@lovrabet/lovrabet-cli 2.3.9 → 2.3.10-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli.js +1 -1
- package/lib/commands/api-doc/index.js +1 -1
- package/lib/commands/app/cache.js +1 -1
- package/lib/commands/app/definitions.js +1 -1
- package/lib/commands/app/eligibility.js +1 -1
- package/lib/commands/app/mock-loader.js +1 -1
- package/lib/commands/app/remote-source.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/approval/index.js +1 -1
- package/lib/commands/artifact/index.js +1 -1
- package/lib/commands/auth/device.js +1 -1
- package/lib/commands/auth/index.d.ts +2 -3
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/auth/prompt.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/exec.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/common/config-policy.js +1 -1
- package/lib/commands/common/constraints.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/config/definitions.js +1 -1
- package/lib/commands/config/init.d.ts +1 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/import-excel.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/sdk-doc.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/issue/context.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/permit/dataset-get.js +1 -1
- package/lib/commands/permit/dataset-set.js +1 -1
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.js +1 -1
- package/lib/commands/personal-bff/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/schedule/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/service/dynamic.js +1 -1
- package/lib/commands/service/function-name-adapter.js +1 -1
- package/lib/commands/service/index.js +1 -1
- package/lib/commands/service/registry.js +1 -1
- package/lib/commands/skill/commands/create.js +1 -1
- package/lib/commands/skill/commands/diagram.js +1 -1
- package/lib/commands/skill/commands/install.js +1 -1
- package/lib/commands/skill/commands/list.js +1 -1
- package/lib/commands/skill/commands/push.js +1 -1
- package/lib/commands/skill/commands/validate.js +1 -1
- package/lib/commands/skill/diagram.js +1 -1
- package/lib/commands/skill/flags.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/skill/manifest-helpers.js +1 -1
- package/lib/commands/skill/push-execute.js +1 -1
- package/lib/commands/skill/push-flow-helpers.js +1 -1
- package/lib/commands/skill/push-retarget.js +1 -1
- package/lib/commands/skill/scopes.js +1 -1
- package/lib/commands/skill/summary.js +1 -1
- package/lib/commands/skill/templates.js +1 -1
- package/lib/commands/skill/validate.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/update.js +1 -1
- package/lib/commands/user-account/bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/config/domain-config.d.ts +1 -1
- package/lib/config/domain-config.js +1 -1
- package/lib/config/schema.d.ts +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/app.js +1 -1
- package/lib/constant/auth-mode.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/distribution.js +1 -1
- package/lib/constant/domain.d.ts +6 -0
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.d.ts +5 -6
- 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.d.ts +3 -13
- package/lib/context.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/kb-management-client.js +1 -1
- package/lib/core/kb-sdk-errors.js +1 -1
- package/lib/core/kb-search-client.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/access-error.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/preparse.js +1 -1
- package/lib/framework/rate-limit.js +1 -1
- package/lib/framework/raw-flags.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-confirmation.js +1 -1
- package/lib/framework/runner-error.js +1 -1
- package/lib/framework/runner.d.ts +2 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/service-order.js +1 -1
- package/lib/framework/types.d.ts +2 -0
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/generated/official-routing.d.ts +3 -1
- package/lib/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.d.ts +2 -2
- package/lib/generated/routing-contract.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/services/dataset-import/auto-id-runner.js +1 -1
- package/lib/services/dataset-import/excel-reader.js +1 -1
- package/lib/services/dataset-import/image-bytes.js +1 -1
- package/lib/services/dataset-import/image-ooxml.js +1 -1
- package/lib/services/dataset-import/image-runner.js +1 -1
- package/lib/services/dataset-import/metadata.js +1 -1
- package/lib/services/dataset-import/preview.js +1 -1
- package/lib/services/dataset-import/runner.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/runtime-skill-sync/constants.js +1 -1
- package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
- package/lib/skills/runtime-skill-sync/hashing.js +1 -1
- package/lib/skills/runtime-skill-sync/install-target.js +1 -1
- package/lib/skills/runtime-skill-sync/links.js +1 -1
- package/lib/skills/runtime-skill-sync/list-local.js +1 -1
- package/lib/skills/runtime-skill-sync/local-files.js +1 -1
- package/lib/skills/runtime-skill-sync/materialize.js +1 -1
- package/lib/skills/runtime-skill-sync/metadata.js +1 -1
- package/lib/skills/runtime-skill-sync/paths.js +1 -1
- package/lib/skills/runtime-skill-sync/push.js +1 -1
- package/lib/skills/runtime-skill-sync/scopes.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/utils/access-key-redaction.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/lossless-json.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/positive-safe-integer.js +1 -1
- package/lib/utils/redaction.js +1 -1
- package/lib/utils/runtime-user-id.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/lovrabet/SKILL.md +31 -132
- package/skills/lovrabet/guides/app-resolution.md +39 -139
- package/skills/lovrabet/guides/dataset-and-data-workflow.md +4 -3
- package/skills/lovrabet/guides/sql-and-bff-workflow.md +12 -27
- package/skills/lovrabet/guides/troubleshooting.md +11 -31
- package/skills/lovrabet/references/dataset-discovery-workflow.md +10 -48
- package/skills/lovrabet/references/instant-api-workflow.md +4 -11
- package/skills/lovrabet/references/lovrabet-app.md +6 -33
- package/skills/lovrabet/references/lovrabet-auth.md +16 -9
- package/skills/lovrabet/references/lovrabet-bff-workflow.md +9 -34
- package/skills/lovrabet/references/lovrabet-config.md +49 -31
- package/skills/lovrabet/references/lovrabet-kb-workflow.md +2 -2
- package/skills/lovrabet/references/lovrabet-service-tree.md +11 -9
- package/skills/lovrabet/references/lovrabet-sql-workflow.md +9 -34
- package/skills/lovrabet/references/lovrabet-workspace.md +12 -11
- package/skills/lovrabet.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2f1a51,_0x1238c1){const _0x25f7b5=a160_0x3019,_0x4d4846=_0x2f1a51();while(!![]){try{const _0x3c3d50=-parseInt(_0x25f7b5(0x13e))/0x1+parseInt(_0x25f7b5(0x159))/0x2*(parseInt(_0x25f7b5(0x139))/0x3)+parseInt(_0x25f7b5(0x148))/0x4+parseInt(_0x25f7b5(0x15d))/0x5*(-parseInt(_0x25f7b5(0x12c))/0x6)+-parseInt(_0x25f7b5(0x141))/0x7+-parseInt(_0x25f7b5(0x12e))/0x8*(parseInt(_0x25f7b5(0x153))/0x9)+-parseInt(_0x25f7b5(0x146))/0xa*(-parseInt(_0x25f7b5(0x145))/0xb);if(_0x3c3d50===_0x1238c1)break;else _0x4d4846['push'](_0x4d4846['shift']());}catch(_0x28bb9f){_0x4d4846['push'](_0x4d4846['shift']());}}}(a160_0x2a44,0xd92d2));function a160_0x3019(_0x39fc18,_0x5d4ff2){_0x39fc18=_0x39fc18-0x12c;const _0x2a44dc=a160_0x2a44();let _0x301949=_0x2a44dc[_0x39fc18];return _0x301949;}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(_0x454dc6){const _0x4384d8=a160_0x3019;return _0x454dc6[_0x4384d8(0x158)]??Buffer[_0x4384d8(0x138)](_0x454dc6[_0x4384d8(0x13b)]??'',_0x4384d8(0x14e));}export function fileText(_0x268a95){const _0x1719be=a160_0x3019;return fileContent(_0x268a95)['toString'](_0x1719be(0x14e));}export function normalizeLocalFiles(_0x100ebb){const _0x272367=a160_0x3019;if(!Array[_0x272367(0x131)](_0x100ebb)||_0x100ebb[_0x272367(0x157)]===0x0)return[];const _0x538a43=new Map();for(const _0x5bbffb of _0x100ebb){if(!_0x5bbffb||typeof _0x5bbffb!==_0x272367(0x140)||typeof _0x5bbffb[_0x272367(0x154)]!=='string')throw CliErrors['validation'](_0x272367(0x151));const _0x1a6568=normalizeSkillRelativePath(_0x5bbffb['path']);if(_0x538a43[_0x272367(0x14f)](_0x1a6568))throw CliErrors['validation']('Duplicate\x20Skill\x20file\x20path:\x20'+_0x1a6568);if(_0x5bbffb['bytes']!==undefined&&!Buffer[_0x272367(0x135)](_0x5bbffb[_0x272367(0x158)]))throw CliErrors[_0x272367(0x155)](_0x272367(0x12f)+_0x1a6568);if(_0x5bbffb[_0x272367(0x158)]===undefined&&typeof _0x5bbffb[_0x272367(0x13b)]!==_0x272367(0x152))throw CliErrors[_0x272367(0x155)](_0x272367(0x12d)+_0x1a6568);const _0x356669=fileContent(_0x5bbffb);_0x538a43[_0x272367(0x137)](_0x1a6568,{'path':_0x1a6568,'bytes':_0x356669});}return Array['from'](_0x538a43[_0x272367(0x15b)]())[_0x272367(0x14c)](compareSkillFiles);}export function normalizeManifestFiles(_0x62a0b4){const _0x5db59c=a160_0x3019;if(!Array[_0x5db59c(0x131)](_0x62a0b4)||_0x62a0b4[_0x5db59c(0x157)]===0x0)return[];const _0x4611af=new Map();for(const _0x172cb5 of _0x62a0b4){if(!_0x172cb5||typeof _0x172cb5!==_0x5db59c(0x140)||typeof _0x172cb5[_0x5db59c(0x154)]!=='string')throw CliErrors[_0x5db59c(0x155)](_0x5db59c(0x151));const _0x177253=normalizeSkillRelativePath(_0x172cb5[_0x5db59c(0x154)]);if(_0x4611af['has'](_0x177253))throw CliErrors[_0x5db59c(0x155)](_0x5db59c(0x150)+_0x177253);if(!isSha256Hex(_0x172cb5[_0x5db59c(0x136)]))throw CliErrors[_0x5db59c(0x155)](_0x5db59c(0x144)+_0x177253);if(!Number[_0x5db59c(0x13c)](_0x172cb5[_0x5db59c(0x149)])||_0x172cb5['size']<0x0)throw CliErrors[_0x5db59c(0x155)]('Skill\x20file\x20size\x20is\x20invalid:\x20'+_0x177253);_0x4611af[_0x5db59c(0x137)](_0x177253,{'path':_0x177253,'sha256':_0x172cb5[_0x5db59c(0x136)][_0x5db59c(0x142)](),'size':_0x172cb5[_0x5db59c(0x149)]});}return Array[_0x5db59c(0x138)](_0x4611af['values']())[_0x5db59c(0x14c)](compareSkillFiles);}export function scanSkillDirectory(_0xc12992,_0x46aabe={}){const _0x54e2a4=realpathSync(_0xc12992),_0x72b94=canonicalExcludedFilePaths(_0x46aabe['excludedFilePaths']),_0x28faf9=[];function _0x3f717c(_0x23b5b0){const _0x24f256=a160_0x3019,_0x1898a5=readdirSync(_0x23b5b0,{'withFileTypes':!![]})['sort']((_0xf2bf29,_0x545dae)=>_0xf2bf29[_0x24f256(0x15e)][_0x24f256(0x156)](_0x545dae[_0x24f256(0x15e)]));for(const _0x21d6dc of _0x1898a5){if(_0x21d6dc['isDirectory']()&&IGNORED_DIR_NAMES[_0x24f256(0x14f)](_0x21d6dc[_0x24f256(0x15e)]))continue;if(IGNORED_FILE_NAMES[_0x24f256(0x14f)](_0x21d6dc['name']))continue;const _0x1ffda8=resolve(_0x23b5b0,_0x21d6dc[_0x24f256(0x15e)]);if(isExcludedFilePath(_0x1ffda8,_0x72b94))continue;if(_0x21d6dc[_0x24f256(0x13d)]())throw CliErrors['validation'](_0x24f256(0x147)+_0x1ffda8);const _0x229120=toPosixPath(relative(_0x54e2a4,_0x1ffda8));if(_0x21d6dc[_0x24f256(0x133)]()){_0x3f717c(_0x1ffda8);continue;}if(!_0x21d6dc[_0x24f256(0x130)]())continue;validateSkillRelativePath(_0x229120);const _0x5f6d2e=readFileSync(_0x1ffda8);_0x28faf9[_0x24f256(0x132)]({'path':_0x229120,'bytes':_0x5f6d2e});}}return _0x3f717c(_0x54e2a4),normalizeLocalFiles(_0x28faf9);}function canonicalExcludedFilePaths(_0x489283){const _0x1a0984=a160_0x3019,_0x7f8fd3=new Set();for(const _0x380739 of _0x489283??[]){const _0x4f0db2=resolve(_0x380739);_0x7f8fd3[_0x1a0984(0x134)](_0x4f0db2);try{_0x7f8fd3['add'](realpathSync(_0x4f0db2));}catch{}}return _0x7f8fd3;}function isExcludedFilePath(_0x10282a,_0x2e15ef){const _0x80150b=a160_0x3019;if(_0x2e15ef['has'](_0x10282a))return!![];if(_0x2e15ef[_0x80150b(0x149)]===0x0)return![];try{return _0x2e15ef['has'](realpathSync(_0x10282a));}catch{return![];}}export function compareSkillFiles(_0x5ded0c,_0x459c40){const _0x50cba8=a160_0x3019;if(_0x5ded0c['path']===SKILL_FILE)return _0x459c40[_0x50cba8(0x154)]===SKILL_FILE?0x0:-0x1;if(_0x459c40[_0x50cba8(0x154)]===SKILL_FILE)return 0x1;return Buffer[_0x50cba8(0x15a)](Buffer[_0x50cba8(0x138)](_0x5ded0c[_0x50cba8(0x154)],_0x50cba8(0x14e)),Buffer['from'](_0x459c40[_0x50cba8(0x154)],'utf8'));}function a160_0x2a44(){const _0x18b668=['trim','startsWith','sort','split','utf8','has','Duplicate\x20Skill\x20file\x20path:\x20','Skill\x20file\x20path\x20must\x20be\x20text.','string','792yYVoUG','path','validation','localeCompare','length','bytes','409246zXvfIU','compare','values','replace','11030jwiaKJ','name','684LGTYZL','Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20','44960EThqjk','Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20','isFile','isArray','push','isDirectory','add','isBuffer','sha256','set','from','6AaZSXN','Unsafe\x20Skill\x20file\x20path:\x20','content','isSafeInteger','isSymbolicLink','56238mGRGcS','includes','object','5138175FCHvzt','toLowerCase','test','Skill\x20file\x20sha256\x20is\x20invalid:\x20','21871333teGSmX','10RCASBG','Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20','113248vcjsrC','size'];a160_0x2a44=function(){return _0x18b668;};return a160_0x2a44();}export function normalizeSkillRelativePath(_0x2f8abb){const _0x1a1b30=a160_0x3019,_0x2e6060=toPosixPath(_0x2f8abb[_0x1a1b30(0x14a)]());return validateSkillRelativePath(_0x2e6060),_0x2e6060;}export function validateSkillRelativePath(_0x5ee67b){const _0x42b7a0=a160_0x3019;if(!_0x5ee67b||_0x5ee67b[_0x42b7a0(0x14b)]('/')||_0x5ee67b[_0x42b7a0(0x13f)]('//'))throw CliErrors['validation'](_0x42b7a0(0x13a)+_0x5ee67b);for(const _0x5920b7 of _0x5ee67b[_0x42b7a0(0x14d)]('/')){if(!_0x5920b7||_0x5920b7==='.'||_0x5920b7==='..')throw CliErrors['validation']('Unsafe\x20Skill\x20file\x20path:\x20'+_0x5ee67b);}}export function toPosixPath(_0x462d33){const _0x1555d5=a160_0x3019;return _0x462d33[_0x1555d5(0x15c)](/\\/g,'/');}export function isSha256Hex(_0x48358b){const _0x3fdfd1=a160_0x3019;return typeof _0x48358b===_0x3fdfd1(0x152)&&/^[a-fA-F0-9]{64}$/[_0x3fdfd1(0x143)](_0x48358b);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x5a502f,_0x3cc9ba){const _0x18627c=a161_0x841a,_0x13e7ea=_0x5a502f();while(!![]){try{const _0xc9bbc9=parseInt(_0x18627c(0x17d))/0x1*(-parseInt(_0x18627c(0x146))/0x2)+-parseInt(_0x18627c(0x14e))/0x3*(-parseInt(_0x18627c(0x169))/0x4)+-parseInt(_0x18627c(0x163))/0x5+-parseInt(_0x18627c(0x15b))/0x6*(parseInt(_0x18627c(0x172))/0x7)+parseInt(_0x18627c(0x17a))/0x8+parseInt(_0x18627c(0x178))/0x9*(parseInt(_0x18627c(0x17b))/0xa)+parseInt(_0x18627c(0x15c))/0xb;if(_0xc9bbc9===_0x3cc9ba)break;else _0x13e7ea['push'](_0x13e7ea['shift']());}catch(_0x177f5c){_0x13e7ea['push'](_0x13e7ea['shift']());}}}(a161_0x50a7,0x905a3));import{existsSync,lstatSync,mkdirSync,readFileSync,rmSync}from'node:fs';function a161_0x841a(_0x4ac864,_0x19376c){_0x4ac864=_0x4ac864-0x141;const _0x50a7e8=a161_0x50a7();let _0x841a8b=_0x50a7e8[_0x4ac864];return _0x841a8b;}import{dirname,resolve}from'node:path';import{isCollection,isMap,isNode,parseDocument,visit}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{resolveManagedFilePath,writeBytesAtomic,writeJsonAtomic}from'./fs-utils.js';import{bufferSha256,contentHash,fileHash}from'./hashing.js';import{fileContent,fileText,normalizeLocalFiles}from'./local-files.js';import{buildMetadata,readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillDir}from'./paths.js';import{extractDownloadedPackage,requirePackageBytes}from'./zip-package.js';export function materializeRuntimeSkill(_0x259ca6,_0xf63e2d,_0x135aba){const _0x166ef5=a161_0x841a,_0x3e0728=requireSkillCode(_0x259ca6),_0x26427a=requirePackageBytes(_0x3e0728,_0x135aba[_0x166ef5(0x167)]),_0xdbd47d=extractDownloadedPackage(_0x26427a),_0x39eff4=_0xdbd47d[_0x166ef5(0x14b)](_0x2e2ba0=>_0x2e2ba0[_0x166ef5(0x147)]===SKILL_FILE);if(!_0x39eff4)throw CliErrors[_0x166ef5(0x143)](_0x166ef5(0x165)+SKILL_FILE+':\x20'+_0x3e0728);const _0x3bcd9c=withMaterializedSkillFrontmatter(_0xdbd47d,_0x259ca6,_0x3e0728),_0x93ca6b=_0x3bcd9c[_0x166ef5(0x14b)](_0x53abce=>_0x53abce[_0x166ef5(0x147)]===SKILL_FILE),_0x58a06e=fileText(_0x93ca6b),_0xd66d48=getRuntimeSkillDir(_0x135aba[_0x166ef5(0x154)],_0x135aba[_0x166ef5(0x16e)],_0x135aba[_0x166ef5(0x176)],_0xf63e2d,_0x3e0728,_0x135aba[_0x166ef5(0x153)]),_0x179198=resolve(_0xd66d48,SKILL_FILE),_0x4d5d76=resolve(_0xd66d48,METADATA_FILE),_0x5764a2=contentHash(_0x58a06e),_0x15f2bc=readMetadataIfPresent(_0x4d5d76)?.[_0x166ef5(0x177)];ensurePulledFilesCanBeOverwritten(_0xd66d48,_0x4d5d76,_0x3bcd9c,_0x135aba[_0x166ef5(0x174)]===!![]),mkdirSync(_0xd66d48,{'recursive':!![],'mode':0x1c0});const _0x188097=existsSync(_0x179198)?readFileSync(_0x179198,_0x166ef5(0x179)):undefined;return materializeFiles(_0xd66d48,_0x3bcd9c),removeStaleManagedFiles(_0xd66d48,_0x15f2bc,_0x3bcd9c),writeJsonAtomic(_0x4d5d76,buildMetadata(_0x259ca6,_0xf63e2d,_0x135aba[_0x166ef5(0x176)],_0x5764a2,_0x135aba[_0x166ef5(0x15e)],_0x3bcd9c,_0x26427a)),{'skill':_0x259ca6,'scope':_0xf63e2d,'dir':_0xd66d48,'skillMdPath':_0x179198,'metadataPath':_0x4d5d76,'contentHash':_0x5764a2,'changed':_0x188097!==_0x58a06e};}export function reuseMaterializedRuntimeSkill(_0x4cb41f,_0x96954b,_0xa266c0){const _0x160a7f=a161_0x841a,_0x1bfc4e=_0x4cb41f['version']?.['trim']();if(!_0x1bfc4e)return undefined;const _0x5e2ee4=requireSkillCode(_0x4cb41f),_0x7d2690=getRuntimeSkillDir(_0xa266c0[_0x160a7f(0x154)],_0xa266c0['accessKey'],_0xa266c0[_0x160a7f(0x176)],_0x96954b,_0x5e2ee4,_0xa266c0['paths']),_0x3bf411=resolve(_0x7d2690,SKILL_FILE),_0x24e45a=resolve(_0x7d2690,METADATA_FILE),_0x1c36a3=readMetadataIfPresent(_0x24e45a);if(!_0x1c36a3||_0x1c36a3[_0x160a7f(0x170)]!==0x2||_0x1c36a3[_0x160a7f(0x176)]!==_0xa266c0[_0x160a7f(0x176)]||_0x1c36a3[_0x160a7f(0x14a)]!==_0x96954b||_0x1c36a3['skillCode']!==_0x5e2ee4||_0x1c36a3[_0x160a7f(0x159)]!==_0x1bfc4e||_0x1c36a3['id']!==_0x4cb41f['id']||_0x1c36a3[_0x160a7f(0x164)]!==_0x4cb41f[_0x160a7f(0x164)]||_0x1c36a3['description']!==_0x4cb41f[_0x160a7f(0x162)]||_0x1c36a3[_0x160a7f(0x16b)]!==_0x4cb41f[_0x160a7f(0x16b)]||_0x1c36a3['status']!==_0x4cb41f[_0x160a7f(0x17e)]||!_0x1c36a3[_0x160a7f(0x152)]||!_0x1c36a3['fileHashes']||!Object[_0x160a7f(0x149)](_0x1c36a3[_0x160a7f(0x177)],SKILL_FILE))return undefined;for(const [_0x561162,_0x1ebc23]of Object['entries'](_0x1c36a3['fileHashes'])){if(!/^[a-f0-9]{64}$/[_0x160a7f(0x150)](_0x1ebc23))return undefined;const _0x2de6c8=resolveManagedFilePath(_0x7d2690,_0x561162);if(!existsSync(_0x2de6c8)||!lstatSync(_0x2de6c8)[_0x160a7f(0x16f)]())return undefined;if(bufferSha256(readFileSync(_0x2de6c8))!==_0x1ebc23)return undefined;}return{'skill':_0x4cb41f,'scope':_0x96954b,'dir':_0x7d2690,'skillMdPath':_0x3bf411,'metadataPath':_0x24e45a,'contentHash':_0x1c36a3[_0x160a7f(0x152)],'changed':![]};}function withMaterializedSkillFrontmatter(_0x50808,_0x49586a,_0xeb9759){const _0x4335ac=a161_0x841a,_0x473db7=skillDisplayName(_0x49586a,_0xeb9759),_0x2b6060=_0x49586a[_0x4335ac(0x162)]?.[_0x4335ac(0x14d)]()||_0x473db7||_0xeb9759;return normalizeLocalFiles(_0x50808)[_0x4335ac(0x14c)](_0x9c88f9=>{const _0x558d98=_0x4335ac,_0x128920=fileText(_0x9c88f9);if(_0x9c88f9[_0x558d98(0x147)]!==SKILL_FILE)return _0x9c88f9;if(hasYamlFrontmatter(_0x128920))return{'path':_0x9c88f9[_0x558d98(0x147)],'content':withSyncedDisplayName(_0x128920,_0x473db7)};return{'path':_0x9c88f9[_0x558d98(0x147)],'content':prependSkillFrontmatter(_0x128920,{'name':_0xeb9759,'displayName':_0x473db7,'description':_0x2b6060})};});}function hasYamlFrontmatter(_0x5872d1){const _0x4e0980=a161_0x841a;return/^\uFEFF?---\s*\r?\n/[_0x4e0980(0x150)](_0x5872d1);}function a161_0x50a7(){const _0x5b5d26=['193796NPyOXB','Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20','example','trimEnd','replace','accessKey','isFile','schemaVersion','Managed\x20file\x20was\x20removed\x20locally:\x20','4959024XEgkNc','keys','force','match','appCode','fileHashes','1143aCkykI','utf8','7305624VJxeXV','4490YRoqMG','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','33wtvfFk','status','contents','name','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','validation','---','length','52386bMLUJf','path','filter','hasOwn','scope','find','map','trim','3wUYhtl','flow','test','---\x0a','contentHash','paths','env','stringify','entries','toString','errors','version','.\x20Changed\x20file:\x20','6KuHEjH','19231927eLidau','slice','pulledAt','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','has','description:\x20','description','3014820eGJaBP','skillName','Runtime\x20Skill\x20package\x20is\x20missing\x20','displayName','packageBytes','set'];a161_0x50a7=function(){return _0x5b5d26;};return a161_0x50a7();}function prependSkillFrontmatter(_0x62cb5b,_0x1fccb6){const _0x3330f5=a161_0x841a,_0x1860a7=_0x62cb5b[_0x3330f5(0x16d)](/^\uFEFF/,'');return[_0x3330f5(0x144),'name:\x20'+yamlString(_0x1fccb6[_0x3330f5(0x141)]),_0x1fccb6['displayName']?'displayName:\x20'+yamlString(_0x1fccb6[_0x3330f5(0x166)]):undefined,_0x3330f5(0x161)+yamlString(_0x1fccb6[_0x3330f5(0x162)]),_0x3330f5(0x144),'',_0x1860a7][_0x3330f5(0x148)](_0x4cb06f=>_0x4cb06f!==undefined)['join']('\x0a');}function yamlString(_0xcbbdd5){const _0x588311=a161_0x841a;return JSON[_0x588311(0x155)](_0xcbbdd5['replace'](/\r/g,'')['trim']());}function skillDisplayName(_0x32dd0b,_0x1b4054){const _0x22344e=a161_0x841a,_0x516718=_0x32dd0b[_0x22344e(0x164)]?.[_0x22344e(0x14d)]();return _0x516718||_0x1b4054;}function withSyncedDisplayName(_0x2b7f54,_0x483d9a){const _0x261de9=a161_0x841a,_0x249a37=_0x2b7f54[_0x261de9(0x175)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x249a37)return _0x2b7f54;const _0x358497=_0x249a37[0x1]??'',_0x427693=_0x249a37[0x2]??'',_0x491ef4=parseDocument(_0x427693);if(_0x491ef4[_0x261de9(0x158)][_0x261de9(0x145)]>0x0||!isMap(_0x491ef4[_0x261de9(0x17f)]))return _0x2b7f54;if(_0x483d9a)_0x491ef4[_0x261de9(0x168)]('displayName',_0x483d9a);else{if(_0x491ef4[_0x261de9(0x160)](_0x261de9(0x166)))_0x491ef4['delete'](_0x261de9(0x166));else return _0x2b7f54;}forceBlockCollections(_0x491ef4[_0x261de9(0x17f)]);const _0x1b0003=_0x491ef4[_0x261de9(0x157)]({'lineWidth':0x0})[_0x261de9(0x16c)](),_0x144965=_0x2b7f54[_0x261de9(0x15d)](_0x249a37[0x0][_0x261de9(0x145)])[_0x261de9(0x16d)](/^\r?\n/,'');return _0x358497+_0x261de9(0x151)+_0x1b0003+'\x0a---\x0a\x0a'+_0x144965;}function forceBlockCollections(_0x3d7f79){if(!isNode(_0x3d7f79))return;visit(_0x3d7f79,(_0x3c378a,_0x996552)=>{const _0x510d6d=a161_0x841a;isCollection(_0x996552)&&(_0x996552[_0x510d6d(0x14f)]=![]);});}function ensurePulledFilesCanBeOverwritten(_0x422ac5,_0x8fb869,_0x1e769f,_0x1f2a73){const _0x17f4e8=a161_0x841a;if(_0x1f2a73||!existsSync(_0x8fb869))return;const _0x19c615=readMetadataIfPresent(_0x8fb869);if(!_0x19c615)return;const _0x2c990b=_0x19c615['fileHashes']&&Object[_0x17f4e8(0x173)](_0x19c615[_0x17f4e8(0x177)])[_0x17f4e8(0x145)]>0x0?_0x19c615[_0x17f4e8(0x177)]:undefined;if(_0x2c990b)for(const [_0x6dbb29,_0x12117c]of Object[_0x17f4e8(0x156)](_0x2c990b)){const _0x7339d6=resolveManagedFilePath(_0x422ac5,_0x6dbb29);if(!existsSync(_0x7339d6))throw CliErrors[_0x17f4e8(0x143)](_0x17f4e8(0x142)+_0x422ac5,_0x17f4e8(0x171)+_0x6dbb29);const _0x44a3e6=lstatSync(_0x7339d6);if(!_0x44a3e6['isFile']())throw CliErrors['validation'](_0x17f4e8(0x142)+_0x422ac5,_0x17f4e8(0x16a)+_0x6dbb29);const _0x128d67=bufferSha256(readFileSync(_0x7339d6));if(_0x128d67!==_0x12117c)throw CliErrors[_0x17f4e8(0x143)](_0x17f4e8(0x142)+_0x422ac5+_0x17f4e8(0x15a)+_0x6dbb29,_0x17f4e8(0x15f)+_0x6dbb29);}else{const _0x56d05c=resolve(_0x422ac5,SKILL_FILE);if(existsSync(_0x56d05c)&&_0x19c615['contentHash']){const _0x53cf4d=contentHash(readFileSync(_0x56d05c,_0x17f4e8(0x179)));if(_0x53cf4d!==_0x19c615[_0x17f4e8(0x152)])throw CliErrors['validation'](_0x17f4e8(0x17c)+_0x56d05c,'Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.');}}for(const _0x36411c of normalizeLocalFiles(_0x1e769f)){if(_0x2c990b?.[_0x36411c['path']])continue;if(!_0x2c990b&&_0x36411c[_0x17f4e8(0x147)]===SKILL_FILE)continue;const _0x413fa4=resolveManagedFilePath(_0x422ac5,_0x36411c[_0x17f4e8(0x147)]);if(!existsSync(_0x413fa4))continue;const _0x2e3819=lstatSync(_0x413fa4);if(!_0x2e3819['isFile']())throw CliErrors[_0x17f4e8(0x143)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x422ac5,'Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20'+_0x36411c[_0x17f4e8(0x147)]);const _0x377b4f=bufferSha256(readFileSync(_0x413fa4));if(_0x377b4f!==fileHash(_0x36411c))throw CliErrors['validation']('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x422ac5,'Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20'+_0x36411c[_0x17f4e8(0x147)]);}}function materializeFiles(_0x418f14,_0x671edb){const _0x5629f6=a161_0x841a;for(const _0x4b5c73 of normalizeLocalFiles(_0x671edb)){const _0x28c3f3=resolveManagedFilePath(_0x418f14,_0x4b5c73[_0x5629f6(0x147)]);mkdirSync(dirname(_0x28c3f3),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x28c3f3,fileContent(_0x4b5c73),0x180);}}function removeStaleManagedFiles(_0x41dc4e,_0x2852c7,_0x4badf7){const _0x1e1a68=a161_0x841a;if(!_0x2852c7)return;const _0xd0f6fd=new Set(normalizeLocalFiles(_0x4badf7)[_0x1e1a68(0x14c)](_0xe48d96=>_0xe48d96[_0x1e1a68(0x147)]));for(const _0x433db9 of Object[_0x1e1a68(0x173)](_0x2852c7)){if(_0xd0f6fd[_0x1e1a68(0x160)](_0x433db9))continue;const _0x510668=resolveManagedFilePath(_0x41dc4e,_0x433db9);existsSync(_0x510668)&&lstatSync(_0x510668)['isFile']()&&rmSync(_0x510668,{'force':!![]});}}
|
|
1
|
+
(function(_0x330c68,_0x18e25a){const _0x52e9cd=a161_0x6b9d,_0x14952f=_0x330c68();while(!![]){try{const _0x19ed2d=parseInt(_0x52e9cd(0x1b2))/0x1*(-parseInt(_0x52e9cd(0x18e))/0x2)+-parseInt(_0x52e9cd(0x18b))/0x3*(parseInt(_0x52e9cd(0x187))/0x4)+-parseInt(_0x52e9cd(0x192))/0x5*(-parseInt(_0x52e9cd(0x196))/0x6)+parseInt(_0x52e9cd(0x1a4))/0x7+-parseInt(_0x52e9cd(0x1a7))/0x8*(-parseInt(_0x52e9cd(0x18d))/0x9)+-parseInt(_0x52e9cd(0x1ad))/0xa+-parseInt(_0x52e9cd(0x194))/0xb*(-parseInt(_0x52e9cd(0x179))/0xc);if(_0x19ed2d===_0x18e25a)break;else _0x14952f['push'](_0x14952f['shift']());}catch(_0x86bd51){_0x14952f['push'](_0x14952f['shift']());}}}(a161_0x3916,0x86880));function a161_0x3916(){const _0x4950c9=['env','name:\x20','delete','displayName','version','isFile','toString','Managed\x20file\x20was\x20removed\x20locally:\x20','112KVJooy','paths','hasOwn','contentHash','20067KckzYy','match','9WhGFiF','229386qSxYhV','scope','example','fileHashes','5HMgOjD','replace','62986vlmSNb','contents','1066620WuRcYi','filter','slice','test','validation','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','.\x20Changed\x20file:\x20','displayName:\x20','find','entries','appCode','keys','schemaVersion','5685820GCHIUZ','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','path','2420936TVRQAO','errors','name','Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20','trimEnd','pulledAt','7080520uWFolK','packageBytes','utf8','Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20','---','5kxdIvV','skillName','map','---\x0a','length','description','1524lSYzTC','\x0a---\x0a\x0a','trim','accessKey','status','has'];a161_0x3916=function(){return _0x4950c9;};return a161_0x3916();}import{existsSync,lstatSync,mkdirSync,readFileSync,rmSync}from'node:fs';import{dirname,resolve}from'node:path';import{isCollection,isMap,isNode,parseDocument,visit}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{resolveManagedFilePath,writeBytesAtomic,writeJsonAtomic}from'./fs-utils.js';import{bufferSha256,contentHash,fileHash}from'./hashing.js';import{fileContent,fileText,normalizeLocalFiles}from'./local-files.js';import{buildMetadata,readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillDir}from'./paths.js';import{extractDownloadedPackage,requirePackageBytes}from'./zip-package.js';export function materializeRuntimeSkill(_0x9d755,_0x595009,_0x240ae7){const _0x1ea068=a161_0x6b9d,_0x28a075=requireSkillCode(_0x9d755),_0x41cd08=requirePackageBytes(_0x28a075,_0x240ae7[_0x1ea068(0x1ae)]),_0x2c7a67=extractDownloadedPackage(_0x41cd08),_0x296e4e=_0x2c7a67['find'](_0xb5dd09=>_0xb5dd09[_0x1ea068(0x1a6)]===SKILL_FILE);if(!_0x296e4e)throw CliErrors[_0x1ea068(0x19a)]('Runtime\x20Skill\x20package\x20is\x20missing\x20'+SKILL_FILE+':\x20'+_0x28a075);const _0x5f1ade=withMaterializedSkillFrontmatter(_0x2c7a67,_0x9d755,_0x28a075),_0x2a0e33=_0x5f1ade[_0x1ea068(0x19f)](_0x19a54b=>_0x19a54b[_0x1ea068(0x1a6)]===SKILL_FILE),_0x11ad60=fileText(_0x2a0e33),_0x495bc1=getRuntimeSkillDir(_0x240ae7[_0x1ea068(0x17f)],_0x240ae7[_0x1ea068(0x17c)],_0x240ae7[_0x1ea068(0x1a1)],_0x595009,_0x28a075,_0x240ae7[_0x1ea068(0x188)]),_0xb273a4=resolve(_0x495bc1,SKILL_FILE),_0x2071bd=resolve(_0x495bc1,METADATA_FILE),_0x5a8ae0=contentHash(_0x11ad60),_0x4a949e=readMetadataIfPresent(_0x2071bd)?.[_0x1ea068(0x191)];ensurePulledFilesCanBeOverwritten(_0x495bc1,_0x2071bd,_0x5f1ade,_0x240ae7['force']===!![]),mkdirSync(_0x495bc1,{'recursive':!![],'mode':0x1c0});const _0x599281=existsSync(_0xb273a4)?readFileSync(_0xb273a4,_0x1ea068(0x1af)):undefined;return materializeFiles(_0x495bc1,_0x5f1ade),removeStaleManagedFiles(_0x495bc1,_0x4a949e,_0x5f1ade),writeJsonAtomic(_0x2071bd,buildMetadata(_0x9d755,_0x595009,_0x240ae7[_0x1ea068(0x1a1)],_0x5a8ae0,_0x240ae7[_0x1ea068(0x1ac)],_0x5f1ade,_0x41cd08)),{'skill':_0x9d755,'scope':_0x595009,'dir':_0x495bc1,'skillMdPath':_0xb273a4,'metadataPath':_0x2071bd,'contentHash':_0x5a8ae0,'changed':_0x599281!==_0x11ad60};}export function reuseMaterializedRuntimeSkill(_0x5ec461,_0x504099,_0x3fbe76){const _0x26facc=a161_0x6b9d,_0x37b18b=_0x5ec461[_0x26facc(0x183)]?.[_0x26facc(0x17b)]();if(!_0x37b18b)return undefined;const _0x2e3e90=requireSkillCode(_0x5ec461),_0xc8c2f2=getRuntimeSkillDir(_0x3fbe76[_0x26facc(0x17f)],_0x3fbe76[_0x26facc(0x17c)],_0x3fbe76[_0x26facc(0x1a1)],_0x504099,_0x2e3e90,_0x3fbe76[_0x26facc(0x188)]),_0x5dcf1f=resolve(_0xc8c2f2,SKILL_FILE),_0x258be0=resolve(_0xc8c2f2,METADATA_FILE),_0x3d6580=readMetadataIfPresent(_0x258be0);if(!_0x3d6580||_0x3d6580[_0x26facc(0x1a3)]!==0x2||_0x3d6580[_0x26facc(0x1a1)]!==_0x3fbe76[_0x26facc(0x1a1)]||_0x3d6580[_0x26facc(0x18f)]!==_0x504099||_0x3d6580['skillCode']!==_0x2e3e90||_0x3d6580[_0x26facc(0x183)]!==_0x37b18b||_0x3d6580['id']!==_0x5ec461['id']||_0x3d6580[_0x26facc(0x1b3)]!==_0x5ec461['skillName']||_0x3d6580[_0x26facc(0x1b7)]!==_0x5ec461[_0x26facc(0x1b7)]||_0x3d6580['example']!==_0x5ec461[_0x26facc(0x190)]||_0x3d6580[_0x26facc(0x17d)]!==_0x5ec461[_0x26facc(0x17d)]||!_0x3d6580[_0x26facc(0x18a)]||!_0x3d6580[_0x26facc(0x191)]||!Object[_0x26facc(0x189)](_0x3d6580['fileHashes'],SKILL_FILE))return undefined;for(const [_0x30ddd1,_0xaac83e]of Object[_0x26facc(0x1a0)](_0x3d6580['fileHashes'])){if(!/^[a-f0-9]{64}$/[_0x26facc(0x199)](_0xaac83e))return undefined;const _0x441eab=resolveManagedFilePath(_0xc8c2f2,_0x30ddd1);if(!existsSync(_0x441eab)||!lstatSync(_0x441eab)['isFile']())return undefined;if(bufferSha256(readFileSync(_0x441eab))!==_0xaac83e)return undefined;}return{'skill':_0x5ec461,'scope':_0x504099,'dir':_0xc8c2f2,'skillMdPath':_0x5dcf1f,'metadataPath':_0x258be0,'contentHash':_0x3d6580['contentHash'],'changed':![]};}function withMaterializedSkillFrontmatter(_0x5e62d3,_0x2f57f1,_0x467791){const _0x98ed83=a161_0x6b9d,_0x486b1a=skillDisplayName(_0x2f57f1,_0x467791),_0x6c228c=_0x2f57f1[_0x98ed83(0x1b7)]?.[_0x98ed83(0x17b)]()||_0x486b1a||_0x467791;return normalizeLocalFiles(_0x5e62d3)[_0x98ed83(0x1b4)](_0x38c85c=>{const _0x296cd0=_0x98ed83,_0xea4aa2=fileText(_0x38c85c);if(_0x38c85c['path']!==SKILL_FILE)return _0x38c85c;if(hasYamlFrontmatter(_0xea4aa2))return{'path':_0x38c85c[_0x296cd0(0x1a6)],'content':withSyncedDisplayName(_0xea4aa2,_0x486b1a)};return{'path':_0x38c85c[_0x296cd0(0x1a6)],'content':prependSkillFrontmatter(_0xea4aa2,{'name':_0x467791,'displayName':_0x486b1a,'description':_0x6c228c})};});}function hasYamlFrontmatter(_0x373433){const _0x325b51=a161_0x6b9d;return/^\uFEFF?---\s*\r?\n/[_0x325b51(0x199)](_0x373433);}function prependSkillFrontmatter(_0x34a695,_0x299c73){const _0x5ead96=a161_0x6b9d,_0x23d631=_0x34a695[_0x5ead96(0x193)](/^\uFEFF/,'');return['---',_0x5ead96(0x180)+yamlString(_0x299c73[_0x5ead96(0x1a9)]),_0x299c73['displayName']?_0x5ead96(0x19e)+yamlString(_0x299c73[_0x5ead96(0x182)]):undefined,'description:\x20'+yamlString(_0x299c73[_0x5ead96(0x1b7)]),_0x5ead96(0x1b1),'',_0x23d631][_0x5ead96(0x197)](_0x24fd82=>_0x24fd82!==undefined)['join']('\x0a');}function yamlString(_0xb6454c){const _0x2777a7=a161_0x6b9d;return JSON['stringify'](_0xb6454c[_0x2777a7(0x193)](/\r/g,'')['trim']());}function skillDisplayName(_0x20b90c,_0x91c225){const _0x5e34fe=a161_0x6b9d,_0x2a62e5=_0x20b90c[_0x5e34fe(0x1b3)]?.[_0x5e34fe(0x17b)]();return _0x2a62e5||_0x91c225;}function withSyncedDisplayName(_0x474b6a,_0x255266){const _0x3486ce=a161_0x6b9d,_0x2ad3a0=_0x474b6a[_0x3486ce(0x18c)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x2ad3a0)return _0x474b6a;const _0x32f659=_0x2ad3a0[0x1]??'',_0xc3d960=_0x2ad3a0[0x2]??'',_0x27aca9=parseDocument(_0xc3d960);if(_0x27aca9[_0x3486ce(0x1a8)][_0x3486ce(0x1b6)]>0x0||!isMap(_0x27aca9[_0x3486ce(0x195)]))return _0x474b6a;if(_0x255266)_0x27aca9['set']('displayName',_0x255266);else{if(_0x27aca9[_0x3486ce(0x17e)](_0x3486ce(0x182)))_0x27aca9[_0x3486ce(0x181)](_0x3486ce(0x182));else return _0x474b6a;}forceBlockCollections(_0x27aca9[_0x3486ce(0x195)]);const _0x3b15c1=_0x27aca9[_0x3486ce(0x185)]({'lineWidth':0x0})[_0x3486ce(0x1ab)](),_0x2d4d04=_0x474b6a[_0x3486ce(0x198)](_0x2ad3a0[0x0][_0x3486ce(0x1b6)])[_0x3486ce(0x193)](/^\r?\n/,'');return _0x32f659+_0x3486ce(0x1b5)+_0x3b15c1+_0x3486ce(0x17a)+_0x2d4d04;}function a161_0x6b9d(_0x2ac8b7,_0x229aa8){_0x2ac8b7=_0x2ac8b7-0x179;const _0x3916f7=a161_0x3916();let _0x6b9d=_0x3916f7[_0x2ac8b7];return _0x6b9d;}function forceBlockCollections(_0x2e0cec){if(!isNode(_0x2e0cec))return;visit(_0x2e0cec,(_0x5cd897,_0x120004)=>{isCollection(_0x120004)&&(_0x120004['flow']=![]);});}function ensurePulledFilesCanBeOverwritten(_0xe821d0,_0x34a368,_0xf07df9,_0x2ef0d6){const _0x2075e4=a161_0x6b9d;if(_0x2ef0d6||!existsSync(_0x34a368))return;const _0x5cafe6=readMetadataIfPresent(_0x34a368);if(!_0x5cafe6)return;const _0x314558=_0x5cafe6['fileHashes']&&Object[_0x2075e4(0x1a2)](_0x5cafe6[_0x2075e4(0x191)])[_0x2075e4(0x1b6)]>0x0?_0x5cafe6['fileHashes']:undefined;if(_0x314558)for(const [_0x9364ea,_0x4b3b37]of Object[_0x2075e4(0x1a0)](_0x314558)){const _0x7f61f7=resolveManagedFilePath(_0xe821d0,_0x9364ea);if(!existsSync(_0x7f61f7))throw CliErrors[_0x2075e4(0x19a)](_0x2075e4(0x19c)+_0xe821d0,_0x2075e4(0x186)+_0x9364ea);const _0x10379e=lstatSync(_0x7f61f7);if(!_0x10379e[_0x2075e4(0x184)]())throw CliErrors[_0x2075e4(0x19a)](_0x2075e4(0x19c)+_0xe821d0,_0x2075e4(0x1aa)+_0x9364ea);const _0x587c6a=bufferSha256(readFileSync(_0x7f61f7));if(_0x587c6a!==_0x4b3b37)throw CliErrors[_0x2075e4(0x19a)](_0x2075e4(0x19c)+_0xe821d0+_0x2075e4(0x19d)+_0x9364ea,_0x2075e4(0x19b)+_0x9364ea);}else{const _0x38b080=resolve(_0xe821d0,SKILL_FILE);if(existsSync(_0x38b080)&&_0x5cafe6[_0x2075e4(0x18a)]){const _0x24041b=contentHash(readFileSync(_0x38b080,_0x2075e4(0x1af)));if(_0x24041b!==_0x5cafe6[_0x2075e4(0x18a)])throw CliErrors['validation']('Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20'+_0x38b080,'Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.');}}for(const _0x3eaabf of normalizeLocalFiles(_0xf07df9)){if(_0x314558?.[_0x3eaabf['path']])continue;if(!_0x314558&&_0x3eaabf[_0x2075e4(0x1a6)]===SKILL_FILE)continue;const _0x3cbbd2=resolveManagedFilePath(_0xe821d0,_0x3eaabf['path']);if(!existsSync(_0x3cbbd2))continue;const _0x453bd3=lstatSync(_0x3cbbd2);if(!_0x453bd3[_0x2075e4(0x184)]())throw CliErrors['validation']('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0xe821d0,_0x2075e4(0x1a5)+_0x3eaabf['path']);const _0x7a5eac=bufferSha256(readFileSync(_0x3cbbd2));if(_0x7a5eac!==fileHash(_0x3eaabf))throw CliErrors[_0x2075e4(0x19a)](_0x2075e4(0x19c)+_0xe821d0,_0x2075e4(0x1b0)+_0x3eaabf[_0x2075e4(0x1a6)]);}}function materializeFiles(_0x38bb50,_0x5e045a){const _0x4e456b=a161_0x6b9d;for(const _0x2a1d03 of normalizeLocalFiles(_0x5e045a)){const _0x1b403b=resolveManagedFilePath(_0x38bb50,_0x2a1d03[_0x4e456b(0x1a6)]);mkdirSync(dirname(_0x1b403b),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x1b403b,fileContent(_0x2a1d03),0x180);}}function removeStaleManagedFiles(_0x577db8,_0x2335d9,_0x54dfc0){const _0x490262=a161_0x6b9d;if(!_0x2335d9)return;const _0xab7b34=new Set(normalizeLocalFiles(_0x54dfc0)[_0x490262(0x1b4)](_0x31e5af=>_0x31e5af['path']));for(const _0x22e878 of Object[_0x490262(0x1a2)](_0x2335d9)){if(_0xab7b34[_0x490262(0x17e)](_0x22e878))continue;const _0x354160=resolveManagedFilePath(_0x577db8,_0x22e878);existsSync(_0x354160)&&lstatSync(_0x354160)['isFile']()&&rmSync(_0x354160,{'force':!![]});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a162_0x483b(_0x6d887b,_0x3e7c92){_0x6d887b=_0x6d887b-0x1dc;const _0x17430d=a162_0x1743();let _0x483bd1=_0x17430d[_0x6d887b];return _0x483bd1;}(function(_0xa77404,_0xb59692){const _0x37e2a5=a162_0x483b,_0x230f54=_0xa77404();while(!![]){try{const _0x14912b=-parseInt(_0x37e2a5(0x202))/0x1*(parseInt(_0x37e2a5(0x1dc))/0x2)+parseInt(_0x37e2a5(0x1ff))/0x3+parseInt(_0x37e2a5(0x1f6))/0x4*(parseInt(_0x37e2a5(0x1e0))/0x5)+-parseInt(_0x37e2a5(0x200))/0x6+parseInt(_0x37e2a5(0x1ec))/0x7*(-parseInt(_0x37e2a5(0x1f5))/0x8)+parseInt(_0x37e2a5(0x1ee))/0x9*(parseInt(_0x37e2a5(0x1df))/0xa)+-parseInt(_0x37e2a5(0x1e7))/0xb*(-parseInt(_0x37e2a5(0x1e4))/0xc);if(_0x14912b===_0xb59692)break;else _0x230f54['push'](_0x230f54['shift']());}catch(_0x5866e8){_0x230f54['push'](_0x230f54['shift']());}}}(a162_0x1743,0x387e0));function a162_0x1743(){const _0x572c9a=['object','zipSha256','Invalid\x20','269556BrdWcS','2313354eNYikH','toISOString','49WmSmfO','3898NlqVnr','map','forkedFromVersion','30rOUBgW','10EPyHPl','tags','userId','parse','12GDYQCg','utf8','fromEntries','5112899liCGsR','length','validation','sourceSessionId','isArray','4627MTQqEx','manifest','876024NJUovy','readonly','hasUpstreamUpdate','status','zipSize','string','trim','1640SVxkEU','2576JQkuIy','ossPath','tenantCode','Runtime\x20Skill\x20is\x20missing\x20skillCode.','forkedFromSkillId','description'];a162_0x1743=function(){return _0x572c9a;};return a162_0x1743();}import{existsSync,readFileSync}from'node:fs';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';import{fileContent,normalizeLocalFiles}from'./local-files.js';import{buildSkillPackage,localFilesToManifestFiles}from'./zip-package.js';export function buildMetadata(_0x4b2ceb,_0x20e1f7,_0x3e3f40,_0x424ad0,_0x606a9a,_0x2d2d52,_0x3c0ea3){const _0x2bc51f=a162_0x483b,_0x48918f=_0x2d2d52?normalizeLocalFiles(_0x2d2d52):[],_0x1a0e7b=!_0x3c0ea3&&_0x48918f[_0x2bc51f(0x1e8)]>0x0?buildSkillPackage(_0x48918f):undefined,_0x40217f=_0x3c0ea3?bufferSha256(_0x3c0ea3):_0x1a0e7b?.[_0x2bc51f(0x1ed)][_0x2bc51f(0x1fd)],_0x1cece9=_0x3c0ea3?.[_0x2bc51f(0x1e8)]??_0x1a0e7b?.[_0x2bc51f(0x1ed)][_0x2bc51f(0x1f2)],_0x750906=_0x48918f['length']>0x0?Object[_0x2bc51f(0x1e6)](_0x48918f['map'](_0x55767f=>[_0x55767f['path'],fileHash(_0x55767f)])):undefined;return{'schemaVersion':_0x48918f[_0x2bc51f(0x1e8)]>0x0?0x2:0x1,'id':_0x4b2ceb['id'],'appCode':_0x3e3f40,'skillCode':requireSkillCode(_0x4b2ceb),'skillName':_0x4b2ceb['skillName'],'description':_0x4b2ceb[_0x2bc51f(0x1fb)],'example':_0x4b2ceb['example'],'scope':_0x20e1f7,'readonly':_0x20e1f7!=='personal'||_0x4b2ceb[_0x2bc51f(0x1ef)]===!![],'tenantCode':_0x4b2ceb[_0x2bc51f(0x1f8)],'userId':_0x4b2ceb[_0x2bc51f(0x1e2)],'version':_0x4b2ceb['version'],'status':_0x4b2ceb[_0x2bc51f(0x1f1)],'tags':Array[_0x2bc51f(0x1eb)](_0x4b2ceb[_0x2bc51f(0x1e1)])?_0x4b2ceb['tags']:[],'hasUpstreamUpdate':_0x4b2ceb[_0x2bc51f(0x1f0)],'forkedFromSkillId':_0x4b2ceb[_0x2bc51f(0x1fa)],'forkedFromVersion':_0x4b2ceb[_0x2bc51f(0x1de)],'sourceSessionId':_0x4b2ceb[_0x2bc51f(0x1ea)],'contentHash':_0x424ad0,'fileHashes':_0x750906,'treeHash':_0x48918f['length']>0x0?fileTreeHash(localFilesToManifestFiles(_0x48918f)):undefined,'ossPath':remoteManifestOssPath(_0x4b2ceb['files']),'zipSha256':_0x40217f,'zipSize':_0x1cece9,'files':_0x48918f['length']>0x0?_0x48918f[_0x2bc51f(0x1dd)](_0x28e776=>({'path':_0x28e776['path'],'hash':fileHash(_0x28e776),'size':fileContent(_0x28e776)[_0x2bc51f(0x1e8)]})):undefined,'pulledAt':_0x606a9a??new Date()[_0x2bc51f(0x201)]()};}export function requireSkillCode(_0x467f71){const _0x5b38c9=a162_0x483b,_0x251f56=_0x467f71['skillCode']?.[_0x5b38c9(0x1f4)]();if(!_0x251f56)throw CliErrors[_0x5b38c9(0x1e9)](_0x5b38c9(0x1f9));return _0x251f56;}export function readMetadataIfPresent(_0x2c9afa){const _0x12bf12=a162_0x483b;if(!existsSync(_0x2c9afa))return undefined;try{const _0x464d9e=JSON[_0x12bf12(0x1e3)](readFileSync(_0x2c9afa,_0x12bf12(0x1e5)));return _0x464d9e;}catch{throw CliErrors[_0x12bf12(0x1e9)](_0x12bf12(0x1fe)+METADATA_FILE+':\x20'+_0x2c9afa);}}function remoteManifestOssPath(_0x25c58a){const _0x17430b=a162_0x483b;if(!_0x25c58a||typeof _0x25c58a!==_0x17430b(0x1fc)||Array[_0x17430b(0x1eb)](_0x25c58a))return undefined;const _0x4243e0=_0x25c58a[_0x17430b(0x1f7)];return typeof _0x4243e0===_0x17430b(0x1f3)&&_0x4243e0['trim']()?_0x4243e0['trim']():undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a163_0x30cd(){const _0x7fb472=['trim','skills','23540QdYMDN','workbuddySkillsDir','Unsafe\x20','9037175APQqoZ','homeDir','includes','validation','3737481fJqQQm','11408526gSBsib','.claude','.agents','homeDirName','cacheRoot','SKILL_ROOT','901552HPwbZR','agentsSkillsDir','path\x20segment','1085FWVZZW','skillCode','327582NllvYV','filter','claudeSkillsDir','2862558ZTjUex'];a163_0x30cd=function(){return _0x7fb472;};return a163_0x30cd();}const a163_0x5779b3=a163_0x1a5d;(function(_0x53d103,_0x53149c){const _0x533e66=a163_0x1a5d,_0x5128cb=_0x53d103();while(!![]){try{const _0x396e5d=parseInt(_0x533e66(0x12f))/0x1+parseInt(_0x533e66(0x132))/0x2+parseInt(_0x533e66(0x123))/0x3+parseInt(_0x533e66(0x135))/0x4*(parseInt(_0x533e66(0x12d))/0x5)+-parseInt(_0x533e66(0x124))/0x6+-parseInt(_0x533e66(0x138))/0x7+-parseInt(_0x533e66(0x12a))/0x8;if(_0x396e5d===_0x53149c)break;else _0x5128cb['push'](_0x5128cb['shift']());}catch(_0x50db08){_0x5128cb['push'](_0x5128cb['shift']());}}}(a163_0x30cd,0xee6d1));import{existsSync}from'node:fs';import{homedir}from'node:os';import{resolve}from'node:path';import{fingerprintAccessKey}from'../../commands/app/cache.js';import{PRODUCT_CONFIG,productEnv}from'../../constant/product.js';import{CliErrors}from'../../errors.js';export function resolveSkillSyncPaths(_0x2f6ac1={}){const _0x231124=a163_0x1a5d,_0x508bea=_0x2f6ac1[_0x231124(0x139)]??homedir(),_0x7bac4c=resolve(_0x508bea,PRODUCT_CONFIG[_0x231124(0x127)],'cache'),_0x1430bc=trimmedEnv(_0x231124(0x129)),_0x4d4e5f=trimmedEnv('CLAUDE_SKILL_ROOT'),_0x3c86f2=resolve(_0x508bea,'.workbuddy'),_0x2aebdb=_0x2f6ac1[_0x231124(0x136)]??(existsSync(_0x3c86f2)?resolve(_0x3c86f2,_0x231124(0x134)):undefined);return{'homeDir':_0x508bea,'cacheRoot':_0x7bac4c,'managedRoot':resolve(_0x508bea,PRODUCT_CONFIG['homeDirName']),'agentsSkillsDir':_0x2f6ac1[_0x231124(0x12b)]??_0x1430bc??resolve(_0x508bea,_0x231124(0x126),_0x231124(0x134)),'claudeSkillsDir':_0x2f6ac1[_0x231124(0x131)]??_0x4d4e5f??resolve(_0x508bea,_0x231124(0x125),'skills'),'workbuddySkillsDir':_0x2aebdb};}export function runtimeAgentSkillRoots(_0xe20606){const _0x304a2d=a163_0x1a5d;return[_0xe20606['agentsSkillsDir'],_0xe20606['claudeSkillsDir'],_0xe20606[_0x304a2d(0x136)]][_0x304a2d(0x130)](_0x3ba426=>Boolean(_0x3ba426));}function a163_0x1a5d(_0x5b9760,_0x253507){_0x5b9760=_0x5b9760-0x123;const _0x30cd1d=a163_0x30cd();let _0x1a5dc9=_0x30cd1d[_0x5b9760];return _0x1a5dc9;}export function getRuntimeSkillCacheRoot(_0x1f1ef8,_0x1f425f,_0x49aa62={}){const _0x4cf07d=a163_0x1a5d,_0x2bc1b4=resolveSkillSyncPaths(_0x49aa62);return resolve(_0x2bc1b4[_0x4cf07d(0x128)],_0x1f1ef8,fingerprintAccessKey(_0x1f425f),'skills');}export function getRuntimeSkillDir(_0x423640,_0x645433,_0x441d46,_0x1f9114,_0x5dfe57,_0x1a4e17={}){const _0x4bc607=a163_0x1a5d;return resolve(getRuntimeSkillCacheRoot(_0x423640,_0x645433,_0x1a4e17),safePathSegment(_0x441d46,'appCode'),_0x1f9114,safePathSegment(_0x5dfe57,_0x4bc607(0x12e)));}export function safePathSegment(_0x5631e6,_0xe18db7=a163_0x5779b3(0x12c)){const _0x3074d6=a163_0x5779b3;if(!_0x5631e6||_0x5631e6[_0x3074d6(0x13a)]('/')||_0x5631e6[_0x3074d6(0x13a)]('\x5c')||_0x5631e6[_0x3074d6(0x13a)]('..'))throw CliErrors[_0x3074d6(0x13b)](_0x3074d6(0x137)+_0xe18db7+'\x20for\x20local\x20path:\x20'+_0x5631e6);return _0x5631e6;}function trimmedEnv(_0x4412e8){const _0x14060d=a163_0x5779b3,_0x4bcf33=productEnv(_0x4412e8)?.[_0x14060d(0x133)]();return _0x4bcf33?_0x4bcf33:undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x18c065,_0x779913){const _0x2ac0a8=a164_0x4b99,_0x55a180=_0x18c065();while(!![]){try{const _0x3868e7=-parseInt(_0x2ac0a8(0x163))/0x1+parseInt(_0x2ac0a8(0x181))/0x2+-parseInt(_0x2ac0a8(0x16e))/0x3*(parseInt(_0x2ac0a8(0x180))/0x4)+parseInt(_0x2ac0a8(0x178))/0x5+-parseInt(_0x2ac0a8(0x175))/0x6+parseInt(_0x2ac0a8(0x17d))/0x7+-parseInt(_0x2ac0a8(0x158))/0x8;if(_0x3868e7===_0x779913)break;else _0x55a180['push'](_0x55a180['shift']());}catch(_0x384077){_0x55a180['push'](_0x55a180['shift']());}}}(a164_0x7d85,0x3ca38));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a164_0x1ed94d}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';function a164_0x7d85(){const _0x1180fa=['manifest','dir','\x20name\x20for\x20SkillHub\x20slug\x20generation.','find','number','personal','filter','ignoreMetadataAppCodeMismatch','slice','15JiOLYl','targetScope','trim','isArray','\x20to\x20submit\x20company\x20Skills\x20for\x20review.','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20','(unknown)','969630EorUKz','isDirectory','excludedFilePaths','1411950JLxqTL','pushedAt','Unable\x20to\x20resolve\x20skillCode\x20from\x20','\x20has\x20unsupported\x20scope\x20\x22','skillCode','1611764rLslFX','appCode','example','144484WeZIkr','933932oafpDZ','string','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20','startsWith','Skill\x20metadata\x20appCode\x20\x22','match','some','utf8','path','Skill\x20directory\x20not\x20found:\x20','scope','ignoreInvalidMetadata','builtin','ignoreMetadataScope','ignoreMetadataForPayload','isFile','files','667752rmvoeB','Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20','sourceSessionId','Missing\x20','\x20has\x20scope=\x22','description','boolean','tags','content','\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22','replace','305553DJfmyG','validation'];a164_0x7d85=function(){return _0x1180fa;};return a164_0x7d85();}export function resolvePushDirectoryIdentity(_0x38459d,_0x21a997,_0x44f8c3={}){const _0x1a3848=a164_0x4b99,_0x10f31a=resolvePushDirectoryRoot(_0x38459d),_0x3230fa=readPushMetadataIfPresent(resolve(_0x10f31a,METADATA_FILE),{'ignoreInvalidMetadata':_0x44f8c3['ignoreInvalidMetadata']});if(_0x3230fa?.[_0x1a3848(0x17e)]&&_0x3230fa[_0x1a3848(0x17e)]!==_0x21a997&&!_0x44f8c3['allowAppCodeRetarget']&&!_0x44f8c3[_0x1a3848(0x16c)])throw CliErrors[_0x1a3848(0x164)](_0x1a3848(0x14b)+_0x3230fa['appCode']+_0x1a3848(0x161)+_0x21a997+'\x22.');const _0x56167=resolvePushSkillCode(_0x10f31a,_0x21a997,_0x3230fa,_0x44f8c3);if(!_0x56167)throw CliErrors[_0x1a3848(0x164)](_0x1a3848(0x17a)+SKILL_FILE+',\x20'+METADATA_FILE+',\x20or\x20directory\x20name.');return{'dir':_0x10f31a,'skillCode':_0x56167,'metadata':_0x3230fa};}export function readPushDirectory(_0x5197de,_0x18abdd,_0x196732={}){const _0xeb5f2d=a164_0x4b99,_0x188692=resolvePushDirectoryIdentity(_0x5197de,_0x18abdd,_0x196732),_0x24ab11=_0x188692[_0xeb5f2d(0x166)],_0x705408=resolve(_0x24ab11,SKILL_FILE);if(!existsSync(_0x705408)||!lstatSync(_0x705408)[_0xeb5f2d(0x156)]())throw CliErrors['validation'](_0xeb5f2d(0x15b)+SKILL_FILE+':\x20'+_0x705408);const _0x2caf04=_0x188692['metadata'],_0x2b58b0=_0x196732[_0xeb5f2d(0x16f)]??_0xeb5f2d(0x16a);if(!_0x196732[_0xeb5f2d(0x154)]&&_0x2caf04?.[_0xeb5f2d(0x151)]===_0xeb5f2d(0x153))throw CliErrors[_0xeb5f2d(0x164)](_0xeb5f2d(0x159)+METADATA_FILE+_0xeb5f2d(0x15c)+_0x2caf04[_0xeb5f2d(0x151)]+'\x22.');if(!_0x196732[_0xeb5f2d(0x154)]&&_0x2b58b0===_0xeb5f2d(0x16a)&&_0x2caf04?.[_0xeb5f2d(0x151)]&&_0x2caf04[_0xeb5f2d(0x151)]!==_0xeb5f2d(0x16a))throw CliErrors[_0xeb5f2d(0x164)](_0xeb5f2d(0x173)+METADATA_FILE+_0xeb5f2d(0x15c)+_0x2caf04[_0xeb5f2d(0x151)]+'\x22.',_0xeb5f2d(0x149)+_0x24ab11+_0xeb5f2d(0x172));const _0x5ef639=scanSkillDirectory(_0x24ab11,{'excludedFilePaths':_0x196732[_0xeb5f2d(0x177)]}),_0x5516a9=buildSkillPackage(_0x5ef639),_0x310bd7=readFileSync(_0x705408,_0xeb5f2d(0x14e)),_0x82e211=_0x188692[_0xeb5f2d(0x17c)],_0x18de9c=_0x196732[_0xeb5f2d(0x155)]?undefined:_0x2caf04,_0x35e748=readSkillDisplayName(_0x310bd7);return{'skillCode':_0x82e211,'metadata':_0x2caf04,'frontmatterDisplayName':_0x35e748,'input':{'skillCode':_0x82e211,'skillName':_0x35e748??_0x18de9c?.['skillName'],'description':_0x18de9c?.[_0xeb5f2d(0x15d)],'content':_0x310bd7,'files':_0x5516a9[_0xeb5f2d(0x165)],'packageBase64':_0x5516a9['packageBase64'],'tags':_0x18de9c?.[_0xeb5f2d(0x15f)],'version':_0x18de9c?.['version'],'sourceSessionId':_0x18de9c?.[_0xeb5f2d(0x15a)]}};}export function refreshPushDirectoryMetadataFromRemote(_0x187761,_0x431f02,_0x42cabc,_0x2c0590={}){const _0x429c35=a164_0x4b99,_0x56aa7a=resolvePushDirectoryRoot(_0x187761),_0x2c2eac=readPushMetadataIfPresent(resolve(_0x56aa7a,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x578855=requireRemoteScope(_0x431f02),_0x2fcc8c=readLocalSkillContent(_0x56aa7a),_0x533312={..._0x431f02,'appCode':_0x431f02[_0x429c35(0x17e)]??_0x42cabc,'skillName':_0x431f02['skillName']??_0x2c2eac?.['skillName'],'description':_0x431f02['description']??_0x2c2eac?.[_0x429c35(0x15d)],'example':_0x431f02[_0x429c35(0x17f)]??_0x2c2eac?.[_0x429c35(0x17f)],'tags':Array[_0x429c35(0x171)](_0x431f02[_0x429c35(0x15f)])?_0x431f02[_0x429c35(0x15f)]:_0x2c2eac?.['tags'],'sourceSessionId':_0x431f02[_0x429c35(0x15a)]??_0x2c2eac?.[_0x429c35(0x15a)],'content':_0x431f02[_0x429c35(0x160)]??_0x2fcc8c},_0x65b3d=buildMetadata(_0x533312,_0x578855,_0x42cabc,contentHash(_0x2fcc8c),_0x2c0590['refreshedAt']);writeJsonAtomic(resolve(_0x56aa7a,METADATA_FILE),_0x65b3d);}export function recordPushedRuntimeSkill(_0x494149,_0x49c1ab,_0x12d64f,_0xb35707={}){const _0x3a4011=a164_0x4b99,_0x376677=resolvePushDirectoryRoot(_0x494149),_0x806976=scanSkillDirectory(_0x376677),_0xbe53cc=_0x806976[_0x3a4011(0x168)](_0x554a4c=>_0x554a4c[_0x3a4011(0x14f)]===SKILL_FILE),_0xaf104e=_0xbe53cc?fileText(_0xbe53cc):'',_0x42056b=tryNormalizePackageManifest(_0x49c1ab['files']),_0x3e6cc3={..._0x49c1ab,'content':_0x49c1ab[_0x3a4011(0x160)]??_0xaf104e,'files':_0x42056b},_0x1bfa0e=_0x42056b?normalizeLocalFiles(_0x806976)[_0x3a4011(0x16b)](_0xc8f90=>_0x42056b[_0x3a4011(0x157)][_0x3a4011(0x14d)](_0xaac5ca=>_0xaac5ca[_0x3a4011(0x14f)]===_0xc8f90[_0x3a4011(0x14f)])):undefined,_0x4fe261=buildMetadata(_0x3e6cc3,_0xb35707['scope']??_0x3a4011(0x16a),_0x12d64f,contentHash(_0x3e6cc3[_0x3a4011(0x160)]??''),_0xb35707[_0x3a4011(0x179)],_0x1bfa0e);writeJsonAtomic(resolve(_0x376677,METADATA_FILE),_0x4fe261);}export function deriveSkillCodeFromDirectory(_0x53182e,_0x5db413){const _0x3fb490=a164_0x4b99,_0x13fd57=basename(resolve(_0x53182e)),_0x2f05ab=_0x5db413+'--';return _0x13fd57[_0x3fb490(0x14a)](_0x2f05ab)?_0x13fd57[_0x3fb490(0x16d)](_0x2f05ab['length']):_0x13fd57;}function resolvePushSkillCode(_0x2287c5,_0x1ea6b6,_0xfbe9e8,_0x598da9){const _0x3440e6=a164_0x4b99,_0x1f5bae=deriveSkillCodeFromSkillFile(_0x2287c5)||deriveSkillCodeFromDirectory(_0x2287c5,_0x1ea6b6);if(_0x598da9['ignoreMetadataSkillCode'])return _0x1f5bae;return _0xfbe9e8?.[_0x3440e6(0x17c)]?.[_0x3440e6(0x170)]()||_0x1f5bae;}function deriveSkillCodeFromSkillFile(_0x1ad9e8){const _0x5d8a17=a164_0x4b99,_0x1f345d=resolve(_0x1ad9e8,SKILL_FILE);if(!existsSync(_0x1f345d)||!lstatSync(_0x1f345d)[_0x5d8a17(0x156)]())return undefined;const _0x1da242=readFileSync(_0x1f345d,_0x5d8a17(0x14e)),_0x4280eb=_0x1da242[_0x5d8a17(0x14c)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x4280eb)return undefined;const _0x12609b=parseFrontmatterObject(_0x4280eb[0x1]??''),_0x179737=scalarToString(_0x12609b?.['name']);return _0x179737?slugifySkillName(_0x179737):undefined;}function readSkillDisplayName(_0x59ca52){const _0x46b010=a164_0x4b99,_0x1634fe=_0x59ca52[_0x46b010(0x14c)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x1634fe)return undefined;const _0x4ec3cc=parseFrontmatterObject(_0x1634fe[0x1]??'');return scalarToString(_0x4ec3cc?.['displayName']);}function slugifySkillName(_0x17f6a6){const _0x186bcd=a164_0x4b99,_0x547d75=_0x17f6a6[_0x186bcd(0x170)]()['toLowerCase']()[_0x186bcd(0x162)](/[^\p{L}\p{N}\p{So}]+/gu,'-')[_0x186bcd(0x162)](/^-+/,'')[_0x186bcd(0x162)](/-+$/,'')['replace'](/-{2,}/g,'-');if(!_0x547d75)throw CliErrors['validation']('Invalid\x20'+SKILL_FILE+_0x186bcd(0x167));return _0x547d75;}function a164_0x4b99(_0x2e2b9e,_0x45a26b){_0x2e2b9e=_0x2e2b9e-0x148;const _0x7d85b8=a164_0x7d85();let _0x4b9911=_0x7d85b8[_0x2e2b9e];return _0x4b9911;}function parseFrontmatterObject(_0x23289e){try{const _0x4aab02=a164_0x1ed94d(_0x23289e);return _0x4aab02&&typeof _0x4aab02==='object'&&!Array['isArray'](_0x4aab02)?_0x4aab02:undefined;}catch{return undefined;}}function scalarToString(_0x37249d){const _0x2e6c8a=a164_0x4b99;if(typeof _0x37249d===_0x2e6c8a(0x148))return _0x37249d['trim']();if(typeof _0x37249d===_0x2e6c8a(0x169)||typeof _0x37249d===_0x2e6c8a(0x15e))return String(_0x37249d);return undefined;}function resolvePushDirectoryRoot(_0x326bbd){const _0x8cd564=a164_0x4b99,_0x3d3c80=resolve(_0x326bbd);if(!existsSync(_0x3d3c80))throw CliErrors[_0x8cd564(0x164)]('Skill\x20directory\x20not\x20found:\x20'+_0x326bbd);const _0x349b87=lstatSync(_0x3d3c80);if(_0x349b87[_0x8cd564(0x176)]())return _0x3d3c80;if(_0x349b87['isSymbolicLink']()){const _0x4d7283=realpathSync(_0x3d3c80);if(lstatSync(_0x4d7283)[_0x8cd564(0x176)]())return _0x4d7283;}throw CliErrors[_0x8cd564(0x164)](_0x8cd564(0x150)+_0x326bbd);}function requireRemoteScope(_0x271cd3){const _0x10cfb5=a164_0x4b99;if(_0x271cd3['scope']===_0x10cfb5(0x16a)||_0x271cd3[_0x10cfb5(0x151)]==='company'||_0x271cd3[_0x10cfb5(0x151)]===_0x10cfb5(0x153))return _0x271cd3[_0x10cfb5(0x151)];throw CliErrors[_0x10cfb5(0x164)]('Remote\x20Skill\x20'+(_0x271cd3[_0x10cfb5(0x17c)]||_0x10cfb5(0x174))+_0x10cfb5(0x17b)+(_0x271cd3['scope']??'unknown')+'\x22.');}function readLocalSkillContent(_0x1b977e){const _0x41101f=a164_0x4b99,_0x389804=resolve(_0x1b977e,SKILL_FILE);return existsSync(_0x389804)&&lstatSync(_0x389804)['isFile']()?readFileSync(_0x389804,_0x41101f(0x14e)):'';}function readPushMetadataIfPresent(_0x24ca1f,_0x409990={}){const _0xda5beb=a164_0x4b99;try{return readMetadataIfPresent(_0x24ca1f);}catch(_0x213987){if(_0x409990[_0xda5beb(0x152)])return undefined;throw _0x213987;}}
|
|
1
|
+
(function(_0xf48eb6,_0x5c96ca){const _0x15a0e2=a164_0x55b4,_0x7312a8=_0xf48eb6();while(!![]){try{const _0x5e0057=parseInt(_0x15a0e2(0xda))/0x1+-parseInt(_0x15a0e2(0xe3))/0x2*(-parseInt(_0x15a0e2(0xed))/0x3)+parseInt(_0x15a0e2(0xf8))/0x4+parseInt(_0x15a0e2(0xca))/0x5*(-parseInt(_0x15a0e2(0xde))/0x6)+parseInt(_0x15a0e2(0xbf))/0x7+parseInt(_0x15a0e2(0xc2))/0x8*(parseInt(_0x15a0e2(0xd1))/0x9)+-parseInt(_0x15a0e2(0xd7))/0xa;if(_0x5e0057===_0x5c96ca)break;else _0x7312a8['push'](_0x7312a8['shift']());}catch(_0x17823e){_0x7312a8['push'](_0x7312a8['shift']());}}}(a164_0x536d,0x94940));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a164_0x31dccc}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{writeJsonAtomic}from'./fs-utils.js';import{contentHash}from'./hashing.js';import{fileText,normalizeLocalFiles,scanSkillDirectory}from'./local-files.js';import{buildMetadata,readMetadataIfPresent}from'./metadata.js';import{buildSkillPackage,tryNormalizePackageManifest}from'./zip-package.js';export function resolvePushDirectoryIdentity(_0x5e528b,_0x4baba2,_0xa9dbd={}){const _0x437431=a164_0x55b4,_0x2d4f32=resolvePushDirectoryRoot(_0x5e528b),_0x4fe26e=readPushMetadataIfPresent(resolve(_0x2d4f32,METADATA_FILE),{'ignoreInvalidMetadata':_0xa9dbd[_0x437431(0xc3)]});if(_0x4fe26e?.[_0x437431(0xd6)]&&_0x4fe26e[_0x437431(0xd6)]!==_0x4baba2&&!_0xa9dbd[_0x437431(0xf5)]&&!_0xa9dbd[_0x437431(0xbe)])throw CliErrors['validation'](_0x437431(0xd3)+_0x4fe26e['appCode']+'\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22'+_0x4baba2+'\x22.');const _0x527832=resolvePushSkillCode(_0x2d4f32,_0x4baba2,_0x4fe26e,_0xa9dbd);if(!_0x527832)throw CliErrors[_0x437431(0xbb)]('Unable\x20to\x20resolve\x20skillCode\x20from\x20'+SKILL_FILE+',\x20'+METADATA_FILE+_0x437431(0xe0));return{'dir':_0x2d4f32,'skillCode':_0x527832,'metadata':_0x4fe26e};}export function readPushDirectory(_0x4c0b49,_0x373803,_0x18295d={}){const _0x33fce9=a164_0x55b4,_0x4d9998=resolvePushDirectoryIdentity(_0x4c0b49,_0x373803,_0x18295d),_0x434908=_0x4d9998[_0x33fce9(0xe8)],_0x3f7ff8=resolve(_0x434908,SKILL_FILE);if(!existsSync(_0x3f7ff8)||!lstatSync(_0x3f7ff8)[_0x33fce9(0xcf)]())throw CliErrors['validation']('Missing\x20'+SKILL_FILE+':\x20'+_0x3f7ff8);const _0x3e65ab=_0x4d9998[_0x33fce9(0xc9)],_0x2215d1=_0x18295d[_0x33fce9(0xe1)]??'personal';if(!_0x18295d[_0x33fce9(0xd0)]&&_0x3e65ab?.['scope']==='builtin')throw CliErrors[_0x33fce9(0xbb)]('Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20'+METADATA_FILE+'\x20has\x20scope=\x22'+_0x3e65ab[_0x33fce9(0xc6)]+'\x22.');if(!_0x18295d['ignoreMetadataScope']&&_0x2215d1===_0x33fce9(0xe5)&&_0x3e65ab?.[_0x33fce9(0xc6)]&&_0x3e65ab[_0x33fce9(0xc6)]!==_0x33fce9(0xe5))throw CliErrors['validation'](_0x33fce9(0xd9)+METADATA_FILE+'\x20has\x20scope=\x22'+_0x3e65ab[_0x33fce9(0xc6)]+'\x22.',_0x33fce9(0xf7)+_0x434908+_0x33fce9(0xea));const _0x53ef90=scanSkillDirectory(_0x434908,{'excludedFilePaths':_0x18295d[_0x33fce9(0xe2)]}),_0x1dff94=buildSkillPackage(_0x53ef90),_0x3de186=readFileSync(_0x3f7ff8,'utf8'),_0x2eb778=_0x4d9998[_0x33fce9(0xcd)],_0x3bb449=_0x18295d[_0x33fce9(0xeb)]?undefined:_0x3e65ab,_0x561653=readSkillDisplayName(_0x3de186);return{'skillCode':_0x2eb778,'metadata':_0x3e65ab,'frontmatterDisplayName':_0x561653,'input':{'skillCode':_0x2eb778,'skillName':_0x561653??_0x3bb449?.[_0x33fce9(0xf4)],'description':_0x3bb449?.[_0x33fce9(0xb7)],'content':_0x3de186,'files':_0x1dff94['manifest'],'packageBase64':_0x1dff94[_0x33fce9(0xd5)],'tags':_0x3bb449?.[_0x33fce9(0xef)],'version':_0x3bb449?.[_0x33fce9(0xf3)],'sourceSessionId':_0x3bb449?.[_0x33fce9(0xb9)]}};}export function refreshPushDirectoryMetadataFromRemote(_0x3ad614,_0x4a9029,_0x562e5f,_0x1fd052={}){const _0xe2c561=a164_0x55b4,_0x1ec89a=resolvePushDirectoryRoot(_0x3ad614),_0x3a4bcb=readPushMetadataIfPresent(resolve(_0x1ec89a,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x1ce5bf=requireRemoteScope(_0x4a9029),_0x2f7488=readLocalSkillContent(_0x1ec89a),_0x4adef4={..._0x4a9029,'appCode':_0x4a9029[_0xe2c561(0xd6)]??_0x562e5f,'skillName':_0x4a9029['skillName']??_0x3a4bcb?.['skillName'],'description':_0x4a9029[_0xe2c561(0xb7)]??_0x3a4bcb?.['description'],'example':_0x4a9029[_0xe2c561(0xc7)]??_0x3a4bcb?.[_0xe2c561(0xc7)],'tags':Array[_0xe2c561(0xe9)](_0x4a9029[_0xe2c561(0xef)])?_0x4a9029[_0xe2c561(0xef)]:_0x3a4bcb?.['tags'],'sourceSessionId':_0x4a9029['sourceSessionId']??_0x3a4bcb?.[_0xe2c561(0xb9)],'content':_0x4a9029[_0xe2c561(0xcc)]??_0x2f7488},_0x1ae23e=buildMetadata(_0x4adef4,_0x1ce5bf,_0x562e5f,contentHash(_0x2f7488),_0x1fd052[_0xe2c561(0xbd)]);writeJsonAtomic(resolve(_0x1ec89a,METADATA_FILE),_0x1ae23e);}export function recordPushedRuntimeSkill(_0x33b3c4,_0x13b32e,_0x57468c,_0x386615={}){const _0x3a4c0c=a164_0x55b4,_0x2661ef=resolvePushDirectoryRoot(_0x33b3c4),_0x439de9=scanSkillDirectory(_0x2661ef),_0x11d5e3=_0x439de9[_0x3a4c0c(0xe6)](_0x2c531e=>_0x2c531e[_0x3a4c0c(0xba)]===SKILL_FILE),_0x529eb0=_0x11d5e3?fileText(_0x11d5e3):'',_0x574de0=tryNormalizePackageManifest(_0x13b32e[_0x3a4c0c(0xc4)]),_0x8a8a0a={..._0x13b32e,'content':_0x13b32e[_0x3a4c0c(0xcc)]??_0x529eb0,'files':_0x574de0},_0xa3c9c8=_0x574de0?normalizeLocalFiles(_0x439de9)[_0x3a4c0c(0xcb)](_0x4d74b0=>_0x574de0[_0x3a4c0c(0xc4)][_0x3a4c0c(0xe7)](_0x4e0821=>_0x4e0821['path']===_0x4d74b0[_0x3a4c0c(0xba)])):undefined,_0x754dda=buildMetadata(_0x8a8a0a,_0x386615[_0x3a4c0c(0xc6)]??_0x3a4c0c(0xe5),_0x57468c,contentHash(_0x8a8a0a['content']??''),_0x386615[_0x3a4c0c(0xdc)],_0xa3c9c8);writeJsonAtomic(resolve(_0x2661ef,METADATA_FILE),_0x754dda);}function a164_0x55b4(_0x2b2b93,_0x329e36){_0x2b2b93=_0x2b2b93-0xb7;const _0x536d8c=a164_0x536d();let _0x55b4ff=_0x536d8c[_0x2b2b93];return _0x55b4ff;}export function deriveSkillCodeFromDirectory(_0x5af4d3,_0x4308e4){const _0x1dd363=a164_0x55b4,_0x2e03bb=basename(resolve(_0x5af4d3)),_0x25becf=_0x4308e4+'--';return _0x2e03bb[_0x1dd363(0xce)](_0x25becf)?_0x2e03bb[_0x1dd363(0xd2)](_0x25becf[_0x1dd363(0xbc)]):_0x2e03bb;}function resolvePushSkillCode(_0x32b4e6,_0x38f9fd,_0x310f27,_0x68f9b9){const _0xfb13a5=a164_0x55b4,_0x101526=deriveSkillCodeFromSkillFile(_0x32b4e6)||deriveSkillCodeFromDirectory(_0x32b4e6,_0x38f9fd);if(_0x68f9b9[_0xfb13a5(0xd4)])return _0x101526;return _0x310f27?.[_0xfb13a5(0xcd)]?.[_0xfb13a5(0xc1)]()||_0x101526;}function deriveSkillCodeFromSkillFile(_0x20580e){const _0x285b11=a164_0x55b4,_0x4c23d8=resolve(_0x20580e,SKILL_FILE);if(!existsSync(_0x4c23d8)||!lstatSync(_0x4c23d8)[_0x285b11(0xcf)]())return undefined;const _0x4a3f46=readFileSync(_0x4c23d8,_0x285b11(0xf0)),_0x42b7f5=_0x4a3f46[_0x285b11(0xf9)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x42b7f5)return undefined;const _0x23fe1b=parseFrontmatterObject(_0x42b7f5[0x1]??''),_0x45ac68=scalarToString(_0x23fe1b?.['name']);return _0x45ac68?slugifySkillName(_0x45ac68):undefined;}function readSkillDisplayName(_0x5343ee){const _0x728b0e=a164_0x55b4,_0x423b3d=_0x5343ee[_0x728b0e(0xf9)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x423b3d)return undefined;const _0x3fe5e5=parseFrontmatterObject(_0x423b3d[0x1]??'');return scalarToString(_0x3fe5e5?.['displayName']);}function slugifySkillName(_0x114751){const _0x1dfffe=a164_0x55b4,_0xfd5b93=_0x114751[_0x1dfffe(0xc1)]()[_0x1dfffe(0xc5)]()['replace'](/[^\p{L}\p{N}\p{So}]+/gu,'-')[_0x1dfffe(0xec)](/^-+/,'')['replace'](/-+$/,'')['replace'](/-{2,}/g,'-');if(!_0xfd5b93)throw CliErrors[_0x1dfffe(0xbb)](_0x1dfffe(0xc0)+SKILL_FILE+_0x1dfffe(0xe4));return _0xfd5b93;}function parseFrontmatterObject(_0x2707e3){const _0x5abc93=a164_0x55b4;try{const _0x1e3940=a164_0x31dccc(_0x2707e3);return _0x1e3940&&typeof _0x1e3940===_0x5abc93(0xf6)&&!Array[_0x5abc93(0xe9)](_0x1e3940)?_0x1e3940:undefined;}catch{return undefined;}}function scalarToString(_0x2e9cc8){const _0x438983=a164_0x55b4;if(typeof _0x2e9cc8===_0x438983(0xf1))return _0x2e9cc8[_0x438983(0xc1)]();if(typeof _0x2e9cc8===_0x438983(0xf2)||typeof _0x2e9cc8===_0x438983(0xdb))return String(_0x2e9cc8);return undefined;}function resolvePushDirectoryRoot(_0xad1fa9){const _0x2ed7c3=a164_0x55b4,_0x5df5f2=resolve(_0xad1fa9);if(!existsSync(_0x5df5f2))throw CliErrors[_0x2ed7c3(0xbb)](_0x2ed7c3(0xc8)+_0xad1fa9);const _0x4c3484=lstatSync(_0x5df5f2);if(_0x4c3484[_0x2ed7c3(0xd8)]())return _0x5df5f2;if(_0x4c3484[_0x2ed7c3(0xee)]()){const _0x487c65=realpathSync(_0x5df5f2);if(lstatSync(_0x487c65)[_0x2ed7c3(0xd8)]())return _0x487c65;}throw CliErrors[_0x2ed7c3(0xbb)](_0x2ed7c3(0xc8)+_0xad1fa9);}function a164_0x536d(){const _0x1f33d3=['skillName','allowAppCodeRetarget','object','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20','1333108NDRZzD','match','description','\x20has\x20unsupported\x20scope\x20\x22','sourceSessionId','path','validation','length','refreshedAt','ignoreMetadataAppCodeMismatch','2615998GlrMOh','Invalid\x20','trim','192048hXKIPf','ignoreInvalidMetadata','files','toLowerCase','scope','example','Skill\x20directory\x20not\x20found:\x20','metadata','128700NBdxxa','filter','content','skillCode','startsWith','isFile','ignoreMetadataScope','207ixpBxR','slice','Skill\x20metadata\x20appCode\x20\x22','ignoreMetadataSkillCode','packageBase64','appCode','11364380BbjWnR','isDirectory','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20','366318crxPfH','boolean','pushedAt','company','132ScYwOV','builtin',',\x20or\x20directory\x20name.','targetScope','excludedFilePaths','9206TmncCk','\x20name\x20for\x20SkillHub\x20slug\x20generation.','personal','find','some','dir','isArray','\x20to\x20submit\x20company\x20Skills\x20for\x20review.','ignoreMetadataForPayload','replace','447bZxqen','isSymbolicLink','tags','utf8','string','number','version'];a164_0x536d=function(){return _0x1f33d3;};return a164_0x536d();}function requireRemoteScope(_0x16a0f8){const _0x3d0e52=a164_0x55b4;if(_0x16a0f8[_0x3d0e52(0xc6)]===_0x3d0e52(0xe5)||_0x16a0f8[_0x3d0e52(0xc6)]===_0x3d0e52(0xdd)||_0x16a0f8[_0x3d0e52(0xc6)]===_0x3d0e52(0xdf))return _0x16a0f8[_0x3d0e52(0xc6)];throw CliErrors[_0x3d0e52(0xbb)]('Remote\x20Skill\x20'+(_0x16a0f8['skillCode']||'(unknown)')+_0x3d0e52(0xb8)+(_0x16a0f8[_0x3d0e52(0xc6)]??'unknown')+'\x22.');}function readLocalSkillContent(_0x2f7ba0){const _0x2db0cf=a164_0x55b4,_0x9e34f1=resolve(_0x2f7ba0,SKILL_FILE);return existsSync(_0x9e34f1)&&lstatSync(_0x9e34f1)[_0x2db0cf(0xcf)]()?readFileSync(_0x9e34f1,_0x2db0cf(0xf0)):'';}function readPushMetadataIfPresent(_0x40581a,_0x1d1ac4={}){try{return readMetadataIfPresent(_0x40581a);}catch(_0xd3636b){if(_0x1d1ac4['ignoreInvalidMetadata'])return undefined;throw _0xd3636b;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a165_0x1793(){const _0x517708=['5676930vybTaQ','Unsupported\x20runtime\x20Skill\x20scope:\x20','personal','includes','1152TLzhib','142DCZeML','951848RYLkTJ','12437jmauON','push','company','18936401lqBRdh','builtin','5159lvqsRG','5964lSkYXM','5FuJrjI','109860yRlKQA','44376OqWywt','validation'];a165_0x1793=function(){return _0x517708;};return a165_0x1793();}function a165_0x14ec(_0x4a4e50,_0x4d62ba){_0x4a4e50=_0x4a4e50-0x1bc;const _0x179329=a165_0x1793();let _0x14ec10=_0x179329[_0x4a4e50];return _0x14ec10;}(function(_0x82cc01,_0x413b87){const _0x539ebd=a165_0x14ec,_0x3b3d65=_0x82cc01();while(!![]){try{const _0x310336=parseInt(_0x539ebd(0x1c9))/0x1*(-parseInt(_0x539ebd(0x1c7))/0x2)+-parseInt(_0x539ebd(0x1bf))/0x3+-parseInt(_0x539ebd(0x1c8))/0x4*(-parseInt(_0x539ebd(0x1be))/0x5)+-parseInt(_0x539ebd(0x1bd))/0x6*(-parseInt(_0x539ebd(0x1bc))/0x7)+parseInt(_0x539ebd(0x1c0))/0x8*(-parseInt(_0x539ebd(0x1c6))/0x9)+-parseInt(_0x539ebd(0x1c2))/0xa+parseInt(_0x539ebd(0x1cc))/0xb;if(_0x310336===_0x413b87)break;else _0x3b3d65['push'](_0x3b3d65['shift']());}catch(_0x5aba84){_0x3b3d65['push'](_0x3b3d65['shift']());}}}(a165_0x1793,0x78c53));import{CliErrors}from'../../errors.js';export function normalizeRuntimeSkillScopes(_0x1e45d0){const _0x12d89e=a165_0x14ec,_0x39c88b=_0x1e45d0&&_0x1e45d0['length']>0x0?_0x1e45d0:[_0x12d89e(0x1c4),_0x12d89e(0x1cb),_0x12d89e(0x1cd)],_0x936be4=[];for(const _0x51e85d of _0x39c88b){if(!isRuntimeSkillScope(_0x51e85d))throw CliErrors[_0x12d89e(0x1c1)](_0x12d89e(0x1c3)+_0x51e85d);!_0x936be4[_0x12d89e(0x1c5)](_0x51e85d)&&_0x936be4[_0x12d89e(0x1ca)](_0x51e85d);}return _0x936be4;}export function isRuntimeSkillScope(_0x555f64){const _0x102934=a165_0x14ec;return _0x555f64==='personal'||_0x555f64===_0x102934(0x1cb)||_0x555f64===_0x102934(0x1cd);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a167_0x21e4df=a167_0x251e;(function(_0x45b0cf,_0x3e9a93){const _0x237f3a=a167_0x251e,_0x5b1df3=_0x45b0cf();while(!![]){try{const _0x430156=parseInt(_0x237f3a(0x169))/0x1+parseInt(_0x237f3a(0x168))/0x2+-parseInt(_0x237f3a(0x171))/0x3+parseInt(_0x237f3a(0x170))/0x4+parseInt(_0x237f3a(0x179))/0x5+-parseInt(_0x237f3a(0x17a))/0x6*(parseInt(_0x237f3a(0x175))/0x7)+-parseInt(_0x237f3a(0x16f))/0x8*(-parseInt(_0x237f3a(0x16d))/0x9);if(_0x430156===_0x3e9a93)break;else _0x5b1df3['push'](_0x5b1df3['shift']());}catch(_0x26faa6){_0x5b1df3['push'](_0x5b1df3['shift']());}}}(a167_0x2601,0xb7984));import{unzipSync,zipSync}from'fflate';import{CliErrors}from'../../errors.js';import{compareSkillFiles,fileContent,normalizeLocalFiles,normalizeSkillRelativePath}from'./local-files.js';const ZIP_MTIME=new Date(a167_0x21e4df(0x172));function a167_0x251e(_0x452a15,_0x39b723){_0x452a15=_0x452a15-0x168;const _0x2601cb=a167_0x2601();let _0x251eff=_0x2601cb[_0x452a15];return _0x251eff;}export function createDeterministicZipPackage(_0x257486){const _0x5ddfc=a167_0x21e4df,_0x1da39e={};for(const _0x3bead9 of normalizeLocalFiles(_0x257486)){_0x1da39e[_0x3bead9['path']]=fileContent(_0x3bead9);}return Buffer[_0x5ddfc(0x16a)](zipSync(_0x1da39e,{'level':0x0,'mtime':ZIP_MTIME}));}function a167_0x2601(){const _0x1d092c=['from','endsWith','entries','4071996QuVmyH','Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.','32OCzDjO','936492MTyjBh','4340430SmfwXt','1980-01-01T00:00:00.000Z','code','length','997094UgtOHi','map','object','validation_error','295255rwAqRT','54fZNogj','sort','validation','259460dLXgjm','1248112hdnspo'];a167_0x2601=function(){return _0x1d092c;};return a167_0x2601();}export function parseZipPackage(_0x42ae7b){const _0x214463=a167_0x21e4df;if(_0x42ae7b[_0x214463(0x174)]<0x16)throw CliErrors[_0x214463(0x17c)](_0x214463(0x16e));let _0x588fbb;try{_0x588fbb=unzipSync(_0x42ae7b,{'filter'(_0x2fb529){const _0xe4608f=_0x214463,_0x418d55=normalizeSkillRelativePath(_0x2fb529['name']);if(_0x418d55[_0xe4608f(0x16b)]('/'))throw CliErrors[_0xe4608f(0x17c)]('Runtime\x20Skill\x20package\x20contains\x20directory\x20entry:\x20'+_0x418d55);return!![];}});}catch(_0x1c47cd){if(isRuntimeSkillValidationError(_0x1c47cd))throw _0x1c47cd;throw CliErrors['validation'](_0x214463(0x16e));}return Object[_0x214463(0x16c)](_0x588fbb)[_0x214463(0x176)](([_0x192bb0,_0xf6afb0])=>({'path':normalizeSkillRelativePath(_0x192bb0),'bytes':Buffer[_0x214463(0x16a)](_0xf6afb0)}))[_0x214463(0x17b)](compareSkillFiles);}function isRuntimeSkillValidationError(_0xecc1cc){const _0x507c33=a167_0x21e4df;return typeof _0xecc1cc===_0x507c33(0x177)&&_0xecc1cc!==null&&_0x507c33(0x173)in _0xecc1cc&&_0xecc1cc[_0x507c33(0x173)]===_0x507c33(0x178);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x425e3d,_0x36fa36){const _0x1b7852=a168_0x2a75,_0xc0b730=_0x425e3d();while(!![]){try{const _0x1162e3=parseInt(_0x1b7852(0x195))/0x1+parseInt(_0x1b7852(0x188))/0x2*(parseInt(_0x1b7852(0x1a2))/0x3)+-parseInt(_0x1b7852(0x186))/0x4*(parseInt(_0x1b7852(0x19d))/0x5)+-parseInt(_0x1b7852(0x182))/0x6+-parseInt(_0x1b7852(0x190))/0x7+parseInt(_0x1b7852(0x1a4))/0x8+-parseInt(_0x1b7852(0x189))/0x9;if(_0x1162e3===_0x36fa36)break;else _0xc0b730['push'](_0xc0b730['shift']());}catch(_0x4b7edc){_0xc0b730['push'](_0xc0b730['shift']());}}}(a168_0x5745,0xc2d6d));import{CliErrors}from'../../errors.js';import{SKILL_FILE}from'./constants.js';import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';import{fileContent,isSha256Hex,normalizeLocalFiles,normalizeManifestFiles}from'./local-files.js';import{createDeterministicZipPackage,parseZipPackage}from'./zip-codec.js';export function buildSkillPackage(_0x4e8a52){const _0x4ec7d1=a168_0x2a75,_0x38852f=normalizeLocalFiles(_0x4e8a52);if(!_0x38852f[_0x4ec7d1(0x19b)](_0x1bc20b=>_0x1bc20b['path']===SKILL_FILE))throw CliErrors['validation'](_0x4ec7d1(0x191)+SKILL_FILE+_0x4ec7d1(0x1a6));const _0x4554d4=localFilesToManifestFiles(_0x38852f),_0x4c1708=createDeterministicZipPackage(_0x38852f);return{'manifest':{'schemaVersion':0x2,'treeSha256':fileTreeHash(_0x4554d4),'zipSha256':bufferSha256(_0x4c1708),'zipSize':_0x4c1708[_0x4ec7d1(0x1a3)],'files':_0x4554d4},'packageBytes':_0x4c1708,'packageBase64':_0x4c1708['toString'](_0x4ec7d1(0x180))};}function a168_0x5745(){const _0x9bacde=['validation','Runtime\x20Skill\x20file\x20tree\x20sha256\x20is\x20invalid.','Runtime\x20Skill\x20package\x20is\x20required\x20for\x20Skill\x20install:\x20','set','some','ossPath','18695RJQWuo','Duplicate\x20Skill\x20package\x20entry:\x20','size','Runtime\x20Skill\x20package\x20entry\x20list\x20mismatch.','schemaVersion','2346DoDRtP','length','11387464WQgKPX','zipSha256','\x20in\x20Skill\x20file\x20package.','has','push','path','bytes','toLowerCase','base64','Runtime\x20Skill\x20package\x20size\x20is\x20invalid.','1379628WfgBXB','string','isArray','map','772mzRklz','Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.','1298ZgLqnV','7061067hyGGdC','Runtime\x20Skill\x20package\x20is\x20missing\x20entry:\x20','get','Runtime\x20Skill\x20package\x20is\x20missing\x20','isSafeInteger','Runtime\x20Skill\x20package\x20file\x20sha256\x20mismatch:\x20','zipSize','4864832kEkgfK','Missing\x20','files','trim','Runtime\x20Skill\x20manifest\x20is\x20missing\x20','1298214hSLiUc','sha256'];a168_0x5745=function(){return _0x9bacde;};return a168_0x5745();}export function verifyRuntimeSkillPackage(_0x3f022b,_0x38e444){const _0x216b18=a168_0x2a75,_0x182267=normalizePackageManifest(_0x3f022b,{'requireOssPath':![]});if(!_0x182267)throw CliErrors['validation'](_0x216b18(0x187));return extractAndVerifyPackage(_0x182267,_0x38e444);}export function verifyRuntimeSkillBundle(_0x70aac3,_0x5863e9){const _0x437d2e=a168_0x2a75,_0x45bd61=normalizePackageManifest(_0x70aac3,{'requireOssPath':![]});if(!_0x45bd61)throw CliErrors[_0x437d2e(0x197)](_0x437d2e(0x187));return extractAndVerifyPackageFiles(_0x45bd61,_0x5863e9);}export function tryNormalizePackageManifest(_0x4b316a){return normalizePackageManifest(_0x4b316a,{'requireOssPath':![]});}export function requirePackageBytes(_0x51123f,_0x11f98e){const _0x354fbf=a168_0x2a75;if(!_0x11f98e||_0x11f98e[_0x354fbf(0x1a3)]===0x0)throw CliErrors['validation'](_0x354fbf(0x199)+_0x51123f);return _0x11f98e;}export function extractDownloadedPackage(_0x50b98b){const _0x3b8e43=a168_0x2a75,_0x15e961=parseZipPackage(_0x50b98b)[_0x3b8e43(0x185)](_0x1547c5=>({'path':_0x1547c5[_0x3b8e43(0x17d)],'bytes':_0x1547c5['bytes']}));if(!_0x15e961[_0x3b8e43(0x19b)](_0x4c4e69=>_0x4c4e69[_0x3b8e43(0x17d)]===SKILL_FILE))throw CliErrors['validation'](_0x3b8e43(0x18c)+SKILL_FILE+'.');return normalizeLocalFiles(_0x15e961);}export function localFilesToManifestFiles(_0x3fb905){const _0x1a282e=a168_0x2a75;return normalizeLocalFiles(_0x3fb905)[_0x1a282e(0x185)](_0x24a734=>({'path':_0x24a734[_0x1a282e(0x17d)],'sha256':fileHash(_0x24a734),'size':fileContent(_0x24a734)[_0x1a282e(0x1a3)]}));}function a168_0x2a75(_0x3ad5c5,_0x6068c0){_0x3ad5c5=_0x3ad5c5-0x17c;const _0x574511=a168_0x5745();let _0x2a75a8=_0x574511[_0x3ad5c5];return _0x2a75a8;}function normalizePackageManifest(_0xf4f207,_0x897528){const _0x51f5c2=a168_0x2a75;if(!_0xf4f207||typeof _0xf4f207!=='object'||Array['isArray'](_0xf4f207))return undefined;const _0x61c20c=_0xf4f207,_0x32b61d=typeof _0x61c20c['ossPath']===_0x51f5c2(0x183)?_0x61c20c[_0x51f5c2(0x19c)][_0x51f5c2(0x193)]():undefined;if(_0x897528['requireOssPath']&&!_0x32b61d)return undefined;if(!Array[_0x51f5c2(0x184)](_0x61c20c[_0x51f5c2(0x192)])||_0x61c20c[_0x51f5c2(0x192)][_0x51f5c2(0x1a3)]===0x0)return undefined;if(!isSha256Hex(_0x61c20c['treeSha256']))throw CliErrors[_0x51f5c2(0x197)](_0x51f5c2(0x198));if(!isSha256Hex(_0x61c20c['zipSha256']))throw CliErrors[_0x51f5c2(0x197)]('Runtime\x20Skill\x20package\x20sha256\x20is\x20invalid.');if(!Number['isSafeInteger'](_0x61c20c[_0x51f5c2(0x18f)])||_0x61c20c['zipSize']<0x0)throw CliErrors['validation'](_0x51f5c2(0x181));const _0x2fb99b=normalizeManifestFiles(_0x61c20c[_0x51f5c2(0x192)]);if(!_0x2fb99b[_0x51f5c2(0x19b)](_0x53c4b8=>_0x53c4b8[_0x51f5c2(0x17d)]===SKILL_FILE))throw CliErrors[_0x51f5c2(0x197)](_0x51f5c2(0x194)+SKILL_FILE+'.');const _0x441124=fileTreeHash(_0x2fb99b);if(_0x441124!==_0x61c20c['treeSha256'][_0x51f5c2(0x17f)]())throw CliErrors['validation']('Runtime\x20Skill\x20file\x20tree\x20sha256\x20mismatch.');return{'schemaVersion':Number[_0x51f5c2(0x18d)](_0x61c20c[_0x51f5c2(0x1a1)])?_0x61c20c['schemaVersion']:0x2,'ossPath':_0x32b61d,'treeSha256':_0x441124,'zipSha256':_0x61c20c[_0x51f5c2(0x1a5)][_0x51f5c2(0x17f)](),'zipSize':_0x61c20c[_0x51f5c2(0x18f)],'files':_0x2fb99b};}function extractAndVerifyPackage(_0x4fb63d,_0x4f2ecc){const _0x1852a1=a168_0x2a75,_0x16ff09=normalizePackageManifest(_0x4fb63d,{'requireOssPath':![]});if(!_0x16ff09)throw CliErrors[_0x1852a1(0x197)]('Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.');if(_0x4f2ecc[_0x1852a1(0x1a3)]!==_0x16ff09[_0x1852a1(0x18f)])throw CliErrors[_0x1852a1(0x197)]('Runtime\x20Skill\x20package\x20size\x20mismatch.');const _0x250740=bufferSha256(_0x4f2ecc);if(_0x250740!==_0x16ff09[_0x1852a1(0x1a5)])throw CliErrors[_0x1852a1(0x197)]('Runtime\x20Skill\x20package\x20sha256\x20mismatch.');return extractAndVerifyPackageFiles(_0x16ff09,_0x4f2ecc);}function extractAndVerifyPackageFiles(_0x3adbc9,_0x4b7bfa){const _0xe774cc=a168_0x2a75,_0x4a6b02=parseZipPackage(_0x4b7bfa);if(_0x4a6b02[_0xe774cc(0x1a3)]!==_0x3adbc9[_0xe774cc(0x192)][_0xe774cc(0x1a3)])throw CliErrors[_0xe774cc(0x197)](_0xe774cc(0x1a0));const _0x53f12e=new Map();for(const _0x4c614e of _0x4a6b02){if(_0x53f12e[_0xe774cc(0x1a7)](_0x4c614e[_0xe774cc(0x17d)]))throw CliErrors[_0xe774cc(0x197)](_0xe774cc(0x19e)+_0x4c614e['path']);_0x53f12e[_0xe774cc(0x19a)](_0x4c614e[_0xe774cc(0x17d)],_0x4c614e);}const _0xe89614=[];for(const _0x1aca64 of _0x3adbc9[_0xe774cc(0x192)]){const _0x40e01d=_0x53f12e[_0xe774cc(0x18b)](_0x1aca64[_0xe774cc(0x17d)]);if(!_0x40e01d)throw CliErrors[_0xe774cc(0x197)](_0xe774cc(0x18a)+_0x1aca64[_0xe774cc(0x17d)]);if(_0x40e01d[_0xe774cc(0x17e)][_0xe774cc(0x1a3)]!==_0x1aca64[_0xe774cc(0x19f)])throw CliErrors[_0xe774cc(0x197)]('Runtime\x20Skill\x20package\x20file\x20size\x20mismatch:\x20'+_0x1aca64[_0xe774cc(0x17d)]);const _0x20b7c8=bufferSha256(_0x40e01d[_0xe774cc(0x17e)]);if(_0x20b7c8!==_0x1aca64[_0xe774cc(0x196)])throw CliErrors[_0xe774cc(0x197)](_0xe774cc(0x18e)+_0x1aca64['path']);_0xe89614[_0xe774cc(0x17c)]({'path':_0x1aca64[_0xe774cc(0x17d)],'bytes':_0x40e01d[_0xe774cc(0x17e)]});}return normalizeLocalFiles(_0xe89614);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x160621,_0x314944){var _0x1937c1=a169_0x4910,_0x201661=_0x160621();while(!![]){try{var _0x37e79c=-parseInt(_0x1937c1(0x18c))/0x1*(parseInt(_0x1937c1(0x188))/0x2)+parseInt(_0x1937c1(0x186))/0x3*(parseInt(_0x1937c1(0x189))/0x4)+parseInt(_0x1937c1(0x18b))/0x5+-parseInt(_0x1937c1(0x187))/0x6+-parseInt(_0x1937c1(0x18e))/0x7+-parseInt(_0x1937c1(0x18f))/0x8+-parseInt(_0x1937c1(0x18a))/0x9*(-parseInt(_0x1937c1(0x18d))/0xa);if(_0x37e79c===_0x314944)break;else _0x201661['push'](_0x201661['shift']());}catch(_0x52f1fd){_0x201661['push'](_0x201661['shift']());}}}(a169_0x3e25,0x5219b));export{contentHash,fileTreeHash}from'./runtime-skill-sync/hashing.js';export{linkEffectiveRuntimeSkills,linkGlobalRuntimeSkills,pruneStaleRuntimeSkillCache,pruneStaleRuntimeSkillLinks}from'./runtime-skill-sync/links.js';export{resolveRuntimeSkillInstallTarget}from'./runtime-skill-sync/install-target.js';export{listLocalRuntimeSkills}from'./runtime-skill-sync/list-local.js';function a169_0x3e25(){var _0x19a06a=['913470offnSL','245670CoKEQJ','2fxHZFg','4snZgFm','18tYcTZI','567055FlZNVp','264331tYVoNG','7454470uThAtp','4622016lSghuA','4855584ERENUH'];a169_0x3e25=function(){return _0x19a06a;};return a169_0x3e25();}export{materializeRuntimeSkill,reuseMaterializedRuntimeSkill}from'./runtime-skill-sync/materialize.js';export{readMetadataIfPresent}from'./runtime-skill-sync/metadata.js';function a169_0x4910(_0x407465,_0x162fec){_0x407465=_0x407465-0x186;var _0x3e25aa=a169_0x3e25();var _0x4910fb=_0x3e25aa[_0x407465];return _0x4910fb;}export{getRuntimeSkillCacheRoot,getRuntimeSkillDir,resolveSkillSyncPaths,runtimeAgentSkillRoots}from'./runtime-skill-sync/paths.js';export{deriveSkillCodeFromDirectory,readPushDirectory,refreshPushDirectoryMetadataFromRemote,recordPushedRuntimeSkill,resolvePushDirectoryIdentity}from'./runtime-skill-sync/push.js';export{buildSkillPackage,verifyRuntimeSkillBundle,verifyRuntimeSkillPackage}from'./runtime-skill-sync/zip-package.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a170_0x1d9482=a170_0x1536;function a170_0x444f(){const _0x253f64=['16LuyfuC','message','.agents','present','\x20has\x20no\x20skills\x20map','object','25657XtUFEp','5Juybdu','number','not-recorded','973017BhzxZw','utf8','kind','find','.claude','\x20uses\x20unsupported\x20version\x20','8asLnRd','version','\x20records\x20\x22','1648116ZIxzgF','613515WjNlmt','699783pfYWmi','SKILL.md','\x22\x20but\x20no\x20SKILL.md\x20was\x20found\x20in\x20known\x20layouts\x20','unusable','\x20is\x20unreadable:\x20','includes','skills','map','2414852JQVJCc','329388xUAtnr','.skill-lock.json','globalSkillsDirs','parse','lockFile','10saNONR','unverifiable','join','recorded','reason'];a170_0x444f=function(){return _0x253f64;};return a170_0x444f();}(function(_0x404482,_0x5931c0){const _0xf2572f=a170_0x1536,_0x565613=_0x404482();while(!![]){try{const _0x2f66bf=parseInt(_0xf2572f(0x16e))/0x1*(-parseInt(_0xf2572f(0x178))/0x2)+-parseInt(_0xf2572f(0x17d))/0x3+parseInt(_0xf2572f(0x186))/0x4*(-parseInt(_0xf2572f(0x16f))/0x5)+parseInt(_0xf2572f(0x17b))/0x6+-parseInt(_0xf2572f(0x17c))/0x7*(-parseInt(_0xf2572f(0x168))/0x8)+parseInt(_0xf2572f(0x172))/0x9*(-parseInt(_0xf2572f(0x18b))/0xa)+parseInt(_0xf2572f(0x185))/0xb;if(_0x2f66bf===_0x5931c0)break;else _0x565613['push'](_0x565613['shift']());}catch(_0x30ee10){_0x565613['push'](_0x565613['shift']());}}}(a170_0x444f,0x22f37));import{existsSync,readFileSync}from'node:fs';import{homedir}from'node:os';import{join}from'node:path';export const SKILL_LOCK_RELATIVE_PATH=join(a170_0x1d9482(0x16a),a170_0x1d9482(0x187));export const GLOBAL_SKILLS_DIR_RELATIVE_PATHS=[join(a170_0x1d9482(0x16a),a170_0x1d9482(0x183)),join(a170_0x1d9482(0x176),'skills')];function a170_0x1536(_0xb416a4,_0x5ad379){_0xb416a4=_0xb416a4-0x164;const _0x444fcf=a170_0x444f();let _0x153673=_0x444fcf[_0xb416a4];return _0x153673;}const SUPPORTED_LOCK_VERSIONS=[0x3];function readLockLookup(_0x433688,_0x53ef16){const _0xd18234=a170_0x1d9482;if(!existsSync(_0x433688))return{'kind':'not-recorded'};let _0x4ecffa;try{_0x4ecffa=JSON[_0xd18234(0x189)](readFileSync(_0x433688,_0xd18234(0x173)));}catch(_0x4f28c2){return{'kind':_0xd18234(0x180),'reason':_0x433688+_0xd18234(0x181)+_0x4f28c2[_0xd18234(0x169)]};}const _0x4b5ec9=_0x4ecffa;if(typeof _0x4b5ec9?.[_0xd18234(0x179)]!==_0xd18234(0x170)||!SUPPORTED_LOCK_VERSIONS[_0xd18234(0x182)](_0x4b5ec9['version']))return{'kind':_0xd18234(0x180),'reason':_0x433688+_0xd18234(0x177)+String(_0x4b5ec9?.[_0xd18234(0x179)])};if(!_0x4b5ec9['skills']||typeof _0x4b5ec9[_0xd18234(0x183)]!==_0xd18234(0x16d))return{'kind':_0xd18234(0x180),'reason':_0x433688+_0xd18234(0x16c)};return _0x4b5ec9[_0xd18234(0x183)][_0x53ef16]?{'kind':_0xd18234(0x166)}:{'kind':_0xd18234(0x171)};}export function resolveInstalledSkill(_0x18b405,_0x51a77d){const _0x4b3d88=a170_0x1d9482,_0x2d742a=_0x51a77d?.['home']??homedir(),_0x3bc58a=_0x51a77d?.[_0x4b3d88(0x188)]??GLOBAL_SKILLS_DIR_RELATIVE_PATHS[_0x4b3d88(0x184)](_0x401026=>join(_0x2d742a,_0x401026)),_0x51e9b8=_0x51a77d?.[_0x4b3d88(0x18a)]??join(_0x2d742a,SKILL_LOCK_RELATIVE_PATH),_0x233545=_0x3bc58a['map'](_0x3774bf=>join(_0x3774bf,_0x18b405,_0x4b3d88(0x17e))),_0x31bb9b=_0x233545[_0x4b3d88(0x175)](_0x541f7d=>existsSync(_0x541f7d));if(_0x31bb9b)return{'state':_0x4b3d88(0x16b),'path':_0x31bb9b};const _0x4e0db8=readLockLookup(_0x51e9b8,_0x18b405);if(_0x4e0db8[_0x4b3d88(0x174)]==='unusable')return{'state':'unverifiable','reason':_0x4e0db8[_0x4b3d88(0x167)]};if(_0x4e0db8[_0x4b3d88(0x174)]===_0x4b3d88(0x166))return{'state':_0x4b3d88(0x164),'reason':_0x51e9b8+_0x4b3d88(0x17a)+_0x18b405+_0x4b3d88(0x17f)+('('+_0x233545[_0x4b3d88(0x165)](',\x20')+')')};return{'state':'absent','checked':_0x233545};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x69ec03,_0x111434){const _0x3e06cb=a171_0xfbd8,_0x1b9193=_0x69ec03();while(!![]){try{const _0x6ef543=-parseInt(_0x3e06cb(0x16b))/0x1+parseInt(_0x3e06cb(0x170))/0x2+parseInt(_0x3e06cb(0x15d))/0x3*(-parseInt(_0x3e06cb(0x166))/0x4)+parseInt(_0x3e06cb(0x163))/0x5+-parseInt(_0x3e06cb(0x16a))/0x6*(-parseInt(_0x3e06cb(0x169))/0x7)+-parseInt(_0x3e06cb(0x15f))/0x8*(parseInt(_0x3e06cb(0x168))/0x9)+parseInt(_0x3e06cb(0x16c))/0xa*(parseInt(_0x3e06cb(0x162))/0xb);if(_0x6ef543===_0x111434)break;else _0x1b9193['push'](_0x1b9193['shift']());}catch(_0x11c355){_0x1b9193['push'](_0x1b9193['shift']());}}}(a171_0x14c9,0x67be8));const REDACTED_ACCESS_KEY='<redacted>';export function maskCliAccessKey(_0x210751){const _0x44ece8=a171_0xfbd8;if(typeof _0x210751!==_0x44ece8(0x15e)||_0x210751[_0x44ece8(0x15a)]<=0x8)return REDACTED_ACCESS_KEY;return''+_0x210751[_0x44ece8(0x164)](0x0,0x8)+'*'[_0x44ece8(0x165)](_0x210751[_0x44ece8(0x15a)]-0x8);}export function redactCliConfigCredentials(_0x1e56e5){const _0x12a26d=a171_0xfbd8,_0x3efa81={..._0x1e56e5};return Object['prototype'][_0x12a26d(0x16d)]['call'](_0x3efa81,_0x12a26d(0x160))&&(_0x3efa81[_0x12a26d(0x160)]=maskCliAccessKey(_0x3efa81['accessKey'])),_0x3efa81[_0x12a26d(0x167)]&&typeof _0x3efa81[_0x12a26d(0x167)]===_0x12a26d(0x161)&&!Array[_0x12a26d(0x159)](_0x3efa81[_0x12a26d(0x167)])&&(_0x3efa81['apps']=redactLegacyAppCredentials(_0x3efa81[_0x12a26d(0x167)])),_0x3efa81;}function a171_0xfbd8(_0x4a9252,_0x291436){_0x4a9252=_0x4a9252-0x159;const _0x14c919=a171_0x14c9();let _0xfbd806=_0x14c919[_0x4a9252];return _0xfbd806;}export function redactCliConfigValue(_0x593414,_0x2078e2){const _0x2156a9=a171_0xfbd8;if(_0x593414==='accessKey'||/^apps\.[^.]+\.accessKey$/[_0x2156a9(0x15b)](_0x593414))return maskCliAccessKey(_0x2078e2);if(_0x593414===_0x2156a9(0x167)&&_0x2078e2&&typeof _0x2078e2===_0x2156a9(0x161)&&!Array[_0x2156a9(0x159)](_0x2078e2))return redactLegacyAppCredentials(_0x2078e2);if(/^apps\.[^.]+$/[_0x2156a9(0x15b)](_0x593414)&&_0x2078e2&&typeof _0x2078e2===_0x2156a9(0x161)&&!Array[_0x2156a9(0x159)](_0x2078e2)){const _0xeba2a7=_0x2078e2;return Object[_0x2156a9(0x16f)][_0x2156a9(0x16d)][_0x2156a9(0x15c)](_0xeba2a7,_0x2156a9(0x160))?{..._0xeba2a7,'accessKey':maskCliAccessKey(_0xeba2a7[_0x2156a9(0x160)])}:_0x2078e2;}return _0x2078e2;}function redactLegacyAppCredentials(_0x45939f){const _0x49687b=a171_0xfbd8;return Object['fromEntries'](Object[_0x49687b(0x16e)](_0x45939f)[_0x49687b(0x171)](([_0xb6745b,_0x50fb66])=>{const _0x332e35=_0x49687b;if(!_0x50fb66||typeof _0x50fb66!==_0x332e35(0x161)||Array[_0x332e35(0x159)](_0x50fb66))return[_0xb6745b,_0x50fb66];const _0x2b2106={..._0x50fb66};return Object[_0x332e35(0x16f)][_0x332e35(0x16d)][_0x332e35(0x15c)](_0x2b2106,_0x332e35(0x160))&&(_0x2b2106[_0x332e35(0x160)]=maskCliAccessKey(_0x2b2106[_0x332e35(0x160)])),[_0xb6745b,_0x2b2106];}));}function a171_0x14c9(){const _0x28f45d=['6Ldsfyh','64283gcIcCb','94670rYSKMN','hasOwnProperty','entries','prototype','101384ztxMrR','map','isArray','length','test','call','9MKpLIQ','string','48muWFeD','accessKey','object','165sZKgwZ','4066395IuQGxb','slice','repeat','324248gdHYBK','apps','868365aRrojr','2137373oPmwwV'];a171_0x14c9=function(){return _0x28f45d;};return a171_0x14c9();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x31160e,_0x25e1e8){const _0x3c77e8=a172_0x5780,_0x1ef177=_0x31160e();while(!![]){try{const _0x7bc79f=-parseInt(_0x3c77e8(0x1bb))/0x1*(parseInt(_0x3c77e8(0x1b4))/0x2)+-parseInt(_0x3c77e8(0x1bf))/0x3+-parseInt(_0x3c77e8(0x1be))/0x4*(-parseInt(_0x3c77e8(0x1b5))/0x5)+-parseInt(_0x3c77e8(0x1b8))/0x6+-parseInt(_0x3c77e8(0x1bd))/0x7*(-parseInt(_0x3c77e8(0x1b6))/0x8)+-parseInt(_0x3c77e8(0x1b9))/0x9*(-parseInt(_0x3c77e8(0x1bc))/0xa)+-parseInt(_0x3c77e8(0x1ba))/0xb*(-parseInt(_0x3c77e8(0x1b7))/0xc);if(_0x7bc79f===_0x25e1e8)break;else _0x1ef177['push'](_0x1ef177['shift']());}catch(_0x4428f0){_0x1ef177['push'](_0x1ef177['shift']());}}}(a172_0x5877,0x950db));import{createJqFilter,resolveBundledJqPaths}from'@lovrabet/cli-framework';function a172_0x5877(){const _0xa24a94=['11wWVVjB','75926kSXoHC','110vKWBYK','1869QmUKJD','4MNFAKX','3642000VKmnQN','22VNiiOh','4112585wugRQZ','24392WZDXuJ','11221032aLvnUk','6725130KZBVhQ','989082TpbzAj'];a172_0x5877=function(){return _0xa24a94;};return a172_0x5877();}function a172_0x5780(_0x1dc2d0,_0x4cd1c6){_0x1dc2d0=_0x1dc2d0-0x1b4;const _0x5877d1=a172_0x5877();let _0x578013=_0x5877d1[_0x1dc2d0];return _0x578013;}import{CliErrors}from'../errors.js';export const applyJqFilter=createJqFilter(CliErrors,{'bundledJqPaths':resolveBundledJqPaths()});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1f4a7b,_0x57a9ea){const _0x557b57=a173_0x2042,_0x3dd37e=_0x1f4a7b();while(!![]){try{const _0x471d51=parseInt(_0x557b57(0x1b4))/0x1+parseInt(_0x557b57(0x1ba))/0x2+-parseInt(_0x557b57(0x1ad))/0x3+parseInt(_0x557b57(0x1b2))/0x4*(-parseInt(_0x557b57(0x1b9))/0x5)+-parseInt(_0x557b57(0x1b6))/0x6+parseInt(_0x557b57(0x1b1))/0x7+-parseInt(_0x557b57(0x1b8))/0x8*(parseInt(_0x557b57(0x1be))/0x9);if(_0x471d51===_0x57a9ea)break;else _0x3dd37e['push'](_0x3dd37e['shift']());}catch(_0x3a395d){_0x3dd37e['push'](_0x3dd37e['shift']());}}}(a173_0x4691,0xb9d0f));import a173_0x7c6f14 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 a173_0x2042(_0xe2a516,_0x7d9207){_0xe2a516=_0xe2a516-0x1ab;const _0x469165=a173_0x4691();let _0x2042f9=_0x469165[_0xe2a516];return _0x2042f9;}import{getCliVersion}from'../utils/version.js';export function evaluateCliVersionPolicy(_0x39a1b4,_0x4bbfff){const _0x5d08d2=a173_0x2042,_0x44361b=a173_0x7c6f14[_0x5d08d2(0x1b7)](_0x39a1b4)===_0x39a1b4,_0x6e19a=_0x4bbfff?.[_0x5d08d2(0x1bf)]??null,_0x17c8bb=_0x4bbfff?.[_0x5d08d2(0x1af)]??null,_0x564c12=Boolean(_0x44361b&&_0x6e19a&&a173_0x7c6f14['lt'](_0x39a1b4,_0x6e19a)),_0x1880c8=Boolean(_0x44361b&&_0x17c8bb&&a173_0x7c6f14['lt'](_0x39a1b4,_0x17c8bb));return{'currentVersion':_0x39a1b4,'stableVersion':_0x6e19a,'minimumVersion':_0x17c8bb,'needsUpgrade':_0x564c12||_0x1880c8,'belowMinimum':_0x1880c8,'upgradeMessage':_0x4bbfff?.['upgradeMessage'],'minimumVersionMessage':_0x4bbfff?.[_0x5d08d2(0x1bd)]};}export async function checkCliVersion(){return evaluateCliVersionPolicy(getCliVersion(),await getCliVersionPolicy());}export function getCliUpgradeCommand(_0x36786a){const _0x1ec1ed=a173_0x2042;return _0x1ec1ed(0x1b3)+LOVRABET_NPM_PACKAGE_NAME+'@'+(_0x36786a[_0x1ec1ed(0x1bf)]??_0x1ec1ed(0x1ae));}export function assertCliVersionSupported(_0x3e213f){const _0x3dfde3=a173_0x2042;if(!_0x3e213f[_0x3dfde3(0x1b5)])return;const _0x1d8e45=[_0x3e213f['minimumVersionMessage'],'Current\x20version:\x20'+_0x3e213f[_0x3dfde3(0x1bc)],_0x3dfde3(0x1ab)+_0x3e213f[_0x3dfde3(0x1af)],_0x3dfde3(0x1ac)+(_0x3e213f[_0x3dfde3(0x1bf)]??_0x3dfde3(0x1b0)),'Upgrade\x20command:\x20'+getCliUpgradeCommand(_0x3e213f)]['filter'](Boolean)[_0x3dfde3(0x1bb)]('\x0a');throw CliErrors['validation']('Current\x20CLI\x20version\x20is\x20below\x20the\x20minimum\x20supported\x20version.',_0x1d8e45);}function a173_0x4691(){const _0xbe0558=['2251380mfHSHJ','latest','minimumVersion','unavailable','2506651aqKGLT','1974068YCAUpa','npm\x20install\x20-g\x20','1237575qdMpcu','belowMinimum','5248518IIOhfS','valid','808JaIeEU','5aPqLKe','2916376alvOva','join','currentVersion','minimumVersionMessage','15507LlJwPx','stableVersion','Minimum\x20supported:\x20','Recommended\x20stable:\x20'];a173_0x4691=function(){return _0xbe0558;};return a173_0x4691();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1b09db,_0x1ee77f){const _0x4a2aee=a174_0x47c6,_0x375b57=_0x1b09db();while(!![]){try{const _0x316228=-parseInt(_0x4a2aee(0x185))/0x1*(parseInt(_0x4a2aee(0x18e))/0x2)+parseInt(_0x4a2aee(0x180))/0x3+parseInt(_0x4a2aee(0x193))/0x4+parseInt(_0x4a2aee(0x192))/0x5+-parseInt(_0x4a2aee(0x191))/0x6+-parseInt(_0x4a2aee(0x183))/0x7*(parseInt(_0x4a2aee(0x186))/0x8)+-parseInt(_0x4a2aee(0x18a))/0x9*(-parseInt(_0x4a2aee(0x18b))/0xa);if(_0x316228===_0x1ee77f)break;else _0x375b57['push'](_0x375b57['shift']());}catch(_0x388ca6){_0x375b57['push'](_0x375b57['shift']());}}}(a174_0x5e9f,0x31872));import a174_0x30c656 from'semver';function a174_0x5e9f(){const _0xde35f6=['1247820eFwEUA','1210180BgDddJ','817264tcuVCU','stableVersion','minimumVersionMessage','valid','trim','491487OiLMWv','finally','upgradeMessage','12502NqjgtS','cli','1eBfSlP','688fWxwgc','minVersion','recommendedVersion','application/json','9keiSUm','2098160VjwGIz','json','object','511130aWFdaG','string','then'];a174_0x5e9f=function(){return _0xde35f6;};return a174_0x5e9f();}import{LOVRABET_CLI_VERSION_POLICY_URL}from'../constant/distribution.js';function a174_0x47c6(_0x4a2c86,_0x272fd3){_0x4a2c86=_0x4a2c86-0x17d;const _0x5e9f67=a174_0x5e9f();let _0x47c676=_0x5e9f67[_0x4a2c86];return _0x47c676;}const SUCCESS_CACHE_TTL_MS=0x5*0x3c*0x3e8,FAILURE_CACHE_TTL_MS=0x3c*0x3e8,FETCH_TIMEOUT_MS=0x5dc;function pickString(_0x4f4ebd){const _0x30ce0b=a174_0x47c6;return typeof _0x4f4ebd===_0x30ce0b(0x18f)&&_0x4f4ebd[_0x30ce0b(0x17f)]()?_0x4f4ebd[_0x30ce0b(0x17f)]():null;}function pickStrictSemver(_0xa0ce9a){const _0x4338ea=a174_0x47c6,_0x34b277=pickString(_0xa0ce9a);return _0x34b277&&a174_0x30c656[_0x4338ea(0x17e)](_0x34b277)===_0x34b277?_0x34b277:null;}export function normalizeCliVersionPolicy(_0x23f20f){const _0x2ba290=a174_0x47c6;if(!_0x23f20f||typeof _0x23f20f!==_0x2ba290(0x18d))return null;const _0x31ac83=_0x23f20f,_0x5d3b85=_0x31ac83[_0x2ba290(0x184)]&&typeof _0x31ac83[_0x2ba290(0x184)]===_0x2ba290(0x18d)?_0x31ac83[_0x2ba290(0x184)]:_0x31ac83,_0xbdf5f3=pickStrictSemver(_0x5d3b85[_0x2ba290(0x194)]??_0x5d3b85['latestVersion']??_0x5d3b85[_0x2ba290(0x188)]),_0x445978=pickStrictSemver(_0x5d3b85['minimumVersion']??_0x5d3b85[_0x2ba290(0x187)]);if(!_0xbdf5f3&&!_0x445978)return null;if(_0xbdf5f3&&_0x445978&&a174_0x30c656['gt'](_0x445978,_0xbdf5f3))return null;return{'stableVersion':_0xbdf5f3,'minimumVersion':_0x445978,'upgradeMessage':pickString(_0x5d3b85[_0x2ba290(0x182)])??undefined,'minimumVersionMessage':pickString(_0x5d3b85[_0x2ba290(0x17d)])??undefined};}export async function fetchCliVersionPolicy(){const _0x432002=a174_0x47c6;try{const _0x3a449e=await fetch(LOVRABET_CLI_VERSION_POLICY_URL,{'headers':{'Accept':_0x432002(0x189)},'signal':AbortSignal['timeout'](FETCH_TIMEOUT_MS)});if(!_0x3a449e['ok'])return null;return normalizeCliVersionPolicy(await _0x3a449e[_0x432002(0x18c)]());}catch{return null;}}let cachedPolicy=null,cachedAt=0x0,hasCachedPolicy=![],pendingPolicy=null;export async function getCliVersionPolicy(){const _0x185e66=a174_0x47c6,_0x787ca8=Date['now']();if(hasCachedPolicy){const _0x4a6677=cachedPolicy?SUCCESS_CACHE_TTL_MS:FAILURE_CACHE_TTL_MS;if(_0x787ca8-cachedAt<_0x4a6677)return cachedPolicy;}if(pendingPolicy)return pendingPolicy;return pendingPolicy=fetchCliVersionPolicy()[_0x185e66(0x190)](_0x322986=>{return cachedPolicy=_0x322986,cachedAt=Date['now'](),hasCachedPolicy=!![],_0x322986;})[_0x185e66(0x181)](()=>{pendingPolicy=null;}),pendingPolicy;}export function clearCliVersionPolicyCache(){cachedPolicy=null,cachedAt=0x0,hasCachedPolicy=![],pendingPolicy=null;}
|
package/lib/utils/logger.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a175_0x38d3(){const _0x183099=['237479eMmHKq','dirname','setLogPath','54188AGlZTM','existsSync','stringify','map','split','701570yDZMTx','4WPDbCM','unknown','rawCommand','1284iXWlND','format','utf8','16125fcuwKK','success','trim','winstonLogger','log','Failed\x20to\x20read\x20logs:','green','initWinstonLogger','red','logFilePath','1199277IlSOFB','now','filter','currentRawCommand','114ivfdrP','transports','addColors','logFileName','parse','details','Failed\x20to\x20clear\x20logs:','533239TBsHLW','combine','mkdirSync','timestamp','info','readLogs','errors','join','command','clearLogs','126YzLvCP','writeFileSync','message','error','toISOString','duration','setRawCommand','warn','1255888lfoLGm','22utQiZU','yellow'];a175_0x38d3=function(){return _0x183099;};return a175_0x38d3();}const a175_0xdeb043=a175_0x50ba;(function(_0x2c6df6,_0x485a57){const _0x42bb1e=a175_0x50ba,_0x1551df=_0x2c6df6();while(!![]){try{const _0x42638c=parseInt(_0x42bb1e(0x12c))/0x1*(-parseInt(_0x42bb1e(0x127))/0x2)+parseInt(_0x42bb1e(0x142))/0x3*(-parseInt(_0x42bb1e(0x132))/0x4)+parseInt(_0x42bb1e(0x138))/0x5*(-parseInt(_0x42bb1e(0x146))/0x6)+parseInt(_0x42bb1e(0x14d))/0x7+parseInt(_0x42bb1e(0x126))/0x8+parseInt(_0x42bb1e(0x11e))/0x9*(-parseInt(_0x42bb1e(0x131))/0xa)+-parseInt(_0x42bb1e(0x129))/0xb*(-parseInt(_0x42bb1e(0x135))/0xc);if(_0x42638c===_0x485a57)break;else _0x1551df['push'](_0x1551df['shift']());}catch(_0x289b2a){_0x1551df['push'](_0x1551df['shift']());}}}(a175_0x38d3,0x7b04e));function a175_0x50ba(_0x2905e2,_0x26e20c){_0x2905e2=_0x2905e2-0x11e;const _0x38d3ec=a175_0x38d3();let _0x50bad9=_0x38d3ec[_0x2905e2];return _0x50bad9;}import a175_0x5ebcd1 from'winston';import a175_0x2eb19c from'node:fs';import a175_0x20d904 from'node:path';import{PRODUCT_CONFIG}from'../constant/product.js';class Logger{[a175_0xdeb043(0x13b)];[a175_0xdeb043(0x141)]='';[a175_0xdeb043(0x145)]='';constructor(){}[a175_0xdeb043(0x124)](_0x577392){const _0x1b05c2=a175_0xdeb043;this[_0x1b05c2(0x145)]=_0x577392;}[a175_0xdeb043(0x12b)](_0x31caee){const _0x7fb4f9=a175_0xdeb043;this[_0x7fb4f9(0x141)]=a175_0x20d904[_0x7fb4f9(0x154)](_0x31caee,PRODUCT_CONFIG[_0x7fb4f9(0x149)]),this['winstonLogger']&&this[_0x7fb4f9(0x13b)]['clear'](),this[_0x7fb4f9(0x13f)]();}[a175_0xdeb043(0x13f)](){const _0x42b833=a175_0xdeb043,_0x5bc591=a175_0x20d904[_0x42b833(0x12a)](this[_0x42b833(0x141)]);!a175_0x2eb19c[_0x42b833(0x12d)](_0x5bc591)&&a175_0x2eb19c[_0x42b833(0x14f)](_0x5bc591,{'recursive':!![]});const _0x2491fd=a175_0x5ebcd1[_0x42b833(0x136)][_0x42b833(0x14e)](a175_0x5ebcd1['format']['timestamp'](),a175_0x5ebcd1[_0x42b833(0x136)][_0x42b833(0x153)]({'stack':!![]}),a175_0x5ebcd1[_0x42b833(0x136)]['printf'](_0x221727=>{const _0x11c14b=_0x42b833,_0x4aaab3={'timestamp':_0x221727[_0x11c14b(0x150)]||new Date()[_0x11c14b(0x122)](),'level':_0x221727['level']||'info','command':_0x221727[_0x11c14b(0x155)]||_0x11c14b(0x133),'rawCommand':_0x221727[_0x11c14b(0x134)]||this[_0x11c14b(0x145)]||undefined,'message':_0x221727['message']||'','duration':_0x221727[_0x11c14b(0x123)]||undefined,'details':_0x221727[_0x11c14b(0x14b)]||undefined};return JSON[_0x11c14b(0x12e)](_0x4aaab3);}));this[_0x42b833(0x13b)]=a175_0x5ebcd1['createLogger']({'level':'info','format':_0x2491fd,'transports':[new a175_0x5ebcd1[(_0x42b833(0x147))]['File']({'filename':this[_0x42b833(0x141)],'level':'info'})],'silent':![]}),a175_0x5ebcd1[_0x42b833(0x148)]({'success':_0x42b833(0x13e),'error':_0x42b833(0x140),'warn':_0x42b833(0x128),'info':'blue'});}[a175_0xdeb043(0x151)](_0x1b965e,_0x27fcf1,_0x380511){const _0xf57eba=a175_0xdeb043;if(!this[_0xf57eba(0x141)]||!this[_0xf57eba(0x13b)])return;this[_0xf57eba(0x13b)][_0xf57eba(0x151)](_0x27fcf1,{'command':_0x1b965e,'details':_0x380511});}[a175_0xdeb043(0x139)](_0x31b055,_0x3bdf58,_0x3a671e,_0x4c2b92){const _0xf7ac0c=a175_0xdeb043;if(!this['logFilePath']||!this[_0xf7ac0c(0x13b)])return;this['winstonLogger'][_0xf7ac0c(0x13c)](_0xf7ac0c(0x151),_0x3bdf58,{'level':'success','command':_0x31b055,'duration':_0x3a671e,'details':_0x4c2b92});}[a175_0xdeb043(0x121)](_0x6c815d,_0x43f7ad,_0x5e8ad6){const _0x99873e=a175_0xdeb043;if(!this['logFilePath']||!this['winstonLogger'])return;this[_0x99873e(0x13b)][_0x99873e(0x121)](_0x43f7ad,{'command':_0x6c815d,'details':_0x5e8ad6});}[a175_0xdeb043(0x125)](_0x2bc458,_0x279b0d,_0x8c6ee){const _0xc10b7=a175_0xdeb043;if(!this[_0xc10b7(0x141)]||!this[_0xc10b7(0x13b)])return;this[_0xc10b7(0x13b)][_0xc10b7(0x125)](_0x279b0d,{'command':_0x2bc458,'details':_0x8c6ee});}async['logTask'](_0x2d13ea,_0x370a69,_0x13cfa5){const _0x446c63=a175_0xdeb043,_0x222f39=Date[_0x446c63(0x143)]();this[_0x446c63(0x151)](_0x2d13ea,'Starting:\x20'+_0x370a69);try{const _0x234a25=await _0x13cfa5(),_0x436f18=Date[_0x446c63(0x143)]()-_0x222f39;return this[_0x446c63(0x139)](_0x2d13ea,'Completed:\x20'+_0x370a69,_0x436f18),_0x234a25;}catch(_0x59ac9e){const _0x4c0523=Date['now']()-_0x222f39;this[_0x446c63(0x121)](_0x2d13ea,'Failed:\x20'+_0x370a69,{'error':_0x59ac9e instanceof Error?_0x59ac9e[_0x446c63(0x120)]:String(_0x59ac9e),'duration':_0x4c0523});throw _0x59ac9e;}}[a175_0xdeb043(0x152)](){const _0x164728=a175_0xdeb043;try{if(!a175_0x2eb19c[_0x164728(0x12d)](this[_0x164728(0x141)]))return[];const _0x1cdc41=a175_0x2eb19c['readFileSync'](this['logFilePath'],_0x164728(0x137));return _0x1cdc41[_0x164728(0x130)](/\r?\n/)[_0x164728(0x144)](_0x49470f=>_0x49470f[_0x164728(0x13a)]())[_0x164728(0x12f)](_0x1e71d6=>JSON[_0x164728(0x14a)](_0x1e71d6));}catch(_0x461098){return console[_0x164728(0x125)](_0x164728(0x13d),_0x461098),[];}}[a175_0xdeb043(0x156)](){const _0x4f442a=a175_0xdeb043;try{a175_0x2eb19c[_0x4f442a(0x12d)](this[_0x4f442a(0x141)])&&a175_0x2eb19c[_0x4f442a(0x11f)](this[_0x4f442a(0x141)],'','utf8');}catch(_0x2119ff){console[_0x4f442a(0x125)](_0x4f442a(0x14c),_0x2119ff);}}['getWinstonInstance'](){const _0x37f2f6=a175_0xdeb043;return this[_0x37f2f6(0x13b)];}}export const logger=new Logger();
|