@lovrabet/lovrabet-cli 2.1.7-beta.2 → 2.1.7-beta.3
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 -1
- package/lib/commands/skill/commands/install.js +1 -1
- package/lib/commands/skill/commands/list.js +1 -1
- package/lib/commands/skill/commands/push.js +1 -1
- package/lib/commands/skill/commands/validate.js +1 -1
- package/lib/commands/skill/flags.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/skill/manifest-helpers.js +1 -1
- package/lib/commands/skill/push-retarget.js +1 -0
- package/lib/commands/skill/scopes.js +1 -1
- package/lib/commands/skill/summary.js +1 -1
- 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 -1
- package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
- package/lib/skills/runtime-skill-sync/hashing.js +1 -1
- package/lib/skills/runtime-skill-sync/links.js +1 -1
- package/lib/skills/runtime-skill-sync/list-local.js +1 -1
- package/lib/skills/runtime-skill-sync/local-files.js +1 -1
- package/lib/skills/runtime-skill-sync/materialize.js +1 -1
- package/lib/skills/runtime-skill-sync/metadata.js +1 -1
- package/lib/skills/runtime-skill-sync/paths.js +1 -1
- package/lib/skills/runtime-skill-sync/push.js +1 -1
- package/lib/skills/runtime-skill-sync/scopes.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
- 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 +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3d2bb7,_0x135af2){const _0x4e826a=a92_0x40ac,_0xef2d23=_0x3d2bb7();while(!![]){try{const _0xa122f4=parseInt(_0x4e826a(0x19c))/0x1+-parseInt(_0x4e826a(0x198))/0x2*(parseInt(_0x4e826a(0x189))/0x3)+-parseInt(_0x4e826a(0x187))/0x4*(parseInt(_0x4e826a(0x191))/0x5)+parseInt(_0x4e826a(0x178))/0x6*(-parseInt(_0x4e826a(0x19e))/0x7)+-parseInt(_0x4e826a(0x18b))/0x8*(parseInt(_0x4e826a(0x195))/0x9)+-parseInt(_0x4e826a(0x18c))/0xa*(-parseInt(_0x4e826a(0x19f))/0xb)+parseInt(_0x4e826a(0x183))/0xc*(parseInt(_0x4e826a(0x186))/0xd);if(_0xa122f4===_0x135af2)break;else _0xef2d23['push'](_0xef2d23['shift']());}catch(_0x12dd7f){_0xef2d23['push'](_0xef2d23['shift']());}}}(a92_0x2123,0x3bb0a));import{existsSync,lstatSync,mkdirSync,readFileSync,rmSync}from'node:fs';import{dirname,resolve}from'node:path';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{resolveManagedFilePath,writeBytesAtomic,writeJsonAtomic}from'./fs-utils.js';import{bufferSha256,contentHash,fileHash}from'./hashing.js';import{fileContent,fileText,normalizeLocalFiles}from'./local-files.js';import{buildMetadata,readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillDir}from'./paths.js';import{extractDownloadedPackage,requirePackageBytes}from'./zip-package.js';export function materializeRuntimeSkill(_0x3ecf14,_0x3b1a64,_0x33f443){const _0x56d9e0=a92_0x40ac,_0x4d8f52=requireSkillCode(_0x3ecf14),_0x1637fe=requirePackageBytes(_0x4d8f52,_0x33f443[_0x56d9e0(0x192)]),_0x38065b=extractDownloadedPackage(_0x1637fe),_0xcb7ea9=_0x38065b['find'](_0x12cb20=>_0x12cb20['path']===SKILL_FILE);if(!_0xcb7ea9)throw CliErrors[_0x56d9e0(0x190)](_0x56d9e0(0x197)+SKILL_FILE+':\x20'+_0x4d8f52);const _0x57d251=withMaterializedSkillFrontmatter(_0x38065b,_0x3ecf14,_0x4d8f52),_0x3b90ca=_0x57d251[_0x56d9e0(0x1a1)](_0x36ea0f=>_0x36ea0f['path']===SKILL_FILE),_0xa1910d=fileText(_0x3b90ca),_0x154e8f=getRuntimeSkillDir(_0x33f443[_0x56d9e0(0x176)],_0x33f443['accessKey'],_0x33f443['appCode'],_0x3b1a64,_0x4d8f52,_0x33f443['paths']),_0x45f2d1=resolve(_0x154e8f,SKILL_FILE),_0x3304fc=resolve(_0x154e8f,METADATA_FILE),_0x56a909=contentHash(_0xa1910d),_0x1a7ad0=readMetadataIfPresent(_0x3304fc)?.[_0x56d9e0(0x18d)];ensurePulledFilesCanBeOverwritten(_0x154e8f,_0x3304fc,_0x57d251,_0x33f443['force']===!![]),mkdirSync(_0x154e8f,{'recursive':!![],'mode':0x1c0});const _0x40c264=existsSync(_0x45f2d1)?readFileSync(_0x45f2d1,_0x56d9e0(0x17b)):undefined;return materializeFiles(_0x154e8f,_0x57d251),removeStaleManagedFiles(_0x154e8f,_0x1a7ad0,_0x57d251),writeJsonAtomic(_0x3304fc,buildMetadata(_0x3ecf14,_0x3b1a64,_0x33f443[_0x56d9e0(0x18a)],_0x56a909,_0x33f443['pulledAt'],_0x57d251,_0x1637fe)),{'skill':_0x3ecf14,'scope':_0x3b1a64,'dir':_0x154e8f,'skillMdPath':_0x45f2d1,'metadataPath':_0x3304fc,'contentHash':_0x56a909,'changed':_0x40c264!==_0xa1910d};}function withMaterializedSkillFrontmatter(_0x16f4ce,_0x5f372e,_0x18c55b){const _0x181035=a92_0x40ac;return normalizeLocalFiles(_0x16f4ce)[_0x181035(0x17d)](_0x1c1cb3=>{const _0x428cc6=_0x181035,_0x38919d=fileText(_0x1c1cb3);if(_0x1c1cb3[_0x428cc6(0x180)]!==SKILL_FILE||hasYamlFrontmatter(_0x38919d))return _0x1c1cb3;return{'path':_0x1c1cb3[_0x428cc6(0x180)],'content':prependSkillFrontmatter(_0x38919d,{'name':_0x18c55b,'description':_0x5f372e[_0x428cc6(0x182)]?.[_0x428cc6(0x18f)]()||_0x5f372e['skillName']?.['trim']()||_0x18c55b})};});}function hasYamlFrontmatter(_0x48f1a9){const _0x3d9f59=a92_0x40ac;return/^\uFEFF?---\s*\r?\n/[_0x3d9f59(0x17a)](_0x48f1a9);}function a92_0x2123(){const _0x3c94bf=['403rwDCYV','293164zYpTdb','contentHash','87hLjUTB','appCode','1192seMvSM','12010LIhkJA','fileHashes','has','trim','validation','30omInsz','packageBytes','stringify','keys','12681yZEfDb','.\x20Changed\x20file:\x20','Runtime\x20Skill\x20package\x20is\x20missing\x20','21022DiaKvd','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','replace','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.','377985dnBtAU','entries','7294ZGDvMU','1012GJZULf','isFile','find','env','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','852mzSbnW','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','test','utf8','join','map','---','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','path','Managed\x20file\x20was\x20removed\x20locally:\x20','description','332316DNUWDU','Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20','name:\x20'];a92_0x2123=function(){return _0x3c94bf;};return a92_0x2123();}function prependSkillFrontmatter(_0xc52deb,_0x567a52){const _0x3eb7e7=a92_0x40ac,_0x354aee=_0xc52deb[_0x3eb7e7(0x19a)](/^\uFEFF/,'');return[_0x3eb7e7(0x17e),_0x3eb7e7(0x185)+yamlString(_0x567a52['name']),'description:\x20'+yamlString(_0x567a52['description']),_0x3eb7e7(0x17e),'',_0x354aee][_0x3eb7e7(0x17c)]('\x0a');}function yamlString(_0x3f7c52){const _0x28a689=a92_0x40ac;return JSON[_0x28a689(0x193)](_0x3f7c52['replace'](/\r/g,'')[_0x28a689(0x18f)]());}function ensurePulledFilesCanBeOverwritten(_0x187581,_0x4bb202,_0x1ebe43,_0xed2669){const _0x4e2080=a92_0x40ac;if(_0xed2669||!existsSync(_0x4bb202))return;const _0x54afc9=readMetadataIfPresent(_0x4bb202);if(!_0x54afc9)return;const _0x1ac947=_0x54afc9[_0x4e2080(0x18d)]&&Object[_0x4e2080(0x194)](_0x54afc9[_0x4e2080(0x18d)])['length']>0x0?_0x54afc9[_0x4e2080(0x18d)]:undefined;if(_0x1ac947)for(const [_0x5eeaf3,_0x5e45fc]of Object[_0x4e2080(0x19d)](_0x1ac947)){const _0x33abf3=resolveManagedFilePath(_0x187581,_0x5eeaf3);if(!existsSync(_0x33abf3))throw CliErrors[_0x4e2080(0x190)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x187581,_0x4e2080(0x181)+_0x5eeaf3);const _0x5f383f=lstatSync(_0x33abf3);if(!_0x5f383f[_0x4e2080(0x1a0)]())throw CliErrors[_0x4e2080(0x190)](_0x4e2080(0x179)+_0x187581,_0x4e2080(0x184)+_0x5eeaf3);const _0x7e6519=bufferSha256(readFileSync(_0x33abf3));if(_0x7e6519!==_0x5e45fc)throw CliErrors[_0x4e2080(0x190)](_0x4e2080(0x179)+_0x187581+_0x4e2080(0x196)+_0x5eeaf3,_0x4e2080(0x199)+_0x5eeaf3);}else{const _0x1c1c3c=resolve(_0x187581,SKILL_FILE);if(existsSync(_0x1c1c3c)&&_0x54afc9[_0x4e2080(0x188)]){const _0x47a3b0=contentHash(readFileSync(_0x1c1c3c,_0x4e2080(0x17b)));if(_0x47a3b0!==_0x54afc9['contentHash'])throw CliErrors[_0x4e2080(0x190)](_0x4e2080(0x177)+_0x1c1c3c,_0x4e2080(0x19b));}}for(const _0x4c8162 of normalizeLocalFiles(_0x1ebe43)){if(_0x1ac947?.[_0x4c8162[_0x4e2080(0x180)]])continue;if(!_0x1ac947&&_0x4c8162['path']===SKILL_FILE)continue;const _0x526590=resolveManagedFilePath(_0x187581,_0x4c8162[_0x4e2080(0x180)]);if(!existsSync(_0x526590))continue;const _0x389e8e=lstatSync(_0x526590);if(!_0x389e8e[_0x4e2080(0x1a0)]())throw CliErrors['validation'](_0x4e2080(0x179)+_0x187581,_0x4e2080(0x17f)+_0x4c8162[_0x4e2080(0x180)]);const _0x18b698=bufferSha256(readFileSync(_0x526590));if(_0x18b698!==fileHash(_0x4c8162))throw CliErrors[_0x4e2080(0x190)](_0x4e2080(0x179)+_0x187581,'Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20'+_0x4c8162[_0x4e2080(0x180)]);}}function materializeFiles(_0x465336,_0x3d296f){const _0x231c32=a92_0x40ac;for(const _0x2b042a of normalizeLocalFiles(_0x3d296f)){const _0x3f4437=resolveManagedFilePath(_0x465336,_0x2b042a[_0x231c32(0x180)]);mkdirSync(dirname(_0x3f4437),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x3f4437,fileContent(_0x2b042a),0x180);}}function a92_0x40ac(_0x3d871a,_0xac066){_0x3d871a=_0x3d871a-0x176;const _0x21237c=a92_0x2123();let _0x40ac8c=_0x21237c[_0x3d871a];return _0x40ac8c;}function removeStaleManagedFiles(_0x4ad295,_0x75cee6,_0x8931db){const _0x1e85cf=a92_0x40ac;if(!_0x75cee6)return;const _0x564bd0=new Set(normalizeLocalFiles(_0x8931db)[_0x1e85cf(0x17d)](_0x5d3d9a=>_0x5d3d9a[_0x1e85cf(0x180)]));for(const _0x3390fe of Object['keys'](_0x75cee6)){if(_0x564bd0[_0x1e85cf(0x18e)](_0x3390fe))continue;const _0x5daa4e=resolveManagedFilePath(_0x4ad295,_0x3390fe);existsSync(_0x5daa4e)&&lstatSync(_0x5daa4e)[_0x1e85cf(0x1a0)]()&&rmSync(_0x5daa4e,{'force':!![]});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x1564cb,_0x4b5afb){const _0x1b1ec5=a93_0x122d,_0x4b2b4d=_0x1564cb();while(!![]){try{const _0x4fc534=parseInt(_0x1b1ec5(0x119))/0x1+parseInt(_0x1b1ec5(0x108))/0x2*(parseInt(_0x1b1ec5(0x100))/0x3)+-parseInt(_0x1b1ec5(0x124))/0x4+parseInt(_0x1b1ec5(0x122))/0x5+parseInt(_0x1b1ec5(0x123))/0x6*(-parseInt(_0x1b1ec5(0x10b))/0x7)+-parseInt(_0x1b1ec5(0x11a))/0x8*(-parseInt(_0x1b1ec5(0x111))/0x9)+-parseInt(_0x1b1ec5(0x11b))/0xa*(parseInt(_0x1b1ec5(0x121))/0xb);if(_0x4fc534===_0x4b5afb)break;else _0x4b2b4d['push'](_0x4b2b4d['shift']());}catch(_0x10eb32){_0x4b2b4d['push'](_0x4b2b4d['shift']());}}}(a93_0x408b,0xc0965));import{existsSync,readFileSync}from'node:fs';import{CliErrors}from'../../errors.js';function a93_0x122d(_0x1ca821,_0x231ab3){_0x1ca821=_0x1ca821-0x100;const _0x408bb4=a93_0x408b();let _0x122dba=_0x408bb4[_0x1ca821];return _0x122dba;}import{METADATA_FILE}from'./constants.js';import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';function a93_0x408b(){const _0x1a260f=['344kRpCyA','9975370SUGvVP','path','length','sourceSessionId','map','tags','11sdzKHD','2696490pPqUwm','4086oixdxH','4228528lECTdJ','4162089kuKGil','fromEntries','utf8','manifest','status','userId','string','forkedFromSkillId','2ACWThy','hasUpstreamUpdate','version','12033oOaTwx','trim','Runtime\x20Skill\x20is\x20missing\x20skillCode.','zipSize','isArray','personal','255978BlOeii','parse','object','skillName','validation','forkedFromVersion','files','description','864478WGQPFW'];a93_0x408b=function(){return _0x1a260f;};return a93_0x408b();}import{fileContent,normalizeLocalFiles}from'./local-files.js';import{buildSkillPackage,localFilesToManifestFiles}from'./zip-package.js';export function buildMetadata(_0x27fb1b,_0x46b305,_0x1f007d,_0x499e48,_0x3367a4,_0xa58bd7,_0x267893){const _0x58727f=a93_0x122d,_0x5362a2=_0xa58bd7?normalizeLocalFiles(_0xa58bd7):[],_0x2f89f4=!_0x267893&&_0x5362a2['length']>0x0?buildSkillPackage(_0x5362a2):undefined,_0x407024=_0x267893?bufferSha256(_0x267893):_0x2f89f4?.[_0x58727f(0x103)]['zipSha256'],_0x29bcb3=_0x267893?.[_0x58727f(0x11d)]??_0x2f89f4?.['manifest'][_0x58727f(0x10e)],_0x27a353=_0x5362a2['length']>0x0?Object[_0x58727f(0x101)](_0x5362a2[_0x58727f(0x11f)](_0x7033fb=>[_0x7033fb['path'],fileHash(_0x7033fb)])):undefined;return{'schemaVersion':_0x5362a2[_0x58727f(0x11d)]>0x0?0x2:0x1,'id':_0x27fb1b['id'],'appCode':_0x1f007d,'skillCode':requireSkillCode(_0x27fb1b),'skillName':_0x27fb1b[_0x58727f(0x114)],'description':_0x27fb1b[_0x58727f(0x118)],'scope':_0x46b305,'readonly':_0x46b305!==_0x58727f(0x110)||_0x27fb1b['readonly']===!![],'tenantCode':_0x27fb1b['tenantCode'],'userId':_0x27fb1b[_0x58727f(0x105)],'version':_0x27fb1b[_0x58727f(0x10a)],'status':_0x27fb1b[_0x58727f(0x104)],'tags':Array['isArray'](_0x27fb1b['tags'])?_0x27fb1b[_0x58727f(0x120)]:[],'hasUpstreamUpdate':_0x27fb1b[_0x58727f(0x109)],'forkedFromSkillId':_0x27fb1b[_0x58727f(0x107)],'forkedFromVersion':_0x27fb1b[_0x58727f(0x116)],'sourceSessionId':_0x27fb1b[_0x58727f(0x11e)],'contentHash':_0x499e48,'fileHashes':_0x27a353,'treeHash':_0x5362a2[_0x58727f(0x11d)]>0x0?fileTreeHash(localFilesToManifestFiles(_0x5362a2)):undefined,'ossPath':remoteManifestOssPath(_0x27fb1b[_0x58727f(0x117)]),'zipSha256':_0x407024,'zipSize':_0x29bcb3,'files':_0x5362a2[_0x58727f(0x11d)]>0x0?_0x5362a2['map'](_0x2e4b92=>({'path':_0x2e4b92[_0x58727f(0x11c)],'hash':fileHash(_0x2e4b92),'size':fileContent(_0x2e4b92)[_0x58727f(0x11d)]})):undefined,'pulledAt':_0x3367a4??new Date()['toISOString']()};}export function requireSkillCode(_0x2a2d64){const _0x5f2fcd=a93_0x122d,_0x41d8c9=_0x2a2d64['skillCode']?.[_0x5f2fcd(0x10c)]();if(!_0x41d8c9)throw CliErrors[_0x5f2fcd(0x115)](_0x5f2fcd(0x10d));return _0x41d8c9;}export function readMetadataIfPresent(_0x23d8c7){const _0x3891e0=a93_0x122d;if(!existsSync(_0x23d8c7))return undefined;try{const _0x4c53bb=JSON[_0x3891e0(0x112)](readFileSync(_0x23d8c7,_0x3891e0(0x102)));return _0x4c53bb;}catch{throw CliErrors[_0x3891e0(0x115)]('Invalid\x20'+METADATA_FILE+':\x20'+_0x23d8c7);}}function remoteManifestOssPath(_0x20f23a){const _0x14d248=a93_0x122d;if(!_0x20f23a||typeof _0x20f23a!==_0x14d248(0x113)||Array[_0x14d248(0x10f)](_0x20f23a))return undefined;const _0x4f12e2=_0x20f23a['ossPath'];return typeof _0x4f12e2===_0x14d248(0x106)&&_0x4f12e2[_0x14d248(0x10c)]()?_0x4f12e2[_0x14d248(0x10c)]():undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a94_0x1fc2d7=a94_0x3c01;(function(_0xa05477,_0x25ceaa){const _0x1fcee2=a94_0x3c01,_0x2fed9b=_0xa05477();while(!![]){try{const _0x1e6f9e=parseInt(_0x1fcee2(0x10c))/0x1+parseInt(_0x1fcee2(0x108))/0x2+-parseInt(_0x1fcee2(0x112))/0x3+-parseInt(_0x1fcee2(0x11a))/0x4*(parseInt(_0x1fcee2(0x11c))/0x5)+-parseInt(_0x1fcee2(0x10d))/0x6+-parseInt(_0x1fcee2(0x10a))/0x7*(parseInt(_0x1fcee2(0x116))/0x8)+parseInt(_0x1fcee2(0x106))/0x9;if(_0x1e6f9e===_0x25ceaa)break;else _0x2fed9b['push'](_0x2fed9b['shift']());}catch(_0x426f03){_0x2fed9b['push'](_0x2fed9b['shift']());}}}(a94_0x338c,0xedeac));import{homedir}from'node:os';import{resolve}from'node:path';import{fingerprintAccessKey}from'../../commands/app/cache.js';function a94_0x338c(){const _0x11c2c2=['appCode','7LyYBwO','skills','417173dZGsao','8613570cIAxsS','Unsafe\x20','cacheRoot','claudeSkillsDir','includes','4976598fJQYeG','homeDir','.claude','trim','14489976GxFsXR','agentsSkillsDir','path\x20segment','.agents','3148ewKlIk','cache','10705RibIjn','\x20for\x20local\x20path:\x20','homeDirName','62467227HFFuSd','skillCode','414414qLPzVx'];a94_0x338c=function(){return _0x11c2c2;};return a94_0x338c();}import{PRODUCT_CONFIG,productEnv}from'../../constant/product.js';import{CliErrors}from'../../errors.js';export function resolveSkillSyncPaths(_0x12901f={}){const _0x1269f9=a94_0x3c01,_0x354be8=_0x12901f[_0x1269f9(0x113)]??homedir(),_0x3cc72d=resolve(_0x354be8,PRODUCT_CONFIG[_0x1269f9(0x11e)],_0x1269f9(0x11b)),_0x4a84b8=trimmedEnv('SKILL_ROOT'),_0x1d0c3d=trimmedEnv('CLAUDE_SKILL_ROOT');return{'homeDir':_0x354be8,'cacheRoot':_0x3cc72d,'managedRoot':resolve(_0x354be8,PRODUCT_CONFIG[_0x1269f9(0x11e)]),'agentsSkillsDir':_0x12901f[_0x1269f9(0x117)]??_0x4a84b8??resolve(_0x354be8,_0x1269f9(0x119),_0x1269f9(0x10b)),'claudeSkillsDir':_0x12901f[_0x1269f9(0x110)]??_0x1d0c3d??resolve(_0x354be8,_0x1269f9(0x114),_0x1269f9(0x10b))};}export function getRuntimeSkillCacheRoot(_0x118838,_0x426072,_0x1d30e5={}){const _0xdea081=a94_0x3c01,_0x3844bc=resolveSkillSyncPaths(_0x1d30e5);return resolve(_0x3844bc[_0xdea081(0x10f)],_0x118838,fingerprintAccessKey(_0x426072),'skills');}function a94_0x3c01(_0x51ca01,_0x21d039){_0x51ca01=_0x51ca01-0x106;const _0x338c47=a94_0x338c();let _0x3c0106=_0x338c47[_0x51ca01];return _0x3c0106;}export function getRuntimeSkillDir(_0x56444b,_0x447670,_0x5f5149,_0x575b63,_0x50b020,_0x5076d1={}){const _0x379eaa=a94_0x3c01;return resolve(getRuntimeSkillCacheRoot(_0x56444b,_0x447670,_0x5076d1),safePathSegment(_0x5f5149,_0x379eaa(0x109)),_0x575b63,safePathSegment(_0x50b020,_0x379eaa(0x107)));}export function safePathSegment(_0x44a991,_0x261dfc=a94_0x1fc2d7(0x118)){const _0x25241f=a94_0x1fc2d7;if(!_0x44a991||_0x44a991[_0x25241f(0x111)]('/')||_0x44a991[_0x25241f(0x111)]('\x5c')||_0x44a991[_0x25241f(0x111)]('..'))throw CliErrors['validation'](_0x25241f(0x10e)+_0x261dfc+_0x25241f(0x11d)+_0x44a991);return _0x44a991;}function trimmedEnv(_0x2608fb){const _0x4f3d53=a94_0x1fc2d7,_0x12ef79=productEnv(_0x2608fb)?.[_0x4f3d53(0x115)]();return _0x12ef79?_0x12ef79:undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4fd030,_0x4ab2fe){const _0x3fb4d9=a95_0x4cf1,_0x41e883=_0x4fd030();while(!![]){try{const _0x294124=-parseInt(_0x3fb4d9(0x101))/0x1*(parseInt(_0x3fb4d9(0x10c))/0x2)+-parseInt(_0x3fb4d9(0xee))/0x3*(parseInt(_0x3fb4d9(0xfc))/0x4)+-parseInt(_0x3fb4d9(0xf5))/0x5+-parseInt(_0x3fb4d9(0xf6))/0x6*(-parseInt(_0x3fb4d9(0x105))/0x7)+-parseInt(_0x3fb4d9(0x112))/0x8*(parseInt(_0x3fb4d9(0x102))/0x9)+-parseInt(_0x3fb4d9(0xf3))/0xa*(-parseInt(_0x3fb4d9(0x10a))/0xb)+parseInt(_0x3fb4d9(0xfb))/0xc*(parseInt(_0x3fb4d9(0xeb))/0xd);if(_0x294124===_0x4ab2fe)break;else _0x41e883['push'](_0x41e883['shift']());}catch(_0x7e1c3a){_0x41e883['push'](_0x41e883['shift']());}}}(a95_0x5844,0xeab95));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{writeJsonAtomic}from'./fs-utils.js';function a95_0x4cf1(_0x35860d,_0x7bbade){_0x35860d=_0x35860d-0xe5;const _0x584410=a95_0x5844();let _0x4cf188=_0x584410[_0x35860d];return _0x4cf188;}import{contentHash}from'./hashing.js';import{fileText,normalizeLocalFiles,scanSkillDirectory}from'./local-files.js';import{buildMetadata,readMetadataIfPresent}from'./metadata.js';import{buildSkillPackage,tryNormalizePackageManifest}from'./zip-package.js';export function resolvePushDirectoryIdentity(_0x4f4b09,_0x33271c,_0x13a1ee={}){const _0x33a29e=a95_0x4cf1,_0x374a5c=resolvePushDirectoryRoot(_0x4f4b09),_0x1b5545=readMetadataIfPresent(resolve(_0x374a5c,METADATA_FILE));if(_0x1b5545?.[_0x33a29e(0xf8)]&&_0x1b5545[_0x33a29e(0xf8)]!==_0x33271c&&!_0x13a1ee['allowAppCodeRetarget'])throw CliErrors['validation']('Skill\x20metadata\x20appCode\x20\x22'+_0x1b5545[_0x33a29e(0xf8)]+'\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22'+_0x33271c+'\x22.');const _0x46a775=_0x1b5545?.['skillCode']?.[_0x33a29e(0xfd)]()||deriveSkillCodeFromDirectory(_0x374a5c,_0x33271c);if(!_0x46a775)throw CliErrors[_0x33a29e(0xff)](_0x33a29e(0x117)+METADATA_FILE+_0x33a29e(0xf9));return{'dir':_0x374a5c,'skillCode':_0x46a775,'metadata':_0x1b5545};}function a95_0x5844(){const _0x3d7d90=['1803avZVVJ','utf8','Skill\x20directory\x20not\x20found:\x20','unknown','metadata','171980dsshym','find','6622425jAkiuP','6RtrqDA','skillCode','appCode','\x20or\x20directory\x20name.','some','63816bgULgH','88RyYKZK','trim','refreshedAt','validation','sourceSessionId','370436soonhk','44721wIANyP','\x20has\x20unsupported\x20scope\x20\x22','isDirectory','248969RRafIg','version','manifest','isFile','tags','220FcbfDO','pushedAt','4IappCX','scope','isArray','packageBase64','Remote\x20Skill\x20','builtin','2472CTcNLe','path','\x20to\x20submit\x20company\x20Skills\x20for\x20review.','filter','personal','Unable\x20to\x20resolve\x20skillCode\x20from\x20','dir','(unknown)','Missing\x20','\x20has\x20scope=\x22','description','files','content','10257cHsaCB','isSymbolicLink','skillName'];a95_0x5844=function(){return _0x3d7d90;};return a95_0x5844();}export function readPushDirectory(_0x4c6d55,_0x5f25b7,_0x3d9a85={}){const _0x1aa008=a95_0x4cf1,_0x358877=resolvePushDirectoryIdentity(_0x4c6d55,_0x5f25b7,_0x3d9a85),_0x13398f=_0x358877[_0x1aa008(0x118)],_0x2bcf86=resolve(_0x13398f,SKILL_FILE);if(!existsSync(_0x2bcf86)||!lstatSync(_0x2bcf86)[_0x1aa008(0x108)]())throw CliErrors[_0x1aa008(0xff)](_0x1aa008(0xe6)+SKILL_FILE+':\x20'+_0x2bcf86);const _0xd224e5=_0x358877[_0x1aa008(0xf2)],_0x18337d=_0x3d9a85['targetScope']??_0x1aa008(0x116);if(_0xd224e5?.[_0x1aa008(0x10d)]==='builtin')throw CliErrors[_0x1aa008(0xff)]('Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20'+METADATA_FILE+_0x1aa008(0xe7)+_0xd224e5[_0x1aa008(0x10d)]+'\x22.');if(_0x18337d===_0x1aa008(0x116)&&_0xd224e5?.[_0x1aa008(0x10d)]&&_0xd224e5[_0x1aa008(0x10d)]!==_0x1aa008(0x116))throw CliErrors[_0x1aa008(0xff)]('Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20'+METADATA_FILE+_0x1aa008(0xe7)+_0xd224e5[_0x1aa008(0x10d)]+'\x22.','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20'+_0x13398f+_0x1aa008(0x114));const _0x6c388e=scanSkillDirectory(_0x13398f),_0x42ba91=buildSkillPackage(_0x6c388e),_0x40dcef=readFileSync(_0x2bcf86,_0x1aa008(0xef)),_0x467969=_0x358877[_0x1aa008(0xf7)];return{'skillCode':_0x467969,'metadata':_0xd224e5,'input':{'skillCode':_0x467969,'skillName':_0xd224e5?.[_0x1aa008(0xed)],'description':_0xd224e5?.['description'],'content':_0x40dcef,'files':_0x42ba91[_0x1aa008(0x107)],'packageBase64':_0x42ba91[_0x1aa008(0x10f)],'tags':_0xd224e5?.[_0x1aa008(0x109)],'version':_0xd224e5?.[_0x1aa008(0x106)],'sourceSessionId':_0xd224e5?.[_0x1aa008(0x100)]}};}export function refreshPushDirectoryMetadataFromRemote(_0x518be0,_0x24b85e,_0x51fac2,_0x9cc530={}){const _0xc35b75=a95_0x4cf1,_0x46f537=resolvePushDirectoryRoot(_0x518be0),_0x20526d=readMetadataIfPresent(resolve(_0x46f537,METADATA_FILE)),_0x1698f0=requireRemoteScope(_0x24b85e),_0x59bc25=readLocalSkillContent(_0x46f537),_0x46de1c={..._0x24b85e,'appCode':_0x24b85e[_0xc35b75(0xf8)]??_0x51fac2,'skillName':_0x24b85e['skillName']??_0x20526d?.[_0xc35b75(0xed)],'description':_0x24b85e[_0xc35b75(0xe8)]??_0x20526d?.[_0xc35b75(0xe8)],'tags':Array[_0xc35b75(0x10e)](_0x24b85e['tags'])?_0x24b85e[_0xc35b75(0x109)]:_0x20526d?.[_0xc35b75(0x109)],'sourceSessionId':_0x24b85e[_0xc35b75(0x100)]??_0x20526d?.[_0xc35b75(0x100)],'content':_0x24b85e[_0xc35b75(0xea)]??_0x59bc25},_0x2a0fc6=buildMetadata(_0x46de1c,_0x1698f0,_0x51fac2,contentHash(_0x59bc25),_0x9cc530[_0xc35b75(0xfe)]);writeJsonAtomic(resolve(_0x46f537,METADATA_FILE),_0x2a0fc6);}export function recordPushedRuntimeSkill(_0x19d21e,_0x4fcb65,_0x502c07,_0x289406={}){const _0x18e6b4=a95_0x4cf1,_0xf1a61b=resolvePushDirectoryRoot(_0x19d21e),_0x2fb509=scanSkillDirectory(_0xf1a61b),_0x1c5f17=_0x2fb509[_0x18e6b4(0xf4)](_0x4c6584=>_0x4c6584[_0x18e6b4(0x113)]===SKILL_FILE),_0x4e9548=_0x1c5f17?fileText(_0x1c5f17):'',_0x5d380e=tryNormalizePackageManifest(_0x4fcb65[_0x18e6b4(0xe9)]),_0x4a30d0={..._0x4fcb65,'content':_0x4fcb65[_0x18e6b4(0xea)]??_0x4e9548,'files':_0x5d380e},_0x214435=_0x5d380e?normalizeLocalFiles(_0x2fb509)[_0x18e6b4(0x115)](_0x59491f=>_0x5d380e[_0x18e6b4(0xe9)][_0x18e6b4(0xfa)](_0x19c9a3=>_0x19c9a3[_0x18e6b4(0x113)]===_0x59491f[_0x18e6b4(0x113)])):undefined,_0x106dec=buildMetadata(_0x4a30d0,_0x289406[_0x18e6b4(0x10d)]??'personal',_0x502c07,contentHash(_0x4a30d0[_0x18e6b4(0xea)]??''),_0x289406[_0x18e6b4(0x10b)],_0x214435);writeJsonAtomic(resolve(_0xf1a61b,METADATA_FILE),_0x106dec);}export function deriveSkillCodeFromDirectory(_0x17e054,_0x209641){const _0x130a12=basename(resolve(_0x17e054)),_0x19e407=_0x209641+'--';return _0x130a12['startsWith'](_0x19e407)?_0x130a12['slice'](_0x19e407['length']):_0x130a12;}function resolvePushDirectoryRoot(_0x27fe72){const _0x41347e=a95_0x4cf1,_0x3083e5=resolve(_0x27fe72);if(!existsSync(_0x3083e5))throw CliErrors[_0x41347e(0xff)](_0x41347e(0xf0)+_0x27fe72);const _0x47b017=lstatSync(_0x3083e5);if(_0x47b017[_0x41347e(0x104)]())return _0x3083e5;if(_0x47b017[_0x41347e(0xec)]()){const _0x206822=realpathSync(_0x3083e5);if(lstatSync(_0x206822)['isDirectory']())return _0x206822;}throw CliErrors[_0x41347e(0xff)]('Skill\x20directory\x20not\x20found:\x20'+_0x27fe72);}function requireRemoteScope(_0x40a1b3){const _0x6f5702=a95_0x4cf1;if(_0x40a1b3[_0x6f5702(0x10d)]===_0x6f5702(0x116)||_0x40a1b3['scope']==='company'||_0x40a1b3[_0x6f5702(0x10d)]===_0x6f5702(0x111))return _0x40a1b3['scope'];throw CliErrors[_0x6f5702(0xff)](_0x6f5702(0x110)+(_0x40a1b3[_0x6f5702(0xf7)]||_0x6f5702(0xe5))+_0x6f5702(0x103)+(_0x40a1b3[_0x6f5702(0x10d)]??_0x6f5702(0xf1))+'\x22.');}function readLocalSkillContent(_0x5800f6){const _0x37445d=a95_0x4cf1,_0xc0daf2=resolve(_0x5800f6,SKILL_FILE);return existsSync(_0xc0daf2)&&lstatSync(_0xc0daf2)[_0x37445d(0x108)]()?readFileSync(_0xc0daf2,_0x37445d(0xef)):'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x24000b,_0x194bb8){const _0x25ede9=a96_0x1a5c,_0x3cbb18=_0x24000b();while(!![]){try{const _0x341d65=parseInt(_0x25ede9(0x96))/0x1*(-parseInt(_0x25ede9(0x9c))/0x2)+parseInt(_0x25ede9(0x8b))/0x3*(parseInt(_0x25ede9(0x9d))/0x4)+parseInt(_0x25ede9(0x8d))/0x5+parseInt(_0x25ede9(0x93))/0x6+-parseInt(_0x25ede9(0x9a))/0x7*(-parseInt(_0x25ede9(0x91))/0x8)+-parseInt(_0x25ede9(0x99))/0x9+-parseInt(_0x25ede9(0x95))/0xa*(parseInt(_0x25ede9(0x8e))/0xb);if(_0x341d65===_0x194bb8)break;else _0x3cbb18['push'](_0x3cbb18['shift']());}catch(_0x24b04d){_0x3cbb18['push'](_0x3cbb18['shift']());}}}(a96_0x21bc,0x90471));function a96_0x21bc(){const _0x250d6b=['length','2DkTYzn','4PdXRAD','2234697ATyzoc','company','2558135oIkpEI','825638uaFqFM','builtin','Unsupported\x20runtime\x20Skill\x20scope:\x20','8dyRfiH','push','1613652njXgbW','includes','110YYSBEd','313103cdnnai','validation','personal','2102427PxAsln','3064859dBnXYg'];a96_0x21bc=function(){return _0x250d6b;};return a96_0x21bc();}import{CliErrors}from'../../errors.js';export function normalizeRuntimeSkillScopes(_0x47edea){const _0x571fa0=a96_0x1a5c,_0x3a38f3=_0x47edea&&_0x47edea[_0x571fa0(0x9b)]>0x0?_0x47edea:[_0x571fa0(0x98),_0x571fa0(0x8c),_0x571fa0(0x8f)],_0xaa49ec=[];for(const _0x81d123 of _0x3a38f3){if(!isRuntimeSkillScope(_0x81d123))throw CliErrors[_0x571fa0(0x97)](_0x571fa0(0x90)+_0x81d123);!_0xaa49ec[_0x571fa0(0x94)](_0x81d123)&&_0xaa49ec[_0x571fa0(0x92)](_0x81d123);}return _0xaa49ec;}function a96_0x1a5c(_0x19e53b,_0x3820c2){_0x19e53b=_0x19e53b-0x8b;const _0x21bcbf=a96_0x21bc();let _0x1a5ca4=_0x21bcbf[_0x19e53b];return _0x1a5ca4;}export function isRuntimeSkillScope(_0x7768a7){const _0x1866c6=a96_0x1a5c;return _0x7768a7===_0x1866c6(0x98)||_0x7768a7==='company'||_0x7768a7===_0x1866c6(0x8f);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0xd04e34,_0x3fc7e2){const _0x502d40=a98_0x2523,_0x5b3a97=_0xd04e34();while(!![]){try{const _0x59fc68=-parseInt(_0x502d40(0x205))/0x1+-parseInt(_0x502d40(0x1fe))/0x2*(-parseInt(_0x502d40(0x203))/0x3)+-parseInt(_0x502d40(0x202))/0x4*(-parseInt(_0x502d40(0x1f1))/0x5)+-parseInt(_0x502d40(0x1ff))/0x6*(-parseInt(_0x502d40(0x1fa))/0x7)+-parseInt(_0x502d40(0x1fd))/0x8+parseInt(_0x502d40(0x1f2))/0x9+parseInt(_0x502d40(0x1f4))/0xa;if(_0x59fc68===_0x3fc7e2)break;else _0x5b3a97['push'](_0x5b3a97['shift']());}catch(_0x1a3f15){_0x5b3a97['push'](_0x5b3a97['shift']());}}}(a98_0x4965,0x472ce));import{unzipSync,zipSync}from'fflate';function a98_0x2523(_0x2c716a,_0x1817eb){_0x2c716a=_0x2c716a-0x1f1;const _0x4965c9=a98_0x4965();let _0x252319=_0x4965c9[_0x2c716a];return _0x252319;}function a98_0x4965(){const _0x1be232=['validation_error','Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.','validation','code','endsWith','63021TZsNKP','object','name','2466384cSkNoV','9446DsSKEv','162edvpRR','from','length','3892pJCTPj','33SPHuBy','map','572097cpJDky','115Kodedt','3434076EwYmmM','path','4729520xIyJFG'];a98_0x4965=function(){return _0x1be232;};return a98_0x4965();}import{CliErrors}from'../../errors.js';import{compareSkillFiles,fileContent,normalizeLocalFiles,normalizeSkillRelativePath}from'./local-files.js';const ZIP_MTIME=new Date('1980-01-01T00:00:00.000Z');export function createDeterministicZipPackage(_0x436194){const _0x529e19=a98_0x2523,_0x19a884={};for(const _0x101077 of normalizeLocalFiles(_0x436194)){_0x19a884[_0x101077[_0x529e19(0x1f3)]]=fileContent(_0x101077);}return Buffer[_0x529e19(0x200)](zipSync(_0x19a884,{'level':0x0,'mtime':ZIP_MTIME}));}export function parseZipPackage(_0xe55288){const _0x16b46b=a98_0x2523;if(_0xe55288[_0x16b46b(0x201)]<0x16)throw CliErrors[_0x16b46b(0x1f7)](_0x16b46b(0x1f6));let _0x24186b;try{_0x24186b=unzipSync(_0xe55288,{'filter'(_0x509e6c){const _0x57e130=_0x16b46b,_0x1073af=normalizeSkillRelativePath(_0x509e6c[_0x57e130(0x1fc)]);if(_0x1073af[_0x57e130(0x1f9)]('/'))throw CliErrors[_0x57e130(0x1f7)]('Runtime\x20Skill\x20package\x20contains\x20directory\x20entry:\x20'+_0x1073af);return!![];}});}catch(_0x5e49a9){if(isRuntimeSkillValidationError(_0x5e49a9))throw _0x5e49a9;throw CliErrors['validation'](_0x16b46b(0x1f6));}return Object['entries'](_0x24186b)[_0x16b46b(0x204)](([_0x1a64af,_0x59c3d4])=>({'path':normalizeSkillRelativePath(_0x1a64af),'bytes':Buffer[_0x16b46b(0x200)](_0x59c3d4)}))['sort'](compareSkillFiles);}function isRuntimeSkillValidationError(_0xaaef37){const _0x29009d=a98_0x2523;return typeof _0xaaef37===_0x29009d(0x1fb)&&_0xaaef37!==null&&_0x29009d(0x1f8)in _0xaaef37&&_0xaaef37['code']===_0x29009d(0x1f5);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x801f66,_0xc086db){const _0x8009be=a99_0x4a76,_0x3d8da8=_0x801f66();while(!![]){try{const _0x353bdf=-parseInt(_0x8009be(0x1cd))/0x1*(-parseInt(_0x8009be(0x1d1))/0x2)+parseInt(_0x8009be(0x1b6))/0x3*(-parseInt(_0x8009be(0x1b5))/0x4)+-parseInt(_0x8009be(0x1c9))/0x5*(parseInt(_0x8009be(0x1ba))/0x6)+parseInt(_0x8009be(0x1bd))/0x7+parseInt(_0x8009be(0x1b1))/0x8*(-parseInt(_0x8009be(0x1b9))/0x9)+parseInt(_0x8009be(0x1ad))/0xa+parseInt(_0x8009be(0x1cf))/0xb;if(_0x353bdf===_0xc086db)break;else _0x3d8da8['push'](_0x3d8da8['shift']());}catch(_0x1d00a2){_0x3d8da8['push'](_0x3d8da8['shift']());}}}(a99_0x23ef,0x9d2bf));import{CliErrors}from'../../errors.js';import{SKILL_FILE}from'./constants.js';import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';function a99_0x4a76(_0x494df6,_0x1b70fa){_0x494df6=_0x494df6-0x1a7;const _0x23ef1a=a99_0x23ef();let _0x4a7658=_0x23ef1a[_0x494df6];return _0x4a7658;}import{fileContent,isSha256Hex,normalizeLocalFiles,normalizeManifestFiles}from'./local-files.js';import{createDeterministicZipPackage,parseZipPackage}from'./zip-codec.js';export function buildSkillPackage(_0x304152){const _0x17e0a0=a99_0x4a76,_0x139ba7=normalizeLocalFiles(_0x304152);if(!_0x139ba7[_0x17e0a0(0x1c8)](_0x301695=>_0x301695['path']===SKILL_FILE))throw CliErrors[_0x17e0a0(0x1c3)](_0x17e0a0(0x1bb)+SKILL_FILE+_0x17e0a0(0x1a7));const _0x14b1ad=localFilesToManifestFiles(_0x139ba7),_0xb19e05=createDeterministicZipPackage(_0x139ba7);return{'manifest':{'schemaVersion':0x2,'treeSha256':fileTreeHash(_0x14b1ad),'zipSha256':bufferSha256(_0xb19e05),'zipSize':_0xb19e05['length'],'files':_0x14b1ad},'packageBytes':_0xb19e05,'packageBase64':_0xb19e05[_0x17e0a0(0x1c2)](_0x17e0a0(0x1d0))};}export function verifyRuntimeSkillPackage(_0xdf9b0a,_0x18caf9){const _0x27ee89=a99_0x4a76,_0x137037=normalizePackageManifest(_0xdf9b0a,{'requireOssPath':![]});if(!_0x137037)throw CliErrors[_0x27ee89(0x1c3)](_0x27ee89(0x1c5));return extractAndVerifyPackage(_0x137037,_0x18caf9);}function a99_0x23ef(){const _0x1a201c=['path','Runtime\x20Skill\x20package\x20file\x20sha256\x20mismatch:\x20','Duplicate\x20Skill\x20package\x20entry:\x20','toString','validation','zipSize','Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.','size','Runtime\x20Skill\x20package\x20entry\x20list\x20mismatch.','some','2270CsIIRd','object','get','Runtime\x20Skill\x20package\x20size\x20mismatch.','8yBVZkd','set','5136395OxzzNz','base64','227790tidRAN','Runtime\x20Skill\x20package\x20file\x20size\x20mismatch:\x20','isArray','requireOssPath','bytes','Runtime\x20Skill\x20file\x20tree\x20sha256\x20is\x20invalid.','\x20in\x20Skill\x20file\x20package.','toLowerCase','files','Runtime\x20Skill\x20package\x20size\x20is\x20invalid.','has','Runtime\x20Skill\x20package\x20is\x20missing\x20entry:\x20','6295130jyelwa','Runtime\x20Skill\x20package\x20is\x20required\x20for\x20Skill\x20install:\x20','Runtime\x20Skill\x20package\x20sha256\x20is\x20invalid.','trim','3928384IRTiHu','treeSha256','push','sha256','30852FcEQkd','243fdAEoO','schemaVersion','length','9rwqOdf','5958kNJGdW','Missing\x20','map','1419460SvJwzd','zipSha256'];a99_0x23ef=function(){return _0x1a201c;};return a99_0x23ef();}export function verifyRuntimeSkillBundle(_0x363432,_0x3d10ab){const _0x5c128b=a99_0x4a76,_0x555d9e=normalizePackageManifest(_0x363432,{'requireOssPath':![]});if(!_0x555d9e)throw CliErrors[_0x5c128b(0x1c3)](_0x5c128b(0x1c5));return extractAndVerifyPackageFiles(_0x555d9e,_0x3d10ab);}export function tryNormalizePackageManifest(_0x33be06){return normalizePackageManifest(_0x33be06,{'requireOssPath':![]});}export function requirePackageBytes(_0x150697,_0x1310c5){const _0x412792=a99_0x4a76;if(!_0x1310c5||_0x1310c5[_0x412792(0x1b8)]===0x0)throw CliErrors[_0x412792(0x1c3)](_0x412792(0x1ae)+_0x150697);return _0x1310c5;}export function extractDownloadedPackage(_0x44fec5){const _0x315413=a99_0x4a76,_0x4487e5=parseZipPackage(_0x44fec5)[_0x315413(0x1bc)](_0x58d1c0=>({'path':_0x58d1c0[_0x315413(0x1bf)],'bytes':_0x58d1c0[_0x315413(0x1d5)]}));if(!_0x4487e5['some'](_0x2c8488=>_0x2c8488[_0x315413(0x1bf)]===SKILL_FILE))throw CliErrors[_0x315413(0x1c3)]('Runtime\x20Skill\x20package\x20is\x20missing\x20'+SKILL_FILE+'.');return normalizeLocalFiles(_0x4487e5);}export function localFilesToManifestFiles(_0x58e738){const _0x37e35d=a99_0x4a76;return normalizeLocalFiles(_0x58e738)[_0x37e35d(0x1bc)](_0x12e858=>({'path':_0x12e858[_0x37e35d(0x1bf)],'sha256':fileHash(_0x12e858),'size':fileContent(_0x12e858)[_0x37e35d(0x1b8)]}));}function normalizePackageManifest(_0x119386,_0x11d22a){const _0x3ec7c7=a99_0x4a76;if(!_0x119386||typeof _0x119386!==_0x3ec7c7(0x1ca)||Array[_0x3ec7c7(0x1d3)](_0x119386))return undefined;const _0x1db43b=_0x119386,_0x4e630e=typeof _0x1db43b['ossPath']==='string'?_0x1db43b['ossPath'][_0x3ec7c7(0x1b0)]():undefined;if(_0x11d22a[_0x3ec7c7(0x1d4)]&&!_0x4e630e)return undefined;if(!Array[_0x3ec7c7(0x1d3)](_0x1db43b[_0x3ec7c7(0x1a9)])||_0x1db43b[_0x3ec7c7(0x1a9)][_0x3ec7c7(0x1b8)]===0x0)return undefined;if(!isSha256Hex(_0x1db43b['treeSha256']))throw CliErrors[_0x3ec7c7(0x1c3)](_0x3ec7c7(0x1d6));if(!isSha256Hex(_0x1db43b[_0x3ec7c7(0x1be)]))throw CliErrors[_0x3ec7c7(0x1c3)](_0x3ec7c7(0x1af));if(!Number['isSafeInteger'](_0x1db43b[_0x3ec7c7(0x1c4)])||_0x1db43b[_0x3ec7c7(0x1c4)]<0x0)throw CliErrors[_0x3ec7c7(0x1c3)](_0x3ec7c7(0x1aa));const _0x14772d=normalizeManifestFiles(_0x1db43b[_0x3ec7c7(0x1a9)]);if(!_0x14772d[_0x3ec7c7(0x1c8)](_0x305b93=>_0x305b93[_0x3ec7c7(0x1bf)]===SKILL_FILE))throw CliErrors[_0x3ec7c7(0x1c3)]('Runtime\x20Skill\x20manifest\x20is\x20missing\x20'+SKILL_FILE+'.');const _0x464ace=fileTreeHash(_0x14772d);if(_0x464ace!==_0x1db43b[_0x3ec7c7(0x1b2)][_0x3ec7c7(0x1a8)]())throw CliErrors['validation']('Runtime\x20Skill\x20file\x20tree\x20sha256\x20mismatch.');return{'schemaVersion':Number['isSafeInteger'](_0x1db43b[_0x3ec7c7(0x1b7)])?_0x1db43b['schemaVersion']:0x2,'ossPath':_0x4e630e,'treeSha256':_0x464ace,'zipSha256':_0x1db43b[_0x3ec7c7(0x1be)][_0x3ec7c7(0x1a8)](),'zipSize':_0x1db43b[_0x3ec7c7(0x1c4)],'files':_0x14772d};}function extractAndVerifyPackage(_0x47e1f0,_0x18a990){const _0x60ec80=a99_0x4a76,_0x29ec9c=normalizePackageManifest(_0x47e1f0,{'requireOssPath':![]});if(!_0x29ec9c)throw CliErrors[_0x60ec80(0x1c3)](_0x60ec80(0x1c5));if(_0x18a990['length']!==_0x29ec9c['zipSize'])throw CliErrors[_0x60ec80(0x1c3)](_0x60ec80(0x1cc));const _0x5ce47d=bufferSha256(_0x18a990);if(_0x5ce47d!==_0x29ec9c[_0x60ec80(0x1be)])throw CliErrors[_0x60ec80(0x1c3)]('Runtime\x20Skill\x20package\x20sha256\x20mismatch.');return extractAndVerifyPackageFiles(_0x29ec9c,_0x18a990);}function extractAndVerifyPackageFiles(_0x272b02,_0x44b8c7){const _0x2b61b9=a99_0x4a76,_0x46c054=parseZipPackage(_0x44b8c7);if(_0x46c054['length']!==_0x272b02[_0x2b61b9(0x1a9)][_0x2b61b9(0x1b8)])throw CliErrors[_0x2b61b9(0x1c3)](_0x2b61b9(0x1c7));const _0x367347=new Map();for(const _0x271ab6 of _0x46c054){if(_0x367347[_0x2b61b9(0x1ab)](_0x271ab6[_0x2b61b9(0x1bf)]))throw CliErrors[_0x2b61b9(0x1c3)](_0x2b61b9(0x1c1)+_0x271ab6['path']);_0x367347[_0x2b61b9(0x1ce)](_0x271ab6['path'],_0x271ab6);}const _0x3e88ec=[];for(const _0x370801 of _0x272b02[_0x2b61b9(0x1a9)]){const _0x49fbe5=_0x367347[_0x2b61b9(0x1cb)](_0x370801['path']);if(!_0x49fbe5)throw CliErrors['validation'](_0x2b61b9(0x1ac)+_0x370801['path']);if(_0x49fbe5[_0x2b61b9(0x1d5)][_0x2b61b9(0x1b8)]!==_0x370801[_0x2b61b9(0x1c6)])throw CliErrors[_0x2b61b9(0x1c3)](_0x2b61b9(0x1d2)+_0x370801[_0x2b61b9(0x1bf)]);const _0x21ee68=bufferSha256(_0x49fbe5[_0x2b61b9(0x1d5)]);if(_0x21ee68!==_0x370801[_0x2b61b9(0x1b4)])throw CliErrors[_0x2b61b9(0x1c3)](_0x2b61b9(0x1c0)+_0x370801[_0x2b61b9(0x1bf)]);_0x3e88ec[_0x2b61b9(0x1b3)]({'path':_0x370801[_0x2b61b9(0x1bf)],'bytes':_0x49fbe5[_0x2b61b9(0x1d5)]});}return normalizeLocalFiles(_0x3e88ec);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x437f63,_0x553335){var _0x482239=a100_0x495b,_0x4dd8e5=_0x437f63();while(!![]){try{var _0x5b93b4=-parseInt(_0x482239(0x91))/0x1+parseInt(_0x482239(0x94))/0x2*(-parseInt(_0x482239(0x9b))/0x3)+-parseInt(_0x482239(0x9c))/0x4*(-parseInt(_0x482239(0x9a))/0x5)+parseInt(_0x482239(0x95))/0x6*(-parseInt(_0x482239(0x97))/0x7)+parseInt(_0x482239(0x99))/0x8*(-parseInt(_0x482239(0x92))/0x9)+parseInt(_0x482239(0x93))/0xa+parseInt(_0x482239(0x98))/0xb*(parseInt(_0x482239(0x96))/0xc);if(_0x5b93b4===_0x553335)break;else _0x4dd8e5['push'](_0x4dd8e5['shift']());}catch(_0x167aa6){_0x4dd8e5['push'](_0x4dd8e5['shift']());}}}(a100_0x23a3,0xc14af));export{contentHash,fileTreeHash}from'./runtime-skill-sync/hashing.js';export{linkEffectiveRuntimeSkills,linkGlobalRuntimeSkills,pruneStaleRuntimeSkillCache,pruneStaleRuntimeSkillLinks}from'./runtime-skill-sync/links.js';function a100_0x495b(_0x5ee167,_0x4c58b7){_0x5ee167=_0x5ee167-0x91;var _0x23a3e0=a100_0x23a3();var _0x495b53=_0x23a3e0[_0x5ee167];return _0x495b53;}export{listLocalRuntimeSkills}from'./runtime-skill-sync/list-local.js';export{materializeRuntimeSkill}from'./runtime-skill-sync/materialize.js';function a100_0x23a3(){var _0x3cb11d=['15551090GgJYjY','2JNYpSd','2838918wlSgyB','72smLunF','7OLiVBX','3359279RwABGm','724504mMdPuY','68215dDgsqI','828789FJtfUD','72cvSkgh','642866tMPBsb','144nbvNPm'];a100_0x23a3=function(){return _0x3cb11d;};return a100_0x23a3();}export{readMetadataIfPresent}from'./runtime-skill-sync/metadata.js';export{getRuntimeSkillCacheRoot,getRuntimeSkillDir,resolveSkillSyncPaths}from'./runtime-skill-sync/paths.js';export{deriveSkillCodeFromDirectory,readPushDirectory,refreshPushDirectoryMetadataFromRemote,recordPushedRuntimeSkill,resolvePushDirectoryIdentity}from'./runtime-skill-sync/push.js';export{buildSkillPackage,verifyRuntimeSkillBundle,verifyRuntimeSkillPackage}from'./runtime-skill-sync/zip-package.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a101_0x2d35(_0x4e4fdb,_0x5bc325){_0x4e4fdb=_0x4e4fdb-0x13c;const _0xb699d1=a101_0xb699();let _0x2d35e1=_0xb699d1[_0x4e4fdb];return _0x2d35e1;}(function(_0xc1214e,_0x1ecef1){const _0x38adad=a101_0x2d35,_0x3c552c=_0xc1214e();while(!![]){try{const _0x55ba47=-parseInt(_0x38adad(0x13c))/0x1+-parseInt(_0x38adad(0x13e))/0x2+parseInt(_0x38adad(0x144))/0x3+-parseInt(_0x38adad(0x13f))/0x4*(-parseInt(_0x38adad(0x145))/0x5)+parseInt(_0x38adad(0x143))/0x6*(-parseInt(_0x38adad(0x142))/0x7)+parseInt(_0x38adad(0x140))/0x8+-parseInt(_0x38adad(0x13d))/0x9*(-parseInt(_0x38adad(0x141))/0xa);if(_0x55ba47===_0x1ecef1)break;else _0x3c552c['push'](_0x3c552c['shift']());}catch(_0xa8c518){_0x3c552c['push'](_0x3c552c['shift']());}}}(a101_0xb699,0x3148b));import{createJqFilter,resolveBundledJqPaths}from'@lovrabet/cli-framework';import{CliErrors}from'../errors.js';export const applyJqFilter=createJqFilter(CliErrors,{'bundledJqPaths':resolveBundledJqPaths()});function a101_0xb699(){const _0x2ec761=['546874uzkDZc','1192WwtvQG','794728uhxPlk','245470vgfFKM','70966lNOvre','144hCQJzY','488625veuMeM','770bJXisF','178620ZvmCoh','216bIJRBw'];a101_0xb699=function(){return _0x2ec761;};return a101_0xb699();}
|
package/lib/utils/logger.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a102_0x527a6e=a102_0x31ac;(function(_0x325203,_0x4b2690){const _0x5591a7=a102_0x31ac,_0x928470=_0x325203();while(!![]){try{const _0x1b2904=-parseInt(_0x5591a7(0x120))/0x1*(parseInt(_0x5591a7(0x117))/0x2)+parseInt(_0x5591a7(0x125))/0x3*(parseInt(_0x5591a7(0x142))/0x4)+parseInt(_0x5591a7(0x12c))/0x5+-parseInt(_0x5591a7(0x13c))/0x6*(-parseInt(_0x5591a7(0x134))/0x7)+-parseInt(_0x5591a7(0x144))/0x8*(-parseInt(_0x5591a7(0x136))/0x9)+-parseInt(_0x5591a7(0x139))/0xa*(-parseInt(_0x5591a7(0x140))/0xb)+parseInt(_0x5591a7(0x128))/0xc*(-parseInt(_0x5591a7(0x126))/0xd);if(_0x1b2904===_0x4b2690)break;else _0x928470['push'](_0x928470['shift']());}catch(_0x4a9e32){_0x928470['push'](_0x928470['shift']());}}}(a102_0x452c,0x8cd3b));import a102_0x26ecc7 from'winston';import a102_0x1d63c1 from'node:fs';function a102_0x31ac(_0x3c5cbd,_0x11802d){_0x3c5cbd=_0x3c5cbd-0x113;const _0x452cf4=a102_0x452c();let _0x31ac25=_0x452cf4[_0x3c5cbd];return _0x31ac25;}import a102_0x569577 from'node:path';import{PRODUCT_CONFIG}from'../constant/product.js';function a102_0x452c(){const _0x3e03a4=['message','format','20TufYNY','now','duration','252762tBqNYk','warn','green','errors','825913iCGqHo','blue','216vidrfw','map','156832kTKkNJ','createLogger','setLogPath','utf8','existsSync','stringify','split','getWinstonInstance','mkdirSync','unknown','winstonLogger','1402BrmwRf','level','timestamp','logFilePath','toISOString','writeFileSync','error','logFileName','parse','291FZBiBE','success','trim','Failed\x20to\x20clear\x20logs:','Completed:\x20','24537xivsMD','1894282klkmDy','info','60rTfreW','addColors','printf','initWinstonLogger','2064305sQvpGx','clearLogs','transports','Failed:\x20','logTask','combine','join','currentRawCommand','35ngURGD','dirname','135sbYoKq'];a102_0x452c=function(){return _0x3e03a4;};return a102_0x452c();}class Logger{[a102_0x527a6e(0x116)];[a102_0x527a6e(0x11a)]='';[a102_0x527a6e(0x133)]='';constructor(){}['setRawCommand'](_0x53700c){this['currentRawCommand']=_0x53700c;}[a102_0x527a6e(0x146)](_0x5e2921){const _0x3c27b8=a102_0x527a6e;this[_0x3c27b8(0x11a)]=a102_0x569577[_0x3c27b8(0x132)](_0x5e2921,PRODUCT_CONFIG[_0x3c27b8(0x11e)]),this[_0x3c27b8(0x116)]&&this['winstonLogger']['clear'](),this[_0x3c27b8(0x12b)]();}[a102_0x527a6e(0x12b)](){const _0x4f17c8=a102_0x527a6e,_0x111f1d=a102_0x569577[_0x4f17c8(0x135)](this['logFilePath']);!a102_0x1d63c1[_0x4f17c8(0x148)](_0x111f1d)&&a102_0x1d63c1[_0x4f17c8(0x114)](_0x111f1d,{'recursive':!![]});const _0x3c187f=a102_0x26ecc7[_0x4f17c8(0x138)][_0x4f17c8(0x131)](a102_0x26ecc7['format'][_0x4f17c8(0x119)](),a102_0x26ecc7[_0x4f17c8(0x138)][_0x4f17c8(0x13f)]({'stack':!![]}),a102_0x26ecc7[_0x4f17c8(0x138)][_0x4f17c8(0x12a)](_0x5706e2=>{const _0x40d886=_0x4f17c8,_0xd22a5e={'timestamp':_0x5706e2[_0x40d886(0x119)]||new Date()[_0x40d886(0x11b)](),'level':_0x5706e2[_0x40d886(0x118)]||_0x40d886(0x127),'command':_0x5706e2['command']||_0x40d886(0x115),'rawCommand':_0x5706e2['rawCommand']||this[_0x40d886(0x133)]||undefined,'message':_0x5706e2[_0x40d886(0x137)]||'','duration':_0x5706e2[_0x40d886(0x13b)]||undefined,'details':_0x5706e2['details']||undefined};return JSON[_0x40d886(0x149)](_0xd22a5e);}));this['winstonLogger']=a102_0x26ecc7[_0x4f17c8(0x145)]({'level':_0x4f17c8(0x127),'format':_0x3c187f,'transports':[new a102_0x26ecc7[(_0x4f17c8(0x12e))]['File']({'filename':this[_0x4f17c8(0x11a)],'level':'info'})],'silent':![]}),a102_0x26ecc7[_0x4f17c8(0x129)]({'success':_0x4f17c8(0x13e),'error':'red','warn':'yellow','info':_0x4f17c8(0x141)});}[a102_0x527a6e(0x127)](_0x5c608e,_0x5658d3,_0x5db367){const _0x3d6c92=a102_0x527a6e;if(!this[_0x3d6c92(0x11a)]||!this[_0x3d6c92(0x116)])return;this[_0x3d6c92(0x116)][_0x3d6c92(0x127)](_0x5658d3,{'command':_0x5c608e,'details':_0x5db367});}[a102_0x527a6e(0x121)](_0x2c8ed2,_0x5f5c81,_0x335dc4,_0x18d9e4){const _0x2f7d92=a102_0x527a6e;if(!this[_0x2f7d92(0x11a)]||!this[_0x2f7d92(0x116)])return;this['winstonLogger']['log'](_0x2f7d92(0x127),_0x5f5c81,{'level':'success','command':_0x2c8ed2,'duration':_0x335dc4,'details':_0x18d9e4});}[a102_0x527a6e(0x11d)](_0x2a865c,_0x12e8ea,_0xe8f6ab){const _0x58c87c=a102_0x527a6e;if(!this[_0x58c87c(0x11a)]||!this[_0x58c87c(0x116)])return;this[_0x58c87c(0x116)]['error'](_0x12e8ea,{'command':_0x2a865c,'details':_0xe8f6ab});}[a102_0x527a6e(0x13d)](_0x1e1091,_0x30804c,_0x56b3a9){const _0x481a13=a102_0x527a6e;if(!this[_0x481a13(0x11a)]||!this[_0x481a13(0x116)])return;this[_0x481a13(0x116)][_0x481a13(0x13d)](_0x30804c,{'command':_0x1e1091,'details':_0x56b3a9});}async[a102_0x527a6e(0x130)](_0x2a196b,_0x230b6a,_0x32ae46){const _0x46d657=a102_0x527a6e,_0x7bcdc3=Date['now']();this['info'](_0x2a196b,'Starting:\x20'+_0x230b6a);try{const _0x43c055=await _0x32ae46(),_0x268025=Date[_0x46d657(0x13a)]()-_0x7bcdc3;return this[_0x46d657(0x121)](_0x2a196b,_0x46d657(0x124)+_0x230b6a,_0x268025),_0x43c055;}catch(_0x251192){const _0x55fc0a=Date[_0x46d657(0x13a)]()-_0x7bcdc3;this['error'](_0x2a196b,_0x46d657(0x12f)+_0x230b6a,{'error':_0x251192 instanceof Error?_0x251192['message']:String(_0x251192),'duration':_0x55fc0a});throw _0x251192;}}['readLogs'](){const _0xbe9fd9=a102_0x527a6e;try{if(!a102_0x1d63c1[_0xbe9fd9(0x148)](this[_0xbe9fd9(0x11a)]))return[];const _0x9913be=a102_0x1d63c1['readFileSync'](this[_0xbe9fd9(0x11a)],_0xbe9fd9(0x147));return _0x9913be[_0xbe9fd9(0x14a)](/\r?\n/)['filter'](_0x291132=>_0x291132[_0xbe9fd9(0x122)]())[_0xbe9fd9(0x143)](_0x1d13ab=>JSON[_0xbe9fd9(0x11f)](_0x1d13ab));}catch(_0x446a25){return console[_0xbe9fd9(0x13d)]('Failed\x20to\x20read\x20logs:',_0x446a25),[];}}[a102_0x527a6e(0x12d)](){const _0x3cd144=a102_0x527a6e;try{a102_0x1d63c1['existsSync'](this[_0x3cd144(0x11a)])&&a102_0x1d63c1[_0x3cd144(0x11c)](this[_0x3cd144(0x11a)],'',_0x3cd144(0x147));}catch(_0x4944bc){console[_0x3cd144(0x13d)](_0x3cd144(0x123),_0x4944bc);}}[a102_0x527a6e(0x113)](){const _0x41a7b3=a102_0x527a6e;return this[_0x41a7b3(0x116)];}}export const logger=new Logger();
|
package/lib/utils/params.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x555320,_0x91a68b){var _0x22d0af=a103_0x4fa3,_0x408fc1=_0x555320();while(!![]){try{var _0x172a1e=parseInt(_0x22d0af(0x1c7))/0x1*(-parseInt(_0x22d0af(0x1cd))/0x2)+parseInt(_0x22d0af(0x1be))/0x3*(-parseInt(_0x22d0af(0x1c5))/0x4)+parseInt(_0x22d0af(0x1bf))/0x5*(parseInt(_0x22d0af(0x1ca))/0x6)+parseInt(_0x22d0af(0x1c2))/0x7+parseInt(_0x22d0af(0x1cc))/0x8*(parseInt(_0x22d0af(0x1c1))/0x9)+-parseInt(_0x22d0af(0x1c6))/0xa+-parseInt(_0x22d0af(0x1ce))/0xb*(-parseInt(_0x22d0af(0x1c8))/0xc);if(_0x172a1e===_0x91a68b)break;else _0x408fc1['push'](_0x408fc1['shift']());}catch(_0x34b7d7){_0x408fc1['push'](_0x408fc1['shift']());}}}(a103_0x4ecf,0x74100));import{CliErrors}from'../errors.js';export function parseJsonParams(_0x2a4b90){var _0x5a4404=a103_0x4fa3;if(!_0x2a4b90)return undefined;try{return JSON[_0x5a4404(0x1c9)](_0x2a4b90);}catch{throw CliErrors[_0x5a4404(0x1c0)](_0x5a4404(0x1c3)+_0x2a4b90);}}function a103_0x4ecf(){var _0x3c95d4=['Invalid\x20JSON\x20for\x20--params:\x20','isArray','12zFWhlj','1125090bFtdnY','1NQpPQS','300lkfuQq','parse','486bfxJRu','items','157936iSGLbM','431252EiYSCI','510565mhjtdD','batchCreate\x20--params\x20must\x20be\x20a\x20JSON\x20array\x20or\x20{\x22items\x22:[...]}','509526qUlWfv','6055wmxSLl','validation','9UCgliD','243915FRboWx'];a103_0x4ecf=function(){return _0x3c95d4;};return a103_0x4ecf();}export function parseJsonParamsValue(_0x121934){var _0xb874b3=a103_0x4fa3;if(!_0x121934)return undefined;try{return JSON[_0xb874b3(0x1c9)](_0x121934);}catch{throw CliErrors['validation'](_0xb874b3(0x1c3)+_0x121934);}}function a103_0x4fa3(_0x1f2efd,_0x139b49){_0x1f2efd=_0x1f2efd-0x1be;var _0x4ecf1e=a103_0x4ecf();var _0x4fa3b1=_0x4ecf1e[_0x1f2efd];return _0x4fa3b1;}export function parseBatchCreateItemsFromParams(_0x210f2a){var _0x42c4e5=a103_0x4fa3;if(Array[_0x42c4e5(0x1c4)](_0x210f2a))return _0x210f2a;if(_0x210f2a!==null&&_0x210f2a!==undefined&&typeof _0x210f2a==='object'&&Array[_0x42c4e5(0x1c4)](_0x210f2a[_0x42c4e5(0x1cb)]))return _0x210f2a['items'];throw CliErrors[_0x42c4e5(0x1c0)](_0x42c4e5(0x1cf),'Example:\x20--params\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27');}
|
package/lib/utils/platform.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a104_0x59d71e=a104_0x2154;(function(_0x1a40f4,_0x38e7be){const _0x3db2c7=a104_0x2154,_0x70669f=_0x1a40f4();while(!![]){try{const _0x117210=parseInt(_0x3db2c7(0x14a))/0x1+parseInt(_0x3db2c7(0x146))/0x2+parseInt(_0x3db2c7(0x14d))/0x3*(-parseInt(_0x3db2c7(0x14b))/0x4)+parseInt(_0x3db2c7(0x14e))/0x5*(-parseInt(_0x3db2c7(0x147))/0x6)+-parseInt(_0x3db2c7(0x144))/0x7+-parseInt(_0x3db2c7(0x14f))/0x8*(parseInt(_0x3db2c7(0x145))/0x9)+parseInt(_0x3db2c7(0x149))/0xa;if(_0x117210===_0x38e7be)break;else _0x70669f['push'](_0x70669f['shift']());}catch(_0x57e376){_0x70669f['push'](_0x70669f['shift']());}}}(a104_0x1688,0x9b632));export const isWindows=process[a104_0x59d71e(0x14c)]===a104_0x59d71e(0x148);function a104_0x2154(_0x3d481e,_0xf643ff){_0x3d481e=_0x3d481e-0x144;const _0x1688b2=a104_0x1688();let _0x2154c4=_0x1688b2[_0x3d481e];return _0x2154c4;}export function resolveNpmBin(_0x521dee){return isWindows?_0x521dee+'.cmd':_0x521dee;}function a104_0x1688(){const _0x336041=['1347908huXkNX','208344idHkmQ','win32','2982000vlTKaE','904276CVUiGT','4616IwPoHo','platform','498sQswsP','15IWpOai','28304UKIDFL','2795632jBxNQB','1386JGglUq'];a104_0x1688=function(){return _0x336041;};return a104_0x1688();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5af5f0,_0x34bc07){const _0x2f1a86=a105_0x10cd,_0x4e8aba=_0x5af5f0();while(!![]){try{const _0x2fcc8d=-parseInt(_0x2f1a86(0xff))/0x1+-parseInt(_0x2f1a86(0xf6))/0x2*(-parseInt(_0x2f1a86(0xe1))/0x3)+-parseInt(_0x2f1a86(0xef))/0x4+parseInt(_0x2f1a86(0xfb))/0x5*(-parseInt(_0x2f1a86(0xdb))/0x6)+-parseInt(_0x2f1a86(0xf0))/0x7*(-parseInt(_0x2f1a86(0xdd))/0x8)+parseInt(_0x2f1a86(0xdf))/0x9*(parseInt(_0x2f1a86(0xdc))/0xa)+parseInt(_0x2f1a86(0xda))/0xb*(parseInt(_0x2f1a86(0xfc))/0xc);if(_0x2fcc8d===_0x34bc07)break;else _0x4e8aba['push'](_0x4e8aba['shift']());}catch(_0x5d1e63){_0x4e8aba['push'](_0x4e8aba['shift']());}}}(a105_0xb9c2,0xd0b64));import{mkdir,readFile,writeFile}from'node:fs/promises';import{homedir}from'node:os';function a105_0xb9c2(){const _0x80b1c=['minor','\x20update','json','now','.cache','timeout','major','lastNotifiedVersion','update-check.json','match','4871168EMxWmP','7GwwACX','latest','Invalid\x20semver','number','map','trim','419962AxFtwT','/-/package/','filter',',\x20run:\x20','entries','93700SatRRY','768756Tzchrb','\x20available,\x20current\x20','prerelease','570181RhkcbD','fromEntries','true','stringify','checkedAt','33CkseMR','396ErzKyR','50ZIbcTi','5821688QxQVJu','utf8','2681874iuQWuM','string','21GaJVeA','/dist-tags','yes','lovrabet-cli'];a105_0xb9c2=function(){return _0x80b1c;};return a105_0xb9c2();}import{dirname,join}from'node:path';import{LOVRABET_NPM_PACKAGE_NAME,NPM_REGISTRY_BASE_URL}from'../constant/distribution.js';function a105_0x10cd(_0x3e2475,_0x3a22df){_0x3e2475=_0x3e2475-0xd6;const _0xb9c20e=a105_0xb9c2();let _0x10cd8e=_0xb9c20e[_0x3e2475];return _0x10cd8e;}import{CLI_BIN_NAME}from'../constant/cli.js';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(_0x28fecb){const _0x503f27=a105_0x10cd,_0x21e5ef=_0x28fecb[_0x503f27(0xf5)]()[_0x503f27(0xee)](/^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?$/);if(!_0x21e5ef)return null;return{'major':Number(_0x21e5ef[0x1]),'minor':Number(_0x21e5ef[0x2]),'patch':Number(_0x21e5ef[0x3]),'prerelease':_0x21e5ef[0x4]};}function compareSemver(_0x1dd5b1,_0x24cce2){const _0x5b49ba=a105_0x10cd,_0x11640c=parseSemver(_0x1dd5b1),_0x339216=parseSemver(_0x24cce2);if(!_0x11640c||!_0x339216)throw new Error(_0x5b49ba(0xf2));for(const _0x525808 of[_0x5b49ba(0xeb),_0x5b49ba(0xe5),'patch']){if(_0x11640c[_0x525808]<_0x339216[_0x525808])return-0x1;if(_0x11640c[_0x525808]>_0x339216[_0x525808])return 0x1;}if(!_0x11640c[_0x5b49ba(0xfe)]&&!_0x339216[_0x5b49ba(0xfe)])return 0x0;if(!_0x11640c[_0x5b49ba(0xfe)])return 0x1;if(!_0x339216['prerelease'])return-0x1;if(_0x11640c[_0x5b49ba(0xfe)]===_0x339216[_0x5b49ba(0xfe)])return 0x0;return _0x11640c['prerelease']<_0x339216[_0x5b49ba(0xfe)]?-0x1:0x1;}function isUpdateNoticeDisabled(){const _0x59558c=a105_0x10cd,_0x2d96dc=process.env.LOVRABET_NO_UPDATE_NOTICE?.[_0x59558c(0xf5)]()['toLowerCase']();return _0x2d96dc==='1'||_0x2d96dc===_0x59558c(0xd7)||_0x2d96dc===_0x59558c(0xe3);}function cacheRoot(){const _0xa8aed=a105_0x10cd;return process.env.XDG_CACHE_HOME||process.env.LOCALAPPDATA||join(homedir(),_0xa8aed(0xe9));}export function getUpdateNoticeCachePath(){const _0x5c8ec6=a105_0x10cd;return join(cacheRoot(),_0x5c8ec6(0xe4),_0x5c8ec6(0xed));}async function readUpdateNoticeCache(){const _0x4b7219=a105_0x10cd;try{const _0x4de0e4=await readFile(getUpdateNoticeCachePath(),_0x4b7219(0xde)),_0xdbe162=JSON['parse'](_0x4de0e4);if(!_0xdbe162||typeof _0xdbe162!=='object')return{};return _0xdbe162;}catch{return{};}}async function writeUpdateNoticeCache(_0x1f0329){const _0x3ba419=a105_0x10cd;try{const _0x478f29=getUpdateNoticeCachePath();await mkdir(dirname(_0x478f29),{'recursive':!![]}),await writeFile(_0x478f29,JSON[_0x3ba419(0xd8)](_0x1f0329,null,0x2)+'\x0a',_0x3ba419(0xde));}catch{}}function isFreshCheck(_0x3875a6,_0x16fb90){const _0x476604=a105_0x10cd;return typeof _0x3875a6[_0x476604(0xd9)]===_0x476604(0xf3)&&_0x16fb90-_0x3875a6[_0x476604(0xd9)]<UPDATE_CHECK_TTL_MS;}function isRecentlyNotified(_0x2e88de,_0x43cc30,_0x54b12d){const _0x436523=a105_0x10cd;return _0x2e88de[_0x436523(0xec)]===_0x43cc30&&typeof _0x2e88de['lastNotifiedAt']===_0x436523(0xf3)&&_0x54b12d-_0x2e88de['lastNotifiedAt']<UPDATE_NOTICE_TTL_MS;}async function fetchNpmDistTags(_0x2e0073=0x5dc){const _0x39972f=a105_0x10cd;try{const _0x4b9e0d=NPM_REGISTRY_BASE_URL+_0x39972f(0xf7)+encodeURIComponent(LOVRABET_NPM_PACKAGE_NAME)+_0x39972f(0xe2),_0x5739d7=await fetch(_0x4b9e0d,{'signal':AbortSignal[_0x39972f(0xea)](_0x2e0073)});if(!_0x5739d7['ok'])return null;const _0xdcab3b=await _0x5739d7[_0x39972f(0xe7)]();if(!_0xdcab3b||typeof _0xdcab3b!=='object')return null;return Object[_0x39972f(0xd6)](Object[_0x39972f(0xfa)](_0xdcab3b)[_0x39972f(0xf8)](([,_0x11c606])=>typeof _0x11c606===_0x39972f(0xe0)&&_0x11c606['trim']())[_0x39972f(0xf4)](([_0x422699,_0x492861])=>[_0x422699,String(_0x492861)[_0x39972f(0xf5)]()]));}catch{return null;}}export function buildNpmVersionUrl(_0x3566c0){return'https://www.npmjs.com/package/'+LOVRABET_NPM_PACKAGE_NAME+'/v/'+_0x3566c0;}export async function resolveLatestUpdateNotice(){const _0x5d457a=a105_0x10cd;if(isUpdateNoticeDisabled())return null;try{const _0x1343a2=Date[_0x5d457a(0xe8)](),_0xef1d89=getCliVersion(),_0x1f44a6=await readUpdateNoticeCache();let _0x30cd38=isFreshCheck(_0x1f44a6,_0x1343a2)?_0x1f44a6['latest']?.[_0x5d457a(0xf5)]():undefined;if(!_0x30cd38&&!isFreshCheck(_0x1f44a6,_0x1343a2)){const _0x49b41e=await fetchNpmDistTags();_0x30cd38=_0x49b41e?.[_0x5d457a(0xf1)]?.[_0x5d457a(0xf5)](),await writeUpdateNoticeCache({..._0x1f44a6,'checkedAt':_0x1343a2,'latest':_0x30cd38,'failed':!_0x30cd38});}if(!_0x30cd38||compareSemver(_0xef1d89,_0x30cd38)>=0x0)return null;if(isRecentlyNotified(_0x1f44a6,_0x30cd38,_0x1343a2))return null;const _0x201e8c=CLI_BIN_NAME+_0x5d457a(0xe6);return await writeUpdateNoticeCache({..._0x1f44a6,'checkedAt':isFreshCheck(_0x1f44a6,_0x1343a2)?_0x1f44a6[_0x5d457a(0xd9)]:_0x1343a2,'latest':_0x30cd38,'failed':![],'lastNotifiedVersion':_0x30cd38,'lastNotifiedAt':_0x1343a2}),{'command':_0x201e8c,'current':_0xef1d89,'latest':_0x30cd38,'url':buildNpmVersionUrl(_0x30cd38),'message':CLI_BIN_NAME+'\x20'+_0x30cd38+_0x5d457a(0xfd)+_0xef1d89+_0x5d457a(0xf9)+_0x201e8c};}catch{return null;}}
|
package/lib/utils/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x357644,_0x59b700){const _0x113fac=a106_0x1a37,_0x46a4a6=_0x357644();while(!![]){try{const _0x13be94=-parseInt(_0x113fac(0x1d2))/0x1*(-parseInt(_0x113fac(0x1d8))/0x2)+parseInt(_0x113fac(0x1d6))/0x3*(-parseInt(_0x113fac(0x1d1))/0x4)+parseInt(_0x113fac(0x1cf))/0x5+-parseInt(_0x113fac(0x1d3))/0x6+-parseInt(_0x113fac(0x1d0))/0x7*(-parseInt(_0x113fac(0x1cd))/0x8)+parseInt(_0x113fac(0x1ce))/0x9*(-parseInt(_0x113fac(0x1d7))/0xa)+parseInt(_0x113fac(0x1d4))/0xb;if(_0x13be94===_0x59b700)break;else _0x46a4a6['push'](_0x46a4a6['shift']());}catch(_0x16d96b){_0x46a4a6['push'](_0x46a4a6['shift']());}}}(a106_0x2acf,0x98e77));import{BUILD_TIME,GIT_COMMIT,VERSION}from'../generated/build-info.js';function a106_0x1a37(_0x277ba2,_0x6d8c95){_0x277ba2=_0x277ba2-0x1cd;const _0x2acffd=a106_0x2acf();let _0x1a375f=_0x2acffd[_0x277ba2];return _0x1a375f;}function a106_0x2acf(){const _0x4d9585=['1527317JiElPG','slice','15RJYHZH','10CRoTaf','78478eoTOZG','unknown','20608VdViHn','10083411aytILJ','3570180LONkMR','1442rNrExP','312940KKVlxX','29ZWEThi','2301726xlrGbb'];a106_0x2acf=function(){return _0x4d9585;};return a106_0x2acf();}export function getCliVersion(){return VERSION;}export function getCliGitCommit(){const _0x83647d=a106_0x1a37,_0x5768a9=String(GIT_COMMIT);return _0x5768a9&&_0x5768a9!==_0x83647d(0x1d9)?_0x5768a9:'';}export function getCliVersionDisplay(){const _0x334d76=a106_0x1a37,_0x5a075d=getCliGitCommit(),_0x3d2a90=BUILD_TIME[_0x334d76(0x1d5)](0x0,0xa);if(!_0x5a075d||!_0x3d2a90)return VERSION;return VERSION+'\x20('+_0x5a075d+',\x20'+_0x3d2a90+')';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x15c966,_0xe34a6a){var _0x567011=a107_0x2081,_0x2ae747=_0x15c966();while(!![]){try{var _0x80bc7a=parseInt(_0x567011(0x143))/0x1+-parseInt(_0x567011(0x142))/0x2*(-parseInt(_0x567011(0x148))/0x3)+-parseInt(_0x567011(0x140))/0x4+parseInt(_0x567011(0x13f))/0x5*(-parseInt(_0x567011(0x144))/0x6)+parseInt(_0x567011(0x145))/0x7+parseInt(_0x567011(0x146))/0x8*(parseInt(_0x567011(0x13e))/0x9)+-parseInt(_0x567011(0x147))/0xa*(parseInt(_0x567011(0x141))/0xb);if(_0x80bc7a===_0xe34a6a)break;else _0x2ae747['push'](_0x2ae747['shift']());}catch(_0x593f3e){_0x2ae747['push'](_0x2ae747['shift']());}}}(a107_0x1e9d,0xd020f));function a107_0x2081(_0xd236c9,_0x2eb342){_0xd236c9=_0xd236c9-0x13c;var _0x1e9dc5=a107_0x1e9d();var _0x208119=_0x1e9dc5[_0xd236c9];return _0x208119;}export function writeCliSideChannelLine(_0x367020){var _0x42e9c6=a107_0x2081;process[_0x42e9c6(0x13d)][_0x42e9c6(0x13c)](_0x367020+'\x0a');}function a107_0x1e9d(){var _0x26d2dd=['stderr','63009sTRFWQ','1004695PRdOcq','3368652EZXUeP','4204882gjmBiZ','4TZHXZt','1014796srTjDK','18pCGMsz','8121106tGndXF','1432VEwCNo','70dGAnuQ','2317764RhiWdQ','write'];a107_0x1e9d=function(){return _0x26d2dd;};return a107_0x1e9d();}
|