@lovrabet/rabetbase-cli 2.0.2-beta.6 → 2.0.2-beta.8
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.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.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/get-session-user.js +1 -0
- 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/doc.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.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/cli-update.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/common/flags.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/doctor.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/index.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/update.js +1 -1
- package/lib/commands/preview.js +1 -1
- package/lib/commands/project-upgrade.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/telemetry/cli-help-trace.js +1 -0
- package/lib/telemetry/otel-logger-version.js +1 -0
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -0
- 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 -1
package/lib/mcp/mcp-installer.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a112_0x4e28d3=a112_0x5a08;(function(_0x3f78b8,_0x4735e8){const _0x5a9784=a112_0x5a08,_0x290498=_0x3f78b8();while(!![]){try{const _0x43ae97=-parseInt(_0x5a9784(0x1e3))/0x1+-parseInt(_0x5a9784(0x1eb))/0x2*(-parseInt(_0x5a9784(0x1d5))/0x3)+parseInt(_0x5a9784(0x1e9))/0x4*(parseInt(_0x5a9784(0x1ba))/0x5)+parseInt(_0x5a9784(0x1b9))/0x6+-parseInt(_0x5a9784(0x1c6))/0x7+-parseInt(_0x5a9784(0x1da))/0x8+parseInt(_0x5a9784(0x1cb))/0x9;if(_0x43ae97===_0x4735e8)break;else _0x290498['push'](_0x290498['shift']());}catch(_0x2ac7a0){_0x290498['push'](_0x290498['shift']());}}}(a112_0x4f19,0x5d4a9));import{existsSync,mkdirSync,writeFileSync,readFileSync}from'node:fs';import{normalizeEnv}from'../constant/env.js';import{join,dirname}from'node:path';import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';function a112_0x5a08(_0x5b9504,_0x14de6f){_0x5b9504=_0x5b9504-0x1ac;const _0x4f19ec=a112_0x4f19();let _0x5a08ba=_0x4f19ec[_0x5b9504];return _0x5a08ba;}function a112_0x4f19(){const _0x1daf2d=['RABETBASE_ENV','message','Configuration:','\x20\x20\x20\x20}','join','255498NTRmeo','25tdrZXT','AppCode:\x20','\x20-e\x20RABETBASE_ENV=','--------------------------------','Restart\x20Claude\x20Code\x20to\x20take\x20effect','Other\x20IDE\x20configuration\x20guide\x20displayed','cursor','success','.cursor','\x20-e\x20RABETBASE_APP_CODE=',',\x20env=','mcpServers','1878107nkuPDi','Create\x20agents.md\x20file','mcp-install','agents.md\x20already\x20exists,\x20skipping','rules','6438978CGUhYp','\x20\x20\x20\x20\x20\x20\x22args\x22:\x20','map','parse','Create\x20Cursor\x20Rules\x20file','Create\x20new\x20mcp.json\x20config','push','lovrabet_rules.mdc','lovrabet-dataset','utf8','18zQbGiL','\x22RABETBASE_ENV\x22:\x20\x22','Configuration:\x20appcode=','\x20\x20\x20\x20\x20\x20}','info','5372480aiWRVS','Update\x20existing\x20mcp.json\x20config','Detailed\x20guide:\x20https://open.lovrabet.com/en/docs/mcp/config-guide','production','stringify','\x20\x20}','Failed\x20to\x20copy\x20agents.md\x20file','mcp-cursor','error','40758jRhspX','Unknown\x20IDE:\x20','\x20\x20\x22mcpServers\x22:\x20{','mcp.json','Please\x20restart\x20Cursor\x20to\x20load\x20the\x20new\x20MCP\x20config.','appcode','353380NEgLyP','claude\x20mcp\x20add\x20','54330yUCDuX','\x20\x20\x20\x20\x22lovrabet-dataset\x22:\x20{','Written\x20.cursor/mcp.json','@lovrabet/dataset-mcp-server@latest','\x20\x20\x20\x20\x20\x20\x22env\x22:\x20{','env','utf-8','needsManualAction','other','claude','mcp-claude','Environment:\x20','Failed\x20to\x20copy\x20Cursor\x20Rules\x20file'];a112_0x4f19=function(){return _0x1daf2d;};return a112_0x4f19();}import{getRulesContent}from'../utils/rules-cdn.js';const __dirname=dirname(fileURLToPath(import.meta.url));export const MCP_SERVER_NAME=a112_0x4e28d3(0x1d3);export const MCP_COMMAND='npx';export const MCP_ARGS=[a112_0x4e28d3(0x1ee)];export function getAppConfig(){const _0x422c09=a112_0x4e28d3,_0x370ebb=readConfig(),_0xb2a9b7=_0x370ebb[_0x422c09(0x1e8)]||_0x370ebb['app'],_0x46c320=normalizeEnv(_0x370ebb[_0x422c09(0x1ac)]||_0x422c09(0x1dd));if(!_0xb2a9b7)throw new Error('No\x20appcode\x20found.\x20Run\x20\x27rabetbase\x20init\x27\x20to\x20initialize\x20project\x20config');return{'appcode':String(_0xb2a9b7),'env':_0x46c320};}export function buildMcpEnv(_0x400377,_0x50a63a){const _0x41f874=a112_0x4e28d3,_0x5112f2={'RABETBASE_APP_CODE':_0x400377};return _0x50a63a!=='production'&&(_0x5112f2[_0x41f874(0x1b4)]=_0x50a63a),_0x5112f2;}export function buildMcpArgs(_0x1a2938){const _0x281318=a112_0x4e28d3,_0x206420=[_0x281318(0x1ee)];return _0x1a2938&&_0x206420[_0x281318(0x1d1)]('--enable-bff-save'),_0x206420;}export function buildMcpServerConfig(_0x24b706,_0x4b9d4a,_0x16544c){return{'command':MCP_COMMAND,'args':buildMcpArgs(_0x16544c),'env':buildMcpEnv(_0x24b706,_0x4b9d4a)};}export function buildClaudeMcpCommand(_0x13a717,_0x37460b,_0x1b48ee){const _0x1c8d3b=a112_0x4e28d3,_0x522182=buildMcpArgs(_0x1b48ee),_0x4664bd=_0x1c8d3b(0x1ea)+MCP_SERVER_NAME+'\x20'+MCP_COMMAND+'\x20'+_0x522182[_0x1c8d3b(0x1b8)]('\x20')+'\x20-e\x20RABETBASE_APP_CODE='+_0x13a717,_0x321d09=_0x37460b!==_0x1c8d3b(0x1dd)?_0x1c8d3b(0x1bc)+_0x37460b:'';return''+_0x4664bd+_0x321d09;}export async function copyCursorRules(_0x260893){const _0x54102b=a112_0x4e28d3,_0x345023=join(_0x260893,'.cursor'),_0x34ba05=join(_0x345023,_0x54102b(0x1ca)),_0x423006=join(_0x34ba05,_0x54102b(0x1d2));if(existsSync(_0x423006))return logger[_0x54102b(0x1d9)](_0x54102b(0x1c8),'Cursor\x20Rules\x20file\x20already\x20exists,\x20skipping',{'path':_0x423006}),![];try{ensureDir(_0x34ba05);const _0x4c2ef8=await getRulesContent();return writeFileSync(_0x423006,_0x4c2ef8,_0x54102b(0x1ad)),logger[_0x54102b(0x1d9)](_0x54102b(0x1c8),_0x54102b(0x1cf),{'to':_0x423006}),!![];}catch(_0x2adeab){return logger[_0x54102b(0x1e2)](_0x54102b(0x1c8),_0x54102b(0x1b3),{'error':_0x2adeab instanceof Error?_0x2adeab[_0x54102b(0x1b5)]:String(_0x2adeab)}),![];}}export async function copyAgentsMd(_0x2afedd){const _0xab8077=a112_0x4e28d3,_0x18470c=join(_0x2afedd,'agents.md');if(existsSync(_0x18470c))return logger['info']('mcp-install',_0xab8077(0x1c9),{'path':_0x18470c}),![];try{const _0x495db3=await getRulesContent();return writeFileSync(_0x18470c,_0x495db3,_0xab8077(0x1ad)),logger['info'](_0xab8077(0x1c8),_0xab8077(0x1c7),{'to':_0x18470c}),!![];}catch(_0x3e43eb){return logger[_0xab8077(0x1e2)](_0xab8077(0x1c8),_0xab8077(0x1e0),{'error':_0x3e43eb instanceof Error?_0x3e43eb[_0xab8077(0x1b5)]:String(_0x3e43eb)}),![];}}export async function configureCursorMcp(_0x650ff,_0x440249){const _0x403ae8=a112_0x4e28d3;try{const {appcode:_0x93fac1,env:_0x55f6f6}=getAppConfig(),_0x15d145=join(_0x650ff,_0x403ae8(0x1c2)),_0x3de135=join(_0x15d145,_0x403ae8(0x1e6));ensureDir(_0x15d145);const _0x1f897b=buildMcpServerConfig(_0x93fac1,_0x55f6f6,_0x440249);let _0x5d5e3a;if(existsSync(_0x3de135)){const _0x5f0363=readFileSync(_0x3de135,_0x403ae8(0x1d4));_0x5d5e3a=JSON[_0x403ae8(0x1ce)](_0x5f0363),!_0x5d5e3a[_0x403ae8(0x1c5)]&&(_0x5d5e3a[_0x403ae8(0x1c5)]={}),logger[_0x403ae8(0x1d9)](_0x403ae8(0x1e1),_0x403ae8(0x1db),{'path':_0x3de135,'appcode':_0x93fac1,'env':_0x55f6f6});}else _0x5d5e3a={'mcpServers':{}},logger[_0x403ae8(0x1d9)]('mcp-cursor',_0x403ae8(0x1d0),{'path':_0x3de135,'appcode':_0x93fac1,'env':_0x55f6f6});_0x5d5e3a['mcpServers'][MCP_SERVER_NAME]=_0x1f897b,writeFileSync(_0x3de135,JSON[_0x403ae8(0x1de)](_0x5d5e3a,null,0x2),{'encoding':_0x403ae8(0x1d4)});const _0x294f16=await copyCursorRules(_0x650ff),_0x179d88=[_0x403ae8(0x1ed),_0x403ae8(0x1bb)+_0x93fac1];return _0x55f6f6!=='production'&&_0x179d88['push'](_0x403ae8(0x1b2)+_0x55f6f6),_0x179d88[_0x403ae8(0x1d1)](_0x403ae8(0x1e7)),_0x294f16&&_0x179d88[_0x403ae8(0x1d1)](_0x403ae8(0x1cf)),logger[_0x403ae8(0x1d9)](_0x403ae8(0x1e1),'\x0a✓\x20Cursor\x20MCP\x20configured\x20successfully!\x0a',{'appcode':_0x93fac1,'env':_0x55f6f6,'configPath':_0x3de135}),{'success':!![],'message':_0x179d88[_0x403ae8(0x1b8)]('\x0a')};}catch(_0x54df13){return logger[_0x403ae8(0x1e2)](_0x403ae8(0x1e1),'\x0aError:\x20Configuration\x20failed\x20-\x20'+(_0x54df13 instanceof Error?_0x54df13[_0x403ae8(0x1b5)]:String(_0x54df13))+'\x0a',{'error':_0x54df13 instanceof Error?_0x54df13[_0x403ae8(0x1b5)]:String(_0x54df13)}),{'success':![],'message':_0x54df13 instanceof Error?_0x54df13['message']:String(_0x54df13)};}}export function configureClaudeMcp(_0x475994,_0x357f5b){const _0x5749e8=a112_0x4e28d3;try{const {appcode:_0x4cb953,env:_0x55cd68}=getAppConfig();copyAgentsMd(_0x475994);const _0x2d36cc=buildMcpArgs(_0x357f5b),_0x521a88=_0x5749e8(0x1ea)+MCP_SERVER_NAME+'\x20'+MCP_COMMAND+'\x20'+_0x2d36cc['join']('\x20')+_0x5749e8(0x1c3)+_0x4cb953,_0x3a9d2b=_0x55cd68!=='production'?_0x5749e8(0x1bc)+_0x55cd68:'',_0x3f16c3=''+_0x521a88+_0x3a9d2b,_0x492fbf=['Run\x20the\x20following\x20command\x20to\x20configure\x20Claude\x20Code\x20MCP:',_0x5749e8(0x1bd),''+_0x3f16c3,_0x5749e8(0x1bd),_0x5749e8(0x1b6),'AppCode:\x20'+_0x4cb953];return _0x55cd68!==_0x5749e8(0x1dd)&&_0x492fbf[_0x5749e8(0x1d1)]('Environment:\x20'+_0x55cd68),_0x492fbf[_0x5749e8(0x1d1)](_0x5749e8(0x1be)),logger[_0x5749e8(0x1d9)]('mcp-claude','Configuration\x20command\x20generated',{'appcode':_0x4cb953,'env':_0x55cd68,'command':_0x3f16c3}),{'success':!![],'message':_0x492fbf[_0x5749e8(0x1b8)]('\x0a'),'needsManualAction':!![]};}catch(_0xcd1f73){return logger[_0x5749e8(0x1e2)](_0x5749e8(0x1b1),'\x0aError:\x20Configuration\x20failed\x20-\x20'+(_0xcd1f73 instanceof Error?_0xcd1f73['message']:String(_0xcd1f73))+'\x0a',{'error':_0xcd1f73 instanceof Error?_0xcd1f73['message']:String(_0xcd1f73)}),{'success':![],'message':_0xcd1f73 instanceof Error?_0xcd1f73['message']:String(_0xcd1f73)};}}export function showOtherMcpGuide(_0x34bd91,_0x3389b0){const _0x58e0b1=a112_0x4e28d3;try{const {appcode:_0x495aa0,env:_0x1cb77d}=getAppConfig(),_0x215ce6=buildMcpServerConfig(_0x495aa0,_0x1cb77d,_0x3389b0),_0x215922=buildMcpArgs(_0x3389b0),_0x490583=['\x22RABETBASE_APP_CODE\x22:\x20\x22'+_0x495aa0+'\x22'];_0x1cb77d!==_0x58e0b1(0x1dd)&&_0x490583[_0x58e0b1(0x1d1)](_0x58e0b1(0x1d6)+_0x1cb77d+'\x22');const _0x2cf01e=_0x1cb77d!=='production'?_0x58e0b1(0x1c4)+_0x1cb77d:'',_0x5a040a=[_0x58e0b1(0x1d7)+_0x495aa0+_0x2cf01e,'{',_0x58e0b1(0x1e5),_0x58e0b1(0x1ec),'\x20\x20\x20\x20\x20\x20\x22command\x22:\x20\x22npx\x22,',_0x58e0b1(0x1cc)+JSON['stringify'](_0x215922)+',',_0x58e0b1(0x1ef),..._0x490583[_0x58e0b1(0x1cd)](_0xceea4c=>'\x20\x20\x20\x20\x20\x20\x20\x20'+_0xceea4c+','),_0x58e0b1(0x1d8),_0x58e0b1(0x1b7),_0x58e0b1(0x1df),'}',_0x58e0b1(0x1dc)];return logger[_0x58e0b1(0x1d9)]('mcp-install',_0x58e0b1(0x1bf),{'appcode':_0x495aa0,'env':_0x1cb77d}),{'success':!![],'message':_0x5a040a['join']('\x0a'),'needsManualAction':!![]};}catch(_0xecb470){return{'success':![],'message':_0xecb470 instanceof Error?_0xecb470[_0x58e0b1(0x1b5)]:String(_0xecb470)};}}function ensureDir(_0x205c12){!existsSync(_0x205c12)&&mkdirSync(_0x205c12,{'recursive':!![]});}export async function installMcp(_0x563530,_0x5988c9,_0x4eaebf=process['cwd']()){const _0x3b38aa=a112_0x4e28d3,_0x1e872c=[];for(const _0x2444e5 of _0x563530){try{let _0x1c9c3f;switch(_0x2444e5){case _0x3b38aa(0x1c0):_0x1c9c3f=await configureCursorMcp(_0x4eaebf,_0x5988c9);break;case _0x3b38aa(0x1b0):_0x1c9c3f=configureClaudeMcp(_0x4eaebf,_0x5988c9);break;case _0x3b38aa(0x1af):_0x1c9c3f=showOtherMcpGuide(_0x4eaebf,_0x5988c9);break;default:_0x1c9c3f={'success':![],'message':_0x3b38aa(0x1e4)+_0x2444e5};}_0x1e872c[_0x3b38aa(0x1d1)]({'ide':_0x2444e5,'success':_0x1c9c3f[_0x3b38aa(0x1c1)],'message':_0x1c9c3f[_0x3b38aa(0x1b5)],'needsManualAction':_0x1c9c3f[_0x3b38aa(0x1ae)]});}catch(_0x261daa){_0x1e872c[_0x3b38aa(0x1d1)]({'ide':_0x2444e5,'success':![],'message':_0x261daa instanceof Error?_0x261daa[_0x3b38aa(0x1b5)]:String(_0x261daa)});}}return _0x1e872c;}
|
|
1
|
+
const a113_0x54a209=a113_0x3d1d;(function(_0x917e4f,_0x5dd975){const _0x3c0edb=a113_0x3d1d,_0x461243=_0x917e4f();while(!![]){try{const _0x3b8454=-parseInt(_0x3c0edb(0x1e6))/0x1+parseInt(_0x3c0edb(0x1f6))/0x2*(-parseInt(_0x3c0edb(0x1eb))/0x3)+parseInt(_0x3c0edb(0x21c))/0x4*(-parseInt(_0x3c0edb(0x1f4))/0x5)+parseInt(_0x3c0edb(0x220))/0x6+parseInt(_0x3c0edb(0x1dc))/0x7*(parseInt(_0x3c0edb(0x20e))/0x8)+parseInt(_0x3c0edb(0x212))/0x9*(parseInt(_0x3c0edb(0x1f2))/0xa)+parseInt(_0x3c0edb(0x1e9))/0xb*(parseInt(_0x3c0edb(0x204))/0xc);if(_0x3b8454===_0x5dd975)break;else _0x461243['push'](_0x461243['shift']());}catch(_0x535d9e){_0x461243['push'](_0x461243['shift']());}}}(a113_0x27d9,0xa2f7d));function a113_0x3d1d(_0x446b16,_0x142fed){_0x446b16=_0x446b16-0x1dc;const _0x27d927=a113_0x27d9();let _0x3d1df0=_0x27d927[_0x446b16];return _0x3d1df0;}import{existsSync,mkdirSync,writeFileSync,readFileSync}from'node:fs';import{normalizeEnv}from'../constant/env.js';import{join,dirname}from'node:path';import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';import{getRulesContent}from'../utils/rules-cdn.js';const __dirname=dirname(fileURLToPath(import.meta.url));export const MCP_SERVER_NAME=a113_0x54a209(0x203);export const MCP_COMMAND=a113_0x54a209(0x214);export const MCP_ARGS=[a113_0x54a209(0x1e5)];export function getAppConfig(){const _0x422c1b=a113_0x54a209,_0x409d47=readConfig(),_0x592a60=_0x409d47['appcode']||_0x409d47[_0x422c1b(0x1f3)],_0x719135=normalizeEnv(_0x409d47[_0x422c1b(0x1df)]||_0x422c1b(0x1f7));if(!_0x592a60)throw new Error('No\x20appcode\x20found.\x20Run\x20\x27rabetbase\x20init\x27\x20to\x20initialize\x20project\x20config');return{'appcode':String(_0x592a60),'env':_0x719135};}export function buildMcpEnv(_0x5b52f9,_0x22736d){const _0x5f4047=a113_0x54a209,_0x3563d2={'RABETBASE_APP_CODE':_0x5b52f9};return _0x22736d!==_0x5f4047(0x1f7)&&(_0x3563d2[_0x5f4047(0x1ea)]=_0x22736d),_0x3563d2;}export function buildMcpArgs(_0xb075d5){const _0xcbb784=a113_0x54a209,_0x1b57bc=['@lovrabet/dataset-mcp-server@latest'];return _0xb075d5&&_0x1b57bc['push'](_0xcbb784(0x211)),_0x1b57bc;}export function buildMcpServerConfig(_0x57557f,_0x4c2009,_0x5b236c){return{'command':MCP_COMMAND,'args':buildMcpArgs(_0x5b236c),'env':buildMcpEnv(_0x57557f,_0x4c2009)};}function a113_0x27d9(){const _0x3464c5=['mcp-claude','parse','\x20\x20\x20\x20\x20\x20}','lovrabet_rules.mdc','agents.md','info','utf8','Unknown\x20IDE:\x20','lovrabet-dataset','732pHzGxN','cursor','claude','Run\x20the\x20following\x20command\x20to\x20configure\x20Claude\x20Code\x20MCP:','\x20\x20\x22mcpServers\x22:\x20{','needsManualAction','mcp-cursor','\x22RABETBASE_APP_CODE\x22:\x20\x22','rules','Create\x20agents.md\x20file','16DMjMNT','\x0a✓\x20Cursor\x20MCP\x20configured\x20successfully!\x0a','mcpServers','--enable-bff-save','7137blFsBv','Update\x20existing\x20mcp.json\x20config','npx','Please\x20restart\x20Cursor\x20to\x20load\x20the\x20new\x20MCP\x20config.','mcp-install','map','success','cwd','claude\x20mcp\x20add\x20','Create\x20Cursor\x20Rules\x20file','44PJNIKR','\x20\x20\x20\x20\x20\x20\x22command\x22:\x20\x22npx\x22,','\x20\x20\x20\x20\x20\x20\x20\x20','error','4648968QeEAzp','Other\x20IDE\x20configuration\x20guide\x20displayed','2819376YADiCP','Restart\x20Claude\x20Code\x20to\x20take\x20effect','\x22RABETBASE_ENV\x22:\x20\x22','env','Configuration:','--------------------------------','utf-8','message','stringify','@lovrabet/dataset-mcp-server@latest','655620pEWrUS','Configuration\x20command\x20generated',',\x20env=','55363XYSeoL','RABETBASE_ENV','3RsonQi','.cursor','join','mcp.json','\x20\x20\x20\x20\x20\x20\x22env\x22:\x20{','\x20-e\x20RABETBASE_ENV=','\x0aError:\x20Configuration\x20failed\x20-\x20','9100lgxamG','app','377145nXGFTu','Environment:\x20','912302UYJVGa','production','AppCode:\x20','push','\x20\x20\x20\x20\x22lovrabet-dataset\x22:\x20{'];a113_0x27d9=function(){return _0x3464c5;};return a113_0x27d9();}export function buildClaudeMcpCommand(_0x54518b,_0x3b724f,_0x58b094){const _0x29b577=a113_0x54a209,_0x3498d2=buildMcpArgs(_0x58b094),_0x1d337c=_0x29b577(0x21a)+MCP_SERVER_NAME+'\x20'+MCP_COMMAND+'\x20'+_0x3498d2[_0x29b577(0x1ed)]('\x20')+'\x20-e\x20RABETBASE_APP_CODE='+_0x54518b,_0x81d671=_0x3b724f!==_0x29b577(0x1f7)?_0x29b577(0x1f0)+_0x3b724f:'';return''+_0x1d337c+_0x81d671;}export async function copyCursorRules(_0x329ef1){const _0x366340=a113_0x54a209,_0x187364=join(_0x329ef1,_0x366340(0x1ec)),_0x175af8=join(_0x187364,_0x366340(0x20c)),_0x37c423=join(_0x175af8,_0x366340(0x1fe));if(existsSync(_0x37c423))return logger['info'](_0x366340(0x216),'Cursor\x20Rules\x20file\x20already\x20exists,\x20skipping',{'path':_0x37c423}),![];try{ensureDir(_0x175af8);const _0xfdf98b=await getRulesContent();return writeFileSync(_0x37c423,_0xfdf98b,_0x366340(0x1e2)),logger[_0x366340(0x200)](_0x366340(0x216),_0x366340(0x21b),{'to':_0x37c423}),!![];}catch(_0x456797){return logger[_0x366340(0x21f)]('mcp-install','Failed\x20to\x20copy\x20Cursor\x20Rules\x20file',{'error':_0x456797 instanceof Error?_0x456797[_0x366340(0x1e3)]:String(_0x456797)}),![];}}export async function copyAgentsMd(_0x278a98){const _0x8ca6a9=a113_0x54a209,_0x56093d=join(_0x278a98,_0x8ca6a9(0x1ff));if(existsSync(_0x56093d))return logger[_0x8ca6a9(0x200)](_0x8ca6a9(0x216),'agents.md\x20already\x20exists,\x20skipping',{'path':_0x56093d}),![];try{const _0x5e0590=await getRulesContent();return writeFileSync(_0x56093d,_0x5e0590,'utf-8'),logger[_0x8ca6a9(0x200)]('mcp-install',_0x8ca6a9(0x20d),{'to':_0x56093d}),!![];}catch(_0xf052f6){return logger['error'](_0x8ca6a9(0x216),'Failed\x20to\x20copy\x20agents.md\x20file',{'error':_0xf052f6 instanceof Error?_0xf052f6[_0x8ca6a9(0x1e3)]:String(_0xf052f6)}),![];}}export async function configureCursorMcp(_0x5886df,_0x3ee472){const _0x55598a=a113_0x54a209;try{const {appcode:_0x416b5d,env:_0x5b3f9a}=getAppConfig(),_0x37941e=join(_0x5886df,_0x55598a(0x1ec)),_0x2853bb=join(_0x37941e,_0x55598a(0x1ee));ensureDir(_0x37941e);const _0x5900e8=buildMcpServerConfig(_0x416b5d,_0x5b3f9a,_0x3ee472);let _0x146e2b;if(existsSync(_0x2853bb)){const _0x187d4d=readFileSync(_0x2853bb,_0x55598a(0x201));_0x146e2b=JSON[_0x55598a(0x1fc)](_0x187d4d),!_0x146e2b[_0x55598a(0x210)]&&(_0x146e2b[_0x55598a(0x210)]={}),logger[_0x55598a(0x200)](_0x55598a(0x20a),_0x55598a(0x213),{'path':_0x2853bb,'appcode':_0x416b5d,'env':_0x5b3f9a});}else _0x146e2b={'mcpServers':{}},logger[_0x55598a(0x200)](_0x55598a(0x20a),'Create\x20new\x20mcp.json\x20config',{'path':_0x2853bb,'appcode':_0x416b5d,'env':_0x5b3f9a});_0x146e2b[_0x55598a(0x210)][MCP_SERVER_NAME]=_0x5900e8,writeFileSync(_0x2853bb,JSON[_0x55598a(0x1e4)](_0x146e2b,null,0x2),{'encoding':_0x55598a(0x201)});const _0x58b3c9=await copyCursorRules(_0x5886df),_0x1d51c9=['Written\x20.cursor/mcp.json',_0x55598a(0x1f8)+_0x416b5d];return _0x5b3f9a!==_0x55598a(0x1f7)&&_0x1d51c9[_0x55598a(0x1f9)](_0x55598a(0x1f5)+_0x5b3f9a),_0x1d51c9[_0x55598a(0x1f9)](_0x55598a(0x215)),_0x58b3c9&&_0x1d51c9[_0x55598a(0x1f9)](_0x55598a(0x21b)),logger[_0x55598a(0x200)]('mcp-cursor',_0x55598a(0x20f),{'appcode':_0x416b5d,'env':_0x5b3f9a,'configPath':_0x2853bb}),{'success':!![],'message':_0x1d51c9['join']('\x0a')};}catch(_0x21b2f1){return logger[_0x55598a(0x21f)]('mcp-cursor',_0x55598a(0x1f1)+(_0x21b2f1 instanceof Error?_0x21b2f1[_0x55598a(0x1e3)]:String(_0x21b2f1))+'\x0a',{'error':_0x21b2f1 instanceof Error?_0x21b2f1['message']:String(_0x21b2f1)}),{'success':![],'message':_0x21b2f1 instanceof Error?_0x21b2f1[_0x55598a(0x1e3)]:String(_0x21b2f1)};}}export function configureClaudeMcp(_0x45f77f,_0x19e7f6){const _0x119d64=a113_0x54a209;try{const {appcode:_0x420c3d,env:_0x2ad70e}=getAppConfig();copyAgentsMd(_0x45f77f);const _0x47f23f=buildMcpArgs(_0x19e7f6),_0x23c520=_0x119d64(0x21a)+MCP_SERVER_NAME+'\x20'+MCP_COMMAND+'\x20'+_0x47f23f[_0x119d64(0x1ed)]('\x20')+'\x20-e\x20RABETBASE_APP_CODE='+_0x420c3d,_0x1bb725=_0x2ad70e!==_0x119d64(0x1f7)?'\x20-e\x20RABETBASE_ENV='+_0x2ad70e:'',_0x429a96=''+_0x23c520+_0x1bb725,_0x31dc53=[_0x119d64(0x207),'--------------------------------',''+_0x429a96,_0x119d64(0x1e1),_0x119d64(0x1e0),_0x119d64(0x1f8)+_0x420c3d];return _0x2ad70e!=='production'&&_0x31dc53['push'](_0x119d64(0x1f5)+_0x2ad70e),_0x31dc53[_0x119d64(0x1f9)](_0x119d64(0x1dd)),logger['info'](_0x119d64(0x1fb),_0x119d64(0x1e7),{'appcode':_0x420c3d,'env':_0x2ad70e,'command':_0x429a96}),{'success':!![],'message':_0x31dc53[_0x119d64(0x1ed)]('\x0a'),'needsManualAction':!![]};}catch(_0x5b07a0){return logger[_0x119d64(0x21f)](_0x119d64(0x1fb),_0x119d64(0x1f1)+(_0x5b07a0 instanceof Error?_0x5b07a0[_0x119d64(0x1e3)]:String(_0x5b07a0))+'\x0a',{'error':_0x5b07a0 instanceof Error?_0x5b07a0[_0x119d64(0x1e3)]:String(_0x5b07a0)}),{'success':![],'message':_0x5b07a0 instanceof Error?_0x5b07a0[_0x119d64(0x1e3)]:String(_0x5b07a0)};}}export function showOtherMcpGuide(_0x4ff3fc,_0x42e662){const _0x48ff42=a113_0x54a209;try{const {appcode:_0x1b247c,env:_0x22e894}=getAppConfig(),_0x4ea782=buildMcpServerConfig(_0x1b247c,_0x22e894,_0x42e662),_0x432679=buildMcpArgs(_0x42e662),_0x4a7470=[_0x48ff42(0x20b)+_0x1b247c+'\x22'];_0x22e894!==_0x48ff42(0x1f7)&&_0x4a7470[_0x48ff42(0x1f9)](_0x48ff42(0x1de)+_0x22e894+'\x22');const _0x47944e=_0x22e894!=='production'?_0x48ff42(0x1e8)+_0x22e894:'',_0x1d16fd=['Configuration:\x20appcode='+_0x1b247c+_0x47944e,'{',_0x48ff42(0x208),_0x48ff42(0x1fa),_0x48ff42(0x21d),'\x20\x20\x20\x20\x20\x20\x22args\x22:\x20'+JSON[_0x48ff42(0x1e4)](_0x432679)+',',_0x48ff42(0x1ef),..._0x4a7470[_0x48ff42(0x217)](_0x5becc4=>_0x48ff42(0x21e)+_0x5becc4+','),_0x48ff42(0x1fd),'\x20\x20\x20\x20}','\x20\x20}','}','Detailed\x20guide:\x20https://open.lovrabet.com/en/docs/mcp/config-guide'];return logger[_0x48ff42(0x200)]('mcp-install',_0x48ff42(0x221),{'appcode':_0x1b247c,'env':_0x22e894}),{'success':!![],'message':_0x1d16fd[_0x48ff42(0x1ed)]('\x0a'),'needsManualAction':!![]};}catch(_0x204696){return{'success':![],'message':_0x204696 instanceof Error?_0x204696[_0x48ff42(0x1e3)]:String(_0x204696)};}}function ensureDir(_0x42feef){!existsSync(_0x42feef)&&mkdirSync(_0x42feef,{'recursive':!![]});}export async function installMcp(_0x308d52,_0x57878f,_0x450109=process[a113_0x54a209(0x219)]()){const _0x4adea0=a113_0x54a209,_0x47cbff=[];for(const _0x532b59 of _0x308d52){try{let _0x2262be;switch(_0x532b59){case _0x4adea0(0x205):_0x2262be=await configureCursorMcp(_0x450109,_0x57878f);break;case _0x4adea0(0x206):_0x2262be=configureClaudeMcp(_0x450109,_0x57878f);break;case'other':_0x2262be=showOtherMcpGuide(_0x450109,_0x57878f);break;default:_0x2262be={'success':![],'message':_0x4adea0(0x202)+_0x532b59};}_0x47cbff['push']({'ide':_0x532b59,'success':_0x2262be[_0x4adea0(0x218)],'message':_0x2262be[_0x4adea0(0x1e3)],'needsManualAction':_0x2262be[_0x4adea0(0x209)]});}catch(_0x2544fb){_0x47cbff['push']({'ide':_0x532b59,'success':![],'message':_0x2544fb instanceof Error?_0x2544fb[_0x4adea0(0x1e3)]:String(_0x2544fb)});}}return _0x47cbff;}
|
package/lib/skills/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a114_0x20504e=a114_0x15c5;(function(_0x491ff3,_0x4a6971){const _0x43e50d=a114_0x15c5,_0x299897=_0x491ff3();while(!![]){try{const _0x59f5d2=-parseInt(_0x43e50d(0x1f0))/0x1+-parseInt(_0x43e50d(0x1f2))/0x2+-parseInt(_0x43e50d(0x1e2))/0x3*(-parseInt(_0x43e50d(0x1eb))/0x4)+parseInt(_0x43e50d(0x1f8))/0x5+parseInt(_0x43e50d(0x1ec))/0x6+parseInt(_0x43e50d(0x1e7))/0x7+-parseInt(_0x43e50d(0x1dd))/0x8;if(_0x59f5d2===_0x4a6971)break;else _0x299897['push'](_0x299897['shift']());}catch(_0x119bab){_0x299897['push'](_0x299897['shift']());}}}(a114_0x53a3,0x38516));import{logger}from'../utils/logger.js';export function camelCaseFlagsToKebab(_0x4c82b8){const _0x1d5790=a114_0x15c5,_0x7ea520=[];for(const [_0x401234,_0x19f6b5]of Object[_0x1d5790(0x1e4)](_0x4c82b8)){if(_0x19f6b5===!![]){const _0x421788=_0x401234[_0x1d5790(0x1e6)](/([A-Z])/g,_0x1d5790(0x1ef))[_0x1d5790(0x1f7)]();_0x7ea520[_0x1d5790(0x1e1)](_0x421788);}}return _0x7ea520;}function a114_0x15c5(_0x5f0441,_0x219cc6){_0x5f0441=_0x5f0441-0x1d8;const _0x53a30b=a114_0x53a3();let _0x15c58e=_0x53a30b[_0x5f0441];return _0x15c58e;}export function parseDynamicFlags(){const _0x669e2f=a114_0x15c5,_0x4118b0=[];for(let _0xabf6ee=0x3;_0xabf6ee<process[_0x669e2f(0x1f1)]['length'];_0xabf6ee++){const _0x282cda=process['argv'][_0xabf6ee];if(_0x282cda&&_0x282cda['startsWith']('--')){const _0x3c1109=_0x282cda[_0x669e2f(0x1f4)](0x2);_0x3c1109&&!_0x3c1109[_0x669e2f(0x1dc)]('=')&&_0x4118b0[_0x669e2f(0x1e1)](_0x3c1109);}}return _0x4118b0;}export function getAllProvidedFlags(_0x5a6c02){const _0xa36da=a114_0x15c5,_0x2b4cf8=camelCaseFlagsToKebab(_0x5a6c02),_0x32ac26=parseDynamicFlags(),_0x39a0a3=new Set([..._0x2b4cf8,..._0x32ac26]);return Array[_0xa36da(0x1d9)](_0x39a0a3);}export function normalizeLegacyBffSaveFlags(_0x32910e){const _0x981877=a114_0x15c5,_0x14bacf=new Set(_0x32910e);return _0x14bacf['has'](_0x981877(0x1e3))&&_0x14bacf['add'](_0x981877(0x1e0)),Array['from'](_0x14bacf);}const SKILLS_INSTALL_COMMAND_LINE=a114_0x20504e(0x1db);function a114_0x53a3(){const _0x13822e=['-$1','386920IWEQbG','argv','660256IOqdMe','\x20\x20rabetbase\x20skill\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20help\x0a','slice','Equivalent\x20command:\x20','cwd','toLowerCase','1124250EbbJZJ','\x0aLovrabet\x20Skill\x20-\x20Developer\x20Skill\x20Installation\x20Tool\x0a\x0aUsage:\x0a\x20\x20rabetbase\x20skill\x20--help\x0a\x20\x20rabetbase\x20skill\x20install\x0a\x0aEquivalent\x20command:\x20','setLogPath','from','Error:\x20Unsupported\x20command:\x20','npx\x20-y\x20skills\x20add\x20lovrabet/rabetbase\x20--global','includes','354512hZFBJd','不支持的命令:\x20','error','enable-bff-save','push','396921oUXwAC','dangerously-bff-save','entries','\x20\x20rabetbase\x20skill\x20install\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Interactive\x20skill\x20installation','replace','2480394LfBFRT','--help','help','\x0a\x0aNote:\x20npx\x20skills\x20selects\x20the\x20agent\x20and\x20writes\x20files;\x20guides\x20live\x20under\x20skills/lovrabet/guides/.\x0a','12GhGAWo','95562AjJNvx','log','(empty)'];a114_0x53a3=function(){return _0x13822e;};return a114_0x53a3();}export async function skillsCommand(_0x563653,_0x59ed02,_0x5ceff8){const _0x229e3e=a114_0x20504e;logger[_0x229e3e(0x1d8)](process[_0x229e3e(0x1f6)]());if(_0x5ceff8?.[_0x229e3e(0x1e9)]||_0x563653===_0x229e3e(0x1e8)){showHelp();return;}console[_0x229e3e(0x1df)](_0x229e3e(0x1da)+(_0x563653||_0x229e3e(0x1ee))),console['log']('\x0aAvailable\x20commands:'),console['log'](_0x229e3e(0x1e5)),console[_0x229e3e(0x1ed)](_0x229e3e(0x1f3)),console[_0x229e3e(0x1ed)](''),console[_0x229e3e(0x1ed)](_0x229e3e(0x1f5)+SKILLS_INSTALL_COMMAND_LINE),logger[_0x229e3e(0x1df)]('skill',_0x229e3e(0x1de)+_0x563653),process['exit'](0x1);}function showHelp(){const _0x4ca96b=a114_0x20504e;console[_0x4ca96b(0x1ed)](_0x4ca96b(0x1f9)+SKILLS_INSTALL_COMMAND_LINE+_0x4ca96b(0x1ea));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a115_0x1dad5a=a115_0x474a;(function(_0x14e3cf,_0xab2739){const _0x43f2f7=a115_0x474a,_0x163f31=_0x14e3cf();while(!![]){try{const _0x1f7429=parseInt(_0x43f2f7(0x80))/0x1*(parseInt(_0x43f2f7(0x69))/0x2)+parseInt(_0x43f2f7(0x7f))/0x3*(parseInt(_0x43f2f7(0x7e))/0x4)+parseInt(_0x43f2f7(0x66))/0x5+-parseInt(_0x43f2f7(0x65))/0x6*(-parseInt(_0x43f2f7(0x7b))/0x7)+parseInt(_0x43f2f7(0x83))/0x8*(parseInt(_0x43f2f7(0x77))/0x9)+-parseInt(_0x43f2f7(0x6a))/0xa+-parseInt(_0x43f2f7(0x75))/0xb;if(_0x1f7429===_0xab2739)break;else _0x163f31['push'](_0x163f31['shift']());}catch(_0x54e0af){_0x163f31['push'](_0x163f31['shift']());}}}(a115_0x5542,0xa3ba1));import{spawnSync}from'node:child_process';export const NPX_FLAG_YES='-y';function a115_0x474a(_0x578e5d,_0x1a079c){_0x578e5d=_0x578e5d-0x65;const _0x554295=a115_0x5542();let _0x474a6a=_0x554295[_0x578e5d];return _0x474a6a;}export const NPX_SKILLS_CLI=a115_0x1dad5a(0x6e);export const NPX_SKILLS_SUBCOMMAND_ADD='add';export const NPX_SKILLS_FLAG_SKILL='--skill';export const RABETBASE_SKILL_SOURCE='lovrabet/lovrabet-skill';function a115_0x5542(){const _0x586cef=['platform','join','178HdylIu','4049110qZhnJq','inherit','log','remove','skills','win32','env','unknown','exit\x20','stderr','RABETBASE_SKIP_NPX_SKILLS','31403515wELQjB','Lovrabet','9LdfKGo','stdio','pipe','--global','12026EhqoCI','toString','npx','4omWnGj','2867445vAJpQE','11503NOcDnn','npx.cmd','skill','2803624ikgcqr','status','trim','stdout','4206WCsxiR','1980240IAjYno'];a115_0x5542=function(){return _0x586cef;};return a115_0x5542();}export const DEFAULT_RABETBASE_SKILL_NAME=a115_0x1dad5a(0x76);export function buildNpxSkillsAddArgv(_0x406dcf=DEFAULT_RABETBASE_SKILL_NAME){return[NPX_FLAG_YES,NPX_SKILLS_CLI,NPX_SKILLS_SUBCOMMAND_ADD,RABETBASE_SKILL_SOURCE,NPX_SKILLS_FLAG_SKILL,_0x406dcf];}export const NPX_SKILLS_ADD_COMMAND_LINE=[a115_0x1dad5a(0x7d),...buildNpxSkillsAddArgv()]['join']('\x20');export function shouldSkipNpxSkillsAdd(){const _0x499ffd=a115_0x1dad5a;return process[_0x499ffd(0x70)][_0x499ffd(0x74)]==='1';}export function runNpxSkillsAdd(_0x36d04b,_0x438505){const _0x4ea366=a115_0x1dad5a;if(shouldSkipNpxSkillsAdd())return{'ok':!![],'status':0x0,'skipped':!![]};const _0xf83c1c=_0x438505?.[_0x4ea366(0x78)]??_0x4ea366(0x6b),_0x11b4a3=process['platform']===_0x4ea366(0x6f)?_0x4ea366(0x81):'npx',_0x1284eb=buildNpxSkillsAddArgv(_0x438505?.['skill']??DEFAULT_RABETBASE_SKILL_NAME),_0x3cb8b5=[_0x11b4a3,..._0x1284eb]['join']('\x20');console['log']('*\x20'+_0x3cb8b5);const _0xa3922a=spawnSync(_0x11b4a3,_0x1284eb,{'cwd':_0x36d04b,'stdio':_0xf83c1c,'env':process[_0x4ea366(0x70)],'shell':![]}),_0x1c165a=_0xa3922a[_0x4ea366(0x84)];if(_0x1c165a===0x0)return{'ok':!![],'status':0x0};let _0x42243e=_0x4ea366(0x72)+(_0x1c165a??'unknown');if(_0xf83c1c===_0x4ea366(0x79)){const _0x38dc56=_0xa3922a[_0x4ea366(0x73)]?_0xa3922a['stderr'][_0x4ea366(0x7c)]()[_0x4ea366(0x85)]():'',_0x2dc371=_0xa3922a[_0x4ea366(0x86)]?_0xa3922a[_0x4ea366(0x86)]['toString']()['trim']():'';if(_0x38dc56)_0x42243e=_0x38dc56;else{if(_0x2dc371)_0x42243e=_0x2dc371;}}return{'ok':![],'status':_0x1c165a??null,'error':_0x42243e};}export function runNpxSkillsRemove(_0x23df6c,_0x218baf){const _0xf17ec7=a115_0x1dad5a,_0x5be00f=_0x218baf?.[_0xf17ec7(0x78)]??_0xf17ec7(0x6b),_0x524ce4=process[_0xf17ec7(0x67)]===_0xf17ec7(0x6f)?'npx.cmd':_0xf17ec7(0x7d),_0xf968e9=[NPX_FLAG_YES,NPX_SKILLS_CLI,_0xf17ec7(0x6d),RABETBASE_SKILL_SOURCE,NPX_SKILLS_FLAG_SKILL,_0x218baf?.[_0xf17ec7(0x82)]??DEFAULT_RABETBASE_SKILL_NAME],_0x12b0e3=[_0x524ce4,..._0xf968e9][_0xf17ec7(0x68)]('\x20');console['log']('*\x20'+_0x12b0e3);const _0x174659=spawnSync(_0x524ce4,_0xf968e9,{'cwd':_0x23df6c,'stdio':_0x5be00f,'env':process['env'],'shell':![]}),_0x4638c1=_0x174659[_0xf17ec7(0x84)];if(_0x4638c1===0x0)return{'ok':!![],'status':0x0};let _0xd7d440=_0xf17ec7(0x72)+(_0x4638c1??_0xf17ec7(0x71));if(_0x5be00f==='pipe'){const _0x27c9c6=_0x174659[_0xf17ec7(0x73)]?_0x174659['stderr'][_0xf17ec7(0x7c)]()[_0xf17ec7(0x85)]():'',_0x31ddc3=_0x174659[_0xf17ec7(0x86)]?_0x174659['stdout'][_0xf17ec7(0x7c)]()[_0xf17ec7(0x85)]():'';if(_0x27c9c6)_0xd7d440=_0x27c9c6;else{if(_0x31ddc3)_0xd7d440=_0x31ddc3;}}return{'ok':![],'status':_0x4638c1??null,'error':_0xd7d440};}export function runNpxSkillsAddGlobal(_0xa59143,_0x14f5f5,_0x5e9f66){const _0x5226ab=a115_0x1dad5a,_0x1df570=_0x5e9f66?.[_0x5226ab(0x78)]??'inherit',_0x172cb4=process['platform']===_0x5226ab(0x6f)?_0x5226ab(0x81):_0x5226ab(0x7d),_0x2cf2b7=[NPX_FLAG_YES,NPX_SKILLS_CLI,NPX_SKILLS_SUBCOMMAND_ADD,_0x14f5f5,_0x5226ab(0x7a)],_0x3a914e=[_0x172cb4,..._0x2cf2b7][_0x5226ab(0x68)]('\x20');console[_0x5226ab(0x6c)]('*\x20'+_0x3a914e);const _0x5c5624=spawnSync(_0x172cb4,_0x2cf2b7,{'cwd':_0xa59143,'stdio':_0x1df570,'env':process[_0x5226ab(0x70)],'shell':![]}),_0x318835=_0x5c5624[_0x5226ab(0x84)];if(_0x318835===0x0)return{'ok':!![],'status':0x0};let _0x57bbc8='exit\x20'+(_0x318835??_0x5226ab(0x71));if(_0x1df570===_0x5226ab(0x79)){const _0x52dbc3=_0x5c5624['stderr']?_0x5c5624[_0x5226ab(0x73)][_0x5226ab(0x7c)]()['trim']():'',_0x42947e=_0x5c5624['stdout']?_0x5c5624[_0x5226ab(0x86)]['toString']()[_0x5226ab(0x85)]():'';if(_0x52dbc3)_0x57bbc8=_0x52dbc3;else{if(_0x42947e)_0x57bbc8=_0x42947e;}}return{'ok':![],'status':_0x318835??null,'error':_0x57bbc8};}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(_0x246ba5,_0x21167f){const _0x5361d2=a116_0x4698,_0xacffb3=_0x246ba5();while(!![]){try{const _0x398f65=parseInt(_0x5361d2(0x13a))/0x1+parseInt(_0x5361d2(0x129))/0x2+-parseInt(_0x5361d2(0x11f))/0x3*(parseInt(_0x5361d2(0x124))/0x4)+parseInt(_0x5361d2(0x127))/0x5*(parseInt(_0x5361d2(0x121))/0x6)+-parseInt(_0x5361d2(0x130))/0x7*(parseInt(_0x5361d2(0x134))/0x8)+-parseInt(_0x5361d2(0x135))/0x9+parseInt(_0x5361d2(0x12d))/0xa;if(_0x398f65===_0x21167f)break;else _0xacffb3['push'](_0xacffb3['shift']());}catch(_0x496f34){_0xacffb3['push'](_0xacffb3['shift']());}}}(a116_0x4af3,0x40161));import{createRequire}from'node:module';import a116_0x3ccb2f from'node:os';function a116_0x4698(_0x989c1c,_0x5b5323){_0x989c1c=_0x989c1c-0x11f;const _0x4af3e4=a116_0x4af3();let _0x4698a7=_0x4af3e4[_0x989c1c];return _0x4698a7;}import{BUILD_NUMBER}from'../generated/build-info.js';import{getSessionUserInfo}from'../auth/get-session-user.js';import{getOtelLoggerPackageVersion}from'./otel-logger-version.js';const require=createRequire(import.meta.url),pkg=require('../../package.json');export async function reportCliHelpTrace(_0xbeaf4d,_0x43838a){const _0x4046f8=a116_0x4698;try{const {setTraceConfig:_0x36644c,sendNodeTraceLog:_0x28b467}=await import(_0x4046f8(0x123)),_0xbb7f08=getOtelLoggerPackageVersion(),_0x170595=await getSessionUserInfo(),_0x9e7199=_0x170595?.[_0x4046f8(0x12e)];_0x36644c({'otelLoggerVersion':_0xbb7f08,'serviceName':pkg[_0x4046f8(0x126)],'serviceVersion':BUILD_NUMBER?pkg[_0x4046f8(0x125)]+_0x4046f8(0x138)+BUILD_NUMBER:pkg[_0x4046f8(0x125)],'serviceEnv':process[_0x4046f8(0x12c)][_0x4046f8(0x133)]??(process[_0x4046f8(0x12c)][_0x4046f8(0x137)]==='1'?_0x4046f8(0x120):_0x4046f8(0x132)),'username':_0x9e7199?.[_0x4046f8(0x131)]??a116_0x3ccb2f[_0x4046f8(0x128)]()[_0x4046f8(0x131)]??'rabetbase-cli',..._0x9e7199&&{'nickname':_0x9e7199[_0x4046f8(0x139)]},..._0x9e7199?.['id']!=null&&_0x9e7199['id']!==''&&{'userId':String(_0x9e7199['id'])}}),_0x28b467({'traceName':'rabetbase-cli','version':pkg[_0x4046f8(0x125)],'spanName':_0x4046f8(0x136),'eventType':_0x4046f8(0x12f),'logData':{'rabetbase.help.kind':_0xbeaf4d,..._0x43838a?.[_0x4046f8(0x12a)]&&{'rabetbase.help.service':_0x43838a[_0x4046f8(0x12a)]}}});}catch(_0xf4fe0d){console[_0x4046f8(0x12b)](_0x4046f8(0x122),_0xf4fe0d);}}function a116_0x4af3(){const _0x1a7f4c=['4560380lJhlNK','user','manual','7Izirog','username','production','RABETBASE_ENV','3203848ltKsdt','2402199GLXUmq','cli.help','RABETBASE_E2E_DAILY','+build.','nickname','160177AYGBRO','1296111JFvdmo','daily','6MTBmBT','Failed\x20to\x20report\x20CLI\x20help\x20trace:','@yuntoo/otel-logger/node','4qCwdcS','version','name','2198705PsjENQ','userInfo','611940CraseR','service','error','env'];a116_0x4af3=function(){return _0x1a7f4c;};return a116_0x4af3();}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(_0x1f5d09,_0x1a4838){const _0x616240=a117_0x1a09,_0x4189ee=_0x1f5d09();while(!![]){try{const _0x4d90fe=-parseInt(_0x616240(0xb2))/0x1*(parseInt(_0x616240(0xaf))/0x2)+parseInt(_0x616240(0xab))/0x3*(-parseInt(_0x616240(0xb7))/0x4)+parseInt(_0x616240(0xb5))/0x5+parseInt(_0x616240(0xb4))/0x6*(-parseInt(_0x616240(0xaa))/0x7)+-parseInt(_0x616240(0xa6))/0x8+-parseInt(_0x616240(0xb6))/0x9*(-parseInt(_0x616240(0xac))/0xa)+parseInt(_0x616240(0xb1))/0xb*(parseInt(_0x616240(0xa8))/0xc);if(_0x4d90fe===_0x1a4838)break;else _0x4189ee['push'](_0x4189ee['shift']());}catch(_0x204ce8){_0x4189ee['push'](_0x4189ee['shift']());}}}(a117_0x53b1,0x8c4d3));import{readFileSync}from'node:fs';function a117_0x53b1(){const _0x46506b=['parse','9746NVkDCP','8811GJhpRg','package.json','6zLZhzr','5215260RLVgXC','16389kmjPdd','76zsrdDV','utf-8','8816504RUWcep','0.0.0','28632SBluXe','version','2299171QQtnpC','93540TmHSxq','460AiNpDQ','resolve','@yuntoo/otel-logger/node','146uqznPW'];a117_0x53b1=function(){return _0x46506b;};return a117_0x53b1();}import{dirname,join}from'node:path';import{createRequire}from'node:module';function a117_0x1a09(_0x232b53,_0x2a7b25){_0x232b53=_0x232b53-0xa5;const _0x53b1d5=a117_0x53b1();let _0x1a09fc=_0x53b1d5[_0x232b53];return _0x1a09fc;}const require=createRequire(import.meta.url);export function getOtelLoggerPackageVersion(){const _0x31121c=a117_0x1a09;try{const _0x296fd9=require[_0x31121c(0xad)](_0x31121c(0xae)),_0x543a13=join(dirname(_0x296fd9),'..',_0x31121c(0xb3)),_0x151e08=JSON[_0x31121c(0xb0)](readFileSync(_0x543a13,_0x31121c(0xa5)));return _0x151e08[_0x31121c(0xa9)];}catch{return _0x31121c(0xa7);}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(_0x2a8fc7,_0x42ff5a){const _0x1c26ee=a118_0x4feb,_0xb834e3=_0x2a8fc7();while(!![]){try{const _0x2c279f=-parseInt(_0x1c26ee(0x1de))/0x1+-parseInt(_0x1c26ee(0x1d7))/0x2*(parseInt(_0x1c26ee(0x1dc))/0x3)+parseInt(_0x1c26ee(0x1d5))/0x4+-parseInt(_0x1c26ee(0x1e2))/0x5*(-parseInt(_0x1c26ee(0x1d6))/0x6)+-parseInt(_0x1c26ee(0x1d4))/0x7*(-parseInt(_0x1c26ee(0x1d3))/0x8)+-parseInt(_0x1c26ee(0x1e1))/0x9*(parseInt(_0x1c26ee(0x1e0))/0xa)+parseInt(_0x1c26ee(0x1dd))/0xb;if(_0x2c279f===_0x42ff5a)break;else _0xb834e3['push'](_0xb834e3['shift']());}catch(_0x2bb079){_0xb834e3['push'](_0xb834e3['shift']());}}}(a118_0x371c,0x21e0f));let shutdownPromise=null;export async function flushOtelNodeIfUsed(){if(shutdownPromise)return shutdownPromise;return shutdownPromise=((async()=>{const _0x5c285a=a118_0x4feb;try{const {shutdownNodeTraces:_0x28c88f}=await import(_0x5c285a(0x1df));await _0x28c88f();}catch{}})()),shutdownPromise;}function a118_0x4feb(_0x3fbcdf,_0x5dcd4c){_0x3fbcdf=_0x3fbcdf-0x1d2;const _0x371c1b=a118_0x371c();let _0x4feb11=_0x371c1b[_0x3fbcdf];return _0x4feb11;}function a118_0x371c(){const _0x1672e5=['215cbvkvJ','SIGINT','64YUacCw','150108RQJYvB','741836CGIoyA','28554UwRLYV','14918PCohnx','once','then','SIGTERM','exit','57pmHOtT','1267288JXUPXI','248458qyGIQQ','@yuntoo/otel-logger/node','42260DLfRYB','315OcVzzZ'];a118_0x371c=function(){return _0x1672e5;};return a118_0x371c();}export function registerOtelShutdownOnExit(){const _0x22a959=a118_0x4feb;process[_0x22a959(0x1d8)]('beforeExit',()=>{void flushOtelNodeIfUsed();});const _0x5617f8=()=>{const _0xb713ac=_0x22a959;void flushOtelNodeIfUsed()[_0xb713ac(0x1d9)](()=>process[_0xb713ac(0x1db)](0x0));};process[_0x22a959(0x1d8)](_0x22a959(0x1d2),_0x5617f8),process[_0x22a959(0x1d8)](_0x22a959(0x1da),_0x5617f8);}export async function exitWithOtelShutdown(_0x53acc3){const _0xd56ff2=a118_0x4feb;await flushOtelNodeIfUsed(),process[_0xd56ff2(0x1db)](_0x53acc3);}
|
package/lib/ui/IDESelector.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a120_0x59ec(){const _0x15f616=['2944458yLDgoS','gray','white','\x20↑/↓:\x20Move\x20\x20Space:\x20Toggle\x20\x20a:\x20All\x20\x20i/r:\x20Invert\x20\x20q:\x20Quit\x20\x20Enter:\x20Confirm','7guBmvk','blue','*\x20Select\x20IDEs\x20to\x20configure:','46802GPrXIG','3072812WlKNoO','4562208AYXJgE','592VXXXRU','[\x20]','22705101rmUfoz','has','cyan','[✓]','3675065ZSfRIW','red','column','181822sdBuik','map'];a120_0x59ec=function(){return _0x15f616;};return a120_0x59ec();}(function(_0x1b68ee,_0x17cd12){const _0x41ba72=a120_0x55a7,_0x452a15=_0x1b68ee();while(!![]){try{const _0x29d3b5=parseInt(_0x41ba72(0xce))/0x1*(parseInt(_0x41ba72(0xdd))/0x2)+-parseInt(_0x41ba72(0xca))/0x3+-parseInt(_0x41ba72(0xd2))/0x4+parseInt(_0x41ba72(0xda))/0x5+-parseInt(_0x41ba72(0xd3))/0x6+-parseInt(_0x41ba72(0xd1))/0x7*(parseInt(_0x41ba72(0xd4))/0x8)+parseInt(_0x41ba72(0xd6))/0x9;if(_0x29d3b5===_0x17cd12)break;else _0x452a15['push'](_0x452a15['shift']());}catch(_0x555b5c){_0x452a15['push'](_0x452a15['shift']());}}}(a120_0x59ec,0xd920e));import{jsxs as a120_0x557719,jsx as a120_0x252cc1}from'react/jsx-runtime';import{Text,Box}from'ink';function a120_0x55a7(_0x339e9c,_0x5a0845){_0x339e9c=_0x339e9c-0xc9;const _0x59ec2f=a120_0x59ec();let _0x55a786=_0x59ec2f[_0x339e9c];return _0x55a786;}export function IDESelector({ideList:_0x306a16,title:_0x116ced,selection:_0x16c148}){const _0x40ebcb=a120_0x55a7,{selectedIndexes:_0x5a1275,highlightIndex:_0x4811ed,errorMsg:_0x49e760}=_0x16c148;return a120_0x557719(Box,{'flexDirection':_0x40ebcb(0xdc),'marginTop':0x1,'children':[a120_0x252cc1(Box,{'children':a120_0x557719(Text,{'color':_0x40ebcb(0xd8),'children':['*\x20',_0x116ced]})}),_0x49e760&&a120_0x252cc1(Box,{'marginTop':0x1,'children':a120_0x557719(Text,{'color':_0x40ebcb(0xdb),'children':['✗\x20',_0x49e760]})}),a120_0x557719(Box,{'marginTop':0x1,'flexDirection':_0x40ebcb(0xdc),'children':[a120_0x252cc1(Text,{'bold':!![],'children':_0x40ebcb(0xd0)}),_0x306a16[_0x40ebcb(0xc9)]((_0x3b3abd,_0x1f3149)=>{const _0xc28120=_0x40ebcb,_0x4d5b05=_0x4811ed===_0x1f3149,_0x38af5f=_0x5a1275[_0xc28120(0xd7)](_0x1f3149);return a120_0x252cc1(Box,{'children':a120_0x557719(Text,{'backgroundColor':_0x4d5b05?_0xc28120(0xcf):undefined,'color':_0x4d5b05?_0xc28120(0xcc):undefined,'children':['\x20\x20',_0x38af5f?_0xc28120(0xd9):_0xc28120(0xd5),'\x20',_0x3b3abd['name'],'\x20',a120_0x557719(Text,{'color':_0x4d5b05?'white':_0xc28120(0xcb),'dimColor':!_0x4d5b05,'children':['-\x20',_0x3b3abd['description']]})]})},_0x3b3abd['key']);}),a120_0x252cc1(Box,{'marginTop':0x1,'children':a120_0x252cc1(Text,{'color':'gray','children':_0x40ebcb(0xcd)})})]})]});}export{useIDESelection}from'./useIDESelection.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x283917,_0xd625d7){const _0x3bfb04=a121_0x3c13,_0x137902=_0x283917();while(!![]){try{const _0x36bc34=-parseInt(_0x3bfb04(0x18a))/0x1*(parseInt(_0x3bfb04(0x194))/0x2)+-parseInt(_0x3bfb04(0x18d))/0x3*(parseInt(_0x3bfb04(0x18b))/0x4)+parseInt(_0x3bfb04(0x19b))/0x5*(parseInt(_0x3bfb04(0x195))/0x6)+-parseInt(_0x3bfb04(0x189))/0x7*(parseInt(_0x3bfb04(0x190))/0x8)+parseInt(_0x3bfb04(0x192))/0x9*(-parseInt(_0x3bfb04(0x199))/0xa)+-parseInt(_0x3bfb04(0x19c))/0xb+parseInt(_0x3bfb04(0x196))/0xc;if(_0x36bc34===_0xd625d7)break;else _0x137902['push'](_0x137902['shift']());}catch(_0x8060e4){_0x137902['push'](_0x137902['shift']());}}}(a121_0x5e1d,0x379b1));import{useState,useCallback}from'react';function a121_0x3c13(_0x4fcde5,_0x437a96){_0x4fcde5=_0x4fcde5-0x188;const _0x5e1d98=a121_0x5e1d();let _0x3c13f4=_0x5e1d98[_0x4fcde5];return _0x3c13f4;}function a121_0x5e1d(){const _0x52f564=['110oUUKbL','key','627055VleDlC','143407hvooqP','filter','add','28854yYniIC','13nEbAqw','534968mWeXeb','delete','9DsSKue','length','upArrow','256tTteOe','downArrow','179919GceSxZ','map','66644EWYBNz','6Yxwhay','15619248FKzZaN','has','size'];a121_0x5e1d=function(){return _0x52f564;};return a121_0x5e1d();}export function useIDESelection({ideList:_0x295e10,preselectedIDEs:preselectedIDEs=[],multiSelect:multiSelect=!![]}){const _0xb27bb6=a121_0x3c13,[_0x55fc0e,_0x20e7be]=useState(new Set(preselectedIDEs[_0xb27bb6(0x193)](_0x5effd8=>_0x295e10['findIndex'](_0x4625fd=>_0x4625fd[_0xb27bb6(0x19a)]===_0x5effd8))['filter'](_0x575846=>_0x575846>=0x0))),[_0x141619,_0x375213]=useState(0x0),[_0x22cb49,_0x329fdf]=useState(''),_0x53d46f=useCallback(()=>{_0x375213(_0x5da6bb=>_0x5da6bb>0x0?_0x5da6bb-0x1:_0x295e10['length']-0x1);},[_0x295e10[_0xb27bb6(0x18e)]]),_0x1219f5=useCallback(()=>{const _0x3d9927=_0xb27bb6;_0x375213(_0x5727c7=>_0x5727c7<_0x295e10[_0x3d9927(0x18e)]-0x1?_0x5727c7+0x1:0x0);},[_0x295e10[_0xb27bb6(0x18e)]]),_0x4ba36b=useCallback(()=>{if(!multiSelect){_0x20e7be(new Set([_0x141619]));return;}_0x20e7be(_0x4356ec=>{const _0x501193=a121_0x3c13,_0x46ab24=new Set(_0x4356ec);return _0x46ab24[_0x501193(0x197)](_0x141619)?_0x46ab24[_0x501193(0x18c)](_0x141619):_0x46ab24[_0x501193(0x188)](_0x141619),_0x46ab24;});},[_0x141619,multiSelect]),_0x4d0bf8=useCallback(()=>{const _0x22501e=_0xb27bb6;_0x20e7be(new Set(_0x295e10[_0x22501e(0x193)]((_0x4f51cc,_0x422944)=>_0x422944)));},[_0x295e10]),_0x2bb46e=useCallback(()=>{_0x20e7be(_0x597e88=>{const _0x443ac4=a121_0x3c13,_0x2467ee=new Set();for(let _0x31904b=0x0;_0x31904b<_0x295e10[_0x443ac4(0x18e)];_0x31904b++){!_0x597e88[_0x443ac4(0x197)](_0x31904b)&&_0x2467ee['add'](_0x31904b);}return _0x2467ee;});},[_0x295e10]),_0x55d7b1=useCallback(()=>{const _0x38963a=_0xb27bb6;return Array['from'](_0x55fc0e)['map'](_0x1e7214=>_0x295e10[_0x1e7214]?.[_0x38963a(0x19a)])[_0x38963a(0x19d)](_0x3dde95=>_0x3dde95!==undefined);},[_0x55fc0e,_0x295e10]),_0x3e27f5=useCallback(()=>{const _0x27706b=_0xb27bb6;return _0x55fc0e[_0x27706b(0x198)]===_0x295e10[_0x27706b(0x18e)];},[_0x55fc0e,_0x295e10]),_0x1ea34b=useCallback((_0x24e364,_0x7703ec)=>{const _0xa0d775=_0xb27bb6;if(_0x7703ec[_0xa0d775(0x18f)])return _0x53d46f(),!![];if(_0x7703ec[_0xa0d775(0x191)])return _0x1219f5(),!![];if(_0x24e364==='\x20')return _0x4ba36b(),!![];if(_0x24e364==='a'||_0x24e364==='A')return _0x4d0bf8(),!![];if(_0x24e364==='i'||_0x24e364==='I'||_0x24e364==='r'||_0x24e364==='R')return _0x2bb46e(),!![];return![];},[_0x53d46f,_0x1219f5,_0x4ba36b,_0x4d0bf8,_0x2bb46e]);return{'selectedIndexes':_0x55fc0e,'highlightIndex':_0x141619,'errorMsg':_0x22cb49,'setErrorMsg':_0x329fdf,'handleKeyDown':_0x1ea34b,'getSelectedIDEs':_0x55d7b1,'isAllSelected':_0x3e27f5,'toggleSelection':_0x4ba36b,'selectAll':_0x4d0bf8,'invertSelection':_0x2bb46e,'moveHighlightUp':_0x53d46f,'moveHighlightDown':_0x1219f5};}
|
package/lib/utils/ai_config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a122_0x13ee0f=a122_0x2e28;(function(_0x2fb530,_0x883885){const _0xb7c462=a122_0x2e28,_0xd40f55=_0x2fb530();while(!![]){try{const _0x181314=-parseInt(_0xb7c462(0x1ea))/0x1*(parseInt(_0xb7c462(0x1e3))/0x2)+parseInt(_0xb7c462(0x1d2))/0x3+parseInt(_0xb7c462(0x1e7))/0x4*(-parseInt(_0xb7c462(0x1c1))/0x5)+-parseInt(_0xb7c462(0x1c6))/0x6+parseInt(_0xb7c462(0x1c0))/0x7*(parseInt(_0xb7c462(0x1e4))/0x8)+-parseInt(_0xb7c462(0x1f2))/0x9*(-parseInt(_0xb7c462(0x1eb))/0xa)+parseInt(_0xb7c462(0x1d1))/0xb;if(_0x181314===_0x883885)break;else _0xd40f55['push'](_0xd40f55['shift']());}catch(_0x5b5a98){_0xd40f55['push'](_0xd40f55['shift']());}}}(a122_0x39a2,0xbb8de));export const CORE_IDE_CONFIGS={'cursor':{'name':a122_0x13ee0f(0x1c8),'description':a122_0x13ee0f(0x1dd),'folders':[a122_0x13ee0f(0x1e9),'.cursor'],'files':[{'type':a122_0x13ee0f(0x1ce),'path':'.cursor/skills/rabetbase.md','template':a122_0x13ee0f(0x1c4)}]},'windsurf':{'name':a122_0x13ee0f(0x1d4),'description':'Windsurf\x20IDE','folders':[a122_0x13ee0f(0x1c5)],'files':[{'type':'file','path':a122_0x13ee0f(0x1ca),'template':a122_0x13ee0f(0x1c4)}]},'claude':{'name':a122_0x13ee0f(0x1de),'description':'Claude\x20Code','folders':['.claude'],'files':[{'type':a122_0x13ee0f(0x1ce),'path':a122_0x13ee0f(0x1cb),'template':'SKILL.md.tpl'}]},'cline':{'name':a122_0x13ee0f(0x1d8),'description':a122_0x13ee0f(0x1dc),'folders':[a122_0x13ee0f(0x1ec)],'files':[{'type':a122_0x13ee0f(0x1ce),'path':'.cline/skills/lovrabet/SKILL.md','template':'SKILL.md.tpl'}]},'codex':{'name':a122_0x13ee0f(0x1ee),'description':a122_0x13ee0f(0x1e2),'folders':[a122_0x13ee0f(0x1e0)],'files':[{'type':'file','path':a122_0x13ee0f(0x1e6),'template':a122_0x13ee0f(0x1c4)}]},'opencode':{'name':a122_0x13ee0f(0x1f5),'description':'OpenCode\x20IDE','folders':[a122_0x13ee0f(0x1d0)],'files':[{'type':'file','path':a122_0x13ee0f(0x1c2),'template':a122_0x13ee0f(0x1c4)}]},'qoder':{'name':a122_0x13ee0f(0x1c9),'description':a122_0x13ee0f(0x1f1),'folders':['.qoder'],'files':[{'type':'file','path':a122_0x13ee0f(0x1e1),'template':a122_0x13ee0f(0x1c4)},{'type':a122_0x13ee0f(0x1ce),'path':'.qoder/skills/lovrabet/SKILL.md','template':a122_0x13ee0f(0x1c4)}]},'codebuddy':{'name':'CodeBuddy','description':a122_0x13ee0f(0x1df),'folders':['.codebuddy'],'files':[{'type':a122_0x13ee0f(0x1ce),'path':a122_0x13ee0f(0x1bf),'template':a122_0x13ee0f(0x1c4)}]},'trae':{'name':a122_0x13ee0f(0x1d6),'description':a122_0x13ee0f(0x1d9),'folders':[a122_0x13ee0f(0x1cd)],'files':[{'type':a122_0x13ee0f(0x1ce),'path':'.trae/skills/lovrabet/SKILL.md','template':'SKILL.md.tpl'}]}};function a122_0x39a2(){const _0x5ecbe3=['CodeBuddy\x20IDE','.codex','.qoder/rules/rabetbase.md','Codex\x20IDE','1526GQQDbz','8mFzLOv','.agent','.codex/skills/lovrabet/SKILL.md','1688FszMAM','cursor','.cursorrules','280fLNipC','50PLFltr','.cline','.agent/skills/lovrabet/SKILL.md','Codex','windsurf','codebuddy','Qoder\x20IDE','2372355JUUYer','claude','cline','OpenCode','.codebuddy/skills/lovrabet/SKILL.md','1202369SLjAZV','16420cGckKO','.opencode/skills/lovrabet/SKILL.md','codex','SKILL.md.tpl','.windsurf','2126250IcsvBk','Antigravity','Cursor','Qoder','.windsurf/workflows/rabetbase.md','.claude/skills/lovrabet/SKILL.md','agent','.trae','file','trae','.opencode','5955136MVTzFp','2072901tQGkOk','antigravity','Windsurf','opencode','Trae','qoder','Cline','Trae\x20IDE','其他\x20(通用模板)','Antigravity\x20IDE','Cline\x20IDE','Cursor\x20IDE','Claude\x20Code'];a122_0x39a2=function(){return _0x5ecbe3;};return a122_0x39a2();}export const IDE_CONFIGS={...CORE_IDE_CONFIGS,'agent':{'name':a122_0x13ee0f(0x1da),'description':'通用模板\x20-\x20兜底方案','folders':['.agent'],'files':[{'type':a122_0x13ee0f(0x1ce),'path':a122_0x13ee0f(0x1ed),'template':a122_0x13ee0f(0x1c4)}]},'antigravity':{'name':a122_0x13ee0f(0x1c7),'description':a122_0x13ee0f(0x1db),'folders':[a122_0x13ee0f(0x1e5)],'files':[{'type':a122_0x13ee0f(0x1ce),'path':'.agent/skills/lovrabet/SKILL.md','template':a122_0x13ee0f(0x1c4)}]}};export const CORE_IDE_LIST=[a122_0x13ee0f(0x1f3),'cline',a122_0x13ee0f(0x1f0),a122_0x13ee0f(0x1c3),'cursor','opencode',a122_0x13ee0f(0x1d7),'trae',a122_0x13ee0f(0x1ef)];export const IDE_LIST=[a122_0x13ee0f(0x1d3),a122_0x13ee0f(0x1f3),a122_0x13ee0f(0x1f4),a122_0x13ee0f(0x1f0),a122_0x13ee0f(0x1c3),'cursor',a122_0x13ee0f(0x1d5),a122_0x13ee0f(0x1d7),a122_0x13ee0f(0x1cf),a122_0x13ee0f(0x1ef),a122_0x13ee0f(0x1cc)];function a122_0x2e28(_0x562200,_0x576c7e){_0x562200=_0x562200-0x1bf;const _0x39a2c3=a122_0x39a2();let _0x2e2820=_0x39a2c3[_0x562200];return _0x2e2820;}export const ALL_CORE_IDES=['cursor',a122_0x13ee0f(0x1ef),a122_0x13ee0f(0x1f3),'cline',a122_0x13ee0f(0x1c3),a122_0x13ee0f(0x1d5),a122_0x13ee0f(0x1d7),'codebuddy',a122_0x13ee0f(0x1cf)];export const MCP_IDES=new Set([a122_0x13ee0f(0x1e8),a122_0x13ee0f(0x1f3)]);
|
package/lib/utils/cdn-config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x40ccbd,_0x3aa8f5){const _0x1b8803=a123_0x467f,_0x1fc4a5=_0x40ccbd();while(!![]){try{const _0x37c4b7=-parseInt(_0x1b8803(0xa0))/0x1+-parseInt(_0x1b8803(0x9d))/0x2+-parseInt(_0x1b8803(0x97))/0x3+-parseInt(_0x1b8803(0x94))/0x4+parseInt(_0x1b8803(0xa1))/0x5*(-parseInt(_0x1b8803(0x9f))/0x6)+-parseInt(_0x1b8803(0x95))/0x7*(-parseInt(_0x1b8803(0x99))/0x8)+parseInt(_0x1b8803(0x9b))/0x9;if(_0x37c4b7===_0x3aa8f5)break;else _0x1fc4a5['push'](_0x1fc4a5['shift']());}catch(_0x6f2042){_0x1fc4a5['push'](_0x1fc4a5['shift']());}}}(a123_0x3ff8,0xddddc));import{getTemplateBaseUrl}from'./config.js';export async function fetchCdnConfig(){const _0x2e1263=a123_0x467f;try{const _0x2a857d=getTemplateBaseUrl(),_0x3cc475=_0x2a857d+'/config.json',_0x3d1fd4=await fetch(_0x3cc475,{'headers':{'Accept':'application/json'}});if(!_0x3d1fd4['ok'])return null;const _0x3bcf2d=await _0x3d1fd4[_0x2e1263(0x9e)]();if(!_0x3bcf2d[_0x2e1263(0x96)]?.['stableVersion']||!_0x3bcf2d['sdk']?.[_0x2e1263(0x9c)]?.[_0x2e1263(0x9a)])return null;return _0x3bcf2d;}catch{return null;}}let cachedConfig=null,cacheTime=0x0;function a123_0x467f(_0x1da21a,_0x36d371){_0x1da21a=_0x1da21a-0x94;const _0x3ff8c7=a123_0x3ff8();let _0x467f27=_0x3ff8c7[_0x1da21a];return _0x467f27;}const CACHE_TTL=0x5*0x3c*0x3e8;export async function getCdnConfig(){const _0x5c96a9=a123_0x467f,_0x2ca9b8=Date[_0x5c96a9(0x98)]();if(cachedConfig&&_0x2ca9b8-cacheTime<CACHE_TTL)return cachedConfig;const _0x386db0=await fetchCdnConfig();return _0x386db0&&(cachedConfig=_0x386db0,cacheTime=_0x2ca9b8),_0x386db0;}export function clearCdnConfigCache(){cachedConfig=null,cacheTime=0x0;}function a123_0x3ff8(){const _0x5209ae=['27149724DsKrKo','node','1631710jRgROx','json','7826022GCIHHS','5722FcwmYv','5hoNBhe','1381144jabYLT','21grkZod','cli','3934743XkOnsq','now','4466424KBWFsS','stableVersion'];a123_0x3ff8=function(){return _0x5209ae;};return a123_0x3ff8();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a124_0x2b468d=a124_0x5d7c;(function(_0x13f9d9,_0x51938b){const _0x5bc95f=a124_0x5d7c,_0x331626=_0x13f9d9();while(!![]){try{const _0x2a47df=-parseInt(_0x5bc95f(0xb2))/0x1*(parseInt(_0x5bc95f(0xc7))/0x2)+parseInt(_0x5bc95f(0xc2))/0x3+parseInt(_0x5bc95f(0xae))/0x4+-parseInt(_0x5bc95f(0xb1))/0x5+parseInt(_0x5bc95f(0xb3))/0x6+parseInt(_0x5bc95f(0xbf))/0x7*(-parseInt(_0x5bc95f(0xb0))/0x8)+parseInt(_0x5bc95f(0xa9))/0x9*(parseInt(_0x5bc95f(0xa7))/0xa);if(_0x2a47df===_0x51938b)break;else _0x331626['push'](_0x331626['shift']());}catch(_0x2dc79a){_0x331626['push'](_0x331626['shift']());}}}(a124_0x3086,0xea9ce));import a124_0x29ce16 from'node:fs';import a124_0x4572fb from'node:path';import a124_0x32ced0 from'semver';import{getCdnConfig}from'./cdn-config.js';function a124_0x3086(){const _0x1248c5=['stableVersion','2653809uQcXGV','package.json','1.2.0','packageName','\x20\x20\x20Upgrade\x20command:\x20','3204858NvVkrr','@lovrabet/sdk','dependencies','utf8','\x20\x20\x20Stable\x20version:\x20','existsSync','version','\x1b[1m','log','14707430xFuVQv','minVersion','9gVCMMS','node','all','node_modules','utf-8','7488180kkkpHh','readFileSync','2711320budIFH','8829180gRRcrq','1kqOWhv','2644578mrTzfB','needsUpgrade','\x1b[33m','coerce','some','sdk','join','\x1b[0m','parse','latest','↪\x20SDK\x20update\x20available','test','7rvEyZH','npm\x20install\x20'];a124_0x3086=function(){return _0x1248c5;};return a124_0x3086();}const FALLBACK_MIN_SDK_VERSION=a124_0x2b468d(0xc4);function a124_0x5d7c(_0x5687bb,_0x479f4c){_0x5687bb=_0x5687bb-0xa2;const _0x308646=a124_0x3086();let _0x5d7c32=_0x308646[_0x5687bb];return _0x5d7c32;}function isNonNumericVersion(_0x4523f8){const _0x16feda=a124_0x2b468d,_0x519712=[/^latest$/i,/^beta$/i,/^alpha$/i,/^canary$/i,/^\*$/,/^x$/];return _0x519712[_0x16feda(0xb7)](_0x1bb5e1=>_0x1bb5e1[_0x16feda(0xbe)](_0x4523f8));}function getInstalledVersion(_0xeadd20,_0x29b7d9){const _0x5ad3e3=a124_0x2b468d;try{const _0x1defeb=a124_0x4572fb[_0x5ad3e3(0xb9)](_0xeadd20,_0x5ad3e3(0xac),_0x29b7d9,_0x5ad3e3(0xc3));if(a124_0x29ce16[_0x5ad3e3(0xa3)](_0x1defeb)){const _0x24ea4a=JSON[_0x5ad3e3(0xbb)](a124_0x29ce16[_0x5ad3e3(0xaf)](_0x1defeb,_0x5ad3e3(0xad)));return _0x24ea4a['version']||null;}}catch{}return null;}async function getSdkStableVersion(){const _0x5acc84=a124_0x2b468d;try{const _0x266e1a=await getCdnConfig();return _0x266e1a?.['sdk']?.[_0x5acc84(0xaa)]?.[_0x5acc84(0xc1)]||null;}catch{return null;}}async function getSdkPackageName(){const _0x305864=a124_0x2b468d;try{const _0x1e159c=await getCdnConfig();return _0x1e159c?.[_0x305864(0xb8)]?.[_0x305864(0xaa)]?.['packageName']||_0x305864(0xc8);}catch{return'@lovrabet/sdk';}}export async function checkSdkVersion(_0x15d2cf){const _0x83fe14=a124_0x2b468d,_0x101d72=a124_0x4572fb['join'](_0x15d2cf,_0x83fe14(0xc3)),[_0x271345,_0x548320]=await Promise[_0x83fe14(0xab)]([getSdkStableVersion(),getSdkPackageName()]),_0x5c4c47=_0x271345||FALLBACK_MIN_SDK_VERSION;if(!a124_0x29ce16[_0x83fe14(0xa3)](_0x101d72))return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':_0x5c4c47,'packageName':_0x548320,'stableVersion':_0x271345};try{const _0x5283ba=JSON[_0x83fe14(0xbb)](a124_0x29ce16[_0x83fe14(0xaf)](_0x101d72,'utf8')),_0x23649e=_0x5283ba[_0x83fe14(0xc9)]||{},_0x196d3c=_0x5283ba['devDependencies']||{},_0x5aee66=_0x23649e[_0x548320]||_0x196d3c[_0x548320];if(!_0x5aee66)return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':_0x5c4c47,'packageName':_0x548320,'stableVersion':_0x271345};let _0xefbef4=getInstalledVersion(_0x15d2cf,_0x548320);!_0xefbef4&&(_0xefbef4=_0x5aee66);if(isNonNumericVersion(_0x5aee66))return{'installed':!![],'version':_0xefbef4,'needsUpgrade':![],'minVersion':_0x5c4c47,'packageName':_0x548320,'stableVersion':_0x271345};const _0x19b3ab=a124_0x32ced0[_0x83fe14(0xb6)](_0xefbef4),_0x49a3e2=a124_0x32ced0[_0x83fe14(0xb6)](_0x5c4c47),_0x195146=_0x19b3ab&&_0x49a3e2?a124_0x32ced0['lt'](_0x19b3ab,_0x49a3e2):![];return{'installed':!![],'version':_0xefbef4,'needsUpgrade':_0x195146,'minVersion':_0x5c4c47,'packageName':_0x548320,'stableVersion':_0x271345};}catch{return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':_0x5c4c47,'packageName':_0x548320,'stableVersion':_0x271345};}}export function checkSdkVersionSync(_0x109c5b){const _0x220836=a124_0x2b468d,_0x3b218e=a124_0x4572fb['join'](_0x109c5b,_0x220836(0xc3)),_0x4642d5=_0x220836(0xc8);if(!a124_0x29ce16['existsSync'](_0x3b218e))return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':FALLBACK_MIN_SDK_VERSION,'packageName':_0x4642d5,'stableVersion':null};try{const _0x24d3bf=JSON[_0x220836(0xbb)](a124_0x29ce16[_0x220836(0xaf)](_0x3b218e,_0x220836(0xca))),_0x460d96=_0x24d3bf[_0x220836(0xc9)]||{},_0x360bda=_0x24d3bf['devDependencies']||{},_0x10d47a=_0x460d96[_0x4642d5]||_0x360bda[_0x4642d5];if(!_0x10d47a)return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':FALLBACK_MIN_SDK_VERSION,'packageName':_0x4642d5,'stableVersion':null};let _0x3edfcc=getInstalledVersion(_0x109c5b,_0x4642d5);!_0x3edfcc&&(_0x3edfcc=_0x10d47a);if(isNonNumericVersion(_0x10d47a))return{'installed':!![],'version':_0x3edfcc,'needsUpgrade':![],'minVersion':FALLBACK_MIN_SDK_VERSION,'packageName':_0x4642d5,'stableVersion':null};const _0x2ecd55=a124_0x32ced0[_0x220836(0xb6)](_0x3edfcc),_0x5c1c73=_0x2ecd55?a124_0x32ced0['lt'](_0x2ecd55,FALLBACK_MIN_SDK_VERSION):![];return{'installed':!![],'version':_0x3edfcc,'needsUpgrade':_0x5c1c73,'minVersion':FALLBACK_MIN_SDK_VERSION,'packageName':_0x4642d5,'stableVersion':null};}catch{return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':FALLBACK_MIN_SDK_VERSION,'packageName':_0x4642d5,'stableVersion':null};}}export function printSdkUpgradeWarning(_0x5e9a72){const _0x3211c5=a124_0x2b468d;if(!_0x5e9a72[_0x3211c5(0xb4)])return;const _0x13d776=_0x3211c5(0xb5),_0x977de1=_0x3211c5(0xba),_0x43820f=_0x3211c5(0xa5),_0x5b2097=_0x5e9a72[_0x3211c5(0xc5)]||_0x3211c5(0xc8),_0x3fd1fc=_0x5e9a72['stableVersion']||_0x5e9a72[_0x3211c5(0xa8)],_0x14fe04=_0x3211c5(0xc0)+_0x5b2097+'@'+(_0x3fd1fc||_0x3211c5(0xbc));console['log'](),console['log'](''+_0x13d776+_0x43820f+_0x3211c5(0xbd)+_0x977de1),console[_0x3211c5(0xa6)](_0x13d776+'\x20\x20\x20Current\x20version:\x20'+_0x5b2097+'@'+_0x5e9a72[_0x3211c5(0xa4)]+_0x977de1),console[_0x3211c5(0xa6)](_0x13d776+_0x3211c5(0xa2)+_0x3fd1fc+_0x977de1),console[_0x3211c5(0xa6)](_0x13d776+_0x3211c5(0xc6)+_0x14fe04+_0x977de1),console[_0x3211c5(0xa6)]();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4297b8,_0x31d3d4){const _0x332fad=a125_0x4074,_0x3d2a45=_0x4297b8();while(!![]){try{const _0x286635=-parseInt(_0x332fad(0xa4))/0x1+-parseInt(_0x332fad(0x8e))/0x2*(-parseInt(_0x332fad(0x91))/0x3)+-parseInt(_0x332fad(0x9b))/0x4+-parseInt(_0x332fad(0x8f))/0x5+-parseInt(_0x332fad(0x9c))/0x6*(parseInt(_0x332fad(0xa7))/0x7)+-parseInt(_0x332fad(0x96))/0x8+parseInt(_0x332fad(0x9f))/0x9;if(_0x286635===_0x31d3d4)break;else _0x3d2a45['push'](_0x3d2a45['shift']());}catch(_0x5c56ba){_0x3d2a45['push'](_0x3d2a45['shift']());}}}(a125_0xf207,0xd8387));import{readFileSync}from'node:fs';import{resolve,dirname}from'node:path';import{fileURLToPath}from'node:url';import a125_0x345b13 from'semver';function a125_0xf207(){const _0x55103a=['\x20\x20\x20Stable\x20version:\x20','npm\x20install\x20-g\x20','1427990LGvzdO','../..','\x1b[0m','999852kVJXfn','↪\x20New\x20version\x20available','1.0.0','7354LoTqFT','699965rxLwkR','needsUpgrade','957qcFaRC','log','utf-8','stableVersion','\x1b[33m','11639400CDcRfh','coerce','version','\x1b[1m','package.json','5387868WsRpCs','54OGFGEp','\x20\x20\x20Upgrade\x20command:\x20','some','48312675mTWAdD','parse','currentVersion'];a125_0xf207=function(){return _0x55103a;};return a125_0xf207();}function a125_0x4074(_0xa00155,_0x2b2077){_0xa00155=_0xa00155-0x8d;const _0xf2077f=a125_0xf207();let _0x407420=_0xf2077f[_0xa00155];return _0x407420;}import{getCdnConfig}from'./cdn-config.js';import{NPM_PACKAGE_NAME}from'../constant/cli.js';function getCurrentCliVersion(){const _0x3892eb=a125_0x4074;try{const _0x19df54=fileURLToPath(import.meta.url),_0x3420b2=resolve(dirname(_0x19df54),_0x3892eb(0xa5)),_0x1943ad=resolve(_0x3420b2,_0x3892eb(0x9a)),_0x4c7b39=JSON[_0x3892eb(0xa0)](readFileSync(_0x1943ad,_0x3892eb(0x93)));return _0x4c7b39[_0x3892eb(0x98)]||_0x3892eb(0x8d);}catch{return _0x3892eb(0x8d);}}function isNonNumericVersion(_0xab5611){const _0x855b42=a125_0x4074,_0x16cd66=[/^latest$/i,/^beta$/i,/^alpha$/i,/^canary$/i,/^\^/,/^~/,/^>/,/^</,/^\*/,/^x$/];return _0x16cd66[_0x855b42(0x9e)](_0x199198=>_0x199198['test'](_0xab5611));}export async function checkCliVersion(){const _0x13f4ec=a125_0x4074,_0x549689=getCurrentCliVersion(),_0x5d73f3=await getCdnConfig(),_0x75500e=_0x5d73f3?.['cli']?.[_0x13f4ec(0x94)]||null;let _0x449475=![];if(_0x75500e)try{const _0x5b5825=a125_0x345b13['coerce'](_0x549689),_0x5a5711=a125_0x345b13[_0x13f4ec(0x97)](_0x75500e);_0x5b5825&&_0x5a5711&&(_0x449475=a125_0x345b13['lt'](_0x5b5825,_0x5a5711));}catch{_0x449475=![];}return{'currentVersion':_0x549689,'stableVersion':_0x75500e,'needsUpgrade':_0x449475,'isPreRelease':![]};}export function printCliUpgradeWarning(_0x5e3fe1){const _0x4ac528=a125_0x4074;if(!_0x5e3fe1[_0x4ac528(0x90)])return;const _0x32a13c=_0x4ac528(0x95),_0x2401a1=_0x4ac528(0xa6),_0x25ecec=_0x4ac528(0x99),_0x365b2e=_0x4ac528(0xa3)+NPM_PACKAGE_NAME+'@latest';console['log'](),console['log'](''+_0x32a13c+_0x25ecec+_0x4ac528(0xa8)+_0x2401a1),console['log'](_0x32a13c+'\x20\x20\x20Current\x20CLI\x20version:\x20'+_0x5e3fe1[_0x4ac528(0xa1)]+_0x2401a1),console['log'](_0x32a13c+_0x4ac528(0xa2)+_0x5e3fe1[_0x4ac528(0x94)]+_0x2401a1),console[_0x4ac528(0x92)](_0x32a13c+_0x4ac528(0x9d)+_0x365b2e+_0x2401a1),console[_0x4ac528(0x92)]();}
|
package/lib/utils/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x29b207,_0xa17948){const _0x5f4061=a126_0x100d,_0x410c3b=_0x29b207();while(!![]){try{const _0x1d5fe7=-parseInt(_0x5f4061(0xfa))/0x1*(parseInt(_0x5f4061(0xf7))/0x2)+-parseInt(_0x5f4061(0xe5))/0x3+parseInt(_0x5f4061(0xee))/0x4*(parseInt(_0x5f4061(0xe6))/0x5)+-parseInt(_0x5f4061(0xf9))/0x6+-parseInt(_0x5f4061(0xe4))/0x7+parseInt(_0x5f4061(0xf0))/0x8+-parseInt(_0x5f4061(0xf2))/0x9*(-parseInt(_0x5f4061(0xf5))/0xa);if(_0x1d5fe7===_0xa17948)break;else _0x410c3b['push'](_0x410c3b['shift']());}catch(_0xeda62e){_0x410c3b['push'](_0x410c3b['shift']());}}}(a126_0x5f72,0xca5fe));import{initEnv}from'../constant/env.js';import{readRawConfig}from'../context.js';function a126_0x5f72(){const _0x412040=['app','50xmthyg','values','20qJQLFU','object','7710138ARLqGg','111347RYuEzs','length','apiDir','6133890PIIosy','3512517aQFdeh','12505TbMAok','template_base_url','filter','https://g.lovrabet.com/dist/lovrabet-skill','env','appcode','entries','apps','1604qBpMaM','string','9199016XcgmOI','map','5619150CDdhMi','trim'];a126_0x5f72=function(){return _0x412040;};return a126_0x5f72();}export{getProjectConfigPath,getGlobalConfigPath}from'../context.js';export{isInProject}from'../context.js';export function readConfig(_0x297642){const _0x20f8d1=a126_0x100d,_0xd8c1bf=readRawConfig(_0x297642);return _0xd8c1bf[_0x20f8d1(0xea)]&&typeof _0xd8c1bf['env']===_0x20f8d1(0xef)&&initEnv(_0xd8c1bf[_0x20f8d1(0xea)]),_0xd8c1bf;}export function getConfigAppCode(){const _0x50262a=a126_0x100d,_0x88e7b3=readRawConfig();if(_0x88e7b3[_0x50262a(0xed)]&&typeof _0x88e7b3[_0x50262a(0xed)]===_0x50262a(0xf8)){const _0x1ce241=_0x88e7b3['defaultApp'];if(_0x1ce241&&_0x88e7b3['apps'][_0x1ce241]?.[_0x50262a(0xeb)])return String(_0x88e7b3[_0x50262a(0xed)][_0x1ce241][_0x50262a(0xeb)])['trim']();const _0x5ba719=Object[_0x50262a(0xf6)](_0x88e7b3[_0x50262a(0xed)])[0x0];if(_0x5ba719?.['appcode'])return String(_0x5ba719['appcode'])['trim']();}const _0x4c0bdf=_0x88e7b3[_0x50262a(0xeb)]||_0x88e7b3[_0x50262a(0xf4)];if(typeof _0x4c0bdf!=='string'||_0x4c0bdf[_0x50262a(0xf3)]()==='')return undefined;return _0x4c0bdf['trim']();}export function getMultiAppConfigs(){const _0x35abf4=a126_0x100d,_0x94b300=readRawConfig(),_0x5d798a=_0x94b300['apps'];if(!_0x5d798a||typeof _0x5d798a!==_0x35abf4(0xf8)||Object['keys'](_0x5d798a)[_0x35abf4(0xe2)]===0x0)return null;const _0x46c2d6=_0x94b300['defaultApp'];return Object[_0x35abf4(0xec)](_0x5d798a)[_0x35abf4(0xf1)](([_0x39af97,_0xe31e13])=>({'name':_0x39af97,'appcode':_0xe31e13?.[_0x35abf4(0xeb)]||'','isDefault':_0x39af97===_0x46c2d6,'env':_0xe31e13?.[_0x35abf4(0xea)],'apiDir':_0xe31e13?.[_0x35abf4(0xe3)],'cookie':_0xe31e13?.['cookie']||undefined}))[_0x35abf4(0xe8)](_0x5042f2=>_0x5042f2[_0x35abf4(0xeb)]);}function a126_0x100d(_0x518803,_0x5bde86){_0x518803=_0x518803-0xe2;const _0x5f72a3=a126_0x5f72();let _0x100db0=_0x5f72a3[_0x518803];return _0x100db0;}export function getTemplateBaseUrl(){const _0x21ff96=a126_0x100d,_0x4207b0=readRawConfig();if(_0x4207b0[_0x21ff96(0xe7)]&&typeof _0x4207b0[_0x21ff96(0xe7)]===_0x21ff96(0xef))return _0x4207b0[_0x21ff96(0xe7)]['replace'](/\/$/,'');return _0x21ff96(0xe9);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a127_0x4f13(){const _0x3d2d3a=['name','170MbaRBg','1579430ADVUFC','488QpRwlB','2679084fEVlfN','error','复制目录时出错:','60963iABdSC','3537855yJpzBy','78TGBoli','isDirectory','readdirSync','749001rPKFnZ','380945FrwHIq','copyFileSync','34924PjcyNY','2HSlChP'];a127_0x4f13=function(){return _0x3d2d3a;};return a127_0x4f13();}(function(_0x1dc965,_0x39cf61){const _0x303731=a127_0x3af8,_0x29341c=_0x1dc965();while(!![]){try{const _0x5cf1a0=-parseInt(_0x303731(0x15f))/0x1*(parseInt(_0x303731(0x162))/0x2)+-parseInt(_0x303731(0x15b))/0x3*(parseInt(_0x303731(0x161))/0x4)+parseInt(_0x303731(0x165))/0x5+-parseInt(_0x303731(0x167))/0x6+-parseInt(_0x303731(0x16a))/0x7*(parseInt(_0x303731(0x166))/0x8)+parseInt(_0x303731(0x15a))/0x9+-parseInt(_0x303731(0x164))/0xa*(-parseInt(_0x303731(0x15e))/0xb);if(_0x5cf1a0===_0x39cf61)break;else _0x29341c['push'](_0x29341c['shift']());}catch(_0x66c7c4){_0x29341c['push'](_0x29341c['shift']());}}}(a127_0x4f13,0x448ee));import a127_0x15a597 from'node:path';function a127_0x3af8(_0x2234bc,_0x3bd339){_0x2234bc=_0x2234bc-0x15a;const _0x4f138e=a127_0x4f13();let _0x3af83e=_0x4f138e[_0x2234bc];return _0x3af83e;}import a127_0x490365 from'node:fs';export async function copyDirectory(_0x2a4afc,_0x233f50){const _0x7ab70e=a127_0x3af8;try{const _0x38edd2=a127_0x490365[_0x7ab70e(0x15d)](_0x2a4afc,{'withFileTypes':!![]});a127_0x490365['mkdirSync'](_0x233f50,{'recursive':!![]});for(const _0x36f7cc of _0x38edd2){const _0x26efad=a127_0x15a597['join'](_0x2a4afc,_0x36f7cc['name']),_0x5bf610=a127_0x15a597['join'](_0x233f50,_0x36f7cc[_0x7ab70e(0x163)]);_0x36f7cc[_0x7ab70e(0x15c)]()?await copyDirectory(_0x26efad,_0x5bf610):a127_0x490365[_0x7ab70e(0x160)](_0x26efad,_0x5bf610);}}catch(_0x254123){console[_0x7ab70e(0x168)](_0x7ab70e(0x169),_0x254123);}}
|
package/lib/utils/file-utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x23c626,_0x3722f5){const _0x1b506b=a128_0x55d3,_0x4b5be1=_0x23c626();while(!![]){try{const _0x5b7d41=parseInt(_0x1b506b(0xcf))/0x1*(parseInt(_0x1b506b(0xcd))/0x2)+parseInt(_0x1b506b(0xc9))/0x3*(-parseInt(_0x1b506b(0xcb))/0x4)+parseInt(_0x1b506b(0xd2))/0x5+-parseInt(_0x1b506b(0xd4))/0x6*(parseInt(_0x1b506b(0xca))/0x7)+-parseInt(_0x1b506b(0xce))/0x8*(parseInt(_0x1b506b(0xd1))/0x9)+parseInt(_0x1b506b(0xd0))/0xa*(-parseInt(_0x1b506b(0xcc))/0xb)+-parseInt(_0x1b506b(0xd3))/0xc*(-parseInt(_0x1b506b(0xd5))/0xd);if(_0x5b7d41===_0x3722f5)break;else _0x4b5be1['push'](_0x4b5be1['shift']());}catch(_0x5baf52){_0x4b5be1['push'](_0x4b5be1['shift']());}}}(a128_0x2cc9,0xe6357));import{existsSync,mkdirSync,copyFileSync,readdirSync,statSync}from'node:fs';import{join}from'node:path';export async function copyDir(_0x3449b5,_0x85952b){const _0x1029db=a128_0x55d3,_0x3f7349=statSync(_0x3449b5);if(_0x3f7349[_0x1029db(0xc8)]()){!existsSync(_0x85952b)&&mkdirSync(_0x85952b,{'recursive':!![]});const _0x111fcb=readdirSync(_0x3449b5);for(const _0xcb6b99 of _0x111fcb){await copyDir(join(_0x3449b5,_0xcb6b99),join(_0x85952b,_0xcb6b99));}}else copyFileSync(_0x3449b5,_0x85952b);}function a128_0x2cc9(){const _0x545256=['3GnKWHy','343LPPSbM','5746980JeuJXY','858TagYhl','10iXhjzs','227960YHcPZJ','265513cZAfLv','69700Uvijip','477pxYqGO','5452165cMJtdp','12KwnTbu','46164eCGiNq','31103579MYTiBe','isDirectory'];a128_0x2cc9=function(){return _0x545256;};return a128_0x2cc9();}export function ensureDir(_0x5cffe4){!existsSync(_0x5cffe4)&&mkdirSync(_0x5cffe4,{'recursive':!![]});}function a128_0x55d3(_0xec0b5f,_0x37fcb2){_0xec0b5f=_0xec0b5f-0xc8;const _0x2cc999=a128_0x2cc9();let _0x55d3c2=_0x2cc999[_0xec0b5f];return _0x55d3c2;}export function pathExists(_0x18668a){return existsSync(_0x18668a);}
|
package/lib/utils/guides-cdn.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a129_0x59d705=a129_0x2946;(function(_0x22ecb6,_0x25dfd0){const _0x769d0e=a129_0x2946,_0x254fb0=_0x22ecb6();while(!![]){try{const _0x8a736=-parseInt(_0x769d0e(0x163))/0x1*(-parseInt(_0x769d0e(0x173))/0x2)+-parseInt(_0x769d0e(0x16a))/0x3*(parseInt(_0x769d0e(0x151))/0x4)+-parseInt(_0x769d0e(0x171))/0x5+parseInt(_0x769d0e(0x156))/0x6+parseInt(_0x769d0e(0x15f))/0x7+parseInt(_0x769d0e(0x160))/0x8+parseInt(_0x769d0e(0x165))/0x9;if(_0x8a736===_0x25dfd0)break;else _0x254fb0['push'](_0x254fb0['shift']());}catch(_0x10c77d){_0x254fb0['push'](_0x254fb0['shift']());}}}(a129_0x1790,0xecbad));import{mkdirSync,writeFileSync}from'node:fs';import{dirname,join}from'node:path';import{getTemplateBaseUrl}from'./config.js';function getGuidesCdnUrl(){const _0xf91b49=a129_0x2946,_0x3f1f98=getTemplateBaseUrl();return _0x3f1f98+_0xf91b49(0x15c);}const CACHE_DIR=join(process[a129_0x59d705(0x16c)][a129_0x59d705(0x154)]||process[a129_0x59d705(0x16c)][a129_0x59d705(0x16e)]||'',a129_0x59d705(0x169),'cache');export async function fetchGuidesFromCDN(){const _0x2297cc=a129_0x59d705,_0x2ac692=getGuidesCdnUrl(),_0xac1d2c=await fetch(_0x2ac692,{'headers':{'Accept':_0x2297cc(0x164)}});if(!_0xac1d2c['ok'])throw new Error('CDN\x20请求失败:\x20'+_0xac1d2c[_0x2297cc(0x15d)]+'\x20'+_0xac1d2c[_0x2297cc(0x170)]);const _0x2b0fea=await _0xac1d2c[_0x2297cc(0x162)]();if(!_0x2b0fea['guides']||typeof _0x2b0fea[_0x2297cc(0x158)]!=='object')throw new Error('CDN\x20返回数据格式错误');return _0x2b0fea;}export function writeGuidesToProject(_0x4134b5,_0x5e730b,_0x586487=a129_0x59d705(0x14f),_0x4d6b01){const _0x475c36=a129_0x59d705,_0x1fa2b8=join(_0x5e730b,_0x586487);mkdirSync(_0x1fa2b8,{'recursive':!![]});for(const [_0x3efdb6,_0x2e7a3e]of Object[_0x475c36(0x153)](_0x4134b5[_0x475c36(0x158)])){let _0x6bc81a=_0x2e7a3e[_0x475c36(0x159)];_0x2e7a3e[_0x475c36(0x150)]&&(_0x6bc81a=appendUpdateTime(_0x6bc81a,_0x2e7a3e['lastUpdated'])),writeFileSync(join(_0x1fa2b8,_0x3efdb6+_0x475c36(0x15a)),_0x6bc81a,'utf-8');}}function a129_0x2946(_0x566847,_0x2f7680){_0x566847=_0x566847-0x14f;const _0x1790d0=a129_0x1790();let _0x294615=_0x1790d0[_0x566847];return _0x294615;}export function appendUpdateTime(_0x34226e,_0x2294f0){const _0x4dce9c=a129_0x59d705;return _0x34226e=_0x34226e['replace'](/\n*>更新时间:.*$/m,''),_0x34226e[_0x4dce9c(0x155)]()+(_0x4dce9c(0x161)+_0x2294f0);}export function getSkillTemplate(_0x4721c4){const _0x1535e7=a129_0x59d705;return _0x4721c4[_0x1535e7(0x157)]?.[_0x1535e7(0x159)]||'';}export function appendExtendContents(_0x460d67,_0x3cd4f0,_0x89d80d){const _0x3f1ba5=a129_0x59d705,_0x5688e3=[];for(const [,_0x20e913]of Object['entries'](_0x3cd4f0[_0x3f1ba5(0x158)])){_0x20e913['extendContent']&&_0x5688e3['push'](_0x20e913[_0x3f1ba5(0x16d)]['trimEnd']());}if(_0x5688e3[_0x3f1ba5(0x16f)]===0x0)return _0x460d67;return _0x460d67[_0x3f1ba5(0x155)]()+'\x0a\x0a'+_0x5688e3[_0x3f1ba5(0x15b)]('\x0a\x0a')+'\x0a';}export function writeSkillFile(_0x3d07f1,_0x1bf837,_0x1c2743){const _0x8dc232=a129_0x59d705,_0x4d4adf=getSkillTemplate(_0x3d07f1);if(!_0x4d4adf)throw new Error(_0x8dc232(0x16b));const _0xbb13de=dirname(_0x1bf837);mkdirSync(_0xbb13de,{'recursive':!![]});let _0x421549=_0x4d4adf[_0x8dc232(0x15e)](/\{\{IDE_NAME\}\}/g,_0x1c2743);_0x421549=appendExtendContents(_0x421549,_0x3d07f1),_0x3d07f1['skillTemplate'][_0x8dc232(0x150)]&&(_0x421549=appendUpdateTime(_0x421549,_0x3d07f1[_0x8dc232(0x157)][_0x8dc232(0x150)])),writeFileSync(_0x1bf837,_0x421549,_0x8dc232(0x152));}export async function installGuides(_0x2c1a20){const _0x42d016=a129_0x59d705,_0x1faa63=await fetchGuidesFromCDN();return writeGuidesToProject(_0x1faa63,_0x2c1a20),Object[_0x42d016(0x168)](_0x1faa63['guides'])[_0x42d016(0x16f)];}export function getGuidesSummary(_0x95515d){const _0x3c07e6=a129_0x59d705;return Object[_0x3c07e6(0x153)](_0x95515d[_0x3c07e6(0x158)])[_0x3c07e6(0x166)](([_0x3153a2,_0x5dd88b])=>({'key':_0x3153a2,'title':_0x5dd88b[_0x3c07e6(0x172)],'path':_0x5dd88b[_0x3c07e6(0x167)]}));}function a129_0x1790(){const _0x590113=['skillTemplate','guides','content','.md','join','/skills/guides.json','status','replace','974785YNYPHL','3999000hDvXZz','\x0a\x0a>更新时间:','json','1ZSmXjB','application/json','15599313TtKGKy','map','path','keys','.lovrabet','18XEfXck','CDN\x20数据中缺少\x20skillTemplate','env','extendContent','USERPROFILE','length','statusText','6989030iBJXHf','title','1366658fyDQgK','.lovrabet/skill/guides','lastUpdated','554668vRgYCS','utf-8','entries','HOME','trimEnd','862422XKWUqp'];a129_0x1790=function(){return _0x590113;};return a129_0x1790();}
|
package/lib/utils/http-client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a130_0x3c49(_0x391439,_0x48dfca){_0x391439=_0x391439-0x13a;const _0x513f1f=a130_0x513f();let _0x3c4978=_0x513f1f[_0x391439];return _0x3c4978;}(function(_0x46cedd,_0x486d07){const _0x3a223f=a130_0x3c49,_0x83ba77=_0x46cedd();while(!![]){try{const _0x363ccf=-parseInt(_0x3a223f(0x14d))/0x1+-parseInt(_0x3a223f(0x154))/0x2*(-parseInt(_0x3a223f(0x14e))/0x3)+-parseInt(_0x3a223f(0x150))/0x4*(-parseInt(_0x3a223f(0x13b))/0x5)+parseInt(_0x3a223f(0x13f))/0x6*(parseInt(_0x3a223f(0x144))/0x7)+parseInt(_0x3a223f(0x152))/0x8*(parseInt(_0x3a223f(0x13e))/0x9)+-parseInt(_0x3a223f(0x153))/0xa+parseInt(_0x3a223f(0x14b))/0xb;if(_0x363ccf===_0x486d07)break;else _0x83ba77['push'](_0x83ba77['shift']());}catch(_0x575d12){_0x83ba77['push'](_0x83ba77['shift']());}}}(a130_0x513f,0x97414));export async function httpRequest(_0x41415f,_0x441db5={}){const _0x3da6fa=a130_0x3c49,{timeout:timeout=0x7530,retries:retries=0x3,retryDelay:retryDelay=0x3e8,headers:headers={}}=_0x441db5;let _0x1401c8=null;for(let _0x2922b6=0x0;_0x2922b6<=retries;_0x2922b6++){try{const _0x2859e4=new AbortController(),_0x24f507=setTimeout(()=>_0x2859e4[_0x3da6fa(0x157)](),timeout),_0xb7438f=await fetch(_0x41415f,{'headers':headers,'signal':_0x2859e4[_0x3da6fa(0x13a)]});clearTimeout(_0x24f507);let _0x3a33f9;const _0x3ee99d=_0xb7438f[_0x3da6fa(0x145)][_0x3da6fa(0x14c)](_0x3da6fa(0x151));return _0x3ee99d?.[_0x3da6fa(0x146)](_0x3da6fa(0x147))?_0x3a33f9=await _0xb7438f['json']():_0x3a33f9=await _0xb7438f['text'](),{'ok':_0xb7438f['ok'],'status':_0xb7438f['status'],'statusText':_0xb7438f[_0x3da6fa(0x13d)],'data':_0x3a33f9,'headers':_0xb7438f[_0x3da6fa(0x145)],'url':_0xb7438f[_0x3da6fa(0x155)],'text':()=>_0xb7438f['text']()};}catch(_0x2a3596){_0x1401c8=_0x2a3596 instanceof Error?_0x2a3596:new Error(String(_0x2a3596));if(_0x2922b6===retries)break;if(shouldRetry(_0x2a3596)){console[_0x3da6fa(0x141)]('*\x20请求失败,'+retryDelay+_0x3da6fa(0x156)+(_0x2922b6+0x1)+_0x3da6fa(0x148)),await sleep(retryDelay);continue;}else break;}}throw _0x1401c8||new Error('Request\x20failed');}function shouldRetry(_0x11bad9){const _0x2c2479=a130_0x3c49;if(_0x11bad9 instanceof Error){if(_0x11bad9[_0x2c2479(0x143)]===_0x2c2479(0x13c))return![];if(_0x11bad9[_0x2c2479(0x143)]===_0x2c2479(0x149)&&_0x11bad9[_0x2c2479(0x142)]['includes'](_0x2c2479(0x140)))return!![];if(_0x11bad9[_0x2c2479(0x142)][_0x2c2479(0x146)](_0x2c2479(0x14f)))return!![];if(_0x11bad9[_0x2c2479(0x142)][_0x2c2479(0x146)](_0x2c2479(0x14a)))return![];}return![];}function sleep(_0x2855b3){return new Promise(_0x2120c0=>setTimeout(_0x2120c0,_0x2855b3));}export function validateUrl(_0x583209){try{return new URL(_0x583209),!![];}catch{return![];}}function a130_0x513f(){const _0x3e1f2f=['9287880mrVjsE','2wOdNOq','url','ms\x20后进行第\x20','abort','signal','4252890yKzoPZ','AbortError','statusText','9niriVG','110622MaDYya','fetch','log','message','name','259bcnPof','headers','includes','application/json','\x20次重试...','TypeError','ENOTFOUND','738870yPfGvp','get','612587QxIlTW','1406661ecgFXY','ECONNRESET','4ZPRelU','content-type','736888yJItWF'];a130_0x513f=function(){return _0x3e1f2f;};return a130_0x513f();}
|
package/lib/utils/logger.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a131_0x5420fa=a131_0x1db8;(function(_0x243456,_0x3ceecf){const _0x211977=a131_0x1db8,_0x34b669=_0x243456();while(!![]){try{const _0x50e792=parseInt(_0x211977(0x170))/0x1+parseInt(_0x211977(0x185))/0x2+parseInt(_0x211977(0x179))/0x3+-parseInt(_0x211977(0x187))/0x4*(parseInt(_0x211977(0x16d))/0x5)+-parseInt(_0x211977(0x16f))/0x6+-parseInt(_0x211977(0x161))/0x7*(parseInt(_0x211977(0x177))/0x8)+parseInt(_0x211977(0x190))/0x9;if(_0x50e792===_0x3ceecf)break;else _0x34b669['push'](_0x34b669['shift']());}catch(_0x1707ea){_0x34b669['push'](_0x34b669['shift']());}}}(a131_0x4ea2,0xea91a));function a131_0x4ea2(){const _0x51a157=['yellow','blue','开始执行:\x20','1057036UAtlqy','readLogs','24EoxROT','clearLogs','getWinstonInstance','setRawCommand','filter','winstonLogger','readFileSync','log','parse','8716968AkjAum','info','utf8','error','success','green','existsSync','5026ZlRGPn','join','logTask','timestamp','createLogger','clear','duration','toISOString','split','details','stringify','red','441050cDiBby','printf','1653354CXbNaH','492974hZHoSV','logFilePath','完成:\x20','.lovrabet.log','errors','format','warn','11080TAXqBB','level','2309997pDQwKE','File','mkdirSync','setLogPath','currentRawCommand','now','dirname','unknown','失败:\x20'];a131_0x4ea2=function(){return _0x51a157;};return a131_0x4ea2();}import a131_0x19001b from'winston';import a131_0x19658a from'node:fs';import a131_0x40c0e1 from'node:path';function a131_0x1db8(_0x6234f2,_0x429fe9){_0x6234f2=_0x6234f2-0x160;const _0x4ea23f=a131_0x4ea2();let _0x1db8b0=_0x4ea23f[_0x6234f2];return _0x1db8b0;}class Logger{['winstonLogger'];[a131_0x5420fa(0x171)];[a131_0x5420fa(0x17d)]='';constructor(){const _0x53149c=a131_0x5420fa;this[_0x53149c(0x171)]='';}[a131_0x5420fa(0x18a)](_0x592789){const _0x2d6fe1=a131_0x5420fa;this[_0x2d6fe1(0x17d)]=_0x592789;}['initWinstonLogger'](){const _0x1cbc09=a131_0x5420fa,_0x77127=a131_0x40c0e1[_0x1cbc09(0x17f)](this[_0x1cbc09(0x171)]);!a131_0x19658a[_0x1cbc09(0x160)](_0x77127)&&a131_0x19658a[_0x1cbc09(0x17b)](_0x77127,{'recursive':!![]});const _0x5c1327=a131_0x19001b[_0x1cbc09(0x175)]['combine'](a131_0x19001b[_0x1cbc09(0x175)][_0x1cbc09(0x164)](),a131_0x19001b[_0x1cbc09(0x175)][_0x1cbc09(0x174)]({'stack':!![]}),a131_0x19001b[_0x1cbc09(0x175)][_0x1cbc09(0x16e)](_0x7fa8f6=>{const _0x45f959=_0x1cbc09,_0x2dfc08={'timestamp':_0x7fa8f6[_0x45f959(0x164)]||new Date()[_0x45f959(0x168)](),'level':_0x7fa8f6[_0x45f959(0x178)]||_0x45f959(0x191),'command':_0x7fa8f6['command']||_0x45f959(0x180),'rawCommand':_0x7fa8f6['rawCommand']||this[_0x45f959(0x17d)]||undefined,'message':_0x7fa8f6['message']||'','duration':_0x7fa8f6[_0x45f959(0x167)]||undefined,'details':_0x7fa8f6[_0x45f959(0x16a)]||undefined};return JSON[_0x45f959(0x16b)](_0x2dfc08);}));this[_0x1cbc09(0x18c)]=a131_0x19001b[_0x1cbc09(0x165)]({'level':_0x1cbc09(0x191),'format':_0x5c1327,'transports':[new a131_0x19001b['transports'][(_0x1cbc09(0x17a))]({'filename':this[_0x1cbc09(0x171)],'level':_0x1cbc09(0x191)})],'silent':![]}),a131_0x19001b['addColors']({'success':_0x1cbc09(0x195),'error':_0x1cbc09(0x16c),'warn':_0x1cbc09(0x182),'info':_0x1cbc09(0x183)});}[a131_0x5420fa(0x17c)](_0x4ffcb2){const _0x2bc803=a131_0x5420fa;this['logFilePath']=a131_0x40c0e1[_0x2bc803(0x162)](_0x4ffcb2,_0x2bc803(0x173)),this[_0x2bc803(0x18c)]&&this[_0x2bc803(0x18c)][_0x2bc803(0x166)](),this['initWinstonLogger']();}['info'](_0x38aaa8,_0x4a12f4,_0x154105){const _0x37f871=a131_0x5420fa;if(!this[_0x37f871(0x171)]||!this[_0x37f871(0x18c)])return;this[_0x37f871(0x18c)][_0x37f871(0x191)](_0x4a12f4,{'command':_0x38aaa8,'details':_0x154105});}['success'](_0x7bb77f,_0x3a1294,_0x8af136,_0x29114b){const _0x4bc724=a131_0x5420fa;if(!this[_0x4bc724(0x171)]||!this[_0x4bc724(0x18c)])return;this['winstonLogger'][_0x4bc724(0x18e)](_0x4bc724(0x191),_0x3a1294,{'level':'success','command':_0x7bb77f,'duration':_0x8af136,'details':_0x29114b});}[a131_0x5420fa(0x193)](_0x4f899f,_0x5f1a30,_0x441fbb){const _0x2f431a=a131_0x5420fa;if(!this[_0x2f431a(0x171)]||!this[_0x2f431a(0x18c)])return;this[_0x2f431a(0x18c)][_0x2f431a(0x193)](_0x5f1a30,{'command':_0x4f899f,'details':_0x441fbb});}['warn'](_0x500a3b,_0x3debd9,_0x307cb2){const _0x1e7ef8=a131_0x5420fa;if(!this[_0x1e7ef8(0x171)]||!this['winstonLogger'])return;this[_0x1e7ef8(0x18c)][_0x1e7ef8(0x176)](_0x3debd9,{'command':_0x500a3b,'details':_0x307cb2});}async[a131_0x5420fa(0x163)](_0x738c95,_0x576c25,_0x1f25e4){const _0x1f3345=a131_0x5420fa,_0x25da88=Date[_0x1f3345(0x17e)]();this[_0x1f3345(0x191)](_0x738c95,_0x1f3345(0x184)+_0x576c25);try{const _0x227b46=await _0x1f25e4(),_0x29ffbe=Date[_0x1f3345(0x17e)]()-_0x25da88;return this[_0x1f3345(0x194)](_0x738c95,_0x1f3345(0x172)+_0x576c25,_0x29ffbe),_0x227b46;}catch(_0x1aa97f){const _0xd01817=Date['now']()-_0x25da88;this[_0x1f3345(0x193)](_0x738c95,_0x1f3345(0x181)+_0x576c25,{'error':_0x1aa97f instanceof Error?_0x1aa97f['message']:String(_0x1aa97f),'duration':_0xd01817});throw _0x1aa97f;}}[a131_0x5420fa(0x186)](){const _0x21ffbd=a131_0x5420fa;try{if(!a131_0x19658a[_0x21ffbd(0x160)](this[_0x21ffbd(0x171)]))return[];const _0xe7d9d2=a131_0x19658a[_0x21ffbd(0x18d)](this[_0x21ffbd(0x171)],'utf8');return _0xe7d9d2[_0x21ffbd(0x169)]('\x0a')[_0x21ffbd(0x18b)](_0xd5cffc=>_0xd5cffc['trim']())['map'](_0x3685c6=>JSON[_0x21ffbd(0x18f)](_0x3685c6));}catch(_0x3af377){return console[_0x21ffbd(0x176)]('Failed\x20to\x20read\x20logs:',_0x3af377),[];}}[a131_0x5420fa(0x188)](){const _0x3faf16=a131_0x5420fa;try{a131_0x19658a['existsSync'](this['logFilePath'])&&a131_0x19658a['writeFileSync'](this[_0x3faf16(0x171)],'',_0x3faf16(0x192));}catch(_0x14acb2){console['warn']('Failed\x20to\x20clear\x20logs:',_0x14acb2);}}[a131_0x5420fa(0x189)](){const _0x4bed1f=a131_0x5420fa;return this[_0x4bed1f(0x18c)];}}export const logger=new Logger();
|