@lovrabet/lovrabet-cli 2.1.22-beta.6 → 2.1.22
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/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/artifact/index.js +1 -1
- package/lib/commands/auth/device.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/common/local-file.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/file/index.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/ocr/index.js +1 -1
- package/lib/commands/personal-bff/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/schedule/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/service/dynamic.js +1 -1
- package/lib/commands/service/function-name-adapter.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/diagram.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/diagram.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-execute.js +1 -1
- package/lib/commands/skill/push-flow-helpers.js +1 -1
- package/lib/commands/skill/push-retarget.js +1 -1
- 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/rate-limit.js +1 -1
- package/lib/framework/raw-flags.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/service-order.js +1 -1
- package/lib/framework/types.d.ts +4 -0
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/runtime/confirmation.d.ts +9 -0
- package/lib/runtime/confirmation.js +1 -0
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.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/install-target.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/lossless-json.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
|
-
|
|
1
|
+
(function(_0x55996f,_0x4d046b){const _0x3c639f=a113_0xa9ff,_0x44d50c=_0x55996f();while(!![]){try{const _0x314a67=parseInt(_0x3c639f(0xc2))/0x1*(-parseInt(_0x3c639f(0xc5))/0x2)+parseInt(_0x3c639f(0xc4))/0x3*(-parseInt(_0x3c639f(0xd9))/0x4)+-parseInt(_0x3c639f(0xcf))/0x5+parseInt(_0x3c639f(0xbb))/0x6+parseInt(_0x3c639f(0xdf))/0x7*(parseInt(_0x3c639f(0xd0))/0x8)+parseInt(_0x3c639f(0xba))/0x9*(-parseInt(_0x3c639f(0xc9))/0xa)+-parseInt(_0x3c639f(0xd5))/0xb*(-parseInt(_0x3c639f(0xce))/0xc);if(_0x314a67===_0x4d046b)break;else _0x44d50c['push'](_0x44d50c['shift']());}catch(_0x272f0e){_0x44d50c['push'](_0x44d50c['shift']());}}}(a113_0x59ab,0x96fcb));import{readFileSync,readdirSync,realpathSync}from'node:fs';import{relative,resolve}from'node:path';import{CliErrors}from'../../errors.js';import{IGNORED_DIR_NAMES,IGNORED_FILE_NAMES,SKILL_FILE}from'./constants.js';export function fileContent(_0xf3664c){const _0x58dbff=a113_0xa9ff;return _0xf3664c[_0x58dbff(0xc0)]??Buffer[_0x58dbff(0xbf)](_0xf3664c['content']??'',_0x58dbff(0xc8));}function a113_0x59ab(){const _0x303b75=['name','16569aqxHnI','316782MNlcTP','Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20','includes','split','from','bytes','Skill\x20file\x20sha256\x20is\x20invalid:\x20','283uTfFoD','sha256','3lRhucq','8130OjpWxY','trim','sort','utf8','70DldiGW','object','isSafeInteger','Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20','Duplicate\x20Skill\x20file\x20path:\x20','2856WFypaM','5922910ZBfWtp','3376968VfxViY','replace','isDirectory','toString','content','142549kWhOMT','localeCompare','isSymbolicLink','isFile','2371412iOEGya','set','size','Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20','path','Skill\x20file\x20size\x20is\x20invalid:\x20','7NFXBGF','Skill\x20file\x20path\x20must\x20be\x20text.','validation','string','push','Unsafe\x20Skill\x20file\x20path:\x20','test','has','toLowerCase','length'];a113_0x59ab=function(){return _0x303b75;};return a113_0x59ab();}export function fileText(_0x374274){const _0xb2cfbd=a113_0xa9ff;return fileContent(_0x374274)[_0xb2cfbd(0xd3)](_0xb2cfbd(0xc8));}function a113_0xa9ff(_0x318050,_0x274e55){_0x318050=_0x318050-0xb9;const _0x59ab14=a113_0x59ab();let _0xa9ff5e=_0x59ab14[_0x318050];return _0xa9ff5e;}export function normalizeLocalFiles(_0x1dc17a){const _0x3c4235=a113_0xa9ff;if(!Array['isArray'](_0x1dc17a)||_0x1dc17a['length']===0x0)return[];const _0x55765e=new Map();for(const _0xf5a699 of _0x1dc17a){if(!_0xf5a699||typeof _0xf5a699!==_0x3c4235(0xca)||typeof _0xf5a699[_0x3c4235(0xdd)]!==_0x3c4235(0xe2))throw CliErrors[_0x3c4235(0xe1)](_0x3c4235(0xe0));const _0x24e232=normalizeSkillRelativePath(_0xf5a699['path']);if(_0x55765e[_0x3c4235(0xe6)](_0x24e232))throw CliErrors[_0x3c4235(0xe1)](_0x3c4235(0xcd)+_0x24e232);if(_0xf5a699[_0x3c4235(0xc0)]!==undefined&&!Buffer['isBuffer'](_0xf5a699['bytes']))throw CliErrors[_0x3c4235(0xe1)](_0x3c4235(0xdc)+_0x24e232);if(_0xf5a699['bytes']===undefined&&typeof _0xf5a699[_0x3c4235(0xd4)]!==_0x3c4235(0xe2))throw CliErrors[_0x3c4235(0xe1)](_0x3c4235(0xcc)+_0x24e232);const _0x1ab6b7=fileContent(_0xf5a699);_0x55765e[_0x3c4235(0xda)](_0x24e232,{'path':_0x24e232,'bytes':_0x1ab6b7});}return Array[_0x3c4235(0xbf)](_0x55765e['values']())[_0x3c4235(0xc7)](compareSkillFiles);}export function normalizeManifestFiles(_0x45615c){const _0x390172=a113_0xa9ff;if(!Array['isArray'](_0x45615c)||_0x45615c[_0x390172(0xe8)]===0x0)return[];const _0x1eaf21=new Map();for(const _0x2033e8 of _0x45615c){if(!_0x2033e8||typeof _0x2033e8!==_0x390172(0xca)||typeof _0x2033e8['path']!==_0x390172(0xe2))throw CliErrors[_0x390172(0xe1)](_0x390172(0xe0));const _0x521e64=normalizeSkillRelativePath(_0x2033e8[_0x390172(0xdd)]);if(_0x1eaf21[_0x390172(0xe6)](_0x521e64))throw CliErrors[_0x390172(0xe1)](_0x390172(0xcd)+_0x521e64);if(!isSha256Hex(_0x2033e8[_0x390172(0xc3)]))throw CliErrors['validation'](_0x390172(0xc1)+_0x521e64);if(!Number[_0x390172(0xcb)](_0x2033e8[_0x390172(0xdb)])||_0x2033e8[_0x390172(0xdb)]<0x0)throw CliErrors[_0x390172(0xe1)](_0x390172(0xde)+_0x521e64);_0x1eaf21[_0x390172(0xda)](_0x521e64,{'path':_0x521e64,'sha256':_0x2033e8[_0x390172(0xc3)][_0x390172(0xe7)](),'size':_0x2033e8[_0x390172(0xdb)]});}return Array[_0x390172(0xbf)](_0x1eaf21['values']())[_0x390172(0xc7)](compareSkillFiles);}export function scanSkillDirectory(_0x1afd6a){const _0x2853fd=realpathSync(_0x1afd6a),_0x1879c0=[];function _0x392e98(_0x3bd88e){const _0x11c4a6=a113_0xa9ff,_0x2f4a5e=readdirSync(_0x3bd88e,{'withFileTypes':!![]})[_0x11c4a6(0xc7)]((_0x15c013,_0x459449)=>_0x15c013[_0x11c4a6(0xb9)][_0x11c4a6(0xd6)](_0x459449['name']));for(const _0x167c8b of _0x2f4a5e){if(_0x167c8b[_0x11c4a6(0xd2)]()&&IGNORED_DIR_NAMES['has'](_0x167c8b['name']))continue;if(IGNORED_FILE_NAMES[_0x11c4a6(0xe6)](_0x167c8b[_0x11c4a6(0xb9)]))continue;const _0x3d52c9=resolve(_0x3bd88e,_0x167c8b[_0x11c4a6(0xb9)]);if(_0x167c8b[_0x11c4a6(0xd7)]())throw CliErrors[_0x11c4a6(0xe1)](_0x11c4a6(0xbc)+_0x3d52c9);const _0x2b299b=toPosixPath(relative(_0x2853fd,_0x3d52c9));if(_0x167c8b['isDirectory']()){_0x392e98(_0x3d52c9);continue;}if(!_0x167c8b[_0x11c4a6(0xd8)]())continue;validateSkillRelativePath(_0x2b299b);const _0x1c9560=readFileSync(_0x3d52c9);_0x1879c0[_0x11c4a6(0xe3)]({'path':_0x2b299b,'bytes':_0x1c9560});}}return _0x392e98(_0x2853fd),normalizeLocalFiles(_0x1879c0);}export function compareSkillFiles(_0x3da833,_0x16f7ee){const _0x1ea38b=a113_0xa9ff;if(_0x3da833[_0x1ea38b(0xdd)]===SKILL_FILE)return _0x16f7ee[_0x1ea38b(0xdd)]===SKILL_FILE?0x0:-0x1;if(_0x16f7ee[_0x1ea38b(0xdd)]===SKILL_FILE)return 0x1;return Buffer['compare'](Buffer['from'](_0x3da833[_0x1ea38b(0xdd)],_0x1ea38b(0xc8)),Buffer[_0x1ea38b(0xbf)](_0x16f7ee[_0x1ea38b(0xdd)],_0x1ea38b(0xc8)));}export function normalizeSkillRelativePath(_0x1e20ea){const _0x42fd22=a113_0xa9ff,_0x4942f7=toPosixPath(_0x1e20ea[_0x42fd22(0xc6)]());return validateSkillRelativePath(_0x4942f7),_0x4942f7;}export function validateSkillRelativePath(_0x5c9161){const _0x35eda8=a113_0xa9ff;if(!_0x5c9161||_0x5c9161['startsWith']('/')||_0x5c9161[_0x35eda8(0xbd)]('//'))throw CliErrors[_0x35eda8(0xe1)](_0x35eda8(0xe4)+_0x5c9161);for(const _0x46fab3 of _0x5c9161[_0x35eda8(0xbe)]('/')){if(!_0x46fab3||_0x46fab3==='.'||_0x46fab3==='..')throw CliErrors[_0x35eda8(0xe1)]('Unsafe\x20Skill\x20file\x20path:\x20'+_0x5c9161);}}export function toPosixPath(_0x119383){const _0x292821=a113_0xa9ff;return _0x119383[_0x292821(0xd1)](/\\/g,'/');}export function isSha256Hex(_0x88bf12){const _0x140934=a113_0xa9ff;return typeof _0x88bf12===_0x140934(0xe2)&&/^[a-fA-F0-9]{64}$/[_0x140934(0xe5)](_0x88bf12);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x136ce5,_0x1566ed){const _0x1aca63=a114_0x2029,_0x335097=_0x136ce5();while(!![]){try{const _0x25957f=-parseInt(_0x1aca63(0x13e))/0x1+parseInt(_0x1aca63(0x132))/0x2+-parseInt(_0x1aca63(0x12e))/0x3+-parseInt(_0x1aca63(0x135))/0x4+-parseInt(_0x1aca63(0x124))/0x5*(parseInt(_0x1aca63(0x137))/0x6)+parseInt(_0x1aca63(0x133))/0x7*(-parseInt(_0x1aca63(0x11c))/0x8)+-parseInt(_0x1aca63(0x125))/0x9*(-parseInt(_0x1aca63(0x11f))/0xa);if(_0x25957f===_0x1566ed)break;else _0x335097['push'](_0x335097['shift']());}catch(_0x329457){_0x335097['push'](_0x335097['shift']());}}}(a114_0x39a6,0xd2856));import{existsSync,lstatSync,mkdirSync,readFileSync,rmSync}from'node:fs';import{dirname,resolve}from'node:path';import{isCollection,isMap,isNode,parseDocument,visit}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{resolveManagedFilePath,writeBytesAtomic,writeJsonAtomic}from'./fs-utils.js';function a114_0x2029(_0x39d6e9,_0x18757f){_0x39d6e9=_0x39d6e9-0x112;const _0x39a6f5=a114_0x39a6();let _0x2029a2=_0x39a6f5[_0x39d6e9];return _0x2029a2;}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(_0x470c9e,_0x533f76,_0xfafc41){const _0x1b9d53=a114_0x2029,_0x2f798a=requireSkillCode(_0x470c9e),_0xd6bc40=requirePackageBytes(_0x2f798a,_0xfafc41['packageBytes']),_0x3ee589=extractDownloadedPackage(_0xd6bc40),_0x140806=_0x3ee589[_0x1b9d53(0x142)](_0x5a9dbb=>_0x5a9dbb[_0x1b9d53(0x128)]===SKILL_FILE);if(!_0x140806)throw CliErrors[_0x1b9d53(0x119)](_0x1b9d53(0x113)+SKILL_FILE+':\x20'+_0x2f798a);const _0x35f637=withMaterializedSkillFrontmatter(_0x3ee589,_0x470c9e,_0x2f798a),_0x589606=_0x35f637[_0x1b9d53(0x142)](_0x4e1f8f=>_0x4e1f8f[_0x1b9d53(0x128)]===SKILL_FILE),_0x41108d=fileText(_0x589606),_0x34639e=getRuntimeSkillDir(_0xfafc41[_0x1b9d53(0x138)],_0xfafc41['accessKey'],_0xfafc41['appCode'],_0x533f76,_0x2f798a,_0xfafc41[_0x1b9d53(0x143)]),_0x83061e=resolve(_0x34639e,SKILL_FILE),_0xe4926b=resolve(_0x34639e,METADATA_FILE),_0x1eb19b=contentHash(_0x41108d),_0x1a7937=readMetadataIfPresent(_0xe4926b)?.[_0x1b9d53(0x144)];ensurePulledFilesCanBeOverwritten(_0x34639e,_0xe4926b,_0x35f637,_0xfafc41[_0x1b9d53(0x126)]===!![]),mkdirSync(_0x34639e,{'recursive':!![],'mode':0x1c0});const _0x2b855d=existsSync(_0x83061e)?readFileSync(_0x83061e,'utf8'):undefined;return materializeFiles(_0x34639e,_0x35f637),removeStaleManagedFiles(_0x34639e,_0x1a7937,_0x35f637),writeJsonAtomic(_0xe4926b,buildMetadata(_0x470c9e,_0x533f76,_0xfafc41['appCode'],_0x1eb19b,_0xfafc41[_0x1b9d53(0x112)],_0x35f637,_0xd6bc40)),{'skill':_0x470c9e,'scope':_0x533f76,'dir':_0x34639e,'skillMdPath':_0x83061e,'metadataPath':_0xe4926b,'contentHash':_0x1eb19b,'changed':_0x2b855d!==_0x41108d};}function withMaterializedSkillFrontmatter(_0x28e2c0,_0x6fb070,_0x4c722a){const _0x37c6c6=a114_0x2029,_0x5bc141=skillDisplayName(_0x6fb070,_0x4c722a),_0x42e0d0=_0x6fb070[_0x37c6c6(0x116)]?.[_0x37c6c6(0x13b)]()||_0x5bc141||_0x4c722a;return normalizeLocalFiles(_0x28e2c0)[_0x37c6c6(0x127)](_0x43f793=>{const _0x5a9efe=_0x37c6c6,_0x54d379=fileText(_0x43f793);if(_0x43f793[_0x5a9efe(0x128)]!==SKILL_FILE)return _0x43f793;if(hasYamlFrontmatter(_0x54d379))return{'path':_0x43f793[_0x5a9efe(0x128)],'content':withSyncedDisplayName(_0x54d379,_0x5bc141)};return{'path':_0x43f793[_0x5a9efe(0x128)],'content':prependSkillFrontmatter(_0x54d379,{'name':_0x4c722a,'displayName':_0x5bc141,'description':_0x42e0d0})};});}function hasYamlFrontmatter(_0x4f8d90){const _0x137fa2=a114_0x2029;return/^\uFEFF?---\s*\r?\n/[_0x137fa2(0x141)](_0x4f8d90);}function prependSkillFrontmatter(_0x4cbda3,_0x1edef3){const _0x29ca81=a114_0x2029,_0x6260a4=_0x4cbda3[_0x29ca81(0x145)](/^\uFEFF/,'');return[_0x29ca81(0x11d),'name:\x20'+yamlString(_0x1edef3['name']),_0x1edef3['displayName']?_0x29ca81(0x12b)+yamlString(_0x1edef3['displayName']):undefined,_0x29ca81(0x130)+yamlString(_0x1edef3[_0x29ca81(0x116)]),_0x29ca81(0x11d),'',_0x6260a4][_0x29ca81(0x115)](_0x29c0bd=>_0x29c0bd!==undefined)[_0x29ca81(0x12c)]('\x0a');}function yamlString(_0x53b3bf){const _0x2d97c9=a114_0x2029;return JSON[_0x2d97c9(0x13f)](_0x53b3bf[_0x2d97c9(0x145)](/\r/g,'')['trim']());}function skillDisplayName(_0x2ca69e,_0x51fc54){const _0x5bfc27=a114_0x2029,_0x5876aa=_0x2ca69e[_0x5bfc27(0x11e)]?.[_0x5bfc27(0x13b)]();return _0x5876aa||_0x51fc54;}function withSyncedDisplayName(_0xe13624,_0x50b44d){const _0x75b46=a114_0x2029,_0x1520b1=_0xe13624[_0x75b46(0x139)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x1520b1)return _0xe13624;const _0x35c8f7=_0x1520b1[0x1]??'',_0x3fad16=_0x1520b1[0x2]??'',_0x4bdf15=parseDocument(_0x3fad16);if(_0x4bdf15['errors'][_0x75b46(0x118)]>0x0||!isMap(_0x4bdf15[_0x75b46(0x131)]))return _0xe13624;if(_0x50b44d)_0x4bdf15[_0x75b46(0x134)](_0x75b46(0x129),_0x50b44d);else{if(_0x4bdf15['has']('displayName'))_0x4bdf15[_0x75b46(0x136)]('displayName');else return _0xe13624;}forceBlockCollections(_0x4bdf15[_0x75b46(0x131)]);const _0x54ed26=_0x4bdf15['toString']({'lineWidth':0x0})[_0x75b46(0x13c)](),_0x537251=_0xe13624[_0x75b46(0x12a)](_0x1520b1[0x0][_0x75b46(0x118)])[_0x75b46(0x145)](/^\r?\n/,'');return _0x35c8f7+_0x75b46(0x140)+_0x54ed26+_0x75b46(0x114)+_0x537251;}function forceBlockCollections(_0x449218){if(!isNode(_0x449218))return;visit(_0x449218,(_0x29d0d4,_0x19f142)=>{const _0x48291a=a114_0x2029;isCollection(_0x19f142)&&(_0x19f142[_0x48291a(0x117)]=![]);});}function ensurePulledFilesCanBeOverwritten(_0x3a750a,_0xbd98aa,_0x38f3aa,_0x58b8c7){const _0x8ec734=a114_0x2029;if(_0x58b8c7||!existsSync(_0xbd98aa))return;const _0x4bac92=readMetadataIfPresent(_0xbd98aa);if(!_0x4bac92)return;const _0x378c5c=_0x4bac92[_0x8ec734(0x144)]&&Object['keys'](_0x4bac92['fileHashes'])[_0x8ec734(0x118)]>0x0?_0x4bac92['fileHashes']:undefined;if(_0x378c5c)for(const [_0x164c9a,_0x57116c]of Object[_0x8ec734(0x11b)](_0x378c5c)){const _0x5407e6=resolveManagedFilePath(_0x3a750a,_0x164c9a);if(!existsSync(_0x5407e6))throw CliErrors[_0x8ec734(0x119)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x3a750a,_0x8ec734(0x13a)+_0x164c9a);const _0x5ba4e2=lstatSync(_0x5407e6);if(!_0x5ba4e2[_0x8ec734(0x122)]())throw CliErrors[_0x8ec734(0x119)](_0x8ec734(0x12f)+_0x3a750a,'Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20'+_0x164c9a);const _0x32f18e=bufferSha256(readFileSync(_0x5407e6));if(_0x32f18e!==_0x57116c)throw CliErrors['validation'](_0x8ec734(0x12f)+_0x3a750a+_0x8ec734(0x120)+_0x164c9a,'Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20'+_0x164c9a);}else{const _0x1d9e2e=resolve(_0x3a750a,SKILL_FILE);if(existsSync(_0x1d9e2e)&&_0x4bac92['contentHash']){const _0x2c351c=contentHash(readFileSync(_0x1d9e2e,_0x8ec734(0x13d)));if(_0x2c351c!==_0x4bac92['contentHash'])throw CliErrors['validation'](_0x8ec734(0x121)+_0x1d9e2e,_0x8ec734(0x11a));}}for(const _0xa99c03 of normalizeLocalFiles(_0x38f3aa)){if(_0x378c5c?.[_0xa99c03[_0x8ec734(0x128)]])continue;if(!_0x378c5c&&_0xa99c03[_0x8ec734(0x128)]===SKILL_FILE)continue;const _0x5dd366=resolveManagedFilePath(_0x3a750a,_0xa99c03['path']);if(!existsSync(_0x5dd366))continue;const _0x5c2516=lstatSync(_0x5dd366);if(!_0x5c2516['isFile']())throw CliErrors[_0x8ec734(0x119)](_0x8ec734(0x12f)+_0x3a750a,_0x8ec734(0x123)+_0xa99c03[_0x8ec734(0x128)]);const _0x1d3b19=bufferSha256(readFileSync(_0x5dd366));if(_0x1d3b19!==fileHash(_0xa99c03))throw CliErrors['validation'](_0x8ec734(0x12f)+_0x3a750a,'Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20'+_0xa99c03['path']);}}function materializeFiles(_0x3dda4b,_0x3ebd76){const _0xd0d33a=a114_0x2029;for(const _0x3234a9 of normalizeLocalFiles(_0x3ebd76)){const _0x16589f=resolveManagedFilePath(_0x3dda4b,_0x3234a9[_0xd0d33a(0x128)]);mkdirSync(dirname(_0x16589f),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x16589f,fileContent(_0x3234a9),0x180);}}function removeStaleManagedFiles(_0x4a76fa,_0x7827bd,_0x251ad5){const _0xa72147=a114_0x2029;if(!_0x7827bd)return;const _0x542e71=new Set(normalizeLocalFiles(_0x251ad5)[_0xa72147(0x127)](_0x219d93=>_0x219d93[_0xa72147(0x128)]));for(const _0x2951d6 of Object[_0xa72147(0x12d)](_0x7827bd)){if(_0x542e71['has'](_0x2951d6))continue;const _0x3a6e65=resolveManagedFilePath(_0x4a76fa,_0x2951d6);existsSync(_0x3a6e65)&&lstatSync(_0x3a6e65)['isFile']()&&rmSync(_0x3a6e65,{'force':!![]});}}function a114_0x39a6(){const _0x1c8808=['match','Managed\x20file\x20was\x20removed\x20locally:\x20','trim','trimEnd','utf8','569993cBVvJo','stringify','---\x0a','test','find','paths','fileHashes','replace','pulledAt','Runtime\x20Skill\x20package\x20is\x20missing\x20','\x0a---\x0a\x0a','filter','description','flow','length','validation','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.','entries','80pCpYLn','---','skillName','11650250NsrJaw','.\x20Changed\x20file:\x20','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','isFile','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','7861610dedXmK','36bgOTdA','force','map','path','displayName','slice','displayName:\x20','join','keys','3976098NmZHAe','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','description:\x20','contents','2982400ARRZhp','251153uEpwjV','set','5850140LhdDOL','delete','6Xwthaj','env'];a114_0x39a6=function(){return _0x1c8808;};return a114_0x39a6();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4158ea,_0x9ab0c1){const _0x220e65=a115_0x171b,_0x57310e=_0x4158ea();while(!![]){try{const _0x266a7e=parseInt(_0x220e65(0x1c6))/0x1*(parseInt(_0x220e65(0x1ad))/0x2)+parseInt(_0x220e65(0x1b5))/0x3+-parseInt(_0x220e65(0x1bf))/0x4*(-parseInt(_0x220e65(0x1ae))/0x5)+-parseInt(_0x220e65(0x1b3))/0x6+-parseInt(_0x220e65(0x1bc))/0x7+-parseInt(_0x220e65(0x1a9))/0x8+-parseInt(_0x220e65(0x1aa))/0x9*(-parseInt(_0x220e65(0x1c5))/0xa);if(_0x266a7e===_0x9ab0c1)break;else _0x57310e['push'](_0x57310e['shift']());}catch(_0x427391){_0x57310e['push'](_0x57310e['shift']());}}}(a115_0x3662,0xbbf3c));import{existsSync,readFileSync}from'node:fs';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';import{fileContent,normalizeLocalFiles}from'./local-files.js';function a115_0x171b(_0x5a4c72,_0x1bee51){_0x5a4c72=_0x5a4c72-0x1a8;const _0x3662d7=a115_0x3662();let _0x171bae=_0x3662d7[_0x5a4c72];return _0x171bae;}import{buildSkillPackage,localFilesToManifestFiles}from'./zip-package.js';export function buildMetadata(_0x702603,_0x8f8d58,_0x161386,_0xb8bc38,_0x195cfa,_0xa5eb19,_0x15c886){const _0x243267=a115_0x171b,_0x1cf0dc=_0xa5eb19?normalizeLocalFiles(_0xa5eb19):[],_0x575a96=!_0x15c886&&_0x1cf0dc['length']>0x0?buildSkillPackage(_0x1cf0dc):undefined,_0xc36963=_0x15c886?bufferSha256(_0x15c886):_0x575a96?.['manifest'][_0x243267(0x1c9)],_0x5f0832=_0x15c886?.[_0x243267(0x1bb)]??_0x575a96?.[_0x243267(0x1cb)][_0x243267(0x1c4)],_0x460f3f=_0x1cf0dc['length']>0x0?Object[_0x243267(0x1c7)](_0x1cf0dc['map'](_0xc693b8=>[_0xc693b8[_0x243267(0x1a8)],fileHash(_0xc693b8)])):undefined;return{'schemaVersion':_0x1cf0dc[_0x243267(0x1bb)]>0x0?0x2:0x1,'id':_0x702603['id'],'appCode':_0x161386,'skillCode':requireSkillCode(_0x702603),'skillName':_0x702603[_0x243267(0x1b4)],'description':_0x702603[_0x243267(0x1c3)],'scope':_0x8f8d58,'readonly':_0x8f8d58!==_0x243267(0x1c8)||_0x702603[_0x243267(0x1bd)]===!![],'tenantCode':_0x702603[_0x243267(0x1ac)],'userId':_0x702603[_0x243267(0x1b2)],'version':_0x702603['version'],'status':_0x702603[_0x243267(0x1ba)],'tags':Array['isArray'](_0x702603[_0x243267(0x1be)])?_0x702603['tags']:[],'hasUpstreamUpdate':_0x702603[_0x243267(0x1b7)],'forkedFromSkillId':_0x702603[_0x243267(0x1ce)],'forkedFromVersion':_0x702603[_0x243267(0x1b9)],'sourceSessionId':_0x702603[_0x243267(0x1c1)],'contentHash':_0xb8bc38,'fileHashes':_0x460f3f,'treeHash':_0x1cf0dc['length']>0x0?fileTreeHash(localFilesToManifestFiles(_0x1cf0dc)):undefined,'ossPath':remoteManifestOssPath(_0x702603[_0x243267(0x1ca)]),'zipSha256':_0xc36963,'zipSize':_0x5f0832,'files':_0x1cf0dc[_0x243267(0x1bb)]>0x0?_0x1cf0dc[_0x243267(0x1b1)](_0x3c96f0=>({'path':_0x3c96f0['path'],'hash':fileHash(_0x3c96f0),'size':fileContent(_0x3c96f0)[_0x243267(0x1bb)]})):undefined,'pulledAt':_0x195cfa??new Date()[_0x243267(0x1cd)]()};}function a115_0x3662(){const _0x1ed67b=['forkedFromVersion','status','length','10601451WnlGdn','readonly','tags','203272fGHxae','utf8','sourceSessionId','parse','description','zipSize','10oCHAlO','1822EFCUxu','fromEntries','personal','zipSha256','files','manifest','skillCode','toISOString','forkedFromSkillId','isArray','path','10432936ElAYjE','26728029sqvsEr','validation','tenantCode','1244vqUXcB','65tDzDcD','ossPath','string','map','userId','7509900ZNIPwK','skillName','229239EbBEzS','trim','hasUpstreamUpdate','Invalid\x20'];a115_0x3662=function(){return _0x1ed67b;};return a115_0x3662();}export function requireSkillCode(_0x4f3d2b){const _0x420026=a115_0x171b,_0x52d486=_0x4f3d2b[_0x420026(0x1cc)]?.['trim']();if(!_0x52d486)throw CliErrors[_0x420026(0x1ab)]('Runtime\x20Skill\x20is\x20missing\x20skillCode.');return _0x52d486;}export function readMetadataIfPresent(_0x2ac79d){const _0x41ed62=a115_0x171b;if(!existsSync(_0x2ac79d))return undefined;try{const _0x6ea286=JSON[_0x41ed62(0x1c2)](readFileSync(_0x2ac79d,_0x41ed62(0x1c0)));return _0x6ea286;}catch{throw CliErrors['validation'](_0x41ed62(0x1b8)+METADATA_FILE+':\x20'+_0x2ac79d);}}function remoteManifestOssPath(_0x32945b){const _0xf20fcf=a115_0x171b;if(!_0x32945b||typeof _0x32945b!=='object'||Array[_0xf20fcf(0x1cf)](_0x32945b))return undefined;const _0x432610=_0x32945b[_0xf20fcf(0x1af)];return typeof _0x432610===_0xf20fcf(0x1b0)&&_0x432610[_0xf20fcf(0x1b6)]()?_0x432610[_0xf20fcf(0x1b6)]():undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
const a116_0x1eac4b=a116_0x219a;(function(_0x179e9e,_0x44e911){const _0x433396=a116_0x219a,_0x57abf8=_0x179e9e();while(!![]){try{const _0x51faf1=-parseInt(_0x433396(0xba))/0x1+parseInt(_0x433396(0xb5))/0x2+parseInt(_0x433396(0xb3))/0x3+parseInt(_0x433396(0xb4))/0x4*(-parseInt(_0x433396(0xab))/0x5)+parseInt(_0x433396(0xa9))/0x6+parseInt(_0x433396(0xbf))/0x7*(-parseInt(_0x433396(0xb1))/0x8)+parseInt(_0x433396(0xaa))/0x9*(-parseInt(_0x433396(0xa8))/0xa);if(_0x51faf1===_0x44e911)break;else _0x57abf8['push'](_0x57abf8['shift']());}catch(_0x52e430){_0x57abf8['push'](_0x57abf8['shift']());}}}(a116_0x51a4,0x7aa40));import{existsSync}from'node:fs';import{homedir}from'node:os';function a116_0x219a(_0x3e80bf,_0x3cdf25){_0x3e80bf=_0x3e80bf-0xa7;const _0x51a4a6=a116_0x51a4();let _0x219a22=_0x51a4a6[_0x3e80bf];return _0x219a22;}import{resolve}from'node:path';import{fingerprintAccessKey}from'../../commands/app/cache.js';import{PRODUCT_CONFIG,productEnv}from'../../constant/product.js';import{CliErrors}from'../../errors.js';export function resolveSkillSyncPaths(_0x5e9df4={}){const _0x42fd0a=a116_0x219a,_0x188da3=_0x5e9df4[_0x42fd0a(0xbc)]??homedir(),_0x22a34a=resolve(_0x188da3,PRODUCT_CONFIG['homeDirName'],_0x42fd0a(0xa7)),_0x67cbcf=trimmedEnv(_0x42fd0a(0xac)),_0x29176a=trimmedEnv(_0x42fd0a(0xb7)),_0x3719e7=resolve(_0x188da3,_0x42fd0a(0xb2)),_0x1d257e=_0x5e9df4[_0x42fd0a(0xc0)]??(existsSync(_0x3719e7)?resolve(_0x3719e7,_0x42fd0a(0xb9)):undefined);return{'homeDir':_0x188da3,'cacheRoot':_0x22a34a,'managedRoot':resolve(_0x188da3,PRODUCT_CONFIG[_0x42fd0a(0xaf)]),'agentsSkillsDir':_0x5e9df4['agentsSkillsDir']??_0x67cbcf??resolve(_0x188da3,_0x42fd0a(0xbb),_0x42fd0a(0xb9)),'claudeSkillsDir':_0x5e9df4[_0x42fd0a(0xb0)]??_0x29176a??resolve(_0x188da3,'.claude',_0x42fd0a(0xb9)),'workbuddySkillsDir':_0x1d257e};}export function runtimeAgentSkillRoots(_0x59681e){const _0x3d6f58=a116_0x219a;return[_0x59681e[_0x3d6f58(0xb8)],_0x59681e[_0x3d6f58(0xb0)],_0x59681e[_0x3d6f58(0xc0)]]['filter'](_0x5ad06e=>Boolean(_0x5ad06e));}export function getRuntimeSkillCacheRoot(_0x2c3392,_0x3f8b0c,_0x3e9cc2={}){const _0x14d353=a116_0x219a,_0x39c1e2=resolveSkillSyncPaths(_0x3e9cc2);return resolve(_0x39c1e2[_0x14d353(0xc3)],_0x2c3392,fingerprintAccessKey(_0x3f8b0c),_0x14d353(0xb9));}export function getRuntimeSkillDir(_0x93dcae,_0xc78088,_0x309952,_0x2207ab,_0x1108a2,_0x1de413={}){const _0x4d1f65=a116_0x219a;return resolve(getRuntimeSkillCacheRoot(_0x93dcae,_0xc78088,_0x1de413),safePathSegment(_0x309952,_0x4d1f65(0xc1)),_0x2207ab,safePathSegment(_0x1108a2,'skillCode'));}function a116_0x51a4(){const _0x8940b5=['.agents','homeDir','includes','Unsafe\x20','6704726mMneZV','workbuddySkillsDir','appCode','\x20for\x20local\x20path:\x20','cacheRoot','cache','70DFzEhX','5920662ytGDCy','966231haRaet','717395GPoMWb','SKILL_ROOT','trim','path\x20segment','homeDirName','claudeSkillsDir','8gTBbni','.workbuddy','2434170pxyBRj','4apMFBn','1392782cHdEkJ','validation','CLAUDE_SKILL_ROOT','agentsSkillsDir','skills','139412sgnujw'];a116_0x51a4=function(){return _0x8940b5;};return a116_0x51a4();}export function safePathSegment(_0x51ce1f,_0x18321a=a116_0x1eac4b(0xae)){const _0x4ce8cd=a116_0x1eac4b;if(!_0x51ce1f||_0x51ce1f[_0x4ce8cd(0xbd)]('/')||_0x51ce1f['includes']('\x5c')||_0x51ce1f[_0x4ce8cd(0xbd)]('..'))throw CliErrors[_0x4ce8cd(0xb6)](_0x4ce8cd(0xbe)+_0x18321a+_0x4ce8cd(0xc2)+_0x51ce1f);return _0x51ce1f;}function trimmedEnv(_0x382561){const _0x4cab84=a116_0x1eac4b,_0x2c5d1c=productEnv(_0x382561)?.[_0x4cab84(0xad)]();return _0x2c5d1c?_0x2c5d1c:undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x50efce,_0x5c28e2){const _0x1e8c69=a116_0x3df2,_0x172409=_0x50efce();while(!![]){try{const _0x4ee7eb=-parseInt(_0x1e8c69(0xec))/0x1*(-parseInt(_0x1e8c69(0xf5))/0x2)+parseInt(_0x1e8c69(0xf8))/0x3*(-parseInt(_0x1e8c69(0xf9))/0x4)+-parseInt(_0x1e8c69(0x11d))/0x5*(-parseInt(_0x1e8c69(0x10f))/0x6)+-parseInt(_0x1e8c69(0x122))/0x7+parseInt(_0x1e8c69(0x11f))/0x8+-parseInt(_0x1e8c69(0xe5))/0x9+parseInt(_0x1e8c69(0x115))/0xa;if(_0x4ee7eb===_0x5c28e2)break;else _0x172409['push'](_0x172409['shift']());}catch(_0x58cea9){_0x172409['push'](_0x172409['shift']());}}}(a116_0x5d8a,0xd0233));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a116_0x12dcd3}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{writeJsonAtomic}from'./fs-utils.js';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(_0x48e619,_0x598f0d,_0x487bf8={}){const _0x5a8824=a116_0x3df2,_0x5a456e=resolvePushDirectoryRoot(_0x48e619),_0x5f1e0b=readPushMetadataIfPresent(resolve(_0x5a456e,METADATA_FILE),{'ignoreInvalidMetadata':_0x487bf8[_0x5a8824(0xfc)]});if(_0x5f1e0b?.[_0x5a8824(0x11c)]&&_0x5f1e0b[_0x5a8824(0x11c)]!==_0x598f0d&&!_0x487bf8[_0x5a8824(0xf4)]&&!_0x487bf8[_0x5a8824(0x10e)])throw CliErrors[_0x5a8824(0x10c)](_0x5a8824(0xed)+_0x5f1e0b[_0x5a8824(0x11c)]+_0x5a8824(0x111)+_0x598f0d+'\x22.');const _0x38fc55=resolvePushSkillCode(_0x5a456e,_0x598f0d,_0x5f1e0b,_0x487bf8);if(!_0x38fc55)throw CliErrors[_0x5a8824(0x10c)]('Unable\x20to\x20resolve\x20skillCode\x20from\x20'+SKILL_FILE+',\x20'+METADATA_FILE+_0x5a8824(0xf6));return{'dir':_0x5a456e,'skillCode':_0x38fc55,'metadata':_0x5f1e0b};}export function readPushDirectory(_0x43ed67,_0x60d000,_0xf4ba16={}){const _0x2ec37f=a116_0x3df2,_0x5d6e05=resolvePushDirectoryIdentity(_0x43ed67,_0x60d000,_0xf4ba16),_0xdd41e5=_0x5d6e05[_0x2ec37f(0x112)],_0x47dd3b=resolve(_0xdd41e5,SKILL_FILE);if(!existsSync(_0x47dd3b)||!lstatSync(_0x47dd3b)[_0x2ec37f(0xf1)]())throw CliErrors[_0x2ec37f(0x10c)](_0x2ec37f(0x106)+SKILL_FILE+':\x20'+_0x47dd3b);const _0x3da563=_0x5d6e05['metadata'],_0x48f415=_0xf4ba16[_0x2ec37f(0x107)]??_0x2ec37f(0x10d);if(!_0xf4ba16[_0x2ec37f(0x117)]&&_0x3da563?.[_0x2ec37f(0x118)]===_0x2ec37f(0xfa))throw CliErrors['validation']('Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20'+METADATA_FILE+'\x20has\x20scope=\x22'+_0x3da563[_0x2ec37f(0x118)]+'\x22.');if(!_0xf4ba16['ignoreMetadataScope']&&_0x48f415===_0x2ec37f(0x10d)&&_0x3da563?.[_0x2ec37f(0x118)]&&_0x3da563[_0x2ec37f(0x118)]!==_0x2ec37f(0x10d))throw CliErrors[_0x2ec37f(0x10c)](_0x2ec37f(0x10b)+METADATA_FILE+_0x2ec37f(0x103)+_0x3da563['scope']+'\x22.',_0x2ec37f(0xfd)+_0xdd41e5+_0x2ec37f(0x100));const _0x430533=scanSkillDirectory(_0xdd41e5),_0x2b87be=buildSkillPackage(_0x430533),_0x4f531f=readFileSync(_0x47dd3b,_0x2ec37f(0x119)),_0x571e31=_0x5d6e05[_0x2ec37f(0xff)],_0x147d16=_0xf4ba16[_0x2ec37f(0x110)]?undefined:_0x3da563,_0x1d5e2a=readSkillDisplayName(_0x4f531f);return{'skillCode':_0x571e31,'metadata':_0x3da563,'frontmatterDisplayName':_0x1d5e2a,'input':{'skillCode':_0x571e31,'skillName':_0x1d5e2a??_0x147d16?.[_0x2ec37f(0x105)],'description':_0x147d16?.['description'],'content':_0x4f531f,'files':_0x2b87be[_0x2ec37f(0xef)],'packageBase64':_0x2b87be['packageBase64'],'tags':_0x147d16?.[_0x2ec37f(0xe6)],'version':_0x147d16?.[_0x2ec37f(0x102)],'sourceSessionId':_0x147d16?.['sourceSessionId']}};}export function refreshPushDirectoryMetadataFromRemote(_0x40f58a,_0x2afdf4,_0x39112d,_0x4d3a79={}){const _0xe7b296=a116_0x3df2,_0x2b1ff9=resolvePushDirectoryRoot(_0x40f58a),_0x2426fd=readPushMetadataIfPresent(resolve(_0x2b1ff9,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x379b79=requireRemoteScope(_0x2afdf4),_0xf1ef20=readLocalSkillContent(_0x2b1ff9),_0x50cc6e={..._0x2afdf4,'appCode':_0x2afdf4[_0xe7b296(0x11c)]??_0x39112d,'skillName':_0x2afdf4[_0xe7b296(0x105)]??_0x2426fd?.[_0xe7b296(0x105)],'description':_0x2afdf4[_0xe7b296(0x114)]??_0x2426fd?.[_0xe7b296(0x114)],'tags':Array[_0xe7b296(0x120)](_0x2afdf4[_0xe7b296(0xe6)])?_0x2afdf4[_0xe7b296(0xe6)]:_0x2426fd?.[_0xe7b296(0xe6)],'sourceSessionId':_0x2afdf4['sourceSessionId']??_0x2426fd?.[_0xe7b296(0xf2)],'content':_0x2afdf4[_0xe7b296(0xfe)]??_0xf1ef20},_0x3d5549=buildMetadata(_0x50cc6e,_0x379b79,_0x39112d,contentHash(_0xf1ef20),_0x4d3a79[_0xe7b296(0x11a)]);writeJsonAtomic(resolve(_0x2b1ff9,METADATA_FILE),_0x3d5549);}function a116_0x3df2(_0x117dc0,_0x479a98){_0x117dc0=_0x117dc0-0xe5;const _0x5d8a57=a116_0x5d8a();let _0x3df25c=_0x5d8a57[_0x117dc0];return _0x3df25c;}export function recordPushedRuntimeSkill(_0x4b7956,_0x181e65,_0x38ca7b,_0x27a0d8={}){const _0x5c0374=a116_0x3df2,_0x534be3=resolvePushDirectoryRoot(_0x4b7956),_0x4f4e08=scanSkillDirectory(_0x534be3),_0x2ef15d=_0x4f4e08[_0x5c0374(0x113)](_0x171e46=>_0x171e46[_0x5c0374(0x10a)]===SKILL_FILE),_0x5f31a4=_0x2ef15d?fileText(_0x2ef15d):'',_0x2d1e24=tryNormalizePackageManifest(_0x181e65[_0x5c0374(0xe9)]),_0x2e4241={..._0x181e65,'content':_0x181e65[_0x5c0374(0xfe)]??_0x5f31a4,'files':_0x2d1e24},_0x585e3c=_0x2d1e24?normalizeLocalFiles(_0x4f4e08)['filter'](_0xdfb59=>_0x2d1e24['files'][_0x5c0374(0x11b)](_0x5958c7=>_0x5958c7['path']===_0xdfb59[_0x5c0374(0x10a)])):undefined,_0x57a25f=buildMetadata(_0x2e4241,_0x27a0d8[_0x5c0374(0x118)]??_0x5c0374(0x10d),_0x38ca7b,contentHash(_0x2e4241[_0x5c0374(0xfe)]??''),_0x27a0d8[_0x5c0374(0x108)],_0x585e3c);writeJsonAtomic(resolve(_0x534be3,METADATA_FILE),_0x57a25f);}export function deriveSkillCodeFromDirectory(_0x2ebb98,_0x3d2437){const _0x13e277=a116_0x3df2,_0xb95806=basename(resolve(_0x2ebb98)),_0x4b140f=_0x3d2437+'--';return _0xb95806[_0x13e277(0x11e)](_0x4b140f)?_0xb95806[_0x13e277(0x116)](_0x4b140f[_0x13e277(0xeb)]):_0xb95806;}function resolvePushSkillCode(_0x2432e7,_0x457ac1,_0x4092ca,_0x4a1de8){const _0x4b56ec=a116_0x3df2,_0xbfe342=deriveSkillCodeFromSkillFile(_0x2432e7)||deriveSkillCodeFromDirectory(_0x2432e7,_0x457ac1);if(_0x4a1de8[_0x4b56ec(0xf0)])return _0xbfe342;return _0x4092ca?.[_0x4b56ec(0xff)]?.[_0x4b56ec(0x121)]()||_0xbfe342;}function deriveSkillCodeFromSkillFile(_0x4068fa){const _0x130ac8=a116_0x3df2,_0x5bbd04=resolve(_0x4068fa,SKILL_FILE);if(!existsSync(_0x5bbd04)||!lstatSync(_0x5bbd04)[_0x130ac8(0xf1)]())return undefined;const _0x1ff997=readFileSync(_0x5bbd04,'utf8'),_0x2b0958=_0x1ff997[_0x130ac8(0xfb)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x2b0958)return undefined;const _0x99a587=parseFrontmatterObject(_0x2b0958[0x1]??''),_0x18814a=scalarToString(_0x99a587?.['name']);return _0x18814a?slugifySkillName(_0x18814a):undefined;}function readSkillDisplayName(_0x2d1295){const _0x25829=_0x2d1295['match'](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x25829)return undefined;const _0x5ad2cf=parseFrontmatterObject(_0x25829[0x1]??'');return scalarToString(_0x5ad2cf?.['displayName']);}function slugifySkillName(_0x35e4fb){const _0x5207d9=a116_0x3df2,_0x34ebdc=_0x35e4fb[_0x5207d9(0x121)]()[_0x5207d9(0x109)]()['replace'](/[^\p{L}\p{N}\p{So}]+/gu,'-')[_0x5207d9(0xea)](/^-+/,'')[_0x5207d9(0xea)](/-+$/,'')[_0x5207d9(0xea)](/-{2,}/g,'-');if(!_0x34ebdc)throw CliErrors[_0x5207d9(0x10c)]('Invalid\x20'+SKILL_FILE+_0x5207d9(0x104));return _0x34ebdc;}function parseFrontmatterObject(_0x36a452){const _0x315fd6=a116_0x3df2;try{const _0x3b09c0=a116_0x12dcd3(_0x36a452);return _0x3b09c0&&typeof _0x3b09c0==='object'&&!Array[_0x315fd6(0x120)](_0x3b09c0)?_0x3b09c0:undefined;}catch{return undefined;}}function scalarToString(_0x5ac618){const _0x15849f=a116_0x3df2;if(typeof _0x5ac618===_0x15849f(0xf7))return _0x5ac618[_0x15849f(0x121)]();if(typeof _0x5ac618==='number'||typeof _0x5ac618==='boolean')return String(_0x5ac618);return undefined;}function a116_0x5d8a(){const _0x47b8ad=['content','skillCode','\x20to\x20submit\x20company\x20Skills\x20for\x20review.','company','version','\x20has\x20scope=\x22','\x20name\x20for\x20SkillHub\x20slug\x20generation.','skillName','Missing\x20','targetScope','pushedAt','toLowerCase','path','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20','validation','personal','ignoreMetadataAppCodeMismatch','5613168FYxZQa','ignoreMetadataForPayload','\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22','dir','find','description','23588200CJaLJj','slice','ignoreMetadataScope','scope','utf8','refreshedAt','some','appCode','5GHgRKi','startsWith','3184872rpigfB','isArray','trim','10622675rTKiCn','6095637MkIEvA','tags','isDirectory','(unknown)','files','replace','length','4GLvWUi','Skill\x20metadata\x20appCode\x20\x22','Remote\x20Skill\x20','manifest','ignoreMetadataSkillCode','isFile','sourceSessionId','unknown','allowAppCodeRetarget','204502rimTpD',',\x20or\x20directory\x20name.','string','98823YsUHpG','128ByJZDm','builtin','match','ignoreInvalidMetadata','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20'];a116_0x5d8a=function(){return _0x47b8ad;};return a116_0x5d8a();}function resolvePushDirectoryRoot(_0x3329fc){const _0x25af7c=a116_0x3df2,_0x33fcf6=resolve(_0x3329fc);if(!existsSync(_0x33fcf6))throw CliErrors['validation']('Skill\x20directory\x20not\x20found:\x20'+_0x3329fc);const _0x1e5059=lstatSync(_0x33fcf6);if(_0x1e5059[_0x25af7c(0xe7)]())return _0x33fcf6;if(_0x1e5059['isSymbolicLink']()){const _0x59e279=realpathSync(_0x33fcf6);if(lstatSync(_0x59e279)[_0x25af7c(0xe7)]())return _0x59e279;}throw CliErrors[_0x25af7c(0x10c)]('Skill\x20directory\x20not\x20found:\x20'+_0x3329fc);}function requireRemoteScope(_0x5d1166){const _0xa7f6d6=a116_0x3df2;if(_0x5d1166[_0xa7f6d6(0x118)]===_0xa7f6d6(0x10d)||_0x5d1166[_0xa7f6d6(0x118)]===_0xa7f6d6(0x101)||_0x5d1166[_0xa7f6d6(0x118)]===_0xa7f6d6(0xfa))return _0x5d1166['scope'];throw CliErrors[_0xa7f6d6(0x10c)](_0xa7f6d6(0xee)+(_0x5d1166[_0xa7f6d6(0xff)]||_0xa7f6d6(0xe8))+'\x20has\x20unsupported\x20scope\x20\x22'+(_0x5d1166[_0xa7f6d6(0x118)]??_0xa7f6d6(0xf3))+'\x22.');}function readLocalSkillContent(_0x47a195){const _0x169a1c=a116_0x3df2,_0x36f761=resolve(_0x47a195,SKILL_FILE);return existsSync(_0x36f761)&&lstatSync(_0x36f761)[_0x169a1c(0xf1)]()?readFileSync(_0x36f761,_0x169a1c(0x119)):'';}function readPushMetadataIfPresent(_0x552b9a,_0x1ff1d0={}){try{return readMetadataIfPresent(_0x552b9a);}catch(_0x53fdc8){if(_0x1ff1d0['ignoreInvalidMetadata'])return undefined;throw _0x53fdc8;}}
|
|
1
|
+
(function(_0x17a216,_0xe99d5){const _0x20ed3e=a117_0x10a2,_0x13fc24=_0x17a216();while(!![]){try{const _0x4b7a43=-parseInt(_0x20ed3e(0x1c8))/0x1+-parseInt(_0x20ed3e(0x1bd))/0x2*(parseInt(_0x20ed3e(0x1c3))/0x3)+parseInt(_0x20ed3e(0x1f6))/0x4*(-parseInt(_0x20ed3e(0x1ea))/0x5)+-parseInt(_0x20ed3e(0x1ee))/0x6+-parseInt(_0x20ed3e(0x1ca))/0x7*(-parseInt(_0x20ed3e(0x1da))/0x8)+-parseInt(_0x20ed3e(0x1e4))/0x9*(-parseInt(_0x20ed3e(0x1cc))/0xa)+-parseInt(_0x20ed3e(0x1ce))/0xb*(-parseInt(_0x20ed3e(0x1c2))/0xc);if(_0x4b7a43===_0xe99d5)break;else _0x13fc24['push'](_0x13fc24['shift']());}catch(_0x1bd8a8){_0x13fc24['push'](_0x13fc24['shift']());}}}(a117_0x4221,0xc1092));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';function a117_0x10a2(_0x424dfa,_0x2ca434){_0x424dfa=_0x424dfa-0x1b6;const _0x422147=a117_0x4221();let _0x10a297=_0x422147[_0x424dfa];return _0x10a297;}import{parse as a117_0x9fcf95}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{writeJsonAtomic}from'./fs-utils.js';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(_0x324efd,_0x5a0e6f,_0x559d2c={}){const _0x4b1054=a117_0x10a2,_0x1707ed=resolvePushDirectoryRoot(_0x324efd),_0x1843e6=readPushMetadataIfPresent(resolve(_0x1707ed,METADATA_FILE),{'ignoreInvalidMetadata':_0x559d2c[_0x4b1054(0x1cb)]});if(_0x1843e6?.['appCode']&&_0x1843e6[_0x4b1054(0x1f7)]!==_0x5a0e6f&&!_0x559d2c['allowAppCodeRetarget']&&!_0x559d2c[_0x4b1054(0x1cd)])throw CliErrors[_0x4b1054(0x1d4)](_0x4b1054(0x1ba)+_0x1843e6[_0x4b1054(0x1f7)]+_0x4b1054(0x1db)+_0x5a0e6f+'\x22.');const _0x4ec79a=resolvePushSkillCode(_0x1707ed,_0x5a0e6f,_0x1843e6,_0x559d2c);if(!_0x4ec79a)throw CliErrors[_0x4b1054(0x1d4)](_0x4b1054(0x1d3)+SKILL_FILE+',\x20'+METADATA_FILE+',\x20or\x20directory\x20name.');return{'dir':_0x1707ed,'skillCode':_0x4ec79a,'metadata':_0x1843e6};}export function readPushDirectory(_0x26324f,_0x4a8d8b,_0x2d67a6={}){const _0x26b4ee=a117_0x10a2,_0x288c40=resolvePushDirectoryIdentity(_0x26324f,_0x4a8d8b,_0x2d67a6),_0x53c3b8=_0x288c40[_0x26b4ee(0x1de)],_0x36da70=resolve(_0x53c3b8,SKILL_FILE);if(!existsSync(_0x36da70)||!lstatSync(_0x36da70)[_0x26b4ee(0x1f0)]())throw CliErrors['validation'](_0x26b4ee(0x1d2)+SKILL_FILE+':\x20'+_0x36da70);const _0x3171ad=_0x288c40[_0x26b4ee(0x1f1)],_0x54bf5f=_0x2d67a6[_0x26b4ee(0x1f3)]??_0x26b4ee(0x1b9);if(!_0x2d67a6[_0x26b4ee(0x1c9)]&&_0x3171ad?.['scope']===_0x26b4ee(0x1e8))throw CliErrors[_0x26b4ee(0x1d4)](_0x26b4ee(0x1e3)+METADATA_FILE+'\x20has\x20scope=\x22'+_0x3171ad['scope']+'\x22.');if(!_0x2d67a6[_0x26b4ee(0x1c9)]&&_0x54bf5f===_0x26b4ee(0x1b9)&&_0x3171ad?.[_0x26b4ee(0x1f2)]&&_0x3171ad['scope']!==_0x26b4ee(0x1b9))throw CliErrors[_0x26b4ee(0x1d4)](_0x26b4ee(0x1c6)+METADATA_FILE+_0x26b4ee(0x1f8)+_0x3171ad[_0x26b4ee(0x1f2)]+'\x22.',_0x26b4ee(0x1e6)+_0x53c3b8+_0x26b4ee(0x1d6));const _0x3e57a0=scanSkillDirectory(_0x53c3b8),_0x1cad68=buildSkillPackage(_0x3e57a0),_0x1c3251=readFileSync(_0x36da70,_0x26b4ee(0x1be)),_0x1fc412=_0x288c40[_0x26b4ee(0x1d7)],_0x436222=_0x2d67a6['ignoreMetadataForPayload']?undefined:_0x3171ad,_0x52fbf0=readSkillDisplayName(_0x1c3251);return{'skillCode':_0x1fc412,'metadata':_0x3171ad,'frontmatterDisplayName':_0x52fbf0,'input':{'skillCode':_0x1fc412,'skillName':_0x52fbf0??_0x436222?.[_0x26b4ee(0x1bc)],'description':_0x436222?.[_0x26b4ee(0x1ef)],'content':_0x1c3251,'files':_0x1cad68[_0x26b4ee(0x1d8)],'packageBase64':_0x1cad68['packageBase64'],'tags':_0x436222?.[_0x26b4ee(0x1eb)],'version':_0x436222?.[_0x26b4ee(0x1e1)],'sourceSessionId':_0x436222?.[_0x26b4ee(0x1ec)]}};}export function refreshPushDirectoryMetadataFromRemote(_0x428670,_0x53d8c7,_0x5838e0,_0x36d0f6={}){const _0x10a1bb=a117_0x10a2,_0x456744=resolvePushDirectoryRoot(_0x428670),_0x6f921c=readPushMetadataIfPresent(resolve(_0x456744,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x5b06c8=requireRemoteScope(_0x53d8c7),_0x6dc2aa=readLocalSkillContent(_0x456744),_0x192303={..._0x53d8c7,'appCode':_0x53d8c7[_0x10a1bb(0x1f7)]??_0x5838e0,'skillName':_0x53d8c7[_0x10a1bb(0x1bc)]??_0x6f921c?.[_0x10a1bb(0x1bc)],'description':_0x53d8c7[_0x10a1bb(0x1ef)]??_0x6f921c?.[_0x10a1bb(0x1ef)],'tags':Array[_0x10a1bb(0x1c1)](_0x53d8c7[_0x10a1bb(0x1eb)])?_0x53d8c7['tags']:_0x6f921c?.[_0x10a1bb(0x1eb)],'sourceSessionId':_0x53d8c7['sourceSessionId']??_0x6f921c?.[_0x10a1bb(0x1ec)],'content':_0x53d8c7[_0x10a1bb(0x1e0)]??_0x6dc2aa},_0x179195=buildMetadata(_0x192303,_0x5b06c8,_0x5838e0,contentHash(_0x6dc2aa),_0x36d0f6['refreshedAt']);writeJsonAtomic(resolve(_0x456744,METADATA_FILE),_0x179195);}export function recordPushedRuntimeSkill(_0x3c2c31,_0x3863c2,_0xcc7fb7,_0x4d3ae6={}){const _0x523c59=a117_0x10a2,_0x2bc7be=resolvePushDirectoryRoot(_0x3c2c31),_0x200ef5=scanSkillDirectory(_0x2bc7be),_0x5502bf=_0x200ef5[_0x523c59(0x1bb)](_0x37091d=>_0x37091d['path']===SKILL_FILE),_0x1bd5fc=_0x5502bf?fileText(_0x5502bf):'',_0x1a4e5d=tryNormalizePackageManifest(_0x3863c2[_0x523c59(0x1d9)]),_0x165549={..._0x3863c2,'content':_0x3863c2['content']??_0x1bd5fc,'files':_0x1a4e5d},_0x286f9d=_0x1a4e5d?normalizeLocalFiles(_0x200ef5)['filter'](_0x314772=>_0x1a4e5d[_0x523c59(0x1d9)][_0x523c59(0x1cf)](_0x59f780=>_0x59f780[_0x523c59(0x1bf)]===_0x314772[_0x523c59(0x1bf)])):undefined,_0x359baa=buildMetadata(_0x165549,_0x4d3ae6['scope']??_0x523c59(0x1b9),_0xcc7fb7,contentHash(_0x165549[_0x523c59(0x1e0)]??''),_0x4d3ae6[_0x523c59(0x1dc)],_0x286f9d);writeJsonAtomic(resolve(_0x2bc7be,METADATA_FILE),_0x359baa);}export function deriveSkillCodeFromDirectory(_0x1d35bc,_0x2be9ba){const _0x14f4a2=a117_0x10a2,_0x844de5=basename(resolve(_0x1d35bc)),_0x426484=_0x2be9ba+'--';return _0x844de5[_0x14f4a2(0x1d1)](_0x426484)?_0x844de5['slice'](_0x426484[_0x14f4a2(0x1e5)]):_0x844de5;}function resolvePushSkillCode(_0x1f716d,_0x5c8810,_0x415361,_0x273b99){const _0x1d95d2=a117_0x10a2,_0x50d6e1=deriveSkillCodeFromSkillFile(_0x1f716d)||deriveSkillCodeFromDirectory(_0x1f716d,_0x5c8810);if(_0x273b99[_0x1d95d2(0x1f4)])return _0x50d6e1;return _0x415361?.['skillCode']?.['trim']()||_0x50d6e1;}function deriveSkillCodeFromSkillFile(_0x363402){const _0xbaffa5=a117_0x10a2,_0x356da7=resolve(_0x363402,SKILL_FILE);if(!existsSync(_0x356da7)||!lstatSync(_0x356da7)[_0xbaffa5(0x1f0)]())return undefined;const _0x4be62e=readFileSync(_0x356da7,_0xbaffa5(0x1be)),_0x3da972=_0x4be62e['match'](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x3da972)return undefined;const _0x59f5d4=parseFrontmatterObject(_0x3da972[0x1]??''),_0x2d332c=scalarToString(_0x59f5d4?.['name']);return _0x2d332c?slugifySkillName(_0x2d332c):undefined;}function readSkillDisplayName(_0x144f22){const _0x16bde6=a117_0x10a2,_0x43b590=_0x144f22[_0x16bde6(0x1e2)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x43b590)return undefined;const _0x195d99=parseFrontmatterObject(_0x43b590[0x1]??'');return scalarToString(_0x195d99?.[_0x16bde6(0x1e9)]);}function slugifySkillName(_0x3ce29a){const _0x5d2d41=a117_0x10a2,_0x5b0a23=_0x3ce29a[_0x5d2d41(0x1c4)]()[_0x5d2d41(0x1c0)]()[_0x5d2d41(0x1d0)](/[^\p{L}\p{N}\p{So}]+/gu,'-')[_0x5d2d41(0x1d0)](/^-+/,'')[_0x5d2d41(0x1d0)](/-+$/,'')['replace'](/-{2,}/g,'-');if(!_0x5b0a23)throw CliErrors['validation'](_0x5d2d41(0x1b7)+SKILL_FILE+_0x5d2d41(0x1ed));return _0x5b0a23;}function parseFrontmatterObject(_0x52cf0a){const _0x2451af=a117_0x10a2;try{const _0x5ef9a0=a117_0x9fcf95(_0x52cf0a);return _0x5ef9a0&&typeof _0x5ef9a0===_0x2451af(0x1b8)&&!Array['isArray'](_0x5ef9a0)?_0x5ef9a0:undefined;}catch{return undefined;}}function scalarToString(_0xd3f061){const _0xb078b8=a117_0x10a2;if(typeof _0xd3f061==='string')return _0xd3f061['trim']();if(typeof _0xd3f061===_0xb078b8(0x1df)||typeof _0xd3f061===_0xb078b8(0x1dd))return String(_0xd3f061);return undefined;}function resolvePushDirectoryRoot(_0x4b6f83){const _0x59038d=a117_0x10a2,_0x128d4c=resolve(_0x4b6f83);if(!existsSync(_0x128d4c))throw CliErrors[_0x59038d(0x1d4)](_0x59038d(0x1c5)+_0x4b6f83);const _0x28deff=lstatSync(_0x128d4c);if(_0x28deff[_0x59038d(0x1d5)]())return _0x128d4c;if(_0x28deff['isSymbolicLink']()){const _0x2555aa=realpathSync(_0x128d4c);if(lstatSync(_0x2555aa)[_0x59038d(0x1d5)]())return _0x2555aa;}throw CliErrors[_0x59038d(0x1d4)]('Skill\x20directory\x20not\x20found:\x20'+_0x4b6f83);}function requireRemoteScope(_0x3a70fc){const _0x564535=a117_0x10a2;if(_0x3a70fc[_0x564535(0x1f2)]===_0x564535(0x1b9)||_0x3a70fc['scope']===_0x564535(0x1b6)||_0x3a70fc['scope']===_0x564535(0x1e8))return _0x3a70fc[_0x564535(0x1f2)];throw CliErrors[_0x564535(0x1d4)](_0x564535(0x1f5)+(_0x3a70fc[_0x564535(0x1d7)]||'(unknown)')+_0x564535(0x1e7)+(_0x3a70fc[_0x564535(0x1f2)]??_0x564535(0x1c7))+'\x22.');}function readLocalSkillContent(_0xb804a){const _0x47b7b7=a117_0x10a2,_0x2e1ddd=resolve(_0xb804a,SKILL_FILE);return existsSync(_0x2e1ddd)&&lstatSync(_0x2e1ddd)['isFile']()?readFileSync(_0x2e1ddd,_0x47b7b7(0x1be)):'';}function a117_0x4221(){const _0x3b30bc=['validation','isDirectory','\x20to\x20submit\x20company\x20Skills\x20for\x20review.','skillCode','manifest','files','67928ClErNr','\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22','pushedAt','boolean','dir','number','content','version','match','Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20','3357pPHQzJ','length','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20','\x20has\x20unsupported\x20scope\x20\x22','builtin','displayName','5WWBZUf','tags','sourceSessionId','\x20name\x20for\x20SkillHub\x20slug\x20generation.','6678642comAVT','description','isFile','metadata','scope','targetScope','ignoreMetadataSkillCode','Remote\x20Skill\x20','3932468UZSlbY','appCode','\x20has\x20scope=\x22','company','Invalid\x20','object','personal','Skill\x20metadata\x20appCode\x20\x22','find','skillName','4YRDZnf','utf8','path','toLowerCase','isArray','12pZWmIQ','2348169bErqek','trim','Skill\x20directory\x20not\x20found:\x20','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20','unknown','605891DxmtQj','ignoreMetadataScope','791MMITks','ignoreInvalidMetadata','14730reyDsU','ignoreMetadataAppCodeMismatch','39042553hCRsqI','some','replace','startsWith','Missing\x20','Unable\x20to\x20resolve\x20skillCode\x20from\x20'];a117_0x4221=function(){return _0x3b30bc;};return a117_0x4221();}function readPushMetadataIfPresent(_0x5e9e88,_0x15f384={}){const _0x49eae0=a117_0x10a2;try{return readMetadataIfPresent(_0x5e9e88);}catch(_0x24f4ab){if(_0x15f384[_0x49eae0(0x1cb)])return undefined;throw _0x24f4ab;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x33a490,_0x200e4){const _0x288855=a118_0x5bcc,_0x868c4=_0x33a490();while(!![]){try{const _0xdeeeca=-parseInt(_0x288855(0x86))/0x1+parseInt(_0x288855(0x84))/0x2*(parseInt(_0x288855(0x87))/0x3)+parseInt(_0x288855(0x7e))/0x4+parseInt(_0x288855(0x8c))/0x5*(parseInt(_0x288855(0x8d))/0x6)+-parseInt(_0x288855(0x89))/0x7*(parseInt(_0x288855(0x7c))/0x8)+parseInt(_0x288855(0x8b))/0x9+-parseInt(_0x288855(0x7f))/0xa*(parseInt(_0x288855(0x81))/0xb);if(_0xdeeeca===_0x200e4)break;else _0x868c4['push'](_0x868c4['shift']());}catch(_0x523111){_0x868c4['push'](_0x868c4['shift']());}}}(a118_0x37a5,0xf1498));import{CliErrors}from'../../errors.js';function a118_0x37a5(){const _0x5e5baa=['1124MtVmuQ','Unsupported\x20runtime\x20Skill\x20scope:\x20','1401159CAEwOC','10155NFSjTC','personal','14UXgeKE','company','15967575bfcfXt','3892835AeykPr','12gZsOJf','push','1590504wZddrW','includes','2562824NhCmND','360evyENo','validation','943338FlEukn','builtin','length'];a118_0x37a5=function(){return _0x5e5baa;};return a118_0x37a5();}function a118_0x5bcc(_0x2e40ae,_0x28455f){_0x2e40ae=_0x2e40ae-0x7b;const _0x37a5e9=a118_0x37a5();let _0x5bcc70=_0x37a5e9[_0x2e40ae];return _0x5bcc70;}export function normalizeRuntimeSkillScopes(_0x1454cd){const _0x180e70=a118_0x5bcc,_0x4f0a1f=_0x1454cd&&_0x1454cd[_0x180e70(0x83)]>0x0?_0x1454cd:['personal',_0x180e70(0x8a),_0x180e70(0x82)],_0x59d6ff=[];for(const _0x5945f1 of _0x4f0a1f){if(!isRuntimeSkillScope(_0x5945f1))throw CliErrors[_0x180e70(0x80)](_0x180e70(0x85)+_0x5945f1);!_0x59d6ff[_0x180e70(0x7d)](_0x5945f1)&&_0x59d6ff[_0x180e70(0x7b)](_0x5945f1);}return _0x59d6ff;}export function isRuntimeSkillScope(_0x48fb87){const _0x56c58a=a118_0x5bcc;return _0x48fb87===_0x56c58a(0x88)||_0x48fb87===_0x56c58a(0x8a)||_0x48fb87===_0x56c58a(0x82);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
const a120_0x5c4e28=a120_0x11cd;(function(_0x329710,_0x2c5c0e){const _0x212b03=a120_0x11cd,_0x54a701=_0x329710();while(!![]){try{const _0x1bc82e=-parseInt(_0x212b03(0x173))/0x1*(parseInt(_0x212b03(0x15e))/0x2)+parseInt(_0x212b03(0x16e))/0x3*(-parseInt(_0x212b03(0x163))/0x4)+parseInt(_0x212b03(0x174))/0x5*(parseInt(_0x212b03(0x161))/0x6)+-parseInt(_0x212b03(0x16c))/0x7*(-parseInt(_0x212b03(0x167))/0x8)+-parseInt(_0x212b03(0x15c))/0x9*(parseInt(_0x212b03(0x166))/0xa)+parseInt(_0x212b03(0x169))/0xb*(-parseInt(_0x212b03(0x175))/0xc)+parseInt(_0x212b03(0x171))/0xd*(parseInt(_0x212b03(0x16d))/0xe);if(_0x1bc82e===_0x2c5c0e)break;else _0x54a701['push'](_0x54a701['shift']());}catch(_0x3e66d4){_0x54a701['push'](_0x54a701['shift']());}}}(a120_0x59cd,0xad73e));import{unzipSync,zipSync}from'fflate';import{CliErrors}from'../../errors.js';import{compareSkillFiles,fileContent,normalizeLocalFiles,normalizeSkillRelativePath}from'./local-files.js';const ZIP_MTIME=new Date(a120_0x5c4e28(0x15a));export function createDeterministicZipPackage(_0x5560a5){const _0x321c92=a120_0x5c4e28,_0x59b07d={};for(const _0x1503b9 of normalizeLocalFiles(_0x5560a5)){_0x59b07d[_0x1503b9[_0x321c92(0x15d)]]=fileContent(_0x1503b9);}return Buffer['from'](zipSync(_0x59b07d,{'level':0x0,'mtime':ZIP_MTIME}));}export function parseZipPackage(_0x2a4e0f){const _0x8bc7a1=a120_0x5c4e28;if(_0x2a4e0f[_0x8bc7a1(0x164)]<0x16)throw CliErrors['validation'](_0x8bc7a1(0x162));let _0x20db19;try{_0x20db19=unzipSync(_0x2a4e0f,{'filter'(_0x562730){const _0x5b786a=_0x8bc7a1,_0x1905fc=normalizeSkillRelativePath(_0x562730[_0x5b786a(0x16b)]);if(_0x1905fc[_0x5b786a(0x168)]('/'))throw CliErrors[_0x5b786a(0x170)](_0x5b786a(0x160)+_0x1905fc);return!![];}});}catch(_0x1644df){if(isRuntimeSkillValidationError(_0x1644df))throw _0x1644df;throw CliErrors[_0x8bc7a1(0x170)]('Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.');}return Object[_0x8bc7a1(0x15b)](_0x20db19)[_0x8bc7a1(0x16f)](([_0x46fac4,_0x5d602c])=>({'path':normalizeSkillRelativePath(_0x46fac4),'bytes':Buffer['from'](_0x5d602c)}))[_0x8bc7a1(0x15f)](compareSkillFiles);}function a120_0x11cd(_0x4b4fa7,_0x2a8f21){_0x4b4fa7=_0x4b4fa7-0x15a;const _0x59cd2a=a120_0x59cd();let _0x11cdb6=_0x59cd2a[_0x4b4fa7];return _0x11cdb6;}function isRuntimeSkillValidationError(_0x570fe4){const _0x1c30f6=a120_0x5c4e28;return typeof _0x570fe4===_0x1c30f6(0x172)&&_0x570fe4!==null&&_0x1c30f6(0x165)in _0x570fe4&&_0x570fe4[_0x1c30f6(0x165)]===_0x1c30f6(0x16a);}function a120_0x59cd(){const _0x3003e7=['8996iGyRHO','length','code','230OGWWVj','186856cAmkVb','endsWith','27379nDsnLm','validation_error','name','21BaSNMH','28ttWxbz','1077RdOpqq','map','validation','10480821GMCTYD','object','255545rMiLiC','185HDHZJa','24WMLZng','1980-01-01T00:00:00.000Z','entries','142146XNRLpN','path','2qxpyQG','sort','Runtime\x20Skill\x20package\x20contains\x20directory\x20entry:\x20','74454eiqqpp','Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.'];a120_0x59cd=function(){return _0x3003e7;};return a120_0x59cd();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3b1bbf,_0x700666){const _0x31f89c=a121_0x36f3,_0x45610a=_0x3b1bbf();while(!![]){try{const _0x1a0291=-parseInt(_0x31f89c(0x113))/0x1+parseInt(_0x31f89c(0x108))/0x2*(parseInt(_0x31f89c(0xf7))/0x3)+parseInt(_0x31f89c(0x100))/0x4+parseInt(_0x31f89c(0x105))/0x5+-parseInt(_0x31f89c(0x10b))/0x6+parseInt(_0x31f89c(0xf3))/0x7*(-parseInt(_0x31f89c(0xfb))/0x8)+-parseInt(_0x31f89c(0xff))/0x9*(-parseInt(_0x31f89c(0xed))/0xa);if(_0x1a0291===_0x700666)break;else _0x45610a['push'](_0x45610a['shift']());}catch(_0x355c49){_0x45610a['push'](_0x45610a['shift']());}}}(a121_0x45fd,0x3f90e));import{CliErrors}from'../../errors.js';function a121_0x45fd(){const _0x2c13e5=['Runtime\x20Skill\x20package\x20file\x20sha256\x20mismatch:\x20','1244aVNUOA','isSafeInteger','Duplicate\x20Skill\x20package\x20entry:\x20','2585964DEqiOf','some','files','zipSize','validation','bytes','Missing\x20','get','401043IhTUed','schemaVersion','Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.','base64','has','treeSha256','12216970JQTbHC','string','isArray','map','zipSha256','Runtime\x20Skill\x20package\x20sha256\x20mismatch.','13223xZlTFu','Runtime\x20Skill\x20package\x20is\x20required\x20for\x20Skill\x20install:\x20','Runtime\x20Skill\x20package\x20size\x20mismatch.','toString','267PZfxpB','length','toLowerCase','sha256','1288pngPAK','Runtime\x20Skill\x20package\x20sha256\x20is\x20invalid.','Runtime\x20Skill\x20file\x20tree\x20sha256\x20mismatch.','path','9eIbExb','21824VFsbgk','object','Runtime\x20Skill\x20package\x20is\x20missing\x20entry:\x20','trim','ossPath','570105MeTiUu','Runtime\x20Skill\x20package\x20file\x20size\x20mismatch:\x20'];a121_0x45fd=function(){return _0x2c13e5;};return a121_0x45fd();}import{SKILL_FILE}from'./constants.js';import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';function a121_0x36f3(_0x45666b,_0x414894){_0x45666b=_0x45666b-0xec;const _0x45fd53=a121_0x45fd();let _0x36f3f1=_0x45fd53[_0x45666b];return _0x36f3f1;}import{fileContent,isSha256Hex,normalizeLocalFiles,normalizeManifestFiles}from'./local-files.js';import{createDeterministicZipPackage,parseZipPackage}from'./zip-codec.js';export function buildSkillPackage(_0x93c379){const _0x44747b=a121_0x36f3,_0xa13ef6=normalizeLocalFiles(_0x93c379);if(!_0xa13ef6['some'](_0x3ff035=>_0x3ff035['path']===SKILL_FILE))throw CliErrors[_0x44747b(0x10f)](_0x44747b(0x111)+SKILL_FILE+'\x20in\x20Skill\x20file\x20package.');const _0x1b87d4=localFilesToManifestFiles(_0xa13ef6),_0x769ff3=createDeterministicZipPackage(_0xa13ef6);return{'manifest':{'schemaVersion':0x2,'treeSha256':fileTreeHash(_0x1b87d4),'zipSha256':bufferSha256(_0x769ff3),'zipSize':_0x769ff3[_0x44747b(0xf8)],'files':_0x1b87d4},'packageBytes':_0x769ff3,'packageBase64':_0x769ff3[_0x44747b(0xf6)](_0x44747b(0x116))};}export function verifyRuntimeSkillPackage(_0x348fcd,_0x42ed47){const _0x24e248=a121_0x36f3,_0x465958=normalizePackageManifest(_0x348fcd,{'requireOssPath':![]});if(!_0x465958)throw CliErrors[_0x24e248(0x10f)]('Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.');return extractAndVerifyPackage(_0x465958,_0x42ed47);}export function verifyRuntimeSkillBundle(_0x5ea4ae,_0xa63b23){const _0x226dfd=a121_0x36f3,_0x5006b9=normalizePackageManifest(_0x5ea4ae,{'requireOssPath':![]});if(!_0x5006b9)throw CliErrors['validation'](_0x226dfd(0x115));return extractAndVerifyPackageFiles(_0x5006b9,_0xa63b23);}export function tryNormalizePackageManifest(_0x31cc40){return normalizePackageManifest(_0x31cc40,{'requireOssPath':![]});}export function requirePackageBytes(_0x55ae7d,_0x32e8c2){const _0x17e72f=a121_0x36f3;if(!_0x32e8c2||_0x32e8c2[_0x17e72f(0xf8)]===0x0)throw CliErrors[_0x17e72f(0x10f)](_0x17e72f(0xf4)+_0x55ae7d);return _0x32e8c2;}export function extractDownloadedPackage(_0x2701c4){const _0x12b3fd=a121_0x36f3,_0x14590e=parseZipPackage(_0x2701c4)[_0x12b3fd(0xf0)](_0x343f73=>({'path':_0x343f73['path'],'bytes':_0x343f73[_0x12b3fd(0x110)]}));if(!_0x14590e[_0x12b3fd(0x10c)](_0x1b1c86=>_0x1b1c86[_0x12b3fd(0xfe)]===SKILL_FILE))throw CliErrors[_0x12b3fd(0x10f)]('Runtime\x20Skill\x20package\x20is\x20missing\x20'+SKILL_FILE+'.');return normalizeLocalFiles(_0x14590e);}export function localFilesToManifestFiles(_0x3d7bc2){const _0x1fb8c2=a121_0x36f3;return normalizeLocalFiles(_0x3d7bc2)[_0x1fb8c2(0xf0)](_0x175d28=>({'path':_0x175d28[_0x1fb8c2(0xfe)],'sha256':fileHash(_0x175d28),'size':fileContent(_0x175d28)[_0x1fb8c2(0xf8)]}));}function normalizePackageManifest(_0x499a96,_0x32216a){const _0x2e91d0=a121_0x36f3;if(!_0x499a96||typeof _0x499a96!==_0x2e91d0(0x101)||Array[_0x2e91d0(0xef)](_0x499a96))return undefined;const _0x140e35=_0x499a96,_0x332ab1=typeof _0x140e35[_0x2e91d0(0x104)]===_0x2e91d0(0xee)?_0x140e35[_0x2e91d0(0x104)][_0x2e91d0(0x103)]():undefined;if(_0x32216a['requireOssPath']&&!_0x332ab1)return undefined;if(!Array[_0x2e91d0(0xef)](_0x140e35[_0x2e91d0(0x10d)])||_0x140e35['files'][_0x2e91d0(0xf8)]===0x0)return undefined;if(!isSha256Hex(_0x140e35[_0x2e91d0(0xec)]))throw CliErrors['validation']('Runtime\x20Skill\x20file\x20tree\x20sha256\x20is\x20invalid.');if(!isSha256Hex(_0x140e35[_0x2e91d0(0xf1)]))throw CliErrors['validation'](_0x2e91d0(0xfc));if(!Number[_0x2e91d0(0x109)](_0x140e35['zipSize'])||_0x140e35['zipSize']<0x0)throw CliErrors[_0x2e91d0(0x10f)]('Runtime\x20Skill\x20package\x20size\x20is\x20invalid.');const _0x27d99b=normalizeManifestFiles(_0x140e35[_0x2e91d0(0x10d)]);if(!_0x27d99b['some'](_0x252af8=>_0x252af8[_0x2e91d0(0xfe)]===SKILL_FILE))throw CliErrors[_0x2e91d0(0x10f)]('Runtime\x20Skill\x20manifest\x20is\x20missing\x20'+SKILL_FILE+'.');const _0x2e7e73=fileTreeHash(_0x27d99b);if(_0x2e7e73!==_0x140e35[_0x2e91d0(0xec)][_0x2e91d0(0xf9)]())throw CliErrors[_0x2e91d0(0x10f)](_0x2e91d0(0xfd));return{'schemaVersion':Number[_0x2e91d0(0x109)](_0x140e35[_0x2e91d0(0x114)])?_0x140e35[_0x2e91d0(0x114)]:0x2,'ossPath':_0x332ab1,'treeSha256':_0x2e7e73,'zipSha256':_0x140e35[_0x2e91d0(0xf1)][_0x2e91d0(0xf9)](),'zipSize':_0x140e35[_0x2e91d0(0x10e)],'files':_0x27d99b};}function extractAndVerifyPackage(_0x5ad5b3,_0x142105){const _0x36aff1=a121_0x36f3,_0x27e752=normalizePackageManifest(_0x5ad5b3,{'requireOssPath':![]});if(!_0x27e752)throw CliErrors[_0x36aff1(0x10f)](_0x36aff1(0x115));if(_0x142105[_0x36aff1(0xf8)]!==_0x27e752[_0x36aff1(0x10e)])throw CliErrors[_0x36aff1(0x10f)](_0x36aff1(0xf5));const _0x29c304=bufferSha256(_0x142105);if(_0x29c304!==_0x27e752[_0x36aff1(0xf1)])throw CliErrors[_0x36aff1(0x10f)](_0x36aff1(0xf2));return extractAndVerifyPackageFiles(_0x27e752,_0x142105);}function extractAndVerifyPackageFiles(_0x127a33,_0x58d26a){const _0x551afe=a121_0x36f3,_0x2c4427=parseZipPackage(_0x58d26a);if(_0x2c4427[_0x551afe(0xf8)]!==_0x127a33[_0x551afe(0x10d)][_0x551afe(0xf8)])throw CliErrors[_0x551afe(0x10f)]('Runtime\x20Skill\x20package\x20entry\x20list\x20mismatch.');const _0x1360e8=new Map();for(const _0x58f8fc of _0x2c4427){if(_0x1360e8[_0x551afe(0x117)](_0x58f8fc[_0x551afe(0xfe)]))throw CliErrors['validation'](_0x551afe(0x10a)+_0x58f8fc['path']);_0x1360e8['set'](_0x58f8fc['path'],_0x58f8fc);}const _0x3290d8=[];for(const _0x2fe38d of _0x127a33[_0x551afe(0x10d)]){const _0x76735c=_0x1360e8[_0x551afe(0x112)](_0x2fe38d[_0x551afe(0xfe)]);if(!_0x76735c)throw CliErrors[_0x551afe(0x10f)](_0x551afe(0x102)+_0x2fe38d['path']);if(_0x76735c['bytes'][_0x551afe(0xf8)]!==_0x2fe38d['size'])throw CliErrors[_0x551afe(0x10f)](_0x551afe(0x106)+_0x2fe38d[_0x551afe(0xfe)]);const _0x32bd56=bufferSha256(_0x76735c['bytes']);if(_0x32bd56!==_0x2fe38d[_0x551afe(0xfa)])throw CliErrors[_0x551afe(0x10f)](_0x551afe(0x107)+_0x2fe38d['path']);_0x3290d8['push']({'path':_0x2fe38d[_0x551afe(0xfe)],'bytes':_0x76735c['bytes']});}return normalizeLocalFiles(_0x3290d8);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2d0311,_0x35f6b9){var _0x465c84=a122_0x73b0,_0x5be880=_0x2d0311();while(!![]){try{var _0x406f4c=-parseInt(_0x465c84(0xf5))/0x1+parseInt(_0x465c84(0xf7))/0x2*(parseInt(_0x465c84(0xf2))/0x3)+-parseInt(_0x465c84(0xf1))/0x4*(-parseInt(_0x465c84(0xf4))/0x5)+-parseInt(_0x465c84(0xf6))/0x6+-parseInt(_0x465c84(0xf3))/0x7+parseInt(_0x465c84(0xf8))/0x8+parseInt(_0x465c84(0xf9))/0x9;if(_0x406f4c===_0x35f6b9)break;else _0x5be880['push'](_0x5be880['shift']());}catch(_0x14ba32){_0x5be880['push'](_0x5be880['shift']());}}}(a122_0x5ae6,0xe98b0));function a122_0x5ae6(){var _0x18a1da=['184450XAczDU','1218448IcJCWD','1414764IDHZKV','1448894kdUewc','1132848rFmRqZ','4890591SdbSlN','36SXfiZV','6iybwbd','385525MPUsCL'];a122_0x5ae6=function(){return _0x18a1da;};return a122_0x5ae6();}export{contentHash,fileTreeHash}from'./runtime-skill-sync/hashing.js';export{linkEffectiveRuntimeSkills,linkGlobalRuntimeSkills,pruneStaleRuntimeSkillCache,pruneStaleRuntimeSkillLinks}from'./runtime-skill-sync/links.js';function a122_0x73b0(_0xc0c661,_0x4f29cc){_0xc0c661=_0xc0c661-0xf1;var _0x5ae6d2=a122_0x5ae6();var _0x73b08f=_0x5ae6d2[_0xc0c661];return _0x73b08f;}export{resolveRuntimeSkillInstallTarget}from'./runtime-skill-sync/install-target.js';export{listLocalRuntimeSkills}from'./runtime-skill-sync/list-local.js';export{materializeRuntimeSkill}from'./runtime-skill-sync/materialize.js';export{readMetadataIfPresent}from'./runtime-skill-sync/metadata.js';export{getRuntimeSkillCacheRoot,getRuntimeSkillDir,resolveSkillSyncPaths,runtimeAgentSkillRoots}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 a123_0x3b8f(_0x5ca3ac,_0x2d098c){_0x5ca3ac=_0x5ca3ac-0x1ec;const _0x16744c=a123_0x1674();let _0x3b8f39=_0x16744c[_0x5ca3ac];return _0x3b8f39;}(function(_0x32b03c,_0x1a1721){const _0x5a5a22=a123_0x3b8f,_0x283d9b=_0x32b03c();while(!![]){try{const _0x497dfc=parseInt(_0x5a5a22(0x1ef))/0x1+-parseInt(_0x5a5a22(0x1ee))/0x2+-parseInt(_0x5a5a22(0x1f2))/0x3+parseInt(_0x5a5a22(0x1ec))/0x4+-parseInt(_0x5a5a22(0x1f0))/0x5+parseInt(_0x5a5a22(0x1f1))/0x6+-parseInt(_0x5a5a22(0x1f3))/0x7*(parseInt(_0x5a5a22(0x1ed))/0x8);if(_0x497dfc===_0x1a1721)break;else _0x283d9b['push'](_0x283d9b['shift']());}catch(_0x1b6119){_0x283d9b['push'](_0x283d9b['shift']());}}}(a123_0x1674,0xa6fd9));function a123_0x1674(){const _0x42f4a2=['1296289BRvIXs','1619830iLOOBy','7980984CpUPuc','1826754hyrinr','14AorBmP','4432736jGetdg','7812984ODnyJb','329028qPRYtu'];a123_0x1674=function(){return _0x42f4a2;};return a123_0x1674();}import{createJqFilter,resolveBundledJqPaths}from'@lovrabet/cli-framework';import{CliErrors}from'../errors.js';export const applyJqFilter=createJqFilter(CliErrors,{'bundledJqPaths':resolveBundledJqPaths()});
|
package/lib/utils/logger.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a124_0x749091=a124_0x1819;(function(_0xe9f4f7,_0x29ca3c){const _0x56b1d3=a124_0x1819,_0x2a881=_0xe9f4f7();while(!![]){try{const _0x3e3ce1=-parseInt(_0x56b1d3(0x190))/0x1+-parseInt(_0x56b1d3(0x197))/0x2*(-parseInt(_0x56b1d3(0x193))/0x3)+parseInt(_0x56b1d3(0x195))/0x4*(parseInt(_0x56b1d3(0x1b1))/0x5)+-parseInt(_0x56b1d3(0x19d))/0x6*(-parseInt(_0x56b1d3(0x1a8))/0x7)+parseInt(_0x56b1d3(0x1a1))/0x8+-parseInt(_0x56b1d3(0x1bc))/0x9+parseInt(_0x56b1d3(0x1a5))/0xa*(parseInt(_0x56b1d3(0x19a))/0xb);if(_0x3e3ce1===_0x29ca3c)break;else _0x2a881['push'](_0x2a881['shift']());}catch(_0x453aa6){_0x2a881['push'](_0x2a881['shift']());}}}(a124_0x1880,0xb816b));import a124_0x374a56 from'winston';import a124_0x4a4652 from'node:fs';import a124_0x37954f from'node:path';import{PRODUCT_CONFIG}from'../constant/product.js';class Logger{[a124_0x749091(0x1b0)];[a124_0x749091(0x1b6)]='';[a124_0x749091(0x19c)]='';constructor(){}[a124_0x749091(0x1a3)](_0x4333f1){this['currentRawCommand']=_0x4333f1;}['setLogPath'](_0x6fe4f0){const _0x532dc8=a124_0x749091;this[_0x532dc8(0x1b6)]=a124_0x37954f['join'](_0x6fe4f0,PRODUCT_CONFIG[_0x532dc8(0x1aa)]),this[_0x532dc8(0x1b0)]&&this[_0x532dc8(0x1b0)]['clear'](),this[_0x532dc8(0x1ac)]();}[a124_0x749091(0x1ac)](){const _0x521430=a124_0x749091,_0x3c8b95=a124_0x37954f['dirname'](this[_0x521430(0x1b6)]);!a124_0x4a4652[_0x521430(0x1a2)](_0x3c8b95)&&a124_0x4a4652[_0x521430(0x1b9)](_0x3c8b95,{'recursive':!![]});const _0x2889de=a124_0x374a56[_0x521430(0x194)][_0x521430(0x1a0)](a124_0x374a56[_0x521430(0x194)]['timestamp'](),a124_0x374a56[_0x521430(0x194)][_0x521430(0x1bb)]({'stack':!![]}),a124_0x374a56[_0x521430(0x194)][_0x521430(0x1be)](_0x575211=>{const _0x1cafcb=_0x521430,_0x45e086={'timestamp':_0x575211['timestamp']||new Date()['toISOString'](),'level':_0x575211[_0x1cafcb(0x198)]||'info','command':_0x575211['command']||_0x1cafcb(0x1b8),'rawCommand':_0x575211[_0x1cafcb(0x1ae)]||this['currentRawCommand']||undefined,'message':_0x575211[_0x1cafcb(0x1af)]||'','duration':_0x575211[_0x1cafcb(0x1b5)]||undefined,'details':_0x575211[_0x1cafcb(0x191)]||undefined};return JSON[_0x1cafcb(0x1b7)](_0x45e086);}));this[_0x521430(0x1b0)]=a124_0x374a56[_0x521430(0x1b2)]({'level':'info','format':_0x2889de,'transports':[new a124_0x374a56[(_0x521430(0x19f))][(_0x521430(0x1a9))]({'filename':this[_0x521430(0x1b6)],'level':_0x521430(0x19e)})],'silent':![]}),a124_0x374a56['addColors']({'success':'green','error':_0x521430(0x199),'warn':_0x521430(0x1bf),'info':'blue'});}[a124_0x749091(0x19e)](_0x35c198,_0x26f34e,_0x8476d){const _0x3bb054=a124_0x749091;if(!this['logFilePath']||!this[_0x3bb054(0x1b0)])return;this[_0x3bb054(0x1b0)][_0x3bb054(0x19e)](_0x26f34e,{'command':_0x35c198,'details':_0x8476d});}[a124_0x749091(0x1ad)](_0x36e3d9,_0x31fd25,_0x47270f,_0x4e4778){const _0x14544f=a124_0x749091;if(!this[_0x14544f(0x1b6)]||!this['winstonLogger'])return;this[_0x14544f(0x1b0)][_0x14544f(0x1a4)]('info',_0x31fd25,{'level':'success','command':_0x36e3d9,'duration':_0x47270f,'details':_0x4e4778});}[a124_0x749091(0x1b4)](_0x265350,_0x5e450d,_0x2606dd){const _0x3cf8ba=a124_0x749091;if(!this[_0x3cf8ba(0x1b6)]||!this[_0x3cf8ba(0x1b0)])return;this['winstonLogger'][_0x3cf8ba(0x1b4)](_0x5e450d,{'command':_0x265350,'details':_0x2606dd});}[a124_0x749091(0x1ba)](_0x33eaa3,_0xc831b7,_0x38b017){const _0x24226b=a124_0x749091;if(!this[_0x24226b(0x1b6)]||!this[_0x24226b(0x1b0)])return;this[_0x24226b(0x1b0)][_0x24226b(0x1ba)](_0xc831b7,{'command':_0x33eaa3,'details':_0x38b017});}async[a124_0x749091(0x19b)](_0x35d9d7,_0x1adb7a,_0x28d263){const _0x2f4e1c=a124_0x749091,_0x39f50f=Date[_0x2f4e1c(0x1a7)]();this[_0x2f4e1c(0x19e)](_0x35d9d7,_0x2f4e1c(0x1bd)+_0x1adb7a);try{const _0x2a5da5=await _0x28d263(),_0x3787cc=Date[_0x2f4e1c(0x1a7)]()-_0x39f50f;return this['success'](_0x35d9d7,_0x2f4e1c(0x1c0)+_0x1adb7a,_0x3787cc),_0x2a5da5;}catch(_0x4b0521){const _0x3b2898=Date[_0x2f4e1c(0x1a7)]()-_0x39f50f;this[_0x2f4e1c(0x1b4)](_0x35d9d7,'Failed:\x20'+_0x1adb7a,{'error':_0x4b0521 instanceof Error?_0x4b0521[_0x2f4e1c(0x1af)]:String(_0x4b0521),'duration':_0x3b2898});throw _0x4b0521;}}['readLogs'](){const _0x325897=a124_0x749091;try{if(!a124_0x4a4652['existsSync'](this[_0x325897(0x1b6)]))return[];const _0x3ba4c1=a124_0x4a4652['readFileSync'](this['logFilePath'],_0x325897(0x1ab));return _0x3ba4c1['split'](/\r?\n/)[_0x325897(0x192)](_0x433a67=>_0x433a67['trim']())[_0x325897(0x1c1)](_0x5be259=>JSON['parse'](_0x5be259));}catch(_0x3fdcee){return console['warn']('Failed\x20to\x20read\x20logs:',_0x3fdcee),[];}}[a124_0x749091(0x196)](){const _0x5d2ec7=a124_0x749091;try{a124_0x4a4652['existsSync'](this['logFilePath'])&&a124_0x4a4652[_0x5d2ec7(0x1b3)](this[_0x5d2ec7(0x1b6)],'','utf8');}catch(_0x4f6ffe){console[_0x5d2ec7(0x1ba)](_0x5d2ec7(0x1a6),_0x4f6ffe);}}['getWinstonInstance'](){const _0x5cf538=a124_0x749091;return this[_0x5cf538(0x1b0)];}}function a124_0x1880(){const _0x41034=['mkdirSync','warn','errors','6099930QdQTne','Starting:\x20','printf','yellow','Completed:\x20','map','881377eqynZo','details','filter','771CfTOde','format','30024TNNgjv','clearLogs','11616lvBDPD','level','red','47839UEeSwa','logTask','currentRawCommand','552042sGuiRe','info','transports','combine','16512wGsEPS','existsSync','setRawCommand','log','1230XwazXF','Failed\x20to\x20clear\x20logs:','now','21qXhDGE','File','logFileName','utf8','initWinstonLogger','success','rawCommand','message','winstonLogger','5PWfDEr','createLogger','writeFileSync','error','duration','logFilePath','stringify','unknown'];a124_0x1880=function(){return _0x41034;};return a124_0x1880();}function a124_0x1819(_0x3782ae,_0xb6a191){_0x3782ae=_0x3782ae-0x190;const _0x18808d=a124_0x1880();let _0x1819fe=_0x18808d[_0x3782ae];return _0x1819fe;}export const logger=new Logger();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a125_0xca3f75=a125_0x4083;(function(_0x40b5c1,_0x80e3f7){const _0xc9386e=a125_0x4083,_0x27dd9b=_0x40b5c1();while(!![]){try{const _0x461627=-parseInt(_0xc9386e(0x181))/0x1*(parseInt(_0xc9386e(0x187))/0x2)+-parseInt(_0xc9386e(0x18b))/0x3*(-parseInt(_0xc9386e(0x18a))/0x4)+-parseInt(_0xc9386e(0x17e))/0x5+-parseInt(_0xc9386e(0x182))/0x6+parseInt(_0xc9386e(0x18d))/0x7*(parseInt(_0xc9386e(0x189))/0x8)+parseInt(_0xc9386e(0x18e))/0x9+parseInt(_0xc9386e(0x188))/0xa;if(_0x461627===_0x80e3f7)break;else _0x27dd9b['push'](_0x27dd9b['shift']());}catch(_0x50dcca){_0x27dd9b['push'](_0x27dd9b['shift']());}}}(a125_0x47fb,0xa53be));function a125_0x4083(_0x31adc4,_0x19a590){_0x31adc4=_0x31adc4-0x17c;const _0x47fbbd=a125_0x47fb();let _0x40832b=_0x47fbbd[_0x31adc4];return _0x40832b;}const JSON_NUMBER_PATTERN=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?/,MAX_SAFE_INTEGER=BigInt(Number[a125_0xca3f75(0x18c)]),MIN_SAFE_INTEGER=BigInt(Number[a125_0xca3f75(0x17f)]);let restoreResponseJsonParser,responseJsonPrototype,originalResponseJsonDescriptor;function a125_0x47fb(){const _0xc6dbc3=['MIN_SAFE_INTEGER','prototype','50551WdcuaC','2953806xULdAJ','length','json','exec','slice','14bnVZqN','6259620oOezKO','728AxQnGa','4TZfHvl','1168851LAfoiC','MAX_SAFE_INTEGER','9597dVfdhV','6199749hnlPIa','includes','undefined','defineProperty','1531225kSlkYn'];a125_0x47fb=function(){return _0xc6dbc3;};return a125_0x47fb();}function isUnsafeIntegerLiteral(_0x2e1864){const _0x19aeb1=a125_0xca3f75;if(_0x2e1864[_0x19aeb1(0x18f)]('.')||_0x2e1864[_0x19aeb1(0x18f)]('e')||_0x2e1864['includes']('E'))return![];const _0x273b7d=BigInt(_0x2e1864);return _0x273b7d>MAX_SAFE_INTEGER||_0x273b7d<MIN_SAFE_INTEGER;}function quoteUnsafeIntegerLiterals(_0x51a186){const _0x5f3099=a125_0xca3f75;let _0x34b55c='',_0x29c7d2=![],_0x59beaa=![];for(let _0xf450d9=0x0;_0xf450d9<_0x51a186[_0x5f3099(0x183)];){const _0x5009f7=_0x51a186[_0xf450d9];if(_0x29c7d2){_0x34b55c+=_0x5009f7,_0xf450d9+=0x1;if(_0x59beaa)_0x59beaa=![];else{if(_0x5009f7==='\x5c')_0x59beaa=!![];else _0x5009f7==='\x22'&&(_0x29c7d2=![]);}continue;}if(_0x5009f7==='\x22'){_0x29c7d2=!![],_0x34b55c+=_0x5009f7,_0xf450d9+=0x1;continue;}if(_0x5009f7==='-'||_0x5009f7>='0'&&_0x5009f7<='9'){const _0x12f174=JSON_NUMBER_PATTERN[_0x5f3099(0x185)](_0x51a186[_0x5f3099(0x186)](_0xf450d9))?.[0x0];if(_0x12f174){_0x34b55c+=isUnsafeIntegerLiteral(_0x12f174)?'\x22'+_0x12f174+'\x22':_0x12f174,_0xf450d9+=_0x12f174[_0x5f3099(0x183)];continue;}}_0x34b55c+=_0x5009f7,_0xf450d9+=0x1;}return _0x34b55c;}export function parseLosslessJson(_0x2b967a){return JSON['parse'](quoteUnsafeIntegerLiterals(_0x2b967a));}export function installLosslessJsonResponseParser(){const _0x2ddaf4=a125_0xca3f75;if(typeof Response===_0x2ddaf4(0x17c))return()=>{};if(restoreResponseJsonParser)return restoreResponseJsonParser;return responseJsonPrototype=Response[_0x2ddaf4(0x180)],originalResponseJsonDescriptor=Object['getOwnPropertyDescriptor'](responseJsonPrototype,_0x2ddaf4(0x184)),Object['defineProperty'](responseJsonPrototype,_0x2ddaf4(0x184),{...originalResponseJsonDescriptor??{'configurable':!![],'enumerable':![],'writable':!![]},'value':async function _0x2eec89(){return parseLosslessJson(await this['text']());}}),restoreResponseJsonParser=()=>{const _0x26d43f=_0x2ddaf4;if(!responseJsonPrototype)return;originalResponseJsonDescriptor?Object[_0x26d43f(0x17d)](responseJsonPrototype,_0x26d43f(0x184),originalResponseJsonDescriptor):delete responseJsonPrototype[_0x26d43f(0x184)],responseJsonPrototype=undefined,originalResponseJsonDescriptor=undefined,restoreResponseJsonParser=undefined;},restoreResponseJsonParser;}export function restoreLosslessJsonResponseParser(){restoreResponseJsonParser?.();}
|
package/lib/utils/params.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xd430ff,_0x196974){const _0x152148=a126_0x1bb5,_0x29b806=_0xd430ff();while(!![]){try{const _0xe0e0e7=parseInt(_0x152148(0x1d0))/0x1+parseInt(_0x152148(0x1e5))/0x2*(-parseInt(_0x152148(0x1d7))/0x3)+-parseInt(_0x152148(0x1d2))/0x4*(parseInt(_0x152148(0x1d6))/0x5)+-parseInt(_0x152148(0x1e6))/0x6*(parseInt(_0x152148(0x1d3))/0x7)+parseInt(_0x152148(0x1e1))/0x8+-parseInt(_0x152148(0x1c9))/0x9+-parseInt(_0x152148(0x1df))/0xa*(-parseInt(_0x152148(0x1e2))/0xb);if(_0xe0e0e7===_0x196974)break;else _0x29b806['push'](_0x29b806['shift']());}catch(_0x4bd70e){_0x29b806['push'](_0x29b806['shift']());}}}(a126_0x3bb9,0x90ca0));import{CliErrors}from'../errors.js';import{parseLosslessJson}from'../utils/lossless-json.js';export const MAX_DATA_UPDATE_IDS=0x3e8;export function parseJsonParams(_0x67fa4){const _0x1dfd1d=a126_0x1bb5;if(!_0x67fa4)return undefined;try{return parseLosslessJson(_0x67fa4);}catch{throw CliErrors[_0x1dfd1d(0x1d9)](_0x1dfd1d(0x1cc)+_0x67fa4);}}export function parseJsonParamsValue(_0x5b57b5){const _0x3b96e0=a126_0x1bb5;if(!_0x5b57b5)return undefined;try{return parseLosslessJson(_0x5b57b5);}catch{throw CliErrors[_0x3b96e0(0x1d9)]('Invalid\x20JSON\x20for\x20--params:\x20'+_0x5b57b5);}}function a126_0x1bb5(_0x5710af,_0x316011){_0x5710af=_0x5710af-0x1c9;const _0x3bb9fc=a126_0x3bb9();let _0x1bb572=_0x3bb9fc[_0x5710af];return _0x1bb572;}export function parseBatchCreateItemsFromParams(_0x22f63e){const _0x501331=a126_0x1bb5;if(Array['isArray'](_0x22f63e))return _0x22f63e;if(_0x22f63e!==null&&_0x22f63e!==undefined&&typeof _0x22f63e===_0x501331(0x1d4)&&Array[_0x501331(0x1dc)](_0x22f63e[_0x501331(0x1de)]))return _0x22f63e[_0x501331(0x1de)];throw CliErrors[_0x501331(0x1d9)](_0x501331(0x1ce),_0x501331(0x1ca));}function parseDataUpdateId(_0x59305e,_0x523749){const _0x29ae11=a126_0x1bb5;if(typeof _0x59305e==='number'&&Number[_0x29ae11(0x1dd)](_0x59305e)&&_0x59305e>0x0)return _0x59305e;if(typeof _0x59305e===_0x29ae11(0x1d1)){if(/^[1-9]\d*$/[_0x29ae11(0x1e7)](_0x59305e))return _0x59305e;}throw CliErrors[_0x29ae11(0x1d9)](_0x29ae11(0x1cd)+_0x523749+_0x29ae11(0x1e8));}export function parseUpdateIdsFromParams(_0x30baab){const _0x1ef2f3=a126_0x1bb5;if(_0x30baab===null||_0x30baab===undefined||typeof _0x30baab!==_0x1ef2f3(0x1d4)||Array['isArray'](_0x30baab))throw CliErrors['validation'](_0x1ef2f3(0x1e3),_0x1ef2f3(0x1d5));const _0x4ba009=_0x30baab['id'];if(_0x4ba009===undefined||_0x4ba009===null)throw CliErrors[_0x1ef2f3(0x1d9)](_0x1ef2f3(0x1d8),_0x1ef2f3(0x1d5));const _0x30ce7f=Array[_0x1ef2f3(0x1dc)](_0x4ba009)?_0x4ba009:[_0x4ba009];if(_0x30ce7f[_0x1ef2f3(0x1cb)]===0x0)throw CliErrors[_0x1ef2f3(0x1d9)](_0x1ef2f3(0x1cf));if(_0x30ce7f['length']>MAX_DATA_UPDATE_IDS)throw CliErrors['validation']('data\x20update\x20can\x20update\x20at\x20most\x20'+MAX_DATA_UPDATE_IDS+_0x1ef2f3(0x1e4)+_0x30ce7f[_0x1ef2f3(0x1cb)]+'.');return _0x30ce7f[_0x1ef2f3(0x1db)]((_0x47c442,_0x55da4a)=>parseDataUpdateId(_0x47c442,Array[_0x1ef2f3(0x1dc)](_0x4ba009)?_0x1ef2f3(0x1e0)+_0x55da4a+']':'id'));}export function normalizeUpdateParamsForRuntime(_0x511d70,_0x4c5af7){const _0x1aa58d=a126_0x1bb5;if(Array[_0x1aa58d(0x1dc)](_0x511d70['id'])&&_0x4c5af7['length']>0x1)return{..._0x511d70,'id':_0x4c5af7[_0x1aa58d(0x1da)](',')};return _0x511d70;}function a126_0x3bb9(){const _0x356652=['map','isArray','isSafeInteger','items','27780xkmvbQ','id[','4427976UzXAhM','8217ZssdCw','data\x20update\x20--params\x20must\x20be\x20a\x20JSON\x20object\x20with\x20id.','\x20records\x20per\x20call;\x20received\x20','302rYGycO','4613130oyYWnK','test','\x20must\x20be\x20a\x20positive\x20integer\x20or\x20numeric\x20string.','4209723bvCUOE','Example:\x20--params\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27','length','Invalid\x20JSON\x20for\x20--params:\x20','data\x20update\x20--params.','batchCreate\x20--params\x20must\x20be\x20a\x20JSON\x20array\x20or\x20{\x22items\x22:[...]}','data\x20update\x20id\x20array\x20cannot\x20be\x20empty.','451395YiiOhx','string','28LpWSay','7kdAQHa','object','Example:\x20--params\x20\x27{\x22id\x22:[1,2,3],\x22status\x22:\x22done\x22}\x27','420405oSzJrI','13149JOdqvC','data\x20update\x20requires\x20\x22id\x22\x20in\x20--params.','validation','join'];a126_0x3bb9=function(){return _0x356652;};return a126_0x3bb9();}
|
package/lib/utils/platform.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a127_0x4bc571=a127_0x5b86;(function(_0x3c5b3f,_0x21dbf1){const _0x4ac499=a127_0x5b86,_0xe2687b=_0x3c5b3f();while(!![]){try{const _0x17846b=parseInt(_0x4ac499(0x12c))/0x1*(-parseInt(_0x4ac499(0x136))/0x2)+-parseInt(_0x4ac499(0x12e))/0x3*(parseInt(_0x4ac499(0x137))/0x4)+parseInt(_0x4ac499(0x131))/0x5*(-parseInt(_0x4ac499(0x132))/0x6)+parseInt(_0x4ac499(0x138))/0x7*(parseInt(_0x4ac499(0x12b))/0x8)+-parseInt(_0x4ac499(0x12f))/0x9*(-parseInt(_0x4ac499(0x133))/0xa)+-parseInt(_0x4ac499(0x12d))/0xb*(-parseInt(_0x4ac499(0x135))/0xc)+parseInt(_0x4ac499(0x134))/0xd;if(_0x17846b===_0x21dbf1)break;else _0xe2687b['push'](_0xe2687b['shift']());}catch(_0x15cf09){_0xe2687b['push'](_0xe2687b['shift']());}}}(a127_0x8ab0,0x3d5c6));export const isWindows=process['platform']===a127_0x4bc571(0x130);function a127_0x5b86(_0x5c6011,_0x3cdc17){_0x5c6011=_0x5c6011-0x12b;const _0x8ab0d2=a127_0x8ab0();let _0x5b86fa=_0x8ab0d2[_0x5c6011];return _0x5b86fa;}export function resolveNpmBin(_0x44c57f){return isWindows?_0x44c57f+'.cmd':_0x44c57f;}function a127_0x8ab0(){const _0x3bd7a4=['204590bifeWO','8810932GIBwAp','2148WWkBsi','70wYFNNo','35004VfABys','21qivElG','2768PQAThV','5183sqrXnS','13607wlMOuR','153aSHgfl','144LcwgTs','win32','5AdczQs','2091174ivVXGS'];a127_0x8ab0=function(){return _0x3bd7a4;};return a127_0x8ab0();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x28b4d9,_0x2624b9){const _0x1963da=a128_0x4b7c,_0x3cc709=_0x28b4d9();while(!![]){try{const _0x552676=-parseInt(_0x1963da(0x1fc))/0x1+parseInt(_0x1963da(0x1fa))/0x2*(-parseInt(_0x1963da(0x1e9))/0x3)+parseInt(_0x1963da(0x1f5))/0x4+-parseInt(_0x1963da(0x1ed))/0x5+-parseInt(_0x1963da(0x1f1))/0x6+-parseInt(_0x1963da(0x1e7))/0x7+parseInt(_0x1963da(0x1dd))/0x8;if(_0x552676===_0x2624b9)break;else _0x3cc709['push'](_0x3cc709['shift']());}catch(_0x48f581){_0x3cc709['push'](_0x3cc709['shift']());}}}(a128_0xff7a,0xcba6e));import{mkdir,readFile,writeFile}from'node:fs/promises';function a128_0x4b7c(_0x13424a,_0x4848d5){_0x13424a=_0x13424a-0x1dd;const _0xff7a85=a128_0xff7a();let _0x4b7cd6=_0xff7a85[_0x13424a];return _0x4b7cd6;}import{homedir}from'node:os';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';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(_0x4ac648){const _0x5b72fc=a128_0x4b7c,_0x53b215=_0x4ac648[_0x5b72fc(0x1fb)]()['match'](/^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?$/);if(!_0x53b215)return null;return{'major':Number(_0x53b215[0x1]),'minor':Number(_0x53b215[0x2]),'patch':Number(_0x53b215[0x3]),'prerelease':_0x53b215[0x4]};}function compareSemver(_0x229755,_0x5bf536){const _0x5766cc=a128_0x4b7c,_0x3debfb=parseSemver(_0x229755),_0x3faac8=parseSemver(_0x5bf536);if(!_0x3debfb||!_0x3faac8)throw new Error(_0x5766cc(0x1f9));for(const _0x4ef783 of['major',_0x5766cc(0x1e3),_0x5766cc(0x1fe)]){if(_0x3debfb[_0x4ef783]<_0x3faac8[_0x4ef783])return-0x1;if(_0x3debfb[_0x4ef783]>_0x3faac8[_0x4ef783])return 0x1;}if(!_0x3debfb[_0x5766cc(0x1f7)]&&!_0x3faac8[_0x5766cc(0x1f7)])return 0x0;if(!_0x3debfb[_0x5766cc(0x1f7)])return 0x1;if(!_0x3faac8['prerelease'])return-0x1;if(_0x3debfb['prerelease']===_0x3faac8[_0x5766cc(0x1f7)])return 0x0;return _0x3debfb[_0x5766cc(0x1f7)]<_0x3faac8[_0x5766cc(0x1f7)]?-0x1:0x1;}function isUpdateNoticeDisabled(){const _0x5b9217=a128_0x4b7c,_0x5bba4d=process.env.LOVRABET_NO_UPDATE_NOTICE?.[_0x5b9217(0x1fb)]()[_0x5b9217(0x1de)]();return _0x5bba4d==='1'||_0x5bba4d==='true'||_0x5bba4d===_0x5b9217(0x1f0);}function cacheRoot(){const _0x42d387=a128_0x4b7c;return process.env.XDG_CACHE_HOME||process.env.LOCALAPPDATA||join(homedir(),_0x42d387(0x1ec));}export function getUpdateNoticeCachePath(){const _0x1d00d3=a128_0x4b7c;return join(cacheRoot(),'lovrabet-cli',_0x1d00d3(0x1e1));}async function readUpdateNoticeCache(){const _0x3e5d34=a128_0x4b7c;try{const _0x180842=await readFile(getUpdateNoticeCachePath(),_0x3e5d34(0x1ef)),_0x341cbc=JSON[_0x3e5d34(0x200)](_0x180842);if(!_0x341cbc||typeof _0x341cbc!==_0x3e5d34(0x1f2))return{};return _0x341cbc;}catch{return{};}}async function writeUpdateNoticeCache(_0x45ea16){const _0x39354b=a128_0x4b7c;try{const _0x523131=getUpdateNoticeCachePath();await mkdir(dirname(_0x523131),{'recursive':!![]}),await writeFile(_0x523131,JSON[_0x39354b(0x1e0)](_0x45ea16,null,0x2)+'\x0a',_0x39354b(0x1ef));}catch{}}function a128_0xff7a(){const _0x456cc8=['5510880NHQCCe','checkedAt','utf8','yes','8665902VrOErB','object','timeout','/-/package/','1990844IHuxiv','/dist-tags','prerelease','map','Invalid\x20semver','30CQIqSX','trim','1454673DivMkX','entries','patch','latest','parse','50241936NocALZ','toLowerCase','now','stringify','update-check.json','filter','minor','\x20available,\x20current\x20',',\x20run:\x20','lastNotifiedVersion','6971223hBjXWn','string','189348ATmPFd','lastNotifiedAt','https://www.npmjs.com/package/','.cache'];a128_0xff7a=function(){return _0x456cc8;};return a128_0xff7a();}function isFreshCheck(_0x3961cd,_0x550810){const _0x2fd3d5=a128_0x4b7c;return typeof _0x3961cd['checkedAt']==='number'&&_0x550810-_0x3961cd[_0x2fd3d5(0x1ee)]<UPDATE_CHECK_TTL_MS;}function isRecentlyNotified(_0x1bff64,_0xe052ac,_0x4962de){const _0x3caefe=a128_0x4b7c;return _0x1bff64[_0x3caefe(0x1e6)]===_0xe052ac&&typeof _0x1bff64[_0x3caefe(0x1ea)]==='number'&&_0x4962de-_0x1bff64['lastNotifiedAt']<UPDATE_NOTICE_TTL_MS;}async function fetchNpmDistTags(_0x4dd471=0x5dc){const _0x536eac=a128_0x4b7c;try{const _0x2ef90e=NPM_REGISTRY_BASE_URL+_0x536eac(0x1f4)+encodeURIComponent(LOVRABET_NPM_PACKAGE_NAME)+_0x536eac(0x1f6),_0x3d04cb=await fetch(_0x2ef90e,{'signal':AbortSignal[_0x536eac(0x1f3)](_0x4dd471)});if(!_0x3d04cb['ok'])return null;const _0x38dbf9=await _0x3d04cb['json']();if(!_0x38dbf9||typeof _0x38dbf9!==_0x536eac(0x1f2))return null;return Object['fromEntries'](Object[_0x536eac(0x1fd)](_0x38dbf9)[_0x536eac(0x1e2)](([,_0x495cf8])=>typeof _0x495cf8===_0x536eac(0x1e8)&&_0x495cf8[_0x536eac(0x1fb)]())[_0x536eac(0x1f8)](([_0x1b3916,_0x260a02])=>[_0x1b3916,String(_0x260a02)['trim']()]));}catch{return null;}}export function buildNpmVersionUrl(_0x4aff97){const _0x54a67=a128_0x4b7c;return _0x54a67(0x1eb)+LOVRABET_NPM_PACKAGE_NAME+'/v/'+_0x4aff97;}export async function resolveLatestUpdateNotice(){const _0x5eca43=a128_0x4b7c;if(isUpdateNoticeDisabled())return null;try{const _0x4ca4d0=Date[_0x5eca43(0x1df)](),_0x394ec9=getCliVersion(),_0xc2de73=await readUpdateNoticeCache();let _0x571d33=isFreshCheck(_0xc2de73,_0x4ca4d0)?_0xc2de73[_0x5eca43(0x1ff)]?.[_0x5eca43(0x1fb)]():undefined;if(!_0x571d33&&!isFreshCheck(_0xc2de73,_0x4ca4d0)){const _0x1b33cc=await fetchNpmDistTags();_0x571d33=_0x1b33cc?.[_0x5eca43(0x1ff)]?.[_0x5eca43(0x1fb)](),await writeUpdateNoticeCache({..._0xc2de73,'checkedAt':_0x4ca4d0,'latest':_0x571d33,'failed':!_0x571d33});}if(!_0x571d33||compareSemver(_0x394ec9,_0x571d33)>=0x0)return null;if(isRecentlyNotified(_0xc2de73,_0x571d33,_0x4ca4d0))return null;const _0x3c443e=CLI_BIN_NAME+'\x20update';return await writeUpdateNoticeCache({..._0xc2de73,'checkedAt':isFreshCheck(_0xc2de73,_0x4ca4d0)?_0xc2de73['checkedAt']:_0x4ca4d0,'latest':_0x571d33,'failed':![],'lastNotifiedVersion':_0x571d33,'lastNotifiedAt':_0x4ca4d0}),{'command':_0x3c443e,'current':_0x394ec9,'latest':_0x571d33,'url':buildNpmVersionUrl(_0x571d33),'message':CLI_BIN_NAME+'\x20'+_0x571d33+_0x5eca43(0x1e4)+_0x394ec9+_0x5eca43(0x1e5)+_0x3c443e};}catch{return null;}}
|