@lovrabet/lovrabet-cli 2.3.1-beta.3 → 2.3.1-beta.4
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/init.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/notification/config-list.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/permit/dataset-get.js +1 -1
- package/lib/commands/permit/dataset-set.js +1 -1
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.js +1 -1
- package/lib/commands/personal-bff/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.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/user-account/bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/config/domain-config.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.d.ts +3 -3
- 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/region.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.d.ts +0 -16
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/kb-search-client.d.ts +30 -0
- package/lib/core/kb-search-client.js +1 -0
- 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 +2 -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/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- 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/builtin-skill.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/skills/skill-presence.js +1 -1
- package/lib/utils/access-key-redaction.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.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
- package/skills/lovrabet/SKILL.md +2 -2
- package/skills/lovrabet/references/lovrabet-config-commands.md +3 -1
- package/skills/lovrabet/references/lovrabet-config.md +2 -2
- package/skills/lovrabet/references/lovrabet-doctor.md +2 -0
- package/skills/lovrabet/references/lovrabet-kb-workflow.md +3 -1
- package/skills/lovrabet.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x35ae23,_0x5a38b6){const _0x1e5e0d=a143_0x12c9,_0x154a70=_0x35ae23();while(!![]){try{const _0x2ffa4f=parseInt(_0x1e5e0d(0xfc))/0x1*(-parseInt(_0x1e5e0d(0x133))/0x2)+parseInt(_0x1e5e0d(0x101))/0x3+parseInt(_0x1e5e0d(0x12f))/0x4+-parseInt(_0x1e5e0d(0x130))/0x5+parseInt(_0x1e5e0d(0x125))/0x6*(-parseInt(_0x1e5e0d(0x12e))/0x7)+parseInt(_0x1e5e0d(0x10d))/0x8*(-parseInt(_0x1e5e0d(0x10b))/0x9)+parseInt(_0x1e5e0d(0x109))/0xa;if(_0x2ffa4f===_0x5a38b6)break;else _0x154a70['push'](_0x154a70['shift']());}catch(_0x1f1c06){_0x154a70['push'](_0x154a70['shift']());}}}(a143_0x45cf,0x8ebaf));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';import{bufferSha256,contentHash,fileHash}from'./hashing.js';import{fileContent,fileText,normalizeLocalFiles}from'./local-files.js';import{buildMetadata,readMetadataIfPresent,requireSkillCode}from'./metadata.js';function a143_0x45cf(){const _0x3850a9=['keys','utf8','1157556qkbJUP','trim','Managed\x20file\x20was\x20removed\x20locally:\x20','delete','has','example','Runtime\x20Skill\x20package\x20is\x20missing\x20','force','28569590gVnJOt','match','27JzqIBo','hasOwn','1180072RNPNki','contents','name','env','isFile','entries','scope','.\x20Changed\x20file:\x20','test','accessKey','fileHashes','description:\x20','skillCode','contentHash','paths','map','appCode','description','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','slice','Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20','pulledAt','trimEnd','set','12756QIjnMD','find','length','skillName','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','schemaVersion','filter','validation','name:\x20','3794WXSbwx','1648112CrWKHU','2768775kaqnII','displayName','status','614428nzkPKj','Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','join','path','---','flow','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','3JXjhyB','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.','version'];a143_0x45cf=function(){return _0x3850a9;};return a143_0x45cf();}import{getRuntimeSkillDir}from'./paths.js';function a143_0x12c9(_0x4f5332,_0x386b4c){_0x4f5332=_0x4f5332-0xfc;const _0x45cfe8=a143_0x45cf();let _0x12c987=_0x45cfe8[_0x4f5332];return _0x12c987;}import{extractDownloadedPackage,requirePackageBytes}from'./zip-package.js';export function materializeRuntimeSkill(_0x4680cf,_0x295e04,_0x57f65a){const _0x5ad887=a143_0x12c9,_0xe53b79=requireSkillCode(_0x4680cf),_0x35487f=requirePackageBytes(_0xe53b79,_0x57f65a['packageBytes']),_0x144ff3=extractDownloadedPackage(_0x35487f),_0x36ed0d=_0x144ff3[_0x5ad887(0x126)](_0x39750d=>_0x39750d[_0x5ad887(0x137)]===SKILL_FILE);if(!_0x36ed0d)throw CliErrors['validation'](_0x5ad887(0x107)+SKILL_FILE+':\x20'+_0xe53b79);const _0x140cbb=withMaterializedSkillFrontmatter(_0x144ff3,_0x4680cf,_0xe53b79),_0x5054b0=_0x140cbb[_0x5ad887(0x126)](_0x3b6609=>_0x3b6609[_0x5ad887(0x137)]===SKILL_FILE),_0x343c5e=fileText(_0x5054b0),_0x142824=getRuntimeSkillDir(_0x57f65a[_0x5ad887(0x110)],_0x57f65a[_0x5ad887(0x116)],_0x57f65a['appCode'],_0x295e04,_0xe53b79,_0x57f65a[_0x5ad887(0x11b)]),_0x2bc7e1=resolve(_0x142824,SKILL_FILE),_0x310cea=resolve(_0x142824,METADATA_FILE),_0x3a9c14=contentHash(_0x343c5e),_0x57df71=readMetadataIfPresent(_0x310cea)?.[_0x5ad887(0x117)];ensurePulledFilesCanBeOverwritten(_0x142824,_0x310cea,_0x140cbb,_0x57f65a[_0x5ad887(0x108)]===!![]),mkdirSync(_0x142824,{'recursive':!![],'mode':0x1c0});const _0x6bac47=existsSync(_0x2bc7e1)?readFileSync(_0x2bc7e1,'utf8'):undefined;return materializeFiles(_0x142824,_0x140cbb),removeStaleManagedFiles(_0x142824,_0x57df71,_0x140cbb),writeJsonAtomic(_0x310cea,buildMetadata(_0x4680cf,_0x295e04,_0x57f65a[_0x5ad887(0x11d)],_0x3a9c14,_0x57f65a[_0x5ad887(0x122)],_0x140cbb,_0x35487f)),{'skill':_0x4680cf,'scope':_0x295e04,'dir':_0x142824,'skillMdPath':_0x2bc7e1,'metadataPath':_0x310cea,'contentHash':_0x3a9c14,'changed':_0x6bac47!==_0x343c5e};}export function reuseMaterializedRuntimeSkill(_0x5a6f36,_0x484349,_0xb4224e){const _0x1653b8=a143_0x12c9,_0x22a4ca=_0x5a6f36[_0x1653b8(0xfe)]?.[_0x1653b8(0x102)]();if(!_0x22a4ca)return undefined;const _0x3a84c0=requireSkillCode(_0x5a6f36),_0x4a3975=getRuntimeSkillDir(_0xb4224e[_0x1653b8(0x110)],_0xb4224e[_0x1653b8(0x116)],_0xb4224e[_0x1653b8(0x11d)],_0x484349,_0x3a84c0,_0xb4224e[_0x1653b8(0x11b)]),_0x435108=resolve(_0x4a3975,SKILL_FILE),_0x12737f=resolve(_0x4a3975,METADATA_FILE),_0x29d565=readMetadataIfPresent(_0x12737f);if(!_0x29d565||_0x29d565[_0x1653b8(0x12a)]!==0x2||_0x29d565[_0x1653b8(0x11d)]!==_0xb4224e[_0x1653b8(0x11d)]||_0x29d565[_0x1653b8(0x113)]!==_0x484349||_0x29d565[_0x1653b8(0x119)]!==_0x3a84c0||_0x29d565['version']!==_0x22a4ca||_0x29d565['id']!==_0x5a6f36['id']||_0x29d565['skillName']!==_0x5a6f36['skillName']||_0x29d565['description']!==_0x5a6f36[_0x1653b8(0x11e)]||_0x29d565['example']!==_0x5a6f36[_0x1653b8(0x106)]||_0x29d565[_0x1653b8(0x132)]!==_0x5a6f36[_0x1653b8(0x132)]||!_0x29d565[_0x1653b8(0x11a)]||!_0x29d565[_0x1653b8(0x117)]||!Object[_0x1653b8(0x10c)](_0x29d565['fileHashes'],SKILL_FILE))return undefined;for(const [_0x1aa102,_0x5f25a6]of Object[_0x1653b8(0x112)](_0x29d565[_0x1653b8(0x117)])){if(!/^[a-f0-9]{64}$/['test'](_0x5f25a6))return undefined;const _0x44b683=resolveManagedFilePath(_0x4a3975,_0x1aa102);if(!existsSync(_0x44b683)||!lstatSync(_0x44b683)[_0x1653b8(0x111)]())return undefined;if(bufferSha256(readFileSync(_0x44b683))!==_0x5f25a6)return undefined;}return{'skill':_0x5a6f36,'scope':_0x484349,'dir':_0x4a3975,'skillMdPath':_0x435108,'metadataPath':_0x12737f,'contentHash':_0x29d565['contentHash'],'changed':![]};}function withMaterializedSkillFrontmatter(_0x47ca05,_0x1fdead,_0x5e53e3){const _0x56696e=a143_0x12c9,_0x476a9f=skillDisplayName(_0x1fdead,_0x5e53e3),_0x394e58=_0x1fdead['description']?.['trim']()||_0x476a9f||_0x5e53e3;return normalizeLocalFiles(_0x47ca05)[_0x56696e(0x11c)](_0x56bf3d=>{const _0x40a72c=_0x56696e,_0x3dbc34=fileText(_0x56bf3d);if(_0x56bf3d[_0x40a72c(0x137)]!==SKILL_FILE)return _0x56bf3d;if(hasYamlFrontmatter(_0x3dbc34))return{'path':_0x56bf3d['path'],'content':withSyncedDisplayName(_0x3dbc34,_0x476a9f)};return{'path':_0x56bf3d[_0x40a72c(0x137)],'content':prependSkillFrontmatter(_0x3dbc34,{'name':_0x5e53e3,'displayName':_0x476a9f,'description':_0x394e58})};});}function hasYamlFrontmatter(_0x54a956){const _0x44ca2b=a143_0x12c9;return/^\uFEFF?---\s*\r?\n/[_0x44ca2b(0x115)](_0x54a956);}function prependSkillFrontmatter(_0x4d8ac7,_0x129607){const _0x29720e=a143_0x12c9,_0x4ed92c=_0x4d8ac7['replace'](/^\uFEFF/,'');return[_0x29720e(0x138),_0x29720e(0x12d)+yamlString(_0x129607[_0x29720e(0x10f)]),_0x129607[_0x29720e(0x131)]?'displayName:\x20'+yamlString(_0x129607['displayName']):undefined,_0x29720e(0x118)+yamlString(_0x129607['description']),_0x29720e(0x138),'',_0x4ed92c][_0x29720e(0x12b)](_0x4ef373=>_0x4ef373!==undefined)[_0x29720e(0x136)]('\x0a');}function yamlString(_0x1dd621){const _0x46dfdf=a143_0x12c9;return JSON['stringify'](_0x1dd621['replace'](/\r/g,'')[_0x46dfdf(0x102)]());}function skillDisplayName(_0x2bbba5,_0x1acf47){const _0x4fa560=a143_0x12c9,_0xe18513=_0x2bbba5[_0x4fa560(0x128)]?.[_0x4fa560(0x102)]();return _0xe18513||_0x1acf47;}function withSyncedDisplayName(_0x41bf2e,_0x1469b2){const _0x4f36ed=a143_0x12c9,_0x33cd55=_0x41bf2e[_0x4f36ed(0x10a)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x33cd55)return _0x41bf2e;const _0x14bc87=_0x33cd55[0x1]??'',_0x42fdf8=_0x33cd55[0x2]??'',_0x581f80=parseDocument(_0x42fdf8);if(_0x581f80['errors'][_0x4f36ed(0x127)]>0x0||!isMap(_0x581f80['contents']))return _0x41bf2e;if(_0x1469b2)_0x581f80[_0x4f36ed(0x124)]('displayName',_0x1469b2);else{if(_0x581f80[_0x4f36ed(0x105)](_0x4f36ed(0x131)))_0x581f80[_0x4f36ed(0x104)](_0x4f36ed(0x131));else return _0x41bf2e;}forceBlockCollections(_0x581f80[_0x4f36ed(0x10e)]);const _0x5df537=_0x581f80['toString']({'lineWidth':0x0})[_0x4f36ed(0x123)](),_0x418f51=_0x41bf2e[_0x4f36ed(0x120)](_0x33cd55[0x0][_0x4f36ed(0x127)])['replace'](/^\r?\n/,'');return _0x14bc87+'---\x0a'+_0x5df537+'\x0a---\x0a\x0a'+_0x418f51;}function forceBlockCollections(_0x376a4b){if(!isNode(_0x376a4b))return;visit(_0x376a4b,(_0x87dbbf,_0x3d20cf)=>{const _0x495d89=a143_0x12c9;isCollection(_0x3d20cf)&&(_0x3d20cf[_0x495d89(0x139)]=![]);});}function ensurePulledFilesCanBeOverwritten(_0x123890,_0x54871d,_0x5b9080,_0x402afb){const _0x150655=a143_0x12c9;if(_0x402afb||!existsSync(_0x54871d))return;const _0x404007=readMetadataIfPresent(_0x54871d);if(!_0x404007)return;const _0xce488d=_0x404007['fileHashes']&&Object['keys'](_0x404007[_0x150655(0x117)])[_0x150655(0x127)]>0x0?_0x404007[_0x150655(0x117)]:undefined;if(_0xce488d)for(const [_0x1c431b,_0x49e4fc]of Object[_0x150655(0x112)](_0xce488d)){const _0x3de1c0=resolveManagedFilePath(_0x123890,_0x1c431b);if(!existsSync(_0x3de1c0))throw CliErrors[_0x150655(0x12c)](_0x150655(0x13a)+_0x123890,_0x150655(0x103)+_0x1c431b);const _0x2eea58=lstatSync(_0x3de1c0);if(!_0x2eea58[_0x150655(0x111)]())throw CliErrors['validation'](_0x150655(0x13a)+_0x123890,_0x150655(0x121)+_0x1c431b);const _0xc087d7=bufferSha256(readFileSync(_0x3de1c0));if(_0xc087d7!==_0x49e4fc)throw CliErrors[_0x150655(0x12c)](_0x150655(0x13a)+_0x123890+_0x150655(0x114)+_0x1c431b,_0x150655(0x129)+_0x1c431b);}else{const _0x282277=resolve(_0x123890,SKILL_FILE);if(existsSync(_0x282277)&&_0x404007[_0x150655(0x11a)]){const _0x2c21f4=contentHash(readFileSync(_0x282277,_0x150655(0x100)));if(_0x2c21f4!==_0x404007[_0x150655(0x11a)])throw CliErrors[_0x150655(0x12c)](_0x150655(0x11f)+_0x282277,_0x150655(0xfd));}}for(const _0xfdeec1 of normalizeLocalFiles(_0x5b9080)){if(_0xce488d?.[_0xfdeec1[_0x150655(0x137)]])continue;if(!_0xce488d&&_0xfdeec1[_0x150655(0x137)]===SKILL_FILE)continue;const _0x2030ab=resolveManagedFilePath(_0x123890,_0xfdeec1[_0x150655(0x137)]);if(!existsSync(_0x2030ab))continue;const _0x583988=lstatSync(_0x2030ab);if(!_0x583988[_0x150655(0x111)]())throw CliErrors[_0x150655(0x12c)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x123890,_0x150655(0x135)+_0xfdeec1[_0x150655(0x137)]);const _0x550216=bufferSha256(readFileSync(_0x2030ab));if(_0x550216!==fileHash(_0xfdeec1))throw CliErrors['validation'](_0x150655(0x13a)+_0x123890,_0x150655(0x134)+_0xfdeec1[_0x150655(0x137)]);}}function materializeFiles(_0x519351,_0x12f63d){const _0x50ef09=a143_0x12c9;for(const _0x5da510 of normalizeLocalFiles(_0x12f63d)){const _0x4bab81=resolveManagedFilePath(_0x519351,_0x5da510[_0x50ef09(0x137)]);mkdirSync(dirname(_0x4bab81),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x4bab81,fileContent(_0x5da510),0x180);}}function removeStaleManagedFiles(_0x569926,_0xd64cfd,_0x395de7){const _0x12bad5=a143_0x12c9;if(!_0xd64cfd)return;const _0x42cc7d=new Set(normalizeLocalFiles(_0x395de7)[_0x12bad5(0x11c)](_0x5681a9=>_0x5681a9[_0x12bad5(0x137)]));for(const _0x35a364 of Object[_0x12bad5(0xff)](_0xd64cfd)){if(_0x42cc7d[_0x12bad5(0x105)](_0x35a364))continue;const _0x314317=resolveManagedFilePath(_0x569926,_0x35a364);existsSync(_0x314317)&&lstatSync(_0x314317)['isFile']()&&rmSync(_0x314317,{'force':!![]});}}
|
|
1
|
+
(function(_0x480f84,_0x3804fe){const _0x1c77d0=a144_0x25da,_0x2ba737=_0x480f84();while(!![]){try{const _0x58660f=parseInt(_0x1c77d0(0x1c1))/0x1+parseInt(_0x1c77d0(0x1dd))/0x2+parseInt(_0x1c77d0(0x1a9))/0x3+parseInt(_0x1c77d0(0x1bf))/0x4*(parseInt(_0x1c77d0(0x1bb))/0x5)+-parseInt(_0x1c77d0(0x1af))/0x6+-parseInt(_0x1c77d0(0x1d1))/0x7+-parseInt(_0x1c77d0(0x1c6))/0x8;if(_0x58660f===_0x3804fe)break;else _0x2ba737['push'](_0x2ba737['shift']());}catch(_0x6cc6e5){_0x2ba737['push'](_0x2ba737['shift']());}}}(a144_0x3488,0x6294c));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';import{bufferSha256,contentHash,fileHash}from'./hashing.js';function a144_0x3488(){const _0x3e7dfc=['slice','replace','schemaVersion','1205050rYNkNp','skillName','1576755oNkySB','isFile','accessKey','delete','filter','appCode','1961304XjhOvJ','Runtime\x20Skill\x20package\x20is\x20missing\x20','scope','match','entries','status','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.','map','pulledAt','trimEnd','fileHashes','path','5MQmJwD','hasOwn','utf8','---','2089484WuWqfX','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','110372rwUwTt','errors','paths','version','set','2892024zCAXUc','packageBytes','example','---\x0a','displayName','trim','keys','validation','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','test','contentHash','4680746LvtkNr','skillCode','length','contents','env','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','description','force','find'];a144_0x3488=function(){return _0x3e7dfc;};return a144_0x3488();}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(_0x199a9c,_0x55d4e8,_0xca856){const _0x4bbd13=a144_0x25da,_0x32ce15=requireSkillCode(_0x199a9c),_0x4364d0=requirePackageBytes(_0x32ce15,_0xca856[_0x4bbd13(0x1c7)]),_0x3e691c=extractDownloadedPackage(_0x4364d0),_0x59fa04=_0x3e691c[_0x4bbd13(0x1d9)](_0x1d7d8a=>_0x1d7d8a['path']===SKILL_FILE);if(!_0x59fa04)throw CliErrors[_0x4bbd13(0x1cd)](_0x4bbd13(0x1b0)+SKILL_FILE+':\x20'+_0x32ce15);const _0x130247=withMaterializedSkillFrontmatter(_0x3e691c,_0x199a9c,_0x32ce15),_0x3a0f7e=_0x130247[_0x4bbd13(0x1d9)](_0x48fce0=>_0x48fce0[_0x4bbd13(0x1ba)]===SKILL_FILE),_0x307677=fileText(_0x3a0f7e),_0x124ba1=getRuntimeSkillDir(_0xca856[_0x4bbd13(0x1d5)],_0xca856[_0x4bbd13(0x1ab)],_0xca856[_0x4bbd13(0x1ae)],_0x55d4e8,_0x32ce15,_0xca856[_0x4bbd13(0x1c3)]),_0x5a3514=resolve(_0x124ba1,SKILL_FILE),_0x4bbf2e=resolve(_0x124ba1,METADATA_FILE),_0x1cb5ca=contentHash(_0x307677),_0x4e0160=readMetadataIfPresent(_0x4bbf2e)?.[_0x4bbd13(0x1b9)];ensurePulledFilesCanBeOverwritten(_0x124ba1,_0x4bbf2e,_0x130247,_0xca856[_0x4bbd13(0x1d8)]===!![]),mkdirSync(_0x124ba1,{'recursive':!![],'mode':0x1c0});const _0x4a9f42=existsSync(_0x5a3514)?readFileSync(_0x5a3514,_0x4bbd13(0x1bd)):undefined;return materializeFiles(_0x124ba1,_0x130247),removeStaleManagedFiles(_0x124ba1,_0x4e0160,_0x130247),writeJsonAtomic(_0x4bbf2e,buildMetadata(_0x199a9c,_0x55d4e8,_0xca856[_0x4bbd13(0x1ae)],_0x1cb5ca,_0xca856[_0x4bbd13(0x1b7)],_0x130247,_0x4364d0)),{'skill':_0x199a9c,'scope':_0x55d4e8,'dir':_0x124ba1,'skillMdPath':_0x5a3514,'metadataPath':_0x4bbf2e,'contentHash':_0x1cb5ca,'changed':_0x4a9f42!==_0x307677};}export function reuseMaterializedRuntimeSkill(_0x5b1ded,_0xc6d1d8,_0x164dfb){const _0x573236=a144_0x25da,_0x200a1b=_0x5b1ded['version']?.[_0x573236(0x1cb)]();if(!_0x200a1b)return undefined;const _0x3e2b35=requireSkillCode(_0x5b1ded),_0x2d8459=getRuntimeSkillDir(_0x164dfb[_0x573236(0x1d5)],_0x164dfb[_0x573236(0x1ab)],_0x164dfb[_0x573236(0x1ae)],_0xc6d1d8,_0x3e2b35,_0x164dfb[_0x573236(0x1c3)]),_0x4e6257=resolve(_0x2d8459,SKILL_FILE),_0x1f4703=resolve(_0x2d8459,METADATA_FILE),_0x2fc950=readMetadataIfPresent(_0x1f4703);if(!_0x2fc950||_0x2fc950[_0x573236(0x1dc)]!==0x2||_0x2fc950['appCode']!==_0x164dfb['appCode']||_0x2fc950[_0x573236(0x1b1)]!==_0xc6d1d8||_0x2fc950[_0x573236(0x1d2)]!==_0x3e2b35||_0x2fc950[_0x573236(0x1c4)]!==_0x200a1b||_0x2fc950['id']!==_0x5b1ded['id']||_0x2fc950['skillName']!==_0x5b1ded[_0x573236(0x1de)]||_0x2fc950['description']!==_0x5b1ded[_0x573236(0x1d7)]||_0x2fc950[_0x573236(0x1c8)]!==_0x5b1ded[_0x573236(0x1c8)]||_0x2fc950['status']!==_0x5b1ded[_0x573236(0x1b4)]||!_0x2fc950[_0x573236(0x1d0)]||!_0x2fc950[_0x573236(0x1b9)]||!Object[_0x573236(0x1bc)](_0x2fc950[_0x573236(0x1b9)],SKILL_FILE))return undefined;for(const [_0x52dff8,_0x20ef6c]of Object[_0x573236(0x1b3)](_0x2fc950[_0x573236(0x1b9)])){if(!/^[a-f0-9]{64}$/[_0x573236(0x1cf)](_0x20ef6c))return undefined;const _0x2a591d=resolveManagedFilePath(_0x2d8459,_0x52dff8);if(!existsSync(_0x2a591d)||!lstatSync(_0x2a591d)[_0x573236(0x1aa)]())return undefined;if(bufferSha256(readFileSync(_0x2a591d))!==_0x20ef6c)return undefined;}return{'skill':_0x5b1ded,'scope':_0xc6d1d8,'dir':_0x2d8459,'skillMdPath':_0x4e6257,'metadataPath':_0x1f4703,'contentHash':_0x2fc950['contentHash'],'changed':![]};}function withMaterializedSkillFrontmatter(_0x5b086f,_0x513931,_0x559c53){const _0x57214e=a144_0x25da,_0x1367f1=skillDisplayName(_0x513931,_0x559c53),_0x2c429b=_0x513931[_0x57214e(0x1d7)]?.[_0x57214e(0x1cb)]()||_0x1367f1||_0x559c53;return normalizeLocalFiles(_0x5b086f)[_0x57214e(0x1b6)](_0x233bbe=>{const _0x4a46d=_0x57214e,_0x3cfdde=fileText(_0x233bbe);if(_0x233bbe[_0x4a46d(0x1ba)]!==SKILL_FILE)return _0x233bbe;if(hasYamlFrontmatter(_0x3cfdde))return{'path':_0x233bbe['path'],'content':withSyncedDisplayName(_0x3cfdde,_0x1367f1)};return{'path':_0x233bbe[_0x4a46d(0x1ba)],'content':prependSkillFrontmatter(_0x3cfdde,{'name':_0x559c53,'displayName':_0x1367f1,'description':_0x2c429b})};});}function hasYamlFrontmatter(_0xbf28fc){const _0x128b17=a144_0x25da;return/^\uFEFF?---\s*\r?\n/[_0x128b17(0x1cf)](_0xbf28fc);}function prependSkillFrontmatter(_0x599ebb,_0x2fdd5d){const _0x4bfcb7=a144_0x25da,_0x55baef=_0x599ebb[_0x4bfcb7(0x1db)](/^\uFEFF/,'');return[_0x4bfcb7(0x1be),'name:\x20'+yamlString(_0x2fdd5d['name']),_0x2fdd5d[_0x4bfcb7(0x1ca)]?'displayName:\x20'+yamlString(_0x2fdd5d['displayName']):undefined,'description:\x20'+yamlString(_0x2fdd5d[_0x4bfcb7(0x1d7)]),_0x4bfcb7(0x1be),'',_0x55baef][_0x4bfcb7(0x1ad)](_0x5e5ae3=>_0x5e5ae3!==undefined)['join']('\x0a');}function yamlString(_0x57c58d){const _0x5f215e=a144_0x25da;return JSON['stringify'](_0x57c58d[_0x5f215e(0x1db)](/\r/g,'')[_0x5f215e(0x1cb)]());}function skillDisplayName(_0x272283,_0x4fa5c5){const _0x3ab7a3=a144_0x25da,_0x5ab28c=_0x272283[_0x3ab7a3(0x1de)]?.[_0x3ab7a3(0x1cb)]();return _0x5ab28c||_0x4fa5c5;}function withSyncedDisplayName(_0x145290,_0x461997){const _0x495720=a144_0x25da,_0x1eceee=_0x145290[_0x495720(0x1b2)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x1eceee)return _0x145290;const _0x417857=_0x1eceee[0x1]??'',_0x53b203=_0x1eceee[0x2]??'',_0x16cf54=parseDocument(_0x53b203);if(_0x16cf54[_0x495720(0x1c2)][_0x495720(0x1d3)]>0x0||!isMap(_0x16cf54[_0x495720(0x1d4)]))return _0x145290;if(_0x461997)_0x16cf54[_0x495720(0x1c5)]('displayName',_0x461997);else{if(_0x16cf54['has']('displayName'))_0x16cf54[_0x495720(0x1ac)]('displayName');else return _0x145290;}forceBlockCollections(_0x16cf54[_0x495720(0x1d4)]);const _0x527f84=_0x16cf54['toString']({'lineWidth':0x0})[_0x495720(0x1b8)](),_0xfe402b=_0x145290[_0x495720(0x1da)](_0x1eceee[0x0]['length'])[_0x495720(0x1db)](/^\r?\n/,'');return _0x417857+_0x495720(0x1c9)+_0x527f84+'\x0a---\x0a\x0a'+_0xfe402b;}function forceBlockCollections(_0x5cec32){if(!isNode(_0x5cec32))return;visit(_0x5cec32,(_0x5f2889,_0x915190)=>{isCollection(_0x915190)&&(_0x915190['flow']=![]);});}function ensurePulledFilesCanBeOverwritten(_0x18c998,_0xade225,_0xe68576,_0x16266c){const _0x23e751=a144_0x25da;if(_0x16266c||!existsSync(_0xade225))return;const _0x4ca790=readMetadataIfPresent(_0xade225);if(!_0x4ca790)return;const _0x14e08c=_0x4ca790[_0x23e751(0x1b9)]&&Object[_0x23e751(0x1cc)](_0x4ca790[_0x23e751(0x1b9)])['length']>0x0?_0x4ca790['fileHashes']:undefined;if(_0x14e08c)for(const [_0x1c4e04,_0x2d134f]of Object[_0x23e751(0x1b3)](_0x14e08c)){const _0x304f15=resolveManagedFilePath(_0x18c998,_0x1c4e04);if(!existsSync(_0x304f15))throw CliErrors[_0x23e751(0x1cd)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x18c998,'Managed\x20file\x20was\x20removed\x20locally:\x20'+_0x1c4e04);const _0xfbf214=lstatSync(_0x304f15);if(!_0xfbf214[_0x23e751(0x1aa)]())throw CliErrors['validation'](_0x23e751(0x1d6)+_0x18c998,'Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20'+_0x1c4e04);const _0x4ba7d4=bufferSha256(readFileSync(_0x304f15));if(_0x4ba7d4!==_0x2d134f)throw CliErrors[_0x23e751(0x1cd)](_0x23e751(0x1d6)+_0x18c998+'.\x20Changed\x20file:\x20'+_0x1c4e04,'Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20'+_0x1c4e04);}else{const _0x39462a=resolve(_0x18c998,SKILL_FILE);if(existsSync(_0x39462a)&&_0x4ca790[_0x23e751(0x1d0)]){const _0x1ae161=contentHash(readFileSync(_0x39462a,_0x23e751(0x1bd)));if(_0x1ae161!==_0x4ca790[_0x23e751(0x1d0)])throw CliErrors[_0x23e751(0x1cd)](_0x23e751(0x1ce)+_0x39462a,_0x23e751(0x1b5));}}for(const _0x352003 of normalizeLocalFiles(_0xe68576)){if(_0x14e08c?.[_0x352003[_0x23e751(0x1ba)]])continue;if(!_0x14e08c&&_0x352003['path']===SKILL_FILE)continue;const _0x5eee2b=resolveManagedFilePath(_0x18c998,_0x352003[_0x23e751(0x1ba)]);if(!existsSync(_0x5eee2b))continue;const _0x5ea796=lstatSync(_0x5eee2b);if(!_0x5ea796[_0x23e751(0x1aa)]())throw CliErrors['validation']('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x18c998,_0x23e751(0x1c0)+_0x352003[_0x23e751(0x1ba)]);const _0x5d133f=bufferSha256(readFileSync(_0x5eee2b));if(_0x5d133f!==fileHash(_0x352003))throw CliErrors['validation'](_0x23e751(0x1d6)+_0x18c998,'Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20'+_0x352003[_0x23e751(0x1ba)]);}}function a144_0x25da(_0x352e51,_0x10d170){_0x352e51=_0x352e51-0x1a9;const _0x3488de=a144_0x3488();let _0x25daa4=_0x3488de[_0x352e51];return _0x25daa4;}function materializeFiles(_0x46c71e,_0x53610c){for(const _0x1e26bf of normalizeLocalFiles(_0x53610c)){const _0x5ab628=resolveManagedFilePath(_0x46c71e,_0x1e26bf['path']);mkdirSync(dirname(_0x5ab628),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x5ab628,fileContent(_0x1e26bf),0x180);}}function removeStaleManagedFiles(_0x56ec01,_0x56a97c,_0x214b85){const _0x153ac=a144_0x25da;if(!_0x56a97c)return;const _0x2ecb9c=new Set(normalizeLocalFiles(_0x214b85)[_0x153ac(0x1b6)](_0x202f31=>_0x202f31['path']));for(const _0x475c54 of Object['keys'](_0x56a97c)){if(_0x2ecb9c['has'](_0x475c54))continue;const _0x3a30d8=resolveManagedFilePath(_0x56ec01,_0x475c54);existsSync(_0x3a30d8)&&lstatSync(_0x3a30d8)[_0x153ac(0x1aa)]()&&rmSync(_0x3a30d8,{'force':!![]});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4f6754,_0x115773){const _0x1502c5=a145_0x3c6a,_0x5782ec=_0x4f6754();while(!![]){try{const _0x8cde3=parseInt(_0x1502c5(0x9e))/0x1*(parseInt(_0x1502c5(0xa6))/0x2)+-parseInt(_0x1502c5(0xac))/0x3*(-parseInt(_0x1502c5(0xc3))/0x4)+-parseInt(_0x1502c5(0xa0))/0x5+parseInt(_0x1502c5(0xc2))/0x6+parseInt(_0x1502c5(0xb5))/0x7+-parseInt(_0x1502c5(0xa1))/0x8+-parseInt(_0x1502c5(0xb1))/0x9*(-parseInt(_0x1502c5(0xb9))/0xa);if(_0x8cde3===_0x115773)break;else _0x5782ec['push'](_0x5782ec['shift']());}catch(_0x50beb6){_0x5782ec['push'](_0x5782ec['shift']());}}}(a145_0xa6ad,0x7f239));import{existsSync,readFileSync}from'node:fs';import{CliErrors}from'../../errors.js';function a145_0x3c6a(_0x1b5fce,_0x3fd337){_0x1b5fce=_0x1b5fce-0x9d;const _0xa6adf6=a145_0xa6ad();let _0x3c6a4f=_0xa6adf6[_0x1b5fce];return _0x3c6a4f;}function a145_0xa6ad(){const _0x271eb8=['forkedFromVersion','tags','manifest','trim','10890ULpbEH','status','ossPath','description','2604238WTlXmk','parse','toISOString','path','5930HNsqBk','skillName','forkedFromSkillId','skillCode','zipSize','personal','validation','readonly','zipSha256','2456658OhdIEJ','1730284qDTIeg','map','33EYHyqb','Runtime\x20Skill\x20is\x20missing\x20skillCode.','4820725WXtzCk','3637528MfPyup','example','version','userId','length','486hyvIzU','utf8','isArray','fromEntries','tenantCode','hasUpstreamUpdate','3iWlIKf'];a145_0xa6ad=function(){return _0x271eb8;};return a145_0xa6ad();}import{METADATA_FILE}from'./constants.js';import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';import{fileContent,normalizeLocalFiles}from'./local-files.js';import{buildSkillPackage,localFilesToManifestFiles}from'./zip-package.js';export function buildMetadata(_0x1cf2a8,_0x4b2080,_0x30a112,_0x39de22,_0x3a2463,_0x33ccf9,_0x145ad6){const _0x385704=a145_0x3c6a,_0xa1a48c=_0x33ccf9?normalizeLocalFiles(_0x33ccf9):[],_0x327ba9=!_0x145ad6&&_0xa1a48c[_0x385704(0xa5)]>0x0?buildSkillPackage(_0xa1a48c):undefined,_0x5f1fdb=_0x145ad6?bufferSha256(_0x145ad6):_0x327ba9?.[_0x385704(0xaf)][_0x385704(0xc1)],_0x15d55b=_0x145ad6?.[_0x385704(0xa5)]??_0x327ba9?.[_0x385704(0xaf)][_0x385704(0xbd)],_0x3064c3=_0xa1a48c[_0x385704(0xa5)]>0x0?Object[_0x385704(0xa9)](_0xa1a48c[_0x385704(0x9d)](_0x4d329d=>[_0x4d329d[_0x385704(0xb8)],fileHash(_0x4d329d)])):undefined;return{'schemaVersion':_0xa1a48c[_0x385704(0xa5)]>0x0?0x2:0x1,'id':_0x1cf2a8['id'],'appCode':_0x30a112,'skillCode':requireSkillCode(_0x1cf2a8),'skillName':_0x1cf2a8[_0x385704(0xba)],'description':_0x1cf2a8[_0x385704(0xb4)],'example':_0x1cf2a8[_0x385704(0xa2)],'scope':_0x4b2080,'readonly':_0x4b2080!==_0x385704(0xbe)||_0x1cf2a8[_0x385704(0xc0)]===!![],'tenantCode':_0x1cf2a8[_0x385704(0xaa)],'userId':_0x1cf2a8[_0x385704(0xa4)],'version':_0x1cf2a8[_0x385704(0xa3)],'status':_0x1cf2a8[_0x385704(0xb2)],'tags':Array[_0x385704(0xa8)](_0x1cf2a8[_0x385704(0xae)])?_0x1cf2a8[_0x385704(0xae)]:[],'hasUpstreamUpdate':_0x1cf2a8[_0x385704(0xab)],'forkedFromSkillId':_0x1cf2a8[_0x385704(0xbb)],'forkedFromVersion':_0x1cf2a8[_0x385704(0xad)],'sourceSessionId':_0x1cf2a8['sourceSessionId'],'contentHash':_0x39de22,'fileHashes':_0x3064c3,'treeHash':_0xa1a48c[_0x385704(0xa5)]>0x0?fileTreeHash(localFilesToManifestFiles(_0xa1a48c)):undefined,'ossPath':remoteManifestOssPath(_0x1cf2a8['files']),'zipSha256':_0x5f1fdb,'zipSize':_0x15d55b,'files':_0xa1a48c[_0x385704(0xa5)]>0x0?_0xa1a48c[_0x385704(0x9d)](_0xc12854=>({'path':_0xc12854[_0x385704(0xb8)],'hash':fileHash(_0xc12854),'size':fileContent(_0xc12854)[_0x385704(0xa5)]})):undefined,'pulledAt':_0x3a2463??new Date()[_0x385704(0xb7)]()};}export function requireSkillCode(_0x59e667){const _0x384ae3=a145_0x3c6a,_0x5a34af=_0x59e667[_0x384ae3(0xbc)]?.[_0x384ae3(0xb0)]();if(!_0x5a34af)throw CliErrors[_0x384ae3(0xbf)](_0x384ae3(0x9f));return _0x5a34af;}export function readMetadataIfPresent(_0x232d94){const _0x54f9b2=a145_0x3c6a;if(!existsSync(_0x232d94))return undefined;try{const _0x1e1179=JSON[_0x54f9b2(0xb6)](readFileSync(_0x232d94,_0x54f9b2(0xa7)));return _0x1e1179;}catch{throw CliErrors[_0x54f9b2(0xbf)]('Invalid\x20'+METADATA_FILE+':\x20'+_0x232d94);}}function remoteManifestOssPath(_0x176acd){const _0x1fa228=a145_0x3c6a;if(!_0x176acd||typeof _0x176acd!=='object'||Array['isArray'](_0x176acd))return undefined;const _0x13f3a3=_0x176acd[_0x1fa228(0xb3)];return typeof _0x13f3a3==='string'&&_0x13f3a3[_0x1fa228(0xb0)]()?_0x13f3a3[_0x1fa228(0xb0)]():undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a146_0x3197c3=a146_0x4632;(function(_0x29c59e,_0x3cc244){const _0x6dcab9=a146_0x4632,_0x55d7b3=_0x29c59e();while(!![]){try{const _0xc35823=-parseInt(_0x6dcab9(0x111))/0x1+-parseInt(_0x6dcab9(0xfc))/0x2+parseInt(_0x6dcab9(0x10b))/0x3+-parseInt(_0x6dcab9(0xf8))/0x4+-parseInt(_0x6dcab9(0x102))/0x5+-parseInt(_0x6dcab9(0x10e))/0x6+-parseInt(_0x6dcab9(0x109))/0x7*(-parseInt(_0x6dcab9(0x100))/0x8);if(_0xc35823===_0x3cc244)break;else _0x55d7b3['push'](_0x55d7b3['shift']());}catch(_0x219858){_0x55d7b3['push'](_0x55d7b3['shift']());}}}(a146_0x50f0,0x3fe12));import{existsSync}from'node:fs';import{homedir}from'node:os';function a146_0x4632(_0x3cc49d,_0x14d48d){_0x3cc49d=_0x3cc49d-0xf5;const _0x50f076=a146_0x50f0();let _0x46326a=_0x50f076[_0x3cc49d];return _0x46326a;}import{resolve}from'node:path';import{fingerprintAccessKey}from'../../commands/app/cache.js';import{PRODUCT_CONFIG,productEnv}from'../../constant/product.js';function a146_0x50f0(){const _0x289f97=['workbuddySkillsDir','\x20for\x20local\x20path:\x20','trim','validation','path\x20segment','skills','14728TBziFE','appCode','606147qOBTFR','Unsafe\x20','.workbuddy','1582380ejcfVV','filter','CLAUDE_SKILL_ROOT','364170OnAfgU','SKILL_ROOT','skillCode','includes','503976HNaZtf','.claude','cacheRoot','claudeSkillsDir','115360sjtBRO','agentsSkillsDir','homeDirName','cache','3368TpZqyZ','.agents','73045pDRJmm'];a146_0x50f0=function(){return _0x289f97;};return a146_0x50f0();}import{CliErrors}from'../../errors.js';export function resolveSkillSyncPaths(_0x5d1527={}){const _0xc20656=a146_0x4632,_0x29d4b1=_0x5d1527['homeDir']??homedir(),_0xc2174c=resolve(_0x29d4b1,PRODUCT_CONFIG[_0xc20656(0xfe)],_0xc20656(0xff)),_0x899575=trimmedEnv(_0xc20656(0xf5)),_0x5d31f2=trimmedEnv(_0xc20656(0x110)),_0xeac17b=resolve(_0x29d4b1,_0xc20656(0x10d)),_0x28ace9=_0x5d1527[_0xc20656(0x103)]??(existsSync(_0xeac17b)?resolve(_0xeac17b,_0xc20656(0x108)):undefined);return{'homeDir':_0x29d4b1,'cacheRoot':_0xc2174c,'managedRoot':resolve(_0x29d4b1,PRODUCT_CONFIG[_0xc20656(0xfe)]),'agentsSkillsDir':_0x5d1527['agentsSkillsDir']??_0x899575??resolve(_0x29d4b1,_0xc20656(0x101),_0xc20656(0x108)),'claudeSkillsDir':_0x5d1527[_0xc20656(0xfb)]??_0x5d31f2??resolve(_0x29d4b1,_0xc20656(0xf9),_0xc20656(0x108)),'workbuddySkillsDir':_0x28ace9};}export function runtimeAgentSkillRoots(_0x2aa333){const _0x5c0aaa=a146_0x4632;return[_0x2aa333[_0x5c0aaa(0xfd)],_0x2aa333[_0x5c0aaa(0xfb)],_0x2aa333[_0x5c0aaa(0x103)]][_0x5c0aaa(0x10f)](_0x3876e8=>Boolean(_0x3876e8));}export function getRuntimeSkillCacheRoot(_0xb7b8ae,_0x2094eb,_0x548da3={}){const _0x10954a=a146_0x4632,_0x18e3e2=resolveSkillSyncPaths(_0x548da3);return resolve(_0x18e3e2[_0x10954a(0xfa)],_0xb7b8ae,fingerprintAccessKey(_0x2094eb),_0x10954a(0x108));}export function getRuntimeSkillDir(_0x18ae6f,_0x36c5db,_0x39850f,_0x4bfd9c,_0x2911a3,_0x4bc07b={}){const _0x2e517a=a146_0x4632;return resolve(getRuntimeSkillCacheRoot(_0x18ae6f,_0x36c5db,_0x4bc07b),safePathSegment(_0x39850f,_0x2e517a(0x10a)),_0x4bfd9c,safePathSegment(_0x2911a3,_0x2e517a(0xf6)));}export function safePathSegment(_0x51035f,_0xa217a5=a146_0x3197c3(0x107)){const _0x2c9379=a146_0x3197c3;if(!_0x51035f||_0x51035f[_0x2c9379(0xf7)]('/')||_0x51035f[_0x2c9379(0xf7)]('\x5c')||_0x51035f[_0x2c9379(0xf7)]('..'))throw CliErrors[_0x2c9379(0x106)](_0x2c9379(0x10c)+_0xa217a5+_0x2c9379(0x104)+_0x51035f);return _0x51035f;}function trimmedEnv(_0x38a0e){const _0x1d9295=a146_0x3197c3,_0x301f6c=productEnv(_0x38a0e)?.[_0x1d9295(0x105)]();return _0x301f6c?_0x301f6c:undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x29ba27,_0xf1f522){const _0x1e36f4=a146_0x5cd8,_0x38534b=_0x29ba27();while(!![]){try{const _0x211efb=parseInt(_0x1e36f4(0x21b))/0x1+-parseInt(_0x1e36f4(0x20f))/0x2*(-parseInt(_0x1e36f4(0x205))/0x3)+parseInt(_0x1e36f4(0x1ea))/0x4+-parseInt(_0x1e36f4(0x210))/0x5*(parseInt(_0x1e36f4(0x20b))/0x6)+parseInt(_0x1e36f4(0x1e6))/0x7+-parseInt(_0x1e36f4(0x206))/0x8+-parseInt(_0x1e36f4(0x1fa))/0x9;if(_0x211efb===_0xf1f522)break;else _0x38534b['push'](_0x38534b['shift']());}catch(_0x49a0be){_0x38534b['push'](_0x38534b['shift']());}}}(a146_0x3ece,0xa3b59));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a146_0x3c7fce}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';function a146_0x3ece(){const _0x1aabe5=['3wYFEZU','2364280neqDtX','Missing\x20','slice','isArray','appCode','18QhebkH','Invalid\x20','files','allowAppCodeRetarget','1779826oOVOJP','2094175TFERYY','\x20to\x20submit\x20company\x20Skills\x20for\x20review.','example','ignoreMetadataSkillCode','path','name','Skill\x20metadata\x20appCode\x20\x22','version','Unable\x20to\x20resolve\x20skillCode\x20from\x20','sourceSessionId','\x20has\x20scope=\x22','587502GdgCPR','skillCode','match','number','ignoreMetadataAppCodeMismatch','personal','scope','\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22','pushedAt','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20','validation','packageBase64','Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20','tags','toLowerCase','3579954tvfcsW','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20','displayName','length','3596008DZALZq','builtin','skillName','metadata','ignoreInvalidMetadata','Remote\x20Skill\x20','some','object','isDirectory','utf8','Skill\x20directory\x20not\x20found:\x20','find','string','isSymbolicLink','\x20has\x20unsupported\x20scope\x20\x22','unknown','5987214tycFiJ','excludedFilePaths','isFile','content','refreshedAt','description','ignoreMetadataForPayload','replace','\x20name\x20for\x20SkillHub\x20slug\x20generation.','company','startsWith'];a146_0x3ece=function(){return _0x1aabe5;};return a146_0x3ece();}import{buildSkillPackage,tryNormalizePackageManifest}from'./zip-package.js';export function resolvePushDirectoryIdentity(_0x4fa3c3,_0x391ed4,_0x27b709={}){const _0x41dbb3=a146_0x5cd8,_0xaa9b6f=resolvePushDirectoryRoot(_0x4fa3c3),_0x27ed92=readPushMetadataIfPresent(resolve(_0xaa9b6f,METADATA_FILE),{'ignoreInvalidMetadata':_0x27b709[_0x41dbb3(0x1ee)]});if(_0x27ed92?.['appCode']&&_0x27ed92[_0x41dbb3(0x20a)]!==_0x391ed4&&!_0x27b709[_0x41dbb3(0x20e)]&&!_0x27b709[_0x41dbb3(0x21f)])throw CliErrors[_0x41dbb3(0x225)](_0x41dbb3(0x216)+_0x27ed92['appCode']+_0x41dbb3(0x222)+_0x391ed4+'\x22.');const _0x56b5d6=resolvePushSkillCode(_0xaa9b6f,_0x391ed4,_0x27ed92,_0x27b709);if(!_0x56b5d6)throw CliErrors[_0x41dbb3(0x225)](_0x41dbb3(0x218)+SKILL_FILE+',\x20'+METADATA_FILE+',\x20or\x20directory\x20name.');return{'dir':_0xaa9b6f,'skillCode':_0x56b5d6,'metadata':_0x27ed92};}export function readPushDirectory(_0x37498d,_0x2f9a70,_0x12dcc4={}){const _0x4854ab=a146_0x5cd8,_0x3855e5=resolvePushDirectoryIdentity(_0x37498d,_0x2f9a70,_0x12dcc4),_0x37e5dc=_0x3855e5['dir'],_0x15782c=resolve(_0x37e5dc,SKILL_FILE);if(!existsSync(_0x15782c)||!lstatSync(_0x15782c)[_0x4854ab(0x1fc)]())throw CliErrors[_0x4854ab(0x225)](_0x4854ab(0x207)+SKILL_FILE+':\x20'+_0x15782c);const _0x1f9167=_0x3855e5[_0x4854ab(0x1ed)],_0x2210d6=_0x12dcc4['targetScope']??_0x4854ab(0x220);if(!_0x12dcc4['ignoreMetadataScope']&&_0x1f9167?.[_0x4854ab(0x221)]===_0x4854ab(0x1eb))throw CliErrors['validation'](_0x4854ab(0x1e3)+METADATA_FILE+_0x4854ab(0x21a)+_0x1f9167[_0x4854ab(0x221)]+'\x22.');if(!_0x12dcc4['ignoreMetadataScope']&&_0x2210d6===_0x4854ab(0x220)&&_0x1f9167?.[_0x4854ab(0x221)]&&_0x1f9167[_0x4854ab(0x221)]!==_0x4854ab(0x220))throw CliErrors['validation'](_0x4854ab(0x224)+METADATA_FILE+'\x20has\x20scope=\x22'+_0x1f9167[_0x4854ab(0x221)]+'\x22.',_0x4854ab(0x1e7)+_0x37e5dc+_0x4854ab(0x211));const _0x3ad14a=scanSkillDirectory(_0x37e5dc,{'excludedFilePaths':_0x12dcc4[_0x4854ab(0x1fb)]}),_0x13f5b1=buildSkillPackage(_0x3ad14a),_0x2a36b8=readFileSync(_0x15782c,_0x4854ab(0x1f3)),_0x23f9dd=_0x3855e5[_0x4854ab(0x21c)],_0x584283=_0x12dcc4[_0x4854ab(0x200)]?undefined:_0x1f9167,_0x2cf7ff=readSkillDisplayName(_0x2a36b8);return{'skillCode':_0x23f9dd,'metadata':_0x1f9167,'frontmatterDisplayName':_0x2cf7ff,'input':{'skillCode':_0x23f9dd,'skillName':_0x2cf7ff??_0x584283?.[_0x4854ab(0x1ec)],'description':_0x584283?.[_0x4854ab(0x1ff)],'content':_0x2a36b8,'files':_0x13f5b1['manifest'],'packageBase64':_0x13f5b1[_0x4854ab(0x226)],'tags':_0x584283?.[_0x4854ab(0x1e4)],'version':_0x584283?.[_0x4854ab(0x217)],'sourceSessionId':_0x584283?.[_0x4854ab(0x219)]}};}export function refreshPushDirectoryMetadataFromRemote(_0x56266f,_0x3b92a0,_0x41f2a0,_0x4cc3c9={}){const _0x3a34a6=a146_0x5cd8,_0x3ecb0c=resolvePushDirectoryRoot(_0x56266f),_0x487f5c=readPushMetadataIfPresent(resolve(_0x3ecb0c,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x537406=requireRemoteScope(_0x3b92a0),_0x53b4af=readLocalSkillContent(_0x3ecb0c),_0x3b512b={..._0x3b92a0,'appCode':_0x3b92a0['appCode']??_0x41f2a0,'skillName':_0x3b92a0[_0x3a34a6(0x1ec)]??_0x487f5c?.['skillName'],'description':_0x3b92a0[_0x3a34a6(0x1ff)]??_0x487f5c?.[_0x3a34a6(0x1ff)],'example':_0x3b92a0[_0x3a34a6(0x212)]??_0x487f5c?.[_0x3a34a6(0x212)],'tags':Array[_0x3a34a6(0x209)](_0x3b92a0[_0x3a34a6(0x1e4)])?_0x3b92a0[_0x3a34a6(0x1e4)]:_0x487f5c?.[_0x3a34a6(0x1e4)],'sourceSessionId':_0x3b92a0[_0x3a34a6(0x219)]??_0x487f5c?.[_0x3a34a6(0x219)],'content':_0x3b92a0[_0x3a34a6(0x1fd)]??_0x53b4af},_0x594958=buildMetadata(_0x3b512b,_0x537406,_0x41f2a0,contentHash(_0x53b4af),_0x4cc3c9[_0x3a34a6(0x1fe)]);writeJsonAtomic(resolve(_0x3ecb0c,METADATA_FILE),_0x594958);}export function recordPushedRuntimeSkill(_0x4ff9d3,_0x5f2533,_0x366666,_0xde91ce={}){const _0x5601cc=a146_0x5cd8,_0x126ed2=resolvePushDirectoryRoot(_0x4ff9d3),_0x307ead=scanSkillDirectory(_0x126ed2),_0x214e6f=_0x307ead[_0x5601cc(0x1f5)](_0x19dac0=>_0x19dac0[_0x5601cc(0x214)]===SKILL_FILE),_0x23a4e0=_0x214e6f?fileText(_0x214e6f):'',_0x3107d4=tryNormalizePackageManifest(_0x5f2533[_0x5601cc(0x20d)]),_0x3f6854={..._0x5f2533,'content':_0x5f2533[_0x5601cc(0x1fd)]??_0x23a4e0,'files':_0x3107d4},_0xb7a3b1=_0x3107d4?normalizeLocalFiles(_0x307ead)['filter'](_0x2d3a2f=>_0x3107d4['files'][_0x5601cc(0x1f0)](_0x3ced7a=>_0x3ced7a[_0x5601cc(0x214)]===_0x2d3a2f[_0x5601cc(0x214)])):undefined,_0x3c1024=buildMetadata(_0x3f6854,_0xde91ce['scope']??'personal',_0x366666,contentHash(_0x3f6854[_0x5601cc(0x1fd)]??''),_0xde91ce[_0x5601cc(0x223)],_0xb7a3b1);writeJsonAtomic(resolve(_0x126ed2,METADATA_FILE),_0x3c1024);}export function deriveSkillCodeFromDirectory(_0xa29ff1,_0x4a77fc){const _0xacef5a=a146_0x5cd8,_0x3a96d5=basename(resolve(_0xa29ff1)),_0x3cad0c=_0x4a77fc+'--';return _0x3a96d5[_0xacef5a(0x204)](_0x3cad0c)?_0x3a96d5[_0xacef5a(0x208)](_0x3cad0c[_0xacef5a(0x1e9)]):_0x3a96d5;}function a146_0x5cd8(_0x4c5f56,_0x52a132){_0x4c5f56=_0x4c5f56-0x1e3;const _0x3ecedb=a146_0x3ece();let _0x5cd818=_0x3ecedb[_0x4c5f56];return _0x5cd818;}function resolvePushSkillCode(_0x3480b7,_0x80dc99,_0x25d6b9,_0xda61a9){const _0x3e4d2c=a146_0x5cd8,_0x5d6dad=deriveSkillCodeFromSkillFile(_0x3480b7)||deriveSkillCodeFromDirectory(_0x3480b7,_0x80dc99);if(_0xda61a9[_0x3e4d2c(0x213)])return _0x5d6dad;return _0x25d6b9?.['skillCode']?.['trim']()||_0x5d6dad;}function deriveSkillCodeFromSkillFile(_0x3ad159){const _0xd709d1=a146_0x5cd8,_0x6a10c8=resolve(_0x3ad159,SKILL_FILE);if(!existsSync(_0x6a10c8)||!lstatSync(_0x6a10c8)['isFile']())return undefined;const _0x53df1e=readFileSync(_0x6a10c8,_0xd709d1(0x1f3)),_0x3f79c8=_0x53df1e[_0xd709d1(0x21d)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x3f79c8)return undefined;const _0x5c7672=parseFrontmatterObject(_0x3f79c8[0x1]??''),_0x1a722a=scalarToString(_0x5c7672?.[_0xd709d1(0x215)]);return _0x1a722a?slugifySkillName(_0x1a722a):undefined;}function readSkillDisplayName(_0x4478f1){const _0x42a301=a146_0x5cd8,_0x51c5d2=_0x4478f1[_0x42a301(0x21d)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x51c5d2)return undefined;const _0x1f5c60=parseFrontmatterObject(_0x51c5d2[0x1]??'');return scalarToString(_0x1f5c60?.[_0x42a301(0x1e8)]);}function slugifySkillName(_0x5b3bca){const _0x3765eb=a146_0x5cd8,_0x4321df=_0x5b3bca['trim']()[_0x3765eb(0x1e5)]()[_0x3765eb(0x201)](/[^\p{L}\p{N}\p{So}]+/gu,'-')[_0x3765eb(0x201)](/^-+/,'')[_0x3765eb(0x201)](/-+$/,'')[_0x3765eb(0x201)](/-{2,}/g,'-');if(!_0x4321df)throw CliErrors[_0x3765eb(0x225)](_0x3765eb(0x20c)+SKILL_FILE+_0x3765eb(0x202));return _0x4321df;}function parseFrontmatterObject(_0x305614){const _0x3a170c=a146_0x5cd8;try{const _0x3f7709=a146_0x3c7fce(_0x305614);return _0x3f7709&&typeof _0x3f7709===_0x3a170c(0x1f1)&&!Array[_0x3a170c(0x209)](_0x3f7709)?_0x3f7709:undefined;}catch{return undefined;}}function scalarToString(_0x125bae){const _0x657873=a146_0x5cd8;if(typeof _0x125bae===_0x657873(0x1f6))return _0x125bae['trim']();if(typeof _0x125bae===_0x657873(0x21e)||typeof _0x125bae==='boolean')return String(_0x125bae);return undefined;}function resolvePushDirectoryRoot(_0x244821){const _0x492c2a=a146_0x5cd8,_0x46ddb6=resolve(_0x244821);if(!existsSync(_0x46ddb6))throw CliErrors[_0x492c2a(0x225)](_0x492c2a(0x1f4)+_0x244821);const _0x297cd4=lstatSync(_0x46ddb6);if(_0x297cd4[_0x492c2a(0x1f2)]())return _0x46ddb6;if(_0x297cd4[_0x492c2a(0x1f7)]()){const _0xd6cc44=realpathSync(_0x46ddb6);if(lstatSync(_0xd6cc44)['isDirectory']())return _0xd6cc44;}throw CliErrors[_0x492c2a(0x225)]('Skill\x20directory\x20not\x20found:\x20'+_0x244821);}function requireRemoteScope(_0x14cb20){const _0x214642=a146_0x5cd8;if(_0x14cb20[_0x214642(0x221)]==='personal'||_0x14cb20['scope']===_0x214642(0x203)||_0x14cb20[_0x214642(0x221)]===_0x214642(0x1eb))return _0x14cb20[_0x214642(0x221)];throw CliErrors[_0x214642(0x225)](_0x214642(0x1ef)+(_0x14cb20[_0x214642(0x21c)]||'(unknown)')+_0x214642(0x1f8)+(_0x14cb20['scope']??_0x214642(0x1f9))+'\x22.');}function readLocalSkillContent(_0x47e61b){const _0x555faf=a146_0x5cd8,_0x458e38=resolve(_0x47e61b,SKILL_FILE);return existsSync(_0x458e38)&&lstatSync(_0x458e38)[_0x555faf(0x1fc)]()?readFileSync(_0x458e38,_0x555faf(0x1f3)):'';}function readPushMetadataIfPresent(_0x7dc826,_0x2d6253={}){const _0x45c6d0=a146_0x5cd8;try{return readMetadataIfPresent(_0x7dc826);}catch(_0x3aa759){if(_0x2d6253[_0x45c6d0(0x1ee)])return undefined;throw _0x3aa759;}}
|
|
1
|
+
(function(_0x35626e,_0x2cafaf){const _0x4fc7b3=a147_0x3adc,_0x56d972=_0x35626e();while(!![]){try{const _0xc36a6d=-parseInt(_0x4fc7b3(0xc9))/0x1+parseInt(_0x4fc7b3(0xcb))/0x2+-parseInt(_0x4fc7b3(0xe8))/0x3*(parseInt(_0x4fc7b3(0xf4))/0x4)+-parseInt(_0x4fc7b3(0xe2))/0x5+-parseInt(_0x4fc7b3(0xfd))/0x6+-parseInt(_0x4fc7b3(0xd1))/0x7+-parseInt(_0x4fc7b3(0xf1))/0x8*(-parseInt(_0x4fc7b3(0xeb))/0x9);if(_0xc36a6d===_0x2cafaf)break;else _0x56d972['push'](_0x56d972['shift']());}catch(_0x572504){_0x56d972['push'](_0x56d972['shift']());}}}(a147_0x4aae,0x5ccbb));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a147_0x4a969b}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';function a147_0x3adc(_0x2330cc,_0x380723){_0x2330cc=_0x2330cc-0xc5;const _0x4aaecc=a147_0x4aae();let _0x3adc7b=_0x4aaecc[_0x2330cc];return _0x3adc7b;}import{buildSkillPackage,tryNormalizePackageManifest}from'./zip-package.js';export function resolvePushDirectoryIdentity(_0x185a71,_0x49ed53,_0x3815d5={}){const _0x15c843=a147_0x3adc,_0x7ab71d=resolvePushDirectoryRoot(_0x185a71),_0x36b635=readPushMetadataIfPresent(resolve(_0x7ab71d,METADATA_FILE),{'ignoreInvalidMetadata':_0x3815d5['ignoreInvalidMetadata']});if(_0x36b635?.[_0x15c843(0xfa)]&&_0x36b635['appCode']!==_0x49ed53&&!_0x3815d5['allowAppCodeRetarget']&&!_0x3815d5[_0x15c843(0xf2)])throw CliErrors[_0x15c843(0xd3)]('Skill\x20metadata\x20appCode\x20\x22'+_0x36b635[_0x15c843(0xfa)]+_0x15c843(0xde)+_0x49ed53+'\x22.');const _0x257a18=resolvePushSkillCode(_0x7ab71d,_0x49ed53,_0x36b635,_0x3815d5);if(!_0x257a18)throw CliErrors[_0x15c843(0xd3)]('Unable\x20to\x20resolve\x20skillCode\x20from\x20'+SKILL_FILE+',\x20'+METADATA_FILE+_0x15c843(0x102));return{'dir':_0x7ab71d,'skillCode':_0x257a18,'metadata':_0x36b635};}export function readPushDirectory(_0x2f9ca3,_0x1f3e99,_0x256aff={}){const _0xccd2c4=a147_0x3adc,_0x44eee0=resolvePushDirectoryIdentity(_0x2f9ca3,_0x1f3e99,_0x256aff),_0x220669=_0x44eee0[_0xccd2c4(0xd8)],_0x421520=resolve(_0x220669,SKILL_FILE);if(!existsSync(_0x421520)||!lstatSync(_0x421520)[_0xccd2c4(0xf3)]())throw CliErrors[_0xccd2c4(0xd3)](_0xccd2c4(0x104)+SKILL_FILE+':\x20'+_0x421520);const _0xb2a61d=_0x44eee0[_0xccd2c4(0xda)],_0xd2cbb4=_0x256aff[_0xccd2c4(0xf7)]??_0xccd2c4(0xd6);if(!_0x256aff[_0xccd2c4(0xdb)]&&_0xb2a61d?.['scope']===_0xccd2c4(0xf0))throw CliErrors[_0xccd2c4(0xd3)](_0xccd2c4(0xc6)+METADATA_FILE+_0xccd2c4(0xec)+_0xb2a61d[_0xccd2c4(0xe3)]+'\x22.');if(!_0x256aff[_0xccd2c4(0xdb)]&&_0xd2cbb4===_0xccd2c4(0xd6)&&_0xb2a61d?.[_0xccd2c4(0xe3)]&&_0xb2a61d[_0xccd2c4(0xe3)]!=='personal')throw CliErrors['validation'](_0xccd2c4(0xcd)+METADATA_FILE+_0xccd2c4(0xec)+_0xb2a61d['scope']+'\x22.',_0xccd2c4(0xd2)+_0x220669+_0xccd2c4(0xed));const _0x4b1265=scanSkillDirectory(_0x220669,{'excludedFilePaths':_0x256aff[_0xccd2c4(0xf5)]}),_0xd4608b=buildSkillPackage(_0x4b1265),_0x542f05=readFileSync(_0x421520,'utf8'),_0x247e35=_0x44eee0[_0xccd2c4(0xce)],_0x49e46e=_0x256aff[_0xccd2c4(0xcf)]?undefined:_0xb2a61d,_0x2199bc=readSkillDisplayName(_0x542f05);return{'skillCode':_0x247e35,'metadata':_0xb2a61d,'frontmatterDisplayName':_0x2199bc,'input':{'skillCode':_0x247e35,'skillName':_0x2199bc??_0x49e46e?.['skillName'],'description':_0x49e46e?.['description'],'content':_0x542f05,'files':_0xd4608b[_0xccd2c4(0xe0)],'packageBase64':_0xd4608b['packageBase64'],'tags':_0x49e46e?.[_0xccd2c4(0x103)],'version':_0x49e46e?.[_0xccd2c4(0x100)],'sourceSessionId':_0x49e46e?.[_0xccd2c4(0xcc)]}};}export function refreshPushDirectoryMetadataFromRemote(_0x8dc13d,_0x2d652d,_0xee6c8e,_0x13a322={}){const _0xe7fe9c=a147_0x3adc,_0x5bbd6b=resolvePushDirectoryRoot(_0x8dc13d),_0x3aba48=readPushMetadataIfPresent(resolve(_0x5bbd6b,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x2d4862=requireRemoteScope(_0x2d652d),_0x5469b2=readLocalSkillContent(_0x5bbd6b),_0x386994={..._0x2d652d,'appCode':_0x2d652d[_0xe7fe9c(0xfa)]??_0xee6c8e,'skillName':_0x2d652d[_0xe7fe9c(0xca)]??_0x3aba48?.[_0xe7fe9c(0xca)],'description':_0x2d652d[_0xe7fe9c(0xd9)]??_0x3aba48?.[_0xe7fe9c(0xd9)],'example':_0x2d652d[_0xe7fe9c(0xe9)]??_0x3aba48?.[_0xe7fe9c(0xe9)],'tags':Array['isArray'](_0x2d652d['tags'])?_0x2d652d[_0xe7fe9c(0x103)]:_0x3aba48?.[_0xe7fe9c(0x103)],'sourceSessionId':_0x2d652d[_0xe7fe9c(0xcc)]??_0x3aba48?.['sourceSessionId'],'content':_0x2d652d[_0xe7fe9c(0x101)]??_0x5469b2},_0x31dcca=buildMetadata(_0x386994,_0x2d4862,_0xee6c8e,contentHash(_0x5469b2),_0x13a322['refreshedAt']);writeJsonAtomic(resolve(_0x5bbd6b,METADATA_FILE),_0x31dcca);}export function recordPushedRuntimeSkill(_0x27fb4b,_0xe75863,_0xc98044,_0x1cf972={}){const _0x2e8ff8=a147_0x3adc,_0x23869d=resolvePushDirectoryRoot(_0x27fb4b),_0x373b8f=scanSkillDirectory(_0x23869d),_0x3a7f4d=_0x373b8f[_0x2e8ff8(0xd4)](_0xc3fbe3=>_0xc3fbe3[_0x2e8ff8(0xc7)]===SKILL_FILE),_0x2d114e=_0x3a7f4d?fileText(_0x3a7f4d):'',_0x37a4e3=tryNormalizePackageManifest(_0xe75863[_0x2e8ff8(0xee)]),_0xd93ab={..._0xe75863,'content':_0xe75863[_0x2e8ff8(0x101)]??_0x2d114e,'files':_0x37a4e3},_0x30d32d=_0x37a4e3?normalizeLocalFiles(_0x373b8f)[_0x2e8ff8(0xd5)](_0xdb9ab0=>_0x37a4e3[_0x2e8ff8(0xee)][_0x2e8ff8(0xf8)](_0x952fcd=>_0x952fcd['path']===_0xdb9ab0[_0x2e8ff8(0xc7)])):undefined,_0x11a874=buildMetadata(_0xd93ab,_0x1cf972[_0x2e8ff8(0xe3)]??_0x2e8ff8(0xd6),_0xc98044,contentHash(_0xd93ab['content']??''),_0x1cf972[_0x2e8ff8(0xfc)],_0x30d32d);writeJsonAtomic(resolve(_0x23869d,METADATA_FILE),_0x11a874);}export function deriveSkillCodeFromDirectory(_0x1fdce2,_0xa37a01){const _0x773ef2=a147_0x3adc,_0x59d77e=basename(resolve(_0x1fdce2)),_0x3b6144=_0xa37a01+'--';return _0x59d77e[_0x773ef2(0xff)](_0x3b6144)?_0x59d77e['slice'](_0x3b6144[_0x773ef2(0xfe)]):_0x59d77e;}function a147_0x4aae(){const _0x2638db=['find','filter','personal','isArray','dir','description','metadata','ignoreMetadataScope','object','trim','\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22','replace','manifest','Invalid\x20','179680kDRAug','scope','string','unknown','ignoreMetadataSkillCode','displayName','42mNGzqq','example','\x20has\x20unsupported\x20scope\x20\x22','397017CZaPom','\x20has\x20scope=\x22','\x20to\x20submit\x20company\x20Skills\x20for\x20review.','files','number','builtin','328yCvzoj','ignoreMetadataAppCodeMismatch','isFile','159632FBPDtv','excludedFilePaths','name','targetScope','some','Remote\x20Skill\x20','appCode','isDirectory','pushedAt','4103844GJdHQo','length','startsWith','version','content',',\x20or\x20directory\x20name.','tags','Missing\x20','company','match','Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20','path','(unknown)','544418vGZfHZ','skillName','892408IyEuaR','sourceSessionId','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20','skillCode','ignoreMetadataForPayload','utf8','361942ryShdF','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20','validation'];a147_0x4aae=function(){return _0x2638db;};return a147_0x4aae();}function resolvePushSkillCode(_0x3be65e,_0x513262,_0x27141e,_0x558647){const _0x9cd1d0=a147_0x3adc,_0x120fc8=deriveSkillCodeFromSkillFile(_0x3be65e)||deriveSkillCodeFromDirectory(_0x3be65e,_0x513262);if(_0x558647[_0x9cd1d0(0xe6)])return _0x120fc8;return _0x27141e?.[_0x9cd1d0(0xce)]?.['trim']()||_0x120fc8;}function deriveSkillCodeFromSkillFile(_0x311285){const _0x5a8682=a147_0x3adc,_0x3cf26d=resolve(_0x311285,SKILL_FILE);if(!existsSync(_0x3cf26d)||!lstatSync(_0x3cf26d)[_0x5a8682(0xf3)]())return undefined;const _0x12b6e0=readFileSync(_0x3cf26d,_0x5a8682(0xd0)),_0x23cf18=_0x12b6e0[_0x5a8682(0xc5)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x23cf18)return undefined;const _0x1c76c2=parseFrontmatterObject(_0x23cf18[0x1]??''),_0x314ae4=scalarToString(_0x1c76c2?.[_0x5a8682(0xf6)]);return _0x314ae4?slugifySkillName(_0x314ae4):undefined;}function readSkillDisplayName(_0x306bfe){const _0x45b76b=a147_0x3adc,_0x3c13b6=_0x306bfe[_0x45b76b(0xc5)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x3c13b6)return undefined;const _0x4eed77=parseFrontmatterObject(_0x3c13b6[0x1]??'');return scalarToString(_0x4eed77?.[_0x45b76b(0xe7)]);}function slugifySkillName(_0x5a65e1){const _0x4dd08=a147_0x3adc,_0x45fb08=_0x5a65e1[_0x4dd08(0xdd)]()['toLowerCase']()[_0x4dd08(0xdf)](/[^\p{L}\p{N}\p{So}]+/gu,'-')[_0x4dd08(0xdf)](/^-+/,'')['replace'](/-+$/,'')[_0x4dd08(0xdf)](/-{2,}/g,'-');if(!_0x45fb08)throw CliErrors[_0x4dd08(0xd3)](_0x4dd08(0xe1)+SKILL_FILE+'\x20name\x20for\x20SkillHub\x20slug\x20generation.');return _0x45fb08;}function parseFrontmatterObject(_0x1b86c8){const _0x118fa2=a147_0x3adc;try{const _0x3824d8=a147_0x4a969b(_0x1b86c8);return _0x3824d8&&typeof _0x3824d8===_0x118fa2(0xdc)&&!Array[_0x118fa2(0xd7)](_0x3824d8)?_0x3824d8:undefined;}catch{return undefined;}}function scalarToString(_0x236f40){const _0x51d707=a147_0x3adc;if(typeof _0x236f40===_0x51d707(0xe4))return _0x236f40[_0x51d707(0xdd)]();if(typeof _0x236f40===_0x51d707(0xef)||typeof _0x236f40==='boolean')return String(_0x236f40);return undefined;}function resolvePushDirectoryRoot(_0x318568){const _0x584334=a147_0x3adc,_0x492a8d=resolve(_0x318568);if(!existsSync(_0x492a8d))throw CliErrors[_0x584334(0xd3)]('Skill\x20directory\x20not\x20found:\x20'+_0x318568);const _0x3d3610=lstatSync(_0x492a8d);if(_0x3d3610[_0x584334(0xfb)]())return _0x492a8d;if(_0x3d3610['isSymbolicLink']()){const _0x38e776=realpathSync(_0x492a8d);if(lstatSync(_0x38e776)[_0x584334(0xfb)]())return _0x38e776;}throw CliErrors[_0x584334(0xd3)]('Skill\x20directory\x20not\x20found:\x20'+_0x318568);}function requireRemoteScope(_0x3a6ab8){const _0x27514c=a147_0x3adc;if(_0x3a6ab8[_0x27514c(0xe3)]===_0x27514c(0xd6)||_0x3a6ab8[_0x27514c(0xe3)]===_0x27514c(0x105)||_0x3a6ab8[_0x27514c(0xe3)]===_0x27514c(0xf0))return _0x3a6ab8['scope'];throw CliErrors[_0x27514c(0xd3)](_0x27514c(0xf9)+(_0x3a6ab8[_0x27514c(0xce)]||_0x27514c(0xc8))+_0x27514c(0xea)+(_0x3a6ab8[_0x27514c(0xe3)]??_0x27514c(0xe5))+'\x22.');}function readLocalSkillContent(_0x18261e){const _0x33bdf4=a147_0x3adc,_0xac02d7=resolve(_0x18261e,SKILL_FILE);return existsSync(_0xac02d7)&&lstatSync(_0xac02d7)[_0x33bdf4(0xf3)]()?readFileSync(_0xac02d7,_0x33bdf4(0xd0)):'';}function readPushMetadataIfPresent(_0x1575c9,_0x770062={}){try{return readMetadataIfPresent(_0x1575c9);}catch(_0x4dd626){if(_0x770062['ignoreInvalidMetadata'])return undefined;throw _0x4dd626;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x24e45a,_0x4b9a46){const _0x4cd430=a148_0x5d54,_0x57c167=_0x24e45a();while(!![]){try{const _0x1059b9=-parseInt(_0x4cd430(0x12f))/0x1*(parseInt(_0x4cd430(0x12e))/0x2)+parseInt(_0x4cd430(0x137))/0x3*(-parseInt(_0x4cd430(0x126))/0x4)+parseInt(_0x4cd430(0x12c))/0x5*(-parseInt(_0x4cd430(0x132))/0x6)+-parseInt(_0x4cd430(0x12d))/0x7+parseInt(_0x4cd430(0x12b))/0x8*(-parseInt(_0x4cd430(0x129))/0x9)+parseInt(_0x4cd430(0x135))/0xa+parseInt(_0x4cd430(0x128))/0xb;if(_0x1059b9===_0x4b9a46)break;else _0x57c167['push'](_0x57c167['shift']());}catch(_0x3a2027){_0x57c167['push'](_0x57c167['shift']());}}}(a148_0x3957,0xd01c7));function a148_0x5d54(_0x2c88f4,_0x1519e5){_0x2c88f4=_0x2c88f4-0x126;const _0x395712=a148_0x3957();let _0x5d5456=_0x395712[_0x2c88f4];return _0x5d5456;}import{CliErrors}from'../../errors.js';export function normalizeRuntimeSkillScopes(_0x2cf40d){const _0x52f38d=a148_0x5d54,_0x4581ed=_0x2cf40d&&_0x2cf40d[_0x52f38d(0x131)]>0x0?_0x2cf40d:[_0x52f38d(0x136),_0x52f38d(0x134),'builtin'],_0x17d65d=[];for(const _0x5d2c11 of _0x4581ed){if(!isRuntimeSkillScope(_0x5d2c11))throw CliErrors[_0x52f38d(0x127)](_0x52f38d(0x133)+_0x5d2c11);!_0x17d65d['includes'](_0x5d2c11)&&_0x17d65d[_0x52f38d(0x130)](_0x5d2c11);}return _0x17d65d;}export function isRuntimeSkillScope(_0x3d0d0a){const _0x5823ed=a148_0x5d54;return _0x3d0d0a==='personal'||_0x3d0d0a===_0x5823ed(0x134)||_0x3d0d0a===_0x5823ed(0x12a);}function a148_0x3957(){const _0x4c5d3f=['2428132ivbgIF','299594YkBVoF','9dpyvlI','push','length','1382088yPAnpJ','Unsupported\x20runtime\x20Skill\x20scope:\x20','company','15452280uWmKVc','personal','63tbhrse','95808YooLSk','validation','25874145gnYkCO','280647kSJtPF','builtin','40mfCvMc','15RiUIXI'];a148_0x3957=function(){return _0x4c5d3f;};return a148_0x3957();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x2e3cad,_0x3f6b91){const _0x69403e=a150_0x5c21,_0x165ecf=_0x2e3cad();while(!![]){try{const _0x25b073=parseInt(_0x69403e(0x187))/0x1+parseInt(_0x69403e(0x179))/0x2+parseInt(_0x69403e(0x188))/0x3+parseInt(_0x69403e(0x17a))/0x4+-parseInt(_0x69403e(0x184))/0x5+-parseInt(_0x69403e(0x181))/0x6+parseInt(_0x69403e(0x17e))/0x7;if(_0x25b073===_0x3f6b91)break;else _0x165ecf['push'](_0x165ecf['shift']());}catch(_0x2bad1e){_0x165ecf['push'](_0x165ecf['shift']());}}}(a150_0x3ee5,0x282a5));import{unzipSync,zipSync}from'fflate';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(_0xc57836){const _0x4e6e61=a150_0x5c21,_0x5e8b0c={};for(const _0x3a1ad7 of normalizeLocalFiles(_0xc57836)){_0x5e8b0c[_0x3a1ad7[_0x4e6e61(0x18a)]]=fileContent(_0x3a1ad7);}return Buffer['from'](zipSync(_0x5e8b0c,{'level':0x0,'mtime':ZIP_MTIME}));}function a150_0x3ee5(){const _0x143561=['1029426Llgnjq','map','entries','1252175Ytoocb','endsWith','from','108929HWPOlB','252786glYenv','name','path','sort','60574MzktIW','1104740afcDyW','code','length','validation','608020EXYAbG','object','Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.'];a150_0x3ee5=function(){return _0x143561;};return a150_0x3ee5();}export function parseZipPackage(_0x4a227e){const _0x2fa441=a150_0x5c21;if(_0x4a227e[_0x2fa441(0x17c)]<0x16)throw CliErrors[_0x2fa441(0x17d)](_0x2fa441(0x180));let _0x34f269;try{_0x34f269=unzipSync(_0x4a227e,{'filter'(_0x37adcc){const _0x45a66=_0x2fa441,_0x4cb965=normalizeSkillRelativePath(_0x37adcc[_0x45a66(0x189)]);if(_0x4cb965[_0x45a66(0x185)]('/'))throw CliErrors[_0x45a66(0x17d)]('Runtime\x20Skill\x20package\x20contains\x20directory\x20entry:\x20'+_0x4cb965);return!![];}});}catch(_0x168f01){if(isRuntimeSkillValidationError(_0x168f01))throw _0x168f01;throw CliErrors['validation'](_0x2fa441(0x180));}return Object[_0x2fa441(0x183)](_0x34f269)[_0x2fa441(0x182)](([_0x139ba5,_0x2fd281])=>({'path':normalizeSkillRelativePath(_0x139ba5),'bytes':Buffer[_0x2fa441(0x186)](_0x2fd281)}))[_0x2fa441(0x18b)](compareSkillFiles);}function a150_0x5c21(_0x563f7,_0x28f055){_0x563f7=_0x563f7-0x179;const _0x3ee542=a150_0x3ee5();let _0x5c216a=_0x3ee542[_0x563f7];return _0x5c216a;}function isRuntimeSkillValidationError(_0x58d78d){const _0x3eabad=a150_0x5c21;return typeof _0x58d78d===_0x3eabad(0x17f)&&_0x58d78d!==null&&_0x3eabad(0x17b)in _0x58d78d&&_0x58d78d[_0x3eabad(0x17b)]==='validation_error';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1bcab3,_0x2744ea){const _0x29222d=a151_0x3c17,_0x2398f0=_0x1bcab3();while(!![]){try{const _0xae7ff1=parseInt(_0x29222d(0x1cc))/0x1*(parseInt(_0x29222d(0x1bd))/0x2)+-parseInt(_0x29222d(0x1c0))/0x3*(-parseInt(_0x29222d(0x1b4))/0x4)+parseInt(_0x29222d(0x1d1))/0x5*(parseInt(_0x29222d(0x1c2))/0x6)+parseInt(_0x29222d(0x1d3))/0x7*(-parseInt(_0x29222d(0x1b2))/0x8)+-parseInt(_0x29222d(0x1c9))/0x9+parseInt(_0x29222d(0x1d0))/0xa*(parseInt(_0x29222d(0x1c8))/0xb)+-parseInt(_0x29222d(0x1b6))/0xc;if(_0xae7ff1===_0x2744ea)break;else _0x2398f0['push'](_0x2398f0['shift']());}catch(_0x202d38){_0x2398f0['push'](_0x2398f0['shift']());}}}(a151_0x4309,0xc2d97));function a151_0x3c17(_0x17939d,_0x3c373f){_0x17939d=_0x17939d-0x1af;const _0x43099b=a151_0x4309();let _0x3c173c=_0x43099b[_0x17939d];return _0x3c173c;}function a151_0x4309(){const _0x53ff81=['validation','size','1220UYVeWR','2433425rzkABa','Runtime\x20Skill\x20package\x20size\x20mismatch.','4592ehfYxT','push','sha256','bytes','ossPath','zipSize','Runtime\x20Skill\x20file\x20tree\x20sha256\x20mismatch.','trim','object','2608LEFVNN','string','95032gdrarH','isSafeInteger','16381236RQPAAV','files','Runtime\x20Skill\x20file\x20tree\x20sha256\x20is\x20invalid.','get','path','set','\x20in\x20Skill\x20file\x20package.','962mtFPzH','Duplicate\x20Skill\x20package\x20entry:\x20','Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.','75fHrfKZ','map','12YHKWWY','Runtime\x20Skill\x20package\x20entry\x20list\x20mismatch.','Runtime\x20Skill\x20package\x20is\x20required\x20for\x20Skill\x20install:\x20','Runtime\x20Skill\x20package\x20file\x20size\x20mismatch:\x20','Runtime\x20Skill\x20manifest\x20is\x20missing\x20','zipSha256','31845CTiBWv','8393184cfnBji','treeSha256','length','2888dXOPGF','some'];a151_0x4309=function(){return _0x53ff81;};return a151_0x4309();}import{CliErrors}from'../../errors.js';import{SKILL_FILE}from'./constants.js';import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';import{fileContent,isSha256Hex,normalizeLocalFiles,normalizeManifestFiles}from'./local-files.js';import{createDeterministicZipPackage,parseZipPackage}from'./zip-codec.js';export function buildSkillPackage(_0x425eea){const _0x4a67cc=a151_0x3c17,_0xce125c=normalizeLocalFiles(_0x425eea);if(!_0xce125c[_0x4a67cc(0x1cd)](_0x5cae26=>_0x5cae26['path']===SKILL_FILE))throw CliErrors[_0x4a67cc(0x1ce)]('Missing\x20'+SKILL_FILE+_0x4a67cc(0x1bc));const _0x3f501d=localFilesToManifestFiles(_0xce125c),_0x3865c1=createDeterministicZipPackage(_0xce125c);return{'manifest':{'schemaVersion':0x2,'treeSha256':fileTreeHash(_0x3f501d),'zipSha256':bufferSha256(_0x3865c1),'zipSize':_0x3865c1[_0x4a67cc(0x1cb)],'files':_0x3f501d},'packageBytes':_0x3865c1,'packageBase64':_0x3865c1['toString']('base64')};}export function verifyRuntimeSkillPackage(_0xb86e0,_0x2d3d90){const _0x22cfd9=a151_0x3c17,_0x367453=normalizePackageManifest(_0xb86e0,{'requireOssPath':![]});if(!_0x367453)throw CliErrors[_0x22cfd9(0x1ce)]('Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.');return extractAndVerifyPackage(_0x367453,_0x2d3d90);}export function verifyRuntimeSkillBundle(_0x35d1c9,_0x280b59){const _0x40effb=a151_0x3c17,_0x4d39ce=normalizePackageManifest(_0x35d1c9,{'requireOssPath':![]});if(!_0x4d39ce)throw CliErrors['validation'](_0x40effb(0x1bf));return extractAndVerifyPackageFiles(_0x4d39ce,_0x280b59);}export function tryNormalizePackageManifest(_0x11be2e){return normalizePackageManifest(_0x11be2e,{'requireOssPath':![]});}export function requirePackageBytes(_0x862406,_0x971979){const _0x29310a=a151_0x3c17;if(!_0x971979||_0x971979[_0x29310a(0x1cb)]===0x0)throw CliErrors['validation'](_0x29310a(0x1c4)+_0x862406);return _0x971979;}export function extractDownloadedPackage(_0x34680c){const _0x503628=a151_0x3c17,_0xc3793c=parseZipPackage(_0x34680c)[_0x503628(0x1c1)](_0x1613bc=>({'path':_0x1613bc[_0x503628(0x1ba)],'bytes':_0x1613bc[_0x503628(0x1d6)]}));if(!_0xc3793c[_0x503628(0x1cd)](_0x18e2a6=>_0x18e2a6[_0x503628(0x1ba)]===SKILL_FILE))throw CliErrors[_0x503628(0x1ce)]('Runtime\x20Skill\x20package\x20is\x20missing\x20'+SKILL_FILE+'.');return normalizeLocalFiles(_0xc3793c);}export function localFilesToManifestFiles(_0x8f4ed9){const _0x1c6456=a151_0x3c17;return normalizeLocalFiles(_0x8f4ed9)[_0x1c6456(0x1c1)](_0x1a97ca=>({'path':_0x1a97ca['path'],'sha256':fileHash(_0x1a97ca),'size':fileContent(_0x1a97ca)[_0x1c6456(0x1cb)]}));}function normalizePackageManifest(_0x573046,_0x47dff8){const _0xc3e6d2=a151_0x3c17;if(!_0x573046||typeof _0x573046!==_0xc3e6d2(0x1b1)||Array['isArray'](_0x573046))return undefined;const _0xf1b458=_0x573046,_0x4ccc07=typeof _0xf1b458[_0xc3e6d2(0x1d7)]===_0xc3e6d2(0x1b3)?_0xf1b458[_0xc3e6d2(0x1d7)][_0xc3e6d2(0x1b0)]():undefined;if(_0x47dff8['requireOssPath']&&!_0x4ccc07)return undefined;if(!Array['isArray'](_0xf1b458['files'])||_0xf1b458[_0xc3e6d2(0x1b7)][_0xc3e6d2(0x1cb)]===0x0)return undefined;if(!isSha256Hex(_0xf1b458[_0xc3e6d2(0x1ca)]))throw CliErrors[_0xc3e6d2(0x1ce)](_0xc3e6d2(0x1b8));if(!isSha256Hex(_0xf1b458[_0xc3e6d2(0x1c7)]))throw CliErrors[_0xc3e6d2(0x1ce)]('Runtime\x20Skill\x20package\x20sha256\x20is\x20invalid.');if(!Number[_0xc3e6d2(0x1b5)](_0xf1b458[_0xc3e6d2(0x1d8)])||_0xf1b458[_0xc3e6d2(0x1d8)]<0x0)throw CliErrors[_0xc3e6d2(0x1ce)]('Runtime\x20Skill\x20package\x20size\x20is\x20invalid.');const _0xe44ea6=normalizeManifestFiles(_0xf1b458[_0xc3e6d2(0x1b7)]);if(!_0xe44ea6[_0xc3e6d2(0x1cd)](_0x163e57=>_0x163e57[_0xc3e6d2(0x1ba)]===SKILL_FILE))throw CliErrors[_0xc3e6d2(0x1ce)](_0xc3e6d2(0x1c6)+SKILL_FILE+'.');const _0x25a16d=fileTreeHash(_0xe44ea6);if(_0x25a16d!==_0xf1b458[_0xc3e6d2(0x1ca)]['toLowerCase']())throw CliErrors['validation'](_0xc3e6d2(0x1af));return{'schemaVersion':Number['isSafeInteger'](_0xf1b458['schemaVersion'])?_0xf1b458['schemaVersion']:0x2,'ossPath':_0x4ccc07,'treeSha256':_0x25a16d,'zipSha256':_0xf1b458[_0xc3e6d2(0x1c7)]['toLowerCase'](),'zipSize':_0xf1b458[_0xc3e6d2(0x1d8)],'files':_0xe44ea6};}function extractAndVerifyPackage(_0xde9dc6,_0x4a38b1){const _0x3ba7c8=a151_0x3c17,_0x5a2097=normalizePackageManifest(_0xde9dc6,{'requireOssPath':![]});if(!_0x5a2097)throw CliErrors[_0x3ba7c8(0x1ce)](_0x3ba7c8(0x1bf));if(_0x4a38b1[_0x3ba7c8(0x1cb)]!==_0x5a2097[_0x3ba7c8(0x1d8)])throw CliErrors[_0x3ba7c8(0x1ce)](_0x3ba7c8(0x1d2));const _0x5d984d=bufferSha256(_0x4a38b1);if(_0x5d984d!==_0x5a2097[_0x3ba7c8(0x1c7)])throw CliErrors[_0x3ba7c8(0x1ce)]('Runtime\x20Skill\x20package\x20sha256\x20mismatch.');return extractAndVerifyPackageFiles(_0x5a2097,_0x4a38b1);}function extractAndVerifyPackageFiles(_0x4341fb,_0x2fc751){const _0x427311=a151_0x3c17,_0x2f3deb=parseZipPackage(_0x2fc751);if(_0x2f3deb[_0x427311(0x1cb)]!==_0x4341fb[_0x427311(0x1b7)][_0x427311(0x1cb)])throw CliErrors[_0x427311(0x1ce)](_0x427311(0x1c3));const _0x5438a8=new Map();for(const _0x3e10f4 of _0x2f3deb){if(_0x5438a8['has'](_0x3e10f4[_0x427311(0x1ba)]))throw CliErrors[_0x427311(0x1ce)](_0x427311(0x1be)+_0x3e10f4[_0x427311(0x1ba)]);_0x5438a8[_0x427311(0x1bb)](_0x3e10f4[_0x427311(0x1ba)],_0x3e10f4);}const _0x3d01b2=[];for(const _0x591844 of _0x4341fb[_0x427311(0x1b7)]){const _0x373839=_0x5438a8[_0x427311(0x1b9)](_0x591844[_0x427311(0x1ba)]);if(!_0x373839)throw CliErrors[_0x427311(0x1ce)]('Runtime\x20Skill\x20package\x20is\x20missing\x20entry:\x20'+_0x591844[_0x427311(0x1ba)]);if(_0x373839[_0x427311(0x1d6)][_0x427311(0x1cb)]!==_0x591844[_0x427311(0x1cf)])throw CliErrors[_0x427311(0x1ce)](_0x427311(0x1c5)+_0x591844[_0x427311(0x1ba)]);const _0x434d0a=bufferSha256(_0x373839[_0x427311(0x1d6)]);if(_0x434d0a!==_0x591844[_0x427311(0x1d5)])throw CliErrors[_0x427311(0x1ce)]('Runtime\x20Skill\x20package\x20file\x20sha256\x20mismatch:\x20'+_0x591844[_0x427311(0x1ba)]);_0x3d01b2[_0x427311(0x1d4)]({'path':_0x591844[_0x427311(0x1ba)],'bytes':_0x373839['bytes']});}return normalizeLocalFiles(_0x3d01b2);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a152_0x34f2(){var _0x55cc6e=['2108384RBmXQi','3ZFWmSF','936100OkwOuk','150180VAEIbU','466459hIXOXG','844174TScwaq','70chfCbl','1066887wQBGTc','2343590fUHpCV','126mtLNUm'];a152_0x34f2=function(){return _0x55cc6e;};return a152_0x34f2();}(function(_0x4424a9,_0x1c88f9){var _0x128c50=a152_0x8a79,_0x777979=_0x4424a9();while(!![]){try{var _0x4c4c24=parseInt(_0x128c50(0x120))/0x1+-parseInt(_0x128c50(0x121))/0x2*(-parseInt(_0x128c50(0x11d))/0x3)+-parseInt(_0x128c50(0x11e))/0x4+-parseInt(_0x128c50(0x124))/0x5+parseInt(_0x128c50(0x11f))/0x6*(-parseInt(_0x128c50(0x11b))/0x7)+-parseInt(_0x128c50(0x11c))/0x8+parseInt(_0x128c50(0x123))/0x9*(parseInt(_0x128c50(0x122))/0xa);if(_0x4c4c24===_0x1c88f9)break;else _0x777979['push'](_0x777979['shift']());}catch(_0x5f0dfd){_0x777979['push'](_0x777979['shift']());}}}(a152_0x34f2,0x499cc));export{contentHash,fileTreeHash}from'./runtime-skill-sync/hashing.js';export{linkEffectiveRuntimeSkills,linkGlobalRuntimeSkills,pruneStaleRuntimeSkillCache,pruneStaleRuntimeSkillLinks}from'./runtime-skill-sync/links.js';export{resolveRuntimeSkillInstallTarget}from'./runtime-skill-sync/install-target.js';export{listLocalRuntimeSkills}from'./runtime-skill-sync/list-local.js';export{materializeRuntimeSkill,reuseMaterializedRuntimeSkill}from'./runtime-skill-sync/materialize.js';function a152_0x8a79(_0x366b32,_0x203b09){_0x366b32=_0x366b32-0x11b;var _0x34f213=a152_0x34f2();var _0x8a79b2=_0x34f213[_0x366b32];return _0x8a79b2;}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
|
-
const
|
|
1
|
+
const a153_0x22ef6a=a153_0x2eb7;(function(_0x3ece3d,_0x93e5b3){const _0x20d2ca=a153_0x2eb7,_0xf429a5=_0x3ece3d();while(!![]){try{const _0x1631e9=parseInt(_0x20d2ca(0x153))/0x1*(parseInt(_0x20d2ca(0x154))/0x2)+-parseInt(_0x20d2ca(0x16f))/0x3+parseInt(_0x20d2ca(0x152))/0x4*(parseInt(_0x20d2ca(0x14e))/0x5)+-parseInt(_0x20d2ca(0x163))/0x6+-parseInt(_0x20d2ca(0x150))/0x7+parseInt(_0x20d2ca(0x161))/0x8+-parseInt(_0x20d2ca(0x165))/0x9*(-parseInt(_0x20d2ca(0x158))/0xa);if(_0x1631e9===_0x93e5b3)break;else _0xf429a5['push'](_0xf429a5['shift']());}catch(_0x3f0962){_0xf429a5['push'](_0xf429a5['shift']());}}}(a153_0x575c,0x3b97d));import{existsSync,readFileSync}from'node:fs';import{homedir}from'node:os';function a153_0x575c(){const _0x22e455=['find','\x20has\x20no\x20skills\x20map','.skill-lock.json','number','home','1998168fRgGMV','\x20records\x20\x22','2777154naWGml','globalSkillsDirs','2286HYwdDi','version','\x22\x20but\x20no\x20SKILL.md\x20was\x20found\x20in\x20known\x20layouts\x20','skills','unverifiable','\x20is\x20unreadable:\x20','not-recorded','kind','includes','utf8','420510pyaSUn','138865jeCMQp','\x20uses\x20unsupported\x20version\x20','824516VoxCmk','SKILL.md','44yDItCf','2RIEJuO','128966SwVLMa','join','map','lockFile','11050rFrXuJ','.agents','unusable','recorded'];a153_0x575c=function(){return _0x22e455;};return a153_0x575c();}import{join}from'node:path';export const SKILL_LOCK_RELATIVE_PATH=join(a153_0x22ef6a(0x159),a153_0x22ef6a(0x15e));function a153_0x2eb7(_0x1aacab,_0x14b8e9){_0x1aacab=_0x1aacab-0x14e;const _0x575c9f=a153_0x575c();let _0x2eb74f=_0x575c9f[_0x1aacab];return _0x2eb74f;}export const GLOBAL_SKILLS_DIR_RELATIVE_PATHS=[join(a153_0x22ef6a(0x159),a153_0x22ef6a(0x168)),join('.claude',a153_0x22ef6a(0x168))];const SUPPORTED_LOCK_VERSIONS=[0x3];function readLockLookup(_0x86cadf,_0x1560e4){const _0x58fe92=a153_0x22ef6a;if(!existsSync(_0x86cadf))return{'kind':_0x58fe92(0x16b)};let _0x864d5c;try{_0x864d5c=JSON['parse'](readFileSync(_0x86cadf,_0x58fe92(0x16e)));}catch(_0x4773c4){return{'kind':_0x58fe92(0x15a),'reason':_0x86cadf+_0x58fe92(0x16a)+_0x4773c4['message']};}const _0x5a1a02=_0x864d5c;if(typeof _0x5a1a02?.['version']!==_0x58fe92(0x15f)||!SUPPORTED_LOCK_VERSIONS[_0x58fe92(0x16d)](_0x5a1a02[_0x58fe92(0x166)]))return{'kind':_0x58fe92(0x15a),'reason':_0x86cadf+_0x58fe92(0x14f)+String(_0x5a1a02?.['version'])};if(!_0x5a1a02[_0x58fe92(0x168)]||typeof _0x5a1a02[_0x58fe92(0x168)]!=='object')return{'kind':'unusable','reason':_0x86cadf+_0x58fe92(0x15d)};return _0x5a1a02[_0x58fe92(0x168)][_0x1560e4]?{'kind':'recorded'}:{'kind':'not-recorded'};}export function resolveInstalledSkill(_0x9de21c,_0x1d8177){const _0x822979=a153_0x22ef6a,_0x4429df=_0x1d8177?.[_0x822979(0x160)]??homedir(),_0x221c1a=_0x1d8177?.[_0x822979(0x164)]??GLOBAL_SKILLS_DIR_RELATIVE_PATHS[_0x822979(0x156)](_0x4037f1=>join(_0x4429df,_0x4037f1)),_0x4fd31e=_0x1d8177?.[_0x822979(0x157)]??join(_0x4429df,SKILL_LOCK_RELATIVE_PATH),_0x1196d3=_0x221c1a['map'](_0xce46e6=>join(_0xce46e6,_0x9de21c,_0x822979(0x151))),_0x3857a4=_0x1196d3[_0x822979(0x15c)](_0x4cda1a=>existsSync(_0x4cda1a));if(_0x3857a4)return{'state':'present','path':_0x3857a4};const _0x41c9ef=readLockLookup(_0x4fd31e,_0x9de21c);if(_0x41c9ef[_0x822979(0x16c)]==='unusable')return{'state':_0x822979(0x169),'reason':_0x41c9ef['reason']};if(_0x41c9ef['kind']===_0x822979(0x15b))return{'state':_0x822979(0x169),'reason':_0x4fd31e+_0x822979(0x162)+_0x9de21c+_0x822979(0x167)+('('+_0x1196d3[_0x822979(0x155)](',\x20')+')')};return{'state':'absent','checked':_0x1196d3};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a154_0x4d53(){const _0x35147c=['object','call','<redacted>','10410QPqXFe','29772OnjLWf','1319092ERtqcI','55953HdAsrQ','fromEntries','slice','1893744FicFMv','hasOwnProperty','string','repeat','184FixFhr','4972CrAflA','test','accessKey','map','14TLUvzZ','length','entries','481njeIAK','apps','15FXGuWX','isArray','5NraJcH','prototype','21672dOGHHH','130893iWRCnA'];a154_0x4d53=function(){return _0x35147c;};return a154_0x4d53();}const a154_0x26b48a=a154_0x4d10;(function(_0xa021ae,_0x452cfd){const _0x1e1e71=a154_0x4d10,_0x301795=_0xa021ae();while(!![]){try{const _0x21280b=-parseInt(_0x1e1e71(0x196))/0x1*(parseInt(_0x1e1e71(0x19a))/0x2)+-parseInt(_0x1e1e71(0x19b))/0x3+parseInt(_0x1e1e71(0x1a1))/0x4*(-parseInt(_0x1e1e71(0x198))/0x5)+-parseInt(_0x1e1e71(0x1a5))/0x6*(-parseInt(_0x1e1e71(0x191))/0x7)+-parseInt(_0x1e1e71(0x1a9))/0x8*(parseInt(_0x1e1e71(0x1a2))/0x9)+parseInt(_0x1e1e71(0x19f))/0xa*(parseInt(_0x1e1e71(0x1aa))/0xb)+-parseInt(_0x1e1e71(0x1a0))/0xc*(parseInt(_0x1e1e71(0x194))/0xd);if(_0x21280b===_0x452cfd)break;else _0x301795['push'](_0x301795['shift']());}catch(_0x44f510){_0x301795['push'](_0x301795['shift']());}}}(a154_0x4d53,0x50d28));const REDACTED_ACCESS_KEY=a154_0x26b48a(0x19e);export function maskCliAccessKey(_0x9f8222){const _0x4d2f61=a154_0x26b48a;if(typeof _0x9f8222!==_0x4d2f61(0x1a7)||_0x9f8222[_0x4d2f61(0x192)]<=0x8)return REDACTED_ACCESS_KEY;return''+_0x9f8222[_0x4d2f61(0x1a4)](0x0,0x8)+'*'[_0x4d2f61(0x1a8)](_0x9f8222[_0x4d2f61(0x192)]-0x8);}export function redactCliConfigCredentials(_0x4bcd0d){const _0x15efe4=a154_0x26b48a,_0x465e55={..._0x4bcd0d};return Object[_0x15efe4(0x199)][_0x15efe4(0x1a6)][_0x15efe4(0x19d)](_0x465e55,'accessKey')&&(_0x465e55[_0x15efe4(0x1ac)]=maskCliAccessKey(_0x465e55['accessKey'])),_0x465e55[_0x15efe4(0x195)]&&typeof _0x465e55[_0x15efe4(0x195)]===_0x15efe4(0x19c)&&!Array[_0x15efe4(0x197)](_0x465e55['apps'])&&(_0x465e55[_0x15efe4(0x195)]=redactLegacyAppCredentials(_0x465e55[_0x15efe4(0x195)])),_0x465e55;}function a154_0x4d10(_0x1e97c0,_0x592424){_0x1e97c0=_0x1e97c0-0x191;const _0x4d53cc=a154_0x4d53();let _0x4d104b=_0x4d53cc[_0x1e97c0];return _0x4d104b;}export function redactCliConfigValue(_0x41e015,_0x5ec7d7){const _0xa75c6c=a154_0x26b48a;if(_0x41e015==='accessKey'||/^apps\.[^.]+\.accessKey$/[_0xa75c6c(0x1ab)](_0x41e015))return maskCliAccessKey(_0x5ec7d7);if(_0x41e015==='apps'&&_0x5ec7d7&&typeof _0x5ec7d7==='object'&&!Array[_0xa75c6c(0x197)](_0x5ec7d7))return redactLegacyAppCredentials(_0x5ec7d7);if(/^apps\.[^.]+$/['test'](_0x41e015)&&_0x5ec7d7&&typeof _0x5ec7d7===_0xa75c6c(0x19c)&&!Array[_0xa75c6c(0x197)](_0x5ec7d7)){const _0x2a7cd5=_0x5ec7d7;return Object['prototype']['hasOwnProperty'][_0xa75c6c(0x19d)](_0x2a7cd5,_0xa75c6c(0x1ac))?{..._0x2a7cd5,'accessKey':maskCliAccessKey(_0x2a7cd5[_0xa75c6c(0x1ac)])}:_0x5ec7d7;}return _0x5ec7d7;}function redactLegacyAppCredentials(_0x56b05e){const _0x2c54bb=a154_0x26b48a;return Object[_0x2c54bb(0x1a3)](Object[_0x2c54bb(0x193)](_0x56b05e)[_0x2c54bb(0x1ad)](([_0x457357,_0x1a486d])=>{const _0x28ca6d=_0x2c54bb;if(!_0x1a486d||typeof _0x1a486d!=='object'||Array[_0x28ca6d(0x197)](_0x1a486d))return[_0x457357,_0x1a486d];const _0x283176={..._0x1a486d};return Object[_0x28ca6d(0x199)][_0x28ca6d(0x1a6)][_0x28ca6d(0x19d)](_0x283176,'accessKey')&&(_0x283176[_0x28ca6d(0x1ac)]=maskCliAccessKey(_0x283176[_0x28ca6d(0x1ac)])),[_0x457357,_0x283176];}));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a155_0x19ca(_0x42de36,_0x59e716){_0x42de36=_0x42de36-0x76;const _0x282e33=a155_0x282e();let _0x19ca69=_0x282e33[_0x42de36];return _0x19ca69;}function a155_0x282e(){const _0x260973=['7062940WdctAZ','14740njJGiv','14103aKkmsq','6917886BtDrdB','89627SefZbl','10wYeIzd','760445yKYCJW','10609760ytlEnQ','4PffZjl','1193013sjqsys'];a155_0x282e=function(){return _0x260973;};return a155_0x282e();}(function(_0x241f8e,_0xfe900f){const _0x404b55=a155_0x19ca,_0x350b31=_0x241f8e();while(!![]){try{const _0x51574b=-parseInt(_0x404b55(0x7a))/0x1*(parseInt(_0x404b55(0x7b))/0x2)+parseInt(_0x404b55(0x7f))/0x3*(parseInt(_0x404b55(0x7e))/0x4)+-parseInt(_0x404b55(0x76))/0x5+parseInt(_0x404b55(0x79))/0x6+parseInt(_0x404b55(0x7c))/0x7+-parseInt(_0x404b55(0x7d))/0x8+-parseInt(_0x404b55(0x78))/0x9*(-parseInt(_0x404b55(0x77))/0xa);if(_0x51574b===_0xfe900f)break;else _0x350b31['push'](_0x350b31['shift']());}catch(_0x546d65){_0x350b31['push'](_0x350b31['shift']());}}}(a155_0x282e,0xbef16));import{createJqFilter,resolveBundledJqPaths}from'@lovrabet/cli-framework';import{CliErrors}from'../errors.js';export const applyJqFilter=createJqFilter(CliErrors,{'bundledJqPaths':resolveBundledJqPaths()});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a156_0xeccf(){const _0x2e0f69=['join','Current\x20version:\x20','1806852wOlZMm','stableVersion','latest','Current\x20CLI\x20version\x20is\x20below\x20the\x20minimum\x20supported\x20version.','80810EHPofM','Recommended\x20stable:\x20','belowMinimum','15970kzbftl','7PCtNyZ','upgradeMessage','Minimum\x20supported:\x20','3YGsdnO','9621648AeHDuN','4503924nnCOXp','1522647VbegTt','24xXtflF','minimumVersionMessage','minimumVersion','89LPOcpn','296087MNEeOr','filter','Upgrade\x20command:\x20','220cfrXIB','npm\x20install\x20-g\x20','validation'];a156_0xeccf=function(){return _0x2e0f69;};return a156_0xeccf();}(function(_0x322792,_0xc57ae3){const _0x41fb9e=a156_0x2fda,_0x37bd1c=_0x322792();while(!![]){try{const _0x4b3c29=parseInt(_0x41fb9e(0x97))/0x1*(parseInt(_0x41fb9e(0xa7))/0x2)+parseInt(_0x41fb9e(0x90))/0x3*(parseInt(_0x41fb9e(0xa0))/0x4)+parseInt(_0x41fb9e(0xa4))/0x5+parseInt(_0x41fb9e(0x92))/0x6*(-parseInt(_0x41fb9e(0xa8))/0x7)+-parseInt(_0x41fb9e(0x94))/0x8*(-parseInt(_0x41fb9e(0x93))/0x9)+parseInt(_0x41fb9e(0x9b))/0xa*(parseInt(_0x41fb9e(0x98))/0xb)+-parseInt(_0x41fb9e(0x91))/0xc;if(_0x4b3c29===_0xc57ae3)break;else _0x37bd1c['push'](_0x37bd1c['shift']());}catch(_0x30dd94){_0x37bd1c['push'](_0x37bd1c['shift']());}}}(a156_0xeccf,0xb132d));import a156_0x36e8f6 from'semver';import{LOVRABET_NPM_PACKAGE_NAME}from'../constant/distribution.js';import{CliErrors}from'../errors.js';import{getCliVersionPolicy}from'../utils/cli-version-policy.js';import{getCliVersion}from'../utils/version.js';export function evaluateCliVersionPolicy(_0x539583,_0x2191bb){const _0x1c1620=a156_0x2fda,_0x34198f=a156_0x36e8f6['valid'](_0x539583)===_0x539583,_0x4ef217=_0x2191bb?.[_0x1c1620(0xa1)]??null,_0x19c28b=_0x2191bb?.[_0x1c1620(0x96)]??null,_0x48c82d=Boolean(_0x34198f&&_0x4ef217&&a156_0x36e8f6['lt'](_0x539583,_0x4ef217)),_0x57aa00=Boolean(_0x34198f&&_0x19c28b&&a156_0x36e8f6['lt'](_0x539583,_0x19c28b));return{'currentVersion':_0x539583,'stableVersion':_0x4ef217,'minimumVersion':_0x19c28b,'needsUpgrade':_0x48c82d||_0x57aa00,'belowMinimum':_0x57aa00,'upgradeMessage':_0x2191bb?.[_0x1c1620(0xa9)],'minimumVersionMessage':_0x2191bb?.[_0x1c1620(0x95)]};}function a156_0x2fda(_0x19ba06,_0x106691){_0x19ba06=_0x19ba06-0x8f;const _0xeccfef=a156_0xeccf();let _0x2fda88=_0xeccfef[_0x19ba06];return _0x2fda88;}export async function checkCliVersion(){return evaluateCliVersionPolicy(getCliVersion(),await getCliVersionPolicy());}export function getCliUpgradeCommand(_0xc645aa){const _0x3ac15d=a156_0x2fda;return _0x3ac15d(0x9c)+LOVRABET_NPM_PACKAGE_NAME+'@'+(_0xc645aa['stableVersion']??_0x3ac15d(0xa2));}export function assertCliVersionSupported(_0x27d55f){const _0x163a00=a156_0x2fda;if(!_0x27d55f[_0x163a00(0xa6)])return;const _0x2a15ed=[_0x27d55f['minimumVersionMessage'],_0x163a00(0x9f)+_0x27d55f['currentVersion'],_0x163a00(0x8f)+_0x27d55f[_0x163a00(0x96)],_0x163a00(0xa5)+(_0x27d55f[_0x163a00(0xa1)]??'unavailable'),_0x163a00(0x9a)+getCliUpgradeCommand(_0x27d55f)][_0x163a00(0x99)](Boolean)[_0x163a00(0x9e)]('\x0a');throw CliErrors[_0x163a00(0x9d)](_0x163a00(0xa3),_0x2a15ed);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x32e8d0,_0x17ec13){const _0xf434c8=a157_0x3f0c,_0x1ce9cf=_0x32e8d0();while(!![]){try{const _0x1cb1eb=-parseInt(_0xf434c8(0xfd))/0x1*(parseInt(_0xf434c8(0x100))/0x2)+-parseInt(_0xf434c8(0x10a))/0x3+parseInt(_0xf434c8(0xfe))/0x4+parseInt(_0xf434c8(0x10b))/0x5+-parseInt(_0xf434c8(0x108))/0x6+-parseInt(_0xf434c8(0xfb))/0x7+-parseInt(_0xf434c8(0x106))/0x8*(-parseInt(_0xf434c8(0x10d))/0x9);if(_0x1cb1eb===_0x17ec13)break;else _0x1ce9cf['push'](_0x1ce9cf['shift']());}catch(_0x294fa3){_0x1ce9cf['push'](_0x1ce9cf['shift']());}}}(a157_0x1f5c,0x48b6c));import a157_0x2f95e1 from'semver';function a157_0x1f5c(){const _0x1906fe=['then','valid','object','67123zjqOSB','minimumVersionMessage','532sIcpwG','2158972pYGBkg','minVersion','582QBlhbw','timeout','cli','upgradeMessage','latestVersion','stableVersion','774024fdtbBL','json','2172738qXBeNG','now','282795KZIuTi','926880NTyIhg','string','18WtIwAh','minimumVersion','trim','finally','application/json'];a157_0x1f5c=function(){return _0x1906fe;};return a157_0x1f5c();}function a157_0x3f0c(_0x534c83,_0xff99ab){_0x534c83=_0x534c83-0xfb;const _0x1f5c82=a157_0x1f5c();let _0x3f0cea=_0x1f5c82[_0x534c83];return _0x3f0cea;}import{LOVRABET_CLI_VERSION_POLICY_URL}from'../constant/distribution.js';const SUCCESS_CACHE_TTL_MS=0x5*0x3c*0x3e8,FAILURE_CACHE_TTL_MS=0x3c*0x3e8,FETCH_TIMEOUT_MS=0x5dc;function pickString(_0x32829a){const _0x43c84c=a157_0x3f0c;return typeof _0x32829a===_0x43c84c(0x10c)&&_0x32829a['trim']()?_0x32829a[_0x43c84c(0x10f)]():null;}function pickStrictSemver(_0x274adf){const _0xd8b4bd=a157_0x3f0c,_0x5bafb4=pickString(_0x274adf);return _0x5bafb4&&a157_0x2f95e1[_0xd8b4bd(0x113)](_0x5bafb4)===_0x5bafb4?_0x5bafb4:null;}export function normalizeCliVersionPolicy(_0xc16f29){const _0x29aa4c=a157_0x3f0c;if(!_0xc16f29||typeof _0xc16f29!=='object')return null;const _0x2304dc=_0xc16f29,_0x2d57d8=_0x2304dc['cli']&&typeof _0x2304dc['cli']===_0x29aa4c(0x114)?_0x2304dc[_0x29aa4c(0x102)]:_0x2304dc,_0x23190e=pickStrictSemver(_0x2d57d8[_0x29aa4c(0x105)]??_0x2d57d8[_0x29aa4c(0x104)]??_0x2d57d8['recommendedVersion']),_0x236b80=pickStrictSemver(_0x2d57d8[_0x29aa4c(0x10e)]??_0x2d57d8[_0x29aa4c(0xff)]);if(!_0x23190e&&!_0x236b80)return null;if(_0x23190e&&_0x236b80&&a157_0x2f95e1['gt'](_0x236b80,_0x23190e))return null;return{'stableVersion':_0x23190e,'minimumVersion':_0x236b80,'upgradeMessage':pickString(_0x2d57d8[_0x29aa4c(0x103)])??undefined,'minimumVersionMessage':pickString(_0x2d57d8[_0x29aa4c(0xfc)])??undefined};}export async function fetchCliVersionPolicy(){const _0x5a28cf=a157_0x3f0c;try{const _0x2015f5=await fetch(LOVRABET_CLI_VERSION_POLICY_URL,{'headers':{'Accept':_0x5a28cf(0x111)},'signal':AbortSignal[_0x5a28cf(0x101)](FETCH_TIMEOUT_MS)});if(!_0x2015f5['ok'])return null;return normalizeCliVersionPolicy(await _0x2015f5[_0x5a28cf(0x107)]());}catch{return null;}}let cachedPolicy=null,cachedAt=0x0,hasCachedPolicy=![],pendingPolicy=null;export async function getCliVersionPolicy(){const _0x1d4a2b=a157_0x3f0c,_0x574433=Date[_0x1d4a2b(0x109)]();if(hasCachedPolicy){const _0x4b3764=cachedPolicy?SUCCESS_CACHE_TTL_MS:FAILURE_CACHE_TTL_MS;if(_0x574433-cachedAt<_0x4b3764)return cachedPolicy;}if(pendingPolicy)return pendingPolicy;return pendingPolicy=fetchCliVersionPolicy()[_0x1d4a2b(0x112)](_0x473c19=>{return cachedPolicy=_0x473c19,cachedAt=Date['now'](),hasCachedPolicy=!![],_0x473c19;})[_0x1d4a2b(0x110)](()=>{pendingPolicy=null;}),pendingPolicy;}export function clearCliVersionPolicyCache(){cachedPolicy=null,cachedAt=0x0,hasCachedPolicy=![],pendingPolicy=null;}
|
package/lib/utils/logger.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a158_0x3b3cd1=a158_0x41e0;(function(_0x1e84eb,_0x4ac1ff){const _0x3def96=a158_0x41e0,_0x4f6c71=_0x1e84eb();while(!![]){try{const _0x2bb173=-parseInt(_0x3def96(0x1af))/0x1+parseInt(_0x3def96(0x193))/0x2+-parseInt(_0x3def96(0x190))/0x3*(parseInt(_0x3def96(0x194))/0x4)+-parseInt(_0x3def96(0x1b0))/0x5*(-parseInt(_0x3def96(0x1b1))/0x6)+-parseInt(_0x3def96(0x1a8))/0x7*(-parseInt(_0x3def96(0x1a0))/0x8)+-parseInt(_0x3def96(0x1a4))/0x9*(parseInt(_0x3def96(0x19f))/0xa)+parseInt(_0x3def96(0x19e))/0xb;if(_0x2bb173===_0x4ac1ff)break;else _0x4f6c71['push'](_0x4f6c71['shift']());}catch(_0x58650b){_0x4f6c71['push'](_0x4f6c71['shift']());}}}(a158_0x47af,0xe842e));import a158_0xf34b48 from'winston';import a158_0x440919 from'node:fs';function a158_0x47af(){const _0x46768d=['initWinstonLogger','trim','readLogs','currentRawCommand','Starting:\x20','timestamp','createLogger','error','Failed:\x20','18411294SYloGz','476970wakyie','712424fgNdGi','logTask','errors','details','99OXzFVF','message','yellow','combine','42WBYnuJ','stringify','printf','utf8','rawCommand','info','unknown','948808RpqPwO','5HkaHES','2845446zvOVqM','success','Failed\x20to\x20clear\x20logs:','readFileSync','dirname','File','duration','existsSync','join','setLogPath','winstonLogger','level','transports','logFilePath','warn','Failed\x20to\x20read\x20logs:','Completed:\x20','mkdirSync','command','filter','map','blue','format','4074897iJDLFu','red','now','2201606Bagwvh','4WvYaNW'];a158_0x47af=function(){return _0x46768d;};return a158_0x47af();}import a158_0x182f57 from'node:path';import{PRODUCT_CONFIG}from'../constant/product.js';function a158_0x41e0(_0x3d3c77,_0x5e04cd){_0x3d3c77=_0x3d3c77-0x188;const _0x47af73=a158_0x47af();let _0x41e0fa=_0x47af73[_0x3d3c77];return _0x41e0fa;}class Logger{[a158_0x3b3cd1(0x1bb)];['logFilePath']='';[a158_0x3b3cd1(0x198)]='';constructor(){}['setRawCommand'](_0x3e894f){const _0x33bf57=a158_0x3b3cd1;this[_0x33bf57(0x198)]=_0x3e894f;}[a158_0x3b3cd1(0x1ba)](_0x8dc7fc){const _0x5278bb=a158_0x3b3cd1;this[_0x5278bb(0x1be)]=a158_0x182f57[_0x5278bb(0x1b9)](_0x8dc7fc,PRODUCT_CONFIG['logFileName']),this[_0x5278bb(0x1bb)]&&this['winstonLogger']['clear'](),this[_0x5278bb(0x195)]();}['initWinstonLogger'](){const _0x2aa76e=a158_0x3b3cd1,_0x30eb28=a158_0x182f57[_0x2aa76e(0x1b5)](this[_0x2aa76e(0x1be)]);!a158_0x440919[_0x2aa76e(0x1b8)](_0x30eb28)&&a158_0x440919[_0x2aa76e(0x18a)](_0x30eb28,{'recursive':!![]});const _0x123c9c=a158_0xf34b48[_0x2aa76e(0x18f)][_0x2aa76e(0x1a7)](a158_0xf34b48[_0x2aa76e(0x18f)][_0x2aa76e(0x19a)](),a158_0xf34b48['format'][_0x2aa76e(0x1a2)]({'stack':!![]}),a158_0xf34b48[_0x2aa76e(0x18f)][_0x2aa76e(0x1aa)](_0x22d1c4=>{const _0x5e127d=_0x2aa76e,_0x49ee01={'timestamp':_0x22d1c4[_0x5e127d(0x19a)]||new Date()['toISOString'](),'level':_0x22d1c4[_0x5e127d(0x1bc)]||_0x5e127d(0x1ad),'command':_0x22d1c4[_0x5e127d(0x18b)]||_0x5e127d(0x1ae),'rawCommand':_0x22d1c4[_0x5e127d(0x1ac)]||this['currentRawCommand']||undefined,'message':_0x22d1c4[_0x5e127d(0x1a5)]||'','duration':_0x22d1c4[_0x5e127d(0x1b7)]||undefined,'details':_0x22d1c4[_0x5e127d(0x1a3)]||undefined};return JSON[_0x5e127d(0x1a9)](_0x49ee01);}));this[_0x2aa76e(0x1bb)]=a158_0xf34b48[_0x2aa76e(0x19b)]({'level':_0x2aa76e(0x1ad),'format':_0x123c9c,'transports':[new a158_0xf34b48[(_0x2aa76e(0x1bd))][(_0x2aa76e(0x1b6))]({'filename':this[_0x2aa76e(0x1be)],'level':_0x2aa76e(0x1ad)})],'silent':![]}),a158_0xf34b48['addColors']({'success':'green','error':_0x2aa76e(0x191),'warn':_0x2aa76e(0x1a6),'info':_0x2aa76e(0x18e)});}[a158_0x3b3cd1(0x1ad)](_0x171833,_0x44a516,_0x7a5245){const _0x9ed7a4=a158_0x3b3cd1;if(!this[_0x9ed7a4(0x1be)]||!this['winstonLogger'])return;this['winstonLogger']['info'](_0x44a516,{'command':_0x171833,'details':_0x7a5245});}[a158_0x3b3cd1(0x1b2)](_0x3348d2,_0x2c2f3d,_0x50a0f3,_0x243776){const _0x22638d=a158_0x3b3cd1;if(!this[_0x22638d(0x1be)]||!this[_0x22638d(0x1bb)])return;this['winstonLogger']['log'](_0x22638d(0x1ad),_0x2c2f3d,{'level':_0x22638d(0x1b2),'command':_0x3348d2,'duration':_0x50a0f3,'details':_0x243776});}['error'](_0x317be1,_0x3612ff,_0x36e314){const _0x590713=a158_0x3b3cd1;if(!this[_0x590713(0x1be)]||!this['winstonLogger'])return;this['winstonLogger']['error'](_0x3612ff,{'command':_0x317be1,'details':_0x36e314});}['warn'](_0x29b058,_0x2df268,_0x216a30){const _0x378d77=a158_0x3b3cd1;if(!this['logFilePath']||!this[_0x378d77(0x1bb)])return;this['winstonLogger']['warn'](_0x2df268,{'command':_0x29b058,'details':_0x216a30});}async[a158_0x3b3cd1(0x1a1)](_0x272bd8,_0x46f352,_0x1ea378){const _0x559f5f=a158_0x3b3cd1,_0x479fa8=Date[_0x559f5f(0x192)]();this['info'](_0x272bd8,_0x559f5f(0x199)+_0x46f352);try{const _0x216a3c=await _0x1ea378(),_0x5c13ef=Date[_0x559f5f(0x192)]()-_0x479fa8;return this[_0x559f5f(0x1b2)](_0x272bd8,_0x559f5f(0x189)+_0x46f352,_0x5c13ef),_0x216a3c;}catch(_0xb1b9a1){const _0x2f91df=Date['now']()-_0x479fa8;this[_0x559f5f(0x19c)](_0x272bd8,_0x559f5f(0x19d)+_0x46f352,{'error':_0xb1b9a1 instanceof Error?_0xb1b9a1[_0x559f5f(0x1a5)]:String(_0xb1b9a1),'duration':_0x2f91df});throw _0xb1b9a1;}}[a158_0x3b3cd1(0x197)](){const _0x27b6ee=a158_0x3b3cd1;try{if(!a158_0x440919[_0x27b6ee(0x1b8)](this[_0x27b6ee(0x1be)]))return[];const _0x44e0b9=a158_0x440919[_0x27b6ee(0x1b4)](this[_0x27b6ee(0x1be)],'utf8');return _0x44e0b9['split'](/\r?\n/)[_0x27b6ee(0x18c)](_0x216f2e=>_0x216f2e[_0x27b6ee(0x196)]())[_0x27b6ee(0x18d)](_0x47803b=>JSON['parse'](_0x47803b));}catch(_0x477539){return console['warn'](_0x27b6ee(0x188),_0x477539),[];}}['clearLogs'](){const _0x481a47=a158_0x3b3cd1;try{a158_0x440919['existsSync'](this[_0x481a47(0x1be)])&&a158_0x440919['writeFileSync'](this['logFilePath'],'',_0x481a47(0x1ab));}catch(_0x4fb1ad){console[_0x481a47(0x1bf)](_0x481a47(0x1b3),_0x4fb1ad);}}['getWinstonInstance'](){const _0x1cd35f=a158_0x3b3cd1;return this[_0x1cd35f(0x1bb)];}}export const logger=new Logger();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a159_0x5adc(_0x143ec9,_0x3bd116){_0x143ec9=_0x143ec9-0x12c;const _0x2a07f0=a159_0x2a07();let _0x5adc0a=_0x2a07f0[_0x143ec9];return _0x5adc0a;}const a159_0xfd9dce=a159_0x5adc;function a159_0x2a07(){const _0xad2f9e=['json','length','undefined','80nVFdgR','getOwnPropertyDescriptor','71974xWhoVQ','515583yFFCgH','71255suLSfU','470337DqkCPY','872352ewqacl','text','parse','includes','prototype','649708MvRwfS','exec','MAX_SAFE_INTEGER','184RNGSqN','MIN_SAFE_INTEGER','defineProperty','217908oHzARo'];a159_0x2a07=function(){return _0xad2f9e;};return a159_0x2a07();}(function(_0x23ee9c,_0xa902f6){const _0x39f272=a159_0x5adc,_0x309cd1=_0x23ee9c();while(!![]){try{const _0x2b9587=-parseInt(_0x39f272(0x132))/0x1+parseInt(_0x39f272(0x138))/0x2+parseInt(_0x39f272(0x13e))/0x3+-parseInt(_0x39f272(0x12d))/0x4*(-parseInt(_0x39f272(0x131))/0x5)+-parseInt(_0x39f272(0x133))/0x6+-parseInt(_0x39f272(0x12f))/0x7*(-parseInt(_0x39f272(0x13b))/0x8)+-parseInt(_0x39f272(0x130))/0x9;if(_0x2b9587===_0xa902f6)break;else _0x309cd1['push'](_0x309cd1['shift']());}catch(_0x2c4480){_0x309cd1['push'](_0x309cd1['shift']());}}}(a159_0x2a07,0x3c0dc));const JSON_NUMBER_PATTERN=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?/,MAX_SAFE_INTEGER=BigInt(Number[a159_0xfd9dce(0x13a)]),MIN_SAFE_INTEGER=BigInt(Number[a159_0xfd9dce(0x13c)]);let restoreResponseJsonParser,responseJsonPrototype,originalResponseJsonDescriptor;function isUnsafeIntegerLiteral(_0x4602c3){const _0x244ccf=a159_0xfd9dce;if(_0x4602c3[_0x244ccf(0x136)]('.')||_0x4602c3[_0x244ccf(0x136)]('e')||_0x4602c3[_0x244ccf(0x136)]('E'))return![];const _0x30cbac=BigInt(_0x4602c3);return _0x30cbac>MAX_SAFE_INTEGER||_0x30cbac<MIN_SAFE_INTEGER;}function quoteUnsafeIntegerLiterals(_0x5988ab){const _0x2fb43b=a159_0xfd9dce;let _0x2dbcba='',_0x5b734f=![],_0x3d1a11=![];for(let _0x286438=0x0;_0x286438<_0x5988ab['length'];){const _0x2ab80d=_0x5988ab[_0x286438];if(_0x5b734f){_0x2dbcba+=_0x2ab80d,_0x286438+=0x1;if(_0x3d1a11)_0x3d1a11=![];else{if(_0x2ab80d==='\x5c')_0x3d1a11=!![];else _0x2ab80d==='\x22'&&(_0x5b734f=![]);}continue;}if(_0x2ab80d==='\x22'){_0x5b734f=!![],_0x2dbcba+=_0x2ab80d,_0x286438+=0x1;continue;}if(_0x2ab80d==='-'||_0x2ab80d>='0'&&_0x2ab80d<='9'){const _0x5c6ea8=JSON_NUMBER_PATTERN[_0x2fb43b(0x139)](_0x5988ab['slice'](_0x286438))?.[0x0];if(_0x5c6ea8){_0x2dbcba+=isUnsafeIntegerLiteral(_0x5c6ea8)?'\x22'+_0x5c6ea8+'\x22':_0x5c6ea8,_0x286438+=_0x5c6ea8[_0x2fb43b(0x140)];continue;}}_0x2dbcba+=_0x2ab80d,_0x286438+=0x1;}return _0x2dbcba;}export function parseLosslessJson(_0x152aea){const _0x5c3475=a159_0xfd9dce;return JSON[_0x5c3475(0x135)](quoteUnsafeIntegerLiterals(_0x152aea));}export function installLosslessJsonResponseParser(){const _0x41d67d=a159_0xfd9dce;if(typeof Response===_0x41d67d(0x12c))return()=>{};if(restoreResponseJsonParser)return restoreResponseJsonParser;return responseJsonPrototype=Response[_0x41d67d(0x137)],originalResponseJsonDescriptor=Object[_0x41d67d(0x12e)](responseJsonPrototype,_0x41d67d(0x13f)),Object[_0x41d67d(0x13d)](responseJsonPrototype,'json',{...originalResponseJsonDescriptor??{'configurable':!![],'enumerable':![],'writable':!![]},'value':async function _0x2c5827(){const _0x339f70=_0x41d67d;return parseLosslessJson(await this[_0x339f70(0x134)]());}}),restoreResponseJsonParser=()=>{const _0x23c350=_0x41d67d;if(!responseJsonPrototype)return;originalResponseJsonDescriptor?Object[_0x23c350(0x13d)](responseJsonPrototype,_0x23c350(0x13f),originalResponseJsonDescriptor):delete responseJsonPrototype[_0x23c350(0x13f)],responseJsonPrototype=undefined,originalResponseJsonDescriptor=undefined,restoreResponseJsonParser=undefined;},restoreResponseJsonParser;}export function restoreLosslessJsonResponseParser(){restoreResponseJsonParser?.();}
|
package/lib/utils/params.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a160_0x422c(_0x448dc0,_0x36617e){_0x448dc0=_0x448dc0-0x143;const _0x5f5437=a160_0x5f54();let _0x422cc7=_0x5f5437[_0x448dc0];return _0x422cc7;}(function(_0x35b0a7,_0x2f314b){const _0x4bb941=a160_0x422c,_0x2deadc=_0x35b0a7();while(!![]){try{const _0x5988ff=parseInt(_0x4bb941(0x15e))/0x1+-parseInt(_0x4bb941(0x145))/0x2*(-parseInt(_0x4bb941(0x14b))/0x3)+-parseInt(_0x4bb941(0x147))/0x4+-parseInt(_0x4bb941(0x15b))/0x5*(parseInt(_0x4bb941(0x154))/0x6)+parseInt(_0x4bb941(0x15f))/0x7*(parseInt(_0x4bb941(0x152))/0x8)+-parseInt(_0x4bb941(0x158))/0x9*(parseInt(_0x4bb941(0x14c))/0xa)+-parseInt(_0x4bb941(0x156))/0xb*(parseInt(_0x4bb941(0x144))/0xc);if(_0x5988ff===_0x2f314b)break;else _0x2deadc['push'](_0x2deadc['shift']());}catch(_0x4b6ce5){_0x2deadc['push'](_0x2deadc['shift']());}}}(a160_0x5f54,0x34f5c));import{CliErrors}from'../errors.js';import{parseLosslessJson}from'../utils/lossless-json.js';export const MAX_DATA_UPDATE_IDS=0x3e8;export function parseJsonParams(_0xa64d6a){const _0x324a2e=a160_0x422c;if(!_0xa64d6a)return undefined;try{return parseLosslessJson(_0xa64d6a);}catch{throw CliErrors[_0x324a2e(0x150)](_0x324a2e(0x153)+_0xa64d6a);}}function a160_0x5f54(){const _0xa3b67a=['number','27gJLgSQ','50IPFelY','isSafeInteger','Example:\x20--params\x20\x27{\x22id\x22:[1,2,3],\x22status\x22:\x22done\x22}\x27','batchCreate\x20--params\x20must\x20be\x20a\x20JSON\x20array\x20or\x20{\x22items\x22:[...]}','validation','data\x20update\x20can\x20update\x20at\x20most\x20','118008fUfhvW','Invalid\x20JSON\x20for\x20--params:\x20','12TSIGPp','data\x20update\x20--params\x20must\x20be\x20a\x20JSON\x20object\x20with\x20id.','11qcPJYC','test','285588BKiYYO','id[','items','14485fAOGRB','string','Example:\x20--params\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27','298386vnvshR','119oCHdAa','data\x20update\x20requires\x20\x22id\x22\x20in\x20--params.','isArray','data\x20update\x20--params.','object','data\x20update\x20id\x20array\x20cannot\x20be\x20empty.','\x20records\x20per\x20call;\x20received\x20','2289036zPFANW','15074WzWqIG','join','179420DwWZjP','length','map'];a160_0x5f54=function(){return _0xa3b67a;};return a160_0x5f54();}export function parseJsonParamsValue(_0x16745c){const _0x4bc5e1=a160_0x422c;if(!_0x16745c)return undefined;try{return parseLosslessJson(_0x16745c);}catch{throw CliErrors[_0x4bc5e1(0x150)](_0x4bc5e1(0x153)+_0x16745c);}}export function parseBatchCreateItemsFromParams(_0x44e74c){const _0x281ca7=a160_0x422c;if(Array[_0x281ca7(0x161)](_0x44e74c))return _0x44e74c;if(_0x44e74c!==null&&_0x44e74c!==undefined&&typeof _0x44e74c===_0x281ca7(0x163)&&Array[_0x281ca7(0x161)](_0x44e74c[_0x281ca7(0x15a)]))return _0x44e74c['items'];throw CliErrors[_0x281ca7(0x150)](_0x281ca7(0x14f),_0x281ca7(0x15d));}function parseDataUpdateId(_0x1516be,_0x3eace9){const _0x53be08=a160_0x422c;if(typeof _0x1516be===_0x53be08(0x14a)&&Number[_0x53be08(0x14d)](_0x1516be)&&_0x1516be>0x0)return _0x1516be;if(typeof _0x1516be===_0x53be08(0x15c)){if(/^[1-9]\d*$/[_0x53be08(0x157)](_0x1516be))return _0x1516be;}throw CliErrors[_0x53be08(0x150)](_0x53be08(0x162)+_0x3eace9+'\x20must\x20be\x20a\x20positive\x20integer\x20or\x20numeric\x20string.');}export function parseUpdateIdsFromParams(_0x44aec9){const _0x26f8ba=a160_0x422c;if(_0x44aec9===null||_0x44aec9===undefined||typeof _0x44aec9!==_0x26f8ba(0x163)||Array[_0x26f8ba(0x161)](_0x44aec9))throw CliErrors[_0x26f8ba(0x150)](_0x26f8ba(0x155),_0x26f8ba(0x14e));const _0x4ef47d=_0x44aec9['id'];if(_0x4ef47d===undefined||_0x4ef47d===null)throw CliErrors[_0x26f8ba(0x150)](_0x26f8ba(0x160),_0x26f8ba(0x14e));const _0xc710aa=Array['isArray'](_0x4ef47d)?_0x4ef47d:[_0x4ef47d];if(_0xc710aa[_0x26f8ba(0x148)]===0x0)throw CliErrors[_0x26f8ba(0x150)](_0x26f8ba(0x164));if(_0xc710aa[_0x26f8ba(0x148)]>MAX_DATA_UPDATE_IDS)throw CliErrors[_0x26f8ba(0x150)](_0x26f8ba(0x151)+MAX_DATA_UPDATE_IDS+_0x26f8ba(0x143)+_0xc710aa[_0x26f8ba(0x148)]+'.');return _0xc710aa[_0x26f8ba(0x149)]((_0x101ca4,_0x55faac)=>parseDataUpdateId(_0x101ca4,Array[_0x26f8ba(0x161)](_0x4ef47d)?_0x26f8ba(0x159)+_0x55faac+']':'id'));}export function normalizeUpdateParamsForRuntime(_0x48ba35,_0x24fdba){const _0x5e3b45=a160_0x422c;if(Array['isArray'](_0x48ba35['id'])&&_0x24fdba[_0x5e3b45(0x148)]>0x1)return{..._0x48ba35,'id':_0x24fdba[_0x5e3b45(0x146)](',')};return _0x48ba35;}
|