@lovrabet/cli 1.3.2-beta.0 → 1.3.2-beta.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 (80) hide show
  1. package/lib/add-page/input-page-router.js +1 -1
  2. package/lib/add-page/main.js +1 -1
  3. package/lib/add-page/select-page-template.js +1 -1
  4. package/lib/ai-setup/AISetupUI.js +1 -1
  5. package/lib/ai-setup/config.js +1 -1
  6. package/lib/api/api-doc-ui.js +1 -1
  7. package/lib/api/api-doc.js +1 -1
  8. package/lib/api/api-pull-ui.js +1 -1
  9. package/lib/api/fetch-model-list.js +1 -1
  10. package/lib/api/generate-api-file.js +1 -1
  11. package/lib/api/main.js +1 -1
  12. package/lib/api/pull-silent.js +1 -1
  13. package/lib/app-menu/app-menu-sync-ui.js +1 -1
  14. package/lib/app-menu/create-menu.js +1 -1
  15. package/lib/app-menu/get-local-pages.js +1 -1
  16. package/lib/app-menu/get-online-menu-list.js +1 -1
  17. package/lib/app-menu/use-get-online-menu-list.js +1 -1
  18. package/lib/app-menu/utils.js +1 -1
  19. package/lib/app-menu/valid-url.js +1 -1
  20. package/lib/app-menu-update-cdn/current-content.js +1 -1
  21. package/lib/app-menu-update-cdn/input-cdn-asset.js +1 -1
  22. package/lib/app-menu-update-cdn/main.js +1 -1
  23. package/lib/app-menu-update-cdn/update-menu-cdn-url.js +1 -1
  24. package/lib/auth/auth-server-ui.js +1 -1
  25. package/lib/auth/auth-server.js +1 -1
  26. package/lib/auth/constant.js +1 -1
  27. package/lib/auth/get-cookie.js +1 -1
  28. package/lib/auth/is-session-valid.js +1 -1
  29. package/lib/auth/logout.js +1 -1
  30. package/lib/cli-flags.js +1 -1
  31. package/lib/cli.js +1 -1
  32. package/lib/cmd/build-watch.js +1 -1
  33. package/lib/cmd/build.js +1 -1
  34. package/lib/cmd/logs.js +1 -1
  35. package/lib/cmd/preview.js +1 -1
  36. package/lib/cmd/start.js +1 -1
  37. package/lib/config/config-help.js +1 -1
  38. package/lib/config/main.js +1 -1
  39. package/lib/constant/domain.js +1 -1
  40. package/lib/constant/env.js +1 -1
  41. package/lib/create-app/enhanced-guided-create.js +1 -1
  42. package/lib/create-app/format-elapsed.js +1 -1
  43. package/lib/create-app/main.js +1 -1
  44. package/lib/create-app/non-interactive.js +1 -1
  45. package/lib/create-app/task-finished.js +1 -1
  46. package/lib/create-app/task-loading.js +1 -1
  47. package/lib/create-app/task-running.js +1 -1
  48. package/lib/create-app/task-time.js +1 -1
  49. package/lib/create-app/use-copy-project-template.js +1 -1
  50. package/lib/create-app/use-format-code.js +1 -1
  51. package/lib/create-app/use-install-dependencies.js +1 -1
  52. package/lib/help.js +1 -1
  53. package/lib/init/main.js +1 -1
  54. package/lib/mcp/McpInstallUI.js +1 -1
  55. package/lib/mcp/claude.js +1 -1
  56. package/lib/mcp/cursor.js +1 -1
  57. package/lib/mcp/main.js +1 -1
  58. package/lib/mcp/mcp-install-non-interactive.js +1 -1
  59. package/lib/mcp/mcp-installer.js +1 -1
  60. package/lib/skills/SkillInstallUI.js +1 -1
  61. package/lib/skills/main.js +1 -1
  62. package/lib/skills/skill-install-non-interactive.js +1 -1
  63. package/lib/skills/skill-installer.js +1 -1
  64. package/lib/ui/IDESelector.js +1 -1
  65. package/lib/ui/useIDESelection.js +1 -1
  66. package/lib/utils/ai_config.js +1 -1
  67. package/lib/utils/cdn-config.js +1 -1
  68. package/lib/utils/check-sdk-version.js +1 -1
  69. package/lib/utils/cli-version-check.js +1 -1
  70. package/lib/utils/config.js +1 -1
  71. package/lib/utils/copy-directory.js +1 -1
  72. package/lib/utils/file-utils.js +1 -1
  73. package/lib/utils/guides-cdn.js +1 -1
  74. package/lib/utils/http-client.js +1 -1
  75. package/lib/utils/logger.js +1 -1
  76. package/lib/utils/router-updater.js +1 -1
  77. package/lib/utils/rules-cdn.js +1 -1
  78. package/lib/utils/sleep.js +1 -1
  79. package/lib/utils/template-replacer.js +1 -1
  80. package/package.json +1 -1
@@ -1 +1 @@
1
- (function(_0xbd8f1c,_0x38084d){const _0x1c4594=a0_0x14d5,_0x3eea65=_0xbd8f1c();while(!![]){try{const _0x10a6a7=-parseInt(_0x1c4594(0x1e7))/0x1+-parseInt(_0x1c4594(0x1e9))/0x2*(-parseInt(_0x1c4594(0x1d1))/0x3)+parseInt(_0x1c4594(0x1d7))/0x4+parseInt(_0x1c4594(0x1e1))/0x5*(-parseInt(_0x1c4594(0x1ee))/0x6)+parseInt(_0x1c4594(0x1d3))/0x7*(-parseInt(_0x1c4594(0x1dd))/0x8)+parseInt(_0x1c4594(0x1ea))/0x9+parseInt(_0x1c4594(0x1e3))/0xa*(parseInt(_0x1c4594(0x1cf))/0xb);if(_0x10a6a7===_0x38084d)break;else _0x3eea65['push'](_0x3eea65['shift']());}catch(_0x5f4027){_0x3eea65['push'](_0x3eea65['shift']());}}}(a0_0x54b9,0xa53a4));import{jsx as a0_0x1cd234,jsxs as a0_0x56735e}from'react/jsx-runtime';function a0_0x14d5(_0x2b3a70,_0x16cf1a){_0x2b3a70=_0x2b3a70-0x1cc;const _0x54b9f6=a0_0x54b9();let _0x14d57f=_0x54b9f6[_0x2b3a70];return _0x14d57f;}import{useState}from'react';import{Text,Box,useInput}from'ink';import a0_0x2a90b8 from'node:fs';function a0_0x54b9(){const _0x38b9ce=['页面路由地址:\x20','30sYANCC','页面路径\x20','\x20直接回车确认,或输入自定义路由地址','return','614714QzIpaX','slice','4FFxOgT','3800871wlSPku','路径中的每个段只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','backspace','column','6OHYSOk','existsSync','includes','\x20Step2:\x20','4368397mmfita','路径不能以\x20/\x20开头或结尾','523959ckLmrw','green','3787diSItn','length','\x20已存在,请使用其他路径','trim','1899864BFQLHs','页面路径长度不能超过\x20100\x20个字符','my-page','页面路径不合法','gray','路径不能包含连续的\x20/','4528lSbkwx','startsWith','delete','endsWith','4201400ZjFZMz'];a0_0x54b9=function(){return _0x38b9ce;};return a0_0x54b9();}export function InputProjectCode(_0x25779c){const _0x4bacc2=a0_0x14d5,{onSubmit:_0x30d9d0,pagePath:_0x25d575}=_0x25779c,[_0x2c89ca,_0x207a95]=useState(''),[_0x1e2a9e,_0x227abf]=useState(''),_0x5046d3=_0x4bacc2(0x1d9);function _0x5e0ebf(_0x25fdc6){const _0x280206=_0x4bacc2;if(_0x25fdc6[_0x280206(0x1d4)]>0x64)return{'valid':![],'message':_0x280206(0x1d8)};if(_0x25fdc6[_0x280206(0x1de)]('/')||_0x25fdc6[_0x280206(0x1e0)]('/'))return{'valid':![],'message':_0x280206(0x1d0)};if(_0x25fdc6[_0x280206(0x1cd)]('//'))return{'valid':![],'message':_0x280206(0x1dc)};const _0x22b493=_0x25fdc6['split']('/');for(const _0x23c915 of _0x22b493){if(!_0x23c915)continue;const _0x436c83=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(!_0x436c83['test'](_0x23c915))return{'valid':![],'message':_0x280206(0x1eb)};}return{'valid':!![]};}return useInput((_0x1a668e,_0x4ba762)=>{const _0x1a4935=_0x4bacc2;if(_0x4ba762[_0x1a4935(0x1e6)]){const _0xa0300b=_0x2c89ca[_0x1a4935(0x1d6)]()||_0x5046d3;if(_0x1e2a9e)return;const _0x1850a8=_0x25d575+'/'+_0xa0300b;if(a0_0x2a90b8[_0x1a4935(0x1cc)](_0x1850a8)){_0x227abf(_0x1a4935(0x1e4)+_0xa0300b+_0x1a4935(0x1d5));return;}_0x30d9d0(_0xa0300b),_0x207a95(''),_0x227abf('');}else _0x4ba762[_0x1a4935(0x1ec)]||_0x4ba762[_0x1a4935(0x1df)]?_0x207a95(_0x3676b8=>{const _0x47ec17=_0x1a4935,_0x10a8e=_0x3676b8[_0x47ec17(0x1e8)](0x0,-0x1),{valid:_0x559b70,message:_0x33cc65}=_0x5e0ebf(_0x10a8e);return _0x227abf(_0x559b70?'':_0x33cc65||'页面路径不合法'),_0x10a8e;}):_0x207a95(_0x2e7c94=>{const _0x4a4c82=_0x1a4935,_0x325487=_0x2e7c94+_0x1a668e,{valid:_0x18734d,message:_0x353a1e}=_0x5e0ebf(_0x325487);return _0x227abf(_0x18734d?'':_0x353a1e||_0x4a4c82(0x1da)),_0x325487;});}),a0_0x56735e(Box,{'flexDirection':_0x4bacc2(0x1ed),'children':[a0_0x56735e(Box,{'children':[a0_0x1cd234(Text,{'color':_0x4bacc2(0x1db),'children':_0x4bacc2(0x1ce)}),a0_0x1cd234(Text,{'children':_0x4bacc2(0x1e2)}),_0x2c89ca?a0_0x1cd234(Text,{'color':_0x4bacc2(0x1d2),'children':_0x2c89ca}):a0_0x1cd234(Text,{'color':_0x4bacc2(0x1db),'children':_0x5046d3}),_0x1e2a9e&&a0_0x56735e(Text,{'color':'red','children':['\x20←\x20',_0x1e2a9e]})]}),!_0x1e2a9e&&!_0x2c89ca&&a0_0x1cd234(Box,{'children':a0_0x1cd234(Text,{'color':_0x4bacc2(0x1db),'children':_0x4bacc2(0x1e5)})})]});}
1
+ (function(_0x3609f7,_0x1c8d35){const _0x8c5687=a0_0x55aa,_0x275288=_0x3609f7();while(!![]){try{const _0x52e816=-parseInt(_0x8c5687(0xd3))/0x1+-parseInt(_0x8c5687(0xe1))/0x2*(-parseInt(_0x8c5687(0xe3))/0x3)+-parseInt(_0x8c5687(0xc9))/0x4*(-parseInt(_0x8c5687(0xdc))/0x5)+parseInt(_0x8c5687(0xdb))/0x6*(parseInt(_0x8c5687(0xe0))/0x7)+parseInt(_0x8c5687(0xcd))/0x8+parseInt(_0x8c5687(0xd2))/0x9+-parseInt(_0x8c5687(0xcf))/0xa*(parseInt(_0x8c5687(0xd0))/0xb);if(_0x52e816===_0x1c8d35)break;else _0x275288['push'](_0x275288['shift']());}catch(_0x21c8b8){_0x275288['push'](_0x275288['shift']());}}}(a0_0x9f93,0xd31b9));function a0_0x55aa(_0x208151,_0x56f2c1){_0x208151=_0x208151-0xc8;const _0x9f93e2=a0_0x9f93();let _0x55aa02=_0x9f93e2[_0x208151];return _0x55aa02;}import{jsx as a0_0x66fcba,jsxs as a0_0x20be13}from'react/jsx-runtime';import{useState}from'react';function a0_0x9f93(){const _0x9cdc2b=['页面路径不合法','页面路径\x20','路径不能包含连续的\x20/','delete','green','152982NucZZt','75FKSWsX','页面路径长度不能超过\x20100\x20个字符','trim','column','259uOevHg','3065182mGHgvN','startsWith','3EkWZlg','路径不能以\x20/\x20开头或结尾','路径中的每个段只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','slice','includes','existsSync','red','254028rFJjWc','length','endsWith','backspace','11268200qsUNqV','test','30xglqdp','15828791hhrHNS','split','6686226DtdHTn','398384takmVj','return','gray'];a0_0x9f93=function(){return _0x9cdc2b;};return a0_0x9f93();}import{Text,Box,useInput}from'ink';import a0_0x358fbc from'node:fs';export function InputProjectCode(_0x3b6f67){const _0xa266c7=a0_0x55aa,{onSubmit:_0x4a01db,pagePath:_0xf1d5ea}=_0x3b6f67,[_0x384fac,_0x4b140d]=useState(''),[_0x29bca9,_0x10c5c1]=useState(''),_0x2a8d4e='my-page';function _0x5e27b6(_0x2151dc){const _0x4a6503=a0_0x55aa;if(_0x2151dc[_0x4a6503(0xca)]>0x64)return{'valid':![],'message':_0x4a6503(0xdd)};if(_0x2151dc[_0x4a6503(0xe2)]('/')||_0x2151dc[_0x4a6503(0xcb)]('/'))return{'valid':![],'message':_0x4a6503(0xe4)};if(_0x2151dc[_0x4a6503(0xe7)]('//'))return{'valid':![],'message':_0x4a6503(0xd8)};const _0x368ecc=_0x2151dc[_0x4a6503(0xd1)]('/');for(const _0x38a35b of _0x368ecc){if(!_0x38a35b)continue;const _0x5c233a=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(!_0x5c233a[_0x4a6503(0xce)](_0x38a35b))return{'valid':![],'message':_0x4a6503(0xe5)};}return{'valid':!![]};}return useInput((_0x4f6e23,_0x746a77)=>{const _0x2d838a=a0_0x55aa;if(_0x746a77[_0x2d838a(0xd4)]){const _0x428761=_0x384fac[_0x2d838a(0xde)]()||_0x2a8d4e;if(_0x29bca9)return;const _0x337346=_0xf1d5ea+'/'+_0x428761;if(a0_0x358fbc[_0x2d838a(0xe8)](_0x337346)){_0x10c5c1(_0x2d838a(0xd7)+_0x428761+'\x20已存在,请使用其他路径');return;}_0x4a01db(_0x428761),_0x4b140d(''),_0x10c5c1('');}else _0x746a77[_0x2d838a(0xcc)]||_0x746a77[_0x2d838a(0xd9)]?_0x4b140d(_0x3a09f8=>{const _0x13abab=_0x2d838a,_0x25332e=_0x3a09f8[_0x13abab(0xe6)](0x0,-0x1),{valid:_0x1bc795,message:_0x4f821b}=_0x5e27b6(_0x25332e);return _0x10c5c1(_0x1bc795?'':_0x4f821b||'页面路径不合法'),_0x25332e;}):_0x4b140d(_0x3b36e4=>{const _0x2dac0c=_0x2d838a,_0x17fa08=_0x3b36e4+_0x4f6e23,{valid:_0x4a16bb,message:_0x276b62}=_0x5e27b6(_0x17fa08);return _0x10c5c1(_0x4a16bb?'':_0x276b62||_0x2dac0c(0xd6)),_0x17fa08;});}),a0_0x20be13(Box,{'flexDirection':_0xa266c7(0xdf),'children':[a0_0x20be13(Box,{'children':[a0_0x66fcba(Text,{'color':_0xa266c7(0xd5),'children':'\x20Step2:\x20'}),a0_0x66fcba(Text,{'children':'页面路由地址:\x20'}),_0x384fac?a0_0x66fcba(Text,{'color':_0xa266c7(0xda),'children':_0x384fac}):a0_0x66fcba(Text,{'color':'gray','children':_0x2a8d4e}),_0x29bca9&&a0_0x20be13(Text,{'color':_0xa266c7(0xc8),'children':['\x20←\x20',_0x29bca9]})]}),!_0x29bca9&&!_0x384fac&&a0_0x66fcba(Box,{'children':a0_0x66fcba(Text,{'color':_0xa266c7(0xd5),'children':'\x20直接回车确认,或输入自定义路由地址'})})]});}
@@ -1 +1 @@
1
- const a1_0x26e9cd=a1_0x3574;(function(_0x2112a1,_0x42c9bf){const _0x2ae1f6=a1_0x3574,_0x11fc17=_0x2112a1();while(!![]){try{const _0x580567=-parseInt(_0x2ae1f6(0x12f))/0x1+-parseInt(_0x2ae1f6(0x132))/0x2*(parseInt(_0x2ae1f6(0x136))/0x3)+-parseInt(_0x2ae1f6(0x129))/0x4*(-parseInt(_0x2ae1f6(0x120))/0x5)+parseInt(_0x2ae1f6(0x11b))/0x6+parseInt(_0x2ae1f6(0x134))/0x7+parseInt(_0x2ae1f6(0x119))/0x8*(-parseInt(_0x2ae1f6(0x12d))/0x9)+parseInt(_0x2ae1f6(0x12a))/0xa;if(_0x580567===_0x42c9bf)break;else _0x11fc17['push'](_0x11fc17['shift']());}catch(_0x54407c){_0x11fc17['push'](_0x11fc17['shift']());}}}(a1_0xa1fb,0x39bc3));import{jsx as a1_0x590822,jsxs as a1_0x106863,Fragment as a1_0x18ddb6}from'react/jsx-runtime';import{fileURLToPath}from'node:url';import a1_0x327063 from'node:path';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{SelectPageTemplate}from'./select-page-template.js';import{InputProjectCode}from'./input-page-router.js';function a1_0x3574(_0x5294c3,_0x299feb){_0x5294c3=_0x5294c3-0x115;const _0xa1fb94=a1_0xa1fb();let _0x357445=_0xa1fb94[_0x5294c3];return _0x357445;}import{logger}from'../utils/logger.js';import{TemplateReplacer}from'../utils/template-replacer.js';const __dirname=a1_0x327063[a1_0x26e9cd(0x128)](fileURLToPath(import.meta.url)),pageTemplateDir=a1_0x327063[a1_0x26e9cd(0x139)](__dirname,a1_0x26e9cd(0x122)),projectDir=process[a1_0x26e9cd(0x138)]();function a1_0xa1fb(){const _0x453d7d=['15EqjyLa','join','../../templates/pages','pages','\x20*\x20页面创建成功!','success','green','已输入的页面路由\x20','dirname','461688DkTsPc','1505230NDsuss','cyan','processTemplate','22221NJtSVC','开始添加页面:\x20','393542EkirFG','\x20Step2:\x20','info','5458JITCAl','message','2133110chnaYV','catch','156CVXbhG','finally','cwd','resolve','\x20Step1:\x20','add-page','error','gray','页面添加失败:\x20','now','1200fgqHsK','\x20*\x20路由地址:\x20','2044584tPgPtX','column','\x20*\x20页面文件已创建,可直接通过路由访问','src','正在创建页面,请稍候…'];a1_0xa1fb=function(){return _0x453d7d;};return a1_0xa1fb();}export const AddPage=()=>{const _0x45f6c0=a1_0x26e9cd,{exit:_0x4d674d}=useApp(),[_0x4c0971,_0x2efe58]=useState(''),[_0x19f716,_0xbcb14]=useState(''),[_0xb229b4,_0xe12bab]=useState(![]),[_0x51b66e,_0x4fb76b]=useState(![]),_0x51ff44=a1_0x327063[_0x45f6c0(0x121)](projectDir,_0x45f6c0(0x11e),_0x45f6c0(0x123)),_0x3c9393=a1_0x327063['join'](_0x51ff44,_0x19f716),_0x1261eb=a1_0x327063[_0x45f6c0(0x121)](_0x45f6c0(0x11e),_0x45f6c0(0x123),_0x19f716);useEffect(()=>{const _0x5aa0af=_0x45f6c0,_0x3df068=a1_0x327063['resolve'](pageTemplateDir,_0x4c0971);if(_0x4c0971&&_0x19f716){_0xe12bab(!![]),logger['setLogPath'](process[_0x5aa0af(0x138)]());const _0x1204bf=Date[_0x5aa0af(0x118)]();logger[_0x5aa0af(0x131)]('add-page',_0x5aa0af(0x12e)+_0x19f716,{'template':_0x4c0971,'targetPath':_0x1261eb}),TemplateReplacer[_0x5aa0af(0x12c)](_0x3df068,a1_0x327063['join'](_0x51ff44,_0x19f716),_0x19f716,_0x4c0971)['then'](()=>{const _0x3f17cb=_0x5aa0af,_0x44fef6=Date[_0x3f17cb(0x118)]()-_0x1204bf;logger[_0x3f17cb(0x125)](_0x3f17cb(0x13b),'页面添加成功:\x20'+_0x19f716,_0x44fef6,{'template':_0x4c0971,'targetPath':_0x1261eb,'routePath':_0x19f716}),_0x4fb76b(!![]);})[_0x5aa0af(0x135)](_0x20171a=>{const _0x1d699b=_0x5aa0af,_0xdffe1f=Date['now']()-_0x1204bf;logger[_0x1d699b(0x115)](_0x1d699b(0x13b),_0x1d699b(0x117)+_0x19f716,{'template':_0x4c0971,'targetPath':_0x1261eb,'error':_0x20171a instanceof Error?_0x20171a[_0x1d699b(0x133)]:String(_0x20171a),'duration':_0xdffe1f});})[_0x5aa0af(0x137)](()=>{_0xe12bab(![]);});}},[_0x4c0971,_0x19f716]),useEffect(()=>{_0x51b66e&&setTimeout(()=>{_0x4d674d();});},[_0x51b66e]);if(_0x4c0971)return a1_0x106863(Box,{'flexDirection':_0x45f6c0(0x11c),'paddingY':0x1,'children':[a1_0x106863(Box,{'children':[a1_0x590822(Text,{'color':_0x45f6c0(0x116),'children':_0x45f6c0(0x13a)}),a1_0x590822(Text,{'children':'已选择页面模板\x20'}),a1_0x590822(Text,{'color':'green','children':_0x4c0971})]}),_0x19f716?a1_0x106863(Box,{'children':[a1_0x590822(Text,{'color':'gray','children':_0x45f6c0(0x130)}),a1_0x590822(Text,{'children':_0x45f6c0(0x127)}),a1_0x590822(Text,{'color':_0x45f6c0(0x126),'children':_0x19f716})]}):a1_0x590822(InputProjectCode,{'pagePath':_0x3c9393,'onSubmit':_0xbcb14}),_0x19f716&&_0xb229b4?a1_0x106863(Box,{'marginTop':0x1,'children':[a1_0x590822(Box,{'width':'4'}),a1_0x590822(Text,{'children':_0x45f6c0(0x11f)})]}):null,_0x51b66e?a1_0x106863(a1_0x18ddb6,{'children':[a1_0x590822(Box,{'marginTop':0x1,'children':a1_0x590822(Text,{'color':_0x45f6c0(0x116),'children':_0x45f6c0(0x124)})}),a1_0x106863(Box,{'children':[a1_0x590822(Text,{'color':_0x45f6c0(0x116),'children':'\x20*\x20页面路径:\x20'}),a1_0x590822(Text,{'color':_0x45f6c0(0x126),'children':_0x1261eb})]}),a1_0x106863(Box,{'children':[a1_0x590822(Text,{'color':_0x45f6c0(0x116),'children':_0x45f6c0(0x11a)}),a1_0x106863(Text,{'color':_0x45f6c0(0x126),'children':['/',_0x19f716]})]}),a1_0x590822(Box,{'marginTop':0x1,'children':a1_0x590822(Text,{'color':_0x45f6c0(0x12b),'children':_0x45f6c0(0x11d)})})]}):null]});return a1_0x590822(SelectPageTemplate,{'onSelect':_0x2efe58});};
1
+ const a1_0x5a59e2=a1_0x49a8;(function(_0x1cd281,_0x28c02e){const _0x55b671=a1_0x49a8,_0x48f67a=_0x1cd281();while(!![]){try{const _0x3550f7=parseInt(_0x55b671(0x1bb))/0x1+parseInt(_0x55b671(0x19e))/0x2+parseInt(_0x55b671(0x1bf))/0x3*(parseInt(_0x55b671(0x1af))/0x4)+parseInt(_0x55b671(0x19f))/0x5*(parseInt(_0x55b671(0x1a7))/0x6)+-parseInt(_0x55b671(0x1b7))/0x7*(-parseInt(_0x55b671(0x1b3))/0x8)+-parseInt(_0x55b671(0x1a1))/0x9*(parseInt(_0x55b671(0x1c2))/0xa)+parseInt(_0x55b671(0x1a8))/0xb*(-parseInt(_0x55b671(0x1b2))/0xc);if(_0x3550f7===_0x28c02e)break;else _0x48f67a['push'](_0x48f67a['shift']());}catch(_0x52e2d2){_0x48f67a['push'](_0x48f67a['shift']());}}}(a1_0x5537,0x2040e));import{jsx as a1_0x1e420d,jsxs as a1_0x1d5f9c,Fragment as a1_0x3184b1}from'react/jsx-runtime';import{fileURLToPath}from'node:url';import a1_0x3148a7 from'node:path';function a1_0x49a8(_0x124b42,_0x66f8de){_0x124b42=_0x124b42-0x19d;const _0x5537f3=a1_0x5537();let _0x49a84f=_0x5537f3[_0x124b42];return _0x49a84f;}import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{SelectPageTemplate}from'./select-page-template.js';import{InputProjectCode}from'./input-page-router.js';import{logger}from'../utils/logger.js';import{TemplateReplacer}from'../utils/template-replacer.js';function a1_0x5537(){const _0xfee0d=['已输入的页面路由\x20','error','12EqUDYZ','352552NGNqXe','pages','gray','resolve','21vRarbb','开始添加页面:\x20','catch','join','100675WFdxdG','已选择页面模板\x20','cwd','../../templates/pages','92955PSPgDP','green','column','2484470jjjFCA','finally','setLogPath','src','224410bYxRdd','5StxtGb','页面添加成功:\x20','9YPTSiG','now','正在创建页面,请稍候…','dirname','\x20Step2:\x20','add-page','250692brLpbB','1773607KAgOVu','\x20*\x20路由地址:\x20','message','processTemplate','\x20*\x20页面创建成功!','then','cyan','20retuTP'];a1_0x5537=function(){return _0xfee0d;};return a1_0x5537();}const __dirname=a1_0x3148a7[a1_0x5a59e2(0x1a4)](fileURLToPath(import.meta.url)),pageTemplateDir=a1_0x3148a7[a1_0x5a59e2(0x1b6)](__dirname,a1_0x5a59e2(0x1be)),projectDir=process['cwd']();export const AddPage=()=>{const _0x3a3d0f=a1_0x5a59e2,{exit:_0x4ef086}=useApp(),[_0x50bacb,_0x378fa6]=useState(''),[_0x52be35,_0x339f55]=useState(''),[_0x2fe066,_0x5ae1b0]=useState(![]),[_0x535248,_0xb58ca7]=useState(![]),_0x1119b2=a1_0x3148a7['join'](projectDir,_0x3a3d0f(0x19d),_0x3a3d0f(0x1b4)),_0x54fbfb=a1_0x3148a7[_0x3a3d0f(0x1ba)](_0x1119b2,_0x52be35),_0x38a6da=a1_0x3148a7['join']('src',_0x3a3d0f(0x1b4),_0x52be35);useEffect(()=>{const _0x282784=_0x3a3d0f,_0x34770c=a1_0x3148a7['resolve'](pageTemplateDir,_0x50bacb);if(_0x50bacb&&_0x52be35){_0x5ae1b0(!![]),logger[_0x282784(0x1c4)](process[_0x282784(0x1bd)]());const _0x3682f3=Date['now']();logger['info']('add-page',_0x282784(0x1b8)+_0x52be35,{'template':_0x50bacb,'targetPath':_0x38a6da}),TemplateReplacer[_0x282784(0x1ab)](_0x34770c,a1_0x3148a7[_0x282784(0x1ba)](_0x1119b2,_0x52be35),_0x52be35,_0x50bacb)[_0x282784(0x1ad)](()=>{const _0x49e568=_0x282784,_0x58b599=Date[_0x49e568(0x1a2)]()-_0x3682f3;logger['success'](_0x49e568(0x1a6),_0x49e568(0x1a0)+_0x52be35,_0x58b599,{'template':_0x50bacb,'targetPath':_0x38a6da,'routePath':_0x52be35}),_0xb58ca7(!![]);})[_0x282784(0x1b9)](_0x3bfe79=>{const _0x58eee7=_0x282784,_0x5c7182=Date[_0x58eee7(0x1a2)]()-_0x3682f3;logger[_0x58eee7(0x1b1)](_0x58eee7(0x1a6),'页面添加失败:\x20'+_0x52be35,{'template':_0x50bacb,'targetPath':_0x38a6da,'error':_0x3bfe79 instanceof Error?_0x3bfe79[_0x58eee7(0x1aa)]:String(_0x3bfe79),'duration':_0x5c7182});})[_0x282784(0x1c3)](()=>{_0x5ae1b0(![]);});}},[_0x50bacb,_0x52be35]),useEffect(()=>{_0x535248&&setTimeout(()=>{_0x4ef086();});},[_0x535248]);if(_0x50bacb)return a1_0x1d5f9c(Box,{'flexDirection':_0x3a3d0f(0x1c1),'paddingY':0x1,'children':[a1_0x1d5f9c(Box,{'children':[a1_0x1e420d(Text,{'color':_0x3a3d0f(0x1b5),'children':'\x20Step1:\x20'}),a1_0x1e420d(Text,{'children':_0x3a3d0f(0x1bc)}),a1_0x1e420d(Text,{'color':_0x3a3d0f(0x1c0),'children':_0x50bacb})]}),_0x52be35?a1_0x1d5f9c(Box,{'children':[a1_0x1e420d(Text,{'color':_0x3a3d0f(0x1b5),'children':_0x3a3d0f(0x1a5)}),a1_0x1e420d(Text,{'children':_0x3a3d0f(0x1b0)}),a1_0x1e420d(Text,{'color':_0x3a3d0f(0x1c0),'children':_0x52be35})]}):a1_0x1e420d(InputProjectCode,{'pagePath':_0x54fbfb,'onSubmit':_0x339f55}),_0x52be35&&_0x2fe066?a1_0x1d5f9c(Box,{'marginTop':0x1,'children':[a1_0x1e420d(Box,{'width':'4'}),a1_0x1e420d(Text,{'children':_0x3a3d0f(0x1a3)})]}):null,_0x535248?a1_0x1d5f9c(a1_0x3184b1,{'children':[a1_0x1e420d(Box,{'marginTop':0x1,'children':a1_0x1e420d(Text,{'color':_0x3a3d0f(0x1b5),'children':_0x3a3d0f(0x1ac)})}),a1_0x1d5f9c(Box,{'children':[a1_0x1e420d(Text,{'color':_0x3a3d0f(0x1b5),'children':'\x20*\x20页面路径:\x20'}),a1_0x1e420d(Text,{'color':'green','children':_0x38a6da})]}),a1_0x1d5f9c(Box,{'children':[a1_0x1e420d(Text,{'color':'gray','children':_0x3a3d0f(0x1a9)}),a1_0x1d5f9c(Text,{'color':'green','children':['/',_0x52be35]})]}),a1_0x1e420d(Box,{'marginTop':0x1,'children':a1_0x1e420d(Text,{'color':_0x3a3d0f(0x1ae),'children':'\x20*\x20页面文件已创建,可直接通过路由访问'})})]}):null]});return a1_0x1e420d(SelectPageTemplate,{'onSelect':_0x378fa6});};
@@ -1 +1 @@
1
- (function(_0x278e13,_0x1fb4a3){const _0x32bd65=a2_0x455e,_0x37c3ae=_0x278e13();while(!![]){try{const _0x13b28a=parseInt(_0x32bd65(0x182))/0x1*(-parseInt(_0x32bd65(0x183))/0x2)+parseInt(_0x32bd65(0x188))/0x3+parseInt(_0x32bd65(0x184))/0x4*(parseInt(_0x32bd65(0x185))/0x5)+-parseInt(_0x32bd65(0x181))/0x6*(-parseInt(_0x32bd65(0x171))/0x7)+-parseInt(_0x32bd65(0x18d))/0x8+parseInt(_0x32bd65(0x17b))/0x9+-parseInt(_0x32bd65(0x17c))/0xa;if(_0x13b28a===_0x1fb4a3)break;else _0x37c3ae['push'](_0x37c3ae['shift']());}catch(_0x2a7f51){_0x37c3ae['push'](_0x37c3ae['shift']());}}}(a2_0x56f7,0x1fad7));function a2_0x455e(_0x34bf72,_0x70324c){_0x34bf72=_0x34bf72-0x16f;const _0x56f7e8=a2_0x56f7();let _0x455ef8=_0x56f7e8[_0x34bf72];return _0x455ef8;}import{jsx as a2_0x10d3a9,jsxs as a2_0x16e52a}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Text,Box,useInput}from'ink';import{readdir}from'node:fs/promises';import a2_0x2f7b09 from'node:path';import{fileURLToPath}from'node:url';async function getTemplateList(){const _0x18834f=a2_0x455e;try{const _0x50e3f0=fileURLToPath(import.meta.url),_0x57cf52=a2_0x2f7b09[_0x18834f(0x180)](a2_0x2f7b09['dirname'](_0x50e3f0),'../..'),_0x5b0b63=a2_0x2f7b09[_0x18834f(0x172)](_0x57cf52,_0x18834f(0x17f)),_0x6f7238=await readdir(_0x5b0b63,{'withFileTypes':!![]}),_0x54473e=_0x6f7238[_0x18834f(0x189)](_0x165c6f=>_0x165c6f[_0x18834f(0x16f)]())[_0x18834f(0x179)](_0xd85214=>({'label':_0xd85214[_0x18834f(0x187)]}))[_0x18834f(0x174)]((_0x572bfd,_0x54682d)=>_0x572bfd[_0x18834f(0x18c)]['localeCompare'](_0x54682d[_0x18834f(0x18c)]));return _0x54473e;}catch(_0x286e24){return console[_0x18834f(0x173)](_0x18834f(0x17d),_0x286e24),[{'label':'blank'},{'label':_0x18834f(0x17a)}];}}function a2_0x56f7(){const _0x406672=['error','sort','length','upArrow','onSelect','请选择您要创建的页面模板','map','sdk-fetch','176400OzVHhI','1616050gAFLLx','获取模板列表失败:','\x20Step1:\x20','templates/pages','resolve','168282JUSItC','1213vJqatF','38QozXlG','4kXdUOu','554450UzyIqj','column','name','640146ASdHyJ','filter','gray','green','label','1582008xVVRRd','return','downArrow','isDirectory','正在加载页面模板...','42qdOkXC','join'];a2_0x56f7=function(){return _0x406672;};return a2_0x56f7();}export function SelectPageTemplate(_0x1834f8){const _0x155d24=a2_0x455e,[_0x498073,_0x589282]=useState(0x0),[_0x5b848b,_0x4bd6b8]=useState([]),[_0x1bbd4b,_0x395621]=useState(!![]);useEffect(()=>{async function _0xc6ed9f(){const _0x50fb0d=await getTemplateList();_0x4bd6b8(_0x50fb0d),_0x395621(![]);}_0xc6ed9f();},[]),useInput((_0x5e9e3a,_0x14ba3b)=>{const _0x1c6694=a2_0x455e;if(_0x1bbd4b)return;if(_0x14ba3b[_0x1c6694(0x18e)]){const _0x48bd26=_0x5b848b[_0x498073];_0x48bd26&&_0x1834f8[_0x1c6694(0x177)](_0x48bd26[_0x1c6694(0x18c)]);}_0x14ba3b[_0x1c6694(0x176)]&&_0x589282(_0x56aa2f=>_0x56aa2f===0x0?_0x5b848b[_0x1c6694(0x175)]-0x1:_0x56aa2f-0x1),_0x14ba3b[_0x1c6694(0x18f)]&&_0x589282(_0x1451dd=>_0x1451dd===_0x5b848b[_0x1c6694(0x175)]-0x1?0x0:_0x1451dd+0x1);});if(_0x1bbd4b)return a2_0x10d3a9(Box,{'flexDirection':_0x155d24(0x186),'paddingY':0x1,'children':a2_0x16e52a(Box,{'children':[a2_0x10d3a9(Text,{'color':_0x155d24(0x18a),'children':_0x155d24(0x17e)}),a2_0x10d3a9(Text,{'children':_0x155d24(0x170)})]})});return a2_0x16e52a(Box,{'flexDirection':_0x155d24(0x186),'paddingY':0x1,'children':[a2_0x16e52a(Box,{'children':[a2_0x10d3a9(Text,{'color':_0x155d24(0x18a),'children':_0x155d24(0x17e)}),a2_0x10d3a9(Text,{'children':_0x155d24(0x178)})]}),_0x5b848b[_0x155d24(0x179)]((_0x33d91a,_0x39af1f)=>{const _0x2c90f1=_0x155d24,_0x47cc1f=_0x39af1f===_0x498073,_0x27e5c2=_0x47cc1f?'\x20\x20\x20\x20\x20\x20>\x20'+_0x33d91a[_0x2c90f1(0x18c)]:'\x20\x20\x20\x20\x20\x20\x20\x20'+_0x33d91a[_0x2c90f1(0x18c)];return a2_0x10d3a9(Box,{'children':a2_0x10d3a9(Text,{'color':_0x47cc1f?_0x2c90f1(0x18b):undefined,'children':_0x27e5c2})},_0x27e5c2);})]});}
1
+ function a2_0x5228(_0x4b0483,_0x3ee8ec){_0x4b0483=_0x4b0483-0x79;const _0x534cf4=a2_0x534c();let _0x5228f3=_0x534cf4[_0x4b0483];return _0x5228f3;}(function(_0x1f6808,_0x5e5a4d){const _0x417342=a2_0x5228,_0x42fd65=_0x1f6808();while(!![]){try{const _0x52f3c8=parseInt(_0x417342(0x7b))/0x1+parseInt(_0x417342(0x84))/0x2+parseInt(_0x417342(0x81))/0x3*(-parseInt(_0x417342(0x92))/0x4)+-parseInt(_0x417342(0x98))/0x5+-parseInt(_0x417342(0x8a))/0x6*(-parseInt(_0x417342(0x79))/0x7)+parseInt(_0x417342(0x99))/0x8*(-parseInt(_0x417342(0x97))/0x9)+-parseInt(_0x417342(0x7c))/0xa;if(_0x52f3c8===_0x5e5a4d)break;else _0x42fd65['push'](_0x42fd65['shift']());}catch(_0x4a71e5){_0x42fd65['push'](_0x42fd65['shift']());}}}(a2_0x534c,0x26022));import{jsx as a2_0x2d3d5f,jsxs as a2_0x476737}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Text,Box,useInput}from'ink';import{readdir}from'node:fs/promises';import a2_0x217eaf from'node:path';import{fileURLToPath}from'node:url';async function getTemplateList(){const _0x155e76=a2_0x5228;try{const _0x58c238=fileURLToPath(import.meta.url),_0x386c67=a2_0x217eaf['resolve'](a2_0x217eaf[_0x155e76(0x8d)](_0x58c238),_0x155e76(0x7f)),_0x5737e9=a2_0x217eaf[_0x155e76(0x85)](_0x386c67,_0x155e76(0x91)),_0x2a2820=await readdir(_0x5737e9,{'withFileTypes':!![]}),_0x16bacd=_0x2a2820[_0x155e76(0x8b)](_0x23a5bf=>_0x23a5bf[_0x155e76(0x7d)]())[_0x155e76(0x86)](_0x5e6a49=>({'label':_0x5e6a49['name']}))['sort']((_0x2c4907,_0x14d58e)=>_0x2c4907[_0x155e76(0x88)][_0x155e76(0x7e)](_0x14d58e['label']));return _0x16bacd;}catch(_0x5a03e6){return console[_0x155e76(0x83)](_0x155e76(0x94),_0x5a03e6),[{'label':'blank'},{'label':_0x155e76(0x8f)}];}}export function SelectPageTemplate(_0x1aa748){const _0xffb7e3=a2_0x5228,[_0x2d710f,_0x398fa0]=useState(0x0),[_0x20d68f,_0x398811]=useState([]),[_0x50cbc2,_0x2fce2d]=useState(!![]);useEffect(()=>{async function _0x48ee40(){const _0x45a76f=await getTemplateList();_0x398811(_0x45a76f),_0x2fce2d(![]);}_0x48ee40();},[]),useInput((_0x29aec7,_0x405248)=>{const _0x2c2a00=a2_0x5228;if(_0x50cbc2)return;if(_0x405248[_0x2c2a00(0x93)]){const _0x42beef=_0x20d68f[_0x2d710f];_0x42beef&&_0x1aa748[_0x2c2a00(0x7a)](_0x42beef[_0x2c2a00(0x88)]);}_0x405248[_0x2c2a00(0x89)]&&_0x398fa0(_0x50aac3=>_0x50aac3===0x0?_0x20d68f[_0x2c2a00(0x96)]-0x1:_0x50aac3-0x1),_0x405248[_0x2c2a00(0x90)]&&_0x398fa0(_0x5dd2fc=>_0x5dd2fc===_0x20d68f[_0x2c2a00(0x96)]-0x1?0x0:_0x5dd2fc+0x1);});if(_0x50cbc2)return a2_0x2d3d5f(Box,{'flexDirection':_0xffb7e3(0x82),'paddingY':0x1,'children':a2_0x476737(Box,{'children':[a2_0x2d3d5f(Text,{'color':_0xffb7e3(0x80),'children':_0xffb7e3(0x87)}),a2_0x2d3d5f(Text,{'children':'正在加载页面模板...'})]})});return a2_0x476737(Box,{'flexDirection':'column','paddingY':0x1,'children':[a2_0x476737(Box,{'children':[a2_0x2d3d5f(Text,{'color':'gray','children':_0xffb7e3(0x87)}),a2_0x2d3d5f(Text,{'children':_0xffb7e3(0x8e)})]}),_0x20d68f[_0xffb7e3(0x86)]((_0x1d1261,_0x4cb71a)=>{const _0x5130f3=_0xffb7e3,_0x752db0=_0x4cb71a===_0x2d710f,_0x4e1042=_0x752db0?'\x20\x20\x20\x20\x20\x20>\x20'+_0x1d1261[_0x5130f3(0x88)]:_0x5130f3(0x95)+_0x1d1261[_0x5130f3(0x88)];return a2_0x2d3d5f(Box,{'children':a2_0x2d3d5f(Text,{'color':_0x752db0?_0x5130f3(0x8c):undefined,'children':_0x4e1042})},_0x4e1042);})]});}function a2_0x534c(){const _0x3d6af3=['map','\x20Step1:\x20','label','upArrow','46356JOmexT','filter','green','dirname','请选择您要创建的页面模板','sdk-fetch','downArrow','templates/pages','692268AkyibE','return','获取模板列表失败:','\x20\x20\x20\x20\x20\x20\x20\x20','length','36uWcOsa','852440FANiPl','124576cGhHms','259KVmxnS','onSelect','201618PtkBWB','826990KzJEDk','isDirectory','localeCompare','../..','gray','3LuMTlO','column','error','313488ddWFav','join'];a2_0x534c=function(){return _0x3d6af3;};return a2_0x534c();}
@@ -1 +1 @@
1
- const a3_0x3f4b56=a3_0xb46d;(function(_0x432cf9,_0xf2461a){const _0x5baec5=a3_0xb46d,_0x2dae74=_0x432cf9();while(!![]){try{const _0x56d39d=-parseInt(_0x5baec5(0x1fa))/0x1*(parseInt(_0x5baec5(0x1e1))/0x2)+-parseInt(_0x5baec5(0x1e3))/0x3*(-parseInt(_0x5baec5(0x1f8))/0x4)+-parseInt(_0x5baec5(0x1ed))/0x5+parseInt(_0x5baec5(0x1f0))/0x6+-parseInt(_0x5baec5(0x1fb))/0x7+-parseInt(_0x5baec5(0x20a))/0x8*(-parseInt(_0x5baec5(0x1f9))/0x9)+-parseInt(_0x5baec5(0x1f4))/0xa*(-parseInt(_0x5baec5(0x1f7))/0xb);if(_0x56d39d===_0xf2461a)break;else _0x2dae74['push'](_0x2dae74['shift']());}catch(_0x2fb4ae){_0x2dae74['push'](_0x2dae74['shift']());}}}(a3_0x1b87,0x69389));import{jsx as a3_0x388791,jsxs as a3_0x1b6235}from'react/jsx-runtime';import{useState,useEffect}from'react';function a3_0x1b87(){const _0xbeaf56=['white','ide','•\x20Skill:\x20安装研发最佳实践、Backend\x20Function\x20规范','done','claude','projectRoot','[✓]','yellow','3145750TYnHvg','↑/↓:\x20移动\x20空格:\x20切换\x20a:\x20全选\x20q:\x20退出\x20Enter:\x20确认','gray','30744WIZIEi','status','filter','agent','50ukfhPX','delete','*\x20选择要配置的\x20IDE:','1765291qLgXPL','2940788XjSMCx','160695saHuDa','2mjwGuO','5394326JqXTXn','是否同时配置\x20AI\x20助手?这将:','name','error','Cursor','column','cursor','size','installing','codebuddy','push','map','正在配置\x20AI\x20助手...','return','Claude\x20Code','376BlQmSP','blue','qoder','MCP\x20服务器\x20(AI\x20访问数据集)','cyan','[Y]\x20是,配置\x20AI\x20助手','opencode','red','codex','selecting','请至少选择一个配置项','[\x20]','message','confirming','green','add','has','trae','•\x20MCP:\x20让\x20AI\x20直接访问\x20Lovrabet\x20数据集','length','skill-','Enter\x20默认:\x20是','551158CPOjDk','windsurf','3Dxobdk','antigravity'];a3_0x1b87=function(){return _0xbeaf56;};return a3_0x1b87();}import{Box,Text,useInput,useApp}from'ink';import{configureMcp}from'./config.js';import{installSkill,copySharedSkills,createSkillManifest,SKILL_IDE_CONFIGS}from'./config.js';const MCP_IDE_LIST=[a3_0x3f4b56(0x201),a3_0x3f4b56(0x1e9)],SKILL_IDE_LIST=[a3_0x3f4b56(0x1e4),'claude',a3_0x3f4b56(0x204),a3_0x3f4b56(0x1d3),a3_0x3f4b56(0x201),a3_0x3f4b56(0x1d1),a3_0x3f4b56(0x20c),a3_0x3f4b56(0x1dc),a3_0x3f4b56(0x1e2),a3_0x3f4b56(0x1f3)];export function AISetupUI({config:_0x316405,onComplete:_0x143318}){const _0x3c831d=a3_0x3f4b56,{exit:_0xe3e344}=useApp(),[_0x2453ed,_0x50d04a]=useState('confirming'),[_0x42f3b0,_0x558c20]=useState(0x0),[_0x111a0c,_0x2a69ff]=useState(new Set([0x0,0x1])),[_0x2c0a12,_0x300623]=useState(new Set(SKILL_IDE_LIST[_0x3c831d(0x206)]((_0x2e650a,_0x63e92b)=>_0x63e92b))),[_0x406871,_0x9a49bd]=useState('');useEffect(()=>{!_0x316405['appcode']&&_0x143318({'mcpResults':[],'skillResults':[]});},[_0x316405['appcode'],_0x143318]),useInput((_0x3c0933,_0x38f310)=>{const _0x16ec97=_0x3c831d;if(_0x2453ed===_0x16ec97(0x1d8)){if(_0x3c0933==='y'||_0x3c0933==='Y'||_0x38f310[_0x16ec97(0x208)]){_0x497b28();return;}if(_0x3c0933==='n'||_0x3c0933==='N'){_0x143318({'mcpResults':[],'skillResults':[]});return;}if(_0x38f310[_0x16ec97(0x208)]){_0x497b28();return;}}if(_0x2453ed===_0x16ec97(0x1d4)){if(_0x38f310['upArrow']){_0x558c20(_0x165cdb=>_0x165cdb>0x0?_0x165cdb-0x1:SKILL_IDE_LIST[_0x16ec97(0x1de)]-0x1);return;}if(_0x38f310['downArrow']){_0x558c20(_0x154a2a=>_0x154a2a<SKILL_IDE_LIST[_0x16ec97(0x1de)]-0x1?_0x154a2a+0x1:0x0);return;}if(_0x3c0933==='\x20'){const _0x3859ab=_0x42f3b0<MCP_IDE_LIST['length'];if(_0x3859ab){const _0x4b8093=new Set(_0x111a0c);_0x4b8093[_0x16ec97(0x1db)](_0x42f3b0)?_0x4b8093[_0x16ec97(0x1f5)](_0x42f3b0):_0x4b8093[_0x16ec97(0x1da)](_0x42f3b0),_0x2a69ff(_0x4b8093);}else{const _0x3ebf09=_0x42f3b0-MCP_IDE_LIST[_0x16ec97(0x1de)],_0x387c0d=new Set(_0x2c0a12);_0x387c0d['has'](_0x3ebf09)?_0x387c0d['delete'](_0x3ebf09):_0x387c0d[_0x16ec97(0x1da)](_0x3ebf09),_0x300623(_0x387c0d);}return;}if(_0x3c0933==='a'||_0x3c0933==='A'){_0x2a69ff(new Set(MCP_IDE_LIST[_0x16ec97(0x206)]((_0x5c2279,_0x3ee7b1)=>_0x3ee7b1))),_0x300623(new Set(SKILL_IDE_LIST[_0x16ec97(0x206)]((_0x401584,_0x40abaf)=>_0x40abaf)));return;}if(_0x3c0933==='q'||_0x3c0933==='Q'){_0xe3e344();return;}if(_0x38f310[_0x16ec97(0x208)]){if(_0x111a0c[_0x16ec97(0x202)]===0x0&&_0x2c0a12[_0x16ec97(0x202)]===0x0){_0x9a49bd(_0x16ec97(0x1d5));return;}_0x497b28();return;}}if(_0x2453ed===_0x16ec97(0x1e8)){_0xe3e344();return;}});async function _0x497b28(){const _0x2217ea=_0x3c831d;_0x50d04a(_0x2217ea(0x203));const _0x389a07=[],_0x3ee878=[];for(const _0x32e806 of _0x111a0c){const _0x316390=MCP_IDE_LIST[_0x32e806];if(!_0x316390)continue;try{const _0x136915=await configureMcp(_0x316390,_0x316405['projectRoot']);_0x389a07[_0x2217ea(0x205)](_0x136915);}catch(_0x4b7a6e){_0x389a07[_0x2217ea(0x205)]({'ide':MCP_IDE_CONFIGS[_0x316390]?.[_0x2217ea(0x1fd)]||_0x316390,'status':_0x2217ea(0x1fe),'message':_0x4b7a6e instanceof Error?_0x4b7a6e['message']:String(_0x4b7a6e)});}}await copySharedSkills(_0x316405['projectRoot']);for(const _0x611c0 of _0x2c0a12){const _0x45ad0b=SKILL_IDE_LIST[_0x611c0];if(!_0x45ad0b)continue;try{const _0x55e29c=await installSkill(_0x45ad0b,_0x316405[_0x2217ea(0x1ea)]);_0x3ee878[_0x2217ea(0x205)](_0x55e29c);}catch(_0x3083e2){_0x3ee878[_0x2217ea(0x205)]({'ide':SKILL_IDE_CONFIGS[_0x45ad0b]?.['name']||_0x45ad0b,'status':'error','message':_0x3083e2 instanceof Error?_0x3083e2[_0x2217ea(0x1d7)]:String(_0x3083e2)});}}if(_0x3ee878[_0x2217ea(0x1de)]>0x0){const _0x5d6312=_0x3ee878[_0x2217ea(0x1f2)](_0x3a121c=>_0x3a121c[_0x2217ea(0x1f1)]==='success')[_0x2217ea(0x206)](_0x581f00=>_0x581f00[_0x2217ea(0x1e6)]);_0x5d6312[_0x2217ea(0x1de)]>0x0&&createSkillManifest(_0x316405[_0x2217ea(0x1ea)],_0x5d6312);}_0x50d04a(_0x2217ea(0x1e8)),setTimeout(()=>{_0x143318({'mcpResults':_0x389a07,'skillResults':_0x3ee878});},0xbb8);}if(_0x2453ed==='confirming')return a3_0x1b6235(Box,{'flexDirection':_0x3c831d(0x200),'marginTop':0x1,'children':[a3_0x388791(Box,{'marginTop':0x1,'children':a3_0x388791(Text,{'color':_0x3c831d(0x1e5),'children':_0x3c831d(0x1fc)})}),a3_0x388791(Box,{'marginLeft':0x2,'marginTop':0x1,'children':a3_0x388791(Text,{'color':_0x3c831d(0x1ef),'children':_0x3c831d(0x1dd)})}),a3_0x388791(Box,{'marginLeft':0x2,'children':a3_0x388791(Text,{'color':_0x3c831d(0x1ef),'children':_0x3c831d(0x1e7)})}),a3_0x1b6235(Box,{'marginTop':0x1,'flexDirection':_0x3c831d(0x200),'children':[a3_0x388791(Box,{'children':a3_0x388791(Text,{'color':_0x3c831d(0x1d9),'children':_0x3c831d(0x20f)})}),a3_0x388791(Box,{'children':a3_0x388791(Text,{'color':_0x3c831d(0x1ef),'children':'[N]\x20跳过,稍后手动配置'})}),a3_0x388791(Box,{'children':a3_0x388791(Text,{'color':'dimColor','children':_0x3c831d(0x1e0)})})]}),_0x406871&&a3_0x388791(Box,{'marginTop':0x1,'children':a3_0x1b6235(Text,{'color':_0x3c831d(0x1d2),'children':['✗\x20',_0x406871]})})]});if(_0x2453ed===_0x3c831d(0x1d4))return a3_0x1b6235(Box,{'flexDirection':_0x3c831d(0x200),'marginTop':0x1,'children':[a3_0x388791(Box,{'children':a3_0x388791(Text,{'color':_0x3c831d(0x20e),'bold':!![],'children':_0x3c831d(0x1f6)})}),_0x406871&&a3_0x388791(Box,{'marginTop':0x1,'children':a3_0x1b6235(Text,{'color':_0x3c831d(0x1d2),'children':['✗\x20',_0x406871]})}),a3_0x1b6235(Box,{'marginTop':0x1,'flexDirection':_0x3c831d(0x200),'children':[a3_0x388791(Text,{'bold':!![],'color':'yellow','children':_0x3c831d(0x20d)}),MCP_IDE_LIST[_0x3c831d(0x206)]((_0x328551,_0x3c5f0b)=>{const _0x386be7=_0x3c831d,_0x4d3a4a=_0x42f3b0===_0x3c5f0b,_0x5130b5=_0x111a0c[_0x386be7(0x1db)](_0x3c5f0b);return a3_0x388791(Box,{'children':a3_0x1b6235(Text,{'backgroundColor':_0x4d3a4a?_0x386be7(0x20b):undefined,'color':_0x4d3a4a?'white':undefined,'children':[_0x5130b5?_0x386be7(0x1eb):_0x386be7(0x1d6),'\x20',_0x328551==='cursor'?_0x386be7(0x1ff):_0x386be7(0x209)]})},'mcp-'+_0x328551);}),a3_0x388791(Box,{'marginTop':0x1,'children':a3_0x388791(Text,{'bold':!![],'color':_0x3c831d(0x1ec),'children':'技能包\x20(研发规范指南)'})}),SKILL_IDE_LIST[_0x3c831d(0x206)]((_0x41ce47,_0x265916)=>{const _0x357f78=_0x3c831d,_0x53a9a1=_0x265916+MCP_IDE_LIST['length'],_0x2a97f6=_0x42f3b0===_0x53a9a1,_0x4a3218=_0x2c0a12['has'](_0x53a9a1);return a3_0x388791(Box,{'children':a3_0x1b6235(Text,{'backgroundColor':_0x2a97f6?_0x357f78(0x20b):undefined,'color':_0x2a97f6?'white':undefined,'children':[_0x4a3218?_0x357f78(0x1eb):_0x357f78(0x1d6),'\x20',SKILL_IDE_CONFIGS[_0x41ce47]['name']]})},_0x357f78(0x1df)+_0x41ce47);}),a3_0x388791(Box,{'marginTop':0x1,'children':a3_0x388791(Text,{'color':_0x3c831d(0x1ef),'children':_0x3c831d(0x1ee)})})]})]});if(_0x2453ed===_0x3c831d(0x203))return a3_0x388791(Box,{'flexDirection':_0x3c831d(0x200),'marginTop':0x1,'children':a3_0x388791(Box,{'children':a3_0x388791(Text,{'children':_0x3c831d(0x207)})})});if(_0x2453ed==='done')return null;return null;}function a3_0xb46d(_0x2212de,_0x8e205){_0x2212de=_0x2212de-0x1d1;const _0x1b877c=a3_0x1b87();let _0xb46d79=_0x1b877c[_0x2212de];return _0xb46d79;}const MCP_IDE_CONFIGS={'cursor':{'name':a3_0x3f4b56(0x1ff)},'claude':{'name':'Claude\x20Code'}};
1
+ const a3_0x108960=a3_0x2d0a;(function(_0x5565e7,_0x27e455){const _0x2c4236=a3_0x2d0a,_0x12d9b1=_0x5565e7();while(!![]){try{const _0x39a483=parseInt(_0x2c4236(0xa7))/0x1+parseInt(_0x2c4236(0xb1))/0x2*(parseInt(_0x2c4236(0xb2))/0x3)+parseInt(_0x2c4236(0xcb))/0x4*(-parseInt(_0x2c4236(0xd0))/0x5)+parseInt(_0x2c4236(0xc5))/0x6+parseInt(_0x2c4236(0xd3))/0x7+parseInt(_0x2c4236(0xca))/0x8+-parseInt(_0x2c4236(0xb9))/0x9;if(_0x39a483===_0x27e455)break;else _0x12d9b1['push'](_0x12d9b1['shift']());}catch(_0x3b9ff7){_0x12d9b1['push'](_0x12d9b1['shift']());}}}(a3_0x554e,0xcc6bf));import{jsx as a3_0x430c4b,jsxs as a3_0xf5bcfe}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Box,Text,useInput,useApp}from'ink';function a3_0x554e(){const _0x1ff513=['*\x20选择要配置的\x20IDE:','gray','133666JVJkks','54uSHIoa','filter','•\x20MCP:\x20让\x20AI\x20直接访问\x20Lovrabet\x20数据集','trae','mcp-','↑/↓:\x20移动\x20空格:\x20切换\x20a:\x20全选\x20q:\x20退出\x20Enter:\x20确认','ide','16724268FOwisj','是否同时配置\x20AI\x20助手?这将:','map','return','请至少选择一个配置项','size','dimColor','cursor','技能包\x20(研发规范指南)','confirming','[N]\x20跳过,稍后手动配置','push','1503534wJoVVI','message','selecting','column','windsurf','10106848iXvppu','84JfIrcC','red','white','[\x20]','cyan','305765YwCdTC','yellow','green','3495730tWEcMG','name','codex','delete','agent','installing','opencode','add','appcode','[]','projectRoot','blue','done','success','length','antigravity','downArrow','[Y]\x20是,配置\x20AI\x20助手','claude','763447vpQdgX','error','has','Claude\x20Code','status','codebuddy','Cursor','Enter\x20默认:\x20是'];a3_0x554e=function(){return _0x1ff513;};return a3_0x554e();}import{configureMcp}from'./config.js';function a3_0x2d0a(_0xf65375,_0x28a3f0){_0xf65375=_0xf65375-0x96;const _0x554ef0=a3_0x554e();let _0x2d0a26=_0x554ef0[_0xf65375];return _0x2d0a26;}import{installSkill,copySharedSkills,createSkillManifest,SKILL_IDE_CONFIGS}from'./config.js';const MCP_IDE_LIST=['cursor',a3_0x108960(0xa6)],SKILL_IDE_LIST=[a3_0x108960(0xa3),'claude',a3_0x108960(0xac),a3_0x108960(0x96),a3_0x108960(0xc0),a3_0x108960(0x9a),'qoder',a3_0x108960(0xb5),a3_0x108960(0xc9),a3_0x108960(0x98)];export function AISetupUI({config:_0x31ff72,onComplete:_0x4a6e0a}){const _0x4ea183=a3_0x108960,{exit:_0xa9fbae}=useApp(),[_0x40ac1f,_0x61f7a5]=useState('confirming'),[_0x5ec5e0,_0x25be93]=useState(0x0),[_0x29d797,_0x1c5bef]=useState(new Set([0x0,0x1])),[_0x42479c,_0x1007f3]=useState(new Set(SKILL_IDE_LIST[_0x4ea183(0xbb)]((_0x2b41d4,_0x324fc2)=>_0x324fc2))),[_0x365a9e,_0x595a01]=useState('');useEffect(()=>{!_0x31ff72['appcode']&&_0x4a6e0a({'mcpResults':[],'skillResults':[]});},[_0x31ff72[_0x4ea183(0x9c)],_0x4a6e0a]),useInput((_0xb7809,_0x3b5331)=>{const _0x548b74=_0x4ea183;if(_0x40ac1f===_0x548b74(0xc2)){if(_0xb7809==='y'||_0xb7809==='Y'||_0x3b5331[_0x548b74(0xbc)]){_0x4aa19c();return;}if(_0xb7809==='n'||_0xb7809==='N'){_0x4a6e0a({'mcpResults':[],'skillResults':[]});return;}if(_0x3b5331[_0x548b74(0xbc)]){_0x4aa19c();return;}}if(_0x40ac1f===_0x548b74(0xc7)){if(_0x3b5331['upArrow']){_0x25be93(_0x4bfd64=>_0x4bfd64>0x0?_0x4bfd64-0x1:SKILL_IDE_LIST[_0x548b74(0xa2)]-0x1);return;}if(_0x3b5331[_0x548b74(0xa4)]){_0x25be93(_0x29d8fc=>_0x29d8fc<SKILL_IDE_LIST[_0x548b74(0xa2)]-0x1?_0x29d8fc+0x1:0x0);return;}if(_0xb7809==='\x20'){const _0x3aae42=_0x5ec5e0<MCP_IDE_LIST['length'];if(_0x3aae42){const _0x2632c9=new Set(_0x29d797);_0x2632c9[_0x548b74(0xa9)](_0x5ec5e0)?_0x2632c9[_0x548b74(0x97)](_0x5ec5e0):_0x2632c9['add'](_0x5ec5e0),_0x1c5bef(_0x2632c9);}else{const _0x312f65=_0x5ec5e0-MCP_IDE_LIST[_0x548b74(0xa2)],_0x3cb058=new Set(_0x42479c);_0x3cb058[_0x548b74(0xa9)](_0x312f65)?_0x3cb058[_0x548b74(0x97)](_0x312f65):_0x3cb058[_0x548b74(0x9b)](_0x312f65),_0x1007f3(_0x3cb058);}return;}if(_0xb7809==='a'||_0xb7809==='A'){_0x1c5bef(new Set(MCP_IDE_LIST[_0x548b74(0xbb)]((_0x2723dd,_0x390c48)=>_0x390c48))),_0x1007f3(new Set(SKILL_IDE_LIST[_0x548b74(0xbb)]((_0x39c838,_0x4d031c)=>_0x4d031c)));return;}if(_0xb7809==='q'||_0xb7809==='Q'){_0xa9fbae();return;}if(_0x3b5331[_0x548b74(0xbc)]){if(_0x29d797['size']===0x0&&_0x42479c[_0x548b74(0xbe)]===0x0){_0x595a01(_0x548b74(0xbd));return;}_0x4aa19c();return;}}if(_0x40ac1f==='done'){_0xa9fbae();return;}});async function _0x4aa19c(){const _0x10f5a4=_0x4ea183;_0x61f7a5(_0x10f5a4(0x99));const _0x576515=[],_0x334688=[];for(const _0x750f1e of _0x29d797){const _0x5a4d07=MCP_IDE_LIST[_0x750f1e];if(!_0x5a4d07)continue;try{const _0x581b39=await configureMcp(_0x5a4d07,_0x31ff72['projectRoot']);_0x576515['push'](_0x581b39);}catch(_0x58564b){_0x576515['push']({'ide':MCP_IDE_CONFIGS[_0x5a4d07]?.[_0x10f5a4(0xd4)]||_0x5a4d07,'status':_0x10f5a4(0xa8),'message':_0x58564b instanceof Error?_0x58564b[_0x10f5a4(0xc6)]:String(_0x58564b)});}}await copySharedSkills(_0x31ff72['projectRoot']);for(const _0x49cd3 of _0x42479c){const _0x5e6f62=SKILL_IDE_LIST[_0x49cd3];if(!_0x5e6f62)continue;try{const _0x4fe1ab=await installSkill(_0x5e6f62,_0x31ff72[_0x10f5a4(0x9e)]);_0x334688[_0x10f5a4(0xc4)](_0x4fe1ab);}catch(_0x3094a0){_0x334688['push']({'ide':SKILL_IDE_CONFIGS[_0x5e6f62]?.[_0x10f5a4(0xd4)]||_0x5e6f62,'status':_0x10f5a4(0xa8),'message':_0x3094a0 instanceof Error?_0x3094a0['message']:String(_0x3094a0)});}}if(_0x334688['length']>0x0){const _0x36206b=_0x334688[_0x10f5a4(0xb3)](_0x5326af=>_0x5326af[_0x10f5a4(0xab)]===_0x10f5a4(0xa1))[_0x10f5a4(0xbb)](_0x2bffab=>_0x2bffab[_0x10f5a4(0xb8)]);_0x36206b[_0x10f5a4(0xa2)]>0x0&&createSkillManifest(_0x31ff72[_0x10f5a4(0x9e)],_0x36206b);}_0x61f7a5(_0x10f5a4(0xa0)),setTimeout(()=>{_0x4a6e0a({'mcpResults':_0x576515,'skillResults':_0x334688});},0xbb8);}if(_0x40ac1f===_0x4ea183(0xc2))return a3_0xf5bcfe(Box,{'flexDirection':_0x4ea183(0xc8),'marginTop':0x1,'children':[a3_0x430c4b(Box,{'marginTop':0x1,'children':a3_0x430c4b(Text,{'color':'white','children':_0x4ea183(0xba)})}),a3_0x430c4b(Box,{'marginLeft':0x2,'marginTop':0x1,'children':a3_0x430c4b(Text,{'color':_0x4ea183(0xb0),'children':_0x4ea183(0xb4)})}),a3_0x430c4b(Box,{'marginLeft':0x2,'children':a3_0x430c4b(Text,{'color':_0x4ea183(0xb0),'children':'•\x20Skill:\x20安装研发最佳实践、Backend\x20Function\x20规范'})}),a3_0xf5bcfe(Box,{'marginTop':0x1,'flexDirection':_0x4ea183(0xc8),'children':[a3_0x430c4b(Box,{'children':a3_0x430c4b(Text,{'color':_0x4ea183(0xd2),'children':_0x4ea183(0xa5)})}),a3_0x430c4b(Box,{'children':a3_0x430c4b(Text,{'color':'gray','children':_0x4ea183(0xc3)})}),a3_0x430c4b(Box,{'children':a3_0x430c4b(Text,{'color':_0x4ea183(0xbf),'children':_0x4ea183(0xae)})})]}),_0x365a9e&&a3_0x430c4b(Box,{'marginTop':0x1,'children':a3_0xf5bcfe(Text,{'color':_0x4ea183(0xcc),'children':['✗\x20',_0x365a9e]})})]});if(_0x40ac1f===_0x4ea183(0xc7))return a3_0xf5bcfe(Box,{'flexDirection':_0x4ea183(0xc8),'marginTop':0x1,'children':[a3_0x430c4b(Box,{'children':a3_0x430c4b(Text,{'color':_0x4ea183(0xcf),'bold':!![],'children':_0x4ea183(0xaf)})}),_0x365a9e&&a3_0x430c4b(Box,{'marginTop':0x1,'children':a3_0xf5bcfe(Text,{'color':_0x4ea183(0xcc),'children':['✗\x20',_0x365a9e]})}),a3_0xf5bcfe(Box,{'marginTop':0x1,'flexDirection':_0x4ea183(0xc8),'children':[a3_0x430c4b(Text,{'bold':!![],'color':_0x4ea183(0xd1),'children':'MCP\x20服务器\x20(AI\x20访问数据集)'}),MCP_IDE_LIST[_0x4ea183(0xbb)]((_0x4e21f3,_0x1ce4f5)=>{const _0x42bd8c=_0x4ea183,_0x56f4dd=_0x5ec5e0===_0x1ce4f5,_0x5d8649=_0x29d797[_0x42bd8c(0xa9)](_0x1ce4f5);return a3_0x430c4b(Box,{'children':a3_0xf5bcfe(Text,{'backgroundColor':_0x56f4dd?'blue':undefined,'color':_0x56f4dd?'white':undefined,'children':[_0x5d8649?'[✓]':'[\x20]','\x20',_0x4e21f3===_0x42bd8c(0xc0)?_0x42bd8c(0xad):_0x42bd8c(0xaa)]})},_0x42bd8c(0xb6)+_0x4e21f3);}),a3_0x430c4b(Box,{'marginTop':0x1,'children':a3_0x430c4b(Text,{'bold':!![],'color':_0x4ea183(0xd1),'children':_0x4ea183(0xc1)})}),SKILL_IDE_LIST[_0x4ea183(0xbb)]((_0x11bb34,_0x46bd0c)=>{const _0x540a0f=_0x4ea183,_0x5e5fe0=_0x46bd0c+MCP_IDE_LIST[_0x540a0f(0xa2)],_0x1da4d1=_0x5ec5e0===_0x5e5fe0,_0x1be941=_0x42479c[_0x540a0f(0xa9)](_0x5e5fe0);return a3_0x430c4b(Box,{'children':a3_0xf5bcfe(Text,{'backgroundColor':_0x1da4d1?_0x540a0f(0x9f):undefined,'color':_0x1da4d1?_0x540a0f(0xcd):undefined,'children':[_0x1be941?_0x540a0f(0x9d):_0x540a0f(0xce),'\x20',SKILL_IDE_CONFIGS[_0x11bb34][_0x540a0f(0xd4)]]})},'skill-'+_0x11bb34);}),a3_0x430c4b(Box,{'marginTop':0x1,'children':a3_0x430c4b(Text,{'color':_0x4ea183(0xb0),'children':_0x4ea183(0xb7)})})]})]});if(_0x40ac1f==='installing')return a3_0x430c4b(Box,{'flexDirection':'column','marginTop':0x1,'children':a3_0x430c4b(Box,{'children':a3_0x430c4b(Text,{'children':'正在配置\x20AI\x20助手...'})})});if(_0x40ac1f===_0x4ea183(0xa0))return null;return null;}const MCP_IDE_CONFIGS={'cursor':{'name':a3_0x108960(0xad)},'claude':{'name':a3_0x108960(0xaa)}};
@@ -1 +1 @@
1
- const a4_0x2d9806=a4_0x42c1;(function(_0x256f1c,_0x2110c5){const _0x268e89=a4_0x42c1,_0x2ab64e=_0x256f1c();while(!![]){try{const _0x59f730=-parseInt(_0x268e89(0xb7))/0x1*(-parseInt(_0x268e89(0xba))/0x2)+parseInt(_0x268e89(0xcf))/0x3*(-parseInt(_0x268e89(0xfc))/0x4)+-parseInt(_0x268e89(0xf6))/0x5+parseInt(_0x268e89(0xb6))/0x6+parseInt(_0x268e89(0xc4))/0x7*(parseInt(_0x268e89(0xb4))/0x8)+-parseInt(_0x268e89(0xf9))/0x9*(-parseInt(_0x268e89(0xf1))/0xa)+-parseInt(_0x268e89(0xda))/0xb;if(_0x59f730===_0x2110c5)break;else _0x2ab64e['push'](_0x2ab64e['shift']());}catch(_0x4ab213){_0x2ab64e['push'](_0x2ab64e['shift']());}}}(a4_0x2c0e,0xcfde4));import{existsSync,mkdirSync,writeFileSync,readFileSync,copyFileSync}from'node:fs';import{join,resolve,dirname}from'node:path';import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';import{IDE_CONFIGS}from'../utils/ai_config.js';import{installSingleIDE}from'../skills/skill-installer.js';function a4_0x42c1(_0x45dbbb,_0x5656ce){_0x45dbbb=_0x45dbbb-0xb0;const _0x2c0e03=a4_0x2c0e();let _0x42c174=_0x2c0e03[_0x45dbbb];return _0x42c174;}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_0x2d9806(0xdd),MCP_COMMAND=a4_0x2d9806(0xbe),MCP_ARGS=[a4_0x2d9806(0xc3)];export function buildEnvConfig(_0x28bf7e,_0x2966c6){const _0x235714=a4_0x2d9806,_0x163603={'LOVRABET_APP_CODE':String(_0x28bf7e)};return _0x2966c6!==_0x235714(0xce)&&(_0x163603[_0x235714(0xf2)]=String(_0x2966c6)),_0x163603;}export async function configureCursorMcp(_0x3a7372){const _0x31fef6=a4_0x2d9806,_0xd6be18=_0x3a7372||process[_0x31fef6(0xe3)](),_0x4202a1=readConfig(_0xd6be18),_0xeb5475=_0x4202a1[_0x31fef6(0xc8)]||_0x4202a1['app'],_0x794adc=_0x4202a1[_0x31fef6(0xee)]||_0x31fef6(0xce);if(!_0xeb5475)return{'ide':_0x31fef6(0xf8),'status':_0x31fef6(0xcb),'message':'需要先配置\x20appcode'};const _0x451a7b=buildEnvConfig(_0xeb5475,_0x794adc),_0x524e59={'command':MCP_COMMAND,'args':MCP_ARGS,'env':_0x451a7b},_0x34f289=join(_0xd6be18,_0x31fef6(0xdc),_0x31fef6(0xef)),_0x1b9b17=join(_0xd6be18,_0x31fef6(0xdc));try{!existsSync(_0x1b9b17)&&mkdirSync(_0x1b9b17,{'recursive':!![]});let _0xdbac61={'mcpServers':{}};if(existsSync(_0x34f289)){const _0x190194=readFileSync(_0x34f289,_0x31fef6(0xd1));_0xdbac61=JSON[_0x31fef6(0xfa)](_0x190194);}return(!_0xdbac61[_0x31fef6(0xb9)]||typeof _0xdbac61[_0x31fef6(0xb9)]!==_0x31fef6(0xc6))&&(_0xdbac61[_0x31fef6(0xb9)]={}),_0xdbac61[_0x31fef6(0xb9)][MCP_SERVER_NAME]=_0x524e59,writeFileSync(_0x34f289,JSON[_0x31fef6(0xfd)](_0xdbac61,null,0x2),'utf-8'),logger[_0x31fef6(0xcc)]('mcp-install',_0x31fef6(0xe0),{'appcode':_0xeb5475,'env':_0x794adc,'path':_0x34f289}),await copyCursorRules(_0x1b9b17),{'ide':'Cursor','status':_0x31fef6(0xf5),'message':'已写入\x20.cursor/mcp.json'};}catch(_0x120d2e){return logger[_0x31fef6(0xcb)](_0x31fef6(0xd2),'Cursor\x20MCP\x20配置失败',{'error':_0x120d2e instanceof Error?_0x120d2e['message']:String(_0x120d2e)}),{'ide':_0x31fef6(0xf8),'status':_0x31fef6(0xcb),'message':_0x120d2e instanceof Error?_0x120d2e[_0x31fef6(0xca)]:String(_0x120d2e)};}}export async function configureClaudeMcp(_0x2af75d){const _0x33049f=a4_0x2d9806,_0x3f30ce=_0x2af75d||process[_0x33049f(0xe3)](),_0x437931=readConfig(_0x3f30ce),_0x47aeda=_0x437931[_0x33049f(0xc8)]||_0x437931[_0x33049f(0xd6)],_0x1c7fd4=_0x437931[_0x33049f(0xee)]||'online';if(!_0x47aeda)return{'ide':'Claude\x20Code','status':_0x33049f(0xcb),'message':_0x33049f(0xe9)};let _0xc8b768=_0x33049f(0xd3)+MCP_SERVER_NAME+'\x20'+MCP_COMMAND+'\x20'+MCP_ARGS[_0x33049f(0xfb)]('\x20')+_0x33049f(0xc7)+_0x47aeda;return _0x1c7fd4!==_0x33049f(0xce)&&(_0xc8b768+=_0x33049f(0xc9)+_0x1c7fd4),await copyAgentsMd(_0x3f30ce),logger[_0x33049f(0xcc)](_0x33049f(0xd2),_0x33049f(0xbf),{'command':_0xc8b768,'appcode':_0x47aeda,'env':_0x1c7fd4}),console[_0x33049f(0xe8)](_0x33049f(0xed)),console[_0x33049f(0xe8)]('\x20\x20'+_0xc8b768+'\x0a'),console[_0x33049f(0xe8)](_0x33049f(0xbc)),console[_0x33049f(0xe8)](_0x33049f(0xcd)+_0x47aeda),_0x1c7fd4!=='online'&&console['log'](_0x33049f(0xec)+_0x1c7fd4),console[_0x33049f(0xe8)](_0x33049f(0xb3)),{'ide':'Claude\x20Code','status':_0x33049f(0xf3),'message':_0x33049f(0xe5)+_0xc8b768};}export async function showOtherGuide(_0x5a7b1d){const _0x53fcd0=a4_0x2d9806,_0x544a2a=_0x5a7b1d||process[_0x53fcd0(0xe3)](),_0x368464=readConfig(_0x544a2a),_0x4e62e9=_0x368464[_0x53fcd0(0xc8)]||_0x368464[_0x53fcd0(0xd6)],_0x28df2c=_0x368464[_0x53fcd0(0xee)]||_0x53fcd0(0xce);if(!_0x4e62e9)return{'ide':'其他','status':_0x53fcd0(0xcb),'message':_0x53fcd0(0xe9)};return console['log'](_0x53fcd0(0xdb)),console[_0x53fcd0(0xe8)]('{'),console[_0x53fcd0(0xe8)](_0x53fcd0(0xc5)),console[_0x53fcd0(0xe8)]('\x20\x20\x20\x20\x22'+MCP_SERVER_NAME+_0x53fcd0(0xd4)),console['log'](_0x53fcd0(0x100)+MCP_COMMAND+'\x22,'),console[_0x53fcd0(0xe8)](_0x53fcd0(0xe1)+MCP_ARGS['map'](_0x1cd7fb=>'\x22'+_0x1cd7fb+'\x22')[_0x53fcd0(0xfb)](',\x20')+'],'),console[_0x53fcd0(0xe8)](_0x53fcd0(0xc1)),console[_0x53fcd0(0xe8)](_0x53fcd0(0xeb)+_0x4e62e9+'\x22,'),_0x28df2c!=='online'&&console[_0x53fcd0(0xe8)](_0x53fcd0(0xb1)+_0x28df2c+'\x22,'),console['log'](_0x53fcd0(0xde)),console[_0x53fcd0(0xe8)]('\x20\x20\x20\x20}'),console[_0x53fcd0(0xe8)](_0x53fcd0(0xd9)),console['log']('}\x0a'),logger['info'](_0x53fcd0(0xd2),_0x53fcd0(0xf4),{'appcode':_0x4e62e9,'env':_0x28df2c}),{'ide':'其他','status':_0x53fcd0(0xf3),'message':_0x53fcd0(0xb0)};}export async function configureMcp(_0x575dcf,_0x436721){const _0x71d1b9=a4_0x2d9806;switch(_0x575dcf){case _0x71d1b9(0xe2):return await configureCursorMcp(_0x436721);case _0x71d1b9(0xfe):return await configureClaudeMcp(_0x436721);default:throw new Error(_0x71d1b9(0xbd)+_0x575dcf);}}async function copyCursorRules(_0x1853b6){const _0x5257b4=a4_0x2d9806,_0x34a61e=join(_0x1853b6,_0x5257b4(0xd5)),_0x1a8643=join(_0x34a61e,_0x5257b4(0xf0));if(existsSync(_0x1a8643))return;try{!existsSync(_0x34a61e)&&mkdirSync(_0x34a61e,{'recursive':!![]});const _0x1cb2c1=await getRulesContent();writeFileSync(_0x1a8643,_0x1cb2c1,'utf-8'),logger['info'](_0x5257b4(0xd2),'创建\x20Cursor\x20Rules\x20文件',{'to':_0x1a8643});}catch(_0x19a1f7){logger[_0x5257b4(0xcb)](_0x5257b4(0xd2),'复制\x20Cursor\x20Rules\x20文件失败',{'error':_0x19a1f7 instanceof Error?_0x19a1f7['message']:String(_0x19a1f7)});}}async function copyAgentsMd(_0x5002ae){const _0x36fec9=a4_0x2d9806,_0x4d81d0=join(_0x5002ae,_0x36fec9(0xb5));if(existsSync(_0x4d81d0))return;try{const _0x145bbc=await getRulesContent();writeFileSync(_0x4d81d0,_0x145bbc,_0x36fec9(0xd1)),logger[_0x36fec9(0xcc)]('mcp-install','创建\x20agents.md\x20文件',{'to':_0x4d81d0});}catch(_0x5b937c){logger[_0x36fec9(0xcb)]('mcp-install','复制\x20agents.md\x20文件失败',{'error':_0x5b937c instanceof Error?_0x5b937c['message']:String(_0x5b937c)});}}export const SKILL_IDE_CONFIGS=IDE_CONFIGS;export async function installSkill(_0x204c7b,_0x200b76){const _0x58c843=a4_0x2d9806,_0x2f3271=_0x200b76||process[_0x58c843(0xe3)](),_0x2aa005=resolve(__dirname,'../../cdn-source/skills'),_0x60134a=SKILL_IDE_CONFIGS[_0x204c7b];if(!_0x60134a)return{'ide':_0x204c7b,'status':_0x58c843(0xcb),'message':_0x58c843(0xd8)+_0x204c7b};const _0x564547=_0x60134a[_0x58c843(0xb8)];try{let _0x37dc8e;try{_0x37dc8e=await fetchGuidesFromCDN();}catch{}const _0x374bd2=await installSingleIDE(_0x204c7b,_0x60134a,_0x2f3271,_0x2aa005,_0x37dc8e);return _0x37dc8e&&writeGuidesToProject(_0x37dc8e,_0x2f3271),logger[_0x58c843(0xcc)](_0x58c843(0xbb),_0x564547+_0x58c843(0xdf),{'ide':_0x204c7b,'filesCount':_0x374bd2}),{'ide':_0x564547,'status':_0x58c843(0xf5),'message':_0x58c843(0xea)+_0x374bd2+'\x20项'};}catch(_0x4e16fe){return logger[_0x58c843(0xcb)]('skill-install',_0x564547+'\x20技能包安装失败',{'error':_0x4e16fe instanceof Error?_0x4e16fe[_0x58c843(0xca)]:String(_0x4e16fe)}),{'ide':_0x564547,'status':_0x58c843(0xcb),'message':_0x4e16fe instanceof Error?_0x4e16fe[_0x58c843(0xca)]:String(_0x4e16fe)};}}function a4_0x2c0e(){const _0x8f93a=['online','44313DAPGQk','.lovrabet/skill/.shared','utf-8','mcp-install','claude\x20mcp\x20add\x20','\x22:\x20{','rules','app','node:fs','未知的\x20IDE:\x20','\x20\x20}','17084474BCUemM','\x0a📋\x20其他\x20IDE\x20MCP\x20配置:\x0a','.cursor','lovrabet-dataset','\x20\x20\x20\x20\x20\x20}','\x20技能包安装成功','Cursor\x20MCP\x20配置成功','\x20\x20\x20\x20\x20\x20\x22args\x22:\x20[','cursor','cwd','toISOString','请手动执行:\x20','创建技能包\x20manifest','2.0.0','log','需要先配置\x20appcode','已创建\x20','\x20\x20\x20\x20\x20\x20\x20\x20\x22LOVRABET_APP_CODE\x22:\x20\x22','\x20\x20环境:\x20','\x0a📋\x20请执行以下命令配置\x20Claude\x20Code\x20MCP:\x0a','env','mcp.json','lovrabet_rules.mdc','3370eBgYhb','LOVRABET_ENV','manual','其他\x20IDE\x20配置指引已显示','success','2246845jOKDVe','.shared','Cursor','20250SyySnW','parse','join','188VFtowR','stringify','claude','.lovrabet','\x20\x20\x20\x20\x20\x20\x22command\x22:\x20\x22','配置指引已显示','\x20\x20\x20\x20\x20\x20\x20\x20\x22LOVRABET_ENV\x22:\x20\x22','共享技能文件复制失败','\x20\x20重启\x20Claude\x20Code\x20后生效\x0a','256RwVUrx','agents.md','9788040ZzyYBv','354ZtWZXH','name','mcpServers','1682XYDmwr','skill-install','配置信息:','不支持的\x20MCP\x20IDE:\x20','npx','Claude\x20Code\x20MCP\x20命令已生成','共享技能文件复制成功','\x20\x20\x20\x20\x20\x20\x22env\x22:\x20{','.lovrabet/skill-manifest.json','@lovrabet/dataset-mcp-server@latest','188314TvAhTV','\x20\x20\x22mcpServers\x22:\x20{','object','\x20-e\x20LOVRABET_APP_CODE=','appcode','\x20-e\x20LOVRABET_ENV=','message','error','info','\x20\x20AppCode:\x20'];a4_0x2c0e=function(){return _0x8f93a;};return a4_0x2c0e();}async function copyDir(_0x52c12d,_0x3a7aed){const _0x457693=a4_0x2d9806,{statSync:_0x55b99a}=await import(_0x457693(0xd7)),{readdirSync:_0x5c6b65}=await import(_0x457693(0xd7)),_0x3ee611=_0x55b99a(_0x52c12d);if(_0x3ee611['isDirectory']()){!existsSync(_0x3a7aed)&&mkdirSync(_0x3a7aed,{'recursive':!![]});const _0x111185=_0x5c6b65(_0x52c12d);for(const _0x3140c1 of _0x111185){await copyDir(join(_0x52c12d,_0x3140c1),join(_0x3a7aed,_0x3140c1));}}else copyFileSync(_0x52c12d,_0x3a7aed);}export async function copySharedSkills(_0x54c84c){const _0x2cc4b7=a4_0x2d9806,_0x3e6baa=_0x54c84c||process[_0x2cc4b7(0xe3)](),_0x43221b=resolve(__dirname,'../../cdn-source/skills'),_0x1326e0=join(_0x43221b,_0x2cc4b7(0xf7)),_0x5bc21e=join(_0x3e6baa,_0x2cc4b7(0xd0));if(!existsSync(_0x1326e0))return![];try{return await copyDir(_0x1326e0,_0x5bc21e),logger[_0x2cc4b7(0xcc)](_0x2cc4b7(0xbb),_0x2cc4b7(0xc0),{'path':_0x5bc21e}),!![];}catch(_0x201f91){return logger['error']('skill-install',_0x2cc4b7(0xb2),{'error':_0x201f91 instanceof Error?_0x201f91['message']:String(_0x201f91)}),![];}}export function createSkillManifest(_0x5c96cc,_0x3ff5ff){const _0x3a1afa=a4_0x2d9806,_0x4ec302={'version':_0x3a1afa(0xe7),'installedAt':new Date()[_0x3a1afa(0xe4)](),'platforms':_0x3ff5ff},_0x4aebdc=join(_0x5c96cc,_0x3a1afa(0xc2)),_0x21c356=join(_0x5c96cc,_0x3a1afa(0xff));!existsSync(_0x21c356)&&mkdirSync(_0x21c356,{'recursive':!![]}),writeFileSync(_0x4aebdc,JSON['stringify'](_0x4ec302,null,0x2),_0x3a1afa(0xd1)),logger[_0x3a1afa(0xcc)]('skill-install',_0x3a1afa(0xe6),{'path':_0x4aebdc});}
1
+ function a4_0x4b9d(_0x3c3779,_0x7692b8){_0x3c3779=_0x3c3779-0x1a1;const _0x51494b=a4_0x5149();let _0x4b9d62=_0x51494b[_0x3c3779];return _0x4b9d62;}const a4_0x30f68b=a4_0x4b9d;(function(_0x3420f6,_0x2424e1){const _0x433dc8=a4_0x4b9d,_0x2b94e1=_0x3420f6();while(!![]){try{const _0xacdb9d=-parseInt(_0x433dc8(0x1c5))/0x1*(parseInt(_0x433dc8(0x1ef))/0x2)+-parseInt(_0x433dc8(0x1b8))/0x3*(parseInt(_0x433dc8(0x1d5))/0x4)+parseInt(_0x433dc8(0x1ca))/0x5*(parseInt(_0x433dc8(0x1eb))/0x6)+-parseInt(_0x433dc8(0x1cb))/0x7+parseInt(_0x433dc8(0x1c2))/0x8*(-parseInt(_0x433dc8(0x1d9))/0x9)+parseInt(_0x433dc8(0x1ac))/0xa*(parseInt(_0x433dc8(0x1de))/0xb)+parseInt(_0x433dc8(0x1cc))/0xc*(parseInt(_0x433dc8(0x1e7))/0xd);if(_0xacdb9d===_0x2424e1)break;else _0x2b94e1['push'](_0x2b94e1['shift']());}catch(_0x304ed6){_0x2b94e1['push'](_0x2b94e1['shift']());}}}(a4_0x5149,0xc125d));import{existsSync,mkdirSync,writeFileSync,readFileSync,copyFileSync}from'node:fs';import{join,resolve,dirname}from'node:path';import{fileURLToPath}from'node:url';function a4_0x5149(){const _0xf49638=['toISOString','info','\x20\x20\x20\x20\x20\x20\x20\x20\x22LOVRABET_ENV\x22:\x20\x22','\x20技能包安装失败','Claude\x20Code','复制\x20Cursor\x20Rules\x20文件失败','lovrabet-dataset','skill-install','已创建\x20','87EyLgwi','\x20\x20\x20\x20\x20\x20}','LOVRABET_ENV','创建技能包\x20manifest','env','error','rules','mcp-install','success','join','342424okZyGW','配置信息:','\x22:\x20{','5hYOMKY','npx','\x0a📋\x20请执行以下命令配置\x20Claude\x20Code\x20MCP:\x0a','\x20\x20\x20\x20\x20\x20\x22command\x22:\x20\x22','需要先配置\x20appcode','1870hLCGkO','2630271JezKAi','11976kkjrCH','Cursor\x20MCP\x20配置成功','claude','创建\x20Cursor\x20Rules\x20文件','请手动执行:\x20','\x20\x20}','\x20\x20\x20\x20\x20\x20\x22env\x22:\x20{','\x20\x20\x20\x20}','\x20-e\x20LOVRABET_APP_CODE=','179048xddspN','.cursor','\x20\x20重启\x20Claude\x20Code\x20后生效\x0a','Cursor','189hynzSW','\x20技能包安装成功','\x0a📋\x20其他\x20IDE\x20MCP\x20配置:\x0a','utf-8','\x20\x20环境:\x20','11IZcfKB','log','lovrabet_rules.mdc','配置指引已显示','appcode','message','mcpServers','未知的\x20IDE:\x20','\x20\x20AppCode:\x20','24596GQQOnX','online','.lovrabet','不支持的\x20MCP\x20IDE:\x20','4518pETVBR','\x20\x20\x20\x20\x20\x20\x20\x20\x22LOVRABET_APP_CODE\x22:\x20\x22','../../cdn-source/skills','2.0.0','35560qWBVFC','stringify','object','共享技能文件复制失败','.shared','\x20-e\x20LOVRABET_ENV=','创建\x20agents.md\x20文件','map','.lovrabet/skill-manifest.json','agents.md','manual','node:fs','Claude\x20Code\x20MCP\x20命令已生成','12829090JpyfCx','cwd','cursor'];a4_0x5149=function(){return _0xf49638;};return a4_0x5149();}import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';import{IDE_CONFIGS}from'../utils/ai_config.js';import{installSingleIDE}from'../skills/skill-installer.js';import{fetchGuidesFromCDN,writeGuidesToProject}from'../utils/guides-cdn.js';import{getRulesContent}from'../utils/rules-cdn.js';const __dirname=dirname(fileURLToPath(import.meta.url)),MCP_SERVER_NAME=a4_0x30f68b(0x1b5),MCP_COMMAND=a4_0x30f68b(0x1c6),MCP_ARGS=['@lovrabet/dataset-mcp-server@latest'];export function buildEnvConfig(_0x28dc06,_0x2a6bfc){const _0x343ccf=a4_0x30f68b,_0x551554={'LOVRABET_APP_CODE':String(_0x28dc06)};return _0x2a6bfc!==_0x343ccf(0x1e8)&&(_0x551554[_0x343ccf(0x1ba)]=String(_0x2a6bfc)),_0x551554;}export async function configureCursorMcp(_0x1f6fe7){const _0x22fec4=a4_0x30f68b,_0x387de5=_0x1f6fe7||process['cwd'](),_0xc69d8b=readConfig(_0x387de5),_0x579996=_0xc69d8b[_0x22fec4(0x1e2)]||_0xc69d8b['app'],_0x5a0dd4=_0xc69d8b[_0x22fec4(0x1bc)]||_0x22fec4(0x1e8);if(!_0x579996)return{'ide':_0x22fec4(0x1d8),'status':'error','message':_0x22fec4(0x1c9)};const _0xdf447=buildEnvConfig(_0x579996,_0x5a0dd4),_0x2d6c76={'command':MCP_COMMAND,'args':MCP_ARGS,'env':_0xdf447},_0x34fcac=join(_0x387de5,'.cursor','mcp.json'),_0x1c111b=join(_0x387de5,_0x22fec4(0x1d6));try{!existsSync(_0x1c111b)&&mkdirSync(_0x1c111b,{'recursive':!![]});let _0x4e9588={'mcpServers':{}};if(existsSync(_0x34fcac)){const _0x240352=readFileSync(_0x34fcac,'utf-8');_0x4e9588=JSON['parse'](_0x240352);}return(!_0x4e9588['mcpServers']||typeof _0x4e9588[_0x22fec4(0x1e4)]!==_0x22fec4(0x1a1))&&(_0x4e9588['mcpServers']={}),_0x4e9588[_0x22fec4(0x1e4)][MCP_SERVER_NAME]=_0x2d6c76,writeFileSync(_0x34fcac,JSON['stringify'](_0x4e9588,null,0x2),_0x22fec4(0x1dc)),logger[_0x22fec4(0x1b0)](_0x22fec4(0x1bf),_0x22fec4(0x1cd),{'appcode':_0x579996,'env':_0x5a0dd4,'path':_0x34fcac}),await copyCursorRules(_0x1c111b),{'ide':_0x22fec4(0x1d8),'status':_0x22fec4(0x1c0),'message':'已写入\x20.cursor/mcp.json'};}catch(_0x4641e6){return logger['error'](_0x22fec4(0x1bf),'Cursor\x20MCP\x20配置失败',{'error':_0x4641e6 instanceof Error?_0x4641e6[_0x22fec4(0x1e3)]:String(_0x4641e6)}),{'ide':_0x22fec4(0x1d8),'status':_0x22fec4(0x1bd),'message':_0x4641e6 instanceof Error?_0x4641e6[_0x22fec4(0x1e3)]:String(_0x4641e6)};}}export async function configureClaudeMcp(_0x29d169){const _0x59897c=a4_0x30f68b,_0x5d4509=_0x29d169||process['cwd'](),_0x586707=readConfig(_0x5d4509),_0x43c4c9=_0x586707[_0x59897c(0x1e2)]||_0x586707['app'],_0x346ba8=_0x586707['env']||'online';if(!_0x43c4c9)return{'ide':_0x59897c(0x1b3),'status':'error','message':_0x59897c(0x1c9)};let _0x5b0bde='claude\x20mcp\x20add\x20'+MCP_SERVER_NAME+'\x20'+MCP_COMMAND+'\x20'+MCP_ARGS[_0x59897c(0x1c1)]('\x20')+_0x59897c(0x1d4)+_0x43c4c9;return _0x346ba8!=='online'&&(_0x5b0bde+=_0x59897c(0x1a4)+_0x346ba8),await copyAgentsMd(_0x5d4509),logger[_0x59897c(0x1b0)](_0x59897c(0x1bf),_0x59897c(0x1ab),{'command':_0x5b0bde,'appcode':_0x43c4c9,'env':_0x346ba8}),console[_0x59897c(0x1df)](_0x59897c(0x1c7)),console['log']('\x20\x20'+_0x5b0bde+'\x0a'),console[_0x59897c(0x1df)](_0x59897c(0x1c3)),console[_0x59897c(0x1df)](_0x59897c(0x1e6)+_0x43c4c9),_0x346ba8!=='online'&&console[_0x59897c(0x1df)](_0x59897c(0x1dd)+_0x346ba8),console[_0x59897c(0x1df)](_0x59897c(0x1d7)),{'ide':_0x59897c(0x1b3),'status':_0x59897c(0x1a9),'message':_0x59897c(0x1d0)+_0x5b0bde};}export async function showOtherGuide(_0x401001){const _0x4d13e5=a4_0x30f68b,_0x3d1454=_0x401001||process[_0x4d13e5(0x1ad)](),_0x10dd4e=readConfig(_0x3d1454),_0x5107fb=_0x10dd4e[_0x4d13e5(0x1e2)]||_0x10dd4e['app'],_0x48a1d6=_0x10dd4e[_0x4d13e5(0x1bc)]||_0x4d13e5(0x1e8);if(!_0x5107fb)return{'ide':'其他','status':_0x4d13e5(0x1bd),'message':_0x4d13e5(0x1c9)};return console[_0x4d13e5(0x1df)](_0x4d13e5(0x1db)),console[_0x4d13e5(0x1df)]('{'),console[_0x4d13e5(0x1df)]('\x20\x20\x22mcpServers\x22:\x20{'),console['log']('\x20\x20\x20\x20\x22'+MCP_SERVER_NAME+_0x4d13e5(0x1c4)),console['log'](_0x4d13e5(0x1c8)+MCP_COMMAND+'\x22,'),console[_0x4d13e5(0x1df)]('\x20\x20\x20\x20\x20\x20\x22args\x22:\x20['+MCP_ARGS[_0x4d13e5(0x1a6)](_0x13d5c4=>'\x22'+_0x13d5c4+'\x22')[_0x4d13e5(0x1c1)](',\x20')+'],'),console[_0x4d13e5(0x1df)](_0x4d13e5(0x1d2)),console[_0x4d13e5(0x1df)](_0x4d13e5(0x1ec)+_0x5107fb+'\x22,'),_0x48a1d6!==_0x4d13e5(0x1e8)&&console[_0x4d13e5(0x1df)](_0x4d13e5(0x1b1)+_0x48a1d6+'\x22,'),console[_0x4d13e5(0x1df)](_0x4d13e5(0x1b9)),console[_0x4d13e5(0x1df)](_0x4d13e5(0x1d3)),console[_0x4d13e5(0x1df)](_0x4d13e5(0x1d1)),console[_0x4d13e5(0x1df)]('}\x0a'),logger[_0x4d13e5(0x1b0)]('mcp-install','其他\x20IDE\x20配置指引已显示',{'appcode':_0x5107fb,'env':_0x48a1d6}),{'ide':'其他','status':_0x4d13e5(0x1a9),'message':_0x4d13e5(0x1e1)};}export async function configureMcp(_0x568dcb,_0x308a17){const _0x596820=a4_0x30f68b;switch(_0x568dcb){case _0x596820(0x1ae):return await configureCursorMcp(_0x308a17);case _0x596820(0x1ce):return await configureClaudeMcp(_0x308a17);default:throw new Error(_0x596820(0x1ea)+_0x568dcb);}}async function copyCursorRules(_0x3daa21){const _0xa242ec=a4_0x30f68b,_0x4a74bd=join(_0x3daa21,_0xa242ec(0x1be)),_0x5f1370=join(_0x4a74bd,_0xa242ec(0x1e0));if(existsSync(_0x5f1370))return;try{!existsSync(_0x4a74bd)&&mkdirSync(_0x4a74bd,{'recursive':!![]});const _0x3028ad=await getRulesContent();writeFileSync(_0x5f1370,_0x3028ad,_0xa242ec(0x1dc)),logger[_0xa242ec(0x1b0)](_0xa242ec(0x1bf),_0xa242ec(0x1cf),{'to':_0x5f1370});}catch(_0x59ec8d){logger['error']('mcp-install',_0xa242ec(0x1b4),{'error':_0x59ec8d instanceof Error?_0x59ec8d['message']:String(_0x59ec8d)});}}async function copyAgentsMd(_0x188be6){const _0x4aef0d=a4_0x30f68b,_0x4e4ae5=join(_0x188be6,_0x4aef0d(0x1a8));if(existsSync(_0x4e4ae5))return;try{const _0xa48fe8=await getRulesContent();writeFileSync(_0x4e4ae5,_0xa48fe8,_0x4aef0d(0x1dc)),logger[_0x4aef0d(0x1b0)](_0x4aef0d(0x1bf),_0x4aef0d(0x1a5),{'to':_0x4e4ae5});}catch(_0x103aee){logger['error'](_0x4aef0d(0x1bf),'复制\x20agents.md\x20文件失败',{'error':_0x103aee instanceof Error?_0x103aee[_0x4aef0d(0x1e3)]:String(_0x103aee)});}}export const SKILL_IDE_CONFIGS=IDE_CONFIGS;export async function installSkill(_0x2f55f7,_0x4fd1cd){const _0x4cfc9c=a4_0x30f68b,_0x2b3e6e=_0x4fd1cd||process[_0x4cfc9c(0x1ad)](),_0x4a95b2=resolve(__dirname,_0x4cfc9c(0x1ed)),_0x372c5c=SKILL_IDE_CONFIGS[_0x2f55f7];if(!_0x372c5c)return{'ide':_0x2f55f7,'status':_0x4cfc9c(0x1bd),'message':_0x4cfc9c(0x1e5)+_0x2f55f7};const _0x29e354=_0x372c5c['name'];try{let _0x128c24;try{_0x128c24=await fetchGuidesFromCDN();}catch{}const _0xec0d2a=await installSingleIDE(_0x2f55f7,_0x372c5c,_0x2b3e6e,_0x4a95b2,_0x128c24);return _0x128c24&&writeGuidesToProject(_0x128c24,_0x2b3e6e),logger[_0x4cfc9c(0x1b0)]('skill-install',_0x29e354+_0x4cfc9c(0x1da),{'ide':_0x2f55f7,'filesCount':_0xec0d2a}),{'ide':_0x29e354,'status':_0x4cfc9c(0x1c0),'message':_0x4cfc9c(0x1b7)+_0xec0d2a+'\x20项'};}catch(_0x373f14){return logger[_0x4cfc9c(0x1bd)](_0x4cfc9c(0x1b6),_0x29e354+_0x4cfc9c(0x1b2),{'error':_0x373f14 instanceof Error?_0x373f14[_0x4cfc9c(0x1e3)]:String(_0x373f14)}),{'ide':_0x29e354,'status':_0x4cfc9c(0x1bd),'message':_0x373f14 instanceof Error?_0x373f14['message']:String(_0x373f14)};}}async function copyDir(_0x59d756,_0x5bfa24){const _0x583c58=a4_0x30f68b,{statSync:_0x174242}=await import('node:fs'),{readdirSync:_0x511c96}=await import(_0x583c58(0x1aa)),_0x2123f2=_0x174242(_0x59d756);if(_0x2123f2['isDirectory']()){!existsSync(_0x5bfa24)&&mkdirSync(_0x5bfa24,{'recursive':!![]});const _0x3adf7f=_0x511c96(_0x59d756);for(const _0x53568f of _0x3adf7f){await copyDir(join(_0x59d756,_0x53568f),join(_0x5bfa24,_0x53568f));}}else copyFileSync(_0x59d756,_0x5bfa24);}export async function copySharedSkills(_0x55fc11){const _0x58a239=a4_0x30f68b,_0x29e686=_0x55fc11||process[_0x58a239(0x1ad)](),_0x3fba4b=resolve(__dirname,_0x58a239(0x1ed)),_0x286be7=join(_0x3fba4b,_0x58a239(0x1a3)),_0x4e08a1=join(_0x29e686,'.lovrabet/skill/.shared');if(!existsSync(_0x286be7))return![];try{return await copyDir(_0x286be7,_0x4e08a1),logger['info'](_0x58a239(0x1b6),'共享技能文件复制成功',{'path':_0x4e08a1}),!![];}catch(_0x3b3315){return logger[_0x58a239(0x1bd)]('skill-install',_0x58a239(0x1a2),{'error':_0x3b3315 instanceof Error?_0x3b3315['message']:String(_0x3b3315)}),![];}}export function createSkillManifest(_0x2c1d4c,_0x558279){const _0x37bb2c=a4_0x30f68b,_0x37eaa6={'version':_0x37bb2c(0x1ee),'installedAt':new Date()[_0x37bb2c(0x1af)](),'platforms':_0x558279},_0x3704c3=join(_0x2c1d4c,_0x37bb2c(0x1a7)),_0xfba98f=join(_0x2c1d4c,_0x37bb2c(0x1e9));!existsSync(_0xfba98f)&&mkdirSync(_0xfba98f,{'recursive':!![]}),writeFileSync(_0x3704c3,JSON[_0x37bb2c(0x1f0)](_0x37eaa6,null,0x2),_0x37bb2c(0x1dc)),logger['info'](_0x37bb2c(0x1b6),_0x37bb2c(0x1bb),{'path':_0x3704c3});}
@@ -1 +1 @@
1
- (function(_0x1f404a,_0x2d5791){const _0x546d0c=a5_0x299f,_0x4df107=_0x1f404a();while(!![]){try{const _0xfc4180=parseInt(_0x546d0c(0xaf))/0x1+parseInt(_0x546d0c(0xdc))/0x2*(-parseInt(_0x546d0c(0xd0))/0x3)+parseInt(_0x546d0c(0xba))/0x4+-parseInt(_0x546d0c(0xe7))/0x5*(-parseInt(_0x546d0c(0xe3))/0x6)+-parseInt(_0x546d0c(0xd7))/0x7*(parseInt(_0x546d0c(0xc8))/0x8)+-parseInt(_0x546d0c(0xe6))/0x9*(-parseInt(_0x546d0c(0xc4))/0xa)+parseInt(_0x546d0c(0xd6))/0xb;if(_0xfc4180===_0x2d5791)break;else _0x4df107['push'](_0x4df107['shift']());}catch(_0x2adcbf){_0x4df107['push'](_0x4df107['shift']());}}}(a5_0x2b4f,0xc0379));import{jsx as a5_0x13893b,jsxs as a5_0x4f3e77,Fragment as a5_0x470316}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_0x2b4f(){const _0x1ad074=['指定的数据集代码都不存在:\x20','未找到任何数据集','green','*\x20生成的文档文件:','\x20个数据集的文档...','\x20(环境:\x20','正在生成\x20','2670672RaNBly','.md\x20(','column','log','yellow','join','cyan','\x20个数据集中筛选出\x20','*\x20共处理\x20','./docs','61820pyUsUE','string','datasetCode','文档生成失败:\x20','21200euIgsy','文档生成完成','dim','map','message','datasetName','使用指定的应用AppCode:\x20','filePath','28893ZtpYzp','正在获取数据集列表...','api-doc','*\x20输出目录:\x20','💡\x20请使用\x20','gray','7740524eUTJxN','2919zEyzzX','\x20个数据集','\x20-\x20','\x1b[0m','includes','254gHfnBf','length','\x20重新登录后再试','online','success','cwd','filter','18qafwaf','\x1b[90m*\x20从\x20','error','1242ogYPsh','378915qSDroz','env','🚀\x20','663691jSWmKz','red','\x20个匹配的数据集\x1b[0m','\x1b[33m!\x20以下数据集代码不存在:\x20'];a5_0x2b4f=function(){return _0x1ad074;};return a5_0x2b4f();}function a5_0x299f(_0x295d9e,_0x14357d){_0x295d9e=_0x295d9e-0xad;const _0x2b4f3d=a5_0x2b4f();let _0x299fde=_0x2b4f3d[_0x295d9e];return _0x299fde;}import{generateDatasetDocs}from'./api-doc.js';import{logger}from'../utils/logger.js';export const ApiDocUI=({appCode:_0xcf29ae,env:_0x3d6958,output:_0x18c32e,extraParams:_0x4a1ac5,datasetCodes:_0x519775})=>{const _0x2942cf=a5_0x299f,{exit:_0x3a24a1}=useApp(),[_0x499981,_0x4945f9]=useState(![]),[_0x152d46,_0x2ce125]=useState(''),[_0x521cf2,_0x401299]=useState(![]),[_0x2203b2,_0x269793]=useState(null),[_0x52f302,_0xa9c941]=useState(null),[_0x5ba73b,_0x3c9839]=useState(0x0),_0x1b6380=readConfig(),_0x50813a=getConfigAppCode(),_0xc2d548=_0xcf29ae||_0x50813a,_0x407c71=typeof _0x1b6380?.[_0x2942cf(0xad)]===_0x2942cf(0xc5)?_0x1b6380[_0x2942cf(0xad)]:undefined,_0x35a3ee=_0x3d6958||_0x407c71||_0x2942cf(0xdf);initEnv(_0x35a3ee);const _0xb0e2a0=_0x18c32e||_0x2942cf(0xc3),_0x10a8ee=_0xcf29ae?_0x2942cf(0xce)+_0xc2d548:'使用配置的应用AppCode:\x20'+_0xc2d548;useEffect(()=>{_0x4945f9(!![]),_0x5d6132();},[]),useEffect(()=>{(_0x521cf2||_0x2203b2)&&_0x3a24a1();},[_0x521cf2,_0x2203b2,_0x3a24a1]);async function _0x5d6132(){const _0xece476=_0x2942cf;if(!_0xc2d548){_0x269793('未提供应用AppCode,且配置中也没有默认值');return;}try{logger['setLogPath'](process[_0xece476(0xe1)]()),_0x2ce125(_0xece476(0xd1));const {configArray:_0x184a06}=await fetchModelList(_0xc2d548);_0x3c9839(_0x184a06[_0xece476(0xdd)]);if(_0x184a06[_0xece476(0xdd)]===0x0){_0x269793(_0xece476(0xb4));return;}let _0x1fc6b9=_0x184a06;if(_0x519775&&_0x519775[_0xece476(0xdd)]>0x0){_0x1fc6b9=_0x184a06[_0xece476(0xe2)](_0x30b59d=>_0x519775[_0xece476(0xdb)](_0x30b59d[_0xece476(0xc6)]));const _0x16b1d=_0x1fc6b9[_0xece476(0xcb)](_0x1f4e64=>_0x1f4e64[_0xece476(0xc6)]),_0x31d2ab=_0x519775[_0xece476(0xe2)](_0x25b424=>!_0x16b1d[_0xece476(0xdb)](_0x25b424));_0x31d2ab[_0xece476(0xdd)]>0x0&&console[_0xece476(0xbd)](_0xece476(0xb2)+_0x31d2ab['join'](',\x20')+_0xece476(0xda));if(_0x1fc6b9[_0xece476(0xdd)]===0x0){_0x269793(_0xece476(0xb3)+_0x519775[_0xece476(0xbf)](',\x20'));return;}console['log'](_0xece476(0xe4)+_0x184a06[_0xece476(0xdd)]+_0xece476(0xc1)+_0x1fc6b9[_0xece476(0xdd)]+_0xece476(0xb1));}_0x2ce125(_0xece476(0xb9)+_0x1fc6b9[_0xece476(0xdd)]+_0xece476(0xb7));const _0x2b9c7b=await generateDatasetDocs(_0x1fc6b9,_0xc2d548,_0xb0e2a0,(_0x9488a5,_0x42eec0,_0x542162)=>{const _0xead280=_0xece476;_0x2ce125('正在生成\x20'+_0x542162+_0xead280(0xbb)+_0x9488a5+'/'+_0x42eec0+')');},_0x4a1ac5);_0xa9c941(_0x2b9c7b),_0x401299(!![]);const _0x412954=_0x2b9c7b[_0xece476(0xe2)](_0x57a90b=>_0x57a90b[_0xece476(0xe0)])[_0xece476(0xdd)],_0x4847ff=_0x2b9c7b[_0xece476(0xe2)](_0x87a4af=>!_0x87a4af[_0xece476(0xe0)])['length'];logger[_0xece476(0xe0)](_0xece476(0xd2),_0xece476(0xc9),undefined,{'totalCount':_0x2b9c7b[_0xece476(0xdd)],'successCount':_0x412954,'failCount':_0x4847ff,'outputDir':_0xb0e2a0});}catch(_0xbb7ac7){const _0x1edf21=_0xbb7ac7 instanceof Error?_0xbb7ac7[_0xece476(0xcc)]:String(_0xbb7ac7);logger[_0xece476(0xe5)]('api-doc',_0xece476(0xc7)+_0x1edf21,{'appCode':_0xc2d548,'outputDir':_0xb0e2a0}),_0x269793(_0xece476(0xc7)+_0x1edf21);}finally{_0x4945f9(![]);}}const _0x2814d9=_0x52f302?.[_0x2942cf(0xe2)](_0x408b6b=>_0x408b6b[_0x2942cf(0xe0)])['length']||0x0,_0x1a6ccd=_0x52f302?.[_0x2942cf(0xe2)](_0x19c662=>!_0x19c662['success'])[_0x2942cf(0xdd)]||0x0;return a5_0x4f3e77(Box,{'flexDirection':'column','children':[(_0x499981||_0x521cf2)&&a5_0x4f3e77(Box,{'children':[a5_0x13893b(Text,{'color':_0x2942cf(0xd5),'children':'*\x20'}),a5_0x13893b(Text,{'color':_0xcf29ae?'white':_0x2942cf(0xca),'children':_0x10a8ee})]}),_0x499981&&a5_0x13893b(Box,{'children':a5_0x4f3e77(Text,{'children':[_0x2942cf(0xae),_0x152d46,_0x2942cf(0xb8),_0x35a3ee,')']})}),_0x521cf2&&_0x52f302&&a5_0x4f3e77(Box,{'flexDirection':_0x2942cf(0xbc),'children':[a5_0x13893b(Box,{'children':a5_0x4f3e77(Text,{'color':_0x2942cf(0xb5),'children':['√\x20文档生成完成!成功\x20',_0x2814d9,'\x20个',_0x1a6ccd>0x0&&',\x20失败\x20'+_0x1a6ccd+'\x20个']})}),a5_0x13893b(Box,{'marginTop':0x1,'children':a5_0x4f3e77(Text,{'color':_0x2942cf(0xd5),'children':[_0x2942cf(0xc2),_0x5ba73b,_0x2942cf(0xd8)]})}),a5_0x4f3e77(Box,{'marginTop':0x1,'children':[a5_0x13893b(Text,{'color':_0x2942cf(0xd5),'children':_0x2942cf(0xd3)}),a5_0x13893b(Text,{'color':_0x2942cf(0xc0),'children':_0xb0e2a0})]}),_0x2814d9>0x0&&a5_0x4f3e77(a5_0x470316,{'children':[a5_0x13893b(Box,{'marginTop':0x1,'children':a5_0x13893b(Text,{'color':_0x2942cf(0xd5),'children':_0x2942cf(0xb6)})}),_0x52f302[_0x2942cf(0xe2)](_0x486e1d=>_0x486e1d[_0x2942cf(0xe0)])['map']((_0x2f9a71,_0xbfd8b1)=>a5_0x4f3e77(Box,{'marginLeft':0x2,'children':[a5_0x4f3e77(Text,{'color':_0x2942cf(0xc0),'children':['•\x20',_0x2f9a71[_0x2942cf(0xcf)]]}),a5_0x4f3e77(Text,{'color':_0x2942cf(0xca),'children':[_0x2942cf(0xd9),_0x2f9a71[_0x2942cf(0xcd)]]})]},_0xbfd8b1))]}),_0x1a6ccd>0x0&&a5_0x4f3e77(a5_0x470316,{'children':[a5_0x13893b(Box,{'marginTop':0x1,'children':a5_0x13893b(Text,{'color':_0x2942cf(0xbe),'children':'⚠️\x20以下数据集生成失败:'})}),_0x52f302[_0x2942cf(0xe2)](_0x4587f5=>!_0x4587f5[_0x2942cf(0xe0)])['map']((_0x361ace,_0x5c34cc)=>a5_0x4f3e77(Box,{'marginLeft':0x2,'flexDirection':'column','children':[a5_0x4f3e77(Text,{'color':_0x2942cf(0xb0),'children':['•\x20',_0x361ace[_0x2942cf(0xcd)],'\x20(',_0x361ace[_0x2942cf(0xc6)],')']}),_0x361ace[_0x2942cf(0xe5)]&&a5_0x13893b(Box,{'marginLeft':0x2,'children':a5_0x13893b(Text,{'color':_0x2942cf(0xca),'children':_0x361ace[_0x2942cf(0xe5)]})})]},_0x5c34cc))]})]}),_0x2203b2&&a5_0x4f3e77(Box,{'flexDirection':_0x2942cf(0xbc),'children':[a5_0x13893b(Box,{'children':a5_0x4f3e77(Text,{'color':_0x2942cf(0xb0),'children':['❌\x20',_0x2203b2]})}),_0x2203b2[_0x2942cf(0xdb)]('登录')&&a5_0x4f3e77(Box,{'marginTop':0x1,'children':[a5_0x13893b(Text,{'color':_0x2942cf(0xbe),'children':_0x2942cf(0xd4)}),a5_0x13893b(Text,{'color':'cyan','children':'lovrabet\x20auth'}),a5_0x13893b(Text,{'color':_0x2942cf(0xbe),'children':_0x2942cf(0xde)})]})]})]});};
1
+ (function(_0x1c8e80,_0x3629eb){const _0x1a141c=a5_0x5253,_0x151bbd=_0x1c8e80();while(!![]){try{const _0xbf6c5a=parseInt(_0x1a141c(0x12e))/0x1+parseInt(_0x1a141c(0x145))/0x2*(-parseInt(_0x1a141c(0x144))/0x3)+parseInt(_0x1a141c(0x153))/0x4*(parseInt(_0x1a141c(0x12c))/0x5)+-parseInt(_0x1a141c(0x146))/0x6*(parseInt(_0x1a141c(0x13d))/0x7)+-parseInt(_0x1a141c(0x130))/0x8*(parseInt(_0x1a141c(0x150))/0x9)+parseInt(_0x1a141c(0x143))/0xa+parseInt(_0x1a141c(0x138))/0xb;if(_0xbf6c5a===_0x3629eb)break;else _0x151bbd['push'](_0x151bbd['shift']());}catch(_0x16c946){_0x151bbd['push'](_0x151bbd['shift']());}}}(a5_0x4617,0xa6f2c));import{jsx as a5_0x5b3da7,jsxs as a5_0x53544d,Fragment as a5_0x159378}from'react/jsx-runtime';function a5_0x5253(_0x56ea0f,_0x333c5b){_0x56ea0f=_0x56ea0f-0x129;const _0x461791=a5_0x4617();let _0x52534c=_0x461791[_0x56ea0f];return _0x52534c;}import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';import{initEnv}from'../constant/env.js';import{fetchModelList}from'./fetch-model-list.js';import{generateDatasetDocs}from'./api-doc.js';import{logger}from'../utils/logger.js';export const ApiDocUI=({appCode:_0x761338,env:_0x21024d,output:_0x100410,extraParams:_0x21340d,datasetCodes:_0x4afd84})=>{const _0x540f3c=a5_0x5253,{exit:_0x2991b7}=useApp(),[_0x319e0c,_0x182bd5]=useState(![]),[_0x460f25,_0x5d242f]=useState(''),[_0x227a02,_0x433942]=useState(![]),[_0x43e822,_0x351d97]=useState(null),[_0x3e3c6e,_0x5957f2]=useState(null),[_0xb7a021,_0x2967e6]=useState(0x0),_0x1b347e=readConfig(),_0x6aa9e9=getConfigAppCode(),_0x1d6d06=_0x761338||_0x6aa9e9,_0x1bf4a5=typeof _0x1b347e?.[_0x540f3c(0x157)]===_0x540f3c(0x14e)?_0x1b347e['env']:undefined,_0x1a41e9=_0x21024d||_0x1bf4a5||'online';initEnv(_0x1a41e9);const _0x30d6df=_0x100410||_0x540f3c(0x141),_0xf017e2=_0x761338?_0x540f3c(0x12d)+_0x1d6d06:_0x540f3c(0x139)+_0x1d6d06;useEffect(()=>{_0x182bd5(!![]),_0x4aa7a8();},[]),useEffect(()=>{(_0x227a02||_0x43e822)&&_0x2991b7();},[_0x227a02,_0x43e822,_0x2991b7]);async function _0x4aa7a8(){const _0x39ccb6=_0x540f3c;if(!_0x1d6d06){_0x351d97(_0x39ccb6(0x13a));return;}try{logger[_0x39ccb6(0x136)](process[_0x39ccb6(0x15c)]()),_0x5d242f('正在获取数据集列表...');const {configArray:_0x329c9b}=await fetchModelList(_0x1d6d06);_0x2967e6(_0x329c9b[_0x39ccb6(0x14c)]);if(_0x329c9b[_0x39ccb6(0x14c)]===0x0){_0x351d97(_0x39ccb6(0x14a));return;}let _0x6e2cc0=_0x329c9b;if(_0x4afd84&&_0x4afd84[_0x39ccb6(0x14c)]>0x0){_0x6e2cc0=_0x329c9b[_0x39ccb6(0x155)](_0x59972d=>_0x4afd84[_0x39ccb6(0x13f)](_0x59972d[_0x39ccb6(0x151)]));const _0x2d62ba=_0x6e2cc0[_0x39ccb6(0x15d)](_0x5b13c3=>_0x5b13c3[_0x39ccb6(0x151)]),_0x4151d8=_0x4afd84['filter'](_0x9879=>!_0x2d62ba['includes'](_0x9879));_0x4151d8[_0x39ccb6(0x14c)]>0x0&&console[_0x39ccb6(0x134)](_0x39ccb6(0x135)+_0x4151d8['join'](',\x20')+_0x39ccb6(0x140));if(_0x6e2cc0[_0x39ccb6(0x14c)]===0x0){_0x351d97(_0x39ccb6(0x147)+_0x4afd84[_0x39ccb6(0x148)](',\x20'));return;}console[_0x39ccb6(0x134)](_0x39ccb6(0x160)+_0x329c9b['length']+_0x39ccb6(0x129)+_0x6e2cc0['length']+_0x39ccb6(0x142));}_0x5d242f(_0x39ccb6(0x158)+_0x6e2cc0[_0x39ccb6(0x14c)]+_0x39ccb6(0x15b));const _0x18c0bd=await generateDatasetDocs(_0x6e2cc0,_0x1d6d06,_0x30d6df,(_0x1bdba4,_0x307037,_0x2b1893)=>{const _0x4aece1=_0x39ccb6;_0x5d242f('正在生成\x20'+_0x2b1893+_0x4aece1(0x14f)+_0x1bdba4+'/'+_0x307037+')');},_0x21340d);_0x5957f2(_0x18c0bd),_0x433942(!![]);const _0x34e4e8=_0x18c0bd['filter'](_0x1998e9=>_0x1998e9[_0x39ccb6(0x15f)])['length'],_0x309843=_0x18c0bd[_0x39ccb6(0x155)](_0x469b94=>!_0x469b94['success'])[_0x39ccb6(0x14c)];logger[_0x39ccb6(0x15f)]('api-doc',_0x39ccb6(0x154),undefined,{'totalCount':_0x18c0bd[_0x39ccb6(0x14c)],'successCount':_0x34e4e8,'failCount':_0x309843,'outputDir':_0x30d6df});}catch(_0x561e32){const _0x51a39f=_0x561e32 instanceof Error?_0x561e32[_0x39ccb6(0x14b)]:String(_0x561e32);logger[_0x39ccb6(0x156)](_0x39ccb6(0x132),_0x39ccb6(0x15a)+_0x51a39f,{'appCode':_0x1d6d06,'outputDir':_0x30d6df}),_0x351d97('文档生成失败:\x20'+_0x51a39f);}finally{_0x182bd5(![]);}}const _0x189a2c=_0x3e3c6e?.[_0x540f3c(0x155)](_0x3088a9=>_0x3088a9[_0x540f3c(0x15f)])[_0x540f3c(0x14c)]||0x0,_0x24261a=_0x3e3c6e?.['filter'](_0x1101b3=>!_0x1101b3[_0x540f3c(0x15f)])[_0x540f3c(0x14c)]||0x0;return a5_0x53544d(Box,{'flexDirection':'column','children':[(_0x319e0c||_0x227a02)&&a5_0x53544d(Box,{'children':[a5_0x5b3da7(Text,{'color':'gray','children':'*\x20'}),a5_0x5b3da7(Text,{'color':_0x761338?'white':'dim','children':_0xf017e2})]}),_0x319e0c&&a5_0x5b3da7(Box,{'children':a5_0x53544d(Text,{'children':['🚀\x20',_0x460f25,'\x20(环境:\x20',_0x1a41e9,')']})}),_0x227a02&&_0x3e3c6e&&a5_0x53544d(Box,{'flexDirection':'column','children':[a5_0x5b3da7(Box,{'children':a5_0x53544d(Text,{'color':_0x540f3c(0x133),'children':[_0x540f3c(0x13e),_0x189a2c,'\x20个',_0x24261a>0x0&&_0x540f3c(0x149)+_0x24261a+'\x20个']})}),a5_0x5b3da7(Box,{'marginTop':0x1,'children':a5_0x53544d(Text,{'color':'gray','children':[_0x540f3c(0x14d),_0xb7a021,_0x540f3c(0x161)]})}),a5_0x53544d(Box,{'marginTop':0x1,'children':[a5_0x5b3da7(Text,{'color':_0x540f3c(0x131),'children':'*\x20输出目录:\x20'}),a5_0x5b3da7(Text,{'color':_0x540f3c(0x13c),'children':_0x30d6df})]}),_0x189a2c>0x0&&a5_0x53544d(a5_0x159378,{'children':[a5_0x5b3da7(Box,{'marginTop':0x1,'children':a5_0x5b3da7(Text,{'color':_0x540f3c(0x131),'children':_0x540f3c(0x137)})}),_0x3e3c6e[_0x540f3c(0x155)](_0xee430f=>_0xee430f[_0x540f3c(0x15f)])[_0x540f3c(0x15d)]((_0x1c25d8,_0x493685)=>a5_0x53544d(Box,{'marginLeft':0x2,'children':[a5_0x53544d(Text,{'color':_0x540f3c(0x13c),'children':['•\x20',_0x1c25d8['filePath']]}),a5_0x53544d(Text,{'color':'dim','children':[_0x540f3c(0x13b),_0x1c25d8[_0x540f3c(0x12f)]]})]},_0x493685))]}),_0x24261a>0x0&&a5_0x53544d(a5_0x159378,{'children':[a5_0x5b3da7(Box,{'marginTop':0x1,'children':a5_0x5b3da7(Text,{'color':_0x540f3c(0x152),'children':_0x540f3c(0x15e)})}),_0x3e3c6e[_0x540f3c(0x155)](_0x11f2c9=>!_0x11f2c9[_0x540f3c(0x15f)])['map']((_0x526967,_0x122b60)=>a5_0x53544d(Box,{'marginLeft':0x2,'flexDirection':_0x540f3c(0x12b),'children':[a5_0x53544d(Text,{'color':_0x540f3c(0x159),'children':['•\x20',_0x526967['datasetName'],'\x20(',_0x526967[_0x540f3c(0x151)],')']}),_0x526967[_0x540f3c(0x156)]&&a5_0x5b3da7(Box,{'marginLeft':0x2,'children':a5_0x5b3da7(Text,{'color':'dim','children':_0x526967['error']})})]},_0x122b60))]})]}),_0x43e822&&a5_0x53544d(Box,{'flexDirection':_0x540f3c(0x12b),'children':[a5_0x5b3da7(Box,{'children':a5_0x53544d(Text,{'color':'red','children':['❌\x20',_0x43e822]})}),_0x43e822[_0x540f3c(0x13f)]('登录')&&a5_0x53544d(Box,{'marginTop':0x1,'children':[a5_0x5b3da7(Text,{'color':_0x540f3c(0x152),'children':'💡\x20请使用\x20'}),a5_0x5b3da7(Text,{'color':_0x540f3c(0x13c),'children':_0x540f3c(0x12a)}),a5_0x5b3da7(Text,{'color':_0x540f3c(0x152),'children':'\x20重新登录后再试'})]})]})]});};function a5_0x4617(){const _0x134426=['green','log','\x1b[33m!\x20以下数据集代码不存在:\x20','setLogPath','*\x20生成的文档文件:','14867127jxaPmN','使用配置的应用AppCode:\x20','未提供应用AppCode,且配置中也没有默认值','\x20-\x20','cyan','7MwBlDb','√\x20文档生成完成!成功\x20','includes','\x1b[0m','./docs','\x20个匹配的数据集\x1b[0m','2732310lnAFGQ','111LXLcTh','10198uGxmky','4423386DzRKBY','指定的数据集代码都不存在:\x20','join',',\x20失败\x20','未找到任何数据集','message','length','*\x20共处理\x20','string','.md\x20(','9NhBYOg','datasetCode','yellow','4uAVyVt','文档生成完成','filter','error','env','正在生成\x20','red','文档生成失败:\x20','\x20个数据集的文档...','cwd','map','⚠️\x20以下数据集生成失败:','success','\x1b[90m*\x20从\x20','\x20个数据集','\x20个数据集中筛选出\x20','lovrabet\x20auth','column','41845okGXnL','使用指定的应用AppCode:\x20','750778FIRKBN','datasetName','6193768SAAGkm','gray','api-doc'];a5_0x4617=function(){return _0x134426;};return a5_0x4617();}
@@ -1 +1 @@
1
- (function(_0x1addae,_0x549140){const _0x294311=a6_0x57d2,_0x25a86c=_0x1addae();while(!![]){try{const _0x442318=parseInt(_0x294311(0xbd))/0x1*(-parseInt(_0x294311(0xd5))/0x2)+-parseInt(_0x294311(0xc6))/0x3+parseInt(_0x294311(0xc2))/0x4+parseInt(_0x294311(0xc9))/0x5*(parseInt(_0x294311(0xca))/0x6)+parseInt(_0x294311(0xc5))/0x7*(-parseInt(_0x294311(0xd2))/0x8)+parseInt(_0x294311(0xba))/0x9+parseInt(_0x294311(0xb6))/0xa*(-parseInt(_0x294311(0xc8))/0xb);if(_0x442318===_0x549140)break;else _0x25a86c['push'](_0x25a86c['shift']());}catch(_0x37fcb6){_0x25a86c['push'](_0x25a86c['shift']());}}}(a6_0x5cbf,0xee7f1));import{mkdirSync,writeFileSync}from'node:fs';import a6_0x181384 from'node:path';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';function a6_0x57d2(_0x537fcd,_0x16e496){_0x537fcd=_0x537fcd-0xaf;const _0x5cbffa=a6_0x5cbf();let _0x57d2f2=_0x5cbffa[_0x537fcd];return _0x57d2f2;}import{logger}from'../utils/logger.js';export async function fetchDatasetDoc(_0xf618d8){const _0x38eb9c=a6_0x57d2,{appCode:_0x9b6855,datasetCode:_0x378b6c,datasetId:_0x30d377,extraParams:_0x1e185e}=_0xf618d8,_0x4a2ac6=getApiDomain(),_0x202d9d=_0x4a2ac6+_0x38eb9c(0xd9),_0x3eb34a={'appCode':_0x9b6855,'datasetCode':_0x378b6c,'datasetId':_0x30d377,..._0x1e185e||{}},_0x583198=await fetch(_0x202d9d,{'method':'POST','headers':{'Content-Type':'application/json','Cookie':getCookie()},'body':JSON[_0x38eb9c(0xb8)](_0x3eb34a)});if(!_0x583198['ok']){if(_0x583198['status']===0x191)throw new Error('登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录');let _0x245a05='';try{_0x245a05=await _0x583198[_0x38eb9c(0xd8)]();}catch(_0x551663){}throw new Error(_0x38eb9c(0xd4)+_0x378b6c+_0x38eb9c(0xb9)+_0x583198[_0x38eb9c(0xbc)]+(_0x245a05?'\x0a'+_0x245a05:''));}const _0x24e193=await _0x583198[_0x38eb9c(0xb3)]();if(!_0x24e193[_0x38eb9c(0xaf)]||typeof _0x24e193[_0x38eb9c(0xaf)]['markdown']!==_0x38eb9c(0xbf))throw new Error(_0x38eb9c(0xce)+_0x378b6c+'):缺少\x20data.markdown\x20字段');return _0x24e193[_0x38eb9c(0xaf)][_0x38eb9c(0xd6)];}function delay(_0x9b0e20){return new Promise(_0x5a8bc3=>setTimeout(_0x5a8bc3,_0x9b0e20));}export async function generateDatasetDocs(_0x2cfb16,_0x27b9fa,_0x4620ec='./docs',_0x2a1b8a,_0xd3a4af){const _0x35862d=a6_0x57d2;mkdirSync(_0x4620ec,{'recursive':!![]});const _0xf76203=[],_0x27a391=_0x2cfb16[_0x35862d(0xc7)];console[_0x35862d(0xd0)](_0x35862d(0xbb)+_0x27a391+_0x35862d(0xb2));for(let _0x1bc7ea=0x0;_0x1bc7ea<_0x2cfb16[_0x35862d(0xc7)];_0x1bc7ea++){const _0x30d8c3=_0x2cfb16[_0x1bc7ea],_0x20eb81=_0x1bc7ea+0x1,_0x565616=_0x30d8c3[_0x35862d(0xc1)];try{console[_0x35862d(0xd0)]('['+_0x20eb81+'/'+_0x27a391+_0x35862d(0xb1)+_0x565616+_0x35862d(0xd7)+_0x30d8c3[_0x35862d(0xbe)]+')');_0x2a1b8a&&_0x2a1b8a(_0x20eb81,_0x27a391,_0x565616);const _0x40c0dd=await fetchDatasetDoc({'appCode':_0x27b9fa,'datasetCode':_0x30d8c3[_0x35862d(0xd1)],'datasetId':_0x30d8c3['id'],'enableAI':![],'extraParams':_0xd3a4af}),_0x3e1898=a6_0x181384['join'](_0x4620ec,_0x565616+_0x35862d(0xc0));writeFileSync(_0x3e1898,_0x40c0dd,{'encoding':'utf8'}),console[_0x35862d(0xd0)](_0x35862d(0xcd)+_0x565616+'.md'),logger[_0x35862d(0xb7)](_0x35862d(0xb4),_0x35862d(0xcb)+_0x565616,undefined,{'datasetCode':_0x30d8c3[_0x35862d(0xd1)],'datasetName':_0x30d8c3[_0x35862d(0xbe)],'filePath':_0x3e1898,'progress':_0x20eb81+'/'+_0x27a391}),_0xf76203[_0x35862d(0xb5)]({'datasetCode':_0x30d8c3['datasetCode'],'datasetName':_0x30d8c3[_0x35862d(0xbe)],'filePath':_0x3e1898,'success':!![]}),_0x20eb81<_0x27a391&&await delay(0x1388);}catch(_0xbb1d43){const _0x569c7c=_0xbb1d43 instanceof Error?_0xbb1d43[_0x35862d(0xb0)]:String(_0xbb1d43);console[_0x35862d(0xd0)](_0x35862d(0xcc)+_0x565616+_0x35862d(0xc4)+_0x569c7c+'\x0a'),logger[_0x35862d(0xd3)](_0x35862d(0xb4),_0x35862d(0xc3)+_0x30d8c3['datasetCode'],{'datasetCode':_0x30d8c3['datasetCode'],'datasetName':_0x30d8c3[_0x35862d(0xbe)],'error':_0x569c7c,'progress':_0x20eb81+'/'+_0x27a391}),_0xf76203[_0x35862d(0xb5)]({'datasetCode':_0x30d8c3['datasetCode'],'datasetName':_0x30d8c3[_0x35862d(0xbe)],'filePath':'','success':![],'error':_0x569c7c}),_0x20eb81<_0x27a391&&(console[_0x35862d(0xd0)](_0x35862d(0xcf)),await delay(0xbb8));}}return _0xf76203;}function a6_0x5cbf(){const _0x297013=['.md\x20-\x20','28RAvCMO','1248810XPBCLj','length','42119HLdtER','20pUbraI','637122GRHmkQ','生成文档成功:\x20','✗\x20失败:\x20','✓\x20成功生成:\x20','响应数据格式错误\x20(','等待\x203\x20秒...\x0a','log','datasetCode','202408RIHrcH','error','获取文档失败\x20(','2dHIWdZ','markdown','.md\x20(','text','/api/node-toolbox/api-doc-generator','data','message',']\x20正在生成:\x20','\x20个数据集需要生成文档\x0a','json','api-doc','push','1470QcshnA','success','stringify','),HTTP状态码:\x20','16706610jGmgUI','\x0a共有\x20','status','1110644BeMLhv','name','string','.md','tableName','3547296pFlInl','生成文档失败:\x20'];a6_0x5cbf=function(){return _0x297013;};return a6_0x5cbf();}
1
+ const a6_0x2dca5a=a6_0x5c36;function a6_0x5c36(_0x56a08d,_0x4b5bd9){_0x56a08d=_0x56a08d-0x165;const _0x592609=a6_0x5926();let _0x5c367b=_0x592609[_0x56a08d];return _0x5c367b;}(function(_0x2cadad,_0x4cf5cb){const _0x412ff4=a6_0x5c36,_0x119fea=_0x2cadad();while(!![]){try{const _0x4dce12=parseInt(_0x412ff4(0x18f))/0x1+-parseInt(_0x412ff4(0x176))/0x2*(parseInt(_0x412ff4(0x185))/0x3)+parseInt(_0x412ff4(0x17c))/0x4*(parseInt(_0x412ff4(0x17e))/0x5)+-parseInt(_0x412ff4(0x184))/0x6+-parseInt(_0x412ff4(0x179))/0x7+parseInt(_0x412ff4(0x183))/0x8*(parseInt(_0x412ff4(0x18b))/0x9)+parseInt(_0x412ff4(0x168))/0xa*(parseInt(_0x412ff4(0x16f))/0xb);if(_0x4dce12===_0x4cf5cb)break;else _0x119fea['push'](_0x119fea['shift']());}catch(_0x5db119){_0x119fea['push'](_0x119fea['shift']());}}}(a6_0x5926,0xea9e5));import{mkdirSync,writeFileSync}from'node:fs';import a6_0x10734e from'node:path';import{getCookie}from'../auth/get-cookie.js';function a6_0x5926(){const _0x516459=[']\x20正在生成:\x20','13478531mIkvtB','stringify','):缺少\x20data.markdown\x20字段','json','生成文档失败:\x20','\x20个数据集需要生成文档\x0a','join','62JjdoXa','name','./docs','289982lmKURy','.md','),HTTP状态码:\x20','12pHXyeQ','等待\x203\x20秒...\x0a','2278315FrVtZY','data','api-doc','\x0a共有\x20','length','70936KvhRzt','7372836OvUDwB','144744neSmbp','/api/node-toolbox/api-doc-generator','.md\x20-\x20','text','log','application/json','468NoEKdL','string','生成文档成功:\x20','message','673523ofOgeI','✓\x20成功生成:\x20','tableName','获取文档失败\x20(','10HVcABe','markdown','✗\x20失败:\x20','status','datasetCode','.md\x20('];a6_0x5926=function(){return _0x516459;};return a6_0x5926();}import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';export async function fetchDatasetDoc(_0x5654c7){const _0x1f613d=a6_0x5c36,{appCode:_0x3152ac,datasetCode:_0x1dd43a,datasetId:_0x26c3af,extraParams:_0x32d966}=_0x5654c7,_0xb96455=getApiDomain(),_0x1c7859=_0xb96455+_0x1f613d(0x186),_0x3df5eb={'appCode':_0x3152ac,'datasetCode':_0x1dd43a,'datasetId':_0x26c3af,..._0x32d966||{}},_0x389d81=await fetch(_0x1c7859,{'method':'POST','headers':{'Content-Type':_0x1f613d(0x18a),'Cookie':getCookie()},'body':JSON[_0x1f613d(0x170)](_0x3df5eb)});if(!_0x389d81['ok']){if(_0x389d81[_0x1f613d(0x16b)]===0x191)throw new Error('登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录');let _0x2ecfcd='';try{_0x2ecfcd=await _0x389d81[_0x1f613d(0x188)]();}catch(_0x67e57a){}throw new Error(_0x1f613d(0x167)+_0x1dd43a+_0x1f613d(0x17b)+_0x389d81[_0x1f613d(0x16b)]+(_0x2ecfcd?'\x0a'+_0x2ecfcd:''));}const _0x26c083=await _0x389d81[_0x1f613d(0x172)]();if(!_0x26c083[_0x1f613d(0x17f)]||typeof _0x26c083['data'][_0x1f613d(0x169)]!==_0x1f613d(0x18c))throw new Error('响应数据格式错误\x20('+_0x1dd43a+_0x1f613d(0x171));return _0x26c083[_0x1f613d(0x17f)][_0x1f613d(0x169)];}function delay(_0x11b70f){return new Promise(_0x3934da=>setTimeout(_0x3934da,_0x11b70f));}export async function generateDatasetDocs(_0xbaf22d,_0x5fe309,_0x42847e=a6_0x2dca5a(0x178),_0x112a32,_0x720ee){const _0x28a901=a6_0x2dca5a;mkdirSync(_0x42847e,{'recursive':!![]});const _0x466e30=[],_0x431481=_0xbaf22d[_0x28a901(0x182)];console[_0x28a901(0x189)](_0x28a901(0x181)+_0x431481+_0x28a901(0x174));for(let _0x347863=0x0;_0x347863<_0xbaf22d['length'];_0x347863++){const _0x4fc74a=_0xbaf22d[_0x347863],_0x5db781=_0x347863+0x1,_0x5749b3=_0x4fc74a[_0x28a901(0x166)];try{console['log']('['+_0x5db781+'/'+_0x431481+_0x28a901(0x16e)+_0x5749b3+_0x28a901(0x16d)+_0x4fc74a['name']+')');_0x112a32&&_0x112a32(_0x5db781,_0x431481,_0x5749b3);const _0x11d7e8=await fetchDatasetDoc({'appCode':_0x5fe309,'datasetCode':_0x4fc74a[_0x28a901(0x16c)],'datasetId':_0x4fc74a['id'],'enableAI':![],'extraParams':_0x720ee}),_0x3f64f6=a6_0x10734e[_0x28a901(0x175)](_0x42847e,_0x5749b3+_0x28a901(0x17a));writeFileSync(_0x3f64f6,_0x11d7e8,{'encoding':'utf8'}),console[_0x28a901(0x189)](_0x28a901(0x165)+_0x5749b3+_0x28a901(0x17a)),logger['success'](_0x28a901(0x180),_0x28a901(0x18d)+_0x5749b3,undefined,{'datasetCode':_0x4fc74a[_0x28a901(0x16c)],'datasetName':_0x4fc74a['name'],'filePath':_0x3f64f6,'progress':_0x5db781+'/'+_0x431481}),_0x466e30['push']({'datasetCode':_0x4fc74a[_0x28a901(0x16c)],'datasetName':_0x4fc74a['name'],'filePath':_0x3f64f6,'success':!![]}),_0x5db781<_0x431481&&await delay(0x1388);}catch(_0x5ad919){const _0x5d08c2=_0x5ad919 instanceof Error?_0x5ad919[_0x28a901(0x18e)]:String(_0x5ad919);console[_0x28a901(0x189)](_0x28a901(0x16a)+_0x5749b3+_0x28a901(0x187)+_0x5d08c2+'\x0a'),logger['error'](_0x28a901(0x180),_0x28a901(0x173)+_0x4fc74a[_0x28a901(0x16c)],{'datasetCode':_0x4fc74a[_0x28a901(0x16c)],'datasetName':_0x4fc74a[_0x28a901(0x177)],'error':_0x5d08c2,'progress':_0x5db781+'/'+_0x431481}),_0x466e30['push']({'datasetCode':_0x4fc74a['datasetCode'],'datasetName':_0x4fc74a['name'],'filePath':'','success':![],'error':_0x5d08c2}),_0x5db781<_0x431481&&(console['log'](_0x28a901(0x17d)),await delay(0xbb8));}}return _0x466e30;}
@@ -1 +1 @@
1
- (function(_0x15c88d,_0x225943){const _0x47cb96=a7_0x5143,_0xe40a79=_0x15c88d();while(!![]){try{const _0x463242=-parseInt(_0x47cb96(0x1fc))/0x1*(-parseInt(_0x47cb96(0x202))/0x2)+parseInt(_0x47cb96(0x1d9))/0x3+-parseInt(_0x47cb96(0x1f4))/0x4*(-parseInt(_0x47cb96(0x200))/0x5)+-parseInt(_0x47cb96(0x1e5))/0x6*(-parseInt(_0x47cb96(0x1e4))/0x7)+-parseInt(_0x47cb96(0x1e0))/0x8+-parseInt(_0x47cb96(0x1eb))/0x9*(-parseInt(_0x47cb96(0x208))/0xa)+-parseInt(_0x47cb96(0x1db))/0xb*(parseInt(_0x47cb96(0x1f6))/0xc);if(_0x463242===_0x225943)break;else _0xe40a79['push'](_0xe40a79['shift']());}catch(_0x2ca060){_0xe40a79['push'](_0xe40a79['shift']());}}}(a7_0x6e7a,0xc21c0));import{jsx as a7_0x63c5ae,jsxs as a7_0x3fcd19}from'react/jsx-runtime';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';import{initEnv}from'../constant/env.js';function a7_0x5143(_0x12d7b0,_0x2cc4c2){_0x12d7b0=_0x12d7b0-0x1d4;const _0x6e7a11=a7_0x6e7a();let _0x514316=_0x6e7a11[_0x12d7b0];return _0x514316;}import{generateApiFile}from'./generate-api-file.js';function a7_0x6e7a(){const _0x11b109=['includes','9280488dLmiVV','green','originalCount','lovrabet\x20auth','21IrKotD','391038nUXLDS','yellow','white','-\x20模型配置文件\x20(','*\x20已生成文件:','cyan','63TQinRM','使用配置的应用AppCode:\x20','slice','./src/api/','-api','modelCount','api','length','env','8QtjbkV','setLogPath','14024700wPtGQU','*\x20导入方式:','join','column','api-pull','message','3073GwHhUZ','string','使用指定的应用AppCode:\x20','online','440745OqwRUU','red','890ghRaoY','duplicateCount','cwd','import\x20','gray','-client','1431210BDSUfe','\x20from\x20\x27@/','√\x20成功拉取\x20','{\x20lovrabetClient\x20}','datasetCount','.ts','拉取\x20API\x20配置失败:\x20','\x20个模型)','\x20重新登录后再试','\x20个,过滤重复','\x20个数据集,生成','4654302tmsQNV','未提供应用AppCode,且配置中也没有默认值','22aVxTMS','client','dim','replace'];a7_0x6e7a=function(){return _0x11b109;};return a7_0x6e7a();}import{logger}from'../utils/logger.js';import{fetchModelList}from'./fetch-model-list.js';export const ApiPullUI=({appCode:_0x10ebc3,env:_0x1fa688,output:_0x47d642})=>{const _0x3a6fac=a7_0x5143,{exit:_0x15afcf}=useApp(),[_0x3703c0,_0x279a18]=useState(![]),[_0x5d07f1,_0x53a499]=useState(![]),[_0x36308f,_0x179f58]=useState(null),[_0x511bc0,_0x49c139]=useState(null),_0x22faae=readConfig(),_0x4a8900=getConfigAppCode(),_0x205942=_0x10ebc3||_0x4a8900,_0x5673c9=typeof _0x22faae?.[_0x3a6fac(0x1f3)]===_0x3a6fac(0x1fd)?_0x22faae[_0x3a6fac(0x1f3)]:undefined,_0x313e84=_0x1fa688||_0x5673c9||_0x3a6fac(0x1ff);initEnv(_0x313e84);const _0x1890de=_0x47d642||_0x3a6fac(0x1ee),_0x5880d3=_0x10ebc3&&_0x10ebc3[_0x3a6fac(0x1df)]('-')?_0x10ebc3['split']('-')[_0x3a6fac(0x1ed)](0x1)[_0x3a6fac(0x1f8)]('-'):'',_0x517a0f=_0x10ebc3?_0x3a6fac(0x1fe)+_0x205942:_0x3a6fac(0x1ec)+_0x205942,_0x232230=_0x5880d3?_0x5880d3+_0x3a6fac(0x1ef):'api',_0x14506a=_0x5880d3?_0x5880d3+_0x3a6fac(0x207):_0x3a6fac(0x1dc);useEffect(()=>{_0x279a18(!![]),_0x4f3012();},[]),useEffect(()=>{(_0x5d07f1||_0x36308f)&&_0x15afcf();},[_0x5d07f1,_0x36308f,_0x15afcf]);async function _0x4f3012(){const _0xcfa5a9=_0x3a6fac;if(!_0x205942){_0x179f58(_0xcfa5a9(0x1da));return;}try{logger[_0xcfa5a9(0x1f5)](process[_0xcfa5a9(0x204)]());const {configArray:_0x44ae8a}=await fetchModelList(_0x205942),_0x2eb2d2=_0x44ae8a[_0xcfa5a9(0x1f2)],_0x1dc2ee=!_0x10ebc3,_0x25843c=await generateApiFile(_0x44ae8a,_0x5880d3,_0x205942,_0x1dc2ee,_0x313e84,_0x1890de),_0x27a088=_0x1890de['endsWith']('/')?_0x1890de:_0x1890de+'/';_0x49c139({'api':''+_0x27a088+_0x232230+_0xcfa5a9(0x20d),'client':''+_0x27a088+_0x14506a+_0xcfa5a9(0x20d),'modelCount':_0x25843c[_0xcfa5a9(0x1f0)],'datasetCount':_0x2eb2d2,'originalCount':_0x2eb2d2,'duplicateCount':0x0}),_0x53a499(!![]);}catch(_0x249ce4){const _0x68bb60=_0x249ce4 instanceof Error?_0x249ce4[_0xcfa5a9(0x1fb)]:String(_0x249ce4);logger['error'](_0xcfa5a9(0x1fa),_0xcfa5a9(0x1d4)+_0x68bb60,{'appCode':_0x205942,'error':_0x68bb60}),_0x179f58('拉取\x20API\x20配置失败:\x20'+_0x68bb60);}finally{_0x279a18(![]);}}return a7_0x3fcd19(Box,{'flexDirection':'column','children':[(_0x3703c0||_0x5d07f1)&&a7_0x3fcd19(Box,{'children':[a7_0x63c5ae(Text,{'color':'gray','children':'*\x20'}),a7_0x63c5ae(Text,{'color':_0x10ebc3?_0x3a6fac(0x1e7):_0x3a6fac(0x1dd),'children':_0x517a0f})]}),_0x3703c0&&a7_0x63c5ae(Box,{'children':a7_0x3fcd19(Text,{'children':['🚀\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20',_0x313e84,')']})}),_0x5d07f1&&_0x511bc0&&a7_0x3fcd19(Box,{'flexDirection':'column','children':[a7_0x63c5ae(Box,{'children':a7_0x3fcd19(Text,{'color':_0x3a6fac(0x1e1),'children':[_0x3a6fac(0x20a),_0x511bc0[_0x3a6fac(0x20c)],_0x3a6fac(0x1d8),'\x20',_0x511bc0['modelCount'],'\x20个模型']})}),_0x511bc0[_0x3a6fac(0x203)]>0x0&&a7_0x63c5ae(Box,{'marginTop':0x1,'children':a7_0x3fcd19(Text,{'color':'yellow','children':['!\x20原始数据集\x20',_0x511bc0[_0x3a6fac(0x1e2)],_0x3a6fac(0x1d7),'\x20',_0x511bc0[_0x3a6fac(0x203)],'\x20个']})}),a7_0x63c5ae(Box,{'marginTop':0x1,'children':a7_0x63c5ae(Text,{'color':_0x3a6fac(0x206),'children':_0x3a6fac(0x1e9)})}),a7_0x3fcd19(Box,{'marginLeft':0x2,'children':[a7_0x3fcd19(Text,{'color':_0x3a6fac(0x1ea),'children':['•\x20',_0x511bc0[_0x3a6fac(0x1f1)]]}),a7_0x3fcd19(Text,{'color':_0x3a6fac(0x1dd),'children':['\x20',_0x3a6fac(0x1e8),_0x511bc0[_0x3a6fac(0x1f0)],_0x3a6fac(0x1d5)]})]}),a7_0x3fcd19(Box,{'marginLeft':0x2,'children':[a7_0x3fcd19(Text,{'color':'cyan','children':['•\x20',_0x511bc0[_0x3a6fac(0x1dc)]]}),a7_0x63c5ae(Text,{'color':_0x3a6fac(0x1dd),'children':'\x20-\x20客户端实例文件'})]}),a7_0x63c5ae(Box,{'marginTop':0x1,'children':a7_0x63c5ae(Text,{'color':_0x3a6fac(0x206),'children':_0x3a6fac(0x1f7)})}),a7_0x63c5ae(Box,{'marginLeft':0x2,'children':a7_0x3fcd19(Text,{'color':_0x3a6fac(0x1e6),'children':[_0x3a6fac(0x205),_0x3a6fac(0x20b),_0x3a6fac(0x209),_0x511bc0[_0x3a6fac(0x1dc)]['replace'](/^\.\//,'')[_0x3a6fac(0x1de)]('.ts',''),'\x27']})})]}),_0x36308f&&a7_0x3fcd19(Box,{'flexDirection':_0x3a6fac(0x1f9),'children':[a7_0x63c5ae(Box,{'children':a7_0x3fcd19(Text,{'color':_0x3a6fac(0x201),'children':['❌\x20',_0x36308f]})}),_0x36308f[_0x3a6fac(0x1df)]('登录')&&a7_0x3fcd19(Box,{'marginTop':0x1,'children':[a7_0x63c5ae(Text,{'color':'yellow','children':'💡\x20请使用\x20'}),a7_0x63c5ae(Text,{'color':_0x3a6fac(0x1ea),'children':_0x3a6fac(0x1e3)}),a7_0x63c5ae(Text,{'color':_0x3a6fac(0x1e6),'children':_0x3a6fac(0x1d6)})]})]})]});};
1
+ (function(_0x2d5ee1,_0x26591a){const _0x69ae7c=a7_0x1227,_0x154a80=_0x2d5ee1();while(!![]){try{const _0x2f7259=parseInt(_0x69ae7c(0x181))/0x1+parseInt(_0x69ae7c(0x17e))/0x2*(-parseInt(_0x69ae7c(0x197))/0x3)+parseInt(_0x69ae7c(0x198))/0x4+parseInt(_0x69ae7c(0x184))/0x5+-parseInt(_0x69ae7c(0x16c))/0x6*(-parseInt(_0x69ae7c(0x18a))/0x7)+-parseInt(_0x69ae7c(0x194))/0x8*(-parseInt(_0x69ae7c(0x190))/0x9)+-parseInt(_0x69ae7c(0x178))/0xa*(parseInt(_0x69ae7c(0x18e))/0xb);if(_0x2f7259===_0x26591a)break;else _0x154a80['push'](_0x154a80['shift']());}catch(_0x3a0a51){_0x154a80['push'](_0x154a80['shift']());}}}(a7_0x51a7,0x1d752));import{jsx as a7_0x21c88b,jsxs as a7_0x390caf}from'react/jsx-runtime';import{useEffect,useState}from'react';function a7_0x51a7(){const _0x116a87=['lovrabet\x20auth','\x20个模型','332814yctRmS','\x20个数据集,生成','modelCount','split','error','slice','\x20from\x20\x27@/','duplicateCount','{\x20lovrabetClient\x20}','🚀\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','\x20重新登录后再试','column','2989460pLCoaq','import\x20','join','client','green','white','113882VaSLkW','.ts','拉取\x20API\x20配置失败:\x20','68513TRycXw','√\x20成功拉取\x20','\x20个,过滤重复','1091360FnhzuJ','使用配置的应用AppCode:\x20','datasetCount','online','api-pull','yellow','21wrnGBp','cwd','message','\x20个模型)','11tWQQam','cyan','145116yqFnNc','使用指定的应用AppCode:\x20','!\x20原始数据集\x20','gray','32QVdNXV','\x20-\x20客户端实例文件','includes','6mfSTGt','63192deuUlk','dim','replace','setLogPath','-\x20模型配置文件\x20(','-client','api','originalCount','未提供应用AppCode,且配置中也没有默认值','./src/api/'];a7_0x51a7=function(){return _0x116a87;};return a7_0x51a7();}function a7_0x1227(_0x32e64e,_0x411f2f){_0x32e64e=_0x32e64e-0x161;const _0x51a7f8=a7_0x51a7();let _0x12277c=_0x51a7f8[_0x32e64e];return _0x12277c;}import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';import{initEnv}from'../constant/env.js';import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';import{fetchModelList}from'./fetch-model-list.js';export const ApiPullUI=({appCode:_0x2cfbab,env:_0x80359a,output:_0x253cb1})=>{const _0x182187=a7_0x1227,{exit:_0x22c97b}=useApp(),[_0x5c08ff,_0x491cd3]=useState(![]),[_0x543e44,_0x5e6f1b]=useState(![]),[_0x33b88a,_0x1c2610]=useState(null),[_0x1f2409,_0x3d5813]=useState(null),_0x47d308=readConfig(),_0x177d5f=getConfigAppCode(),_0x2454cc=_0x2cfbab||_0x177d5f,_0x30b02e=typeof _0x47d308?.['env']==='string'?_0x47d308['env']:undefined,_0x2c8825=_0x80359a||_0x30b02e||_0x182187(0x187);initEnv(_0x2c8825);const _0x1131c3=_0x253cb1||_0x182187(0x169),_0x23f232=_0x2cfbab&&_0x2cfbab['includes']('-')?_0x2cfbab[_0x182187(0x16f)]('-')[_0x182187(0x171)](0x1)[_0x182187(0x17a)]('-'):'',_0x30298c=_0x2cfbab?_0x182187(0x191)+_0x2454cc:_0x182187(0x185)+_0x2454cc,_0x4ebe2e=_0x23f232?_0x23f232+'-api':_0x182187(0x166),_0xa97319=_0x23f232?_0x23f232+_0x182187(0x165):_0x182187(0x17b);useEffect(()=>{_0x491cd3(!![]),_0x159ac4();},[]),useEffect(()=>{(_0x543e44||_0x33b88a)&&_0x22c97b();},[_0x543e44,_0x33b88a,_0x22c97b]);async function _0x159ac4(){const _0x261c09=_0x182187;if(!_0x2454cc){_0x1c2610(_0x261c09(0x168));return;}try{logger[_0x261c09(0x163)](process[_0x261c09(0x18b)]());const {configArray:_0x270409}=await fetchModelList(_0x2454cc),_0x2f4d95=_0x270409['length'],_0x3bf3c7=!_0x2cfbab,_0x24a74b=await generateApiFile(_0x270409,_0x23f232,_0x2454cc,_0x3bf3c7,_0x2c8825,_0x1131c3),_0x5bb2dd=_0x1131c3['endsWith']('/')?_0x1131c3:_0x1131c3+'/';_0x3d5813({'api':''+_0x5bb2dd+_0x4ebe2e+_0x261c09(0x17f),'client':''+_0x5bb2dd+_0xa97319+_0x261c09(0x17f),'modelCount':_0x24a74b[_0x261c09(0x16e)],'datasetCount':_0x2f4d95,'originalCount':_0x2f4d95,'duplicateCount':0x0}),_0x5e6f1b(!![]);}catch(_0x41c849){const _0x24c2d2=_0x41c849 instanceof Error?_0x41c849[_0x261c09(0x18c)]:String(_0x41c849);logger[_0x261c09(0x170)](_0x261c09(0x188),'拉取\x20API\x20配置失败:\x20'+_0x24c2d2,{'appCode':_0x2454cc,'error':_0x24c2d2}),_0x1c2610(_0x261c09(0x180)+_0x24c2d2);}finally{_0x491cd3(![]);}}return a7_0x390caf(Box,{'flexDirection':_0x182187(0x177),'children':[(_0x5c08ff||_0x543e44)&&a7_0x390caf(Box,{'children':[a7_0x21c88b(Text,{'color':_0x182187(0x193),'children':'*\x20'}),a7_0x21c88b(Text,{'color':_0x2cfbab?_0x182187(0x17d):_0x182187(0x161),'children':_0x30298c})]}),_0x5c08ff&&a7_0x21c88b(Box,{'children':a7_0x390caf(Text,{'children':[_0x182187(0x175),_0x2c8825,')']})}),_0x543e44&&_0x1f2409&&a7_0x390caf(Box,{'flexDirection':_0x182187(0x177),'children':[a7_0x21c88b(Box,{'children':a7_0x390caf(Text,{'color':_0x182187(0x17c),'children':[_0x182187(0x182),_0x1f2409[_0x182187(0x186)],_0x182187(0x16d),'\x20',_0x1f2409[_0x182187(0x16e)],_0x182187(0x16b)]})}),_0x1f2409['duplicateCount']>0x0&&a7_0x21c88b(Box,{'marginTop':0x1,'children':a7_0x390caf(Text,{'color':_0x182187(0x189),'children':[_0x182187(0x192),_0x1f2409[_0x182187(0x167)],_0x182187(0x183),'\x20',_0x1f2409[_0x182187(0x173)],'\x20个']})}),a7_0x21c88b(Box,{'marginTop':0x1,'children':a7_0x21c88b(Text,{'color':_0x182187(0x193),'children':'*\x20已生成文件:'})}),a7_0x390caf(Box,{'marginLeft':0x2,'children':[a7_0x390caf(Text,{'color':'cyan','children':['•\x20',_0x1f2409[_0x182187(0x166)]]}),a7_0x390caf(Text,{'color':'dim','children':['\x20',_0x182187(0x164),_0x1f2409['modelCount'],_0x182187(0x18d)]})]}),a7_0x390caf(Box,{'marginLeft':0x2,'children':[a7_0x390caf(Text,{'color':_0x182187(0x18f),'children':['•\x20',_0x1f2409['client']]}),a7_0x21c88b(Text,{'color':'dim','children':_0x182187(0x195)})]}),a7_0x21c88b(Box,{'marginTop':0x1,'children':a7_0x21c88b(Text,{'color':'gray','children':'*\x20导入方式:'})}),a7_0x21c88b(Box,{'marginLeft':0x2,'children':a7_0x390caf(Text,{'color':_0x182187(0x189),'children':[_0x182187(0x179),_0x182187(0x174),_0x182187(0x172),_0x1f2409[_0x182187(0x17b)]['replace'](/^\.\//,'')[_0x182187(0x162)]('.ts',''),'\x27']})})]}),_0x33b88a&&a7_0x390caf(Box,{'flexDirection':_0x182187(0x177),'children':[a7_0x21c88b(Box,{'children':a7_0x390caf(Text,{'color':'red','children':['❌\x20',_0x33b88a]})}),_0x33b88a[_0x182187(0x196)]('登录')&&a7_0x390caf(Box,{'marginTop':0x1,'children':[a7_0x21c88b(Text,{'color':'yellow','children':'💡\x20请使用\x20'}),a7_0x21c88b(Text,{'color':_0x182187(0x18f),'children':_0x182187(0x16a)}),a7_0x21c88b(Text,{'color':_0x182187(0x189),'children':_0x182187(0x176)})]})]})]});};
@@ -1 +1 @@
1
- (function(_0x4ae6ea,_0x1ff150){const _0x8c3f50=a8_0x1d0f,_0x87519e=_0x4ae6ea();while(!![]){try{const _0x215619=-parseInt(_0x8c3f50(0x1c5))/0x1+parseInt(_0x8c3f50(0x1c8))/0x2+-parseInt(_0x8c3f50(0x1cc))/0x3*(-parseInt(_0x8c3f50(0x1b8))/0x4)+parseInt(_0x8c3f50(0x1ce))/0x5+-parseInt(_0x8c3f50(0x1b6))/0x6+parseInt(_0x8c3f50(0x1bf))/0x7+-parseInt(_0x8c3f50(0x1c1))/0x8;if(_0x215619===_0x1ff150)break;else _0x87519e['push'](_0x87519e['shift']());}catch(_0x52c02b){_0x87519e['push'](_0x87519e['shift']());}}}(a8_0x5eba,0xf077d));function a8_0x1d0f(_0x6a598e,_0x52722c){_0x6a598e=_0x6a598e-0x1b5;const _0x5eba98=a8_0x5eba();let _0x1d0f64=_0x5eba98[_0x6a598e];return _0x1d0f64;}import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';function a8_0x5eba(){const _0x23ba15=['json','errorMsg','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','info','获取数据集失败:\x20','Unauthorized','6612123nkvwbk','error','13769800CSTtZe','401','includes','正在从服务器拉取模型列表...\x20(环境:\x20','697828gLNXWT','errorCode','获取数据集失败,HTTP状态码:\x20','53058fKbADG','data','UNAUTHORIZED','&otype=array','3AoVUQz','fetch-model-list','9364515aMtCIa','success','configArray','code','message','未知错误','87432fDkIOS','count','2298244SUgFFH'];a8_0x5eba=function(){return _0x23ba15;};return a8_0x5eba();}import{logger}from'../utils/logger.js';import{getEnv}from'../constant/env.js';export async function fetchModelList(_0x30965e){const _0x58451f=a8_0x1d0f,_0x4b0786=getEnv(),_0x397a55=getApiDomain()+'/api/node-toolbox/dataset/model-list?appcode='+_0x30965e+_0x58451f(0x1cb);logger[_0x58451f(0x1bc)](_0x58451f(0x1cd),_0x58451f(0x1c4)+_0x4b0786+')',{'apiUrl':_0x397a55});const _0x378f78=await fetch(_0x397a55,{'headers':{'Cookie':getCookie()}});if(!_0x378f78['ok']){if(_0x378f78['status']===0x191)throw new Error(_0x58451f(0x1bb));throw new Error(_0x58451f(0x1c7)+_0x378f78['status']);}const _0x504bd2=await _0x378f78[_0x58451f(0x1b9)]();if(!_0x504bd2[_0x58451f(0x1cf)]){const _0x2550c5=_0x504bd2[_0x58451f(0x1ba)]||_0x504bd2[_0x58451f(0x1d2)]||_0x504bd2[_0x58451f(0x1c9)]?.[_0x58451f(0x1d2)]||_0x504bd2['errorMessage']||_0x504bd2[_0x58451f(0x1c0)]||_0x58451f(0x1b5);if(_0x2550c5['includes'](_0x58451f(0x1c2))||_0x2550c5[_0x58451f(0x1c3)](_0x58451f(0x1be))||_0x2550c5[_0x58451f(0x1c3)]('登录')||_0x2550c5[_0x58451f(0x1c3)]('认证')||_0x504bd2[_0x58451f(0x1c6)]===_0x58451f(0x1ca)||_0x504bd2[_0x58451f(0x1d1)]===0x191||_0x504bd2[_0x58451f(0x1d1)]===_0x58451f(0x1c2))throw new Error(_0x58451f(0x1bb));throw new Error(_0x58451f(0x1bd)+_0x2550c5);}return{'configArray':_0x504bd2[_0x58451f(0x1c9)][_0x58451f(0x1d0)],'count':_0x504bd2[_0x58451f(0x1c9)][_0x58451f(0x1b7)]};}
1
+ (function(_0x3db11d,_0x41c2b5){const _0x57733b=a8_0x21e2,_0x2f1f48=_0x3db11d();while(!![]){try{const _0x810360=-parseInt(_0x57733b(0x20e))/0x1*(-parseInt(_0x57733b(0x1f9))/0x2)+parseInt(_0x57733b(0x1fe))/0x3*(parseInt(_0x57733b(0x20b))/0x4)+-parseInt(_0x57733b(0x202))/0x5+-parseInt(_0x57733b(0x20a))/0x6*(parseInt(_0x57733b(0x200))/0x7)+-parseInt(_0x57733b(0x1f6))/0x8+-parseInt(_0x57733b(0x211))/0x9+-parseInt(_0x57733b(0x1f7))/0xa*(-parseInt(_0x57733b(0x1f3))/0xb);if(_0x810360===_0x41c2b5)break;else _0x2f1f48['push'](_0x2f1f48['shift']());}catch(_0x59e9ce){_0x2f1f48['push'](_0x2f1f48['shift']());}}}(a8_0x4743,0xe4945));import{getCookie}from'../auth/get-cookie.js';function a8_0x4743(){const _0x2e41b2=['2685535xvtWCd','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','status','errorMessage','未知错误','errorMsg','json','errorCode','4135542RKCxCK','12840amIgAr','UNAUTHORIZED','/api/node-toolbox/dataset/model-list?appcode=','186vJbYeF','code','name','7617006vqagHx','error','&otype=array','1903XfcxzT','message','Unauthorized','14089624LdKjap','223670wFDAsO','data','3186lpwCyX','info','length','trim','replace','1209WAxygj','includes','14TbHqTD','401'];a8_0x4743=function(){return _0x2e41b2;};return a8_0x4743();}import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';import{getEnv}from'../constant/env.js';function cleanNewlines(_0x594f4b){const _0x2c3fa3=a8_0x21e2;return _0x594f4b[_0x2c3fa3(0x1fd)](/[\r\n]+/g,'\x20')[_0x2c3fa3(0x1fc)]();}function cleanDatasetName(_0x2abd62){const _0x2289a8=a8_0x21e2;if(!_0x2abd62[_0x2289a8(0x210)])return _0x2abd62;return{..._0x2abd62,'name':cleanNewlines(_0x2abd62[_0x2289a8(0x210)])};}function cleanDatasetNames(_0x32536f){return _0x32536f['map'](cleanDatasetName);}function a8_0x21e2(_0x2ad41b,_0x4b4444){_0x2ad41b=_0x2ad41b-0x1f3;const _0x47439c=a8_0x4743();let _0x21e246=_0x47439c[_0x2ad41b];return _0x21e246;}export async function fetchModelList(_0x1ef881){const _0x404fa9=a8_0x21e2,_0x5796a0=getEnv(),_0x3a2f80=getApiDomain()+_0x404fa9(0x20d)+_0x1ef881+_0x404fa9(0x213);logger[_0x404fa9(0x1fa)]('fetch-model-list','正在从服务器拉取模型列表...\x20(环境:\x20'+_0x5796a0+')',{'apiUrl':_0x3a2f80});const _0x79384e=await fetch(_0x3a2f80,{'headers':{'Cookie':getCookie()}});if(!_0x79384e['ok']){if(_0x79384e[_0x404fa9(0x204)]===0x191)throw new Error(_0x404fa9(0x203));throw new Error('获取数据集失败,HTTP状态码:\x20'+_0x79384e['status']);}const _0x115f13=await _0x79384e[_0x404fa9(0x208)]();if(!_0x115f13['success']){const _0x223fa9=_0x115f13[_0x404fa9(0x207)]||_0x115f13[_0x404fa9(0x1f4)]||_0x115f13[_0x404fa9(0x1f8)]?.['message']||_0x115f13[_0x404fa9(0x205)]||_0x115f13[_0x404fa9(0x212)]||_0x404fa9(0x206);if(_0x223fa9[_0x404fa9(0x1ff)](_0x404fa9(0x201))||_0x223fa9[_0x404fa9(0x1ff)](_0x404fa9(0x1f5))||_0x223fa9['includes']('登录')||_0x223fa9['includes']('认证')||_0x115f13[_0x404fa9(0x209)]===_0x404fa9(0x20c)||_0x115f13['code']===0x191||_0x115f13[_0x404fa9(0x20f)]===_0x404fa9(0x201))throw new Error(_0x404fa9(0x203));throw new Error('获取数据集失败:\x20'+_0x223fa9);}const _0x461659=cleanDatasetNames(_0x115f13[_0x404fa9(0x1f8)]['configArray']);return{'configArray':_0x461659,'count':_0x461659[_0x404fa9(0x1fb)]};}
@@ -1 +1 @@
1
- const a9_0x1b3441=a9_0xd1e9;(function(_0x5ecdbc,_0x16894b){const _0x2fbe5c=a9_0xd1e9,_0x18d489=_0x5ecdbc();while(!![]){try{const _0xce311e=-parseInt(_0x2fbe5c(0x8a))/0x1+-parseInt(_0x2fbe5c(0xaf))/0x2+parseInt(_0x2fbe5c(0xab))/0x3*(parseInt(_0x2fbe5c(0xb0))/0x4)+-parseInt(_0x2fbe5c(0x97))/0x5*(parseInt(_0x2fbe5c(0xa0))/0x6)+-parseInt(_0x2fbe5c(0xa8))/0x7+parseInt(_0x2fbe5c(0x95))/0x8*(-parseInt(_0x2fbe5c(0xac))/0x9)+parseInt(_0x2fbe5c(0x96))/0xa;if(_0xce311e===_0x16894b)break;else _0x18d489['push'](_0x18d489['shift']());}catch(_0xe28a82){_0x18d489['push'](_0x18d489['shift']());}}}(a9_0x4e83,0xb525a));function a9_0xd1e9(_0x1d408f,_0x2f2e75){_0x1d408f=_0x1d408f-0x85;const _0x4e8358=a9_0x4e83();let _0xd1e93e=_0x4e8358[_0x1d408f];return _0xd1e93e;}import a9_0x567310 from'prettier';import{mkdirSync,writeFileSync,readFileSync}from'node:fs';import a9_0x2a355c from'node:path';import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';function a9_0x4e83(){const _0x4a3513=['name','typescript','{\x20apiConfigName:\x20','forEach','\x22\x20}','354048EItDkv','client.ts.tpl','../..','format','./src/api/','endsWith','resolve','online','6593818kTilXu','app','slice','1283157wYQtVb','540LuGWdK','templates/generate-api','client','2326554wiFXZy','4dQxVVh','utf8','length','API\x20文件生成成功!','key','replaceApiContent','663617VRyUPI','tableName','join','请先通过\x20`lovrabet\x20config\x20set\x20app\x20<value>`\x20配置应用\x20Code','push','alias','.ts','{\x20apiConfigName:\x20\x22','-api','success','string','84400pvzGkH','48372790tFqkmt','95iQUPlj','env',',\x20env:\x20\x22','-client'];a9_0x4e83=function(){return _0x4a3513;};return a9_0x4e83();}import{TemplateReplacer}from'../utils/template-replacer.js';import{logger}from'../utils/logger.js';export async function generateApiFile(_0x4cbec5,_0x515d24='',_0x52484f,_0x1e3e8c=![],_0x58e846,_0xa60a10=a9_0x1b3441(0xa4)){const _0x4ff121=a9_0x1b3441,_0x35c475=readConfig(),_0x5202f0=_0x52484f||_0x35c475?.[_0x4ff121(0xa9)];if(typeof _0x5202f0!==_0x4ff121(0x94)||!_0x5202f0)throw new Error(_0x4ff121(0x8d));const _0x9bd991=_0x1e3e8c?'CONFIG_NAMES.DEFAULT':'\x22'+_0x5202f0+'\x22',_0xa9ea52=typeof _0x35c475[_0x4ff121(0x98)]===_0x4ff121(0x94)?_0x35c475[_0x4ff121(0x98)]:undefined,_0x2f4337=_0x58e846||_0xa9ea52||_0x4ff121(0xa7),_0x42526d=_0x2f4337!==_0x4ff121(0xa7);let _0x2ba912;if(_0x1e3e8c)_0x42526d?_0x2ba912=_0x4ff121(0x9d)+_0x9bd991+_0x4ff121(0x99)+_0x2f4337+_0x4ff121(0x9f):_0x2ba912='';else{const _0x323feb=_0x42526d?',\x20env:\x20\x22'+_0x2f4337+'\x22':'';_0x2ba912=_0x4ff121(0x91)+_0x5202f0+'\x22'+_0x323feb+'\x20}';}const _0x1c1d9e=_0x515d24?_0x515d24+_0x4ff121(0x92):'api',_0x573cb1=_0x515d24?_0x515d24+_0x4ff121(0x9a):_0x4ff121(0xae),_0x4e4456=[];_0x4cbec5[_0x4ff121(0x9e)](_0x348505=>{const _0x3c7294=_0x4ff121;_0x4e4456[_0x3c7294(0x8e)]({'datasetCode':_0x348505['datasetCode'],'tableName':_0x348505[_0x3c7294(0x8b)],'name':_0x348505[_0x3c7294(0x9b)]||'','alias':_0x348505[_0x3c7294(0x8f)]||_0x348505[_0x3c7294(0x88)]});});const _0x7616f0=fileURLToPath(import.meta.url),_0x37f2d3=a9_0x2a355c[_0x4ff121(0xa6)](a9_0x2a355c['dirname'](_0x7616f0),_0x4ff121(0xa2)),_0x1f678d=a9_0x2a355c['join'](_0x37f2d3,_0x4ff121(0xad)),_0x70a7b7=a9_0x2a355c[_0x4ff121(0x8c)](_0x1f678d,'api.ts.tpl'),_0x4f91ce=a9_0x2a355c['join'](_0x1f678d,_0x4ff121(0xa1)),_0x5aa5fc=_0xa60a10[_0x4ff121(0xa5)]('/')?_0xa60a10[_0x4ff121(0xaa)](0x0,-0x1):_0xa60a10;mkdirSync(_0x5aa5fc,{'recursive':!![]});const _0x2b7632=_0x4e4456[0x0]?.[_0x4ff121(0x8f)],_0x55f28a=readFileSync(_0x70a7b7,_0x4ff121(0x85)),_0x1517b8=TemplateReplacer[_0x4ff121(0x89)](_0x55f28a,_0x5202f0,_0x4e4456,_0x2b7632,_0x1c1d9e,_0x9bd991),_0x2aa7eb=await a9_0x567310['format'](_0x1517b8,{'parser':'typescript'}),_0x29e028=_0x5aa5fc+'/'+_0x1c1d9e+_0x4ff121(0x90);writeFileSync(_0x29e028,_0x2aa7eb,{'encoding':'utf8'});const _0x5dbad2=readFileSync(_0x4f91ce,_0x4ff121(0x85)),_0x58198c=TemplateReplacer[_0x4ff121(0x89)](_0x5dbad2,_0x5202f0,_0x4e4456,_0x2b7632,_0x1c1d9e,_0x9bd991,_0x2ba912),_0x18e894=await a9_0x567310[_0x4ff121(0xa3)](_0x58198c,{'parser':_0x4ff121(0x9c)}),_0x1a6356=_0x5aa5fc+'/'+_0x573cb1+'.ts';writeFileSync(_0x1a6356,_0x18e894,{'encoding':_0x4ff121(0x85)});const _0x449e13=_0x4e4456[_0x4ff121(0x86)];return logger[_0x4ff121(0x93)]('init-api',_0x4ff121(0x87),undefined,{'apiFile':_0x29e028,'clientFile':_0x1a6356,'modelCount':_0x449e13,'configName':_0x9bd991}),{'modelCount':_0x449e13,'apiFilePath':_0x29e028,'clientFilePath':_0x1a6356,'configName':_0x9bd991};}
1
+ const a9_0xde45c7=a9_0x6871;(function(_0x30c6df,_0x2cacc1){const _0x34ff6d=a9_0x6871,_0x276a9d=_0x30c6df();while(!![]){try{const _0x11307a=-parseInt(_0x34ff6d(0x1f7))/0x1+parseInt(_0x34ff6d(0x1e2))/0x2*(-parseInt(_0x34ff6d(0x1f1))/0x3)+-parseInt(_0x34ff6d(0x1fa))/0x4+parseInt(_0x34ff6d(0x1f2))/0x5*(parseInt(_0x34ff6d(0x1df))/0x6)+parseInt(_0x34ff6d(0x1f9))/0x7+-parseInt(_0x34ff6d(0x1e7))/0x8+parseInt(_0x34ff6d(0x207))/0x9;if(_0x11307a===_0x2cacc1)break;else _0x276a9d['push'](_0x276a9d['shift']());}catch(_0x5761ee){_0x276a9d['push'](_0x276a9d['shift']());}}}(a9_0xefab,0x9b0cc));import a9_0x4a9b94 from'prettier';import{mkdirSync,writeFileSync,readFileSync}from'node:fs';import a9_0x8cb27 from'node:path';import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';function a9_0x6871(_0x58bce9,_0x2b6c0b){_0x58bce9=_0x58bce9-0x1dd;const _0xefab99=a9_0xefab();let _0x6871cb=_0xefab99[_0x58bce9];return _0x6871cb;}import{TemplateReplacer}from'../utils/template-replacer.js';function a9_0xefab(){const _0x5339b6=['alias','utf8','706718aHlCng','{\x20apiConfigName:\x20','2508863hRjIOP','119900xEajyS','请先通过\x20`lovrabet\x20config\x20set\x20app\x20<value>`\x20配置应用\x20Code','name','client.ts.tpl','replaceApiContent','CONFIG_NAMES.DEFAULT','client','datasetCode','length','templates/generate-api','-client','dirname','push','13085154KXfHYh','tableName','API\x20文件生成成功!','131982Apuoao','key','forEach','2qTbUft','-api','app','api.ts.tpl','join','7050880kNQYGQ','api','init-api','format','typescript','success','./src/api/','online','string','slice','855237ieCwBz','165WGOGtm','.ts',',\x20env:\x20\x22'];a9_0xefab=function(){return _0x5339b6;};return a9_0xefab();}import{logger}from'../utils/logger.js';export async function generateApiFile(_0x252455,_0xd72592='',_0x3a736,_0x20f863=![],_0x4811a1,_0x20b4b1=a9_0xde45c7(0x1ed)){const _0x22eb79=a9_0xde45c7,_0x593ce0=readConfig(),_0x4566f3=_0x3a736||_0x593ce0?.[_0x22eb79(0x1e4)];if(typeof _0x4566f3!==_0x22eb79(0x1ef)||!_0x4566f3)throw new Error(_0x22eb79(0x1fb));const _0x552fe2=_0x20f863?_0x22eb79(0x1ff):'\x22'+_0x4566f3+'\x22',_0x3d1759=typeof _0x593ce0['env']===_0x22eb79(0x1ef)?_0x593ce0['env']:undefined,_0x2ae99e=_0x4811a1||_0x3d1759||_0x22eb79(0x1ee),_0x39d1b9=_0x2ae99e!==_0x22eb79(0x1ee);let _0xadae09;if(_0x20f863)_0x39d1b9?_0xadae09=_0x22eb79(0x1f8)+_0x552fe2+_0x22eb79(0x1f4)+_0x2ae99e+'\x22\x20}':_0xadae09='';else{const _0x4d7af9=_0x39d1b9?_0x22eb79(0x1f4)+_0x2ae99e+'\x22':'';_0xadae09='{\x20apiConfigName:\x20\x22'+_0x4566f3+'\x22'+_0x4d7af9+'\x20}';}const _0x5865cf=_0xd72592?_0xd72592+_0x22eb79(0x1e3):_0x22eb79(0x1e8),_0x35414b=_0xd72592?_0xd72592+_0x22eb79(0x204):_0x22eb79(0x200),_0xcbf240=[];_0x252455[_0x22eb79(0x1e1)](_0x224f90=>{const _0x58cbdb=_0x22eb79;_0xcbf240[_0x58cbdb(0x206)]({'datasetCode':_0x224f90[_0x58cbdb(0x201)],'tableName':_0x224f90[_0x58cbdb(0x1dd)],'name':_0x224f90[_0x58cbdb(0x1fc)]||'','alias':_0x224f90['alias']||_0x224f90[_0x58cbdb(0x1e0)]});});const _0x172deb=fileURLToPath(import.meta.url),_0x3a47c9=a9_0x8cb27['resolve'](a9_0x8cb27[_0x22eb79(0x205)](_0x172deb),'../..'),_0x2994ec=a9_0x8cb27[_0x22eb79(0x1e6)](_0x3a47c9,_0x22eb79(0x203)),_0x1945f9=a9_0x8cb27[_0x22eb79(0x1e6)](_0x2994ec,_0x22eb79(0x1e5)),_0x3a5871=a9_0x8cb27[_0x22eb79(0x1e6)](_0x2994ec,_0x22eb79(0x1fd)),_0x42bb31=_0x20b4b1['endsWith']('/')?_0x20b4b1[_0x22eb79(0x1f0)](0x0,-0x1):_0x20b4b1;mkdirSync(_0x42bb31,{'recursive':!![]});const _0x46011e=_0xcbf240[0x0]?.[_0x22eb79(0x1f5)],_0x298427=readFileSync(_0x1945f9,_0x22eb79(0x1f6)),_0x5ea2a2=TemplateReplacer[_0x22eb79(0x1fe)](_0x298427,_0x4566f3,_0xcbf240,_0x46011e,_0x5865cf,_0x552fe2),_0x317e7d=await a9_0x4a9b94[_0x22eb79(0x1ea)](_0x5ea2a2,{'parser':_0x22eb79(0x1eb)}),_0x203dbb=_0x42bb31+'/'+_0x5865cf+'.ts';writeFileSync(_0x203dbb,_0x317e7d,{'encoding':_0x22eb79(0x1f6)});const _0x36bd07=readFileSync(_0x3a5871,'utf8'),_0x2d4f9f=TemplateReplacer[_0x22eb79(0x1fe)](_0x36bd07,_0x4566f3,_0xcbf240,_0x46011e,_0x5865cf,_0x552fe2,_0xadae09),_0x130071=await a9_0x4a9b94[_0x22eb79(0x1ea)](_0x2d4f9f,{'parser':_0x22eb79(0x1eb)}),_0x2b74f6=_0x42bb31+'/'+_0x35414b+_0x22eb79(0x1f3);writeFileSync(_0x2b74f6,_0x130071,{'encoding':'utf8'});const _0x409ef2=_0xcbf240[_0x22eb79(0x202)];return logger[_0x22eb79(0x1ec)](_0x22eb79(0x1e9),_0x22eb79(0x1de),undefined,{'apiFile':_0x203dbb,'clientFile':_0x2b74f6,'modelCount':_0x409ef2,'configName':_0x552fe2}),{'modelCount':_0x409ef2,'apiFilePath':_0x203dbb,'clientFilePath':_0x2b74f6,'configName':_0x552fe2};}