@lovrabet/lovrabet-cli 2.3.5 → 2.3.6-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli.js +1 -1
- package/lib/commands/api-doc/index.js +1 -1
- package/lib/commands/app/cache.js +1 -1
- package/lib/commands/app/definitions.js +1 -1
- package/lib/commands/app/eligibility.js +1 -1
- package/lib/commands/app/mock-loader.js +1 -1
- package/lib/commands/app/remote-source.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/approval/index.js +1 -1
- package/lib/commands/artifact/index.js +1 -1
- package/lib/commands/auth/device.js +1 -1
- package/lib/commands/auth/index.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.d.ts +3 -3
- 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 +11 -0
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/kb-search-client.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/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.d.ts +3 -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.d.ts +3 -0
- package/lib/services/dataset-import/image-bytes.js +1 -0
- package/lib/services/dataset-import/image-ooxml.d.ts +10 -0
- package/lib/services/dataset-import/image-ooxml.js +1 -0
- package/lib/services/dataset-import/image-runner.d.ts +48 -0
- package/lib/services/dataset-import/image-runner.js +1 -0
- package/lib/services/dataset-import/metadata.js +1 -1
- package/lib/services/dataset-import/preview.js +1 -1
- package/lib/services/dataset-import/runner.d.ts +10 -1
- package/lib/services/dataset-import/runner.js +1 -1
- package/lib/services/dataset-import/types.d.ts +28 -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 +4 -1
- package/skills/lovrabet/SKILL.md +7 -3
- package/skills/lovrabet/guides/app-resolution.md +2 -0
- package/skills/lovrabet/guides/dataset-and-data-workflow.md +10 -1
- package/skills/lovrabet/references/dataset-discovery-workflow.md +14 -1
- package/skills/lovrabet/references/instant-api-workflow.md +2 -0
- package/skills/lovrabet/references/lovrabet-app.md +2 -0
- package/skills/lovrabet/references/lovrabet-excel-import.md +19 -0
- package/skills/lovrabet.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x518e7c,_0x2f6cc6){const _0x16976d=a154_0x5e86,_0x4cb1e0=_0x518e7c();while(!![]){try{const _0x41e2a3=parseInt(_0x16976d(0x124))/0x1*(-parseInt(_0x16976d(0x10c))/0x2)+-parseInt(_0x16976d(0x113))/0x3+-parseInt(_0x16976d(0x11e))/0x4*(-parseInt(_0x16976d(0x126))/0x5)+parseInt(_0x16976d(0x103))/0x6+parseInt(_0x16976d(0xfb))/0x7*(parseInt(_0x16976d(0x10e))/0x8)+parseInt(_0x16976d(0x115))/0x9*(parseInt(_0x16976d(0x119))/0xa)+parseInt(_0x16976d(0x102))/0xb*(-parseInt(_0x16976d(0x108))/0xc);if(_0x41e2a3===_0x2f6cc6)break;else _0x4cb1e0['push'](_0x4cb1e0['shift']());}catch(_0x89de04){_0x4cb1e0['push'](_0x4cb1e0['shift']());}}}(a154_0x2b26,0xa8004));import{existsSync,readdirSync}from'node:fs';import{resolve}from'node:path';function a154_0x5e86(_0xe30be7,_0x5327d8){_0xe30be7=_0xe30be7-0xf9;const _0x2b262a=a154_0x2b26();let _0x5e861f=_0x2b262a[_0xe30be7];return _0x5e861f;}import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{readMetadataIfPresent}from'./metadata.js';import{getRuntimeSkillCacheRoot,safePathSegment}from'./paths.js';function a154_0x2b26(){const _0x47da30=['name','51112yuvFRh','isSymbolicLink','Runtime\x20Skill\x20install\x20target\x20app\x20mismatch:\x20','link','env','1757013mKsvjS','localeCompare','338319FjXSuo','builtin','trim','skillCode','130mWymix','source','\x20!=\x20','linkedPath','from','344ThAjPy','cache','sort','has','set','scope','179hXmQqL','dir','44465foRMbY','startsWith','isArray','scopes','1498ohvymg','get','tags','appCode','accessKey','values','code','429uqiZgw','3777054gqGfOa','metadataPath','includes','skillRoots','local','201996dRxrWM','filter','push','linkedPaths','14748ugcVZB'];a154_0x2b26=function(){return _0x47da30;};return a154_0x2b26();}import{isRuntimeSkillScope,normalizeRuntimeSkillScopes}from'./scopes.js';export function listLocalRuntimeSkills(_0x5a41e3,_0x1ef8cc,_0x50b8ea={}){const _0x2b3c6b=a154_0x5e86,_0x538f5e=safePathSegment(_0x5a41e3[_0x2b3c6b(0xfe)],'appCode');if(_0x1ef8cc[_0x2b3c6b(0xfe)]!==_0x538f5e)throw CliErrors['validation'](_0x2b3c6b(0x110)+_0x1ef8cc[_0x2b3c6b(0xfe)]+_0x2b3c6b(0x11b)+_0x538f5e);const _0x1500d1=normalizeRuntimeSkillScopes(_0x5a41e3[_0x2b3c6b(0xfa)]),_0x3ad2dc=new Set(_0x1500d1),_0xf8f628=_0x5a41e3[_0x2b3c6b(0x101)]?.[_0x2b3c6b(0x117)](),_0x3d21a3=new Map(),_0x95f013=resolve(getRuntimeSkillCacheRoot(_0x5a41e3[_0x2b3c6b(0x112)],_0x5a41e3[_0x2b3c6b(0xff)],_0x50b8ea),_0x538f5e);for(const _0x5248a6 of _0x1500d1){for(const _0x5ce3f2 of localSkillEntryDirs(resolve(_0x95f013,_0x5248a6))){collectLocalRuntimeSkill(_0x3d21a3,_0x5ce3f2,{'appCode':_0x538f5e,'scopes':_0x3ad2dc,'code':_0xf8f628,'source':'cache'});}}for(const _0x5c94a5 of _0x1ef8cc[_0x2b3c6b(0x106)]){for(const _0x3035f8 of localSkillLinkCandidates(_0x5c94a5,_0x1ef8cc,_0x3ad2dc)){collectLocalRuntimeSkill(_0x3d21a3,_0x3035f8,{'appCode':_0x538f5e,'scopes':_0x3ad2dc,'code':_0xf8f628,'source':_0x2b3c6b(0x111),'linkedPath':_0x3035f8});}}return Array[_0x2b3c6b(0x11d)](_0x3d21a3[_0x2b3c6b(0x100)]())[_0x2b3c6b(0x120)](compareLocalRuntimeSkills);}function localSkillEntryDirs(_0x18ec43){const _0x474337=a154_0x5e86;if(!existsSync(_0x18ec43))return[];return readdirSync(_0x18ec43,{'withFileTypes':!![]})[_0x474337(0x109)](_0x58de88=>_0x58de88['isDirectory']()||_0x58de88[_0x474337(0x10f)]())['map'](_0x1545dc=>resolve(_0x18ec43,_0x1545dc[_0x474337(0x10d)]));}function localSkillLinkCandidates(_0x2294d6,_0x543440,_0x316c64){const _0x199516=a154_0x5e86;if(!existsSync(_0x2294d6))return[];const _0x35c95f=_0x543440[_0x199516(0xfe)]+'--';return readdirSync(_0x2294d6,{'withFileTypes':!![]})[_0x199516(0x109)](_0x258d76=>_0x258d76['isDirectory']()||_0x258d76['isSymbolicLink']())[_0x199516(0x109)](_0x22f2d7=>_0x543440[_0x199516(0x123)]==='project'||_0x22f2d7[_0x199516(0x10d)][_0x199516(0x127)](_0x35c95f)||_0x316c64[_0x199516(0x121)](_0x199516(0x116)))['map'](_0x2c1ea9=>resolve(_0x2294d6,_0x2c1ea9[_0x199516(0x10d)]));}function collectLocalRuntimeSkill(_0x37d20d,_0x4f686b,_0x398ec7){const _0x2dc9d4=a154_0x5e86,_0x1a6ce3=resolve(_0x4f686b,METADATA_FILE),_0x15f283=readMetadataIfPresent(_0x1a6ce3);if(!_0x15f283)return;if(_0x15f283[_0x2dc9d4(0xfe)]!==_0x398ec7[_0x2dc9d4(0xfe)])return;if(!isRuntimeSkillScope(_0x15f283[_0x2dc9d4(0x123)])||!_0x398ec7[_0x2dc9d4(0xfa)][_0x2dc9d4(0x121)](_0x15f283[_0x2dc9d4(0x123)]))return;const _0x30859c=_0x15f283[_0x2dc9d4(0x118)]?.['trim']();if(!_0x30859c)return;if(_0x398ec7[_0x2dc9d4(0x101)]&&_0x30859c!==_0x398ec7[_0x2dc9d4(0x101)])return;const _0x3d1f45=_0x15f283['scope']+':'+_0x30859c,_0x2e3ac6=_0x398ec7[_0x2dc9d4(0x11c)]?[_0x398ec7[_0x2dc9d4(0x11c)]]:[],_0xca45bb=_0x37d20d[_0x2dc9d4(0xfc)](_0x3d1f45);if(_0xca45bb){_0x398ec7[_0x2dc9d4(0x11a)]===_0x2dc9d4(0x11f)&&(_0xca45bb['dir']=_0x4f686b,_0xca45bb['cacheDir']=_0x4f686b,_0xca45bb['skillMdPath']=resolve(_0x4f686b,SKILL_FILE),_0xca45bb[_0x2dc9d4(0x104)]=_0x1a6ce3);for(const _0x10b7c0 of _0x2e3ac6){!_0xca45bb[_0x2dc9d4(0x10b)][_0x2dc9d4(0x105)](_0x10b7c0)&&_0xca45bb[_0x2dc9d4(0x10b)][_0x2dc9d4(0x10a)](_0x10b7c0);}_0xca45bb[_0x2dc9d4(0x10b)][_0x2dc9d4(0x120)]();return;}_0x37d20d[_0x2dc9d4(0x122)](_0x3d1f45,{..._0x15f283,'tags':Array[_0x2dc9d4(0xf9)](_0x15f283[_0x2dc9d4(0xfd)])?_0x15f283[_0x2dc9d4(0xfd)]:[],'scope':_0x15f283[_0x2dc9d4(0x123)],'source':_0x2dc9d4(0x107),'dir':_0x4f686b,'cacheDir':_0x398ec7[_0x2dc9d4(0x11a)]===_0x2dc9d4(0x11f)?_0x4f686b:undefined,'skillMdPath':resolve(_0x4f686b,SKILL_FILE),'metadataPath':_0x1a6ce3,'linkedPaths':_0x2e3ac6});}function compareLocalRuntimeSkills(_0x495107,_0x3e7065){const _0x1e3b84=a154_0x5e86,_0x43c9cf={'personal':0x0,'company':0x1,'builtin':0x2};return _0x43c9cf[_0x495107[_0x1e3b84(0x123)]]-_0x43c9cf[_0x3e7065['scope']]||_0x495107[_0x1e3b84(0x118)][_0x1e3b84(0x114)](_0x3e7065[_0x1e3b84(0x118)])||_0x495107[_0x1e3b84(0x125)]['localeCompare'](_0x3e7065[_0x1e3b84(0x125)]);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x416557,_0x49ca01){const _0x499cd1=a155_0x46a5,_0x9d901c=_0x416557();while(!![]){try{const _0x3dd9ef=-parseInt(_0x499cd1(0x181))/0x1*(-parseInt(_0x499cd1(0x18f))/0x2)+parseInt(_0x499cd1(0x175))/0x3+-parseInt(_0x499cd1(0x193))/0x4*(-parseInt(_0x499cd1(0x17b))/0x5)+-parseInt(_0x499cd1(0x182))/0x6*(-parseInt(_0x499cd1(0x187))/0x7)+-parseInt(_0x499cd1(0x18b))/0x8*(parseInt(_0x499cd1(0x17a))/0x9)+-parseInt(_0x499cd1(0x191))/0xa*(-parseInt(_0x499cd1(0x168))/0xb)+-parseInt(_0x499cd1(0x186))/0xc;if(_0x3dd9ef===_0x49ca01)break;else _0x9d901c['push'](_0x9d901c['shift']());}catch(_0x2eabbb){_0x9d901c['push'](_0x9d901c['shift']());}}}(a155_0xa4ed,0xacbf0));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(_0x2a51d3){const _0x28b072=a155_0x46a5;return _0x2a51d3[_0x28b072(0x190)]??Buffer[_0x28b072(0x17f)](_0x2a51d3[_0x28b072(0x171)]??'',_0x28b072(0x177));}function a155_0x46a5(_0x1a6d41,_0x41ce06){_0x1a6d41=_0x1a6d41-0x167;const _0xa4edc4=a155_0xa4ed();let _0x46a54c=_0xa4edc4[_0x1a6d41];return _0x46a54c;}export function fileText(_0xa6cc5f){const _0x516a04=a155_0x46a5;return fileContent(_0xa6cc5f)[_0x516a04(0x189)](_0x516a04(0x177));}export function normalizeLocalFiles(_0x38f4d4){const _0xff72e0=a155_0x46a5;if(!Array['isArray'](_0x38f4d4)||_0x38f4d4[_0xff72e0(0x169)]===0x0)return[];const _0x40cda3=new Map();for(const _0x45da8d of _0x38f4d4){if(!_0x45da8d||typeof _0x45da8d!==_0xff72e0(0x184)||typeof _0x45da8d['path']!==_0xff72e0(0x17e))throw CliErrors['validation'](_0xff72e0(0x196));const _0x141af4=normalizeSkillRelativePath(_0x45da8d[_0xff72e0(0x180)]);if(_0x40cda3[_0xff72e0(0x188)](_0x141af4))throw CliErrors[_0xff72e0(0x195)](_0xff72e0(0x17c)+_0x141af4);if(_0x45da8d[_0xff72e0(0x190)]!==undefined&&!Buffer[_0xff72e0(0x176)](_0x45da8d['bytes']))throw CliErrors[_0xff72e0(0x195)](_0xff72e0(0x17d)+_0x141af4);if(_0x45da8d[_0xff72e0(0x190)]===undefined&&typeof _0x45da8d[_0xff72e0(0x171)]!==_0xff72e0(0x17e))throw CliErrors[_0xff72e0(0x195)](_0xff72e0(0x16d)+_0x141af4);const _0x9188e8=fileContent(_0x45da8d);_0x40cda3[_0xff72e0(0x16a)](_0x141af4,{'path':_0x141af4,'bytes':_0x9188e8});}return Array[_0xff72e0(0x17f)](_0x40cda3[_0xff72e0(0x185)]())[_0xff72e0(0x178)](compareSkillFiles);}export function normalizeManifestFiles(_0x46f054){const _0x32756f=a155_0x46a5;if(!Array[_0x32756f(0x18c)](_0x46f054)||_0x46f054[_0x32756f(0x169)]===0x0)return[];const _0x450e1b=new Map();for(const _0x239a22 of _0x46f054){if(!_0x239a22||typeof _0x239a22!==_0x32756f(0x184)||typeof _0x239a22[_0x32756f(0x180)]!==_0x32756f(0x17e))throw CliErrors[_0x32756f(0x195)]('Skill\x20file\x20path\x20must\x20be\x20text.');const _0x7798b7=normalizeSkillRelativePath(_0x239a22[_0x32756f(0x180)]);if(_0x450e1b[_0x32756f(0x188)](_0x7798b7))throw CliErrors[_0x32756f(0x195)](_0x32756f(0x17c)+_0x7798b7);if(!isSha256Hex(_0x239a22['sha256']))throw CliErrors[_0x32756f(0x195)](_0x32756f(0x174)+_0x7798b7);if(!Number[_0x32756f(0x183)](_0x239a22[_0x32756f(0x192)])||_0x239a22['size']<0x0)throw CliErrors[_0x32756f(0x195)](_0x32756f(0x18d)+_0x7798b7);_0x450e1b[_0x32756f(0x16a)](_0x7798b7,{'path':_0x7798b7,'sha256':_0x239a22['sha256'][_0x32756f(0x173)](),'size':_0x239a22['size']});}return Array[_0x32756f(0x17f)](_0x450e1b[_0x32756f(0x185)]())[_0x32756f(0x178)](compareSkillFiles);}export function scanSkillDirectory(_0x210c54,_0x3e0212={}){const _0x4d5401=a155_0x46a5,_0x2747e1=realpathSync(_0x210c54),_0x2731cd=canonicalExcludedFilePaths(_0x3e0212[_0x4d5401(0x172)]),_0x496a8b=[];function _0x32febd(_0x13dd99){const _0x1bcbfa=_0x4d5401,_0x48fde8=readdirSync(_0x13dd99,{'withFileTypes':!![]})[_0x1bcbfa(0x178)]((_0x1d6953,_0x43870b)=>_0x1d6953[_0x1bcbfa(0x179)][_0x1bcbfa(0x167)](_0x43870b['name']));for(const _0x48f598 of _0x48fde8){if(_0x48f598[_0x1bcbfa(0x18e)]()&&IGNORED_DIR_NAMES['has'](_0x48f598['name']))continue;if(IGNORED_FILE_NAMES[_0x1bcbfa(0x188)](_0x48f598['name']))continue;const _0xd356c7=resolve(_0x13dd99,_0x48f598['name']);if(isExcludedFilePath(_0xd356c7,_0x2731cd))continue;if(_0x48f598['isSymbolicLink']())throw CliErrors[_0x1bcbfa(0x195)]('Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20'+_0xd356c7);const _0x31a0e2=toPosixPath(relative(_0x2747e1,_0xd356c7));if(_0x48f598[_0x1bcbfa(0x18e)]()){_0x32febd(_0xd356c7);continue;}if(!_0x48f598['isFile']())continue;validateSkillRelativePath(_0x31a0e2);const _0x38b27d=readFileSync(_0xd356c7);_0x496a8b[_0x1bcbfa(0x16f)]({'path':_0x31a0e2,'bytes':_0x38b27d});}}return _0x32febd(_0x2747e1),normalizeLocalFiles(_0x496a8b);}function canonicalExcludedFilePaths(_0x31aa9b){const _0x51b3d9=a155_0x46a5,_0x1f56e7=new Set();for(const _0x4b21cb of _0x31aa9b??[]){const _0x3708ff=resolve(_0x4b21cb);_0x1f56e7[_0x51b3d9(0x16e)](_0x3708ff);try{_0x1f56e7['add'](realpathSync(_0x3708ff));}catch{}}return _0x1f56e7;}function a155_0xa4ed(){const _0x5c33ce=['Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20','string','from','path','8cABvXq','224340aNgIDy','isSafeInteger','object','values','5672820swtwng','42WiOflU','has','toString','includes','11280296QMqMlI','isArray','Skill\x20file\x20size\x20is\x20invalid:\x20','isDirectory','75146oSqihX','bytes','986380dLlgDF','size','164kvBbZo','compare','validation','Skill\x20file\x20path\x20must\x20be\x20text.','localeCompare','66jqPbNU','length','set','Unsafe\x20Skill\x20file\x20path:\x20','split','Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20','add','push','trim','content','excludedFilePaths','toLowerCase','Skill\x20file\x20sha256\x20is\x20invalid:\x20','3189657baWeZX','isBuffer','utf8','sort','name','9MCFOfT','50045PYGtbc','Duplicate\x20Skill\x20file\x20path:\x20'];a155_0xa4ed=function(){return _0x5c33ce;};return a155_0xa4ed();}function isExcludedFilePath(_0x53df76,_0x255260){const _0x423e6f=a155_0x46a5;if(_0x255260[_0x423e6f(0x188)](_0x53df76))return!![];if(_0x255260[_0x423e6f(0x192)]===0x0)return![];try{return _0x255260[_0x423e6f(0x188)](realpathSync(_0x53df76));}catch{return![];}}export function compareSkillFiles(_0x2d5127,_0x1573eb){const _0x2698b8=a155_0x46a5;if(_0x2d5127[_0x2698b8(0x180)]===SKILL_FILE)return _0x1573eb['path']===SKILL_FILE?0x0:-0x1;if(_0x1573eb[_0x2698b8(0x180)]===SKILL_FILE)return 0x1;return Buffer[_0x2698b8(0x194)](Buffer[_0x2698b8(0x17f)](_0x2d5127[_0x2698b8(0x180)],'utf8'),Buffer[_0x2698b8(0x17f)](_0x1573eb[_0x2698b8(0x180)],_0x2698b8(0x177)));}export function normalizeSkillRelativePath(_0x4432d7){const _0x24a67c=a155_0x46a5,_0x418fbf=toPosixPath(_0x4432d7[_0x24a67c(0x170)]());return validateSkillRelativePath(_0x418fbf),_0x418fbf;}export function validateSkillRelativePath(_0x1b3576){const _0x14be2e=a155_0x46a5;if(!_0x1b3576||_0x1b3576['startsWith']('/')||_0x1b3576[_0x14be2e(0x18a)]('//'))throw CliErrors[_0x14be2e(0x195)](_0x14be2e(0x16b)+_0x1b3576);for(const _0x30b7fa of _0x1b3576[_0x14be2e(0x16c)]('/')){if(!_0x30b7fa||_0x30b7fa==='.'||_0x30b7fa==='..')throw CliErrors[_0x14be2e(0x195)]('Unsafe\x20Skill\x20file\x20path:\x20'+_0x1b3576);}}export function toPosixPath(_0x48c287){return _0x48c287['replace'](/\\/g,'/');}export function isSha256Hex(_0x1758fe){const _0x7736a0=a155_0x46a5;return typeof _0x1758fe===_0x7736a0(0x17e)&&/^[a-fA-F0-9]{64}$/['test'](_0x1758fe);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x56639d,_0x395114){const _0x12050a=a153_0xb6f0,_0x1f2eef=_0x56639d();while(!![]){try{const _0x5efecd=parseInt(_0x12050a(0x1ea))/0x1*(parseInt(_0x12050a(0x20e))/0x2)+-parseInt(_0x12050a(0x1ee))/0x3+-parseInt(_0x12050a(0x209))/0x4*(parseInt(_0x12050a(0x1fe))/0x5)+parseInt(_0x12050a(0x1ff))/0x6+parseInt(_0x12050a(0x212))/0x7+-parseInt(_0x12050a(0x1f4))/0x8+-parseInt(_0x12050a(0x1e9))/0x9*(-parseInt(_0x12050a(0x203))/0xa);if(_0x5efecd===_0x395114)break;else _0x1f2eef['push'](_0x1f2eef['shift']());}catch(_0x432954){_0x1f2eef['push'](_0x1f2eef['shift']());}}}(a153_0x245c,0x890c7));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(_0x5d09af,_0x3d490f,_0x4224e9){const _0x5a622f=a153_0xb6f0,_0x6ea353=requireSkillCode(_0x5d09af),_0x5df971=requirePackageBytes(_0x6ea353,_0x4224e9['packageBytes']),_0x68f4f0=extractDownloadedPackage(_0x5df971),_0x1129b8=_0x68f4f0[_0x5a622f(0x20b)](_0x3dcaba=>_0x3dcaba['path']===SKILL_FILE);if(!_0x1129b8)throw CliErrors[_0x5a622f(0x1fc)](_0x5a622f(0x1f8)+SKILL_FILE+':\x20'+_0x6ea353);const _0x4e2413=withMaterializedSkillFrontmatter(_0x68f4f0,_0x5d09af,_0x6ea353),_0xab2d2a=_0x4e2413[_0x5a622f(0x20b)](_0x5bfc8d=>_0x5bfc8d['path']===SKILL_FILE),_0x182a33=fileText(_0xab2d2a),_0x121f8e=getRuntimeSkillDir(_0x4224e9[_0x5a622f(0x205)],_0x4224e9[_0x5a622f(0x211)],_0x4224e9[_0x5a622f(0x220)],_0x3d490f,_0x6ea353,_0x4224e9['paths']),_0x440ee8=resolve(_0x121f8e,SKILL_FILE),_0xe232ca=resolve(_0x121f8e,METADATA_FILE),_0x363ede=contentHash(_0x182a33),_0x429a6a=readMetadataIfPresent(_0xe232ca)?.[_0x5a622f(0x206)];ensurePulledFilesCanBeOverwritten(_0x121f8e,_0xe232ca,_0x4e2413,_0x4224e9[_0x5a622f(0x213)]===!![]),mkdirSync(_0x121f8e,{'recursive':!![],'mode':0x1c0});const _0x2f8e8b=existsSync(_0x440ee8)?readFileSync(_0x440ee8,_0x5a622f(0x214)):undefined;return materializeFiles(_0x121f8e,_0x4e2413),removeStaleManagedFiles(_0x121f8e,_0x429a6a,_0x4e2413),writeJsonAtomic(_0xe232ca,buildMetadata(_0x5d09af,_0x3d490f,_0x4224e9[_0x5a622f(0x220)],_0x363ede,_0x4224e9[_0x5a622f(0x20d)],_0x4e2413,_0x5df971)),{'skill':_0x5d09af,'scope':_0x3d490f,'dir':_0x121f8e,'skillMdPath':_0x440ee8,'metadataPath':_0xe232ca,'contentHash':_0x363ede,'changed':_0x2f8e8b!==_0x182a33};}export function reuseMaterializedRuntimeSkill(_0x438104,_0x56f308,_0x4d214e){const _0x29d55a=a153_0xb6f0,_0x3c7043=_0x438104[_0x29d55a(0x1ed)]?.[_0x29d55a(0x202)]();if(!_0x3c7043)return undefined;const _0x4ce162=requireSkillCode(_0x438104),_0x38f82d=getRuntimeSkillDir(_0x4d214e[_0x29d55a(0x205)],_0x4d214e[_0x29d55a(0x211)],_0x4d214e[_0x29d55a(0x220)],_0x56f308,_0x4ce162,_0x4d214e['paths']),_0x4f61b5=resolve(_0x38f82d,SKILL_FILE),_0xc282ad=resolve(_0x38f82d,METADATA_FILE),_0x261d85=readMetadataIfPresent(_0xc282ad);if(!_0x261d85||_0x261d85['schemaVersion']!==0x2||_0x261d85[_0x29d55a(0x220)]!==_0x4d214e['appCode']||_0x261d85[_0x29d55a(0x20a)]!==_0x56f308||_0x261d85['skillCode']!==_0x4ce162||_0x261d85[_0x29d55a(0x1ed)]!==_0x3c7043||_0x261d85['id']!==_0x438104['id']||_0x261d85[_0x29d55a(0x218)]!==_0x438104[_0x29d55a(0x218)]||_0x261d85['description']!==_0x438104[_0x29d55a(0x21b)]||_0x261d85['example']!==_0x438104[_0x29d55a(0x21a)]||_0x261d85[_0x29d55a(0x210)]!==_0x438104['status']||!_0x261d85[_0x29d55a(0x215)]||!_0x261d85['fileHashes']||!Object[_0x29d55a(0x1fb)](_0x261d85['fileHashes'],SKILL_FILE))return undefined;for(const [_0x5da58e,_0xa2612c]of Object[_0x29d55a(0x1fd)](_0x261d85[_0x29d55a(0x206)])){if(!/^[a-f0-9]{64}$/['test'](_0xa2612c))return undefined;const _0x1ba7bc=resolveManagedFilePath(_0x38f82d,_0x5da58e);if(!existsSync(_0x1ba7bc)||!lstatSync(_0x1ba7bc)[_0x29d55a(0x207)]())return undefined;if(bufferSha256(readFileSync(_0x1ba7bc))!==_0xa2612c)return undefined;}return{'skill':_0x438104,'scope':_0x56f308,'dir':_0x38f82d,'skillMdPath':_0x4f61b5,'metadataPath':_0xc282ad,'contentHash':_0x261d85[_0x29d55a(0x215)],'changed':![]};}function a153_0xb6f0(_0x1b8ae9,_0xe8c4ea){_0x1b8ae9=_0x1b8ae9-0x1e9;const _0x245ce0=a153_0x245c();let _0xb6f0a1=_0x245ce0[_0x1b8ae9];return _0xb6f0a1;}function withMaterializedSkillFrontmatter(_0x28238f,_0x3df9c1,_0xcf9f0e){const _0x397814=a153_0xb6f0,_0x293bf4=skillDisplayName(_0x3df9c1,_0xcf9f0e),_0x49f395=_0x3df9c1['description']?.[_0x397814(0x202)]()||_0x293bf4||_0xcf9f0e;return normalizeLocalFiles(_0x28238f)['map'](_0x471d6b=>{const _0x4392ec=_0x397814,_0x1ca94b=fileText(_0x471d6b);if(_0x471d6b[_0x4392ec(0x1f5)]!==SKILL_FILE)return _0x471d6b;if(hasYamlFrontmatter(_0x1ca94b))return{'path':_0x471d6b['path'],'content':withSyncedDisplayName(_0x1ca94b,_0x293bf4)};return{'path':_0x471d6b[_0x4392ec(0x1f5)],'content':prependSkillFrontmatter(_0x1ca94b,{'name':_0xcf9f0e,'displayName':_0x293bf4,'description':_0x49f395})};});}function hasYamlFrontmatter(_0x555c6d){return/^\uFEFF?---\s*\r?\n/['test'](_0x555c6d);}function prependSkillFrontmatter(_0x677bd4,_0x5a2201){const _0x539c3c=a153_0xb6f0,_0x279139=_0x677bd4[_0x539c3c(0x200)](/^\uFEFF/,'');return[_0x539c3c(0x21f),'name:\x20'+yamlString(_0x5a2201[_0x539c3c(0x20f)]),_0x5a2201[_0x539c3c(0x208)]?'displayName:\x20'+yamlString(_0x5a2201['displayName']):undefined,_0x539c3c(0x21c)+yamlString(_0x5a2201[_0x539c3c(0x21b)]),_0x539c3c(0x21f),'',_0x279139]['filter'](_0x40542a=>_0x40542a!==undefined)[_0x539c3c(0x1f7)]('\x0a');}function yamlString(_0x95b68){const _0x388bea=a153_0xb6f0;return JSON['stringify'](_0x95b68[_0x388bea(0x200)](/\r/g,'')['trim']());}function skillDisplayName(_0x24a1e4,_0x40f5e5){const _0x56405a=a153_0xb6f0,_0x58179b=_0x24a1e4[_0x56405a(0x218)]?.['trim']();return _0x58179b||_0x40f5e5;}function withSyncedDisplayName(_0x56146e,_0x218fba){const _0x3428f5=a153_0xb6f0,_0x1f7ada=_0x56146e[_0x3428f5(0x21e)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x1f7ada)return _0x56146e;const _0x3171d0=_0x1f7ada[0x1]??'',_0x589ddc=_0x1f7ada[0x2]??'',_0x3b62e3=parseDocument(_0x589ddc);if(_0x3b62e3[_0x3428f5(0x1f2)][_0x3428f5(0x1ec)]>0x0||!isMap(_0x3b62e3['contents']))return _0x56146e;if(_0x218fba)_0x3b62e3[_0x3428f5(0x1fa)](_0x3428f5(0x208),_0x218fba);else{if(_0x3b62e3['has'](_0x3428f5(0x208)))_0x3b62e3['delete']('displayName');else return _0x56146e;}forceBlockCollections(_0x3b62e3['contents']);const _0x41e855=_0x3b62e3[_0x3428f5(0x1f0)]({'lineWidth':0x0})[_0x3428f5(0x1f9)](),_0x35f322=_0x56146e[_0x3428f5(0x1eb)](_0x1f7ada[0x0][_0x3428f5(0x1ec)])[_0x3428f5(0x200)](/^\r?\n/,'');return _0x3171d0+_0x3428f5(0x217)+_0x41e855+_0x3428f5(0x1f1)+_0x35f322;}function forceBlockCollections(_0x32d5ea){if(!isNode(_0x32d5ea))return;visit(_0x32d5ea,(_0x16d239,_0x58bdae)=>{isCollection(_0x58bdae)&&(_0x58bdae['flow']=![]);});}function ensurePulledFilesCanBeOverwritten(_0x318563,_0x23e9d8,_0x3026e4,_0x57a9b0){const _0x5469cc=a153_0xb6f0;if(_0x57a9b0||!existsSync(_0x23e9d8))return;const _0x10cd53=readMetadataIfPresent(_0x23e9d8);if(!_0x10cd53)return;const _0x24b825=_0x10cd53[_0x5469cc(0x206)]&&Object[_0x5469cc(0x216)](_0x10cd53[_0x5469cc(0x206)])[_0x5469cc(0x1ec)]>0x0?_0x10cd53[_0x5469cc(0x206)]:undefined;if(_0x24b825)for(const [_0x82a63,_0x70b510]of Object['entries'](_0x24b825)){const _0x34e646=resolveManagedFilePath(_0x318563,_0x82a63);if(!existsSync(_0x34e646))throw CliErrors[_0x5469cc(0x1fc)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x318563,_0x5469cc(0x219)+_0x82a63);const _0x5c26f6=lstatSync(_0x34e646);if(!_0x5c26f6[_0x5469cc(0x207)]())throw CliErrors[_0x5469cc(0x1fc)](_0x5469cc(0x1ef)+_0x318563,_0x5469cc(0x21d)+_0x82a63);const _0x32c479=bufferSha256(readFileSync(_0x34e646));if(_0x32c479!==_0x70b510)throw CliErrors[_0x5469cc(0x1fc)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x318563+_0x5469cc(0x1f3)+_0x82a63,_0x5469cc(0x1f6)+_0x82a63);}else{const _0x264d6e=resolve(_0x318563,SKILL_FILE);if(existsSync(_0x264d6e)&&_0x10cd53[_0x5469cc(0x215)]){const _0x461694=contentHash(readFileSync(_0x264d6e,_0x5469cc(0x214)));if(_0x461694!==_0x10cd53[_0x5469cc(0x215)])throw CliErrors['validation'](_0x5469cc(0x20c)+_0x264d6e,'Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.');}}for(const _0x42448f of normalizeLocalFiles(_0x3026e4)){if(_0x24b825?.[_0x42448f[_0x5469cc(0x1f5)]])continue;if(!_0x24b825&&_0x42448f[_0x5469cc(0x1f5)]===SKILL_FILE)continue;const _0x40e3b1=resolveManagedFilePath(_0x318563,_0x42448f[_0x5469cc(0x1f5)]);if(!existsSync(_0x40e3b1))continue;const _0x34f4ae=lstatSync(_0x40e3b1);if(!_0x34f4ae['isFile']())throw CliErrors[_0x5469cc(0x1fc)](_0x5469cc(0x1ef)+_0x318563,'Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20'+_0x42448f[_0x5469cc(0x1f5)]);const _0x12232e=bufferSha256(readFileSync(_0x40e3b1));if(_0x12232e!==fileHash(_0x42448f))throw CliErrors[_0x5469cc(0x1fc)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x318563,_0x5469cc(0x204)+_0x42448f['path']);}}function materializeFiles(_0x2ab414,_0x2ccc82){for(const _0x4390cd of normalizeLocalFiles(_0x2ccc82)){const _0x5a4cb8=resolveManagedFilePath(_0x2ab414,_0x4390cd['path']);mkdirSync(dirname(_0x5a4cb8),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x5a4cb8,fileContent(_0x4390cd),0x180);}}function a153_0x245c(){const _0x1c568c=['find','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','pulledAt','20QApPrr','name','status','accessKey','1863414opdwMm','force','utf8','contentHash','keys','---\x0a','skillName','Managed\x20file\x20was\x20removed\x20locally:\x20','example','description','description:\x20','Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20','match','---','appCode','9522099aFAzst','80854ZZUJJN','slice','length','version','1484205kumfCQ','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','toString','\x0a---\x0a\x0a','errors','.\x20Changed\x20file:\x20','5701296Mpsbjm','path','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','join','Runtime\x20Skill\x20package\x20is\x20missing\x20','trimEnd','set','hasOwn','validation','entries','2963965OMMLTj','1372728bABGex','replace','map','trim','10fPhhso','Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20','env','fileHashes','isFile','displayName','4itElNH','scope'];a153_0x245c=function(){return _0x1c568c;};return a153_0x245c();}function removeStaleManagedFiles(_0x321bc4,_0x4faf46,_0x437294){const _0x21cd37=a153_0xb6f0;if(!_0x4faf46)return;const _0x5af6b5=new Set(normalizeLocalFiles(_0x437294)[_0x21cd37(0x201)](_0x1cc1f7=>_0x1cc1f7[_0x21cd37(0x1f5)]));for(const _0x36f394 of Object[_0x21cd37(0x216)](_0x4faf46)){if(_0x5af6b5['has'](_0x36f394))continue;const _0x571e1d=resolveManagedFilePath(_0x321bc4,_0x36f394);existsSync(_0x571e1d)&&lstatSync(_0x571e1d)['isFile']()&&rmSync(_0x571e1d,{'force':!![]});}}
|
|
1
|
+
(function(_0x1c2c7d,_0x147e45){const _0x387eae=a156_0x3c11,_0x13b82b=_0x1c2c7d();while(!![]){try{const _0x2b46aa=parseInt(_0x387eae(0x11b))/0x1*(parseInt(_0x387eae(0x130))/0x2)+-parseInt(_0x387eae(0x11f))/0x3*(-parseInt(_0x387eae(0x125))/0x4)+parseInt(_0x387eae(0x137))/0x5+parseInt(_0x387eae(0x126))/0x6+parseInt(_0x387eae(0x13f))/0x7*(parseInt(_0x387eae(0x120))/0x8)+parseInt(_0x387eae(0x149))/0x9*(-parseInt(_0x387eae(0x121))/0xa)+-parseInt(_0x387eae(0x123))/0xb;if(_0x2b46aa===_0x147e45)break;else _0x13b82b['push'](_0x13b82b['shift']());}catch(_0x47296c){_0x13b82b['push'](_0x13b82b['shift']());}}}(a156_0x3d55,0xc5a0f));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(_0x5b6869,_0x10fedf,_0xa507dd){const _0x549c2f=a156_0x3c11,_0x402082=requireSkillCode(_0x5b6869),_0x1a03cf=requirePackageBytes(_0x402082,_0xa507dd['packageBytes']),_0x5dfa30=extractDownloadedPackage(_0x1a03cf),_0x3c53af=_0x5dfa30[_0x549c2f(0x13e)](_0x7ef646=>_0x7ef646[_0x549c2f(0x13c)]===SKILL_FILE);if(!_0x3c53af)throw CliErrors['validation']('Runtime\x20Skill\x20package\x20is\x20missing\x20'+SKILL_FILE+':\x20'+_0x402082);const _0x42cc3a=withMaterializedSkillFrontmatter(_0x5dfa30,_0x5b6869,_0x402082),_0x2ddec1=_0x42cc3a[_0x549c2f(0x13e)](_0x28d81d=>_0x28d81d[_0x549c2f(0x13c)]===SKILL_FILE),_0x74b5c5=fileText(_0x2ddec1),_0x12d488=getRuntimeSkillDir(_0xa507dd[_0x549c2f(0x134)],_0xa507dd[_0x549c2f(0x13b)],_0xa507dd['appCode'],_0x10fedf,_0x402082,_0xa507dd[_0x549c2f(0x148)]),_0x5b3f51=resolve(_0x12d488,SKILL_FILE),_0x5afc0a=resolve(_0x12d488,METADATA_FILE),_0x56d168=contentHash(_0x74b5c5),_0x5d7993=readMetadataIfPresent(_0x5afc0a)?.[_0x549c2f(0x14f)];ensurePulledFilesCanBeOverwritten(_0x12d488,_0x5afc0a,_0x42cc3a,_0xa507dd[_0x549c2f(0x13a)]===!![]),mkdirSync(_0x12d488,{'recursive':!![],'mode':0x1c0});const _0x163113=existsSync(_0x5b3f51)?readFileSync(_0x5b3f51,_0x549c2f(0x143)):undefined;return materializeFiles(_0x12d488,_0x42cc3a),removeStaleManagedFiles(_0x12d488,_0x5d7993,_0x42cc3a),writeJsonAtomic(_0x5afc0a,buildMetadata(_0x5b6869,_0x10fedf,_0xa507dd[_0x549c2f(0x14a)],_0x56d168,_0xa507dd[_0x549c2f(0x12c)],_0x42cc3a,_0x1a03cf)),{'skill':_0x5b6869,'scope':_0x10fedf,'dir':_0x12d488,'skillMdPath':_0x5b3f51,'metadataPath':_0x5afc0a,'contentHash':_0x56d168,'changed':_0x163113!==_0x74b5c5};}function a156_0x3d55(){const _0x58cddd=['198HkoNBS','appCode','Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20','replace','flow','slice','fileHashes','---','join','stringify','.\x20Changed\x20file:\x20','scope','match','status','has','name:\x20','2aOyRmx','test','length','delete','588465eCdRXL','8qoUYLj','562310odvcrc','contentHash','38767861KBZOSH','set','20PSBHjo','6790398CJHwnF','schemaVersion','validation','---\x0a','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','pulledAt','example','name','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','846908GkvWPC','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.','skillName','displayName','env','\x0a---\x0a\x0a','Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20','6951925QIZvAR','description','contents','force','accessKey','path','isFile','find','8547833NGNTRf','version','trimEnd','errors','utf8','map','trim','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','entries','paths'];a156_0x3d55=function(){return _0x58cddd;};return a156_0x3d55();}export function reuseMaterializedRuntimeSkill(_0x41ecc5,_0x6833e7,_0x21c8b9){const _0x113b83=a156_0x3c11,_0x21976b=_0x41ecc5[_0x113b83(0x140)]?.[_0x113b83(0x145)]();if(!_0x21976b)return undefined;const _0x10a77a=requireSkillCode(_0x41ecc5),_0x5f1c38=getRuntimeSkillDir(_0x21c8b9['env'],_0x21c8b9[_0x113b83(0x13b)],_0x21c8b9[_0x113b83(0x14a)],_0x6833e7,_0x10a77a,_0x21c8b9[_0x113b83(0x148)]),_0x426cd1=resolve(_0x5f1c38,SKILL_FILE),_0x1f649d=resolve(_0x5f1c38,METADATA_FILE),_0x22698b=readMetadataIfPresent(_0x1f649d);if(!_0x22698b||_0x22698b[_0x113b83(0x127)]!==0x2||_0x22698b['appCode']!==_0x21c8b9[_0x113b83(0x14a)]||_0x22698b[_0x113b83(0x116)]!==_0x6833e7||_0x22698b['skillCode']!==_0x10a77a||_0x22698b['version']!==_0x21976b||_0x22698b['id']!==_0x41ecc5['id']||_0x22698b[_0x113b83(0x132)]!==_0x41ecc5[_0x113b83(0x132)]||_0x22698b[_0x113b83(0x138)]!==_0x41ecc5[_0x113b83(0x138)]||_0x22698b[_0x113b83(0x12d)]!==_0x41ecc5['example']||_0x22698b['status']!==_0x41ecc5[_0x113b83(0x118)]||!_0x22698b['contentHash']||!_0x22698b[_0x113b83(0x14f)]||!Object['hasOwn'](_0x22698b[_0x113b83(0x14f)],SKILL_FILE))return undefined;for(const [_0xbdc377,_0x582f20]of Object[_0x113b83(0x147)](_0x22698b[_0x113b83(0x14f)])){if(!/^[a-f0-9]{64}$/[_0x113b83(0x11c)](_0x582f20))return undefined;const _0x446b1b=resolveManagedFilePath(_0x5f1c38,_0xbdc377);if(!existsSync(_0x446b1b)||!lstatSync(_0x446b1b)[_0x113b83(0x13d)]())return undefined;if(bufferSha256(readFileSync(_0x446b1b))!==_0x582f20)return undefined;}return{'skill':_0x41ecc5,'scope':_0x6833e7,'dir':_0x5f1c38,'skillMdPath':_0x426cd1,'metadataPath':_0x1f649d,'contentHash':_0x22698b[_0x113b83(0x122)],'changed':![]};}function withMaterializedSkillFrontmatter(_0xd29348,_0x5e8b83,_0x47feba){const _0x24a900=a156_0x3c11,_0x5ed368=skillDisplayName(_0x5e8b83,_0x47feba),_0x1ca861=_0x5e8b83[_0x24a900(0x138)]?.[_0x24a900(0x145)]()||_0x5ed368||_0x47feba;return normalizeLocalFiles(_0xd29348)['map'](_0x1bcf1c=>{const _0x17b493=_0x24a900,_0x4c83be=fileText(_0x1bcf1c);if(_0x1bcf1c[_0x17b493(0x13c)]!==SKILL_FILE)return _0x1bcf1c;if(hasYamlFrontmatter(_0x4c83be))return{'path':_0x1bcf1c['path'],'content':withSyncedDisplayName(_0x4c83be,_0x5ed368)};return{'path':_0x1bcf1c[_0x17b493(0x13c)],'content':prependSkillFrontmatter(_0x4c83be,{'name':_0x47feba,'displayName':_0x5ed368,'description':_0x1ca861})};});}function hasYamlFrontmatter(_0x2fda18){const _0x495223=a156_0x3c11;return/^\uFEFF?---\s*\r?\n/[_0x495223(0x11c)](_0x2fda18);}function prependSkillFrontmatter(_0x19a35c,_0x394ae5){const _0x537d11=a156_0x3c11,_0xc11792=_0x19a35c[_0x537d11(0x14c)](/^\uFEFF/,'');return[_0x537d11(0x150),_0x537d11(0x11a)+yamlString(_0x394ae5[_0x537d11(0x12e)]),_0x394ae5[_0x537d11(0x133)]?'displayName:\x20'+yamlString(_0x394ae5[_0x537d11(0x133)]):undefined,'description:\x20'+yamlString(_0x394ae5[_0x537d11(0x138)]),_0x537d11(0x150),'',_0xc11792]['filter'](_0x4565b8=>_0x4565b8!==undefined)[_0x537d11(0x151)]('\x0a');}function yamlString(_0x5015aa){const _0x318afc=a156_0x3c11;return JSON[_0x318afc(0x152)](_0x5015aa[_0x318afc(0x14c)](/\r/g,'')[_0x318afc(0x145)]());}function skillDisplayName(_0x3a643b,_0x1bcecd){const _0x1ac0b1=a156_0x3c11,_0x464128=_0x3a643b[_0x1ac0b1(0x132)]?.['trim']();return _0x464128||_0x1bcecd;}function withSyncedDisplayName(_0x269a6e,_0x54cea8){const _0x16cbd0=a156_0x3c11,_0x1036e9=_0x269a6e[_0x16cbd0(0x117)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x1036e9)return _0x269a6e;const _0x4e9967=_0x1036e9[0x1]??'',_0x3a5644=_0x1036e9[0x2]??'',_0x36246b=parseDocument(_0x3a5644);if(_0x36246b[_0x16cbd0(0x142)][_0x16cbd0(0x11d)]>0x0||!isMap(_0x36246b[_0x16cbd0(0x139)]))return _0x269a6e;if(_0x54cea8)_0x36246b[_0x16cbd0(0x124)](_0x16cbd0(0x133),_0x54cea8);else{if(_0x36246b[_0x16cbd0(0x119)](_0x16cbd0(0x133)))_0x36246b[_0x16cbd0(0x11e)](_0x16cbd0(0x133));else return _0x269a6e;}forceBlockCollections(_0x36246b[_0x16cbd0(0x139)]);const _0x14f3e5=_0x36246b['toString']({'lineWidth':0x0})[_0x16cbd0(0x141)](),_0x131f47=_0x269a6e[_0x16cbd0(0x14e)](_0x1036e9[0x0][_0x16cbd0(0x11d)])[_0x16cbd0(0x14c)](/^\r?\n/,'');return _0x4e9967+_0x16cbd0(0x129)+_0x14f3e5+_0x16cbd0(0x135)+_0x131f47;}function forceBlockCollections(_0x57655c){if(!isNode(_0x57655c))return;visit(_0x57655c,(_0x460237,_0x1ff901)=>{const _0x3f9063=a156_0x3c11;isCollection(_0x1ff901)&&(_0x1ff901[_0x3f9063(0x14d)]=![]);});}function ensurePulledFilesCanBeOverwritten(_0x252e47,_0x2a51ac,_0x44f312,_0x251caf){const _0x275a44=a156_0x3c11;if(_0x251caf||!existsSync(_0x2a51ac))return;const _0x148bb4=readMetadataIfPresent(_0x2a51ac);if(!_0x148bb4)return;const _0x3446f8=_0x148bb4['fileHashes']&&Object['keys'](_0x148bb4[_0x275a44(0x14f)])['length']>0x0?_0x148bb4[_0x275a44(0x14f)]:undefined;if(_0x3446f8)for(const [_0x464255,_0x1bdba1]of Object[_0x275a44(0x147)](_0x3446f8)){const _0x41f8b9=resolveManagedFilePath(_0x252e47,_0x464255);if(!existsSync(_0x41f8b9))throw CliErrors[_0x275a44(0x128)](_0x275a44(0x12f)+_0x252e47,'Managed\x20file\x20was\x20removed\x20locally:\x20'+_0x464255);const _0x20ed8c=lstatSync(_0x41f8b9);if(!_0x20ed8c[_0x275a44(0x13d)]())throw CliErrors[_0x275a44(0x128)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x252e47,_0x275a44(0x14b)+_0x464255);const _0xfa6113=bufferSha256(readFileSync(_0x41f8b9));if(_0xfa6113!==_0x1bdba1)throw CliErrors['validation'](_0x275a44(0x12f)+_0x252e47+_0x275a44(0x115)+_0x464255,_0x275a44(0x146)+_0x464255);}else{const _0x49feb8=resolve(_0x252e47,SKILL_FILE);if(existsSync(_0x49feb8)&&_0x148bb4[_0x275a44(0x122)]){const _0x2f9bf3=contentHash(readFileSync(_0x49feb8,_0x275a44(0x143)));if(_0x2f9bf3!==_0x148bb4['contentHash'])throw CliErrors[_0x275a44(0x128)](_0x275a44(0x12a)+_0x49feb8,_0x275a44(0x131));}}for(const _0x3edbc9 of normalizeLocalFiles(_0x44f312)){if(_0x3446f8?.[_0x3edbc9[_0x275a44(0x13c)]])continue;if(!_0x3446f8&&_0x3edbc9[_0x275a44(0x13c)]===SKILL_FILE)continue;const _0x271660=resolveManagedFilePath(_0x252e47,_0x3edbc9[_0x275a44(0x13c)]);if(!existsSync(_0x271660))continue;const _0x2f93f6=lstatSync(_0x271660);if(!_0x2f93f6['isFile']())throw CliErrors[_0x275a44(0x128)](_0x275a44(0x12f)+_0x252e47,_0x275a44(0x12b)+_0x3edbc9['path']);const _0x30b762=bufferSha256(readFileSync(_0x271660));if(_0x30b762!==fileHash(_0x3edbc9))throw CliErrors[_0x275a44(0x128)](_0x275a44(0x12f)+_0x252e47,_0x275a44(0x136)+_0x3edbc9[_0x275a44(0x13c)]);}}function a156_0x3c11(_0x7e9f2f,_0x49c7ca){_0x7e9f2f=_0x7e9f2f-0x115;const _0x3d5550=a156_0x3d55();let _0x3c11a4=_0x3d5550[_0x7e9f2f];return _0x3c11a4;}function materializeFiles(_0x31e06c,_0x2458dc){const _0x2ae10c=a156_0x3c11;for(const _0x16e65f of normalizeLocalFiles(_0x2458dc)){const _0x3e3149=resolveManagedFilePath(_0x31e06c,_0x16e65f[_0x2ae10c(0x13c)]);mkdirSync(dirname(_0x3e3149),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x3e3149,fileContent(_0x16e65f),0x180);}}function removeStaleManagedFiles(_0xcd9928,_0x535326,_0x373b1d){const _0x4d0747=a156_0x3c11;if(!_0x535326)return;const _0x363353=new Set(normalizeLocalFiles(_0x373b1d)[_0x4d0747(0x144)](_0x56454d=>_0x56454d[_0x4d0747(0x13c)]));for(const _0x3743de of Object['keys'](_0x535326)){if(_0x363353['has'](_0x3743de))continue;const _0x847ce=resolveManagedFilePath(_0xcd9928,_0x3743de);existsSync(_0x847ce)&&lstatSync(_0x847ce)['isFile']()&&rmSync(_0x847ce,{'force':!![]});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xfad9c7,_0x58920b){const _0x4f4614=a157_0x3ca7,_0x33a311=_0xfad9c7();while(!![]){try{const _0x3acebd=-parseInt(_0x4f4614(0x1b3))/0x1+-parseInt(_0x4f4614(0x1c5))/0x2+-parseInt(_0x4f4614(0x1cb))/0x3+parseInt(_0x4f4614(0x1cd))/0x4*(parseInt(_0x4f4614(0x1cf))/0x5)+parseInt(_0x4f4614(0x1be))/0x6*(parseInt(_0x4f4614(0x1bc))/0x7)+-parseInt(_0x4f4614(0x1c8))/0x8+parseInt(_0x4f4614(0x1c7))/0x9*(parseInt(_0x4f4614(0x1d1))/0xa);if(_0x3acebd===_0x58920b)break;else _0x33a311['push'](_0x33a311['shift']());}catch(_0x4d14eb){_0x33a311['push'](_0x33a311['shift']());}}}(a157_0x6e0d,0xc0888));function a157_0x3ca7(_0x22f0e2,_0x1f509d){_0x22f0e2=_0x22f0e2-0x1b2;const _0x6e0d47=a157_0x6e0d();let _0x3ca71e=_0x6e0d47[_0x22f0e2];return _0x3ca71e;}function a157_0x6e0d(){const _0x210c83=['326226NjvBHF','forkedFromSkillId','8GNpdhk','manifest','1589655rWKPLQ','Invalid\x20','1850iPdkIh','personal','1388475OAyKab','length','readonly','validation','tags','status','map','toISOString','string','7cgjXKo','files','6265698Xhflhr','forkedFromVersion','fromEntries','zipSize','isArray','path','example','2035258LSyFFY','hasUpstreamUpdate','122202HZhsli','7108904cAohFY','trim','parse'];a157_0x6e0d=function(){return _0x210c83;};return a157_0x6e0d();}import{existsSync,readFileSync}from'node:fs';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';import{fileContent,normalizeLocalFiles}from'./local-files.js';import{buildSkillPackage,localFilesToManifestFiles}from'./zip-package.js';export function buildMetadata(_0x3cbf57,_0x13b229,_0x3024d4,_0x5b1af7,_0x326e51,_0x58c10d,_0x3fa630){const _0x17bfc1=a157_0x3ca7,_0x5a43b8=_0x58c10d?normalizeLocalFiles(_0x58c10d):[],_0x53ef77=!_0x3fa630&&_0x5a43b8['length']>0x0?buildSkillPackage(_0x5a43b8):undefined,_0x27ff6f=_0x3fa630?bufferSha256(_0x3fa630):_0x53ef77?.[_0x17bfc1(0x1ce)]['zipSha256'],_0x4a65b5=_0x3fa630?.[_0x17bfc1(0x1b4)]??_0x53ef77?.[_0x17bfc1(0x1ce)][_0x17bfc1(0x1c1)],_0x311731=_0x5a43b8[_0x17bfc1(0x1b4)]>0x0?Object[_0x17bfc1(0x1c0)](_0x5a43b8[_0x17bfc1(0x1b9)](_0x133082=>[_0x133082[_0x17bfc1(0x1c3)],fileHash(_0x133082)])):undefined;return{'schemaVersion':_0x5a43b8[_0x17bfc1(0x1b4)]>0x0?0x2:0x1,'id':_0x3cbf57['id'],'appCode':_0x3024d4,'skillCode':requireSkillCode(_0x3cbf57),'skillName':_0x3cbf57['skillName'],'description':_0x3cbf57['description'],'example':_0x3cbf57[_0x17bfc1(0x1c4)],'scope':_0x13b229,'readonly':_0x13b229!==_0x17bfc1(0x1b2)||_0x3cbf57[_0x17bfc1(0x1b5)]===!![],'tenantCode':_0x3cbf57['tenantCode'],'userId':_0x3cbf57['userId'],'version':_0x3cbf57['version'],'status':_0x3cbf57[_0x17bfc1(0x1b8)],'tags':Array[_0x17bfc1(0x1c2)](_0x3cbf57['tags'])?_0x3cbf57[_0x17bfc1(0x1b7)]:[],'hasUpstreamUpdate':_0x3cbf57[_0x17bfc1(0x1c6)],'forkedFromSkillId':_0x3cbf57[_0x17bfc1(0x1cc)],'forkedFromVersion':_0x3cbf57[_0x17bfc1(0x1bf)],'sourceSessionId':_0x3cbf57['sourceSessionId'],'contentHash':_0x5b1af7,'fileHashes':_0x311731,'treeHash':_0x5a43b8[_0x17bfc1(0x1b4)]>0x0?fileTreeHash(localFilesToManifestFiles(_0x5a43b8)):undefined,'ossPath':remoteManifestOssPath(_0x3cbf57[_0x17bfc1(0x1bd)]),'zipSha256':_0x27ff6f,'zipSize':_0x4a65b5,'files':_0x5a43b8[_0x17bfc1(0x1b4)]>0x0?_0x5a43b8['map'](_0x3683d3=>({'path':_0x3683d3[_0x17bfc1(0x1c3)],'hash':fileHash(_0x3683d3),'size':fileContent(_0x3683d3)[_0x17bfc1(0x1b4)]})):undefined,'pulledAt':_0x326e51??new Date()[_0x17bfc1(0x1ba)]()};}export function requireSkillCode(_0x21ab66){const _0x213b89=a157_0x3ca7,_0x2565f9=_0x21ab66['skillCode']?.[_0x213b89(0x1c9)]();if(!_0x2565f9)throw CliErrors[_0x213b89(0x1b6)]('Runtime\x20Skill\x20is\x20missing\x20skillCode.');return _0x2565f9;}export function readMetadataIfPresent(_0x2c9fbf){const _0x121f23=a157_0x3ca7;if(!existsSync(_0x2c9fbf))return undefined;try{const _0x148433=JSON[_0x121f23(0x1ca)](readFileSync(_0x2c9fbf,'utf8'));return _0x148433;}catch{throw CliErrors[_0x121f23(0x1b6)](_0x121f23(0x1d0)+METADATA_FILE+':\x20'+_0x2c9fbf);}}function remoteManifestOssPath(_0x4f236b){const _0x4af17e=a157_0x3ca7;if(!_0x4f236b||typeof _0x4f236b!=='object'||Array[_0x4af17e(0x1c2)](_0x4f236b))return undefined;const _0x4b0286=_0x4f236b['ossPath'];return typeof _0x4b0286===_0x4af17e(0x1bb)&&_0x4b0286[_0x4af17e(0x1c9)]()?_0x4b0286[_0x4af17e(0x1c9)]():undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a158_0x2dcaa9=a158_0x308c;(function(_0x462219,_0x21300e){const _0x55f927=a158_0x308c,_0x2169ef=_0x462219();while(!![]){try{const _0x40564f=-parseInt(_0x55f927(0x1d0))/0x1+parseInt(_0x55f927(0x1cf))/0x2+-parseInt(_0x55f927(0x1e4))/0x3+parseInt(_0x55f927(0x1d4))/0x4*(-parseInt(_0x55f927(0x1cd))/0x5)+-parseInt(_0x55f927(0x1d7))/0x6*(-parseInt(_0x55f927(0x1d5))/0x7)+-parseInt(_0x55f927(0x1d9))/0x8+parseInt(_0x55f927(0x1d6))/0x9*(parseInt(_0x55f927(0x1dc))/0xa);if(_0x40564f===_0x21300e)break;else _0x2169ef['push'](_0x2169ef['shift']());}catch(_0x2115e9){_0x2169ef['push'](_0x2169ef['shift']());}}}(a158_0xde93,0x927b2));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';function a158_0xde93(){const _0x47aa6c=['1030662rgEqmt','142810RJtwYy','agentsSkillsDir','skills','path\x20segment','2232jTKeJh','1813QGLqnp','19485729MYmcXs','3786juUFnX','trim','6232624vNyeDV','Unsafe\x20','workbuddySkillsDir','10PeLZYf','homeDir','homeDirName','SKILL_ROOT','filter','includes','CLAUDE_SKILL_ROOT','cacheRoot','2280183ydSdIA','claudeSkillsDir','skillCode','5035haufNR','.workbuddy'];a158_0xde93=function(){return _0x47aa6c;};return a158_0xde93();}function a158_0x308c(_0x5af389,_0x14274e){_0x5af389=_0x5af389-0x1cc;const _0xde933b=a158_0xde93();let _0x308c2d=_0xde933b[_0x5af389];return _0x308c2d;}import{CliErrors}from'../../errors.js';export function resolveSkillSyncPaths(_0x115c2c={}){const _0xfe2a0d=a158_0x308c,_0x34963b=_0x115c2c[_0xfe2a0d(0x1dd)]??homedir(),_0x5d17b7=resolve(_0x34963b,PRODUCT_CONFIG[_0xfe2a0d(0x1de)],'cache'),_0xf9446=trimmedEnv(_0xfe2a0d(0x1df)),_0x36bdb6=trimmedEnv(_0xfe2a0d(0x1e2)),_0xcf82aa=resolve(_0x34963b,_0xfe2a0d(0x1ce)),_0x462ae7=_0x115c2c['workbuddySkillsDir']??(existsSync(_0xcf82aa)?resolve(_0xcf82aa,'skills'):undefined);return{'homeDir':_0x34963b,'cacheRoot':_0x5d17b7,'managedRoot':resolve(_0x34963b,PRODUCT_CONFIG[_0xfe2a0d(0x1de)]),'agentsSkillsDir':_0x115c2c['agentsSkillsDir']??_0xf9446??resolve(_0x34963b,'.agents',_0xfe2a0d(0x1d2)),'claudeSkillsDir':_0x115c2c[_0xfe2a0d(0x1e5)]??_0x36bdb6??resolve(_0x34963b,'.claude',_0xfe2a0d(0x1d2)),'workbuddySkillsDir':_0x462ae7};}export function runtimeAgentSkillRoots(_0x2551d2){const _0x460826=a158_0x308c;return[_0x2551d2[_0x460826(0x1d1)],_0x2551d2['claudeSkillsDir'],_0x2551d2[_0x460826(0x1db)]][_0x460826(0x1e0)](_0x5828cb=>Boolean(_0x5828cb));}export function getRuntimeSkillCacheRoot(_0x4e5834,_0x306e06,_0x49f960={}){const _0x24bf2a=a158_0x308c,_0x2f2882=resolveSkillSyncPaths(_0x49f960);return resolve(_0x2f2882[_0x24bf2a(0x1e3)],_0x4e5834,fingerprintAccessKey(_0x306e06),'skills');}export function getRuntimeSkillDir(_0x326ef3,_0x5f3b2d,_0x6cbf9,_0x23a816,_0x3c3be1,_0x1434ac={}){const _0x2721e6=a158_0x308c;return resolve(getRuntimeSkillCacheRoot(_0x326ef3,_0x5f3b2d,_0x1434ac),safePathSegment(_0x6cbf9,'appCode'),_0x23a816,safePathSegment(_0x3c3be1,_0x2721e6(0x1cc)));}export function safePathSegment(_0x4ccecb,_0x3501e0=a158_0x2dcaa9(0x1d3)){const _0x200449=a158_0x2dcaa9;if(!_0x4ccecb||_0x4ccecb['includes']('/')||_0x4ccecb[_0x200449(0x1e1)]('\x5c')||_0x4ccecb['includes']('..'))throw CliErrors['validation'](_0x200449(0x1da)+_0x3501e0+'\x20for\x20local\x20path:\x20'+_0x4ccecb);return _0x4ccecb;}function trimmedEnv(_0x420798){const _0x53adbd=a158_0x2dcaa9,_0x37e24c=productEnv(_0x420798)?.[_0x53adbd(0x1d8)]();return _0x37e24c?_0x37e24c:undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0xf6a566,_0x187db6){const _0x48a05b=a156_0x13d7,_0xdeb9e5=_0xf6a566();while(!![]){try{const _0x28dccd=parseInt(_0x48a05b(0xe6))/0x1*(-parseInt(_0x48a05b(0x109))/0x2)+-parseInt(_0x48a05b(0xe5))/0x3+-parseInt(_0x48a05b(0xfd))/0x4*(parseInt(_0x48a05b(0xca))/0x5)+parseInt(_0x48a05b(0xf6))/0x6+parseInt(_0x48a05b(0xfc))/0x7+parseInt(_0x48a05b(0xf2))/0x8+-parseInt(_0x48a05b(0x102))/0x9*(-parseInt(_0x48a05b(0xf3))/0xa);if(_0x28dccd===_0x187db6)break;else _0xdeb9e5['push'](_0xdeb9e5['shift']());}catch(_0x209d14){_0xdeb9e5['push'](_0xdeb9e5['shift']());}}}(a156_0xbeac,0xba716));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a156_0x227a2f}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{writeJsonAtomic}from'./fs-utils.js';function a156_0x13d7(_0x44e2ca,_0x67c498){_0x44e2ca=_0x44e2ca-0xc8;const _0xbeac03=a156_0xbeac();let _0x13d749=_0xbeac03[_0x44e2ca];return _0x13d749;}import{contentHash}from'./hashing.js';import{fileText,normalizeLocalFiles,scanSkillDirectory}from'./local-files.js';import{buildMetadata,readMetadataIfPresent}from'./metadata.js';import{buildSkillPackage,tryNormalizePackageManifest}from'./zip-package.js';function a156_0xbeac(){const _0x4f9507=['30adzeIp','description','isFile','isSymbolicLink','1698760NwPxJB','refreshedAt','tags','sourceSessionId','content','appCode','Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20','unknown','(unknown)','ignoreMetadataScope','Remote\x20Skill\x20','isArray','string','startsWith','\x20has\x20unsupported\x20scope\x20\x22','example','match','dir','excludedFilePaths','packageBase64','\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22','scope','isDirectory','personal','version','metadata','replace','2690226jhHimK','65965DxjYAU','trim','Missing\x20','path','\x20to\x20submit\x20company\x20Skills\x20for\x20review.','Skill\x20directory\x20not\x20found:\x20','builtin','\x20has\x20scope=\x22','allowAppCodeRetarget','files',',\x20or\x20directory\x20name.','some','9284336cGOrjs','20gRJhVz','toLowerCase','utf8','4639050fGNylP','skillName','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20','ignoreMetadataAppCodeMismatch','validation','object','2108344nzWHbT','4bikvVf','ignoreInvalidMetadata','\x20name\x20for\x20SkillHub\x20slug\x20generation.','Invalid\x20','name','3396285ovwTIE','pushedAt','ignoreMetadataForPayload','ignoreMetadataSkillCode','length','displayName','company'];a156_0xbeac=function(){return _0x4f9507;};return a156_0xbeac();}export function resolvePushDirectoryIdentity(_0x2e09d1,_0x4ad078,_0x5de309={}){const _0x175009=a156_0x13d7,_0x25435a=resolvePushDirectoryRoot(_0x2e09d1),_0x19a560=readPushMetadataIfPresent(resolve(_0x25435a,METADATA_FILE),{'ignoreInvalidMetadata':_0x5de309[_0x175009(0xfe)]});if(_0x19a560?.[_0x175009(0xcf)]&&_0x19a560[_0x175009(0xcf)]!==_0x4ad078&&!_0x5de309[_0x175009(0xee)]&&!_0x5de309[_0x175009(0xf9)])throw CliErrors[_0x175009(0xfa)]('Skill\x20metadata\x20appCode\x20\x22'+_0x19a560[_0x175009(0xcf)]+_0x175009(0xde)+_0x4ad078+'\x22.');const _0x185ee4=resolvePushSkillCode(_0x25435a,_0x4ad078,_0x19a560,_0x5de309);if(!_0x185ee4)throw CliErrors['validation']('Unable\x20to\x20resolve\x20skillCode\x20from\x20'+SKILL_FILE+',\x20'+METADATA_FILE+_0x175009(0xf0));return{'dir':_0x25435a,'skillCode':_0x185ee4,'metadata':_0x19a560};}export function readPushDirectory(_0xebecfe,_0x189cf5,_0x56269d={}){const _0x52350=a156_0x13d7,_0x38f2b5=resolvePushDirectoryIdentity(_0xebecfe,_0x189cf5,_0x56269d),_0x531ad6=_0x38f2b5[_0x52350(0xdb)],_0x1f83c9=resolve(_0x531ad6,SKILL_FILE);if(!existsSync(_0x1f83c9)||!lstatSync(_0x1f83c9)[_0x52350(0xc8)]())throw CliErrors['validation'](_0x52350(0xe8)+SKILL_FILE+':\x20'+_0x1f83c9);const _0x2ee708=_0x38f2b5[_0x52350(0xe3)],_0x16a587=_0x56269d['targetScope']??'personal';if(!_0x56269d['ignoreMetadataScope']&&_0x2ee708?.['scope']==='builtin')throw CliErrors['validation'](_0x52350(0xd0)+METADATA_FILE+_0x52350(0xed)+_0x2ee708[_0x52350(0xdf)]+'\x22.');if(!_0x56269d[_0x52350(0xd3)]&&_0x16a587===_0x52350(0xe1)&&_0x2ee708?.[_0x52350(0xdf)]&&_0x2ee708[_0x52350(0xdf)]!==_0x52350(0xe1))throw CliErrors['validation'](_0x52350(0xf8)+METADATA_FILE+_0x52350(0xed)+_0x2ee708[_0x52350(0xdf)]+'\x22.','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20'+_0x531ad6+_0x52350(0xea));const _0x188375=scanSkillDirectory(_0x531ad6,{'excludedFilePaths':_0x56269d[_0x52350(0xdc)]}),_0x1e1e68=buildSkillPackage(_0x188375),_0xa8c014=readFileSync(_0x1f83c9,_0x52350(0xf5)),_0x5009b3=_0x38f2b5['skillCode'],_0x5d92b3=_0x56269d[_0x52350(0x104)]?undefined:_0x2ee708,_0xbf6c5c=readSkillDisplayName(_0xa8c014);return{'skillCode':_0x5009b3,'metadata':_0x2ee708,'frontmatterDisplayName':_0xbf6c5c,'input':{'skillCode':_0x5009b3,'skillName':_0xbf6c5c??_0x5d92b3?.[_0x52350(0xf7)],'description':_0x5d92b3?.[_0x52350(0x10a)],'content':_0xa8c014,'files':_0x1e1e68['manifest'],'packageBase64':_0x1e1e68[_0x52350(0xdd)],'tags':_0x5d92b3?.[_0x52350(0xcc)],'version':_0x5d92b3?.[_0x52350(0xe2)],'sourceSessionId':_0x5d92b3?.[_0x52350(0xcd)]}};}export function refreshPushDirectoryMetadataFromRemote(_0x3f4730,_0x5adc1c,_0x373c88,_0x470c31={}){const _0x41c8ae=a156_0x13d7,_0x31d65d=resolvePushDirectoryRoot(_0x3f4730),_0x375a43=readPushMetadataIfPresent(resolve(_0x31d65d,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x2fb8b3=requireRemoteScope(_0x5adc1c),_0x2323e6=readLocalSkillContent(_0x31d65d),_0x3891dd={..._0x5adc1c,'appCode':_0x5adc1c[_0x41c8ae(0xcf)]??_0x373c88,'skillName':_0x5adc1c[_0x41c8ae(0xf7)]??_0x375a43?.[_0x41c8ae(0xf7)],'description':_0x5adc1c['description']??_0x375a43?.[_0x41c8ae(0x10a)],'example':_0x5adc1c['example']??_0x375a43?.[_0x41c8ae(0xd9)],'tags':Array[_0x41c8ae(0xd5)](_0x5adc1c['tags'])?_0x5adc1c[_0x41c8ae(0xcc)]:_0x375a43?.[_0x41c8ae(0xcc)],'sourceSessionId':_0x5adc1c[_0x41c8ae(0xcd)]??_0x375a43?.['sourceSessionId'],'content':_0x5adc1c['content']??_0x2323e6},_0x5cb651=buildMetadata(_0x3891dd,_0x2fb8b3,_0x373c88,contentHash(_0x2323e6),_0x470c31[_0x41c8ae(0xcb)]);writeJsonAtomic(resolve(_0x31d65d,METADATA_FILE),_0x5cb651);}export function recordPushedRuntimeSkill(_0x144183,_0x145d68,_0x48522a,_0x481154={}){const _0x5f2931=a156_0x13d7,_0x888d4e=resolvePushDirectoryRoot(_0x144183),_0x593646=scanSkillDirectory(_0x888d4e),_0x15b32d=_0x593646['find'](_0x5db46c=>_0x5db46c[_0x5f2931(0xe9)]===SKILL_FILE),_0x59a685=_0x15b32d?fileText(_0x15b32d):'',_0x100f58=tryNormalizePackageManifest(_0x145d68['files']),_0x51d16b={..._0x145d68,'content':_0x145d68[_0x5f2931(0xce)]??_0x59a685,'files':_0x100f58},_0x122127=_0x100f58?normalizeLocalFiles(_0x593646)['filter'](_0x5bee30=>_0x100f58[_0x5f2931(0xef)][_0x5f2931(0xf1)](_0x2ce010=>_0x2ce010[_0x5f2931(0xe9)]===_0x5bee30[_0x5f2931(0xe9)])):undefined,_0x362453=buildMetadata(_0x51d16b,_0x481154[_0x5f2931(0xdf)]??_0x5f2931(0xe1),_0x48522a,contentHash(_0x51d16b[_0x5f2931(0xce)]??''),_0x481154[_0x5f2931(0x103)],_0x122127);writeJsonAtomic(resolve(_0x888d4e,METADATA_FILE),_0x362453);}export function deriveSkillCodeFromDirectory(_0x4c2cdd,_0x14973b){const _0x146ccf=a156_0x13d7,_0x75efbe=basename(resolve(_0x4c2cdd)),_0x3a8461=_0x14973b+'--';return _0x75efbe[_0x146ccf(0xd7)](_0x3a8461)?_0x75efbe['slice'](_0x3a8461[_0x146ccf(0x106)]):_0x75efbe;}function resolvePushSkillCode(_0x3175b6,_0xac4578,_0x208f88,_0x2a17c9){const _0x5338f5=a156_0x13d7,_0x348b73=deriveSkillCodeFromSkillFile(_0x3175b6)||deriveSkillCodeFromDirectory(_0x3175b6,_0xac4578);if(_0x2a17c9[_0x5338f5(0x105)])return _0x348b73;return _0x208f88?.['skillCode']?.[_0x5338f5(0xe7)]()||_0x348b73;}function deriveSkillCodeFromSkillFile(_0xf8815){const _0x448f57=a156_0x13d7,_0x48fd6c=resolve(_0xf8815,SKILL_FILE);if(!existsSync(_0x48fd6c)||!lstatSync(_0x48fd6c)['isFile']())return undefined;const _0x17f6c6=readFileSync(_0x48fd6c,'utf8'),_0x25600e=_0x17f6c6[_0x448f57(0xda)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x25600e)return undefined;const _0x1841c9=parseFrontmatterObject(_0x25600e[0x1]??''),_0x2009f7=scalarToString(_0x1841c9?.[_0x448f57(0x101)]);return _0x2009f7?slugifySkillName(_0x2009f7):undefined;}function readSkillDisplayName(_0x12c706){const _0x28a002=a156_0x13d7,_0x422f61=_0x12c706[_0x28a002(0xda)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x422f61)return undefined;const _0x56d7a2=parseFrontmatterObject(_0x422f61[0x1]??'');return scalarToString(_0x56d7a2?.[_0x28a002(0x107)]);}function slugifySkillName(_0x53d44e){const _0x16a1af=a156_0x13d7,_0x2a9814=_0x53d44e['trim']()[_0x16a1af(0xf4)]()['replace'](/[^\p{L}\p{N}\p{So}]+/gu,'-')[_0x16a1af(0xe4)](/^-+/,'')[_0x16a1af(0xe4)](/-+$/,'')[_0x16a1af(0xe4)](/-{2,}/g,'-');if(!_0x2a9814)throw CliErrors[_0x16a1af(0xfa)](_0x16a1af(0x100)+SKILL_FILE+_0x16a1af(0xff));return _0x2a9814;}function parseFrontmatterObject(_0x437420){const _0x41a089=a156_0x13d7;try{const _0x1c899d=a156_0x227a2f(_0x437420);return _0x1c899d&&typeof _0x1c899d===_0x41a089(0xfb)&&!Array[_0x41a089(0xd5)](_0x1c899d)?_0x1c899d:undefined;}catch{return undefined;}}function scalarToString(_0x2bf487){const _0x558d28=a156_0x13d7;if(typeof _0x2bf487===_0x558d28(0xd6))return _0x2bf487[_0x558d28(0xe7)]();if(typeof _0x2bf487==='number'||typeof _0x2bf487==='boolean')return String(_0x2bf487);return undefined;}function resolvePushDirectoryRoot(_0x38dac7){const _0x3a0bff=a156_0x13d7,_0x20955f=resolve(_0x38dac7);if(!existsSync(_0x20955f))throw CliErrors['validation'](_0x3a0bff(0xeb)+_0x38dac7);const _0x3f4fa5=lstatSync(_0x20955f);if(_0x3f4fa5[_0x3a0bff(0xe0)]())return _0x20955f;if(_0x3f4fa5[_0x3a0bff(0xc9)]()){const _0x432e6f=realpathSync(_0x20955f);if(lstatSync(_0x432e6f)[_0x3a0bff(0xe0)]())return _0x432e6f;}throw CliErrors[_0x3a0bff(0xfa)](_0x3a0bff(0xeb)+_0x38dac7);}function requireRemoteScope(_0x212d7c){const _0x5b6b5c=a156_0x13d7;if(_0x212d7c[_0x5b6b5c(0xdf)]===_0x5b6b5c(0xe1)||_0x212d7c[_0x5b6b5c(0xdf)]===_0x5b6b5c(0x108)||_0x212d7c['scope']===_0x5b6b5c(0xec))return _0x212d7c[_0x5b6b5c(0xdf)];throw CliErrors['validation'](_0x5b6b5c(0xd4)+(_0x212d7c['skillCode']||_0x5b6b5c(0xd2))+_0x5b6b5c(0xd8)+(_0x212d7c[_0x5b6b5c(0xdf)]??_0x5b6b5c(0xd1))+'\x22.');}function readLocalSkillContent(_0x4e394a){const _0x635a4d=resolve(_0x4e394a,SKILL_FILE);return existsSync(_0x635a4d)&&lstatSync(_0x635a4d)['isFile']()?readFileSync(_0x635a4d,'utf8'):'';}function readPushMetadataIfPresent(_0x32b6cc,_0x406a72={}){const _0x1cb283=a156_0x13d7;try{return readMetadataIfPresent(_0x32b6cc);}catch(_0x149fdb){if(_0x406a72[_0x1cb283(0xfe)])return undefined;throw _0x149fdb;}}
|
|
1
|
+
(function(_0x21ecce,_0x1e50de){const _0x94d037=a159_0x40d4,_0x418a53=_0x21ecce();while(!![]){try{const _0x29a282=-parseInt(_0x94d037(0x73))/0x1+parseInt(_0x94d037(0x94))/0x2*(parseInt(_0x94d037(0x8a))/0x3)+-parseInt(_0x94d037(0x81))/0x4*(-parseInt(_0x94d037(0x7d))/0x5)+-parseInt(_0x94d037(0x8f))/0x6*(-parseInt(_0x94d037(0x8b))/0x7)+parseInt(_0x94d037(0x98))/0x8*(parseInt(_0x94d037(0x8e))/0x9)+parseInt(_0x94d037(0x89))/0xa*(parseInt(_0x94d037(0xab))/0xb)+-parseInt(_0x94d037(0x8d))/0xc;if(_0x29a282===_0x1e50de)break;else _0x418a53['push'](_0x418a53['shift']());}catch(_0x68e954){_0x418a53['push'](_0x418a53['shift']());}}}(a159_0x34cb,0x7108e));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a159_0x5cbc80}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{writeJsonAtomic}from'./fs-utils.js';import{contentHash}from'./hashing.js';import{fileText,normalizeLocalFiles,scanSkillDirectory}from'./local-files.js';import{buildMetadata,readMetadataIfPresent}from'./metadata.js';import{buildSkillPackage,tryNormalizePackageManifest}from'./zip-package.js';function a159_0x34cb(){const _0x35946b=['ignoreMetadataAppCodeMismatch','11121qgYJru','packageBase64','isArray','content','96886tzHAxx','builtin','length','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20','boolean','skillName','isDirectory','refreshedAt','slice','scope','1896205BPMblg','trim','unknown','isSymbolicLink','4bXbSBX','ignoreInvalidMetadata','ignoreMetadataSkillCode','personal','filter','pushedAt','appCode','sourceSessionId','3570YszxgR','389283YwKwBS','28ASYgSZ','displayName','22689432AzLstQ','8203941NIfaOa','1003776DuJzMv','\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22','\x20name\x20for\x20SkillHub\x20slug\x20generation.','metadata','company','2ZqHIEx','ignoreMetadataForPayload','Remote\x20Skill\x20',',\x20or\x20directory\x20name.','8iFOpBu','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20','number','tags','path','ignoreMetadataScope','utf8','string','example','validation','replace','description','manifest','Invalid\x20','isFile','files','skillCode','\x20has\x20unsupported\x20scope\x20\x22'];a159_0x34cb=function(){return _0x35946b;};return a159_0x34cb();}export function resolvePushDirectoryIdentity(_0x314ede,_0x1cba84,_0x12d75b={}){const _0x27cd76=a159_0x40d4,_0x5be13a=resolvePushDirectoryRoot(_0x314ede),_0x1ab982=readPushMetadataIfPresent(resolve(_0x5be13a,METADATA_FILE),{'ignoreInvalidMetadata':_0x12d75b[_0x27cd76(0x82)]});if(_0x1ab982?.[_0x27cd76(0x87)]&&_0x1ab982[_0x27cd76(0x87)]!==_0x1cba84&&!_0x12d75b['allowAppCodeRetarget']&&!_0x12d75b[_0x27cd76(0xaa)])throw CliErrors[_0x27cd76(0xa1)]('Skill\x20metadata\x20appCode\x20\x22'+_0x1ab982[_0x27cd76(0x87)]+_0x27cd76(0x90)+_0x1cba84+'\x22.');const _0xf841a3=resolvePushSkillCode(_0x5be13a,_0x1cba84,_0x1ab982,_0x12d75b);if(!_0xf841a3)throw CliErrors[_0x27cd76(0xa1)]('Unable\x20to\x20resolve\x20skillCode\x20from\x20'+SKILL_FILE+',\x20'+METADATA_FILE+_0x27cd76(0x97));return{'dir':_0x5be13a,'skillCode':_0xf841a3,'metadata':_0x1ab982};}export function readPushDirectory(_0x2c4b15,_0x4ad487,_0x71ba52={}){const _0x5e295b=a159_0x40d4,_0x18b596=resolvePushDirectoryIdentity(_0x2c4b15,_0x4ad487,_0x71ba52),_0x1ce6ce=_0x18b596['dir'],_0x16aed6=resolve(_0x1ce6ce,SKILL_FILE);if(!existsSync(_0x16aed6)||!lstatSync(_0x16aed6)['isFile']())throw CliErrors[_0x5e295b(0xa1)]('Missing\x20'+SKILL_FILE+':\x20'+_0x16aed6);const _0x4b9b0a=_0x18b596[_0x5e295b(0x92)],_0x527364=_0x71ba52['targetScope']??_0x5e295b(0x84);if(!_0x71ba52[_0x5e295b(0x9d)]&&_0x4b9b0a?.[_0x5e295b(0x7c)]===_0x5e295b(0x74))throw CliErrors[_0x5e295b(0xa1)]('Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20'+METADATA_FILE+'\x20has\x20scope=\x22'+_0x4b9b0a[_0x5e295b(0x7c)]+'\x22.');if(!_0x71ba52[_0x5e295b(0x9d)]&&_0x527364===_0x5e295b(0x84)&&_0x4b9b0a?.['scope']&&_0x4b9b0a[_0x5e295b(0x7c)]!=='personal')throw CliErrors['validation'](_0x5e295b(0x76)+METADATA_FILE+'\x20has\x20scope=\x22'+_0x4b9b0a['scope']+'\x22.',_0x5e295b(0x99)+_0x1ce6ce+'\x20to\x20submit\x20company\x20Skills\x20for\x20review.');const _0x2b8e68=scanSkillDirectory(_0x1ce6ce,{'excludedFilePaths':_0x71ba52['excludedFilePaths']}),_0x3a5a53=buildSkillPackage(_0x2b8e68),_0xd7180=readFileSync(_0x16aed6,_0x5e295b(0x9e)),_0xae66cc=_0x18b596[_0x5e295b(0xa8)],_0x1385d7=_0x71ba52[_0x5e295b(0x95)]?undefined:_0x4b9b0a,_0x170a73=readSkillDisplayName(_0xd7180);return{'skillCode':_0xae66cc,'metadata':_0x4b9b0a,'frontmatterDisplayName':_0x170a73,'input':{'skillCode':_0xae66cc,'skillName':_0x170a73??_0x1385d7?.[_0x5e295b(0x78)],'description':_0x1385d7?.['description'],'content':_0xd7180,'files':_0x3a5a53[_0x5e295b(0xa4)],'packageBase64':_0x3a5a53[_0x5e295b(0x70)],'tags':_0x1385d7?.[_0x5e295b(0x9b)],'version':_0x1385d7?.['version'],'sourceSessionId':_0x1385d7?.[_0x5e295b(0x88)]}};}export function refreshPushDirectoryMetadataFromRemote(_0x2f09f9,_0x4bcce8,_0x473b7b,_0x4409b6={}){const _0x30b2f8=a159_0x40d4,_0x10e911=resolvePushDirectoryRoot(_0x2f09f9),_0x5f33aa=readPushMetadataIfPresent(resolve(_0x10e911,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x244dcd=requireRemoteScope(_0x4bcce8),_0x178624=readLocalSkillContent(_0x10e911),_0x306ac9={..._0x4bcce8,'appCode':_0x4bcce8[_0x30b2f8(0x87)]??_0x473b7b,'skillName':_0x4bcce8[_0x30b2f8(0x78)]??_0x5f33aa?.[_0x30b2f8(0x78)],'description':_0x4bcce8['description']??_0x5f33aa?.[_0x30b2f8(0xa3)],'example':_0x4bcce8['example']??_0x5f33aa?.[_0x30b2f8(0xa0)],'tags':Array[_0x30b2f8(0x71)](_0x4bcce8[_0x30b2f8(0x9b)])?_0x4bcce8[_0x30b2f8(0x9b)]:_0x5f33aa?.[_0x30b2f8(0x9b)],'sourceSessionId':_0x4bcce8[_0x30b2f8(0x88)]??_0x5f33aa?.[_0x30b2f8(0x88)],'content':_0x4bcce8[_0x30b2f8(0x72)]??_0x178624},_0x49baea=buildMetadata(_0x306ac9,_0x244dcd,_0x473b7b,contentHash(_0x178624),_0x4409b6[_0x30b2f8(0x7a)]);writeJsonAtomic(resolve(_0x10e911,METADATA_FILE),_0x49baea);}function a159_0x40d4(_0x18e142,_0x301686){_0x18e142=_0x18e142-0x70;const _0x34cb93=a159_0x34cb();let _0x40d444=_0x34cb93[_0x18e142];return _0x40d444;}export function recordPushedRuntimeSkill(_0x2a9121,_0x51f075,_0x48135f,_0x5c233a={}){const _0x56d9d2=a159_0x40d4,_0x4fe9d7=resolvePushDirectoryRoot(_0x2a9121),_0x31731a=scanSkillDirectory(_0x4fe9d7),_0x3f3077=_0x31731a['find'](_0x16e1ac=>_0x16e1ac[_0x56d9d2(0x9c)]===SKILL_FILE),_0x59aec1=_0x3f3077?fileText(_0x3f3077):'',_0x5b1889=tryNormalizePackageManifest(_0x51f075[_0x56d9d2(0xa7)]),_0x2b84e6={..._0x51f075,'content':_0x51f075[_0x56d9d2(0x72)]??_0x59aec1,'files':_0x5b1889},_0x2be3bb=_0x5b1889?normalizeLocalFiles(_0x31731a)[_0x56d9d2(0x85)](_0x23e0ff=>_0x5b1889['files']['some'](_0x470cde=>_0x470cde[_0x56d9d2(0x9c)]===_0x23e0ff['path'])):undefined,_0x489579=buildMetadata(_0x2b84e6,_0x5c233a[_0x56d9d2(0x7c)]??_0x56d9d2(0x84),_0x48135f,contentHash(_0x2b84e6[_0x56d9d2(0x72)]??''),_0x5c233a[_0x56d9d2(0x86)],_0x2be3bb);writeJsonAtomic(resolve(_0x4fe9d7,METADATA_FILE),_0x489579);}export function deriveSkillCodeFromDirectory(_0x36a778,_0x54f9e9){const _0x4b77a8=a159_0x40d4,_0x4f320c=basename(resolve(_0x36a778)),_0x2bf3c6=_0x54f9e9+'--';return _0x4f320c['startsWith'](_0x2bf3c6)?_0x4f320c[_0x4b77a8(0x7b)](_0x2bf3c6[_0x4b77a8(0x75)]):_0x4f320c;}function resolvePushSkillCode(_0x3880c6,_0x305b1a,_0x2abb4f,_0x3a29bb){const _0x5dba7b=a159_0x40d4,_0x1f06b8=deriveSkillCodeFromSkillFile(_0x3880c6)||deriveSkillCodeFromDirectory(_0x3880c6,_0x305b1a);if(_0x3a29bb[_0x5dba7b(0x83)])return _0x1f06b8;return _0x2abb4f?.[_0x5dba7b(0xa8)]?.[_0x5dba7b(0x7e)]()||_0x1f06b8;}function deriveSkillCodeFromSkillFile(_0x13aad2){const _0x332017=a159_0x40d4,_0x4c4e2b=resolve(_0x13aad2,SKILL_FILE);if(!existsSync(_0x4c4e2b)||!lstatSync(_0x4c4e2b)[_0x332017(0xa6)]())return undefined;const _0x154e6c=readFileSync(_0x4c4e2b,'utf8'),_0xa9136d=_0x154e6c['match'](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0xa9136d)return undefined;const _0x418d29=parseFrontmatterObject(_0xa9136d[0x1]??''),_0x4cf779=scalarToString(_0x418d29?.['name']);return _0x4cf779?slugifySkillName(_0x4cf779):undefined;}function readSkillDisplayName(_0x27db66){const _0x4fce13=a159_0x40d4,_0x9fb183=_0x27db66['match'](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x9fb183)return undefined;const _0x550b6c=parseFrontmatterObject(_0x9fb183[0x1]??'');return scalarToString(_0x550b6c?.[_0x4fce13(0x8c)]);}function slugifySkillName(_0x3a4b28){const _0x30d2f2=a159_0x40d4,_0x1e56f8=_0x3a4b28[_0x30d2f2(0x7e)]()['toLowerCase']()[_0x30d2f2(0xa2)](/[^\p{L}\p{N}\p{So}]+/gu,'-')['replace'](/^-+/,'')[_0x30d2f2(0xa2)](/-+$/,'')[_0x30d2f2(0xa2)](/-{2,}/g,'-');if(!_0x1e56f8)throw CliErrors[_0x30d2f2(0xa1)](_0x30d2f2(0xa5)+SKILL_FILE+_0x30d2f2(0x91));return _0x1e56f8;}function parseFrontmatterObject(_0x4f4701){try{const _0x2386d4=a159_0x5cbc80(_0x4f4701);return _0x2386d4&&typeof _0x2386d4==='object'&&!Array['isArray'](_0x2386d4)?_0x2386d4:undefined;}catch{return undefined;}}function scalarToString(_0x25ab92){const _0x195ee1=a159_0x40d4;if(typeof _0x25ab92===_0x195ee1(0x9f))return _0x25ab92[_0x195ee1(0x7e)]();if(typeof _0x25ab92===_0x195ee1(0x9a)||typeof _0x25ab92===_0x195ee1(0x77))return String(_0x25ab92);return undefined;}function resolvePushDirectoryRoot(_0x5a140d){const _0x396523=a159_0x40d4,_0x2ffded=resolve(_0x5a140d);if(!existsSync(_0x2ffded))throw CliErrors[_0x396523(0xa1)]('Skill\x20directory\x20not\x20found:\x20'+_0x5a140d);const _0x4ed2b3=lstatSync(_0x2ffded);if(_0x4ed2b3[_0x396523(0x79)]())return _0x2ffded;if(_0x4ed2b3[_0x396523(0x80)]()){const _0x531853=realpathSync(_0x2ffded);if(lstatSync(_0x531853)['isDirectory']())return _0x531853;}throw CliErrors[_0x396523(0xa1)]('Skill\x20directory\x20not\x20found:\x20'+_0x5a140d);}function requireRemoteScope(_0x1426f5){const _0x4b7d47=a159_0x40d4;if(_0x1426f5[_0x4b7d47(0x7c)]===_0x4b7d47(0x84)||_0x1426f5['scope']===_0x4b7d47(0x93)||_0x1426f5[_0x4b7d47(0x7c)]===_0x4b7d47(0x74))return _0x1426f5[_0x4b7d47(0x7c)];throw CliErrors['validation'](_0x4b7d47(0x96)+(_0x1426f5['skillCode']||'(unknown)')+_0x4b7d47(0xa9)+(_0x1426f5[_0x4b7d47(0x7c)]??_0x4b7d47(0x7f))+'\x22.');}function readLocalSkillContent(_0x4439e9){const _0x243cb5=a159_0x40d4,_0x5d429e=resolve(_0x4439e9,SKILL_FILE);return existsSync(_0x5d429e)&&lstatSync(_0x5d429e)[_0x243cb5(0xa6)]()?readFileSync(_0x5d429e,_0x243cb5(0x9e)):'';}function readPushMetadataIfPresent(_0x182301,_0xf34e5a={}){const _0x5c5479=a159_0x40d4;try{return readMetadataIfPresent(_0x182301);}catch(_0x113529){if(_0xf34e5a[_0x5c5479(0x82)])return undefined;throw _0x113529;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a160_0x41da(_0x5d841f,_0x3be283){_0x5d841f=_0x5d841f-0x136;const _0x5e12e6=a160_0x5e12();let _0x41da50=_0x5e12e6[_0x5d841f];return _0x41da50;}(function(_0x329840,_0x1d6811){const _0x538a2a=a160_0x41da,_0xfc43e5=_0x329840();while(!![]){try{const _0x37cd23=parseInt(_0x538a2a(0x143))/0x1+-parseInt(_0x538a2a(0x13f))/0x2+-parseInt(_0x538a2a(0x141))/0x3+-parseInt(_0x538a2a(0x13b))/0x4*(-parseInt(_0x538a2a(0x140))/0x5)+parseInt(_0x538a2a(0x13d))/0x6+-parseInt(_0x538a2a(0x142))/0x7*(-parseInt(_0x538a2a(0x139))/0x8)+-parseInt(_0x538a2a(0x145))/0x9*(parseInt(_0x538a2a(0x144))/0xa);if(_0x37cd23===_0x1d6811)break;else _0xfc43e5['push'](_0xfc43e5['shift']());}catch(_0x2d4079){_0xfc43e5['push'](_0xfc43e5['shift']());}}}(a160_0x5e12,0xc62a2));function a160_0x5e12(){const _0x418c0d=['585801jCnmeS','includes','push','validation','110216vnFbuY','Unsupported\x20runtime\x20Skill\x20scope:\x20','105740uopapo','company','2168262erEsIT','builtin','2652816JWYNuU','290YwEWMV','1873050oXgRpN','371hbTVZr','853631oxCtKD','110hnNhLw'];a160_0x5e12=function(){return _0x418c0d;};return a160_0x5e12();}import{CliErrors}from'../../errors.js';export function normalizeRuntimeSkillScopes(_0x48ad72){const _0x5d300e=a160_0x41da,_0x44e44c=_0x48ad72&&_0x48ad72['length']>0x0?_0x48ad72:['personal',_0x5d300e(0x13c),_0x5d300e(0x13e)],_0x4cd028=[];for(const _0x3987d6 of _0x44e44c){if(!isRuntimeSkillScope(_0x3987d6))throw CliErrors[_0x5d300e(0x138)](_0x5d300e(0x13a)+_0x3987d6);!_0x4cd028[_0x5d300e(0x136)](_0x3987d6)&&_0x4cd028[_0x5d300e(0x137)](_0x3987d6);}return _0x4cd028;}export function isRuntimeSkillScope(_0x31a7bb){const _0x1cbe57=a160_0x41da;return _0x31a7bb==='personal'||_0x31a7bb===_0x1cbe57(0x13c)||_0x31a7bb==='builtin';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x131e07,_0x5a5bef){const _0x294cbb=a162_0x3e08,_0x1b5207=_0x131e07();while(!![]){try{const _0x4d6e11=-parseInt(_0x294cbb(0x19d))/0x1+-parseInt(_0x294cbb(0x195))/0x2*(parseInt(_0x294cbb(0x19e))/0x3)+parseInt(_0x294cbb(0x191))/0x4+parseInt(_0x294cbb(0x199))/0x5+-parseInt(_0x294cbb(0x198))/0x6+-parseInt(_0x294cbb(0x19b))/0x7*(parseInt(_0x294cbb(0x190))/0x8)+-parseInt(_0x294cbb(0x19a))/0x9*(-parseInt(_0x294cbb(0x197))/0xa);if(_0x4d6e11===_0x5a5bef)break;else _0x1b5207['push'](_0x1b5207['shift']());}catch(_0x5f52ed){_0x1b5207['push'](_0x1b5207['shift']());}}}(a162_0x5d83,0xe17cb));import{unzipSync,zipSync}from'fflate';function a162_0x3e08(_0x531888,_0x655394){_0x531888=_0x531888-0x189;const _0x5d8345=a162_0x5d83();let _0x3e0819=_0x5d8345[_0x531888];return _0x3e0819;}import{CliErrors}from'../../errors.js';import{compareSkillFiles,fileContent,normalizeLocalFiles,normalizeSkillRelativePath}from'./local-files.js';function a162_0x5d83(){const _0x216bad=['validation','object','length','Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.','code','8wIqrzi','5489228dRPFGS','name','entries','sort','2RMVyrX','Runtime\x20Skill\x20package\x20contains\x20directory\x20entry:\x20','5057530wKjhom','3523482WdwGhq','3137405KGpdPG','45WBNIzx','11404071ENBMsO','from','352109Omztqz','3109347CrYubC','path','endsWith'];a162_0x5d83=function(){return _0x216bad;};return a162_0x5d83();}const ZIP_MTIME=new Date('1980-01-01T00:00:00.000Z');export function createDeterministicZipPackage(_0x17d2eb){const _0x58f235=a162_0x3e08,_0x3409cf={};for(const _0xa40081 of normalizeLocalFiles(_0x17d2eb)){_0x3409cf[_0xa40081[_0x58f235(0x189)]]=fileContent(_0xa40081);}return Buffer[_0x58f235(0x19c)](zipSync(_0x3409cf,{'level':0x0,'mtime':ZIP_MTIME}));}export function parseZipPackage(_0x721ab6){const _0x504a6a=a162_0x3e08;if(_0x721ab6[_0x504a6a(0x18d)]<0x16)throw CliErrors[_0x504a6a(0x18b)](_0x504a6a(0x18e));let _0x324cf1;try{_0x324cf1=unzipSync(_0x721ab6,{'filter'(_0x4cea55){const _0xc8edcd=_0x504a6a,_0x5e6b56=normalizeSkillRelativePath(_0x4cea55[_0xc8edcd(0x192)]);if(_0x5e6b56[_0xc8edcd(0x18a)]('/'))throw CliErrors[_0xc8edcd(0x18b)](_0xc8edcd(0x196)+_0x5e6b56);return!![];}});}catch(_0x575404){if(isRuntimeSkillValidationError(_0x575404))throw _0x575404;throw CliErrors[_0x504a6a(0x18b)](_0x504a6a(0x18e));}return Object[_0x504a6a(0x193)](_0x324cf1)['map'](([_0x3bfef2,_0x25c118])=>({'path':normalizeSkillRelativePath(_0x3bfef2),'bytes':Buffer[_0x504a6a(0x19c)](_0x25c118)}))[_0x504a6a(0x194)](compareSkillFiles);}function isRuntimeSkillValidationError(_0x343e6){const _0x398d37=a162_0x3e08;return typeof _0x343e6===_0x398d37(0x18c)&&_0x343e6!==null&&_0x398d37(0x18f)in _0x343e6&&_0x343e6[_0x398d37(0x18f)]==='validation_error';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x42ee17,_0x4bb698){const _0x523b30=a163_0x44a8,_0x41766e=_0x42ee17();while(!![]){try{const _0x30102a=-parseInt(_0x523b30(0x18a))/0x1+parseInt(_0x523b30(0x194))/0x2+-parseInt(_0x523b30(0x1a9))/0x3*(parseInt(_0x523b30(0x182))/0x4)+-parseInt(_0x523b30(0x192))/0x5+parseInt(_0x523b30(0x17f))/0x6*(-parseInt(_0x523b30(0x199))/0x7)+parseInt(_0x523b30(0x1ae))/0x8*(-parseInt(_0x523b30(0x1a8))/0x9)+parseInt(_0x523b30(0x197))/0xa;if(_0x30102a===_0x4bb698)break;else _0x41766e['push'](_0x41766e['shift']());}catch(_0x417fb0){_0x41766e['push'](_0x41766e['shift']());}}}(a163_0x1aa9,0x7ffa9));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(_0xd4f1da){const _0x17bc76=a163_0x44a8,_0x550fb0=normalizeLocalFiles(_0xd4f1da);if(!_0x550fb0[_0x17bc76(0x18e)](_0x1d6ced=>_0x1d6ced[_0x17bc76(0x18c)]===SKILL_FILE))throw CliErrors[_0x17bc76(0x1a6)](_0x17bc76(0x1af)+SKILL_FILE+_0x17bc76(0x1a7));const _0x596ed4=localFilesToManifestFiles(_0x550fb0),_0x474da9=createDeterministicZipPackage(_0x550fb0);return{'manifest':{'schemaVersion':0x2,'treeSha256':fileTreeHash(_0x596ed4),'zipSha256':bufferSha256(_0x474da9),'zipSize':_0x474da9[_0x17bc76(0x1ab)],'files':_0x596ed4},'packageBytes':_0x474da9,'packageBase64':_0x474da9[_0x17bc76(0x191)](_0x17bc76(0x19a))};}export function verifyRuntimeSkillPackage(_0x5790a5,_0x4eeff0){const _0x26e674=a163_0x44a8,_0x45e4ca=normalizePackageManifest(_0x5790a5,{'requireOssPath':![]});if(!_0x45e4ca)throw CliErrors[_0x26e674(0x1a6)](_0x26e674(0x1a0));return extractAndVerifyPackage(_0x45e4ca,_0x4eeff0);}export function verifyRuntimeSkillBundle(_0x5ca77b,_0x9f2541){const _0x4a77d1=a163_0x44a8,_0x40d2f4=normalizePackageManifest(_0x5ca77b,{'requireOssPath':![]});if(!_0x40d2f4)throw CliErrors[_0x4a77d1(0x1a6)](_0x4a77d1(0x1a0));return extractAndVerifyPackageFiles(_0x40d2f4,_0x9f2541);}export function tryNormalizePackageManifest(_0x3f2024){return normalizePackageManifest(_0x3f2024,{'requireOssPath':![]});}export function requirePackageBytes(_0x39c00b,_0x95e7cc){const _0x2c0cde=a163_0x44a8;if(!_0x95e7cc||_0x95e7cc[_0x2c0cde(0x1ab)]===0x0)throw CliErrors['validation'](_0x2c0cde(0x19c)+_0x39c00b);return _0x95e7cc;}function a163_0x1aa9(){const _0x5ec069=['Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.','Runtime\x20Skill\x20file\x20tree\x20sha256\x20mismatch.','isSafeInteger','Runtime\x20Skill\x20package\x20is\x20missing\x20','bytes','object','validation','\x20in\x20Skill\x20file\x20package.','81bwZLcT','24NFKbwN','zipSize','length','push','schemaVersion','806056vqKpaT','Missing\x20','22794qTemTE','requireOssPath','Runtime\x20Skill\x20package\x20file\x20sha256\x20mismatch:\x20','179448fHDfZx','ossPath','isArray','zipSha256','Runtime\x20Skill\x20package\x20sha256\x20is\x20invalid.','files','Duplicate\x20Skill\x20package\x20entry:\x20','set','658903iogWzC','Runtime\x20Skill\x20package\x20size\x20mismatch.','path','has','some','Runtime\x20Skill\x20package\x20entry\x20list\x20mismatch.','Runtime\x20Skill\x20manifest\x20is\x20missing\x20','toString','403880LoQtVJ','toLowerCase','526388cIDfBz','Runtime\x20Skill\x20package\x20size\x20is\x20invalid.','treeSha256','26804860lOGzDP','Runtime\x20Skill\x20package\x20is\x20missing\x20entry:\x20','763CzaYaE','base64','map','Runtime\x20Skill\x20package\x20is\x20required\x20for\x20Skill\x20install:\x20','trim','Runtime\x20Skill\x20package\x20file\x20size\x20mismatch:\x20','Runtime\x20Skill\x20package\x20sha256\x20mismatch.'];a163_0x1aa9=function(){return _0x5ec069;};return a163_0x1aa9();}export function extractDownloadedPackage(_0x28d18c){const _0x15a4b7=a163_0x44a8,_0x3cc0fa=parseZipPackage(_0x28d18c)[_0x15a4b7(0x19b)](_0x3dacf5=>({'path':_0x3dacf5[_0x15a4b7(0x18c)],'bytes':_0x3dacf5[_0x15a4b7(0x1a4)]}));if(!_0x3cc0fa[_0x15a4b7(0x18e)](_0x4680b3=>_0x4680b3[_0x15a4b7(0x18c)]===SKILL_FILE))throw CliErrors[_0x15a4b7(0x1a6)](_0x15a4b7(0x1a3)+SKILL_FILE+'.');return normalizeLocalFiles(_0x3cc0fa);}function a163_0x44a8(_0x2ed533,_0x542875){_0x2ed533=_0x2ed533-0x17f;const _0x1aa9cc=a163_0x1aa9();let _0x44a829=_0x1aa9cc[_0x2ed533];return _0x44a829;}export function localFilesToManifestFiles(_0x417d60){const _0x3a9086=a163_0x44a8;return normalizeLocalFiles(_0x417d60)[_0x3a9086(0x19b)](_0x5a98b9=>({'path':_0x5a98b9[_0x3a9086(0x18c)],'sha256':fileHash(_0x5a98b9),'size':fileContent(_0x5a98b9)[_0x3a9086(0x1ab)]}));}function normalizePackageManifest(_0x33084d,_0x31467d){const _0x4d8eb7=a163_0x44a8;if(!_0x33084d||typeof _0x33084d!==_0x4d8eb7(0x1a5)||Array['isArray'](_0x33084d))return undefined;const _0x39cf2f=_0x33084d,_0x29c9d2=typeof _0x39cf2f['ossPath']==='string'?_0x39cf2f[_0x4d8eb7(0x183)][_0x4d8eb7(0x19d)]():undefined;if(_0x31467d[_0x4d8eb7(0x180)]&&!_0x29c9d2)return undefined;if(!Array[_0x4d8eb7(0x184)](_0x39cf2f[_0x4d8eb7(0x187)])||_0x39cf2f[_0x4d8eb7(0x187)]['length']===0x0)return undefined;if(!isSha256Hex(_0x39cf2f[_0x4d8eb7(0x196)]))throw CliErrors['validation']('Runtime\x20Skill\x20file\x20tree\x20sha256\x20is\x20invalid.');if(!isSha256Hex(_0x39cf2f['zipSha256']))throw CliErrors[_0x4d8eb7(0x1a6)](_0x4d8eb7(0x186));if(!Number[_0x4d8eb7(0x1a2)](_0x39cf2f[_0x4d8eb7(0x1aa)])||_0x39cf2f[_0x4d8eb7(0x1aa)]<0x0)throw CliErrors['validation'](_0x4d8eb7(0x195));const _0xc45222=normalizeManifestFiles(_0x39cf2f[_0x4d8eb7(0x187)]);if(!_0xc45222[_0x4d8eb7(0x18e)](_0x293260=>_0x293260[_0x4d8eb7(0x18c)]===SKILL_FILE))throw CliErrors[_0x4d8eb7(0x1a6)](_0x4d8eb7(0x190)+SKILL_FILE+'.');const _0x48574a=fileTreeHash(_0xc45222);if(_0x48574a!==_0x39cf2f[_0x4d8eb7(0x196)][_0x4d8eb7(0x193)]())throw CliErrors['validation'](_0x4d8eb7(0x1a1));return{'schemaVersion':Number[_0x4d8eb7(0x1a2)](_0x39cf2f[_0x4d8eb7(0x1ad)])?_0x39cf2f[_0x4d8eb7(0x1ad)]:0x2,'ossPath':_0x29c9d2,'treeSha256':_0x48574a,'zipSha256':_0x39cf2f['zipSha256']['toLowerCase'](),'zipSize':_0x39cf2f[_0x4d8eb7(0x1aa)],'files':_0xc45222};}function extractAndVerifyPackage(_0x15b8da,_0x456773){const _0x223bba=a163_0x44a8,_0x28ee68=normalizePackageManifest(_0x15b8da,{'requireOssPath':![]});if(!_0x28ee68)throw CliErrors[_0x223bba(0x1a6)](_0x223bba(0x1a0));if(_0x456773['length']!==_0x28ee68[_0x223bba(0x1aa)])throw CliErrors['validation'](_0x223bba(0x18b));const _0x464a9b=bufferSha256(_0x456773);if(_0x464a9b!==_0x28ee68[_0x223bba(0x185)])throw CliErrors['validation'](_0x223bba(0x19f));return extractAndVerifyPackageFiles(_0x28ee68,_0x456773);}function extractAndVerifyPackageFiles(_0x51186d,_0x278b32){const _0x4314f0=a163_0x44a8,_0x58ce39=parseZipPackage(_0x278b32);if(_0x58ce39[_0x4314f0(0x1ab)]!==_0x51186d[_0x4314f0(0x187)][_0x4314f0(0x1ab)])throw CliErrors[_0x4314f0(0x1a6)](_0x4314f0(0x18f));const _0x18a8f2=new Map();for(const _0x3d22a5 of _0x58ce39){if(_0x18a8f2[_0x4314f0(0x18d)](_0x3d22a5[_0x4314f0(0x18c)]))throw CliErrors['validation'](_0x4314f0(0x188)+_0x3d22a5['path']);_0x18a8f2[_0x4314f0(0x189)](_0x3d22a5[_0x4314f0(0x18c)],_0x3d22a5);}const _0x45ac98=[];for(const _0x533899 of _0x51186d[_0x4314f0(0x187)]){const _0x48079f=_0x18a8f2['get'](_0x533899[_0x4314f0(0x18c)]);if(!_0x48079f)throw CliErrors[_0x4314f0(0x1a6)](_0x4314f0(0x198)+_0x533899[_0x4314f0(0x18c)]);if(_0x48079f[_0x4314f0(0x1a4)]['length']!==_0x533899['size'])throw CliErrors[_0x4314f0(0x1a6)](_0x4314f0(0x19e)+_0x533899[_0x4314f0(0x18c)]);const _0x1e2f5d=bufferSha256(_0x48079f[_0x4314f0(0x1a4)]);if(_0x1e2f5d!==_0x533899['sha256'])throw CliErrors[_0x4314f0(0x1a6)](_0x4314f0(0x181)+_0x533899[_0x4314f0(0x18c)]);_0x45ac98[_0x4314f0(0x1ac)]({'path':_0x533899['path'],'bytes':_0x48079f['bytes']});}return normalizeLocalFiles(_0x45ac98);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a164_0x5486(_0xabfcc0,_0x1e3b3b){_0xabfcc0=_0xabfcc0-0x6a;var _0x220286=a164_0x2202();var _0x5486e6=_0x220286[_0xabfcc0];return _0x5486e6;}(function(_0x48c6df,_0x37d6b1){var _0x2d3aa2=a164_0x5486,_0x1bb00b=_0x48c6df();while(!![]){try{var _0xedfa7=parseInt(_0x2d3aa2(0x70))/0x1+-parseInt(_0x2d3aa2(0x6d))/0x2+-parseInt(_0x2d3aa2(0x6b))/0x3*(parseInt(_0x2d3aa2(0x73))/0x4)+-parseInt(_0x2d3aa2(0x6e))/0x5+-parseInt(_0x2d3aa2(0x6c))/0x6*(-parseInt(_0x2d3aa2(0x6a))/0x7)+parseInt(_0x2d3aa2(0x6f))/0x8+parseInt(_0x2d3aa2(0x72))/0x9*(parseInt(_0x2d3aa2(0x71))/0xa);if(_0xedfa7===_0x37d6b1)break;else _0x1bb00b['push'](_0x1bb00b['shift']());}catch(_0x22d2ea){_0x1bb00b['push'](_0x1bb00b['shift']());}}}(a164_0x2202,0xeef18));export{contentHash,fileTreeHash}from'./runtime-skill-sync/hashing.js';export{linkEffectiveRuntimeSkills,linkGlobalRuntimeSkills,pruneStaleRuntimeSkillCache,pruneStaleRuntimeSkillLinks}from'./runtime-skill-sync/links.js';export{resolveRuntimeSkillInstallTarget}from'./runtime-skill-sync/install-target.js';export{listLocalRuntimeSkills}from'./runtime-skill-sync/list-local.js';export{materializeRuntimeSkill,reuseMaterializedRuntimeSkill}from'./runtime-skill-sync/materialize.js';export{readMetadataIfPresent}from'./runtime-skill-sync/metadata.js';export{getRuntimeSkillCacheRoot,getRuntimeSkillDir,resolveSkillSyncPaths,runtimeAgentSkillRoots}from'./runtime-skill-sync/paths.js';function a164_0x2202(){var _0xa5f604=['2240JJHfMC','123363GTMbEi','6121212MBlkAZ','350TIhsAK','3FdHFRm','174uTEFSu','2343868CMKZXm','1935035dpJgrz','1286272ixQmCc','835354NiWisc'];a164_0x2202=function(){return _0xa5f604;};return a164_0x2202();}export{deriveSkillCodeFromDirectory,readPushDirectory,refreshPushDirectoryMetadataFromRemote,recordPushedRuntimeSkill,resolvePushDirectoryIdentity}from'./runtime-skill-sync/push.js';export{buildSkillPackage,verifyRuntimeSkillBundle,verifyRuntimeSkillPackage}from'./runtime-skill-sync/zip-package.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a165_0x37004d=a165_0x5565;(function(_0x3a11ae,_0x19433b){const _0x44fafd=a165_0x5565,_0x3c008a=_0x3a11ae();while(!![]){try{const _0x5d23df=-parseInt(_0x44fafd(0xe9))/0x1*(-parseInt(_0x44fafd(0x102))/0x2)+parseInt(_0x44fafd(0xfe))/0x3+-parseInt(_0x44fafd(0xed))/0x4*(-parseInt(_0x44fafd(0x105))/0x5)+parseInt(_0x44fafd(0x101))/0x6+-parseInt(_0x44fafd(0x103))/0x7*(-parseInt(_0x44fafd(0x108))/0x8)+-parseInt(_0x44fafd(0xf7))/0x9+-parseInt(_0x44fafd(0xe7))/0xa;if(_0x5d23df===_0x19433b)break;else _0x3c008a['push'](_0x3c008a['shift']());}catch(_0x4b12a0){_0x3c008a['push'](_0x3c008a['shift']());}}}(a165_0x1c73,0xa3f89));import{existsSync,readFileSync}from'node:fs';import{homedir}from'node:os';function a165_0x5565(_0x27dc53,_0x309438){_0x27dc53=_0x27dc53-0xe6;const _0x1c73d1=a165_0x1c73();let _0x55655b=_0x1c73d1[_0x27dc53];return _0x55655b;}function a165_0x1c73(){const _0x13c69b=['version','utf8','join','56sLlmLa','kind','number','skills','present','unverifiable','not-recorded','lockFile','message','map','10554120jfQLkH','globalSkillsDirs','.claude','.agents','home','\x20uses\x20unsupported\x20version\x20','\x20records\x20\x22','3466068kdDOte','object','recorded','7964604ddDCnX','118Igosfp','186809foMGor','unusable','242030msUtsq','absent','\x20has\x20no\x20skills\x20map','144zCLuoX','includes','19375450wSmdeI','\x20is\x20unreadable:\x20','2390WFWKeH'];a165_0x1c73=function(){return _0x13c69b;};return a165_0x1c73();}import{join}from'node:path';export const SKILL_LOCK_RELATIVE_PATH=join(a165_0x37004d(0xfa),'.skill-lock.json');export const GLOBAL_SKILLS_DIR_RELATIVE_PATHS=[join(a165_0x37004d(0xfa),a165_0x37004d(0xf0)),join(a165_0x37004d(0xf9),a165_0x37004d(0xf0))];const SUPPORTED_LOCK_VERSIONS=[0x3];function readLockLookup(_0x17c417,_0x33eddb){const _0x3252fc=a165_0x37004d;if(!existsSync(_0x17c417))return{'kind':_0x3252fc(0xf3)};let _0x4f9699;try{_0x4f9699=JSON['parse'](readFileSync(_0x17c417,_0x3252fc(0xeb)));}catch(_0x240e8f){return{'kind':_0x3252fc(0x104),'reason':_0x17c417+_0x3252fc(0xe8)+_0x240e8f[_0x3252fc(0xf5)]};}const _0x59fe89=_0x4f9699;if(typeof _0x59fe89?.['version']!==_0x3252fc(0xef)||!SUPPORTED_LOCK_VERSIONS[_0x3252fc(0xe6)](_0x59fe89[_0x3252fc(0xea)]))return{'kind':'unusable','reason':_0x17c417+_0x3252fc(0xfc)+String(_0x59fe89?.[_0x3252fc(0xea)])};if(!_0x59fe89[_0x3252fc(0xf0)]||typeof _0x59fe89[_0x3252fc(0xf0)]!==_0x3252fc(0xff))return{'kind':_0x3252fc(0x104),'reason':_0x17c417+_0x3252fc(0x107)};return _0x59fe89[_0x3252fc(0xf0)][_0x33eddb]?{'kind':_0x3252fc(0x100)}:{'kind':_0x3252fc(0xf3)};}export function resolveInstalledSkill(_0x14ea34,_0x32637c){const _0x1609d3=a165_0x37004d,_0x20e213=_0x32637c?.[_0x1609d3(0xfb)]??homedir(),_0x58985f=_0x32637c?.[_0x1609d3(0xf8)]??GLOBAL_SKILLS_DIR_RELATIVE_PATHS[_0x1609d3(0xf6)](_0x5895ec=>join(_0x20e213,_0x5895ec)),_0x4a021c=_0x32637c?.[_0x1609d3(0xf4)]??join(_0x20e213,SKILL_LOCK_RELATIVE_PATH),_0x5d0bf8=_0x58985f['map'](_0x41f49e=>join(_0x41f49e,_0x14ea34,'SKILL.md')),_0x2c93c2=_0x5d0bf8['find'](_0x4b7074=>existsSync(_0x4b7074));if(_0x2c93c2)return{'state':_0x1609d3(0xf1),'path':_0x2c93c2};const _0xb1798a=readLockLookup(_0x4a021c,_0x14ea34);if(_0xb1798a[_0x1609d3(0xee)]===_0x1609d3(0x104))return{'state':'unverifiable','reason':_0xb1798a['reason']};if(_0xb1798a[_0x1609d3(0xee)]===_0x1609d3(0x100))return{'state':_0x1609d3(0xf2),'reason':_0x4a021c+_0x1609d3(0xfd)+_0x14ea34+'\x22\x20but\x20no\x20SKILL.md\x20was\x20found\x20in\x20known\x20layouts\x20'+('('+_0x5d0bf8[_0x1609d3(0xec)](',\x20')+')')};return{'state':_0x1609d3(0x106),'checked':_0x5d0bf8};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a166_0x623a33=a166_0x1f4f;(function(_0x37c4cc,_0xe62e19){const _0x379306=a166_0x1f4f,_0x19a974=_0x37c4cc();while(!![]){try{const _0x2b4aa5=-parseInt(_0x379306(0x15f))/0x1*(parseInt(_0x379306(0x164))/0x2)+-parseInt(_0x379306(0x15d))/0x3+-parseInt(_0x379306(0x161))/0x4+parseInt(_0x379306(0x163))/0x5+parseInt(_0x379306(0x160))/0x6+-parseInt(_0x379306(0x155))/0x7+-parseInt(_0x379306(0x162))/0x8*(-parseInt(_0x379306(0x153))/0x9);if(_0x2b4aa5===_0xe62e19)break;else _0x19a974['push'](_0x19a974['shift']());}catch(_0x43f5ef){_0x19a974['push'](_0x19a974['shift']());}}}(a166_0x57a5,0xee109));const REDACTED_ACCESS_KEY=a166_0x623a33(0x154);export function maskCliAccessKey(_0x20ec80){const _0x5cd3ac=a166_0x623a33;if(typeof _0x20ec80!==_0x5cd3ac(0x15e)||_0x20ec80[_0x5cd3ac(0x14f)]<=0x8)return REDACTED_ACCESS_KEY;return''+_0x20ec80[_0x5cd3ac(0x157)](0x0,0x8)+'*'[_0x5cd3ac(0x158)](_0x20ec80[_0x5cd3ac(0x14f)]-0x8);}export function redactCliConfigCredentials(_0x458f45){const _0x5d7e59=a166_0x623a33,_0x5f8128={..._0x458f45};return Object[_0x5d7e59(0x152)][_0x5d7e59(0x14d)][_0x5d7e59(0x151)](_0x5f8128,_0x5d7e59(0x15c))&&(_0x5f8128[_0x5d7e59(0x15c)]=maskCliAccessKey(_0x5f8128[_0x5d7e59(0x15c)])),_0x5f8128[_0x5d7e59(0x15b)]&&typeof _0x5f8128['apps']===_0x5d7e59(0x15a)&&!Array[_0x5d7e59(0x156)](_0x5f8128[_0x5d7e59(0x15b)])&&(_0x5f8128[_0x5d7e59(0x15b)]=redactLegacyAppCredentials(_0x5f8128['apps'])),_0x5f8128;}export function redactCliConfigValue(_0x257724,_0x9db41){const _0x528111=a166_0x623a33;if(_0x257724==='accessKey'||/^apps\.[^.]+\.accessKey$/['test'](_0x257724))return maskCliAccessKey(_0x9db41);if(_0x257724===_0x528111(0x15b)&&_0x9db41&&typeof _0x9db41===_0x528111(0x15a)&&!Array[_0x528111(0x156)](_0x9db41))return redactLegacyAppCredentials(_0x9db41);if(/^apps\.[^.]+$/[_0x528111(0x150)](_0x257724)&&_0x9db41&&typeof _0x9db41===_0x528111(0x15a)&&!Array[_0x528111(0x156)](_0x9db41)){const _0x1ac5c6=_0x9db41;return Object[_0x528111(0x152)]['hasOwnProperty']['call'](_0x1ac5c6,_0x528111(0x15c))?{..._0x1ac5c6,'accessKey':maskCliAccessKey(_0x1ac5c6[_0x528111(0x15c)])}:_0x9db41;}return _0x9db41;}function a166_0x1f4f(_0x2c46de,_0x274084){_0x2c46de=_0x2c46de-0x14c;const _0x57a50d=a166_0x57a5();let _0x1f4fe4=_0x57a50d[_0x2c46de];return _0x1f4fe4;}function redactLegacyAppCredentials(_0xb30134){const _0x42edf8=a166_0x623a33;return Object[_0x42edf8(0x159)](Object[_0x42edf8(0x14c)](_0xb30134)[_0x42edf8(0x14e)](([_0x432dc0,_0x24f440])=>{const _0x3f5de1=_0x42edf8;if(!_0x24f440||typeof _0x24f440!==_0x3f5de1(0x15a)||Array[_0x3f5de1(0x156)](_0x24f440))return[_0x432dc0,_0x24f440];const _0x5c08b4={..._0x24f440};return Object[_0x3f5de1(0x152)][_0x3f5de1(0x14d)]['call'](_0x5c08b4,_0x3f5de1(0x15c))&&(_0x5c08b4[_0x3f5de1(0x15c)]=maskCliAccessKey(_0x5c08b4[_0x3f5de1(0x15c)])),[_0x432dc0,_0x5c08b4];}));}function a166_0x57a5(){const _0x51d37d=['4609032zdmiuL','355312bvBmIG','4039835mMuJIC','954OSbUIK','entries','hasOwnProperty','map','length','test','call','prototype','162kQlVAY','<redacted>','1773079JWESer','isArray','slice','repeat','fromEntries','object','apps','accessKey','1214172VATihX','string','877cdUUgL','9577812uQkRQR'];a166_0x57a5=function(){return _0x51d37d;};return a166_0x57a5();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x30b379,_0x501457){const _0xda845=a167_0x1a17,_0x296c96=_0x30b379();while(!![]){try{const _0x52d5a8=parseInt(_0xda845(0x1da))/0x1+parseInt(_0xda845(0x1d5))/0x2+parseInt(_0xda845(0x1d7))/0x3+-parseInt(_0xda845(0x1d8))/0x4+-parseInt(_0xda845(0x1d9))/0x5+parseInt(_0xda845(0x1dd))/0x6*(parseInt(_0xda845(0x1d6))/0x7)+-parseInt(_0xda845(0x1dc))/0x8*(-parseInt(_0xda845(0x1db))/0x9);if(_0x52d5a8===_0x501457)break;else _0x296c96['push'](_0x296c96['shift']());}catch(_0x2b6894){_0x296c96['push'](_0x296c96['shift']());}}}(a167_0x23eb,0x47e68));function a167_0x23eb(){const _0x3ab638=['1231866fxqxoU','2339064oMvUUz','2341305AHJJca','490594BoHJiA','18vAmCDB','296288DcZHPx','630930fyXsKz','534176SqepEO','7wMvmKO'];a167_0x23eb=function(){return _0x3ab638;};return a167_0x23eb();}import{createJqFilter,resolveBundledJqPaths}from'@lovrabet/cli-framework';import{CliErrors}from'../errors.js';function a167_0x1a17(_0x235f18,_0x1af55d){_0x235f18=_0x235f18-0x1d5;const _0x23eb96=a167_0x23eb();let _0x1a17a2=_0x23eb96[_0x235f18];return _0x1a17a2;}export const applyJqFilter=createJqFilter(CliErrors,{'bundledJqPaths':resolveBundledJqPaths()});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2f8e4d,_0x5cfabf){const _0x15b4e8=a168_0x474f,_0x227e72=_0x2f8e4d();while(!![]){try{const _0x3319f2=-parseInt(_0x15b4e8(0xd9))/0x1*(parseInt(_0x15b4e8(0xe5))/0x2)+-parseInt(_0x15b4e8(0xde))/0x3*(parseInt(_0x15b4e8(0xd5))/0x4)+-parseInt(_0x15b4e8(0xd6))/0x5+parseInt(_0x15b4e8(0xdc))/0x6+-parseInt(_0x15b4e8(0xda))/0x7+parseInt(_0x15b4e8(0xe4))/0x8*(parseInt(_0x15b4e8(0xe7))/0x9)+parseInt(_0x15b4e8(0xdf))/0xa;if(_0x3319f2===_0x5cfabf)break;else _0x227e72['push'](_0x227e72['shift']());}catch(_0x520122){_0x227e72['push'](_0x227e72['shift']());}}}(a168_0xcaad,0xc3645));import a168_0x3e89b3 from'semver';function a168_0x474f(_0x4e8a4c,_0x5d212f){_0x4e8a4c=_0x4e8a4c-0xd3;const _0xcaad53=a168_0xcaad();let _0x474f90=_0xcaad53[_0x4e8a4c];return _0x474f90;}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 a168_0xcaad(){const _0x3ef594=['288LvMonX','28926520JdwdZe','Minimum\x20supported:\x20','stableVersion','upgradeMessage','minimumVersion','3097296kEGzJK','594gFRKqt','filter','18vxNGdq','valid','currentVersion','npm\x20install\x20-g\x20','unavailable','10252uojXpr','6390220CSvSub','minimumVersionMessage','Recommended\x20stable:\x20','4804OxwrxE','4928217LkkSPC','belowMinimum','4729560VRbyTs','latest'];a168_0xcaad=function(){return _0x3ef594;};return a168_0xcaad();}export function evaluateCliVersionPolicy(_0x48a208,_0x356a08){const _0x302ee8=a168_0x474f,_0x38e4a2=a168_0x3e89b3[_0x302ee8(0xe8)](_0x48a208)===_0x48a208,_0x269c56=_0x356a08?.[_0x302ee8(0xe1)]??null,_0x153135=_0x356a08?.[_0x302ee8(0xe3)]??null,_0x4c6b24=Boolean(_0x38e4a2&&_0x269c56&&a168_0x3e89b3['lt'](_0x48a208,_0x269c56)),_0x1a752f=Boolean(_0x38e4a2&&_0x153135&&a168_0x3e89b3['lt'](_0x48a208,_0x153135));return{'currentVersion':_0x48a208,'stableVersion':_0x269c56,'minimumVersion':_0x153135,'needsUpgrade':_0x4c6b24||_0x1a752f,'belowMinimum':_0x1a752f,'upgradeMessage':_0x356a08?.[_0x302ee8(0xe2)],'minimumVersionMessage':_0x356a08?.[_0x302ee8(0xd7)]};}export async function checkCliVersion(){return evaluateCliVersionPolicy(getCliVersion(),await getCliVersionPolicy());}export function getCliUpgradeCommand(_0x2e38c2){const _0x34b354=a168_0x474f;return _0x34b354(0xd3)+LOVRABET_NPM_PACKAGE_NAME+'@'+(_0x2e38c2['stableVersion']??_0x34b354(0xdd));}export function assertCliVersionSupported(_0x140058){const _0x5470e4=a168_0x474f;if(!_0x140058[_0x5470e4(0xdb)])return;const _0x428f2f=[_0x140058[_0x5470e4(0xd7)],'Current\x20version:\x20'+_0x140058[_0x5470e4(0xe9)],_0x5470e4(0xe0)+_0x140058['minimumVersion'],_0x5470e4(0xd8)+(_0x140058[_0x5470e4(0xe1)]??_0x5470e4(0xd4)),'Upgrade\x20command:\x20'+getCliUpgradeCommand(_0x140058)][_0x5470e4(0xe6)](Boolean)['join']('\x0a');throw CliErrors['validation']('Current\x20CLI\x20version\x20is\x20below\x20the\x20minimum\x20supported\x20version.',_0x428f2f);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x367765,_0x365ed8){const _0x2c2987=a169_0x3214,_0x36908e=_0x367765();while(!![]){try{const _0x2ff7e5=-parseInt(_0x2c2987(0x140))/0x1+parseInt(_0x2c2987(0x12d))/0x2*(-parseInt(_0x2c2987(0x13b))/0x3)+-parseInt(_0x2c2987(0x138))/0x4*(-parseInt(_0x2c2987(0x131))/0x5)+-parseInt(_0x2c2987(0x12c))/0x6*(parseInt(_0x2c2987(0x13f))/0x7)+parseInt(_0x2c2987(0x12a))/0x8*(-parseInt(_0x2c2987(0x13a))/0x9)+parseInt(_0x2c2987(0x136))/0xa*(-parseInt(_0x2c2987(0x135))/0xb)+-parseInt(_0x2c2987(0x127))/0xc*(-parseInt(_0x2c2987(0x130))/0xd);if(_0x2ff7e5===_0x365ed8)break;else _0x36908e['push'](_0x36908e['shift']());}catch(_0x324340){_0x36908e['push'](_0x36908e['shift']());}}}(a169_0x6f15,0xe6de0));import a169_0xf05a20 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(_0x56c004){const _0x42ccb0=a169_0x3214;return typeof _0x56c004===_0x42ccb0(0x12e)&&_0x56c004[_0x42ccb0(0x13d)]()?_0x56c004[_0x42ccb0(0x13d)]():null;}function pickStrictSemver(_0x51bf90){const _0x271a92=a169_0x3214,_0x1adcdc=pickString(_0x51bf90);return _0x1adcdc&&a169_0xf05a20[_0x271a92(0x12f)](_0x1adcdc)===_0x1adcdc?_0x1adcdc:null;}export function normalizeCliVersionPolicy(_0x12d6dc){const _0x57ef32=a169_0x3214;if(!_0x12d6dc||typeof _0x12d6dc!==_0x57ef32(0x13c))return null;const _0x1a2b54=_0x12d6dc,_0x20b226=_0x1a2b54[_0x57ef32(0x139)]&&typeof _0x1a2b54[_0x57ef32(0x139)]===_0x57ef32(0x13c)?_0x1a2b54[_0x57ef32(0x139)]:_0x1a2b54,_0x156af4=pickStrictSemver(_0x20b226[_0x57ef32(0x141)]??_0x20b226[_0x57ef32(0x128)]??_0x20b226['recommendedVersion']),_0x191876=pickStrictSemver(_0x20b226[_0x57ef32(0x12b)]??_0x20b226[_0x57ef32(0x133)]);if(!_0x156af4&&!_0x191876)return null;if(_0x156af4&&_0x191876&&a169_0xf05a20['gt'](_0x191876,_0x156af4))return null;return{'stableVersion':_0x156af4,'minimumVersion':_0x191876,'upgradeMessage':pickString(_0x20b226['upgradeMessage'])??undefined,'minimumVersionMessage':pickString(_0x20b226[_0x57ef32(0x137)])??undefined};}export async function fetchCliVersionPolicy(){const _0x4b69be=a169_0x3214;try{const _0x18c55a=await fetch(LOVRABET_CLI_VERSION_POLICY_URL,{'headers':{'Accept':'application/json'},'signal':AbortSignal[_0x4b69be(0x132)](FETCH_TIMEOUT_MS)});if(!_0x18c55a['ok'])return null;return normalizeCliVersionPolicy(await _0x18c55a['json']());}catch{return null;}}function a169_0x3214(_0x116332,_0x205f0c){_0x116332=_0x116332-0x127;const _0x6f15b4=a169_0x6f15();let _0x32148f=_0x6f15b4[_0x116332];return _0x32148f;}let cachedPolicy=null,cachedAt=0x0,hasCachedPolicy=![],pendingPolicy=null;export async function getCliVersionPolicy(){const _0x177239=a169_0x3214,_0x1eafa0=Date[_0x177239(0x129)]();if(hasCachedPolicy){const _0x3439ff=cachedPolicy?SUCCESS_CACHE_TTL_MS:FAILURE_CACHE_TTL_MS;if(_0x1eafa0-cachedAt<_0x3439ff)return cachedPolicy;}if(pendingPolicy)return pendingPolicy;return pendingPolicy=fetchCliVersionPolicy()[_0x177239(0x13e)](_0x1b6167=>{const _0x358901=_0x177239;return cachedPolicy=_0x1b6167,cachedAt=Date[_0x358901(0x129)](),hasCachedPolicy=!![],_0x1b6167;})[_0x177239(0x134)](()=>{pendingPolicy=null;}),pendingPolicy;}export function clearCliVersionPolicyCache(){cachedPolicy=null,cachedAt=0x0,hasCachedPolicy=![],pendingPolicy=null;}function a169_0x6f15(){const _0x2650f1=['616qmBmJs','minimumVersion','84RDhPjK','2NPlfLg','string','valid','39EdocXG','20KyBlct','timeout','minVersion','finally','16151696TLTiat','10KEjtxk','minimumVersionMessage','278148vgOlvk','cli','167814MUCtcB','469779hPolWK','object','trim','then','304815sftxVX','956228qVbWTD','stableVersion','21176052LfJWdW','latestVersion','now'];a169_0x6f15=function(){return _0x2650f1;};return a169_0x6f15();}
|