@lovrabet/lovrabet-cli 2.3.6-beta.3 → 2.3.7-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -11
- package/lib/cli.js +1 -1
- package/lib/commands/api-doc/index.js +1 -1
- package/lib/commands/app/cache.js +1 -1
- package/lib/commands/app/definitions.js +1 -1
- package/lib/commands/app/eligibility.js +1 -1
- package/lib/commands/app/mock-loader.js +1 -1
- package/lib/commands/app/remote-source.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/approval/index.js +1 -1
- package/lib/commands/artifact/index.js +1 -1
- package/lib/commands/auth/device.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/auth/prompt.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/exec.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/common/config-policy.js +1 -1
- package/lib/commands/common/constraints.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/config/definitions.js +1 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/import-excel.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/sdk-doc.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/permit/dataset-get.js +1 -1
- package/lib/commands/permit/dataset-set.js +1 -1
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.js +1 -1
- package/lib/commands/personal-bff/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/schedule/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/service/dynamic.js +1 -1
- package/lib/commands/service/function-name-adapter.js +1 -1
- package/lib/commands/service/index.js +1 -1
- package/lib/commands/service/registry.js +1 -1
- package/lib/commands/skill/commands/create.js +1 -1
- package/lib/commands/skill/commands/diagram.js +1 -1
- package/lib/commands/skill/commands/install.js +1 -1
- package/lib/commands/skill/commands/list.js +1 -1
- package/lib/commands/skill/commands/push.js +1 -1
- package/lib/commands/skill/commands/validate.js +1 -1
- package/lib/commands/skill/diagram.js +1 -1
- package/lib/commands/skill/flags.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/skill/manifest-helpers.js +1 -1
- package/lib/commands/skill/push-execute.js +1 -1
- package/lib/commands/skill/push-flow-helpers.js +1 -1
- package/lib/commands/skill/push-retarget.js +1 -1
- package/lib/commands/skill/scopes.js +1 -1
- package/lib/commands/skill/summary.js +1 -1
- package/lib/commands/skill/templates.js +1 -1
- package/lib/commands/skill/validate.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/update.js +1 -1
- package/lib/commands/user-account/bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/config/domain-config.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/app.js +1 -1
- package/lib/constant/auth-mode.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/distribution.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/product.js +1 -1
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/api-client.d.ts +6 -6
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/kb-management-client.d.ts +5 -3
- package/lib/core/kb-management-client.js +1 -1
- package/lib/core/kb-search-client.d.ts +6 -1
- package/lib/core/kb-search-client.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/access-error.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/preparse.js +1 -1
- package/lib/framework/rate-limit.js +1 -1
- package/lib/framework/raw-flags.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-confirmation.js +1 -1
- package/lib/framework/runner-error.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/service-order.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/generated/official-routing.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/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/lovrabet/SKILL.md +2 -2
- package/skills/lovrabet/references/lovrabet-kb-workflow.md +9 -5
- package/skills/lovrabet.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x250f40,_0x4c1b53){const _0x170db7=a156_0x2b7d,_0x55aaca=_0x250f40();while(!![]){try{const _0x363785=-parseInt(_0x170db7(0xc7))/0x1*(parseInt(_0x170db7(0xa0))/0x2)+parseInt(_0x170db7(0xb4))/0x3+-parseInt(_0x170db7(0xaa))/0x4*(-parseInt(_0x170db7(0xb9))/0x5)+parseInt(_0x170db7(0xb7))/0x6+parseInt(_0x170db7(0xba))/0x7*(parseInt(_0x170db7(0x9d))/0x8)+-parseInt(_0x170db7(0xbb))/0x9*(-parseInt(_0x170db7(0xc0))/0xa)+-parseInt(_0x170db7(0x9e))/0xb;if(_0x363785===_0x4c1b53)break;else _0x55aaca['push'](_0x55aaca['shift']());}catch(_0x2ab8aa){_0x55aaca['push'](_0x55aaca['shift']());}}}(a156_0x1e70,0x85efa));import{readFileSync,readdirSync,realpathSync}from'node:fs';import{relative,resolve}from'node:path';import{CliErrors}from'../../errors.js';import{IGNORED_DIR_NAMES,IGNORED_FILE_NAMES,SKILL_FILE}from'./constants.js';export function fileContent(_0xfa2674){const _0x12760c=a156_0x2b7d;return _0xfa2674[_0x12760c(0xc6)]??Buffer[_0x12760c(0xa2)](_0xfa2674['content']??'',_0x12760c(0xc2));}function a156_0x2b7d(_0x2bac7,_0x3e88cd){_0x2bac7=_0x2bac7-0x9d;const _0x1e704a=a156_0x1e70();let _0x2b7d3e=_0x1e704a[_0x2bac7];return _0x2b7d3e;}export function fileText(_0x84ea72){const _0x2c3808=a156_0x2b7d;return fileContent(_0x84ea72)[_0x2c3808(0xa8)](_0x2c3808(0xc2));}export function normalizeLocalFiles(_0xce59b4){const _0x4bc3d4=a156_0x2b7d;if(!Array[_0x4bc3d4(0xad)](_0xce59b4)||_0xce59b4['length']===0x0)return[];const _0x50ec68=new Map();for(const _0x995d46 of _0xce59b4){if(!_0x995d46||typeof _0x995d46!==_0x4bc3d4(0xbe)||typeof _0x995d46['path']!==_0x4bc3d4(0xc3))throw CliErrors[_0x4bc3d4(0xbf)]('Skill\x20file\x20path\x20must\x20be\x20text.');const _0x2ffbac=normalizeSkillRelativePath(_0x995d46[_0x4bc3d4(0xb2)]);if(_0x50ec68['has'](_0x2ffbac))throw CliErrors['validation'](_0x4bc3d4(0xc8)+_0x2ffbac);if(_0x995d46['bytes']!==undefined&&!Buffer[_0x4bc3d4(0xb3)](_0x995d46['bytes']))throw CliErrors[_0x4bc3d4(0xbf)](_0x4bc3d4(0xc5)+_0x2ffbac);if(_0x995d46[_0x4bc3d4(0xc6)]===undefined&&typeof _0x995d46[_0x4bc3d4(0xb1)]!==_0x4bc3d4(0xc3))throw CliErrors['validation'](_0x4bc3d4(0xae)+_0x2ffbac);const _0x395dbd=fileContent(_0x995d46);_0x50ec68[_0x4bc3d4(0xa4)](_0x2ffbac,{'path':_0x2ffbac,'bytes':_0x395dbd});}return Array[_0x4bc3d4(0xa2)](_0x50ec68[_0x4bc3d4(0x9f)]())['sort'](compareSkillFiles);}export function normalizeManifestFiles(_0x30d313){const _0x4060a0=a156_0x2b7d;if(!Array['isArray'](_0x30d313)||_0x30d313[_0x4060a0(0xa5)]===0x0)return[];const _0x36efaa=new Map();for(const _0x227ee4 of _0x30d313){if(!_0x227ee4||typeof _0x227ee4!=='object'||typeof _0x227ee4[_0x4060a0(0xb2)]!==_0x4060a0(0xc3))throw CliErrors[_0x4060a0(0xbf)](_0x4060a0(0xa7));const _0x7224b4=normalizeSkillRelativePath(_0x227ee4[_0x4060a0(0xb2)]);if(_0x36efaa[_0x4060a0(0xb8)](_0x7224b4))throw CliErrors[_0x4060a0(0xbf)](_0x4060a0(0xc8)+_0x7224b4);if(!isSha256Hex(_0x227ee4[_0x4060a0(0xbc)]))throw CliErrors[_0x4060a0(0xbf)](_0x4060a0(0xc1)+_0x7224b4);if(!Number['isSafeInteger'](_0x227ee4[_0x4060a0(0xa1)])||_0x227ee4['size']<0x0)throw CliErrors[_0x4060a0(0xbf)](_0x4060a0(0xc4)+_0x7224b4);_0x36efaa[_0x4060a0(0xa4)](_0x7224b4,{'path':_0x7224b4,'sha256':_0x227ee4[_0x4060a0(0xbc)][_0x4060a0(0xb6)](),'size':_0x227ee4[_0x4060a0(0xa1)]});}return Array[_0x4060a0(0xa2)](_0x36efaa['values']())['sort'](compareSkillFiles);}function a156_0x1e70(){const _0x261823=['Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20','localeCompare','add','content','path','isBuffer','2287059diEDHq','Unsafe\x20Skill\x20file\x20path:\x20','toLowerCase','670872zfDbsS','has','785gNSEKr','7LOzVUQ','9855qismgB','sha256','Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20','object','validation','3430EetXJE','Skill\x20file\x20sha256\x20is\x20invalid:\x20','utf8','string','Skill\x20file\x20size\x20is\x20invalid:\x20','Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20','bytes','7379PZzAWD','Duplicate\x20Skill\x20file\x20path:\x20','excludedFilePaths','test','push','845464XIBTzR','12736713COztBh','values','118aXYRfK','size','from','isDirectory','set','length','startsWith','Skill\x20file\x20path\x20must\x20be\x20text.','toString','replace','20036epJHyd','trim','name','isArray'];a156_0x1e70=function(){return _0x261823;};return a156_0x1e70();}export function scanSkillDirectory(_0x4522b5,_0x50f138={}){const _0x29edc9=a156_0x2b7d,_0xe165c3=realpathSync(_0x4522b5),_0x19ffc5=canonicalExcludedFilePaths(_0x50f138[_0x29edc9(0xc9)]),_0x30083d=[];function _0x59bb6f(_0x23f71f){const _0x10b2f8=_0x29edc9,_0x24b369=readdirSync(_0x23f71f,{'withFileTypes':!![]})['sort']((_0x2cd67b,_0x540379)=>_0x2cd67b[_0x10b2f8(0xac)][_0x10b2f8(0xaf)](_0x540379['name']));for(const _0x1853b7 of _0x24b369){if(_0x1853b7['isDirectory']()&&IGNORED_DIR_NAMES['has'](_0x1853b7[_0x10b2f8(0xac)]))continue;if(IGNORED_FILE_NAMES[_0x10b2f8(0xb8)](_0x1853b7[_0x10b2f8(0xac)]))continue;const _0x13dafd=resolve(_0x23f71f,_0x1853b7[_0x10b2f8(0xac)]);if(isExcludedFilePath(_0x13dafd,_0x19ffc5))continue;if(_0x1853b7['isSymbolicLink']())throw CliErrors[_0x10b2f8(0xbf)](_0x10b2f8(0xbd)+_0x13dafd);const _0x1879f0=toPosixPath(relative(_0xe165c3,_0x13dafd));if(_0x1853b7[_0x10b2f8(0xa3)]()){_0x59bb6f(_0x13dafd);continue;}if(!_0x1853b7['isFile']())continue;validateSkillRelativePath(_0x1879f0);const _0x56e5e0=readFileSync(_0x13dafd);_0x30083d[_0x10b2f8(0xcb)]({'path':_0x1879f0,'bytes':_0x56e5e0});}}return _0x59bb6f(_0xe165c3),normalizeLocalFiles(_0x30083d);}function canonicalExcludedFilePaths(_0x1e8690){const _0x16987d=a156_0x2b7d,_0x1ab695=new Set();for(const _0x2c48d7 of _0x1e8690??[]){const _0x2e0091=resolve(_0x2c48d7);_0x1ab695[_0x16987d(0xb0)](_0x2e0091);try{_0x1ab695[_0x16987d(0xb0)](realpathSync(_0x2e0091));}catch{}}return _0x1ab695;}function isExcludedFilePath(_0xa6e8ff,_0x26b6ad){const _0x4d7497=a156_0x2b7d;if(_0x26b6ad[_0x4d7497(0xb8)](_0xa6e8ff))return!![];if(_0x26b6ad[_0x4d7497(0xa1)]===0x0)return![];try{return _0x26b6ad[_0x4d7497(0xb8)](realpathSync(_0xa6e8ff));}catch{return![];}}export function compareSkillFiles(_0x14ede1,_0x4a0701){const _0x361dfe=a156_0x2b7d;if(_0x14ede1[_0x361dfe(0xb2)]===SKILL_FILE)return _0x4a0701['path']===SKILL_FILE?0x0:-0x1;if(_0x4a0701[_0x361dfe(0xb2)]===SKILL_FILE)return 0x1;return Buffer['compare'](Buffer[_0x361dfe(0xa2)](_0x14ede1[_0x361dfe(0xb2)],_0x361dfe(0xc2)),Buffer['from'](_0x4a0701[_0x361dfe(0xb2)],'utf8'));}export function normalizeSkillRelativePath(_0x66f87c){const _0x5eddae=a156_0x2b7d,_0x3a9609=toPosixPath(_0x66f87c[_0x5eddae(0xab)]());return validateSkillRelativePath(_0x3a9609),_0x3a9609;}export function validateSkillRelativePath(_0x3ca81b){const _0x2608ff=a156_0x2b7d;if(!_0x3ca81b||_0x3ca81b[_0x2608ff(0xa6)]('/')||_0x3ca81b['includes']('//'))throw CliErrors[_0x2608ff(0xbf)](_0x2608ff(0xb5)+_0x3ca81b);for(const _0x375e85 of _0x3ca81b['split']('/')){if(!_0x375e85||_0x375e85==='.'||_0x375e85==='..')throw CliErrors['validation'](_0x2608ff(0xb5)+_0x3ca81b);}}export function toPosixPath(_0x1516f){const _0x4ea3c2=a156_0x2b7d;return _0x1516f[_0x4ea3c2(0xa9)](/\\/g,'/');}export function isSha256Hex(_0x3329eb){const _0x3ff863=a156_0x2b7d;return typeof _0x3329eb===_0x3ff863(0xc3)&&/^[a-fA-F0-9]{64}$/[_0x3ff863(0xca)](_0x3329eb);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x13fe32,_0x464234){const _0xfced55=a157_0x482f,_0x19818b=_0x13fe32();while(!![]){try{const _0x2b2c27=-parseInt(_0xfced55(0x97))/0x1+parseInt(_0xfced55(0xa0))/0x2+-parseInt(_0xfced55(0x79))/0x3+parseInt(_0xfced55(0x7f))/0x4+parseInt(_0xfced55(0x8e))/0x5*(parseInt(_0xfced55(0x88))/0x6)+parseInt(_0xfced55(0xa7))/0x7*(-parseInt(_0xfced55(0xa2))/0x8)+parseInt(_0xfced55(0x8a))/0x9*(parseInt(_0xfced55(0x96))/0xa);if(_0x2b2c27===_0x464234)break;else _0x19818b['push'](_0x19818b['shift']());}catch(_0xfbe954){_0x19818b['push'](_0x19818b['shift']());}}}(a157_0x29bd,0x57eba));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';function a157_0x482f(_0x5abea9,_0x3ac3c3){_0x5abea9=_0x5abea9-0x72;const _0x29bdf1=a157_0x29bd();let _0x482fde=_0x29bdf1[_0x5abea9];return _0x482fde;}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';function a157_0x29bd(){const _0x23ac5c=['displayName','936XvTPcz','map','trim','displayName:\x20','schemaVersion','28007woEAkX','has','flow','.\x20Changed\x20file:\x20','skillCode','paths','validation','description','hasOwn','trimEnd','contents','path','1781907sSIetc','set','toString','appCode','length','name','2488640BdSHOb','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','description:\x20','Runtime\x20Skill\x20package\x20is\x20missing\x20','delete','contentHash','isFile','utf8','1051692LxapkI','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','9fvWggq','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','\x0a---\x0a\x0a','skillName','5EzkUqS','env','errors','keys','packageBytes','filter','find','join','6266710hPRxyL','585215iKmRHI','version','example','pulledAt','scope','fileHashes','status','entries','---','1166620ASBMPI'];a157_0x29bd=function(){return _0x23ac5c;};return a157_0x29bd();}export function materializeRuntimeSkill(_0x580078,_0x816b62,_0x45a53c){const _0x3f9d80=a157_0x482f,_0x417c72=requireSkillCode(_0x580078),_0x26515e=requirePackageBytes(_0x417c72,_0x45a53c[_0x3f9d80(0x92)]),_0x400325=extractDownloadedPackage(_0x26515e),_0x1f8f60=_0x400325[_0x3f9d80(0x94)](_0x270160=>_0x270160[_0x3f9d80(0x78)]===SKILL_FILE);if(!_0x1f8f60)throw CliErrors[_0x3f9d80(0x73)](_0x3f9d80(0x83)+SKILL_FILE+':\x20'+_0x417c72);const _0x7eb0e=withMaterializedSkillFrontmatter(_0x400325,_0x580078,_0x417c72),_0x20aace=_0x7eb0e['find'](_0x467889=>_0x467889[_0x3f9d80(0x78)]===SKILL_FILE),_0x385682=fileText(_0x20aace),_0x10a959=getRuntimeSkillDir(_0x45a53c[_0x3f9d80(0x8f)],_0x45a53c['accessKey'],_0x45a53c['appCode'],_0x816b62,_0x417c72,_0x45a53c['paths']),_0x43f324=resolve(_0x10a959,SKILL_FILE),_0x56a550=resolve(_0x10a959,METADATA_FILE),_0xfd98e6=contentHash(_0x385682),_0x32f1e7=readMetadataIfPresent(_0x56a550)?.[_0x3f9d80(0x9c)];ensurePulledFilesCanBeOverwritten(_0x10a959,_0x56a550,_0x7eb0e,_0x45a53c['force']===!![]),mkdirSync(_0x10a959,{'recursive':!![],'mode':0x1c0});const _0x3f10c=existsSync(_0x43f324)?readFileSync(_0x43f324,_0x3f9d80(0x87)):undefined;return materializeFiles(_0x10a959,_0x7eb0e),removeStaleManagedFiles(_0x10a959,_0x32f1e7,_0x7eb0e),writeJsonAtomic(_0x56a550,buildMetadata(_0x580078,_0x816b62,_0x45a53c[_0x3f9d80(0x7c)],_0xfd98e6,_0x45a53c[_0x3f9d80(0x9a)],_0x7eb0e,_0x26515e)),{'skill':_0x580078,'scope':_0x816b62,'dir':_0x10a959,'skillMdPath':_0x43f324,'metadataPath':_0x56a550,'contentHash':_0xfd98e6,'changed':_0x3f10c!==_0x385682};}export function reuseMaterializedRuntimeSkill(_0x2635d2,_0x383221,_0x5561b6){const _0x1ed846=a157_0x482f,_0x1dbc8d=_0x2635d2[_0x1ed846(0x98)]?.[_0x1ed846(0xa4)]();if(!_0x1dbc8d)return undefined;const _0x24c9f0=requireSkillCode(_0x2635d2),_0x8c3e37=getRuntimeSkillDir(_0x5561b6[_0x1ed846(0x8f)],_0x5561b6['accessKey'],_0x5561b6[_0x1ed846(0x7c)],_0x383221,_0x24c9f0,_0x5561b6[_0x1ed846(0x72)]),_0x57b02e=resolve(_0x8c3e37,SKILL_FILE),_0xb99b17=resolve(_0x8c3e37,METADATA_FILE),_0x1713f6=readMetadataIfPresent(_0xb99b17);if(!_0x1713f6||_0x1713f6[_0x1ed846(0xa6)]!==0x2||_0x1713f6[_0x1ed846(0x7c)]!==_0x5561b6['appCode']||_0x1713f6[_0x1ed846(0x9b)]!==_0x383221||_0x1713f6[_0x1ed846(0xab)]!==_0x24c9f0||_0x1713f6[_0x1ed846(0x98)]!==_0x1dbc8d||_0x1713f6['id']!==_0x2635d2['id']||_0x1713f6[_0x1ed846(0x8d)]!==_0x2635d2['skillName']||_0x1713f6[_0x1ed846(0x74)]!==_0x2635d2['description']||_0x1713f6[_0x1ed846(0x99)]!==_0x2635d2[_0x1ed846(0x99)]||_0x1713f6[_0x1ed846(0x9d)]!==_0x2635d2['status']||!_0x1713f6[_0x1ed846(0x85)]||!_0x1713f6[_0x1ed846(0x9c)]||!Object[_0x1ed846(0x75)](_0x1713f6['fileHashes'],SKILL_FILE))return undefined;for(const [_0x169369,_0xbf5757]of Object['entries'](_0x1713f6[_0x1ed846(0x9c)])){if(!/^[a-f0-9]{64}$/['test'](_0xbf5757))return undefined;const _0x483864=resolveManagedFilePath(_0x8c3e37,_0x169369);if(!existsSync(_0x483864)||!lstatSync(_0x483864)[_0x1ed846(0x86)]())return undefined;if(bufferSha256(readFileSync(_0x483864))!==_0xbf5757)return undefined;}return{'skill':_0x2635d2,'scope':_0x383221,'dir':_0x8c3e37,'skillMdPath':_0x57b02e,'metadataPath':_0xb99b17,'contentHash':_0x1713f6['contentHash'],'changed':![]};}function withMaterializedSkillFrontmatter(_0x4307fe,_0x489535,_0x4acc06){const _0xa477ac=a157_0x482f,_0x5e99db=skillDisplayName(_0x489535,_0x4acc06),_0x4061f7=_0x489535[_0xa477ac(0x74)]?.['trim']()||_0x5e99db||_0x4acc06;return normalizeLocalFiles(_0x4307fe)['map'](_0x30f86f=>{const _0x848609=_0xa477ac,_0x20dc34=fileText(_0x30f86f);if(_0x30f86f['path']!==SKILL_FILE)return _0x30f86f;if(hasYamlFrontmatter(_0x20dc34))return{'path':_0x30f86f[_0x848609(0x78)],'content':withSyncedDisplayName(_0x20dc34,_0x5e99db)};return{'path':_0x30f86f[_0x848609(0x78)],'content':prependSkillFrontmatter(_0x20dc34,{'name':_0x4acc06,'displayName':_0x5e99db,'description':_0x4061f7})};});}function hasYamlFrontmatter(_0x3061b2){return/^\uFEFF?---\s*\r?\n/['test'](_0x3061b2);}function prependSkillFrontmatter(_0x1a2fee,_0x2a221d){const _0x3d131d=a157_0x482f,_0x13e24f=_0x1a2fee['replace'](/^\uFEFF/,'');return[_0x3d131d(0x9f),'name:\x20'+yamlString(_0x2a221d[_0x3d131d(0x7e)]),_0x2a221d[_0x3d131d(0xa1)]?_0x3d131d(0xa5)+yamlString(_0x2a221d[_0x3d131d(0xa1)]):undefined,_0x3d131d(0x82)+yamlString(_0x2a221d[_0x3d131d(0x74)]),'---','',_0x13e24f][_0x3d131d(0x93)](_0x9709c5=>_0x9709c5!==undefined)[_0x3d131d(0x95)]('\x0a');}function yamlString(_0x495d71){return JSON['stringify'](_0x495d71['replace'](/\r/g,'')['trim']());}function skillDisplayName(_0x28dd60,_0x8a8e3d){const _0x2ca564=_0x28dd60['skillName']?.['trim']();return _0x2ca564||_0x8a8e3d;}function withSyncedDisplayName(_0x1f27c3,_0x1ca207){const _0x260e38=a157_0x482f,_0x184c9f=_0x1f27c3['match'](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x184c9f)return _0x1f27c3;const _0x2341a0=_0x184c9f[0x1]??'',_0x5ccef0=_0x184c9f[0x2]??'',_0x192574=parseDocument(_0x5ccef0);if(_0x192574[_0x260e38(0x90)][_0x260e38(0x7d)]>0x0||!isMap(_0x192574[_0x260e38(0x77)]))return _0x1f27c3;if(_0x1ca207)_0x192574[_0x260e38(0x7a)](_0x260e38(0xa1),_0x1ca207);else{if(_0x192574[_0x260e38(0xa8)](_0x260e38(0xa1)))_0x192574[_0x260e38(0x84)]('displayName');else return _0x1f27c3;}forceBlockCollections(_0x192574['contents']);const _0x4612a7=_0x192574[_0x260e38(0x7b)]({'lineWidth':0x0})[_0x260e38(0x76)](),_0x56b0e8=_0x1f27c3['slice'](_0x184c9f[0x0][_0x260e38(0x7d)])['replace'](/^\r?\n/,'');return _0x2341a0+'---\x0a'+_0x4612a7+_0x260e38(0x8c)+_0x56b0e8;}function forceBlockCollections(_0x381ee6){if(!isNode(_0x381ee6))return;visit(_0x381ee6,(_0x1d30ef,_0x2c137a)=>{const _0x3ebdb7=a157_0x482f;isCollection(_0x2c137a)&&(_0x2c137a[_0x3ebdb7(0xa9)]=![]);});}function ensurePulledFilesCanBeOverwritten(_0x14afde,_0x344aeb,_0x4305da,_0x2976f8){const _0x44344b=a157_0x482f;if(_0x2976f8||!existsSync(_0x344aeb))return;const _0x42e39d=readMetadataIfPresent(_0x344aeb);if(!_0x42e39d)return;const _0x20f56d=_0x42e39d[_0x44344b(0x9c)]&&Object[_0x44344b(0x91)](_0x42e39d['fileHashes'])['length']>0x0?_0x42e39d[_0x44344b(0x9c)]:undefined;if(_0x20f56d)for(const [_0x23657f,_0x483ee9]of Object[_0x44344b(0x9e)](_0x20f56d)){const _0x20de67=resolveManagedFilePath(_0x14afde,_0x23657f);if(!existsSync(_0x20de67))throw CliErrors[_0x44344b(0x73)](_0x44344b(0x8b)+_0x14afde,'Managed\x20file\x20was\x20removed\x20locally:\x20'+_0x23657f);const _0x4c5bdc=lstatSync(_0x20de67);if(!_0x4c5bdc[_0x44344b(0x86)]())throw CliErrors[_0x44344b(0x73)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x14afde,'Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20'+_0x23657f);const _0x546364=bufferSha256(readFileSync(_0x20de67));if(_0x546364!==_0x483ee9)throw CliErrors['validation']('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x14afde+_0x44344b(0xaa)+_0x23657f,_0x44344b(0x81)+_0x23657f);}else{const _0x5a3ec1=resolve(_0x14afde,SKILL_FILE);if(existsSync(_0x5a3ec1)&&_0x42e39d[_0x44344b(0x85)]){const _0x575a40=contentHash(readFileSync(_0x5a3ec1,_0x44344b(0x87)));if(_0x575a40!==_0x42e39d[_0x44344b(0x85)])throw CliErrors[_0x44344b(0x73)](_0x44344b(0x80)+_0x5a3ec1,'Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.');}}for(const _0x30c093 of normalizeLocalFiles(_0x4305da)){if(_0x20f56d?.[_0x30c093[_0x44344b(0x78)]])continue;if(!_0x20f56d&&_0x30c093[_0x44344b(0x78)]===SKILL_FILE)continue;const _0x4fec02=resolveManagedFilePath(_0x14afde,_0x30c093[_0x44344b(0x78)]);if(!existsSync(_0x4fec02))continue;const _0x6a64a0=lstatSync(_0x4fec02);if(!_0x6a64a0['isFile']())throw CliErrors['validation'](_0x44344b(0x8b)+_0x14afde,_0x44344b(0x89)+_0x30c093[_0x44344b(0x78)]);const _0x1050ee=bufferSha256(readFileSync(_0x4fec02));if(_0x1050ee!==fileHash(_0x30c093))throw CliErrors[_0x44344b(0x73)](_0x44344b(0x8b)+_0x14afde,'Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20'+_0x30c093[_0x44344b(0x78)]);}}function materializeFiles(_0x206afa,_0x4cc908){const _0x44be1d=a157_0x482f;for(const _0x341df5 of normalizeLocalFiles(_0x4cc908)){const _0x567631=resolveManagedFilePath(_0x206afa,_0x341df5[_0x44be1d(0x78)]);mkdirSync(dirname(_0x567631),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x567631,fileContent(_0x341df5),0x180);}}function removeStaleManagedFiles(_0x184027,_0x3175e4,_0xdee6e9){const _0x5e0080=a157_0x482f;if(!_0x3175e4)return;const _0x3f631a=new Set(normalizeLocalFiles(_0xdee6e9)[_0x5e0080(0xa3)](_0x3dab6d=>_0x3dab6d[_0x5e0080(0x78)]));for(const _0xd0a7ff of Object['keys'](_0x3175e4)){if(_0x3f631a['has'](_0xd0a7ff))continue;const _0x9fa248=resolveManagedFilePath(_0x184027,_0xd0a7ff);existsSync(_0x9fa248)&&lstatSync(_0x9fa248)['isFile']()&&rmSync(_0x9fa248,{'force':!![]});}}
|
|
1
|
+
(function(_0x29e779,_0x2b7616){const _0x5e7bf2=a157_0x26d0,_0x5c3b1c=_0x29e779();while(!![]){try{const _0x2357b1=parseInt(_0x5e7bf2(0x84))/0x1+parseInt(_0x5e7bf2(0x83))/0x2+-parseInt(_0x5e7bf2(0x9a))/0x3*(parseInt(_0x5e7bf2(0x7c))/0x4)+parseInt(_0x5e7bf2(0x6e))/0x5*(-parseInt(_0x5e7bf2(0xa6))/0x6)+-parseInt(_0x5e7bf2(0x72))/0x7*(parseInt(_0x5e7bf2(0x8d))/0x8)+-parseInt(_0x5e7bf2(0xa7))/0x9+parseInt(_0x5e7bf2(0x87))/0xa*(parseInt(_0x5e7bf2(0x7a))/0xb);if(_0x2357b1===_0x2b7616)break;else _0x5c3b1c['push'](_0x5c3b1c['shift']());}catch(_0x1b5a8a){_0x5c3b1c['push'](_0x5c3b1c['shift']());}}}(a157_0x427d,0xa5058));function a157_0x26d0(_0x1b17e0,_0x1de80b){_0x1b17e0=_0x1b17e0-0x6c;const _0x427d2a=a157_0x427d();let _0x26d02b=_0x427d2a[_0x1b17e0];return _0x26d02b;}import{existsSync,lstatSync,mkdirSync,readFileSync,rmSync}from'node:fs';import{dirname,resolve}from'node:path';import{isCollection,isMap,isNode,parseDocument,visit}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{resolveManagedFilePath,writeBytesAtomic,writeJsonAtomic}from'./fs-utils.js';import{bufferSha256,contentHash,fileHash}from'./hashing.js';import{fileContent,fileText,normalizeLocalFiles}from'./local-files.js';import{buildMetadata,readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillDir}from'./paths.js';import{extractDownloadedPackage,requirePackageBytes}from'./zip-package.js';export function materializeRuntimeSkill(_0x3e90f5,_0x3bc6e7,_0x3547a2){const _0x1c716d=a157_0x26d0,_0x133b42=requireSkillCode(_0x3e90f5),_0xd4bec1=requirePackageBytes(_0x133b42,_0x3547a2[_0x1c716d(0x88)]),_0xc90479=extractDownloadedPackage(_0xd4bec1),_0x42dd78=_0xc90479['find'](_0x148e36=>_0x148e36[_0x1c716d(0x98)]===SKILL_FILE);if(!_0x42dd78)throw CliErrors[_0x1c716d(0x92)]('Runtime\x20Skill\x20package\x20is\x20missing\x20'+SKILL_FILE+':\x20'+_0x133b42);const _0x3cc11a=withMaterializedSkillFrontmatter(_0xc90479,_0x3e90f5,_0x133b42),_0x2cc7df=_0x3cc11a[_0x1c716d(0xaa)](_0x58e9eb=>_0x58e9eb[_0x1c716d(0x98)]===SKILL_FILE),_0x3303d4=fileText(_0x2cc7df),_0x3a2b8e=getRuntimeSkillDir(_0x3547a2[_0x1c716d(0x9f)],_0x3547a2[_0x1c716d(0x95)],_0x3547a2[_0x1c716d(0xa1)],_0x3bc6e7,_0x133b42,_0x3547a2[_0x1c716d(0x7d)]),_0x833da2=resolve(_0x3a2b8e,SKILL_FILE),_0x59a2ce=resolve(_0x3a2b8e,METADATA_FILE),_0x3065f8=contentHash(_0x3303d4),_0x20ca18=readMetadataIfPresent(_0x59a2ce)?.['fileHashes'];ensurePulledFilesCanBeOverwritten(_0x3a2b8e,_0x59a2ce,_0x3cc11a,_0x3547a2[_0x1c716d(0x6d)]===!![]),mkdirSync(_0x3a2b8e,{'recursive':!![],'mode':0x1c0});const _0x483eed=existsSync(_0x833da2)?readFileSync(_0x833da2,_0x1c716d(0x76)):undefined;return materializeFiles(_0x3a2b8e,_0x3cc11a),removeStaleManagedFiles(_0x3a2b8e,_0x20ca18,_0x3cc11a),writeJsonAtomic(_0x59a2ce,buildMetadata(_0x3e90f5,_0x3bc6e7,_0x3547a2[_0x1c716d(0xa1)],_0x3065f8,_0x3547a2[_0x1c716d(0x93)],_0x3cc11a,_0xd4bec1)),{'skill':_0x3e90f5,'scope':_0x3bc6e7,'dir':_0x3a2b8e,'skillMdPath':_0x833da2,'metadataPath':_0x59a2ce,'contentHash':_0x3065f8,'changed':_0x483eed!==_0x3303d4};}export function reuseMaterializedRuntimeSkill(_0x9dd935,_0x323adc,_0x42c08d){const _0x3fb132=a157_0x26d0,_0x2643fd=_0x9dd935['version']?.[_0x3fb132(0xa9)]();if(!_0x2643fd)return undefined;const _0x28418b=requireSkillCode(_0x9dd935),_0x263efd=getRuntimeSkillDir(_0x42c08d['env'],_0x42c08d[_0x3fb132(0x95)],_0x42c08d[_0x3fb132(0xa1)],_0x323adc,_0x28418b,_0x42c08d['paths']),_0x56c664=resolve(_0x263efd,SKILL_FILE),_0x539b2e=resolve(_0x263efd,METADATA_FILE),_0x4aa1ae=readMetadataIfPresent(_0x539b2e);if(!_0x4aa1ae||_0x4aa1ae[_0x3fb132(0x7e)]!==0x2||_0x4aa1ae[_0x3fb132(0xa1)]!==_0x42c08d[_0x3fb132(0xa1)]||_0x4aa1ae[_0x3fb132(0x78)]!==_0x323adc||_0x4aa1ae[_0x3fb132(0x9c)]!==_0x28418b||_0x4aa1ae[_0x3fb132(0x8a)]!==_0x2643fd||_0x4aa1ae['id']!==_0x9dd935['id']||_0x4aa1ae[_0x3fb132(0x77)]!==_0x9dd935['skillName']||_0x4aa1ae['description']!==_0x9dd935['description']||_0x4aa1ae[_0x3fb132(0xa0)]!==_0x9dd935[_0x3fb132(0xa0)]||_0x4aa1ae[_0x3fb132(0xa8)]!==_0x9dd935['status']||!_0x4aa1ae['contentHash']||!_0x4aa1ae['fileHashes']||!Object[_0x3fb132(0x86)](_0x4aa1ae['fileHashes'],SKILL_FILE))return undefined;for(const [_0x3be0c5,_0x3ffa7a]of Object[_0x3fb132(0x8f)](_0x4aa1ae[_0x3fb132(0x9b)])){if(!/^[a-f0-9]{64}$/[_0x3fb132(0x6c)](_0x3ffa7a))return undefined;const _0x5a559e=resolveManagedFilePath(_0x263efd,_0x3be0c5);if(!existsSync(_0x5a559e)||!lstatSync(_0x5a559e)[_0x3fb132(0x9d)]())return undefined;if(bufferSha256(readFileSync(_0x5a559e))!==_0x3ffa7a)return undefined;}return{'skill':_0x9dd935,'scope':_0x323adc,'dir':_0x263efd,'skillMdPath':_0x56c664,'metadataPath':_0x539b2e,'contentHash':_0x4aa1ae['contentHash'],'changed':![]};}function withMaterializedSkillFrontmatter(_0x1f9b0f,_0x176ac0,_0xa95b25){const _0x42609f=a157_0x26d0,_0x4ced70=skillDisplayName(_0x176ac0,_0xa95b25),_0x5a5daf=_0x176ac0[_0x42609f(0x71)]?.[_0x42609f(0xa9)]()||_0x4ced70||_0xa95b25;return normalizeLocalFiles(_0x1f9b0f)[_0x42609f(0x80)](_0x4863d3=>{const _0x1bf566=_0x42609f,_0x4bc82c=fileText(_0x4863d3);if(_0x4863d3['path']!==SKILL_FILE)return _0x4863d3;if(hasYamlFrontmatter(_0x4bc82c))return{'path':_0x4863d3[_0x1bf566(0x98)],'content':withSyncedDisplayName(_0x4bc82c,_0x4ced70)};return{'path':_0x4863d3[_0x1bf566(0x98)],'content':prependSkillFrontmatter(_0x4bc82c,{'name':_0xa95b25,'displayName':_0x4ced70,'description':_0x5a5daf})};});}function hasYamlFrontmatter(_0x1dfd66){const _0x26103f=a157_0x26d0;return/^\uFEFF?---\s*\r?\n/[_0x26103f(0x6c)](_0x1dfd66);}function prependSkillFrontmatter(_0x1164aa,_0x1880e4){const _0x1a9f96=a157_0x26d0,_0x505fef=_0x1164aa['replace'](/^\uFEFF/,'');return['---',_0x1a9f96(0xa2)+yamlString(_0x1880e4[_0x1a9f96(0x8c)]),_0x1880e4['displayName']?_0x1a9f96(0x94)+yamlString(_0x1880e4[_0x1a9f96(0x7b)]):undefined,'description:\x20'+yamlString(_0x1880e4[_0x1a9f96(0x71)]),'---','',_0x505fef]['filter'](_0x17eb76=>_0x17eb76!==undefined)[_0x1a9f96(0x85)]('\x0a');}function yamlString(_0x5736c5){const _0x5ea58f=a157_0x26d0;return JSON[_0x5ea58f(0xa5)](_0x5736c5[_0x5ea58f(0xa3)](/\r/g,'')[_0x5ea58f(0xa9)]());}function skillDisplayName(_0x165bdc,_0x168b6a){const _0x290246=a157_0x26d0,_0x4e1a0d=_0x165bdc[_0x290246(0x77)]?.[_0x290246(0xa9)]();return _0x4e1a0d||_0x168b6a;}function a157_0x427d(){const _0x138fdf=['scope','flow','11bpztjj','displayName','8zdwRtk','paths','schemaVersion','slice','map','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','2577016RLrcWd','257337rhHayh','join','hasOwn','23336170fDNJfO','packageBytes','Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20','version','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','name','57736qpfoYi','match','entries','length','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','validation','pulledAt','displayName:\x20','accessKey','delete','has','path','---\x0a','1702803xlCxqE','fileHashes','skillCode','isFile','\x0a---\x0a\x0a','env','example','appCode','name:\x20','replace','trimEnd','stringify','6iNtmmw','7721568AGWZFq','status','trim','find','test','force','2551655maQrgd','Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','description','679mkgnOi','contentHash','keys','toString','utf8','skillName'];a157_0x427d=function(){return _0x138fdf;};return a157_0x427d();}function withSyncedDisplayName(_0x563a15,_0x4a5361){const _0x3f87dc=a157_0x26d0,_0x5c727c=_0x563a15[_0x3f87dc(0x8e)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x5c727c)return _0x563a15;const _0x4cad3c=_0x5c727c[0x1]??'',_0x51f16c=_0x5c727c[0x2]??'',_0x16c314=parseDocument(_0x51f16c);if(_0x16c314['errors'][_0x3f87dc(0x90)]>0x0||!isMap(_0x16c314['contents']))return _0x563a15;if(_0x4a5361)_0x16c314['set'](_0x3f87dc(0x7b),_0x4a5361);else{if(_0x16c314[_0x3f87dc(0x97)]('displayName'))_0x16c314[_0x3f87dc(0x96)]('displayName');else return _0x563a15;}forceBlockCollections(_0x16c314['contents']);const _0x3e7bc0=_0x16c314[_0x3f87dc(0x75)]({'lineWidth':0x0})[_0x3f87dc(0xa4)](),_0x225c45=_0x563a15[_0x3f87dc(0x7f)](_0x5c727c[0x0][_0x3f87dc(0x90)])['replace'](/^\r?\n/,'');return _0x4cad3c+_0x3f87dc(0x99)+_0x3e7bc0+_0x3f87dc(0x9e)+_0x225c45;}function forceBlockCollections(_0x15a499){if(!isNode(_0x15a499))return;visit(_0x15a499,(_0x41f0ce,_0x5911a6)=>{const _0x3e5500=a157_0x26d0;isCollection(_0x5911a6)&&(_0x5911a6[_0x3e5500(0x79)]=![]);});}function ensurePulledFilesCanBeOverwritten(_0x48b04b,_0x45692b,_0x3fd56a,_0x52246c){const _0x39741e=a157_0x26d0;if(_0x52246c||!existsSync(_0x45692b))return;const _0x4f73af=readMetadataIfPresent(_0x45692b);if(!_0x4f73af)return;const _0x13753a=_0x4f73af['fileHashes']&&Object[_0x39741e(0x74)](_0x4f73af[_0x39741e(0x9b)])[_0x39741e(0x90)]>0x0?_0x4f73af[_0x39741e(0x9b)]:undefined;if(_0x13753a)for(const [_0x1a07b8,_0x3093b2]of Object[_0x39741e(0x8f)](_0x13753a)){const _0x6b1c72=resolveManagedFilePath(_0x48b04b,_0x1a07b8);if(!existsSync(_0x6b1c72))throw CliErrors[_0x39741e(0x92)](_0x39741e(0x82)+_0x48b04b,'Managed\x20file\x20was\x20removed\x20locally:\x20'+_0x1a07b8);const _0x104a0f=lstatSync(_0x6b1c72);if(!_0x104a0f['isFile']())throw CliErrors[_0x39741e(0x92)](_0x39741e(0x82)+_0x48b04b,_0x39741e(0x6f)+_0x1a07b8);const _0x359146=bufferSha256(readFileSync(_0x6b1c72));if(_0x359146!==_0x3093b2)throw CliErrors[_0x39741e(0x92)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x48b04b+'.\x20Changed\x20file:\x20'+_0x1a07b8,_0x39741e(0x8b)+_0x1a07b8);}else{const _0x2c487f=resolve(_0x48b04b,SKILL_FILE);if(existsSync(_0x2c487f)&&_0x4f73af[_0x39741e(0x73)]){const _0x2f843a=contentHash(readFileSync(_0x2c487f,'utf8'));if(_0x2f843a!==_0x4f73af[_0x39741e(0x73)])throw CliErrors['validation'](_0x39741e(0x70)+_0x2c487f,_0x39741e(0x81));}}for(const _0x3fff29 of normalizeLocalFiles(_0x3fd56a)){if(_0x13753a?.[_0x3fff29[_0x39741e(0x98)]])continue;if(!_0x13753a&&_0x3fff29[_0x39741e(0x98)]===SKILL_FILE)continue;const _0x2dcfb3=resolveManagedFilePath(_0x48b04b,_0x3fff29[_0x39741e(0x98)]);if(!existsSync(_0x2dcfb3))continue;const _0xaceb59=lstatSync(_0x2dcfb3);if(!_0xaceb59[_0x39741e(0x9d)]())throw CliErrors[_0x39741e(0x92)](_0x39741e(0x82)+_0x48b04b,_0x39741e(0x91)+_0x3fff29[_0x39741e(0x98)]);const _0x30c512=bufferSha256(readFileSync(_0x2dcfb3));if(_0x30c512!==fileHash(_0x3fff29))throw CliErrors['validation'](_0x39741e(0x82)+_0x48b04b,_0x39741e(0x89)+_0x3fff29[_0x39741e(0x98)]);}}function materializeFiles(_0x3aca18,_0x478073){const _0x29fd0c=a157_0x26d0;for(const _0x1d9edb of normalizeLocalFiles(_0x478073)){const _0x337dd3=resolveManagedFilePath(_0x3aca18,_0x1d9edb[_0x29fd0c(0x98)]);mkdirSync(dirname(_0x337dd3),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x337dd3,fileContent(_0x1d9edb),0x180);}}function removeStaleManagedFiles(_0x22dbb0,_0x3a189d,_0x17e07a){const _0x112b30=a157_0x26d0;if(!_0x3a189d)return;const _0x276f4a=new Set(normalizeLocalFiles(_0x17e07a)[_0x112b30(0x80)](_0x44cd92=>_0x44cd92[_0x112b30(0x98)]));for(const _0x33e121 of Object[_0x112b30(0x74)](_0x3a189d)){if(_0x276f4a[_0x112b30(0x97)](_0x33e121))continue;const _0x2347ae=resolveManagedFilePath(_0x22dbb0,_0x33e121);existsSync(_0x2347ae)&&lstatSync(_0x2347ae)['isFile']()&&rmSync(_0x2347ae,{'force':!![]});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x171cd4,_0x394258){const _0x5b8562=a158_0x251d,_0x2f9178=_0x171cd4();while(!![]){try{const _0x34c53c=parseInt(_0x5b8562(0x20e))/0x1*(-parseInt(_0x5b8562(0x1f7))/0x2)+-parseInt(_0x5b8562(0x1f9))/0x3*(-parseInt(_0x5b8562(0x1fc))/0x4)+-parseInt(_0x5b8562(0x20a))/0x5*(parseInt(_0x5b8562(0x213))/0x6)+-parseInt(_0x5b8562(0x212))/0x7*(parseInt(_0x5b8562(0x1f1))/0x8)+-parseInt(_0x5b8562(0x1ff))/0x9+-parseInt(_0x5b8562(0x207))/0xa+-parseInt(_0x5b8562(0x211))/0xb*(-parseInt(_0x5b8562(0x1f8))/0xc);if(_0x34c53c===_0x394258)break;else _0x2f9178['push'](_0x2f9178['shift']());}catch(_0x148593){_0x2f9178['push'](_0x2f9178['shift']());}}}(a158_0x4e4f,0x93997));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_0x251d(_0x1da522,_0x4c06d4){_0x1da522=_0x1da522-0x1f1;const _0x4e4f72=a158_0x4e4f();let _0x251dd8=_0x4e4f72[_0x1da522];return _0x251dd8;}function a158_0x4e4f(){const _0x234405=['zipSize','skillName','Runtime\x20Skill\x20is\x20missing\x20skillCode.','map','parse','string','path','3325900PfgUqI','trim','toISOString','217510ErTdwr','object','length','files','11rCscVr','isArray','fromEntries','154TDjpWC','7CUunug','132WFFBNu','example','hasUpstreamUpdate','readonly','skillCode','8464528tClWLk','sourceSessionId','manifest','validation','ossPath','tags','29884MmQBAZ','3640404BQPDYB','981nMPwBl','forkedFromSkillId','userId','12Jvmhgb','zipSha256','status','10183410vkxXir'];a158_0x4e4f=function(){return _0x234405;};return a158_0x4e4f();}export function buildMetadata(_0x297d54,_0xba1172,_0x449bc5,_0x5b003,_0x3b3057,_0x210d33,_0x34ce3c){const _0x43812e=a158_0x251d,_0x5fd9de=_0x210d33?normalizeLocalFiles(_0x210d33):[],_0x21ca50=!_0x34ce3c&&_0x5fd9de[_0x43812e(0x20c)]>0x0?buildSkillPackage(_0x5fd9de):undefined,_0xbdaf1f=_0x34ce3c?bufferSha256(_0x34ce3c):_0x21ca50?.[_0x43812e(0x1f3)][_0x43812e(0x1fd)],_0x471980=_0x34ce3c?.['length']??_0x21ca50?.[_0x43812e(0x1f3)][_0x43812e(0x200)],_0x5e47e4=_0x5fd9de[_0x43812e(0x20c)]>0x0?Object[_0x43812e(0x210)](_0x5fd9de[_0x43812e(0x203)](_0x2d6ff4=>[_0x2d6ff4[_0x43812e(0x206)],fileHash(_0x2d6ff4)])):undefined;return{'schemaVersion':_0x5fd9de[_0x43812e(0x20c)]>0x0?0x2:0x1,'id':_0x297d54['id'],'appCode':_0x449bc5,'skillCode':requireSkillCode(_0x297d54),'skillName':_0x297d54[_0x43812e(0x201)],'description':_0x297d54['description'],'example':_0x297d54[_0x43812e(0x214)],'scope':_0xba1172,'readonly':_0xba1172!=='personal'||_0x297d54[_0x43812e(0x216)]===!![],'tenantCode':_0x297d54['tenantCode'],'userId':_0x297d54[_0x43812e(0x1fb)],'version':_0x297d54['version'],'status':_0x297d54[_0x43812e(0x1fe)],'tags':Array[_0x43812e(0x20f)](_0x297d54['tags'])?_0x297d54[_0x43812e(0x1f6)]:[],'hasUpstreamUpdate':_0x297d54[_0x43812e(0x215)],'forkedFromSkillId':_0x297d54[_0x43812e(0x1fa)],'forkedFromVersion':_0x297d54['forkedFromVersion'],'sourceSessionId':_0x297d54[_0x43812e(0x1f2)],'contentHash':_0x5b003,'fileHashes':_0x5e47e4,'treeHash':_0x5fd9de[_0x43812e(0x20c)]>0x0?fileTreeHash(localFilesToManifestFiles(_0x5fd9de)):undefined,'ossPath':remoteManifestOssPath(_0x297d54[_0x43812e(0x20d)]),'zipSha256':_0xbdaf1f,'zipSize':_0x471980,'files':_0x5fd9de[_0x43812e(0x20c)]>0x0?_0x5fd9de[_0x43812e(0x203)](_0xc0df94=>({'path':_0xc0df94['path'],'hash':fileHash(_0xc0df94),'size':fileContent(_0xc0df94)[_0x43812e(0x20c)]})):undefined,'pulledAt':_0x3b3057??new Date()[_0x43812e(0x209)]()};}export function requireSkillCode(_0x29a1eb){const _0x56b0cc=a158_0x251d,_0x3feea3=_0x29a1eb[_0x56b0cc(0x217)]?.[_0x56b0cc(0x208)]();if(!_0x3feea3)throw CliErrors[_0x56b0cc(0x1f4)](_0x56b0cc(0x202));return _0x3feea3;}export function readMetadataIfPresent(_0x1add28){const _0x43cb75=a158_0x251d;if(!existsSync(_0x1add28))return undefined;try{const _0x4d23e1=JSON[_0x43cb75(0x204)](readFileSync(_0x1add28,'utf8'));return _0x4d23e1;}catch{throw CliErrors[_0x43cb75(0x1f4)]('Invalid\x20'+METADATA_FILE+':\x20'+_0x1add28);}}function remoteManifestOssPath(_0x32a5a3){const _0x5d0235=a158_0x251d;if(!_0x32a5a3||typeof _0x32a5a3!==_0x5d0235(0x20b)||Array['isArray'](_0x32a5a3))return undefined;const _0x523a8b=_0x32a5a3[_0x5d0235(0x1f5)];return typeof _0x523a8b===_0x5d0235(0x205)&&_0x523a8b['trim']()?_0x523a8b[_0x5d0235(0x208)]():undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a159_0x23bbb2=a159_0x428f;(function(_0x18fb87,_0x3db6ae){const _0x36d697=a159_0x428f,_0x3ba087=_0x18fb87();while(!![]){try{const _0x14548d=parseInt(_0x36d697(0x10d))/0x1+parseInt(_0x36d697(0x108))/0x2*(-parseInt(_0x36d697(0x11c))/0x3)+-parseInt(_0x36d697(0x118))/0x4+parseInt(_0x36d697(0x11b))/0x5+-parseInt(_0x36d697(0x115))/0x6+-parseInt(_0x36d697(0x10b))/0x7+parseInt(_0x36d697(0x10a))/0x8;if(_0x14548d===_0x3db6ae)break;else _0x3ba087['push'](_0x3ba087['shift']());}catch(_0x141315){_0x3ba087['push'](_0x3ba087['shift']());}}}(a159_0x4551,0x4a875));function a159_0x4551(){const _0x5c123b=['Unsafe\x20','homeDir','homeDirName','filter','396852AYPWuW','skills','workbuddySkillsDir','1371636GceguU','.claude','includes','2731595FPDgoK','6YYlCkO','claudeSkillsDir','cacheRoot','path\x20segment','\x20for\x20local\x20path:\x20','519484uXoImB','skillCode','4480120vxLTke','3359118GiDnWo','.workbuddy','607344MHrOoy','agentsSkillsDir','SKILL_ROOT','.agents'];a159_0x4551=function(){return _0x5c123b;};return a159_0x4551();}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(_0x4bde97={}){const _0x5ac1bd=a159_0x428f,_0x284469=_0x4bde97[_0x5ac1bd(0x112)]??homedir(),_0x38b4e3=resolve(_0x284469,PRODUCT_CONFIG['homeDirName'],'cache'),_0x307b03=trimmedEnv(_0x5ac1bd(0x10f)),_0x17f374=trimmedEnv('CLAUDE_SKILL_ROOT'),_0x5123e1=resolve(_0x284469,_0x5ac1bd(0x10c)),_0x40ce44=_0x4bde97[_0x5ac1bd(0x117)]??(existsSync(_0x5123e1)?resolve(_0x5123e1,'skills'):undefined);return{'homeDir':_0x284469,'cacheRoot':_0x38b4e3,'managedRoot':resolve(_0x284469,PRODUCT_CONFIG[_0x5ac1bd(0x113)]),'agentsSkillsDir':_0x4bde97[_0x5ac1bd(0x10e)]??_0x307b03??resolve(_0x284469,_0x5ac1bd(0x110),'skills'),'claudeSkillsDir':_0x4bde97[_0x5ac1bd(0x11d)]??_0x17f374??resolve(_0x284469,_0x5ac1bd(0x119),_0x5ac1bd(0x116)),'workbuddySkillsDir':_0x40ce44};}export function runtimeAgentSkillRoots(_0x25f545){const _0xf8fb8c=a159_0x428f;return[_0x25f545[_0xf8fb8c(0x10e)],_0x25f545[_0xf8fb8c(0x11d)],_0x25f545[_0xf8fb8c(0x117)]][_0xf8fb8c(0x114)](_0x35d22f=>Boolean(_0x35d22f));}export function getRuntimeSkillCacheRoot(_0x42bf50,_0xe0836e,_0x27d9c5={}){const _0x2c160c=a159_0x428f,_0x180818=resolveSkillSyncPaths(_0x27d9c5);return resolve(_0x180818[_0x2c160c(0x11e)],_0x42bf50,fingerprintAccessKey(_0xe0836e),_0x2c160c(0x116));}function a159_0x428f(_0x459299,_0x157a31){_0x459299=_0x459299-0x106;const _0x455189=a159_0x4551();let _0x428f44=_0x455189[_0x459299];return _0x428f44;}export function getRuntimeSkillDir(_0x163b39,_0x31b905,_0x172e74,_0x51e230,_0xbedbfb,_0x442436={}){const _0x21d7b4=a159_0x428f;return resolve(getRuntimeSkillCacheRoot(_0x163b39,_0x31b905,_0x442436),safePathSegment(_0x172e74,'appCode'),_0x51e230,safePathSegment(_0xbedbfb,_0x21d7b4(0x109)));}export function safePathSegment(_0x1069ed,_0x456d74=a159_0x23bbb2(0x106)){const _0x2b3c07=a159_0x23bbb2;if(!_0x1069ed||_0x1069ed[_0x2b3c07(0x11a)]('/')||_0x1069ed[_0x2b3c07(0x11a)]('\x5c')||_0x1069ed[_0x2b3c07(0x11a)]('..'))throw CliErrors['validation'](_0x2b3c07(0x111)+_0x456d74+_0x2b3c07(0x107)+_0x1069ed);return _0x1069ed;}function trimmedEnv(_0x2ada8c){const _0x46d5de=productEnv(_0x2ada8c)?.['trim']();return _0x46d5de?_0x46d5de:undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x519097,_0x3128e4){const _0x4618dd=a160_0x5b09,_0x136c30=_0x519097();while(!![]){try{const _0x5aafbd=-parseInt(_0x4618dd(0x1cb))/0x1*(parseInt(_0x4618dd(0x1f0))/0x2)+parseInt(_0x4618dd(0x1e3))/0x3*(parseInt(_0x4618dd(0x1c8))/0x4)+parseInt(_0x4618dd(0x1db))/0x5+-parseInt(_0x4618dd(0x1bd))/0x6+parseInt(_0x4618dd(0x1f9))/0x7+parseInt(_0x4618dd(0x1eb))/0x8+parseInt(_0x4618dd(0x1ed))/0x9;if(_0x5aafbd===_0x3128e4)break;else _0x136c30['push'](_0x136c30['shift']());}catch(_0x20377b){_0x136c30['push'](_0x136c30['shift']());}}}(a160_0x5cda,0x93727));function a160_0x5b09(_0x1fe1d7,_0x704082){_0x1fe1d7=_0x1fe1d7-0x1bd;const _0x5cda91=a160_0x5cda();let _0x5b09db=_0x5cda91[_0x1fe1d7];return _0x5b09db;}import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a160_0x4bfce9}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';function a160_0x5cda(){const _0x2eedf3=['string','targetScope','name','1267288oAzLKt','number','3143286xHMBVw','ignoreInvalidMetadata','builtin','46ZDzDZX','sourceSessionId','ignoreMetadataForPayload','personal','skillName','path','example','pushedAt','\x20name\x20for\x20SkillHub\x20slug\x20generation.','2607801zZAWZl','toLowerCase','boolean','5108718PZXBTZ','some','isFile','validation','packageBase64','ignoreMetadataScope','dir','replace','object','ignoreMetadataSkillCode','(unknown)','4SmuBrG','isSymbolicLink','utf8','39646KbnNJk','Remote\x20Skill\x20','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20','Skill\x20directory\x20not\x20found:\x20','Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20','displayName','ignoreMetadataAppCodeMismatch','match','description','isDirectory','Unable\x20to\x20resolve\x20skillCode\x20from\x20','Missing\x20','find','\x20has\x20unsupported\x20scope\x20\x22','scope','trim','3259295NClCHP','tags','slice','length','isArray','skillCode','unknown',',\x20or\x20directory\x20name.','2505561tKwYRy','startsWith','appCode','content','files'];a160_0x5cda=function(){return _0x2eedf3;};return a160_0x5cda();}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(_0x71e2fe,_0x5d9aae,_0x5d4568={}){const _0x5b4630=a160_0x5b09,_0x5263a7=resolvePushDirectoryRoot(_0x71e2fe),_0x3c499f=readPushMetadataIfPresent(resolve(_0x5263a7,METADATA_FILE),{'ignoreInvalidMetadata':_0x5d4568[_0x5b4630(0x1ee)]});if(_0x3c499f?.[_0x5b4630(0x1e5)]&&_0x3c499f[_0x5b4630(0x1e5)]!==_0x5d9aae&&!_0x5d4568['allowAppCodeRetarget']&&!_0x5d4568[_0x5b4630(0x1d1)])throw CliErrors['validation']('Skill\x20metadata\x20appCode\x20\x22'+_0x3c499f['appCode']+'\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22'+_0x5d9aae+'\x22.');const _0x36ef46=resolvePushSkillCode(_0x5263a7,_0x5d9aae,_0x3c499f,_0x5d4568);if(!_0x36ef46)throw CliErrors['validation'](_0x5b4630(0x1d5)+SKILL_FILE+',\x20'+METADATA_FILE+_0x5b4630(0x1e2));return{'dir':_0x5263a7,'skillCode':_0x36ef46,'metadata':_0x3c499f};}export function readPushDirectory(_0x52d0d8,_0x55db40,_0x30b84f={}){const _0x252771=a160_0x5b09,_0x2968a5=resolvePushDirectoryIdentity(_0x52d0d8,_0x55db40,_0x30b84f),_0x488571=_0x2968a5[_0x252771(0x1c3)],_0x1dcc72=resolve(_0x488571,SKILL_FILE);if(!existsSync(_0x1dcc72)||!lstatSync(_0x1dcc72)[_0x252771(0x1bf)]())throw CliErrors[_0x252771(0x1c0)](_0x252771(0x1d6)+SKILL_FILE+':\x20'+_0x1dcc72);const _0xdc79bc=_0x2968a5['metadata'],_0x120df0=_0x30b84f[_0x252771(0x1e9)]??_0x252771(0x1f3);if(!_0x30b84f[_0x252771(0x1c2)]&&_0xdc79bc?.['scope']===_0x252771(0x1ef))throw CliErrors[_0x252771(0x1c0)](_0x252771(0x1cf)+METADATA_FILE+'\x20has\x20scope=\x22'+_0xdc79bc[_0x252771(0x1d9)]+'\x22.');if(!_0x30b84f[_0x252771(0x1c2)]&&_0x120df0===_0x252771(0x1f3)&&_0xdc79bc?.['scope']&&_0xdc79bc[_0x252771(0x1d9)]!==_0x252771(0x1f3))throw CliErrors[_0x252771(0x1c0)](_0x252771(0x1cd)+METADATA_FILE+'\x20has\x20scope=\x22'+_0xdc79bc['scope']+'\x22.','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20'+_0x488571+'\x20to\x20submit\x20company\x20Skills\x20for\x20review.');const _0x3a8df3=scanSkillDirectory(_0x488571,{'excludedFilePaths':_0x30b84f['excludedFilePaths']}),_0x2e8c49=buildSkillPackage(_0x3a8df3),_0xd49a49=readFileSync(_0x1dcc72,'utf8'),_0x1cc794=_0x2968a5[_0x252771(0x1e0)],_0xd5d2f6=_0x30b84f[_0x252771(0x1f2)]?undefined:_0xdc79bc,_0x509f60=readSkillDisplayName(_0xd49a49);return{'skillCode':_0x1cc794,'metadata':_0xdc79bc,'frontmatterDisplayName':_0x509f60,'input':{'skillCode':_0x1cc794,'skillName':_0x509f60??_0xd5d2f6?.['skillName'],'description':_0xd5d2f6?.[_0x252771(0x1d3)],'content':_0xd49a49,'files':_0x2e8c49['manifest'],'packageBase64':_0x2e8c49[_0x252771(0x1c1)],'tags':_0xd5d2f6?.['tags'],'version':_0xd5d2f6?.['version'],'sourceSessionId':_0xd5d2f6?.[_0x252771(0x1f1)]}};}export function refreshPushDirectoryMetadataFromRemote(_0x5a620d,_0x5f4160,_0x2f21b2,_0x183c92={}){const _0x598f06=a160_0x5b09,_0x7a9b61=resolvePushDirectoryRoot(_0x5a620d),_0x296ffa=readPushMetadataIfPresent(resolve(_0x7a9b61,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x119803=requireRemoteScope(_0x5f4160),_0x44f5e1=readLocalSkillContent(_0x7a9b61),_0x98b50a={..._0x5f4160,'appCode':_0x5f4160['appCode']??_0x2f21b2,'skillName':_0x5f4160[_0x598f06(0x1f4)]??_0x296ffa?.[_0x598f06(0x1f4)],'description':_0x5f4160[_0x598f06(0x1d3)]??_0x296ffa?.[_0x598f06(0x1d3)],'example':_0x5f4160['example']??_0x296ffa?.[_0x598f06(0x1f6)],'tags':Array[_0x598f06(0x1df)](_0x5f4160[_0x598f06(0x1dc)])?_0x5f4160[_0x598f06(0x1dc)]:_0x296ffa?.['tags'],'sourceSessionId':_0x5f4160['sourceSessionId']??_0x296ffa?.[_0x598f06(0x1f1)],'content':_0x5f4160[_0x598f06(0x1e6)]??_0x44f5e1},_0x3a39a1=buildMetadata(_0x98b50a,_0x119803,_0x2f21b2,contentHash(_0x44f5e1),_0x183c92['refreshedAt']);writeJsonAtomic(resolve(_0x7a9b61,METADATA_FILE),_0x3a39a1);}export function recordPushedRuntimeSkill(_0x793179,_0x566e44,_0x5d093e,_0x15fd8d={}){const _0x909a62=a160_0x5b09,_0x18020e=resolvePushDirectoryRoot(_0x793179),_0xc6067f=scanSkillDirectory(_0x18020e),_0x3a9ce0=_0xc6067f[_0x909a62(0x1d7)](_0x5f109f=>_0x5f109f[_0x909a62(0x1f5)]===SKILL_FILE),_0xea6a8a=_0x3a9ce0?fileText(_0x3a9ce0):'',_0x2f97d3=tryNormalizePackageManifest(_0x566e44[_0x909a62(0x1e7)]),_0xd8e5e9={..._0x566e44,'content':_0x566e44[_0x909a62(0x1e6)]??_0xea6a8a,'files':_0x2f97d3},_0x52ed02=_0x2f97d3?normalizeLocalFiles(_0xc6067f)['filter'](_0x26d9ae=>_0x2f97d3[_0x909a62(0x1e7)][_0x909a62(0x1be)](_0x431697=>_0x431697['path']===_0x26d9ae['path'])):undefined,_0x3fe55f=buildMetadata(_0xd8e5e9,_0x15fd8d[_0x909a62(0x1d9)]??'personal',_0x5d093e,contentHash(_0xd8e5e9['content']??''),_0x15fd8d[_0x909a62(0x1f7)],_0x52ed02);writeJsonAtomic(resolve(_0x18020e,METADATA_FILE),_0x3fe55f);}export function deriveSkillCodeFromDirectory(_0x461f51,_0xd0a6ef){const _0x4d4f3f=a160_0x5b09,_0x189731=basename(resolve(_0x461f51)),_0x437180=_0xd0a6ef+'--';return _0x189731[_0x4d4f3f(0x1e4)](_0x437180)?_0x189731[_0x4d4f3f(0x1dd)](_0x437180[_0x4d4f3f(0x1de)]):_0x189731;}function resolvePushSkillCode(_0x47c8e6,_0x1d85c2,_0x3127be,_0x2d170d){const _0x50d038=a160_0x5b09,_0xbb28bd=deriveSkillCodeFromSkillFile(_0x47c8e6)||deriveSkillCodeFromDirectory(_0x47c8e6,_0x1d85c2);if(_0x2d170d[_0x50d038(0x1c6)])return _0xbb28bd;return _0x3127be?.['skillCode']?.[_0x50d038(0x1da)]()||_0xbb28bd;}function deriveSkillCodeFromSkillFile(_0x2c3cd4){const _0x2bc3e6=a160_0x5b09,_0x44aea7=resolve(_0x2c3cd4,SKILL_FILE);if(!existsSync(_0x44aea7)||!lstatSync(_0x44aea7)[_0x2bc3e6(0x1bf)]())return undefined;const _0x261c87=readFileSync(_0x44aea7,_0x2bc3e6(0x1ca)),_0x31d26a=_0x261c87[_0x2bc3e6(0x1d2)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x31d26a)return undefined;const _0x574f0a=parseFrontmatterObject(_0x31d26a[0x1]??''),_0x477a21=scalarToString(_0x574f0a?.[_0x2bc3e6(0x1ea)]);return _0x477a21?slugifySkillName(_0x477a21):undefined;}function readSkillDisplayName(_0x4ad7cd){const _0x4ea083=a160_0x5b09,_0x10f8d8=_0x4ad7cd[_0x4ea083(0x1d2)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x10f8d8)return undefined;const _0x1e20bf=parseFrontmatterObject(_0x10f8d8[0x1]??'');return scalarToString(_0x1e20bf?.[_0x4ea083(0x1d0)]);}function slugifySkillName(_0x343f13){const _0x3f368d=a160_0x5b09,_0x5ee0e3=_0x343f13[_0x3f368d(0x1da)]()[_0x3f368d(0x1fa)]()[_0x3f368d(0x1c4)](/[^\p{L}\p{N}\p{So}]+/gu,'-')[_0x3f368d(0x1c4)](/^-+/,'')['replace'](/-+$/,'')[_0x3f368d(0x1c4)](/-{2,}/g,'-');if(!_0x5ee0e3)throw CliErrors[_0x3f368d(0x1c0)]('Invalid\x20'+SKILL_FILE+_0x3f368d(0x1f8));return _0x5ee0e3;}function parseFrontmatterObject(_0x4b507a){const _0x3e0440=a160_0x5b09;try{const _0x33dd27=a160_0x4bfce9(_0x4b507a);return _0x33dd27&&typeof _0x33dd27===_0x3e0440(0x1c5)&&!Array[_0x3e0440(0x1df)](_0x33dd27)?_0x33dd27:undefined;}catch{return undefined;}}function scalarToString(_0x390be1){const _0x5b7039=a160_0x5b09;if(typeof _0x390be1===_0x5b7039(0x1e8))return _0x390be1[_0x5b7039(0x1da)]();if(typeof _0x390be1===_0x5b7039(0x1ec)||typeof _0x390be1===_0x5b7039(0x1fb))return String(_0x390be1);return undefined;}function resolvePushDirectoryRoot(_0x2aec4c){const _0x208ca5=a160_0x5b09,_0x48b9fa=resolve(_0x2aec4c);if(!existsSync(_0x48b9fa))throw CliErrors['validation'](_0x208ca5(0x1ce)+_0x2aec4c);const _0x5eac01=lstatSync(_0x48b9fa);if(_0x5eac01[_0x208ca5(0x1d4)]())return _0x48b9fa;if(_0x5eac01[_0x208ca5(0x1c9)]()){const _0x177dda=realpathSync(_0x48b9fa);if(lstatSync(_0x177dda)[_0x208ca5(0x1d4)]())return _0x177dda;}throw CliErrors[_0x208ca5(0x1c0)]('Skill\x20directory\x20not\x20found:\x20'+_0x2aec4c);}function requireRemoteScope(_0x3ba88c){const _0x13213b=a160_0x5b09;if(_0x3ba88c[_0x13213b(0x1d9)]==='personal'||_0x3ba88c[_0x13213b(0x1d9)]==='company'||_0x3ba88c[_0x13213b(0x1d9)]==='builtin')return _0x3ba88c[_0x13213b(0x1d9)];throw CliErrors[_0x13213b(0x1c0)](_0x13213b(0x1cc)+(_0x3ba88c[_0x13213b(0x1e0)]||_0x13213b(0x1c7))+_0x13213b(0x1d8)+(_0x3ba88c['scope']??_0x13213b(0x1e1))+'\x22.');}function readLocalSkillContent(_0x4f2901){const _0x10db26=a160_0x5b09,_0x7996f6=resolve(_0x4f2901,SKILL_FILE);return existsSync(_0x7996f6)&&lstatSync(_0x7996f6)['isFile']()?readFileSync(_0x7996f6,_0x10db26(0x1ca)):'';}function readPushMetadataIfPresent(_0x2da55e,_0xc6c4ab={}){try{return readMetadataIfPresent(_0x2da55e);}catch(_0x137b09){if(_0xc6c4ab['ignoreInvalidMetadata'])return undefined;throw _0x137b09;}}
|
|
1
|
+
(function(_0x44ff6f,_0x3b2fbf){const _0x40657d=a160_0x3050,_0x366f4e=_0x44ff6f();while(!![]){try{const _0x34ebda=parseInt(_0x40657d(0x19c))/0x1*(-parseInt(_0x40657d(0x1a2))/0x2)+parseInt(_0x40657d(0x1c0))/0x3*(parseInt(_0x40657d(0x1a8))/0x4)+parseInt(_0x40657d(0x199))/0x5+parseInt(_0x40657d(0x1ae))/0x6+parseInt(_0x40657d(0x19b))/0x7*(-parseInt(_0x40657d(0x1a7))/0x8)+parseInt(_0x40657d(0x1b2))/0x9+-parseInt(_0x40657d(0x1b4))/0xa;if(_0x34ebda===_0x3b2fbf)break;else _0x366f4e['push'](_0x366f4e['shift']());}catch(_0x2a8f29){_0x366f4e['push'](_0x366f4e['shift']());}}}(a160_0x3034,0x4ca71));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a160_0x38aa99}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(_0x342585,_0x153e47,_0x21225b={}){const _0x8f7979=a160_0x3050,_0x1a33ae=resolvePushDirectoryRoot(_0x342585),_0x5d0990=readPushMetadataIfPresent(resolve(_0x1a33ae,METADATA_FILE),{'ignoreInvalidMetadata':_0x21225b['ignoreInvalidMetadata']});if(_0x5d0990?.[_0x8f7979(0x189)]&&_0x5d0990[_0x8f7979(0x189)]!==_0x153e47&&!_0x21225b['allowAppCodeRetarget']&&!_0x21225b[_0x8f7979(0x194)])throw CliErrors[_0x8f7979(0x18f)](_0x8f7979(0x1a3)+_0x5d0990[_0x8f7979(0x189)]+_0x8f7979(0x1c1)+_0x153e47+'\x22.');const _0x30a091=resolvePushSkillCode(_0x1a33ae,_0x153e47,_0x5d0990,_0x21225b);if(!_0x30a091)throw CliErrors[_0x8f7979(0x18f)]('Unable\x20to\x20resolve\x20skillCode\x20from\x20'+SKILL_FILE+',\x20'+METADATA_FILE+_0x8f7979(0x1b6));return{'dir':_0x1a33ae,'skillCode':_0x30a091,'metadata':_0x5d0990};}export function readPushDirectory(_0x1aae01,_0x138d91,_0x289972={}){const _0x2e200b=a160_0x3050,_0x4032a8=resolvePushDirectoryIdentity(_0x1aae01,_0x138d91,_0x289972),_0x4724b2=_0x4032a8[_0x2e200b(0x195)],_0x2ffd2a=resolve(_0x4724b2,SKILL_FILE);if(!existsSync(_0x2ffd2a)||!lstatSync(_0x2ffd2a)[_0x2e200b(0x1a9)]())throw CliErrors[_0x2e200b(0x18f)](_0x2e200b(0x18c)+SKILL_FILE+':\x20'+_0x2ffd2a);const _0xf3a548=_0x4032a8['metadata'],_0xbb6214=_0x289972[_0x2e200b(0x186)]??_0x2e200b(0x18b);if(!_0x289972[_0x2e200b(0x191)]&&_0xf3a548?.['scope']===_0x2e200b(0x1b1))throw CliErrors[_0x2e200b(0x18f)](_0x2e200b(0x1ba)+METADATA_FILE+_0x2e200b(0x1a0)+_0xf3a548[_0x2e200b(0x1b5)]+'\x22.');if(!_0x289972[_0x2e200b(0x191)]&&_0xbb6214===_0x2e200b(0x18b)&&_0xf3a548?.[_0x2e200b(0x1b5)]&&_0xf3a548['scope']!==_0x2e200b(0x18b))throw CliErrors[_0x2e200b(0x18f)]('Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20'+METADATA_FILE+_0x2e200b(0x1a0)+_0xf3a548[_0x2e200b(0x1b5)]+'\x22.',_0x2e200b(0x193)+_0x4724b2+_0x2e200b(0x1bc));const _0x562109=scanSkillDirectory(_0x4724b2,{'excludedFilePaths':_0x289972[_0x2e200b(0x1b3)]}),_0x21e932=buildSkillPackage(_0x562109),_0x3e53b1=readFileSync(_0x2ffd2a,'utf8'),_0x52eac1=_0x4032a8[_0x2e200b(0x190)],_0x3a20d1=_0x289972['ignoreMetadataForPayload']?undefined:_0xf3a548,_0x194f7c=readSkillDisplayName(_0x3e53b1);return{'skillCode':_0x52eac1,'metadata':_0xf3a548,'frontmatterDisplayName':_0x194f7c,'input':{'skillCode':_0x52eac1,'skillName':_0x194f7c??_0x3a20d1?.['skillName'],'description':_0x3a20d1?.[_0x2e200b(0x1bb)],'content':_0x3e53b1,'files':_0x21e932[_0x2e200b(0x198)],'packageBase64':_0x21e932[_0x2e200b(0x18a)],'tags':_0x3a20d1?.[_0x2e200b(0x1c2)],'version':_0x3a20d1?.[_0x2e200b(0x188)],'sourceSessionId':_0x3a20d1?.[_0x2e200b(0x187)]}};}export function refreshPushDirectoryMetadataFromRemote(_0x28bdae,_0x555785,_0x191d84,_0x5dec4b={}){const _0x32c3e4=a160_0x3050,_0x275cc6=resolvePushDirectoryRoot(_0x28bdae),_0x4a4281=readPushMetadataIfPresent(resolve(_0x275cc6,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x18a707=requireRemoteScope(_0x555785),_0x423b6d=readLocalSkillContent(_0x275cc6),_0x45d332={..._0x555785,'appCode':_0x555785['appCode']??_0x191d84,'skillName':_0x555785[_0x32c3e4(0x1a4)]??_0x4a4281?.[_0x32c3e4(0x1a4)],'description':_0x555785[_0x32c3e4(0x1bb)]??_0x4a4281?.[_0x32c3e4(0x1bb)],'example':_0x555785[_0x32c3e4(0x1aa)]??_0x4a4281?.[_0x32c3e4(0x1aa)],'tags':Array['isArray'](_0x555785[_0x32c3e4(0x1c2)])?_0x555785[_0x32c3e4(0x1c2)]:_0x4a4281?.[_0x32c3e4(0x1c2)],'sourceSessionId':_0x555785[_0x32c3e4(0x187)]??_0x4a4281?.[_0x32c3e4(0x187)],'content':_0x555785[_0x32c3e4(0x19d)]??_0x423b6d},_0x4949f8=buildMetadata(_0x45d332,_0x18a707,_0x191d84,contentHash(_0x423b6d),_0x5dec4b['refreshedAt']);writeJsonAtomic(resolve(_0x275cc6,METADATA_FILE),_0x4949f8);}export function recordPushedRuntimeSkill(_0x1832ac,_0x344590,_0x425305,_0x1109a8={}){const _0x2a8413=a160_0x3050,_0x5c131c=resolvePushDirectoryRoot(_0x1832ac),_0x23ab95=scanSkillDirectory(_0x5c131c),_0xa21e97=_0x23ab95[_0x2a8413(0x1b9)](_0x527ad6=>_0x527ad6[_0x2a8413(0x185)]===SKILL_FILE),_0xdb8d65=_0xa21e97?fileText(_0xa21e97):'',_0x3306b0=tryNormalizePackageManifest(_0x344590[_0x2a8413(0x1ad)]),_0x144f3f={..._0x344590,'content':_0x344590[_0x2a8413(0x19d)]??_0xdb8d65,'files':_0x3306b0},_0x329634=_0x3306b0?normalizeLocalFiles(_0x23ab95)['filter'](_0x1a14f3=>_0x3306b0[_0x2a8413(0x1ad)][_0x2a8413(0x1af)](_0x2442d8=>_0x2442d8[_0x2a8413(0x185)]===_0x1a14f3[_0x2a8413(0x185)])):undefined,_0x572c64=buildMetadata(_0x144f3f,_0x1109a8[_0x2a8413(0x1b5)]??'personal',_0x425305,contentHash(_0x144f3f[_0x2a8413(0x19d)]??''),_0x1109a8[_0x2a8413(0x1b7)],_0x329634);writeJsonAtomic(resolve(_0x5c131c,METADATA_FILE),_0x572c64);}export function deriveSkillCodeFromDirectory(_0x5079cc,_0x174035){const _0x19453c=a160_0x3050,_0x374bc3=basename(resolve(_0x5079cc)),_0x58117e=_0x174035+'--';return _0x374bc3['startsWith'](_0x58117e)?_0x374bc3['slice'](_0x58117e[_0x19453c(0x1ab)]):_0x374bc3;}function resolvePushSkillCode(_0x5c5cd8,_0x2656b3,_0x16f5cc,_0x5adde0){const _0xa7904c=a160_0x3050,_0x41f195=deriveSkillCodeFromSkillFile(_0x5c5cd8)||deriveSkillCodeFromDirectory(_0x5c5cd8,_0x2656b3);if(_0x5adde0[_0xa7904c(0x19f)])return _0x41f195;return _0x16f5cc?.[_0xa7904c(0x190)]?.[_0xa7904c(0x18d)]()||_0x41f195;}function deriveSkillCodeFromSkillFile(_0x349128){const _0x350a93=a160_0x3050,_0x4ff056=resolve(_0x349128,SKILL_FILE);if(!existsSync(_0x4ff056)||!lstatSync(_0x4ff056)[_0x350a93(0x1a9)]())return undefined;const _0x3fdcb5=readFileSync(_0x4ff056,'utf8'),_0x339b20=_0x3fdcb5[_0x350a93(0x196)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x339b20)return undefined;const _0x3b6d1e=parseFrontmatterObject(_0x339b20[0x1]??''),_0x2e05e0=scalarToString(_0x3b6d1e?.[_0x350a93(0x1bd)]);return _0x2e05e0?slugifySkillName(_0x2e05e0):undefined;}function readSkillDisplayName(_0x1c67b7){const _0x4ee292=a160_0x3050,_0x38d835=_0x1c67b7[_0x4ee292(0x196)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x38d835)return undefined;const _0x128493=parseFrontmatterObject(_0x38d835[0x1]??'');return scalarToString(_0x128493?.[_0x4ee292(0x197)]);}function slugifySkillName(_0x2051f2){const _0x21e2b6=a160_0x3050,_0x1d7554=_0x2051f2[_0x21e2b6(0x18d)]()[_0x21e2b6(0x1b0)]()[_0x21e2b6(0x1b8)](/[^\p{L}\p{N}\p{So}]+/gu,'-')['replace'](/^-+/,'')[_0x21e2b6(0x1b8)](/-+$/,'')[_0x21e2b6(0x1b8)](/-{2,}/g,'-');if(!_0x1d7554)throw CliErrors['validation'](_0x21e2b6(0x1c3)+SKILL_FILE+_0x21e2b6(0x19a));return _0x1d7554;}function parseFrontmatterObject(_0x21289a){const _0x5211a9=a160_0x3050;try{const _0x4e9516=a160_0x38aa99(_0x21289a);return _0x4e9516&&typeof _0x4e9516===_0x5211a9(0x1bf)&&!Array[_0x5211a9(0x18e)](_0x4e9516)?_0x4e9516:undefined;}catch{return undefined;}}function scalarToString(_0x423809){const _0x4e9972=a160_0x3050;if(typeof _0x423809==='string')return _0x423809[_0x4e9972(0x18d)]();if(typeof _0x423809===_0x4e9972(0x192)||typeof _0x423809==='boolean')return String(_0x423809);return undefined;}function a160_0x3034(){const _0x338cdf=['isFile','example','length','company','files','2085528HeWLOJ','some','toLowerCase','builtin','991620eEPMtn','excludedFilePaths','4232370UGUbHs','scope',',\x20or\x20directory\x20name.','pushedAt','replace','find','Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20','description','\x20to\x20submit\x20company\x20Skills\x20for\x20review.','name','(unknown)','object','141BGAisH','\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22','tags','Invalid\x20','Remote\x20Skill\x20','path','targetScope','sourceSessionId','version','appCode','packageBase64','personal','Missing\x20','trim','isArray','validation','skillCode','ignoreMetadataScope','number','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20','ignoreMetadataAppCodeMismatch','dir','match','displayName','manifest','979980CCWlhN','\x20name\x20for\x20SkillHub\x20slug\x20generation.','7mddhlF','2330HmzxAZ','content','Skill\x20directory\x20not\x20found:\x20','ignoreMetadataSkillCode','\x20has\x20scope=\x22','isDirectory','32nqEFUj','Skill\x20metadata\x20appCode\x20\x22','skillName','ignoreInvalidMetadata','utf8','3485688fVaaIJ','47356pfEVxZ'];a160_0x3034=function(){return _0x338cdf;};return a160_0x3034();}function a160_0x3050(_0x514a6c,_0x4f234e){_0x514a6c=_0x514a6c-0x185;const _0x30348e=a160_0x3034();let _0x3050ae=_0x30348e[_0x514a6c];return _0x3050ae;}function resolvePushDirectoryRoot(_0x471463){const _0x2db54e=a160_0x3050,_0x55bc27=resolve(_0x471463);if(!existsSync(_0x55bc27))throw CliErrors[_0x2db54e(0x18f)](_0x2db54e(0x19e)+_0x471463);const _0x3708cb=lstatSync(_0x55bc27);if(_0x3708cb[_0x2db54e(0x1a1)]())return _0x55bc27;if(_0x3708cb['isSymbolicLink']()){const _0x1558fa=realpathSync(_0x55bc27);if(lstatSync(_0x1558fa)['isDirectory']())return _0x1558fa;}throw CliErrors[_0x2db54e(0x18f)]('Skill\x20directory\x20not\x20found:\x20'+_0x471463);}function requireRemoteScope(_0x242333){const _0x21daa2=a160_0x3050;if(_0x242333[_0x21daa2(0x1b5)]===_0x21daa2(0x18b)||_0x242333[_0x21daa2(0x1b5)]===_0x21daa2(0x1ac)||_0x242333[_0x21daa2(0x1b5)]==='builtin')return _0x242333[_0x21daa2(0x1b5)];throw CliErrors[_0x21daa2(0x18f)](_0x21daa2(0x1c4)+(_0x242333['skillCode']||_0x21daa2(0x1be))+'\x20has\x20unsupported\x20scope\x20\x22'+(_0x242333[_0x21daa2(0x1b5)]??'unknown')+'\x22.');}function readLocalSkillContent(_0x28e7b9){const _0x31cc1b=a160_0x3050,_0x444849=resolve(_0x28e7b9,SKILL_FILE);return existsSync(_0x444849)&&lstatSync(_0x444849)[_0x31cc1b(0x1a9)]()?readFileSync(_0x444849,_0x31cc1b(0x1a6)):'';}function readPushMetadataIfPresent(_0x1095ef,_0x216b37={}){const _0x5f2a14=a160_0x3050;try{return readMetadataIfPresent(_0x1095ef);}catch(_0x45699d){if(_0x216b37[_0x5f2a14(0x1a5)])return undefined;throw _0x45699d;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x1ca1cd,_0x226d19){const _0xb81c27=a161_0xe1f2,_0x34ee56=_0x1ca1cd();while(!![]){try{const _0x29091a=parseInt(_0xb81c27(0xdb))/0x1*(-parseInt(_0xb81c27(0xdf))/0x2)+parseInt(_0xb81c27(0xda))/0x3+parseInt(_0xb81c27(0xd6))/0x4+parseInt(_0xb81c27(0xe4))/0x5*(-parseInt(_0xb81c27(0xe0))/0x6)+parseInt(_0xb81c27(0xde))/0x7+-parseInt(_0xb81c27(0xdc))/0x8+-parseInt(_0xb81c27(0xd7))/0x9;if(_0x29091a===_0x226d19)break;else _0x34ee56['push'](_0x34ee56['shift']());}catch(_0x2d4fea){_0x34ee56['push'](_0x34ee56['shift']());}}}(a161_0x1f62,0x72d0b));function a161_0xe1f2(_0x2d517f,_0x53193d){_0x2d517f=_0x2d517f-0xd6;const _0x1f6260=a161_0x1f62();let _0xe1f27f=_0x1f6260[_0x2d517f];return _0xe1f27f;}import{CliErrors}from'../../errors.js';export function normalizeRuntimeSkillScopes(_0x1a478c){const _0x291c65=a161_0xe1f2,_0x523fae=_0x1a478c&&_0x1a478c[_0x291c65(0xe5)]>0x0?_0x1a478c:[_0x291c65(0xe6),_0x291c65(0xe1),_0x291c65(0xd8)],_0x520560=[];for(const _0x233900 of _0x523fae){if(!isRuntimeSkillScope(_0x233900))throw CliErrors[_0x291c65(0xdd)](_0x291c65(0xe2)+_0x233900);!_0x520560[_0x291c65(0xd9)](_0x233900)&&_0x520560[_0x291c65(0xe3)](_0x233900);}return _0x520560;}function a161_0x1f62(){const _0x3fe68e=['builtin','includes','2316597XnFEZD','5395SIHcUt','1643592cZaNWZ','validation','3635520GlsTkM','290JYeTCJ','12VhXrtT','company','Unsupported\x20runtime\x20Skill\x20scope:\x20','push','1618720tuNsXi','length','personal','3478212ZTXnWH','500553Eljmgt'];a161_0x1f62=function(){return _0x3fe68e;};return a161_0x1f62();}export function isRuntimeSkillScope(_0x12d0f8){const _0x46c093=a161_0xe1f2;return _0x12d0f8===_0x46c093(0xe6)||_0x12d0f8===_0x46c093(0xe1)||_0x12d0f8===_0x46c093(0xd8);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a163_0x340efa=a163_0x5009;(function(_0x4ce2f0,_0x5b7696){const _0x57503b=a163_0x5009,_0x41ead0=_0x4ce2f0();while(!![]){try{const _0x205ad3=-parseInt(_0x57503b(0x15c))/0x1+-parseInt(_0x57503b(0x152))/0x2+parseInt(_0x57503b(0x160))/0x3+parseInt(_0x57503b(0x162))/0x4*(parseInt(_0x57503b(0x14e))/0x5)+-parseInt(_0x57503b(0x161))/0x6*(parseInt(_0x57503b(0x155))/0x7)+-parseInt(_0x57503b(0x154))/0x8+parseInt(_0x57503b(0x15e))/0x9*(parseInt(_0x57503b(0x164))/0xa);if(_0x205ad3===_0x5b7696)break;else _0x41ead0['push'](_0x41ead0['shift']());}catch(_0x1c3272){_0x41ead0['push'](_0x41ead0['shift']());}}}(a163_0x241e,0xe92ea));import{unzipSync,zipSync}from'fflate';function a163_0x5009(_0x3898e4,_0x42cb32){_0x3898e4=_0x3898e4-0x14e;const _0x241e4b=a163_0x241e();let _0x500982=_0x241e4b[_0x3898e4];return _0x500982;}import{CliErrors}from'../../errors.js';import{compareSkillFiles,fileContent,normalizeLocalFiles,normalizeSkillRelativePath}from'./local-files.js';function a163_0x241e(){const _0x2ab62c=['object','Runtime\x20Skill\x20package\x20contains\x20directory\x20entry:\x20','validation_error','code','validation','1494643OsXXIa','entries','36jwyFcV','map','36141YZJULc','12bpilMX','164HXdWvr','sort','10339870UMrNxs','84305XTIdbf','endsWith','Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.','length','1504902zJVVhd','name','6353360meJMrf','2950213OSBxiq','1980-01-01T00:00:00.000Z'];a163_0x241e=function(){return _0x2ab62c;};return a163_0x241e();}const ZIP_MTIME=new Date(a163_0x340efa(0x156));export function createDeterministicZipPackage(_0x3d56d0){const _0x1715e6={};for(const _0x55f2ea of normalizeLocalFiles(_0x3d56d0)){_0x1715e6[_0x55f2ea['path']]=fileContent(_0x55f2ea);}return Buffer['from'](zipSync(_0x1715e6,{'level':0x0,'mtime':ZIP_MTIME}));}export function parseZipPackage(_0x16c56f){const _0x42f6b2=a163_0x340efa;if(_0x16c56f[_0x42f6b2(0x151)]<0x16)throw CliErrors[_0x42f6b2(0x15b)]('Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.');let _0x487a1b;try{_0x487a1b=unzipSync(_0x16c56f,{'filter'(_0x3e9dd3){const _0x1d8b54=_0x42f6b2,_0x34904f=normalizeSkillRelativePath(_0x3e9dd3[_0x1d8b54(0x153)]);if(_0x34904f[_0x1d8b54(0x14f)]('/'))throw CliErrors[_0x1d8b54(0x15b)](_0x1d8b54(0x158)+_0x34904f);return!![];}});}catch(_0x32a931){if(isRuntimeSkillValidationError(_0x32a931))throw _0x32a931;throw CliErrors['validation'](_0x42f6b2(0x150));}return Object[_0x42f6b2(0x15d)](_0x487a1b)[_0x42f6b2(0x15f)](([_0x4fdd48,_0x269938])=>({'path':normalizeSkillRelativePath(_0x4fdd48),'bytes':Buffer['from'](_0x269938)}))[_0x42f6b2(0x163)](compareSkillFiles);}function isRuntimeSkillValidationError(_0xcaf36b){const _0x511f57=a163_0x340efa;return typeof _0xcaf36b===_0x511f57(0x157)&&_0xcaf36b!==null&&_0x511f57(0x15a)in _0xcaf36b&&_0xcaf36b['code']===_0x511f57(0x159);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1087c,_0x5080b8){const _0x4093ea=a164_0x58dc,_0x19e3f8=_0x1087c();while(!![]){try{const _0x3e3f44=parseInt(_0x4093ea(0x12b))/0x1+parseInt(_0x4093ea(0x115))/0x2+parseInt(_0x4093ea(0x12a))/0x3*(-parseInt(_0x4093ea(0x104))/0x4)+parseInt(_0x4093ea(0x12f))/0x5*(parseInt(_0x4093ea(0x11d))/0x6)+-parseInt(_0x4093ea(0x113))/0x7*(parseInt(_0x4093ea(0x11e))/0x8)+parseInt(_0x4093ea(0x109))/0x9*(parseInt(_0x4093ea(0x107))/0xa)+-parseInt(_0x4093ea(0x12d))/0xb*(-parseInt(_0x4093ea(0x111))/0xc);if(_0x3e3f44===_0x5080b8)break;else _0x19e3f8['push'](_0x19e3f8['shift']());}catch(_0x5a04c6){_0x19e3f8['push'](_0x19e3f8['shift']());}}}(a164_0xdcd9,0x96edd));import{CliErrors}from'../../errors.js';import{SKILL_FILE}from'./constants.js';import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';import{fileContent,isSha256Hex,normalizeLocalFiles,normalizeManifestFiles}from'./local-files.js';import{createDeterministicZipPackage,parseZipPackage}from'./zip-codec.js';export function buildSkillPackage(_0x12160b){const _0x2854d8=a164_0x58dc,_0x10d65c=normalizeLocalFiles(_0x12160b);if(!_0x10d65c[_0x2854d8(0x127)](_0x31d915=>_0x31d915[_0x2854d8(0x12c)]===SKILL_FILE))throw CliErrors[_0x2854d8(0x10d)](_0x2854d8(0x126)+SKILL_FILE+_0x2854d8(0x122));const _0x3faf50=localFilesToManifestFiles(_0x10d65c),_0x50687b=createDeterministicZipPackage(_0x10d65c);return{'manifest':{'schemaVersion':0x2,'treeSha256':fileTreeHash(_0x3faf50),'zipSha256':bufferSha256(_0x50687b),'zipSize':_0x50687b[_0x2854d8(0x116)],'files':_0x3faf50},'packageBytes':_0x50687b,'packageBase64':_0x50687b['toString']('base64')};}export function verifyRuntimeSkillPackage(_0x32bf4a,_0x2dce42){const _0x373c23=normalizePackageManifest(_0x32bf4a,{'requireOssPath':![]});if(!_0x373c23)throw CliErrors['validation']('Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.');return extractAndVerifyPackage(_0x373c23,_0x2dce42);}function a164_0xdcd9(){const _0x3d6807=['object','has','Duplicate\x20Skill\x20package\x20entry:\x20','11922KHBLpc','8klqQZs','files','bytes','isArray','\x20in\x20Skill\x20file\x20package.','size','Runtime\x20Skill\x20package\x20file\x20size\x20mismatch:\x20','Runtime\x20Skill\x20package\x20size\x20is\x20invalid.','Missing\x20','some','Runtime\x20Skill\x20package\x20is\x20missing\x20','isSafeInteger','6oKCpuA','1067527IjaTut','path','11NePndm','zipSize','1230DppCrr','ossPath','1898596UufpiX','zipSha256','requireOssPath','10sLGvFe','get','886122eONeAC','set','Runtime\x20Skill\x20package\x20sha256\x20is\x20invalid.','push','validation','Runtime\x20Skill\x20package\x20is\x20required\x20for\x20Skill\x20install:\x20','Runtime\x20Skill\x20package\x20file\x20sha256\x20mismatch:\x20','toLowerCase','5519964debsis','map','7219891FTEdEw','Runtime\x20Skill\x20package\x20sha256\x20mismatch.','968264flMlUl','length','Runtime\x20Skill\x20file\x20tree\x20sha256\x20is\x20invalid.','Runtime\x20Skill\x20file\x20tree\x20sha256\x20mismatch.','sha256'];a164_0xdcd9=function(){return _0x3d6807;};return a164_0xdcd9();}export function verifyRuntimeSkillBundle(_0x5f50d6,_0x2e3cc3){const _0x337f3c=normalizePackageManifest(_0x5f50d6,{'requireOssPath':![]});if(!_0x337f3c)throw CliErrors['validation']('Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.');return extractAndVerifyPackageFiles(_0x337f3c,_0x2e3cc3);}export function tryNormalizePackageManifest(_0x4dc872){return normalizePackageManifest(_0x4dc872,{'requireOssPath':![]});}export function requirePackageBytes(_0x2fec20,_0x3af09e){const _0x43fc38=a164_0x58dc;if(!_0x3af09e||_0x3af09e[_0x43fc38(0x116)]===0x0)throw CliErrors[_0x43fc38(0x10d)](_0x43fc38(0x10e)+_0x2fec20);return _0x3af09e;}export function extractDownloadedPackage(_0x5a196d){const _0x3148f9=a164_0x58dc,_0x1c774c=parseZipPackage(_0x5a196d)[_0x3148f9(0x112)](_0x46448b=>({'path':_0x46448b[_0x3148f9(0x12c)],'bytes':_0x46448b[_0x3148f9(0x120)]}));if(!_0x1c774c['some'](_0x771ceb=>_0x771ceb[_0x3148f9(0x12c)]===SKILL_FILE))throw CliErrors[_0x3148f9(0x10d)](_0x3148f9(0x128)+SKILL_FILE+'.');return normalizeLocalFiles(_0x1c774c);}export function localFilesToManifestFiles(_0x4aba09){const _0x5bf624=a164_0x58dc;return normalizeLocalFiles(_0x4aba09)[_0x5bf624(0x112)](_0x253745=>({'path':_0x253745[_0x5bf624(0x12c)],'sha256':fileHash(_0x253745),'size':fileContent(_0x253745)[_0x5bf624(0x116)]}));}function normalizePackageManifest(_0x2cb406,_0x5f537b){const _0x23f053=a164_0x58dc;if(!_0x2cb406||typeof _0x2cb406!==_0x23f053(0x11a)||Array[_0x23f053(0x121)](_0x2cb406))return undefined;const _0x3450dc=_0x2cb406,_0x22cf3f=typeof _0x3450dc['ossPath']==='string'?_0x3450dc[_0x23f053(0x103)]['trim']():undefined;if(_0x5f537b[_0x23f053(0x106)]&&!_0x22cf3f)return undefined;if(!Array[_0x23f053(0x121)](_0x3450dc[_0x23f053(0x11f)])||_0x3450dc[_0x23f053(0x11f)][_0x23f053(0x116)]===0x0)return undefined;if(!isSha256Hex(_0x3450dc['treeSha256']))throw CliErrors[_0x23f053(0x10d)](_0x23f053(0x117));if(!isSha256Hex(_0x3450dc['zipSha256']))throw CliErrors[_0x23f053(0x10d)](_0x23f053(0x10b));if(!Number['isSafeInteger'](_0x3450dc[_0x23f053(0x12e)])||_0x3450dc['zipSize']<0x0)throw CliErrors['validation'](_0x23f053(0x125));const _0x5e1125=normalizeManifestFiles(_0x3450dc[_0x23f053(0x11f)]);if(!_0x5e1125[_0x23f053(0x127)](_0x4184b1=>_0x4184b1[_0x23f053(0x12c)]===SKILL_FILE))throw CliErrors[_0x23f053(0x10d)]('Runtime\x20Skill\x20manifest\x20is\x20missing\x20'+SKILL_FILE+'.');const _0x2cdabd=fileTreeHash(_0x5e1125);if(_0x2cdabd!==_0x3450dc['treeSha256'][_0x23f053(0x110)]())throw CliErrors[_0x23f053(0x10d)](_0x23f053(0x118));return{'schemaVersion':Number[_0x23f053(0x129)](_0x3450dc['schemaVersion'])?_0x3450dc['schemaVersion']:0x2,'ossPath':_0x22cf3f,'treeSha256':_0x2cdabd,'zipSha256':_0x3450dc['zipSha256']['toLowerCase'](),'zipSize':_0x3450dc[_0x23f053(0x12e)],'files':_0x5e1125};}function a164_0x58dc(_0x201eab,_0x1a1d2f){_0x201eab=_0x201eab-0x103;const _0xdcd91b=a164_0xdcd9();let _0x58dcde=_0xdcd91b[_0x201eab];return _0x58dcde;}function extractAndVerifyPackage(_0x3edef0,_0x564369){const _0x12b816=a164_0x58dc,_0x592c4a=normalizePackageManifest(_0x3edef0,{'requireOssPath':![]});if(!_0x592c4a)throw CliErrors['validation']('Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.');if(_0x564369[_0x12b816(0x116)]!==_0x592c4a[_0x12b816(0x12e)])throw CliErrors['validation']('Runtime\x20Skill\x20package\x20size\x20mismatch.');const _0x5c41a3=bufferSha256(_0x564369);if(_0x5c41a3!==_0x592c4a[_0x12b816(0x105)])throw CliErrors[_0x12b816(0x10d)](_0x12b816(0x114));return extractAndVerifyPackageFiles(_0x592c4a,_0x564369);}function extractAndVerifyPackageFiles(_0x92eef5,_0x22925a){const _0x41392c=a164_0x58dc,_0x34b338=parseZipPackage(_0x22925a);if(_0x34b338[_0x41392c(0x116)]!==_0x92eef5[_0x41392c(0x11f)][_0x41392c(0x116)])throw CliErrors[_0x41392c(0x10d)]('Runtime\x20Skill\x20package\x20entry\x20list\x20mismatch.');const _0x4fcace=new Map();for(const _0xa709b7 of _0x34b338){if(_0x4fcace[_0x41392c(0x11b)](_0xa709b7['path']))throw CliErrors[_0x41392c(0x10d)](_0x41392c(0x11c)+_0xa709b7['path']);_0x4fcace[_0x41392c(0x10a)](_0xa709b7[_0x41392c(0x12c)],_0xa709b7);}const _0x425b32=[];for(const _0x295ef3 of _0x92eef5[_0x41392c(0x11f)]){const _0x5d00b2=_0x4fcace[_0x41392c(0x108)](_0x295ef3[_0x41392c(0x12c)]);if(!_0x5d00b2)throw CliErrors[_0x41392c(0x10d)]('Runtime\x20Skill\x20package\x20is\x20missing\x20entry:\x20'+_0x295ef3[_0x41392c(0x12c)]);if(_0x5d00b2[_0x41392c(0x120)]['length']!==_0x295ef3[_0x41392c(0x123)])throw CliErrors['validation'](_0x41392c(0x124)+_0x295ef3[_0x41392c(0x12c)]);const _0x2fa388=bufferSha256(_0x5d00b2[_0x41392c(0x120)]);if(_0x2fa388!==_0x295ef3[_0x41392c(0x119)])throw CliErrors[_0x41392c(0x10d)](_0x41392c(0x10f)+_0x295ef3[_0x41392c(0x12c)]);_0x425b32[_0x41392c(0x10c)]({'path':_0x295ef3[_0x41392c(0x12c)],'bytes':_0x5d00b2['bytes']});}return normalizeLocalFiles(_0x425b32);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x58f849,_0x5845d6){var _0x5a1df2=a165_0x50c3,_0x2cec78=_0x58f849();while(!![]){try{var _0x40f063=-parseInt(_0x5a1df2(0xa0))/0x1+parseInt(_0x5a1df2(0x96))/0x2*(parseInt(_0x5a1df2(0x9e))/0x3)+-parseInt(_0x5a1df2(0x9c))/0x4*(parseInt(_0x5a1df2(0x98))/0x5)+parseInt(_0x5a1df2(0x9d))/0x6*(parseInt(_0x5a1df2(0x9b))/0x7)+parseInt(_0x5a1df2(0x9a))/0x8*(-parseInt(_0x5a1df2(0x9f))/0x9)+parseInt(_0x5a1df2(0x97))/0xa*(-parseInt(_0x5a1df2(0x99))/0xb)+parseInt(_0x5a1df2(0xa1))/0xc;if(_0x40f063===_0x5845d6)break;else _0x2cec78['push'](_0x2cec78['shift']());}catch(_0x4a9c4a){_0x2cec78['push'](_0x2cec78['shift']());}}}(a165_0x59c5,0xc22d8));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_0x59c5(){var _0x390fd9=['40qneiXR','31472aEBxZE','4MfxLrd','228tiBnoB','1590NSmXdp','2462139vBWuTB','427833aHlBCo','37442652wmmfhK','3260IDJEzs','10VpvRXg','28300hgdTmE','17140959nQaCyi'];a165_0x59c5=function(){return _0x390fd9;};return a165_0x59c5();}export{listLocalRuntimeSkills}from'./runtime-skill-sync/list-local.js';export{materializeRuntimeSkill,reuseMaterializedRuntimeSkill}from'./runtime-skill-sync/materialize.js';function a165_0x50c3(_0x583983,_0x52789c){_0x583983=_0x583983-0x96;var _0x59c5d1=a165_0x59c5();var _0x50c3f9=_0x59c5d1[_0x583983];return _0x50c3f9;}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
|
-
|
|
1
|
+
function a166_0x1f16(_0x41819d,_0x3bf51e){_0x41819d=_0x41819d-0x198;const _0x3d0d18=a166_0x3d0d();let _0x1f16c2=_0x3d0d18[_0x41819d];return _0x1f16c2;}const a166_0x1927df=a166_0x1f16;(function(_0xfdb75b,_0xe33e09){const _0x2d650e=a166_0x1f16,_0xe98fc7=_0xfdb75b();while(!![]){try{const _0x4ecec9=parseInt(_0x2d650e(0x19f))/0x1*(parseInt(_0x2d650e(0x1b4))/0x2)+-parseInt(_0x2d650e(0x1b9))/0x3+parseInt(_0x2d650e(0x199))/0x4*(-parseInt(_0x2d650e(0x1a1))/0x5)+parseInt(_0x2d650e(0x198))/0x6*(parseInt(_0x2d650e(0x19b))/0x7)+-parseInt(_0x2d650e(0x19a))/0x8+parseInt(_0x2d650e(0x1a0))/0x9*(-parseInt(_0x2d650e(0x1b1))/0xa)+parseInt(_0x2d650e(0x1a9))/0xb;if(_0x4ecec9===_0xe33e09)break;else _0xe98fc7['push'](_0xe98fc7['shift']());}catch(_0x3d8819){_0xe98fc7['push'](_0xe98fc7['shift']());}}}(a166_0x3d0d,0x7387d));function a166_0x3d0d(){const _0xfb5963=['skills','unusable','17544417iJPFUD','home','number','\x20uses\x20unsupported\x20version\x20','not-recorded','.claude','absent','.skill-lock.json','2400KjIxSc','globalSkillsDirs','\x20has\x20no\x20skills\x20map','672962dxWxGN','kind','object','recorded','\x22\x20but\x20no\x20SKILL.md\x20was\x20found\x20in\x20known\x20layouts\x20','2115675GtWjur','.agents','unverifiable','reason','6tbyrEp','1572CYAYYh','284616IHryeU','174153ZFZaRB','utf8','parse','map','2ydkwjN','14796upUsio','8705rzxSXF','version','find','message','\x20is\x20unreadable:\x20','join'];a166_0x3d0d=function(){return _0xfb5963;};return a166_0x3d0d();}import{existsSync,readFileSync}from'node:fs';import{homedir}from'node:os';import{join}from'node:path';export const SKILL_LOCK_RELATIVE_PATH=join(a166_0x1927df(0x1ba),a166_0x1927df(0x1b0));export const GLOBAL_SKILLS_DIR_RELATIVE_PATHS=[join('.agents',a166_0x1927df(0x1a7)),join(a166_0x1927df(0x1ae),a166_0x1927df(0x1a7))];const SUPPORTED_LOCK_VERSIONS=[0x3];function readLockLookup(_0x835fde,_0x120bd2){const _0x5be7a6=a166_0x1927df;if(!existsSync(_0x835fde))return{'kind':'not-recorded'};let _0x2824f7;try{_0x2824f7=JSON[_0x5be7a6(0x19d)](readFileSync(_0x835fde,_0x5be7a6(0x19c)));}catch(_0x485cd2){return{'kind':'unusable','reason':_0x835fde+_0x5be7a6(0x1a5)+_0x485cd2[_0x5be7a6(0x1a4)]};}const _0xcbcf2f=_0x2824f7;if(typeof _0xcbcf2f?.[_0x5be7a6(0x1a2)]!==_0x5be7a6(0x1ab)||!SUPPORTED_LOCK_VERSIONS['includes'](_0xcbcf2f['version']))return{'kind':_0x5be7a6(0x1a8),'reason':_0x835fde+_0x5be7a6(0x1ac)+String(_0xcbcf2f?.[_0x5be7a6(0x1a2)])};if(!_0xcbcf2f[_0x5be7a6(0x1a7)]||typeof _0xcbcf2f['skills']!==_0x5be7a6(0x1b6))return{'kind':_0x5be7a6(0x1a8),'reason':_0x835fde+_0x5be7a6(0x1b3)};return _0xcbcf2f[_0x5be7a6(0x1a7)][_0x120bd2]?{'kind':_0x5be7a6(0x1b7)}:{'kind':_0x5be7a6(0x1ad)};}export function resolveInstalledSkill(_0x1270a9,_0x131afa){const _0x51de10=a166_0x1927df,_0x3cd814=_0x131afa?.[_0x51de10(0x1aa)]??homedir(),_0x4c74a9=_0x131afa?.[_0x51de10(0x1b2)]??GLOBAL_SKILLS_DIR_RELATIVE_PATHS[_0x51de10(0x19e)](_0x4fb795=>join(_0x3cd814,_0x4fb795)),_0xe482a6=_0x131afa?.['lockFile']??join(_0x3cd814,SKILL_LOCK_RELATIVE_PATH),_0xf358dc=_0x4c74a9['map'](_0x17c235=>join(_0x17c235,_0x1270a9,'SKILL.md')),_0x228972=_0xf358dc[_0x51de10(0x1a3)](_0x95da41=>existsSync(_0x95da41));if(_0x228972)return{'state':'present','path':_0x228972};const _0x426fbc=readLockLookup(_0xe482a6,_0x1270a9);if(_0x426fbc[_0x51de10(0x1b5)]===_0x51de10(0x1a8))return{'state':_0x51de10(0x1bb),'reason':_0x426fbc[_0x51de10(0x1bc)]};if(_0x426fbc['kind']===_0x51de10(0x1b7))return{'state':_0x51de10(0x1bb),'reason':_0xe482a6+'\x20records\x20\x22'+_0x1270a9+_0x51de10(0x1b8)+('('+_0xf358dc[_0x51de10(0x1a6)](',\x20')+')')};return{'state':_0x51de10(0x1af),'checked':_0xf358dc};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a167_0x3e4dbf=a167_0x20b8;(function(_0x1b1c5e,_0x4dd5aa){const _0x37cbbd=a167_0x20b8,_0x2e0e5c=_0x1b1c5e();while(!![]){try{const _0x4ea74f=parseInt(_0x37cbbd(0x170))/0x1*(parseInt(_0x37cbbd(0x167))/0x2)+parseInt(_0x37cbbd(0x17d))/0x3+-parseInt(_0x37cbbd(0x178))/0x4*(parseInt(_0x37cbbd(0x17a))/0x5)+parseInt(_0x37cbbd(0x16f))/0x6+parseInt(_0x37cbbd(0x174))/0x7*(parseInt(_0x37cbbd(0x176))/0x8)+parseInt(_0x37cbbd(0x175))/0x9+-parseInt(_0x37cbbd(0x171))/0xa;if(_0x4ea74f===_0x4dd5aa)break;else _0x2e0e5c['push'](_0x2e0e5c['shift']());}catch(_0x1971fc){_0x2e0e5c['push'](_0x2e0e5c['shift']());}}}(a167_0x1ece,0x67ef9));const REDACTED_ACCESS_KEY=a167_0x3e4dbf(0x17c);export function maskCliAccessKey(_0x5cc1e0){const _0x34f9df=a167_0x3e4dbf;if(typeof _0x5cc1e0!=='string'||_0x5cc1e0[_0x34f9df(0x172)]<=0x8)return REDACTED_ACCESS_KEY;return''+_0x5cc1e0[_0x34f9df(0x179)](0x0,0x8)+'*'[_0x34f9df(0x17b)](_0x5cc1e0[_0x34f9df(0x172)]-0x8);}export function redactCliConfigCredentials(_0x41ee43){const _0x396892=a167_0x3e4dbf,_0x51ce8a={..._0x41ee43};return Object[_0x396892(0x173)][_0x396892(0x168)][_0x396892(0x16d)](_0x51ce8a,_0x396892(0x16c))&&(_0x51ce8a['accessKey']=maskCliAccessKey(_0x51ce8a[_0x396892(0x16c)])),_0x51ce8a[_0x396892(0x16b)]&&typeof _0x51ce8a[_0x396892(0x16b)]===_0x396892(0x17e)&&!Array['isArray'](_0x51ce8a[_0x396892(0x16b)])&&(_0x51ce8a['apps']=redactLegacyAppCredentials(_0x51ce8a[_0x396892(0x16b)])),_0x51ce8a;}function a167_0x20b8(_0x69941b,_0x4266dc){_0x69941b=_0x69941b-0x166;const _0x1ece63=a167_0x1ece();let _0x20b8a7=_0x1ece63[_0x69941b];return _0x20b8a7;}function a167_0x1ece(){const _0x3d04a1=['map','670McLUFx','hasOwnProperty','entries','test','apps','accessKey','call','isArray','245628UGbrZI','1648GgviXJ','3040670XaVvIZ','length','prototype','13153WMcPAb','2969019cXlwpa','976SJykYX','fromEntries','61620owxhgJ','slice','235GdBbpc','repeat','<redacted>','905028UfZJEW','object'];a167_0x1ece=function(){return _0x3d04a1;};return a167_0x1ece();}export function redactCliConfigValue(_0x3fa8d8,_0x8f85a3){const _0x315de7=a167_0x3e4dbf;if(_0x3fa8d8==='accessKey'||/^apps\.[^.]+\.accessKey$/[_0x315de7(0x16a)](_0x3fa8d8))return maskCliAccessKey(_0x8f85a3);if(_0x3fa8d8===_0x315de7(0x16b)&&_0x8f85a3&&typeof _0x8f85a3===_0x315de7(0x17e)&&!Array[_0x315de7(0x16e)](_0x8f85a3))return redactLegacyAppCredentials(_0x8f85a3);if(/^apps\.[^.]+$/[_0x315de7(0x16a)](_0x3fa8d8)&&_0x8f85a3&&typeof _0x8f85a3===_0x315de7(0x17e)&&!Array[_0x315de7(0x16e)](_0x8f85a3)){const _0x529a4f=_0x8f85a3;return Object[_0x315de7(0x173)]['hasOwnProperty'][_0x315de7(0x16d)](_0x529a4f,'accessKey')?{..._0x529a4f,'accessKey':maskCliAccessKey(_0x529a4f[_0x315de7(0x16c)])}:_0x8f85a3;}return _0x8f85a3;}function redactLegacyAppCredentials(_0x2333cc){const _0x1b21e5=a167_0x3e4dbf;return Object[_0x1b21e5(0x177)](Object[_0x1b21e5(0x169)](_0x2333cc)[_0x1b21e5(0x166)](([_0x47c1a1,_0x5944fb])=>{const _0x124914=_0x1b21e5;if(!_0x5944fb||typeof _0x5944fb!==_0x124914(0x17e)||Array[_0x124914(0x16e)](_0x5944fb))return[_0x47c1a1,_0x5944fb];const _0x582117={..._0x5944fb};return Object['prototype'][_0x124914(0x168)][_0x124914(0x16d)](_0x582117,'accessKey')&&(_0x582117[_0x124914(0x16c)]=maskCliAccessKey(_0x582117[_0x124914(0x16c)])),[_0x47c1a1,_0x582117];}));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a168_0x3d9a(_0x154898,_0x1b327d){_0x154898=_0x154898-0x10b;const _0x551c73=a168_0x551c();let _0x3d9a44=_0x551c73[_0x154898];return _0x3d9a44;}(function(_0x17a06f,_0x1a56e9){const _0x3dc069=a168_0x3d9a,_0x3b7988=_0x17a06f();while(!![]){try{const _0x12508f=parseInt(_0x3dc069(0x112))/0x1+-parseInt(_0x3dc069(0x113))/0x2+-parseInt(_0x3dc069(0x10b))/0x3*(parseInt(_0x3dc069(0x111))/0x4)+-parseInt(_0x3dc069(0x10e))/0x5+parseInt(_0x3dc069(0x10c))/0x6+parseInt(_0x3dc069(0x110))/0x7+parseInt(_0x3dc069(0x10d))/0x8*(parseInt(_0x3dc069(0x10f))/0x9);if(_0x12508f===_0x1a56e9)break;else _0x3b7988['push'](_0x3b7988['shift']());}catch(_0x43bb37){_0x3b7988['push'](_0x3b7988['shift']());}}}(a168_0x551c,0x2b1ec));import{createJqFilter,resolveBundledJqPaths}from'@lovrabet/cli-framework';import{CliErrors}from'../errors.js';function a168_0x551c(){const _0x3b89cf=['24580lUVCVg','21223WgMBRj','459744OEjJBw','15ThQdYR','335844ETBJwZ','24VOmeON','1462830iZIouU','943146rFFoEJ','2367428tZVzFB'];a168_0x551c=function(){return _0x3b89cf;};return a168_0x551c();}export const applyJqFilter=createJqFilter(CliErrors,{'bundledJqPaths':resolveBundledJqPaths()});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x43bfa6,_0x3d61b9){const _0x431b50=a169_0x4c3e,_0x5f26bb=_0x43bfa6();while(!![]){try{const _0xe90483=-parseInt(_0x431b50(0xa7))/0x1+parseInt(_0x431b50(0xaf))/0x2+parseInt(_0x431b50(0xa0))/0x3+-parseInt(_0x431b50(0xb1))/0x4+parseInt(_0x431b50(0xa3))/0x5+-parseInt(_0x431b50(0xa8))/0x6+parseInt(_0x431b50(0xae))/0x7;if(_0xe90483===_0x3d61b9)break;else _0x5f26bb['push'](_0x5f26bb['shift']());}catch(_0x24601a){_0x5f26bb['push'](_0x5f26bb['shift']());}}}(a169_0xf634,0x50900));import a169_0x1c0301 from'semver';import{LOVRABET_NPM_PACKAGE_NAME}from'../constant/distribution.js';import{CliErrors}from'../errors.js';import{getCliVersionPolicy}from'../utils/cli-version-policy.js';import{getCliVersion}from'../utils/version.js';function a169_0xf634(){const _0x439c28=['Upgrade\x20command:\x20','minimumVersion','1715441yeOuiL','998368GlBTWP','valid','251184noxNwA','Current\x20CLI\x20version\x20is\x20below\x20the\x20minimum\x20supported\x20version.','Recommended\x20stable:\x20','Current\x20version:\x20','1728525tVSETq','filter','latest','1331425fKBSzB','npm\x20install\x20-g\x20','stableVersion','upgradeMessage','555544eONGoA','3830298cWXunP','minimumVersionMessage','join','Minimum\x20supported:\x20'];a169_0xf634=function(){return _0x439c28;};return a169_0xf634();}export function evaluateCliVersionPolicy(_0x4c2583,_0x727a99){const _0x3e78ff=a169_0x4c3e,_0x579e34=a169_0x1c0301[_0x3e78ff(0xb0)](_0x4c2583)===_0x4c2583,_0x89f1e8=_0x727a99?.[_0x3e78ff(0xa5)]??null,_0x4f9ca6=_0x727a99?.['minimumVersion']??null,_0x2eec4d=Boolean(_0x579e34&&_0x89f1e8&&a169_0x1c0301['lt'](_0x4c2583,_0x89f1e8)),_0xe9ce90=Boolean(_0x579e34&&_0x4f9ca6&&a169_0x1c0301['lt'](_0x4c2583,_0x4f9ca6));return{'currentVersion':_0x4c2583,'stableVersion':_0x89f1e8,'minimumVersion':_0x4f9ca6,'needsUpgrade':_0x2eec4d||_0xe9ce90,'belowMinimum':_0xe9ce90,'upgradeMessage':_0x727a99?.[_0x3e78ff(0xa6)],'minimumVersionMessage':_0x727a99?.[_0x3e78ff(0xa9)]};}export async function checkCliVersion(){return evaluateCliVersionPolicy(getCliVersion(),await getCliVersionPolicy());}export function getCliUpgradeCommand(_0xe6028c){const _0x54a3e0=a169_0x4c3e;return _0x54a3e0(0xa4)+LOVRABET_NPM_PACKAGE_NAME+'@'+(_0xe6028c[_0x54a3e0(0xa5)]??_0x54a3e0(0xa2));}function a169_0x4c3e(_0x279ba2,_0x52889c){_0x279ba2=_0x279ba2-0xa0;const _0xf634bf=a169_0xf634();let _0x4c3e9e=_0xf634bf[_0x279ba2];return _0x4c3e9e;}export function assertCliVersionSupported(_0x205b8c){const _0xc5ca2=a169_0x4c3e;if(!_0x205b8c['belowMinimum'])return;const _0x15a233=[_0x205b8c[_0xc5ca2(0xa9)],_0xc5ca2(0xb4)+_0x205b8c['currentVersion'],_0xc5ca2(0xab)+_0x205b8c[_0xc5ca2(0xad)],_0xc5ca2(0xb3)+(_0x205b8c[_0xc5ca2(0xa5)]??'unavailable'),_0xc5ca2(0xac)+getCliUpgradeCommand(_0x205b8c)][_0xc5ca2(0xa1)](Boolean)[_0xc5ca2(0xaa)]('\x0a');throw CliErrors['validation'](_0xc5ca2(0xb2),_0x15a233);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2fc143,_0x19ecba){const _0x231afb=a170_0x3b94,_0x5647d3=_0x2fc143();while(!![]){try{const _0x37acd8=parseInt(_0x231afb(0x15c))/0x1+-parseInt(_0x231afb(0x14d))/0x2*(parseInt(_0x231afb(0x14c))/0x3)+-parseInt(_0x231afb(0x158))/0x4+-parseInt(_0x231afb(0x14e))/0x5*(parseInt(_0x231afb(0x14f))/0x6)+-parseInt(_0x231afb(0x164))/0x7+-parseInt(_0x231afb(0x159))/0x8*(parseInt(_0x231afb(0x153))/0x9)+-parseInt(_0x231afb(0x161))/0xa*(-parseInt(_0x231afb(0x15f))/0xb);if(_0x37acd8===_0x19ecba)break;else _0x5647d3['push'](_0x5647d3['shift']());}catch(_0xaf2542){_0x5647d3['push'](_0x5647d3['shift']());}}}(a170_0x3e56,0x18caa));import a170_0x1ab70e 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(_0x16b2e6){const _0x12e18d=a170_0x3b94;return typeof _0x16b2e6===_0x12e18d(0x163)&&_0x16b2e6[_0x12e18d(0x156)]()?_0x16b2e6[_0x12e18d(0x156)]():null;}function pickStrictSemver(_0x58dd41){const _0x4a5c7e=a170_0x3b94,_0x4c76cf=pickString(_0x58dd41);return _0x4c76cf&&a170_0x1ab70e[_0x4a5c7e(0x15e)](_0x4c76cf)===_0x4c76cf?_0x4c76cf:null;}function a170_0x3e56(){const _0x290ac4=['184563tnLClS','recommendedVersion','now','trim','minimumVersionMessage','104520qAhhYp','24tKJWYa','cli','upgradeMessage','84343npQfdC','application/json','valid','252692IBDUNh','timeout','110svgDNX','object','string','682591UUrRtN','6Oieydw','2872COTdWC','5sVQyAg','284718uNVIcq','minVersion','latestVersion','stableVersion'];a170_0x3e56=function(){return _0x290ac4;};return a170_0x3e56();}export function normalizeCliVersionPolicy(_0x540f8b){const _0x71e557=a170_0x3b94;if(!_0x540f8b||typeof _0x540f8b!==_0x71e557(0x162))return null;const _0x2b4520=_0x540f8b,_0x36c2c7=_0x2b4520[_0x71e557(0x15a)]&&typeof _0x2b4520[_0x71e557(0x15a)]===_0x71e557(0x162)?_0x2b4520[_0x71e557(0x15a)]:_0x2b4520,_0x27851e=pickStrictSemver(_0x36c2c7[_0x71e557(0x152)]??_0x36c2c7[_0x71e557(0x151)]??_0x36c2c7[_0x71e557(0x154)]),_0x1e9c38=pickStrictSemver(_0x36c2c7['minimumVersion']??_0x36c2c7[_0x71e557(0x150)]);if(!_0x27851e&&!_0x1e9c38)return null;if(_0x27851e&&_0x1e9c38&&a170_0x1ab70e['gt'](_0x1e9c38,_0x27851e))return null;return{'stableVersion':_0x27851e,'minimumVersion':_0x1e9c38,'upgradeMessage':pickString(_0x36c2c7[_0x71e557(0x15b)])??undefined,'minimumVersionMessage':pickString(_0x36c2c7[_0x71e557(0x157)])??undefined};}export async function fetchCliVersionPolicy(){const _0x4aad38=a170_0x3b94;try{const _0x349464=await fetch(LOVRABET_CLI_VERSION_POLICY_URL,{'headers':{'Accept':_0x4aad38(0x15d)},'signal':AbortSignal[_0x4aad38(0x160)](FETCH_TIMEOUT_MS)});if(!_0x349464['ok'])return null;return normalizeCliVersionPolicy(await _0x349464['json']());}catch{return null;}}let cachedPolicy=null,cachedAt=0x0,hasCachedPolicy=![],pendingPolicy=null;export async function getCliVersionPolicy(){const _0x512670=a170_0x3b94,_0x1c9f25=Date[_0x512670(0x155)]();if(hasCachedPolicy){const _0x108fb2=cachedPolicy?SUCCESS_CACHE_TTL_MS:FAILURE_CACHE_TTL_MS;if(_0x1c9f25-cachedAt<_0x108fb2)return cachedPolicy;}if(pendingPolicy)return pendingPolicy;return pendingPolicy=fetchCliVersionPolicy()['then'](_0x4f9f08=>{const _0x2fd6a4=_0x512670;return cachedPolicy=_0x4f9f08,cachedAt=Date[_0x2fd6a4(0x155)](),hasCachedPolicy=!![],_0x4f9f08;})['finally'](()=>{pendingPolicy=null;}),pendingPolicy;}function a170_0x3b94(_0x141462,_0x1aa152){_0x141462=_0x141462-0x14c;const _0x3e5643=a170_0x3e56();let _0x3b9402=_0x3e5643[_0x141462];return _0x3b9402;}export function clearCliVersionPolicyCache(){cachedPolicy=null,cachedAt=0x0,hasCachedPolicy=![],pendingPolicy=null;}
|
package/lib/utils/logger.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a171_0x3c7b(){const _0xc15474=['trim','logFileName','Failed\x20to\x20read\x20logs:','now','688695NMMVtX','writeFileSync','Failed:\x20','rawCommand','map','initWinstonLogger','4465764VLxaSb','2455565eNtTgm','1154936fghrOF','52ohnNzJ','toISOString','Failed\x20to\x20clear\x20logs:','level','8986850qOLiwM','success','combine','10NoGdNl','command','Completed:\x20','error','mkdirSync','logTask','winstonLogger','message','info','Starting:\x20','warn','format','File','unknown','existsSync','green','logFilePath','log','details','189009MUFjTF','getWinstonInstance','clear','readLogs','utf8','createLogger','duration','transports','split','dirname','blue','9BSFNDX','63995vdvWSE','currentRawCommand','timestamp','errors','setRawCommand','yellow'];a171_0x3c7b=function(){return _0xc15474;};return a171_0x3c7b();}const a171_0x4fe3eb=a171_0x288c;(function(_0x39a597,_0x73f579){const _0x3fbe0e=a171_0x288c,_0x1d6230=_0x39a597();while(!![]){try{const _0x1da67a=-parseInt(_0x3fbe0e(0xb6))/0x1+parseInt(_0x3fbe0e(0xc6))/0x2*(parseInt(_0x3fbe0e(0xd9))/0x3)+-parseInt(_0x3fbe0e(0xbf))/0x4*(-parseInt(_0x3fbe0e(0xe5))/0x5)+-parseInt(_0x3fbe0e(0xbc))/0x6+parseInt(_0x3fbe0e(0xbd))/0x7+parseInt(_0x3fbe0e(0xbe))/0x8+parseInt(_0x3fbe0e(0xe4))/0x9*(parseInt(_0x3fbe0e(0xc3))/0xa);if(_0x1da67a===_0x73f579)break;else _0x1d6230['push'](_0x1d6230['shift']());}catch(_0x4541fa){_0x1d6230['push'](_0x1d6230['shift']());}}}(a171_0x3c7b,0x6bf94));import a171_0x2cee21 from'winston';import a171_0x499352 from'node:fs';import a171_0x7609b1 from'node:path';function a171_0x288c(_0xb9598f,_0x3622d8){_0xb9598f=_0xb9598f-0xad;const _0x3c7b59=a171_0x3c7b();let _0x288c62=_0x3c7b59[_0xb9598f];return _0x288c62;}import{PRODUCT_CONFIG}from'../constant/product.js';class Logger{[a171_0x4fe3eb(0xcc)];[a171_0x4fe3eb(0xd6)]='';[a171_0x4fe3eb(0xad)]='';constructor(){}[a171_0x4fe3eb(0xb0)](_0x385e56){this['currentRawCommand']=_0x385e56;}['setLogPath'](_0x55dbc6){const _0x15f86a=a171_0x4fe3eb;this[_0x15f86a(0xd6)]=a171_0x7609b1['join'](_0x55dbc6,PRODUCT_CONFIG[_0x15f86a(0xb3)]),this[_0x15f86a(0xcc)]&&this['winstonLogger'][_0x15f86a(0xdb)](),this[_0x15f86a(0xbb)]();}['initWinstonLogger'](){const _0x4bbe8e=a171_0x4fe3eb,_0x2d1b3a=a171_0x7609b1[_0x4bbe8e(0xe2)](this[_0x4bbe8e(0xd6)]);!a171_0x499352['existsSync'](_0x2d1b3a)&&a171_0x499352[_0x4bbe8e(0xca)](_0x2d1b3a,{'recursive':!![]});const _0x319d55=a171_0x2cee21[_0x4bbe8e(0xd1)][_0x4bbe8e(0xc5)](a171_0x2cee21[_0x4bbe8e(0xd1)][_0x4bbe8e(0xae)](),a171_0x2cee21[_0x4bbe8e(0xd1)][_0x4bbe8e(0xaf)]({'stack':!![]}),a171_0x2cee21[_0x4bbe8e(0xd1)]['printf'](_0x5941d3=>{const _0x470a69=_0x4bbe8e,_0x117dcd={'timestamp':_0x5941d3[_0x470a69(0xae)]||new Date()[_0x470a69(0xc0)](),'level':_0x5941d3[_0x470a69(0xc2)]||_0x470a69(0xce),'command':_0x5941d3[_0x470a69(0xc7)]||_0x470a69(0xd3),'rawCommand':_0x5941d3[_0x470a69(0xb9)]||this[_0x470a69(0xad)]||undefined,'message':_0x5941d3[_0x470a69(0xcd)]||'','duration':_0x5941d3[_0x470a69(0xdf)]||undefined,'details':_0x5941d3[_0x470a69(0xd8)]||undefined};return JSON['stringify'](_0x117dcd);}));this['winstonLogger']=a171_0x2cee21[_0x4bbe8e(0xde)]({'level':_0x4bbe8e(0xce),'format':_0x319d55,'transports':[new a171_0x2cee21[(_0x4bbe8e(0xe0))][(_0x4bbe8e(0xd2))]({'filename':this[_0x4bbe8e(0xd6)],'level':_0x4bbe8e(0xce)})],'silent':![]}),a171_0x2cee21['addColors']({'success':_0x4bbe8e(0xd5),'error':'red','warn':_0x4bbe8e(0xb1),'info':_0x4bbe8e(0xe3)});}[a171_0x4fe3eb(0xce)](_0x5b0be1,_0x1cbdbd,_0x68d622){const _0x4b8ca9=a171_0x4fe3eb;if(!this[_0x4b8ca9(0xd6)]||!this[_0x4b8ca9(0xcc)])return;this['winstonLogger'][_0x4b8ca9(0xce)](_0x1cbdbd,{'command':_0x5b0be1,'details':_0x68d622});}[a171_0x4fe3eb(0xc4)](_0x560b6b,_0x415163,_0x144ee1,_0x4aaec7){const _0x465a86=a171_0x4fe3eb;if(!this[_0x465a86(0xd6)]||!this[_0x465a86(0xcc)])return;this[_0x465a86(0xcc)][_0x465a86(0xd7)](_0x465a86(0xce),_0x415163,{'level':_0x465a86(0xc4),'command':_0x560b6b,'duration':_0x144ee1,'details':_0x4aaec7});}[a171_0x4fe3eb(0xc9)](_0x15a755,_0x3f5c4c,_0x3e0b61){const _0x460f5e=a171_0x4fe3eb;if(!this[_0x460f5e(0xd6)]||!this[_0x460f5e(0xcc)])return;this[_0x460f5e(0xcc)][_0x460f5e(0xc9)](_0x3f5c4c,{'command':_0x15a755,'details':_0x3e0b61});}['warn'](_0x83e1a6,_0x346d48,_0x561fb6){const _0x5b5e94=a171_0x4fe3eb;if(!this[_0x5b5e94(0xd6)]||!this['winstonLogger'])return;this[_0x5b5e94(0xcc)][_0x5b5e94(0xd0)](_0x346d48,{'command':_0x83e1a6,'details':_0x561fb6});}async[a171_0x4fe3eb(0xcb)](_0x30d0ef,_0xe68cd1,_0x282c91){const _0x3495d8=a171_0x4fe3eb,_0x40c514=Date[_0x3495d8(0xb5)]();this[_0x3495d8(0xce)](_0x30d0ef,_0x3495d8(0xcf)+_0xe68cd1);try{const _0x4af55b=await _0x282c91(),_0x1fb001=Date['now']()-_0x40c514;return this[_0x3495d8(0xc4)](_0x30d0ef,_0x3495d8(0xc8)+_0xe68cd1,_0x1fb001),_0x4af55b;}catch(_0x5a7b8f){const _0x362a12=Date['now']()-_0x40c514;this['error'](_0x30d0ef,_0x3495d8(0xb8)+_0xe68cd1,{'error':_0x5a7b8f instanceof Error?_0x5a7b8f[_0x3495d8(0xcd)]:String(_0x5a7b8f),'duration':_0x362a12});throw _0x5a7b8f;}}[a171_0x4fe3eb(0xdc)](){const _0x47c27c=a171_0x4fe3eb;try{if(!a171_0x499352[_0x47c27c(0xd4)](this[_0x47c27c(0xd6)]))return[];const _0x3fdfc8=a171_0x499352['readFileSync'](this[_0x47c27c(0xd6)],_0x47c27c(0xdd));return _0x3fdfc8[_0x47c27c(0xe1)](/\r?\n/)['filter'](_0x26c973=>_0x26c973[_0x47c27c(0xb2)]())[_0x47c27c(0xba)](_0x17d59f=>JSON['parse'](_0x17d59f));}catch(_0x11b361){return console[_0x47c27c(0xd0)](_0x47c27c(0xb4),_0x11b361),[];}}['clearLogs'](){const _0xd4de1d=a171_0x4fe3eb;try{a171_0x499352[_0xd4de1d(0xd4)](this[_0xd4de1d(0xd6)])&&a171_0x499352[_0xd4de1d(0xb7)](this[_0xd4de1d(0xd6)],'',_0xd4de1d(0xdd));}catch(_0x3d0609){console['warn'](_0xd4de1d(0xc1),_0x3d0609);}}[a171_0x4fe3eb(0xda)](){return this['winstonLogger'];}}export const logger=new Logger();
|