@lovrabet/lovrabet-cli 2.2.4 → 2.2.5-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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/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/shared.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/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/risk.js +1 -1
- package/lib/constant/url.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.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/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/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.d.ts +7 -0
- 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.d.ts +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/utils/apply-jq-filter.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/platform.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.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
const a135_0x13a9e8=a135_0x4b53;(function(_0x436282,_0x54bc17){const _0x1beb12=a135_0x4b53,_0x41273d=_0x436282();while(!![]){try{const _0xc80151=parseInt(_0x1beb12(0x111))/0x1*(parseInt(_0x1beb12(0x121))/0x2)+-parseInt(_0x1beb12(0x120))/0x3+parseInt(_0x1beb12(0x122))/0x4+-parseInt(_0x1beb12(0x10c))/0x5+-parseInt(_0x1beb12(0x103))/0x6+parseInt(_0x1beb12(0x118))/0x7+-parseInt(_0x1beb12(0xfa))/0x8;if(_0xc80151===_0x54bc17)break;else _0x41273d['push'](_0x41273d['shift']());}catch(_0x185597){_0x41273d['push'](_0x41273d['shift']());}}}(a135_0xb090,0xafe4a));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import a135_0x32d561 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 a135_0x4b53(_0x4a252e,_0x11a101){_0x4a252e=_0x4a252e-0xf9;const _0xb090f7=a135_0xb090();let _0x4b53b6=_0xb090f7[_0x4a252e];return _0x4b53b6;}import{readMetadataIfPresent,requireSkillCode}from'./metadata.js';function a135_0xb090(){const _0x3aec4f=['metadata-mismatch','isSymbolicLink','has','4802064VYeczA','dir','linked-from-protected-root','Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20','metadataPath','company','project','env','appCode','5188008ggpKVo','filter','accessKey','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20','personal','startsWith','trim','set','updated','616505imSHgg','created','managedRoot','pruneSkillCodes','slice','209YjfjSz','builtin','name','skillRoots','skipped','push','activeSkillCodes','7341397ijdVxt','isDirectory','map','Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20','protectedLinkRoots','external-symlink','removed','Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20','2193807HljqKf','8734YhTIKF','4313920lBYIuy','contentHash','Refusing\x20to\x20copy\x20Skill\x20symlink:\x20','not-managed-symlink','secret-retriever','unchanged','scope','skillCode','Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20','skill','validation'];a135_0xb090=function(){return _0x3aec4f;};return a135_0xb090();}import{getRuntimeSkillCacheRoot,resolveSkillSyncPaths,safePathSegment}from'./paths.js';const {copySync,ensureDirSync,removeSync}=a135_0x32d561,RESERVED_PROJECT_SKILL_CODES=new Set(['lovrabet','runtime-observe',a135_0x13a9e8(0x126)]);export function linkEffectiveRuntimeSkills(_0x377ef5,_0xfa6712){const _0xda9bc=a135_0x13a9e8,_0x54a6c5=new Map();for(const _0x5cef29 of _0x377ef5){const _0x239fd2=_0x5cef29['skill']['skillCode'];if(!_0x239fd2)continue;const _0x2fa858=_0x54a6c5['get'](_0x239fd2);(!_0x2fa858||_0x5cef29[_0xda9bc(0x128)]===_0xda9bc(0x107))&&_0x54a6c5[_0xda9bc(0x10a)](_0x239fd2,_0x5cef29);}const _0x4b6362=[];for(const _0x2073ab of _0x54a6c5['values']()){const _0x2b75f3=requireSkillCode(_0x2073ab['skill']),_0x3eedee=readMetadataIfPresent(_0x2073ab[_0xda9bc(0xfe)]);if(_0x3eedee?.[_0xda9bc(0x102)]!==_0xfa6712[_0xda9bc(0x102)]||_0x3eedee['skillCode']!==_0x2b75f3)throw CliErrors[_0xda9bc(0x12c)](_0xda9bc(0x12a)+_0xfa6712[_0xda9bc(0x102)]+':\x20'+_0x2073ab[_0xda9bc(0xfe)]);const _0x137cb4=runtimeSkillLinkName(_0xfa6712,_0x2b75f3);for(const _0x56f2c5 of _0xfa6712[_0xda9bc(0x114)]){_0x4b6362[_0xda9bc(0x116)](ensureManagedSymlink(resolve(_0x56f2c5,_0x137cb4),_0x2073ab[_0xda9bc(0xfb)],_0xfa6712,_0x2b75f3));}}return _0x4b6362;}export function pruneStaleRuntimeSkillLinks(_0x2726ea,_0x42a85f,_0x495bfe){const _0xdfe205=a135_0x13a9e8,_0x312d72=new Set([..._0x42a85f]['map'](_0x57afb3=>_0x57afb3[_0xdfe205(0x109)]())['filter'](Boolean)),_0x45abe4=_0x495bfe?new Set([..._0x495bfe][_0xdfe205(0x11a)](_0x1eb019=>_0x1eb019['trim']())[_0xdfe205(0x104)](Boolean)):undefined,_0x280afe=[];for(const _0x55bf66 of _0x2726ea[_0xdfe205(0x114)]){for(const _0x37247c of managedTargetSkillLinkPaths(_0x55bf66,_0x2726ea)){const _0x310e6e=runtimeSkillCodeFromLink(_0x2726ea,_0x37247c);if(_0x45abe4&&!_0x45abe4[_0xdfe205(0xf9)](_0x310e6e))continue;if(_0x312d72[_0xdfe205(0xf9)](_0x310e6e))continue;_0x280afe[_0xdfe205(0x116)](removeManagedSkillLink(_0x37247c,_0x2726ea,_0x310e6e));}}return _0x280afe;}export function pruneStaleRuntimeSkillCache(_0x2c74d0,_0x456978={}){const _0x27f102=a135_0x13a9e8,_0x3b1d6c=new Set([..._0x2c74d0[_0x27f102(0x117)]][_0x27f102(0x11a)](_0x403166=>_0x403166[_0x27f102(0x109)]())['filter'](Boolean)),_0xab81ee=_0x2c74d0[_0x27f102(0x10f)]?new Set([..._0x2c74d0[_0x27f102(0x10f)]][_0x27f102(0x11a)](_0x26e4a2=>_0x26e4a2[_0x27f102(0x109)]())[_0x27f102(0x104)](Boolean)):undefined,_0x372434=_0x2c74d0['scopes']??[_0x27f102(0x107),_0x27f102(0xff)],_0x3b86cf=resolve(getRuntimeSkillCacheRoot(_0x2c74d0[_0x27f102(0x101)],_0x2c74d0[_0x27f102(0x105)],_0x456978),safePathSegment(_0x2c74d0['appCode'],_0x27f102(0x102))),_0x1ab120=[];for(const _0x3de43a of _0x372434){const _0x671e4a=resolve(_0x3b86cf,_0x3de43a);if(!existsSync(_0x671e4a))continue;for(const _0x14de7a of readdirSync(_0x671e4a,{'withFileTypes':!![]})){if(!_0x14de7a[_0x27f102(0x119)]())continue;const _0x4ab056=_0x14de7a[_0x27f102(0x113)];if(_0xab81ee&&!_0xab81ee['has'](_0x4ab056))continue;if(_0x3b1d6c[_0x27f102(0xf9)](_0x4ab056))continue;const _0x11b1cc=resolve(_0x671e4a,_0x4ab056),_0x29a3b1=readMetadataIfPresent(resolve(_0x11b1cc,METADATA_FILE));if(_0x29a3b1?.['appCode']!==_0x2c74d0[_0x27f102(0x102)]||_0x29a3b1['scope']!==_0x3de43a||_0x29a3b1[_0x27f102(0x129)]!==_0x4ab056){_0x1ab120[_0x27f102(0x116)]({'path':_0x11b1cc,'action':_0x27f102(0x115),'reason':_0x27f102(0x12d)});continue;}if(isLinkedFromAnyRoot(_0x11b1cc,_0x2c74d0[_0x27f102(0x11c)]??[])){_0x1ab120[_0x27f102(0x116)]({'path':_0x11b1cc,'action':'skipped','reason':_0x27f102(0xfc)});continue;}removeSync(_0x11b1cc),_0x1ab120[_0x27f102(0x116)]({'path':_0x11b1cc,'action':_0x27f102(0x11e)});}}return _0x1ab120;}export function linkGlobalRuntimeSkills(_0x1f96a2,_0x5eabf3={}){const _0x55de56=a135_0x13a9e8,_0xa0fb2c=resolveSkillSyncPaths(_0x5eabf3),_0x4239bb=[];for(const _0x153841 of _0x1f96a2){if(_0x153841['scope']!==_0x55de56(0x112))throw CliErrors[_0x55de56(0x12c)]('Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20'+_0x153841[_0x55de56(0x128)]);const _0x319fdf=requireSkillCode(_0x153841[_0x55de56(0x12b)]),_0x2bc776=copyManagedSkillDirectory(_0x153841[_0x55de56(0xfb)],resolve(_0xa0fb2c['agentsSkillsDir'],_0x319fdf));_0x4239bb[_0x55de56(0x116)]({..._0x2bc776,'contentHash':_0x153841['contentHash']});}return _0x4239bb;}function ensureManagedSymlink(_0x7adeef,_0x2b62c7,_0x518a07,_0x49bf1d){const _0x2deb67=a135_0x13a9e8;mkdirSync(dirname(_0x7adeef),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x7adeef)||isDanglingSymlink(_0x7adeef)){const _0x472f65=lstatSync(_0x7adeef);if(!_0x472f65[_0x2deb67(0x12e)]())throw CliErrors[_0x2deb67(0x12c)](_0x2deb67(0xfd)+_0x7adeef);const _0x17d8a7=resolveSymlinkTarget(_0x7adeef);if(!isPathInside(realOrResolved(_0x17d8a7),realOrResolved(_0x518a07['managedRoot'])))throw CliErrors[_0x2deb67(0x12c)](_0x2deb67(0x11f)+_0x7adeef);if(realOrResolved(_0x17d8a7)===realOrResolved(_0x2b62c7))return{'path':_0x7adeef,'target':_0x2b62c7,'action':_0x2deb67(0x127)};const _0x1ec7b9=readMetadataIfPresent(resolve(_0x17d8a7,METADATA_FILE));if(_0x518a07[_0x2deb67(0x128)]===_0x2deb67(0x100)&&(_0x1ec7b9?.[_0x2deb67(0x102)]!==_0x518a07['appCode']||_0x1ec7b9[_0x2deb67(0x129)]!==_0x49bf1d))throw CliErrors[_0x2deb67(0x12c)](_0x2deb67(0x11b)+_0x7adeef);return unlinkSync(_0x7adeef),symlinkSync(_0x2b62c7,_0x7adeef,'dir'),{'path':_0x7adeef,'target':_0x2b62c7,'action':_0x2deb67(0x10b)};}return symlinkSync(_0x2b62c7,_0x7adeef,_0x2deb67(0xfb)),{'path':_0x7adeef,'target':_0x2b62c7,'action':'created'};}function managedTargetSkillLinkPaths(_0x218317,_0x4580f6){const _0x3e3f77=a135_0x13a9e8;if(!existsSync(_0x218317))return[];const _0xfbe62b=_0x4580f6['appCode']+'--';return readdirSync(_0x218317,{'withFileTypes':!![]})[_0x3e3f77(0x104)](_0x30700a=>_0x4580f6[_0x3e3f77(0x128)]===_0x3e3f77(0x100)||_0x30700a[_0x3e3f77(0x113)][_0x3e3f77(0x108)](_0xfbe62b))[_0x3e3f77(0x11a)](_0x5378c9=>resolve(_0x218317,_0x5378c9[_0x3e3f77(0x113)]));}function removeManagedSkillLink(_0x5a43f1,_0x587bb8,_0xc92c7e){const _0x325aa4=a135_0x13a9e8,_0x1e2932=lstatIfPresent(_0x5a43f1);if(!_0x1e2932?.[_0x325aa4(0x12e)]())return{'path':_0x5a43f1,'action':_0x325aa4(0x115),'reason':_0x325aa4(0x125)};const _0x2cda2e=resolveSymlinkTarget(_0x5a43f1);if(!isPathInside(realOrResolved(_0x2cda2e),realOrResolved(_0x587bb8[_0x325aa4(0x10e)])))return{'path':_0x5a43f1,'action':'skipped','reason':_0x325aa4(0x11d)};const _0x448279=readMetadataIfPresent(resolve(_0x2cda2e,METADATA_FILE));if(_0x587bb8[_0x325aa4(0x128)]===_0x325aa4(0x100)&&(_0x448279?.['appCode']!==_0x587bb8[_0x325aa4(0x102)]||_0x448279[_0x325aa4(0x129)]!==_0xc92c7e))return{'path':_0x5a43f1,'action':'skipped','reason':'metadata-mismatch'};return unlinkSync(_0x5a43f1),{'path':_0x5a43f1,'action':'removed'};}function isLinkedFromAnyRoot(_0x4fc23e,_0x31a1ed){const _0x42bfec=a135_0x13a9e8,_0x1018ed=realOrResolved(_0x4fc23e);for(const _0x4b5ef6 of _0x31a1ed){if(!existsSync(_0x4b5ef6))continue;for(const _0x16b5fd of readdirSync(_0x4b5ef6,{'withFileTypes':!![]})){if(!_0x16b5fd[_0x42bfec(0x12e)]())continue;const _0x51eac6=resolve(_0x4b5ef6,_0x16b5fd['name']);if(realOrResolved(resolveSymlinkTarget(_0x51eac6))===_0x1018ed)return!![];}}return![];}function runtimeSkillLinkName(_0x53b1fc,_0x24ee17){const _0x13e0d8=a135_0x13a9e8,_0x10872a=safePathSegment(_0x24ee17,_0x13e0d8(0x129));if(_0x53b1fc[_0x13e0d8(0x128)]===_0x13e0d8(0x100)&&RESERVED_PROJECT_SKILL_CODES[_0x13e0d8(0xf9)](_0x10872a))throw CliErrors[_0x13e0d8(0x12c)]('Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20'+_0x10872a);return _0x53b1fc[_0x13e0d8(0x128)]===_0x13e0d8(0x100)?_0x10872a:_0x53b1fc[_0x13e0d8(0x102)]+'--'+_0x10872a;}function runtimeSkillCodeFromLink(_0x1f10e7,_0x2fa1b4){const _0x55ca80=a135_0x13a9e8,_0xaaeb29=basename(_0x2fa1b4);return _0x1f10e7[_0x55ca80(0x128)]===_0x55ca80(0x100)?_0xaaeb29:_0xaaeb29[_0x55ca80(0x110)]((_0x1f10e7[_0x55ca80(0x102)]+'--')['length']);}export function copyManagedSkillDirectory(_0x969c58,_0x173ac2){const _0x36c7aa=a135_0x13a9e8,_0x5d86b2=resolve(_0x173ac2,METADATA_FILE),_0x1aa550=existsSync(_0x173ac2);if(_0x1aa550){const _0x21f952=lstatSync(_0x173ac2);if(_0x21f952[_0x36c7aa(0x12e)]())throw CliErrors[_0x36c7aa(0x12c)]('Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20'+_0x173ac2);if(!_0x21f952[_0x36c7aa(0x119)]())throw CliErrors['validation']('Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20'+_0x173ac2);const _0xd34a10=readMetadataIfPresent(_0x5d86b2);if(_0xd34a10?.[_0x36c7aa(0x128)]!==_0x36c7aa(0x112))throw CliErrors[_0x36c7aa(0x12c)](_0x36c7aa(0x106)+_0x173ac2);}ensureDirSync(dirname(_0x173ac2));const _0x59486c=_0x1aa550?readMetadataIfPresent(_0x5d86b2)?.[_0x36c7aa(0x123)]:undefined,_0xc1864f=readMetadataIfPresent(resolve(_0x969c58,METADATA_FILE))?.['contentHash'];return _0x1aa550&&removeSync(_0x173ac2),copySkillDirectory(_0x969c58,_0x173ac2),{'path':_0x173ac2,'target':_0x969c58,'action':!_0x1aa550?_0x36c7aa(0x10d):_0x59486c===_0xc1864f?'unchanged':_0x36c7aa(0x10b)};}function copySkillDirectory(_0x122945,_0xcca6af){copySync(_0x122945,_0xcca6af,{'dereference':![],'overwrite':!![],'filter'(_0x368ce2){const _0x37cc98=a135_0x4b53;if(lstatSync(_0x368ce2)[_0x37cc98(0x12e)]())throw CliErrors[_0x37cc98(0x12c)](_0x37cc98(0x124)+_0x368ce2);return!![];}});}
|
|
1
|
+
const a135_0x5e7187=a135_0x218e;(function(_0x34bce0,_0x280657){const _0xa9fd6d=a135_0x218e,_0x4b4b03=_0x34bce0();while(!![]){try{const _0x29ee50=parseInt(_0xa9fd6d(0x12a))/0x1+-parseInt(_0xa9fd6d(0x12d))/0x2*(parseInt(_0xa9fd6d(0x145))/0x3)+parseInt(_0xa9fd6d(0x15b))/0x4*(-parseInt(_0xa9fd6d(0x147))/0x5)+parseInt(_0xa9fd6d(0x13d))/0x6*(-parseInt(_0xa9fd6d(0x130))/0x7)+-parseInt(_0xa9fd6d(0x13b))/0x8+parseInt(_0xa9fd6d(0x13f))/0x9+parseInt(_0xa9fd6d(0x13a))/0xa;if(_0x29ee50===_0x280657)break;else _0x4b4b03['push'](_0x4b4b03['shift']());}catch(_0x50495){_0x4b4b03['push'](_0x4b4b03['shift']());}}}(a135_0x1fb0,0x3dd94));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import a135_0x686360 from'fs-extra';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';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}=a135_0x686360,RESERVED_PROJECT_SKILL_CODES=new Set([a135_0x5e7187(0x139),a135_0x5e7187(0x129),'secret-retriever']);export function linkEffectiveRuntimeSkills(_0x5c197e,_0x13575b){const _0x3c5836=a135_0x5e7187,_0x4648cf=new Map();for(const _0x2b2450 of _0x5c197e){const _0x8750f=_0x2b2450[_0x3c5836(0x134)][_0x3c5836(0x12b)];if(!_0x8750f)continue;const _0x3dd299=_0x4648cf[_0x3c5836(0x156)](_0x8750f);(!_0x3dd299||_0x2b2450[_0x3c5836(0x128)]===_0x3c5836(0x148))&&_0x4648cf[_0x3c5836(0x14b)](_0x8750f,_0x2b2450);}const _0x1451e3=[];for(const _0xe4af5 of _0x4648cf[_0x3c5836(0x14e)]()){const _0x51249a=requireSkillCode(_0xe4af5[_0x3c5836(0x134)]),_0x258428=readMetadataIfPresent(_0xe4af5[_0x3c5836(0x13c)]);if(_0x258428?.[_0x3c5836(0x151)]!==_0x13575b['appCode']||_0x258428[_0x3c5836(0x12b)]!==_0x51249a)throw CliErrors[_0x3c5836(0x144)]('Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20'+_0x13575b[_0x3c5836(0x151)]+':\x20'+_0xe4af5[_0x3c5836(0x13c)]);const _0x49358c=runtimeSkillLinkName(_0x13575b,_0x51249a);for(const _0xbb02d1 of _0x13575b['skillRoots']){_0x1451e3[_0x3c5836(0x149)](ensureManagedSymlink(resolve(_0xbb02d1,_0x49358c),_0xe4af5[_0x3c5836(0x146)],_0x13575b,_0x51249a));}}return _0x1451e3;}export function pruneStaleRuntimeSkillLinks(_0x386ea6,_0x5b2940,_0x16a6cc){const _0x46cfcd=a135_0x5e7187,_0x454656=new Set([..._0x5b2940][_0x46cfcd(0x15a)](_0x134408=>_0x134408[_0x46cfcd(0x15c)]())[_0x46cfcd(0x154)](Boolean)),_0x587e8b=_0x16a6cc?new Set([..._0x16a6cc][_0x46cfcd(0x15a)](_0x475dff=>_0x475dff['trim']())['filter'](Boolean)):undefined,_0x368336=[];for(const _0x29584e of _0x386ea6[_0x46cfcd(0x14a)]){for(const _0x2d257e of managedTargetSkillLinkPaths(_0x29584e,_0x386ea6)){const _0x4b9eab=runtimeSkillCodeFromLink(_0x386ea6,_0x2d257e);if(_0x587e8b&&!_0x587e8b[_0x46cfcd(0x133)](_0x4b9eab))continue;if(_0x454656['has'](_0x4b9eab))continue;_0x368336[_0x46cfcd(0x149)](removeManagedSkillLink(_0x2d257e,_0x386ea6,_0x4b9eab));}}return _0x368336;}function a135_0x1fb0(){const _0x47efdf=['appCode','skipped','env','filter','isDirectory','get','managedRoot','scopes','updated','map','4QTBJkm','trim','Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20','linked-from-protected-root','accessKey','Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20','created','protectedLinkRoots','Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20','scope','runtime-observe','80149gEefgT','skillCode','startsWith','9242CZQfXS','length','Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20','14nMvhlp','project','name','has','skill','isSymbolicLink','removed','contentHash','company','lovrabet','6446740fEBpAP','46856kocHkG','metadataPath','854130GTSojc','Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20','555624XUUgPd','unchanged','Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','Refusing\x20to\x20copy\x20Skill\x20symlink:\x20','validation','9CjpbsQ','dir','1143985wyzDBl','personal','push','skillRoots','set','metadata-mismatch','builtin','values','activeSkillCodes','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20'];a135_0x1fb0=function(){return _0x47efdf;};return a135_0x1fb0();}export function pruneStaleRuntimeSkillCache(_0x74a69c,_0x345880={}){const _0x477199=a135_0x5e7187,_0x4da99f=new Set([..._0x74a69c[_0x477199(0x14f)]][_0x477199(0x15a)](_0x535c51=>_0x535c51['trim']())['filter'](Boolean)),_0x525082=_0x74a69c['pruneSkillCodes']?new Set([..._0x74a69c['pruneSkillCodes']][_0x477199(0x15a)](_0x1c25df=>_0x1c25df[_0x477199(0x15c)]())[_0x477199(0x154)](Boolean)):undefined,_0x152bfb=_0x74a69c[_0x477199(0x158)]??['personal',_0x477199(0x138)],_0x1bc035=resolve(getRuntimeSkillCacheRoot(_0x74a69c[_0x477199(0x153)],_0x74a69c[_0x477199(0x15f)],_0x345880),safePathSegment(_0x74a69c[_0x477199(0x151)],_0x477199(0x151))),_0x259c73=[];for(const _0x24d54b of _0x152bfb){const _0x41fcf0=resolve(_0x1bc035,_0x24d54b);if(!existsSync(_0x41fcf0))continue;for(const _0x5286fc of readdirSync(_0x41fcf0,{'withFileTypes':!![]})){if(!_0x5286fc[_0x477199(0x155)]())continue;const _0x26d621=_0x5286fc['name'];if(_0x525082&&!_0x525082[_0x477199(0x133)](_0x26d621))continue;if(_0x4da99f['has'](_0x26d621))continue;const _0x367ea0=resolve(_0x41fcf0,_0x26d621),_0x318763=readMetadataIfPresent(resolve(_0x367ea0,METADATA_FILE));if(_0x318763?.[_0x477199(0x151)]!==_0x74a69c[_0x477199(0x151)]||_0x318763['scope']!==_0x24d54b||_0x318763[_0x477199(0x12b)]!==_0x26d621){_0x259c73[_0x477199(0x149)]({'path':_0x367ea0,'action':'skipped','reason':_0x477199(0x14c)});continue;}if(isLinkedFromAnyRoot(_0x367ea0,_0x74a69c[_0x477199(0x126)]??[])){_0x259c73['push']({'path':_0x367ea0,'action':_0x477199(0x152),'reason':_0x477199(0x15e)});continue;}removeSync(_0x367ea0),_0x259c73[_0x477199(0x149)]({'path':_0x367ea0,'action':'removed'});}}return _0x259c73;}function a135_0x218e(_0x41aaf7,_0x348e51){_0x41aaf7=_0x41aaf7-0x124;const _0x1fb00b=a135_0x1fb0();let _0x218e29=_0x1fb00b[_0x41aaf7];return _0x218e29;}export function linkGlobalRuntimeSkills(_0x49433d,_0x265134={}){const _0xb000d6=a135_0x5e7187,_0x50bfb8=resolveSkillSyncPaths(_0x265134),_0x33c26e=[];for(const _0x14ed78 of _0x49433d){if(_0x14ed78[_0xb000d6(0x128)]!==_0xb000d6(0x14d))throw CliErrors[_0xb000d6(0x144)](_0xb000d6(0x142)+_0x14ed78[_0xb000d6(0x128)]);const _0x36e701=requireSkillCode(_0x14ed78['skill']),_0x3a2d03=copyManagedSkillDirectory(_0x14ed78[_0xb000d6(0x146)],resolve(_0x50bfb8['agentsSkillsDir'],_0x36e701));_0x33c26e[_0xb000d6(0x149)]({..._0x3a2d03,'contentHash':_0x14ed78[_0xb000d6(0x137)]});}return _0x33c26e;}function ensureManagedSymlink(_0x44db1d,_0xc59045,_0x30016b,_0x10174f){const _0x1e9bd7=a135_0x5e7187;mkdirSync(dirname(_0x44db1d),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x44db1d)||isDanglingSymlink(_0x44db1d)){const _0x3f0004=lstatSync(_0x44db1d);if(!_0x3f0004[_0x1e9bd7(0x135)]())throw CliErrors[_0x1e9bd7(0x144)](_0x1e9bd7(0x13e)+_0x44db1d);const _0x32e51b=resolveSymlinkTarget(_0x44db1d);if(!isPathInside(realOrResolved(_0x32e51b),realOrResolved(_0x30016b[_0x1e9bd7(0x157)])))throw CliErrors[_0x1e9bd7(0x144)](_0x1e9bd7(0x12f)+_0x44db1d);if(realOrResolved(_0x32e51b)===realOrResolved(_0xc59045))return{'path':_0x44db1d,'target':_0xc59045,'action':'unchanged'};const _0x5d4340=readMetadataIfPresent(resolve(_0x32e51b,METADATA_FILE));if(_0x30016b[_0x1e9bd7(0x128)]===_0x1e9bd7(0x131)&&(_0x5d4340?.['appCode']!==_0x30016b[_0x1e9bd7(0x151)]||_0x5d4340[_0x1e9bd7(0x12b)]!==_0x10174f))throw CliErrors[_0x1e9bd7(0x144)](_0x1e9bd7(0x15d)+_0x44db1d);return unlinkSync(_0x44db1d),symlinkSync(_0xc59045,_0x44db1d,_0x1e9bd7(0x146)),{'path':_0x44db1d,'target':_0xc59045,'action':_0x1e9bd7(0x159)};}return symlinkSync(_0xc59045,_0x44db1d,_0x1e9bd7(0x146)),{'path':_0x44db1d,'target':_0xc59045,'action':_0x1e9bd7(0x125)};}function managedTargetSkillLinkPaths(_0x5b86f8,_0x3911d4){const _0x2d8679=a135_0x5e7187;if(!existsSync(_0x5b86f8))return[];const _0x3ae699=_0x3911d4[_0x2d8679(0x151)]+'--';return readdirSync(_0x5b86f8,{'withFileTypes':!![]})[_0x2d8679(0x154)](_0x3e5a45=>_0x3911d4[_0x2d8679(0x128)]==='project'||_0x3e5a45[_0x2d8679(0x132)][_0x2d8679(0x12c)](_0x3ae699))[_0x2d8679(0x15a)](_0x5a08f0=>resolve(_0x5b86f8,_0x5a08f0[_0x2d8679(0x132)]));}function removeManagedSkillLink(_0xdb0ac9,_0x4031a5,_0x266d5a){const _0x40e021=a135_0x5e7187,_0x2b41dd=lstatIfPresent(_0xdb0ac9);if(!_0x2b41dd?.[_0x40e021(0x135)]())return{'path':_0xdb0ac9,'action':_0x40e021(0x152),'reason':'not-managed-symlink'};const _0x9ee880=resolveSymlinkTarget(_0xdb0ac9);if(!isPathInside(realOrResolved(_0x9ee880),realOrResolved(_0x4031a5[_0x40e021(0x157)])))return{'path':_0xdb0ac9,'action':_0x40e021(0x152),'reason':'external-symlink'};const _0x4da84d=readMetadataIfPresent(resolve(_0x9ee880,METADATA_FILE));if(_0x4031a5[_0x40e021(0x128)]==='project'&&(_0x4da84d?.[_0x40e021(0x151)]!==_0x4031a5[_0x40e021(0x151)]||_0x4da84d['skillCode']!==_0x266d5a))return{'path':_0xdb0ac9,'action':'skipped','reason':_0x40e021(0x14c)};return unlinkSync(_0xdb0ac9),{'path':_0xdb0ac9,'action':_0x40e021(0x136)};}function isLinkedFromAnyRoot(_0x33cd6b,_0x5bf4a9){const _0x428337=a135_0x5e7187,_0x266505=realOrResolved(_0x33cd6b);for(const _0x297554 of _0x5bf4a9){if(!existsSync(_0x297554))continue;for(const _0x153c84 of readdirSync(_0x297554,{'withFileTypes':!![]})){if(!_0x153c84[_0x428337(0x135)]())continue;const _0x307999=resolve(_0x297554,_0x153c84[_0x428337(0x132)]);if(realOrResolved(resolveSymlinkTarget(_0x307999))===_0x266505)return!![];}}return![];}function runtimeSkillLinkName(_0x49ceea,_0x5990f5){const _0x432404=a135_0x5e7187,_0x2f34ee=safePathSegment(_0x5990f5,_0x432404(0x12b));if(_0x49ceea[_0x432404(0x128)]===_0x432404(0x131)&&RESERVED_PROJECT_SKILL_CODES[_0x432404(0x133)](_0x2f34ee))throw CliErrors[_0x432404(0x144)](_0x432404(0x127)+_0x2f34ee);return _0x49ceea[_0x432404(0x128)]===_0x432404(0x131)?_0x2f34ee:_0x49ceea[_0x432404(0x151)]+'--'+_0x2f34ee;}function runtimeSkillCodeFromLink(_0x57b135,_0x5c8512){const _0xd1546c=a135_0x5e7187,_0x2a0dab=basename(_0x5c8512);return _0x57b135[_0xd1546c(0x128)]===_0xd1546c(0x131)?_0x2a0dab:_0x2a0dab['slice']((_0x57b135[_0xd1546c(0x151)]+'--')[_0xd1546c(0x12e)]);}export function copyManagedSkillDirectory(_0x46cf4a,_0x479854){const _0x50b662=a135_0x5e7187,_0x2a9652=resolve(_0x479854,METADATA_FILE),_0x56612d=existsSync(_0x479854);if(_0x56612d){const _0x38cdc4=lstatSync(_0x479854);if(_0x38cdc4[_0x50b662(0x135)]())throw CliErrors['validation'](_0x50b662(0x124)+_0x479854);if(!_0x38cdc4['isDirectory']())throw CliErrors[_0x50b662(0x144)](_0x50b662(0x141)+_0x479854);const _0x1369e9=readMetadataIfPresent(_0x2a9652);if(_0x1369e9?.[_0x50b662(0x128)]!==_0x50b662(0x14d))throw CliErrors[_0x50b662(0x144)](_0x50b662(0x150)+_0x479854);}ensureDirSync(dirname(_0x479854));const _0x39e0ba=_0x56612d?readMetadataIfPresent(_0x2a9652)?.[_0x50b662(0x137)]:undefined,_0x3c5933=readMetadataIfPresent(resolve(_0x46cf4a,METADATA_FILE))?.[_0x50b662(0x137)];return _0x56612d&&removeSync(_0x479854),copySkillDirectory(_0x46cf4a,_0x479854),{'path':_0x479854,'target':_0x46cf4a,'action':!_0x56612d?_0x50b662(0x125):_0x39e0ba===_0x3c5933?_0x50b662(0x140):_0x50b662(0x159)};}function copySkillDirectory(_0x34cda4,_0x2904a0){copySync(_0x34cda4,_0x2904a0,{'dereference':![],'overwrite':!![],'filter'(_0x547ddb){const _0x5406a6=a135_0x218e;if(lstatSync(_0x547ddb)[_0x5406a6(0x135)]())throw CliErrors[_0x5406a6(0x144)](_0x5406a6(0x143)+_0x547ddb);return!![];}});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x554f80,_0x2b3918){const _0x4842d6=a136_0x5266,_0x317d93=_0x554f80();while(!![]){try{const _0x1adfff=parseInt(_0x4842d6(0xac))/0x1*(parseInt(_0x4842d6(0x93))/0x2)+-parseInt(_0x4842d6(0x9d))/0x3*(-parseInt(_0x4842d6(0xbd))/0x4)+parseInt(_0x4842d6(0xa8))/0x5+parseInt(_0x4842d6(0x94))/0x6+parseInt(_0x4842d6(0xb6))/0x7+-parseInt(_0x4842d6(0xbb))/0x8*(-parseInt(_0x4842d6(0xaa))/0x9)+-parseInt(_0x4842d6(0x95))/0xa;if(_0x1adfff===_0x2b3918)break;else _0x317d93['push'](_0x317d93['shift']());}catch(_0x583f35){_0x317d93['push'](_0x317d93['shift']());}}}(a136_0x8332,0xe9da0));import{existsSync,readdirSync}from'node:fs';function a136_0x5266(_0x1edb91,_0x5d8f68){_0x1edb91=_0x1edb91-0x90;const _0x83321d=a136_0x8332();let _0x5266d1=_0x83321d[_0x1edb91];return _0x5266d1;}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';import{isRuntimeSkillScope,normalizeRuntimeSkillScopes}from'./scopes.js';function a136_0x8332(){const _0x54a869=['push','filter','10906196LfGdbj','has','linkedPaths','isArray','link','2319920yMjrpc','env','528124TemDXQ','validation','includes','tags','map','isDirectory','2846962HFbjyX','7550256MXBtGP','71005240GLUsmg','code','cacheDir','accessKey','trim','\x20!=\x20','startsWith','builtin','27rugLpQ','get','appCode','scopes','set','scope','Runtime\x20Skill\x20install\x20target\x20app\x20mismatch:\x20','values','name','from','dir','8801230GrfepY','isSymbolicLink','27CJbANQ','cache','1uUPLyH','linkedPath','localeCompare','project','skillCode','source','sort','skillRoots'];a136_0x8332=function(){return _0x54a869;};return a136_0x8332();}export function listLocalRuntimeSkills(_0x42830c,_0x401a41,_0x33124c={}){const _0x50d701=a136_0x5266,_0x556d97=safePathSegment(_0x42830c[_0x50d701(0x9f)],'appCode');if(_0x401a41[_0x50d701(0x9f)]!==_0x556d97)throw CliErrors[_0x50d701(0xbe)](_0x50d701(0xa3)+_0x401a41[_0x50d701(0x9f)]+_0x50d701(0x9a)+_0x556d97);const _0x5c3e2b=normalizeRuntimeSkillScopes(_0x42830c[_0x50d701(0xa0)]),_0x1a66fc=new Set(_0x5c3e2b),_0x3b5e28=_0x42830c[_0x50d701(0x96)]?.[_0x50d701(0x99)](),_0x22678a=new Map(),_0x5a7b39=resolve(getRuntimeSkillCacheRoot(_0x42830c[_0x50d701(0xbc)],_0x42830c[_0x50d701(0x98)],_0x33124c),_0x556d97);for(const _0x50b6ca of _0x5c3e2b){for(const _0x10418d of localSkillEntryDirs(resolve(_0x5a7b39,_0x50b6ca))){collectLocalRuntimeSkill(_0x22678a,_0x10418d,{'appCode':_0x556d97,'scopes':_0x1a66fc,'code':_0x3b5e28,'source':'cache'});}}for(const _0xeea6c5 of _0x401a41[_0x50d701(0xb3)]){for(const _0x42e79b of localSkillLinkCandidates(_0xeea6c5,_0x401a41,_0x1a66fc)){collectLocalRuntimeSkill(_0x22678a,_0x42e79b,{'appCode':_0x556d97,'scopes':_0x1a66fc,'code':_0x3b5e28,'source':_0x50d701(0xba),'linkedPath':_0x42e79b});}}return Array[_0x50d701(0xa6)](_0x22678a[_0x50d701(0xa4)]())[_0x50d701(0xb2)](compareLocalRuntimeSkills);}function localSkillEntryDirs(_0x2a6efd){const _0x48edc2=a136_0x5266;if(!existsSync(_0x2a6efd))return[];return readdirSync(_0x2a6efd,{'withFileTypes':!![]})['filter'](_0x39c493=>_0x39c493[_0x48edc2(0x92)]()||_0x39c493['isSymbolicLink']())[_0x48edc2(0x91)](_0x1f2d87=>resolve(_0x2a6efd,_0x1f2d87[_0x48edc2(0xa5)]));}function localSkillLinkCandidates(_0x13ae17,_0x5610f6,_0x58f135){const _0x2da995=a136_0x5266;if(!existsSync(_0x13ae17))return[];const _0x29dbb5=_0x5610f6[_0x2da995(0x9f)]+'--';return readdirSync(_0x13ae17,{'withFileTypes':!![]})[_0x2da995(0xb5)](_0x263a92=>_0x263a92['isDirectory']()||_0x263a92[_0x2da995(0xa9)]())[_0x2da995(0xb5)](_0x1aca9d=>_0x5610f6[_0x2da995(0xa2)]===_0x2da995(0xaf)||_0x1aca9d['name'][_0x2da995(0x9b)](_0x29dbb5)||_0x58f135[_0x2da995(0xb7)](_0x2da995(0x9c)))[_0x2da995(0x91)](_0x1f16dc=>resolve(_0x13ae17,_0x1f16dc[_0x2da995(0xa5)]));}function collectLocalRuntimeSkill(_0x3c2fc9,_0x5da805,_0x2fd770){const _0x2eb86c=a136_0x5266,_0x3b0f21=resolve(_0x5da805,METADATA_FILE),_0x3394d1=readMetadataIfPresent(_0x3b0f21);if(!_0x3394d1)return;if(_0x3394d1[_0x2eb86c(0x9f)]!==_0x2fd770[_0x2eb86c(0x9f)])return;if(!isRuntimeSkillScope(_0x3394d1[_0x2eb86c(0xa2)])||!_0x2fd770[_0x2eb86c(0xa0)][_0x2eb86c(0xb7)](_0x3394d1[_0x2eb86c(0xa2)]))return;const _0x24e4d5=_0x3394d1['skillCode']?.[_0x2eb86c(0x99)]();if(!_0x24e4d5)return;if(_0x2fd770[_0x2eb86c(0x96)]&&_0x24e4d5!==_0x2fd770[_0x2eb86c(0x96)])return;const _0x59dbd9=_0x3394d1[_0x2eb86c(0xa2)]+':'+_0x24e4d5,_0x2177bc=_0x2fd770[_0x2eb86c(0xad)]?[_0x2fd770['linkedPath']]:[],_0x371f51=_0x3c2fc9[_0x2eb86c(0x9e)](_0x59dbd9);if(_0x371f51){_0x2fd770[_0x2eb86c(0xb1)]===_0x2eb86c(0xab)&&(_0x371f51[_0x2eb86c(0xa7)]=_0x5da805,_0x371f51[_0x2eb86c(0x97)]=_0x5da805,_0x371f51['skillMdPath']=resolve(_0x5da805,SKILL_FILE),_0x371f51['metadataPath']=_0x3b0f21);for(const _0x375628 of _0x2177bc){!_0x371f51[_0x2eb86c(0xb8)][_0x2eb86c(0xbf)](_0x375628)&&_0x371f51[_0x2eb86c(0xb8)][_0x2eb86c(0xb4)](_0x375628);}_0x371f51[_0x2eb86c(0xb8)]['sort']();return;}_0x3c2fc9[_0x2eb86c(0xa1)](_0x59dbd9,{..._0x3394d1,'tags':Array[_0x2eb86c(0xb9)](_0x3394d1['tags'])?_0x3394d1[_0x2eb86c(0x90)]:[],'scope':_0x3394d1['scope'],'source':'local','dir':_0x5da805,'cacheDir':_0x2fd770[_0x2eb86c(0xb1)]==='cache'?_0x5da805:undefined,'skillMdPath':resolve(_0x5da805,SKILL_FILE),'metadataPath':_0x3b0f21,'linkedPaths':_0x2177bc});}function compareLocalRuntimeSkills(_0x31440a,_0x4fbf23){const _0x5a7aa4=a136_0x5266,_0x7e1d95={'personal':0x0,'company':0x1,'builtin':0x2};return _0x7e1d95[_0x31440a[_0x5a7aa4(0xa2)]]-_0x7e1d95[_0x4fbf23[_0x5a7aa4(0xa2)]]||_0x31440a['skillCode'][_0x5a7aa4(0xae)](_0x4fbf23[_0x5a7aa4(0xb0)])||_0x31440a[_0x5a7aa4(0xa7)]['localeCompare'](_0x4fbf23[_0x5a7aa4(0xa7)]);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x25efcb,_0x586fdc){const _0x4399a0=a137_0x1343,_0x343d65=_0x25efcb();while(!![]){try{const _0x53e7bc=-parseInt(_0x4399a0(0xa2))/0x1+parseInt(_0x4399a0(0xa7))/0x2+-parseInt(_0x4399a0(0x93))/0x3*(parseInt(_0x4399a0(0x9e))/0x4)+-parseInt(_0x4399a0(0x88))/0x5*(parseInt(_0x4399a0(0x85))/0x6)+parseInt(_0x4399a0(0xa0))/0x7+parseInt(_0x4399a0(0x8b))/0x8*(-parseInt(_0x4399a0(0x8d))/0x9)+parseInt(_0x4399a0(0xa5))/0xa;if(_0x53e7bc===_0x586fdc)break;else _0x343d65['push'](_0x343d65['shift']());}catch(_0xaf832b){_0x343d65['push'](_0x343d65['shift']());}}}(a137_0x128c,0xdba8b));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(_0x19f815){const _0x25c4fd=a137_0x1343;return _0x19f815[_0x25c4fd(0xa6)]??Buffer[_0x25c4fd(0x9b)](_0x19f815['content']??'',_0x25c4fd(0x95));}export function fileText(_0x1a8f72){const _0x28ea52=a137_0x1343;return fileContent(_0x1a8f72)[_0x28ea52(0xa4)](_0x28ea52(0x95));}export function normalizeLocalFiles(_0x5170d3){const _0x5adb1d=a137_0x1343;if(!Array[_0x5adb1d(0x9d)](_0x5170d3)||_0x5170d3['length']===0x0)return[];const _0x1e3cd2=new Map();for(const _0x3ed8f2 of _0x5170d3){if(!_0x3ed8f2||typeof _0x3ed8f2!==_0x5adb1d(0x98)||typeof _0x3ed8f2['path']!=='string')throw CliErrors[_0x5adb1d(0x97)](_0x5adb1d(0x94));const _0x4b768f=normalizeSkillRelativePath(_0x3ed8f2[_0x5adb1d(0x7c)]);if(_0x1e3cd2[_0x5adb1d(0x80)](_0x4b768f))throw CliErrors[_0x5adb1d(0x97)](_0x5adb1d(0x7e)+_0x4b768f);if(_0x3ed8f2[_0x5adb1d(0xa6)]!==undefined&&!Buffer[_0x5adb1d(0x8e)](_0x3ed8f2[_0x5adb1d(0xa6)]))throw CliErrors[_0x5adb1d(0x97)]('Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20'+_0x4b768f);if(_0x3ed8f2['bytes']===undefined&&typeof _0x3ed8f2[_0x5adb1d(0xa9)]!==_0x5adb1d(0x8a))throw CliErrors[_0x5adb1d(0x97)]('Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20'+_0x4b768f);const _0x658858=fileContent(_0x3ed8f2);_0x1e3cd2[_0x5adb1d(0x92)](_0x4b768f,{'path':_0x4b768f,'bytes':_0x658858});}return Array[_0x5adb1d(0x9b)](_0x1e3cd2[_0x5adb1d(0x9c)]())[_0x5adb1d(0x8f)](compareSkillFiles);}export function normalizeManifestFiles(_0x1956aa){const _0x5977d8=a137_0x1343;if(!Array[_0x5977d8(0x9d)](_0x1956aa)||_0x1956aa[_0x5977d8(0x7d)]===0x0)return[];const _0x51e230=new Map();for(const _0x16790c of _0x1956aa){if(!_0x16790c||typeof _0x16790c!==_0x5977d8(0x98)||typeof _0x16790c[_0x5977d8(0x7c)]!==_0x5977d8(0x8a))throw CliErrors[_0x5977d8(0x97)]('Skill\x20file\x20path\x20must\x20be\x20text.');const _0x53ce36=normalizeSkillRelativePath(_0x16790c[_0x5977d8(0x7c)]);if(_0x51e230[_0x5977d8(0x80)](_0x53ce36))throw CliErrors[_0x5977d8(0x97)](_0x5977d8(0x7e)+_0x53ce36);if(!isSha256Hex(_0x16790c[_0x5977d8(0xa1)]))throw CliErrors[_0x5977d8(0x97)](_0x5977d8(0xa8)+_0x53ce36);if(!Number[_0x5977d8(0xa3)](_0x16790c[_0x5977d8(0x8c)])||_0x16790c['size']<0x0)throw CliErrors[_0x5977d8(0x97)](_0x5977d8(0x89)+_0x53ce36);_0x51e230['set'](_0x53ce36,{'path':_0x53ce36,'sha256':_0x16790c[_0x5977d8(0xa1)][_0x5977d8(0x87)](),'size':_0x16790c[_0x5977d8(0x8c)]});}return Array['from'](_0x51e230[_0x5977d8(0x9c)]())[_0x5977d8(0x8f)](compareSkillFiles);}export function scanSkillDirectory(_0x45db7d,_0x19fd6a={}){const _0x54749b=a137_0x1343,_0x8b5772=realpathSync(_0x45db7d),_0x31e9ad=canonicalExcludedFilePaths(_0x19fd6a[_0x54749b(0x84)]),_0x595a4a=[];function _0x3b040d(_0x4e4cb0){const _0xe1b38b=_0x54749b,_0x5daeb5=readdirSync(_0x4e4cb0,{'withFileTypes':!![]})[_0xe1b38b(0x8f)]((_0x877a69,_0x71f191)=>_0x877a69[_0xe1b38b(0x86)]['localeCompare'](_0x71f191[_0xe1b38b(0x86)]));for(const _0x2e6130 of _0x5daeb5){if(_0x2e6130[_0xe1b38b(0x7f)]()&&IGNORED_DIR_NAMES[_0xe1b38b(0x80)](_0x2e6130[_0xe1b38b(0x86)]))continue;if(IGNORED_FILE_NAMES[_0xe1b38b(0x80)](_0x2e6130[_0xe1b38b(0x86)]))continue;const _0x302463=resolve(_0x4e4cb0,_0x2e6130['name']);if(isExcludedFilePath(_0x302463,_0x31e9ad))continue;if(_0x2e6130['isSymbolicLink']())throw CliErrors[_0xe1b38b(0x97)](_0xe1b38b(0x9a)+_0x302463);const _0x1498d4=toPosixPath(relative(_0x8b5772,_0x302463));if(_0x2e6130['isDirectory']()){_0x3b040d(_0x302463);continue;}if(!_0x2e6130[_0xe1b38b(0x96)]())continue;validateSkillRelativePath(_0x1498d4);const _0x3717eb=readFileSync(_0x302463);_0x595a4a[_0xe1b38b(0x90)]({'path':_0x1498d4,'bytes':_0x3717eb});}}return _0x3b040d(_0x8b5772),normalizeLocalFiles(_0x595a4a);}function canonicalExcludedFilePaths(_0x2614c0){const _0x478958=a137_0x1343,_0x3d7c92=new Set();for(const _0x2648d3 of _0x2614c0??[]){const _0x45cc04=resolve(_0x2648d3);_0x3d7c92[_0x478958(0x82)](_0x45cc04);try{_0x3d7c92[_0x478958(0x82)](realpathSync(_0x45cc04));}catch{}}return _0x3d7c92;}function a137_0x1343(_0x109053,_0x996349){_0x109053=_0x109053-0x7b;const _0x128c80=a137_0x128c();let _0x13438f=_0x128c80[_0x109053];return _0x13438f;}function isExcludedFilePath(_0x2cbb80,_0x9db0d9){const _0xcff0a3=a137_0x1343;if(_0x9db0d9[_0xcff0a3(0x80)](_0x2cbb80))return!![];if(_0x9db0d9[_0xcff0a3(0x8c)]===0x0)return![];try{return _0x9db0d9[_0xcff0a3(0x80)](realpathSync(_0x2cbb80));}catch{return![];}}export function compareSkillFiles(_0x5a9afc,_0x124ead){const _0x1f07be=a137_0x1343;if(_0x5a9afc['path']===SKILL_FILE)return _0x124ead[_0x1f07be(0x7c)]===SKILL_FILE?0x0:-0x1;if(_0x124ead[_0x1f07be(0x7c)]===SKILL_FILE)return 0x1;return Buffer[_0x1f07be(0x99)](Buffer['from'](_0x5a9afc['path'],'utf8'),Buffer[_0x1f07be(0x9b)](_0x124ead['path'],_0x1f07be(0x95)));}function a137_0x128c(){const _0x514428=['string','1683496UMyOvv','size','9bjilhz','isBuffer','sort','push','Unsafe\x20Skill\x20file\x20path:\x20','set','368931himmJX','Skill\x20file\x20path\x20must\x20be\x20text.','utf8','isFile','validation','object','compare','Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20','from','values','isArray','24SScpgK','startsWith','3838198kelyWX','sha256','1659449ZxbOlw','isSafeInteger','toString','28149720FXpsNe','bytes','2321422ZaKpRc','Skill\x20file\x20sha256\x20is\x20invalid:\x20','content','replace','path','length','Duplicate\x20Skill\x20file\x20path:\x20','isDirectory','has','includes','add','split','excludedFilePaths','126pbCPLg','name','toLowerCase','242030eakeUH','Skill\x20file\x20size\x20is\x20invalid:\x20'];a137_0x128c=function(){return _0x514428;};return a137_0x128c();}export function normalizeSkillRelativePath(_0x430fec){const _0x31bd02=toPosixPath(_0x430fec['trim']());return validateSkillRelativePath(_0x31bd02),_0x31bd02;}export function validateSkillRelativePath(_0x26eff6){const _0x180502=a137_0x1343;if(!_0x26eff6||_0x26eff6[_0x180502(0x9f)]('/')||_0x26eff6[_0x180502(0x81)]('//'))throw CliErrors[_0x180502(0x97)](_0x180502(0x91)+_0x26eff6);for(const _0x540211 of _0x26eff6[_0x180502(0x83)]('/')){if(!_0x540211||_0x540211==='.'||_0x540211==='..')throw CliErrors[_0x180502(0x97)](_0x180502(0x91)+_0x26eff6);}}export function toPosixPath(_0x3841b7){const _0x56a30c=a137_0x1343;return _0x3841b7[_0x56a30c(0x7b)](/\\/g,'/');}export function isSha256Hex(_0x54b8f0){const _0x4ec534=a137_0x1343;return typeof _0x54b8f0===_0x4ec534(0x8a)&&/^[a-fA-F0-9]{64}$/['test'](_0x54b8f0);}
|
|
@@ -9,3 +9,10 @@ export declare function materializeRuntimeSkill(skill: RuntimeSkillItem, scope:
|
|
|
9
9
|
force?: boolean;
|
|
10
10
|
packageBytes?: Buffer;
|
|
11
11
|
}): MaterializedRuntimeSkill;
|
|
12
|
+
/** Reuses an intact immutable remote version without downloading its package again. */
|
|
13
|
+
export declare function reuseMaterializedRuntimeSkill(skill: RuntimeSkillItem, scope: RuntimeSkillScope, options: {
|
|
14
|
+
env: "production" | "development" | "daily";
|
|
15
|
+
accessKey: string;
|
|
16
|
+
appCode: string;
|
|
17
|
+
paths?: SkillSyncPathsOptions;
|
|
18
|
+
}): MaterializedRuntimeSkill | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x2d95d5,_0x523ca6){const _0x39e3c2=a138_0x458b,_0x29e274=_0x2d95d5();while(!![]){try{const _0xa8b2b=-parseInt(_0x39e3c2(0xfd))/0x1+parseInt(_0x39e3c2(0xf3))/0x2*(parseInt(_0x39e3c2(0xef))/0x3)+parseInt(_0x39e3c2(0xe4))/0x4*(-parseInt(_0x39e3c2(0xfc))/0x5)+parseInt(_0x39e3c2(0x104))/0x6+-parseInt(_0x39e3c2(0xdf))/0x7+-parseInt(_0x39e3c2(0x10a))/0x8*(parseInt(_0x39e3c2(0xf6))/0x9)+parseInt(_0x39e3c2(0xf9))/0xa*(parseInt(_0x39e3c2(0xe1))/0xb);if(_0xa8b2b===_0x523ca6)break;else _0x29e274['push'](_0x29e274['shift']());}catch(_0x5dcef5){_0x29e274['push'](_0x29e274['shift']());}}}(a138_0x2111,0x59923));import{existsSync,lstatSync,mkdirSync,readFileSync,rmSync}from'node:fs';function a138_0x2111(){const _0x166ed6=['459504WHgGNk','skillName','utf8','20SfHflt','path','appCode','25985eUlecG','363109XKoaup','slice','Runtime\x20Skill\x20package\x20is\x20missing\x20','isFile','.\x20Changed\x20file:\x20','filter','trimEnd','2865702MBOiiA','errors','entries','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','test','---','24UMsTEZ','force','length','displayName','contentHash','stringify','replace','\x0a---\x0a\x0a','has','fileHashes','map','toString','description','flow','accessKey','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','1567986GkUbbn','packageBytes','3249037uTSbLl','join','match','300mPkxde','trim','Managed\x20file\x20was\x20removed\x20locally:\x20','keys','contents','pulledAt','Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20','delete','validation','name','paths','642873yEYenF','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','find','name:\x20','4lmXVva','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.','set'];a138_0x2111=function(){return _0x166ed6;};return a138_0x2111();}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(_0xa9090f,_0x42cfa6,_0x4ea354){const _0xc1f131=a138_0x458b,_0x22a442=requireSkillCode(_0xa9090f),_0x19032e=requirePackageBytes(_0x22a442,_0x4ea354[_0xc1f131(0xe0)]),_0x181372=extractDownloadedPackage(_0x19032e),_0x5bb367=_0x181372[_0xc1f131(0xf1)](_0x2d4502=>_0x2d4502[_0xc1f131(0xfa)]===SKILL_FILE);if(!_0x5bb367)throw CliErrors[_0xc1f131(0xec)](_0xc1f131(0xff)+SKILL_FILE+':\x20'+_0x22a442);const _0xe38b8=withMaterializedSkillFrontmatter(_0x181372,_0xa9090f,_0x22a442),_0x406799=_0xe38b8['find'](_0x1f7187=>_0x1f7187[_0xc1f131(0xfa)]===SKILL_FILE),_0x4cdad5=fileText(_0x406799),_0x40421d=getRuntimeSkillDir(_0x4ea354['env'],_0x4ea354[_0xc1f131(0xdd)],_0x4ea354[_0xc1f131(0xfb)],_0x42cfa6,_0x22a442,_0x4ea354[_0xc1f131(0xee)]),_0x3d6ff3=resolve(_0x40421d,SKILL_FILE),_0x550f31=resolve(_0x40421d,METADATA_FILE),_0x57ce37=contentHash(_0x4cdad5),_0x337321=readMetadataIfPresent(_0x550f31)?.[_0xc1f131(0x113)];ensurePulledFilesCanBeOverwritten(_0x40421d,_0x550f31,_0xe38b8,_0x4ea354[_0xc1f131(0x10b)]===!![]),mkdirSync(_0x40421d,{'recursive':!![],'mode':0x1c0});const _0x1a72cd=existsSync(_0x3d6ff3)?readFileSync(_0x3d6ff3,_0xc1f131(0xf8)):undefined;return materializeFiles(_0x40421d,_0xe38b8),removeStaleManagedFiles(_0x40421d,_0x337321,_0xe38b8),writeJsonAtomic(_0x550f31,buildMetadata(_0xa9090f,_0x42cfa6,_0x4ea354[_0xc1f131(0xfb)],_0x57ce37,_0x4ea354[_0xc1f131(0xe9)],_0xe38b8,_0x19032e)),{'skill':_0xa9090f,'scope':_0x42cfa6,'dir':_0x40421d,'skillMdPath':_0x3d6ff3,'metadataPath':_0x550f31,'contentHash':_0x57ce37,'changed':_0x1a72cd!==_0x4cdad5};}function withMaterializedSkillFrontmatter(_0x4b076b,_0x19bef6,_0x458419){const _0x318d39=a138_0x458b,_0x20436c=skillDisplayName(_0x19bef6,_0x458419),_0x19fac8=_0x19bef6[_0x318d39(0x116)]?.[_0x318d39(0xe5)]()||_0x20436c||_0x458419;return normalizeLocalFiles(_0x4b076b)[_0x318d39(0x114)](_0x577aef=>{const _0x32e8a0=_0x318d39,_0x1e61d5=fileText(_0x577aef);if(_0x577aef['path']!==SKILL_FILE)return _0x577aef;if(hasYamlFrontmatter(_0x1e61d5))return{'path':_0x577aef[_0x32e8a0(0xfa)],'content':withSyncedDisplayName(_0x1e61d5,_0x20436c)};return{'path':_0x577aef[_0x32e8a0(0xfa)],'content':prependSkillFrontmatter(_0x1e61d5,{'name':_0x458419,'displayName':_0x20436c,'description':_0x19fac8})};});}function a138_0x458b(_0x5518e2,_0x45e5fd){_0x5518e2=_0x5518e2-0xdc;const _0x211129=a138_0x2111();let _0x458b3e=_0x211129[_0x5518e2];return _0x458b3e;}function hasYamlFrontmatter(_0x383a38){const _0xb8c3e7=a138_0x458b;return/^\uFEFF?---\s*\r?\n/[_0xb8c3e7(0x108)](_0x383a38);}function prependSkillFrontmatter(_0x2f8b94,_0x29c461){const _0x37306d=a138_0x458b,_0x4f860c=_0x2f8b94[_0x37306d(0x110)](/^\uFEFF/,'');return[_0x37306d(0x109),_0x37306d(0xf2)+yamlString(_0x29c461[_0x37306d(0xed)]),_0x29c461['displayName']?'displayName:\x20'+yamlString(_0x29c461['displayName']):undefined,'description:\x20'+yamlString(_0x29c461[_0x37306d(0x116)]),'---','',_0x4f860c][_0x37306d(0x102)](_0x8fd92d=>_0x8fd92d!==undefined)[_0x37306d(0xe2)]('\x0a');}function yamlString(_0x9c5a8b){const _0xa40028=a138_0x458b;return JSON[_0xa40028(0x10f)](_0x9c5a8b['replace'](/\r/g,'')['trim']());}function skillDisplayName(_0x2362ff,_0xce7a54){const _0xa65ab=a138_0x458b,_0x23457e=_0x2362ff[_0xa65ab(0xf7)]?.[_0xa65ab(0xe5)]();return _0x23457e||_0xce7a54;}function withSyncedDisplayName(_0x3c740f,_0x15d0df){const _0x50357b=a138_0x458b,_0x12b8d5=_0x3c740f[_0x50357b(0xe3)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x12b8d5)return _0x3c740f;const _0xcddd70=_0x12b8d5[0x1]??'',_0x10e300=_0x12b8d5[0x2]??'',_0x589025=parseDocument(_0x10e300);if(_0x589025[_0x50357b(0x105)][_0x50357b(0x10c)]>0x0||!isMap(_0x589025['contents']))return _0x3c740f;if(_0x15d0df)_0x589025[_0x50357b(0xf5)](_0x50357b(0x10d),_0x15d0df);else{if(_0x589025['has'](_0x50357b(0x10d)))_0x589025[_0x50357b(0xeb)](_0x50357b(0x10d));else return _0x3c740f;}forceBlockCollections(_0x589025[_0x50357b(0xe8)]);const _0x3e6f89=_0x589025[_0x50357b(0x115)]({'lineWidth':0x0})[_0x50357b(0x103)](),_0x509cb1=_0x3c740f[_0x50357b(0xfe)](_0x12b8d5[0x0][_0x50357b(0x10c)])[_0x50357b(0x110)](/^\r?\n/,'');return _0xcddd70+'---\x0a'+_0x3e6f89+_0x50357b(0x111)+_0x509cb1;}function forceBlockCollections(_0x1da09b){if(!isNode(_0x1da09b))return;visit(_0x1da09b,(_0x1dc928,_0x3bf626)=>{const _0x30044b=a138_0x458b;isCollection(_0x3bf626)&&(_0x3bf626[_0x30044b(0xdc)]=![]);});}function ensurePulledFilesCanBeOverwritten(_0x5608cf,_0x5c8926,_0x3804f3,_0x1627f4){const _0x29e7f6=a138_0x458b;if(_0x1627f4||!existsSync(_0x5c8926))return;const _0x270bfb=readMetadataIfPresent(_0x5c8926);if(!_0x270bfb)return;const _0x297093=_0x270bfb['fileHashes']&&Object['keys'](_0x270bfb[_0x29e7f6(0x113)])['length']>0x0?_0x270bfb[_0x29e7f6(0x113)]:undefined;if(_0x297093)for(const [_0x211bf7,_0x3dab6c]of Object[_0x29e7f6(0x106)](_0x297093)){const _0x4de520=resolveManagedFilePath(_0x5608cf,_0x211bf7);if(!existsSync(_0x4de520))throw CliErrors['validation']('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x5608cf,_0x29e7f6(0xe6)+_0x211bf7);const _0x277863=lstatSync(_0x4de520);if(!_0x277863['isFile']())throw CliErrors[_0x29e7f6(0xec)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x5608cf,'Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20'+_0x211bf7);const _0x27f2ca=bufferSha256(readFileSync(_0x4de520));if(_0x27f2ca!==_0x3dab6c)throw CliErrors['validation'](_0x29e7f6(0xde)+_0x5608cf+_0x29e7f6(0x101)+_0x211bf7,'Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20'+_0x211bf7);}else{const _0x262801=resolve(_0x5608cf,SKILL_FILE);if(existsSync(_0x262801)&&_0x270bfb[_0x29e7f6(0x10e)]){const _0x34208d=contentHash(readFileSync(_0x262801,_0x29e7f6(0xf8)));if(_0x34208d!==_0x270bfb[_0x29e7f6(0x10e)])throw CliErrors[_0x29e7f6(0xec)](_0x29e7f6(0xf0)+_0x262801,_0x29e7f6(0xf4));}}for(const _0x4a64c1 of normalizeLocalFiles(_0x3804f3)){if(_0x297093?.[_0x4a64c1['path']])continue;if(!_0x297093&&_0x4a64c1[_0x29e7f6(0xfa)]===SKILL_FILE)continue;const _0x56048e=resolveManagedFilePath(_0x5608cf,_0x4a64c1['path']);if(!existsSync(_0x56048e))continue;const _0x30169b=lstatSync(_0x56048e);if(!_0x30169b[_0x29e7f6(0x100)]())throw CliErrors['validation'](_0x29e7f6(0xde)+_0x5608cf,_0x29e7f6(0x107)+_0x4a64c1[_0x29e7f6(0xfa)]);const _0x5178f0=bufferSha256(readFileSync(_0x56048e));if(_0x5178f0!==fileHash(_0x4a64c1))throw CliErrors[_0x29e7f6(0xec)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x5608cf,_0x29e7f6(0xea)+_0x4a64c1['path']);}}function materializeFiles(_0x4a1a86,_0x57287a){const _0x3b3cd6=a138_0x458b;for(const _0x52989 of normalizeLocalFiles(_0x57287a)){const _0x5c86cd=resolveManagedFilePath(_0x4a1a86,_0x52989[_0x3b3cd6(0xfa)]);mkdirSync(dirname(_0x5c86cd),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x5c86cd,fileContent(_0x52989),0x180);}}function removeStaleManagedFiles(_0x1e4a9e,_0x3cb9dd,_0x5a5cc2){const _0x5a4f6d=a138_0x458b;if(!_0x3cb9dd)return;const _0x2fae66=new Set(normalizeLocalFiles(_0x5a5cc2)['map'](_0x2b6fbc=>_0x2b6fbc[_0x5a4f6d(0xfa)]));for(const _0x1640b5 of Object[_0x5a4f6d(0xe7)](_0x3cb9dd)){if(_0x2fae66[_0x5a4f6d(0x112)](_0x1640b5))continue;const _0x1a8ae3=resolveManagedFilePath(_0x1e4a9e,_0x1640b5);existsSync(_0x1a8ae3)&&lstatSync(_0x1a8ae3)[_0x5a4f6d(0x100)]()&&rmSync(_0x1a8ae3,{'force':!![]});}}
|
|
1
|
+
(function(_0x36f089,_0x2b523c){const _0x26cb93=a138_0xa0f9,_0x25f06f=_0x36f089();while(!![]){try{const _0x4dda50=parseInt(_0x26cb93(0x9f))/0x1*(-parseInt(_0x26cb93(0x84))/0x2)+parseInt(_0x26cb93(0x8b))/0x3+-parseInt(_0x26cb93(0x8f))/0x4*(parseInt(_0x26cb93(0xb5))/0x5)+parseInt(_0x26cb93(0x7e))/0x6*(parseInt(_0x26cb93(0x8e))/0x7)+parseInt(_0x26cb93(0x9e))/0x8+-parseInt(_0x26cb93(0x82))/0x9*(-parseInt(_0x26cb93(0xb3))/0xa)+-parseInt(_0x26cb93(0x8c))/0xb;if(_0x4dda50===_0x2b523c)break;else _0x25f06f['push'](_0x25f06f['shift']());}catch(_0x470dd6){_0x25f06f['push'](_0x25f06f['shift']());}}}(a138_0x44cb,0x812db));import{existsSync,lstatSync,mkdirSync,readFileSync,rmSync}from'node:fs';import{dirname,resolve}from'node:path';function a138_0x44cb(){const _0x1c84c2=['---\x0a','length','name','2436048IyPFNc','3hXFYfU','---','pulledAt','test','path','displayName','stringify','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','name:\x20','validation','find','utf8','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','\x0a---\x0a\x0a','.\x20Changed\x20file:\x20','example','skillName','map','fileHashes','packageBytes','640DiYPxl','delete','117295wCGTWz','replace','trim','version','scope','6PyHPxW','Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20','description','Runtime\x20Skill\x20package\x20is\x20missing\x20','100413yeqKXd','appCode','51406fkrAlY','slice','Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20','Managed\x20file\x20was\x20removed\x20locally:\x20','flow','skillCode','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','2705763IYqOpG','22654885PxQEBH','status','6038053pJUOQC','20tFacjW','isFile','has','displayName:\x20','contentHash','env','filter','keys','entries','join','errors','contents'];a138_0x44cb=function(){return _0x1c84c2;};return a138_0x44cb();}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(_0x433778,_0x430bf6,_0x3e7ef9){const _0x53b913=a138_0xa0f9,_0x33ef28=requireSkillCode(_0x433778),_0x51e11d=requirePackageBytes(_0x33ef28,_0x3e7ef9[_0x53b913(0xb2)]),_0x2bd6f6=extractDownloadedPackage(_0x51e11d),_0xd7c580=_0x2bd6f6[_0x53b913(0xa9)](_0x129a5=>_0x129a5[_0x53b913(0xa3)]===SKILL_FILE);if(!_0xd7c580)throw CliErrors['validation'](_0x53b913(0x81)+SKILL_FILE+':\x20'+_0x33ef28);const _0x229387=withMaterializedSkillFrontmatter(_0x2bd6f6,_0x433778,_0x33ef28),_0x14c972=_0x229387[_0x53b913(0xa9)](_0x53dabf=>_0x53dabf[_0x53b913(0xa3)]===SKILL_FILE),_0x39c824=fileText(_0x14c972),_0x34be8e=getRuntimeSkillDir(_0x3e7ef9[_0x53b913(0x94)],_0x3e7ef9['accessKey'],_0x3e7ef9[_0x53b913(0x83)],_0x430bf6,_0x33ef28,_0x3e7ef9['paths']),_0x50ff5f=resolve(_0x34be8e,SKILL_FILE),_0x144a6c=resolve(_0x34be8e,METADATA_FILE),_0x56c3a0=contentHash(_0x39c824),_0x867032=readMetadataIfPresent(_0x144a6c)?.[_0x53b913(0xb1)];ensurePulledFilesCanBeOverwritten(_0x34be8e,_0x144a6c,_0x229387,_0x3e7ef9['force']===!![]),mkdirSync(_0x34be8e,{'recursive':!![],'mode':0x1c0});const _0x3113cf=existsSync(_0x50ff5f)?readFileSync(_0x50ff5f,'utf8'):undefined;return materializeFiles(_0x34be8e,_0x229387),removeStaleManagedFiles(_0x34be8e,_0x867032,_0x229387),writeJsonAtomic(_0x144a6c,buildMetadata(_0x433778,_0x430bf6,_0x3e7ef9[_0x53b913(0x83)],_0x56c3a0,_0x3e7ef9[_0x53b913(0xa1)],_0x229387,_0x51e11d)),{'skill':_0x433778,'scope':_0x430bf6,'dir':_0x34be8e,'skillMdPath':_0x50ff5f,'metadataPath':_0x144a6c,'contentHash':_0x56c3a0,'changed':_0x3113cf!==_0x39c824};}export function reuseMaterializedRuntimeSkill(_0x257427,_0x349a49,_0x543b6b){const _0xe07244=a138_0xa0f9,_0x470d14=_0x257427[_0xe07244(0x7c)]?.[_0xe07244(0xb7)]();if(!_0x470d14)return undefined;const _0x3f6205=requireSkillCode(_0x257427),_0x5255f4=getRuntimeSkillDir(_0x543b6b['env'],_0x543b6b['accessKey'],_0x543b6b[_0xe07244(0x83)],_0x349a49,_0x3f6205,_0x543b6b['paths']),_0x450985=resolve(_0x5255f4,SKILL_FILE),_0x222bfd=resolve(_0x5255f4,METADATA_FILE),_0x3872f7=readMetadataIfPresent(_0x222bfd);if(!_0x3872f7||_0x3872f7['schemaVersion']!==0x2||_0x3872f7[_0xe07244(0x83)]!==_0x543b6b['appCode']||_0x3872f7[_0xe07244(0x7d)]!==_0x349a49||_0x3872f7[_0xe07244(0x89)]!==_0x3f6205||_0x3872f7['version']!==_0x470d14||_0x3872f7['id']!==_0x257427['id']||_0x3872f7[_0xe07244(0xaf)]!==_0x257427[_0xe07244(0xaf)]||_0x3872f7[_0xe07244(0x80)]!==_0x257427[_0xe07244(0x80)]||_0x3872f7[_0xe07244(0xae)]!==_0x257427['example']||_0x3872f7[_0xe07244(0x8d)]!==_0x257427[_0xe07244(0x8d)]||!_0x3872f7['contentHash']||!_0x3872f7[_0xe07244(0xb1)]||!Object['hasOwn'](_0x3872f7[_0xe07244(0xb1)],SKILL_FILE))return undefined;for(const [_0x1e142d,_0x11e144]of Object['entries'](_0x3872f7[_0xe07244(0xb1)])){if(!/^[a-f0-9]{64}$/[_0xe07244(0xa2)](_0x11e144))return undefined;const _0x3d9d05=resolveManagedFilePath(_0x5255f4,_0x1e142d);if(!existsSync(_0x3d9d05)||!lstatSync(_0x3d9d05)['isFile']())return undefined;if(bufferSha256(readFileSync(_0x3d9d05))!==_0x11e144)return undefined;}return{'skill':_0x257427,'scope':_0x349a49,'dir':_0x5255f4,'skillMdPath':_0x450985,'metadataPath':_0x222bfd,'contentHash':_0x3872f7[_0xe07244(0x93)],'changed':![]};}function withMaterializedSkillFrontmatter(_0x16add1,_0x17dd0b,_0x4d4aa0){const _0x4d3d78=a138_0xa0f9,_0x5c0958=skillDisplayName(_0x17dd0b,_0x4d4aa0),_0x4e253c=_0x17dd0b['description']?.['trim']()||_0x5c0958||_0x4d4aa0;return normalizeLocalFiles(_0x16add1)[_0x4d3d78(0xb0)](_0x5a83dc=>{const _0x2d0459=_0x4d3d78,_0x38cc81=fileText(_0x5a83dc);if(_0x5a83dc[_0x2d0459(0xa3)]!==SKILL_FILE)return _0x5a83dc;if(hasYamlFrontmatter(_0x38cc81))return{'path':_0x5a83dc['path'],'content':withSyncedDisplayName(_0x38cc81,_0x5c0958)};return{'path':_0x5a83dc[_0x2d0459(0xa3)],'content':prependSkillFrontmatter(_0x38cc81,{'name':_0x4d4aa0,'displayName':_0x5c0958,'description':_0x4e253c})};});}function hasYamlFrontmatter(_0x264ddd){const _0x302f51=a138_0xa0f9;return/^\uFEFF?---\s*\r?\n/[_0x302f51(0xa2)](_0x264ddd);}function prependSkillFrontmatter(_0x140fd6,_0x24902d){const _0x11c2f9=a138_0xa0f9,_0x19a154=_0x140fd6[_0x11c2f9(0xb6)](/^\uFEFF/,'');return[_0x11c2f9(0xa0),_0x11c2f9(0xa7)+yamlString(_0x24902d[_0x11c2f9(0x9d)]),_0x24902d[_0x11c2f9(0xa4)]?_0x11c2f9(0x92)+yamlString(_0x24902d['displayName']):undefined,'description:\x20'+yamlString(_0x24902d[_0x11c2f9(0x80)]),'---','',_0x19a154][_0x11c2f9(0x95)](_0x54d0ee=>_0x54d0ee!==undefined)[_0x11c2f9(0x98)]('\x0a');}function yamlString(_0x695202){const _0x2665c4=a138_0xa0f9;return JSON[_0x2665c4(0xa5)](_0x695202[_0x2665c4(0xb6)](/\r/g,'')[_0x2665c4(0xb7)]());}function a138_0xa0f9(_0x21c318,_0x50e49f){_0x21c318=_0x21c318-0x7c;const _0x44cb84=a138_0x44cb();let _0xa0f94b=_0x44cb84[_0x21c318];return _0xa0f94b;}function skillDisplayName(_0xbc1db3,_0x40a6c5){const _0x3b993e=a138_0xa0f9,_0x43f1d1=_0xbc1db3[_0x3b993e(0xaf)]?.[_0x3b993e(0xb7)]();return _0x43f1d1||_0x40a6c5;}function withSyncedDisplayName(_0x4c5021,_0x5cfe7c){const _0x1a13b0=a138_0xa0f9,_0x651f20=_0x4c5021['match'](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x651f20)return _0x4c5021;const _0x4bd9c3=_0x651f20[0x1]??'',_0x2cf9fc=_0x651f20[0x2]??'',_0x3d32a7=parseDocument(_0x2cf9fc);if(_0x3d32a7[_0x1a13b0(0x99)][_0x1a13b0(0x9c)]>0x0||!isMap(_0x3d32a7['contents']))return _0x4c5021;if(_0x5cfe7c)_0x3d32a7['set'](_0x1a13b0(0xa4),_0x5cfe7c);else{if(_0x3d32a7['has'](_0x1a13b0(0xa4)))_0x3d32a7[_0x1a13b0(0xb4)](_0x1a13b0(0xa4));else return _0x4c5021;}forceBlockCollections(_0x3d32a7[_0x1a13b0(0x9a)]);const _0x2f156e=_0x3d32a7['toString']({'lineWidth':0x0})['trimEnd'](),_0x1f3f58=_0x4c5021[_0x1a13b0(0x85)](_0x651f20[0x0][_0x1a13b0(0x9c)])['replace'](/^\r?\n/,'');return _0x4bd9c3+_0x1a13b0(0x9b)+_0x2f156e+_0x1a13b0(0xac)+_0x1f3f58;}function forceBlockCollections(_0xce7e3d){if(!isNode(_0xce7e3d))return;visit(_0xce7e3d,(_0x23e153,_0x5d5a39)=>{const _0x4bcf15=a138_0xa0f9;isCollection(_0x5d5a39)&&(_0x5d5a39[_0x4bcf15(0x88)]=![]);});}function ensurePulledFilesCanBeOverwritten(_0x2fd1ac,_0x139512,_0x143289,_0x5dc10a){const _0x16fc4b=a138_0xa0f9;if(_0x5dc10a||!existsSync(_0x139512))return;const _0x34577e=readMetadataIfPresent(_0x139512);if(!_0x34577e)return;const _0x3c515a=_0x34577e[_0x16fc4b(0xb1)]&&Object[_0x16fc4b(0x96)](_0x34577e[_0x16fc4b(0xb1)])[_0x16fc4b(0x9c)]>0x0?_0x34577e['fileHashes']:undefined;if(_0x3c515a)for(const [_0x72e35f,_0x360702]of Object[_0x16fc4b(0x97)](_0x3c515a)){const _0x45e840=resolveManagedFilePath(_0x2fd1ac,_0x72e35f);if(!existsSync(_0x45e840))throw CliErrors[_0x16fc4b(0xa8)](_0x16fc4b(0xab)+_0x2fd1ac,_0x16fc4b(0x87)+_0x72e35f);const _0x236e54=lstatSync(_0x45e840);if(!_0x236e54[_0x16fc4b(0x90)]())throw CliErrors['validation'](_0x16fc4b(0xab)+_0x2fd1ac,_0x16fc4b(0x7f)+_0x72e35f);const _0x23417f=bufferSha256(readFileSync(_0x45e840));if(_0x23417f!==_0x360702)throw CliErrors[_0x16fc4b(0xa8)](_0x16fc4b(0xab)+_0x2fd1ac+_0x16fc4b(0xad)+_0x72e35f,'Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20'+_0x72e35f);}else{const _0x7c6d77=resolve(_0x2fd1ac,SKILL_FILE);if(existsSync(_0x7c6d77)&&_0x34577e[_0x16fc4b(0x93)]){const _0x35edc3=contentHash(readFileSync(_0x7c6d77,_0x16fc4b(0xaa)));if(_0x35edc3!==_0x34577e[_0x16fc4b(0x93)])throw CliErrors[_0x16fc4b(0xa8)](_0x16fc4b(0x8a)+_0x7c6d77,'Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.');}}for(const _0x46f351 of normalizeLocalFiles(_0x143289)){if(_0x3c515a?.[_0x46f351[_0x16fc4b(0xa3)]])continue;if(!_0x3c515a&&_0x46f351[_0x16fc4b(0xa3)]===SKILL_FILE)continue;const _0x3bacf1=resolveManagedFilePath(_0x2fd1ac,_0x46f351[_0x16fc4b(0xa3)]);if(!existsSync(_0x3bacf1))continue;const _0x1d262d=lstatSync(_0x3bacf1);if(!_0x1d262d['isFile']())throw CliErrors[_0x16fc4b(0xa8)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x2fd1ac,_0x16fc4b(0xa6)+_0x46f351[_0x16fc4b(0xa3)]);const _0x31582e=bufferSha256(readFileSync(_0x3bacf1));if(_0x31582e!==fileHash(_0x46f351))throw CliErrors[_0x16fc4b(0xa8)](_0x16fc4b(0xab)+_0x2fd1ac,_0x16fc4b(0x86)+_0x46f351[_0x16fc4b(0xa3)]);}}function materializeFiles(_0xb73f0d,_0x455c98){const _0x5b6bb0=a138_0xa0f9;for(const _0x3caa20 of normalizeLocalFiles(_0x455c98)){const _0x171685=resolveManagedFilePath(_0xb73f0d,_0x3caa20[_0x5b6bb0(0xa3)]);mkdirSync(dirname(_0x171685),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x171685,fileContent(_0x3caa20),0x180);}}function removeStaleManagedFiles(_0x4472f2,_0x6b8354,_0x454305){const _0x59fe41=a138_0xa0f9;if(!_0x6b8354)return;const _0x5e70aa=new Set(normalizeLocalFiles(_0x454305)['map'](_0x3abc86=>_0x3abc86[_0x59fe41(0xa3)]));for(const _0x255f9c of Object['keys'](_0x6b8354)){if(_0x5e70aa[_0x59fe41(0x91)](_0x255f9c))continue;const _0x12003d=resolveManagedFilePath(_0x4472f2,_0x255f9c);existsSync(_0x12003d)&&lstatSync(_0x12003d)[_0x59fe41(0x90)]()&&rmSync(_0x12003d,{'force':!![]});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x42ee0e,_0x558851){const _0x51630a=a139_0x5d96,_0x2b732a=_0x42ee0e();while(!![]){try{const _0x5e043f=parseInt(_0x51630a(0x14b))/0x1*(parseInt(_0x51630a(0x167))/0x2)+-parseInt(_0x51630a(0x166))/0x3+-parseInt(_0x51630a(0x15a))/0x4+parseInt(_0x51630a(0x140))/0x5*(parseInt(_0x51630a(0x161))/0x6)+parseInt(_0x51630a(0x14a))/0x7*(-parseInt(_0x51630a(0x15e))/0x8)+-parseInt(_0x51630a(0x146))/0x9*(parseInt(_0x51630a(0x15c))/0xa)+parseInt(_0x51630a(0x149))/0xb*(parseInt(_0x51630a(0x163))/0xc);if(_0x5e043f===_0x558851)break;else _0x2b732a['push'](_0x2b732a['shift']());}catch(_0x39d30a){_0x2b732a['push'](_0x2b732a['shift']());}}}(a139_0x4df9,0xb5aac));import{existsSync,readFileSync}from'node:fs';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';import{fileContent,normalizeLocalFiles}from'./local-files.js';import{buildSkillPackage,localFilesToManifestFiles}from'./zip-package.js';export function buildMetadata(_0x35f3e2,_0x1f91bc,_0x3e76b9,_0x1838e2,_0x46af67,_0x482d3d,_0x1d7371){const _0xd3b0ac=a139_0x5d96,_0xae5264=_0x482d3d?normalizeLocalFiles(_0x482d3d):[],_0x429901=!_0x1d7371&&_0xae5264['length']>0x0?buildSkillPackage(_0xae5264):undefined,_0x3ba8ab=_0x1d7371?bufferSha256(_0x1d7371):_0x429901?.[_0xd3b0ac(0x141)][_0xd3b0ac(0x154)],_0xcf5ed1=_0x1d7371?.[_0xd3b0ac(0x165)]??_0x429901?.[_0xd3b0ac(0x141)][_0xd3b0ac(0x152)],_0x53a43b=_0xae5264[_0xd3b0ac(0x165)]>0x0?Object[_0xd3b0ac(0x151)](_0xae5264[_0xd3b0ac(0x142)](_0x270a02=>[_0x270a02[_0xd3b0ac(0x144)],fileHash(_0x270a02)])):undefined;return{'schemaVersion':_0xae5264[_0xd3b0ac(0x165)]>0x0?0x2:0x1,'id':_0x35f3e2['id'],'appCode':_0x3e76b9,'skillCode':requireSkillCode(_0x35f3e2),'skillName':_0x35f3e2[_0xd3b0ac(0x159)],'description':_0x35f3e2[_0xd3b0ac(0x168)],'example':_0x35f3e2[_0xd3b0ac(0x158)],'scope':_0x1f91bc,'readonly':_0x1f91bc!==_0xd3b0ac(0x14d)||_0x35f3e2[_0xd3b0ac(0x148)]===!![],'tenantCode':_0x35f3e2[_0xd3b0ac(0x153)],'userId':_0x35f3e2[_0xd3b0ac(0x145)],'version':_0x35f3e2[_0xd3b0ac(0x15d)],'status':_0x35f3e2[_0xd3b0ac(0x14c)],'tags':Array[_0xd3b0ac(0x143)](_0x35f3e2[_0xd3b0ac(0x15b)])?_0x35f3e2[_0xd3b0ac(0x15b)]:[],'hasUpstreamUpdate':_0x35f3e2['hasUpstreamUpdate'],'forkedFromSkillId':_0x35f3e2[_0xd3b0ac(0x14f)],'forkedFromVersion':_0x35f3e2['forkedFromVersion'],'sourceSessionId':_0x35f3e2[_0xd3b0ac(0x169)],'contentHash':_0x1838e2,'fileHashes':_0x53a43b,'treeHash':_0xae5264[_0xd3b0ac(0x165)]>0x0?fileTreeHash(localFilesToManifestFiles(_0xae5264)):undefined,'ossPath':remoteManifestOssPath(_0x35f3e2[_0xd3b0ac(0x16a)]),'zipSha256':_0x3ba8ab,'zipSize':_0xcf5ed1,'files':_0xae5264[_0xd3b0ac(0x165)]>0x0?_0xae5264['map'](_0x15c2d4=>({'path':_0x15c2d4['path'],'hash':fileHash(_0x15c2d4),'size':fileContent(_0x15c2d4)[_0xd3b0ac(0x165)]})):undefined,'pulledAt':_0x46af67??new Date()['toISOString']()};}export function requireSkillCode(_0x4e5a4a){const _0x59c44c=a139_0x5d96,_0x491614=_0x4e5a4a[_0x59c44c(0x15f)]?.[_0x59c44c(0x156)]();if(!_0x491614)throw CliErrors[_0x59c44c(0x157)](_0x59c44c(0x160));return _0x491614;}function a139_0x4df9(){const _0x425e87=['files','10jyJhNa','manifest','map','isArray','path','userId','9944298cDlcKS','ossPath','readonly','213037olllBZ','52633OfKLTP','2nndVih','status','personal','object','forkedFromSkillId','parse','fromEntries','zipSize','tenantCode','zipSha256','Invalid\x20','trim','validation','example','skillName','2495288QZXuwm','tags','10SlBdPk','version','952QpSVDH','skillCode','Runtime\x20Skill\x20is\x20missing\x20skillCode.','521544kwSXcG','utf8','1788PeuDPD','string','length','2552892tupfTH','1159046VZPzUY','description','sourceSessionId'];a139_0x4df9=function(){return _0x425e87;};return a139_0x4df9();}function a139_0x5d96(_0x52ab79,_0x720b29){_0x52ab79=_0x52ab79-0x140;const _0x4df9af=a139_0x4df9();let _0x5d96b9=_0x4df9af[_0x52ab79];return _0x5d96b9;}export function readMetadataIfPresent(_0x5e235d){const _0xa07f0e=a139_0x5d96;if(!existsSync(_0x5e235d))return undefined;try{const _0x5509f6=JSON[_0xa07f0e(0x150)](readFileSync(_0x5e235d,_0xa07f0e(0x162)));return _0x5509f6;}catch{throw CliErrors[_0xa07f0e(0x157)](_0xa07f0e(0x155)+METADATA_FILE+':\x20'+_0x5e235d);}}function remoteManifestOssPath(_0x50b952){const _0x375e74=a139_0x5d96;if(!_0x50b952||typeof _0x50b952!==_0x375e74(0x14e)||Array[_0x375e74(0x143)](_0x50b952))return undefined;const _0x35420c=_0x50b952[_0x375e74(0x147)];return typeof _0x35420c===_0x375e74(0x164)&&_0x35420c[_0x375e74(0x156)]()?_0x35420c[_0x375e74(0x156)]():undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a140_0x438480=a140_0x599f;(function(_0x8ec66,_0x3b9bf1){const _0x46da64=a140_0x599f,_0x16a877=_0x8ec66();while(!![]){try{const _0x1762a2=-parseInt(_0x46da64(0x1ad))/0x1+-parseInt(_0x46da64(0x1a5))/0x2*(-parseInt(_0x46da64(0x1b6))/0x3)+-parseInt(_0x46da64(0x1ab))/0x4+parseInt(_0x46da64(0x1a7))/0x5*(parseInt(_0x46da64(0x19e))/0x6)+parseInt(_0x46da64(0x1b2))/0x7*(parseInt(_0x46da64(0x1a6))/0x8)+-parseInt(_0x46da64(0x1a1))/0x9*(-parseInt(_0x46da64(0x1a3))/0xa)+-parseInt(_0x46da64(0x1ae))/0xb;if(_0x1762a2===_0x3b9bf1)break;else _0x16a877['push'](_0x16a877['shift']());}catch(_0x492353){_0x16a877['push'](_0x16a877['shift']());}}}(a140_0x1643,0x53ced));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(_0x59ccf8={}){const _0x461f3a=a140_0x599f,_0x30c0be=_0x59ccf8[_0x461f3a(0x19b)]??homedir(),_0x4fbad9=resolve(_0x30c0be,PRODUCT_CONFIG[_0x461f3a(0x1ac)],_0x461f3a(0x1b9)),_0x82a3e7=trimmedEnv(_0x461f3a(0x1a9)),_0x28a7b4=trimmedEnv(_0x461f3a(0x1b1)),_0x16ee2d=resolve(_0x30c0be,_0x461f3a(0x1b5)),_0x494e2c=_0x59ccf8['workbuddySkillsDir']??(existsSync(_0x16ee2d)?resolve(_0x16ee2d,_0x461f3a(0x19c)):undefined);return{'homeDir':_0x30c0be,'cacheRoot':_0x4fbad9,'managedRoot':resolve(_0x30c0be,PRODUCT_CONFIG[_0x461f3a(0x1ac)]),'agentsSkillsDir':_0x59ccf8[_0x461f3a(0x1b3)]??_0x82a3e7??resolve(_0x30c0be,'.agents',_0x461f3a(0x19c)),'claudeSkillsDir':_0x59ccf8[_0x461f3a(0x19f)]??_0x28a7b4??resolve(_0x30c0be,_0x461f3a(0x1a0),_0x461f3a(0x19c)),'workbuddySkillsDir':_0x494e2c};}export function runtimeAgentSkillRoots(_0x579802){const _0x1cc8ec=a140_0x599f;return[_0x579802['agentsSkillsDir'],_0x579802[_0x1cc8ec(0x19f)],_0x579802[_0x1cc8ec(0x1b4)]][_0x1cc8ec(0x1b7)](_0x348c41=>Boolean(_0x348c41));}export function getRuntimeSkillCacheRoot(_0x3feb00,_0x2f93e2,_0x4e3832={}){const _0x1e1208=a140_0x599f,_0x541ca8=resolveSkillSyncPaths(_0x4e3832);return resolve(_0x541ca8[_0x1e1208(0x1af)],_0x3feb00,fingerprintAccessKey(_0x2f93e2),_0x1e1208(0x19c));}export function getRuntimeSkillDir(_0x3cf054,_0x515883,_0x2d630f,_0x556995,_0x550e78,_0x4dccb9={}){const _0xe572b3=a140_0x599f;return resolve(getRuntimeSkillCacheRoot(_0x3cf054,_0x515883,_0x4dccb9),safePathSegment(_0x2d630f,_0xe572b3(0x1aa)),_0x556995,safePathSegment(_0x550e78,_0xe572b3(0x19d)));}export function safePathSegment(_0x50398b,_0x1d003e=a140_0x438480(0x19a)){const _0x26a6e1=a140_0x438480;if(!_0x50398b||_0x50398b[_0x26a6e1(0x1a2)]('/')||_0x50398b[_0x26a6e1(0x1a2)]('\x5c')||_0x50398b[_0x26a6e1(0x1a2)]('..'))throw CliErrors[_0x26a6e1(0x1a8)](_0x26a6e1(0x1b0)+_0x1d003e+_0x26a6e1(0x1a4)+_0x50398b);return _0x50398b;}function a140_0x599f(_0x5df4b8,_0x35095e){_0x5df4b8=_0x5df4b8-0x19a;const _0x164339=a140_0x1643();let _0x599fc3=_0x164339[_0x5df4b8];return _0x599fc3;}function a140_0x1643(){const _0x27c43d=['homeDirName','610931iIsKBs','6810727ANHsug','cacheRoot','Unsafe\x20','CLAUDE_SKILL_ROOT','3577UxPbAh','agentsSkillsDir','workbuddySkillsDir','.workbuddy','66TxboJu','filter','trim','cache','path\x20segment','homeDir','skills','skillCode','6HJIoej','claudeSkillsDir','.claude','12501HmzBAJ','includes','4030vuFGkg','\x20for\x20local\x20path:\x20','28218ikckVi','9584JaXdeg','1578545lDBbhP','validation','SKILL_ROOT','appCode','898748SAkxAE'];a140_0x1643=function(){return _0x27c43d;};return a140_0x1643();}function trimmedEnv(_0x35a319){const _0x14f52=a140_0x438480,_0x3aeb05=productEnv(_0x35a319)?.[_0x14f52(0x1b8)]();return _0x3aeb05?_0x3aeb05:undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x4c8ebb,_0xde2c20){const _0x3c4c17=a141_0x28b1,_0x1272cf=_0x4c8ebb();while(!![]){try{const _0x6079ef=-parseInt(_0x3c4c17(0x205))/0x1+parseInt(_0x3c4c17(0x202))/0x2*(parseInt(_0x3c4c17(0x1ee))/0x3)+parseInt(_0x3c4c17(0x1d5))/0x4+parseInt(_0x3c4c17(0x1f8))/0x5*(parseInt(_0x3c4c17(0x20c))/0x6)+parseInt(_0x3c4c17(0x1e8))/0x7+-parseInt(_0x3c4c17(0x1db))/0x8*(parseInt(_0x3c4c17(0x210))/0x9)+parseInt(_0x3c4c17(0x1ef))/0xa;if(_0x6079ef===_0xde2c20)break;else _0x1272cf['push'](_0x1272cf['shift']());}catch(_0xa22cd8){_0x1272cf['push'](_0x1272cf['shift']());}}}(a141_0x45da,0x5b1ec));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a141_0x457f87}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{writeJsonAtomic}from'./fs-utils.js';function a141_0x28b1(_0x2ff5d9,_0x49549d){_0x2ff5d9=_0x2ff5d9-0x1d2;const _0x45da7a=a141_0x45da();let _0x28b1a7=_0x45da7a[_0x2ff5d9];return _0x28b1a7;}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(_0x277df4,_0x124c22,_0x3f28b0={}){const _0x5a4f88=a141_0x28b1,_0x4c5202=resolvePushDirectoryRoot(_0x277df4),_0x4e1754=readPushMetadataIfPresent(resolve(_0x4c5202,METADATA_FILE),{'ignoreInvalidMetadata':_0x3f28b0[_0x5a4f88(0x20b)]});if(_0x4e1754?.[_0x5a4f88(0x1e9)]&&_0x4e1754['appCode']!==_0x124c22&&!_0x3f28b0['allowAppCodeRetarget']&&!_0x3f28b0['ignoreMetadataAppCodeMismatch'])throw CliErrors['validation'](_0x5a4f88(0x1fa)+_0x4e1754[_0x5a4f88(0x1e9)]+'\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22'+_0x124c22+'\x22.');const _0x1dd203=resolvePushSkillCode(_0x4c5202,_0x124c22,_0x4e1754,_0x3f28b0);if(!_0x1dd203)throw CliErrors['validation'](_0x5a4f88(0x216)+SKILL_FILE+',\x20'+METADATA_FILE+_0x5a4f88(0x20d));return{'dir':_0x4c5202,'skillCode':_0x1dd203,'metadata':_0x4e1754};}export function readPushDirectory(_0x480f89,_0x214619,_0x563297={}){const _0x11f51c=a141_0x28b1,_0xb2b163=resolvePushDirectoryIdentity(_0x480f89,_0x214619,_0x563297),_0x3d56eb=_0xb2b163[_0x11f51c(0x1de)],_0x465eb6=resolve(_0x3d56eb,SKILL_FILE);if(!existsSync(_0x465eb6)||!lstatSync(_0x465eb6)[_0x11f51c(0x215)]())throw CliErrors[_0x11f51c(0x20a)](_0x11f51c(0x1f0)+SKILL_FILE+':\x20'+_0x465eb6);const _0x4de978=_0xb2b163[_0x11f51c(0x1e4)],_0x1ef211=_0x563297['targetScope']??_0x11f51c(0x1d7);if(!_0x563297[_0x11f51c(0x1dc)]&&_0x4de978?.[_0x11f51c(0x20e)]==='builtin')throw CliErrors['validation'](_0x11f51c(0x1e3)+METADATA_FILE+_0x11f51c(0x212)+_0x4de978[_0x11f51c(0x20e)]+'\x22.');if(!_0x563297[_0x11f51c(0x1dc)]&&_0x1ef211==='personal'&&_0x4de978?.[_0x11f51c(0x20e)]&&_0x4de978[_0x11f51c(0x20e)]!=='personal')throw CliErrors['validation'](_0x11f51c(0x200)+METADATA_FILE+_0x11f51c(0x212)+_0x4de978[_0x11f51c(0x20e)]+'\x22.',_0x11f51c(0x1f9)+_0x3d56eb+_0x11f51c(0x1f6));const _0x45baea=scanSkillDirectory(_0x3d56eb,{'excludedFilePaths':_0x563297[_0x11f51c(0x209)]}),_0x52d56d=buildSkillPackage(_0x45baea),_0x4ebc5c=readFileSync(_0x465eb6,'utf8'),_0x28ad55=_0xb2b163['skillCode'],_0x1cdeb3=_0x563297[_0x11f51c(0x1f5)]?undefined:_0x4de978,_0x2a7112=readSkillDisplayName(_0x4ebc5c);return{'skillCode':_0x28ad55,'metadata':_0x4de978,'frontmatterDisplayName':_0x2a7112,'input':{'skillCode':_0x28ad55,'skillName':_0x2a7112??_0x1cdeb3?.[_0x11f51c(0x1d6)],'description':_0x1cdeb3?.[_0x11f51c(0x1f1)],'content':_0x4ebc5c,'files':_0x52d56d[_0x11f51c(0x1f7)],'packageBase64':_0x52d56d[_0x11f51c(0x1d2)],'tags':_0x1cdeb3?.[_0x11f51c(0x1fd)],'version':_0x1cdeb3?.['version'],'sourceSessionId':_0x1cdeb3?.['sourceSessionId']}};}export function refreshPushDirectoryMetadataFromRemote(_0x1a7f84,_0xefc22e,_0x28bb30,_0x37201e={}){const _0x283ff3=a141_0x28b1,_0x44a08e=resolvePushDirectoryRoot(_0x1a7f84),_0x193a3d=readPushMetadataIfPresent(resolve(_0x44a08e,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x53cf36=requireRemoteScope(_0xefc22e),_0x5043ee=readLocalSkillContent(_0x44a08e),_0x1c0a48={..._0xefc22e,'appCode':_0xefc22e[_0x283ff3(0x1e9)]??_0x28bb30,'skillName':_0xefc22e['skillName']??_0x193a3d?.[_0x283ff3(0x1d6)],'description':_0xefc22e[_0x283ff3(0x1f1)]??_0x193a3d?.[_0x283ff3(0x1f1)],'example':_0xefc22e['example']??_0x193a3d?.[_0x283ff3(0x1e6)],'tags':Array[_0x283ff3(0x206)](_0xefc22e[_0x283ff3(0x1fd)])?_0xefc22e[_0x283ff3(0x1fd)]:_0x193a3d?.[_0x283ff3(0x1fd)],'sourceSessionId':_0xefc22e[_0x283ff3(0x214)]??_0x193a3d?.['sourceSessionId'],'content':_0xefc22e[_0x283ff3(0x213)]??_0x5043ee},_0x203873=buildMetadata(_0x1c0a48,_0x53cf36,_0x28bb30,contentHash(_0x5043ee),_0x37201e[_0x283ff3(0x203)]);writeJsonAtomic(resolve(_0x44a08e,METADATA_FILE),_0x203873);}export function recordPushedRuntimeSkill(_0x5b0fbf,_0xba19d0,_0x390a49,_0x16e9e9={}){const _0x17bc89=a141_0x28b1,_0x5c3961=resolvePushDirectoryRoot(_0x5b0fbf),_0xf8e6be=scanSkillDirectory(_0x5c3961),_0x50ad17=_0xf8e6be[_0x17bc89(0x1d9)](_0x7924e1=>_0x7924e1[_0x17bc89(0x1d3)]===SKILL_FILE),_0x178f87=_0x50ad17?fileText(_0x50ad17):'',_0x36e5bc=tryNormalizePackageManifest(_0xba19d0[_0x17bc89(0x1ea)]),_0xabe444={..._0xba19d0,'content':_0xba19d0[_0x17bc89(0x213)]??_0x178f87,'files':_0x36e5bc},_0x14daa0=_0x36e5bc?normalizeLocalFiles(_0xf8e6be)[_0x17bc89(0x1d8)](_0x232270=>_0x36e5bc[_0x17bc89(0x1ea)]['some'](_0x55b040=>_0x55b040['path']===_0x232270[_0x17bc89(0x1d3)])):undefined,_0x5ec92e=buildMetadata(_0xabe444,_0x16e9e9[_0x17bc89(0x20e)]??_0x17bc89(0x1d7),_0x390a49,contentHash(_0xabe444['content']??''),_0x16e9e9[_0x17bc89(0x20f)],_0x14daa0);writeJsonAtomic(resolve(_0x5c3961,METADATA_FILE),_0x5ec92e);}export function deriveSkillCodeFromDirectory(_0x2850fc,_0x241c8d){const _0x135e0a=a141_0x28b1,_0x368f31=basename(resolve(_0x2850fc)),_0x564f14=_0x241c8d+'--';return _0x368f31[_0x135e0a(0x1f2)](_0x564f14)?_0x368f31[_0x135e0a(0x1da)](_0x564f14[_0x135e0a(0x1e1)]):_0x368f31;}function resolvePushSkillCode(_0x42b017,_0x4b88a7,_0x2fa132,_0x4db54b){const _0x3d5326=a141_0x28b1,_0x219966=deriveSkillCodeFromSkillFile(_0x42b017)||deriveSkillCodeFromDirectory(_0x42b017,_0x4b88a7);if(_0x4db54b[_0x3d5326(0x1e5)])return _0x219966;return _0x2fa132?.[_0x3d5326(0x1ed)]?.[_0x3d5326(0x1e0)]()||_0x219966;}function deriveSkillCodeFromSkillFile(_0x3097f3){const _0x48693c=a141_0x28b1,_0x48f482=resolve(_0x3097f3,SKILL_FILE);if(!existsSync(_0x48f482)||!lstatSync(_0x48f482)[_0x48693c(0x215)]())return undefined;const _0x4edee5=readFileSync(_0x48f482,_0x48693c(0x208)),_0x45c469=_0x4edee5[_0x48693c(0x1fc)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x45c469)return undefined;const _0x450609=parseFrontmatterObject(_0x45c469[0x1]??''),_0xbc1d87=scalarToString(_0x450609?.[_0x48693c(0x201)]);return _0xbc1d87?slugifySkillName(_0xbc1d87):undefined;}function a141_0x45da(){const _0x25d4fe=['ignoreMetadataForPayload','\x20to\x20submit\x20company\x20Skills\x20for\x20review.','manifest','1028930JIPaVr','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20','Skill\x20metadata\x20appCode\x20\x22','builtin','match','tags','isDirectory','isSymbolicLink','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20','name','2pcGkSO','refreshedAt','(unknown)','275892MkLUSM','isArray','Invalid\x20','utf8','excludedFilePaths','validation','ignoreInvalidMetadata','12bLBjQY',',\x20or\x20directory\x20name.','scope','pushedAt','114525WMwmNm','\x20name\x20for\x20SkillHub\x20slug\x20generation.','\x20has\x20scope=\x22','content','sourceSessionId','isFile','Unable\x20to\x20resolve\x20skillCode\x20from\x20','packageBase64','path','toLowerCase','169764Nxzpnb','skillName','personal','filter','find','slice','104hILsWA','ignoreMetadataScope','replace','dir','Skill\x20directory\x20not\x20found:\x20','trim','length','company','Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20','metadata','ignoreMetadataSkillCode','example','displayName','241213oPfeJt','appCode','files','Remote\x20Skill\x20','string','skillCode','159333ryRfDn','2729620CeNIHv','Missing\x20','description','startsWith','\x20has\x20unsupported\x20scope\x20\x22','unknown'];a141_0x45da=function(){return _0x25d4fe;};return a141_0x45da();}function readSkillDisplayName(_0x210df4){const _0x6323fa=a141_0x28b1,_0x2630f9=_0x210df4['match'](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x2630f9)return undefined;const _0x988d0=parseFrontmatterObject(_0x2630f9[0x1]??'');return scalarToString(_0x988d0?.[_0x6323fa(0x1e7)]);}function slugifySkillName(_0x3fd663){const _0x44bbf9=a141_0x28b1,_0x29377c=_0x3fd663[_0x44bbf9(0x1e0)]()[_0x44bbf9(0x1d4)]()['replace'](/[^\p{L}\p{N}\p{So}]+/gu,'-')[_0x44bbf9(0x1dd)](/^-+/,'')['replace'](/-+$/,'')[_0x44bbf9(0x1dd)](/-{2,}/g,'-');if(!_0x29377c)throw CliErrors['validation'](_0x44bbf9(0x207)+SKILL_FILE+_0x44bbf9(0x211));return _0x29377c;}function parseFrontmatterObject(_0x3e3613){const _0x497f86=a141_0x28b1;try{const _0x336d6c=a141_0x457f87(_0x3e3613);return _0x336d6c&&typeof _0x336d6c==='object'&&!Array[_0x497f86(0x206)](_0x336d6c)?_0x336d6c:undefined;}catch{return undefined;}}function scalarToString(_0x2748be){const _0x3ee848=a141_0x28b1;if(typeof _0x2748be===_0x3ee848(0x1ec))return _0x2748be[_0x3ee848(0x1e0)]();if(typeof _0x2748be==='number'||typeof _0x2748be==='boolean')return String(_0x2748be);return undefined;}function resolvePushDirectoryRoot(_0x2d9f51){const _0xb1670a=a141_0x28b1,_0x3f2bef=resolve(_0x2d9f51);if(!existsSync(_0x3f2bef))throw CliErrors[_0xb1670a(0x20a)](_0xb1670a(0x1df)+_0x2d9f51);const _0x87b9ab=lstatSync(_0x3f2bef);if(_0x87b9ab[_0xb1670a(0x1fe)]())return _0x3f2bef;if(_0x87b9ab[_0xb1670a(0x1ff)]()){const _0x12be2e=realpathSync(_0x3f2bef);if(lstatSync(_0x12be2e)['isDirectory']())return _0x12be2e;}throw CliErrors[_0xb1670a(0x20a)](_0xb1670a(0x1df)+_0x2d9f51);}function requireRemoteScope(_0x45e212){const _0x357d8a=a141_0x28b1;if(_0x45e212[_0x357d8a(0x20e)]==='personal'||_0x45e212[_0x357d8a(0x20e)]===_0x357d8a(0x1e2)||_0x45e212['scope']===_0x357d8a(0x1fb))return _0x45e212[_0x357d8a(0x20e)];throw CliErrors[_0x357d8a(0x20a)](_0x357d8a(0x1eb)+(_0x45e212[_0x357d8a(0x1ed)]||_0x357d8a(0x204))+_0x357d8a(0x1f3)+(_0x45e212[_0x357d8a(0x20e)]??_0x357d8a(0x1f4))+'\x22.');}function readLocalSkillContent(_0x549ca1){const _0x283e65=a141_0x28b1,_0x11f40f=resolve(_0x549ca1,SKILL_FILE);return existsSync(_0x11f40f)&&lstatSync(_0x11f40f)[_0x283e65(0x215)]()?readFileSync(_0x11f40f,'utf8'):'';}function readPushMetadataIfPresent(_0x4b3cee,_0x466e66={}){const _0x4d5859=a141_0x28b1;try{return readMetadataIfPresent(_0x4b3cee);}catch(_0x1c2638){if(_0x466e66[_0x4d5859(0x20b)])return undefined;throw _0x1c2638;}}
|
|
1
|
+
(function(_0x4a716c,_0x9ab9cf){const _0x39e47a=a141_0x37e7,_0x134051=_0x4a716c();while(!![]){try{const _0x219ff1=-parseInt(_0x39e47a(0x17f))/0x1*(parseInt(_0x39e47a(0x155))/0x2)+-parseInt(_0x39e47a(0x142))/0x3+parseInt(_0x39e47a(0x169))/0x4*(parseInt(_0x39e47a(0x151))/0x5)+parseInt(_0x39e47a(0x167))/0x6*(-parseInt(_0x39e47a(0x172))/0x7)+parseInt(_0x39e47a(0x183))/0x8*(parseInt(_0x39e47a(0x178))/0x9)+-parseInt(_0x39e47a(0x154))/0xa*(-parseInt(_0x39e47a(0x15b))/0xb)+parseInt(_0x39e47a(0x14b))/0xc;if(_0x219ff1===_0x9ab9cf)break;else _0x134051['push'](_0x134051['shift']());}catch(_0x22f5ec){_0x134051['push'](_0x134051['shift']());}}}(a141_0xcd98,0x4f328));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a141_0x35be4c}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{writeJsonAtomic}from'./fs-utils.js';import{contentHash}from'./hashing.js';import{fileText,normalizeLocalFiles,scanSkillDirectory}from'./local-files.js';import{buildMetadata,readMetadataIfPresent}from'./metadata.js';import{buildSkillPackage,tryNormalizePackageManifest}from'./zip-package.js';export function resolvePushDirectoryIdentity(_0x28ff47,_0x50f1fa,_0x38ee66={}){const _0x1a2038=a141_0x37e7,_0x225db1=resolvePushDirectoryRoot(_0x28ff47),_0x29c18e=readPushMetadataIfPresent(resolve(_0x225db1,METADATA_FILE),{'ignoreInvalidMetadata':_0x38ee66[_0x1a2038(0x145)]});if(_0x29c18e?.['appCode']&&_0x29c18e[_0x1a2038(0x14f)]!==_0x50f1fa&&!_0x38ee66[_0x1a2038(0x141)]&&!_0x38ee66[_0x1a2038(0x143)])throw CliErrors[_0x1a2038(0x16c)](_0x1a2038(0x15f)+_0x29c18e['appCode']+'\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22'+_0x50f1fa+'\x22.');const _0x55ca11=resolvePushSkillCode(_0x225db1,_0x50f1fa,_0x29c18e,_0x38ee66);if(!_0x55ca11)throw CliErrors[_0x1a2038(0x16c)](_0x1a2038(0x165)+SKILL_FILE+',\x20'+METADATA_FILE+_0x1a2038(0x171));return{'dir':_0x225db1,'skillCode':_0x55ca11,'metadata':_0x29c18e};}export function readPushDirectory(_0x1994f9,_0x7fc433,_0x11e770={}){const _0x4c2b05=a141_0x37e7,_0x5178d5=resolvePushDirectoryIdentity(_0x1994f9,_0x7fc433,_0x11e770),_0x1e17f7=_0x5178d5[_0x4c2b05(0x166)],_0x3a89b7=resolve(_0x1e17f7,SKILL_FILE);if(!existsSync(_0x3a89b7)||!lstatSync(_0x3a89b7)[_0x4c2b05(0x14d)]())throw CliErrors[_0x4c2b05(0x16c)](_0x4c2b05(0x149)+SKILL_FILE+':\x20'+_0x3a89b7);const _0x45307b=_0x5178d5[_0x4c2b05(0x17d)],_0x11bfe8=_0x11e770[_0x4c2b05(0x13d)]??_0x4c2b05(0x17e);if(!_0x11e770['ignoreMetadataScope']&&_0x45307b?.[_0x4c2b05(0x181)]===_0x4c2b05(0x174))throw CliErrors[_0x4c2b05(0x16c)](_0x4c2b05(0x159)+METADATA_FILE+_0x4c2b05(0x17c)+_0x45307b[_0x4c2b05(0x181)]+'\x22.');if(!_0x11e770[_0x4c2b05(0x152)]&&_0x11bfe8==='personal'&&_0x45307b?.['scope']&&_0x45307b[_0x4c2b05(0x181)]!=='personal')throw CliErrors[_0x4c2b05(0x16c)](_0x4c2b05(0x176)+METADATA_FILE+_0x4c2b05(0x17c)+_0x45307b[_0x4c2b05(0x181)]+'\x22.',_0x4c2b05(0x160)+_0x1e17f7+_0x4c2b05(0x156));const _0x16faa6=scanSkillDirectory(_0x1e17f7,{'excludedFilePaths':_0x11e770[_0x4c2b05(0x16a)]}),_0x2879d0=buildSkillPackage(_0x16faa6),_0x540b2d=readFileSync(_0x3a89b7,_0x4c2b05(0x13e)),_0x3fe839=_0x5178d5[_0x4c2b05(0x182)],_0x324bf1=_0x11e770[_0x4c2b05(0x153)]?undefined:_0x45307b,_0x23ac48=readSkillDisplayName(_0x540b2d);return{'skillCode':_0x3fe839,'metadata':_0x45307b,'frontmatterDisplayName':_0x23ac48,'input':{'skillCode':_0x3fe839,'skillName':_0x23ac48??_0x324bf1?.[_0x4c2b05(0x16d)],'description':_0x324bf1?.[_0x4c2b05(0x15e)],'content':_0x540b2d,'files':_0x2879d0[_0x4c2b05(0x16e)],'packageBase64':_0x2879d0['packageBase64'],'tags':_0x324bf1?.[_0x4c2b05(0x179)],'version':_0x324bf1?.[_0x4c2b05(0x175)],'sourceSessionId':_0x324bf1?.[_0x4c2b05(0x147)]}};}export function refreshPushDirectoryMetadataFromRemote(_0x1d0542,_0x273001,_0x43408b,_0x31c720={}){const _0x10f753=a141_0x37e7,_0x4fc1c8=resolvePushDirectoryRoot(_0x1d0542),_0x5355a9=readPushMetadataIfPresent(resolve(_0x4fc1c8,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x5ab6a6=requireRemoteScope(_0x273001),_0x49a6c3=readLocalSkillContent(_0x4fc1c8),_0x5efafd={..._0x273001,'appCode':_0x273001['appCode']??_0x43408b,'skillName':_0x273001['skillName']??_0x5355a9?.[_0x10f753(0x16d)],'description':_0x273001[_0x10f753(0x15e)]??_0x5355a9?.['description'],'example':_0x273001[_0x10f753(0x148)]??_0x5355a9?.[_0x10f753(0x148)],'tags':Array[_0x10f753(0x14e)](_0x273001[_0x10f753(0x179)])?_0x273001[_0x10f753(0x179)]:_0x5355a9?.[_0x10f753(0x179)],'sourceSessionId':_0x273001[_0x10f753(0x147)]??_0x5355a9?.[_0x10f753(0x147)],'content':_0x273001[_0x10f753(0x177)]??_0x49a6c3},_0x32cfe5=buildMetadata(_0x5efafd,_0x5ab6a6,_0x43408b,contentHash(_0x49a6c3),_0x31c720[_0x10f753(0x15d)]);writeJsonAtomic(resolve(_0x4fc1c8,METADATA_FILE),_0x32cfe5);}export function recordPushedRuntimeSkill(_0x273270,_0x1205b2,_0x3e7546,_0xb7a059={}){const _0x9ef5a4=a141_0x37e7,_0x4983e3=resolvePushDirectoryRoot(_0x273270),_0x3e5773=scanSkillDirectory(_0x4983e3),_0x5726b3=_0x3e5773[_0x9ef5a4(0x14c)](_0x172b70=>_0x172b70[_0x9ef5a4(0x157)]===SKILL_FILE),_0x492bc7=_0x5726b3?fileText(_0x5726b3):'',_0x64ac5a=tryNormalizePackageManifest(_0x1205b2[_0x9ef5a4(0x17b)]),_0x3b7676={..._0x1205b2,'content':_0x1205b2[_0x9ef5a4(0x177)]??_0x492bc7,'files':_0x64ac5a},_0x3cfb2e=_0x64ac5a?normalizeLocalFiles(_0x3e5773)[_0x9ef5a4(0x158)](_0x5eda69=>_0x64ac5a[_0x9ef5a4(0x17b)][_0x9ef5a4(0x163)](_0x2b4ee0=>_0x2b4ee0[_0x9ef5a4(0x157)]===_0x5eda69[_0x9ef5a4(0x157)])):undefined,_0x37af5a=buildMetadata(_0x3b7676,_0xb7a059[_0x9ef5a4(0x181)]??_0x9ef5a4(0x17e),_0x3e7546,contentHash(_0x3b7676[_0x9ef5a4(0x177)]??''),_0xb7a059[_0x9ef5a4(0x14a)],_0x3cfb2e);writeJsonAtomic(resolve(_0x4983e3,METADATA_FILE),_0x37af5a);}export function deriveSkillCodeFromDirectory(_0xa6e6bd,_0x8391a1){const _0x260f14=a141_0x37e7,_0x9af089=basename(resolve(_0xa6e6bd)),_0x27bd4f=_0x8391a1+'--';return _0x9af089[_0x260f14(0x140)](_0x27bd4f)?_0x9af089['slice'](_0x27bd4f[_0x260f14(0x13f)]):_0x9af089;}function a141_0x37e7(_0x4b5525,_0x580a61){_0x4b5525=_0x4b5525-0x13c;const _0xcd9834=a141_0xcd98();let _0x37e708=_0xcd9834[_0x4b5525];return _0x37e708;}function resolvePushSkillCode(_0x35c82f,_0x436593,_0x3b4258,_0x2d01ce){const _0x54ede2=a141_0x37e7,_0x1ee439=deriveSkillCodeFromSkillFile(_0x35c82f)||deriveSkillCodeFromDirectory(_0x35c82f,_0x436593);if(_0x2d01ce[_0x54ede2(0x16f)])return _0x1ee439;return _0x3b4258?.[_0x54ede2(0x182)]?.[_0x54ede2(0x173)]()||_0x1ee439;}function deriveSkillCodeFromSkillFile(_0xac5e58){const _0x2318d6=a141_0x37e7,_0x3c7441=resolve(_0xac5e58,SKILL_FILE);if(!existsSync(_0x3c7441)||!lstatSync(_0x3c7441)[_0x2318d6(0x14d)]())return undefined;const _0x39e157=readFileSync(_0x3c7441,_0x2318d6(0x13e)),_0x474b9f=_0x39e157['match'](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x474b9f)return undefined;const _0x1d1c3f=parseFrontmatterObject(_0x474b9f[0x1]??''),_0x42e8ca=scalarToString(_0x1d1c3f?.[_0x2318d6(0x164)]);return _0x42e8ca?slugifySkillName(_0x42e8ca):undefined;}function readSkillDisplayName(_0x106d67){const _0x427549=a141_0x37e7,_0x292566=_0x106d67[_0x427549(0x15a)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x292566)return undefined;const _0x3f153b=parseFrontmatterObject(_0x292566[0x1]??'');return scalarToString(_0x3f153b?.[_0x427549(0x13c)]);}function slugifySkillName(_0x26919e){const _0x519c80=a141_0x37e7,_0x55bb42=_0x26919e['trim']()[_0x519c80(0x168)]()[_0x519c80(0x144)](/[^\p{L}\p{N}\p{So}]+/gu,'-')['replace'](/^-+/,'')['replace'](/-+$/,'')[_0x519c80(0x144)](/-{2,}/g,'-');if(!_0x55bb42)throw CliErrors[_0x519c80(0x16c)](_0x519c80(0x161)+SKILL_FILE+_0x519c80(0x180));return _0x55bb42;}function parseFrontmatterObject(_0x42bcc5){const _0x306a1d=a141_0x37e7;try{const _0x456f41=a141_0x35be4c(_0x42bcc5);return _0x456f41&&typeof _0x456f41==='object'&&!Array[_0x306a1d(0x14e)](_0x456f41)?_0x456f41:undefined;}catch{return undefined;}}function scalarToString(_0x429fa9){const _0x46e0d6=a141_0x37e7;if(typeof _0x429fa9===_0x46e0d6(0x15c))return _0x429fa9[_0x46e0d6(0x173)]();if(typeof _0x429fa9===_0x46e0d6(0x16b)||typeof _0x429fa9==='boolean')return String(_0x429fa9);return undefined;}function resolvePushDirectoryRoot(_0x12e3e2){const _0x2e8c85=a141_0x37e7,_0xcd6727=resolve(_0x12e3e2);if(!existsSync(_0xcd6727))throw CliErrors[_0x2e8c85(0x16c)](_0x2e8c85(0x170)+_0x12e3e2);const _0x5e7f8b=lstatSync(_0xcd6727);if(_0x5e7f8b[_0x2e8c85(0x17a)]())return _0xcd6727;if(_0x5e7f8b[_0x2e8c85(0x146)]()){const _0x360696=realpathSync(_0xcd6727);if(lstatSync(_0x360696)[_0x2e8c85(0x17a)]())return _0x360696;}throw CliErrors['validation'](_0x2e8c85(0x170)+_0x12e3e2);}function a141_0xcd98(){const _0x4b96ef=['ignoreMetadataAppCodeMismatch','replace','ignoreInvalidMetadata','isSymbolicLink','sourceSessionId','example','Missing\x20','pushedAt','4117308XutFSJ','find','isFile','isArray','appCode','(unknown)','37815PldNmt','ignoreMetadataScope','ignoreMetadataForPayload','1510100ndJdei','454mGjUmi','\x20to\x20submit\x20company\x20Skills\x20for\x20review.','path','filter','Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20','match','22rEEADW','string','refreshedAt','description','Skill\x20metadata\x20appCode\x20\x22','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20','Invalid\x20','company','some','name','Unable\x20to\x20resolve\x20skillCode\x20from\x20','dir','19176byrwyf','toLowerCase','12CUqegm','excludedFilePaths','number','validation','skillName','manifest','ignoreMetadataSkillCode','Skill\x20directory\x20not\x20found:\x20',',\x20or\x20directory\x20name.','819Pwgwiw','trim','builtin','version','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20','content','1746gGHKEa','tags','isDirectory','files','\x20has\x20scope=\x22','metadata','personal','569yaOKyH','\x20name\x20for\x20SkillHub\x20slug\x20generation.','scope','skillCode','13816KKviAZ','displayName','targetScope','utf8','length','startsWith','allowAppCodeRetarget','526107MXMYCs'];a141_0xcd98=function(){return _0x4b96ef;};return a141_0xcd98();}function requireRemoteScope(_0x78c8bd){const _0x4b0cae=a141_0x37e7;if(_0x78c8bd[_0x4b0cae(0x181)]===_0x4b0cae(0x17e)||_0x78c8bd[_0x4b0cae(0x181)]===_0x4b0cae(0x162)||_0x78c8bd[_0x4b0cae(0x181)]===_0x4b0cae(0x174))return _0x78c8bd[_0x4b0cae(0x181)];throw CliErrors[_0x4b0cae(0x16c)]('Remote\x20Skill\x20'+(_0x78c8bd[_0x4b0cae(0x182)]||_0x4b0cae(0x150))+'\x20has\x20unsupported\x20scope\x20\x22'+(_0x78c8bd[_0x4b0cae(0x181)]??'unknown')+'\x22.');}function readLocalSkillContent(_0x17c4cd){const _0x13f061=resolve(_0x17c4cd,SKILL_FILE);return existsSync(_0x13f061)&&lstatSync(_0x13f061)['isFile']()?readFileSync(_0x13f061,'utf8'):'';}function readPushMetadataIfPresent(_0x504382,_0x4894a6={}){const _0x20011b=a141_0x37e7;try{return readMetadataIfPresent(_0x504382);}catch(_0x2715b3){if(_0x4894a6[_0x20011b(0x145)])return undefined;throw _0x2715b3;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x9cd136,_0x192a87){const _0x5d490=a142_0x2102,_0x3af058=_0x9cd136();while(!![]){try{const _0x200035=parseInt(_0x5d490(0x8f))/0x1*(-parseInt(_0x5d490(0x8a))/0x2)+-parseInt(_0x5d490(0x8c))/0x3*(parseInt(_0x5d490(0x8b))/0x4)+-parseInt(_0x5d490(0x86))/0x5*(parseInt(_0x5d490(0x88))/0x6)+-parseInt(_0x5d490(0x8e))/0x7+-parseInt(_0x5d490(0x92))/0x8*(-parseInt(_0x5d490(0x84))/0x9)+parseInt(_0x5d490(0x89))/0xa+parseInt(_0x5d490(0x90))/0xb;if(_0x200035===_0x192a87)break;else _0x3af058['push'](_0x3af058['shift']());}catch(_0x49ff51){_0x3af058['push'](_0x3af058['shift']());}}}(a142_0xe448,0x840f3));import{CliErrors}from'../../errors.js';export function normalizeRuntimeSkillScopes(_0x1d1d16){const _0x2dd543=a142_0x2102,_0x21a0b9=_0x1d1d16&&_0x1d1d16[_0x2dd543(0x85)]>0x0?_0x1d1d16:['personal',_0x2dd543(0x91),_0x2dd543(0x83)],_0xe9d8c8=[];for(const _0x584903 of _0x21a0b9){if(!isRuntimeSkillScope(_0x584903))throw CliErrors[_0x2dd543(0x8d)]('Unsupported\x20runtime\x20Skill\x20scope:\x20'+_0x584903);!_0xe9d8c8[_0x2dd543(0x93)](_0x584903)&&_0xe9d8c8['push'](_0x584903);}return _0xe9d8c8;}function a142_0x2102(_0x3738e6,_0x41a7f1){_0x3738e6=_0x3738e6-0x83;const _0xe44864=a142_0xe448();let _0x210207=_0xe44864[_0x3738e6];return _0x210207;}function a142_0xe448(){const _0x4a4869=['validation','6364001OuNTQm','16EmbzYY','9111751bKOAjY','company','8nKvDZw','includes','builtin','6882669yoJGym','length','5YHeGEG','personal','36606MsHygk','8218890nwfAwe','26330gBCfGd','2992688KSwhjH','3vxagtc'];a142_0xe448=function(){return _0x4a4869;};return a142_0xe448();}export function isRuntimeSkillScope(_0x3c388b){const _0x19edad=a142_0x2102;return _0x3c388b===_0x19edad(0x87)||_0x3c388b===_0x19edad(0x91)||_0x3c388b===_0x19edad(0x83);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a144_0x3b9c39=a144_0x2d9e;(function(_0x3f37cf,_0x422d66){const _0x343afc=a144_0x2d9e,_0x1e4e27=_0x3f37cf();while(!![]){try{const _0x4245f5=parseInt(_0x343afc(0x146))/0x1*(-parseInt(_0x343afc(0x145))/0x2)+parseInt(_0x343afc(0x147))/0x3+-parseInt(_0x343afc(0x14b))/0x4+parseInt(_0x343afc(0x13c))/0x5+-parseInt(_0x343afc(0x149))/0x6+parseInt(_0x343afc(0x13a))/0x7+parseInt(_0x343afc(0x13b))/0x8*(-parseInt(_0x343afc(0x14c))/0x9);if(_0x4245f5===_0x422d66)break;else _0x1e4e27['push'](_0x1e4e27['shift']());}catch(_0x8c867d){_0x1e4e27['push'](_0x1e4e27['shift']());}}}(a144_0x1fbf,0x47e62));import{unzipSync,zipSync}from'fflate';import{CliErrors}from'../../errors.js';import{compareSkillFiles,fileContent,normalizeLocalFiles,normalizeSkillRelativePath}from'./local-files.js';const ZIP_MTIME=new Date(a144_0x3b9c39(0x144));function a144_0x1fbf(){const _0x4ccee1=['validation','code','path','validation_error','entries','1980-01-01T00:00:00.000Z','762VyprOK','503dxoXIn','1699851WzauTX','endsWith','1199220RvHliG','Runtime\x20Skill\x20package\x20contains\x20directory\x20entry:\x20','764136UtuJRC','147006Vzwhda','Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.','length','971159CUAWpb','8HXJYVT','940125OqUzRa','name','map'];a144_0x1fbf=function(){return _0x4ccee1;};return a144_0x1fbf();}function a144_0x2d9e(_0x3ce646,_0x5c578a){_0x3ce646=_0x3ce646-0x138;const _0x1fbfa1=a144_0x1fbf();let _0x2d9e95=_0x1fbfa1[_0x3ce646];return _0x2d9e95;}export function createDeterministicZipPackage(_0x3dffb2){const _0x2f0c6a=a144_0x3b9c39,_0x29dadf={};for(const _0x1d7b1d of normalizeLocalFiles(_0x3dffb2)){_0x29dadf[_0x1d7b1d[_0x2f0c6a(0x141)]]=fileContent(_0x1d7b1d);}return Buffer['from'](zipSync(_0x29dadf,{'level':0x0,'mtime':ZIP_MTIME}));}export function parseZipPackage(_0x15a33d){const _0x47f3b9=a144_0x3b9c39;if(_0x15a33d[_0x47f3b9(0x139)]<0x16)throw CliErrors[_0x47f3b9(0x13f)](_0x47f3b9(0x138));let _0xe02065;try{_0xe02065=unzipSync(_0x15a33d,{'filter'(_0x2b147f){const _0x196a89=_0x47f3b9,_0x7f8e6f=normalizeSkillRelativePath(_0x2b147f[_0x196a89(0x13d)]);if(_0x7f8e6f[_0x196a89(0x148)]('/'))throw CliErrors[_0x196a89(0x13f)](_0x196a89(0x14a)+_0x7f8e6f);return!![];}});}catch(_0x1c22fb){if(isRuntimeSkillValidationError(_0x1c22fb))throw _0x1c22fb;throw CliErrors[_0x47f3b9(0x13f)](_0x47f3b9(0x138));}return Object[_0x47f3b9(0x143)](_0xe02065)[_0x47f3b9(0x13e)](([_0xf467d1,_0x4d42d8])=>({'path':normalizeSkillRelativePath(_0xf467d1),'bytes':Buffer['from'](_0x4d42d8)}))['sort'](compareSkillFiles);}function isRuntimeSkillValidationError(_0x3f812a){const _0x54cc18=a144_0x3b9c39;return typeof _0x3f812a==='object'&&_0x3f812a!==null&&'code'in _0x3f812a&&_0x3f812a[_0x54cc18(0x140)]===_0x54cc18(0x142);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x96461,_0x1cd938){const _0x1e1255=a145_0x49ae,_0xaca62=_0x96461();while(!![]){try{const _0x5cd4a7=parseInt(_0x1e1255(0xc0))/0x1+parseInt(_0x1e1255(0xc3))/0x2+-parseInt(_0x1e1255(0xbe))/0x3*(-parseInt(_0x1e1255(0xe5))/0x4)+parseInt(_0x1e1255(0xd4))/0x5+parseInt(_0x1e1255(0xd0))/0x6*(parseInt(_0x1e1255(0xe1))/0x7)+-parseInt(_0x1e1255(0xdb))/0x8*(parseInt(_0x1e1255(0xc5))/0x9)+-parseInt(_0x1e1255(0xc1))/0xa*(parseInt(_0x1e1255(0xd5))/0xb);if(_0x5cd4a7===_0x1cd938)break;else _0xaca62['push'](_0xaca62['shift']());}catch(_0x11cf17){_0xaca62['push'](_0xaca62['shift']());}}}(a145_0x3c9f,0x5e560));function a145_0x3c9f(){const _0x8ae8f=['228774ZKvYkb','80740XrOcte','toString','440970nToxWI','Duplicate\x20Skill\x20package\x20entry:\x20','576SNVaZD','Runtime\x20Skill\x20package\x20size\x20is\x20invalid.','files','Runtime\x20Skill\x20package\x20is\x20required\x20for\x20Skill\x20install:\x20','Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.','trim','Runtime\x20Skill\x20package\x20sha256\x20is\x20invalid.','base64','ossPath','validation','Runtime\x20Skill\x20package\x20size\x20mismatch.','8286mrCnvS','treeSha256','set','get','93250ReqcwO','913RmJlpq','zipSize','sha256','Runtime\x20Skill\x20package\x20entry\x20list\x20mismatch.','path','object','71512yfYHaJ','string','\x20in\x20Skill\x20file\x20package.','bytes','toLowerCase','some','3437UuktLH','Runtime\x20Skill\x20package\x20is\x20missing\x20entry:\x20','isArray','Runtime\x20Skill\x20file\x20tree\x20sha256\x20is\x20invalid.','18744xElARf','map','isSafeInteger','Runtime\x20Skill\x20manifest\x20is\x20missing\x20','Runtime\x20Skill\x20package\x20file\x20sha256\x20mismatch:\x20','size','length','309egIWop','zipSha256'];a145_0x3c9f=function(){return _0x8ae8f;};return a145_0x3c9f();}import{CliErrors}from'../../errors.js';import{SKILL_FILE}from'./constants.js';import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';function a145_0x49ae(_0x8e1756,_0x3f703c){_0x8e1756=_0x8e1756-0xbd;const _0x3c9fc8=a145_0x3c9f();let _0x49ae77=_0x3c9fc8[_0x8e1756];return _0x49ae77;}import{fileContent,isSha256Hex,normalizeLocalFiles,normalizeManifestFiles}from'./local-files.js';import{createDeterministicZipPackage,parseZipPackage}from'./zip-codec.js';export function buildSkillPackage(_0x357cb7){const _0x5b2423=a145_0x49ae,_0x5701b8=normalizeLocalFiles(_0x357cb7);if(!_0x5701b8[_0x5b2423(0xe0)](_0x2ce01a=>_0x2ce01a[_0x5b2423(0xd9)]===SKILL_FILE))throw CliErrors[_0x5b2423(0xce)]('Missing\x20'+SKILL_FILE+_0x5b2423(0xdd));const _0x2cc091=localFilesToManifestFiles(_0x5701b8),_0x3d05e5=createDeterministicZipPackage(_0x5701b8);return{'manifest':{'schemaVersion':0x2,'treeSha256':fileTreeHash(_0x2cc091),'zipSha256':bufferSha256(_0x3d05e5),'zipSize':_0x3d05e5[_0x5b2423(0xbd)],'files':_0x2cc091},'packageBytes':_0x3d05e5,'packageBase64':_0x3d05e5[_0x5b2423(0xc2)](_0x5b2423(0xcc))};}export function verifyRuntimeSkillPackage(_0x459b93,_0x272fab){const _0x416fc0=a145_0x49ae,_0x55fbed=normalizePackageManifest(_0x459b93,{'requireOssPath':![]});if(!_0x55fbed)throw CliErrors[_0x416fc0(0xce)](_0x416fc0(0xc9));return extractAndVerifyPackage(_0x55fbed,_0x272fab);}export function verifyRuntimeSkillBundle(_0x454921,_0x4c8178){const _0x174808=a145_0x49ae,_0x2ae55f=normalizePackageManifest(_0x454921,{'requireOssPath':![]});if(!_0x2ae55f)throw CliErrors[_0x174808(0xce)](_0x174808(0xc9));return extractAndVerifyPackageFiles(_0x2ae55f,_0x4c8178);}export function tryNormalizePackageManifest(_0x4ea602){return normalizePackageManifest(_0x4ea602,{'requireOssPath':![]});}export function requirePackageBytes(_0x9f5b83,_0x2d7bb9){const _0x17087e=a145_0x49ae;if(!_0x2d7bb9||_0x2d7bb9['length']===0x0)throw CliErrors[_0x17087e(0xce)](_0x17087e(0xc8)+_0x9f5b83);return _0x2d7bb9;}export function extractDownloadedPackage(_0x232685){const _0x2d8d0a=a145_0x49ae,_0x682e35=parseZipPackage(_0x232685)[_0x2d8d0a(0xe6)](_0x560088=>({'path':_0x560088[_0x2d8d0a(0xd9)],'bytes':_0x560088[_0x2d8d0a(0xde)]}));if(!_0x682e35[_0x2d8d0a(0xe0)](_0x5dab63=>_0x5dab63['path']===SKILL_FILE))throw CliErrors['validation']('Runtime\x20Skill\x20package\x20is\x20missing\x20'+SKILL_FILE+'.');return normalizeLocalFiles(_0x682e35);}export function localFilesToManifestFiles(_0xde2166){const _0x4dfb7c=a145_0x49ae;return normalizeLocalFiles(_0xde2166)[_0x4dfb7c(0xe6)](_0x16ef4e=>({'path':_0x16ef4e[_0x4dfb7c(0xd9)],'sha256':fileHash(_0x16ef4e),'size':fileContent(_0x16ef4e)[_0x4dfb7c(0xbd)]}));}function normalizePackageManifest(_0x157227,_0x5456d9){const _0x16bdbd=a145_0x49ae;if(!_0x157227||typeof _0x157227!==_0x16bdbd(0xda)||Array[_0x16bdbd(0xe3)](_0x157227))return undefined;const _0x48285a=_0x157227,_0x23cb5b=typeof _0x48285a[_0x16bdbd(0xcd)]===_0x16bdbd(0xdc)?_0x48285a[_0x16bdbd(0xcd)][_0x16bdbd(0xca)]():undefined;if(_0x5456d9['requireOssPath']&&!_0x23cb5b)return undefined;if(!Array[_0x16bdbd(0xe3)](_0x48285a[_0x16bdbd(0xc7)])||_0x48285a[_0x16bdbd(0xc7)][_0x16bdbd(0xbd)]===0x0)return undefined;if(!isSha256Hex(_0x48285a['treeSha256']))throw CliErrors[_0x16bdbd(0xce)](_0x16bdbd(0xe4));if(!isSha256Hex(_0x48285a['zipSha256']))throw CliErrors[_0x16bdbd(0xce)](_0x16bdbd(0xcb));if(!Number['isSafeInteger'](_0x48285a['zipSize'])||_0x48285a['zipSize']<0x0)throw CliErrors[_0x16bdbd(0xce)](_0x16bdbd(0xc6));const _0x51c72a=normalizeManifestFiles(_0x48285a[_0x16bdbd(0xc7)]);if(!_0x51c72a['some'](_0x28a862=>_0x28a862['path']===SKILL_FILE))throw CliErrors[_0x16bdbd(0xce)](_0x16bdbd(0xe8)+SKILL_FILE+'.');const _0x2d900a=fileTreeHash(_0x51c72a);if(_0x2d900a!==_0x48285a[_0x16bdbd(0xd1)][_0x16bdbd(0xdf)]())throw CliErrors[_0x16bdbd(0xce)]('Runtime\x20Skill\x20file\x20tree\x20sha256\x20mismatch.');return{'schemaVersion':Number[_0x16bdbd(0xe7)](_0x48285a['schemaVersion'])?_0x48285a['schemaVersion']:0x2,'ossPath':_0x23cb5b,'treeSha256':_0x2d900a,'zipSha256':_0x48285a[_0x16bdbd(0xbf)][_0x16bdbd(0xdf)](),'zipSize':_0x48285a[_0x16bdbd(0xd6)],'files':_0x51c72a};}function extractAndVerifyPackage(_0x114033,_0x162148){const _0x6b8293=a145_0x49ae,_0x292cb1=normalizePackageManifest(_0x114033,{'requireOssPath':![]});if(!_0x292cb1)throw CliErrors[_0x6b8293(0xce)]('Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.');if(_0x162148['length']!==_0x292cb1[_0x6b8293(0xd6)])throw CliErrors[_0x6b8293(0xce)](_0x6b8293(0xcf));const _0x284552=bufferSha256(_0x162148);if(_0x284552!==_0x292cb1[_0x6b8293(0xbf)])throw CliErrors[_0x6b8293(0xce)]('Runtime\x20Skill\x20package\x20sha256\x20mismatch.');return extractAndVerifyPackageFiles(_0x292cb1,_0x162148);}function extractAndVerifyPackageFiles(_0x280bac,_0x37ece3){const _0x1cca68=a145_0x49ae,_0x24b0ec=parseZipPackage(_0x37ece3);if(_0x24b0ec[_0x1cca68(0xbd)]!==_0x280bac[_0x1cca68(0xc7)][_0x1cca68(0xbd)])throw CliErrors[_0x1cca68(0xce)](_0x1cca68(0xd8));const _0xdd61a6=new Map();for(const _0x8e5df2 of _0x24b0ec){if(_0xdd61a6['has'](_0x8e5df2[_0x1cca68(0xd9)]))throw CliErrors[_0x1cca68(0xce)](_0x1cca68(0xc4)+_0x8e5df2[_0x1cca68(0xd9)]);_0xdd61a6[_0x1cca68(0xd2)](_0x8e5df2[_0x1cca68(0xd9)],_0x8e5df2);}const _0x418d27=[];for(const _0x58be33 of _0x280bac[_0x1cca68(0xc7)]){const _0x428161=_0xdd61a6[_0x1cca68(0xd3)](_0x58be33[_0x1cca68(0xd9)]);if(!_0x428161)throw CliErrors[_0x1cca68(0xce)](_0x1cca68(0xe2)+_0x58be33[_0x1cca68(0xd9)]);if(_0x428161[_0x1cca68(0xde)][_0x1cca68(0xbd)]!==_0x58be33[_0x1cca68(0xea)])throw CliErrors[_0x1cca68(0xce)]('Runtime\x20Skill\x20package\x20file\x20size\x20mismatch:\x20'+_0x58be33[_0x1cca68(0xd9)]);const _0x18f441=bufferSha256(_0x428161[_0x1cca68(0xde)]);if(_0x18f441!==_0x58be33[_0x1cca68(0xd7)])throw CliErrors['validation'](_0x1cca68(0xe9)+_0x58be33['path']);_0x418d27['push']({'path':_0x58be33[_0x1cca68(0xd9)],'bytes':_0x428161[_0x1cca68(0xde)]});}return normalizeLocalFiles(_0x418d27);}
|
|
@@ -8,7 +8,7 @@ export { contentHash, fileTreeHash, } from "./runtime-skill-sync/hashing.js";
|
|
|
8
8
|
export { linkEffectiveRuntimeSkills, linkGlobalRuntimeSkills, pruneStaleRuntimeSkillCache, pruneStaleRuntimeSkillLinks, } from "./runtime-skill-sync/links.js";
|
|
9
9
|
export { resolveRuntimeSkillInstallTarget } from "./runtime-skill-sync/install-target.js";
|
|
10
10
|
export { listLocalRuntimeSkills } from "./runtime-skill-sync/list-local.js";
|
|
11
|
-
export { materializeRuntimeSkill } from "./runtime-skill-sync/materialize.js";
|
|
11
|
+
export { materializeRuntimeSkill, reuseMaterializedRuntimeSkill, } from "./runtime-skill-sync/materialize.js";
|
|
12
12
|
export { readMetadataIfPresent } from "./runtime-skill-sync/metadata.js";
|
|
13
13
|
export { getRuntimeSkillCacheRoot, getRuntimeSkillDir, resolveSkillSyncPaths, runtimeAgentSkillRoots, } from "./runtime-skill-sync/paths.js";
|
|
14
14
|
export { deriveSkillCodeFromDirectory, readPushDirectory, refreshPushDirectoryMetadataFromRemote, recordPushedRuntimeSkill, resolvePushDirectoryIdentity, } from "./runtime-skill-sync/push.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1d7d9d,_0xa8bca4){var _0x44899c=a146_0x261a,_0x2520c9=_0x1d7d9d();while(!![]){try{var _0x57cfa1=-parseInt(_0x44899c(0x1dd))/0x1*(parseInt(_0x44899c(0x1e1))/0x2)+parseInt(_0x44899c(0x1de))/0x3+parseInt(_0x44899c(0x1df))/0x4+-parseInt(_0x44899c(0x1e3))/0x5*(parseInt(_0x44899c(0x1e6))/0x6)+-parseInt(_0x44899c(0x1e5))/0x7+-parseInt(_0x44899c(0x1e2))/0x8*(parseInt(_0x44899c(0x1e0))/0x9)+parseInt(_0x44899c(0x1e4))/0xa;if(_0x57cfa1===_0xa8bca4)break;else _0x2520c9['push'](_0x2520c9['shift']());}catch(_0x4148da){_0x2520c9['push'](_0x2520c9['shift']());}}}(a146_0x2d1b,0xa38ea));export{contentHash,fileTreeHash}from'./runtime-skill-sync/hashing.js';export{linkEffectiveRuntimeSkills,linkGlobalRuntimeSkills,pruneStaleRuntimeSkillCache,pruneStaleRuntimeSkillLinks}from'./runtime-skill-sync/links.js';function a146_0x261a(_0x28ff2b,_0x5104){_0x28ff2b=_0x28ff2b-0x1dd;var _0x2d1bc4=a146_0x2d1b();var _0x261a46=_0x2d1bc4[_0x28ff2b];return _0x261a46;}export{resolveRuntimeSkillInstallTarget}from'./runtime-skill-sync/install-target.js';export{listLocalRuntimeSkills}from'./runtime-skill-sync/list-local.js';function a146_0x2d1b(){var _0x429238=['200439sWmJsP','2877207BEMADs','1375600gYNPQH','45oDzujF','12LeVPZi','1457992loNfxO','711885XqbEOY','30779330zPZzyw','6196456yPYVvb','30aVJiME'];a146_0x2d1b=function(){return _0x429238;};return a146_0x2d1b();}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 a147_0x4f3210=a147_0x5395;(function(_0xf46760,_0x93aab0){const _0x4de9a2=a147_0x5395,_0x5c0304=_0xf46760();while(!![]){try{const _0x2efb2c=parseInt(_0x4de9a2(0x1e5))/0x1+-parseInt(_0x4de9a2(0x1ea))/0x2+-parseInt(_0x4de9a2(0x1e0))/0x3*(parseInt(_0x4de9a2(0x1e4))/0x4)+parseInt(_0x4de9a2(0x1e9))/0x5*(-parseInt(_0x4de9a2(0x1d8))/0x6)+parseInt(_0x4de9a2(0x1e6))/0x7+parseInt(_0x4de9a2(0x1d6))/0x8*(-parseInt(_0x4de9a2(0x1e2))/0x9)+parseInt(_0x4de9a2(0x1db))/0xa;if(_0x2efb2c===_0x93aab0)break;else _0x5c0304['push'](_0x5c0304['shift']());}catch(_0xe5def4){_0x5c0304['push'](_0x5c0304['shift']());}}}(a147_0x31f7,0x22c65));import{existsSync,readFileSync}from'node:fs';function a147_0x5395(_0x4a3b32,_0x420204){_0x4a3b32=_0x4a3b32-0x1d6;const _0x31f7cc=a147_0x31f7();let _0x539586=_0x31f7cc[_0x4a3b32];return _0x539586;}import{homedir}from'node:os';function a147_0x31f7(){const _0x39c758=['785526qGpTOC','skills','kind','115XNoSDD','217878iEeyzP','unverifiable','recorded','.agents','includes','unusable','utf8','object','join','map','number','\x20is\x20unreadable:\x20','version','\x20uses\x20unsupported\x20version\x20','280792HKzNPf','\x20records\x20\x22','1494cljQhY','.skill-lock.json','home','3413290fiwNLC','\x22\x20but\x20no\x20SKILL.md\x20was\x20found\x20in\x20known\x20layouts\x20','globalSkillsDirs','not-recorded','parse','735hWuoed','lockFile','36vSVsIe','absent','4408SpfJmG','213942DcRXCN'];a147_0x31f7=function(){return _0x39c758;};return a147_0x31f7();}import{join}from'node:path';export const SKILL_LOCK_RELATIVE_PATH=join(a147_0x4f3210(0x1ed),a147_0x4f3210(0x1d9));export const GLOBAL_SKILLS_DIR_RELATIVE_PATHS=[join(a147_0x4f3210(0x1ed),a147_0x4f3210(0x1e7)),join('.claude',a147_0x4f3210(0x1e7))];const SUPPORTED_LOCK_VERSIONS=[0x3];function readLockLookup(_0x129038,_0x1a1c4d){const _0x1a3f3a=a147_0x4f3210;if(!existsSync(_0x129038))return{'kind':_0x1a3f3a(0x1de)};let _0x1508a2;try{_0x1508a2=JSON[_0x1a3f3a(0x1df)](readFileSync(_0x129038,_0x1a3f3a(0x1f0)));}catch(_0x165360){return{'kind':_0x1a3f3a(0x1ef),'reason':_0x129038+_0x1a3f3a(0x1f5)+_0x165360['message']};}const _0xe4e8d7=_0x1508a2;if(typeof _0xe4e8d7?.[_0x1a3f3a(0x1f6)]!==_0x1a3f3a(0x1f4)||!SUPPORTED_LOCK_VERSIONS[_0x1a3f3a(0x1ee)](_0xe4e8d7[_0x1a3f3a(0x1f6)]))return{'kind':_0x1a3f3a(0x1ef),'reason':_0x129038+_0x1a3f3a(0x1f7)+String(_0xe4e8d7?.[_0x1a3f3a(0x1f6)])};if(!_0xe4e8d7[_0x1a3f3a(0x1e7)]||typeof _0xe4e8d7['skills']!==_0x1a3f3a(0x1f1))return{'kind':_0x1a3f3a(0x1ef),'reason':_0x129038+'\x20has\x20no\x20skills\x20map'};return _0xe4e8d7[_0x1a3f3a(0x1e7)][_0x1a1c4d]?{'kind':_0x1a3f3a(0x1ec)}:{'kind':_0x1a3f3a(0x1de)};}export function resolveInstalledSkill(_0x4a1bc3,_0x3783c3){const _0x52e48d=a147_0x4f3210,_0x318e92=_0x3783c3?.[_0x52e48d(0x1da)]??homedir(),_0x56e167=_0x3783c3?.[_0x52e48d(0x1dd)]??GLOBAL_SKILLS_DIR_RELATIVE_PATHS[_0x52e48d(0x1f3)](_0x55d82a=>join(_0x318e92,_0x55d82a)),_0x56c7df=_0x3783c3?.[_0x52e48d(0x1e1)]??join(_0x318e92,SKILL_LOCK_RELATIVE_PATH),_0x4fbeeb=_0x56e167[_0x52e48d(0x1f3)](_0x4068ce=>join(_0x4068ce,_0x4a1bc3,'SKILL.md')),_0xca2b6=_0x4fbeeb['find'](_0x44ec83=>existsSync(_0x44ec83));if(_0xca2b6)return{'state':'present','path':_0xca2b6};const _0xe220f=readLockLookup(_0x56c7df,_0x4a1bc3);if(_0xe220f[_0x52e48d(0x1e8)]==='unusable')return{'state':'unverifiable','reason':_0xe220f['reason']};if(_0xe220f[_0x52e48d(0x1e8)]===_0x52e48d(0x1ec))return{'state':_0x52e48d(0x1eb),'reason':_0x56c7df+_0x52e48d(0x1d7)+_0x4a1bc3+_0x52e48d(0x1dc)+('('+_0x4fbeeb[_0x52e48d(0x1f2)](',\x20')+')')};return{'state':_0x52e48d(0x1e3),'checked':_0x4fbeeb};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x71df3c,_0x242a0a){const _0x304e22=a148_0x2395,_0x283ff1=_0x71df3c();while(!![]){try{const _0x4aef63=-parseInt(_0x304e22(0xdf))/0x1*(-parseInt(_0x304e22(0xe3))/0x2)+parseInt(_0x304e22(0xdc))/0x3+-parseInt(_0x304e22(0xde))/0x4+-parseInt(_0x304e22(0xe1))/0x5*(-parseInt(_0x304e22(0xe2))/0x6)+-parseInt(_0x304e22(0xe4))/0x7+-parseInt(_0x304e22(0xdd))/0x8+parseInt(_0x304e22(0xe0))/0x9;if(_0x4aef63===_0x242a0a)break;else _0x283ff1['push'](_0x283ff1['shift']());}catch(_0x273fa8){_0x283ff1['push'](_0x283ff1['shift']());}}}(a148_0x1804,0xf359a));import{createJqFilter,resolveBundledJqPaths}from'@lovrabet/cli-framework';import{CliErrors}from'../errors.js';function a148_0x2395(_0x3688f4,_0x2beb30){_0x3688f4=_0x3688f4-0xdc;const _0x18040e=a148_0x1804();let _0x239501=_0x18040e[_0x3688f4];return _0x239501;}function a148_0x1804(){const _0x3b2ebf=['7931456lahgqq','5741xcCucb','20104506keeTHE','5RzylgK','8042442suhtoK','506UJjusP','3454493PQFYoM','759780waVTMI','14454792SckuGi'];a148_0x1804=function(){return _0x3b2ebf;};return a148_0x1804();}export const applyJqFilter=createJqFilter(CliErrors,{'bundledJqPaths':resolveBundledJqPaths()});
|