@lovrabet/lovrabet-cli 2.1.2 → 2.1.3-beta.1
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/cli.js +1 -1
- package/lib/commands/api-doc/index.js +1 -1
- package/lib/commands/app/cache.js +1 -1
- package/lib/commands/app/definitions.js +1 -1
- package/lib/commands/app/eligibility.js +1 -1
- package/lib/commands/app/mock-loader.js +1 -1
- package/lib/commands/app/remote-source.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/artifact/index.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/auth/prompt.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/exec.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/common/config-policy.js +1 -1
- package/lib/commands/common/constraints.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/config/definitions.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/sdk-doc.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/personal-bff/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/service/dynamic.js +1 -1
- package/lib/commands/service/index.js +1 -1
- package/lib/commands/service/registry.js +1 -1
- package/lib/commands/skill/commands/create.js +1 -0
- package/lib/commands/skill/commands/install.js +1 -0
- package/lib/commands/skill/commands/list.js +1 -0
- package/lib/commands/skill/commands/push.js +1 -0
- package/lib/commands/skill/commands/validate.js +1 -0
- package/lib/commands/skill/flags.js +1 -0
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/skill/manifest-helpers.js +1 -0
- package/lib/commands/skill/scopes.js +1 -0
- package/lib/commands/skill/summary.js +1 -0
- package/lib/commands/skill/templates.js +1 -1
- package/lib/commands/skill/validate.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/update.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/app.js +1 -1
- package/lib/constant/auth-mode.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/distribution.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/product.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.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/preparse.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-confirmation.js +1 -1
- package/lib/framework/runner-error.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.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/skills/npx-skills-add.js +1 -1
- package/lib/skills/runtime-skill-sync/constants.js +1 -0
- package/lib/skills/runtime-skill-sync/fs-utils.js +1 -0
- package/lib/skills/runtime-skill-sync/hashing.js +1 -0
- package/lib/skills/runtime-skill-sync/links.js +1 -0
- package/lib/skills/runtime-skill-sync/list-local.js +1 -0
- package/lib/skills/runtime-skill-sync/local-files.js +1 -0
- package/lib/skills/runtime-skill-sync/materialize.js +1 -0
- package/lib/skills/runtime-skill-sync/metadata.js +1 -0
- package/lib/skills/runtime-skill-sync/paths.js +1 -0
- package/lib/skills/runtime-skill-sync/push.js +1 -0
- package/lib/skills/runtime-skill-sync/scopes.js +1 -0
- package/lib/skills/runtime-skill-sync/types.js +1 -0
- package/lib/skills/runtime-skill-sync/zip-codec.js +1 -0
- package/lib/skills/runtime-skill-sync/zip-package.js +1 -0
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +4 -1
package/lib/utils/logger.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a101_0x30aa(_0x36deb9,_0x3dc289){_0x36deb9=_0x36deb9-0x7c;const _0x52c4b7=a101_0x52c4();let _0x30aa74=_0x52c4b7[_0x36deb9];return _0x30aa74;}function a101_0x52c4(){const _0x597f58=['details','mkdirSync','transports','parse','addColors','1903685EHSasw','blue','444530YiAgEI','459812AMNYbl','utf8','timestamp','Completed:\x20','rawCommand','writeFileSync','logFileName','warn','info','6hSIkEu','duration','green','yellow','readFileSync','level','winstonLogger','9vpPHyd','command','success','dirname','filter','File','error','split','map','red','message','combine','format','existsSync','clear','logFilePath','Failed\x20to\x20read\x20logs:','currentRawCommand','errors','Starting:\x20','toISOString','readLogs','180702QCQaMg','join','unknown','now','Failed:\x20','361864FPOkgD','201611cMSKPw','getWinstonInstance','6214952aEXmLG','printf'];a101_0x52c4=function(){return _0x597f58;};return a101_0x52c4();}const a101_0x5601f9=a101_0x30aa;(function(_0x424db6,_0x1de299){const _0x4b38b0=a101_0x30aa,_0x4ac279=_0x424db6();while(!![]){try{const _0xa54c00=parseInt(_0x4b38b0(0x8b))/0x1+parseInt(_0x4b38b0(0x8a))/0x2+parseInt(_0x4b38b0(0x85))/0x3+parseInt(_0x4b38b0(0x97))/0x4+parseInt(_0x4b38b0(0x96))/0x5*(parseInt(_0x4b38b0(0xa0))/0x6)+parseInt(_0x4b38b0(0x94))/0x7+parseInt(_0x4b38b0(0x8d))/0x8*(-parseInt(_0x4b38b0(0xa7))/0x9);if(_0xa54c00===_0x1de299)break;else _0x4ac279['push'](_0x4ac279['shift']());}catch(_0x463766){_0x4ac279['push'](_0x4ac279['shift']());}}}(a101_0x52c4,0x2299a));import a101_0x43c560 from'winston';import a101_0x1b8f80 from'node:fs';import a101_0x3b5eba from'node:path';import{PRODUCT_CONFIG}from'../constant/product.js';class Logger{[a101_0x5601f9(0xa6)];[a101_0x5601f9(0x7e)]='';[a101_0x5601f9(0x80)]='';constructor(){}['setRawCommand'](_0x357ca6){const _0x252476=a101_0x5601f9;this[_0x252476(0x80)]=_0x357ca6;}['setLogPath'](_0x516d48){const _0x3a8198=a101_0x5601f9;this[_0x3a8198(0x7e)]=a101_0x3b5eba[_0x3a8198(0x86)](_0x516d48,PRODUCT_CONFIG[_0x3a8198(0x9d)]),this[_0x3a8198(0xa6)]&&this[_0x3a8198(0xa6)][_0x3a8198(0x7d)](),this['initWinstonLogger']();}['initWinstonLogger'](){const _0x74d1e7=a101_0x5601f9,_0x269b69=a101_0x3b5eba[_0x74d1e7(0xaa)](this[_0x74d1e7(0x7e)]);!a101_0x1b8f80[_0x74d1e7(0x7c)](_0x269b69)&&a101_0x1b8f80[_0x74d1e7(0x90)](_0x269b69,{'recursive':!![]});const _0x4fa0a9=a101_0x43c560[_0x74d1e7(0xb3)][_0x74d1e7(0xb2)](a101_0x43c560['format'][_0x74d1e7(0x99)](),a101_0x43c560[_0x74d1e7(0xb3)][_0x74d1e7(0x81)]({'stack':!![]}),a101_0x43c560[_0x74d1e7(0xb3)][_0x74d1e7(0x8e)](_0x9a22=>{const _0x4c16ae=_0x74d1e7,_0x1dcca7={'timestamp':_0x9a22['timestamp']||new Date()[_0x4c16ae(0x83)](),'level':_0x9a22[_0x4c16ae(0xa5)]||_0x4c16ae(0x9f),'command':_0x9a22[_0x4c16ae(0xa8)]||_0x4c16ae(0x87),'rawCommand':_0x9a22[_0x4c16ae(0x9b)]||this[_0x4c16ae(0x80)]||undefined,'message':_0x9a22['message']||'','duration':_0x9a22[_0x4c16ae(0xa1)]||undefined,'details':_0x9a22[_0x4c16ae(0x8f)]||undefined};return JSON['stringify'](_0x1dcca7);}));this[_0x74d1e7(0xa6)]=a101_0x43c560['createLogger']({'level':'info','format':_0x4fa0a9,'transports':[new a101_0x43c560[(_0x74d1e7(0x91))][(_0x74d1e7(0xac))]({'filename':this[_0x74d1e7(0x7e)],'level':'info'})],'silent':![]}),a101_0x43c560[_0x74d1e7(0x93)]({'success':_0x74d1e7(0xa2),'error':_0x74d1e7(0xb0),'warn':_0x74d1e7(0xa3),'info':_0x74d1e7(0x95)});}[a101_0x5601f9(0x9f)](_0x50f4fb,_0x425cab,_0x36f38b){const _0x21f5b1=a101_0x5601f9;if(!this[_0x21f5b1(0x7e)]||!this[_0x21f5b1(0xa6)])return;this[_0x21f5b1(0xa6)]['info'](_0x425cab,{'command':_0x50f4fb,'details':_0x36f38b});}[a101_0x5601f9(0xa9)](_0x50acab,_0x47abb3,_0x3e1730,_0x162f5e){const _0x139759=a101_0x5601f9;if(!this['logFilePath']||!this[_0x139759(0xa6)])return;this[_0x139759(0xa6)]['log'](_0x139759(0x9f),_0x47abb3,{'level':'success','command':_0x50acab,'duration':_0x3e1730,'details':_0x162f5e});}[a101_0x5601f9(0xad)](_0x4508cc,_0x202171,_0x42b521){const _0x5aa635=a101_0x5601f9;if(!this['logFilePath']||!this[_0x5aa635(0xa6)])return;this[_0x5aa635(0xa6)][_0x5aa635(0xad)](_0x202171,{'command':_0x4508cc,'details':_0x42b521});}[a101_0x5601f9(0x9e)](_0x4d80d0,_0x207da0,_0x562b91){const _0x36c9ec=a101_0x5601f9;if(!this[_0x36c9ec(0x7e)]||!this[_0x36c9ec(0xa6)])return;this[_0x36c9ec(0xa6)][_0x36c9ec(0x9e)](_0x207da0,{'command':_0x4d80d0,'details':_0x562b91});}async['logTask'](_0x11fa3a,_0x281495,_0xf2f95d){const _0xcce67a=a101_0x5601f9,_0x59dd01=Date[_0xcce67a(0x88)]();this[_0xcce67a(0x9f)](_0x11fa3a,_0xcce67a(0x82)+_0x281495);try{const _0x27a0da=await _0xf2f95d(),_0x177262=Date[_0xcce67a(0x88)]()-_0x59dd01;return this[_0xcce67a(0xa9)](_0x11fa3a,_0xcce67a(0x9a)+_0x281495,_0x177262),_0x27a0da;}catch(_0x1ef87c){const _0x24e8c3=Date['now']()-_0x59dd01;this[_0xcce67a(0xad)](_0x11fa3a,_0xcce67a(0x89)+_0x281495,{'error':_0x1ef87c instanceof Error?_0x1ef87c[_0xcce67a(0xb1)]:String(_0x1ef87c),'duration':_0x24e8c3});throw _0x1ef87c;}}[a101_0x5601f9(0x84)](){const _0x24a2ab=a101_0x5601f9;try{if(!a101_0x1b8f80['existsSync'](this[_0x24a2ab(0x7e)]))return[];const _0x290ac4=a101_0x1b8f80[_0x24a2ab(0xa4)](this[_0x24a2ab(0x7e)],_0x24a2ab(0x98));return _0x290ac4[_0x24a2ab(0xae)](/\r?\n/)[_0x24a2ab(0xab)](_0x4af9af=>_0x4af9af['trim']())[_0x24a2ab(0xaf)](_0xad9226=>JSON[_0x24a2ab(0x92)](_0xad9226));}catch(_0x805d3){return console['warn'](_0x24a2ab(0x7f),_0x805d3),[];}}['clearLogs'](){const _0x22128d=a101_0x5601f9;try{a101_0x1b8f80['existsSync'](this[_0x22128d(0x7e)])&&a101_0x1b8f80[_0x22128d(0x9c)](this[_0x22128d(0x7e)],'','utf8');}catch(_0x5e551e){console[_0x22128d(0x9e)]('Failed\x20to\x20clear\x20logs:',_0x5e551e);}}[a101_0x5601f9(0x8c)](){const _0x1496c2=a101_0x5601f9;return this[_0x1496c2(0xa6)];}}export const logger=new Logger();
|
package/lib/utils/params.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x277e56,_0x24762f){var _0x385b1d=a102_0x2af0,_0x4017ea=_0x277e56();while(!![]){try{var _0x1e7500=-parseInt(_0x385b1d(0x8f))/0x1*(parseInt(_0x385b1d(0x9d))/0x2)+-parseInt(_0x385b1d(0x92))/0x3+-parseInt(_0x385b1d(0x98))/0x4*(-parseInt(_0x385b1d(0x94))/0x5)+parseInt(_0x385b1d(0x96))/0x6*(-parseInt(_0x385b1d(0x97))/0x7)+parseInt(_0x385b1d(0x9e))/0x8*(-parseInt(_0x385b1d(0x9f))/0x9)+-parseInt(_0x385b1d(0x90))/0xa*(-parseInt(_0x385b1d(0x9c))/0xb)+parseInt(_0x385b1d(0x91))/0xc*(parseInt(_0x385b1d(0x95))/0xd);if(_0x1e7500===_0x24762f)break;else _0x4017ea['push'](_0x4017ea['shift']());}catch(_0x16dda2){_0x4017ea['push'](_0x4017ea['shift']());}}}(a102_0x45f6,0xbc5fb));import{CliErrors}from'../errors.js';export function parseJsonParams(_0x4fab8e){var _0x50f552=a102_0x2af0;if(!_0x4fab8e)return undefined;try{return JSON[_0x50f552(0xa2)](_0x4fab8e);}catch{throw CliErrors['validation'](_0x50f552(0xa0)+_0x4fab8e);}}function a102_0x2af0(_0x2acf12,_0x4aee4d){_0x2acf12=_0x2acf12-0x8f;var _0x45f6b7=a102_0x45f6();var _0x2af003=_0x45f6b7[_0x2acf12];return _0x2af003;}function a102_0x45f6(){var _0x50cd29=['Invalid\x20JSON\x20for\x20--params:\x20','validation','parse','536QdpJpI','4342390AWGVSU','12uyQiYQ','3641988QJVvNW','isArray','29285ziKvit','39618787NsVWFe','348fmWYUi','77357vfPpDN','460YjFhvL','object','batchCreate\x20--params\x20must\x20be\x20a\x20JSON\x20array\x20or\x20{\x22items\x22:[...]}','Example:\x20--params\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27','11ZBxCKr','1086OQjiIT','1424iVBOLZ','62586CJxZwh'];a102_0x45f6=function(){return _0x50cd29;};return a102_0x45f6();}export function parseJsonParamsValue(_0x53adf1){var _0x199d9d=a102_0x2af0;if(!_0x53adf1)return undefined;try{return JSON['parse'](_0x53adf1);}catch{throw CliErrors[_0x199d9d(0xa1)](_0x199d9d(0xa0)+_0x53adf1);}}export function parseBatchCreateItemsFromParams(_0x1ad605){var _0x2f430a=a102_0x2af0;if(Array[_0x2f430a(0x93)](_0x1ad605))return _0x1ad605;if(_0x1ad605!==null&&_0x1ad605!==undefined&&typeof _0x1ad605===_0x2f430a(0x99)&&Array[_0x2f430a(0x93)](_0x1ad605['items']))return _0x1ad605['items'];throw CliErrors[_0x2f430a(0xa1)](_0x2f430a(0x9a),_0x2f430a(0x9b));}
|
package/lib/utils/platform.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a103_0x835f62=a103_0x5664;function a103_0x5664(_0x1052cf,_0x2997f6){_0x1052cf=_0x1052cf-0x1ae;const _0x22d2c1=a103_0x22d2();let _0x5664cf=_0x22d2c1[_0x1052cf];return _0x5664cf;}(function(_0x38825e,_0x16121f){const _0x37a9a8=a103_0x5664,_0x3579b1=_0x38825e();while(!![]){try{const _0x3e6479=parseInt(_0x37a9a8(0x1b5))/0x1+-parseInt(_0x37a9a8(0x1b1))/0x2+-parseInt(_0x37a9a8(0x1b3))/0x3*(parseInt(_0x37a9a8(0x1b2))/0x4)+-parseInt(_0x37a9a8(0x1b4))/0x5*(parseInt(_0x37a9a8(0x1b6))/0x6)+parseInt(_0x37a9a8(0x1af))/0x7*(parseInt(_0x37a9a8(0x1ae))/0x8)+parseInt(_0x37a9a8(0x1b8))/0x9+parseInt(_0x37a9a8(0x1b0))/0xa;if(_0x3e6479===_0x16121f)break;else _0x3579b1['push'](_0x3579b1['shift']());}catch(_0x420187){_0x3579b1['push'](_0x3579b1['shift']());}}}(a103_0x22d2,0xf3623));function a103_0x22d2(){const _0x4bdf29=['657kQaOVW','95XYYpWX','447116RhpZZZ','520218auHJHx','win32','13649553PawRPU','.cmd','platform','56ifLLOV','101899POuAJe','10270280hWsYOU','160530FaSfNh','6724MHirGy'];a103_0x22d2=function(){return _0x4bdf29;};return a103_0x22d2();}export const isWindows=process[a103_0x835f62(0x1ba)]===a103_0x835f62(0x1b7);export function resolveNpmBin(_0x491fdb){const _0x16b635=a103_0x835f62;return isWindows?_0x491fdb+_0x16b635(0x1b9):_0x491fdb;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5574c4,_0x5422ef){const _0x41748f=a104_0x31e7,_0x13b093=_0x5574c4();while(!![]){try{const _0x761ac0=parseInt(_0x41748f(0xe4))/0x1*(-parseInt(_0x41748f(0xea))/0x2)+-parseInt(_0x41748f(0xd0))/0x3*(-parseInt(_0x41748f(0xd7))/0x4)+-parseInt(_0x41748f(0xe6))/0x5*(-parseInt(_0x41748f(0xe3))/0x6)+-parseInt(_0x41748f(0xe9))/0x7*(-parseInt(_0x41748f(0xd2))/0x8)+parseInt(_0x41748f(0xef))/0x9+-parseInt(_0x41748f(0xde))/0xa*(parseInt(_0x41748f(0xdc))/0xb)+-parseInt(_0x41748f(0xee))/0xc;if(_0x761ac0===_0x5422ef)break;else _0x13b093['push'](_0x13b093['shift']());}catch(_0x305d4d){_0x13b093['push'](_0x13b093['shift']());}}}(a104_0x1513,0xa5b7d));import{mkdir,readFile,writeFile}from'node:fs/promises';import{homedir}from'node:os';function a104_0x1513(){const _0x127c49=['true','now','lovrabet-cli','4jqKbkQ','lastNotifiedAt','.cache','utf8','lastNotifiedVersion','11MliMfb','yes','2257910MQjdJn','timeout','patch','map','minor','4990926bbGcOk','471VDHnuk','entries','5FiCaCr','https://www.npmjs.com/package/','parse','943873tShNyY','3642QDmKTZ','checkedAt','latest','filter','16740516zYQLxX','1808307sMnoEK','major','trim','Invalid\x20semver','\x20available,\x20current\x20','2733033FXbjQG','number','72btpHuP','prerelease'];a104_0x1513=function(){return _0x127c49;};return a104_0x1513();}import{dirname,join}from'node:path';import{LOVRABET_NPM_PACKAGE_NAME,NPM_REGISTRY_BASE_URL}from'../constant/distribution.js';import{CLI_BIN_NAME}from'../constant/cli.js';function a104_0x31e7(_0x54bf57,_0x424b4e){_0x54bf57=_0x54bf57-0xd0;const _0x151352=a104_0x1513();let _0x31e72f=_0x151352[_0x54bf57];return _0x31e72f;}import{getCliVersion}from'../utils/version.js';const UPDATE_CHECK_TTL_MS=0xc*0x3c*0x3c*0x3e8,UPDATE_NOTICE_TTL_MS=0x18*0x3c*0x3c*0x3e8;function parseSemver(_0x4952c8){const _0x8f1b6a=a104_0x31e7,_0xeb99fc=_0x4952c8[_0x8f1b6a(0xf1)]()['match'](/^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?$/);if(!_0xeb99fc)return null;return{'major':Number(_0xeb99fc[0x1]),'minor':Number(_0xeb99fc[0x2]),'patch':Number(_0xeb99fc[0x3]),'prerelease':_0xeb99fc[0x4]};}function compareSemver(_0x5df708,_0x27a3c1){const _0x2850e7=a104_0x31e7,_0x397d41=parseSemver(_0x5df708),_0xf04d66=parseSemver(_0x27a3c1);if(!_0x397d41||!_0xf04d66)throw new Error(_0x2850e7(0xf2));for(const _0x1a48d7 of[_0x2850e7(0xf0),_0x2850e7(0xe2),_0x2850e7(0xe0)]){if(_0x397d41[_0x1a48d7]<_0xf04d66[_0x1a48d7])return-0x1;if(_0x397d41[_0x1a48d7]>_0xf04d66[_0x1a48d7])return 0x1;}if(!_0x397d41['prerelease']&&!_0xf04d66[_0x2850e7(0xd3)])return 0x0;if(!_0x397d41['prerelease'])return 0x1;if(!_0xf04d66[_0x2850e7(0xd3)])return-0x1;if(_0x397d41['prerelease']===_0xf04d66[_0x2850e7(0xd3)])return 0x0;return _0x397d41[_0x2850e7(0xd3)]<_0xf04d66['prerelease']?-0x1:0x1;}function isUpdateNoticeDisabled(){const _0x327982=a104_0x31e7,_0x42d26f=process.env.LOVRABET_NO_UPDATE_NOTICE?.[_0x327982(0xf1)]()['toLowerCase']();return _0x42d26f==='1'||_0x42d26f===_0x327982(0xd4)||_0x42d26f===_0x327982(0xdd);}function cacheRoot(){const _0x5b45df=a104_0x31e7;return process.env.XDG_CACHE_HOME||process.env.LOCALAPPDATA||join(homedir(),_0x5b45df(0xd9));}export function getUpdateNoticeCachePath(){const _0x463905=a104_0x31e7;return join(cacheRoot(),_0x463905(0xd6),'update-check.json');}async function readUpdateNoticeCache(){const _0x1e9d21=a104_0x31e7;try{const _0x52dc5b=await readFile(getUpdateNoticeCachePath(),_0x1e9d21(0xda)),_0x5c737b=JSON[_0x1e9d21(0xe8)](_0x52dc5b);if(!_0x5c737b||typeof _0x5c737b!=='object')return{};return _0x5c737b;}catch{return{};}}async function writeUpdateNoticeCache(_0x583bb8){const _0x554897=a104_0x31e7;try{const _0x97395b=getUpdateNoticeCachePath();await mkdir(dirname(_0x97395b),{'recursive':!![]}),await writeFile(_0x97395b,JSON['stringify'](_0x583bb8,null,0x2)+'\x0a',_0x554897(0xda));}catch{}}function isFreshCheck(_0x273169,_0x542008){const _0x4278e4=a104_0x31e7;return typeof _0x273169['checkedAt']==='number'&&_0x542008-_0x273169[_0x4278e4(0xeb)]<UPDATE_CHECK_TTL_MS;}function isRecentlyNotified(_0x52ca72,_0x4f693d,_0x4a9d77){const _0x251748=a104_0x31e7;return _0x52ca72[_0x251748(0xdb)]===_0x4f693d&&typeof _0x52ca72[_0x251748(0xd8)]===_0x251748(0xd1)&&_0x4a9d77-_0x52ca72[_0x251748(0xd8)]<UPDATE_NOTICE_TTL_MS;}async function fetchNpmDistTags(_0x19209b=0x5dc){const _0x2ee0ff=a104_0x31e7;try{const _0x27622b=NPM_REGISTRY_BASE_URL+'/-/package/'+encodeURIComponent(LOVRABET_NPM_PACKAGE_NAME)+'/dist-tags',_0x4c2ac4=await fetch(_0x27622b,{'signal':AbortSignal[_0x2ee0ff(0xdf)](_0x19209b)});if(!_0x4c2ac4['ok'])return null;const _0xf3b1f0=await _0x4c2ac4['json']();if(!_0xf3b1f0||typeof _0xf3b1f0!=='object')return null;return Object['fromEntries'](Object[_0x2ee0ff(0xe5)](_0xf3b1f0)[_0x2ee0ff(0xed)](([,_0x5aecec])=>typeof _0x5aecec==='string'&&_0x5aecec['trim']())[_0x2ee0ff(0xe1)](([_0x9d101a,_0x9dffbf])=>[_0x9d101a,String(_0x9dffbf)[_0x2ee0ff(0xf1)]()]));}catch{return null;}}export function buildNpmVersionUrl(_0x44c925){const _0x475163=a104_0x31e7;return _0x475163(0xe7)+LOVRABET_NPM_PACKAGE_NAME+'/v/'+_0x44c925;}export async function resolveLatestUpdateNotice(){const _0x1ad0a0=a104_0x31e7;if(isUpdateNoticeDisabled())return null;try{const _0xef77be=Date[_0x1ad0a0(0xd5)](),_0x58e144=getCliVersion(),_0xaca3d8=await readUpdateNoticeCache();let _0x375799=isFreshCheck(_0xaca3d8,_0xef77be)?_0xaca3d8[_0x1ad0a0(0xec)]?.[_0x1ad0a0(0xf1)]():undefined;if(!_0x375799&&!isFreshCheck(_0xaca3d8,_0xef77be)){const _0x2c8283=await fetchNpmDistTags();_0x375799=_0x2c8283?.['latest']?.[_0x1ad0a0(0xf1)](),await writeUpdateNoticeCache({..._0xaca3d8,'checkedAt':_0xef77be,'latest':_0x375799,'failed':!_0x375799});}if(!_0x375799||compareSemver(_0x58e144,_0x375799)>=0x0)return null;if(isRecentlyNotified(_0xaca3d8,_0x375799,_0xef77be))return null;const _0x46b075=CLI_BIN_NAME+'\x20update';return await writeUpdateNoticeCache({..._0xaca3d8,'checkedAt':isFreshCheck(_0xaca3d8,_0xef77be)?_0xaca3d8['checkedAt']:_0xef77be,'latest':_0x375799,'failed':![],'lastNotifiedVersion':_0x375799,'lastNotifiedAt':_0xef77be}),{'command':_0x46b075,'current':_0x58e144,'latest':_0x375799,'url':buildNpmVersionUrl(_0x375799),'message':CLI_BIN_NAME+'\x20'+_0x375799+_0x1ad0a0(0xf3)+_0x58e144+',\x20run:\x20'+_0x46b075};}catch{return null;}}
|
package/lib/utils/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a105_0x104c(_0x1e9ea0,_0x491e33){_0x1e9ea0=_0x1e9ea0-0x173;const _0x5b8751=a105_0x5b87();let _0x104c2f=_0x5b8751[_0x1e9ea0];return _0x104c2f;}(function(_0x2338d1,_0x5062d3){const _0x2782a2=a105_0x104c,_0x4ce063=_0x2338d1();while(!![]){try{const _0x5af4a1=parseInt(_0x2782a2(0x178))/0x1+-parseInt(_0x2782a2(0x17f))/0x2+parseInt(_0x2782a2(0x179))/0x3*(-parseInt(_0x2782a2(0x17a))/0x4)+parseInt(_0x2782a2(0x17c))/0x5*(parseInt(_0x2782a2(0x17d))/0x6)+-parseInt(_0x2782a2(0x177))/0x7+-parseInt(_0x2782a2(0x175))/0x8*(-parseInt(_0x2782a2(0x173))/0x9)+parseInt(_0x2782a2(0x17e))/0xa*(-parseInt(_0x2782a2(0x176))/0xb);if(_0x5af4a1===_0x5062d3)break;else _0x4ce063['push'](_0x4ce063['shift']());}catch(_0x277e4c){_0x4ce063['push'](_0x4ce063['shift']());}}}(a105_0x5b87,0xf14f3));import{BUILD_TIME,GIT_COMMIT,VERSION}from'../generated/build-info.js';export function getCliVersion(){return VERSION;}export function getCliGitCommit(){const _0x4a6149=a105_0x104c,_0xe1d233=String(GIT_COMMIT);return _0xe1d233&&_0xe1d233!==_0x4a6149(0x17b)?_0xe1d233:'';}export function getCliVersionDisplay(){const _0x40b9f6=a105_0x104c,_0x2e7de4=getCliGitCommit(),_0x20b45d=BUILD_TIME[_0x40b9f6(0x174)](0x0,0xa);if(!_0x2e7de4||!_0x20b45d)return VERSION;return VERSION+'\x20('+_0x2e7de4+',\x20'+_0x20b45d+')';}function a105_0x5b87(){const _0x3a9fe6=['4rvwyQQ','unknown','125oxOPJK','344118jIRvZu','43570ODqlVj','2402006EVbaBc','97263PaHINv','slice','1448dylQqk','308NXCYyP','13552784VLljWc','1527770GwIfbF','2010444vWgEaJ'];a105_0x5b87=function(){return _0x3a9fe6;};return a105_0x5b87();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x38deab,_0x182ea9){var _0x664fd5=a106_0x1706,_0x5db50b=_0x38deab();while(!![]){try{var _0xd76f0=parseInt(_0x664fd5(0x11a))/0x1+-parseInt(_0x664fd5(0x119))/0x2+parseInt(_0x664fd5(0x11b))/0x3*(-parseInt(_0x664fd5(0x11c))/0x4)+parseInt(_0x664fd5(0x11d))/0x5*(parseInt(_0x664fd5(0x115))/0x6)+-parseInt(_0x664fd5(0x118))/0x7+-parseInt(_0x664fd5(0x116))/0x8*(parseInt(_0x664fd5(0x11f))/0x9)+parseInt(_0x664fd5(0x117))/0xa;if(_0xd76f0===_0x182ea9)break;else _0x5db50b['push'](_0x5db50b['shift']());}catch(_0x9e975e){_0x5db50b['push'](_0x5db50b['shift']());}}}(a106_0x5ace,0xd5894));function a106_0x5ace(){var _0x3a772f=['2909892tqesgp','272rsdfOT','30935740GJzpzH','11858448zpdzsh','1446796kdiUYO','461514onSNVQ','2649jrEsSK','3928hVlbMm','10DHIeRV','stderr','96840bPDCVx'];a106_0x5ace=function(){return _0x3a772f;};return a106_0x5ace();}function a106_0x1706(_0x30e2cb,_0x1ebd67){_0x30e2cb=_0x30e2cb-0x115;var _0x5ace9c=a106_0x5ace();var _0x170685=_0x5ace9c[_0x30e2cb];return _0x170685;}export function writeCliSideChannelLine(_0x1ff01f){var _0x259552=a106_0x1706;process[_0x259552(0x11e)]['write'](_0x1ff01f+'\x0a');}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lovrabet/lovrabet-cli",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.3-beta.1",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -51,6 +51,8 @@
|
|
|
51
51
|
"@lovrabet/cli-framework": "1.0.5",
|
|
52
52
|
"@lovrabet/sdk": "1.4.2",
|
|
53
53
|
"chalk": "^5.6.2",
|
|
54
|
+
"fflate": "^0.8.3",
|
|
55
|
+
"fs-extra": "^11.3.6",
|
|
54
56
|
"ink": "^6.2.3",
|
|
55
57
|
"ink-spinner": "^5.0.0",
|
|
56
58
|
"meow": "^13.2.0",
|
|
@@ -59,6 +61,7 @@
|
|
|
59
61
|
"ws": "8.20.1"
|
|
60
62
|
},
|
|
61
63
|
"devDependencies": {
|
|
64
|
+
"@types/fs-extra": "^11.0.4",
|
|
62
65
|
"@types/node": "^24.5.2",
|
|
63
66
|
"@types/react": "^19.2.0",
|
|
64
67
|
"@vitest/coverage-v8": "^4.1.2",
|