@lovrabet/rabetbase-cli 2.0.4-beta.5 → 2.0.6
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/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 -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/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/api/shared.js +1 -1
- package/lib/commands/app/add.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/remote.js +1 -1
- package/lib/commands/app/remove.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app/use.js +1 -1
- package/lib/commands/auth/index.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/app-selector.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.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/index.js +1 -1
- package/lib/commands/logs/index.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/index.js +1 -1
- package/lib/commands/project-upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/skill/index.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/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/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/framework/types.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/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.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/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/platform.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/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x55273b,_0x2b5763){const _0x28b311=a116_0x5e55,_0x3ef80d=_0x55273b();while(!![]){try{const _0x23d2f9=-parseInt(_0x28b311(0x123))/0x1*(parseInt(_0x28b311(0x11f))/0x2)+parseInt(_0x28b311(0x120))/0x3*(-parseInt(_0x28b311(0x128))/0x4)+parseInt(_0x28b311(0x126))/0x5+-parseInt(_0x28b311(0x129))/0x6+-parseInt(_0x28b311(0x127))/0x7*(parseInt(_0x28b311(0x11d))/0x8)+-parseInt(_0x28b311(0x12b))/0x9*(-parseInt(_0x28b311(0x121))/0xa)+parseInt(_0x28b311(0x122))/0xb;if(_0x23d2f9===_0x2b5763)break;else _0x3ef80d['push'](_0x3ef80d['shift']());}catch(_0x4b2b53){_0x3ef80d['push'](_0x3ef80d['shift']());}}}(a116_0x51e2,0x88aa1));import a116_0x31f396 from'node:os';import{VERSION,GIT_COMMIT}from'../generated/build-info.js';import{getSessionUserInfo}from'../auth/get-session-user.js';import{setTraceConfig,getOtelLoggerVersion}from'@lovrabet/otel-logger';import{NPM_PACKAGE_NAME}from'../constant/cli.js';function a116_0x5e55(_0x12624b,_0x37d60f){_0x12624b=_0x12624b-0x11c;const _0x51e23f=a116_0x51e2();let _0x5e55b6=_0x51e23f[_0x12624b];return _0x5e55b6;}let cliOtelTraceInitialized=![];function a116_0x51e2(){const _0x459ef4=['190iJrgUC','19980543rnAWko','549817BAuzVm','userInfo','production','4410585YjEtqT','3563wsgEFj','1044NqTOcr','5048154lluirk','rabetbase-cli','501129NFFFHZ','nickname','username','14024YdpQsK','daily','2EOSoTk','10497RGUrxq'];a116_0x51e2=function(){return _0x459ef4;};return a116_0x51e2();}export async function ensureCliOtelTraceConfig(){const _0x57cdf8=a116_0x5e55,_0x1c9f7e=await getSessionUserInfo();if(!cliOtelTraceInitialized){const _0x1f5208=_0x1c9f7e?.['user'];setTraceConfig({'otelLoggerVersion':getOtelLoggerVersion(),'serviceName':NPM_PACKAGE_NAME,'serviceVersion':GIT_COMMIT!=='unknown'?VERSION+'+'+GIT_COMMIT:VERSION,'serviceEnv':process.env.RABETBASE_ENV??(process.env.RABETBASE_E2E_DAILY==='1'?_0x57cdf8(0x11e):_0x57cdf8(0x125)),'username':_0x1f5208?.[_0x57cdf8(0x11c)]??a116_0x31f396[_0x57cdf8(0x124)]()[_0x57cdf8(0x11c)]??_0x57cdf8(0x12a),..._0x1f5208&&{'nickname':_0x1f5208[_0x57cdf8(0x12c)]}}),cliOtelTraceInitialized=!![];}return _0x1c9f7e;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x54806c,_0x32ea95){const _0x166b58=a117_0x478d,_0x2aa570=_0x54806c();while(!![]){try{const _0x5f13ba=-parseInt(_0x166b58(0xc2))/0x1*(-parseInt(_0x166b58(0xcb))/0x2)+parseInt(_0x166b58(0xc9))/0x3+parseInt(_0x166b58(0xbe))/0x4+-parseInt(_0x166b58(0xc3))/0x5+parseInt(_0x166b58(0xbd))/0x6*(-parseInt(_0x166b58(0xc1))/0x7)+parseInt(_0x166b58(0xc4))/0x8*(parseInt(_0x166b58(0xc8))/0x9)+-parseInt(_0x166b58(0xc0))/0xa*(parseInt(_0x166b58(0xc5))/0xb);if(_0x5f13ba===_0x32ea95)break;else _0x2aa570['push'](_0x2aa570['shift']());}catch(_0x52a6da){_0x2aa570['push'](_0x2aa570['shift']());}}}(a117_0x3f11,0x8bf23));import{shutdownTraces}from'@lovrabet/otel-logger';let shutdownPromise=null;export async function flushOtelNodeIfUsed(){if(shutdownPromise)return shutdownPromise;return shutdownPromise=((async()=>{try{await shutdownTraces();}catch{}})()),shutdownPromise;}export function registerOtelShutdownOnExit(){const _0x25b23d=a117_0x478d;process[_0x25b23d(0xc7)](_0x25b23d(0xbf),()=>{void flushOtelNodeIfUsed();});const _0x118d4b=()=>{const _0x3bef06=_0x25b23d;void flushOtelNodeIfUsed()['then'](()=>process[_0x3bef06(0xcc)](0x0));};process['once'](_0x25b23d(0xc6),_0x118d4b),process[_0x25b23d(0xc7)](_0x25b23d(0xca),_0x118d4b);}function a117_0x3f11(){const _0x4f10ac=['47179VWVmVe','SIGINT','once','351EZOOYV','3131895oFFOor','SIGTERM','238166fWcqmU','exit','6xtkwVU','2511228HRIVtp','beforeExit','3040VVgIUy','1233302LERjDb','1XoyaZX','258500IwInKg','64432aIzaKf'];a117_0x3f11=function(){return _0x4f10ac;};return a117_0x3f11();}function a117_0x478d(_0x50b201,_0x4c67c9){_0x50b201=_0x50b201-0xbd;const _0x3f11ae=a117_0x3f11();let _0x478df6=_0x3f11ae[_0x50b201];return _0x478df6;}export async function exitWithOtelShutdown(_0x41017c){const _0x100811=a117_0x478d;await flushOtelNodeIfUsed(),process[_0x100811(0xcc)](_0x41017c);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a118_0x454694=a118_0x5b4e;function a118_0x2709(){const _0x4f9e3a=['rabetbase-cli','5324rLgGKd','2778243McwGTH','traceparent','spanName','240JORbRq','version','21430260XWisRX','638980sEZlsf','logData','42unYUui','1vjDIBX','151911qjOdeJ','3287268RYcAQy','215262kybNaE','manual','2780yFsVZr','5Ewdbby'];a118_0x2709=function(){return _0x4f9e3a;};return a118_0x2709();}(function(_0x3ab648,_0x374eb2){const _0xa70b4a=a118_0x5b4e,_0x446bb5=_0x3ab648();while(!![]){try{const _0x1c92de=parseInt(_0xa70b4a(0x17f))/0x1*(parseInt(_0xa70b4a(0x17c))/0x2)+-parseInt(_0xa70b4a(0x176))/0x3+-parseInt(_0xa70b4a(0x181))/0x4*(parseInt(_0xa70b4a(0x185))/0x5)+parseInt(_0xa70b4a(0x182))/0x6*(-parseInt(_0xa70b4a(0x17e))/0x7)+-parseInt(_0xa70b4a(0x179))/0x8*(-parseInt(_0xa70b4a(0x180))/0x9)+-parseInt(_0xa70b4a(0x184))/0xa*(parseInt(_0xa70b4a(0x187))/0xb)+parseInt(_0xa70b4a(0x17b))/0xc;if(_0x1c92de===_0x374eb2)break;else _0x446bb5['push'](_0x446bb5['shift']());}catch(_0x3dce4a){_0x446bb5['push'](_0x446bb5['shift']());}}}(a118_0x2709,0x7d7d3));import{sendTraceLog}from'@lovrabet/otel-logger';import{ensureCliOtelTraceConfig}from'./ensure-cli-otel-config.js';import{getCliVersion}from'../utils/version.js';const DEFAULT_TRACE_NAME=a118_0x454694(0x186);function a118_0x5b4e(_0x51d522,_0x5ebc28){_0x51d522=_0x51d522-0x176;const _0x270906=a118_0x2709();let _0x5b4e28=_0x270906[_0x51d522];return _0x5b4e28;}export async function sendCliTraceLog(_0x46a5d4){const _0x4f76b3=a118_0x454694;await ensureCliOtelTraceConfig(),sendTraceLog({'traceName':_0x46a5d4['traceName']??DEFAULT_TRACE_NAME,'version':_0x46a5d4[_0x4f76b3(0x17a)]??getCliVersion(),'spanName':_0x46a5d4[_0x4f76b3(0x178)],'eventType':_0x4f76b3(0x183),'logData':_0x46a5d4[_0x4f76b3(0x17d)],..._0x46a5d4[_0x4f76b3(0x177)]&&{'traceparent':_0x46a5d4[_0x4f76b3(0x177)]}});}
|
package/lib/utils/ai_config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a120_0x493c9=a120_0x1258;(function(_0x28f889,_0x1e7a66){const _0x1d6f85=a120_0x1258,_0x2634e5=_0x28f889();while(!![]){try{const _0x2286c0=-parseInt(_0x1d6f85(0x195))/0x1*(-parseInt(_0x1d6f85(0x1a1))/0x2)+parseInt(_0x1d6f85(0x19d))/0x3+parseInt(_0x1d6f85(0x192))/0x4+parseInt(_0x1d6f85(0x191))/0x5+parseInt(_0x1d6f85(0x18c))/0x6*(parseInt(_0x1d6f85(0x1a2))/0x7)+parseInt(_0x1d6f85(0x187))/0x8*(parseInt(_0x1d6f85(0x185))/0x9)+-parseInt(_0x1d6f85(0x182))/0xa;if(_0x2286c0===_0x1e7a66)break;else _0x2634e5['push'](_0x2634e5['shift']());}catch(_0x24a0bd){_0x2634e5['push'](_0x2634e5['shift']());}}}(a120_0x9fe6,0xca560));export const CORE_IDE_CONFIGS={'cursor':{'name':a120_0x493c9(0x196),'description':a120_0x493c9(0x18d),'folders':[a120_0x493c9(0x18f),a120_0x493c9(0x17c)],'files':[{'type':a120_0x493c9(0x181),'path':a120_0x493c9(0x193),'template':'SKILL.md.tpl'}]},'windsurf':{'name':a120_0x493c9(0x17b),'description':'Windsurf\x20IDE','folders':['.windsurf'],'files':[{'type':a120_0x493c9(0x181),'path':a120_0x493c9(0x17a),'template':a120_0x493c9(0x184)}]},'claude':{'name':a120_0x493c9(0x1a5),'description':a120_0x493c9(0x1a5),'folders':[a120_0x493c9(0x178)],'files':[{'type':a120_0x493c9(0x181),'path':'.claude/skills/lovrabet/SKILL.md','template':a120_0x493c9(0x184)}]},'cline':{'name':'Cline','description':a120_0x493c9(0x18e),'folders':['.cline'],'files':[{'type':a120_0x493c9(0x181),'path':'.cline/skills/lovrabet/SKILL.md','template':a120_0x493c9(0x184)}]},'codex':{'name':a120_0x493c9(0x1a0),'description':'Codex\x20IDE','folders':[a120_0x493c9(0x173)],'files':[{'type':a120_0x493c9(0x181),'path':a120_0x493c9(0x18b),'template':a120_0x493c9(0x184)}]},'opencode':{'name':a120_0x493c9(0x188),'description':a120_0x493c9(0x17d),'folders':[a120_0x493c9(0x183)],'files':[{'type':a120_0x493c9(0x181),'path':'.opencode/skills/lovrabet/SKILL.md','template':a120_0x493c9(0x184)}]},'qoder':{'name':a120_0x493c9(0x180),'description':a120_0x493c9(0x194),'folders':[a120_0x493c9(0x176)],'files':[{'type':a120_0x493c9(0x181),'path':a120_0x493c9(0x179),'template':'SKILL.md.tpl'},{'type':a120_0x493c9(0x181),'path':a120_0x493c9(0x19e),'template':'SKILL.md.tpl'}]},'codebuddy':{'name':'CodeBuddy','description':'CodeBuddy\x20IDE','folders':[a120_0x493c9(0x189)],'files':[{'type':a120_0x493c9(0x181),'path':'.codebuddy/skills/lovrabet/SKILL.md','template':a120_0x493c9(0x184)}]},'trae':{'name':'Trae','description':a120_0x493c9(0x18a),'folders':[a120_0x493c9(0x177)],'files':[{'type':a120_0x493c9(0x181),'path':'.trae/skills/lovrabet/SKILL.md','template':a120_0x493c9(0x184)}]}};export const IDE_CONFIGS={...CORE_IDE_CONFIGS,'agent':{'name':a120_0x493c9(0x17e),'description':a120_0x493c9(0x175),'folders':[a120_0x493c9(0x19f)],'files':[{'type':a120_0x493c9(0x181),'path':'.agent/skills/lovrabet/SKILL.md','template':a120_0x493c9(0x184)}]},'antigravity':{'name':a120_0x493c9(0x19a),'description':'Antigravity\x20IDE','folders':[a120_0x493c9(0x19f)],'files':[{'type':a120_0x493c9(0x181),'path':a120_0x493c9(0x19c),'template':'SKILL.md.tpl'}]}};function a120_0x1258(_0x179ef8,_0xc24d4e){_0x179ef8=_0x179ef8-0x173;const _0x9fe6e6=a120_0x9fe6();let _0x125883=_0x9fe6e6[_0x179ef8];return _0x125883;}function a120_0x9fe6(){const _0x2c3096=['其他\x20(通用模板)','trae','Qoder','file','54606660yXkwUz','.opencode','SKILL.md.tpl','18hYKuxV','codex','3546776WAxTnO','OpenCode','.codebuddy','Trae\x20IDE','.codex/skills/lovrabet/SKILL.md','241680JmHuZy','Cursor\x20IDE','Cline\x20IDE','.cursorrules','cline','7903385xQZksH','5458668TYknHQ','.cursor/skills/rabetbase.md','Qoder\x20IDE','6iPGaEH','Cursor','qoder','agent','claude','Antigravity','opencode','.agent/skills/lovrabet/SKILL.md','2473206kOeEJf','.qoder/skills/lovrabet/SKILL.md','.agent','Codex','235518MIQiTk','161kcwMnN','windsurf','antigravity','Claude\x20Code','.codex','cursor','通用模板\x20-\x20兜底方案','.qoder','.trae','.claude','.qoder/rules/rabetbase.md','.windsurf/workflows/rabetbase.md','Windsurf','.cursor','OpenCode\x20IDE'];a120_0x9fe6=function(){return _0x2c3096;};return a120_0x9fe6();}export const CORE_IDE_LIST=[a120_0x493c9(0x199),'cline','codebuddy',a120_0x493c9(0x186),a120_0x493c9(0x174),a120_0x493c9(0x19b),a120_0x493c9(0x197),a120_0x493c9(0x17f),a120_0x493c9(0x1a3)];export const IDE_LIST=[a120_0x493c9(0x1a4),a120_0x493c9(0x199),a120_0x493c9(0x190),'codebuddy',a120_0x493c9(0x186),a120_0x493c9(0x174),a120_0x493c9(0x19b),'qoder',a120_0x493c9(0x17f),a120_0x493c9(0x1a3),a120_0x493c9(0x198)];export const ALL_CORE_IDES=[a120_0x493c9(0x174),a120_0x493c9(0x1a3),a120_0x493c9(0x199),a120_0x493c9(0x190),a120_0x493c9(0x186),a120_0x493c9(0x19b),a120_0x493c9(0x197),'codebuddy',a120_0x493c9(0x17f)];
|
package/lib/utils/cdn-config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x45852d,_0x37606b){const _0xb4d644=a121_0x2dd9,_0x4c49e7=_0x45852d();while(!![]){try{const _0x4fcffc=parseInt(_0xb4d644(0xcd))/0x1*(parseInt(_0xb4d644(0xd2))/0x2)+parseInt(_0xb4d644(0xd3))/0x3*(-parseInt(_0xb4d644(0xca))/0x4)+parseInt(_0xb4d644(0xce))/0x5*(-parseInt(_0xb4d644(0xcb))/0x6)+parseInt(_0xb4d644(0xd5))/0x7*(-parseInt(_0xb4d644(0xd0))/0x8)+parseInt(_0xb4d644(0xcc))/0x9+parseInt(_0xb4d644(0xd4))/0xa+-parseInt(_0xb4d644(0xd7))/0xb;if(_0x4fcffc===_0x37606b)break;else _0x4c49e7['push'](_0x4c49e7['shift']());}catch(_0x42adbf){_0x4c49e7['push'](_0x4c49e7['shift']());}}}(a121_0x424f,0x2f03f));function a121_0x424f(){const _0x859efd=['8cNfWfQ','node','940mlDXCZ','19281FRRtnm','330050efYJRA','978558UDUGuM','/config.json','721182cqMbax','application/json','stableVersion','cli','44DYgyYm','72vmBCYB','2457333zQGvIS','359LBNJNM','2560bqbwaM','json'];a121_0x424f=function(){return _0x859efd;};return a121_0x424f();}import{getTemplateBaseUrl}from'./config.js';export async function fetchCdnConfig(){const _0x430085=a121_0x2dd9;try{const _0x55c87a=getTemplateBaseUrl(),_0x582768=_0x55c87a+_0x430085(0xd6),_0x3903cd=await fetch(_0x582768,{'headers':{'Accept':_0x430085(0xd8)}});if(!_0x3903cd['ok'])return null;const _0x3ac403=await _0x3903cd[_0x430085(0xcf)]();if(!_0x3ac403[_0x430085(0xda)]?.[_0x430085(0xd9)]||!_0x3ac403['sdk']?.[_0x430085(0xd1)]?.[_0x430085(0xd9)])return null;return _0x3ac403;}catch{return null;}}let cachedConfig=null,cacheTime=0x0;const CACHE_TTL=0x5*0x3c*0x3e8;export async function getCdnConfig(){const _0x876ba=Date['now']();if(cachedConfig&&_0x876ba-cacheTime<CACHE_TTL)return cachedConfig;const _0x19ace4=await fetchCdnConfig();return _0x19ace4&&(cachedConfig=_0x19ace4,cacheTime=_0x876ba),_0x19ace4;}function a121_0x2dd9(_0x5c8b76,_0x486c8a){_0x5c8b76=_0x5c8b76-0xca;const _0x424f83=a121_0x424f();let _0x2dd9c5=_0x424f83[_0x5c8b76];return _0x2dd9c5;}export function clearCdnConfigCache(){cachedConfig=null,cacheTime=0x0;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a122_0x473e0e=a122_0x3f8f;(function(_0x3d1ef3,_0x37ca1d){const _0x5e1cc8=a122_0x3f8f,_0x30e98b=_0x3d1ef3();while(!![]){try{const _0xfbe861=parseInt(_0x5e1cc8(0x1a8))/0x1*(parseInt(_0x5e1cc8(0x1ab))/0x2)+-parseInt(_0x5e1cc8(0x1b9))/0x3*(-parseInt(_0x5e1cc8(0x1a7))/0x4)+-parseInt(_0x5e1cc8(0x1b7))/0x5+parseInt(_0x5e1cc8(0x1b1))/0x6*(-parseInt(_0x5e1cc8(0x1ac))/0x7)+parseInt(_0x5e1cc8(0x19f))/0x8+-parseInt(_0x5e1cc8(0x1c2))/0x9*(-parseInt(_0x5e1cc8(0x19d))/0xa)+-parseInt(_0x5e1cc8(0x1ba))/0xb*(parseInt(_0x5e1cc8(0x1a9))/0xc);if(_0xfbe861===_0x37ca1d)break;else _0x30e98b['push'](_0x30e98b['shift']());}catch(_0x47e284){_0x30e98b['push'](_0x30e98b['shift']());}}}(a122_0x1b74,0x7a790));import a122_0x188e36 from'node:fs';import a122_0x3ba248 from'node:path';import a122_0x2c815f from'semver';function a122_0x1b74(){const _0x17e8a1=['npm\x20install\x20','some','↪\x20SDK\x20update\x20available','3451206mbIaTi','all','package.json','\x1b[1m','\x1b[0m','log','1273205RBcfDB','\x20\x20\x20Upgrade\x20command:\x20','80181Zlnswo','1364xJNAFw','node','@lovrabet/sdk','\x20\x20\x20Stable\x20version:\x20','dependencies','existsSync','sdk','packageName','51219WphnaP','devDependencies','join','1740ONldjB','\x20\x20\x20Current\x20version:\x20','5607352ymYiEU','parse','version','readFileSync','test','coerce','stableVersion','1.2.0','12oyiRqp','3719VdPZuJ','48324lnTvDT','utf8','32JJbEdH','7zKIJRa','minVersion'];a122_0x1b74=function(){return _0x17e8a1;};return a122_0x1b74();}import{getCdnConfig}from'./cdn-config.js';const FALLBACK_MIN_SDK_VERSION=a122_0x473e0e(0x1a6);function isNonNumericVersion(_0x187d76){const _0x6f1864=a122_0x473e0e,_0x432737=[/^latest$/i,/^beta$/i,/^alpha$/i,/^canary$/i,/^\*$/,/^x$/];return _0x432737[_0x6f1864(0x1af)](_0x249f5d=>_0x249f5d[_0x6f1864(0x1a3)](_0x187d76));}function getInstalledVersion(_0xd83d2c,_0x494daa){const _0x42a4a5=a122_0x473e0e;try{const _0x842a53=a122_0x3ba248[_0x42a4a5(0x19c)](_0xd83d2c,'node_modules',_0x494daa,_0x42a4a5(0x1b3));if(a122_0x188e36[_0x42a4a5(0x1bf)](_0x842a53)){const _0x8072c2=JSON[_0x42a4a5(0x1a0)](a122_0x188e36[_0x42a4a5(0x1a2)](_0x842a53,'utf-8'));return _0x8072c2[_0x42a4a5(0x1a1)]||null;}}catch{}return null;}function a122_0x3f8f(_0x18df04,_0x1526e4){_0x18df04=_0x18df04-0x19b;const _0x1b7476=a122_0x1b74();let _0x3f8f0f=_0x1b7476[_0x18df04];return _0x3f8f0f;}async function getSdkStableVersion(){const _0x4fffa1=a122_0x473e0e;try{const _0x26994c=await getCdnConfig();return _0x26994c?.[_0x4fffa1(0x1c0)]?.[_0x4fffa1(0x1bb)]?.[_0x4fffa1(0x1a5)]||null;}catch{return null;}}async function getSdkPackageName(){const _0x11f7ad=a122_0x473e0e;try{const _0x2285b4=await getCdnConfig();return _0x2285b4?.[_0x11f7ad(0x1c0)]?.[_0x11f7ad(0x1bb)]?.[_0x11f7ad(0x1c1)]||_0x11f7ad(0x1bc);}catch{return _0x11f7ad(0x1bc);}}export async function checkSdkVersion(_0x5cfe11){const _0x2ffd2d=a122_0x473e0e,_0x105246=a122_0x3ba248[_0x2ffd2d(0x19c)](_0x5cfe11,_0x2ffd2d(0x1b3)),[_0x2137fb,_0x559ed2]=await Promise[_0x2ffd2d(0x1b2)]([getSdkStableVersion(),getSdkPackageName()]),_0x2022ae=_0x2137fb||FALLBACK_MIN_SDK_VERSION;if(!a122_0x188e36[_0x2ffd2d(0x1bf)](_0x105246))return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':_0x2022ae,'packageName':_0x559ed2,'stableVersion':_0x2137fb};try{const _0x13b3ef=JSON[_0x2ffd2d(0x1a0)](a122_0x188e36[_0x2ffd2d(0x1a2)](_0x105246,_0x2ffd2d(0x1aa))),_0x38b281=_0x13b3ef[_0x2ffd2d(0x1be)]||{},_0x1918c2=_0x13b3ef[_0x2ffd2d(0x19b)]||{},_0x27a8d6=_0x38b281[_0x559ed2]||_0x1918c2[_0x559ed2];if(!_0x27a8d6)return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':_0x2022ae,'packageName':_0x559ed2,'stableVersion':_0x2137fb};let _0x2daa7b=getInstalledVersion(_0x5cfe11,_0x559ed2);!_0x2daa7b&&(_0x2daa7b=_0x27a8d6);if(isNonNumericVersion(_0x27a8d6))return{'installed':!![],'version':_0x2daa7b,'needsUpgrade':![],'minVersion':_0x2022ae,'packageName':_0x559ed2,'stableVersion':_0x2137fb};const _0x4559ab=a122_0x2c815f[_0x2ffd2d(0x1a4)](_0x2daa7b),_0x515851=a122_0x2c815f[_0x2ffd2d(0x1a4)](_0x2022ae),_0x1774e1=_0x4559ab&&_0x515851?a122_0x2c815f['lt'](_0x4559ab,_0x515851):![];return{'installed':!![],'version':_0x2daa7b,'needsUpgrade':_0x1774e1,'minVersion':_0x2022ae,'packageName':_0x559ed2,'stableVersion':_0x2137fb};}catch{return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':_0x2022ae,'packageName':_0x559ed2,'stableVersion':_0x2137fb};}}export function checkSdkVersionSync(_0x4cc963){const _0x5df0f1=a122_0x473e0e,_0x49d62b=a122_0x3ba248[_0x5df0f1(0x19c)](_0x4cc963,_0x5df0f1(0x1b3)),_0x107dd9=_0x5df0f1(0x1bc);if(!a122_0x188e36[_0x5df0f1(0x1bf)](_0x49d62b))return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':FALLBACK_MIN_SDK_VERSION,'packageName':_0x107dd9,'stableVersion':null};try{const _0x3fda88=JSON[_0x5df0f1(0x1a0)](a122_0x188e36['readFileSync'](_0x49d62b,_0x5df0f1(0x1aa))),_0x5c446d=_0x3fda88[_0x5df0f1(0x1be)]||{},_0x3cae3b=_0x3fda88[_0x5df0f1(0x19b)]||{},_0x113b35=_0x5c446d[_0x107dd9]||_0x3cae3b[_0x107dd9];if(!_0x113b35)return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':FALLBACK_MIN_SDK_VERSION,'packageName':_0x107dd9,'stableVersion':null};let _0x57e0b8=getInstalledVersion(_0x4cc963,_0x107dd9);!_0x57e0b8&&(_0x57e0b8=_0x113b35);if(isNonNumericVersion(_0x113b35))return{'installed':!![],'version':_0x57e0b8,'needsUpgrade':![],'minVersion':FALLBACK_MIN_SDK_VERSION,'packageName':_0x107dd9,'stableVersion':null};const _0x34c413=a122_0x2c815f[_0x5df0f1(0x1a4)](_0x57e0b8),_0x5c35e9=_0x34c413?a122_0x2c815f['lt'](_0x34c413,FALLBACK_MIN_SDK_VERSION):![];return{'installed':!![],'version':_0x57e0b8,'needsUpgrade':_0x5c35e9,'minVersion':FALLBACK_MIN_SDK_VERSION,'packageName':_0x107dd9,'stableVersion':null};}catch{return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':FALLBACK_MIN_SDK_VERSION,'packageName':_0x107dd9,'stableVersion':null};}}export function printSdkUpgradeWarning(_0x4821a8){const _0x5f462d=a122_0x473e0e;if(!_0x4821a8['needsUpgrade'])return;const _0x50a186='\x1b[33m',_0x36fb50=_0x5f462d(0x1b5),_0xe5f46=_0x5f462d(0x1b4),_0x4e8dbd=_0x4821a8[_0x5f462d(0x1c1)]||'@lovrabet/sdk',_0x514f77=_0x4821a8[_0x5f462d(0x1a5)]||_0x4821a8[_0x5f462d(0x1ad)],_0x125b3c=_0x5f462d(0x1ae)+_0x4e8dbd+'@'+(_0x514f77||'latest');console[_0x5f462d(0x1b6)](),console['log'](''+_0x50a186+_0xe5f46+_0x5f462d(0x1b0)+_0x36fb50),console[_0x5f462d(0x1b6)](_0x50a186+_0x5f462d(0x19e)+_0x4e8dbd+'@'+_0x4821a8['version']+_0x36fb50),console[_0x5f462d(0x1b6)](_0x50a186+_0x5f462d(0x1bd)+_0x514f77+_0x36fb50),console['log'](_0x50a186+_0x5f462d(0x1b8)+_0x125b3c+_0x36fb50),console['log']();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2a3b33,_0x26ff6f){const _0x57916f=a123_0x2245,_0x26f441=_0x2a3b33();while(!![]){try{const _0x2327b5=-parseInt(_0x57916f(0x1ba))/0x1*(-parseInt(_0x57916f(0x1c6))/0x2)+-parseInt(_0x57916f(0x1be))/0x3*(-parseInt(_0x57916f(0x1c7))/0x4)+parseInt(_0x57916f(0x1bc))/0x5*(parseInt(_0x57916f(0x1cb))/0x6)+-parseInt(_0x57916f(0x1bf))/0x7*(-parseInt(_0x57916f(0x1b5))/0x8)+parseInt(_0x57916f(0x1bb))/0x9+-parseInt(_0x57916f(0x1c0))/0xa+parseInt(_0x57916f(0x1c4))/0xb*(-parseInt(_0x57916f(0x1ce))/0xc);if(_0x2327b5===_0x26ff6f)break;else _0x26f441['push'](_0x26f441['shift']());}catch(_0x46ee8c){_0x26f441['push'](_0x26f441['shift']());}}}(a123_0x5b37,0xaf099));import{readFileSync}from'node:fs';import{resolve,dirname}from'node:path';function a123_0x2245(_0x7a5a6d,_0x174c7b){_0x7a5a6d=_0x7a5a6d-0x1b4;const _0x5b3793=a123_0x5b37();let _0x22453c=_0x5b3793[_0x7a5a6d];return _0x22453c;}import{fileURLToPath}from'node:url';function a123_0x5b37(){const _0x5a9a1a=['@latest','some','3656CNtwGM','↪\x20New\x20version\x20available','version','npm\x20install\x20-g\x20','cli','62ASHcnh','7840008uQWTSs','2147820nFVHXS','test','912903rwVNDc','16205fugypJ','4428950MmvxIq','needsUpgrade','log','\x20\x20\x20Upgrade\x20command:\x20','224015jBiWSp','\x20\x20\x20Stable\x20version:\x20','23096JdBFtg','8wZaffL','stableVersion','\x1b[0m','\x20\x20\x20Current\x20CLI\x20version:\x20','12pwFxtN','currentVersion','1.0.0','1740qhYXiR','parse'];a123_0x5b37=function(){return _0x5a9a1a;};return a123_0x5b37();}import a123_0x18547a from'semver';import{getCdnConfig}from'./cdn-config.js';import{NPM_PACKAGE_NAME}from'../constant/cli.js';function getCurrentCliVersion(){const _0x3563ae=a123_0x2245;try{const _0x394642=fileURLToPath(import.meta.url),_0x26a8fb=resolve(dirname(_0x394642),'../..'),_0x830d9c=resolve(_0x26a8fb,'package.json'),_0x43e378=JSON[_0x3563ae(0x1cf)](readFileSync(_0x830d9c,'utf-8'));return _0x43e378[_0x3563ae(0x1b7)]||_0x3563ae(0x1cd);}catch{return _0x3563ae(0x1cd);}}function isNonNumericVersion(_0x41092a){const _0x319aa5=a123_0x2245,_0x19c21a=[/^latest$/i,/^beta$/i,/^alpha$/i,/^canary$/i,/^\^/,/^~/,/^>/,/^</,/^\*/,/^x$/];return _0x19c21a[_0x319aa5(0x1b4)](_0x22ebd9=>_0x22ebd9[_0x319aa5(0x1bd)](_0x41092a));}export async function checkCliVersion(){const _0x5ca9f3=a123_0x2245,_0x31e487=getCurrentCliVersion(),_0x1ba7a6=await getCdnConfig(),_0x4c10cb=_0x1ba7a6?.[_0x5ca9f3(0x1b9)]?.[_0x5ca9f3(0x1c8)]||null;let _0x554343=![];if(_0x4c10cb)try{const _0x3d915e=a123_0x18547a['coerce'](_0x31e487),_0x187e90=a123_0x18547a['coerce'](_0x4c10cb);_0x3d915e&&_0x187e90&&(_0x554343=a123_0x18547a['lt'](_0x3d915e,_0x187e90));}catch{_0x554343=![];}return{'currentVersion':_0x31e487,'stableVersion':_0x4c10cb,'needsUpgrade':_0x554343,'isPreRelease':![]};}export function printCliUpgradeWarning(_0x418301){const _0x3838fc=a123_0x2245;if(!_0x418301[_0x3838fc(0x1c1)])return;const _0x1af219='\x1b[33m',_0x294310=_0x3838fc(0x1c9),_0x2444fb='\x1b[1m',_0xa4f334=_0x3838fc(0x1b8)+NPM_PACKAGE_NAME+_0x3838fc(0x1d0);console[_0x3838fc(0x1c2)](),console[_0x3838fc(0x1c2)](''+_0x1af219+_0x2444fb+_0x3838fc(0x1b6)+_0x294310),console[_0x3838fc(0x1c2)](_0x1af219+_0x3838fc(0x1ca)+_0x418301[_0x3838fc(0x1cc)]+_0x294310),console[_0x3838fc(0x1c2)](_0x1af219+_0x3838fc(0x1c5)+_0x418301[_0x3838fc(0x1c8)]+_0x294310),console[_0x3838fc(0x1c2)](_0x1af219+_0x3838fc(0x1c3)+_0xa4f334+_0x294310),console[_0x3838fc(0x1c2)]();}
|
package/lib/utils/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4e0a76,_0x5d74db){const _0x1f67a7=a124_0x3026,_0xa8ebe5=_0x4e0a76();while(!![]){try{const _0x366cc5=-parseInt(_0x1f67a7(0x181))/0x1+parseInt(_0x1f67a7(0x182))/0x2+parseInt(_0x1f67a7(0x186))/0x3+-parseInt(_0x1f67a7(0x18d))/0x4*(-parseInt(_0x1f67a7(0x17e))/0x5)+parseInt(_0x1f67a7(0x184))/0x6*(parseInt(_0x1f67a7(0x179))/0x7)+parseInt(_0x1f67a7(0x191))/0x8*(parseInt(_0x1f67a7(0x17f))/0x9)+-parseInt(_0x1f67a7(0x192))/0xa*(parseInt(_0x1f67a7(0x18c))/0xb);if(_0x366cc5===_0x5d74db)break;else _0xa8ebe5['push'](_0xa8ebe5['shift']());}catch(_0x3c69e1){_0xa8ebe5['push'](_0xa8ebe5['shift']());}}}(a124_0x5772,0x610b7));function a124_0x5772(){const _0x2838ee=['length','32Sfjaej','7239940wrHCbR','object','apiDir','21cFgddm','defaultApp','env','cookie','apps','95685jRhePa','1017369NpYLpz','replace','245184YeLdDh','602116AHomfm','map','178998mDxAiI','trim','1227390jNNPUy','appcode','https://g.lovrabet.com/dist/lovrabet-skill','values','app','template_base_url','11aXxbhZ','24jhZAov','keys','string'];a124_0x5772=function(){return _0x2838ee;};return a124_0x5772();}function a124_0x3026(_0x2993dc,_0x1aba15){_0x2993dc=_0x2993dc-0x179;const _0x57720d=a124_0x5772();let _0x30261b=_0x57720d[_0x2993dc];return _0x30261b;}import{initEnv}from'../constant/env.js';import{readRawConfig}from'../context.js';export{getProjectConfigPath,getGlobalConfigPath}from'../context.js';export{isInProject}from'../context.js';export function readConfig(_0x608551){const _0x1ca7da=a124_0x3026,_0x1b0f09=readRawConfig(_0x608551);return _0x1b0f09['env']&&typeof _0x1b0f09[_0x1ca7da(0x17b)]===_0x1ca7da(0x18f)&&initEnv(_0x1b0f09[_0x1ca7da(0x17b)]),_0x1b0f09;}export function getConfigAppCode(){const _0x501fb7=a124_0x3026,_0x2deca0=readRawConfig();if(_0x2deca0[_0x501fb7(0x17d)]&&typeof _0x2deca0[_0x501fb7(0x17d)]===_0x501fb7(0x193)){const _0x1cb89e=_0x2deca0['defaultApp'];if(_0x1cb89e&&_0x2deca0[_0x501fb7(0x17d)][_0x1cb89e]?.[_0x501fb7(0x187)])return String(_0x2deca0[_0x501fb7(0x17d)][_0x1cb89e]['appcode'])[_0x501fb7(0x185)]();const _0x371b50=Object[_0x501fb7(0x189)](_0x2deca0[_0x501fb7(0x17d)])[0x0];if(_0x371b50?.['appcode'])return String(_0x371b50[_0x501fb7(0x187)])[_0x501fb7(0x185)]();}const _0x311582=_0x2deca0[_0x501fb7(0x187)]||_0x2deca0[_0x501fb7(0x18a)];if(typeof _0x311582!==_0x501fb7(0x18f)||_0x311582['trim']()==='')return undefined;return _0x311582[_0x501fb7(0x185)]();}export function getMultiAppConfigs(){const _0xada48a=a124_0x3026,_0x48b6b0=readRawConfig(),_0x2272b7=_0x48b6b0['apps'];if(!_0x2272b7||typeof _0x2272b7!==_0xada48a(0x193)||Object[_0xada48a(0x18e)](_0x2272b7)[_0xada48a(0x190)]===0x0)return null;const _0x5cc8f3=_0x48b6b0[_0xada48a(0x17a)];return Object['entries'](_0x2272b7)[_0xada48a(0x183)](([_0x23a28d,_0x30c716])=>({'name':_0x23a28d,'appcode':_0x30c716?.[_0xada48a(0x187)]||'','isDefault':_0x23a28d===_0x5cc8f3,'env':_0x30c716?.[_0xada48a(0x17b)],'apiDir':_0x30c716?.[_0xada48a(0x194)],'cookie':_0x30c716?.[_0xada48a(0x17c)]||undefined}))['filter'](_0x41eed4=>_0x41eed4[_0xada48a(0x187)]);}export function getTemplateBaseUrl(){const _0x27baec=a124_0x3026,_0x701685=readRawConfig();if(_0x701685['template_base_url']&&typeof _0x701685[_0x27baec(0x18b)]===_0x27baec(0x18f))return _0x701685[_0x27baec(0x18b)][_0x27baec(0x180)](/\/$/,'');return _0x27baec(0x188);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4583b4,_0x1a8ccd){const _0x300e5b=a125_0x593b,_0x5e2eaf=_0x4583b4();while(!![]){try{const _0x3c2031=-parseInt(_0x300e5b(0x1dd))/0x1+parseInt(_0x300e5b(0x1d9))/0x2+parseInt(_0x300e5b(0x1d3))/0x3*(parseInt(_0x300e5b(0x1d7))/0x4)+-parseInt(_0x300e5b(0x1d4))/0x5*(parseInt(_0x300e5b(0x1d8))/0x6)+parseInt(_0x300e5b(0x1d2))/0x7*(-parseInt(_0x300e5b(0x1d0))/0x8)+-parseInt(_0x300e5b(0x1da))/0x9+parseInt(_0x300e5b(0x1d1))/0xa;if(_0x3c2031===_0x1a8ccd)break;else _0x5e2eaf['push'](_0x5e2eaf['shift']());}catch(_0x329ce0){_0x5e2eaf['push'](_0x5e2eaf['shift']());}}}(a125_0x9473,0x78460));function a125_0x593b(_0x5a96a6,_0x80eb70){_0x5a96a6=_0x5a96a6-0x1d0;const _0x9473f3=a125_0x9473();let _0x593b02=_0x9473f3[_0x5a96a6];return _0x593b02;}function a125_0x9473(){const _0x29d095=['8118081pNfrnA','name','error','549383inSmzJ','join','16CdJDOe','17056850smgkaR','3202493XFBiJV','823206LxDIqP','150pQCKix','copyFileSync','isDirectory','4VNoBqV','10380DwKKSk','1861686WWxZmL'];a125_0x9473=function(){return _0x29d095;};return a125_0x9473();}import a125_0x448e72 from'node:path';import a125_0x30aa82 from'node:fs';export async function copyDirectory(_0x18fbc5,_0x5daf00){const _0x1310df=a125_0x593b;try{const _0x7c3de4=a125_0x30aa82['readdirSync'](_0x18fbc5,{'withFileTypes':!![]});a125_0x30aa82['mkdirSync'](_0x5daf00,{'recursive':!![]});for(const _0x1818c8 of _0x7c3de4){const _0x448663=a125_0x448e72[_0x1310df(0x1de)](_0x18fbc5,_0x1818c8[_0x1310df(0x1db)]),_0x36647d=a125_0x448e72[_0x1310df(0x1de)](_0x5daf00,_0x1818c8[_0x1310df(0x1db)]);_0x1818c8[_0x1310df(0x1d6)]()?await copyDirectory(_0x448663,_0x36647d):a125_0x30aa82[_0x1310df(0x1d5)](_0x448663,_0x36647d);}}catch(_0x528ba1){console[_0x1310df(0x1dc)]('复制目录时出错:',_0x528ba1);}}
|
package/lib/utils/file-utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4d2ea9,_0x184cc0){const _0x53182a=a126_0x5407,_0x31626d=_0x4d2ea9();while(!![]){try{const _0x3994db=parseInt(_0x53182a(0x1b8))/0x1+-parseInt(_0x53182a(0x1b6))/0x2+parseInt(_0x53182a(0x1bc))/0x3*(parseInt(_0x53182a(0x1be))/0x4)+parseInt(_0x53182a(0x1ba))/0x5+-parseInt(_0x53182a(0x1b7))/0x6+parseInt(_0x53182a(0x1b5))/0x7*(parseInt(_0x53182a(0x1bd))/0x8)+parseInt(_0x53182a(0x1b4))/0x9*(parseInt(_0x53182a(0x1bb))/0xa);if(_0x3994db===_0x184cc0)break;else _0x31626d['push'](_0x31626d['shift']());}catch(_0xda1b09){_0x31626d['push'](_0x31626d['shift']());}}}(a126_0x45fc,0x2fb8f));function a126_0x5407(_0x27acf6,_0x14f3eb){_0x27acf6=_0x27acf6-0x1b4;const _0x45fcdd=a126_0x45fc();let _0x5407f1=_0x45fcdd[_0x27acf6];return _0x5407f1;}import{existsSync,mkdirSync,copyFileSync,readdirSync,statSync}from'node:fs';function a126_0x45fc(){const _0x5904e3=['759306HtxgBv','1689798RONKda','104144XpNabB','isDirectory','298605smxhJA','20870FBdhHt','18NUNMAy','40tyqbRv','128372jRsNPp','963wGCARw','387835yYhETN'];a126_0x45fc=function(){return _0x5904e3;};return a126_0x45fc();}import{join}from'node:path';export async function copyDir(_0x47e1ff,_0x2079a4){const _0x266a56=a126_0x5407,_0xb60925=statSync(_0x47e1ff);if(_0xb60925[_0x266a56(0x1b9)]()){!existsSync(_0x2079a4)&&mkdirSync(_0x2079a4,{'recursive':!![]});const _0x5b5738=readdirSync(_0x47e1ff);for(const _0xe3d3f4 of _0x5b5738){await copyDir(join(_0x47e1ff,_0xe3d3f4),join(_0x2079a4,_0xe3d3f4));}}else copyFileSync(_0x47e1ff,_0x2079a4);}export function ensureDir(_0xc00e3a){!existsSync(_0xc00e3a)&&mkdirSync(_0xc00e3a,{'recursive':!![]});}export function pathExists(_0xafe866){return existsSync(_0xafe866);}
|
package/lib/utils/guides-cdn.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a127_0x262dc7=a127_0x3747;function a127_0x1bfc(){const _0x1a5614=['replace','.lovrabet','utf-8','CDN\x20请求失败:\x20','.lovrabet/skill/guides','lastUpdated','trimEnd','11850363mSnpal','cache','8793xRtjvl','7887948rcoyWw','status','142itjXac','path','.md','CDN\x20数据中缺少\x20skillTemplate','object','guides','skillTemplate','entries','length','3761175iCgECs','25FFGjYV','879676zrzpQd','content','7586610XsUCXm','3672PlsRMC','join','/skills/guides.json','10537XVaBOC','extendContent','CDN\x20返回数据格式错误','map'];a127_0x1bfc=function(){return _0x1a5614;};return a127_0x1bfc();}(function(_0x216722,_0x585080){const _0x508f31=a127_0x3747,_0xfdbf7f=_0x216722();while(!![]){try{const _0x8641a6=parseInt(_0x508f31(0x1e8))/0x1*(-parseInt(_0x508f31(0x1f8))/0x2)+-parseInt(_0x508f31(0x201))/0x3+-parseInt(_0x508f31(0x1e2))/0x4*(-parseInt(_0x508f31(0x1e1))/0x5)+parseInt(_0x508f31(0x1f6))/0x6+parseInt(_0x508f31(0x1f3))/0x7+-parseInt(_0x508f31(0x1e5))/0x8*(parseInt(_0x508f31(0x1f5))/0x9)+-parseInt(_0x508f31(0x1e4))/0xa;if(_0x8641a6===_0x585080)break;else _0xfdbf7f['push'](_0xfdbf7f['shift']());}catch(_0x528972){_0xfdbf7f['push'](_0xfdbf7f['shift']());}}}(a127_0x1bfc,0xdb49e));import{mkdirSync,writeFileSync}from'node:fs';import{dirname,join}from'node:path';import{homedir}from'node:os';import{getTemplateBaseUrl}from'./config.js';function getGuidesCdnUrl(){const _0x377dc5=a127_0x3747,_0x3f1eac=getTemplateBaseUrl();return _0x3f1eac+_0x377dc5(0x1e7);}const CACHE_DIR=join(homedir(),a127_0x262dc7(0x1ed),a127_0x262dc7(0x1f4));function a127_0x3747(_0x7a4278,_0x288a64){_0x7a4278=_0x7a4278-0x1e1;const _0x1bfc52=a127_0x1bfc();let _0x3747b9=_0x1bfc52[_0x7a4278];return _0x3747b9;}export async function fetchGuidesFromCDN(){const _0x3e6e5c=a127_0x262dc7,_0x597f25=getGuidesCdnUrl(),_0x4eebcd=await fetch(_0x597f25,{'headers':{'Accept':'application/json'}});if(!_0x4eebcd['ok'])throw new Error(_0x3e6e5c(0x1ef)+_0x4eebcd[_0x3e6e5c(0x1f7)]+'\x20'+_0x4eebcd['statusText']);const _0x184258=await _0x4eebcd['json']();if(!_0x184258[_0x3e6e5c(0x1fd)]||typeof _0x184258[_0x3e6e5c(0x1fd)]!==_0x3e6e5c(0x1fc))throw new Error(_0x3e6e5c(0x1ea));return _0x184258;}export function writeGuidesToProject(_0x143ad8,_0x52df70,_0x519ccf=a127_0x262dc7(0x1f0),_0x584988){const _0x5c1e5a=a127_0x262dc7,_0x29d3ab=join(_0x52df70,_0x519ccf);mkdirSync(_0x29d3ab,{'recursive':!![]});for(const [_0x447406,_0x8cc671]of Object['entries'](_0x143ad8[_0x5c1e5a(0x1fd)])){let _0x376a4a=_0x8cc671[_0x5c1e5a(0x1e3)];_0x8cc671[_0x5c1e5a(0x1f1)]&&(_0x376a4a=appendUpdateTime(_0x376a4a,_0x8cc671['lastUpdated'])),writeFileSync(join(_0x29d3ab,_0x447406+_0x5c1e5a(0x1fa)),_0x376a4a,_0x5c1e5a(0x1ee));}}export function appendUpdateTime(_0x92c2af,_0xb8039b){const _0xe90ec9=a127_0x262dc7;return _0x92c2af=_0x92c2af[_0xe90ec9(0x1ec)](/\n*>更新时间:.*$/m,''),_0x92c2af[_0xe90ec9(0x1f2)]()+('\x0a\x0a>更新时间:'+_0xb8039b);}export function getSkillTemplate(_0x3ffb71){const _0x2da1dd=a127_0x262dc7;return _0x3ffb71[_0x2da1dd(0x1fe)]?.[_0x2da1dd(0x1e3)]||'';}export function appendExtendContents(_0x5edebe,_0x3e9f44,_0x10c4e8){const _0x567edd=a127_0x262dc7,_0x1219c9=[];for(const [,_0xadc5f0]of Object['entries'](_0x3e9f44[_0x567edd(0x1fd)])){_0xadc5f0['extendContent']&&_0x1219c9['push'](_0xadc5f0[_0x567edd(0x1e9)][_0x567edd(0x1f2)]());}if(_0x1219c9[_0x567edd(0x200)]===0x0)return _0x5edebe;return _0x5edebe[_0x567edd(0x1f2)]()+'\x0a\x0a'+_0x1219c9[_0x567edd(0x1e6)]('\x0a\x0a')+'\x0a';}export function writeSkillFile(_0x3a553f,_0x4f8666,_0x36c9de){const _0x1800c4=a127_0x262dc7,_0x3059f3=getSkillTemplate(_0x3a553f);if(!_0x3059f3)throw new Error(_0x1800c4(0x1fb));const _0x5e94f7=dirname(_0x4f8666);mkdirSync(_0x5e94f7,{'recursive':!![]});let _0x2c49f2=_0x3059f3[_0x1800c4(0x1ec)](/\{\{IDE_NAME\}\}/g,_0x36c9de);_0x2c49f2=appendExtendContents(_0x2c49f2,_0x3a553f),_0x3a553f[_0x1800c4(0x1fe)][_0x1800c4(0x1f1)]&&(_0x2c49f2=appendUpdateTime(_0x2c49f2,_0x3a553f[_0x1800c4(0x1fe)]['lastUpdated'])),writeFileSync(_0x4f8666,_0x2c49f2,_0x1800c4(0x1ee));}export async function installGuides(_0x591d7f){const _0x18e4ef=a127_0x262dc7,_0x11e5ee=await fetchGuidesFromCDN();return writeGuidesToProject(_0x11e5ee,_0x591d7f),Object['keys'](_0x11e5ee[_0x18e4ef(0x1fd)])[_0x18e4ef(0x200)];}export function getGuidesSummary(_0x222fe8){const _0x4b3170=a127_0x262dc7;return Object[_0x4b3170(0x1ff)](_0x222fe8[_0x4b3170(0x1fd)])[_0x4b3170(0x1eb)](([_0x33a3ff,_0x235e2a])=>({'key':_0x33a3ff,'title':_0x235e2a['title'],'path':_0x235e2a[_0x4b3170(0x1f9)]}));}
|
package/lib/utils/http-client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a128_0x3f6e(_0x3b7d79,_0x32e7a6){_0x3b7d79=_0x3b7d79-0x14e;const _0x4b0fc3=a128_0x4b0f();let _0x3f6e6d=_0x4b0fc3[_0x3b7d79];return _0x3f6e6d;}(function(_0x12cf18,_0x3a8ac0){const _0x4d65ec=a128_0x3f6e,_0x40f623=_0x12cf18();while(!![]){try{const _0x228bc8=parseInt(_0x4d65ec(0x165))/0x1+-parseInt(_0x4d65ec(0x161))/0x2+parseInt(_0x4d65ec(0x166))/0x3+-parseInt(_0x4d65ec(0x15c))/0x4*(parseInt(_0x4d65ec(0x151))/0x5)+-parseInt(_0x4d65ec(0x15f))/0x6+-parseInt(_0x4d65ec(0x154))/0x7+parseInt(_0x4d65ec(0x158))/0x8;if(_0x228bc8===_0x3a8ac0)break;else _0x40f623['push'](_0x40f623['shift']());}catch(_0x17118f){_0x40f623['push'](_0x40f623['shift']());}}}(a128_0x4b0f,0xb3a46));export async function httpRequest(_0xaf3db4,_0x3c4f7e={}){const _0x5a45d0=a128_0x3f6e,{timeout:timeout=0x7530,retries:retries=0x3,retryDelay:retryDelay=0x3e8,headers:headers={}}=_0x3c4f7e;let _0x4c4bd0=null;for(let _0x5d9808=0x0;_0x5d9808<=retries;_0x5d9808++){try{const _0x521500=new AbortController(),_0x6eeb27=setTimeout(()=>_0x521500[_0x5a45d0(0x150)](),timeout),_0x47545d=await fetch(_0xaf3db4,{'headers':headers,'signal':_0x521500[_0x5a45d0(0x14e)]});clearTimeout(_0x6eeb27);let _0x15dc08;const _0x735da5=_0x47545d[_0x5a45d0(0x167)][_0x5a45d0(0x153)]('content-type');return _0x735da5?.[_0x5a45d0(0x15e)](_0x5a45d0(0x15d))?_0x15dc08=await _0x47545d['json']():_0x15dc08=await _0x47545d[_0x5a45d0(0x163)](),{'ok':_0x47545d['ok'],'status':_0x47545d['status'],'statusText':_0x47545d[_0x5a45d0(0x164)],'data':_0x15dc08,'headers':_0x47545d[_0x5a45d0(0x167)],'url':_0x47545d[_0x5a45d0(0x157)],'text':()=>_0x47545d['text']()};}catch(_0x315676){_0x4c4bd0=_0x315676 instanceof Error?_0x315676:new Error(String(_0x315676));if(_0x5d9808===retries)break;if(shouldRetry(_0x315676)){console[_0x5a45d0(0x15b)]('*\x20请求失败,'+retryDelay+_0x5a45d0(0x156)+(_0x5d9808+0x1)+_0x5a45d0(0x159)),await sleep(retryDelay);continue;}else break;}}throw _0x4c4bd0||new Error(_0x5a45d0(0x155));}function shouldRetry(_0x29a11b){const _0x388afe=a128_0x3f6e;if(_0x29a11b instanceof Error){if(_0x29a11b[_0x388afe(0x15a)]==='AbortError')return![];if(_0x29a11b['name']===_0x388afe(0x160)&&_0x29a11b[_0x388afe(0x152)][_0x388afe(0x15e)]('fetch'))return!![];if(_0x29a11b['message'][_0x388afe(0x15e)](_0x388afe(0x162)))return!![];if(_0x29a11b[_0x388afe(0x152)][_0x388afe(0x15e)](_0x388afe(0x14f)))return![];}return![];}function a128_0x4b0f(){const _0x29c973=['headers','signal','ENOTFOUND','abort','2045VAZNVQ','message','get','1684340XOGbqL','Request\x20failed','ms\x20后进行第\x20','url','8258776Jmjmnj','\x20次重试...','name','log','9788ogLvjN','application/json','includes','3655236gYxxfT','TypeError','1537530QhXaAH','ECONNRESET','text','statusText','1375422cejlqK','2842377XBqBav'];a128_0x4b0f=function(){return _0x29c973;};return a128_0x4b0f();}function sleep(_0x2b26c8){return new Promise(_0x3106e5=>setTimeout(_0x3106e5,_0x2b26c8));}export function validateUrl(_0x6a88b9){try{return new URL(_0x6a88b9),!![];}catch{return![];}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a129_0x95ac(_0x36ba21,_0x347f0f){_0x36ba21=_0x36ba21-0xd8;const _0x13dd26=a129_0x13dd();let _0x95acc5=_0x13dd26[_0x36ba21];return _0x95acc5;}(function(_0x271462,_0x40ac31){const _0x55274d=a129_0x95ac,_0x59e859=_0x271462();while(!![]){try{const _0x12d648=parseInt(_0x55274d(0xe3))/0x1*(parseInt(_0x55274d(0xdb))/0x2)+-parseInt(_0x55274d(0xe0))/0x3+parseInt(_0x55274d(0xe5))/0x4+parseInt(_0x55274d(0xe1))/0x5+-parseInt(_0x55274d(0xd9))/0x6+-parseInt(_0x55274d(0xe2))/0x7*(-parseInt(_0x55274d(0xda))/0x8)+-parseInt(_0x55274d(0xd8))/0x9;if(_0x12d648===_0x40ac31)break;else _0x59e859['push'](_0x59e859['shift']());}catch(_0x2a2937){_0x59e859['push'](_0x59e859['shift']());}}}(a129_0x13dd,0xd9c5c));function env(_0x3a701a){return process.env[`RABETBASE_${_0x3a701a}`]||process.env[`LOVRABET_${_0x3a701a}`]||undefined;}export function isNonInteractive(_0x4068ab){const _0x4e81c7=a129_0x95ac;return!!(_0x4068ab[_0x4e81c7(0xe6)]||_0x4068ab['ci']||env('CI')===_0x4e81c7(0xdc)||process.env.CI===_0x4e81c7(0xdc)||!process['stdout']['isTTY']||!isStdinRawModeSupported());}function a129_0x13dd(){const _0x35d212=['1948984JsWnQP','24982PRTZAG','true','setRawMode','isRaw','isTTY','1247490fwJOdb','6213800SKrxva','49WjjeRo','101SeJGbM','stdin','3256164OZzZRl','nonInteractive','19922499eNGycw','9013896pHXNFf'];a129_0x13dd=function(){return _0x35d212;};return a129_0x13dd();}function isStdinRawModeSupported(){const _0x22461f=a129_0x95ac;if(!process[_0x22461f(0xe4)][_0x22461f(0xdf)])return![];try{const _0xb233ee=process[_0x22461f(0xe4)][_0x22461f(0xde)];return process[_0x22461f(0xe4)][_0x22461f(0xdd)](!![]),process[_0x22461f(0xe4)][_0x22461f(0xdd)](_0xb233ee??![]),!![];}catch{return![];}}
|
package/lib/utils/logger.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a130_0x239a89=a130_0x5068;(function(_0xf3ec2d,_0x59a6b5){const _0x3cfcfb=a130_0x5068,_0x355058=_0xf3ec2d();while(!![]){try{const _0x20b174=-parseInt(_0x3cfcfb(0xdf))/0x1+parseInt(_0x3cfcfb(0xf6))/0x2*(-parseInt(_0x3cfcfb(0xe4))/0x3)+-parseInt(_0x3cfcfb(0xe9))/0x4*(parseInt(_0x3cfcfb(0xf9))/0x5)+-parseInt(_0x3cfcfb(0xe5))/0x6*(parseInt(_0x3cfcfb(0xea))/0x7)+parseInt(_0x3cfcfb(0x107))/0x8*(-parseInt(_0x3cfcfb(0xf1))/0x9)+-parseInt(_0x3cfcfb(0x10b))/0xa+parseInt(_0x3cfcfb(0xf4))/0xb*(parseInt(_0x3cfcfb(0xf2))/0xc);if(_0x20b174===_0x59a6b5)break;else _0x355058['push'](_0x355058['shift']());}catch(_0x2571a2){_0x355058['push'](_0x355058['shift']());}}}(a130_0x3a30,0x2af16));import a130_0x13be7d from'winston';function a130_0x5068(_0x5bb719,_0x270122){_0x5bb719=_0x5bb719-0xda;const _0x3a302e=a130_0x3a30();let _0x5068de=_0x3a302e[_0x5bb719];return _0x5068de;}import a130_0x14b9ea from'node:fs';import a130_0x4e6d1c from'node:path';class Logger{['winstonLogger'];[a130_0x239a89(0x10c)];[a130_0x239a89(0xec)]='';constructor(){this['logFilePath']='';}['setRawCommand'](_0x4c4843){const _0x44e2bf=a130_0x239a89;this[_0x44e2bf(0xec)]=_0x4c4843;}[a130_0x239a89(0xfb)](){const _0x165322=a130_0x239a89,_0x5c5cc6=a130_0x4e6d1c[_0x165322(0xed)](this[_0x165322(0x10c)]);!a130_0x14b9ea['existsSync'](_0x5c5cc6)&&a130_0x14b9ea[_0x165322(0xe6)](_0x5c5cc6,{'recursive':!![]});const _0x17b6fc=a130_0x13be7d[_0x165322(0x10a)][_0x165322(0x103)](a130_0x13be7d['format'][_0x165322(0xee)](),a130_0x13be7d[_0x165322(0x10a)]['errors']({'stack':!![]}),a130_0x13be7d[_0x165322(0x10a)][_0x165322(0xe3)](_0x41c91e=>{const _0x5f1dd5=_0x165322,_0x1d4881={'timestamp':_0x41c91e[_0x5f1dd5(0xee)]||new Date()[_0x5f1dd5(0xe0)](),'level':_0x41c91e['level']||'info','command':_0x41c91e[_0x5f1dd5(0xde)]||'unknown','rawCommand':_0x41c91e['rawCommand']||this[_0x5f1dd5(0xec)]||undefined,'message':_0x41c91e['message']||'','duration':_0x41c91e['duration']||undefined,'details':_0x41c91e[_0x5f1dd5(0xfd)]||undefined};return JSON['stringify'](_0x1d4881);}));this[_0x165322(0xfa)]=a130_0x13be7d[_0x165322(0xe1)]({'level':'info','format':_0x17b6fc,'transports':[new a130_0x13be7d[(_0x165322(0x108))]['File']({'filename':this[_0x165322(0x10c)],'level':_0x165322(0x106)})],'silent':![]}),a130_0x13be7d[_0x165322(0xf7)]({'success':_0x165322(0xf0),'error':'red','warn':_0x165322(0xda),'info':_0x165322(0xf8)});}[a130_0x239a89(0x100)](_0x28b63b){const _0x4fccb9=a130_0x239a89;this[_0x4fccb9(0x10c)]=a130_0x4e6d1c[_0x4fccb9(0x101)](_0x28b63b,_0x4fccb9(0xe8)),this['winstonLogger']&&this[_0x4fccb9(0xfa)][_0x4fccb9(0xe2)](),this[_0x4fccb9(0xfb)]();}[a130_0x239a89(0x106)](_0xf04f2e,_0x3da89f,_0x5c9db5){const _0x3c4851=a130_0x239a89;if(!this[_0x3c4851(0x10c)]||!this[_0x3c4851(0xfa)])return;this[_0x3c4851(0xfa)][_0x3c4851(0x106)](_0x3da89f,{'command':_0xf04f2e,'details':_0x5c9db5});}[a130_0x239a89(0x104)](_0x2b5363,_0x3d8c1f,_0x483516,_0x4f658f){const _0x566d8f=a130_0x239a89;if(!this[_0x566d8f(0x10c)]||!this['winstonLogger'])return;this[_0x566d8f(0xfa)][_0x566d8f(0xff)](_0x566d8f(0x106),_0x3d8c1f,{'level':_0x566d8f(0x104),'command':_0x2b5363,'duration':_0x483516,'details':_0x4f658f});}[a130_0x239a89(0xdd)](_0x245462,_0x3e426c,_0x10c839){const _0x5ba7f9=a130_0x239a89;if(!this[_0x5ba7f9(0x10c)]||!this[_0x5ba7f9(0xfa)])return;this[_0x5ba7f9(0xfa)][_0x5ba7f9(0xdd)](_0x3e426c,{'command':_0x245462,'details':_0x10c839});}[a130_0x239a89(0xfc)](_0x534913,_0x253788,_0x2a3164){const _0xbd17e=a130_0x239a89;if(!this['logFilePath']||!this[_0xbd17e(0xfa)])return;this[_0xbd17e(0xfa)][_0xbd17e(0xfc)](_0x253788,{'command':_0x534913,'details':_0x2a3164});}async[a130_0x239a89(0xf3)](_0x236285,_0x10b2a3,_0x4b7f4f){const _0x10cd5a=a130_0x239a89,_0x129afa=Date[_0x10cd5a(0x109)]();this['info'](_0x236285,_0x10cd5a(0xf5)+_0x10b2a3);try{const _0x3f4b80=await _0x4b7f4f(),_0x477d08=Date[_0x10cd5a(0x109)]()-_0x129afa;return this[_0x10cd5a(0x104)](_0x236285,'完成:\x20'+_0x10b2a3,_0x477d08),_0x3f4b80;}catch(_0x10bf4b){const _0x192a39=Date[_0x10cd5a(0x109)]()-_0x129afa;this[_0x10cd5a(0xdd)](_0x236285,'失败:\x20'+_0x10b2a3,{'error':_0x10bf4b instanceof Error?_0x10bf4b[_0x10cd5a(0xdc)]:String(_0x10bf4b),'duration':_0x192a39});throw _0x10bf4b;}}['readLogs'](){const _0x2b660d=a130_0x239a89;try{if(!a130_0x14b9ea[_0x2b660d(0x102)](this[_0x2b660d(0x10c)]))return[];const _0xa2fa1a=a130_0x14b9ea[_0x2b660d(0xeb)](this[_0x2b660d(0x10c)],'utf8');return _0xa2fa1a['split']('\x0a')['filter'](_0x294a8=>_0x294a8['trim']())[_0x2b660d(0xdb)](_0x3a7a39=>JSON[_0x2b660d(0x105)](_0x3a7a39));}catch(_0x3b5e80){return console[_0x2b660d(0xfc)]('Failed\x20to\x20read\x20logs:',_0x3b5e80),[];}}['clearLogs'](){const _0x1bafc0=a130_0x239a89;try{a130_0x14b9ea[_0x1bafc0(0x102)](this[_0x1bafc0(0x10c)])&&a130_0x14b9ea[_0x1bafc0(0xef)](this[_0x1bafc0(0x10c)],'',_0x1bafc0(0xfe));}catch(_0xde588a){console[_0x1bafc0(0xfc)](_0x1bafc0(0xe7),_0xde588a);}}['getWinstonInstance'](){return this['winstonLogger'];}}function a130_0x3a30(){const _0x94bb51=['error','command','72294BLzFpU','toISOString','createLogger','clear','printf','9939QJlEGQ','6kPpTyy','mkdirSync','Failed\x20to\x20clear\x20logs:','.lovrabet.log','56852PFutDl','1439711uCSuzB','readFileSync','currentRawCommand','dirname','timestamp','writeFileSync','green','9WvKxny','15011148xrKfAT','logTask','11YDMjUh','开始执行:\x20','166ZiOrDA','addColors','blue','15ILfSzv','winstonLogger','initWinstonLogger','warn','details','utf8','log','setLogPath','join','existsSync','combine','success','parse','info','1061176cuoRcF','transports','now','format','3468030jKOTAE','logFilePath','yellow','map','message'];a130_0x3a30=function(){return _0x94bb51;};return a130_0x3a30();}export const logger=new Logger();
|
package/lib/utils/platform.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a131_0x38c4(_0x2aca59,_0x17e6d1){_0x2aca59=_0x2aca59-0xde;const _0x5c30c7=a131_0x5c30();let _0x38c43f=_0x5c30c7[_0x2aca59];return _0x38c43f;}const a131_0x1fd270=a131_0x38c4;(function(_0x113a1f,_0x18d20b){const _0xeec04b=a131_0x38c4,_0x75d508=_0x113a1f();while(!![]){try{const _0x162323=parseInt(_0xeec04b(0xe9))/0x1*(-parseInt(_0xeec04b(0xe4))/0x2)+parseInt(_0xeec04b(0xe7))/0x3+parseInt(_0xeec04b(0xe1))/0x4+parseInt(_0xeec04b(0xe0))/0x5*(-parseInt(_0xeec04b(0xe5))/0x6)+-parseInt(_0xeec04b(0xde))/0x7*(-parseInt(_0xeec04b(0xe8))/0x8)+-parseInt(_0xeec04b(0xe2))/0x9*(parseInt(_0xeec04b(0xdf))/0xa)+-parseInt(_0xeec04b(0xe3))/0xb;if(_0x162323===_0x18d20b)break;else _0x75d508['push'](_0x75d508['shift']());}catch(_0x56bd37){_0x75d508['push'](_0x75d508['shift']());}}}(a131_0x5c30,0x64d5a));export const isWindows=process['platform']===a131_0x1fd270(0xe6);function a131_0x5c30(){const _0x77409f=['15032IOAjiq','3UnnyCS','2779EMlzpH','885780OWXMri','855370nkOiki','1684788WyzMbi','27QPmkKo','6023435AEXhNW','224914UWCiUK','12QtWEUK','win32','2216088JIEfOy'];a131_0x5c30=function(){return _0x77409f;};return a131_0x5c30();}export function resolveNpmBin(_0x397246){return isWindows?_0x397246+'.cmd':_0x397246;}
|
package/lib/utils/rules-cdn.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
const a132_0x2c7d22=a132_0x3140;(function(_0x168f28,_0xee2e26){const _0x58723a=a132_0x3140,_0x3b4a28=_0x168f28();while(!![]){try{const _0x3ce885=-parseInt(_0x58723a(0xd9))/0x1*(parseInt(_0x58723a(0xdb))/0x2)+-parseInt(_0x58723a(0xcc))/0x3+parseInt(_0x58723a(0xd2))/0x4*(parseInt(_0x58723a(0xde))/0x5)+parseInt(_0x58723a(0xcf))/0x6+parseInt(_0x58723a(0xda))/0x7*(parseInt(_0x58723a(0xdd))/0x8)+parseInt(_0x58723a(0xcd))/0x9+-parseInt(_0x58723a(0xe1))/0xa;if(_0x3ce885===_0xee2e26)break;else _0x3b4a28['push'](_0x3b4a28['shift']());}catch(_0x3e93b2){_0x3b4a28['push'](_0x3b4a28['shift']());}}}(a132_0x3a21,0x310ab));import{existsSync,mkdirSync,readFileSync,writeFileSync}from'node:fs';import{dirname,join,resolve}from'node:path';import{fileURLToPath}from'node:url';import{getTemplateBaseUrl}from'./config.js';import{appendUpdateTime}from'./guides-cdn.js';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename);function a132_0x3140(_0x2127e4,_0x2fef26){_0x2127e4=_0x2127e4-0xc9;const _0x3a21b9=a132_0x3a21();let _0x31401c=_0x3a21b9[_0x2127e4];return _0x31401c;}function getRulesCdnUrl(){const _0xde5c65=a132_0x3140,_0x5817cf=getTemplateBaseUrl();return _0x5817cf+_0xde5c65(0xe2);}const LOCAL_TEMPLATE_PATH=resolve(__dirname,a132_0x2c7d22(0xcb));export async function fetchRulesFromCDN(){const _0x416829=a132_0x2c7d22,_0x3bb83e=getRulesCdnUrl(),_0x36f392=await fetch(_0x3bb83e,{'headers':{'Accept':_0x416829(0xd5)}});if(!_0x36f392['ok'])throw new Error(_0x416829(0xd6)+_0x36f392[_0x416829(0xd1)]+'\x20'+_0x36f392[_0x416829(0xc9)]);const _0x4016dd=await _0x36f392[_0x416829(0xdc)]();if(!_0x4016dd[_0x416829(0xd8)]||typeof _0x4016dd[_0x416829(0xd8)]!==_0x416829(0xdf))throw new Error(_0x416829(0xca));return _0x4016dd;}export async function getRulesContent(){const _0x5f3369=a132_0x2c7d22;try{const _0x134bee=await fetchRulesFromCDN();return _0x134bee[_0x5f3369(0xd8)];}catch{return readLocalTemplate();}}export function readLocalTemplate(){const _0x5cbba8=a132_0x2c7d22;if(existsSync(LOCAL_TEMPLATE_PATH))return readFileSync(LOCAL_TEMPLATE_PATH,_0x5cbba8(0xd0));throw new Error(_0x5cbba8(0xd3)+LOCAL_TEMPLATE_PATH);}function a132_0x3a21(){const _0x85714c=['39361aYoGIY','3714CZEBIF','json','568TKXMvM','55zayVss','string','catch','1685830kimDEL','/rules/rules.json','statusText','CDN\x20返回数据格式错误','../../templates/rules/lovrabet_rules.mdc.tpl','864444fHTNlL','2042190qzmIMb','.cursor/rules','67608nRwdPN','utf-8','status','85000CXBuub','本地模板文件不存在:\x20','lastUpdated','application/json','CDN\x20请求失败:\x20','agents.md','content','115jAcrKG'];a132_0x3a21=function(){return _0x85714c;};return a132_0x3a21();}export async function writeRulesFile(_0xa49da9){const _0x1168b9=a132_0x2c7d22,_0x2404f7=await fetchRulesFromCDN()[_0x1168b9(0xe0)](()=>null);let _0x485e82;_0x2404f7?(_0x485e82=_0x2404f7[_0x1168b9(0xd8)],_0x2404f7['lastUpdated']&&(_0x485e82=appendUpdateTime(_0x485e82,_0x2404f7[_0x1168b9(0xd4)]))):_0x485e82=readLocalTemplate();const _0xf3c1d3=dirname(_0xa49da9);!existsSync(_0xf3c1d3)&&mkdirSync(_0xf3c1d3,{'recursive':!![]}),writeFileSync(_0xa49da9,_0x485e82,_0x1168b9(0xd0));}export async function copyRulesToCursor(_0xae3937){const _0x2afafa=a132_0x2c7d22,_0x28f960=join(_0xae3937,_0x2afafa(0xce)),_0x53a88a=join(_0x28f960,'lovrabet_rules.mdc');if(existsSync(_0x53a88a))return![];return await writeRulesFile(_0x53a88a),!![];}export async function copyRulesToAgentsMd(_0x35414d){const _0x26b8da=a132_0x2c7d22,_0x4d8e48=join(_0x35414d,_0x26b8da(0xd7));if(existsSync(_0x4d8e48))return![];return await writeRulesFile(_0x4d8e48),!![];}
|
package/lib/utils/sleep.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export function sleep(
|
|
1
|
+
export function sleep(_0x54a7d4){return new Promise(_0x57a5c1=>setTimeout(_0x57a5c1,_0x54a7d4));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a134_0x35ed66=a134_0x3a0e;(function(_0x3e7f40,_0x537493){const _0x28c24d=a134_0x3a0e,_0x862481=_0x3e7f40();while(!![]){try{const _0x1b5a1d=-parseInt(_0x28c24d(0x1ab))/0x1+-parseInt(_0x28c24d(0x18a))/0x2+-parseInt(_0x28c24d(0x18b))/0x3+parseInt(_0x28c24d(0x1aa))/0x4+-parseInt(_0x28c24d(0x187))/0x5*(-parseInt(_0x28c24d(0x1a6))/0x6)+-parseInt(_0x28c24d(0x19c))/0x7+parseInt(_0x28c24d(0x185))/0x8*(parseInt(_0x28c24d(0x1a2))/0x9);if(_0x1b5a1d===_0x537493)break;else _0x862481['push'](_0x862481['shift']());}catch(_0x2a2539){_0x862481['push'](_0x862481['shift']());}}}(a134_0x2ebb,0x2d367));function a134_0x2ebb(){const _0xc4f488=['toISOString','success','2058363iCMGsC','split','toLocaleTimeString','replaceApiContent','72216SKqtTQ','replace','error','pop','1314504tEQKNw','295316zlJhdw','tableName','.json','writeFile','toLocaleDateString','endsWith','toLocaleString','\x20},','.jsx','utf8','readdir','datasetCode:\x20\x22','promises','numeric','push','name','processFile','now','readFile','2-digit','charAt','toUpperCase','mkdir','api','YourModel','开始处理模板内容替换','message','.css','slice','模板内容替换完成','16FZJNih','copyFile','85UVRUPf','processDirectory','toDisplayTitle','374084urTAdf','683094ABYsNs','isFile','LOVRABET','toComponentName','template','\x0a\x20\x20\x20\x20{\x20','includes','.scss','map','.md','.tpl','datasetCode','toLowerCase','.tsx','replaceContent','processTemplate','.js','667835NJLGFl','tableName:\x20\x22','alias','join'];a134_0x2ebb=function(){return _0xc4f488;};return a134_0x2ebb();}import a134_0xfa34ad from'node:fs';import a134_0x4b9670 from'node:path';function a134_0x3a0e(_0x2b6679,_0x5bda3f){_0x2b6679=_0x2b6679-0x16b;const _0x2ebb07=a134_0x2ebb();let _0x3a0ec6=_0x2ebb07[_0x2b6679];return _0x3a0ec6;}import{logger}from'./logger.js';import{getCliVersion}from'./version.js';const CLI_VERSION=getCliVersion();export class TemplateReplacer{static[a134_0x35ed66(0x18e)](_0x21cd7b){const _0x12e7d2=a134_0x35ed66,_0x144fd0=_0x21cd7b[_0x12e7d2(0x1a3)]('/')[_0x12e7d2(0x1a9)]()||_0x21cd7b;return _0x144fd0[_0x12e7d2(0x1a3)]('-')[_0x12e7d2(0x193)](_0x3489dd=>_0x3489dd[_0x12e7d2(0x17b)](0x0)['toUpperCase']()+_0x3489dd[_0x12e7d2(0x183)](0x1)['toLowerCase']())[_0x12e7d2(0x19f)]('');}static[a134_0x35ed66(0x189)](_0x3b5b1f){const _0x3036c9=a134_0x35ed66,_0x14a822=_0x3b5b1f[_0x3036c9(0x1a3)]('/')[_0x3036c9(0x1a9)]()||_0x3b5b1f;return _0x14a822[_0x3036c9(0x1a3)]('-')[_0x3036c9(0x193)](_0x551f3d=>_0x551f3d[_0x3036c9(0x17b)](0x0)[_0x3036c9(0x17c)]()+_0x551f3d[_0x3036c9(0x183)](0x1)[_0x3036c9(0x197)]())['join']('\x20');}static[a134_0x35ed66(0x199)](_0x41c2b1,_0x1ba6e0,_0x3716e0){const _0x149c33=a134_0x35ed66,_0x5c2cef=this[_0x149c33(0x18e)](_0x1ba6e0),_0x1d37c7=this[_0x149c33(0x189)](_0x1ba6e0),_0x4ba153=new Date(),_0x1f4a95=_0x4ba153[_0x149c33(0x16d)](undefined,{'year':_0x149c33(0x174),'month':_0x149c33(0x17a),'day':'2-digit','hour':_0x149c33(0x17a),'minute':'2-digit','second':_0x149c33(0x17a),'hour12':![]})['replace'](/\//g,'-'),_0x39dbcf=_0x4ba153[_0x149c33(0x16b)](undefined,{'year':_0x149c33(0x174),'month':_0x149c33(0x17a),'day':'2-digit'})['replace'](/\//g,'-'),_0x5a81c6=_0x4ba153[_0x149c33(0x1a4)](undefined,{'hour12':![]});let _0x11ea3a=_0x41c2b1[_0x149c33(0x1a7)](/\{CliVersion\}/g,CLI_VERSION)['replace'](/\{ComponentName\}/g,_0x5c2cef)[_0x149c33(0x1a7)](/\{DisplayTitle\}/g,_0x1d37c7)[_0x149c33(0x1a7)](/\{PageName\}/g,_0x1ba6e0)[_0x149c33(0x1a7)](/\{TemplateName\}/g,_0x3716e0)[_0x149c33(0x1a7)](/\{CreatedAt\}/g,_0x1f4a95)[_0x149c33(0x1a7)](/\{CreatedDate\}/g,_0x39dbcf)[_0x149c33(0x1a7)](/\{CreatedTime\}/g,_0x5a81c6);return _0x11ea3a;}static[a134_0x35ed66(0x1a5)](_0x501561,_0x4350b8,_0x4ba98c,_0x509184,_0x1b992d,_0x35c70c,_0x52d36d,_0x76032b){const _0x39b036=a134_0x35ed66,_0x41aea6=new Date(),_0x4ee418=_0x41aea6[_0x39b036(0x1a0)](),_0x434dc7=_0x4ba98c[_0x39b036(0x193)](_0x37c813=>{const _0x4acc97=_0x39b036,_0xd59083=[_0x4acc97(0x172)+_0x37c813[_0x4acc97(0x196)]+'\x22',_0x4acc97(0x19d)+_0x37c813[_0x4acc97(0x1ac)]+'\x22','name:\x20\x22'+_0x37c813['name']+'\x22'];return _0x37c813[_0x4acc97(0x19e)]&&_0xd59083[_0x4acc97(0x175)]('alias:\x20\x22'+_0x37c813[_0x4acc97(0x19e)]+'\x22'),_0x4acc97(0x190)+_0xd59083[_0x4acc97(0x19f)](',\x20')+_0x4acc97(0x16e);})[_0x39b036(0x19f)](''),_0x90913b=_0x509184||_0x4ba98c[0x0]?.[_0x39b036(0x19e)]||_0x39b036(0x17f);let _0x3926db=_0x501561[_0x39b036(0x1a7)](/\{AppCode\}/g,_0x4350b8)['replace'](/\{ModelConfigs\}/g,_0x434dc7)[_0x39b036(0x1a7)](/\{ExampleModelName\}/g,_0x90913b)[_0x39b036(0x1a7)](/\{ApiFileName\}/g,_0x1b992d||_0x39b036(0x17e))['replace'](/\{ConfigName\}/g,_0x35c70c||'default')[_0x39b036(0x1a7)](/\{ClientConfigParam\}/g,_0x52d36d||'')[_0x39b036(0x1a7)](/\{VarPrefix\}/g,_0x76032b||_0x39b036(0x18d))['replace'](/\{CreatedAt\}/g,_0x4ee418);return _0x3926db;}static async[a134_0x35ed66(0x19a)](_0x3f0b34,_0x35fddd,_0x4b11b2,_0xbddc3,_0x2ea13f=!![]){const _0x3e8879=a134_0x35ed66,_0x21e3d1=Date[_0x3e8879(0x178)]();try{_0x2ea13f&&logger['info']('template',_0x3e8879(0x180),{'templatePath':_0x3f0b34,'targetPath':_0x35fddd,'pageName':_0x4b11b2,'templateName':_0xbddc3});await a134_0xfa34ad[_0x3e8879(0x173)][_0x3e8879(0x17d)](_0x35fddd,{'recursive':!![]}),await this['processDirectory'](_0x3f0b34,_0x35fddd,_0x4b11b2,_0xbddc3);if(_0x2ea13f){const _0x4d517f=Date['now']()-_0x21e3d1;logger[_0x3e8879(0x1a1)](_0x3e8879(0x18f),_0x3e8879(0x184),_0x4d517f,{'pageName':_0x4b11b2,'templateName':_0xbddc3});}}catch(_0xf22747){if(_0x2ea13f){const _0x25d4dc=Date[_0x3e8879(0x178)]()-_0x21e3d1;logger[_0x3e8879(0x1a8)](_0x3e8879(0x18f),'模板内容替换失败',{'templatePath':_0x3f0b34,'targetPath':_0x35fddd,'pageName':_0x4b11b2,'templateName':_0xbddc3,'error':_0xf22747 instanceof Error?_0xf22747[_0x3e8879(0x181)]:String(_0xf22747),'duration':_0x25d4dc});}throw _0xf22747;}}static async[a134_0x35ed66(0x188)](_0x82b3d,_0x3d6fd9,_0x3d9fbc,_0x2b395b){const _0x1be4f6=a134_0x35ed66,_0x3333b1=await a134_0xfa34ad[_0x1be4f6(0x173)][_0x1be4f6(0x171)](_0x82b3d,{'withFileTypes':!![]});for(const _0xcd2057 of _0x3333b1){const _0x4ea76e=a134_0x4b9670[_0x1be4f6(0x19f)](_0x82b3d,_0xcd2057[_0x1be4f6(0x176)]);let _0x17b801=a134_0x4b9670[_0x1be4f6(0x19f)](_0x3d6fd9,_0xcd2057[_0x1be4f6(0x176)]);_0xcd2057[_0x1be4f6(0x176)][_0x1be4f6(0x16c)]('.tpl')&&(_0x17b801=a134_0x4b9670[_0x1be4f6(0x19f)](_0x3d6fd9,_0xcd2057[_0x1be4f6(0x176)][_0x1be4f6(0x1a7)](/\.tpl$/,'')));if(_0xcd2057['isDirectory']())await a134_0xfa34ad[_0x1be4f6(0x173)][_0x1be4f6(0x17d)](_0x17b801,{'recursive':!![]}),await this[_0x1be4f6(0x188)](_0x4ea76e,_0x17b801,_0x3d9fbc,_0x2b395b);else _0xcd2057[_0x1be4f6(0x18c)]()&&await this[_0x1be4f6(0x177)](_0x4ea76e,_0x17b801,_0x3d9fbc,_0x2b395b);}}static async[a134_0x35ed66(0x177)](_0x325cdf,_0x4c78fa,_0x156d07,_0x8a385d){const _0x1f615d=a134_0x35ed66,_0x42540f=a134_0x4b9670['extname'](_0x325cdf)[_0x1f615d(0x197)]();_0x325cdf['endsWith']('.tpl')&&(_0x4c78fa=_0x4c78fa[_0x1f615d(0x1a7)](/\.tpl$/,''));const _0x1e1202=[_0x1f615d(0x198),'.ts',_0x1f615d(0x16f),_0x1f615d(0x19b),_0x1f615d(0x1ad),_0x1f615d(0x194),_0x1f615d(0x182),_0x1f615d(0x192),_0x1f615d(0x195)];if(_0x1e1202[_0x1f615d(0x191)](_0x42540f)||_0x325cdf[_0x1f615d(0x16c)](_0x1f615d(0x195))){const _0x3cc683=await a134_0xfa34ad[_0x1f615d(0x173)][_0x1f615d(0x179)](_0x325cdf,'utf8'),_0x5582be=this[_0x1f615d(0x199)](_0x3cc683,_0x156d07,_0x8a385d);await a134_0xfa34ad['promises'][_0x1f615d(0x1ae)](_0x4c78fa,_0x5582be,_0x1f615d(0x170));}else await a134_0xfa34ad['promises'][_0x1f615d(0x186)](_0x325cdf,_0x4c78fa);}}
|
package/lib/utils/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a135_0x5082(_0x25e265,_0x4fb69e){_0x25e265=_0x25e265-0xc5;var _0x42bd91=a135_0x42bd();var _0x50822c=_0x42bd91[_0x25e265];return _0x50822c;}(function(_0x416215,_0x26a32d){var _0x1519f5=a135_0x5082,_0x8d8a06=_0x416215();while(!![]){try{var _0x19e16b=parseInt(_0x1519f5(0xc7))/0x1+-parseInt(_0x1519f5(0xc8))/0x2*(parseInt(_0x1519f5(0xca))/0x3)+parseInt(_0x1519f5(0xcc))/0x4*(-parseInt(_0x1519f5(0xcf))/0x5)+-parseInt(_0x1519f5(0xce))/0x6+-parseInt(_0x1519f5(0xc9))/0x7*(parseInt(_0x1519f5(0xc5))/0x8)+parseInt(_0x1519f5(0xcb))/0x9*(parseInt(_0x1519f5(0xcd))/0xa)+parseInt(_0x1519f5(0xc6))/0xb;if(_0x19e16b===_0x26a32d)break;else _0x8d8a06['push'](_0x8d8a06['shift']());}catch(_0x85bc6){_0x8d8a06['push'](_0x8d8a06['shift']());}}}(a135_0x42bd,0x7a119));function a135_0x42bd(){var _0x4d7ddd=['11981wuVgpe','14BUWDER','25928WyDpoO','312789MhzVCi','821025IzirGg','12ijfmxc','10bCuPEI','3568092hbrTiY','1284345uavXDu','1560gTWwBC','35356167DhQIdp'];a135_0x42bd=function(){return _0x4d7ddd;};return a135_0x42bd();}import{VERSION}from'../generated/build-info.js';export function getCliVersion(){return VERSION;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x6efd7d,_0x45aace){var _0xb1c40a=a136_0x1153,_0x3bf02f=_0x6efd7d();while(!![]){try{var _0x458bde=parseInt(_0xb1c40a(0x14f))/0x1+-parseInt(_0xb1c40a(0x156))/0x2*(parseInt(_0xb1c40a(0x152))/0x3)+-parseInt(_0xb1c40a(0x157))/0x4*(-parseInt(_0xb1c40a(0x158))/0x5)+-parseInt(_0xb1c40a(0x154))/0x6*(-parseInt(_0xb1c40a(0x151))/0x7)+-parseInt(_0xb1c40a(0x150))/0x8+parseInt(_0xb1c40a(0x159))/0x9*(-parseInt(_0xb1c40a(0x155))/0xa)+parseInt(_0xb1c40a(0x153))/0xb;if(_0x458bde===_0x45aace)break;else _0x3bf02f['push'](_0x3bf02f['shift']());}catch(_0x18fdeb){_0x3bf02f['push'](_0x3bf02f['shift']());}}}(a136_0x4b93,0xc343f));import{setActiveCookie,clearActiveCookie}from'../core/api-client.js';function a136_0x4b93(){var _0x337155=['12742994VNJMpM','516198rzLIIO','391680QEryhY','12BCrBSB','29904ygqjkp','450vRiOiL','18enFJIS','243650YnJShK','9249632AOKZru','49crKguP','321414CuVSMb'];a136_0x4b93=function(){return _0x337155;};return a136_0x4b93();}function a136_0x1153(_0x22d2a9,_0x5448f0){_0x22d2a9=_0x22d2a9-0x14f;var _0x4b93f9=a136_0x4b93();var _0x115324=_0x4b93f9[_0x22d2a9];return _0x115324;}export async function withActiveCookie(_0x3e6c7a,_0x1c28bb){setActiveCookie(_0x3e6c7a);try{return await _0x1c28bb();}finally{clearActiveCookie();}}
|
package/package.json
CHANGED