@lovrabet/lovrabet-cli 2.3.2-beta.3 → 2.3.3-beta.1
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.d.ts +15 -0
- package/lib/commands/approval/index.js +1 -0
- package/lib/commands/artifact/index.js +1 -1
- package/lib/commands/auth/device.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/auth/prompt.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/exec.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/common/config-policy.js +1 -1
- package/lib/commands/common/constraints.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/config/definitions.js +1 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/sdk-doc.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/permit/dataset-get.js +1 -1
- package/lib/commands/permit/dataset-set.js +1 -1
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.js +1 -1
- package/lib/commands/personal-bff/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/schedule/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/service/dynamic.js +1 -1
- package/lib/commands/service/function-name-adapter.js +1 -1
- package/lib/commands/service/index.js +1 -1
- package/lib/commands/service/registry.js +1 -1
- package/lib/commands/skill/commands/create.js +1 -1
- package/lib/commands/skill/commands/diagram.js +1 -1
- package/lib/commands/skill/commands/install.js +1 -1
- package/lib/commands/skill/commands/list.js +1 -1
- package/lib/commands/skill/commands/push.js +1 -1
- package/lib/commands/skill/commands/validate.js +1 -1
- package/lib/commands/skill/diagram.js +1 -1
- package/lib/commands/skill/flags.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/skill/manifest-helpers.js +1 -1
- package/lib/commands/skill/push-execute.js +1 -1
- package/lib/commands/skill/push-flow-helpers.js +1 -1
- package/lib/commands/skill/push-retarget.js +1 -1
- package/lib/commands/skill/scopes.js +1 -1
- package/lib/commands/skill/summary.js +1 -1
- package/lib/commands/skill/templates.js +1 -1
- package/lib/commands/skill/validate.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/update.js +1 -1
- package/lib/commands/user-account/bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/config/domain-config.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/app.js +1 -1
- package/lib/constant/auth-mode.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/distribution.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/product.js +1 -1
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/api-client.d.ts +83 -0
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/kb-search-client.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/preparse.js +1 -1
- package/lib/framework/rate-limit.js +1 -1
- package/lib/framework/raw-flags.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-confirmation.js +1 -1
- package/lib/framework/runner-error.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/service-order.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/runtime-skill-sync/constants.js +1 -1
- package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
- package/lib/skills/runtime-skill-sync/hashing.js +1 -1
- package/lib/skills/runtime-skill-sync/install-target.js +1 -1
- package/lib/skills/runtime-skill-sync/links.js +1 -1
- package/lib/skills/runtime-skill-sync/list-local.js +1 -1
- package/lib/skills/runtime-skill-sync/local-files.js +1 -1
- package/lib/skills/runtime-skill-sync/materialize.js +1 -1
- package/lib/skills/runtime-skill-sync/metadata.js +1 -1
- package/lib/skills/runtime-skill-sync/paths.js +1 -1
- package/lib/skills/runtime-skill-sync/push.js +1 -1
- package/lib/skills/runtime-skill-sync/scopes.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/utils/access-key-redaction.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/lossless-json.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/positive-safe-integer.d.ts +5 -0
- package/lib/utils/positive-safe-integer.js +1 -0
- package/lib/utils/redaction.d.ts +17 -0
- package/lib/utils/redaction.js +1 -0
- 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 +3 -2
- package/skills/lovrabet/references/lovrabet-approval-workflow.md +73 -0
- package/skills/lovrabet.manifest.json +4 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2a87ed,_0x582de6){const _0x40f8c7=a144_0x3a52,_0x2a1fb1=_0x2a87ed();while(!![]){try{const _0x54df34=parseInt(_0x40f8c7(0x1e3))/0x1*(parseInt(_0x40f8c7(0x200))/0x2)+parseInt(_0x40f8c7(0x1e2))/0x3+parseInt(_0x40f8c7(0x20e))/0x4*(-parseInt(_0x40f8c7(0x211))/0x5)+parseInt(_0x40f8c7(0x1e1))/0x6+-parseInt(_0x40f8c7(0x20d))/0x7*(parseInt(_0x40f8c7(0x1e6))/0x8)+-parseInt(_0x40f8c7(0x1f9))/0x9*(-parseInt(_0x40f8c7(0x1fc))/0xa)+parseInt(_0x40f8c7(0x1f6))/0xb*(-parseInt(_0x40f8c7(0x1ff))/0xc);if(_0x54df34===_0x582de6)break;else _0x2a1fb1['push'](_0x2a1fb1['shift']());}catch(_0x12d24a){_0x2a1fb1['push'](_0x2a1fb1['shift']());}}}(a144_0x42b9,0xd9592));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(_0x362d82){const _0x1ce79e=a144_0x3a52;return _0x362d82[_0x1ce79e(0x1fa)]??Buffer[_0x1ce79e(0x1f4)](_0x362d82[_0x1ce79e(0x20a)]??'',_0x1ce79e(0x210));}export function fileText(_0x18d925){const _0x3c9283=a144_0x3a52;return fileContent(_0x18d925)[_0x3c9283(0x20c)](_0x3c9283(0x210));}export function normalizeLocalFiles(_0x3207f2){const _0x2b9db5=a144_0x3a52;if(!Array[_0x2b9db5(0x212)](_0x3207f2)||_0x3207f2[_0x2b9db5(0x206)]===0x0)return[];const _0xa3e304=new Map();for(const _0xa250a6 of _0x3207f2){if(!_0xa250a6||typeof _0xa250a6!==_0x2b9db5(0x20f)||typeof _0xa250a6['path']!=='string')throw CliErrors[_0x2b9db5(0x1e8)](_0x2b9db5(0x205));const _0x3e85a6=normalizeSkillRelativePath(_0xa250a6['path']);if(_0xa3e304[_0x2b9db5(0x1ee)](_0x3e85a6))throw CliErrors['validation'](_0x2b9db5(0x1fd)+_0x3e85a6);if(_0xa250a6[_0x2b9db5(0x1fa)]!==undefined&&!Buffer[_0x2b9db5(0x1f8)](_0xa250a6[_0x2b9db5(0x1fa)]))throw CliErrors[_0x2b9db5(0x1e8)](_0x2b9db5(0x1ef)+_0x3e85a6);if(_0xa250a6[_0x2b9db5(0x1fa)]===undefined&&typeof _0xa250a6[_0x2b9db5(0x20a)]!==_0x2b9db5(0x202))throw CliErrors[_0x2b9db5(0x1e8)](_0x2b9db5(0x1f1)+_0x3e85a6);const _0x112848=fileContent(_0xa250a6);_0xa3e304[_0x2b9db5(0x213)](_0x3e85a6,{'path':_0x3e85a6,'bytes':_0x112848});}return Array[_0x2b9db5(0x1f4)](_0xa3e304[_0x2b9db5(0x207)]())[_0x2b9db5(0x1f5)](compareSkillFiles);}export function normalizeManifestFiles(_0x4bd783){const _0x5cf6f8=a144_0x3a52;if(!Array[_0x5cf6f8(0x212)](_0x4bd783)||_0x4bd783[_0x5cf6f8(0x206)]===0x0)return[];const _0xa35af2=new Map();for(const _0x499cb5 of _0x4bd783){if(!_0x499cb5||typeof _0x499cb5!=='object'||typeof _0x499cb5['path']!==_0x5cf6f8(0x202))throw CliErrors[_0x5cf6f8(0x1e8)](_0x5cf6f8(0x205));const _0x132464=normalizeSkillRelativePath(_0x499cb5[_0x5cf6f8(0x1e7)]);if(_0xa35af2[_0x5cf6f8(0x1ee)](_0x132464))throw CliErrors[_0x5cf6f8(0x1e8)]('Duplicate\x20Skill\x20file\x20path:\x20'+_0x132464);if(!isSha256Hex(_0x499cb5[_0x5cf6f8(0x1ec)]))throw CliErrors['validation'](_0x5cf6f8(0x1f7)+_0x132464);if(!Number['isSafeInteger'](_0x499cb5[_0x5cf6f8(0x208)])||_0x499cb5[_0x5cf6f8(0x208)]<0x0)throw CliErrors[_0x5cf6f8(0x1e8)](_0x5cf6f8(0x1eb)+_0x132464);_0xa35af2['set'](_0x132464,{'path':_0x132464,'sha256':_0x499cb5[_0x5cf6f8(0x1ec)][_0x5cf6f8(0x1e4)](),'size':_0x499cb5[_0x5cf6f8(0x208)]});}return Array[_0x5cf6f8(0x1f4)](_0xa35af2[_0x5cf6f8(0x207)]())[_0x5cf6f8(0x1f5)](compareSkillFiles);}export function scanSkillDirectory(_0x105276,_0x4c8086={}){const _0x479c1a=realpathSync(_0x105276),_0x2fdd2a=canonicalExcludedFilePaths(_0x4c8086['excludedFilePaths']),_0x1d4906=[];function _0xc47892(_0xbe1838){const _0x473bfb=a144_0x3a52,_0xf521a1=readdirSync(_0xbe1838,{'withFileTypes':!![]})[_0x473bfb(0x1f5)]((_0x2ae545,_0xdc12e3)=>_0x2ae545['name']['localeCompare'](_0xdc12e3[_0x473bfb(0x1fe)]));for(const _0x390910 of _0xf521a1){if(_0x390910[_0x473bfb(0x1ed)]()&&IGNORED_DIR_NAMES['has'](_0x390910['name']))continue;if(IGNORED_FILE_NAMES[_0x473bfb(0x1ee)](_0x390910[_0x473bfb(0x1fe)]))continue;const _0x91301a=resolve(_0xbe1838,_0x390910['name']);if(isExcludedFilePath(_0x91301a,_0x2fdd2a))continue;if(_0x390910[_0x473bfb(0x201)]())throw CliErrors[_0x473bfb(0x1e8)](_0x473bfb(0x1f2)+_0x91301a);const _0xf0ad6c=toPosixPath(relative(_0x479c1a,_0x91301a));if(_0x390910[_0x473bfb(0x1ed)]()){_0xc47892(_0x91301a);continue;}if(!_0x390910[_0x473bfb(0x209)]())continue;validateSkillRelativePath(_0xf0ad6c);const _0x1fd2b4=readFileSync(_0x91301a);_0x1d4906[_0x473bfb(0x204)]({'path':_0xf0ad6c,'bytes':_0x1fd2b4});}}return _0xc47892(_0x479c1a),normalizeLocalFiles(_0x1d4906);}function a144_0x3a52(_0x448a2f,_0x5e3783){_0x448a2f=_0x448a2f-0x1e1;const _0x42b90e=a144_0x42b9();let _0x3a5246=_0x42b90e[_0x448a2f];return _0x3a5246;}function canonicalExcludedFilePaths(_0x11f013){const _0x5c2537=a144_0x3a52,_0x2e3e7b=new Set();for(const _0x1e54fa of _0x11f013??[]){const _0x52aff0=resolve(_0x1e54fa);_0x2e3e7b[_0x5c2537(0x1ea)](_0x52aff0);try{_0x2e3e7b[_0x5c2537(0x1ea)](realpathSync(_0x52aff0));}catch{}}return _0x2e3e7b;}function isExcludedFilePath(_0x599f15,_0x1e2339){const _0x19a3c8=a144_0x3a52;if(_0x1e2339[_0x19a3c8(0x1ee)](_0x599f15))return!![];if(_0x1e2339[_0x19a3c8(0x208)]===0x0)return![];try{return _0x1e2339[_0x19a3c8(0x1ee)](realpathSync(_0x599f15));}catch{return![];}}export function compareSkillFiles(_0x483ec3,_0x3f583c){const _0x55bfa2=a144_0x3a52;if(_0x483ec3[_0x55bfa2(0x1e7)]===SKILL_FILE)return _0x3f583c['path']===SKILL_FILE?0x0:-0x1;if(_0x3f583c[_0x55bfa2(0x1e7)]===SKILL_FILE)return 0x1;return Buffer[_0x55bfa2(0x20b)](Buffer['from'](_0x483ec3[_0x55bfa2(0x1e7)],_0x55bfa2(0x210)),Buffer[_0x55bfa2(0x1f4)](_0x3f583c[_0x55bfa2(0x1e7)],_0x55bfa2(0x210)));}export function normalizeSkillRelativePath(_0x193989){const _0x3dabaa=a144_0x3a52,_0x25fbe4=toPosixPath(_0x193989[_0x3dabaa(0x1e5)]());return validateSkillRelativePath(_0x25fbe4),_0x25fbe4;}export function validateSkillRelativePath(_0x5a5029){const _0x76c5a6=a144_0x3a52;if(!_0x5a5029||_0x5a5029['startsWith']('/')||_0x5a5029[_0x76c5a6(0x1f0)]('//'))throw CliErrors['validation'](_0x76c5a6(0x1e9)+_0x5a5029);for(const _0x4bacc3 of _0x5a5029[_0x76c5a6(0x203)]('/')){if(!_0x4bacc3||_0x4bacc3==='.'||_0x4bacc3==='..')throw CliErrors['validation']('Unsafe\x20Skill\x20file\x20path:\x20'+_0x5a5029);}}export function toPosixPath(_0xebb996){const _0x18ac29=a144_0x3a52;return _0xebb996[_0x18ac29(0x1fb)](/\\/g,'/');}export function isSha256Hex(_0x37e0c3){const _0x96550e=a144_0x3a52;return typeof _0x37e0c3===_0x96550e(0x202)&&/^[a-fA-F0-9]{64}$/[_0x96550e(0x1f3)](_0x37e0c3);}function a144_0x42b9(){const _0x4afbd9=['sort','7902488WrDREK','Skill\x20file\x20sha256\x20is\x20invalid:\x20','isBuffer','9VLYMEK','bytes','replace','4225420QcbIep','Duplicate\x20Skill\x20file\x20path:\x20','name','12MePRcH','136kfzzxr','isSymbolicLink','string','split','push','Skill\x20file\x20path\x20must\x20be\x20text.','length','values','size','isFile','content','compare','toString','203kWQRxs','4ImHrHy','object','utf8','2973855AwdoPN','isArray','set','5621514INXxAF','408018frgwjx','24977PsZswk','toLowerCase','trim','273232HKNbrC','path','validation','Unsafe\x20Skill\x20file\x20path:\x20','add','Skill\x20file\x20size\x20is\x20invalid:\x20','sha256','isDirectory','has','Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20','includes','Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20','Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20','test','from'];a144_0x42b9=function(){return _0x4afbd9;};return a144_0x42b9();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x124b52,_0x388416){const _0x157669=a144_0x7383,_0x4394cf=_0x124b52();while(!![]){try{const _0x55b2e5=-parseInt(_0x157669(0x1e9))/0x1+-parseInt(_0x157669(0x1d5))/0x2*(-parseInt(_0x157669(0x1e5))/0x3)+parseInt(_0x157669(0x1e8))/0x4+-parseInt(_0x157669(0x1dd))/0x5+parseInt(_0x157669(0x1e1))/0x6+parseInt(_0x157669(0x1e7))/0x7*(-parseInt(_0x157669(0x1f6))/0x8)+-parseInt(_0x157669(0x1c0))/0x9*(-parseInt(_0x157669(0x1cd))/0xa);if(_0x55b2e5===_0x388416)break;else _0x4394cf['push'](_0x4394cf['shift']());}catch(_0x5ead7e){_0x4394cf['push'](_0x4394cf['shift']());}}}(a144_0x364f,0xd7fe7));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';function a144_0x364f(){const _0x5b9a53=['5121720lFexbj','env','appCode','skillCode','10375722mYFXWj','status','validation','Managed\x20file\x20was\x20removed\x20locally:\x20','771ydDgQK','displayName:\x20','19418OLtYTv','3366944eSmrvE','1001271quRunP','join','\x0a---\x0a\x0a','accessKey','.\x20Changed\x20file:\x20','example','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','trim','force','match','length','hasOwn','skillName','4768OKFnoY','packageBytes','entries','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','---\x0a','Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20','test','has','34947iylJCa','fileHashes','Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20','pulledAt','isFile','scope','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','keys','slice','flow','contentHash','delete','toString','4620BCfXvg','paths','errors','path','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','map','utf8','version','1546cZSNdO','contents','filter','name','replace','description','set','---'];a144_0x364f=function(){return _0x5b9a53;};return a144_0x364f();}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(_0xfeb18c,_0x258845,_0x2a2c71){const _0x4a02f7=a144_0x7383,_0x436d6f=requireSkillCode(_0xfeb18c),_0x26e17d=requirePackageBytes(_0x436d6f,_0x2a2c71[_0x4a02f7(0x1f7)]),_0x36d277=extractDownloadedPackage(_0x26e17d),_0x126fe6=_0x36d277['find'](_0x303aa1=>_0x303aa1[_0x4a02f7(0x1d0)]===SKILL_FILE);if(!_0x126fe6)throw CliErrors['validation']('Runtime\x20Skill\x20package\x20is\x20missing\x20'+SKILL_FILE+':\x20'+_0x436d6f);const _0x397ee3=withMaterializedSkillFrontmatter(_0x36d277,_0xfeb18c,_0x436d6f),_0xec0872=_0x397ee3['find'](_0x15e733=>_0x15e733['path']===SKILL_FILE),_0x5569b8=fileText(_0xec0872),_0x3a065f=getRuntimeSkillDir(_0x2a2c71['env'],_0x2a2c71[_0x4a02f7(0x1ec)],_0x2a2c71[_0x4a02f7(0x1df)],_0x258845,_0x436d6f,_0x2a2c71[_0x4a02f7(0x1ce)]),_0x342ae6=resolve(_0x3a065f,SKILL_FILE),_0x2abed7=resolve(_0x3a065f,METADATA_FILE),_0x5d189c=contentHash(_0x5569b8),_0x2009a9=readMetadataIfPresent(_0x2abed7)?.['fileHashes'];ensurePulledFilesCanBeOverwritten(_0x3a065f,_0x2abed7,_0x397ee3,_0x2a2c71[_0x4a02f7(0x1f1)]===!![]),mkdirSync(_0x3a065f,{'recursive':!![],'mode':0x1c0});const _0x142f28=existsSync(_0x342ae6)?readFileSync(_0x342ae6,_0x4a02f7(0x1d3)):undefined;return materializeFiles(_0x3a065f,_0x397ee3),removeStaleManagedFiles(_0x3a065f,_0x2009a9,_0x397ee3),writeJsonAtomic(_0x2abed7,buildMetadata(_0xfeb18c,_0x258845,_0x2a2c71['appCode'],_0x5d189c,_0x2a2c71[_0x4a02f7(0x1c3)],_0x397ee3,_0x26e17d)),{'skill':_0xfeb18c,'scope':_0x258845,'dir':_0x3a065f,'skillMdPath':_0x342ae6,'metadataPath':_0x2abed7,'contentHash':_0x5d189c,'changed':_0x142f28!==_0x5569b8};}export function reuseMaterializedRuntimeSkill(_0xfafc93,_0x38250f,_0xd633e9){const _0x49f122=a144_0x7383,_0x286164=_0xfafc93['version']?.['trim']();if(!_0x286164)return undefined;const _0x1f8204=requireSkillCode(_0xfafc93),_0x1ae8fa=getRuntimeSkillDir(_0xd633e9[_0x49f122(0x1de)],_0xd633e9[_0x49f122(0x1ec)],_0xd633e9[_0x49f122(0x1df)],_0x38250f,_0x1f8204,_0xd633e9[_0x49f122(0x1ce)]),_0x3371f8=resolve(_0x1ae8fa,SKILL_FILE),_0xb3b7a4=resolve(_0x1ae8fa,METADATA_FILE),_0x1b44d9=readMetadataIfPresent(_0xb3b7a4);if(!_0x1b44d9||_0x1b44d9['schemaVersion']!==0x2||_0x1b44d9[_0x49f122(0x1df)]!==_0xd633e9[_0x49f122(0x1df)]||_0x1b44d9[_0x49f122(0x1c5)]!==_0x38250f||_0x1b44d9[_0x49f122(0x1e0)]!==_0x1f8204||_0x1b44d9[_0x49f122(0x1d4)]!==_0x286164||_0x1b44d9['id']!==_0xfafc93['id']||_0x1b44d9[_0x49f122(0x1f5)]!==_0xfafc93[_0x49f122(0x1f5)]||_0x1b44d9[_0x49f122(0x1da)]!==_0xfafc93['description']||_0x1b44d9[_0x49f122(0x1ee)]!==_0xfafc93[_0x49f122(0x1ee)]||_0x1b44d9[_0x49f122(0x1e2)]!==_0xfafc93[_0x49f122(0x1e2)]||!_0x1b44d9[_0x49f122(0x1ca)]||!_0x1b44d9[_0x49f122(0x1c1)]||!Object[_0x49f122(0x1f4)](_0x1b44d9[_0x49f122(0x1c1)],SKILL_FILE))return undefined;for(const [_0x540ac4,_0x5ad553]of Object[_0x49f122(0x1f8)](_0x1b44d9[_0x49f122(0x1c1)])){if(!/^[a-f0-9]{64}$/[_0x49f122(0x1be)](_0x5ad553))return undefined;const _0x3dfcba=resolveManagedFilePath(_0x1ae8fa,_0x540ac4);if(!existsSync(_0x3dfcba)||!lstatSync(_0x3dfcba)[_0x49f122(0x1c4)]())return undefined;if(bufferSha256(readFileSync(_0x3dfcba))!==_0x5ad553)return undefined;}return{'skill':_0xfafc93,'scope':_0x38250f,'dir':_0x1ae8fa,'skillMdPath':_0x3371f8,'metadataPath':_0xb3b7a4,'contentHash':_0x1b44d9[_0x49f122(0x1ca)],'changed':![]};}function withMaterializedSkillFrontmatter(_0x57cf0d,_0x2bfac6,_0xfcb3de){const _0x39d70e=a144_0x7383,_0x342b0a=skillDisplayName(_0x2bfac6,_0xfcb3de),_0x5a353d=_0x2bfac6[_0x39d70e(0x1da)]?.[_0x39d70e(0x1f0)]()||_0x342b0a||_0xfcb3de;return normalizeLocalFiles(_0x57cf0d)['map'](_0x42dd2f=>{const _0x35ce61=_0x39d70e,_0x1b3905=fileText(_0x42dd2f);if(_0x42dd2f[_0x35ce61(0x1d0)]!==SKILL_FILE)return _0x42dd2f;if(hasYamlFrontmatter(_0x1b3905))return{'path':_0x42dd2f['path'],'content':withSyncedDisplayName(_0x1b3905,_0x342b0a)};return{'path':_0x42dd2f[_0x35ce61(0x1d0)],'content':prependSkillFrontmatter(_0x1b3905,{'name':_0xfcb3de,'displayName':_0x342b0a,'description':_0x5a353d})};});}function a144_0x7383(_0x169ade,_0x4d4b2a){_0x169ade=_0x169ade-0x1be;const _0x364f96=a144_0x364f();let _0x73834d=_0x364f96[_0x169ade];return _0x73834d;}function hasYamlFrontmatter(_0x45eaba){const _0x503514=a144_0x7383;return/^\uFEFF?---\s*\r?\n/[_0x503514(0x1be)](_0x45eaba);}function prependSkillFrontmatter(_0x110a50,_0x94bf69){const _0x2d9449=a144_0x7383,_0x3b09f7=_0x110a50[_0x2d9449(0x1d9)](/^\uFEFF/,'');return[_0x2d9449(0x1dc),'name:\x20'+yamlString(_0x94bf69[_0x2d9449(0x1d8)]),_0x94bf69['displayName']?_0x2d9449(0x1e6)+yamlString(_0x94bf69['displayName']):undefined,'description:\x20'+yamlString(_0x94bf69[_0x2d9449(0x1da)]),_0x2d9449(0x1dc),'',_0x3b09f7][_0x2d9449(0x1d7)](_0x5c17ea=>_0x5c17ea!==undefined)[_0x2d9449(0x1ea)]('\x0a');}function yamlString(_0x546d1b){const _0xb8fbb3=a144_0x7383;return JSON['stringify'](_0x546d1b[_0xb8fbb3(0x1d9)](/\r/g,'')[_0xb8fbb3(0x1f0)]());}function skillDisplayName(_0x12afcd,_0x38d40a){const _0x3ab949=a144_0x7383,_0x5e8a2f=_0x12afcd['skillName']?.[_0x3ab949(0x1f0)]();return _0x5e8a2f||_0x38d40a;}function withSyncedDisplayName(_0x504334,_0x428027){const _0x460a8a=a144_0x7383,_0x5219a1=_0x504334[_0x460a8a(0x1f2)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x5219a1)return _0x504334;const _0x562fa5=_0x5219a1[0x1]??'',_0x54f68c=_0x5219a1[0x2]??'',_0x53d149=parseDocument(_0x54f68c);if(_0x53d149[_0x460a8a(0x1cf)][_0x460a8a(0x1f3)]>0x0||!isMap(_0x53d149[_0x460a8a(0x1d6)]))return _0x504334;if(_0x428027)_0x53d149[_0x460a8a(0x1db)]('displayName',_0x428027);else{if(_0x53d149[_0x460a8a(0x1bf)]('displayName'))_0x53d149[_0x460a8a(0x1cb)]('displayName');else return _0x504334;}forceBlockCollections(_0x53d149['contents']);const _0x295473=_0x53d149[_0x460a8a(0x1cc)]({'lineWidth':0x0})['trimEnd'](),_0x156411=_0x504334[_0x460a8a(0x1c8)](_0x5219a1[0x0][_0x460a8a(0x1f3)])[_0x460a8a(0x1d9)](/^\r?\n/,'');return _0x562fa5+_0x460a8a(0x1fa)+_0x295473+_0x460a8a(0x1eb)+_0x156411;}function forceBlockCollections(_0x314c28){if(!isNode(_0x314c28))return;visit(_0x314c28,(_0x76c526,_0x4bf1fe)=>{const _0x641af7=a144_0x7383;isCollection(_0x4bf1fe)&&(_0x4bf1fe[_0x641af7(0x1c9)]=![]);});}function ensurePulledFilesCanBeOverwritten(_0xfeb777,_0x4160be,_0xcd11c7,_0x583a45){const _0x266ab2=a144_0x7383;if(_0x583a45||!existsSync(_0x4160be))return;const _0x1d10ad=readMetadataIfPresent(_0x4160be);if(!_0x1d10ad)return;const _0x70a2c3=_0x1d10ad[_0x266ab2(0x1c1)]&&Object[_0x266ab2(0x1c7)](_0x1d10ad['fileHashes'])[_0x266ab2(0x1f3)]>0x0?_0x1d10ad[_0x266ab2(0x1c1)]:undefined;if(_0x70a2c3)for(const [_0x5c537a,_0x375c28]of Object[_0x266ab2(0x1f8)](_0x70a2c3)){const _0x3ddc4f=resolveManagedFilePath(_0xfeb777,_0x5c537a);if(!existsSync(_0x3ddc4f))throw CliErrors[_0x266ab2(0x1e3)](_0x266ab2(0x1c6)+_0xfeb777,_0x266ab2(0x1e4)+_0x5c537a);const _0x2e22ad=lstatSync(_0x3ddc4f);if(!_0x2e22ad[_0x266ab2(0x1c4)]())throw CliErrors[_0x266ab2(0x1e3)](_0x266ab2(0x1c6)+_0xfeb777,_0x266ab2(0x1fb)+_0x5c537a);const _0x4f684e=bufferSha256(readFileSync(_0x3ddc4f));if(_0x4f684e!==_0x375c28)throw CliErrors[_0x266ab2(0x1e3)](_0x266ab2(0x1c6)+_0xfeb777+_0x266ab2(0x1ed)+_0x5c537a,_0x266ab2(0x1f9)+_0x5c537a);}else{const _0xdb3504=resolve(_0xfeb777,SKILL_FILE);if(existsSync(_0xdb3504)&&_0x1d10ad[_0x266ab2(0x1ca)]){const _0x22129e=contentHash(readFileSync(_0xdb3504,_0x266ab2(0x1d3)));if(_0x22129e!==_0x1d10ad[_0x266ab2(0x1ca)])throw CliErrors['validation'](_0x266ab2(0x1d1)+_0xdb3504,'Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.');}}for(const _0x610344 of normalizeLocalFiles(_0xcd11c7)){if(_0x70a2c3?.[_0x610344[_0x266ab2(0x1d0)]])continue;if(!_0x70a2c3&&_0x610344[_0x266ab2(0x1d0)]===SKILL_FILE)continue;const _0x46941d=resolveManagedFilePath(_0xfeb777,_0x610344[_0x266ab2(0x1d0)]);if(!existsSync(_0x46941d))continue;const _0x5e4c37=lstatSync(_0x46941d);if(!_0x5e4c37['isFile']())throw CliErrors[_0x266ab2(0x1e3)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0xfeb777,_0x266ab2(0x1ef)+_0x610344[_0x266ab2(0x1d0)]);const _0x40726b=bufferSha256(readFileSync(_0x46941d));if(_0x40726b!==fileHash(_0x610344))throw CliErrors['validation'](_0x266ab2(0x1c6)+_0xfeb777,_0x266ab2(0x1c2)+_0x610344['path']);}}function materializeFiles(_0x2d30a8,_0xb0b3f4){for(const _0xfcff6b of normalizeLocalFiles(_0xb0b3f4)){const _0x501ad5=resolveManagedFilePath(_0x2d30a8,_0xfcff6b['path']);mkdirSync(dirname(_0x501ad5),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x501ad5,fileContent(_0xfcff6b),0x180);}}function removeStaleManagedFiles(_0x19bc33,_0x11cc17,_0x4eeb7f){const _0x507162=a144_0x7383;if(!_0x11cc17)return;const _0x12e9ba=new Set(normalizeLocalFiles(_0x4eeb7f)[_0x507162(0x1d2)](_0x3618f1=>_0x3618f1[_0x507162(0x1d0)]));for(const _0x5342b6 of Object['keys'](_0x11cc17)){if(_0x12e9ba[_0x507162(0x1bf)](_0x5342b6))continue;const _0x2f30d4=resolveManagedFilePath(_0x19bc33,_0x5342b6);existsSync(_0x2f30d4)&&lstatSync(_0x2f30d4)['isFile']()&&rmSync(_0x2f30d4,{'force':!![]});}}
|
|
1
|
+
(function(_0x2b1849,_0x3818a6){const _0x35ddfc=a145_0x5b6c,_0x52240a=_0x2b1849();while(!![]){try{const _0xe73f0e=-parseInt(_0x35ddfc(0xcb))/0x1+-parseInt(_0x35ddfc(0xcd))/0x2+parseInt(_0x35ddfc(0xcf))/0x3+parseInt(_0x35ddfc(0xc1))/0x4+parseInt(_0x35ddfc(0xd9))/0x5+-parseInt(_0x35ddfc(0xd5))/0x6+parseInt(_0x35ddfc(0xd1))/0x7*(-parseInt(_0x35ddfc(0xec))/0x8);if(_0xe73f0e===_0x3818a6)break;else _0x52240a['push'](_0x52240a['shift']());}catch(_0x100eb0){_0x52240a['push'](_0x52240a['shift']());}}}(a145_0x1202,0x904a2));import{existsSync,lstatSync,mkdirSync,readFileSync,rmSync}from'node:fs';import{dirname,resolve}from'node:path';function a145_0x5b6c(_0xd86a9,_0x434f26){_0xd86a9=_0xd86a9-0xbe;const _0x120292=a145_0x1202();let _0x5b6cf2=_0x120292[_0xd86a9];return _0x5b6cf2;}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(_0xf59359,_0x1c24c2,_0x119cbc){const _0x43996b=a145_0x5b6c,_0x10d714=requireSkillCode(_0xf59359),_0x5e3f9d=requirePackageBytes(_0x10d714,_0x119cbc[_0x43996b(0xd7)]),_0x16b330=extractDownloadedPackage(_0x5e3f9d),_0x438285=_0x16b330[_0x43996b(0xbf)](_0x4f44b9=>_0x4f44b9[_0x43996b(0xc0)]===SKILL_FILE);if(!_0x438285)throw CliErrors[_0x43996b(0xf7)](_0x43996b(0xf8)+SKILL_FILE+':\x20'+_0x10d714);const _0x5c8328=withMaterializedSkillFrontmatter(_0x16b330,_0xf59359,_0x10d714),_0x494d98=_0x5c8328[_0x43996b(0xbf)](_0x44064c=>_0x44064c['path']===SKILL_FILE),_0x2739e3=fileText(_0x494d98),_0x11cdf3=getRuntimeSkillDir(_0x119cbc[_0x43996b(0xf5)],_0x119cbc['accessKey'],_0x119cbc['appCode'],_0x1c24c2,_0x10d714,_0x119cbc[_0x43996b(0xf1)]),_0x19ab5f=resolve(_0x11cdf3,SKILL_FILE),_0x2e1378=resolve(_0x11cdf3,METADATA_FILE),_0x1ba34d=contentHash(_0x2739e3),_0x3a1dff=readMetadataIfPresent(_0x2e1378)?.[_0x43996b(0xee)];ensurePulledFilesCanBeOverwritten(_0x11cdf3,_0x2e1378,_0x5c8328,_0x119cbc['force']===!![]),mkdirSync(_0x11cdf3,{'recursive':!![],'mode':0x1c0});const _0x389b26=existsSync(_0x19ab5f)?readFileSync(_0x19ab5f,'utf8'):undefined;return materializeFiles(_0x11cdf3,_0x5c8328),removeStaleManagedFiles(_0x11cdf3,_0x3a1dff,_0x5c8328),writeJsonAtomic(_0x2e1378,buildMetadata(_0xf59359,_0x1c24c2,_0x119cbc[_0x43996b(0xc9)],_0x1ba34d,_0x119cbc[_0x43996b(0xe5)],_0x5c8328,_0x5e3f9d)),{'skill':_0xf59359,'scope':_0x1c24c2,'dir':_0x11cdf3,'skillMdPath':_0x19ab5f,'metadataPath':_0x2e1378,'contentHash':_0x1ba34d,'changed':_0x389b26!==_0x2739e3};}export function reuseMaterializedRuntimeSkill(_0x346ac5,_0x586d28,_0x49515c){const _0x4bfb4f=a145_0x5b6c,_0x322ede=_0x346ac5[_0x4bfb4f(0xc3)]?.[_0x4bfb4f(0xdb)]();if(!_0x322ede)return undefined;const _0x18877d=requireSkillCode(_0x346ac5),_0x150698=getRuntimeSkillDir(_0x49515c[_0x4bfb4f(0xf5)],_0x49515c['accessKey'],_0x49515c[_0x4bfb4f(0xc9)],_0x586d28,_0x18877d,_0x49515c[_0x4bfb4f(0xf1)]),_0x210120=resolve(_0x150698,SKILL_FILE),_0x192d40=resolve(_0x150698,METADATA_FILE),_0x25dc86=readMetadataIfPresent(_0x192d40);if(!_0x25dc86||_0x25dc86[_0x4bfb4f(0xeb)]!==0x2||_0x25dc86['appCode']!==_0x49515c[_0x4bfb4f(0xc9)]||_0x25dc86[_0x4bfb4f(0xe6)]!==_0x586d28||_0x25dc86['skillCode']!==_0x18877d||_0x25dc86['version']!==_0x322ede||_0x25dc86['id']!==_0x346ac5['id']||_0x25dc86[_0x4bfb4f(0xe8)]!==_0x346ac5['skillName']||_0x25dc86[_0x4bfb4f(0xf4)]!==_0x346ac5['description']||_0x25dc86[_0x4bfb4f(0xe3)]!==_0x346ac5['example']||_0x25dc86[_0x4bfb4f(0xdf)]!==_0x346ac5[_0x4bfb4f(0xdf)]||!_0x25dc86[_0x4bfb4f(0xd8)]||!_0x25dc86[_0x4bfb4f(0xee)]||!Object[_0x4bfb4f(0xc5)](_0x25dc86[_0x4bfb4f(0xee)],SKILL_FILE))return undefined;for(const [_0x3c92d5,_0x4624c6]of Object[_0x4bfb4f(0xe7)](_0x25dc86['fileHashes'])){if(!/^[a-f0-9]{64}$/[_0x4bfb4f(0xf0)](_0x4624c6))return undefined;const _0x16148c=resolveManagedFilePath(_0x150698,_0x3c92d5);if(!existsSync(_0x16148c)||!lstatSync(_0x16148c)[_0x4bfb4f(0xe9)]())return undefined;if(bufferSha256(readFileSync(_0x16148c))!==_0x4624c6)return undefined;}return{'skill':_0x346ac5,'scope':_0x586d28,'dir':_0x150698,'skillMdPath':_0x210120,'metadataPath':_0x192d40,'contentHash':_0x25dc86[_0x4bfb4f(0xd8)],'changed':![]};}function withMaterializedSkillFrontmatter(_0x4553f5,_0x1a3ae6,_0x1515ed){const _0x310751=a145_0x5b6c,_0xf6da6a=skillDisplayName(_0x1a3ae6,_0x1515ed),_0x19a3a4=_0x1a3ae6[_0x310751(0xf4)]?.[_0x310751(0xdb)]()||_0xf6da6a||_0x1515ed;return normalizeLocalFiles(_0x4553f5)[_0x310751(0xdd)](_0x2abd46=>{const _0x2ad73c=_0x310751,_0x5323b3=fileText(_0x2abd46);if(_0x2abd46['path']!==SKILL_FILE)return _0x2abd46;if(hasYamlFrontmatter(_0x5323b3))return{'path':_0x2abd46[_0x2ad73c(0xc0)],'content':withSyncedDisplayName(_0x5323b3,_0xf6da6a)};return{'path':_0x2abd46[_0x2ad73c(0xc0)],'content':prependSkillFrontmatter(_0x5323b3,{'name':_0x1515ed,'displayName':_0xf6da6a,'description':_0x19a3a4})};});}function hasYamlFrontmatter(_0x2d6700){return/^\uFEFF?---\s*\r?\n/['test'](_0x2d6700);}function prependSkillFrontmatter(_0x4a6367,_0x5ab98e){const _0x1f6c6a=a145_0x5b6c,_0x2c0f33=_0x4a6367[_0x1f6c6a(0xd6)](/^\uFEFF/,'');return[_0x1f6c6a(0xea),_0x1f6c6a(0xbe)+yamlString(_0x5ab98e['name']),_0x5ab98e[_0x1f6c6a(0xce)]?_0x1f6c6a(0xda)+yamlString(_0x5ab98e[_0x1f6c6a(0xce)]):undefined,_0x1f6c6a(0xdc)+yamlString(_0x5ab98e[_0x1f6c6a(0xf4)]),_0x1f6c6a(0xea),'',_0x2c0f33][_0x1f6c6a(0xc6)](_0x2ba8c7=>_0x2ba8c7!==undefined)[_0x1f6c6a(0xd3)]('\x0a');}function yamlString(_0x45f66f){const _0x4a29d8=a145_0x5b6c;return JSON[_0x4a29d8(0xf6)](_0x45f66f[_0x4a29d8(0xd6)](/\r/g,'')[_0x4a29d8(0xdb)]());}function skillDisplayName(_0x489338,_0x300612){const _0x9cdec6=a145_0x5b6c,_0x2c1e0a=_0x489338['skillName']?.[_0x9cdec6(0xdb)]();return _0x2c1e0a||_0x300612;}function withSyncedDisplayName(_0x862b63,_0x3b5b30){const _0x587328=a145_0x5b6c,_0x2fae13=_0x862b63[_0x587328(0xe0)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x2fae13)return _0x862b63;const _0x5dc375=_0x2fae13[0x1]??'',_0x1aa7ef=_0x2fae13[0x2]??'',_0xe0ad91=parseDocument(_0x1aa7ef);if(_0xe0ad91['errors']['length']>0x0||!isMap(_0xe0ad91['contents']))return _0x862b63;if(_0x3b5b30)_0xe0ad91[_0x587328(0xca)]('displayName',_0x3b5b30);else{if(_0xe0ad91[_0x587328(0xed)]('displayName'))_0xe0ad91[_0x587328(0xc4)](_0x587328(0xce));else return _0x862b63;}forceBlockCollections(_0xe0ad91[_0x587328(0xef)]);const _0x1f9cc1=_0xe0ad91['toString']({'lineWidth':0x0})[_0x587328(0xde)](),_0x503cfb=_0x862b63[_0x587328(0xe1)](_0x2fae13[0x0][_0x587328(0xd4)])[_0x587328(0xd6)](/^\r?\n/,'');return _0x5dc375+'---\x0a'+_0x1f9cc1+_0x587328(0xe2)+_0x503cfb;}function forceBlockCollections(_0x5df788){if(!isNode(_0x5df788))return;visit(_0x5df788,(_0xa3ad0b,_0xb99adb)=>{isCollection(_0xb99adb)&&(_0xb99adb['flow']=![]);});}function ensurePulledFilesCanBeOverwritten(_0x430eb8,_0x5e76c9,_0x4e8e56,_0x2f314c){const _0x2d3235=a145_0x5b6c;if(_0x2f314c||!existsSync(_0x5e76c9))return;const _0x69ce24=readMetadataIfPresent(_0x5e76c9);if(!_0x69ce24)return;const _0x5bed25=_0x69ce24[_0x2d3235(0xee)]&&Object[_0x2d3235(0xd0)](_0x69ce24[_0x2d3235(0xee)])['length']>0x0?_0x69ce24['fileHashes']:undefined;if(_0x5bed25)for(const [_0x2b65fe,_0x39c014]of Object['entries'](_0x5bed25)){const _0x364559=resolveManagedFilePath(_0x430eb8,_0x2b65fe);if(!existsSync(_0x364559))throw CliErrors[_0x2d3235(0xf7)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x430eb8,'Managed\x20file\x20was\x20removed\x20locally:\x20'+_0x2b65fe);const _0x40e6cd=lstatSync(_0x364559);if(!_0x40e6cd[_0x2d3235(0xe9)]())throw CliErrors[_0x2d3235(0xf7)](_0x2d3235(0xc8)+_0x430eb8,'Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20'+_0x2b65fe);const _0x360f81=bufferSha256(readFileSync(_0x364559));if(_0x360f81!==_0x39c014)throw CliErrors[_0x2d3235(0xf7)](_0x2d3235(0xc8)+_0x430eb8+_0x2d3235(0xd2)+_0x2b65fe,_0x2d3235(0xf3)+_0x2b65fe);}else{const _0x2cfc11=resolve(_0x430eb8,SKILL_FILE);if(existsSync(_0x2cfc11)&&_0x69ce24[_0x2d3235(0xd8)]){const _0x17530d=contentHash(readFileSync(_0x2cfc11,_0x2d3235(0xc2)));if(_0x17530d!==_0x69ce24['contentHash'])throw CliErrors['validation'](_0x2d3235(0xe4)+_0x2cfc11,_0x2d3235(0xc7));}}for(const _0x12addc of normalizeLocalFiles(_0x4e8e56)){if(_0x5bed25?.[_0x12addc[_0x2d3235(0xc0)]])continue;if(!_0x5bed25&&_0x12addc['path']===SKILL_FILE)continue;const _0x2c91d2=resolveManagedFilePath(_0x430eb8,_0x12addc['path']);if(!existsSync(_0x2c91d2))continue;const _0x1b50df=lstatSync(_0x2c91d2);if(!_0x1b50df[_0x2d3235(0xe9)]())throw CliErrors[_0x2d3235(0xf7)](_0x2d3235(0xc8)+_0x430eb8,_0x2d3235(0xcc)+_0x12addc[_0x2d3235(0xc0)]);const _0x38393e=bufferSha256(readFileSync(_0x2c91d2));if(_0x38393e!==fileHash(_0x12addc))throw CliErrors[_0x2d3235(0xf7)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x430eb8,_0x2d3235(0xf2)+_0x12addc[_0x2d3235(0xc0)]);}}function materializeFiles(_0x3bce04,_0x1fd692){for(const _0x6c731e of normalizeLocalFiles(_0x1fd692)){const _0x64aec4=resolveManagedFilePath(_0x3bce04,_0x6c731e['path']);mkdirSync(dirname(_0x64aec4),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x64aec4,fileContent(_0x6c731e),0x180);}}function a145_0x1202(){const _0x212a4b=['2089575VWbEYc','keys','3198307hMsLYr','.\x20Changed\x20file:\x20','join','length','3233874HLzATQ','replace','packageBytes','contentHash','4267690isfUVu','displayName:\x20','trim','description:\x20','map','trimEnd','status','match','slice','\x0a---\x0a\x0a','example','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','pulledAt','scope','entries','skillName','isFile','---','schemaVersion','8oNYTbA','has','fileHashes','contents','test','paths','Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','description','env','stringify','validation','Runtime\x20Skill\x20package\x20is\x20missing\x20','name:\x20','find','path','3027424DzuSfi','utf8','version','delete','hasOwn','filter','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','appCode','set','160239wYCaef','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','1119580ZvCKNi','displayName'];a145_0x1202=function(){return _0x212a4b;};return a145_0x1202();}function removeStaleManagedFiles(_0x164e03,_0x246312,_0x2b8b55){const _0x4b6a8c=a145_0x5b6c;if(!_0x246312)return;const _0xc0d7af=new Set(normalizeLocalFiles(_0x2b8b55)[_0x4b6a8c(0xdd)](_0x1b7082=>_0x1b7082['path']));for(const _0x25f1e5 of Object['keys'](_0x246312)){if(_0xc0d7af[_0x4b6a8c(0xed)](_0x25f1e5))continue;const _0x119287=resolveManagedFilePath(_0x164e03,_0x25f1e5);existsSync(_0x119287)&&lstatSync(_0x119287)[_0x4b6a8c(0xe9)]()&&rmSync(_0x119287,{'force':!![]});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x29caa8,_0xc27bc3){const _0x1d0c5f=a146_0x1bbe,_0x14be6d=_0x29caa8();while(!![]){try{const _0x5e5706=-parseInt(_0x1d0c5f(0x11a))/0x1+-parseInt(_0x1d0c5f(0x13c))/0x2+-parseInt(_0x1d0c5f(0x11b))/0x3+-parseInt(_0x1d0c5f(0x137))/0x4*(-parseInt(_0x1d0c5f(0x13d))/0x5)+-parseInt(_0x1d0c5f(0x12e))/0x6+-parseInt(_0x1d0c5f(0x12a))/0x7*(-parseInt(_0x1d0c5f(0x11f))/0x8)+parseInt(_0x1d0c5f(0x133))/0x9;if(_0x5e5706===_0xc27bc3)break;else _0x14be6d['push'](_0x14be6d['shift']());}catch(_0x4d4c3a){_0x14be6d['push'](_0x14be6d['shift']());}}}(a146_0x500c,0xd72b9));import{existsSync,readFileSync}from'node:fs';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';import{fileContent,normalizeLocalFiles}from'./local-files.js';function a146_0x500c(){const _0x909191=['40972041NTuJyr','example','toISOString','personal','4804xZoCJY','files','version','trim','zipSha256','2788372mYgeUF','370phMFtN','userId','length','map','validation','1740241PApHLs','4826205fVzXqY','Invalid\x20','object','sourceSessionId','38088HrWSHP','manifest','hasUpstreamUpdate','string','tags','forkedFromSkillId','zipSize','description','isArray','utf8','Runtime\x20Skill\x20is\x20missing\x20skillCode.','2030hGqioX','tenantCode','parse','skillCode','2385084Wnevcv','ossPath','skillName','status','path'];a146_0x500c=function(){return _0x909191;};return a146_0x500c();}import{buildSkillPackage,localFilesToManifestFiles}from'./zip-package.js';export function buildMetadata(_0x21d496,_0x8a6f82,_0x2287ef,_0x286f29,_0x173375,_0x1e4cf8,_0x4cf9cb){const _0x4ae36a=a146_0x1bbe,_0x515e5c=_0x1e4cf8?normalizeLocalFiles(_0x1e4cf8):[],_0x34dc96=!_0x4cf9cb&&_0x515e5c[_0x4ae36a(0x117)]>0x0?buildSkillPackage(_0x515e5c):undefined,_0x37d923=_0x4cf9cb?bufferSha256(_0x4cf9cb):_0x34dc96?.[_0x4ae36a(0x120)][_0x4ae36a(0x13b)],_0x59b3e6=_0x4cf9cb?.[_0x4ae36a(0x117)]??_0x34dc96?.[_0x4ae36a(0x120)][_0x4ae36a(0x125)],_0x3c501e=_0x515e5c[_0x4ae36a(0x117)]>0x0?Object['fromEntries'](_0x515e5c['map'](_0x382579=>[_0x382579[_0x4ae36a(0x132)],fileHash(_0x382579)])):undefined;return{'schemaVersion':_0x515e5c[_0x4ae36a(0x117)]>0x0?0x2:0x1,'id':_0x21d496['id'],'appCode':_0x2287ef,'skillCode':requireSkillCode(_0x21d496),'skillName':_0x21d496[_0x4ae36a(0x130)],'description':_0x21d496[_0x4ae36a(0x126)],'example':_0x21d496[_0x4ae36a(0x134)],'scope':_0x8a6f82,'readonly':_0x8a6f82!==_0x4ae36a(0x136)||_0x21d496['readonly']===!![],'tenantCode':_0x21d496[_0x4ae36a(0x12b)],'userId':_0x21d496[_0x4ae36a(0x116)],'version':_0x21d496[_0x4ae36a(0x139)],'status':_0x21d496[_0x4ae36a(0x131)],'tags':Array[_0x4ae36a(0x127)](_0x21d496[_0x4ae36a(0x123)])?_0x21d496[_0x4ae36a(0x123)]:[],'hasUpstreamUpdate':_0x21d496[_0x4ae36a(0x121)],'forkedFromSkillId':_0x21d496[_0x4ae36a(0x124)],'forkedFromVersion':_0x21d496['forkedFromVersion'],'sourceSessionId':_0x21d496[_0x4ae36a(0x11e)],'contentHash':_0x286f29,'fileHashes':_0x3c501e,'treeHash':_0x515e5c[_0x4ae36a(0x117)]>0x0?fileTreeHash(localFilesToManifestFiles(_0x515e5c)):undefined,'ossPath':remoteManifestOssPath(_0x21d496[_0x4ae36a(0x138)]),'zipSha256':_0x37d923,'zipSize':_0x59b3e6,'files':_0x515e5c[_0x4ae36a(0x117)]>0x0?_0x515e5c[_0x4ae36a(0x118)](_0x1c0226=>({'path':_0x1c0226['path'],'hash':fileHash(_0x1c0226),'size':fileContent(_0x1c0226)['length']})):undefined,'pulledAt':_0x173375??new Date()[_0x4ae36a(0x135)]()};}function a146_0x1bbe(_0x356c80,_0x19c3eb){_0x356c80=_0x356c80-0x116;const _0x500c2c=a146_0x500c();let _0x1bbea3=_0x500c2c[_0x356c80];return _0x1bbea3;}export function requireSkillCode(_0x20430d){const _0xcc1074=a146_0x1bbe,_0x4856bb=_0x20430d[_0xcc1074(0x12d)]?.[_0xcc1074(0x13a)]();if(!_0x4856bb)throw CliErrors[_0xcc1074(0x119)](_0xcc1074(0x129));return _0x4856bb;}export function readMetadataIfPresent(_0xe5a491){const _0x40eff4=a146_0x1bbe;if(!existsSync(_0xe5a491))return undefined;try{const _0x4cf324=JSON[_0x40eff4(0x12c)](readFileSync(_0xe5a491,_0x40eff4(0x128)));return _0x4cf324;}catch{throw CliErrors[_0x40eff4(0x119)](_0x40eff4(0x11c)+METADATA_FILE+':\x20'+_0xe5a491);}}function remoteManifestOssPath(_0x220cfe){const _0x56cc98=a146_0x1bbe;if(!_0x220cfe||typeof _0x220cfe!==_0x56cc98(0x11d)||Array[_0x56cc98(0x127)](_0x220cfe))return undefined;const _0x567643=_0x220cfe[_0x56cc98(0x12f)];return typeof _0x567643===_0x56cc98(0x122)&&_0x567643['trim']()?_0x567643[_0x56cc98(0x13a)]():undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a147_0x457229=a147_0x5354;(function(_0x275d83,_0x5cf9ed){const _0x13e6e0=a147_0x5354,_0x528051=_0x275d83();while(!![]){try{const _0x30be68=parseInt(_0x13e6e0(0xa0))/0x1*(parseInt(_0x13e6e0(0x9c))/0x2)+-parseInt(_0x13e6e0(0x8f))/0x3+parseInt(_0x13e6e0(0x8e))/0x4+-parseInt(_0x13e6e0(0x9a))/0x5*(parseInt(_0x13e6e0(0x90))/0x6)+-parseInt(_0x13e6e0(0xa6))/0x7*(parseInt(_0x13e6e0(0x8a))/0x8)+parseInt(_0x13e6e0(0x97))/0x9*(-parseInt(_0x13e6e0(0xa5))/0xa)+-parseInt(_0x13e6e0(0x96))/0xb*(-parseInt(_0x13e6e0(0x9b))/0xc);if(_0x30be68===_0x5cf9ed)break;else _0x528051['push'](_0x528051['shift']());}catch(_0x57c9d1){_0x528051['push'](_0x528051['shift']());}}}(a147_0x3926,0x3383e));import{existsSync}from'node:fs';import{homedir}from'node:os';import{resolve}from'node:path';function a147_0x5354(_0xf5fb53,_0x3d4deb){_0xf5fb53=_0xf5fb53-0x88;const _0x3926a0=a147_0x3926();let _0x5354db=_0x3926a0[_0xf5fb53];return _0x5354db;}import{fingerprintAccessKey}from'../../commands/app/cache.js';import{PRODUCT_CONFIG,productEnv}from'../../constant/product.js';import{CliErrors}from'../../errors.js';function a147_0x3926(){const _0x1a532a=['path\x20segment','.workbuddy','3385BsyIrL','11570868lzpZGs','4WWyLNz','claudeSkillsDir','CLAUDE_SKILL_ROOT','cacheRoot','117118LnNtFf','cache','workbuddySkillsDir','skillCode','trim','2179790XzdZfe','7AKPNbn','\x20for\x20local\x20path:\x20','filter','1529968SXSpJI','agentsSkillsDir','Unsafe\x20','.claude','481032RklIpg','994704mVHPDP','3252pMTeoD','homeDir','.agents','homeDirName','skills','includes','11qWYgWR','9wSyfUs'];a147_0x3926=function(){return _0x1a532a;};return a147_0x3926();}export function resolveSkillSyncPaths(_0x17445a={}){const _0x391323=a147_0x5354,_0x135dd9=_0x17445a[_0x391323(0x91)]??homedir(),_0x1b55d7=resolve(_0x135dd9,PRODUCT_CONFIG[_0x391323(0x93)],_0x391323(0xa1)),_0x4ede33=trimmedEnv('SKILL_ROOT'),_0x564805=trimmedEnv(_0x391323(0x9e)),_0x45469d=resolve(_0x135dd9,_0x391323(0x99)),_0x3187a7=_0x17445a[_0x391323(0xa2)]??(existsSync(_0x45469d)?resolve(_0x45469d,_0x391323(0x94)):undefined);return{'homeDir':_0x135dd9,'cacheRoot':_0x1b55d7,'managedRoot':resolve(_0x135dd9,PRODUCT_CONFIG['homeDirName']),'agentsSkillsDir':_0x17445a[_0x391323(0x8b)]??_0x4ede33??resolve(_0x135dd9,_0x391323(0x92),'skills'),'claudeSkillsDir':_0x17445a[_0x391323(0x9d)]??_0x564805??resolve(_0x135dd9,_0x391323(0x8d),'skills'),'workbuddySkillsDir':_0x3187a7};}export function runtimeAgentSkillRoots(_0x4dfe08){const _0x4d432f=a147_0x5354;return[_0x4dfe08[_0x4d432f(0x8b)],_0x4dfe08['claudeSkillsDir'],_0x4dfe08[_0x4d432f(0xa2)]][_0x4d432f(0x89)](_0x412b8f=>Boolean(_0x412b8f));}export function getRuntimeSkillCacheRoot(_0x16ccd0,_0x478c1b,_0x5a2a12={}){const _0x4ee97d=a147_0x5354,_0x25e5f0=resolveSkillSyncPaths(_0x5a2a12);return resolve(_0x25e5f0[_0x4ee97d(0x9f)],_0x16ccd0,fingerprintAccessKey(_0x478c1b),'skills');}export function getRuntimeSkillDir(_0x35ad76,_0xd77e8d,_0x562323,_0x439248,_0x15ddb9,_0x2b17c4={}){const _0x95c3ec=a147_0x5354;return resolve(getRuntimeSkillCacheRoot(_0x35ad76,_0xd77e8d,_0x2b17c4),safePathSegment(_0x562323,'appCode'),_0x439248,safePathSegment(_0x15ddb9,_0x95c3ec(0xa3)));}export function safePathSegment(_0x4f6ffe,_0x4a08e0=a147_0x457229(0x98)){const _0x139059=a147_0x457229;if(!_0x4f6ffe||_0x4f6ffe[_0x139059(0x95)]('/')||_0x4f6ffe[_0x139059(0x95)]('\x5c')||_0x4f6ffe[_0x139059(0x95)]('..'))throw CliErrors['validation'](_0x139059(0x8c)+_0x4a08e0+_0x139059(0x88)+_0x4f6ffe);return _0x4f6ffe;}function trimmedEnv(_0x59e2a3){const _0x102c24=a147_0x457229,_0x5047d2=productEnv(_0x59e2a3)?.[_0x102c24(0xa4)]();return _0x5047d2?_0x5047d2:undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x429b4f,_0x306569){const _0x18e0d3=a147_0x23da,_0x36b0bb=_0x429b4f();while(!![]){try{const _0x133f95=-parseInt(_0x18e0d3(0x198))/0x1+parseInt(_0x18e0d3(0x1bd))/0x2*(-parseInt(_0x18e0d3(0x1ae))/0x3)+-parseInt(_0x18e0d3(0x195))/0x4+-parseInt(_0x18e0d3(0x1a8))/0x5*(parseInt(_0x18e0d3(0x192))/0x6)+parseInt(_0x18e0d3(0x1bf))/0x7*(-parseInt(_0x18e0d3(0x18c))/0x8)+-parseInt(_0x18e0d3(0x19b))/0x9+parseInt(_0x18e0d3(0x1aa))/0xa;if(_0x133f95===_0x306569)break;else _0x36b0bb['push'](_0x36b0bb['shift']());}catch(_0x3695df){_0x36b0bb['push'](_0x36b0bb['shift']());}}}(a147_0xd692,0x73390));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';function a147_0xd692(){const _0x4de45e=['refreshedAt','description','files','24YLayEN','skillCode','Invalid\x20','ignoreInvalidMetadata','match','tags','539862ofaKLS','string','scope','3261576cBLErz','\x20has\x20unsupported\x20scope\x20\x22','validation','371676EifnRt','find','skillName','7465104HVjNCL','slice','isArray','content','length','example','toLowerCase','replace','targetScope','filter','excludedFilePaths','unknown','ignoreMetadataAppCodeMismatch','35PPhMxc','Skill\x20directory\x20not\x20found:\x20','46360600nVxvmr','number','some','path','51636RxvIcc','sourceSessionId','personal','isFile','dir','isDirectory','boolean','Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20','(unknown)','pushedAt','builtin','utf8','Unable\x20to\x20resolve\x20skillCode\x20from\x20','displayName','company','104xDWRKd','appCode','1453011TQVijt','ignoreMetadataScope','Remote\x20Skill\x20','ignoreMetadataForPayload','Missing\x20','packageBase64','\x20to\x20submit\x20company\x20Skills\x20for\x20review.','version','manifest',',\x20or\x20directory\x20name.','trim','\x20has\x20scope=\x22','metadata'];a147_0xd692=function(){return _0x4de45e;};return a147_0xd692();}import{basename,resolve}from'node:path';function a147_0x23da(_0x4b78d8,_0x204a5e){_0x4b78d8=_0x4b78d8-0x18b;const _0xd69209=a147_0xd692();let _0x23daba=_0xd69209[_0x4b78d8];return _0x23daba;}import{parse as a147_0x56441c}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(_0x1a99d8,_0x49cfc4,_0x3a8839={}){const _0x575dcd=a147_0x23da,_0x4a532e=resolvePushDirectoryRoot(_0x1a99d8),_0x381344=readPushMetadataIfPresent(resolve(_0x4a532e,METADATA_FILE),{'ignoreInvalidMetadata':_0x3a8839['ignoreInvalidMetadata']});if(_0x381344?.[_0x575dcd(0x1be)]&&_0x381344[_0x575dcd(0x1be)]!==_0x49cfc4&&!_0x3a8839['allowAppCodeRetarget']&&!_0x3a8839[_0x575dcd(0x1a7)])throw CliErrors[_0x575dcd(0x197)]('Skill\x20metadata\x20appCode\x20\x22'+_0x381344[_0x575dcd(0x1be)]+'\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22'+_0x49cfc4+'\x22.');const _0x1743fb=resolvePushSkillCode(_0x4a532e,_0x49cfc4,_0x381344,_0x3a8839);if(!_0x1743fb)throw CliErrors[_0x575dcd(0x197)](_0x575dcd(0x1ba)+SKILL_FILE+',\x20'+METADATA_FILE+_0x575dcd(0x1c8));return{'dir':_0x4a532e,'skillCode':_0x1743fb,'metadata':_0x381344};}export function readPushDirectory(_0x127bf1,_0x21b46f,_0x16cd7a={}){const _0x34d795=a147_0x23da,_0x2d9e3a=resolvePushDirectoryIdentity(_0x127bf1,_0x21b46f,_0x16cd7a),_0x47a942=_0x2d9e3a[_0x34d795(0x1b2)],_0x44b108=resolve(_0x47a942,SKILL_FILE);if(!existsSync(_0x44b108)||!lstatSync(_0x44b108)[_0x34d795(0x1b1)]())throw CliErrors['validation'](_0x34d795(0x1c3)+SKILL_FILE+':\x20'+_0x44b108);const _0x542d94=_0x2d9e3a[_0x34d795(0x1cb)],_0x1f5669=_0x16cd7a[_0x34d795(0x1a3)]??_0x34d795(0x1b0);if(!_0x16cd7a[_0x34d795(0x1c0)]&&_0x542d94?.[_0x34d795(0x194)]==='builtin')throw CliErrors[_0x34d795(0x197)](_0x34d795(0x1b5)+METADATA_FILE+_0x34d795(0x1ca)+_0x542d94[_0x34d795(0x194)]+'\x22.');if(!_0x16cd7a[_0x34d795(0x1c0)]&&_0x1f5669===_0x34d795(0x1b0)&&_0x542d94?.[_0x34d795(0x194)]&&_0x542d94['scope']!==_0x34d795(0x1b0))throw CliErrors[_0x34d795(0x197)]('Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20'+METADATA_FILE+_0x34d795(0x1ca)+_0x542d94[_0x34d795(0x194)]+'\x22.','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20'+_0x47a942+_0x34d795(0x1c5));const _0x15a341=scanSkillDirectory(_0x47a942,{'excludedFilePaths':_0x16cd7a[_0x34d795(0x1a5)]}),_0x249d52=buildSkillPackage(_0x15a341),_0x19647b=readFileSync(_0x44b108,'utf8'),_0x4614da=_0x2d9e3a[_0x34d795(0x18d)],_0x408fc0=_0x16cd7a[_0x34d795(0x1c2)]?undefined:_0x542d94,_0x3cc065=readSkillDisplayName(_0x19647b);return{'skillCode':_0x4614da,'metadata':_0x542d94,'frontmatterDisplayName':_0x3cc065,'input':{'skillCode':_0x4614da,'skillName':_0x3cc065??_0x408fc0?.[_0x34d795(0x19a)],'description':_0x408fc0?.[_0x34d795(0x1cd)],'content':_0x19647b,'files':_0x249d52[_0x34d795(0x1c7)],'packageBase64':_0x249d52[_0x34d795(0x1c4)],'tags':_0x408fc0?.[_0x34d795(0x191)],'version':_0x408fc0?.[_0x34d795(0x1c6)],'sourceSessionId':_0x408fc0?.['sourceSessionId']}};}export function refreshPushDirectoryMetadataFromRemote(_0x157c63,_0x128503,_0x38bad9,_0x20da56={}){const _0x7aa8ad=a147_0x23da,_0x1f9e78=resolvePushDirectoryRoot(_0x157c63),_0x108ce4=readPushMetadataIfPresent(resolve(_0x1f9e78,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x27f606=requireRemoteScope(_0x128503),_0x60e458=readLocalSkillContent(_0x1f9e78),_0x37b451={..._0x128503,'appCode':_0x128503[_0x7aa8ad(0x1be)]??_0x38bad9,'skillName':_0x128503[_0x7aa8ad(0x19a)]??_0x108ce4?.['skillName'],'description':_0x128503[_0x7aa8ad(0x1cd)]??_0x108ce4?.[_0x7aa8ad(0x1cd)],'example':_0x128503['example']??_0x108ce4?.[_0x7aa8ad(0x1a0)],'tags':Array[_0x7aa8ad(0x19d)](_0x128503['tags'])?_0x128503[_0x7aa8ad(0x191)]:_0x108ce4?.[_0x7aa8ad(0x191)],'sourceSessionId':_0x128503[_0x7aa8ad(0x1af)]??_0x108ce4?.[_0x7aa8ad(0x1af)],'content':_0x128503[_0x7aa8ad(0x19e)]??_0x60e458},_0xbe0b23=buildMetadata(_0x37b451,_0x27f606,_0x38bad9,contentHash(_0x60e458),_0x20da56[_0x7aa8ad(0x1cc)]);writeJsonAtomic(resolve(_0x1f9e78,METADATA_FILE),_0xbe0b23);}export function recordPushedRuntimeSkill(_0x41ad31,_0x1f1d6a,_0x2c780b,_0x5ee49d={}){const _0x1cef35=a147_0x23da,_0x26ca84=resolvePushDirectoryRoot(_0x41ad31),_0x2e2fe0=scanSkillDirectory(_0x26ca84),_0x20bc38=_0x2e2fe0[_0x1cef35(0x199)](_0xfe1eda=>_0xfe1eda[_0x1cef35(0x1ad)]===SKILL_FILE),_0x4c2bb1=_0x20bc38?fileText(_0x20bc38):'',_0x2b3525=tryNormalizePackageManifest(_0x1f1d6a[_0x1cef35(0x18b)]),_0x5017c8={..._0x1f1d6a,'content':_0x1f1d6a[_0x1cef35(0x19e)]??_0x4c2bb1,'files':_0x2b3525},_0x20435e=_0x2b3525?normalizeLocalFiles(_0x2e2fe0)[_0x1cef35(0x1a4)](_0x377886=>_0x2b3525[_0x1cef35(0x18b)][_0x1cef35(0x1ac)](_0x6db4c0=>_0x6db4c0[_0x1cef35(0x1ad)]===_0x377886['path'])):undefined,_0x3e1e21=buildMetadata(_0x5017c8,_0x5ee49d['scope']??_0x1cef35(0x1b0),_0x2c780b,contentHash(_0x5017c8[_0x1cef35(0x19e)]??''),_0x5ee49d[_0x1cef35(0x1b7)],_0x20435e);writeJsonAtomic(resolve(_0x26ca84,METADATA_FILE),_0x3e1e21);}export function deriveSkillCodeFromDirectory(_0x359b88,_0x3cf2d5){const _0x4cf489=a147_0x23da,_0xab6d05=basename(resolve(_0x359b88)),_0x65910=_0x3cf2d5+'--';return _0xab6d05['startsWith'](_0x65910)?_0xab6d05[_0x4cf489(0x19c)](_0x65910[_0x4cf489(0x19f)]):_0xab6d05;}function resolvePushSkillCode(_0x92769c,_0x21e144,_0x4392bb,_0x56f250){const _0x188396=a147_0x23da,_0x4d0c29=deriveSkillCodeFromSkillFile(_0x92769c)||deriveSkillCodeFromDirectory(_0x92769c,_0x21e144);if(_0x56f250['ignoreMetadataSkillCode'])return _0x4d0c29;return _0x4392bb?.[_0x188396(0x18d)]?.[_0x188396(0x1c9)]()||_0x4d0c29;}function deriveSkillCodeFromSkillFile(_0x70c97d){const _0x216955=a147_0x23da,_0x5a7d7f=resolve(_0x70c97d,SKILL_FILE);if(!existsSync(_0x5a7d7f)||!lstatSync(_0x5a7d7f)[_0x216955(0x1b1)]())return undefined;const _0x38c28d=readFileSync(_0x5a7d7f,'utf8'),_0xdd946d=_0x38c28d[_0x216955(0x190)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0xdd946d)return undefined;const _0x13be12=parseFrontmatterObject(_0xdd946d[0x1]??''),_0x2b5962=scalarToString(_0x13be12?.['name']);return _0x2b5962?slugifySkillName(_0x2b5962):undefined;}function readSkillDisplayName(_0x20b620){const _0x5627a7=a147_0x23da,_0x200846=_0x20b620[_0x5627a7(0x190)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x200846)return undefined;const _0x3ad882=parseFrontmatterObject(_0x200846[0x1]??'');return scalarToString(_0x3ad882?.[_0x5627a7(0x1bb)]);}function slugifySkillName(_0x1c787c){const _0x562ea0=a147_0x23da,_0x45c15c=_0x1c787c[_0x562ea0(0x1c9)]()[_0x562ea0(0x1a1)]()[_0x562ea0(0x1a2)](/[^\p{L}\p{N}\p{So}]+/gu,'-')[_0x562ea0(0x1a2)](/^-+/,'')['replace'](/-+$/,'')[_0x562ea0(0x1a2)](/-{2,}/g,'-');if(!_0x45c15c)throw CliErrors[_0x562ea0(0x197)](_0x562ea0(0x18e)+SKILL_FILE+'\x20name\x20for\x20SkillHub\x20slug\x20generation.');return _0x45c15c;}function parseFrontmatterObject(_0xe1dfcc){const _0xccdb12=a147_0x23da;try{const _0xde4ae8=a147_0x56441c(_0xe1dfcc);return _0xde4ae8&&typeof _0xde4ae8==='object'&&!Array[_0xccdb12(0x19d)](_0xde4ae8)?_0xde4ae8:undefined;}catch{return undefined;}}function scalarToString(_0x1125bd){const _0x4421d2=a147_0x23da;if(typeof _0x1125bd===_0x4421d2(0x193))return _0x1125bd[_0x4421d2(0x1c9)]();if(typeof _0x1125bd===_0x4421d2(0x1ab)||typeof _0x1125bd===_0x4421d2(0x1b4))return String(_0x1125bd);return undefined;}function resolvePushDirectoryRoot(_0x10f6f4){const _0x59738c=a147_0x23da,_0x56ad5a=resolve(_0x10f6f4);if(!existsSync(_0x56ad5a))throw CliErrors[_0x59738c(0x197)](_0x59738c(0x1a9)+_0x10f6f4);const _0x173c30=lstatSync(_0x56ad5a);if(_0x173c30[_0x59738c(0x1b3)]())return _0x56ad5a;if(_0x173c30['isSymbolicLink']()){const _0x20953c=realpathSync(_0x56ad5a);if(lstatSync(_0x20953c)['isDirectory']())return _0x20953c;}throw CliErrors['validation'](_0x59738c(0x1a9)+_0x10f6f4);}function requireRemoteScope(_0x43a255){const _0x3b0126=a147_0x23da;if(_0x43a255[_0x3b0126(0x194)]===_0x3b0126(0x1b0)||_0x43a255[_0x3b0126(0x194)]===_0x3b0126(0x1bc)||_0x43a255[_0x3b0126(0x194)]===_0x3b0126(0x1b8))return _0x43a255[_0x3b0126(0x194)];throw CliErrors[_0x3b0126(0x197)](_0x3b0126(0x1c1)+(_0x43a255['skillCode']||_0x3b0126(0x1b6))+_0x3b0126(0x196)+(_0x43a255[_0x3b0126(0x194)]??_0x3b0126(0x1a6))+'\x22.');}function readLocalSkillContent(_0x1c110e){const _0x472798=a147_0x23da,_0x1ca8fb=resolve(_0x1c110e,SKILL_FILE);return existsSync(_0x1ca8fb)&&lstatSync(_0x1ca8fb)[_0x472798(0x1b1)]()?readFileSync(_0x1ca8fb,_0x472798(0x1b9)):'';}function readPushMetadataIfPresent(_0x2d85a9,_0x21a725={}){const _0x581d00=a147_0x23da;try{return readMetadataIfPresent(_0x2d85a9);}catch(_0x313582){if(_0x21a725[_0x581d00(0x18f)])return undefined;throw _0x313582;}}
|
|
1
|
+
(function(_0x21d7b4,_0x91d6f6){const _0x39f189=a148_0x5067,_0x8a1d7d=_0x21d7b4();while(!![]){try{const _0x18ba11=parseInt(_0x39f189(0x1a7))/0x1*(parseInt(_0x39f189(0x1d0))/0x2)+parseInt(_0x39f189(0x1c7))/0x3*(parseInt(_0x39f189(0x1c5))/0x4)+parseInt(_0x39f189(0x1bc))/0x5+parseInt(_0x39f189(0x19f))/0x6+parseInt(_0x39f189(0x1b1))/0x7*(-parseInt(_0x39f189(0x1c8))/0x8)+parseInt(_0x39f189(0x1db))/0x9+-parseInt(_0x39f189(0x19c))/0xa;if(_0x18ba11===_0x91d6f6)break;else _0x8a1d7d['push'](_0x8a1d7d['shift']());}catch(_0x5bcdee){_0x8a1d7d['push'](_0x8a1d7d['shift']());}}}(a148_0x2075,0x7445b));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a148_0x2b34bd}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(_0xd366f,_0x7f369f,_0x2495b4={}){const _0x1b10ad=a148_0x5067,_0x2c36f9=resolvePushDirectoryRoot(_0xd366f),_0x309b27=readPushMetadataIfPresent(resolve(_0x2c36f9,METADATA_FILE),{'ignoreInvalidMetadata':_0x2495b4[_0x1b10ad(0x1cd)]});if(_0x309b27?.['appCode']&&_0x309b27['appCode']!==_0x7f369f&&!_0x2495b4[_0x1b10ad(0x1ac)]&&!_0x2495b4[_0x1b10ad(0x1c3)])throw CliErrors[_0x1b10ad(0x1ae)](_0x1b10ad(0x1dd)+_0x309b27[_0x1b10ad(0x1a3)]+_0x1b10ad(0x1da)+_0x7f369f+'\x22.');const _0x353e6a=resolvePushSkillCode(_0x2c36f9,_0x7f369f,_0x309b27,_0x2495b4);if(!_0x353e6a)throw CliErrors['validation']('Unable\x20to\x20resolve\x20skillCode\x20from\x20'+SKILL_FILE+',\x20'+METADATA_FILE+',\x20or\x20directory\x20name.');return{'dir':_0x2c36f9,'skillCode':_0x353e6a,'metadata':_0x309b27};}export function readPushDirectory(_0xa78a0f,_0x27952c,_0x4239de={}){const _0xa1f5b7=a148_0x5067,_0x10ca22=resolvePushDirectoryIdentity(_0xa78a0f,_0x27952c,_0x4239de),_0x26e084=_0x10ca22[_0xa1f5b7(0x1be)],_0x3ba27f=resolve(_0x26e084,SKILL_FILE);if(!existsSync(_0x3ba27f)||!lstatSync(_0x3ba27f)[_0xa1f5b7(0x1dc)]())throw CliErrors['validation']('Missing\x20'+SKILL_FILE+':\x20'+_0x3ba27f);const _0x29a69e=_0x10ca22[_0xa1f5b7(0x1c4)],_0x54d4c5=_0x4239de[_0xa1f5b7(0x19a)]??_0xa1f5b7(0x1cf);if(!_0x4239de[_0xa1f5b7(0x1b4)]&&_0x29a69e?.[_0xa1f5b7(0x1bb)]===_0xa1f5b7(0x1cb))throw CliErrors['validation'](_0xa1f5b7(0x1ca)+METADATA_FILE+_0xa1f5b7(0x1a4)+_0x29a69e[_0xa1f5b7(0x1bb)]+'\x22.');if(!_0x4239de[_0xa1f5b7(0x1b4)]&&_0x54d4c5===_0xa1f5b7(0x1cf)&&_0x29a69e?.[_0xa1f5b7(0x1bb)]&&_0x29a69e[_0xa1f5b7(0x1bb)]!==_0xa1f5b7(0x1cf))throw CliErrors[_0xa1f5b7(0x1ae)](_0xa1f5b7(0x1c1)+METADATA_FILE+'\x20has\x20scope=\x22'+_0x29a69e['scope']+'\x22.','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20'+_0x26e084+_0xa1f5b7(0x1ad));const _0x3d0378=scanSkillDirectory(_0x26e084,{'excludedFilePaths':_0x4239de[_0xa1f5b7(0x19b)]}),_0x74e3bf=buildSkillPackage(_0x3d0378),_0x2f2f3c=readFileSync(_0x3ba27f,_0xa1f5b7(0x1b3)),_0x387af1=_0x10ca22['skillCode'],_0x18bdea=_0x4239de['ignoreMetadataForPayload']?undefined:_0x29a69e,_0x3a7927=readSkillDisplayName(_0x2f2f3c);return{'skillCode':_0x387af1,'metadata':_0x29a69e,'frontmatterDisplayName':_0x3a7927,'input':{'skillCode':_0x387af1,'skillName':_0x3a7927??_0x18bdea?.[_0xa1f5b7(0x1bd)],'description':_0x18bdea?.[_0xa1f5b7(0x1b5)],'content':_0x2f2f3c,'files':_0x74e3bf[_0xa1f5b7(0x1af)],'packageBase64':_0x74e3bf[_0xa1f5b7(0x1b6)],'tags':_0x18bdea?.[_0xa1f5b7(0x1d4)],'version':_0x18bdea?.['version'],'sourceSessionId':_0x18bdea?.[_0xa1f5b7(0x1bf)]}};}function a148_0x5067(_0x3e6092,_0x2641ed){_0x3e6092=_0x3e6092-0x19a;const _0x20755b=a148_0x2075();let _0x50675a=_0x20755b[_0x3e6092];return _0x50675a;}export function refreshPushDirectoryMetadataFromRemote(_0x2daae2,_0x18cbc3,_0x248b00,_0x2d79bc={}){const _0x4176c0=a148_0x5067,_0x4fd5a4=resolvePushDirectoryRoot(_0x2daae2),_0x356d81=readPushMetadataIfPresent(resolve(_0x4fd5a4,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x54e0ff=requireRemoteScope(_0x18cbc3),_0x1334f5=readLocalSkillContent(_0x4fd5a4),_0xbb703c={..._0x18cbc3,'appCode':_0x18cbc3[_0x4176c0(0x1a3)]??_0x248b00,'skillName':_0x18cbc3[_0x4176c0(0x1bd)]??_0x356d81?.['skillName'],'description':_0x18cbc3['description']??_0x356d81?.['description'],'example':_0x18cbc3[_0x4176c0(0x1d7)]??_0x356d81?.[_0x4176c0(0x1d7)],'tags':Array['isArray'](_0x18cbc3[_0x4176c0(0x1d4)])?_0x18cbc3[_0x4176c0(0x1d4)]:_0x356d81?.[_0x4176c0(0x1d4)],'sourceSessionId':_0x18cbc3[_0x4176c0(0x1bf)]??_0x356d81?.[_0x4176c0(0x1bf)],'content':_0x18cbc3[_0x4176c0(0x1a2)]??_0x1334f5},_0x309288=buildMetadata(_0xbb703c,_0x54e0ff,_0x248b00,contentHash(_0x1334f5),_0x2d79bc[_0x4176c0(0x1a6)]);writeJsonAtomic(resolve(_0x4fd5a4,METADATA_FILE),_0x309288);}export function recordPushedRuntimeSkill(_0x31575a,_0xac9d71,_0x2e58d6,_0x45ad97={}){const _0x5da880=a148_0x5067,_0x2e4ecd=resolvePushDirectoryRoot(_0x31575a),_0x51e3a3=scanSkillDirectory(_0x2e4ecd),_0x2766a3=_0x51e3a3[_0x5da880(0x1a8)](_0x532c69=>_0x532c69[_0x5da880(0x1ba)]===SKILL_FILE),_0x12f42f=_0x2766a3?fileText(_0x2766a3):'',_0x55e4ee=tryNormalizePackageManifest(_0xac9d71[_0x5da880(0x1a0)]),_0x2a94fb={..._0xac9d71,'content':_0xac9d71['content']??_0x12f42f,'files':_0x55e4ee},_0x1f8094=_0x55e4ee?normalizeLocalFiles(_0x51e3a3)[_0x5da880(0x1b2)](_0x32dbd7=>_0x55e4ee['files']['some'](_0x1613c3=>_0x1613c3[_0x5da880(0x1ba)]===_0x32dbd7[_0x5da880(0x1ba)])):undefined,_0x98f99c=buildMetadata(_0x2a94fb,_0x45ad97[_0x5da880(0x1bb)]??_0x5da880(0x1cf),_0x2e58d6,contentHash(_0x2a94fb[_0x5da880(0x1a2)]??''),_0x45ad97[_0x5da880(0x1d1)],_0x1f8094);writeJsonAtomic(resolve(_0x2e4ecd,METADATA_FILE),_0x98f99c);}export function deriveSkillCodeFromDirectory(_0x42d0f4,_0x463838){const _0x1f0b2c=a148_0x5067,_0x268492=basename(resolve(_0x42d0f4)),_0x4b24ec=_0x463838+'--';return _0x268492[_0x1f0b2c(0x1aa)](_0x4b24ec)?_0x268492[_0x1f0b2c(0x1ce)](_0x4b24ec[_0x1f0b2c(0x1b0)]):_0x268492;}function resolvePushSkillCode(_0x47db4a,_0x368b61,_0x53b466,_0x3699e8){const _0x538076=a148_0x5067,_0x303c9b=deriveSkillCodeFromSkillFile(_0x47db4a)||deriveSkillCodeFromDirectory(_0x47db4a,_0x368b61);if(_0x3699e8[_0x538076(0x1b7)])return _0x303c9b;return _0x53b466?.[_0x538076(0x1a5)]?.[_0x538076(0x1c2)]()||_0x303c9b;}function deriveSkillCodeFromSkillFile(_0x19b564){const _0x5f33f7=a148_0x5067,_0x4b23fe=resolve(_0x19b564,SKILL_FILE);if(!existsSync(_0x4b23fe)||!lstatSync(_0x4b23fe)[_0x5f33f7(0x1dc)]())return undefined;const _0xb8c1d7=readFileSync(_0x4b23fe,_0x5f33f7(0x1b3)),_0x52e088=_0xb8c1d7['match'](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x52e088)return undefined;const _0x288e36=parseFrontmatterObject(_0x52e088[0x1]??''),_0x5d2a6e=scalarToString(_0x288e36?.[_0x5f33f7(0x1d8)]);return _0x5d2a6e?slugifySkillName(_0x5d2a6e):undefined;}function readSkillDisplayName(_0x379e70){const _0x1a7083=a148_0x5067,_0x5e8e38=_0x379e70['match'](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x5e8e38)return undefined;const _0x1b782a=parseFrontmatterObject(_0x5e8e38[0x1]??'');return scalarToString(_0x1b782a?.[_0x1a7083(0x1d2)]);}function slugifySkillName(_0x77e371){const _0x3bdb9e=a148_0x5067,_0x16d108=_0x77e371['trim']()[_0x3bdb9e(0x1a1)]()[_0x3bdb9e(0x1c6)](/[^\p{L}\p{N}\p{So}]+/gu,'-')['replace'](/^-+/,'')[_0x3bdb9e(0x1c6)](/-+$/,'')[_0x3bdb9e(0x1c6)](/-{2,}/g,'-');if(!_0x16d108)throw CliErrors['validation'](_0x3bdb9e(0x1d3)+SKILL_FILE+_0x3bdb9e(0x19d));return _0x16d108;}function parseFrontmatterObject(_0x3fccbb){const _0x402008=a148_0x5067;try{const _0xdc71c9=a148_0x2b34bd(_0x3fccbb);return _0xdc71c9&&typeof _0xdc71c9===_0x402008(0x1d5)&&!Array[_0x402008(0x1c0)](_0xdc71c9)?_0xdc71c9:undefined;}catch{return undefined;}}function scalarToString(_0x1ca0af){const _0x3f8692=a148_0x5067;if(typeof _0x1ca0af===_0x3f8692(0x1b8))return _0x1ca0af[_0x3f8692(0x1c2)]();if(typeof _0x1ca0af===_0x3f8692(0x1b9)||typeof _0x1ca0af===_0x3f8692(0x1d9))return String(_0x1ca0af);return undefined;}function resolvePushDirectoryRoot(_0x4a52e2){const _0x2fa28e=a148_0x5067,_0x31ae70=resolve(_0x4a52e2);if(!existsSync(_0x31ae70))throw CliErrors[_0x2fa28e(0x1ae)](_0x2fa28e(0x1ab)+_0x4a52e2);const _0x3df2da=lstatSync(_0x31ae70);if(_0x3df2da[_0x2fa28e(0x1cc)]())return _0x31ae70;if(_0x3df2da['isSymbolicLink']()){const _0x5e0511=realpathSync(_0x31ae70);if(lstatSync(_0x5e0511)[_0x2fa28e(0x1cc)]())return _0x5e0511;}throw CliErrors[_0x2fa28e(0x1ae)](_0x2fa28e(0x1ab)+_0x4a52e2);}function a148_0x2075(){const _0x29e242=['60692aZZKVo','find','(unknown)','startsWith','Skill\x20directory\x20not\x20found:\x20','allowAppCodeRetarget','\x20to\x20submit\x20company\x20Skills\x20for\x20review.','validation','manifest','length','1484ITjfYo','filter','utf8','ignoreMetadataScope','description','packageBase64','ignoreMetadataSkillCode','string','number','path','scope','3202380YBoxwP','skillName','dir','sourceSessionId','isArray','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20','trim','ignoreMetadataAppCodeMismatch','metadata','8WOUmxT','replace','549819yvXpcX','32584RIuBYe','Remote\x20Skill\x20','Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20','builtin','isDirectory','ignoreInvalidMetadata','slice','personal','6IviLbV','pushedAt','displayName','Invalid\x20','tags','object','\x20has\x20unsupported\x20scope\x20\x22','example','name','boolean','\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22','501786ADBoNt','isFile','Skill\x20metadata\x20appCode\x20\x22','targetScope','excludedFilePaths','2895940TbRbMs','\x20name\x20for\x20SkillHub\x20slug\x20generation.','unknown','2306814ESSzrw','files','toLowerCase','content','appCode','\x20has\x20scope=\x22','skillCode','refreshedAt'];a148_0x2075=function(){return _0x29e242;};return a148_0x2075();}function requireRemoteScope(_0x4804ec){const _0x4fe32d=a148_0x5067;if(_0x4804ec[_0x4fe32d(0x1bb)]==='personal'||_0x4804ec['scope']==='company'||_0x4804ec[_0x4fe32d(0x1bb)]===_0x4fe32d(0x1cb))return _0x4804ec[_0x4fe32d(0x1bb)];throw CliErrors[_0x4fe32d(0x1ae)](_0x4fe32d(0x1c9)+(_0x4804ec['skillCode']||_0x4fe32d(0x1a9))+_0x4fe32d(0x1d6)+(_0x4804ec[_0x4fe32d(0x1bb)]??_0x4fe32d(0x19e))+'\x22.');}function readLocalSkillContent(_0xe9372d){const _0x4e69c5=a148_0x5067,_0x596e88=resolve(_0xe9372d,SKILL_FILE);return existsSync(_0x596e88)&&lstatSync(_0x596e88)[_0x4e69c5(0x1dc)]()?readFileSync(_0x596e88,_0x4e69c5(0x1b3)):'';}function readPushMetadataIfPresent(_0x39a0cb,_0xd24b8b={}){const _0x19ebff=a148_0x5067;try{return readMetadataIfPresent(_0x39a0cb);}catch(_0x4dcfb0){if(_0xd24b8b[_0x19ebff(0x1cd)])return undefined;throw _0x4dcfb0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1f767e,_0xf428ec){const _0x323c2f=a149_0x165c,_0x6e1ff7=_0x1f767e();while(!![]){try{const _0x336ae3=-parseInt(_0x323c2f(0x137))/0x1*(-parseInt(_0x323c2f(0x13f))/0x2)+-parseInt(_0x323c2f(0x12f))/0x3*(-parseInt(_0x323c2f(0x139))/0x4)+parseInt(_0x323c2f(0x132))/0x5*(-parseInt(_0x323c2f(0x130))/0x6)+parseInt(_0x323c2f(0x141))/0x7*(-parseInt(_0x323c2f(0x13a))/0x8)+parseInt(_0x323c2f(0x136))/0x9*(-parseInt(_0x323c2f(0x13b))/0xa)+parseInt(_0x323c2f(0x13e))/0xb*(parseInt(_0x323c2f(0x140))/0xc)+parseInt(_0x323c2f(0x13d))/0xd;if(_0x336ae3===_0xf428ec)break;else _0x6e1ff7['push'](_0x6e1ff7['shift']());}catch(_0x5afd05){_0x6e1ff7['push'](_0x6e1ff7['shift']());}}}(a149_0x4a01,0x282d4));function a149_0x165c(_0x5200a5,_0x556186){_0x5200a5=_0x5200a5-0x12d;const _0x4a0146=a149_0x4a01();let _0x165c89=_0x4a0146[_0x5200a5];return _0x165c89;}import{CliErrors}from'../../errors.js';export function normalizeRuntimeSkillScopes(_0x3fb295){const _0x5b4adb=a149_0x165c,_0x983fea=_0x3fb295&&_0x3fb295[_0x5b4adb(0x131)]>0x0?_0x3fb295:[_0x5b4adb(0x12d),_0x5b4adb(0x13c),_0x5b4adb(0x134)],_0x4d0afd=[];for(const _0x57da7e of _0x983fea){if(!isRuntimeSkillScope(_0x57da7e))throw CliErrors[_0x5b4adb(0x133)](_0x5b4adb(0x138)+_0x57da7e);!_0x4d0afd[_0x5b4adb(0x12e)](_0x57da7e)&&_0x4d0afd[_0x5b4adb(0x135)](_0x57da7e);}return _0x4d0afd;}export function isRuntimeSkillScope(_0x2e2ed3){const _0x2a8ce3=a149_0x165c;return _0x2e2ed3===_0x2a8ce3(0x12d)||_0x2e2ed3==='company'||_0x2e2ed3===_0x2a8ce3(0x134);}function a149_0x4a01(){const _0xf1d160=['197551jEavEf','Unsupported\x20runtime\x20Skill\x20scope:\x20','1424WKWPHb','33296simKFn','455740gjvJeL','company','2947386VYlunB','11euawzH','2twxTih','3240444wXPOzP','385sntmYa','personal','includes','1347OxxdDv','12KatsHP','length','809895yDpHQp','validation','builtin','push','27MBGvbR'];a149_0x4a01=function(){return _0xf1d160;};return a149_0x4a01();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
const a151_0x251efd=a151_0x7080;(function(_0x221461,_0x50e3b7){const _0x3af8fe=a151_0x7080,_0x3a7bac=_0x221461();while(!![]){try{const _0xfd6ed9=parseInt(_0x3af8fe(0xc6))/0x1*(-parseInt(_0x3af8fe(0xc0))/0x2)+parseInt(_0x3af8fe(0xbf))/0x3+parseInt(_0x3af8fe(0xc5))/0x4+-parseInt(_0x3af8fe(0xce))/0x5+-parseInt(_0x3af8fe(0xca))/0x6+parseInt(_0x3af8fe(0xc9))/0x7*(-parseInt(_0x3af8fe(0xd2))/0x8)+-parseInt(_0x3af8fe(0xc7))/0x9*(-parseInt(_0x3af8fe(0xc8))/0xa);if(_0xfd6ed9===_0x50e3b7)break;else _0x3a7bac['push'](_0x3a7bac['shift']());}catch(_0x6810a8){_0x3a7bac['push'](_0x3a7bac['shift']());}}}(a151_0x3c00,0xca6bb));import{unzipSync,zipSync}from'fflate';import{CliErrors}from'../../errors.js';import{compareSkillFiles,fileContent,normalizeLocalFiles,normalizeSkillRelativePath}from'./local-files.js';function a151_0x7080(_0x50de5e,_0x36434e){_0x50de5e=_0x50de5e-0xbe;const _0x3c004b=a151_0x3c00();let _0x7080c5=_0x3c004b[_0x50de5e];return _0x7080c5;}const ZIP_MTIME=new Date(a151_0x251efd(0xcf));export function createDeterministicZipPackage(_0x4494df){const _0x2cfccd={};for(const _0x46563a of normalizeLocalFiles(_0x4494df)){_0x2cfccd[_0x46563a['path']]=fileContent(_0x46563a);}return Buffer['from'](zipSync(_0x2cfccd,{'level':0x0,'mtime':ZIP_MTIME}));}export function parseZipPackage(_0x8b9328){const _0x5effaa=a151_0x251efd;if(_0x8b9328[_0x5effaa(0xcb)]<0x16)throw CliErrors[_0x5effaa(0xc2)](_0x5effaa(0xbe));let _0x29ff27;try{_0x29ff27=unzipSync(_0x8b9328,{'filter'(_0x4a8438){const _0x470593=_0x5effaa,_0x4393ae=normalizeSkillRelativePath(_0x4a8438[_0x470593(0xc1)]);if(_0x4393ae[_0x470593(0xd0)]('/'))throw CliErrors[_0x470593(0xc2)]('Runtime\x20Skill\x20package\x20contains\x20directory\x20entry:\x20'+_0x4393ae);return!![];}});}catch(_0x18db2b){if(isRuntimeSkillValidationError(_0x18db2b))throw _0x18db2b;throw CliErrors[_0x5effaa(0xc2)](_0x5effaa(0xbe));}return Object[_0x5effaa(0xc4)](_0x29ff27)['map'](([_0x1a3386,_0x394b53])=>({'path':normalizeSkillRelativePath(_0x1a3386),'bytes':Buffer[_0x5effaa(0xcd)](_0x394b53)}))[_0x5effaa(0xc3)](compareSkillFiles);}function isRuntimeSkillValidationError(_0x5767fe){const _0x187e49=a151_0x251efd;return typeof _0x5767fe==='object'&&_0x5767fe!==null&&_0x187e49(0xd1)in _0x5767fe&&_0x5767fe[_0x187e49(0xd1)]===_0x187e49(0xcc);}function a151_0x3c00(){const _0x422b43=['776RBgppg','Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.','4313415WYmXCK','16hTxCgk','name','validation','sort','entries','3080780WUipUD','19259lOmFJe','1118889OLxrsy','40LTSqKQ','62636SSPgkA','2310030hlyfSR','length','validation_error','from','2345680KCJsaq','1980-01-01T00:00:00.000Z','endsWith','code'];a151_0x3c00=function(){return _0x422b43;};return a151_0x3c00();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x52adba,_0x4aa1a8){const _0x33ccd7=a152_0x48df,_0x32fb2a=_0x52adba();while(!![]){try{const _0x57991b=-parseInt(_0x33ccd7(0x184))/0x1+-parseInt(_0x33ccd7(0x17b))/0x2+parseInt(_0x33ccd7(0x171))/0x3+-parseInt(_0x33ccd7(0x197))/0x4*(-parseInt(_0x33ccd7(0x195))/0x5)+parseInt(_0x33ccd7(0x17e))/0x6*(parseInt(_0x33ccd7(0x196))/0x7)+parseInt(_0x33ccd7(0x177))/0x8+parseInt(_0x33ccd7(0x176))/0x9*(-parseInt(_0x33ccd7(0x18e))/0xa);if(_0x57991b===_0x4aa1a8)break;else _0x32fb2a['push'](_0x32fb2a['shift']());}catch(_0x57260f){_0x32fb2a['push'](_0x32fb2a['shift']());}}}(a152_0x31c6,0xaa823));import{CliErrors}from'../../errors.js';import{SKILL_FILE}from'./constants.js';function a152_0x48df(_0x5a1465,_0x51f344){_0x5a1465=_0x5a1465-0x171;const _0x31c6c8=a152_0x31c6();let _0x48df43=_0x31c6c8[_0x5a1465];return _0x48df43;}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(_0x2160a7){const _0x4158f2=a152_0x48df,_0x584462=normalizeLocalFiles(_0x2160a7);if(!_0x584462['some'](_0x35d4c3=>_0x35d4c3[_0x4158f2(0x194)]===SKILL_FILE))throw CliErrors[_0x4158f2(0x198)](_0x4158f2(0x188)+SKILL_FILE+_0x4158f2(0x17c));const _0x6cf9c3=localFilesToManifestFiles(_0x584462),_0x2ad4b0=createDeterministicZipPackage(_0x584462);return{'manifest':{'schemaVersion':0x2,'treeSha256':fileTreeHash(_0x6cf9c3),'zipSha256':bufferSha256(_0x2ad4b0),'zipSize':_0x2ad4b0[_0x4158f2(0x18c)],'files':_0x6cf9c3},'packageBytes':_0x2ad4b0,'packageBase64':_0x2ad4b0[_0x4158f2(0x174)](_0x4158f2(0x18b))};}export function verifyRuntimeSkillPackage(_0xff74f9,_0x61cef3){const _0x3a286f=normalizePackageManifest(_0xff74f9,{'requireOssPath':![]});if(!_0x3a286f)throw CliErrors['validation']('Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.');return extractAndVerifyPackage(_0x3a286f,_0x61cef3);}function a152_0x31c6(){const _0x4f687b=['ossPath','string','toLowerCase','some','1144353EDhusE','has','sha256','Runtime\x20Skill\x20package\x20file\x20size\x20mismatch:\x20','Missing\x20','Runtime\x20Skill\x20package\x20size\x20is\x20invalid.','Runtime\x20Skill\x20manifest\x20is\x20missing\x20','base64','length','treeSha256','10XQdSKv','isSafeInteger','push','Runtime\x20Skill\x20file\x20tree\x20sha256\x20is\x20invalid.','bytes','Runtime\x20Skill\x20package\x20file\x20sha256\x20mismatch:\x20','path','9810TmJtUw','777aZkFWN','1368ClOqXF','validation','Runtime\x20Skill\x20package\x20is\x20missing\x20entry:\x20','Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.','Runtime\x20Skill\x20package\x20entry\x20list\x20mismatch.','zipSha256','files','trim','1822524YniKgC','get','zipSize','toString','object','3236895wzVVpY','3455040NExNlA','schemaVersion','Runtime\x20Skill\x20file\x20tree\x20sha256\x20mismatch.','Runtime\x20Skill\x20package\x20is\x20missing\x20','304894mpCcza','\x20in\x20Skill\x20file\x20package.','map','34836KzKmcF','isArray'];a152_0x31c6=function(){return _0x4f687b;};return a152_0x31c6();}export function verifyRuntimeSkillBundle(_0x562ba8,_0x4467a6){const _0x34e267=a152_0x48df,_0x1d8955=normalizePackageManifest(_0x562ba8,{'requireOssPath':![]});if(!_0x1d8955)throw CliErrors[_0x34e267(0x198)](_0x34e267(0x19a));return extractAndVerifyPackageFiles(_0x1d8955,_0x4467a6);}export function tryNormalizePackageManifest(_0x246392){return normalizePackageManifest(_0x246392,{'requireOssPath':![]});}export function requirePackageBytes(_0xc82af3,_0x55404e){const _0x345b46=a152_0x48df;if(!_0x55404e||_0x55404e[_0x345b46(0x18c)]===0x0)throw CliErrors['validation']('Runtime\x20Skill\x20package\x20is\x20required\x20for\x20Skill\x20install:\x20'+_0xc82af3);return _0x55404e;}export function extractDownloadedPackage(_0x3e2a24){const _0x4ce4f7=a152_0x48df,_0x3e505e=parseZipPackage(_0x3e2a24)[_0x4ce4f7(0x17d)](_0x30cf8c=>({'path':_0x30cf8c[_0x4ce4f7(0x194)],'bytes':_0x30cf8c['bytes']}));if(!_0x3e505e[_0x4ce4f7(0x183)](_0x1aeac8=>_0x1aeac8[_0x4ce4f7(0x194)]===SKILL_FILE))throw CliErrors[_0x4ce4f7(0x198)](_0x4ce4f7(0x17a)+SKILL_FILE+'.');return normalizeLocalFiles(_0x3e505e);}export function localFilesToManifestFiles(_0x127dca){const _0x210db8=a152_0x48df;return normalizeLocalFiles(_0x127dca)[_0x210db8(0x17d)](_0x32dcce=>({'path':_0x32dcce['path'],'sha256':fileHash(_0x32dcce),'size':fileContent(_0x32dcce)[_0x210db8(0x18c)]}));}function normalizePackageManifest(_0x49f006,_0x414aa2){const _0x426553=a152_0x48df;if(!_0x49f006||typeof _0x49f006!==_0x426553(0x175)||Array[_0x426553(0x17f)](_0x49f006))return undefined;const _0x36fc9f=_0x49f006,_0x1d6bc4=typeof _0x36fc9f[_0x426553(0x180)]===_0x426553(0x181)?_0x36fc9f[_0x426553(0x180)][_0x426553(0x19e)]():undefined;if(_0x414aa2['requireOssPath']&&!_0x1d6bc4)return undefined;if(!Array[_0x426553(0x17f)](_0x36fc9f[_0x426553(0x19d)])||_0x36fc9f[_0x426553(0x19d)][_0x426553(0x18c)]===0x0)return undefined;if(!isSha256Hex(_0x36fc9f['treeSha256']))throw CliErrors[_0x426553(0x198)](_0x426553(0x191));if(!isSha256Hex(_0x36fc9f['zipSha256']))throw CliErrors[_0x426553(0x198)]('Runtime\x20Skill\x20package\x20sha256\x20is\x20invalid.');if(!Number[_0x426553(0x18f)](_0x36fc9f['zipSize'])||_0x36fc9f[_0x426553(0x173)]<0x0)throw CliErrors[_0x426553(0x198)](_0x426553(0x189));const _0x2113fd=normalizeManifestFiles(_0x36fc9f[_0x426553(0x19d)]);if(!_0x2113fd[_0x426553(0x183)](_0x265694=>_0x265694['path']===SKILL_FILE))throw CliErrors[_0x426553(0x198)](_0x426553(0x18a)+SKILL_FILE+'.');const _0x4d44a9=fileTreeHash(_0x2113fd);if(_0x4d44a9!==_0x36fc9f[_0x426553(0x18d)][_0x426553(0x182)]())throw CliErrors['validation'](_0x426553(0x179));return{'schemaVersion':Number['isSafeInteger'](_0x36fc9f[_0x426553(0x178)])?_0x36fc9f['schemaVersion']:0x2,'ossPath':_0x1d6bc4,'treeSha256':_0x4d44a9,'zipSha256':_0x36fc9f[_0x426553(0x19c)][_0x426553(0x182)](),'zipSize':_0x36fc9f[_0x426553(0x173)],'files':_0x2113fd};}function extractAndVerifyPackage(_0x4ff0a2,_0x5edb0a){const _0x57078c=a152_0x48df,_0x35329c=normalizePackageManifest(_0x4ff0a2,{'requireOssPath':![]});if(!_0x35329c)throw CliErrors[_0x57078c(0x198)](_0x57078c(0x19a));if(_0x5edb0a[_0x57078c(0x18c)]!==_0x35329c[_0x57078c(0x173)])throw CliErrors[_0x57078c(0x198)]('Runtime\x20Skill\x20package\x20size\x20mismatch.');const _0x43f059=bufferSha256(_0x5edb0a);if(_0x43f059!==_0x35329c['zipSha256'])throw CliErrors[_0x57078c(0x198)]('Runtime\x20Skill\x20package\x20sha256\x20mismatch.');return extractAndVerifyPackageFiles(_0x35329c,_0x5edb0a);}function extractAndVerifyPackageFiles(_0x28b121,_0x185a71){const _0x1865a8=a152_0x48df,_0x2132f9=parseZipPackage(_0x185a71);if(_0x2132f9[_0x1865a8(0x18c)]!==_0x28b121[_0x1865a8(0x19d)][_0x1865a8(0x18c)])throw CliErrors[_0x1865a8(0x198)](_0x1865a8(0x19b));const _0x5e16a1=new Map();for(const _0x4d43e7 of _0x2132f9){if(_0x5e16a1[_0x1865a8(0x185)](_0x4d43e7[_0x1865a8(0x194)]))throw CliErrors[_0x1865a8(0x198)]('Duplicate\x20Skill\x20package\x20entry:\x20'+_0x4d43e7[_0x1865a8(0x194)]);_0x5e16a1['set'](_0x4d43e7['path'],_0x4d43e7);}const _0x31448a=[];for(const _0x529fbc of _0x28b121[_0x1865a8(0x19d)]){const _0x4cbd49=_0x5e16a1[_0x1865a8(0x172)](_0x529fbc[_0x1865a8(0x194)]);if(!_0x4cbd49)throw CliErrors[_0x1865a8(0x198)](_0x1865a8(0x199)+_0x529fbc[_0x1865a8(0x194)]);if(_0x4cbd49[_0x1865a8(0x192)]['length']!==_0x529fbc['size'])throw CliErrors['validation'](_0x1865a8(0x187)+_0x529fbc[_0x1865a8(0x194)]);const _0x5ddaf6=bufferSha256(_0x4cbd49[_0x1865a8(0x192)]);if(_0x5ddaf6!==_0x529fbc[_0x1865a8(0x186)])throw CliErrors[_0x1865a8(0x198)](_0x1865a8(0x193)+_0x529fbc[_0x1865a8(0x194)]);_0x31448a[_0x1865a8(0x190)]({'path':_0x529fbc[_0x1865a8(0x194)],'bytes':_0x4cbd49['bytes']});}return normalizeLocalFiles(_0x31448a);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x392d53,_0x25f586){var _0x296939=a153_0x581c,_0xf332d=_0x392d53();while(!![]){try{var _0x3a418=parseInt(_0x296939(0x140))/0x1+parseInt(_0x296939(0x143))/0x2*(-parseInt(_0x296939(0x147))/0x3)+parseInt(_0x296939(0x13f))/0x4+parseInt(_0x296939(0x149))/0x5*(-parseInt(_0x296939(0x145))/0x6)+parseInt(_0x296939(0x141))/0x7*(-parseInt(_0x296939(0x148))/0x8)+-parseInt(_0x296939(0x146))/0x9*(-parseInt(_0x296939(0x142))/0xa)+-parseInt(_0x296939(0x144))/0xb*(-parseInt(_0x296939(0x14a))/0xc);if(_0x3a418===_0x25f586)break;else _0xf332d['push'](_0xf332d['shift']());}catch(_0x6c2071){_0xf332d['push'](_0xf332d['shift']());}}}(a153_0x4c59,0x37dd7));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 a153_0x4c59(){var _0x4c9dc1=['12zTCPyl','1682044FLywgk','332204gqAxbw','7GnqYxQ','10NSRSwh','1076zLxBLm','1982772boyWYo','18nPImIq','2081484ZTJYwo','2403YUZANZ','625528twLiOz','710485ygxtuV'];a153_0x4c59=function(){return _0x4c9dc1;};return a153_0x4c59();}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';function a153_0x581c(_0xe3bbd0,_0x5e092a){_0xe3bbd0=_0xe3bbd0-0x13f;var _0x4c5971=a153_0x4c59();var _0x581ca2=_0x4c5971[_0xe3bbd0];return _0x581ca2;}export{buildSkillPackage,verifyRuntimeSkillBundle,verifyRuntimeSkillPackage}from'./runtime-skill-sync/zip-package.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a154_0x62fab3=a154_0x1305;(function(_0x31e054,_0x46391d){const _0x3d81f7=a154_0x1305,_0xfbca8d=_0x31e054();while(!![]){try{const _0x267086=parseInt(_0x3d81f7(0xe9))/0x1*(parseInt(_0x3d81f7(0xe0))/0x2)+parseInt(_0x3d81f7(0xe8))/0x3+-parseInt(_0x3d81f7(0xc6))/0x4*(parseInt(_0x3d81f7(0xdb))/0x5)+parseInt(_0x3d81f7(0xd5))/0x6*(-parseInt(_0x3d81f7(0xd8))/0x7)+parseInt(_0x3d81f7(0xdf))/0x8*(parseInt(_0x3d81f7(0xc5))/0x9)+parseInt(_0x3d81f7(0xe2))/0xa*(parseInt(_0x3d81f7(0xd4))/0xb)+-parseInt(_0x3d81f7(0xd9))/0xc;if(_0x267086===_0x46391d)break;else _0xfbca8d['push'](_0xfbca8d['shift']());}catch(_0x2e0d3a){_0xfbca8d['push'](_0xfbca8d['shift']());}}}(a154_0xbfca,0x52e18));import{existsSync,readFileSync}from'node:fs';import{homedir}from'node:os';import{join}from'node:path';function a154_0xbfca(){const _0x44e146=['message','not-recorded','.claude','\x20uses\x20unsupported\x20version\x20','\x20records\x20\x22','utf8','.skill-lock.json','11TLTRFP','282MHorII','object','includes','14497nvPYFe','9404760AvfQeS','find','1687270IjWXky','\x22\x20but\x20no\x20SKILL.md\x20was\x20found\x20in\x20known\x20layouts\x20','\x20is\x20unreadable:\x20','kind','2904Qxihlt','17954bTjpwx','lockFile','2725490pjBSgO','.agents','version','home','unverifiable','map','991380iEaTVM','71tWbxHU','join','number','7875tIgmlM','4DhieQz','present','unusable','recorded','\x20has\x20no\x20skills\x20map','globalSkillsDirs','skills'];a154_0xbfca=function(){return _0x44e146;};return a154_0xbfca();}export const SKILL_LOCK_RELATIVE_PATH=join('.agents',a154_0x62fab3(0xd3));function a154_0x1305(_0x358dd4,_0x5ee381){_0x358dd4=_0x358dd4-0xc5;const _0xbfca69=a154_0xbfca();let _0x130503=_0xbfca69[_0x358dd4];return _0x130503;}export const GLOBAL_SKILLS_DIR_RELATIVE_PATHS=[join(a154_0x62fab3(0xe3),'skills'),join(a154_0x62fab3(0xcf),a154_0x62fab3(0xcc))];const SUPPORTED_LOCK_VERSIONS=[0x3];function readLockLookup(_0x3ca7cf,_0x337a26){const _0x303fbc=a154_0x62fab3;if(!existsSync(_0x3ca7cf))return{'kind':'not-recorded'};let _0x46b8ba;try{_0x46b8ba=JSON['parse'](readFileSync(_0x3ca7cf,_0x303fbc(0xd2)));}catch(_0x419cce){return{'kind':'unusable','reason':_0x3ca7cf+_0x303fbc(0xdd)+_0x419cce[_0x303fbc(0xcd)]};}const _0x426437=_0x46b8ba;if(typeof _0x426437?.[_0x303fbc(0xe4)]!==_0x303fbc(0xeb)||!SUPPORTED_LOCK_VERSIONS[_0x303fbc(0xd7)](_0x426437[_0x303fbc(0xe4)]))return{'kind':_0x303fbc(0xc8),'reason':_0x3ca7cf+_0x303fbc(0xd0)+String(_0x426437?.[_0x303fbc(0xe4)])};if(!_0x426437['skills']||typeof _0x426437[_0x303fbc(0xcc)]!==_0x303fbc(0xd6))return{'kind':_0x303fbc(0xc8),'reason':_0x3ca7cf+_0x303fbc(0xca)};return _0x426437[_0x303fbc(0xcc)][_0x337a26]?{'kind':_0x303fbc(0xc9)}:{'kind':_0x303fbc(0xce)};}export function resolveInstalledSkill(_0x1c9274,_0x3b3753){const _0x4f4956=a154_0x62fab3,_0x51e867=_0x3b3753?.[_0x4f4956(0xe5)]??homedir(),_0x361d5d=_0x3b3753?.[_0x4f4956(0xcb)]??GLOBAL_SKILLS_DIR_RELATIVE_PATHS[_0x4f4956(0xe7)](_0x4084ec=>join(_0x51e867,_0x4084ec)),_0x22211a=_0x3b3753?.[_0x4f4956(0xe1)]??join(_0x51e867,SKILL_LOCK_RELATIVE_PATH),_0x36ab08=_0x361d5d[_0x4f4956(0xe7)](_0x8020d=>join(_0x8020d,_0x1c9274,'SKILL.md')),_0x2a1b44=_0x36ab08[_0x4f4956(0xda)](_0x32c031=>existsSync(_0x32c031));if(_0x2a1b44)return{'state':_0x4f4956(0xc7),'path':_0x2a1b44};const _0x73bd0=readLockLookup(_0x22211a,_0x1c9274);if(_0x73bd0[_0x4f4956(0xde)]===_0x4f4956(0xc8))return{'state':_0x4f4956(0xe6),'reason':_0x73bd0['reason']};if(_0x73bd0['kind']===_0x4f4956(0xc9))return{'state':_0x4f4956(0xe6),'reason':_0x22211a+_0x4f4956(0xd1)+_0x1c9274+_0x4f4956(0xdc)+('('+_0x36ab08[_0x4f4956(0xea)](',\x20')+')')};return{'state':'absent','checked':_0x36ab08};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a155_0x8cc7(){const _0x12f00e=['hasOwnProperty','1411039CHcXDo','136386aYwWhM','apps','fromEntries','707044DtjMDq','call','entries','8eAvsyy','5335002BarDjt','1206378kyRxJv','721815OcnpyF','841930VJtjzJ','<redacted>','length','slice','30iWvdDP','test','accessKey','string','prototype','isArray','object','68DVewVu'];a155_0x8cc7=function(){return _0x12f00e;};return a155_0x8cc7();}const a155_0x2fc6e3=a155_0x2525;(function(_0x58783f,_0x149c41){const _0x297f21=a155_0x2525,_0x44baa5=_0x58783f();while(!![]){try{const _0x2351f7=-parseInt(_0x297f21(0x179))/0x1+-parseInt(_0x297f21(0x180))/0x2+-parseInt(_0x297f21(0x18e))/0x3*(-parseInt(_0x297f21(0x18b))/0x4)+-parseInt(_0x297f21(0x17f))/0x5+parseInt(_0x297f21(0x17d))/0x6+-parseInt(_0x297f21(0x18d))/0x7*(parseInt(_0x297f21(0x17c))/0x8)+parseInt(_0x297f21(0x17e))/0x9*(parseInt(_0x297f21(0x184))/0xa);if(_0x2351f7===_0x149c41)break;else _0x44baa5['push'](_0x44baa5['shift']());}catch(_0x52fec1){_0x44baa5['push'](_0x44baa5['shift']());}}}(a155_0x8cc7,0x90176));const REDACTED_ACCESS_KEY=a155_0x2fc6e3(0x181);export function maskCliAccessKey(_0x2b7eec){const _0xc8337e=a155_0x2fc6e3;if(typeof _0x2b7eec!==_0xc8337e(0x187)||_0x2b7eec[_0xc8337e(0x182)]<=0x8)return REDACTED_ACCESS_KEY;return''+_0x2b7eec[_0xc8337e(0x183)](0x0,0x8)+'*'['repeat'](_0x2b7eec['length']-0x8);}export function redactCliConfigCredentials(_0x13e320){const _0x46a39c=a155_0x2fc6e3,_0x1fde41={..._0x13e320};return Object[_0x46a39c(0x188)][_0x46a39c(0x18c)][_0x46a39c(0x17a)](_0x1fde41,_0x46a39c(0x186))&&(_0x1fde41[_0x46a39c(0x186)]=maskCliAccessKey(_0x1fde41['accessKey'])),_0x1fde41[_0x46a39c(0x177)]&&typeof _0x1fde41['apps']===_0x46a39c(0x18a)&&!Array[_0x46a39c(0x189)](_0x1fde41[_0x46a39c(0x177)])&&(_0x1fde41[_0x46a39c(0x177)]=redactLegacyAppCredentials(_0x1fde41[_0x46a39c(0x177)])),_0x1fde41;}function a155_0x2525(_0x515983,_0xe42627){_0x515983=_0x515983-0x177;const _0x8cc747=a155_0x8cc7();let _0x2525ba=_0x8cc747[_0x515983];return _0x2525ba;}export function redactCliConfigValue(_0x5e6901,_0xdc8a86){const _0x22ee40=a155_0x2fc6e3;if(_0x5e6901===_0x22ee40(0x186)||/^apps\.[^.]+\.accessKey$/[_0x22ee40(0x185)](_0x5e6901))return maskCliAccessKey(_0xdc8a86);if(_0x5e6901===_0x22ee40(0x177)&&_0xdc8a86&&typeof _0xdc8a86==='object'&&!Array[_0x22ee40(0x189)](_0xdc8a86))return redactLegacyAppCredentials(_0xdc8a86);if(/^apps\.[^.]+$/['test'](_0x5e6901)&&_0xdc8a86&&typeof _0xdc8a86==='object'&&!Array['isArray'](_0xdc8a86)){const _0xe8ede9=_0xdc8a86;return Object[_0x22ee40(0x188)]['hasOwnProperty']['call'](_0xe8ede9,_0x22ee40(0x186))?{..._0xe8ede9,'accessKey':maskCliAccessKey(_0xe8ede9[_0x22ee40(0x186)])}:_0xdc8a86;}return _0xdc8a86;}function redactLegacyAppCredentials(_0x5d908d){const _0x3db482=a155_0x2fc6e3;return Object[_0x3db482(0x178)](Object[_0x3db482(0x17b)](_0x5d908d)['map'](([_0x4f5e54,_0x5064d3])=>{const _0x25a07b=_0x3db482;if(!_0x5064d3||typeof _0x5064d3!==_0x25a07b(0x18a)||Array[_0x25a07b(0x189)](_0x5064d3))return[_0x4f5e54,_0x5064d3];const _0x777119={..._0x5064d3};return Object['prototype']['hasOwnProperty'][_0x25a07b(0x17a)](_0x777119,'accessKey')&&(_0x777119[_0x25a07b(0x186)]=maskCliAccessKey(_0x777119['accessKey'])),[_0x4f5e54,_0x777119];}));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x29d027,_0x57c840){const _0x41ea1d=a156_0x26b4,_0x5ac492=_0x29d027();while(!![]){try{const _0x9359bf=parseInt(_0x41ea1d(0xd6))/0x1+parseInt(_0x41ea1d(0xd9))/0x2+parseInt(_0x41ea1d(0xd7))/0x3*(-parseInt(_0x41ea1d(0xda))/0x4)+parseInt(_0x41ea1d(0xdd))/0x5+parseInt(_0x41ea1d(0xdc))/0x6+parseInt(_0x41ea1d(0xde))/0x7+parseInt(_0x41ea1d(0xdb))/0x8*(-parseInt(_0x41ea1d(0xd8))/0x9);if(_0x9359bf===_0x57c840)break;else _0x5ac492['push'](_0x5ac492['shift']());}catch(_0x3c9ebd){_0x5ac492['push'](_0x5ac492['shift']());}}}(a156_0x453f,0xdb93d));import{createJqFilter,resolveBundledJqPaths}from'@lovrabet/cli-framework';function a156_0x26b4(_0x451bff,_0xbb620b){_0x451bff=_0x451bff-0xd6;const _0x453f27=a156_0x453f();let _0x26b43c=_0x453f27[_0x451bff];return _0x26b43c;}import{CliErrors}from'../errors.js';function a156_0x453f(){const _0x2c78d2=['863601vdecYc','9BALGFS','3040460NUANTk','12nROsPJ','17757616zIRlTI','3311898gJvQrB','3103800hpjIKq','764176HrfNrf','1180551SOcibn'];a156_0x453f=function(){return _0x2c78d2;};return a156_0x453f();}export const applyJqFilter=createJqFilter(CliErrors,{'bundledJqPaths':resolveBundledJqPaths()});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a157_0x2475(){const _0x19b161=['filter','minimumVersionMessage','Upgrade\x20command:\x20','72QsApCp','1295462eSqnlf','currentVersion','95468iNRXDX','Recommended\x20stable:\x20','54868ZQugAA','latest','11341370AluGHw','upgradeMessage','join','21zmEuso','305328GXBsbO','stableVersion','minimumVersion','Minimum\x20supported:\x20','belowMinimum','1185714RUvmZH','15pPaSgW','valid','unavailable','1060350bywgXv','Current\x20version:\x20','Current\x20CLI\x20version\x20is\x20below\x20the\x20minimum\x20supported\x20version.'];a157_0x2475=function(){return _0x19b161;};return a157_0x2475();}(function(_0x4a5672,_0x3e5f19){const _0x1580c0=a157_0x5291,_0x2aedc7=_0x4a5672();while(!![]){try{const _0x3efa2c=-parseInt(_0x1580c0(0x198))/0x1+parseInt(_0x1580c0(0x1a7))/0x2+parseInt(_0x1580c0(0x19d))/0x3*(parseInt(_0x1580c0(0x196))/0x4)+-parseInt(_0x1580c0(0x1a4))/0x5*(-parseInt(_0x1580c0(0x19e))/0x6)+-parseInt(_0x1580c0(0x194))/0x7+parseInt(_0x1580c0(0x1ad))/0x8*(parseInt(_0x1580c0(0x1a3))/0x9)+-parseInt(_0x1580c0(0x19a))/0xa;if(_0x3efa2c===_0x3e5f19)break;else _0x2aedc7['push'](_0x2aedc7['shift']());}catch(_0x1d6926){_0x2aedc7['push'](_0x2aedc7['shift']());}}}(a157_0x2475,0xa182f));import a157_0x497c37 from'semver';import{LOVRABET_NPM_PACKAGE_NAME}from'../constant/distribution.js';import{CliErrors}from'../errors.js';import{getCliVersionPolicy}from'../utils/cli-version-policy.js';function a157_0x5291(_0x38ad75,_0x2f5259){_0x38ad75=_0x38ad75-0x194;const _0x24754d=a157_0x2475();let _0x529144=_0x24754d[_0x38ad75];return _0x529144;}import{getCliVersion}from'../utils/version.js';export function evaluateCliVersionPolicy(_0x3f71fa,_0x40c3f1){const _0x42ebac=a157_0x5291,_0x146499=a157_0x497c37[_0x42ebac(0x1a5)](_0x3f71fa)===_0x3f71fa,_0x1fa47e=_0x40c3f1?.[_0x42ebac(0x19f)]??null,_0x4a0d37=_0x40c3f1?.[_0x42ebac(0x1a0)]??null,_0xba514e=Boolean(_0x146499&&_0x1fa47e&&a157_0x497c37['lt'](_0x3f71fa,_0x1fa47e)),_0x52bc27=Boolean(_0x146499&&_0x4a0d37&&a157_0x497c37['lt'](_0x3f71fa,_0x4a0d37));return{'currentVersion':_0x3f71fa,'stableVersion':_0x1fa47e,'minimumVersion':_0x4a0d37,'needsUpgrade':_0xba514e||_0x52bc27,'belowMinimum':_0x52bc27,'upgradeMessage':_0x40c3f1?.[_0x42ebac(0x19b)],'minimumVersionMessage':_0x40c3f1?.[_0x42ebac(0x1ab)]};}export async function checkCliVersion(){return evaluateCliVersionPolicy(getCliVersion(),await getCliVersionPolicy());}export function getCliUpgradeCommand(_0x5137c5){const _0x32464e=a157_0x5291;return'npm\x20install\x20-g\x20'+LOVRABET_NPM_PACKAGE_NAME+'@'+(_0x5137c5['stableVersion']??_0x32464e(0x199));}export function assertCliVersionSupported(_0x434bc8){const _0xa3ba3e=a157_0x5291;if(!_0x434bc8[_0xa3ba3e(0x1a2)])return;const _0x521516=[_0x434bc8[_0xa3ba3e(0x1ab)],_0xa3ba3e(0x1a8)+_0x434bc8[_0xa3ba3e(0x195)],_0xa3ba3e(0x1a1)+_0x434bc8[_0xa3ba3e(0x1a0)],_0xa3ba3e(0x197)+(_0x434bc8[_0xa3ba3e(0x19f)]??_0xa3ba3e(0x1a6)),_0xa3ba3e(0x1ac)+getCliUpgradeCommand(_0x434bc8)][_0xa3ba3e(0x1aa)](Boolean)[_0xa3ba3e(0x19c)]('\x0a');throw CliErrors['validation'](_0xa3ba3e(0x1a9),_0x521516);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x19b391,_0x1f740b){const _0x3f380c=a158_0xb907,_0x4ab83d=_0x19b391();while(!![]){try{const _0x543ca9=parseInt(_0x3f380c(0x7a))/0x1+parseInt(_0x3f380c(0x8d))/0x2*(-parseInt(_0x3f380c(0x88))/0x3)+parseInt(_0x3f380c(0x79))/0x4*(parseInt(_0x3f380c(0x87))/0x5)+parseInt(_0x3f380c(0x80))/0x6+-parseInt(_0x3f380c(0x82))/0x7+parseInt(_0x3f380c(0x8c))/0x8+-parseInt(_0x3f380c(0x8a))/0x9*(parseInt(_0x3f380c(0x7b))/0xa);if(_0x543ca9===_0x1f740b)break;else _0x4ab83d['push'](_0x4ab83d['shift']());}catch(_0x3182f1){_0x4ab83d['push'](_0x4ab83d['shift']());}}}(a158_0x28b9,0x3ad67));import a158_0x1f297c 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(_0x830553){const _0x4a03b3=a158_0xb907;return typeof _0x830553===_0x4a03b3(0x76)&&_0x830553[_0x4a03b3(0x84)]()?_0x830553['trim']():null;}function pickStrictSemver(_0x1219af){const _0x40924d=a158_0xb907,_0x2665fb=pickString(_0x1219af);return _0x2665fb&&a158_0x1f297c[_0x40924d(0x7e)](_0x2665fb)===_0x2665fb?_0x2665fb:null;}export function normalizeCliVersionPolicy(_0x1db2ea){const _0x53d409=a158_0xb907;if(!_0x1db2ea||typeof _0x1db2ea!==_0x53d409(0x83))return null;const _0x25bdb8=_0x1db2ea,_0x3efdaa=_0x25bdb8[_0x53d409(0x8b)]&&typeof _0x25bdb8['cli']===_0x53d409(0x83)?_0x25bdb8[_0x53d409(0x8b)]:_0x25bdb8,_0x13f65c=pickStrictSemver(_0x3efdaa[_0x53d409(0x7f)]??_0x3efdaa[_0x53d409(0x78)]??_0x3efdaa['recommendedVersion']),_0x17eb57=pickStrictSemver(_0x3efdaa[_0x53d409(0x89)]??_0x3efdaa[_0x53d409(0x81)]);if(!_0x13f65c&&!_0x17eb57)return null;if(_0x13f65c&&_0x17eb57&&a158_0x1f297c['gt'](_0x17eb57,_0x13f65c))return null;return{'stableVersion':_0x13f65c,'minimumVersion':_0x17eb57,'upgradeMessage':pickString(_0x3efdaa[_0x53d409(0x8e)])??undefined,'minimumVersionMessage':pickString(_0x3efdaa[_0x53d409(0x85)])??undefined};}function a158_0x28b9(){const _0x2f79d6=['object','trim','minimumVersionMessage','json','80MrVQZz','489XsGYiY','minimumVersion','9lqvrZu','cli','3189168Ehcebj','3998aPrdJp','upgradeMessage','string','finally','latestVersion','62976drzHar','206291jedRHX','4419370aXenTK','now','then','valid','stableVersion','2368566Fghqnb','minVersion','1699803jrwxjZ'];a158_0x28b9=function(){return _0x2f79d6;};return a158_0x28b9();}export async function fetchCliVersionPolicy(){const _0x3a9cd3=a158_0xb907;try{const _0x3f901a=await fetch(LOVRABET_CLI_VERSION_POLICY_URL,{'headers':{'Accept':'application/json'},'signal':AbortSignal['timeout'](FETCH_TIMEOUT_MS)});if(!_0x3f901a['ok'])return null;return normalizeCliVersionPolicy(await _0x3f901a[_0x3a9cd3(0x86)]());}catch{return null;}}let cachedPolicy=null,cachedAt=0x0,hasCachedPolicy=![],pendingPolicy=null;function a158_0xb907(_0x2f17e1,_0x41fb2b){_0x2f17e1=_0x2f17e1-0x76;const _0x28b9cb=a158_0x28b9();let _0xb907ec=_0x28b9cb[_0x2f17e1];return _0xb907ec;}export async function getCliVersionPolicy(){const _0x5f1f27=a158_0xb907,_0x1e02f3=Date['now']();if(hasCachedPolicy){const _0x4325a8=cachedPolicy?SUCCESS_CACHE_TTL_MS:FAILURE_CACHE_TTL_MS;if(_0x1e02f3-cachedAt<_0x4325a8)return cachedPolicy;}if(pendingPolicy)return pendingPolicy;return pendingPolicy=fetchCliVersionPolicy()[_0x5f1f27(0x7d)](_0x1578fb=>{const _0x243581=_0x5f1f27;return cachedPolicy=_0x1578fb,cachedAt=Date[_0x243581(0x7c)](),hasCachedPolicy=!![],_0x1578fb;})[_0x5f1f27(0x77)](()=>{pendingPolicy=null;}),pendingPolicy;}export function clearCliVersionPolicyCache(){cachedPolicy=null,cachedAt=0x0,hasCachedPolicy=![],pendingPolicy=null;}
|
package/lib/utils/logger.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a159_0x5677(_0x263ed6,_0x2a5504){_0x263ed6=_0x263ed6-0x70;const _0x653de7=a159_0x653d();let _0x567794=_0x653de7[_0x263ed6];return _0x567794;}function a159_0x653d(){const _0x18edf4=['winstonLogger','Failed:\x20','unknown','error','addColors','Failed\x20to\x20clear\x20logs:','errors','1266974FbQcUp','timestamp','2054540PJWaJp','writeFileSync','createLogger','logTask','137785twAtxQ','readFileSync','log','237314VsvLar','File','success','initWinstonLogger','split','map','144pSPSku','logFileName','now','clearLogs','filter','utf8','clear','readLogs','red','combine','8yGpNqi','logFilePath','format','warn','existsSync','setRawCommand','green','blue','toISOString','48565IsYYEy','duration','message','yellow','join','info','currentRawCommand','setLogPath','level','trim','168LWCSHs','2459835lIcxnP','36068CibFRy','rawCommand'];a159_0x653d=function(){return _0x18edf4;};return a159_0x653d();}const a159_0x73d006=a159_0x5677;(function(_0x32ac2c,_0x45d4bc){const _0x5bb1dd=a159_0x5677,_0x195339=_0x32ac2c();while(!![]){try{const _0x1748c2=-parseInt(_0x5bb1dd(0x83))/0x1+parseInt(_0x5bb1dd(0x7d))/0x2+-parseInt(_0x5bb1dd(0x72))/0x3*(parseInt(_0x5bb1dd(0x74))/0x4)+parseInt(_0x5bb1dd(0x9f))/0x5*(parseInt(_0x5bb1dd(0x8c))/0x6)+-parseInt(_0x5bb1dd(0x86))/0x7*(-parseInt(_0x5bb1dd(0x96))/0x8)+parseInt(_0x5bb1dd(0x73))/0x9+-parseInt(_0x5bb1dd(0x7f))/0xa;if(_0x1748c2===_0x45d4bc)break;else _0x195339['push'](_0x195339['shift']());}catch(_0x488812){_0x195339['push'](_0x195339['shift']());}}}(a159_0x653d,0x4f7f9));import a159_0x422633 from'winston';import a159_0x23a295 from'node:fs';import a159_0x520489 from'node:path';import{PRODUCT_CONFIG}from'../constant/product.js';class Logger{[a159_0x73d006(0x76)];['logFilePath']='';[a159_0x73d006(0xa5)]='';constructor(){}[a159_0x73d006(0x9b)](_0x5095e2){this['currentRawCommand']=_0x5095e2;}[a159_0x73d006(0xa6)](_0x78f835){const _0x3ba831=a159_0x73d006;this[_0x3ba831(0x97)]=a159_0x520489[_0x3ba831(0xa3)](_0x78f835,PRODUCT_CONFIG[_0x3ba831(0x8d)]),this[_0x3ba831(0x76)]&&this['winstonLogger'][_0x3ba831(0x92)](),this[_0x3ba831(0x89)]();}[a159_0x73d006(0x89)](){const _0xd73fe4=a159_0x73d006,_0x44840c=a159_0x520489['dirname'](this['logFilePath']);!a159_0x23a295[_0xd73fe4(0x9a)](_0x44840c)&&a159_0x23a295['mkdirSync'](_0x44840c,{'recursive':!![]});const _0x1645c7=a159_0x422633['format'][_0xd73fe4(0x95)](a159_0x422633['format'][_0xd73fe4(0x7e)](),a159_0x422633[_0xd73fe4(0x98)][_0xd73fe4(0x7c)]({'stack':!![]}),a159_0x422633[_0xd73fe4(0x98)]['printf'](_0x16d91b=>{const _0x4a90ce=_0xd73fe4,_0x3f6bd3={'timestamp':_0x16d91b['timestamp']||new Date()[_0x4a90ce(0x9e)](),'level':_0x16d91b[_0x4a90ce(0x70)]||_0x4a90ce(0xa4),'command':_0x16d91b['command']||_0x4a90ce(0x78),'rawCommand':_0x16d91b[_0x4a90ce(0x75)]||this[_0x4a90ce(0xa5)]||undefined,'message':_0x16d91b[_0x4a90ce(0xa1)]||'','duration':_0x16d91b[_0x4a90ce(0xa0)]||undefined,'details':_0x16d91b['details']||undefined};return JSON['stringify'](_0x3f6bd3);}));this['winstonLogger']=a159_0x422633[_0xd73fe4(0x81)]({'level':_0xd73fe4(0xa4),'format':_0x1645c7,'transports':[new a159_0x422633['transports'][(_0xd73fe4(0x87))]({'filename':this[_0xd73fe4(0x97)],'level':'info'})],'silent':![]}),a159_0x422633[_0xd73fe4(0x7a)]({'success':_0xd73fe4(0x9c),'error':_0xd73fe4(0x94),'warn':_0xd73fe4(0xa2),'info':_0xd73fe4(0x9d)});}['info'](_0x544ab3,_0x2c32bd,_0x28152c){const _0x2a16a6=a159_0x73d006;if(!this['logFilePath']||!this[_0x2a16a6(0x76)])return;this[_0x2a16a6(0x76)][_0x2a16a6(0xa4)](_0x2c32bd,{'command':_0x544ab3,'details':_0x28152c});}['success'](_0x776925,_0x2b1fd0,_0x599abf,_0x290e29){const _0xe345b5=a159_0x73d006;if(!this[_0xe345b5(0x97)]||!this['winstonLogger'])return;this[_0xe345b5(0x76)][_0xe345b5(0x85)](_0xe345b5(0xa4),_0x2b1fd0,{'level':'success','command':_0x776925,'duration':_0x599abf,'details':_0x290e29});}[a159_0x73d006(0x79)](_0x2f766a,_0x31971b,_0x4ff59c){const _0x17e675=a159_0x73d006;if(!this[_0x17e675(0x97)]||!this[_0x17e675(0x76)])return;this[_0x17e675(0x76)][_0x17e675(0x79)](_0x31971b,{'command':_0x2f766a,'details':_0x4ff59c});}[a159_0x73d006(0x99)](_0x54ba05,_0x3e57d7,_0x2303c4){const _0x2d2c17=a159_0x73d006;if(!this['logFilePath']||!this[_0x2d2c17(0x76)])return;this[_0x2d2c17(0x76)][_0x2d2c17(0x99)](_0x3e57d7,{'command':_0x54ba05,'details':_0x2303c4});}async[a159_0x73d006(0x82)](_0xa2b812,_0x4b8a44,_0x31f7d0){const _0x4e174c=a159_0x73d006,_0xf00b33=Date[_0x4e174c(0x8e)]();this[_0x4e174c(0xa4)](_0xa2b812,'Starting:\x20'+_0x4b8a44);try{const _0x509af8=await _0x31f7d0(),_0x40f724=Date[_0x4e174c(0x8e)]()-_0xf00b33;return this[_0x4e174c(0x88)](_0xa2b812,'Completed:\x20'+_0x4b8a44,_0x40f724),_0x509af8;}catch(_0x18919c){const _0x594577=Date[_0x4e174c(0x8e)]()-_0xf00b33;this['error'](_0xa2b812,_0x4e174c(0x77)+_0x4b8a44,{'error':_0x18919c instanceof Error?_0x18919c[_0x4e174c(0xa1)]:String(_0x18919c),'duration':_0x594577});throw _0x18919c;}}[a159_0x73d006(0x93)](){const _0x10984d=a159_0x73d006;try{if(!a159_0x23a295['existsSync'](this[_0x10984d(0x97)]))return[];const _0x204723=a159_0x23a295[_0x10984d(0x84)](this[_0x10984d(0x97)],_0x10984d(0x91));return _0x204723[_0x10984d(0x8a)](/\r?\n/)[_0x10984d(0x90)](_0x1c1aec=>_0x1c1aec[_0x10984d(0x71)]())[_0x10984d(0x8b)](_0x1cca4c=>JSON['parse'](_0x1cca4c));}catch(_0x3f4e4a){return console[_0x10984d(0x99)]('Failed\x20to\x20read\x20logs:',_0x3f4e4a),[];}}[a159_0x73d006(0x8f)](){const _0x23e231=a159_0x73d006;try{a159_0x23a295['existsSync'](this[_0x23e231(0x97)])&&a159_0x23a295[_0x23e231(0x80)](this['logFilePath'],'',_0x23e231(0x91));}catch(_0x18eda6){console[_0x23e231(0x99)](_0x23e231(0x7b),_0x18eda6);}}['getWinstonInstance'](){const _0x57f6f7=a159_0x73d006;return this[_0x57f6f7(0x76)];}}export const logger=new Logger();
|