@lovrabet/cli 1.2.5-beta.5 → 1.2.5-beta.7

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 (95) hide show
  1. package/lib/add-page/input-page-router.js +1 -1
  2. package/lib/add-page/main.js +1 -1
  3. package/lib/add-page/select-page-template.js +1 -1
  4. package/lib/ai-setup/AISetupUI.js +1 -1
  5. package/lib/ai-setup/config.js +1 -1
  6. package/lib/api/api-doc-ui.js +1 -1
  7. package/lib/api/api-doc.js +1 -1
  8. package/lib/api/api-pull-ui.js +1 -1
  9. package/lib/api/fetch-model-list.js +1 -1
  10. package/lib/api/generate-api-file.js +1 -1
  11. package/lib/api/main.js +1 -1
  12. package/lib/api/pull-silent.js +1 -1
  13. package/lib/app-menu/app-menu-sync-ui.js +1 -1
  14. package/lib/app-menu/create-menu.js +1 -1
  15. package/lib/app-menu/get-local-pages.js +1 -1
  16. package/lib/app-menu/get-online-menu-list.js +1 -1
  17. package/lib/app-menu/use-get-online-menu-list.js +1 -1
  18. package/lib/app-menu/utils.js +1 -1
  19. package/lib/app-menu/valid-url.js +1 -1
  20. package/lib/app-menu-update-cdn/current-content.js +1 -1
  21. package/lib/app-menu-update-cdn/input-cdn-asset.js +1 -1
  22. package/lib/app-menu-update-cdn/main.js +1 -1
  23. package/lib/app-menu-update-cdn/update-menu-cdn-url.js +1 -1
  24. package/lib/auth/auth-server-ui.js +1 -1
  25. package/lib/auth/auth-server.js +1 -1
  26. package/lib/auth/constant.js +1 -1
  27. package/lib/auth/get-cookie.js +1 -1
  28. package/lib/auth/is-session-valid.js +1 -1
  29. package/lib/auth/logout.js +1 -1
  30. package/lib/cli.js +1 -1
  31. package/lib/cmd/build-watch.js +1 -1
  32. package/lib/cmd/build.js +1 -1
  33. package/lib/cmd/logs.js +1 -1
  34. package/lib/cmd/preview.js +1 -1
  35. package/lib/cmd/start.js +1 -1
  36. package/lib/config/config-help.js +1 -1
  37. package/lib/config/main.js +1 -1
  38. package/lib/constant/domain.js +1 -1
  39. package/lib/constant/env.js +1 -1
  40. package/lib/create-app/enhanced-guided-create.js +1 -1
  41. package/lib/create-app/format-elapsed.js +1 -1
  42. package/lib/create-app/main.js +1 -1
  43. package/lib/create-app/non-interactive.js +1 -0
  44. package/lib/create-app/task-finished.js +1 -1
  45. package/lib/create-app/task-loading.js +1 -1
  46. package/lib/create-app/task-running.js +1 -1
  47. package/lib/create-app/task-time.js +1 -1
  48. package/lib/create-app/use-copy-project-template.js +1 -1
  49. package/lib/create-app/use-format-code.js +1 -1
  50. package/lib/create-app/use-install-dependencies.js +1 -1
  51. package/lib/help.js +1 -1
  52. package/lib/init/main.js +1 -1
  53. package/lib/mcp/McpInstallUI.js +1 -1
  54. package/lib/mcp/claude.js +1 -1
  55. package/lib/mcp/cursor.js +1 -1
  56. package/lib/mcp/main.js +1 -1
  57. package/lib/mcp/mcp-install-non-interactive.js +1 -0
  58. package/lib/mcp/mcp-installer.js +1 -0
  59. package/lib/skills/SkillInstallUI.js +1 -1
  60. package/lib/skills/main.js +1 -1
  61. package/lib/skills/skill-install-non-interactive.js +1 -0
  62. package/lib/skills/skill-installer.js +1 -0
  63. package/lib/ui/IDESelector.js +1 -0
  64. package/lib/ui/useIDESelection.js +1 -0
  65. package/lib/utils/ai_config.js +1 -0
  66. package/lib/utils/check-sdk-version.js +1 -1
  67. package/lib/utils/config.js +1 -1
  68. package/lib/utils/copy-directory.js +1 -1
  69. package/lib/utils/file-utils.js +1 -0
  70. package/lib/utils/http-client.js +1 -1
  71. package/lib/utils/logger.js +1 -1
  72. package/lib/utils/router-updater.js +1 -1
  73. package/lib/utils/sleep.js +1 -1
  74. package/lib/utils/template-replacer.js +1 -1
  75. package/package.json +1 -1
  76. package/templates/skills/.shared/README.md +12 -37
  77. package/templates/skills/.shared/SKILL.md.tpl +119 -0
  78. package/templates/skills/.shared/guides/01-typescript-sdk/guide.md +382 -0
  79. package/templates/skills/.shared/guides/02-mcp-sql-workflow/guide.md +5 -5
  80. package/templates/skills/.shared/guides/03-antd-style/guide.md +21 -8
  81. package/templates/skills/.shared/guides/04-troubleshooting/guide.md +3 -3
  82. package/templates/skills/.shared/guides/05-api-integration/guide.md +4 -2
  83. package/templates/skills/.shared/guides/06-menu-management/guide.md +4 -2
  84. package/templates/skills/.shared/guides/07-backend-function/guide.md +361 -440
  85. package/templates/skills/.agent/skills/lovrabet/SKILL.md +0 -258
  86. package/templates/skills/.claude/skills/lovrabet/SKILL.md +0 -258
  87. package/templates/skills/.codebuddy/skills/lovrabet/SKILL.md +0 -258
  88. package/templates/skills/.codex/skills/lovrabet/SKILL.md +0 -258
  89. package/templates/skills/.cursor/commands/lovrabet.md +0 -248
  90. package/templates/skills/.opencode/skills/lovrabet/SKILL.md +0 -258
  91. package/templates/skills/.qoder/rules/lovrabet.md +0 -258
  92. package/templates/skills/.qoder/skills/lovrabet.md +0 -258
  93. package/templates/skills/.shared/guides/01-filter-query/guide.md +0 -300
  94. package/templates/skills/.trae/skills/lovrabet/SKILL.md +0 -258
  95. package/templates/skills/.windsurf/workflows/lovrabet.md +0 -257
@@ -1 +1 @@
1
- (function(_0x39136a,_0x286696){const _0x4a5da3=a0_0x5b4f,_0x101331=_0x39136a();while(!![]){try{const _0x150849=parseInt(_0x4a5da3(0x1e6))/0x1*(-parseInt(_0x4a5da3(0x1d9))/0x2)+parseInt(_0x4a5da3(0x1ea))/0x3*(parseInt(_0x4a5da3(0x1f0))/0x4)+-parseInt(_0x4a5da3(0x1f2))/0x5*(parseInt(_0x4a5da3(0x1e1))/0x6)+-parseInt(_0x4a5da3(0x1e9))/0x7+-parseInt(_0x4a5da3(0x1ef))/0x8+parseInt(_0x4a5da3(0x1e2))/0x9+parseInt(_0x4a5da3(0x1f3))/0xa;if(_0x150849===_0x286696)break;else _0x101331['push'](_0x101331['shift']());}catch(_0x2442b1){_0x101331['push'](_0x101331['shift']());}}}(a0_0x6ad5,0x4b3a4));function a0_0x6ad5(){const _0x27b100=['\x20Step2:\x20','页面路径不合法','28542ICEdLE','4114116DyUIth','gray','red','trim','479213bAWIpR','页面路径长度不能超过\x20100\x20个字符','路径不能包含连续的\x20/','2262239kdqvPl','99741lRBkYS','\x20直接回车确认,或输入自定义路由地址','return','endsWith','green','2980960GOsgiC','56ETwYoc','split','190EuDSYL','7413260uDHMfR','页面路由地址:\x20','my-page','路径中的每个段只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','2EgOZAM','existsSync','\x20已存在,请使用其他路径','路径不能以\x20/\x20开头或结尾','includes','length'];a0_0x6ad5=function(){return _0x27b100;};return a0_0x6ad5();}import{jsx as a0_0x2993d1,jsxs as a0_0x323283}from'react/jsx-runtime';function a0_0x5b4f(_0x2c7b46,_0x51fe7d){_0x2c7b46=_0x2c7b46-0x1d9;const _0x6ad547=a0_0x6ad5();let _0x5b4f38=_0x6ad547[_0x2c7b46];return _0x5b4f38;}import{useState}from'react';import{Text,Box,useInput}from'ink';import a0_0x38900f from'node:fs';export function InputProjectCode(_0x4059b8){const _0x343a53=a0_0x5b4f,{onSubmit:_0x3fa26d,pagePath:_0x3dc3cb}=_0x4059b8,[_0x305bfb,_0x3a623c]=useState(''),[_0x2e2711,_0x2ac048]=useState(''),_0x1b1e73=_0x343a53(0x1f5);function _0x220e79(_0x1ef833){const _0x28dc58=_0x343a53;if(_0x1ef833[_0x28dc58(0x1de)]>0x64)return{'valid':![],'message':_0x28dc58(0x1e7)};if(_0x1ef833['startsWith']('/')||_0x1ef833[_0x28dc58(0x1ed)]('/'))return{'valid':![],'message':_0x28dc58(0x1dc)};if(_0x1ef833[_0x28dc58(0x1dd)]('//'))return{'valid':![],'message':_0x28dc58(0x1e8)};const _0x3f8e5b=_0x1ef833[_0x28dc58(0x1f1)]('/');for(const _0xd72977 of _0x3f8e5b){if(!_0xd72977)continue;const _0x390025=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(!_0x390025['test'](_0xd72977))return{'valid':![],'message':_0x28dc58(0x1f6)};}return{'valid':!![]};}return useInput((_0x56fe80,_0x144ee2)=>{const _0x5d34b3=_0x343a53;if(_0x144ee2[_0x5d34b3(0x1ec)]){const _0x20ef39=_0x305bfb[_0x5d34b3(0x1e5)]()||_0x1b1e73;if(_0x2e2711)return;const _0x51b7f3=_0x3dc3cb+'/'+_0x20ef39;if(a0_0x38900f[_0x5d34b3(0x1da)](_0x51b7f3)){_0x2ac048('页面路径\x20'+_0x20ef39+_0x5d34b3(0x1db));return;}_0x3fa26d(_0x20ef39),_0x3a623c(''),_0x2ac048('');}else _0x144ee2['backspace']||_0x144ee2['delete']?_0x3a623c(_0x7662d=>{const _0x104e5c=_0x5d34b3,_0x3b7137=_0x7662d['slice'](0x0,-0x1),{valid:_0x28c7ba,message:_0x13a8bb}=_0x220e79(_0x3b7137);return _0x2ac048(_0x28c7ba?'':_0x13a8bb||_0x104e5c(0x1e0)),_0x3b7137;}):_0x3a623c(_0x125536=>{const _0x56e59f=_0x5d34b3,_0x160a54=_0x125536+_0x56fe80,{valid:_0x1297e1,message:_0x11f067}=_0x220e79(_0x160a54);return _0x2ac048(_0x1297e1?'':_0x11f067||_0x56e59f(0x1e0)),_0x160a54;});}),a0_0x323283(Box,{'flexDirection':'column','children':[a0_0x323283(Box,{'children':[a0_0x2993d1(Text,{'color':'gray','children':_0x343a53(0x1df)}),a0_0x2993d1(Text,{'children':_0x343a53(0x1f4)}),_0x305bfb?a0_0x2993d1(Text,{'color':_0x343a53(0x1ee),'children':_0x305bfb}):a0_0x2993d1(Text,{'color':_0x343a53(0x1e3),'children':_0x1b1e73}),_0x2e2711&&a0_0x323283(Text,{'color':_0x343a53(0x1e4),'children':['\x20←\x20',_0x2e2711]})]}),!_0x2e2711&&!_0x305bfb&&a0_0x2993d1(Box,{'children':a0_0x2993d1(Text,{'color':_0x343a53(0x1e3),'children':_0x343a53(0x1eb)})})]});}
1
+ function a0_0x2a1d(_0x2ec114,_0x4c4c71){_0x2ec114=_0x2ec114-0xaf;const _0x516f65=a0_0x516f();let _0x2a1dc7=_0x516f65[_0x2ec114];return _0x2a1dc7;}(function(_0x26a57a,_0x3b47f0){const _0x35579a=a0_0x2a1d,_0x1bab06=_0x26a57a();while(!![]){try{const _0x173766=parseInt(_0x35579a(0xb7))/0x1+parseInt(_0x35579a(0xc8))/0x2*(-parseInt(_0x35579a(0xcd))/0x3)+parseInt(_0x35579a(0xbe))/0x4*(-parseInt(_0x35579a(0xb9))/0x5)+-parseInt(_0x35579a(0xc5))/0x6*(parseInt(_0x35579a(0xaf))/0x7)+parseInt(_0x35579a(0xbd))/0x8*(parseInt(_0x35579a(0xb8))/0x9)+-parseInt(_0x35579a(0xcf))/0xa+-parseInt(_0x35579a(0xc1))/0xb*(-parseInt(_0x35579a(0xc4))/0xc);if(_0x173766===_0x3b47f0)break;else _0x1bab06['push'](_0x1bab06['shift']());}catch(_0x7e5c1d){_0x1bab06['push'](_0x1bab06['shift']());}}}(a0_0x516f,0x60f07));function a0_0x516f(){const _0x41e5f3=['7LgVzSQ','green','路径不能包含连续的\x20/','column','slice','length','endsWith','my-page','774896mRUIwR','18qBBFbl','515980BpFVjO','red','\x20已存在,请使用其他路径','页面路径不合法','325664nHanYw','8YZHtev','trim','includes','44jwbanq','页面路由地址:\x20','路径不能以\x20/\x20开头或结尾','2311896yvwVqu','1201260yObxNJ','return','页面路径\x20','184006sAPdKZ','existsSync','\x20←\x20','backspace','\x20直接回车确认,或输入自定义路由地址','12kORTzu','startsWith','4552670owpCJz','gray'];a0_0x516f=function(){return _0x41e5f3;};return a0_0x516f();}import{jsx as a0_0x2bb625,jsxs as a0_0x2e0b76}from'react/jsx-runtime';import{useState}from'react';import{Text,Box,useInput}from'ink';import a0_0x587cf8 from'node:fs';export function InputProjectCode(_0x2d4e18){const _0x37177b=a0_0x2a1d,{onSubmit:_0x243a62,pagePath:_0x1577ed}=_0x2d4e18,[_0x26f064,_0x2af658]=useState(''),[_0x2977eb,_0x5648bb]=useState(''),_0x351627=_0x37177b(0xb6);function _0x4e549b(_0x12efdb){const _0xfefc01=_0x37177b;if(_0x12efdb[_0xfefc01(0xb4)]>0x64)return{'valid':![],'message':'页面路径长度不能超过\x20100\x20个字符'};if(_0x12efdb[_0xfefc01(0xce)]('/')||_0x12efdb[_0xfefc01(0xb5)]('/'))return{'valid':![],'message':_0xfefc01(0xc3)};if(_0x12efdb[_0xfefc01(0xc0)]('//'))return{'valid':![],'message':_0xfefc01(0xb1)};const _0x448fb4=_0x12efdb['split']('/');for(const _0x270f9b of _0x448fb4){if(!_0x270f9b)continue;const _0x9451d3=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(!_0x9451d3['test'](_0x270f9b))return{'valid':![],'message':'路径中的每个段只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_'};}return{'valid':!![]};}return useInput((_0x43a5ec,_0x12d6d5)=>{const _0x1db935=_0x37177b;if(_0x12d6d5[_0x1db935(0xc6)]){const _0x47e7c9=_0x26f064[_0x1db935(0xbf)]()||_0x351627;if(_0x2977eb)return;const _0x3809f5=_0x1577ed+'/'+_0x47e7c9;if(a0_0x587cf8[_0x1db935(0xc9)](_0x3809f5)){_0x5648bb(_0x1db935(0xc7)+_0x47e7c9+_0x1db935(0xbb));return;}_0x243a62(_0x47e7c9),_0x2af658(''),_0x5648bb('');}else _0x12d6d5[_0x1db935(0xcb)]||_0x12d6d5['delete']?_0x2af658(_0x400605=>{const _0x5b17a3=_0x1db935,_0x20030f=_0x400605[_0x5b17a3(0xb3)](0x0,-0x1),{valid:_0x10c604,message:_0x357fe5}=_0x4e549b(_0x20030f);return _0x5648bb(_0x10c604?'':_0x357fe5||_0x5b17a3(0xbc)),_0x20030f;}):_0x2af658(_0x5528d5=>{const _0x2ffe13=_0x1db935,_0xd0d81f=_0x5528d5+_0x43a5ec,{valid:_0x407dab,message:_0x1befeb}=_0x4e549b(_0xd0d81f);return _0x5648bb(_0x407dab?'':_0x1befeb||_0x2ffe13(0xbc)),_0xd0d81f;});}),a0_0x2e0b76(Box,{'flexDirection':_0x37177b(0xb2),'children':[a0_0x2e0b76(Box,{'children':[a0_0x2bb625(Text,{'color':'gray','children':'\x20Step2:\x20'}),a0_0x2bb625(Text,{'children':_0x37177b(0xc2)}),_0x26f064?a0_0x2bb625(Text,{'color':_0x37177b(0xb0),'children':_0x26f064}):a0_0x2bb625(Text,{'color':'gray','children':_0x351627}),_0x2977eb&&a0_0x2e0b76(Text,{'color':_0x37177b(0xba),'children':[_0x37177b(0xca),_0x2977eb]})]}),!_0x2977eb&&!_0x26f064&&a0_0x2bb625(Box,{'children':a0_0x2bb625(Text,{'color':_0x37177b(0xd0),'children':_0x37177b(0xcc)})})]});}
@@ -1 +1 @@
1
- const a1_0x3884e4=a1_0x1102;(function(_0x44f6ba,_0x4d2297){const _0x405d18=a1_0x1102,_0x3bd481=_0x44f6ba();while(!![]){try{const _0x4eece6=-parseInt(_0x405d18(0xb2))/0x1*(-parseInt(_0x405d18(0xc6))/0x2)+parseInt(_0x405d18(0xc2))/0x3+-parseInt(_0x405d18(0xaa))/0x4*(-parseInt(_0x405d18(0xc7))/0x5)+-parseInt(_0x405d18(0xbd))/0x6+parseInt(_0x405d18(0xc1))/0x7+parseInt(_0x405d18(0xb6))/0x8+parseInt(_0x405d18(0xae))/0x9*(-parseInt(_0x405d18(0xb9))/0xa);if(_0x4eece6===_0x4d2297)break;else _0x3bd481['push'](_0x3bd481['shift']());}catch(_0x5719a2){_0x3bd481['push'](_0x3bd481['shift']());}}}(a1_0x3890,0xe4fe9));import{jsx as a1_0x43cd81,jsxs as a1_0x5a1ad0,Fragment as a1_0x368778}from'react/jsx-runtime';import{fileURLToPath}from'node:url';import a1_0x42f560 from'node:path';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{SelectPageTemplate}from'./select-page-template.js';function a1_0x3890(){const _0xf5bab6=['pages','message','gray','476293yeLMBx','error','now','页面添加失败:\x20','1310344GvaQZq','then','join','20VLZsbV','\x20*\x20路由地址:\x20','catch','src','5755614aaxVuJ','\x20Step2:\x20','\x20*\x20页面文件已创建,可直接通过路由访问','cwd','11646509KGUZkr','4900248VYxake','页面添加成功:\x20','正在创建页面,请稍候…','success','2dWaYis','696785KlecHM','cyan','add-page','green','setLogPath','\x20Step1:\x20','已选择页面模板\x20','44TIyPyP','resolve','column','../../templates/pages','16078437KnjpQO'];a1_0x3890=function(){return _0xf5bab6;};return a1_0x3890();}import{InputProjectCode}from'./input-page-router.js';import{logger}from'../utils/logger.js';function a1_0x1102(_0x456e84,_0x392ac0){_0x456e84=_0x456e84-0xaa;const _0x3890f7=a1_0x3890();let _0x1102e5=_0x3890f7[_0x456e84];return _0x1102e5;}import{TemplateReplacer}from'../utils/template-replacer.js';const __dirname=a1_0x42f560['dirname'](fileURLToPath(import.meta.url)),pageTemplateDir=a1_0x42f560['resolve'](__dirname,a1_0x3884e4(0xad)),projectDir=process[a1_0x3884e4(0xc0)]();export const AddPage=()=>{const _0x2852fb=a1_0x3884e4,{exit:_0x359d8c}=useApp(),[_0x43c9b9,_0x4f48e2]=useState(''),[_0x49e034,_0x40d53a]=useState(''),[_0x5a3ef5,_0x449793]=useState(![]),[_0x20bf5c,_0x2a0a8d]=useState(![]),_0x3f0428=a1_0x42f560[_0x2852fb(0xb8)](projectDir,_0x2852fb(0xbc),_0x2852fb(0xaf)),_0x4c82b6=a1_0x42f560[_0x2852fb(0xb8)](_0x3f0428,_0x49e034),_0x51055d=a1_0x42f560[_0x2852fb(0xb8)](_0x2852fb(0xbc),_0x2852fb(0xaf),_0x49e034);useEffect(()=>{const _0x17293e=_0x2852fb,_0xaa4d86=a1_0x42f560[_0x17293e(0xab)](pageTemplateDir,_0x43c9b9);if(_0x43c9b9&&_0x49e034){_0x449793(!![]),logger[_0x17293e(0xcb)](process['cwd']());const _0x200c56=Date[_0x17293e(0xb4)]();logger['info']('add-page','开始添加页面:\x20'+_0x49e034,{'template':_0x43c9b9,'targetPath':_0x51055d}),TemplateReplacer['processTemplate'](_0xaa4d86,a1_0x42f560[_0x17293e(0xb8)](_0x3f0428,_0x49e034),_0x49e034,_0x43c9b9)[_0x17293e(0xb7)](()=>{const _0x5c7b8d=_0x17293e,_0x2645b9=Date[_0x5c7b8d(0xb4)]()-_0x200c56;logger[_0x5c7b8d(0xc5)](_0x5c7b8d(0xc9),_0x5c7b8d(0xc3)+_0x49e034,_0x2645b9,{'template':_0x43c9b9,'targetPath':_0x51055d,'routePath':_0x49e034}),_0x2a0a8d(!![]);})[_0x17293e(0xbb)](_0x1bfd4e=>{const _0xf801e1=_0x17293e,_0x4fe16a=Date[_0xf801e1(0xb4)]()-_0x200c56;logger[_0xf801e1(0xb3)]('add-page',_0xf801e1(0xb5)+_0x49e034,{'template':_0x43c9b9,'targetPath':_0x51055d,'error':_0x1bfd4e instanceof Error?_0x1bfd4e[_0xf801e1(0xb0)]:String(_0x1bfd4e),'duration':_0x4fe16a});})['finally'](()=>{_0x449793(![]);});}},[_0x43c9b9,_0x49e034]),useEffect(()=>{_0x20bf5c&&setTimeout(()=>{_0x359d8c();});},[_0x20bf5c]);if(_0x43c9b9)return a1_0x5a1ad0(Box,{'flexDirection':_0x2852fb(0xac),'paddingY':0x1,'children':[a1_0x5a1ad0(Box,{'children':[a1_0x43cd81(Text,{'color':_0x2852fb(0xb1),'children':_0x2852fb(0xcc)}),a1_0x43cd81(Text,{'children':_0x2852fb(0xcd)}),a1_0x43cd81(Text,{'color':'green','children':_0x43c9b9})]}),_0x49e034?a1_0x5a1ad0(Box,{'children':[a1_0x43cd81(Text,{'color':_0x2852fb(0xb1),'children':_0x2852fb(0xbe)}),a1_0x43cd81(Text,{'children':'已输入的页面路由\x20'}),a1_0x43cd81(Text,{'color':_0x2852fb(0xca),'children':_0x49e034})]}):a1_0x43cd81(InputProjectCode,{'pagePath':_0x4c82b6,'onSubmit':_0x40d53a}),_0x49e034&&_0x5a3ef5?a1_0x5a1ad0(Box,{'marginTop':0x1,'children':[a1_0x43cd81(Box,{'width':'4'}),a1_0x43cd81(Text,{'children':_0x2852fb(0xc4)})]}):null,_0x20bf5c?a1_0x5a1ad0(a1_0x368778,{'children':[a1_0x43cd81(Box,{'marginTop':0x1,'children':a1_0x43cd81(Text,{'color':'gray','children':'\x20*\x20页面创建成功!'})}),a1_0x5a1ad0(Box,{'children':[a1_0x43cd81(Text,{'color':_0x2852fb(0xb1),'children':'\x20*\x20页面路径:\x20'}),a1_0x43cd81(Text,{'color':_0x2852fb(0xca),'children':_0x51055d})]}),a1_0x5a1ad0(Box,{'children':[a1_0x43cd81(Text,{'color':_0x2852fb(0xb1),'children':_0x2852fb(0xba)}),a1_0x5a1ad0(Text,{'color':_0x2852fb(0xca),'children':['/',_0x49e034]})]}),a1_0x43cd81(Box,{'marginTop':0x1,'children':a1_0x43cd81(Text,{'color':_0x2852fb(0xc8),'children':_0x2852fb(0xbf)})})]}):null]});return a1_0x43cd81(SelectPageTemplate,{'onSelect':_0x4f48e2});};
1
+ const a1_0x270d8a=a1_0x494b;(function(_0x32e4ab,_0x47a3f9){const _0x5bbbf9=a1_0x494b,_0x16af5e=_0x32e4ab();while(!![]){try{const _0x347c5e=parseInt(_0x5bbbf9(0xa9))/0x1*(parseInt(_0x5bbbf9(0xb4))/0x2)+parseInt(_0x5bbbf9(0x9e))/0x3+parseInt(_0x5bbbf9(0x9a))/0x4+parseInt(_0x5bbbf9(0x96))/0x5*(parseInt(_0x5bbbf9(0x9b))/0x6)+-parseInt(_0x5bbbf9(0xb9))/0x7+parseInt(_0x5bbbf9(0x9c))/0x8*(parseInt(_0x5bbbf9(0xa3))/0x9)+-parseInt(_0x5bbbf9(0xa7))/0xa;if(_0x347c5e===_0x47a3f9)break;else _0x16af5e['push'](_0x16af5e['shift']());}catch(_0x156a8a){_0x16af5e['push'](_0x16af5e['shift']());}}}(a1_0x3296,0x224f7));import{jsx as a1_0x5b3300,jsxs as a1_0x1bad4b,Fragment as a1_0x5a163e}from'react/jsx-runtime';import{fileURLToPath}from'node:url';function a1_0x3296(){const _0x3bd9a6=['页面添加失败:\x20','\x20*\x20页面文件已创建,可直接通过路由访问','3928890leDXob','add-page','1JLnMqN','success','now','cyan','../../templates/pages','\x20*\x20页面路径:\x20','processTemplate','\x20*\x20页面创建成功!','cwd','error','正在创建页面,请稍候…','503054AYpFZJ','catch','setLogPath','\x20Step2:\x20','info','1478603jEniLD','已输入的页面路由\x20','src','\x20Step1:\x20','开始添加页面:\x20','join','1940MMKMCD','gray','页面添加成功:\x20','\x20*\x20路由地址:\x20','739588IqEbLN','168tOrdsm','363712ljJQBu','resolve','619311KEvMFJ','message','已选择页面模板\x20','column','pages','18BbrcEw','green'];a1_0x3296=function(){return _0x3bd9a6;};return a1_0x3296();}import a1_0x11c314 from'node:path';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';function a1_0x494b(_0x1bddb9,_0x32c3b6){_0x1bddb9=_0x1bddb9-0x92;const _0x3296be=a1_0x3296();let _0x494bb3=_0x3296be[_0x1bddb9];return _0x494bb3;}import{SelectPageTemplate}from'./select-page-template.js';import{InputProjectCode}from'./input-page-router.js';import{logger}from'../utils/logger.js';import{TemplateReplacer}from'../utils/template-replacer.js';const __dirname=a1_0x11c314['dirname'](fileURLToPath(import.meta.url)),pageTemplateDir=a1_0x11c314[a1_0x270d8a(0x9d)](__dirname,a1_0x270d8a(0xad)),projectDir=process[a1_0x270d8a(0xb1)]();export const AddPage=()=>{const _0x47247e=a1_0x270d8a,{exit:_0x2e2038}=useApp(),[_0x47ad13,_0x6abcf1]=useState(''),[_0x1153c0,_0x4a3f9a]=useState(''),[_0x40dc0b,_0x117344]=useState(![]),[_0xe54132,_0x4767af]=useState(![]),_0x14aeeb=a1_0x11c314[_0x47247e(0x95)](projectDir,_0x47247e(0x92),'pages'),_0x18d64b=a1_0x11c314['join'](_0x14aeeb,_0x1153c0),_0x38b739=a1_0x11c314['join'](_0x47247e(0x92),_0x47247e(0xa2),_0x1153c0);useEffect(()=>{const _0x5b608c=_0x47247e,_0x5ab7b4=a1_0x11c314['resolve'](pageTemplateDir,_0x47ad13);if(_0x47ad13&&_0x1153c0){_0x117344(!![]),logger[_0x5b608c(0xb6)](process['cwd']());const _0x1a3541=Date[_0x5b608c(0xab)]();logger[_0x5b608c(0xb8)](_0x5b608c(0xa8),_0x5b608c(0x94)+_0x1153c0,{'template':_0x47ad13,'targetPath':_0x38b739}),TemplateReplacer[_0x5b608c(0xaf)](_0x5ab7b4,a1_0x11c314[_0x5b608c(0x95)](_0x14aeeb,_0x1153c0),_0x1153c0,_0x47ad13)['then'](()=>{const _0x160b7a=_0x5b608c,_0x5314f7=Date[_0x160b7a(0xab)]()-_0x1a3541;logger[_0x160b7a(0xaa)](_0x160b7a(0xa8),_0x160b7a(0x98)+_0x1153c0,_0x5314f7,{'template':_0x47ad13,'targetPath':_0x38b739,'routePath':_0x1153c0}),_0x4767af(!![]);})[_0x5b608c(0xb5)](_0x4acc43=>{const _0x4858f0=_0x5b608c,_0x1b823e=Date[_0x4858f0(0xab)]()-_0x1a3541;logger[_0x4858f0(0xb2)](_0x4858f0(0xa8),_0x4858f0(0xa5)+_0x1153c0,{'template':_0x47ad13,'targetPath':_0x38b739,'error':_0x4acc43 instanceof Error?_0x4acc43[_0x4858f0(0x9f)]:String(_0x4acc43),'duration':_0x1b823e});})['finally'](()=>{_0x117344(![]);});}},[_0x47ad13,_0x1153c0]),useEffect(()=>{_0xe54132&&setTimeout(()=>{_0x2e2038();});},[_0xe54132]);if(_0x47ad13)return a1_0x1bad4b(Box,{'flexDirection':_0x47247e(0xa1),'paddingY':0x1,'children':[a1_0x1bad4b(Box,{'children':[a1_0x5b3300(Text,{'color':_0x47247e(0x97),'children':_0x47247e(0x93)}),a1_0x5b3300(Text,{'children':_0x47247e(0xa0)}),a1_0x5b3300(Text,{'color':_0x47247e(0xa4),'children':_0x47ad13})]}),_0x1153c0?a1_0x1bad4b(Box,{'children':[a1_0x5b3300(Text,{'color':_0x47247e(0x97),'children':_0x47247e(0xb7)}),a1_0x5b3300(Text,{'children':_0x47247e(0xba)}),a1_0x5b3300(Text,{'color':_0x47247e(0xa4),'children':_0x1153c0})]}):a1_0x5b3300(InputProjectCode,{'pagePath':_0x18d64b,'onSubmit':_0x4a3f9a}),_0x1153c0&&_0x40dc0b?a1_0x1bad4b(Box,{'marginTop':0x1,'children':[a1_0x5b3300(Box,{'width':'4'}),a1_0x5b3300(Text,{'children':_0x47247e(0xb3)})]}):null,_0xe54132?a1_0x1bad4b(a1_0x5a163e,{'children':[a1_0x5b3300(Box,{'marginTop':0x1,'children':a1_0x5b3300(Text,{'color':'gray','children':_0x47247e(0xb0)})}),a1_0x1bad4b(Box,{'children':[a1_0x5b3300(Text,{'color':'gray','children':_0x47247e(0xae)}),a1_0x5b3300(Text,{'color':_0x47247e(0xa4),'children':_0x38b739})]}),a1_0x1bad4b(Box,{'children':[a1_0x5b3300(Text,{'color':_0x47247e(0x97),'children':_0x47247e(0x99)}),a1_0x1bad4b(Text,{'color':'green','children':['/',_0x1153c0]})]}),a1_0x5b3300(Box,{'marginTop':0x1,'children':a1_0x5b3300(Text,{'color':_0x47247e(0xac),'children':_0x47247e(0xa6)})})]}):null]});return a1_0x5b3300(SelectPageTemplate,{'onSelect':_0x6abcf1});};
@@ -1 +1 @@
1
- (function(_0x425586,_0x1ad340){const _0x863bdd=a2_0x8c3c,_0xd838b6=_0x425586();while(!![]){try{const _0x1f1bfa=-parseInt(_0x863bdd(0x1d4))/0x1+parseInt(_0x863bdd(0x1d7))/0x2+parseInt(_0x863bdd(0x1d2))/0x3+parseInt(_0x863bdd(0x1ca))/0x4+parseInt(_0x863bdd(0x1cc))/0x5*(-parseInt(_0x863bdd(0x1ce))/0x6)+parseInt(_0x863bdd(0x1e5))/0x7*(parseInt(_0x863bdd(0x1e2))/0x8)+parseInt(_0x863bdd(0x1cf))/0x9;if(_0x1f1bfa===_0x1ad340)break;else _0xd838b6['push'](_0xd838b6['shift']());}catch(_0x2ba1d5){_0xd838b6['push'](_0xd838b6['shift']());}}}(a2_0x2466,0x4392b));import{jsx as a2_0x85656d,jsxs as a2_0x15255b}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Text,Box,useInput}from'ink';import{readdir}from'node:fs/promises';import a2_0x70f610 from'node:path';function a2_0x8c3c(_0x11510c,_0x33faae){_0x11510c=_0x11510c-0x1c9;const _0x246669=a2_0x2466();let _0x8c3c5=_0x246669[_0x11510c];return _0x8c3c5;}import{fileURLToPath}from'node:url';async function getTemplateList(){const _0x2a1568=a2_0x8c3c;try{const _0x10bddb=fileURLToPath(import.meta.url),_0x5200ea=a2_0x70f610[_0x2a1568(0x1e4)](a2_0x70f610[_0x2a1568(0x1d1)](_0x10bddb),_0x2a1568(0x1cd)),_0x3a8ed3=a2_0x70f610[_0x2a1568(0x1db)](_0x5200ea,_0x2a1568(0x1da)),_0x5c9dd4=await readdir(_0x3a8ed3,{'withFileTypes':!![]}),_0x1c46bc=_0x5c9dd4[_0x2a1568(0x1e6)](_0x12a6e6=>_0x12a6e6[_0x2a1568(0x1c9)]())[_0x2a1568(0x1df)](_0x48cf9e=>({'label':_0x48cf9e[_0x2a1568(0x1d9)]}))['sort']((_0x592b1f,_0x13c047)=>_0x592b1f[_0x2a1568(0x1d8)]['localeCompare'](_0x13c047[_0x2a1568(0x1d8)]));return _0x1c46bc;}catch(_0x599af0){return console['error'](_0x2a1568(0x1d6),_0x599af0),[{'label':_0x2a1568(0x1de)},{'label':_0x2a1568(0x1d5)}];}}function a2_0x2466(){const _0x4c43e3=['return','blank','map','请选择您要创建的页面模板','gray','8YBxeoX','正在加载页面模板...','resolve','3150777qDVkYw','filter','isDirectory','1023844hDPVFV','\x20\x20\x20\x20\x20\x20\x20\x20','1300140ctxgJH','../..','6UFzdBT','1327716OfPAkf','length','dirname','497412AEtmHY','column','530128mbUlEJ','sdk-fetch','获取模板列表失败:','95070WnSqdQ','label','name','templates/pages','join','\x20Step1:\x20'];a2_0x2466=function(){return _0x4c43e3;};return a2_0x2466();}export function SelectPageTemplate(_0x4a45b4){const _0x2e4fdb=a2_0x8c3c,[_0x5798d2,_0x359f39]=useState(0x0),[_0x12db1a,_0x1a80d8]=useState([]),[_0x367dca,_0x4a1f2d]=useState(!![]);useEffect(()=>{async function _0x19d822(){const _0x18052a=await getTemplateList();_0x1a80d8(_0x18052a),_0x4a1f2d(![]);}_0x19d822();},[]),useInput((_0x1e2f78,_0x2e4fef)=>{const _0xf12174=a2_0x8c3c;if(_0x367dca)return;if(_0x2e4fef[_0xf12174(0x1dd)]){const _0x37eca1=_0x12db1a[_0x5798d2];_0x37eca1&&_0x4a45b4['onSelect'](_0x37eca1['label']);}_0x2e4fef['upArrow']&&_0x359f39(_0x3e1f9a=>_0x3e1f9a===0x0?_0x12db1a[_0xf12174(0x1d0)]-0x1:_0x3e1f9a-0x1),_0x2e4fef['downArrow']&&_0x359f39(_0x1c2e0a=>_0x1c2e0a===_0x12db1a[_0xf12174(0x1d0)]-0x1?0x0:_0x1c2e0a+0x1);});if(_0x367dca)return a2_0x85656d(Box,{'flexDirection':_0x2e4fdb(0x1d3),'paddingY':0x1,'children':a2_0x15255b(Box,{'children':[a2_0x85656d(Text,{'color':_0x2e4fdb(0x1e1),'children':_0x2e4fdb(0x1dc)}),a2_0x85656d(Text,{'children':_0x2e4fdb(0x1e3)})]})});return a2_0x15255b(Box,{'flexDirection':_0x2e4fdb(0x1d3),'paddingY':0x1,'children':[a2_0x15255b(Box,{'children':[a2_0x85656d(Text,{'color':'gray','children':_0x2e4fdb(0x1dc)}),a2_0x85656d(Text,{'children':_0x2e4fdb(0x1e0)})]}),_0x12db1a[_0x2e4fdb(0x1df)]((_0x412143,_0x4a9827)=>{const _0x3cc1d1=_0x2e4fdb,_0x294828=_0x4a9827===_0x5798d2,_0x31293c=_0x294828?'\x20\x20\x20\x20\x20\x20>\x20'+_0x412143['label']:_0x3cc1d1(0x1cb)+_0x412143[_0x3cc1d1(0x1d8)];return a2_0x85656d(Box,{'children':a2_0x85656d(Text,{'color':_0x294828?'green':undefined,'children':_0x31293c})},_0x31293c);})]});}
1
+ (function(_0x51743a,_0x386d71){const _0x276f4c=a2_0x44b6,_0x3d4ade=_0x51743a();while(!![]){try{const _0x384263=parseInt(_0x276f4c(0xcc))/0x1+parseInt(_0x276f4c(0xd5))/0x2*(parseInt(_0x276f4c(0xd8))/0x3)+-parseInt(_0x276f4c(0xdb))/0x4+-parseInt(_0x276f4c(0xbf))/0x5*(parseInt(_0x276f4c(0xc8))/0x6)+-parseInt(_0x276f4c(0xbc))/0x7+parseInt(_0x276f4c(0xba))/0x8*(-parseInt(_0x276f4c(0xc6))/0x9)+-parseInt(_0x276f4c(0xbd))/0xa*(-parseInt(_0x276f4c(0xd1))/0xb);if(_0x384263===_0x386d71)break;else _0x3d4ade['push'](_0x3d4ade['shift']());}catch(_0x4eec97){_0x3d4ade['push'](_0x3d4ade['shift']());}}}(a2_0x3765,0xa0399));import{jsx as a2_0x336dc6,jsxs as a2_0x3a9174}from'react/jsx-runtime';function a2_0x3765(){const _0x3f1c03=['localeCompare','blank','gray','isDirectory','12345443qJarxq','请选择您要创建的页面模板','downArrow','templates/pages','235178kVZEIe','upArrow','sdk-fetch','3yvuApN','green','length','4264048utNpNy','map','../..','error','43192lrMqeE','return','2549316JvirJx','30Siraic','label','10bIXUKs','正在加载页面模板...','获取模板列表失败:','column','sort','onSelect','resolve','1341FOwlwn','\x20Step1:\x20','2795322rrEaaf','join','name','\x20\x20\x20\x20\x20\x20\x20\x20','338178ZmglBh'];a2_0x3765=function(){return _0x3f1c03;};return a2_0x3765();}import{useState,useEffect}from'react';import{Text,Box,useInput}from'ink';function a2_0x44b6(_0x1d0fdf,_0xadc75){_0x1d0fdf=_0x1d0fdf-0xb7;const _0x3765b5=a2_0x3765();let _0x44b6b8=_0x3765b5[_0x1d0fdf];return _0x44b6b8;}import{readdir}from'node:fs/promises';import a2_0x5cd517 from'node:path';import{fileURLToPath}from'node:url';async function getTemplateList(){const _0x2658be=a2_0x44b6;try{const _0x692d0e=fileURLToPath(import.meta.url),_0x1eecf4=a2_0x5cd517[_0x2658be(0xc5)](a2_0x5cd517['dirname'](_0x692d0e),_0x2658be(0xb8)),_0x5e573e=a2_0x5cd517[_0x2658be(0xc9)](_0x1eecf4,_0x2658be(0xd4)),_0x426682=await readdir(_0x5e573e,{'withFileTypes':!![]}),_0xd0516a=_0x426682['filter'](_0x7cacad=>_0x7cacad[_0x2658be(0xd0)]())[_0x2658be(0xb7)](_0x25b1ab=>({'label':_0x25b1ab[_0x2658be(0xca)]}))[_0x2658be(0xc3)]((_0x42f833,_0x56c6f2)=>_0x42f833[_0x2658be(0xbe)][_0x2658be(0xcd)](_0x56c6f2[_0x2658be(0xbe)]));return _0xd0516a;}catch(_0x4ef821){return console[_0x2658be(0xb9)](_0x2658be(0xc1),_0x4ef821),[{'label':_0x2658be(0xce)},{'label':_0x2658be(0xd7)}];}}export function SelectPageTemplate(_0x3eadc7){const _0x534f64=a2_0x44b6,[_0x4a33d1,_0x8a5241]=useState(0x0),[_0x5015c,_0x4b154a]=useState([]),[_0x529822,_0x40e093]=useState(!![]);useEffect(()=>{async function _0x357fdd(){const _0x520d03=await getTemplateList();_0x4b154a(_0x520d03),_0x40e093(![]);}_0x357fdd();},[]),useInput((_0x27eaca,_0x3b96fe)=>{const _0x46bb00=a2_0x44b6;if(_0x529822)return;if(_0x3b96fe[_0x46bb00(0xbb)]){const _0x26527e=_0x5015c[_0x4a33d1];_0x26527e&&_0x3eadc7[_0x46bb00(0xc4)](_0x26527e['label']);}_0x3b96fe[_0x46bb00(0xd6)]&&_0x8a5241(_0x457eb9=>_0x457eb9===0x0?_0x5015c[_0x46bb00(0xda)]-0x1:_0x457eb9-0x1),_0x3b96fe[_0x46bb00(0xd3)]&&_0x8a5241(_0x24c789=>_0x24c789===_0x5015c[_0x46bb00(0xda)]-0x1?0x0:_0x24c789+0x1);});if(_0x529822)return a2_0x336dc6(Box,{'flexDirection':_0x534f64(0xc2),'paddingY':0x1,'children':a2_0x3a9174(Box,{'children':[a2_0x336dc6(Text,{'color':'gray','children':_0x534f64(0xc7)}),a2_0x336dc6(Text,{'children':_0x534f64(0xc0)})]})});return a2_0x3a9174(Box,{'flexDirection':_0x534f64(0xc2),'paddingY':0x1,'children':[a2_0x3a9174(Box,{'children':[a2_0x336dc6(Text,{'color':_0x534f64(0xcf),'children':_0x534f64(0xc7)}),a2_0x336dc6(Text,{'children':_0x534f64(0xd2)})]}),_0x5015c[_0x534f64(0xb7)]((_0x45020b,_0x25cb53)=>{const _0x2b78af=_0x534f64,_0x120f67=_0x25cb53===_0x4a33d1,_0x2f6e85=_0x120f67?'\x20\x20\x20\x20\x20\x20>\x20'+_0x45020b[_0x2b78af(0xbe)]:_0x2b78af(0xcb)+_0x45020b[_0x2b78af(0xbe)];return a2_0x336dc6(Box,{'children':a2_0x336dc6(Text,{'color':_0x120f67?_0x2b78af(0xd9):undefined,'children':_0x2f6e85})},_0x2f6e85);})]});}
@@ -1 +1 @@
1
- const a3_0x178e51=a3_0x2d77;function a3_0x18d5(){const _0x2fa8a4=['success','2797568XSRdut','status','[Y]\x20是,配置\x20AI\x20助手','Claude\x20Code','cursor','8889528lhkxMr','•\x20Skill:\x20安装研发最佳实践、Backend\x20Function\x20规范','75729870vLzdjo','[✓]','⭐\x20配置\x20AI\x20助手\x20(研发效率提升\x2010x)','has','error','length','selecting','codex','claude','name','[N]\x20跳过,稍后手动配置','return','Cursor','codebuddy','projectRoot','size','green','installing','delete','•\x20MCP:\x20让\x20AI\x20直接访问\x20Lovrabet\x20数据集','qoder','skill-','Enter\x20默认:\x20是','add','正在配置\x20AI\x20助手...','*\x20选择要配置的\x20IDE:','dimColor','5CgdQEi','ide','gray','473861jXOUcu','column','blue','3004816UZkKHQ','white','技能包\x20(研发规范指南)','mcp-','map','7SkOTWo','done','[\x20]','trae','1931169murkvD','agent','15094386eeojku','confirming','yellow','antigravity','push','↑/↓:\x20移动\x20空格:\x20切换\x20a:\x20全选\x20q:\x20退出\x20Enter:\x20确认','message','8KQMyUD','MCP\x20服务器\x20(AI\x20访问数据集)'];a3_0x18d5=function(){return _0x2fa8a4;};return a3_0x18d5();}(function(_0x1afdb9,_0xb00033){const _0xedebfb=a3_0x2d77,_0xe2738b=_0x1afdb9();while(!![]){try{const _0xe913a6=-parseInt(_0xedebfb(0x203))/0x1+-parseInt(_0xedebfb(0x21b))/0x2+parseInt(_0xedebfb(0x20f))/0x3*(-parseInt(_0xedebfb(0x218))/0x4)+-parseInt(_0xedebfb(0x200))/0x5*(parseInt(_0xedebfb(0x220))/0x6)+parseInt(_0xedebfb(0x20b))/0x7*(-parseInt(_0xedebfb(0x206))/0x8)+-parseInt(_0xedebfb(0x211))/0x9+parseInt(_0xedebfb(0x1e5))/0xa;if(_0xe913a6===_0xb00033)break;else _0xe2738b['push'](_0xe2738b['shift']());}catch(_0x5d9a93){_0xe2738b['push'](_0xe2738b['shift']());}}}(a3_0x18d5,0xd67d8));import{jsx as a3_0x5095f8,jsxs as a3_0x2113de}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Box,Text,useInput,useApp}from'ink';import{configureMcp}from'./config.js';import{installSkill,copySharedSkills,createSkillManifest,SKILL_IDE_CONFIGS}from'./config.js';const MCP_IDE_LIST=[a3_0x178e51(0x21f),a3_0x178e51(0x1ed)],SKILL_IDE_LIST=[a3_0x178e51(0x214),'claude',a3_0x178e51(0x1f2),a3_0x178e51(0x1ec),'cursor','opencode',a3_0x178e51(0x1f9),a3_0x178e51(0x20e),'windsurf',a3_0x178e51(0x210)];export function AISetupUI({config:_0x377759,onComplete:_0x2ac395}){const _0x605687=a3_0x178e51,{exit:_0x521d56}=useApp(),[_0x2f3f3c,_0xdd36b3]=useState(_0x605687(0x212)),[_0x57039f,_0x2ffc49]=useState(0x0),[_0x573c4d,_0x3cf8c1]=useState(new Set([0x0,0x1])),[_0xb2e09b,_0x5d9a5d]=useState(new Set(SKILL_IDE_LIST[_0x605687(0x20a)]((_0x2e0f89,_0x12835a)=>_0x12835a))),[_0x2d19c9,_0x30a67e]=useState('');useEffect(()=>{!_0x377759['appcode']&&_0x2ac395({'mcpResults':[],'skillResults':[]});},[_0x377759['appcode'],_0x2ac395]),useInput((_0x7a7a24,_0x20b43f)=>{const _0xf5445b=_0x605687;if(_0x2f3f3c===_0xf5445b(0x212)){if(_0x7a7a24==='y'||_0x7a7a24==='Y'||_0x20b43f[_0xf5445b(0x1f0)]){_0x557ba8();return;}if(_0x7a7a24==='n'||_0x7a7a24==='N'){_0x2ac395({'mcpResults':[],'skillResults':[]});return;}if(_0x20b43f[_0xf5445b(0x1f0)]){_0x557ba8();return;}}if(_0x2f3f3c===_0xf5445b(0x1eb)){if(_0x20b43f['upArrow']){_0x2ffc49(_0xb062f9=>_0xb062f9>0x0?_0xb062f9-0x1:SKILL_IDE_LIST['length']-0x1);return;}if(_0x20b43f['downArrow']){_0x2ffc49(_0x12c738=>_0x12c738<SKILL_IDE_LIST[_0xf5445b(0x1ea)]-0x1?_0x12c738+0x1:0x0);return;}if(_0x7a7a24==='\x20'){const _0x466836=_0x57039f<MCP_IDE_LIST[_0xf5445b(0x1ea)];if(_0x466836){const _0x239a66=new Set(_0x573c4d);_0x239a66[_0xf5445b(0x1e8)](_0x57039f)?_0x239a66[_0xf5445b(0x1f7)](_0x57039f):_0x239a66[_0xf5445b(0x1fc)](_0x57039f),_0x3cf8c1(_0x239a66);}else{const _0xd4ff52=_0x57039f-MCP_IDE_LIST[_0xf5445b(0x1ea)],_0x5250cc=new Set(_0xb2e09b);_0x5250cc[_0xf5445b(0x1e8)](_0xd4ff52)?_0x5250cc[_0xf5445b(0x1f7)](_0xd4ff52):_0x5250cc[_0xf5445b(0x1fc)](_0xd4ff52),_0x5d9a5d(_0x5250cc);}return;}if(_0x7a7a24==='a'||_0x7a7a24==='A'){_0x3cf8c1(new Set(MCP_IDE_LIST[_0xf5445b(0x20a)]((_0x271e71,_0x3df06e)=>_0x3df06e))),_0x5d9a5d(new Set(SKILL_IDE_LIST['map']((_0x3331c9,_0x1ee4e3)=>_0x1ee4e3)));return;}if(_0x7a7a24==='q'||_0x7a7a24==='Q'){_0x521d56();return;}if(_0x20b43f[_0xf5445b(0x1f0)]){if(_0x573c4d[_0xf5445b(0x1f4)]===0x0&&_0xb2e09b[_0xf5445b(0x1f4)]===0x0){_0x30a67e('请至少选择一个配置项');return;}_0x557ba8();return;}}if(_0x2f3f3c===_0xf5445b(0x20c)){_0x521d56();return;}});async function _0x557ba8(){const _0xa67af4=_0x605687;_0xdd36b3(_0xa67af4(0x1f6));const _0x5b2157=[],_0x283ab0=[];for(const _0x556c1b of _0x573c4d){const _0x322f7d=MCP_IDE_LIST[_0x556c1b];if(!_0x322f7d)continue;try{const _0x33faf6=await configureMcp(_0x322f7d,_0x377759[_0xa67af4(0x1f3)]);_0x5b2157[_0xa67af4(0x215)](_0x33faf6);}catch(_0x329582){_0x5b2157['push']({'ide':MCP_IDE_CONFIGS[_0x322f7d]?.['name']||_0x322f7d,'status':'error','message':_0x329582 instanceof Error?_0x329582[_0xa67af4(0x217)]:String(_0x329582)});}}await copySharedSkills(_0x377759[_0xa67af4(0x1f3)]);for(const _0x23ef25 of _0xb2e09b){const _0x9552fc=SKILL_IDE_LIST[_0x23ef25];if(!_0x9552fc)continue;try{const _0x31bea0=await installSkill(_0x9552fc,_0x377759[_0xa67af4(0x1f3)]);_0x283ab0[_0xa67af4(0x215)](_0x31bea0);}catch(_0x34b496){_0x283ab0[_0xa67af4(0x215)]({'ide':SKILL_IDE_CONFIGS[_0x9552fc]?.[_0xa67af4(0x1ee)]||_0x9552fc,'status':_0xa67af4(0x1e9),'message':_0x34b496 instanceof Error?_0x34b496[_0xa67af4(0x217)]:String(_0x34b496)});}}if(_0x283ab0[_0xa67af4(0x1ea)]>0x0){const _0x11b782=_0x283ab0['filter'](_0x3a69d5=>_0x3a69d5[_0xa67af4(0x21c)]===_0xa67af4(0x21a))[_0xa67af4(0x20a)](_0x4ea76e=>_0x4ea76e[_0xa67af4(0x201)]);_0x11b782[_0xa67af4(0x1ea)]>0x0&&createSkillManifest(_0x377759['projectRoot'],_0x11b782);}_0xdd36b3('done'),setTimeout(()=>{_0x2ac395({'mcpResults':_0x5b2157,'skillResults':_0x283ab0});},0xbb8);}if(_0x2f3f3c===_0x605687(0x212))return a3_0x2113de(Box,{'flexDirection':_0x605687(0x204),'marginTop':0x1,'children':[a3_0x5095f8(Box,{'children':a3_0x5095f8(Text,{'color':_0x605687(0x213),'bold':!![],'children':_0x605687(0x1e7)})}),a3_0x5095f8(Box,{'marginTop':0x1,'children':a3_0x5095f8(Text,{'color':_0x605687(0x207),'children':'是否同时配置\x20AI\x20助手?这将:'})}),a3_0x5095f8(Box,{'marginLeft':0x2,'marginTop':0x1,'children':a3_0x5095f8(Text,{'color':_0x605687(0x202),'children':_0x605687(0x1f8)})}),a3_0x5095f8(Box,{'marginLeft':0x2,'children':a3_0x5095f8(Text,{'color':_0x605687(0x202),'children':_0x605687(0x221)})}),a3_0x2113de(Box,{'marginTop':0x1,'flexDirection':'column','children':[a3_0x5095f8(Box,{'children':a3_0x5095f8(Text,{'color':_0x605687(0x1f5),'children':_0x605687(0x21d)})}),a3_0x5095f8(Box,{'children':a3_0x5095f8(Text,{'color':'gray','children':_0x605687(0x1ef)})}),a3_0x5095f8(Box,{'children':a3_0x5095f8(Text,{'color':_0x605687(0x1ff),'children':_0x605687(0x1fb)})})]}),_0x2d19c9&&a3_0x5095f8(Box,{'marginTop':0x1,'children':a3_0x2113de(Text,{'color':'red','children':['✗\x20',_0x2d19c9]})})]});if(_0x2f3f3c===_0x605687(0x1eb))return a3_0x2113de(Box,{'flexDirection':_0x605687(0x204),'marginTop':0x1,'children':[a3_0x5095f8(Box,{'children':a3_0x5095f8(Text,{'color':'cyan','bold':!![],'children':_0x605687(0x1fe)})}),_0x2d19c9&&a3_0x5095f8(Box,{'marginTop':0x1,'children':a3_0x2113de(Text,{'color':'red','children':['✗\x20',_0x2d19c9]})}),a3_0x2113de(Box,{'marginTop':0x1,'flexDirection':_0x605687(0x204),'children':[a3_0x5095f8(Text,{'bold':!![],'color':'yellow','children':_0x605687(0x219)}),MCP_IDE_LIST['map']((_0x1b125a,_0x3bfaf6)=>{const _0x2f9824=_0x605687,_0x108f6b=_0x57039f===_0x3bfaf6,_0x44fe42=_0x573c4d[_0x2f9824(0x1e8)](_0x3bfaf6);return a3_0x5095f8(Box,{'children':a3_0x2113de(Text,{'backgroundColor':_0x108f6b?_0x2f9824(0x205):undefined,'color':_0x108f6b?_0x2f9824(0x207):undefined,'children':[_0x44fe42?_0x2f9824(0x1e6):_0x2f9824(0x20d),'\x20',_0x1b125a==='cursor'?_0x2f9824(0x1f1):_0x2f9824(0x21e)]})},_0x2f9824(0x209)+_0x1b125a);}),a3_0x5095f8(Box,{'marginTop':0x1,'children':a3_0x5095f8(Text,{'bold':!![],'color':_0x605687(0x213),'children':_0x605687(0x208)})}),SKILL_IDE_LIST[_0x605687(0x20a)]((_0x345a7e,_0x4a81f7)=>{const _0x5a708c=_0x605687,_0x26c502=_0x4a81f7+MCP_IDE_LIST[_0x5a708c(0x1ea)],_0x2b4ad4=_0x57039f===_0x26c502,_0x597bbe=_0xb2e09b[_0x5a708c(0x1e8)](_0x26c502);return a3_0x5095f8(Box,{'children':a3_0x2113de(Text,{'backgroundColor':_0x2b4ad4?'blue':undefined,'color':_0x2b4ad4?_0x5a708c(0x207):undefined,'children':[_0x597bbe?_0x5a708c(0x1e6):_0x5a708c(0x20d),'\x20',SKILL_IDE_CONFIGS[_0x345a7e]['name']]})},_0x5a708c(0x1fa)+_0x345a7e);}),a3_0x5095f8(Box,{'marginTop':0x1,'children':a3_0x5095f8(Text,{'color':'gray','children':_0x605687(0x216)})})]})]});if(_0x2f3f3c==='installing')return a3_0x5095f8(Box,{'flexDirection':_0x605687(0x204),'marginTop':0x1,'children':a3_0x5095f8(Box,{'children':a3_0x5095f8(Text,{'children':_0x605687(0x1fd)})})});if(_0x2f3f3c===_0x605687(0x20c))return null;return null;}function a3_0x2d77(_0xb7b54a,_0xc64994){_0xb7b54a=_0xb7b54a-0x1e5;const _0x18d580=a3_0x18d5();let _0x2d77cc=_0x18d580[_0xb7b54a];return _0x2d77cc;}const MCP_IDE_CONFIGS={'cursor':{'name':'Cursor'},'claude':{'name':a3_0x178e51(0x21e)}};
1
+ const a3_0x59a741=a3_0x2147;(function(_0xe6c814,_0x5f30a8){const _0x4525ad=a3_0x2147,_0x3183ae=_0xe6c814();while(!![]){try{const _0x50ccec=parseInt(_0x4525ad(0x16b))/0x1*(parseInt(_0x4525ad(0x172))/0x2)+-parseInt(_0x4525ad(0x188))/0x3*(-parseInt(_0x4525ad(0x19a))/0x4)+parseInt(_0x4525ad(0x15f))/0x5+parseInt(_0x4525ad(0x18d))/0x6+-parseInt(_0x4525ad(0x196))/0x7*(parseInt(_0x4525ad(0x177))/0x8)+parseInt(_0x4525ad(0x162))/0x9*(-parseInt(_0x4525ad(0x17e))/0xa)+parseInt(_0x4525ad(0x185))/0xb;if(_0x50ccec===_0x5f30a8)break;else _0x3183ae['push'](_0x3183ae['shift']());}catch(_0x54b178){_0x3183ae['push'](_0x3183ae['shift']());}}}(a3_0x3108,0x4d1cb));import{jsx as a3_0x89ee7,jsxs as a3_0x224764}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Box,Text,useInput,useApp}from'ink';import{configureMcp}from'./config.js';function a3_0x3108(){const _0x570c8b=['gray','column','success','[✓]','skill-','1240450iiixDc','red','Claude\x20Code','has','blue','codex','yellow','56760bzSYXk','codebuddy','size','5247qFSrfr','正在配置\x20AI\x20助手...','return','white','push','812550CtyKjR','dimColor','[N]\x20跳过,稍后手动配置','upArrow','windsurf','downArrow','map','name','Cursor','456337zygMkD','opencode','confirming','projectRoot','1164hueZUr','antigravity','done','957530XyBvrz','filter','[Y]\x20是,配置\x20AI\x20助手','9KKpSGA','status','MCP\x20服务器\x20(AI\x20访问数据集)','add','•\x20Skill:\x20安装研发最佳实践、Backend\x20Function\x20规范','•\x20MCP:\x20让\x20AI\x20直接访问\x20Lovrabet\x20数据集','length','ide','qoder','1oaGNJc','selecting','↑/↓:\x20移动\x20空格:\x20切换\x20a:\x20全选\x20q:\x20退出\x20Enter:\x20确认','appcode','message','claude','cyan','110366wIzaWP','delete','技能包\x20(研发规范指南)','mcp-','cursor','56pjMxfi','trae'];a3_0x3108=function(){return _0x570c8b;};return a3_0x3108();}import{installSkill,copySharedSkills,createSkillManifest,SKILL_IDE_CONFIGS}from'./config.js';function a3_0x2147(_0x4636ba,_0x2ae5b6){_0x4636ba=_0x4636ba-0x15f;const _0x310874=a3_0x3108();let _0x2147e6=_0x310874[_0x4636ba];return _0x2147e6;}const MCP_IDE_LIST=['cursor','claude'],SKILL_IDE_LIST=[a3_0x59a741(0x19b),a3_0x59a741(0x170),a3_0x59a741(0x186),a3_0x59a741(0x183),a3_0x59a741(0x176),a3_0x59a741(0x197),a3_0x59a741(0x16a),a3_0x59a741(0x178),a3_0x59a741(0x191),'agent'];export function AISetupUI({config:_0x239371,onComplete:_0x47d4ef}){const _0x35b991=a3_0x59a741,{exit:_0x4750d0}=useApp(),[_0x558ed0,_0x33c171]=useState('confirming'),[_0x19d0e2,_0xda77d7]=useState(0x0),[_0x1ef523,_0x4ebd1b]=useState(new Set([0x0,0x1])),[_0x372442,_0xea6c2d]=useState(new Set(SKILL_IDE_LIST[_0x35b991(0x193)]((_0x3b77ac,_0x3b01d8)=>_0x3b01d8))),[_0x16a9ad,_0x4215c9]=useState('');useEffect(()=>{const _0xd3380a=_0x35b991;!_0x239371[_0xd3380a(0x16e)]&&_0x47d4ef({'mcpResults':[],'skillResults':[]});},[_0x239371[_0x35b991(0x16e)],_0x47d4ef]),useInput((_0x2b53f8,_0x2027db)=>{const _0x2b540d=_0x35b991;if(_0x558ed0===_0x2b540d(0x198)){if(_0x2b53f8==='y'||_0x2b53f8==='Y'||_0x2027db[_0x2b540d(0x18a)]){_0x2dc250();return;}if(_0x2b53f8==='n'||_0x2b53f8==='N'){_0x47d4ef({'mcpResults':[],'skillResults':[]});return;}if(_0x2027db['return']){_0x2dc250();return;}}if(_0x558ed0===_0x2b540d(0x16c)){if(_0x2027db[_0x2b540d(0x190)]){_0xda77d7(_0x3ec413=>_0x3ec413>0x0?_0x3ec413-0x1:SKILL_IDE_LIST[_0x2b540d(0x168)]-0x1);return;}if(_0x2027db[_0x2b540d(0x192)]){_0xda77d7(_0x211631=>_0x211631<SKILL_IDE_LIST[_0x2b540d(0x168)]-0x1?_0x211631+0x1:0x0);return;}if(_0x2b53f8==='\x20'){const _0x27e7de=_0x19d0e2<MCP_IDE_LIST[_0x2b540d(0x168)];if(_0x27e7de){const _0x52915c=new Set(_0x1ef523);_0x52915c[_0x2b540d(0x181)](_0x19d0e2)?_0x52915c[_0x2b540d(0x173)](_0x19d0e2):_0x52915c[_0x2b540d(0x165)](_0x19d0e2),_0x4ebd1b(_0x52915c);}else{const _0x48e91a=_0x19d0e2-MCP_IDE_LIST[_0x2b540d(0x168)],_0x5f13f9=new Set(_0x372442);_0x5f13f9[_0x2b540d(0x181)](_0x48e91a)?_0x5f13f9[_0x2b540d(0x173)](_0x48e91a):_0x5f13f9[_0x2b540d(0x165)](_0x48e91a),_0xea6c2d(_0x5f13f9);}return;}if(_0x2b53f8==='a'||_0x2b53f8==='A'){_0x4ebd1b(new Set(MCP_IDE_LIST[_0x2b540d(0x193)]((_0x10c087,_0x30c2db)=>_0x30c2db))),_0xea6c2d(new Set(SKILL_IDE_LIST[_0x2b540d(0x193)]((_0x445c75,_0x135a9f)=>_0x135a9f)));return;}if(_0x2b53f8==='q'||_0x2b53f8==='Q'){_0x4750d0();return;}if(_0x2027db[_0x2b540d(0x18a)]){if(_0x1ef523[_0x2b540d(0x187)]===0x0&&_0x372442[_0x2b540d(0x187)]===0x0){_0x4215c9('请至少选择一个配置项');return;}_0x2dc250();return;}}if(_0x558ed0===_0x2b540d(0x19c)){_0x4750d0();return;}});async function _0x2dc250(){const _0x17c176=_0x35b991;_0x33c171('installing');const _0x18c2f6=[],_0x4d363e=[];for(const _0x3b7802 of _0x1ef523){const _0x19372e=MCP_IDE_LIST[_0x3b7802];if(!_0x19372e)continue;try{const _0x13239c=await configureMcp(_0x19372e,_0x239371['projectRoot']);_0x18c2f6[_0x17c176(0x18c)](_0x13239c);}catch(_0x362dd1){_0x18c2f6[_0x17c176(0x18c)]({'ide':MCP_IDE_CONFIGS[_0x19372e]?.[_0x17c176(0x194)]||_0x19372e,'status':'error','message':_0x362dd1 instanceof Error?_0x362dd1[_0x17c176(0x16f)]:String(_0x362dd1)});}}await copySharedSkills(_0x239371[_0x17c176(0x199)]);for(const _0x184035 of _0x372442){const _0x352fd5=SKILL_IDE_LIST[_0x184035];if(!_0x352fd5)continue;try{const _0x1c1fe5=await installSkill(_0x352fd5,_0x239371['projectRoot']);_0x4d363e['push'](_0x1c1fe5);}catch(_0x48709c){_0x4d363e['push']({'ide':SKILL_IDE_CONFIGS[_0x352fd5]?.['name']||_0x352fd5,'status':'error','message':_0x48709c instanceof Error?_0x48709c[_0x17c176(0x16f)]:String(_0x48709c)});}}if(_0x4d363e[_0x17c176(0x168)]>0x0){const _0x25fda0=_0x4d363e[_0x17c176(0x160)](_0x167ba8=>_0x167ba8[_0x17c176(0x163)]===_0x17c176(0x17b))[_0x17c176(0x193)](_0x184538=>_0x184538[_0x17c176(0x169)]);_0x25fda0[_0x17c176(0x168)]>0x0&&createSkillManifest(_0x239371[_0x17c176(0x199)],_0x25fda0);}_0x33c171(_0x17c176(0x19c)),setTimeout(()=>{_0x47d4ef({'mcpResults':_0x18c2f6,'skillResults':_0x4d363e});},0xbb8);}if(_0x558ed0===_0x35b991(0x198))return a3_0x224764(Box,{'flexDirection':'column','marginTop':0x1,'children':[a3_0x89ee7(Box,{'marginTop':0x1,'children':a3_0x89ee7(Text,{'color':_0x35b991(0x18b),'children':'是否同时配置\x20AI\x20助手?这将:'})}),a3_0x89ee7(Box,{'marginLeft':0x2,'marginTop':0x1,'children':a3_0x89ee7(Text,{'color':_0x35b991(0x179),'children':_0x35b991(0x167)})}),a3_0x89ee7(Box,{'marginLeft':0x2,'children':a3_0x89ee7(Text,{'color':_0x35b991(0x179),'children':_0x35b991(0x166)})}),a3_0x224764(Box,{'marginTop':0x1,'flexDirection':_0x35b991(0x17a),'children':[a3_0x89ee7(Box,{'children':a3_0x89ee7(Text,{'color':'green','children':_0x35b991(0x161)})}),a3_0x89ee7(Box,{'children':a3_0x89ee7(Text,{'color':_0x35b991(0x179),'children':_0x35b991(0x18f)})}),a3_0x89ee7(Box,{'children':a3_0x89ee7(Text,{'color':_0x35b991(0x18e),'children':'Enter\x20默认:\x20是'})})]}),_0x16a9ad&&a3_0x89ee7(Box,{'marginTop':0x1,'children':a3_0x224764(Text,{'color':_0x35b991(0x17f),'children':['✗\x20',_0x16a9ad]})})]});if(_0x558ed0===_0x35b991(0x16c))return a3_0x224764(Box,{'flexDirection':_0x35b991(0x17a),'marginTop':0x1,'children':[a3_0x89ee7(Box,{'children':a3_0x89ee7(Text,{'color':_0x35b991(0x171),'bold':!![],'children':'*\x20选择要配置的\x20IDE:'})}),_0x16a9ad&&a3_0x89ee7(Box,{'marginTop':0x1,'children':a3_0x224764(Text,{'color':'red','children':['✗\x20',_0x16a9ad]})}),a3_0x224764(Box,{'marginTop':0x1,'flexDirection':_0x35b991(0x17a),'children':[a3_0x89ee7(Text,{'bold':!![],'color':_0x35b991(0x184),'children':_0x35b991(0x164)}),MCP_IDE_LIST[_0x35b991(0x193)]((_0x471878,_0x21a843)=>{const _0x176207=_0x35b991,_0x5a4f4a=_0x19d0e2===_0x21a843,_0xed5931=_0x1ef523[_0x176207(0x181)](_0x21a843);return a3_0x89ee7(Box,{'children':a3_0x224764(Text,{'backgroundColor':_0x5a4f4a?_0x176207(0x182):undefined,'color':_0x5a4f4a?_0x176207(0x18b):undefined,'children':[_0xed5931?_0x176207(0x17c):'[\x20]','\x20',_0x471878===_0x176207(0x176)?_0x176207(0x195):_0x176207(0x180)]})},_0x176207(0x175)+_0x471878);}),a3_0x89ee7(Box,{'marginTop':0x1,'children':a3_0x89ee7(Text,{'bold':!![],'color':_0x35b991(0x184),'children':_0x35b991(0x174)})}),SKILL_IDE_LIST[_0x35b991(0x193)]((_0x2a7f87,_0x1b18e0)=>{const _0x52c6e7=_0x35b991,_0x3cb3bc=_0x1b18e0+MCP_IDE_LIST[_0x52c6e7(0x168)],_0x2eb44a=_0x19d0e2===_0x3cb3bc,_0x63d05d=_0x372442[_0x52c6e7(0x181)](_0x3cb3bc);return a3_0x89ee7(Box,{'children':a3_0x224764(Text,{'backgroundColor':_0x2eb44a?_0x52c6e7(0x182):undefined,'color':_0x2eb44a?_0x52c6e7(0x18b):undefined,'children':[_0x63d05d?_0x52c6e7(0x17c):'[\x20]','\x20',SKILL_IDE_CONFIGS[_0x2a7f87][_0x52c6e7(0x194)]]})},_0x52c6e7(0x17d)+_0x2a7f87);}),a3_0x89ee7(Box,{'marginTop':0x1,'children':a3_0x89ee7(Text,{'color':_0x35b991(0x179),'children':_0x35b991(0x16d)})})]})]});if(_0x558ed0==='installing')return a3_0x89ee7(Box,{'flexDirection':'column','marginTop':0x1,'children':a3_0x89ee7(Box,{'children':a3_0x89ee7(Text,{'children':_0x35b991(0x189)})})});if(_0x558ed0===_0x35b991(0x19c))return null;return null;}const MCP_IDE_CONFIGS={'cursor':{'name':a3_0x59a741(0x195)},'claude':{'name':a3_0x59a741(0x180)}};
@@ -1 +1 @@
1
- const a4_0x1c957a=a4_0x1b8d;(function(_0x3bca02,_0x3b4ae3){const _0xf97535=a4_0x1b8d,_0x53334a=_0x3bca02();while(!![]){try{const _0x358853=-parseInt(_0xf97535(0x226))/0x1*(-parseInt(_0xf97535(0x1eb))/0x2)+-parseInt(_0xf97535(0x1dc))/0x3+-parseInt(_0xf97535(0x1cb))/0x4+parseInt(_0xf97535(0x217))/0x5*(-parseInt(_0xf97535(0x1c6))/0x6)+-parseInt(_0xf97535(0x20e))/0x7+-parseInt(_0xf97535(0x1f9))/0x8*(parseInt(_0xf97535(0x1c7))/0x9)+-parseInt(_0xf97535(0x1ca))/0xa*(-parseInt(_0xf97535(0x1d6))/0xb);if(_0x358853===_0x3b4ae3)break;else _0x53334a['push'](_0x53334a['shift']());}catch(_0x478f03){_0x53334a['push'](_0x53334a['shift']());}}}(a4_0x2a44,0x9a0ab));import{existsSync,mkdirSync,writeFileSync,readFileSync,copyFileSync}from'node:fs';import{join,resolve,dirname}from'node:path';import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';const __dirname=dirname(fileURLToPath(import.meta.url)),MCP_SERVER_NAME=a4_0x1c957a(0x1f2),MCP_COMMAND='npx',MCP_ARGS=[a4_0x1c957a(0x200)];export function buildEnvConfig(_0x23811d,_0x12bc35){const _0x2a260f=a4_0x1c957a,_0x3efc18={'LOVRABET_APP_CODE':String(_0x23811d)};return _0x12bc35!==_0x2a260f(0x228)&&(_0x3efc18[_0x2a260f(0x1f4)]=String(_0x12bc35)),_0x3efc18;}export async function configureCursorMcp(_0x4caf38){const _0xa18d96=a4_0x1c957a,_0x3c1502=_0x4caf38||process[_0xa18d96(0x213)](),_0x4be7ff=readConfig(_0x3c1502),_0x53e307=_0x4be7ff[_0xa18d96(0x1d7)]||_0x4be7ff['app'],_0x3a4a66=_0x4be7ff[_0xa18d96(0x1e1)]||_0xa18d96(0x228);if(!_0x53e307)return{'ide':_0xa18d96(0x227),'status':_0xa18d96(0x1db),'message':'需要先配置\x20appcode'};const _0x2652dc=buildEnvConfig(_0x53e307,_0x3a4a66),_0x31d03e={'command':MCP_COMMAND,'args':MCP_ARGS,'env':_0x2652dc},_0x45b371=join(_0x3c1502,_0xa18d96(0x1c2),_0xa18d96(0x1c4)),_0xabb969=join(_0x3c1502,'.cursor');try{!existsSync(_0xabb969)&&mkdirSync(_0xabb969,{'recursive':!![]});let _0xd81aef={'mcpServers':{}};if(existsSync(_0x45b371)){const _0x5f3fdb=readFileSync(_0x45b371,_0xa18d96(0x1ef));_0xd81aef=JSON['parse'](_0x5f3fdb);}return(!_0xd81aef[_0xa18d96(0x1c3)]||typeof _0xd81aef[_0xa18d96(0x1c3)]!==_0xa18d96(0x1f1))&&(_0xd81aef['mcpServers']={}),_0xd81aef[_0xa18d96(0x1c3)][MCP_SERVER_NAME]=_0x31d03e,writeFileSync(_0x45b371,JSON['stringify'](_0xd81aef,null,0x2),_0xa18d96(0x1ef)),logger['info'](_0xa18d96(0x21d),_0xa18d96(0x1ff),{'appcode':_0x53e307,'env':_0x3a4a66,'path':_0x45b371}),await copyCursorRules(_0xabb969),{'ide':_0xa18d96(0x227),'status':_0xa18d96(0x224),'message':_0xa18d96(0x1e9)};}catch(_0x89170c){return logger[_0xa18d96(0x1db)](_0xa18d96(0x21d),_0xa18d96(0x210),{'error':_0x89170c instanceof Error?_0x89170c['message']:String(_0x89170c)}),{'ide':_0xa18d96(0x227),'status':_0xa18d96(0x1db),'message':_0x89170c instanceof Error?_0x89170c[_0xa18d96(0x1d1)]:String(_0x89170c)};}}export async function configureClaudeMcp(_0x2fe0cc){const _0x577109=a4_0x1c957a,_0x2c20c5=_0x2fe0cc||process['cwd'](),_0x3c7827=readConfig(_0x2c20c5),_0x293548=_0x3c7827[_0x577109(0x1d7)]||_0x3c7827['app'],_0x1be537=_0x3c7827[_0x577109(0x1e1)]||_0x577109(0x228);if(!_0x293548)return{'ide':'Claude\x20Code','status':_0x577109(0x1db),'message':'需要先配置\x20appcode'};let _0x1c9404='claude\x20mcp\x20add\x20'+MCP_SERVER_NAME+'\x20'+MCP_COMMAND+'\x20'+MCP_ARGS[_0x577109(0x20c)]('\x20')+_0x577109(0x1da)+_0x293548;return _0x1be537!==_0x577109(0x228)&&(_0x1c9404+=_0x577109(0x1d4)+_0x1be537),await copyAgentsMd(_0x2c20c5),logger[_0x577109(0x211)](_0x577109(0x21d),_0x577109(0x1ea),{'command':_0x1c9404,'appcode':_0x293548,'env':_0x1be537}),console[_0x577109(0x1c9)]('\x0a📋\x20请执行以下命令配置\x20Claude\x20Code\x20MCP:\x0a'),console[_0x577109(0x1c9)]('\x20\x20'+_0x1c9404+'\x0a'),console['log'](_0x577109(0x21b)),console[_0x577109(0x1c9)]('\x20\x20AppCode:\x20'+_0x293548),_0x1be537!==_0x577109(0x228)&&console[_0x577109(0x1c9)]('\x20\x20环境:\x20'+_0x1be537),console[_0x577109(0x1c9)](_0x577109(0x212)),{'ide':_0x577109(0x1cd),'status':_0x577109(0x1cf),'message':_0x577109(0x204)+_0x1c9404};}function a4_0x1b8d(_0x567285,_0xec9422){_0x567285=_0x567285-0x1c1;const _0x2a44cc=a4_0x2a44();let _0x1b8d8f=_0x2a44cc[_0x567285];return _0x1b8d8f;}function a4_0x2a44(){const _0x2eeba4=['utf-8','name','object','lovrabet-dataset','.shared','LOVRABET_ENV','node:fs','\x20\x20\x22mcpServers\x22:\x20{','Qoder','2.0.0','638576WTJTen','其他\x20IDE\x20配置指引已显示','已复制\x20','rules','\x22:\x20{','创建技能包\x20manifest','Cursor\x20MCP\x20配置成功','@lovrabet/dataset-mcp-server@latest','\x20\x20\x20\x20\x20\x20\x22env\x22:\x20{','\x20技能包安装成功','skill-install','请手动执行:\x20','.lovrabet/skill/.shared','模板不存在:\x20','lovrabet_rules.mdc','.codebuddy','OpenCode','\x20个目录','\x20技能包安装失败','join','\x20\x20\x20\x20\x20\x20\x20\x20\x22LOVRABET_ENV\x22:\x20\x22','4218760EqmjSE','创建\x20Cursor\x20Rules\x20文件','Cursor\x20MCP\x20配置失败','info','\x20\x20重启\x20Claude\x20Code\x20后生效\x0a','cwd','\x20\x20\x20\x20\x20\x20}','\x20\x20}','.agent','4976515rcxzeZ','agents.md','创建\x20agents.md\x20文件','map','配置信息:','复制\x20agents.md\x20文件失败','mcp-install','.trae','.qoder','Windsurf','Antigravity','cursor','\x20\x20\x20\x20\x20\x20\x22command\x22:\x20\x22','success','Codex','572249kMoayh','Cursor','online','不支持的\x20MCP\x20IDE:\x20','.cursor','mcpServers','mcp.json','复制\x20Cursor\x20Rules\x20文件失败','6pJnqJp','72kSOctG','\x20\x20\x20\x20\x20\x20\x22args\x22:\x20[','log','10MhUGoo','853012vOGGgR','.claude','Claude\x20Code','共享技能文件复制失败','manual','Qoder\x20IDE','message','\x20\x20\x20\x20\x20\x20\x20\x20\x22LOVRABET_APP_CODE\x22:\x20\x22','Antigravity\x20IDE','\x20-e\x20LOVRABET_ENV=','isDirectory','30568043TsImKV','appcode','通用模板','.lovrabet','\x20-e\x20LOVRABET_APP_CODE=','error','811185mnIUSn','.lovrabet/skill-manifest.json','.codex','配置指引已显示','stringify','env','其他\x20IDE','OpenCode\x20IDE','agent','Trae\x20IDE','Windsurf\x20IDE','CodeBuddy\x20IDE','../../templates/rules/lovrabet_rules.mdc.tpl','已写入\x20.cursor/mcp.json','Claude\x20Code\x20MCP\x20命令已生成','2ihoMYM','共享技能文件复制成功','../../templates/skills','.windsurf'];a4_0x2a44=function(){return _0x2eeba4;};return a4_0x2a44();}export async function showOtherGuide(_0x9aa553){const _0x1dbc82=a4_0x1c957a,_0x8e86fb=_0x9aa553||process[_0x1dbc82(0x213)](),_0x36719f=readConfig(_0x8e86fb),_0x19fb0c=_0x36719f['appcode']||_0x36719f['app'],_0x381a22=_0x36719f['env']||_0x1dbc82(0x228);if(!_0x19fb0c)return{'ide':'其他','status':_0x1dbc82(0x1db),'message':'需要先配置\x20appcode'};return console[_0x1dbc82(0x1c9)]('\x0a📋\x20其他\x20IDE\x20MCP\x20配置:\x0a'),console[_0x1dbc82(0x1c9)]('{'),console['log'](_0x1dbc82(0x1f6)),console['log']('\x20\x20\x20\x20\x22'+MCP_SERVER_NAME+_0x1dbc82(0x1fd)),console[_0x1dbc82(0x1c9)](_0x1dbc82(0x223)+MCP_COMMAND+'\x22,'),console[_0x1dbc82(0x1c9)](_0x1dbc82(0x1c8)+MCP_ARGS[_0x1dbc82(0x21a)](_0x72157f=>'\x22'+_0x72157f+'\x22')[_0x1dbc82(0x20c)](',\x20')+'],'),console[_0x1dbc82(0x1c9)](_0x1dbc82(0x201)),console[_0x1dbc82(0x1c9)](_0x1dbc82(0x1d2)+_0x19fb0c+'\x22,'),_0x381a22!==_0x1dbc82(0x228)&&console[_0x1dbc82(0x1c9)](_0x1dbc82(0x20d)+_0x381a22+'\x22,'),console[_0x1dbc82(0x1c9)](_0x1dbc82(0x214)),console[_0x1dbc82(0x1c9)]('\x20\x20\x20\x20}'),console[_0x1dbc82(0x1c9)](_0x1dbc82(0x215)),console['log']('}\x0a'),logger[_0x1dbc82(0x211)]('mcp-install',_0x1dbc82(0x1fa),{'appcode':_0x19fb0c,'env':_0x381a22}),{'ide':'其他','status':_0x1dbc82(0x1cf),'message':_0x1dbc82(0x1df)};}export async function configureMcp(_0x347550,_0x11451c){const _0x26e80d=a4_0x1c957a;switch(_0x347550){case _0x26e80d(0x222):return await configureCursorMcp(_0x11451c);case'claude':return await configureClaudeMcp(_0x11451c);default:throw new Error(_0x26e80d(0x1c1)+_0x347550);}}async function copyCursorRules(_0x9e0eee){const _0x292175=a4_0x1c957a,_0xf7f299=join(_0x9e0eee,_0x292175(0x1fc)),_0x5c3f0e=join(_0xf7f299,_0x292175(0x207));if(existsSync(_0x5c3f0e))return;try{!existsSync(_0xf7f299)&&mkdirSync(_0xf7f299,{'recursive':!![]});const _0x2a825c=resolve(__dirname,_0x292175(0x1e8));existsSync(_0x2a825c)&&(copyFileSync(_0x2a825c,_0x5c3f0e),logger['info'](_0x292175(0x21d),_0x292175(0x20f),{'from':_0x2a825c,'to':_0x5c3f0e}));}catch(_0x3db18e){logger['error'](_0x292175(0x21d),_0x292175(0x1c5),{'error':_0x3db18e instanceof Error?_0x3db18e['message']:String(_0x3db18e)});}}async function copyAgentsMd(_0x47a4fc){const _0x53b1dc=a4_0x1c957a,_0x1b83fe=join(_0x47a4fc,_0x53b1dc(0x218));if(existsSync(_0x1b83fe))return;try{const _0x489e1f=resolve(__dirname,'../../templates/rules/lovrabet_rules.mdc.tpl');if(existsSync(_0x489e1f)){const _0x3bf357=readFileSync(_0x489e1f,'utf-8');writeFileSync(_0x1b83fe,_0x3bf357,_0x53b1dc(0x1ef)),logger[_0x53b1dc(0x211)](_0x53b1dc(0x21d),_0x53b1dc(0x219),{'from':_0x489e1f,'to':_0x1b83fe});}}catch(_0x1e9e03){logger[_0x53b1dc(0x1db)]('mcp-install',_0x53b1dc(0x21c),{'error':_0x1e9e03 instanceof Error?_0x1e9e03[_0x53b1dc(0x1d1)]:String(_0x1e9e03)});}}export const SKILL_IDE_CONFIGS={'cursor':{'name':a4_0x1c957a(0x227),'description':'Cursor\x20IDE','folders':['.cursorrules',a4_0x1c957a(0x1c2)]},'windsurf':{'name':a4_0x1c957a(0x220),'description':a4_0x1c957a(0x1e6),'folders':[a4_0x1c957a(0x1ee)]},'claude':{'name':a4_0x1c957a(0x1cd),'description':a4_0x1c957a(0x1cd),'folders':[a4_0x1c957a(0x1cc)]},'codex':{'name':a4_0x1c957a(0x225),'description':'Codex\x20IDE','folders':[a4_0x1c957a(0x1de)]},'opencode':{'name':a4_0x1c957a(0x209),'description':a4_0x1c957a(0x1e3),'folders':['.opencode']},'qoder':{'name':a4_0x1c957a(0x1f7),'description':a4_0x1c957a(0x1d0),'folders':[a4_0x1c957a(0x21f)]},'codebuddy':{'name':'CodeBuddy','description':a4_0x1c957a(0x1e7),'folders':[a4_0x1c957a(0x208)]},'trae':{'name':'Trae','description':a4_0x1c957a(0x1e5),'folders':[a4_0x1c957a(0x21e)]},'antigravity':{'name':a4_0x1c957a(0x221),'description':a4_0x1c957a(0x1d3),'folders':[a4_0x1c957a(0x216)]},'agent':{'name':a4_0x1c957a(0x1d8),'description':a4_0x1c957a(0x1e2),'folders':['.agent']}};async function copyDir(_0x327e1c,_0x4bc2e7){const _0x2a5742=a4_0x1c957a,{statSync:_0x22a127}=await import('node:fs'),{readdirSync:_0x39d9e5}=await import(_0x2a5742(0x1f5)),_0x1ab44f=_0x22a127(_0x327e1c);if(_0x1ab44f[_0x2a5742(0x1d5)]()){!existsSync(_0x4bc2e7)&&mkdirSync(_0x4bc2e7,{'recursive':!![]});const _0x4a80c4=_0x39d9e5(_0x327e1c);for(const _0x57c95a of _0x4a80c4){await copyDir(join(_0x327e1c,_0x57c95a),join(_0x4bc2e7,_0x57c95a));}}else copyFileSync(_0x327e1c,_0x4bc2e7);}export async function installSkill(_0x725710,_0x4f91fd){const _0x3e4576=a4_0x1c957a,_0x2f0a49=_0x4f91fd||process[_0x3e4576(0x213)](),_0x26f44b=resolve(__dirname,_0x3e4576(0x1ed)),_0x1646ae=_0x725710===_0x3e4576(0x1e4),_0x4cc40e=SKILL_IDE_CONFIGS[_0x725710],_0x561845=_0x1646ae?'通用模板':_0x4cc40e[_0x3e4576(0x1f0)];try{let _0x45e806=0x0;const _0x499a51=_0x1646ae?[_0x3e4576(0x216)]:_0x4cc40e['folders'];for(const _0x436b09 of _0x499a51){const _0x476f2c=join(_0x26f44b,_0x436b09),_0x5e2d09=join(_0x2f0a49,_0x436b09);if(!existsSync(_0x476f2c)){logger['warn'](_0x3e4576(0x203),_0x3e4576(0x206)+_0x476f2c);continue;}await copyDir(_0x476f2c,_0x5e2d09),_0x45e806++;}return logger['info'](_0x3e4576(0x203),_0x561845+_0x3e4576(0x202),{'ide':_0x725710,'foldersCount':_0x45e806}),{'ide':_0x561845,'status':_0x3e4576(0x224),'message':_0x3e4576(0x1fb)+_0x45e806+_0x3e4576(0x20a)};}catch(_0xf14dc1){return logger[_0x3e4576(0x1db)](_0x3e4576(0x203),_0x561845+_0x3e4576(0x20b),{'error':_0xf14dc1 instanceof Error?_0xf14dc1['message']:String(_0xf14dc1)}),{'ide':_0x561845,'status':_0x3e4576(0x1db),'message':_0xf14dc1 instanceof Error?_0xf14dc1[_0x3e4576(0x1d1)]:String(_0xf14dc1)};}}export async function copySharedSkills(_0x5e1e20){const _0x48a189=a4_0x1c957a,_0x2ae9a9=_0x5e1e20||process[_0x48a189(0x213)](),_0x506adf=resolve(__dirname,_0x48a189(0x1ed)),_0x4ea48a=join(_0x506adf,_0x48a189(0x1f3)),_0x4b3a89=join(_0x2ae9a9,_0x48a189(0x205));if(!existsSync(_0x4ea48a))return![];try{return await copyDir(_0x4ea48a,_0x4b3a89),logger[_0x48a189(0x211)](_0x48a189(0x203),_0x48a189(0x1ec),{'path':_0x4b3a89}),!![];}catch(_0x8108af){return logger[_0x48a189(0x1db)](_0x48a189(0x203),_0x48a189(0x1ce),{'error':_0x8108af instanceof Error?_0x8108af['message']:String(_0x8108af)}),![];}}export function createSkillManifest(_0x45006b,_0x4bb079){const _0x4c7639=a4_0x1c957a,_0x5db11f={'version':_0x4c7639(0x1f8),'installedAt':new Date()['toISOString'](),'platforms':_0x4bb079},_0x47efb5=join(_0x45006b,_0x4c7639(0x1dd)),_0x2f46f3=join(_0x45006b,_0x4c7639(0x1d9));!existsSync(_0x2f46f3)&&mkdirSync(_0x2f46f3,{'recursive':!![]}),writeFileSync(_0x47efb5,JSON[_0x4c7639(0x1e0)](_0x5db11f,null,0x2),'utf-8'),logger[_0x4c7639(0x211)](_0x4c7639(0x203),_0x4c7639(0x1fe),{'path':_0x47efb5});}
1
+ const a4_0x59c374=a4_0x4594;(function(_0x529ecc,_0x13a3ef){const _0x1b633b=a4_0x4594,_0x1e318d=_0x529ecc();while(!![]){try{const _0x2074f2=parseInt(_0x1b633b(0x1ed))/0x1+-parseInt(_0x1b633b(0x22b))/0x2*(-parseInt(_0x1b633b(0x1e8))/0x3)+parseInt(_0x1b633b(0x1e1))/0x4+parseInt(_0x1b633b(0x21d))/0x5*(-parseInt(_0x1b633b(0x1fe))/0x6)+parseInt(_0x1b633b(0x1e9))/0x7+parseInt(_0x1b633b(0x224))/0x8+parseInt(_0x1b633b(0x209))/0x9*(-parseInt(_0x1b633b(0x222))/0xa);if(_0x2074f2===_0x13a3ef)break;else _0x1e318d['push'](_0x1e318d['shift']());}catch(_0x595f45){_0x1e318d['push'](_0x1e318d['shift']());}}}(a4_0x4921,0x75601));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';const __dirname=dirname(fileURLToPath(import.meta.url)),MCP_SERVER_NAME='lovrabet-dataset',MCP_COMMAND=a4_0x59c374(0x20f),MCP_ARGS=['@lovrabet/dataset-mcp-server@latest'];function a4_0x4594(_0x584790,_0x463ab5){_0x584790=_0x584790-0x1de;const _0x4921fd=a4_0x4921();let _0x4594c8=_0x4921fd[_0x584790];return _0x4594c8;}function a4_0x4921(){const _0x1ca42e=['skill-install','复制\x20Cursor\x20Rules\x20文件失败','\x20\x20重启\x20Claude\x20Code\x20后生效\x0a','已写入\x20.cursor/mcp.json','\x20\x20\x20\x20\x20\x20\x20\x20\x22LOVRABET_APP_CODE\x22:\x20\x22','../../templates/skills','\x20\x20\x20\x20\x20\x20\x20\x20\x22LOVRABET_ENV\x22:\x20\x22','35wQOTwC','\x20\x20\x22mcpServers\x22:\x20{','manual','app','未知的\x20IDE:\x20','30foWxdF','\x20\x20环境:\x20','1554216NjCmLG','log','node:fs','map','stringify','message','Claude\x20Code','1906646pYSnMz','需要先配置\x20appcode','../../templates/rules/lovrabet_rules.mdc.tpl','rules','\x20\x20\x20\x20}','2055420aQwfEF','error','env','\x0a📋\x20请执行以下命令配置\x20Claude\x20Code\x20MCP:\x0a','2.0.0','success','.shared','3fhqLOn','5777814axgOPR','创建\x20Cursor\x20Rules\x20文件','\x22:\x20{','utf-8','740300eLiOPM','其他\x20IDE\x20配置指引已显示','\x20\x20\x20\x20\x20\x20\x22env\x22:\x20{','创建\x20agents.md\x20文件','创建技能包\x20manifest','\x20\x20}','Claude\x20Code\x20MCP\x20命令已生成','.cursor','.lovrabet','mcpServers','object','Cursor','cursor','cwd','共享技能文件复制成功','\x20\x20\x20\x20\x20\x20\x22args\x22:\x20[','\x20\x20AppCode:\x20','608862JjxdQa','不支持的\x20MCP\x20IDE:\x20','join','\x0a📋\x20其他\x20IDE\x20MCP\x20配置:\x0a','claude\x20mcp\x20add\x20','info','mcp.json','Cursor\x20MCP\x20配置失败','\x20技能包安装成功','.lovrabet/skill-manifest.json','复制\x20agents.md\x20文件失败','6108147qCzXhy','\x20技能包安装失败','lovrabet_rules.mdc','.lovrabet/skill/.shared','\x20\x20\x20\x20\x20\x20}','mcp-install','npx','\x20-e\x20LOVRABET_APP_CODE=','appcode','Cursor\x20MCP\x20配置成功','配置信息:','online','claude'];a4_0x4921=function(){return _0x1ca42e;};return a4_0x4921();}export function buildEnvConfig(_0x2f8650,_0x2d9e56){const _0x3aa0c6=a4_0x59c374,_0x789923={'LOVRABET_APP_CODE':String(_0x2f8650)};return _0x2d9e56!==_0x3aa0c6(0x214)&&(_0x789923['LOVRABET_ENV']=String(_0x2d9e56)),_0x789923;}export async function configureCursorMcp(_0x34ccc3){const _0x36cbe0=a4_0x59c374,_0x236969=_0x34ccc3||process[_0x36cbe0(0x1fa)](),_0x4af061=readConfig(_0x236969),_0x193044=_0x4af061[_0x36cbe0(0x211)]||_0x4af061['app'],_0x4e0899=_0x4af061[_0x36cbe0(0x1e3)]||_0x36cbe0(0x214);if(!_0x193044)return{'ide':'Cursor','status':_0x36cbe0(0x1e2),'message':'需要先配置\x20appcode'};const _0x1fc114=buildEnvConfig(_0x193044,_0x4e0899),_0x3f94a3={'command':MCP_COMMAND,'args':MCP_ARGS,'env':_0x1fc114},_0x44a8aa=join(_0x236969,_0x36cbe0(0x1f4),_0x36cbe0(0x204)),_0x46a44e=join(_0x236969,_0x36cbe0(0x1f4));try{!existsSync(_0x46a44e)&&mkdirSync(_0x46a44e,{'recursive':!![]});let _0x2a6217={'mcpServers':{}};if(existsSync(_0x44a8aa)){const _0x556227=readFileSync(_0x44a8aa,_0x36cbe0(0x1ec));_0x2a6217=JSON['parse'](_0x556227);}return(!_0x2a6217[_0x36cbe0(0x1f6)]||typeof _0x2a6217['mcpServers']!==_0x36cbe0(0x1f7))&&(_0x2a6217[_0x36cbe0(0x1f6)]={}),_0x2a6217[_0x36cbe0(0x1f6)][MCP_SERVER_NAME]=_0x3f94a3,writeFileSync(_0x44a8aa,JSON[_0x36cbe0(0x228)](_0x2a6217,null,0x2),_0x36cbe0(0x1ec)),logger[_0x36cbe0(0x203)]('mcp-install',_0x36cbe0(0x212),{'appcode':_0x193044,'env':_0x4e0899,'path':_0x44a8aa}),await copyCursorRules(_0x46a44e),{'ide':_0x36cbe0(0x1f8),'status':_0x36cbe0(0x1e6),'message':_0x36cbe0(0x219)};}catch(_0x52f431){return logger[_0x36cbe0(0x1e2)](_0x36cbe0(0x20e),_0x36cbe0(0x205),{'error':_0x52f431 instanceof Error?_0x52f431[_0x36cbe0(0x229)]:String(_0x52f431)}),{'ide':'Cursor','status':'error','message':_0x52f431 instanceof Error?_0x52f431[_0x36cbe0(0x229)]:String(_0x52f431)};}}export async function configureClaudeMcp(_0x46f111){const _0x5206b5=a4_0x59c374,_0x110768=_0x46f111||process[_0x5206b5(0x1fa)](),_0x9c5036=readConfig(_0x110768),_0x4b62b6=_0x9c5036[_0x5206b5(0x211)]||_0x9c5036[_0x5206b5(0x220)],_0x5af3e0=_0x9c5036[_0x5206b5(0x1e3)]||_0x5206b5(0x214);if(!_0x4b62b6)return{'ide':_0x5206b5(0x22a),'status':_0x5206b5(0x1e2),'message':_0x5206b5(0x22c)};let _0x31a4cb=_0x5206b5(0x202)+MCP_SERVER_NAME+'\x20'+MCP_COMMAND+'\x20'+MCP_ARGS[_0x5206b5(0x200)]('\x20')+_0x5206b5(0x210)+_0x4b62b6;return _0x5af3e0!==_0x5206b5(0x214)&&(_0x31a4cb+='\x20-e\x20LOVRABET_ENV='+_0x5af3e0),await copyAgentsMd(_0x110768),logger[_0x5206b5(0x203)]('mcp-install',_0x5206b5(0x1f3),{'command':_0x31a4cb,'appcode':_0x4b62b6,'env':_0x5af3e0}),console[_0x5206b5(0x225)](_0x5206b5(0x1e4)),console[_0x5206b5(0x225)]('\x20\x20'+_0x31a4cb+'\x0a'),console[_0x5206b5(0x225)](_0x5206b5(0x213)),console[_0x5206b5(0x225)](_0x5206b5(0x1fd)+_0x4b62b6),_0x5af3e0!==_0x5206b5(0x214)&&console[_0x5206b5(0x225)](_0x5206b5(0x223)+_0x5af3e0),console['log'](_0x5206b5(0x218)),{'ide':'Claude\x20Code','status':_0x5206b5(0x21f),'message':'请手动执行:\x20'+_0x31a4cb};}export async function showOtherGuide(_0x2c5dc9){const _0x283be4=a4_0x59c374,_0x2b94cd=_0x2c5dc9||process[_0x283be4(0x1fa)](),_0x323873=readConfig(_0x2b94cd),_0x1ad954=_0x323873[_0x283be4(0x211)]||_0x323873['app'],_0x4c16f9=_0x323873['env']||_0x283be4(0x214);if(!_0x1ad954)return{'ide':'其他','status':'error','message':'需要先配置\x20appcode'};return console[_0x283be4(0x225)](_0x283be4(0x201)),console[_0x283be4(0x225)]('{'),console[_0x283be4(0x225)](_0x283be4(0x21e)),console[_0x283be4(0x225)]('\x20\x20\x20\x20\x22'+MCP_SERVER_NAME+_0x283be4(0x1eb)),console[_0x283be4(0x225)]('\x20\x20\x20\x20\x20\x20\x22command\x22:\x20\x22'+MCP_COMMAND+'\x22,'),console['log'](_0x283be4(0x1fc)+MCP_ARGS[_0x283be4(0x227)](_0x21f86b=>'\x22'+_0x21f86b+'\x22')[_0x283be4(0x200)](',\x20')+'],'),console[_0x283be4(0x225)](_0x283be4(0x1ef)),console[_0x283be4(0x225)](_0x283be4(0x21a)+_0x1ad954+'\x22,'),_0x4c16f9!==_0x283be4(0x214)&&console[_0x283be4(0x225)](_0x283be4(0x21c)+_0x4c16f9+'\x22,'),console['log'](_0x283be4(0x20d)),console[_0x283be4(0x225)](_0x283be4(0x1e0)),console['log'](_0x283be4(0x1f2)),console[_0x283be4(0x225)]('}\x0a'),logger[_0x283be4(0x203)](_0x283be4(0x20e),_0x283be4(0x1ee),{'appcode':_0x1ad954,'env':_0x4c16f9}),{'ide':'其他','status':_0x283be4(0x21f),'message':'配置指引已显示'};}export async function configureMcp(_0x4b7af5,_0x4a32f4){const _0x11529e=a4_0x59c374;switch(_0x4b7af5){case _0x11529e(0x1f9):return await configureCursorMcp(_0x4a32f4);case _0x11529e(0x215):return await configureClaudeMcp(_0x4a32f4);default:throw new Error(_0x11529e(0x1ff)+_0x4b7af5);}}async function copyCursorRules(_0x278d0f){const _0x465978=a4_0x59c374,_0x32d55c=join(_0x278d0f,_0x465978(0x1df)),_0xdd0c73=join(_0x32d55c,_0x465978(0x20b));if(existsSync(_0xdd0c73))return;try{!existsSync(_0x32d55c)&&mkdirSync(_0x32d55c,{'recursive':!![]});const _0x2f2c8f=resolve(__dirname,_0x465978(0x1de));existsSync(_0x2f2c8f)&&(copyFileSync(_0x2f2c8f,_0xdd0c73),logger['info'](_0x465978(0x20e),_0x465978(0x1ea),{'from':_0x2f2c8f,'to':_0xdd0c73}));}catch(_0x387c0b){logger[_0x465978(0x1e2)](_0x465978(0x20e),_0x465978(0x217),{'error':_0x387c0b instanceof Error?_0x387c0b[_0x465978(0x229)]:String(_0x387c0b)});}}async function copyAgentsMd(_0x5e53ff){const _0xe432bd=a4_0x59c374,_0x422806=join(_0x5e53ff,'agents.md');if(existsSync(_0x422806))return;try{const _0x3615a5=resolve(__dirname,_0xe432bd(0x1de));if(existsSync(_0x3615a5)){const _0xb645de=readFileSync(_0x3615a5,_0xe432bd(0x1ec));writeFileSync(_0x422806,_0xb645de,'utf-8'),logger[_0xe432bd(0x203)]('mcp-install',_0xe432bd(0x1f0),{'from':_0x3615a5,'to':_0x422806});}}catch(_0x17a0f0){logger[_0xe432bd(0x1e2)](_0xe432bd(0x20e),_0xe432bd(0x208),{'error':_0x17a0f0 instanceof Error?_0x17a0f0[_0xe432bd(0x229)]:String(_0x17a0f0)});}}export const SKILL_IDE_CONFIGS=IDE_CONFIGS;export async function installSkill(_0x4951af,_0x33973a){const _0x46c6b5=a4_0x59c374,_0x4ee52b=_0x33973a||process['cwd'](),_0x5eaf07=resolve(__dirname,_0x46c6b5(0x21b)),_0x177f12=SKILL_IDE_CONFIGS[_0x4951af];if(!_0x177f12)return{'ide':_0x4951af,'status':_0x46c6b5(0x1e2),'message':_0x46c6b5(0x221)+_0x4951af};const _0x3e271d=_0x177f12['name'];try{const _0x5def32=await installSingleIDE(_0x4951af,_0x177f12,_0x4ee52b,_0x5eaf07);return logger[_0x46c6b5(0x203)](_0x46c6b5(0x216),_0x3e271d+_0x46c6b5(0x206),{'ide':_0x4951af,'filesCount':_0x5def32}),{'ide':_0x3e271d,'status':'success','message':'已创建\x20'+_0x5def32+'\x20项'};}catch(_0x55a7e3){return logger[_0x46c6b5(0x1e2)]('skill-install',_0x3e271d+_0x46c6b5(0x20a),{'error':_0x55a7e3 instanceof Error?_0x55a7e3[_0x46c6b5(0x229)]:String(_0x55a7e3)}),{'ide':_0x3e271d,'status':_0x46c6b5(0x1e2),'message':_0x55a7e3 instanceof Error?_0x55a7e3[_0x46c6b5(0x229)]:String(_0x55a7e3)};}}async function copyDir(_0x2e03ee,_0x3923da){const _0x48579c=a4_0x59c374,{statSync:_0x1c6506}=await import(_0x48579c(0x226)),{readdirSync:_0xc2f286}=await import('node:fs'),_0x10d76b=_0x1c6506(_0x2e03ee);if(_0x10d76b['isDirectory']()){!existsSync(_0x3923da)&&mkdirSync(_0x3923da,{'recursive':!![]});const _0x520e55=_0xc2f286(_0x2e03ee);for(const _0x37dae0 of _0x520e55){await copyDir(join(_0x2e03ee,_0x37dae0),join(_0x3923da,_0x37dae0));}}else copyFileSync(_0x2e03ee,_0x3923da);}export async function copySharedSkills(_0x22795a){const _0xe19dc1=a4_0x59c374,_0x49661b=_0x22795a||process['cwd'](),_0x3829df=resolve(__dirname,_0xe19dc1(0x21b)),_0xddfd4c=join(_0x3829df,_0xe19dc1(0x1e7)),_0x509340=join(_0x49661b,_0xe19dc1(0x20c));if(!existsSync(_0xddfd4c))return![];try{return await copyDir(_0xddfd4c,_0x509340),logger[_0xe19dc1(0x203)](_0xe19dc1(0x216),_0xe19dc1(0x1fb),{'path':_0x509340}),!![];}catch(_0x54fdb8){return logger[_0xe19dc1(0x1e2)](_0xe19dc1(0x216),'共享技能文件复制失败',{'error':_0x54fdb8 instanceof Error?_0x54fdb8[_0xe19dc1(0x229)]:String(_0x54fdb8)}),![];}}export function createSkillManifest(_0x4b2725,_0x45f9ac){const _0xcc9a74=a4_0x59c374,_0x4d8a2b={'version':_0xcc9a74(0x1e5),'installedAt':new Date()['toISOString'](),'platforms':_0x45f9ac},_0x36ef0b=join(_0x4b2725,_0xcc9a74(0x207)),_0x48298b=join(_0x4b2725,_0xcc9a74(0x1f5));!existsSync(_0x48298b)&&mkdirSync(_0x48298b,{'recursive':!![]}),writeFileSync(_0x36ef0b,JSON[_0xcc9a74(0x228)](_0x4d8a2b,null,0x2),_0xcc9a74(0x1ec)),logger[_0xcc9a74(0x203)](_0xcc9a74(0x216),_0xcc9a74(0x1f1),{'path':_0x36ef0b});}
@@ -1 +1 @@
1
- (function(_0x32e6db,_0x4e4a18){const _0x377340=a5_0x3ed5,_0x279944=_0x32e6db();while(!![]){try{const _0x2581c3=-parseInt(_0x377340(0x103))/0x1*(-parseInt(_0x377340(0xe7))/0x2)+-parseInt(_0x377340(0xcd))/0x3+-parseInt(_0x377340(0x100))/0x4*(-parseInt(_0x377340(0xd7))/0x5)+parseInt(_0x377340(0xf8))/0x6+parseInt(_0x377340(0xd9))/0x7*(-parseInt(_0x377340(0xff))/0x8)+-parseInt(_0x377340(0xfb))/0x9+-parseInt(_0x377340(0xfa))/0xa;if(_0x2581c3===_0x4e4a18)break;else _0x279944['push'](_0x279944['shift']());}catch(_0x558dbf){_0x279944['push'](_0x279944['shift']());}}}(a5_0x1919,0x91c7d));function a5_0x3ed5(_0x4b1b79,_0x45c17a){_0x4b1b79=_0x4b1b79-0xcb;const _0x19199e=a5_0x1919();let _0x3ed598=_0x19199e[_0x4b1b79];return _0x3ed598;}import{jsx as a5_0x2a9027,jsxs as a5_0x5a412b,Fragment as a5_0xb9bcfd}from'react/jsx-runtime';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';function a5_0x1919(){const _0x1ca5d3=['8VledWz','\x20重新登录后再试','正在生成\x20','1075436dynnrk','join','\x20个匹配的数据集\x1b[0m','3566877BxjsTS','文档生成完成','\x20个数据集','length','文档生成失败:\x20','.md\x20(','filePath','\x20(环境:\x20','🚀\x20','dim','1436455DgPvAx','setLogPath','350007qqdbdB','指定的数据集代码都不存在:\x20','*\x20生成的文档文件:','*\x20共处理\x20','\x20个数据集的文档...','⚠️\x20以下数据集生成失败:','正在获取数据集列表...','cwd','gray','filter','message','\x1b[90m*\x20从\x20','\x20个数据集中筛选出\x20','√\x20文档生成完成!成功\x20','2MLoFTy','💡\x20请使用\x20','white','includes','success','未找到任何数据集','env','cyan','column','yellow','datasetName',',\x20失败\x20','map','datasetCode','*\x20输出目录:\x20','\x20-\x20','log','6724302MZkOOl','api-doc','4710250BORMqS','1922652kEXAss','error','未提供应用AppCode,且配置中也没有默认值','green','48HHwLWG'];a5_0x1919=function(){return _0x1ca5d3;};return a5_0x1919();}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:_0x1814be,env:_0x23d8b4,output:_0x4548df,extraParams:_0x29f8cd,datasetCodes:_0x43102f})=>{const _0x1a699d=a5_0x3ed5,{exit:_0x186c87}=useApp(),[_0x1d30a5,_0x583c41]=useState(![]),[_0x458075,_0x1be484]=useState(''),[_0x4a83a5,_0xc3f928]=useState(![]),[_0x17b92d,_0x410096]=useState(null),[_0x5be56c,_0x365646]=useState(null),[_0x463ff6,_0x246961]=useState(0x0),_0x524505=readConfig(),_0x5c98cf=getConfigAppCode(),_0x21f7a4=_0x1814be||_0x5c98cf,_0x2462aa=typeof _0x524505?.[_0x1a699d(0xed)]==='string'?_0x524505[_0x1a699d(0xed)]:undefined,_0x45eaaf=_0x23d8b4||_0x2462aa||'online';initEnv(_0x45eaaf);const _0x545088=_0x4548df||'./docs',_0x305e49=_0x1814be?'使用指定的应用AppCode:\x20'+_0x21f7a4:'使用配置的应用AppCode:\x20'+_0x21f7a4;useEffect(()=>{_0x583c41(!![]),_0x15545f();},[]),useEffect(()=>{(_0x4a83a5||_0x17b92d)&&_0x186c87();},[_0x4a83a5,_0x17b92d,_0x186c87]);async function _0x15545f(){const _0x7fadba=_0x1a699d;if(!_0x21f7a4){_0x410096(_0x7fadba(0xfd));return;}try{logger[_0x7fadba(0xd8)](process[_0x7fadba(0xe0)]()),_0x1be484(_0x7fadba(0xdf));const {configArray:_0x36bb8e}=await fetchModelList(_0x21f7a4);_0x246961(_0x36bb8e[_0x7fadba(0xd0)]);if(_0x36bb8e['length']===0x0){_0x410096(_0x7fadba(0xec));return;}let _0x2d2283=_0x36bb8e;if(_0x43102f&&_0x43102f['length']>0x0){_0x2d2283=_0x36bb8e[_0x7fadba(0xe2)](_0x16d34d=>_0x43102f[_0x7fadba(0xea)](_0x16d34d[_0x7fadba(0xf4)]));const _0x46b857=_0x2d2283[_0x7fadba(0xf3)](_0xa58105=>_0xa58105[_0x7fadba(0xf4)]),_0x59b572=_0x43102f[_0x7fadba(0xe2)](_0x3a4942=>!_0x46b857[_0x7fadba(0xea)](_0x3a4942));_0x59b572[_0x7fadba(0xd0)]>0x0&&console[_0x7fadba(0xf7)]('\x1b[33m!\x20以下数据集代码不存在:\x20'+_0x59b572[_0x7fadba(0xcb)](',\x20')+'\x1b[0m');if(_0x2d2283[_0x7fadba(0xd0)]===0x0){_0x410096(_0x7fadba(0xda)+_0x43102f[_0x7fadba(0xcb)](',\x20'));return;}console[_0x7fadba(0xf7)](_0x7fadba(0xe4)+_0x36bb8e[_0x7fadba(0xd0)]+_0x7fadba(0xe5)+_0x2d2283[_0x7fadba(0xd0)]+_0x7fadba(0xcc));}_0x1be484(_0x7fadba(0x102)+_0x2d2283[_0x7fadba(0xd0)]+_0x7fadba(0xdd));const _0x581ec2=await generateDatasetDocs(_0x2d2283,_0x21f7a4,_0x545088,(_0x2d8538,_0xe9ff5b,_0xbbbcd9)=>{const _0x57b621=_0x7fadba;_0x1be484(_0x57b621(0x102)+_0xbbbcd9+_0x57b621(0xd2)+_0x2d8538+'/'+_0xe9ff5b+')');},_0x29f8cd);_0x365646(_0x581ec2),_0xc3f928(!![]);const _0x2af082=_0x581ec2[_0x7fadba(0xe2)](_0x433d41=>_0x433d41[_0x7fadba(0xeb)])[_0x7fadba(0xd0)],_0x4ae8c7=_0x581ec2['filter'](_0x4e3cd3=>!_0x4e3cd3['success'])['length'];logger[_0x7fadba(0xeb)](_0x7fadba(0xf9),_0x7fadba(0xce),undefined,{'totalCount':_0x581ec2[_0x7fadba(0xd0)],'successCount':_0x2af082,'failCount':_0x4ae8c7,'outputDir':_0x545088});}catch(_0xc60986){const _0x476119=_0xc60986 instanceof Error?_0xc60986[_0x7fadba(0xe3)]:String(_0xc60986);logger[_0x7fadba(0xfc)]('api-doc',_0x7fadba(0xd1)+_0x476119,{'appCode':_0x21f7a4,'outputDir':_0x545088}),_0x410096(_0x7fadba(0xd1)+_0x476119);}finally{_0x583c41(![]);}}const _0x4c6912=_0x5be56c?.['filter'](_0x382f55=>_0x382f55[_0x1a699d(0xeb)])['length']||0x0,_0x3afee3=_0x5be56c?.[_0x1a699d(0xe2)](_0x121f03=>!_0x121f03[_0x1a699d(0xeb)])[_0x1a699d(0xd0)]||0x0;return a5_0x5a412b(Box,{'flexDirection':_0x1a699d(0xef),'children':[(_0x1d30a5||_0x4a83a5)&&a5_0x5a412b(Box,{'children':[a5_0x2a9027(Text,{'color':_0x1a699d(0xe1),'children':'*\x20'}),a5_0x2a9027(Text,{'color':_0x1814be?_0x1a699d(0xe9):'dim','children':_0x305e49})]}),_0x1d30a5&&a5_0x2a9027(Box,{'children':a5_0x5a412b(Text,{'children':[_0x1a699d(0xd5),_0x458075,_0x1a699d(0xd4),_0x45eaaf,')']})}),_0x4a83a5&&_0x5be56c&&a5_0x5a412b(Box,{'flexDirection':'column','children':[a5_0x2a9027(Box,{'children':a5_0x5a412b(Text,{'color':_0x1a699d(0xfe),'children':[_0x1a699d(0xe6),_0x4c6912,'\x20个',_0x3afee3>0x0&&_0x1a699d(0xf2)+_0x3afee3+'\x20个']})}),a5_0x2a9027(Box,{'marginTop':0x1,'children':a5_0x5a412b(Text,{'color':'gray','children':[_0x1a699d(0xdc),_0x463ff6,_0x1a699d(0xcf)]})}),a5_0x5a412b(Box,{'marginTop':0x1,'children':[a5_0x2a9027(Text,{'color':_0x1a699d(0xe1),'children':_0x1a699d(0xf5)}),a5_0x2a9027(Text,{'color':_0x1a699d(0xee),'children':_0x545088})]}),_0x4c6912>0x0&&a5_0x5a412b(a5_0xb9bcfd,{'children':[a5_0x2a9027(Box,{'marginTop':0x1,'children':a5_0x2a9027(Text,{'color':_0x1a699d(0xe1),'children':_0x1a699d(0xdb)})}),_0x5be56c[_0x1a699d(0xe2)](_0x1bd226=>_0x1bd226['success'])[_0x1a699d(0xf3)]((_0x16f2d1,_0x5dea0c)=>a5_0x5a412b(Box,{'marginLeft':0x2,'children':[a5_0x5a412b(Text,{'color':_0x1a699d(0xee),'children':['•\x20',_0x16f2d1[_0x1a699d(0xd3)]]}),a5_0x5a412b(Text,{'color':_0x1a699d(0xd6),'children':[_0x1a699d(0xf6),_0x16f2d1[_0x1a699d(0xf1)]]})]},_0x5dea0c))]}),_0x3afee3>0x0&&a5_0x5a412b(a5_0xb9bcfd,{'children':[a5_0x2a9027(Box,{'marginTop':0x1,'children':a5_0x2a9027(Text,{'color':_0x1a699d(0xf0),'children':_0x1a699d(0xde)})}),_0x5be56c[_0x1a699d(0xe2)](_0x57f653=>!_0x57f653[_0x1a699d(0xeb)])[_0x1a699d(0xf3)]((_0x579aa0,_0x4c023e)=>a5_0x5a412b(Box,{'marginLeft':0x2,'flexDirection':_0x1a699d(0xef),'children':[a5_0x5a412b(Text,{'color':'red','children':['•\x20',_0x579aa0[_0x1a699d(0xf1)],'\x20(',_0x579aa0[_0x1a699d(0xf4)],')']}),_0x579aa0[_0x1a699d(0xfc)]&&a5_0x2a9027(Box,{'marginLeft':0x2,'children':a5_0x2a9027(Text,{'color':_0x1a699d(0xd6),'children':_0x579aa0['error']})})]},_0x4c023e))]})]}),_0x17b92d&&a5_0x5a412b(Box,{'flexDirection':'column','children':[a5_0x2a9027(Box,{'children':a5_0x5a412b(Text,{'color':'red','children':['❌\x20',_0x17b92d]})}),_0x17b92d[_0x1a699d(0xea)]('登录')&&a5_0x5a412b(Box,{'marginTop':0x1,'children':[a5_0x2a9027(Text,{'color':'yellow','children':_0x1a699d(0xe8)}),a5_0x2a9027(Text,{'color':_0x1a699d(0xee),'children':'lovrabet\x20auth'}),a5_0x2a9027(Text,{'color':_0x1a699d(0xf0),'children':_0x1a699d(0x101)})]})]})]});};
1
+ (function(_0x433e5a,_0x396f88){const _0x535d93=a5_0x598f,_0x263159=_0x433e5a();while(!![]){try{const _0x22480c=-parseInt(_0x535d93(0x89))/0x1+parseInt(_0x535d93(0xae))/0x2+-parseInt(_0x535d93(0xb7))/0x3+parseInt(_0x535d93(0xb5))/0x4*(-parseInt(_0x535d93(0xb2))/0x5)+parseInt(_0x535d93(0x9b))/0x6*(-parseInt(_0x535d93(0x8e))/0x7)+parseInt(_0x535d93(0xa8))/0x8+parseInt(_0x535d93(0x8c))/0x9*(parseInt(_0x535d93(0xb0))/0xa);if(_0x22480c===_0x396f88)break;else _0x263159['push'](_0x263159['shift']());}catch(_0x64c5b3){_0x263159['push'](_0x263159['shift']());}}}(a5_0x23f0,0x4f26f));import{jsx as a5_0x3e2b47,jsxs as a5_0x383369,Fragment as a5_0x2ef72e}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_0x23f0(){const _0xe9002=['41157aoOlwQ','green','161GRidoZ','使用指定的应用AppCode:\x20','使用配置的应用AppCode:\x20','\x20个数据集','success','\x20个数据集的文档...','white','setLogPath','💡\x20请使用\x20','dim','join','正在生成\x20','env','52458HqfzrU','\x1b[33m!\x20以下数据集代码不存在:\x20','未找到任何数据集','\x1b[0m','length','red','⚠️\x20以下数据集生成失败:','未提供应用AppCode,且配置中也没有默认值','gray',',\x20失败\x20','error','string','*\x20生成的文档文件:','15072xJqPSR','datasetName','.md\x20(','*\x20输出目录:\x20','map','filePath','1016230oHhrlD','log','2440zbZIuK','datasetCode','745eXCMlq','includes','lovrabet\x20auth','4696LDxBUU','文档生成失败:\x20','1366128sYUFKP','yellow','文档生成完成','filter','指定的数据集代码都不存在:\x20','\x1b[90m*\x20从\x20','api-doc','./docs','470213xfkwgn','正在获取数据集列表...','column'];a5_0x23f0=function(){return _0xe9002;};return a5_0x23f0();}import{generateDatasetDocs}from'./api-doc.js';function a5_0x598f(_0x4a72ea,_0xff52a2){_0x4a72ea=_0x4a72ea-0x89;const _0x23f0be=a5_0x23f0();let _0x598faf=_0x23f0be[_0x4a72ea];return _0x598faf;}import{logger}from'../utils/logger.js';export const ApiDocUI=({appCode:_0x567f23,env:_0x43659d,output:_0x2dfcec,extraParams:_0x268d52,datasetCodes:_0x49ec16})=>{const _0x3b840d=a5_0x598f,{exit:_0x439ad3}=useApp(),[_0x31bc21,_0x533a64]=useState(![]),[_0x34bcf8,_0x2530b4]=useState(''),[_0xff1376,_0x4ea8e5]=useState(![]),[_0x201500,_0x3add96]=useState(null),[_0x5f258c,_0x2ddd82]=useState(null),[_0x3ddaaa,_0x3c4a6d]=useState(0x0),_0x225d5f=readConfig(),_0x368428=getConfigAppCode(),_0x4405f4=_0x567f23||_0x368428,_0x1d5a74=typeof _0x225d5f?.[_0x3b840d(0x9a)]===_0x3b840d(0xa6)?_0x225d5f[_0x3b840d(0x9a)]:undefined,_0xfd281d=_0x43659d||_0x1d5a74||'online';initEnv(_0xfd281d);const _0xbcb300=_0x2dfcec||_0x3b840d(0xbe),_0x4170e6=_0x567f23?_0x3b840d(0x8f)+_0x4405f4:_0x3b840d(0x90)+_0x4405f4;useEffect(()=>{_0x533a64(!![]),_0x27af7c();},[]),useEffect(()=>{(_0xff1376||_0x201500)&&_0x439ad3();},[_0xff1376,_0x201500,_0x439ad3]);async function _0x27af7c(){const _0xa2b415=_0x3b840d;if(!_0x4405f4){_0x3add96(_0xa2b415(0xa2));return;}try{logger[_0xa2b415(0x95)](process['cwd']()),_0x2530b4(_0xa2b415(0x8a));const {configArray:_0x217af0}=await fetchModelList(_0x4405f4);_0x3c4a6d(_0x217af0['length']);if(_0x217af0['length']===0x0){_0x3add96(_0xa2b415(0x9d));return;}let _0x19bc7b=_0x217af0;if(_0x49ec16&&_0x49ec16['length']>0x0){_0x19bc7b=_0x217af0[_0xa2b415(0xba)](_0x422b5e=>_0x49ec16[_0xa2b415(0xb3)](_0x422b5e['datasetCode']));const _0xf92b61=_0x19bc7b[_0xa2b415(0xac)](_0x321b20=>_0x321b20[_0xa2b415(0xb1)]),_0x5a1638=_0x49ec16[_0xa2b415(0xba)](_0x10748e=>!_0xf92b61['includes'](_0x10748e));_0x5a1638['length']>0x0&&console[_0xa2b415(0xaf)](_0xa2b415(0x9c)+_0x5a1638[_0xa2b415(0x98)](',\x20')+_0xa2b415(0x9e));if(_0x19bc7b[_0xa2b415(0x9f)]===0x0){_0x3add96(_0xa2b415(0xbb)+_0x49ec16[_0xa2b415(0x98)](',\x20'));return;}console['log'](_0xa2b415(0xbc)+_0x217af0[_0xa2b415(0x9f)]+'\x20个数据集中筛选出\x20'+_0x19bc7b[_0xa2b415(0x9f)]+'\x20个匹配的数据集\x1b[0m');}_0x2530b4(_0xa2b415(0x99)+_0x19bc7b[_0xa2b415(0x9f)]+_0xa2b415(0x93));const _0x3c08c4=await generateDatasetDocs(_0x19bc7b,_0x4405f4,_0xbcb300,(_0x2357fc,_0x1c7f35,_0x58acc5)=>{const _0x40981c=_0xa2b415;_0x2530b4('正在生成\x20'+_0x58acc5+_0x40981c(0xaa)+_0x2357fc+'/'+_0x1c7f35+')');},_0x268d52);_0x2ddd82(_0x3c08c4),_0x4ea8e5(!![]);const _0x4240d0=_0x3c08c4[_0xa2b415(0xba)](_0x2e1eb0=>_0x2e1eb0[_0xa2b415(0x92)])[_0xa2b415(0x9f)],_0x596721=_0x3c08c4['filter'](_0x376735=>!_0x376735['success'])[_0xa2b415(0x9f)];logger['success'](_0xa2b415(0xbd),_0xa2b415(0xb9),undefined,{'totalCount':_0x3c08c4[_0xa2b415(0x9f)],'successCount':_0x4240d0,'failCount':_0x596721,'outputDir':_0xbcb300});}catch(_0x3f848c){const _0x3a4573=_0x3f848c instanceof Error?_0x3f848c['message']:String(_0x3f848c);logger[_0xa2b415(0xa5)](_0xa2b415(0xbd),'文档生成失败:\x20'+_0x3a4573,{'appCode':_0x4405f4,'outputDir':_0xbcb300}),_0x3add96(_0xa2b415(0xb6)+_0x3a4573);}finally{_0x533a64(![]);}}const _0x1124b6=_0x5f258c?.[_0x3b840d(0xba)](_0x41e400=>_0x41e400['success'])[_0x3b840d(0x9f)]||0x0,_0x56efd8=_0x5f258c?.[_0x3b840d(0xba)](_0x48246f=>!_0x48246f['success'])[_0x3b840d(0x9f)]||0x0;return a5_0x383369(Box,{'flexDirection':_0x3b840d(0x8b),'children':[(_0x31bc21||_0xff1376)&&a5_0x383369(Box,{'children':[a5_0x3e2b47(Text,{'color':_0x3b840d(0xa3),'children':'*\x20'}),a5_0x3e2b47(Text,{'color':_0x567f23?_0x3b840d(0x94):_0x3b840d(0x97),'children':_0x4170e6})]}),_0x31bc21&&a5_0x3e2b47(Box,{'children':a5_0x383369(Text,{'children':['🚀\x20',_0x34bcf8,'\x20(环境:\x20',_0xfd281d,')']})}),_0xff1376&&_0x5f258c&&a5_0x383369(Box,{'flexDirection':_0x3b840d(0x8b),'children':[a5_0x3e2b47(Box,{'children':a5_0x383369(Text,{'color':_0x3b840d(0x8d),'children':['√\x20文档生成完成!成功\x20',_0x1124b6,'\x20个',_0x56efd8>0x0&&_0x3b840d(0xa4)+_0x56efd8+'\x20个']})}),a5_0x3e2b47(Box,{'marginTop':0x1,'children':a5_0x383369(Text,{'color':'gray','children':['*\x20共处理\x20',_0x3ddaaa,_0x3b840d(0x91)]})}),a5_0x383369(Box,{'marginTop':0x1,'children':[a5_0x3e2b47(Text,{'color':_0x3b840d(0xa3),'children':_0x3b840d(0xab)}),a5_0x3e2b47(Text,{'color':'cyan','children':_0xbcb300})]}),_0x1124b6>0x0&&a5_0x383369(a5_0x2ef72e,{'children':[a5_0x3e2b47(Box,{'marginTop':0x1,'children':a5_0x3e2b47(Text,{'color':_0x3b840d(0xa3),'children':_0x3b840d(0xa7)})}),_0x5f258c['filter'](_0x43e96d=>_0x43e96d[_0x3b840d(0x92)])[_0x3b840d(0xac)]((_0x3c4db8,_0x45fd2a)=>a5_0x383369(Box,{'marginLeft':0x2,'children':[a5_0x383369(Text,{'color':'cyan','children':['•\x20',_0x3c4db8[_0x3b840d(0xad)]]}),a5_0x383369(Text,{'color':_0x3b840d(0x97),'children':['\x20-\x20',_0x3c4db8['datasetName']]})]},_0x45fd2a))]}),_0x56efd8>0x0&&a5_0x383369(a5_0x2ef72e,{'children':[a5_0x3e2b47(Box,{'marginTop':0x1,'children':a5_0x3e2b47(Text,{'color':'yellow','children':_0x3b840d(0xa1)})}),_0x5f258c[_0x3b840d(0xba)](_0x4fc915=>!_0x4fc915[_0x3b840d(0x92)])[_0x3b840d(0xac)]((_0x4f267a,_0x28637a)=>a5_0x383369(Box,{'marginLeft':0x2,'flexDirection':'column','children':[a5_0x383369(Text,{'color':_0x3b840d(0xa0),'children':['•\x20',_0x4f267a[_0x3b840d(0xa9)],'\x20(',_0x4f267a[_0x3b840d(0xb1)],')']}),_0x4f267a[_0x3b840d(0xa5)]&&a5_0x3e2b47(Box,{'marginLeft':0x2,'children':a5_0x3e2b47(Text,{'color':_0x3b840d(0x97),'children':_0x4f267a[_0x3b840d(0xa5)]})})]},_0x28637a))]})]}),_0x201500&&a5_0x383369(Box,{'flexDirection':_0x3b840d(0x8b),'children':[a5_0x3e2b47(Box,{'children':a5_0x383369(Text,{'color':_0x3b840d(0xa0),'children':['❌\x20',_0x201500]})}),_0x201500['includes']('登录')&&a5_0x383369(Box,{'marginTop':0x1,'children':[a5_0x3e2b47(Text,{'color':_0x3b840d(0xb8),'children':_0x3b840d(0x96)}),a5_0x3e2b47(Text,{'color':'cyan','children':_0x3b840d(0xb4)}),a5_0x3e2b47(Text,{'color':_0x3b840d(0xb8),'children':'\x20重新登录后再试'})]})]})]});};
@@ -1 +1 @@
1
- const a6_0x32bc67=a6_0x285b;(function(_0x3d97e6,_0x59441f){const _0x3b7562=a6_0x285b,_0x1bf69e=_0x3d97e6();while(!![]){try{const _0x4e8fe5=parseInt(_0x3b7562(0xc6))/0x1+parseInt(_0x3b7562(0xcf))/0x2+parseInt(_0x3b7562(0xcd))/0x3+-parseInt(_0x3b7562(0xd9))/0x4*(-parseInt(_0x3b7562(0xb6))/0x5)+parseInt(_0x3b7562(0xc5))/0x6*(parseInt(_0x3b7562(0xd2))/0x7)+-parseInt(_0x3b7562(0xc4))/0x8+-parseInt(_0x3b7562(0xd7))/0x9*(parseInt(_0x3b7562(0xd5))/0xa);if(_0x4e8fe5===_0x59441f)break;else _0x1bf69e['push'](_0x1bf69e['shift']());}catch(_0x47e18e){_0x1bf69e['push'](_0x1bf69e['shift']());}}}(a6_0x14a6,0x6ee73));import{mkdirSync,writeFileSync}from'node:fs';function a6_0x285b(_0x1b2a71,_0x26eecb){_0x1b2a71=_0x1b2a71-0xb4;const _0x14a64a=a6_0x14a6();let _0x285b4e=_0x14a64a[_0x1b2a71];return _0x285b4e;}import a6_0x5a638f from'node:path';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';function a6_0x14a6(){const _0x1990a4=['message','710422rzfnPH','\x20个数据集需要生成文档\x0a','datasetCode','35oqzLTq','join','name','650tbFYxM','markdown','128745WXfemC','stringify','1619924uNbLHX','push','✗\x20失败:\x20','\x0a共有\x20','5ITgTog','utf8','):缺少\x20data.markdown\x20字段','log','获取文档失败\x20(','),HTTP状态码:\x20','status',']\x20正在生成:\x20','data','./docs','length','等待\x203\x20秒...\x0a','/api/node-toolbox/api-doc-generator','string','6773360pthYES','343716uLCtGG','442203dOILjN','响应数据格式错误\x20(','application/json','error','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','api-doc','.md\x20(','2225787CPnQDZ'];a6_0x14a6=function(){return _0x1990a4;};return a6_0x14a6();}export async function fetchDatasetDoc(_0x1834ed){const _0x536bb9=a6_0x285b,{appCode:_0x7bcd85,datasetCode:_0x4e8e8d,datasetId:_0xac3808,extraParams:_0x9c453e}=_0x1834ed,_0x1153a1=getApiDomain(),_0x254e77=_0x1153a1+_0x536bb9(0xc2),_0x5cde68={'appCode':_0x7bcd85,'datasetCode':_0x4e8e8d,'datasetId':_0xac3808,..._0x9c453e||{}},_0x4ef99e=await fetch(_0x254e77,{'method':'POST','headers':{'Content-Type':_0x536bb9(0xc8),'Cookie':getCookie()},'body':JSON[_0x536bb9(0xd8)](_0x5cde68)});if(!_0x4ef99e['ok']){if(_0x4ef99e['status']===0x191)throw new Error(_0x536bb9(0xca));let _0x49c561='';try{_0x49c561=await _0x4ef99e['text']();}catch(_0x5c7cef){}throw new Error(_0x536bb9(0xba)+_0x4e8e8d+_0x536bb9(0xbb)+_0x4ef99e[_0x536bb9(0xbc)]+(_0x49c561?'\x0a'+_0x49c561:''));}const _0x12858e=await _0x4ef99e['json']();if(!_0x12858e[_0x536bb9(0xbe)]||typeof _0x12858e[_0x536bb9(0xbe)]['markdown']!==_0x536bb9(0xc3))throw new Error(_0x536bb9(0xc7)+_0x4e8e8d+_0x536bb9(0xb8));return _0x12858e[_0x536bb9(0xbe)][_0x536bb9(0xd6)];}function delay(_0x4aa7ec){return new Promise(_0x5e5aab=>setTimeout(_0x5e5aab,_0x4aa7ec));}export async function generateDatasetDocs(_0x23ef2b,_0x171bb1,_0x2f670c=a6_0x32bc67(0xbf),_0x18e556,_0x1ba178){const _0x2ce50c=a6_0x32bc67;mkdirSync(_0x2f670c,{'recursive':!![]});const _0x263e9f=[],_0x19bda1=_0x23ef2b['length'];console[_0x2ce50c(0xb9)](_0x2ce50c(0xb5)+_0x19bda1+_0x2ce50c(0xd0));for(let _0x18f912=0x0;_0x18f912<_0x23ef2b[_0x2ce50c(0xc0)];_0x18f912++){const _0x2996bf=_0x23ef2b[_0x18f912],_0x19cbe4=_0x18f912+0x1,_0x172077=_0x2996bf['tableName'];try{console[_0x2ce50c(0xb9)]('['+_0x19cbe4+'/'+_0x19bda1+_0x2ce50c(0xbd)+_0x172077+_0x2ce50c(0xcc)+_0x2996bf[_0x2ce50c(0xd4)]+')');_0x18e556&&_0x18e556(_0x19cbe4,_0x19bda1,_0x172077);const _0x4b0245=await fetchDatasetDoc({'appCode':_0x171bb1,'datasetCode':_0x2996bf[_0x2ce50c(0xd1)],'datasetId':_0x2996bf['id'],'enableAI':![],'extraParams':_0x1ba178}),_0x6df375=a6_0x5a638f[_0x2ce50c(0xd3)](_0x2f670c,_0x172077+'.md');writeFileSync(_0x6df375,_0x4b0245,{'encoding':_0x2ce50c(0xb7)}),console[_0x2ce50c(0xb9)]('✓\x20成功生成:\x20'+_0x172077+'.md'),logger['success']('api-doc','生成文档成功:\x20'+_0x172077,undefined,{'datasetCode':_0x2996bf[_0x2ce50c(0xd1)],'datasetName':_0x2996bf[_0x2ce50c(0xd4)],'filePath':_0x6df375,'progress':_0x19cbe4+'/'+_0x19bda1}),_0x263e9f[_0x2ce50c(0xda)]({'datasetCode':_0x2996bf[_0x2ce50c(0xd1)],'datasetName':_0x2996bf[_0x2ce50c(0xd4)],'filePath':_0x6df375,'success':!![]}),_0x19cbe4<_0x19bda1&&await delay(0x1388);}catch(_0x5cc887){const _0x19064c=_0x5cc887 instanceof Error?_0x5cc887[_0x2ce50c(0xce)]:String(_0x5cc887);console[_0x2ce50c(0xb9)](_0x2ce50c(0xb4)+_0x172077+'.md\x20-\x20'+_0x19064c+'\x0a'),logger[_0x2ce50c(0xc9)](_0x2ce50c(0xcb),'生成文档失败:\x20'+_0x2996bf[_0x2ce50c(0xd1)],{'datasetCode':_0x2996bf[_0x2ce50c(0xd1)],'datasetName':_0x2996bf[_0x2ce50c(0xd4)],'error':_0x19064c,'progress':_0x19cbe4+'/'+_0x19bda1}),_0x263e9f[_0x2ce50c(0xda)]({'datasetCode':_0x2996bf[_0x2ce50c(0xd1)],'datasetName':_0x2996bf[_0x2ce50c(0xd4)],'filePath':'','success':![],'error':_0x19064c}),_0x19cbe4<_0x19bda1&&(console[_0x2ce50c(0xb9)](_0x2ce50c(0xc1)),await delay(0xbb8));}}return _0x263e9f;}
1
+ function a6_0x268f(_0x4d8137,_0x47e65a){_0x4d8137=_0x4d8137-0xfc;const _0x302865=a6_0x3028();let _0x268f41=_0x302865[_0x4d8137];return _0x268f41;}const a6_0x150ec2=a6_0x268f;function a6_0x3028(){const _0x5a8df2=['130738aiStSS','2724124JiVEtC','text','✓\x20成功生成:\x20','datasetCode','生成文档失败:\x20','31495tYuzix','application/json','stringify','name','.md\x20(','生成文档成功:\x20',']\x20正在生成:\x20','api-doc','status','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','3ahTdrR','✗\x20失败:\x20','10IWGrNd','json','./docs','length','log','126DzukqI','.md\x20-\x20','/api/node-toolbox/api-doc-generator','),HTTP状态码:\x20','markdown','tableName','229256VBwVxb','182havPzT','1480380jksQGq','utf8','success','4376754kJVAHt','message','.md','push','获取文档失败\x20(','data','join','):缺少\x20data.markdown\x20字段','等待\x203\x20秒...\x0a','20673455TyRzfV'];a6_0x3028=function(){return _0x5a8df2;};return a6_0x3028();}(function(_0x40c76b,_0x25a27b){const _0x54d40b=a6_0x268f,_0x231bea=_0x40c76b();while(!![]){try{const _0x4c2a48=-parseInt(_0x54d40b(0x108))/0x1*(parseInt(_0x54d40b(0x124))/0x2)+-parseInt(_0x54d40b(0x117))/0x3+-parseInt(_0x54d40b(0x125))/0x4+parseInt(_0x54d40b(0xfe))/0x5*(parseInt(_0x54d40b(0x10f))/0x6)+parseInt(_0x54d40b(0x116))/0x7*(-parseInt(_0x54d40b(0x115))/0x8)+parseInt(_0x54d40b(0x11a))/0x9+-parseInt(_0x54d40b(0x10a))/0xa*(-parseInt(_0x54d40b(0x123))/0xb);if(_0x4c2a48===_0x25a27b)break;else _0x231bea['push'](_0x231bea['shift']());}catch(_0x575a63){_0x231bea['push'](_0x231bea['shift']());}}}(a6_0x3028,0x5d566));import{mkdirSync,writeFileSync}from'node:fs';import a6_0x150516 from'node:path';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';export async function fetchDatasetDoc(_0x525558){const _0x2af8a5=a6_0x268f,{appCode:_0xf1034d,datasetCode:_0x28aa5d,datasetId:_0x238332,extraParams:_0xe9db7f}=_0x525558,_0xaddda0=getApiDomain(),_0x589993=_0xaddda0+_0x2af8a5(0x111),_0x10b9cf={'appCode':_0xf1034d,'datasetCode':_0x28aa5d,'datasetId':_0x238332,..._0xe9db7f||{}},_0x5bb68a=await fetch(_0x589993,{'method':'POST','headers':{'Content-Type':_0x2af8a5(0xff),'Cookie':getCookie()},'body':JSON[_0x2af8a5(0x100)](_0x10b9cf)});if(!_0x5bb68a['ok']){if(_0x5bb68a[_0x2af8a5(0x106)]===0x191)throw new Error(_0x2af8a5(0x107));let _0x108663='';try{_0x108663=await _0x5bb68a[_0x2af8a5(0x126)]();}catch(_0x424b3a){}throw new Error(_0x2af8a5(0x11e)+_0x28aa5d+_0x2af8a5(0x112)+_0x5bb68a[_0x2af8a5(0x106)]+(_0x108663?'\x0a'+_0x108663:''));}const _0x3d812f=await _0x5bb68a[_0x2af8a5(0x10b)]();if(!_0x3d812f[_0x2af8a5(0x11f)]||typeof _0x3d812f[_0x2af8a5(0x11f)]['markdown']!=='string')throw new Error('响应数据格式错误\x20('+_0x28aa5d+_0x2af8a5(0x121));return _0x3d812f[_0x2af8a5(0x11f)][_0x2af8a5(0x113)];}function delay(_0x4cf927){return new Promise(_0x5b6391=>setTimeout(_0x5b6391,_0x4cf927));}export async function generateDatasetDocs(_0x331cd4,_0x101f8b,_0x530cc3=a6_0x150ec2(0x10c),_0x4a7279,_0x2e1163){const _0x273afa=a6_0x150ec2;mkdirSync(_0x530cc3,{'recursive':!![]});const _0x11e904=[],_0x2e7954=_0x331cd4[_0x273afa(0x10d)];console[_0x273afa(0x10e)]('\x0a共有\x20'+_0x2e7954+'\x20个数据集需要生成文档\x0a');for(let _0x270e30=0x0;_0x270e30<_0x331cd4[_0x273afa(0x10d)];_0x270e30++){const _0x229b18=_0x331cd4[_0x270e30],_0x63b6a4=_0x270e30+0x1,_0xb56252=_0x229b18[_0x273afa(0x114)];try{console['log']('['+_0x63b6a4+'/'+_0x2e7954+_0x273afa(0x104)+_0xb56252+_0x273afa(0x102)+_0x229b18[_0x273afa(0x101)]+')');_0x4a7279&&_0x4a7279(_0x63b6a4,_0x2e7954,_0xb56252);const _0x873560=await fetchDatasetDoc({'appCode':_0x101f8b,'datasetCode':_0x229b18[_0x273afa(0xfc)],'datasetId':_0x229b18['id'],'enableAI':![],'extraParams':_0x2e1163}),_0x279d20=a6_0x150516[_0x273afa(0x120)](_0x530cc3,_0xb56252+_0x273afa(0x11c));writeFileSync(_0x279d20,_0x873560,{'encoding':_0x273afa(0x118)}),console['log'](_0x273afa(0x127)+_0xb56252+_0x273afa(0x11c)),logger[_0x273afa(0x119)](_0x273afa(0x105),_0x273afa(0x103)+_0xb56252,undefined,{'datasetCode':_0x229b18[_0x273afa(0xfc)],'datasetName':_0x229b18[_0x273afa(0x101)],'filePath':_0x279d20,'progress':_0x63b6a4+'/'+_0x2e7954}),_0x11e904[_0x273afa(0x11d)]({'datasetCode':_0x229b18[_0x273afa(0xfc)],'datasetName':_0x229b18[_0x273afa(0x101)],'filePath':_0x279d20,'success':!![]}),_0x63b6a4<_0x2e7954&&await delay(0x1388);}catch(_0x34bf81){const _0x58f370=_0x34bf81 instanceof Error?_0x34bf81[_0x273afa(0x11b)]:String(_0x34bf81);console[_0x273afa(0x10e)](_0x273afa(0x109)+_0xb56252+_0x273afa(0x110)+_0x58f370+'\x0a'),logger['error'](_0x273afa(0x105),_0x273afa(0xfd)+_0x229b18[_0x273afa(0xfc)],{'datasetCode':_0x229b18[_0x273afa(0xfc)],'datasetName':_0x229b18[_0x273afa(0x101)],'error':_0x58f370,'progress':_0x63b6a4+'/'+_0x2e7954}),_0x11e904['push']({'datasetCode':_0x229b18['datasetCode'],'datasetName':_0x229b18[_0x273afa(0x101)],'filePath':'','success':![],'error':_0x58f370}),_0x63b6a4<_0x2e7954&&(console[_0x273afa(0x10e)](_0x273afa(0x122)),await delay(0xbb8));}}return _0x11e904;}
@@ -1 +1 @@
1
- (function(_0x3ecd61,_0x2a46c8){const _0x3fb52d=a7_0x488f,_0x24d0df=_0x3ecd61();while(!![]){try{const _0x4c8c73=-parseInt(_0x3fb52d(0xad))/0x1+parseInt(_0x3fb52d(0xaf))/0x2*(-parseInt(_0x3fb52d(0x85))/0x3)+parseInt(_0x3fb52d(0x96))/0x4*(parseInt(_0x3fb52d(0x90))/0x5)+-parseInt(_0x3fb52d(0x82))/0x6+parseInt(_0x3fb52d(0x9f))/0x7+parseInt(_0x3fb52d(0xa9))/0x8+parseInt(_0x3fb52d(0x99))/0x9;if(_0x4c8c73===_0x2a46c8)break;else _0x24d0df['push'](_0x24d0df['shift']());}catch(_0x610525){_0x24d0df['push'](_0x24d0df['shift']());}}}(a7_0x7006,0x778af));import{jsx as a7_0x36d74d,jsxs as a7_0x53d548}from'react/jsx-runtime';import{useEffect,useState}from'react';function a7_0x7006(){const _0x453a52=['duplicateCount','拉取\x20API\x20配置失败:\x20','split','join','565103FdMzrb','使用指定的应用AppCode:\x20','client','-api','modelCount','setLogPath','red','green','-client','*\x20已生成文件:','1775928cAlLGK','\x20from\x20\x27@/','\x20重新登录后再试','\x20个数据集,生成','867145uPMpVC','!\x20原始数据集\x20','19484pFyzlD','dim','datasetCount','env','lovrabet\x20auth','api','string','\x20个模型)','💡\x20请使用\x20','column','{\x20lovrabetClient\x20}','1490430IpgFhb','online','./src/api/','183OVeLnR','.ts','cwd','yellow','gray','includes','import\x20','-\x20模型配置文件\x20(','\x20个模型','slice','\x20个,过滤重复','95FmguUW','replace','endsWith','length','api-pull','🚀\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','116652inZeoo','cyan','message','12083778lkgXRr','white'];a7_0x7006=function(){return _0x453a52;};return a7_0x7006();}import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';import{initEnv}from'../constant/env.js';import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';import{fetchModelList}from'./fetch-model-list.js';function a7_0x488f(_0x525d86,_0xa25457){_0x525d86=_0x525d86-0x7f;const _0x7006d6=a7_0x7006();let _0x488fac=_0x7006d6[_0x525d86];return _0x488fac;}export const ApiPullUI=({appCode:_0x4ac886,env:_0x585d60,output:_0x3f7f21})=>{const _0x272d25=a7_0x488f,{exit:_0x105476}=useApp(),[_0x5d793e,_0x50007a]=useState(![]),[_0x3e5b13,_0x1b776e]=useState(![]),[_0x1d4ac1,_0x366d3d]=useState(null),[_0x571ffd,_0x1ea97f]=useState(null),_0x4f3a4c=readConfig(),_0x5a240f=getConfigAppCode(),_0x12799b=_0x4ac886||_0x5a240f,_0x255b34=typeof _0x4f3a4c?.['env']===_0x272d25(0xb5)?_0x4f3a4c[_0x272d25(0xb2)]:undefined,_0x3ae713=_0x585d60||_0x255b34||_0x272d25(0x83);initEnv(_0x3ae713);const _0x5a3306=_0x3f7f21||_0x272d25(0x84),_0x308a56=_0x4ac886&&_0x4ac886[_0x272d25(0x8a)]('-')?_0x4ac886[_0x272d25(0x9d)]('-')[_0x272d25(0x8e)](0x1)[_0x272d25(0x9e)]('-'):'',_0x4f4fa6=_0x4ac886?_0x272d25(0xa0)+_0x12799b:'使用配置的应用AppCode:\x20'+_0x12799b,_0x1db253=_0x308a56?_0x308a56+_0x272d25(0xa2):_0x272d25(0xb4),_0x4641b7=_0x308a56?_0x308a56+_0x272d25(0xa7):'client';useEffect(()=>{_0x50007a(!![]),_0x4e612c();},[]),useEffect(()=>{(_0x3e5b13||_0x1d4ac1)&&_0x105476();},[_0x3e5b13,_0x1d4ac1,_0x105476]);async function _0x4e612c(){const _0x24dc1a=_0x272d25;if(!_0x12799b){_0x366d3d('未提供应用AppCode,且配置中也没有默认值');return;}try{logger[_0x24dc1a(0xa4)](process[_0x24dc1a(0x87)]());const {configArray:_0x188b12}=await fetchModelList(_0x12799b),_0x5d9888=_0x188b12[_0x24dc1a(0x93)],_0x2fc303=!_0x4ac886,_0x44ed5e=await generateApiFile(_0x188b12,_0x308a56,_0x12799b,_0x2fc303,_0x3ae713,_0x5a3306),_0xd1e607=_0x5a3306[_0x24dc1a(0x92)]('/')?_0x5a3306:_0x5a3306+'/';_0x1ea97f({'api':''+_0xd1e607+_0x1db253+_0x24dc1a(0x86),'client':''+_0xd1e607+_0x4641b7+_0x24dc1a(0x86),'modelCount':_0x44ed5e['modelCount'],'datasetCount':_0x5d9888,'originalCount':_0x5d9888,'duplicateCount':0x0}),_0x1b776e(!![]);}catch(_0x36bcd1){const _0x3b3432=_0x36bcd1 instanceof Error?_0x36bcd1[_0x24dc1a(0x98)]:String(_0x36bcd1);logger['error'](_0x24dc1a(0x94),_0x24dc1a(0x9c)+_0x3b3432,{'appCode':_0x12799b,'error':_0x3b3432}),_0x366d3d('拉取\x20API\x20配置失败:\x20'+_0x3b3432);}finally{_0x50007a(![]);}}return a7_0x53d548(Box,{'flexDirection':_0x272d25(0x80),'children':[(_0x5d793e||_0x3e5b13)&&a7_0x53d548(Box,{'children':[a7_0x36d74d(Text,{'color':_0x272d25(0x89),'children':'*\x20'}),a7_0x36d74d(Text,{'color':_0x4ac886?_0x272d25(0x9a):'dim','children':_0x4f4fa6})]}),_0x5d793e&&a7_0x36d74d(Box,{'children':a7_0x53d548(Text,{'children':[_0x272d25(0x95),_0x3ae713,')']})}),_0x3e5b13&&_0x571ffd&&a7_0x53d548(Box,{'flexDirection':_0x272d25(0x80),'children':[a7_0x36d74d(Box,{'children':a7_0x53d548(Text,{'color':_0x272d25(0xa6),'children':['√\x20成功拉取\x20',_0x571ffd[_0x272d25(0xb1)],_0x272d25(0xac),'\x20',_0x571ffd[_0x272d25(0xa3)],_0x272d25(0x8d)]})}),_0x571ffd[_0x272d25(0x9b)]>0x0&&a7_0x36d74d(Box,{'marginTop':0x1,'children':a7_0x53d548(Text,{'color':_0x272d25(0x88),'children':[_0x272d25(0xae),_0x571ffd['originalCount'],_0x272d25(0x8f),'\x20',_0x571ffd[_0x272d25(0x9b)],'\x20个']})}),a7_0x36d74d(Box,{'marginTop':0x1,'children':a7_0x36d74d(Text,{'color':'gray','children':_0x272d25(0xa8)})}),a7_0x53d548(Box,{'marginLeft':0x2,'children':[a7_0x53d548(Text,{'color':_0x272d25(0x97),'children':['•\x20',_0x571ffd[_0x272d25(0xb4)]]}),a7_0x53d548(Text,{'color':_0x272d25(0xb0),'children':['\x20',_0x272d25(0x8c),_0x571ffd[_0x272d25(0xa3)],_0x272d25(0xb6)]})]}),a7_0x53d548(Box,{'marginLeft':0x2,'children':[a7_0x53d548(Text,{'color':_0x272d25(0x97),'children':['•\x20',_0x571ffd['client']]}),a7_0x36d74d(Text,{'color':'dim','children':'\x20-\x20客户端实例文件'})]}),a7_0x36d74d(Box,{'marginTop':0x1,'children':a7_0x36d74d(Text,{'color':_0x272d25(0x89),'children':'*\x20导入方式:'})}),a7_0x36d74d(Box,{'marginLeft':0x2,'children':a7_0x53d548(Text,{'color':_0x272d25(0x88),'children':[_0x272d25(0x8b),_0x272d25(0x81),_0x272d25(0xaa),_0x571ffd[_0x272d25(0xa1)][_0x272d25(0x91)](/^\.\//,'')[_0x272d25(0x91)](_0x272d25(0x86),''),'\x27']})})]}),_0x1d4ac1&&a7_0x53d548(Box,{'flexDirection':_0x272d25(0x80),'children':[a7_0x36d74d(Box,{'children':a7_0x53d548(Text,{'color':_0x272d25(0xa5),'children':['❌\x20',_0x1d4ac1]})}),_0x1d4ac1[_0x272d25(0x8a)]('登录')&&a7_0x53d548(Box,{'marginTop':0x1,'children':[a7_0x36d74d(Text,{'color':'yellow','children':_0x272d25(0x7f)}),a7_0x36d74d(Text,{'color':_0x272d25(0x97),'children':_0x272d25(0xb3)}),a7_0x36d74d(Text,{'color':_0x272d25(0x88),'children':_0x272d25(0xab)})]})]})]});};
1
+ (function(_0x373339,_0x1b74a8){const _0x37f40a=a7_0x28dd,_0x4f2282=_0x373339();while(!![]){try{const _0x42bc4b=parseInt(_0x37f40a(0x16f))/0x1*(-parseInt(_0x37f40a(0x179))/0x2)+parseInt(_0x37f40a(0x17c))/0x3*(-parseInt(_0x37f40a(0x17b))/0x4)+parseInt(_0x37f40a(0x181))/0x5+-parseInt(_0x37f40a(0x175))/0x6*(parseInt(_0x37f40a(0x173))/0x7)+parseInt(_0x37f40a(0x160))/0x8*(-parseInt(_0x37f40a(0x15f))/0x9)+parseInt(_0x37f40a(0x165))/0xa+-parseInt(_0x37f40a(0x167))/0xb*(-parseInt(_0x37f40a(0x180))/0xc);if(_0x42bc4b===_0x1b74a8)break;else _0x4f2282['push'](_0x4f2282['shift']());}catch(_0x402b6b){_0x4f2282['push'](_0x4f2282['shift']());}}}(a7_0x2d93,0x5ff52));function a7_0x2d93(){const _0x18eeb4=['cwd','string','endsWith','\x20-\x20客户端实例文件','modelCount','message','9mVvJUR','575880nvjYIV','\x20个模型','💡\x20请使用\x20','split','online','135700eGrdTk','white','1793KVBIPm','拉取\x20API\x20配置失败:\x20','使用指定的应用AppCode:\x20','-\x20模型配置文件\x20(','import\x20','使用配置的应用AppCode:\x20','未提供应用AppCode,且配置中也没有默认值','api','783337wgDgOg','!\x20原始数据集\x20','-client','replace','441sLSHuG','client','54486NbEtCl','\x20个数据集,生成','yellow','{\x20lovrabetClient\x20}','2sxYyVw','\x20重新登录后再试','1552wccheb','2010hWudPX','error','duplicateCount','\x20from\x20\x27@/','105348ycINWc','3179400brYDgN','.ts','cyan','datasetCount','red','dim','lovrabet\x20auth','setLogPath','originalCount','\x20个模型)','column','includes','env'];a7_0x2d93=function(){return _0x18eeb4;};return a7_0x2d93();}import{jsx as a7_0x514a8a,jsxs as a7_0x1a3c62}from'react/jsx-runtime';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';function a7_0x28dd(_0x50114b,_0x290799){_0x50114b=_0x50114b-0x157;const _0x2d93fd=a7_0x2d93();let _0x28dd50=_0x2d93fd[_0x50114b];return _0x28dd50;}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:_0x20630f,env:_0x4159d7,output:_0x2f9eb7})=>{const _0x329b46=a7_0x28dd,{exit:_0x183eeb}=useApp(),[_0x14124b,_0x53c81a]=useState(![]),[_0x526afa,_0x8470a7]=useState(![]),[_0x4fde1b,_0x103835]=useState(null),[_0x4ec542,_0x48f2c4]=useState(null),_0x198f8c=readConfig(),_0x5de9da=getConfigAppCode(),_0xdf5eb4=_0x20630f||_0x5de9da,_0x52c2b6=typeof _0x198f8c?.[_0x329b46(0x158)]===_0x329b46(0x15a)?_0x198f8c['env']:undefined,_0x196148=_0x4159d7||_0x52c2b6||_0x329b46(0x164);initEnv(_0x196148);const _0x3dd42f=_0x2f9eb7||'./src/api/',_0x35b710=_0x20630f&&_0x20630f[_0x329b46(0x157)]('-')?_0x20630f[_0x329b46(0x163)]('-')['slice'](0x1)['join']('-'):'',_0x54ce14=_0x20630f?_0x329b46(0x169)+_0xdf5eb4:_0x329b46(0x16c)+_0xdf5eb4,_0x29557f=_0x35b710?_0x35b710+'-api':'api',_0x4fb7af=_0x35b710?_0x35b710+_0x329b46(0x171):_0x329b46(0x174);useEffect(()=>{_0x53c81a(!![]),_0x551d77();},[]),useEffect(()=>{(_0x526afa||_0x4fde1b)&&_0x183eeb();},[_0x526afa,_0x4fde1b,_0x183eeb]);async function _0x551d77(){const _0xf586d2=_0x329b46;if(!_0xdf5eb4){_0x103835(_0xf586d2(0x16d));return;}try{logger[_0xf586d2(0x188)](process[_0xf586d2(0x159)]());const {configArray:_0x2bf7f3}=await fetchModelList(_0xdf5eb4),_0x8fa2bf=_0x2bf7f3['length'],_0x19685a=!_0x20630f,_0x2b55f6=await generateApiFile(_0x2bf7f3,_0x35b710,_0xdf5eb4,_0x19685a,_0x196148,_0x3dd42f),_0x2f6073=_0x3dd42f[_0xf586d2(0x15b)]('/')?_0x3dd42f:_0x3dd42f+'/';_0x48f2c4({'api':''+_0x2f6073+_0x29557f+'.ts','client':''+_0x2f6073+_0x4fb7af+'.ts','modelCount':_0x2b55f6[_0xf586d2(0x15d)],'datasetCount':_0x8fa2bf,'originalCount':_0x8fa2bf,'duplicateCount':0x0}),_0x8470a7(!![]);}catch(_0x3f54b2){const _0x1208c1=_0x3f54b2 instanceof Error?_0x3f54b2[_0xf586d2(0x15e)]:String(_0x3f54b2);logger[_0xf586d2(0x17d)]('api-pull',_0xf586d2(0x168)+_0x1208c1,{'appCode':_0xdf5eb4,'error':_0x1208c1}),_0x103835(_0xf586d2(0x168)+_0x1208c1);}finally{_0x53c81a(![]);}}return a7_0x1a3c62(Box,{'flexDirection':'column','children':[(_0x14124b||_0x526afa)&&a7_0x1a3c62(Box,{'children':[a7_0x514a8a(Text,{'color':'gray','children':'*\x20'}),a7_0x514a8a(Text,{'color':_0x20630f?_0x329b46(0x166):'dim','children':_0x54ce14})]}),_0x14124b&&a7_0x514a8a(Box,{'children':a7_0x1a3c62(Text,{'children':['🚀\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20',_0x196148,')']})}),_0x526afa&&_0x4ec542&&a7_0x1a3c62(Box,{'flexDirection':_0x329b46(0x18b),'children':[a7_0x514a8a(Box,{'children':a7_0x1a3c62(Text,{'color':'green','children':['√\x20成功拉取\x20',_0x4ec542[_0x329b46(0x184)],_0x329b46(0x176),'\x20',_0x4ec542[_0x329b46(0x15d)],_0x329b46(0x161)]})}),_0x4ec542[_0x329b46(0x17e)]>0x0&&a7_0x514a8a(Box,{'marginTop':0x1,'children':a7_0x1a3c62(Text,{'color':_0x329b46(0x177),'children':[_0x329b46(0x170),_0x4ec542[_0x329b46(0x189)],'\x20个,过滤重复','\x20',_0x4ec542[_0x329b46(0x17e)],'\x20个']})}),a7_0x514a8a(Box,{'marginTop':0x1,'children':a7_0x514a8a(Text,{'color':'gray','children':'*\x20已生成文件:'})}),a7_0x1a3c62(Box,{'marginLeft':0x2,'children':[a7_0x1a3c62(Text,{'color':_0x329b46(0x183),'children':['•\x20',_0x4ec542[_0x329b46(0x16e)]]}),a7_0x1a3c62(Text,{'color':_0x329b46(0x186),'children':['\x20',_0x329b46(0x16a),_0x4ec542[_0x329b46(0x15d)],_0x329b46(0x18a)]})]}),a7_0x1a3c62(Box,{'marginLeft':0x2,'children':[a7_0x1a3c62(Text,{'color':'cyan','children':['•\x20',_0x4ec542['client']]}),a7_0x514a8a(Text,{'color':_0x329b46(0x186),'children':_0x329b46(0x15c)})]}),a7_0x514a8a(Box,{'marginTop':0x1,'children':a7_0x514a8a(Text,{'color':'gray','children':'*\x20导入方式:'})}),a7_0x514a8a(Box,{'marginLeft':0x2,'children':a7_0x1a3c62(Text,{'color':_0x329b46(0x177),'children':[_0x329b46(0x16b),_0x329b46(0x178),_0x329b46(0x17f),_0x4ec542['client']['replace'](/^\.\//,'')[_0x329b46(0x172)](_0x329b46(0x182),''),'\x27']})})]}),_0x4fde1b&&a7_0x1a3c62(Box,{'flexDirection':_0x329b46(0x18b),'children':[a7_0x514a8a(Box,{'children':a7_0x1a3c62(Text,{'color':_0x329b46(0x185),'children':['❌\x20',_0x4fde1b]})}),_0x4fde1b[_0x329b46(0x157)]('登录')&&a7_0x1a3c62(Box,{'marginTop':0x1,'children':[a7_0x514a8a(Text,{'color':_0x329b46(0x177),'children':_0x329b46(0x162)}),a7_0x514a8a(Text,{'color':_0x329b46(0x183),'children':_0x329b46(0x187)}),a7_0x514a8a(Text,{'color':_0x329b46(0x177),'children':_0x329b46(0x17a)})]})]})]});};
@@ -1 +1 @@
1
- (function(_0x2190f9,_0x2151ee){const _0x10b941=a8_0x2e6b,_0x1c1419=_0x2190f9();while(!![]){try{const _0x5a5b96=-parseInt(_0x10b941(0xea))/0x1*(-parseInt(_0x10b941(0xd6))/0x2)+parseInt(_0x10b941(0xcf))/0x3*(parseInt(_0x10b941(0xd4))/0x4)+-parseInt(_0x10b941(0xd1))/0x5*(parseInt(_0x10b941(0xe1))/0x6)+-parseInt(_0x10b941(0xe4))/0x7+-parseInt(_0x10b941(0xdb))/0x8+-parseInt(_0x10b941(0xe5))/0x9*(-parseInt(_0x10b941(0xd5))/0xa)+parseInt(_0x10b941(0xdc))/0xb*(parseInt(_0x10b941(0xec))/0xc);if(_0x5a5b96===_0x2151ee)break;else _0x1c1419['push'](_0x1c1419['shift']());}catch(_0x1d75d6){_0x1c1419['push'](_0x1c1419['shift']());}}}(a8_0xf7fc,0x7afa7));function a8_0x2e6b(_0x32eee6,_0x154a1c){_0x32eee6=_0x32eee6-0xcf;const _0xf7fc50=a8_0xf7fc();let _0x2e6b77=_0xf7fc50[_0x32eee6];return _0x2e6b77;}import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';function a8_0xf7fc(){const _0x32b41a=['7790296gqTZVH','11BobsAi','401','&otype=array','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','message','6tiPWBX','/api/node-toolbox/dataset/model-list?appcode=','未知错误','6984607cxGQaH','675isaRrO','errorCode','获取数据集失败,HTTP状态码:\x20','data','errorMessage','392BjDPMC','errorMsg','18045204mCpOCD','includes','error','info','29379oGpBDn','正在从服务器拉取模型列表...\x20(环境:\x20','2595170soNsYU','json','status','340wqyEVE','8990bIbuJI','3014WCWDiO','UNAUTHORIZED','configArray','fetch-model-list','success'];a8_0xf7fc=function(){return _0x32b41a;};return a8_0xf7fc();}import{getEnv}from'../constant/env.js';export async function fetchModelList(_0x191e96){const _0x1da5d6=a8_0x2e6b,_0x27d7a8=getEnv(),_0x13ad92=getApiDomain()+_0x1da5d6(0xe2)+_0x191e96+_0x1da5d6(0xde);logger[_0x1da5d6(0xef)](_0x1da5d6(0xd9),_0x1da5d6(0xd0)+_0x27d7a8+')',{'apiUrl':_0x13ad92});const _0x51106b=await fetch(_0x13ad92,{'headers':{'Cookie':getCookie()}});if(!_0x51106b['ok']){if(_0x51106b[_0x1da5d6(0xd3)]===0x191)throw new Error(_0x1da5d6(0xdf));throw new Error(_0x1da5d6(0xe7)+_0x51106b[_0x1da5d6(0xd3)]);}const _0x17da7=await _0x51106b[_0x1da5d6(0xd2)]();if(!_0x17da7[_0x1da5d6(0xda)]){const _0x3c65bd=_0x17da7[_0x1da5d6(0xeb)]||_0x17da7[_0x1da5d6(0xe0)]||_0x17da7[_0x1da5d6(0xe8)]?.['message']||_0x17da7[_0x1da5d6(0xe9)]||_0x17da7[_0x1da5d6(0xee)]||_0x1da5d6(0xe3);if(_0x3c65bd[_0x1da5d6(0xed)](_0x1da5d6(0xdd))||_0x3c65bd[_0x1da5d6(0xed)]('Unauthorized')||_0x3c65bd[_0x1da5d6(0xed)]('登录')||_0x3c65bd['includes']('认证')||_0x17da7[_0x1da5d6(0xe6)]===_0x1da5d6(0xd7)||_0x17da7['code']===0x191||_0x17da7['code']==='401')throw new Error(_0x1da5d6(0xdf));throw new Error('获取数据集失败:\x20'+_0x3c65bd);}return{'configArray':_0x17da7[_0x1da5d6(0xe8)][_0x1da5d6(0xd8)],'count':_0x17da7[_0x1da5d6(0xe8)]['count']};}
1
+ (function(_0x295061,_0x4193aa){const _0x1914b3=a8_0x5935,_0x5193cc=_0x295061();while(!![]){try{const _0x53964d=parseInt(_0x1914b3(0x1c9))/0x1*(-parseInt(_0x1914b3(0x1cc))/0x2)+-parseInt(_0x1914b3(0x1d8))/0x3*(parseInt(_0x1914b3(0x1e5))/0x4)+parseInt(_0x1914b3(0x1c5))/0x5*(parseInt(_0x1914b3(0x1cb))/0x6)+parseInt(_0x1914b3(0x1d5))/0x7+parseInt(_0x1914b3(0x1d2))/0x8+parseInt(_0x1914b3(0x1d1))/0x9*(parseInt(_0x1914b3(0x1c6))/0xa)+parseInt(_0x1914b3(0x1ce))/0xb*(-parseInt(_0x1914b3(0x1cf))/0xc);if(_0x53964d===_0x4193aa)break;else _0x5193cc['push'](_0x5193cc['shift']());}catch(_0x396ef0){_0x5193cc['push'](_0x5193cc['shift']());}}}(a8_0x2f32,0xd662c));function a8_0x2f32(){const _0x187453=['errorCode','&otype=array','includes','8884tRKbFX','正在从服务器拉取模型列表...\x20(环境:\x20','info','获取数据集失败:\x20','344475lLAyXs','620WFVtCQ','UNAUTHORIZED','errorMessage','249591GNmsxb','Unauthorized','54yzQmSX','10AMgEky','fetch-model-list','11WEurAq','10406532vwKjCD','data','195174RTqHLh','3415312nWQcqH','status','errorMsg','10602340mIVckL','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','error','1233lymmgm','configArray','message','count','获取数据集失败,HTTP状态码:\x20','401','未知错误','code','success','json'];a8_0x2f32=function(){return _0x187453;};return a8_0x2f32();}import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';function a8_0x5935(_0x53138c,_0xf75b94){_0x53138c=_0x53138c-0x1c2;const _0x2f3277=a8_0x2f32();let _0x593514=_0x2f3277[_0x53138c];return _0x593514;}import{getEnv}from'../constant/env.js';export async function fetchModelList(_0x12c6bd){const _0x146a04=a8_0x5935,_0x11775b=getEnv(),_0xfea9e5=getApiDomain()+'/api/node-toolbox/dataset/model-list?appcode='+_0x12c6bd+_0x146a04(0x1e3);logger[_0x146a04(0x1c3)](_0x146a04(0x1cd),_0x146a04(0x1c2)+_0x11775b+')',{'apiUrl':_0xfea9e5});const _0x34c5b7=await fetch(_0xfea9e5,{'headers':{'Cookie':getCookie()}});if(!_0x34c5b7['ok']){if(_0x34c5b7[_0x146a04(0x1d3)]===0x191)throw new Error(_0x146a04(0x1d6));throw new Error(_0x146a04(0x1dc)+_0x34c5b7['status']);}const _0x3fc51e=await _0x34c5b7[_0x146a04(0x1e1)]();if(!_0x3fc51e[_0x146a04(0x1e0)]){const _0x35d4d3=_0x3fc51e[_0x146a04(0x1d4)]||_0x3fc51e[_0x146a04(0x1da)]||_0x3fc51e['data']?.[_0x146a04(0x1da)]||_0x3fc51e[_0x146a04(0x1c8)]||_0x3fc51e[_0x146a04(0x1d7)]||_0x146a04(0x1de);if(_0x35d4d3['includes'](_0x146a04(0x1dd))||_0x35d4d3[_0x146a04(0x1e4)](_0x146a04(0x1ca))||_0x35d4d3['includes']('登录')||_0x35d4d3[_0x146a04(0x1e4)]('认证')||_0x3fc51e[_0x146a04(0x1e2)]===_0x146a04(0x1c7)||_0x3fc51e['code']===0x191||_0x3fc51e[_0x146a04(0x1df)]===_0x146a04(0x1dd))throw new Error(_0x146a04(0x1d6));throw new Error(_0x146a04(0x1c4)+_0x35d4d3);}return{'configArray':_0x3fc51e['data'][_0x146a04(0x1d9)],'count':_0x3fc51e[_0x146a04(0x1d0)][_0x146a04(0x1db)]};}
@@ -1 +1 @@
1
- (function(_0x486626,_0x2ca3d2){const _0x2232c0=a9_0x4603,_0x2fdde2=_0x486626();while(!![]){try{const _0x23204d=-parseInt(_0x2232c0(0x143))/0x1*(parseInt(_0x2232c0(0x154))/0x2)+parseInt(_0x2232c0(0x146))/0x3*(parseInt(_0x2232c0(0x165))/0x4)+parseInt(_0x2232c0(0x153))/0x5+parseInt(_0x2232c0(0x141))/0x6*(parseInt(_0x2232c0(0x161))/0x7)+-parseInt(_0x2232c0(0x163))/0x8*(-parseInt(_0x2232c0(0x152))/0x9)+-parseInt(_0x2232c0(0x140))/0xa+parseInt(_0x2232c0(0x14e))/0xb*(-parseInt(_0x2232c0(0x148))/0xc);if(_0x23204d===_0x2ca3d2)break;else _0x2fdde2['push'](_0x2fdde2['shift']());}catch(_0x5cdec8){_0x2fdde2['push'](_0x2fdde2['shift']());}}}(a9_0x5039,0xdb133));import a9_0xc4df4d from'prettier';import{mkdirSync,writeFileSync,readFileSync}from'node:fs';import a9_0x14d93e from'node:path';import{fileURLToPath}from'node:url';function a9_0x4603(_0x19b5b2,_0x1d4ab0){_0x19b5b2=_0x19b5b2-0x140;const _0x5039cd=a9_0x5039();let _0x4603ea=_0x5039cd[_0x19b5b2];return _0x4603ea;}import{readConfig}from'../utils/config.js';import{TemplateReplacer}from'../utils/template-replacer.js';import{logger}from'../utils/logger.js';export async function generateApiFile(_0x12b6f2,_0x265494='',_0x1a13d1,_0x5c226b=![],_0x98c9b1,_0x1eda4b='./src/api/'){const _0x367495=a9_0x4603,_0x4f6d98=readConfig(),_0xc1d7a7=_0x1a13d1||_0x4f6d98?.['app'];if(typeof _0xc1d7a7!==_0x367495(0x159)||!_0xc1d7a7)throw new Error(_0x367495(0x14c));const _0x5b24c9=_0x5c226b?_0x367495(0x151):'\x22'+_0xc1d7a7+'\x22',_0xc703a5=typeof _0x4f6d98[_0x367495(0x14d)]===_0x367495(0x159)?_0x4f6d98[_0x367495(0x14d)]:undefined,_0x146830=_0x98c9b1||_0xc703a5||_0x367495(0x15c),_0x49253b=_0x146830!==_0x367495(0x15c);let _0x2871ea;if(_0x5c226b)_0x49253b?_0x2871ea=_0x367495(0x162)+_0x5b24c9+_0x367495(0x160)+_0x146830+'\x22\x20}':_0x2871ea='';else{const _0x1c9f0c=_0x49253b?_0x367495(0x160)+_0x146830+'\x22':'';_0x2871ea=_0x367495(0x15f)+_0xc1d7a7+'\x22'+_0x1c9f0c+'\x20}';}const _0x2d65d2=_0x265494?_0x265494+'-api':'api',_0x1ac4b5=_0x265494?_0x265494+_0x367495(0x156):_0x367495(0x145),_0x18a817=[];_0x12b6f2[_0x367495(0x149)](_0x8e4271=>{const _0x23685f=_0x367495;_0x18a817[_0x23685f(0x15b)]({'datasetCode':_0x8e4271[_0x23685f(0x15a)],'tableName':_0x8e4271['tableName'],'name':_0x8e4271[_0x23685f(0x164)]||'','alias':_0x8e4271[_0x23685f(0x144)]||_0x8e4271['key']});});const _0x5526eb=fileURLToPath(import.meta.url),_0x40453e=a9_0x14d93e['resolve'](a9_0x14d93e['dirname'](_0x5526eb),_0x367495(0x155)),_0x3e1fd1=a9_0x14d93e[_0x367495(0x15d)](_0x40453e,_0x367495(0x147)),_0xd05867=a9_0x14d93e[_0x367495(0x15d)](_0x3e1fd1,'api.ts.tpl'),_0x33eabf=a9_0x14d93e[_0x367495(0x15d)](_0x3e1fd1,_0x367495(0x157)),_0x11ae5a=_0x1eda4b[_0x367495(0x15e)]('/')?_0x1eda4b['slice'](0x0,-0x1):_0x1eda4b;mkdirSync(_0x11ae5a,{'recursive':!![]});const _0x3f5561=_0x18a817[0x0]?.[_0x367495(0x144)],_0x4f39c3=readFileSync(_0xd05867,'utf8'),_0x368d93=TemplateReplacer[_0x367495(0x150)](_0x4f39c3,_0xc1d7a7,_0x18a817,_0x3f5561,_0x2d65d2,_0x5b24c9),_0x2d9990=await a9_0xc4df4d[_0x367495(0x14b)](_0x368d93,{'parser':_0x367495(0x158)}),_0x18825e=_0x11ae5a+'/'+_0x2d65d2+_0x367495(0x142);writeFileSync(_0x18825e,_0x2d9990,{'encoding':_0x367495(0x14a)});const _0x54e65d=readFileSync(_0x33eabf,_0x367495(0x14a)),_0x120e19=TemplateReplacer[_0x367495(0x150)](_0x54e65d,_0xc1d7a7,_0x18a817,_0x3f5561,_0x2d65d2,_0x5b24c9,_0x2871ea),_0x4b89b3=await a9_0xc4df4d[_0x367495(0x14b)](_0x120e19,{'parser':_0x367495(0x158)}),_0x47e820=_0x11ae5a+'/'+_0x1ac4b5+_0x367495(0x142);writeFileSync(_0x47e820,_0x4b89b3,{'encoding':_0x367495(0x14a)});const _0x34d48e=_0x18a817['length'];return logger['success']('init-api',_0x367495(0x14f),undefined,{'apiFile':_0x18825e,'clientFile':_0x47e820,'modelCount':_0x34d48e,'configName':_0x5b24c9}),{'modelCount':_0x34d48e,'apiFilePath':_0x18825e,'clientFilePath':_0x47e820,'configName':_0x5b24c9};}function a9_0x5039(){const _0x1a1035=['name','7088524AMbVOI','10546050eQZMIX','342PjaayA','.ts','19238cuIkqZ','alias','client','3eOXeBN','templates/generate-api','5872404PVsjlF','forEach','utf8','format','请先通过\x20`lovrabet\x20config\x20set\x20app\x20<value>`\x20配置应用\x20Code','env','11MaXjOE','API\x20文件生成成功!','replaceApiContent','CONFIG_NAMES.DEFAULT','81eAvurN','3653485xNkgZO','142QIHLPZ','../..','-client','client.ts.tpl','typescript','string','datasetCode','push','online','join','endsWith','{\x20apiConfigName:\x20\x22',',\x20env:\x20\x22','50701mZbknW','{\x20apiConfigName:\x20','792464nQcqaO'];a9_0x5039=function(){return _0x1a1035;};return a9_0x5039();}
1
+ const a9_0x22447e=a9_0x4968;(function(_0x1c2165,_0x4999d7){const _0xd2fa15=a9_0x4968,_0x15faa6=_0x1c2165();while(!![]){try{const _0x211f18=parseInt(_0xd2fa15(0xdc))/0x1*(-parseInt(_0xd2fa15(0xd5))/0x2)+parseInt(_0xd2fa15(0xeb))/0x3+-parseInt(_0xd2fa15(0xd1))/0x4+parseInt(_0xd2fa15(0xf2))/0x5+parseInt(_0xd2fa15(0xcf))/0x6*(-parseInt(_0xd2fa15(0xd0))/0x7)+-parseInt(_0xd2fa15(0xd3))/0x8*(parseInt(_0xd2fa15(0xe4))/0x9)+parseInt(_0xd2fa15(0xd8))/0xa;if(_0x211f18===_0x4999d7)break;else _0x15faa6['push'](_0x15faa6['shift']());}catch(_0x22a07e){_0x15faa6['push'](_0x15faa6['shift']());}}}(a9_0x2cc1,0xb585d));import a9_0x2114f0 from'prettier';import{mkdirSync,writeFileSync,readFileSync}from'node:fs';function a9_0x2cc1(){const _0x46ac51=['{\x20apiConfigName:\x20\x22','slice','alias','env','{\x20apiConfigName:\x20','4382577yDwXGU','templates/generate-api','api.ts.tpl','key','online','format','CONFIG_NAMES.DEFAULT','3074980TuwUew','resolve','push','tableName','api','replaceApiContent','请先通过\x20`lovrabet\x20config\x20set\x20app\x20<value>`\x20配置应用\x20Code','length','954126IGGGrE','7tTeoDJ','1919672aDALEe','-api','4882096vAiMfj','join','2WqFhFj','typescript','./src/api/','18704340GjKMXt','utf8','-client','string','1343309kRqnZi','dirname','init-api','client.ts.tpl','success','\x22\x20}','endsWith','../..','18RFFEaL','forEach'];a9_0x2cc1=function(){return _0x46ac51;};return a9_0x2cc1();}import a9_0x367b07 from'node:path';import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';import{TemplateReplacer}from'../utils/template-replacer.js';import{logger}from'../utils/logger.js';function a9_0x4968(_0x5914b0,_0x259c1b){_0x5914b0=_0x5914b0-0xc8;const _0x2cc1c9=a9_0x2cc1();let _0x496841=_0x2cc1c9[_0x5914b0];return _0x496841;}export async function generateApiFile(_0x1f3d42,_0x5c7649='',_0x26f7ed,_0x6c173a=![],_0x1d9c52,_0x53b5fb=a9_0x22447e(0xd7)){const _0x16aed8=a9_0x22447e,_0x11e179=readConfig(),_0x417f04=_0x26f7ed||_0x11e179?.['app'];if(typeof _0x417f04!==_0x16aed8(0xdb)||!_0x417f04)throw new Error(_0x16aed8(0xcd));const _0x3eb1e1=_0x6c173a?_0x16aed8(0xf1):'\x22'+_0x417f04+'\x22',_0x334bce=typeof _0x11e179['env']===_0x16aed8(0xdb)?_0x11e179[_0x16aed8(0xe9)]:undefined,_0x3b1c08=_0x1d9c52||_0x334bce||_0x16aed8(0xef),_0x1291d7=_0x3b1c08!=='online';let _0xe7423a;if(_0x6c173a)_0x1291d7?_0xe7423a=_0x16aed8(0xea)+_0x3eb1e1+',\x20env:\x20\x22'+_0x3b1c08+_0x16aed8(0xe1):_0xe7423a='';else{const _0x3f05a9=_0x1291d7?',\x20env:\x20\x22'+_0x3b1c08+'\x22':'';_0xe7423a=_0x16aed8(0xe6)+_0x417f04+'\x22'+_0x3f05a9+'\x20}';}const _0x4901d5=_0x5c7649?_0x5c7649+_0x16aed8(0xd2):_0x16aed8(0xcb),_0x56bb94=_0x5c7649?_0x5c7649+_0x16aed8(0xda):'client',_0x365887=[];_0x1f3d42[_0x16aed8(0xe5)](_0x14047e=>{const _0x45336f=_0x16aed8;_0x365887[_0x45336f(0xc9)]({'datasetCode':_0x14047e['datasetCode'],'tableName':_0x14047e[_0x45336f(0xca)],'name':_0x14047e['name']||'','alias':_0x14047e[_0x45336f(0xe8)]||_0x14047e[_0x45336f(0xee)]});});const _0x1d4d6f=fileURLToPath(import.meta.url),_0xe7a5d=a9_0x367b07[_0x16aed8(0xc8)](a9_0x367b07[_0x16aed8(0xdd)](_0x1d4d6f),_0x16aed8(0xe3)),_0x47894b=a9_0x367b07['join'](_0xe7a5d,_0x16aed8(0xec)),_0x336e8d=a9_0x367b07[_0x16aed8(0xd4)](_0x47894b,_0x16aed8(0xed)),_0x3248b6=a9_0x367b07['join'](_0x47894b,_0x16aed8(0xdf)),_0x1a9448=_0x53b5fb[_0x16aed8(0xe2)]('/')?_0x53b5fb[_0x16aed8(0xe7)](0x0,-0x1):_0x53b5fb;mkdirSync(_0x1a9448,{'recursive':!![]});const _0x3b3a5b=_0x365887[0x0]?.[_0x16aed8(0xe8)],_0x4ef919=readFileSync(_0x336e8d,_0x16aed8(0xd9)),_0x29bd39=TemplateReplacer['replaceApiContent'](_0x4ef919,_0x417f04,_0x365887,_0x3b3a5b,_0x4901d5,_0x3eb1e1),_0x5a0627=await a9_0x2114f0[_0x16aed8(0xf0)](_0x29bd39,{'parser':'typescript'}),_0x56a576=_0x1a9448+'/'+_0x4901d5+'.ts';writeFileSync(_0x56a576,_0x5a0627,{'encoding':_0x16aed8(0xd9)});const _0x4ea8d6=readFileSync(_0x3248b6,_0x16aed8(0xd9)),_0x46125a=TemplateReplacer[_0x16aed8(0xcc)](_0x4ea8d6,_0x417f04,_0x365887,_0x3b3a5b,_0x4901d5,_0x3eb1e1,_0xe7423a),_0x757436=await a9_0x2114f0[_0x16aed8(0xf0)](_0x46125a,{'parser':_0x16aed8(0xd6)}),_0x553a77=_0x1a9448+'/'+_0x56bb94+'.ts';writeFileSync(_0x553a77,_0x757436,{'encoding':'utf8'});const _0x102b61=_0x365887[_0x16aed8(0xce)];return logger[_0x16aed8(0xe0)](_0x16aed8(0xde),'API\x20文件生成成功!',undefined,{'apiFile':_0x56a576,'clientFile':_0x553a77,'modelCount':_0x102b61,'configName':_0x3eb1e1}),{'modelCount':_0x102b61,'apiFilePath':_0x56a576,'clientFilePath':_0x553a77,'configName':_0x3eb1e1};}