@lovrabet/lovrabet-cli 2.3.10-beta.2 → 2.3.10-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli.js +1 -1
- package/lib/commands/api-doc/index.js +1 -1
- package/lib/commands/app/cache.js +1 -1
- package/lib/commands/app/definitions.js +1 -1
- package/lib/commands/app/eligibility.js +1 -1
- package/lib/commands/app/mock-loader.js +1 -1
- package/lib/commands/app/remote-source.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/approval/index.js +1 -1
- package/lib/commands/artifact/index.js +1 -1
- package/lib/commands/auth/device.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/auth/prompt.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/exec.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/common/config-policy.js +1 -1
- package/lib/commands/common/constraints.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/config/definitions.js +1 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/import-excel.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/issue/context.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/permit/dataset-get.js +1 -1
- package/lib/commands/permit/dataset-set.js +1 -1
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.js +1 -1
- package/lib/commands/personal-bff/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/schedule/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/service/dynamic.js +1 -1
- package/lib/commands/service/function-name-adapter.js +1 -1
- package/lib/commands/service/index.js +1 -1
- package/lib/commands/service/registry.js +1 -1
- package/lib/commands/skill/commands/create.js +1 -1
- package/lib/commands/skill/commands/diagram.js +1 -1
- package/lib/commands/skill/commands/install.js +1 -1
- package/lib/commands/skill/commands/list.js +1 -1
- package/lib/commands/skill/commands/push.js +1 -1
- package/lib/commands/skill/commands/validate.js +1 -1
- package/lib/commands/skill/diagram.js +1 -1
- package/lib/commands/skill/flags.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/skill/manifest-helpers.js +1 -1
- package/lib/commands/skill/push-execute.js +1 -1
- package/lib/commands/skill/push-flow-helpers.js +1 -1
- package/lib/commands/skill/push-retarget.js +1 -1
- package/lib/commands/skill/scopes.js +1 -1
- package/lib/commands/skill/summary.js +1 -1
- package/lib/commands/skill/templates.js +1 -1
- package/lib/commands/skill/validate.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/update.js +1 -1
- package/lib/commands/user-account/bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/config/domain-config.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/app.js +1 -1
- package/lib/constant/auth-mode.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/distribution.js +1 -1
- package/lib/constant/domain.d.ts +1 -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.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/kb-management-client.js +1 -1
- package/lib/core/kb-sdk-errors.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/access-error.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 +4 -1
- package/lib/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.d.ts +2 -2
- 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/services/dataset-import/auto-id-runner.js +1 -1
- package/lib/services/dataset-import/excel-reader.js +1 -1
- package/lib/services/dataset-import/image-bytes.js +1 -1
- package/lib/services/dataset-import/image-ooxml.js +1 -1
- package/lib/services/dataset-import/image-runner.js +1 -1
- package/lib/services/dataset-import/metadata.js +1 -1
- package/lib/services/dataset-import/preview.js +1 -1
- package/lib/services/dataset-import/runner.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/positive-safe-integer.js +1 -1
- package/lib/utils/redaction.js +1 -1
- package/lib/utils/runtime-user-id.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/lovrabet/SKILL.md +1 -1
- package/skills/lovrabet/references/lovrabet-config-commands.md +17 -33
- package/skills/lovrabet/references/lovrabet-config.md +11 -3
- package/skills/lovrabet/references/lovrabet-doctor.md +1 -1
- package/skills/lovrabet/references/lovrabet-kb-workflow.md +4 -4
- package/skills/lovrabet.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x53d65a,_0x121f63){const _0x34b8d6=a160_0x302c,_0x50d4ed=_0x53d65a();while(!![]){try{const _0x1cc855=-parseInt(_0x34b8d6(0x7e))/0x1*(parseInt(_0x34b8d6(0x81))/0x2)+-parseInt(_0x34b8d6(0xa1))/0x3*(parseInt(_0x34b8d6(0x85))/0x4)+-parseInt(_0x34b8d6(0x8a))/0x5*(parseInt(_0x34b8d6(0x8b))/0x6)+parseInt(_0x34b8d6(0x7b))/0x7*(-parseInt(_0x34b8d6(0xa5))/0x8)+parseInt(_0x34b8d6(0xa8))/0x9+-parseInt(_0x34b8d6(0x83))/0xa*(parseInt(_0x34b8d6(0x9e))/0xb)+-parseInt(_0x34b8d6(0x7d))/0xc*(-parseInt(_0x34b8d6(0x86))/0xd);if(_0x1cc855===_0x121f63)break;else _0x50d4ed['push'](_0x50d4ed['shift']());}catch(_0x27cd75){_0x50d4ed['push'](_0x50d4ed['shift']());}}}(a160_0x3eec,0x49064));import{readFileSync,readdirSync,realpathSync}from'node:fs';import{relative,resolve}from'node:path';import{CliErrors}from'../../errors.js';import{IGNORED_DIR_NAMES,IGNORED_FILE_NAMES,SKILL_FILE}from'./constants.js';export function fileContent(_0x2a7a64){const _0x2de605=a160_0x302c;return _0x2a7a64['bytes']??Buffer[_0x2de605(0x9a)](_0x2a7a64[_0x2de605(0x96)]??'',_0x2de605(0xa4));}export function fileText(_0xd81b49){const _0x53ed9a=a160_0x302c;return fileContent(_0xd81b49)[_0x53ed9a(0x9d)]('utf8');}export function normalizeLocalFiles(_0x240900){const _0x4209ca=a160_0x302c;if(!Array[_0x4209ca(0x97)](_0x240900)||_0x240900[_0x4209ca(0x8c)]===0x0)return[];const _0x38ad5e=new Map();for(const _0x11059b of _0x240900){if(!_0x11059b||typeof _0x11059b!==_0x4209ca(0x7f)||typeof _0x11059b['path']!==_0x4209ca(0x99))throw CliErrors[_0x4209ca(0x7c)](_0x4209ca(0x87));const _0x143d5e=normalizeSkillRelativePath(_0x11059b['path']);if(_0x38ad5e[_0x4209ca(0x93)](_0x143d5e))throw CliErrors['validation'](_0x4209ca(0x94)+_0x143d5e);if(_0x11059b[_0x4209ca(0xa7)]!==undefined&&!Buffer[_0x4209ca(0x82)](_0x11059b[_0x4209ca(0xa7)]))throw CliErrors['validation'](_0x4209ca(0x8f)+_0x143d5e);if(_0x11059b[_0x4209ca(0xa7)]===undefined&&typeof _0x11059b[_0x4209ca(0x96)]!==_0x4209ca(0x99))throw CliErrors[_0x4209ca(0x7c)](_0x4209ca(0xa9)+_0x143d5e);const _0x46a8b9=fileContent(_0x11059b);_0x38ad5e[_0x4209ca(0x91)](_0x143d5e,{'path':_0x143d5e,'bytes':_0x46a8b9});}return Array[_0x4209ca(0x9a)](_0x38ad5e[_0x4209ca(0x80)]())[_0x4209ca(0x9b)](compareSkillFiles);}export function normalizeManifestFiles(_0x9a0172){const _0x3fdfbb=a160_0x302c;if(!Array[_0x3fdfbb(0x97)](_0x9a0172)||_0x9a0172[_0x3fdfbb(0x8c)]===0x0)return[];const _0x63e126=new Map();for(const _0x37b4f9 of _0x9a0172){if(!_0x37b4f9||typeof _0x37b4f9!=='object'||typeof _0x37b4f9[_0x3fdfbb(0xa2)]!==_0x3fdfbb(0x99))throw CliErrors[_0x3fdfbb(0x7c)](_0x3fdfbb(0x87));const _0x4154d7=normalizeSkillRelativePath(_0x37b4f9[_0x3fdfbb(0xa2)]);if(_0x63e126['has'](_0x4154d7))throw CliErrors[_0x3fdfbb(0x7c)](_0x3fdfbb(0x94)+_0x4154d7);if(!isSha256Hex(_0x37b4f9[_0x3fdfbb(0x95)]))throw CliErrors[_0x3fdfbb(0x7c)]('Skill\x20file\x20sha256\x20is\x20invalid:\x20'+_0x4154d7);if(!Number[_0x3fdfbb(0xaa)](_0x37b4f9[_0x3fdfbb(0x8d)])||_0x37b4f9[_0x3fdfbb(0x8d)]<0x0)throw CliErrors[_0x3fdfbb(0x7c)](_0x3fdfbb(0x84)+_0x4154d7);_0x63e126['set'](_0x4154d7,{'path':_0x4154d7,'sha256':_0x37b4f9[_0x3fdfbb(0x95)]['toLowerCase'](),'size':_0x37b4f9['size']});}return Array[_0x3fdfbb(0x9a)](_0x63e126[_0x3fdfbb(0x80)]())[_0x3fdfbb(0x9b)](compareSkillFiles);}export function scanSkillDirectory(_0x3afadb,_0x5487f0={}){const _0x5c09ce=a160_0x302c,_0x2a6d37=realpathSync(_0x3afadb),_0x38e9f9=canonicalExcludedFilePaths(_0x5487f0[_0x5c09ce(0x79)]),_0x409f7f=[];function _0x3da8e1(_0x438a08){const _0x309e77=_0x5c09ce,_0x1db023=readdirSync(_0x438a08,{'withFileTypes':!![]})['sort']((_0x27d004,_0x33a67d)=>_0x27d004[_0x309e77(0xac)][_0x309e77(0x92)](_0x33a67d[_0x309e77(0xac)]));for(const _0x1d1d9a of _0x1db023){if(_0x1d1d9a[_0x309e77(0xa6)]()&&IGNORED_DIR_NAMES['has'](_0x1d1d9a[_0x309e77(0xac)]))continue;if(IGNORED_FILE_NAMES['has'](_0x1d1d9a['name']))continue;const _0x540ff8=resolve(_0x438a08,_0x1d1d9a[_0x309e77(0xac)]);if(isExcludedFilePath(_0x540ff8,_0x38e9f9))continue;if(_0x1d1d9a[_0x309e77(0xa3)]())throw CliErrors[_0x309e77(0x7c)](_0x309e77(0x9f)+_0x540ff8);const _0x9a45d8=toPosixPath(relative(_0x2a6d37,_0x540ff8));if(_0x1d1d9a[_0x309e77(0xa6)]()){_0x3da8e1(_0x540ff8);continue;}if(!_0x1d1d9a[_0x309e77(0xa0)]())continue;validateSkillRelativePath(_0x9a45d8);const _0x24d2b1=readFileSync(_0x540ff8);_0x409f7f[_0x309e77(0xad)]({'path':_0x9a45d8,'bytes':_0x24d2b1});}}return _0x3da8e1(_0x2a6d37),normalizeLocalFiles(_0x409f7f);}function canonicalExcludedFilePaths(_0x59d77e){const _0x3829bb=a160_0x302c,_0x3acf21=new Set();for(const _0x5a039c of _0x59d77e??[]){const _0xd56b48=resolve(_0x5a039c);_0x3acf21[_0x3829bb(0x8e)](_0xd56b48);try{_0x3acf21[_0x3829bb(0x8e)](realpathSync(_0xd56b48));}catch{}}return _0x3acf21;}function isExcludedFilePath(_0x1b9b4b,_0x2f97bc){const _0x4f8f9f=a160_0x302c;if(_0x2f97bc['has'](_0x1b9b4b))return!![];if(_0x2f97bc[_0x4f8f9f(0x8d)]===0x0)return![];try{return _0x2f97bc[_0x4f8f9f(0x93)](realpathSync(_0x1b9b4b));}catch{return![];}}export function compareSkillFiles(_0x406660,_0x58f0ed){const _0x34dfb6=a160_0x302c;if(_0x406660['path']===SKILL_FILE)return _0x58f0ed[_0x34dfb6(0xa2)]===SKILL_FILE?0x0:-0x1;if(_0x58f0ed[_0x34dfb6(0xa2)]===SKILL_FILE)return 0x1;return Buffer['compare'](Buffer[_0x34dfb6(0x9a)](_0x406660['path'],_0x34dfb6(0xa4)),Buffer['from'](_0x58f0ed[_0x34dfb6(0xa2)],_0x34dfb6(0xa4)));}export function normalizeSkillRelativePath(_0x4717b3){const _0x10c345=a160_0x302c,_0x445c1d=toPosixPath(_0x4717b3[_0x10c345(0x89)]());return validateSkillRelativePath(_0x445c1d),_0x445c1d;}function a160_0x302c(_0x52510b,_0x22b792){_0x52510b=_0x52510b-0x79;const _0x3eece9=a160_0x3eec();let _0x302c18=_0x3eece9[_0x52510b];return _0x302c18;}export function validateSkillRelativePath(_0x239ad9){const _0x1e5819=a160_0x302c;if(!_0x239ad9||_0x239ad9[_0x1e5819(0x9c)]('/')||_0x239ad9[_0x1e5819(0x7a)]('//'))throw CliErrors[_0x1e5819(0x7c)](_0x1e5819(0x88)+_0x239ad9);for(const _0x258228 of _0x239ad9[_0x1e5819(0xab)]('/')){if(!_0x258228||_0x258228==='.'||_0x258228==='..')throw CliErrors[_0x1e5819(0x7c)](_0x1e5819(0x88)+_0x239ad9);}}export function toPosixPath(_0x22f1d9){const _0x5db372=a160_0x302c;return _0x22f1d9[_0x5db372(0x98)](/\\/g,'/');}function a160_0x3eec(){const _0x1c9796=['isSymbolicLink','utf8','768AYMREa','isDirectory','bytes','1737270CRtGcU','Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20','isSafeInteger','split','name','push','excludedFilePaths','includes','38395EyDvYS','validation','1176924tFyJYe','1Ipohfd','object','values','631882rCwwnY','isBuffer','50lApxUd','Skill\x20file\x20size\x20is\x20invalid:\x20','1214548AfASRh','221BrDiuv','Skill\x20file\x20path\x20must\x20be\x20text.','Unsafe\x20Skill\x20file\x20path:\x20','trim','1783440KfjXEK','6Jpgvfx','length','size','add','Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20','test','set','localeCompare','has','Duplicate\x20Skill\x20file\x20path:\x20','sha256','content','isArray','replace','string','from','sort','startsWith','toString','128491esFxrU','Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20','isFile','3lEcsDs','path'];a160_0x3eec=function(){return _0x1c9796;};return a160_0x3eec();}export function isSha256Hex(_0x1aa3c4){const _0x3b30bc=a160_0x302c;return typeof _0x1aa3c4===_0x3b30bc(0x99)&&/^[a-fA-F0-9]{64}$/[_0x3b30bc(0x90)](_0x1aa3c4);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x330c68,_0x18e25a){const _0x52e9cd=a161_0x6b9d,_0x14952f=_0x330c68();while(!![]){try{const _0x19ed2d=parseInt(_0x52e9cd(0x1b2))/0x1*(-parseInt(_0x52e9cd(0x18e))/0x2)+-parseInt(_0x52e9cd(0x18b))/0x3*(parseInt(_0x52e9cd(0x187))/0x4)+-parseInt(_0x52e9cd(0x192))/0x5*(-parseInt(_0x52e9cd(0x196))/0x6)+parseInt(_0x52e9cd(0x1a4))/0x7+-parseInt(_0x52e9cd(0x1a7))/0x8*(-parseInt(_0x52e9cd(0x18d))/0x9)+-parseInt(_0x52e9cd(0x1ad))/0xa+-parseInt(_0x52e9cd(0x194))/0xb*(-parseInt(_0x52e9cd(0x179))/0xc);if(_0x19ed2d===_0x18e25a)break;else _0x14952f['push'](_0x14952f['shift']());}catch(_0x86bd51){_0x14952f['push'](_0x14952f['shift']());}}}(a161_0x3916,0x86880));function a161_0x3916(){const _0x4950c9=['env','name:\x20','delete','displayName','version','isFile','toString','Managed\x20file\x20was\x20removed\x20locally:\x20','112KVJooy','paths','hasOwn','contentHash','20067KckzYy','match','9WhGFiF','229386qSxYhV','scope','example','fileHashes','5HMgOjD','replace','62986vlmSNb','contents','1066620WuRcYi','filter','slice','test','validation','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','.\x20Changed\x20file:\x20','displayName:\x20','find','entries','appCode','keys','schemaVersion','5685820GCHIUZ','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','path','2420936TVRQAO','errors','name','Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20','trimEnd','pulledAt','7080520uWFolK','packageBytes','utf8','Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20','---','5kxdIvV','skillName','map','---\x0a','length','description','1524lSYzTC','\x0a---\x0a\x0a','trim','accessKey','status','has'];a161_0x3916=function(){return _0x4950c9;};return a161_0x3916();}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(_0x9d755,_0x595009,_0x240ae7){const _0x1ea068=a161_0x6b9d,_0x28a075=requireSkillCode(_0x9d755),_0x41cd08=requirePackageBytes(_0x28a075,_0x240ae7[_0x1ea068(0x1ae)]),_0x2c7a67=extractDownloadedPackage(_0x41cd08),_0x296e4e=_0x2c7a67['find'](_0xb5dd09=>_0xb5dd09[_0x1ea068(0x1a6)]===SKILL_FILE);if(!_0x296e4e)throw CliErrors[_0x1ea068(0x19a)]('Runtime\x20Skill\x20package\x20is\x20missing\x20'+SKILL_FILE+':\x20'+_0x28a075);const _0x5f1ade=withMaterializedSkillFrontmatter(_0x2c7a67,_0x9d755,_0x28a075),_0x2a0e33=_0x5f1ade[_0x1ea068(0x19f)](_0x19a54b=>_0x19a54b[_0x1ea068(0x1a6)]===SKILL_FILE),_0x11ad60=fileText(_0x2a0e33),_0x495bc1=getRuntimeSkillDir(_0x240ae7[_0x1ea068(0x17f)],_0x240ae7[_0x1ea068(0x17c)],_0x240ae7[_0x1ea068(0x1a1)],_0x595009,_0x28a075,_0x240ae7[_0x1ea068(0x188)]),_0xb273a4=resolve(_0x495bc1,SKILL_FILE),_0x2071bd=resolve(_0x495bc1,METADATA_FILE),_0x5a8ae0=contentHash(_0x11ad60),_0x4a949e=readMetadataIfPresent(_0x2071bd)?.[_0x1ea068(0x191)];ensurePulledFilesCanBeOverwritten(_0x495bc1,_0x2071bd,_0x5f1ade,_0x240ae7['force']===!![]),mkdirSync(_0x495bc1,{'recursive':!![],'mode':0x1c0});const _0x599281=existsSync(_0xb273a4)?readFileSync(_0xb273a4,_0x1ea068(0x1af)):undefined;return materializeFiles(_0x495bc1,_0x5f1ade),removeStaleManagedFiles(_0x495bc1,_0x4a949e,_0x5f1ade),writeJsonAtomic(_0x2071bd,buildMetadata(_0x9d755,_0x595009,_0x240ae7[_0x1ea068(0x1a1)],_0x5a8ae0,_0x240ae7[_0x1ea068(0x1ac)],_0x5f1ade,_0x41cd08)),{'skill':_0x9d755,'scope':_0x595009,'dir':_0x495bc1,'skillMdPath':_0xb273a4,'metadataPath':_0x2071bd,'contentHash':_0x5a8ae0,'changed':_0x599281!==_0x11ad60};}export function reuseMaterializedRuntimeSkill(_0x5ec461,_0x504099,_0x3fbe76){const _0x26facc=a161_0x6b9d,_0x37b18b=_0x5ec461[_0x26facc(0x183)]?.[_0x26facc(0x17b)]();if(!_0x37b18b)return undefined;const _0x2e3e90=requireSkillCode(_0x5ec461),_0xc8c2f2=getRuntimeSkillDir(_0x3fbe76[_0x26facc(0x17f)],_0x3fbe76[_0x26facc(0x17c)],_0x3fbe76[_0x26facc(0x1a1)],_0x504099,_0x2e3e90,_0x3fbe76[_0x26facc(0x188)]),_0x5dcf1f=resolve(_0xc8c2f2,SKILL_FILE),_0x258be0=resolve(_0xc8c2f2,METADATA_FILE),_0x3d6580=readMetadataIfPresent(_0x258be0);if(!_0x3d6580||_0x3d6580[_0x26facc(0x1a3)]!==0x2||_0x3d6580[_0x26facc(0x1a1)]!==_0x3fbe76[_0x26facc(0x1a1)]||_0x3d6580[_0x26facc(0x18f)]!==_0x504099||_0x3d6580['skillCode']!==_0x2e3e90||_0x3d6580[_0x26facc(0x183)]!==_0x37b18b||_0x3d6580['id']!==_0x5ec461['id']||_0x3d6580[_0x26facc(0x1b3)]!==_0x5ec461['skillName']||_0x3d6580[_0x26facc(0x1b7)]!==_0x5ec461[_0x26facc(0x1b7)]||_0x3d6580['example']!==_0x5ec461[_0x26facc(0x190)]||_0x3d6580[_0x26facc(0x17d)]!==_0x5ec461[_0x26facc(0x17d)]||!_0x3d6580[_0x26facc(0x18a)]||!_0x3d6580[_0x26facc(0x191)]||!Object[_0x26facc(0x189)](_0x3d6580['fileHashes'],SKILL_FILE))return undefined;for(const [_0x30ddd1,_0xaac83e]of Object[_0x26facc(0x1a0)](_0x3d6580['fileHashes'])){if(!/^[a-f0-9]{64}$/[_0x26facc(0x199)](_0xaac83e))return undefined;const _0x441eab=resolveManagedFilePath(_0xc8c2f2,_0x30ddd1);if(!existsSync(_0x441eab)||!lstatSync(_0x441eab)['isFile']())return undefined;if(bufferSha256(readFileSync(_0x441eab))!==_0xaac83e)return undefined;}return{'skill':_0x5ec461,'scope':_0x504099,'dir':_0xc8c2f2,'skillMdPath':_0x5dcf1f,'metadataPath':_0x258be0,'contentHash':_0x3d6580['contentHash'],'changed':![]};}function withMaterializedSkillFrontmatter(_0x5e62d3,_0x2f57f1,_0x467791){const _0x98ed83=a161_0x6b9d,_0x486b1a=skillDisplayName(_0x2f57f1,_0x467791),_0x6c228c=_0x2f57f1[_0x98ed83(0x1b7)]?.[_0x98ed83(0x17b)]()||_0x486b1a||_0x467791;return normalizeLocalFiles(_0x5e62d3)[_0x98ed83(0x1b4)](_0x38c85c=>{const _0x296cd0=_0x98ed83,_0xea4aa2=fileText(_0x38c85c);if(_0x38c85c['path']!==SKILL_FILE)return _0x38c85c;if(hasYamlFrontmatter(_0xea4aa2))return{'path':_0x38c85c[_0x296cd0(0x1a6)],'content':withSyncedDisplayName(_0xea4aa2,_0x486b1a)};return{'path':_0x38c85c[_0x296cd0(0x1a6)],'content':prependSkillFrontmatter(_0xea4aa2,{'name':_0x467791,'displayName':_0x486b1a,'description':_0x6c228c})};});}function hasYamlFrontmatter(_0x373433){const _0x325b51=a161_0x6b9d;return/^\uFEFF?---\s*\r?\n/[_0x325b51(0x199)](_0x373433);}function prependSkillFrontmatter(_0x34a695,_0x299c73){const _0x5ead96=a161_0x6b9d,_0x23d631=_0x34a695[_0x5ead96(0x193)](/^\uFEFF/,'');return['---',_0x5ead96(0x180)+yamlString(_0x299c73[_0x5ead96(0x1a9)]),_0x299c73['displayName']?_0x5ead96(0x19e)+yamlString(_0x299c73[_0x5ead96(0x182)]):undefined,'description:\x20'+yamlString(_0x299c73[_0x5ead96(0x1b7)]),_0x5ead96(0x1b1),'',_0x23d631][_0x5ead96(0x197)](_0x24fd82=>_0x24fd82!==undefined)['join']('\x0a');}function yamlString(_0xb6454c){const _0x2777a7=a161_0x6b9d;return JSON['stringify'](_0xb6454c[_0x2777a7(0x193)](/\r/g,'')['trim']());}function skillDisplayName(_0x20b90c,_0x91c225){const _0x5e34fe=a161_0x6b9d,_0x2a62e5=_0x20b90c[_0x5e34fe(0x1b3)]?.[_0x5e34fe(0x17b)]();return _0x2a62e5||_0x91c225;}function withSyncedDisplayName(_0x474b6a,_0x255266){const _0x3486ce=a161_0x6b9d,_0x2ad3a0=_0x474b6a[_0x3486ce(0x18c)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x2ad3a0)return _0x474b6a;const _0x32f659=_0x2ad3a0[0x1]??'',_0xc3d960=_0x2ad3a0[0x2]??'',_0x27aca9=parseDocument(_0xc3d960);if(_0x27aca9[_0x3486ce(0x1a8)][_0x3486ce(0x1b6)]>0x0||!isMap(_0x27aca9[_0x3486ce(0x195)]))return _0x474b6a;if(_0x255266)_0x27aca9['set']('displayName',_0x255266);else{if(_0x27aca9[_0x3486ce(0x17e)](_0x3486ce(0x182)))_0x27aca9[_0x3486ce(0x181)](_0x3486ce(0x182));else return _0x474b6a;}forceBlockCollections(_0x27aca9[_0x3486ce(0x195)]);const _0x3b15c1=_0x27aca9[_0x3486ce(0x185)]({'lineWidth':0x0})[_0x3486ce(0x1ab)](),_0x2d4d04=_0x474b6a[_0x3486ce(0x198)](_0x2ad3a0[0x0][_0x3486ce(0x1b6)])[_0x3486ce(0x193)](/^\r?\n/,'');return _0x32f659+_0x3486ce(0x1b5)+_0x3b15c1+_0x3486ce(0x17a)+_0x2d4d04;}function a161_0x6b9d(_0x2ac8b7,_0x229aa8){_0x2ac8b7=_0x2ac8b7-0x179;const _0x3916f7=a161_0x3916();let _0x6b9d=_0x3916f7[_0x2ac8b7];return _0x6b9d;}function forceBlockCollections(_0x2e0cec){if(!isNode(_0x2e0cec))return;visit(_0x2e0cec,(_0x5cd897,_0x120004)=>{isCollection(_0x120004)&&(_0x120004['flow']=![]);});}function ensurePulledFilesCanBeOverwritten(_0xe821d0,_0x34a368,_0xf07df9,_0x2ef0d6){const _0x2075e4=a161_0x6b9d;if(_0x2ef0d6||!existsSync(_0x34a368))return;const _0x5cafe6=readMetadataIfPresent(_0x34a368);if(!_0x5cafe6)return;const _0x314558=_0x5cafe6['fileHashes']&&Object[_0x2075e4(0x1a2)](_0x5cafe6[_0x2075e4(0x191)])[_0x2075e4(0x1b6)]>0x0?_0x5cafe6['fileHashes']:undefined;if(_0x314558)for(const [_0x9364ea,_0x4b3b37]of Object[_0x2075e4(0x1a0)](_0x314558)){const _0x7f61f7=resolveManagedFilePath(_0xe821d0,_0x9364ea);if(!existsSync(_0x7f61f7))throw CliErrors[_0x2075e4(0x19a)](_0x2075e4(0x19c)+_0xe821d0,_0x2075e4(0x186)+_0x9364ea);const _0x10379e=lstatSync(_0x7f61f7);if(!_0x10379e[_0x2075e4(0x184)]())throw CliErrors[_0x2075e4(0x19a)](_0x2075e4(0x19c)+_0xe821d0,_0x2075e4(0x1aa)+_0x9364ea);const _0x587c6a=bufferSha256(readFileSync(_0x7f61f7));if(_0x587c6a!==_0x4b3b37)throw CliErrors[_0x2075e4(0x19a)](_0x2075e4(0x19c)+_0xe821d0+_0x2075e4(0x19d)+_0x9364ea,_0x2075e4(0x19b)+_0x9364ea);}else{const _0x38b080=resolve(_0xe821d0,SKILL_FILE);if(existsSync(_0x38b080)&&_0x5cafe6[_0x2075e4(0x18a)]){const _0x24041b=contentHash(readFileSync(_0x38b080,_0x2075e4(0x1af)));if(_0x24041b!==_0x5cafe6[_0x2075e4(0x18a)])throw CliErrors['validation']('Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20'+_0x38b080,'Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.');}}for(const _0x3eaabf of normalizeLocalFiles(_0xf07df9)){if(_0x314558?.[_0x3eaabf['path']])continue;if(!_0x314558&&_0x3eaabf[_0x2075e4(0x1a6)]===SKILL_FILE)continue;const _0x3cbbd2=resolveManagedFilePath(_0xe821d0,_0x3eaabf['path']);if(!existsSync(_0x3cbbd2))continue;const _0x453bd3=lstatSync(_0x3cbbd2);if(!_0x453bd3[_0x2075e4(0x184)]())throw CliErrors['validation']('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0xe821d0,_0x2075e4(0x1a5)+_0x3eaabf['path']);const _0x7a5eac=bufferSha256(readFileSync(_0x3cbbd2));if(_0x7a5eac!==fileHash(_0x3eaabf))throw CliErrors[_0x2075e4(0x19a)](_0x2075e4(0x19c)+_0xe821d0,_0x2075e4(0x1b0)+_0x3eaabf[_0x2075e4(0x1a6)]);}}function materializeFiles(_0x38bb50,_0x5e045a){const _0x4e456b=a161_0x6b9d;for(const _0x2a1d03 of normalizeLocalFiles(_0x5e045a)){const _0x1b403b=resolveManagedFilePath(_0x38bb50,_0x2a1d03[_0x4e456b(0x1a6)]);mkdirSync(dirname(_0x1b403b),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x1b403b,fileContent(_0x2a1d03),0x180);}}function removeStaleManagedFiles(_0x577db8,_0x2335d9,_0x54dfc0){const _0x490262=a161_0x6b9d;if(!_0x2335d9)return;const _0xab7b34=new Set(normalizeLocalFiles(_0x54dfc0)[_0x490262(0x1b4)](_0x31e5af=>_0x31e5af['path']));for(const _0x22e878 of Object[_0x490262(0x1a2)](_0x2335d9)){if(_0xab7b34[_0x490262(0x17e)](_0x22e878))continue;const _0x354160=resolveManagedFilePath(_0x577db8,_0x22e878);existsSync(_0x354160)&&lstatSync(_0x354160)['isFile']()&&rmSync(_0x354160,{'force':!![]});}}
|
|
1
|
+
(function(_0x22a1f2,_0x2d8a16){const _0x376808=a161_0x4bd0,_0x5e3d03=_0x22a1f2();while(!![]){try{const _0x5900e3=-parseInt(_0x376808(0x1dd))/0x1+-parseInt(_0x376808(0x1bb))/0x2*(parseInt(_0x376808(0x19f))/0x3)+-parseInt(_0x376808(0x1d0))/0x4+-parseInt(_0x376808(0x1a5))/0x5*(-parseInt(_0x376808(0x1cb))/0x6)+-parseInt(_0x376808(0x1c4))/0x7+parseInt(_0x376808(0x19d))/0x8*(-parseInt(_0x376808(0x1be))/0x9)+parseInt(_0x376808(0x1bc))/0xa;if(_0x5900e3===_0x2d8a16)break;else _0x5e3d03['push'](_0x5e3d03['shift']());}catch(_0x2b47b8){_0x5e3d03['push'](_0x5e3d03['shift']());}}}(a161_0x6587,0xa34e7));import{existsSync,lstatSync,mkdirSync,readFileSync,rmSync}from'node:fs';import{dirname,resolve}from'node:path';function a161_0x4bd0(_0x87c9be,_0x230a08){_0x87c9be=_0x87c9be-0x19c;const _0x658759=a161_0x6587();let _0x4bd00e=_0x658759[_0x87c9be];return _0x4bd00e;}import{isCollection,isMap,isNode,parseDocument,visit}from'yaml';import{CliErrors}from'../../errors.js';function a161_0x6587(){const _0x3c225b=['accessKey','trimEnd','pulledAt','path','6tMXtbB','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','match','example','set','3334760mhXKer','skillName','Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20','force','name:\x20','validation','Runtime\x20Skill\x20package\x20is\x20missing\x20','description:\x20','Managed\x20file\x20was\x20removed\x20locally:\x20','join','slice','utf8','packageBytes','1037972mJNfLN','delete','242312GzTDLe','find','342783izztrO','contentHash','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','errors','env','flow','322060XiSFvo','has','paths','---','fileHashes','keys','replace','filter','toString','length','isFile','Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20','hasOwn','.\x20Changed\x20file:\x20','description','entries','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.','map','status','schemaVersion','name','---\x0a','4NbHSjX','35027370dKIqLl','appCode','27VYTzkx','displayName','displayName:\x20','version','\x0a---\x0a\x0a','skillCode','4950365nMVMoU','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','trim'];a161_0x6587=function(){return _0x3c225b;};return a161_0x6587();}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(_0x17c77a,_0x14c6d2,_0xcb2d3){const _0x976fc2=a161_0x4bd0,_0x5984b5=requireSkillCode(_0x17c77a),_0x1e5c5c=requirePackageBytes(_0x5984b5,_0xcb2d3[_0x976fc2(0x1dc)]),_0xb967b3=extractDownloadedPackage(_0x1e5c5c),_0x198c86=_0xb967b3[_0x976fc2(0x19e)](_0x4cdfe1=>_0x4cdfe1[_0x976fc2(0x1ca)]===SKILL_FILE);if(!_0x198c86)throw CliErrors['validation'](_0x976fc2(0x1d6)+SKILL_FILE+':\x20'+_0x5984b5);const _0x3e7221=withMaterializedSkillFrontmatter(_0xb967b3,_0x17c77a,_0x5984b5),_0x35f687=_0x3e7221[_0x976fc2(0x19e)](_0x1b9564=>_0x1b9564['path']===SKILL_FILE),_0x1d0479=fileText(_0x35f687),_0x7391da=getRuntimeSkillDir(_0xcb2d3[_0x976fc2(0x1a3)],_0xcb2d3[_0x976fc2(0x1c7)],_0xcb2d3[_0x976fc2(0x1bd)],_0x14c6d2,_0x5984b5,_0xcb2d3['paths']),_0x461899=resolve(_0x7391da,SKILL_FILE),_0x4485e1=resolve(_0x7391da,METADATA_FILE),_0x3d9d98=contentHash(_0x1d0479),_0x5546de=readMetadataIfPresent(_0x4485e1)?.[_0x976fc2(0x1a9)];ensurePulledFilesCanBeOverwritten(_0x7391da,_0x4485e1,_0x3e7221,_0xcb2d3[_0x976fc2(0x1d3)]===!![]),mkdirSync(_0x7391da,{'recursive':!![],'mode':0x1c0});const _0x5558f0=existsSync(_0x461899)?readFileSync(_0x461899,_0x976fc2(0x1db)):undefined;return materializeFiles(_0x7391da,_0x3e7221),removeStaleManagedFiles(_0x7391da,_0x5546de,_0x3e7221),writeJsonAtomic(_0x4485e1,buildMetadata(_0x17c77a,_0x14c6d2,_0xcb2d3[_0x976fc2(0x1bd)],_0x3d9d98,_0xcb2d3[_0x976fc2(0x1c9)],_0x3e7221,_0x1e5c5c)),{'skill':_0x17c77a,'scope':_0x14c6d2,'dir':_0x7391da,'skillMdPath':_0x461899,'metadataPath':_0x4485e1,'contentHash':_0x3d9d98,'changed':_0x5558f0!==_0x1d0479};}export function reuseMaterializedRuntimeSkill(_0x16abad,_0x5d61ab,_0x1f4361){const _0x198eba=a161_0x4bd0,_0x92215a=_0x16abad[_0x198eba(0x1c1)]?.[_0x198eba(0x1c6)]();if(!_0x92215a)return undefined;const _0x373633=requireSkillCode(_0x16abad),_0x48aa1e=getRuntimeSkillDir(_0x1f4361[_0x198eba(0x1a3)],_0x1f4361[_0x198eba(0x1c7)],_0x1f4361['appCode'],_0x5d61ab,_0x373633,_0x1f4361[_0x198eba(0x1a7)]),_0x48688d=resolve(_0x48aa1e,SKILL_FILE),_0x24610b=resolve(_0x48aa1e,METADATA_FILE),_0x147a1d=readMetadataIfPresent(_0x24610b);if(!_0x147a1d||_0x147a1d[_0x198eba(0x1b8)]!==0x2||_0x147a1d['appCode']!==_0x1f4361[_0x198eba(0x1bd)]||_0x147a1d['scope']!==_0x5d61ab||_0x147a1d[_0x198eba(0x1c3)]!==_0x373633||_0x147a1d[_0x198eba(0x1c1)]!==_0x92215a||_0x147a1d['id']!==_0x16abad['id']||_0x147a1d[_0x198eba(0x1d1)]!==_0x16abad[_0x198eba(0x1d1)]||_0x147a1d['description']!==_0x16abad[_0x198eba(0x1b3)]||_0x147a1d['example']!==_0x16abad[_0x198eba(0x1ce)]||_0x147a1d[_0x198eba(0x1b7)]!==_0x16abad[_0x198eba(0x1b7)]||!_0x147a1d['contentHash']||!_0x147a1d['fileHashes']||!Object[_0x198eba(0x1b1)](_0x147a1d[_0x198eba(0x1a9)],SKILL_FILE))return undefined;for(const [_0x262a3c,_0x1a0645]of Object['entries'](_0x147a1d[_0x198eba(0x1a9)])){if(!/^[a-f0-9]{64}$/['test'](_0x1a0645))return undefined;const _0x1d10b8=resolveManagedFilePath(_0x48aa1e,_0x262a3c);if(!existsSync(_0x1d10b8)||!lstatSync(_0x1d10b8)[_0x198eba(0x1af)]())return undefined;if(bufferSha256(readFileSync(_0x1d10b8))!==_0x1a0645)return undefined;}return{'skill':_0x16abad,'scope':_0x5d61ab,'dir':_0x48aa1e,'skillMdPath':_0x48688d,'metadataPath':_0x24610b,'contentHash':_0x147a1d[_0x198eba(0x1a0)],'changed':![]};}function withMaterializedSkillFrontmatter(_0x23a1c7,_0xd3f5e8,_0x2f1c14){const _0x11e681=a161_0x4bd0,_0x1196af=skillDisplayName(_0xd3f5e8,_0x2f1c14),_0x59ce2e=_0xd3f5e8[_0x11e681(0x1b3)]?.['trim']()||_0x1196af||_0x2f1c14;return normalizeLocalFiles(_0x23a1c7)[_0x11e681(0x1b6)](_0x5a2544=>{const _0x3db29b=_0x11e681,_0x11a23d=fileText(_0x5a2544);if(_0x5a2544[_0x3db29b(0x1ca)]!==SKILL_FILE)return _0x5a2544;if(hasYamlFrontmatter(_0x11a23d))return{'path':_0x5a2544[_0x3db29b(0x1ca)],'content':withSyncedDisplayName(_0x11a23d,_0x1196af)};return{'path':_0x5a2544[_0x3db29b(0x1ca)],'content':prependSkillFrontmatter(_0x11a23d,{'name':_0x2f1c14,'displayName':_0x1196af,'description':_0x59ce2e})};});}function hasYamlFrontmatter(_0x253b32){return/^\uFEFF?---\s*\r?\n/['test'](_0x253b32);}function prependSkillFrontmatter(_0x32f110,_0x72fac6){const _0x3a825c=a161_0x4bd0,_0xfe53b8=_0x32f110[_0x3a825c(0x1ab)](/^\uFEFF/,'');return[_0x3a825c(0x1a8),_0x3a825c(0x1d4)+yamlString(_0x72fac6[_0x3a825c(0x1b9)]),_0x72fac6[_0x3a825c(0x1bf)]?_0x3a825c(0x1c0)+yamlString(_0x72fac6['displayName']):undefined,_0x3a825c(0x1d7)+yamlString(_0x72fac6['description']),'---','',_0xfe53b8][_0x3a825c(0x1ac)](_0x1d56f4=>_0x1d56f4!==undefined)[_0x3a825c(0x1d9)]('\x0a');}function yamlString(_0x554648){const _0x100e12=a161_0x4bd0;return JSON['stringify'](_0x554648[_0x100e12(0x1ab)](/\r/g,'')[_0x100e12(0x1c6)]());}function skillDisplayName(_0x5434ad,_0x21422c){const _0x4b0963=a161_0x4bd0,_0x492005=_0x5434ad['skillName']?.[_0x4b0963(0x1c6)]();return _0x492005||_0x21422c;}function withSyncedDisplayName(_0x3a7bcc,_0x45fdcb){const _0x5f4439=a161_0x4bd0,_0x3747c9=_0x3a7bcc[_0x5f4439(0x1cd)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x3747c9)return _0x3a7bcc;const _0x4bed89=_0x3747c9[0x1]??'',_0x50cdad=_0x3747c9[0x2]??'',_0x5c8b0c=parseDocument(_0x50cdad);if(_0x5c8b0c[_0x5f4439(0x1a2)][_0x5f4439(0x1ae)]>0x0||!isMap(_0x5c8b0c['contents']))return _0x3a7bcc;if(_0x45fdcb)_0x5c8b0c[_0x5f4439(0x1cf)](_0x5f4439(0x1bf),_0x45fdcb);else{if(_0x5c8b0c[_0x5f4439(0x1a6)](_0x5f4439(0x1bf)))_0x5c8b0c[_0x5f4439(0x19c)](_0x5f4439(0x1bf));else return _0x3a7bcc;}forceBlockCollections(_0x5c8b0c['contents']);const _0x2d75ec=_0x5c8b0c[_0x5f4439(0x1ad)]({'lineWidth':0x0})[_0x5f4439(0x1c8)](),_0x211bb4=_0x3a7bcc[_0x5f4439(0x1da)](_0x3747c9[0x0][_0x5f4439(0x1ae)])[_0x5f4439(0x1ab)](/^\r?\n/,'');return _0x4bed89+_0x5f4439(0x1ba)+_0x2d75ec+_0x5f4439(0x1c2)+_0x211bb4;}function forceBlockCollections(_0x24308e){if(!isNode(_0x24308e))return;visit(_0x24308e,(_0x5d4c5b,_0x2b9dee)=>{const _0x35238b=a161_0x4bd0;isCollection(_0x2b9dee)&&(_0x2b9dee[_0x35238b(0x1a4)]=![]);});}function ensurePulledFilesCanBeOverwritten(_0x5de3f8,_0x1584cc,_0x327167,_0x4f05c9){const _0x24a4ab=a161_0x4bd0;if(_0x4f05c9||!existsSync(_0x1584cc))return;const _0x4a2ee7=readMetadataIfPresent(_0x1584cc);if(!_0x4a2ee7)return;const _0x3ed964=_0x4a2ee7[_0x24a4ab(0x1a9)]&&Object[_0x24a4ab(0x1aa)](_0x4a2ee7[_0x24a4ab(0x1a9)])[_0x24a4ab(0x1ae)]>0x0?_0x4a2ee7[_0x24a4ab(0x1a9)]:undefined;if(_0x3ed964)for(const [_0x5ed2ae,_0x3b11c6]of Object[_0x24a4ab(0x1b4)](_0x3ed964)){const _0x459a3d=resolveManagedFilePath(_0x5de3f8,_0x5ed2ae);if(!existsSync(_0x459a3d))throw CliErrors[_0x24a4ab(0x1d5)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x5de3f8,_0x24a4ab(0x1d8)+_0x5ed2ae);const _0x3d7c07=lstatSync(_0x459a3d);if(!_0x3d7c07[_0x24a4ab(0x1af)]())throw CliErrors[_0x24a4ab(0x1d5)](_0x24a4ab(0x1a1)+_0x5de3f8,_0x24a4ab(0x1d2)+_0x5ed2ae);const _0x453b6f=bufferSha256(readFileSync(_0x459a3d));if(_0x453b6f!==_0x3b11c6)throw CliErrors['validation']('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x5de3f8+_0x24a4ab(0x1b2)+_0x5ed2ae,_0x24a4ab(0x1cc)+_0x5ed2ae);}else{const _0x30f09c=resolve(_0x5de3f8,SKILL_FILE);if(existsSync(_0x30f09c)&&_0x4a2ee7[_0x24a4ab(0x1a0)]){const _0x5ed22e=contentHash(readFileSync(_0x30f09c,_0x24a4ab(0x1db)));if(_0x5ed22e!==_0x4a2ee7[_0x24a4ab(0x1a0)])throw CliErrors[_0x24a4ab(0x1d5)]('Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20'+_0x30f09c,_0x24a4ab(0x1b5));}}for(const _0x563702 of normalizeLocalFiles(_0x327167)){if(_0x3ed964?.[_0x563702[_0x24a4ab(0x1ca)]])continue;if(!_0x3ed964&&_0x563702[_0x24a4ab(0x1ca)]===SKILL_FILE)continue;const _0x11e700=resolveManagedFilePath(_0x5de3f8,_0x563702[_0x24a4ab(0x1ca)]);if(!existsSync(_0x11e700))continue;const _0x5baec1=lstatSync(_0x11e700);if(!_0x5baec1['isFile']())throw CliErrors[_0x24a4ab(0x1d5)](_0x24a4ab(0x1a1)+_0x5de3f8,_0x24a4ab(0x1c5)+_0x563702[_0x24a4ab(0x1ca)]);const _0x2333c1=bufferSha256(readFileSync(_0x11e700));if(_0x2333c1!==fileHash(_0x563702))throw CliErrors[_0x24a4ab(0x1d5)](_0x24a4ab(0x1a1)+_0x5de3f8,_0x24a4ab(0x1b0)+_0x563702[_0x24a4ab(0x1ca)]);}}function materializeFiles(_0x2542a5,_0x590a16){const _0xedd5c2=a161_0x4bd0;for(const _0x1aaf12 of normalizeLocalFiles(_0x590a16)){const _0x333db8=resolveManagedFilePath(_0x2542a5,_0x1aaf12[_0xedd5c2(0x1ca)]);mkdirSync(dirname(_0x333db8),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x333db8,fileContent(_0x1aaf12),0x180);}}function removeStaleManagedFiles(_0x5af2d1,_0x3615e4,_0x3dfc59){const _0x173350=a161_0x4bd0;if(!_0x3615e4)return;const _0x3c362f=new Set(normalizeLocalFiles(_0x3dfc59)[_0x173350(0x1b6)](_0x47126f=>_0x47126f['path']));for(const _0x5e6563 of Object[_0x173350(0x1aa)](_0x3615e4)){if(_0x3c362f['has'](_0x5e6563))continue;const _0xf5735b=resolveManagedFilePath(_0x5af2d1,_0x5e6563);existsSync(_0xf5735b)&&lstatSync(_0xf5735b)[_0x173350(0x1af)]()&&rmSync(_0xf5735b,{'force':!![]});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a162_0x4487(){const _0x1c5367=['Runtime\x20Skill\x20is\x20missing\x20skillCode.','Invalid\x20','toISOString','utf8','readonly','453080GpWMAl','tags','example','773476EIdZzr','version','28CAtEaP','validation','trim','1135374JREvVG','1918221VnrYmc','manifest','forkedFromSkillId','userId','1156192XBFWhY','skillCode','object','forkedFromVersion','files','map','path','status','isArray','1957830NYNMnT','418312YuviEJ','tenantCode','hasUpstreamUpdate','zipSha256','length','fromEntries','ossPath','parse'];a162_0x4487=function(){return _0x1c5367;};return a162_0x4487();}(function(_0x323c27,_0x4299b2){const _0x59ee1c=a162_0x505c,_0x546a8f=_0x323c27();while(!![]){try{const _0x38769c=parseInt(_0x59ee1c(0xd3))/0x1+-parseInt(_0x59ee1c(0xd6))/0x2+parseInt(_0x59ee1c(0xdc))/0x3+parseInt(_0x59ee1c(0xc6))/0x4+parseInt(_0x59ee1c(0xc5))/0x5+-parseInt(_0x59ee1c(0xdb))/0x6+parseInt(_0x59ee1c(0xd8))/0x7*(-parseInt(_0x59ee1c(0xe0))/0x8);if(_0x38769c===_0x4299b2)break;else _0x546a8f['push'](_0x546a8f['shift']());}catch(_0x9e6ece){_0x546a8f['push'](_0x546a8f['shift']());}}}(a162_0x4487,0x6a188));import{existsSync,readFileSync}from'node:fs';function a162_0x505c(_0x1265cb,_0x2b2060){_0x1265cb=_0x1265cb-0xc5;const _0x44872e=a162_0x4487();let _0x505ca1=_0x44872e[_0x1265cb];return _0x505ca1;}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(_0x119e7b,_0x527d16,_0x545f08,_0x3b0836,_0x26413e,_0x8570ce,_0xae0dbc){const _0x20557a=a162_0x505c,_0x284004=_0x8570ce?normalizeLocalFiles(_0x8570ce):[],_0x4f63e3=!_0xae0dbc&&_0x284004[_0x20557a(0xca)]>0x0?buildSkillPackage(_0x284004):undefined,_0x19455f=_0xae0dbc?bufferSha256(_0xae0dbc):_0x4f63e3?.[_0x20557a(0xdd)][_0x20557a(0xc9)],_0x55acbd=_0xae0dbc?.[_0x20557a(0xca)]??_0x4f63e3?.[_0x20557a(0xdd)]['zipSize'],_0x5675bf=_0x284004[_0x20557a(0xca)]>0x0?Object[_0x20557a(0xcb)](_0x284004[_0x20557a(0xe5)](_0x5bf3bd=>[_0x5bf3bd[_0x20557a(0xe6)],fileHash(_0x5bf3bd)])):undefined;return{'schemaVersion':_0x284004[_0x20557a(0xca)]>0x0?0x2:0x1,'id':_0x119e7b['id'],'appCode':_0x545f08,'skillCode':requireSkillCode(_0x119e7b),'skillName':_0x119e7b['skillName'],'description':_0x119e7b['description'],'example':_0x119e7b[_0x20557a(0xd5)],'scope':_0x527d16,'readonly':_0x527d16!=='personal'||_0x119e7b[_0x20557a(0xd2)]===!![],'tenantCode':_0x119e7b[_0x20557a(0xc7)],'userId':_0x119e7b[_0x20557a(0xdf)],'version':_0x119e7b[_0x20557a(0xd7)],'status':_0x119e7b[_0x20557a(0xe7)],'tags':Array[_0x20557a(0xe8)](_0x119e7b[_0x20557a(0xd4)])?_0x119e7b[_0x20557a(0xd4)]:[],'hasUpstreamUpdate':_0x119e7b[_0x20557a(0xc8)],'forkedFromSkillId':_0x119e7b[_0x20557a(0xde)],'forkedFromVersion':_0x119e7b[_0x20557a(0xe3)],'sourceSessionId':_0x119e7b['sourceSessionId'],'contentHash':_0x3b0836,'fileHashes':_0x5675bf,'treeHash':_0x284004[_0x20557a(0xca)]>0x0?fileTreeHash(localFilesToManifestFiles(_0x284004)):undefined,'ossPath':remoteManifestOssPath(_0x119e7b[_0x20557a(0xe4)]),'zipSha256':_0x19455f,'zipSize':_0x55acbd,'files':_0x284004['length']>0x0?_0x284004[_0x20557a(0xe5)](_0x1d265d=>({'path':_0x1d265d[_0x20557a(0xe6)],'hash':fileHash(_0x1d265d),'size':fileContent(_0x1d265d)['length']})):undefined,'pulledAt':_0x26413e??new Date()[_0x20557a(0xd0)]()};}export function requireSkillCode(_0x28f959){const _0x1a365a=a162_0x505c,_0x1495f5=_0x28f959[_0x1a365a(0xe1)]?.[_0x1a365a(0xda)]();if(!_0x1495f5)throw CliErrors[_0x1a365a(0xd9)](_0x1a365a(0xce));return _0x1495f5;}export function readMetadataIfPresent(_0x799c21){const _0x1cabd5=a162_0x505c;if(!existsSync(_0x799c21))return undefined;try{const _0x34326d=JSON[_0x1cabd5(0xcd)](readFileSync(_0x799c21,_0x1cabd5(0xd1)));return _0x34326d;}catch{throw CliErrors['validation'](_0x1cabd5(0xcf)+METADATA_FILE+':\x20'+_0x799c21);}}function remoteManifestOssPath(_0x1c2c1c){const _0x465fd6=a162_0x505c;if(!_0x1c2c1c||typeof _0x1c2c1c!==_0x465fd6(0xe2)||Array['isArray'](_0x1c2c1c))return undefined;const _0x52202a=_0x1c2c1c[_0x465fd6(0xcc)];return typeof _0x52202a==='string'&&_0x52202a[_0x465fd6(0xda)]()?_0x52202a['trim']():undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a163_0x4eb808=a163_0x3559;(function(_0x40c254,_0x489df7){const _0x32eef5=a163_0x3559,_0x631573=_0x40c254();while(!![]){try{const _0x2ba8ce=parseInt(_0x32eef5(0x75))/0x1*(-parseInt(_0x32eef5(0x7a))/0x2)+-parseInt(_0x32eef5(0x88))/0x3*(parseInt(_0x32eef5(0x81))/0x4)+-parseInt(_0x32eef5(0x85))/0x5+-parseInt(_0x32eef5(0x8c))/0x6+-parseInt(_0x32eef5(0x7b))/0x7*(parseInt(_0x32eef5(0x89))/0x8)+parseInt(_0x32eef5(0x86))/0x9*(-parseInt(_0x32eef5(0x77))/0xa)+-parseInt(_0x32eef5(0x80))/0xb*(-parseInt(_0x32eef5(0x7e))/0xc);if(_0x2ba8ce===_0x489df7)break;else _0x631573['push'](_0x631573['shift']());}catch(_0x426ce7){_0x631573['push'](_0x631573['shift']());}}}(a163_0x3bc5,0xb2848));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(_0x5e9318={}){const _0xf797f9=a163_0x3559,_0x51d976=_0x5e9318[_0xf797f9(0x8d)]??homedir(),_0x5705eb=resolve(_0x51d976,PRODUCT_CONFIG[_0xf797f9(0x74)],'cache'),_0x5d355f=trimmedEnv(_0xf797f9(0x87)),_0x208dda=trimmedEnv('CLAUDE_SKILL_ROOT'),_0x10e55a=resolve(_0x51d976,_0xf797f9(0x73)),_0x2a4325=_0x5e9318[_0xf797f9(0x84)]??(existsSync(_0x10e55a)?resolve(_0x10e55a,'skills'):undefined);return{'homeDir':_0x51d976,'cacheRoot':_0x5705eb,'managedRoot':resolve(_0x51d976,PRODUCT_CONFIG['homeDirName']),'agentsSkillsDir':_0x5e9318['agentsSkillsDir']??_0x5d355f??resolve(_0x51d976,_0xf797f9(0x72),_0xf797f9(0x79)),'claudeSkillsDir':_0x5e9318[_0xf797f9(0x8f)]??_0x208dda??resolve(_0x51d976,_0xf797f9(0x83),_0xf797f9(0x79)),'workbuddySkillsDir':_0x2a4325};}function a163_0x3559(_0x1e90de,_0x34f5fd){_0x1e90de=_0x1e90de-0x72;const _0x3bc5ff=a163_0x3bc5();let _0x355972=_0x3bc5ff[_0x1e90de];return _0x355972;}export function runtimeAgentSkillRoots(_0x5867e7){const _0x3aba5c=a163_0x3559;return[_0x5867e7['agentsSkillsDir'],_0x5867e7[_0x3aba5c(0x8f)],_0x5867e7[_0x3aba5c(0x84)]][_0x3aba5c(0x7f)](_0x45cc5e=>Boolean(_0x45cc5e));}function a163_0x3bc5(){const _0x3d9e12=['.workbuddy','homeDirName','2NouOuR','skillCode','130930JmOMPm','validation','skills','838478fmpXmR','10871KqBKVv','Unsafe\x20','\x20for\x20local\x20path:\x20','30540Mcfrlm','filter','23573DrtalK','1739324UCaUDC','trim','.claude','workbuddySkillsDir','2917745jAVdXx','657TfzcJD','SKILL_ROOT','9WByyyd','88ouexNz','appCode','includes','6140010oljsiK','homeDir','path\x20segment','claudeSkillsDir','.agents'];a163_0x3bc5=function(){return _0x3d9e12;};return a163_0x3bc5();}export function getRuntimeSkillCacheRoot(_0x15b64e,_0x238c3d,_0x2b9abb={}){const _0xdf7810=a163_0x3559,_0x11283c=resolveSkillSyncPaths(_0x2b9abb);return resolve(_0x11283c['cacheRoot'],_0x15b64e,fingerprintAccessKey(_0x238c3d),_0xdf7810(0x79));}export function getRuntimeSkillDir(_0x37baa8,_0x286e07,_0x502d0f,_0x28f92c,_0x4def05,_0x3ba922={}){const _0x4bb947=a163_0x3559;return resolve(getRuntimeSkillCacheRoot(_0x37baa8,_0x286e07,_0x3ba922),safePathSegment(_0x502d0f,_0x4bb947(0x8a)),_0x28f92c,safePathSegment(_0x4def05,_0x4bb947(0x76)));}export function safePathSegment(_0x508446,_0x2b5e43=a163_0x4eb808(0x8e)){const _0xa741de=a163_0x4eb808;if(!_0x508446||_0x508446[_0xa741de(0x8b)]('/')||_0x508446['includes']('\x5c')||_0x508446['includes']('..'))throw CliErrors[_0xa741de(0x78)](_0xa741de(0x7c)+_0x2b5e43+_0xa741de(0x7d)+_0x508446);return _0x508446;}function trimmedEnv(_0x559ec8){const _0x62ba98=a163_0x4eb808,_0x5c6887=productEnv(_0x559ec8)?.[_0x62ba98(0x82)]();return _0x5c6887?_0x5c6887:undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0xf48eb6,_0x5c96ca){const _0x15a0e2=a164_0x55b4,_0x7312a8=_0xf48eb6();while(!![]){try{const _0x5e0057=parseInt(_0x15a0e2(0xda))/0x1+-parseInt(_0x15a0e2(0xe3))/0x2*(-parseInt(_0x15a0e2(0xed))/0x3)+parseInt(_0x15a0e2(0xf8))/0x4+parseInt(_0x15a0e2(0xca))/0x5*(-parseInt(_0x15a0e2(0xde))/0x6)+parseInt(_0x15a0e2(0xbf))/0x7+parseInt(_0x15a0e2(0xc2))/0x8*(parseInt(_0x15a0e2(0xd1))/0x9)+-parseInt(_0x15a0e2(0xd7))/0xa;if(_0x5e0057===_0x5c96ca)break;else _0x7312a8['push'](_0x7312a8['shift']());}catch(_0x17823e){_0x7312a8['push'](_0x7312a8['shift']());}}}(a164_0x536d,0x94940));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a164_0x31dccc}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{writeJsonAtomic}from'./fs-utils.js';import{contentHash}from'./hashing.js';import{fileText,normalizeLocalFiles,scanSkillDirectory}from'./local-files.js';import{buildMetadata,readMetadataIfPresent}from'./metadata.js';import{buildSkillPackage,tryNormalizePackageManifest}from'./zip-package.js';export function resolvePushDirectoryIdentity(_0x5e528b,_0x4baba2,_0xa9dbd={}){const _0x437431=a164_0x55b4,_0x2d4f32=resolvePushDirectoryRoot(_0x5e528b),_0x4fe26e=readPushMetadataIfPresent(resolve(_0x2d4f32,METADATA_FILE),{'ignoreInvalidMetadata':_0xa9dbd[_0x437431(0xc3)]});if(_0x4fe26e?.[_0x437431(0xd6)]&&_0x4fe26e[_0x437431(0xd6)]!==_0x4baba2&&!_0xa9dbd[_0x437431(0xf5)]&&!_0xa9dbd[_0x437431(0xbe)])throw CliErrors['validation'](_0x437431(0xd3)+_0x4fe26e['appCode']+'\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22'+_0x4baba2+'\x22.');const _0x527832=resolvePushSkillCode(_0x2d4f32,_0x4baba2,_0x4fe26e,_0xa9dbd);if(!_0x527832)throw CliErrors[_0x437431(0xbb)]('Unable\x20to\x20resolve\x20skillCode\x20from\x20'+SKILL_FILE+',\x20'+METADATA_FILE+_0x437431(0xe0));return{'dir':_0x2d4f32,'skillCode':_0x527832,'metadata':_0x4fe26e};}export function readPushDirectory(_0x4c0b49,_0x373803,_0x18295d={}){const _0x33fce9=a164_0x55b4,_0x4d9998=resolvePushDirectoryIdentity(_0x4c0b49,_0x373803,_0x18295d),_0x434908=_0x4d9998[_0x33fce9(0xe8)],_0x3f7ff8=resolve(_0x434908,SKILL_FILE);if(!existsSync(_0x3f7ff8)||!lstatSync(_0x3f7ff8)[_0x33fce9(0xcf)]())throw CliErrors['validation']('Missing\x20'+SKILL_FILE+':\x20'+_0x3f7ff8);const _0x3e65ab=_0x4d9998[_0x33fce9(0xc9)],_0x2215d1=_0x18295d[_0x33fce9(0xe1)]??'personal';if(!_0x18295d[_0x33fce9(0xd0)]&&_0x3e65ab?.['scope']==='builtin')throw CliErrors[_0x33fce9(0xbb)]('Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20'+METADATA_FILE+'\x20has\x20scope=\x22'+_0x3e65ab[_0x33fce9(0xc6)]+'\x22.');if(!_0x18295d['ignoreMetadataScope']&&_0x2215d1===_0x33fce9(0xe5)&&_0x3e65ab?.[_0x33fce9(0xc6)]&&_0x3e65ab[_0x33fce9(0xc6)]!==_0x33fce9(0xe5))throw CliErrors['validation'](_0x33fce9(0xd9)+METADATA_FILE+'\x20has\x20scope=\x22'+_0x3e65ab[_0x33fce9(0xc6)]+'\x22.',_0x33fce9(0xf7)+_0x434908+_0x33fce9(0xea));const _0x53ef90=scanSkillDirectory(_0x434908,{'excludedFilePaths':_0x18295d[_0x33fce9(0xe2)]}),_0x1dff94=buildSkillPackage(_0x53ef90),_0x3de186=readFileSync(_0x3f7ff8,'utf8'),_0x2eb778=_0x4d9998[_0x33fce9(0xcd)],_0x3bb449=_0x18295d[_0x33fce9(0xeb)]?undefined:_0x3e65ab,_0x561653=readSkillDisplayName(_0x3de186);return{'skillCode':_0x2eb778,'metadata':_0x3e65ab,'frontmatterDisplayName':_0x561653,'input':{'skillCode':_0x2eb778,'skillName':_0x561653??_0x3bb449?.[_0x33fce9(0xf4)],'description':_0x3bb449?.[_0x33fce9(0xb7)],'content':_0x3de186,'files':_0x1dff94['manifest'],'packageBase64':_0x1dff94[_0x33fce9(0xd5)],'tags':_0x3bb449?.[_0x33fce9(0xef)],'version':_0x3bb449?.[_0x33fce9(0xf3)],'sourceSessionId':_0x3bb449?.[_0x33fce9(0xb9)]}};}export function refreshPushDirectoryMetadataFromRemote(_0x3ad614,_0x4a9029,_0x562e5f,_0x1fd052={}){const _0xe2c561=a164_0x55b4,_0x1ec89a=resolvePushDirectoryRoot(_0x3ad614),_0x3a4bcb=readPushMetadataIfPresent(resolve(_0x1ec89a,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x1ce5bf=requireRemoteScope(_0x4a9029),_0x2f7488=readLocalSkillContent(_0x1ec89a),_0x4adef4={..._0x4a9029,'appCode':_0x4a9029[_0xe2c561(0xd6)]??_0x562e5f,'skillName':_0x4a9029['skillName']??_0x3a4bcb?.['skillName'],'description':_0x4a9029[_0xe2c561(0xb7)]??_0x3a4bcb?.['description'],'example':_0x4a9029[_0xe2c561(0xc7)]??_0x3a4bcb?.[_0xe2c561(0xc7)],'tags':Array[_0xe2c561(0xe9)](_0x4a9029[_0xe2c561(0xef)])?_0x4a9029[_0xe2c561(0xef)]:_0x3a4bcb?.['tags'],'sourceSessionId':_0x4a9029['sourceSessionId']??_0x3a4bcb?.[_0xe2c561(0xb9)],'content':_0x4a9029[_0xe2c561(0xcc)]??_0x2f7488},_0x1ae23e=buildMetadata(_0x4adef4,_0x1ce5bf,_0x562e5f,contentHash(_0x2f7488),_0x1fd052[_0xe2c561(0xbd)]);writeJsonAtomic(resolve(_0x1ec89a,METADATA_FILE),_0x1ae23e);}export function recordPushedRuntimeSkill(_0x33b3c4,_0x13b32e,_0x57468c,_0x386615={}){const _0x3a4c0c=a164_0x55b4,_0x2661ef=resolvePushDirectoryRoot(_0x33b3c4),_0x439de9=scanSkillDirectory(_0x2661ef),_0x11d5e3=_0x439de9[_0x3a4c0c(0xe6)](_0x2c531e=>_0x2c531e[_0x3a4c0c(0xba)]===SKILL_FILE),_0x529eb0=_0x11d5e3?fileText(_0x11d5e3):'',_0x574de0=tryNormalizePackageManifest(_0x13b32e[_0x3a4c0c(0xc4)]),_0x8a8a0a={..._0x13b32e,'content':_0x13b32e[_0x3a4c0c(0xcc)]??_0x529eb0,'files':_0x574de0},_0xa3c9c8=_0x574de0?normalizeLocalFiles(_0x439de9)[_0x3a4c0c(0xcb)](_0x4d74b0=>_0x574de0[_0x3a4c0c(0xc4)][_0x3a4c0c(0xe7)](_0x4e0821=>_0x4e0821['path']===_0x4d74b0[_0x3a4c0c(0xba)])):undefined,_0x754dda=buildMetadata(_0x8a8a0a,_0x386615[_0x3a4c0c(0xc6)]??_0x3a4c0c(0xe5),_0x57468c,contentHash(_0x8a8a0a['content']??''),_0x386615[_0x3a4c0c(0xdc)],_0xa3c9c8);writeJsonAtomic(resolve(_0x2661ef,METADATA_FILE),_0x754dda);}function a164_0x55b4(_0x2b2b93,_0x329e36){_0x2b2b93=_0x2b2b93-0xb7;const _0x536d8c=a164_0x536d();let _0x55b4ff=_0x536d8c[_0x2b2b93];return _0x55b4ff;}export function deriveSkillCodeFromDirectory(_0x5af4d3,_0x4308e4){const _0x1dd363=a164_0x55b4,_0x2e03bb=basename(resolve(_0x5af4d3)),_0x25becf=_0x4308e4+'--';return _0x2e03bb[_0x1dd363(0xce)](_0x25becf)?_0x2e03bb[_0x1dd363(0xd2)](_0x25becf[_0x1dd363(0xbc)]):_0x2e03bb;}function resolvePushSkillCode(_0x32b4e6,_0x38f9fd,_0x310f27,_0x68f9b9){const _0xfb13a5=a164_0x55b4,_0x101526=deriveSkillCodeFromSkillFile(_0x32b4e6)||deriveSkillCodeFromDirectory(_0x32b4e6,_0x38f9fd);if(_0x68f9b9[_0xfb13a5(0xd4)])return _0x101526;return _0x310f27?.[_0xfb13a5(0xcd)]?.[_0xfb13a5(0xc1)]()||_0x101526;}function deriveSkillCodeFromSkillFile(_0x20580e){const _0x285b11=a164_0x55b4,_0x4c23d8=resolve(_0x20580e,SKILL_FILE);if(!existsSync(_0x4c23d8)||!lstatSync(_0x4c23d8)[_0x285b11(0xcf)]())return undefined;const _0x4a3f46=readFileSync(_0x4c23d8,_0x285b11(0xf0)),_0x42b7f5=_0x4a3f46[_0x285b11(0xf9)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x42b7f5)return undefined;const _0x23fe1b=parseFrontmatterObject(_0x42b7f5[0x1]??''),_0x45ac68=scalarToString(_0x23fe1b?.['name']);return _0x45ac68?slugifySkillName(_0x45ac68):undefined;}function readSkillDisplayName(_0x5343ee){const _0x728b0e=a164_0x55b4,_0x423b3d=_0x5343ee[_0x728b0e(0xf9)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x423b3d)return undefined;const _0x3fe5e5=parseFrontmatterObject(_0x423b3d[0x1]??'');return scalarToString(_0x3fe5e5?.['displayName']);}function slugifySkillName(_0x114751){const _0x1dfffe=a164_0x55b4,_0xfd5b93=_0x114751[_0x1dfffe(0xc1)]()[_0x1dfffe(0xc5)]()['replace'](/[^\p{L}\p{N}\p{So}]+/gu,'-')[_0x1dfffe(0xec)](/^-+/,'')['replace'](/-+$/,'')['replace'](/-{2,}/g,'-');if(!_0xfd5b93)throw CliErrors[_0x1dfffe(0xbb)](_0x1dfffe(0xc0)+SKILL_FILE+_0x1dfffe(0xe4));return _0xfd5b93;}function parseFrontmatterObject(_0x2707e3){const _0x5abc93=a164_0x55b4;try{const _0x1e3940=a164_0x31dccc(_0x2707e3);return _0x1e3940&&typeof _0x1e3940===_0x5abc93(0xf6)&&!Array[_0x5abc93(0xe9)](_0x1e3940)?_0x1e3940:undefined;}catch{return undefined;}}function scalarToString(_0x2e9cc8){const _0x438983=a164_0x55b4;if(typeof _0x2e9cc8===_0x438983(0xf1))return _0x2e9cc8[_0x438983(0xc1)]();if(typeof _0x2e9cc8===_0x438983(0xf2)||typeof _0x2e9cc8===_0x438983(0xdb))return String(_0x2e9cc8);return undefined;}function resolvePushDirectoryRoot(_0xad1fa9){const _0x2ed7c3=a164_0x55b4,_0x5df5f2=resolve(_0xad1fa9);if(!existsSync(_0x5df5f2))throw CliErrors[_0x2ed7c3(0xbb)](_0x2ed7c3(0xc8)+_0xad1fa9);const _0x4c3484=lstatSync(_0x5df5f2);if(_0x4c3484[_0x2ed7c3(0xd8)]())return _0x5df5f2;if(_0x4c3484[_0x2ed7c3(0xee)]()){const _0x487c65=realpathSync(_0x5df5f2);if(lstatSync(_0x487c65)[_0x2ed7c3(0xd8)]())return _0x487c65;}throw CliErrors[_0x2ed7c3(0xbb)](_0x2ed7c3(0xc8)+_0xad1fa9);}function a164_0x536d(){const _0x1f33d3=['skillName','allowAppCodeRetarget','object','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20','1333108NDRZzD','match','description','\x20has\x20unsupported\x20scope\x20\x22','sourceSessionId','path','validation','length','refreshedAt','ignoreMetadataAppCodeMismatch','2615998GlrMOh','Invalid\x20','trim','192048hXKIPf','ignoreInvalidMetadata','files','toLowerCase','scope','example','Skill\x20directory\x20not\x20found:\x20','metadata','128700NBdxxa','filter','content','skillCode','startsWith','isFile','ignoreMetadataScope','207ixpBxR','slice','Skill\x20metadata\x20appCode\x20\x22','ignoreMetadataSkillCode','packageBase64','appCode','11364380BbjWnR','isDirectory','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20','366318crxPfH','boolean','pushedAt','company','132ScYwOV','builtin',',\x20or\x20directory\x20name.','targetScope','excludedFilePaths','9206TmncCk','\x20name\x20for\x20SkillHub\x20slug\x20generation.','personal','find','some','dir','isArray','\x20to\x20submit\x20company\x20Skills\x20for\x20review.','ignoreMetadataForPayload','replace','447bZxqen','isSymbolicLink','tags','utf8','string','number','version'];a164_0x536d=function(){return _0x1f33d3;};return a164_0x536d();}function requireRemoteScope(_0x16a0f8){const _0x3d0e52=a164_0x55b4;if(_0x16a0f8[_0x3d0e52(0xc6)]===_0x3d0e52(0xe5)||_0x16a0f8[_0x3d0e52(0xc6)]===_0x3d0e52(0xdd)||_0x16a0f8[_0x3d0e52(0xc6)]===_0x3d0e52(0xdf))return _0x16a0f8[_0x3d0e52(0xc6)];throw CliErrors[_0x3d0e52(0xbb)]('Remote\x20Skill\x20'+(_0x16a0f8['skillCode']||'(unknown)')+_0x3d0e52(0xb8)+(_0x16a0f8[_0x3d0e52(0xc6)]??'unknown')+'\x22.');}function readLocalSkillContent(_0x2f7ba0){const _0x2db0cf=a164_0x55b4,_0x9e34f1=resolve(_0x2f7ba0,SKILL_FILE);return existsSync(_0x9e34f1)&&lstatSync(_0x9e34f1)[_0x2db0cf(0xcf)]()?readFileSync(_0x9e34f1,_0x2db0cf(0xf0)):'';}function readPushMetadataIfPresent(_0x40581a,_0x1d1ac4={}){try{return readMetadataIfPresent(_0x40581a);}catch(_0xd3636b){if(_0x1d1ac4['ignoreInvalidMetadata'])return undefined;throw _0xd3636b;}}
|
|
1
|
+
(function(_0x1844cd,_0x27b916){const _0x1290eb=a164_0x1be3,_0x402016=_0x1844cd();while(!![]){try{const _0x575618=parseInt(_0x1290eb(0x204))/0x1+parseInt(_0x1290eb(0x209))/0x2+-parseInt(_0x1290eb(0x211))/0x3*(-parseInt(_0x1290eb(0x1ee))/0x4)+-parseInt(_0x1290eb(0x1f1))/0x5*(-parseInt(_0x1290eb(0x1f5))/0x6)+parseInt(_0x1290eb(0x1f7))/0x7+-parseInt(_0x1290eb(0x1fc))/0x8+-parseInt(_0x1290eb(0x200))/0x9;if(_0x575618===_0x27b916)break;else _0x402016['push'](_0x402016['shift']());}catch(_0x4c3396){_0x402016['push'](_0x402016['shift']());}}}(a164_0x139c,0x1f82f));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a164_0x3c4cf8}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{writeJsonAtomic}from'./fs-utils.js';import{contentHash}from'./hashing.js';import{fileText,normalizeLocalFiles,scanSkillDirectory}from'./local-files.js';import{buildMetadata,readMetadataIfPresent}from'./metadata.js';import{buildSkillPackage,tryNormalizePackageManifest}from'./zip-package.js';export function resolvePushDirectoryIdentity(_0x558db7,_0x133ac5,_0x5495af={}){const _0x5906e1=a164_0x1be3,_0x456684=resolvePushDirectoryRoot(_0x558db7),_0x40f164=readPushMetadataIfPresent(resolve(_0x456684,METADATA_FILE),{'ignoreInvalidMetadata':_0x5495af[_0x5906e1(0x205)]});if(_0x40f164?.[_0x5906e1(0x1e5)]&&_0x40f164['appCode']!==_0x133ac5&&!_0x5495af['allowAppCodeRetarget']&&!_0x5495af['ignoreMetadataAppCodeMismatch'])throw CliErrors[_0x5906e1(0x1e9)](_0x5906e1(0x20d)+_0x40f164['appCode']+_0x5906e1(0x1e6)+_0x133ac5+'\x22.');const _0x14fda1=resolvePushSkillCode(_0x456684,_0x133ac5,_0x40f164,_0x5495af);if(!_0x14fda1)throw CliErrors[_0x5906e1(0x1e9)]('Unable\x20to\x20resolve\x20skillCode\x20from\x20'+SKILL_FILE+',\x20'+METADATA_FILE+_0x5906e1(0x1ef));return{'dir':_0x456684,'skillCode':_0x14fda1,'metadata':_0x40f164};}export function readPushDirectory(_0x1824cb,_0x2780a5,_0x387f82={}){const _0x2ab82b=a164_0x1be3,_0x4e0760=resolvePushDirectoryIdentity(_0x1824cb,_0x2780a5,_0x387f82),_0x19187c=_0x4e0760['dir'],_0x4b602e=resolve(_0x19187c,SKILL_FILE);if(!existsSync(_0x4b602e)||!lstatSync(_0x4b602e)[_0x2ab82b(0x210)]())throw CliErrors[_0x2ab82b(0x1e9)](_0x2ab82b(0x1f0)+SKILL_FILE+':\x20'+_0x4b602e);const _0xf4fbaa=_0x4e0760[_0x2ab82b(0x21a)],_0x5bad80=_0x387f82[_0x2ab82b(0x206)]??_0x2ab82b(0x202);if(!_0x387f82['ignoreMetadataScope']&&_0xf4fbaa?.[_0x2ab82b(0x1f4)]===_0x2ab82b(0x1f6))throw CliErrors[_0x2ab82b(0x1e9)](_0x2ab82b(0x1e1)+METADATA_FILE+_0x2ab82b(0x1e8)+_0xf4fbaa[_0x2ab82b(0x1f4)]+'\x22.');if(!_0x387f82[_0x2ab82b(0x20b)]&&_0x5bad80===_0x2ab82b(0x202)&&_0xf4fbaa?.[_0x2ab82b(0x1f4)]&&_0xf4fbaa[_0x2ab82b(0x1f4)]!=='personal')throw CliErrors[_0x2ab82b(0x1e9)](_0x2ab82b(0x215)+METADATA_FILE+_0x2ab82b(0x1e8)+_0xf4fbaa[_0x2ab82b(0x1f4)]+'\x22.',_0x2ab82b(0x219)+_0x19187c+_0x2ab82b(0x1e2));const _0x573c82=scanSkillDirectory(_0x19187c,{'excludedFilePaths':_0x387f82[_0x2ab82b(0x20f)]}),_0x11dfbb=buildSkillPackage(_0x573c82),_0x5e2125=readFileSync(_0x4b602e,_0x2ab82b(0x1eb)),_0x4333ae=_0x4e0760[_0x2ab82b(0x21b)],_0x519369=_0x387f82[_0x2ab82b(0x213)]?undefined:_0xf4fbaa,_0x4ae825=readSkillDisplayName(_0x5e2125);return{'skillCode':_0x4333ae,'metadata':_0xf4fbaa,'frontmatterDisplayName':_0x4ae825,'input':{'skillCode':_0x4333ae,'skillName':_0x4ae825??_0x519369?.[_0x2ab82b(0x1e4)],'description':_0x519369?.['description'],'content':_0x5e2125,'files':_0x11dfbb[_0x2ab82b(0x1fe)],'packageBase64':_0x11dfbb[_0x2ab82b(0x216)],'tags':_0x519369?.['tags'],'version':_0x519369?.['version'],'sourceSessionId':_0x519369?.[_0x2ab82b(0x1e3)]}};}function a164_0x139c(){const _0x245928=['ignoreMetadataForPayload','object','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20','packageBase64','some','files','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20','metadata','skillCode','description','find','trim','Remote\x20Skill\x20','Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20','\x20to\x20submit\x20company\x20Skills\x20for\x20review.','sourceSessionId','skillName','appCode','\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22','startsWith','\x20has\x20scope=\x22','validation','Skill\x20directory\x20not\x20found:\x20','utf8','pushedAt','\x20name\x20for\x20SkillHub\x20slug\x20generation.','4plJTuI',',\x20or\x20directory\x20name.','Missing\x20','15jPsNmy','toLowerCase','\x20has\x20unsupported\x20scope\x20\x22','scope','376110hTEFxy','builtin','100492hNLkKA','length','tags','replace','refreshedAt','1313664YwRgQe','example','manifest','match','3530862DcHjIA','isDirectory','personal','content','31586cKosTV','ignoreInvalidMetadata','targetScope','company','isArray','452982ZJCSGz','filter','ignoreMetadataScope','path','Skill\x20metadata\x20appCode\x20\x22','number','excludedFilePaths','isFile','675327kxvvuH','displayName'];a164_0x139c=function(){return _0x245928;};return a164_0x139c();}export function refreshPushDirectoryMetadataFromRemote(_0x21a31b,_0x231674,_0x1652e4,_0xfddcf9={}){const _0x5252f6=a164_0x1be3,_0x32366a=resolvePushDirectoryRoot(_0x21a31b),_0x3ffb77=readPushMetadataIfPresent(resolve(_0x32366a,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x25a12a=requireRemoteScope(_0x231674),_0x1ce16a=readLocalSkillContent(_0x32366a),_0x5a1a2a={..._0x231674,'appCode':_0x231674[_0x5252f6(0x1e5)]??_0x1652e4,'skillName':_0x231674[_0x5252f6(0x1e4)]??_0x3ffb77?.['skillName'],'description':_0x231674['description']??_0x3ffb77?.[_0x5252f6(0x21c)],'example':_0x231674['example']??_0x3ffb77?.[_0x5252f6(0x1fd)],'tags':Array['isArray'](_0x231674['tags'])?_0x231674[_0x5252f6(0x1f9)]:_0x3ffb77?.[_0x5252f6(0x1f9)],'sourceSessionId':_0x231674['sourceSessionId']??_0x3ffb77?.[_0x5252f6(0x1e3)],'content':_0x231674['content']??_0x1ce16a},_0x73e08f=buildMetadata(_0x5a1a2a,_0x25a12a,_0x1652e4,contentHash(_0x1ce16a),_0xfddcf9[_0x5252f6(0x1fb)]);writeJsonAtomic(resolve(_0x32366a,METADATA_FILE),_0x73e08f);}export function recordPushedRuntimeSkill(_0x4f9646,_0x8fa442,_0x402dc8,_0x1c428f={}){const _0x450170=a164_0x1be3,_0x8a7f97=resolvePushDirectoryRoot(_0x4f9646),_0x2ec2a6=scanSkillDirectory(_0x8a7f97),_0x28c30c=_0x2ec2a6[_0x450170(0x21d)](_0xa13352=>_0xa13352[_0x450170(0x20c)]===SKILL_FILE),_0x4e9e72=_0x28c30c?fileText(_0x28c30c):'',_0x40c901=tryNormalizePackageManifest(_0x8fa442[_0x450170(0x218)]),_0x3c3c80={..._0x8fa442,'content':_0x8fa442[_0x450170(0x203)]??_0x4e9e72,'files':_0x40c901},_0x433d86=_0x40c901?normalizeLocalFiles(_0x2ec2a6)[_0x450170(0x20a)](_0x7276b8=>_0x40c901[_0x450170(0x218)][_0x450170(0x217)](_0x37f24b=>_0x37f24b[_0x450170(0x20c)]===_0x7276b8[_0x450170(0x20c)])):undefined,_0x1e39e1=buildMetadata(_0x3c3c80,_0x1c428f['scope']??'personal',_0x402dc8,contentHash(_0x3c3c80[_0x450170(0x203)]??''),_0x1c428f[_0x450170(0x1ec)],_0x433d86);writeJsonAtomic(resolve(_0x8a7f97,METADATA_FILE),_0x1e39e1);}export function deriveSkillCodeFromDirectory(_0x197716,_0x337ee9){const _0x4e32cd=a164_0x1be3,_0x9b126a=basename(resolve(_0x197716)),_0x5867d4=_0x337ee9+'--';return _0x9b126a[_0x4e32cd(0x1e7)](_0x5867d4)?_0x9b126a['slice'](_0x5867d4[_0x4e32cd(0x1f8)]):_0x9b126a;}function resolvePushSkillCode(_0x3d6e0f,_0x43edaa,_0x4470ed,_0x4a7ce2){const _0x1340f5=a164_0x1be3,_0x866e6d=deriveSkillCodeFromSkillFile(_0x3d6e0f)||deriveSkillCodeFromDirectory(_0x3d6e0f,_0x43edaa);if(_0x4a7ce2['ignoreMetadataSkillCode'])return _0x866e6d;return _0x4470ed?.[_0x1340f5(0x21b)]?.[_0x1340f5(0x21e)]()||_0x866e6d;}function deriveSkillCodeFromSkillFile(_0x45a7c3){const _0x4a01c8=a164_0x1be3,_0x4ba17b=resolve(_0x45a7c3,SKILL_FILE);if(!existsSync(_0x4ba17b)||!lstatSync(_0x4ba17b)[_0x4a01c8(0x210)]())return undefined;const _0x35f311=readFileSync(_0x4ba17b,_0x4a01c8(0x1eb)),_0x2b75b2=_0x35f311[_0x4a01c8(0x1ff)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x2b75b2)return undefined;const _0x4041f0=parseFrontmatterObject(_0x2b75b2[0x1]??''),_0x372496=scalarToString(_0x4041f0?.['name']);return _0x372496?slugifySkillName(_0x372496):undefined;}function readSkillDisplayName(_0x56d21f){const _0x2e5436=a164_0x1be3,_0x263566=_0x56d21f[_0x2e5436(0x1ff)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x263566)return undefined;const _0x2454e1=parseFrontmatterObject(_0x263566[0x1]??'');return scalarToString(_0x2454e1?.[_0x2e5436(0x212)]);}function slugifySkillName(_0x56804a){const _0x46fee1=a164_0x1be3,_0x4fea69=_0x56804a['trim']()[_0x46fee1(0x1f2)]()[_0x46fee1(0x1fa)](/[^\p{L}\p{N}\p{So}]+/gu,'-')[_0x46fee1(0x1fa)](/^-+/,'')['replace'](/-+$/,'')[_0x46fee1(0x1fa)](/-{2,}/g,'-');if(!_0x4fea69)throw CliErrors[_0x46fee1(0x1e9)]('Invalid\x20'+SKILL_FILE+_0x46fee1(0x1ed));return _0x4fea69;}function parseFrontmatterObject(_0x23c95a){const _0x2d45df=a164_0x1be3;try{const _0x273d15=a164_0x3c4cf8(_0x23c95a);return _0x273d15&&typeof _0x273d15===_0x2d45df(0x214)&&!Array[_0x2d45df(0x208)](_0x273d15)?_0x273d15:undefined;}catch{return undefined;}}function scalarToString(_0x302b9e){const _0x383321=a164_0x1be3;if(typeof _0x302b9e==='string')return _0x302b9e[_0x383321(0x21e)]();if(typeof _0x302b9e===_0x383321(0x20e)||typeof _0x302b9e==='boolean')return String(_0x302b9e);return undefined;}function resolvePushDirectoryRoot(_0x3e78b0){const _0x1324af=a164_0x1be3,_0x583e36=resolve(_0x3e78b0);if(!existsSync(_0x583e36))throw CliErrors[_0x1324af(0x1e9)](_0x1324af(0x1ea)+_0x3e78b0);const _0x86622c=lstatSync(_0x583e36);if(_0x86622c[_0x1324af(0x201)]())return _0x583e36;if(_0x86622c['isSymbolicLink']()){const _0x2121ef=realpathSync(_0x583e36);if(lstatSync(_0x2121ef)[_0x1324af(0x201)]())return _0x2121ef;}throw CliErrors['validation'](_0x1324af(0x1ea)+_0x3e78b0);}function requireRemoteScope(_0xdf3152){const _0x11b28e=a164_0x1be3;if(_0xdf3152['scope']===_0x11b28e(0x202)||_0xdf3152[_0x11b28e(0x1f4)]===_0x11b28e(0x207)||_0xdf3152['scope']===_0x11b28e(0x1f6))return _0xdf3152['scope'];throw CliErrors[_0x11b28e(0x1e9)](_0x11b28e(0x21f)+(_0xdf3152[_0x11b28e(0x21b)]||'(unknown)')+_0x11b28e(0x1f3)+(_0xdf3152['scope']??'unknown')+'\x22.');}function readLocalSkillContent(_0x461882){const _0x539b13=a164_0x1be3,_0x7d1e55=resolve(_0x461882,SKILL_FILE);return existsSync(_0x7d1e55)&&lstatSync(_0x7d1e55)[_0x539b13(0x210)]()?readFileSync(_0x7d1e55,_0x539b13(0x1eb)):'';}function a164_0x1be3(_0x44dc17,_0x154cb9){_0x44dc17=_0x44dc17-0x1e1;const _0x139c7a=a164_0x139c();let _0x1be3b9=_0x139c7a[_0x44dc17];return _0x1be3b9;}function readPushMetadataIfPresent(_0xb14c55,_0x2b261e={}){const _0x3ad022=a164_0x1be3;try{return readMetadataIfPresent(_0xb14c55);}catch(_0x32ec4a){if(_0x2b261e[_0x3ad022(0x205)])return undefined;throw _0x32ec4a;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a165_0x35f2(_0xc3dca5,_0x186674){_0xc3dca5=_0xc3dca5-0x6e;const _0x5e76ab=a165_0x5e76();let _0x35f225=_0x5e76ab[_0xc3dca5];return _0x35f225;}(function(_0x27cf9b,_0x267576){const _0x3d6d7d=a165_0x35f2,_0x5268a1=_0x27cf9b();while(!![]){try{const _0x47288f=-parseInt(_0x3d6d7d(0x71))/0x1*(-parseInt(_0x3d6d7d(0x74))/0x2)+-parseInt(_0x3d6d7d(0x7a))/0x3+parseInt(_0x3d6d7d(0x70))/0x4+parseInt(_0x3d6d7d(0x6e))/0x5*(-parseInt(_0x3d6d7d(0x75))/0x6)+parseInt(_0x3d6d7d(0x76))/0x7*(parseInt(_0x3d6d7d(0x79))/0x8)+parseInt(_0x3d6d7d(0x72))/0x9+-parseInt(_0x3d6d7d(0x77))/0xa;if(_0x47288f===_0x267576)break;else _0x5268a1['push'](_0x5268a1['shift']());}catch(_0x4a5ce6){_0x5268a1['push'](_0x5268a1['shift']());}}}(a165_0x5e76,0x9cb78));import{CliErrors}from'../../errors.js';export function normalizeRuntimeSkillScopes(_0x55bcda){const _0x2a4697=a165_0x35f2,_0x15e0e0=_0x55bcda&&_0x55bcda['length']>0x0?_0x55bcda:[_0x2a4697(0x73),'company',_0x2a4697(0x7b)],_0x119a8e=[];for(const _0x45f8c2 of _0x15e0e0){if(!isRuntimeSkillScope(_0x45f8c2))throw CliErrors[_0x2a4697(0x78)](_0x2a4697(0x6f)+_0x45f8c2);!_0x119a8e['includes'](_0x45f8c2)&&_0x119a8e['push'](_0x45f8c2);}return _0x119a8e;}function a165_0x5e76(){const _0x181a33=['builtin','company','55595rhsGwF','Unsupported\x20runtime\x20Skill\x20scope:\x20','4162960guTUoe','10OPOvLv','5415381TLucYE','personal','159032RrTSHG','222TqUoiu','5254039qqLUKG','14710770rpGqjp','validation','8onvElW','1991382CuhrsP'];a165_0x5e76=function(){return _0x181a33;};return a165_0x5e76();}export function isRuntimeSkillScope(_0x2ed474){const _0x586937=a165_0x35f2;return _0x2ed474==='personal'||_0x2ed474===_0x586937(0x7c)||_0x2ed474===_0x586937(0x7b);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a167_0x2d26(_0x54271d,_0x305889){_0x54271d=_0x54271d-0x109;const _0x4861b7=a167_0x4861();let _0x2d2670=_0x4861b7[_0x54271d];return _0x2d2670;}const a167_0x371736=a167_0x2d26;(function(_0x384039,_0x540423){const _0x5e684b=a167_0x2d26,_0x3df9b5=_0x384039();while(!![]){try{const _0x4287fc=parseInt(_0x5e684b(0x10d))/0x1+-parseInt(_0x5e684b(0x118))/0x2*(parseInt(_0x5e684b(0x109))/0x3)+parseInt(_0x5e684b(0x11b))/0x4+-parseInt(_0x5e684b(0x112))/0x5*(parseInt(_0x5e684b(0x110))/0x6)+-parseInt(_0x5e684b(0x10b))/0x7*(parseInt(_0x5e684b(0x10f))/0x8)+parseInt(_0x5e684b(0x113))/0x9*(parseInt(_0x5e684b(0x11a))/0xa)+parseInt(_0x5e684b(0x11c))/0xb;if(_0x4287fc===_0x540423)break;else _0x3df9b5['push'](_0x3df9b5['shift']());}catch(_0x3f571e){_0x3df9b5['push'](_0x3df9b5['shift']());}}}(a167_0x4861,0x779a3));import{unzipSync,zipSync}from'fflate';import{CliErrors}from'../../errors.js';import{compareSkillFiles,fileContent,normalizeLocalFiles,normalizeSkillRelativePath}from'./local-files.js';const ZIP_MTIME=new Date(a167_0x371736(0x11e));function a167_0x4861(){const _0x30a835=['288510AXeFDI','Runtime\x20Skill\x20package\x20contains\x20directory\x20entry:\x20','15LvRiFF','9DPONqb','entries','sort','validation','validation_error','4DRBkmy','path','1783930TfDuNX','184068KRcrmx','6596403MZqBIA','object','1980-01-01T00:00:00.000Z','length','code','from','Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.','544731SDgVlK','name','7MnKqdz','endsWith','231513ZAgLsf','map','466368SFEKcK'];a167_0x4861=function(){return _0x30a835;};return a167_0x4861();}export function createDeterministicZipPackage(_0x283349){const _0x3759a9=a167_0x371736,_0x3ab20e={};for(const _0x50a346 of normalizeLocalFiles(_0x283349)){_0x3ab20e[_0x50a346[_0x3759a9(0x119)]]=fileContent(_0x50a346);}return Buffer[_0x3759a9(0x121)](zipSync(_0x3ab20e,{'level':0x0,'mtime':ZIP_MTIME}));}export function parseZipPackage(_0x577958){const _0x57dfdb=a167_0x371736;if(_0x577958[_0x57dfdb(0x11f)]<0x16)throw CliErrors[_0x57dfdb(0x116)](_0x57dfdb(0x122));let _0x380dc1;try{_0x380dc1=unzipSync(_0x577958,{'filter'(_0x4056cb){const _0x50dadc=_0x57dfdb,_0x2a23bd=normalizeSkillRelativePath(_0x4056cb[_0x50dadc(0x10a)]);if(_0x2a23bd[_0x50dadc(0x10c)]('/'))throw CliErrors[_0x50dadc(0x116)](_0x50dadc(0x111)+_0x2a23bd);return!![];}});}catch(_0x408aa1){if(isRuntimeSkillValidationError(_0x408aa1))throw _0x408aa1;throw CliErrors['validation'](_0x57dfdb(0x122));}return Object[_0x57dfdb(0x114)](_0x380dc1)[_0x57dfdb(0x10e)](([_0x1dff1c,_0x41c694])=>({'path':normalizeSkillRelativePath(_0x1dff1c),'bytes':Buffer[_0x57dfdb(0x121)](_0x41c694)}))[_0x57dfdb(0x115)](compareSkillFiles);}function isRuntimeSkillValidationError(_0x5e8740){const _0x80a7ed=a167_0x371736;return typeof _0x5e8740===_0x80a7ed(0x11d)&&_0x5e8740!==null&&_0x80a7ed(0x120)in _0x5e8740&&_0x5e8740['code']===_0x80a7ed(0x117);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xb26eb,_0x118876){const _0x25d219=a168_0x5dac,_0x38e8a8=_0xb26eb();while(!![]){try{const _0x3a2770=parseInt(_0x25d219(0x16a))/0x1*(parseInt(_0x25d219(0x170))/0x2)+-parseInt(_0x25d219(0x173))/0x3*(parseInt(_0x25d219(0x166))/0x4)+-parseInt(_0x25d219(0x177))/0x5*(-parseInt(_0x25d219(0x15f))/0x6)+parseInt(_0x25d219(0x159))/0x7*(-parseInt(_0x25d219(0x172))/0x8)+-parseInt(_0x25d219(0x151))/0x9+parseInt(_0x25d219(0x14e))/0xa*(parseInt(_0x25d219(0x16e))/0xb)+parseInt(_0x25d219(0x164))/0xc;if(_0x3a2770===_0x118876)break;else _0x38e8a8['push'](_0x38e8a8['shift']());}catch(_0x20790f){_0x38e8a8['push'](_0x38e8a8['shift']());}}}(a168_0x1347,0xc0220));function a168_0x1347(){const _0x12c260=['2599421smSXtD','isArray','4398jrukWO','treeSha256','5584744yYPzMp','3hIEVHW','Runtime\x20Skill\x20package\x20size\x20mismatch.','push','size','320RVhBrQ','Runtime\x20Skill\x20package\x20is\x20missing\x20entry:\x20','Runtime\x20Skill\x20package\x20size\x20is\x20invalid.','zipSha256','sha256','toLowerCase','20xZryma','length','Runtime\x20Skill\x20package\x20is\x20missing\x20','6148737bmlJZh','trim','Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.','Runtime\x20Skill\x20package\x20sha256\x20mismatch.','toString','Runtime\x20Skill\x20file\x20tree\x20sha256\x20is\x20invalid.','validation','string','7yxcGbr','bytes','files','\x20in\x20Skill\x20file\x20package.','Runtime\x20Skill\x20file\x20tree\x20sha256\x20mismatch.','Runtime\x20Skill\x20package\x20is\x20required\x20for\x20Skill\x20install:\x20','74706ePSjTb','Runtime\x20Skill\x20package\x20file\x20size\x20mismatch:\x20','some','schemaVersion','Duplicate\x20Skill\x20package\x20entry:\x20','20885676GaisFh','path','3657056QtTCuM','has','Runtime\x20Skill\x20package\x20entry\x20list\x20mismatch.','map','33xaKdqh','object','zipSize','Runtime\x20Skill\x20package\x20sha256\x20is\x20invalid.'];a168_0x1347=function(){return _0x12c260;};return a168_0x1347();}import{CliErrors}from'../../errors.js';import{SKILL_FILE}from'./constants.js';import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';import{fileContent,isSha256Hex,normalizeLocalFiles,normalizeManifestFiles}from'./local-files.js';import{createDeterministicZipPackage,parseZipPackage}from'./zip-codec.js';export function buildSkillPackage(_0x1a3e61){const _0x564f75=a168_0x5dac,_0x2c37dd=normalizeLocalFiles(_0x1a3e61);if(!_0x2c37dd[_0x564f75(0x161)](_0x59a3e2=>_0x59a3e2[_0x564f75(0x165)]===SKILL_FILE))throw CliErrors[_0x564f75(0x157)]('Missing\x20'+SKILL_FILE+_0x564f75(0x15c));const _0x198e9b=localFilesToManifestFiles(_0x2c37dd),_0x31a235=createDeterministicZipPackage(_0x2c37dd);return{'manifest':{'schemaVersion':0x2,'treeSha256':fileTreeHash(_0x198e9b),'zipSha256':bufferSha256(_0x31a235),'zipSize':_0x31a235[_0x564f75(0x14f)],'files':_0x198e9b},'packageBytes':_0x31a235,'packageBase64':_0x31a235[_0x564f75(0x155)]('base64')};}function a168_0x5dac(_0x2b9bdc,_0x104bf0){_0x2b9bdc=_0x2b9bdc-0x14a;const _0x134706=a168_0x1347();let _0x5dac6d=_0x134706[_0x2b9bdc];return _0x5dac6d;}export function verifyRuntimeSkillPackage(_0x507d09,_0x3759d7){const _0x836aa4=a168_0x5dac,_0x239794=normalizePackageManifest(_0x507d09,{'requireOssPath':![]});if(!_0x239794)throw CliErrors[_0x836aa4(0x157)](_0x836aa4(0x153));return extractAndVerifyPackage(_0x239794,_0x3759d7);}export function verifyRuntimeSkillBundle(_0x5d97d1,_0x56fca5){const _0x53b212=a168_0x5dac,_0x4892c9=normalizePackageManifest(_0x5d97d1,{'requireOssPath':![]});if(!_0x4892c9)throw CliErrors['validation'](_0x53b212(0x153));return extractAndVerifyPackageFiles(_0x4892c9,_0x56fca5);}export function tryNormalizePackageManifest(_0x323deb){return normalizePackageManifest(_0x323deb,{'requireOssPath':![]});}export function requirePackageBytes(_0xbfcc00,_0x4b95fd){const _0x4f62cc=a168_0x5dac;if(!_0x4b95fd||_0x4b95fd[_0x4f62cc(0x14f)]===0x0)throw CliErrors[_0x4f62cc(0x157)](_0x4f62cc(0x15e)+_0xbfcc00);return _0x4b95fd;}export function extractDownloadedPackage(_0x15f5d8){const _0x546516=a168_0x5dac,_0x5b97b2=parseZipPackage(_0x15f5d8)[_0x546516(0x169)](_0x217c36=>({'path':_0x217c36[_0x546516(0x165)],'bytes':_0x217c36[_0x546516(0x15a)]}));if(!_0x5b97b2['some'](_0x4fae07=>_0x4fae07[_0x546516(0x165)]===SKILL_FILE))throw CliErrors[_0x546516(0x157)](_0x546516(0x150)+SKILL_FILE+'.');return normalizeLocalFiles(_0x5b97b2);}export function localFilesToManifestFiles(_0x4b9887){const _0x5029a9=a168_0x5dac;return normalizeLocalFiles(_0x4b9887)[_0x5029a9(0x169)](_0x4f5005=>({'path':_0x4f5005['path'],'sha256':fileHash(_0x4f5005),'size':fileContent(_0x4f5005)[_0x5029a9(0x14f)]}));}function normalizePackageManifest(_0x5c128d,_0x4e1200){const _0x10b16a=a168_0x5dac;if(!_0x5c128d||typeof _0x5c128d!==_0x10b16a(0x16b)||Array['isArray'](_0x5c128d))return undefined;const _0x532e7f=_0x5c128d,_0x5cdccb=typeof _0x532e7f['ossPath']===_0x10b16a(0x158)?_0x532e7f['ossPath'][_0x10b16a(0x152)]():undefined;if(_0x4e1200['requireOssPath']&&!_0x5cdccb)return undefined;if(!Array[_0x10b16a(0x16f)](_0x532e7f[_0x10b16a(0x15b)])||_0x532e7f[_0x10b16a(0x15b)][_0x10b16a(0x14f)]===0x0)return undefined;if(!isSha256Hex(_0x532e7f[_0x10b16a(0x171)]))throw CliErrors['validation'](_0x10b16a(0x156));if(!isSha256Hex(_0x532e7f[_0x10b16a(0x14b)]))throw CliErrors[_0x10b16a(0x157)](_0x10b16a(0x16d));if(!Number['isSafeInteger'](_0x532e7f[_0x10b16a(0x16c)])||_0x532e7f[_0x10b16a(0x16c)]<0x0)throw CliErrors[_0x10b16a(0x157)](_0x10b16a(0x14a));const _0x3886a6=normalizeManifestFiles(_0x532e7f[_0x10b16a(0x15b)]);if(!_0x3886a6[_0x10b16a(0x161)](_0x4dd801=>_0x4dd801[_0x10b16a(0x165)]===SKILL_FILE))throw CliErrors[_0x10b16a(0x157)]('Runtime\x20Skill\x20manifest\x20is\x20missing\x20'+SKILL_FILE+'.');const _0xbaf5=fileTreeHash(_0x3886a6);if(_0xbaf5!==_0x532e7f[_0x10b16a(0x171)][_0x10b16a(0x14d)]())throw CliErrors[_0x10b16a(0x157)](_0x10b16a(0x15d));return{'schemaVersion':Number['isSafeInteger'](_0x532e7f[_0x10b16a(0x162)])?_0x532e7f['schemaVersion']:0x2,'ossPath':_0x5cdccb,'treeSha256':_0xbaf5,'zipSha256':_0x532e7f[_0x10b16a(0x14b)][_0x10b16a(0x14d)](),'zipSize':_0x532e7f[_0x10b16a(0x16c)],'files':_0x3886a6};}function extractAndVerifyPackage(_0x39a6a9,_0x29c44a){const _0x1e3888=a168_0x5dac,_0x3bbccd=normalizePackageManifest(_0x39a6a9,{'requireOssPath':![]});if(!_0x3bbccd)throw CliErrors[_0x1e3888(0x157)](_0x1e3888(0x153));if(_0x29c44a['length']!==_0x3bbccd[_0x1e3888(0x16c)])throw CliErrors['validation'](_0x1e3888(0x174));const _0x633b3f=bufferSha256(_0x29c44a);if(_0x633b3f!==_0x3bbccd[_0x1e3888(0x14b)])throw CliErrors[_0x1e3888(0x157)](_0x1e3888(0x154));return extractAndVerifyPackageFiles(_0x3bbccd,_0x29c44a);}function extractAndVerifyPackageFiles(_0x409e9a,_0xf56e60){const _0x456bc7=a168_0x5dac,_0x734fee=parseZipPackage(_0xf56e60);if(_0x734fee[_0x456bc7(0x14f)]!==_0x409e9a[_0x456bc7(0x15b)][_0x456bc7(0x14f)])throw CliErrors[_0x456bc7(0x157)](_0x456bc7(0x168));const _0x2d8525=new Map();for(const _0x3c7566 of _0x734fee){if(_0x2d8525[_0x456bc7(0x167)](_0x3c7566[_0x456bc7(0x165)]))throw CliErrors[_0x456bc7(0x157)](_0x456bc7(0x163)+_0x3c7566[_0x456bc7(0x165)]);_0x2d8525['set'](_0x3c7566[_0x456bc7(0x165)],_0x3c7566);}const _0x2b499f=[];for(const _0x3c37e9 of _0x409e9a[_0x456bc7(0x15b)]){const _0x4ef1dd=_0x2d8525['get'](_0x3c37e9[_0x456bc7(0x165)]);if(!_0x4ef1dd)throw CliErrors[_0x456bc7(0x157)](_0x456bc7(0x178)+_0x3c37e9[_0x456bc7(0x165)]);if(_0x4ef1dd['bytes'][_0x456bc7(0x14f)]!==_0x3c37e9[_0x456bc7(0x176)])throw CliErrors[_0x456bc7(0x157)](_0x456bc7(0x160)+_0x3c37e9[_0x456bc7(0x165)]);const _0x978cf1=bufferSha256(_0x4ef1dd[_0x456bc7(0x15a)]);if(_0x978cf1!==_0x3c37e9[_0x456bc7(0x14c)])throw CliErrors[_0x456bc7(0x157)]('Runtime\x20Skill\x20package\x20file\x20sha256\x20mismatch:\x20'+_0x3c37e9[_0x456bc7(0x165)]);_0x2b499f[_0x456bc7(0x175)]({'path':_0x3c37e9[_0x456bc7(0x165)],'bytes':_0x4ef1dd['bytes']});}return normalizeLocalFiles(_0x2b499f);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x481890,_0x3c8ae4){var _0x562e89=a169_0x515d,_0x5a13b1=_0x481890();while(!![]){try{var _0x2ef4fc=-parseInt(_0x562e89(0x71))/0x1+-parseInt(_0x562e89(0x69))/0x2+parseInt(_0x562e89(0x6c))/0x3*(-parseInt(_0x562e89(0x6d))/0x4)+parseInt(_0x562e89(0x68))/0x5*(-parseInt(_0x562e89(0x6f))/0x6)+-parseInt(_0x562e89(0x6e))/0x7*(parseInt(_0x562e89(0x6b))/0x8)+-parseInt(_0x562e89(0x6a))/0x9+parseInt(_0x562e89(0x70))/0xa;if(_0x2ef4fc===_0x3c8ae4)break;else _0x5a13b1['push'](_0x5a13b1['shift']());}catch(_0x29f213){_0x5a13b1['push'](_0x5a13b1['shift']());}}}(a169_0x4937,0xce6a6));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';function a169_0x515d(_0x189f52,_0x652d16){_0x189f52=_0x189f52-0x68;var _0x493762=a169_0x4937();var _0x515d45=_0x493762[_0x189f52];return _0x515d45;}function a169_0x4937(){var _0x374adf=['1266045ChTUyu','5WZcRVT','2017852uYdJiN','3275757bUqpUY','24QeOjhL','3QveQcL','5726500uKfzyh','2026682oDlKCx','6335358QkRrTC','68405180vCodBc'];a169_0x4937=function(){return _0x374adf;};return a169_0x4937();}export{listLocalRuntimeSkills}from'./runtime-skill-sync/list-local.js';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 a170_0x47c8a4=a170_0x1632;(function(_0x508578,_0x57fbf5){const _0x53e696=a170_0x1632,_0xff3fb=_0x508578();while(!![]){try{const _0x136f14=-parseInt(_0x53e696(0x120))/0x1*(parseInt(_0x53e696(0x11e))/0x2)+-parseInt(_0x53e696(0x115))/0x3+parseInt(_0x53e696(0x116))/0x4+parseInt(_0x53e696(0x10d))/0x5+parseInt(_0x53e696(0x11b))/0x6*(parseInt(_0x53e696(0x12a))/0x7)+-parseInt(_0x53e696(0x118))/0x8*(parseInt(_0x53e696(0x126))/0x9)+-parseInt(_0x53e696(0x117))/0xa;if(_0x136f14===_0x57fbf5)break;else _0xff3fb['push'](_0xff3fb['shift']());}catch(_0x1a1978){_0xff3fb['push'](_0xff3fb['shift']());}}}(a170_0x18af,0xa5e89));import{existsSync,readFileSync}from'node:fs';import{homedir}from'node:os';import{join}from'node:path';export const SKILL_LOCK_RELATIVE_PATH=join('.agents','.skill-lock.json');function a170_0x1632(_0x56487b,_0x57120a){_0x56487b=_0x56487b-0x10c;const _0x18affe=a170_0x18af();let _0x163235=_0x18affe[_0x56487b];return _0x163235;}export const GLOBAL_SKILLS_DIR_RELATIVE_PATHS=[join(a170_0x47c8a4(0x127),a170_0x47c8a4(0x11a)),join(a170_0x47c8a4(0x129),a170_0x47c8a4(0x11a))];const SUPPORTED_LOCK_VERSIONS=[0x3];function a170_0x18af(){const _0x3348a8=['SKILL.md','unverifiable','map','6759490IuPBzE','\x20is\x20unreadable:\x20','version','home','not-recorded','unusable','join','object','1838640tBDjIi','2029744ZYiKBr','1928040vnNnnM','8392OyXUWb','\x20records\x20\x22','skills','2379498MpucOv','globalSkillsDirs','\x20uses\x20unsupported\x20version\x20','658tWDgKP','kind','981EJTaqw','\x22\x20but\x20no\x20SKILL.md\x20was\x20found\x20in\x20known\x20layouts\x20','number','reason','recorded','parse','3843fuedns','.agents','present','.claude','7JeEyBQ','absent'];a170_0x18af=function(){return _0x3348a8;};return a170_0x18af();}function readLockLookup(_0x4ef440,_0x535382){const _0x461765=a170_0x47c8a4;if(!existsSync(_0x4ef440))return{'kind':'not-recorded'};let _0x37d83a;try{_0x37d83a=JSON[_0x461765(0x125)](readFileSync(_0x4ef440,'utf8'));}catch(_0x3d0974){return{'kind':_0x461765(0x112),'reason':_0x4ef440+_0x461765(0x10e)+_0x3d0974['message']};}const _0x5de2e1=_0x37d83a;if(typeof _0x5de2e1?.[_0x461765(0x10f)]!==_0x461765(0x122)||!SUPPORTED_LOCK_VERSIONS['includes'](_0x5de2e1[_0x461765(0x10f)]))return{'kind':'unusable','reason':_0x4ef440+_0x461765(0x11d)+String(_0x5de2e1?.[_0x461765(0x10f)])};if(!_0x5de2e1[_0x461765(0x11a)]||typeof _0x5de2e1[_0x461765(0x11a)]!==_0x461765(0x114))return{'kind':'unusable','reason':_0x4ef440+'\x20has\x20no\x20skills\x20map'};return _0x5de2e1[_0x461765(0x11a)][_0x535382]?{'kind':_0x461765(0x124)}:{'kind':_0x461765(0x111)};}export function resolveInstalledSkill(_0x48bf8c,_0xbae63d){const _0x538409=a170_0x47c8a4,_0x15fb94=_0xbae63d?.[_0x538409(0x110)]??homedir(),_0x518c94=_0xbae63d?.[_0x538409(0x11c)]??GLOBAL_SKILLS_DIR_RELATIVE_PATHS['map'](_0x32e311=>join(_0x15fb94,_0x32e311)),_0x5aa131=_0xbae63d?.['lockFile']??join(_0x15fb94,SKILL_LOCK_RELATIVE_PATH),_0x2ee356=_0x518c94[_0x538409(0x10c)](_0x333ede=>join(_0x333ede,_0x48bf8c,_0x538409(0x12c))),_0x4a6d4f=_0x2ee356['find'](_0xb7473e=>existsSync(_0xb7473e));if(_0x4a6d4f)return{'state':_0x538409(0x128),'path':_0x4a6d4f};const _0x49f329=readLockLookup(_0x5aa131,_0x48bf8c);if(_0x49f329[_0x538409(0x11f)]===_0x538409(0x112))return{'state':'unverifiable','reason':_0x49f329[_0x538409(0x123)]};if(_0x49f329[_0x538409(0x11f)]===_0x538409(0x124))return{'state':_0x538409(0x12d),'reason':_0x5aa131+_0x538409(0x119)+_0x48bf8c+_0x538409(0x121)+('('+_0x2ee356[_0x538409(0x113)](',\x20')+')')};return{'state':_0x538409(0x12b),'checked':_0x2ee356};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x15d315,_0x54d372){const _0x47faff=a171_0x203f,_0x2c162a=_0x15d315();while(!![]){try{const _0x472e8e=parseInt(_0x47faff(0x14c))/0x1*(parseInt(_0x47faff(0x150))/0x2)+-parseInt(_0x47faff(0x155))/0x3*(-parseInt(_0x47faff(0x153))/0x4)+-parseInt(_0x47faff(0x14d))/0x5+-parseInt(_0x47faff(0x146))/0x6*(parseInt(_0x47faff(0x152))/0x7)+-parseInt(_0x47faff(0x14b))/0x8+parseInt(_0x47faff(0x148))/0x9*(parseInt(_0x47faff(0x159))/0xa)+-parseInt(_0x47faff(0x151))/0xb*(-parseInt(_0x47faff(0x157))/0xc);if(_0x472e8e===_0x54d372)break;else _0x2c162a['push'](_0x2c162a['shift']());}catch(_0x2dd5b1){_0x2c162a['push'](_0x2c162a['shift']());}}}(a171_0x2e6a,0x7a4dc));const REDACTED_ACCESS_KEY='<redacted>';function a171_0x2e6a(){const _0x48f86d=['accessKey','859398KPaANu','string','36GXuxUV','apps','20JRzmgx','call','fromEntries','1929414GhxpaC','entries','3076263kvUALY','object','isArray','7552168uqgwEG','5501AuuOIo','3397165dkMDxg','length','hasOwnProperty','94BPCsPT','4463624PIAAhB','7iTQBHp','4JERvdq'];a171_0x2e6a=function(){return _0x48f86d;};return a171_0x2e6a();}function a171_0x203f(_0x247252,_0x4bb982){_0x247252=_0x247252-0x144;const _0x2e6ae0=a171_0x2e6a();let _0x203fee=_0x2e6ae0[_0x247252];return _0x203fee;}export function maskCliAccessKey(_0x39640a){const _0x5d0e47=a171_0x203f;if(typeof _0x39640a!==_0x5d0e47(0x156)||_0x39640a[_0x5d0e47(0x14e)]<=0x8)return REDACTED_ACCESS_KEY;return''+_0x39640a['slice'](0x0,0x8)+'*'['repeat'](_0x39640a[_0x5d0e47(0x14e)]-0x8);}export function redactCliConfigCredentials(_0x306784){const _0x374da3=a171_0x203f,_0x38292a={..._0x306784};return Object['prototype'][_0x374da3(0x14f)][_0x374da3(0x144)](_0x38292a,_0x374da3(0x154))&&(_0x38292a[_0x374da3(0x154)]=maskCliAccessKey(_0x38292a[_0x374da3(0x154)])),_0x38292a[_0x374da3(0x158)]&&typeof _0x38292a[_0x374da3(0x158)]===_0x374da3(0x149)&&!Array[_0x374da3(0x14a)](_0x38292a[_0x374da3(0x158)])&&(_0x38292a[_0x374da3(0x158)]=redactLegacyAppCredentials(_0x38292a[_0x374da3(0x158)])),_0x38292a;}export function redactCliConfigValue(_0x1aeed3,_0x43f01c){const _0x175294=a171_0x203f;if(_0x1aeed3==='accessKey'||/^apps\.[^.]+\.accessKey$/['test'](_0x1aeed3))return maskCliAccessKey(_0x43f01c);if(_0x1aeed3==='apps'&&_0x43f01c&&typeof _0x43f01c==='object'&&!Array[_0x175294(0x14a)](_0x43f01c))return redactLegacyAppCredentials(_0x43f01c);if(/^apps\.[^.]+$/['test'](_0x1aeed3)&&_0x43f01c&&typeof _0x43f01c==='object'&&!Array['isArray'](_0x43f01c)){const _0x3fbdc0=_0x43f01c;return Object['prototype'][_0x175294(0x14f)][_0x175294(0x144)](_0x3fbdc0,'accessKey')?{..._0x3fbdc0,'accessKey':maskCliAccessKey(_0x3fbdc0[_0x175294(0x154)])}:_0x43f01c;}return _0x43f01c;}function redactLegacyAppCredentials(_0x13e0a3){const _0x3d5ca2=a171_0x203f;return Object[_0x3d5ca2(0x145)](Object[_0x3d5ca2(0x147)](_0x13e0a3)['map'](([_0x2373fb,_0x404793])=>{const _0x2a29bd=_0x3d5ca2;if(!_0x404793||typeof _0x404793!==_0x2a29bd(0x149)||Array[_0x2a29bd(0x14a)](_0x404793))return[_0x2373fb,_0x404793];const _0x1b57ee={..._0x404793};return Object['prototype']['hasOwnProperty'][_0x2a29bd(0x144)](_0x1b57ee,_0x2a29bd(0x154))&&(_0x1b57ee['accessKey']=maskCliAccessKey(_0x1b57ee['accessKey'])),[_0x2373fb,_0x1b57ee];}));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3e40b1,_0x3c3109){const _0x102de0=a172_0x10ff,_0x529e8c=_0x3e40b1();while(!![]){try{const _0x58e4e1=parseInt(_0x102de0(0x11d))/0x1*(-parseInt(_0x102de0(0x122))/0x2)+-parseInt(_0x102de0(0x120))/0x3+parseInt(_0x102de0(0x121))/0x4+parseInt(_0x102de0(0x11f))/0x5+-parseInt(_0x102de0(0x124))/0x6*(-parseInt(_0x102de0(0x11e))/0x7)+parseInt(_0x102de0(0x123))/0x8*(-parseInt(_0x102de0(0x11c))/0x9)+parseInt(_0x102de0(0x125))/0xa;if(_0x58e4e1===_0x3c3109)break;else _0x529e8c['push'](_0x529e8c['shift']());}catch(_0x11dd2b){_0x529e8c['push'](_0x529e8c['shift']());}}}(a172_0x1099,0x249f5));import{createJqFilter,resolveBundledJqPaths}from'@lovrabet/cli-framework';import{CliErrors}from'../errors.js';function a172_0x10ff(_0x56ccf5,_0x4b4fd6){_0x56ccf5=_0x56ccf5-0x11c;const _0x109992=a172_0x1099();let _0x10ff1e=_0x109992[_0x56ccf5];return _0x10ff1e;}function a172_0x1099(){const _0xa63d6a=['717295Hdcdfp','762906uzZZKr','330204irqlAN','2cGWWRA','29568PFWcai','489342HtBayT','1214620MjOJTH','18xjJYWY','17330sUkOOX','7GLQqDj'];a172_0x1099=function(){return _0xa63d6a;};return a172_0x1099();}export const applyJqFilter=createJqFilter(CliErrors,{'bundledJqPaths':resolveBundledJqPaths()});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2ae938,_0xadc74c){const _0x4c7c09=a173_0x5217,_0x51fad1=_0x2ae938();while(!![]){try{const _0x1b13f7=-parseInt(_0x4c7c09(0x15f))/0x1+-parseInt(_0x4c7c09(0x168))/0x2*(parseInt(_0x4c7c09(0x167))/0x3)+parseInt(_0x4c7c09(0x15b))/0x4*(-parseInt(_0x4c7c09(0x162))/0x5)+parseInt(_0x4c7c09(0x170))/0x6*(parseInt(_0x4c7c09(0x163))/0x7)+parseInt(_0x4c7c09(0x161))/0x8+-parseInt(_0x4c7c09(0x157))/0x9*(parseInt(_0x4c7c09(0x16b))/0xa)+parseInt(_0x4c7c09(0x160))/0xb;if(_0x1b13f7===_0xadc74c)break;else _0x51fad1['push'](_0x51fad1['shift']());}catch(_0xbfe714){_0x51fad1['push'](_0x51fad1['shift']());}}}(a173_0x306c,0x25d71));import a173_0x151f90 from'semver';function a173_0x306c(){const _0x6dfdc3=['join','upgradeMessage','31074jKwIzo','2762082ukMsOz','currentVersion','Current\x20CLI\x20version\x20is\x20below\x20the\x20minimum\x20supported\x20version.','Current\x20version:\x20','1708AiURoZ','minimumVersion','stableVersion','npm\x20install\x20-g\x20','287582dzmzPV','8056576XyAhxT','2401920xgilxH','3365FhDBxn','273UmOyQz','Upgrade\x20command:\x20','filter','minimumVersionMessage','65931QtOLCE','18TquIps','Recommended\x20stable:\x20','latest','10TspcwF','validation','unavailable'];a173_0x306c=function(){return _0x6dfdc3;};return a173_0x306c();}import{LOVRABET_NPM_PACKAGE_NAME}from'../constant/distribution.js';function a173_0x5217(_0x497924,_0xc708e8){_0x497924=_0x497924-0x157;const _0x306c53=a173_0x306c();let _0x521738=_0x306c53[_0x497924];return _0x521738;}import{CliErrors}from'../errors.js';import{getCliVersionPolicy}from'../utils/cli-version-policy.js';import{getCliVersion}from'../utils/version.js';export function evaluateCliVersionPolicy(_0x3787d7,_0x564750){const _0x36ac11=a173_0x5217,_0x5b9d33=a173_0x151f90['valid'](_0x3787d7)===_0x3787d7,_0x273592=_0x564750?.['stableVersion']??null,_0x1da565=_0x564750?.[_0x36ac11(0x15c)]??null,_0xd27133=Boolean(_0x5b9d33&&_0x273592&&a173_0x151f90['lt'](_0x3787d7,_0x273592)),_0x3d0119=Boolean(_0x5b9d33&&_0x1da565&&a173_0x151f90['lt'](_0x3787d7,_0x1da565));return{'currentVersion':_0x3787d7,'stableVersion':_0x273592,'minimumVersion':_0x1da565,'needsUpgrade':_0xd27133||_0x3d0119,'belowMinimum':_0x3d0119,'upgradeMessage':_0x564750?.[_0x36ac11(0x16f)],'minimumVersionMessage':_0x564750?.[_0x36ac11(0x166)]};}export async function checkCliVersion(){return evaluateCliVersionPolicy(getCliVersion(),await getCliVersionPolicy());}export function getCliUpgradeCommand(_0x28e200){const _0x2b1ae9=a173_0x5217;return _0x2b1ae9(0x15e)+LOVRABET_NPM_PACKAGE_NAME+'@'+(_0x28e200[_0x2b1ae9(0x15d)]??_0x2b1ae9(0x16a));}export function assertCliVersionSupported(_0x4f5dc0){const _0x14c6ac=a173_0x5217;if(!_0x4f5dc0['belowMinimum'])return;const _0x39d37b=[_0x4f5dc0[_0x14c6ac(0x166)],_0x14c6ac(0x15a)+_0x4f5dc0[_0x14c6ac(0x158)],'Minimum\x20supported:\x20'+_0x4f5dc0[_0x14c6ac(0x15c)],_0x14c6ac(0x169)+(_0x4f5dc0[_0x14c6ac(0x15d)]??_0x14c6ac(0x16d)),_0x14c6ac(0x164)+getCliUpgradeCommand(_0x4f5dc0)][_0x14c6ac(0x165)](Boolean)[_0x14c6ac(0x16e)]('\x0a');throw CliErrors[_0x14c6ac(0x16c)](_0x14c6ac(0x159),_0x39d37b);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5752ae,_0x49215f){const _0x474199=a174_0x18d6,_0x5f462f=_0x5752ae();while(!![]){try{const _0x3990ba=-parseInt(_0x474199(0x1a4))/0x1+-parseInt(_0x474199(0x1a1))/0x2+parseInt(_0x474199(0x198))/0x3+-parseInt(_0x474199(0x1a2))/0x4+parseInt(_0x474199(0x1a0))/0x5*(-parseInt(_0x474199(0x197))/0x6)+parseInt(_0x474199(0x1a7))/0x7+parseInt(_0x474199(0x19e))/0x8;if(_0x3990ba===_0x49215f)break;else _0x5f462f['push'](_0x5f462f['shift']());}catch(_0x114f07){_0x5f462f['push'](_0x5f462f['shift']());}}}(a174_0x31d8,0x1d617));import a174_0x30294e from'semver';import{LOVRABET_CLI_VERSION_POLICY_URL}from'../constant/distribution.js';const SUCCESS_CACHE_TTL_MS=0x5*0x3c*0x3e8,FAILURE_CACHE_TTL_MS=0x3c*0x3e8,FETCH_TIMEOUT_MS=0x5dc;function pickString(_0xe68e30){const _0x129673=a174_0x18d6;return typeof _0xe68e30==='string'&&_0xe68e30['trim']()?_0xe68e30[_0x129673(0x1a6)]():null;}function a174_0x18d6(_0x48baae,_0x46d992){_0x48baae=_0x48baae-0x192;const _0x31d844=a174_0x31d8();let _0x18d6b8=_0x31d844[_0x48baae];return _0x18d6b8;}function pickStrictSemver(_0x378770){const _0xbe26b2=pickString(_0x378770);return _0xbe26b2&&a174_0x30294e['valid'](_0xbe26b2)===_0xbe26b2?_0xbe26b2:null;}function a174_0x31d8(){const _0x4ce2b1=['json','trim','117180nrNbbZ','minimumVersion','upgradeMessage','object','minimumVersionMessage','timeout','finally','minVersion','744LwGWPe','718998onGuSe','then','latestVersion','now','cli','stableVersion','2952856Jznngh','recommendedVersion','685sDgnRa','232684AZQHeU','792264jyuBWA','application/json','173774UiEilC'];a174_0x31d8=function(){return _0x4ce2b1;};return a174_0x31d8();}export function normalizeCliVersionPolicy(_0x52a236){const _0x48fd2e=a174_0x18d6;if(!_0x52a236||typeof _0x52a236!==_0x48fd2e(0x192))return null;const _0x4a297d=_0x52a236,_0xe4a9ff=_0x4a297d[_0x48fd2e(0x19c)]&&typeof _0x4a297d['cli']===_0x48fd2e(0x192)?_0x4a297d[_0x48fd2e(0x19c)]:_0x4a297d,_0xad610e=pickStrictSemver(_0xe4a9ff[_0x48fd2e(0x19d)]??_0xe4a9ff[_0x48fd2e(0x19a)]??_0xe4a9ff[_0x48fd2e(0x19f)]),_0x12c328=pickStrictSemver(_0xe4a9ff[_0x48fd2e(0x1a8)]??_0xe4a9ff[_0x48fd2e(0x196)]);if(!_0xad610e&&!_0x12c328)return null;if(_0xad610e&&_0x12c328&&a174_0x30294e['gt'](_0x12c328,_0xad610e))return null;return{'stableVersion':_0xad610e,'minimumVersion':_0x12c328,'upgradeMessage':pickString(_0xe4a9ff[_0x48fd2e(0x1a9)])??undefined,'minimumVersionMessage':pickString(_0xe4a9ff[_0x48fd2e(0x193)])??undefined};}export async function fetchCliVersionPolicy(){const _0x4d071e=a174_0x18d6;try{const _0x15aeaf=await fetch(LOVRABET_CLI_VERSION_POLICY_URL,{'headers':{'Accept':_0x4d071e(0x1a3)},'signal':AbortSignal[_0x4d071e(0x194)](FETCH_TIMEOUT_MS)});if(!_0x15aeaf['ok'])return null;return normalizeCliVersionPolicy(await _0x15aeaf[_0x4d071e(0x1a5)]());}catch{return null;}}let cachedPolicy=null,cachedAt=0x0,hasCachedPolicy=![],pendingPolicy=null;export async function getCliVersionPolicy(){const _0x5bf805=a174_0x18d6,_0xf22452=Date[_0x5bf805(0x19b)]();if(hasCachedPolicy){const _0xc7332c=cachedPolicy?SUCCESS_CACHE_TTL_MS:FAILURE_CACHE_TTL_MS;if(_0xf22452-cachedAt<_0xc7332c)return cachedPolicy;}if(pendingPolicy)return pendingPolicy;return pendingPolicy=fetchCliVersionPolicy()[_0x5bf805(0x199)](_0x3607c4=>{return cachedPolicy=_0x3607c4,cachedAt=Date['now'](),hasCachedPolicy=!![],_0x3607c4;})[_0x5bf805(0x195)](()=>{pendingPolicy=null;}),pendingPolicy;}export function clearCliVersionPolicyCache(){cachedPolicy=null,cachedAt=0x0,hasCachedPolicy=![],pendingPolicy=null;}
|
package/lib/utils/logger.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a175_0x4ee2(){const _0x223a8d=['trim','setRawCommand','format','dirname','3JQKBrU','mkdirSync','Failed\x20to\x20clear\x20logs:','readFileSync','341zGOXRH','map','Completed:\x20','writeFileSync','1578MUtDrJ','addColors','winstonLogger','clear','parse','red','utf8','split','859761WOfGqb','createLogger','Failed:\x20','1015cBQveb','log','setLogPath','warn','getWinstonInstance','transports','green','now','16YeWcoI','logFilePath','success','initWinstonLogger','currentRawCommand','clearLogs','details','timestamp','blue','logFileName','54510vCvvmU','unknown','readLogs','777834VlWFqJ','stringify','error','existsSync','message','info','toISOString','filter','level','Starting:\x20','duration','3qIOtrT','44078JYLhVB','278500gyoyuc','File','command','printf'];a175_0x4ee2=function(){return _0x223a8d;};return a175_0x4ee2();}const a175_0x418ced=a175_0x3222;(function(_0x4729e6,_0x38c932){const _0x411b62=a175_0x3222,_0x3c1eb9=_0x4729e6();while(!![]){try{const _0x5363d0=parseInt(_0x411b62(0x1d0))/0x1*(parseInt(_0x411b62(0x1d1))/0x2)+-parseInt(_0x411b62(0x19d))/0x3*(parseInt(_0x411b62(0x1d2))/0x4)+parseInt(_0x411b62(0x1b0))/0x5*(-parseInt(_0x411b62(0x1a5))/0x6)+parseInt(_0x411b62(0x1ad))/0x7+-parseInt(_0x411b62(0x1b8))/0x8+-parseInt(_0x411b62(0x1c5))/0x9+-parseInt(_0x411b62(0x1c2))/0xa*(-parseInt(_0x411b62(0x1a1))/0xb);if(_0x5363d0===_0x38c932)break;else _0x3c1eb9['push'](_0x3c1eb9['shift']());}catch(_0x5d540c){_0x3c1eb9['push'](_0x3c1eb9['shift']());}}}(a175_0x4ee2,0x243ff));import a175_0x1c4d6e from'winston';import a175_0x4be750 from'node:fs';import a175_0x33e2df from'node:path';import{PRODUCT_CONFIG}from'../constant/product.js';function a175_0x3222(_0x443c7d,_0x7334ef){_0x443c7d=_0x443c7d-0x19d;const _0x4ee217=a175_0x4ee2();let _0x32223a=_0x4ee217[_0x443c7d];return _0x32223a;}class Logger{[a175_0x418ced(0x1a7)];['logFilePath']='';[a175_0x418ced(0x1bc)]='';constructor(){}[a175_0x418ced(0x1d7)](_0x16753f){this['currentRawCommand']=_0x16753f;}[a175_0x418ced(0x1b2)](_0x2007ce){const _0x10fd4e=a175_0x418ced;this[_0x10fd4e(0x1b9)]=a175_0x33e2df['join'](_0x2007ce,PRODUCT_CONFIG[_0x10fd4e(0x1c1)]),this[_0x10fd4e(0x1a7)]&&this['winstonLogger'][_0x10fd4e(0x1a8)](),this[_0x10fd4e(0x1bb)]();}[a175_0x418ced(0x1bb)](){const _0x135067=a175_0x418ced,_0x16d1b8=a175_0x33e2df[_0x135067(0x1d9)](this[_0x135067(0x1b9)]);!a175_0x4be750[_0x135067(0x1c8)](_0x16d1b8)&&a175_0x4be750[_0x135067(0x19e)](_0x16d1b8,{'recursive':!![]});const _0x5212df=a175_0x1c4d6e[_0x135067(0x1d8)]['combine'](a175_0x1c4d6e[_0x135067(0x1d8)][_0x135067(0x1bf)](),a175_0x1c4d6e['format']['errors']({'stack':!![]}),a175_0x1c4d6e[_0x135067(0x1d8)][_0x135067(0x1d5)](_0x35a5ef=>{const _0x2a0342=_0x135067,_0x1b6fa8={'timestamp':_0x35a5ef[_0x2a0342(0x1bf)]||new Date()[_0x2a0342(0x1cb)](),'level':_0x35a5ef[_0x2a0342(0x1cd)]||_0x2a0342(0x1ca),'command':_0x35a5ef[_0x2a0342(0x1d4)]||_0x2a0342(0x1c3),'rawCommand':_0x35a5ef['rawCommand']||this[_0x2a0342(0x1bc)]||undefined,'message':_0x35a5ef[_0x2a0342(0x1c9)]||'','duration':_0x35a5ef[_0x2a0342(0x1cf)]||undefined,'details':_0x35a5ef[_0x2a0342(0x1be)]||undefined};return JSON[_0x2a0342(0x1c6)](_0x1b6fa8);}));this[_0x135067(0x1a7)]=a175_0x1c4d6e[_0x135067(0x1ae)]({'level':_0x135067(0x1ca),'format':_0x5212df,'transports':[new a175_0x1c4d6e[(_0x135067(0x1b5))][(_0x135067(0x1d3))]({'filename':this['logFilePath'],'level':'info'})],'silent':![]}),a175_0x1c4d6e[_0x135067(0x1a6)]({'success':_0x135067(0x1b6),'error':_0x135067(0x1aa),'warn':'yellow','info':_0x135067(0x1c0)});}[a175_0x418ced(0x1ca)](_0x405948,_0x3db2b3,_0x238a9a){const _0xd0062e=a175_0x418ced;if(!this[_0xd0062e(0x1b9)]||!this[_0xd0062e(0x1a7)])return;this['winstonLogger']['info'](_0x3db2b3,{'command':_0x405948,'details':_0x238a9a});}[a175_0x418ced(0x1ba)](_0x25ac2f,_0x37004e,_0xf63c5c,_0x58c24f){const _0x1a050b=a175_0x418ced;if(!this[_0x1a050b(0x1b9)]||!this[_0x1a050b(0x1a7)])return;this[_0x1a050b(0x1a7)][_0x1a050b(0x1b1)](_0x1a050b(0x1ca),_0x37004e,{'level':_0x1a050b(0x1ba),'command':_0x25ac2f,'duration':_0xf63c5c,'details':_0x58c24f});}[a175_0x418ced(0x1c7)](_0x5dfa6c,_0x4f86f4,_0x13a1c4){const _0x6fe068=a175_0x418ced;if(!this['logFilePath']||!this[_0x6fe068(0x1a7)])return;this[_0x6fe068(0x1a7)][_0x6fe068(0x1c7)](_0x4f86f4,{'command':_0x5dfa6c,'details':_0x13a1c4});}['warn'](_0x58c429,_0xcecf29,_0x5ae5a9){const _0x2f6af1=a175_0x418ced;if(!this['logFilePath']||!this['winstonLogger'])return;this[_0x2f6af1(0x1a7)]['warn'](_0xcecf29,{'command':_0x58c429,'details':_0x5ae5a9});}async['logTask'](_0x3503d4,_0x54ce8d,_0x4b6ac5){const _0x5b6222=a175_0x418ced,_0x4f4d38=Date[_0x5b6222(0x1b7)]();this[_0x5b6222(0x1ca)](_0x3503d4,_0x5b6222(0x1ce)+_0x54ce8d);try{const _0x1372d0=await _0x4b6ac5(),_0x55a991=Date[_0x5b6222(0x1b7)]()-_0x4f4d38;return this[_0x5b6222(0x1ba)](_0x3503d4,_0x5b6222(0x1a3)+_0x54ce8d,_0x55a991),_0x1372d0;}catch(_0x51e0fd){const _0x2e527a=Date[_0x5b6222(0x1b7)]()-_0x4f4d38;this[_0x5b6222(0x1c7)](_0x3503d4,_0x5b6222(0x1af)+_0x54ce8d,{'error':_0x51e0fd instanceof Error?_0x51e0fd[_0x5b6222(0x1c9)]:String(_0x51e0fd),'duration':_0x2e527a});throw _0x51e0fd;}}[a175_0x418ced(0x1c4)](){const _0x195012=a175_0x418ced;try{if(!a175_0x4be750['existsSync'](this['logFilePath']))return[];const _0x8e232d=a175_0x4be750[_0x195012(0x1a0)](this[_0x195012(0x1b9)],_0x195012(0x1ab));return _0x8e232d[_0x195012(0x1ac)](/\r?\n/)[_0x195012(0x1cc)](_0x395fd3=>_0x395fd3[_0x195012(0x1d6)]())[_0x195012(0x1a2)](_0x2c8080=>JSON[_0x195012(0x1a9)](_0x2c8080));}catch(_0x1a1c94){return console[_0x195012(0x1b3)]('Failed\x20to\x20read\x20logs:',_0x1a1c94),[];}}[a175_0x418ced(0x1bd)](){const _0x131ddc=a175_0x418ced;try{a175_0x4be750[_0x131ddc(0x1c8)](this[_0x131ddc(0x1b9)])&&a175_0x4be750[_0x131ddc(0x1a4)](this[_0x131ddc(0x1b9)],'',_0x131ddc(0x1ab));}catch(_0x1e1992){console[_0x131ddc(0x1b3)](_0x131ddc(0x19f),_0x1e1992);}}[a175_0x418ced(0x1b4)](){return this['winstonLogger'];}}export const logger=new Logger();
|