@lovrabet/cli 1.2.5-beta.7 → 1.3.0-beta.12

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 (90) hide show
  1. package/lib/add-page/input-page-router.js +1 -1
  2. package/lib/add-page/main.js +1 -1
  3. package/lib/add-page/select-page-template.js +1 -1
  4. package/lib/ai-setup/AISetupUI.js +1 -1
  5. package/lib/ai-setup/config.js +1 -1
  6. package/lib/api/api-doc-ui.js +1 -1
  7. package/lib/api/api-doc.js +1 -1
  8. package/lib/api/api-pull-ui.js +1 -1
  9. package/lib/api/fetch-model-list.js +1 -1
  10. package/lib/api/generate-api-file.js +1 -1
  11. package/lib/api/main.js +1 -1
  12. package/lib/api/pull-silent.js +1 -1
  13. package/lib/app-menu/app-menu-sync-ui.js +1 -1
  14. package/lib/app-menu/create-menu.js +1 -1
  15. package/lib/app-menu/get-local-pages.js +1 -1
  16. package/lib/app-menu/get-online-menu-list.js +1 -1
  17. package/lib/app-menu/use-get-online-menu-list.js +1 -1
  18. package/lib/app-menu/utils.js +1 -1
  19. package/lib/app-menu/valid-url.js +1 -1
  20. package/lib/app-menu-update-cdn/current-content.js +1 -1
  21. package/lib/app-menu-update-cdn/input-cdn-asset.js +1 -1
  22. package/lib/app-menu-update-cdn/main.js +1 -1
  23. package/lib/app-menu-update-cdn/update-menu-cdn-url.js +1 -1
  24. package/lib/auth/auth-server-ui.js +1 -1
  25. package/lib/auth/auth-server.js +1 -1
  26. package/lib/auth/constant.js +1 -1
  27. package/lib/auth/get-cookie.js +1 -1
  28. package/lib/auth/is-session-valid.js +1 -1
  29. package/lib/auth/logout.js +1 -1
  30. package/lib/cli.js +1 -1
  31. package/lib/cmd/build-watch.js +1 -1
  32. package/lib/cmd/build.js +1 -1
  33. package/lib/cmd/logs.js +1 -1
  34. package/lib/cmd/preview.js +1 -1
  35. package/lib/cmd/start.js +1 -1
  36. package/lib/config/config-help.js +1 -1
  37. package/lib/config/main.js +1 -1
  38. package/lib/constant/domain.js +1 -1
  39. package/lib/constant/env.js +1 -1
  40. package/lib/create-app/enhanced-guided-create.js +1 -1
  41. package/lib/create-app/format-elapsed.js +1 -1
  42. package/lib/create-app/main.js +1 -1
  43. package/lib/create-app/non-interactive.js +1 -1
  44. package/lib/create-app/task-finished.js +1 -1
  45. package/lib/create-app/task-loading.js +1 -1
  46. package/lib/create-app/task-running.js +1 -1
  47. package/lib/create-app/task-time.js +1 -1
  48. package/lib/create-app/use-copy-project-template.js +1 -1
  49. package/lib/create-app/use-format-code.js +1 -1
  50. package/lib/create-app/use-install-dependencies.js +1 -1
  51. package/lib/help.js +1 -1
  52. package/lib/init/main.js +1 -1
  53. package/lib/mcp/McpInstallUI.js +1 -1
  54. package/lib/mcp/claude.js +1 -1
  55. package/lib/mcp/cursor.js +1 -1
  56. package/lib/mcp/main.js +1 -1
  57. package/lib/mcp/mcp-install-non-interactive.js +1 -1
  58. package/lib/mcp/mcp-installer.js +1 -1
  59. package/lib/skills/SkillInstallUI.js +1 -1
  60. package/lib/skills/main.js +1 -1
  61. package/lib/skills/skill-install-non-interactive.js +1 -1
  62. package/lib/skills/skill-installer.js +1 -1
  63. package/lib/ui/IDESelector.js +1 -1
  64. package/lib/ui/useIDESelection.js +1 -1
  65. package/lib/utils/ai_config.js +1 -1
  66. package/lib/utils/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 -1
  70. package/lib/utils/guides-cdn.js +1 -0
  71. package/lib/utils/http-client.js +1 -1
  72. package/lib/utils/logger.js +1 -1
  73. package/lib/utils/router-updater.js +1 -1
  74. package/lib/utils/rules-cdn.js +1 -0
  75. package/lib/utils/sleep.js +1 -1
  76. package/lib/utils/template-replacer.js +1 -1
  77. package/package.json +4 -3
  78. package/templates/rules/README.md +0 -178
  79. package/templates/rules/example-project-setup.md +0 -276
  80. package/templates/rules/lovrabet_rules.mdc.tpl +0 -1249
  81. package/templates/skills/.cursorrules +0 -109
  82. package/templates/skills/.shared/README.md +0 -20
  83. package/templates/skills/.shared/SKILL.md.tpl +0 -119
  84. package/templates/skills/.shared/guides/01-typescript-sdk/guide.md +0 -382
  85. package/templates/skills/.shared/guides/02-mcp-sql-workflow/guide.md +0 -272
  86. package/templates/skills/.shared/guides/03-antd-style/guide.md +0 -282
  87. package/templates/skills/.shared/guides/04-troubleshooting/guide.md +0 -426
  88. package/templates/skills/.shared/guides/05-api-integration/guide.md +0 -329
  89. package/templates/skills/.shared/guides/06-menu-management/guide.md +0 -307
  90. package/templates/skills/.shared/guides/07-backend-function/guide.md +0 -600
@@ -1 +1 @@
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
+ (function(_0x429f02,_0x40641d){const _0x444606=a0_0x3c65,_0x39ff1e=_0x429f02();while(!![]){try{const _0x3aa295=-parseInt(_0x444606(0x94))/0x1*(parseInt(_0x444606(0x7f))/0x2)+-parseInt(_0x444606(0x8a))/0x3*(parseInt(_0x444606(0x90))/0x4)+parseInt(_0x444606(0x8e))/0x5*(parseInt(_0x444606(0x81))/0x6)+-parseInt(_0x444606(0x86))/0x7*(parseInt(_0x444606(0x79))/0x8)+parseInt(_0x444606(0x7c))/0x9*(-parseInt(_0x444606(0x8f))/0xa)+parseInt(_0x444606(0x8b))/0xb+parseInt(_0x444606(0x83))/0xc*(parseInt(_0x444606(0x91))/0xd);if(_0x3aa295===_0x40641d)break;else _0x39ff1e['push'](_0x39ff1e['shift']());}catch(_0x4fa924){_0x39ff1e['push'](_0x39ff1e['shift']());}}}(a0_0x9bbf,0x9330d));import{jsx as a0_0x4a69cf,jsxs as a0_0x3dd217}from'react/jsx-runtime';import{useState}from'react';function a0_0x9bbf(){const _0x2cda84=['\x20Step2:\x20','backspace','2114325kIGZNJ','trim','\x20已存在,请使用其他路径','142HQlgVz','页面路由地址:\x20','7482oNZatp','column','48lwjxWU','页面路径\x20','endsWith','8330021JgTZcn','my-page','delete','length','9BIQyom','10010110XCJkJi','页面路径长度不能超过\x20100\x20个字符','路径不能以\x20/\x20开头或结尾','380XsYuzd','10sbxLou','1151252ZBTecN','7886138PAFURb','return','gray','7606RsWEYg','red','\x20←\x20','slice','页面路径不合法','existsSync','路径不能包含连续的\x20/','test','startsWith','8tOMJOH'];a0_0x9bbf=function(){return _0x2cda84;};return a0_0x9bbf();}import{Text,Box,useInput}from'ink';import a0_0x3a7a33 from'node:fs';function a0_0x3c65(_0x38a9bc,_0x144266){_0x38a9bc=_0x38a9bc-0x78;const _0x9bbfb7=a0_0x9bbf();let _0x3c654c=_0x9bbfb7[_0x38a9bc];return _0x3c654c;}export function InputProjectCode(_0x32a86d){const _0x44b0aa=a0_0x3c65,{onSubmit:_0x1be467,pagePath:_0x42c471}=_0x32a86d,[_0xa9650,_0x2e1496]=useState(''),[_0x337c8c,_0x30927d]=useState(''),_0x5605c3=_0x44b0aa(0x87);function _0x45bcb3(_0xf58828){const _0x9bdb0d=_0x44b0aa;if(_0xf58828[_0x9bdb0d(0x89)]>0x64)return{'valid':![],'message':_0x9bdb0d(0x8c)};if(_0xf58828[_0x9bdb0d(0x78)]('/')||_0xf58828[_0x9bdb0d(0x85)]('/'))return{'valid':![],'message':_0x9bdb0d(0x8d)};if(_0xf58828['includes']('//'))return{'valid':![],'message':_0x9bdb0d(0x9a)};const _0x1613cf=_0xf58828['split']('/');for(const _0xc8f87a of _0x1613cf){if(!_0xc8f87a)continue;const _0xc48913=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(!_0xc48913[_0x9bdb0d(0x9b)](_0xc8f87a))return{'valid':![],'message':'路径中的每个段只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_'};}return{'valid':!![]};}return useInput((_0x5ce6f0,_0x5ec759)=>{const _0x5f02e1=_0x44b0aa;if(_0x5ec759[_0x5f02e1(0x92)]){const _0x3b938f=_0xa9650[_0x5f02e1(0x7d)]()||_0x5605c3;if(_0x337c8c)return;const _0x2eb545=_0x42c471+'/'+_0x3b938f;if(a0_0x3a7a33[_0x5f02e1(0x99)](_0x2eb545)){_0x30927d(_0x5f02e1(0x84)+_0x3b938f+_0x5f02e1(0x7e));return;}_0x1be467(_0x3b938f),_0x2e1496(''),_0x30927d('');}else _0x5ec759[_0x5f02e1(0x7b)]||_0x5ec759[_0x5f02e1(0x88)]?_0x2e1496(_0x406dbc=>{const _0x22c183=_0x5f02e1,_0x38b86e=_0x406dbc[_0x22c183(0x97)](0x0,-0x1),{valid:_0x414688,message:_0x199494}=_0x45bcb3(_0x38b86e);return _0x30927d(_0x414688?'':_0x199494||_0x22c183(0x98)),_0x38b86e;}):_0x2e1496(_0x2663b5=>{const _0x2df372=_0x5f02e1,_0x371bdd=_0x2663b5+_0x5ce6f0,{valid:_0x3093d5,message:_0x9bbef7}=_0x45bcb3(_0x371bdd);return _0x30927d(_0x3093d5?'':_0x9bbef7||_0x2df372(0x98)),_0x371bdd;});}),a0_0x3dd217(Box,{'flexDirection':_0x44b0aa(0x82),'children':[a0_0x3dd217(Box,{'children':[a0_0x4a69cf(Text,{'color':_0x44b0aa(0x93),'children':_0x44b0aa(0x7a)}),a0_0x4a69cf(Text,{'children':_0x44b0aa(0x80)}),_0xa9650?a0_0x4a69cf(Text,{'color':'green','children':_0xa9650}):a0_0x4a69cf(Text,{'color':_0x44b0aa(0x93),'children':_0x5605c3}),_0x337c8c&&a0_0x3dd217(Text,{'color':_0x44b0aa(0x95),'children':[_0x44b0aa(0x96),_0x337c8c]})]}),!_0x337c8c&&!_0xa9650&&a0_0x4a69cf(Box,{'children':a0_0x4a69cf(Text,{'color':_0x44b0aa(0x93),'children':'\x20直接回车确认,或输入自定义路由地址'})})]});}
@@ -1 +1 @@
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
+ const a1_0x4d6fb3=a1_0x491d;(function(_0x265357,_0xa96ca){const _0x13df2f=a1_0x491d,_0x37ed83=_0x265357();while(!![]){try{const _0x11800d=parseInt(_0x13df2f(0x202))/0x1*(parseInt(_0x13df2f(0x1f4))/0x2)+parseInt(_0x13df2f(0x1f8))/0x3*(-parseInt(_0x13df2f(0x205))/0x4)+parseInt(_0x13df2f(0x1f7))/0x5+parseInt(_0x13df2f(0x201))/0x6+-parseInt(_0x13df2f(0x1ee))/0x7*(parseInt(_0x13df2f(0x200))/0x8)+parseInt(_0x13df2f(0x1ed))/0x9+parseInt(_0x13df2f(0x208))/0xa;if(_0x11800d===_0xa96ca)break;else _0x37ed83['push'](_0x37ed83['shift']());}catch(_0x1bc72b){_0x37ed83['push'](_0x37ed83['shift']());}}}(a1_0x1abc,0xab235));function a1_0x491d(_0x2b588a,_0x57dfa6){_0x2b588a=_0x2b588a-0x1ec;const _0x1abc99=a1_0x1abc();let _0x491d9f=_0x1abc99[_0x2b588a];return _0x491d9f;}import{jsx as a1_0xdea866,jsxs as a1_0xe54419,Fragment as a1_0x576a75}from'react/jsx-runtime';import{fileURLToPath}from'node:url';import a1_0x2d7e50 from'node:path';import{useEffect,useState}from'react';function a1_0x1abc(){const _0x5d6fa5=['已选择页面模板\x20','add-page','catch','\x20*\x20页面创建成功!','success','1832RjRjpH','362502JJEvbk','14475tOJxIv','../../templates/pages','dirname','5146052TFZTKt','\x20Step1:\x20','正在创建页面,请稍候…','6442080RNOuaK','开始添加页面:\x20','info','页面添加成功:\x20','error','then','\x20Step2:\x20','setLogPath','green','cyan','cwd','finally','8149905KyWUkJ','10409dbLkMb','join','页面添加失败:\x20','gray','column','now','74iITtsA','\x20*\x20页面文件已创建,可直接通过路由访问','resolve','911360IbGvSY','3hZtPUr','src','\x20*\x20路由地址:\x20'];a1_0x1abc=function(){return _0x5d6fa5;};return a1_0x1abc();}import{Box,Text,useApp}from'ink';import{SelectPageTemplate}from'./select-page-template.js';import{InputProjectCode}from'./input-page-router.js';import{logger}from'../utils/logger.js';import{TemplateReplacer}from'../utils/template-replacer.js';const __dirname=a1_0x2d7e50[a1_0x4d6fb3(0x204)](fileURLToPath(import.meta.url)),pageTemplateDir=a1_0x2d7e50[a1_0x4d6fb3(0x1f6)](__dirname,a1_0x4d6fb3(0x203)),projectDir=process['cwd']();export const AddPage=()=>{const _0x366bde=a1_0x4d6fb3,{exit:_0x409bcf}=useApp(),[_0x33cf09,_0x39cd89]=useState(''),[_0x3cec16,_0x13cb62]=useState(''),[_0x57a204,_0x503c97]=useState(![]),[_0x35e256,_0xb15fe1]=useState(![]),_0x5b763e=a1_0x2d7e50[_0x366bde(0x1ef)](projectDir,_0x366bde(0x1f9),'pages'),_0x251b9a=a1_0x2d7e50['join'](_0x5b763e,_0x3cec16),_0x2344ce=a1_0x2d7e50['join']('src','pages',_0x3cec16);useEffect(()=>{const _0xb8f1c1=_0x366bde,_0x39fea7=a1_0x2d7e50[_0xb8f1c1(0x1f6)](pageTemplateDir,_0x33cf09);if(_0x33cf09&&_0x3cec16){_0x503c97(!![]),logger[_0xb8f1c1(0x20f)](process[_0xb8f1c1(0x212)]());const _0x45589f=Date[_0xb8f1c1(0x1f3)]();logger[_0xb8f1c1(0x20a)](_0xb8f1c1(0x1fc),_0xb8f1c1(0x209)+_0x3cec16,{'template':_0x33cf09,'targetPath':_0x2344ce}),TemplateReplacer['processTemplate'](_0x39fea7,a1_0x2d7e50[_0xb8f1c1(0x1ef)](_0x5b763e,_0x3cec16),_0x3cec16,_0x33cf09)[_0xb8f1c1(0x20d)](()=>{const _0x15e60f=_0xb8f1c1,_0x5389c8=Date['now']()-_0x45589f;logger[_0x15e60f(0x1ff)](_0x15e60f(0x1fc),_0x15e60f(0x20b)+_0x3cec16,_0x5389c8,{'template':_0x33cf09,'targetPath':_0x2344ce,'routePath':_0x3cec16}),_0xb15fe1(!![]);})[_0xb8f1c1(0x1fd)](_0x19fd49=>{const _0x47422c=_0xb8f1c1,_0x2b6551=Date[_0x47422c(0x1f3)]()-_0x45589f;logger[_0x47422c(0x20c)]('add-page',_0x47422c(0x1f0)+_0x3cec16,{'template':_0x33cf09,'targetPath':_0x2344ce,'error':_0x19fd49 instanceof Error?_0x19fd49['message']:String(_0x19fd49),'duration':_0x2b6551});})[_0xb8f1c1(0x1ec)](()=>{_0x503c97(![]);});}},[_0x33cf09,_0x3cec16]),useEffect(()=>{_0x35e256&&setTimeout(()=>{_0x409bcf();});},[_0x35e256]);if(_0x33cf09)return a1_0xe54419(Box,{'flexDirection':_0x366bde(0x1f2),'paddingY':0x1,'children':[a1_0xe54419(Box,{'children':[a1_0xdea866(Text,{'color':_0x366bde(0x1f1),'children':_0x366bde(0x206)}),a1_0xdea866(Text,{'children':_0x366bde(0x1fb)}),a1_0xdea866(Text,{'color':_0x366bde(0x210),'children':_0x33cf09})]}),_0x3cec16?a1_0xe54419(Box,{'children':[a1_0xdea866(Text,{'color':'gray','children':_0x366bde(0x20e)}),a1_0xdea866(Text,{'children':'已输入的页面路由\x20'}),a1_0xdea866(Text,{'color':_0x366bde(0x210),'children':_0x3cec16})]}):a1_0xdea866(InputProjectCode,{'pagePath':_0x251b9a,'onSubmit':_0x13cb62}),_0x3cec16&&_0x57a204?a1_0xe54419(Box,{'marginTop':0x1,'children':[a1_0xdea866(Box,{'width':'4'}),a1_0xdea866(Text,{'children':_0x366bde(0x207)})]}):null,_0x35e256?a1_0xe54419(a1_0x576a75,{'children':[a1_0xdea866(Box,{'marginTop':0x1,'children':a1_0xdea866(Text,{'color':_0x366bde(0x1f1),'children':_0x366bde(0x1fe)})}),a1_0xe54419(Box,{'children':[a1_0xdea866(Text,{'color':'gray','children':'\x20*\x20页面路径:\x20'}),a1_0xdea866(Text,{'color':_0x366bde(0x210),'children':_0x2344ce})]}),a1_0xe54419(Box,{'children':[a1_0xdea866(Text,{'color':'gray','children':_0x366bde(0x1fa)}),a1_0xe54419(Text,{'color':_0x366bde(0x210),'children':['/',_0x3cec16]})]}),a1_0xdea866(Box,{'marginTop':0x1,'children':a1_0xdea866(Text,{'color':_0x366bde(0x211),'children':_0x366bde(0x1f5)})})]}):null]});return a1_0xdea866(SelectPageTemplate,{'onSelect':_0x39cd89});};
@@ -1 +1 @@
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
+ (function(_0x29c2b5,_0x48fe62){const _0x4ad78f=a2_0x334e,_0x5040a5=_0x29c2b5();while(!![]){try{const _0x1b1050=parseInt(_0x4ad78f(0xa6))/0x1+parseInt(_0x4ad78f(0xbb))/0x2+parseInt(_0x4ad78f(0x9f))/0x3*(parseInt(_0x4ad78f(0xa2))/0x4)+-parseInt(_0x4ad78f(0xa3))/0x5*(-parseInt(_0x4ad78f(0xb6))/0x6)+-parseInt(_0x4ad78f(0xa0))/0x7*(parseInt(_0x4ad78f(0xa1))/0x8)+-parseInt(_0x4ad78f(0xae))/0x9+-parseInt(_0x4ad78f(0x99))/0xa;if(_0x1b1050===_0x48fe62)break;else _0x5040a5['push'](_0x5040a5['shift']());}catch(_0x2757b6){_0x5040a5['push'](_0x5040a5['shift']());}}}(a2_0x3800,0xd7ad2));function a2_0x334e(_0x7ccb4b,_0x1cdaa9){_0x7ccb4b=_0x7ccb4b-0x99;const _0x3800d4=a2_0x3800();let _0x334e56=_0x3800d4[_0x7ccb4b];return _0x334e56;}import{jsx as a2_0xbc734d,jsxs as a2_0xbf692c}from'react/jsx-runtime';function a2_0x3800(){const _0x1c08cd=['1799522SkWedU','17834420cqeaqi','onSelect','filter','sdk-fetch','\x20Step1:\x20','templates/pages','6MqJQvM','7ktIrSu','10331800BAZMUK','2009076IkhKSJ','978570BTOxaE','dirname','error','1274363UyZidJ','gray','获取模板列表失败:','\x20\x20\x20\x20\x20\x20>\x20','column','map','localeCompare','downArrow','5312997TzLUgi','label','return','\x20\x20\x20\x20\x20\x20\x20\x20','../..','resolve','length','sort','42ZSiwIC','blank','isDirectory','upArrow','请选择您要创建的页面模板'];a2_0x3800=function(){return _0x1c08cd;};return a2_0x3800();}import{useState,useEffect}from'react';import{Text,Box,useInput}from'ink';import{readdir}from'node:fs/promises';import a2_0x14bb19 from'node:path';import{fileURLToPath}from'node:url';async function getTemplateList(){const _0x276f66=a2_0x334e;try{const _0x136d38=fileURLToPath(import.meta.url),_0x3c9149=a2_0x14bb19[_0x276f66(0xb3)](a2_0x14bb19[_0x276f66(0xa4)](_0x136d38),_0x276f66(0xb2)),_0x3285cb=a2_0x14bb19['join'](_0x3c9149,_0x276f66(0x9e)),_0x393a41=await readdir(_0x3285cb,{'withFileTypes':!![]}),_0x5307d9=_0x393a41[_0x276f66(0x9b)](_0x280f84=>_0x280f84[_0x276f66(0xb8)]())['map'](_0x21209f=>({'label':_0x21209f['name']}))[_0x276f66(0xb5)]((_0xed3140,_0x551686)=>_0xed3140[_0x276f66(0xaf)][_0x276f66(0xac)](_0x551686[_0x276f66(0xaf)]));return _0x5307d9;}catch(_0x51c981){return console[_0x276f66(0xa5)](_0x276f66(0xa8),_0x51c981),[{'label':_0x276f66(0xb7)},{'label':_0x276f66(0x9c)}];}}export function SelectPageTemplate(_0x54ff9d){const _0x55c354=a2_0x334e,[_0x3b139d,_0x3bf550]=useState(0x0),[_0x1f7ea6,_0x2287ad]=useState([]),[_0x3b4e7c,_0x5b9dc6]=useState(!![]);useEffect(()=>{async function _0x5a4bb8(){const _0x312eae=await getTemplateList();_0x2287ad(_0x312eae),_0x5b9dc6(![]);}_0x5a4bb8();},[]),useInput((_0x4b4eef,_0x5b1fd4)=>{const _0x347231=a2_0x334e;if(_0x3b4e7c)return;if(_0x5b1fd4[_0x347231(0xb0)]){const _0x5f696a=_0x1f7ea6[_0x3b139d];_0x5f696a&&_0x54ff9d[_0x347231(0x9a)](_0x5f696a[_0x347231(0xaf)]);}_0x5b1fd4[_0x347231(0xb9)]&&_0x3bf550(_0x3cbc8a=>_0x3cbc8a===0x0?_0x1f7ea6['length']-0x1:_0x3cbc8a-0x1),_0x5b1fd4[_0x347231(0xad)]&&_0x3bf550(_0xd04238=>_0xd04238===_0x1f7ea6[_0x347231(0xb4)]-0x1?0x0:_0xd04238+0x1);});if(_0x3b4e7c)return a2_0xbc734d(Box,{'flexDirection':_0x55c354(0xaa),'paddingY':0x1,'children':a2_0xbf692c(Box,{'children':[a2_0xbc734d(Text,{'color':_0x55c354(0xa7),'children':_0x55c354(0x9d)}),a2_0xbc734d(Text,{'children':'正在加载页面模板...'})]})});return a2_0xbf692c(Box,{'flexDirection':_0x55c354(0xaa),'paddingY':0x1,'children':[a2_0xbf692c(Box,{'children':[a2_0xbc734d(Text,{'color':_0x55c354(0xa7),'children':_0x55c354(0x9d)}),a2_0xbc734d(Text,{'children':_0x55c354(0xba)})]}),_0x1f7ea6[_0x55c354(0xab)]((_0xb0e867,_0x107188)=>{const _0x1e958d=_0x55c354,_0x2fca01=_0x107188===_0x3b139d,_0x563b3d=_0x2fca01?_0x1e958d(0xa9)+_0xb0e867['label']:_0x1e958d(0xb1)+_0xb0e867[_0x1e958d(0xaf)];return a2_0xbc734d(Box,{'children':a2_0xbc734d(Text,{'color':_0x2fca01?'green':undefined,'children':_0x563b3d})},_0x563b3d);})]});}
@@ -1 +1 @@
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
+ function a3_0x3fe8(){const _0x433821=['done','skill-','opencode','push','success','[Y]\x20是,配置\x20AI\x20助手','技能包\x20(研发规范指南)','Cursor','[✓]','has','cursor','gray','error','23861qaUVbx','length','259032sdyrPh','appcode','1386160BKdPFu','MCP\x20服务器\x20(AI\x20访问数据集)','5934DwhTCA','Claude\x20Code','22AKsfmF','[\x20]','confirming','return','codex','mcp-','[N]\x20跳过,稍后手动配置','506871QJkDWs','green','915ELoBsJ','size','77MPkDoD','name','red','*\x20选择要配置的\x20IDE:','•\x20Skill:\x20安装研发最佳实践、Backend\x20Function\x20规范','cyan','claude','add','upArrow','132544jMTmfO','filter','572526jEcmUp','trae','column','selecting','message','white','installing','projectRoot','delete','blue','map','请至少选择一个配置项','yellow','antigravity','downArrow','正在配置\x20AI\x20助手...','windsurf','9bnmpEV'];a3_0x3fe8=function(){return _0x433821;};return a3_0x3fe8();}const a3_0x3e245f=a3_0x3b04;(function(_0x2ca686,_0x421c59){const _0x4c4f1c=a3_0x3b04,_0x3351ee=_0x2ca686();while(!![]){try{const _0x221469=parseInt(_0x4c4f1c(0x114))/0x1+parseInt(_0x4c4f1c(0xf5))/0x2+parseInt(_0x4c4f1c(0x106))/0x3*(parseInt(_0x4c4f1c(0x116))/0x4)+parseInt(_0x4c4f1c(0x125))/0x5*(-parseInt(_0x4c4f1c(0x11a))/0x6)+parseInt(_0x4c4f1c(0x127))/0x7*(parseInt(_0x4c4f1c(0xf3))/0x8)+-parseInt(_0x4c4f1c(0x123))/0x9+parseInt(_0x4c4f1c(0x118))/0xa*(-parseInt(_0x4c4f1c(0x11c))/0xb);if(_0x221469===_0x421c59)break;else _0x3351ee['push'](_0x3351ee['shift']());}catch(_0x4f7f7d){_0x3351ee['push'](_0x3351ee['shift']());}}}(a3_0x3fe8,0x2a04c));import{jsx as a3_0x437e63,jsxs as a3_0x481274}from'react/jsx-runtime';import{useState,useEffect}from'react';function a3_0x3b04(_0x5aea4a,_0x5c616a){_0x5aea4a=_0x5aea4a-0xed;const _0x3fe8d1=a3_0x3fe8();let _0x3b04bc=_0x3fe8d1[_0x5aea4a];return _0x3b04bc;}import{Box,Text,useInput,useApp}from'ink';import{configureMcp}from'./config.js';import{installSkill,copySharedSkills,createSkillManifest,SKILL_IDE_CONFIGS}from'./config.js';const MCP_IDE_LIST=[a3_0x3e245f(0x111),a3_0x3e245f(0xf0)],SKILL_IDE_LIST=[a3_0x3e245f(0x102),'claude','codebuddy',a3_0x3e245f(0x120),a3_0x3e245f(0x111),a3_0x3e245f(0x109),'qoder',a3_0x3e245f(0xf6),a3_0x3e245f(0x105),'agent'];export function AISetupUI({config:_0x181946,onComplete:_0x38c44b}){const _0x593640=a3_0x3e245f,{exit:_0x48a3d4}=useApp(),[_0xf3ace6,_0x25a7b1]=useState(_0x593640(0x11e)),[_0x33ce51,_0x3b7a94]=useState(0x0),[_0x5dcda8,_0x57963e]=useState(new Set([0x0,0x1])),[_0x4532c5,_0x230bef]=useState(new Set(SKILL_IDE_LIST[_0x593640(0xff)]((_0xbff63,_0x1713dc)=>_0x1713dc))),[_0x461165,_0x3e617e]=useState('');useEffect(()=>{!_0x181946['appcode']&&_0x38c44b({'mcpResults':[],'skillResults':[]});},[_0x181946[_0x593640(0x117)],_0x38c44b]),useInput((_0x577944,_0x31e4c7)=>{const _0x428643=_0x593640;if(_0xf3ace6===_0x428643(0x11e)){if(_0x577944==='y'||_0x577944==='Y'||_0x31e4c7['return']){_0x120439();return;}if(_0x577944==='n'||_0x577944==='N'){_0x38c44b({'mcpResults':[],'skillResults':[]});return;}if(_0x31e4c7[_0x428643(0x11f)]){_0x120439();return;}}if(_0xf3ace6==='selecting'){if(_0x31e4c7[_0x428643(0xf2)]){_0x3b7a94(_0x25bd77=>_0x25bd77>0x0?_0x25bd77-0x1:SKILL_IDE_LIST[_0x428643(0x115)]-0x1);return;}if(_0x31e4c7[_0x428643(0x103)]){_0x3b7a94(_0x1de1ec=>_0x1de1ec<SKILL_IDE_LIST[_0x428643(0x115)]-0x1?_0x1de1ec+0x1:0x0);return;}if(_0x577944==='\x20'){const _0x176379=_0x33ce51<MCP_IDE_LIST['length'];if(_0x176379){const _0x264d8c=new Set(_0x5dcda8);_0x264d8c[_0x428643(0x110)](_0x33ce51)?_0x264d8c['delete'](_0x33ce51):_0x264d8c['add'](_0x33ce51),_0x57963e(_0x264d8c);}else{const _0x9a2789=_0x33ce51-MCP_IDE_LIST[_0x428643(0x115)],_0x163ee8=new Set(_0x4532c5);_0x163ee8[_0x428643(0x110)](_0x9a2789)?_0x163ee8[_0x428643(0xfd)](_0x9a2789):_0x163ee8[_0x428643(0xf1)](_0x9a2789),_0x230bef(_0x163ee8);}return;}if(_0x577944==='a'||_0x577944==='A'){_0x57963e(new Set(MCP_IDE_LIST[_0x428643(0xff)]((_0x379bda,_0x13d0f4)=>_0x13d0f4))),_0x230bef(new Set(SKILL_IDE_LIST[_0x428643(0xff)]((_0x42d2b4,_0x47d555)=>_0x47d555)));return;}if(_0x577944==='q'||_0x577944==='Q'){_0x48a3d4();return;}if(_0x31e4c7[_0x428643(0x11f)]){if(_0x5dcda8[_0x428643(0x126)]===0x0&&_0x4532c5['size']===0x0){_0x3e617e(_0x428643(0x100));return;}_0x120439();return;}}if(_0xf3ace6===_0x428643(0x107)){_0x48a3d4();return;}});async function _0x120439(){const _0x18b1fb=_0x593640;_0x25a7b1(_0x18b1fb(0xfb));const _0x36f5b6=[],_0x2e46a2=[];for(const _0x4b98e9 of _0x5dcda8){const _0x4a88bb=MCP_IDE_LIST[_0x4b98e9];if(!_0x4a88bb)continue;try{const _0x2afdd8=await configureMcp(_0x4a88bb,_0x181946[_0x18b1fb(0xfc)]);_0x36f5b6[_0x18b1fb(0x10a)](_0x2afdd8);}catch(_0x5062ec){_0x36f5b6[_0x18b1fb(0x10a)]({'ide':MCP_IDE_CONFIGS[_0x4a88bb]?.[_0x18b1fb(0x128)]||_0x4a88bb,'status':_0x18b1fb(0x113),'message':_0x5062ec instanceof Error?_0x5062ec[_0x18b1fb(0xf9)]:String(_0x5062ec)});}}await copySharedSkills(_0x181946['projectRoot']);for(const _0x3bd2c9 of _0x4532c5){const _0x435725=SKILL_IDE_LIST[_0x3bd2c9];if(!_0x435725)continue;try{const _0x35930c=await installSkill(_0x435725,_0x181946[_0x18b1fb(0xfc)]);_0x2e46a2[_0x18b1fb(0x10a)](_0x35930c);}catch(_0x287a3f){_0x2e46a2['push']({'ide':SKILL_IDE_CONFIGS[_0x435725]?.[_0x18b1fb(0x128)]||_0x435725,'status':_0x18b1fb(0x113),'message':_0x287a3f instanceof Error?_0x287a3f['message']:String(_0x287a3f)});}}if(_0x2e46a2[_0x18b1fb(0x115)]>0x0){const _0xac2aec=_0x2e46a2[_0x18b1fb(0xf4)](_0x19300a=>_0x19300a['status']===_0x18b1fb(0x10b))[_0x18b1fb(0xff)](_0x8a3bf6=>_0x8a3bf6['ide']);_0xac2aec[_0x18b1fb(0x115)]>0x0&&createSkillManifest(_0x181946[_0x18b1fb(0xfc)],_0xac2aec);}_0x25a7b1(_0x18b1fb(0x107)),setTimeout(()=>{_0x38c44b({'mcpResults':_0x36f5b6,'skillResults':_0x2e46a2});},0xbb8);}if(_0xf3ace6===_0x593640(0x11e))return a3_0x481274(Box,{'flexDirection':_0x593640(0xf7),'marginTop':0x1,'children':[a3_0x437e63(Box,{'marginTop':0x1,'children':a3_0x437e63(Text,{'color':_0x593640(0xfa),'children':'是否同时配置\x20AI\x20助手?这将:'})}),a3_0x437e63(Box,{'marginLeft':0x2,'marginTop':0x1,'children':a3_0x437e63(Text,{'color':'gray','children':'•\x20MCP:\x20让\x20AI\x20直接访问\x20Lovrabet\x20数据集'})}),a3_0x437e63(Box,{'marginLeft':0x2,'children':a3_0x437e63(Text,{'color':_0x593640(0x112),'children':_0x593640(0xee)})}),a3_0x481274(Box,{'marginTop':0x1,'flexDirection':_0x593640(0xf7),'children':[a3_0x437e63(Box,{'children':a3_0x437e63(Text,{'color':_0x593640(0x124),'children':_0x593640(0x10c)})}),a3_0x437e63(Box,{'children':a3_0x437e63(Text,{'color':'gray','children':_0x593640(0x122)})}),a3_0x437e63(Box,{'children':a3_0x437e63(Text,{'color':'dimColor','children':'Enter\x20默认:\x20是'})})]}),_0x461165&&a3_0x437e63(Box,{'marginTop':0x1,'children':a3_0x481274(Text,{'color':_0x593640(0x129),'children':['✗\x20',_0x461165]})})]});if(_0xf3ace6===_0x593640(0xf8))return a3_0x481274(Box,{'flexDirection':_0x593640(0xf7),'marginTop':0x1,'children':[a3_0x437e63(Box,{'children':a3_0x437e63(Text,{'color':_0x593640(0xef),'bold':!![],'children':_0x593640(0xed)})}),_0x461165&&a3_0x437e63(Box,{'marginTop':0x1,'children':a3_0x481274(Text,{'color':_0x593640(0x129),'children':['✗\x20',_0x461165]})}),a3_0x481274(Box,{'marginTop':0x1,'flexDirection':_0x593640(0xf7),'children':[a3_0x437e63(Text,{'bold':!![],'color':_0x593640(0x101),'children':_0x593640(0x119)}),MCP_IDE_LIST['map']((_0x129945,_0x18145a)=>{const _0x2565b9=_0x593640,_0x1ae866=_0x33ce51===_0x18145a,_0xbd7f76=_0x5dcda8[_0x2565b9(0x110)](_0x18145a);return a3_0x437e63(Box,{'children':a3_0x481274(Text,{'backgroundColor':_0x1ae866?_0x2565b9(0xfe):undefined,'color':_0x1ae866?_0x2565b9(0xfa):undefined,'children':[_0xbd7f76?_0x2565b9(0x10f):'[\x20]','\x20',_0x129945===_0x2565b9(0x111)?'Cursor':_0x2565b9(0x11b)]})},_0x2565b9(0x121)+_0x129945);}),a3_0x437e63(Box,{'marginTop':0x1,'children':a3_0x437e63(Text,{'bold':!![],'color':_0x593640(0x101),'children':_0x593640(0x10d)})}),SKILL_IDE_LIST['map']((_0x37ff44,_0x2abcef)=>{const _0x369a0d=_0x593640,_0x27f08e=_0x2abcef+MCP_IDE_LIST[_0x369a0d(0x115)],_0x48d274=_0x33ce51===_0x27f08e,_0x3aac7f=_0x4532c5[_0x369a0d(0x110)](_0x27f08e);return a3_0x437e63(Box,{'children':a3_0x481274(Text,{'backgroundColor':_0x48d274?_0x369a0d(0xfe):undefined,'color':_0x48d274?'white':undefined,'children':[_0x3aac7f?_0x369a0d(0x10f):_0x369a0d(0x11d),'\x20',SKILL_IDE_CONFIGS[_0x37ff44]['name']]})},_0x369a0d(0x108)+_0x37ff44);}),a3_0x437e63(Box,{'marginTop':0x1,'children':a3_0x437e63(Text,{'color':_0x593640(0x112),'children':'↑/↓:\x20移动\x20空格:\x20切换\x20a:\x20全选\x20q:\x20退出\x20Enter:\x20确认'})})]})]});if(_0xf3ace6===_0x593640(0xfb))return a3_0x437e63(Box,{'flexDirection':'column','marginTop':0x1,'children':a3_0x437e63(Box,{'children':a3_0x437e63(Text,{'children':_0x593640(0x104)})})});if(_0xf3ace6==='done')return null;return null;}const MCP_IDE_CONFIGS={'cursor':{'name':a3_0x3e245f(0x10e)},'claude':{'name':'Claude\x20Code'}};
@@ -1 +1 @@
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
+ const a4_0x51f940=a4_0x3d57;(function(_0x718f79,_0x5aeb06){const _0x15752b=a4_0x3d57,_0x4bdfe8=_0x718f79();while(!![]){try{const _0x3773bb=-parseInt(_0x15752b(0x10c))/0x1*(parseInt(_0x15752b(0xef))/0x2)+-parseInt(_0x15752b(0x11b))/0x3*(parseInt(_0x15752b(0x10a))/0x4)+parseInt(_0x15752b(0xd7))/0x5*(-parseInt(_0x15752b(0xdf))/0x6)+parseInt(_0x15752b(0x121))/0x7*(parseInt(_0x15752b(0xe6))/0x8)+parseInt(_0x15752b(0xf5))/0x9*(parseInt(_0x15752b(0x10e))/0xa)+-parseInt(_0x15752b(0xed))/0xb*(parseInt(_0x15752b(0xde))/0xc)+parseInt(_0x15752b(0x105))/0xd;if(_0x3773bb===_0x5aeb06)break;else _0x4bdfe8['push'](_0x4bdfe8['shift']());}catch(_0x2c7ab5){_0x4bdfe8['push'](_0x4bdfe8['shift']());}}}(a4_0x2876,0x74bf9));function a4_0x2876(){const _0x272d52=['\x20\x20\x20\x20\x20\x20\x22command\x22:\x20\x22','请手动执行:\x20','2.0.0','.lovrabet','99yJWgAt','LOVRABET_ENV','\x20\x20\x20\x20\x20\x20\x22env\x22:\x20{','env','创建\x20Cursor\x20Rules\x20文件','lovrabet-dataset','log','error','parse','\x20\x20重启\x20Claude\x20Code\x20后生效\x0a','\x20\x20\x20\x20\x20\x20\x20\x20\x22LOVRABET_ENV\x22:\x20\x22','复制\x20Cursor\x20Rules\x20文件失败','\x20\x20AppCode:\x20','不支持的\x20MCP\x20IDE:\x20','isDirectory','创建\x20agents.md\x20文件','15440568HYPVPw','utf-8','info','cwd','rules','12zWMThs','mcpServers','2WrBGHy','manual','580660jXTjhK','map','Cursor','mcp-install','共享技能文件复制成功','\x20\x20}','npx','已写入\x20.cursor/mcp.json','创建技能包\x20manifest','复制\x20agents.md\x20文件失败','Claude\x20Code\x20MCP\x20命令已生成','\x0a📋\x20请执行以下命令配置\x20Claude\x20Code\x20MCP:\x0a','\x20\x20\x20\x20}','715389jNWGee','mcp.json','\x22:\x20{','agents.md','name','.cursor','88018aCVOug','\x0a📋\x20其他\x20IDE\x20MCP\x20配置:\x0a','app','join','共享技能文件复制失败','message','stringify','\x20\x20\x20\x20\x22','appcode','85795qjvcqO','Claude\x20Code','配置信息:','Cursor\x20MCP\x20配置失败','Cursor\x20MCP\x20配置成功','cursor','已创建\x20','348FuhPzI','150coyfQh','../../cdn-source/skills','配置指引已显示','\x20-e\x20LOVRABET_APP_CODE=','.lovrabet/skill/.shared','需要先配置\x20appcode','skill-install','136BUTJxp','\x20\x20\x20\x20\x20\x20\x22args\x22:\x20[','.lovrabet/skill-manifest.json','\x20\x20\x20\x20\x20\x20\x20\x20\x22LOVRABET_APP_CODE\x22:\x20\x22','@lovrabet/dataset-mcp-server@latest','online','其他\x20IDE\x20配置指引已显示','18799ZrGbWd','success','368094FkLPOM','lovrabet_rules.mdc'];a4_0x2876=function(){return _0x272d52;};return a4_0x2876();}import{existsSync,mkdirSync,writeFileSync,readFileSync,copyFileSync}from'node:fs';import{join,resolve,dirname}from'node:path';import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';import{IDE_CONFIGS}from'../utils/ai_config.js';import{installSingleIDE}from'../skills/skill-installer.js';function a4_0x3d57(_0x2ebca1,_0x57d9a3){_0x2ebca1=_0x2ebca1-0xd1;const _0x287676=a4_0x2876();let _0x3d5780=_0x287676[_0x2ebca1];return _0x3d5780;}import{fetchGuidesFromCDN,writeGuidesToProject}from'../utils/guides-cdn.js';import{getRulesContent}from'../utils/rules-cdn.js';const __dirname=dirname(fileURLToPath(import.meta.url)),MCP_SERVER_NAME=a4_0x51f940(0xfa),MCP_COMMAND=a4_0x51f940(0x114),MCP_ARGS=[a4_0x51f940(0xea)];export function buildEnvConfig(_0x47aed3,_0x5708a6){const _0x2c1479=a4_0x51f940,_0x4f9742={'LOVRABET_APP_CODE':String(_0x47aed3)};return _0x5708a6!==_0x2c1479(0xeb)&&(_0x4f9742[_0x2c1479(0xf6)]=String(_0x5708a6)),_0x4f9742;}export async function configureCursorMcp(_0x1c5ab8){const _0x2c62f3=a4_0x51f940,_0x55d51a=_0x1c5ab8||process[_0x2c62f3(0x108)](),_0x4d149e=readConfig(_0x55d51a),_0x3efbd7=_0x4d149e['appcode']||_0x4d149e[_0x2c62f3(0x123)],_0xa58114=_0x4d149e[_0x2c62f3(0xf8)]||'online';if(!_0x3efbd7)return{'ide':_0x2c62f3(0x110),'status':_0x2c62f3(0xfc),'message':_0x2c62f3(0xe4)};const _0x14eeb5=buildEnvConfig(_0x3efbd7,_0xa58114),_0x2ad869={'command':MCP_COMMAND,'args':MCP_ARGS,'env':_0x14eeb5},_0x43bdb5=join(_0x55d51a,_0x2c62f3(0x120),_0x2c62f3(0x11c)),_0x2c4d4c=join(_0x55d51a,_0x2c62f3(0x120));try{!existsSync(_0x2c4d4c)&&mkdirSync(_0x2c4d4c,{'recursive':!![]});let _0x5f1911={'mcpServers':{}};if(existsSync(_0x43bdb5)){const _0x5ab731=readFileSync(_0x43bdb5,_0x2c62f3(0x106));_0x5f1911=JSON[_0x2c62f3(0xfd)](_0x5ab731);}return(!_0x5f1911[_0x2c62f3(0x10b)]||typeof _0x5f1911[_0x2c62f3(0x10b)]!=='object')&&(_0x5f1911[_0x2c62f3(0x10b)]={}),_0x5f1911[_0x2c62f3(0x10b)][MCP_SERVER_NAME]=_0x2ad869,writeFileSync(_0x43bdb5,JSON['stringify'](_0x5f1911,null,0x2),_0x2c62f3(0x106)),logger[_0x2c62f3(0x107)](_0x2c62f3(0x111),_0x2c62f3(0xdb),{'appcode':_0x3efbd7,'env':_0xa58114,'path':_0x43bdb5}),await copyCursorRules(_0x2c4d4c),{'ide':'Cursor','status':'success','message':_0x2c62f3(0x115)};}catch(_0x1f3018){return logger[_0x2c62f3(0xfc)](_0x2c62f3(0x111),_0x2c62f3(0xda),{'error':_0x1f3018 instanceof Error?_0x1f3018['message']:String(_0x1f3018)}),{'ide':_0x2c62f3(0x110),'status':_0x2c62f3(0xfc),'message':_0x1f3018 instanceof Error?_0x1f3018[_0x2c62f3(0xd3)]:String(_0x1f3018)};}}export async function configureClaudeMcp(_0x16d406){const _0x4d452b=a4_0x51f940,_0x35da94=_0x16d406||process[_0x4d452b(0x108)](),_0x5f3ab2=readConfig(_0x35da94),_0x461f56=_0x5f3ab2[_0x4d452b(0xd6)]||_0x5f3ab2['app'],_0x5f3416=_0x5f3ab2[_0x4d452b(0xf8)]||_0x4d452b(0xeb);if(!_0x461f56)return{'ide':_0x4d452b(0xd8),'status':'error','message':'需要先配置\x20appcode'};let _0x19b8ae='claude\x20mcp\x20add\x20'+MCP_SERVER_NAME+'\x20'+MCP_COMMAND+'\x20'+MCP_ARGS[_0x4d452b(0xd1)]('\x20')+_0x4d452b(0xe2)+_0x461f56;return _0x5f3416!==_0x4d452b(0xeb)&&(_0x19b8ae+='\x20-e\x20LOVRABET_ENV='+_0x5f3416),await copyAgentsMd(_0x35da94),logger[_0x4d452b(0x107)](_0x4d452b(0x111),_0x4d452b(0x118),{'command':_0x19b8ae,'appcode':_0x461f56,'env':_0x5f3416}),console[_0x4d452b(0xfb)](_0x4d452b(0x119)),console[_0x4d452b(0xfb)]('\x20\x20'+_0x19b8ae+'\x0a'),console[_0x4d452b(0xfb)](_0x4d452b(0xd9)),console[_0x4d452b(0xfb)](_0x4d452b(0x101)+_0x461f56),_0x5f3416!=='online'&&console[_0x4d452b(0xfb)]('\x20\x20环境:\x20'+_0x5f3416),console[_0x4d452b(0xfb)](_0x4d452b(0xfe)),{'ide':'Claude\x20Code','status':_0x4d452b(0x10d),'message':_0x4d452b(0xf2)+_0x19b8ae};}export async function showOtherGuide(_0xb9889){const _0x1f5445=a4_0x51f940,_0x25b259=_0xb9889||process[_0x1f5445(0x108)](),_0x56b3c5=readConfig(_0x25b259),_0x1c368a=_0x56b3c5[_0x1f5445(0xd6)]||_0x56b3c5['app'],_0x4bafdd=_0x56b3c5[_0x1f5445(0xf8)]||_0x1f5445(0xeb);if(!_0x1c368a)return{'ide':'其他','status':_0x1f5445(0xfc),'message':_0x1f5445(0xe4)};return console['log'](_0x1f5445(0x122)),console[_0x1f5445(0xfb)]('{'),console[_0x1f5445(0xfb)]('\x20\x20\x22mcpServers\x22:\x20{'),console[_0x1f5445(0xfb)](_0x1f5445(0xd5)+MCP_SERVER_NAME+_0x1f5445(0x11d)),console[_0x1f5445(0xfb)](_0x1f5445(0xf1)+MCP_COMMAND+'\x22,'),console[_0x1f5445(0xfb)](_0x1f5445(0xe7)+MCP_ARGS[_0x1f5445(0x10f)](_0x46a98b=>'\x22'+_0x46a98b+'\x22')['join'](',\x20')+'],'),console[_0x1f5445(0xfb)](_0x1f5445(0xf7)),console[_0x1f5445(0xfb)](_0x1f5445(0xe9)+_0x1c368a+'\x22,'),_0x4bafdd!=='online'&&console['log'](_0x1f5445(0xff)+_0x4bafdd+'\x22,'),console[_0x1f5445(0xfb)]('\x20\x20\x20\x20\x20\x20}'),console[_0x1f5445(0xfb)](_0x1f5445(0x11a)),console[_0x1f5445(0xfb)](_0x1f5445(0x113)),console[_0x1f5445(0xfb)]('}\x0a'),logger[_0x1f5445(0x107)]('mcp-install',_0x1f5445(0xec),{'appcode':_0x1c368a,'env':_0x4bafdd}),{'ide':'其他','status':_0x1f5445(0x10d),'message':_0x1f5445(0xe1)};}export async function configureMcp(_0x8586bf,_0x29e61f){const _0x1afbdd=a4_0x51f940;switch(_0x8586bf){case _0x1afbdd(0xdc):return await configureCursorMcp(_0x29e61f);case'claude':return await configureClaudeMcp(_0x29e61f);default:throw new Error(_0x1afbdd(0x102)+_0x8586bf);}}async function copyCursorRules(_0xf6cc8c){const _0x21a9f6=a4_0x51f940,_0x277b85=join(_0xf6cc8c,_0x21a9f6(0x109)),_0x38909f=join(_0x277b85,_0x21a9f6(0xf0));if(existsSync(_0x38909f))return;try{!existsSync(_0x277b85)&&mkdirSync(_0x277b85,{'recursive':!![]});const _0x206a18=await getRulesContent();writeFileSync(_0x38909f,_0x206a18,_0x21a9f6(0x106)),logger[_0x21a9f6(0x107)]('mcp-install',_0x21a9f6(0xf9),{'to':_0x38909f});}catch(_0x2a0c80){logger['error']('mcp-install',_0x21a9f6(0x100),{'error':_0x2a0c80 instanceof Error?_0x2a0c80[_0x21a9f6(0xd3)]:String(_0x2a0c80)});}}async function copyAgentsMd(_0x33315d){const _0x55f255=a4_0x51f940,_0x9b3048=join(_0x33315d,_0x55f255(0x11e));if(existsSync(_0x9b3048))return;try{const _0x1c6d1e=await getRulesContent();writeFileSync(_0x9b3048,_0x1c6d1e,_0x55f255(0x106)),logger[_0x55f255(0x107)]('mcp-install',_0x55f255(0x104),{'to':_0x9b3048});}catch(_0x70cbfc){logger[_0x55f255(0xfc)](_0x55f255(0x111),_0x55f255(0x117),{'error':_0x70cbfc instanceof Error?_0x70cbfc['message']:String(_0x70cbfc)});}}export const SKILL_IDE_CONFIGS=IDE_CONFIGS;export async function installSkill(_0x169ccf,_0x1e77bc){const _0x4020f7=a4_0x51f940,_0x53a33f=_0x1e77bc||process[_0x4020f7(0x108)](),_0x35ae02=resolve(__dirname,_0x4020f7(0xe0)),_0x2d50fe=SKILL_IDE_CONFIGS[_0x169ccf];if(!_0x2d50fe)return{'ide':_0x169ccf,'status':_0x4020f7(0xfc),'message':'未知的\x20IDE:\x20'+_0x169ccf};const _0x5326f7=_0x2d50fe[_0x4020f7(0x11f)];try{let _0x186dca;try{_0x186dca=await fetchGuidesFromCDN();}catch{}const _0x4df3d8=await installSingleIDE(_0x169ccf,_0x2d50fe,_0x53a33f,_0x35ae02,_0x186dca);return _0x186dca&&writeGuidesToProject(_0x186dca,_0x53a33f),logger['info'](_0x4020f7(0xe5),_0x5326f7+'\x20技能包安装成功',{'ide':_0x169ccf,'filesCount':_0x4df3d8}),{'ide':_0x5326f7,'status':_0x4020f7(0xee),'message':_0x4020f7(0xdd)+_0x4df3d8+'\x20项'};}catch(_0x26b2c6){return logger['error']('skill-install',_0x5326f7+'\x20技能包安装失败',{'error':_0x26b2c6 instanceof Error?_0x26b2c6['message']:String(_0x26b2c6)}),{'ide':_0x5326f7,'status':_0x4020f7(0xfc),'message':_0x26b2c6 instanceof Error?_0x26b2c6[_0x4020f7(0xd3)]:String(_0x26b2c6)};}}async function copyDir(_0x96e42b,_0x30671a){const _0x335f25=a4_0x51f940,{statSync:_0x499c8b}=await import('node:fs'),{readdirSync:_0x2f4797}=await import('node:fs'),_0x36efc5=_0x499c8b(_0x96e42b);if(_0x36efc5[_0x335f25(0x103)]()){!existsSync(_0x30671a)&&mkdirSync(_0x30671a,{'recursive':!![]});const _0x352ea5=_0x2f4797(_0x96e42b);for(const _0x36c7c4 of _0x352ea5){await copyDir(join(_0x96e42b,_0x36c7c4),join(_0x30671a,_0x36c7c4));}}else copyFileSync(_0x96e42b,_0x30671a);}export async function copySharedSkills(_0x6a5c54){const _0x4a341c=a4_0x51f940,_0x1e9dbb=_0x6a5c54||process[_0x4a341c(0x108)](),_0x5462fb=resolve(__dirname,'../../cdn-source/skills'),_0x152d82=join(_0x5462fb,'.shared'),_0x3fd72f=join(_0x1e9dbb,_0x4a341c(0xe3));if(!existsSync(_0x152d82))return![];try{return await copyDir(_0x152d82,_0x3fd72f),logger['info']('skill-install',_0x4a341c(0x112),{'path':_0x3fd72f}),!![];}catch(_0x19ce65){return logger[_0x4a341c(0xfc)](_0x4a341c(0xe5),_0x4a341c(0xd2),{'error':_0x19ce65 instanceof Error?_0x19ce65[_0x4a341c(0xd3)]:String(_0x19ce65)}),![];}}export function createSkillManifest(_0x2c8f42,_0x1af344){const _0x35e7c8=a4_0x51f940,_0x506df5={'version':_0x35e7c8(0xf3),'installedAt':new Date()['toISOString'](),'platforms':_0x1af344},_0xd30a8=join(_0x2c8f42,_0x35e7c8(0xe8)),_0x43d993=join(_0x2c8f42,_0x35e7c8(0xf4));!existsSync(_0x43d993)&&mkdirSync(_0x43d993,{'recursive':!![]}),writeFileSync(_0xd30a8,JSON[_0x35e7c8(0xd4)](_0x506df5,null,0x2),'utf-8'),logger[_0x35e7c8(0x107)]('skill-install',_0x35e7c8(0x116),{'path':_0xd30a8});}
@@ -1 +1 @@
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
+ (function(_0x5065c2,_0x1f102e){const _0x3e41c3=a5_0x2e5b,_0x549985=_0x5065c2();while(!![]){try{const _0x12cdd1=parseInt(_0x3e41c3(0x170))/0x1*(-parseInt(_0x3e41c3(0x198))/0x2)+parseInt(_0x3e41c3(0x19b))/0x3+parseInt(_0x3e41c3(0x184))/0x4+-parseInt(_0x3e41c3(0x17a))/0x5+-parseInt(_0x3e41c3(0x191))/0x6+-parseInt(_0x3e41c3(0x179))/0x7+-parseInt(_0x3e41c3(0x194))/0x8*(-parseInt(_0x3e41c3(0x187))/0x9);if(_0x12cdd1===_0x1f102e)break;else _0x549985['push'](_0x549985['shift']());}catch(_0x5dfa4c){_0x549985['push'](_0x549985['shift']());}}}(a5_0x5278,0x9198e));import{jsx as a5_0x135684,jsxs as a5_0x4ddc64,Fragment as a5_0x38366a}from'react/jsx-runtime';function a5_0x2e5b(_0x4d4b6e,_0x3bc62f){_0x4d4b6e=_0x4d4b6e-0x163;const _0x527847=a5_0x5278();let _0x2e5b6d=_0x527847[_0x4d4b6e];return _0x2e5b6d;}import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';import{initEnv}from'../constant/env.js';import{fetchModelList}from'./fetch-model-list.js';import{generateDatasetDocs}from'./api-doc.js';function a5_0x5278(){const _0x288283=['white','指定的数据集代码都不存在:\x20','.md\x20(','map','string','⚠️\x20以下数据集生成失败:','898336gjcoSQ','\x20-\x20','length','18vjJMLL','使用指定的应用AppCode:\x20','使用配置的应用AppCode:\x20','\x20个匹配的数据集\x1b[0m','文档生成失败:\x20','./docs','column','\x20重新登录后再试','\x20个数据集中筛选出\x20','cwd','397338EscvhR','includes','datasetName','10120960LdbuEJ','未找到任何数据集','error','*\x20输出目录:\x20','43606rntyMg','*\x20共处理\x20','\x20(环境:\x20','1508706ZMChwL','online','datasetCode','message','\x1b[0m','dim','cyan','api-doc','正在生成\x20','🚀\x20','\x20个数据集','env','lovrabet\x20auth',',\x20失败\x20','26owIQYn','success','green','\x1b[33m!\x20以下数据集代码不存在:\x20','log','yellow','gray','\x20个数据集的文档...','red','7616609JNPdAG','4700860uPJaRh','💡\x20请使用\x20','join','filter'];a5_0x5278=function(){return _0x288283;};return a5_0x5278();}import{logger}from'../utils/logger.js';export const ApiDocUI=({appCode:_0x47be60,env:_0x5f2add,output:_0x392663,extraParams:_0x1682c0,datasetCodes:_0x445989})=>{const _0x3f4c17=a5_0x2e5b,{exit:_0x3b355f}=useApp(),[_0x231657,_0x3ff818]=useState(![]),[_0x533fc8,_0x40f857]=useState(''),[_0x5b452f,_0x494f80]=useState(![]),[_0x573d92,_0x4df07b]=useState(null),[_0x22e5dc,_0x5a4f07]=useState(null),[_0x59427b,_0x5c04a3]=useState(0x0),_0x15f5a6=readConfig(),_0x1e82bb=getConfigAppCode(),_0x56a3db=_0x47be60||_0x1e82bb,_0x37ce30=typeof _0x15f5a6?.[_0x3f4c17(0x16d)]===_0x3f4c17(0x182)?_0x15f5a6[_0x3f4c17(0x16d)]:undefined,_0x31fa05=_0x5f2add||_0x37ce30||_0x3f4c17(0x163);initEnv(_0x31fa05);const _0x293a5b=_0x392663||_0x3f4c17(0x18c),_0x1da65d=_0x47be60?_0x3f4c17(0x188)+_0x56a3db:_0x3f4c17(0x189)+_0x56a3db;useEffect(()=>{_0x3ff818(!![]),_0x2254f6();},[]),useEffect(()=>{(_0x5b452f||_0x573d92)&&_0x3b355f();},[_0x5b452f,_0x573d92,_0x3b355f]);async function _0x2254f6(){const _0x335dd0=_0x3f4c17;if(!_0x56a3db){_0x4df07b('未提供应用AppCode,且配置中也没有默认值');return;}try{logger['setLogPath'](process[_0x335dd0(0x190)]()),_0x40f857('正在获取数据集列表...');const {configArray:_0x3cde50}=await fetchModelList(_0x56a3db);_0x5c04a3(_0x3cde50['length']);if(_0x3cde50[_0x335dd0(0x186)]===0x0){_0x4df07b(_0x335dd0(0x195));return;}let _0x193315=_0x3cde50;if(_0x445989&&_0x445989['length']>0x0){_0x193315=_0x3cde50[_0x335dd0(0x17d)](_0xa36906=>_0x445989[_0x335dd0(0x192)](_0xa36906[_0x335dd0(0x164)]));const _0x4ad33c=_0x193315[_0x335dd0(0x181)](_0x2f70f8=>_0x2f70f8[_0x335dd0(0x164)]),_0x542c37=_0x445989['filter'](_0x153065=>!_0x4ad33c['includes'](_0x153065));_0x542c37[_0x335dd0(0x186)]>0x0&&console[_0x335dd0(0x174)](_0x335dd0(0x173)+_0x542c37[_0x335dd0(0x17c)](',\x20')+_0x335dd0(0x166));if(_0x193315['length']===0x0){_0x4df07b(_0x335dd0(0x17f)+_0x445989['join'](',\x20'));return;}console[_0x335dd0(0x174)]('\x1b[90m*\x20从\x20'+_0x3cde50[_0x335dd0(0x186)]+_0x335dd0(0x18f)+_0x193315[_0x335dd0(0x186)]+_0x335dd0(0x18a));}_0x40f857(_0x335dd0(0x16a)+_0x193315['length']+_0x335dd0(0x177));const _0x1271f4=await generateDatasetDocs(_0x193315,_0x56a3db,_0x293a5b,(_0x3e5fa6,_0x1bee28,_0x51b10d)=>{const _0x8fa42e=_0x335dd0;_0x40f857(_0x8fa42e(0x16a)+_0x51b10d+_0x8fa42e(0x180)+_0x3e5fa6+'/'+_0x1bee28+')');},_0x1682c0);_0x5a4f07(_0x1271f4),_0x494f80(!![]);const _0x34394d=_0x1271f4[_0x335dd0(0x17d)](_0x1a0fe4=>_0x1a0fe4[_0x335dd0(0x171)])['length'],_0x587178=_0x1271f4[_0x335dd0(0x17d)](_0x2ea2e1=>!_0x2ea2e1[_0x335dd0(0x171)])['length'];logger[_0x335dd0(0x171)](_0x335dd0(0x169),'文档生成完成',undefined,{'totalCount':_0x1271f4['length'],'successCount':_0x34394d,'failCount':_0x587178,'outputDir':_0x293a5b});}catch(_0x2c900a){const _0x374309=_0x2c900a instanceof Error?_0x2c900a[_0x335dd0(0x165)]:String(_0x2c900a);logger['error'](_0x335dd0(0x169),_0x335dd0(0x18b)+_0x374309,{'appCode':_0x56a3db,'outputDir':_0x293a5b}),_0x4df07b('文档生成失败:\x20'+_0x374309);}finally{_0x3ff818(![]);}}const _0x9a71c5=_0x22e5dc?.['filter'](_0x20ea94=>_0x20ea94['success'])['length']||0x0,_0x571233=_0x22e5dc?.['filter'](_0x2c801=>!_0x2c801[_0x3f4c17(0x171)])['length']||0x0;return a5_0x4ddc64(Box,{'flexDirection':_0x3f4c17(0x18d),'children':[(_0x231657||_0x5b452f)&&a5_0x4ddc64(Box,{'children':[a5_0x135684(Text,{'color':'gray','children':'*\x20'}),a5_0x135684(Text,{'color':_0x47be60?_0x3f4c17(0x17e):_0x3f4c17(0x167),'children':_0x1da65d})]}),_0x231657&&a5_0x135684(Box,{'children':a5_0x4ddc64(Text,{'children':[_0x3f4c17(0x16b),_0x533fc8,_0x3f4c17(0x19a),_0x31fa05,')']})}),_0x5b452f&&_0x22e5dc&&a5_0x4ddc64(Box,{'flexDirection':_0x3f4c17(0x18d),'children':[a5_0x135684(Box,{'children':a5_0x4ddc64(Text,{'color':_0x3f4c17(0x172),'children':['√\x20文档生成完成!成功\x20',_0x9a71c5,'\x20个',_0x571233>0x0&&_0x3f4c17(0x16f)+_0x571233+'\x20个']})}),a5_0x135684(Box,{'marginTop':0x1,'children':a5_0x4ddc64(Text,{'color':'gray','children':[_0x3f4c17(0x199),_0x59427b,_0x3f4c17(0x16c)]})}),a5_0x4ddc64(Box,{'marginTop':0x1,'children':[a5_0x135684(Text,{'color':_0x3f4c17(0x176),'children':_0x3f4c17(0x197)}),a5_0x135684(Text,{'color':_0x3f4c17(0x168),'children':_0x293a5b})]}),_0x9a71c5>0x0&&a5_0x4ddc64(a5_0x38366a,{'children':[a5_0x135684(Box,{'marginTop':0x1,'children':a5_0x135684(Text,{'color':'gray','children':'*\x20生成的文档文件:'})}),_0x22e5dc[_0x3f4c17(0x17d)](_0x46b477=>_0x46b477['success'])[_0x3f4c17(0x181)]((_0x2f09ab,_0x5e0bd0)=>a5_0x4ddc64(Box,{'marginLeft':0x2,'children':[a5_0x4ddc64(Text,{'color':_0x3f4c17(0x168),'children':['•\x20',_0x2f09ab['filePath']]}),a5_0x4ddc64(Text,{'color':'dim','children':[_0x3f4c17(0x185),_0x2f09ab[_0x3f4c17(0x193)]]})]},_0x5e0bd0))]}),_0x571233>0x0&&a5_0x4ddc64(a5_0x38366a,{'children':[a5_0x135684(Box,{'marginTop':0x1,'children':a5_0x135684(Text,{'color':_0x3f4c17(0x175),'children':_0x3f4c17(0x183)})}),_0x22e5dc[_0x3f4c17(0x17d)](_0x252b53=>!_0x252b53[_0x3f4c17(0x171)])[_0x3f4c17(0x181)]((_0x5700dd,_0x2066ce)=>a5_0x4ddc64(Box,{'marginLeft':0x2,'flexDirection':_0x3f4c17(0x18d),'children':[a5_0x4ddc64(Text,{'color':_0x3f4c17(0x178),'children':['•\x20',_0x5700dd[_0x3f4c17(0x193)],'\x20(',_0x5700dd[_0x3f4c17(0x164)],')']}),_0x5700dd['error']&&a5_0x135684(Box,{'marginLeft':0x2,'children':a5_0x135684(Text,{'color':_0x3f4c17(0x167),'children':_0x5700dd[_0x3f4c17(0x196)]})})]},_0x2066ce))]})]}),_0x573d92&&a5_0x4ddc64(Box,{'flexDirection':'column','children':[a5_0x135684(Box,{'children':a5_0x4ddc64(Text,{'color':'red','children':['❌\x20',_0x573d92]})}),_0x573d92[_0x3f4c17(0x192)]('登录')&&a5_0x4ddc64(Box,{'marginTop':0x1,'children':[a5_0x135684(Text,{'color':'yellow','children':_0x3f4c17(0x17b)}),a5_0x135684(Text,{'color':_0x3f4c17(0x168),'children':_0x3f4c17(0x16e)}),a5_0x135684(Text,{'color':'yellow','children':_0x3f4c17(0x18e)})]})]})]});};
@@ -1 +1 @@
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
+ const a6_0x25d4b4=a6_0x2c01;(function(_0x488ad7,_0x35cd65){const _0x44d4e5=a6_0x2c01,_0x192c3f=_0x488ad7();while(!![]){try{const _0x47f103=-parseInt(_0x44d4e5(0x12a))/0x1+-parseInt(_0x44d4e5(0x112))/0x2+parseInt(_0x44d4e5(0x11c))/0x3+parseInt(_0x44d4e5(0x133))/0x4+-parseInt(_0x44d4e5(0x10f))/0x5+parseInt(_0x44d4e5(0x125))/0x6+parseInt(_0x44d4e5(0x135))/0x7;if(_0x47f103===_0x35cd65)break;else _0x192c3f['push'](_0x192c3f['shift']());}catch(_0xa7dc8f){_0x192c3f['push'](_0x192c3f['shift']());}}}(a6_0x4ebd,0xeba96));function a6_0x4ebd(){const _0x5f160c=['datasetCode','6522870ymdKKq','等待\x203\x20秒...\x0a','message','生成文档失败:\x20','push','1656987SKcMpU','name','application/json','join','data','api-doc','success','utf8','./docs','5797852amlKCo','✗\x20失败:\x20','8813266XcsdVU','\x20个数据集需要生成文档\x0a','7680635olOPKQ','):缺少\x20data.markdown\x20字段','error','828122eNKFzS','POST','✓\x20成功生成:\x20','响应数据格式错误\x20(','status','.md\x20(','text','获取文档失败\x20(','.md','log','2330397ETxaVD','markdown','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','),HTTP状态码:\x20','stringify','生成文档成功:\x20','json','tableName'];a6_0x4ebd=function(){return _0x5f160c;};return a6_0x4ebd();}function a6_0x2c01(_0x44a1bd,_0x3a7b0e){_0x44a1bd=_0x44a1bd-0x10e;const _0x4ebdb3=a6_0x4ebd();let _0x2c011c=_0x4ebdb3[_0x44a1bd];return _0x2c011c;}import{mkdirSync,writeFileSync}from'node:fs';import a6_0x48c874 from'node:path';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';export async function fetchDatasetDoc(_0x29e1bc){const _0xf8adf6=a6_0x2c01,{appCode:_0x28d65d,datasetCode:_0x3daa63,datasetId:_0x578006,extraParams:_0x1212d9}=_0x29e1bc,_0x388080=getApiDomain(),_0x33c8b3=_0x388080+'/api/node-toolbox/api-doc-generator',_0xb1197={'appCode':_0x28d65d,'datasetCode':_0x3daa63,'datasetId':_0x578006,..._0x1212d9||{}},_0x325319=await fetch(_0x33c8b3,{'method':_0xf8adf6(0x113),'headers':{'Content-Type':_0xf8adf6(0x12c),'Cookie':getCookie()},'body':JSON[_0xf8adf6(0x120)](_0xb1197)});if(!_0x325319['ok']){if(_0x325319[_0xf8adf6(0x116)]===0x191)throw new Error(_0xf8adf6(0x11e));let _0x809084='';try{_0x809084=await _0x325319[_0xf8adf6(0x118)]();}catch(_0x83dd90){}throw new Error(_0xf8adf6(0x119)+_0x3daa63+_0xf8adf6(0x11f)+_0x325319['status']+(_0x809084?'\x0a'+_0x809084:''));}const _0xf1ca71=await _0x325319[_0xf8adf6(0x122)]();if(!_0xf1ca71[_0xf8adf6(0x12e)]||typeof _0xf1ca71[_0xf8adf6(0x12e)]['markdown']!=='string')throw new Error(_0xf8adf6(0x115)+_0x3daa63+_0xf8adf6(0x110));return _0xf1ca71[_0xf8adf6(0x12e)][_0xf8adf6(0x11d)];}function delay(_0x59014e){return new Promise(_0x1f5c2c=>setTimeout(_0x1f5c2c,_0x59014e));}export async function generateDatasetDocs(_0x3ae0cd,_0x386227,_0x255c1c=a6_0x25d4b4(0x132),_0x1ebf9a,_0x562d82){const _0x401a9e=a6_0x25d4b4;mkdirSync(_0x255c1c,{'recursive':!![]});const _0x625098=[],_0xb5c512=_0x3ae0cd['length'];console[_0x401a9e(0x11b)]('\x0a共有\x20'+_0xb5c512+_0x401a9e(0x10e));for(let _0x3251cd=0x0;_0x3251cd<_0x3ae0cd['length'];_0x3251cd++){const _0x1a3fec=_0x3ae0cd[_0x3251cd],_0x1f108c=_0x3251cd+0x1,_0x202585=_0x1a3fec[_0x401a9e(0x123)];try{console['log']('['+_0x1f108c+'/'+_0xb5c512+']\x20正在生成:\x20'+_0x202585+_0x401a9e(0x117)+_0x1a3fec['name']+')');_0x1ebf9a&&_0x1ebf9a(_0x1f108c,_0xb5c512,_0x202585);const _0x25cc86=await fetchDatasetDoc({'appCode':_0x386227,'datasetCode':_0x1a3fec['datasetCode'],'datasetId':_0x1a3fec['id'],'enableAI':![],'extraParams':_0x562d82}),_0x4a3925=a6_0x48c874[_0x401a9e(0x12d)](_0x255c1c,_0x202585+_0x401a9e(0x11a));writeFileSync(_0x4a3925,_0x25cc86,{'encoding':_0x401a9e(0x131)}),console[_0x401a9e(0x11b)](_0x401a9e(0x114)+_0x202585+'.md'),logger[_0x401a9e(0x130)]('api-doc',_0x401a9e(0x121)+_0x202585,undefined,{'datasetCode':_0x1a3fec[_0x401a9e(0x124)],'datasetName':_0x1a3fec[_0x401a9e(0x12b)],'filePath':_0x4a3925,'progress':_0x1f108c+'/'+_0xb5c512}),_0x625098[_0x401a9e(0x129)]({'datasetCode':_0x1a3fec[_0x401a9e(0x124)],'datasetName':_0x1a3fec[_0x401a9e(0x12b)],'filePath':_0x4a3925,'success':!![]}),_0x1f108c<_0xb5c512&&await delay(0x1388);}catch(_0x225d3a){const _0x568740=_0x225d3a instanceof Error?_0x225d3a[_0x401a9e(0x127)]:String(_0x225d3a);console[_0x401a9e(0x11b)](_0x401a9e(0x134)+_0x202585+'.md\x20-\x20'+_0x568740+'\x0a'),logger[_0x401a9e(0x111)](_0x401a9e(0x12f),_0x401a9e(0x128)+_0x1a3fec[_0x401a9e(0x124)],{'datasetCode':_0x1a3fec[_0x401a9e(0x124)],'datasetName':_0x1a3fec['name'],'error':_0x568740,'progress':_0x1f108c+'/'+_0xb5c512}),_0x625098[_0x401a9e(0x129)]({'datasetCode':_0x1a3fec[_0x401a9e(0x124)],'datasetName':_0x1a3fec[_0x401a9e(0x12b)],'filePath':'','success':![],'error':_0x568740}),_0x1f108c<_0xb5c512&&(console[_0x401a9e(0x11b)](_0x401a9e(0x126)),await delay(0xbb8));}}return _0x625098;}
@@ -1 +1 @@
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
+ (function(_0x20a197,_0x2f51c9){const _0xb168f7=a7_0x188d,_0x430628=_0x20a197();while(!![]){try{const _0x56ae8d=-parseInt(_0xb168f7(0xa9))/0x1+-parseInt(_0xb168f7(0xaf))/0x2*(-parseInt(_0xb168f7(0xb4))/0x3)+parseInt(_0xb168f7(0x89))/0x4+parseInt(_0xb168f7(0x91))/0x5*(parseInt(_0xb168f7(0xa3))/0x6)+parseInt(_0xb168f7(0x8a))/0x7+parseInt(_0xb168f7(0xb1))/0x8*(parseInt(_0xb168f7(0x98))/0x9)+-parseInt(_0xb168f7(0xbc))/0xa*(parseInt(_0xb168f7(0x97))/0xb);if(_0x56ae8d===_0x2f51c9)break;else _0x430628['push'](_0x430628['shift']());}catch(_0x5b3186){_0x430628['push'](_0x430628['shift']());}}}(a7_0x3a75,0x1aed5));function a7_0x3a75(){const _0x571d29=['*\x20已生成文件:','api-pull','\x20个,过滤重复','gray','3846SosPKQ','setLogPath','\x20个模型','modelCount','\x20from\x20\x27@/','*\x20导入方式:','186986CVHLdw','cwd','./src/api/','message','duplicateCount','replace','72DaPMfU','datasetCount','56tQcbAl','includes','cyan','16590WELpzf','join','!\x20原始数据集\x20','column','length','💡\x20请使用\x20','使用指定的应用AppCode:\x20','originalCount','535540yTXJkn','green','split','\x20-\x20客户端实例文件','535080WAQCIw','855393WbSZbg','.ts','yellow','dim','white','slice','error','1180KSsHuJ','client','api','-\x20模型配置文件\x20(','string','\x20重新登录后再试','66pQryKH','15786QWiCmU','√\x20成功拉取\x20','\x20个数据集,生成','online','import\x20','-api','endsWith'];a7_0x3a75=function(){return _0x571d29;};return a7_0x3a75();}import{jsx as a7_0x33d91e,jsxs as a7_0x510311}from'react/jsx-runtime';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';import{initEnv}from'../constant/env.js';function a7_0x188d(_0x3a2400,_0x14c4b5){_0x3a2400=_0x3a2400-0x86;const _0x3a750d=a7_0x3a75();let _0x188dec=_0x3a750d[_0x3a2400];return _0x188dec;}import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';import{fetchModelList}from'./fetch-model-list.js';export const ApiPullUI=({appCode:_0x199669,env:_0x37afd1,output:_0x1fe53f})=>{const _0x7da044=a7_0x188d,{exit:_0x1c96f1}=useApp(),[_0x28c649,_0x4669a1]=useState(![]),[_0x251211,_0x1cdfef]=useState(![]),[_0x5af439,_0x5e097b]=useState(null),[_0x1b39ca,_0x52e9f2]=useState(null),_0x25ced9=readConfig(),_0x38aa27=getConfigAppCode(),_0x10b050=_0x199669||_0x38aa27,_0x5ac4e0=typeof _0x25ced9?.['env']===_0x7da044(0x95)?_0x25ced9['env']:undefined,_0x1b61d0=_0x37afd1||_0x5ac4e0||_0x7da044(0x9b);initEnv(_0x1b61d0);const _0x489758=_0x1fe53f||_0x7da044(0xab),_0x11a038=_0x199669&&_0x199669['includes']('-')?_0x199669[_0x7da044(0x87)]('-')[_0x7da044(0x8f)](0x1)[_0x7da044(0xb5)]('-'):'',_0x3779df=_0x199669?_0x7da044(0xba)+_0x10b050:'使用配置的应用AppCode:\x20'+_0x10b050,_0x366309=_0x11a038?_0x11a038+_0x7da044(0x9d):_0x7da044(0x93),_0x14b7b4=_0x11a038?_0x11a038+'-client':_0x7da044(0x92);useEffect(()=>{_0x4669a1(!![]),_0x1a0e97();},[]),useEffect(()=>{(_0x251211||_0x5af439)&&_0x1c96f1();},[_0x251211,_0x5af439,_0x1c96f1]);async function _0x1a0e97(){const _0x1ea022=_0x7da044;if(!_0x10b050){_0x5e097b('未提供应用AppCode,且配置中也没有默认值');return;}try{logger[_0x1ea022(0xa4)](process[_0x1ea022(0xaa)]());const {configArray:_0x503742}=await fetchModelList(_0x10b050),_0x4050ee=_0x503742[_0x1ea022(0xb8)],_0x4a2f4a=!_0x199669,_0x63c786=await generateApiFile(_0x503742,_0x11a038,_0x10b050,_0x4a2f4a,_0x1b61d0,_0x489758),_0x15af1e=_0x489758[_0x1ea022(0x9e)]('/')?_0x489758:_0x489758+'/';_0x52e9f2({'api':''+_0x15af1e+_0x366309+_0x1ea022(0x8b),'client':''+_0x15af1e+_0x14b7b4+_0x1ea022(0x8b),'modelCount':_0x63c786[_0x1ea022(0xa6)],'datasetCount':_0x4050ee,'originalCount':_0x4050ee,'duplicateCount':0x0}),_0x1cdfef(!![]);}catch(_0x10d140){const _0x481f44=_0x10d140 instanceof Error?_0x10d140[_0x1ea022(0xac)]:String(_0x10d140);logger[_0x1ea022(0x90)](_0x1ea022(0xa0),'拉取\x20API\x20配置失败:\x20'+_0x481f44,{'appCode':_0x10b050,'error':_0x481f44}),_0x5e097b('拉取\x20API\x20配置失败:\x20'+_0x481f44);}finally{_0x4669a1(![]);}}return a7_0x510311(Box,{'flexDirection':_0x7da044(0xb7),'children':[(_0x28c649||_0x251211)&&a7_0x510311(Box,{'children':[a7_0x33d91e(Text,{'color':_0x7da044(0xa2),'children':'*\x20'}),a7_0x33d91e(Text,{'color':_0x199669?_0x7da044(0x8e):'dim','children':_0x3779df})]}),_0x28c649&&a7_0x33d91e(Box,{'children':a7_0x510311(Text,{'children':['🚀\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20',_0x1b61d0,')']})}),_0x251211&&_0x1b39ca&&a7_0x510311(Box,{'flexDirection':_0x7da044(0xb7),'children':[a7_0x33d91e(Box,{'children':a7_0x510311(Text,{'color':_0x7da044(0x86),'children':[_0x7da044(0x99),_0x1b39ca[_0x7da044(0xb0)],_0x7da044(0x9a),'\x20',_0x1b39ca['modelCount'],_0x7da044(0xa5)]})}),_0x1b39ca[_0x7da044(0xad)]>0x0&&a7_0x33d91e(Box,{'marginTop':0x1,'children':a7_0x510311(Text,{'color':'yellow','children':[_0x7da044(0xb6),_0x1b39ca[_0x7da044(0xbb)],_0x7da044(0xa1),'\x20',_0x1b39ca['duplicateCount'],'\x20个']})}),a7_0x33d91e(Box,{'marginTop':0x1,'children':a7_0x33d91e(Text,{'color':_0x7da044(0xa2),'children':_0x7da044(0x9f)})}),a7_0x510311(Box,{'marginLeft':0x2,'children':[a7_0x510311(Text,{'color':_0x7da044(0xb3),'children':['•\x20',_0x1b39ca[_0x7da044(0x93)]]}),a7_0x510311(Text,{'color':_0x7da044(0x8d),'children':['\x20',_0x7da044(0x94),_0x1b39ca[_0x7da044(0xa6)],'\x20个模型)']})]}),a7_0x510311(Box,{'marginLeft':0x2,'children':[a7_0x510311(Text,{'color':_0x7da044(0xb3),'children':['•\x20',_0x1b39ca[_0x7da044(0x92)]]}),a7_0x33d91e(Text,{'color':'dim','children':_0x7da044(0x88)})]}),a7_0x33d91e(Box,{'marginTop':0x1,'children':a7_0x33d91e(Text,{'color':_0x7da044(0xa2),'children':_0x7da044(0xa8)})}),a7_0x33d91e(Box,{'marginLeft':0x2,'children':a7_0x510311(Text,{'color':_0x7da044(0x8c),'children':[_0x7da044(0x9c),'{\x20lovrabetClient\x20}',_0x7da044(0xa7),_0x1b39ca['client']['replace'](/^\.\//,'')[_0x7da044(0xae)](_0x7da044(0x8b),''),'\x27']})})]}),_0x5af439&&a7_0x510311(Box,{'flexDirection':_0x7da044(0xb7),'children':[a7_0x33d91e(Box,{'children':a7_0x510311(Text,{'color':'red','children':['❌\x20',_0x5af439]})}),_0x5af439[_0x7da044(0xb2)]('登录')&&a7_0x510311(Box,{'marginTop':0x1,'children':[a7_0x33d91e(Text,{'color':'yellow','children':_0x7da044(0xb9)}),a7_0x33d91e(Text,{'color':'cyan','children':'lovrabet\x20auth'}),a7_0x33d91e(Text,{'color':'yellow','children':_0x7da044(0x96)})]})]})]});};
@@ -1 +1 @@
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
+ (function(_0x248e97,_0x372600){const _0x5b0d32=a8_0x24a1,_0x4d3bf0=_0x248e97();while(!![]){try{const _0x198011=-parseInt(_0x5b0d32(0xb7))/0x1+parseInt(_0x5b0d32(0xae))/0x2*(-parseInt(_0x5b0d32(0xa8))/0x3)+parseInt(_0x5b0d32(0xa6))/0x4*(parseInt(_0x5b0d32(0xb5))/0x5)+parseInt(_0x5b0d32(0xc4))/0x6*(-parseInt(_0x5b0d32(0xa9))/0x7)+-parseInt(_0x5b0d32(0xa5))/0x8+-parseInt(_0x5b0d32(0xab))/0x9+parseInt(_0x5b0d32(0xbb))/0xa;if(_0x198011===_0x372600)break;else _0x4d3bf0['push'](_0x4d3bf0['shift']());}catch(_0x1d1e0f){_0x4d3bf0['push'](_0x4d3bf0['shift']());}}}(a8_0x234e,0x4b275));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';function a8_0x24a1(_0x1af654,_0x146b0d){_0x1af654=_0x1af654-0xa4;const _0x234e8b=a8_0x234e();let _0x24a106=_0x234e8b[_0x1af654];return _0x24a106;}import{getEnv}from'../constant/env.js';function a8_0x234e(){const _0x4a670e=['264447sDWkCu','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','Unauthorized','status','16028660APXrRO','data','UNAUTHORIZED','message','fetch-model-list','未知错误','info','errorMsg','includes','114ZINhTw','json','4493656HnCTJj','12saYobs','获取数据集失败,HTTP状态码:\x20','12KjzNUN','17143SrUYTr','count','4283028DGFrAd','&otype=array','configArray','203156LgOqvR','code','获取数据集失败:\x20','401','/api/node-toolbox/dataset/model-list?appcode=','errorCode','errorMessage','766420xrKqfX','success'];a8_0x234e=function(){return _0x4a670e;};return a8_0x234e();}export async function fetchModelList(_0x33c461){const _0x39ee2f=a8_0x24a1,_0x451821=getEnv(),_0x3fc83b=getApiDomain()+_0x39ee2f(0xb2)+_0x33c461+_0x39ee2f(0xac);logger[_0x39ee2f(0xc1)](_0x39ee2f(0xbf),'正在从服务器拉取模型列表...\x20(环境:\x20'+_0x451821+')',{'apiUrl':_0x3fc83b});const _0x4f01f4=await fetch(_0x3fc83b,{'headers':{'Cookie':getCookie()}});if(!_0x4f01f4['ok']){if(_0x4f01f4[_0x39ee2f(0xba)]===0x191)throw new Error(_0x39ee2f(0xb8));throw new Error(_0x39ee2f(0xa7)+_0x4f01f4[_0x39ee2f(0xba)]);}const _0x1178d7=await _0x4f01f4[_0x39ee2f(0xa4)]();if(!_0x1178d7[_0x39ee2f(0xb6)]){const _0x346c42=_0x1178d7[_0x39ee2f(0xc2)]||_0x1178d7[_0x39ee2f(0xbe)]||_0x1178d7[_0x39ee2f(0xbc)]?.[_0x39ee2f(0xbe)]||_0x1178d7[_0x39ee2f(0xb4)]||_0x1178d7['error']||_0x39ee2f(0xc0);if(_0x346c42[_0x39ee2f(0xc3)](_0x39ee2f(0xb1))||_0x346c42[_0x39ee2f(0xc3)](_0x39ee2f(0xb9))||_0x346c42['includes']('登录')||_0x346c42['includes']('认证')||_0x1178d7[_0x39ee2f(0xb3)]===_0x39ee2f(0xbd)||_0x1178d7['code']===0x191||_0x1178d7[_0x39ee2f(0xaf)]===_0x39ee2f(0xb1))throw new Error(_0x39ee2f(0xb8));throw new Error(_0x39ee2f(0xb0)+_0x346c42);}return{'configArray':_0x1178d7[_0x39ee2f(0xbc)][_0x39ee2f(0xad)],'count':_0x1178d7[_0x39ee2f(0xbc)][_0x39ee2f(0xaa)]};}
@@ -1 +1 @@
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};}
1
+ const a9_0x4624ba=a9_0x183e;(function(_0x54bbc6,_0x396797){const _0x1d3d9b=a9_0x183e,_0x1a9a01=_0x54bbc6();while(!![]){try{const _0x14604e=parseInt(_0x1d3d9b(0x13d))/0x1*(parseInt(_0x1d3d9b(0x154))/0x2)+parseInt(_0x1d3d9b(0x13f))/0x3+parseInt(_0x1d3d9b(0x12f))/0x4+parseInt(_0x1d3d9b(0x14a))/0x5+parseInt(_0x1d3d9b(0x142))/0x6*(parseInt(_0x1d3d9b(0x149))/0x7)+parseInt(_0x1d3d9b(0x131))/0x8*(parseInt(_0x1d3d9b(0x13c))/0x9)+parseInt(_0x1d3d9b(0x143))/0xa*(-parseInt(_0x1d3d9b(0x146))/0xb);if(_0x14604e===_0x396797)break;else _0x1a9a01['push'](_0x1a9a01['shift']());}catch(_0x451ec5){_0x1a9a01['push'](_0x1a9a01['shift']());}}}(a9_0x369d,0x334f6));import a9_0x3b0a31 from'prettier';import{mkdirSync,writeFileSync,readFileSync}from'node:fs';import a9_0x2d871c from'node:path';import{fileURLToPath}from'node:url';function a9_0x183e(_0x4befed,_0x337520){_0x4befed=_0x4befed-0x12f;const _0x369dba=a9_0x369d();let _0x183eda=_0x369dba[_0x4befed];return _0x183eda;}import{readConfig}from'../utils/config.js';function a9_0x369d(){const _0x439cb7=['467829keuOdF','templates/generate-api','forEach','235146OVxIBa','20460vITlwY','typescript','{\x20apiConfigName:\x20\x22','5269qVKkTZ','client','format','7sTXnVN','1363135IHRDNb',',\x20env:\x20\x22','length','env','.ts','join','CONFIG_NAMES.DEFAULT','API\x20文件生成成功!','online','string','1722mYDWHx','slice','955972ejebvd','api','16bertqo','init-api','\x22\x20}','utf8','replaceApiContent','datasetCode','tableName','../..','app','./src/api/','resolve','811683HamtcW','352YvpVyP','-client'];a9_0x369d=function(){return _0x439cb7;};return a9_0x369d();}import{TemplateReplacer}from'../utils/template-replacer.js';import{logger}from'../utils/logger.js';export async function generateApiFile(_0x2487ff,_0x4c2a86='',_0x351e05,_0x4b9977=![],_0x2eb05d,_0x11b986=a9_0x4624ba(0x13a)){const _0x510401=a9_0x4624ba,_0x37b5b4=readConfig(),_0x40f92e=_0x351e05||_0x37b5b4?.[_0x510401(0x139)];if(typeof _0x40f92e!==_0x510401(0x153)||!_0x40f92e)throw new Error('请先通过\x20`lovrabet\x20config\x20set\x20app\x20<value>`\x20配置应用\x20Code');const _0x3edaab=_0x4b9977?_0x510401(0x150):'\x22'+_0x40f92e+'\x22',_0xe0bcf9=typeof _0x37b5b4[_0x510401(0x14d)]===_0x510401(0x153)?_0x37b5b4[_0x510401(0x14d)]:undefined,_0x59688b=_0x2eb05d||_0xe0bcf9||_0x510401(0x152),_0x3ea8d1=_0x59688b!==_0x510401(0x152);let _0x569880;if(_0x4b9977)_0x3ea8d1?_0x569880='{\x20apiConfigName:\x20'+_0x3edaab+_0x510401(0x14b)+_0x59688b+_0x510401(0x133):_0x569880='';else{const _0x371602=_0x3ea8d1?',\x20env:\x20\x22'+_0x59688b+'\x22':'';_0x569880=_0x510401(0x145)+_0x40f92e+'\x22'+_0x371602+'\x20}';}const _0x51302b=_0x4c2a86?_0x4c2a86+'-api':_0x510401(0x130),_0x3eaabe=_0x4c2a86?_0x4c2a86+_0x510401(0x13e):_0x510401(0x147),_0x490b49=[];_0x2487ff[_0x510401(0x141)](_0x27aad3=>{const _0x2a4a9b=_0x510401;_0x490b49['push']({'datasetCode':_0x27aad3[_0x2a4a9b(0x136)],'tableName':_0x27aad3[_0x2a4a9b(0x137)],'name':_0x27aad3['name']||'','alias':_0x27aad3['alias']||_0x27aad3['key']});});const _0x579132=fileURLToPath(import.meta.url),_0x3177a2=a9_0x2d871c[_0x510401(0x13b)](a9_0x2d871c['dirname'](_0x579132),_0x510401(0x138)),_0x4880cd=a9_0x2d871c['join'](_0x3177a2,_0x510401(0x140)),_0x346df7=a9_0x2d871c[_0x510401(0x14f)](_0x4880cd,'api.ts.tpl'),_0xdf9d95=a9_0x2d871c[_0x510401(0x14f)](_0x4880cd,'client.ts.tpl'),_0x416241=_0x11b986['endsWith']('/')?_0x11b986[_0x510401(0x155)](0x0,-0x1):_0x11b986;mkdirSync(_0x416241,{'recursive':!![]});const _0xb137d2=_0x490b49[0x0]?.['alias'],_0x1a2a57=readFileSync(_0x346df7,_0x510401(0x134)),_0x3ce726=TemplateReplacer[_0x510401(0x135)](_0x1a2a57,_0x40f92e,_0x490b49,_0xb137d2,_0x51302b,_0x3edaab),_0x4e0eb2=await a9_0x3b0a31[_0x510401(0x148)](_0x3ce726,{'parser':_0x510401(0x144)}),_0x5a8443=_0x416241+'/'+_0x51302b+_0x510401(0x14e);writeFileSync(_0x5a8443,_0x4e0eb2,{'encoding':'utf8'});const _0x3e8d22=readFileSync(_0xdf9d95,_0x510401(0x134)),_0x4a2f8c=TemplateReplacer[_0x510401(0x135)](_0x3e8d22,_0x40f92e,_0x490b49,_0xb137d2,_0x51302b,_0x3edaab,_0x569880),_0x3b6796=await a9_0x3b0a31[_0x510401(0x148)](_0x4a2f8c,{'parser':_0x510401(0x144)}),_0x27bb38=_0x416241+'/'+_0x3eaabe+_0x510401(0x14e);writeFileSync(_0x27bb38,_0x3b6796,{'encoding':'utf8'});const _0x26c7f3=_0x490b49[_0x510401(0x14c)];return logger['success'](_0x510401(0x132),_0x510401(0x151),undefined,{'apiFile':_0x5a8443,'clientFile':_0x27bb38,'modelCount':_0x26c7f3,'configName':_0x3edaab}),{'modelCount':_0x26c7f3,'apiFilePath':_0x5a8443,'clientFilePath':_0x27bb38,'configName':_0x3edaab};}