@lovrabet/cli 1.3.2-beta.1 → 1.3.2

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 (80) 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-flags.js +1 -1
  31. package/lib/cli.js +1 -1
  32. package/lib/cmd/build-watch.js +1 -1
  33. package/lib/cmd/build.js +1 -1
  34. package/lib/cmd/logs.js +1 -1
  35. package/lib/cmd/preview.js +1 -1
  36. package/lib/cmd/start.js +1 -1
  37. package/lib/config/config-help.js +1 -1
  38. package/lib/config/main.js +1 -1
  39. package/lib/constant/domain.js +1 -1
  40. package/lib/constant/env.js +1 -1
  41. package/lib/create-app/enhanced-guided-create.js +1 -1
  42. package/lib/create-app/format-elapsed.js +1 -1
  43. package/lib/create-app/main.js +1 -1
  44. package/lib/create-app/non-interactive.js +1 -1
  45. package/lib/create-app/task-finished.js +1 -1
  46. package/lib/create-app/task-loading.js +1 -1
  47. package/lib/create-app/task-running.js +1 -1
  48. package/lib/create-app/task-time.js +1 -1
  49. package/lib/create-app/use-copy-project-template.js +1 -1
  50. package/lib/create-app/use-format-code.js +1 -1
  51. package/lib/create-app/use-install-dependencies.js +1 -1
  52. package/lib/help.js +1 -1
  53. package/lib/init/main.js +1 -1
  54. package/lib/mcp/McpInstallUI.js +1 -1
  55. package/lib/mcp/claude.js +1 -1
  56. package/lib/mcp/cursor.js +1 -1
  57. package/lib/mcp/main.js +1 -1
  58. package/lib/mcp/mcp-install-non-interactive.js +1 -1
  59. package/lib/mcp/mcp-installer.js +1 -1
  60. package/lib/skills/SkillInstallUI.js +1 -1
  61. package/lib/skills/main.js +1 -1
  62. package/lib/skills/skill-install-non-interactive.js +1 -1
  63. package/lib/skills/skill-installer.js +1 -1
  64. package/lib/ui/IDESelector.js +1 -1
  65. package/lib/ui/useIDESelection.js +1 -1
  66. package/lib/utils/ai_config.js +1 -1
  67. package/lib/utils/cdn-config.js +1 -1
  68. package/lib/utils/check-sdk-version.js +1 -1
  69. package/lib/utils/cli-version-check.js +1 -1
  70. package/lib/utils/config.js +1 -1
  71. package/lib/utils/copy-directory.js +1 -1
  72. package/lib/utils/file-utils.js +1 -1
  73. package/lib/utils/guides-cdn.js +1 -1
  74. package/lib/utils/http-client.js +1 -1
  75. package/lib/utils/logger.js +1 -1
  76. package/lib/utils/router-updater.js +1 -1
  77. package/lib/utils/rules-cdn.js +1 -1
  78. package/lib/utils/sleep.js +1 -1
  79. package/lib/utils/template-replacer.js +1 -1
  80. package/package.json +1 -1
@@ -1 +1 @@
1
- (function(_0x3609f7,_0x1c8d35){const _0x8c5687=a0_0x55aa,_0x275288=_0x3609f7();while(!![]){try{const _0x52e816=-parseInt(_0x8c5687(0xd3))/0x1+-parseInt(_0x8c5687(0xe1))/0x2*(-parseInt(_0x8c5687(0xe3))/0x3)+-parseInt(_0x8c5687(0xc9))/0x4*(-parseInt(_0x8c5687(0xdc))/0x5)+parseInt(_0x8c5687(0xdb))/0x6*(parseInt(_0x8c5687(0xe0))/0x7)+parseInt(_0x8c5687(0xcd))/0x8+parseInt(_0x8c5687(0xd2))/0x9+-parseInt(_0x8c5687(0xcf))/0xa*(parseInt(_0x8c5687(0xd0))/0xb);if(_0x52e816===_0x1c8d35)break;else _0x275288['push'](_0x275288['shift']());}catch(_0x21c8b8){_0x275288['push'](_0x275288['shift']());}}}(a0_0x9f93,0xd31b9));function a0_0x55aa(_0x208151,_0x56f2c1){_0x208151=_0x208151-0xc8;const _0x9f93e2=a0_0x9f93();let _0x55aa02=_0x9f93e2[_0x208151];return _0x55aa02;}import{jsx as a0_0x66fcba,jsxs as a0_0x20be13}from'react/jsx-runtime';import{useState}from'react';function a0_0x9f93(){const _0x9cdc2b=['页面路径不合法','页面路径\x20','路径不能包含连续的\x20/','delete','green','152982NucZZt','75FKSWsX','页面路径长度不能超过\x20100\x20个字符','trim','column','259uOevHg','3065182mGHgvN','startsWith','3EkWZlg','路径不能以\x20/\x20开头或结尾','路径中的每个段只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','slice','includes','existsSync','red','254028rFJjWc','length','endsWith','backspace','11268200qsUNqV','test','30xglqdp','15828791hhrHNS','split','6686226DtdHTn','398384takmVj','return','gray'];a0_0x9f93=function(){return _0x9cdc2b;};return a0_0x9f93();}import{Text,Box,useInput}from'ink';import a0_0x358fbc from'node:fs';export function InputProjectCode(_0x3b6f67){const _0xa266c7=a0_0x55aa,{onSubmit:_0x4a01db,pagePath:_0xf1d5ea}=_0x3b6f67,[_0x384fac,_0x4b140d]=useState(''),[_0x29bca9,_0x10c5c1]=useState(''),_0x2a8d4e='my-page';function _0x5e27b6(_0x2151dc){const _0x4a6503=a0_0x55aa;if(_0x2151dc[_0x4a6503(0xca)]>0x64)return{'valid':![],'message':_0x4a6503(0xdd)};if(_0x2151dc[_0x4a6503(0xe2)]('/')||_0x2151dc[_0x4a6503(0xcb)]('/'))return{'valid':![],'message':_0x4a6503(0xe4)};if(_0x2151dc[_0x4a6503(0xe7)]('//'))return{'valid':![],'message':_0x4a6503(0xd8)};const _0x368ecc=_0x2151dc[_0x4a6503(0xd1)]('/');for(const _0x38a35b of _0x368ecc){if(!_0x38a35b)continue;const _0x5c233a=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(!_0x5c233a[_0x4a6503(0xce)](_0x38a35b))return{'valid':![],'message':_0x4a6503(0xe5)};}return{'valid':!![]};}return useInput((_0x4f6e23,_0x746a77)=>{const _0x2d838a=a0_0x55aa;if(_0x746a77[_0x2d838a(0xd4)]){const _0x428761=_0x384fac[_0x2d838a(0xde)]()||_0x2a8d4e;if(_0x29bca9)return;const _0x337346=_0xf1d5ea+'/'+_0x428761;if(a0_0x358fbc[_0x2d838a(0xe8)](_0x337346)){_0x10c5c1(_0x2d838a(0xd7)+_0x428761+'\x20已存在,请使用其他路径');return;}_0x4a01db(_0x428761),_0x4b140d(''),_0x10c5c1('');}else _0x746a77[_0x2d838a(0xcc)]||_0x746a77[_0x2d838a(0xd9)]?_0x4b140d(_0x3a09f8=>{const _0x13abab=_0x2d838a,_0x25332e=_0x3a09f8[_0x13abab(0xe6)](0x0,-0x1),{valid:_0x1bc795,message:_0x4f821b}=_0x5e27b6(_0x25332e);return _0x10c5c1(_0x1bc795?'':_0x4f821b||'页面路径不合法'),_0x25332e;}):_0x4b140d(_0x3b36e4=>{const _0x2dac0c=_0x2d838a,_0x17fa08=_0x3b36e4+_0x4f6e23,{valid:_0x4a16bb,message:_0x276b62}=_0x5e27b6(_0x17fa08);return _0x10c5c1(_0x4a16bb?'':_0x276b62||_0x2dac0c(0xd6)),_0x17fa08;});}),a0_0x20be13(Box,{'flexDirection':_0xa266c7(0xdf),'children':[a0_0x20be13(Box,{'children':[a0_0x66fcba(Text,{'color':_0xa266c7(0xd5),'children':'\x20Step2:\x20'}),a0_0x66fcba(Text,{'children':'页面路由地址:\x20'}),_0x384fac?a0_0x66fcba(Text,{'color':_0xa266c7(0xda),'children':_0x384fac}):a0_0x66fcba(Text,{'color':'gray','children':_0x2a8d4e}),_0x29bca9&&a0_0x20be13(Text,{'color':_0xa266c7(0xc8),'children':['\x20←\x20',_0x29bca9]})]}),!_0x29bca9&&!_0x384fac&&a0_0x66fcba(Box,{'children':a0_0x66fcba(Text,{'color':_0xa266c7(0xd5),'children':'\x20直接回车确认,或输入自定义路由地址'})})]});}
1
+ function a0_0x3c67(_0x1674b1,_0x173f5e){_0x1674b1=_0x1674b1-0x69;const _0x4b2515=a0_0x4b25();let _0x3c672e=_0x4b2515[_0x1674b1];return _0x3c672e;}(function(_0x54dfc7,_0x466fc5){const _0x2ba359=a0_0x3c67,_0x2bb85a=_0x54dfc7();while(!![]){try{const _0x4c67f5=-parseInt(_0x2ba359(0x73))/0x1+-parseInt(_0x2ba359(0x79))/0x2+-parseInt(_0x2ba359(0x70))/0x3*(parseInt(_0x2ba359(0x7b))/0x4)+parseInt(_0x2ba359(0x86))/0x5*(-parseInt(_0x2ba359(0x6b))/0x6)+parseInt(_0x2ba359(0x8a))/0x7*(parseInt(_0x2ba359(0x74))/0x8)+parseInt(_0x2ba359(0x6e))/0x9+parseInt(_0x2ba359(0x80))/0xa;if(_0x4c67f5===_0x466fc5)break;else _0x2bb85a['push'](_0x2bb85a['shift']());}catch(_0x1acf2b){_0x2bb85a['push'](_0x2bb85a['shift']());}}}(a0_0x4b25,0x22936));import{jsx as a0_0x2524fa,jsxs as a0_0x108e7c}from'react/jsx-runtime';import{useState}from'react';function a0_0x4b25(){const _0x1b2327=['startsWith','454530BbJLcf','\x20←\x20','107760pooFFW','delete','\x20Step2:\x20','includes','路径不能包含连续的\x20/','4540240aqcdzT','slice','gray','test','length','column','15275CfuhWj','\x20直接回车确认,或输入自定义路由地址','split','red','55363qybxun','页面路由地址:\x20','页面路径不合法','return','138GFgRLQ','路径中的每个段只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','页面路径长度不能超过\x20100\x20个字符','1844955fWhdWn','backspace','24BWXPPL','trim','\x20已存在,请使用其他路径','146709qePSHF','144guwfBc','路径不能以\x20/\x20开头或结尾','green','页面路径\x20'];a0_0x4b25=function(){return _0x1b2327;};return a0_0x4b25();}import{Text,Box,useInput}from'ink';import a0_0x553fff from'node:fs';export function InputProjectCode(_0x3dcbda){const _0x53f18e=a0_0x3c67,{onSubmit:_0x9acde8,pagePath:_0x448fbd}=_0x3dcbda,[_0x737c8b,_0x2fffa9]=useState(''),[_0xd31d1c,_0x33589f]=useState(''),_0x5c596c='my-page';function _0x125ad1(_0x118992){const _0x36d99c=a0_0x3c67;if(_0x118992[_0x36d99c(0x84)]>0x64)return{'valid':![],'message':_0x36d99c(0x6d)};if(_0x118992[_0x36d99c(0x78)]('/')||_0x118992['endsWith']('/'))return{'valid':![],'message':_0x36d99c(0x75)};if(_0x118992[_0x36d99c(0x7e)]('//'))return{'valid':![],'message':_0x36d99c(0x7f)};const _0x15cbe9=_0x118992[_0x36d99c(0x88)]('/');for(const _0xbb95ae of _0x15cbe9){if(!_0xbb95ae)continue;const _0x45debf=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(!_0x45debf[_0x36d99c(0x83)](_0xbb95ae))return{'valid':![],'message':_0x36d99c(0x6c)};}return{'valid':!![]};}return useInput((_0x26af1f,_0x59d2ca)=>{const _0x3a8657=a0_0x3c67;if(_0x59d2ca[_0x3a8657(0x6a)]){const _0x59a873=_0x737c8b[_0x3a8657(0x71)]()||_0x5c596c;if(_0xd31d1c)return;const _0x5f1334=_0x448fbd+'/'+_0x59a873;if(a0_0x553fff['existsSync'](_0x5f1334)){_0x33589f(_0x3a8657(0x77)+_0x59a873+_0x3a8657(0x72));return;}_0x9acde8(_0x59a873),_0x2fffa9(''),_0x33589f('');}else _0x59d2ca[_0x3a8657(0x6f)]||_0x59d2ca[_0x3a8657(0x7c)]?_0x2fffa9(_0xa670d8=>{const _0x26946c=_0x3a8657,_0x121b4e=_0xa670d8[_0x26946c(0x81)](0x0,-0x1),{valid:_0x4e51d1,message:_0x2e05d4}=_0x125ad1(_0x121b4e);return _0x33589f(_0x4e51d1?'':_0x2e05d4||_0x26946c(0x69)),_0x121b4e;}):_0x2fffa9(_0x3751ee=>{const _0xa03254=_0x3a8657,_0x3bd871=_0x3751ee+_0x26af1f,{valid:_0x22115a,message:_0xf47a85}=_0x125ad1(_0x3bd871);return _0x33589f(_0x22115a?'':_0xf47a85||_0xa03254(0x69)),_0x3bd871;});}),a0_0x108e7c(Box,{'flexDirection':_0x53f18e(0x85),'children':[a0_0x108e7c(Box,{'children':[a0_0x2524fa(Text,{'color':_0x53f18e(0x82),'children':_0x53f18e(0x7d)}),a0_0x2524fa(Text,{'children':_0x53f18e(0x8b)}),_0x737c8b?a0_0x2524fa(Text,{'color':_0x53f18e(0x76),'children':_0x737c8b}):a0_0x2524fa(Text,{'color':_0x53f18e(0x82),'children':_0x5c596c}),_0xd31d1c&&a0_0x108e7c(Text,{'color':_0x53f18e(0x89),'children':[_0x53f18e(0x7a),_0xd31d1c]})]}),!_0xd31d1c&&!_0x737c8b&&a0_0x2524fa(Box,{'children':a0_0x2524fa(Text,{'color':_0x53f18e(0x82),'children':_0x53f18e(0x87)})})]});}
@@ -1 +1 @@
1
- const a1_0x5a59e2=a1_0x49a8;(function(_0x1cd281,_0x28c02e){const _0x55b671=a1_0x49a8,_0x48f67a=_0x1cd281();while(!![]){try{const _0x3550f7=parseInt(_0x55b671(0x1bb))/0x1+parseInt(_0x55b671(0x19e))/0x2+parseInt(_0x55b671(0x1bf))/0x3*(parseInt(_0x55b671(0x1af))/0x4)+parseInt(_0x55b671(0x19f))/0x5*(parseInt(_0x55b671(0x1a7))/0x6)+-parseInt(_0x55b671(0x1b7))/0x7*(-parseInt(_0x55b671(0x1b3))/0x8)+-parseInt(_0x55b671(0x1a1))/0x9*(parseInt(_0x55b671(0x1c2))/0xa)+parseInt(_0x55b671(0x1a8))/0xb*(-parseInt(_0x55b671(0x1b2))/0xc);if(_0x3550f7===_0x28c02e)break;else _0x48f67a['push'](_0x48f67a['shift']());}catch(_0x52e2d2){_0x48f67a['push'](_0x48f67a['shift']());}}}(a1_0x5537,0x2040e));import{jsx as a1_0x1e420d,jsxs as a1_0x1d5f9c,Fragment as a1_0x3184b1}from'react/jsx-runtime';import{fileURLToPath}from'node:url';import a1_0x3148a7 from'node:path';function a1_0x49a8(_0x124b42,_0x66f8de){_0x124b42=_0x124b42-0x19d;const _0x5537f3=a1_0x5537();let _0x49a84f=_0x5537f3[_0x124b42];return _0x49a84f;}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';function a1_0x5537(){const _0xfee0d=['已输入的页面路由\x20','error','12EqUDYZ','352552NGNqXe','pages','gray','resolve','21vRarbb','开始添加页面:\x20','catch','join','100675WFdxdG','已选择页面模板\x20','cwd','../../templates/pages','92955PSPgDP','green','column','2484470jjjFCA','finally','setLogPath','src','224410bYxRdd','5StxtGb','页面添加成功:\x20','9YPTSiG','now','正在创建页面,请稍候…','dirname','\x20Step2:\x20','add-page','250692brLpbB','1773607KAgOVu','\x20*\x20路由地址:\x20','message','processTemplate','\x20*\x20页面创建成功!','then','cyan','20retuTP'];a1_0x5537=function(){return _0xfee0d;};return a1_0x5537();}const __dirname=a1_0x3148a7[a1_0x5a59e2(0x1a4)](fileURLToPath(import.meta.url)),pageTemplateDir=a1_0x3148a7[a1_0x5a59e2(0x1b6)](__dirname,a1_0x5a59e2(0x1be)),projectDir=process['cwd']();export const AddPage=()=>{const _0x3a3d0f=a1_0x5a59e2,{exit:_0x4ef086}=useApp(),[_0x50bacb,_0x378fa6]=useState(''),[_0x52be35,_0x339f55]=useState(''),[_0x2fe066,_0x5ae1b0]=useState(![]),[_0x535248,_0xb58ca7]=useState(![]),_0x1119b2=a1_0x3148a7['join'](projectDir,_0x3a3d0f(0x19d),_0x3a3d0f(0x1b4)),_0x54fbfb=a1_0x3148a7[_0x3a3d0f(0x1ba)](_0x1119b2,_0x52be35),_0x38a6da=a1_0x3148a7['join']('src',_0x3a3d0f(0x1b4),_0x52be35);useEffect(()=>{const _0x282784=_0x3a3d0f,_0x34770c=a1_0x3148a7['resolve'](pageTemplateDir,_0x50bacb);if(_0x50bacb&&_0x52be35){_0x5ae1b0(!![]),logger[_0x282784(0x1c4)](process[_0x282784(0x1bd)]());const _0x3682f3=Date['now']();logger['info']('add-page',_0x282784(0x1b8)+_0x52be35,{'template':_0x50bacb,'targetPath':_0x38a6da}),TemplateReplacer[_0x282784(0x1ab)](_0x34770c,a1_0x3148a7[_0x282784(0x1ba)](_0x1119b2,_0x52be35),_0x52be35,_0x50bacb)[_0x282784(0x1ad)](()=>{const _0x49e568=_0x282784,_0x58b599=Date[_0x49e568(0x1a2)]()-_0x3682f3;logger['success'](_0x49e568(0x1a6),_0x49e568(0x1a0)+_0x52be35,_0x58b599,{'template':_0x50bacb,'targetPath':_0x38a6da,'routePath':_0x52be35}),_0xb58ca7(!![]);})[_0x282784(0x1b9)](_0x3bfe79=>{const _0x58eee7=_0x282784,_0x5c7182=Date[_0x58eee7(0x1a2)]()-_0x3682f3;logger[_0x58eee7(0x1b1)](_0x58eee7(0x1a6),'页面添加失败:\x20'+_0x52be35,{'template':_0x50bacb,'targetPath':_0x38a6da,'error':_0x3bfe79 instanceof Error?_0x3bfe79[_0x58eee7(0x1aa)]:String(_0x3bfe79),'duration':_0x5c7182});})[_0x282784(0x1c3)](()=>{_0x5ae1b0(![]);});}},[_0x50bacb,_0x52be35]),useEffect(()=>{_0x535248&&setTimeout(()=>{_0x4ef086();});},[_0x535248]);if(_0x50bacb)return a1_0x1d5f9c(Box,{'flexDirection':_0x3a3d0f(0x1c1),'paddingY':0x1,'children':[a1_0x1d5f9c(Box,{'children':[a1_0x1e420d(Text,{'color':_0x3a3d0f(0x1b5),'children':'\x20Step1:\x20'}),a1_0x1e420d(Text,{'children':_0x3a3d0f(0x1bc)}),a1_0x1e420d(Text,{'color':_0x3a3d0f(0x1c0),'children':_0x50bacb})]}),_0x52be35?a1_0x1d5f9c(Box,{'children':[a1_0x1e420d(Text,{'color':_0x3a3d0f(0x1b5),'children':_0x3a3d0f(0x1a5)}),a1_0x1e420d(Text,{'children':_0x3a3d0f(0x1b0)}),a1_0x1e420d(Text,{'color':_0x3a3d0f(0x1c0),'children':_0x52be35})]}):a1_0x1e420d(InputProjectCode,{'pagePath':_0x54fbfb,'onSubmit':_0x339f55}),_0x52be35&&_0x2fe066?a1_0x1d5f9c(Box,{'marginTop':0x1,'children':[a1_0x1e420d(Box,{'width':'4'}),a1_0x1e420d(Text,{'children':_0x3a3d0f(0x1a3)})]}):null,_0x535248?a1_0x1d5f9c(a1_0x3184b1,{'children':[a1_0x1e420d(Box,{'marginTop':0x1,'children':a1_0x1e420d(Text,{'color':_0x3a3d0f(0x1b5),'children':_0x3a3d0f(0x1ac)})}),a1_0x1d5f9c(Box,{'children':[a1_0x1e420d(Text,{'color':_0x3a3d0f(0x1b5),'children':'\x20*\x20页面路径:\x20'}),a1_0x1e420d(Text,{'color':'green','children':_0x38a6da})]}),a1_0x1d5f9c(Box,{'children':[a1_0x1e420d(Text,{'color':'gray','children':_0x3a3d0f(0x1a9)}),a1_0x1d5f9c(Text,{'color':'green','children':['/',_0x52be35]})]}),a1_0x1e420d(Box,{'marginTop':0x1,'children':a1_0x1e420d(Text,{'color':_0x3a3d0f(0x1ae),'children':'\x20*\x20页面文件已创建,可直接通过路由访问'})})]}):null]});return a1_0x1e420d(SelectPageTemplate,{'onSelect':_0x378fa6});};
1
+ function a1_0x575e(){const _0x1d31ef=['finally','14260455PpcxNp','cwd','join','column','pages','1563464ZHNJwd','\x20Step2:\x20','\x20*\x20页面创建成功!','6zcUCWf','\x20Step1:\x20','开始添加页面:\x20','success','cyan','info','error','\x20*\x20页面文件已创建,可直接通过路由访问','add-page','页面添加成功:\x20','56DGftBm','gray','已输入的页面路由\x20','src','页面添加失败:\x20','97592vqCsiO','processTemplate','4121192lnSkqE','catch','5155220VFivoJ','正在创建页面,请稍候…','now','1570934dxFvBF','green','\x20*\x20路由地址:\x20','\x20*\x20页面路径:\x20','resolve','2002884OvIHrE','message'];a1_0x575e=function(){return _0x1d31ef;};return a1_0x575e();}const a1_0x264e6f=a1_0x365e;(function(_0x2930fe,_0x385d52){const _0x222370=a1_0x365e,_0x5b19ea=_0x2930fe();while(!![]){try{const _0x534af8=parseInt(_0x222370(0x95))/0x1+-parseInt(_0x222370(0x8e))/0x2+-parseInt(_0x222370(0x9a))/0x3+-parseInt(_0x222370(0x90))/0x4+-parseInt(_0x222370(0x92))/0x5*(-parseInt(_0x222370(0x7f))/0x6)+parseInt(_0x222370(0x89))/0x7*(parseInt(_0x222370(0x7c))/0x8)+-parseInt(_0x222370(0x9d))/0x9;if(_0x534af8===_0x385d52)break;else _0x5b19ea['push'](_0x5b19ea['shift']());}catch(_0xc1bf9a){_0x5b19ea['push'](_0x5b19ea['shift']());}}}(a1_0x575e,0xcbab1));function a1_0x365e(_0x46f717,_0xd0dbbb){_0x46f717=_0x46f717-0x7c;const _0x575ee9=a1_0x575e();let _0x365ef8=_0x575ee9[_0x46f717];return _0x365ef8;}import{jsx as a1_0x4ef507,jsxs as a1_0x3fcd87,Fragment as a1_0xb81f6f}from'react/jsx-runtime';import{fileURLToPath}from'node:url';import a1_0x36fc57 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_0x36fc57['dirname'](fileURLToPath(import.meta.url)),pageTemplateDir=a1_0x36fc57[a1_0x264e6f(0x99)](__dirname,'../../templates/pages'),projectDir=process[a1_0x264e6f(0x9e)]();export const AddPage=()=>{const _0x39d04e=a1_0x264e6f,{exit:_0x56af32}=useApp(),[_0x5054ea,_0xe91f68]=useState(''),[_0x565eb6,_0x16f62e]=useState(''),[_0x28af0c,_0x33a7ad]=useState(![]),[_0xe06162,_0x3c65a5]=useState(![]),_0x214a16=a1_0x36fc57[_0x39d04e(0x9f)](projectDir,_0x39d04e(0x8c),_0x39d04e(0xa1)),_0x4694d8=a1_0x36fc57[_0x39d04e(0x9f)](_0x214a16,_0x565eb6),_0x3e4303=a1_0x36fc57['join'](_0x39d04e(0x8c),_0x39d04e(0xa1),_0x565eb6);useEffect(()=>{const _0x521b87=_0x39d04e,_0x4b5e73=a1_0x36fc57[_0x521b87(0x99)](pageTemplateDir,_0x5054ea);if(_0x5054ea&&_0x565eb6){_0x33a7ad(!![]),logger['setLogPath'](process[_0x521b87(0x9e)]());const _0x342e15=Date[_0x521b87(0x94)]();logger[_0x521b87(0x84)]('add-page',_0x521b87(0x81)+_0x565eb6,{'template':_0x5054ea,'targetPath':_0x3e4303}),TemplateReplacer[_0x521b87(0x8f)](_0x4b5e73,a1_0x36fc57['join'](_0x214a16,_0x565eb6),_0x565eb6,_0x5054ea)['then'](()=>{const _0x443c00=_0x521b87,_0x29abac=Date[_0x443c00(0x94)]()-_0x342e15;logger[_0x443c00(0x82)](_0x443c00(0x87),_0x443c00(0x88)+_0x565eb6,_0x29abac,{'template':_0x5054ea,'targetPath':_0x3e4303,'routePath':_0x565eb6}),_0x3c65a5(!![]);})[_0x521b87(0x91)](_0x3eef11=>{const _0x20c19e=_0x521b87,_0x1b9107=Date[_0x20c19e(0x94)]()-_0x342e15;logger[_0x20c19e(0x85)](_0x20c19e(0x87),_0x20c19e(0x8d)+_0x565eb6,{'template':_0x5054ea,'targetPath':_0x3e4303,'error':_0x3eef11 instanceof Error?_0x3eef11[_0x20c19e(0x9b)]:String(_0x3eef11),'duration':_0x1b9107});})[_0x521b87(0x9c)](()=>{_0x33a7ad(![]);});}},[_0x5054ea,_0x565eb6]),useEffect(()=>{_0xe06162&&setTimeout(()=>{_0x56af32();});},[_0xe06162]);if(_0x5054ea)return a1_0x3fcd87(Box,{'flexDirection':_0x39d04e(0xa0),'paddingY':0x1,'children':[a1_0x3fcd87(Box,{'children':[a1_0x4ef507(Text,{'color':'gray','children':_0x39d04e(0x80)}),a1_0x4ef507(Text,{'children':'已选择页面模板\x20'}),a1_0x4ef507(Text,{'color':'green','children':_0x5054ea})]}),_0x565eb6?a1_0x3fcd87(Box,{'children':[a1_0x4ef507(Text,{'color':_0x39d04e(0x8a),'children':_0x39d04e(0x7d)}),a1_0x4ef507(Text,{'children':_0x39d04e(0x8b)}),a1_0x4ef507(Text,{'color':_0x39d04e(0x96),'children':_0x565eb6})]}):a1_0x4ef507(InputProjectCode,{'pagePath':_0x4694d8,'onSubmit':_0x16f62e}),_0x565eb6&&_0x28af0c?a1_0x3fcd87(Box,{'marginTop':0x1,'children':[a1_0x4ef507(Box,{'width':'4'}),a1_0x4ef507(Text,{'children':_0x39d04e(0x93)})]}):null,_0xe06162?a1_0x3fcd87(a1_0xb81f6f,{'children':[a1_0x4ef507(Box,{'marginTop':0x1,'children':a1_0x4ef507(Text,{'color':'gray','children':_0x39d04e(0x7e)})}),a1_0x3fcd87(Box,{'children':[a1_0x4ef507(Text,{'color':_0x39d04e(0x8a),'children':_0x39d04e(0x98)}),a1_0x4ef507(Text,{'color':_0x39d04e(0x96),'children':_0x3e4303})]}),a1_0x3fcd87(Box,{'children':[a1_0x4ef507(Text,{'color':_0x39d04e(0x8a),'children':_0x39d04e(0x97)}),a1_0x3fcd87(Text,{'color':_0x39d04e(0x96),'children':['/',_0x565eb6]})]}),a1_0x4ef507(Box,{'marginTop':0x1,'children':a1_0x4ef507(Text,{'color':_0x39d04e(0x83),'children':_0x39d04e(0x86)})})]}):null]});return a1_0x4ef507(SelectPageTemplate,{'onSelect':_0xe91f68});};
@@ -1 +1 @@
1
- function a2_0x5228(_0x4b0483,_0x3ee8ec){_0x4b0483=_0x4b0483-0x79;const _0x534cf4=a2_0x534c();let _0x5228f3=_0x534cf4[_0x4b0483];return _0x5228f3;}(function(_0x1f6808,_0x5e5a4d){const _0x417342=a2_0x5228,_0x42fd65=_0x1f6808();while(!![]){try{const _0x52f3c8=parseInt(_0x417342(0x7b))/0x1+parseInt(_0x417342(0x84))/0x2+parseInt(_0x417342(0x81))/0x3*(-parseInt(_0x417342(0x92))/0x4)+-parseInt(_0x417342(0x98))/0x5+-parseInt(_0x417342(0x8a))/0x6*(-parseInt(_0x417342(0x79))/0x7)+parseInt(_0x417342(0x99))/0x8*(-parseInt(_0x417342(0x97))/0x9)+-parseInt(_0x417342(0x7c))/0xa;if(_0x52f3c8===_0x5e5a4d)break;else _0x42fd65['push'](_0x42fd65['shift']());}catch(_0x4a71e5){_0x42fd65['push'](_0x42fd65['shift']());}}}(a2_0x534c,0x26022));import{jsx as a2_0x2d3d5f,jsxs as a2_0x476737}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Text,Box,useInput}from'ink';import{readdir}from'node:fs/promises';import a2_0x217eaf from'node:path';import{fileURLToPath}from'node:url';async function getTemplateList(){const _0x155e76=a2_0x5228;try{const _0x58c238=fileURLToPath(import.meta.url),_0x386c67=a2_0x217eaf['resolve'](a2_0x217eaf[_0x155e76(0x8d)](_0x58c238),_0x155e76(0x7f)),_0x5737e9=a2_0x217eaf[_0x155e76(0x85)](_0x386c67,_0x155e76(0x91)),_0x2a2820=await readdir(_0x5737e9,{'withFileTypes':!![]}),_0x16bacd=_0x2a2820[_0x155e76(0x8b)](_0x23a5bf=>_0x23a5bf[_0x155e76(0x7d)]())[_0x155e76(0x86)](_0x5e6a49=>({'label':_0x5e6a49['name']}))['sort']((_0x2c4907,_0x14d58e)=>_0x2c4907[_0x155e76(0x88)][_0x155e76(0x7e)](_0x14d58e['label']));return _0x16bacd;}catch(_0x5a03e6){return console[_0x155e76(0x83)](_0x155e76(0x94),_0x5a03e6),[{'label':'blank'},{'label':_0x155e76(0x8f)}];}}export function SelectPageTemplate(_0x1aa748){const _0xffb7e3=a2_0x5228,[_0x2d710f,_0x398fa0]=useState(0x0),[_0x20d68f,_0x398811]=useState([]),[_0x50cbc2,_0x2fce2d]=useState(!![]);useEffect(()=>{async function _0x48ee40(){const _0x45a76f=await getTemplateList();_0x398811(_0x45a76f),_0x2fce2d(![]);}_0x48ee40();},[]),useInput((_0x29aec7,_0x405248)=>{const _0x2c2a00=a2_0x5228;if(_0x50cbc2)return;if(_0x405248[_0x2c2a00(0x93)]){const _0x42beef=_0x20d68f[_0x2d710f];_0x42beef&&_0x1aa748[_0x2c2a00(0x7a)](_0x42beef[_0x2c2a00(0x88)]);}_0x405248[_0x2c2a00(0x89)]&&_0x398fa0(_0x50aac3=>_0x50aac3===0x0?_0x20d68f[_0x2c2a00(0x96)]-0x1:_0x50aac3-0x1),_0x405248[_0x2c2a00(0x90)]&&_0x398fa0(_0x5dd2fc=>_0x5dd2fc===_0x20d68f[_0x2c2a00(0x96)]-0x1?0x0:_0x5dd2fc+0x1);});if(_0x50cbc2)return a2_0x2d3d5f(Box,{'flexDirection':_0xffb7e3(0x82),'paddingY':0x1,'children':a2_0x476737(Box,{'children':[a2_0x2d3d5f(Text,{'color':_0xffb7e3(0x80),'children':_0xffb7e3(0x87)}),a2_0x2d3d5f(Text,{'children':'正在加载页面模板...'})]})});return a2_0x476737(Box,{'flexDirection':'column','paddingY':0x1,'children':[a2_0x476737(Box,{'children':[a2_0x2d3d5f(Text,{'color':'gray','children':_0xffb7e3(0x87)}),a2_0x2d3d5f(Text,{'children':_0xffb7e3(0x8e)})]}),_0x20d68f[_0xffb7e3(0x86)]((_0x1d1261,_0x4cb71a)=>{const _0x5130f3=_0xffb7e3,_0x752db0=_0x4cb71a===_0x2d710f,_0x4e1042=_0x752db0?'\x20\x20\x20\x20\x20\x20>\x20'+_0x1d1261[_0x5130f3(0x88)]:_0x5130f3(0x95)+_0x1d1261[_0x5130f3(0x88)];return a2_0x2d3d5f(Box,{'children':a2_0x2d3d5f(Text,{'color':_0x752db0?_0x5130f3(0x8c):undefined,'children':_0x4e1042})},_0x4e1042);})]});}function a2_0x534c(){const _0x3d6af3=['map','\x20Step1:\x20','label','upArrow','46356JOmexT','filter','green','dirname','请选择您要创建的页面模板','sdk-fetch','downArrow','templates/pages','692268AkyibE','return','获取模板列表失败:','\x20\x20\x20\x20\x20\x20\x20\x20','length','36uWcOsa','852440FANiPl','124576cGhHms','259KVmxnS','onSelect','201618PtkBWB','826990KzJEDk','isDirectory','localeCompare','../..','gray','3LuMTlO','column','error','313488ddWFav','join'];a2_0x534c=function(){return _0x3d6af3;};return a2_0x534c();}
1
+ (function(_0x18c943,_0x3c0714){const _0x5cc29f=a2_0x51ec,_0x58a938=_0x18c943();while(!![]){try{const _0x5948dd=parseInt(_0x5cc29f(0xfb))/0x1+-parseInt(_0x5cc29f(0x10b))/0x2*(-parseInt(_0x5cc29f(0xfd))/0x3)+parseInt(_0x5cc29f(0x103))/0x4+parseInt(_0x5cc29f(0x11c))/0x5+-parseInt(_0x5cc29f(0x101))/0x6*(parseInt(_0x5cc29f(0x115))/0x7)+parseInt(_0x5cc29f(0x108))/0x8*(-parseInt(_0x5cc29f(0xfe))/0x9)+parseInt(_0x5cc29f(0x102))/0xa*(-parseInt(_0x5cc29f(0x114))/0xb);if(_0x5948dd===_0x3c0714)break;else _0x58a938['push'](_0x58a938['shift']());}catch(_0x271f81){_0x58a938['push'](_0x58a938['shift']());}}}(a2_0x49ff,0x7f15f));import{jsx as a2_0x117de4,jsxs as a2_0x24deb8}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Text,Box,useInput}from'ink';import{readdir}from'node:fs/promises';import a2_0x24a3e1 from'node:path';function a2_0x51ec(_0x4d78f1,_0x2993ea){_0x4d78f1=_0x4d78f1-0xfa;const _0x49fff2=a2_0x49ff();let _0x51ec02=_0x49fff2[_0x4d78f1];return _0x51ec02;}import{fileURLToPath}from'node:url';async function getTemplateList(){const _0x518f3a=a2_0x51ec;try{const _0x513463=fileURLToPath(import.meta.url),_0x5d27bb=a2_0x24a3e1[_0x518f3a(0xfa)](a2_0x24a3e1[_0x518f3a(0x118)](_0x513463),_0x518f3a(0x113)),_0x3b86f3=a2_0x24a3e1[_0x518f3a(0x11b)](_0x5d27bb,'templates/pages'),_0x3b019e=await readdir(_0x3b86f3,{'withFileTypes':!![]}),_0x202f7a=_0x3b019e[_0x518f3a(0x10a)](_0x18bd46=>_0x18bd46[_0x518f3a(0x10c)]())['map'](_0x4e1fcb=>({'label':_0x4e1fcb[_0x518f3a(0x11d)]}))[_0x518f3a(0x11a)]((_0x1e33e5,_0x25bbb9)=>_0x1e33e5[_0x518f3a(0x100)]['localeCompare'](_0x25bbb9[_0x518f3a(0x100)]));return _0x202f7a;}catch(_0x5e8210){return console[_0x518f3a(0x119)](_0x518f3a(0xfc),_0x5e8210),[{'label':_0x518f3a(0xff)},{'label':_0x518f3a(0x10d)}];}}function a2_0x49ff(){const _0x254b3d=['join','2503055osqaIk','name','resolve','307091riNuyf','获取模板列表失败:','3QzyTDQ','45QoVOjw','blank','label','42318wzNsaC','3175450mOQTTc','4039220RazMLP','\x20Step1:\x20','map','column','请选择您要创建的页面模板','1379080XmzIyD','downArrow','filter','1824488sgDyNN','isDirectory','sdk-fetch','正在加载页面模板...','return','gray','\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20\x20\x20\x20\x20>\x20','../..','11OBTnNW','1022hcAQeD','green','length','dirname','error','sort'];a2_0x49ff=function(){return _0x254b3d;};return a2_0x49ff();}export function SelectPageTemplate(_0x44c7cf){const _0x607d1=a2_0x51ec,[_0x4cd8c6,_0x53278a]=useState(0x0),[_0x34959f,_0x1b93e0]=useState([]),[_0x2bbcaa,_0x45f5c3]=useState(!![]);useEffect(()=>{async function _0x12a8f6(){const _0x5e51d8=await getTemplateList();_0x1b93e0(_0x5e51d8),_0x45f5c3(![]);}_0x12a8f6();},[]),useInput((_0x2aac27,_0xbe7bfb)=>{const _0xba6153=a2_0x51ec;if(_0x2bbcaa)return;if(_0xbe7bfb[_0xba6153(0x10f)]){const _0x5a0c3c=_0x34959f[_0x4cd8c6];_0x5a0c3c&&_0x44c7cf['onSelect'](_0x5a0c3c[_0xba6153(0x100)]);}_0xbe7bfb['upArrow']&&_0x53278a(_0x424b69=>_0x424b69===0x0?_0x34959f[_0xba6153(0x117)]-0x1:_0x424b69-0x1),_0xbe7bfb[_0xba6153(0x109)]&&_0x53278a(_0x375bf0=>_0x375bf0===_0x34959f[_0xba6153(0x117)]-0x1?0x0:_0x375bf0+0x1);});if(_0x2bbcaa)return a2_0x117de4(Box,{'flexDirection':_0x607d1(0x106),'paddingY':0x1,'children':a2_0x24deb8(Box,{'children':[a2_0x117de4(Text,{'color':_0x607d1(0x110),'children':_0x607d1(0x104)}),a2_0x117de4(Text,{'children':_0x607d1(0x10e)})]})});return a2_0x24deb8(Box,{'flexDirection':'column','paddingY':0x1,'children':[a2_0x24deb8(Box,{'children':[a2_0x117de4(Text,{'color':_0x607d1(0x110),'children':_0x607d1(0x104)}),a2_0x117de4(Text,{'children':_0x607d1(0x107)})]}),_0x34959f[_0x607d1(0x105)]((_0x487521,_0xba342b)=>{const _0x2b994f=_0x607d1,_0x13807e=_0xba342b===_0x4cd8c6,_0x77ab61=_0x13807e?_0x2b994f(0x112)+_0x487521[_0x2b994f(0x100)]:_0x2b994f(0x111)+_0x487521['label'];return a2_0x117de4(Box,{'children':a2_0x117de4(Text,{'color':_0x13807e?_0x2b994f(0x116):undefined,'children':_0x77ab61})},_0x77ab61);})]});}
@@ -1 +1 @@
1
- const a3_0x108960=a3_0x2d0a;(function(_0x5565e7,_0x27e455){const _0x2c4236=a3_0x2d0a,_0x12d9b1=_0x5565e7();while(!![]){try{const _0x39a483=parseInt(_0x2c4236(0xa7))/0x1+parseInt(_0x2c4236(0xb1))/0x2*(parseInt(_0x2c4236(0xb2))/0x3)+parseInt(_0x2c4236(0xcb))/0x4*(-parseInt(_0x2c4236(0xd0))/0x5)+parseInt(_0x2c4236(0xc5))/0x6+parseInt(_0x2c4236(0xd3))/0x7+parseInt(_0x2c4236(0xca))/0x8+-parseInt(_0x2c4236(0xb9))/0x9;if(_0x39a483===_0x27e455)break;else _0x12d9b1['push'](_0x12d9b1['shift']());}catch(_0x3b9ff7){_0x12d9b1['push'](_0x12d9b1['shift']());}}}(a3_0x554e,0xcc6bf));import{jsx as a3_0x430c4b,jsxs as a3_0xf5bcfe}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Box,Text,useInput,useApp}from'ink';function a3_0x554e(){const _0x1ff513=['*\x20选择要配置的\x20IDE:','gray','133666JVJkks','54uSHIoa','filter','•\x20MCP:\x20让\x20AI\x20直接访问\x20Lovrabet\x20数据集','trae','mcp-','↑/↓:\x20移动\x20空格:\x20切换\x20a:\x20全选\x20q:\x20退出\x20Enter:\x20确认','ide','16724268FOwisj','是否同时配置\x20AI\x20助手?这将:','map','return','请至少选择一个配置项','size','dimColor','cursor','技能包\x20(研发规范指南)','confirming','[N]\x20跳过,稍后手动配置','push','1503534wJoVVI','message','selecting','column','windsurf','10106848iXvppu','84JfIrcC','red','white','[\x20]','cyan','305765YwCdTC','yellow','green','3495730tWEcMG','name','codex','delete','agent','installing','opencode','add','appcode','[✓]','projectRoot','blue','done','success','length','antigravity','downArrow','[Y]\x20是,配置\x20AI\x20助手','claude','763447vpQdgX','error','has','Claude\x20Code','status','codebuddy','Cursor','Enter\x20默认:\x20是'];a3_0x554e=function(){return _0x1ff513;};return a3_0x554e();}import{configureMcp}from'./config.js';function a3_0x2d0a(_0xf65375,_0x28a3f0){_0xf65375=_0xf65375-0x96;const _0x554ef0=a3_0x554e();let _0x2d0a26=_0x554ef0[_0xf65375];return _0x2d0a26;}import{installSkill,copySharedSkills,createSkillManifest,SKILL_IDE_CONFIGS}from'./config.js';const MCP_IDE_LIST=['cursor',a3_0x108960(0xa6)],SKILL_IDE_LIST=[a3_0x108960(0xa3),'claude',a3_0x108960(0xac),a3_0x108960(0x96),a3_0x108960(0xc0),a3_0x108960(0x9a),'qoder',a3_0x108960(0xb5),a3_0x108960(0xc9),a3_0x108960(0x98)];export function AISetupUI({config:_0x31ff72,onComplete:_0x4a6e0a}){const _0x4ea183=a3_0x108960,{exit:_0xa9fbae}=useApp(),[_0x40ac1f,_0x61f7a5]=useState('confirming'),[_0x5ec5e0,_0x25be93]=useState(0x0),[_0x29d797,_0x1c5bef]=useState(new Set([0x0,0x1])),[_0x42479c,_0x1007f3]=useState(new Set(SKILL_IDE_LIST[_0x4ea183(0xbb)]((_0x2b41d4,_0x324fc2)=>_0x324fc2))),[_0x365a9e,_0x595a01]=useState('');useEffect(()=>{!_0x31ff72['appcode']&&_0x4a6e0a({'mcpResults':[],'skillResults':[]});},[_0x31ff72[_0x4ea183(0x9c)],_0x4a6e0a]),useInput((_0xb7809,_0x3b5331)=>{const _0x548b74=_0x4ea183;if(_0x40ac1f===_0x548b74(0xc2)){if(_0xb7809==='y'||_0xb7809==='Y'||_0x3b5331[_0x548b74(0xbc)]){_0x4aa19c();return;}if(_0xb7809==='n'||_0xb7809==='N'){_0x4a6e0a({'mcpResults':[],'skillResults':[]});return;}if(_0x3b5331[_0x548b74(0xbc)]){_0x4aa19c();return;}}if(_0x40ac1f===_0x548b74(0xc7)){if(_0x3b5331['upArrow']){_0x25be93(_0x4bfd64=>_0x4bfd64>0x0?_0x4bfd64-0x1:SKILL_IDE_LIST[_0x548b74(0xa2)]-0x1);return;}if(_0x3b5331[_0x548b74(0xa4)]){_0x25be93(_0x29d8fc=>_0x29d8fc<SKILL_IDE_LIST[_0x548b74(0xa2)]-0x1?_0x29d8fc+0x1:0x0);return;}if(_0xb7809==='\x20'){const _0x3aae42=_0x5ec5e0<MCP_IDE_LIST['length'];if(_0x3aae42){const _0x2632c9=new Set(_0x29d797);_0x2632c9[_0x548b74(0xa9)](_0x5ec5e0)?_0x2632c9[_0x548b74(0x97)](_0x5ec5e0):_0x2632c9['add'](_0x5ec5e0),_0x1c5bef(_0x2632c9);}else{const _0x312f65=_0x5ec5e0-MCP_IDE_LIST[_0x548b74(0xa2)],_0x3cb058=new Set(_0x42479c);_0x3cb058[_0x548b74(0xa9)](_0x312f65)?_0x3cb058[_0x548b74(0x97)](_0x312f65):_0x3cb058[_0x548b74(0x9b)](_0x312f65),_0x1007f3(_0x3cb058);}return;}if(_0xb7809==='a'||_0xb7809==='A'){_0x1c5bef(new Set(MCP_IDE_LIST[_0x548b74(0xbb)]((_0x2723dd,_0x390c48)=>_0x390c48))),_0x1007f3(new Set(SKILL_IDE_LIST[_0x548b74(0xbb)]((_0x39c838,_0x4d031c)=>_0x4d031c)));return;}if(_0xb7809==='q'||_0xb7809==='Q'){_0xa9fbae();return;}if(_0x3b5331[_0x548b74(0xbc)]){if(_0x29d797['size']===0x0&&_0x42479c[_0x548b74(0xbe)]===0x0){_0x595a01(_0x548b74(0xbd));return;}_0x4aa19c();return;}}if(_0x40ac1f==='done'){_0xa9fbae();return;}});async function _0x4aa19c(){const _0x10f5a4=_0x4ea183;_0x61f7a5(_0x10f5a4(0x99));const _0x576515=[],_0x334688=[];for(const _0x750f1e of _0x29d797){const _0x5a4d07=MCP_IDE_LIST[_0x750f1e];if(!_0x5a4d07)continue;try{const _0x581b39=await configureMcp(_0x5a4d07,_0x31ff72['projectRoot']);_0x576515['push'](_0x581b39);}catch(_0x58564b){_0x576515['push']({'ide':MCP_IDE_CONFIGS[_0x5a4d07]?.[_0x10f5a4(0xd4)]||_0x5a4d07,'status':_0x10f5a4(0xa8),'message':_0x58564b instanceof Error?_0x58564b[_0x10f5a4(0xc6)]:String(_0x58564b)});}}await copySharedSkills(_0x31ff72['projectRoot']);for(const _0x49cd3 of _0x42479c){const _0x5e6f62=SKILL_IDE_LIST[_0x49cd3];if(!_0x5e6f62)continue;try{const _0x4fe1ab=await installSkill(_0x5e6f62,_0x31ff72[_0x10f5a4(0x9e)]);_0x334688[_0x10f5a4(0xc4)](_0x4fe1ab);}catch(_0x3094a0){_0x334688['push']({'ide':SKILL_IDE_CONFIGS[_0x5e6f62]?.[_0x10f5a4(0xd4)]||_0x5e6f62,'status':_0x10f5a4(0xa8),'message':_0x3094a0 instanceof Error?_0x3094a0['message']:String(_0x3094a0)});}}if(_0x334688['length']>0x0){const _0x36206b=_0x334688[_0x10f5a4(0xb3)](_0x5326af=>_0x5326af[_0x10f5a4(0xab)]===_0x10f5a4(0xa1))[_0x10f5a4(0xbb)](_0x2bffab=>_0x2bffab[_0x10f5a4(0xb8)]);_0x36206b[_0x10f5a4(0xa2)]>0x0&&createSkillManifest(_0x31ff72[_0x10f5a4(0x9e)],_0x36206b);}_0x61f7a5(_0x10f5a4(0xa0)),setTimeout(()=>{_0x4a6e0a({'mcpResults':_0x576515,'skillResults':_0x334688});},0xbb8);}if(_0x40ac1f===_0x4ea183(0xc2))return a3_0xf5bcfe(Box,{'flexDirection':_0x4ea183(0xc8),'marginTop':0x1,'children':[a3_0x430c4b(Box,{'marginTop':0x1,'children':a3_0x430c4b(Text,{'color':'white','children':_0x4ea183(0xba)})}),a3_0x430c4b(Box,{'marginLeft':0x2,'marginTop':0x1,'children':a3_0x430c4b(Text,{'color':_0x4ea183(0xb0),'children':_0x4ea183(0xb4)})}),a3_0x430c4b(Box,{'marginLeft':0x2,'children':a3_0x430c4b(Text,{'color':_0x4ea183(0xb0),'children':'•\x20Skill:\x20安装研发最佳实践、Backend\x20Function\x20规范'})}),a3_0xf5bcfe(Box,{'marginTop':0x1,'flexDirection':_0x4ea183(0xc8),'children':[a3_0x430c4b(Box,{'children':a3_0x430c4b(Text,{'color':_0x4ea183(0xd2),'children':_0x4ea183(0xa5)})}),a3_0x430c4b(Box,{'children':a3_0x430c4b(Text,{'color':'gray','children':_0x4ea183(0xc3)})}),a3_0x430c4b(Box,{'children':a3_0x430c4b(Text,{'color':_0x4ea183(0xbf),'children':_0x4ea183(0xae)})})]}),_0x365a9e&&a3_0x430c4b(Box,{'marginTop':0x1,'children':a3_0xf5bcfe(Text,{'color':_0x4ea183(0xcc),'children':['✗\x20',_0x365a9e]})})]});if(_0x40ac1f===_0x4ea183(0xc7))return a3_0xf5bcfe(Box,{'flexDirection':_0x4ea183(0xc8),'marginTop':0x1,'children':[a3_0x430c4b(Box,{'children':a3_0x430c4b(Text,{'color':_0x4ea183(0xcf),'bold':!![],'children':_0x4ea183(0xaf)})}),_0x365a9e&&a3_0x430c4b(Box,{'marginTop':0x1,'children':a3_0xf5bcfe(Text,{'color':_0x4ea183(0xcc),'children':['✗\x20',_0x365a9e]})}),a3_0xf5bcfe(Box,{'marginTop':0x1,'flexDirection':_0x4ea183(0xc8),'children':[a3_0x430c4b(Text,{'bold':!![],'color':_0x4ea183(0xd1),'children':'MCP\x20服务器\x20(AI\x20访问数据集)'}),MCP_IDE_LIST[_0x4ea183(0xbb)]((_0x4e21f3,_0x1ce4f5)=>{const _0x42bd8c=_0x4ea183,_0x56f4dd=_0x5ec5e0===_0x1ce4f5,_0x5d8649=_0x29d797[_0x42bd8c(0xa9)](_0x1ce4f5);return a3_0x430c4b(Box,{'children':a3_0xf5bcfe(Text,{'backgroundColor':_0x56f4dd?'blue':undefined,'color':_0x56f4dd?'white':undefined,'children':[_0x5d8649?'[✓]':'[\x20]','\x20',_0x4e21f3===_0x42bd8c(0xc0)?_0x42bd8c(0xad):_0x42bd8c(0xaa)]})},_0x42bd8c(0xb6)+_0x4e21f3);}),a3_0x430c4b(Box,{'marginTop':0x1,'children':a3_0x430c4b(Text,{'bold':!![],'color':_0x4ea183(0xd1),'children':_0x4ea183(0xc1)})}),SKILL_IDE_LIST[_0x4ea183(0xbb)]((_0x11bb34,_0x46bd0c)=>{const _0x540a0f=_0x4ea183,_0x5e5fe0=_0x46bd0c+MCP_IDE_LIST[_0x540a0f(0xa2)],_0x1da4d1=_0x5ec5e0===_0x5e5fe0,_0x1be941=_0x42479c[_0x540a0f(0xa9)](_0x5e5fe0);return a3_0x430c4b(Box,{'children':a3_0xf5bcfe(Text,{'backgroundColor':_0x1da4d1?_0x540a0f(0x9f):undefined,'color':_0x1da4d1?_0x540a0f(0xcd):undefined,'children':[_0x1be941?_0x540a0f(0x9d):_0x540a0f(0xce),'\x20',SKILL_IDE_CONFIGS[_0x11bb34][_0x540a0f(0xd4)]]})},'skill-'+_0x11bb34);}),a3_0x430c4b(Box,{'marginTop':0x1,'children':a3_0x430c4b(Text,{'color':_0x4ea183(0xb0),'children':_0x4ea183(0xb7)})})]})]});if(_0x40ac1f==='installing')return a3_0x430c4b(Box,{'flexDirection':'column','marginTop':0x1,'children':a3_0x430c4b(Box,{'children':a3_0x430c4b(Text,{'children':'正在配置\x20AI\x20助手...'})})});if(_0x40ac1f===_0x4ea183(0xa0))return null;return null;}const MCP_IDE_CONFIGS={'cursor':{'name':a3_0x108960(0xad)},'claude':{'name':a3_0x108960(0xaa)}};
1
+ const a3_0x11b8c3=a3_0x5545;function a3_0x14c3(){const _0x401dd5=['技能包\x20(研发规范指南)','681390pOWluJ','ide','installing','status','请至少选择一个配置项','push','qoder','trae','136LVriXt','upArrow','•\x20MCP:\x20让\x20AI\x20直接访问\x20Lovrabet\x20数据集','selecting','appcode','codex','codebuddy','done','name','add','MCP\x20服务器\x20(AI\x20访问数据集)','size','cyan','claude','delete','61220AjRSUt','45618fxxHms','length','259RswzWq','filter','skill-','downArrow','↑/↓:\x20移动\x20空格:\x20切换\x20a:\x20全选\x20q:\x20退出\x20Enter:\x20确认','red','projectRoot','dimColor','success','2439WFvgFn','confirming','[N]\x20跳过,稍后手动配置','opencode','return','5870249nJityt','antigravity','blue','[✓]','cursor','[\x20]','gray','has','7144ISkLTB','column','white','正在配置\x20AI\x20助手...','error','map','12TWKEmO','message','Cursor','25158XjdsUh','6011970VFjCTy','•\x20Skill:\x20安装研发最佳实践、Backend\x20Function\x20规范'];a3_0x14c3=function(){return _0x401dd5;};return a3_0x14c3();}(function(_0x144990,_0x382a58){const _0x87b8bf=a3_0x5545,_0x3aad10=_0x144990();while(!![]){try{const _0xd98a0a=-parseInt(_0x87b8bf(0x114))/0x1*(parseInt(_0x87b8bf(0xf5))/0x2)+-parseInt(_0x87b8bf(0xf6))/0x3*(-parseInt(_0x87b8bf(0xe6))/0x4)+parseInt(_0x87b8bf(0xde))/0x5+-parseInt(_0x87b8bf(0xda))/0x6*(parseInt(_0x87b8bf(0xf8))/0x7)+-parseInt(_0x87b8bf(0x10e))/0x8*(-parseInt(_0x87b8bf(0x101))/0x9)+-parseInt(_0x87b8bf(0xdb))/0xa+parseInt(_0x87b8bf(0x106))/0xb;if(_0xd98a0a===_0x382a58)break;else _0x3aad10['push'](_0x3aad10['shift']());}catch(_0xb4933d){_0x3aad10['push'](_0x3aad10['shift']());}}}(a3_0x14c3,0x4a886));function a3_0x5545(_0x3455be,_0x16b095){_0x3455be=_0x3455be-0xd8;const _0x14c329=a3_0x14c3();let _0x5545c0=_0x14c329[_0x3455be];return _0x5545c0;}import{jsx as a3_0x17159d,jsxs as a3_0x28af4e}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_0x11b8c3(0x10a),a3_0x11b8c3(0xf3)],SKILL_IDE_LIST=[a3_0x11b8c3(0x107),a3_0x11b8c3(0xf3),a3_0x11b8c3(0xec),a3_0x11b8c3(0xeb),a3_0x11b8c3(0x10a),a3_0x11b8c3(0x104),a3_0x11b8c3(0xe4),a3_0x11b8c3(0xe5),'windsurf','agent'];export function AISetupUI({config:_0x2bef46,onComplete:_0x2a3891}){const _0x35cd46=a3_0x11b8c3,{exit:_0x58b3d8}=useApp(),[_0x2e1252,_0x5c87d7]=useState(_0x35cd46(0x102)),[_0x37accc,_0x47fa64]=useState(0x0),[_0x2b00cb,_0x676609]=useState(new Set([0x0,0x1])),[_0x21d95f,_0x3d01d1]=useState(new Set(SKILL_IDE_LIST[_0x35cd46(0x113)]((_0x330416,_0x33cd67)=>_0x33cd67))),[_0x33ddb8,_0x4f56ea]=useState('');useEffect(()=>{const _0x105fc6=_0x35cd46;!_0x2bef46[_0x105fc6(0xea)]&&_0x2a3891({'mcpResults':[],'skillResults':[]});},[_0x2bef46[_0x35cd46(0xea)],_0x2a3891]),useInput((_0x2fe6ef,_0x3e2621)=>{const _0x1b7cc4=_0x35cd46;if(_0x2e1252===_0x1b7cc4(0x102)){if(_0x2fe6ef==='y'||_0x2fe6ef==='Y'||_0x3e2621[_0x1b7cc4(0x105)]){_0x2aa2e0();return;}if(_0x2fe6ef==='n'||_0x2fe6ef==='N'){_0x2a3891({'mcpResults':[],'skillResults':[]});return;}if(_0x3e2621['return']){_0x2aa2e0();return;}}if(_0x2e1252===_0x1b7cc4(0xe9)){if(_0x3e2621[_0x1b7cc4(0xe7)]){_0x47fa64(_0x5456ae=>_0x5456ae>0x0?_0x5456ae-0x1:SKILL_IDE_LIST[_0x1b7cc4(0xf7)]-0x1);return;}if(_0x3e2621[_0x1b7cc4(0xfb)]){_0x47fa64(_0x2a07f1=>_0x2a07f1<SKILL_IDE_LIST[_0x1b7cc4(0xf7)]-0x1?_0x2a07f1+0x1:0x0);return;}if(_0x2fe6ef==='\x20'){const _0x2c7f80=_0x37accc<MCP_IDE_LIST['length'];if(_0x2c7f80){const _0x150ba4=new Set(_0x2b00cb);_0x150ba4[_0x1b7cc4(0x10d)](_0x37accc)?_0x150ba4['delete'](_0x37accc):_0x150ba4['add'](_0x37accc),_0x676609(_0x150ba4);}else{const _0x21c8fe=_0x37accc-MCP_IDE_LIST['length'],_0x52bf25=new Set(_0x21d95f);_0x52bf25[_0x1b7cc4(0x10d)](_0x21c8fe)?_0x52bf25[_0x1b7cc4(0xf4)](_0x21c8fe):_0x52bf25[_0x1b7cc4(0xef)](_0x21c8fe),_0x3d01d1(_0x52bf25);}return;}if(_0x2fe6ef==='a'||_0x2fe6ef==='A'){_0x676609(new Set(MCP_IDE_LIST[_0x1b7cc4(0x113)]((_0x2f0ebd,_0x3f1133)=>_0x3f1133))),_0x3d01d1(new Set(SKILL_IDE_LIST[_0x1b7cc4(0x113)]((_0x45d874,_0x4c02f3)=>_0x4c02f3)));return;}if(_0x2fe6ef==='q'||_0x2fe6ef==='Q'){_0x58b3d8();return;}if(_0x3e2621['return']){if(_0x2b00cb['size']===0x0&&_0x21d95f[_0x1b7cc4(0xf1)]===0x0){_0x4f56ea(_0x1b7cc4(0xe2));return;}_0x2aa2e0();return;}}if(_0x2e1252===_0x1b7cc4(0xed)){_0x58b3d8();return;}});async function _0x2aa2e0(){const _0x2e6755=_0x35cd46;_0x5c87d7(_0x2e6755(0xe0));const _0x387ad4=[],_0x2514e8=[];for(const _0x530f31 of _0x2b00cb){const _0x2b28ee=MCP_IDE_LIST[_0x530f31];if(!_0x2b28ee)continue;try{const _0x3c82d1=await configureMcp(_0x2b28ee,_0x2bef46[_0x2e6755(0xfe)]);_0x387ad4[_0x2e6755(0xe3)](_0x3c82d1);}catch(_0x9c79ec){_0x387ad4[_0x2e6755(0xe3)]({'ide':MCP_IDE_CONFIGS[_0x2b28ee]?.[_0x2e6755(0xee)]||_0x2b28ee,'status':'error','message':_0x9c79ec instanceof Error?_0x9c79ec[_0x2e6755(0xd8)]:String(_0x9c79ec)});}}await copySharedSkills(_0x2bef46['projectRoot']);for(const _0x3d7aae of _0x21d95f){const _0x43e8af=SKILL_IDE_LIST[_0x3d7aae];if(!_0x43e8af)continue;try{const _0x2a389f=await installSkill(_0x43e8af,_0x2bef46[_0x2e6755(0xfe)]);_0x2514e8[_0x2e6755(0xe3)](_0x2a389f);}catch(_0x24b157){_0x2514e8[_0x2e6755(0xe3)]({'ide':SKILL_IDE_CONFIGS[_0x43e8af]?.[_0x2e6755(0xee)]||_0x43e8af,'status':_0x2e6755(0x112),'message':_0x24b157 instanceof Error?_0x24b157[_0x2e6755(0xd8)]:String(_0x24b157)});}}if(_0x2514e8[_0x2e6755(0xf7)]>0x0){const _0x3f3416=_0x2514e8[_0x2e6755(0xf9)](_0x149325=>_0x149325[_0x2e6755(0xe1)]===_0x2e6755(0x100))[_0x2e6755(0x113)](_0x300c6b=>_0x300c6b[_0x2e6755(0xdf)]);_0x3f3416[_0x2e6755(0xf7)]>0x0&&createSkillManifest(_0x2bef46['projectRoot'],_0x3f3416);}_0x5c87d7(_0x2e6755(0xed)),setTimeout(()=>{_0x2a3891({'mcpResults':_0x387ad4,'skillResults':_0x2514e8});},0xbb8);}if(_0x2e1252===_0x35cd46(0x102))return a3_0x28af4e(Box,{'flexDirection':_0x35cd46(0x10f),'marginTop':0x1,'children':[a3_0x17159d(Box,{'marginTop':0x1,'children':a3_0x17159d(Text,{'color':_0x35cd46(0x110),'children':'是否同时配置\x20AI\x20助手?这将:'})}),a3_0x17159d(Box,{'marginLeft':0x2,'marginTop':0x1,'children':a3_0x17159d(Text,{'color':_0x35cd46(0x10c),'children':_0x35cd46(0xe8)})}),a3_0x17159d(Box,{'marginLeft':0x2,'children':a3_0x17159d(Text,{'color':_0x35cd46(0x10c),'children':_0x35cd46(0xdc)})}),a3_0x28af4e(Box,{'marginTop':0x1,'flexDirection':_0x35cd46(0x10f),'children':[a3_0x17159d(Box,{'children':a3_0x17159d(Text,{'color':'green','children':'[Y]\x20是,配置\x20AI\x20助手'})}),a3_0x17159d(Box,{'children':a3_0x17159d(Text,{'color':_0x35cd46(0x10c),'children':_0x35cd46(0x103)})}),a3_0x17159d(Box,{'children':a3_0x17159d(Text,{'color':_0x35cd46(0xff),'children':'Enter\x20默认:\x20是'})})]}),_0x33ddb8&&a3_0x17159d(Box,{'marginTop':0x1,'children':a3_0x28af4e(Text,{'color':_0x35cd46(0xfd),'children':['✗\x20',_0x33ddb8]})})]});if(_0x2e1252===_0x35cd46(0xe9))return a3_0x28af4e(Box,{'flexDirection':'column','marginTop':0x1,'children':[a3_0x17159d(Box,{'children':a3_0x17159d(Text,{'color':_0x35cd46(0xf2),'bold':!![],'children':'*\x20选择要配置的\x20IDE:'})}),_0x33ddb8&&a3_0x17159d(Box,{'marginTop':0x1,'children':a3_0x28af4e(Text,{'color':_0x35cd46(0xfd),'children':['✗\x20',_0x33ddb8]})}),a3_0x28af4e(Box,{'marginTop':0x1,'flexDirection':_0x35cd46(0x10f),'children':[a3_0x17159d(Text,{'bold':!![],'color':'yellow','children':_0x35cd46(0xf0)}),MCP_IDE_LIST[_0x35cd46(0x113)]((_0x2d02c3,_0x4743f9)=>{const _0x4af29e=_0x35cd46,_0x13c34a=_0x37accc===_0x4743f9,_0x272e13=_0x2b00cb[_0x4af29e(0x10d)](_0x4743f9);return a3_0x17159d(Box,{'children':a3_0x28af4e(Text,{'backgroundColor':_0x13c34a?'blue':undefined,'color':_0x13c34a?_0x4af29e(0x110):undefined,'children':[_0x272e13?_0x4af29e(0x109):_0x4af29e(0x10b),'\x20',_0x2d02c3===_0x4af29e(0x10a)?_0x4af29e(0xd9):'Claude\x20Code']})},'mcp-'+_0x2d02c3);}),a3_0x17159d(Box,{'marginTop':0x1,'children':a3_0x17159d(Text,{'bold':!![],'color':'yellow','children':_0x35cd46(0xdd)})}),SKILL_IDE_LIST[_0x35cd46(0x113)]((_0x3934c6,_0xe55e2e)=>{const _0x5d280b=_0x35cd46,_0x45b155=_0xe55e2e+MCP_IDE_LIST[_0x5d280b(0xf7)],_0x564da5=_0x37accc===_0x45b155,_0x4e5b00=_0x21d95f[_0x5d280b(0x10d)](_0x45b155);return a3_0x17159d(Box,{'children':a3_0x28af4e(Text,{'backgroundColor':_0x564da5?_0x5d280b(0x108):undefined,'color':_0x564da5?_0x5d280b(0x110):undefined,'children':[_0x4e5b00?_0x5d280b(0x109):_0x5d280b(0x10b),'\x20',SKILL_IDE_CONFIGS[_0x3934c6][_0x5d280b(0xee)]]})},_0x5d280b(0xfa)+_0x3934c6);}),a3_0x17159d(Box,{'marginTop':0x1,'children':a3_0x17159d(Text,{'color':_0x35cd46(0x10c),'children':_0x35cd46(0xfc)})})]})]});if(_0x2e1252==='installing')return a3_0x17159d(Box,{'flexDirection':_0x35cd46(0x10f),'marginTop':0x1,'children':a3_0x17159d(Box,{'children':a3_0x17159d(Text,{'children':_0x35cd46(0x111)})})});if(_0x2e1252===_0x35cd46(0xed))return null;return null;}const MCP_IDE_CONFIGS={'cursor':{'name':'Cursor'},'claude':{'name':'Claude\x20Code'}};
@@ -1 +1 @@
1
- function a4_0x4b9d(_0x3c3779,_0x7692b8){_0x3c3779=_0x3c3779-0x1a1;const _0x51494b=a4_0x5149();let _0x4b9d62=_0x51494b[_0x3c3779];return _0x4b9d62;}const a4_0x30f68b=a4_0x4b9d;(function(_0x3420f6,_0x2424e1){const _0x433dc8=a4_0x4b9d,_0x2b94e1=_0x3420f6();while(!![]){try{const _0xacdb9d=-parseInt(_0x433dc8(0x1c5))/0x1*(parseInt(_0x433dc8(0x1ef))/0x2)+-parseInt(_0x433dc8(0x1b8))/0x3*(parseInt(_0x433dc8(0x1d5))/0x4)+parseInt(_0x433dc8(0x1ca))/0x5*(parseInt(_0x433dc8(0x1eb))/0x6)+-parseInt(_0x433dc8(0x1cb))/0x7+parseInt(_0x433dc8(0x1c2))/0x8*(-parseInt(_0x433dc8(0x1d9))/0x9)+parseInt(_0x433dc8(0x1ac))/0xa*(parseInt(_0x433dc8(0x1de))/0xb)+parseInt(_0x433dc8(0x1cc))/0xc*(parseInt(_0x433dc8(0x1e7))/0xd);if(_0xacdb9d===_0x2424e1)break;else _0x2b94e1['push'](_0x2b94e1['shift']());}catch(_0x304ed6){_0x2b94e1['push'](_0x2b94e1['shift']());}}}(a4_0x5149,0xc125d));import{existsSync,mkdirSync,writeFileSync,readFileSync,copyFileSync}from'node:fs';import{join,resolve,dirname}from'node:path';import{fileURLToPath}from'node:url';function a4_0x5149(){const _0xf49638=['toISOString','info','\x20\x20\x20\x20\x20\x20\x20\x20\x22LOVRABET_ENV\x22:\x20\x22','\x20技能包安装失败','Claude\x20Code','复制\x20Cursor\x20Rules\x20文件失败','lovrabet-dataset','skill-install','已创建\x20','87EyLgwi','\x20\x20\x20\x20\x20\x20}','LOVRABET_ENV','创建技能包\x20manifest','env','error','rules','mcp-install','success','join','342424okZyGW','配置信息:','\x22:\x20{','5hYOMKY','npx','\x0a📋\x20请执行以下命令配置\x20Claude\x20Code\x20MCP:\x0a','\x20\x20\x20\x20\x20\x20\x22command\x22:\x20\x22','需要先配置\x20appcode','1870hLCGkO','2630271JezKAi','11976kkjrCH','Cursor\x20MCP\x20配置成功','claude','创建\x20Cursor\x20Rules\x20文件','请手动执行:\x20','\x20\x20}','\x20\x20\x20\x20\x20\x20\x22env\x22:\x20{','\x20\x20\x20\x20}','\x20-e\x20LOVRABET_APP_CODE=','179048xddspN','.cursor','\x20\x20重启\x20Claude\x20Code\x20后生效\x0a','Cursor','189hynzSW','\x20技能包安装成功','\x0a📋\x20其他\x20IDE\x20MCP\x20配置:\x0a','utf-8','\x20\x20环境:\x20','11IZcfKB','log','lovrabet_rules.mdc','配置指引已显示','appcode','message','mcpServers','未知的\x20IDE:\x20','\x20\x20AppCode:\x20','24596GQQOnX','online','.lovrabet','不支持的\x20MCP\x20IDE:\x20','4518pETVBR','\x20\x20\x20\x20\x20\x20\x20\x20\x22LOVRABET_APP_CODE\x22:\x20\x22','../../cdn-source/skills','2.0.0','35560qWBVFC','stringify','object','共享技能文件复制失败','.shared','\x20-e\x20LOVRABET_ENV=','创建\x20agents.md\x20文件','map','.lovrabet/skill-manifest.json','agents.md','manual','node:fs','Claude\x20Code\x20MCP\x20命令已生成','12829090JpyfCx','cwd','cursor'];a4_0x5149=function(){return _0xf49638;};return a4_0x5149();}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_0x30f68b(0x1b5),MCP_COMMAND=a4_0x30f68b(0x1c6),MCP_ARGS=['@lovrabet/dataset-mcp-server@latest'];export function buildEnvConfig(_0x28dc06,_0x2a6bfc){const _0x343ccf=a4_0x30f68b,_0x551554={'LOVRABET_APP_CODE':String(_0x28dc06)};return _0x2a6bfc!==_0x343ccf(0x1e8)&&(_0x551554[_0x343ccf(0x1ba)]=String(_0x2a6bfc)),_0x551554;}export async function configureCursorMcp(_0x1f6fe7){const _0x22fec4=a4_0x30f68b,_0x387de5=_0x1f6fe7||process['cwd'](),_0xc69d8b=readConfig(_0x387de5),_0x579996=_0xc69d8b[_0x22fec4(0x1e2)]||_0xc69d8b['app'],_0x5a0dd4=_0xc69d8b[_0x22fec4(0x1bc)]||_0x22fec4(0x1e8);if(!_0x579996)return{'ide':_0x22fec4(0x1d8),'status':'error','message':_0x22fec4(0x1c9)};const _0xdf447=buildEnvConfig(_0x579996,_0x5a0dd4),_0x2d6c76={'command':MCP_COMMAND,'args':MCP_ARGS,'env':_0xdf447},_0x34fcac=join(_0x387de5,'.cursor','mcp.json'),_0x1c111b=join(_0x387de5,_0x22fec4(0x1d6));try{!existsSync(_0x1c111b)&&mkdirSync(_0x1c111b,{'recursive':!![]});let _0x4e9588={'mcpServers':{}};if(existsSync(_0x34fcac)){const _0x240352=readFileSync(_0x34fcac,'utf-8');_0x4e9588=JSON['parse'](_0x240352);}return(!_0x4e9588['mcpServers']||typeof _0x4e9588[_0x22fec4(0x1e4)]!==_0x22fec4(0x1a1))&&(_0x4e9588['mcpServers']={}),_0x4e9588[_0x22fec4(0x1e4)][MCP_SERVER_NAME]=_0x2d6c76,writeFileSync(_0x34fcac,JSON['stringify'](_0x4e9588,null,0x2),_0x22fec4(0x1dc)),logger[_0x22fec4(0x1b0)](_0x22fec4(0x1bf),_0x22fec4(0x1cd),{'appcode':_0x579996,'env':_0x5a0dd4,'path':_0x34fcac}),await copyCursorRules(_0x1c111b),{'ide':_0x22fec4(0x1d8),'status':_0x22fec4(0x1c0),'message':'已写入\x20.cursor/mcp.json'};}catch(_0x4641e6){return logger['error'](_0x22fec4(0x1bf),'Cursor\x20MCP\x20配置失败',{'error':_0x4641e6 instanceof Error?_0x4641e6[_0x22fec4(0x1e3)]:String(_0x4641e6)}),{'ide':_0x22fec4(0x1d8),'status':_0x22fec4(0x1bd),'message':_0x4641e6 instanceof Error?_0x4641e6[_0x22fec4(0x1e3)]:String(_0x4641e6)};}}export async function configureClaudeMcp(_0x29d169){const _0x59897c=a4_0x30f68b,_0x5d4509=_0x29d169||process['cwd'](),_0x586707=readConfig(_0x5d4509),_0x43c4c9=_0x586707[_0x59897c(0x1e2)]||_0x586707['app'],_0x346ba8=_0x586707['env']||'online';if(!_0x43c4c9)return{'ide':_0x59897c(0x1b3),'status':'error','message':_0x59897c(0x1c9)};let _0x5b0bde='claude\x20mcp\x20add\x20'+MCP_SERVER_NAME+'\x20'+MCP_COMMAND+'\x20'+MCP_ARGS[_0x59897c(0x1c1)]('\x20')+_0x59897c(0x1d4)+_0x43c4c9;return _0x346ba8!=='online'&&(_0x5b0bde+=_0x59897c(0x1a4)+_0x346ba8),await copyAgentsMd(_0x5d4509),logger[_0x59897c(0x1b0)](_0x59897c(0x1bf),_0x59897c(0x1ab),{'command':_0x5b0bde,'appcode':_0x43c4c9,'env':_0x346ba8}),console[_0x59897c(0x1df)](_0x59897c(0x1c7)),console['log']('\x20\x20'+_0x5b0bde+'\x0a'),console[_0x59897c(0x1df)](_0x59897c(0x1c3)),console[_0x59897c(0x1df)](_0x59897c(0x1e6)+_0x43c4c9),_0x346ba8!=='online'&&console[_0x59897c(0x1df)](_0x59897c(0x1dd)+_0x346ba8),console[_0x59897c(0x1df)](_0x59897c(0x1d7)),{'ide':_0x59897c(0x1b3),'status':_0x59897c(0x1a9),'message':_0x59897c(0x1d0)+_0x5b0bde};}export async function showOtherGuide(_0x401001){const _0x4d13e5=a4_0x30f68b,_0x3d1454=_0x401001||process[_0x4d13e5(0x1ad)](),_0x10dd4e=readConfig(_0x3d1454),_0x5107fb=_0x10dd4e[_0x4d13e5(0x1e2)]||_0x10dd4e['app'],_0x48a1d6=_0x10dd4e[_0x4d13e5(0x1bc)]||_0x4d13e5(0x1e8);if(!_0x5107fb)return{'ide':'其他','status':_0x4d13e5(0x1bd),'message':_0x4d13e5(0x1c9)};return console[_0x4d13e5(0x1df)](_0x4d13e5(0x1db)),console[_0x4d13e5(0x1df)]('{'),console[_0x4d13e5(0x1df)]('\x20\x20\x22mcpServers\x22:\x20{'),console['log']('\x20\x20\x20\x20\x22'+MCP_SERVER_NAME+_0x4d13e5(0x1c4)),console['log'](_0x4d13e5(0x1c8)+MCP_COMMAND+'\x22,'),console[_0x4d13e5(0x1df)]('\x20\x20\x20\x20\x20\x20\x22args\x22:\x20['+MCP_ARGS[_0x4d13e5(0x1a6)](_0x13d5c4=>'\x22'+_0x13d5c4+'\x22')[_0x4d13e5(0x1c1)](',\x20')+'],'),console[_0x4d13e5(0x1df)](_0x4d13e5(0x1d2)),console[_0x4d13e5(0x1df)](_0x4d13e5(0x1ec)+_0x5107fb+'\x22,'),_0x48a1d6!==_0x4d13e5(0x1e8)&&console[_0x4d13e5(0x1df)](_0x4d13e5(0x1b1)+_0x48a1d6+'\x22,'),console[_0x4d13e5(0x1df)](_0x4d13e5(0x1b9)),console[_0x4d13e5(0x1df)](_0x4d13e5(0x1d3)),console[_0x4d13e5(0x1df)](_0x4d13e5(0x1d1)),console[_0x4d13e5(0x1df)]('}\x0a'),logger[_0x4d13e5(0x1b0)]('mcp-install','其他\x20IDE\x20配置指引已显示',{'appcode':_0x5107fb,'env':_0x48a1d6}),{'ide':'其他','status':_0x4d13e5(0x1a9),'message':_0x4d13e5(0x1e1)};}export async function configureMcp(_0x568dcb,_0x308a17){const _0x596820=a4_0x30f68b;switch(_0x568dcb){case _0x596820(0x1ae):return await configureCursorMcp(_0x308a17);case _0x596820(0x1ce):return await configureClaudeMcp(_0x308a17);default:throw new Error(_0x596820(0x1ea)+_0x568dcb);}}async function copyCursorRules(_0x3daa21){const _0xa242ec=a4_0x30f68b,_0x4a74bd=join(_0x3daa21,_0xa242ec(0x1be)),_0x5f1370=join(_0x4a74bd,_0xa242ec(0x1e0));if(existsSync(_0x5f1370))return;try{!existsSync(_0x4a74bd)&&mkdirSync(_0x4a74bd,{'recursive':!![]});const _0x3028ad=await getRulesContent();writeFileSync(_0x5f1370,_0x3028ad,_0xa242ec(0x1dc)),logger[_0xa242ec(0x1b0)](_0xa242ec(0x1bf),_0xa242ec(0x1cf),{'to':_0x5f1370});}catch(_0x59ec8d){logger['error']('mcp-install',_0xa242ec(0x1b4),{'error':_0x59ec8d instanceof Error?_0x59ec8d['message']:String(_0x59ec8d)});}}async function copyAgentsMd(_0x188be6){const _0x4aef0d=a4_0x30f68b,_0x4e4ae5=join(_0x188be6,_0x4aef0d(0x1a8));if(existsSync(_0x4e4ae5))return;try{const _0xa48fe8=await getRulesContent();writeFileSync(_0x4e4ae5,_0xa48fe8,_0x4aef0d(0x1dc)),logger[_0x4aef0d(0x1b0)](_0x4aef0d(0x1bf),_0x4aef0d(0x1a5),{'to':_0x4e4ae5});}catch(_0x103aee){logger['error'](_0x4aef0d(0x1bf),'复制\x20agents.md\x20文件失败',{'error':_0x103aee instanceof Error?_0x103aee[_0x4aef0d(0x1e3)]:String(_0x103aee)});}}export const SKILL_IDE_CONFIGS=IDE_CONFIGS;export async function installSkill(_0x2f55f7,_0x4fd1cd){const _0x4cfc9c=a4_0x30f68b,_0x2b3e6e=_0x4fd1cd||process[_0x4cfc9c(0x1ad)](),_0x4a95b2=resolve(__dirname,_0x4cfc9c(0x1ed)),_0x372c5c=SKILL_IDE_CONFIGS[_0x2f55f7];if(!_0x372c5c)return{'ide':_0x2f55f7,'status':_0x4cfc9c(0x1bd),'message':_0x4cfc9c(0x1e5)+_0x2f55f7};const _0x29e354=_0x372c5c['name'];try{let _0x128c24;try{_0x128c24=await fetchGuidesFromCDN();}catch{}const _0xec0d2a=await installSingleIDE(_0x2f55f7,_0x372c5c,_0x2b3e6e,_0x4a95b2,_0x128c24);return _0x128c24&&writeGuidesToProject(_0x128c24,_0x2b3e6e),logger[_0x4cfc9c(0x1b0)]('skill-install',_0x29e354+_0x4cfc9c(0x1da),{'ide':_0x2f55f7,'filesCount':_0xec0d2a}),{'ide':_0x29e354,'status':_0x4cfc9c(0x1c0),'message':_0x4cfc9c(0x1b7)+_0xec0d2a+'\x20项'};}catch(_0x373f14){return logger[_0x4cfc9c(0x1bd)](_0x4cfc9c(0x1b6),_0x29e354+_0x4cfc9c(0x1b2),{'error':_0x373f14 instanceof Error?_0x373f14[_0x4cfc9c(0x1e3)]:String(_0x373f14)}),{'ide':_0x29e354,'status':_0x4cfc9c(0x1bd),'message':_0x373f14 instanceof Error?_0x373f14['message']:String(_0x373f14)};}}async function copyDir(_0x59d756,_0x5bfa24){const _0x583c58=a4_0x30f68b,{statSync:_0x174242}=await import('node:fs'),{readdirSync:_0x511c96}=await import(_0x583c58(0x1aa)),_0x2123f2=_0x174242(_0x59d756);if(_0x2123f2['isDirectory']()){!existsSync(_0x5bfa24)&&mkdirSync(_0x5bfa24,{'recursive':!![]});const _0x3adf7f=_0x511c96(_0x59d756);for(const _0x53568f of _0x3adf7f){await copyDir(join(_0x59d756,_0x53568f),join(_0x5bfa24,_0x53568f));}}else copyFileSync(_0x59d756,_0x5bfa24);}export async function copySharedSkills(_0x55fc11){const _0x58a239=a4_0x30f68b,_0x29e686=_0x55fc11||process[_0x58a239(0x1ad)](),_0x3fba4b=resolve(__dirname,_0x58a239(0x1ed)),_0x286be7=join(_0x3fba4b,_0x58a239(0x1a3)),_0x4e08a1=join(_0x29e686,'.lovrabet/skill/.shared');if(!existsSync(_0x286be7))return![];try{return await copyDir(_0x286be7,_0x4e08a1),logger['info'](_0x58a239(0x1b6),'共享技能文件复制成功',{'path':_0x4e08a1}),!![];}catch(_0x3b3315){return logger[_0x58a239(0x1bd)]('skill-install',_0x58a239(0x1a2),{'error':_0x3b3315 instanceof Error?_0x3b3315['message']:String(_0x3b3315)}),![];}}export function createSkillManifest(_0x2c1d4c,_0x558279){const _0x37bb2c=a4_0x30f68b,_0x37eaa6={'version':_0x37bb2c(0x1ee),'installedAt':new Date()[_0x37bb2c(0x1af)](),'platforms':_0x558279},_0x3704c3=join(_0x2c1d4c,_0x37bb2c(0x1a7)),_0xfba98f=join(_0x2c1d4c,_0x37bb2c(0x1e9));!existsSync(_0xfba98f)&&mkdirSync(_0xfba98f,{'recursive':!![]}),writeFileSync(_0x3704c3,JSON[_0x37bb2c(0x1f0)](_0x37eaa6,null,0x2),_0x37bb2c(0x1dc)),logger['info'](_0x37bb2c(0x1b6),_0x37bb2c(0x1bb),{'path':_0x3704c3});}
1
+ const a4_0x5252e9=a4_0x2360;(function(_0x2d3a97,_0x4fb13a){const _0x449a43=a4_0x2360,_0x11499d=_0x2d3a97();while(!![]){try{const _0x33fe73=-parseInt(_0x449a43(0x1ab))/0x1+-parseInt(_0x449a43(0x1ad))/0x2*(-parseInt(_0x449a43(0x1c9))/0x3)+parseInt(_0x449a43(0x1a9))/0x4*(parseInt(_0x449a43(0x1a7))/0x5)+parseInt(_0x449a43(0x1c8))/0x6+parseInt(_0x449a43(0x1d1))/0x7*(parseInt(_0x449a43(0x1a3))/0x8)+parseInt(_0x449a43(0x1b3))/0x9+-parseInt(_0x449a43(0x191))/0xa;if(_0x33fe73===_0x4fb13a)break;else _0x11499d['push'](_0x11499d['shift']());}catch(_0x10341e){_0x11499d['push'](_0x11499d['shift']());}}}(a4_0x12b2,0xe811d));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_0x5252e9(0x19e),MCP_COMMAND=a4_0x5252e9(0x1a0),MCP_ARGS=[a4_0x5252e9(0x1b7)];export function buildEnvConfig(_0xf9f7f1,_0x19081e){const _0x128bb2=a4_0x5252e9,_0xed220e={'LOVRABET_APP_CODE':String(_0xf9f7f1)};return _0x19081e!==_0x128bb2(0x192)&&(_0xed220e[_0x128bb2(0x1b5)]=String(_0x19081e)),_0xed220e;}function a4_0x2360(_0x4c3295,_0x1e4869){_0x4c3295=_0x4c3295-0x18c;const _0x12b2fd=a4_0x12b2();let _0x23605d=_0x12b2fd[_0x4c3295];return _0x23605d;}export async function configureCursorMcp(_0x1394ec){const _0x263297=a4_0x5252e9,_0x3bc31c=_0x1394ec||process[_0x263297(0x1c6)](),_0x1eeb8b=readConfig(_0x3bc31c),_0x1c640b=_0x1eeb8b[_0x263297(0x1cf)]||_0x1eeb8b[_0x263297(0x1b9)],_0x51c8fe=_0x1eeb8b[_0x263297(0x1a2)]||'online';if(!_0x1c640b)return{'ide':_0x263297(0x1d0),'status':_0x263297(0x1d6),'message':_0x263297(0x1af)};const _0x15e87f=buildEnvConfig(_0x1c640b,_0x51c8fe),_0x16bde8={'command':MCP_COMMAND,'args':MCP_ARGS,'env':_0x15e87f},_0x459935=join(_0x3bc31c,_0x263297(0x19c),_0x263297(0x1a8)),_0x1242a7=join(_0x3bc31c,'.cursor');try{!existsSync(_0x1242a7)&&mkdirSync(_0x1242a7,{'recursive':!![]});let _0x5c4488={'mcpServers':{}};if(existsSync(_0x459935)){const _0x40e6bb=readFileSync(_0x459935,_0x263297(0x193));_0x5c4488=JSON[_0x263297(0x1b1)](_0x40e6bb);}return(!_0x5c4488[_0x263297(0x1d4)]||typeof _0x5c4488['mcpServers']!=='object')&&(_0x5c4488[_0x263297(0x1d4)]={}),_0x5c4488[_0x263297(0x1d4)][MCP_SERVER_NAME]=_0x16bde8,writeFileSync(_0x459935,JSON['stringify'](_0x5c4488,null,0x2),_0x263297(0x193)),logger[_0x263297(0x19a)](_0x263297(0x1ba),_0x263297(0x1d7),{'appcode':_0x1c640b,'env':_0x51c8fe,'path':_0x459935}),await copyCursorRules(_0x1242a7),{'ide':'Cursor','status':_0x263297(0x1ae),'message':_0x263297(0x1d5)};}catch(_0x2cfeb8){return logger[_0x263297(0x1d6)](_0x263297(0x1ba),_0x263297(0x1be),{'error':_0x2cfeb8 instanceof Error?_0x2cfeb8['message']:String(_0x2cfeb8)}),{'ide':_0x263297(0x1d0),'status':_0x263297(0x1d6),'message':_0x2cfeb8 instanceof Error?_0x2cfeb8['message']:String(_0x2cfeb8)};}}export async function configureClaudeMcp(_0x2c631e){const _0x427e49=a4_0x5252e9,_0xf1c2e=_0x2c631e||process[_0x427e49(0x1c6)](),_0x591625=readConfig(_0xf1c2e),_0xb9c04e=_0x591625[_0x427e49(0x1cf)]||_0x591625['app'],_0x17bb73=_0x591625[_0x427e49(0x1a2)]||_0x427e49(0x192);if(!_0xb9c04e)return{'ide':_0x427e49(0x1b2),'status':_0x427e49(0x1d6),'message':_0x427e49(0x1af)};let _0x4e7713=_0x427e49(0x18c)+MCP_SERVER_NAME+'\x20'+MCP_COMMAND+'\x20'+MCP_ARGS[_0x427e49(0x196)]('\x20')+_0x427e49(0x1c5)+_0xb9c04e;return _0x17bb73!==_0x427e49(0x192)&&(_0x4e7713+=_0x427e49(0x1d3)+_0x17bb73),await copyAgentsMd(_0xf1c2e),logger[_0x427e49(0x19a)](_0x427e49(0x1ba),_0x427e49(0x1bd),{'command':_0x4e7713,'appcode':_0xb9c04e,'env':_0x17bb73}),console[_0x427e49(0x1c3)]('\x0a📋\x20请执行以下命令配置\x20Claude\x20Code\x20MCP:\x0a'),console[_0x427e49(0x1c3)]('\x20\x20'+_0x4e7713+'\x0a'),console[_0x427e49(0x1c3)]('配置信息:'),console[_0x427e49(0x1c3)](_0x427e49(0x1b6)+_0xb9c04e),_0x17bb73!=='online'&&console[_0x427e49(0x1c3)](_0x427e49(0x1c7)+_0x17bb73),console[_0x427e49(0x1c3)](_0x427e49(0x18f)),{'ide':_0x427e49(0x1b2),'status':'manual','message':_0x427e49(0x18d)+_0x4e7713};}export async function showOtherGuide(_0x4e816c){const _0x260148=a4_0x5252e9,_0xd0b0d2=_0x4e816c||process['cwd'](),_0x463a21=readConfig(_0xd0b0d2),_0x51a292=_0x463a21[_0x260148(0x1cf)]||_0x463a21[_0x260148(0x1b9)],_0x52e298=_0x463a21[_0x260148(0x1a2)]||'online';if(!_0x51a292)return{'ide':'其他','status':_0x260148(0x1d6),'message':_0x260148(0x1af)};return console['log'](_0x260148(0x1b0)),console['log']('{'),console['log']('\x20\x20\x22mcpServers\x22:\x20{'),console[_0x260148(0x1c3)]('\x20\x20\x20\x20\x22'+MCP_SERVER_NAME+'\x22:\x20{'),console[_0x260148(0x1c3)](_0x260148(0x194)+MCP_COMMAND+'\x22,'),console[_0x260148(0x1c3)](_0x260148(0x1ca)+MCP_ARGS[_0x260148(0x190)](_0x4f3200=>'\x22'+_0x4f3200+'\x22')[_0x260148(0x196)](',\x20')+'],'),console[_0x260148(0x1c3)]('\x20\x20\x20\x20\x20\x20\x22env\x22:\x20{'),console[_0x260148(0x1c3)](_0x260148(0x195)+_0x51a292+'\x22,'),_0x52e298!==_0x260148(0x192)&&console[_0x260148(0x1c3)](_0x260148(0x1bf)+_0x52e298+'\x22,'),console['log']('\x20\x20\x20\x20\x20\x20}'),console[_0x260148(0x1c3)](_0x260148(0x197)),console[_0x260148(0x1c3)]('\x20\x20}'),console['log']('}\x0a'),logger[_0x260148(0x19a)](_0x260148(0x1ba),_0x260148(0x1aa),{'appcode':_0x51a292,'env':_0x52e298}),{'ide':'其他','status':_0x260148(0x1c0),'message':'配置指引已显示'};}export async function configureMcp(_0x33ead9,_0x1c0182){const _0x3979ef=a4_0x5252e9;switch(_0x33ead9){case _0x3979ef(0x19d):return await configureCursorMcp(_0x1c0182);case _0x3979ef(0x18e):return await configureClaudeMcp(_0x1c0182);default:throw new Error('不支持的\x20MCP\x20IDE:\x20'+_0x33ead9);}}async function copyCursorRules(_0x2c460e){const _0x40746d=a4_0x5252e9,_0x5d8477=join(_0x2c460e,_0x40746d(0x1cc)),_0x1d53ad=join(_0x5d8477,_0x40746d(0x1b8));if(existsSync(_0x1d53ad))return;try{!existsSync(_0x5d8477)&&mkdirSync(_0x5d8477,{'recursive':!![]});const _0x59b1a4=await getRulesContent();writeFileSync(_0x1d53ad,_0x59b1a4,_0x40746d(0x193)),logger[_0x40746d(0x19a)](_0x40746d(0x1ba),_0x40746d(0x1c4),{'to':_0x1d53ad});}catch(_0x185e12){logger[_0x40746d(0x1d6)]('mcp-install',_0x40746d(0x198),{'error':_0x185e12 instanceof Error?_0x185e12[_0x40746d(0x1cb)]:String(_0x185e12)});}}async function copyAgentsMd(_0x401ebf){const _0x1296a1=a4_0x5252e9,_0x18f86a=join(_0x401ebf,'agents.md');if(existsSync(_0x18f86a))return;try{const _0xeb0bae=await getRulesContent();writeFileSync(_0x18f86a,_0xeb0bae,'utf-8'),logger[_0x1296a1(0x19a)](_0x1296a1(0x1ba),_0x1296a1(0x1bb),{'to':_0x18f86a});}catch(_0x4c429e){logger[_0x1296a1(0x1d6)](_0x1296a1(0x1ba),_0x1296a1(0x199),{'error':_0x4c429e instanceof Error?_0x4c429e[_0x1296a1(0x1cb)]:String(_0x4c429e)});}}export const SKILL_IDE_CONFIGS=IDE_CONFIGS;export async function installSkill(_0x66532c,_0x41e917){const _0x4da078=a4_0x5252e9,_0xd6ec4c=_0x41e917||process[_0x4da078(0x1c6)](),_0x2fd9d7=resolve(__dirname,_0x4da078(0x1d8)),_0x40e0f3=SKILL_IDE_CONFIGS[_0x66532c];if(!_0x40e0f3)return{'ide':_0x66532c,'status':_0x4da078(0x1d6),'message':_0x4da078(0x1cd)+_0x66532c};const _0x4dfd69=_0x40e0f3[_0x4da078(0x1a4)];try{let _0x212fae;try{_0x212fae=await fetchGuidesFromCDN();}catch{}const _0x202dd0=await installSingleIDE(_0x66532c,_0x40e0f3,_0xd6ec4c,_0x2fd9d7,_0x212fae);return _0x212fae&&writeGuidesToProject(_0x212fae,_0xd6ec4c),logger['info'](_0x4da078(0x1a6),_0x4dfd69+_0x4da078(0x1c1),{'ide':_0x66532c,'filesCount':_0x202dd0}),{'ide':_0x4dfd69,'status':_0x4da078(0x1ae),'message':'已创建\x20'+_0x202dd0+'\x20项'};}catch(_0x343905){return logger[_0x4da078(0x1d6)]('skill-install',_0x4dfd69+_0x4da078(0x1d9),{'error':_0x343905 instanceof Error?_0x343905[_0x4da078(0x1cb)]:String(_0x343905)}),{'ide':_0x4dfd69,'status':_0x4da078(0x1d6),'message':_0x343905 instanceof Error?_0x343905[_0x4da078(0x1cb)]:String(_0x343905)};}}function a4_0x12b2(){const _0x44d61=['已写入\x20.cursor/mcp.json','error','Cursor\x20MCP\x20配置成功','../../cdn-source/skills','\x20技能包安装失败','claude\x20mcp\x20add\x20','请手动执行:\x20','claude','\x20\x20重启\x20Claude\x20Code\x20后生效\x0a','map','47797890DPfuBD','online','utf-8','\x20\x20\x20\x20\x20\x20\x22command\x22:\x20\x22','\x20\x20\x20\x20\x20\x20\x20\x20\x22LOVRABET_APP_CODE\x22:\x20\x22','join','\x20\x20\x20\x20}','复制\x20Cursor\x20Rules\x20文件失败','复制\x20agents.md\x20文件失败','info','.lovrabet/skill-manifest.json','.cursor','cursor','lovrabet-dataset','isDirectory','npx','共享技能文件复制成功','env','47056MUkZTf','name','node:fs','skill-install','5YcfWZt','mcp.json','4952060VATmLW','其他\x20IDE\x20配置指引已显示','997383KLquRO','.lovrabet/skill/.shared','1652334dTiwfo','success','需要先配置\x20appcode','\x0a📋\x20其他\x20IDE\x20MCP\x20配置:\x0a','parse','Claude\x20Code','10591461enlufW','共享技能文件复制失败','LOVRABET_ENV','\x20\x20AppCode:\x20','@lovrabet/dataset-mcp-server@latest','lovrabet_rules.mdc','app','mcp-install','创建\x20agents.md\x20文件','toISOString','Claude\x20Code\x20MCP\x20命令已生成','Cursor\x20MCP\x20配置失败','\x20\x20\x20\x20\x20\x20\x20\x20\x22LOVRABET_ENV\x22:\x20\x22','manual','\x20技能包安装成功','创建技能包\x20manifest','log','创建\x20Cursor\x20Rules\x20文件','\x20-e\x20LOVRABET_APP_CODE=','cwd','\x20\x20环境:\x20','9963666dJSBxE','6aPNSYI','\x20\x20\x20\x20\x20\x20\x22args\x22:\x20[','message','rules','未知的\x20IDE:\x20','2.0.0','appcode','Cursor','1190infmMH','stringify','\x20-e\x20LOVRABET_ENV=','mcpServers'];a4_0x12b2=function(){return _0x44d61;};return a4_0x12b2();}async function copyDir(_0x4af6da,_0x240b2c){const _0x69bff5=a4_0x5252e9,{statSync:_0x536a7d}=await import(_0x69bff5(0x1a5)),{readdirSync:_0x53cd76}=await import(_0x69bff5(0x1a5)),_0x333f0c=_0x536a7d(_0x4af6da);if(_0x333f0c[_0x69bff5(0x19f)]()){!existsSync(_0x240b2c)&&mkdirSync(_0x240b2c,{'recursive':!![]});const _0x206181=_0x53cd76(_0x4af6da);for(const _0x1b3cc7 of _0x206181){await copyDir(join(_0x4af6da,_0x1b3cc7),join(_0x240b2c,_0x1b3cc7));}}else copyFileSync(_0x4af6da,_0x240b2c);}export async function copySharedSkills(_0x8bfd71){const _0x2d647f=a4_0x5252e9,_0x3bce5d=_0x8bfd71||process[_0x2d647f(0x1c6)](),_0x5b2d33=resolve(__dirname,'../../cdn-source/skills'),_0x230704=join(_0x5b2d33,'.shared'),_0x33ca61=join(_0x3bce5d,_0x2d647f(0x1ac));if(!existsSync(_0x230704))return![];try{return await copyDir(_0x230704,_0x33ca61),logger[_0x2d647f(0x19a)](_0x2d647f(0x1a6),_0x2d647f(0x1a1),{'path':_0x33ca61}),!![];}catch(_0x32753b){return logger[_0x2d647f(0x1d6)](_0x2d647f(0x1a6),_0x2d647f(0x1b4),{'error':_0x32753b instanceof Error?_0x32753b[_0x2d647f(0x1cb)]:String(_0x32753b)}),![];}}export function createSkillManifest(_0x21f77f,_0x124abc){const _0x10aeb7=a4_0x5252e9,_0x282389={'version':_0x10aeb7(0x1ce),'installedAt':new Date()[_0x10aeb7(0x1bc)](),'platforms':_0x124abc},_0x1a694e=join(_0x21f77f,_0x10aeb7(0x19b)),_0x54ad72=join(_0x21f77f,'.lovrabet');!existsSync(_0x54ad72)&&mkdirSync(_0x54ad72,{'recursive':!![]}),writeFileSync(_0x1a694e,JSON[_0x10aeb7(0x1d2)](_0x282389,null,0x2),_0x10aeb7(0x193)),logger[_0x10aeb7(0x19a)]('skill-install',_0x10aeb7(0x1c2),{'path':_0x1a694e});}
@@ -1 +1 @@
1
- (function(_0x1c8e80,_0x3629eb){const _0x1a141c=a5_0x5253,_0x151bbd=_0x1c8e80();while(!![]){try{const _0xbf6c5a=parseInt(_0x1a141c(0x12e))/0x1+parseInt(_0x1a141c(0x145))/0x2*(-parseInt(_0x1a141c(0x144))/0x3)+parseInt(_0x1a141c(0x153))/0x4*(parseInt(_0x1a141c(0x12c))/0x5)+-parseInt(_0x1a141c(0x146))/0x6*(parseInt(_0x1a141c(0x13d))/0x7)+-parseInt(_0x1a141c(0x130))/0x8*(parseInt(_0x1a141c(0x150))/0x9)+parseInt(_0x1a141c(0x143))/0xa+parseInt(_0x1a141c(0x138))/0xb;if(_0xbf6c5a===_0x3629eb)break;else _0x151bbd['push'](_0x151bbd['shift']());}catch(_0x16c946){_0x151bbd['push'](_0x151bbd['shift']());}}}(a5_0x4617,0xa6f2c));import{jsx as a5_0x5b3da7,jsxs as a5_0x53544d,Fragment as a5_0x159378}from'react/jsx-runtime';function a5_0x5253(_0x56ea0f,_0x333c5b){_0x56ea0f=_0x56ea0f-0x129;const _0x461791=a5_0x4617();let _0x52534c=_0x461791[_0x56ea0f];return _0x52534c;}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';import{logger}from'../utils/logger.js';export const ApiDocUI=({appCode:_0x761338,env:_0x21024d,output:_0x100410,extraParams:_0x21340d,datasetCodes:_0x4afd84})=>{const _0x540f3c=a5_0x5253,{exit:_0x2991b7}=useApp(),[_0x319e0c,_0x182bd5]=useState(![]),[_0x460f25,_0x5d242f]=useState(''),[_0x227a02,_0x433942]=useState(![]),[_0x43e822,_0x351d97]=useState(null),[_0x3e3c6e,_0x5957f2]=useState(null),[_0xb7a021,_0x2967e6]=useState(0x0),_0x1b347e=readConfig(),_0x6aa9e9=getConfigAppCode(),_0x1d6d06=_0x761338||_0x6aa9e9,_0x1bf4a5=typeof _0x1b347e?.[_0x540f3c(0x157)]===_0x540f3c(0x14e)?_0x1b347e['env']:undefined,_0x1a41e9=_0x21024d||_0x1bf4a5||'online';initEnv(_0x1a41e9);const _0x30d6df=_0x100410||_0x540f3c(0x141),_0xf017e2=_0x761338?_0x540f3c(0x12d)+_0x1d6d06:_0x540f3c(0x139)+_0x1d6d06;useEffect(()=>{_0x182bd5(!![]),_0x4aa7a8();},[]),useEffect(()=>{(_0x227a02||_0x43e822)&&_0x2991b7();},[_0x227a02,_0x43e822,_0x2991b7]);async function _0x4aa7a8(){const _0x39ccb6=_0x540f3c;if(!_0x1d6d06){_0x351d97(_0x39ccb6(0x13a));return;}try{logger[_0x39ccb6(0x136)](process[_0x39ccb6(0x15c)]()),_0x5d242f('正在获取数据集列表...');const {configArray:_0x329c9b}=await fetchModelList(_0x1d6d06);_0x2967e6(_0x329c9b[_0x39ccb6(0x14c)]);if(_0x329c9b[_0x39ccb6(0x14c)]===0x0){_0x351d97(_0x39ccb6(0x14a));return;}let _0x6e2cc0=_0x329c9b;if(_0x4afd84&&_0x4afd84[_0x39ccb6(0x14c)]>0x0){_0x6e2cc0=_0x329c9b[_0x39ccb6(0x155)](_0x59972d=>_0x4afd84[_0x39ccb6(0x13f)](_0x59972d[_0x39ccb6(0x151)]));const _0x2d62ba=_0x6e2cc0[_0x39ccb6(0x15d)](_0x5b13c3=>_0x5b13c3[_0x39ccb6(0x151)]),_0x4151d8=_0x4afd84['filter'](_0x9879=>!_0x2d62ba['includes'](_0x9879));_0x4151d8[_0x39ccb6(0x14c)]>0x0&&console[_0x39ccb6(0x134)](_0x39ccb6(0x135)+_0x4151d8['join'](',\x20')+_0x39ccb6(0x140));if(_0x6e2cc0[_0x39ccb6(0x14c)]===0x0){_0x351d97(_0x39ccb6(0x147)+_0x4afd84[_0x39ccb6(0x148)](',\x20'));return;}console[_0x39ccb6(0x134)](_0x39ccb6(0x160)+_0x329c9b['length']+_0x39ccb6(0x129)+_0x6e2cc0['length']+_0x39ccb6(0x142));}_0x5d242f(_0x39ccb6(0x158)+_0x6e2cc0[_0x39ccb6(0x14c)]+_0x39ccb6(0x15b));const _0x18c0bd=await generateDatasetDocs(_0x6e2cc0,_0x1d6d06,_0x30d6df,(_0x1bdba4,_0x307037,_0x2b1893)=>{const _0x4aece1=_0x39ccb6;_0x5d242f('正在生成\x20'+_0x2b1893+_0x4aece1(0x14f)+_0x1bdba4+'/'+_0x307037+')');},_0x21340d);_0x5957f2(_0x18c0bd),_0x433942(!![]);const _0x34e4e8=_0x18c0bd['filter'](_0x1998e9=>_0x1998e9[_0x39ccb6(0x15f)])['length'],_0x309843=_0x18c0bd[_0x39ccb6(0x155)](_0x469b94=>!_0x469b94['success'])[_0x39ccb6(0x14c)];logger[_0x39ccb6(0x15f)]('api-doc',_0x39ccb6(0x154),undefined,{'totalCount':_0x18c0bd[_0x39ccb6(0x14c)],'successCount':_0x34e4e8,'failCount':_0x309843,'outputDir':_0x30d6df});}catch(_0x561e32){const _0x51a39f=_0x561e32 instanceof Error?_0x561e32[_0x39ccb6(0x14b)]:String(_0x561e32);logger[_0x39ccb6(0x156)](_0x39ccb6(0x132),_0x39ccb6(0x15a)+_0x51a39f,{'appCode':_0x1d6d06,'outputDir':_0x30d6df}),_0x351d97('文档生成失败:\x20'+_0x51a39f);}finally{_0x182bd5(![]);}}const _0x189a2c=_0x3e3c6e?.[_0x540f3c(0x155)](_0x3088a9=>_0x3088a9[_0x540f3c(0x15f)])[_0x540f3c(0x14c)]||0x0,_0x24261a=_0x3e3c6e?.['filter'](_0x1101b3=>!_0x1101b3[_0x540f3c(0x15f)])[_0x540f3c(0x14c)]||0x0;return a5_0x53544d(Box,{'flexDirection':'column','children':[(_0x319e0c||_0x227a02)&&a5_0x53544d(Box,{'children':[a5_0x5b3da7(Text,{'color':'gray','children':'*\x20'}),a5_0x5b3da7(Text,{'color':_0x761338?'white':'dim','children':_0xf017e2})]}),_0x319e0c&&a5_0x5b3da7(Box,{'children':a5_0x53544d(Text,{'children':['🚀\x20',_0x460f25,'\x20(环境:\x20',_0x1a41e9,')']})}),_0x227a02&&_0x3e3c6e&&a5_0x53544d(Box,{'flexDirection':'column','children':[a5_0x5b3da7(Box,{'children':a5_0x53544d(Text,{'color':_0x540f3c(0x133),'children':[_0x540f3c(0x13e),_0x189a2c,'\x20个',_0x24261a>0x0&&_0x540f3c(0x149)+_0x24261a+'\x20个']})}),a5_0x5b3da7(Box,{'marginTop':0x1,'children':a5_0x53544d(Text,{'color':'gray','children':[_0x540f3c(0x14d),_0xb7a021,_0x540f3c(0x161)]})}),a5_0x53544d(Box,{'marginTop':0x1,'children':[a5_0x5b3da7(Text,{'color':_0x540f3c(0x131),'children':'*\x20输出目录:\x20'}),a5_0x5b3da7(Text,{'color':_0x540f3c(0x13c),'children':_0x30d6df})]}),_0x189a2c>0x0&&a5_0x53544d(a5_0x159378,{'children':[a5_0x5b3da7(Box,{'marginTop':0x1,'children':a5_0x5b3da7(Text,{'color':_0x540f3c(0x131),'children':_0x540f3c(0x137)})}),_0x3e3c6e[_0x540f3c(0x155)](_0xee430f=>_0xee430f[_0x540f3c(0x15f)])[_0x540f3c(0x15d)]((_0x1c25d8,_0x493685)=>a5_0x53544d(Box,{'marginLeft':0x2,'children':[a5_0x53544d(Text,{'color':_0x540f3c(0x13c),'children':['•\x20',_0x1c25d8['filePath']]}),a5_0x53544d(Text,{'color':'dim','children':[_0x540f3c(0x13b),_0x1c25d8[_0x540f3c(0x12f)]]})]},_0x493685))]}),_0x24261a>0x0&&a5_0x53544d(a5_0x159378,{'children':[a5_0x5b3da7(Box,{'marginTop':0x1,'children':a5_0x5b3da7(Text,{'color':_0x540f3c(0x152),'children':_0x540f3c(0x15e)})}),_0x3e3c6e[_0x540f3c(0x155)](_0x11f2c9=>!_0x11f2c9[_0x540f3c(0x15f)])['map']((_0x526967,_0x122b60)=>a5_0x53544d(Box,{'marginLeft':0x2,'flexDirection':_0x540f3c(0x12b),'children':[a5_0x53544d(Text,{'color':_0x540f3c(0x159),'children':['•\x20',_0x526967['datasetName'],'\x20(',_0x526967[_0x540f3c(0x151)],')']}),_0x526967[_0x540f3c(0x156)]&&a5_0x5b3da7(Box,{'marginLeft':0x2,'children':a5_0x5b3da7(Text,{'color':'dim','children':_0x526967['error']})})]},_0x122b60))]})]}),_0x43e822&&a5_0x53544d(Box,{'flexDirection':_0x540f3c(0x12b),'children':[a5_0x5b3da7(Box,{'children':a5_0x53544d(Text,{'color':'red','children':['❌\x20',_0x43e822]})}),_0x43e822[_0x540f3c(0x13f)]('登录')&&a5_0x53544d(Box,{'marginTop':0x1,'children':[a5_0x5b3da7(Text,{'color':_0x540f3c(0x152),'children':'💡\x20请使用\x20'}),a5_0x5b3da7(Text,{'color':_0x540f3c(0x13c),'children':_0x540f3c(0x12a)}),a5_0x5b3da7(Text,{'color':_0x540f3c(0x152),'children':'\x20重新登录后再试'})]})]})]});};function a5_0x4617(){const _0x134426=['green','log','\x1b[33m!\x20以下数据集代码不存在:\x20','setLogPath','*\x20生成的文档文件:','14867127jxaPmN','使用配置的应用AppCode:\x20','未提供应用AppCode,且配置中也没有默认值','\x20-\x20','cyan','7MwBlDb','√\x20文档生成完成!成功\x20','includes','\x1b[0m','./docs','\x20个匹配的数据集\x1b[0m','2732310lnAFGQ','111LXLcTh','10198uGxmky','4423386DzRKBY','指定的数据集代码都不存在:\x20','join',',\x20失败\x20','未找到任何数据集','message','length','*\x20共处理\x20','string','.md\x20(','9NhBYOg','datasetCode','yellow','4uAVyVt','文档生成完成','filter','error','env','正在生成\x20','red','文档生成失败:\x20','\x20个数据集的文档...','cwd','map','⚠️\x20以下数据集生成失败:','success','\x1b[90m*\x20从\x20','\x20个数据集','\x20个数据集中筛选出\x20','lovrabet\x20auth','column','41845okGXnL','使用指定的应用AppCode:\x20','750778FIRKBN','datasetName','6193768SAAGkm','gray','api-doc'];a5_0x4617=function(){return _0x134426;};return a5_0x4617();}
1
+ (function(_0x2e0dfe,_0x4bb0eb){const _0x1ab148=a5_0x1776,_0x1041ed=_0x2e0dfe();while(!![]){try{const _0x5d9787=-parseInt(_0x1ab148(0x1b8))/0x1+-parseInt(_0x1ab148(0x1ce))/0x2+parseInt(_0x1ab148(0x19f))/0x3*(-parseInt(_0x1ab148(0x1c3))/0x4)+-parseInt(_0x1ab148(0x1c4))/0x5+-parseInt(_0x1ab148(0x1be))/0x6+-parseInt(_0x1ab148(0x1b3))/0x7+parseInt(_0x1ab148(0x1a2))/0x8;if(_0x5d9787===_0x4bb0eb)break;else _0x1041ed['push'](_0x1041ed['shift']());}catch(_0x39ae95){_0x1041ed['push'](_0x1041ed['shift']());}}}(a5_0x22a5,0x5f8be));import{jsx as a5_0x2bb031,jsxs as a5_0x3ce69b,Fragment as a5_0x3e8a51}from'react/jsx-runtime';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';function a5_0x1776(_0x5b4de1,_0x1a6969){_0x5b4de1=_0x5b4de1-0x19f;const _0x22a577=a5_0x22a5();let _0x177657=_0x22a577[_0x5b4de1];return _0x177657;}import{initEnv}from'../constant/env.js';import{fetchModelList}from'./fetch-model-list.js';import{generateDatasetDocs}from'./api-doc.js';import{logger}from'../utils/logger.js';function a5_0x22a5(){const _0x394fd1=['env','string','cyan','gray','539555PflTgV','log','column','*\x20生成的文档文件:','\x20重新登录后再试','正在获取数据集列表...','2927832FlOyKc','red','\x1b[33m!\x20以下数据集代码不存在:\x20','未提供应用AppCode,且配置中也没有默认值','error','34968TlyZrN','236790tUvoFz','filePath','datasetName','api-doc','⚠️\x20以下数据集生成失败:','white','includes','\x20个数据集',',\x20失败\x20','map','1388244UtKGcO','success','\x20(环境:\x20','*\x20共处理\x20','filter','\x20个数据集中筛选出\x20','length','192XVdNvG','online','yellow','23650040ZyoBPW','指定的数据集代码都不存在:\x20','datasetCode','green','lovrabet\x20auth','join','dim','使用配置的应用AppCode:\x20','\x1b[0m','文档生成失败:\x20','\x20个数据集的文档...','setLogPath','message','cwd','正在生成\x20','\x20-\x20','\x20个匹配的数据集\x1b[0m','1654814PDBAJc'];a5_0x22a5=function(){return _0x394fd1;};return a5_0x22a5();}export const ApiDocUI=({appCode:_0x5cc74a,env:_0x570c4b,output:_0x3162a1,extraParams:_0x5d020b,datasetCodes:_0x4814a3})=>{const _0x36d07f=a5_0x1776,{exit:_0x3bb367}=useApp(),[_0x397990,_0x21734e]=useState(![]),[_0x70c91c,_0xcc5122]=useState(''),[_0x5c4775,_0xa75daa]=useState(![]),[_0x7ff32f,_0x18aac2]=useState(null),[_0x245eb7,_0x3fff5e]=useState(null),[_0x1fbaf7,_0x498b5a]=useState(0x0),_0x5f456e=readConfig(),_0x530fd6=getConfigAppCode(),_0x3cffcf=_0x5cc74a||_0x530fd6,_0x5444d2=typeof _0x5f456e?.['env']===_0x36d07f(0x1b5)?_0x5f456e[_0x36d07f(0x1b4)]:undefined,_0x51ea59=_0x570c4b||_0x5444d2||_0x36d07f(0x1a0);initEnv(_0x51ea59);const _0x5d5bd2=_0x3162a1||'./docs',_0x486cf4=_0x5cc74a?'使用指定的应用AppCode:\x20'+_0x3cffcf:_0x36d07f(0x1a9)+_0x3cffcf;useEffect(()=>{_0x21734e(!![]),_0x420c90();},[]),useEffect(()=>{(_0x5c4775||_0x7ff32f)&&_0x3bb367();},[_0x5c4775,_0x7ff32f,_0x3bb367]);async function _0x420c90(){const _0xee1bbd=_0x36d07f;if(!_0x3cffcf){_0x18aac2(_0xee1bbd(0x1c1));return;}try{logger[_0xee1bbd(0x1ad)](process[_0xee1bbd(0x1af)]()),_0xcc5122(_0xee1bbd(0x1bd));const {configArray:_0x337be8}=await fetchModelList(_0x3cffcf);_0x498b5a(_0x337be8[_0xee1bbd(0x1d4)]);if(_0x337be8[_0xee1bbd(0x1d4)]===0x0){_0x18aac2('未找到任何数据集');return;}let _0x444003=_0x337be8;if(_0x4814a3&&_0x4814a3[_0xee1bbd(0x1d4)]>0x0){_0x444003=_0x337be8[_0xee1bbd(0x1d2)](_0x1b37f9=>_0x4814a3[_0xee1bbd(0x1ca)](_0x1b37f9[_0xee1bbd(0x1a4)]));const _0x4b55e1=_0x444003[_0xee1bbd(0x1cd)](_0x4a489a=>_0x4a489a[_0xee1bbd(0x1a4)]),_0x42ae64=_0x4814a3['filter'](_0x27f09d=>!_0x4b55e1[_0xee1bbd(0x1ca)](_0x27f09d));_0x42ae64[_0xee1bbd(0x1d4)]>0x0&&console[_0xee1bbd(0x1b9)](_0xee1bbd(0x1c0)+_0x42ae64['join'](',\x20')+_0xee1bbd(0x1aa));if(_0x444003[_0xee1bbd(0x1d4)]===0x0){_0x18aac2(_0xee1bbd(0x1a3)+_0x4814a3[_0xee1bbd(0x1a7)](',\x20'));return;}console[_0xee1bbd(0x1b9)]('\x1b[90m*\x20从\x20'+_0x337be8[_0xee1bbd(0x1d4)]+_0xee1bbd(0x1d3)+_0x444003[_0xee1bbd(0x1d4)]+_0xee1bbd(0x1b2));}_0xcc5122(_0xee1bbd(0x1b0)+_0x444003[_0xee1bbd(0x1d4)]+_0xee1bbd(0x1ac));const _0x5ae04b=await generateDatasetDocs(_0x444003,_0x3cffcf,_0x5d5bd2,(_0x2e5e23,_0x7d3778,_0x5a798a)=>{const _0x6373d4=_0xee1bbd;_0xcc5122(_0x6373d4(0x1b0)+_0x5a798a+'.md\x20('+_0x2e5e23+'/'+_0x7d3778+')');},_0x5d020b);_0x3fff5e(_0x5ae04b),_0xa75daa(!![]);const _0x55d8e8=_0x5ae04b[_0xee1bbd(0x1d2)](_0x59afbe=>_0x59afbe[_0xee1bbd(0x1cf)])[_0xee1bbd(0x1d4)],_0x45c927=_0x5ae04b['filter'](_0x205c92=>!_0x205c92[_0xee1bbd(0x1cf)])['length'];logger[_0xee1bbd(0x1cf)]('api-doc','文档生成完成',undefined,{'totalCount':_0x5ae04b['length'],'successCount':_0x55d8e8,'failCount':_0x45c927,'outputDir':_0x5d5bd2});}catch(_0x2038fe){const _0x30b413=_0x2038fe instanceof Error?_0x2038fe[_0xee1bbd(0x1ae)]:String(_0x2038fe);logger[_0xee1bbd(0x1c2)](_0xee1bbd(0x1c7),_0xee1bbd(0x1ab)+_0x30b413,{'appCode':_0x3cffcf,'outputDir':_0x5d5bd2}),_0x18aac2(_0xee1bbd(0x1ab)+_0x30b413);}finally{_0x21734e(![]);}}const _0x2742e1=_0x245eb7?.['filter'](_0x1a5c06=>_0x1a5c06[_0x36d07f(0x1cf)])[_0x36d07f(0x1d4)]||0x0,_0x33fd8a=_0x245eb7?.[_0x36d07f(0x1d2)](_0xbd0bb1=>!_0xbd0bb1[_0x36d07f(0x1cf)])[_0x36d07f(0x1d4)]||0x0;return a5_0x3ce69b(Box,{'flexDirection':_0x36d07f(0x1ba),'children':[(_0x397990||_0x5c4775)&&a5_0x3ce69b(Box,{'children':[a5_0x2bb031(Text,{'color':_0x36d07f(0x1b7),'children':'*\x20'}),a5_0x2bb031(Text,{'color':_0x5cc74a?_0x36d07f(0x1c9):_0x36d07f(0x1a8),'children':_0x486cf4})]}),_0x397990&&a5_0x2bb031(Box,{'children':a5_0x3ce69b(Text,{'children':['🚀\x20',_0x70c91c,_0x36d07f(0x1d0),_0x51ea59,')']})}),_0x5c4775&&_0x245eb7&&a5_0x3ce69b(Box,{'flexDirection':_0x36d07f(0x1ba),'children':[a5_0x2bb031(Box,{'children':a5_0x3ce69b(Text,{'color':_0x36d07f(0x1a5),'children':['√\x20文档生成完成!成功\x20',_0x2742e1,'\x20个',_0x33fd8a>0x0&&_0x36d07f(0x1cc)+_0x33fd8a+'\x20个']})}),a5_0x2bb031(Box,{'marginTop':0x1,'children':a5_0x3ce69b(Text,{'color':_0x36d07f(0x1b7),'children':[_0x36d07f(0x1d1),_0x1fbaf7,_0x36d07f(0x1cb)]})}),a5_0x3ce69b(Box,{'marginTop':0x1,'children':[a5_0x2bb031(Text,{'color':_0x36d07f(0x1b7),'children':'*\x20输出目录:\x20'}),a5_0x2bb031(Text,{'color':_0x36d07f(0x1b6),'children':_0x5d5bd2})]}),_0x2742e1>0x0&&a5_0x3ce69b(a5_0x3e8a51,{'children':[a5_0x2bb031(Box,{'marginTop':0x1,'children':a5_0x2bb031(Text,{'color':_0x36d07f(0x1b7),'children':_0x36d07f(0x1bb)})}),_0x245eb7[_0x36d07f(0x1d2)](_0x4489e7=>_0x4489e7[_0x36d07f(0x1cf)])[_0x36d07f(0x1cd)]((_0x216890,_0x87a027)=>a5_0x3ce69b(Box,{'marginLeft':0x2,'children':[a5_0x3ce69b(Text,{'color':'cyan','children':['•\x20',_0x216890[_0x36d07f(0x1c5)]]}),a5_0x3ce69b(Text,{'color':'dim','children':[_0x36d07f(0x1b1),_0x216890[_0x36d07f(0x1c6)]]})]},_0x87a027))]}),_0x33fd8a>0x0&&a5_0x3ce69b(a5_0x3e8a51,{'children':[a5_0x2bb031(Box,{'marginTop':0x1,'children':a5_0x2bb031(Text,{'color':_0x36d07f(0x1a1),'children':_0x36d07f(0x1c8)})}),_0x245eb7[_0x36d07f(0x1d2)](_0x4c9d27=>!_0x4c9d27[_0x36d07f(0x1cf)])['map']((_0x3a0c48,_0x153fa1)=>a5_0x3ce69b(Box,{'marginLeft':0x2,'flexDirection':_0x36d07f(0x1ba),'children':[a5_0x3ce69b(Text,{'color':_0x36d07f(0x1bf),'children':['•\x20',_0x3a0c48[_0x36d07f(0x1c6)],'\x20(',_0x3a0c48[_0x36d07f(0x1a4)],')']}),_0x3a0c48[_0x36d07f(0x1c2)]&&a5_0x2bb031(Box,{'marginLeft':0x2,'children':a5_0x2bb031(Text,{'color':_0x36d07f(0x1a8),'children':_0x3a0c48['error']})})]},_0x153fa1))]})]}),_0x7ff32f&&a5_0x3ce69b(Box,{'flexDirection':'column','children':[a5_0x2bb031(Box,{'children':a5_0x3ce69b(Text,{'color':_0x36d07f(0x1bf),'children':['❌\x20',_0x7ff32f]})}),_0x7ff32f['includes']('登录')&&a5_0x3ce69b(Box,{'marginTop':0x1,'children':[a5_0x2bb031(Text,{'color':_0x36d07f(0x1a1),'children':'💡\x20请使用\x20'}),a5_0x2bb031(Text,{'color':_0x36d07f(0x1b6),'children':_0x36d07f(0x1a6)}),a5_0x2bb031(Text,{'color':'yellow','children':_0x36d07f(0x1bc)})]})]})]});};
@@ -1 +1 @@
1
- const a6_0x2dca5a=a6_0x5c36;function a6_0x5c36(_0x56a08d,_0x4b5bd9){_0x56a08d=_0x56a08d-0x165;const _0x592609=a6_0x5926();let _0x5c367b=_0x592609[_0x56a08d];return _0x5c367b;}(function(_0x2cadad,_0x4cf5cb){const _0x412ff4=a6_0x5c36,_0x119fea=_0x2cadad();while(!![]){try{const _0x4dce12=parseInt(_0x412ff4(0x18f))/0x1+-parseInt(_0x412ff4(0x176))/0x2*(parseInt(_0x412ff4(0x185))/0x3)+parseInt(_0x412ff4(0x17c))/0x4*(parseInt(_0x412ff4(0x17e))/0x5)+-parseInt(_0x412ff4(0x184))/0x6+-parseInt(_0x412ff4(0x179))/0x7+parseInt(_0x412ff4(0x183))/0x8*(parseInt(_0x412ff4(0x18b))/0x9)+parseInt(_0x412ff4(0x168))/0xa*(parseInt(_0x412ff4(0x16f))/0xb);if(_0x4dce12===_0x4cf5cb)break;else _0x119fea['push'](_0x119fea['shift']());}catch(_0x5db119){_0x119fea['push'](_0x119fea['shift']());}}}(a6_0x5926,0xea9e5));import{mkdirSync,writeFileSync}from'node:fs';import a6_0x10734e from'node:path';import{getCookie}from'../auth/get-cookie.js';function a6_0x5926(){const _0x516459=[']\x20正在生成:\x20','13478531mIkvtB','stringify','):缺少\x20data.markdown\x20字段','json','生成文档失败:\x20','\x20个数据集需要生成文档\x0a','join','62JjdoXa','name','./docs','289982lmKURy','.md','),HTTP状态码:\x20','12pHXyeQ','等待\x203\x20秒...\x0a','2278315FrVtZY','data','api-doc','\x0a共有\x20','length','70936KvhRzt','7372836OvUDwB','144744neSmbp','/api/node-toolbox/api-doc-generator','.md\x20-\x20','text','log','application/json','468NoEKdL','string','生成文档成功:\x20','message','673523ofOgeI','✓\x20成功生成:\x20','tableName','获取文档失败\x20(','10HVcABe','markdown','✗\x20失败:\x20','status','datasetCode','.md\x20('];a6_0x5926=function(){return _0x516459;};return a6_0x5926();}import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';export async function fetchDatasetDoc(_0x5654c7){const _0x1f613d=a6_0x5c36,{appCode:_0x3152ac,datasetCode:_0x1dd43a,datasetId:_0x26c3af,extraParams:_0x32d966}=_0x5654c7,_0xb96455=getApiDomain(),_0x1c7859=_0xb96455+_0x1f613d(0x186),_0x3df5eb={'appCode':_0x3152ac,'datasetCode':_0x1dd43a,'datasetId':_0x26c3af,..._0x32d966||{}},_0x389d81=await fetch(_0x1c7859,{'method':'POST','headers':{'Content-Type':_0x1f613d(0x18a),'Cookie':getCookie()},'body':JSON[_0x1f613d(0x170)](_0x3df5eb)});if(!_0x389d81['ok']){if(_0x389d81[_0x1f613d(0x16b)]===0x191)throw new Error('登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录');let _0x2ecfcd='';try{_0x2ecfcd=await _0x389d81[_0x1f613d(0x188)]();}catch(_0x67e57a){}throw new Error(_0x1f613d(0x167)+_0x1dd43a+_0x1f613d(0x17b)+_0x389d81[_0x1f613d(0x16b)]+(_0x2ecfcd?'\x0a'+_0x2ecfcd:''));}const _0x26c083=await _0x389d81[_0x1f613d(0x172)]();if(!_0x26c083[_0x1f613d(0x17f)]||typeof _0x26c083['data'][_0x1f613d(0x169)]!==_0x1f613d(0x18c))throw new Error('响应数据格式错误\x20('+_0x1dd43a+_0x1f613d(0x171));return _0x26c083[_0x1f613d(0x17f)][_0x1f613d(0x169)];}function delay(_0x11b70f){return new Promise(_0x3934da=>setTimeout(_0x3934da,_0x11b70f));}export async function generateDatasetDocs(_0xbaf22d,_0x5fe309,_0x42847e=a6_0x2dca5a(0x178),_0x112a32,_0x720ee){const _0x28a901=a6_0x2dca5a;mkdirSync(_0x42847e,{'recursive':!![]});const _0x466e30=[],_0x431481=_0xbaf22d[_0x28a901(0x182)];console[_0x28a901(0x189)](_0x28a901(0x181)+_0x431481+_0x28a901(0x174));for(let _0x347863=0x0;_0x347863<_0xbaf22d['length'];_0x347863++){const _0x4fc74a=_0xbaf22d[_0x347863],_0x5db781=_0x347863+0x1,_0x5749b3=_0x4fc74a[_0x28a901(0x166)];try{console['log']('['+_0x5db781+'/'+_0x431481+_0x28a901(0x16e)+_0x5749b3+_0x28a901(0x16d)+_0x4fc74a['name']+')');_0x112a32&&_0x112a32(_0x5db781,_0x431481,_0x5749b3);const _0x11d7e8=await fetchDatasetDoc({'appCode':_0x5fe309,'datasetCode':_0x4fc74a[_0x28a901(0x16c)],'datasetId':_0x4fc74a['id'],'enableAI':![],'extraParams':_0x720ee}),_0x3f64f6=a6_0x10734e[_0x28a901(0x175)](_0x42847e,_0x5749b3+_0x28a901(0x17a));writeFileSync(_0x3f64f6,_0x11d7e8,{'encoding':'utf8'}),console[_0x28a901(0x189)](_0x28a901(0x165)+_0x5749b3+_0x28a901(0x17a)),logger['success'](_0x28a901(0x180),_0x28a901(0x18d)+_0x5749b3,undefined,{'datasetCode':_0x4fc74a[_0x28a901(0x16c)],'datasetName':_0x4fc74a['name'],'filePath':_0x3f64f6,'progress':_0x5db781+'/'+_0x431481}),_0x466e30['push']({'datasetCode':_0x4fc74a[_0x28a901(0x16c)],'datasetName':_0x4fc74a['name'],'filePath':_0x3f64f6,'success':!![]}),_0x5db781<_0x431481&&await delay(0x1388);}catch(_0x5ad919){const _0x5d08c2=_0x5ad919 instanceof Error?_0x5ad919[_0x28a901(0x18e)]:String(_0x5ad919);console[_0x28a901(0x189)](_0x28a901(0x16a)+_0x5749b3+_0x28a901(0x187)+_0x5d08c2+'\x0a'),logger['error'](_0x28a901(0x180),_0x28a901(0x173)+_0x4fc74a[_0x28a901(0x16c)],{'datasetCode':_0x4fc74a[_0x28a901(0x16c)],'datasetName':_0x4fc74a[_0x28a901(0x177)],'error':_0x5d08c2,'progress':_0x5db781+'/'+_0x431481}),_0x466e30['push']({'datasetCode':_0x4fc74a['datasetCode'],'datasetName':_0x4fc74a['name'],'filePath':'','success':![],'error':_0x5d08c2}),_0x5db781<_0x431481&&(console['log'](_0x28a901(0x17d)),await delay(0xbb8));}}return _0x466e30;}
1
+ (function(_0x3336f2,_0x4791a1){const _0x36f22f=a6_0xc749,_0x551836=_0x3336f2();while(!![]){try{const _0x32f85a=parseInt(_0x36f22f(0xba))/0x1+parseInt(_0x36f22f(0xca))/0x2+parseInt(_0x36f22f(0xb9))/0x3*(parseInt(_0x36f22f(0xc3))/0x4)+parseInt(_0x36f22f(0xbc))/0x5+parseInt(_0x36f22f(0xd6))/0x6*(parseInt(_0x36f22f(0xc9))/0x7)+parseInt(_0x36f22f(0xb4))/0x8+parseInt(_0x36f22f(0xc2))/0x9*(-parseInt(_0x36f22f(0xd4))/0xa);if(_0x32f85a===_0x4791a1)break;else _0x551836['push'](_0x551836['shift']());}catch(_0x6abfba){_0x551836['push'](_0x551836['shift']());}}}(a6_0x120a,0xc8937));import{mkdirSync,writeFileSync}from'node:fs';function a6_0x120a(){const _0x1175c7=['2029484PVIDQU','status','/api/node-toolbox/api-doc-generator','success','stringify','markdown','.md','),HTTP状态码:\x20','message','length','44921680uByfFk','生成文档失败:\x20','6BiPmCS','text','✗\x20失败:\x20','api-doc','\x20个数据集需要生成文档\x0a','data','error','push','name','10465048QeNLQP','\x0a共有\x20','tableName','join','json','129jkdfqK','181088zjIkJS','datasetCode','7338590lzxHcL','log','生成文档成功:\x20','响应数据格式错误\x20(','POST','):缺少\x20data.markdown\x20字段','9OjrzEK','58356OkJwoq','.md\x20-\x20','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','application/json',']\x20正在生成:\x20','✓\x20成功生成:\x20','5003047wrWaki'];a6_0x120a=function(){return _0x1175c7;};return a6_0x120a();}import a6_0x5e98da from'node:path';import{getCookie}from'../auth/get-cookie.js';function a6_0xc749(_0x15d4fb,_0x5c7160){_0x15d4fb=_0x15d4fb-0xb0;const _0x120a85=a6_0x120a();let _0xc74993=_0x120a85[_0x15d4fb];return _0xc74993;}import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';export async function fetchDatasetDoc(_0x4bbd24){const _0x541bfd=a6_0xc749,{appCode:_0x422073,datasetCode:_0x537a5c,datasetId:_0x240078,extraParams:_0x4c555b}=_0x4bbd24,_0x3f58a2=getApiDomain(),_0x229f84=_0x3f58a2+_0x541bfd(0xcc),_0x42b9d4={'appCode':_0x422073,'datasetCode':_0x537a5c,'datasetId':_0x240078,..._0x4c555b||{}},_0x2aa6cd=await fetch(_0x229f84,{'method':_0x541bfd(0xc0),'headers':{'Content-Type':_0x541bfd(0xc6),'Cookie':getCookie()},'body':JSON[_0x541bfd(0xce)](_0x42b9d4)});if(!_0x2aa6cd['ok']){if(_0x2aa6cd[_0x541bfd(0xcb)]===0x191)throw new Error(_0x541bfd(0xc5));let _0x10817e='';try{_0x10817e=await _0x2aa6cd[_0x541bfd(0xd7)]();}catch(_0x148ccc){}throw new Error('获取文档失败\x20('+_0x537a5c+_0x541bfd(0xd1)+_0x2aa6cd[_0x541bfd(0xcb)]+(_0x10817e?'\x0a'+_0x10817e:''));}const _0x554608=await _0x2aa6cd[_0x541bfd(0xb8)]();if(!_0x554608['data']||typeof _0x554608[_0x541bfd(0xb0)][_0x541bfd(0xcf)]!=='string')throw new Error(_0x541bfd(0xbf)+_0x537a5c+_0x541bfd(0xc1));return _0x554608['data']['markdown'];}function delay(_0x1c899b){return new Promise(_0x296c4d=>setTimeout(_0x296c4d,_0x1c899b));}export async function generateDatasetDocs(_0xd75a5b,_0x584dc4,_0xba8764='./docs',_0x1ab580,_0x459f84){const _0x58db29=a6_0xc749;mkdirSync(_0xba8764,{'recursive':!![]});const _0x6b189b=[],_0x2c51fd=_0xd75a5b[_0x58db29(0xd3)];console['log'](_0x58db29(0xb5)+_0x2c51fd+_0x58db29(0xda));for(let _0xa89b68=0x0;_0xa89b68<_0xd75a5b[_0x58db29(0xd3)];_0xa89b68++){const _0x148d32=_0xd75a5b[_0xa89b68],_0x18b89e=_0xa89b68+0x1,_0x2192a0=_0x148d32[_0x58db29(0xb6)];try{console[_0x58db29(0xbd)]('['+_0x18b89e+'/'+_0x2c51fd+_0x58db29(0xc7)+_0x2192a0+'.md\x20('+_0x148d32['name']+')');_0x1ab580&&_0x1ab580(_0x18b89e,_0x2c51fd,_0x2192a0);const _0x3d7bef=await fetchDatasetDoc({'appCode':_0x584dc4,'datasetCode':_0x148d32['datasetCode'],'datasetId':_0x148d32['id'],'enableAI':![],'extraParams':_0x459f84}),_0x1c3acd=a6_0x5e98da[_0x58db29(0xb7)](_0xba8764,_0x2192a0+_0x58db29(0xd0));writeFileSync(_0x1c3acd,_0x3d7bef,{'encoding':'utf8'}),console['log'](_0x58db29(0xc8)+_0x2192a0+_0x58db29(0xd0)),logger[_0x58db29(0xcd)](_0x58db29(0xd9),_0x58db29(0xbe)+_0x2192a0,undefined,{'datasetCode':_0x148d32['datasetCode'],'datasetName':_0x148d32[_0x58db29(0xb3)],'filePath':_0x1c3acd,'progress':_0x18b89e+'/'+_0x2c51fd}),_0x6b189b[_0x58db29(0xb2)]({'datasetCode':_0x148d32[_0x58db29(0xbb)],'datasetName':_0x148d32[_0x58db29(0xb3)],'filePath':_0x1c3acd,'success':!![]}),_0x18b89e<_0x2c51fd&&await delay(0x1388);}catch(_0xd6b262){const _0x18ccf4=_0xd6b262 instanceof Error?_0xd6b262[_0x58db29(0xd2)]:String(_0xd6b262);console[_0x58db29(0xbd)](_0x58db29(0xd8)+_0x2192a0+_0x58db29(0xc4)+_0x18ccf4+'\x0a'),logger[_0x58db29(0xb1)](_0x58db29(0xd9),_0x58db29(0xd5)+_0x148d32['datasetCode'],{'datasetCode':_0x148d32[_0x58db29(0xbb)],'datasetName':_0x148d32[_0x58db29(0xb3)],'error':_0x18ccf4,'progress':_0x18b89e+'/'+_0x2c51fd}),_0x6b189b['push']({'datasetCode':_0x148d32[_0x58db29(0xbb)],'datasetName':_0x148d32[_0x58db29(0xb3)],'filePath':'','success':![],'error':_0x18ccf4}),_0x18b89e<_0x2c51fd&&(console['log']('等待\x203\x20秒...\x0a'),await delay(0xbb8));}}return _0x6b189b;}
@@ -1 +1 @@
1
- (function(_0x2d5ee1,_0x26591a){const _0x69ae7c=a7_0x1227,_0x154a80=_0x2d5ee1();while(!![]){try{const _0x2f7259=parseInt(_0x69ae7c(0x181))/0x1+parseInt(_0x69ae7c(0x17e))/0x2*(-parseInt(_0x69ae7c(0x197))/0x3)+parseInt(_0x69ae7c(0x198))/0x4+parseInt(_0x69ae7c(0x184))/0x5+-parseInt(_0x69ae7c(0x16c))/0x6*(-parseInt(_0x69ae7c(0x18a))/0x7)+-parseInt(_0x69ae7c(0x194))/0x8*(-parseInt(_0x69ae7c(0x190))/0x9)+-parseInt(_0x69ae7c(0x178))/0xa*(parseInt(_0x69ae7c(0x18e))/0xb);if(_0x2f7259===_0x26591a)break;else _0x154a80['push'](_0x154a80['shift']());}catch(_0x3a0a51){_0x154a80['push'](_0x154a80['shift']());}}}(a7_0x51a7,0x1d752));import{jsx as a7_0x21c88b,jsxs as a7_0x390caf}from'react/jsx-runtime';import{useEffect,useState}from'react';function a7_0x51a7(){const _0x116a87=['lovrabet\x20auth','\x20个模型','332814yctRmS','\x20个数据集,生成','modelCount','split','error','slice','\x20from\x20\x27@/','duplicateCount','{\x20lovrabetClient\x20}','🚀\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','\x20重新登录后再试','column','2989460pLCoaq','import\x20','join','client','green','white','113882VaSLkW','.ts','拉取\x20API\x20配置失败:\x20','68513TRycXw','√\x20成功拉取\x20','\x20个,过滤重复','1091360FnhzuJ','使用配置的应用AppCode:\x20','datasetCount','online','api-pull','yellow','21wrnGBp','cwd','message','\x20个模型)','11tWQQam','cyan','145116yqFnNc','使用指定的应用AppCode:\x20','!\x20原始数据集\x20','gray','32QVdNXV','\x20-\x20客户端实例文件','includes','6mfSTGt','63192deuUlk','dim','replace','setLogPath','-\x20模型配置文件\x20(','-client','api','originalCount','未提供应用AppCode,且配置中也没有默认值','./src/api/'];a7_0x51a7=function(){return _0x116a87;};return a7_0x51a7();}function a7_0x1227(_0x32e64e,_0x411f2f){_0x32e64e=_0x32e64e-0x161;const _0x51a7f8=a7_0x51a7();let _0x12277c=_0x51a7f8[_0x32e64e];return _0x12277c;}import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';import{initEnv}from'../constant/env.js';import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';import{fetchModelList}from'./fetch-model-list.js';export const ApiPullUI=({appCode:_0x2cfbab,env:_0x80359a,output:_0x253cb1})=>{const _0x182187=a7_0x1227,{exit:_0x22c97b}=useApp(),[_0x5c08ff,_0x491cd3]=useState(![]),[_0x543e44,_0x5e6f1b]=useState(![]),[_0x33b88a,_0x1c2610]=useState(null),[_0x1f2409,_0x3d5813]=useState(null),_0x47d308=readConfig(),_0x177d5f=getConfigAppCode(),_0x2454cc=_0x2cfbab||_0x177d5f,_0x30b02e=typeof _0x47d308?.['env']==='string'?_0x47d308['env']:undefined,_0x2c8825=_0x80359a||_0x30b02e||_0x182187(0x187);initEnv(_0x2c8825);const _0x1131c3=_0x253cb1||_0x182187(0x169),_0x23f232=_0x2cfbab&&_0x2cfbab['includes']('-')?_0x2cfbab[_0x182187(0x16f)]('-')[_0x182187(0x171)](0x1)[_0x182187(0x17a)]('-'):'',_0x30298c=_0x2cfbab?_0x182187(0x191)+_0x2454cc:_0x182187(0x185)+_0x2454cc,_0x4ebe2e=_0x23f232?_0x23f232+'-api':_0x182187(0x166),_0xa97319=_0x23f232?_0x23f232+_0x182187(0x165):_0x182187(0x17b);useEffect(()=>{_0x491cd3(!![]),_0x159ac4();},[]),useEffect(()=>{(_0x543e44||_0x33b88a)&&_0x22c97b();},[_0x543e44,_0x33b88a,_0x22c97b]);async function _0x159ac4(){const _0x261c09=_0x182187;if(!_0x2454cc){_0x1c2610(_0x261c09(0x168));return;}try{logger[_0x261c09(0x163)](process[_0x261c09(0x18b)]());const {configArray:_0x270409}=await fetchModelList(_0x2454cc),_0x2f4d95=_0x270409['length'],_0x3bf3c7=!_0x2cfbab,_0x24a74b=await generateApiFile(_0x270409,_0x23f232,_0x2454cc,_0x3bf3c7,_0x2c8825,_0x1131c3),_0x5bb2dd=_0x1131c3['endsWith']('/')?_0x1131c3:_0x1131c3+'/';_0x3d5813({'api':''+_0x5bb2dd+_0x4ebe2e+_0x261c09(0x17f),'client':''+_0x5bb2dd+_0xa97319+_0x261c09(0x17f),'modelCount':_0x24a74b[_0x261c09(0x16e)],'datasetCount':_0x2f4d95,'originalCount':_0x2f4d95,'duplicateCount':0x0}),_0x5e6f1b(!![]);}catch(_0x41c849){const _0x24c2d2=_0x41c849 instanceof Error?_0x41c849[_0x261c09(0x18c)]:String(_0x41c849);logger[_0x261c09(0x170)](_0x261c09(0x188),'拉取\x20API\x20配置失败:\x20'+_0x24c2d2,{'appCode':_0x2454cc,'error':_0x24c2d2}),_0x1c2610(_0x261c09(0x180)+_0x24c2d2);}finally{_0x491cd3(![]);}}return a7_0x390caf(Box,{'flexDirection':_0x182187(0x177),'children':[(_0x5c08ff||_0x543e44)&&a7_0x390caf(Box,{'children':[a7_0x21c88b(Text,{'color':_0x182187(0x193),'children':'*\x20'}),a7_0x21c88b(Text,{'color':_0x2cfbab?_0x182187(0x17d):_0x182187(0x161),'children':_0x30298c})]}),_0x5c08ff&&a7_0x21c88b(Box,{'children':a7_0x390caf(Text,{'children':[_0x182187(0x175),_0x2c8825,')']})}),_0x543e44&&_0x1f2409&&a7_0x390caf(Box,{'flexDirection':_0x182187(0x177),'children':[a7_0x21c88b(Box,{'children':a7_0x390caf(Text,{'color':_0x182187(0x17c),'children':[_0x182187(0x182),_0x1f2409[_0x182187(0x186)],_0x182187(0x16d),'\x20',_0x1f2409[_0x182187(0x16e)],_0x182187(0x16b)]})}),_0x1f2409['duplicateCount']>0x0&&a7_0x21c88b(Box,{'marginTop':0x1,'children':a7_0x390caf(Text,{'color':_0x182187(0x189),'children':[_0x182187(0x192),_0x1f2409[_0x182187(0x167)],_0x182187(0x183),'\x20',_0x1f2409[_0x182187(0x173)],'\x20个']})}),a7_0x21c88b(Box,{'marginTop':0x1,'children':a7_0x21c88b(Text,{'color':_0x182187(0x193),'children':'*\x20已生成文件:'})}),a7_0x390caf(Box,{'marginLeft':0x2,'children':[a7_0x390caf(Text,{'color':'cyan','children':['•\x20',_0x1f2409[_0x182187(0x166)]]}),a7_0x390caf(Text,{'color':'dim','children':['\x20',_0x182187(0x164),_0x1f2409['modelCount'],_0x182187(0x18d)]})]}),a7_0x390caf(Box,{'marginLeft':0x2,'children':[a7_0x390caf(Text,{'color':_0x182187(0x18f),'children':['•\x20',_0x1f2409['client']]}),a7_0x21c88b(Text,{'color':'dim','children':_0x182187(0x195)})]}),a7_0x21c88b(Box,{'marginTop':0x1,'children':a7_0x21c88b(Text,{'color':'gray','children':'*\x20导入方式:'})}),a7_0x21c88b(Box,{'marginLeft':0x2,'children':a7_0x390caf(Text,{'color':_0x182187(0x189),'children':[_0x182187(0x179),_0x182187(0x174),_0x182187(0x172),_0x1f2409[_0x182187(0x17b)]['replace'](/^\.\//,'')[_0x182187(0x162)]('.ts',''),'\x27']})})]}),_0x33b88a&&a7_0x390caf(Box,{'flexDirection':_0x182187(0x177),'children':[a7_0x21c88b(Box,{'children':a7_0x390caf(Text,{'color':'red','children':['❌\x20',_0x33b88a]})}),_0x33b88a[_0x182187(0x196)]('登录')&&a7_0x390caf(Box,{'marginTop':0x1,'children':[a7_0x21c88b(Text,{'color':'yellow','children':'💡\x20请使用\x20'}),a7_0x21c88b(Text,{'color':_0x182187(0x18f),'children':_0x182187(0x16a)}),a7_0x21c88b(Text,{'color':_0x182187(0x189),'children':_0x182187(0x176)})]})]})]});};
1
+ (function(_0xa71420,_0x4a4a70){const _0x215490=a7_0x2c47,_0x4da904=_0xa71420();while(!![]){try{const _0x14fcd5=-parseInt(_0x215490(0x113))/0x1+parseInt(_0x215490(0xfd))/0x2+-parseInt(_0x215490(0x122))/0x3+-parseInt(_0x215490(0x11a))/0x4+-parseInt(_0x215490(0x105))/0x5+-parseInt(_0x215490(0x133))/0x6*(parseInt(_0x215490(0x12a))/0x7)+-parseInt(_0x215490(0x123))/0x8*(-parseInt(_0x215490(0x107))/0x9);if(_0x14fcd5===_0x4a4a70)break;else _0x4da904['push'](_0x4da904['shift']());}catch(_0x2a804f){_0x4da904['push'](_0x4da904['shift']());}}}(a7_0x1035,0x6b5ff));import{jsx as a7_0x260b70,jsxs as a7_0x4a61ee}from'react/jsx-runtime';import{useEffect,useState}from'react';function a7_0x1035(){const _0x539b53=['\x20个,过滤重复','619790YCCMJN','yellow','endsWith','gray','\x20重新登录后再试','join','./src/api/','1946220WLKmzd','-api','includes','red','error','🚀\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','cyan','\x20个模型','358425nfEeRS','897976ZyxoPu','api-pull','string','length','*\x20导入方式:','lovrabet\x20auth','拉取\x20API\x20配置失败:\x20','393708pulYjc','√\x20成功拉取\x20','未提供应用AppCode,且配置中也没有默认值','\x20-\x20客户端实例文件','cwd','api','\x20from\x20\x27@/','\x20个模型)','white','6LrZAWk','1632552rZvKpi','slice','replace','-client','modelCount','*\x20已生成文件:','dim','env','2206845HufroE','client','108jPjkSw','使用配置的应用AppCode:\x20','message','split','duplicateCount','import\x20','column','\x20个数据集,生成','{\x20lovrabetClient\x20}','使用指定的应用AppCode:\x20','.ts'];a7_0x1035=function(){return _0x539b53;};return a7_0x1035();}import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';import{initEnv}from'../constant/env.js';function a7_0x2c47(_0x15b9d2,_0x58fccb){_0x15b9d2=_0x15b9d2-0xfd;const _0x103575=a7_0x1035();let _0x2c47b5=_0x103575[_0x15b9d2];return _0x2c47b5;}import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';import{fetchModelList}from'./fetch-model-list.js';export const ApiPullUI=({appCode:_0x38f8b5,env:_0x29067b,output:_0x145c42})=>{const _0x3d00ad=a7_0x2c47,{exit:_0xa9f3b0}=useApp(),[_0x2cf8ce,_0x245933]=useState(![]),[_0x32d352,_0x2f5e3b]=useState(![]),[_0xde5126,_0xf0be15]=useState(null),[_0x3a1e2b,_0xbfa747]=useState(null),_0x1b14a2=readConfig(),_0x47003c=getConfigAppCode(),_0x50b061=_0x38f8b5||_0x47003c,_0x4cfe41=typeof _0x1b14a2?.[_0x3d00ad(0x104)]===_0x3d00ad(0x125)?_0x1b14a2[_0x3d00ad(0x104)]:undefined,_0x2d6996=_0x29067b||_0x4cfe41||'online';initEnv(_0x2d6996);const _0x7d43c9=_0x145c42||_0x3d00ad(0x119),_0x209d8a=_0x38f8b5&&_0x38f8b5['includes']('-')?_0x38f8b5[_0x3d00ad(0x10a)]('-')[_0x3d00ad(0xfe)](0x1)[_0x3d00ad(0x118)]('-'):'',_0x135b01=_0x38f8b5?_0x3d00ad(0x110)+_0x50b061:_0x3d00ad(0x108)+_0x50b061,_0x3017b0=_0x209d8a?_0x209d8a+_0x3d00ad(0x11b):'api',_0x316976=_0x209d8a?_0x209d8a+_0x3d00ad(0x100):_0x3d00ad(0x106);useEffect(()=>{_0x245933(!![]),_0x8f179e();},[]),useEffect(()=>{(_0x32d352||_0xde5126)&&_0xa9f3b0();},[_0x32d352,_0xde5126,_0xa9f3b0]);async function _0x8f179e(){const _0x490704=_0x3d00ad;if(!_0x50b061){_0xf0be15(_0x490704(0x12c));return;}try{logger['setLogPath'](process[_0x490704(0x12e)]());const {configArray:_0x4369ca}=await fetchModelList(_0x50b061),_0x2cb362=_0x4369ca[_0x490704(0x126)],_0xc34e6b=!_0x38f8b5,_0x24d1ce=await generateApiFile(_0x4369ca,_0x209d8a,_0x50b061,_0xc34e6b,_0x2d6996,_0x7d43c9),_0x17cf31=_0x7d43c9[_0x490704(0x115)]('/')?_0x7d43c9:_0x7d43c9+'/';_0xbfa747({'api':''+_0x17cf31+_0x3017b0+_0x490704(0x111),'client':''+_0x17cf31+_0x316976+'.ts','modelCount':_0x24d1ce['modelCount'],'datasetCount':_0x2cb362,'originalCount':_0x2cb362,'duplicateCount':0x0}),_0x2f5e3b(!![]);}catch(_0x509b07){const _0x3872e7=_0x509b07 instanceof Error?_0x509b07[_0x490704(0x109)]:String(_0x509b07);logger[_0x490704(0x11e)](_0x490704(0x124),_0x490704(0x129)+_0x3872e7,{'appCode':_0x50b061,'error':_0x3872e7}),_0xf0be15(_0x490704(0x129)+_0x3872e7);}finally{_0x245933(![]);}}return a7_0x4a61ee(Box,{'flexDirection':_0x3d00ad(0x10d),'children':[(_0x2cf8ce||_0x32d352)&&a7_0x4a61ee(Box,{'children':[a7_0x260b70(Text,{'color':'gray','children':'*\x20'}),a7_0x260b70(Text,{'color':_0x38f8b5?_0x3d00ad(0x132):_0x3d00ad(0x103),'children':_0x135b01})]}),_0x2cf8ce&&a7_0x260b70(Box,{'children':a7_0x4a61ee(Text,{'children':[_0x3d00ad(0x11f),_0x2d6996,')']})}),_0x32d352&&_0x3a1e2b&&a7_0x4a61ee(Box,{'flexDirection':_0x3d00ad(0x10d),'children':[a7_0x260b70(Box,{'children':a7_0x4a61ee(Text,{'color':'green','children':[_0x3d00ad(0x12b),_0x3a1e2b['datasetCount'],_0x3d00ad(0x10e),'\x20',_0x3a1e2b[_0x3d00ad(0x101)],_0x3d00ad(0x121)]})}),_0x3a1e2b[_0x3d00ad(0x10b)]>0x0&&a7_0x260b70(Box,{'marginTop':0x1,'children':a7_0x4a61ee(Text,{'color':'yellow','children':['!\x20原始数据集\x20',_0x3a1e2b['originalCount'],_0x3d00ad(0x112),'\x20',_0x3a1e2b[_0x3d00ad(0x10b)],'\x20个']})}),a7_0x260b70(Box,{'marginTop':0x1,'children':a7_0x260b70(Text,{'color':_0x3d00ad(0x116),'children':_0x3d00ad(0x102)})}),a7_0x4a61ee(Box,{'marginLeft':0x2,'children':[a7_0x4a61ee(Text,{'color':_0x3d00ad(0x120),'children':['•\x20',_0x3a1e2b[_0x3d00ad(0x12f)]]}),a7_0x4a61ee(Text,{'color':_0x3d00ad(0x103),'children':['\x20','-\x20模型配置文件\x20(',_0x3a1e2b['modelCount'],_0x3d00ad(0x131)]})]}),a7_0x4a61ee(Box,{'marginLeft':0x2,'children':[a7_0x4a61ee(Text,{'color':_0x3d00ad(0x120),'children':['•\x20',_0x3a1e2b[_0x3d00ad(0x106)]]}),a7_0x260b70(Text,{'color':_0x3d00ad(0x103),'children':_0x3d00ad(0x12d)})]}),a7_0x260b70(Box,{'marginTop':0x1,'children':a7_0x260b70(Text,{'color':_0x3d00ad(0x116),'children':_0x3d00ad(0x127)})}),a7_0x260b70(Box,{'marginLeft':0x2,'children':a7_0x4a61ee(Text,{'color':_0x3d00ad(0x114),'children':[_0x3d00ad(0x10c),_0x3d00ad(0x10f),_0x3d00ad(0x130),_0x3a1e2b[_0x3d00ad(0x106)][_0x3d00ad(0xff)](/^\.\//,'')[_0x3d00ad(0xff)](_0x3d00ad(0x111),''),'\x27']})})]}),_0xde5126&&a7_0x4a61ee(Box,{'flexDirection':'column','children':[a7_0x260b70(Box,{'children':a7_0x4a61ee(Text,{'color':_0x3d00ad(0x11d),'children':['❌\x20',_0xde5126]})}),_0xde5126[_0x3d00ad(0x11c)]('登录')&&a7_0x4a61ee(Box,{'marginTop':0x1,'children':[a7_0x260b70(Text,{'color':_0x3d00ad(0x114),'children':'💡\x20请使用\x20'}),a7_0x260b70(Text,{'color':'cyan','children':_0x3d00ad(0x128)}),a7_0x260b70(Text,{'color':_0x3d00ad(0x114),'children':_0x3d00ad(0x117)})]})]})]});};
@@ -1 +1 @@
1
- (function(_0x3db11d,_0x41c2b5){const _0x57733b=a8_0x21e2,_0x2f1f48=_0x3db11d();while(!![]){try{const _0x810360=-parseInt(_0x57733b(0x20e))/0x1*(-parseInt(_0x57733b(0x1f9))/0x2)+parseInt(_0x57733b(0x1fe))/0x3*(parseInt(_0x57733b(0x20b))/0x4)+-parseInt(_0x57733b(0x202))/0x5+-parseInt(_0x57733b(0x20a))/0x6*(parseInt(_0x57733b(0x200))/0x7)+-parseInt(_0x57733b(0x1f6))/0x8+-parseInt(_0x57733b(0x211))/0x9+-parseInt(_0x57733b(0x1f7))/0xa*(-parseInt(_0x57733b(0x1f3))/0xb);if(_0x810360===_0x41c2b5)break;else _0x2f1f48['push'](_0x2f1f48['shift']());}catch(_0x59e9ce){_0x2f1f48['push'](_0x2f1f48['shift']());}}}(a8_0x4743,0xe4945));import{getCookie}from'../auth/get-cookie.js';function a8_0x4743(){const _0x2e41b2=['2685535xvtWCd','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','status','errorMessage','未知错误','errorMsg','json','errorCode','4135542RKCxCK','12840amIgAr','UNAUTHORIZED','/api/node-toolbox/dataset/model-list?appcode=','186vJbYeF','code','name','7617006vqagHx','error','&otype=array','1903XfcxzT','message','Unauthorized','14089624LdKjap','223670wFDAsO','data','3186lpwCyX','info','length','trim','replace','1209WAxygj','includes','14TbHqTD','401'];a8_0x4743=function(){return _0x2e41b2;};return a8_0x4743();}import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';import{getEnv}from'../constant/env.js';function cleanNewlines(_0x594f4b){const _0x2c3fa3=a8_0x21e2;return _0x594f4b[_0x2c3fa3(0x1fd)](/[\r\n]+/g,'\x20')[_0x2c3fa3(0x1fc)]();}function cleanDatasetName(_0x2abd62){const _0x2289a8=a8_0x21e2;if(!_0x2abd62[_0x2289a8(0x210)])return _0x2abd62;return{..._0x2abd62,'name':cleanNewlines(_0x2abd62[_0x2289a8(0x210)])};}function cleanDatasetNames(_0x32536f){return _0x32536f['map'](cleanDatasetName);}function a8_0x21e2(_0x2ad41b,_0x4b4444){_0x2ad41b=_0x2ad41b-0x1f3;const _0x47439c=a8_0x4743();let _0x21e246=_0x47439c[_0x2ad41b];return _0x21e246;}export async function fetchModelList(_0x1ef881){const _0x404fa9=a8_0x21e2,_0x5796a0=getEnv(),_0x3a2f80=getApiDomain()+_0x404fa9(0x20d)+_0x1ef881+_0x404fa9(0x213);logger[_0x404fa9(0x1fa)]('fetch-model-list','正在从服务器拉取模型列表...\x20(环境:\x20'+_0x5796a0+')',{'apiUrl':_0x3a2f80});const _0x79384e=await fetch(_0x3a2f80,{'headers':{'Cookie':getCookie()}});if(!_0x79384e['ok']){if(_0x79384e[_0x404fa9(0x204)]===0x191)throw new Error(_0x404fa9(0x203));throw new Error('获取数据集失败,HTTP状态码:\x20'+_0x79384e['status']);}const _0x115f13=await _0x79384e[_0x404fa9(0x208)]();if(!_0x115f13['success']){const _0x223fa9=_0x115f13[_0x404fa9(0x207)]||_0x115f13[_0x404fa9(0x1f4)]||_0x115f13[_0x404fa9(0x1f8)]?.['message']||_0x115f13[_0x404fa9(0x205)]||_0x115f13[_0x404fa9(0x212)]||_0x404fa9(0x206);if(_0x223fa9[_0x404fa9(0x1ff)](_0x404fa9(0x201))||_0x223fa9[_0x404fa9(0x1ff)](_0x404fa9(0x1f5))||_0x223fa9['includes']('登录')||_0x223fa9['includes']('认证')||_0x115f13[_0x404fa9(0x209)]===_0x404fa9(0x20c)||_0x115f13['code']===0x191||_0x115f13[_0x404fa9(0x20f)]===_0x404fa9(0x201))throw new Error(_0x404fa9(0x203));throw new Error('获取数据集失败:\x20'+_0x223fa9);}const _0x461659=cleanDatasetNames(_0x115f13[_0x404fa9(0x1f8)]['configArray']);return{'configArray':_0x461659,'count':_0x461659[_0x404fa9(0x1fb)]};}
1
+ (function(_0x59b695,_0x2801ee){const _0x4a7773=a8_0x4d13,_0x10f164=_0x59b695();while(!![]){try{const _0x300cd8=parseInt(_0x4a7773(0x7a))/0x1+parseInt(_0x4a7773(0x79))/0x2*(parseInt(_0x4a7773(0x7c))/0x3)+parseInt(_0x4a7773(0x84))/0x4+parseInt(_0x4a7773(0x83))/0x5+parseInt(_0x4a7773(0x7d))/0x6*(parseInt(_0x4a7773(0x6e))/0x7)+parseInt(_0x4a7773(0x8a))/0x8+-parseInt(_0x4a7773(0x78))/0x9*(parseInt(_0x4a7773(0x71))/0xa);if(_0x300cd8===_0x2801ee)break;else _0x10f164['push'](_0x10f164['shift']());}catch(_0x42c76f){_0x10f164['push'](_0x10f164['shift']());}}}(a8_0x3ec4,0xb031f));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';function a8_0x3ec4(){const _0x165884=['18Osidsf','info','replace','获取数据集失败:\x20','includes','errorCode','5597940jmhpmi','763612QwMuOt','errorMsg','fetch-model-list','401','正在从服务器拉取模型列表...\x20(环境:\x20','UNAUTHORIZED','10936096MHtEoI','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','trim','/api/node-toolbox/dataset/model-list?appcode=','code','1370313KDYiee','data','name','34827230oIsmwa','json','message','获取数据集失败,HTTP状态码:\x20','Unauthorized','error','success','9GhOhft','1712126FtMLoK','83575BPYdgf','length','3djExFJ'];a8_0x3ec4=function(){return _0x165884;};return a8_0x3ec4();}import{getEnv}from'../constant/env.js';function cleanNewlines(_0x32430a){const _0x327e67=a8_0x4d13;return _0x32430a[_0x327e67(0x7f)](/[\r\n]+/g,'\x20')[_0x327e67(0x8c)]();}function a8_0x4d13(_0x1a7cf0,_0x113c18){_0x1a7cf0=_0x1a7cf0-0x6d;const _0x3ec443=a8_0x3ec4();let _0x4d1368=_0x3ec443[_0x1a7cf0];return _0x4d1368;}function cleanDatasetName(_0x496043){const _0x19699d=a8_0x4d13;if(!_0x496043['name'])return _0x496043;return{..._0x496043,'name':cleanNewlines(_0x496043[_0x19699d(0x70)])};}function cleanDatasetNames(_0x563648){return _0x563648['map'](cleanDatasetName);}export async function fetchModelList(_0x4c3b2e){const _0x493176=a8_0x4d13,_0x3ea61f=getEnv(),_0xbafc4f=getApiDomain()+_0x493176(0x8d)+_0x4c3b2e+'&otype=array';logger[_0x493176(0x7e)](_0x493176(0x86),_0x493176(0x88)+_0x3ea61f+')',{'apiUrl':_0xbafc4f});const _0x339616=await fetch(_0xbafc4f,{'headers':{'Cookie':getCookie()}});if(!_0x339616['ok']){if(_0x339616['status']===0x191)throw new Error(_0x493176(0x8b));throw new Error(_0x493176(0x74)+_0x339616['status']);}const _0x5eb3c6=await _0x339616[_0x493176(0x72)]();if(!_0x5eb3c6[_0x493176(0x77)]){const _0x7f8031=_0x5eb3c6[_0x493176(0x85)]||_0x5eb3c6[_0x493176(0x73)]||_0x5eb3c6[_0x493176(0x6f)]?.[_0x493176(0x73)]||_0x5eb3c6['errorMessage']||_0x5eb3c6[_0x493176(0x76)]||'未知错误';if(_0x7f8031[_0x493176(0x81)](_0x493176(0x87))||_0x7f8031[_0x493176(0x81)](_0x493176(0x75))||_0x7f8031[_0x493176(0x81)]('登录')||_0x7f8031[_0x493176(0x81)]('认证')||_0x5eb3c6[_0x493176(0x82)]===_0x493176(0x89)||_0x5eb3c6[_0x493176(0x6d)]===0x191||_0x5eb3c6['code']===_0x493176(0x87))throw new Error(_0x493176(0x8b));throw new Error(_0x493176(0x80)+_0x7f8031);}const _0x5a5651=cleanDatasetNames(_0x5eb3c6[_0x493176(0x6f)]['configArray']);return{'configArray':_0x5a5651,'count':_0x5a5651[_0x493176(0x7b)]};}
@@ -1 +1 @@
1
- const a9_0xde45c7=a9_0x6871;(function(_0x30c6df,_0x2cacc1){const _0x34ff6d=a9_0x6871,_0x276a9d=_0x30c6df();while(!![]){try{const _0x11307a=-parseInt(_0x34ff6d(0x1f7))/0x1+parseInt(_0x34ff6d(0x1e2))/0x2*(-parseInt(_0x34ff6d(0x1f1))/0x3)+-parseInt(_0x34ff6d(0x1fa))/0x4+parseInt(_0x34ff6d(0x1f2))/0x5*(parseInt(_0x34ff6d(0x1df))/0x6)+parseInt(_0x34ff6d(0x1f9))/0x7+-parseInt(_0x34ff6d(0x1e7))/0x8+parseInt(_0x34ff6d(0x207))/0x9;if(_0x11307a===_0x2cacc1)break;else _0x276a9d['push'](_0x276a9d['shift']());}catch(_0x5761ee){_0x276a9d['push'](_0x276a9d['shift']());}}}(a9_0xefab,0x9b0cc));import a9_0x4a9b94 from'prettier';import{mkdirSync,writeFileSync,readFileSync}from'node:fs';import a9_0x8cb27 from'node:path';import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';function a9_0x6871(_0x58bce9,_0x2b6c0b){_0x58bce9=_0x58bce9-0x1dd;const _0xefab99=a9_0xefab();let _0x6871cb=_0xefab99[_0x58bce9];return _0x6871cb;}import{TemplateReplacer}from'../utils/template-replacer.js';function a9_0xefab(){const _0x5339b6=['alias','utf8','706718aHlCng','{\x20apiConfigName:\x20','2508863hRjIOP','119900xEajyS','请先通过\x20`lovrabet\x20config\x20set\x20app\x20<value>`\x20配置应用\x20Code','name','client.ts.tpl','replaceApiContent','CONFIG_NAMES.DEFAULT','client','datasetCode','length','templates/generate-api','-client','dirname','push','13085154KXfHYh','tableName','API\x20文件生成成功!','131982Apuoao','key','forEach','2qTbUft','-api','app','api.ts.tpl','join','7050880kNQYGQ','api','init-api','format','typescript','success','./src/api/','online','string','slice','855237ieCwBz','165WGOGtm','.ts',',\x20env:\x20\x22'];a9_0xefab=function(){return _0x5339b6;};return a9_0xefab();}import{logger}from'../utils/logger.js';export async function generateApiFile(_0x252455,_0xd72592='',_0x3a736,_0x20f863=![],_0x4811a1,_0x20b4b1=a9_0xde45c7(0x1ed)){const _0x22eb79=a9_0xde45c7,_0x593ce0=readConfig(),_0x4566f3=_0x3a736||_0x593ce0?.[_0x22eb79(0x1e4)];if(typeof _0x4566f3!==_0x22eb79(0x1ef)||!_0x4566f3)throw new Error(_0x22eb79(0x1fb));const _0x552fe2=_0x20f863?_0x22eb79(0x1ff):'\x22'+_0x4566f3+'\x22',_0x3d1759=typeof _0x593ce0['env']===_0x22eb79(0x1ef)?_0x593ce0['env']:undefined,_0x2ae99e=_0x4811a1||_0x3d1759||_0x22eb79(0x1ee),_0x39d1b9=_0x2ae99e!==_0x22eb79(0x1ee);let _0xadae09;if(_0x20f863)_0x39d1b9?_0xadae09=_0x22eb79(0x1f8)+_0x552fe2+_0x22eb79(0x1f4)+_0x2ae99e+'\x22\x20}':_0xadae09='';else{const _0x4d7af9=_0x39d1b9?_0x22eb79(0x1f4)+_0x2ae99e+'\x22':'';_0xadae09='{\x20apiConfigName:\x20\x22'+_0x4566f3+'\x22'+_0x4d7af9+'\x20}';}const _0x5865cf=_0xd72592?_0xd72592+_0x22eb79(0x1e3):_0x22eb79(0x1e8),_0x35414b=_0xd72592?_0xd72592+_0x22eb79(0x204):_0x22eb79(0x200),_0xcbf240=[];_0x252455[_0x22eb79(0x1e1)](_0x224f90=>{const _0x58cbdb=_0x22eb79;_0xcbf240[_0x58cbdb(0x206)]({'datasetCode':_0x224f90[_0x58cbdb(0x201)],'tableName':_0x224f90[_0x58cbdb(0x1dd)],'name':_0x224f90[_0x58cbdb(0x1fc)]||'','alias':_0x224f90['alias']||_0x224f90[_0x58cbdb(0x1e0)]});});const _0x172deb=fileURLToPath(import.meta.url),_0x3a47c9=a9_0x8cb27['resolve'](a9_0x8cb27[_0x22eb79(0x205)](_0x172deb),'../..'),_0x2994ec=a9_0x8cb27[_0x22eb79(0x1e6)](_0x3a47c9,_0x22eb79(0x203)),_0x1945f9=a9_0x8cb27[_0x22eb79(0x1e6)](_0x2994ec,_0x22eb79(0x1e5)),_0x3a5871=a9_0x8cb27[_0x22eb79(0x1e6)](_0x2994ec,_0x22eb79(0x1fd)),_0x42bb31=_0x20b4b1['endsWith']('/')?_0x20b4b1[_0x22eb79(0x1f0)](0x0,-0x1):_0x20b4b1;mkdirSync(_0x42bb31,{'recursive':!![]});const _0x46011e=_0xcbf240[0x0]?.[_0x22eb79(0x1f5)],_0x298427=readFileSync(_0x1945f9,_0x22eb79(0x1f6)),_0x5ea2a2=TemplateReplacer[_0x22eb79(0x1fe)](_0x298427,_0x4566f3,_0xcbf240,_0x46011e,_0x5865cf,_0x552fe2),_0x317e7d=await a9_0x4a9b94[_0x22eb79(0x1ea)](_0x5ea2a2,{'parser':_0x22eb79(0x1eb)}),_0x203dbb=_0x42bb31+'/'+_0x5865cf+'.ts';writeFileSync(_0x203dbb,_0x317e7d,{'encoding':_0x22eb79(0x1f6)});const _0x36bd07=readFileSync(_0x3a5871,'utf8'),_0x2d4f9f=TemplateReplacer[_0x22eb79(0x1fe)](_0x36bd07,_0x4566f3,_0xcbf240,_0x46011e,_0x5865cf,_0x552fe2,_0xadae09),_0x130071=await a9_0x4a9b94[_0x22eb79(0x1ea)](_0x2d4f9f,{'parser':_0x22eb79(0x1eb)}),_0x2b74f6=_0x42bb31+'/'+_0x35414b+_0x22eb79(0x1f3);writeFileSync(_0x2b74f6,_0x130071,{'encoding':'utf8'});const _0x409ef2=_0xcbf240[_0x22eb79(0x202)];return logger[_0x22eb79(0x1ec)](_0x22eb79(0x1e9),_0x22eb79(0x1de),undefined,{'apiFile':_0x203dbb,'clientFile':_0x2b74f6,'modelCount':_0x409ef2,'configName':_0x552fe2}),{'modelCount':_0x409ef2,'apiFilePath':_0x203dbb,'clientFilePath':_0x2b74f6,'configName':_0x552fe2};}
1
+ (function(_0x42725b,_0x5cb6ad){const _0x39ab8a=a9_0x3b11,_0x3a7c71=_0x42725b();while(!![]){try{const _0x3b936a=-parseInt(_0x39ab8a(0x175))/0x1+-parseInt(_0x39ab8a(0x165))/0x2*(parseInt(_0x39ab8a(0x16b))/0x3)+parseInt(_0x39ab8a(0x164))/0x4*(parseInt(_0x39ab8a(0x174))/0x5)+parseInt(_0x39ab8a(0x171))/0x6+parseInt(_0x39ab8a(0x16c))/0x7*(parseInt(_0x39ab8a(0x17e))/0x8)+parseInt(_0x39ab8a(0x177))/0x9+-parseInt(_0x39ab8a(0x176))/0xa*(parseInt(_0x39ab8a(0x16a))/0xb);if(_0x3b936a===_0x5cb6ad)break;else _0x3a7c71['push'](_0x3a7c71['shift']());}catch(_0x3c367b){_0x3a7c71['push'](_0x3a7c71['shift']());}}}(a9_0x3028,0xe9405));import a9_0x59bf78 from'prettier';function a9_0x3b11(_0x2bf5a0,_0x785b48){_0x2bf5a0=_0x2bf5a0-0x164;const _0x3028d6=a9_0x3028();let _0x3b1106=_0x3028d6[_0x2bf5a0];return _0x3b1106;}import{mkdirSync,writeFileSync,readFileSync}from'node:fs';import a9_0x1e6585 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';function a9_0x3028(){const _0x2dab1a=['{\x20apiConfigName:\x20','name','slice','.ts','../..','112912stpKrG','datasetCode','success','alias','api','templates/generate-api','typescript','forEach',',\x20env:\x20\x22','join','API\x20文件生成成功!','format','CONFIG_NAMES.DEFAULT','length','utf8','string','188wEyGhT','195770Qofmpq','push','client','{\x20apiConfigName:\x20\x22','init-api','14839nyyGNq','45qmDpaF','651AYFiTC','endsWith','请先通过\x20`lovrabet\x20config\x20set\x20app\x20<value>`\x20配置应用\x20Code','replaceApiContent','-client','8066136HSgRgP','online','env','58635vrqQto','98286dbPJJu','14890ROmCHd','11902428dZKtHT','tableName'];a9_0x3028=function(){return _0x2dab1a;};return a9_0x3028();}export async function generateApiFile(_0x349320,_0x165c71='',_0xb7ebb3,_0x40757b=![],_0xaeb488,_0x6ebddf='./src/api/'){const _0xafb4e0=a9_0x3b11,_0x1a248f=readConfig(),_0x1c78c6=_0xb7ebb3||_0x1a248f?.['app'];if(typeof _0x1c78c6!==_0xafb4e0(0x18d)||!_0x1c78c6)throw new Error(_0xafb4e0(0x16e));const _0x4cffb2=_0x40757b?_0xafb4e0(0x18a):'\x22'+_0x1c78c6+'\x22',_0x341a92=typeof _0x1a248f[_0xafb4e0(0x173)]===_0xafb4e0(0x18d)?_0x1a248f['env']:undefined,_0x1c3115=_0xaeb488||_0x341a92||_0xafb4e0(0x172),_0xd4ed57=_0x1c3115!==_0xafb4e0(0x172);let _0x3eb8ba;if(_0x40757b)_0xd4ed57?_0x3eb8ba=_0xafb4e0(0x179)+_0x4cffb2+_0xafb4e0(0x186)+_0x1c3115+'\x22\x20}':_0x3eb8ba='';else{const _0x183ed3=_0xd4ed57?_0xafb4e0(0x186)+_0x1c3115+'\x22':'';_0x3eb8ba=_0xafb4e0(0x168)+_0x1c78c6+'\x22'+_0x183ed3+'\x20}';}const _0x336a97=_0x165c71?_0x165c71+'-api':_0xafb4e0(0x182),_0x60baf5=_0x165c71?_0x165c71+_0xafb4e0(0x170):_0xafb4e0(0x167),_0x2d07c4=[];_0x349320[_0xafb4e0(0x185)](_0x3f2be6=>{const _0xa434a4=_0xafb4e0;_0x2d07c4[_0xa434a4(0x166)]({'datasetCode':_0x3f2be6[_0xa434a4(0x17f)],'tableName':_0x3f2be6[_0xa434a4(0x178)],'name':_0x3f2be6[_0xa434a4(0x17a)]||'','alias':_0x3f2be6[_0xa434a4(0x181)]||_0x3f2be6['key']});});const _0x30f4dd=fileURLToPath(import.meta.url),_0x424f92=a9_0x1e6585['resolve'](a9_0x1e6585['dirname'](_0x30f4dd),_0xafb4e0(0x17d)),_0x417de8=a9_0x1e6585[_0xafb4e0(0x187)](_0x424f92,_0xafb4e0(0x183)),_0x5efbed=a9_0x1e6585[_0xafb4e0(0x187)](_0x417de8,'api.ts.tpl'),_0x3ac29c=a9_0x1e6585[_0xafb4e0(0x187)](_0x417de8,'client.ts.tpl'),_0x4cf013=_0x6ebddf[_0xafb4e0(0x16d)]('/')?_0x6ebddf[_0xafb4e0(0x17b)](0x0,-0x1):_0x6ebddf;mkdirSync(_0x4cf013,{'recursive':!![]});const _0x433de5=_0x2d07c4[0x0]?.['alias'],_0x9fb6d1=readFileSync(_0x5efbed,'utf8'),_0x81e651=TemplateReplacer[_0xafb4e0(0x16f)](_0x9fb6d1,_0x1c78c6,_0x2d07c4,_0x433de5,_0x336a97,_0x4cffb2),_0x2ed74e=await a9_0x59bf78[_0xafb4e0(0x189)](_0x81e651,{'parser':'typescript'}),_0x1db641=_0x4cf013+'/'+_0x336a97+_0xafb4e0(0x17c);writeFileSync(_0x1db641,_0x2ed74e,{'encoding':_0xafb4e0(0x18c)});const _0x2b6286=readFileSync(_0x3ac29c,_0xafb4e0(0x18c)),_0xa05211=TemplateReplacer[_0xafb4e0(0x16f)](_0x2b6286,_0x1c78c6,_0x2d07c4,_0x433de5,_0x336a97,_0x4cffb2,_0x3eb8ba),_0x1b3be1=await a9_0x59bf78[_0xafb4e0(0x189)](_0xa05211,{'parser':_0xafb4e0(0x184)}),_0x14d7e1=_0x4cf013+'/'+_0x60baf5+_0xafb4e0(0x17c);writeFileSync(_0x14d7e1,_0x1b3be1,{'encoding':_0xafb4e0(0x18c)});const _0x24675b=_0x2d07c4[_0xafb4e0(0x18b)];return logger[_0xafb4e0(0x180)](_0xafb4e0(0x169),_0xafb4e0(0x188),undefined,{'apiFile':_0x1db641,'clientFile':_0x14d7e1,'modelCount':_0x24675b,'configName':_0x4cffb2}),{'modelCount':_0x24675b,'apiFilePath':_0x1db641,'clientFilePath':_0x14d7e1,'configName':_0x4cffb2};}
package/lib/api/main.js CHANGED
@@ -1 +1 @@
1
- (function(_0x5031c1,_0x423e9a){const _0x2df999=a10_0x2b50,_0x30ce11=_0x5031c1();while(!![]){try{const _0x2f44eb=parseInt(_0x2df999(0x111))/0x1+parseInt(_0x2df999(0x126))/0x2+parseInt(_0x2df999(0xfe))/0x3*(parseInt(_0x2df999(0x102))/0x4)+parseInt(_0x2df999(0x124))/0x5*(parseInt(_0x2df999(0x11c))/0x6)+parseInt(_0x2df999(0x122))/0x7+-parseInt(_0x2df999(0x113))/0x8+-parseInt(_0x2df999(0x105))/0x9;if(_0x2f44eb===_0x423e9a)break;else _0x30ce11['push'](_0x30ce11['shift']());}catch(_0x3d0364){_0x30ce11['push'](_0x30ce11['shift']());}}}(a10_0x5c7d,0xf130b));import{jsx as a10_0xe9b9f8}from'react/jsx-runtime';import{render}from'ink';function a10_0x2b50(_0x105a69,_0x471eb1){_0x105a69=_0x105a69-0xfc;const _0x5c7d68=a10_0x5c7d();let _0x2b5027=_0x5c7d68[_0x105a69];return _0x2b5027;}function a10_0x5c7d(){const _0x4f3a60=['split','请使用\x20--appcode\x20参数,例如:','help','\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20doc\x20--appcode\x20<app-code>','map','\x1b[90m*\x20仅生成指定数据集的文档:\x20','error','6383214Wgferi','❌\x20错误:不再支持位置参数方式','Unknown\x20api\x20command:\x20','length','\x1b[90m*\x20使用配置的应用AppCode:\x20','message','4750627Plhavl','env','5SjUoXw','log','3544442OeIWBL','output','Available\x20commands:','trim','pull','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','input','parse','×\x20--params\x20参数必须是一个有效的\x20JSON\x20对象','\x20\x20lovrabet\x20api\x20doc\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定文档输出目录(默认:\x20./docs)','doc','3nQrXGJ','join','\x1b[0m','×\x20未配置\x20AppCode','772584KptApF','\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\x20错误:\x20','27754326JtzXsi','\x20\x20lovrabet\x20api\x20pull\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定输出目录(默认:\x20./src/api/)','isArray','\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\x20\x201.\x20配置默认值:\x20lovrabet\x20config\x20set\x20appcode\x20<app-code>','\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20pull\x20--appcode\x20<app-code>','flags','exit','appcode','string','!\x20请使用以下方式之一:','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','1564621QBmGvA','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20','9606312MdlPhM','filter'];a10_0x5c7d=function(){return _0x4f3a60;};return a10_0x5c7d();}import{ApiPullUI}from'./api-pull-ui.js';import{ApiDocUI}from'./api-doc-ui.js';import{getConfigAppCode}from'../utils/config.js';export async function apiCli(_0x14ccc8){const _0x2cadbd=a10_0x2b50,_0x52f391=_0x14ccc8[_0x2cadbd(0x12c)][0x1];if(_0x14ccc8['flags'][_0x2cadbd(0x117)]){console[_0x2cadbd(0x125)](_0x2cadbd(0x103));return;}if(_0x52f391===_0x2cadbd(0x12a)){_0x14ccc8[_0x2cadbd(0x12c)][0x2]&&(console[_0x2cadbd(0x11b)](_0x2cadbd(0x11d)),console[_0x2cadbd(0x125)](_0x2cadbd(0x116)),console['log']('\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20'+_0x14ccc8[_0x2cadbd(0x12c)][0x2]),process[_0x2cadbd(0x10c)](0x1));const _0x1200f7=getConfigAppCode();let _0x1ed3df=_0x14ccc8[_0x2cadbd(0x10b)][_0x2cadbd(0x10d)];const _0x1439bd=typeof _0x14ccc8[_0x2cadbd(0x10b)][_0x2cadbd(0x123)]===_0x2cadbd(0x10e)?_0x14ccc8['flags'][_0x2cadbd(0x123)]:undefined,_0x4ae4aa=_0x14ccc8[_0x2cadbd(0x10b)][_0x2cadbd(0x127)];!_0x1ed3df&&!_0x1200f7&&(console[_0x2cadbd(0x11b)]('×\x20未配置\x20AppCode'),console[_0x2cadbd(0x125)](_0x2cadbd(0x10f)),console[_0x2cadbd(0x125)](_0x2cadbd(0x109)),console[_0x2cadbd(0x125)](_0x2cadbd(0x10a)),process[_0x2cadbd(0x10c)](0x1)),_0x1ed3df&&_0x1200f7&&_0x1ed3df===_0x1200f7&&(console[_0x2cadbd(0x125)]('\x1b[90m*\x20使用配置的应用AppCode:\x20'+_0x1ed3df+_0x2cadbd(0x100)),console[_0x2cadbd(0x125)]('\x1b[90m\x20\x20(注:\x20--appcode\x20参数与配置一致,将使用默认配置)\x1b[0m'),_0x1ed3df=undefined),render(a10_0xe9b9f8(ApiPullUI,{'appCode':_0x1ed3df,'env':_0x1439bd,'output':_0x4ae4aa}));}else{if(_0x52f391===_0x2cadbd(0xfd)){_0x14ccc8[_0x2cadbd(0x12c)][0x2]&&(console[_0x2cadbd(0x11b)](_0x2cadbd(0x11d)),console[_0x2cadbd(0x125)](_0x2cadbd(0x116)),console[_0x2cadbd(0x125)](_0x2cadbd(0x112)+_0x14ccc8[_0x2cadbd(0x12c)][0x2]),process[_0x2cadbd(0x10c)](0x1));const _0x1cf9d8=getConfigAppCode();let _0x28c2dd=_0x14ccc8[_0x2cadbd(0x10b)][_0x2cadbd(0x10d)];const _0x58dfb0=typeof _0x14ccc8[_0x2cadbd(0x10b)][_0x2cadbd(0x123)]==='string'?_0x14ccc8['flags'][_0x2cadbd(0x123)]:undefined,_0x17b0b5=_0x14ccc8[_0x2cadbd(0x10b)][_0x2cadbd(0x127)],_0x52c78f=_0x14ccc8['flags']['params'],_0x347395=_0x14ccc8[_0x2cadbd(0x10b)]['datasetcode'];!_0x28c2dd&&!_0x1cf9d8&&(console[_0x2cadbd(0x11b)](_0x2cadbd(0x101)),console['log'](_0x2cadbd(0x10f)),console[_0x2cadbd(0x125)](_0x2cadbd(0x109)),console[_0x2cadbd(0x125)](_0x2cadbd(0x118)),process['exit'](0x1));_0x28c2dd&&_0x1cf9d8&&_0x28c2dd===_0x1cf9d8&&(console[_0x2cadbd(0x125)](_0x2cadbd(0x120)+_0x28c2dd+_0x2cadbd(0x100)),_0x28c2dd=undefined);let _0x11757f;if(_0x52c78f)try{_0x11757f=JSON[_0x2cadbd(0x12d)](_0x52c78f),(typeof _0x11757f!=='object'||_0x11757f===null||Array[_0x2cadbd(0x107)](_0x11757f))&&(console[_0x2cadbd(0x11b)](_0x2cadbd(0x12e)),process[_0x2cadbd(0x10c)](0x1));}catch(_0x139fba){console[_0x2cadbd(0x11b)]('×\x20--params\x20参数不是有效的\x20JSON\x20格式'),console[_0x2cadbd(0x11b)](_0x2cadbd(0x104)+(_0x139fba instanceof Error?_0x139fba[_0x2cadbd(0x121)]:String(_0x139fba))),process[_0x2cadbd(0x10c)](0x1);}let _0x4d1e97;_0x347395&&(_0x4d1e97=_0x347395[_0x2cadbd(0x115)](',')[_0x2cadbd(0x119)](_0x1f306f=>_0x1f306f[_0x2cadbd(0x129)]())[_0x2cadbd(0x114)](_0x36f7df=>_0x36f7df['length']>0x0),_0x4d1e97[_0x2cadbd(0x11f)]===0x0&&(console[_0x2cadbd(0x11b)]('×\x20--datasetcode\x20参数不能为空'),process['exit'](0x1)),console[_0x2cadbd(0x125)](_0x2cadbd(0x11a)+_0x4d1e97[_0x2cadbd(0xff)](',\x20')+'\x1b[0m')),render(a10_0xe9b9f8(ApiDocUI,{'appCode':_0x28c2dd,'env':_0x58dfb0,'output':_0x17b0b5,'extraParams':_0x11757f,'datasetCodes':_0x4d1e97}));}else console[_0x2cadbd(0x11b)](_0x2cadbd(0x11e)+_0x52f391),console['log'](_0x2cadbd(0x128)),console['log'](_0x2cadbd(0x108)),console[_0x2cadbd(0x125)](_0x2cadbd(0x12b)),console[_0x2cadbd(0x125)](_0x2cadbd(0x106)),console[_0x2cadbd(0x125)]('\x20\x20lovrabet\x20api\x20pull\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)'),console[_0x2cadbd(0x125)](''),console[_0x2cadbd(0x125)]('\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['log'](_0x2cadbd(0x110)),console[_0x2cadbd(0x125)](_0x2cadbd(0xfc)),console[_0x2cadbd(0x125)]('\x20\x20lovrabet\x20api\x20doc\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)'),process[_0x2cadbd(0x10c)](0x1);}}
1
+ (function(_0x1d85d0,_0x381781){const _0xfd7a46=a10_0x33f5,_0x5c9857=_0x1d85d0();while(!![]){try{const _0x413463=-parseInt(_0xfd7a46(0x130))/0x1+-parseInt(_0xfd7a46(0x15c))/0x2*(-parseInt(_0xfd7a46(0x13c))/0x3)+-parseInt(_0xfd7a46(0x13a))/0x4+parseInt(_0xfd7a46(0x151))/0x5+-parseInt(_0xfd7a46(0x14e))/0x6+parseInt(_0xfd7a46(0x156))/0x7*(parseInt(_0xfd7a46(0x132))/0x8)+parseInt(_0xfd7a46(0x133))/0x9;if(_0x413463===_0x381781)break;else _0x5c9857['push'](_0x5c9857['shift']());}catch(_0x2297fa){_0x5c9857['push'](_0x5c9857['shift']());}}}(a10_0x4774,0x420e1));function a10_0x4774(){const _0x38afcf=['\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','160965fzYlcx','\x20\x20错误:\x20','48248TIBxfM','5537916GXrxbS','\x1b[90m\x20\x20(注:\x20--appcode\x20参数与配置一致,将使用默认配置)\x1b[0m','Unknown\x20api\x20command:\x20','isArray','\x20\x20lovrabet\x20api\x20doc\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定文档输出目录(默认:\x20./docs)','exit','\x20\x20lovrabet\x20api\x20pull\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定输出目录(默认:\x20./src/api/)','2139688rlqRvl','❌\x20错误:不再支持位置参数方式','389265JhhVPp','pull','×\x20--datasetcode\x20参数不能为空','join','split','×\x20--params\x20参数必须是一个有效的\x20JSON\x20对象','\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20pull\x20--appcode\x20<app-code>','请使用\x20--appcode\x20参数,例如:','\x20\x20lovrabet\x20api\x20doc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20生成\x20API\x20文档','length','\x20\x20lovrabet\x20api\x20doc\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)','log','\x1b[90m*\x20使用配置的应用AppCode:\x20','!\x20请使用以下方式之一:','×\x20--params\x20参数不是有效的\x20JSON\x20格式','flags','datasetcode','input','2361222RitFXo','\x20\x20lovrabet\x20api\x20pull\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)','Available\x20commands:','329540MTwZXy','string','trim','\x20\x20\x201.\x20配置默认值:\x20lovrabet\x20config\x20set\x20appcode\x20<app-code>','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20','336ZwEJOx','env','object','appcode','\x1b[0m','help','6uPUzeh','×\x20未配置\x20AppCode','error','parse','\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20doc\x20--appcode\x20<app-code>','filter'];a10_0x4774=function(){return _0x38afcf;};return a10_0x4774();}import{jsx as a10_0x4e46d5}from'react/jsx-runtime';import{render}from'ink';import{ApiPullUI}from'./api-pull-ui.js';import{ApiDocUI}from'./api-doc-ui.js';import{getConfigAppCode}from'../utils/config.js';function a10_0x33f5(_0x2f480e,_0x868fc){_0x2f480e=_0x2f480e-0x12d;const _0x47744c=a10_0x4774();let _0x33f56c=_0x47744c[_0x2f480e];return _0x33f56c;}export async function apiCli(_0x260d41){const _0x174a7f=a10_0x33f5,_0x140622=_0x260d41[_0x174a7f(0x14d)][0x1];if(_0x260d41[_0x174a7f(0x14b)][_0x174a7f(0x15b)]){console[_0x174a7f(0x147)]('\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(_0x140622===_0x174a7f(0x13d)){_0x260d41[_0x174a7f(0x14d)][0x2]&&(console[_0x174a7f(0x15e)](_0x174a7f(0x13b)),console['log'](_0x174a7f(0x143)),console[_0x174a7f(0x147)](_0x174a7f(0x155)+_0x260d41[_0x174a7f(0x14d)][0x2]),process[_0x174a7f(0x138)](0x1));const _0x2d1c1d=getConfigAppCode();let _0x9cdf90=_0x260d41[_0x174a7f(0x14b)][_0x174a7f(0x159)];const _0x4193d1=typeof _0x260d41['flags'][_0x174a7f(0x157)]===_0x174a7f(0x152)?_0x260d41['flags'][_0x174a7f(0x157)]:undefined,_0x14894e=_0x260d41[_0x174a7f(0x14b)]['output'];!_0x9cdf90&&!_0x2d1c1d&&(console[_0x174a7f(0x15e)](_0x174a7f(0x15d)),console[_0x174a7f(0x147)](_0x174a7f(0x149)),console['log'](_0x174a7f(0x154)),console[_0x174a7f(0x147)](_0x174a7f(0x142)),process[_0x174a7f(0x138)](0x1)),_0x9cdf90&&_0x2d1c1d&&_0x9cdf90===_0x2d1c1d&&(console['log'](_0x174a7f(0x148)+_0x9cdf90+_0x174a7f(0x15a)),console[_0x174a7f(0x147)](_0x174a7f(0x134)),_0x9cdf90=undefined),render(a10_0x4e46d5(ApiPullUI,{'appCode':_0x9cdf90,'env':_0x4193d1,'output':_0x14894e}));}else{if(_0x140622==='doc'){_0x260d41[_0x174a7f(0x14d)][0x2]&&(console['error']('❌\x20错误:不再支持位置参数方式'),console[_0x174a7f(0x147)]('请使用\x20--appcode\x20参数,例如:'),console[_0x174a7f(0x147)](_0x174a7f(0x12e)+_0x260d41[_0x174a7f(0x14d)][0x2]),process[_0x174a7f(0x138)](0x1));const _0x4c5143=getConfigAppCode();let _0x19d73e=_0x260d41['flags'][_0x174a7f(0x159)];const _0x18b711=typeof _0x260d41[_0x174a7f(0x14b)][_0x174a7f(0x157)]===_0x174a7f(0x152)?_0x260d41[_0x174a7f(0x14b)][_0x174a7f(0x157)]:undefined,_0x265c47=_0x260d41['flags']['output'],_0x56913d=_0x260d41[_0x174a7f(0x14b)]['params'],_0x489338=_0x260d41[_0x174a7f(0x14b)][_0x174a7f(0x14c)];!_0x19d73e&&!_0x4c5143&&(console['error'](_0x174a7f(0x15d)),console['log'](_0x174a7f(0x149)),console['log'](_0x174a7f(0x154)),console[_0x174a7f(0x147)](_0x174a7f(0x160)),process[_0x174a7f(0x138)](0x1));_0x19d73e&&_0x4c5143&&_0x19d73e===_0x4c5143&&(console[_0x174a7f(0x147)]('\x1b[90m*\x20使用配置的应用AppCode:\x20'+_0x19d73e+'\x1b[0m'),_0x19d73e=undefined);let _0x5c8253;if(_0x56913d)try{_0x5c8253=JSON[_0x174a7f(0x15f)](_0x56913d),(typeof _0x5c8253!==_0x174a7f(0x158)||_0x5c8253===null||Array[_0x174a7f(0x136)](_0x5c8253))&&(console[_0x174a7f(0x15e)](_0x174a7f(0x141)),process['exit'](0x1));}catch(_0x185acf){console[_0x174a7f(0x15e)](_0x174a7f(0x14a)),console[_0x174a7f(0x15e)](_0x174a7f(0x131)+(_0x185acf instanceof Error?_0x185acf['message']:String(_0x185acf))),process[_0x174a7f(0x138)](0x1);}let _0x1b0939;_0x489338&&(_0x1b0939=_0x489338[_0x174a7f(0x140)](',')['map'](_0x3543a9=>_0x3543a9[_0x174a7f(0x153)]())[_0x174a7f(0x12d)](_0x369d15=>_0x369d15['length']>0x0),_0x1b0939[_0x174a7f(0x145)]===0x0&&(console['error'](_0x174a7f(0x13e)),process[_0x174a7f(0x138)](0x1)),console[_0x174a7f(0x147)]('\x1b[90m*\x20仅生成指定数据集的文档:\x20'+_0x1b0939[_0x174a7f(0x13f)](',\x20')+_0x174a7f(0x15a))),render(a10_0x4e46d5(ApiDocUI,{'appCode':_0x19d73e,'env':_0x18b711,'output':_0x265c47,'extraParams':_0x5c8253,'datasetCodes':_0x1b0939}));}else console['error'](_0x174a7f(0x135)+_0x140622),console['log'](_0x174a7f(0x150)),console[_0x174a7f(0x147)]('\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[_0x174a7f(0x147)](_0x174a7f(0x12f)),console[_0x174a7f(0x147)](_0x174a7f(0x139)),console['log'](_0x174a7f(0x14f)),console[_0x174a7f(0x147)](''),console[_0x174a7f(0x147)](_0x174a7f(0x144)),console[_0x174a7f(0x147)]('\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode'),console['log'](_0x174a7f(0x137)),console[_0x174a7f(0x147)](_0x174a7f(0x146)),process[_0x174a7f(0x138)](0x1);}}