@lovrabet/cli 1.3.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/lib/add-page/input-page-router.js +1 -1
  2. package/lib/add-page/main.js +1 -1
  3. package/lib/add-page/select-page-template.js +1 -1
  4. package/lib/ai-setup/AISetupUI.js +1 -1
  5. package/lib/ai-setup/config.js +1 -1
  6. package/lib/api/api-doc-ui.js +1 -1
  7. package/lib/api/api-doc.js +1 -1
  8. package/lib/api/api-pull-ui.js +1 -1
  9. package/lib/api/fetch-model-list.js +1 -1
  10. package/lib/api/generate-api-file.js +1 -1
  11. package/lib/api/main.js +1 -1
  12. package/lib/api/pull-silent.js +1 -1
  13. package/lib/app-menu/app-menu-sync-ui.js +1 -1
  14. package/lib/app-menu/create-menu.js +1 -1
  15. package/lib/app-menu/get-local-pages.js +1 -1
  16. package/lib/app-menu/get-online-menu-list.js +1 -1
  17. package/lib/app-menu/use-get-online-menu-list.js +1 -1
  18. package/lib/app-menu/utils.js +1 -1
  19. package/lib/app-menu/valid-url.js +1 -1
  20. package/lib/app-menu-update-cdn/current-content.js +1 -1
  21. package/lib/app-menu-update-cdn/input-cdn-asset.js +1 -1
  22. package/lib/app-menu-update-cdn/main.js +1 -1
  23. package/lib/app-menu-update-cdn/update-menu-cdn-url.js +1 -1
  24. package/lib/auth/auth-server-ui.js +1 -1
  25. package/lib/auth/auth-server.js +1 -1
  26. package/lib/auth/constant.js +1 -1
  27. package/lib/auth/get-cookie.js +1 -1
  28. package/lib/auth/is-session-valid.js +1 -1
  29. package/lib/auth/logout.js +1 -1
  30. package/lib/cli.js +1 -1
  31. package/lib/cmd/build-watch.js +1 -1
  32. package/lib/cmd/build.js +1 -1
  33. package/lib/cmd/logs.js +1 -1
  34. package/lib/cmd/preview.js +1 -1
  35. package/lib/cmd/start.js +1 -1
  36. package/lib/config/config-help.js +1 -1
  37. package/lib/config/main.js +1 -1
  38. package/lib/constant/domain.js +1 -1
  39. package/lib/constant/env.js +1 -1
  40. package/lib/create-app/enhanced-guided-create.js +1 -1
  41. package/lib/create-app/format-elapsed.js +1 -1
  42. package/lib/create-app/main.js +1 -1
  43. package/lib/create-app/non-interactive.js +1 -1
  44. package/lib/create-app/task-finished.js +1 -1
  45. package/lib/create-app/task-loading.js +1 -1
  46. package/lib/create-app/task-running.js +1 -1
  47. package/lib/create-app/task-time.js +1 -1
  48. package/lib/create-app/use-copy-project-template.js +1 -1
  49. package/lib/create-app/use-format-code.js +1 -1
  50. package/lib/create-app/use-install-dependencies.js +1 -1
  51. package/lib/help.js +1 -1
  52. package/lib/init/main.js +1 -1
  53. package/lib/mcp/McpInstallUI.js +1 -1
  54. package/lib/mcp/claude.js +1 -1
  55. package/lib/mcp/cursor.js +1 -1
  56. package/lib/mcp/main.js +1 -1
  57. package/lib/mcp/mcp-install-non-interactive.js +1 -1
  58. package/lib/mcp/mcp-installer.js +1 -1
  59. package/lib/skills/SkillInstallUI.js +1 -1
  60. package/lib/skills/main.js +1 -1
  61. package/lib/skills/skill-install-non-interactive.js +1 -1
  62. package/lib/skills/skill-installer.js +1 -1
  63. package/lib/ui/IDESelector.js +1 -1
  64. package/lib/ui/useIDESelection.js +1 -1
  65. package/lib/utils/ai_config.js +1 -1
  66. package/lib/utils/cdn-config.js +1 -1
  67. package/lib/utils/check-sdk-version.js +1 -1
  68. package/lib/utils/cli-version-check.js +1 -1
  69. package/lib/utils/config.js +1 -1
  70. package/lib/utils/copy-directory.js +1 -1
  71. package/lib/utils/file-utils.js +1 -1
  72. package/lib/utils/guides-cdn.js +1 -1
  73. package/lib/utils/http-client.js +1 -1
  74. package/lib/utils/logger.js +1 -1
  75. package/lib/utils/router-updater.js +1 -1
  76. package/lib/utils/rules-cdn.js +1 -1
  77. package/lib/utils/sleep.js +1 -1
  78. package/lib/utils/template-replacer.js +1 -1
  79. package/package.json +1 -1
@@ -1 +1 @@
1
- (function(_0x5c89be,_0x3da0ca){const _0x3db882=a0_0xf7c4,_0x12d117=_0x5c89be();while(!![]){try{const _0x1d18f6=parseInt(_0x3db882(0x184))/0x1+parseInt(_0x3db882(0x179))/0x2+-parseInt(_0x3db882(0x181))/0x3*(-parseInt(_0x3db882(0x17a))/0x4)+-parseInt(_0x3db882(0x170))/0x5*(parseInt(_0x3db882(0x186))/0x6)+parseInt(_0x3db882(0x188))/0x7*(-parseInt(_0x3db882(0x17d))/0x8)+parseInt(_0x3db882(0x171))/0x9*(parseInt(_0x3db882(0x189))/0xa)+-parseInt(_0x3db882(0x180))/0xb;if(_0x1d18f6===_0x3da0ca)break;else _0x12d117['push'](_0x12d117['shift']());}catch(_0x490702){_0x12d117['push'](_0x12d117['shift']());}}}(a0_0x5ebd,0xcd536));function a0_0xf7c4(_0x569383,_0x44fc63){_0x569383=_0x569383-0x16d;const _0x5ebd8d=a0_0x5ebd();let _0xf7c45d=_0x5ebd8d[_0x569383];return _0xf7c45d;}import{jsx as a0_0x5d240b,jsxs as a0_0x548139}from'react/jsx-runtime';import{useState}from'react';import{Text,Box,useInput}from'ink';import a0_0x524e41 from'node:fs';export function InputProjectCode(_0x12c242){const _0x313715=a0_0xf7c4,{onSubmit:_0x4fbfb3,pagePath:_0x14f41c}=_0x12c242,[_0x58e701,_0x9a1ad7]=useState(''),[_0x2e5544,_0x106cea]=useState(''),_0x528648=_0x313715(0x183);function _0x46cb65(_0x4c8675){const _0x3a395b=_0x313715;if(_0x4c8675[_0x3a395b(0x173)]>0x64)return{'valid':![],'message':_0x3a395b(0x17b)};if(_0x4c8675[_0x3a395b(0x178)]('/')||_0x4c8675[_0x3a395b(0x174)]('/'))return{'valid':![],'message':_0x3a395b(0x18a)};if(_0x4c8675['includes']('//'))return{'valid':![],'message':_0x3a395b(0x17c)};const _0x1841ed=_0x4c8675['split']('/');for(const _0x36b492 of _0x1841ed){if(!_0x36b492)continue;const _0x41122a=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(!_0x41122a[_0x3a395b(0x17f)](_0x36b492))return{'valid':![],'message':_0x3a395b(0x16e)};}return{'valid':!![]};}return useInput((_0x59a7c0,_0x256be7)=>{const _0x4fbae1=_0x313715;if(_0x256be7[_0x4fbae1(0x187)]){const _0x3e8579=_0x58e701[_0x4fbae1(0x16f)]()||_0x528648;if(_0x2e5544)return;const _0x4332f9=_0x14f41c+'/'+_0x3e8579;if(a0_0x524e41[_0x4fbae1(0x172)](_0x4332f9)){_0x106cea('页面路径\x20'+_0x3e8579+'\x20已存在,请使用其他路径');return;}_0x4fbfb3(_0x3e8579),_0x9a1ad7(''),_0x106cea('');}else _0x256be7['backspace']||_0x256be7[_0x4fbae1(0x177)]?_0x9a1ad7(_0x4e6111=>{const _0x468a91=_0x4fbae1,_0xe53685=_0x4e6111[_0x468a91(0x175)](0x0,-0x1),{valid:_0x38f90b,message:_0x5191d1}=_0x46cb65(_0xe53685);return _0x106cea(_0x38f90b?'':_0x5191d1||'页面路径不合法'),_0xe53685;}):_0x9a1ad7(_0x462f7f=>{const _0x3fc9ba=_0x4fbae1,_0x1723dc=_0x462f7f+_0x59a7c0,{valid:_0x427849,message:_0x492dae}=_0x46cb65(_0x1723dc);return _0x106cea(_0x427849?'':_0x492dae||_0x3fc9ba(0x176)),_0x1723dc;});}),a0_0x548139(Box,{'flexDirection':_0x313715(0x17e),'children':[a0_0x548139(Box,{'children':[a0_0x5d240b(Text,{'color':_0x313715(0x16d),'children':_0x313715(0x182)}),a0_0x5d240b(Text,{'children':_0x313715(0x18b)}),_0x58e701?a0_0x5d240b(Text,{'color':'green','children':_0x58e701}):a0_0x5d240b(Text,{'color':_0x313715(0x16d),'children':_0x528648}),_0x2e5544&&a0_0x548139(Text,{'color':'red','children':[_0x313715(0x18c),_0x2e5544]})]}),!_0x2e5544&&!_0x58e701&&a0_0x5d240b(Box,{'children':a0_0x5d240b(Text,{'color':'gray','children':_0x313715(0x185)})})]});}function a0_0x5ebd(){const _0x555b55=['785960kNbGCF','\x20直接回车确认,或输入自定义路由地址','1179498ombDEx','return','91hrXXcE','800ZdAgUD','路径不能以\x20/\x20开头或结尾','页面路由地址:\x20','\x20←\x20','gray','路径中的每个段只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','trim','10fIHPuW','60894iIueGt','existsSync','length','endsWith','slice','页面路径不合法','delete','startsWith','453410nziwWU','668IyFjJw','页面路径长度不能超过\x20100\x20个字符','路径不能包含连续的\x20/','464968XykZwn','column','test','2532068PzOODz','11964CJcZSQ','\x20Step2:\x20','my-page'];a0_0x5ebd=function(){return _0x555b55;};return a0_0x5ebd();}
1
+ (function(_0x157669,_0x2b80fa){const _0x2be954=a0_0x5f35,_0xd31e0f=_0x157669();while(!![]){try{const _0x3b8b03=-parseInt(_0x2be954(0xfd))/0x1+parseInt(_0x2be954(0xf0))/0x2*(parseInt(_0x2be954(0xf2))/0x3)+-parseInt(_0x2be954(0xfa))/0x4*(-parseInt(_0x2be954(0x101))/0x5)+-parseInt(_0x2be954(0xf5))/0x6*(-parseInt(_0x2be954(0xf4))/0x7)+-parseInt(_0x2be954(0xf1))/0x8*(parseInt(_0x2be954(0x10b))/0x9)+-parseInt(_0x2be954(0xf9))/0xa*(-parseInt(_0x2be954(0xfb))/0xb)+-parseInt(_0x2be954(0x10f))/0xc;if(_0x3b8b03===_0x2b80fa)break;else _0xd31e0f['push'](_0xd31e0f['shift']());}catch(_0x40d6ba){_0xd31e0f['push'](_0xd31e0f['shift']());}}}(a0_0x3600,0xdd7b8));import{jsx as a0_0xf577b,jsxs as a0_0x77b6fe}from'react/jsx-runtime';import{useState}from'react';function a0_0x5f35(_0x3942df,_0x547273){_0x3942df=_0x3942df-0xef;const _0x36004b=a0_0x3600();let _0x5f359c=_0x36004b[_0x3942df];return _0x5f359c;}function a0_0x3600(){const _0x22afb1=['trim','column','路径不能包含连续的\x20/','gray','路径不能以\x20/\x20开头或结尾','页面路径\x20','return','页面路由地址:\x20','length','150021BuDPhO','页面路径长度不能超过\x20100\x20个字符','slice','split','28761888FKoGfl','backspace','delete','8fyAtOX','136EBJJwz','102294FtIHrG','red','1053962Chzhjs','18razutd','页面路径不合法','endsWith','\x20已存在,请使用其他路径','4346050DivJXI','8tgrdVr','44xUkEHB','startsWith','399359pDXPGN','my-page','includes','test','4150595cdlsjB'];a0_0x3600=function(){return _0x22afb1;};return a0_0x3600();}import{Text,Box,useInput}from'ink';import a0_0x26e3f1 from'node:fs';export function InputProjectCode(_0x5ab10b){const _0x52db7f=a0_0x5f35,{onSubmit:_0x3687ce,pagePath:_0x154363}=_0x5ab10b,[_0x405c75,_0x1db7fc]=useState(''),[_0x45e2ef,_0x4b3877]=useState(''),_0xa35ad0=_0x52db7f(0xfe);function _0x407436(_0x2012d8){const _0x30d02e=_0x52db7f;if(_0x2012d8[_0x30d02e(0x10a)]>0x64)return{'valid':![],'message':_0x30d02e(0x10c)};if(_0x2012d8[_0x30d02e(0xfc)]('/')||_0x2012d8[_0x30d02e(0xf7)]('/'))return{'valid':![],'message':_0x30d02e(0x106)};if(_0x2012d8[_0x30d02e(0xff)]('//'))return{'valid':![],'message':_0x30d02e(0x104)};const _0x57b3c5=_0x2012d8[_0x30d02e(0x10e)]('/');for(const _0x6cf0cd of _0x57b3c5){if(!_0x6cf0cd)continue;const _0x44f1cc=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(!_0x44f1cc[_0x30d02e(0x100)](_0x6cf0cd))return{'valid':![],'message':'路径中的每个段只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_'};}return{'valid':!![]};}return useInput((_0x389dca,_0x4d8529)=>{const _0x1e38b5=_0x52db7f;if(_0x4d8529[_0x1e38b5(0x108)]){const _0x288dc6=_0x405c75[_0x1e38b5(0x102)]()||_0xa35ad0;if(_0x45e2ef)return;const _0x14a40e=_0x154363+'/'+_0x288dc6;if(a0_0x26e3f1['existsSync'](_0x14a40e)){_0x4b3877(_0x1e38b5(0x107)+_0x288dc6+_0x1e38b5(0xf8));return;}_0x3687ce(_0x288dc6),_0x1db7fc(''),_0x4b3877('');}else _0x4d8529[_0x1e38b5(0x110)]||_0x4d8529[_0x1e38b5(0xef)]?_0x1db7fc(_0xbdcab5=>{const _0xd7fac7=_0x1e38b5,_0x4f572a=_0xbdcab5[_0xd7fac7(0x10d)](0x0,-0x1),{valid:_0x1ffe26,message:_0x23990d}=_0x407436(_0x4f572a);return _0x4b3877(_0x1ffe26?'':_0x23990d||_0xd7fac7(0xf6)),_0x4f572a;}):_0x1db7fc(_0x213063=>{const _0x1f7c8a=_0x1e38b5,_0x4d8be4=_0x213063+_0x389dca,{valid:_0x43be93,message:_0x20a103}=_0x407436(_0x4d8be4);return _0x4b3877(_0x43be93?'':_0x20a103||_0x1f7c8a(0xf6)),_0x4d8be4;});}),a0_0x77b6fe(Box,{'flexDirection':_0x52db7f(0x103),'children':[a0_0x77b6fe(Box,{'children':[a0_0xf577b(Text,{'color':'gray','children':'\x20Step2:\x20'}),a0_0xf577b(Text,{'children':_0x52db7f(0x109)}),_0x405c75?a0_0xf577b(Text,{'color':'green','children':_0x405c75}):a0_0xf577b(Text,{'color':_0x52db7f(0x105),'children':_0xa35ad0}),_0x45e2ef&&a0_0x77b6fe(Text,{'color':_0x52db7f(0xf3),'children':['\x20←\x20',_0x45e2ef]})]}),!_0x45e2ef&&!_0x405c75&&a0_0xf577b(Box,{'children':a0_0xf577b(Text,{'color':_0x52db7f(0x105),'children':'\x20直接回车确认,或输入自定义路由地址'})})]});}
@@ -1 +1 @@
1
- const a1_0x1916cd=a1_0x13b1;(function(_0x52932f,_0x4ac84e){const _0x25965a=a1_0x13b1,_0x2a787b=_0x52932f();while(!![]){try{const _0xdc49d0=-parseInt(_0x25965a(0x10d))/0x1*(-parseInt(_0x25965a(0x115))/0x2)+parseInt(_0x25965a(0xff))/0x3*(-parseInt(_0x25965a(0x10b))/0x4)+-parseInt(_0x25965a(0xfb))/0x5*(-parseInt(_0x25965a(0xfc))/0x6)+parseInt(_0x25965a(0x116))/0x7+-parseInt(_0x25965a(0xfe))/0x8*(-parseInt(_0x25965a(0x109))/0x9)+-parseInt(_0x25965a(0x108))/0xa+-parseInt(_0x25965a(0x118))/0xb*(parseInt(_0x25965a(0x112))/0xc);if(_0xdc49d0===_0x4ac84e)break;else _0x2a787b['push'](_0x2a787b['shift']());}catch(_0x1d3c76){_0x2a787b['push'](_0x2a787b['shift']());}}}(a1_0x450f,0x8a4fc));import{jsx as a1_0x265aee,jsxs as a1_0xd1df5d,Fragment as a1_0x448fe0}from'react/jsx-runtime';import{fileURLToPath}from'node:url';import a1_0x2e1bbf from'node:path';function a1_0x13b1(_0x17e393,_0x599c61){_0x17e393=_0x17e393-0xfa;const _0x450fe5=a1_0x450f();let _0x13b17f=_0x450fe5[_0x17e393];return _0x13b17f;}function a1_0x450f(){const _0xc1ac13=['393590eUUpPm','36uFxoAy','\x20Step1:\x20','470248ibjZTw','152874LxppPS','add-page','\x20Step2:\x20','now','cwd','\x20*\x20页面文件已创建,可直接通过路由访问','页面添加失败:\x20','processTemplate','src','3474170EwLPrk','54UxPtFr','then','8apllMT','green','27lALKya','cyan','finally','gray','已选择页面模板\x20','10416QfbfMS','resolve','message','5444FnNTSs','1386651zHbYED','column','1023ifbSPZ','\x20*\x20路由地址:\x20','\x20*\x20页面创建成功!','页面添加成功:\x20','开始添加页面:\x20','join','pages'];a1_0x450f=function(){return _0xc1ac13;};return a1_0x450f();}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_0x2e1bbf['dirname'](fileURLToPath(import.meta.url)),pageTemplateDir=a1_0x2e1bbf[a1_0x1916cd(0x113)](__dirname,'../../templates/pages'),projectDir=process[a1_0x1916cd(0x103)]();export const AddPage=()=>{const _0x2a2ae3=a1_0x1916cd,{exit:_0x4f7eac}=useApp(),[_0x21d25a,_0x430459]=useState(''),[_0x28cdb5,_0x5438af]=useState(''),[_0x36d016,_0x2a8c57]=useState(![]),[_0x536c0e,_0x5f27a3]=useState(![]),_0x18cb27=a1_0x2e1bbf[_0x2a2ae3(0x11d)](projectDir,_0x2a2ae3(0x107),_0x2a2ae3(0xfa)),_0x560a5c=a1_0x2e1bbf['join'](_0x18cb27,_0x28cdb5),_0x4602e7=a1_0x2e1bbf[_0x2a2ae3(0x11d)](_0x2a2ae3(0x107),_0x2a2ae3(0xfa),_0x28cdb5);useEffect(()=>{const _0x26b889=_0x2a2ae3,_0x1e61ec=a1_0x2e1bbf[_0x26b889(0x113)](pageTemplateDir,_0x21d25a);if(_0x21d25a&&_0x28cdb5){_0x2a8c57(!![]),logger['setLogPath'](process['cwd']());const _0x19f819=Date[_0x26b889(0x102)]();logger['info'](_0x26b889(0x100),_0x26b889(0x11c)+_0x28cdb5,{'template':_0x21d25a,'targetPath':_0x4602e7}),TemplateReplacer[_0x26b889(0x106)](_0x1e61ec,a1_0x2e1bbf[_0x26b889(0x11d)](_0x18cb27,_0x28cdb5),_0x28cdb5,_0x21d25a)[_0x26b889(0x10a)](()=>{const _0x2ea7cf=_0x26b889,_0x3fe30d=Date[_0x2ea7cf(0x102)]()-_0x19f819;logger['success'](_0x2ea7cf(0x100),_0x2ea7cf(0x11b)+_0x28cdb5,_0x3fe30d,{'template':_0x21d25a,'targetPath':_0x4602e7,'routePath':_0x28cdb5}),_0x5f27a3(!![]);})['catch'](_0x19695d=>{const _0x536308=_0x26b889,_0x20b096=Date[_0x536308(0x102)]()-_0x19f819;logger['error'](_0x536308(0x100),_0x536308(0x105)+_0x28cdb5,{'template':_0x21d25a,'targetPath':_0x4602e7,'error':_0x19695d instanceof Error?_0x19695d[_0x536308(0x114)]:String(_0x19695d),'duration':_0x20b096});})[_0x26b889(0x10f)](()=>{_0x2a8c57(![]);});}},[_0x21d25a,_0x28cdb5]),useEffect(()=>{_0x536c0e&&setTimeout(()=>{_0x4f7eac();});},[_0x536c0e]);if(_0x21d25a)return a1_0xd1df5d(Box,{'flexDirection':_0x2a2ae3(0x117),'paddingY':0x1,'children':[a1_0xd1df5d(Box,{'children':[a1_0x265aee(Text,{'color':_0x2a2ae3(0x110),'children':_0x2a2ae3(0xfd)}),a1_0x265aee(Text,{'children':_0x2a2ae3(0x111)}),a1_0x265aee(Text,{'color':'green','children':_0x21d25a})]}),_0x28cdb5?a1_0xd1df5d(Box,{'children':[a1_0x265aee(Text,{'color':_0x2a2ae3(0x110),'children':_0x2a2ae3(0x101)}),a1_0x265aee(Text,{'children':'已输入的页面路由\x20'}),a1_0x265aee(Text,{'color':_0x2a2ae3(0x10c),'children':_0x28cdb5})]}):a1_0x265aee(InputProjectCode,{'pagePath':_0x560a5c,'onSubmit':_0x5438af}),_0x28cdb5&&_0x36d016?a1_0xd1df5d(Box,{'marginTop':0x1,'children':[a1_0x265aee(Box,{'width':'4'}),a1_0x265aee(Text,{'children':'正在创建页面,请稍候…'})]}):null,_0x536c0e?a1_0xd1df5d(a1_0x448fe0,{'children':[a1_0x265aee(Box,{'marginTop':0x1,'children':a1_0x265aee(Text,{'color':'gray','children':_0x2a2ae3(0x11a)})}),a1_0xd1df5d(Box,{'children':[a1_0x265aee(Text,{'color':_0x2a2ae3(0x110),'children':'\x20*\x20页面路径:\x20'}),a1_0x265aee(Text,{'color':'green','children':_0x4602e7})]}),a1_0xd1df5d(Box,{'children':[a1_0x265aee(Text,{'color':'gray','children':_0x2a2ae3(0x119)}),a1_0xd1df5d(Text,{'color':_0x2a2ae3(0x10c),'children':['/',_0x28cdb5]})]}),a1_0x265aee(Box,{'marginTop':0x1,'children':a1_0x265aee(Text,{'color':_0x2a2ae3(0x10e),'children':_0x2a2ae3(0x104)})})]}):null]});return a1_0x265aee(SelectPageTemplate,{'onSelect':_0x430459});};
1
+ const a1_0x2b318b=a1_0x159e;(function(_0xa43ef0,_0x6261d9){const _0x48bd44=a1_0x159e,_0x156e96=_0xa43ef0();while(!![]){try{const _0x590fc6=-parseInt(_0x48bd44(0x1b1))/0x1*(parseInt(_0x48bd44(0x193))/0x2)+-parseInt(_0x48bd44(0x1b5))/0x3+-parseInt(_0x48bd44(0x1b2))/0x4+parseInt(_0x48bd44(0x1ab))/0x5*(-parseInt(_0x48bd44(0x1b6))/0x6)+-parseInt(_0x48bd44(0x1ad))/0x7*(-parseInt(_0x48bd44(0x192))/0x8)+parseInt(_0x48bd44(0x191))/0x9*(parseInt(_0x48bd44(0x19f))/0xa)+parseInt(_0x48bd44(0x1a3))/0xb;if(_0x590fc6===_0x6261d9)break;else _0x156e96['push'](_0x156e96['shift']());}catch(_0x2b02d0){_0x156e96['push'](_0x156e96['shift']());}}}(a1_0x4be4,0xb5d5d));import{jsx as a1_0xb3f755,jsxs as a1_0x3e107f,Fragment as a1_0xc3fa80}from'react/jsx-runtime';import{fileURLToPath}from'node:url';import a1_0xafc091 from'node:path';import{useEffect,useState}from'react';function a1_0x159e(_0x590a81,_0x56112d){_0x590a81=_0x590a81-0x191;const _0x4be423=a1_0x4be4();let _0x159e3b=_0x4be423[_0x590a81];return _0x159e3b;}import{Box,Text,useApp}from'ink';function a1_0x4be4(){const _0xecee62=['2365168jlJUMZ','2872054wbIrfN','\x20Step2:\x20','页面添加失败:\x20','info','gray','finally','green','error','开始添加页面:\x20','src','cwd','message','110EMlSqp','pages','join','dirname','27282497ZbBmIa','\x20*\x20页面路径:\x20','页面添加成功:\x20','已选择页面模板\x20','已输入的页面路由\x20','\x20*\x20页面文件已创建,可直接通过路由访问','success','column','5gUQjKQ','then','21EmpeuF','now','add-page','catch','1ThAAUi','1949244VUBivQ','../../templates/pages','resolve','3340503EnceRs','1338600gEJzuM','521649kBPwbW'];a1_0x4be4=function(){return _0xecee62;};return a1_0x4be4();}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_0xafc091[a1_0x2b318b(0x1a2)](fileURLToPath(import.meta.url)),pageTemplateDir=a1_0xafc091[a1_0x2b318b(0x1b4)](__dirname,a1_0x2b318b(0x1b3)),projectDir=process[a1_0x2b318b(0x19d)]();export const AddPage=()=>{const _0x36da8e=a1_0x2b318b,{exit:_0x463411}=useApp(),[_0x496328,_0x32779]=useState(''),[_0x450d37,_0x5d9f09]=useState(''),[_0x547f44,_0x2903d1]=useState(![]),[_0x3c92ea,_0x2a1d52]=useState(![]),_0x1b7a55=a1_0xafc091[_0x36da8e(0x1a1)](projectDir,_0x36da8e(0x19c),_0x36da8e(0x1a0)),_0xd0ad6a=a1_0xafc091['join'](_0x1b7a55,_0x450d37),_0x501aef=a1_0xafc091['join'](_0x36da8e(0x19c),'pages',_0x450d37);useEffect(()=>{const _0x1fdcac=_0x36da8e,_0x213fca=a1_0xafc091[_0x1fdcac(0x1b4)](pageTemplateDir,_0x496328);if(_0x496328&&_0x450d37){_0x2903d1(!![]),logger['setLogPath'](process[_0x1fdcac(0x19d)]());const _0x4c7ada=Date[_0x1fdcac(0x1ae)]();logger[_0x1fdcac(0x196)]('add-page',_0x1fdcac(0x19b)+_0x450d37,{'template':_0x496328,'targetPath':_0x501aef}),TemplateReplacer['processTemplate'](_0x213fca,a1_0xafc091[_0x1fdcac(0x1a1)](_0x1b7a55,_0x450d37),_0x450d37,_0x496328)[_0x1fdcac(0x1ac)](()=>{const _0x20273a=_0x1fdcac,_0x320d0d=Date[_0x20273a(0x1ae)]()-_0x4c7ada;logger[_0x20273a(0x1a9)](_0x20273a(0x1af),_0x20273a(0x1a5)+_0x450d37,_0x320d0d,{'template':_0x496328,'targetPath':_0x501aef,'routePath':_0x450d37}),_0x2a1d52(!![]);})[_0x1fdcac(0x1b0)](_0x29fc47=>{const _0x151abf=_0x1fdcac,_0x30d315=Date['now']()-_0x4c7ada;logger[_0x151abf(0x19a)](_0x151abf(0x1af),_0x151abf(0x195)+_0x450d37,{'template':_0x496328,'targetPath':_0x501aef,'error':_0x29fc47 instanceof Error?_0x29fc47[_0x151abf(0x19e)]:String(_0x29fc47),'duration':_0x30d315});})[_0x1fdcac(0x198)](()=>{_0x2903d1(![]);});}},[_0x496328,_0x450d37]),useEffect(()=>{_0x3c92ea&&setTimeout(()=>{_0x463411();});},[_0x3c92ea]);if(_0x496328)return a1_0x3e107f(Box,{'flexDirection':_0x36da8e(0x1aa),'paddingY':0x1,'children':[a1_0x3e107f(Box,{'children':[a1_0xb3f755(Text,{'color':_0x36da8e(0x197),'children':'\x20Step1:\x20'}),a1_0xb3f755(Text,{'children':_0x36da8e(0x1a6)}),a1_0xb3f755(Text,{'color':_0x36da8e(0x199),'children':_0x496328})]}),_0x450d37?a1_0x3e107f(Box,{'children':[a1_0xb3f755(Text,{'color':_0x36da8e(0x197),'children':_0x36da8e(0x194)}),a1_0xb3f755(Text,{'children':_0x36da8e(0x1a7)}),a1_0xb3f755(Text,{'color':'green','children':_0x450d37})]}):a1_0xb3f755(InputProjectCode,{'pagePath':_0xd0ad6a,'onSubmit':_0x5d9f09}),_0x450d37&&_0x547f44?a1_0x3e107f(Box,{'marginTop':0x1,'children':[a1_0xb3f755(Box,{'width':'4'}),a1_0xb3f755(Text,{'children':'正在创建页面,请稍候…'})]}):null,_0x3c92ea?a1_0x3e107f(a1_0xc3fa80,{'children':[a1_0xb3f755(Box,{'marginTop':0x1,'children':a1_0xb3f755(Text,{'color':_0x36da8e(0x197),'children':'\x20*\x20页面创建成功!'})}),a1_0x3e107f(Box,{'children':[a1_0xb3f755(Text,{'color':'gray','children':_0x36da8e(0x1a4)}),a1_0xb3f755(Text,{'color':_0x36da8e(0x199),'children':_0x501aef})]}),a1_0x3e107f(Box,{'children':[a1_0xb3f755(Text,{'color':_0x36da8e(0x197),'children':'\x20*\x20路由地址:\x20'}),a1_0x3e107f(Text,{'color':'green','children':['/',_0x450d37]})]}),a1_0xb3f755(Box,{'marginTop':0x1,'children':a1_0xb3f755(Text,{'color':'cyan','children':_0x36da8e(0x1a8)})})]}):null]});return a1_0xb3f755(SelectPageTemplate,{'onSelect':_0x32779});};
@@ -1 +1 @@
1
- (function(_0x57ddae,_0x25fff9){const _0x14cf7b=a2_0xdd3a,_0x38b56d=_0x57ddae();while(!![]){try{const _0x487213=-parseInt(_0x14cf7b(0xb4))/0x1+-parseInt(_0x14cf7b(0xb1))/0x2+-parseInt(_0x14cf7b(0xb2))/0x3*(-parseInt(_0x14cf7b(0x9b))/0x4)+-parseInt(_0x14cf7b(0xb7))/0x5+parseInt(_0x14cf7b(0xb0))/0x6+-parseInt(_0x14cf7b(0xad))/0x7+parseInt(_0x14cf7b(0xb5))/0x8*(parseInt(_0x14cf7b(0xa0))/0x9);if(_0x487213===_0x25fff9)break;else _0x38b56d['push'](_0x38b56d['shift']());}catch(_0x522882){_0x38b56d['push'](_0x38b56d['shift']());}}}(a2_0x15b0,0x380a8));import{jsx as a2_0x4481a5,jsxs as a2_0x37ca72}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Text,Box,useInput}from'ink';import{readdir}from'node:fs/promises';import a2_0x1651d6 from'node:path';function a2_0x15b0(){const _0x59018f=['3763680JndPsb','\x20Step1:\x20','387285JiNolQ','error','40llKIxH','upArrow','dirname','resolve','sort','9UZvuJS','../..','map','isDirectory','return','gray','templates/pages','label','filter','\x20\x20\x20\x20\x20\x20\x20\x20','blank','正在加载页面模板...','column','1429120ydYSyY','\x20\x20\x20\x20\x20\x20>\x20','localeCompare','7296VjnZRy','93320pYEbxD','115878iuLkVg','green','300115FmTGXR'];a2_0x15b0=function(){return _0x59018f;};return a2_0x15b0();}import{fileURLToPath}from'node:url';async function getTemplateList(){const _0xfea11f=a2_0xdd3a;try{const _0x4f0220=fileURLToPath(import.meta.url),_0xa29915=a2_0x1651d6[_0xfea11f(0x9e)](a2_0x1651d6[_0xfea11f(0x9d)](_0x4f0220),_0xfea11f(0xa1)),_0x23c1c4=a2_0x1651d6['join'](_0xa29915,_0xfea11f(0xa6)),_0x5efe81=await readdir(_0x23c1c4,{'withFileTypes':!![]}),_0x1ecb6f=_0x5efe81[_0xfea11f(0xa8)](_0x5afcde=>_0x5afcde[_0xfea11f(0xa3)]())[_0xfea11f(0xa2)](_0x3983a4=>({'label':_0x3983a4['name']}))[_0xfea11f(0x9f)]((_0x1d7250,_0x2af4ec)=>_0x1d7250[_0xfea11f(0xa7)][_0xfea11f(0xaf)](_0x2af4ec[_0xfea11f(0xa7)]));return _0x1ecb6f;}catch(_0x515247){return console[_0xfea11f(0x9a)]('获取模板列表失败:',_0x515247),[{'label':_0xfea11f(0xaa)},{'label':'sdk-fetch'}];}}function a2_0xdd3a(_0x1eef4a,_0x386cd6){_0x1eef4a=_0x1eef4a-0x9a;const _0x15b0f7=a2_0x15b0();let _0xdd3a69=_0x15b0f7[_0x1eef4a];return _0xdd3a69;}export function SelectPageTemplate(_0x4e71d3){const _0x26b7ca=a2_0xdd3a,[_0x1fb00f,_0x427803]=useState(0x0),[_0x38d5a6,_0x71dbf2]=useState([]),[_0x19b6f2,_0x1b21d4]=useState(!![]);useEffect(()=>{async function _0x112408(){const _0x5868bc=await getTemplateList();_0x71dbf2(_0x5868bc),_0x1b21d4(![]);}_0x112408();},[]),useInput((_0x407d21,_0x3dd745)=>{const _0x328424=a2_0xdd3a;if(_0x19b6f2)return;if(_0x3dd745[_0x328424(0xa4)]){const _0x46f5ce=_0x38d5a6[_0x1fb00f];_0x46f5ce&&_0x4e71d3['onSelect'](_0x46f5ce[_0x328424(0xa7)]);}_0x3dd745[_0x328424(0x9c)]&&_0x427803(_0x271c55=>_0x271c55===0x0?_0x38d5a6['length']-0x1:_0x271c55-0x1),_0x3dd745['downArrow']&&_0x427803(_0x80dcb2=>_0x80dcb2===_0x38d5a6['length']-0x1?0x0:_0x80dcb2+0x1);});if(_0x19b6f2)return a2_0x4481a5(Box,{'flexDirection':_0x26b7ca(0xac),'paddingY':0x1,'children':a2_0x37ca72(Box,{'children':[a2_0x4481a5(Text,{'color':_0x26b7ca(0xa5),'children':_0x26b7ca(0xb6)}),a2_0x4481a5(Text,{'children':_0x26b7ca(0xab)})]})});return a2_0x37ca72(Box,{'flexDirection':_0x26b7ca(0xac),'paddingY':0x1,'children':[a2_0x37ca72(Box,{'children':[a2_0x4481a5(Text,{'color':_0x26b7ca(0xa5),'children':_0x26b7ca(0xb6)}),a2_0x4481a5(Text,{'children':'请选择您要创建的页面模板'})]}),_0x38d5a6[_0x26b7ca(0xa2)]((_0x182218,_0x5ebb47)=>{const _0x4d2b4c=_0x26b7ca,_0x1cbc7e=_0x5ebb47===_0x1fb00f,_0xfc9907=_0x1cbc7e?_0x4d2b4c(0xae)+_0x182218[_0x4d2b4c(0xa7)]:_0x4d2b4c(0xa9)+_0x182218[_0x4d2b4c(0xa7)];return a2_0x4481a5(Box,{'children':a2_0x4481a5(Text,{'color':_0x1cbc7e?_0x4d2b4c(0xb3):undefined,'children':_0xfc9907})},_0xfc9907);})]});}
1
+ function a2_0x3745(){const _0x4f2f5b=['29474739sjWHIu','filter','green','sdk-fetch','420bgMsjK','downArrow','请选择您要创建的页面模板','gray','123115BXGXrS','length','1546298zaNFDn','../..','upArrow','120869HbUQOs','onSelect','\x20Step1:\x20','isDirectory','sort','dirname','templates/pages','获取模板列表失败:','localeCompare','328nxoPUd','label','resolve','4016076tMWrEX','3527079BnFBUS','\x20\x20\x20\x20\x20\x20>\x20','column','839437JzFsXs','blank','name'];a2_0x3745=function(){return _0x4f2f5b;};return a2_0x3745();}(function(_0x655561,_0x248a05){const _0x7e7910=a2_0x2ffb,_0x2ddb85=_0x655561();while(!![]){try{const _0x574680=-parseInt(_0x7e7910(0xbe))/0x1+parseInt(_0x7e7910(0xab))/0x2+parseInt(_0x7e7910(0xbb))/0x3+-parseInt(_0x7e7910(0xba))/0x4+parseInt(_0x7e7910(0xa9))/0x5*(-parseInt(_0x7e7910(0xc5))/0x6)+parseInt(_0x7e7910(0xae))/0x7*(-parseInt(_0x7e7910(0xb7))/0x8)+parseInt(_0x7e7910(0xc1))/0x9;if(_0x574680===_0x248a05)break;else _0x2ddb85['push'](_0x2ddb85['shift']());}catch(_0x5c0aff){_0x2ddb85['push'](_0x2ddb85['shift']());}}}(a2_0x3745,0xe7a40));import{jsx as a2_0x1d2493,jsxs as a2_0x137b9e}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Text,Box,useInput}from'ink';import{readdir}from'node:fs/promises';import a2_0x4d6d91 from'node:path';import{fileURLToPath}from'node:url';function a2_0x2ffb(_0x217194,_0x5b1812){_0x217194=_0x217194-0xa7;const _0x374561=a2_0x3745();let _0x2ffbf0=_0x374561[_0x217194];return _0x2ffbf0;}async function getTemplateList(){const _0x397a08=a2_0x2ffb;try{const _0x23f749=fileURLToPath(import.meta.url),_0x3ea788=a2_0x4d6d91[_0x397a08(0xb9)](a2_0x4d6d91[_0x397a08(0xb3)](_0x23f749),_0x397a08(0xac)),_0x28fd96=a2_0x4d6d91['join'](_0x3ea788,_0x397a08(0xb4)),_0x24136b=await readdir(_0x28fd96,{'withFileTypes':!![]}),_0x5bd7f0=_0x24136b[_0x397a08(0xc2)](_0x3c0226=>_0x3c0226[_0x397a08(0xb1)]())['map'](_0x4c10e1=>({'label':_0x4c10e1[_0x397a08(0xc0)]}))[_0x397a08(0xb2)]((_0xe3121,_0x76d94f)=>_0xe3121[_0x397a08(0xb8)][_0x397a08(0xb6)](_0x76d94f[_0x397a08(0xb8)]));return _0x5bd7f0;}catch(_0x15c02b){return console['error'](_0x397a08(0xb5),_0x15c02b),[{'label':_0x397a08(0xbf)},{'label':_0x397a08(0xc4)}];}}export function SelectPageTemplate(_0x31b117){const _0x5df35e=a2_0x2ffb,[_0x148980,_0x116599]=useState(0x0),[_0x4a1da0,_0x4a6877]=useState([]),[_0x1772ea,_0x2bb0a7]=useState(!![]);useEffect(()=>{async function _0x1744cb(){const _0x366e7b=await getTemplateList();_0x4a6877(_0x366e7b),_0x2bb0a7(![]);}_0x1744cb();},[]),useInput((_0x22176e,_0x3d0d0f)=>{const _0x37e97f=a2_0x2ffb;if(_0x1772ea)return;if(_0x3d0d0f['return']){const _0xa2ece1=_0x4a1da0[_0x148980];_0xa2ece1&&_0x31b117[_0x37e97f(0xaf)](_0xa2ece1[_0x37e97f(0xb8)]);}_0x3d0d0f[_0x37e97f(0xad)]&&_0x116599(_0x4da60b=>_0x4da60b===0x0?_0x4a1da0['length']-0x1:_0x4da60b-0x1),_0x3d0d0f[_0x37e97f(0xc6)]&&_0x116599(_0x4d2f18=>_0x4d2f18===_0x4a1da0[_0x37e97f(0xaa)]-0x1?0x0:_0x4d2f18+0x1);});if(_0x1772ea)return a2_0x1d2493(Box,{'flexDirection':_0x5df35e(0xbd),'paddingY':0x1,'children':a2_0x137b9e(Box,{'children':[a2_0x1d2493(Text,{'color':_0x5df35e(0xa8),'children':_0x5df35e(0xb0)}),a2_0x1d2493(Text,{'children':'正在加载页面模板...'})]})});return a2_0x137b9e(Box,{'flexDirection':_0x5df35e(0xbd),'paddingY':0x1,'children':[a2_0x137b9e(Box,{'children':[a2_0x1d2493(Text,{'color':_0x5df35e(0xa8),'children':_0x5df35e(0xb0)}),a2_0x1d2493(Text,{'children':_0x5df35e(0xa7)})]}),_0x4a1da0['map']((_0x5122ba,_0x293596)=>{const _0x53dcff=_0x5df35e,_0x450d1f=_0x293596===_0x148980,_0x3b6be3=_0x450d1f?_0x53dcff(0xbc)+_0x5122ba[_0x53dcff(0xb8)]:'\x20\x20\x20\x20\x20\x20\x20\x20'+_0x5122ba['label'];return a2_0x1d2493(Box,{'children':a2_0x1d2493(Text,{'color':_0x450d1f?_0x53dcff(0xc3):undefined,'children':_0x3b6be3})},_0x3b6be3);})]});}
@@ -1 +1 @@
1
- const a3_0xc1cc17=a3_0x5e78;(function(_0x2d1595,_0x339697){const _0xfbe23=a3_0x5e78,_0x481a56=_0x2d1595();while(!![]){try{const _0x333c4c=-parseInt(_0xfbe23(0x1bd))/0x1+parseInt(_0xfbe23(0x1e0))/0x2+parseInt(_0xfbe23(0x1c7))/0x3*(-parseInt(_0xfbe23(0x1cb))/0x4)+-parseInt(_0xfbe23(0x1b7))/0x5+parseInt(_0xfbe23(0x1e8))/0x6+-parseInt(_0xfbe23(0x1be))/0x7+-parseInt(_0xfbe23(0x1df))/0x8*(-parseInt(_0xfbe23(0x1d0))/0x9);if(_0x333c4c===_0x339697)break;else _0x481a56['push'](_0x481a56['shift']());}catch(_0x59d7f0){_0x481a56['push'](_0x481a56['shift']());}}}(a3_0x35a0,0x7f404));import{jsx as a3_0x362bc3,jsxs as a3_0x5658b7}from'react/jsx-runtime';import{useState,useEffect}from'react';function a3_0x5e78(_0x32d0a4,_0x218fe2){_0x32d0a4=_0x32d0a4-0x1b1;const _0x35a0bd=a3_0x35a0();let _0x5e78a7=_0x35a0bd[_0x32d0a4];return _0x5e78a7;}import{Box,Text,useInput,useApp}from'ink';function a3_0x35a0(){const _0x279547=['mcp-','skill-','selecting','[Y]\x20是,配置\x20AI\x20助手','column','2277625FnZpdl','size','*\x20选择要配置的\x20IDE:','cyan','dimColor','agent','907752DyLorp','2870952yalUmI','请至少选择一个配置项','Cursor','blue','[\x20]','[N]\x20跳过,稍后手动配置','•\x20MCP:\x20让\x20AI\x20直接访问\x20Lovrabet\x20数据集','projectRoot','appcode','5613iRDAjV','name','done','error','1132atpFuO','是否同时配置\x20AI\x20助手?这将:','codex','ide','message','117QMZkPx','gray','cursor','confirming','red','push','trae','MCP\x20服务器\x20(AI\x20访问数据集)','Enter\x20默认:\x20是','map','delete','length','green','正在配置\x20AI\x20助手...','white','1104808UvdpDt','415532BdxKRW','has','[✓]','add','Claude\x20Code','installing','opencode','•\x20Skill:\x20安装研发最佳实践、Backend\x20Function\x20规范','4926282HrQcBx','windsurf','claude','codebuddy','↑/↓:\x20移动\x20空格:\x20切换\x20a:\x20全选\x20q:\x20退出\x20Enter:\x20确认','return'];a3_0x35a0=function(){return _0x279547;};return a3_0x35a0();}import{configureMcp}from'./config.js';import{installSkill,copySharedSkills,createSkillManifest,SKILL_IDE_CONFIGS}from'./config.js';const MCP_IDE_LIST=[a3_0xc1cc17(0x1d2),a3_0xc1cc17(0x1ea)],SKILL_IDE_LIST=['antigravity',a3_0xc1cc17(0x1ea),a3_0xc1cc17(0x1eb),a3_0xc1cc17(0x1cd),a3_0xc1cc17(0x1d2),a3_0xc1cc17(0x1e6),'qoder',a3_0xc1cc17(0x1d6),a3_0xc1cc17(0x1e9),a3_0xc1cc17(0x1bc)];export function AISetupUI({config:_0x1626c0,onComplete:_0x45e327}){const _0x4563e5=a3_0xc1cc17,{exit:_0x51aa56}=useApp(),[_0x3bef73,_0x3ef8d0]=useState(_0x4563e5(0x1d3)),[_0x40ac55,_0x2d0b8c]=useState(0x0),[_0xd0aacf,_0x4bdc7a]=useState(new Set([0x0,0x1])),[_0x382c7f,_0x3128a4]=useState(new Set(SKILL_IDE_LIST[_0x4563e5(0x1d9)]((_0x5bc05a,_0x106928)=>_0x106928))),[_0xcd46ff,_0x351313]=useState('');useEffect(()=>{const _0x58f4a0=_0x4563e5;!_0x1626c0[_0x58f4a0(0x1c6)]&&_0x45e327({'mcpResults':[],'skillResults':[]});},[_0x1626c0[_0x4563e5(0x1c6)],_0x45e327]),useInput((_0x22bd31,_0x846a5c)=>{const _0x29a6da=_0x4563e5;if(_0x3bef73===_0x29a6da(0x1d3)){if(_0x22bd31==='y'||_0x22bd31==='Y'||_0x846a5c[_0x29a6da(0x1b1)]){_0x550b7f();return;}if(_0x22bd31==='n'||_0x22bd31==='N'){_0x45e327({'mcpResults':[],'skillResults':[]});return;}if(_0x846a5c[_0x29a6da(0x1b1)]){_0x550b7f();return;}}if(_0x3bef73===_0x29a6da(0x1b4)){if(_0x846a5c['upArrow']){_0x2d0b8c(_0x13e8ed=>_0x13e8ed>0x0?_0x13e8ed-0x1:SKILL_IDE_LIST[_0x29a6da(0x1db)]-0x1);return;}if(_0x846a5c['downArrow']){_0x2d0b8c(_0x4d228b=>_0x4d228b<SKILL_IDE_LIST['length']-0x1?_0x4d228b+0x1:0x0);return;}if(_0x22bd31==='\x20'){const _0x1f061f=_0x40ac55<MCP_IDE_LIST[_0x29a6da(0x1db)];if(_0x1f061f){const _0xf8e2c0=new Set(_0xd0aacf);_0xf8e2c0[_0x29a6da(0x1e1)](_0x40ac55)?_0xf8e2c0[_0x29a6da(0x1da)](_0x40ac55):_0xf8e2c0[_0x29a6da(0x1e3)](_0x40ac55),_0x4bdc7a(_0xf8e2c0);}else{const _0x3f6dd0=_0x40ac55-MCP_IDE_LIST[_0x29a6da(0x1db)],_0x15f67d=new Set(_0x382c7f);_0x15f67d['has'](_0x3f6dd0)?_0x15f67d[_0x29a6da(0x1da)](_0x3f6dd0):_0x15f67d[_0x29a6da(0x1e3)](_0x3f6dd0),_0x3128a4(_0x15f67d);}return;}if(_0x22bd31==='a'||_0x22bd31==='A'){_0x4bdc7a(new Set(MCP_IDE_LIST[_0x29a6da(0x1d9)]((_0x3514ca,_0x37db9c)=>_0x37db9c))),_0x3128a4(new Set(SKILL_IDE_LIST[_0x29a6da(0x1d9)]((_0x55e58d,_0x550dc6)=>_0x550dc6)));return;}if(_0x22bd31==='q'||_0x22bd31==='Q'){_0x51aa56();return;}if(_0x846a5c[_0x29a6da(0x1b1)]){if(_0xd0aacf['size']===0x0&&_0x382c7f[_0x29a6da(0x1b8)]===0x0){_0x351313(_0x29a6da(0x1bf));return;}_0x550b7f();return;}}if(_0x3bef73==='done'){_0x51aa56();return;}});async function _0x550b7f(){const _0x1cf12b=_0x4563e5;_0x3ef8d0(_0x1cf12b(0x1e5));const _0x3a534f=[],_0x80fbd7=[];for(const _0x4cd281 of _0xd0aacf){const _0x1150f2=MCP_IDE_LIST[_0x4cd281];if(!_0x1150f2)continue;try{const _0x29cdcb=await configureMcp(_0x1150f2,_0x1626c0[_0x1cf12b(0x1c5)]);_0x3a534f[_0x1cf12b(0x1d5)](_0x29cdcb);}catch(_0x40da34){_0x3a534f[_0x1cf12b(0x1d5)]({'ide':MCP_IDE_CONFIGS[_0x1150f2]?.[_0x1cf12b(0x1c8)]||_0x1150f2,'status':_0x1cf12b(0x1ca),'message':_0x40da34 instanceof Error?_0x40da34[_0x1cf12b(0x1cf)]:String(_0x40da34)});}}await copySharedSkills(_0x1626c0[_0x1cf12b(0x1c5)]);for(const _0x235b3e of _0x382c7f){const _0xd32f11=SKILL_IDE_LIST[_0x235b3e];if(!_0xd32f11)continue;try{const _0xf576e=await installSkill(_0xd32f11,_0x1626c0[_0x1cf12b(0x1c5)]);_0x80fbd7['push'](_0xf576e);}catch(_0xa83671){_0x80fbd7['push']({'ide':SKILL_IDE_CONFIGS[_0xd32f11]?.[_0x1cf12b(0x1c8)]||_0xd32f11,'status':_0x1cf12b(0x1ca),'message':_0xa83671 instanceof Error?_0xa83671[_0x1cf12b(0x1cf)]:String(_0xa83671)});}}if(_0x80fbd7[_0x1cf12b(0x1db)]>0x0){const _0x1e28f6=_0x80fbd7['filter'](_0xe832f2=>_0xe832f2['status']==='success')[_0x1cf12b(0x1d9)](_0x309df3=>_0x309df3[_0x1cf12b(0x1ce)]);_0x1e28f6['length']>0x0&&createSkillManifest(_0x1626c0[_0x1cf12b(0x1c5)],_0x1e28f6);}_0x3ef8d0('done'),setTimeout(()=>{_0x45e327({'mcpResults':_0x3a534f,'skillResults':_0x80fbd7});},0xbb8);}if(_0x3bef73===_0x4563e5(0x1d3))return a3_0x5658b7(Box,{'flexDirection':_0x4563e5(0x1b6),'marginTop':0x1,'children':[a3_0x362bc3(Box,{'marginTop':0x1,'children':a3_0x362bc3(Text,{'color':'white','children':_0x4563e5(0x1cc)})}),a3_0x362bc3(Box,{'marginLeft':0x2,'marginTop':0x1,'children':a3_0x362bc3(Text,{'color':_0x4563e5(0x1d1),'children':_0x4563e5(0x1c4)})}),a3_0x362bc3(Box,{'marginLeft':0x2,'children':a3_0x362bc3(Text,{'color':_0x4563e5(0x1d1),'children':_0x4563e5(0x1e7)})}),a3_0x5658b7(Box,{'marginTop':0x1,'flexDirection':'column','children':[a3_0x362bc3(Box,{'children':a3_0x362bc3(Text,{'color':_0x4563e5(0x1dc),'children':_0x4563e5(0x1b5)})}),a3_0x362bc3(Box,{'children':a3_0x362bc3(Text,{'color':_0x4563e5(0x1d1),'children':_0x4563e5(0x1c3)})}),a3_0x362bc3(Box,{'children':a3_0x362bc3(Text,{'color':_0x4563e5(0x1bb),'children':_0x4563e5(0x1d8)})})]}),_0xcd46ff&&a3_0x362bc3(Box,{'marginTop':0x1,'children':a3_0x5658b7(Text,{'color':_0x4563e5(0x1d4),'children':['✗\x20',_0xcd46ff]})})]});if(_0x3bef73===_0x4563e5(0x1b4))return a3_0x5658b7(Box,{'flexDirection':_0x4563e5(0x1b6),'marginTop':0x1,'children':[a3_0x362bc3(Box,{'children':a3_0x362bc3(Text,{'color':_0x4563e5(0x1ba),'bold':!![],'children':_0x4563e5(0x1b9)})}),_0xcd46ff&&a3_0x362bc3(Box,{'marginTop':0x1,'children':a3_0x5658b7(Text,{'color':_0x4563e5(0x1d4),'children':['✗\x20',_0xcd46ff]})}),a3_0x5658b7(Box,{'marginTop':0x1,'flexDirection':_0x4563e5(0x1b6),'children':[a3_0x362bc3(Text,{'bold':!![],'color':'yellow','children':_0x4563e5(0x1d7)}),MCP_IDE_LIST[_0x4563e5(0x1d9)]((_0x1c425a,_0x9a9442)=>{const _0x26876c=_0x4563e5,_0x127245=_0x40ac55===_0x9a9442,_0xb88aca=_0xd0aacf['has'](_0x9a9442);return a3_0x362bc3(Box,{'children':a3_0x5658b7(Text,{'backgroundColor':_0x127245?_0x26876c(0x1c1):undefined,'color':_0x127245?_0x26876c(0x1de):undefined,'children':[_0xb88aca?_0x26876c(0x1e2):_0x26876c(0x1c2),'\x20',_0x1c425a==='cursor'?'Cursor':_0x26876c(0x1e4)]})},_0x26876c(0x1b2)+_0x1c425a);}),a3_0x362bc3(Box,{'marginTop':0x1,'children':a3_0x362bc3(Text,{'bold':!![],'color':'yellow','children':'技能包\x20(研发规范指南)'})}),SKILL_IDE_LIST[_0x4563e5(0x1d9)]((_0x538f18,_0x417167)=>{const _0x367244=_0x4563e5,_0x35ed47=_0x417167+MCP_IDE_LIST[_0x367244(0x1db)],_0x3c92b2=_0x40ac55===_0x35ed47,_0x543d2c=_0x382c7f[_0x367244(0x1e1)](_0x35ed47);return a3_0x362bc3(Box,{'children':a3_0x5658b7(Text,{'backgroundColor':_0x3c92b2?_0x367244(0x1c1):undefined,'color':_0x3c92b2?_0x367244(0x1de):undefined,'children':[_0x543d2c?'[✓]':_0x367244(0x1c2),'\x20',SKILL_IDE_CONFIGS[_0x538f18][_0x367244(0x1c8)]]})},_0x367244(0x1b3)+_0x538f18);}),a3_0x362bc3(Box,{'marginTop':0x1,'children':a3_0x362bc3(Text,{'color':_0x4563e5(0x1d1),'children':_0x4563e5(0x1ec)})})]})]});if(_0x3bef73===_0x4563e5(0x1e5))return a3_0x362bc3(Box,{'flexDirection':'column','marginTop':0x1,'children':a3_0x362bc3(Box,{'children':a3_0x362bc3(Text,{'children':_0x4563e5(0x1dd)})})});if(_0x3bef73===_0x4563e5(0x1c9))return null;return null;}const MCP_IDE_CONFIGS={'cursor':{'name':a3_0xc1cc17(0x1c0)},'claude':{'name':a3_0xc1cc17(0x1e4)}};
1
+ const a3_0x5bf43b=a3_0x4a9d;(function(_0x3d427f,_0x29b18f){const _0x53c196=a3_0x4a9d,_0x57920e=_0x3d427f();while(!![]){try{const _0x1e8efb=parseInt(_0x53c196(0x202))/0x1+-parseInt(_0x53c196(0x1d3))/0x2+-parseInt(_0x53c196(0x1d2))/0x3+parseInt(_0x53c196(0x1fa))/0x4+parseInt(_0x53c196(0x1cf))/0x5+-parseInt(_0x53c196(0x1fb))/0x6*(-parseInt(_0x53c196(0x1cc))/0x7)+-parseInt(_0x53c196(0x1ca))/0x8;if(_0x1e8efb===_0x29b18f)break;else _0x57920e['push'](_0x57920e['shift']());}catch(_0x1bd0d7){_0x57920e['push'](_0x57920e['shift']());}}}(a3_0x1dd6,0xa7436));import{jsx as a3_0x1a65b8,jsxs as a3_0x484886}from'react/jsx-runtime';function a3_0x1dd6(){const _0x1b687f=['*\x20选择要配置的\x20IDE:','column','windsurf','[\x20]','return','3676552XSEqxo','11334BBlfFJ','add','•\x20Skill:\x20安装研发最佳实践、Backend\x20Function\x20规范','opencode','has','[N]\x20跳过,稍后手动配置','antigravity','750508hlzKqO','claude','是否同时配置\x20AI\x20助手?这将:','3517776QMCNBR','upArrow','3171LmXuIs','mcp-','技能包\x20(研发规范指南)','5872360IZgRob','[Y]\x20是,配置\x20AI\x20助手','error','3797103PhcNFu','2618604HqHJbW','appcode','success','done','[✓]','delete','codebuddy','name','map','qoder','push','yellow','red','trae','projectRoot','Claude\x20Code','codex','length','installing','请至少选择一个配置项','status','Cursor','cursor','gray','confirming','selecting','message','dimColor','size','white','downArrow','blue','MCP\x20服务器\x20(AI\x20访问数据集)','正在配置\x20AI\x20助手...'];a3_0x1dd6=function(){return _0x1b687f;};return a3_0x1dd6();}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';function a3_0x4a9d(_0x32e80d,_0x5dba2c){_0x32e80d=_0x32e80d-0x1c8;const _0x1dd625=a3_0x1dd6();let _0x4a9d63=_0x1dd625[_0x32e80d];return _0x4a9d63;}const MCP_IDE_LIST=['cursor',a3_0x5bf43b(0x1c8)],SKILL_IDE_LIST=[a3_0x5bf43b(0x201),'claude',a3_0x5bf43b(0x1d9),a3_0x5bf43b(0x1e3),'cursor',a3_0x5bf43b(0x1fe),a3_0x5bf43b(0x1dc),a3_0x5bf43b(0x1e0),a3_0x5bf43b(0x1f7),'agent'];export function AISetupUI({config:_0x32ce36,onComplete:_0xeb5343}){const _0x4490c1=a3_0x5bf43b,{exit:_0x2a3c97}=useApp(),[_0x4efbf7,_0x47a14d]=useState(_0x4490c1(0x1eb)),[_0x14fcb9,_0x49eee5]=useState(0x0),[_0x27b00d,_0x4af84a]=useState(new Set([0x0,0x1])),[_0xcdcb2b,_0x2efe95]=useState(new Set(SKILL_IDE_LIST[_0x4490c1(0x1db)]((_0x181798,_0x24cbf2)=>_0x24cbf2))),[_0x56ca2b,_0x50e37a]=useState('');useEffect(()=>{const _0x37b969=_0x4490c1;!_0x32ce36[_0x37b969(0x1d4)]&&_0xeb5343({'mcpResults':[],'skillResults':[]});},[_0x32ce36[_0x4490c1(0x1d4)],_0xeb5343]),useInput((_0x389957,_0x73d21e)=>{const _0x4fa1f8=_0x4490c1;if(_0x4efbf7===_0x4fa1f8(0x1eb)){if(_0x389957==='y'||_0x389957==='Y'||_0x73d21e[_0x4fa1f8(0x1f9)]){_0x11f783();return;}if(_0x389957==='n'||_0x389957==='N'){_0xeb5343({'mcpResults':[],'skillResults':[]});return;}if(_0x73d21e[_0x4fa1f8(0x1f9)]){_0x11f783();return;}}if(_0x4efbf7===_0x4fa1f8(0x1ec)){if(_0x73d21e[_0x4fa1f8(0x1cb)]){_0x49eee5(_0x23ec9f=>_0x23ec9f>0x0?_0x23ec9f-0x1:SKILL_IDE_LIST[_0x4fa1f8(0x1e4)]-0x1);return;}if(_0x73d21e[_0x4fa1f8(0x1f1)]){_0x49eee5(_0x5d18ca=>_0x5d18ca<SKILL_IDE_LIST[_0x4fa1f8(0x1e4)]-0x1?_0x5d18ca+0x1:0x0);return;}if(_0x389957==='\x20'){const _0x4da5ee=_0x14fcb9<MCP_IDE_LIST[_0x4fa1f8(0x1e4)];if(_0x4da5ee){const _0x26d83f=new Set(_0x27b00d);_0x26d83f[_0x4fa1f8(0x1ff)](_0x14fcb9)?_0x26d83f[_0x4fa1f8(0x1d8)](_0x14fcb9):_0x26d83f[_0x4fa1f8(0x1fc)](_0x14fcb9),_0x4af84a(_0x26d83f);}else{const _0x3254c9=_0x14fcb9-MCP_IDE_LIST[_0x4fa1f8(0x1e4)],_0x53ef63=new Set(_0xcdcb2b);_0x53ef63[_0x4fa1f8(0x1ff)](_0x3254c9)?_0x53ef63[_0x4fa1f8(0x1d8)](_0x3254c9):_0x53ef63['add'](_0x3254c9),_0x2efe95(_0x53ef63);}return;}if(_0x389957==='a'||_0x389957==='A'){_0x4af84a(new Set(MCP_IDE_LIST[_0x4fa1f8(0x1db)]((_0x5e2bb5,_0x4464ac)=>_0x4464ac))),_0x2efe95(new Set(SKILL_IDE_LIST[_0x4fa1f8(0x1db)]((_0x3023cd,_0x5d78c4)=>_0x5d78c4)));return;}if(_0x389957==='q'||_0x389957==='Q'){_0x2a3c97();return;}if(_0x73d21e['return']){if(_0x27b00d[_0x4fa1f8(0x1ef)]===0x0&&_0xcdcb2b[_0x4fa1f8(0x1ef)]===0x0){_0x50e37a(_0x4fa1f8(0x1e6));return;}_0x11f783();return;}}if(_0x4efbf7===_0x4fa1f8(0x1d6)){_0x2a3c97();return;}});async function _0x11f783(){const _0x52e9fb=_0x4490c1;_0x47a14d(_0x52e9fb(0x1e5));const _0xe1203b=[],_0x3ee645=[];for(const _0x35c53b of _0x27b00d){const _0xdd7f9e=MCP_IDE_LIST[_0x35c53b];if(!_0xdd7f9e)continue;try{const _0x3a6c61=await configureMcp(_0xdd7f9e,_0x32ce36['projectRoot']);_0xe1203b[_0x52e9fb(0x1dd)](_0x3a6c61);}catch(_0x5a1095){_0xe1203b[_0x52e9fb(0x1dd)]({'ide':MCP_IDE_CONFIGS[_0xdd7f9e]?.[_0x52e9fb(0x1da)]||_0xdd7f9e,'status':_0x52e9fb(0x1d1),'message':_0x5a1095 instanceof Error?_0x5a1095[_0x52e9fb(0x1ed)]:String(_0x5a1095)});}}await copySharedSkills(_0x32ce36['projectRoot']);for(const _0x4908af of _0xcdcb2b){const _0x8a9d05=SKILL_IDE_LIST[_0x4908af];if(!_0x8a9d05)continue;try{const _0x2a43b1=await installSkill(_0x8a9d05,_0x32ce36[_0x52e9fb(0x1e1)]);_0x3ee645['push'](_0x2a43b1);}catch(_0x45d160){_0x3ee645['push']({'ide':SKILL_IDE_CONFIGS[_0x8a9d05]?.[_0x52e9fb(0x1da)]||_0x8a9d05,'status':'error','message':_0x45d160 instanceof Error?_0x45d160[_0x52e9fb(0x1ed)]:String(_0x45d160)});}}if(_0x3ee645[_0x52e9fb(0x1e4)]>0x0){const _0x31c6f2=_0x3ee645['filter'](_0x2416b4=>_0x2416b4[_0x52e9fb(0x1e7)]===_0x52e9fb(0x1d5))[_0x52e9fb(0x1db)](_0x5a1ae2=>_0x5a1ae2['ide']);_0x31c6f2[_0x52e9fb(0x1e4)]>0x0&&createSkillManifest(_0x32ce36[_0x52e9fb(0x1e1)],_0x31c6f2);}_0x47a14d(_0x52e9fb(0x1d6)),setTimeout(()=>{_0xeb5343({'mcpResults':_0xe1203b,'skillResults':_0x3ee645});},0xbb8);}if(_0x4efbf7===_0x4490c1(0x1eb))return a3_0x484886(Box,{'flexDirection':'column','marginTop':0x1,'children':[a3_0x1a65b8(Box,{'marginTop':0x1,'children':a3_0x1a65b8(Text,{'color':_0x4490c1(0x1f0),'children':_0x4490c1(0x1c9)})}),a3_0x1a65b8(Box,{'marginLeft':0x2,'marginTop':0x1,'children':a3_0x1a65b8(Text,{'color':_0x4490c1(0x1ea),'children':'•\x20MCP:\x20让\x20AI\x20直接访问\x20Lovrabet\x20数据集'})}),a3_0x1a65b8(Box,{'marginLeft':0x2,'children':a3_0x1a65b8(Text,{'color':_0x4490c1(0x1ea),'children':_0x4490c1(0x1fd)})}),a3_0x484886(Box,{'marginTop':0x1,'flexDirection':'column','children':[a3_0x1a65b8(Box,{'children':a3_0x1a65b8(Text,{'color':'green','children':_0x4490c1(0x1d0)})}),a3_0x1a65b8(Box,{'children':a3_0x1a65b8(Text,{'color':_0x4490c1(0x1ea),'children':_0x4490c1(0x200)})}),a3_0x1a65b8(Box,{'children':a3_0x1a65b8(Text,{'color':_0x4490c1(0x1ee),'children':'Enter\x20默认:\x20是'})})]}),_0x56ca2b&&a3_0x1a65b8(Box,{'marginTop':0x1,'children':a3_0x484886(Text,{'color':_0x4490c1(0x1df),'children':['✗\x20',_0x56ca2b]})})]});if(_0x4efbf7===_0x4490c1(0x1ec))return a3_0x484886(Box,{'flexDirection':_0x4490c1(0x1f6),'marginTop':0x1,'children':[a3_0x1a65b8(Box,{'children':a3_0x1a65b8(Text,{'color':'cyan','bold':!![],'children':_0x4490c1(0x1f5)})}),_0x56ca2b&&a3_0x1a65b8(Box,{'marginTop':0x1,'children':a3_0x484886(Text,{'color':_0x4490c1(0x1df),'children':['✗\x20',_0x56ca2b]})}),a3_0x484886(Box,{'marginTop':0x1,'flexDirection':_0x4490c1(0x1f6),'children':[a3_0x1a65b8(Text,{'bold':!![],'color':_0x4490c1(0x1de),'children':_0x4490c1(0x1f3)}),MCP_IDE_LIST[_0x4490c1(0x1db)]((_0x8269d6,_0xe6b234)=>{const _0x1b8b6c=_0x4490c1,_0x195fee=_0x14fcb9===_0xe6b234,_0x3af134=_0x27b00d['has'](_0xe6b234);return a3_0x1a65b8(Box,{'children':a3_0x484886(Text,{'backgroundColor':_0x195fee?'blue':undefined,'color':_0x195fee?_0x1b8b6c(0x1f0):undefined,'children':[_0x3af134?_0x1b8b6c(0x1d7):'[\x20]','\x20',_0x8269d6===_0x1b8b6c(0x1e9)?'Cursor':_0x1b8b6c(0x1e2)]})},_0x1b8b6c(0x1cd)+_0x8269d6);}),a3_0x1a65b8(Box,{'marginTop':0x1,'children':a3_0x1a65b8(Text,{'bold':!![],'color':_0x4490c1(0x1de),'children':_0x4490c1(0x1ce)})}),SKILL_IDE_LIST[_0x4490c1(0x1db)]((_0x4ff190,_0x55118c)=>{const _0x77a2b9=_0x4490c1,_0x1a1669=_0x55118c+MCP_IDE_LIST['length'],_0x58cef9=_0x14fcb9===_0x1a1669,_0x313964=_0xcdcb2b[_0x77a2b9(0x1ff)](_0x1a1669);return a3_0x1a65b8(Box,{'children':a3_0x484886(Text,{'backgroundColor':_0x58cef9?_0x77a2b9(0x1f2):undefined,'color':_0x58cef9?'white':undefined,'children':[_0x313964?_0x77a2b9(0x1d7):_0x77a2b9(0x1f8),'\x20',SKILL_IDE_CONFIGS[_0x4ff190][_0x77a2b9(0x1da)]]})},'skill-'+_0x4ff190);}),a3_0x1a65b8(Box,{'marginTop':0x1,'children':a3_0x1a65b8(Text,{'color':_0x4490c1(0x1ea),'children':'↑/↓:\x20移动\x20空格:\x20切换\x20a:\x20全选\x20q:\x20退出\x20Enter:\x20确认'})})]})]});if(_0x4efbf7==='installing')return a3_0x1a65b8(Box,{'flexDirection':_0x4490c1(0x1f6),'marginTop':0x1,'children':a3_0x1a65b8(Box,{'children':a3_0x1a65b8(Text,{'children':_0x4490c1(0x1f4)})})});if(_0x4efbf7===_0x4490c1(0x1d6))return null;return null;}const MCP_IDE_CONFIGS={'cursor':{'name':a3_0x5bf43b(0x1e8)},'claude':{'name':a3_0x5bf43b(0x1e2)}};
@@ -1 +1 @@
1
- (function(_0x85f959,_0x567b40){const _0x3e7c71=a4_0x3d96,_0xc10e1e=_0x85f959();while(!![]){try{const _0x281c38=-parseInt(_0x3e7c71(0x11b))/0x1+parseInt(_0x3e7c71(0x14c))/0x2*(-parseInt(_0x3e7c71(0x154))/0x3)+parseInt(_0x3e7c71(0x152))/0x4*(parseInt(_0x3e7c71(0x153))/0x5)+-parseInt(_0x3e7c71(0x106))/0x6*(-parseInt(_0x3e7c71(0x149))/0x7)+parseInt(_0x3e7c71(0x122))/0x8+-parseInt(_0x3e7c71(0x129))/0x9*(parseInt(_0x3e7c71(0x130))/0xa)+parseInt(_0x3e7c71(0x13d))/0xb*(parseInt(_0x3e7c71(0x144))/0xc);if(_0x281c38===_0x567b40)break;else _0xc10e1e['push'](_0xc10e1e['shift']());}catch(_0x451481){_0xc10e1e['push'](_0xc10e1e['shift']());}}}(a4_0x1d6c,0x96650));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';function a4_0x3d96(_0x23e180,_0x5160d7){_0x23e180=_0x23e180-0x105;const _0x1d6c6f=a4_0x1d6c();let _0x3d96c8=_0x1d6c6f[_0x23e180];return _0x3d96c8;}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='lovrabet-dataset',MCP_COMMAND='npx',MCP_ARGS=['@lovrabet/dataset-mcp-server@latest'];export function buildEnvConfig(_0x2d642d,_0x2436d6){const _0x51802a=a4_0x3d96,_0xe17216={'LOVRABET_APP_CODE':String(_0x2d642d)};return _0x2436d6!==_0x51802a(0x126)&&(_0xe17216[_0x51802a(0x11f)]=String(_0x2436d6)),_0xe17216;}export async function configureCursorMcp(_0x2681c2){const _0x1e0508=a4_0x3d96,_0x464c5f=_0x2681c2||process[_0x1e0508(0x107)](),_0x1e5e0e=readConfig(_0x464c5f),_0x5c18de=_0x1e5e0e[_0x1e0508(0x13c)]||_0x1e5e0e[_0x1e0508(0x123)],_0x2aa97b=_0x1e5e0e[_0x1e0508(0x10e)]||_0x1e0508(0x126);if(!_0x5c18de)return{'ide':_0x1e0508(0x14e),'status':_0x1e0508(0x11e),'message':_0x1e0508(0x12f)};const _0x4d873d=buildEnvConfig(_0x5c18de,_0x2aa97b),_0x44cde5={'command':MCP_COMMAND,'args':MCP_ARGS,'env':_0x4d873d},_0x2a5a04=join(_0x464c5f,'.cursor',_0x1e0508(0x110)),_0x3b508e=join(_0x464c5f,_0x1e0508(0x105));try{!existsSync(_0x3b508e)&&mkdirSync(_0x3b508e,{'recursive':!![]});let _0x5baabf={'mcpServers':{}};if(existsSync(_0x2a5a04)){const _0x351f56=readFileSync(_0x2a5a04,'utf-8');_0x5baabf=JSON[_0x1e0508(0x131)](_0x351f56);}return(!_0x5baabf[_0x1e0508(0x12d)]||typeof _0x5baabf[_0x1e0508(0x12d)]!==_0x1e0508(0x118))&&(_0x5baabf['mcpServers']={}),_0x5baabf[_0x1e0508(0x12d)][MCP_SERVER_NAME]=_0x44cde5,writeFileSync(_0x2a5a04,JSON[_0x1e0508(0x128)](_0x5baabf,null,0x2),_0x1e0508(0x13a)),logger[_0x1e0508(0x150)](_0x1e0508(0x146),_0x1e0508(0x112),{'appcode':_0x5c18de,'env':_0x2aa97b,'path':_0x2a5a04}),await copyCursorRules(_0x3b508e),{'ide':_0x1e0508(0x14e),'status':_0x1e0508(0x13e),'message':_0x1e0508(0x124)};}catch(_0x24de17){return logger[_0x1e0508(0x11e)]('mcp-install',_0x1e0508(0x135),{'error':_0x24de17 instanceof Error?_0x24de17[_0x1e0508(0x13f)]:String(_0x24de17)}),{'ide':_0x1e0508(0x14e),'status':'error','message':_0x24de17 instanceof Error?_0x24de17[_0x1e0508(0x13f)]:String(_0x24de17)};}}export async function configureClaudeMcp(_0x29c878){const _0x567232=a4_0x3d96,_0x465f23=_0x29c878||process[_0x567232(0x107)](),_0x14ddb7=readConfig(_0x465f23),_0x350749=_0x14ddb7[_0x567232(0x13c)]||_0x14ddb7[_0x567232(0x123)],_0xffdbd3=_0x14ddb7['env']||_0x567232(0x126);if(!_0x350749)return{'ide':_0x567232(0x116),'status':'error','message':_0x567232(0x12f)};let _0x139fcc='claude\x20mcp\x20add\x20'+MCP_SERVER_NAME+'\x20'+MCP_COMMAND+'\x20'+MCP_ARGS['join']('\x20')+_0x567232(0x140)+_0x350749;return _0xffdbd3!==_0x567232(0x126)&&(_0x139fcc+=_0x567232(0x136)+_0xffdbd3),await copyAgentsMd(_0x465f23),logger[_0x567232(0x150)](_0x567232(0x146),_0x567232(0x145),{'command':_0x139fcc,'appcode':_0x350749,'env':_0xffdbd3}),console[_0x567232(0x12b)](_0x567232(0x11d)),console['log']('\x20\x20'+_0x139fcc+'\x0a'),console[_0x567232(0x12b)]('配置信息:'),console[_0x567232(0x12b)](_0x567232(0x12a)+_0x350749),_0xffdbd3!==_0x567232(0x126)&&console['log']('\x20\x20环境:\x20'+_0xffdbd3),console[_0x567232(0x12b)](_0x567232(0x14a)),{'ide':_0x567232(0x116),'status':'manual','message':_0x567232(0x10a)+_0x139fcc};}export async function showOtherGuide(_0x2f433b){const _0x542af7=a4_0x3d96,_0x3526e1=_0x2f433b||process[_0x542af7(0x107)](),_0x5d8eb3=readConfig(_0x3526e1),_0x3a2b17=_0x5d8eb3[_0x542af7(0x13c)]||_0x5d8eb3[_0x542af7(0x123)],_0x53e3c1=_0x5d8eb3[_0x542af7(0x10e)]||_0x542af7(0x126);if(!_0x3a2b17)return{'ide':'其他','status':'error','message':_0x542af7(0x12f)};return console['log'](_0x542af7(0x10f)),console[_0x542af7(0x12b)]('{'),console[_0x542af7(0x12b)]('\x20\x20\x22mcpServers\x22:\x20{'),console[_0x542af7(0x12b)](_0x542af7(0x10b)+MCP_SERVER_NAME+'\x22:\x20{'),console[_0x542af7(0x12b)](_0x542af7(0x113)+MCP_COMMAND+'\x22,'),console[_0x542af7(0x12b)](_0x542af7(0x109)+MCP_ARGS['map'](_0x446d7d=>'\x22'+_0x446d7d+'\x22')[_0x542af7(0x12e)](',\x20')+'],'),console['log']('\x20\x20\x20\x20\x20\x20\x22env\x22:\x20{'),console['log'](_0x542af7(0x132)+_0x3a2b17+'\x22,'),_0x53e3c1!=='online'&&console[_0x542af7(0x12b)](_0x542af7(0x142)+_0x53e3c1+'\x22,'),console[_0x542af7(0x12b)](_0x542af7(0x10c)),console['log']('\x20\x20\x20\x20}'),console[_0x542af7(0x12b)](_0x542af7(0x117)),console['log']('}\x0a'),logger[_0x542af7(0x150)](_0x542af7(0x146),_0x542af7(0x147),{'appcode':_0x3a2b17,'env':_0x53e3c1}),{'ide':'其他','status':_0x542af7(0x11a),'message':_0x542af7(0x11c)};}export async function configureMcp(_0x2e279f,_0x1f27e1){const _0x29eddd=a4_0x3d96;switch(_0x2e279f){case _0x29eddd(0x143):return await configureCursorMcp(_0x1f27e1);case _0x29eddd(0x151):return await configureClaudeMcp(_0x1f27e1);default:throw new Error(_0x29eddd(0x120)+_0x2e279f);}}async function copyCursorRules(_0x10cdd0){const _0x12afce=a4_0x3d96,_0x5134ad=join(_0x10cdd0,_0x12afce(0x139)),_0x589769=join(_0x5134ad,_0x12afce(0x14f));if(existsSync(_0x589769))return;try{!existsSync(_0x5134ad)&&mkdirSync(_0x5134ad,{'recursive':!![]});const _0x27f4d2=await getRulesContent();writeFileSync(_0x589769,_0x27f4d2,'utf-8'),logger[_0x12afce(0x150)]('mcp-install','创建\x20Cursor\x20Rules\x20文件',{'to':_0x589769});}catch(_0x39d8e5){logger[_0x12afce(0x11e)](_0x12afce(0x146),_0x12afce(0x115),{'error':_0x39d8e5 instanceof Error?_0x39d8e5[_0x12afce(0x13f)]:String(_0x39d8e5)});}}async function copyAgentsMd(_0x49df4f){const _0x20e10b=a4_0x3d96,_0x43e6bb=join(_0x49df4f,'agents.md');if(existsSync(_0x43e6bb))return;try{const _0x197382=await getRulesContent();writeFileSync(_0x43e6bb,_0x197382,_0x20e10b(0x13a)),logger[_0x20e10b(0x150)](_0x20e10b(0x146),_0x20e10b(0x133),{'to':_0x43e6bb});}catch(_0x54505c){logger[_0x20e10b(0x11e)](_0x20e10b(0x146),_0x20e10b(0x108),{'error':_0x54505c instanceof Error?_0x54505c[_0x20e10b(0x13f)]:String(_0x54505c)});}}export const SKILL_IDE_CONFIGS=IDE_CONFIGS;function a4_0x1d6c(){const _0x193ab9=['log','已创建\x20','mcpServers','join','需要先配置\x20appcode','128930yaEbdL','parse','\x20\x20\x20\x20\x20\x20\x20\x20\x22LOVRABET_APP_CODE\x22:\x20\x22','创建\x20agents.md\x20文件','.shared','Cursor\x20MCP\x20配置失败','\x20-e\x20LOVRABET_ENV=','toISOString','skill-install','rules','utf-8','2.0.0','appcode','1947jxrhCT','success','message','\x20-e\x20LOVRABET_APP_CODE=','共享技能文件复制失败','\x20\x20\x20\x20\x20\x20\x20\x20\x22LOVRABET_ENV\x22:\x20\x22','cursor','103536jrgkIy','Claude\x20Code\x20MCP\x20命令已生成','mcp-install','其他\x20IDE\x20配置指引已显示','isDirectory','7rtIdun','\x20\x20重启\x20Claude\x20Code\x20后生效\x0a','name','1624084wUpzDa','共享技能文件复制成功','Cursor','lovrabet_rules.mdc','info','claude','368KtCJxs','12490nliMJe','3ZrzCTm','.cursor','7012074hnwihh','cwd','复制\x20agents.md\x20文件失败','\x20\x20\x20\x20\x20\x20\x22args\x22:\x20[','请手动执行:\x20','\x20\x20\x20\x20\x22','\x20\x20\x20\x20\x20\x20}','\x20技能包安装失败','env','\x0a📋\x20其他\x20IDE\x20MCP\x20配置:\x0a','mcp.json','创建技能包\x20manifest','Cursor\x20MCP\x20配置成功','\x20\x20\x20\x20\x20\x20\x22command\x22:\x20\x22','\x20技能包安装成功','复制\x20Cursor\x20Rules\x20文件失败','Claude\x20Code','\x20\x20}','object','.lovrabet/skill-manifest.json','manual','884479caZeHb','配置指引已显示','\x0a📋\x20请执行以下命令配置\x20Claude\x20Code\x20MCP:\x0a','error','LOVRABET_ENV','不支持的\x20MCP\x20IDE:\x20','未知的\x20IDE:\x20','3037176UTxjMn','app','已写入\x20.cursor/mcp.json','.lovrabet','online','node:fs','stringify','693QeSdfe','\x20\x20AppCode:\x20'];a4_0x1d6c=function(){return _0x193ab9;};return a4_0x1d6c();}export async function installSkill(_0x2012df,_0x220649){const _0x5bf74d=a4_0x3d96,_0x5bae7c=_0x220649||process['cwd'](),_0x5ceda=resolve(__dirname,'../../cdn-source/skills'),_0x100054=SKILL_IDE_CONFIGS[_0x2012df];if(!_0x100054)return{'ide':_0x2012df,'status':_0x5bf74d(0x11e),'message':_0x5bf74d(0x121)+_0x2012df};const _0x4a3d9d=_0x100054[_0x5bf74d(0x14b)];try{let _0x445a56;try{_0x445a56=await fetchGuidesFromCDN();}catch{}const _0x3ff176=await installSingleIDE(_0x2012df,_0x100054,_0x5bae7c,_0x5ceda,_0x445a56);return _0x445a56&&writeGuidesToProject(_0x445a56,_0x5bae7c),logger[_0x5bf74d(0x150)](_0x5bf74d(0x138),_0x4a3d9d+_0x5bf74d(0x114),{'ide':_0x2012df,'filesCount':_0x3ff176}),{'ide':_0x4a3d9d,'status':_0x5bf74d(0x13e),'message':_0x5bf74d(0x12c)+_0x3ff176+'\x20项'};}catch(_0x705eb9){return logger[_0x5bf74d(0x11e)]('skill-install',_0x4a3d9d+_0x5bf74d(0x10d),{'error':_0x705eb9 instanceof Error?_0x705eb9[_0x5bf74d(0x13f)]:String(_0x705eb9)}),{'ide':_0x4a3d9d,'status':_0x5bf74d(0x11e),'message':_0x705eb9 instanceof Error?_0x705eb9[_0x5bf74d(0x13f)]:String(_0x705eb9)};}}async function copyDir(_0x227b2d,_0x4813aa){const _0x326100=a4_0x3d96,{statSync:_0x52a098}=await import(_0x326100(0x127)),{readdirSync:_0x52c823}=await import(_0x326100(0x127)),_0x353b95=_0x52a098(_0x227b2d);if(_0x353b95[_0x326100(0x148)]()){!existsSync(_0x4813aa)&&mkdirSync(_0x4813aa,{'recursive':!![]});const _0x43c291=_0x52c823(_0x227b2d);for(const _0x47e818 of _0x43c291){await copyDir(join(_0x227b2d,_0x47e818),join(_0x4813aa,_0x47e818));}}else copyFileSync(_0x227b2d,_0x4813aa);}export async function copySharedSkills(_0x1055ce){const _0x5909c5=a4_0x3d96,_0x4af2a5=_0x1055ce||process[_0x5909c5(0x107)](),_0x398c6e=resolve(__dirname,'../../cdn-source/skills'),_0x47910f=join(_0x398c6e,_0x5909c5(0x134)),_0x554229=join(_0x4af2a5,'.lovrabet/skill/.shared');if(!existsSync(_0x47910f))return![];try{return await copyDir(_0x47910f,_0x554229),logger['info'](_0x5909c5(0x138),_0x5909c5(0x14d),{'path':_0x554229}),!![];}catch(_0x4c3d3d){return logger[_0x5909c5(0x11e)](_0x5909c5(0x138),_0x5909c5(0x141),{'error':_0x4c3d3d instanceof Error?_0x4c3d3d[_0x5909c5(0x13f)]:String(_0x4c3d3d)}),![];}}export function createSkillManifest(_0xf27d79,_0x7de7c3){const _0x18af56=a4_0x3d96,_0x55b40a={'version':_0x18af56(0x13b),'installedAt':new Date()[_0x18af56(0x137)](),'platforms':_0x7de7c3},_0x37d028=join(_0xf27d79,_0x18af56(0x119)),_0x4ebde6=join(_0xf27d79,_0x18af56(0x125));!existsSync(_0x4ebde6)&&mkdirSync(_0x4ebde6,{'recursive':!![]}),writeFileSync(_0x37d028,JSON[_0x18af56(0x128)](_0x55b40a,null,0x2),_0x18af56(0x13a)),logger['info']('skill-install',_0x18af56(0x111),{'path':_0x37d028});}
1
+ const a4_0x25f543=a4_0x1ce2;(function(_0x5210fa,_0x1dc29b){const _0x268b27=a4_0x1ce2,_0x410ef8=_0x5210fa();while(!![]){try{const _0xcbc789=parseInt(_0x268b27(0x1ca))/0x1+parseInt(_0x268b27(0x1da))/0x2+-parseInt(_0x268b27(0x1d5))/0x3*(parseInt(_0x268b27(0x1c1))/0x4)+-parseInt(_0x268b27(0x1b5))/0x5+-parseInt(_0x268b27(0x1b7))/0x6*(parseInt(_0x268b27(0x1b1))/0x7)+-parseInt(_0x268b27(0x1d0))/0x8*(-parseInt(_0x268b27(0x1e1))/0x9)+-parseInt(_0x268b27(0x1ae))/0xa*(-parseInt(_0x268b27(0x1c8))/0xb);if(_0xcbc789===_0x1dc29b)break;else _0x410ef8['push'](_0x410ef8['shift']());}catch(_0x55c4fc){_0x410ef8['push'](_0x410ef8['shift']());}}}(a4_0x572b,0xe2ad2));import{existsSync,mkdirSync,writeFileSync,readFileSync,copyFileSync}from'node:fs';function a4_0x1ce2(_0x11c703,_0x151349){_0x11c703=_0x11c703-0x194;const _0x572b8a=a4_0x572b();let _0x1ce217=_0x572b8a[_0x11c703];return _0x1ce217;}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_0x25f543(0x1e3),MCP_COMMAND='npx',MCP_ARGS=[a4_0x25f543(0x1a3)];export function buildEnvConfig(_0x1b8bdd,_0x14e219){const _0x5b968d=a4_0x25f543,_0x4c6836={'LOVRABET_APP_CODE':String(_0x1b8bdd)};return _0x14e219!==_0x5b968d(0x1af)&&(_0x4c6836[_0x5b968d(0x1be)]=String(_0x14e219)),_0x4c6836;}export async function configureCursorMcp(_0x310458){const _0x22536e=a4_0x25f543,_0x41a8b9=_0x310458||process[_0x22536e(0x1ce)](),_0xe44deb=readConfig(_0x41a8b9),_0x5738db=_0xe44deb[_0x22536e(0x1bf)]||_0xe44deb[_0x22536e(0x1d6)],_0xf04103=_0xe44deb[_0x22536e(0x1c4)]||_0x22536e(0x1af);if(!_0x5738db)return{'ide':_0x22536e(0x1db),'status':_0x22536e(0x1e7),'message':'需要先配置\x20appcode'};const _0x53a147=buildEnvConfig(_0x5738db,_0xf04103),_0x29f226={'command':MCP_COMMAND,'args':MCP_ARGS,'env':_0x53a147},_0x53944c=join(_0x41a8b9,_0x22536e(0x1b2),_0x22536e(0x1d4)),_0x12f2ec=join(_0x41a8b9,'.cursor');try{!existsSync(_0x12f2ec)&&mkdirSync(_0x12f2ec,{'recursive':!![]});let _0x35c865={'mcpServers':{}};if(existsSync(_0x53944c)){const _0x57cd39=readFileSync(_0x53944c,'utf-8');_0x35c865=JSON[_0x22536e(0x1c5)](_0x57cd39);}return(!_0x35c865[_0x22536e(0x1a1)]||typeof _0x35c865[_0x22536e(0x1a1)]!==_0x22536e(0x1ba))&&(_0x35c865[_0x22536e(0x1a1)]={}),_0x35c865['mcpServers'][MCP_SERVER_NAME]=_0x29f226,writeFileSync(_0x53944c,JSON[_0x22536e(0x1a8)](_0x35c865,null,0x2),_0x22536e(0x1b0)),logger['info'](_0x22536e(0x1c3),_0x22536e(0x1c6),{'appcode':_0x5738db,'env':_0xf04103,'path':_0x53944c}),await copyCursorRules(_0x12f2ec),{'ide':'Cursor','status':_0x22536e(0x1cc),'message':_0x22536e(0x197)};}catch(_0x2b6dd7){return logger[_0x22536e(0x1e7)](_0x22536e(0x1c3),_0x22536e(0x194),{'error':_0x2b6dd7 instanceof Error?_0x2b6dd7['message']:String(_0x2b6dd7)}),{'ide':_0x22536e(0x1db),'status':_0x22536e(0x1e7),'message':_0x2b6dd7 instanceof Error?_0x2b6dd7[_0x22536e(0x1a9)]:String(_0x2b6dd7)};}}function a4_0x572b(){const _0x175ee6=['mcp-install','env','parse','Cursor\x20MCP\x20配置成功','\x20\x20\x20\x20\x20\x20\x22env\x22:\x20{','46150049BbZOoR','Claude\x20Code\x20MCP\x20命令已生成','6721hJGcoN','\x20\x20\x20\x20\x20\x20}','success','请手动执行:\x20','cwd','不支持的\x20MCP\x20IDE:\x20','791064AMxlSM','创建\x20agents.md\x20文件','\x20\x20环境:\x20','2.0.0','mcp.json','2767707cAmVyP','app','\x0a📋\x20请执行以下命令配置\x20Claude\x20Code\x20MCP:\x0a','Claude\x20Code','\x20\x20\x20\x20\x20\x20\x22command\x22:\x20\x22','1044618ZYijko','Cursor','\x20\x20AppCode:\x20','isDirectory','skill-install','复制\x20agents.md\x20文件失败','cursor','9tCfDeG','\x0a📋\x20其他\x20IDE\x20MCP\x20配置:\x0a','lovrabet-dataset','配置指引已显示','.lovrabet','\x20-e\x20LOVRABET_ENV=','error','Cursor\x20MCP\x20配置失败','\x20\x20\x20\x20\x22','.shared','已写入\x20.cursor/mcp.json','共享技能文件复制失败','\x20\x20重启\x20Claude\x20Code\x20后生效\x0a','claude','rules','toISOString','创建技能包\x20manifest','\x20\x20\x20\x20\x20\x20\x20\x20\x22LOVRABET_APP_CODE\x22:\x20\x22','../../cdn-source/skills','map','mcpServers','其他\x20IDE\x20配置指引已显示','@lovrabet/dataset-mcp-server@latest','manual','.lovrabet/skill-manifest.json','log','\x20技能包安装成功','stringify','message','已创建\x20','lovrabet_rules.mdc','\x20\x20\x20\x20}','\x20\x20\x22mcpServers\x22:\x20{','10HuNcKl','online','utf-8','200599KVEuSZ','.cursor','join','需要先配置\x20appcode','4087585oBDQgE','未知的\x20IDE:\x20','258TZUBnH','配置信息:','.lovrabet/skill/.shared','object','info','\x22:\x20{','\x20\x20\x20\x20\x20\x20\x22args\x22:\x20[','LOVRABET_ENV','appcode','node:fs','8zqYAPY','claude\x20mcp\x20add\x20'];a4_0x572b=function(){return _0x175ee6;};return a4_0x572b();}export async function configureClaudeMcp(_0x285a89){const _0x162dc3=a4_0x25f543,_0x57c671=_0x285a89||process[_0x162dc3(0x1ce)](),_0x293ce1=readConfig(_0x57c671),_0x31ccaf=_0x293ce1['appcode']||_0x293ce1[_0x162dc3(0x1d6)],_0x59113d=_0x293ce1[_0x162dc3(0x1c4)]||_0x162dc3(0x1af);if(!_0x31ccaf)return{'ide':_0x162dc3(0x1d8),'status':'error','message':_0x162dc3(0x1b4)};let _0x5beb39=_0x162dc3(0x1c2)+MCP_SERVER_NAME+'\x20'+MCP_COMMAND+'\x20'+MCP_ARGS[_0x162dc3(0x1b3)]('\x20')+'\x20-e\x20LOVRABET_APP_CODE='+_0x31ccaf;return _0x59113d!==_0x162dc3(0x1af)&&(_0x5beb39+=_0x162dc3(0x1e6)+_0x59113d),await copyAgentsMd(_0x57c671),logger['info']('mcp-install',_0x162dc3(0x1c9),{'command':_0x5beb39,'appcode':_0x31ccaf,'env':_0x59113d}),console[_0x162dc3(0x1a6)](_0x162dc3(0x1d7)),console[_0x162dc3(0x1a6)]('\x20\x20'+_0x5beb39+'\x0a'),console[_0x162dc3(0x1a6)](_0x162dc3(0x1b8)),console[_0x162dc3(0x1a6)](_0x162dc3(0x1dc)+_0x31ccaf),_0x59113d!==_0x162dc3(0x1af)&&console[_0x162dc3(0x1a6)](_0x162dc3(0x1d2)+_0x59113d),console['log'](_0x162dc3(0x199)),{'ide':'Claude\x20Code','status':'manual','message':_0x162dc3(0x1cd)+_0x5beb39};}export async function showOtherGuide(_0x227b6a){const _0x3f8ffa=a4_0x25f543,_0x5c0340=_0x227b6a||process[_0x3f8ffa(0x1ce)](),_0x32ce7d=readConfig(_0x5c0340),_0xec3636=_0x32ce7d['appcode']||_0x32ce7d[_0x3f8ffa(0x1d6)],_0x35f8d3=_0x32ce7d['env']||_0x3f8ffa(0x1af);if(!_0xec3636)return{'ide':'其他','status':_0x3f8ffa(0x1e7),'message':_0x3f8ffa(0x1b4)};return console[_0x3f8ffa(0x1a6)](_0x3f8ffa(0x1e2)),console[_0x3f8ffa(0x1a6)]('{'),console[_0x3f8ffa(0x1a6)](_0x3f8ffa(0x1ad)),console[_0x3f8ffa(0x1a6)](_0x3f8ffa(0x195)+MCP_SERVER_NAME+_0x3f8ffa(0x1bc)),console[_0x3f8ffa(0x1a6)](_0x3f8ffa(0x1d9)+MCP_COMMAND+'\x22,'),console[_0x3f8ffa(0x1a6)](_0x3f8ffa(0x1bd)+MCP_ARGS[_0x3f8ffa(0x1a0)](_0x4ea3b4=>'\x22'+_0x4ea3b4+'\x22')[_0x3f8ffa(0x1b3)](',\x20')+'],'),console[_0x3f8ffa(0x1a6)](_0x3f8ffa(0x1c7)),console[_0x3f8ffa(0x1a6)](_0x3f8ffa(0x19e)+_0xec3636+'\x22,'),_0x35f8d3!==_0x3f8ffa(0x1af)&&console['log']('\x20\x20\x20\x20\x20\x20\x20\x20\x22LOVRABET_ENV\x22:\x20\x22'+_0x35f8d3+'\x22,'),console[_0x3f8ffa(0x1a6)](_0x3f8ffa(0x1cb)),console[_0x3f8ffa(0x1a6)](_0x3f8ffa(0x1ac)),console[_0x3f8ffa(0x1a6)]('\x20\x20}'),console['log']('}\x0a'),logger['info'](_0x3f8ffa(0x1c3),_0x3f8ffa(0x1a2),{'appcode':_0xec3636,'env':_0x35f8d3}),{'ide':'其他','status':_0x3f8ffa(0x1a4),'message':_0x3f8ffa(0x1e4)};}export async function configureMcp(_0x3c473a,_0x25b0cc){const _0xac92fb=a4_0x25f543;switch(_0x3c473a){case _0xac92fb(0x1e0):return await configureCursorMcp(_0x25b0cc);case _0xac92fb(0x19a):return await configureClaudeMcp(_0x25b0cc);default:throw new Error(_0xac92fb(0x1cf)+_0x3c473a);}}async function copyCursorRules(_0x370cea){const _0x4a9ce4=a4_0x25f543,_0x12e66e=join(_0x370cea,_0x4a9ce4(0x19b)),_0x2ac769=join(_0x12e66e,_0x4a9ce4(0x1ab));if(existsSync(_0x2ac769))return;try{!existsSync(_0x12e66e)&&mkdirSync(_0x12e66e,{'recursive':!![]});const _0x5bd02e=await getRulesContent();writeFileSync(_0x2ac769,_0x5bd02e,_0x4a9ce4(0x1b0)),logger[_0x4a9ce4(0x1bb)](_0x4a9ce4(0x1c3),'创建\x20Cursor\x20Rules\x20文件',{'to':_0x2ac769});}catch(_0x8f33c1){logger[_0x4a9ce4(0x1e7)]('mcp-install','复制\x20Cursor\x20Rules\x20文件失败',{'error':_0x8f33c1 instanceof Error?_0x8f33c1[_0x4a9ce4(0x1a9)]:String(_0x8f33c1)});}}async function copyAgentsMd(_0x644ef2){const _0x2887d4=a4_0x25f543,_0x26ac8d=join(_0x644ef2,'agents.md');if(existsSync(_0x26ac8d))return;try{const _0x3bb695=await getRulesContent();writeFileSync(_0x26ac8d,_0x3bb695,_0x2887d4(0x1b0)),logger[_0x2887d4(0x1bb)]('mcp-install',_0x2887d4(0x1d1),{'to':_0x26ac8d});}catch(_0x3b00f3){logger[_0x2887d4(0x1e7)](_0x2887d4(0x1c3),_0x2887d4(0x1df),{'error':_0x3b00f3 instanceof Error?_0x3b00f3[_0x2887d4(0x1a9)]:String(_0x3b00f3)});}}export const SKILL_IDE_CONFIGS=IDE_CONFIGS;export async function installSkill(_0x719cd4,_0x28b576){const _0x263fb4=a4_0x25f543,_0xfe9fb4=_0x28b576||process[_0x263fb4(0x1ce)](),_0x2631dc=resolve(__dirname,'../../cdn-source/skills'),_0x2e27a7=SKILL_IDE_CONFIGS[_0x719cd4];if(!_0x2e27a7)return{'ide':_0x719cd4,'status':_0x263fb4(0x1e7),'message':_0x263fb4(0x1b6)+_0x719cd4};const _0x4b5afd=_0x2e27a7['name'];try{let _0x48a13e;try{_0x48a13e=await fetchGuidesFromCDN();}catch{}const _0x3ea852=await installSingleIDE(_0x719cd4,_0x2e27a7,_0xfe9fb4,_0x2631dc,_0x48a13e);return _0x48a13e&&writeGuidesToProject(_0x48a13e,_0xfe9fb4),logger[_0x263fb4(0x1bb)](_0x263fb4(0x1de),_0x4b5afd+_0x263fb4(0x1a7),{'ide':_0x719cd4,'filesCount':_0x3ea852}),{'ide':_0x4b5afd,'status':_0x263fb4(0x1cc),'message':_0x263fb4(0x1aa)+_0x3ea852+'\x20项'};}catch(_0x429de8){return logger[_0x263fb4(0x1e7)](_0x263fb4(0x1de),_0x4b5afd+'\x20技能包安装失败',{'error':_0x429de8 instanceof Error?_0x429de8[_0x263fb4(0x1a9)]:String(_0x429de8)}),{'ide':_0x4b5afd,'status':'error','message':_0x429de8 instanceof Error?_0x429de8[_0x263fb4(0x1a9)]:String(_0x429de8)};}}async function copyDir(_0x3196a3,_0x1f48f2){const _0x3bff19=a4_0x25f543,{statSync:_0x120fe6}=await import(_0x3bff19(0x1c0)),{readdirSync:_0x26f18b}=await import(_0x3bff19(0x1c0)),_0x947b8c=_0x120fe6(_0x3196a3);if(_0x947b8c[_0x3bff19(0x1dd)]()){!existsSync(_0x1f48f2)&&mkdirSync(_0x1f48f2,{'recursive':!![]});const _0x2b3967=_0x26f18b(_0x3196a3);for(const _0x2739a4 of _0x2b3967){await copyDir(join(_0x3196a3,_0x2739a4),join(_0x1f48f2,_0x2739a4));}}else copyFileSync(_0x3196a3,_0x1f48f2);}export async function copySharedSkills(_0x45d2e7){const _0x591ccd=a4_0x25f543,_0x22b2c9=_0x45d2e7||process[_0x591ccd(0x1ce)](),_0x36c53c=resolve(__dirname,_0x591ccd(0x19f)),_0x3b836e=join(_0x36c53c,_0x591ccd(0x196)),_0x1d5879=join(_0x22b2c9,_0x591ccd(0x1b9));if(!existsSync(_0x3b836e))return![];try{return await copyDir(_0x3b836e,_0x1d5879),logger[_0x591ccd(0x1bb)](_0x591ccd(0x1de),'共享技能文件复制成功',{'path':_0x1d5879}),!![];}catch(_0xf9aff4){return logger[_0x591ccd(0x1e7)](_0x591ccd(0x1de),_0x591ccd(0x198),{'error':_0xf9aff4 instanceof Error?_0xf9aff4[_0x591ccd(0x1a9)]:String(_0xf9aff4)}),![];}}export function createSkillManifest(_0x2bb0e9,_0x7197b0){const _0x4a5282=a4_0x25f543,_0x3d9ccd={'version':_0x4a5282(0x1d3),'installedAt':new Date()[_0x4a5282(0x19c)](),'platforms':_0x7197b0},_0x9c0097=join(_0x2bb0e9,_0x4a5282(0x1a5)),_0x11b3f4=join(_0x2bb0e9,_0x4a5282(0x1e5));!existsSync(_0x11b3f4)&&mkdirSync(_0x11b3f4,{'recursive':!![]}),writeFileSync(_0x9c0097,JSON['stringify'](_0x3d9ccd,null,0x2),_0x4a5282(0x1b0)),logger[_0x4a5282(0x1bb)]('skill-install',_0x4a5282(0x19d),{'path':_0x9c0097});}
@@ -1 +1 @@
1
- (function(_0x2c2426,_0x5884a1){const _0x5ac6d0=a5_0x49f7,_0x4e49fe=_0x2c2426();while(!![]){try{const _0x2578e3=parseInt(_0x5ac6d0(0x1cc))/0x1+parseInt(_0x5ac6d0(0x1d4))/0x2+-parseInt(_0x5ac6d0(0x1df))/0x3+parseInt(_0x5ac6d0(0x1bc))/0x4+parseInt(_0x5ac6d0(0x1d1))/0x5*(-parseInt(_0x5ac6d0(0x1ca))/0x6)+-parseInt(_0x5ac6d0(0x1d5))/0x7*(parseInt(_0x5ac6d0(0x1c4))/0x8)+parseInt(_0x5ac6d0(0x1c2))/0x9;if(_0x2578e3===_0x5884a1)break;else _0x4e49fe['push'](_0x4e49fe['shift']());}catch(_0x5ba057){_0x4e49fe['push'](_0x4e49fe['shift']());}}}(a5_0x3e27,0x41636));import{jsx as a5_0x24d284,jsxs as a5_0x3f9883,Fragment as a5_0x3d5930}from'react/jsx-runtime';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';import{initEnv}from'../constant/env.js';import{fetchModelList}from'./fetch-model-list.js';function a5_0x49f7(_0x514486,_0x5604c9){_0x514486=_0x514486-0x1ae;const _0x3e271d=a5_0x3e27();let _0x49f7d0=_0x3e271d[_0x514486];return _0x49f7d0;}import{generateDatasetDocs}from'./api-doc.js';import{logger}from'../utils/logger.js';export const ApiDocUI=({appCode:_0xef4647,env:_0x500b76,output:_0x55ddb0,extraParams:_0x3368c4,datasetCodes:_0x3641ce})=>{const _0x1c9418=a5_0x49f7,{exit:_0x2a45bc}=useApp(),[_0x306c36,_0x4e7408]=useState(![]),[_0x42f230,_0x1f7334]=useState(''),[_0x5b1b85,_0x2ed9e9]=useState(![]),[_0x1d4e1f,_0x32ae2d]=useState(null),[_0x4b8c75,_0x1f3614]=useState(null),[_0x2a8719,_0x2e1fba]=useState(0x0),_0x3045cb=readConfig(),_0x3e0a38=getConfigAppCode(),_0x42936d=_0xef4647||_0x3e0a38,_0xee4049=typeof _0x3045cb?.[_0x1c9418(0x1c0)]==='string'?_0x3045cb[_0x1c9418(0x1c0)]:undefined,_0x1b5672=_0x500b76||_0xee4049||'online';initEnv(_0x1b5672);const _0x56d20b=_0x55ddb0||_0x1c9418(0x1d2),_0x2b1954=_0xef4647?_0x1c9418(0x1cd)+_0x42936d:_0x1c9418(0x1bb)+_0x42936d;useEffect(()=>{_0x4e7408(!![]),_0x1f6466();},[]),useEffect(()=>{(_0x5b1b85||_0x1d4e1f)&&_0x2a45bc();},[_0x5b1b85,_0x1d4e1f,_0x2a45bc]);async function _0x1f6466(){const _0x4deb9d=_0x1c9418;if(!_0x42936d){_0x32ae2d(_0x4deb9d(0x1ce));return;}try{logger[_0x4deb9d(0x1c3)](process[_0x4deb9d(0x1c5)]()),_0x1f7334(_0x4deb9d(0x1de));const {configArray:_0x2534a8}=await fetchModelList(_0x42936d);_0x2e1fba(_0x2534a8['length']);if(_0x2534a8['length']===0x0){_0x32ae2d(_0x4deb9d(0x1e5));return;}let _0x5e922a=_0x2534a8;if(_0x3641ce&&_0x3641ce[_0x4deb9d(0x1d9)]>0x0){_0x5e922a=_0x2534a8[_0x4deb9d(0x1d8)](_0x37fd2f=>_0x3641ce[_0x4deb9d(0x1b3)](_0x37fd2f[_0x4deb9d(0x1c6)]));const _0x3d9f20=_0x5e922a['map'](_0x1ed749=>_0x1ed749[_0x4deb9d(0x1c6)]),_0x58402f=_0x3641ce[_0x4deb9d(0x1d8)](_0x4c41cd=>!_0x3d9f20[_0x4deb9d(0x1b3)](_0x4c41cd));_0x58402f[_0x4deb9d(0x1d9)]>0x0&&console[_0x4deb9d(0x1dc)](_0x4deb9d(0x1b2)+_0x58402f[_0x4deb9d(0x1e4)](',\x20')+_0x4deb9d(0x1bf));if(_0x5e922a[_0x4deb9d(0x1d9)]===0x0){_0x32ae2d(_0x4deb9d(0x1e6)+_0x3641ce['join'](',\x20'));return;}console[_0x4deb9d(0x1dc)](_0x4deb9d(0x1ae)+_0x2534a8[_0x4deb9d(0x1d9)]+_0x4deb9d(0x1b0)+_0x5e922a[_0x4deb9d(0x1d9)]+'\x20个匹配的数据集\x1b[0m');}_0x1f7334(_0x4deb9d(0x1e1)+_0x5e922a[_0x4deb9d(0x1d9)]+_0x4deb9d(0x1db));const _0x2f104b=await generateDatasetDocs(_0x5e922a,_0x42936d,_0x56d20b,(_0x3e5e2d,_0x3855e5,_0x21fc1b)=>{const _0x1129e7=_0x4deb9d;_0x1f7334(_0x1129e7(0x1e1)+_0x21fc1b+_0x1129e7(0x1b9)+_0x3e5e2d+'/'+_0x3855e5+')');},_0x3368c4);_0x1f3614(_0x2f104b),_0x2ed9e9(!![]);const _0x5d18ac=_0x2f104b[_0x4deb9d(0x1d8)](_0x38646c=>_0x38646c[_0x4deb9d(0x1b8)])['length'],_0x55effe=_0x2f104b[_0x4deb9d(0x1d8)](_0x1178f1=>!_0x1178f1['success'])[_0x4deb9d(0x1d9)];logger['success'](_0x4deb9d(0x1bd),_0x4deb9d(0x1d7),undefined,{'totalCount':_0x2f104b[_0x4deb9d(0x1d9)],'successCount':_0x5d18ac,'failCount':_0x55effe,'outputDir':_0x56d20b});}catch(_0x24bb83){const _0x2c970a=_0x24bb83 instanceof Error?_0x24bb83['message']:String(_0x24bb83);logger[_0x4deb9d(0x1b6)](_0x4deb9d(0x1bd),'文档生成失败:\x20'+_0x2c970a,{'appCode':_0x42936d,'outputDir':_0x56d20b}),_0x32ae2d('文档生成失败:\x20'+_0x2c970a);}finally{_0x4e7408(![]);}}const _0x165dd0=_0x4b8c75?.[_0x1c9418(0x1d8)](_0x4c58eb=>_0x4c58eb[_0x1c9418(0x1b8)])[_0x1c9418(0x1d9)]||0x0,_0x3612c5=_0x4b8c75?.[_0x1c9418(0x1d8)](_0xd199cd=>!_0xd199cd['success'])[_0x1c9418(0x1d9)]||0x0;return a5_0x3f9883(Box,{'flexDirection':_0x1c9418(0x1c7),'children':[(_0x306c36||_0x5b1b85)&&a5_0x3f9883(Box,{'children':[a5_0x24d284(Text,{'color':_0x1c9418(0x1af),'children':'*\x20'}),a5_0x24d284(Text,{'color':_0xef4647?_0x1c9418(0x1d3):_0x1c9418(0x1b5),'children':_0x2b1954})]}),_0x306c36&&a5_0x24d284(Box,{'children':a5_0x3f9883(Text,{'children':[_0x1c9418(0x1dd),_0x42f230,_0x1c9418(0x1c9),_0x1b5672,')']})}),_0x5b1b85&&_0x4b8c75&&a5_0x3f9883(Box,{'flexDirection':'column','children':[a5_0x24d284(Box,{'children':a5_0x3f9883(Text,{'color':_0x1c9418(0x1be),'children':[_0x1c9418(0x1b1),_0x165dd0,'\x20个',_0x3612c5>0x0&&_0x1c9418(0x1b7)+_0x3612c5+'\x20个']})}),a5_0x24d284(Box,{'marginTop':0x1,'children':a5_0x3f9883(Text,{'color':_0x1c9418(0x1af),'children':['*\x20共处理\x20',_0x2a8719,_0x1c9418(0x1e3)]})}),a5_0x3f9883(Box,{'marginTop':0x1,'children':[a5_0x24d284(Text,{'color':_0x1c9418(0x1af),'children':'*\x20输出目录:\x20'}),a5_0x24d284(Text,{'color':'cyan','children':_0x56d20b})]}),_0x165dd0>0x0&&a5_0x3f9883(a5_0x3d5930,{'children':[a5_0x24d284(Box,{'marginTop':0x1,'children':a5_0x24d284(Text,{'color':'gray','children':_0x1c9418(0x1cb)})}),_0x4b8c75[_0x1c9418(0x1d8)](_0x34aa5a=>_0x34aa5a['success'])[_0x1c9418(0x1d6)]((_0x2381e7,_0x29d6a6)=>a5_0x3f9883(Box,{'marginLeft':0x2,'children':[a5_0x3f9883(Text,{'color':_0x1c9418(0x1e0),'children':['•\x20',_0x2381e7['filePath']]}),a5_0x3f9883(Text,{'color':_0x1c9418(0x1b5),'children':[_0x1c9418(0x1d0),_0x2381e7[_0x1c9418(0x1c8)]]})]},_0x29d6a6))]}),_0x3612c5>0x0&&a5_0x3f9883(a5_0x3d5930,{'children':[a5_0x24d284(Box,{'marginTop':0x1,'children':a5_0x24d284(Text,{'color':'yellow','children':_0x1c9418(0x1ba)})}),_0x4b8c75[_0x1c9418(0x1d8)](_0x414ebe=>!_0x414ebe[_0x1c9418(0x1b8)])['map']((_0x1ed69c,_0x551973)=>a5_0x3f9883(Box,{'marginLeft':0x2,'flexDirection':_0x1c9418(0x1c7),'children':[a5_0x3f9883(Text,{'color':_0x1c9418(0x1c1),'children':['•\x20',_0x1ed69c[_0x1c9418(0x1c8)],'\x20(',_0x1ed69c[_0x1c9418(0x1c6)],')']}),_0x1ed69c['error']&&a5_0x24d284(Box,{'marginLeft':0x2,'children':a5_0x24d284(Text,{'color':_0x1c9418(0x1b5),'children':_0x1ed69c[_0x1c9418(0x1b6)]})})]},_0x551973))]})]}),_0x1d4e1f&&a5_0x3f9883(Box,{'flexDirection':_0x1c9418(0x1c7),'children':[a5_0x24d284(Box,{'children':a5_0x3f9883(Text,{'color':_0x1c9418(0x1c1),'children':['❌\x20',_0x1d4e1f]})}),_0x1d4e1f[_0x1c9418(0x1b3)]('登录')&&a5_0x3f9883(Box,{'marginTop':0x1,'children':[a5_0x24d284(Text,{'color':_0x1c9418(0x1e2),'children':_0x1c9418(0x1cf)}),a5_0x24d284(Text,{'color':_0x1c9418(0x1e0),'children':_0x1c9418(0x1da)}),a5_0x24d284(Text,{'color':'yellow','children':_0x1c9418(0x1b4)})]})]})]});};function a5_0x3e27(){const _0x10d238=['length','lovrabet\x20auth','\x20个数据集的文档...','log','🚀\x20','正在获取数据集列表...','1589136YsIjbG','cyan','正在生成\x20','yellow','\x20个数据集','join','未找到任何数据集','指定的数据集代码都不存在:\x20','\x1b[90m*\x20从\x20','gray','\x20个数据集中筛选出\x20','√\x20文档生成完成!成功\x20','\x1b[33m!\x20以下数据集代码不存在:\x20','includes','\x20重新登录后再试','dim','error',',\x20失败\x20','success','.md\x20(','⚠️\x20以下数据集生成失败:','使用配置的应用AppCode:\x20','318232VVdAVG','api-doc','green','\x1b[0m','env','red','2762865VDNqyR','setLogPath','3048HPojWo','cwd','datasetCode','column','datasetName','\x20(环境:\x20','1230dvtiGv','*\x20生成的文档文件:','57344AMNacE','使用指定的应用AppCode:\x20','未提供应用AppCode,且配置中也没有默认值','💡\x20请使用\x20','\x20-\x20','2600LjPthm','./docs','white','947942jPgCGP','252epAMKn','map','文档生成完成','filter'];a5_0x3e27=function(){return _0x10d238;};return a5_0x3e27();}
1
+ (function(_0xf1b535,_0x3af402){const _0x5620e9=a5_0x44d3,_0x68e9ed=_0xf1b535();while(!![]){try{const _0x2b8b99=parseInt(_0x5620e9(0x9e))/0x1+-parseInt(_0x5620e9(0xa4))/0x2*(-parseInt(_0x5620e9(0x93))/0x3)+-parseInt(_0x5620e9(0x82))/0x4*(parseInt(_0x5620e9(0xb1))/0x5)+-parseInt(_0x5620e9(0x9f))/0x6+parseInt(_0x5620e9(0x94))/0x7+-parseInt(_0x5620e9(0x98))/0x8+-parseInt(_0x5620e9(0x8c))/0x9*(-parseInt(_0x5620e9(0x9d))/0xa);if(_0x2b8b99===_0x3af402)break;else _0x68e9ed['push'](_0x68e9ed['shift']());}catch(_0x8237e8){_0x68e9ed['push'](_0x68e9ed['shift']());}}}(a5_0x3fca,0x6a99f));import{jsx as a5_0x1aa9c2,jsxs as a5_0x9e6ecc,Fragment as a5_0x49a175}from'react/jsx-runtime';function a5_0x44d3(_0x3be874,_0x3513ef){_0x3be874=_0x3be874-0x7f;const _0x3fcada=a5_0x3fca();let _0x44d3be=_0x3fcada[_0x3be874];return _0x44d3be;}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';function a5_0x3fca(){const _0x2d1967=['\x1b[0m','length','map','\x20个匹配的数据集\x1b[0m','datasetCode','文档生成完成','481185eYsSDo','datasetName','message','api-doc','\x20个数据集的文档...','cyan','正在获取数据集列表...','9YkpZZU','3203025gIegvG','env','\x20重新登录后再试','dim','1005296oGJkcL','join','正在生成\x20','未找到任何数据集','gray','100XYqGdx','120079GjIRja','2729004eSdeLY','error','*\x20生成的文档文件:','使用配置的应用AppCode:\x20','\x1b[90m*\x20从\x20','73222YAuwrX','white','includes','lovrabet\x20auth','red','success','online','filter','./docs','🚀\x20',',\x20失败\x20','.md\x20(','*\x20共处理\x20','10qmULfO','\x20个数据集中筛选出\x20','√\x20文档生成完成!成功\x20','yellow','column','log','文档生成失败:\x20','未提供应用AppCode,且配置中也没有默认值','cwd','💡\x20请使用\x20','string','setLogPath','\x20-\x20','410004KJpOQd','指定的数据集代码都不存在:\x20','⚠️\x20以下数据集生成失败:','\x20(环境:\x20'];a5_0x3fca=function(){return _0x2d1967;};return a5_0x3fca();}export const ApiDocUI=({appCode:_0x388512,env:_0x12bd0c,output:_0x3dad07,extraParams:_0x5f1749,datasetCodes:_0x495505})=>{const _0x13f14a=a5_0x44d3,{exit:_0x1c2942}=useApp(),[_0x420548,_0x49f43f]=useState(![]),[_0x43648d,_0x49ec79]=useState(''),[_0x1825f0,_0x5f2b63]=useState(![]),[_0x17a222,_0xc13762]=useState(null),[_0x10a3ec,_0x16e40f]=useState(null),[_0x187062,_0x108770]=useState(0x0),_0x1f620d=readConfig(),_0x540f59=getConfigAppCode(),_0x18911=_0x388512||_0x540f59,_0x8c3a88=typeof _0x1f620d?.[_0x13f14a(0x95)]===_0x13f14a(0x7f)?_0x1f620d[_0x13f14a(0x95)]:undefined,_0xcc2dcb=_0x12bd0c||_0x8c3a88||_0x13f14a(0xaa);initEnv(_0xcc2dcb);const _0x3e23d7=_0x3dad07||_0x13f14a(0xac),_0x580a4c=_0x388512?'使用指定的应用AppCode:\x20'+_0x18911:_0x13f14a(0xa2)+_0x18911;useEffect(()=>{_0x49f43f(!![]),_0x5ab55a();},[]),useEffect(()=>{(_0x1825f0||_0x17a222)&&_0x1c2942();},[_0x1825f0,_0x17a222,_0x1c2942]);async function _0x5ab55a(){const _0x56007f=_0x13f14a;if(!_0x18911){_0xc13762(_0x56007f(0xb8));return;}try{logger[_0x56007f(0x80)](process[_0x56007f(0xb9)]()),_0x49ec79(_0x56007f(0x92));const {configArray:_0x3288df}=await fetchModelList(_0x18911);_0x108770(_0x3288df[_0x56007f(0x87)]);if(_0x3288df[_0x56007f(0x87)]===0x0){_0xc13762(_0x56007f(0x9b));return;}let _0x27d2b5=_0x3288df;if(_0x495505&&_0x495505['length']>0x0){_0x27d2b5=_0x3288df[_0x56007f(0xab)](_0x2ff2c6=>_0x495505[_0x56007f(0xa6)](_0x2ff2c6[_0x56007f(0x8a)]));const _0x3b2c61=_0x27d2b5[_0x56007f(0x88)](_0x35dffc=>_0x35dffc[_0x56007f(0x8a)]),_0x1c736e=_0x495505['filter'](_0x536139=>!_0x3b2c61[_0x56007f(0xa6)](_0x536139));_0x1c736e[_0x56007f(0x87)]>0x0&&console['log']('\x1b[33m!\x20以下数据集代码不存在:\x20'+_0x1c736e[_0x56007f(0x99)](',\x20')+_0x56007f(0x86));if(_0x27d2b5[_0x56007f(0x87)]===0x0){_0xc13762(_0x56007f(0x83)+_0x495505[_0x56007f(0x99)](',\x20'));return;}console[_0x56007f(0xb6)](_0x56007f(0xa3)+_0x3288df[_0x56007f(0x87)]+_0x56007f(0xb2)+_0x27d2b5[_0x56007f(0x87)]+_0x56007f(0x89));}_0x49ec79(_0x56007f(0x9a)+_0x27d2b5['length']+_0x56007f(0x90));const _0x53be62=await generateDatasetDocs(_0x27d2b5,_0x18911,_0x3e23d7,(_0x1e9763,_0x4835f3,_0x4d64eb)=>{const _0x4de7cf=_0x56007f;_0x49ec79(_0x4de7cf(0x9a)+_0x4d64eb+_0x4de7cf(0xaf)+_0x1e9763+'/'+_0x4835f3+')');},_0x5f1749);_0x16e40f(_0x53be62),_0x5f2b63(!![]);const _0xcffb67=_0x53be62[_0x56007f(0xab)](_0x54a358=>_0x54a358[_0x56007f(0xa9)])[_0x56007f(0x87)],_0x2d95cb=_0x53be62[_0x56007f(0xab)](_0x117ab6=>!_0x117ab6[_0x56007f(0xa9)])[_0x56007f(0x87)];logger[_0x56007f(0xa9)](_0x56007f(0x8f),_0x56007f(0x8b),undefined,{'totalCount':_0x53be62['length'],'successCount':_0xcffb67,'failCount':_0x2d95cb,'outputDir':_0x3e23d7});}catch(_0x721253){const _0x53b3d4=_0x721253 instanceof Error?_0x721253[_0x56007f(0x8e)]:String(_0x721253);logger[_0x56007f(0xa0)](_0x56007f(0x8f),'文档生成失败:\x20'+_0x53b3d4,{'appCode':_0x18911,'outputDir':_0x3e23d7}),_0xc13762(_0x56007f(0xb7)+_0x53b3d4);}finally{_0x49f43f(![]);}}const _0x572c19=_0x10a3ec?.[_0x13f14a(0xab)](_0x47fae5=>_0x47fae5[_0x13f14a(0xa9)])['length']||0x0,_0x4d6469=_0x10a3ec?.[_0x13f14a(0xab)](_0x3e47fe=>!_0x3e47fe[_0x13f14a(0xa9)])[_0x13f14a(0x87)]||0x0;return a5_0x9e6ecc(Box,{'flexDirection':'column','children':[(_0x420548||_0x1825f0)&&a5_0x9e6ecc(Box,{'children':[a5_0x1aa9c2(Text,{'color':_0x13f14a(0x9c),'children':'*\x20'}),a5_0x1aa9c2(Text,{'color':_0x388512?_0x13f14a(0xa5):_0x13f14a(0x97),'children':_0x580a4c})]}),_0x420548&&a5_0x1aa9c2(Box,{'children':a5_0x9e6ecc(Text,{'children':[_0x13f14a(0xad),_0x43648d,_0x13f14a(0x85),_0xcc2dcb,')']})}),_0x1825f0&&_0x10a3ec&&a5_0x9e6ecc(Box,{'flexDirection':_0x13f14a(0xb5),'children':[a5_0x1aa9c2(Box,{'children':a5_0x9e6ecc(Text,{'color':'green','children':[_0x13f14a(0xb3),_0x572c19,'\x20个',_0x4d6469>0x0&&_0x13f14a(0xae)+_0x4d6469+'\x20个']})}),a5_0x1aa9c2(Box,{'marginTop':0x1,'children':a5_0x9e6ecc(Text,{'color':_0x13f14a(0x9c),'children':[_0x13f14a(0xb0),_0x187062,'\x20个数据集']})}),a5_0x9e6ecc(Box,{'marginTop':0x1,'children':[a5_0x1aa9c2(Text,{'color':'gray','children':'*\x20输出目录:\x20'}),a5_0x1aa9c2(Text,{'color':_0x13f14a(0x91),'children':_0x3e23d7})]}),_0x572c19>0x0&&a5_0x9e6ecc(a5_0x49a175,{'children':[a5_0x1aa9c2(Box,{'marginTop':0x1,'children':a5_0x1aa9c2(Text,{'color':_0x13f14a(0x9c),'children':_0x13f14a(0xa1)})}),_0x10a3ec[_0x13f14a(0xab)](_0x175ea9=>_0x175ea9[_0x13f14a(0xa9)])[_0x13f14a(0x88)]((_0x37b2a8,_0x255003)=>a5_0x9e6ecc(Box,{'marginLeft':0x2,'children':[a5_0x9e6ecc(Text,{'color':_0x13f14a(0x91),'children':['•\x20',_0x37b2a8['filePath']]}),a5_0x9e6ecc(Text,{'color':'dim','children':[_0x13f14a(0x81),_0x37b2a8[_0x13f14a(0x8d)]]})]},_0x255003))]}),_0x4d6469>0x0&&a5_0x9e6ecc(a5_0x49a175,{'children':[a5_0x1aa9c2(Box,{'marginTop':0x1,'children':a5_0x1aa9c2(Text,{'color':_0x13f14a(0xb4),'children':_0x13f14a(0x84)})}),_0x10a3ec[_0x13f14a(0xab)](_0x2398d5=>!_0x2398d5[_0x13f14a(0xa9)])[_0x13f14a(0x88)]((_0x24a03c,_0x4ab8e3)=>a5_0x9e6ecc(Box,{'marginLeft':0x2,'flexDirection':_0x13f14a(0xb5),'children':[a5_0x9e6ecc(Text,{'color':'red','children':['•\x20',_0x24a03c[_0x13f14a(0x8d)],'\x20(',_0x24a03c[_0x13f14a(0x8a)],')']}),_0x24a03c[_0x13f14a(0xa0)]&&a5_0x1aa9c2(Box,{'marginLeft':0x2,'children':a5_0x1aa9c2(Text,{'color':_0x13f14a(0x97),'children':_0x24a03c[_0x13f14a(0xa0)]})})]},_0x4ab8e3))]})]}),_0x17a222&&a5_0x9e6ecc(Box,{'flexDirection':_0x13f14a(0xb5),'children':[a5_0x1aa9c2(Box,{'children':a5_0x9e6ecc(Text,{'color':_0x13f14a(0xa8),'children':['❌\x20',_0x17a222]})}),_0x17a222[_0x13f14a(0xa6)]('登录')&&a5_0x9e6ecc(Box,{'marginTop':0x1,'children':[a5_0x1aa9c2(Text,{'color':_0x13f14a(0xb4),'children':_0x13f14a(0xba)}),a5_0x1aa9c2(Text,{'color':_0x13f14a(0x91),'children':_0x13f14a(0xa7)}),a5_0x1aa9c2(Text,{'color':_0x13f14a(0xb4),'children':_0x13f14a(0x96)})]})]})]});};
@@ -1 +1 @@
1
- const a6_0x36b505=a6_0x3382;function a6_0x5853(){const _0x4e454f=['登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','生成文档成功:\x20','string','length','error','name','1917564iXqMGC','api-doc','./docs','生成文档失败:\x20','):缺少\x20data.markdown\x20字段','2640477aetZGH','\x0a共有\x20','11481903Dyfzam','POST','datasetCode','status','log','markdown','),HTTP状态码:\x20','665714bQNcGY','message','✗\x20失败:\x20','6AuvcQb','1829403pLJhBQ','.md\x20-\x20','2396936UekrLU','data','push','等待\x203\x20秒...\x0a','tableName','.md\x20(','获取文档失败\x20(','.md','✓\x20成功生成:\x20','/api/node-toolbox/api-doc-generator','8txAtRA','success','2624190SZeGUp'];a6_0x5853=function(){return _0x4e454f;};return a6_0x5853();}(function(_0x1b0e39,_0x15cdae){const _0x355133=a6_0x3382,_0x49d792=_0x1b0e39();while(!![]){try{const _0x29adda=-parseInt(_0x355133(0xfe))/0x1+parseInt(_0x355133(0xf0))/0x2+-parseInt(_0x355133(0x102))/0x3+-parseInt(_0x355133(0x104))/0x4+-parseInt(_0x355133(0x110))/0x5*(-parseInt(_0x355133(0x101))/0x6)+-parseInt(_0x355133(0xf5))/0x7*(parseInt(_0x355133(0x10e))/0x8)+parseInt(_0x355133(0xf7))/0x9;if(_0x29adda===_0x15cdae)break;else _0x49d792['push'](_0x49d792['shift']());}catch(_0x646f3f){_0x49d792['push'](_0x49d792['shift']());}}}(a6_0x5853,0x7be23));import{mkdirSync,writeFileSync}from'node:fs';import a6_0x5ce6dd from'node:path';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';function a6_0x3382(_0xed44b4,_0x1b5c8b){_0xed44b4=_0xed44b4-0xf0;const _0x5853c6=a6_0x5853();let _0x3382d2=_0x5853c6[_0xed44b4];return _0x3382d2;}import{logger}from'../utils/logger.js';export async function fetchDatasetDoc(_0x1dc1d1){const _0x4749d2=a6_0x3382,{appCode:_0x29b8ed,datasetCode:_0x138e99,datasetId:_0x934643,extraParams:_0x4770d2}=_0x1dc1d1,_0x207718=getApiDomain(),_0x1a2f55=_0x207718+_0x4749d2(0x10d),_0x45c5d6={'appCode':_0x29b8ed,'datasetCode':_0x138e99,'datasetId':_0x934643,..._0x4770d2||{}},_0x25a1b0=await fetch(_0x1a2f55,{'method':_0x4749d2(0xf8),'headers':{'Content-Type':'application/json','Cookie':getCookie()},'body':JSON['stringify'](_0x45c5d6)});if(!_0x25a1b0['ok']){if(_0x25a1b0[_0x4749d2(0xfa)]===0x191)throw new Error(_0x4749d2(0x111));let _0x3c40f9='';try{_0x3c40f9=await _0x25a1b0['text']();}catch(_0x2d0ae8){}throw new Error(_0x4749d2(0x10a)+_0x138e99+_0x4749d2(0xfd)+_0x25a1b0['status']+(_0x3c40f9?'\x0a'+_0x3c40f9:''));}const _0x105dea=await _0x25a1b0['json']();if(!_0x105dea['data']||typeof _0x105dea[_0x4749d2(0x105)][_0x4749d2(0xfc)]!==_0x4749d2(0x113))throw new Error('响应数据格式错误\x20('+_0x138e99+_0x4749d2(0xf4));return _0x105dea[_0x4749d2(0x105)][_0x4749d2(0xfc)];}function delay(_0x57570e){return new Promise(_0x109cea=>setTimeout(_0x109cea,_0x57570e));}export async function generateDatasetDocs(_0x14e0c8,_0x43b9af,_0xee794e=a6_0x36b505(0xf2),_0x219d41,_0x5884cf){const _0x9968ae=a6_0x36b505;mkdirSync(_0xee794e,{'recursive':!![]});const _0x295039=[],_0x2a9c4f=_0x14e0c8[_0x9968ae(0x114)];console['log'](_0x9968ae(0xf6)+_0x2a9c4f+'\x20个数据集需要生成文档\x0a');for(let _0x3f2b85=0x0;_0x3f2b85<_0x14e0c8['length'];_0x3f2b85++){const _0x277313=_0x14e0c8[_0x3f2b85],_0x1bfb62=_0x3f2b85+0x1,_0x3927a2=_0x277313[_0x9968ae(0x108)];try{console[_0x9968ae(0xfb)]('['+_0x1bfb62+'/'+_0x2a9c4f+']\x20正在生成:\x20'+_0x3927a2+_0x9968ae(0x109)+_0x277313[_0x9968ae(0x116)]+')');_0x219d41&&_0x219d41(_0x1bfb62,_0x2a9c4f,_0x3927a2);const _0x3d92e9=await fetchDatasetDoc({'appCode':_0x43b9af,'datasetCode':_0x277313[_0x9968ae(0xf9)],'datasetId':_0x277313['id'],'enableAI':![],'extraParams':_0x5884cf}),_0x21ebcc=a6_0x5ce6dd['join'](_0xee794e,_0x3927a2+_0x9968ae(0x10b));writeFileSync(_0x21ebcc,_0x3d92e9,{'encoding':'utf8'}),console[_0x9968ae(0xfb)](_0x9968ae(0x10c)+_0x3927a2+'.md'),logger[_0x9968ae(0x10f)]('api-doc',_0x9968ae(0x112)+_0x3927a2,undefined,{'datasetCode':_0x277313[_0x9968ae(0xf9)],'datasetName':_0x277313['name'],'filePath':_0x21ebcc,'progress':_0x1bfb62+'/'+_0x2a9c4f}),_0x295039[_0x9968ae(0x106)]({'datasetCode':_0x277313['datasetCode'],'datasetName':_0x277313[_0x9968ae(0x116)],'filePath':_0x21ebcc,'success':!![]}),_0x1bfb62<_0x2a9c4f&&await delay(0x1388);}catch(_0x33b18b){const _0x3e5dff=_0x33b18b instanceof Error?_0x33b18b[_0x9968ae(0xff)]:String(_0x33b18b);console['log'](_0x9968ae(0x100)+_0x3927a2+_0x9968ae(0x103)+_0x3e5dff+'\x0a'),logger[_0x9968ae(0x115)](_0x9968ae(0xf1),_0x9968ae(0xf3)+_0x277313[_0x9968ae(0xf9)],{'datasetCode':_0x277313[_0x9968ae(0xf9)],'datasetName':_0x277313[_0x9968ae(0x116)],'error':_0x3e5dff,'progress':_0x1bfb62+'/'+_0x2a9c4f}),_0x295039[_0x9968ae(0x106)]({'datasetCode':_0x277313[_0x9968ae(0xf9)],'datasetName':_0x277313[_0x9968ae(0x116)],'filePath':'','success':![],'error':_0x3e5dff}),_0x1bfb62<_0x2a9c4f&&(console['log'](_0x9968ae(0x107)),await delay(0xbb8));}}return _0x295039;}
1
+ const a6_0x4aeb67=a6_0x25df;(function(_0x5020f2,_0x5e4224){const _0x4b4254=a6_0x25df,_0xf4cf78=_0x5020f2();while(!![]){try{const _0x1258d8=parseInt(_0x4b4254(0x202))/0x1+parseInt(_0x4b4254(0x20f))/0x2+parseInt(_0x4b4254(0x1f2))/0x3*(-parseInt(_0x4b4254(0x1fe))/0x4)+parseInt(_0x4b4254(0x1f8))/0x5*(-parseInt(_0x4b4254(0x1ec))/0x6)+-parseInt(_0x4b4254(0x1f5))/0x7*(-parseInt(_0x4b4254(0x209))/0x8)+parseInt(_0x4b4254(0x20c))/0x9+-parseInt(_0x4b4254(0x208))/0xa;if(_0x1258d8===_0x5e4224)break;else _0xf4cf78['push'](_0xf4cf78['shift']());}catch(_0x86b439){_0xf4cf78['push'](_0xf4cf78['shift']());}}}(a6_0x4194,0x97897));import{mkdirSync,writeFileSync}from'node:fs';import a6_0x27fc92 from'node:path';function a6_0x25df(_0x27f1e5,_0x25e350){_0x27f1e5=_0x27f1e5-0x1ea;const _0x419498=a6_0x4194();let _0x25df1f=_0x419498[_0x27f1e5];return _0x25df1f;}import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';export async function fetchDatasetDoc(_0x13a82c){const _0x377fde=a6_0x25df,{appCode:_0x57f76e,datasetCode:_0x5028f1,datasetId:_0x385fde,extraParams:_0x834ab1}=_0x13a82c,_0x12c7d7=getApiDomain(),_0x25d310=_0x12c7d7+_0x377fde(0x207),_0x46986d={'appCode':_0x57f76e,'datasetCode':_0x5028f1,'datasetId':_0x385fde,..._0x834ab1||{}},_0x17d0c9=await fetch(_0x25d310,{'method':_0x377fde(0x1eb),'headers':{'Content-Type':_0x377fde(0x1f4),'Cookie':getCookie()},'body':JSON[_0x377fde(0x20d)](_0x46986d)});if(!_0x17d0c9['ok']){if(_0x17d0c9[_0x377fde(0x1ff)]===0x191)throw new Error(_0x377fde(0x1fd));let _0x14f821='';try{_0x14f821=await _0x17d0c9[_0x377fde(0x1f0)]();}catch(_0x454d03){}throw new Error(_0x377fde(0x20a)+_0x5028f1+_0x377fde(0x1fc)+_0x17d0c9['status']+(_0x14f821?'\x0a'+_0x14f821:''));}const _0x1b8412=await _0x17d0c9[_0x377fde(0x204)]();if(!_0x1b8412[_0x377fde(0x1ed)]||typeof _0x1b8412[_0x377fde(0x1ed)][_0x377fde(0x1ee)]!=='string')throw new Error('响应数据格式错误\x20('+_0x5028f1+'):缺少\x20data.markdown\x20字段');return _0x1b8412[_0x377fde(0x1ed)][_0x377fde(0x1ee)];}function delay(_0x9fdf9){return new Promise(_0x37fbb9=>setTimeout(_0x37fbb9,_0x9fdf9));}function a6_0x4194(){const _0x549570=['api-doc','text','./docs','800403idnznS','\x0a共有\x20','application/json','7ThKKQP','push','error','5DrmmfJ','utf8','.md\x20(','等待\x203\x20秒...\x0a','),HTTP状态码:\x20','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','4RTRCwt','status','✗\x20失败:\x20','datasetCode','1033828OqxciQ','success','json','.md','tableName','/api/node-toolbox/api-doc-generator','19902640MmKNhH','8957576iHTgzj','获取文档失败\x20(','message','9332244bHAGvB','stringify','length','1753796PzsdTJ','生成文档成功:\x20','log','name','✓\x20成功生成:\x20','POST','7137474cinrtr','data','markdown'];a6_0x4194=function(){return _0x549570;};return a6_0x4194();}export async function generateDatasetDocs(_0x4c0159,_0x28d722,_0x96935f=a6_0x4aeb67(0x1f1),_0x1696bb,_0x31d9a6){const _0x14413f=a6_0x4aeb67;mkdirSync(_0x96935f,{'recursive':!![]});const _0x141719=[],_0x200250=_0x4c0159['length'];console['log'](_0x14413f(0x1f3)+_0x200250+'\x20个数据集需要生成文档\x0a');for(let _0x12c1b9=0x0;_0x12c1b9<_0x4c0159[_0x14413f(0x20e)];_0x12c1b9++){const _0x201688=_0x4c0159[_0x12c1b9],_0x33a5c6=_0x12c1b9+0x1,_0x5f2e89=_0x201688[_0x14413f(0x206)];try{console['log']('['+_0x33a5c6+'/'+_0x200250+']\x20正在生成:\x20'+_0x5f2e89+_0x14413f(0x1fa)+_0x201688[_0x14413f(0x212)]+')');_0x1696bb&&_0x1696bb(_0x33a5c6,_0x200250,_0x5f2e89);const _0x107bc4=await fetchDatasetDoc({'appCode':_0x28d722,'datasetCode':_0x201688[_0x14413f(0x201)],'datasetId':_0x201688['id'],'enableAI':![],'extraParams':_0x31d9a6}),_0x28008a=a6_0x27fc92['join'](_0x96935f,_0x5f2e89+'.md');writeFileSync(_0x28008a,_0x107bc4,{'encoding':_0x14413f(0x1f9)}),console[_0x14413f(0x211)](_0x14413f(0x1ea)+_0x5f2e89+_0x14413f(0x205)),logger[_0x14413f(0x203)](_0x14413f(0x1ef),_0x14413f(0x210)+_0x5f2e89,undefined,{'datasetCode':_0x201688[_0x14413f(0x201)],'datasetName':_0x201688[_0x14413f(0x212)],'filePath':_0x28008a,'progress':_0x33a5c6+'/'+_0x200250}),_0x141719[_0x14413f(0x1f6)]({'datasetCode':_0x201688['datasetCode'],'datasetName':_0x201688[_0x14413f(0x212)],'filePath':_0x28008a,'success':!![]}),_0x33a5c6<_0x200250&&await delay(0x1388);}catch(_0x253d79){const _0x4c1f38=_0x253d79 instanceof Error?_0x253d79[_0x14413f(0x20b)]:String(_0x253d79);console[_0x14413f(0x211)](_0x14413f(0x200)+_0x5f2e89+'.md\x20-\x20'+_0x4c1f38+'\x0a'),logger[_0x14413f(0x1f7)]('api-doc','生成文档失败:\x20'+_0x201688['datasetCode'],{'datasetCode':_0x201688[_0x14413f(0x201)],'datasetName':_0x201688['name'],'error':_0x4c1f38,'progress':_0x33a5c6+'/'+_0x200250}),_0x141719[_0x14413f(0x1f6)]({'datasetCode':_0x201688[_0x14413f(0x201)],'datasetName':_0x201688[_0x14413f(0x212)],'filePath':'','success':![],'error':_0x4c1f38}),_0x33a5c6<_0x200250&&(console[_0x14413f(0x211)](_0x14413f(0x1fb)),await delay(0xbb8));}}return _0x141719;}
@@ -1 +1 @@
1
- function a7_0xe605(){const _0x58a4f9=['117842GmbcZy','\x20-\x20客户端实例文件','4DkBBdx','70803UweIZZ','-\x20模型配置文件\x20(','string','yellow','\x20from\x20\x27@/','\x20个模型','modelCount','拉取\x20API\x20配置失败:\x20','lovrabet\x20auth','green','🚀\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','white','\x20重新登录后再试','!\x20原始数据集\x20','length','80eQCFvD','replace','join','2430HWoMvJ','cwd','.ts','setLogPath','20cpRMfO','79671toRcjg','online','3020190DHOfsu','1727pqotrq','{\x20lovrabetClient\x20}','53032POeLiU','433202jrLDpd','env','√\x20成功拉取\x20','cyan','slice','datasetCount','endsWith','api','message','使用配置的应用AppCode:\x20','split','client','\x20个,过滤重复','*\x20已生成文件:','💡\x20请使用\x20','未提供应用AppCode,且配置中也没有默认值','./src/api/','gray','column'];a7_0xe605=function(){return _0x58a4f9;};return a7_0xe605();}(function(_0x1d1c09,_0x191353){const _0x11b57a=a7_0x443e,_0x4f55b3=_0x1d1c09();while(!![]){try{const _0x147f1a=-parseInt(_0x11b57a(0x1fc))/0x1*(parseInt(_0x11b57a(0x1fe))/0x2)+-parseInt(_0x11b57a(0x1e3))/0x3+parseInt(_0x11b57a(0x1e8))/0x4*(-parseInt(_0x11b57a(0x1e2))/0x5)+parseInt(_0x11b57a(0x1e5))/0x6+parseInt(_0x11b57a(0x1e9))/0x7+-parseInt(_0x11b57a(0x1db))/0x8*(-parseInt(_0x11b57a(0x1ff))/0x9)+-parseInt(_0x11b57a(0x1de))/0xa*(parseInt(_0x11b57a(0x1e6))/0xb);if(_0x147f1a===_0x191353)break;else _0x4f55b3['push'](_0x4f55b3['shift']());}catch(_0x35efa9){_0x4f55b3['push'](_0x4f55b3['shift']());}}}(a7_0xe605,0x46ec1));import{jsx as a7_0x595938,jsxs as a7_0x5e400b}from'react/jsx-runtime';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';import{initEnv}from'../constant/env.js';import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';import{fetchModelList}from'./fetch-model-list.js';function a7_0x443e(_0x1f6ad8,_0x34f45e){_0x1f6ad8=_0x1f6ad8-0x1d0;const _0xe605d4=a7_0xe605();let _0x443ef9=_0xe605d4[_0x1f6ad8];return _0x443ef9;}export const ApiPullUI=({appCode:_0x5e73c3,env:_0x2d6d7f,output:_0x408227})=>{const _0x18971a=a7_0x443e,{exit:_0x92cff1}=useApp(),[_0x5281f8,_0x5b2095]=useState(![]),[_0x2f47f5,_0x28c170]=useState(![]),[_0xdc40e3,_0x19cda5]=useState(null),[_0x438c6d,_0xf464b0]=useState(null),_0x49520f=readConfig(),_0x52283f=getConfigAppCode(),_0x5ad836=_0x5e73c3||_0x52283f,_0x1c24e5=typeof _0x49520f?.['env']===_0x18971a(0x201)?_0x49520f[_0x18971a(0x1ea)]:undefined,_0x17af8c=_0x2d6d7f||_0x1c24e5||_0x18971a(0x1e4);initEnv(_0x17af8c);const _0x463183=_0x408227||_0x18971a(0x1f9),_0xfcb6be=_0x5e73c3&&_0x5e73c3['includes']('-')?_0x5e73c3[_0x18971a(0x1f3)]('-')[_0x18971a(0x1ed)](0x1)[_0x18971a(0x1dd)]('-'):'',_0x345bc5=_0x5e73c3?'使用指定的应用AppCode:\x20'+_0x5ad836:_0x18971a(0x1f2)+_0x5ad836,_0x427e2a=_0xfcb6be?_0xfcb6be+'-api':_0x18971a(0x1f0),_0x404326=_0xfcb6be?_0xfcb6be+'-client':_0x18971a(0x1f4);useEffect(()=>{_0x5b2095(!![]),_0x1d84e5();},[]),useEffect(()=>{(_0x2f47f5||_0xdc40e3)&&_0x92cff1();},[_0x2f47f5,_0xdc40e3,_0x92cff1]);async function _0x1d84e5(){const _0x706b38=_0x18971a;if(!_0x5ad836){_0x19cda5(_0x706b38(0x1f8));return;}try{logger[_0x706b38(0x1e1)](process[_0x706b38(0x1df)]());const {configArray:_0x595ffa}=await fetchModelList(_0x5ad836),_0x269bd7=_0x595ffa[_0x706b38(0x1da)],_0x439a3c=!_0x5e73c3,_0x323963=await generateApiFile(_0x595ffa,_0xfcb6be,_0x5ad836,_0x439a3c,_0x17af8c,_0x463183),_0x166800=_0x463183[_0x706b38(0x1ef)]('/')?_0x463183:_0x463183+'/';_0xf464b0({'api':''+_0x166800+_0x427e2a+_0x706b38(0x1e0),'client':''+_0x166800+_0x404326+'.ts','modelCount':_0x323963[_0x706b38(0x1d2)],'datasetCount':_0x269bd7,'originalCount':_0x269bd7,'duplicateCount':0x0}),_0x28c170(!![]);}catch(_0x9b938a){const _0x55406a=_0x9b938a instanceof Error?_0x9b938a[_0x706b38(0x1f1)]:String(_0x9b938a);logger['error']('api-pull',_0x706b38(0x1d3)+_0x55406a,{'appCode':_0x5ad836,'error':_0x55406a}),_0x19cda5(_0x706b38(0x1d3)+_0x55406a);}finally{_0x5b2095(![]);}}return a7_0x5e400b(Box,{'flexDirection':_0x18971a(0x1fb),'children':[(_0x5281f8||_0x2f47f5)&&a7_0x5e400b(Box,{'children':[a7_0x595938(Text,{'color':'gray','children':'*\x20'}),a7_0x595938(Text,{'color':_0x5e73c3?_0x18971a(0x1d7):'dim','children':_0x345bc5})]}),_0x5281f8&&a7_0x595938(Box,{'children':a7_0x5e400b(Text,{'children':[_0x18971a(0x1d6),_0x17af8c,')']})}),_0x2f47f5&&_0x438c6d&&a7_0x5e400b(Box,{'flexDirection':_0x18971a(0x1fb),'children':[a7_0x595938(Box,{'children':a7_0x5e400b(Text,{'color':_0x18971a(0x1d5),'children':[_0x18971a(0x1eb),_0x438c6d[_0x18971a(0x1ee)],'\x20个数据集,生成','\x20',_0x438c6d[_0x18971a(0x1d2)],_0x18971a(0x1d1)]})}),_0x438c6d['duplicateCount']>0x0&&a7_0x595938(Box,{'marginTop':0x1,'children':a7_0x5e400b(Text,{'color':_0x18971a(0x202),'children':[_0x18971a(0x1d9),_0x438c6d['originalCount'],_0x18971a(0x1f5),'\x20',_0x438c6d['duplicateCount'],'\x20个']})}),a7_0x595938(Box,{'marginTop':0x1,'children':a7_0x595938(Text,{'color':'gray','children':_0x18971a(0x1f6)})}),a7_0x5e400b(Box,{'marginLeft':0x2,'children':[a7_0x5e400b(Text,{'color':'cyan','children':['•\x20',_0x438c6d[_0x18971a(0x1f0)]]}),a7_0x5e400b(Text,{'color':'dim','children':['\x20',_0x18971a(0x200),_0x438c6d['modelCount'],'\x20个模型)']})]}),a7_0x5e400b(Box,{'marginLeft':0x2,'children':[a7_0x5e400b(Text,{'color':_0x18971a(0x1ec),'children':['•\x20',_0x438c6d[_0x18971a(0x1f4)]]}),a7_0x595938(Text,{'color':'dim','children':_0x18971a(0x1fd)})]}),a7_0x595938(Box,{'marginTop':0x1,'children':a7_0x595938(Text,{'color':_0x18971a(0x1fa),'children':'*\x20导入方式:'})}),a7_0x595938(Box,{'marginLeft':0x2,'children':a7_0x5e400b(Text,{'color':'yellow','children':['import\x20',_0x18971a(0x1e7),_0x18971a(0x1d0),_0x438c6d[_0x18971a(0x1f4)][_0x18971a(0x1dc)](/^\.\//,'')[_0x18971a(0x1dc)](_0x18971a(0x1e0),''),'\x27']})})]}),_0xdc40e3&&a7_0x5e400b(Box,{'flexDirection':'column','children':[a7_0x595938(Box,{'children':a7_0x5e400b(Text,{'color':'red','children':['❌\x20',_0xdc40e3]})}),_0xdc40e3['includes']('登录')&&a7_0x5e400b(Box,{'marginTop':0x1,'children':[a7_0x595938(Text,{'color':_0x18971a(0x202),'children':_0x18971a(0x1f7)}),a7_0x595938(Text,{'color':_0x18971a(0x1ec),'children':_0x18971a(0x1d4)}),a7_0x595938(Text,{'color':_0x18971a(0x202),'children':_0x18971a(0x1d8)})]})]})]});};
1
+ (function(_0x1eed27,_0x29f8b6){const _0x151caf=a7_0x57c2,_0x4bb032=_0x1eed27();while(!![]){try{const _0x1875f3=-parseInt(_0x151caf(0x187))/0x1+parseInt(_0x151caf(0x1a4))/0x2*(parseInt(_0x151caf(0x181))/0x3)+parseInt(_0x151caf(0x193))/0x4*(parseInt(_0x151caf(0x17a))/0x5)+parseInt(_0x151caf(0x19f))/0x6*(parseInt(_0x151caf(0x195))/0x7)+parseInt(_0x151caf(0x183))/0x8*(parseInt(_0x151caf(0x172))/0x9)+-parseInt(_0x151caf(0x19e))/0xa*(parseInt(_0x151caf(0x198))/0xb)+-parseInt(_0x151caf(0x185))/0xc*(parseInt(_0x151caf(0x170))/0xd);if(_0x1875f3===_0x29f8b6)break;else _0x4bb032['push'](_0x4bb032['shift']());}catch(_0x838f2c){_0x4bb032['push'](_0x4bb032['shift']());}}}(a7_0x13ed,0x31c58));import{jsx as a7_0x4925af,jsxs as a7_0xa8e224}from'react/jsx-runtime';import{useEffect,useState}from'react';function a7_0x57c2(_0x2bde17,_0x57440d){_0x2bde17=_0x2bde17-0x16e;const _0x13ed56=a7_0x13ed();let _0x57c24d=_0x13ed56[_0x2bde17];return _0x57c24d;}import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';import{initEnv}from'../constant/env.js';import{generateApiFile}from'./generate-api-file.js';function a7_0x13ed(){const _0x3422fe=['2565774tJpErW','setLogPath','\x20个模型','-\x20模型配置文件\x20(','*\x20已生成文件:','modelCount','未提供应用AppCode,且配置中也没有默认值','api-pull','25OFOJqa','dim','√\x20成功拉取\x20','yellow','-api','join','duplicateCount','27SGlqUJ','endsWith','8amgSli','\x20重新登录后再试','15324KfbOEE','\x20-\x20客户端实例文件','170166ostTkY','💡\x20请使用\x20','column','online','length','slice','includes','datasetCount','lovrabet\x20auth','originalCount','client','{\x20lovrabetClient\x20}','206068jQuXcn','\x20个模型)','42cIPwHN','\x20个,过滤重复','string','1137356sekmYR','cyan','gray','拉取\x20API\x20配置失败:\x20','red','api','10lTbkOm','115356UKMRrC','-client','🚀\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','*\x20导入方式:','replace','3852QgMLzm','message','.ts','2015gMcZBt','cwd'];a7_0x13ed=function(){return _0x3422fe;};return a7_0x13ed();}import{logger}from'../utils/logger.js';import{fetchModelList}from'./fetch-model-list.js';export const ApiPullUI=({appCode:_0x4a7c9e,env:_0x42ac0f,output:_0x2c56c4})=>{const _0x43aae0=a7_0x57c2,{exit:_0x18c7e9}=useApp(),[_0x450d93,_0x15058d]=useState(![]),[_0x4d57f6,_0x4cb824]=useState(![]),[_0x4a61a6,_0x2adc2b]=useState(null),[_0x4f5c4a,_0x369328]=useState(null),_0x4dc96a=readConfig(),_0x2cef39=getConfigAppCode(),_0x2954ec=_0x4a7c9e||_0x2cef39,_0x3169ae=typeof _0x4dc96a?.['env']===_0x43aae0(0x197)?_0x4dc96a['env']:undefined,_0x457160=_0x42ac0f||_0x3169ae||_0x43aae0(0x18a);initEnv(_0x457160);const _0x24be0c=_0x2c56c4||'./src/api/',_0x3561d1=_0x4a7c9e&&_0x4a7c9e[_0x43aae0(0x18d)]('-')?_0x4a7c9e['split']('-')[_0x43aae0(0x18c)](0x1)[_0x43aae0(0x17f)]('-'):'',_0x3413ae=_0x4a7c9e?'使用指定的应用AppCode:\x20'+_0x2954ec:'使用配置的应用AppCode:\x20'+_0x2954ec,_0x4b5653=_0x3561d1?_0x3561d1+_0x43aae0(0x17e):_0x43aae0(0x19d),_0x4e043d=_0x3561d1?_0x3561d1+_0x43aae0(0x1a0):_0x43aae0(0x191);useEffect(()=>{_0x15058d(!![]),_0x3c8f28();},[]),useEffect(()=>{(_0x4d57f6||_0x4a61a6)&&_0x18c7e9();},[_0x4d57f6,_0x4a61a6,_0x18c7e9]);async function _0x3c8f28(){const _0x27925c=_0x43aae0;if(!_0x2954ec){_0x2adc2b(_0x27925c(0x178));return;}try{logger[_0x27925c(0x173)](process[_0x27925c(0x171)]());const {configArray:_0x1899a4}=await fetchModelList(_0x2954ec),_0x497c41=_0x1899a4[_0x27925c(0x18b)],_0x582074=!_0x4a7c9e,_0x7ae754=await generateApiFile(_0x1899a4,_0x3561d1,_0x2954ec,_0x582074,_0x457160,_0x24be0c),_0x27f1b1=_0x24be0c[_0x27925c(0x182)]('/')?_0x24be0c:_0x24be0c+'/';_0x369328({'api':''+_0x27f1b1+_0x4b5653+_0x27925c(0x16f),'client':''+_0x27f1b1+_0x4e043d+_0x27925c(0x16f),'modelCount':_0x7ae754[_0x27925c(0x177)],'datasetCount':_0x497c41,'originalCount':_0x497c41,'duplicateCount':0x0}),_0x4cb824(!![]);}catch(_0x399c4b){const _0x4c7f81=_0x399c4b instanceof Error?_0x399c4b[_0x27925c(0x16e)]:String(_0x399c4b);logger['error'](_0x27925c(0x179),'拉取\x20API\x20配置失败:\x20'+_0x4c7f81,{'appCode':_0x2954ec,'error':_0x4c7f81}),_0x2adc2b(_0x27925c(0x19b)+_0x4c7f81);}finally{_0x15058d(![]);}}return a7_0xa8e224(Box,{'flexDirection':_0x43aae0(0x189),'children':[(_0x450d93||_0x4d57f6)&&a7_0xa8e224(Box,{'children':[a7_0x4925af(Text,{'color':'gray','children':'*\x20'}),a7_0x4925af(Text,{'color':_0x4a7c9e?'white':_0x43aae0(0x17b),'children':_0x3413ae})]}),_0x450d93&&a7_0x4925af(Box,{'children':a7_0xa8e224(Text,{'children':[_0x43aae0(0x1a1),_0x457160,')']})}),_0x4d57f6&&_0x4f5c4a&&a7_0xa8e224(Box,{'flexDirection':'column','children':[a7_0x4925af(Box,{'children':a7_0xa8e224(Text,{'color':'green','children':[_0x43aae0(0x17c),_0x4f5c4a[_0x43aae0(0x18e)],'\x20个数据集,生成','\x20',_0x4f5c4a[_0x43aae0(0x177)],_0x43aae0(0x174)]})}),_0x4f5c4a[_0x43aae0(0x180)]>0x0&&a7_0x4925af(Box,{'marginTop':0x1,'children':a7_0xa8e224(Text,{'color':_0x43aae0(0x17d),'children':['!\x20原始数据集\x20',_0x4f5c4a[_0x43aae0(0x190)],_0x43aae0(0x196),'\x20',_0x4f5c4a['duplicateCount'],'\x20个']})}),a7_0x4925af(Box,{'marginTop':0x1,'children':a7_0x4925af(Text,{'color':_0x43aae0(0x19a),'children':_0x43aae0(0x176)})}),a7_0xa8e224(Box,{'marginLeft':0x2,'children':[a7_0xa8e224(Text,{'color':_0x43aae0(0x199),'children':['•\x20',_0x4f5c4a[_0x43aae0(0x19d)]]}),a7_0xa8e224(Text,{'color':_0x43aae0(0x17b),'children':['\x20',_0x43aae0(0x175),_0x4f5c4a[_0x43aae0(0x177)],_0x43aae0(0x194)]})]}),a7_0xa8e224(Box,{'marginLeft':0x2,'children':[a7_0xa8e224(Text,{'color':_0x43aae0(0x199),'children':['•\x20',_0x4f5c4a[_0x43aae0(0x191)]]}),a7_0x4925af(Text,{'color':_0x43aae0(0x17b),'children':_0x43aae0(0x186)})]}),a7_0x4925af(Box,{'marginTop':0x1,'children':a7_0x4925af(Text,{'color':'gray','children':_0x43aae0(0x1a2)})}),a7_0x4925af(Box,{'marginLeft':0x2,'children':a7_0xa8e224(Text,{'color':'yellow','children':['import\x20',_0x43aae0(0x192),'\x20from\x20\x27@/',_0x4f5c4a[_0x43aae0(0x191)]['replace'](/^\.\//,'')[_0x43aae0(0x1a3)]('.ts',''),'\x27']})})]}),_0x4a61a6&&a7_0xa8e224(Box,{'flexDirection':_0x43aae0(0x189),'children':[a7_0x4925af(Box,{'children':a7_0xa8e224(Text,{'color':_0x43aae0(0x19c),'children':['❌\x20',_0x4a61a6]})}),_0x4a61a6[_0x43aae0(0x18d)]('登录')&&a7_0xa8e224(Box,{'marginTop':0x1,'children':[a7_0x4925af(Text,{'color':_0x43aae0(0x17d),'children':_0x43aae0(0x188)}),a7_0x4925af(Text,{'color':'cyan','children':_0x43aae0(0x18f)}),a7_0x4925af(Text,{'color':_0x43aae0(0x17d),'children':_0x43aae0(0x184)})]})]})]});};
@@ -1 +1 @@
1
- function a8_0x3092(){const _0x256e65=['33610uiooIH','正在从服务器拉取模型列表...\x20(环境:\x20','data','24918slyYbc','UNAUTHORIZED','265LekriW','json','12288nLrLdL','error','未知错误','获取数据集失败:\x20','3257937vDamVg','14NSphLh','success','Unauthorized','status','/api/node-toolbox/dataset/model-list?appcode=','1884014cqcxZW','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','includes','401','count','errorCode','errorMsg','2496016UvSPws','1473112ffOyXI','432belBLs','2255hBroKz','&otype=array','code','fetch-model-list','errorMessage','message'];a8_0x3092=function(){return _0x256e65;};return a8_0x3092();}(function(_0x3ff8e2,_0xc48e7){const _0x17dbb3=a8_0xbd82,_0xd9da7d=_0x3ff8e2();while(!![]){try{const _0x4093e1=parseInt(_0x17dbb3(0x1a0))/0x1+parseInt(_0x17dbb3(0x198))/0x2+parseInt(_0x17dbb3(0x1a1))/0x3*(-parseInt(_0x17dbb3(0x18e))/0x4)+-parseInt(_0x17dbb3(0x1ad))/0x5*(parseInt(_0x17dbb3(0x1ab))/0x6)+-parseInt(_0x17dbb3(0x193))/0x7*(parseInt(_0x17dbb3(0x19f))/0x8)+parseInt(_0x17dbb3(0x192))/0x9+parseInt(_0x17dbb3(0x1a8))/0xa*(-parseInt(_0x17dbb3(0x1a2))/0xb);if(_0x4093e1===_0xc48e7)break;else _0xd9da7d['push'](_0xd9da7d['shift']());}catch(_0x6abae0){_0xd9da7d['push'](_0xd9da7d['shift']());}}}(a8_0x3092,0xc3b5a));function a8_0xbd82(_0x192fa7,_0x4c03d3){_0x192fa7=_0x192fa7-0x18d;const _0x3092d8=a8_0x3092();let _0xbd82ba=_0x3092d8[_0x192fa7];return _0xbd82ba;}import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';import{getEnv}from'../constant/env.js';export async function fetchModelList(_0x3f8d30){const _0x57d204=a8_0xbd82,_0x574486=getEnv(),_0x179803=getApiDomain()+_0x57d204(0x197)+_0x3f8d30+_0x57d204(0x1a3);logger['info'](_0x57d204(0x1a5),_0x57d204(0x1a9)+_0x574486+')',{'apiUrl':_0x179803});const _0x26b250=await fetch(_0x179803,{'headers':{'Cookie':getCookie()}});if(!_0x26b250['ok']){if(_0x26b250[_0x57d204(0x196)]===0x191)throw new Error(_0x57d204(0x199));throw new Error('获取数据集失败,HTTP状态码:\x20'+_0x26b250[_0x57d204(0x196)]);}const _0x37a27c=await _0x26b250[_0x57d204(0x18d)]();if(!_0x37a27c[_0x57d204(0x194)]){const _0x337991=_0x37a27c[_0x57d204(0x19e)]||_0x37a27c[_0x57d204(0x1a7)]||_0x37a27c[_0x57d204(0x1aa)]?.[_0x57d204(0x1a7)]||_0x37a27c[_0x57d204(0x1a6)]||_0x37a27c[_0x57d204(0x18f)]||_0x57d204(0x190);if(_0x337991[_0x57d204(0x19a)](_0x57d204(0x19b))||_0x337991[_0x57d204(0x19a)](_0x57d204(0x195))||_0x337991[_0x57d204(0x19a)]('登录')||_0x337991[_0x57d204(0x19a)]('认证')||_0x37a27c[_0x57d204(0x19d)]===_0x57d204(0x1ac)||_0x37a27c[_0x57d204(0x1a4)]===0x191||_0x37a27c['code']===_0x57d204(0x19b))throw new Error(_0x57d204(0x199));throw new Error(_0x57d204(0x191)+_0x337991);}return{'configArray':_0x37a27c[_0x57d204(0x1aa)]['configArray'],'count':_0x37a27c[_0x57d204(0x1aa)][_0x57d204(0x19c)]};}
1
+ (function(_0x22d062,_0x479dc){const _0x1b48b9=a8_0x5b4e,_0x3c682d=_0x22d062();while(!![]){try{const _0xea518b=-parseInt(_0x1b48b9(0xec))/0x1+-parseInt(_0x1b48b9(0x108))/0x2*(parseInt(_0x1b48b9(0x103))/0x3)+parseInt(_0x1b48b9(0xed))/0x4*(parseInt(_0x1b48b9(0x10c))/0x5)+parseInt(_0x1b48b9(0xfb))/0x6+-parseInt(_0x1b48b9(0x107))/0x7+parseInt(_0x1b48b9(0xfa))/0x8*(-parseInt(_0x1b48b9(0xf1))/0x9)+-parseInt(_0x1b48b9(0x104))/0xa*(-parseInt(_0x1b48b9(0xf0))/0xb);if(_0xea518b===_0x479dc)break;else _0x3c682d['push'](_0x3c682d['shift']());}catch(_0x3ac633){_0x3c682d['push'](_0x3c682d['shift']());}}}(a8_0x3920,0x3ba81));import{getCookie}from'../auth/get-cookie.js';function a8_0x3920(){const _0xf88f75=['UNAUTHORIZED','401','count','message','error','8vwSWPK','1569234JKRZJt','json','errorMessage','未知错误','info','includes','获取数据集失败:\x20','errorCode','1461VYyDFp','30RfUeNP','status','success','2323888UQKDsA','1126xGdNMA','configArray','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','Unauthorized','196950dXWLuL','&otype=array','fetch-model-list','255709wEjgOS','40epMLJE','errorMsg','正在从服务器拉取模型列表...\x20(环境:\x20','1788028fypmFy','331704TjVWjO','data','code','/api/node-toolbox/dataset/model-list?appcode='];a8_0x3920=function(){return _0xf88f75;};return a8_0x3920();}import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';function a8_0x5b4e(_0x4f599e,_0x3d9e2b){_0x4f599e=_0x4f599e-0xeb;const _0x392074=a8_0x3920();let _0x5b4e9f=_0x392074[_0x4f599e];return _0x5b4e9f;}import{getEnv}from'../constant/env.js';export async function fetchModelList(_0x40341e){const _0x131f8e=a8_0x5b4e,_0x375c5c=getEnv(),_0x1e5aab=getApiDomain()+_0x131f8e(0xf4)+_0x40341e+_0x131f8e(0x10d);logger[_0x131f8e(0xff)](_0x131f8e(0xeb),_0x131f8e(0xef)+_0x375c5c+')',{'apiUrl':_0x1e5aab});const _0x46e8ec=await fetch(_0x1e5aab,{'headers':{'Cookie':getCookie()}});if(!_0x46e8ec['ok']){if(_0x46e8ec['status']===0x191)throw new Error(_0x131f8e(0x10a));throw new Error('获取数据集失败,HTTP状态码:\x20'+_0x46e8ec[_0x131f8e(0x105)]);}const _0x6b7979=await _0x46e8ec[_0x131f8e(0xfc)]();if(!_0x6b7979[_0x131f8e(0x106)]){const _0x20cf55=_0x6b7979[_0x131f8e(0xee)]||_0x6b7979[_0x131f8e(0xf8)]||_0x6b7979[_0x131f8e(0xf2)]?.[_0x131f8e(0xf8)]||_0x6b7979[_0x131f8e(0xfd)]||_0x6b7979[_0x131f8e(0xf9)]||_0x131f8e(0xfe);if(_0x20cf55[_0x131f8e(0x100)](_0x131f8e(0xf6))||_0x20cf55[_0x131f8e(0x100)](_0x131f8e(0x10b))||_0x20cf55['includes']('登录')||_0x20cf55['includes']('认证')||_0x6b7979[_0x131f8e(0x102)]===_0x131f8e(0xf5)||_0x6b7979[_0x131f8e(0xf3)]===0x191||_0x6b7979[_0x131f8e(0xf3)]===_0x131f8e(0xf6))throw new Error('登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录');throw new Error(_0x131f8e(0x101)+_0x20cf55);}return{'configArray':_0x6b7979[_0x131f8e(0xf2)][_0x131f8e(0x109)],'count':_0x6b7979[_0x131f8e(0xf2)][_0x131f8e(0xf7)]};}
@@ -1 +1 @@
1
- (function(_0x169a35,_0x300039){const _0x13dc4d=a9_0x56fc,_0x38d2f8=_0x169a35();while(!![]){try{const _0x41829b=parseInt(_0x13dc4d(0x147))/0x1*(-parseInt(_0x13dc4d(0x141))/0x2)+parseInt(_0x13dc4d(0x130))/0x3*(-parseInt(_0x13dc4d(0x139))/0x4)+-parseInt(_0x13dc4d(0x145))/0x5*(parseInt(_0x13dc4d(0x132))/0x6)+-parseInt(_0x13dc4d(0x138))/0x7*(parseInt(_0x13dc4d(0x14c))/0x8)+-parseInt(_0x13dc4d(0x13f))/0x9+-parseInt(_0x13dc4d(0x134))/0xa*(-parseInt(_0x13dc4d(0x146))/0xb)+parseInt(_0x13dc4d(0x148))/0xc;if(_0x41829b===_0x300039)break;else _0x38d2f8['push'](_0x38d2f8['shift']());}catch(_0x50a4f1){_0x38d2f8['push'](_0x38d2f8['shift']());}}}(a9_0x135e,0xda354));import a9_0xf14f5f from'prettier';import{mkdirSync,writeFileSync,readFileSync}from'node:fs';import a9_0x4b4db7 from'node:path';import{fileURLToPath}from'node:url';function a9_0x135e(){const _0x20c156=[',\x20env:\x20\x22','78212TorLVK','datasetCode','init-api','templates/generate-api','26855UsedBF','22sTIJir','37YbKpov','43193508UsolXq','api','push','CONFIG_NAMES.DEFAULT','147848aHyUUO','API\x20文件生成成功!','alias','typescript','format','app','../..','-client','name','success','slice','-api','replaceApiContent','env','dirname','134715Dkybov','string','954ttUMOA','请先通过\x20`lovrabet\x20config\x20set\x20app\x20<value>`\x20配置应用\x20Code','5379510QeXWrL','{\x20apiConfigName:\x20\x22','utf8','join','406srrIkf','12wGqqJh','client.ts.tpl','tableName','api.ts.tpl','endsWith','.ts','2466513SUHDNn'];a9_0x135e=function(){return _0x20c156;};return a9_0x135e();}function a9_0x56fc(_0xa6300a,_0x359242){_0xa6300a=_0xa6300a-0x126;const _0x135edf=a9_0x135e();let _0x56fce0=_0x135edf[_0xa6300a];return _0x56fce0;}import{readConfig}from'../utils/config.js';import{TemplateReplacer}from'../utils/template-replacer.js';import{logger}from'../utils/logger.js';export async function generateApiFile(_0x361c75,_0x28f908='',_0x3348c7,_0x3d5d37=![],_0x4c8dc3,_0x1806f8='./src/api/'){const _0x4fc9e0=a9_0x56fc,_0x31900c=readConfig(),_0xc1455c=_0x3348c7||_0x31900c?.[_0x4fc9e0(0x126)];if(typeof _0xc1455c!==_0x4fc9e0(0x131)||!_0xc1455c)throw new Error(_0x4fc9e0(0x133));const _0x43f85a=_0x3d5d37?_0x4fc9e0(0x14b):'\x22'+_0xc1455c+'\x22',_0x2eb39f=typeof _0x31900c[_0x4fc9e0(0x12e)]==='string'?_0x31900c['env']:undefined,_0x5496f0=_0x4c8dc3||_0x2eb39f||'online',_0x8b85d=_0x5496f0!=='online';let _0x9d4fae;if(_0x3d5d37)_0x8b85d?_0x9d4fae='{\x20apiConfigName:\x20'+_0x43f85a+_0x4fc9e0(0x140)+_0x5496f0+'\x22\x20}':_0x9d4fae='';else{const _0xf524b9=_0x8b85d?_0x4fc9e0(0x140)+_0x5496f0+'\x22':'';_0x9d4fae=_0x4fc9e0(0x135)+_0xc1455c+'\x22'+_0xf524b9+'\x20}';}const _0x42e57a=_0x28f908?_0x28f908+_0x4fc9e0(0x12c):_0x4fc9e0(0x149),_0x1e48fc=_0x28f908?_0x28f908+_0x4fc9e0(0x128):'client',_0x3ddd9e=[];_0x361c75['forEach'](_0x2a5137=>{const _0x3b7a3a=_0x4fc9e0;_0x3ddd9e[_0x3b7a3a(0x14a)]({'datasetCode':_0x2a5137[_0x3b7a3a(0x142)],'tableName':_0x2a5137[_0x3b7a3a(0x13b)],'name':_0x2a5137[_0x3b7a3a(0x129)]||'','alias':_0x2a5137[_0x3b7a3a(0x14e)]||_0x2a5137['key']});});const _0x4629fb=fileURLToPath(import.meta.url),_0x3935ca=a9_0x4b4db7['resolve'](a9_0x4b4db7[_0x4fc9e0(0x12f)](_0x4629fb),_0x4fc9e0(0x127)),_0x2a632a=a9_0x4b4db7['join'](_0x3935ca,_0x4fc9e0(0x144)),_0x3a9284=a9_0x4b4db7[_0x4fc9e0(0x137)](_0x2a632a,_0x4fc9e0(0x13c)),_0x20f92e=a9_0x4b4db7[_0x4fc9e0(0x137)](_0x2a632a,_0x4fc9e0(0x13a)),_0x29bd36=_0x1806f8[_0x4fc9e0(0x13d)]('/')?_0x1806f8[_0x4fc9e0(0x12b)](0x0,-0x1):_0x1806f8;mkdirSync(_0x29bd36,{'recursive':!![]});const _0x53614a=_0x3ddd9e[0x0]?.[_0x4fc9e0(0x14e)],_0x46065b=readFileSync(_0x3a9284,_0x4fc9e0(0x136)),_0xe3315e=TemplateReplacer['replaceApiContent'](_0x46065b,_0xc1455c,_0x3ddd9e,_0x53614a,_0x42e57a,_0x43f85a),_0x561d27=await a9_0xf14f5f[_0x4fc9e0(0x150)](_0xe3315e,{'parser':'typescript'}),_0x2a28a3=_0x29bd36+'/'+_0x42e57a+_0x4fc9e0(0x13e);writeFileSync(_0x2a28a3,_0x561d27,{'encoding':_0x4fc9e0(0x136)});const _0x2b037d=readFileSync(_0x20f92e,_0x4fc9e0(0x136)),_0x29a699=TemplateReplacer[_0x4fc9e0(0x12d)](_0x2b037d,_0xc1455c,_0x3ddd9e,_0x53614a,_0x42e57a,_0x43f85a,_0x9d4fae),_0x1973df=await a9_0xf14f5f[_0x4fc9e0(0x150)](_0x29a699,{'parser':_0x4fc9e0(0x14f)}),_0x2be14e=_0x29bd36+'/'+_0x1e48fc+'.ts';writeFileSync(_0x2be14e,_0x1973df,{'encoding':_0x4fc9e0(0x136)});const _0x186bea=_0x3ddd9e['length'];return logger[_0x4fc9e0(0x12a)](_0x4fc9e0(0x143),_0x4fc9e0(0x14d),undefined,{'apiFile':_0x2a28a3,'clientFile':_0x2be14e,'modelCount':_0x186bea,'configName':_0x43f85a}),{'modelCount':_0x186bea,'apiFilePath':_0x2a28a3,'clientFilePath':_0x2be14e,'configName':_0x43f85a};}
1
+ const a9_0x196be4=a9_0x229c;(function(_0x2f99fd,_0x3cc7b0){const _0x5eca50=a9_0x229c,_0x5bc52b=_0x2f99fd();while(!![]){try{const _0x539c21=parseInt(_0x5eca50(0xbb))/0x1+-parseInt(_0x5eca50(0xa9))/0x2+parseInt(_0x5eca50(0xb4))/0x3*(-parseInt(_0x5eca50(0xb2))/0x4)+-parseInt(_0x5eca50(0xc0))/0x5+parseInt(_0x5eca50(0xaa))/0x6+parseInt(_0x5eca50(0xa8))/0x7+parseInt(_0x5eca50(0xb8))/0x8;if(_0x539c21===_0x3cc7b0)break;else _0x5bc52b['push'](_0x5bc52b['shift']());}catch(_0x228990){_0x5bc52b['push'](_0x5bc52b['shift']());}}}(a9_0x4011,0xab19b));import a9_0x532af1 from'prettier';import{mkdirSync,writeFileSync,readFileSync}from'node:fs';function a9_0x229c(_0x40328a,_0x2b2178){_0x40328a=_0x40328a-0x9b;const _0x4011ed=a9_0x4011();let _0x229cc9=_0x4011ed[_0x40328a];return _0x229cc9;}import a9_0x378595 from'node:path';function a9_0x4011(){const _0x511eda=['join','\x22\x20}','slice','templates/generate-api','dirname','api','utf8','env','1911805nUuOEq','505040TuRQQQ','2995302PBOrcr','.ts','online','string','init-api','CONFIG_NAMES.DEFAULT','app','success','66428lNwtEM','length','210GuLqdR','key','replaceApiContent','{\x20apiConfigName:\x20\x22','5045752cbfSux','API\x20文件生成成功!','format','1042411VtVQyz','./src/api/','client','{\x20apiConfigName:\x20','endsWith','1648125sPlSfL','alias','name','typescript','forEach','api.ts.tpl','push','tableName','datasetCode',',\x20env:\x20\x22'];a9_0x4011=function(){return _0x511eda;};return a9_0x4011();}import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';import{TemplateReplacer}from'../utils/template-replacer.js';import{logger}from'../utils/logger.js';export async function generateApiFile(_0xea4520,_0xf35f22='',_0x46f4ae,_0x5ca31f=![],_0x15850e,_0xe86f49=a9_0x196be4(0xbc)){const _0x12ded8=a9_0x196be4,_0x1261d6=readConfig(),_0x1781d3=_0x46f4ae||_0x1261d6?.[_0x12ded8(0xb0)];if(typeof _0x1781d3!==_0x12ded8(0xad)||!_0x1781d3)throw new Error('请先通过\x20`lovrabet\x20config\x20set\x20app\x20<value>`\x20配置应用\x20Code');const _0x57ef08=_0x5ca31f?_0x12ded8(0xaf):'\x22'+_0x1781d3+'\x22',_0x24b3eb=typeof _0x1261d6[_0x12ded8(0xa7)]==='string'?_0x1261d6[_0x12ded8(0xa7)]:undefined,_0x8398e0=_0x15850e||_0x24b3eb||_0x12ded8(0xac),_0x2e9a2e=_0x8398e0!==_0x12ded8(0xac);let _0x5b28b8;if(_0x5ca31f)_0x2e9a2e?_0x5b28b8=_0x12ded8(0xbe)+_0x57ef08+',\x20env:\x20\x22'+_0x8398e0+_0x12ded8(0xa1):_0x5b28b8='';else{const _0x21b918=_0x2e9a2e?_0x12ded8(0x9f)+_0x8398e0+'\x22':'';_0x5b28b8=_0x12ded8(0xb7)+_0x1781d3+'\x22'+_0x21b918+'\x20}';}const _0x280330=_0xf35f22?_0xf35f22+'-api':_0x12ded8(0xa5),_0x20a150=_0xf35f22?_0xf35f22+'-client':_0x12ded8(0xbd),_0x1f3b9e=[];_0xea4520[_0x12ded8(0xc4)](_0x80897f=>{const _0x1ba05e=_0x12ded8;_0x1f3b9e[_0x1ba05e(0x9c)]({'datasetCode':_0x80897f[_0x1ba05e(0x9e)],'tableName':_0x80897f[_0x1ba05e(0x9d)],'name':_0x80897f[_0x1ba05e(0xc2)]||'','alias':_0x80897f[_0x1ba05e(0xc1)]||_0x80897f[_0x1ba05e(0xb5)]});});const _0xa1806d=fileURLToPath(import.meta.url),_0x39658a=a9_0x378595['resolve'](a9_0x378595[_0x12ded8(0xa4)](_0xa1806d),'../..'),_0x56a179=a9_0x378595[_0x12ded8(0xa0)](_0x39658a,_0x12ded8(0xa3)),_0x38409a=a9_0x378595[_0x12ded8(0xa0)](_0x56a179,_0x12ded8(0x9b)),_0x5848c0=a9_0x378595[_0x12ded8(0xa0)](_0x56a179,'client.ts.tpl'),_0x292d3e=_0xe86f49[_0x12ded8(0xbf)]('/')?_0xe86f49[_0x12ded8(0xa2)](0x0,-0x1):_0xe86f49;mkdirSync(_0x292d3e,{'recursive':!![]});const _0x1ec6b4=_0x1f3b9e[0x0]?.[_0x12ded8(0xc1)],_0x37cc42=readFileSync(_0x38409a,_0x12ded8(0xa6)),_0x4a9a55=TemplateReplacer[_0x12ded8(0xb6)](_0x37cc42,_0x1781d3,_0x1f3b9e,_0x1ec6b4,_0x280330,_0x57ef08),_0x4cb27b=await a9_0x532af1[_0x12ded8(0xba)](_0x4a9a55,{'parser':'typescript'}),_0x2ceab5=_0x292d3e+'/'+_0x280330+_0x12ded8(0xab);writeFileSync(_0x2ceab5,_0x4cb27b,{'encoding':_0x12ded8(0xa6)});const _0x168ba7=readFileSync(_0x5848c0,_0x12ded8(0xa6)),_0x26fc94=TemplateReplacer[_0x12ded8(0xb6)](_0x168ba7,_0x1781d3,_0x1f3b9e,_0x1ec6b4,_0x280330,_0x57ef08,_0x5b28b8),_0x38425b=await a9_0x532af1['format'](_0x26fc94,{'parser':_0x12ded8(0xc3)}),_0x162c3d=_0x292d3e+'/'+_0x20a150+_0x12ded8(0xab);writeFileSync(_0x162c3d,_0x38425b,{'encoding':_0x12ded8(0xa6)});const _0x1fbd71=_0x1f3b9e[_0x12ded8(0xb3)];return logger[_0x12ded8(0xb1)](_0x12ded8(0xae),_0x12ded8(0xb9),undefined,{'apiFile':_0x2ceab5,'clientFile':_0x162c3d,'modelCount':_0x1fbd71,'configName':_0x57ef08}),{'modelCount':_0x1fbd71,'apiFilePath':_0x2ceab5,'clientFilePath':_0x162c3d,'configName':_0x57ef08};}
package/lib/api/main.js CHANGED
@@ -1 +1 @@
1
- function a10_0x3f48(_0x5487bd,_0x539cf5){_0x5487bd=_0x5487bd-0x104;const _0xe5ba3b=a10_0xe5ba();let _0x3f4844=_0xe5ba3b[_0x5487bd];return _0x3f4844;}(function(_0x31f7f5,_0x4fe2f6){const _0x83b2a=a10_0x3f48,_0x510fb5=_0x31f7f5();while(!![]){try{const _0x2fc15=-parseInt(_0x83b2a(0x135))/0x1*(-parseInt(_0x83b2a(0x11b))/0x2)+-parseInt(_0x83b2a(0x119))/0x3+parseInt(_0x83b2a(0x104))/0x4+-parseInt(_0x83b2a(0x10f))/0x5+-parseInt(_0x83b2a(0x12f))/0x6+parseInt(_0x83b2a(0x129))/0x7*(-parseInt(_0x83b2a(0x128))/0x8)+parseInt(_0x83b2a(0x120))/0x9;if(_0x2fc15===_0x4fe2f6)break;else _0x510fb5['push'](_0x510fb5['shift']());}catch(_0x5ec4d3){_0x510fb5['push'](_0x510fb5['shift']());}}}(a10_0xe5ba,0x1c6c0));import{jsx as a10_0x3ef92a}from'react/jsx-runtime';function a10_0xe5ba(){const _0x43b5df=['input','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','env','join','5gbQqbU','×\x20--params\x20参数不是有效的\x20JSON\x20格式','string','\x20\x20错误:\x20','output','177056hVEfhr','\x20\x20lovrabet\x20api\x20pull\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定输出目录(默认:\x20./src/api/)','\x20\x20lovrabet\x20api\x20pull\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)','flags','❌\x20错误:不再支持位置参数方式','\x1b[0m','\x1b[90m*\x20仅生成指定数据集的文档:\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配置文件','\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文档','filter','!\x20请使用以下方式之一:','1032735nKOSBQ','请使用\x20--appcode\x20参数,例如:','log','length','×\x20--datasetcode\x20参数不能为空','split','params','\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20pull\x20--appcode\x20<app-code>','\x20\x20lovrabet\x20api\x20doc\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定文档输出目录(默认:\x20./docs)','Unknown\x20api\x20command:\x20','385167LTZdLt','\x1b[90m*\x20使用配置的应用AppCode:\x20','73394YpsPQN','isArray','Available\x20commands:','object','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20','5997906vdcGir','error','\x0alovrabet\x20api\x20-\x20API\x20相关操作\x0a\x0a用法:\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20[options]\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20[options]\x0a\x0a选项:\x0a\x20\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20指定应用代码\x0a\x20\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20指定输出目录(pull:\x20./src/api/,doc:\x20./docs)\x0a\x20\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20指定环境(如:daily、online)\x0a\x20\x20--datasetcode\x20<codes>\x20指定要生成文档的数据集代码(多个用逗号分隔,仅\x20doc\x20命令)\x0a\x20\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20显示此帮助信息\x0a\x0a示例:\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20拉取并生成\x20API\x20配置文件\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--appcode\x20myapp\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--output\x20./api\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定输出目录\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--env\x20daily\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境拉取\x20API\x0a\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20生成所有数据集的文档\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--appcode\x20myapp\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--output\x20./docs\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定文档输出目录\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--env\x20daily\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境生成文档\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--datasetcode\x20ds_001\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20只生成指定数据集的文档\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--datasetcode\x20ds_001,ds_002\x20\x20\x20\x20\x20\x20//\x20生成多个数据集的文档\x0a','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20','parse','doc','\x20\x20\x201.\x20配置默认值:\x20lovrabet\x20config\x20set\x20appcode\x20<app-code>','message','8gJnOIX','1621977YJyhia','trim','×\x20未配置\x20AppCode','×\x20--params\x20参数必须是一个有效的\x20JSON\x20对象','appcode','help','1266720BfXMOg','exit'];a10_0xe5ba=function(){return _0x43b5df;};return a10_0xe5ba();}import{render}from'ink';import{ApiPullUI}from'./api-pull-ui.js';import{ApiDocUI}from'./api-doc-ui.js';import{getConfigAppCode}from'../utils/config.js';export async function apiCli(_0x454e21){const _0x1a81d3=a10_0x3f48,_0x2da73d=_0x454e21[_0x1a81d3(0x131)][0x1];if(_0x454e21[_0x1a81d3(0x107)][_0x1a81d3(0x12e)]){console[_0x1a81d3(0x111)](_0x1a81d3(0x122));return;}if(_0x2da73d==='pull'){_0x454e21[_0x1a81d3(0x131)][0x2]&&(console['error'](_0x1a81d3(0x108)),console[_0x1a81d3(0x111)](_0x1a81d3(0x110)),console['log'](_0x1a81d3(0x123)+_0x454e21[_0x1a81d3(0x131)][0x2]),process['exit'](0x1));const _0x5bbcf8=getConfigAppCode();let _0x4d7c44=_0x454e21[_0x1a81d3(0x107)][_0x1a81d3(0x12d)];const _0x2a21a7=typeof _0x454e21[_0x1a81d3(0x107)][_0x1a81d3(0x133)]===_0x1a81d3(0x137)?_0x454e21[_0x1a81d3(0x107)][_0x1a81d3(0x133)]:undefined,_0x40999e=_0x454e21[_0x1a81d3(0x107)][_0x1a81d3(0x139)];!_0x4d7c44&&!_0x5bbcf8&&(console[_0x1a81d3(0x121)]('×\x20未配置\x20AppCode'),console[_0x1a81d3(0x111)](_0x1a81d3(0x10e)),console[_0x1a81d3(0x111)](_0x1a81d3(0x126)),console[_0x1a81d3(0x111)](_0x1a81d3(0x116)),process[_0x1a81d3(0x130)](0x1)),_0x4d7c44&&_0x5bbcf8&&_0x4d7c44===_0x5bbcf8&&(console['log'](_0x1a81d3(0x11a)+_0x4d7c44+'\x1b[0m'),console[_0x1a81d3(0x111)]('\x1b[90m\x20\x20(注:\x20--appcode\x20参数与配置一致,将使用默认配置)\x1b[0m'),_0x4d7c44=undefined),render(a10_0x3ef92a(ApiPullUI,{'appCode':_0x4d7c44,'env':_0x2a21a7,'output':_0x40999e}));}else{if(_0x2da73d===_0x1a81d3(0x125)){_0x454e21[_0x1a81d3(0x131)][0x2]&&(console[_0x1a81d3(0x121)](_0x1a81d3(0x108)),console[_0x1a81d3(0x111)](_0x1a81d3(0x110)),console[_0x1a81d3(0x111)](_0x1a81d3(0x11f)+_0x454e21[_0x1a81d3(0x131)][0x2]),process['exit'](0x1));const _0x7bdb61=getConfigAppCode();let _0x24e2e4=_0x454e21[_0x1a81d3(0x107)]['appcode'];const _0x2dc34f=typeof _0x454e21[_0x1a81d3(0x107)][_0x1a81d3(0x133)]===_0x1a81d3(0x137)?_0x454e21[_0x1a81d3(0x107)][_0x1a81d3(0x133)]:undefined,_0x34cd92=_0x454e21[_0x1a81d3(0x107)][_0x1a81d3(0x139)],_0x3820e1=_0x454e21[_0x1a81d3(0x107)][_0x1a81d3(0x115)],_0x151e75=_0x454e21['flags']['datasetcode'];!_0x24e2e4&&!_0x7bdb61&&(console[_0x1a81d3(0x121)](_0x1a81d3(0x12b)),console[_0x1a81d3(0x111)]('!\x20请使用以下方式之一:'),console[_0x1a81d3(0x111)]('\x20\x20\x201.\x20配置默认值:\x20lovrabet\x20config\x20set\x20appcode\x20<app-code>'),console[_0x1a81d3(0x111)]('\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20doc\x20--appcode\x20<app-code>'),process[_0x1a81d3(0x130)](0x1));_0x24e2e4&&_0x7bdb61&&_0x24e2e4===_0x7bdb61&&(console[_0x1a81d3(0x111)](_0x1a81d3(0x11a)+_0x24e2e4+_0x1a81d3(0x109)),_0x24e2e4=undefined);let _0x36b7d1;if(_0x3820e1)try{_0x36b7d1=JSON[_0x1a81d3(0x124)](_0x3820e1),(typeof _0x36b7d1!==_0x1a81d3(0x11e)||_0x36b7d1===null||Array[_0x1a81d3(0x11c)](_0x36b7d1))&&(console[_0x1a81d3(0x121)](_0x1a81d3(0x12c)),process[_0x1a81d3(0x130)](0x1));}catch(_0x56c6b1){console[_0x1a81d3(0x121)](_0x1a81d3(0x136)),console[_0x1a81d3(0x121)](_0x1a81d3(0x138)+(_0x56c6b1 instanceof Error?_0x56c6b1[_0x1a81d3(0x127)]:String(_0x56c6b1))),process[_0x1a81d3(0x130)](0x1);}let _0x301c15;_0x151e75&&(_0x301c15=_0x151e75[_0x1a81d3(0x114)](',')['map'](_0x31784d=>_0x31784d[_0x1a81d3(0x12a)]())[_0x1a81d3(0x10d)](_0x38f280=>_0x38f280[_0x1a81d3(0x112)]>0x0),_0x301c15[_0x1a81d3(0x112)]===0x0&&(console[_0x1a81d3(0x121)](_0x1a81d3(0x113)),process['exit'](0x1)),console[_0x1a81d3(0x111)](_0x1a81d3(0x10a)+_0x301c15[_0x1a81d3(0x134)](',\x20')+_0x1a81d3(0x109))),render(a10_0x3ef92a(ApiDocUI,{'appCode':_0x24e2e4,'env':_0x2dc34f,'output':_0x34cd92,'extraParams':_0x36b7d1,'datasetCodes':_0x301c15}));}else console[_0x1a81d3(0x121)](_0x1a81d3(0x118)+_0x2da73d),console[_0x1a81d3(0x111)](_0x1a81d3(0x11d)),console[_0x1a81d3(0x111)](_0x1a81d3(0x10b)),console[_0x1a81d3(0x111)]('\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode'),console[_0x1a81d3(0x111)](_0x1a81d3(0x105)),console[_0x1a81d3(0x111)](_0x1a81d3(0x106)),console[_0x1a81d3(0x111)](''),console[_0x1a81d3(0x111)](_0x1a81d3(0x10c)),console[_0x1a81d3(0x111)](_0x1a81d3(0x132)),console['log'](_0x1a81d3(0x117)),console['log']('\x20\x20lovrabet\x20api\x20doc\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)'),process['exit'](0x1);}}
1
+ (function(_0x5749fe,_0x564199){const _0x5446ca=a10_0x23bb,_0x5d01fd=_0x5749fe();while(!![]){try{const _0xe0b046=parseInt(_0x5446ca(0x154))/0x1*(parseInt(_0x5446ca(0x139))/0x2)+-parseInt(_0x5446ca(0x129))/0x3+-parseInt(_0x5446ca(0x126))/0x4*(parseInt(_0x5446ca(0x13b))/0x5)+parseInt(_0x5446ca(0x134))/0x6*(parseInt(_0x5446ca(0x13e))/0x7)+-parseInt(_0x5446ca(0x135))/0x8+parseInt(_0x5446ca(0x12f))/0x9*(parseInt(_0x5446ca(0x144))/0xa)+-parseInt(_0x5446ca(0x133))/0xb*(-parseInt(_0x5446ca(0x124))/0xc);if(_0xe0b046===_0x564199)break;else _0x5d01fd['push'](_0x5d01fd['shift']());}catch(_0x39ca2c){_0x5d01fd['push'](_0x5d01fd['shift']());}}}(a10_0x36a5,0xa6097));import{jsx as a10_0x77e1b0}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_0x23bb(_0x13ebf2,_0x21ca37){_0x13ebf2=_0x13ebf2-0x11e;const _0x36a540=a10_0x36a5();let _0x23bb4e=_0x36a540[_0x13ebf2];return _0x23bb4e;}export async function apiCli(_0x11558b){const _0x1812ac=a10_0x23bb,_0x234eb0=_0x11558b[_0x1812ac(0x12d)][0x1];if(_0x11558b[_0x1812ac(0x141)]['help']){console[_0x1812ac(0x149)](_0x1812ac(0x142));return;}if(_0x234eb0===_0x1812ac(0x14d)){_0x11558b[_0x1812ac(0x12d)][0x2]&&(console[_0x1812ac(0x137)](_0x1812ac(0x14a)),console[_0x1812ac(0x149)](_0x1812ac(0x150)),console['log'](_0x1812ac(0x12e)+_0x11558b[_0x1812ac(0x12d)][0x2]),process['exit'](0x1));const _0x5d2af6=getConfigAppCode();let _0x37016c=_0x11558b[_0x1812ac(0x141)][_0x1812ac(0x13c)];const _0x4f4eb0=typeof _0x11558b[_0x1812ac(0x141)][_0x1812ac(0x130)]===_0x1812ac(0x13d)?_0x11558b[_0x1812ac(0x141)][_0x1812ac(0x130)]:undefined,_0x5c4ca7=_0x11558b[_0x1812ac(0x141)][_0x1812ac(0x151)];!_0x37016c&&!_0x5d2af6&&(console[_0x1812ac(0x137)](_0x1812ac(0x123)),console['log'](_0x1812ac(0x152)),console['log']('\x20\x20\x201.\x20配置默认值:\x20lovrabet\x20config\x20set\x20appcode\x20<app-code>'),console[_0x1812ac(0x149)](_0x1812ac(0x132)),process[_0x1812ac(0x138)](0x1)),_0x37016c&&_0x5d2af6&&_0x37016c===_0x5d2af6&&(console[_0x1812ac(0x149)]('\x1b[90m*\x20使用配置的应用AppCode:\x20'+_0x37016c+_0x1812ac(0x12b)),console[_0x1812ac(0x149)](_0x1812ac(0x14c)),_0x37016c=undefined),render(a10_0x77e1b0(ApiPullUI,{'appCode':_0x37016c,'env':_0x4f4eb0,'output':_0x5c4ca7}));}else{if(_0x234eb0===_0x1812ac(0x146)){_0x11558b[_0x1812ac(0x12d)][0x2]&&(console[_0x1812ac(0x137)](_0x1812ac(0x14a)),console[_0x1812ac(0x149)](_0x1812ac(0x150)),console[_0x1812ac(0x149)](_0x1812ac(0x14f)+_0x11558b[_0x1812ac(0x12d)][0x2]),process[_0x1812ac(0x138)](0x1));const _0x5a5854=getConfigAppCode();let _0x41bead=_0x11558b[_0x1812ac(0x141)][_0x1812ac(0x13c)];const _0x43cb7b=typeof _0x11558b[_0x1812ac(0x141)][_0x1812ac(0x130)]===_0x1812ac(0x13d)?_0x11558b[_0x1812ac(0x141)]['env']:undefined,_0x3cd5c8=_0x11558b[_0x1812ac(0x141)][_0x1812ac(0x151)],_0x982098=_0x11558b['flags'][_0x1812ac(0x148)],_0x29833e=_0x11558b[_0x1812ac(0x141)][_0x1812ac(0x131)];!_0x41bead&&!_0x5a5854&&(console['error']('×\x20未配置\x20AppCode'),console[_0x1812ac(0x149)](_0x1812ac(0x152)),console['log'](_0x1812ac(0x136)),console[_0x1812ac(0x149)](_0x1812ac(0x120)),process[_0x1812ac(0x138)](0x1));_0x41bead&&_0x5a5854&&_0x41bead===_0x5a5854&&(console[_0x1812ac(0x149)](_0x1812ac(0x155)+_0x41bead+_0x1812ac(0x12b)),_0x41bead=undefined);let _0x4e114e;if(_0x982098)try{_0x4e114e=JSON[_0x1812ac(0x153)](_0x982098),(typeof _0x4e114e!==_0x1812ac(0x11f)||_0x4e114e===null||Array[_0x1812ac(0x11e)](_0x4e114e))&&(console[_0x1812ac(0x137)](_0x1812ac(0x128)),process[_0x1812ac(0x138)](0x1));}catch(_0x27e0eb){console['error'](_0x1812ac(0x156)),console[_0x1812ac(0x137)](_0x1812ac(0x12a)+(_0x27e0eb instanceof Error?_0x27e0eb[_0x1812ac(0x127)]:String(_0x27e0eb))),process[_0x1812ac(0x138)](0x1);}let _0x77ed8d;_0x29833e&&(_0x77ed8d=_0x29833e[_0x1812ac(0x125)](',')['map'](_0x19e30d=>_0x19e30d['trim']())[_0x1812ac(0x14b)](_0x399f9d=>_0x399f9d[_0x1812ac(0x143)]>0x0),_0x77ed8d['length']===0x0&&(console[_0x1812ac(0x137)]('×\x20--datasetcode\x20参数不能为空'),process['exit'](0x1)),console[_0x1812ac(0x149)](_0x1812ac(0x14e)+_0x77ed8d[_0x1812ac(0x12c)](',\x20')+_0x1812ac(0x12b))),render(a10_0x77e1b0(ApiDocUI,{'appCode':_0x41bead,'env':_0x43cb7b,'output':_0x3cd5c8,'extraParams':_0x4e114e,'datasetCodes':_0x77ed8d}));}else console[_0x1812ac(0x137)](_0x1812ac(0x121)+_0x234eb0),console['log']('Available\x20commands:'),console[_0x1812ac(0x149)](_0x1812ac(0x122)),console[_0x1812ac(0x149)](_0x1812ac(0x13f)),console['log'](_0x1812ac(0x13a)),console[_0x1812ac(0x149)]('\x20\x20lovrabet\x20api\x20pull\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)'),console[_0x1812ac(0x149)](''),console[_0x1812ac(0x149)](_0x1812ac(0x140)),console[_0x1812ac(0x149)](_0x1812ac(0x147)),console[_0x1812ac(0x149)]('\x20\x20lovrabet\x20api\x20doc\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定文档输出目录(默认:\x20./docs)'),console['log'](_0x1812ac(0x145)),process[_0x1812ac(0x138)](0x1);}}function a10_0x36a5(){const _0x1ec140=['2550tVeyDf','\x20\x20lovrabet\x20api\x20doc\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)','doc','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','params','log','❌\x20错误:不再支持位置参数方式','filter','\x1b[90m\x20\x20(注:\x20--appcode\x20参数与配置一致,将使用默认配置)\x1b[0m','pull','\x1b[90m*\x20仅生成指定数据集的文档:\x20','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20','请使用\x20--appcode\x20参数,例如:','output','!\x20请使用以下方式之一:','parse','12jwXUOj','\x1b[90m*\x20使用配置的应用AppCode:\x20','×\x20--params\x20参数不是有效的\x20JSON\x20格式','isArray','object','\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20doc\x20--appcode\x20<app-code>','Unknown\x20api\x20command:\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配置文件','×\x20未配置\x20AppCode','48VFiurI','split','3385436pLJqEp','message','×\x20--params\x20参数必须是一个有效的\x20JSON\x20对象','2275596RIFGsO','\x20\x20错误:\x20','\x1b[0m','join','input','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20','17217HtAbaM','env','datasetcode','\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20pull\x20--appcode\x20<app-code>','4577485SpIAVE','66NrLDFW','6549168GvpfHA','\x20\x20\x201.\x20配置默认值:\x20lovrabet\x20config\x20set\x20appcode\x20<app-code>','error','exit','68178RdWUvl','\x20\x20lovrabet\x20api\x20pull\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定输出目录(默认:\x20./src/api/)','5KuagsW','appcode','string','345037SpUwHw','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','\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文档','flags','\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','length'];a10_0x36a5=function(){return _0x1ec140;};return a10_0x36a5();}