@lovrabet/cli 1.2.5-beta.1 → 1.2.5-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/add-page/input-page-router.js +1 -1
- package/lib/add-page/main.js +1 -1
- package/lib/add-page/select-page-template.js +1 -1
- package/lib/api/api-doc-ui.js +1 -1
- package/lib/api/api-doc.js +1 -1
- package/lib/api/api-pull-ui.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/main.js +1 -1
- package/lib/api/pull-silent.js +1 -1
- package/lib/app-menu/app-menu-sync-ui.js +1 -1
- package/lib/app-menu/create-menu.js +1 -1
- package/lib/app-menu/get-local-pages.js +1 -1
- package/lib/app-menu/get-online-menu-list.js +1 -1
- package/lib/app-menu/use-get-online-menu-list.js +1 -1
- package/lib/app-menu/utils.js +1 -1
- package/lib/app-menu/valid-url.js +1 -1
- package/lib/app-menu-update-cdn/current-content.js +1 -1
- package/lib/app-menu-update-cdn/input-cdn-asset.js +1 -1
- package/lib/app-menu-update-cdn/main.js +1 -1
- package/lib/app-menu-update-cdn/update-menu-cdn-url.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/cmd/build-watch.js +1 -1
- package/lib/cmd/build.js +1 -1
- package/lib/cmd/logs.js +1 -1
- package/lib/cmd/preview.js +1 -1
- package/lib/cmd/start.js +1 -1
- package/lib/config/config-help.js +1 -1
- package/lib/config/main.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/create-app/enhanced-guided-create.js +1 -1
- package/lib/create-app/format-elapsed.js +1 -1
- package/lib/create-app/main.js +1 -1
- package/lib/create-app/task-finished.js +1 -1
- package/lib/create-app/task-loading.js +1 -1
- package/lib/create-app/task-running.js +1 -1
- package/lib/create-app/task-time.js +1 -1
- package/lib/create-app/use-copy-project-template.js +1 -1
- package/lib/create-app/use-format-code.js +1 -1
- package/lib/create-app/use-install-dependencies.js +1 -1
- package/lib/help.js +1 -1
- package/lib/init/main.js +1 -1
- package/lib/mcp/claude.js +1 -1
- package/lib/mcp/cursor.js +1 -1
- package/lib/mcp/main.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/router-updater.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/package.json +1 -1
- package/templates/skills/.claude/skills/lovrabet/SKILL.md +1 -0
- package/templates/skills/.cursor/commands/lovrabet.md +1 -0
- package/templates/skills/.shared/guides/07-backend-function/guide.md +679 -0
- package/templates/skills/.windsurf/workflows/lovrabet.md +1 -0
package/lib/mcp/claude.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a51_0x4ae5(){const _0x4faaa7=['2465MmUWRw','4680024kpDtFB','mcp-claude','online','-e\x20LOVRABET_APP_CODE=','2423368tkpmgq','生成\x20claude\x20MCP\x20配置命令','error','配置完成后:\x0a','trim','app','675119xXgyRR','错误:\x20未找到\x20appcode\x20配置,请先运行\x20\x27lovrabet\x20init\x27\x20初始化项目配置','daily','-e\x20LOVRABET_ENV=daily','2aBCjbo','exit','7015960ukGgrP','\x20\x20-\x20AppCode:\x20','\x20\x20-\x20环境:\x20','message','733512nhfrCS','info','5960vVFWJV','5514966mVwcgk','未找到\x20appcode\x20配置','\x20\x202.\x20在\x20claude\x20code\x20中确认\x20lovrabet-dataset\x20MCP\x20服务器已加载\x0a','配置信息:','appcode','log','错误:\x20配置失败\x20-\x20','\x20\x201.\x20重启\x20claude\x20code'];a51_0x4ae5=function(){return _0x4faaa7;};return a51_0x4ae5();}(function(_0x1f1c96,_0x22519c){const _0x6cf6e6=a51_0x5f2e,_0x1dd42b=_0x1f1c96();while(!![]){try{const _0x6d479=-parseInt(_0x6cf6e6(0xe7))/0x1*(parseInt(_0x6cf6e6(0xcb))/0x2)+parseInt(_0x6cf6e6(0xd1))/0x3+-parseInt(_0x6cf6e6(0xd3))/0x4*(-parseInt(_0x6cf6e6(0xdc))/0x5)+-parseInt(_0x6cf6e6(0xdd))/0x6+parseInt(_0x6cf6e6(0xcd))/0x7+-parseInt(_0x6cf6e6(0xe1))/0x8+parseInt(_0x6cf6e6(0xd4))/0x9;if(_0x6d479===_0x22519c)break;else _0x1dd42b['push'](_0x1dd42b['shift']());}catch(_0x5e63f1){_0x1dd42b['push'](_0x1dd42b['shift']());}}}(a51_0x4ae5,0xcc1f4));function a51_0x5f2e(_0x5ba1b0,_0x264ebc){_0x5ba1b0=_0x5ba1b0-0xc9;const _0x4ae53c=a51_0x4ae5();let _0x5f2ed7=_0x4ae53c[_0x5ba1b0];return _0x5f2ed7;}import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';export async function configureClaudeMcp(){const _0x48de02=a51_0x5f2e;try{const _0x26fcb8=readConfig(),_0x52e082=_0x26fcb8[_0x48de02(0xd8)]||_0x26fcb8[_0x48de02(0xe6)],_0xc977cb=_0x26fcb8['env']||_0x48de02(0xdf);!_0x52e082&&(console[_0x48de02(0xe3)](_0x48de02(0xe8)),logger[_0x48de02(0xe3)](_0x48de02(0xde),_0x48de02(0xd5)),process[_0x48de02(0xcc)](0x1));console['log'](_0x48de02(0xd7)),console[_0x48de02(0xd9)](_0x48de02(0xce)+_0x52e082),console[_0x48de02(0xd9)](_0x48de02(0xcf)+_0xc977cb+'\x0a');const _0x4f6fe5='claude\x20mcp\x20add\x20lovrabet-dataset\x20npx\x20@lovrabet/dataset-mcp-server@latest',_0x40455a=_0x48de02(0xe0)+_0x52e082,_0xce5079=_0xc977cb===_0x48de02(0xc9)?_0x48de02(0xca):'',_0x402348=(_0x4f6fe5+'\x20'+_0x40455a+'\x20'+_0xce5079)[_0x48de02(0xe5)]();console[_0x48de02(0xd9)]('请在终端中执行以下命令来配置\x20claude\x20code\x20MCP:\x0a'),console[_0x48de02(0xd9)]('\x20\x20'+_0x402348+'\x0a'),console['log'](_0x48de02(0xe4)),console[_0x48de02(0xd9)](_0x48de02(0xdb)),console[_0x48de02(0xd9)](_0x48de02(0xd6)),logger[_0x48de02(0xd2)](_0x48de02(0xde),_0x48de02(0xe2),{'appcode':_0x52e082,'env':_0xc977cb}),process[_0x48de02(0xcc)](0x0);}catch(_0x398389){logger['error']('mcp-claude','配置失败',{'error':_0x398389 instanceof Error?_0x398389[_0x48de02(0xd0)]:String(_0x398389)}),console['error'](_0x48de02(0xda)+(_0x398389 instanceof Error?_0x398389[_0x48de02(0xd0)]:String(_0x398389))),process[_0x48de02(0xcc)](0x1);}}
|
package/lib/mcp/cursor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4d3070,_0x44f688){const _0x45cbc7=a52_0x2019,_0x2ce6f1=_0x4d3070();while(!![]){try{const _0x16db1b=-parseInt(_0x45cbc7(0xad))/0x1+parseInt(_0x45cbc7(0xb8))/0x2+parseInt(_0x45cbc7(0x97))/0x3*(parseInt(_0x45cbc7(0xbf))/0x4)+parseInt(_0x45cbc7(0xbb))/0x5+parseInt(_0x45cbc7(0x9e))/0x6*(-parseInt(_0x45cbc7(0x8f))/0x7)+parseInt(_0x45cbc7(0xa6))/0x8*(parseInt(_0x45cbc7(0x9d))/0x9)+-parseInt(_0x45cbc7(0xb5))/0xa;if(_0x16db1b===_0x44f688)break;else _0x2ce6f1['push'](_0x2ce6f1['shift']());}catch(_0x1520fc){_0x2ce6f1['push'](_0x2ce6f1['shift']());}}}(a52_0x343e,0xc7631));function a52_0x343e(){const _0x2bdf0e=['exit','更新现有\x20mcp.json\x20配置','8XqWQmS','env','mcp-cursor','\x0a配置信息:','配置\x20Cursor\x20MCP\x20成功','21IATjwX','\x20\x20-\x20配置文件:\x20','\x20\x20-\x20AppCode:\x20','\x0a现在您可以在\x20Cursor\x20中使用\x20Lovrabet\x20数据集\x20MCP\x20工具了。','info','npx','error','错误:\x20配置失败:\x20','1607286AalwYS','@lovrabet/dataset-mcp-server','Cursor\x20Rules\x20文件已存在,跳过','warn','复制\x20Cursor\x20Rules\x20文件','错误:\x20未找到\x20appcode\x20配置,请先运行\x20\x27lovrabet\x20init\x27\x20初始化项目配置','92610GJShoz','2807394bNLIVJ','message','✓\x20创建\x20Cursor\x20Rules\x20文件:\x20.cursor/rules/lovrabet_rules.mdc','lovrabet_rules.mdc','mcp.json','配置\x20Cursor\x20MCP\x20失败','\x20\x20-\x20环境:\x20','警告:\x20复制\x20Cursor\x20Rules\x20文件失败:\x20','1184aYdvwD','创建\x20.cursor/rules\x20目录','未找到\x20appcode\x20配置','rules','✓\x20更新\x20mcp.json\x20配置','创建\x20.cursor\x20目录','mcpServers','336889TZorzx','请重启\x20Cursor\x20以加载新的\x20MCP\x20配置。','\x0a✓\x20Cursor\x20MCP\x20配置成功!','utf8','log','Cursor\x20Rules\x20模板文件不存在','online','!\x20Cursor\x20Rules\x20文件已存在,跳过创建,如需重新创建,请删除\x20.cursor/rules/lovrabet_rules.mdc\x20文件','18390860oWQlSR','错误:\x20解析现有\x20mcp.json\x20失败:\x20','stringify','812236ggrVcB','lovrabet-dataset','.cursor','6978995YTbWnL','✓\x20创建\x20.cursor\x20目录:\x20'];a52_0x343e=function(){return _0x2bdf0e;};return a52_0x343e();}function a52_0x2019(_0x4c5b8b,_0x114b6d){_0x4c5b8b=_0x4c5b8b-0x8e;const _0x343e50=a52_0x343e();let _0x201937=_0x343e50[_0x4c5b8b];return _0x201937;}import{existsSync,mkdirSync,writeFileSync,readFileSync,copyFileSync}from'node:fs';import{resolve,dirname}from'node:path';import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';export async function configureCursorMcp(){const _0x171312=a52_0x2019;try{const _0x298d54=process['cwd'](),_0x40626e=resolve(_0x298d54,_0x171312(0xba)),_0x52b114=resolve(_0x40626e,_0x171312(0xa2)),_0x4d9308=readConfig(),_0x5a5fb9=_0x4d9308['appcode']||_0x4d9308['app'],_0x410109=_0x4d9308[_0x171312(0xc0)]||_0x171312(0xb3);!_0x5a5fb9&&(console[_0x171312(0x95)](_0x171312(0x9c)),logger[_0x171312(0x95)]('mcp-cursor',_0x171312(0xa8)),process[_0x171312(0xbd)](0x1));!existsSync(_0x40626e)&&(mkdirSync(_0x40626e,{'recursive':!![]}),logger[_0x171312(0x93)](_0x171312(0xc1),_0x171312(0xab),{'path':_0x40626e}),console['log'](_0x171312(0xbc)+_0x40626e));const _0x589035={'command':_0x171312(0x94),'args':['-y',_0x171312(0x98)],'env':{'LOVRABET_APP_CODE':String(_0x5a5fb9),'LOVRABET_ENV':String(_0x410109)}};let _0x530e72;if(existsSync(_0x52b114))try{const _0x1203bf=readFileSync(_0x52b114,'utf8');_0x530e72=JSON['parse'](_0x1203bf),!_0x530e72[_0x171312(0xac)]&&(_0x530e72[_0x171312(0xac)]={}),_0x530e72[_0x171312(0xac)][_0x171312(0xb9)]=_0x589035,logger[_0x171312(0x93)](_0x171312(0xc1),_0x171312(0xbe),{'path':_0x52b114,'appcode':_0x5a5fb9,'env':_0x410109}),console[_0x171312(0xb1)](_0x171312(0xaa));}catch(_0x343f75){logger[_0x171312(0x95)](_0x171312(0xc1),'解析现有\x20mcp.json\x20失败',{'error':_0x343f75 instanceof Error?_0x343f75['message']:String(_0x343f75)}),console[_0x171312(0x95)](_0x171312(0xb6)+(_0x343f75 instanceof Error?_0x343f75[_0x171312(0x9f)]:String(_0x343f75))),process[_0x171312(0xbd)](0x1);}else _0x530e72={'mcpServers':{'lovrabet-dataset':_0x589035}},logger[_0x171312(0x93)](_0x171312(0xc1),'创建新的\x20mcp.json\x20配置',{'path':_0x52b114,'appcode':_0x5a5fb9,'env':_0x410109}),console[_0x171312(0xb1)]('✓\x20创建\x20mcp.json\x20配置文件');writeFileSync(_0x52b114,JSON[_0x171312(0xb7)](_0x530e72,null,0x2),{'encoding':_0x171312(0xb0)});const _0xe91aa7=resolve(_0x40626e,_0x171312(0xa9)),_0x2678ef=resolve(_0xe91aa7,_0x171312(0xa1));if(!existsSync(_0x2678ef))try{!existsSync(_0xe91aa7)&&(mkdirSync(_0xe91aa7,{'recursive':!![]}),logger['info'](_0x171312(0xc1),_0x171312(0xa7),{'path':_0xe91aa7}));const _0x28d38d=fileURLToPath(import.meta.url),_0x4f08ad=dirname(_0x28d38d),_0x5993a7=resolve(_0x4f08ad,'../../templates/rules/lovrabet_rules.mdc.tpl');existsSync(_0x5993a7)?(copyFileSync(_0x5993a7,_0x2678ef),logger[_0x171312(0x93)](_0x171312(0xc1),_0x171312(0x9b),{'from':_0x5993a7,'to':_0x2678ef}),console[_0x171312(0xb1)](_0x171312(0xa0))):logger[_0x171312(0x9a)](_0x171312(0xc1),_0x171312(0xb2),{'templatePath':_0x5993a7});}catch(_0x18f259){logger[_0x171312(0x95)](_0x171312(0xc1),'复制\x20Cursor\x20Rules\x20文件失败',{'error':_0x18f259 instanceof Error?_0x18f259['message']:String(_0x18f259)}),console[_0x171312(0x9a)](_0x171312(0xa5)+(_0x18f259 instanceof Error?_0x18f259['message']:String(_0x18f259)));}else console[_0x171312(0xb1)](_0x171312(0xb4)),logger['info'](_0x171312(0xc1),_0x171312(0x99),{'path':_0x2678ef});console['log'](_0x171312(0xaf)),console[_0x171312(0xb1)](_0x171312(0xc2)),console[_0x171312(0xb1)](_0x171312(0x91)+_0x5a5fb9),console[_0x171312(0xb1)](_0x171312(0xa4)+_0x410109),console[_0x171312(0xb1)](_0x171312(0x90)+_0x52b114),console[_0x171312(0xb1)](_0x171312(0x92)),console[_0x171312(0xb1)](_0x171312(0xae)),logger[_0x171312(0x93)](_0x171312(0xc1),_0x171312(0x8e),{'appcode':_0x5a5fb9,'env':_0x410109,'configPath':_0x52b114}),process[_0x171312(0xbd)](0x0);}catch(_0x417a49){logger['error'](_0x171312(0xc1),_0x171312(0xa3),{'error':_0x417a49 instanceof Error?_0x417a49[_0x171312(0x9f)]:String(_0x417a49)}),console[_0x171312(0x95)](_0x171312(0x96)+(_0x417a49 instanceof Error?_0x417a49['message']:String(_0x417a49))),process[_0x171312(0xbd)](0x1);}}
|
package/lib/mcp/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a53_0x3c6f9c=a53_0x2910;function a53_0x2910(_0x1596ba,_0x595c97){_0x1596ba=_0x1596ba-0xed;const _0x1a6de6=a53_0x1a6d();let _0x2910f7=_0x1a6de6[_0x1596ba];return _0x2910f7;}(function(_0x2df091,_0x5b8854){const _0x5b8cd4=a53_0x2910,_0x3fea49=_0x2df091();while(!![]){try{const _0x5e9fc7=parseInt(_0x5b8cd4(0xfa))/0x1+-parseInt(_0x5b8cd4(0x10e))/0x2+-parseInt(_0x5b8cd4(0xed))/0x3*(-parseInt(_0x5b8cd4(0x10b))/0x4)+parseInt(_0x5b8cd4(0x100))/0x5*(parseInt(_0x5b8cd4(0x10f))/0x6)+parseInt(_0x5b8cd4(0xf1))/0x7+-parseInt(_0x5b8cd4(0x10d))/0x8*(parseInt(_0x5b8cd4(0x103))/0x9)+parseInt(_0x5b8cd4(0x102))/0xa*(-parseInt(_0x5b8cd4(0x112))/0xb);if(_0x5e9fc7===_0x5b8854)break;else _0x3fea49['push'](_0x3fea49['shift']());}catch(_0x3b0020){_0x3fea49['push'](_0x3fea49['shift']());}}}(a53_0x1a6d,0x69dd2));import{configureCursorMcp}from'./cursor.js';import{configureClaudeMcp}from'./claude.js';import{logger}from'../utils/logger.js';const IDE_CONFIGS={'cursor':{'name':a53_0x3c6f9c(0xfd),'description':a53_0x3c6f9c(0xf5)},'claude':{'name':a53_0x3c6f9c(0x101),'description':a53_0x3c6f9c(0x101)}};function a53_0x1a6d(){const _0x19c463=['\x20\x20lovrabet\x20mcp\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20显示帮助信息\x0a','\x20\x20lovrabet\x20mcp\x20install\x20claude\x20\x20\x20\x20#\x20claude\x20code\x0a','3355618cCQEQz','\x0a📦\x20正在配置\x20','\x0a可用命令:','log','Cursor\x20IDE','cwd','错误:\x20不支持的平台:\x20','\x0a请指定要配置的平台:\x0a','配置失败','215224lnEwOz','install','(空)','Cursor','错误:\x20不支持的命令:\x20','message','125QaJUPe','claude\x20code','5570NyuFaE','66339TiSEkj','\x20\x20cursor\x20\x20\x20-\x20Cursor\x20IDE','help','claude','\x20MCP...\x0a','name','error','setLogPath','1667732xagWic','支持的平台:','536rdsofk','719964PhQdig','116076weGAzy','mcp','\x20\x20claude\x20\x20\x20-\x20claude\x20code\x0a','14311neDsqg','cursor','6qVjZoC','exit'];a53_0x1a6d=function(){return _0x19c463;};return a53_0x1a6d();}export async function mcpCommand(_0x557f76,_0xeb8bb2,_0x125830){const _0x561469=a53_0x3c6f9c;logger[_0x561469(0x10a)](process[_0x561469(0xf6)]());if(_0x125830?.[_0x561469(0x105)]||_0x557f76==='--help'){showHelp();return;}_0x557f76!==_0x561469(0xfb)&&(console['error'](_0x561469(0xfe)+(_0x557f76||_0x561469(0xfc))),console['log'](_0x561469(0xf3)),console['log']('\x20\x20lovrabet\x20mcp\x20install\x20<ide>\x20\x20\x20\x20#\x20安装\x20MCP\x20配置'),console[_0x561469(0xf4)](_0x561469(0xef)),console[_0x561469(0xf4)](_0x561469(0x10c)),console[_0x561469(0xf4)](_0x561469(0x104)),console[_0x561469(0xf4)](_0x561469(0x111)),logger[_0x561469(0x109)](_0x561469(0x110),'不支持的命令:\x20'+_0x557f76),process[_0x561469(0xee)](0x1)),await installMcp(_0xeb8bb2?.[0x0]);}function showHelp(){console['log']('\x0aLovrabet\x20MCP\x20-\x20MCP\x20服务器配置工具\x0a\x0a用法:\x0a\x20\x20lovrabet\x20mcp\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20显示帮助信息\x0a\x0a安装\x20MCP\x20配置:\x0a\x20\x20lovrabet\x20mcp\x20install\x20<ide>\x20\x20\x20\x20\x20\x20\x20安装\x20MCP\x20配置到\x20IDE\x0a\x0a支持的平台:\x0a\x20\x20cursor\x20\x20\x20-\x20Cursor\x20IDE\x0a\x20\x20\x20\x20└──\x20自动配置\x20.cursor/mcp.json\x0a\x0a\x20\x20claude\x20\x20\x20-\x20claude\x20code\x0a\x20\x20\x20\x20└──\x20输出手动配置命令(需手动执行)\x0a\x0a示例:\x0a\x20\x20lovrabet\x20mcp\x20install\x20cursor\x20\x20\x20\x20\x20\x20\x20#\x20配置\x20Cursor\x20的\x20MCP\x0a\x20\x20lovrabet\x20mcp\x20install\x20claude\x20\x20\x20\x20\x20\x20\x20#\x20输出\x20claude\x20code\x20的\x20MCP\x20配置命令\x0a\x0a配置后:\x0a\x20\x20-\x20Cursor:\x20重启\x20IDE\x20即可使用\x0a\x20\x20-\x20claude\x20code:\x20手动执行输出的命令\x0a');}async function installMcp(_0x549104){const _0x11f9e7=a53_0x3c6f9c;!_0x549104&&(console[_0x11f9e7(0xf4)](_0x11f9e7(0xf8)),console[_0x11f9e7(0xf4)]('\x20\x20lovrabet\x20mcp\x20install\x20cursor\x20\x20\x20\x20#\x20Cursor\x20IDE'),console[_0x11f9e7(0xf4)](_0x11f9e7(0xf0)),process[_0x11f9e7(0xee)](0x1));const _0x11d944=_0x549104['toLowerCase']();!IDE_CONFIGS[_0x11d944]&&(console['error'](_0x11f9e7(0xf7)+_0x549104),console['log']('\x0a支持的平台:\x20cursor,\x20claude\x0a'),process[_0x11f9e7(0xee)](0x1));try{console[_0x11f9e7(0xf4)](_0x11f9e7(0xf2)+IDE_CONFIGS[_0x11d944][_0x11f9e7(0x108)]+_0x11f9e7(0x107));switch(_0x11d944){case _0x11f9e7(0x113):await configureCursorMcp();break;case _0x11f9e7(0x106):await configureClaudeMcp();break;}}catch(_0x4ffa36){logger[_0x11f9e7(0x109)]('mcp-install',_0x11f9e7(0xf9),{'error':_0x4ffa36 instanceof Error?_0x4ffa36[_0x11f9e7(0xff)]:String(_0x4ffa36)}),console[_0x11f9e7(0x109)]('\x0a错误:\x20配置失败\x20-\x20'+(_0x4ffa36 instanceof Error?_0x4ffa36[_0x11f9e7(0xff)]:String(_0x4ffa36))+'\x0a'),process[_0x11f9e7(0xee)](0x1);}}
|
package/lib/skills/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a54_0x48f2fa=a54_0x59dc;function a54_0x59dc(_0x1f33e9,_0x5900a6){_0x1f33e9=_0x1f33e9-0x10f;const _0x195159=a54_0x1951();let _0x59dcfc=_0x195159[_0x1f33e9];return _0x59dcfc;}(function(_0x19da05,_0x3c3138){const _0x59ba2d=a54_0x59dc,_0x52f06b=_0x19da05();while(!![]){try{const _0x37a34f=-parseInt(_0x59ba2d(0x12a))/0x1+-parseInt(_0x59ba2d(0x119))/0x2+-parseInt(_0x59ba2d(0x111))/0x3*(parseInt(_0x59ba2d(0x114))/0x4)+parseInt(_0x59ba2d(0x127))/0x5+-parseInt(_0x59ba2d(0x142))/0x6*(parseInt(_0x59ba2d(0x126))/0x7)+parseInt(_0x59ba2d(0x139))/0x8+-parseInt(_0x59ba2d(0x115))/0x9*(-parseInt(_0x59ba2d(0x12e))/0xa);if(_0x37a34f===_0x3c3138)break;else _0x52f06b['push'](_0x52f06b['shift']());}catch(_0x52294e){_0x52f06b['push'](_0x52f06b['shift']());}}}(a54_0x1951,0xeb0f8));function a54_0x1951(){const _0x1f02fe=['Windsurf','安装失败','.windsurf','\x20\x20lovrabet\x20skill\x20install\x20cursor\x20\x20\x20#\x20Cursor\x20IDE','claude\x20code','message','支持的平台:','\x20\x20lovrabet\x20skill\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20显示帮助信息\x0a','toISOString','--help','5415GJVIxd','skill','.lovrabet','3188LPNxHl','145836tnqWsZ','\x0a✓\x20技能包安装成功!\x0a','\x20\x20-\x20在\x20claude\x20code\x20设置中添加此技能,即可使用\x0a','\x20\x20-\x20.windsurf/workflows/lovrabet.md\x20文件已安装\x0a','2430184rKiFFf','claude\x20code\x20(.claude/skills/)','\x20\x20-\x20.claude/skills/lovrabet/SKILL.md\x20文件已安装','error','\x20\x20windsurf\x20-\x20Windsurf\x20IDE','cursor','utf-8','isDirectory','setLogPath','错误:\x20不支持的平台:\x20','cwd','Windsurf\x20使用说明:','\x20\x20lovrabet\x20skill\x20install\x20claude\x20\x20\x20#\x20claude\x20code\x0a','4543iMDDae','251530DJmukA','Cursor','skill-install','69349AXHNxL','warn','\x0aLovrabet\x20Skill\x20-\x20开发者技能包安装工具\x0a\x0a用法:\x0a\x20\x20lovrabet\x20skill\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20显示帮助信息\x0a\x0a安装技能包:\x0a\x20\x20lovrabet\x20skill\x20install\x20<ide>\x20\x20\x20\x20\x20安装技能包到项目\x0a\x0a支持的平台:\x0a\x20\x20cursor\x20\x20\x20-\x20Cursor\x20IDE\x0a\x20\x20\x20\x20└──\x20安装\x20.cursorrules\x20和\x20.cursor/commands/\x0a\x0a\x20\x20windsurf\x20-\x20Windsurf\x20IDE\x0a\x20\x20\x20\x20└──\x20安装\x20.windsurf/workflows/\x0a\x0a\x20\x20claude\x20\x20\x20-\x20claude\x20code\x0a\x20\x20\x20\x20└──\x20安装\x20.claude/skills/\x0a\x0a技能包内容包括:\x0a\x20\x20-\x20Filter\x20查询构建规范\x20(10\x20种常见错误对照)\x0a\x20\x20-\x20MCP\x20SQL\x20创建工作流\x20(5\x20步强制流程)\x0a\x20\x20-\x20AntD\x20UI\x20开发规范\x20(禁止\x20AI\x20味道)\x0a\x20\x20-\x20API\x20集成指南\x20(lovrabet\x20api\x20pull\x20流程)\x0a\x20\x20-\x20菜单管理指南\x20(menu\x20sync/update\x20流程)\x0a\x20\x20-\x20Backend\x20Function\x20脚本编写规范\x20(权限过滤、数据脱敏、业务逻辑)\x0a\x0a示例:\x0a\x20\x20lovrabet\x20skill\x20install\x20cursor\x20\x20\x20#\x20安装\x20Cursor\x20规则\x0a\x20\x20lovrabet\x20skill\x20install\x20windsurf\x20#\x20安装\x20Windsurf\x20规则\x0a\x20\x20lovrabet\x20skill\x20install\x20claude\x20\x20\x20#\x20安装\x20claude\x20code\x20规则\x0a\x0a安装后会在项目中创建:\x0a\x20\x20-\x20.cursorrules\x20或\x20.windsurf/workflows/\x20或\x20.claude/skills/\x0a\x20\x20-\x20.lovrabet/skill/.shared/guides/\x20\x20-\x20开发者技能指南\x0a\x0a开发者指南位置:\x0a\x20\x20.lovrabet/skill/.shared/guides/01-filter-query/guide.md\x0a\x20\x20.lovrabet/skill/.shared/guides/02-mcp-sql-workflow/guide.md\x0a\x20\x20.lovrabet/skill/.shared/guides/03-antd-style/guide.md\x0a\x20\x20.lovrabet/skill/.shared/guides/05-api-integration/guide.md\x0a\x20\x20.lovrabet/skill/.shared/guides/06-menu-management/guide.md\x0a\x20\x20.lovrabet/skill/.shared/guides/07-backend-function/guide.md\x0a\x20\x20','log','1430pBaxkS','../../templates/skills','Cursor\x20使用说明:','错误:\x20不支持的命令:\x20','Windsurf\x20IDE\x20(.windsurf/workflows/)','.cursor','exit','windsurf','install','\x20\x20claude\x20\x20\x20-\x20claude\x20code\x0a','.lovrabet/skill-manifest.json','10552040yqSCGm','\x20\x20-\x20.lovrabet/skill/.shared/guides/\x20-\x20详细开发指南\x0a','✓\x20复制\x20.lovrabet/skill/.shared/','\x0a📦\x20正在安装\x20Lovrabet\x20技能包...\x0a','.lovrabet/skill/.shared','folders','安装成功','\x0a可用命令:','开发者指南位置:','6uolafy','\x0a支持的平台:\x20cursor,\x20windsurf,\x20claude\x0a'];a54_0x1951=function(){return _0x1f02fe;};return a54_0x1951();}import{existsSync,mkdirSync,writeFileSync,copyFileSync,readdirSync,statSync}from'node:fs';import{resolve,dirname,join}from'node:path';import{fileURLToPath}from'node:url';import{logger}from'../utils/logger.js';const __dirname=dirname(fileURLToPath(import.meta.url)),IDE_CONFIGS={'cursor':{'name':a54_0x48f2fa(0x128),'description':'Cursor\x20IDE\x20(.cursorrules\x20+\x20.cursor/commands/)','folders':['.cursorrules',a54_0x48f2fa(0x133)]},'windsurf':{'name':a54_0x48f2fa(0x144),'description':a54_0x48f2fa(0x132),'folders':[a54_0x48f2fa(0x146)]},'claude':{'name':a54_0x48f2fa(0x148),'description':a54_0x48f2fa(0x11a),'folders':['.claude']}};export async function skillsCommand(_0x28aec0,_0x4313aa,_0x7daac){const _0x1c4dad=a54_0x48f2fa;logger[_0x1c4dad(0x121)](process['cwd']());if(_0x7daac?.['help']||_0x28aec0===_0x1c4dad(0x110)){showHelp();return;}_0x28aec0!==_0x1c4dad(0x136)&&(console[_0x1c4dad(0x11c)](_0x1c4dad(0x131)+(_0x28aec0||'(空)')),console[_0x1c4dad(0x12d)](_0x1c4dad(0x140)),console[_0x1c4dad(0x12d)]('\x20\x20lovrabet\x20skill\x20install\x20<ide>\x20\x20\x20\x20#\x20安装技能包到项目'),console[_0x1c4dad(0x12d)](_0x1c4dad(0x14b)),console[_0x1c4dad(0x12d)](_0x1c4dad(0x14a)),console[_0x1c4dad(0x12d)]('\x20\x20cursor\x20\x20\x20-\x20Cursor\x20IDE'),console[_0x1c4dad(0x12d)](_0x1c4dad(0x11d)),console['log'](_0x1c4dad(0x137)),logger[_0x1c4dad(0x11c)](_0x1c4dad(0x112),'不支持的命令:\x20'+_0x28aec0),process[_0x1c4dad(0x134)](0x1)),await installSkill(_0x4313aa?.[0x0]);}function showHelp(){const _0x3ad10d=a54_0x48f2fa;console['log'](_0x3ad10d(0x12c));}async function copyDir(_0x5b89e7,_0x1492b4){const _0x32f1fc=a54_0x48f2fa,_0x52166e=statSync(_0x5b89e7);if(_0x52166e[_0x32f1fc(0x120)]()){!existsSync(_0x1492b4)&&mkdirSync(_0x1492b4,{'recursive':!![]});const _0x57c66c=readdirSync(_0x5b89e7);for(const _0x36a0cd of _0x57c66c){await copyDir(join(_0x5b89e7,_0x36a0cd),join(_0x1492b4,_0x36a0cd));}}else copyFileSync(_0x5b89e7,_0x1492b4);}async function installSkill(_0x567b5a){const _0x366b28=a54_0x48f2fa,_0xa241a7=process[_0x366b28(0x123)]();!_0x567b5a&&(console[_0x366b28(0x12d)]('\x0a请指定要安装的平台:\x0a'),console[_0x366b28(0x12d)](_0x366b28(0x147)),console['log']('\x20\x20lovrabet\x20skill\x20install\x20windsurf\x20#\x20Windsurf\x20IDE'),console['log'](_0x366b28(0x125)),process[_0x366b28(0x134)](0x1));!IDE_CONFIGS[_0x567b5a]&&(console[_0x366b28(0x11c)](_0x366b28(0x122)+_0x567b5a),console['log'](_0x366b28(0x143)),process[_0x366b28(0x134)](0x1));try{console[_0x366b28(0x12d)](_0x366b28(0x13c)),console[_0x366b28(0x12d)]('目标平台:\x20'+IDE_CONFIGS[_0x567b5a]['name']+'\x0a');const _0x5a628e=resolve(__dirname,_0x366b28(0x12f));let _0x4971f7=0x0;for(const _0x3bbbc5 of IDE_CONFIGS[_0x567b5a][_0x366b28(0x13e)]){const _0x2d0fc4=join(_0x5a628e,_0x3bbbc5),_0x53b503=join(_0xa241a7,_0x3bbbc5);if(!existsSync(_0x2d0fc4)){logger[_0x366b28(0x12b)]('skill-install','模板不存在:\x20'+_0x2d0fc4);continue;}await copyDir(_0x2d0fc4,_0x53b503),_0x4971f7++,console[_0x366b28(0x12d)]('✓\x20复制\x20'+_0x3bbbc5+'/');}const _0x354845=join(_0x5a628e,'.shared'),_0x33e132=join(_0xa241a7,_0x366b28(0x13d));existsSync(_0x354845)&&(await copyDir(_0x354845,_0x33e132),_0x4971f7++,console[_0x366b28(0x12d)](_0x366b28(0x13b)));const _0x5b0b71={'version':'2.0.0','installedAt':new Date()[_0x366b28(0x10f)](),'platform':_0x567b5a},_0x3648ef=join(_0xa241a7,_0x366b28(0x138));!existsSync(join(_0xa241a7,_0x366b28(0x113)))&&mkdirSync(join(_0xa241a7,_0x366b28(0x113)),{'recursive':!![]});writeFileSync(_0x3648ef,JSON['stringify'](_0x5b0b71,null,0x2),_0x366b28(0x11f)),console[_0x366b28(0x12d)]('✓\x20创建\x20.lovrabet/skill-manifest.json'),console[_0x366b28(0x12d)](_0x366b28(0x116));switch(_0x567b5a){case _0x366b28(0x11e):console[_0x366b28(0x12d)](_0x366b28(0x130)),console[_0x366b28(0x12d)]('\x20\x20-\x20.cursorrules\x20文件已创建,Cursor\x20会自动读取'),console[_0x366b28(0x12d)]('\x20\x20-\x20.cursor/commands/lovrabet.md\x20也已安装,可通过\x20@lovrabet\x20直接调用\x0a'),console[_0x366b28(0x12d)](_0x366b28(0x141)),console['log']('\x20\x20-\x20.lovrabet/skill/.shared/guides/\x20-\x20详细开发指南\x0a');break;case _0x366b28(0x135):console[_0x366b28(0x12d)](_0x366b28(0x124)),console[_0x366b28(0x12d)](_0x366b28(0x118)),console[_0x366b28(0x12d)]('开发者指南位置:'),console['log'](_0x366b28(0x13a));break;case'claude':console[_0x366b28(0x12d)]('claude\x20code\x20使用说明:'),console[_0x366b28(0x12d)](_0x366b28(0x11b)),console[_0x366b28(0x12d)](_0x366b28(0x117)),console[_0x366b28(0x12d)]('开发者指南位置:'),console[_0x366b28(0x12d)](_0x366b28(0x13a));break;}logger['info'](_0x366b28(0x129),_0x366b28(0x13f),{'projectRoot':_0xa241a7,'ide':_0x567b5a,'foldersCount':_0x4971f7});}catch(_0xdab6e4){logger['error']('skill-install',_0x366b28(0x145),{'error':_0xdab6e4 instanceof Error?_0xdab6e4[_0x366b28(0x149)]:String(_0xdab6e4)}),console[_0x366b28(0x11c)]('\x0a错误:\x20安装失败\x20-\x20'+(_0xdab6e4 instanceof Error?_0xdab6e4[_0x366b28(0x149)]:String(_0xdab6e4))+'\x0a'),process[_0x366b28(0x134)](0x1);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a56_0x423e(){const _0x3d8aaf=['45hZfbMV','⚠️\x20\x20SDK\x20版本不兼容','935544fpQDfl','\x1b[1m','759190SaVmwi','227839HlKZfR','existsSync','@lovrabet/sdk','2WNDBUG','\x20或更高版本:','minVersion','parse','560903FUZLUs','log','readFileSync','1311088uyRwfE','\x20\x20\x20请升级\x20SDK\x20至\x20','1486050kiXNuP','\x20\x20\x20当前\x20CLI\x20版本已升级模型注册协议,但检测到您的\x20@lovrabet/sdk\x20版本\x20','25452216QWvNqM','devDependencies','3XjFWIi','\x20\x20\x20npm\x20install\x20@lovrabet/sdk@latest','\x20不支持新协议。','\x20\x20\x20查看最新版本:\x20https://www.npmjs.com/package/@lovrabet/sdk','\x1b[0m','1.2.0','package.json','33QDtbgf','6FktEio','dependencies'];a56_0x423e=function(){return _0x3d8aaf;};return a56_0x423e();}const a56_0x5ab83=a56_0x5cef;(function(_0x26e9b0,_0x5917e5){const _0x5c1654=a56_0x5cef,_0x112f68=_0x26e9b0();while(!![]){try{const _0x2b50aa=-parseInt(_0x5c1654(0xe7))/0x1*(parseInt(_0x5c1654(0xea))/0x2)+parseInt(_0x5c1654(0xf7))/0x3*(-parseInt(_0x5c1654(0xf1))/0x4)+-parseInt(_0x5c1654(0xe6))/0x5+parseInt(_0x5c1654(0xe0))/0x6*(parseInt(_0x5c1654(0xee))/0x7)+-parseInt(_0x5c1654(0xe4))/0x8*(parseInt(_0x5c1654(0xe2))/0x9)+-parseInt(_0x5c1654(0xf3))/0xa*(parseInt(_0x5c1654(0xdf))/0xb)+parseInt(_0x5c1654(0xf5))/0xc;if(_0x2b50aa===_0x5917e5)break;else _0x112f68['push'](_0x112f68['shift']());}catch(_0x437741){_0x112f68['push'](_0x112f68['shift']());}}}(a56_0x423e,0x71140));import a56_0x48bc80 from'node:fs';import a56_0x29cbe5 from'node:path';import a56_0x1b58df from'semver';const MIN_SDK_VERSION=a56_0x5ab83(0xfc);export function checkSdkVersion(_0x81958c){const _0xc56182=a56_0x5ab83,_0x24c229=a56_0x29cbe5['join'](_0x81958c,_0xc56182(0xde));if(!a56_0x48bc80[_0xc56182(0xe8)](_0x24c229))return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':MIN_SDK_VERSION};try{const _0x270dfe=JSON[_0xc56182(0xed)](a56_0x48bc80[_0xc56182(0xf0)](_0x24c229,'utf8')),_0xb4fceb=_0x270dfe[_0xc56182(0xe1)]||{},_0x5d2ffa=_0x270dfe[_0xc56182(0xf6)]||{},_0x10996c=_0xb4fceb[_0xc56182(0xe9)]||_0x5d2ffa[_0xc56182(0xe9)];if(!_0x10996c)return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':MIN_SDK_VERSION};const _0x38428d=a56_0x1b58df['coerce'](_0x10996c),_0x36fffe=_0x38428d?a56_0x1b58df['lt'](_0x38428d,MIN_SDK_VERSION):![];return{'installed':!![],'version':_0x10996c,'needsUpgrade':_0x36fffe,'minVersion':MIN_SDK_VERSION};}catch{return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':MIN_SDK_VERSION};}}function a56_0x5cef(_0x392c06,_0x5bc009){_0x392c06=_0x392c06-0xde;const _0x423eb7=a56_0x423e();let _0x5cef93=_0x423eb7[_0x392c06];return _0x5cef93;}export function printSdkUpgradeWarning(_0x1374b7){const _0xf19b0a=a56_0x5ab83;if(!_0x1374b7['needsUpgrade'])return;const _0x34e5a7='\x1b[33m',_0x319d5e=_0xf19b0a(0xfb),_0x5e5cf9=_0xf19b0a(0xe5);console[_0xf19b0a(0xef)](),console[_0xf19b0a(0xef)](''+_0x34e5a7+_0x5e5cf9+_0xf19b0a(0xe3)+_0x319d5e),console[_0xf19b0a(0xef)](_0x34e5a7+_0xf19b0a(0xf4)+_0x1374b7['version']+_0xf19b0a(0xf9)+_0x319d5e),console['log'](_0x34e5a7+_0xf19b0a(0xf2)+_0x1374b7[_0xf19b0a(0xec)]+_0xf19b0a(0xeb)+_0x319d5e),console[_0xf19b0a(0xef)](_0x34e5a7+_0xf19b0a(0xf8)+_0x319d5e),console[_0xf19b0a(0xef)](_0x34e5a7+_0xf19b0a(0xfa)+_0x319d5e),console[_0xf19b0a(0xef)]();}
|
package/lib/utils/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a57_0x249959=a57_0x68a8;(function(_0x21730e,_0x34becf){const _0x403370=a57_0x68a8,_0x44d2a3=_0x21730e();while(!![]){try{const _0x1075bb=parseInt(_0x403370(0x17f))/0x1+-parseInt(_0x403370(0x176))/0x2*(-parseInt(_0x403370(0x178))/0x3)+-parseInt(_0x403370(0x17a))/0x4+parseInt(_0x403370(0x172))/0x5*(-parseInt(_0x403370(0x179))/0x6)+-parseInt(_0x403370(0x181))/0x7+parseInt(_0x403370(0x17c))/0x8+-parseInt(_0x403370(0x17e))/0x9*(-parseInt(_0x403370(0x17b))/0xa);if(_0x1075bb===_0x34becf)break;else _0x44d2a3['push'](_0x44d2a3['shift']());}catch(_0x2e728a){_0x44d2a3['push'](_0x44d2a3['shift']());}}}(a57_0x3d08,0x57ae4));import{existsSync,readFileSync}from'node:fs';function a57_0x68a8(_0x3b32de,_0x576c05){_0x3b32de=_0x3b32de-0x172;const _0x3d0843=a57_0x3d08();let _0x68a8bf=_0x3d0843[_0x3b32de];return _0x68a8bf;}import{resolve}from'node:path';function a57_0x3d08(){const _0x269956=['appcode','parse','app','2CvdjnQ','utf8','1213047VJhdqT','654dppuli','2106828YWjNsA','1320630DUHOgg','3837392VjuVPU','trim','45NeFedQ','481893UsbCkv','.lovrabetrc','4794874ROyUHD','20890PCzOWq'];a57_0x3d08=function(){return _0x269956;};return a57_0x3d08();}import{homedir}from'node:os';export const projectConfigPath=resolve(process['cwd'](),a57_0x249959(0x180));export const globalConfigPath=resolve(homedir(),a57_0x249959(0x180));export function readConfig(){const _0xd7e39f=a57_0x249959;let _0x35ee9f={};try{if(existsSync(globalConfigPath)){const _0x1fe780=readFileSync(globalConfigPath,{'encoding':_0xd7e39f(0x177)});_0x1fe780&&(_0x35ee9f=JSON['parse'](_0x1fe780));}}catch(_0x232e1e){}try{if(existsSync(projectConfigPath)){const _0x2e057f=readFileSync(projectConfigPath,{'encoding':_0xd7e39f(0x177)});if(_0x2e057f){const _0x1ff76f=JSON[_0xd7e39f(0x174)](_0x2e057f);_0x35ee9f={..._0x35ee9f,..._0x1ff76f};}}}catch(_0x2d4e41){}return _0x35ee9f;}export function getConfigAppCode(){const _0x5f53e6=a57_0x249959;let _0x2397c7={},_0x42a249={};try{if(existsSync(globalConfigPath)){const _0x163735=readFileSync(globalConfigPath,{'encoding':_0x5f53e6(0x177)});_0x163735&&(_0x42a249=JSON[_0x5f53e6(0x174)](_0x163735));}}catch(_0x530b07){}try{if(existsSync(projectConfigPath)){const _0x280186=readFileSync(projectConfigPath,{'encoding':_0x5f53e6(0x177)});_0x280186&&(_0x2397c7=JSON[_0x5f53e6(0x174)](_0x280186));}}catch(_0xc49ba){}let _0x3b4bee;if(_0x5f53e6(0x173)in _0x2397c7)_0x3b4bee=_0x2397c7[_0x5f53e6(0x173)];else{if(_0x5f53e6(0x175)in _0x2397c7)_0x3b4bee=_0x2397c7[_0x5f53e6(0x175)];else{if(_0x5f53e6(0x173)in _0x42a249)_0x3b4bee=_0x42a249[_0x5f53e6(0x173)];else _0x5f53e6(0x175)in _0x42a249&&(_0x3b4bee=_0x42a249[_0x5f53e6(0x175)]);}}if(typeof _0x3b4bee!=='string'||_0x3b4bee[_0x5f53e6(0x17d)]()==='')return undefined;return _0x3b4bee;}export function isInProject(){return existsSync(projectConfigPath);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x15bd63,_0x3f2674){const _0x4b3419=a58_0x4340,_0x198430=_0x15bd63();while(!![]){try{const _0x339bc5=-parseInt(_0x4b3419(0x16a))/0x1*(parseInt(_0x4b3419(0x16e))/0x2)+-parseInt(_0x4b3419(0x169))/0x3*(parseInt(_0x4b3419(0x16b))/0x4)+-parseInt(_0x4b3419(0x16f))/0x5+parseInt(_0x4b3419(0x15e))/0x6+parseInt(_0x4b3419(0x164))/0x7*(parseInt(_0x4b3419(0x162))/0x8)+parseInt(_0x4b3419(0x165))/0x9+parseInt(_0x4b3419(0x161))/0xa*(parseInt(_0x4b3419(0x15f))/0xb);if(_0x339bc5===_0x3f2674)break;else _0x198430['push'](_0x198430['shift']());}catch(_0x27aa3d){_0x198430['push'](_0x198430['shift']());}}}(a58_0x5db5,0x49369));import a58_0x5f070a from'node:path';function a58_0x4340(_0x323509,_0x2f46ad){_0x323509=_0x323509-0x15e;const _0x5db5b1=a58_0x5db5();let _0x43409f=_0x5db5b1[_0x323509];return _0x43409f;}import a58_0x25397f from'node:fs';export async function copyDirectory(_0x56e740,_0x42edd8){const _0x8188f8=a58_0x4340;try{const _0x26e5ba=a58_0x25397f[_0x8188f8(0x168)](_0x56e740,{'withFileTypes':!![]});a58_0x25397f[_0x8188f8(0x166)](_0x42edd8,{'recursive':!![]});for(const _0x2a17e5 of _0x26e5ba){const _0x160c37=a58_0x5f070a['join'](_0x56e740,_0x2a17e5[_0x8188f8(0x167)]),_0x2bdf7a=a58_0x5f070a[_0x8188f8(0x16c)](_0x42edd8,_0x2a17e5[_0x8188f8(0x167)]);_0x2a17e5['isDirectory']()?await copyDirectory(_0x160c37,_0x2bdf7a):a58_0x25397f[_0x8188f8(0x16d)](_0x160c37,_0x2bdf7a);}}catch(_0x7f6635){console[_0x8188f8(0x163)](_0x8188f8(0x160),_0x7f6635);}}function a58_0x5db5(){const _0x37f7aa=['readdirSync','261807ljqIRm','79537YpgvcR','12HIXoid','join','copyFileSync','2VfheFY','1442685OCrXHz','1231500TrOSGM','3407129jAYlUa','复制目录时出错:','10hNeLIF','9096qlNRWa','error','1022QJOons','2238939EFquWh','mkdirSync','name'];a58_0x5db5=function(){return _0x37f7aa;};return a58_0x5db5();}
|
package/lib/utils/http-client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x36a6b6,_0x502ce0){const _0x570f43=a59_0x2da4,_0x240f17=_0x36a6b6();while(!![]){try{const _0x292bc4=-parseInt(_0x570f43(0x1f8))/0x1+parseInt(_0x570f43(0x1fd))/0x2+-parseInt(_0x570f43(0x1f6))/0x3+parseInt(_0x570f43(0x1fb))/0x4*(-parseInt(_0x570f43(0x203))/0x5)+parseInt(_0x570f43(0x209))/0x6*(-parseInt(_0x570f43(0x1f7))/0x7)+parseInt(_0x570f43(0x200))/0x8*(-parseInt(_0x570f43(0x1ff))/0x9)+parseInt(_0x570f43(0x20b))/0xa;if(_0x292bc4===_0x502ce0)break;else _0x240f17['push'](_0x240f17['shift']());}catch(_0x409c69){_0x240f17['push'](_0x240f17['shift']());}}}(a59_0x3c5a,0x9432c));export async function httpRequest(_0x23948e,_0xf3cfe4={}){const _0x5afe85=a59_0x2da4,{timeout:timeout=0x7530,retries:retries=0x3,retryDelay:retryDelay=0x3e8,headers:headers={}}=_0xf3cfe4;let _0x438bf=null;for(let _0x449331=0x0;_0x449331<=retries;_0x449331++){try{const _0x3ae00b=new AbortController(),_0x5ae2c9=setTimeout(()=>_0x3ae00b[_0x5afe85(0x1fe)](),timeout),_0x3979ab=await fetch(_0x23948e,{'headers':headers,'signal':_0x3ae00b[_0x5afe85(0x1f0)]});clearTimeout(_0x5ae2c9);let _0x59769f;const _0x26246f=_0x3979ab[_0x5afe85(0x1f9)][_0x5afe85(0x205)](_0x5afe85(0x20c));return _0x26246f?.[_0x5afe85(0x1f3)](_0x5afe85(0x20e))?_0x59769f=await _0x3979ab['json']():_0x59769f=await _0x3979ab[_0x5afe85(0x1fc)](),{'ok':_0x3979ab['ok'],'status':_0x3979ab['status'],'statusText':_0x3979ab[_0x5afe85(0x201)],'data':_0x59769f,'headers':_0x3979ab[_0x5afe85(0x1f9)],'url':_0x3979ab[_0x5afe85(0x1f2)],'text':()=>_0x3979ab['text']()};}catch(_0x50fa43){_0x438bf=_0x50fa43 instanceof Error?_0x50fa43:new Error(String(_0x50fa43));if(_0x449331===retries)break;if(shouldRetry(_0x50fa43)){console[_0x5afe85(0x207)](_0x5afe85(0x20d)+retryDelay+_0x5afe85(0x1fa)+(_0x449331+0x1)+_0x5afe85(0x202)),await sleep(retryDelay);continue;}else break;}}throw _0x438bf||new Error(_0x5afe85(0x20a));}function shouldRetry(_0x68326a){const _0x4235c0=a59_0x2da4;if(_0x68326a instanceof Error){if(_0x68326a[_0x4235c0(0x208)]===_0x4235c0(0x204))return![];if(_0x68326a['name']===_0x4235c0(0x1f1)&&_0x68326a[_0x4235c0(0x206)][_0x4235c0(0x1f3)](_0x4235c0(0x1f5)))return!![];if(_0x68326a[_0x4235c0(0x206)][_0x4235c0(0x1f3)](_0x4235c0(0x1f4)))return!![];if(_0x68326a[_0x4235c0(0x206)]['includes'](_0x4235c0(0x20f)))return![];}return![];}function sleep(_0x26a449){return new Promise(_0x4b597e=>setTimeout(_0x4b597e,_0x26a449));}function a59_0x2da4(_0x1b3fe8,_0x2edd8a){_0x1b3fe8=_0x1b3fe8-0x1f0;const _0x3c5aa9=a59_0x3c5a();let _0x2da4a1=_0x3c5aa9[_0x1b3fe8];return _0x2da4a1;}export function validateUrl(_0x38ca84){try{return new URL(_0x38ca84),!![];}catch{return![];}}function a59_0x3c5a(){const _0xac2f68=['message','log','name','4596qMnPHX','Request\x20failed','27866520CmefEI','content-type','*\x20请求失败,','application/json','ENOTFOUND','signal','TypeError','url','includes','ECONNRESET','fetch','592599hjJqSH','4186IUOnkY','1189630eyOpmp','headers','ms\x20后进行第\x20','2872SAAsLl','text','1300258hcbYay','abort','417456HkKxIK','56JfjFdo','statusText','\x20次重试...','4595AZftmm','AbortError','get'];a59_0x3c5a=function(){return _0xac2f68;};return a59_0x3c5a();}
|
package/lib/utils/logger.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a60_0x5953(_0x438af4,_0x513204){_0x438af4=_0x438af4-0xfe;const _0x2753f2=a60_0x2753();let _0x59532b=_0x2753f2[_0x438af4];return _0x59532b;}const a60_0x28cf3e=a60_0x5953;function a60_0x2753(){const _0x34592a=['writeFileSync','warn','462551NiedAA','Failed\x20to\x20clear\x20logs:','493384zmrCNx','timestamp','readLogs','rawCommand','.lovrabet.log','printf','addColors','logFilePath','setRawCommand','clear','310079zjNFsq','split','details','utf8','blue','logTask','green','42ouhnaC','info','join','errors','yellow','format','now','失败:\x20','createLogger','command','toISOString','File','45bdbskN','完成:\x20','开始执行:\x20','currentRawCommand','transports','level','existsSync','message','2074740vQQMJm','unknown','656286qGIKmL','Failed\x20to\x20read\x20logs:','349012HoJvUk','combine','parse','error','525452jkhdmN','log','dirname','duration','clearLogs','success','winstonLogger'];a60_0x2753=function(){return _0x34592a;};return a60_0x2753();}(function(_0x222925,_0x2de588){const _0x168dee=a60_0x5953,_0xcf08e=_0x222925();while(!![]){try{const _0x577632=parseInt(_0x168dee(0x10a))/0x1+-parseInt(_0x168dee(0x101))/0x2+-parseInt(_0x168dee(0x133))/0x3+parseInt(_0x168dee(0x135))/0x4+-parseInt(_0x168dee(0x131))/0x5+-parseInt(_0x168dee(0x11d))/0x6*(-parseInt(_0x168dee(0x116))/0x7)+parseInt(_0x168dee(0x10c))/0x8*(parseInt(_0x168dee(0x129))/0x9);if(_0x577632===_0x2de588)break;else _0xcf08e['push'](_0xcf08e['shift']());}catch(_0x1bf538){_0xcf08e['push'](_0xcf08e['shift']());}}}(a60_0x2753,0x425c4));import a60_0x52cd3c from'winston';import a60_0x27339f from'node:fs';import a60_0x13e139 from'node:path';class Logger{['winstonLogger'];[a60_0x28cf3e(0x113)];[a60_0x28cf3e(0x12c)]='';constructor(){const _0xa18e8c=a60_0x28cf3e;this[_0xa18e8c(0x113)]='';}[a60_0x28cf3e(0x114)](_0x237bc1){const _0x5d0c4b=a60_0x28cf3e;this[_0x5d0c4b(0x12c)]=_0x237bc1;}['initWinstonLogger'](){const _0x125426=a60_0x28cf3e,_0x36f495=a60_0x13e139[_0x125426(0x103)](this[_0x125426(0x113)]);!a60_0x27339f[_0x125426(0x12f)](_0x36f495)&&a60_0x27339f['mkdirSync'](_0x36f495,{'recursive':!![]});const _0x2905da=a60_0x52cd3c[_0x125426(0x122)][_0x125426(0xfe)](a60_0x52cd3c[_0x125426(0x122)]['timestamp'](),a60_0x52cd3c[_0x125426(0x122)][_0x125426(0x120)]({'stack':!![]}),a60_0x52cd3c[_0x125426(0x122)][_0x125426(0x111)](_0x4cd4ad=>{const _0x2fdff6=_0x125426,_0x23e8af={'timestamp':_0x4cd4ad[_0x2fdff6(0x10d)]||new Date()[_0x2fdff6(0x127)](),'level':_0x4cd4ad[_0x2fdff6(0x12e)]||_0x2fdff6(0x11e),'command':_0x4cd4ad[_0x2fdff6(0x126)]||_0x2fdff6(0x132),'rawCommand':_0x4cd4ad[_0x2fdff6(0x10f)]||this[_0x2fdff6(0x12c)]||undefined,'message':_0x4cd4ad[_0x2fdff6(0x130)]||'','duration':_0x4cd4ad[_0x2fdff6(0x104)]||undefined,'details':_0x4cd4ad[_0x2fdff6(0x118)]||undefined};return JSON['stringify'](_0x23e8af);}));this['winstonLogger']=a60_0x52cd3c[_0x125426(0x125)]({'level':_0x125426(0x11e),'format':_0x2905da,'transports':[new a60_0x52cd3c[(_0x125426(0x12d))][(_0x125426(0x128))]({'filename':this[_0x125426(0x113)],'level':_0x125426(0x11e)})],'silent':![]}),a60_0x52cd3c[_0x125426(0x112)]({'success':_0x125426(0x11c),'error':'red','warn':_0x125426(0x121),'info':_0x125426(0x11a)});}['setLogPath'](_0xc62539){const _0x41af7f=a60_0x28cf3e;this[_0x41af7f(0x113)]=a60_0x13e139[_0x41af7f(0x11f)](_0xc62539,_0x41af7f(0x110)),this[_0x41af7f(0x107)]&&this[_0x41af7f(0x107)][_0x41af7f(0x115)](),this['initWinstonLogger']();}[a60_0x28cf3e(0x11e)](_0x137ea0,_0x489215,_0x51b9c2){const _0x45e732=a60_0x28cf3e;if(!this['logFilePath']||!this[_0x45e732(0x107)])return;this['winstonLogger'][_0x45e732(0x11e)](_0x489215,{'command':_0x137ea0,'details':_0x51b9c2});}['success'](_0x449277,_0x5c3b6a,_0x229952,_0x1c8fcb){const _0xf00ddf=a60_0x28cf3e;if(!this[_0xf00ddf(0x113)]||!this['winstonLogger'])return;this[_0xf00ddf(0x107)][_0xf00ddf(0x102)](_0xf00ddf(0x11e),_0x5c3b6a,{'level':_0xf00ddf(0x106),'command':_0x449277,'duration':_0x229952,'details':_0x1c8fcb});}[a60_0x28cf3e(0x100)](_0x2846c4,_0x14ad50,_0x583967){const _0x531de6=a60_0x28cf3e;if(!this[_0x531de6(0x113)]||!this['winstonLogger'])return;this[_0x531de6(0x107)][_0x531de6(0x100)](_0x14ad50,{'command':_0x2846c4,'details':_0x583967});}['warn'](_0x55125f,_0x43dafd,_0x5d6d40){const _0x36efb1=a60_0x28cf3e;if(!this[_0x36efb1(0x113)]||!this[_0x36efb1(0x107)])return;this[_0x36efb1(0x107)][_0x36efb1(0x109)](_0x43dafd,{'command':_0x55125f,'details':_0x5d6d40});}async[a60_0x28cf3e(0x11b)](_0x25ec1b,_0x472412,_0x6937e9){const _0x1e6a1e=a60_0x28cf3e,_0x7bc4e2=Date[_0x1e6a1e(0x123)]();this['info'](_0x25ec1b,_0x1e6a1e(0x12b)+_0x472412);try{const _0x30a36e=await _0x6937e9(),_0x306788=Date[_0x1e6a1e(0x123)]()-_0x7bc4e2;return this[_0x1e6a1e(0x106)](_0x25ec1b,_0x1e6a1e(0x12a)+_0x472412,_0x306788),_0x30a36e;}catch(_0x91a7f1){const _0x3e0452=Date[_0x1e6a1e(0x123)]()-_0x7bc4e2;this[_0x1e6a1e(0x100)](_0x25ec1b,_0x1e6a1e(0x124)+_0x472412,{'error':_0x91a7f1 instanceof Error?_0x91a7f1[_0x1e6a1e(0x130)]:String(_0x91a7f1),'duration':_0x3e0452});throw _0x91a7f1;}}[a60_0x28cf3e(0x10e)](){const _0x2cd335=a60_0x28cf3e;try{if(!a60_0x27339f['existsSync'](this[_0x2cd335(0x113)]))return[];const _0x505501=a60_0x27339f['readFileSync'](this[_0x2cd335(0x113)],_0x2cd335(0x119));return _0x505501[_0x2cd335(0x117)]('\x0a')['filter'](_0x1698b5=>_0x1698b5['trim']())['map'](_0x44dd1b=>JSON[_0x2cd335(0xff)](_0x44dd1b));}catch(_0x363e14){return console[_0x2cd335(0x109)](_0x2cd335(0x134),_0x363e14),[];}}[a60_0x28cf3e(0x105)](){const _0x355308=a60_0x28cf3e;try{a60_0x27339f[_0x355308(0x12f)](this[_0x355308(0x113)])&&a60_0x27339f[_0x355308(0x108)](this[_0x355308(0x113)],'','utf8');}catch(_0x44474d){console[_0x355308(0x109)](_0x355308(0x10b),_0x44474d);}}['getWinstonInstance'](){const _0xf0730e=a60_0x28cf3e;return this[_0xf0730e(0x107)];}}export const logger=new Logger();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a61_0x1ccd(_0x21a275,_0x2d360b){_0x21a275=_0x21a275-0xc7;const _0x188e9d=a61_0x188e();let _0x1ccdd0=_0x188e9d[_0x21a275];return _0x1ccdd0;}function a61_0x188e(){const _0xbe713c=['success','开始更新路由配置','22730MYpFvc','src','writeFile','144sAqxFG','addPageRoute','4466439XfnINP','addImport','\x20from\x20\x22../pages/','62224FuQBIR','4716370cZcazc','previewChanges','existsSync','120XOgKUn','routerFilePath','addRoute','match','\x20/>,\x0a\x20\x20\x20\x20\x20\x20\x20\x20},','join','readFile','charAt','indexOf','3254psJSRc','lastIndexOf','toUpperCase','路由配置更新完成','message','index','toComponentName','now','includes','info','slice','383jBLOeo','index.tsx','error','522gyqLzj','1168794ryvoMz','79184YwSNtZ','length','utf8','\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20element:\x20<','promises','\x20\x20\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20path:\x20\x22','16LBNYyB','path:\x20\x22','路由文件不存在:\x20','import\x20','router'];a61_0x188e=function(){return _0xbe713c;};return a61_0x188e();}const a61_0x1f31a7=a61_0x1ccd;(function(_0x9f3fd5,_0x27ad20){const _0x20cfcb=a61_0x1ccd,_0x16f08a=_0x9f3fd5();while(!![]){try{const _0x3fec99=parseInt(_0x20cfcb(0xf0))/0x1*(parseInt(_0x20cfcb(0xe5))/0x2)+parseInt(_0x20cfcb(0xdc))/0x3*(parseInt(_0x20cfcb(0xd8))/0x4)+parseInt(_0x20cfcb(0xd0))/0x5*(parseInt(_0x20cfcb(0xf3))/0x6)+parseInt(_0x20cfcb(0xf5))/0x7*(-parseInt(_0x20cfcb(0xc9))/0x8)+-parseInt(_0x20cfcb(0xd5))/0x9+parseInt(_0x20cfcb(0xd9))/0xa+parseInt(_0x20cfcb(0xf4))/0xb*(-parseInt(_0x20cfcb(0xd3))/0xc);if(_0x3fec99===_0x27ad20)break;else _0x16f08a['push'](_0x16f08a['shift']());}catch(_0x481af0){_0x16f08a['push'](_0x16f08a['shift']());}}}(a61_0x188e,0x4dc71));import a61_0x3767b9 from'node:fs';import a61_0x486ad9 from'node:path';import{logger}from'./logger.js';export class RouterUpdater{['routerFilePath'];constructor(_0x5cc911){const _0x2807c4=a61_0x1ccd;this[_0x2807c4(0xdd)]=a61_0x486ad9[_0x2807c4(0xe1)](_0x5cc911,_0x2807c4(0xd1),_0x2807c4(0xcd),_0x2807c4(0xf1));}async[a61_0x1f31a7(0xd4)](_0x5ab6a1,_0x336ba8){const _0x2f7959=a61_0x1f31a7;if(!a61_0x3767b9[_0x2f7959(0xdb)](this[_0x2f7959(0xdd)]))throw new Error(_0x2f7959(0xcb)+this[_0x2f7959(0xdd)]);const _0x11f00d=Date[_0x2f7959(0xec)]();logger[_0x2f7959(0xee)](_0x2f7959(0xcd),_0x2f7959(0xcf),{'pageName':_0x5ab6a1,'routePath':_0x336ba8,'file':this[_0x2f7959(0xdd)]});try{const _0x278ad2=await a61_0x3767b9[_0x2f7959(0xc7)]['readFile'](this['routerFilePath'],_0x2f7959(0xf7)),_0xb6e573=this[_0x2f7959(0xeb)](_0x5ab6a1),_0x111bad=this[_0x2f7959(0xd6)](_0x278ad2,_0xb6e573,_0x5ab6a1),_0x28771d=this[_0x2f7959(0xde)](_0x111bad,_0x336ba8,_0xb6e573);await a61_0x3767b9['promises'][_0x2f7959(0xd2)](this[_0x2f7959(0xdd)],_0x28771d,_0x2f7959(0xf7));const _0x1da95b=Date[_0x2f7959(0xec)]()-_0x11f00d;logger[_0x2f7959(0xce)](_0x2f7959(0xcd),_0x2f7959(0xe8),_0x1da95b,{'pageName':_0x5ab6a1,'routePath':_0x336ba8,'componentName':_0xb6e573});}catch(_0x25555e){const _0x157fae=Date['now']()-_0x11f00d;logger[_0x2f7959(0xf2)](_0x2f7959(0xcd),'路由配置更新失败',{'pageName':_0x5ab6a1,'routePath':_0x336ba8,'error':_0x25555e instanceof Error?_0x25555e[_0x2f7959(0xe9)]:String(_0x25555e),'duration':_0x157fae});throw _0x25555e;}}[a61_0x1f31a7(0xeb)](_0x89e9bf){const _0x24813d=a61_0x1f31a7;return _0x89e9bf['split']('-')['map'](_0x5bcab4=>_0x5bcab4[_0x24813d(0xe3)](0x0)[_0x24813d(0xe7)]()+_0x5bcab4[_0x24813d(0xef)](0x1)['toLowerCase']())[_0x24813d(0xe1)]('');}[a61_0x1f31a7(0xd6)](_0x7c5f09,_0x1ef353,_0x52528c){const _0x5a20f6=a61_0x1f31a7,_0x44ea26=/import\s+\w+\s+from\s+["']\.\.\/pages\/\w+["'];?\n/g,_0x479d93=_0x7c5f09[_0x5a20f6(0xdf)](_0x44ea26)||[],_0x95a393=_0x5a20f6(0xcc)+_0x1ef353+_0x5a20f6(0xd7)+_0x52528c+'\x22;';if(_0x7c5f09['includes'](_0x95a393))return _0x7c5f09;if(_0x479d93[_0x5a20f6(0xf6)]>0x0){const _0x3a683b=_0x479d93[_0x479d93[_0x5a20f6(0xf6)]-0x1];if(_0x3a683b){const _0x4217f2=_0x7c5f09[_0x5a20f6(0xe6)](_0x3a683b),_0x53e7d7=_0x4217f2+_0x3a683b[_0x5a20f6(0xf6)];return _0x7c5f09[_0x5a20f6(0xef)](0x0,_0x53e7d7)+_0x95a393+'\x0a'+_0x7c5f09['slice'](_0x53e7d7);}}const _0x168156=_0x7c5f09[_0x5a20f6(0xdf)](/import\s+\w+\s+from\s+["']\.\.\/layouts\/\w+["'];?\n/);if(_0x168156&&_0x168156[_0x5a20f6(0xea)]!==undefined){const _0x4fb41f=_0x168156[_0x5a20f6(0xea)]+_0x168156[0x0]['length'];return _0x7c5f09[_0x5a20f6(0xef)](0x0,_0x4fb41f)+_0x95a393+'\x0a'+_0x7c5f09[_0x5a20f6(0xef)](_0x4fb41f);}return _0x7c5f09;}[a61_0x1f31a7(0xde)](_0x1edd43,_0x1941a7,_0xf15bc8){const _0x44f6f3=a61_0x1f31a7,_0x2bd65d=_0x44f6f3(0xc8)+_0x1941a7+_0x44f6f3(0xf8)+_0xf15bc8+_0x44f6f3(0xe0);if(_0x1edd43[_0x44f6f3(0xed)](_0x44f6f3(0xca)+_0x1941a7+'\x22'))return _0x1edd43;const _0x41f348=/children:\s*\[([\s\S]*?)\]/,_0x5c33d2=_0x1edd43['match'](_0x41f348);if(!_0x5c33d2||_0x5c33d2['index']===undefined)throw new Error('未找到路由配置的\x20children\x20数组');const _0x14ea6c=_0x5c33d2[0x1],_0x1be14f=_0x5c33d2['index']+_0x5c33d2[0x0][_0x44f6f3(0xe4)]('[')+0x1,_0x25aac2=_0x14ea6c?.['match'](/\{[\s\S]*?\},/g)||[];if(_0x25aac2[_0x44f6f3(0xf6)]>0x0){const _0x278de3=_0x25aac2[_0x25aac2['length']-0x1];if(_0x278de3){const _0x575673=_0x1edd43[_0x44f6f3(0xe6)](_0x278de3),_0x536411=_0x575673+_0x278de3['length'];return _0x1edd43[_0x44f6f3(0xef)](0x0,_0x536411)+'\x0a'+_0x2bd65d+_0x1edd43['slice'](_0x536411);}}return _0x1edd43[_0x44f6f3(0xef)](0x0,_0x1be14f)+'\x0a'+_0x2bd65d+_0x1edd43[_0x44f6f3(0xef)](_0x1be14f);}async[a61_0x1f31a7(0xda)](_0x59be3b,_0x3291ba){const _0x1a7bcb=a61_0x1f31a7;if(!a61_0x3767b9[_0x1a7bcb(0xdb)](this['routerFilePath']))throw new Error(_0x1a7bcb(0xcb)+this[_0x1a7bcb(0xdd)]);const _0x449ef9=await a61_0x3767b9[_0x1a7bcb(0xc7)][_0x1a7bcb(0xe2)](this[_0x1a7bcb(0xdd)],_0x1a7bcb(0xf7)),_0x5d84a7=this['toComponentName'](_0x59be3b);let _0x3446da=this['addImport'](_0x449ef9,_0x5d84a7,_0x59be3b);return _0x3446da=this[_0x1a7bcb(0xde)](_0x3446da,_0x3291ba,_0x5d84a7),_0x3446da;}}
|
package/lib/utils/sleep.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export function sleep(
|
|
1
|
+
export function sleep(_0xf7ddc4){return new Promise(_0x463c65=>setTimeout(_0x463c65,_0xf7ddc4));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a63_0x48170c=a63_0x2844;(function(_0x38c20f,_0x560707){const _0x396364=a63_0x2844,_0x2da949=_0x38c20f();while(!![]){try{const _0x4d0a83=parseInt(_0x396364(0x143))/0x1+parseInt(_0x396364(0x12d))/0x2*(-parseInt(_0x396364(0x16a))/0x3)+parseInt(_0x396364(0x165))/0x4*(parseInt(_0x396364(0x16c))/0x5)+parseInt(_0x396364(0x152))/0x6*(-parseInt(_0x396364(0x13c))/0x7)+parseInt(_0x396364(0x154))/0x8*(parseInt(_0x396364(0x150))/0x9)+-parseInt(_0x396364(0x132))/0xa*(parseInt(_0x396364(0x16d))/0xb)+-parseInt(_0x396364(0x15b))/0xc*(-parseInt(_0x396364(0x137))/0xd);if(_0x4d0a83===_0x560707)break;else _0x2da949['push'](_0x2da949['shift']());}catch(_0x580f46){_0x2da949['push'](_0x2da949['shift']());}}}(a63_0x3a41,0x802f2));import a63_0x38551e from'node:fs';function a63_0x2844(_0x260dae,_0x29b6d8){_0x260dae=_0x260dae-0x128;const _0x3a41c5=a63_0x3a41();let _0x284458=_0x3a41c5[_0x260dae];return _0x284458;}import a63_0x5a1085 from'node:path';function a63_0x3a41(){const _0x2257ea=['882ekcHQd','toLocaleTimeString','1616lCdouj','join','readFile','YourModel','datasetCode:\x20\x22','replace','promises','16147308ffCOvq','模板内容替换失败','name:\x20\x22','.scss','\x20},','endsWith','alias','charAt','numeric','.tsx','134984KkHWcs','utf8','tableName','.tpl','.css','485313lDKnNn','isDirectory','80pOSsVS','33mIEUmd','readdir','toUpperCase','.jsx','map','template','alias:\x20\x22','toISOString','8fLZjmT','toDisplayTitle','mkdir','模板内容替换完成','.md','2796410pOscxl','push','toLocaleString','error','2-digit','13MavvcS','toLowerCase','message','.json','replaceContent','23863PWWvbD','tableName:\x20\x22','processTemplate','processDirectory','isFile','split','api','624203UnOIcl','.js','info','开始处理模板内容替换','toLocaleDateString','toComponentName','\x0a\x20\x20\x20\x20{\x20','copyFile','now','includes','.ts','pop','slice','108CxhoDO','name'];a63_0x3a41=function(){return _0x2257ea;};return a63_0x3a41();}import{logger}from'./logger.js';export class TemplateReplacer{static[a63_0x48170c(0x148)](_0x413d1d){const _0x2916c7=a63_0x48170c,_0x1e0439=_0x413d1d[_0x2916c7(0x141)]('/')[_0x2916c7(0x14e)]()||_0x413d1d;return _0x1e0439[_0x2916c7(0x141)]('-')[_0x2916c7(0x129)](_0x332dd4=>_0x332dd4[_0x2916c7(0x162)](0x0)[_0x2916c7(0x16f)]()+_0x332dd4['slice'](0x1)[_0x2916c7(0x138)]())[_0x2916c7(0x155)]('');}static[a63_0x48170c(0x12e)](_0xae1ee3){const _0x2a91ec=a63_0x48170c,_0x5563bc=_0xae1ee3[_0x2a91ec(0x141)]('/')[_0x2a91ec(0x14e)]()||_0xae1ee3;return _0x5563bc[_0x2a91ec(0x141)]('-')['map'](_0x141539=>_0x141539[_0x2a91ec(0x162)](0x0)[_0x2a91ec(0x16f)]()+_0x141539[_0x2a91ec(0x14f)](0x1)['toLowerCase']())[_0x2a91ec(0x155)]('\x20');}static[a63_0x48170c(0x13b)](_0x423d47,_0x5cbcf4,_0x5cc313){const _0x519c60=a63_0x48170c,_0x865b16=this[_0x519c60(0x148)](_0x5cbcf4),_0x3c51fa=this[_0x519c60(0x12e)](_0x5cbcf4),_0x492af4=new Date(),_0x21857d=_0x492af4[_0x519c60(0x134)](undefined,{'year':_0x519c60(0x163),'month':'2-digit','day':_0x519c60(0x136),'hour':_0x519c60(0x136),'minute':_0x519c60(0x136),'second':_0x519c60(0x136),'hour12':![]})[_0x519c60(0x159)](/\//g,'-'),_0x545356=_0x492af4[_0x519c60(0x147)](undefined,{'year':'numeric','month':'2-digit','day':'2-digit'})[_0x519c60(0x159)](/\//g,'-'),_0x461c18=_0x492af4[_0x519c60(0x153)](undefined,{'hour12':![]});let _0x78c3a0=_0x423d47[_0x519c60(0x159)](/\{ComponentName\}/g,_0x865b16)[_0x519c60(0x159)](/\{DisplayTitle\}/g,_0x3c51fa)[_0x519c60(0x159)](/\{PageName\}/g,_0x5cbcf4)[_0x519c60(0x159)](/\{TemplateName\}/g,_0x5cc313)[_0x519c60(0x159)](/\{CreatedAt\}/g,_0x21857d)[_0x519c60(0x159)](/\{CreatedDate\}/g,_0x545356)['replace'](/\{CreatedTime\}/g,_0x461c18);return _0x78c3a0;}static['replaceApiContent'](_0x320a42,_0x402205,_0x1b75cd,_0x163703,_0x27835f,_0x556fab,_0x41e45b){const _0x3c0621=a63_0x48170c,_0x57657a=new Date(),_0x360707=_0x57657a[_0x3c0621(0x12c)](),_0x5b6cff=_0x1b75cd[_0x3c0621(0x129)](_0x1c1e4a=>{const _0x46ecd2=_0x3c0621,_0x1df22e=[_0x46ecd2(0x158)+_0x1c1e4a['datasetCode']+'\x22',_0x46ecd2(0x13d)+_0x1c1e4a[_0x46ecd2(0x167)]+'\x22',_0x46ecd2(0x15d)+_0x1c1e4a[_0x46ecd2(0x151)]+'\x22'];return _0x1c1e4a[_0x46ecd2(0x161)]&&_0x1df22e[_0x46ecd2(0x133)](_0x46ecd2(0x12b)+_0x1c1e4a[_0x46ecd2(0x161)]+'\x22'),_0x46ecd2(0x149)+_0x1df22e['join'](',\x20')+_0x46ecd2(0x15f);})[_0x3c0621(0x155)](''),_0x2c6e=_0x163703||_0x1b75cd[0x0]?.[_0x3c0621(0x161)]||_0x3c0621(0x157);let _0x52b8e1=_0x320a42[_0x3c0621(0x159)](/\{AppCode\}/g,_0x402205)[_0x3c0621(0x159)](/\{ModelConfigs\}/g,_0x5b6cff)['replace'](/\{ExampleModelName\}/g,_0x2c6e)['replace'](/\{ApiFileName\}/g,_0x27835f||_0x3c0621(0x142))[_0x3c0621(0x159)](/\{ConfigName\}/g,_0x556fab||'default')[_0x3c0621(0x159)](/\{ClientConfigParam\}/g,_0x41e45b||'')[_0x3c0621(0x159)](/\{CreatedAt\}/g,_0x360707);return _0x52b8e1;}static async[a63_0x48170c(0x13e)](_0x2a11f6,_0xa8702,_0x1ba2b3,_0x243ea2,_0x294f54=!![]){const _0x9d423f=a63_0x48170c,_0x2f7658=Date[_0x9d423f(0x14b)]();try{_0x294f54&&logger[_0x9d423f(0x145)](_0x9d423f(0x12a),_0x9d423f(0x146),{'templatePath':_0x2a11f6,'targetPath':_0xa8702,'pageName':_0x1ba2b3,'templateName':_0x243ea2});await a63_0x38551e['promises'][_0x9d423f(0x12f)](_0xa8702,{'recursive':!![]}),await this[_0x9d423f(0x13f)](_0x2a11f6,_0xa8702,_0x1ba2b3,_0x243ea2);if(_0x294f54){const _0x3886cb=Date[_0x9d423f(0x14b)]()-_0x2f7658;logger['success']('template',_0x9d423f(0x130),_0x3886cb,{'pageName':_0x1ba2b3,'templateName':_0x243ea2});}}catch(_0x2b009a){if(_0x294f54){const _0x22ead0=Date[_0x9d423f(0x14b)]()-_0x2f7658;logger[_0x9d423f(0x135)](_0x9d423f(0x12a),_0x9d423f(0x15c),{'templatePath':_0x2a11f6,'targetPath':_0xa8702,'pageName':_0x1ba2b3,'templateName':_0x243ea2,'error':_0x2b009a instanceof Error?_0x2b009a[_0x9d423f(0x139)]:String(_0x2b009a),'duration':_0x22ead0});}throw _0x2b009a;}}static async['processDirectory'](_0xcff72f,_0x4d5cfb,_0x2ad866,_0x27a495){const _0x24892b=a63_0x48170c,_0x300890=await a63_0x38551e[_0x24892b(0x15a)][_0x24892b(0x16e)](_0xcff72f,{'withFileTypes':!![]});for(const _0x7aada1 of _0x300890){const _0x443d72=a63_0x5a1085[_0x24892b(0x155)](_0xcff72f,_0x7aada1['name']);let _0x2138a6=a63_0x5a1085['join'](_0x4d5cfb,_0x7aada1[_0x24892b(0x151)]);_0x7aada1[_0x24892b(0x151)][_0x24892b(0x160)]('.tpl')&&(_0x2138a6=a63_0x5a1085[_0x24892b(0x155)](_0x4d5cfb,_0x7aada1['name'][_0x24892b(0x159)](/\.tpl$/,'')));if(_0x7aada1[_0x24892b(0x16b)]())await a63_0x38551e[_0x24892b(0x15a)][_0x24892b(0x12f)](_0x2138a6,{'recursive':!![]}),await this['processDirectory'](_0x443d72,_0x2138a6,_0x2ad866,_0x27a495);else _0x7aada1[_0x24892b(0x140)]()&&await this['processFile'](_0x443d72,_0x2138a6,_0x2ad866,_0x27a495);}}static async['processFile'](_0x114f86,_0x37fed3,_0x24a1b7,_0x12061c){const _0x5eabba=a63_0x48170c,_0x4fd47f=a63_0x5a1085['extname'](_0x114f86)[_0x5eabba(0x138)]();_0x114f86[_0x5eabba(0x160)](_0x5eabba(0x168))&&(_0x37fed3=_0x37fed3[_0x5eabba(0x159)](/\.tpl$/,''));const _0x47dc73=[_0x5eabba(0x164),_0x5eabba(0x14d),_0x5eabba(0x128),_0x5eabba(0x144),_0x5eabba(0x13a),_0x5eabba(0x131),_0x5eabba(0x169),_0x5eabba(0x15e),_0x5eabba(0x168)];if(_0x47dc73[_0x5eabba(0x14c)](_0x4fd47f)||_0x114f86[_0x5eabba(0x160)](_0x5eabba(0x168))){const _0xff7e49=await a63_0x38551e['promises'][_0x5eabba(0x156)](_0x114f86,_0x5eabba(0x166)),_0x2b0a2c=this[_0x5eabba(0x13b)](_0xff7e49,_0x24a1b7,_0x12061c);await a63_0x38551e[_0x5eabba(0x15a)]['writeFile'](_0x37fed3,_0x2b0a2c,_0x5eabba(0x166));}else await a63_0x38551e[_0x5eabba(0x15a)][_0x5eabba(0x14a)](_0x114f86,_0x37fed3);}}
|
package/package.json
CHANGED
|
@@ -236,6 +236,7 @@ lovrabet skill install <ide> # 安装技能包到项目
|
|
|
236
236
|
- `.lovrabet/skill/.shared/guides/04-troubleshooting/guide.md`
|
|
237
237
|
- `.lovrabet/skill/.shared/guides/05-api-integration/guide.md`
|
|
238
238
|
- `.lovrabet/skill/.shared/guides/06-menu-management/guide.md`
|
|
239
|
+
- `.lovrabet/skill/.shared/guides/07-backend-function/guide.md`
|
|
239
240
|
|
|
240
241
|
## MCP 配置说明
|
|
241
242
|
|
|
@@ -231,6 +231,7 @@ const result = await client.models.<modelName>.filter({
|
|
|
231
231
|
- **04-troubleshooting** - 问题排查指南(常见问题快速定位)
|
|
232
232
|
- **05-api-integration** - API 集成指南(lovrabet api pull 流程)
|
|
233
233
|
- **06-menu-management** - 菜单管理指南(menu sync/update 流程)
|
|
234
|
+
- **07-backend-function** - Backend Function 脚本编写规范(权限过滤、数据脱敏、业务逻辑)
|
|
234
235
|
|
|
235
236
|
当遇到复杂问题时,可以参考这些指南获取更详细的说明和示例。
|
|
236
237
|
|