@lovrabet/lovrabet-cli 2.3.1 → 2.3.2-beta.2
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/README.md +10 -8
- 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.d.ts +1 -2
- 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.d.ts +0 -3
- 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.d.ts +2 -0
- 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.d.ts +6 -14
- package/lib/config/domain-config.js +1 -1
- package/lib/config/schema.d.ts +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 +0 -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 +5 -10
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/kb-search-client.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/preparse.js +1 -1
- package/lib/framework/rate-limit.js +1 -1
- package/lib/framework/raw-flags.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-confirmation.js +1 -1
- package/lib/framework/runner-error.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/service-order.js +1 -1
- package/lib/framework/types.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.d.ts +1 -5
- package/lib/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.d.ts +3 -7
- 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/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 +2 -1
- package/skills/lovrabet/SKILL.md +4 -4
- package/skills/lovrabet/guides/role-and-permission-workflow.md +6 -4
- package/skills/lovrabet/references/lovrabet-config-commands.md +7 -11
- package/skills/lovrabet/references/lovrabet-config.md +2 -3
- package/skills/lovrabet/references/lovrabet-doctor.md +1 -1
- package/skills/lovrabet/references/lovrabet-kb-workflow.md +1 -1
- package/skills/lovrabet/references/lovrabet-notification-config-list.md +2 -8
- package/skills/lovrabet.manifest.json +3 -3
- package/lib/utils/platform.d.ts +0 -17
- package/lib/utils/platform.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x11a292,_0x141eb6){const _0x4b4ca1=a143_0x5097,_0x197dab=_0x11a292();while(!![]){try{const _0x4054da=-parseInt(_0x4b4ca1(0x118))/0x1+-parseInt(_0x4b4ca1(0x121))/0x2*(-parseInt(_0x4b4ca1(0x116))/0x3)+parseInt(_0x4b4ca1(0x114))/0x4*(-parseInt(_0x4b4ca1(0x13a))/0x5)+-parseInt(_0x4b4ca1(0x13d))/0x6+-parseInt(_0x4b4ca1(0x111))/0x7+-parseInt(_0x4b4ca1(0x133))/0x8+-parseInt(_0x4b4ca1(0x13b))/0x9*(-parseInt(_0x4b4ca1(0x11e))/0xa);if(_0x4054da===_0x141eb6)break;else _0x197dab['push'](_0x197dab['shift']());}catch(_0x5e9bb5){_0x197dab['push'](_0x197dab['shift']());}}}(a143_0x2fcb,0x1af6f));import{readFileSync,readdirSync,realpathSync}from'node:fs';import{relative,resolve}from'node:path';import{CliErrors}from'../../errors.js';import{IGNORED_DIR_NAMES,IGNORED_FILE_NAMES,SKILL_FILE}from'./constants.js';function a143_0x5097(_0x2eb530,_0x9d70d0){_0x2eb530=_0x2eb530-0x111;const _0x2fcb7b=a143_0x2fcb();let _0x5097df=_0x2fcb7b[_0x2eb530];return _0x5097df;}export function fileContent(_0x3d9110){const _0x78c76d=a143_0x5097;return _0x3d9110[_0x78c76d(0x12c)]??Buffer[_0x78c76d(0x126)](_0x3d9110['content']??'',_0x78c76d(0x119));}export function fileText(_0x45dd7a){const _0x3c3c89=a143_0x5097;return fileContent(_0x45dd7a)[_0x3c3c89(0x11d)](_0x3c3c89(0x119));}export function normalizeLocalFiles(_0x471834){const _0x50c5b8=a143_0x5097;if(!Array[_0x50c5b8(0x12e)](_0x471834)||_0x471834[_0x50c5b8(0x132)]===0x0)return[];const _0x514600=new Map();for(const _0x51b919 of _0x471834){if(!_0x51b919||typeof _0x51b919!==_0x50c5b8(0x13c)||typeof _0x51b919[_0x50c5b8(0x130)]!==_0x50c5b8(0x124))throw CliErrors['validation'](_0x50c5b8(0x120));const _0x100512=normalizeSkillRelativePath(_0x51b919[_0x50c5b8(0x130)]);if(_0x514600[_0x50c5b8(0x122)](_0x100512))throw CliErrors[_0x50c5b8(0x11f)](_0x50c5b8(0x128)+_0x100512);if(_0x51b919[_0x50c5b8(0x12c)]!==undefined&&!Buffer[_0x50c5b8(0x138)](_0x51b919[_0x50c5b8(0x12c)]))throw CliErrors[_0x50c5b8(0x11f)]('Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20'+_0x100512);if(_0x51b919[_0x50c5b8(0x12c)]===undefined&&typeof _0x51b919['content']!==_0x50c5b8(0x124))throw CliErrors[_0x50c5b8(0x11f)](_0x50c5b8(0x11c)+_0x100512);const _0x49657e=fileContent(_0x51b919);_0x514600[_0x50c5b8(0x139)](_0x100512,{'path':_0x100512,'bytes':_0x49657e});}return Array[_0x50c5b8(0x126)](_0x514600[_0x50c5b8(0x12f)]())['sort'](compareSkillFiles);}export function normalizeManifestFiles(_0x17cb7f){const _0x3986ab=a143_0x5097;if(!Array['isArray'](_0x17cb7f)||_0x17cb7f['length']===0x0)return[];const _0x2ca3d6=new Map();for(const _0x544ca3 of _0x17cb7f){if(!_0x544ca3||typeof _0x544ca3!==_0x3986ab(0x13c)||typeof _0x544ca3[_0x3986ab(0x130)]!==_0x3986ab(0x124))throw CliErrors['validation'](_0x3986ab(0x120));const _0x50b9f2=normalizeSkillRelativePath(_0x544ca3[_0x3986ab(0x130)]);if(_0x2ca3d6['has'](_0x50b9f2))throw CliErrors[_0x3986ab(0x11f)]('Duplicate\x20Skill\x20file\x20path:\x20'+_0x50b9f2);if(!isSha256Hex(_0x544ca3['sha256']))throw CliErrors[_0x3986ab(0x11f)](_0x3986ab(0x11b)+_0x50b9f2);if(!Number[_0x3986ab(0x137)](_0x544ca3['size'])||_0x544ca3[_0x3986ab(0x12d)]<0x0)throw CliErrors[_0x3986ab(0x11f)](_0x3986ab(0x131)+_0x50b9f2);_0x2ca3d6['set'](_0x50b9f2,{'path':_0x50b9f2,'sha256':_0x544ca3[_0x3986ab(0x129)][_0x3986ab(0x113)](),'size':_0x544ca3[_0x3986ab(0x12d)]});}return Array[_0x3986ab(0x126)](_0x2ca3d6[_0x3986ab(0x12f)]())[_0x3986ab(0x125)](compareSkillFiles);}export function scanSkillDirectory(_0x14fb17,_0x171a53={}){const _0x11e36e=a143_0x5097,_0x422041=realpathSync(_0x14fb17),_0x3ea8b9=canonicalExcludedFilePaths(_0x171a53[_0x11e36e(0x13e)]),_0x4b0212=[];function _0x1eb793(_0x294ed0){const _0xf9e74c=_0x11e36e,_0x5e0a61=readdirSync(_0x294ed0,{'withFileTypes':!![]})[_0xf9e74c(0x125)]((_0xcee4aa,_0x5bf16c)=>_0xcee4aa['name'][_0xf9e74c(0x117)](_0x5bf16c['name']));for(const _0x448394 of _0x5e0a61){if(_0x448394[_0xf9e74c(0x12b)]()&&IGNORED_DIR_NAMES[_0xf9e74c(0x122)](_0x448394[_0xf9e74c(0x123)]))continue;if(IGNORED_FILE_NAMES[_0xf9e74c(0x122)](_0x448394[_0xf9e74c(0x123)]))continue;const _0x5d0190=resolve(_0x294ed0,_0x448394[_0xf9e74c(0x123)]);if(isExcludedFilePath(_0x5d0190,_0x3ea8b9))continue;if(_0x448394[_0xf9e74c(0x134)]())throw CliErrors[_0xf9e74c(0x11f)](_0xf9e74c(0x135)+_0x5d0190);const _0x1b76ca=toPosixPath(relative(_0x422041,_0x5d0190));if(_0x448394[_0xf9e74c(0x12b)]()){_0x1eb793(_0x5d0190);continue;}if(!_0x448394['isFile']())continue;validateSkillRelativePath(_0x1b76ca);const _0x572356=readFileSync(_0x5d0190);_0x4b0212[_0xf9e74c(0x115)]({'path':_0x1b76ca,'bytes':_0x572356});}}return _0x1eb793(_0x422041),normalizeLocalFiles(_0x4b0212);}function a143_0x2fcb(){const _0x2d60dc=['excludedFilePaths','450464tidmpV','split','toLowerCase','1340jNeFYW','push','648078qHtyBR','localeCompare','147620qzKiEI','utf8','test','Skill\x20file\x20sha256\x20is\x20invalid:\x20','Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20','toString','1672810aHpgAK','validation','Skill\x20file\x20path\x20must\x20be\x20text.','2cOpXLI','has','name','string','sort','from','add','Duplicate\x20Skill\x20file\x20path:\x20','sha256','includes','isDirectory','bytes','size','isArray','values','path','Skill\x20file\x20size\x20is\x20invalid:\x20','length','68824cJpHQI','isSymbolicLink','Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20','Unsafe\x20Skill\x20file\x20path:\x20','isSafeInteger','isBuffer','set','2155NuRuie','18rpxRlQ','object','451086HewOKK'];a143_0x2fcb=function(){return _0x2d60dc;};return a143_0x2fcb();}function canonicalExcludedFilePaths(_0x216790){const _0x15b362=a143_0x5097,_0x4ac033=new Set();for(const _0xb16ec8 of _0x216790??[]){const _0x21cbfe=resolve(_0xb16ec8);_0x4ac033[_0x15b362(0x127)](_0x21cbfe);try{_0x4ac033[_0x15b362(0x127)](realpathSync(_0x21cbfe));}catch{}}return _0x4ac033;}function isExcludedFilePath(_0x5f1203,_0x483498){const _0x5236ee=a143_0x5097;if(_0x483498[_0x5236ee(0x122)](_0x5f1203))return!![];if(_0x483498[_0x5236ee(0x12d)]===0x0)return![];try{return _0x483498[_0x5236ee(0x122)](realpathSync(_0x5f1203));}catch{return![];}}export function compareSkillFiles(_0x1dcd5a,_0x11d179){const _0x35e2ac=a143_0x5097;if(_0x1dcd5a['path']===SKILL_FILE)return _0x11d179['path']===SKILL_FILE?0x0:-0x1;if(_0x11d179[_0x35e2ac(0x130)]===SKILL_FILE)return 0x1;return Buffer['compare'](Buffer[_0x35e2ac(0x126)](_0x1dcd5a['path'],'utf8'),Buffer['from'](_0x11d179[_0x35e2ac(0x130)],_0x35e2ac(0x119)));}export function normalizeSkillRelativePath(_0x13504c){const _0x2fbb5a=toPosixPath(_0x13504c['trim']());return validateSkillRelativePath(_0x2fbb5a),_0x2fbb5a;}export function validateSkillRelativePath(_0x3cf2f8){const _0x2948be=a143_0x5097;if(!_0x3cf2f8||_0x3cf2f8['startsWith']('/')||_0x3cf2f8[_0x2948be(0x12a)]('//'))throw CliErrors['validation'](_0x2948be(0x136)+_0x3cf2f8);for(const _0x43d124 of _0x3cf2f8[_0x2948be(0x112)]('/')){if(!_0x43d124||_0x43d124==='.'||_0x43d124==='..')throw CliErrors[_0x2948be(0x11f)](_0x2948be(0x136)+_0x3cf2f8);}}export function toPosixPath(_0xeddce8){return _0xeddce8['replace'](/\\/g,'/');}export function isSha256Hex(_0x23206a){const _0x175825=a143_0x5097;return typeof _0x23206a===_0x175825(0x124)&&/^[a-fA-F0-9]{64}$/[_0x175825(0x11a)](_0x23206a);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x4c43f0,_0x12ac2c){const _0x8daaeb=a144_0x2c2d,_0xa6e7ec=_0x4c43f0();while(!![]){try{const _0x1b9b8c=parseInt(_0x8daaeb(0x13e))/0x1*(-parseInt(_0x8daaeb(0x150))/0x2)+-parseInt(_0x8daaeb(0x149))/0x3+-parseInt(_0x8daaeb(0x14a))/0x4+parseInt(_0x8daaeb(0x151))/0x5*(-parseInt(_0x8daaeb(0x13a))/0x6)+parseInt(_0x8daaeb(0x122))/0x7*(parseInt(_0x8daaeb(0x125))/0x8)+parseInt(_0x8daaeb(0x126))/0x9*(-parseInt(_0x8daaeb(0x136))/0xa)+parseInt(_0x8daaeb(0x134))/0xb;if(_0x1b9b8c===_0x12ac2c)break;else _0xa6e7ec['push'](_0xa6e7ec['shift']());}catch(_0x3c454e){_0xa6e7ec['push'](_0xa6e7ec['shift']());}}}(a144_0x5a2c,0x63747));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';import{getRuntimeSkillDir}from'./paths.js';import{extractDownloadedPackage,requirePackageBytes}from'./zip-package.js';export function materializeRuntimeSkill(_0x4bebf6,_0x4a3ed3,_0x2aee2a){const _0x5ad10d=a144_0x2c2d,_0x1063c6=requireSkillCode(_0x4bebf6),_0x27294b=requirePackageBytes(_0x1063c6,_0x2aee2a[_0x5ad10d(0x14d)]),_0x426f6c=extractDownloadedPackage(_0x27294b),_0x5adb52=_0x426f6c[_0x5ad10d(0x14f)](_0x218f24=>_0x218f24[_0x5ad10d(0x144)]===SKILL_FILE);if(!_0x5adb52)throw CliErrors[_0x5ad10d(0x138)](_0x5ad10d(0x124)+SKILL_FILE+':\x20'+_0x1063c6);const _0x493139=withMaterializedSkillFrontmatter(_0x426f6c,_0x4bebf6,_0x1063c6),_0xaae761=_0x493139['find'](_0x1381b0=>_0x1381b0[_0x5ad10d(0x144)]===SKILL_FILE),_0x56ca41=fileText(_0xaae761),_0x25b17f=getRuntimeSkillDir(_0x2aee2a[_0x5ad10d(0x129)],_0x2aee2a[_0x5ad10d(0x118)],_0x2aee2a[_0x5ad10d(0x11d)],_0x4a3ed3,_0x1063c6,_0x2aee2a[_0x5ad10d(0x11b)]),_0x2f80ec=resolve(_0x25b17f,SKILL_FILE),_0x179162=resolve(_0x25b17f,METADATA_FILE),_0x1c1c7b=contentHash(_0x56ca41),_0x5e95be=readMetadataIfPresent(_0x179162)?.[_0x5ad10d(0x12c)];ensurePulledFilesCanBeOverwritten(_0x25b17f,_0x179162,_0x493139,_0x2aee2a[_0x5ad10d(0x133)]===!![]),mkdirSync(_0x25b17f,{'recursive':!![],'mode':0x1c0});const _0x26cc42=existsSync(_0x2f80ec)?readFileSync(_0x2f80ec,_0x5ad10d(0x12e)):undefined;return materializeFiles(_0x25b17f,_0x493139),removeStaleManagedFiles(_0x25b17f,_0x5e95be,_0x493139),writeJsonAtomic(_0x179162,buildMetadata(_0x4bebf6,_0x4a3ed3,_0x2aee2a[_0x5ad10d(0x11d)],_0x1c1c7b,_0x2aee2a['pulledAt'],_0x493139,_0x27294b)),{'skill':_0x4bebf6,'scope':_0x4a3ed3,'dir':_0x25b17f,'skillMdPath':_0x2f80ec,'metadataPath':_0x179162,'contentHash':_0x1c1c7b,'changed':_0x26cc42!==_0x56ca41};}export function reuseMaterializedRuntimeSkill(_0x277d6d,_0x4eb49c,_0x1427ac){const _0x5ee0bc=a144_0x2c2d,_0x3867ad=_0x277d6d[_0x5ee0bc(0x137)]?.[_0x5ee0bc(0x115)]();if(!_0x3867ad)return undefined;const _0x4558fb=requireSkillCode(_0x277d6d),_0xb1e7df=getRuntimeSkillDir(_0x1427ac['env'],_0x1427ac[_0x5ee0bc(0x118)],_0x1427ac[_0x5ee0bc(0x11d)],_0x4eb49c,_0x4558fb,_0x1427ac['paths']),_0x2799b5=resolve(_0xb1e7df,SKILL_FILE),_0x5aca82=resolve(_0xb1e7df,METADATA_FILE),_0x12a785=readMetadataIfPresent(_0x5aca82);if(!_0x12a785||_0x12a785[_0x5ee0bc(0x143)]!==0x2||_0x12a785['appCode']!==_0x1427ac[_0x5ee0bc(0x11d)]||_0x12a785[_0x5ee0bc(0x13f)]!==_0x4eb49c||_0x12a785[_0x5ee0bc(0x11e)]!==_0x4558fb||_0x12a785[_0x5ee0bc(0x137)]!==_0x3867ad||_0x12a785['id']!==_0x277d6d['id']||_0x12a785[_0x5ee0bc(0x142)]!==_0x277d6d[_0x5ee0bc(0x142)]||_0x12a785['description']!==_0x277d6d[_0x5ee0bc(0x147)]||_0x12a785[_0x5ee0bc(0x121)]!==_0x277d6d[_0x5ee0bc(0x121)]||_0x12a785['status']!==_0x277d6d[_0x5ee0bc(0x11a)]||!_0x12a785[_0x5ee0bc(0x131)]||!_0x12a785['fileHashes']||!Object[_0x5ee0bc(0x12b)](_0x12a785['fileHashes'],SKILL_FILE))return undefined;for(const [_0x8ca30a,_0x262e3e]of Object[_0x5ee0bc(0x128)](_0x12a785[_0x5ee0bc(0x12c)])){if(!/^[a-f0-9]{64}$/['test'](_0x262e3e))return undefined;const _0x2d9425=resolveManagedFilePath(_0xb1e7df,_0x8ca30a);if(!existsSync(_0x2d9425)||!lstatSync(_0x2d9425)[_0x5ee0bc(0x11f)]())return undefined;if(bufferSha256(readFileSync(_0x2d9425))!==_0x262e3e)return undefined;}return{'skill':_0x277d6d,'scope':_0x4eb49c,'dir':_0xb1e7df,'skillMdPath':_0x2799b5,'metadataPath':_0x5aca82,'contentHash':_0x12a785[_0x5ee0bc(0x131)],'changed':![]};}function withMaterializedSkillFrontmatter(_0x235e52,_0x62a721,_0x2e28c4){const _0x282203=a144_0x2c2d,_0x541940=skillDisplayName(_0x62a721,_0x2e28c4),_0xb06b6a=_0x62a721[_0x282203(0x147)]?.[_0x282203(0x115)]()||_0x541940||_0x2e28c4;return normalizeLocalFiles(_0x235e52)[_0x282203(0x13b)](_0x457268=>{const _0x58f061=_0x282203,_0x2b4dc2=fileText(_0x457268);if(_0x457268[_0x58f061(0x144)]!==SKILL_FILE)return _0x457268;if(hasYamlFrontmatter(_0x2b4dc2))return{'path':_0x457268[_0x58f061(0x144)],'content':withSyncedDisplayName(_0x2b4dc2,_0x541940)};return{'path':_0x457268['path'],'content':prependSkillFrontmatter(_0x2b4dc2,{'name':_0x2e28c4,'displayName':_0x541940,'description':_0xb06b6a})};});}function a144_0x2c2d(_0x102f33,_0x482157){_0x102f33=_0x102f33-0x115;const _0x5a2ce9=a144_0x5a2c();let _0x2c2d8d=_0x5a2ce9[_0x102f33];return _0x2c2d8d;}function hasYamlFrontmatter(_0xf0541f){const _0x34ebf0=a144_0x2c2d;return/^\uFEFF?---\s*\r?\n/[_0x34ebf0(0x14c)](_0xf0541f);}function prependSkillFrontmatter(_0x5aae5b,_0x366a06){const _0x402b0d=a144_0x2c2d,_0x4ef1c3=_0x5aae5b[_0x402b0d(0x141)](/^\uFEFF/,'');return[_0x402b0d(0x130),_0x402b0d(0x13c)+yamlString(_0x366a06[_0x402b0d(0x12f)]),_0x366a06[_0x402b0d(0x12d)]?'displayName:\x20'+yamlString(_0x366a06[_0x402b0d(0x12d)]):undefined,_0x402b0d(0x148)+yamlString(_0x366a06['description']),_0x402b0d(0x130),'',_0x4ef1c3][_0x402b0d(0x14e)](_0x5b30c2=>_0x5b30c2!==undefined)['join']('\x0a');}function a144_0x5a2c(){const _0xe67ae4=['1119321VctGLH','1340920XqGMcf','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','test','packageBytes','filter','find','620714wOyAkZ','48755rVGLXO','trim','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','errors','accessKey','slice','status','paths','match','appCode','skillCode','isFile','Managed\x20file\x20was\x20removed\x20locally:\x20','example','204253TQKBDG','Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20','Runtime\x20Skill\x20package\x20is\x20missing\x20','128MoriDv','27qSXyFJ','flow','entries','env','set','hasOwn','fileHashes','displayName','utf8','name','---','contentHash','---\x0a','force','23161325asKElT','keys','2553630jLqirt','version','validation','stringify','234OVMdcZ','map','name:\x20','toString','1KJpOKa','scope','Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20','replace','skillName','schemaVersion','path','\x0a---\x0a\x0a','length','description','description:\x20'];a144_0x5a2c=function(){return _0xe67ae4;};return a144_0x5a2c();}function yamlString(_0x37e2a4){const _0x50918f=a144_0x2c2d;return JSON[_0x50918f(0x139)](_0x37e2a4[_0x50918f(0x141)](/\r/g,'')[_0x50918f(0x115)]());}function skillDisplayName(_0x2ff49e,_0x59e91b){const _0x34d7d2=a144_0x2c2d,_0x45ec62=_0x2ff49e['skillName']?.[_0x34d7d2(0x115)]();return _0x45ec62||_0x59e91b;}function withSyncedDisplayName(_0x1db2c9,_0x4223a8){const _0x5db6c2=a144_0x2c2d,_0x54e128=_0x1db2c9[_0x5db6c2(0x11c)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x54e128)return _0x1db2c9;const _0x29b739=_0x54e128[0x1]??'',_0x3bbfaa=_0x54e128[0x2]??'',_0x2ee480=parseDocument(_0x3bbfaa);if(_0x2ee480[_0x5db6c2(0x117)][_0x5db6c2(0x146)]>0x0||!isMap(_0x2ee480['contents']))return _0x1db2c9;if(_0x4223a8)_0x2ee480[_0x5db6c2(0x12a)](_0x5db6c2(0x12d),_0x4223a8);else{if(_0x2ee480['has'](_0x5db6c2(0x12d)))_0x2ee480['delete'](_0x5db6c2(0x12d));else return _0x1db2c9;}forceBlockCollections(_0x2ee480['contents']);const _0xad974=_0x2ee480[_0x5db6c2(0x13d)]({'lineWidth':0x0})['trimEnd'](),_0x12125b=_0x1db2c9[_0x5db6c2(0x119)](_0x54e128[0x0][_0x5db6c2(0x146)])[_0x5db6c2(0x141)](/^\r?\n/,'');return _0x29b739+_0x5db6c2(0x132)+_0xad974+_0x5db6c2(0x145)+_0x12125b;}function forceBlockCollections(_0x422b6f){if(!isNode(_0x422b6f))return;visit(_0x422b6f,(_0x229dc9,_0x3ed4c0)=>{const _0x4f454a=a144_0x2c2d;isCollection(_0x3ed4c0)&&(_0x3ed4c0[_0x4f454a(0x127)]=![]);});}function ensurePulledFilesCanBeOverwritten(_0x4ad514,_0x524177,_0x5d4559,_0x3241d8){const _0x54e7e7=a144_0x2c2d;if(_0x3241d8||!existsSync(_0x524177))return;const _0x4f2bfd=readMetadataIfPresent(_0x524177);if(!_0x4f2bfd)return;const _0x11be9d=_0x4f2bfd[_0x54e7e7(0x12c)]&&Object[_0x54e7e7(0x135)](_0x4f2bfd['fileHashes'])['length']>0x0?_0x4f2bfd[_0x54e7e7(0x12c)]:undefined;if(_0x11be9d)for(const [_0x23f0a4,_0x280ab5]of Object['entries'](_0x11be9d)){const _0x222437=resolveManagedFilePath(_0x4ad514,_0x23f0a4);if(!existsSync(_0x222437))throw CliErrors[_0x54e7e7(0x138)](_0x54e7e7(0x116)+_0x4ad514,_0x54e7e7(0x120)+_0x23f0a4);const _0x7442ee=lstatSync(_0x222437);if(!_0x7442ee[_0x54e7e7(0x11f)]())throw CliErrors[_0x54e7e7(0x138)](_0x54e7e7(0x116)+_0x4ad514,_0x54e7e7(0x123)+_0x23f0a4);const _0x475b02=bufferSha256(readFileSync(_0x222437));if(_0x475b02!==_0x280ab5)throw CliErrors[_0x54e7e7(0x138)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x4ad514+'.\x20Changed\x20file:\x20'+_0x23f0a4,'Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20'+_0x23f0a4);}else{const _0x17831a=resolve(_0x4ad514,SKILL_FILE);if(existsSync(_0x17831a)&&_0x4f2bfd[_0x54e7e7(0x131)]){const _0x521910=contentHash(readFileSync(_0x17831a,_0x54e7e7(0x12e)));if(_0x521910!==_0x4f2bfd[_0x54e7e7(0x131)])throw CliErrors[_0x54e7e7(0x138)](_0x54e7e7(0x14b)+_0x17831a,'Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.');}}for(const _0x18f6e6 of normalizeLocalFiles(_0x5d4559)){if(_0x11be9d?.[_0x18f6e6[_0x54e7e7(0x144)]])continue;if(!_0x11be9d&&_0x18f6e6[_0x54e7e7(0x144)]===SKILL_FILE)continue;const _0x471b49=resolveManagedFilePath(_0x4ad514,_0x18f6e6[_0x54e7e7(0x144)]);if(!existsSync(_0x471b49))continue;const _0x47519a=lstatSync(_0x471b49);if(!_0x47519a[_0x54e7e7(0x11f)]())throw CliErrors[_0x54e7e7(0x138)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x4ad514,'Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20'+_0x18f6e6[_0x54e7e7(0x144)]);const _0xc15738=bufferSha256(readFileSync(_0x471b49));if(_0xc15738!==fileHash(_0x18f6e6))throw CliErrors[_0x54e7e7(0x138)](_0x54e7e7(0x116)+_0x4ad514,_0x54e7e7(0x140)+_0x18f6e6[_0x54e7e7(0x144)]);}}function materializeFiles(_0x282c44,_0x5af415){const _0x14f084=a144_0x2c2d;for(const _0x48cf72 of normalizeLocalFiles(_0x5af415)){const _0x1cda63=resolveManagedFilePath(_0x282c44,_0x48cf72[_0x14f084(0x144)]);mkdirSync(dirname(_0x1cda63),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x1cda63,fileContent(_0x48cf72),0x180);}}function removeStaleManagedFiles(_0x338d91,_0x3044f3,_0x324fa6){const _0x397902=a144_0x2c2d;if(!_0x3044f3)return;const _0x2a642a=new Set(normalizeLocalFiles(_0x324fa6)[_0x397902(0x13b)](_0x8f8e3e=>_0x8f8e3e['path']));for(const _0x15d01c of Object[_0x397902(0x135)](_0x3044f3)){if(_0x2a642a['has'](_0x15d01c))continue;const _0x4f9ff3=resolveManagedFilePath(_0x338d91,_0x15d01c);existsSync(_0x4f9ff3)&&lstatSync(_0x4f9ff3)[_0x397902(0x11f)]()&&rmSync(_0x4f9ff3,{'force':!![]});}}
|
|
1
|
+
(function(_0x377478,_0x1fea2f){const _0x5b3b89=a144_0xa471,_0x2882de=_0x377478();while(!![]){try{const _0x270d19=parseInt(_0x5b3b89(0x1e2))/0x1*(-parseInt(_0x5b3b89(0x1d7))/0x2)+parseInt(_0x5b3b89(0x1ed))/0x3*(parseInt(_0x5b3b89(0x1fd))/0x4)+-parseInt(_0x5b3b89(0x1cd))/0x5+-parseInt(_0x5b3b89(0x1de))/0x6*(parseInt(_0x5b3b89(0x1d8))/0x7)+-parseInt(_0x5b3b89(0x1ca))/0x8*(parseInt(_0x5b3b89(0x1d3))/0x9)+-parseInt(_0x5b3b89(0x1e8))/0xa*(-parseInt(_0x5b3b89(0x1f0))/0xb)+parseInt(_0x5b3b89(0x1cb))/0xc*(parseInt(_0x5b3b89(0x1e9))/0xd);if(_0x270d19===_0x1fea2f)break;else _0x2882de['push'](_0x2882de['shift']());}catch(_0x3b6b89){_0x2882de['push'](_0x2882de['shift']());}}}(a144_0x5593,0x64cd0));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';import{getRuntimeSkillDir}from'./paths.js';function a144_0xa471(_0x70f290,_0x3eca7a){_0x70f290=_0x70f290-0x1c7;const _0x55939d=a144_0x5593();let _0xa47114=_0x55939d[_0x70f290];return _0xa47114;}import{extractDownloadedPackage,requirePackageBytes}from'./zip-package.js';export function materializeRuntimeSkill(_0x3dc8c7,_0x1878f7,_0x1e9a06){const _0x4c4057=a144_0xa471,_0x712a2a=requireSkillCode(_0x3dc8c7),_0xaebe1c=requirePackageBytes(_0x712a2a,_0x1e9a06['packageBytes']),_0x5b5cde=extractDownloadedPackage(_0xaebe1c),_0xee5873=_0x5b5cde[_0x4c4057(0x1df)](_0x4a4861=>_0x4a4861[_0x4c4057(0x1f3)]===SKILL_FILE);if(!_0xee5873)throw CliErrors[_0x4c4057(0x1ec)](_0x4c4057(0x1dd)+SKILL_FILE+':\x20'+_0x712a2a);const _0x353d88=withMaterializedSkillFrontmatter(_0x5b5cde,_0x3dc8c7,_0x712a2a),_0x2acc4a=_0x353d88[_0x4c4057(0x1df)](_0x292b94=>_0x292b94[_0x4c4057(0x1f3)]===SKILL_FILE),_0x4e9036=fileText(_0x2acc4a),_0x5a4678=getRuntimeSkillDir(_0x1e9a06[_0x4c4057(0x1f1)],_0x1e9a06['accessKey'],_0x1e9a06[_0x4c4057(0x1c9)],_0x1878f7,_0x712a2a,_0x1e9a06[_0x4c4057(0x1f4)]),_0x2ad7c7=resolve(_0x5a4678,SKILL_FILE),_0x2d9541=resolve(_0x5a4678,METADATA_FILE),_0x3dd2c9=contentHash(_0x4e9036),_0x47404d=readMetadataIfPresent(_0x2d9541)?.[_0x4c4057(0x1e6)];ensurePulledFilesCanBeOverwritten(_0x5a4678,_0x2d9541,_0x353d88,_0x1e9a06['force']===!![]),mkdirSync(_0x5a4678,{'recursive':!![],'mode':0x1c0});const _0x59b8ea=existsSync(_0x2ad7c7)?readFileSync(_0x2ad7c7,_0x4c4057(0x1f2)):undefined;return materializeFiles(_0x5a4678,_0x353d88),removeStaleManagedFiles(_0x5a4678,_0x47404d,_0x353d88),writeJsonAtomic(_0x2d9541,buildMetadata(_0x3dc8c7,_0x1878f7,_0x1e9a06[_0x4c4057(0x1c9)],_0x3dd2c9,_0x1e9a06['pulledAt'],_0x353d88,_0xaebe1c)),{'skill':_0x3dc8c7,'scope':_0x1878f7,'dir':_0x5a4678,'skillMdPath':_0x2ad7c7,'metadataPath':_0x2d9541,'contentHash':_0x3dd2c9,'changed':_0x59b8ea!==_0x4e9036};}function a144_0x5593(){const _0x276e94=['length','delete','472baaPIl','match','keys','test','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.','description','join','status','Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20','\x0a---\x0a\x0a','hasOwn','appCode','120gggdhK','19092xclSBk','schemaVersion','1628175cXBYXJ','trim','---','isFile','---\x0a','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','48294dohICm','displayName:\x20','trimEnd','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','693790iOPyrn','4683147XHfJgv','has','example','description:\x20','replace','Runtime\x20Skill\x20package\x20is\x20missing\x20','6xAeYlp','find','contentHash','accessKey','2iEogqR','skillName','slice','version','fileHashes','name','1065640xJECPn','11596lWcIUf','toString','displayName','validation','16680UhHnlR','scope','set','11VzVxIo','env','utf8','path','paths','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','name:\x20','stringify','flow','Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20','filter'];a144_0x5593=function(){return _0x276e94;};return a144_0x5593();}export function reuseMaterializedRuntimeSkill(_0x2d90b0,_0x388ae7,_0x1f9f4d){const _0x29d4a0=a144_0xa471,_0x194034=_0x2d90b0['version']?.[_0x29d4a0(0x1ce)]();if(!_0x194034)return undefined;const _0x219371=requireSkillCode(_0x2d90b0),_0x558a52=getRuntimeSkillDir(_0x1f9f4d['env'],_0x1f9f4d[_0x29d4a0(0x1e1)],_0x1f9f4d[_0x29d4a0(0x1c9)],_0x388ae7,_0x219371,_0x1f9f4d['paths']),_0x461729=resolve(_0x558a52,SKILL_FILE),_0x593cdb=resolve(_0x558a52,METADATA_FILE),_0x5ac551=readMetadataIfPresent(_0x593cdb);if(!_0x5ac551||_0x5ac551[_0x29d4a0(0x1cc)]!==0x2||_0x5ac551[_0x29d4a0(0x1c9)]!==_0x1f9f4d['appCode']||_0x5ac551[_0x29d4a0(0x1ee)]!==_0x388ae7||_0x5ac551['skillCode']!==_0x219371||_0x5ac551[_0x29d4a0(0x1e5)]!==_0x194034||_0x5ac551['id']!==_0x2d90b0['id']||_0x5ac551[_0x29d4a0(0x1e3)]!==_0x2d90b0[_0x29d4a0(0x1e3)]||_0x5ac551['description']!==_0x2d90b0['description']||_0x5ac551[_0x29d4a0(0x1da)]!==_0x2d90b0[_0x29d4a0(0x1da)]||_0x5ac551[_0x29d4a0(0x204)]!==_0x2d90b0[_0x29d4a0(0x204)]||!_0x5ac551[_0x29d4a0(0x1e0)]||!_0x5ac551[_0x29d4a0(0x1e6)]||!Object[_0x29d4a0(0x1c8)](_0x5ac551[_0x29d4a0(0x1e6)],SKILL_FILE))return undefined;for(const [_0x52404d,_0x5eabe9]of Object['entries'](_0x5ac551[_0x29d4a0(0x1e6)])){if(!/^[a-f0-9]{64}$/[_0x29d4a0(0x200)](_0x5eabe9))return undefined;const _0x4e87b9=resolveManagedFilePath(_0x558a52,_0x52404d);if(!existsSync(_0x4e87b9)||!lstatSync(_0x4e87b9)[_0x29d4a0(0x1d0)]())return undefined;if(bufferSha256(readFileSync(_0x4e87b9))!==_0x5eabe9)return undefined;}return{'skill':_0x2d90b0,'scope':_0x388ae7,'dir':_0x558a52,'skillMdPath':_0x461729,'metadataPath':_0x593cdb,'contentHash':_0x5ac551[_0x29d4a0(0x1e0)],'changed':![]};}function withMaterializedSkillFrontmatter(_0x4f6264,_0x1856fb,_0x11a307){const _0x3f331f=a144_0xa471,_0xd47f36=skillDisplayName(_0x1856fb,_0x11a307),_0x120ae7=_0x1856fb['description']?.[_0x3f331f(0x1ce)]()||_0xd47f36||_0x11a307;return normalizeLocalFiles(_0x4f6264)['map'](_0x3c6f26=>{const _0x6296c5=fileText(_0x3c6f26);if(_0x3c6f26['path']!==SKILL_FILE)return _0x3c6f26;if(hasYamlFrontmatter(_0x6296c5))return{'path':_0x3c6f26['path'],'content':withSyncedDisplayName(_0x6296c5,_0xd47f36)};return{'path':_0x3c6f26['path'],'content':prependSkillFrontmatter(_0x6296c5,{'name':_0x11a307,'displayName':_0xd47f36,'description':_0x120ae7})};});}function hasYamlFrontmatter(_0x1ca4ed){const _0x3e3bb2=a144_0xa471;return/^\uFEFF?---\s*\r?\n/[_0x3e3bb2(0x200)](_0x1ca4ed);}function prependSkillFrontmatter(_0x1f7f8f,_0x16f227){const _0xb174e7=a144_0xa471,_0x3fd64c=_0x1f7f8f[_0xb174e7(0x1dc)](/^\uFEFF/,'');return[_0xb174e7(0x1cf),_0xb174e7(0x1f6)+yamlString(_0x16f227[_0xb174e7(0x1e7)]),_0x16f227[_0xb174e7(0x1eb)]?_0xb174e7(0x1d4)+yamlString(_0x16f227['displayName']):undefined,_0xb174e7(0x1db)+yamlString(_0x16f227[_0xb174e7(0x202)]),_0xb174e7(0x1cf),'',_0x3fd64c][_0xb174e7(0x1fa)](_0x347140=>_0x347140!==undefined)[_0xb174e7(0x203)]('\x0a');}function yamlString(_0x2b5b3e){const _0x24ef05=a144_0xa471;return JSON[_0x24ef05(0x1f7)](_0x2b5b3e['replace'](/\r/g,'')[_0x24ef05(0x1ce)]());}function skillDisplayName(_0x141221,_0x4db976){const _0x5660b5=a144_0xa471,_0x41c84b=_0x141221[_0x5660b5(0x1e3)]?.[_0x5660b5(0x1ce)]();return _0x41c84b||_0x4db976;}function withSyncedDisplayName(_0x391b78,_0x2cd503){const _0x4725a7=a144_0xa471,_0x1eb31e=_0x391b78[_0x4725a7(0x1fe)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x1eb31e)return _0x391b78;const _0xaa016e=_0x1eb31e[0x1]??'',_0x1ba58d=_0x1eb31e[0x2]??'',_0x4403bf=parseDocument(_0x1ba58d);if(_0x4403bf['errors'][_0x4725a7(0x1fb)]>0x0||!isMap(_0x4403bf['contents']))return _0x391b78;if(_0x2cd503)_0x4403bf[_0x4725a7(0x1ef)](_0x4725a7(0x1eb),_0x2cd503);else{if(_0x4403bf['has']('displayName'))_0x4403bf[_0x4725a7(0x1fc)](_0x4725a7(0x1eb));else return _0x391b78;}forceBlockCollections(_0x4403bf['contents']);const _0x3d1d77=_0x4403bf[_0x4725a7(0x1ea)]({'lineWidth':0x0})[_0x4725a7(0x1d5)](),_0x17b2d8=_0x391b78[_0x4725a7(0x1e4)](_0x1eb31e[0x0][_0x4725a7(0x1fb)])[_0x4725a7(0x1dc)](/^\r?\n/,'');return _0xaa016e+_0x4725a7(0x1d1)+_0x3d1d77+_0x4725a7(0x1c7)+_0x17b2d8;}function forceBlockCollections(_0x507f49){if(!isNode(_0x507f49))return;visit(_0x507f49,(_0x1f7a18,_0x3e3b7c)=>{const _0x446f37=a144_0xa471;isCollection(_0x3e3b7c)&&(_0x3e3b7c[_0x446f37(0x1f8)]=![]);});}function ensurePulledFilesCanBeOverwritten(_0x560e7a,_0xbddb66,_0x13e349,_0x1a34db){const _0x37b90d=a144_0xa471;if(_0x1a34db||!existsSync(_0xbddb66))return;const _0xb4324c=readMetadataIfPresent(_0xbddb66);if(!_0xb4324c)return;const _0x128567=_0xb4324c[_0x37b90d(0x1e6)]&&Object['keys'](_0xb4324c[_0x37b90d(0x1e6)])[_0x37b90d(0x1fb)]>0x0?_0xb4324c[_0x37b90d(0x1e6)]:undefined;if(_0x128567)for(const [_0x12e9cc,_0x24175d]of Object['entries'](_0x128567)){const _0x43f44b=resolveManagedFilePath(_0x560e7a,_0x12e9cc);if(!existsSync(_0x43f44b))throw CliErrors[_0x37b90d(0x1ec)](_0x37b90d(0x1d6)+_0x560e7a,'Managed\x20file\x20was\x20removed\x20locally:\x20'+_0x12e9cc);const _0x3f385e=lstatSync(_0x43f44b);if(!_0x3f385e[_0x37b90d(0x1d0)]())throw CliErrors['validation'](_0x37b90d(0x1d6)+_0x560e7a,_0x37b90d(0x205)+_0x12e9cc);const _0x2524b3=bufferSha256(readFileSync(_0x43f44b));if(_0x2524b3!==_0x24175d)throw CliErrors['validation'](_0x37b90d(0x1d6)+_0x560e7a+'.\x20Changed\x20file:\x20'+_0x12e9cc,_0x37b90d(0x1d2)+_0x12e9cc);}else{const _0x3c04d4=resolve(_0x560e7a,SKILL_FILE);if(existsSync(_0x3c04d4)&&_0xb4324c['contentHash']){const _0x1f2383=contentHash(readFileSync(_0x3c04d4,_0x37b90d(0x1f2)));if(_0x1f2383!==_0xb4324c[_0x37b90d(0x1e0)])throw CliErrors[_0x37b90d(0x1ec)]('Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20'+_0x3c04d4,_0x37b90d(0x201));}}for(const _0x15090f of normalizeLocalFiles(_0x13e349)){if(_0x128567?.[_0x15090f[_0x37b90d(0x1f3)]])continue;if(!_0x128567&&_0x15090f[_0x37b90d(0x1f3)]===SKILL_FILE)continue;const _0x55dd16=resolveManagedFilePath(_0x560e7a,_0x15090f[_0x37b90d(0x1f3)]);if(!existsSync(_0x55dd16))continue;const _0x52f87d=lstatSync(_0x55dd16);if(!_0x52f87d[_0x37b90d(0x1d0)]())throw CliErrors[_0x37b90d(0x1ec)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x560e7a,_0x37b90d(0x1f5)+_0x15090f['path']);const _0x399289=bufferSha256(readFileSync(_0x55dd16));if(_0x399289!==fileHash(_0x15090f))throw CliErrors[_0x37b90d(0x1ec)](_0x37b90d(0x1d6)+_0x560e7a,_0x37b90d(0x1f9)+_0x15090f[_0x37b90d(0x1f3)]);}}function materializeFiles(_0x483420,_0x5dde1c){const _0x3f4727=a144_0xa471;for(const _0x1d4483 of normalizeLocalFiles(_0x5dde1c)){const _0x456c11=resolveManagedFilePath(_0x483420,_0x1d4483[_0x3f4727(0x1f3)]);mkdirSync(dirname(_0x456c11),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x456c11,fileContent(_0x1d4483),0x180);}}function removeStaleManagedFiles(_0x56ce27,_0x23c003,_0x21bfa4){const _0x376824=a144_0xa471;if(!_0x23c003)return;const _0x1e3cf8=new Set(normalizeLocalFiles(_0x21bfa4)['map'](_0x3880e5=>_0x3880e5[_0x376824(0x1f3)]));for(const _0x37dc4a of Object[_0x376824(0x1ff)](_0x23c003)){if(_0x1e3cf8[_0x376824(0x1d9)](_0x37dc4a))continue;const _0x57663f=resolveManagedFilePath(_0x56ce27,_0x37dc4a);existsSync(_0x57663f)&&lstatSync(_0x57663f)[_0x376824(0x1d0)]()&&rmSync(_0x57663f,{'force':!![]});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x41bd4e,_0x34908e){const _0x41f131=a145_0x136d,_0xcf678=_0x41bd4e();while(!![]){try{const _0xb087a4=parseInt(_0x41f131(0x95))/0x1+-parseInt(_0x41f131(0x9b))/0x2*(-parseInt(_0x41f131(0x8c))/0x3)+parseInt(_0x41f131(0x7b))/0x4+parseInt(_0x41f131(0x7d))/0x5*(-parseInt(_0x41f131(0x8e))/0x6)+parseInt(_0x41f131(0x94))/0x7*(-parseInt(_0x41f131(0x92))/0x8)+parseInt(_0x41f131(0x85))/0x9*(parseInt(_0x41f131(0x79))/0xa)+-parseInt(_0x41f131(0x8b))/0xb;if(_0xb087a4===_0x34908e)break;else _0xcf678['push'](_0xcf678['shift']());}catch(_0x1372ce){_0xcf678['push'](_0xcf678['shift']());}}}(a145_0x46b2,0x51258));function a145_0x136d(_0x2e73e3,_0x5193b5){_0x2e73e3=_0x2e73e3-0x79;const _0x46b291=a145_0x46b2();let _0x136d2f=_0x46b291[_0x2e73e3];return _0x136d2f;}import{existsSync,readFileSync}from'node:fs';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';import{fileContent,normalizeLocalFiles}from'./local-files.js';import{buildSkillPackage,localFilesToManifestFiles}from'./zip-package.js';export function buildMetadata(_0x5dffb3,_0x1b9920,_0x3dac3e,_0x4381c0,_0x144fa4,_0x540895,_0xd96d06){const _0x10f67a=a145_0x136d,_0x5ce160=_0x540895?normalizeLocalFiles(_0x540895):[],_0x232718=!_0xd96d06&&_0x5ce160[_0x10f67a(0x83)]>0x0?buildSkillPackage(_0x5ce160):undefined,_0x48bb15=_0xd96d06?bufferSha256(_0xd96d06):_0x232718?.[_0x10f67a(0x80)][_0x10f67a(0x82)],_0x5241c9=_0xd96d06?.['length']??_0x232718?.[_0x10f67a(0x80)][_0x10f67a(0x84)],_0x5107ea=_0x5ce160[_0x10f67a(0x83)]>0x0?Object[_0x10f67a(0x87)](_0x5ce160[_0x10f67a(0x8a)](_0x1eee29=>[_0x1eee29[_0x10f67a(0x8f)],fileHash(_0x1eee29)])):undefined;return{'schemaVersion':_0x5ce160['length']>0x0?0x2:0x1,'id':_0x5dffb3['id'],'appCode':_0x3dac3e,'skillCode':requireSkillCode(_0x5dffb3),'skillName':_0x5dffb3[_0x10f67a(0x89)],'description':_0x5dffb3['description'],'example':_0x5dffb3[_0x10f67a(0x81)],'scope':_0x1b9920,'readonly':_0x1b9920!==_0x10f67a(0x93)||_0x5dffb3[_0x10f67a(0x8d)]===!![],'tenantCode':_0x5dffb3[_0x10f67a(0x86)],'userId':_0x5dffb3['userId'],'version':_0x5dffb3[_0x10f67a(0x99)],'status':_0x5dffb3[_0x10f67a(0x7f)],'tags':Array[_0x10f67a(0x96)](_0x5dffb3['tags'])?_0x5dffb3[_0x10f67a(0x7c)]:[],'hasUpstreamUpdate':_0x5dffb3['hasUpstreamUpdate'],'forkedFromSkillId':_0x5dffb3['forkedFromSkillId'],'forkedFromVersion':_0x5dffb3['forkedFromVersion'],'sourceSessionId':_0x5dffb3[_0x10f67a(0x7e)],'contentHash':_0x4381c0,'fileHashes':_0x5107ea,'treeHash':_0x5ce160[_0x10f67a(0x83)]>0x0?fileTreeHash(localFilesToManifestFiles(_0x5ce160)):undefined,'ossPath':remoteManifestOssPath(_0x5dffb3['files']),'zipSha256':_0x48bb15,'zipSize':_0x5241c9,'files':_0x5ce160[_0x10f67a(0x83)]>0x0?_0x5ce160[_0x10f67a(0x8a)](_0x126a40=>({'path':_0x126a40[_0x10f67a(0x8f)],'hash':fileHash(_0x126a40),'size':fileContent(_0x126a40)['length']})):undefined,'pulledAt':_0x144fa4??new Date()['toISOString']()};}function a145_0x46b2(){const _0x20b168=['203fPCQpg','268754ddynVi','isArray','utf8','trim','version','validation','167306NMsGSp','1090EUNovR','object','2619104vvCrNQ','tags','15pYBntX','sourceSessionId','status','manifest','example','zipSha256','length','zipSize','13491eqSDBy','tenantCode','fromEntries','ossPath','skillName','map','6657761UttTOV','18SDWZnX','readonly','17202OnMuIi','path','Invalid\x20','string','177272MFsCFz','personal'];a145_0x46b2=function(){return _0x20b168;};return a145_0x46b2();}export function requireSkillCode(_0x38a278){const _0x5e01b2=a145_0x136d,_0x19359e=_0x38a278['skillCode']?.['trim']();if(!_0x19359e)throw CliErrors[_0x5e01b2(0x9a)]('Runtime\x20Skill\x20is\x20missing\x20skillCode.');return _0x19359e;}export function readMetadataIfPresent(_0x5e6fc4){const _0x84b284=a145_0x136d;if(!existsSync(_0x5e6fc4))return undefined;try{const _0x24ba58=JSON['parse'](readFileSync(_0x5e6fc4,_0x84b284(0x97)));return _0x24ba58;}catch{throw CliErrors[_0x84b284(0x9a)](_0x84b284(0x90)+METADATA_FILE+':\x20'+_0x5e6fc4);}}function remoteManifestOssPath(_0x591209){const _0x1f6736=a145_0x136d;if(!_0x591209||typeof _0x591209!==_0x1f6736(0x7a)||Array[_0x1f6736(0x96)](_0x591209))return undefined;const _0x28e4f8=_0x591209[_0x1f6736(0x88)];return typeof _0x28e4f8===_0x1f6736(0x91)&&_0x28e4f8['trim']()?_0x28e4f8[_0x1f6736(0x98)]():undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a146_0x3633(_0x2fe6f8,_0x56bff6){_0x2fe6f8=_0x2fe6f8-0x1d3;const _0x22776c=a146_0x2277();let _0x36339b=_0x22776c[_0x2fe6f8];return _0x36339b;}const a146_0x5cde96=a146_0x3633;(function(_0x14bb8d,_0x371f7c){const _0x3d1a3e=a146_0x3633,_0xf9a705=_0x14bb8d();while(!![]){try{const _0x4483b7=-parseInt(_0x3d1a3e(0x1e2))/0x1*(parseInt(_0x3d1a3e(0x1e7))/0x2)+parseInt(_0x3d1a3e(0x1d8))/0x3*(-parseInt(_0x3d1a3e(0x1d7))/0x4)+-parseInt(_0x3d1a3e(0x1d3))/0x5+parseInt(_0x3d1a3e(0x1eb))/0x6*(parseInt(_0x3d1a3e(0x1d5))/0x7)+-parseInt(_0x3d1a3e(0x1e5))/0x8*(parseInt(_0x3d1a3e(0x1e0))/0x9)+-parseInt(_0x3d1a3e(0x1e4))/0xa+-parseInt(_0x3d1a3e(0x1ea))/0xb*(-parseInt(_0x3d1a3e(0x1ec))/0xc);if(_0x4483b7===_0x371f7c)break;else _0xf9a705['push'](_0xf9a705['shift']());}catch(_0x5a573d){_0xf9a705['push'](_0xf9a705['shift']());}}}(a146_0x2277,0x8e68a));import{existsSync}from'node:fs';import{homedir}from'node:os';import{resolve}from'node:path';import{fingerprintAccessKey}from'../../commands/app/cache.js';import{PRODUCT_CONFIG,productEnv}from'../../constant/product.js';import{CliErrors}from'../../errors.js';export function resolveSkillSyncPaths(_0x407b78={}){const _0x12cdcb=a146_0x3633,_0x32981b=_0x407b78['homeDir']??homedir(),_0x4479d5=resolve(_0x32981b,PRODUCT_CONFIG['homeDirName'],_0x12cdcb(0x1e8)),_0x416286=trimmedEnv(_0x12cdcb(0x1e1)),_0x42db33=trimmedEnv(_0x12cdcb(0x1ed)),_0x66f40d=resolve(_0x32981b,_0x12cdcb(0x1d4)),_0x5a5c9d=_0x407b78['workbuddySkillsDir']??(existsSync(_0x66f40d)?resolve(_0x66f40d,_0x12cdcb(0x1e3)):undefined);return{'homeDir':_0x32981b,'cacheRoot':_0x4479d5,'managedRoot':resolve(_0x32981b,PRODUCT_CONFIG['homeDirName']),'agentsSkillsDir':_0x407b78[_0x12cdcb(0x1e6)]??_0x416286??resolve(_0x32981b,_0x12cdcb(0x1ee),_0x12cdcb(0x1e3)),'claudeSkillsDir':_0x407b78[_0x12cdcb(0x1df)]??_0x42db33??resolve(_0x32981b,'.claude',_0x12cdcb(0x1e3)),'workbuddySkillsDir':_0x5a5c9d};}export function runtimeAgentSkillRoots(_0x37abe3){const _0x18ae21=a146_0x3633;return[_0x37abe3[_0x18ae21(0x1e6)],_0x37abe3[_0x18ae21(0x1df)],_0x37abe3['workbuddySkillsDir']][_0x18ae21(0x1de)](_0x165287=>Boolean(_0x165287));}export function getRuntimeSkillCacheRoot(_0x3ddbdf,_0x5aba17,_0x55745d={}){const _0x368a30=a146_0x3633,_0x21d7f1=resolveSkillSyncPaths(_0x55745d);return resolve(_0x21d7f1[_0x368a30(0x1dd)],_0x3ddbdf,fingerprintAccessKey(_0x5aba17),_0x368a30(0x1e3));}function a146_0x2277(){const _0x2670e0=['4tQmHiA','cache','\x20for\x20local\x20path:\x20','11giKrNL','240282jWvXOt','51210060hOFTBD','CLAUDE_SKILL_ROOT','.agents','4299280BEzCaw','.workbuddy','35vbIQlG','skillCode','4kSSatl','2352471NWnGVM','Unsafe\x20','includes','trim','path\x20segment','cacheRoot','filter','claudeSkillsDir','4272165eLyQjQ','SKILL_ROOT','182353FYdrOw','skills','9263450ipSAlx','16GaNLZW','agentsSkillsDir'];a146_0x2277=function(){return _0x2670e0;};return a146_0x2277();}export function getRuntimeSkillDir(_0x184a18,_0x5ff848,_0x11e56e,_0x1d1fba,_0x36b9ee,_0x5c6f70={}){const _0x1e1091=a146_0x3633;return resolve(getRuntimeSkillCacheRoot(_0x184a18,_0x5ff848,_0x5c6f70),safePathSegment(_0x11e56e,'appCode'),_0x1d1fba,safePathSegment(_0x36b9ee,_0x1e1091(0x1d6)));}export function safePathSegment(_0x3d28f2,_0x2a9fbc=a146_0x5cde96(0x1dc)){const _0x38c43d=a146_0x5cde96;if(!_0x3d28f2||_0x3d28f2[_0x38c43d(0x1da)]('/')||_0x3d28f2[_0x38c43d(0x1da)]('\x5c')||_0x3d28f2[_0x38c43d(0x1da)]('..'))throw CliErrors['validation'](_0x38c43d(0x1d9)+_0x2a9fbc+_0x38c43d(0x1e9)+_0x3d28f2);return _0x3d28f2;}function trimmedEnv(_0x40c3ed){const _0x58d3e2=a146_0x5cde96,_0x4a8a1e=productEnv(_0x40c3ed)?.[_0x58d3e2(0x1db)]();return _0x4a8a1e?_0x4a8a1e:undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x39b207,_0x2e5a5b){const _0x5b1db6=a147_0x4759,_0x5d4a26=_0x39b207();while(!![]){try{const _0x10fd27=-parseInt(_0x5b1db6(0x208))/0x1*(parseInt(_0x5b1db6(0x202))/0x2)+parseInt(_0x5b1db6(0x21f))/0x3+parseInt(_0x5b1db6(0x212))/0x4*(-parseInt(_0x5b1db6(0x1e4))/0x5)+parseInt(_0x5b1db6(0x200))/0x6+parseInt(_0x5b1db6(0x21b))/0x7+parseInt(_0x5b1db6(0x203))/0x8+parseInt(_0x5b1db6(0x1e5))/0x9*(-parseInt(_0x5b1db6(0x1fe))/0xa);if(_0x10fd27===_0x2e5a5b)break;else _0x5d4a26['push'](_0x5d4a26['shift']());}catch(_0x453ec8){_0x5d4a26['push'](_0x5d4a26['shift']());}}}(a147_0x50f4,0x3ff7c));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a147_0x199efb}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';function a147_0x50f4(){const _0x26a364=['displayName','path','metadata','dir','description','skillCode','1409646nzGkYG','name','isSymbolicLink','ignoreInvalidMetadata','1248093LwkwzV','tags','filter','Remote\x20Skill\x20','Skill\x20directory\x20not\x20found:\x20','validation','10ANZrvJ','9wAuzcL','match','pushedAt','isArray','number','utf8',',\x20or\x20directory\x20name.','ignoreMetadataAppCodeMismatch','find','\x20has\x20unsupported\x20scope\x20\x22','Skill\x20metadata\x20appCode\x20\x22','appCode','personal','skillName','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20','Missing\x20','builtin','targetScope','example','isFile','string','\x20has\x20scope=\x22','boolean','files','sourceSessionId','4778890ontgVp','ignoreMetadataForPayload','1280160UPjxlL','refreshedAt','147310fXHUiN','27544MkIVKz','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20','trim','scope','\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22','1UvERZm','isDirectory','manifest','ignoreMetadataSkillCode','object','allowAppCodeRetarget','replace','\x20name\x20for\x20SkillHub\x20slug\x20generation.','excludedFilePaths','ignoreMetadataScope','41312aVdEWs','slice','content'];a147_0x50f4=function(){return _0x26a364;};return a147_0x50f4();}import{buildMetadata,readMetadataIfPresent}from'./metadata.js';import{buildSkillPackage,tryNormalizePackageManifest}from'./zip-package.js';export function resolvePushDirectoryIdentity(_0x5f3120,_0x14f8af,_0x35c4d9={}){const _0x3ad7d6=a147_0x4759,_0x4ef7c8=resolvePushDirectoryRoot(_0x5f3120),_0x6bd7fc=readPushMetadataIfPresent(resolve(_0x4ef7c8,METADATA_FILE),{'ignoreInvalidMetadata':_0x35c4d9[_0x3ad7d6(0x21e)]});if(_0x6bd7fc?.['appCode']&&_0x6bd7fc[_0x3ad7d6(0x1f0)]!==_0x14f8af&&!_0x35c4d9[_0x3ad7d6(0x20d)]&&!_0x35c4d9[_0x3ad7d6(0x1ec)])throw CliErrors['validation'](_0x3ad7d6(0x1ef)+_0x6bd7fc[_0x3ad7d6(0x1f0)]+_0x3ad7d6(0x207)+_0x14f8af+'\x22.');const _0x5cad40=resolvePushSkillCode(_0x4ef7c8,_0x14f8af,_0x6bd7fc,_0x35c4d9);if(!_0x5cad40)throw CliErrors[_0x3ad7d6(0x224)]('Unable\x20to\x20resolve\x20skillCode\x20from\x20'+SKILL_FILE+',\x20'+METADATA_FILE+_0x3ad7d6(0x1eb));return{'dir':_0x4ef7c8,'skillCode':_0x5cad40,'metadata':_0x6bd7fc};}export function readPushDirectory(_0x5ce1fb,_0x316659,_0x2f777d={}){const _0x390a7b=a147_0x4759,_0x4f4999=resolvePushDirectoryIdentity(_0x5ce1fb,_0x316659,_0x2f777d),_0x11b9f0=_0x4f4999[_0x390a7b(0x218)],_0x3fe9fd=resolve(_0x11b9f0,SKILL_FILE);if(!existsSync(_0x3fe9fd)||!lstatSync(_0x3fe9fd)[_0x390a7b(0x1f8)]())throw CliErrors[_0x390a7b(0x224)](_0x390a7b(0x1f4)+SKILL_FILE+':\x20'+_0x3fe9fd);const _0x158fd4=_0x4f4999[_0x390a7b(0x217)],_0x13fd91=_0x2f777d[_0x390a7b(0x1f6)]??_0x390a7b(0x1f1);if(!_0x2f777d[_0x390a7b(0x211)]&&_0x158fd4?.[_0x390a7b(0x206)]===_0x390a7b(0x1f5))throw CliErrors[_0x390a7b(0x224)]('Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20'+METADATA_FILE+'\x20has\x20scope=\x22'+_0x158fd4[_0x390a7b(0x206)]+'\x22.');if(!_0x2f777d[_0x390a7b(0x211)]&&_0x13fd91===_0x390a7b(0x1f1)&&_0x158fd4?.[_0x390a7b(0x206)]&&_0x158fd4[_0x390a7b(0x206)]!==_0x390a7b(0x1f1))throw CliErrors['validation'](_0x390a7b(0x1f3)+METADATA_FILE+_0x390a7b(0x1fa)+_0x158fd4['scope']+'\x22.',_0x390a7b(0x204)+_0x11b9f0+'\x20to\x20submit\x20company\x20Skills\x20for\x20review.');const _0x4007d4=scanSkillDirectory(_0x11b9f0,{'excludedFilePaths':_0x2f777d[_0x390a7b(0x210)]}),_0x4e3d6f=buildSkillPackage(_0x4007d4),_0x3763c6=readFileSync(_0x3fe9fd,_0x390a7b(0x1ea)),_0x11b8fb=_0x4f4999['skillCode'],_0x3af86e=_0x2f777d[_0x390a7b(0x1ff)]?undefined:_0x158fd4,_0x506db2=readSkillDisplayName(_0x3763c6);return{'skillCode':_0x11b8fb,'metadata':_0x158fd4,'frontmatterDisplayName':_0x506db2,'input':{'skillCode':_0x11b8fb,'skillName':_0x506db2??_0x3af86e?.[_0x390a7b(0x1f2)],'description':_0x3af86e?.[_0x390a7b(0x219)],'content':_0x3763c6,'files':_0x4e3d6f[_0x390a7b(0x20a)],'packageBase64':_0x4e3d6f['packageBase64'],'tags':_0x3af86e?.[_0x390a7b(0x220)],'version':_0x3af86e?.['version'],'sourceSessionId':_0x3af86e?.[_0x390a7b(0x1fd)]}};}export function refreshPushDirectoryMetadataFromRemote(_0xdfce80,_0x4a29b7,_0x3cfce0,_0x1862e2={}){const _0x787928=a147_0x4759,_0x1c433b=resolvePushDirectoryRoot(_0xdfce80),_0x4fd437=readPushMetadataIfPresent(resolve(_0x1c433b,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x13e035=requireRemoteScope(_0x4a29b7),_0x26d46b=readLocalSkillContent(_0x1c433b),_0x211e10={..._0x4a29b7,'appCode':_0x4a29b7[_0x787928(0x1f0)]??_0x3cfce0,'skillName':_0x4a29b7[_0x787928(0x1f2)]??_0x4fd437?.[_0x787928(0x1f2)],'description':_0x4a29b7[_0x787928(0x219)]??_0x4fd437?.[_0x787928(0x219)],'example':_0x4a29b7[_0x787928(0x1f7)]??_0x4fd437?.['example'],'tags':Array[_0x787928(0x1e8)](_0x4a29b7[_0x787928(0x220)])?_0x4a29b7['tags']:_0x4fd437?.[_0x787928(0x220)],'sourceSessionId':_0x4a29b7['sourceSessionId']??_0x4fd437?.[_0x787928(0x1fd)],'content':_0x4a29b7[_0x787928(0x214)]??_0x26d46b},_0x258c97=buildMetadata(_0x211e10,_0x13e035,_0x3cfce0,contentHash(_0x26d46b),_0x1862e2[_0x787928(0x201)]);writeJsonAtomic(resolve(_0x1c433b,METADATA_FILE),_0x258c97);}export function recordPushedRuntimeSkill(_0x1952ce,_0x49ac31,_0xf50b53,_0x555983={}){const _0x4b1ea7=a147_0x4759,_0x44be70=resolvePushDirectoryRoot(_0x1952ce),_0x4bda7e=scanSkillDirectory(_0x44be70),_0x5a1b40=_0x4bda7e[_0x4b1ea7(0x1ed)](_0x6f9adc=>_0x6f9adc[_0x4b1ea7(0x216)]===SKILL_FILE),_0x149d08=_0x5a1b40?fileText(_0x5a1b40):'',_0x568ebf=tryNormalizePackageManifest(_0x49ac31[_0x4b1ea7(0x1fc)]),_0x173bb9={..._0x49ac31,'content':_0x49ac31[_0x4b1ea7(0x214)]??_0x149d08,'files':_0x568ebf},_0x479068=_0x568ebf?normalizeLocalFiles(_0x4bda7e)[_0x4b1ea7(0x221)](_0x4fdb88=>_0x568ebf[_0x4b1ea7(0x1fc)]['some'](_0x3bbc07=>_0x3bbc07['path']===_0x4fdb88['path'])):undefined,_0x14bdc0=buildMetadata(_0x173bb9,_0x555983['scope']??_0x4b1ea7(0x1f1),_0xf50b53,contentHash(_0x173bb9[_0x4b1ea7(0x214)]??''),_0x555983[_0x4b1ea7(0x1e7)],_0x479068);writeJsonAtomic(resolve(_0x44be70,METADATA_FILE),_0x14bdc0);}export function deriveSkillCodeFromDirectory(_0x3ae12c,_0x4ee9e2){const _0x4df175=a147_0x4759,_0x5af5ff=basename(resolve(_0x3ae12c)),_0x196349=_0x4ee9e2+'--';return _0x5af5ff['startsWith'](_0x196349)?_0x5af5ff[_0x4df175(0x213)](_0x196349['length']):_0x5af5ff;}function resolvePushSkillCode(_0x297f23,_0x396c25,_0x446e8a,_0x4971ee){const _0x544f98=a147_0x4759,_0x441eea=deriveSkillCodeFromSkillFile(_0x297f23)||deriveSkillCodeFromDirectory(_0x297f23,_0x396c25);if(_0x4971ee[_0x544f98(0x20b)])return _0x441eea;return _0x446e8a?.[_0x544f98(0x21a)]?.[_0x544f98(0x205)]()||_0x441eea;}function deriveSkillCodeFromSkillFile(_0x393a91){const _0x2cb535=a147_0x4759,_0x5b523e=resolve(_0x393a91,SKILL_FILE);if(!existsSync(_0x5b523e)||!lstatSync(_0x5b523e)[_0x2cb535(0x1f8)]())return undefined;const _0x5892ae=readFileSync(_0x5b523e,_0x2cb535(0x1ea)),_0x3b5fc7=_0x5892ae[_0x2cb535(0x1e6)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x3b5fc7)return undefined;const _0x1fe0b4=parseFrontmatterObject(_0x3b5fc7[0x1]??''),_0x2b4f10=scalarToString(_0x1fe0b4?.[_0x2cb535(0x21c)]);return _0x2b4f10?slugifySkillName(_0x2b4f10):undefined;}function readSkillDisplayName(_0x5454dd){const _0x14a1ad=a147_0x4759,_0x33a510=_0x5454dd[_0x14a1ad(0x1e6)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x33a510)return undefined;const _0xc381a9=parseFrontmatterObject(_0x33a510[0x1]??'');return scalarToString(_0xc381a9?.[_0x14a1ad(0x215)]);}function slugifySkillName(_0x3140e9){const _0x32e7eb=a147_0x4759,_0x3a3b17=_0x3140e9[_0x32e7eb(0x205)]()['toLowerCase']()[_0x32e7eb(0x20e)](/[^\p{L}\p{N}\p{So}]+/gu,'-')[_0x32e7eb(0x20e)](/^-+/,'')[_0x32e7eb(0x20e)](/-+$/,'')[_0x32e7eb(0x20e)](/-{2,}/g,'-');if(!_0x3a3b17)throw CliErrors[_0x32e7eb(0x224)]('Invalid\x20'+SKILL_FILE+_0x32e7eb(0x20f));return _0x3a3b17;}function a147_0x4759(_0x3c60f8,_0x3a92e5){_0x3c60f8=_0x3c60f8-0x1e4;const _0x50f4f8=a147_0x50f4();let _0x4759a9=_0x50f4f8[_0x3c60f8];return _0x4759a9;}function parseFrontmatterObject(_0x1907de){const _0x205c44=a147_0x4759;try{const _0x287417=a147_0x199efb(_0x1907de);return _0x287417&&typeof _0x287417===_0x205c44(0x20c)&&!Array['isArray'](_0x287417)?_0x287417:undefined;}catch{return undefined;}}function scalarToString(_0x25d5e6){const _0x21eb75=a147_0x4759;if(typeof _0x25d5e6===_0x21eb75(0x1f9))return _0x25d5e6[_0x21eb75(0x205)]();if(typeof _0x25d5e6===_0x21eb75(0x1e9)||typeof _0x25d5e6===_0x21eb75(0x1fb))return String(_0x25d5e6);return undefined;}function resolvePushDirectoryRoot(_0x50af47){const _0x3d311e=a147_0x4759,_0x380cb5=resolve(_0x50af47);if(!existsSync(_0x380cb5))throw CliErrors[_0x3d311e(0x224)](_0x3d311e(0x223)+_0x50af47);const _0x202790=lstatSync(_0x380cb5);if(_0x202790[_0x3d311e(0x209)]())return _0x380cb5;if(_0x202790[_0x3d311e(0x21d)]()){const _0x38a19a=realpathSync(_0x380cb5);if(lstatSync(_0x38a19a)[_0x3d311e(0x209)]())return _0x38a19a;}throw CliErrors['validation'](_0x3d311e(0x223)+_0x50af47);}function requireRemoteScope(_0x256eb1){const _0x754ac=a147_0x4759;if(_0x256eb1[_0x754ac(0x206)]===_0x754ac(0x1f1)||_0x256eb1[_0x754ac(0x206)]==='company'||_0x256eb1['scope']===_0x754ac(0x1f5))return _0x256eb1['scope'];throw CliErrors['validation'](_0x754ac(0x222)+(_0x256eb1[_0x754ac(0x21a)]||'(unknown)')+_0x754ac(0x1ee)+(_0x256eb1['scope']??'unknown')+'\x22.');}function readLocalSkillContent(_0x2c3015){const _0xeb807d=a147_0x4759,_0x199e84=resolve(_0x2c3015,SKILL_FILE);return existsSync(_0x199e84)&&lstatSync(_0x199e84)[_0xeb807d(0x1f8)]()?readFileSync(_0x199e84,_0xeb807d(0x1ea)):'';}function readPushMetadataIfPresent(_0x483410,_0x3c378c={}){try{return readMetadataIfPresent(_0x483410);}catch(_0x23318a){if(_0x3c378c['ignoreInvalidMetadata'])return undefined;throw _0x23318a;}}
|
|
1
|
+
(function(_0x182910,_0x35a669){const _0xc74c02=a147_0x3195,_0xdc365b=_0x182910();while(!![]){try{const _0x23eed0=parseInt(_0xc74c02(0x11f))/0x1+parseInt(_0xc74c02(0x149))/0x2+parseInt(_0xc74c02(0x129))/0x3+-parseInt(_0xc74c02(0x151))/0x4*(-parseInt(_0xc74c02(0x122))/0x5)+-parseInt(_0xc74c02(0x139))/0x6*(-parseInt(_0xc74c02(0x12a))/0x7)+-parseInt(_0xc74c02(0x11d))/0x8*(-parseInt(_0xc74c02(0x127))/0x9)+-parseInt(_0xc74c02(0x12f))/0xa;if(_0x23eed0===_0x35a669)break;else _0xdc365b['push'](_0xdc365b['shift']());}catch(_0xefb99a){_0xdc365b['push'](_0xdc365b['shift']());}}}(a147_0x13c5,0x20075));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a147_0x4d476c}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_0x3195(_0x572602,_0xfede50){_0x572602=_0x572602-0x11a;const _0x13c5b5=a147_0x13c5();let _0x319522=_0x13c5b5[_0x572602];return _0x319522;}import{buildSkillPackage,tryNormalizePackageManifest}from'./zip-package.js';export function resolvePushDirectoryIdentity(_0x3d924a,_0x2f822d,_0x109669={}){const _0x6901f0=a147_0x3195,_0x258708=resolvePushDirectoryRoot(_0x3d924a),_0x246a84=readPushMetadataIfPresent(resolve(_0x258708,METADATA_FILE),{'ignoreInvalidMetadata':_0x109669[_0x6901f0(0x125)]});if(_0x246a84?.[_0x6901f0(0x140)]&&_0x246a84[_0x6901f0(0x140)]!==_0x2f822d&&!_0x109669[_0x6901f0(0x13a)]&&!_0x109669[_0x6901f0(0x12b)])throw CliErrors[_0x6901f0(0x12e)]('Skill\x20metadata\x20appCode\x20\x22'+_0x246a84[_0x6901f0(0x140)]+_0x6901f0(0x143)+_0x2f822d+'\x22.');const _0x150e28=resolvePushSkillCode(_0x258708,_0x2f822d,_0x246a84,_0x109669);if(!_0x150e28)throw CliErrors['validation'](_0x6901f0(0x135)+SKILL_FILE+',\x20'+METADATA_FILE+_0x6901f0(0x15b));return{'dir':_0x258708,'skillCode':_0x150e28,'metadata':_0x246a84};}export function readPushDirectory(_0x5a66db,_0x3d7d8d,_0x2631b8={}){const _0x10ee9b=a147_0x3195,_0x37f928=resolvePushDirectoryIdentity(_0x5a66db,_0x3d7d8d,_0x2631b8),_0x9181f3=_0x37f928[_0x10ee9b(0x141)],_0x41d861=resolve(_0x9181f3,SKILL_FILE);if(!existsSync(_0x41d861)||!lstatSync(_0x41d861)['isFile']())throw CliErrors[_0x10ee9b(0x12e)](_0x10ee9b(0x12c)+SKILL_FILE+':\x20'+_0x41d861);const _0x23bb73=_0x37f928[_0x10ee9b(0x133)],_0x4d25c3=_0x2631b8[_0x10ee9b(0x123)]??_0x10ee9b(0x15a);if(!_0x2631b8[_0x10ee9b(0x137)]&&_0x23bb73?.[_0x10ee9b(0x11c)]==='builtin')throw CliErrors[_0x10ee9b(0x12e)](_0x10ee9b(0x144)+METADATA_FILE+_0x10ee9b(0x147)+_0x23bb73[_0x10ee9b(0x11c)]+'\x22.');if(!_0x2631b8[_0x10ee9b(0x137)]&&_0x4d25c3===_0x10ee9b(0x15a)&&_0x23bb73?.[_0x10ee9b(0x11c)]&&_0x23bb73['scope']!==_0x10ee9b(0x15a))throw CliErrors['validation'](_0x10ee9b(0x138)+METADATA_FILE+_0x10ee9b(0x147)+_0x23bb73[_0x10ee9b(0x11c)]+'\x22.',_0x10ee9b(0x13d)+_0x9181f3+_0x10ee9b(0x136));const _0x2d74f5=scanSkillDirectory(_0x9181f3,{'excludedFilePaths':_0x2631b8[_0x10ee9b(0x120)]}),_0x459881=buildSkillPackage(_0x2d74f5),_0x2b8aa4=readFileSync(_0x41d861,_0x10ee9b(0x11a)),_0xef8d4f=_0x37f928[_0x10ee9b(0x13e)],_0x529879=_0x2631b8[_0x10ee9b(0x12d)]?undefined:_0x23bb73,_0xc58b43=readSkillDisplayName(_0x2b8aa4);return{'skillCode':_0xef8d4f,'metadata':_0x23bb73,'frontmatterDisplayName':_0xc58b43,'input':{'skillCode':_0xef8d4f,'skillName':_0xc58b43??_0x529879?.[_0x10ee9b(0x142)],'description':_0x529879?.['description'],'content':_0x2b8aa4,'files':_0x459881['manifest'],'packageBase64':_0x459881[_0x10ee9b(0x11e)],'tags':_0x529879?.[_0x10ee9b(0x146)],'version':_0x529879?.['version'],'sourceSessionId':_0x529879?.[_0x10ee9b(0x154)]}};}export function refreshPushDirectoryMetadataFromRemote(_0x1addc5,_0x26646d,_0x38c0fc,_0x149699={}){const _0x3f3156=a147_0x3195,_0x3dcd65=resolvePushDirectoryRoot(_0x1addc5),_0x412a37=readPushMetadataIfPresent(resolve(_0x3dcd65,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x47d4f7=requireRemoteScope(_0x26646d),_0x2f9893=readLocalSkillContent(_0x3dcd65),_0x3cb5f0={..._0x26646d,'appCode':_0x26646d['appCode']??_0x38c0fc,'skillName':_0x26646d['skillName']??_0x412a37?.[_0x3f3156(0x142)],'description':_0x26646d['description']??_0x412a37?.['description'],'example':_0x26646d[_0x3f3156(0x132)]??_0x412a37?.[_0x3f3156(0x132)],'tags':Array['isArray'](_0x26646d['tags'])?_0x26646d[_0x3f3156(0x146)]:_0x412a37?.[_0x3f3156(0x146)],'sourceSessionId':_0x26646d[_0x3f3156(0x154)]??_0x412a37?.['sourceSessionId'],'content':_0x26646d['content']??_0x2f9893},_0xfe7964=buildMetadata(_0x3cb5f0,_0x47d4f7,_0x38c0fc,contentHash(_0x2f9893),_0x149699[_0x3f3156(0x128)]);writeJsonAtomic(resolve(_0x3dcd65,METADATA_FILE),_0xfe7964);}export function recordPushedRuntimeSkill(_0x19e369,_0x49404f,_0x10b515,_0x170cb3={}){const _0x52118f=a147_0x3195,_0x5234e0=resolvePushDirectoryRoot(_0x19e369),_0x5abae3=scanSkillDirectory(_0x5234e0),_0x397cec=_0x5abae3[_0x52118f(0x14e)](_0xdbd168=>_0xdbd168[_0x52118f(0x145)]===SKILL_FILE),_0x860db6=_0x397cec?fileText(_0x397cec):'',_0x3b78cf=tryNormalizePackageManifest(_0x49404f['files']),_0x1828cf={..._0x49404f,'content':_0x49404f[_0x52118f(0x13c)]??_0x860db6,'files':_0x3b78cf},_0x50fcc7=_0x3b78cf?normalizeLocalFiles(_0x5abae3)['filter'](_0xb77cd4=>_0x3b78cf['files'][_0x52118f(0x121)](_0x40cd2a=>_0x40cd2a[_0x52118f(0x145)]===_0xb77cd4[_0x52118f(0x145)])):undefined,_0x45911e=buildMetadata(_0x1828cf,_0x170cb3['scope']??_0x52118f(0x15a),_0x10b515,contentHash(_0x1828cf[_0x52118f(0x13c)]??''),_0x170cb3['pushedAt'],_0x50fcc7);writeJsonAtomic(resolve(_0x5234e0,METADATA_FILE),_0x45911e);}function a147_0x13c5(){const _0x306dc6=['boolean','\x20has\x20unsupported\x20scope\x20\x22','\x20name\x20for\x20SkillHub\x20slug\x20generation.','personal',',\x20or\x20directory\x20name.','utf8','isArray','scope','440912JQwkOB','packageBase64','95287lqtsga','excludedFilePaths','some','5dwtLCg','targetScope','Skill\x20directory\x20not\x20found:\x20','ignoreInvalidMetadata','company','9iOvEHp','refreshedAt','111567JCGCNz','409927cAxuFl','ignoreMetadataAppCodeMismatch','Missing\x20','ignoreMetadataForPayload','validation','5202790esSMog','unknown','name','example','metadata','match','Unable\x20to\x20resolve\x20skillCode\x20from\x20','\x20to\x20submit\x20company\x20Skills\x20for\x20review.','ignoreMetadataScope','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20','24tbpRzX','allowAppCodeRetarget','trim','content','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20','skillCode','replace','appCode','dir','skillName','\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22','Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20','path','tags','\x20has\x20scope=\x22','isSymbolicLink','260592DfSeHh','toLowerCase','isFile','displayName','string','find','Remote\x20Skill\x20','object','397352IEVbPP','isDirectory','startsWith','sourceSessionId','slice','builtin'];a147_0x13c5=function(){return _0x306dc6;};return a147_0x13c5();}export function deriveSkillCodeFromDirectory(_0x571c0f,_0x9f2800){const _0x2816d6=a147_0x3195,_0x546366=basename(resolve(_0x571c0f)),_0x22d01c=_0x9f2800+'--';return _0x546366[_0x2816d6(0x153)](_0x22d01c)?_0x546366[_0x2816d6(0x155)](_0x22d01c['length']):_0x546366;}function resolvePushSkillCode(_0x5f053a,_0x19fc65,_0x322683,_0xd252d0){const _0x43355f=deriveSkillCodeFromSkillFile(_0x5f053a)||deriveSkillCodeFromDirectory(_0x5f053a,_0x19fc65);if(_0xd252d0['ignoreMetadataSkillCode'])return _0x43355f;return _0x322683?.['skillCode']?.['trim']()||_0x43355f;}function deriveSkillCodeFromSkillFile(_0x347b7b){const _0xeb2f1e=a147_0x3195,_0x362a8c=resolve(_0x347b7b,SKILL_FILE);if(!existsSync(_0x362a8c)||!lstatSync(_0x362a8c)['isFile']())return undefined;const _0x2b82d4=readFileSync(_0x362a8c,'utf8'),_0x572bb1=_0x2b82d4[_0xeb2f1e(0x134)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x572bb1)return undefined;const _0xc8905a=parseFrontmatterObject(_0x572bb1[0x1]??''),_0x452bb6=scalarToString(_0xc8905a?.[_0xeb2f1e(0x131)]);return _0x452bb6?slugifySkillName(_0x452bb6):undefined;}function readSkillDisplayName(_0x4862c5){const _0x54df88=a147_0x3195,_0x4f1cdc=_0x4862c5[_0x54df88(0x134)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x4f1cdc)return undefined;const _0x407eee=parseFrontmatterObject(_0x4f1cdc[0x1]??'');return scalarToString(_0x407eee?.[_0x54df88(0x14c)]);}function slugifySkillName(_0x505a7f){const _0xd3cc64=a147_0x3195,_0x4e36d2=_0x505a7f[_0xd3cc64(0x13b)]()[_0xd3cc64(0x14a)]()[_0xd3cc64(0x13f)](/[^\p{L}\p{N}\p{So}]+/gu,'-')[_0xd3cc64(0x13f)](/^-+/,'')[_0xd3cc64(0x13f)](/-+$/,'')['replace'](/-{2,}/g,'-');if(!_0x4e36d2)throw CliErrors[_0xd3cc64(0x12e)]('Invalid\x20'+SKILL_FILE+_0xd3cc64(0x159));return _0x4e36d2;}function parseFrontmatterObject(_0x503872){const _0x5b5061=a147_0x3195;try{const _0x25b197=a147_0x4d476c(_0x503872);return _0x25b197&&typeof _0x25b197===_0x5b5061(0x150)&&!Array[_0x5b5061(0x11b)](_0x25b197)?_0x25b197:undefined;}catch{return undefined;}}function scalarToString(_0x27e4bc){const _0x154695=a147_0x3195;if(typeof _0x27e4bc===_0x154695(0x14d))return _0x27e4bc[_0x154695(0x13b)]();if(typeof _0x27e4bc==='number'||typeof _0x27e4bc===_0x154695(0x157))return String(_0x27e4bc);return undefined;}function resolvePushDirectoryRoot(_0xa4424){const _0x5aac2a=a147_0x3195,_0x172e75=resolve(_0xa4424);if(!existsSync(_0x172e75))throw CliErrors[_0x5aac2a(0x12e)](_0x5aac2a(0x124)+_0xa4424);const _0x139367=lstatSync(_0x172e75);if(_0x139367[_0x5aac2a(0x152)]())return _0x172e75;if(_0x139367[_0x5aac2a(0x148)]()){const _0x260fd9=realpathSync(_0x172e75);if(lstatSync(_0x260fd9)[_0x5aac2a(0x152)]())return _0x260fd9;}throw CliErrors['validation'](_0x5aac2a(0x124)+_0xa4424);}function requireRemoteScope(_0xd04f25){const _0x2212a4=a147_0x3195;if(_0xd04f25[_0x2212a4(0x11c)]==='personal'||_0xd04f25['scope']===_0x2212a4(0x126)||_0xd04f25[_0x2212a4(0x11c)]===_0x2212a4(0x156))return _0xd04f25['scope'];throw CliErrors[_0x2212a4(0x12e)](_0x2212a4(0x14f)+(_0xd04f25[_0x2212a4(0x13e)]||'(unknown)')+_0x2212a4(0x158)+(_0xd04f25[_0x2212a4(0x11c)]??_0x2212a4(0x130))+'\x22.');}function readLocalSkillContent(_0x266986){const _0x2fbbf4=a147_0x3195,_0x1767f8=resolve(_0x266986,SKILL_FILE);return existsSync(_0x1767f8)&&lstatSync(_0x1767f8)[_0x2fbbf4(0x14b)]()?readFileSync(_0x1767f8,_0x2fbbf4(0x11a)):'';}function readPushMetadataIfPresent(_0x2acea2,_0x281914={}){const _0x457f9c=a147_0x3195;try{return readMetadataIfPresent(_0x2acea2);}catch(_0x4253ce){if(_0x281914[_0x457f9c(0x125)])return undefined;throw _0x4253ce;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a148_0x455a(){const _0x516da7=['Unsupported\x20runtime\x20Skill\x20scope:\x20','includes','3885092oxpICK','personal','24KsiSnO','4777773tEGPmK','4953645viKCyb','11KMSJDi','10sPNnXN','builtin','length','push','267706jZwrfK','8129445lVJMEB','3617400AOVcdn','company','6jpuTuU','15524729OpqecY'];a148_0x455a=function(){return _0x516da7;};return a148_0x455a();}function a148_0xb0eb(_0x44aca3,_0x27422f){_0x44aca3=_0x44aca3-0x111;const _0x455ae2=a148_0x455a();let _0xb0eb79=_0x455ae2[_0x44aca3];return _0xb0eb79;}(function(_0x16f0c8,_0x4fff49){const _0x14b4e0=a148_0xb0eb,_0x286c16=_0x16f0c8();while(!![]){try{const _0x5a651f=-parseInt(_0x14b4e0(0x121))/0x1*(-parseInt(_0x14b4e0(0x114))/0x2)+-parseInt(_0x14b4e0(0x118))/0x3*(parseInt(_0x14b4e0(0x11c))/0x4)+parseInt(_0x14b4e0(0x115))/0x5+-parseInt(_0x14b4e0(0x116))/0x6+parseInt(_0x14b4e0(0x11f))/0x7+-parseInt(_0x14b4e0(0x11e))/0x8*(parseInt(_0x14b4e0(0x120))/0x9)+parseInt(_0x14b4e0(0x122))/0xa*(parseInt(_0x14b4e0(0x119))/0xb);if(_0x5a651f===_0x4fff49)break;else _0x286c16['push'](_0x286c16['shift']());}catch(_0x32252e){_0x286c16['push'](_0x286c16['shift']());}}}(a148_0x455a,0xf30a1));import{CliErrors}from'../../errors.js';export function normalizeRuntimeSkillScopes(_0x311723){const _0x120968=a148_0xb0eb,_0x251a0b=_0x311723&&_0x311723[_0x120968(0x112)]>0x0?_0x311723:[_0x120968(0x11d),_0x120968(0x117),_0x120968(0x111)],_0x249422=[];for(const _0x3bd250 of _0x251a0b){if(!isRuntimeSkillScope(_0x3bd250))throw CliErrors['validation'](_0x120968(0x11a)+_0x3bd250);!_0x249422[_0x120968(0x11b)](_0x3bd250)&&_0x249422[_0x120968(0x113)](_0x3bd250);}return _0x249422;}export function isRuntimeSkillScope(_0x3a19aa){const _0x4b11cd=a148_0xb0eb;return _0x3a19aa===_0x4b11cd(0x11d)||_0x3a19aa==='company'||_0x3a19aa===_0x4b11cd(0x111);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x51c20c,_0x37263d){const _0x1c12b7=a150_0x1209,_0x4c8227=_0x51c20c();while(!![]){try{const _0x417e51=parseInt(_0x1c12b7(0x14d))/0x1*(-parseInt(_0x1c12b7(0x159))/0x2)+-parseInt(_0x1c12b7(0x15c))/0x3+parseInt(_0x1c12b7(0x162))/0x4+-parseInt(_0x1c12b7(0x164))/0x5*(-parseInt(_0x1c12b7(0x14f))/0x6)+-parseInt(_0x1c12b7(0x154))/0x7*(parseInt(_0x1c12b7(0x156))/0x8)+parseInt(_0x1c12b7(0x15e))/0x9*(parseInt(_0x1c12b7(0x151))/0xa)+-parseInt(_0x1c12b7(0x14e))/0xb*(-parseInt(_0x1c12b7(0x15f))/0xc);if(_0x417e51===_0x37263d)break;else _0x4c8227['push'](_0x4c8227['shift']());}catch(_0x3f423c){_0x4c8227['push'](_0x4c8227['shift']());}}}(a150_0x1e1b,0x4501a));import{unzipSync,zipSync}from'fflate';import{CliErrors}from'../../errors.js';function a150_0x1209(_0x37ce05,_0x53ff60){_0x37ce05=_0x37ce05-0x14c;const _0x1e1b7d=a150_0x1e1b();let _0x120997=_0x1e1b7d[_0x37ce05];return _0x120997;}import{compareSkillFiles,fileContent,normalizeLocalFiles,normalizeSkillRelativePath}from'./local-files.js';const ZIP_MTIME=new Date('1980-01-01T00:00:00.000Z');export function createDeterministicZipPackage(_0x2052a7){const _0x5df10e=a150_0x1209,_0x30d986={};for(const _0x569fb4 of normalizeLocalFiles(_0x2052a7)){_0x30d986[_0x569fb4[_0x5df10e(0x14c)]]=fileContent(_0x569fb4);}return Buffer[_0x5df10e(0x155)](zipSync(_0x30d986,{'level':0x0,'mtime':ZIP_MTIME}));}export function parseZipPackage(_0x17fdbf){const _0x2fb74d=a150_0x1209;if(_0x17fdbf[_0x2fb74d(0x150)]<0x16)throw CliErrors[_0x2fb74d(0x15d)]('Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.');let _0x4027c4;try{_0x4027c4=unzipSync(_0x17fdbf,{'filter'(_0xf4dc30){const _0x277097=_0x2fb74d,_0x1c8d78=normalizeSkillRelativePath(_0xf4dc30[_0x277097(0x15a)]);if(_0x1c8d78[_0x277097(0x157)]('/'))throw CliErrors[_0x277097(0x15d)]('Runtime\x20Skill\x20package\x20contains\x20directory\x20entry:\x20'+_0x1c8d78);return!![];}});}catch(_0x26b0d6){if(isRuntimeSkillValidationError(_0x26b0d6))throw _0x26b0d6;throw CliErrors['validation'](_0x2fb74d(0x158));}return Object[_0x2fb74d(0x153)](_0x4027c4)[_0x2fb74d(0x15b)](([_0x3c94bb,_0x3ea6d4])=>({'path':normalizeSkillRelativePath(_0x3c94bb),'bytes':Buffer['from'](_0x3ea6d4)}))[_0x2fb74d(0x163)](compareSkillFiles);}function a150_0x1e1b(){const _0x39775c=['length','70VOTKgc','code','entries','7sXNMAA','from','334928ZBVwPa','endsWith','Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.','34742RpIQfN','name','map','1600860jhIicX','validation','110061YlxjBq','7524JqYUIh','validation_error','object','1255464yUQEfk','sort','10gftOsM','path','2nPZBWQ','8503BfMyJZ','26214levyXJ'];a150_0x1e1b=function(){return _0x39775c;};return a150_0x1e1b();}function isRuntimeSkillValidationError(_0x45c70a){const _0x5ec3d1=a150_0x1209;return typeof _0x45c70a===_0x5ec3d1(0x161)&&_0x45c70a!==null&&'code'in _0x45c70a&&_0x45c70a[_0x5ec3d1(0x152)]===_0x5ec3d1(0x160);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x31bb5f,_0x2ce11c){const _0x226251=a151_0x3cb7,_0x517747=_0x31bb5f();while(!![]){try{const _0x2fb903=-parseInt(_0x226251(0x9d))/0x1*(parseInt(_0x226251(0xae))/0x2)+parseInt(_0x226251(0xb4))/0x3*(-parseInt(_0x226251(0xaf))/0x4)+-parseInt(_0x226251(0x95))/0x5+-parseInt(_0x226251(0xb0))/0x6*(parseInt(_0x226251(0x96))/0x7)+-parseInt(_0x226251(0xa4))/0x8+-parseInt(_0x226251(0x8e))/0x9*(-parseInt(_0x226251(0x8c))/0xa)+parseInt(_0x226251(0x92))/0xb;if(_0x2fb903===_0x2ce11c)break;else _0x517747['push'](_0x517747['shift']());}catch(_0xda5b63){_0x517747['push'](_0x517747['shift']());}}}(a151_0x57f9,0x5434f));import{CliErrors}from'../../errors.js';import{SKILL_FILE}from'./constants.js';import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';function a151_0x57f9(){const _0x28320f=['\x20in\x20Skill\x20file\x20package.','Runtime\x20Skill\x20package\x20is\x20missing\x20entry:\x20','ossPath','310lrdjRY','has','object','Runtime\x20Skill\x20package\x20sha256\x20is\x20invalid.','files','map','Runtime\x20Skill\x20package\x20file\x20sha256\x20mismatch:\x20','4191616HZUdTh','isSafeInteger','path','some','validation','Runtime\x20Skill\x20manifest\x20is\x20missing\x20','Runtime\x20Skill\x20file\x20tree\x20sha256\x20is\x20invalid.','schemaVersion','string','base64','144YHhpKt','4WFlEGz','960486YalGwn','push','Duplicate\x20Skill\x20package\x20entry:\x20','length','1656030yuxQhA','Runtime\x20Skill\x20package\x20sha256\x20mismatch.','isArray','trim','Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.','Runtime\x20Skill\x20package\x20entry\x20list\x20mismatch.','sha256','1501630WAoRIl','toString','18kADCqG','Runtime\x20Skill\x20package\x20is\x20required\x20for\x20Skill\x20install:\x20','bytes','zipSize','19284650RQMryq','toLowerCase','Runtime\x20Skill\x20file\x20tree\x20sha256\x20mismatch.','1450605BqBEFu','14lChONK','zipSha256','Runtime\x20Skill\x20package\x20is\x20missing\x20','treeSha256'];a151_0x57f9=function(){return _0x28320f;};return a151_0x57f9();}import{fileContent,isSha256Hex,normalizeLocalFiles,normalizeManifestFiles}from'./local-files.js';import{createDeterministicZipPackage,parseZipPackage}from'./zip-codec.js';export function buildSkillPackage(_0x327bb8){const _0x49770c=a151_0x3cb7,_0x1e1776=normalizeLocalFiles(_0x327bb8);if(!_0x1e1776[_0x49770c(0xa7)](_0x2d0a4b=>_0x2d0a4b['path']===SKILL_FILE))throw CliErrors['validation']('Missing\x20'+SKILL_FILE+_0x49770c(0x9a));const _0x24b5ed=localFilesToManifestFiles(_0x1e1776),_0x323fe6=createDeterministicZipPackage(_0x1e1776);return{'manifest':{'schemaVersion':0x2,'treeSha256':fileTreeHash(_0x24b5ed),'zipSha256':bufferSha256(_0x323fe6),'zipSize':_0x323fe6['length'],'files':_0x24b5ed},'packageBytes':_0x323fe6,'packageBase64':_0x323fe6[_0x49770c(0x8d)](_0x49770c(0xad))};}export function verifyRuntimeSkillPackage(_0x3c3e6d,_0x28ea23){const _0x26329b=a151_0x3cb7,_0x2328f5=normalizePackageManifest(_0x3c3e6d,{'requireOssPath':![]});if(!_0x2328f5)throw CliErrors['validation'](_0x26329b(0x89));return extractAndVerifyPackage(_0x2328f5,_0x28ea23);}export function verifyRuntimeSkillBundle(_0x2a2300,_0x1273e8){const _0x48954d=a151_0x3cb7,_0x2a4a2a=normalizePackageManifest(_0x2a2300,{'requireOssPath':![]});if(!_0x2a4a2a)throw CliErrors['validation'](_0x48954d(0x89));return extractAndVerifyPackageFiles(_0x2a4a2a,_0x1273e8);}export function tryNormalizePackageManifest(_0x452f22){return normalizePackageManifest(_0x452f22,{'requireOssPath':![]});}function a151_0x3cb7(_0xbeee45,_0x4d9d8b){_0xbeee45=_0xbeee45-0x87;const _0x57f980=a151_0x57f9();let _0x3cb7e6=_0x57f980[_0xbeee45];return _0x3cb7e6;}export function requirePackageBytes(_0x2a3641,_0x4b32ed){const _0x57381a=a151_0x3cb7;if(!_0x4b32ed||_0x4b32ed[_0x57381a(0xb3)]===0x0)throw CliErrors[_0x57381a(0xa8)](_0x57381a(0x8f)+_0x2a3641);return _0x4b32ed;}export function extractDownloadedPackage(_0x401c7b){const _0x45b374=a151_0x3cb7,_0x18eaa9=parseZipPackage(_0x401c7b)['map'](_0x29a8bd=>({'path':_0x29a8bd[_0x45b374(0xa6)],'bytes':_0x29a8bd[_0x45b374(0x90)]}));if(!_0x18eaa9[_0x45b374(0xa7)](_0x46c132=>_0x46c132[_0x45b374(0xa6)]===SKILL_FILE))throw CliErrors[_0x45b374(0xa8)](_0x45b374(0x98)+SKILL_FILE+'.');return normalizeLocalFiles(_0x18eaa9);}export function localFilesToManifestFiles(_0x130b30){const _0x2d35bd=a151_0x3cb7;return normalizeLocalFiles(_0x130b30)[_0x2d35bd(0xa2)](_0x55a040=>({'path':_0x55a040[_0x2d35bd(0xa6)],'sha256':fileHash(_0x55a040),'size':fileContent(_0x55a040)[_0x2d35bd(0xb3)]}));}function normalizePackageManifest(_0x4fb1aa,_0x246eeb){const _0x48aa2d=a151_0x3cb7;if(!_0x4fb1aa||typeof _0x4fb1aa!==_0x48aa2d(0x9f)||Array[_0x48aa2d(0x87)](_0x4fb1aa))return undefined;const _0x1feb94=_0x4fb1aa,_0x43e75f=typeof _0x1feb94[_0x48aa2d(0x9c)]===_0x48aa2d(0xac)?_0x1feb94[_0x48aa2d(0x9c)][_0x48aa2d(0x88)]():undefined;if(_0x246eeb['requireOssPath']&&!_0x43e75f)return undefined;if(!Array[_0x48aa2d(0x87)](_0x1feb94['files'])||_0x1feb94[_0x48aa2d(0xa1)][_0x48aa2d(0xb3)]===0x0)return undefined;if(!isSha256Hex(_0x1feb94[_0x48aa2d(0x99)]))throw CliErrors['validation'](_0x48aa2d(0xaa));if(!isSha256Hex(_0x1feb94[_0x48aa2d(0x97)]))throw CliErrors[_0x48aa2d(0xa8)](_0x48aa2d(0xa0));if(!Number[_0x48aa2d(0xa5)](_0x1feb94['zipSize'])||_0x1feb94[_0x48aa2d(0x91)]<0x0)throw CliErrors[_0x48aa2d(0xa8)]('Runtime\x20Skill\x20package\x20size\x20is\x20invalid.');const _0x4e62d7=normalizeManifestFiles(_0x1feb94[_0x48aa2d(0xa1)]);if(!_0x4e62d7[_0x48aa2d(0xa7)](_0x15ba44=>_0x15ba44['path']===SKILL_FILE))throw CliErrors[_0x48aa2d(0xa8)](_0x48aa2d(0xa9)+SKILL_FILE+'.');const _0x136861=fileTreeHash(_0x4e62d7);if(_0x136861!==_0x1feb94[_0x48aa2d(0x99)][_0x48aa2d(0x93)]())throw CliErrors[_0x48aa2d(0xa8)](_0x48aa2d(0x94));return{'schemaVersion':Number[_0x48aa2d(0xa5)](_0x1feb94[_0x48aa2d(0xab)])?_0x1feb94[_0x48aa2d(0xab)]:0x2,'ossPath':_0x43e75f,'treeSha256':_0x136861,'zipSha256':_0x1feb94['zipSha256'][_0x48aa2d(0x93)](),'zipSize':_0x1feb94['zipSize'],'files':_0x4e62d7};}function extractAndVerifyPackage(_0x2b83f1,_0x5b6be2){const _0x143795=a151_0x3cb7,_0x59b82c=normalizePackageManifest(_0x2b83f1,{'requireOssPath':![]});if(!_0x59b82c)throw CliErrors[_0x143795(0xa8)](_0x143795(0x89));if(_0x5b6be2[_0x143795(0xb3)]!==_0x59b82c[_0x143795(0x91)])throw CliErrors[_0x143795(0xa8)]('Runtime\x20Skill\x20package\x20size\x20mismatch.');const _0x4e5364=bufferSha256(_0x5b6be2);if(_0x4e5364!==_0x59b82c[_0x143795(0x97)])throw CliErrors[_0x143795(0xa8)](_0x143795(0xb5));return extractAndVerifyPackageFiles(_0x59b82c,_0x5b6be2);}function extractAndVerifyPackageFiles(_0x5c9fd3,_0x292b0b){const _0x56d417=a151_0x3cb7,_0xb003c8=parseZipPackage(_0x292b0b);if(_0xb003c8['length']!==_0x5c9fd3[_0x56d417(0xa1)][_0x56d417(0xb3)])throw CliErrors['validation'](_0x56d417(0x8a));const _0xcfd546=new Map();for(const _0x459a61 of _0xb003c8){if(_0xcfd546[_0x56d417(0x9e)](_0x459a61['path']))throw CliErrors[_0x56d417(0xa8)](_0x56d417(0xb2)+_0x459a61[_0x56d417(0xa6)]);_0xcfd546['set'](_0x459a61[_0x56d417(0xa6)],_0x459a61);}const _0x593d85=[];for(const _0x1ca070 of _0x5c9fd3[_0x56d417(0xa1)]){const _0x1f227c=_0xcfd546['get'](_0x1ca070[_0x56d417(0xa6)]);if(!_0x1f227c)throw CliErrors[_0x56d417(0xa8)](_0x56d417(0x9b)+_0x1ca070[_0x56d417(0xa6)]);if(_0x1f227c['bytes'][_0x56d417(0xb3)]!==_0x1ca070['size'])throw CliErrors[_0x56d417(0xa8)]('Runtime\x20Skill\x20package\x20file\x20size\x20mismatch:\x20'+_0x1ca070['path']);const _0x4968ba=bufferSha256(_0x1f227c['bytes']);if(_0x4968ba!==_0x1ca070[_0x56d417(0x8b)])throw CliErrors['validation'](_0x56d417(0xa3)+_0x1ca070[_0x56d417(0xa6)]);_0x593d85[_0x56d417(0xb1)]({'path':_0x1ca070[_0x56d417(0xa6)],'bytes':_0x1f227c[_0x56d417(0x90)]});}return normalizeLocalFiles(_0x593d85);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xadca29,_0x203c27){var _0x38a642=a152_0x528e,_0x47eb31=_0xadca29();while(!![]){try{var _0x1816c6=parseInt(_0x38a642(0xe2))/0x1*(parseInt(_0x38a642(0xdd))/0x2)+-parseInt(_0x38a642(0xde))/0x3*(-parseInt(_0x38a642(0xe5))/0x4)+-parseInt(_0x38a642(0xe3))/0x5*(parseInt(_0x38a642(0xdf))/0x6)+parseInt(_0x38a642(0xe1))/0x7*(parseInt(_0x38a642(0xe4))/0x8)+parseInt(_0x38a642(0xe6))/0x9+parseInt(_0x38a642(0xe0))/0xa+-parseInt(_0x38a642(0xdb))/0xb*(parseInt(_0x38a642(0xdc))/0xc);if(_0x1816c6===_0x203c27)break;else _0x47eb31['push'](_0x47eb31['shift']());}catch(_0x226be1){_0x47eb31['push'](_0x47eb31['shift']());}}}(a152_0x9f7f,0x2d546));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';function a152_0x9f7f(){var _0x4c4a4f=['313130VWOfjV','38129iqkFPh','1YAkwUS','126065Bbuxwq','264hQbabw','1324IjpFja','2832210LsFHlx','8041VUhbov','3984zsdYKB','510518jpWYKh','3OslmXO','84lvKkqx'];a152_0x9f7f=function(){return _0x4c4a4f;};return a152_0x9f7f();}function a152_0x528e(_0x5ae94e,_0x29c0f9){_0x5ae94e=_0x5ae94e-0xdb;var _0x9f7f5a=a152_0x9f7f();var _0x528e33=_0x9f7f5a[_0x5ae94e];return _0x528e33;}export{materializeRuntimeSkill,reuseMaterializedRuntimeSkill}from'./runtime-skill-sync/materialize.js';export{readMetadataIfPresent}from'./runtime-skill-sync/metadata.js';export{getRuntimeSkillCacheRoot,getRuntimeSkillDir,resolveSkillSyncPaths,runtimeAgentSkillRoots}from'./runtime-skill-sync/paths.js';export{deriveSkillCodeFromDirectory,readPushDirectory,refreshPushDirectoryMetadataFromRemote,recordPushedRuntimeSkill,resolvePushDirectoryIdentity}from'./runtime-skill-sync/push.js';export{buildSkillPackage,verifyRuntimeSkillBundle,verifyRuntimeSkillPackage}from'./runtime-skill-sync/zip-package.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a153_0x7568b8=a153_0x2381;(function(_0x129c0e,_0x127f79){const _0x4f19ca=a153_0x2381,_0xd8d9b2=_0x129c0e();while(!![]){try{const _0x1d2699=-parseInt(_0x4f19ca(0x7a))/0x1+-parseInt(_0x4f19ca(0x9a))/0x2+-parseInt(_0x4f19ca(0x93))/0x3+parseInt(_0x4f19ca(0x7b))/0x4+parseInt(_0x4f19ca(0x84))/0x5*(parseInt(_0x4f19ca(0x83))/0x6)+-parseInt(_0x4f19ca(0x78))/0x7+-parseInt(_0x4f19ca(0x88))/0x8*(parseInt(_0x4f19ca(0x85))/0x9);if(_0x1d2699===_0x127f79)break;else _0xd8d9b2['push'](_0xd8d9b2['shift']());}catch(_0x1d16ce){_0xd8d9b2['push'](_0xd8d9b2['shift']());}}}(a153_0x12d9,0x64714));import{existsSync,readFileSync}from'node:fs';function a153_0x12d9(){const _0x17a07b=['57262TRorRd','3168844LJBttB','present','absent','recorded','home','\x20records\x20\x22','.agents','unusable','4875018nmlcfZ','5CCUJlR','1413ObTxgY','includes','map','200zMkziI','object','SKILL.md','find','join','parse','reason','not-recorded','unverifiable','number','skills','416259qCAygw','lockFile','\x20is\x20unreadable:\x20','utf8','.skill-lock.json','version','.claude','1378144nlKRSG','2130030pNCKrc','kind'];a153_0x12d9=function(){return _0x17a07b;};return a153_0x12d9();}import{homedir}from'node:os';import{join}from'node:path';export const SKILL_LOCK_RELATIVE_PATH=join('.agents',a153_0x7568b8(0x97));export const GLOBAL_SKILLS_DIR_RELATIVE_PATHS=[join(a153_0x7568b8(0x81),a153_0x7568b8(0x92)),join(a153_0x7568b8(0x99),a153_0x7568b8(0x92))];const SUPPORTED_LOCK_VERSIONS=[0x3];function a153_0x2381(_0x4cf8bf,_0x1ccef2){_0x4cf8bf=_0x4cf8bf-0x78;const _0x12d929=a153_0x12d9();let _0x238179=_0x12d929[_0x4cf8bf];return _0x238179;}function readLockLookup(_0x43417d,_0x425277){const _0x135605=a153_0x7568b8;if(!existsSync(_0x43417d))return{'kind':_0x135605(0x8f)};let _0x44ccf8;try{_0x44ccf8=JSON[_0x135605(0x8d)](readFileSync(_0x43417d,_0x135605(0x96)));}catch(_0x281ecd){return{'kind':_0x135605(0x82),'reason':_0x43417d+_0x135605(0x95)+_0x281ecd['message']};}const _0x365fbb=_0x44ccf8;if(typeof _0x365fbb?.[_0x135605(0x98)]!==_0x135605(0x91)||!SUPPORTED_LOCK_VERSIONS[_0x135605(0x86)](_0x365fbb[_0x135605(0x98)]))return{'kind':_0x135605(0x82),'reason':_0x43417d+'\x20uses\x20unsupported\x20version\x20'+String(_0x365fbb?.[_0x135605(0x98)])};if(!_0x365fbb['skills']||typeof _0x365fbb['skills']!==_0x135605(0x89))return{'kind':_0x135605(0x82),'reason':_0x43417d+'\x20has\x20no\x20skills\x20map'};return _0x365fbb[_0x135605(0x92)][_0x425277]?{'kind':_0x135605(0x7e)}:{'kind':_0x135605(0x8f)};}export function resolveInstalledSkill(_0x3da057,_0x17ca98){const _0x3cfde3=a153_0x7568b8,_0x558bf3=_0x17ca98?.[_0x3cfde3(0x7f)]??homedir(),_0x59c7f4=_0x17ca98?.['globalSkillsDirs']??GLOBAL_SKILLS_DIR_RELATIVE_PATHS[_0x3cfde3(0x87)](_0x4ed4cb=>join(_0x558bf3,_0x4ed4cb)),_0x4560fb=_0x17ca98?.[_0x3cfde3(0x94)]??join(_0x558bf3,SKILL_LOCK_RELATIVE_PATH),_0x3dd4fc=_0x59c7f4['map'](_0x5c5e3c=>join(_0x5c5e3c,_0x3da057,_0x3cfde3(0x8a))),_0x3cca00=_0x3dd4fc[_0x3cfde3(0x8b)](_0xc47375=>existsSync(_0xc47375));if(_0x3cca00)return{'state':_0x3cfde3(0x7c),'path':_0x3cca00};const _0x55d6d8=readLockLookup(_0x4560fb,_0x3da057);if(_0x55d6d8[_0x3cfde3(0x79)]===_0x3cfde3(0x82))return{'state':_0x3cfde3(0x90),'reason':_0x55d6d8[_0x3cfde3(0x8e)]};if(_0x55d6d8[_0x3cfde3(0x79)]===_0x3cfde3(0x7e))return{'state':_0x3cfde3(0x90),'reason':_0x4560fb+_0x3cfde3(0x80)+_0x3da057+'\x22\x20but\x20no\x20SKILL.md\x20was\x20found\x20in\x20known\x20layouts\x20'+('('+_0x3dd4fc[_0x3cfde3(0x8c)](',\x20')+')')};return{'state':_0x3cfde3(0x7d),'checked':_0x3dd4fc};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a154_0x352d(){const _0x276343=['954468lbPAEI','<redacted>','hasOwnProperty','18WcvxYe','isArray','entries','fromEntries','445948LMpuNc','slice','prototype','accessKey','589981xnpmcZ','340370ZboMwQ','test','210540ykYQQQ','609831aCbLMv','apps','length','call','5PTXJEx','4BHvdqu','map','44GQnANG','709512KjiVhg','object'];a154_0x352d=function(){return _0x276343;};return a154_0x352d();}const a154_0x9d19c2=a154_0x2fc4;(function(_0x29f7f1,_0x49882a){const _0x11f8d5=a154_0x2fc4,_0x176ca9=_0x29f7f1();while(!![]){try{const _0x4ec446=parseInt(_0x11f8d5(0xfc))/0x1+parseInt(_0x11f8d5(0x10e))/0x2+-parseInt(_0x11f8d5(0xfd))/0x3*(parseInt(_0x11f8d5(0x102))/0x4)+parseInt(_0x11f8d5(0x101))/0x5*(-parseInt(_0x11f8d5(0x107))/0x6)+parseInt(_0x11f8d5(0x112))/0x7+-parseInt(_0x11f8d5(0x105))/0x8*(-parseInt(_0x11f8d5(0x10a))/0x9)+parseInt(_0x11f8d5(0x113))/0xa*(-parseInt(_0x11f8d5(0x104))/0xb);if(_0x4ec446===_0x49882a)break;else _0x176ca9['push'](_0x176ca9['shift']());}catch(_0x19bae0){_0x176ca9['push'](_0x176ca9['shift']());}}}(a154_0x352d,0x30040));const REDACTED_ACCESS_KEY=a154_0x9d19c2(0x108);export function maskCliAccessKey(_0x904232){const _0x1775e7=a154_0x9d19c2;if(typeof _0x904232!=='string'||_0x904232[_0x1775e7(0xff)]<=0x8)return REDACTED_ACCESS_KEY;return''+_0x904232[_0x1775e7(0x10f)](0x0,0x8)+'*'['repeat'](_0x904232['length']-0x8);}export function redactCliConfigCredentials(_0x1f2d0f){const _0x535a99=a154_0x9d19c2,_0x48ae96={..._0x1f2d0f};return Object[_0x535a99(0x110)][_0x535a99(0x109)]['call'](_0x48ae96,_0x535a99(0x111))&&(_0x48ae96['accessKey']=maskCliAccessKey(_0x48ae96[_0x535a99(0x111)])),_0x48ae96['apps']&&typeof _0x48ae96[_0x535a99(0xfe)]==='object'&&!Array[_0x535a99(0x10b)](_0x48ae96[_0x535a99(0xfe)])&&(_0x48ae96[_0x535a99(0xfe)]=redactLegacyAppCredentials(_0x48ae96['apps'])),_0x48ae96;}export function redactCliConfigValue(_0x2e12e6,_0x12b38f){const _0x5969b1=a154_0x9d19c2;if(_0x2e12e6===_0x5969b1(0x111)||/^apps\.[^.]+\.accessKey$/['test'](_0x2e12e6))return maskCliAccessKey(_0x12b38f);if(_0x2e12e6===_0x5969b1(0xfe)&&_0x12b38f&&typeof _0x12b38f===_0x5969b1(0x106)&&!Array[_0x5969b1(0x10b)](_0x12b38f))return redactLegacyAppCredentials(_0x12b38f);if(/^apps\.[^.]+$/[_0x5969b1(0x114)](_0x2e12e6)&&_0x12b38f&&typeof _0x12b38f===_0x5969b1(0x106)&&!Array[_0x5969b1(0x10b)](_0x12b38f)){const _0x53f2c3=_0x12b38f;return Object[_0x5969b1(0x110)]['hasOwnProperty'][_0x5969b1(0x100)](_0x53f2c3,_0x5969b1(0x111))?{..._0x53f2c3,'accessKey':maskCliAccessKey(_0x53f2c3[_0x5969b1(0x111)])}:_0x12b38f;}return _0x12b38f;}function a154_0x2fc4(_0xa8a5b4,_0x36619f){_0xa8a5b4=_0xa8a5b4-0xfc;const _0x352dce=a154_0x352d();let _0x2fc474=_0x352dce[_0xa8a5b4];return _0x2fc474;}function redactLegacyAppCredentials(_0x4df568){const _0xa9067=a154_0x9d19c2;return Object[_0xa9067(0x10d)](Object[_0xa9067(0x10c)](_0x4df568)[_0xa9067(0x103)](([_0x4141d3,_0x50577d])=>{const _0x23e305=_0xa9067;if(!_0x50577d||typeof _0x50577d!==_0x23e305(0x106)||Array[_0x23e305(0x10b)](_0x50577d))return[_0x4141d3,_0x50577d];const _0xbbe041={..._0x50577d};return Object[_0x23e305(0x110)]['hasOwnProperty']['call'](_0xbbe041,_0x23e305(0x111))&&(_0xbbe041[_0x23e305(0x111)]=maskCliAccessKey(_0xbbe041[_0x23e305(0x111)])),[_0x4141d3,_0xbbe041];}));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x117bc4,_0x133167){const _0x993d13=a155_0x3530,_0x3b85b6=_0x117bc4();while(!![]){try{const _0x399f03=-parseInt(_0x993d13(0x91))/0x1+-parseInt(_0x993d13(0x97))/0x2+-parseInt(_0x993d13(0x95))/0x3*(-parseInt(_0x993d13(0x92))/0x4)+parseInt(_0x993d13(0x93))/0x5+parseInt(_0x993d13(0x99))/0x6+parseInt(_0x993d13(0x96))/0x7+-parseInt(_0x993d13(0x98))/0x8*(-parseInt(_0x993d13(0x94))/0x9);if(_0x399f03===_0x133167)break;else _0x3b85b6['push'](_0x3b85b6['shift']());}catch(_0xd6aca7){_0x3b85b6['push'](_0x3b85b6['shift']());}}}(a155_0xafc9,0x29644));import{createJqFilter,resolveBundledJqPaths}from'@lovrabet/cli-framework';import{CliErrors}from'../errors.js';function a155_0xafc9(){const _0x40ede1=['816nTZEJs','1103985URMftH','1585377ogQXVM','876ksydpk','28035KPTNfc','328204KzzQDf','8npMTVa','728610ZDWawv','248316nWqGLk'];a155_0xafc9=function(){return _0x40ede1;};return a155_0xafc9();}function a155_0x3530(_0x161868,_0x1f3b06){_0x161868=_0x161868-0x91;const _0xafc976=a155_0xafc9();let _0x353071=_0xafc976[_0x161868];return _0x353071;}export const applyJqFilter=createJqFilter(CliErrors,{'bundledJqPaths':resolveBundledJqPaths()});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a156_0x1537(_0x168dcb,_0x34eae3){_0x168dcb=_0x168dcb-0x74;const _0x42198d=a156_0x4219();let _0x1537fd=_0x42198d[_0x168dcb];return _0x1537fd;}(function(_0xe3cc5e,_0x2cb259){const _0xb5fd64=a156_0x1537,_0x3df7c0=_0xe3cc5e();while(!![]){try{const _0x997a5a=parseInt(_0xb5fd64(0x7b))/0x1*(-parseInt(_0xb5fd64(0x74))/0x2)+parseInt(_0xb5fd64(0x82))/0x3+-parseInt(_0xb5fd64(0x80))/0x4+-parseInt(_0xb5fd64(0x87))/0x5+parseInt(_0xb5fd64(0x83))/0x6*(-parseInt(_0xb5fd64(0x77))/0x7)+-parseInt(_0xb5fd64(0x7a))/0x8*(parseInt(_0xb5fd64(0x75))/0x9)+parseInt(_0xb5fd64(0x81))/0xa;if(_0x997a5a===_0x2cb259)break;else _0x3df7c0['push'](_0x3df7c0['shift']());}catch(_0x498834){_0x3df7c0['push'](_0x3df7c0['shift']());}}}(a156_0x4219,0x70cd4));import a156_0x2f555c from'semver';import{LOVRABET_NPM_PACKAGE_NAME}from'../constant/distribution.js';import{CliErrors}from'../errors.js';import{getCliVersionPolicy}from'../utils/cli-version-policy.js';function a156_0x4219(){const _0xc3d319=['Minimum\x20supported:\x20','valid','minimumVersion','567565eUUzRe','stableVersion','belowMinimum','latest','unavailable','4QLRFdk','36MpTndH','currentVersion','4837GwHNdm','minimumVersionMessage','Upgrade\x20command:\x20','804704sZcAId','38941kPfSFL','filter','npm\x20install\x20-g\x20','Recommended\x20stable:\x20','Current\x20CLI\x20version\x20is\x20below\x20the\x20minimum\x20supported\x20version.','1478884fKWIUE','13735040auTZHh','1053609YOiGVv','2598kYayjW'];a156_0x4219=function(){return _0xc3d319;};return a156_0x4219();}import{getCliVersion}from'../utils/version.js';export function evaluateCliVersionPolicy(_0x5607d2,_0x3ff747){const _0x13d876=a156_0x1537,_0x3e78de=a156_0x2f555c[_0x13d876(0x85)](_0x5607d2)===_0x5607d2,_0x2494a3=_0x3ff747?.[_0x13d876(0x88)]??null,_0x3eba39=_0x3ff747?.[_0x13d876(0x86)]??null,_0x3ac1ba=Boolean(_0x3e78de&&_0x2494a3&&a156_0x2f555c['lt'](_0x5607d2,_0x2494a3)),_0x2b2ab1=Boolean(_0x3e78de&&_0x3eba39&&a156_0x2f555c['lt'](_0x5607d2,_0x3eba39));return{'currentVersion':_0x5607d2,'stableVersion':_0x2494a3,'minimumVersion':_0x3eba39,'needsUpgrade':_0x3ac1ba||_0x2b2ab1,'belowMinimum':_0x2b2ab1,'upgradeMessage':_0x3ff747?.['upgradeMessage'],'minimumVersionMessage':_0x3ff747?.[_0x13d876(0x78)]};}export async function checkCliVersion(){return evaluateCliVersionPolicy(getCliVersion(),await getCliVersionPolicy());}export function getCliUpgradeCommand(_0x134a2f){const _0x1a4bb8=a156_0x1537;return _0x1a4bb8(0x7d)+LOVRABET_NPM_PACKAGE_NAME+'@'+(_0x134a2f['stableVersion']??_0x1a4bb8(0x8a));}export function assertCliVersionSupported(_0x36f489){const _0x16b7a0=a156_0x1537;if(!_0x36f489[_0x16b7a0(0x89)])return;const _0x3e4d4d=[_0x36f489[_0x16b7a0(0x78)],'Current\x20version:\x20'+_0x36f489[_0x16b7a0(0x76)],_0x16b7a0(0x84)+_0x36f489[_0x16b7a0(0x86)],_0x16b7a0(0x7e)+(_0x36f489[_0x16b7a0(0x88)]??_0x16b7a0(0x8b)),_0x16b7a0(0x79)+getCliUpgradeCommand(_0x36f489)][_0x16b7a0(0x7c)](Boolean)['join']('\x0a');throw CliErrors['validation'](_0x16b7a0(0x7f),_0x3e4d4d);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x28022b,_0x15859f){const _0x324656=a157_0x3bea,_0xef869d=_0x28022b();while(!![]){try{const _0x1272a3=-parseInt(_0x324656(0xdf))/0x1+-parseInt(_0x324656(0xeb))/0x2+-parseInt(_0x324656(0xe2))/0x3*(-parseInt(_0x324656(0xe5))/0x4)+-parseInt(_0x324656(0xe1))/0x5*(-parseInt(_0x324656(0xea))/0x6)+-parseInt(_0x324656(0xee))/0x7*(parseInt(_0x324656(0xe4))/0x8)+parseInt(_0x324656(0xec))/0x9*(-parseInt(_0x324656(0xde))/0xa)+parseInt(_0x324656(0xe7))/0xb;if(_0x1272a3===_0x15859f)break;else _0xef869d['push'](_0xef869d['shift']());}catch(_0x20cc6b){_0xef869d['push'](_0xef869d['shift']());}}}(a157_0x5efc,0xbcc60));import a157_0x360623 from'semver';import{LOVRABET_CLI_VERSION_POLICY_URL}from'../constant/distribution.js';function a157_0x5efc(){const _0x1c5a3b=['object','20568orixhV','3065258xkWhZx','3678066KXZuhJ','application/json','1330ZRxYLn','stableVersion','now','timeout','latestVersion','cli','20EUlUww','1260850pUiAxO','json','520BUZqSC','1689JVqZjC','valid','27504gAXMTz','9028lNUuuq','minimumVersion','37510660jbziGu','trim'];a157_0x5efc=function(){return _0x1c5a3b;};return a157_0x5efc();}const SUCCESS_CACHE_TTL_MS=0x5*0x3c*0x3e8,FAILURE_CACHE_TTL_MS=0x3c*0x3e8,FETCH_TIMEOUT_MS=0x5dc;function pickString(_0xfcdefb){const _0x4df73a=a157_0x3bea;return typeof _0xfcdefb==='string'&&_0xfcdefb['trim']()?_0xfcdefb[_0x4df73a(0xe8)]():null;}function pickStrictSemver(_0x174663){const _0x30cad4=a157_0x3bea,_0x362829=pickString(_0x174663);return _0x362829&&a157_0x360623[_0x30cad4(0xe3)](_0x362829)===_0x362829?_0x362829:null;}export function normalizeCliVersionPolicy(_0xdf13c3){const _0x230a7a=a157_0x3bea;if(!_0xdf13c3||typeof _0xdf13c3!==_0x230a7a(0xe9))return null;const _0xed16f9=_0xdf13c3,_0x3544da=_0xed16f9[_0x230a7a(0xdd)]&&typeof _0xed16f9[_0x230a7a(0xdd)]===_0x230a7a(0xe9)?_0xed16f9[_0x230a7a(0xdd)]:_0xed16f9,_0x5df16a=pickStrictSemver(_0x3544da[_0x230a7a(0xef)]??_0x3544da[_0x230a7a(0xdc)]??_0x3544da['recommendedVersion']),_0x5c4b2b=pickStrictSemver(_0x3544da[_0x230a7a(0xe6)]??_0x3544da['minVersion']);if(!_0x5df16a&&!_0x5c4b2b)return null;if(_0x5df16a&&_0x5c4b2b&&a157_0x360623['gt'](_0x5c4b2b,_0x5df16a))return null;return{'stableVersion':_0x5df16a,'minimumVersion':_0x5c4b2b,'upgradeMessage':pickString(_0x3544da['upgradeMessage'])??undefined,'minimumVersionMessage':pickString(_0x3544da['minimumVersionMessage'])??undefined};}function a157_0x3bea(_0x3cf3cd,_0xd3c74d){_0x3cf3cd=_0x3cf3cd-0xdb;const _0x5efc18=a157_0x5efc();let _0x3bead0=_0x5efc18[_0x3cf3cd];return _0x3bead0;}export async function fetchCliVersionPolicy(){const _0x46e608=a157_0x3bea;try{const _0x30534c=await fetch(LOVRABET_CLI_VERSION_POLICY_URL,{'headers':{'Accept':_0x46e608(0xed)},'signal':AbortSignal[_0x46e608(0xdb)](FETCH_TIMEOUT_MS)});if(!_0x30534c['ok'])return null;return normalizeCliVersionPolicy(await _0x30534c[_0x46e608(0xe0)]());}catch{return null;}}let cachedPolicy=null,cachedAt=0x0,hasCachedPolicy=![],pendingPolicy=null;export async function getCliVersionPolicy(){const _0x1abfd5=Date['now']();if(hasCachedPolicy){const _0x425a68=cachedPolicy?SUCCESS_CACHE_TTL_MS:FAILURE_CACHE_TTL_MS;if(_0x1abfd5-cachedAt<_0x425a68)return cachedPolicy;}if(pendingPolicy)return pendingPolicy;return pendingPolicy=fetchCliVersionPolicy()['then'](_0x34404f=>{const _0x2cc861=a157_0x3bea;return cachedPolicy=_0x34404f,cachedAt=Date[_0x2cc861(0xf0)](),hasCachedPolicy=!![],_0x34404f;})['finally'](()=>{pendingPolicy=null;}),pendingPolicy;}export function clearCliVersionPolicyCache(){cachedPolicy=null,cachedAt=0x0,hasCachedPolicy=![],pendingPolicy=null;}
|
package/lib/utils/logger.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a158_0x412041=a158_0xc3ac;(function(_0x5515bd,_0x570116){const _0x1b26ec=a158_0xc3ac,_0x49e45d=_0x5515bd();while(!![]){try{const _0x36be11=parseInt(_0x1b26ec(0xdd))/0x1+-parseInt(_0x1b26ec(0xdf))/0x2+-parseInt(_0x1b26ec(0xec))/0x3+-parseInt(_0x1b26ec(0xf6))/0x4*(parseInt(_0x1b26ec(0xc8))/0x5)+-parseInt(_0x1b26ec(0xe4))/0x6*(-parseInt(_0x1b26ec(0xc7))/0x7)+-parseInt(_0x1b26ec(0xf5))/0x8*(-parseInt(_0x1b26ec(0xf8))/0x9)+parseInt(_0x1b26ec(0xf3))/0xa*(-parseInt(_0x1b26ec(0xeb))/0xb);if(_0x36be11===_0x570116)break;else _0x49e45d['push'](_0x49e45d['shift']());}catch(_0x4e0fee){_0x49e45d['push'](_0x49e45d['shift']());}}}(a158_0x3ad1,0xb35b9));import a158_0x3d74af from'winston';import a158_0x2dcadc from'node:fs';function a158_0x3ad1(){const _0x5d0e25=['addColors','11RgwmvW','492501wFUHZb','error','initWinstonLogger','map','existsSync','printf','errors','1389940ICovel','utf8','2317736CygQyl','4PvtvHx','timestamp','27vculYP','toISOString','winstonLogger','format','parse','14lReqsa','4410145TcDxcK','readLogs','getWinstonInstance','rawCommand','info','blue','command','clear','split','now','Starting:\x20','setRawCommand','success','currentRawCommand','transports','Completed:\x20','filter','message','warn','log','logFilePath','1326986CrHjxJ','details','2566968fJdIhv','setLogPath','trim','combine','readFileSync','3021558FhtpNQ','clearLogs','Failed\x20to\x20clear\x20logs:','createLogger','duration','dirname'];a158_0x3ad1=function(){return _0x5d0e25;};return a158_0x3ad1();}import a158_0x2a0982 from'node:path';function a158_0xc3ac(_0x2d14da,_0x244365){_0x2d14da=_0x2d14da-0xc5;const _0x3ad186=a158_0x3ad1();let _0xc3acc=_0x3ad186[_0x2d14da];return _0xc3acc;}import{PRODUCT_CONFIG}from'../constant/product.js';class Logger{[a158_0x412041(0xfa)];[a158_0x412041(0xdc)]='';[a158_0x412041(0xd5)]='';constructor(){}[a158_0x412041(0xd3)](_0x92f0d){this['currentRawCommand']=_0x92f0d;}[a158_0x412041(0xe0)](_0x201485){const _0x456725=a158_0x412041;this[_0x456725(0xdc)]=a158_0x2a0982['join'](_0x201485,PRODUCT_CONFIG['logFileName']),this[_0x456725(0xfa)]&&this['winstonLogger'][_0x456725(0xcf)](),this[_0x456725(0xee)]();}['initWinstonLogger'](){const _0x4fd11e=a158_0x412041,_0x47361b=a158_0x2a0982[_0x4fd11e(0xe9)](this['logFilePath']);!a158_0x2dcadc[_0x4fd11e(0xf0)](_0x47361b)&&a158_0x2dcadc['mkdirSync'](_0x47361b,{'recursive':!![]});const _0x1be84c=a158_0x3d74af['format'][_0x4fd11e(0xe2)](a158_0x3d74af[_0x4fd11e(0xc5)][_0x4fd11e(0xf7)](),a158_0x3d74af[_0x4fd11e(0xc5)][_0x4fd11e(0xf2)]({'stack':!![]}),a158_0x3d74af[_0x4fd11e(0xc5)][_0x4fd11e(0xf1)](_0x212c5f=>{const _0xfb2842=_0x4fd11e,_0x52799f={'timestamp':_0x212c5f['timestamp']||new Date()[_0xfb2842(0xf9)](),'level':_0x212c5f['level']||_0xfb2842(0xcc),'command':_0x212c5f[_0xfb2842(0xce)]||'unknown','rawCommand':_0x212c5f[_0xfb2842(0xcb)]||this[_0xfb2842(0xd5)]||undefined,'message':_0x212c5f[_0xfb2842(0xd9)]||'','duration':_0x212c5f[_0xfb2842(0xe8)]||undefined,'details':_0x212c5f[_0xfb2842(0xde)]||undefined};return JSON['stringify'](_0x52799f);}));this[_0x4fd11e(0xfa)]=a158_0x3d74af[_0x4fd11e(0xe7)]({'level':_0x4fd11e(0xcc),'format':_0x1be84c,'transports':[new a158_0x3d74af[(_0x4fd11e(0xd6))]['File']({'filename':this[_0x4fd11e(0xdc)],'level':_0x4fd11e(0xcc)})],'silent':![]}),a158_0x3d74af[_0x4fd11e(0xea)]({'success':'green','error':'red','warn':'yellow','info':_0x4fd11e(0xcd)});}[a158_0x412041(0xcc)](_0x489fbe,_0x3bc65f,_0x56e2f4){const _0x276af2=a158_0x412041;if(!this[_0x276af2(0xdc)]||!this[_0x276af2(0xfa)])return;this[_0x276af2(0xfa)][_0x276af2(0xcc)](_0x3bc65f,{'command':_0x489fbe,'details':_0x56e2f4});}[a158_0x412041(0xd4)](_0x35826a,_0x5395c2,_0x1165f3,_0x4993b7){const _0x1e3a19=a158_0x412041;if(!this[_0x1e3a19(0xdc)]||!this['winstonLogger'])return;this[_0x1e3a19(0xfa)][_0x1e3a19(0xdb)](_0x1e3a19(0xcc),_0x5395c2,{'level':'success','command':_0x35826a,'duration':_0x1165f3,'details':_0x4993b7});}[a158_0x412041(0xed)](_0x2de5cf,_0x325c58,_0x2d9754){const _0x1739c2=a158_0x412041;if(!this[_0x1739c2(0xdc)]||!this[_0x1739c2(0xfa)])return;this[_0x1739c2(0xfa)]['error'](_0x325c58,{'command':_0x2de5cf,'details':_0x2d9754});}['warn'](_0x1e8b72,_0x560d3f,_0x4e5f04){const _0x3ac48b=a158_0x412041;if(!this['logFilePath']||!this[_0x3ac48b(0xfa)])return;this['winstonLogger'][_0x3ac48b(0xda)](_0x560d3f,{'command':_0x1e8b72,'details':_0x4e5f04});}async['logTask'](_0x14a5b0,_0x1d3c4d,_0x29cab6){const _0x444db7=a158_0x412041,_0xb3bbe2=Date[_0x444db7(0xd1)]();this[_0x444db7(0xcc)](_0x14a5b0,_0x444db7(0xd2)+_0x1d3c4d);try{const _0x5d2753=await _0x29cab6(),_0x71ef03=Date['now']()-_0xb3bbe2;return this['success'](_0x14a5b0,_0x444db7(0xd7)+_0x1d3c4d,_0x71ef03),_0x5d2753;}catch(_0x4d7665){const _0x32a6b1=Date[_0x444db7(0xd1)]()-_0xb3bbe2;this['error'](_0x14a5b0,'Failed:\x20'+_0x1d3c4d,{'error':_0x4d7665 instanceof Error?_0x4d7665[_0x444db7(0xd9)]:String(_0x4d7665),'duration':_0x32a6b1});throw _0x4d7665;}}[a158_0x412041(0xc9)](){const _0x30d28f=a158_0x412041;try{if(!a158_0x2dcadc[_0x30d28f(0xf0)](this[_0x30d28f(0xdc)]))return[];const _0x3f2e80=a158_0x2dcadc[_0x30d28f(0xe3)](this[_0x30d28f(0xdc)],_0x30d28f(0xf4));return _0x3f2e80[_0x30d28f(0xd0)](/\r?\n/)[_0x30d28f(0xd8)](_0x2b4671=>_0x2b4671[_0x30d28f(0xe1)]())[_0x30d28f(0xef)](_0x10073e=>JSON[_0x30d28f(0xc6)](_0x10073e));}catch(_0x184648){return console[_0x30d28f(0xda)]('Failed\x20to\x20read\x20logs:',_0x184648),[];}}[a158_0x412041(0xe5)](){const _0x195fc6=a158_0x412041;try{a158_0x2dcadc[_0x195fc6(0xf0)](this[_0x195fc6(0xdc)])&&a158_0x2dcadc['writeFileSync'](this[_0x195fc6(0xdc)],'',_0x195fc6(0xf4));}catch(_0x321a12){console[_0x195fc6(0xda)](_0x195fc6(0xe6),_0x321a12);}}[a158_0x412041(0xca)](){return this['winstonLogger'];}}export const logger=new Logger();
|