@lovrabet/rabetbase-cli 2.0.2-beta.1 → 2.0.2-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/ai-setup/config.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-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api.js +1 -1
- package/lib/commands/app.js +1 -1
- package/lib/commands/auth.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/new.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/build.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/config.js +1 -1
- package/lib/commands/create.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/links.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/logout.js +1 -1
- package/lib/commands/logs.js +1 -1
- package/lib/commands/mcp.js +1 -1
- package/lib/commands/menu.js +1 -1
- package/lib/commands/preview.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/run.js +1 -1
- package/lib/commands/skill.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/save.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/start.js +1 -1
- package/lib/config/config-help.js +1 -1
- package/lib/config/main.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/sql-validator.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/non-interactive.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/errors.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/init/main.js +1 -1
- package/lib/mcp/McpInstallUI.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/mcp/mcp-install-non-interactive.js +1 -1
- package/lib/mcp/mcp-installer.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/ui/IDESelector.js +1 -1
- package/lib/ui/useIDESelection.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/package.json +2 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a112_0xaa2a4a=a112_0x3947;(function(_0x4b0084,_0x165b09){const _0x57bc1b=a112_0x3947,_0x5e4091=_0x4b0084();while(!![]){try{const _0x1a1bc9=-parseInt(_0x57bc1b(0xb7))/0x1*(parseInt(_0x57bc1b(0xa5))/0x2)+-parseInt(_0x57bc1b(0xa8))/0x3*(-parseInt(_0x57bc1b(0xac))/0x4)+-parseInt(_0x57bc1b(0xb2))/0x5*(parseInt(_0x57bc1b(0xa4))/0x6)+parseInt(_0x57bc1b(0xaa))/0x7*(parseInt(_0x57bc1b(0xb8))/0x8)+-parseInt(_0x57bc1b(0xa9))/0x9+parseInt(_0x57bc1b(0xb3))/0xa*(-parseInt(_0x57bc1b(0xa0))/0xb)+parseInt(_0x57bc1b(0xb5))/0xc;if(_0x1a1bc9===_0x165b09)break;else _0x5e4091['push'](_0x5e4091['shift']());}catch(_0x1edfc5){_0x5e4091['push'](_0x5e4091['shift']());}}}(a112_0x116a,0x475c1));import{spawnSync}from'node:child_process';function a112_0x116a(){const _0x1836d7=['5gGUELv','400dJEGLi','env','8921712aOFofj','npx','529fCOJKk','104RtQUhY','pipe','win32','inherit','stdout','69883GOIDui','exit\x20','--skill','log','3506838mAayQc','542wcceuA','trim','toString','1791pmoGyf','1288251QUjKFa','94451JsVteU','add','3340ZmunrW','lovrabet/lovrabet-skill','RABETBASE_SKIP_NPX_SKILLS','join','stderr','platform'];a112_0x116a=function(){return _0x1836d7;};return a112_0x116a();}export const NPX_FLAG_YES='-y';export const NPX_SKILLS_CLI='skills';export const NPX_SKILLS_SUBCOMMAND_ADD=a112_0xaa2a4a(0xab);export const NPX_SKILLS_FLAG_SKILL=a112_0xaa2a4a(0xa2);function a112_0x3947(_0x2829a0,_0x597c6f){_0x2829a0=_0x2829a0-0x9d;const _0x116ab4=a112_0x116a();let _0x3947e5=_0x116ab4[_0x2829a0];return _0x3947e5;}export const RABETBASE_SKILL_SOURCE=a112_0xaa2a4a(0xad);export const DEFAULT_RABETBASE_SKILL_NAME='Lovrabet';export function buildNpxSkillsAddArgv(_0x2017a1=DEFAULT_RABETBASE_SKILL_NAME){return[NPX_FLAG_YES,NPX_SKILLS_CLI,NPX_SKILLS_SUBCOMMAND_ADD,RABETBASE_SKILL_SOURCE,NPX_SKILLS_FLAG_SKILL,_0x2017a1];}export const NPX_SKILLS_ADD_COMMAND_LINE=['npx',...buildNpxSkillsAddArgv()][a112_0xaa2a4a(0xaf)]('\x20');export function shouldSkipNpxSkillsAdd(){const _0x1146b2=a112_0xaa2a4a;return process[_0x1146b2(0xb4)][_0x1146b2(0xae)]==='1';}export function runNpxSkillsAdd(_0x1f3ab5,_0x9afdd){const _0x440f98=a112_0xaa2a4a;if(shouldSkipNpxSkillsAdd())return{'ok':!![],'status':0x0,'skipped':!![]};const _0x506a14=_0x9afdd?.['stdio']??_0x440f98(0x9e),_0x489049=process[_0x440f98(0xb1)]===_0x440f98(0x9d)?'npx.cmd':_0x440f98(0xb6),_0x5eaf6a=buildNpxSkillsAddArgv(_0x9afdd?.['skill']??DEFAULT_RABETBASE_SKILL_NAME),_0x534111=[_0x489049,..._0x5eaf6a][_0x440f98(0xaf)]('\x20');console[_0x440f98(0xa3)]('*\x20'+_0x534111);const _0x9aff58=spawnSync(_0x489049,_0x5eaf6a,{'cwd':_0x1f3ab5,'stdio':_0x506a14,'env':process[_0x440f98(0xb4)],'shell':![]}),_0x2bfe4d=_0x9aff58['status'];if(_0x2bfe4d===0x0)return{'ok':!![],'status':0x0};let _0x4397bd=_0x440f98(0xa1)+(_0x2bfe4d??'unknown');if(_0x506a14===_0x440f98(0xb9)){const _0x31bd88=_0x9aff58['stderr']?_0x9aff58[_0x440f98(0xb0)][_0x440f98(0xa7)]()[_0x440f98(0xa6)]():'',_0x14bd74=_0x9aff58[_0x440f98(0x9f)]?_0x9aff58['stdout'][_0x440f98(0xa7)]()[_0x440f98(0xa6)]():'';if(_0x31bd88)_0x4397bd=_0x31bd88;else{if(_0x14bd74)_0x4397bd=_0x14bd74;}}return{'ok':![],'status':_0x2bfe4d??null,'error':_0x4397bd};}
|
package/lib/ui/IDESelector.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x386fef,_0x504a09){const _0x377357=a114_0x313a,_0x4f491c=_0x386fef();while(!![]){try{const _0x175ee7=-parseInt(_0x377357(0x14e))/0x1+parseInt(_0x377357(0x15e))/0x2+parseInt(_0x377357(0x153))/0x3*(-parseInt(_0x377357(0x14d))/0x4)+-parseInt(_0x377357(0x14b))/0x5+-parseInt(_0x377357(0x151))/0x6*(parseInt(_0x377357(0x15b))/0x7)+parseInt(_0x377357(0x15d))/0x8+parseInt(_0x377357(0x15c))/0x9;if(_0x175ee7===_0x504a09)break;else _0x4f491c['push'](_0x4f491c['shift']());}catch(_0x4bcacb){_0x4f491c['push'](_0x4f491c['shift']());}}}(a114_0x345d,0x43068));function a114_0x345d(){const _0x46b5f9=['key','white','cyan','blue','has','column','21OwJGMb','10643355iAGQOf','1027952MGuhLU','774564SFVsMc','gray','1324445ckwRUl','description','4NqQYgr','247687HNxNzw','[\x20]','name','1002612FcEkrJ','red','1229859gWyVrf','\x20↑/↓:\x20Move\x20\x20Space:\x20Toggle\x20\x20a:\x20All\x20\x20i/r:\x20Invert\x20\x20q:\x20Quit\x20\x20Enter:\x20Confirm'];a114_0x345d=function(){return _0x46b5f9;};return a114_0x345d();}import{jsxs as a114_0xf8b6f0,jsx as a114_0x3ba747}from'react/jsx-runtime';import{Text,Box}from'ink';export function IDESelector({ideList:_0x3a7455,title:_0xded21e,selection:_0x27dd69}){const _0x591e5c=a114_0x313a,{selectedIndexes:_0x13ca83,highlightIndex:_0x50a743,errorMsg:_0x2efcb9}=_0x27dd69;return a114_0xf8b6f0(Box,{'flexDirection':_0x591e5c(0x15a),'marginTop':0x1,'children':[a114_0x3ba747(Box,{'children':a114_0xf8b6f0(Text,{'color':_0x591e5c(0x157),'children':['*\x20',_0xded21e]})}),_0x2efcb9&&a114_0x3ba747(Box,{'marginTop':0x1,'children':a114_0xf8b6f0(Text,{'color':_0x591e5c(0x152),'children':['✗\x20',_0x2efcb9]})}),a114_0xf8b6f0(Box,{'marginTop':0x1,'flexDirection':_0x591e5c(0x15a),'children':[a114_0x3ba747(Text,{'bold':!![],'children':'*\x20Select\x20IDEs\x20to\x20configure:'}),_0x3a7455['map']((_0x282bf8,_0x4d1c52)=>{const _0x67a6f0=_0x591e5c,_0x1b3245=_0x50a743===_0x4d1c52,_0x1c8efe=_0x13ca83[_0x67a6f0(0x159)](_0x4d1c52);return a114_0x3ba747(Box,{'children':a114_0xf8b6f0(Text,{'backgroundColor':_0x1b3245?_0x67a6f0(0x158):undefined,'color':_0x1b3245?_0x67a6f0(0x156):undefined,'children':['\x20\x20',_0x1c8efe?'[✓]':_0x67a6f0(0x14f),'\x20',_0x282bf8[_0x67a6f0(0x150)],'\x20',a114_0xf8b6f0(Text,{'color':_0x1b3245?_0x67a6f0(0x156):'gray','dimColor':!_0x1b3245,'children':['-\x20',_0x282bf8[_0x67a6f0(0x14c)]]})]})},_0x282bf8[_0x67a6f0(0x155)]);}),a114_0x3ba747(Box,{'marginTop':0x1,'children':a114_0x3ba747(Text,{'color':_0x591e5c(0x15f),'children':_0x591e5c(0x154)})})]})]});}function a114_0x313a(_0x150d2a,_0x433073){_0x150d2a=_0x150d2a-0x14b;const _0x345d64=a114_0x345d();let _0x313af8=_0x345d64[_0x150d2a];return _0x313af8;}export{useIDESelection}from'./useIDESelection.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x46f0a4,_0x5a3004){const _0x412e7b=a115_0x5330,_0x4c147a=_0x46f0a4();while(!![]){try{const _0x1c0580=-parseInt(_0x412e7b(0x1f4))/0x1*(parseInt(_0x412e7b(0x205))/0x2)+parseInt(_0x412e7b(0x1f3))/0x3*(-parseInt(_0x412e7b(0x1f9))/0x4)+-parseInt(_0x412e7b(0x1fa))/0x5+-parseInt(_0x412e7b(0x206))/0x6*(parseInt(_0x412e7b(0x200))/0x7)+parseInt(_0x412e7b(0x1f5))/0x8+-parseInt(_0x412e7b(0x203))/0x9+parseInt(_0x412e7b(0x1f8))/0xa;if(_0x1c0580===_0x5a3004)break;else _0x4c147a['push'](_0x4c147a['shift']());}catch(_0x2a76ea){_0x4c147a['push'](_0x4c147a['shift']());}}}(a115_0x5e45,0x68433));import{useState,useCallback}from'react';function a115_0x5330(_0x1c7e27,_0x298cfd){_0x1c7e27=_0x1c7e27-0x1f2;const _0x5e453c=a115_0x5e45();let _0x533018=_0x5e453c[_0x1c7e27];return _0x533018;}function a115_0x5e45(){const _0x3a39e6=['12jOaodp','3834456dacruH','map','add','41577hhiBVy','102708ovLhlx','1944016loDgcO','filter','from','27593660gOWZSC','196KoFWNF','2607085nhEjbY','downArrow','size','findIndex','delete','key','7tgpodd','upArrow','length','1075293RoCDBN','has'];a115_0x5e45=function(){return _0x3a39e6;};return a115_0x5e45();}export function useIDESelection({ideList:_0x368495,preselectedIDEs:preselectedIDEs=[],multiSelect:multiSelect=!![]}){const _0x4afe1f=a115_0x5330,[_0x5af879,_0x54e417]=useState(new Set(preselectedIDEs[_0x4afe1f(0x207)](_0x207c33=>_0x368495[_0x4afe1f(0x1fd)](_0x2e9f18=>_0x2e9f18[_0x4afe1f(0x1ff)]===_0x207c33))[_0x4afe1f(0x1f6)](_0x40ac90=>_0x40ac90>=0x0))),[_0x10874a,_0x109b98]=useState(0x0),[_0x570967,_0x5e22a4]=useState(''),_0x14035d=useCallback(()=>{_0x109b98(_0x40bd00=>_0x40bd00>0x0?_0x40bd00-0x1:_0x368495['length']-0x1);},[_0x368495[_0x4afe1f(0x202)]]),_0x1bb045=useCallback(()=>{_0x109b98(_0x255c97=>_0x255c97<_0x368495['length']-0x1?_0x255c97+0x1:0x0);},[_0x368495['length']]),_0x20a4e2=useCallback(()=>{if(!multiSelect){_0x54e417(new Set([_0x10874a]));return;}_0x54e417(_0x2fc41f=>{const _0x1674d9=a115_0x5330,_0x13c9fa=new Set(_0x2fc41f);return _0x13c9fa[_0x1674d9(0x204)](_0x10874a)?_0x13c9fa[_0x1674d9(0x1fe)](_0x10874a):_0x13c9fa[_0x1674d9(0x1f2)](_0x10874a),_0x13c9fa;});},[_0x10874a,multiSelect]),_0x765994=useCallback(()=>{const _0x5ecb81=_0x4afe1f;_0x54e417(new Set(_0x368495[_0x5ecb81(0x207)]((_0x231382,_0x259fe2)=>_0x259fe2)));},[_0x368495]),_0x21b5f0=useCallback(()=>{_0x54e417(_0x219361=>{const _0x2f2f89=a115_0x5330,_0x5ce15f=new Set();for(let _0x1c254c=0x0;_0x1c254c<_0x368495[_0x2f2f89(0x202)];_0x1c254c++){!_0x219361[_0x2f2f89(0x204)](_0x1c254c)&&_0x5ce15f[_0x2f2f89(0x1f2)](_0x1c254c);}return _0x5ce15f;});},[_0x368495]),_0x172101=useCallback(()=>{const _0x490ea9=_0x4afe1f;return Array[_0x490ea9(0x1f7)](_0x5af879)[_0x490ea9(0x207)](_0x5d22ee=>_0x368495[_0x5d22ee]?.[_0x490ea9(0x1ff)])['filter'](_0x5739af=>_0x5739af!==undefined);},[_0x5af879,_0x368495]),_0x2feb0e=useCallback(()=>{const _0x20cfcf=_0x4afe1f;return _0x5af879[_0x20cfcf(0x1fc)]===_0x368495['length'];},[_0x5af879,_0x368495]),_0x17e999=useCallback((_0x3c2782,_0x354259)=>{const _0x35877b=_0x4afe1f;if(_0x354259[_0x35877b(0x201)])return _0x14035d(),!![];if(_0x354259[_0x35877b(0x1fb)])return _0x1bb045(),!![];if(_0x3c2782==='\x20')return _0x20a4e2(),!![];if(_0x3c2782==='a'||_0x3c2782==='A')return _0x765994(),!![];if(_0x3c2782==='i'||_0x3c2782==='I'||_0x3c2782==='r'||_0x3c2782==='R')return _0x21b5f0(),!![];return![];},[_0x14035d,_0x1bb045,_0x20a4e2,_0x765994,_0x21b5f0]);return{'selectedIndexes':_0x5af879,'highlightIndex':_0x10874a,'errorMsg':_0x570967,'setErrorMsg':_0x5e22a4,'handleKeyDown':_0x17e999,'getSelectedIDEs':_0x172101,'isAllSelected':_0x2feb0e,'toggleSelection':_0x20a4e2,'selectAll':_0x765994,'invertSelection':_0x21b5f0,'moveHighlightUp':_0x14035d,'moveHighlightDown':_0x1bb045};}
|
package/lib/utils/ai_config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a116_0x1c5257=a116_0x2e0a;function a116_0x2a25(){const _0x47a2b9=['4kWdvzD','.qoder','.cursorrules','agent','8044056OlQaiu','.qoder/rules/rabetbase.md','opencode','.claude/skills/lovrabet/SKILL.md','778199IHCtXX','Qoder','Trae','30AYkuvG','.cline','.claude','codebuddy','Windsurf','OpenCode\x20IDE','.trae','SKILL.md.tpl','claude','2982192dUYSXL','.opencode/skills/lovrabet/SKILL.md','windsurf','523270jGPiFT','CodeBuddy\x20IDE','402660uuLhZu','.codebuddy/skills/lovrabet/SKILL.md','CodeBuddy','Claude\x20Code','Antigravity','7VcQziO','cline','通用模板\x20-\x20兜底方案','Cline\x20IDE','2IFwfnM','trae','其他\x20(通用模板)','.cursor','cursor','codex','946960vAMjek','.opencode','.cursor/skills/rabetbase.md','Qoder\x20IDE','88YQsdoT','.codex','.windsurf/workflows/rabetbase.md','94545iNAHKT','.windsurf','.agent/skills/lovrabet/SKILL.md','.agent','.qoder/skills/lovrabet/SKILL.md','qoder','file','Windsurf\x20IDE','Codex\x20IDE','Cline'];a116_0x2a25=function(){return _0x47a2b9;};return a116_0x2a25();}(function(_0x4d80ee,_0x2d7486){const _0x32598e=a116_0x2e0a,_0x5ac982=_0x4d80ee();while(!![]){try{const _0x52b042=parseInt(_0x32598e(0x141))/0x1*(parseInt(_0x32598e(0x15b))/0x2)+parseInt(_0x32598e(0x14d))/0x3*(parseInt(_0x32598e(0x139))/0x4)+parseInt(_0x32598e(0x150))/0x5+-parseInt(_0x32598e(0x13d))/0x6*(parseInt(_0x32598e(0x157))/0x7)+-parseInt(_0x32598e(0x128))/0x8+-parseInt(_0x32598e(0x12f))/0x9*(-parseInt(_0x32598e(0x144))/0xa)+parseInt(_0x32598e(0x12c))/0xb*(parseInt(_0x32598e(0x152))/0xc);if(_0x52b042===_0x2d7486)break;else _0x5ac982['push'](_0x5ac982['shift']());}catch(_0x2d33e5){_0x5ac982['push'](_0x5ac982['shift']());}}}(a116_0x2a25,0xaf402));export const CORE_IDE_CONFIGS={'cursor':{'name':'Cursor','description':'Cursor\x20IDE','folders':[a116_0x1c5257(0x13b),a116_0x1c5257(0x15e)],'files':[{'type':a116_0x1c5257(0x135),'path':a116_0x1c5257(0x12a),'template':a116_0x1c5257(0x14b)}]},'windsurf':{'name':a116_0x1c5257(0x148),'description':a116_0x1c5257(0x136),'folders':[a116_0x1c5257(0x130)],'files':[{'type':a116_0x1c5257(0x135),'path':a116_0x1c5257(0x12e),'template':a116_0x1c5257(0x14b)}]},'claude':{'name':'Claude\x20Code','description':a116_0x1c5257(0x155),'folders':[a116_0x1c5257(0x146)],'files':[{'type':a116_0x1c5257(0x135),'path':a116_0x1c5257(0x140),'template':a116_0x1c5257(0x14b)}]},'cline':{'name':a116_0x1c5257(0x138),'description':a116_0x1c5257(0x15a),'folders':[a116_0x1c5257(0x145)],'files':[{'type':a116_0x1c5257(0x135),'path':'.cline/skills/lovrabet/SKILL.md','template':a116_0x1c5257(0x14b)}]},'codex':{'name':'Codex','description':a116_0x1c5257(0x137),'folders':[a116_0x1c5257(0x12d)],'files':[{'type':a116_0x1c5257(0x135),'path':'.codex/skills/lovrabet/SKILL.md','template':a116_0x1c5257(0x14b)}]},'opencode':{'name':'OpenCode','description':a116_0x1c5257(0x149),'folders':[a116_0x1c5257(0x129)],'files':[{'type':'file','path':a116_0x1c5257(0x14e),'template':a116_0x1c5257(0x14b)}]},'qoder':{'name':a116_0x1c5257(0x142),'description':a116_0x1c5257(0x12b),'folders':[a116_0x1c5257(0x13a)],'files':[{'type':a116_0x1c5257(0x135),'path':a116_0x1c5257(0x13e),'template':a116_0x1c5257(0x14b)},{'type':a116_0x1c5257(0x135),'path':a116_0x1c5257(0x133),'template':'SKILL.md.tpl'}]},'codebuddy':{'name':a116_0x1c5257(0x154),'description':a116_0x1c5257(0x151),'folders':['.codebuddy'],'files':[{'type':a116_0x1c5257(0x135),'path':a116_0x1c5257(0x153),'template':a116_0x1c5257(0x14b)}]},'trae':{'name':a116_0x1c5257(0x143),'description':'Trae\x20IDE','folders':[a116_0x1c5257(0x14a)],'files':[{'type':a116_0x1c5257(0x135),'path':'.trae/skills/lovrabet/SKILL.md','template':'SKILL.md.tpl'}]}};export const IDE_CONFIGS={...CORE_IDE_CONFIGS,'agent':{'name':a116_0x1c5257(0x15d),'description':a116_0x1c5257(0x159),'folders':[a116_0x1c5257(0x132)],'files':[{'type':a116_0x1c5257(0x135),'path':a116_0x1c5257(0x131),'template':'SKILL.md.tpl'}]},'antigravity':{'name':a116_0x1c5257(0x156),'description':'Antigravity\x20IDE','folders':[a116_0x1c5257(0x132)],'files':[{'type':a116_0x1c5257(0x135),'path':a116_0x1c5257(0x131),'template':a116_0x1c5257(0x14b)}]}};export const CORE_IDE_LIST=[a116_0x1c5257(0x14c),a116_0x1c5257(0x158),a116_0x1c5257(0x147),a116_0x1c5257(0x160),a116_0x1c5257(0x15f),a116_0x1c5257(0x13f),a116_0x1c5257(0x134),a116_0x1c5257(0x15c),a116_0x1c5257(0x14f)];function a116_0x2e0a(_0xab4b38,_0x3b7302){_0xab4b38=_0xab4b38-0x128;const _0x2a2550=a116_0x2a25();let _0x2e0aff=_0x2a2550[_0xab4b38];return _0x2e0aff;}export const IDE_LIST=['antigravity',a116_0x1c5257(0x14c),a116_0x1c5257(0x158),a116_0x1c5257(0x147),'codex',a116_0x1c5257(0x15f),a116_0x1c5257(0x13f),a116_0x1c5257(0x134),a116_0x1c5257(0x15c),a116_0x1c5257(0x14f),a116_0x1c5257(0x13c)];export const ALL_CORE_IDES=[a116_0x1c5257(0x15f),'windsurf',a116_0x1c5257(0x14c),a116_0x1c5257(0x158),a116_0x1c5257(0x160),a116_0x1c5257(0x13f),a116_0x1c5257(0x134),a116_0x1c5257(0x147),a116_0x1c5257(0x15c)];export const MCP_IDES=new Set([a116_0x1c5257(0x15f),'claude']);
|
package/lib/utils/cdn-config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a117_0x4de3(){const _0x5271d3=['now','6RAmfJv','6710ZLOwWp','14814PSYpdN','721880adWpZg','1070tbEXuL','sdk','/config.json','1368YyFjba','418293GQpwYM','536982KUZgkZ','37681OegMtU','stableVersion','23503370jWQSOn','12EAZXEb','4912MhEWaG','json'];a117_0x4de3=function(){return _0x5271d3;};return a117_0x4de3();}function a117_0x35d3(_0x834cd2,_0x416d48){_0x834cd2=_0x834cd2-0xdb;const _0x4de315=a117_0x4de3();let _0x35d360=_0x4de315[_0x834cd2];return _0x35d360;}(function(_0x128a85,_0x368fe2){const _0x5324a8=a117_0x35d3,_0x5b5f85=_0x128a85();while(!![]){try{const _0x2f0720=-parseInt(_0x5324a8(0xe4))/0x1+parseInt(_0x5324a8(0xe1))/0x2*(-parseInt(_0x5324a8(0xe9))/0x3)+-parseInt(_0x5324a8(0xde))/0x4*(parseInt(_0x5324a8(0xe5))/0x5)+parseInt(_0x5324a8(0xea))/0x6+parseInt(_0x5324a8(0xeb))/0x7*(parseInt(_0x5324a8(0xe8))/0x8)+-parseInt(_0x5324a8(0xe3))/0x9*(parseInt(_0x5324a8(0xe2))/0xa)+-parseInt(_0x5324a8(0xdc))/0xb*(-parseInt(_0x5324a8(0xdd))/0xc);if(_0x2f0720===_0x368fe2)break;else _0x5b5f85['push'](_0x5b5f85['shift']());}catch(_0x56bebc){_0x5b5f85['push'](_0x5b5f85['shift']());}}}(a117_0x4de3,0x9c0fd));import{getTemplateBaseUrl}from'./config.js';export async function fetchCdnConfig(){const _0x4e88f9=a117_0x35d3;try{const _0x54dfb2=getTemplateBaseUrl(),_0x300bac=_0x54dfb2+_0x4e88f9(0xe7),_0x1f2428=await fetch(_0x300bac,{'headers':{'Accept':'application/json'}});if(!_0x1f2428['ok'])return null;const _0x33d0fe=await _0x1f2428[_0x4e88f9(0xdf)]();if(!_0x33d0fe['cli']?.[_0x4e88f9(0xdb)]||!_0x33d0fe[_0x4e88f9(0xe6)]?.['node']?.[_0x4e88f9(0xdb)])return null;return _0x33d0fe;}catch{return null;}}let cachedConfig=null,cacheTime=0x0;const CACHE_TTL=0x5*0x3c*0x3e8;export async function getCdnConfig(){const _0x52dd47=a117_0x35d3,_0xcfed99=Date[_0x52dd47(0xe0)]();if(cachedConfig&&_0xcfed99-cacheTime<CACHE_TTL)return cachedConfig;const _0x5a8d39=await fetchCdnConfig();return _0x5a8d39&&(cachedConfig=_0x5a8d39,cacheTime=_0xcfed99),_0x5a8d39;}export function clearCdnConfigCache(){cachedConfig=null,cacheTime=0x0;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a118_0x2aa5ae=a118_0x4764;(function(_0x5705c5,_0x37a63e){const _0x1926b2=a118_0x4764,_0x5b5ce6=_0x5705c5();while(!![]){try{const _0x3e068f=-parseInt(_0x1926b2(0x14b))/0x1+-parseInt(_0x1926b2(0x13b))/0x2*(-parseInt(_0x1926b2(0x13d))/0x3)+parseInt(_0x1926b2(0x138))/0x4+parseInt(_0x1926b2(0x13c))/0x5+-parseInt(_0x1926b2(0x14d))/0x6+parseInt(_0x1926b2(0x12b))/0x7+-parseInt(_0x1926b2(0x135))/0x8*(parseInt(_0x1926b2(0x141))/0x9);if(_0x3e068f===_0x37a63e)break;else _0x5b5ce6['push'](_0x5b5ce6['shift']());}catch(_0x84fd56){_0x5b5ce6['push'](_0x5b5ce6['shift']());}}}(a118_0x2489,0xe8f72));import a118_0x1bb137 from'node:fs';import a118_0x1b6ff4 from'node:path';import a118_0x1d9ee5 from'semver';import{getCdnConfig}from'./cdn-config.js';const FALLBACK_MIN_SDK_VERSION=a118_0x2aa5ae(0x146);function a118_0x2489(){const _0x424757=['utf8','1.2.0','sdk','test','dependencies','stableVersion','287490zPZnID','@lovrabet/sdk','4480326obGfqv','readFileSync','\x20\x20\x20Stable\x20version:\x20','parse','coerce','\x1b[0m','12629799JVUKRy','node_modules','package.json','latest','version','\x1b[33m','devDependencies','node','minVersion','existsSync','32svSDuK','join','↪\x20SDK\x20update\x20available','1759680LcwyXq','needsUpgrade','some','6MpxKRD','7904625jmqcMR','469263xmMgHN','\x20\x20\x20Current\x20version:\x20','all','\x1b[1m','5188338ijozEb','log','utf-8','packageName'];a118_0x2489=function(){return _0x424757;};return a118_0x2489();}function isNonNumericVersion(_0x2b84b3){const _0x4eb1d9=a118_0x2aa5ae,_0x3ce392=[/^latest$/i,/^beta$/i,/^alpha$/i,/^canary$/i,/^\*$/,/^x$/];return _0x3ce392[_0x4eb1d9(0x13a)](_0x5a1cce=>_0x5a1cce[_0x4eb1d9(0x148)](_0x2b84b3));}function a118_0x4764(_0x3a5a04,_0x9e21e0){_0x3a5a04=_0x3a5a04-0x12b;const _0x2489db=a118_0x2489();let _0x47645c=_0x2489db[_0x3a5a04];return _0x47645c;}function getInstalledVersion(_0x14639e,_0x5bf274){const _0x450665=a118_0x2aa5ae;try{const _0x59d8eb=a118_0x1b6ff4[_0x450665(0x136)](_0x14639e,_0x450665(0x12c),_0x5bf274,_0x450665(0x12d));if(a118_0x1bb137[_0x450665(0x134)](_0x59d8eb)){const _0x49f947=JSON[_0x450665(0x150)](a118_0x1bb137[_0x450665(0x14e)](_0x59d8eb,_0x450665(0x143)));return _0x49f947[_0x450665(0x12f)]||null;}}catch{}return null;}async function getSdkStableVersion(){const _0x30bb21=a118_0x2aa5ae;try{const _0x286627=await getCdnConfig();return _0x286627?.[_0x30bb21(0x147)]?.[_0x30bb21(0x132)]?.[_0x30bb21(0x14a)]||null;}catch{return null;}}async function getSdkPackageName(){const _0x20ff8b=a118_0x2aa5ae;try{const _0x537ef7=await getCdnConfig();return _0x537ef7?.[_0x20ff8b(0x147)]?.['node']?.[_0x20ff8b(0x144)]||_0x20ff8b(0x14c);}catch{return _0x20ff8b(0x14c);}}export async function checkSdkVersion(_0x225886){const _0x554ce7=a118_0x2aa5ae,_0x39ebd7=a118_0x1b6ff4[_0x554ce7(0x136)](_0x225886,_0x554ce7(0x12d)),[_0x548f9b,_0x25a278]=await Promise[_0x554ce7(0x13f)]([getSdkStableVersion(),getSdkPackageName()]),_0x3cb956=_0x548f9b||FALLBACK_MIN_SDK_VERSION;if(!a118_0x1bb137[_0x554ce7(0x134)](_0x39ebd7))return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':_0x3cb956,'packageName':_0x25a278,'stableVersion':_0x548f9b};try{const _0xbcc2b6=JSON[_0x554ce7(0x150)](a118_0x1bb137[_0x554ce7(0x14e)](_0x39ebd7,_0x554ce7(0x145))),_0x5f5d47=_0xbcc2b6[_0x554ce7(0x149)]||{},_0x26918b=_0xbcc2b6[_0x554ce7(0x131)]||{},_0x5c3d56=_0x5f5d47[_0x25a278]||_0x26918b[_0x25a278];if(!_0x5c3d56)return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':_0x3cb956,'packageName':_0x25a278,'stableVersion':_0x548f9b};let _0x1f9b87=getInstalledVersion(_0x225886,_0x25a278);!_0x1f9b87&&(_0x1f9b87=_0x5c3d56);if(isNonNumericVersion(_0x5c3d56))return{'installed':!![],'version':_0x1f9b87,'needsUpgrade':![],'minVersion':_0x3cb956,'packageName':_0x25a278,'stableVersion':_0x548f9b};const _0x5617fb=a118_0x1d9ee5[_0x554ce7(0x151)](_0x1f9b87),_0x4bdcea=a118_0x1d9ee5[_0x554ce7(0x151)](_0x3cb956),_0x48c8f0=_0x5617fb&&_0x4bdcea?a118_0x1d9ee5['lt'](_0x5617fb,_0x4bdcea):![];return{'installed':!![],'version':_0x1f9b87,'needsUpgrade':_0x48c8f0,'minVersion':_0x3cb956,'packageName':_0x25a278,'stableVersion':_0x548f9b};}catch{return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':_0x3cb956,'packageName':_0x25a278,'stableVersion':_0x548f9b};}}export function checkSdkVersionSync(_0x27c698){const _0x13a3c8=a118_0x2aa5ae,_0x3f792e=a118_0x1b6ff4[_0x13a3c8(0x136)](_0x27c698,_0x13a3c8(0x12d)),_0x235f2d=_0x13a3c8(0x14c);if(!a118_0x1bb137[_0x13a3c8(0x134)](_0x3f792e))return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':FALLBACK_MIN_SDK_VERSION,'packageName':_0x235f2d,'stableVersion':null};try{const _0x87da20=JSON[_0x13a3c8(0x150)](a118_0x1bb137[_0x13a3c8(0x14e)](_0x3f792e,_0x13a3c8(0x145))),_0x6669f6=_0x87da20[_0x13a3c8(0x149)]||{},_0x272b3a=_0x87da20[_0x13a3c8(0x131)]||{},_0x2e7e99=_0x6669f6[_0x235f2d]||_0x272b3a[_0x235f2d];if(!_0x2e7e99)return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':FALLBACK_MIN_SDK_VERSION,'packageName':_0x235f2d,'stableVersion':null};let _0x5aad58=getInstalledVersion(_0x27c698,_0x235f2d);!_0x5aad58&&(_0x5aad58=_0x2e7e99);if(isNonNumericVersion(_0x2e7e99))return{'installed':!![],'version':_0x5aad58,'needsUpgrade':![],'minVersion':FALLBACK_MIN_SDK_VERSION,'packageName':_0x235f2d,'stableVersion':null};const _0xb9ba99=a118_0x1d9ee5['coerce'](_0x5aad58),_0xd66607=_0xb9ba99?a118_0x1d9ee5['lt'](_0xb9ba99,FALLBACK_MIN_SDK_VERSION):![];return{'installed':!![],'version':_0x5aad58,'needsUpgrade':_0xd66607,'minVersion':FALLBACK_MIN_SDK_VERSION,'packageName':_0x235f2d,'stableVersion':null};}catch{return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':FALLBACK_MIN_SDK_VERSION,'packageName':_0x235f2d,'stableVersion':null};}}export function printSdkUpgradeWarning(_0xdb78cf){const _0x46f1f3=a118_0x2aa5ae;if(!_0xdb78cf[_0x46f1f3(0x139)])return;const _0x2f29f0=_0x46f1f3(0x130),_0x80a7b1=_0x46f1f3(0x152),_0x246caa=_0x46f1f3(0x140),_0x31a7c0=_0xdb78cf['packageName']||_0x46f1f3(0x14c),_0x16b262=_0xdb78cf[_0x46f1f3(0x14a)]||_0xdb78cf[_0x46f1f3(0x133)],_0x235527='npm\x20install\x20'+_0x31a7c0+'@'+(_0x16b262||_0x46f1f3(0x12e));console['log'](),console[_0x46f1f3(0x142)](''+_0x2f29f0+_0x246caa+_0x46f1f3(0x137)+_0x80a7b1),console[_0x46f1f3(0x142)](_0x2f29f0+_0x46f1f3(0x13e)+_0x31a7c0+'@'+_0xdb78cf[_0x46f1f3(0x12f)]+_0x80a7b1),console[_0x46f1f3(0x142)](_0x2f29f0+_0x46f1f3(0x14f)+_0x16b262+_0x80a7b1),console[_0x46f1f3(0x142)](_0x2f29f0+'\x20\x20\x20Upgrade\x20command:\x20'+_0x235527+_0x80a7b1),console[_0x46f1f3(0x142)]();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x40eba5,_0x701d5d){const _0x258b04=a119_0x537a,_0x52aa94=_0x40eba5();while(!![]){try{const _0x4cc55a=-parseInt(_0x258b04(0x1a2))/0x1+-parseInt(_0x258b04(0x1ac))/0x2*(-parseInt(_0x258b04(0x1a5))/0x3)+parseInt(_0x258b04(0x1a9))/0x4*(-parseInt(_0x258b04(0x1a7))/0x5)+parseInt(_0x258b04(0x19b))/0x6*(parseInt(_0x258b04(0x1af))/0x7)+parseInt(_0x258b04(0x19d))/0x8+-parseInt(_0x258b04(0x199))/0x9+parseInt(_0x258b04(0x1a4))/0xa*(parseInt(_0x258b04(0x1b3))/0xb);if(_0x4cc55a===_0x701d5d)break;else _0x52aa94['push'](_0x52aa94['shift']());}catch(_0x4c74da){_0x52aa94['push'](_0x52aa94['shift']());}}}(a119_0x3eed,0x1a584));function a119_0x3eed(){const _0xeda629=['182596yGMmrV','needsUpgrade','44000VRtuhY','1029JYuNFs','\x20\x20\x20Current\x20CLI\x20version:\x20','80sGHZwr','package.json','20932Eevfxd','parse','utf-8','582xpRmRB','coerce','\x1b[0m','5817pHLxnC','../..','\x20\x20\x20Stable\x20version:\x20','log','363wVvLag','version','506745CFOmzB','↪\x20New\x20version\x20available','1038gTMRHr','\x20\x20\x20Upgrade\x20command:\x20','334088MwpGyO','test','stableVersion','\x1b[33m','some'];a119_0x3eed=function(){return _0xeda629;};return a119_0x3eed();}import{readFileSync}from'node:fs';function a119_0x537a(_0xe6a547,_0x370959){_0xe6a547=_0xe6a547-0x199;const _0x3eed68=a119_0x3eed();let _0x537aa0=_0x3eed68[_0xe6a547];return _0x537aa0;}import{resolve,dirname}from'node:path';import{fileURLToPath}from'node:url';import a119_0x2d59f8 from'semver';import{getCdnConfig}from'./cdn-config.js';import{NPM_PACKAGE_NAME}from'../constant/cli.js';function getCurrentCliVersion(){const _0x392f3c=a119_0x537a;try{const _0x480c7f=fileURLToPath(import.meta.url),_0x231253=resolve(dirname(_0x480c7f),_0x392f3c(0x1b0)),_0x318af7=resolve(_0x231253,_0x392f3c(0x1a8)),_0x167c72=JSON[_0x392f3c(0x1aa)](readFileSync(_0x318af7,_0x392f3c(0x1ab)));return _0x167c72[_0x392f3c(0x1b4)]||'1.0.0';}catch{return'1.0.0';}}function isNonNumericVersion(_0x3f1822){const _0x2c835d=a119_0x537a,_0x557854=[/^latest$/i,/^beta$/i,/^alpha$/i,/^canary$/i,/^\^/,/^~/,/^>/,/^</,/^\*/,/^x$/];return _0x557854[_0x2c835d(0x1a1)](_0x543867=>_0x543867[_0x2c835d(0x19e)](_0x3f1822));}export async function checkCliVersion(){const _0x1e7fbc=a119_0x537a,_0x5e914f=getCurrentCliVersion(),_0x5017de=await getCdnConfig(),_0x3e1c14=_0x5017de?.['cli']?.[_0x1e7fbc(0x19f)]||null;let _0x3a3abc=![];if(_0x3e1c14)try{const _0x536c11=a119_0x2d59f8[_0x1e7fbc(0x1ad)](_0x5e914f),_0x59c787=a119_0x2d59f8[_0x1e7fbc(0x1ad)](_0x3e1c14);_0x536c11&&_0x59c787&&(_0x3a3abc=a119_0x2d59f8['lt'](_0x536c11,_0x59c787));}catch{_0x3a3abc=![];}return{'currentVersion':_0x5e914f,'stableVersion':_0x3e1c14,'needsUpgrade':_0x3a3abc,'isPreRelease':![]};}export function printCliUpgradeWarning(_0x5ca090){const _0x5f128a=a119_0x537a;if(!_0x5ca090[_0x5f128a(0x1a3)])return;const _0x2e066a=_0x5f128a(0x1a0),_0xc49263=_0x5f128a(0x1ae),_0x550601='\x1b[1m',_0x5321f1='npm\x20install\x20-g\x20'+NPM_PACKAGE_NAME+'@latest';console[_0x5f128a(0x1b2)](),console[_0x5f128a(0x1b2)](''+_0x2e066a+_0x550601+_0x5f128a(0x19a)+_0xc49263),console[_0x5f128a(0x1b2)](_0x2e066a+_0x5f128a(0x1a6)+_0x5ca090['currentVersion']+_0xc49263),console['log'](_0x2e066a+_0x5f128a(0x1b1)+_0x5ca090[_0x5f128a(0x19f)]+_0xc49263),console[_0x5f128a(0x1b2)](_0x2e066a+_0x5f128a(0x19c)+_0x5321f1+_0xc49263),console['log']();}
|
package/lib/utils/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3a8820,_0x14e6dc){const _0x529680=a120_0x3241,_0x4dc9cd=_0x3a8820();while(!![]){try{const _0x2c9bc3=parseInt(_0x529680(0x71))/0x1*(-parseInt(_0x529680(0x72))/0x2)+parseInt(_0x529680(0x76))/0x3*(parseInt(_0x529680(0x7f))/0x4)+-parseInt(_0x529680(0x70))/0x5*(parseInt(_0x529680(0x75))/0x6)+-parseInt(_0x529680(0x79))/0x7+-parseInt(_0x529680(0x77))/0x8*(-parseInt(_0x529680(0x74))/0x9)+parseInt(_0x529680(0x78))/0xa+-parseInt(_0x529680(0x7e))/0xb*(-parseInt(_0x529680(0x7d))/0xc);if(_0x2c9bc3===_0x14e6dc)break;else _0x4dc9cd['push'](_0x4dc9cd['shift']());}catch(_0x242aca){_0x4dc9cd['push'](_0x4dc9cd['shift']());}}}(a120_0x3a74,0x75450));function a120_0x3241(_0x3b7e41,_0x2d671f){_0x3b7e41=_0x3b7e41-0x6e;const _0x3a74d0=a120_0x3a74();let _0x324169=_0x3a74d0[_0x3b7e41];return _0x324169;}import{initEnv}from'../constant/env.js';import{readRawConfig}from'../context.js';export{getProjectConfigPath,getGlobalConfigPath}from'../context.js';function a120_0x3a74(){const _0x19ce87=['243144mISoLU','328250TpQNKZ','677803ocwmam','env','template_base_url','replace','12UOZXVk','6798539CPFLLx','20MIAGLa','string','https://g.lovrabet.com/dist/lovrabet-skill','5RQIKfM','1224TllmNR','982mvyWcW','trim','27zStUqM','522894BtpuwG','313947BADgvW'];a120_0x3a74=function(){return _0x19ce87;};return a120_0x3a74();}export{isInProject}from'../context.js';export function readConfig(_0x842b44){const _0x1616c1=a120_0x3241,_0x3fa44b=readRawConfig(_0x842b44);return _0x3fa44b[_0x1616c1(0x7a)]&&typeof _0x3fa44b['env']===_0x1616c1(0x6e)&&initEnv(_0x3fa44b['env']),_0x3fa44b;}export function getConfigAppCode(){const _0x337e3a=a120_0x3241,_0x5a7989=readRawConfig(),_0x53ed10=_0x5a7989['appcode']||_0x5a7989['app'];if(typeof _0x53ed10!==_0x337e3a(0x6e)||_0x53ed10[_0x337e3a(0x73)]()==='')return undefined;return _0x53ed10[_0x337e3a(0x73)]();}export function getTemplateBaseUrl(){const _0x37464c=a120_0x3241,_0x492863=readRawConfig();if(_0x492863[_0x37464c(0x7b)]&&typeof _0x492863[_0x37464c(0x7b)]===_0x37464c(0x6e))return _0x492863[_0x37464c(0x7b)][_0x37464c(0x7c)](/\/$/,'');return _0x37464c(0x6f);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x2c8fb5,_0x217bf4){const _0x761da6=a121_0x4098,_0x30f387=_0x2c8fb5();while(!![]){try{const _0x4a9a24=parseInt(_0x761da6(0xe1))/0x1*(-parseInt(_0x761da6(0xd7))/0x2)+-parseInt(_0x761da6(0xe0))/0x3+-parseInt(_0x761da6(0xe4))/0x4*(-parseInt(_0x761da6(0xd9))/0x5)+-parseInt(_0x761da6(0xdb))/0x6*(-parseInt(_0x761da6(0xdf))/0x7)+-parseInt(_0x761da6(0xd6))/0x8+-parseInt(_0x761da6(0xda))/0x9+parseInt(_0x761da6(0xd8))/0xa*(parseInt(_0x761da6(0xe2))/0xb);if(_0x4a9a24===_0x217bf4)break;else _0x30f387['push'](_0x30f387['shift']());}catch(_0x511252){_0x30f387['push'](_0x30f387['shift']());}}}(a121_0x562c,0x97945));function a121_0x562c(){const _0x34d754=['913QmPLsq','name','4UnfPoV','mkdirSync','error','isDirectory','readdirSync','1624728BInEjW','107736nufHTH','194930mzDPNr','702895PORcyX','834138BiZNlM','1806iVWKwi','copyFileSync','join','复制目录时出错:','1939isgVxz','2452491YMrpEj','2soovYu'];a121_0x562c=function(){return _0x34d754;};return a121_0x562c();}import a121_0x364a67 from'node:path';import a121_0x3adb6d from'node:fs';function a121_0x4098(_0x355a8d,_0x160bd4){_0x355a8d=_0x355a8d-0xd2;const _0x562ce9=a121_0x562c();let _0x4098cb=_0x562ce9[_0x355a8d];return _0x4098cb;}export async function copyDirectory(_0x2f2307,_0x2e9236){const _0x59712e=a121_0x4098;try{const _0x5ee9bb=a121_0x3adb6d[_0x59712e(0xd5)](_0x2f2307,{'withFileTypes':!![]});a121_0x3adb6d[_0x59712e(0xd2)](_0x2e9236,{'recursive':!![]});for(const _0x118180 of _0x5ee9bb){const _0x1b88c8=a121_0x364a67[_0x59712e(0xdd)](_0x2f2307,_0x118180[_0x59712e(0xe3)]),_0x4f4d09=a121_0x364a67[_0x59712e(0xdd)](_0x2e9236,_0x118180['name']);_0x118180[_0x59712e(0xd4)]()?await copyDirectory(_0x1b88c8,_0x4f4d09):a121_0x3adb6d[_0x59712e(0xdc)](_0x1b88c8,_0x4f4d09);}}catch(_0x12cd64){console[_0x59712e(0xd3)](_0x59712e(0xde),_0x12cd64);}}
|
package/lib/utils/file-utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a122_0x310e(_0x2fb4cc,_0xd402e4){_0x2fb4cc=_0x2fb4cc-0x1a2;const _0x5c9e41=a122_0x5c9e();let _0x310e73=_0x5c9e41[_0x2fb4cc];return _0x310e73;}(function(_0x405e93,_0x153aa3){const _0x4c0cac=a122_0x310e,_0x5db01a=_0x405e93();while(!![]){try{const _0x56fd46=parseInt(_0x4c0cac(0x1a4))/0x1*(-parseInt(_0x4c0cac(0x1a5))/0x2)+parseInt(_0x4c0cac(0x1ac))/0x3*(-parseInt(_0x4c0cac(0x1a3))/0x4)+-parseInt(_0x4c0cac(0x1a9))/0x5+parseInt(_0x4c0cac(0x1a2))/0x6*(-parseInt(_0x4c0cac(0x1a6))/0x7)+-parseInt(_0x4c0cac(0x1ab))/0x8*(-parseInt(_0x4c0cac(0x1aa))/0x9)+parseInt(_0x4c0cac(0x1a7))/0xa+parseInt(_0x4c0cac(0x1a8))/0xb;if(_0x56fd46===_0x153aa3)break;else _0x5db01a['push'](_0x5db01a['shift']());}catch(_0x5d9b06){_0x5db01a['push'](_0x5db01a['shift']());}}}(a122_0x5c9e,0x79935));function a122_0x5c9e(){const _0x1136f3=['3CfefZN','6FkxZcz','1388144ChnQqU','76103aWrYXl','6fSeGRG','2409358cFiCqp','8578030JjpLSo','3104002cJaOeQ','1693065JDBsyQ','108ezhmpF','410760LvBUgS'];a122_0x5c9e=function(){return _0x1136f3;};return a122_0x5c9e();}import{existsSync,mkdirSync,copyFileSync,readdirSync,statSync}from'node:fs';import{join}from'node:path';export async function copyDir(_0x11ea7d,_0x56c3ed){const _0x39d26e=statSync(_0x11ea7d);if(_0x39d26e['isDirectory']()){!existsSync(_0x56c3ed)&&mkdirSync(_0x56c3ed,{'recursive':!![]});const _0x3f7b6b=readdirSync(_0x11ea7d);for(const _0x2cae10 of _0x3f7b6b){await copyDir(join(_0x11ea7d,_0x2cae10),join(_0x56c3ed,_0x2cae10));}}else copyFileSync(_0x11ea7d,_0x56c3ed);}export function ensureDir(_0x1279f6){!existsSync(_0x1279f6)&&mkdirSync(_0x1279f6,{'recursive':!![]});}export function pathExists(_0x3c5a7b){return existsSync(_0x3c5a7b);}
|
package/lib/utils/guides-cdn.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a123_0x33633c=a123_0xfa0f;(function(_0x3cec9b,_0xe51e0e){const _0x11b6c0=a123_0xfa0f,_0x48ff1a=_0x3cec9b();while(!![]){try{const _0x53df6b=-parseInt(_0x11b6c0(0x199))/0x1+-parseInt(_0x11b6c0(0x180))/0x2*(parseInt(_0x11b6c0(0x18b))/0x3)+-parseInt(_0x11b6c0(0x17c))/0x4*(parseInt(_0x11b6c0(0x179))/0x5)+-parseInt(_0x11b6c0(0x19a))/0x6+-parseInt(_0x11b6c0(0x195))/0x7+-parseInt(_0x11b6c0(0x18c))/0x8*(-parseInt(_0x11b6c0(0x196))/0x9)+-parseInt(_0x11b6c0(0x193))/0xa*(-parseInt(_0x11b6c0(0x187))/0xb);if(_0x53df6b===_0xe51e0e)break;else _0x48ff1a['push'](_0x48ff1a['shift']());}catch(_0x16c50f){_0x48ff1a['push'](_0x48ff1a['shift']());}}}(a123_0x2d4e,0xcc1d8));import{mkdirSync,writeFileSync}from'node:fs';import{dirname,join}from'node:path';import{getTemplateBaseUrl}from'./config.js';function a123_0x2d4e(){const _0x42b376=['application/json','length','lastUpdated','14030yylOMM','object','skillTemplate','.lovrabet/skill/guides','push','trimEnd','guides','995423ADLzWF','status','extendContent','CDN\x20请求失败:\x20','303hiuned','9495072wKDzGp','entries','keys','.lovrabet','content','utf-8','CDN\x20数据中缺少\x20skillTemplate','390CHvIod','/skills/guides.json','7543410tyWtwg','9yDNRXX','json','.md','1665479yyprWX','88674KfRftt','join','statusText','344710pEPytB','USERPROFILE','env','24Ebkrem'];a123_0x2d4e=function(){return _0x42b376;};return a123_0x2d4e();}function getGuidesCdnUrl(){const _0x4c6164=a123_0xfa0f,_0x1e3291=getTemplateBaseUrl();return _0x1e3291+_0x4c6164(0x194);}const CACHE_DIR=join(process[a123_0x33633c(0x17b)]['HOME']||process[a123_0x33633c(0x17b)][a123_0x33633c(0x17a)]||'',a123_0x33633c(0x18f),'cache');export async function fetchGuidesFromCDN(){const _0x49202b=a123_0x33633c,_0x25b6f8=getGuidesCdnUrl(),_0x214e7c=await fetch(_0x25b6f8,{'headers':{'Accept':_0x49202b(0x17d)}});if(!_0x214e7c['ok'])throw new Error(_0x49202b(0x18a)+_0x214e7c[_0x49202b(0x188)]+'\x20'+_0x214e7c[_0x49202b(0x178)]);const _0x2ab338=await _0x214e7c[_0x49202b(0x197)]();if(!_0x2ab338[_0x49202b(0x186)]||typeof _0x2ab338['guides']!==_0x49202b(0x181))throw new Error('CDN\x20返回数据格式错误');return _0x2ab338;}export function writeGuidesToProject(_0x41a3e5,_0x41a6d9,_0x45c405=a123_0x33633c(0x183),_0x54a43f){const _0x580dc3=a123_0x33633c,_0x41dccc=join(_0x41a6d9,_0x45c405);mkdirSync(_0x41dccc,{'recursive':!![]});for(const [_0x42e8ee,_0xa1eaf6]of Object['entries'](_0x41a3e5[_0x580dc3(0x186)])){let _0x394fd2=_0xa1eaf6[_0x580dc3(0x190)];_0xa1eaf6[_0x580dc3(0x17f)]&&(_0x394fd2=appendUpdateTime(_0x394fd2,_0xa1eaf6[_0x580dc3(0x17f)])),writeFileSync(join(_0x41dccc,_0x42e8ee+_0x580dc3(0x198)),_0x394fd2,_0x580dc3(0x191));}}function a123_0xfa0f(_0x20b2dc,_0x3503ec){_0x20b2dc=_0x20b2dc-0x178;const _0x2d4e8c=a123_0x2d4e();let _0xfa0fbd=_0x2d4e8c[_0x20b2dc];return _0xfa0fbd;}export function appendUpdateTime(_0x26e1a8,_0x33d952){const _0x3acfa4=a123_0x33633c;return _0x26e1a8=_0x26e1a8['replace'](/\n*>更新时间:.*$/m,''),_0x26e1a8[_0x3acfa4(0x185)]()+('\x0a\x0a>更新时间:'+_0x33d952);}export function getSkillTemplate(_0x140d59){const _0x1cfb8b=a123_0x33633c;return _0x140d59[_0x1cfb8b(0x182)]?.['content']||'';}export function appendExtendContents(_0x4efe83,_0x2b12c8,_0x26fec2){const _0x15a689=a123_0x33633c,_0x3da341=[];for(const [,_0x92d73e]of Object['entries'](_0x2b12c8[_0x15a689(0x186)])){_0x92d73e[_0x15a689(0x189)]&&_0x3da341[_0x15a689(0x184)](_0x92d73e[_0x15a689(0x189)][_0x15a689(0x185)]());}if(_0x3da341[_0x15a689(0x17e)]===0x0)return _0x4efe83;return _0x4efe83[_0x15a689(0x185)]()+'\x0a\x0a'+_0x3da341[_0x15a689(0x19b)]('\x0a\x0a')+'\x0a';}export function writeSkillFile(_0x14ff49,_0x2cfb6e,_0x24d53e){const _0x13edb5=a123_0x33633c,_0x243855=getSkillTemplate(_0x14ff49);if(!_0x243855)throw new Error(_0x13edb5(0x192));const _0x567d23=dirname(_0x2cfb6e);mkdirSync(_0x567d23,{'recursive':!![]});let _0x542652=_0x243855['replace'](/\{\{IDE_NAME\}\}/g,_0x24d53e);_0x542652=appendExtendContents(_0x542652,_0x14ff49),_0x14ff49['skillTemplate'][_0x13edb5(0x17f)]&&(_0x542652=appendUpdateTime(_0x542652,_0x14ff49[_0x13edb5(0x182)][_0x13edb5(0x17f)])),writeFileSync(_0x2cfb6e,_0x542652,_0x13edb5(0x191));}export async function installGuides(_0x24feb5){const _0x1d9353=a123_0x33633c,_0x110ba0=await fetchGuidesFromCDN();return writeGuidesToProject(_0x110ba0,_0x24feb5),Object[_0x1d9353(0x18e)](_0x110ba0[_0x1d9353(0x186)])[_0x1d9353(0x17e)];}export function getGuidesSummary(_0x8db8f){const _0x4848d3=a123_0x33633c;return Object[_0x4848d3(0x18d)](_0x8db8f[_0x4848d3(0x186)])['map'](([_0x2a9e73,_0x59145c])=>({'key':_0x2a9e73,'title':_0x59145c['title'],'path':_0x59145c['path']}));}
|
package/lib/utils/http-client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x498279,_0x12c7c1){const _0x2bdd99=a124_0x3e66,_0x459c01=_0x498279();while(!![]){try{const _0x5928f1=-parseInt(_0x2bdd99(0x1ab))/0x1+parseInt(_0x2bdd99(0x1a6))/0x2+parseInt(_0x2bdd99(0x1a3))/0x3+parseInt(_0x2bdd99(0x1a9))/0x4*(-parseInt(_0x2bdd99(0x1ac))/0x5)+-parseInt(_0x2bdd99(0x1b1))/0x6+-parseInt(_0x2bdd99(0x1b3))/0x7*(parseInt(_0x2bdd99(0x1ae))/0x8)+parseInt(_0x2bdd99(0x1a8))/0x9;if(_0x5928f1===_0x12c7c1)break;else _0x459c01['push'](_0x459c01['shift']());}catch(_0x27c770){_0x459c01['push'](_0x459c01['shift']());}}}(a124_0x5917,0x9cf70));function a124_0x3e66(_0x21bfdc,_0x7bbdcf){_0x21bfdc=_0x21bfdc-0x19e;const _0x591723=a124_0x5917();let _0x3e66cb=_0x591723[_0x21bfdc];return _0x3e66cb;}export async function httpRequest(_0x42e774,_0x5103d5={}){const _0x16d66b=a124_0x3e66,{timeout:timeout=0x7530,retries:retries=0x3,retryDelay:retryDelay=0x3e8,headers:headers={}}=_0x5103d5;let _0x7d41d5=null;for(let _0x5f1692=0x0;_0x5f1692<=retries;_0x5f1692++){try{const _0x20585d=new AbortController(),_0x255fb3=setTimeout(()=>_0x20585d[_0x16d66b(0x1a2)](),timeout),_0x1e8729=await fetch(_0x42e774,{'headers':headers,'signal':_0x20585d['signal']});clearTimeout(_0x255fb3);let _0x57bd00;const _0x17da4c=_0x1e8729[_0x16d66b(0x1b6)]['get'](_0x16d66b(0x1a0));return _0x17da4c?.[_0x16d66b(0x1b2)](_0x16d66b(0x1a5))?_0x57bd00=await _0x1e8729[_0x16d66b(0x19e)]():_0x57bd00=await _0x1e8729[_0x16d66b(0x1b4)](),{'ok':_0x1e8729['ok'],'status':_0x1e8729[_0x16d66b(0x1af)],'statusText':_0x1e8729[_0x16d66b(0x1b5)],'data':_0x57bd00,'headers':_0x1e8729[_0x16d66b(0x1b6)],'url':_0x1e8729[_0x16d66b(0x1b7)],'text':()=>_0x1e8729[_0x16d66b(0x1b4)]()};}catch(_0x3e26d0){_0x7d41d5=_0x3e26d0 instanceof Error?_0x3e26d0:new Error(String(_0x3e26d0));if(_0x5f1692===retries)break;if(shouldRetry(_0x3e26d0)){console[_0x16d66b(0x1b0)](_0x16d66b(0x1a1)+retryDelay+_0x16d66b(0x1a4)+(_0x5f1692+0x1)+'\x20次重试...'),await sleep(retryDelay);continue;}else break;}}throw _0x7d41d5||new Error('Request\x20failed');}function shouldRetry(_0x4f16e1){const _0xba5c02=a124_0x3e66;if(_0x4f16e1 instanceof Error){if(_0x4f16e1[_0xba5c02(0x1ad)]==='AbortError')return![];if(_0x4f16e1['name']==='TypeError'&&_0x4f16e1[_0xba5c02(0x19f)][_0xba5c02(0x1b2)](_0xba5c02(0x1aa)))return!![];if(_0x4f16e1[_0xba5c02(0x19f)][_0xba5c02(0x1b2)]('ECONNRESET'))return!![];if(_0x4f16e1[_0xba5c02(0x19f)][_0xba5c02(0x1b2)](_0xba5c02(0x1a7)))return![];}return![];}function sleep(_0x33ad5e){return new Promise(_0x4e044d=>setTimeout(_0x4e044d,_0x33ad5e));}function a124_0x5917(){const _0x43f187=['1553121dBRfut','ms\x20后进行第\x20','application/json','692506VuxObJ','ENOTFOUND','21340827DkSfeA','32vmZVKP','fetch','272146kPqtwV','514310lsOoGP','name','6160776FIUfoz','status','log','4362576uhUeyE','includes','7cHSdSY','text','statusText','headers','url','json','message','content-type','*\x20请求失败,','abort'];a124_0x5917=function(){return _0x43f187;};return a124_0x5917();}export function validateUrl(_0x5cc9c1){try{return new URL(_0x5cc9c1),!![];}catch{return![];}}
|
package/lib/utils/logger.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a125_0x48c26e=a125_0x9758;function a125_0x1fa8(){const _0x4acb5f=['transports','addColors','warn','timestamp','getWinstonInstance','logTask','details','16373dcKPVP','12325247JydKNo','Failed\x20to\x20read\x20logs:','unknown','stringify','yellow','error','info','filter','clear','format','duration','.lovrabet.log','currentRawCommand','errors','combine','27ZglLao','1617208rzGeWR','printf','command','30FtwSxC','createLogger','winstonLogger','green','615990onFhpi','existsSync','blue','File','trim','toISOString','15746lZNeDa','utf8','mkdirSync','12fGowni','parse','log','744895faEziX','join','1599sstTsP','success','now','red','1192LWXUwu','失败:\x20','initWinstonLogger','logFilePath','setLogPath','dirname','message'];a125_0x1fa8=function(){return _0x4acb5f;};return a125_0x1fa8();}(function(_0x85f013,_0x3f644f){const _0x3857e5=a125_0x9758,_0x25c034=_0x85f013();while(!![]){try{const _0x32d788=-parseInt(_0x3857e5(0xaa))/0x1*(parseInt(_0x3857e5(0xb4))/0x2)+parseInt(_0x3857e5(0xbc))/0x3*(parseInt(_0x3857e5(0xc0))/0x4)+-parseInt(_0x3857e5(0xba))/0x5+-parseInt(_0x3857e5(0xb7))/0x6*(parseInt(_0x3857e5(0x96))/0x7)+-parseInt(_0x3857e5(0xa7))/0x8*(parseInt(_0x3857e5(0xa6))/0x9)+parseInt(_0x3857e5(0xae))/0xa+parseInt(_0x3857e5(0x97))/0xb;if(_0x32d788===_0x3f644f)break;else _0x25c034['push'](_0x25c034['shift']());}catch(_0x38d61b){_0x25c034['push'](_0x25c034['shift']());}}}(a125_0x1fa8,0x54222));import a125_0x5c81c3 from'winston';import a125_0x31ac28 from'node:fs';import a125_0x2af80d from'node:path';function a125_0x9758(_0x172d4d,_0x4ad347){_0x172d4d=_0x172d4d-0x94;const _0x1fa8e1=a125_0x1fa8();let _0x975862=_0x1fa8e1[_0x172d4d];return _0x975862;}class Logger{[a125_0x48c26e(0xac)];[a125_0x48c26e(0xc3)];[a125_0x48c26e(0xa3)]='';constructor(){this['logFilePath']='';}['setRawCommand'](_0x3fbd3b){this['currentRawCommand']=_0x3fbd3b;}[a125_0x48c26e(0xc2)](){const _0x5961c0=a125_0x48c26e,_0x56be84=a125_0x2af80d[_0x5961c0(0xc5)](this[_0x5961c0(0xc3)]);!a125_0x31ac28[_0x5961c0(0xaf)](_0x56be84)&&a125_0x31ac28[_0x5961c0(0xb6)](_0x56be84,{'recursive':!![]});const _0x308fe7=a125_0x5c81c3['format'][_0x5961c0(0xa5)](a125_0x5c81c3[_0x5961c0(0xa0)][_0x5961c0(0xca)](),a125_0x5c81c3[_0x5961c0(0xa0)][_0x5961c0(0xa4)]({'stack':!![]}),a125_0x5c81c3[_0x5961c0(0xa0)][_0x5961c0(0xa8)](_0x37bf17=>{const _0xe08e92=_0x5961c0,_0x3f6049={'timestamp':_0x37bf17[_0xe08e92(0xca)]||new Date()[_0xe08e92(0xb3)](),'level':_0x37bf17['level']||_0xe08e92(0x9d),'command':_0x37bf17[_0xe08e92(0xa9)]||_0xe08e92(0x99),'rawCommand':_0x37bf17['rawCommand']||this[_0xe08e92(0xa3)]||undefined,'message':_0x37bf17[_0xe08e92(0xc6)]||'','duration':_0x37bf17[_0xe08e92(0xa1)]||undefined,'details':_0x37bf17[_0xe08e92(0x95)]||undefined};return JSON[_0xe08e92(0x9a)](_0x3f6049);}));this[_0x5961c0(0xac)]=a125_0x5c81c3[_0x5961c0(0xab)]({'level':_0x5961c0(0x9d),'format':_0x308fe7,'transports':[new a125_0x5c81c3[(_0x5961c0(0xc7))][(_0x5961c0(0xb1))]({'filename':this[_0x5961c0(0xc3)],'level':_0x5961c0(0x9d)})],'silent':![]}),a125_0x5c81c3[_0x5961c0(0xc8)]({'success':_0x5961c0(0xad),'error':_0x5961c0(0xbf),'warn':_0x5961c0(0x9b),'info':_0x5961c0(0xb0)});}[a125_0x48c26e(0xc4)](_0x4fb894){const _0x8a70ba=a125_0x48c26e;this[_0x8a70ba(0xc3)]=a125_0x2af80d[_0x8a70ba(0xbb)](_0x4fb894,_0x8a70ba(0xa2)),this[_0x8a70ba(0xac)]&&this[_0x8a70ba(0xac)][_0x8a70ba(0x9f)](),this['initWinstonLogger']();}[a125_0x48c26e(0x9d)](_0x23e60d,_0x3803d0,_0xed386c){const _0x3b45f1=a125_0x48c26e;if(!this[_0x3b45f1(0xc3)]||!this[_0x3b45f1(0xac)])return;this['winstonLogger'][_0x3b45f1(0x9d)](_0x3803d0,{'command':_0x23e60d,'details':_0xed386c});}[a125_0x48c26e(0xbd)](_0xb0b93c,_0x39ed26,_0x4cf31e,_0x1632d4){const _0x473e2f=a125_0x48c26e;if(!this[_0x473e2f(0xc3)]||!this['winstonLogger'])return;this[_0x473e2f(0xac)][_0x473e2f(0xb9)]('info',_0x39ed26,{'level':'success','command':_0xb0b93c,'duration':_0x4cf31e,'details':_0x1632d4});}['error'](_0x564b79,_0x330744,_0x2ca2a8){const _0x3db38f=a125_0x48c26e;if(!this['logFilePath']||!this[_0x3db38f(0xac)])return;this['winstonLogger'][_0x3db38f(0x9c)](_0x330744,{'command':_0x564b79,'details':_0x2ca2a8});}[a125_0x48c26e(0xc9)](_0x4131a3,_0xdbede1,_0x729472){const _0x4a921b=a125_0x48c26e;if(!this[_0x4a921b(0xc3)]||!this[_0x4a921b(0xac)])return;this[_0x4a921b(0xac)][_0x4a921b(0xc9)](_0xdbede1,{'command':_0x4131a3,'details':_0x729472});}async[a125_0x48c26e(0x94)](_0x5e85f5,_0x140c6b,_0x1a29cb){const _0x1ad869=a125_0x48c26e,_0x18b1c3=Date[_0x1ad869(0xbe)]();this[_0x1ad869(0x9d)](_0x5e85f5,'开始执行:\x20'+_0x140c6b);try{const _0x27fd07=await _0x1a29cb(),_0x10c2fb=Date[_0x1ad869(0xbe)]()-_0x18b1c3;return this[_0x1ad869(0xbd)](_0x5e85f5,'完成:\x20'+_0x140c6b,_0x10c2fb),_0x27fd07;}catch(_0x1c2b4c){const _0x496adb=Date[_0x1ad869(0xbe)]()-_0x18b1c3;this[_0x1ad869(0x9c)](_0x5e85f5,_0x1ad869(0xc1)+_0x140c6b,{'error':_0x1c2b4c instanceof Error?_0x1c2b4c[_0x1ad869(0xc6)]:String(_0x1c2b4c),'duration':_0x496adb});throw _0x1c2b4c;}}['readLogs'](){const _0x11f0e5=a125_0x48c26e;try{if(!a125_0x31ac28[_0x11f0e5(0xaf)](this[_0x11f0e5(0xc3)]))return[];const _0x4ad587=a125_0x31ac28['readFileSync'](this['logFilePath'],'utf8');return _0x4ad587['split']('\x0a')[_0x11f0e5(0x9e)](_0x15f640=>_0x15f640[_0x11f0e5(0xb2)]())['map'](_0x807428=>JSON[_0x11f0e5(0xb8)](_0x807428));}catch(_0xa4c2ea){return console[_0x11f0e5(0xc9)](_0x11f0e5(0x98),_0xa4c2ea),[];}}['clearLogs'](){const _0xb40551=a125_0x48c26e;try{a125_0x31ac28[_0xb40551(0xaf)](this[_0xb40551(0xc3)])&&a125_0x31ac28['writeFileSync'](this[_0xb40551(0xc3)],'',_0xb40551(0xb5));}catch(_0x276149){console[_0xb40551(0xc9)]('Failed\x20to\x20clear\x20logs:',_0x276149);}}[a125_0x48c26e(0xcb)](){return this['winstonLogger'];}}export const logger=new Logger();
|
package/lib/utils/rules-cdn.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a126_0x2f7840=a126_0x53cb;(function(_0x4d1dbc,_0x2361d4){const _0x1185fc=a126_0x53cb,_0x5668b0=_0x4d1dbc();while(!![]){try{const _0x282f87=parseInt(_0x1185fc(0x181))/0x1+-parseInt(_0x1185fc(0x176))/0x2+parseInt(_0x1185fc(0x182))/0x3+parseInt(_0x1185fc(0x17e))/0x4*(parseInt(_0x1185fc(0x17b))/0x5)+parseInt(_0x1185fc(0x187))/0x6+-parseInt(_0x1185fc(0x17d))/0x7+-parseInt(_0x1185fc(0x178))/0x8*(parseInt(_0x1185fc(0x174))/0x9);if(_0x282f87===_0x2361d4)break;else _0x5668b0['push'](_0x5668b0['shift']());}catch(_0x58d6ea){_0x5668b0['push'](_0x5668b0['shift']());}}}(a126_0xe9cd,0x482a0));import{existsSync,mkdirSync,readFileSync,writeFileSync}from'node:fs';import{dirname,join,resolve}from'node:path';function a126_0x53cb(_0x18e838,_0x3f7082){_0x18e838=_0x18e838-0x172;const _0xe9cd72=a126_0xe9cd();let _0x53cb46=_0xe9cd72[_0x18e838];return _0x53cb46;}import{fileURLToPath}from'node:url';import{getTemplateBaseUrl}from'./config.js';function a126_0xe9cd(){const _0x5ef0c2=['statusText','9624fCVpHW','utf-8','application/json','202295qviBeF','本地模板文件不存在:\x20','912800uKsDqp','4UoyLjO','content','status','408766RCDxYp','440118RjnDAF','json','agents.md','CDN\x20返回数据格式错误','../../templates/rules/lovrabet_rules.mdc.tpl','3264390bfVbcx','catch','lastUpdated','1503VwpyIa','string','1026222lqENgB'];a126_0xe9cd=function(){return _0x5ef0c2;};return a126_0xe9cd();}import{appendUpdateTime}from'./guides-cdn.js';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename);function getRulesCdnUrl(){const _0x49bb0e=getTemplateBaseUrl();return _0x49bb0e+'/rules/rules.json';}const LOCAL_TEMPLATE_PATH=resolve(__dirname,a126_0x2f7840(0x186));export async function fetchRulesFromCDN(){const _0x5cf68b=a126_0x2f7840,_0x5580ff=getRulesCdnUrl(),_0x2434e4=await fetch(_0x5580ff,{'headers':{'Accept':_0x5cf68b(0x17a)}});if(!_0x2434e4['ok'])throw new Error('CDN\x20请求失败:\x20'+_0x2434e4[_0x5cf68b(0x180)]+'\x20'+_0x2434e4[_0x5cf68b(0x177)]);const _0x40482d=await _0x2434e4[_0x5cf68b(0x183)]();if(!_0x40482d[_0x5cf68b(0x17f)]||typeof _0x40482d[_0x5cf68b(0x17f)]!==_0x5cf68b(0x175))throw new Error(_0x5cf68b(0x185));return _0x40482d;}export async function getRulesContent(){const _0x39f02b=a126_0x2f7840;try{const _0x4baf49=await fetchRulesFromCDN();return _0x4baf49[_0x39f02b(0x17f)];}catch{return readLocalTemplate();}}export function readLocalTemplate(){const _0x4e5cc9=a126_0x2f7840;if(existsSync(LOCAL_TEMPLATE_PATH))return readFileSync(LOCAL_TEMPLATE_PATH,_0x4e5cc9(0x179));throw new Error(_0x4e5cc9(0x17c)+LOCAL_TEMPLATE_PATH);}export async function writeRulesFile(_0x16b535){const _0x331768=a126_0x2f7840,_0x233f8f=await fetchRulesFromCDN()[_0x331768(0x172)](()=>null);let _0x454679;_0x233f8f?(_0x454679=_0x233f8f[_0x331768(0x17f)],_0x233f8f[_0x331768(0x173)]&&(_0x454679=appendUpdateTime(_0x454679,_0x233f8f['lastUpdated']))):_0x454679=readLocalTemplate();const _0x55b574=dirname(_0x16b535);!existsSync(_0x55b574)&&mkdirSync(_0x55b574,{'recursive':!![]}),writeFileSync(_0x16b535,_0x454679,_0x331768(0x179));}export async function copyRulesToCursor(_0x530b2f){const _0x28160f=join(_0x530b2f,'.cursor/rules'),_0x4639ce=join(_0x28160f,'lovrabet_rules.mdc');if(existsSync(_0x4639ce))return![];return await writeRulesFile(_0x4639ce),!![];}export async function copyRulesToAgentsMd(_0x19b20d){const _0x4ac8ed=a126_0x2f7840,_0x1ac34d=join(_0x19b20d,_0x4ac8ed(0x184));if(existsSync(_0x1ac34d))return![];return await writeRulesFile(_0x1ac34d),!![];}
|
package/lib/utils/sleep.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export function sleep(
|
|
1
|
+
export function sleep(_0x3ecb6f){return new Promise(_0x343a69=>setTimeout(_0x343a69,_0x3ecb6f));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a128_0x3487(_0x4a2eb8,_0x358015){_0x4a2eb8=_0x4a2eb8-0x1df;const _0x16a024=a128_0x16a0();let _0x34879d=_0x16a024[_0x4a2eb8];return _0x34879d;}const a128_0x1d387e=a128_0x3487;(function(_0x268dac,_0x2859ae){const _0x5bdc1c=a128_0x3487,_0x3d5048=_0x268dac();while(!![]){try{const _0x396424=parseInt(_0x5bdc1c(0x212))/0x1*(parseInt(_0x5bdc1c(0x1f4))/0x2)+parseInt(_0x5bdc1c(0x206))/0x3+parseInt(_0x5bdc1c(0x1e7))/0x4+parseInt(_0x5bdc1c(0x21a))/0x5*(parseInt(_0x5bdc1c(0x221))/0x6)+parseInt(_0x5bdc1c(0x215))/0x7*(-parseInt(_0x5bdc1c(0x1f9))/0x8)+-parseInt(_0x5bdc1c(0x211))/0x9*(parseInt(_0x5bdc1c(0x21e))/0xa)+-parseInt(_0x5bdc1c(0x1ed))/0xb;if(_0x396424===_0x2859ae)break;else _0x3d5048['push'](_0x3d5048['shift']());}catch(_0x726824){_0x3d5048['push'](_0x3d5048['shift']());}}}(a128_0x16a0,0xef355));function a128_0x16a0(){const _0x20b18c=['info','toLocaleDateString','10378pSkwhK','2-digit','.tpl','promises','template','3227888STpfbw','split','readFile','map','name','toUpperCase','name:\x20\x22','now','utf8','error','.js','replaceContent','numeric','3894459SXRpUM','.json','datasetCode:\x20\x22','toComponentName','success','.jsx','YourModel','processFile','replaceApiContent','replace','../../package.json','1173006GRyRYQ','66YYeMwe','push','extname','7NPYRGk','模板内容替换完成','readdir','api','toLocaleString','225HyOlYW','mkdir','.css','tableName','80UFSnnf','endsWith','version','4950UCcxjC','datasetCode','message','toDisplayTitle','.ts','\x20},','slice','模板内容替换失败','toLowerCase','writeFile','pop','4748552YnZqhd','\x0a\x20\x20\x20\x20{\x20','charAt','alias','tableName:\x20\x22','isDirectory','4828285gUiXoY','processDirectory','join','alias:\x20\x22','toLocaleTimeString'];a128_0x16a0=function(){return _0x20b18c;};return a128_0x16a0();}import a128_0x3425f7 from'node:fs';import a128_0x2a222f from'node:path';import{createRequire}from'node:module';import{logger}from'./logger.js';const require=createRequire(import.meta.url),CLI_VERSION=require(a128_0x1d387e(0x210))[a128_0x1d387e(0x220)];export class TemplateReplacer{static[a128_0x1d387e(0x209)](_0x3871cd){const _0x5189d7=a128_0x1d387e,_0x3f0a1f=_0x3871cd[_0x5189d7(0x1fa)]('/')['pop']()||_0x3871cd;return _0x3f0a1f[_0x5189d7(0x1fa)]('-')[_0x5189d7(0x1fc)](_0x2d3b36=>_0x2d3b36[_0x5189d7(0x1e9)](0x0)[_0x5189d7(0x1fe)]()+_0x2d3b36[_0x5189d7(0x1e2)](0x1)[_0x5189d7(0x1e4)]())['join']('');}static[a128_0x1d387e(0x1df)](_0x20bc55){const _0x5677fd=a128_0x1d387e,_0xabd5c6=_0x20bc55['split']('/')[_0x5677fd(0x1e6)]()||_0x20bc55;return _0xabd5c6[_0x5677fd(0x1fa)]('-')[_0x5677fd(0x1fc)](_0x5abe8a=>_0x5abe8a[_0x5677fd(0x1e9)](0x0)['toUpperCase']()+_0x5abe8a['slice'](0x1)[_0x5677fd(0x1e4)]())['join']('\x20');}static[a128_0x1d387e(0x204)](_0x4f8e2b,_0x490068,_0xfcf143){const _0x192aa3=a128_0x1d387e,_0x39bacc=this[_0x192aa3(0x209)](_0x490068),_0x27321f=this[_0x192aa3(0x1df)](_0x490068),_0x11e5c1=new Date(),_0x57222a=_0x11e5c1[_0x192aa3(0x219)](undefined,{'year':_0x192aa3(0x205),'month':_0x192aa3(0x1f5),'day':_0x192aa3(0x1f5),'hour':_0x192aa3(0x1f5),'minute':_0x192aa3(0x1f5),'second':_0x192aa3(0x1f5),'hour12':![]})[_0x192aa3(0x20f)](/\//g,'-'),_0x55d0e4=_0x11e5c1[_0x192aa3(0x1f3)](undefined,{'year':_0x192aa3(0x205),'month':_0x192aa3(0x1f5),'day':_0x192aa3(0x1f5)})[_0x192aa3(0x20f)](/\//g,'-'),_0x5da1d4=_0x11e5c1[_0x192aa3(0x1f1)](undefined,{'hour12':![]});let _0x36015f=_0x4f8e2b[_0x192aa3(0x20f)](/\{CliVersion\}/g,CLI_VERSION)[_0x192aa3(0x20f)](/\{ComponentName\}/g,_0x39bacc)[_0x192aa3(0x20f)](/\{DisplayTitle\}/g,_0x27321f)[_0x192aa3(0x20f)](/\{PageName\}/g,_0x490068)['replace'](/\{TemplateName\}/g,_0xfcf143)[_0x192aa3(0x20f)](/\{CreatedAt\}/g,_0x57222a)[_0x192aa3(0x20f)](/\{CreatedDate\}/g,_0x55d0e4)[_0x192aa3(0x20f)](/\{CreatedTime\}/g,_0x5da1d4);return _0x36015f;}static[a128_0x1d387e(0x20e)](_0x6dde3b,_0x348ad6,_0x4f977d,_0x3bc5f7,_0x365f83,_0x30038e,_0x4f7f3c){const _0x5574f1=a128_0x1d387e,_0x3b09f1=new Date(),_0x421fc1=_0x3b09f1['toISOString'](),_0x5a5125=_0x4f977d[_0x5574f1(0x1fc)](_0x1ec6f7=>{const _0x5ea7f6=_0x5574f1,_0x4171a9=[_0x5ea7f6(0x208)+_0x1ec6f7[_0x5ea7f6(0x222)]+'\x22',_0x5ea7f6(0x1eb)+_0x1ec6f7[_0x5ea7f6(0x21d)]+'\x22',_0x5ea7f6(0x1ff)+_0x1ec6f7[_0x5ea7f6(0x1fd)]+'\x22'];return _0x1ec6f7[_0x5ea7f6(0x1ea)]&&_0x4171a9[_0x5ea7f6(0x213)](_0x5ea7f6(0x1f0)+_0x1ec6f7['alias']+'\x22'),_0x5ea7f6(0x1e8)+_0x4171a9[_0x5ea7f6(0x1ef)](',\x20')+_0x5ea7f6(0x1e1);})[_0x5574f1(0x1ef)](''),_0x23798f=_0x3bc5f7||_0x4f977d[0x0]?.['alias']||_0x5574f1(0x20c);let _0x317841=_0x6dde3b[_0x5574f1(0x20f)](/\{AppCode\}/g,_0x348ad6)[_0x5574f1(0x20f)](/\{ModelConfigs\}/g,_0x5a5125)[_0x5574f1(0x20f)](/\{ExampleModelName\}/g,_0x23798f)[_0x5574f1(0x20f)](/\{ApiFileName\}/g,_0x365f83||_0x5574f1(0x218))[_0x5574f1(0x20f)](/\{ConfigName\}/g,_0x30038e||'default')['replace'](/\{ClientConfigParam\}/g,_0x4f7f3c||'')[_0x5574f1(0x20f)](/\{CreatedAt\}/g,_0x421fc1);return _0x317841;}static async['processTemplate'](_0x3d59f3,_0x344636,_0x4b13a7,_0x6821ce,_0x1f40f4=!![]){const _0x7b6d7b=a128_0x1d387e,_0x4b75bf=Date[_0x7b6d7b(0x200)]();try{_0x1f40f4&&logger[_0x7b6d7b(0x1f2)]('template','开始处理模板内容替换',{'templatePath':_0x3d59f3,'targetPath':_0x344636,'pageName':_0x4b13a7,'templateName':_0x6821ce});await a128_0x3425f7['promises'][_0x7b6d7b(0x21b)](_0x344636,{'recursive':!![]}),await this[_0x7b6d7b(0x1ee)](_0x3d59f3,_0x344636,_0x4b13a7,_0x6821ce);if(_0x1f40f4){const _0x591912=Date[_0x7b6d7b(0x200)]()-_0x4b75bf;logger[_0x7b6d7b(0x20a)](_0x7b6d7b(0x1f8),_0x7b6d7b(0x216),_0x591912,{'pageName':_0x4b13a7,'templateName':_0x6821ce});}}catch(_0x88e357){if(_0x1f40f4){const _0x3157c3=Date[_0x7b6d7b(0x200)]()-_0x4b75bf;logger[_0x7b6d7b(0x202)]('template',_0x7b6d7b(0x1e3),{'templatePath':_0x3d59f3,'targetPath':_0x344636,'pageName':_0x4b13a7,'templateName':_0x6821ce,'error':_0x88e357 instanceof Error?_0x88e357[_0x7b6d7b(0x223)]:String(_0x88e357),'duration':_0x3157c3});}throw _0x88e357;}}static async['processDirectory'](_0x4210e5,_0x5396e1,_0x32f090,_0x3c4c46){const _0x69917e=a128_0x1d387e,_0x1659c2=await a128_0x3425f7[_0x69917e(0x1f7)][_0x69917e(0x217)](_0x4210e5,{'withFileTypes':!![]});for(const _0x4a7b94 of _0x1659c2){const _0x26cf17=a128_0x2a222f[_0x69917e(0x1ef)](_0x4210e5,_0x4a7b94[_0x69917e(0x1fd)]);let _0x3f468a=a128_0x2a222f[_0x69917e(0x1ef)](_0x5396e1,_0x4a7b94[_0x69917e(0x1fd)]);_0x4a7b94[_0x69917e(0x1fd)][_0x69917e(0x21f)](_0x69917e(0x1f6))&&(_0x3f468a=a128_0x2a222f[_0x69917e(0x1ef)](_0x5396e1,_0x4a7b94[_0x69917e(0x1fd)]['replace'](/\.tpl$/,'')));if(_0x4a7b94[_0x69917e(0x1ec)]())await a128_0x3425f7['promises'][_0x69917e(0x21b)](_0x3f468a,{'recursive':!![]}),await this['processDirectory'](_0x26cf17,_0x3f468a,_0x32f090,_0x3c4c46);else _0x4a7b94['isFile']()&&await this['processFile'](_0x26cf17,_0x3f468a,_0x32f090,_0x3c4c46);}}static async[a128_0x1d387e(0x20d)](_0x3ec5f6,_0x186e2a,_0x5f4dee,_0xc5ccd9){const _0x21e3f1=a128_0x1d387e,_0x483e49=a128_0x2a222f[_0x21e3f1(0x214)](_0x3ec5f6)['toLowerCase']();_0x3ec5f6[_0x21e3f1(0x21f)](_0x21e3f1(0x1f6))&&(_0x186e2a=_0x186e2a[_0x21e3f1(0x20f)](/\.tpl$/,''));const _0x51209f=['.tsx',_0x21e3f1(0x1e0),_0x21e3f1(0x20b),_0x21e3f1(0x203),_0x21e3f1(0x207),'.md',_0x21e3f1(0x21c),'.scss',_0x21e3f1(0x1f6)];if(_0x51209f['includes'](_0x483e49)||_0x3ec5f6[_0x21e3f1(0x21f)]('.tpl')){const _0x3b9589=await a128_0x3425f7[_0x21e3f1(0x1f7)][_0x21e3f1(0x1fb)](_0x3ec5f6,'utf8'),_0x5a4b73=this[_0x21e3f1(0x204)](_0x3b9589,_0x5f4dee,_0xc5ccd9);await a128_0x3425f7[_0x21e3f1(0x1f7)][_0x21e3f1(0x1e5)](_0x186e2a,_0x5a4b73,_0x21e3f1(0x201));}else await a128_0x3425f7[_0x21e3f1(0x1f7)]['copyFile'](_0x3ec5f6,_0x186e2a);}}
|
package/package.json
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lovrabet/rabetbase-cli",
|
|
3
|
-
"version": "2.0.2-beta.
|
|
3
|
+
"version": "2.0.2-beta.2",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git@codeup.aliyun.com:yuntoo/open/rabetbase-cli.git"
|
|
8
8
|
},
|
|
9
9
|
"bin": {
|
|
10
|
-
"rabetbase": "lib/cli.js"
|
|
11
|
-
"lovrabet": "lib/cli.js"
|
|
10
|
+
"rabetbase": "lib/cli.js"
|
|
12
11
|
},
|
|
13
12
|
"type": "module",
|
|
14
13
|
"module": "lib/cli.js",
|