@lovrabet/lovrabet-cli 2.3.6-beta.2 → 2.3.6-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -2
- package/lib/cli.js +1 -1
- package/lib/commands/api-doc/index.js +1 -1
- package/lib/commands/app/cache.js +1 -1
- package/lib/commands/app/definitions.js +1 -1
- package/lib/commands/app/eligibility.js +1 -1
- package/lib/commands/app/mock-loader.js +1 -1
- package/lib/commands/app/remote-source.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/approval/index.js +1 -1
- package/lib/commands/artifact/index.js +1 -1
- package/lib/commands/auth/device.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/auth/prompt.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/exec.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/common/config-policy.js +1 -1
- package/lib/commands/common/constraints.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/config/definitions.js +1 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/import-excel.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/sdk-doc.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/permit/dataset-get.js +1 -1
- package/lib/commands/permit/dataset-set.js +1 -1
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.js +1 -1
- package/lib/commands/personal-bff/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/schedule/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/service/dynamic.js +1 -1
- package/lib/commands/service/function-name-adapter.js +1 -1
- package/lib/commands/service/index.js +1 -1
- package/lib/commands/service/registry.js +1 -1
- package/lib/commands/skill/commands/create.js +1 -1
- package/lib/commands/skill/commands/diagram.js +1 -1
- package/lib/commands/skill/commands/install.js +1 -1
- package/lib/commands/skill/commands/list.js +1 -1
- package/lib/commands/skill/commands/push.js +1 -1
- package/lib/commands/skill/commands/validate.js +1 -1
- package/lib/commands/skill/diagram.js +1 -1
- package/lib/commands/skill/flags.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/skill/manifest-helpers.js +1 -1
- package/lib/commands/skill/push-execute.js +1 -1
- package/lib/commands/skill/push-flow-helpers.js +1 -1
- package/lib/commands/skill/push-retarget.js +1 -1
- package/lib/commands/skill/scopes.js +1 -1
- package/lib/commands/skill/summary.js +1 -1
- package/lib/commands/skill/templates.js +1 -1
- package/lib/commands/skill/validate.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/update.js +1 -1
- package/lib/commands/user-account/bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/config/domain-config.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/app.js +1 -1
- package/lib/constant/auth-mode.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/distribution.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/product.js +1 -1
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/api-client.d.ts +6 -6
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/kb-management-client.d.ts +17 -0
- package/lib/core/kb-management-client.js +1 -0
- package/lib/core/kb-search-client.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/access-error.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/preparse.js +1 -1
- package/lib/framework/rate-limit.js +1 -1
- package/lib/framework/raw-flags.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-confirmation.js +1 -1
- package/lib/framework/runner-error.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/service-order.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/services/dataset-import/auto-id-runner.js +1 -1
- package/lib/services/dataset-import/excel-reader.js +1 -1
- package/lib/services/dataset-import/image-bytes.js +1 -1
- package/lib/services/dataset-import/image-ooxml.js +1 -1
- package/lib/services/dataset-import/image-runner.js +1 -1
- package/lib/services/dataset-import/metadata.js +1 -1
- package/lib/services/dataset-import/preview.js +1 -1
- package/lib/services/dataset-import/runner.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/runtime-skill-sync/constants.js +1 -1
- package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
- package/lib/skills/runtime-skill-sync/hashing.js +1 -1
- package/lib/skills/runtime-skill-sync/install-target.js +1 -1
- package/lib/skills/runtime-skill-sync/links.js +1 -1
- package/lib/skills/runtime-skill-sync/list-local.js +1 -1
- package/lib/skills/runtime-skill-sync/local-files.js +1 -1
- package/lib/skills/runtime-skill-sync/materialize.js +1 -1
- package/lib/skills/runtime-skill-sync/metadata.js +1 -1
- package/lib/skills/runtime-skill-sync/paths.js +1 -1
- package/lib/skills/runtime-skill-sync/push.js +1 -1
- package/lib/skills/runtime-skill-sync/scopes.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/utils/access-key-redaction.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/lossless-json.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/positive-safe-integer.js +1 -1
- package/lib/utils/redaction.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/lovrabet/SKILL.md +1 -1
- package/skills/lovrabet/references/lovrabet-kb-workflow.md +7 -3
- package/skills/lovrabet.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
const a153_0x5c4f35=a153_0xafb7;(function(_0x3c9144,_0x24edc6){const _0x16989e=a153_0xafb7,_0x49f983=_0x3c9144();while(!![]){try{const _0x46a0a7=-parseInt(_0x16989e(0x183))/0x1+-parseInt(_0x16989e(0x174))/0x2*(parseInt(_0x16989e(0x17f))/0x3)+-parseInt(_0x16989e(0x17a))/0x4*(parseInt(_0x16989e(0x169))/0x5)+parseInt(_0x16989e(0x15e))/0x6+-parseInt(_0x16989e(0x16e))/0x7*(-parseInt(_0x16989e(0x16f))/0x8)+parseInt(_0x16989e(0x186))/0x9+-parseInt(_0x16989e(0x162))/0xa*(parseInt(_0x16989e(0x155))/0xb);if(_0x46a0a7===_0x24edc6)break;else _0x49f983['push'](_0x49f983['shift']());}catch(_0x49d730){_0x49f983['push'](_0x49f983['shift']());}}}(a153_0x4230,0x8096a));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import a153_0x211ddb from'fs-extra';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';import{isDanglingSymlink,isPathInside,lstatIfPresent,realOrResolved,resolveSymlinkTarget}from'./fs-utils.js';function a153_0x4230(){const _0x50651b=['created','trim','push','filter','Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20','6134328xHDRuh','removed','skillRoots','Refusing\x20to\x20copy\x20Skill\x20symlink:\x20','20cdNuLG','appCode','linked-from-protected-root','scope','runtime-observe','dir','get','30qzjSpn','length','Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20','builtin','project','7zcqzfc','4724528fkETAz','accessKey','Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20','skill','metadataPath','316wyPdVu','contentHash','lovrabet','not-managed-symlink','unchanged','name','409588FhERsT','protectedLinkRoots','isSymbolicLink','managedRoot','env','3165wavxVE','metadata-mismatch','skillCode','company','322011amlisz','set','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','6037119oILWpq','skipped','has','validation','slice','startsWith','external-symlink','Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20','Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20','3596802rgywpl','updated','map','personal'];a153_0x4230=function(){return _0x50651b;};return a153_0x4230();}import{readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillCacheRoot,resolveSkillSyncPaths,safePathSegment}from'./paths.js';const {copySync,ensureDirSync,removeSync}=a153_0x211ddb,RESERVED_PROJECT_SKILL_CODES=new Set([a153_0x5c4f35(0x176),a153_0x5c4f35(0x166),'secret-retriever']);export function linkEffectiveRuntimeSkills(_0xa42c1,_0x5202fa){const _0x5110ed=a153_0x5c4f35,_0x12cad4=new Map();for(const _0x467ef7 of _0xa42c1){const _0x2d97a4=_0x467ef7[_0x5110ed(0x172)]['skillCode'];if(!_0x2d97a4)continue;const _0x278980=_0x12cad4[_0x5110ed(0x168)](_0x2d97a4);(!_0x278980||_0x467ef7[_0x5110ed(0x165)]==='personal')&&_0x12cad4[_0x5110ed(0x184)](_0x2d97a4,_0x467ef7);}const _0x4ff8ee=[];for(const _0x4cc8fc of _0x12cad4['values']()){const _0x2fde3b=requireSkillCode(_0x4cc8fc[_0x5110ed(0x172)]),_0x6bee99=readMetadataIfPresent(_0x4cc8fc[_0x5110ed(0x173)]);if(_0x6bee99?.[_0x5110ed(0x163)]!==_0x5202fa[_0x5110ed(0x163)]||_0x6bee99[_0x5110ed(0x181)]!==_0x2fde3b)throw CliErrors[_0x5110ed(0x189)](_0x5110ed(0x16b)+_0x5202fa[_0x5110ed(0x163)]+':\x20'+_0x4cc8fc['metadataPath']);const _0x243387=runtimeSkillLinkName(_0x5202fa,_0x2fde3b);for(const _0x32a755 of _0x5202fa['skillRoots']){_0x4ff8ee['push'](ensureManagedSymlink(resolve(_0x32a755,_0x243387),_0x4cc8fc[_0x5110ed(0x167)],_0x5202fa,_0x2fde3b));}}return _0x4ff8ee;}function a153_0xafb7(_0x5c2790,_0x15e405){_0x5c2790=_0x5c2790-0x150;const _0x42309f=a153_0x4230();let _0xafb77d=_0x42309f[_0x5c2790];return _0xafb77d;}export function pruneStaleRuntimeSkillLinks(_0x152d9b,_0xf77387,_0x482e30){const _0x5eb8fc=a153_0x5c4f35,_0x57d308=new Set([..._0xf77387][_0x5eb8fc(0x157)](_0x13d56a=>_0x13d56a[_0x5eb8fc(0x15a)]())[_0x5eb8fc(0x15c)](Boolean)),_0xd85c3a=_0x482e30?new Set([..._0x482e30][_0x5eb8fc(0x157)](_0x9ee4d8=>_0x9ee4d8['trim']())[_0x5eb8fc(0x15c)](Boolean)):undefined,_0x2ab1b6=[];for(const _0x4e98b8 of _0x152d9b[_0x5eb8fc(0x160)]){for(const _0x4a9a54 of managedTargetSkillLinkPaths(_0x4e98b8,_0x152d9b)){const _0x1bacc1=runtimeSkillCodeFromLink(_0x152d9b,_0x4a9a54);if(_0xd85c3a&&!_0xd85c3a[_0x5eb8fc(0x188)](_0x1bacc1))continue;if(_0x57d308['has'](_0x1bacc1))continue;_0x2ab1b6[_0x5eb8fc(0x15b)](removeManagedSkillLink(_0x4a9a54,_0x152d9b,_0x1bacc1));}}return _0x2ab1b6;}export function pruneStaleRuntimeSkillCache(_0x46a213,_0x132973={}){const _0x20b833=a153_0x5c4f35,_0x319078=new Set([..._0x46a213['activeSkillCodes']][_0x20b833(0x157)](_0x169ea8=>_0x169ea8[_0x20b833(0x15a)]())[_0x20b833(0x15c)](Boolean)),_0xd9e8d7=_0x46a213['pruneSkillCodes']?new Set([..._0x46a213['pruneSkillCodes']]['map'](_0x4ef440=>_0x4ef440[_0x20b833(0x15a)]())['filter'](Boolean)):undefined,_0x306618=_0x46a213['scopes']??[_0x20b833(0x158),_0x20b833(0x182)],_0x4f2970=resolve(getRuntimeSkillCacheRoot(_0x46a213[_0x20b833(0x17e)],_0x46a213[_0x20b833(0x170)],_0x132973),safePathSegment(_0x46a213[_0x20b833(0x163)],'appCode')),_0x29b8b8=[];for(const _0x2decea of _0x306618){const _0x1097da=resolve(_0x4f2970,_0x2decea);if(!existsSync(_0x1097da))continue;for(const _0x21bebe of readdirSync(_0x1097da,{'withFileTypes':!![]})){if(!_0x21bebe['isDirectory']())continue;const _0x18f007=_0x21bebe[_0x20b833(0x179)];if(_0xd9e8d7&&!_0xd9e8d7[_0x20b833(0x188)](_0x18f007))continue;if(_0x319078[_0x20b833(0x188)](_0x18f007))continue;const _0x1f4d08=resolve(_0x1097da,_0x18f007),_0x30ec4e=readMetadataIfPresent(resolve(_0x1f4d08,METADATA_FILE));if(_0x30ec4e?.[_0x20b833(0x163)]!==_0x46a213['appCode']||_0x30ec4e[_0x20b833(0x165)]!==_0x2decea||_0x30ec4e['skillCode']!==_0x18f007){_0x29b8b8[_0x20b833(0x15b)]({'path':_0x1f4d08,'action':_0x20b833(0x187),'reason':_0x20b833(0x180)});continue;}if(isLinkedFromAnyRoot(_0x1f4d08,_0x46a213[_0x20b833(0x17b)]??[])){_0x29b8b8[_0x20b833(0x15b)]({'path':_0x1f4d08,'action':'skipped','reason':_0x20b833(0x164)});continue;}removeSync(_0x1f4d08),_0x29b8b8[_0x20b833(0x15b)]({'path':_0x1f4d08,'action':_0x20b833(0x15f)});}}return _0x29b8b8;}export function linkGlobalRuntimeSkills(_0x3a83c3,_0x53b78d={}){const _0x5bc40b=a153_0x5c4f35,_0x59c782=resolveSkillSyncPaths(_0x53b78d),_0x3a72f1=[];for(const _0x5ec13f of _0x3a83c3){if(_0x5ec13f['scope']!==_0x5bc40b(0x16c))throw CliErrors[_0x5bc40b(0x189)](_0x5bc40b(0x185)+_0x5ec13f[_0x5bc40b(0x165)]);const _0x10506a=requireSkillCode(_0x5ec13f[_0x5bc40b(0x172)]),_0x5abd4c=copyManagedSkillDirectory(_0x5ec13f[_0x5bc40b(0x167)],resolve(_0x59c782['agentsSkillsDir'],_0x10506a));_0x3a72f1[_0x5bc40b(0x15b)]({..._0x5abd4c,'contentHash':_0x5ec13f[_0x5bc40b(0x175)]});}return _0x3a72f1;}function ensureManagedSymlink(_0x254920,_0x4e5003,_0x2df6b7,_0x35309f){const _0x1980f0=a153_0x5c4f35;mkdirSync(dirname(_0x254920),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x254920)||isDanglingSymlink(_0x254920)){const _0x4636c7=lstatSync(_0x254920);if(!_0x4636c7['isSymbolicLink']())throw CliErrors[_0x1980f0(0x189)](_0x1980f0(0x171)+_0x254920);const _0x21bb36=resolveSymlinkTarget(_0x254920);if(!isPathInside(realOrResolved(_0x21bb36),realOrResolved(_0x2df6b7[_0x1980f0(0x17d)])))throw CliErrors[_0x1980f0(0x189)]('Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20'+_0x254920);if(realOrResolved(_0x21bb36)===realOrResolved(_0x4e5003))return{'path':_0x254920,'target':_0x4e5003,'action':_0x1980f0(0x178)};const _0x19e8d6=readMetadataIfPresent(resolve(_0x21bb36,METADATA_FILE));if(_0x2df6b7[_0x1980f0(0x165)]===_0x1980f0(0x16d)&&(_0x19e8d6?.[_0x1980f0(0x163)]!==_0x2df6b7[_0x1980f0(0x163)]||_0x19e8d6[_0x1980f0(0x181)]!==_0x35309f))throw CliErrors['validation']('Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20'+_0x254920);return unlinkSync(_0x254920),symlinkSync(_0x4e5003,_0x254920,'dir'),{'path':_0x254920,'target':_0x4e5003,'action':'updated'};}return symlinkSync(_0x4e5003,_0x254920,_0x1980f0(0x167)),{'path':_0x254920,'target':_0x4e5003,'action':_0x1980f0(0x159)};}function managedTargetSkillLinkPaths(_0x42e37b,_0x153a2e){const _0xf61a85=a153_0x5c4f35;if(!existsSync(_0x42e37b))return[];const _0x14d167=_0x153a2e[_0xf61a85(0x163)]+'--';return readdirSync(_0x42e37b,{'withFileTypes':!![]})[_0xf61a85(0x15c)](_0x4462c1=>_0x153a2e[_0xf61a85(0x165)]===_0xf61a85(0x16d)||_0x4462c1[_0xf61a85(0x179)][_0xf61a85(0x151)](_0x14d167))[_0xf61a85(0x157)](_0x37539f=>resolve(_0x42e37b,_0x37539f[_0xf61a85(0x179)]));}function removeManagedSkillLink(_0x4e39f9,_0x2065f0,_0x29767e){const _0x124bf7=a153_0x5c4f35,_0x3af73f=lstatIfPresent(_0x4e39f9);if(!_0x3af73f?.[_0x124bf7(0x17c)]())return{'path':_0x4e39f9,'action':_0x124bf7(0x187),'reason':_0x124bf7(0x177)};const _0x12ce8b=resolveSymlinkTarget(_0x4e39f9);if(!isPathInside(realOrResolved(_0x12ce8b),realOrResolved(_0x2065f0['managedRoot'])))return{'path':_0x4e39f9,'action':_0x124bf7(0x187),'reason':_0x124bf7(0x152)};const _0x646c92=readMetadataIfPresent(resolve(_0x12ce8b,METADATA_FILE));if(_0x2065f0[_0x124bf7(0x165)]==='project'&&(_0x646c92?.[_0x124bf7(0x163)]!==_0x2065f0[_0x124bf7(0x163)]||_0x646c92[_0x124bf7(0x181)]!==_0x29767e))return{'path':_0x4e39f9,'action':'skipped','reason':_0x124bf7(0x180)};return unlinkSync(_0x4e39f9),{'path':_0x4e39f9,'action':'removed'};}function isLinkedFromAnyRoot(_0x2d60c2,_0x2ff361){const _0x5814d2=a153_0x5c4f35,_0x1ceb81=realOrResolved(_0x2d60c2);for(const _0x4a702b of _0x2ff361){if(!existsSync(_0x4a702b))continue;for(const _0x1950de of readdirSync(_0x4a702b,{'withFileTypes':!![]})){if(!_0x1950de[_0x5814d2(0x17c)]())continue;const _0x3db22a=resolve(_0x4a702b,_0x1950de[_0x5814d2(0x179)]);if(realOrResolved(resolveSymlinkTarget(_0x3db22a))===_0x1ceb81)return!![];}}return![];}function runtimeSkillLinkName(_0x2d83d3,_0xeb6da1){const _0x1ac70f=a153_0x5c4f35,_0x4f177f=safePathSegment(_0xeb6da1,_0x1ac70f(0x181));if(_0x2d83d3[_0x1ac70f(0x165)]===_0x1ac70f(0x16d)&&RESERVED_PROJECT_SKILL_CODES['has'](_0x4f177f))throw CliErrors[_0x1ac70f(0x189)](_0x1ac70f(0x153)+_0x4f177f);return _0x2d83d3['scope']===_0x1ac70f(0x16d)?_0x4f177f:_0x2d83d3[_0x1ac70f(0x163)]+'--'+_0x4f177f;}function runtimeSkillCodeFromLink(_0x24492a,_0x5e6660){const _0xa8976e=a153_0x5c4f35,_0x313d48=basename(_0x5e6660);return _0x24492a[_0xa8976e(0x165)]===_0xa8976e(0x16d)?_0x313d48:_0x313d48[_0xa8976e(0x150)]((_0x24492a['appCode']+'--')[_0xa8976e(0x16a)]);}export function copyManagedSkillDirectory(_0x4ffa54,_0x1a2fe0){const _0x52eb5e=a153_0x5c4f35,_0x9e1c4f=resolve(_0x1a2fe0,METADATA_FILE),_0x20b9ca=existsSync(_0x1a2fe0);if(_0x20b9ca){const _0x312827=lstatSync(_0x1a2fe0);if(_0x312827[_0x52eb5e(0x17c)]())throw CliErrors['validation'](_0x52eb5e(0x154)+_0x1a2fe0);if(!_0x312827['isDirectory']())throw CliErrors[_0x52eb5e(0x189)](_0x52eb5e(0x15d)+_0x1a2fe0);const _0x5ddd27=readMetadataIfPresent(_0x9e1c4f);if(_0x5ddd27?.[_0x52eb5e(0x165)]!==_0x52eb5e(0x16c))throw CliErrors[_0x52eb5e(0x189)]('Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20'+_0x1a2fe0);}ensureDirSync(dirname(_0x1a2fe0));const _0x4de112=_0x20b9ca?readMetadataIfPresent(_0x9e1c4f)?.[_0x52eb5e(0x175)]:undefined,_0x5e5bcf=readMetadataIfPresent(resolve(_0x4ffa54,METADATA_FILE))?.[_0x52eb5e(0x175)];return _0x20b9ca&&removeSync(_0x1a2fe0),copySkillDirectory(_0x4ffa54,_0x1a2fe0),{'path':_0x1a2fe0,'target':_0x4ffa54,'action':!_0x20b9ca?'created':_0x4de112===_0x5e5bcf?_0x52eb5e(0x178):_0x52eb5e(0x156)};}function copySkillDirectory(_0x2b5628,_0x1ae5b9){copySync(_0x2b5628,_0x1ae5b9,{'dereference':![],'overwrite':!![],'filter'(_0x340225){const _0x1d6510=a153_0xafb7;if(lstatSync(_0x340225)[_0x1d6510(0x17c)]())throw CliErrors[_0x1d6510(0x189)](_0x1d6510(0x161)+_0x340225);return!![];}});}
|
|
1
|
+
const a154_0x4f48b2=a154_0x2537;(function(_0x294322,_0x37f4b7){const _0x383e1a=a154_0x2537,_0x831736=_0x294322();while(!![]){try{const _0x5d9bb4=parseInt(_0x383e1a(0x139))/0x1+-parseInt(_0x383e1a(0x122))/0x2+-parseInt(_0x383e1a(0x141))/0x3*(-parseInt(_0x383e1a(0x129))/0x4)+-parseInt(_0x383e1a(0x137))/0x5+parseInt(_0x383e1a(0x13c))/0x6+-parseInt(_0x383e1a(0x145))/0x7+-parseInt(_0x383e1a(0x142))/0x8*(-parseInt(_0x383e1a(0x14d))/0x9);if(_0x5d9bb4===_0x37f4b7)break;else _0x831736['push'](_0x831736['shift']());}catch(_0x328d2e){_0x831736['push'](_0x831736['shift']());}}}(a154_0x1e8c,0x7ff24));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';function a154_0x1e8c(){const _0x2f2ace=['length','2169040ujymnG','isDirectory','970379ZmNtUt','validation','builtin','1537692XZDKoG','pruneSkillCodes','removed','created','personal','3OtzDDf','3694072NsUCIY','has','activeSkillCodes','1475264BNWGrv','env','filter','linked-from-protected-root','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20','metadataPath','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','managedRoot','9moUsPb','appCode','unchanged','runtime-observe','accessKey','name','updated','startsWith','skillCode','protectedLinkRoots','scope','get','metadata-mismatch','agentsSkillsDir','dir','1774738aEzPRz','trim','skipped','push','Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20','Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20','project','1470308dilFbG','Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20','set','contentHash','skill','Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20','map','skillRoots','values','not-managed-symlink','scopes','lovrabet','isSymbolicLink'];a154_0x1e8c=function(){return _0x2f2ace;};return a154_0x1e8c();}import a154_0x4074fc from'fs-extra';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';function a154_0x2537(_0x41392d,_0x138511){_0x41392d=_0x41392d-0x122;const _0x1e8c59=a154_0x1e8c();let _0x25372a=_0x1e8c59[_0x41392d];return _0x25372a;}import{isDanglingSymlink,isPathInside,lstatIfPresent,realOrResolved,resolveSymlinkTarget}from'./fs-utils.js';import{readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillCacheRoot,resolveSkillSyncPaths,safePathSegment}from'./paths.js';const {copySync,ensureDirSync,removeSync}=a154_0x4074fc,RESERVED_PROJECT_SKILL_CODES=new Set([a154_0x4f48b2(0x134),a154_0x4f48b2(0x150),'secret-retriever']);export function linkEffectiveRuntimeSkills(_0x3c429b,_0x1d1b0a){const _0x564e4e=a154_0x4f48b2,_0x323cd4=new Map();for(const _0x30b8a9 of _0x3c429b){const _0x580931=_0x30b8a9[_0x564e4e(0x12d)]['skillCode'];if(!_0x580931)continue;const _0x4dafb6=_0x323cd4[_0x564e4e(0x158)](_0x580931);(!_0x4dafb6||_0x30b8a9[_0x564e4e(0x157)]===_0x564e4e(0x140))&&_0x323cd4[_0x564e4e(0x12b)](_0x580931,_0x30b8a9);}const _0x1af2cf=[];for(const _0x3ad5b4 of _0x323cd4[_0x564e4e(0x131)]()){const _0x384034=requireSkillCode(_0x3ad5b4[_0x564e4e(0x12d)]),_0x42e09a=readMetadataIfPresent(_0x3ad5b4[_0x564e4e(0x14a)]);if(_0x42e09a?.[_0x564e4e(0x14e)]!==_0x1d1b0a[_0x564e4e(0x14e)]||_0x42e09a[_0x564e4e(0x155)]!==_0x384034)throw CliErrors[_0x564e4e(0x13a)](_0x564e4e(0x126)+_0x1d1b0a['appCode']+':\x20'+_0x3ad5b4[_0x564e4e(0x14a)]);const _0x2968a0=runtimeSkillLinkName(_0x1d1b0a,_0x384034);for(const _0x3f03f0 of _0x1d1b0a[_0x564e4e(0x130)]){_0x1af2cf[_0x564e4e(0x125)](ensureManagedSymlink(resolve(_0x3f03f0,_0x2968a0),_0x3ad5b4[_0x564e4e(0x15b)],_0x1d1b0a,_0x384034));}}return _0x1af2cf;}export function pruneStaleRuntimeSkillLinks(_0x3bb2bb,_0x8792ae,_0x17708b){const _0x585c18=a154_0x4f48b2,_0x44f0c2=new Set([..._0x8792ae][_0x585c18(0x12f)](_0x296b8c=>_0x296b8c[_0x585c18(0x123)]())[_0x585c18(0x147)](Boolean)),_0x38b333=_0x17708b?new Set([..._0x17708b][_0x585c18(0x12f)](_0x20d19a=>_0x20d19a[_0x585c18(0x123)]())[_0x585c18(0x147)](Boolean)):undefined,_0x5dff34=[];for(const _0x553cf6 of _0x3bb2bb['skillRoots']){for(const _0x10b27a of managedTargetSkillLinkPaths(_0x553cf6,_0x3bb2bb)){const _0x4d45a1=runtimeSkillCodeFromLink(_0x3bb2bb,_0x10b27a);if(_0x38b333&&!_0x38b333['has'](_0x4d45a1))continue;if(_0x44f0c2[_0x585c18(0x143)](_0x4d45a1))continue;_0x5dff34[_0x585c18(0x125)](removeManagedSkillLink(_0x10b27a,_0x3bb2bb,_0x4d45a1));}}return _0x5dff34;}export function pruneStaleRuntimeSkillCache(_0x54c9ef,_0x2adaac={}){const _0x462dc5=a154_0x4f48b2,_0x1a149e=new Set([..._0x54c9ef[_0x462dc5(0x144)]][_0x462dc5(0x12f)](_0x960c26=>_0x960c26[_0x462dc5(0x123)]())[_0x462dc5(0x147)](Boolean)),_0x993b78=_0x54c9ef[_0x462dc5(0x13d)]?new Set([..._0x54c9ef[_0x462dc5(0x13d)]][_0x462dc5(0x12f)](_0x23d701=>_0x23d701['trim']())[_0x462dc5(0x147)](Boolean)):undefined,_0x5c8d3e=_0x54c9ef[_0x462dc5(0x133)]??['personal','company'],_0x2642f2=resolve(getRuntimeSkillCacheRoot(_0x54c9ef[_0x462dc5(0x146)],_0x54c9ef[_0x462dc5(0x151)],_0x2adaac),safePathSegment(_0x54c9ef[_0x462dc5(0x14e)],_0x462dc5(0x14e))),_0x375534=[];for(const _0x535567 of _0x5c8d3e){const _0x3e53d5=resolve(_0x2642f2,_0x535567);if(!existsSync(_0x3e53d5))continue;for(const _0x520055 of readdirSync(_0x3e53d5,{'withFileTypes':!![]})){if(!_0x520055[_0x462dc5(0x138)]())continue;const _0x43687a=_0x520055[_0x462dc5(0x152)];if(_0x993b78&&!_0x993b78['has'](_0x43687a))continue;if(_0x1a149e[_0x462dc5(0x143)](_0x43687a))continue;const _0x56cc65=resolve(_0x3e53d5,_0x43687a),_0x5d8ca0=readMetadataIfPresent(resolve(_0x56cc65,METADATA_FILE));if(_0x5d8ca0?.[_0x462dc5(0x14e)]!==_0x54c9ef['appCode']||_0x5d8ca0[_0x462dc5(0x157)]!==_0x535567||_0x5d8ca0[_0x462dc5(0x155)]!==_0x43687a){_0x375534[_0x462dc5(0x125)]({'path':_0x56cc65,'action':_0x462dc5(0x124),'reason':_0x462dc5(0x159)});continue;}if(isLinkedFromAnyRoot(_0x56cc65,_0x54c9ef[_0x462dc5(0x156)]??[])){_0x375534[_0x462dc5(0x125)]({'path':_0x56cc65,'action':_0x462dc5(0x124),'reason':_0x462dc5(0x148)});continue;}removeSync(_0x56cc65),_0x375534['push']({'path':_0x56cc65,'action':_0x462dc5(0x13e)});}}return _0x375534;}export function linkGlobalRuntimeSkills(_0xb14023,_0x17b8f0={}){const _0x521f26=a154_0x4f48b2,_0x3c3ed5=resolveSkillSyncPaths(_0x17b8f0),_0x26b180=[];for(const _0x412460 of _0xb14023){if(_0x412460[_0x521f26(0x157)]!==_0x521f26(0x13b))throw CliErrors['validation'](_0x521f26(0x14b)+_0x412460[_0x521f26(0x157)]);const _0x3ea320=requireSkillCode(_0x412460['skill']),_0x4537d1=copyManagedSkillDirectory(_0x412460['dir'],resolve(_0x3c3ed5[_0x521f26(0x15a)],_0x3ea320));_0x26b180[_0x521f26(0x125)]({..._0x4537d1,'contentHash':_0x412460['contentHash']});}return _0x26b180;}function ensureManagedSymlink(_0x29be1a,_0x1cc73e,_0x2cf0d1,_0xbd05b7){const _0x1b6ab9=a154_0x4f48b2;mkdirSync(dirname(_0x29be1a),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x29be1a)||isDanglingSymlink(_0x29be1a)){const _0x15c654=lstatSync(_0x29be1a);if(!_0x15c654['isSymbolicLink']())throw CliErrors[_0x1b6ab9(0x13a)]('Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20'+_0x29be1a);const _0xdc1632=resolveSymlinkTarget(_0x29be1a);if(!isPathInside(realOrResolved(_0xdc1632),realOrResolved(_0x2cf0d1[_0x1b6ab9(0x14c)])))throw CliErrors[_0x1b6ab9(0x13a)](_0x1b6ab9(0x127)+_0x29be1a);if(realOrResolved(_0xdc1632)===realOrResolved(_0x1cc73e))return{'path':_0x29be1a,'target':_0x1cc73e,'action':_0x1b6ab9(0x14f)};const _0x2f9fd9=readMetadataIfPresent(resolve(_0xdc1632,METADATA_FILE));if(_0x2cf0d1[_0x1b6ab9(0x157)]===_0x1b6ab9(0x128)&&(_0x2f9fd9?.[_0x1b6ab9(0x14e)]!==_0x2cf0d1[_0x1b6ab9(0x14e)]||_0x2f9fd9[_0x1b6ab9(0x155)]!==_0xbd05b7))throw CliErrors['validation']('Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20'+_0x29be1a);return unlinkSync(_0x29be1a),symlinkSync(_0x1cc73e,_0x29be1a,_0x1b6ab9(0x15b)),{'path':_0x29be1a,'target':_0x1cc73e,'action':_0x1b6ab9(0x153)};}return symlinkSync(_0x1cc73e,_0x29be1a,_0x1b6ab9(0x15b)),{'path':_0x29be1a,'target':_0x1cc73e,'action':_0x1b6ab9(0x13f)};}function managedTargetSkillLinkPaths(_0x45e084,_0x3f4ca8){const _0xf3b102=a154_0x4f48b2;if(!existsSync(_0x45e084))return[];const _0x19abd1=_0x3f4ca8[_0xf3b102(0x14e)]+'--';return readdirSync(_0x45e084,{'withFileTypes':!![]})[_0xf3b102(0x147)](_0x40b1c8=>_0x3f4ca8['scope']==='project'||_0x40b1c8[_0xf3b102(0x152)][_0xf3b102(0x154)](_0x19abd1))[_0xf3b102(0x12f)](_0x393272=>resolve(_0x45e084,_0x393272[_0xf3b102(0x152)]));}function removeManagedSkillLink(_0x128796,_0x1ab515,_0x87549c){const _0x160981=a154_0x4f48b2,_0x14f7a8=lstatIfPresent(_0x128796);if(!_0x14f7a8?.[_0x160981(0x135)]())return{'path':_0x128796,'action':_0x160981(0x124),'reason':_0x160981(0x132)};const _0x3a651c=resolveSymlinkTarget(_0x128796);if(!isPathInside(realOrResolved(_0x3a651c),realOrResolved(_0x1ab515[_0x160981(0x14c)])))return{'path':_0x128796,'action':_0x160981(0x124),'reason':'external-symlink'};const _0x5f02fa=readMetadataIfPresent(resolve(_0x3a651c,METADATA_FILE));if(_0x1ab515[_0x160981(0x157)]===_0x160981(0x128)&&(_0x5f02fa?.['appCode']!==_0x1ab515[_0x160981(0x14e)]||_0x5f02fa[_0x160981(0x155)]!==_0x87549c))return{'path':_0x128796,'action':'skipped','reason':_0x160981(0x159)};return unlinkSync(_0x128796),{'path':_0x128796,'action':_0x160981(0x13e)};}function isLinkedFromAnyRoot(_0x560a22,_0x45b0d1){const _0xa90981=a154_0x4f48b2,_0x3203e3=realOrResolved(_0x560a22);for(const _0x2c2758 of _0x45b0d1){if(!existsSync(_0x2c2758))continue;for(const _0x41db32 of readdirSync(_0x2c2758,{'withFileTypes':!![]})){if(!_0x41db32[_0xa90981(0x135)]())continue;const _0x4e441f=resolve(_0x2c2758,_0x41db32['name']);if(realOrResolved(resolveSymlinkTarget(_0x4e441f))===_0x3203e3)return!![];}}return![];}function runtimeSkillLinkName(_0x6697ed,_0x4b4bda){const _0x2f507d=a154_0x4f48b2,_0x5f53fa=safePathSegment(_0x4b4bda,_0x2f507d(0x155));if(_0x6697ed['scope']===_0x2f507d(0x128)&&RESERVED_PROJECT_SKILL_CODES[_0x2f507d(0x143)](_0x5f53fa))throw CliErrors[_0x2f507d(0x13a)]('Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20'+_0x5f53fa);return _0x6697ed[_0x2f507d(0x157)]===_0x2f507d(0x128)?_0x5f53fa:_0x6697ed['appCode']+'--'+_0x5f53fa;}function runtimeSkillCodeFromLink(_0x4ec1a0,_0x2b8f01){const _0x5ca20c=a154_0x4f48b2,_0x174761=basename(_0x2b8f01);return _0x4ec1a0[_0x5ca20c(0x157)]===_0x5ca20c(0x128)?_0x174761:_0x174761['slice']((_0x4ec1a0['appCode']+'--')[_0x5ca20c(0x136)]);}export function copyManagedSkillDirectory(_0x27b0d,_0x218e26){const _0x44f47a=a154_0x4f48b2,_0xd7cb5c=resolve(_0x218e26,METADATA_FILE),_0x1b5618=existsSync(_0x218e26);if(_0x1b5618){const _0x4d6bcc=lstatSync(_0x218e26);if(_0x4d6bcc[_0x44f47a(0x135)]())throw CliErrors[_0x44f47a(0x13a)](_0x44f47a(0x12e)+_0x218e26);if(!_0x4d6bcc['isDirectory']())throw CliErrors[_0x44f47a(0x13a)](_0x44f47a(0x12a)+_0x218e26);const _0x5f00e1=readMetadataIfPresent(_0xd7cb5c);if(_0x5f00e1?.[_0x44f47a(0x157)]!=='builtin')throw CliErrors[_0x44f47a(0x13a)](_0x44f47a(0x149)+_0x218e26);}ensureDirSync(dirname(_0x218e26));const _0x388c9b=_0x1b5618?readMetadataIfPresent(_0xd7cb5c)?.[_0x44f47a(0x12c)]:undefined,_0x29f13d=readMetadataIfPresent(resolve(_0x27b0d,METADATA_FILE))?.['contentHash'];return _0x1b5618&&removeSync(_0x218e26),copySkillDirectory(_0x27b0d,_0x218e26),{'path':_0x218e26,'target':_0x27b0d,'action':!_0x1b5618?_0x44f47a(0x13f):_0x388c9b===_0x29f13d?'unchanged':'updated'};}function copySkillDirectory(_0x1f3774,_0x42dfb4){copySync(_0x1f3774,_0x42dfb4,{'dereference':![],'overwrite':!![],'filter'(_0xfe6ec8){const _0x145cad=a154_0x2537;if(lstatSync(_0xfe6ec8)[_0x145cad(0x135)]())throw CliErrors[_0x145cad(0x13a)]('Refusing\x20to\x20copy\x20Skill\x20symlink:\x20'+_0xfe6ec8);return!![];}});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x8f5cce,_0x39fc75){const _0x297e1b=a155_0x546d,_0x11aafe=_0x8f5cce();while(!![]){try{const _0x330618=parseInt(_0x297e1b(0x14e))/0x1+-parseInt(_0x297e1b(0x150))/0x2*(parseInt(_0x297e1b(0x165))/0x3)+-parseInt(_0x297e1b(0x160))/0x4+-parseInt(_0x297e1b(0x157))/0x5*(-parseInt(_0x297e1b(0x146))/0x6)+parseInt(_0x297e1b(0x154))/0x7*(parseInt(_0x297e1b(0x14a))/0x8)+parseInt(_0x297e1b(0x142))/0x9*(-parseInt(_0x297e1b(0x13c))/0xa)+parseInt(_0x297e1b(0x15f))/0xb*(parseInt(_0x297e1b(0x164))/0xc);if(_0x330618===_0x39fc75)break;else _0x11aafe['push'](_0x11aafe['shift']());}catch(_0x4e57a9){_0x11aafe['push'](_0x11aafe['shift']());}}}(a155_0x3921,0x5755b));import{existsSync,readdirSync}from'node:fs';import{resolve}from'node:path';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 a155_0x546d(_0x105289,_0x3a74e2){_0x105289=_0x105289-0x13a;const _0x392188=a155_0x3921();let _0x546dd3=_0x392188[_0x105289];return _0x546dd3;}import{isRuntimeSkillScope,normalizeRuntimeSkillScopes}from'./scopes.js';export function listLocalRuntimeSkills(_0x4f3329,_0x19eba0,_0x25ad8a={}){const _0x50bf2e=a155_0x546d,_0x432e1a=safePathSegment(_0x4f3329['appCode'],_0x50bf2e(0x153));if(_0x19eba0[_0x50bf2e(0x153)]!==_0x432e1a)throw CliErrors[_0x50bf2e(0x14c)](_0x50bf2e(0x15d)+_0x19eba0[_0x50bf2e(0x153)]+'\x20!=\x20'+_0x432e1a);const _0x1cafc3=normalizeRuntimeSkillScopes(_0x4f3329[_0x50bf2e(0x152)]),_0x34cc68=new Set(_0x1cafc3),_0xe650f9=_0x4f3329[_0x50bf2e(0x156)]?.['trim'](),_0x184787=new Map(),_0x5b83be=resolve(getRuntimeSkillCacheRoot(_0x4f3329[_0x50bf2e(0x162)],_0x4f3329[_0x50bf2e(0x13a)],_0x25ad8a),_0x432e1a);for(const _0x1dbec3 of _0x1cafc3){for(const _0x1cdbd3 of localSkillEntryDirs(resolve(_0x5b83be,_0x1dbec3))){collectLocalRuntimeSkill(_0x184787,_0x1cdbd3,{'appCode':_0x432e1a,'scopes':_0x34cc68,'code':_0xe650f9,'source':'cache'});}}for(const _0x429bfd of _0x19eba0['skillRoots']){for(const _0x4fe50c of localSkillLinkCandidates(_0x429bfd,_0x19eba0,_0x34cc68)){collectLocalRuntimeSkill(_0x184787,_0x4fe50c,{'appCode':_0x432e1a,'scopes':_0x34cc68,'code':_0xe650f9,'source':'link','linkedPath':_0x4fe50c});}}return Array[_0x50bf2e(0x148)](_0x184787['values']())[_0x50bf2e(0x15b)](compareLocalRuntimeSkills);}function localSkillEntryDirs(_0x247b24){const _0x650f30=a155_0x546d;if(!existsSync(_0x247b24))return[];return readdirSync(_0x247b24,{'withFileTypes':!![]})[_0x650f30(0x13d)](_0x439c66=>_0x439c66[_0x650f30(0x13f)]()||_0x439c66[_0x650f30(0x159)]())[_0x650f30(0x15e)](_0x54f19a=>resolve(_0x247b24,_0x54f19a[_0x650f30(0x151)]));}function localSkillLinkCandidates(_0x394913,_0x557b2b,_0x1f0c6f){const _0x3ff691=a155_0x546d;if(!existsSync(_0x394913))return[];const _0x5f1bf9=_0x557b2b[_0x3ff691(0x153)]+'--';return readdirSync(_0x394913,{'withFileTypes':!![]})['filter'](_0x258a8f=>_0x258a8f[_0x3ff691(0x13f)]()||_0x258a8f[_0x3ff691(0x159)]())[_0x3ff691(0x13d)](_0x164725=>_0x557b2b[_0x3ff691(0x149)]===_0x3ff691(0x140)||_0x164725[_0x3ff691(0x151)]['startsWith'](_0x5f1bf9)||_0x1f0c6f['has'](_0x3ff691(0x141)))[_0x3ff691(0x15e)](_0x513d7d=>resolve(_0x394913,_0x513d7d[_0x3ff691(0x151)]));}function a155_0x3921(){const _0xdb4777=['trim','2938HAihbp','name','scopes','appCode','913157xOuyBR','has','code','605gKdLgz','cache','isSymbolicLink','tags','sort','metadataPath','Runtime\x20Skill\x20install\x20target\x20app\x20mismatch:\x20','map','11SDtcMI','1556668nArLwd','skillCode','env','get','6594096EMuTUp','201DGlRxp','source','accessKey','localeCompare','60UDtMdj','filter','linkedPaths','isDirectory','project','builtin','507933HCqxYt','linkedPath','set','skillMdPath','2478CQkmEV','isArray','from','scope','8duZSnC','dir','validation','push','454003qssKMz'];a155_0x3921=function(){return _0xdb4777;};return a155_0x3921();}function collectLocalRuntimeSkill(_0x47827a,_0x10c619,_0x481075){const _0x262a6d=a155_0x546d,_0x5246b6=resolve(_0x10c619,METADATA_FILE),_0x318909=readMetadataIfPresent(_0x5246b6);if(!_0x318909)return;if(_0x318909['appCode']!==_0x481075[_0x262a6d(0x153)])return;if(!isRuntimeSkillScope(_0x318909[_0x262a6d(0x149)])||!_0x481075[_0x262a6d(0x152)][_0x262a6d(0x155)](_0x318909[_0x262a6d(0x149)]))return;const _0x1823f3=_0x318909[_0x262a6d(0x161)]?.[_0x262a6d(0x14f)]();if(!_0x1823f3)return;if(_0x481075[_0x262a6d(0x156)]&&_0x1823f3!==_0x481075[_0x262a6d(0x156)])return;const _0x200367=_0x318909[_0x262a6d(0x149)]+':'+_0x1823f3,_0xb30287=_0x481075[_0x262a6d(0x143)]?[_0x481075[_0x262a6d(0x143)]]:[],_0x1509c4=_0x47827a[_0x262a6d(0x163)](_0x200367);if(_0x1509c4){_0x481075[_0x262a6d(0x166)]===_0x262a6d(0x158)&&(_0x1509c4[_0x262a6d(0x14b)]=_0x10c619,_0x1509c4['cacheDir']=_0x10c619,_0x1509c4[_0x262a6d(0x145)]=resolve(_0x10c619,SKILL_FILE),_0x1509c4[_0x262a6d(0x15c)]=_0x5246b6);for(const _0x389481 of _0xb30287){!_0x1509c4['linkedPaths']['includes'](_0x389481)&&_0x1509c4[_0x262a6d(0x13e)][_0x262a6d(0x14d)](_0x389481);}_0x1509c4[_0x262a6d(0x13e)][_0x262a6d(0x15b)]();return;}_0x47827a[_0x262a6d(0x144)](_0x200367,{..._0x318909,'tags':Array[_0x262a6d(0x147)](_0x318909[_0x262a6d(0x15a)])?_0x318909[_0x262a6d(0x15a)]:[],'scope':_0x318909[_0x262a6d(0x149)],'source':'local','dir':_0x10c619,'cacheDir':_0x481075[_0x262a6d(0x166)]===_0x262a6d(0x158)?_0x10c619:undefined,'skillMdPath':resolve(_0x10c619,SKILL_FILE),'metadataPath':_0x5246b6,'linkedPaths':_0xb30287});}function compareLocalRuntimeSkills(_0x1ca03f,_0x3e5bcd){const _0x1a0d1b=a155_0x546d,_0x102afa={'personal':0x0,'company':0x1,'builtin':0x2};return _0x102afa[_0x1ca03f[_0x1a0d1b(0x149)]]-_0x102afa[_0x3e5bcd[_0x1a0d1b(0x149)]]||_0x1ca03f[_0x1a0d1b(0x161)][_0x1a0d1b(0x13b)](_0x3e5bcd['skillCode'])||_0x1ca03f[_0x1a0d1b(0x14b)][_0x1a0d1b(0x13b)](_0x3e5bcd['dir']);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a156_0x5b04(){const _0x3881e1=['add','92thOjOe','Duplicate\x20Skill\x20file\x20path:\x20','44355yEEKta','values','has','Skill\x20file\x20path\x20must\x20be\x20text.','Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20','path','Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20','utf8','Skill\x20file\x20size\x20is\x20invalid:\x20','91666IvInxT','string','21790PREVUB','validation','startsWith','isDirectory','isFile','test','Unsafe\x20Skill\x20file\x20path:\x20','split','content','size','toLowerCase','22QCHNJv','4525002bxwQEW','trim','bytes','6602776vrurZe','localeCompare','4107510RhArCP','compare','isSafeInteger','replace','push','set','Skill\x20file\x20sha256\x20is\x20invalid:\x20','isSymbolicLink','sha256','length','12JMwRxG','20284kdsdaI','isArray','from','2156315klerAM','object','sort','name'];a156_0x5b04=function(){return _0x3881e1;};return a156_0x5b04();}(function(_0x15208c,_0xacaef){const _0x3b1bc6=a156_0x2e26,_0x3a84e0=_0x15208c();while(!![]){try{const _0x22ca14=parseInt(_0x3b1bc6(0x1b9))/0x1*(-parseInt(_0x3b1bc6(0x1ac))/0x2)+-parseInt(_0x3b1bc6(0x1d4))/0x3*(-parseInt(_0x3b1bc6(0x1d2))/0x4)+-parseInt(_0x3b1bc6(0x1bf))/0x5+parseInt(_0x3b1bc6(0x1c9))/0x6*(-parseInt(_0x3b1bc6(0x1cd))/0x7)+-parseInt(_0x3b1bc6(0x1bd))/0x8+-parseInt(_0x3b1bc6(0x1ba))/0x9+-parseInt(_0x3b1bc6(0x1ae))/0xa*(-parseInt(_0x3b1bc6(0x1ca))/0xb);if(_0x22ca14===_0xacaef)break;else _0x3a84e0['push'](_0x3a84e0['shift']());}catch(_0x500e3c){_0x3a84e0['push'](_0x3a84e0['shift']());}}}(a156_0x5b04,0x8e998));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(_0x23b4d6){const _0x42de7a=a156_0x2e26;return _0x23b4d6[_0x42de7a(0x1bc)]??Buffer[_0x42de7a(0x1cc)](_0x23b4d6[_0x42de7a(0x1b6)]??'',_0x42de7a(0x1aa));}export function fileText(_0x2d9561){const _0x421549=a156_0x2e26;return fileContent(_0x2d9561)['toString'](_0x421549(0x1aa));}export function normalizeLocalFiles(_0x3f0903){const _0x465f01=a156_0x2e26;if(!Array[_0x465f01(0x1cb)](_0x3f0903)||_0x3f0903['length']===0x0)return[];const _0x5c566c=new Map();for(const _0x3072b7 of _0x3f0903){if(!_0x3072b7||typeof _0x3072b7!==_0x465f01(0x1ce)||typeof _0x3072b7[_0x465f01(0x1a8)]!==_0x465f01(0x1ad))throw CliErrors['validation']('Skill\x20file\x20path\x20must\x20be\x20text.');const _0x3600ab=normalizeSkillRelativePath(_0x3072b7[_0x465f01(0x1a8)]);if(_0x5c566c[_0x465f01(0x1a5)](_0x3600ab))throw CliErrors['validation'](_0x465f01(0x1d3)+_0x3600ab);if(_0x3072b7[_0x465f01(0x1bc)]!==undefined&&!Buffer['isBuffer'](_0x3072b7[_0x465f01(0x1bc)]))throw CliErrors[_0x465f01(0x1af)]('Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20'+_0x3600ab);if(_0x3072b7[_0x465f01(0x1bc)]===undefined&&typeof _0x3072b7[_0x465f01(0x1b6)]!==_0x465f01(0x1ad))throw CliErrors['validation'](_0x465f01(0x1a9)+_0x3600ab);const _0x31d17a=fileContent(_0x3072b7);_0x5c566c[_0x465f01(0x1c4)](_0x3600ab,{'path':_0x3600ab,'bytes':_0x31d17a});}return Array[_0x465f01(0x1cc)](_0x5c566c[_0x465f01(0x1d5)]())[_0x465f01(0x1cf)](compareSkillFiles);}export function normalizeManifestFiles(_0x11d0fa){const _0x1d4c97=a156_0x2e26;if(!Array[_0x1d4c97(0x1cb)](_0x11d0fa)||_0x11d0fa[_0x1d4c97(0x1c8)]===0x0)return[];const _0x392c13=new Map();for(const _0xec5c89 of _0x11d0fa){if(!_0xec5c89||typeof _0xec5c89!==_0x1d4c97(0x1ce)||typeof _0xec5c89['path']!==_0x1d4c97(0x1ad))throw CliErrors['validation'](_0x1d4c97(0x1a6));const _0x11eba1=normalizeSkillRelativePath(_0xec5c89[_0x1d4c97(0x1a8)]);if(_0x392c13[_0x1d4c97(0x1a5)](_0x11eba1))throw CliErrors['validation'](_0x1d4c97(0x1d3)+_0x11eba1);if(!isSha256Hex(_0xec5c89[_0x1d4c97(0x1c7)]))throw CliErrors[_0x1d4c97(0x1af)](_0x1d4c97(0x1c5)+_0x11eba1);if(!Number[_0x1d4c97(0x1c1)](_0xec5c89[_0x1d4c97(0x1b7)])||_0xec5c89[_0x1d4c97(0x1b7)]<0x0)throw CliErrors['validation'](_0x1d4c97(0x1ab)+_0x11eba1);_0x392c13[_0x1d4c97(0x1c4)](_0x11eba1,{'path':_0x11eba1,'sha256':_0xec5c89['sha256'][_0x1d4c97(0x1b8)](),'size':_0xec5c89[_0x1d4c97(0x1b7)]});}return Array[_0x1d4c97(0x1cc)](_0x392c13[_0x1d4c97(0x1d5)]())[_0x1d4c97(0x1cf)](compareSkillFiles);}export function scanSkillDirectory(_0x166bd2,_0x1b0a8b={}){const _0x5c9a09=realpathSync(_0x166bd2),_0x24ce19=canonicalExcludedFilePaths(_0x1b0a8b['excludedFilePaths']),_0x3903ca=[];function _0x47e955(_0x194967){const _0x1376e8=a156_0x2e26,_0x3bce59=readdirSync(_0x194967,{'withFileTypes':!![]})[_0x1376e8(0x1cf)]((_0x56eec6,_0x51b64b)=>_0x56eec6[_0x1376e8(0x1d0)][_0x1376e8(0x1be)](_0x51b64b[_0x1376e8(0x1d0)]));for(const _0x958a96 of _0x3bce59){if(_0x958a96[_0x1376e8(0x1b1)]()&&IGNORED_DIR_NAMES[_0x1376e8(0x1a5)](_0x958a96[_0x1376e8(0x1d0)]))continue;if(IGNORED_FILE_NAMES['has'](_0x958a96[_0x1376e8(0x1d0)]))continue;const _0x5ea343=resolve(_0x194967,_0x958a96[_0x1376e8(0x1d0)]);if(isExcludedFilePath(_0x5ea343,_0x24ce19))continue;if(_0x958a96[_0x1376e8(0x1c6)]())throw CliErrors[_0x1376e8(0x1af)](_0x1376e8(0x1a7)+_0x5ea343);const _0x562d27=toPosixPath(relative(_0x5c9a09,_0x5ea343));if(_0x958a96[_0x1376e8(0x1b1)]()){_0x47e955(_0x5ea343);continue;}if(!_0x958a96[_0x1376e8(0x1b2)]())continue;validateSkillRelativePath(_0x562d27);const _0xa4b735=readFileSync(_0x5ea343);_0x3903ca[_0x1376e8(0x1c3)]({'path':_0x562d27,'bytes':_0xa4b735});}}return _0x47e955(_0x5c9a09),normalizeLocalFiles(_0x3903ca);}function canonicalExcludedFilePaths(_0x9f7057){const _0x52b9d4=a156_0x2e26,_0x4820f5=new Set();for(const _0x4fae0c of _0x9f7057??[]){const _0x5e934b=resolve(_0x4fae0c);_0x4820f5[_0x52b9d4(0x1d1)](_0x5e934b);try{_0x4820f5['add'](realpathSync(_0x5e934b));}catch{}}return _0x4820f5;}function isExcludedFilePath(_0x187417,_0x1aedf5){const _0x567122=a156_0x2e26;if(_0x1aedf5[_0x567122(0x1a5)](_0x187417))return!![];if(_0x1aedf5[_0x567122(0x1b7)]===0x0)return![];try{return _0x1aedf5[_0x567122(0x1a5)](realpathSync(_0x187417));}catch{return![];}}function a156_0x2e26(_0x5e495d,_0x2cd941){_0x5e495d=_0x5e495d-0x1a5;const _0x5b041f=a156_0x5b04();let _0x2e2683=_0x5b041f[_0x5e495d];return _0x2e2683;}export function compareSkillFiles(_0x3eda97,_0x3d5008){const _0x48f2be=a156_0x2e26;if(_0x3eda97[_0x48f2be(0x1a8)]===SKILL_FILE)return _0x3d5008['path']===SKILL_FILE?0x0:-0x1;if(_0x3d5008[_0x48f2be(0x1a8)]===SKILL_FILE)return 0x1;return Buffer[_0x48f2be(0x1c0)](Buffer['from'](_0x3eda97[_0x48f2be(0x1a8)],_0x48f2be(0x1aa)),Buffer[_0x48f2be(0x1cc)](_0x3d5008['path'],'utf8'));}export function normalizeSkillRelativePath(_0x11af39){const _0xbd7ee4=a156_0x2e26,_0x42054b=toPosixPath(_0x11af39[_0xbd7ee4(0x1bb)]());return validateSkillRelativePath(_0x42054b),_0x42054b;}export function validateSkillRelativePath(_0x2de128){const _0x1577cc=a156_0x2e26;if(!_0x2de128||_0x2de128[_0x1577cc(0x1b0)]('/')||_0x2de128['includes']('//'))throw CliErrors[_0x1577cc(0x1af)](_0x1577cc(0x1b4)+_0x2de128);for(const _0x57edb0 of _0x2de128[_0x1577cc(0x1b5)]('/')){if(!_0x57edb0||_0x57edb0==='.'||_0x57edb0==='..')throw CliErrors['validation'](_0x1577cc(0x1b4)+_0x2de128);}}export function toPosixPath(_0x2e7966){const _0x1e55d1=a156_0x2e26;return _0x2e7966[_0x1e55d1(0x1c2)](/\\/g,'/');}export function isSha256Hex(_0x731ff3){const _0x1a9ce3=a156_0x2e26;return typeof _0x731ff3===_0x1a9ce3(0x1ad)&&/^[a-fA-F0-9]{64}$/[_0x1a9ce3(0x1b3)](_0x731ff3);}
|
|
@@ -1 +1 @@
|
|
|
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
|
+
(function(_0x13fe32,_0x464234){const _0xfced55=a157_0x482f,_0x19818b=_0x13fe32();while(!![]){try{const _0x2b2c27=-parseInt(_0xfced55(0x97))/0x1+parseInt(_0xfced55(0xa0))/0x2+-parseInt(_0xfced55(0x79))/0x3+parseInt(_0xfced55(0x7f))/0x4+parseInt(_0xfced55(0x8e))/0x5*(parseInt(_0xfced55(0x88))/0x6)+parseInt(_0xfced55(0xa7))/0x7*(-parseInt(_0xfced55(0xa2))/0x8)+parseInt(_0xfced55(0x8a))/0x9*(parseInt(_0xfced55(0x96))/0xa);if(_0x2b2c27===_0x464234)break;else _0x19818b['push'](_0x19818b['shift']());}catch(_0xfbe954){_0x19818b['push'](_0x19818b['shift']());}}}(a157_0x29bd,0x57eba));import{existsSync,lstatSync,mkdirSync,readFileSync,rmSync}from'node:fs';import{dirname,resolve}from'node:path';import{isCollection,isMap,isNode,parseDocument,visit}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{resolveManagedFilePath,writeBytesAtomic,writeJsonAtomic}from'./fs-utils.js';function a157_0x482f(_0x5abea9,_0x3ac3c3){_0x5abea9=_0x5abea9-0x72;const _0x29bdf1=a157_0x29bd();let _0x482fde=_0x29bdf1[_0x5abea9];return _0x482fde;}import{bufferSha256,contentHash,fileHash}from'./hashing.js';import{fileContent,fileText,normalizeLocalFiles}from'./local-files.js';import{buildMetadata,readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillDir}from'./paths.js';import{extractDownloadedPackage,requirePackageBytes}from'./zip-package.js';function a157_0x29bd(){const _0x23ac5c=['displayName','936XvTPcz','map','trim','displayName:\x20','schemaVersion','28007woEAkX','has','flow','.\x20Changed\x20file:\x20','skillCode','paths','validation','description','hasOwn','trimEnd','contents','path','1781907sSIetc','set','toString','appCode','length','name','2488640BdSHOb','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','description:\x20','Runtime\x20Skill\x20package\x20is\x20missing\x20','delete','contentHash','isFile','utf8','1051692LxapkI','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','9fvWggq','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','\x0a---\x0a\x0a','skillName','5EzkUqS','env','errors','keys','packageBytes','filter','find','join','6266710hPRxyL','585215iKmRHI','version','example','pulledAt','scope','fileHashes','status','entries','---','1166620ASBMPI'];a157_0x29bd=function(){return _0x23ac5c;};return a157_0x29bd();}export function materializeRuntimeSkill(_0x580078,_0x816b62,_0x45a53c){const _0x3f9d80=a157_0x482f,_0x417c72=requireSkillCode(_0x580078),_0x26515e=requirePackageBytes(_0x417c72,_0x45a53c[_0x3f9d80(0x92)]),_0x400325=extractDownloadedPackage(_0x26515e),_0x1f8f60=_0x400325[_0x3f9d80(0x94)](_0x270160=>_0x270160[_0x3f9d80(0x78)]===SKILL_FILE);if(!_0x1f8f60)throw CliErrors[_0x3f9d80(0x73)](_0x3f9d80(0x83)+SKILL_FILE+':\x20'+_0x417c72);const _0x7eb0e=withMaterializedSkillFrontmatter(_0x400325,_0x580078,_0x417c72),_0x20aace=_0x7eb0e['find'](_0x467889=>_0x467889[_0x3f9d80(0x78)]===SKILL_FILE),_0x385682=fileText(_0x20aace),_0x10a959=getRuntimeSkillDir(_0x45a53c[_0x3f9d80(0x8f)],_0x45a53c['accessKey'],_0x45a53c['appCode'],_0x816b62,_0x417c72,_0x45a53c['paths']),_0x43f324=resolve(_0x10a959,SKILL_FILE),_0x56a550=resolve(_0x10a959,METADATA_FILE),_0xfd98e6=contentHash(_0x385682),_0x32f1e7=readMetadataIfPresent(_0x56a550)?.[_0x3f9d80(0x9c)];ensurePulledFilesCanBeOverwritten(_0x10a959,_0x56a550,_0x7eb0e,_0x45a53c['force']===!![]),mkdirSync(_0x10a959,{'recursive':!![],'mode':0x1c0});const _0x3f10c=existsSync(_0x43f324)?readFileSync(_0x43f324,_0x3f9d80(0x87)):undefined;return materializeFiles(_0x10a959,_0x7eb0e),removeStaleManagedFiles(_0x10a959,_0x32f1e7,_0x7eb0e),writeJsonAtomic(_0x56a550,buildMetadata(_0x580078,_0x816b62,_0x45a53c[_0x3f9d80(0x7c)],_0xfd98e6,_0x45a53c[_0x3f9d80(0x9a)],_0x7eb0e,_0x26515e)),{'skill':_0x580078,'scope':_0x816b62,'dir':_0x10a959,'skillMdPath':_0x43f324,'metadataPath':_0x56a550,'contentHash':_0xfd98e6,'changed':_0x3f10c!==_0x385682};}export function reuseMaterializedRuntimeSkill(_0x2635d2,_0x383221,_0x5561b6){const _0x1ed846=a157_0x482f,_0x1dbc8d=_0x2635d2[_0x1ed846(0x98)]?.[_0x1ed846(0xa4)]();if(!_0x1dbc8d)return undefined;const _0x24c9f0=requireSkillCode(_0x2635d2),_0x8c3e37=getRuntimeSkillDir(_0x5561b6[_0x1ed846(0x8f)],_0x5561b6['accessKey'],_0x5561b6[_0x1ed846(0x7c)],_0x383221,_0x24c9f0,_0x5561b6[_0x1ed846(0x72)]),_0x57b02e=resolve(_0x8c3e37,SKILL_FILE),_0xb99b17=resolve(_0x8c3e37,METADATA_FILE),_0x1713f6=readMetadataIfPresent(_0xb99b17);if(!_0x1713f6||_0x1713f6[_0x1ed846(0xa6)]!==0x2||_0x1713f6[_0x1ed846(0x7c)]!==_0x5561b6['appCode']||_0x1713f6[_0x1ed846(0x9b)]!==_0x383221||_0x1713f6[_0x1ed846(0xab)]!==_0x24c9f0||_0x1713f6[_0x1ed846(0x98)]!==_0x1dbc8d||_0x1713f6['id']!==_0x2635d2['id']||_0x1713f6[_0x1ed846(0x8d)]!==_0x2635d2['skillName']||_0x1713f6[_0x1ed846(0x74)]!==_0x2635d2['description']||_0x1713f6[_0x1ed846(0x99)]!==_0x2635d2[_0x1ed846(0x99)]||_0x1713f6[_0x1ed846(0x9d)]!==_0x2635d2['status']||!_0x1713f6[_0x1ed846(0x85)]||!_0x1713f6[_0x1ed846(0x9c)]||!Object[_0x1ed846(0x75)](_0x1713f6['fileHashes'],SKILL_FILE))return undefined;for(const [_0x169369,_0xbf5757]of Object['entries'](_0x1713f6[_0x1ed846(0x9c)])){if(!/^[a-f0-9]{64}$/['test'](_0xbf5757))return undefined;const _0x483864=resolveManagedFilePath(_0x8c3e37,_0x169369);if(!existsSync(_0x483864)||!lstatSync(_0x483864)[_0x1ed846(0x86)]())return undefined;if(bufferSha256(readFileSync(_0x483864))!==_0xbf5757)return undefined;}return{'skill':_0x2635d2,'scope':_0x383221,'dir':_0x8c3e37,'skillMdPath':_0x57b02e,'metadataPath':_0xb99b17,'contentHash':_0x1713f6['contentHash'],'changed':![]};}function withMaterializedSkillFrontmatter(_0x4307fe,_0x489535,_0x4acc06){const _0xa477ac=a157_0x482f,_0x5e99db=skillDisplayName(_0x489535,_0x4acc06),_0x4061f7=_0x489535[_0xa477ac(0x74)]?.['trim']()||_0x5e99db||_0x4acc06;return normalizeLocalFiles(_0x4307fe)['map'](_0x30f86f=>{const _0x848609=_0xa477ac,_0x20dc34=fileText(_0x30f86f);if(_0x30f86f['path']!==SKILL_FILE)return _0x30f86f;if(hasYamlFrontmatter(_0x20dc34))return{'path':_0x30f86f[_0x848609(0x78)],'content':withSyncedDisplayName(_0x20dc34,_0x5e99db)};return{'path':_0x30f86f[_0x848609(0x78)],'content':prependSkillFrontmatter(_0x20dc34,{'name':_0x4acc06,'displayName':_0x5e99db,'description':_0x4061f7})};});}function hasYamlFrontmatter(_0x3061b2){return/^\uFEFF?---\s*\r?\n/['test'](_0x3061b2);}function prependSkillFrontmatter(_0x1a2fee,_0x2a221d){const _0x3d131d=a157_0x482f,_0x13e24f=_0x1a2fee['replace'](/^\uFEFF/,'');return[_0x3d131d(0x9f),'name:\x20'+yamlString(_0x2a221d[_0x3d131d(0x7e)]),_0x2a221d[_0x3d131d(0xa1)]?_0x3d131d(0xa5)+yamlString(_0x2a221d[_0x3d131d(0xa1)]):undefined,_0x3d131d(0x82)+yamlString(_0x2a221d[_0x3d131d(0x74)]),'---','',_0x13e24f][_0x3d131d(0x93)](_0x9709c5=>_0x9709c5!==undefined)[_0x3d131d(0x95)]('\x0a');}function yamlString(_0x495d71){return JSON['stringify'](_0x495d71['replace'](/\r/g,'')['trim']());}function skillDisplayName(_0x28dd60,_0x8a8e3d){const _0x2ca564=_0x28dd60['skillName']?.['trim']();return _0x2ca564||_0x8a8e3d;}function withSyncedDisplayName(_0x1f27c3,_0x1ca207){const _0x260e38=a157_0x482f,_0x184c9f=_0x1f27c3['match'](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x184c9f)return _0x1f27c3;const _0x2341a0=_0x184c9f[0x1]??'',_0x5ccef0=_0x184c9f[0x2]??'',_0x192574=parseDocument(_0x5ccef0);if(_0x192574[_0x260e38(0x90)][_0x260e38(0x7d)]>0x0||!isMap(_0x192574[_0x260e38(0x77)]))return _0x1f27c3;if(_0x1ca207)_0x192574[_0x260e38(0x7a)](_0x260e38(0xa1),_0x1ca207);else{if(_0x192574[_0x260e38(0xa8)](_0x260e38(0xa1)))_0x192574[_0x260e38(0x84)]('displayName');else return _0x1f27c3;}forceBlockCollections(_0x192574['contents']);const _0x4612a7=_0x192574[_0x260e38(0x7b)]({'lineWidth':0x0})[_0x260e38(0x76)](),_0x56b0e8=_0x1f27c3['slice'](_0x184c9f[0x0][_0x260e38(0x7d)])['replace'](/^\r?\n/,'');return _0x2341a0+'---\x0a'+_0x4612a7+_0x260e38(0x8c)+_0x56b0e8;}function forceBlockCollections(_0x381ee6){if(!isNode(_0x381ee6))return;visit(_0x381ee6,(_0x1d30ef,_0x2c137a)=>{const _0x3ebdb7=a157_0x482f;isCollection(_0x2c137a)&&(_0x2c137a[_0x3ebdb7(0xa9)]=![]);});}function ensurePulledFilesCanBeOverwritten(_0x14afde,_0x344aeb,_0x4305da,_0x2976f8){const _0x44344b=a157_0x482f;if(_0x2976f8||!existsSync(_0x344aeb))return;const _0x42e39d=readMetadataIfPresent(_0x344aeb);if(!_0x42e39d)return;const _0x20f56d=_0x42e39d[_0x44344b(0x9c)]&&Object[_0x44344b(0x91)](_0x42e39d['fileHashes'])['length']>0x0?_0x42e39d[_0x44344b(0x9c)]:undefined;if(_0x20f56d)for(const [_0x23657f,_0x483ee9]of Object[_0x44344b(0x9e)](_0x20f56d)){const _0x20de67=resolveManagedFilePath(_0x14afde,_0x23657f);if(!existsSync(_0x20de67))throw CliErrors[_0x44344b(0x73)](_0x44344b(0x8b)+_0x14afde,'Managed\x20file\x20was\x20removed\x20locally:\x20'+_0x23657f);const _0x4c5bdc=lstatSync(_0x20de67);if(!_0x4c5bdc[_0x44344b(0x86)]())throw CliErrors[_0x44344b(0x73)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x14afde,'Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20'+_0x23657f);const _0x546364=bufferSha256(readFileSync(_0x20de67));if(_0x546364!==_0x483ee9)throw CliErrors['validation']('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x14afde+_0x44344b(0xaa)+_0x23657f,_0x44344b(0x81)+_0x23657f);}else{const _0x5a3ec1=resolve(_0x14afde,SKILL_FILE);if(existsSync(_0x5a3ec1)&&_0x42e39d[_0x44344b(0x85)]){const _0x575a40=contentHash(readFileSync(_0x5a3ec1,_0x44344b(0x87)));if(_0x575a40!==_0x42e39d[_0x44344b(0x85)])throw CliErrors[_0x44344b(0x73)](_0x44344b(0x80)+_0x5a3ec1,'Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.');}}for(const _0x30c093 of normalizeLocalFiles(_0x4305da)){if(_0x20f56d?.[_0x30c093[_0x44344b(0x78)]])continue;if(!_0x20f56d&&_0x30c093[_0x44344b(0x78)]===SKILL_FILE)continue;const _0x4fec02=resolveManagedFilePath(_0x14afde,_0x30c093[_0x44344b(0x78)]);if(!existsSync(_0x4fec02))continue;const _0x6a64a0=lstatSync(_0x4fec02);if(!_0x6a64a0['isFile']())throw CliErrors['validation'](_0x44344b(0x8b)+_0x14afde,_0x44344b(0x89)+_0x30c093[_0x44344b(0x78)]);const _0x1050ee=bufferSha256(readFileSync(_0x4fec02));if(_0x1050ee!==fileHash(_0x30c093))throw CliErrors[_0x44344b(0x73)](_0x44344b(0x8b)+_0x14afde,'Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20'+_0x30c093[_0x44344b(0x78)]);}}function materializeFiles(_0x206afa,_0x4cc908){const _0x44be1d=a157_0x482f;for(const _0x341df5 of normalizeLocalFiles(_0x4cc908)){const _0x567631=resolveManagedFilePath(_0x206afa,_0x341df5[_0x44be1d(0x78)]);mkdirSync(dirname(_0x567631),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x567631,fileContent(_0x341df5),0x180);}}function removeStaleManagedFiles(_0x184027,_0x3175e4,_0xdee6e9){const _0x5e0080=a157_0x482f;if(!_0x3175e4)return;const _0x3f631a=new Set(normalizeLocalFiles(_0xdee6e9)[_0x5e0080(0xa3)](_0x3dab6d=>_0x3dab6d[_0x5e0080(0x78)]));for(const _0xd0a7ff of Object['keys'](_0x3175e4)){if(_0x3f631a['has'](_0xd0a7ff))continue;const _0x9fa248=resolveManagedFilePath(_0x184027,_0xd0a7ff);existsSync(_0x9fa248)&&lstatSync(_0x9fa248)['isFile']()&&rmSync(_0x9fa248,{'force':!![]});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3ffa4f,_0x49baba){const _0x554152=a158_0xbbc2,_0xb22440=_0x3ffa4f();while(!![]){try{const _0x489778=-parseInt(_0x554152(0x131))/0x1+parseInt(_0x554152(0x11a))/0x2*(-parseInt(_0x554152(0x125))/0x3)+parseInt(_0x554152(0x12f))/0x4+-parseInt(_0x554152(0x129))/0x5+-parseInt(_0x554152(0x122))/0x6+parseInt(_0x554152(0x12c))/0x7+parseInt(_0x554152(0x116))/0x8;if(_0x489778===_0x49baba)break;else _0xb22440['push'](_0xb22440['shift']());}catch(_0x1bec13){_0xb22440['push'](_0xb22440['shift']());}}}(a158_0x4cd6,0xc4076));import{existsSync,readFileSync}from'node:fs';import{CliErrors}from'../../errors.js';function a158_0xbbc2(_0x2b9bb3,_0x363073){_0x2b9bb3=_0x2b9bb3-0x116;const _0x4cd65b=a158_0x4cd6();let _0xbbc26b=_0x4cd65b[_0x2b9bb3];return _0xbbc26b;}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(_0x1b65c7,_0x2aa448,_0x12d63a,_0x5760f7,_0x3058d4,_0x347ab5,_0x18aa00){const _0x778e6a=a158_0xbbc2,_0x536c6a=_0x347ab5?normalizeLocalFiles(_0x347ab5):[],_0xc6a67e=!_0x18aa00&&_0x536c6a[_0x778e6a(0x132)]>0x0?buildSkillPackage(_0x536c6a):undefined,_0x3a7385=_0x18aa00?bufferSha256(_0x18aa00):_0xc6a67e?.[_0x778e6a(0x11d)][_0x778e6a(0x119)],_0x37180f=_0x18aa00?.[_0x778e6a(0x132)]??_0xc6a67e?.['manifest']['zipSize'],_0x4b4040=_0x536c6a[_0x778e6a(0x132)]>0x0?Object['fromEntries'](_0x536c6a[_0x778e6a(0x12e)](_0x163ab9=>[_0x163ab9['path'],fileHash(_0x163ab9)])):undefined;return{'schemaVersion':_0x536c6a[_0x778e6a(0x132)]>0x0?0x2:0x1,'id':_0x1b65c7['id'],'appCode':_0x12d63a,'skillCode':requireSkillCode(_0x1b65c7),'skillName':_0x1b65c7['skillName'],'description':_0x1b65c7['description'],'example':_0x1b65c7[_0x778e6a(0x11b)],'scope':_0x2aa448,'readonly':_0x2aa448!=='personal'||_0x1b65c7[_0x778e6a(0x126)]===!![],'tenantCode':_0x1b65c7[_0x778e6a(0x117)],'userId':_0x1b65c7[_0x778e6a(0x11f)],'version':_0x1b65c7['version'],'status':_0x1b65c7['status'],'tags':Array[_0x778e6a(0x133)](_0x1b65c7[_0x778e6a(0x12a)])?_0x1b65c7['tags']:[],'hasUpstreamUpdate':_0x1b65c7[_0x778e6a(0x123)],'forkedFromSkillId':_0x1b65c7['forkedFromSkillId'],'forkedFromVersion':_0x1b65c7[_0x778e6a(0x118)],'sourceSessionId':_0x1b65c7[_0x778e6a(0x11e)],'contentHash':_0x5760f7,'fileHashes':_0x4b4040,'treeHash':_0x536c6a[_0x778e6a(0x132)]>0x0?fileTreeHash(localFilesToManifestFiles(_0x536c6a)):undefined,'ossPath':remoteManifestOssPath(_0x1b65c7['files']),'zipSha256':_0x3a7385,'zipSize':_0x37180f,'files':_0x536c6a[_0x778e6a(0x132)]>0x0?_0x536c6a[_0x778e6a(0x12e)](_0x1f500f=>({'path':_0x1f500f[_0x778e6a(0x121)],'hash':fileHash(_0x1f500f),'size':fileContent(_0x1f500f)['length']})):undefined,'pulledAt':_0x3058d4??new Date()[_0x778e6a(0x130)]()};}export function requireSkillCode(_0x168e02){const _0x417d51=a158_0xbbc2,_0xdef41d=_0x168e02[_0x417d51(0x11c)]?.[_0x417d51(0x135)]();if(!_0xdef41d)throw CliErrors[_0x417d51(0x124)](_0x417d51(0x134));return _0xdef41d;}function a158_0x4cd6(){const _0x1a8dc9=['ossPath','path','5266308xfMxJF','hasUpstreamUpdate','validation','3TgFoeK','readonly','utf8','object','5471350JJOsBH','tags','parse','1474977RQuFpA','string','map','4946252LrKJka','toISOString','623280WpDDxP','length','isArray','Runtime\x20Skill\x20is\x20missing\x20skillCode.','trim','16624088LxXWAS','tenantCode','forkedFromVersion','zipSha256','254166NsQWRr','example','skillCode','manifest','sourceSessionId','userId'];a158_0x4cd6=function(){return _0x1a8dc9;};return a158_0x4cd6();}export function readMetadataIfPresent(_0x1581b0){const _0x4111dc=a158_0xbbc2;if(!existsSync(_0x1581b0))return undefined;try{const _0xeb4bb9=JSON[_0x4111dc(0x12b)](readFileSync(_0x1581b0,_0x4111dc(0x127)));return _0xeb4bb9;}catch{throw CliErrors[_0x4111dc(0x124)]('Invalid\x20'+METADATA_FILE+':\x20'+_0x1581b0);}}function remoteManifestOssPath(_0x77b9fc){const _0x2bd6bf=a158_0xbbc2;if(!_0x77b9fc||typeof _0x77b9fc!==_0x2bd6bf(0x128)||Array['isArray'](_0x77b9fc))return undefined;const _0x1d1389=_0x77b9fc[_0x2bd6bf(0x120)];return typeof _0x1d1389===_0x2bd6bf(0x12d)&&_0x1d1389[_0x2bd6bf(0x135)]()?_0x1d1389[_0x2bd6bf(0x135)]():undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a159_0x2aa850=a159_0x3d32;(function(_0x40572d,_0x34bcda){const _0x290a89=a159_0x3d32,_0x4007b1=_0x40572d();while(!![]){try{const _0x4c8bf4=parseInt(_0x290a89(0x184))/0x1*(-parseInt(_0x290a89(0x18d))/0x2)+parseInt(_0x290a89(0x189))/0x3+-parseInt(_0x290a89(0x186))/0x4+parseInt(_0x290a89(0x195))/0x5+parseInt(_0x290a89(0x192))/0x6+-parseInt(_0x290a89(0x18e))/0x7+parseInt(_0x290a89(0x19b))/0x8*(parseInt(_0x290a89(0x191))/0x9);if(_0x4c8bf4===_0x34bcda)break;else _0x4007b1['push'](_0x4007b1['shift']());}catch(_0x2f0c98){_0x4007b1['push'](_0x4007b1['shift']());}}}(a159_0x2024,0xade2b));import{existsSync}from'node:fs';import{homedir}from'node:os';import{resolve}from'node:path';import{fingerprintAccessKey}from'../../commands/app/cache.js';import{PRODUCT_CONFIG,productEnv}from'../../constant/product.js';import{CliErrors}from'../../errors.js';export function resolveSkillSyncPaths(_0x313724={}){const _0xd23c70=a159_0x3d32,_0x42030d=_0x313724[_0xd23c70(0x199)]??homedir(),_0x3e7d83=resolve(_0x42030d,PRODUCT_CONFIG[_0xd23c70(0x193)],_0xd23c70(0x185)),_0xaff057=trimmedEnv(_0xd23c70(0x18c)),_0x24b84c=trimmedEnv(_0xd23c70(0x18b)),_0x26423b=resolve(_0x42030d,_0xd23c70(0x198)),_0x2aebf2=_0x313724[_0xd23c70(0x18a)]??(existsSync(_0x26423b)?resolve(_0x26423b,'skills'):undefined);return{'homeDir':_0x42030d,'cacheRoot':_0x3e7d83,'managedRoot':resolve(_0x42030d,PRODUCT_CONFIG[_0xd23c70(0x193)]),'agentsSkillsDir':_0x313724[_0xd23c70(0x19d)]??_0xaff057??resolve(_0x42030d,_0xd23c70(0x190),'skills'),'claudeSkillsDir':_0x313724[_0xd23c70(0x187)]??_0x24b84c??resolve(_0x42030d,_0xd23c70(0x194),_0xd23c70(0x18f)),'workbuddySkillsDir':_0x2aebf2};}function a159_0x2024(){const _0x1c9837=['filter','3171270OjsamD','workbuddySkillsDir','CLAUDE_SKILL_ROOT','SKILL_ROOT','2DEpQHM','8360884GkDhZv','skills','.agents','5328ejIENA','3716766EcNjmS','homeDirName','.claude','1404550tAwgyH','\x20for\x20local\x20path:\x20','skillCode','.workbuddy','homeDir','Unsafe\x20','13096RZVojR','path\x20segment','agentsSkillsDir','validation','927683RtFpWR','cache','368940LkvHss','claudeSkillsDir'];a159_0x2024=function(){return _0x1c9837;};return a159_0x2024();}function a159_0x3d32(_0x1f3a93,_0x329bef){_0x1f3a93=_0x1f3a93-0x183;const _0x202454=a159_0x2024();let _0x3d3249=_0x202454[_0x1f3a93];return _0x3d3249;}export function runtimeAgentSkillRoots(_0x21a6eb){const _0x144372=a159_0x3d32;return[_0x21a6eb[_0x144372(0x19d)],_0x21a6eb[_0x144372(0x187)],_0x21a6eb['workbuddySkillsDir']][_0x144372(0x188)](_0x28cffd=>Boolean(_0x28cffd));}export function getRuntimeSkillCacheRoot(_0xdb480c,_0x42083c,_0x13ab36={}){const _0x563783=a159_0x3d32,_0x1334ef=resolveSkillSyncPaths(_0x13ab36);return resolve(_0x1334ef['cacheRoot'],_0xdb480c,fingerprintAccessKey(_0x42083c),_0x563783(0x18f));}export function getRuntimeSkillDir(_0x37b15f,_0x5bb966,_0xf31ece,_0xa2bf71,_0x257ad6,_0x586e84={}){const _0x500547=a159_0x3d32;return resolve(getRuntimeSkillCacheRoot(_0x37b15f,_0x5bb966,_0x586e84),safePathSegment(_0xf31ece,'appCode'),_0xa2bf71,safePathSegment(_0x257ad6,_0x500547(0x197)));}export function safePathSegment(_0x377688,_0x45a052=a159_0x2aa850(0x19c)){const _0x536baf=a159_0x2aa850;if(!_0x377688||_0x377688['includes']('/')||_0x377688['includes']('\x5c')||_0x377688['includes']('..'))throw CliErrors[_0x536baf(0x183)](_0x536baf(0x19a)+_0x45a052+_0x536baf(0x196)+_0x377688);return _0x377688;}function trimmedEnv(_0x1ad7cc){const _0x416880=productEnv(_0x1ad7cc)?.['trim']();return _0x416880?_0x416880:undefined;}
|
|
@@ -1 +1 @@
|
|
|
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
|
+
(function(_0x519097,_0x3128e4){const _0x4618dd=a160_0x5b09,_0x136c30=_0x519097();while(!![]){try{const _0x5aafbd=-parseInt(_0x4618dd(0x1cb))/0x1*(parseInt(_0x4618dd(0x1f0))/0x2)+parseInt(_0x4618dd(0x1e3))/0x3*(parseInt(_0x4618dd(0x1c8))/0x4)+parseInt(_0x4618dd(0x1db))/0x5+-parseInt(_0x4618dd(0x1bd))/0x6+parseInt(_0x4618dd(0x1f9))/0x7+parseInt(_0x4618dd(0x1eb))/0x8+parseInt(_0x4618dd(0x1ed))/0x9;if(_0x5aafbd===_0x3128e4)break;else _0x136c30['push'](_0x136c30['shift']());}catch(_0x20377b){_0x136c30['push'](_0x136c30['shift']());}}}(a160_0x5cda,0x93727));function a160_0x5b09(_0x1fe1d7,_0x704082){_0x1fe1d7=_0x1fe1d7-0x1bd;const _0x5cda91=a160_0x5cda();let _0x5b09db=_0x5cda91[_0x1fe1d7];return _0x5b09db;}import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a160_0x4bfce9}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';function a160_0x5cda(){const _0x2eedf3=['string','targetScope','name','1267288oAzLKt','number','3143286xHMBVw','ignoreInvalidMetadata','builtin','46ZDzDZX','sourceSessionId','ignoreMetadataForPayload','personal','skillName','path','example','pushedAt','\x20name\x20for\x20SkillHub\x20slug\x20generation.','2607801zZAWZl','toLowerCase','boolean','5108718PZXBTZ','some','isFile','validation','packageBase64','ignoreMetadataScope','dir','replace','object','ignoreMetadataSkillCode','(unknown)','4SmuBrG','isSymbolicLink','utf8','39646KbnNJk','Remote\x20Skill\x20','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20','Skill\x20directory\x20not\x20found:\x20','Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20','displayName','ignoreMetadataAppCodeMismatch','match','description','isDirectory','Unable\x20to\x20resolve\x20skillCode\x20from\x20','Missing\x20','find','\x20has\x20unsupported\x20scope\x20\x22','scope','trim','3259295NClCHP','tags','slice','length','isArray','skillCode','unknown',',\x20or\x20directory\x20name.','2505561tKwYRy','startsWith','appCode','content','files'];a160_0x5cda=function(){return _0x2eedf3;};return a160_0x5cda();}import{writeJsonAtomic}from'./fs-utils.js';import{contentHash}from'./hashing.js';import{fileText,normalizeLocalFiles,scanSkillDirectory}from'./local-files.js';import{buildMetadata,readMetadataIfPresent}from'./metadata.js';import{buildSkillPackage,tryNormalizePackageManifest}from'./zip-package.js';export function resolvePushDirectoryIdentity(_0x71e2fe,_0x5d9aae,_0x5d4568={}){const _0x5b4630=a160_0x5b09,_0x5263a7=resolvePushDirectoryRoot(_0x71e2fe),_0x3c499f=readPushMetadataIfPresent(resolve(_0x5263a7,METADATA_FILE),{'ignoreInvalidMetadata':_0x5d4568[_0x5b4630(0x1ee)]});if(_0x3c499f?.[_0x5b4630(0x1e5)]&&_0x3c499f[_0x5b4630(0x1e5)]!==_0x5d9aae&&!_0x5d4568['allowAppCodeRetarget']&&!_0x5d4568[_0x5b4630(0x1d1)])throw CliErrors['validation']('Skill\x20metadata\x20appCode\x20\x22'+_0x3c499f['appCode']+'\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22'+_0x5d9aae+'\x22.');const _0x36ef46=resolvePushSkillCode(_0x5263a7,_0x5d9aae,_0x3c499f,_0x5d4568);if(!_0x36ef46)throw CliErrors['validation'](_0x5b4630(0x1d5)+SKILL_FILE+',\x20'+METADATA_FILE+_0x5b4630(0x1e2));return{'dir':_0x5263a7,'skillCode':_0x36ef46,'metadata':_0x3c499f};}export function readPushDirectory(_0x52d0d8,_0x55db40,_0x30b84f={}){const _0x252771=a160_0x5b09,_0x2968a5=resolvePushDirectoryIdentity(_0x52d0d8,_0x55db40,_0x30b84f),_0x488571=_0x2968a5[_0x252771(0x1c3)],_0x1dcc72=resolve(_0x488571,SKILL_FILE);if(!existsSync(_0x1dcc72)||!lstatSync(_0x1dcc72)[_0x252771(0x1bf)]())throw CliErrors[_0x252771(0x1c0)](_0x252771(0x1d6)+SKILL_FILE+':\x20'+_0x1dcc72);const _0xdc79bc=_0x2968a5['metadata'],_0x120df0=_0x30b84f[_0x252771(0x1e9)]??_0x252771(0x1f3);if(!_0x30b84f[_0x252771(0x1c2)]&&_0xdc79bc?.['scope']===_0x252771(0x1ef))throw CliErrors[_0x252771(0x1c0)](_0x252771(0x1cf)+METADATA_FILE+'\x20has\x20scope=\x22'+_0xdc79bc[_0x252771(0x1d9)]+'\x22.');if(!_0x30b84f[_0x252771(0x1c2)]&&_0x120df0===_0x252771(0x1f3)&&_0xdc79bc?.['scope']&&_0xdc79bc[_0x252771(0x1d9)]!==_0x252771(0x1f3))throw CliErrors[_0x252771(0x1c0)](_0x252771(0x1cd)+METADATA_FILE+'\x20has\x20scope=\x22'+_0xdc79bc['scope']+'\x22.','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20'+_0x488571+'\x20to\x20submit\x20company\x20Skills\x20for\x20review.');const _0x3a8df3=scanSkillDirectory(_0x488571,{'excludedFilePaths':_0x30b84f['excludedFilePaths']}),_0x2e8c49=buildSkillPackage(_0x3a8df3),_0xd49a49=readFileSync(_0x1dcc72,'utf8'),_0x1cc794=_0x2968a5[_0x252771(0x1e0)],_0xd5d2f6=_0x30b84f[_0x252771(0x1f2)]?undefined:_0xdc79bc,_0x509f60=readSkillDisplayName(_0xd49a49);return{'skillCode':_0x1cc794,'metadata':_0xdc79bc,'frontmatterDisplayName':_0x509f60,'input':{'skillCode':_0x1cc794,'skillName':_0x509f60??_0xd5d2f6?.['skillName'],'description':_0xd5d2f6?.[_0x252771(0x1d3)],'content':_0xd49a49,'files':_0x2e8c49['manifest'],'packageBase64':_0x2e8c49[_0x252771(0x1c1)],'tags':_0xd5d2f6?.['tags'],'version':_0xd5d2f6?.['version'],'sourceSessionId':_0xd5d2f6?.[_0x252771(0x1f1)]}};}export function refreshPushDirectoryMetadataFromRemote(_0x5a620d,_0x5f4160,_0x2f21b2,_0x183c92={}){const _0x598f06=a160_0x5b09,_0x7a9b61=resolvePushDirectoryRoot(_0x5a620d),_0x296ffa=readPushMetadataIfPresent(resolve(_0x7a9b61,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x119803=requireRemoteScope(_0x5f4160),_0x44f5e1=readLocalSkillContent(_0x7a9b61),_0x98b50a={..._0x5f4160,'appCode':_0x5f4160['appCode']??_0x2f21b2,'skillName':_0x5f4160[_0x598f06(0x1f4)]??_0x296ffa?.[_0x598f06(0x1f4)],'description':_0x5f4160[_0x598f06(0x1d3)]??_0x296ffa?.[_0x598f06(0x1d3)],'example':_0x5f4160['example']??_0x296ffa?.[_0x598f06(0x1f6)],'tags':Array[_0x598f06(0x1df)](_0x5f4160[_0x598f06(0x1dc)])?_0x5f4160[_0x598f06(0x1dc)]:_0x296ffa?.['tags'],'sourceSessionId':_0x5f4160['sourceSessionId']??_0x296ffa?.[_0x598f06(0x1f1)],'content':_0x5f4160[_0x598f06(0x1e6)]??_0x44f5e1},_0x3a39a1=buildMetadata(_0x98b50a,_0x119803,_0x2f21b2,contentHash(_0x44f5e1),_0x183c92['refreshedAt']);writeJsonAtomic(resolve(_0x7a9b61,METADATA_FILE),_0x3a39a1);}export function recordPushedRuntimeSkill(_0x793179,_0x566e44,_0x5d093e,_0x15fd8d={}){const _0x909a62=a160_0x5b09,_0x18020e=resolvePushDirectoryRoot(_0x793179),_0xc6067f=scanSkillDirectory(_0x18020e),_0x3a9ce0=_0xc6067f[_0x909a62(0x1d7)](_0x5f109f=>_0x5f109f[_0x909a62(0x1f5)]===SKILL_FILE),_0xea6a8a=_0x3a9ce0?fileText(_0x3a9ce0):'',_0x2f97d3=tryNormalizePackageManifest(_0x566e44[_0x909a62(0x1e7)]),_0xd8e5e9={..._0x566e44,'content':_0x566e44[_0x909a62(0x1e6)]??_0xea6a8a,'files':_0x2f97d3},_0x52ed02=_0x2f97d3?normalizeLocalFiles(_0xc6067f)['filter'](_0x26d9ae=>_0x2f97d3[_0x909a62(0x1e7)][_0x909a62(0x1be)](_0x431697=>_0x431697['path']===_0x26d9ae['path'])):undefined,_0x3fe55f=buildMetadata(_0xd8e5e9,_0x15fd8d[_0x909a62(0x1d9)]??'personal',_0x5d093e,contentHash(_0xd8e5e9['content']??''),_0x15fd8d[_0x909a62(0x1f7)],_0x52ed02);writeJsonAtomic(resolve(_0x18020e,METADATA_FILE),_0x3fe55f);}export function deriveSkillCodeFromDirectory(_0x461f51,_0xd0a6ef){const _0x4d4f3f=a160_0x5b09,_0x189731=basename(resolve(_0x461f51)),_0x437180=_0xd0a6ef+'--';return _0x189731[_0x4d4f3f(0x1e4)](_0x437180)?_0x189731[_0x4d4f3f(0x1dd)](_0x437180[_0x4d4f3f(0x1de)]):_0x189731;}function resolvePushSkillCode(_0x47c8e6,_0x1d85c2,_0x3127be,_0x2d170d){const _0x50d038=a160_0x5b09,_0xbb28bd=deriveSkillCodeFromSkillFile(_0x47c8e6)||deriveSkillCodeFromDirectory(_0x47c8e6,_0x1d85c2);if(_0x2d170d[_0x50d038(0x1c6)])return _0xbb28bd;return _0x3127be?.['skillCode']?.[_0x50d038(0x1da)]()||_0xbb28bd;}function deriveSkillCodeFromSkillFile(_0x2c3cd4){const _0x2bc3e6=a160_0x5b09,_0x44aea7=resolve(_0x2c3cd4,SKILL_FILE);if(!existsSync(_0x44aea7)||!lstatSync(_0x44aea7)[_0x2bc3e6(0x1bf)]())return undefined;const _0x261c87=readFileSync(_0x44aea7,_0x2bc3e6(0x1ca)),_0x31d26a=_0x261c87[_0x2bc3e6(0x1d2)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x31d26a)return undefined;const _0x574f0a=parseFrontmatterObject(_0x31d26a[0x1]??''),_0x477a21=scalarToString(_0x574f0a?.[_0x2bc3e6(0x1ea)]);return _0x477a21?slugifySkillName(_0x477a21):undefined;}function readSkillDisplayName(_0x4ad7cd){const _0x4ea083=a160_0x5b09,_0x10f8d8=_0x4ad7cd[_0x4ea083(0x1d2)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x10f8d8)return undefined;const _0x1e20bf=parseFrontmatterObject(_0x10f8d8[0x1]??'');return scalarToString(_0x1e20bf?.[_0x4ea083(0x1d0)]);}function slugifySkillName(_0x343f13){const _0x3f368d=a160_0x5b09,_0x5ee0e3=_0x343f13[_0x3f368d(0x1da)]()[_0x3f368d(0x1fa)]()[_0x3f368d(0x1c4)](/[^\p{L}\p{N}\p{So}]+/gu,'-')[_0x3f368d(0x1c4)](/^-+/,'')['replace'](/-+$/,'')[_0x3f368d(0x1c4)](/-{2,}/g,'-');if(!_0x5ee0e3)throw CliErrors[_0x3f368d(0x1c0)]('Invalid\x20'+SKILL_FILE+_0x3f368d(0x1f8));return _0x5ee0e3;}function parseFrontmatterObject(_0x4b507a){const _0x3e0440=a160_0x5b09;try{const _0x33dd27=a160_0x4bfce9(_0x4b507a);return _0x33dd27&&typeof _0x33dd27===_0x3e0440(0x1c5)&&!Array[_0x3e0440(0x1df)](_0x33dd27)?_0x33dd27:undefined;}catch{return undefined;}}function scalarToString(_0x390be1){const _0x5b7039=a160_0x5b09;if(typeof _0x390be1===_0x5b7039(0x1e8))return _0x390be1[_0x5b7039(0x1da)]();if(typeof _0x390be1===_0x5b7039(0x1ec)||typeof _0x390be1===_0x5b7039(0x1fb))return String(_0x390be1);return undefined;}function resolvePushDirectoryRoot(_0x2aec4c){const _0x208ca5=a160_0x5b09,_0x48b9fa=resolve(_0x2aec4c);if(!existsSync(_0x48b9fa))throw CliErrors['validation'](_0x208ca5(0x1ce)+_0x2aec4c);const _0x5eac01=lstatSync(_0x48b9fa);if(_0x5eac01[_0x208ca5(0x1d4)]())return _0x48b9fa;if(_0x5eac01[_0x208ca5(0x1c9)]()){const _0x177dda=realpathSync(_0x48b9fa);if(lstatSync(_0x177dda)[_0x208ca5(0x1d4)]())return _0x177dda;}throw CliErrors[_0x208ca5(0x1c0)]('Skill\x20directory\x20not\x20found:\x20'+_0x2aec4c);}function requireRemoteScope(_0x3ba88c){const _0x13213b=a160_0x5b09;if(_0x3ba88c[_0x13213b(0x1d9)]==='personal'||_0x3ba88c[_0x13213b(0x1d9)]==='company'||_0x3ba88c[_0x13213b(0x1d9)]==='builtin')return _0x3ba88c[_0x13213b(0x1d9)];throw CliErrors[_0x13213b(0x1c0)](_0x13213b(0x1cc)+(_0x3ba88c[_0x13213b(0x1e0)]||_0x13213b(0x1c7))+_0x13213b(0x1d8)+(_0x3ba88c['scope']??_0x13213b(0x1e1))+'\x22.');}function readLocalSkillContent(_0x4f2901){const _0x10db26=a160_0x5b09,_0x7996f6=resolve(_0x4f2901,SKILL_FILE);return existsSync(_0x7996f6)&&lstatSync(_0x7996f6)['isFile']()?readFileSync(_0x7996f6,_0x10db26(0x1ca)):'';}function readPushMetadataIfPresent(_0x2da55e,_0xc6c4ab={}){try{return readMetadataIfPresent(_0x2da55e);}catch(_0x137b09){if(_0xc6c4ab['ignoreInvalidMetadata'])return undefined;throw _0x137b09;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a161_0x3d27(){const _0x13c160=['552008PBCQgY','validation','3wPBIEm','27CZxVrX','personal','Unsupported\x20runtime\x20Skill\x20scope:\x20','2382335YcgJjK','includes','1duQeeM','306355oJIREw','3577892KbHFIG','4165554XxSuaX','12898336ICFUBN','push','477290TyyHXd','company','length'];a161_0x3d27=function(){return _0x13c160;};return a161_0x3d27();}(function(_0x3ed027,_0x59ead8){const _0x3a3b3a=a161_0x38f1,_0x1efc31=_0x3ed027();while(!![]){try{const _0x34f945=-parseInt(_0x3a3b3a(0x158))/0x1*(-parseInt(_0x3a3b3a(0x150))/0x2)+-parseInt(_0x3a3b3a(0x152))/0x3*(-parseInt(_0x3a3b3a(0x15a))/0x4)+parseInt(_0x3a3b3a(0x156))/0x5+parseInt(_0x3a3b3a(0x14a))/0x6+-parseInt(_0x3a3b3a(0x159))/0x7+-parseInt(_0x3a3b3a(0x14b))/0x8+parseInt(_0x3a3b3a(0x153))/0x9*(parseInt(_0x3a3b3a(0x14d))/0xa);if(_0x34f945===_0x59ead8)break;else _0x1efc31['push'](_0x1efc31['shift']());}catch(_0x253788){_0x1efc31['push'](_0x1efc31['shift']());}}}(a161_0x3d27,0xca3ad));import{CliErrors}from'../../errors.js';function a161_0x38f1(_0x431307,_0x296084){_0x431307=_0x431307-0x14a;const _0x3d2739=a161_0x3d27();let _0x38f1a9=_0x3d2739[_0x431307];return _0x38f1a9;}export function normalizeRuntimeSkillScopes(_0x4dff04){const _0x4bef6d=a161_0x38f1,_0x206a3c=_0x4dff04&&_0x4dff04[_0x4bef6d(0x14f)]>0x0?_0x4dff04:[_0x4bef6d(0x154),_0x4bef6d(0x14e),'builtin'],_0x1a5a39=[];for(const _0x3765eb of _0x206a3c){if(!isRuntimeSkillScope(_0x3765eb))throw CliErrors[_0x4bef6d(0x151)](_0x4bef6d(0x155)+_0x3765eb);!_0x1a5a39[_0x4bef6d(0x157)](_0x3765eb)&&_0x1a5a39[_0x4bef6d(0x14c)](_0x3765eb);}return _0x1a5a39;}export function isRuntimeSkillScope(_0x4dae91){const _0x33b9b2=a161_0x38f1;return _0x4dae91==='personal'||_0x4dae91===_0x33b9b2(0x14e)||_0x4dae91==='builtin';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
const a163_0x5415cb=a163_0x324c;(function(_0x159b96,_0xf2945f){const _0x4d7c1d=a163_0x324c,_0x5babd8=_0x159b96();while(!![]){try{const _0x4084c2=-parseInt(_0x4d7c1d(0x10e))/0x1+-parseInt(_0x4d7c1d(0x104))/0x2*(-parseInt(_0x4d7c1d(0x10b))/0x3)+-parseInt(_0x4d7c1d(0xf8))/0x4+parseInt(_0x4d7c1d(0x102))/0x5*(-parseInt(_0x4d7c1d(0xf9))/0x6)+-parseInt(_0x4d7c1d(0x105))/0x7+-parseInt(_0x4d7c1d(0x101))/0x8*(parseInt(_0x4d7c1d(0x107))/0x9)+parseInt(_0x4d7c1d(0xfa))/0xa*(parseInt(_0x4d7c1d(0x106))/0xb);if(_0x4084c2===_0xf2945f)break;else _0x5babd8['push'](_0x5babd8['shift']());}catch(_0x55a033){_0x5babd8['push'](_0x5babd8['shift']());}}}(a163_0x4d6a,0x283c7));import{unzipSync,zipSync}from'fflate';function a163_0x4d6a(){const _0x3d3553=['object','Runtime\x20Skill\x20package\x20contains\x20directory\x20entry:\x20','endsWith','Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.','1240528gpQQPY','6780xIamDr','validation','262osQurD','631204SKoiKC','1760KYcZgD','9NglYDs','sort','validation_error','1980-01-01T00:00:00.000Z','6681ALqZFT','name','path','304254RjrZOd','entries','1019624McBhMT','162PvjGZV','44630PCPewt','length','from'];a163_0x4d6a=function(){return _0x3d3553;};return a163_0x4d6a();}import{CliErrors}from'../../errors.js';import{compareSkillFiles,fileContent,normalizeLocalFiles,normalizeSkillRelativePath}from'./local-files.js';const ZIP_MTIME=new Date(a163_0x5415cb(0x10a));export function createDeterministicZipPackage(_0x23dba4){const _0x44e5cc=a163_0x5415cb,_0x27d32e={};for(const _0x20755b of normalizeLocalFiles(_0x23dba4)){_0x27d32e[_0x20755b[_0x44e5cc(0x10d)]]=fileContent(_0x20755b);}return Buffer['from'](zipSync(_0x27d32e,{'level':0x0,'mtime':ZIP_MTIME}));}function a163_0x324c(_0x15aff5,_0x17ac32){_0x15aff5=_0x15aff5-0xf7;const _0x4d6a24=a163_0x4d6a();let _0x324c94=_0x4d6a24[_0x15aff5];return _0x324c94;}export function parseZipPackage(_0x471c2b){const _0x56119a=a163_0x5415cb;if(_0x471c2b[_0x56119a(0xfb)]<0x16)throw CliErrors[_0x56119a(0x103)]('Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.');let _0x999578;try{_0x999578=unzipSync(_0x471c2b,{'filter'(_0x582ad3){const _0x5c4716=_0x56119a,_0x3b469b=normalizeSkillRelativePath(_0x582ad3[_0x5c4716(0x10c)]);if(_0x3b469b[_0x5c4716(0xff)]('/'))throw CliErrors[_0x5c4716(0x103)](_0x5c4716(0xfe)+_0x3b469b);return!![];}});}catch(_0x2c532b){if(isRuntimeSkillValidationError(_0x2c532b))throw _0x2c532b;throw CliErrors[_0x56119a(0x103)](_0x56119a(0x100));}return Object[_0x56119a(0xf7)](_0x999578)['map'](([_0x59f77d,_0x32e00a])=>({'path':normalizeSkillRelativePath(_0x59f77d),'bytes':Buffer[_0x56119a(0xfc)](_0x32e00a)}))[_0x56119a(0x108)](compareSkillFiles);}function isRuntimeSkillValidationError(_0x3c57c4){const _0x563073=a163_0x5415cb;return typeof _0x3c57c4===_0x563073(0xfd)&&_0x3c57c4!==null&&'code'in _0x3c57c4&&_0x3c57c4['code']===_0x563073(0x109);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x428fec,_0x371fc0){const _0x4cccea=a164_0x643a,_0xb670a4=_0x428fec();while(!![]){try{const _0x3f5555=parseInt(_0x4cccea(0xd4))/0x1*(parseInt(_0x4cccea(0xbb))/0x2)+-parseInt(_0x4cccea(0xcb))/0x3+parseInt(_0x4cccea(0xe9))/0x4*(-parseInt(_0x4cccea(0xe0))/0x5)+parseInt(_0x4cccea(0xec))/0x6*(-parseInt(_0x4cccea(0xe2))/0x7)+-parseInt(_0x4cccea(0xca))/0x8*(-parseInt(_0x4cccea(0xd8))/0x9)+parseInt(_0x4cccea(0xd5))/0xa*(-parseInt(_0x4cccea(0xdd))/0xb)+parseInt(_0x4cccea(0xe7))/0xc;if(_0x3f5555===_0x371fc0)break;else _0xb670a4['push'](_0xb670a4['shift']());}catch(_0xac42e0){_0xb670a4['push'](_0xb670a4['shift']());}}}(a164_0x36cc,0xb8005));import{CliErrors}from'../../errors.js';function a164_0x36cc(){const _0x4cd80f=['\x20in\x20Skill\x20file\x20package.','Runtime\x20Skill\x20file\x20tree\x20sha256\x20is\x20invalid.','Runtime\x20Skill\x20package\x20size\x20mismatch.','path','has','422536DGgawc','546426evMRJE','size','toLowerCase','sha256','zipSha256','files','Missing\x20','Runtime\x20Skill\x20manifest\x20is\x20missing\x20','get','50961afEMzU','20lhcYxQ','Runtime\x20Skill\x20package\x20entry\x20list\x20mismatch.','requireOssPath','18evwyki','some','treeSha256','toString','object','4860196bTsRMF','validation','ossPath','65AECLDM','length','1874320CxOcBa','push','base64','Runtime\x20Skill\x20package\x20sha256\x20is\x20invalid.','schemaVersion','28007508moxhux','isSafeInteger','41708ejSccO','string','Runtime\x20Skill\x20package\x20file\x20sha256\x20mismatch:\x20','12IzYstf','Runtime\x20Skill\x20package\x20size\x20is\x20invalid.','2DiuPhU','map','trim','Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.','zipSize','Runtime\x20Skill\x20package\x20is\x20required\x20for\x20Skill\x20install:\x20','isArray','Runtime\x20Skill\x20package\x20is\x20missing\x20','bytes','set'];a164_0x36cc=function(){return _0x4cd80f;};return a164_0x36cc();}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(_0xed422b){const _0x5e0872=a164_0x643a,_0x2abb97=normalizeLocalFiles(_0xed422b);if(!_0x2abb97[_0x5e0872(0xd9)](_0xb73e8d=>_0xb73e8d[_0x5e0872(0xc8)]===SKILL_FILE))throw CliErrors[_0x5e0872(0xde)](_0x5e0872(0xd1)+SKILL_FILE+_0x5e0872(0xc5));const _0x45ad94=localFilesToManifestFiles(_0x2abb97),_0x52903e=createDeterministicZipPackage(_0x2abb97);return{'manifest':{'schemaVersion':0x2,'treeSha256':fileTreeHash(_0x45ad94),'zipSha256':bufferSha256(_0x52903e),'zipSize':_0x52903e['length'],'files':_0x45ad94},'packageBytes':_0x52903e,'packageBase64':_0x52903e[_0x5e0872(0xdb)](_0x5e0872(0xe4))};}export function verifyRuntimeSkillPackage(_0x30b26d,_0x17eac0){const _0x3905a6=a164_0x643a,_0x5c1a48=normalizePackageManifest(_0x30b26d,{'requireOssPath':![]});if(!_0x5c1a48)throw CliErrors[_0x3905a6(0xde)]('Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.');return extractAndVerifyPackage(_0x5c1a48,_0x17eac0);}function a164_0x643a(_0x4de038,_0x955b20){_0x4de038=_0x4de038-0xbb;const _0x36cc85=a164_0x36cc();let _0x643a28=_0x36cc85[_0x4de038];return _0x643a28;}export function verifyRuntimeSkillBundle(_0x2f59bb,_0x3627ed){const _0x537bab=a164_0x643a,_0x1a2186=normalizePackageManifest(_0x2f59bb,{'requireOssPath':![]});if(!_0x1a2186)throw CliErrors['validation'](_0x537bab(0xbe));return extractAndVerifyPackageFiles(_0x1a2186,_0x3627ed);}export function tryNormalizePackageManifest(_0x53eba6){return normalizePackageManifest(_0x53eba6,{'requireOssPath':![]});}export function requirePackageBytes(_0x29ad6b,_0x155e06){const _0x157dea=a164_0x643a;if(!_0x155e06||_0x155e06[_0x157dea(0xe1)]===0x0)throw CliErrors[_0x157dea(0xde)](_0x157dea(0xc0)+_0x29ad6b);return _0x155e06;}export function extractDownloadedPackage(_0x192022){const _0x230551=a164_0x643a,_0x4019ad=parseZipPackage(_0x192022)[_0x230551(0xbc)](_0x3b3c6f=>({'path':_0x3b3c6f[_0x230551(0xc8)],'bytes':_0x3b3c6f[_0x230551(0xc3)]}));if(!_0x4019ad['some'](_0x2cc40e=>_0x2cc40e[_0x230551(0xc8)]===SKILL_FILE))throw CliErrors[_0x230551(0xde)](_0x230551(0xc2)+SKILL_FILE+'.');return normalizeLocalFiles(_0x4019ad);}export function localFilesToManifestFiles(_0x2f4a23){const _0x58c000=a164_0x643a;return normalizeLocalFiles(_0x2f4a23)[_0x58c000(0xbc)](_0x430173=>({'path':_0x430173['path'],'sha256':fileHash(_0x430173),'size':fileContent(_0x430173)[_0x58c000(0xe1)]}));}function normalizePackageManifest(_0x38ec01,_0x36631c){const _0x521e5f=a164_0x643a;if(!_0x38ec01||typeof _0x38ec01!==_0x521e5f(0xdc)||Array['isArray'](_0x38ec01))return undefined;const _0x569372=_0x38ec01,_0x3125a1=typeof _0x569372[_0x521e5f(0xdf)]===_0x521e5f(0xea)?_0x569372[_0x521e5f(0xdf)][_0x521e5f(0xbd)]():undefined;if(_0x36631c[_0x521e5f(0xd7)]&&!_0x3125a1)return undefined;if(!Array[_0x521e5f(0xc1)](_0x569372[_0x521e5f(0xd0)])||_0x569372['files'][_0x521e5f(0xe1)]===0x0)return undefined;if(!isSha256Hex(_0x569372[_0x521e5f(0xda)]))throw CliErrors[_0x521e5f(0xde)](_0x521e5f(0xc6));if(!isSha256Hex(_0x569372['zipSha256']))throw CliErrors[_0x521e5f(0xde)](_0x521e5f(0xe5));if(!Number[_0x521e5f(0xe8)](_0x569372[_0x521e5f(0xbf)])||_0x569372[_0x521e5f(0xbf)]<0x0)throw CliErrors[_0x521e5f(0xde)](_0x521e5f(0xed));const _0x3752f0=normalizeManifestFiles(_0x569372[_0x521e5f(0xd0)]);if(!_0x3752f0[_0x521e5f(0xd9)](_0x396903=>_0x396903['path']===SKILL_FILE))throw CliErrors[_0x521e5f(0xde)](_0x521e5f(0xd2)+SKILL_FILE+'.');const _0x21543d=fileTreeHash(_0x3752f0);if(_0x21543d!==_0x569372['treeSha256'][_0x521e5f(0xcd)]())throw CliErrors[_0x521e5f(0xde)]('Runtime\x20Skill\x20file\x20tree\x20sha256\x20mismatch.');return{'schemaVersion':Number[_0x521e5f(0xe8)](_0x569372[_0x521e5f(0xe6)])?_0x569372[_0x521e5f(0xe6)]:0x2,'ossPath':_0x3125a1,'treeSha256':_0x21543d,'zipSha256':_0x569372['zipSha256']['toLowerCase'](),'zipSize':_0x569372[_0x521e5f(0xbf)],'files':_0x3752f0};}function extractAndVerifyPackage(_0x386682,_0xaf86ab){const _0x5337d1=a164_0x643a,_0x4c70c9=normalizePackageManifest(_0x386682,{'requireOssPath':![]});if(!_0x4c70c9)throw CliErrors[_0x5337d1(0xde)]('Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.');if(_0xaf86ab[_0x5337d1(0xe1)]!==_0x4c70c9[_0x5337d1(0xbf)])throw CliErrors[_0x5337d1(0xde)](_0x5337d1(0xc7));const _0x5b17d8=bufferSha256(_0xaf86ab);if(_0x5b17d8!==_0x4c70c9[_0x5337d1(0xcf)])throw CliErrors[_0x5337d1(0xde)]('Runtime\x20Skill\x20package\x20sha256\x20mismatch.');return extractAndVerifyPackageFiles(_0x4c70c9,_0xaf86ab);}function extractAndVerifyPackageFiles(_0x503066,_0x4de958){const _0x546a24=a164_0x643a,_0x256160=parseZipPackage(_0x4de958);if(_0x256160['length']!==_0x503066[_0x546a24(0xd0)][_0x546a24(0xe1)])throw CliErrors['validation'](_0x546a24(0xd6));const _0x40dccb=new Map();for(const _0x5d39e1 of _0x256160){if(_0x40dccb[_0x546a24(0xc9)](_0x5d39e1[_0x546a24(0xc8)]))throw CliErrors[_0x546a24(0xde)]('Duplicate\x20Skill\x20package\x20entry:\x20'+_0x5d39e1[_0x546a24(0xc8)]);_0x40dccb[_0x546a24(0xc4)](_0x5d39e1[_0x546a24(0xc8)],_0x5d39e1);}const _0x370f5c=[];for(const _0x344bc7 of _0x503066[_0x546a24(0xd0)]){const _0x303e90=_0x40dccb[_0x546a24(0xd3)](_0x344bc7['path']);if(!_0x303e90)throw CliErrors[_0x546a24(0xde)]('Runtime\x20Skill\x20package\x20is\x20missing\x20entry:\x20'+_0x344bc7['path']);if(_0x303e90[_0x546a24(0xc3)][_0x546a24(0xe1)]!==_0x344bc7[_0x546a24(0xcc)])throw CliErrors[_0x546a24(0xde)]('Runtime\x20Skill\x20package\x20file\x20size\x20mismatch:\x20'+_0x344bc7['path']);const _0x8853eb=bufferSha256(_0x303e90['bytes']);if(_0x8853eb!==_0x344bc7[_0x546a24(0xce)])throw CliErrors[_0x546a24(0xde)](_0x546a24(0xeb)+_0x344bc7[_0x546a24(0xc8)]);_0x370f5c[_0x546a24(0xe3)]({'path':_0x344bc7['path'],'bytes':_0x303e90[_0x546a24(0xc3)]});}return normalizeLocalFiles(_0x370f5c);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x28b267,_0x173b07){var _0x67f9c9=a165_0x876f,_0x3240f0=_0x28b267();while(!![]){try{var _0x97bda3=parseInt(_0x67f9c9(0xbe))/0x1*(-parseInt(_0x67f9c9(0xbc))/0x2)+parseInt(_0x67f9c9(0xc7))/0x3*(-parseInt(_0x67f9c9(0xc2))/0x4)+-parseInt(_0x67f9c9(0xc0))/0x5*(parseInt(_0x67f9c9(0xc1))/0x6)+parseInt(_0x67f9c9(0xbb))/0x7*(parseInt(_0x67f9c9(0xc6))/0x8)+parseInt(_0x67f9c9(0xba))/0x9*(-parseInt(_0x67f9c9(0xbd))/0xa)+parseInt(_0x67f9c9(0xc4))/0xb*(-parseInt(_0x67f9c9(0xc5))/0xc)+parseInt(_0x67f9c9(0xc3))/0xd*(parseInt(_0x67f9c9(0xbf))/0xe);if(_0x97bda3===_0x173b07)break;else _0x3240f0['push'](_0x3240f0['shift']());}catch(_0xd42fb1){_0x3240f0['push'](_0x3240f0['shift']());}}}(a165_0x3559,0x721cf));export{contentHash,fileTreeHash}from'./runtime-skill-sync/hashing.js';export{linkEffectiveRuntimeSkills,linkGlobalRuntimeSkills,pruneStaleRuntimeSkillCache,pruneStaleRuntimeSkillLinks}from'./runtime-skill-sync/links.js';export{resolveRuntimeSkillInstallTarget}from'./runtime-skill-sync/install-target.js';export{listLocalRuntimeSkills}from'./runtime-skill-sync/list-local.js';function a165_0x876f(_0x4c5d7e,_0x4977fb){_0x4c5d7e=_0x4c5d7e-0xba;var _0x3559dd=a165_0x3559();var _0x876f2a=_0x3559dd[_0x4c5d7e];return _0x876f2a;}function a165_0x3559(){var _0x3f91f6=['26658asHaFu','4421683mwMOgZ','547574KFAibR','1690BmZsAD','3IGImwB','14TEAsFl','20mIoPtZ','72324bummMo','234796cGrUaJ','26818753ByRRZA','22DixTmA','3029364OOOKSN','8egubsE','18bHQcaq'];a165_0x3559=function(){return _0x3f91f6;};return a165_0x3559();}export{materializeRuntimeSkill,reuseMaterializedRuntimeSkill}from'./runtime-skill-sync/materialize.js';export{readMetadataIfPresent}from'./runtime-skill-sync/metadata.js';export{getRuntimeSkillCacheRoot,getRuntimeSkillDir,resolveSkillSyncPaths,runtimeAgentSkillRoots}from'./runtime-skill-sync/paths.js';export{deriveSkillCodeFromDirectory,readPushDirectory,refreshPushDirectoryMetadataFromRemote,recordPushedRuntimeSkill,resolvePushDirectoryIdentity}from'./runtime-skill-sync/push.js';export{buildSkillPackage,verifyRuntimeSkillBundle,verifyRuntimeSkillPackage}from'./runtime-skill-sync/zip-package.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a166_0x1d1c0f=a166_0x56e6;function a166_0x56e6(_0x55c350,_0x52c72f){_0x55c350=_0x55c350-0x147;const _0x2580e4=a166_0x2580();let _0x56e673=_0x2580e4[_0x55c350];return _0x56e673;}(function(_0x3c85c5,_0x3ee470){const _0xd171af=a166_0x56e6,_0x4579c7=_0x3c85c5();while(!![]){try{const _0x27d57a=parseInt(_0xd171af(0x147))/0x1+parseInt(_0xd171af(0x158))/0x2*(-parseInt(_0xd171af(0x162))/0x3)+-parseInt(_0xd171af(0x163))/0x4+-parseInt(_0xd171af(0x14a))/0x5*(-parseInt(_0xd171af(0x148))/0x6)+-parseInt(_0xd171af(0x166))/0x7*(parseInt(_0xd171af(0x14b))/0x8)+-parseInt(_0xd171af(0x152))/0x9+parseInt(_0xd171af(0x15c))/0xa;if(_0x27d57a===_0x3ee470)break;else _0x4579c7['push'](_0x4579c7['shift']());}catch(_0x2e7431){_0x4579c7['push'](_0x4579c7['shift']());}}}(a166_0x2580,0x7e8ef));import{existsSync,readFileSync}from'node:fs';function a166_0x2580(){const _0x3395a3=['recorded','4921911JNHurj','\x20has\x20no\x20skills\x20map','present','.agents','home','\x20is\x20unreadable:\x20','404VgnUrJ','not-recorded','kind','find','6719840nZZTtb','utf8','absent','unverifiable','unusable','parse','4251tJQBrM','1206952jGmfkC','version','.skill-lock.json','14000nVYgdz','.claude','\x22\x20but\x20no\x20SKILL.md\x20was\x20found\x20in\x20known\x20layouts\x20','lockFile','object','865884eYhnSw','6nMOkzr','globalSkillsDirs','686830uUgwbu','88skrxcJ','\x20uses\x20unsupported\x20version\x20','skills','map','SKILL.md','includes'];a166_0x2580=function(){return _0x3395a3;};return a166_0x2580();}import{homedir}from'node:os';import{join}from'node:path';export const SKILL_LOCK_RELATIVE_PATH=join(a166_0x1d1c0f(0x155),a166_0x1d1c0f(0x165));export const GLOBAL_SKILLS_DIR_RELATIVE_PATHS=[join(a166_0x1d1c0f(0x155),a166_0x1d1c0f(0x14d)),join(a166_0x1d1c0f(0x167),'skills')];const SUPPORTED_LOCK_VERSIONS=[0x3];function readLockLookup(_0x559327,_0x42afe4){const _0x51136b=a166_0x1d1c0f;if(!existsSync(_0x559327))return{'kind':'not-recorded'};let _0x868ae0;try{_0x868ae0=JSON[_0x51136b(0x161)](readFileSync(_0x559327,_0x51136b(0x15d)));}catch(_0x57e4a4){return{'kind':_0x51136b(0x160),'reason':_0x559327+_0x51136b(0x157)+_0x57e4a4['message']};}const _0x19e92e=_0x868ae0;if(typeof _0x19e92e?.['version']!=='number'||!SUPPORTED_LOCK_VERSIONS[_0x51136b(0x150)](_0x19e92e[_0x51136b(0x164)]))return{'kind':'unusable','reason':_0x559327+_0x51136b(0x14c)+String(_0x19e92e?.[_0x51136b(0x164)])};if(!_0x19e92e[_0x51136b(0x14d)]||typeof _0x19e92e[_0x51136b(0x14d)]!==_0x51136b(0x16a))return{'kind':_0x51136b(0x160),'reason':_0x559327+_0x51136b(0x153)};return _0x19e92e['skills'][_0x42afe4]?{'kind':_0x51136b(0x151)}:{'kind':_0x51136b(0x159)};}export function resolveInstalledSkill(_0x2886be,_0x36bd7b){const _0x1e936f=a166_0x1d1c0f,_0x4511cb=_0x36bd7b?.[_0x1e936f(0x156)]??homedir(),_0x13dd9d=_0x36bd7b?.[_0x1e936f(0x149)]??GLOBAL_SKILLS_DIR_RELATIVE_PATHS[_0x1e936f(0x14e)](_0x375363=>join(_0x4511cb,_0x375363)),_0x256baf=_0x36bd7b?.[_0x1e936f(0x169)]??join(_0x4511cb,SKILL_LOCK_RELATIVE_PATH),_0x424f31=_0x13dd9d[_0x1e936f(0x14e)](_0x23143d=>join(_0x23143d,_0x2886be,_0x1e936f(0x14f))),_0x5a4ee7=_0x424f31[_0x1e936f(0x15b)](_0x28e3bf=>existsSync(_0x28e3bf));if(_0x5a4ee7)return{'state':_0x1e936f(0x154),'path':_0x5a4ee7};const _0x5d91a3=readLockLookup(_0x256baf,_0x2886be);if(_0x5d91a3[_0x1e936f(0x15a)]===_0x1e936f(0x160))return{'state':_0x1e936f(0x15f),'reason':_0x5d91a3['reason']};if(_0x5d91a3[_0x1e936f(0x15a)]===_0x1e936f(0x151))return{'state':'unverifiable','reason':_0x256baf+'\x20records\x20\x22'+_0x2886be+_0x1e936f(0x168)+('('+_0x424f31['join'](',\x20')+')')};return{'state':_0x1e936f(0x15e),'checked':_0x424f31};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a167_0x581f07=a167_0x4c8e;(function(_0x4030b1,_0x5fcd03){const _0x36649e=a167_0x4c8e,_0x3fac4b=_0x4030b1();while(!![]){try{const _0x29a940=-parseInt(_0x36649e(0xf5))/0x1*(-parseInt(_0x36649e(0xf4))/0x2)+parseInt(_0x36649e(0xf6))/0x3+parseInt(_0x36649e(0xfd))/0x4*(-parseInt(_0x36649e(0xfa))/0x5)+parseInt(_0x36649e(0xe8))/0x6+-parseInt(_0x36649e(0xee))/0x7+parseInt(_0x36649e(0xe7))/0x8*(parseInt(_0x36649e(0xf2))/0x9)+parseInt(_0x36649e(0xed))/0xa*(parseInt(_0x36649e(0xf8))/0xb);if(_0x29a940===_0x5fcd03)break;else _0x3fac4b['push'](_0x3fac4b['shift']());}catch(_0x467e99){_0x3fac4b['push'](_0x3fac4b['shift']());}}}(a167_0x5d9d,0x42770));const REDACTED_ACCESS_KEY=a167_0x581f07(0xfc);function a167_0x4c8e(_0x4e385c,_0x3a7812){_0x4e385c=_0x4e385c-0xe7;const _0x5d9d8c=a167_0x5d9d();let _0x4c8efb=_0x5d9d8c[_0x4e385c];return _0x4c8efb;}function a167_0x5d9d(){const _0x516f91=['fromEntries','55Nxhwvu','length','39110BzuFFx','isArray','<redacted>','232mkSeTZ','1016YabYIm','51900bciwJW','call','string','slice','object','1624650covNWv','1689618KkaXjS','apps','entries','accessKey','3816WfzcrM','test','18366xRhKah','9QljqCq','29460VAOmIf'];a167_0x5d9d=function(){return _0x516f91;};return a167_0x5d9d();}export function maskCliAccessKey(_0x560346){const _0x3a8b06=a167_0x581f07;if(typeof _0x560346!==_0x3a8b06(0xea)||_0x560346['length']<=0x8)return REDACTED_ACCESS_KEY;return''+_0x560346[_0x3a8b06(0xeb)](0x0,0x8)+'*'['repeat'](_0x560346[_0x3a8b06(0xf9)]-0x8);}export function redactCliConfigCredentials(_0x5bd30c){const _0x404737=a167_0x581f07,_0x14cb6b={..._0x5bd30c};return Object['prototype']['hasOwnProperty']['call'](_0x14cb6b,'accessKey')&&(_0x14cb6b[_0x404737(0xf1)]=maskCliAccessKey(_0x14cb6b[_0x404737(0xf1)])),_0x14cb6b[_0x404737(0xef)]&&typeof _0x14cb6b['apps']===_0x404737(0xec)&&!Array[_0x404737(0xfb)](_0x14cb6b[_0x404737(0xef)])&&(_0x14cb6b[_0x404737(0xef)]=redactLegacyAppCredentials(_0x14cb6b[_0x404737(0xef)])),_0x14cb6b;}export function redactCliConfigValue(_0x5861e2,_0x129606){const _0x17ca9e=a167_0x581f07;if(_0x5861e2==='accessKey'||/^apps\.[^.]+\.accessKey$/[_0x17ca9e(0xf3)](_0x5861e2))return maskCliAccessKey(_0x129606);if(_0x5861e2===_0x17ca9e(0xef)&&_0x129606&&typeof _0x129606===_0x17ca9e(0xec)&&!Array[_0x17ca9e(0xfb)](_0x129606))return redactLegacyAppCredentials(_0x129606);if(/^apps\.[^.]+$/[_0x17ca9e(0xf3)](_0x5861e2)&&_0x129606&&typeof _0x129606===_0x17ca9e(0xec)&&!Array[_0x17ca9e(0xfb)](_0x129606)){const _0x5e8f16=_0x129606;return Object['prototype']['hasOwnProperty']['call'](_0x5e8f16,_0x17ca9e(0xf1))?{..._0x5e8f16,'accessKey':maskCliAccessKey(_0x5e8f16[_0x17ca9e(0xf1)])}:_0x129606;}return _0x129606;}function redactLegacyAppCredentials(_0x4fec0a){const _0x2220ae=a167_0x581f07;return Object[_0x2220ae(0xf7)](Object[_0x2220ae(0xf0)](_0x4fec0a)['map'](([_0x43a54d,_0x23bc31])=>{const _0x43d1d9=_0x2220ae;if(!_0x23bc31||typeof _0x23bc31!==_0x43d1d9(0xec)||Array[_0x43d1d9(0xfb)](_0x23bc31))return[_0x43a54d,_0x23bc31];const _0x1a8bae={..._0x23bc31};return Object['prototype']['hasOwnProperty'][_0x43d1d9(0xe9)](_0x1a8bae,_0x43d1d9(0xf1))&&(_0x1a8bae[_0x43d1d9(0xf1)]=maskCliAccessKey(_0x1a8bae[_0x43d1d9(0xf1)])),[_0x43a54d,_0x1a8bae];}));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a168_0x1aef(){const _0x4a8402=['1727680UtRkSP','5gGKPgg','11bYrDJH','562956EbborM','3424690pHJFHy','1989211JLBRmj','24IrhWzh','18034qZZrAt','341040kaBdPc','4845087rbTAsQ','6raPOpG'];a168_0x1aef=function(){return _0x4a8402;};return a168_0x1aef();}(function(_0xd03ad5,_0x10d8df){const _0x462779=a168_0x4e3d,_0x4bb6df=_0xd03ad5();while(!![]){try{const _0x5231d3=-parseInt(_0x462779(0x1d2))/0x1+parseInt(_0x462779(0x1d1))/0x2*(-parseInt(_0x462779(0x1d4))/0x3)+parseInt(_0x462779(0x1d5))/0x4+parseInt(_0x462779(0x1d6))/0x5*(-parseInt(_0x462779(0x1d8))/0x6)+-parseInt(_0x462779(0x1cf))/0x7*(-parseInt(_0x462779(0x1d0))/0x8)+-parseInt(_0x462779(0x1d3))/0x9+parseInt(_0x462779(0x1d9))/0xa*(parseInt(_0x462779(0x1d7))/0xb);if(_0x5231d3===_0x10d8df)break;else _0x4bb6df['push'](_0x4bb6df['shift']());}catch(_0xcd017f){_0x4bb6df['push'](_0x4bb6df['shift']());}}}(a168_0x1aef,0x9b311));import{createJqFilter,resolveBundledJqPaths}from'@lovrabet/cli-framework';import{CliErrors}from'../errors.js';function a168_0x4e3d(_0x33c42a,_0x2d5bea){_0x33c42a=_0x33c42a-0x1cf;const _0x1aef16=a168_0x1aef();let _0x4e3d07=_0x1aef16[_0x33c42a];return _0x4e3d07;}export const applyJqFilter=createJqFilter(CliErrors,{'bundledJqPaths':resolveBundledJqPaths()});
|