@lovrabet/lovrabet-cli 2.2.6 → 2.2.7
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.js +1 -1
- package/lib/skills/runtime-skill-sync/metadata.js +1 -1
- package/lib/skills/runtime-skill-sync/paths.js +1 -1
- package/lib/skills/runtime-skill-sync/push.js +1 -1
- package/lib/skills/runtime-skill-sync/scopes.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/utils/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_0x33224d=a135_0x32a4;(function(_0x3a1a0f,_0x3ba26c){const _0x20d373=a135_0x32a4,_0x3f4c60=_0x3a1a0f();while(!![]){try{const _0x5e6474=parseInt(_0x20d373(0x13c))/0x1*(parseInt(_0x20d373(0x114))/0x2)+-parseInt(_0x20d373(0x10a))/0x3+-parseInt(_0x20d373(0x120))/0x4*(parseInt(_0x20d373(0x126))/0x5)+-parseInt(_0x20d373(0x111))/0x6*(-parseInt(_0x20d373(0x138))/0x7)+parseInt(_0x20d373(0x13f))/0x8+-parseInt(_0x20d373(0x119))/0x9*(-parseInt(_0x20d373(0x115))/0xa)+-parseInt(_0x20d373(0x141))/0xb*(parseInt(_0x20d373(0x123))/0xc);if(_0x5e6474===_0x3ba26c)break;else _0x3f4c60['push'](_0x3f4c60['shift']());}catch(_0x2e78db){_0x3f4c60['push'](_0x3f4c60['shift']());}}}(a135_0x5585,0xb737b));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import a135_0x480ec3 from'fs-extra';function a135_0x5585(){const _0xa08b96=['skillRoots','name','isDirectory','dir','appCode','567195nOkdlg','has','created','Refusing\x20to\x20copy\x20Skill\x20symlink:\x20','Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20','removed','skillCode','6ycmuDH','managedRoot','linked-from-protected-root','494250cUwuhB','2890XKAeai','Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20','get','contentHash','10062cBJWTm','map','skill','startsWith','updated','filter','project','1708852KpkhnQ','runtime-observe','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20','29112hANkif','protectedLinkRoots','slice','10soniOA','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20','push','lovrabet','scope','pruneSkillCodes','metadata-mismatch','env','accessKey','unchanged','metadataPath','values','Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20','scopes','skipped','length','isSymbolicLink','1832677UcvfoD','trim','builtin','not-managed-symlink','5YSmUvV','personal','Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20','3882384CQmViq','secret-retriever','2321WVGNVW','company','validation'];a135_0x5585=function(){return _0xa08b96;};return a135_0x5585();}import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';import{isDanglingSymlink,isPathInside,lstatIfPresent,realOrResolved,resolveSymlinkTarget}from'./fs-utils.js';function a135_0x32a4(_0x4ae82e,_0x55517c){_0x4ae82e=_0x4ae82e-0x105;const _0x55858b=a135_0x5585();let _0x32a447=_0x55858b[_0x4ae82e];return _0x32a447;}import{readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillCacheRoot,resolveSkillSyncPaths,safePathSegment}from'./paths.js';const {copySync,ensureDirSync,removeSync}=a135_0x480ec3,RESERVED_PROJECT_SKILL_CODES=new Set([a135_0x33224d(0x12a),a135_0x33224d(0x121),a135_0x33224d(0x140)]);export function linkEffectiveRuntimeSkills(_0xa372d6,_0xfdc7d1){const _0x3f41e6=a135_0x33224d,_0x28690d=new Map();for(const _0x679122 of _0xa372d6){const _0x13fedb=_0x679122[_0x3f41e6(0x11b)][_0x3f41e6(0x110)];if(!_0x13fedb)continue;const _0x29ff1a=_0x28690d[_0x3f41e6(0x117)](_0x13fedb);(!_0x29ff1a||_0x679122['scope']===_0x3f41e6(0x13d))&&_0x28690d['set'](_0x13fedb,_0x679122);}const _0x575724=[];for(const _0xb1b28a of _0x28690d[_0x3f41e6(0x132)]()){const _0x2c1bcc=requireSkillCode(_0xb1b28a[_0x3f41e6(0x11b)]),_0x3b21cf=readMetadataIfPresent(_0xb1b28a['metadataPath']);if(_0x3b21cf?.[_0x3f41e6(0x109)]!==_0xfdc7d1[_0x3f41e6(0x109)]||_0x3b21cf[_0x3f41e6(0x110)]!==_0x2c1bcc)throw CliErrors[_0x3f41e6(0x143)](_0x3f41e6(0x116)+_0xfdc7d1[_0x3f41e6(0x109)]+':\x20'+_0xb1b28a[_0x3f41e6(0x131)]);const _0x3d5f30=runtimeSkillLinkName(_0xfdc7d1,_0x2c1bcc);for(const _0x1bab3a of _0xfdc7d1[_0x3f41e6(0x105)]){_0x575724[_0x3f41e6(0x129)](ensureManagedSymlink(resolve(_0x1bab3a,_0x3d5f30),_0xb1b28a['dir'],_0xfdc7d1,_0x2c1bcc));}}return _0x575724;}export function pruneStaleRuntimeSkillLinks(_0x325eae,_0x662633,_0x1611f1){const _0x36fdac=a135_0x33224d,_0xd49321=new Set([..._0x662633]['map'](_0xe16f88=>_0xe16f88['trim']())['filter'](Boolean)),_0x48ba67=_0x1611f1?new Set([..._0x1611f1][_0x36fdac(0x11a)](_0x18c91e=>_0x18c91e[_0x36fdac(0x139)]())[_0x36fdac(0x11e)](Boolean)):undefined,_0x473293=[];for(const _0x5d8d11 of _0x325eae[_0x36fdac(0x105)]){for(const _0x41353e of managedTargetSkillLinkPaths(_0x5d8d11,_0x325eae)){const _0x2f9faa=runtimeSkillCodeFromLink(_0x325eae,_0x41353e);if(_0x48ba67&&!_0x48ba67['has'](_0x2f9faa))continue;if(_0xd49321['has'](_0x2f9faa))continue;_0x473293[_0x36fdac(0x129)](removeManagedSkillLink(_0x41353e,_0x325eae,_0x2f9faa));}}return _0x473293;}export function pruneStaleRuntimeSkillCache(_0x1595aa,_0x4686b3={}){const _0x408776=a135_0x33224d,_0x4c8fa6=new Set([..._0x1595aa['activeSkillCodes']][_0x408776(0x11a)](_0x323d76=>_0x323d76['trim']())[_0x408776(0x11e)](Boolean)),_0x21b266=_0x1595aa[_0x408776(0x12c)]?new Set([..._0x1595aa[_0x408776(0x12c)]][_0x408776(0x11a)](_0x422dd6=>_0x422dd6[_0x408776(0x139)]())[_0x408776(0x11e)](Boolean)):undefined,_0x54cec4=_0x1595aa[_0x408776(0x134)]??[_0x408776(0x13d),_0x408776(0x142)],_0x5a94ef=resolve(getRuntimeSkillCacheRoot(_0x1595aa[_0x408776(0x12e)],_0x1595aa[_0x408776(0x12f)],_0x4686b3),safePathSegment(_0x1595aa['appCode'],'appCode')),_0x3ed9f6=[];for(const _0x5a0e28 of _0x54cec4){const _0x1003c6=resolve(_0x5a94ef,_0x5a0e28);if(!existsSync(_0x1003c6))continue;for(const _0x436b10 of readdirSync(_0x1003c6,{'withFileTypes':!![]})){if(!_0x436b10[_0x408776(0x107)]())continue;const _0x253d04=_0x436b10['name'];if(_0x21b266&&!_0x21b266['has'](_0x253d04))continue;if(_0x4c8fa6[_0x408776(0x10b)](_0x253d04))continue;const _0x284dba=resolve(_0x1003c6,_0x253d04),_0x28a11f=readMetadataIfPresent(resolve(_0x284dba,METADATA_FILE));if(_0x28a11f?.[_0x408776(0x109)]!==_0x1595aa['appCode']||_0x28a11f[_0x408776(0x12b)]!==_0x5a0e28||_0x28a11f[_0x408776(0x110)]!==_0x253d04){_0x3ed9f6[_0x408776(0x129)]({'path':_0x284dba,'action':_0x408776(0x135),'reason':'metadata-mismatch'});continue;}if(isLinkedFromAnyRoot(_0x284dba,_0x1595aa[_0x408776(0x124)]??[])){_0x3ed9f6[_0x408776(0x129)]({'path':_0x284dba,'action':_0x408776(0x135),'reason':_0x408776(0x113)});continue;}removeSync(_0x284dba),_0x3ed9f6['push']({'path':_0x284dba,'action':'removed'});}}return _0x3ed9f6;}export function linkGlobalRuntimeSkills(_0x319ae6,_0x4aeb6e={}){const _0x1b61df=a135_0x33224d,_0x310c9c=resolveSkillSyncPaths(_0x4aeb6e),_0x3b9750=[];for(const _0x25cbd4 of _0x319ae6){if(_0x25cbd4[_0x1b61df(0x12b)]!==_0x1b61df(0x13a))throw CliErrors[_0x1b61df(0x143)](_0x1b61df(0x127)+_0x25cbd4[_0x1b61df(0x12b)]);const _0x859dad=requireSkillCode(_0x25cbd4[_0x1b61df(0x11b)]),_0x5afc4f=copyManagedSkillDirectory(_0x25cbd4[_0x1b61df(0x108)],resolve(_0x310c9c['agentsSkillsDir'],_0x859dad));_0x3b9750['push']({..._0x5afc4f,'contentHash':_0x25cbd4[_0x1b61df(0x118)]});}return _0x3b9750;}function ensureManagedSymlink(_0xe623f7,_0x37bf26,_0x52cabf,_0x26ad86){const _0x465ef0=a135_0x33224d;mkdirSync(dirname(_0xe623f7),{'recursive':!![],'mode':0x1c0});if(existsSync(_0xe623f7)||isDanglingSymlink(_0xe623f7)){const _0x3224cb=lstatSync(_0xe623f7);if(!_0x3224cb['isSymbolicLink']())throw CliErrors['validation']('Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20'+_0xe623f7);const _0x33cb9d=resolveSymlinkTarget(_0xe623f7);if(!isPathInside(realOrResolved(_0x33cb9d),realOrResolved(_0x52cabf[_0x465ef0(0x112)])))throw CliErrors[_0x465ef0(0x143)](_0x465ef0(0x133)+_0xe623f7);if(realOrResolved(_0x33cb9d)===realOrResolved(_0x37bf26))return{'path':_0xe623f7,'target':_0x37bf26,'action':'unchanged'};const _0x13af5b=readMetadataIfPresent(resolve(_0x33cb9d,METADATA_FILE));if(_0x52cabf[_0x465ef0(0x12b)]===_0x465ef0(0x11f)&&(_0x13af5b?.[_0x465ef0(0x109)]!==_0x52cabf[_0x465ef0(0x109)]||_0x13af5b[_0x465ef0(0x110)]!==_0x26ad86))throw CliErrors['validation'](_0x465ef0(0x10e)+_0xe623f7);return unlinkSync(_0xe623f7),symlinkSync(_0x37bf26,_0xe623f7,'dir'),{'path':_0xe623f7,'target':_0x37bf26,'action':_0x465ef0(0x11d)};}return symlinkSync(_0x37bf26,_0xe623f7,_0x465ef0(0x108)),{'path':_0xe623f7,'target':_0x37bf26,'action':_0x465ef0(0x10c)};}function managedTargetSkillLinkPaths(_0x51fbcd,_0x3ac24f){const _0x413223=a135_0x33224d;if(!existsSync(_0x51fbcd))return[];const _0x398810=_0x3ac24f[_0x413223(0x109)]+'--';return readdirSync(_0x51fbcd,{'withFileTypes':!![]})[_0x413223(0x11e)](_0x308a02=>_0x3ac24f[_0x413223(0x12b)]===_0x413223(0x11f)||_0x308a02['name'][_0x413223(0x11c)](_0x398810))[_0x413223(0x11a)](_0x54d09a=>resolve(_0x51fbcd,_0x54d09a[_0x413223(0x106)]));}function removeManagedSkillLink(_0x2765e8,_0x2167f6,_0x174971){const _0x7c7c8f=a135_0x33224d,_0x578a31=lstatIfPresent(_0x2765e8);if(!_0x578a31?.[_0x7c7c8f(0x137)]())return{'path':_0x2765e8,'action':'skipped','reason':_0x7c7c8f(0x13b)};const _0x4f1a1d=resolveSymlinkTarget(_0x2765e8);if(!isPathInside(realOrResolved(_0x4f1a1d),realOrResolved(_0x2167f6['managedRoot'])))return{'path':_0x2765e8,'action':_0x7c7c8f(0x135),'reason':'external-symlink'};const _0x132edf=readMetadataIfPresent(resolve(_0x4f1a1d,METADATA_FILE));if(_0x2167f6[_0x7c7c8f(0x12b)]==='project'&&(_0x132edf?.[_0x7c7c8f(0x109)]!==_0x2167f6['appCode']||_0x132edf['skillCode']!==_0x174971))return{'path':_0x2765e8,'action':'skipped','reason':_0x7c7c8f(0x12d)};return unlinkSync(_0x2765e8),{'path':_0x2765e8,'action':_0x7c7c8f(0x10f)};}function isLinkedFromAnyRoot(_0x3819c3,_0x4e980b){const _0x1df640=a135_0x33224d,_0x408142=realOrResolved(_0x3819c3);for(const _0x5df03f of _0x4e980b){if(!existsSync(_0x5df03f))continue;for(const _0x4c693e of readdirSync(_0x5df03f,{'withFileTypes':!![]})){if(!_0x4c693e[_0x1df640(0x137)]())continue;const _0xfa063b=resolve(_0x5df03f,_0x4c693e['name']);if(realOrResolved(resolveSymlinkTarget(_0xfa063b))===_0x408142)return!![];}}return![];}function runtimeSkillLinkName(_0x33b94c,_0x1c607b){const _0x477ec1=a135_0x33224d,_0x54b807=safePathSegment(_0x1c607b,_0x477ec1(0x110));if(_0x33b94c['scope']==='project'&&RESERVED_PROJECT_SKILL_CODES[_0x477ec1(0x10b)](_0x54b807))throw CliErrors[_0x477ec1(0x143)](_0x477ec1(0x128)+_0x54b807);return _0x33b94c[_0x477ec1(0x12b)]===_0x477ec1(0x11f)?_0x54b807:_0x33b94c['appCode']+'--'+_0x54b807;}function runtimeSkillCodeFromLink(_0x2db720,_0x265c50){const _0x3077dd=a135_0x33224d,_0x19a55e=basename(_0x265c50);return _0x2db720[_0x3077dd(0x12b)]==='project'?_0x19a55e:_0x19a55e[_0x3077dd(0x125)]((_0x2db720[_0x3077dd(0x109)]+'--')[_0x3077dd(0x136)]);}export function copyManagedSkillDirectory(_0x4c4cad,_0x1b9c76){const _0x561a39=a135_0x33224d,_0x3695a3=resolve(_0x1b9c76,METADATA_FILE),_0x16e5b3=existsSync(_0x1b9c76);if(_0x16e5b3){const _0x12ec8a=lstatSync(_0x1b9c76);if(_0x12ec8a[_0x561a39(0x137)]())throw CliErrors[_0x561a39(0x143)]('Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20'+_0x1b9c76);if(!_0x12ec8a[_0x561a39(0x107)]())throw CliErrors['validation'](_0x561a39(0x13e)+_0x1b9c76);const _0x1b4100=readMetadataIfPresent(_0x3695a3);if(_0x1b4100?.[_0x561a39(0x12b)]!=='builtin')throw CliErrors[_0x561a39(0x143)](_0x561a39(0x122)+_0x1b9c76);}ensureDirSync(dirname(_0x1b9c76));const _0x4e4456=_0x16e5b3?readMetadataIfPresent(_0x3695a3)?.['contentHash']:undefined,_0x521e24=readMetadataIfPresent(resolve(_0x4c4cad,METADATA_FILE))?.[_0x561a39(0x118)];return _0x16e5b3&&removeSync(_0x1b9c76),copySkillDirectory(_0x4c4cad,_0x1b9c76),{'path':_0x1b9c76,'target':_0x4c4cad,'action':!_0x16e5b3?'created':_0x4e4456===_0x521e24?_0x561a39(0x130):'updated'};}function copySkillDirectory(_0x1d522b,_0xc02b14){copySync(_0x1d522b,_0xc02b14,{'dereference':![],'overwrite':!![],'filter'(_0x397264){const _0x311751=a135_0x32a4;if(lstatSync(_0x397264)[_0x311751(0x137)]())throw CliErrors['validation'](_0x311751(0x10d)+_0x397264);return!![];}});}
|
|
1
|
+
const a135_0x2b007e=a135_0x5883;(function(_0x4087fa,_0x4bb8fd){const _0xda6133=a135_0x5883,_0x58a7b5=_0x4087fa();while(!![]){try{const _0x2baaf7=-parseInt(_0xda6133(0x107))/0x1+-parseInt(_0xda6133(0x121))/0x2+-parseInt(_0xda6133(0x122))/0x3+-parseInt(_0xda6133(0x116))/0x4+-parseInt(_0xda6133(0x109))/0x5*(parseInt(_0xda6133(0x12d))/0x6)+parseInt(_0xda6133(0x106))/0x7+-parseInt(_0xda6133(0x10f))/0x8*(-parseInt(_0xda6133(0x119))/0x9);if(_0x2baaf7===_0x4bb8fd)break;else _0x58a7b5['push'](_0x58a7b5['shift']());}catch(_0x1db4a0){_0x58a7b5['push'](_0x58a7b5['shift']());}}}(a135_0x4599,0x94f8c));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import a135_0x443f17 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';function a135_0x5883(_0x349b0c,_0x11f421){_0x349b0c=_0x349b0c-0x102;const _0x4599cd=a135_0x4599();let _0x58839b=_0x4599cd[_0x349b0c];return _0x58839b;}const {copySync,ensureDirSync,removeSync}=a135_0x443f17,RESERVED_PROJECT_SKILL_CODES=new Set([a135_0x2b007e(0x118),a135_0x2b007e(0x111),a135_0x2b007e(0x110)]);export function linkEffectiveRuntimeSkills(_0x4d8f8f,_0xbdae1f){const _0x18983e=a135_0x2b007e,_0x1ef113=new Map();for(const _0x176dd9 of _0x4d8f8f){const _0x101c0d=_0x176dd9[_0x18983e(0x11e)]['skillCode'];if(!_0x101c0d)continue;const _0x2ad408=_0x1ef113['get'](_0x101c0d);(!_0x2ad408||_0x176dd9[_0x18983e(0x11a)]===_0x18983e(0x112))&&_0x1ef113[_0x18983e(0x113)](_0x101c0d,_0x176dd9);}const _0x18a5cc=[];for(const _0x4bb061 of _0x1ef113[_0x18983e(0x127)]()){const _0x584877=requireSkillCode(_0x4bb061[_0x18983e(0x11e)]),_0x401104=readMetadataIfPresent(_0x4bb061[_0x18983e(0x104)]);if(_0x401104?.[_0x18983e(0x134)]!==_0xbdae1f[_0x18983e(0x134)]||_0x401104[_0x18983e(0x10b)]!==_0x584877)throw CliErrors[_0x18983e(0x10e)](_0x18983e(0x114)+_0xbdae1f[_0x18983e(0x134)]+':\x20'+_0x4bb061['metadataPath']);const _0x1e1186=runtimeSkillLinkName(_0xbdae1f,_0x584877);for(const _0x6b77fd of _0xbdae1f[_0x18983e(0x12e)]){_0x18a5cc[_0x18983e(0x11b)](ensureManagedSymlink(resolve(_0x6b77fd,_0x1e1186),_0x4bb061['dir'],_0xbdae1f,_0x584877));}}return _0x18a5cc;}export function pruneStaleRuntimeSkillLinks(_0x30609f,_0x141574,_0x343fdf){const _0x3ef335=a135_0x2b007e,_0x27cf2c=new Set([..._0x141574]['map'](_0xce9dfd=>_0xce9dfd[_0x3ef335(0x138)]())[_0x3ef335(0x11f)](Boolean)),_0x3ba0e3=_0x343fdf?new Set([..._0x343fdf][_0x3ef335(0x10a)](_0x2b001d=>_0x2b001d['trim']())[_0x3ef335(0x11f)](Boolean)):undefined,_0xfaf9cd=[];for(const _0x4a1ef1 of _0x30609f[_0x3ef335(0x12e)]){for(const _0x3c64ac of managedTargetSkillLinkPaths(_0x4a1ef1,_0x30609f)){const _0x3f1782=runtimeSkillCodeFromLink(_0x30609f,_0x3c64ac);if(_0x3ba0e3&&!_0x3ba0e3[_0x3ef335(0x103)](_0x3f1782))continue;if(_0x27cf2c['has'](_0x3f1782))continue;_0xfaf9cd[_0x3ef335(0x11b)](removeManagedSkillLink(_0x3c64ac,_0x30609f,_0x3f1782));}}return _0xfaf9cd;}export function pruneStaleRuntimeSkillCache(_0x30187b,_0x59ea13={}){const _0x2f706a=a135_0x2b007e,_0x43c7cc=new Set([..._0x30187b['activeSkillCodes']][_0x2f706a(0x10a)](_0x297b92=>_0x297b92['trim']())[_0x2f706a(0x11f)](Boolean)),_0x30715c=_0x30187b[_0x2f706a(0x11d)]?new Set([..._0x30187b[_0x2f706a(0x11d)]][_0x2f706a(0x10a)](_0x4a2bab=>_0x4a2bab[_0x2f706a(0x138)]())['filter'](Boolean)):undefined,_0x48a66c=_0x30187b[_0x2f706a(0x12a)]??[_0x2f706a(0x112),_0x2f706a(0x13c)],_0x45ac8c=resolve(getRuntimeSkillCacheRoot(_0x30187b[_0x2f706a(0x102)],_0x30187b['accessKey'],_0x59ea13),safePathSegment(_0x30187b[_0x2f706a(0x134)],_0x2f706a(0x134))),_0xccece3=[];for(const _0x565ea1 of _0x48a66c){const _0x4c494e=resolve(_0x45ac8c,_0x565ea1);if(!existsSync(_0x4c494e))continue;for(const _0x58380e of readdirSync(_0x4c494e,{'withFileTypes':!![]})){if(!_0x58380e['isDirectory']())continue;const _0x234442=_0x58380e[_0x2f706a(0x137)];if(_0x30715c&&!_0x30715c[_0x2f706a(0x103)](_0x234442))continue;if(_0x43c7cc[_0x2f706a(0x103)](_0x234442))continue;const _0x34df43=resolve(_0x4c494e,_0x234442),_0x3badf5=readMetadataIfPresent(resolve(_0x34df43,METADATA_FILE));if(_0x3badf5?.[_0x2f706a(0x134)]!==_0x30187b[_0x2f706a(0x134)]||_0x3badf5[_0x2f706a(0x11a)]!==_0x565ea1||_0x3badf5[_0x2f706a(0x10b)]!==_0x234442){_0xccece3[_0x2f706a(0x11b)]({'path':_0x34df43,'action':_0x2f706a(0x108),'reason':_0x2f706a(0x124)});continue;}if(isLinkedFromAnyRoot(_0x34df43,_0x30187b[_0x2f706a(0x12c)]??[])){_0xccece3[_0x2f706a(0x11b)]({'path':_0x34df43,'action':'skipped','reason':_0x2f706a(0x11c)});continue;}removeSync(_0x34df43),_0xccece3[_0x2f706a(0x11b)]({'path':_0x34df43,'action':_0x2f706a(0x130)});}}return _0xccece3;}function a135_0x4599(){const _0x2df746=['personal','set','Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20','contentHash','1590484IAYKGU','managedRoot','lovrabet','262467oxmKMD','scope','push','linked-from-protected-root','pruneSkillCodes','skill','filter','Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20','1732746iygCPN','231687LcIkNb','project','metadata-mismatch','isDirectory','Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20','values','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20','Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20','scopes','created','protectedLinkRoots','29754DmymvG','skillRoots','agentsSkillsDir','removed','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','builtin','dir','appCode','isSymbolicLink','length','name','trim','Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20','unchanged','updated','company','env','has','metadataPath','startsWith','883568dHULlW','14419mOHNBu','skipped','1115mhALta','map','skillCode','slice','not-managed-symlink','validation','808WvhwyC','secret-retriever','runtime-observe'];a135_0x4599=function(){return _0x2df746;};return a135_0x4599();}export function linkGlobalRuntimeSkills(_0x1894ad,_0x59741f={}){const _0x26b72f=a135_0x2b007e,_0x46131e=resolveSkillSyncPaths(_0x59741f),_0x1ce406=[];for(const _0x5a59da of _0x1894ad){if(_0x5a59da[_0x26b72f(0x11a)]!==_0x26b72f(0x132))throw CliErrors['validation'](_0x26b72f(0x131)+_0x5a59da[_0x26b72f(0x11a)]);const _0x3fed29=requireSkillCode(_0x5a59da[_0x26b72f(0x11e)]),_0x2aceff=copyManagedSkillDirectory(_0x5a59da[_0x26b72f(0x133)],resolve(_0x46131e[_0x26b72f(0x12f)],_0x3fed29));_0x1ce406['push']({..._0x2aceff,'contentHash':_0x5a59da[_0x26b72f(0x115)]});}return _0x1ce406;}function ensureManagedSymlink(_0x2ab497,_0x3e7f08,_0x47b74b,_0x58dd96){const _0x20ea8d=a135_0x2b007e;mkdirSync(dirname(_0x2ab497),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x2ab497)||isDanglingSymlink(_0x2ab497)){const _0x19bbe5=lstatSync(_0x2ab497);if(!_0x19bbe5['isSymbolicLink']())throw CliErrors[_0x20ea8d(0x10e)](_0x20ea8d(0x139)+_0x2ab497);const _0x1e0837=resolveSymlinkTarget(_0x2ab497);if(!isPathInside(realOrResolved(_0x1e0837),realOrResolved(_0x47b74b['managedRoot'])))throw CliErrors['validation'](_0x20ea8d(0x126)+_0x2ab497);if(realOrResolved(_0x1e0837)===realOrResolved(_0x3e7f08))return{'path':_0x2ab497,'target':_0x3e7f08,'action':_0x20ea8d(0x13a)};const _0x53bdff=readMetadataIfPresent(resolve(_0x1e0837,METADATA_FILE));if(_0x47b74b['scope']===_0x20ea8d(0x123)&&(_0x53bdff?.[_0x20ea8d(0x134)]!==_0x47b74b[_0x20ea8d(0x134)]||_0x53bdff[_0x20ea8d(0x10b)]!==_0x58dd96))throw CliErrors[_0x20ea8d(0x10e)](_0x20ea8d(0x120)+_0x2ab497);return unlinkSync(_0x2ab497),symlinkSync(_0x3e7f08,_0x2ab497,_0x20ea8d(0x133)),{'path':_0x2ab497,'target':_0x3e7f08,'action':_0x20ea8d(0x13b)};}return symlinkSync(_0x3e7f08,_0x2ab497,_0x20ea8d(0x133)),{'path':_0x2ab497,'target':_0x3e7f08,'action':_0x20ea8d(0x12b)};}function managedTargetSkillLinkPaths(_0x2a84b1,_0x14403d){const _0x282158=a135_0x2b007e;if(!existsSync(_0x2a84b1))return[];const _0x241530=_0x14403d[_0x282158(0x134)]+'--';return readdirSync(_0x2a84b1,{'withFileTypes':!![]})[_0x282158(0x11f)](_0xa64ee9=>_0x14403d[_0x282158(0x11a)]==='project'||_0xa64ee9['name'][_0x282158(0x105)](_0x241530))['map'](_0x2e58c9=>resolve(_0x2a84b1,_0x2e58c9[_0x282158(0x137)]));}function removeManagedSkillLink(_0x5153f3,_0x5a2c95,_0x38e3bc){const _0x493f15=a135_0x2b007e,_0xc75bd2=lstatIfPresent(_0x5153f3);if(!_0xc75bd2?.[_0x493f15(0x135)]())return{'path':_0x5153f3,'action':'skipped','reason':_0x493f15(0x10d)};const _0x30e75c=resolveSymlinkTarget(_0x5153f3);if(!isPathInside(realOrResolved(_0x30e75c),realOrResolved(_0x5a2c95[_0x493f15(0x117)])))return{'path':_0x5153f3,'action':'skipped','reason':'external-symlink'};const _0x10600d=readMetadataIfPresent(resolve(_0x30e75c,METADATA_FILE));if(_0x5a2c95[_0x493f15(0x11a)]===_0x493f15(0x123)&&(_0x10600d?.[_0x493f15(0x134)]!==_0x5a2c95[_0x493f15(0x134)]||_0x10600d[_0x493f15(0x10b)]!==_0x38e3bc))return{'path':_0x5153f3,'action':'skipped','reason':_0x493f15(0x124)};return unlinkSync(_0x5153f3),{'path':_0x5153f3,'action':_0x493f15(0x130)};}function isLinkedFromAnyRoot(_0x551f61,_0x2cccbf){const _0x20f3be=a135_0x2b007e,_0x18afd6=realOrResolved(_0x551f61);for(const _0x3355f5 of _0x2cccbf){if(!existsSync(_0x3355f5))continue;for(const _0x4dad6a of readdirSync(_0x3355f5,{'withFileTypes':!![]})){if(!_0x4dad6a[_0x20f3be(0x135)]())continue;const _0x153b86=resolve(_0x3355f5,_0x4dad6a[_0x20f3be(0x137)]);if(realOrResolved(resolveSymlinkTarget(_0x153b86))===_0x18afd6)return!![];}}return![];}function runtimeSkillLinkName(_0x3906ae,_0x35b663){const _0x26cee7=a135_0x2b007e,_0x2fe88d=safePathSegment(_0x35b663,_0x26cee7(0x10b));if(_0x3906ae[_0x26cee7(0x11a)]===_0x26cee7(0x123)&&RESERVED_PROJECT_SKILL_CODES[_0x26cee7(0x103)](_0x2fe88d))throw CliErrors[_0x26cee7(0x10e)]('Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20'+_0x2fe88d);return _0x3906ae[_0x26cee7(0x11a)]===_0x26cee7(0x123)?_0x2fe88d:_0x3906ae[_0x26cee7(0x134)]+'--'+_0x2fe88d;}function runtimeSkillCodeFromLink(_0x4b061e,_0x2057a9){const _0x6223f5=a135_0x2b007e,_0x11fb2f=basename(_0x2057a9);return _0x4b061e[_0x6223f5(0x11a)]===_0x6223f5(0x123)?_0x11fb2f:_0x11fb2f[_0x6223f5(0x10c)]((_0x4b061e[_0x6223f5(0x134)]+'--')[_0x6223f5(0x136)]);}export function copyManagedSkillDirectory(_0x5ce02f,_0xbeeb){const _0x55f6fb=a135_0x2b007e,_0x3d867b=resolve(_0xbeeb,METADATA_FILE),_0x387f2c=existsSync(_0xbeeb);if(_0x387f2c){const _0x33bb3c=lstatSync(_0xbeeb);if(_0x33bb3c[_0x55f6fb(0x135)]())throw CliErrors[_0x55f6fb(0x10e)](_0x55f6fb(0x129)+_0xbeeb);if(!_0x33bb3c[_0x55f6fb(0x125)]())throw CliErrors['validation']('Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20'+_0xbeeb);const _0x29636d=readMetadataIfPresent(_0x3d867b);if(_0x29636d?.[_0x55f6fb(0x11a)]!==_0x55f6fb(0x132))throw CliErrors[_0x55f6fb(0x10e)](_0x55f6fb(0x128)+_0xbeeb);}ensureDirSync(dirname(_0xbeeb));const _0x1fd0ab=_0x387f2c?readMetadataIfPresent(_0x3d867b)?.['contentHash']:undefined,_0x7af3d4=readMetadataIfPresent(resolve(_0x5ce02f,METADATA_FILE))?.[_0x55f6fb(0x115)];return _0x387f2c&&removeSync(_0xbeeb),copySkillDirectory(_0x5ce02f,_0xbeeb),{'path':_0xbeeb,'target':_0x5ce02f,'action':!_0x387f2c?_0x55f6fb(0x12b):_0x1fd0ab===_0x7af3d4?_0x55f6fb(0x13a):_0x55f6fb(0x13b)};}function copySkillDirectory(_0x5b8657,_0x22faf2){copySync(_0x5b8657,_0x22faf2,{'dereference':![],'overwrite':!![],'filter'(_0xd38fa){const _0x4bbd66=a135_0x5883;if(lstatSync(_0xd38fa)[_0x4bbd66(0x135)]())throw CliErrors[_0x4bbd66(0x10e)]('Refusing\x20to\x20copy\x20Skill\x20symlink:\x20'+_0xd38fa);return!![];}});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x41fa58,_0x139735){const _0x125671=a136_0x5587,_0x72d4a9=_0x41fa58();while(!![]){try{const _0x1bee1d=parseInt(_0x125671(0x1ae))/0x1*(parseInt(_0x125671(0x199))/0x2)+parseInt(_0x125671(0x1a4))/0x3*(-parseInt(_0x125671(0x18b))/0x4)+-parseInt(_0x125671(0x188))/0x5*(parseInt(_0x125671(0x189))/0x6)+parseInt(_0x125671(0x1a5))/0x7*(-parseInt(_0x125671(0x197))/0x8)+-parseInt(_0x125671(0x194))/0x9+parseInt(_0x125671(0x1aa))/0xa+parseInt(_0x125671(0x1a9))/0xb;if(_0x1bee1d===_0x139735)break;else _0x72d4a9['push'](_0x72d4a9['shift']());}catch(_0xcfa6c8){_0x72d4a9['push'](_0x72d4a9['shift']());}}}(a136_0x57f5,0x6efdd));import{existsSync,readdirSync}from'node:fs';import{resolve}from'node:path';import{CliErrors}from'../../errors.js';function a136_0x57f5(){const _0x15c036=['push','source','87306UbkUIw','includes','sort','isDirectory','code','map','3706735EDvnzw','6tojWAf','tags','4zUSWlJ','has','get','skillCode','scope','trim','Runtime\x20Skill\x20install\x20target\x20app\x20mismatch:\x20','project','localeCompare','3767049CkBEsu','skillMdPath','linkedPath','3048LPeWNh','skillRoots','12yubZuA','startsWith','link','isSymbolicLink','builtin','local','scopes','filter','validation','appCode','isArray','129411xKqEfU','9597jHNxYP','linkedPaths','metadataPath','cache','9823242bLKYyg','7631590yETNSj','name'];a136_0x57f5=function(){return _0x15c036;};return a136_0x57f5();}import{METADATA_FILE,SKILL_FILE}from'./constants.js';function a136_0x5587(_0x42df24,_0xfe06d5){_0x42df24=_0x42df24-0x188;const _0x57f5bd=a136_0x57f5();let _0x55878a=_0x57f5bd[_0x42df24];return _0x55878a;}import{readMetadataIfPresent}from'./metadata.js';import{getRuntimeSkillCacheRoot,safePathSegment}from'./paths.js';import{isRuntimeSkillScope,normalizeRuntimeSkillScopes}from'./scopes.js';export function listLocalRuntimeSkills(_0x321a5c,_0x1870f8,_0x2479ac={}){const _0x378ae9=a136_0x5587,_0x556e90=safePathSegment(_0x321a5c[_0x378ae9(0x1a2)],_0x378ae9(0x1a2));if(_0x1870f8[_0x378ae9(0x1a2)]!==_0x556e90)throw CliErrors[_0x378ae9(0x1a1)](_0x378ae9(0x191)+_0x1870f8[_0x378ae9(0x1a2)]+'\x20!=\x20'+_0x556e90);const _0x358b14=normalizeRuntimeSkillScopes(_0x321a5c['scopes']),_0x352367=new Set(_0x358b14),_0x4592df=_0x321a5c[_0x378ae9(0x1b2)]?.[_0x378ae9(0x190)](),_0x17b8f6=new Map(),_0x4e833b=resolve(getRuntimeSkillCacheRoot(_0x321a5c['env'],_0x321a5c['accessKey'],_0x2479ac),_0x556e90);for(const _0x1f17e6 of _0x358b14){for(const _0x5044d3 of localSkillEntryDirs(resolve(_0x4e833b,_0x1f17e6))){collectLocalRuntimeSkill(_0x17b8f6,_0x5044d3,{'appCode':_0x556e90,'scopes':_0x352367,'code':_0x4592df,'source':_0x378ae9(0x1a8)});}}for(const _0x25aca0 of _0x1870f8[_0x378ae9(0x198)]){for(const _0x2d0a74 of localSkillLinkCandidates(_0x25aca0,_0x1870f8,_0x352367)){collectLocalRuntimeSkill(_0x17b8f6,_0x2d0a74,{'appCode':_0x556e90,'scopes':_0x352367,'code':_0x4592df,'source':_0x378ae9(0x19b),'linkedPath':_0x2d0a74});}}return Array['from'](_0x17b8f6['values']())[_0x378ae9(0x1b0)](compareLocalRuntimeSkills);}function localSkillEntryDirs(_0x316504){const _0x35411c=a136_0x5587;if(!existsSync(_0x316504))return[];return readdirSync(_0x316504,{'withFileTypes':!![]})[_0x35411c(0x1a0)](_0x5d0101=>_0x5d0101['isDirectory']()||_0x5d0101[_0x35411c(0x19c)]())['map'](_0x483eba=>resolve(_0x316504,_0x483eba['name']));}function localSkillLinkCandidates(_0x4c9bba,_0x1b8569,_0x32e8ff){const _0x17b4fc=a136_0x5587;if(!existsSync(_0x4c9bba))return[];const _0x28cbb0=_0x1b8569[_0x17b4fc(0x1a2)]+'--';return readdirSync(_0x4c9bba,{'withFileTypes':!![]})[_0x17b4fc(0x1a0)](_0x6d8b39=>_0x6d8b39[_0x17b4fc(0x1b1)]()||_0x6d8b39[_0x17b4fc(0x19c)]())[_0x17b4fc(0x1a0)](_0x1fb274=>_0x1b8569['scope']===_0x17b4fc(0x192)||_0x1fb274[_0x17b4fc(0x1ab)][_0x17b4fc(0x19a)](_0x28cbb0)||_0x32e8ff['has'](_0x17b4fc(0x19d)))[_0x17b4fc(0x1b3)](_0x2cc1d2=>resolve(_0x4c9bba,_0x2cc1d2[_0x17b4fc(0x1ab)]));}function collectLocalRuntimeSkill(_0x59ce58,_0x3b540e,_0x5a63e2){const _0x1c51a7=a136_0x5587,_0x2e494d=resolve(_0x3b540e,METADATA_FILE),_0x4379ea=readMetadataIfPresent(_0x2e494d);if(!_0x4379ea)return;if(_0x4379ea[_0x1c51a7(0x1a2)]!==_0x5a63e2['appCode'])return;if(!isRuntimeSkillScope(_0x4379ea[_0x1c51a7(0x18f)])||!_0x5a63e2[_0x1c51a7(0x19f)][_0x1c51a7(0x18c)](_0x4379ea[_0x1c51a7(0x18f)]))return;const _0x172cf7=_0x4379ea['skillCode']?.[_0x1c51a7(0x190)]();if(!_0x172cf7)return;if(_0x5a63e2[_0x1c51a7(0x1b2)]&&_0x172cf7!==_0x5a63e2['code'])return;const _0x59474b=_0x4379ea['scope']+':'+_0x172cf7,_0x1e5c48=_0x5a63e2[_0x1c51a7(0x196)]?[_0x5a63e2[_0x1c51a7(0x196)]]:[],_0x35808d=_0x59ce58[_0x1c51a7(0x18d)](_0x59474b);if(_0x35808d){_0x5a63e2['source']===_0x1c51a7(0x1a8)&&(_0x35808d['dir']=_0x3b540e,_0x35808d['cacheDir']=_0x3b540e,_0x35808d[_0x1c51a7(0x195)]=resolve(_0x3b540e,SKILL_FILE),_0x35808d[_0x1c51a7(0x1a7)]=_0x2e494d);for(const _0x34be15 of _0x1e5c48){!_0x35808d[_0x1c51a7(0x1a6)][_0x1c51a7(0x1af)](_0x34be15)&&_0x35808d['linkedPaths'][_0x1c51a7(0x1ac)](_0x34be15);}_0x35808d[_0x1c51a7(0x1a6)][_0x1c51a7(0x1b0)]();return;}_0x59ce58['set'](_0x59474b,{..._0x4379ea,'tags':Array[_0x1c51a7(0x1a3)](_0x4379ea[_0x1c51a7(0x18a)])?_0x4379ea[_0x1c51a7(0x18a)]:[],'scope':_0x4379ea[_0x1c51a7(0x18f)],'source':_0x1c51a7(0x19e),'dir':_0x3b540e,'cacheDir':_0x5a63e2[_0x1c51a7(0x1ad)]==='cache'?_0x3b540e:undefined,'skillMdPath':resolve(_0x3b540e,SKILL_FILE),'metadataPath':_0x2e494d,'linkedPaths':_0x1e5c48});}function compareLocalRuntimeSkills(_0x5bbf0d,_0x2bfddc){const _0x510bf2=a136_0x5587,_0x1978aa={'personal':0x0,'company':0x1,'builtin':0x2};return _0x1978aa[_0x5bbf0d[_0x510bf2(0x18f)]]-_0x1978aa[_0x2bfddc[_0x510bf2(0x18f)]]||_0x5bbf0d[_0x510bf2(0x18e)][_0x510bf2(0x193)](_0x2bfddc[_0x510bf2(0x18e)])||_0x5bbf0d['dir']['localeCompare'](_0x2bfddc['dir']);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x314a3c,_0x1f537f){const _0x3d5673=a137_0x1ba4,_0x213a05=_0x314a3c();while(!![]){try{const _0x56fb87=parseInt(_0x3d5673(0x117))/0x1+-parseInt(_0x3d5673(0x10d))/0x2*(-parseInt(_0x3d5673(0x10c))/0x3)+parseInt(_0x3d5673(0x118))/0x4+-parseInt(_0x3d5673(0x11d))/0x5+parseInt(_0x3d5673(0x104))/0x6+-parseInt(_0x3d5673(0x100))/0x7+-parseInt(_0x3d5673(0x119))/0x8;if(_0x56fb87===_0x1f537f)break;else _0x213a05['push'](_0x213a05['shift']());}catch(_0x24d215){_0x213a05['push'](_0x213a05['shift']());}}}(a137_0x49a0,0x9304a));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(_0x189fba){const _0x340996=a137_0x1ba4;return _0x189fba[_0x340996(0x10e)]??Buffer[_0x340996(0x114)](_0x189fba['content']??'',_0x340996(0xf8));}export function fileText(_0x406a97){const _0x48d507=a137_0x1ba4;return fileContent(_0x406a97)['toString'](_0x48d507(0xf8));}export function normalizeLocalFiles(_0x5585ae){const _0x493a90=a137_0x1ba4;if(!Array['isArray'](_0x5585ae)||_0x5585ae[_0x493a90(0x10b)]===0x0)return[];const _0x2755ec=new Map();for(const _0x23eb5e of _0x5585ae){if(!_0x23eb5e||typeof _0x23eb5e!==_0x493a90(0x116)||typeof _0x23eb5e[_0x493a90(0x10a)]!==_0x493a90(0x112))throw CliErrors[_0x493a90(0xfc)](_0x493a90(0x123));const _0x136467=normalizeSkillRelativePath(_0x23eb5e[_0x493a90(0x10a)]);if(_0x2755ec[_0x493a90(0x122)](_0x136467))throw CliErrors['validation'](_0x493a90(0x108)+_0x136467);if(_0x23eb5e[_0x493a90(0x10e)]!==undefined&&!Buffer[_0x493a90(0xf6)](_0x23eb5e['bytes']))throw CliErrors[_0x493a90(0xfc)](_0x493a90(0xf7)+_0x136467);if(_0x23eb5e[_0x493a90(0x10e)]===undefined&&typeof _0x23eb5e[_0x493a90(0x11c)]!=='string')throw CliErrors['validation'](_0x493a90(0xfb)+_0x136467);const _0x4a208c=fileContent(_0x23eb5e);_0x2755ec[_0x493a90(0x110)](_0x136467,{'path':_0x136467,'bytes':_0x4a208c});}return Array[_0x493a90(0x114)](_0x2755ec[_0x493a90(0x105)]())['sort'](compareSkillFiles);}function a137_0x49a0(){const _0x281b31=['isBuffer','Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20','utf8','push','Skill\x20file\x20size\x20is\x20invalid:\x20','Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20','validation','compare','test','trim','7779149LMvooF','Unsafe\x20Skill\x20file\x20path:\x20','Skill\x20file\x20sha256\x20is\x20invalid:\x20','split','5097990WfrJts','values','isFile','sort','Duplicate\x20Skill\x20file\x20path:\x20','startsWith','path','length','2662494ZiYNgN','2cSeyim','bytes','excludedFilePaths','set','isArray','string','replace','from','sha256','object','397581XZSnFb','4260708ypDIaQ','9205888jHiNVC','isSymbolicLink','toLowerCase','content','1678460hDhajC','isDirectory','Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20','isSafeInteger','name','has','Skill\x20file\x20path\x20must\x20be\x20text.','includes','size'];a137_0x49a0=function(){return _0x281b31;};return a137_0x49a0();}export function normalizeManifestFiles(_0x18d9e6){const _0x1975df=a137_0x1ba4;if(!Array[_0x1975df(0x111)](_0x18d9e6)||_0x18d9e6['length']===0x0)return[];const _0x278a3b=new Map();for(const _0x2e4e2e of _0x18d9e6){if(!_0x2e4e2e||typeof _0x2e4e2e!=='object'||typeof _0x2e4e2e[_0x1975df(0x10a)]!=='string')throw CliErrors[_0x1975df(0xfc)](_0x1975df(0x123));const _0x4d0f03=normalizeSkillRelativePath(_0x2e4e2e['path']);if(_0x278a3b[_0x1975df(0x122)](_0x4d0f03))throw CliErrors[_0x1975df(0xfc)](_0x1975df(0x108)+_0x4d0f03);if(!isSha256Hex(_0x2e4e2e[_0x1975df(0x115)]))throw CliErrors[_0x1975df(0xfc)](_0x1975df(0x102)+_0x4d0f03);if(!Number[_0x1975df(0x120)](_0x2e4e2e[_0x1975df(0x125)])||_0x2e4e2e['size']<0x0)throw CliErrors[_0x1975df(0xfc)](_0x1975df(0xfa)+_0x4d0f03);_0x278a3b[_0x1975df(0x110)](_0x4d0f03,{'path':_0x4d0f03,'sha256':_0x2e4e2e['sha256'][_0x1975df(0x11b)](),'size':_0x2e4e2e['size']});}return Array['from'](_0x278a3b[_0x1975df(0x105)]())[_0x1975df(0x107)](compareSkillFiles);}export function scanSkillDirectory(_0x5cd283,_0x522799={}){const _0x4b7b9a=a137_0x1ba4,_0x58105c=realpathSync(_0x5cd283),_0x22c655=canonicalExcludedFilePaths(_0x522799[_0x4b7b9a(0x10f)]),_0x5ebb86=[];function _0x51318c(_0x3de41f){const _0x31fced=_0x4b7b9a,_0x454304=readdirSync(_0x3de41f,{'withFileTypes':!![]})[_0x31fced(0x107)]((_0x49b39d,_0x37c248)=>_0x49b39d[_0x31fced(0x121)]['localeCompare'](_0x37c248[_0x31fced(0x121)]));for(const _0x2dbece of _0x454304){if(_0x2dbece[_0x31fced(0x11e)]()&&IGNORED_DIR_NAMES[_0x31fced(0x122)](_0x2dbece[_0x31fced(0x121)]))continue;if(IGNORED_FILE_NAMES[_0x31fced(0x122)](_0x2dbece['name']))continue;const _0x1507d3=resolve(_0x3de41f,_0x2dbece[_0x31fced(0x121)]);if(isExcludedFilePath(_0x1507d3,_0x22c655))continue;if(_0x2dbece[_0x31fced(0x11a)]())throw CliErrors[_0x31fced(0xfc)](_0x31fced(0x11f)+_0x1507d3);const _0x41c360=toPosixPath(relative(_0x58105c,_0x1507d3));if(_0x2dbece[_0x31fced(0x11e)]()){_0x51318c(_0x1507d3);continue;}if(!_0x2dbece[_0x31fced(0x106)]())continue;validateSkillRelativePath(_0x41c360);const _0x104d94=readFileSync(_0x1507d3);_0x5ebb86[_0x31fced(0xf9)]({'path':_0x41c360,'bytes':_0x104d94});}}return _0x51318c(_0x58105c),normalizeLocalFiles(_0x5ebb86);}function canonicalExcludedFilePaths(_0x42daff){const _0x4759a2=new Set();for(const _0x1457a8 of _0x42daff??[]){const _0x1c7c1b=resolve(_0x1457a8);_0x4759a2['add'](_0x1c7c1b);try{_0x4759a2['add'](realpathSync(_0x1c7c1b));}catch{}}return _0x4759a2;}function isExcludedFilePath(_0x449b22,_0xd3fa5e){const _0x40ecd5=a137_0x1ba4;if(_0xd3fa5e[_0x40ecd5(0x122)](_0x449b22))return!![];if(_0xd3fa5e['size']===0x0)return![];try{return _0xd3fa5e[_0x40ecd5(0x122)](realpathSync(_0x449b22));}catch{return![];}}export function compareSkillFiles(_0xd42598,_0x25a678){const _0x3f1943=a137_0x1ba4;if(_0xd42598['path']===SKILL_FILE)return _0x25a678[_0x3f1943(0x10a)]===SKILL_FILE?0x0:-0x1;if(_0x25a678[_0x3f1943(0x10a)]===SKILL_FILE)return 0x1;return Buffer[_0x3f1943(0xfd)](Buffer[_0x3f1943(0x114)](_0xd42598['path'],_0x3f1943(0xf8)),Buffer['from'](_0x25a678['path'],_0x3f1943(0xf8)));}export function normalizeSkillRelativePath(_0x3d946f){const _0xc4f42a=a137_0x1ba4,_0x2114d9=toPosixPath(_0x3d946f[_0xc4f42a(0xff)]());return validateSkillRelativePath(_0x2114d9),_0x2114d9;}export function validateSkillRelativePath(_0x3c2b91){const _0x1e33e1=a137_0x1ba4;if(!_0x3c2b91||_0x3c2b91[_0x1e33e1(0x109)]('/')||_0x3c2b91[_0x1e33e1(0x124)]('//'))throw CliErrors['validation']('Unsafe\x20Skill\x20file\x20path:\x20'+_0x3c2b91);for(const _0x2e5690 of _0x3c2b91[_0x1e33e1(0x103)]('/')){if(!_0x2e5690||_0x2e5690==='.'||_0x2e5690==='..')throw CliErrors[_0x1e33e1(0xfc)](_0x1e33e1(0x101)+_0x3c2b91);}}function a137_0x1ba4(_0x5477b2,_0x5f3b83){_0x5477b2=_0x5477b2-0xf6;const _0x49a0ef=a137_0x49a0();let _0x1ba40d=_0x49a0ef[_0x5477b2];return _0x1ba40d;}export function toPosixPath(_0x448d0c){const _0x427df5=a137_0x1ba4;return _0x448d0c[_0x427df5(0x113)](/\\/g,'/');}export function isSha256Hex(_0x3665ea){const _0x2d4b0c=a137_0x1ba4;return typeof _0x3665ea===_0x2d4b0c(0x112)&&/^[a-fA-F0-9]{64}$/[_0x2d4b0c(0xfe)](_0x3665ea);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a138_0x37bf(_0x133667,_0x4b4184){_0x133667=_0x133667-0x1f3;const _0x30cb7b=a138_0x30cb();let _0x37bfce=_0x30cb7b[_0x133667];return _0x37bfce;}(function(_0x1cf263,_0xf8d15d){const _0x4ad5b5=a138_0x37bf,_0x41b3fe=_0x1cf263();while(!![]){try{const _0x452393=parseInt(_0x4ad5b5(0x214))/0x1*(parseInt(_0x4ad5b5(0x1fc))/0x2)+parseInt(_0x4ad5b5(0x1f4))/0x3*(parseInt(_0x4ad5b5(0x20a))/0x4)+parseInt(_0x4ad5b5(0x21c))/0x5*(-parseInt(_0x4ad5b5(0x222))/0x6)+-parseInt(_0x4ad5b5(0x206))/0x7*(parseInt(_0x4ad5b5(0x20c))/0x8)+parseInt(_0x4ad5b5(0x21e))/0x9*(-parseInt(_0x4ad5b5(0x20e))/0xa)+-parseInt(_0x4ad5b5(0x20b))/0xb+parseInt(_0x4ad5b5(0x22a))/0xc;if(_0x452393===_0xf8d15d)break;else _0x41b3fe['push'](_0x41b3fe['shift']());}catch(_0x4fb2c6){_0x41b3fe['push'](_0x41b3fe['shift']());}}}(a138_0x30cb,0xe1622));import{existsSync,lstatSync,mkdirSync,readFileSync,rmSync}from'node:fs';import{dirname,resolve}from'node:path';import{isCollection,isMap,isNode,parseDocument,visit}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{resolveManagedFilePath,writeBytesAtomic,writeJsonAtomic}from'./fs-utils.js';import{bufferSha256,contentHash,fileHash}from'./hashing.js';import{fileContent,fileText,normalizeLocalFiles}from'./local-files.js';import{buildMetadata,readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillDir}from'./paths.js';import{extractDownloadedPackage,requirePackageBytes}from'./zip-package.js';export function materializeRuntimeSkill(_0x390dfb,_0x519e9c,_0x6d1a86){const _0x2f9e18=a138_0x37bf,_0x16fd9a=requireSkillCode(_0x390dfb),_0x493b9a=requirePackageBytes(_0x16fd9a,_0x6d1a86[_0x2f9e18(0x1f7)]),_0x27f8ab=extractDownloadedPackage(_0x493b9a),_0x522931=_0x27f8ab['find'](_0x1159b7=>_0x1159b7['path']===SKILL_FILE);if(!_0x522931)throw CliErrors[_0x2f9e18(0x1f6)]('Runtime\x20Skill\x20package\x20is\x20missing\x20'+SKILL_FILE+':\x20'+_0x16fd9a);const _0x88d8ee=withMaterializedSkillFrontmatter(_0x27f8ab,_0x390dfb,_0x16fd9a),_0x254ee5=_0x88d8ee[_0x2f9e18(0x21d)](_0x3fce13=>_0x3fce13['path']===SKILL_FILE),_0x3fb39f=fileText(_0x254ee5),_0x2cbf63=getRuntimeSkillDir(_0x6d1a86[_0x2f9e18(0x21a)],_0x6d1a86['accessKey'],_0x6d1a86[_0x2f9e18(0x200)],_0x519e9c,_0x16fd9a,_0x6d1a86['paths']),_0x39241c=resolve(_0x2cbf63,SKILL_FILE),_0x509b56=resolve(_0x2cbf63,METADATA_FILE),_0x35bcaa=contentHash(_0x3fb39f),_0x29c015=readMetadataIfPresent(_0x509b56)?.['fileHashes'];ensurePulledFilesCanBeOverwritten(_0x2cbf63,_0x509b56,_0x88d8ee,_0x6d1a86[_0x2f9e18(0x1fb)]===!![]),mkdirSync(_0x2cbf63,{'recursive':!![],'mode':0x1c0});const _0x16bd51=existsSync(_0x39241c)?readFileSync(_0x39241c,_0x2f9e18(0x207)):undefined;return materializeFiles(_0x2cbf63,_0x88d8ee),removeStaleManagedFiles(_0x2cbf63,_0x29c015,_0x88d8ee),writeJsonAtomic(_0x509b56,buildMetadata(_0x390dfb,_0x519e9c,_0x6d1a86[_0x2f9e18(0x200)],_0x35bcaa,_0x6d1a86[_0x2f9e18(0x212)],_0x88d8ee,_0x493b9a)),{'skill':_0x390dfb,'scope':_0x519e9c,'dir':_0x2cbf63,'skillMdPath':_0x39241c,'metadataPath':_0x509b56,'contentHash':_0x35bcaa,'changed':_0x16bd51!==_0x3fb39f};}export function reuseMaterializedRuntimeSkill(_0x348f26,_0x115499,_0x2429de){const _0x4e22e2=a138_0x37bf,_0x1bc3d9=_0x348f26[_0x4e22e2(0x219)]?.[_0x4e22e2(0x213)]();if(!_0x1bc3d9)return undefined;const _0x5e71a8=requireSkillCode(_0x348f26),_0x11c4e7=getRuntimeSkillDir(_0x2429de[_0x4e22e2(0x21a)],_0x2429de[_0x4e22e2(0x22b)],_0x2429de[_0x4e22e2(0x200)],_0x115499,_0x5e71a8,_0x2429de[_0x4e22e2(0x223)]),_0x8e34a6=resolve(_0x11c4e7,SKILL_FILE),_0xe0f7e5=resolve(_0x11c4e7,METADATA_FILE),_0x335ca0=readMetadataIfPresent(_0xe0f7e5);if(!_0x335ca0||_0x335ca0[_0x4e22e2(0x218)]!==0x2||_0x335ca0['appCode']!==_0x2429de[_0x4e22e2(0x200)]||_0x335ca0[_0x4e22e2(0x203)]!==_0x115499||_0x335ca0[_0x4e22e2(0x209)]!==_0x5e71a8||_0x335ca0[_0x4e22e2(0x219)]!==_0x1bc3d9||_0x335ca0['id']!==_0x348f26['id']||_0x335ca0[_0x4e22e2(0x21b)]!==_0x348f26['skillName']||_0x335ca0['description']!==_0x348f26['description']||_0x335ca0['example']!==_0x348f26['example']||_0x335ca0['status']!==_0x348f26[_0x4e22e2(0x210)]||!_0x335ca0['contentHash']||!_0x335ca0[_0x4e22e2(0x22e)]||!Object[_0x4e22e2(0x1fd)](_0x335ca0[_0x4e22e2(0x22e)],SKILL_FILE))return undefined;for(const [_0x2243b5,_0x4ad6ef]of Object['entries'](_0x335ca0[_0x4e22e2(0x22e)])){if(!/^[a-f0-9]{64}$/['test'](_0x4ad6ef))return undefined;const _0x5f10ec=resolveManagedFilePath(_0x11c4e7,_0x2243b5);if(!existsSync(_0x5f10ec)||!lstatSync(_0x5f10ec)[_0x4e22e2(0x205)]())return undefined;if(bufferSha256(readFileSync(_0x5f10ec))!==_0x4ad6ef)return undefined;}return{'skill':_0x348f26,'scope':_0x115499,'dir':_0x11c4e7,'skillMdPath':_0x8e34a6,'metadataPath':_0xe0f7e5,'contentHash':_0x335ca0['contentHash'],'changed':![]};}function withMaterializedSkillFrontmatter(_0x47479a,_0x21a193,_0x3ea19e){const _0x131c9f=a138_0x37bf,_0x3ed65c=skillDisplayName(_0x21a193,_0x3ea19e),_0x2048c0=_0x21a193[_0x131c9f(0x22d)]?.[_0x131c9f(0x213)]()||_0x3ed65c||_0x3ea19e;return normalizeLocalFiles(_0x47479a)[_0x131c9f(0x216)](_0x578f50=>{const _0x184009=_0x131c9f,_0x1bad3f=fileText(_0x578f50);if(_0x578f50[_0x184009(0x225)]!==SKILL_FILE)return _0x578f50;if(hasYamlFrontmatter(_0x1bad3f))return{'path':_0x578f50[_0x184009(0x225)],'content':withSyncedDisplayName(_0x1bad3f,_0x3ed65c)};return{'path':_0x578f50[_0x184009(0x225)],'content':prependSkillFrontmatter(_0x1bad3f,{'name':_0x3ea19e,'displayName':_0x3ed65c,'description':_0x2048c0})};});}function hasYamlFrontmatter(_0x4b8065){const _0x2b7106=a138_0x37bf;return/^\uFEFF?---\s*\r?\n/[_0x2b7106(0x228)](_0x4b8065);}function prependSkillFrontmatter(_0x4bd3b7,_0xd3cec3){const _0x408977=a138_0x37bf,_0x5ca2cc=_0x4bd3b7['replace'](/^\uFEFF/,'');return[_0x408977(0x1f8),_0x408977(0x229)+yamlString(_0xd3cec3[_0x408977(0x217)]),_0xd3cec3['displayName']?_0x408977(0x1fa)+yamlString(_0xd3cec3[_0x408977(0x204)]):undefined,_0x408977(0x226)+yamlString(_0xd3cec3[_0x408977(0x22d)]),_0x408977(0x1f8),'',_0x5ca2cc][_0x408977(0x1f9)](_0x6d09b1=>_0x6d09b1!==undefined)[_0x408977(0x1f3)]('\x0a');}function yamlString(_0x182ae6){const _0x4e31bd=a138_0x37bf;return JSON['stringify'](_0x182ae6['replace'](/\r/g,'')[_0x4e31bd(0x213)]());}function skillDisplayName(_0x12f73d,_0x3911db){const _0x4e17f2=a138_0x37bf,_0x28f338=_0x12f73d['skillName']?.[_0x4e17f2(0x213)]();return _0x28f338||_0x3911db;}function withSyncedDisplayName(_0x1bb093,_0x393bf0){const _0x1b4dc7=a138_0x37bf,_0x23a432=_0x1bb093['match'](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x23a432)return _0x1bb093;const _0x36f6c0=_0x23a432[0x1]??'',_0x3f95af=_0x23a432[0x2]??'',_0x4a7f91=parseDocument(_0x3f95af);if(_0x4a7f91[_0x1b4dc7(0x1fe)][_0x1b4dc7(0x221)]>0x0||!isMap(_0x4a7f91[_0x1b4dc7(0x224)]))return _0x1bb093;if(_0x393bf0)_0x4a7f91['set']('displayName',_0x393bf0);else{if(_0x4a7f91['has'](_0x1b4dc7(0x204)))_0x4a7f91['delete']('displayName');else return _0x1bb093;}forceBlockCollections(_0x4a7f91[_0x1b4dc7(0x224)]);const _0x2392f3=_0x4a7f91[_0x1b4dc7(0x227)]({'lineWidth':0x0})['trimEnd'](),_0x4b15fd=_0x1bb093['slice'](_0x23a432[0x0]['length'])['replace'](/^\r?\n/,'');return _0x36f6c0+_0x1b4dc7(0x1f5)+_0x2392f3+'\x0a---\x0a\x0a'+_0x4b15fd;}function a138_0x30cb(){const _0x37f309=['entries','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','length','55962ALeWfQ','paths','contents','path','description:\x20','toString','test','name:\x20','46384728MKTLdf','accessKey','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','description','fileHashes','join','9bPmfZy','---\x0a','validation','packageBytes','---','filter','displayName:\x20','force','1132UPGqbU','hasOwn','errors','Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20','appCode','.\x20Changed\x20file:\x20','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','scope','displayName','isFile','119SUGuJy','utf8','has','skillCode','423052lbeksd','17926513SYCGLI','402968YyqyzL','Managed\x20file\x20was\x20removed\x20locally:\x20','50ORWNZK','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.','status','contentHash','pulledAt','trim','1984toJfAJ','Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20','map','name','schemaVersion','version','env','skillName','630OLsqog','find','1298277QXlDDh'];a138_0x30cb=function(){return _0x37f309;};return a138_0x30cb();}function forceBlockCollections(_0x34c572){if(!isNode(_0x34c572))return;visit(_0x34c572,(_0x380494,_0x28e209)=>{isCollection(_0x28e209)&&(_0x28e209['flow']=![]);});}function ensurePulledFilesCanBeOverwritten(_0xc956c3,_0x33f28e,_0x2d07d9,_0x149fdf){const _0x9371c4=a138_0x37bf;if(_0x149fdf||!existsSync(_0x33f28e))return;const _0x152215=readMetadataIfPresent(_0x33f28e);if(!_0x152215)return;const _0x211a67=_0x152215[_0x9371c4(0x22e)]&&Object['keys'](_0x152215['fileHashes'])[_0x9371c4(0x221)]>0x0?_0x152215[_0x9371c4(0x22e)]:undefined;if(_0x211a67)for(const [_0x7c3e6,_0x169d8e]of Object[_0x9371c4(0x21f)](_0x211a67)){const _0x29c0ab=resolveManagedFilePath(_0xc956c3,_0x7c3e6);if(!existsSync(_0x29c0ab))throw CliErrors[_0x9371c4(0x1f6)](_0x9371c4(0x220)+_0xc956c3,_0x9371c4(0x20d)+_0x7c3e6);const _0xee6dd8=lstatSync(_0x29c0ab);if(!_0xee6dd8[_0x9371c4(0x205)]())throw CliErrors[_0x9371c4(0x1f6)](_0x9371c4(0x220)+_0xc956c3,_0x9371c4(0x215)+_0x7c3e6);const _0xbed603=bufferSha256(readFileSync(_0x29c0ab));if(_0xbed603!==_0x169d8e)throw CliErrors['validation'](_0x9371c4(0x220)+_0xc956c3+_0x9371c4(0x201)+_0x7c3e6,'Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20'+_0x7c3e6);}else{const _0x3bdc35=resolve(_0xc956c3,SKILL_FILE);if(existsSync(_0x3bdc35)&&_0x152215[_0x9371c4(0x211)]){const _0x193df6=contentHash(readFileSync(_0x3bdc35,_0x9371c4(0x207)));if(_0x193df6!==_0x152215['contentHash'])throw CliErrors[_0x9371c4(0x1f6)](_0x9371c4(0x202)+_0x3bdc35,_0x9371c4(0x20f));}}for(const _0x3244c9 of normalizeLocalFiles(_0x2d07d9)){if(_0x211a67?.[_0x3244c9[_0x9371c4(0x225)]])continue;if(!_0x211a67&&_0x3244c9['path']===SKILL_FILE)continue;const _0x5849d4=resolveManagedFilePath(_0xc956c3,_0x3244c9[_0x9371c4(0x225)]);if(!existsSync(_0x5849d4))continue;const _0x4c62e1=lstatSync(_0x5849d4);if(!_0x4c62e1[_0x9371c4(0x205)]())throw CliErrors['validation'](_0x9371c4(0x220)+_0xc956c3,_0x9371c4(0x22c)+_0x3244c9[_0x9371c4(0x225)]);const _0x36658b=bufferSha256(readFileSync(_0x5849d4));if(_0x36658b!==fileHash(_0x3244c9))throw CliErrors['validation']('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0xc956c3,_0x9371c4(0x1ff)+_0x3244c9[_0x9371c4(0x225)]);}}function materializeFiles(_0x3d4ff2,_0x10d968){const _0xe250db=a138_0x37bf;for(const _0x24f593 of normalizeLocalFiles(_0x10d968)){const _0x489111=resolveManagedFilePath(_0x3d4ff2,_0x24f593[_0xe250db(0x225)]);mkdirSync(dirname(_0x489111),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x489111,fileContent(_0x24f593),0x180);}}function removeStaleManagedFiles(_0x295a9a,_0x199b95,_0x393b4c){const _0x5b2ddd=a138_0x37bf;if(!_0x199b95)return;const _0xc0845=new Set(normalizeLocalFiles(_0x393b4c)[_0x5b2ddd(0x216)](_0x527042=>_0x527042[_0x5b2ddd(0x225)]));for(const _0x492c7c of Object['keys'](_0x199b95)){if(_0xc0845[_0x5b2ddd(0x208)](_0x492c7c))continue;const _0x1c9400=resolveManagedFilePath(_0x295a9a,_0x492c7c);existsSync(_0x1c9400)&&lstatSync(_0x1c9400)[_0x5b2ddd(0x205)]()&&rmSync(_0x1c9400,{'force':!![]});}}
|
|
1
|
+
(function(_0x47d8a5,_0x7f3b0c){const _0x2cab07=a138_0x2abd,_0x58cbeb=_0x47d8a5();while(!![]){try{const _0xba0282=parseInt(_0x2cab07(0xbe))/0x1*(-parseInt(_0x2cab07(0xc3))/0x2)+parseInt(_0x2cab07(0xcd))/0x3*(parseInt(_0x2cab07(0xd0))/0x4)+-parseInt(_0x2cab07(0xad))/0x5*(parseInt(_0x2cab07(0xcc))/0x6)+parseInt(_0x2cab07(0xbf))/0x7*(-parseInt(_0x2cab07(0xd6))/0x8)+parseInt(_0x2cab07(0xd2))/0x9+parseInt(_0x2cab07(0xcb))/0xa+parseInt(_0x2cab07(0xe3))/0xb*(-parseInt(_0x2cab07(0xbd))/0xc);if(_0xba0282===_0x7f3b0c)break;else _0x58cbeb['push'](_0x58cbeb['shift']());}catch(_0x12b458){_0x58cbeb['push'](_0x58cbeb['shift']());}}}(a138_0x2454,0xa72ed));function a138_0x2abd(_0x523774,_0x3e85d1){_0x523774=_0x523774-0xa6;const _0x2454de=a138_0x2454();let _0x2abd0f=_0x2454de[_0x523774];return _0x2abd0f;}import{existsSync,lstatSync,mkdirSync,readFileSync,rmSync}from'node:fs';import{dirname,resolve}from'node:path';import{isCollection,isMap,isNode,parseDocument,visit}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{resolveManagedFilePath,writeBytesAtomic,writeJsonAtomic}from'./fs-utils.js';import{bufferSha256,contentHash,fileHash}from'./hashing.js';import{fileContent,fileText,normalizeLocalFiles}from'./local-files.js';function a138_0x2454(){const _0x4cb262=['skillName','has','env','schemaVersion','path','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.','filter','slice','---','contents','displayName:\x20','3498exQUkf','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','Managed\x20file\x20was\x20removed\x20locally:\x20','paths','length','errors','Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20','example','3615505ayztjt','appCode','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','packageBytes','set','isFile','validation','entries','scope','test','toString','find','map','keys','version','11064OqWhjQ','16vPxSmo','110726SwgwaO','utf8','description:\x20','match','81580rWXHXu','status','pulledAt','contentHash','displayName','\x0a---\x0a\x0a','name:\x20','accessKey','4997490qTIuuc','6itLGVJ','36WYdVNa','.\x20Changed\x20file:\x20','force','427912osiCkI','fileHashes','6270993OzhHax','join','replace','description','64JHBvMm','trim'];a138_0x2454=function(){return _0x4cb262;};return a138_0x2454();}import{buildMetadata,readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillDir}from'./paths.js';import{extractDownloadedPackage,requirePackageBytes}from'./zip-package.js';export function materializeRuntimeSkill(_0x3ef524,_0x2f909b,_0x24e00a){const _0x1603d1=a138_0x2abd,_0x1a84c7=requireSkillCode(_0x3ef524),_0x5c8249=requirePackageBytes(_0x1a84c7,_0x24e00a[_0x1603d1(0xb1)]),_0x17371c=extractDownloadedPackage(_0x5c8249),_0x1a8ec4=_0x17371c[_0x1603d1(0xb9)](_0x3390d8=>_0x3390d8[_0x1603d1(0xdc)]===SKILL_FILE);if(!_0x1a8ec4)throw CliErrors[_0x1603d1(0xb4)]('Runtime\x20Skill\x20package\x20is\x20missing\x20'+SKILL_FILE+':\x20'+_0x1a84c7);const _0x5cf3bd=withMaterializedSkillFrontmatter(_0x17371c,_0x3ef524,_0x1a84c7),_0x23a867=_0x5cf3bd[_0x1603d1(0xb9)](_0x141f35=>_0x141f35['path']===SKILL_FILE),_0x113df9=fileText(_0x23a867),_0x4cbdcb=getRuntimeSkillDir(_0x24e00a[_0x1603d1(0xda)],_0x24e00a[_0x1603d1(0xca)],_0x24e00a['appCode'],_0x2f909b,_0x1a84c7,_0x24e00a[_0x1603d1(0xa8)]),_0x1702bc=resolve(_0x4cbdcb,SKILL_FILE),_0x523e48=resolve(_0x4cbdcb,METADATA_FILE),_0x3c7f80=contentHash(_0x113df9),_0x20842e=readMetadataIfPresent(_0x523e48)?.['fileHashes'];ensurePulledFilesCanBeOverwritten(_0x4cbdcb,_0x523e48,_0x5cf3bd,_0x24e00a[_0x1603d1(0xcf)]===!![]),mkdirSync(_0x4cbdcb,{'recursive':!![],'mode':0x1c0});const _0x5389ed=existsSync(_0x1702bc)?readFileSync(_0x1702bc,'utf8'):undefined;return materializeFiles(_0x4cbdcb,_0x5cf3bd),removeStaleManagedFiles(_0x4cbdcb,_0x20842e,_0x5cf3bd),writeJsonAtomic(_0x523e48,buildMetadata(_0x3ef524,_0x2f909b,_0x24e00a['appCode'],_0x3c7f80,_0x24e00a[_0x1603d1(0xc5)],_0x5cf3bd,_0x5c8249)),{'skill':_0x3ef524,'scope':_0x2f909b,'dir':_0x4cbdcb,'skillMdPath':_0x1702bc,'metadataPath':_0x523e48,'contentHash':_0x3c7f80,'changed':_0x5389ed!==_0x113df9};}export function reuseMaterializedRuntimeSkill(_0x3b7518,_0x23c4ca,_0x225df8){const _0x442e85=a138_0x2abd,_0x57a229=_0x3b7518[_0x442e85(0xbc)]?.[_0x442e85(0xd7)]();if(!_0x57a229)return undefined;const _0x2e0ee5=requireSkillCode(_0x3b7518),_0x334736=getRuntimeSkillDir(_0x225df8['env'],_0x225df8[_0x442e85(0xca)],_0x225df8[_0x442e85(0xae)],_0x23c4ca,_0x2e0ee5,_0x225df8[_0x442e85(0xa8)]),_0x1148db=resolve(_0x334736,SKILL_FILE),_0x5735d1=resolve(_0x334736,METADATA_FILE),_0x1bbe78=readMetadataIfPresent(_0x5735d1);if(!_0x1bbe78||_0x1bbe78[_0x442e85(0xdb)]!==0x2||_0x1bbe78[_0x442e85(0xae)]!==_0x225df8[_0x442e85(0xae)]||_0x1bbe78[_0x442e85(0xb6)]!==_0x23c4ca||_0x1bbe78['skillCode']!==_0x2e0ee5||_0x1bbe78[_0x442e85(0xbc)]!==_0x57a229||_0x1bbe78['id']!==_0x3b7518['id']||_0x1bbe78[_0x442e85(0xd8)]!==_0x3b7518['skillName']||_0x1bbe78[_0x442e85(0xd5)]!==_0x3b7518[_0x442e85(0xd5)]||_0x1bbe78[_0x442e85(0xac)]!==_0x3b7518['example']||_0x1bbe78['status']!==_0x3b7518[_0x442e85(0xc4)]||!_0x1bbe78[_0x442e85(0xc6)]||!_0x1bbe78['fileHashes']||!Object['hasOwn'](_0x1bbe78[_0x442e85(0xd1)],SKILL_FILE))return undefined;for(const [_0x3d3122,_0x2ca1b1]of Object[_0x442e85(0xb5)](_0x1bbe78[_0x442e85(0xd1)])){if(!/^[a-f0-9]{64}$/[_0x442e85(0xb7)](_0x2ca1b1))return undefined;const _0x5f0c58=resolveManagedFilePath(_0x334736,_0x3d3122);if(!existsSync(_0x5f0c58)||!lstatSync(_0x5f0c58)[_0x442e85(0xb3)]())return undefined;if(bufferSha256(readFileSync(_0x5f0c58))!==_0x2ca1b1)return undefined;}return{'skill':_0x3b7518,'scope':_0x23c4ca,'dir':_0x334736,'skillMdPath':_0x1148db,'metadataPath':_0x5735d1,'contentHash':_0x1bbe78['contentHash'],'changed':![]};}function withMaterializedSkillFrontmatter(_0x4e5dc4,_0x4c7aac,_0x3fd63c){const _0x8cf341=a138_0x2abd,_0x51d9f0=skillDisplayName(_0x4c7aac,_0x3fd63c),_0x25ccfb=_0x4c7aac[_0x8cf341(0xd5)]?.['trim']()||_0x51d9f0||_0x3fd63c;return normalizeLocalFiles(_0x4e5dc4)[_0x8cf341(0xba)](_0x18d560=>{const _0x1f38a6=_0x8cf341,_0x139760=fileText(_0x18d560);if(_0x18d560['path']!==SKILL_FILE)return _0x18d560;if(hasYamlFrontmatter(_0x139760))return{'path':_0x18d560[_0x1f38a6(0xdc)],'content':withSyncedDisplayName(_0x139760,_0x51d9f0)};return{'path':_0x18d560[_0x1f38a6(0xdc)],'content':prependSkillFrontmatter(_0x139760,{'name':_0x3fd63c,'displayName':_0x51d9f0,'description':_0x25ccfb})};});}function hasYamlFrontmatter(_0x3e87cb){const _0x3af81e=a138_0x2abd;return/^\uFEFF?---\s*\r?\n/[_0x3af81e(0xb7)](_0x3e87cb);}function prependSkillFrontmatter(_0xdfccee,_0x4e85cb){const _0x52d3b0=a138_0x2abd,_0x32e276=_0xdfccee[_0x52d3b0(0xd4)](/^\uFEFF/,'');return[_0x52d3b0(0xe0),_0x52d3b0(0xc9)+yamlString(_0x4e85cb['name']),_0x4e85cb[_0x52d3b0(0xc7)]?_0x52d3b0(0xe2)+yamlString(_0x4e85cb[_0x52d3b0(0xc7)]):undefined,_0x52d3b0(0xc1)+yamlString(_0x4e85cb['description']),'---','',_0x32e276][_0x52d3b0(0xde)](_0x5756e7=>_0x5756e7!==undefined)[_0x52d3b0(0xd3)]('\x0a');}function yamlString(_0x366087){const _0x14bb24=a138_0x2abd;return JSON['stringify'](_0x366087[_0x14bb24(0xd4)](/\r/g,'')[_0x14bb24(0xd7)]());}function skillDisplayName(_0x354059,_0x1448b3){const _0x465b7f=a138_0x2abd,_0x2e026c=_0x354059[_0x465b7f(0xd8)]?.['trim']();return _0x2e026c||_0x1448b3;}function withSyncedDisplayName(_0x328a07,_0x5afd68){const _0xbc3bec=a138_0x2abd,_0x5b0170=_0x328a07[_0xbc3bec(0xc2)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x5b0170)return _0x328a07;const _0x324620=_0x5b0170[0x1]??'',_0x34d9bf=_0x5b0170[0x2]??'',_0x2e467f=parseDocument(_0x34d9bf);if(_0x2e467f[_0xbc3bec(0xaa)][_0xbc3bec(0xa9)]>0x0||!isMap(_0x2e467f[_0xbc3bec(0xe1)]))return _0x328a07;if(_0x5afd68)_0x2e467f[_0xbc3bec(0xb2)]('displayName',_0x5afd68);else{if(_0x2e467f[_0xbc3bec(0xd9)](_0xbc3bec(0xc7)))_0x2e467f['delete'](_0xbc3bec(0xc7));else return _0x328a07;}forceBlockCollections(_0x2e467f[_0xbc3bec(0xe1)]);const _0x5e93cd=_0x2e467f[_0xbc3bec(0xb8)]({'lineWidth':0x0})['trimEnd'](),_0x49f25b=_0x328a07[_0xbc3bec(0xdf)](_0x5b0170[0x0]['length'])[_0xbc3bec(0xd4)](/^\r?\n/,'');return _0x324620+'---\x0a'+_0x5e93cd+_0xbc3bec(0xc8)+_0x49f25b;}function forceBlockCollections(_0x473173){if(!isNode(_0x473173))return;visit(_0x473173,(_0x4dedbd,_0x34fdab)=>{isCollection(_0x34fdab)&&(_0x34fdab['flow']=![]);});}function ensurePulledFilesCanBeOverwritten(_0x53c6be,_0x5d78c0,_0x741fd8,_0x211719){const _0x5614f4=a138_0x2abd;if(_0x211719||!existsSync(_0x5d78c0))return;const _0x2409b1=readMetadataIfPresent(_0x5d78c0);if(!_0x2409b1)return;const _0x13e190=_0x2409b1[_0x5614f4(0xd1)]&&Object[_0x5614f4(0xbb)](_0x2409b1[_0x5614f4(0xd1)])[_0x5614f4(0xa9)]>0x0?_0x2409b1[_0x5614f4(0xd1)]:undefined;if(_0x13e190)for(const [_0x1a1604,_0x4f82e3]of Object[_0x5614f4(0xb5)](_0x13e190)){const _0x443d4c=resolveManagedFilePath(_0x53c6be,_0x1a1604);if(!existsSync(_0x443d4c))throw CliErrors[_0x5614f4(0xb4)](_0x5614f4(0xaf)+_0x53c6be,_0x5614f4(0xa7)+_0x1a1604);const _0x51b9f0=lstatSync(_0x443d4c);if(!_0x51b9f0[_0x5614f4(0xb3)]())throw CliErrors[_0x5614f4(0xb4)](_0x5614f4(0xaf)+_0x53c6be,_0x5614f4(0xab)+_0x1a1604);const _0x205ea1=bufferSha256(readFileSync(_0x443d4c));if(_0x205ea1!==_0x4f82e3)throw CliErrors[_0x5614f4(0xb4)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x53c6be+_0x5614f4(0xce)+_0x1a1604,_0x5614f4(0xb0)+_0x1a1604);}else{const _0x1b3965=resolve(_0x53c6be,SKILL_FILE);if(existsSync(_0x1b3965)&&_0x2409b1[_0x5614f4(0xc6)]){const _0x2d37df=contentHash(readFileSync(_0x1b3965,_0x5614f4(0xc0)));if(_0x2d37df!==_0x2409b1[_0x5614f4(0xc6)])throw CliErrors[_0x5614f4(0xb4)]('Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20'+_0x1b3965,_0x5614f4(0xdd));}}for(const _0x8841de of normalizeLocalFiles(_0x741fd8)){if(_0x13e190?.[_0x8841de[_0x5614f4(0xdc)]])continue;if(!_0x13e190&&_0x8841de['path']===SKILL_FILE)continue;const _0x5a5b2a=resolveManagedFilePath(_0x53c6be,_0x8841de['path']);if(!existsSync(_0x5a5b2a))continue;const _0x4e02ee=lstatSync(_0x5a5b2a);if(!_0x4e02ee[_0x5614f4(0xb3)]())throw CliErrors[_0x5614f4(0xb4)](_0x5614f4(0xaf)+_0x53c6be,_0x5614f4(0xa6)+_0x8841de[_0x5614f4(0xdc)]);const _0x2369f6=bufferSha256(readFileSync(_0x5a5b2a));if(_0x2369f6!==fileHash(_0x8841de))throw CliErrors['validation'](_0x5614f4(0xaf)+_0x53c6be,'Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20'+_0x8841de[_0x5614f4(0xdc)]);}}function materializeFiles(_0x3fa070,_0x14f1fc){const _0xa95fe7=a138_0x2abd;for(const _0xecdc53 of normalizeLocalFiles(_0x14f1fc)){const _0x1d0469=resolveManagedFilePath(_0x3fa070,_0xecdc53[_0xa95fe7(0xdc)]);mkdirSync(dirname(_0x1d0469),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x1d0469,fileContent(_0xecdc53),0x180);}}function removeStaleManagedFiles(_0x10c635,_0x16aeb4,_0x3cd6db){const _0x51682d=a138_0x2abd;if(!_0x16aeb4)return;const _0x3ed07a=new Set(normalizeLocalFiles(_0x3cd6db)[_0x51682d(0xba)](_0x5e270a=>_0x5e270a[_0x51682d(0xdc)]));for(const _0x3949c4 of Object['keys'](_0x16aeb4)){if(_0x3ed07a[_0x51682d(0xd9)](_0x3949c4))continue;const _0x166b2a=resolveManagedFilePath(_0x10c635,_0x3949c4);existsSync(_0x166b2a)&&lstatSync(_0x166b2a)['isFile']()&&rmSync(_0x166b2a,{'force':!![]});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x33ae1a,_0x45b220){const _0x28243e=a139_0x47a4,_0x5b6dc7=_0x33ae1a();while(!![]){try{const _0x99e0d5=-parseInt(_0x28243e(0x10e))/0x1*(parseInt(_0x28243e(0xf2))/0x2)+-parseInt(_0x28243e(0x10c))/0x3+-parseInt(_0x28243e(0xfe))/0x4+-parseInt(_0x28243e(0xfa))/0x5+-parseInt(_0x28243e(0x110))/0x6+parseInt(_0x28243e(0xf7))/0x7+parseInt(_0x28243e(0xf8))/0x8;if(_0x99e0d5===_0x45b220)break;else _0x5b6dc7['push'](_0x5b6dc7['shift']());}catch(_0x5a3b3d){_0x5b6dc7['push'](_0x5b6dc7['shift']());}}}(a139_0x1c3d,0x45a17));import{existsSync,readFileSync}from'node:fs';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';function a139_0x47a4(_0x1c65c3,_0x17880c){_0x1c65c3=_0x1c65c3-0xf1;const _0x1c3df8=a139_0x1c3d();let _0x47a41a=_0x1c3df8[_0x1c65c3];return _0x47a41a;}import{fileContent,normalizeLocalFiles}from'./local-files.js';import{buildSkillPackage,localFilesToManifestFiles}from'./zip-package.js';export function buildMetadata(_0x4c256c,_0x23391f,_0x2fafae,_0x4da7d3,_0x9e8a45,_0x4278f4,_0x4f737d){const _0x553aab=a139_0x47a4,_0x5bceb6=_0x4278f4?normalizeLocalFiles(_0x4278f4):[],_0x24ba62=!_0x4f737d&&_0x5bceb6['length']>0x0?buildSkillPackage(_0x5bceb6):undefined,_0x27c120=_0x4f737d?bufferSha256(_0x4f737d):_0x24ba62?.[_0x553aab(0x10f)][_0x553aab(0x101)],_0x41a654=_0x4f737d?.['length']??_0x24ba62?.[_0x553aab(0x10f)][_0x553aab(0x107)],_0x7863ba=_0x5bceb6[_0x553aab(0x112)]>0x0?Object[_0x553aab(0x106)](_0x5bceb6['map'](_0x43f4ca=>[_0x43f4ca['path'],fileHash(_0x43f4ca)])):undefined;return{'schemaVersion':_0x5bceb6[_0x553aab(0x112)]>0x0?0x2:0x1,'id':_0x4c256c['id'],'appCode':_0x2fafae,'skillCode':requireSkillCode(_0x4c256c),'skillName':_0x4c256c[_0x553aab(0xf1)],'description':_0x4c256c[_0x553aab(0xf6)],'example':_0x4c256c[_0x553aab(0x103)],'scope':_0x23391f,'readonly':_0x23391f!=='personal'||_0x4c256c[_0x553aab(0xfb)]===!![],'tenantCode':_0x4c256c['tenantCode'],'userId':_0x4c256c[_0x553aab(0x104)],'version':_0x4c256c[_0x553aab(0x113)],'status':_0x4c256c[_0x553aab(0xfd)],'tags':Array[_0x553aab(0xf3)](_0x4c256c[_0x553aab(0x10a)])?_0x4c256c['tags']:[],'hasUpstreamUpdate':_0x4c256c[_0x553aab(0x111)],'forkedFromSkillId':_0x4c256c['forkedFromSkillId'],'forkedFromVersion':_0x4c256c[_0x553aab(0xfc)],'sourceSessionId':_0x4c256c[_0x553aab(0x108)],'contentHash':_0x4da7d3,'fileHashes':_0x7863ba,'treeHash':_0x5bceb6[_0x553aab(0x112)]>0x0?fileTreeHash(localFilesToManifestFiles(_0x5bceb6)):undefined,'ossPath':remoteManifestOssPath(_0x4c256c[_0x553aab(0x10b)]),'zipSha256':_0x27c120,'zipSize':_0x41a654,'files':_0x5bceb6['length']>0x0?_0x5bceb6['map'](_0x18574e=>({'path':_0x18574e[_0x553aab(0x105)],'hash':fileHash(_0x18574e),'size':fileContent(_0x18574e)['length']})):undefined,'pulledAt':_0x9e8a45??new Date()[_0x553aab(0x109)]()};}export function requireSkillCode(_0x20eab1){const _0x468a0a=a139_0x47a4,_0x1e21ee=_0x20eab1[_0x468a0a(0x10d)]?.['trim']();if(!_0x1e21ee)throw CliErrors[_0x468a0a(0xff)](_0x468a0a(0xf4));return _0x1e21ee;}export function readMetadataIfPresent(_0x3b580d){const _0x9c257c=a139_0x47a4;if(!existsSync(_0x3b580d))return undefined;try{const _0x3d01ba=JSON['parse'](readFileSync(_0x3b580d,'utf8'));return _0x3d01ba;}catch{throw CliErrors[_0x9c257c(0xff)](_0x9c257c(0xf5)+METADATA_FILE+':\x20'+_0x3b580d);}}function remoteManifestOssPath(_0x4d12af){const _0x2aa86d=a139_0x47a4;if(!_0x4d12af||typeof _0x4d12af!=='object'||Array['isArray'](_0x4d12af))return undefined;const _0x283ac7=_0x4d12af[_0x2aa86d(0x102)];return typeof _0x283ac7===_0x2aa86d(0x100)&&_0x283ac7[_0x2aa86d(0xf9)]()?_0x283ac7[_0x2aa86d(0xf9)]():undefined;}function a139_0x1c3d(){const _0x27653b=['toISOString','tags','files','140676EAGiEd','skillCode','271fxiSxH','manifest','1470492rCDomd','hasUpstreamUpdate','length','version','skillName','1894dQInWk','isArray','Runtime\x20Skill\x20is\x20missing\x20skillCode.','Invalid\x20','description','127134ftxbXS','13927912YNywoW','trim','2757370PWyTvu','readonly','forkedFromVersion','status','1495436OEPCcE','validation','string','zipSha256','ossPath','example','userId','path','fromEntries','zipSize','sourceSessionId'];a139_0x1c3d=function(){return _0x27653b;};return a139_0x1c3d();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x2a01ff,_0x261ff5){const _0x49b4cc=a140_0x30ef,_0x2909c0=_0x2a01ff();while(!![]){try{const _0x3fa0a0=parseInt(_0x49b4cc(0x175))/0x1*(-parseInt(_0x49b4cc(0x171))/0x2)+parseInt(_0x49b4cc(0x16f))/0x3+-parseInt(_0x49b4cc(0x166))/0x4*(parseInt(_0x49b4cc(0x173))/0x5)+-parseInt(_0x49b4cc(0x168))/0x6*(-parseInt(_0x49b4cc(0x165))/0x7)+-parseInt(_0x49b4cc(0x16c))/0x8+parseInt(_0x49b4cc(0x179))/0x9*(-parseInt(_0x49b4cc(0x164))/0xa)+parseInt(_0x49b4cc(0x163))/0xb*(parseInt(_0x49b4cc(0x16a))/0xc);if(_0x3fa0a0===_0x261ff5)break;else _0x2909c0['push'](_0x2909c0['shift']());}catch(_0x3a5c2b){_0x2909c0['push'](_0x2909c0['shift']());}}}(a140_0x1fe7,0xeb4ee));import{existsSync}from'node:fs';import{homedir}from'node:os';function a140_0x1fe7(){const _0x4c770f=['.agents','196RLbfFq','claudeSkillsDir','agentsSkillsDir','homeDir','1611UuicYL','skills','includes','CLAUDE_SKILL_ROOT','cacheRoot','homeDirName','101189CWJPYm','76660QVxiSP','161CpxtnL','28AduWBm','validation','347934ADzdfs','trim','6024rOYSmG','.workbuddy','7173256ECStng','workbuddySkillsDir','.claude','2353455FqgxyL','appCode','16672DpBsip','SKILL_ROOT','1335415xuJDeo'];a140_0x1fe7=function(){return _0x4c770f;};return a140_0x1fe7();}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(_0x19caca={}){const _0x1ee849=a140_0x30ef,_0x1b19a4=_0x19caca[_0x1ee849(0x178)]??homedir(),_0x519b0f=resolve(_0x1b19a4,PRODUCT_CONFIG[_0x1ee849(0x162)],'cache'),_0x49ec1d=trimmedEnv(_0x1ee849(0x172)),_0x576133=trimmedEnv(_0x1ee849(0x160)),_0x5e3bd7=resolve(_0x1b19a4,_0x1ee849(0x16b)),_0x381363=_0x19caca[_0x1ee849(0x16d)]??(existsSync(_0x5e3bd7)?resolve(_0x5e3bd7,_0x1ee849(0x17a)):undefined);return{'homeDir':_0x1b19a4,'cacheRoot':_0x519b0f,'managedRoot':resolve(_0x1b19a4,PRODUCT_CONFIG[_0x1ee849(0x162)]),'agentsSkillsDir':_0x19caca['agentsSkillsDir']??_0x49ec1d??resolve(_0x1b19a4,_0x1ee849(0x174),_0x1ee849(0x17a)),'claudeSkillsDir':_0x19caca[_0x1ee849(0x176)]??_0x576133??resolve(_0x1b19a4,_0x1ee849(0x16e),_0x1ee849(0x17a)),'workbuddySkillsDir':_0x381363};}export function runtimeAgentSkillRoots(_0x131fdf){const _0x5b4941=a140_0x30ef;return[_0x131fdf[_0x5b4941(0x177)],_0x131fdf[_0x5b4941(0x176)],_0x131fdf[_0x5b4941(0x16d)]]['filter'](_0x3dbcb7=>Boolean(_0x3dbcb7));}function a140_0x30ef(_0x4949eb,_0x430aae){_0x4949eb=_0x4949eb-0x15f;const _0x1fe790=a140_0x1fe7();let _0x30ef5d=_0x1fe790[_0x4949eb];return _0x30ef5d;}export function getRuntimeSkillCacheRoot(_0x4ac418,_0x2c5c0e,_0x38f8af={}){const _0x429f77=a140_0x30ef,_0x46846a=resolveSkillSyncPaths(_0x38f8af);return resolve(_0x46846a[_0x429f77(0x161)],_0x4ac418,fingerprintAccessKey(_0x2c5c0e),_0x429f77(0x17a));}export function getRuntimeSkillDir(_0x53f1cc,_0x41aea2,_0x3d7efa,_0x2fe502,_0xc0343a,_0x31ca03={}){const _0x396adf=a140_0x30ef;return resolve(getRuntimeSkillCacheRoot(_0x53f1cc,_0x41aea2,_0x31ca03),safePathSegment(_0x3d7efa,_0x396adf(0x170)),_0x2fe502,safePathSegment(_0xc0343a,'skillCode'));}export function safePathSegment(_0x1520c8,_0x3ca48d='path\x20segment'){const _0x623361=a140_0x30ef;if(!_0x1520c8||_0x1520c8[_0x623361(0x15f)]('/')||_0x1520c8[_0x623361(0x15f)]('\x5c')||_0x1520c8[_0x623361(0x15f)]('..'))throw CliErrors[_0x623361(0x167)]('Unsafe\x20'+_0x3ca48d+'\x20for\x20local\x20path:\x20'+_0x1520c8);return _0x1520c8;}function trimmedEnv(_0x1ec3fe){const _0x2afc56=a140_0x30ef,_0xe56ede=productEnv(_0x1ec3fe)?.[_0x2afc56(0x169)]();return _0xe56ede?_0xe56ede:undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x13fcca,_0x24189b){const _0x39ebf8=a141_0x35c6,_0x4439f3=_0x13fcca();while(!![]){try{const _0xbe03af=parseInt(_0x39ebf8(0xf2))/0x1+-parseInt(_0x39ebf8(0xff))/0x2*(-parseInt(_0x39ebf8(0xdd))/0x3)+-parseInt(_0x39ebf8(0xfc))/0x4+parseInt(_0x39ebf8(0x112))/0x5*(-parseInt(_0x39ebf8(0x111))/0x6)+parseInt(_0x39ebf8(0xf5))/0x7*(-parseInt(_0x39ebf8(0xf3))/0x8)+-parseInt(_0x39ebf8(0xfd))/0x9+parseInt(_0x39ebf8(0x104))/0xa;if(_0xbe03af===_0x24189b)break;else _0x4439f3['push'](_0x4439f3['shift']());}catch(_0x757efc){_0x4439f3['push'](_0x4439f3['shift']());}}}(a141_0x4d3c,0x5d9db));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a141_0x447269}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';function a141_0x4d3c(){const _0x161bff=['10157qhBkNG','(unknown)','Skill\x20directory\x20not\x20found:\x20','allowAppCodeRetarget','\x20name\x20for\x20SkillHub\x20slug\x20generation.','ignoreMetadataAppCodeMismatch','number','434240MzNVVS','1775880AZHIql','company','1602jaUDpm','match','replace','\x20has\x20unsupported\x20scope\x20\x22','Remote\x20Skill\x20','6084650KpeLno','dir','\x20has\x20scope=\x22','pushedAt','name','content','ignoreMetadataForPayload','unknown','Skill\x20metadata\x20appCode\x20\x22','refreshedAt','object','files','personal','834NLsGCX','27140QPnHUc','Missing\x20','builtin','packageBase64','string','scope','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20','\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22','isFile','example','boolean','path','Unable\x20to\x20resolve\x20skillCode\x20from\x20','displayName','appCode','version','excludedFilePaths','metadata','skillCode','1314uLFsGk','manifest','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20','\x20to\x20submit\x20company\x20Skills\x20for\x20review.','isDirectory','isSymbolicLink',',\x20or\x20directory\x20name.','ignoreMetadataScope','length','slice','tags','toLowerCase','sourceSessionId','utf8','targetScope','ignoreInvalidMetadata','description','trim','validation','isArray','startsWith','591894zGFzeU','592dZRefr','skillName'];a141_0x4d3c=function(){return _0x161bff;};return a141_0x4d3c();}import{fileText,normalizeLocalFiles,scanSkillDirectory}from'./local-files.js';import{buildMetadata,readMetadataIfPresent}from'./metadata.js';import{buildSkillPackage,tryNormalizePackageManifest}from'./zip-package.js';export function resolvePushDirectoryIdentity(_0x5e5479,_0x26f2c2,_0x351946={}){const _0x3cf1ca=a141_0x35c6,_0xe28252=resolvePushDirectoryRoot(_0x5e5479),_0x2a9fb7=readPushMetadataIfPresent(resolve(_0xe28252,METADATA_FILE),{'ignoreInvalidMetadata':_0x351946[_0x3cf1ca(0xec)]});if(_0x2a9fb7?.[_0x3cf1ca(0xd8)]&&_0x2a9fb7[_0x3cf1ca(0xd8)]!==_0x26f2c2&&!_0x351946[_0x3cf1ca(0xf8)]&&!_0x351946[_0x3cf1ca(0xfa)])throw CliErrors[_0x3cf1ca(0xef)](_0x3cf1ca(0x10c)+_0x2a9fb7['appCode']+_0x3cf1ca(0xd1)+_0x26f2c2+'\x22.');const _0x57083e=resolvePushSkillCode(_0xe28252,_0x26f2c2,_0x2a9fb7,_0x351946);if(!_0x57083e)throw CliErrors[_0x3cf1ca(0xef)](_0x3cf1ca(0xd6)+SKILL_FILE+',\x20'+METADATA_FILE+_0x3cf1ca(0xe3));return{'dir':_0xe28252,'skillCode':_0x57083e,'metadata':_0x2a9fb7};}export function readPushDirectory(_0x217853,_0x5f3692,_0xabbd1d={}){const _0x3649c7=a141_0x35c6,_0x2879cb=resolvePushDirectoryIdentity(_0x217853,_0x5f3692,_0xabbd1d),_0x8a4ed=_0x2879cb[_0x3649c7(0x105)],_0x3f5a5e=resolve(_0x8a4ed,SKILL_FILE);if(!existsSync(_0x3f5a5e)||!lstatSync(_0x3f5a5e)[_0x3649c7(0xd2)]())throw CliErrors[_0x3649c7(0xef)](_0x3649c7(0x113)+SKILL_FILE+':\x20'+_0x3f5a5e);const _0x1042fc=_0x2879cb[_0x3649c7(0xdb)],_0x2564d3=_0xabbd1d[_0x3649c7(0xeb)]??_0x3649c7(0x110);if(!_0xabbd1d[_0x3649c7(0xe4)]&&_0x1042fc?.[_0x3649c7(0x117)]===_0x3649c7(0x114))throw CliErrors[_0x3649c7(0xef)]('Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20'+METADATA_FILE+_0x3649c7(0x106)+_0x1042fc['scope']+'\x22.');if(!_0xabbd1d['ignoreMetadataScope']&&_0x2564d3===_0x3649c7(0x110)&&_0x1042fc?.[_0x3649c7(0x117)]&&_0x1042fc['scope']!=='personal')throw CliErrors['validation'](_0x3649c7(0xd0)+METADATA_FILE+_0x3649c7(0x106)+_0x1042fc[_0x3649c7(0x117)]+'\x22.',_0x3649c7(0xdf)+_0x8a4ed+_0x3649c7(0xe0));const _0x2482fa=scanSkillDirectory(_0x8a4ed,{'excludedFilePaths':_0xabbd1d[_0x3649c7(0xda)]}),_0x435ab9=buildSkillPackage(_0x2482fa),_0x566ac1=readFileSync(_0x3f5a5e,'utf8'),_0xf0c5a7=_0x2879cb[_0x3649c7(0xdc)],_0x33ed1d=_0xabbd1d[_0x3649c7(0x10a)]?undefined:_0x1042fc,_0xbadcab=readSkillDisplayName(_0x566ac1);return{'skillCode':_0xf0c5a7,'metadata':_0x1042fc,'frontmatterDisplayName':_0xbadcab,'input':{'skillCode':_0xf0c5a7,'skillName':_0xbadcab??_0x33ed1d?.[_0x3649c7(0xf4)],'description':_0x33ed1d?.['description'],'content':_0x566ac1,'files':_0x435ab9[_0x3649c7(0xde)],'packageBase64':_0x435ab9[_0x3649c7(0x115)],'tags':_0x33ed1d?.[_0x3649c7(0xe7)],'version':_0x33ed1d?.[_0x3649c7(0xd9)],'sourceSessionId':_0x33ed1d?.[_0x3649c7(0xe9)]}};}export function refreshPushDirectoryMetadataFromRemote(_0x4f6749,_0x580eb8,_0x52a4a7,_0xfde670={}){const _0x5a65f8=a141_0x35c6,_0x1eb630=resolvePushDirectoryRoot(_0x4f6749),_0x450e38=readPushMetadataIfPresent(resolve(_0x1eb630,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x27582b=requireRemoteScope(_0x580eb8),_0x44f41e=readLocalSkillContent(_0x1eb630),_0x5be264={..._0x580eb8,'appCode':_0x580eb8[_0x5a65f8(0xd8)]??_0x52a4a7,'skillName':_0x580eb8[_0x5a65f8(0xf4)]??_0x450e38?.[_0x5a65f8(0xf4)],'description':_0x580eb8[_0x5a65f8(0xed)]??_0x450e38?.[_0x5a65f8(0xed)],'example':_0x580eb8['example']??_0x450e38?.[_0x5a65f8(0xd3)],'tags':Array[_0x5a65f8(0xf0)](_0x580eb8[_0x5a65f8(0xe7)])?_0x580eb8[_0x5a65f8(0xe7)]:_0x450e38?.[_0x5a65f8(0xe7)],'sourceSessionId':_0x580eb8[_0x5a65f8(0xe9)]??_0x450e38?.['sourceSessionId'],'content':_0x580eb8[_0x5a65f8(0x109)]??_0x44f41e},_0x3bf689=buildMetadata(_0x5be264,_0x27582b,_0x52a4a7,contentHash(_0x44f41e),_0xfde670[_0x5a65f8(0x10d)]);writeJsonAtomic(resolve(_0x1eb630,METADATA_FILE),_0x3bf689);}export function recordPushedRuntimeSkill(_0x351e2a,_0x2448de,_0x5b0337,_0x4c10ad={}){const _0x2c2f40=a141_0x35c6,_0x17cda6=resolvePushDirectoryRoot(_0x351e2a),_0x267c21=scanSkillDirectory(_0x17cda6),_0x55c7af=_0x267c21['find'](_0x5e0dd2=>_0x5e0dd2['path']===SKILL_FILE),_0x3cab51=_0x55c7af?fileText(_0x55c7af):'',_0x34e424=tryNormalizePackageManifest(_0x2448de[_0x2c2f40(0x10f)]),_0x416153={..._0x2448de,'content':_0x2448de['content']??_0x3cab51,'files':_0x34e424},_0x5286cc=_0x34e424?normalizeLocalFiles(_0x267c21)['filter'](_0x1c80c6=>_0x34e424[_0x2c2f40(0x10f)]['some'](_0x2b18c8=>_0x2b18c8[_0x2c2f40(0xd5)]===_0x1c80c6[_0x2c2f40(0xd5)])):undefined,_0x2f9bdd=buildMetadata(_0x416153,_0x4c10ad['scope']??_0x2c2f40(0x110),_0x5b0337,contentHash(_0x416153[_0x2c2f40(0x109)]??''),_0x4c10ad[_0x2c2f40(0x107)],_0x5286cc);writeJsonAtomic(resolve(_0x17cda6,METADATA_FILE),_0x2f9bdd);}export function deriveSkillCodeFromDirectory(_0x4f9c82,_0xe365c9){const _0x195fa8=a141_0x35c6,_0x4eead4=basename(resolve(_0x4f9c82)),_0x5ec2e0=_0xe365c9+'--';return _0x4eead4[_0x195fa8(0xf1)](_0x5ec2e0)?_0x4eead4[_0x195fa8(0xe6)](_0x5ec2e0[_0x195fa8(0xe5)]):_0x4eead4;}function resolvePushSkillCode(_0x32114b,_0x5839ec,_0x5802fa,_0x2fa8bd){const _0x55de5b=a141_0x35c6,_0x1ead21=deriveSkillCodeFromSkillFile(_0x32114b)||deriveSkillCodeFromDirectory(_0x32114b,_0x5839ec);if(_0x2fa8bd['ignoreMetadataSkillCode'])return _0x1ead21;return _0x5802fa?.[_0x55de5b(0xdc)]?.['trim']()||_0x1ead21;}function deriveSkillCodeFromSkillFile(_0x225359){const _0x149ce1=a141_0x35c6,_0x2dce78=resolve(_0x225359,SKILL_FILE);if(!existsSync(_0x2dce78)||!lstatSync(_0x2dce78)['isFile']())return undefined;const _0x9cb8bd=readFileSync(_0x2dce78,_0x149ce1(0xea)),_0x1d465b=_0x9cb8bd[_0x149ce1(0x100)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x1d465b)return undefined;const _0x51d238=parseFrontmatterObject(_0x1d465b[0x1]??''),_0x448332=scalarToString(_0x51d238?.[_0x149ce1(0x108)]);return _0x448332?slugifySkillName(_0x448332):undefined;}function readSkillDisplayName(_0x3e098f){const _0x427a82=a141_0x35c6,_0x3280f8=_0x3e098f['match'](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x3280f8)return undefined;const _0x51c05d=parseFrontmatterObject(_0x3280f8[0x1]??'');return scalarToString(_0x51c05d?.[_0x427a82(0xd7)]);}function slugifySkillName(_0x21e33b){const _0x2b22e3=a141_0x35c6,_0x47267d=_0x21e33b[_0x2b22e3(0xee)]()[_0x2b22e3(0xe8)]()[_0x2b22e3(0x101)](/[^\p{L}\p{N}\p{So}]+/gu,'-')[_0x2b22e3(0x101)](/^-+/,'')['replace'](/-+$/,'')[_0x2b22e3(0x101)](/-{2,}/g,'-');if(!_0x47267d)throw CliErrors['validation']('Invalid\x20'+SKILL_FILE+_0x2b22e3(0xf9));return _0x47267d;}function parseFrontmatterObject(_0x13285f){const _0x1d2de5=a141_0x35c6;try{const _0x346a3e=a141_0x447269(_0x13285f);return _0x346a3e&&typeof _0x346a3e===_0x1d2de5(0x10e)&&!Array['isArray'](_0x346a3e)?_0x346a3e:undefined;}catch{return undefined;}}function scalarToString(_0x20e5f7){const _0x154c43=a141_0x35c6;if(typeof _0x20e5f7===_0x154c43(0x116))return _0x20e5f7[_0x154c43(0xee)]();if(typeof _0x20e5f7===_0x154c43(0xfb)||typeof _0x20e5f7===_0x154c43(0xd4))return String(_0x20e5f7);return undefined;}function resolvePushDirectoryRoot(_0x477edb){const _0x4296da=a141_0x35c6,_0x2b0d83=resolve(_0x477edb);if(!existsSync(_0x2b0d83))throw CliErrors['validation'](_0x4296da(0xf7)+_0x477edb);const _0xa96754=lstatSync(_0x2b0d83);if(_0xa96754['isDirectory']())return _0x2b0d83;if(_0xa96754[_0x4296da(0xe2)]()){const _0x30f954=realpathSync(_0x2b0d83);if(lstatSync(_0x30f954)[_0x4296da(0xe1)]())return _0x30f954;}throw CliErrors['validation'](_0x4296da(0xf7)+_0x477edb);}function requireRemoteScope(_0x2f0ebf){const _0x489983=a141_0x35c6;if(_0x2f0ebf['scope']===_0x489983(0x110)||_0x2f0ebf[_0x489983(0x117)]===_0x489983(0xfe)||_0x2f0ebf[_0x489983(0x117)]===_0x489983(0x114))return _0x2f0ebf['scope'];throw CliErrors['validation'](_0x489983(0x103)+(_0x2f0ebf[_0x489983(0xdc)]||_0x489983(0xf6))+_0x489983(0x102)+(_0x2f0ebf['scope']??_0x489983(0x10b))+'\x22.');}function readLocalSkillContent(_0x2575e5){const _0x320ee2=a141_0x35c6,_0x291452=resolve(_0x2575e5,SKILL_FILE);return existsSync(_0x291452)&&lstatSync(_0x291452)['isFile']()?readFileSync(_0x291452,_0x320ee2(0xea)):'';}function a141_0x35c6(_0x3462c2,_0x785b97){_0x3462c2=_0x3462c2-0xd0;const _0x4d3c10=a141_0x4d3c();let _0x35c6c9=_0x4d3c10[_0x3462c2];return _0x35c6c9;}function readPushMetadataIfPresent(_0x347280,_0x4ec479={}){try{return readMetadataIfPresent(_0x347280);}catch(_0x1cabaf){if(_0x4ec479['ignoreInvalidMetadata'])return undefined;throw _0x1cabaf;}}
|
|
1
|
+
(function(_0x14dd52,_0x42e90f){const _0x4cae09=a141_0x2587,_0x200a18=_0x14dd52();while(!![]){try{const _0x5e4e2d=parseInt(_0x4cae09(0x142))/0x1*(-parseInt(_0x4cae09(0x162))/0x2)+-parseInt(_0x4cae09(0x13b))/0x3+-parseInt(_0x4cae09(0x139))/0x4*(-parseInt(_0x4cae09(0x14d))/0x5)+-parseInt(_0x4cae09(0x149))/0x6+parseInt(_0x4cae09(0x158))/0x7+parseInt(_0x4cae09(0x137))/0x8*(-parseInt(_0x4cae09(0x164))/0x9)+-parseInt(_0x4cae09(0x15c))/0xa*(-parseInt(_0x4cae09(0x134))/0xb);if(_0x5e4e2d===_0x42e90f)break;else _0x200a18['push'](_0x200a18['shift']());}catch(_0x3f9e20){_0x200a18['push'](_0x200a18['shift']());}}}(a141_0x3f30,0x45802));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';function a141_0x3f30(){const _0x102b01=['skillCode','\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22','21000eLAxUy','appCode','targetScope','\x20has\x20unsupported\x20scope\x20\x22','trim','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20','14otSXjd','path','63yxHpjW','length','boolean','manifest','replace','(unknown)','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20',',\x20or\x20directory\x20name.','Remote\x20Skill\x20','ignoreMetadataSkillCode','\x20has\x20scope=\x22','metadata','string','startsWith','Unable\x20to\x20resolve\x20skillCode\x20from\x20','Missing\x20','excludedFilePaths','displayName','slice','ignoreMetadataForPayload','\x20name\x20for\x20SkillHub\x20slug\x20generation.','3894PDmKhW','number','Invalid\x20','626048czEhgO','\x20to\x20submit\x20company\x20Skills\x20for\x20review.','36mgphbq','isFile','1504968TkbPid','Skill\x20metadata\x20appCode\x20\x22','example','Skill\x20directory\x20not\x20found:\x20','description','isDirectory','skillName','1607YWbzuB','builtin','pushedAt','unknown','isArray','content','some','131376NPqqwh','scope','personal','version','272755VzcEgi','ignoreMetadataScope','object','ignoreInvalidMetadata','tags','company','name','sourceSessionId','validation','files','find','930356NGSnBc','utf8'];a141_0x3f30=function(){return _0x102b01;};return a141_0x3f30();}import{basename,resolve}from'node:path';import{parse as a141_0x3fa1b9}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{writeJsonAtomic}from'./fs-utils.js';import{contentHash}from'./hashing.js';import{fileText,normalizeLocalFiles,scanSkillDirectory}from'./local-files.js';import{buildMetadata,readMetadataIfPresent}from'./metadata.js';import{buildSkillPackage,tryNormalizePackageManifest}from'./zip-package.js';function a141_0x2587(_0x43d7a6,_0x3af1fc){_0x43d7a6=_0x43d7a6-0x12a;const _0x3f308e=a141_0x3f30();let _0x2587cc=_0x3f308e[_0x43d7a6];return _0x2587cc;}export function resolvePushDirectoryIdentity(_0x99cb37,_0x414ed1,_0x222f99={}){const _0x4a54d9=a141_0x2587,_0x402e2e=resolvePushDirectoryRoot(_0x99cb37),_0x3f4007=readPushMetadataIfPresent(resolve(_0x402e2e,METADATA_FILE),{'ignoreInvalidMetadata':_0x222f99[_0x4a54d9(0x150)]});if(_0x3f4007?.[_0x4a54d9(0x15d)]&&_0x3f4007[_0x4a54d9(0x15d)]!==_0x414ed1&&!_0x222f99['allowAppCodeRetarget']&&!_0x222f99['ignoreMetadataAppCodeMismatch'])throw CliErrors[_0x4a54d9(0x155)](_0x4a54d9(0x13c)+_0x3f4007[_0x4a54d9(0x15d)]+_0x4a54d9(0x15b)+_0x414ed1+'\x22.');const _0x20a23f=resolvePushSkillCode(_0x402e2e,_0x414ed1,_0x3f4007,_0x222f99);if(!_0x20a23f)throw CliErrors[_0x4a54d9(0x155)](_0x4a54d9(0x12d)+SKILL_FILE+',\x20'+METADATA_FILE+_0x4a54d9(0x16b));return{'dir':_0x402e2e,'skillCode':_0x20a23f,'metadata':_0x3f4007};}export function readPushDirectory(_0x239ec0,_0x31b1b5,_0x31ebb1={}){const _0x4c943e=a141_0x2587,_0x30ae73=resolvePushDirectoryIdentity(_0x239ec0,_0x31b1b5,_0x31ebb1),_0xad6579=_0x30ae73['dir'],_0x44ff3e=resolve(_0xad6579,SKILL_FILE);if(!existsSync(_0x44ff3e)||!lstatSync(_0x44ff3e)[_0x4c943e(0x13a)]())throw CliErrors[_0x4c943e(0x155)](_0x4c943e(0x12e)+SKILL_FILE+':\x20'+_0x44ff3e);const _0x18305a=_0x30ae73[_0x4c943e(0x12a)],_0x23c2d4=_0x31ebb1[_0x4c943e(0x15e)]??_0x4c943e(0x14b);if(!_0x31ebb1[_0x4c943e(0x14e)]&&_0x18305a?.[_0x4c943e(0x14a)]===_0x4c943e(0x143))throw CliErrors[_0x4c943e(0x155)]('Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20'+METADATA_FILE+_0x4c943e(0x16e)+_0x18305a[_0x4c943e(0x14a)]+'\x22.');if(!_0x31ebb1[_0x4c943e(0x14e)]&&_0x23c2d4===_0x4c943e(0x14b)&&_0x18305a?.[_0x4c943e(0x14a)]&&_0x18305a[_0x4c943e(0x14a)]!==_0x4c943e(0x14b))throw CliErrors[_0x4c943e(0x155)](_0x4c943e(0x16a)+METADATA_FILE+_0x4c943e(0x16e)+_0x18305a[_0x4c943e(0x14a)]+'\x22.',_0x4c943e(0x161)+_0xad6579+_0x4c943e(0x138));const _0xb268f6=scanSkillDirectory(_0xad6579,{'excludedFilePaths':_0x31ebb1[_0x4c943e(0x12f)]}),_0x1500b9=buildSkillPackage(_0xb268f6),_0x22b55c=readFileSync(_0x44ff3e,_0x4c943e(0x159)),_0x131aee=_0x30ae73[_0x4c943e(0x15a)],_0x45eb10=_0x31ebb1[_0x4c943e(0x132)]?undefined:_0x18305a,_0xfb70e1=readSkillDisplayName(_0x22b55c);return{'skillCode':_0x131aee,'metadata':_0x18305a,'frontmatterDisplayName':_0xfb70e1,'input':{'skillCode':_0x131aee,'skillName':_0xfb70e1??_0x45eb10?.[_0x4c943e(0x141)],'description':_0x45eb10?.[_0x4c943e(0x13f)],'content':_0x22b55c,'files':_0x1500b9[_0x4c943e(0x167)],'packageBase64':_0x1500b9['packageBase64'],'tags':_0x45eb10?.[_0x4c943e(0x151)],'version':_0x45eb10?.[_0x4c943e(0x14c)],'sourceSessionId':_0x45eb10?.[_0x4c943e(0x154)]}};}export function refreshPushDirectoryMetadataFromRemote(_0x50b093,_0x1a4e5a,_0x5c2f40,_0x11cc7e={}){const _0x5531c5=a141_0x2587,_0xa385c9=resolvePushDirectoryRoot(_0x50b093),_0x41b60c=readPushMetadataIfPresent(resolve(_0xa385c9,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x36f8bf=requireRemoteScope(_0x1a4e5a),_0x205cc4=readLocalSkillContent(_0xa385c9),_0x1cc8f7={..._0x1a4e5a,'appCode':_0x1a4e5a['appCode']??_0x5c2f40,'skillName':_0x1a4e5a[_0x5531c5(0x141)]??_0x41b60c?.['skillName'],'description':_0x1a4e5a['description']??_0x41b60c?.[_0x5531c5(0x13f)],'example':_0x1a4e5a['example']??_0x41b60c?.[_0x5531c5(0x13d)],'tags':Array[_0x5531c5(0x146)](_0x1a4e5a[_0x5531c5(0x151)])?_0x1a4e5a[_0x5531c5(0x151)]:_0x41b60c?.[_0x5531c5(0x151)],'sourceSessionId':_0x1a4e5a[_0x5531c5(0x154)]??_0x41b60c?.['sourceSessionId'],'content':_0x1a4e5a[_0x5531c5(0x147)]??_0x205cc4},_0xc712e4=buildMetadata(_0x1cc8f7,_0x36f8bf,_0x5c2f40,contentHash(_0x205cc4),_0x11cc7e['refreshedAt']);writeJsonAtomic(resolve(_0xa385c9,METADATA_FILE),_0xc712e4);}export function recordPushedRuntimeSkill(_0x249a45,_0x5a470c,_0x234e7c,_0x181132={}){const _0x570eb7=a141_0x2587,_0x2448b1=resolvePushDirectoryRoot(_0x249a45),_0xe9e803=scanSkillDirectory(_0x2448b1),_0x567a8f=_0xe9e803[_0x570eb7(0x157)](_0x36da21=>_0x36da21['path']===SKILL_FILE),_0x2cfa12=_0x567a8f?fileText(_0x567a8f):'',_0x1e0172=tryNormalizePackageManifest(_0x5a470c[_0x570eb7(0x156)]),_0x292305={..._0x5a470c,'content':_0x5a470c[_0x570eb7(0x147)]??_0x2cfa12,'files':_0x1e0172},_0x3519e9=_0x1e0172?normalizeLocalFiles(_0xe9e803)['filter'](_0x1fb5ba=>_0x1e0172[_0x570eb7(0x156)][_0x570eb7(0x148)](_0x1bc07a=>_0x1bc07a[_0x570eb7(0x163)]===_0x1fb5ba[_0x570eb7(0x163)])):undefined,_0x4948dd=buildMetadata(_0x292305,_0x181132['scope']??_0x570eb7(0x14b),_0x234e7c,contentHash(_0x292305[_0x570eb7(0x147)]??''),_0x181132[_0x570eb7(0x144)],_0x3519e9);writeJsonAtomic(resolve(_0x2448b1,METADATA_FILE),_0x4948dd);}export function deriveSkillCodeFromDirectory(_0x182dfe,_0x12bc2c){const _0x909685=a141_0x2587,_0x4bb001=basename(resolve(_0x182dfe)),_0x46ab6e=_0x12bc2c+'--';return _0x4bb001[_0x909685(0x12c)](_0x46ab6e)?_0x4bb001[_0x909685(0x131)](_0x46ab6e[_0x909685(0x165)]):_0x4bb001;}function resolvePushSkillCode(_0x44c301,_0x238fa4,_0x2f996b,_0x540dad){const _0x2687bf=a141_0x2587,_0x1c43b3=deriveSkillCodeFromSkillFile(_0x44c301)||deriveSkillCodeFromDirectory(_0x44c301,_0x238fa4);if(_0x540dad[_0x2687bf(0x16d)])return _0x1c43b3;return _0x2f996b?.[_0x2687bf(0x15a)]?.[_0x2687bf(0x160)]()||_0x1c43b3;}function deriveSkillCodeFromSkillFile(_0x183fee){const _0x48023d=a141_0x2587,_0x12b609=resolve(_0x183fee,SKILL_FILE);if(!existsSync(_0x12b609)||!lstatSync(_0x12b609)[_0x48023d(0x13a)]())return undefined;const _0x48429c=readFileSync(_0x12b609,'utf8'),_0x5de4b5=_0x48429c['match'](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x5de4b5)return undefined;const _0x10f397=parseFrontmatterObject(_0x5de4b5[0x1]??''),_0x3cfc47=scalarToString(_0x10f397?.[_0x48023d(0x153)]);return _0x3cfc47?slugifySkillName(_0x3cfc47):undefined;}function readSkillDisplayName(_0xc2841d){const _0x572f11=a141_0x2587,_0x538062=_0xc2841d['match'](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x538062)return undefined;const _0x1bee3f=parseFrontmatterObject(_0x538062[0x1]??'');return scalarToString(_0x1bee3f?.[_0x572f11(0x130)]);}function slugifySkillName(_0x3a3da7){const _0xa23fed=a141_0x2587,_0x1e3362=_0x3a3da7['trim']()['toLowerCase']()['replace'](/[^\p{L}\p{N}\p{So}]+/gu,'-')['replace'](/^-+/,'')[_0xa23fed(0x168)](/-+$/,'')[_0xa23fed(0x168)](/-{2,}/g,'-');if(!_0x1e3362)throw CliErrors[_0xa23fed(0x155)](_0xa23fed(0x136)+SKILL_FILE+_0xa23fed(0x133));return _0x1e3362;}function parseFrontmatterObject(_0x29ba25){const _0x383b76=a141_0x2587;try{const _0x249cc5=a141_0x3fa1b9(_0x29ba25);return _0x249cc5&&typeof _0x249cc5===_0x383b76(0x14f)&&!Array[_0x383b76(0x146)](_0x249cc5)?_0x249cc5:undefined;}catch{return undefined;}}function scalarToString(_0x283447){const _0x576282=a141_0x2587;if(typeof _0x283447===_0x576282(0x12b))return _0x283447[_0x576282(0x160)]();if(typeof _0x283447===_0x576282(0x135)||typeof _0x283447===_0x576282(0x166))return String(_0x283447);return undefined;}function resolvePushDirectoryRoot(_0x37c5c0){const _0x42cf94=a141_0x2587,_0x1fadc2=resolve(_0x37c5c0);if(!existsSync(_0x1fadc2))throw CliErrors[_0x42cf94(0x155)](_0x42cf94(0x13e)+_0x37c5c0);const _0x4bf80e=lstatSync(_0x1fadc2);if(_0x4bf80e[_0x42cf94(0x140)]())return _0x1fadc2;if(_0x4bf80e['isSymbolicLink']()){const _0xbcb910=realpathSync(_0x1fadc2);if(lstatSync(_0xbcb910)[_0x42cf94(0x140)]())return _0xbcb910;}throw CliErrors['validation'](_0x42cf94(0x13e)+_0x37c5c0);}function requireRemoteScope(_0x3cf4cf){const _0x47d266=a141_0x2587;if(_0x3cf4cf[_0x47d266(0x14a)]===_0x47d266(0x14b)||_0x3cf4cf[_0x47d266(0x14a)]===_0x47d266(0x152)||_0x3cf4cf[_0x47d266(0x14a)]===_0x47d266(0x143))return _0x3cf4cf[_0x47d266(0x14a)];throw CliErrors['validation'](_0x47d266(0x16c)+(_0x3cf4cf[_0x47d266(0x15a)]||_0x47d266(0x169))+_0x47d266(0x15f)+(_0x3cf4cf[_0x47d266(0x14a)]??_0x47d266(0x145))+'\x22.');}function readLocalSkillContent(_0x25318d){const _0x33d667=a141_0x2587,_0x336ae3=resolve(_0x25318d,SKILL_FILE);return existsSync(_0x336ae3)&&lstatSync(_0x336ae3)[_0x33d667(0x13a)]()?readFileSync(_0x336ae3,_0x33d667(0x159)):'';}function readPushMetadataIfPresent(_0xaad198,_0xcb2368={}){const _0x427d58=a141_0x2587;try{return readMetadataIfPresent(_0xaad198);}catch(_0x3fe2e6){if(_0xcb2368[_0x427d58(0x150)])return undefined;throw _0x3fe2e6;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a142_0x3ff4(_0x2f1c83,_0x21d071){_0x2f1c83=_0x2f1c83-0x1db;const _0x393f43=a142_0x393f();let _0x3ff431=_0x393f43[_0x2f1c83];return _0x3ff431;}function a142_0x393f(){const _0x211c2d=['18EvDZmf','personal','525258kaPLmH','push','includes','41596nGaGqH','1zkYGIO','builtin','validation','30VCoWrt','6oPHgEK','Unsupported\x20runtime\x20Skill\x20scope:\x20','11614888wJEdwu','11244205SqDxfy','3327328THHPEu','company','length','29520IjEXYH','16489atuNSW','1441550PkQExy'];a142_0x393f=function(){return _0x211c2d;};return a142_0x393f();}(function(_0x4810e2,_0x43f5c4){const _0x23ef8d=a142_0x3ff4,_0x28e402=_0x4810e2();while(!![]){try{const _0x2edb10=-parseInt(_0x23ef8d(0x1ea))/0x1*(-parseInt(_0x23ef8d(0x1de))/0x2)+parseInt(_0x23ef8d(0x1e4))/0x3*(-parseInt(_0x23ef8d(0x1e9))/0x4)+-parseInt(_0x23ef8d(0x1e3))/0x5+parseInt(_0x23ef8d(0x1ee))/0x6*(parseInt(_0x23ef8d(0x1dd))/0x7)+parseInt(_0x23ef8d(0x1dc))/0x8+-parseInt(_0x23ef8d(0x1e6))/0x9*(-parseInt(_0x23ef8d(0x1ed))/0xa)+-parseInt(_0x23ef8d(0x1e2))/0xb*(parseInt(_0x23ef8d(0x1e1))/0xc);if(_0x2edb10===_0x43f5c4)break;else _0x28e402['push'](_0x28e402['shift']());}catch(_0x383bb3){_0x28e402['push'](_0x28e402['shift']());}}}(a142_0x393f,0xd1a3a));import{CliErrors}from'../../errors.js';export function normalizeRuntimeSkillScopes(_0x5ac0e2){const _0x10d8c3=a142_0x3ff4,_0x461728=_0x5ac0e2&&_0x5ac0e2[_0x10d8c3(0x1e0)]>0x0?_0x5ac0e2:['personal',_0x10d8c3(0x1df),_0x10d8c3(0x1eb)],_0x3f9de2=[];for(const _0x560559 of _0x461728){if(!isRuntimeSkillScope(_0x560559))throw CliErrors[_0x10d8c3(0x1ec)](_0x10d8c3(0x1db)+_0x560559);!_0x3f9de2[_0x10d8c3(0x1e8)](_0x560559)&&_0x3f9de2[_0x10d8c3(0x1e7)](_0x560559);}return _0x3f9de2;}export function isRuntimeSkillScope(_0x238df6){const _0x4bbcf4=a142_0x3ff4;return _0x238df6===_0x4bbcf4(0x1e5)||_0x238df6===_0x4bbcf4(0x1df)||_0x238df6===_0x4bbcf4(0x1eb);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a144_0x2947(){const _0x4fe847=['Runtime\x20Skill\x20package\x20contains\x20directory\x20entry:\x20','length','2010780YytLuA','2660409eXjoTt','11154970BsEhSO','endsWith','24sPnpzU','entries','5649MPzBSu','sort','1980-01-01T00:00:00.000Z','code','object','validation_error','11SPUdFe','Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.','3780786sNtzbf','4522740sWxiWq','from','528347TrnUfY','validation','4764DURbhD','2AbHcog'];a144_0x2947=function(){return _0x4fe847;};return a144_0x2947();}const a144_0xed8595=a144_0x5c5f;(function(_0x51206c,_0x223c2c){const _0x2ec5d8=a144_0x5c5f,_0x396dc6=_0x51206c();while(!![]){try{const _0x2f95e7=-parseInt(_0x2ec5d8(0x116))/0x1*(parseInt(_0x2ec5d8(0x119))/0x2)+parseInt(_0x2ec5d8(0x113))/0x3+-parseInt(_0x2ec5d8(0x11c))/0x4+parseInt(_0x2ec5d8(0x114))/0x5+parseInt(_0x2ec5d8(0x118))/0x6*(-parseInt(_0x2ec5d8(0x122))/0x7)+-parseInt(_0x2ec5d8(0x120))/0x8*(parseInt(_0x2ec5d8(0x11d))/0x9)+-parseInt(_0x2ec5d8(0x11e))/0xa*(-parseInt(_0x2ec5d8(0x128))/0xb);if(_0x2f95e7===_0x223c2c)break;else _0x396dc6['push'](_0x396dc6['shift']());}catch(_0x197044){_0x396dc6['push'](_0x396dc6['shift']());}}}(a144_0x2947,0xb0328));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_0xed8595(0x124));export function createDeterministicZipPackage(_0x10d703){const _0x771183={};for(const _0x6455c0 of normalizeLocalFiles(_0x10d703)){_0x771183[_0x6455c0['path']]=fileContent(_0x6455c0);}return Buffer['from'](zipSync(_0x771183,{'level':0x0,'mtime':ZIP_MTIME}));}export function parseZipPackage(_0x3250c2){const _0x4a4e73=a144_0xed8595;if(_0x3250c2[_0x4a4e73(0x11b)]<0x16)throw CliErrors[_0x4a4e73(0x117)](_0x4a4e73(0x129));let _0x592063;try{_0x592063=unzipSync(_0x3250c2,{'filter'(_0x34a0e0){const _0x4de1c8=_0x4a4e73,_0x392f74=normalizeSkillRelativePath(_0x34a0e0['name']);if(_0x392f74[_0x4de1c8(0x11f)]('/'))throw CliErrors[_0x4de1c8(0x117)](_0x4de1c8(0x11a)+_0x392f74);return!![];}});}catch(_0xb1547){if(isRuntimeSkillValidationError(_0xb1547))throw _0xb1547;throw CliErrors[_0x4a4e73(0x117)](_0x4a4e73(0x129));}return Object[_0x4a4e73(0x121)](_0x592063)['map'](([_0x254b6a,_0x27ac52])=>({'path':normalizeSkillRelativePath(_0x254b6a),'bytes':Buffer[_0x4a4e73(0x115)](_0x27ac52)}))[_0x4a4e73(0x123)](compareSkillFiles);}function a144_0x5c5f(_0x3f6ab8,_0x3455a5){_0x3f6ab8=_0x3f6ab8-0x113;const _0x294710=a144_0x2947();let _0x5c5f6e=_0x294710[_0x3f6ab8];return _0x5c5f6e;}function isRuntimeSkillValidationError(_0x40fc5c){const _0x1e9255=a144_0xed8595;return typeof _0x40fc5c===_0x1e9255(0x126)&&_0x40fc5c!==null&&_0x1e9255(0x125)in _0x40fc5c&&_0x40fc5c['code']===_0x1e9255(0x127);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x23c6cb,_0x40f456){const _0x51c6e3=a145_0x53d1,_0x108191=_0x23c6cb();while(!![]){try{const _0x3e72de=parseInt(_0x51c6e3(0xe5))/0x1*(-parseInt(_0x51c6e3(0xe0))/0x2)+parseInt(_0x51c6e3(0x101))/0x3+parseInt(_0x51c6e3(0xe7))/0x4*(parseInt(_0x51c6e3(0xdb))/0x5)+-parseInt(_0x51c6e3(0xff))/0x6+parseInt(_0x51c6e3(0xfa))/0x7*(parseInt(_0x51c6e3(0xea))/0x8)+-parseInt(_0x51c6e3(0xf2))/0x9+parseInt(_0x51c6e3(0xda))/0xa*(-parseInt(_0x51c6e3(0x102))/0xb);if(_0x3e72de===_0x40f456)break;else _0x108191['push'](_0x108191['shift']());}catch(_0x58ca0e){_0x108191['push'](_0x108191['shift']());}}}(a145_0x4110,0xb6f38));import{CliErrors}from'../../errors.js';import{SKILL_FILE}from'./constants.js';import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';import{fileContent,isSha256Hex,normalizeLocalFiles,normalizeManifestFiles}from'./local-files.js';import{createDeterministicZipPackage,parseZipPackage}from'./zip-codec.js';export function buildSkillPackage(_0x1b06e3){const _0x3b635d=a145_0x53d1,_0x501bdc=normalizeLocalFiles(_0x1b06e3);if(!_0x501bdc[_0x3b635d(0xe2)](_0xd329a1=>_0xd329a1[_0x3b635d(0xe9)]===SKILL_FILE))throw CliErrors[_0x3b635d(0x100)](_0x3b635d(0xf0)+SKILL_FILE+_0x3b635d(0xfd));const _0x4e0d79=localFilesToManifestFiles(_0x501bdc),_0x5dec34=createDeterministicZipPackage(_0x501bdc);return{'manifest':{'schemaVersion':0x2,'treeSha256':fileTreeHash(_0x4e0d79),'zipSha256':bufferSha256(_0x5dec34),'zipSize':_0x5dec34['length'],'files':_0x4e0d79},'packageBytes':_0x5dec34,'packageBase64':_0x5dec34[_0x3b635d(0xdf)](_0x3b635d(0xf7))};}export function verifyRuntimeSkillPackage(_0x11baa4,_0x260bf8){const _0x1d92f1=a145_0x53d1,_0x531e2b=normalizePackageManifest(_0x11baa4,{'requireOssPath':![]});if(!_0x531e2b)throw CliErrors[_0x1d92f1(0x100)](_0x1d92f1(0xf3));return extractAndVerifyPackage(_0x531e2b,_0x260bf8);}export function verifyRuntimeSkillBundle(_0x6b19af,_0x297cbc){const _0x25279d=a145_0x53d1,_0x1ef651=normalizePackageManifest(_0x6b19af,{'requireOssPath':![]});if(!_0x1ef651)throw CliErrors[_0x25279d(0x100)]('Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.');return extractAndVerifyPackageFiles(_0x1ef651,_0x297cbc);}function a145_0x4110(){const _0x507be9=['toString','3426EZIoTf','schemaVersion','some','set','size','45dDyxBM','length','4HGLjUD','Runtime\x20Skill\x20package\x20size\x20mismatch.','path','88enRDpq','push','Runtime\x20Skill\x20package\x20file\x20size\x20mismatch:\x20','Runtime\x20Skill\x20package\x20sha256\x20is\x20invalid.','requireOssPath','bytes','Missing\x20','toLowerCase','2354382SAQAMe','Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.','Runtime\x20Skill\x20package\x20is\x20missing\x20','trim','Runtime\x20Skill\x20package\x20sha256\x20mismatch.','base64','Runtime\x20Skill\x20package\x20is\x20required\x20for\x20Skill\x20install:\x20','zipSha256','836486EuuWoJ','zipSize','string','\x20in\x20Skill\x20file\x20package.','Runtime\x20Skill\x20package\x20size\x20is\x20invalid.','3452760pTasay','validation','968736mqtrXf','63228LEytsC','map','Runtime\x20Skill\x20package\x20entry\x20list\x20mismatch.','Runtime\x20Skill\x20file\x20tree\x20sha256\x20mismatch.','ossPath','files','isArray','1140PPSUFK','3406965sNmvjg','Runtime\x20Skill\x20package\x20is\x20missing\x20entry:\x20','isSafeInteger','treeSha256'];a145_0x4110=function(){return _0x507be9;};return a145_0x4110();}export function tryNormalizePackageManifest(_0x38a32b){return normalizePackageManifest(_0x38a32b,{'requireOssPath':![]});}export function requirePackageBytes(_0x36d5a8,_0x2b2a84){const _0x153577=a145_0x53d1;if(!_0x2b2a84||_0x2b2a84[_0x153577(0xe6)]===0x0)throw CliErrors[_0x153577(0x100)](_0x153577(0xf8)+_0x36d5a8);return _0x2b2a84;}export function extractDownloadedPackage(_0x9919a6){const _0x2de5aa=a145_0x53d1,_0x153a3c=parseZipPackage(_0x9919a6)[_0x2de5aa(0x103)](_0x29c3dc=>({'path':_0x29c3dc['path'],'bytes':_0x29c3dc[_0x2de5aa(0xef)]}));if(!_0x153a3c[_0x2de5aa(0xe2)](_0x30b04a=>_0x30b04a['path']===SKILL_FILE))throw CliErrors[_0x2de5aa(0x100)](_0x2de5aa(0xf4)+SKILL_FILE+'.');return normalizeLocalFiles(_0x153a3c);}export function localFilesToManifestFiles(_0x36d3b9){const _0x85505e=a145_0x53d1;return normalizeLocalFiles(_0x36d3b9)[_0x85505e(0x103)](_0x187670=>({'path':_0x187670[_0x85505e(0xe9)],'sha256':fileHash(_0x187670),'size':fileContent(_0x187670)[_0x85505e(0xe6)]}));}function a145_0x53d1(_0x4c0467,_0x20e606){_0x4c0467=_0x4c0467-0xd7;const _0x4110aa=a145_0x4110();let _0x53d19c=_0x4110aa[_0x4c0467];return _0x53d19c;}function normalizePackageManifest(_0x466cc8,_0x560a2f){const _0x24caca=a145_0x53d1;if(!_0x466cc8||typeof _0x466cc8!=='object'||Array[_0x24caca(0xd9)](_0x466cc8))return undefined;const _0x27d2db=_0x466cc8,_0x331d29=typeof _0x27d2db[_0x24caca(0xd7)]===_0x24caca(0xfc)?_0x27d2db[_0x24caca(0xd7)][_0x24caca(0xf5)]():undefined;if(_0x560a2f[_0x24caca(0xee)]&&!_0x331d29)return undefined;if(!Array[_0x24caca(0xd9)](_0x27d2db[_0x24caca(0xd8)])||_0x27d2db[_0x24caca(0xd8)][_0x24caca(0xe6)]===0x0)return undefined;if(!isSha256Hex(_0x27d2db[_0x24caca(0xde)]))throw CliErrors[_0x24caca(0x100)]('Runtime\x20Skill\x20file\x20tree\x20sha256\x20is\x20invalid.');if(!isSha256Hex(_0x27d2db[_0x24caca(0xf9)]))throw CliErrors[_0x24caca(0x100)](_0x24caca(0xed));if(!Number[_0x24caca(0xdd)](_0x27d2db[_0x24caca(0xfb)])||_0x27d2db['zipSize']<0x0)throw CliErrors[_0x24caca(0x100)](_0x24caca(0xfe));const _0x6c9c32=normalizeManifestFiles(_0x27d2db[_0x24caca(0xd8)]);if(!_0x6c9c32[_0x24caca(0xe2)](_0x2ee026=>_0x2ee026['path']===SKILL_FILE))throw CliErrors[_0x24caca(0x100)]('Runtime\x20Skill\x20manifest\x20is\x20missing\x20'+SKILL_FILE+'.');const _0x748f04=fileTreeHash(_0x6c9c32);if(_0x748f04!==_0x27d2db[_0x24caca(0xde)][_0x24caca(0xf1)]())throw CliErrors[_0x24caca(0x100)](_0x24caca(0x105));return{'schemaVersion':Number[_0x24caca(0xdd)](_0x27d2db[_0x24caca(0xe1)])?_0x27d2db[_0x24caca(0xe1)]:0x2,'ossPath':_0x331d29,'treeSha256':_0x748f04,'zipSha256':_0x27d2db['zipSha256']['toLowerCase'](),'zipSize':_0x27d2db[_0x24caca(0xfb)],'files':_0x6c9c32};}function extractAndVerifyPackage(_0x116150,_0xa6c776){const _0x104c50=a145_0x53d1,_0x3b39a3=normalizePackageManifest(_0x116150,{'requireOssPath':![]});if(!_0x3b39a3)throw CliErrors[_0x104c50(0x100)](_0x104c50(0xf3));if(_0xa6c776['length']!==_0x3b39a3[_0x104c50(0xfb)])throw CliErrors[_0x104c50(0x100)](_0x104c50(0xe8));const _0x42c385=bufferSha256(_0xa6c776);if(_0x42c385!==_0x3b39a3[_0x104c50(0xf9)])throw CliErrors[_0x104c50(0x100)](_0x104c50(0xf6));return extractAndVerifyPackageFiles(_0x3b39a3,_0xa6c776);}function extractAndVerifyPackageFiles(_0x116aff,_0x4116db){const _0x14ad11=a145_0x53d1,_0x2dd1d9=parseZipPackage(_0x4116db);if(_0x2dd1d9[_0x14ad11(0xe6)]!==_0x116aff['files'][_0x14ad11(0xe6)])throw CliErrors[_0x14ad11(0x100)](_0x14ad11(0x104));const _0x3cb7db=new Map();for(const _0x363d41 of _0x2dd1d9){if(_0x3cb7db['has'](_0x363d41['path']))throw CliErrors[_0x14ad11(0x100)]('Duplicate\x20Skill\x20package\x20entry:\x20'+_0x363d41[_0x14ad11(0xe9)]);_0x3cb7db[_0x14ad11(0xe3)](_0x363d41[_0x14ad11(0xe9)],_0x363d41);}const _0x273535=[];for(const _0x244268 of _0x116aff['files']){const _0x2f6b35=_0x3cb7db['get'](_0x244268[_0x14ad11(0xe9)]);if(!_0x2f6b35)throw CliErrors[_0x14ad11(0x100)](_0x14ad11(0xdc)+_0x244268[_0x14ad11(0xe9)]);if(_0x2f6b35['bytes'][_0x14ad11(0xe6)]!==_0x244268[_0x14ad11(0xe4)])throw CliErrors[_0x14ad11(0x100)](_0x14ad11(0xec)+_0x244268[_0x14ad11(0xe9)]);const _0xf749d4=bufferSha256(_0x2f6b35[_0x14ad11(0xef)]);if(_0xf749d4!==_0x244268['sha256'])throw CliErrors['validation']('Runtime\x20Skill\x20package\x20file\x20sha256\x20mismatch:\x20'+_0x244268[_0x14ad11(0xe9)]);_0x273535[_0x14ad11(0xeb)]({'path':_0x244268[_0x14ad11(0xe9)],'bytes':_0x2f6b35[_0x14ad11(0xef)]});}return normalizeLocalFiles(_0x273535);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a146_0x292b(){var _0x1876e8=['5771815MNagrM','4887750XbkSzg','259780URkazJ','46701NAOcvg','4544172ZojXxA','48LqwvPy','253113kiheMA','396816gaRvLF','12agQYhn'];a146_0x292b=function(){return _0x1876e8;};return a146_0x292b();}(function(_0xa1f3a5,_0x1f955c){var _0x19a54a=a146_0x40f3,_0x1558bc=_0xa1f3a5();while(!![]){try{var _0x478479=parseInt(_0x19a54a(0xb3))/0x1+parseInt(_0x19a54a(0xb0))/0x2*(-parseInt(_0x19a54a(0xb7))/0x3)+-parseInt(_0x19a54a(0xaf))/0x4+parseInt(_0x19a54a(0xb1))/0x5+-parseInt(_0x19a54a(0xb5))/0x6+parseInt(_0x19a54a(0xb2))/0x7+-parseInt(_0x19a54a(0xb6))/0x8*(-parseInt(_0x19a54a(0xb4))/0x9);if(_0x478479===_0x1f955c)break;else _0x1558bc['push'](_0x1558bc['shift']());}catch(_0x3ab2ac){_0x1558bc['push'](_0x1558bc['shift']());}}}(a146_0x292b,0xbe9bf));export{contentHash,fileTreeHash}from'./runtime-skill-sync/hashing.js';function a146_0x40f3(_0x1cace3,_0x207f14){_0x1cace3=_0x1cace3-0xaf;var _0x292b83=a146_0x292b();var _0x40f31a=_0x292b83[_0x1cace3];return _0x40f31a;}export{linkEffectiveRuntimeSkills,linkGlobalRuntimeSkills,pruneStaleRuntimeSkillCache,pruneStaleRuntimeSkillLinks}from'./runtime-skill-sync/links.js';export{resolveRuntimeSkillInstallTarget}from'./runtime-skill-sync/install-target.js';export{listLocalRuntimeSkills}from'./runtime-skill-sync/list-local.js';export{materializeRuntimeSkill,reuseMaterializedRuntimeSkill}from'./runtime-skill-sync/materialize.js';export{readMetadataIfPresent}from'./runtime-skill-sync/metadata.js';export{getRuntimeSkillCacheRoot,getRuntimeSkillDir,resolveSkillSyncPaths,runtimeAgentSkillRoots}from'./runtime-skill-sync/paths.js';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_0x28b4d5=a147_0x319a;(function(_0x6dd588,_0x843f51){const _0x143e04=a147_0x319a,_0x9c5fb9=_0x6dd588();while(!![]){try{const _0x2bdc00=-parseInt(_0x143e04(0x92))/0x1*(parseInt(_0x143e04(0x93))/0x2)+-parseInt(_0x143e04(0x7a))/0x3*(-parseInt(_0x143e04(0x91))/0x4)+-parseInt(_0x143e04(0x8c))/0x5+-parseInt(_0x143e04(0x78))/0x6*(parseInt(_0x143e04(0x72))/0x7)+-parseInt(_0x143e04(0x74))/0x8+parseInt(_0x143e04(0x76))/0x9*(parseInt(_0x143e04(0x87))/0xa)+parseInt(_0x143e04(0x84))/0xb;if(_0x2bdc00===_0x843f51)break;else _0x9c5fb9['push'](_0x9c5fb9['shift']());}catch(_0x5e40a4){_0x9c5fb9['push'](_0x9c5fb9['shift']());}}}(a147_0x3a09,0xed4aa));import{existsSync,readFileSync}from'node:fs';import{homedir}from'node:os';import{join}from'node:path';export const SKILL_LOCK_RELATIVE_PATH=join(a147_0x28b4d5(0x8f),'.skill-lock.json');function a147_0x3a09(){const _0x33efd1=['\x22\x20but\x20no\x20SKILL.md\x20was\x20found\x20in\x20known\x20layouts\x20','not-recorded','version','includes','unusable','lockFile','join','home','32075857qLJnZm','globalSkillsDirs','object','5858230DodldF','skills','find','\x20uses\x20unsupported\x20version\x20','unverifiable','8128150JIqpCe','\x20has\x20no\x20skills\x20map','absent','.agents','map','4688060DpfHhe','5waZLsZ','378498DOXwnK','parse','SKILL.md','14ummBjW','recorded','14025968Oliyub','\x20is\x20unreadable:\x20','27kiZAZM','number','1645212avmbDs','utf8','3wrqlhW','kind'];a147_0x3a09=function(){return _0x33efd1;};return a147_0x3a09();}function a147_0x319a(_0x23ec87,_0x2db3e0){_0x23ec87=_0x23ec87-0x72;const _0x3a09b7=a147_0x3a09();let _0x319aa3=_0x3a09b7[_0x23ec87];return _0x319aa3;}export const GLOBAL_SKILLS_DIR_RELATIVE_PATHS=[join(a147_0x28b4d5(0x8f),a147_0x28b4d5(0x88)),join('.claude',a147_0x28b4d5(0x88))];const SUPPORTED_LOCK_VERSIONS=[0x3];function readLockLookup(_0x48eb28,_0x355cad){const _0x58e57a=a147_0x28b4d5;if(!existsSync(_0x48eb28))return{'kind':_0x58e57a(0x7d)};let _0x2858f3;try{_0x2858f3=JSON[_0x58e57a(0x94)](readFileSync(_0x48eb28,_0x58e57a(0x79)));}catch(_0x5a7b5d){return{'kind':_0x58e57a(0x80),'reason':_0x48eb28+_0x58e57a(0x75)+_0x5a7b5d['message']};}const _0x6078cc=_0x2858f3;if(typeof _0x6078cc?.['version']!==_0x58e57a(0x77)||!SUPPORTED_LOCK_VERSIONS[_0x58e57a(0x7f)](_0x6078cc[_0x58e57a(0x7e)]))return{'kind':_0x58e57a(0x80),'reason':_0x48eb28+_0x58e57a(0x8a)+String(_0x6078cc?.[_0x58e57a(0x7e)])};if(!_0x6078cc[_0x58e57a(0x88)]||typeof _0x6078cc[_0x58e57a(0x88)]!==_0x58e57a(0x86))return{'kind':'unusable','reason':_0x48eb28+_0x58e57a(0x8d)};return _0x6078cc[_0x58e57a(0x88)][_0x355cad]?{'kind':'recorded'}:{'kind':_0x58e57a(0x7d)};}export function resolveInstalledSkill(_0x42b70c,_0x2a6ea5){const _0x3ff20b=a147_0x28b4d5,_0x1fd2d3=_0x2a6ea5?.[_0x3ff20b(0x83)]??homedir(),_0x20264c=_0x2a6ea5?.[_0x3ff20b(0x85)]??GLOBAL_SKILLS_DIR_RELATIVE_PATHS[_0x3ff20b(0x90)](_0x120beb=>join(_0x1fd2d3,_0x120beb)),_0x5cd01e=_0x2a6ea5?.[_0x3ff20b(0x81)]??join(_0x1fd2d3,SKILL_LOCK_RELATIVE_PATH),_0x30b5d8=_0x20264c[_0x3ff20b(0x90)](_0x47ff1f=>join(_0x47ff1f,_0x42b70c,_0x3ff20b(0x95))),_0x136941=_0x30b5d8[_0x3ff20b(0x89)](_0x141584=>existsSync(_0x141584));if(_0x136941)return{'state':'present','path':_0x136941};const _0xca7405=readLockLookup(_0x5cd01e,_0x42b70c);if(_0xca7405[_0x3ff20b(0x7b)]==='unusable')return{'state':'unverifiable','reason':_0xca7405['reason']};if(_0xca7405[_0x3ff20b(0x7b)]===_0x3ff20b(0x73))return{'state':_0x3ff20b(0x8b),'reason':_0x5cd01e+'\x20records\x20\x22'+_0x42b70c+_0x3ff20b(0x7c)+('('+_0x30b5d8[_0x3ff20b(0x82)](',\x20')+')')};return{'state':_0x3ff20b(0x8e),'checked':_0x30b5d8};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x9cd0b7,_0x335ff9){const _0x40d6c9=a148_0x45ee,_0x19bb41=_0x9cd0b7();while(!![]){try{const _0x44b7d5=-parseInt(_0x40d6c9(0x151))/0x1+-parseInt(_0x40d6c9(0x155))/0x2+-parseInt(_0x40d6c9(0x153))/0x3*(parseInt(_0x40d6c9(0x158))/0x4)+parseInt(_0x40d6c9(0x150))/0x5*(parseInt(_0x40d6c9(0x15a))/0x6)+-parseInt(_0x40d6c9(0x157))/0x7*(parseInt(_0x40d6c9(0x154))/0x8)+parseInt(_0x40d6c9(0x159))/0x9*(parseInt(_0x40d6c9(0x152))/0xa)+-parseInt(_0x40d6c9(0x15b))/0xb*(-parseInt(_0x40d6c9(0x156))/0xc);if(_0x44b7d5===_0x335ff9)break;else _0x19bb41['push'](_0x19bb41['shift']());}catch(_0x120f3f){_0x19bb41['push'](_0x19bb41['shift']());}}}(a148_0x15b5,0xc716f));import{createJqFilter,resolveBundledJqPaths}from'@lovrabet/cli-framework';import{CliErrors}from'../errors.js';function a148_0x45ee(_0x3de9db,_0x5e83e7){_0x3de9db=_0x3de9db-0x150;const _0x15b510=a148_0x15b5();let _0x45eec3=_0x15b510[_0x3de9db];return _0x45eec3;}export const applyJqFilter=createJqFilter(CliErrors,{'bundledJqPaths':resolveBundledJqPaths()});function a148_0x15b5(){const _0x2ab66c=['370970BEXQPE','778175pYgBud','610770xWfVyh','42dgIHAs','1130408vweJRo','2035184ldsPPC','396jVUTwa','49ORxAxs','24392FXvtIT','18EJXqfi','114UmBpHG','717959vuVXgK'];a148_0x15b5=function(){return _0x2ab66c;};return a148_0x15b5();}
|