@lovrabet/lovrabet-cli 2.3.7 → 2.3.8-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api-doc/index.js +1 -1
- package/lib/commands/app/cache.js +1 -1
- package/lib/commands/app/definitions.js +1 -1
- package/lib/commands/app/eligibility.js +1 -1
- package/lib/commands/app/mock-loader.js +1 -1
- package/lib/commands/app/remote-source.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/approval/index.js +1 -1
- package/lib/commands/artifact/index.js +1 -1
- package/lib/commands/auth/device.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/auth/prompt.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/exec.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/common/config-policy.js +1 -1
- package/lib/commands/common/constraints.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/config/definitions.js +1 -1
- package/lib/commands/config/init.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/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.d.ts +32 -6
- 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.d.ts +2 -4
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/update.js +1 -1
- package/lib/commands/user-account/bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/config/domain-config.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/app.js +1 -1
- package/lib/constant/auth-mode.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/distribution.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/product.js +1 -1
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/api-client.d.ts +20 -340
- 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-search-client.js +1 -1
- package/lib/core/sdk-client.d.ts +7 -10
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/access-error.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/preparse.js +1 -1
- package/lib/framework/rate-limit.js +1 -1
- package/lib/framework/raw-flags.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-confirmation.js +1 -1
- package/lib/framework/runner-error.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/service-order.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/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.d.ts +2 -0
- package/lib/utils/runtime-user-id.js +1 -0
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +3 -3
- package/skills/lovrabet/SKILL.md +2 -2
- package/skills/lovrabet/guides/role-and-permission-workflow.md +3 -2
- package/skills/lovrabet.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x327a0d,_0x35b7d4){const _0x3d9d3c=a156_0x53bf,_0x52dadb=_0x327a0d();while(!![]){try{const _0x1ec83c=parseInt(_0x3d9d3c(0x190))/0x1+parseInt(_0x3d9d3c(0x1a7))/0x2+-parseInt(_0x3d9d3c(0x1aa))/0x3+-parseInt(_0x3d9d3c(0x197))/0x4*(parseInt(_0x3d9d3c(0x19f))/0x5)+parseInt(_0x3d9d3c(0x196))/0x6+parseInt(_0x3d9d3c(0x18d))/0x7*(parseInt(_0x3d9d3c(0x189))/0x8)+-parseInt(_0x3d9d3c(0x184))/0x9;if(_0x1ec83c===_0x35b7d4)break;else _0x52dadb['push'](_0x52dadb['shift']());}catch(_0x3f96f2){_0x52dadb['push'](_0x52dadb['shift']());}}}(a156_0x202a,0x560cb));function a156_0x202a(){const _0x5570ef=['split','values','content','from','3505224TTNOKr','includes','sort','set','7EAuhrK','trim','path','174523rcnURV','validation','push','bytes','size','Duplicate\x20Skill\x20file\x20path:\x20','2678478UrFDRX','1277192OxNFgN','has','Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20','compare','Skill\x20file\x20sha256\x20is\x20invalid:\x20','startsWith','sha256','utf8','10BDmbBX','toLowerCase','Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20','add','string','toString','length','isDirectory','695004FVGIDQ','isSymbolicLink','isArray','133278kHBlkf','test','Skill\x20file\x20path\x20must\x20be\x20text.','object','name','3339990sXWYse'];a156_0x202a=function(){return _0x5570ef;};return a156_0x202a();}import{readFileSync,readdirSync,realpathSync}from'node:fs';import{relative,resolve}from'node:path';import{CliErrors}from'../../errors.js';import{IGNORED_DIR_NAMES,IGNORED_FILE_NAMES,SKILL_FILE}from'./constants.js';function a156_0x53bf(_0x170b18,_0x485b73){_0x170b18=_0x170b18-0x180;const _0x202a97=a156_0x202a();let _0x53bf98=_0x202a97[_0x170b18];return _0x53bf98;}export function fileContent(_0x3d4ae8){const _0x72e45=a156_0x53bf;return _0x3d4ae8[_0x72e45(0x193)]??Buffer[_0x72e45(0x188)](_0x3d4ae8['content']??'',_0x72e45(0x19e));}export function fileText(_0x14ebf7){const _0x279d51=a156_0x53bf;return fileContent(_0x14ebf7)[_0x279d51(0x1a4)]('utf8');}export function normalizeLocalFiles(_0x4eeb8c){const _0x208a93=a156_0x53bf;if(!Array[_0x208a93(0x1a9)](_0x4eeb8c)||_0x4eeb8c[_0x208a93(0x1a5)]===0x0)return[];const _0x53e5b6=new Map();for(const _0x48d3ba of _0x4eeb8c){if(!_0x48d3ba||typeof _0x48d3ba!==_0x208a93(0x182)||typeof _0x48d3ba[_0x208a93(0x18f)]!=='string')throw CliErrors[_0x208a93(0x191)](_0x208a93(0x181));const _0x273cee=normalizeSkillRelativePath(_0x48d3ba[_0x208a93(0x18f)]);if(_0x53e5b6['has'](_0x273cee))throw CliErrors[_0x208a93(0x191)](_0x208a93(0x195)+_0x273cee);if(_0x48d3ba['bytes']!==undefined&&!Buffer['isBuffer'](_0x48d3ba[_0x208a93(0x193)]))throw CliErrors[_0x208a93(0x191)]('Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20'+_0x273cee);if(_0x48d3ba[_0x208a93(0x193)]===undefined&&typeof _0x48d3ba[_0x208a93(0x187)]!==_0x208a93(0x1a3))throw CliErrors[_0x208a93(0x191)](_0x208a93(0x1a1)+_0x273cee);const _0x3cd9c2=fileContent(_0x48d3ba);_0x53e5b6['set'](_0x273cee,{'path':_0x273cee,'bytes':_0x3cd9c2});}return Array['from'](_0x53e5b6[_0x208a93(0x186)]())[_0x208a93(0x18b)](compareSkillFiles);}export function normalizeManifestFiles(_0x811006){const _0x50c47b=a156_0x53bf;if(!Array[_0x50c47b(0x1a9)](_0x811006)||_0x811006[_0x50c47b(0x1a5)]===0x0)return[];const _0x4dc1ee=new Map();for(const _0x1d4a46 of _0x811006){if(!_0x1d4a46||typeof _0x1d4a46!=='object'||typeof _0x1d4a46[_0x50c47b(0x18f)]!==_0x50c47b(0x1a3))throw CliErrors['validation'](_0x50c47b(0x181));const _0x95a69a=normalizeSkillRelativePath(_0x1d4a46['path']);if(_0x4dc1ee[_0x50c47b(0x198)](_0x95a69a))throw CliErrors[_0x50c47b(0x191)](_0x50c47b(0x195)+_0x95a69a);if(!isSha256Hex(_0x1d4a46[_0x50c47b(0x19d)]))throw CliErrors['validation'](_0x50c47b(0x19b)+_0x95a69a);if(!Number['isSafeInteger'](_0x1d4a46[_0x50c47b(0x194)])||_0x1d4a46[_0x50c47b(0x194)]<0x0)throw CliErrors[_0x50c47b(0x191)]('Skill\x20file\x20size\x20is\x20invalid:\x20'+_0x95a69a);_0x4dc1ee[_0x50c47b(0x18c)](_0x95a69a,{'path':_0x95a69a,'sha256':_0x1d4a46[_0x50c47b(0x19d)][_0x50c47b(0x1a0)](),'size':_0x1d4a46[_0x50c47b(0x194)]});}return Array[_0x50c47b(0x188)](_0x4dc1ee[_0x50c47b(0x186)]())[_0x50c47b(0x18b)](compareSkillFiles);}export function scanSkillDirectory(_0x43b6c4,_0x23a9b4={}){const _0x2433f6=realpathSync(_0x43b6c4),_0x33a585=canonicalExcludedFilePaths(_0x23a9b4['excludedFilePaths']),_0x4884f3=[];function _0xbfb79e(_0x52616f){const _0x71e170=a156_0x53bf,_0x2aa9be=readdirSync(_0x52616f,{'withFileTypes':!![]})[_0x71e170(0x18b)]((_0x18323f,_0x3b30e0)=>_0x18323f[_0x71e170(0x183)]['localeCompare'](_0x3b30e0[_0x71e170(0x183)]));for(const _0x27796f of _0x2aa9be){if(_0x27796f[_0x71e170(0x1a6)]()&&IGNORED_DIR_NAMES[_0x71e170(0x198)](_0x27796f[_0x71e170(0x183)]))continue;if(IGNORED_FILE_NAMES[_0x71e170(0x198)](_0x27796f[_0x71e170(0x183)]))continue;const _0x1638ab=resolve(_0x52616f,_0x27796f['name']);if(isExcludedFilePath(_0x1638ab,_0x33a585))continue;if(_0x27796f[_0x71e170(0x1a8)]())throw CliErrors['validation'](_0x71e170(0x199)+_0x1638ab);const _0x180d69=toPosixPath(relative(_0x2433f6,_0x1638ab));if(_0x27796f[_0x71e170(0x1a6)]()){_0xbfb79e(_0x1638ab);continue;}if(!_0x27796f['isFile']())continue;validateSkillRelativePath(_0x180d69);const _0x13d4a7=readFileSync(_0x1638ab);_0x4884f3[_0x71e170(0x192)]({'path':_0x180d69,'bytes':_0x13d4a7});}}return _0xbfb79e(_0x2433f6),normalizeLocalFiles(_0x4884f3);}function canonicalExcludedFilePaths(_0x3367c2){const _0x30546e=a156_0x53bf,_0x419433=new Set();for(const _0x48a26a of _0x3367c2??[]){const _0x4ed27b=resolve(_0x48a26a);_0x419433[_0x30546e(0x1a2)](_0x4ed27b);try{_0x419433[_0x30546e(0x1a2)](realpathSync(_0x4ed27b));}catch{}}return _0x419433;}function isExcludedFilePath(_0x5bb84c,_0x56f83e){const _0xa4e8cb=a156_0x53bf;if(_0x56f83e[_0xa4e8cb(0x198)](_0x5bb84c))return!![];if(_0x56f83e['size']===0x0)return![];try{return _0x56f83e[_0xa4e8cb(0x198)](realpathSync(_0x5bb84c));}catch{return![];}}export function compareSkillFiles(_0x7733d7,_0x3cbba3){const _0x42eac1=a156_0x53bf;if(_0x7733d7['path']===SKILL_FILE)return _0x3cbba3[_0x42eac1(0x18f)]===SKILL_FILE?0x0:-0x1;if(_0x3cbba3[_0x42eac1(0x18f)]===SKILL_FILE)return 0x1;return Buffer[_0x42eac1(0x19a)](Buffer[_0x42eac1(0x188)](_0x7733d7[_0x42eac1(0x18f)],_0x42eac1(0x19e)),Buffer[_0x42eac1(0x188)](_0x3cbba3[_0x42eac1(0x18f)],_0x42eac1(0x19e)));}export function normalizeSkillRelativePath(_0x2dfe6a){const _0x51ae7c=a156_0x53bf,_0x467692=toPosixPath(_0x2dfe6a[_0x51ae7c(0x18e)]());return validateSkillRelativePath(_0x467692),_0x467692;}export function validateSkillRelativePath(_0x1b75eb){const _0x328404=a156_0x53bf;if(!_0x1b75eb||_0x1b75eb[_0x328404(0x19c)]('/')||_0x1b75eb[_0x328404(0x18a)]('//'))throw CliErrors[_0x328404(0x191)]('Unsafe\x20Skill\x20file\x20path:\x20'+_0x1b75eb);for(const _0x2c025a of _0x1b75eb[_0x328404(0x185)]('/')){if(!_0x2c025a||_0x2c025a==='.'||_0x2c025a==='..')throw CliErrors['validation']('Unsafe\x20Skill\x20file\x20path:\x20'+_0x1b75eb);}}export function toPosixPath(_0x435b45){return _0x435b45['replace'](/\\/g,'/');}export function isSha256Hex(_0x591e61){const _0x285cdf=a156_0x53bf;return typeof _0x591e61===_0x285cdf(0x1a3)&&/^[a-fA-F0-9]{64}$/[_0x285cdf(0x180)](_0x591e61);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x1790f2,_0x22b1e1){const _0x56fd2c=a157_0x55d5,_0x36c60a=_0x1790f2();while(!![]){try{const _0x1e26ae=parseInt(_0x56fd2c(0x1e7))/0x1*(parseInt(_0x56fd2c(0x1f1))/0x2)+-parseInt(_0x56fd2c(0x208))/0x3*(parseInt(_0x56fd2c(0x1d9))/0x4)+parseInt(_0x56fd2c(0x1da))/0x5*(parseInt(_0x56fd2c(0x20f))/0x6)+-parseInt(_0x56fd2c(0x1e5))/0x7+parseInt(_0x56fd2c(0x1ec))/0x8+-parseInt(_0x56fd2c(0x1fe))/0x9*(-parseInt(_0x56fd2c(0x1ed))/0xa)+parseInt(_0x56fd2c(0x205))/0xb*(-parseInt(_0x56fd2c(0x1ee))/0xc);if(_0x1e26ae===_0x22b1e1)break;else _0x36c60a['push'](_0x36c60a['shift']());}catch(_0x52f95d){_0x36c60a['push'](_0x36c60a['shift']());}}}(a157_0x2298,0x841ba));import{existsSync,lstatSync,mkdirSync,readFileSync,rmSync}from'node:fs';import{dirname,resolve}from'node:path';function a157_0x55d5(_0x4b0f8e,_0x5e5e9f){_0x4b0f8e=_0x4b0f8e-0x1d7;const _0x229818=a157_0x2298();let _0x55d5bc=_0x229818[_0x4b0f8e];return _0x55d5bc;}function a157_0x2298(){const _0x5ae052=['length','---\x0a','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','4028136sfTLiu','470JpjpJt','8787360LmfSbr','\x0a---\x0a\x0a','join','12490RWYGdf','contents','name:\x20','path','toString','version','test','trimEnd','has','schemaVersion','displayName','---','keys','186696NxZTpw','Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20','status','skillCode','stringify','packageBytes','set','11JkqYzl','fileHashes','trim','289269uzkfaF','validation','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.','find','utf8','entries','match','1938LvRgat','Managed\x20file\x20was\x20removed\x20locally:\x20','accessKey','appCode','replace','.\x20Changed\x20file:\x20','scope','force','8MAsToU','3670bClMIF','paths','isFile','description:\x20','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','env','contentHash','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','filter','map','example','2969309TkEkhN','pulledAt','28YrXRZF','description'];a157_0x2298=function(){return _0x5ae052;};return a157_0x2298();}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(_0x2cfb8b,_0x1da3b2,_0xbb994c){const _0x647638=a157_0x55d5,_0x153293=requireSkillCode(_0x2cfb8b),_0x11e69f=requirePackageBytes(_0x153293,_0xbb994c[_0x647638(0x203)]),_0x2d37f8=extractDownloadedPackage(_0x11e69f),_0x4b6c75=_0x2d37f8[_0x647638(0x20b)](_0x3175ff=>_0x3175ff['path']===SKILL_FILE);if(!_0x4b6c75)throw CliErrors[_0x647638(0x209)]('Runtime\x20Skill\x20package\x20is\x20missing\x20'+SKILL_FILE+':\x20'+_0x153293);const _0x46f45d=withMaterializedSkillFrontmatter(_0x2d37f8,_0x2cfb8b,_0x153293),_0x457596=_0x46f45d['find'](_0x5abe86=>_0x5abe86['path']===SKILL_FILE),_0x27aa33=fileText(_0x457596),_0x13232e=getRuntimeSkillDir(_0xbb994c['env'],_0xbb994c[_0x647638(0x211)],_0xbb994c[_0x647638(0x212)],_0x1da3b2,_0x153293,_0xbb994c[_0x647638(0x1db)]),_0x20b193=resolve(_0x13232e,SKILL_FILE),_0x5d5ef6=resolve(_0x13232e,METADATA_FILE),_0x19683b=contentHash(_0x27aa33),_0xf2c14e=readMetadataIfPresent(_0x5d5ef6)?.[_0x647638(0x206)];ensurePulledFilesCanBeOverwritten(_0x13232e,_0x5d5ef6,_0x46f45d,_0xbb994c[_0x647638(0x1d8)]===!![]),mkdirSync(_0x13232e,{'recursive':!![],'mode':0x1c0});const _0x13749d=existsSync(_0x20b193)?readFileSync(_0x20b193,_0x647638(0x20c)):undefined;return materializeFiles(_0x13232e,_0x46f45d),removeStaleManagedFiles(_0x13232e,_0xf2c14e,_0x46f45d),writeJsonAtomic(_0x5d5ef6,buildMetadata(_0x2cfb8b,_0x1da3b2,_0xbb994c[_0x647638(0x212)],_0x19683b,_0xbb994c[_0x647638(0x1e6)],_0x46f45d,_0x11e69f)),{'skill':_0x2cfb8b,'scope':_0x1da3b2,'dir':_0x13232e,'skillMdPath':_0x20b193,'metadataPath':_0x5d5ef6,'contentHash':_0x19683b,'changed':_0x13749d!==_0x27aa33};}export function reuseMaterializedRuntimeSkill(_0x26e7ab,_0x289097,_0x3b8479){const _0x442b58=a157_0x55d5,_0xb30fb1=_0x26e7ab['version']?.[_0x442b58(0x207)]();if(!_0xb30fb1)return undefined;const _0x3784cb=requireSkillCode(_0x26e7ab),_0x2a4c70=getRuntimeSkillDir(_0x3b8479[_0x442b58(0x1df)],_0x3b8479[_0x442b58(0x211)],_0x3b8479[_0x442b58(0x212)],_0x289097,_0x3784cb,_0x3b8479[_0x442b58(0x1db)]),_0x2cd646=resolve(_0x2a4c70,SKILL_FILE),_0x438c9b=resolve(_0x2a4c70,METADATA_FILE),_0x3eed39=readMetadataIfPresent(_0x438c9b);if(!_0x3eed39||_0x3eed39[_0x442b58(0x1fa)]!==0x2||_0x3eed39[_0x442b58(0x212)]!==_0x3b8479['appCode']||_0x3eed39[_0x442b58(0x1d7)]!==_0x289097||_0x3eed39[_0x442b58(0x201)]!==_0x3784cb||_0x3eed39[_0x442b58(0x1f6)]!==_0xb30fb1||_0x3eed39['id']!==_0x26e7ab['id']||_0x3eed39['skillName']!==_0x26e7ab['skillName']||_0x3eed39[_0x442b58(0x1e8)]!==_0x26e7ab[_0x442b58(0x1e8)]||_0x3eed39['example']!==_0x26e7ab[_0x442b58(0x1e4)]||_0x3eed39[_0x442b58(0x200)]!==_0x26e7ab[_0x442b58(0x200)]||!_0x3eed39['contentHash']||!_0x3eed39[_0x442b58(0x206)]||!Object['hasOwn'](_0x3eed39[_0x442b58(0x206)],SKILL_FILE))return undefined;for(const [_0x3c6bf5,_0x228a16]of Object['entries'](_0x3eed39['fileHashes'])){if(!/^[a-f0-9]{64}$/['test'](_0x228a16))return undefined;const _0x5b85b5=resolveManagedFilePath(_0x2a4c70,_0x3c6bf5);if(!existsSync(_0x5b85b5)||!lstatSync(_0x5b85b5)[_0x442b58(0x1dc)]())return undefined;if(bufferSha256(readFileSync(_0x5b85b5))!==_0x228a16)return undefined;}return{'skill':_0x26e7ab,'scope':_0x289097,'dir':_0x2a4c70,'skillMdPath':_0x2cd646,'metadataPath':_0x438c9b,'contentHash':_0x3eed39[_0x442b58(0x1e0)],'changed':![]};}function withMaterializedSkillFrontmatter(_0x3d483e,_0x85a306,_0x323c44){const _0x160a93=a157_0x55d5,_0x1ee79f=skillDisplayName(_0x85a306,_0x323c44),_0x130535=_0x85a306['description']?.[_0x160a93(0x207)]()||_0x1ee79f||_0x323c44;return normalizeLocalFiles(_0x3d483e)[_0x160a93(0x1e3)](_0x2169f9=>{const _0x31ecf5=_0x160a93,_0x5b925d=fileText(_0x2169f9);if(_0x2169f9['path']!==SKILL_FILE)return _0x2169f9;if(hasYamlFrontmatter(_0x5b925d))return{'path':_0x2169f9[_0x31ecf5(0x1f4)],'content':withSyncedDisplayName(_0x5b925d,_0x1ee79f)};return{'path':_0x2169f9[_0x31ecf5(0x1f4)],'content':prependSkillFrontmatter(_0x5b925d,{'name':_0x323c44,'displayName':_0x1ee79f,'description':_0x130535})};});}function hasYamlFrontmatter(_0x543674){const _0x438bdf=a157_0x55d5;return/^\uFEFF?---\s*\r?\n/[_0x438bdf(0x1f7)](_0x543674);}function prependSkillFrontmatter(_0x4def24,_0x3acf44){const _0x382fd7=a157_0x55d5,_0x1d4dc7=_0x4def24[_0x382fd7(0x213)](/^\uFEFF/,'');return[_0x382fd7(0x1fc),_0x382fd7(0x1f3)+yamlString(_0x3acf44['name']),_0x3acf44[_0x382fd7(0x1fb)]?'displayName:\x20'+yamlString(_0x3acf44[_0x382fd7(0x1fb)]):undefined,_0x382fd7(0x1dd)+yamlString(_0x3acf44[_0x382fd7(0x1e8)]),'---','',_0x1d4dc7][_0x382fd7(0x1e2)](_0x36cf35=>_0x36cf35!==undefined)[_0x382fd7(0x1f0)]('\x0a');}function yamlString(_0x219da1){const _0x33af1d=a157_0x55d5;return JSON[_0x33af1d(0x202)](_0x219da1[_0x33af1d(0x213)](/\r/g,'')[_0x33af1d(0x207)]());}function skillDisplayName(_0x23d641,_0x3074c1){const _0x4c9f5b=a157_0x55d5,_0x40c37e=_0x23d641['skillName']?.[_0x4c9f5b(0x207)]();return _0x40c37e||_0x3074c1;}function withSyncedDisplayName(_0x308a84,_0x43574f){const _0x4dd9ec=a157_0x55d5,_0x138532=_0x308a84[_0x4dd9ec(0x20e)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x138532)return _0x308a84;const _0x31b4a5=_0x138532[0x1]??'',_0x532d3f=_0x138532[0x2]??'',_0x3a4a25=parseDocument(_0x532d3f);if(_0x3a4a25['errors'][_0x4dd9ec(0x1e9)]>0x0||!isMap(_0x3a4a25['contents']))return _0x308a84;if(_0x43574f)_0x3a4a25[_0x4dd9ec(0x204)](_0x4dd9ec(0x1fb),_0x43574f);else{if(_0x3a4a25[_0x4dd9ec(0x1f9)](_0x4dd9ec(0x1fb)))_0x3a4a25['delete']('displayName');else return _0x308a84;}forceBlockCollections(_0x3a4a25[_0x4dd9ec(0x1f2)]);const _0x1567c5=_0x3a4a25[_0x4dd9ec(0x1f5)]({'lineWidth':0x0})[_0x4dd9ec(0x1f8)](),_0x2e04f5=_0x308a84['slice'](_0x138532[0x0]['length'])['replace'](/^\r?\n/,'');return _0x31b4a5+_0x4dd9ec(0x1ea)+_0x1567c5+_0x4dd9ec(0x1ef)+_0x2e04f5;}function forceBlockCollections(_0x5161f1){if(!isNode(_0x5161f1))return;visit(_0x5161f1,(_0x32295a,_0x1c6ef6)=>{isCollection(_0x1c6ef6)&&(_0x1c6ef6['flow']=![]);});}function ensurePulledFilesCanBeOverwritten(_0x27d4ef,_0xff8cdb,_0x9d53c9,_0x1d7c03){const _0x72b663=a157_0x55d5;if(_0x1d7c03||!existsSync(_0xff8cdb))return;const _0x4b241d=readMetadataIfPresent(_0xff8cdb);if(!_0x4b241d)return;const _0x26ebfe=_0x4b241d[_0x72b663(0x206)]&&Object[_0x72b663(0x1fd)](_0x4b241d[_0x72b663(0x206)])['length']>0x0?_0x4b241d['fileHashes']:undefined;if(_0x26ebfe)for(const [_0x4e78ce,_0x2e2bc3]of Object[_0x72b663(0x20d)](_0x26ebfe)){const _0x4a5c7c=resolveManagedFilePath(_0x27d4ef,_0x4e78ce);if(!existsSync(_0x4a5c7c))throw CliErrors['validation'](_0x72b663(0x1de)+_0x27d4ef,_0x72b663(0x210)+_0x4e78ce);const _0x5cf45f=lstatSync(_0x4a5c7c);if(!_0x5cf45f[_0x72b663(0x1dc)]())throw CliErrors[_0x72b663(0x209)](_0x72b663(0x1de)+_0x27d4ef,_0x72b663(0x1ff)+_0x4e78ce);const _0x2d1646=bufferSha256(readFileSync(_0x4a5c7c));if(_0x2d1646!==_0x2e2bc3)throw CliErrors[_0x72b663(0x209)](_0x72b663(0x1de)+_0x27d4ef+_0x72b663(0x214)+_0x4e78ce,_0x72b663(0x1eb)+_0x4e78ce);}else{const _0x52a967=resolve(_0x27d4ef,SKILL_FILE);if(existsSync(_0x52a967)&&_0x4b241d[_0x72b663(0x1e0)]){const _0x1e89ce=contentHash(readFileSync(_0x52a967,_0x72b663(0x20c)));if(_0x1e89ce!==_0x4b241d[_0x72b663(0x1e0)])throw CliErrors[_0x72b663(0x209)](_0x72b663(0x1e1)+_0x52a967,_0x72b663(0x20a));}}for(const _0x5a98bd of normalizeLocalFiles(_0x9d53c9)){if(_0x26ebfe?.[_0x5a98bd[_0x72b663(0x1f4)]])continue;if(!_0x26ebfe&&_0x5a98bd['path']===SKILL_FILE)continue;const _0xa96e95=resolveManagedFilePath(_0x27d4ef,_0x5a98bd[_0x72b663(0x1f4)]);if(!existsSync(_0xa96e95))continue;const _0x11503d=lstatSync(_0xa96e95);if(!_0x11503d[_0x72b663(0x1dc)]())throw CliErrors[_0x72b663(0x209)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x27d4ef,'Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20'+_0x5a98bd[_0x72b663(0x1f4)]);const _0x5a5b6a=bufferSha256(readFileSync(_0xa96e95));if(_0x5a5b6a!==fileHash(_0x5a98bd))throw CliErrors['validation'](_0x72b663(0x1de)+_0x27d4ef,'Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20'+_0x5a98bd['path']);}}function materializeFiles(_0x129df9,_0x53a9e1){const _0x4f71a7=a157_0x55d5;for(const _0x498c8e of normalizeLocalFiles(_0x53a9e1)){const _0x5e6aba=resolveManagedFilePath(_0x129df9,_0x498c8e[_0x4f71a7(0x1f4)]);mkdirSync(dirname(_0x5e6aba),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x5e6aba,fileContent(_0x498c8e),0x180);}}function removeStaleManagedFiles(_0x2885da,_0x35e7bd,_0x1aac2f){const _0x4a2b1a=a157_0x55d5;if(!_0x35e7bd)return;const _0x871e4b=new Set(normalizeLocalFiles(_0x1aac2f)[_0x4a2b1a(0x1e3)](_0x299f36=>_0x299f36[_0x4a2b1a(0x1f4)]));for(const _0x1498c6 of Object[_0x4a2b1a(0x1fd)](_0x35e7bd)){if(_0x871e4b['has'](_0x1498c6))continue;const _0x168273=resolveManagedFilePath(_0x2885da,_0x1498c6);existsSync(_0x168273)&&lstatSync(_0x168273)[_0x4a2b1a(0x1dc)]()&&rmSync(_0x168273,{'force':!![]});}}
|
|
1
|
+
(function(_0x2eb982,_0x809d33){const _0x2ff27b=a157_0x46d2,_0x49a2ff=_0x2eb982();while(!![]){try{const _0x348a6d=parseInt(_0x2ff27b(0x94))/0x1*(parseInt(_0x2ff27b(0x8f))/0x2)+-parseInt(_0x2ff27b(0x92))/0x3*(parseInt(_0x2ff27b(0x7f))/0x4)+parseInt(_0x2ff27b(0xa6))/0x5+-parseInt(_0x2ff27b(0x82))/0x6+parseInt(_0x2ff27b(0xba))/0x7*(parseInt(_0x2ff27b(0x7d))/0x8)+parseInt(_0x2ff27b(0xb7))/0x9+parseInt(_0x2ff27b(0xb2))/0xa*(-parseInt(_0x2ff27b(0x97))/0xb);if(_0x348a6d===_0x809d33)break;else _0x49a2ff['push'](_0x49a2ff['shift']());}catch(_0x313fac){_0x49a2ff['push'](_0x49a2ff['shift']());}}}(a157_0x496a,0xeab5f));import{existsSync,lstatSync,mkdirSync,readFileSync,rmSync}from'node:fs';import{dirname,resolve}from'node:path';import{isCollection,isMap,isNode,parseDocument,visit}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{resolveManagedFilePath,writeBytesAtomic,writeJsonAtomic}from'./fs-utils.js';import{bufferSha256,contentHash,fileHash}from'./hashing.js';import{fileContent,fileText,normalizeLocalFiles}from'./local-files.js';import{buildMetadata,readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillDir}from'./paths.js';function a157_0x496a(){const _0x1aaebd=['description','displayName','appCode','4104430GJcRMH','length','utf8','displayName:\x20','path','12018708rkASNf','map','hasOwn','7SMOilN','status','test','filter','14288112NUyByv','schemaVersion','8pggvwf','fileHashes','example','5881884NTFxEg','errors','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','paths','contents','keys','validation','Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20','join','slice','has','entries','Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20','2hfussT','skillName','stringify','2303376wOzTCG','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','1580906adARYS','delete','trimEnd','55rjvWtf','---','packageBytes','find','version','match','Runtime\x20Skill\x20package\x20is\x20missing\x20','contentHash','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.','scope','replace','accessKey','skillCode','trim','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','4135780cjFcGI','force','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','set','.\x20Changed\x20file:\x20','isFile','flow','env','pulledAt'];a157_0x496a=function(){return _0x1aaebd;};return a157_0x496a();}import{extractDownloadedPackage,requirePackageBytes}from'./zip-package.js';export function materializeRuntimeSkill(_0x1ceca4,_0x498ba3,_0x291092){const _0xfda5db=a157_0x46d2,_0x336711=requireSkillCode(_0x1ceca4),_0x5f07c6=requirePackageBytes(_0x336711,_0x291092[_0xfda5db(0x99)]),_0x210db4=extractDownloadedPackage(_0x5f07c6),_0x31dba0=_0x210db4[_0xfda5db(0x9a)](_0x43e023=>_0x43e023[_0xfda5db(0xb6)]===SKILL_FILE);if(!_0x31dba0)throw CliErrors[_0xfda5db(0x88)](_0xfda5db(0x9d)+SKILL_FILE+':\x20'+_0x336711);const _0x108be4=withMaterializedSkillFrontmatter(_0x210db4,_0x1ceca4,_0x336711),_0x2b711c=_0x108be4[_0xfda5db(0x9a)](_0x1fb34c=>_0x1fb34c[_0xfda5db(0xb6)]===SKILL_FILE),_0x388ec3=fileText(_0x2b711c),_0xf97290=getRuntimeSkillDir(_0x291092['env'],_0x291092[_0xfda5db(0xa2)],_0x291092['appCode'],_0x498ba3,_0x336711,_0x291092[_0xfda5db(0x85)]),_0x139b35=resolve(_0xf97290,SKILL_FILE),_0x244f38=resolve(_0xf97290,METADATA_FILE),_0x291965=contentHash(_0x388ec3),_0x23acbe=readMetadataIfPresent(_0x244f38)?.[_0xfda5db(0x80)];ensurePulledFilesCanBeOverwritten(_0xf97290,_0x244f38,_0x108be4,_0x291092[_0xfda5db(0xa7)]===!![]),mkdirSync(_0xf97290,{'recursive':!![],'mode':0x1c0});const _0x5b2170=existsSync(_0x139b35)?readFileSync(_0x139b35,'utf8'):undefined;return materializeFiles(_0xf97290,_0x108be4),removeStaleManagedFiles(_0xf97290,_0x23acbe,_0x108be4),writeJsonAtomic(_0x244f38,buildMetadata(_0x1ceca4,_0x498ba3,_0x291092[_0xfda5db(0xb1)],_0x291965,_0x291092[_0xfda5db(0xae)],_0x108be4,_0x5f07c6)),{'skill':_0x1ceca4,'scope':_0x498ba3,'dir':_0xf97290,'skillMdPath':_0x139b35,'metadataPath':_0x244f38,'contentHash':_0x291965,'changed':_0x5b2170!==_0x388ec3};}export function reuseMaterializedRuntimeSkill(_0x217eb2,_0x21f98e,_0x3e38f8){const _0x137192=a157_0x46d2,_0x4998ae=_0x217eb2[_0x137192(0x9b)]?.['trim']();if(!_0x4998ae)return undefined;const _0x18fec4=requireSkillCode(_0x217eb2),_0x116588=getRuntimeSkillDir(_0x3e38f8[_0x137192(0xad)],_0x3e38f8['accessKey'],_0x3e38f8['appCode'],_0x21f98e,_0x18fec4,_0x3e38f8[_0x137192(0x85)]),_0x596062=resolve(_0x116588,SKILL_FILE),_0x5f2fd3=resolve(_0x116588,METADATA_FILE),_0x391cae=readMetadataIfPresent(_0x5f2fd3);if(!_0x391cae||_0x391cae[_0x137192(0x7e)]!==0x2||_0x391cae[_0x137192(0xb1)]!==_0x3e38f8[_0x137192(0xb1)]||_0x391cae[_0x137192(0xa0)]!==_0x21f98e||_0x391cae[_0x137192(0xa3)]!==_0x18fec4||_0x391cae['version']!==_0x4998ae||_0x391cae['id']!==_0x217eb2['id']||_0x391cae[_0x137192(0x90)]!==_0x217eb2[_0x137192(0x90)]||_0x391cae[_0x137192(0xaf)]!==_0x217eb2[_0x137192(0xaf)]||_0x391cae['example']!==_0x217eb2[_0x137192(0x81)]||_0x391cae[_0x137192(0x7a)]!==_0x217eb2['status']||!_0x391cae[_0x137192(0x9e)]||!_0x391cae[_0x137192(0x80)]||!Object[_0x137192(0xb9)](_0x391cae[_0x137192(0x80)],SKILL_FILE))return undefined;for(const [_0xd15573,_0xd89a96]of Object[_0x137192(0x8d)](_0x391cae[_0x137192(0x80)])){if(!/^[a-f0-9]{64}$/[_0x137192(0x7b)](_0xd89a96))return undefined;const _0x8a6b76=resolveManagedFilePath(_0x116588,_0xd15573);if(!existsSync(_0x8a6b76)||!lstatSync(_0x8a6b76)[_0x137192(0xab)]())return undefined;if(bufferSha256(readFileSync(_0x8a6b76))!==_0xd89a96)return undefined;}return{'skill':_0x217eb2,'scope':_0x21f98e,'dir':_0x116588,'skillMdPath':_0x596062,'metadataPath':_0x5f2fd3,'contentHash':_0x391cae[_0x137192(0x9e)],'changed':![]};}function withMaterializedSkillFrontmatter(_0x54901e,_0x484e90,_0x51680c){const _0x15f2b7=a157_0x46d2,_0x48c81c=skillDisplayName(_0x484e90,_0x51680c),_0x5c2c75=_0x484e90[_0x15f2b7(0xaf)]?.[_0x15f2b7(0xa4)]()||_0x48c81c||_0x51680c;return normalizeLocalFiles(_0x54901e)['map'](_0x53e8c4=>{const _0x1422df=_0x15f2b7,_0x5eb9bf=fileText(_0x53e8c4);if(_0x53e8c4[_0x1422df(0xb6)]!==SKILL_FILE)return _0x53e8c4;if(hasYamlFrontmatter(_0x5eb9bf))return{'path':_0x53e8c4[_0x1422df(0xb6)],'content':withSyncedDisplayName(_0x5eb9bf,_0x48c81c)};return{'path':_0x53e8c4[_0x1422df(0xb6)],'content':prependSkillFrontmatter(_0x5eb9bf,{'name':_0x51680c,'displayName':_0x48c81c,'description':_0x5c2c75})};});}function hasYamlFrontmatter(_0x408b09){const _0x56becd=a157_0x46d2;return/^\uFEFF?---\s*\r?\n/[_0x56becd(0x7b)](_0x408b09);}function prependSkillFrontmatter(_0x82bea,_0x1c2763){const _0x5062da=a157_0x46d2,_0x56349f=_0x82bea[_0x5062da(0xa1)](/^\uFEFF/,'');return[_0x5062da(0x98),'name:\x20'+yamlString(_0x1c2763['name']),_0x1c2763['displayName']?_0x5062da(0xb5)+yamlString(_0x1c2763[_0x5062da(0xb0)]):undefined,'description:\x20'+yamlString(_0x1c2763['description']),_0x5062da(0x98),'',_0x56349f][_0x5062da(0x7c)](_0x14cb4b=>_0x14cb4b!==undefined)[_0x5062da(0x8a)]('\x0a');}function yamlString(_0x29a80a){const _0x316a4d=a157_0x46d2;return JSON[_0x316a4d(0x91)](_0x29a80a[_0x316a4d(0xa1)](/\r/g,'')[_0x316a4d(0xa4)]());}function skillDisplayName(_0x533d4c,_0x74c2db){const _0x14cd77=a157_0x46d2,_0x83678b=_0x533d4c[_0x14cd77(0x90)]?.['trim']();return _0x83678b||_0x74c2db;}function a157_0x46d2(_0x579299,_0x485f0d){_0x579299=_0x579299-0x7a;const _0x496a8c=a157_0x496a();let _0x46d2ca=_0x496a8c[_0x579299];return _0x46d2ca;}function withSyncedDisplayName(_0x34dc6e,_0x400287){const _0x4b56bd=a157_0x46d2,_0x5d173f=_0x34dc6e[_0x4b56bd(0x9c)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x5d173f)return _0x34dc6e;const _0x48ba64=_0x5d173f[0x1]??'',_0x43c0be=_0x5d173f[0x2]??'',_0x39d4c4=parseDocument(_0x43c0be);if(_0x39d4c4[_0x4b56bd(0x83)][_0x4b56bd(0xb3)]>0x0||!isMap(_0x39d4c4[_0x4b56bd(0x86)]))return _0x34dc6e;if(_0x400287)_0x39d4c4[_0x4b56bd(0xa9)](_0x4b56bd(0xb0),_0x400287);else{if(_0x39d4c4[_0x4b56bd(0x8c)](_0x4b56bd(0xb0)))_0x39d4c4[_0x4b56bd(0x95)](_0x4b56bd(0xb0));else return _0x34dc6e;}forceBlockCollections(_0x39d4c4['contents']);const _0x3314d4=_0x39d4c4['toString']({'lineWidth':0x0})[_0x4b56bd(0x96)](),_0x4e0e30=_0x34dc6e[_0x4b56bd(0x8b)](_0x5d173f[0x0][_0x4b56bd(0xb3)])['replace'](/^\r?\n/,'');return _0x48ba64+'---\x0a'+_0x3314d4+'\x0a---\x0a\x0a'+_0x4e0e30;}function forceBlockCollections(_0x16002f){if(!isNode(_0x16002f))return;visit(_0x16002f,(_0x4ad7af,_0x378b70)=>{const _0x322b8b=a157_0x46d2;isCollection(_0x378b70)&&(_0x378b70[_0x322b8b(0xac)]=![]);});}function ensurePulledFilesCanBeOverwritten(_0x1bd0a0,_0x3090b8,_0x41001f,_0xab5b69){const _0x3e709c=a157_0x46d2;if(_0xab5b69||!existsSync(_0x3090b8))return;const _0x1f2c6d=readMetadataIfPresent(_0x3090b8);if(!_0x1f2c6d)return;const _0x22a109=_0x1f2c6d[_0x3e709c(0x80)]&&Object[_0x3e709c(0x87)](_0x1f2c6d['fileHashes'])[_0x3e709c(0xb3)]>0x0?_0x1f2c6d[_0x3e709c(0x80)]:undefined;if(_0x22a109)for(const [_0x33a71d,_0x2ea7f4]of Object['entries'](_0x22a109)){const _0x96a12f=resolveManagedFilePath(_0x1bd0a0,_0x33a71d);if(!existsSync(_0x96a12f))throw CliErrors[_0x3e709c(0x88)](_0x3e709c(0xa8)+_0x1bd0a0,'Managed\x20file\x20was\x20removed\x20locally:\x20'+_0x33a71d);const _0x240972=lstatSync(_0x96a12f);if(!_0x240972['isFile']())throw CliErrors['validation'](_0x3e709c(0xa8)+_0x1bd0a0,_0x3e709c(0x89)+_0x33a71d);const _0x405e65=bufferSha256(readFileSync(_0x96a12f));if(_0x405e65!==_0x2ea7f4)throw CliErrors['validation'](_0x3e709c(0xa8)+_0x1bd0a0+_0x3e709c(0xaa)+_0x33a71d,_0x3e709c(0x84)+_0x33a71d);}else{const _0x3c65b9=resolve(_0x1bd0a0,SKILL_FILE);if(existsSync(_0x3c65b9)&&_0x1f2c6d[_0x3e709c(0x9e)]){const _0xd1bfb9=contentHash(readFileSync(_0x3c65b9,_0x3e709c(0xb4)));if(_0xd1bfb9!==_0x1f2c6d['contentHash'])throw CliErrors[_0x3e709c(0x88)](_0x3e709c(0xa5)+_0x3c65b9,_0x3e709c(0x9f));}}for(const _0x4fbd81 of normalizeLocalFiles(_0x41001f)){if(_0x22a109?.[_0x4fbd81[_0x3e709c(0xb6)]])continue;if(!_0x22a109&&_0x4fbd81[_0x3e709c(0xb6)]===SKILL_FILE)continue;const _0x3bd51c=resolveManagedFilePath(_0x1bd0a0,_0x4fbd81[_0x3e709c(0xb6)]);if(!existsSync(_0x3bd51c))continue;const _0x2dd17d=lstatSync(_0x3bd51c);if(!_0x2dd17d['isFile']())throw CliErrors[_0x3e709c(0x88)](_0x3e709c(0xa8)+_0x1bd0a0,_0x3e709c(0x93)+_0x4fbd81[_0x3e709c(0xb6)]);const _0x572087=bufferSha256(readFileSync(_0x3bd51c));if(_0x572087!==fileHash(_0x4fbd81))throw CliErrors[_0x3e709c(0x88)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x1bd0a0,_0x3e709c(0x8e)+_0x4fbd81[_0x3e709c(0xb6)]);}}function materializeFiles(_0x1e0343,_0x4bf14f){for(const _0x216821 of normalizeLocalFiles(_0x4bf14f)){const _0x2c0a17=resolveManagedFilePath(_0x1e0343,_0x216821['path']);mkdirSync(dirname(_0x2c0a17),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x2c0a17,fileContent(_0x216821),0x180);}}function removeStaleManagedFiles(_0x259c9c,_0xebf69a,_0x5176b9){const _0x567ac3=a157_0x46d2;if(!_0xebf69a)return;const _0x23eef6=new Set(normalizeLocalFiles(_0x5176b9)[_0x567ac3(0xb8)](_0x326b1e=>_0x326b1e['path']));for(const _0x2b4aef of Object['keys'](_0xebf69a)){if(_0x23eef6[_0x567ac3(0x8c)](_0x2b4aef))continue;const _0x26bb00=resolveManagedFilePath(_0x259c9c,_0x2b4aef);existsSync(_0x26bb00)&&lstatSync(_0x26bb00)['isFile']()&&rmSync(_0x26bb00,{'force':!![]});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x7a9dfd,_0x13fb8b){const _0x2d8a3b=a158_0x2bcf,_0x524acf=_0x7a9dfd();while(!![]){try{const _0x11905d=-parseInt(_0x2d8a3b(0xe6))/0x1+-parseInt(_0x2d8a3b(0xe3))/0x2+-parseInt(_0x2d8a3b(0xd7))/0x3*(-parseInt(_0x2d8a3b(0xda))/0x4)+-parseInt(_0x2d8a3b(0xde))/0x5+-parseInt(_0x2d8a3b(0xd1))/0x6*(parseInt(_0x2d8a3b(0xc8))/0x7)+parseInt(_0x2d8a3b(0xcd))/0x8+-parseInt(_0x2d8a3b(0xe2))/0x9*(-parseInt(_0x2d8a3b(0xcc))/0xa);if(_0x11905d===_0x13fb8b)break;else _0x524acf['push'](_0x524acf['shift']());}catch(_0x40358a){_0x524acf['push'](_0x524acf['shift']());}}}(a158_0x33f5,0x6badb));function a158_0x33f5(){const _0x3be897=['userId','description','example','Runtime\x20Skill\x20is\x20missing\x20skillCode.','validation','314970TXxBkV','personal','fromEntries','32YyAvia','zipSha256','manifest','length','26550CAAKWf','forkedFromSkillId','forkedFromVersion','tags','297ZvTKBh','808560jNvsPu','trim','zipSize','733105selmDC','files','hasUpstreamUpdate','readonly','ossPath','string','Invalid\x20','674303YdEdkC','skillCode','map','version','174170mIpBwV','6746944fiQbbY','sourceSessionId','isArray','path','42DuPRBc'];a158_0x33f5=function(){return _0x3be897;};return a158_0x33f5();}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';function a158_0x2bcf(_0x4cebf2,_0x655858){_0x4cebf2=_0x4cebf2-0xc2;const _0x33f591=a158_0x33f5();let _0x2bcf1c=_0x33f591[_0x4cebf2];return _0x2bcf1c;}export function buildMetadata(_0x2be0dc,_0x262b0d,_0x2715e1,_0x3d5c91,_0x417cb5,_0x654d36,_0x128047){const _0x683fc6=a158_0x2bcf,_0x56006f=_0x654d36?normalizeLocalFiles(_0x654d36):[],_0x331b02=!_0x128047&&_0x56006f[_0x683fc6(0xdd)]>0x0?buildSkillPackage(_0x56006f):undefined,_0x156fd8=_0x128047?bufferSha256(_0x128047):_0x331b02?.[_0x683fc6(0xdc)][_0x683fc6(0xdb)],_0x29a9eb=_0x128047?.[_0x683fc6(0xdd)]??_0x331b02?.[_0x683fc6(0xdc)][_0x683fc6(0xe5)],_0x4dd054=_0x56006f['length']>0x0?Object[_0x683fc6(0xd9)](_0x56006f[_0x683fc6(0xca)](_0x57cb33=>[_0x57cb33[_0x683fc6(0xd0)],fileHash(_0x57cb33)])):undefined;return{'schemaVersion':_0x56006f[_0x683fc6(0xdd)]>0x0?0x2:0x1,'id':_0x2be0dc['id'],'appCode':_0x2715e1,'skillCode':requireSkillCode(_0x2be0dc),'skillName':_0x2be0dc['skillName'],'description':_0x2be0dc[_0x683fc6(0xd3)],'example':_0x2be0dc[_0x683fc6(0xd4)],'scope':_0x262b0d,'readonly':_0x262b0d!==_0x683fc6(0xd8)||_0x2be0dc[_0x683fc6(0xc4)]===!![],'tenantCode':_0x2be0dc['tenantCode'],'userId':_0x2be0dc[_0x683fc6(0xd2)],'version':_0x2be0dc[_0x683fc6(0xcb)],'status':_0x2be0dc['status'],'tags':Array[_0x683fc6(0xcf)](_0x2be0dc['tags'])?_0x2be0dc[_0x683fc6(0xe1)]:[],'hasUpstreamUpdate':_0x2be0dc[_0x683fc6(0xc3)],'forkedFromSkillId':_0x2be0dc[_0x683fc6(0xdf)],'forkedFromVersion':_0x2be0dc[_0x683fc6(0xe0)],'sourceSessionId':_0x2be0dc[_0x683fc6(0xce)],'contentHash':_0x3d5c91,'fileHashes':_0x4dd054,'treeHash':_0x56006f[_0x683fc6(0xdd)]>0x0?fileTreeHash(localFilesToManifestFiles(_0x56006f)):undefined,'ossPath':remoteManifestOssPath(_0x2be0dc[_0x683fc6(0xc2)]),'zipSha256':_0x156fd8,'zipSize':_0x29a9eb,'files':_0x56006f['length']>0x0?_0x56006f[_0x683fc6(0xca)](_0x41f243=>({'path':_0x41f243[_0x683fc6(0xd0)],'hash':fileHash(_0x41f243),'size':fileContent(_0x41f243)[_0x683fc6(0xdd)]})):undefined,'pulledAt':_0x417cb5??new Date()['toISOString']()};}export function requireSkillCode(_0x2450f7){const _0x26293d=a158_0x2bcf,_0x53da5d=_0x2450f7[_0x26293d(0xc9)]?.[_0x26293d(0xe4)]();if(!_0x53da5d)throw CliErrors[_0x26293d(0xd6)](_0x26293d(0xd5));return _0x53da5d;}export function readMetadataIfPresent(_0x24624c){const _0x5cded0=a158_0x2bcf;if(!existsSync(_0x24624c))return undefined;try{const _0x270da1=JSON['parse'](readFileSync(_0x24624c,'utf8'));return _0x270da1;}catch{throw CliErrors[_0x5cded0(0xd6)](_0x5cded0(0xc7)+METADATA_FILE+':\x20'+_0x24624c);}}function remoteManifestOssPath(_0x1c8f26){const _0x52cede=a158_0x2bcf;if(!_0x1c8f26||typeof _0x1c8f26!=='object'||Array['isArray'](_0x1c8f26))return undefined;const _0x207840=_0x1c8f26[_0x52cede(0xc5)];return typeof _0x207840===_0x52cede(0xc6)&&_0x207840[_0x52cede(0xe4)]()?_0x207840[_0x52cede(0xe4)]():undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a159_0x4b44f0=a159_0x4818;(function(_0x3f6d20,_0xc5e629){const _0x58c660=a159_0x4818,_0x30ac13=_0x3f6d20();while(!![]){try{const _0x27e4b8=parseInt(_0x58c660(0x179))/0x1+-parseInt(_0x58c660(0x17d))/0x2+parseInt(_0x58c660(0x16e))/0x3*(-parseInt(_0x58c660(0x17c))/0x4)+parseInt(_0x58c660(0x172))/0x5+parseInt(_0x58c660(0x177))/0x6+-parseInt(_0x58c660(0x16f))/0x7+parseInt(_0x58c660(0x17e))/0x8*(parseInt(_0x58c660(0x168))/0x9);if(_0x27e4b8===_0xc5e629)break;else _0x30ac13['push'](_0x30ac13['shift']());}catch(_0xbd561b){_0x30ac13['push'](_0x30ac13['shift']());}}}(a159_0x4208,0x470e7));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(_0x5c701c={}){const _0x49386c=a159_0x4818,_0x26868c=_0x5c701c['homeDir']??homedir(),_0xe5fda7=resolve(_0x26868c,PRODUCT_CONFIG[_0x49386c(0x16a)],_0x49386c(0x171)),_0x380726=trimmedEnv('SKILL_ROOT'),_0x4f6d35=trimmedEnv('CLAUDE_SKILL_ROOT'),_0x1fee3e=resolve(_0x26868c,'.workbuddy'),_0x162c3d=_0x5c701c[_0x49386c(0x16b)]??(existsSync(_0x1fee3e)?resolve(_0x1fee3e,_0x49386c(0x169)):undefined);return{'homeDir':_0x26868c,'cacheRoot':_0xe5fda7,'managedRoot':resolve(_0x26868c,PRODUCT_CONFIG[_0x49386c(0x16a)]),'agentsSkillsDir':_0x5c701c[_0x49386c(0x173)]??_0x380726??resolve(_0x26868c,_0x49386c(0x17a),_0x49386c(0x169)),'claudeSkillsDir':_0x5c701c[_0x49386c(0x167)]??_0x4f6d35??resolve(_0x26868c,'.claude','skills'),'workbuddySkillsDir':_0x162c3d};}function a159_0x4818(_0x3fede3,_0x505fa7){_0x3fede3=_0x3fede3-0x167;const _0x4208b8=a159_0x4208();let _0x4818c7=_0x4208b8[_0x3fede3];return _0x4818c7;}function a159_0x4208(){const _0x367920=['2005720vTTHAY','agentsSkillsDir','validation','appCode','includes','2130198wOwsRb','path\x20segment','162967HcYJKU','.agents','skillCode','4CwwafL','234808YPKRDu','681872qWxgWQ','\x20for\x20local\x20path:\x20','cacheRoot','claudeSkillsDir','9kkmsTt','skills','homeDirName','workbuddySkillsDir','Unsafe\x20','filter','754920GiHOuf','2410009NCYypH','trim','cache'];a159_0x4208=function(){return _0x367920;};return a159_0x4208();}export function runtimeAgentSkillRoots(_0x33547c){const _0x106a56=a159_0x4818;return[_0x33547c[_0x106a56(0x173)],_0x33547c[_0x106a56(0x167)],_0x33547c[_0x106a56(0x16b)]][_0x106a56(0x16d)](_0x5e0008=>Boolean(_0x5e0008));}export function getRuntimeSkillCacheRoot(_0x33bac5,_0x4fc9c6,_0x6011ad={}){const _0x359095=a159_0x4818,_0x2a339a=resolveSkillSyncPaths(_0x6011ad);return resolve(_0x2a339a[_0x359095(0x180)],_0x33bac5,fingerprintAccessKey(_0x4fc9c6),'skills');}export function getRuntimeSkillDir(_0x1546f5,_0x2cd031,_0x3ccad7,_0x4a5fb5,_0x59a8fb,_0x49a67d={}){const _0x39278e=a159_0x4818;return resolve(getRuntimeSkillCacheRoot(_0x1546f5,_0x2cd031,_0x49a67d),safePathSegment(_0x3ccad7,_0x39278e(0x175)),_0x4a5fb5,safePathSegment(_0x59a8fb,_0x39278e(0x17b)));}export function safePathSegment(_0x2d770b,_0xcc9156=a159_0x4b44f0(0x178)){const _0x278b1e=a159_0x4b44f0;if(!_0x2d770b||_0x2d770b[_0x278b1e(0x176)]('/')||_0x2d770b[_0x278b1e(0x176)]('\x5c')||_0x2d770b[_0x278b1e(0x176)]('..'))throw CliErrors[_0x278b1e(0x174)](_0x278b1e(0x16c)+_0xcc9156+_0x278b1e(0x17f)+_0x2d770b);return _0x2d770b;}function trimmedEnv(_0x302f06){const _0x5e9a53=a159_0x4b44f0,_0x20fc10=productEnv(_0x302f06)?.[_0x5e9a53(0x170)]();return _0x20fc10?_0x20fc10:undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0xefc03a,_0x1dc62f){const _0x3ba6e9=a160_0x1f5e,_0xf6c114=_0xefc03a();while(!![]){try{const _0x13c86e=parseInt(_0x3ba6e9(0xbf))/0x1+-parseInt(_0x3ba6e9(0xbc))/0x2+parseInt(_0x3ba6e9(0xa7))/0x3*(parseInt(_0x3ba6e9(0xa0))/0x4)+parseInt(_0x3ba6e9(0xa3))/0x5+-parseInt(_0x3ba6e9(0xca))/0x6+-parseInt(_0x3ba6e9(0x9e))/0x7*(-parseInt(_0x3ba6e9(0xa6))/0x8)+parseInt(_0x3ba6e9(0xb5))/0x9*(parseInt(_0x3ba6e9(0xc9))/0xa);if(_0x13c86e===_0x1dc62f)break;else _0xf6c114['push'](_0xf6c114['shift']());}catch(_0x4a5a54){_0xf6c114['push'](_0xf6c114['shift']());}}}(a160_0x2fc7,0x5a6b5));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';function a160_0x2fc7(){const _0x3a31da=['tags','filter','builtin','content','Invalid\x20','pushedAt','Skill\x20directory\x20not\x20found:\x20','trim','unknown','205299aryQXK','boolean','ignoreInvalidMetadata','isDirectory','packageBase64','allowAppCodeRetarget','Remote\x20Skill\x20','217068PkRAlz','path','skillCode','136018MVyQZf','example','files','startsWith','match','utf8','Skill\x20metadata\x20appCode\x20\x22','metadata','manifest','displayName','10NzghvJ','2852412aQhZwc','Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20','ignoreMetadataAppCodeMismatch','ignoreMetadataSkillCode','validation','\x20has\x20unsupported\x20scope\x20\x22','skillName','toLowerCase','length','Missing\x20','personal','sourceSessionId','version','\x20has\x20scope=\x22','find','isSymbolicLink','isFile','company','name','description','slice','70NGPSWg','number','1116xDTuPM','object','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20','3122365aRimdV','replace','isArray','92376UCUsuF','597wJUEzp','Unable\x20to\x20resolve\x20skillCode\x20from\x20','appCode','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20','scope'];a160_0x2fc7=function(){return _0x3a31da;};return a160_0x2fc7();}import{basename,resolve}from'node:path';import{parse as a160_0x159db6}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(_0x40a596,_0x27e9a5,_0x3947d4={}){const _0x1a9398=a160_0x1f5e,_0x14a6f6=resolvePushDirectoryRoot(_0x40a596),_0x3d9d4f=readPushMetadataIfPresent(resolve(_0x14a6f6,METADATA_FILE),{'ignoreInvalidMetadata':_0x3947d4[_0x1a9398(0xb7)]});if(_0x3d9d4f?.[_0x1a9398(0xa9)]&&_0x3d9d4f['appCode']!==_0x27e9a5&&!_0x3947d4[_0x1a9398(0xba)]&&!_0x3947d4[_0x1a9398(0xcc)])throw CliErrors[_0x1a9398(0xce)](_0x1a9398(0xc5)+_0x3d9d4f[_0x1a9398(0xa9)]+'\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22'+_0x27e9a5+'\x22.');const _0x661fb1=resolvePushSkillCode(_0x14a6f6,_0x27e9a5,_0x3d9d4f,_0x3947d4);if(!_0x661fb1)throw CliErrors['validation'](_0x1a9398(0xa8)+SKILL_FILE+',\x20'+METADATA_FILE+',\x20or\x20directory\x20name.');return{'dir':_0x14a6f6,'skillCode':_0x661fb1,'metadata':_0x3d9d4f};}export function readPushDirectory(_0x5a45cc,_0x3c371d,_0x1fbd7a={}){const _0x4aba09=a160_0x1f5e,_0x4089a4=resolvePushDirectoryIdentity(_0x5a45cc,_0x3c371d,_0x1fbd7a),_0x5bb434=_0x4089a4['dir'],_0x74f88f=resolve(_0x5bb434,SKILL_FILE);if(!existsSync(_0x74f88f)||!lstatSync(_0x74f88f)[_0x4aba09(0x99)]())throw CliErrors[_0x4aba09(0xce)](_0x4aba09(0xd3)+SKILL_FILE+':\x20'+_0x74f88f);const _0x5b0d98=_0x4089a4[_0x4aba09(0xc6)],_0x312a67=_0x1fbd7a['targetScope']??_0x4aba09(0xd4);if(!_0x1fbd7a['ignoreMetadataScope']&&_0x5b0d98?.[_0x4aba09(0xab)]===_0x4aba09(0xae))throw CliErrors[_0x4aba09(0xce)](_0x4aba09(0xcb)+METADATA_FILE+_0x4aba09(0xd7)+_0x5b0d98['scope']+'\x22.');if(!_0x1fbd7a['ignoreMetadataScope']&&_0x312a67==='personal'&&_0x5b0d98?.['scope']&&_0x5b0d98[_0x4aba09(0xab)]!==_0x4aba09(0xd4))throw CliErrors[_0x4aba09(0xce)](_0x4aba09(0xa2)+METADATA_FILE+_0x4aba09(0xd7)+_0x5b0d98[_0x4aba09(0xab)]+'\x22.',_0x4aba09(0xaa)+_0x5bb434+'\x20to\x20submit\x20company\x20Skills\x20for\x20review.');const _0x2d62ec=scanSkillDirectory(_0x5bb434,{'excludedFilePaths':_0x1fbd7a['excludedFilePaths']}),_0x3e36d4=buildSkillPackage(_0x2d62ec),_0x53f456=readFileSync(_0x74f88f,_0x4aba09(0xc4)),_0x5914e4=_0x4089a4['skillCode'],_0x440f86=_0x1fbd7a['ignoreMetadataForPayload']?undefined:_0x5b0d98,_0x9ae4cc=readSkillDisplayName(_0x53f456);return{'skillCode':_0x5914e4,'metadata':_0x5b0d98,'frontmatterDisplayName':_0x9ae4cc,'input':{'skillCode':_0x5914e4,'skillName':_0x9ae4cc??_0x440f86?.[_0x4aba09(0xd0)],'description':_0x440f86?.['description'],'content':_0x53f456,'files':_0x3e36d4[_0x4aba09(0xc7)],'packageBase64':_0x3e36d4[_0x4aba09(0xb9)],'tags':_0x440f86?.[_0x4aba09(0xac)],'version':_0x440f86?.[_0x4aba09(0xd6)],'sourceSessionId':_0x440f86?.[_0x4aba09(0xd5)]}};}export function refreshPushDirectoryMetadataFromRemote(_0xc9d13d,_0x4029db,_0x1ec758,_0x45c04f={}){const _0x4f6e6c=a160_0x1f5e,_0x5bd01f=resolvePushDirectoryRoot(_0xc9d13d),_0x94e275=readPushMetadataIfPresent(resolve(_0x5bd01f,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x13daab=requireRemoteScope(_0x4029db),_0x59c72f=readLocalSkillContent(_0x5bd01f),_0xdde965={..._0x4029db,'appCode':_0x4029db[_0x4f6e6c(0xa9)]??_0x1ec758,'skillName':_0x4029db[_0x4f6e6c(0xd0)]??_0x94e275?.[_0x4f6e6c(0xd0)],'description':_0x4029db['description']??_0x94e275?.[_0x4f6e6c(0x9c)],'example':_0x4029db[_0x4f6e6c(0xc0)]??_0x94e275?.[_0x4f6e6c(0xc0)],'tags':Array[_0x4f6e6c(0xa5)](_0x4029db['tags'])?_0x4029db[_0x4f6e6c(0xac)]:_0x94e275?.[_0x4f6e6c(0xac)],'sourceSessionId':_0x4029db[_0x4f6e6c(0xd5)]??_0x94e275?.[_0x4f6e6c(0xd5)],'content':_0x4029db[_0x4f6e6c(0xaf)]??_0x59c72f},_0x3bb449=buildMetadata(_0xdde965,_0x13daab,_0x1ec758,contentHash(_0x59c72f),_0x45c04f['refreshedAt']);writeJsonAtomic(resolve(_0x5bd01f,METADATA_FILE),_0x3bb449);}export function recordPushedRuntimeSkill(_0xb2c13c,_0xf32298,_0x79e4a6,_0x262ec0={}){const _0x4f2ad5=a160_0x1f5e,_0x26f315=resolvePushDirectoryRoot(_0xb2c13c),_0x485248=scanSkillDirectory(_0x26f315),_0x59df8a=_0x485248[_0x4f2ad5(0x97)](_0x45df2f=>_0x45df2f[_0x4f2ad5(0xbd)]===SKILL_FILE),_0x38cf1a=_0x59df8a?fileText(_0x59df8a):'',_0x454ee2=tryNormalizePackageManifest(_0xf32298['files']),_0x25b01b={..._0xf32298,'content':_0xf32298[_0x4f2ad5(0xaf)]??_0x38cf1a,'files':_0x454ee2},_0x145eeb=_0x454ee2?normalizeLocalFiles(_0x485248)[_0x4f2ad5(0xad)](_0x8b874f=>_0x454ee2[_0x4f2ad5(0xc1)]['some'](_0x514997=>_0x514997['path']===_0x8b874f['path'])):undefined,_0x392240=buildMetadata(_0x25b01b,_0x262ec0[_0x4f2ad5(0xab)]??'personal',_0x79e4a6,contentHash(_0x25b01b[_0x4f2ad5(0xaf)]??''),_0x262ec0[_0x4f2ad5(0xb1)],_0x145eeb);writeJsonAtomic(resolve(_0x26f315,METADATA_FILE),_0x392240);}export function deriveSkillCodeFromDirectory(_0x560e25,_0x8c7041){const _0x519d90=a160_0x1f5e,_0x3fe3e2=basename(resolve(_0x560e25)),_0x42f27e=_0x8c7041+'--';return _0x3fe3e2[_0x519d90(0xc2)](_0x42f27e)?_0x3fe3e2[_0x519d90(0x9d)](_0x42f27e[_0x519d90(0xd2)]):_0x3fe3e2;}function resolvePushSkillCode(_0x1fec46,_0x1c25ce,_0xd508d7,_0x167272){const _0x2aa7f0=a160_0x1f5e,_0x35e374=deriveSkillCodeFromSkillFile(_0x1fec46)||deriveSkillCodeFromDirectory(_0x1fec46,_0x1c25ce);if(_0x167272[_0x2aa7f0(0xcd)])return _0x35e374;return _0xd508d7?.[_0x2aa7f0(0xbe)]?.[_0x2aa7f0(0xb3)]()||_0x35e374;}function deriveSkillCodeFromSkillFile(_0x46a7d7){const _0x58bbd7=a160_0x1f5e,_0x49cfd9=resolve(_0x46a7d7,SKILL_FILE);if(!existsSync(_0x49cfd9)||!lstatSync(_0x49cfd9)['isFile']())return undefined;const _0xfee15c=readFileSync(_0x49cfd9,'utf8'),_0x132bb7=_0xfee15c[_0x58bbd7(0xc3)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x132bb7)return undefined;const _0x581f54=parseFrontmatterObject(_0x132bb7[0x1]??''),_0xbfb946=scalarToString(_0x581f54?.[_0x58bbd7(0x9b)]);return _0xbfb946?slugifySkillName(_0xbfb946):undefined;}function readSkillDisplayName(_0x55543f){const _0x53a70b=a160_0x1f5e,_0x3d2d45=_0x55543f[_0x53a70b(0xc3)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x3d2d45)return undefined;const _0x3b7d43=parseFrontmatterObject(_0x3d2d45[0x1]??'');return scalarToString(_0x3b7d43?.[_0x53a70b(0xc8)]);}function a160_0x1f5e(_0xdf3ba7,_0x5059a2){_0xdf3ba7=_0xdf3ba7-0x97;const _0x2fc765=a160_0x2fc7();let _0x1f5ed1=_0x2fc765[_0xdf3ba7];return _0x1f5ed1;}function slugifySkillName(_0x53954c){const _0xc77f73=a160_0x1f5e,_0x235da1=_0x53954c[_0xc77f73(0xb3)]()[_0xc77f73(0xd1)]()[_0xc77f73(0xa4)](/[^\p{L}\p{N}\p{So}]+/gu,'-')['replace'](/^-+/,'')[_0xc77f73(0xa4)](/-+$/,'')[_0xc77f73(0xa4)](/-{2,}/g,'-');if(!_0x235da1)throw CliErrors[_0xc77f73(0xce)](_0xc77f73(0xb0)+SKILL_FILE+'\x20name\x20for\x20SkillHub\x20slug\x20generation.');return _0x235da1;}function parseFrontmatterObject(_0x6f733d){const _0x572c1=a160_0x1f5e;try{const _0x377c33=a160_0x159db6(_0x6f733d);return _0x377c33&&typeof _0x377c33===_0x572c1(0xa1)&&!Array[_0x572c1(0xa5)](_0x377c33)?_0x377c33:undefined;}catch{return undefined;}}function scalarToString(_0x380c0d){const _0x9dbb23=a160_0x1f5e;if(typeof _0x380c0d==='string')return _0x380c0d['trim']();if(typeof _0x380c0d===_0x9dbb23(0x9f)||typeof _0x380c0d===_0x9dbb23(0xb6))return String(_0x380c0d);return undefined;}function resolvePushDirectoryRoot(_0x413fa8){const _0x5007e0=a160_0x1f5e,_0xbc1aed=resolve(_0x413fa8);if(!existsSync(_0xbc1aed))throw CliErrors[_0x5007e0(0xce)](_0x5007e0(0xb2)+_0x413fa8);const _0x1e51ba=lstatSync(_0xbc1aed);if(_0x1e51ba[_0x5007e0(0xb8)]())return _0xbc1aed;if(_0x1e51ba[_0x5007e0(0x98)]()){const _0x4738ed=realpathSync(_0xbc1aed);if(lstatSync(_0x4738ed)[_0x5007e0(0xb8)]())return _0x4738ed;}throw CliErrors[_0x5007e0(0xce)](_0x5007e0(0xb2)+_0x413fa8);}function requireRemoteScope(_0x53b0ae){const _0x55ef16=a160_0x1f5e;if(_0x53b0ae[_0x55ef16(0xab)]===_0x55ef16(0xd4)||_0x53b0ae[_0x55ef16(0xab)]===_0x55ef16(0x9a)||_0x53b0ae[_0x55ef16(0xab)]==='builtin')return _0x53b0ae[_0x55ef16(0xab)];throw CliErrors[_0x55ef16(0xce)](_0x55ef16(0xbb)+(_0x53b0ae[_0x55ef16(0xbe)]||'(unknown)')+_0x55ef16(0xcf)+(_0x53b0ae['scope']??_0x55ef16(0xb4))+'\x22.');}function readLocalSkillContent(_0x3ac269){const _0x3a39ab=a160_0x1f5e,_0xfa56e=resolve(_0x3ac269,SKILL_FILE);return existsSync(_0xfa56e)&&lstatSync(_0xfa56e)[_0x3a39ab(0x99)]()?readFileSync(_0xfa56e,_0x3a39ab(0xc4)):'';}function readPushMetadataIfPresent(_0x262b4c,_0x35b705={}){const _0x3a79d6=a160_0x1f5e;try{return readMetadataIfPresent(_0x262b4c);}catch(_0x2f4f31){if(_0x35b705[_0x3a79d6(0xb7)])return undefined;throw _0x2f4f31;}}
|
|
1
|
+
function a160_0x2e5b(){const _0xb8a6de=['company','example','excludedFilePaths','replace','2sTFJnd','slice','ignoreMetadataSkillCode','1321545ldwofH','\x20to\x20submit\x20company\x20Skills\x20for\x20review.','name','isFile','Missing\x20','1732755gpTuKU','skillCode','ignoreMetadataAppCodeMismatch','packageBase64','355317olAFIH','pushedAt','startsWith','ignoreMetadataForPayload','(unknown)','number','Invalid\x20','isArray','utf8','ignoreMetadataScope','allowAppCodeRetarget','Skill\x20directory\x20not\x20found:\x20','220528lxXOGH','content',',\x20or\x20directory\x20name.','find','Skill\x20metadata\x20appCode\x20\x22','\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22','manifest','scope','dir','validation','appCode','Unable\x20to\x20resolve\x20skillCode\x20from\x20','\x20has\x20scope=\x22','length','7qmYPWr','path','sourceSessionId','skillName','1357332cOFaqB','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20','match','string','filter','2199832haQsbC','files','ignoreInvalidMetadata','Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20','some','toLowerCase','boolean','version','personal','trim','Remote\x20Skill\x20','description','object','builtin','unknown','metadata','isDirectory','tags','5005503ciMpbm'];a160_0x2e5b=function(){return _0xb8a6de;};return a160_0x2e5b();}(function(_0x19766b,_0xfea66c){const _0x1cf82c=a160_0x28c8,_0x18b502=_0x19766b();while(!![]){try{const _0x5bcb77=parseInt(_0x1cf82c(0x120))/0x1*(-parseInt(_0x1cf82c(0x114))/0x2)+parseInt(_0x1cf82c(0x117))/0x3+parseInt(_0x1cf82c(0xe6))/0x4+-parseInt(_0x1cf82c(0x11c))/0x5+parseInt(_0x1cf82c(0xf8))/0x6*(parseInt(_0x1cf82c(0xf4))/0x7)+-parseInt(_0x1cf82c(0xfd))/0x8+parseInt(_0x1cf82c(0x10f))/0x9;if(_0x5bcb77===_0xfea66c)break;else _0x18b502['push'](_0x18b502['shift']());}catch(_0x364a85){_0x18b502['push'](_0x18b502['shift']());}}}(a160_0x2e5b,0x49885));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a160_0xcf4da6}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 a160_0x28c8(_0xa192a7,_0x207a5d){_0xa192a7=_0xa192a7-0xe1;const _0x2e5b45=a160_0x2e5b();let _0x28c888=_0x2e5b45[_0xa192a7];return _0x28c888;}export function resolvePushDirectoryIdentity(_0x3ce734,_0xc7f41a,_0x548f8e={}){const _0x363c34=a160_0x28c8,_0x3b711f=resolvePushDirectoryRoot(_0x3ce734),_0x5d7492=readPushMetadataIfPresent(resolve(_0x3b711f,METADATA_FILE),{'ignoreInvalidMetadata':_0x548f8e[_0x363c34(0xff)]});if(_0x5d7492?.[_0x363c34(0xf0)]&&_0x5d7492[_0x363c34(0xf0)]!==_0xc7f41a&&!_0x548f8e[_0x363c34(0xe4)]&&!_0x548f8e[_0x363c34(0x11e)])throw CliErrors[_0x363c34(0xef)](_0x363c34(0xea)+_0x5d7492[_0x363c34(0xf0)]+_0x363c34(0xeb)+_0xc7f41a+'\x22.');const _0x550432=resolvePushSkillCode(_0x3b711f,_0xc7f41a,_0x5d7492,_0x548f8e);if(!_0x550432)throw CliErrors[_0x363c34(0xef)](_0x363c34(0xf1)+SKILL_FILE+',\x20'+METADATA_FILE+_0x363c34(0xe8));return{'dir':_0x3b711f,'skillCode':_0x550432,'metadata':_0x5d7492};}export function readPushDirectory(_0x3c8992,_0x6529cf,_0x3f2d68={}){const _0x23290a=a160_0x28c8,_0x42b5a1=resolvePushDirectoryIdentity(_0x3c8992,_0x6529cf,_0x3f2d68),_0x201727=_0x42b5a1[_0x23290a(0xee)],_0x3a42d3=resolve(_0x201727,SKILL_FILE);if(!existsSync(_0x3a42d3)||!lstatSync(_0x3a42d3)['isFile']())throw CliErrors[_0x23290a(0xef)](_0x23290a(0x11b)+SKILL_FILE+':\x20'+_0x3a42d3);const _0x332fa7=_0x42b5a1[_0x23290a(0x10c)],_0x5026a2=_0x3f2d68['targetScope']??_0x23290a(0x105);if(!_0x3f2d68[_0x23290a(0xe3)]&&_0x332fa7?.[_0x23290a(0xed)]===_0x23290a(0x10a))throw CliErrors[_0x23290a(0xef)](_0x23290a(0x100)+METADATA_FILE+_0x23290a(0xf2)+_0x332fa7[_0x23290a(0xed)]+'\x22.');if(!_0x3f2d68[_0x23290a(0xe3)]&&_0x5026a2==='personal'&&_0x332fa7?.[_0x23290a(0xed)]&&_0x332fa7['scope']!==_0x23290a(0x105))throw CliErrors['validation'](_0x23290a(0xf9)+METADATA_FILE+_0x23290a(0xf2)+_0x332fa7[_0x23290a(0xed)]+'\x22.','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20'+_0x201727+_0x23290a(0x118));const _0x4a5dbe=scanSkillDirectory(_0x201727,{'excludedFilePaths':_0x3f2d68[_0x23290a(0x112)]}),_0x518905=buildSkillPackage(_0x4a5dbe),_0x1df558=readFileSync(_0x3a42d3,_0x23290a(0xe2)),_0x3c0d7c=_0x42b5a1[_0x23290a(0x11d)],_0x5dc321=_0x3f2d68[_0x23290a(0x123)]?undefined:_0x332fa7,_0x4d77e0=readSkillDisplayName(_0x1df558);return{'skillCode':_0x3c0d7c,'metadata':_0x332fa7,'frontmatterDisplayName':_0x4d77e0,'input':{'skillCode':_0x3c0d7c,'skillName':_0x4d77e0??_0x5dc321?.['skillName'],'description':_0x5dc321?.[_0x23290a(0x108)],'content':_0x1df558,'files':_0x518905[_0x23290a(0xec)],'packageBase64':_0x518905[_0x23290a(0x11f)],'tags':_0x5dc321?.[_0x23290a(0x10e)],'version':_0x5dc321?.[_0x23290a(0x104)],'sourceSessionId':_0x5dc321?.[_0x23290a(0xf6)]}};}export function refreshPushDirectoryMetadataFromRemote(_0x489b45,_0x1633de,_0x3d26de,_0x4aa080={}){const _0x41d55e=a160_0x28c8,_0x5383c9=resolvePushDirectoryRoot(_0x489b45),_0x28b8d0=readPushMetadataIfPresent(resolve(_0x5383c9,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x2fe9ee=requireRemoteScope(_0x1633de),_0x41b309=readLocalSkillContent(_0x5383c9),_0x9c5b35={..._0x1633de,'appCode':_0x1633de[_0x41d55e(0xf0)]??_0x3d26de,'skillName':_0x1633de[_0x41d55e(0xf7)]??_0x28b8d0?.['skillName'],'description':_0x1633de['description']??_0x28b8d0?.[_0x41d55e(0x108)],'example':_0x1633de[_0x41d55e(0x111)]??_0x28b8d0?.[_0x41d55e(0x111)],'tags':Array[_0x41d55e(0xe1)](_0x1633de[_0x41d55e(0x10e)])?_0x1633de[_0x41d55e(0x10e)]:_0x28b8d0?.['tags'],'sourceSessionId':_0x1633de[_0x41d55e(0xf6)]??_0x28b8d0?.['sourceSessionId'],'content':_0x1633de[_0x41d55e(0xe7)]??_0x41b309},_0x33978f=buildMetadata(_0x9c5b35,_0x2fe9ee,_0x3d26de,contentHash(_0x41b309),_0x4aa080['refreshedAt']);writeJsonAtomic(resolve(_0x5383c9,METADATA_FILE),_0x33978f);}export function recordPushedRuntimeSkill(_0xaa5fb5,_0x153f73,_0x52f7a7,_0x492c10={}){const _0x184e95=a160_0x28c8,_0x8d9027=resolvePushDirectoryRoot(_0xaa5fb5),_0x75f4f9=scanSkillDirectory(_0x8d9027),_0x1fb284=_0x75f4f9[_0x184e95(0xe9)](_0x2496f2=>_0x2496f2[_0x184e95(0xf5)]===SKILL_FILE),_0x18fcb7=_0x1fb284?fileText(_0x1fb284):'',_0x44e91a=tryNormalizePackageManifest(_0x153f73[_0x184e95(0xfe)]),_0xca0a3={..._0x153f73,'content':_0x153f73['content']??_0x18fcb7,'files':_0x44e91a},_0x314a83=_0x44e91a?normalizeLocalFiles(_0x75f4f9)[_0x184e95(0xfc)](_0x55c044=>_0x44e91a[_0x184e95(0xfe)][_0x184e95(0x101)](_0x364981=>_0x364981['path']===_0x55c044[_0x184e95(0xf5)])):undefined,_0x1afe99=buildMetadata(_0xca0a3,_0x492c10[_0x184e95(0xed)]??_0x184e95(0x105),_0x52f7a7,contentHash(_0xca0a3[_0x184e95(0xe7)]??''),_0x492c10[_0x184e95(0x121)],_0x314a83);writeJsonAtomic(resolve(_0x8d9027,METADATA_FILE),_0x1afe99);}export function deriveSkillCodeFromDirectory(_0x7d3021,_0x173a9e){const _0x224e2a=a160_0x28c8,_0x48e332=basename(resolve(_0x7d3021)),_0x5c6084=_0x173a9e+'--';return _0x48e332[_0x224e2a(0x122)](_0x5c6084)?_0x48e332[_0x224e2a(0x115)](_0x5c6084[_0x224e2a(0xf3)]):_0x48e332;}function resolvePushSkillCode(_0x20d6f9,_0x451f25,_0x45b752,_0x21eb25){const _0x3570b5=a160_0x28c8,_0x223fe9=deriveSkillCodeFromSkillFile(_0x20d6f9)||deriveSkillCodeFromDirectory(_0x20d6f9,_0x451f25);if(_0x21eb25[_0x3570b5(0x116)])return _0x223fe9;return _0x45b752?.[_0x3570b5(0x11d)]?.['trim']()||_0x223fe9;}function deriveSkillCodeFromSkillFile(_0x2d39f9){const _0x123bc5=a160_0x28c8,_0xfe543=resolve(_0x2d39f9,SKILL_FILE);if(!existsSync(_0xfe543)||!lstatSync(_0xfe543)[_0x123bc5(0x11a)]())return undefined;const _0x4630f3=readFileSync(_0xfe543,_0x123bc5(0xe2)),_0x2fc6f5=_0x4630f3['match'](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x2fc6f5)return undefined;const _0x4cc25e=parseFrontmatterObject(_0x2fc6f5[0x1]??''),_0x4a78e6=scalarToString(_0x4cc25e?.[_0x123bc5(0x119)]);return _0x4a78e6?slugifySkillName(_0x4a78e6):undefined;}function readSkillDisplayName(_0x485d71){const _0x3e6ac5=a160_0x28c8,_0x42a431=_0x485d71[_0x3e6ac5(0xfa)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x42a431)return undefined;const _0x5a1530=parseFrontmatterObject(_0x42a431[0x1]??'');return scalarToString(_0x5a1530?.['displayName']);}function slugifySkillName(_0x3381a4){const _0x62c4c3=a160_0x28c8,_0x21c46f=_0x3381a4[_0x62c4c3(0x106)]()[_0x62c4c3(0x102)]()[_0x62c4c3(0x113)](/[^\p{L}\p{N}\p{So}]+/gu,'-')[_0x62c4c3(0x113)](/^-+/,'')['replace'](/-+$/,'')[_0x62c4c3(0x113)](/-{2,}/g,'-');if(!_0x21c46f)throw CliErrors[_0x62c4c3(0xef)](_0x62c4c3(0x126)+SKILL_FILE+'\x20name\x20for\x20SkillHub\x20slug\x20generation.');return _0x21c46f;}function parseFrontmatterObject(_0x393d2f){const _0x4ada32=a160_0x28c8;try{const _0xb8351=a160_0xcf4da6(_0x393d2f);return _0xb8351&&typeof _0xb8351===_0x4ada32(0x109)&&!Array[_0x4ada32(0xe1)](_0xb8351)?_0xb8351:undefined;}catch{return undefined;}}function scalarToString(_0xa4d5d9){const _0x21ccaa=a160_0x28c8;if(typeof _0xa4d5d9===_0x21ccaa(0xfb))return _0xa4d5d9[_0x21ccaa(0x106)]();if(typeof _0xa4d5d9===_0x21ccaa(0x125)||typeof _0xa4d5d9===_0x21ccaa(0x103))return String(_0xa4d5d9);return undefined;}function resolvePushDirectoryRoot(_0xcd6155){const _0x3038e4=a160_0x28c8,_0x24b6f6=resolve(_0xcd6155);if(!existsSync(_0x24b6f6))throw CliErrors[_0x3038e4(0xef)](_0x3038e4(0xe5)+_0xcd6155);const _0x4d6a4a=lstatSync(_0x24b6f6);if(_0x4d6a4a['isDirectory']())return _0x24b6f6;if(_0x4d6a4a['isSymbolicLink']()){const _0x5f3a8e=realpathSync(_0x24b6f6);if(lstatSync(_0x5f3a8e)[_0x3038e4(0x10d)]())return _0x5f3a8e;}throw CliErrors[_0x3038e4(0xef)]('Skill\x20directory\x20not\x20found:\x20'+_0xcd6155);}function requireRemoteScope(_0x54094e){const _0x3a8688=a160_0x28c8;if(_0x54094e[_0x3a8688(0xed)]===_0x3a8688(0x105)||_0x54094e[_0x3a8688(0xed)]===_0x3a8688(0x110)||_0x54094e[_0x3a8688(0xed)]===_0x3a8688(0x10a))return _0x54094e[_0x3a8688(0xed)];throw CliErrors[_0x3a8688(0xef)](_0x3a8688(0x107)+(_0x54094e[_0x3a8688(0x11d)]||_0x3a8688(0x124))+'\x20has\x20unsupported\x20scope\x20\x22'+(_0x54094e['scope']??_0x3a8688(0x10b))+'\x22.');}function readLocalSkillContent(_0x1e74f8){const _0x15c4fe=a160_0x28c8,_0x214ceb=resolve(_0x1e74f8,SKILL_FILE);return existsSync(_0x214ceb)&&lstatSync(_0x214ceb)[_0x15c4fe(0x11a)]()?readFileSync(_0x214ceb,_0x15c4fe(0xe2)):'';}function readPushMetadataIfPresent(_0x213db3,_0x193594={}){const _0x5f5d7d=a160_0x28c8;try{return readMetadataIfPresent(_0x213db3);}catch(_0x192fe2){if(_0x193594[_0x5f5d7d(0xff)])return undefined;throw _0x192fe2;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2a5f04,_0x4821b0){const _0x1f4c51=a161_0x1b1d,_0x37f0b0=_0x2a5f04();while(!![]){try{const _0x501364=parseInt(_0x1f4c51(0xa6))/0x1*(-parseInt(_0x1f4c51(0xa9))/0x2)+-parseInt(_0x1f4c51(0xa3))/0x3*(-parseInt(_0x1f4c51(0xaf))/0x4)+parseInt(_0x1f4c51(0xb0))/0x5*(-parseInt(_0x1f4c51(0xae))/0x6)+parseInt(_0x1f4c51(0xa4))/0x7*(parseInt(_0x1f4c51(0xa1))/0x8)+parseInt(_0x1f4c51(0xac))/0x9*(parseInt(_0x1f4c51(0xa8))/0xa)+parseInt(_0x1f4c51(0xab))/0xb+-parseInt(_0x1f4c51(0xb1))/0xc;if(_0x501364===_0x4821b0)break;else _0x37f0b0['push'](_0x37f0b0['shift']());}catch(_0x22f107){_0x37f0b0['push'](_0x37f0b0['shift']());}}}(a161_0x2391,0xec783));import{CliErrors}from'../../errors.js';function a161_0x1b1d(_0x47ca60,_0x184497){_0x47ca60=_0x47ca60-0xa1;const _0x2391dc=a161_0x2391();let _0x1b1d19=_0x2391dc[_0x47ca60];return _0x1b1d19;}function a161_0x2391(){const _0x34f488=['9REXoLS','includes','6CNsYPl','36afhOCD','5488655cWFAHX','10012488CMrSUq','4206664mWqeWH','push','233109MMfkrt','7EZiDNh','Unsupported\x20runtime\x20Skill\x20scope:\x20','65684rJgHBc','validation','17447740QamqLf','26SbqYVw','builtin','8631062yOqlHY'];a161_0x2391=function(){return _0x34f488;};return a161_0x2391();}export function normalizeRuntimeSkillScopes(_0x1b8ba1){const _0x47f145=a161_0x1b1d,_0x796766=_0x1b8ba1&&_0x1b8ba1['length']>0x0?_0x1b8ba1:['personal','company',_0x47f145(0xaa)],_0x1d668b=[];for(const _0x441a5e of _0x796766){if(!isRuntimeSkillScope(_0x441a5e))throw CliErrors[_0x47f145(0xa7)](_0x47f145(0xa5)+_0x441a5e);!_0x1d668b[_0x47f145(0xad)](_0x441a5e)&&_0x1d668b[_0x47f145(0xa2)](_0x441a5e);}return _0x1d668b;}export function isRuntimeSkillScope(_0x5012a0){const _0x5d525e=a161_0x1b1d;return _0x5012a0==='personal'||_0x5012a0==='company'||_0x5012a0===_0x5d525e(0xaa);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x4f0fa0,_0x4017f0){const _0x3b5167=a163_0x9c5d,_0x346f0c=_0x4f0fa0();while(!![]){try{const _0x3c5d05=parseInt(_0x3b5167(0x98))/0x1+parseInt(_0x3b5167(0x99))/0x2+-parseInt(_0x3b5167(0x9f))/0x3*(-parseInt(_0x3b5167(0x90))/0x4)+parseInt(_0x3b5167(0x97))/0x5*(-parseInt(_0x3b5167(0x9d))/0x6)+parseInt(_0x3b5167(0xa0))/0x7+-parseInt(_0x3b5167(0x94))/0x8+-parseInt(_0x3b5167(0x9e))/0x9*(parseInt(_0x3b5167(0x92))/0xa);if(_0x3c5d05===_0x4017f0)break;else _0x346f0c['push'](_0x346f0c['shift']());}catch(_0x572242){_0x346f0c['push'](_0x346f0c['shift']());}}}(a163_0x2c23,0x7b676));import{unzipSync,zipSync}from'fflate';function a163_0x9c5d(_0x255f19,_0x65e95f){_0x255f19=_0x255f19-0x8d;const _0x2c231d=a163_0x2c23();let _0x9c5d78=_0x2c231d[_0x255f19];return _0x9c5d78;}import{CliErrors}from'../../errors.js';function a163_0x2c23(){const _0x307ef2=['from','code','1816eabVBb','object','1483180JBLuAK','validation','7314024LXWkBn','Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.','entries','159520EqCPap','557739tQIdQz','1319398Booire','length','name','validation_error','18gdNbBS','36MgtQha','1263PQxqhH','4900889BaxHIU','Runtime\x20Skill\x20package\x20contains\x20directory\x20entry:\x20'];a163_0x2c23=function(){return _0x307ef2;};return a163_0x2c23();}import{compareSkillFiles,fileContent,normalizeLocalFiles,normalizeSkillRelativePath}from'./local-files.js';const ZIP_MTIME=new Date('1980-01-01T00:00:00.000Z');export function createDeterministicZipPackage(_0x356806){const _0x5673c2=a163_0x9c5d,_0x1c4b18={};for(const _0x17d611 of normalizeLocalFiles(_0x356806)){_0x1c4b18[_0x17d611['path']]=fileContent(_0x17d611);}return Buffer[_0x5673c2(0x8e)](zipSync(_0x1c4b18,{'level':0x0,'mtime':ZIP_MTIME}));}export function parseZipPackage(_0x5f398e){const _0xffa6=a163_0x9c5d;if(_0x5f398e[_0xffa6(0x9a)]<0x16)throw CliErrors[_0xffa6(0x93)](_0xffa6(0x95));let _0x318d9f;try{_0x318d9f=unzipSync(_0x5f398e,{'filter'(_0x1e9d83){const _0x264f15=_0xffa6,_0x7e797b=normalizeSkillRelativePath(_0x1e9d83[_0x264f15(0x9b)]);if(_0x7e797b['endsWith']('/'))throw CliErrors[_0x264f15(0x93)](_0x264f15(0x8d)+_0x7e797b);return!![];}});}catch(_0x33bd19){if(isRuntimeSkillValidationError(_0x33bd19))throw _0x33bd19;throw CliErrors[_0xffa6(0x93)](_0xffa6(0x95));}return Object[_0xffa6(0x96)](_0x318d9f)['map'](([_0xfd404b,_0x117838])=>({'path':normalizeSkillRelativePath(_0xfd404b),'bytes':Buffer[_0xffa6(0x8e)](_0x117838)}))['sort'](compareSkillFiles);}function isRuntimeSkillValidationError(_0x13ec79){const _0x3f94d7=a163_0x9c5d;return typeof _0x13ec79===_0x3f94d7(0x91)&&_0x13ec79!==null&&_0x3f94d7(0x8f)in _0x13ec79&&_0x13ec79['code']===_0x3f94d7(0x9c);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3ba4f9,_0x45a183){const _0x1ed1e6=a164_0x13ae,_0x26ca37=_0x3ba4f9();while(!![]){try{const _0x1fa6b4=parseInt(_0x1ed1e6(0x1a8))/0x1+parseInt(_0x1ed1e6(0x1b0))/0x2+parseInt(_0x1ed1e6(0x19b))/0x3*(parseInt(_0x1ed1e6(0x19e))/0x4)+-parseInt(_0x1ed1e6(0x1a4))/0x5*(parseInt(_0x1ed1e6(0x19d))/0x6)+parseInt(_0x1ed1e6(0x190))/0x7+-parseInt(_0x1ed1e6(0x1ab))/0x8+parseInt(_0x1ed1e6(0x1b3))/0x9*(-parseInt(_0x1ed1e6(0x1a6))/0xa);if(_0x1fa6b4===_0x45a183)break;else _0x26ca37['push'](_0x26ca37['shift']());}catch(_0x1016d9){_0x26ca37['push'](_0x26ca37['shift']());}}}(a164_0x5ab9,0x2f9e1));function a164_0x13ae(_0x2e8d95,_0x5e5344){_0x2e8d95=_0x2e8d95-0x18d;const _0x5ab994=a164_0x5ab9();let _0x13aebf=_0x5ab994[_0x2e8d95];return _0x13aebf;}import{CliErrors}from'../../errors.js';function a164_0x5ab9(){const _0xd49c6=['Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.','1939352PlgATi','Runtime\x20Skill\x20package\x20size\x20is\x20invalid.','sha256','Runtime\x20Skill\x20package\x20sha256\x20is\x20invalid.','isArray','433126qmSUKT','zipSha256','length','130671HQZvAE','isSafeInteger','Runtime\x20Skill\x20package\x20sha256\x20mismatch.','files','map','base64','ossPath','Duplicate\x20Skill\x20package\x20entry:\x20','toLowerCase','size','1747333JwYrxW','path','Runtime\x20Skill\x20package\x20file\x20size\x20mismatch:\x20','validation','Runtime\x20Skill\x20manifest\x20is\x20missing\x20','bytes','push','treeSha256','zipSize','toString','some','3OEHtUr','\x20in\x20Skill\x20file\x20package.','194406fNdIqZ','821452mVgpUV','set','Runtime\x20Skill\x20package\x20is\x20missing\x20entry:\x20','Runtime\x20Skill\x20package\x20size\x20mismatch.','get','has','10tOirhU','schemaVersion','290QZHNgc','Runtime\x20Skill\x20file\x20tree\x20sha256\x20mismatch.','251768KPJvsb','Runtime\x20Skill\x20package\x20file\x20sha256\x20mismatch:\x20'];a164_0x5ab9=function(){return _0xd49c6;};return a164_0x5ab9();}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(_0x2148bc){const _0x1ae806=a164_0x13ae,_0x510694=normalizeLocalFiles(_0x2148bc);if(!_0x510694[_0x1ae806(0x19a)](_0x41540e=>_0x41540e['path']===SKILL_FILE))throw CliErrors[_0x1ae806(0x193)]('Missing\x20'+SKILL_FILE+_0x1ae806(0x19c));const _0x39ce72=localFilesToManifestFiles(_0x510694),_0x24eb9f=createDeterministicZipPackage(_0x510694);return{'manifest':{'schemaVersion':0x2,'treeSha256':fileTreeHash(_0x39ce72),'zipSha256':bufferSha256(_0x24eb9f),'zipSize':_0x24eb9f[_0x1ae806(0x1b2)],'files':_0x39ce72},'packageBytes':_0x24eb9f,'packageBase64':_0x24eb9f[_0x1ae806(0x199)](_0x1ae806(0x1b8))};}export function verifyRuntimeSkillPackage(_0x49de4a,_0x220530){const _0x300a40=a164_0x13ae,_0x456a12=normalizePackageManifest(_0x49de4a,{'requireOssPath':![]});if(!_0x456a12)throw CliErrors[_0x300a40(0x193)](_0x300a40(0x1aa));return extractAndVerifyPackage(_0x456a12,_0x220530);}export function verifyRuntimeSkillBundle(_0x4a44d0,_0x3229d8){const _0x8d5811=a164_0x13ae,_0x9370a2=normalizePackageManifest(_0x4a44d0,{'requireOssPath':![]});if(!_0x9370a2)throw CliErrors[_0x8d5811(0x193)](_0x8d5811(0x1aa));return extractAndVerifyPackageFiles(_0x9370a2,_0x3229d8);}export function tryNormalizePackageManifest(_0x49754c){return normalizePackageManifest(_0x49754c,{'requireOssPath':![]});}export function requirePackageBytes(_0x183f61,_0x27f04d){const _0x238b09=a164_0x13ae;if(!_0x27f04d||_0x27f04d[_0x238b09(0x1b2)]===0x0)throw CliErrors[_0x238b09(0x193)]('Runtime\x20Skill\x20package\x20is\x20required\x20for\x20Skill\x20install:\x20'+_0x183f61);return _0x27f04d;}export function extractDownloadedPackage(_0x596af5){const _0x4b01f5=a164_0x13ae,_0x1b8d11=parseZipPackage(_0x596af5)[_0x4b01f5(0x1b7)](_0x5dfe6a=>({'path':_0x5dfe6a[_0x4b01f5(0x191)],'bytes':_0x5dfe6a[_0x4b01f5(0x195)]}));if(!_0x1b8d11[_0x4b01f5(0x19a)](_0x4bbb6c=>_0x4bbb6c[_0x4b01f5(0x191)]===SKILL_FILE))throw CliErrors[_0x4b01f5(0x193)]('Runtime\x20Skill\x20package\x20is\x20missing\x20'+SKILL_FILE+'.');return normalizeLocalFiles(_0x1b8d11);}export function localFilesToManifestFiles(_0x541d66){const _0x1c2f41=a164_0x13ae;return normalizeLocalFiles(_0x541d66)['map'](_0x5b56f6=>({'path':_0x5b56f6[_0x1c2f41(0x191)],'sha256':fileHash(_0x5b56f6),'size':fileContent(_0x5b56f6)['length']}));}function normalizePackageManifest(_0x5a6e0a,_0x440b54){const _0x5b1b52=a164_0x13ae;if(!_0x5a6e0a||typeof _0x5a6e0a!=='object'||Array[_0x5b1b52(0x1af)](_0x5a6e0a))return undefined;const _0x11aace=_0x5a6e0a,_0x441cba=typeof _0x11aace[_0x5b1b52(0x1b9)]==='string'?_0x11aace[_0x5b1b52(0x1b9)]['trim']():undefined;if(_0x440b54['requireOssPath']&&!_0x441cba)return undefined;if(!Array[_0x5b1b52(0x1af)](_0x11aace[_0x5b1b52(0x1b6)])||_0x11aace[_0x5b1b52(0x1b6)]['length']===0x0)return undefined;if(!isSha256Hex(_0x11aace[_0x5b1b52(0x197)]))throw CliErrors[_0x5b1b52(0x193)]('Runtime\x20Skill\x20file\x20tree\x20sha256\x20is\x20invalid.');if(!isSha256Hex(_0x11aace[_0x5b1b52(0x1b1)]))throw CliErrors[_0x5b1b52(0x193)](_0x5b1b52(0x1ae));if(!Number[_0x5b1b52(0x1b4)](_0x11aace[_0x5b1b52(0x198)])||_0x11aace['zipSize']<0x0)throw CliErrors['validation'](_0x5b1b52(0x1ac));const _0x30ac32=normalizeManifestFiles(_0x11aace['files']);if(!_0x30ac32['some'](_0x43f72b=>_0x43f72b[_0x5b1b52(0x191)]===SKILL_FILE))throw CliErrors['validation'](_0x5b1b52(0x194)+SKILL_FILE+'.');const _0x596329=fileTreeHash(_0x30ac32);if(_0x596329!==_0x11aace[_0x5b1b52(0x197)]['toLowerCase']())throw CliErrors[_0x5b1b52(0x193)](_0x5b1b52(0x1a7));return{'schemaVersion':Number['isSafeInteger'](_0x11aace[_0x5b1b52(0x1a5)])?_0x11aace[_0x5b1b52(0x1a5)]:0x2,'ossPath':_0x441cba,'treeSha256':_0x596329,'zipSha256':_0x11aace['zipSha256'][_0x5b1b52(0x18e)](),'zipSize':_0x11aace[_0x5b1b52(0x198)],'files':_0x30ac32};}function extractAndVerifyPackage(_0x3b7463,_0xbfaad4){const _0x3543cd=a164_0x13ae,_0x3d740c=normalizePackageManifest(_0x3b7463,{'requireOssPath':![]});if(!_0x3d740c)throw CliErrors[_0x3543cd(0x193)]('Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.');if(_0xbfaad4[_0x3543cd(0x1b2)]!==_0x3d740c[_0x3543cd(0x198)])throw CliErrors[_0x3543cd(0x193)](_0x3543cd(0x1a1));const _0xaa04b6=bufferSha256(_0xbfaad4);if(_0xaa04b6!==_0x3d740c[_0x3543cd(0x1b1)])throw CliErrors[_0x3543cd(0x193)](_0x3543cd(0x1b5));return extractAndVerifyPackageFiles(_0x3d740c,_0xbfaad4);}function extractAndVerifyPackageFiles(_0x301380,_0x31e761){const _0x8be485=a164_0x13ae,_0xc9968f=parseZipPackage(_0x31e761);if(_0xc9968f[_0x8be485(0x1b2)]!==_0x301380['files'][_0x8be485(0x1b2)])throw CliErrors['validation']('Runtime\x20Skill\x20package\x20entry\x20list\x20mismatch.');const _0x452854=new Map();for(const _0x3821b6 of _0xc9968f){if(_0x452854[_0x8be485(0x1a3)](_0x3821b6['path']))throw CliErrors[_0x8be485(0x193)](_0x8be485(0x18d)+_0x3821b6[_0x8be485(0x191)]);_0x452854[_0x8be485(0x19f)](_0x3821b6[_0x8be485(0x191)],_0x3821b6);}const _0x50f351=[];for(const _0x419f92 of _0x301380[_0x8be485(0x1b6)]){const _0x2c91a6=_0x452854[_0x8be485(0x1a2)](_0x419f92['path']);if(!_0x2c91a6)throw CliErrors[_0x8be485(0x193)](_0x8be485(0x1a0)+_0x419f92[_0x8be485(0x191)]);if(_0x2c91a6['bytes'][_0x8be485(0x1b2)]!==_0x419f92[_0x8be485(0x18f)])throw CliErrors['validation'](_0x8be485(0x192)+_0x419f92[_0x8be485(0x191)]);const _0x550ffb=bufferSha256(_0x2c91a6[_0x8be485(0x195)]);if(_0x550ffb!==_0x419f92[_0x8be485(0x1ad)])throw CliErrors[_0x8be485(0x193)](_0x8be485(0x1a9)+_0x419f92[_0x8be485(0x191)]);_0x50f351[_0x8be485(0x196)]({'path':_0x419f92[_0x8be485(0x191)],'bytes':_0x2c91a6['bytes']});}return normalizeLocalFiles(_0x50f351);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x6a9b5f,_0x3f63e2){var _0x3d7b99=a165_0x3041,_0x532352=_0x6a9b5f();while(!![]){try{var _0x3cbe98=parseInt(_0x3d7b99(0xe8))/0x1+-parseInt(_0x3d7b99(0xe3))/0x2*(parseInt(_0x3d7b99(0xe6))/0x3)+-parseInt(_0x3d7b99(0xe7))/0x4*(-parseInt(_0x3d7b99(0xe9))/0x5)+-parseInt(_0x3d7b99(0xe2))/0x6+parseInt(_0x3d7b99(0xea))/0x7+-parseInt(_0x3d7b99(0xe5))/0x8+parseInt(_0x3d7b99(0xe4))/0x9*(-parseInt(_0x3d7b99(0xe1))/0xa);if(_0x3cbe98===_0x3f63e2)break;else _0x532352['push'](_0x532352['shift']());}catch(_0x1afe51){_0x532352['push'](_0x532352['shift']());}}}(a165_0xb55f,0xa21e1));function a165_0xb55f(){var _0x50b2ae=['10CCsxmc','3288635KZKoXo','10IIjdtf','2207748TERlvz','114982uVZjuw','6400413ezDejp','3334408bVykrL','3zYEZwT','1091772TIQEJD','1201749KILDYf'];a165_0xb55f=function(){return _0x50b2ae;};return a165_0xb55f();}export{contentHash,fileTreeHash}from'./runtime-skill-sync/hashing.js';export{linkEffectiveRuntimeSkills,linkGlobalRuntimeSkills,pruneStaleRuntimeSkillCache,pruneStaleRuntimeSkillLinks}from'./runtime-skill-sync/links.js';export{resolveRuntimeSkillInstallTarget}from'./runtime-skill-sync/install-target.js';function a165_0x3041(_0x1dc54e,_0x3e17b0){_0x1dc54e=_0x1dc54e-0xe1;var _0xb55f04=a165_0xb55f();var _0x3041b5=_0xb55f04[_0x1dc54e];return _0x3041b5;}export{listLocalRuntimeSkills}from'./runtime-skill-sync/list-local.js';export{materializeRuntimeSkill,reuseMaterializedRuntimeSkill}from'./runtime-skill-sync/materialize.js';export{readMetadataIfPresent}from'./runtime-skill-sync/metadata.js';export{getRuntimeSkillCacheRoot,getRuntimeSkillDir,resolveSkillSyncPaths,runtimeAgentSkillRoots}from'./runtime-skill-sync/paths.js';export{deriveSkillCodeFromDirectory,readPushDirectory,refreshPushDirectoryMetadataFromRemote,recordPushedRuntimeSkill,resolvePushDirectoryIdentity}from'./runtime-skill-sync/push.js';export{buildSkillPackage,verifyRuntimeSkillBundle,verifyRuntimeSkillPackage}from'./runtime-skill-sync/zip-package.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a166_0x37b66e=a166_0x5011;function a166_0x5011(_0x1d724b,_0xe51a19){_0x1d724b=_0x1d724b-0x84;const _0x4721fb=a166_0x4721();let _0x501146=_0x4721fb[_0x1d724b];return _0x501146;}(function(_0x16e463,_0x14c286){const _0x6dce65=a166_0x5011,_0xeb7801=_0x16e463();while(!![]){try{const _0x4abbf7=-parseInt(_0x6dce65(0xa4))/0x1*(parseInt(_0x6dce65(0x8d))/0x2)+-parseInt(_0x6dce65(0x9b))/0x3+parseInt(_0x6dce65(0x8b))/0x4+-parseInt(_0x6dce65(0x9f))/0x5+-parseInt(_0x6dce65(0x86))/0x6+parseInt(_0x6dce65(0x91))/0x7*(parseInt(_0x6dce65(0x84))/0x8)+parseInt(_0x6dce65(0x90))/0x9*(parseInt(_0x6dce65(0x89))/0xa);if(_0x4abbf7===_0x14c286)break;else _0xeb7801['push'](_0xeb7801['shift']());}catch(_0x3f5190){_0xeb7801['push'](_0xeb7801['shift']());}}}(a166_0x4721,0x9757a));import{existsSync,readFileSync}from'node:fs';import{homedir}from'node:os';import{join}from'node:path';export const SKILL_LOCK_RELATIVE_PATH=join('.agents',a166_0x37b66e(0x85));export const GLOBAL_SKILLS_DIR_RELATIVE_PATHS=[join(a166_0x37b66e(0x8e),a166_0x37b66e(0x88)),join(a166_0x37b66e(0x94),a166_0x37b66e(0x88))];function a166_0x4721(){const _0x5e8889=['451485GkibQn','absent','reason','not-recorded','3379800CieBLd','\x20has\x20no\x20skills\x20map','lockFile','join','utf8','1crmqnd','kind','11224YIioti','.skill-lock.json','6167202ExuOmA','object','skills','10yPdkMU','SKILL.md','239428fJQuFw','\x20is\x20unreadable:\x20','2195062OoADSY','.agents','\x20uses\x20unsupported\x20version\x20','21240279IPvHsz','5747hkxWgm','version','\x20records\x20\x22','.claude','includes','\x22\x20but\x20no\x20SKILL.md\x20was\x20found\x20in\x20known\x20layouts\x20','unusable','recorded','unverifiable','map'];a166_0x4721=function(){return _0x5e8889;};return a166_0x4721();}const SUPPORTED_LOCK_VERSIONS=[0x3];function readLockLookup(_0x3f95d0,_0x3a5026){const _0x52ff7e=a166_0x37b66e;if(!existsSync(_0x3f95d0))return{'kind':'not-recorded'};let _0x1dddce;try{_0x1dddce=JSON['parse'](readFileSync(_0x3f95d0,_0x52ff7e(0xa3)));}catch(_0x1a3d40){return{'kind':_0x52ff7e(0x97),'reason':_0x3f95d0+_0x52ff7e(0x8c)+_0x1a3d40['message']};}const _0x1fd585=_0x1dddce;if(typeof _0x1fd585?.[_0x52ff7e(0x92)]!=='number'||!SUPPORTED_LOCK_VERSIONS[_0x52ff7e(0x95)](_0x1fd585[_0x52ff7e(0x92)]))return{'kind':_0x52ff7e(0x97),'reason':_0x3f95d0+_0x52ff7e(0x8f)+String(_0x1fd585?.[_0x52ff7e(0x92)])};if(!_0x1fd585[_0x52ff7e(0x88)]||typeof _0x1fd585['skills']!==_0x52ff7e(0x87))return{'kind':_0x52ff7e(0x97),'reason':_0x3f95d0+_0x52ff7e(0xa0)};return _0x1fd585[_0x52ff7e(0x88)][_0x3a5026]?{'kind':_0x52ff7e(0x98)}:{'kind':_0x52ff7e(0x9e)};}export function resolveInstalledSkill(_0x43e7a3,_0x4c9b38){const _0x5a0755=a166_0x37b66e,_0x549d3e=_0x4c9b38?.['home']??homedir(),_0x307d2c=_0x4c9b38?.['globalSkillsDirs']??GLOBAL_SKILLS_DIR_RELATIVE_PATHS[_0x5a0755(0x9a)](_0x365066=>join(_0x549d3e,_0x365066)),_0x5ef79c=_0x4c9b38?.[_0x5a0755(0xa1)]??join(_0x549d3e,SKILL_LOCK_RELATIVE_PATH),_0x47011a=_0x307d2c[_0x5a0755(0x9a)](_0x2c16bf=>join(_0x2c16bf,_0x43e7a3,_0x5a0755(0x8a))),_0xb073fc=_0x47011a['find'](_0x758cc7=>existsSync(_0x758cc7));if(_0xb073fc)return{'state':'present','path':_0xb073fc};const _0x3b7b25=readLockLookup(_0x5ef79c,_0x43e7a3);if(_0x3b7b25[_0x5a0755(0xa5)]===_0x5a0755(0x97))return{'state':_0x5a0755(0x99),'reason':_0x3b7b25[_0x5a0755(0x9d)]};if(_0x3b7b25[_0x5a0755(0xa5)]===_0x5a0755(0x98))return{'state':_0x5a0755(0x99),'reason':_0x5ef79c+_0x5a0755(0x93)+_0x43e7a3+_0x5a0755(0x96)+('('+_0x47011a[_0x5a0755(0xa2)](',\x20')+')')};return{'state':_0x5a0755(0x9c),'checked':_0x47011a};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a167_0x43eb43=a167_0x2696;(function(_0xfb5b2a,_0x290793){const _0x533077=a167_0x2696,_0xeb40b6=_0xfb5b2a();while(!![]){try{const _0x804a96=-parseInt(_0x533077(0x10e))/0x1+-parseInt(_0x533077(0x117))/0x2+-parseInt(_0x533077(0x10f))/0x3+-parseInt(_0x533077(0x11f))/0x4+-parseInt(_0x533077(0x118))/0x5+-parseInt(_0x533077(0x11a))/0x6*(parseInt(_0x533077(0x112))/0x7)+parseInt(_0x533077(0x11b))/0x8;if(_0x804a96===_0x290793)break;else _0xeb40b6['push'](_0xeb40b6['shift']());}catch(_0x207a4d){_0xeb40b6['push'](_0xeb40b6['shift']());}}}(a167_0x24d9,0x1e576));const REDACTED_ACCESS_KEY=a167_0x43eb43(0x10d);export function maskCliAccessKey(_0x277bdd){const _0x5ccc7e=a167_0x43eb43;if(typeof _0x277bdd!=='string'||_0x277bdd[_0x5ccc7e(0x11c)]<=0x8)return REDACTED_ACCESS_KEY;return''+_0x277bdd[_0x5ccc7e(0x121)](0x0,0x8)+'*'['repeat'](_0x277bdd['length']-0x8);}export function redactCliConfigCredentials(_0x2529e5){const _0x2992fd=a167_0x43eb43,_0x2c5c20={..._0x2529e5};return Object[_0x2992fd(0x11d)][_0x2992fd(0x115)][_0x2992fd(0x116)](_0x2c5c20,_0x2992fd(0x114))&&(_0x2c5c20[_0x2992fd(0x114)]=maskCliAccessKey(_0x2c5c20[_0x2992fd(0x114)])),_0x2c5c20['apps']&&typeof _0x2c5c20[_0x2992fd(0x110)]===_0x2992fd(0x119)&&!Array[_0x2992fd(0x113)](_0x2c5c20[_0x2992fd(0x110)])&&(_0x2c5c20[_0x2992fd(0x110)]=redactLegacyAppCredentials(_0x2c5c20[_0x2992fd(0x110)])),_0x2c5c20;}function a167_0x24d9(){const _0x4c53d5=['isArray','accessKey','hasOwnProperty','call','403392VtKvxJ','332160OxnPIZ','object','1662aBjDYC','6192672xbLUpS','length','prototype','test','275796aqHZOK','map','slice','<redacted>','144015UYYcYI','315012PzuIAn','apps','entries','1610jNZsHR'];a167_0x24d9=function(){return _0x4c53d5;};return a167_0x24d9();}function a167_0x2696(_0x1620db,_0x459238){_0x1620db=_0x1620db-0x10d;const _0x24d940=a167_0x24d9();let _0x2696e8=_0x24d940[_0x1620db];return _0x2696e8;}export function redactCliConfigValue(_0x55e037,_0x4e24d2){const _0x3b64e5=a167_0x43eb43;if(_0x55e037===_0x3b64e5(0x114)||/^apps\.[^.]+\.accessKey$/[_0x3b64e5(0x11e)](_0x55e037))return maskCliAccessKey(_0x4e24d2);if(_0x55e037===_0x3b64e5(0x110)&&_0x4e24d2&&typeof _0x4e24d2==='object'&&!Array[_0x3b64e5(0x113)](_0x4e24d2))return redactLegacyAppCredentials(_0x4e24d2);if(/^apps\.[^.]+$/[_0x3b64e5(0x11e)](_0x55e037)&&_0x4e24d2&&typeof _0x4e24d2==='object'&&!Array[_0x3b64e5(0x113)](_0x4e24d2)){const _0x6cb121=_0x4e24d2;return Object[_0x3b64e5(0x11d)]['hasOwnProperty'][_0x3b64e5(0x116)](_0x6cb121,'accessKey')?{..._0x6cb121,'accessKey':maskCliAccessKey(_0x6cb121[_0x3b64e5(0x114)])}:_0x4e24d2;}return _0x4e24d2;}function redactLegacyAppCredentials(_0x489731){const _0x40114e=a167_0x43eb43;return Object['fromEntries'](Object[_0x40114e(0x111)](_0x489731)[_0x40114e(0x120)](([_0x1ad633,_0x5b3d03])=>{const _0x1f1801=_0x40114e;if(!_0x5b3d03||typeof _0x5b3d03!==_0x1f1801(0x119)||Array[_0x1f1801(0x113)](_0x5b3d03))return[_0x1ad633,_0x5b3d03];const _0x1a0102={..._0x5b3d03};return Object[_0x1f1801(0x11d)][_0x1f1801(0x115)][_0x1f1801(0x116)](_0x1a0102,_0x1f1801(0x114))&&(_0x1a0102[_0x1f1801(0x114)]=maskCliAccessKey(_0x1a0102['accessKey'])),[_0x1ad633,_0x1a0102];}));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2168db,_0x4325e7){const _0x269ccc=a168_0xb804,_0x392538=_0x2168db();while(!![]){try{const _0x667d76=-parseInt(_0x269ccc(0x146))/0x1+parseInt(_0x269ccc(0x144))/0x2+-parseInt(_0x269ccc(0x14a))/0x3+-parseInt(_0x269ccc(0x14b))/0x4+-parseInt(_0x269ccc(0x143))/0x5*(-parseInt(_0x269ccc(0x147))/0x6)+parseInt(_0x269ccc(0x148))/0x7+parseInt(_0x269ccc(0x149))/0x8*(-parseInt(_0x269ccc(0x145))/0x9);if(_0x667d76===_0x4325e7)break;else _0x392538['push'](_0x392538['shift']());}catch(_0x4a519c){_0x392538['push'](_0x392538['shift']());}}}(a168_0x4118,0xb22db));function a168_0xb804(_0x54da0b,_0x27389d){_0x54da0b=_0x54da0b-0x143;const _0x411821=a168_0x4118();let _0xb804fa=_0x411821[_0x54da0b];return _0xb804fa;}import{createJqFilter,resolveBundledJqPaths}from'@lovrabet/cli-framework';import{CliErrors}from'../errors.js';export const applyJqFilter=createJqFilter(CliErrors,{'bundledJqPaths':resolveBundledJqPaths()});function a168_0x4118(){const _0x2e3b78=['9CeGfAJ','56189jquhZd','121650KOgmPG','7655466gHzean','2427976jKVZCS','1733130uskRZj','3153356aemJql','315JprokG','169182kKqBnC'];a168_0x4118=function(){return _0x2e3b78;};return a168_0x4118();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1e35ec,_0x37b606){const _0x463c57=a169_0x1893,_0x44197f=_0x1e35ec();while(!![]){try{const _0x4190e7=-parseInt(_0x463c57(0x154))/0x1+parseInt(_0x463c57(0x15a))/0x2*(-parseInt(_0x463c57(0x159))/0x3)+parseInt(_0x463c57(0x153))/0x4+-parseInt(_0x463c57(0x14c))/0x5+-parseInt(_0x463c57(0x151))/0x6*(parseInt(_0x463c57(0x14a))/0x7)+parseInt(_0x463c57(0x14f))/0x8*(parseInt(_0x463c57(0x157))/0x9)+parseInt(_0x463c57(0x152))/0xa;if(_0x4190e7===_0x37b606)break;else _0x44197f['push'](_0x44197f['shift']());}catch(_0x152f3c){_0x44197f['push'](_0x44197f['shift']());}}}(a169_0x3651,0x22c13));import a169_0x3ad18b from'semver';import{LOVRABET_NPM_PACKAGE_NAME}from'../constant/distribution.js';function a169_0x3651(){const _0x1dabee=['2HubnfV','validation','Recommended\x20stable:\x20','Minimum\x20supported:\x20','npm\x20install\x20-g\x20','72765WoNcWT','valid','643730heRNYF','minimumVersion','stableVersion','83312oaeVAT','minimumVersionMessage','96oGzZie','9040230tcGflf','130860hmmMcc','256878zshJmX','Upgrade\x20command:\x20','Current\x20version:\x20','9ZZAZjl','join','758559mJaBTE'];a169_0x3651=function(){return _0x1dabee;};return a169_0x3651();}import{CliErrors}from'../errors.js';import{getCliVersionPolicy}from'../utils/cli-version-policy.js';import{getCliVersion}from'../utils/version.js';export function evaluateCliVersionPolicy(_0x1412a5,_0x48a25e){const _0x18c18d=a169_0x1893,_0x5a325c=a169_0x3ad18b[_0x18c18d(0x14b)](_0x1412a5)===_0x1412a5,_0x1e0669=_0x48a25e?.[_0x18c18d(0x14e)]??null,_0x1a0787=_0x48a25e?.[_0x18c18d(0x14d)]??null,_0xde1a64=Boolean(_0x5a325c&&_0x1e0669&&a169_0x3ad18b['lt'](_0x1412a5,_0x1e0669)),_0xe19448=Boolean(_0x5a325c&&_0x1a0787&&a169_0x3ad18b['lt'](_0x1412a5,_0x1a0787));return{'currentVersion':_0x1412a5,'stableVersion':_0x1e0669,'minimumVersion':_0x1a0787,'needsUpgrade':_0xde1a64||_0xe19448,'belowMinimum':_0xe19448,'upgradeMessage':_0x48a25e?.['upgradeMessage'],'minimumVersionMessage':_0x48a25e?.['minimumVersionMessage']};}export async function checkCliVersion(){return evaluateCliVersionPolicy(getCliVersion(),await getCliVersionPolicy());}function a169_0x1893(_0x2225cb,_0x19f7fc){_0x2225cb=_0x2225cb-0x148;const _0x365195=a169_0x3651();let _0x1893a8=_0x365195[_0x2225cb];return _0x1893a8;}export function getCliUpgradeCommand(_0x192da6){const _0x20901d=a169_0x1893;return _0x20901d(0x149)+LOVRABET_NPM_PACKAGE_NAME+'@'+(_0x192da6[_0x20901d(0x14e)]??'latest');}export function assertCliVersionSupported(_0x666285){const _0x3c25f0=a169_0x1893;if(!_0x666285['belowMinimum'])return;const _0x312f77=[_0x666285[_0x3c25f0(0x150)],_0x3c25f0(0x156)+_0x666285['currentVersion'],_0x3c25f0(0x148)+_0x666285['minimumVersion'],_0x3c25f0(0x15c)+(_0x666285[_0x3c25f0(0x14e)]??'unavailable'),_0x3c25f0(0x155)+getCliUpgradeCommand(_0x666285)]['filter'](Boolean)[_0x3c25f0(0x158)]('\x0a');throw CliErrors[_0x3c25f0(0x15b)]('Current\x20CLI\x20version\x20is\x20below\x20the\x20minimum\x20supported\x20version.',_0x312f77);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x19e7e2,_0x59da44){const _0x465fae=a170_0x65e9,_0x52a7c4=_0x19e7e2();while(!![]){try{const _0x4bdc4d=parseInt(_0x465fae(0x126))/0x1+-parseInt(_0x465fae(0x117))/0x2*(parseInt(_0x465fae(0x12c))/0x3)+parseInt(_0x465fae(0x115))/0x4+-parseInt(_0x465fae(0x120))/0x5+parseInt(_0x465fae(0x123))/0x6+-parseInt(_0x465fae(0x129))/0x7*(parseInt(_0x465fae(0x127))/0x8)+-parseInt(_0x465fae(0x11a))/0x9*(-parseInt(_0x465fae(0x119))/0xa);if(_0x4bdc4d===_0x59da44)break;else _0x52a7c4['push'](_0x52a7c4['shift']());}catch(_0x50863d){_0x52a7c4['push'](_0x52a7c4['shift']());}}}(a170_0x4831,0xdcd56));import a170_0x555da3 from'semver';import{LOVRABET_CLI_VERSION_POLICY_URL}from'../constant/distribution.js';const SUCCESS_CACHE_TTL_MS=0x5*0x3c*0x3e8,FAILURE_CACHE_TTL_MS=0x3c*0x3e8,FETCH_TIMEOUT_MS=0x5dc;function pickString(_0x537297){const _0x163692=a170_0x65e9;return typeof _0x537297==='string'&&_0x537297[_0x163692(0x118)]()?_0x537297[_0x163692(0x118)]():null;}function a170_0x65e9(_0x15c8a7,_0x230eff){_0x15c8a7=_0x15c8a7-0x115;const _0x483186=a170_0x4831();let _0x65e9bb=_0x483186[_0x15c8a7];return _0x65e9bb;}function pickStrictSemver(_0x2e49bb){const _0x29659=a170_0x65e9,_0x5ba1b6=pickString(_0x2e49bb);return _0x5ba1b6&&a170_0x555da3[_0x29659(0x125)](_0x5ba1b6)===_0x5ba1b6?_0x5ba1b6:null;}function a170_0x4831(){const _0x3d859d=['application/json','now','minimumVersion','then','105170bmnxMN','recommendedVersion','object','9068646grSewo','upgradeMessage','valid','51336WMrvdi','8943592IMFWDG','minVersion','7FDOdIi','cli','latestVersion','83742NSGOtN','json','5374380fASyWD','timeout','72VYHnQY','trim','1420490MbgccK','9bDQXdO','finally'];a170_0x4831=function(){return _0x3d859d;};return a170_0x4831();}export function normalizeCliVersionPolicy(_0x1e27f6){const _0x1da37c=a170_0x65e9;if(!_0x1e27f6||typeof _0x1e27f6!==_0x1da37c(0x122))return null;const _0x366176=_0x1e27f6,_0x1dcf77=_0x366176[_0x1da37c(0x12a)]&&typeof _0x366176[_0x1da37c(0x12a)]==='object'?_0x366176['cli']:_0x366176,_0x42d8e4=pickStrictSemver(_0x1dcf77['stableVersion']??_0x1dcf77[_0x1da37c(0x12b)]??_0x1dcf77[_0x1da37c(0x121)]),_0x2978f3=pickStrictSemver(_0x1dcf77[_0x1da37c(0x11e)]??_0x1dcf77[_0x1da37c(0x128)]);if(!_0x42d8e4&&!_0x2978f3)return null;if(_0x42d8e4&&_0x2978f3&&a170_0x555da3['gt'](_0x2978f3,_0x42d8e4))return null;return{'stableVersion':_0x42d8e4,'minimumVersion':_0x2978f3,'upgradeMessage':pickString(_0x1dcf77[_0x1da37c(0x124)])??undefined,'minimumVersionMessage':pickString(_0x1dcf77['minimumVersionMessage'])??undefined};}export async function fetchCliVersionPolicy(){const _0x4db05a=a170_0x65e9;try{const _0x30d37b=await fetch(LOVRABET_CLI_VERSION_POLICY_URL,{'headers':{'Accept':_0x4db05a(0x11c)},'signal':AbortSignal[_0x4db05a(0x116)](FETCH_TIMEOUT_MS)});if(!_0x30d37b['ok'])return null;return normalizeCliVersionPolicy(await _0x30d37b[_0x4db05a(0x12d)]());}catch{return null;}}let cachedPolicy=null,cachedAt=0x0,hasCachedPolicy=![],pendingPolicy=null;export async function getCliVersionPolicy(){const _0x3e60e3=a170_0x65e9,_0x181c56=Date['now']();if(hasCachedPolicy){const _0x18f954=cachedPolicy?SUCCESS_CACHE_TTL_MS:FAILURE_CACHE_TTL_MS;if(_0x181c56-cachedAt<_0x18f954)return cachedPolicy;}if(pendingPolicy)return pendingPolicy;return pendingPolicy=fetchCliVersionPolicy()[_0x3e60e3(0x11f)](_0x2afc16=>{const _0x1c113c=_0x3e60e3;return cachedPolicy=_0x2afc16,cachedAt=Date[_0x1c113c(0x11d)](),hasCachedPolicy=!![],_0x2afc16;})[_0x3e60e3(0x11b)](()=>{pendingPolicy=null;}),pendingPolicy;}export function clearCliVersionPolicyCache(){cachedPolicy=null,cachedAt=0x0,hasCachedPolicy=![],pendingPolicy=null;}
|
package/lib/utils/logger.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a171_0x5a79c0=a171_0x3445;(function(_0x5303f9,_0x27b69c){const _0x1cae51=a171_0x3445,_0x10ebba=_0x5303f9();while(!![]){try{const _0x4cce3b=parseInt(_0x1cae51(0x18d))/0x1*(-parseInt(_0x1cae51(0x1b1))/0x2)+parseInt(_0x1cae51(0x1a2))/0x3*(parseInt(_0x1cae51(0x1c3))/0x4)+-parseInt(_0x1cae51(0x19e))/0x5*(parseInt(_0x1cae51(0x1bb))/0x6)+parseInt(_0x1cae51(0x1c2))/0x7+parseInt(_0x1cae51(0x1b5))/0x8+parseInt(_0x1cae51(0x1b8))/0x9+-parseInt(_0x1cae51(0x1b0))/0xa*(parseInt(_0x1cae51(0x199))/0xb);if(_0x4cce3b===_0x27b69c)break;else _0x10ebba['push'](_0x10ebba['shift']());}catch(_0x3768ee){_0x10ebba['push'](_0x10ebba['shift']());}}}(a171_0x3c9e,0x2ac39));function a171_0x3445(_0x23aa77,_0x22adf2){_0x23aa77=_0x23aa77-0x18c;const _0x3c9e55=a171_0x3c9e();let _0x344524=_0x3c9e55[_0x23aa77];return _0x344524;}function a171_0x3c9e(){const _0x43dbc9=['337HXlvLr','message','addColors','readFileSync','createLogger','transports','readLogs','Failed\x20to\x20read\x20logs:','mkdirSync','info','warn','now','72457YczbLu','utf8','File','red','clearLogs','36315hJafQz','command','level','Failed:\x20','3FHKihc','trim','filter','setRawCommand','blue','writeFileSync','currentRawCommand','error','initWinstonLogger','Completed:\x20','toISOString','getWinstonInstance','duration','format','740dtbtWN','1318WfMbRr','parse','logTask','map','1323040eXXUhS','yellow','success','2496240OvNtVn','winstonLogger','errors','36RRMtGE','Starting:\x20','Failed\x20to\x20clear\x20logs:','split','logFilePath','existsSync','green','1134441EfjImk','1293828mMTSXH','details','rawCommand','clear'];a171_0x3c9e=function(){return _0x43dbc9;};return a171_0x3c9e();}import a171_0x4549b5 from'winston';import a171_0x192475 from'node:fs';import a171_0x231a69 from'node:path';import{PRODUCT_CONFIG}from'../constant/product.js';class Logger{['winstonLogger'];[a171_0x5a79c0(0x1bf)]='';['currentRawCommand']='';constructor(){}[a171_0x5a79c0(0x1a5)](_0x3d096f){const _0x4f45ab=a171_0x5a79c0;this[_0x4f45ab(0x1a8)]=_0x3d096f;}['setLogPath'](_0x56d50e){const _0x49247a=a171_0x5a79c0;this[_0x49247a(0x1bf)]=a171_0x231a69['join'](_0x56d50e,PRODUCT_CONFIG['logFileName']),this[_0x49247a(0x1b9)]&&this[_0x49247a(0x1b9)][_0x49247a(0x18c)](),this[_0x49247a(0x1aa)]();}['initWinstonLogger'](){const _0x120455=a171_0x5a79c0,_0x2ca9e8=a171_0x231a69['dirname'](this[_0x120455(0x1bf)]);!a171_0x192475[_0x120455(0x1c0)](_0x2ca9e8)&&a171_0x192475[_0x120455(0x195)](_0x2ca9e8,{'recursive':!![]});const _0x3e623e=a171_0x4549b5['format']['combine'](a171_0x4549b5[_0x120455(0x1af)]['timestamp'](),a171_0x4549b5[_0x120455(0x1af)][_0x120455(0x1ba)]({'stack':!![]}),a171_0x4549b5[_0x120455(0x1af)]['printf'](_0x3610c6=>{const _0x432afe=_0x120455,_0x36fa81={'timestamp':_0x3610c6['timestamp']||new Date()[_0x432afe(0x1ac)](),'level':_0x3610c6[_0x432afe(0x1a0)]||_0x432afe(0x196),'command':_0x3610c6[_0x432afe(0x19f)]||'unknown','rawCommand':_0x3610c6[_0x432afe(0x1c5)]||this[_0x432afe(0x1a8)]||undefined,'message':_0x3610c6[_0x432afe(0x18e)]||'','duration':_0x3610c6[_0x432afe(0x1ae)]||undefined,'details':_0x3610c6[_0x432afe(0x1c4)]||undefined};return JSON['stringify'](_0x36fa81);}));this[_0x120455(0x1b9)]=a171_0x4549b5[_0x120455(0x191)]({'level':_0x120455(0x196),'format':_0x3e623e,'transports':[new a171_0x4549b5[(_0x120455(0x192))][(_0x120455(0x19b))]({'filename':this[_0x120455(0x1bf)],'level':'info'})],'silent':![]}),a171_0x4549b5[_0x120455(0x18f)]({'success':_0x120455(0x1c1),'error':_0x120455(0x19c),'warn':_0x120455(0x1b6),'info':_0x120455(0x1a6)});}['info'](_0x4ffed4,_0x45282d,_0x1495d4){const _0x49c6a3=a171_0x5a79c0;if(!this[_0x49c6a3(0x1bf)]||!this[_0x49c6a3(0x1b9)])return;this['winstonLogger'][_0x49c6a3(0x196)](_0x45282d,{'command':_0x4ffed4,'details':_0x1495d4});}[a171_0x5a79c0(0x1b7)](_0x47a050,_0x327a51,_0xe1f8eb,_0x2e7891){const _0x31e487=a171_0x5a79c0;if(!this[_0x31e487(0x1bf)]||!this[_0x31e487(0x1b9)])return;this[_0x31e487(0x1b9)]['log']('info',_0x327a51,{'level':_0x31e487(0x1b7),'command':_0x47a050,'duration':_0xe1f8eb,'details':_0x2e7891});}[a171_0x5a79c0(0x1a9)](_0x569fce,_0xe5d9f2,_0x23989a){const _0x45812c=a171_0x5a79c0;if(!this[_0x45812c(0x1bf)]||!this[_0x45812c(0x1b9)])return;this[_0x45812c(0x1b9)][_0x45812c(0x1a9)](_0xe5d9f2,{'command':_0x569fce,'details':_0x23989a});}[a171_0x5a79c0(0x197)](_0x4fe3b3,_0x295c43,_0x409462){const _0x5215a2=a171_0x5a79c0;if(!this[_0x5215a2(0x1bf)]||!this[_0x5215a2(0x1b9)])return;this[_0x5215a2(0x1b9)]['warn'](_0x295c43,{'command':_0x4fe3b3,'details':_0x409462});}async[a171_0x5a79c0(0x1b3)](_0x11ae87,_0x52013e,_0x44d053){const _0x12cba2=a171_0x5a79c0,_0x2f2c14=Date[_0x12cba2(0x198)]();this['info'](_0x11ae87,_0x12cba2(0x1bc)+_0x52013e);try{const _0x5e9068=await _0x44d053(),_0x1d4f5f=Date[_0x12cba2(0x198)]()-_0x2f2c14;return this[_0x12cba2(0x1b7)](_0x11ae87,_0x12cba2(0x1ab)+_0x52013e,_0x1d4f5f),_0x5e9068;}catch(_0x18598c){const _0x4b830f=Date[_0x12cba2(0x198)]()-_0x2f2c14;this[_0x12cba2(0x1a9)](_0x11ae87,_0x12cba2(0x1a1)+_0x52013e,{'error':_0x18598c instanceof Error?_0x18598c[_0x12cba2(0x18e)]:String(_0x18598c),'duration':_0x4b830f});throw _0x18598c;}}[a171_0x5a79c0(0x193)](){const _0x361325=a171_0x5a79c0;try{if(!a171_0x192475['existsSync'](this[_0x361325(0x1bf)]))return[];const _0x4cc32b=a171_0x192475[_0x361325(0x190)](this[_0x361325(0x1bf)],'utf8');return _0x4cc32b[_0x361325(0x1be)](/\r?\n/)[_0x361325(0x1a4)](_0x55af4b=>_0x55af4b[_0x361325(0x1a3)]())[_0x361325(0x1b4)](_0x2d5c29=>JSON[_0x361325(0x1b2)](_0x2d5c29));}catch(_0x2936e9){return console[_0x361325(0x197)](_0x361325(0x194),_0x2936e9),[];}}[a171_0x5a79c0(0x19d)](){const _0x38f96c=a171_0x5a79c0;try{a171_0x192475[_0x38f96c(0x1c0)](this[_0x38f96c(0x1bf)])&&a171_0x192475[_0x38f96c(0x1a7)](this[_0x38f96c(0x1bf)],'',_0x38f96c(0x19a));}catch(_0x150329){console['warn'](_0x38f96c(0x1bd),_0x150329);}}[a171_0x5a79c0(0x1ad)](){const _0x18932a=a171_0x5a79c0;return this[_0x18932a(0x1b9)];}}export const logger=new Logger();
|