@lovrabet/lovrabet-cli 2.3.0 → 2.3.1-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli.js +1 -1
- package/lib/commands/api-doc/index.js +1 -1
- package/lib/commands/app/cache.js +1 -1
- package/lib/commands/app/definitions.js +1 -1
- package/lib/commands/app/eligibility.js +1 -1
- package/lib/commands/app/mock-loader.js +1 -1
- package/lib/commands/app/remote-source.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/artifact/index.js +1 -1
- package/lib/commands/auth/device.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/auth/prompt.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/exec.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/common/config-policy.js +1 -1
- package/lib/commands/common/constraints.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/config/definitions.js +1 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/sdk-doc.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/permit/dataset-get.js +1 -1
- package/lib/commands/permit/dataset-set.js +1 -1
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.js +1 -1
- package/lib/commands/personal-bff/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/schedule/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/service/dynamic.js +1 -1
- package/lib/commands/service/function-name-adapter.js +1 -1
- package/lib/commands/service/index.js +1 -1
- package/lib/commands/service/registry.js +1 -1
- package/lib/commands/skill/commands/create.js +1 -1
- package/lib/commands/skill/commands/diagram.js +1 -1
- package/lib/commands/skill/commands/install.js +1 -1
- package/lib/commands/skill/commands/list.js +1 -1
- package/lib/commands/skill/commands/push.js +1 -1
- package/lib/commands/skill/commands/validate.js +1 -1
- package/lib/commands/skill/diagram.js +1 -1
- package/lib/commands/skill/flags.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/skill/manifest-helpers.js +1 -1
- package/lib/commands/skill/push-execute.js +1 -1
- package/lib/commands/skill/push-flow-helpers.js +1 -1
- package/lib/commands/skill/push-retarget.js +1 -1
- package/lib/commands/skill/scopes.js +1 -1
- package/lib/commands/skill/summary.js +1 -1
- package/lib/commands/skill/templates.js +1 -1
- package/lib/commands/skill/validate.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/update.js +1 -1
- package/lib/commands/user-account/bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/config/domain-config.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/app.js +1 -1
- package/lib/constant/auth-mode.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/distribution.js +1 -1
- package/lib/constant/domain.d.ts +3 -3
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/product.js +1 -1
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/api-client.d.ts +0 -16
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/kb-search-client.d.ts +30 -0
- package/lib/core/kb-search-client.js +1 -0
- 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.d.ts +2 -0
- 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/access-key-redaction.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/lossless-json.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/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 +3 -2
- package/skills/lovrabet/guides/sql-and-bff-workflow.md +1 -1
- package/skills/lovrabet/references/lovrabet-config-commands.md +2 -2
- package/skills/lovrabet/references/lovrabet-config.md +2 -2
- package/skills/lovrabet/references/lovrabet-doctor.md +2 -0
- package/skills/lovrabet/references/lovrabet-kb-workflow.md +3 -1
- package/skills/lovrabet/references/lovrabet-personal-bff-workflow.md +32 -0
- package/skills/lovrabet.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a134_0x3a9754=a134_0xf47f;(function(_0x5044c2,_0x3fff7b){const _0x53ae02=a134_0xf47f,_0x4d4ffd=_0x5044c2();while(!![]){try{const _0x459947=-parseInt(_0x53ae02(0xd1))/0x1*(parseInt(_0x53ae02(0xeb))/0x2)+parseInt(_0x53ae02(0xe4))/0x3+parseInt(_0x53ae02(0xe1))/0x4+parseInt(_0x53ae02(0xd8))/0x5*(parseInt(_0x53ae02(0xf6))/0x6)+parseInt(_0x53ae02(0xca))/0x7*(parseInt(_0x53ae02(0xd5))/0x8)+-parseInt(_0x53ae02(0xd2))/0x9*(-parseInt(_0x53ae02(0xd6))/0xa)+-parseInt(_0x53ae02(0xf5))/0xb;if(_0x459947===_0x3fff7b)break;else _0x4d4ffd['push'](_0x4d4ffd['shift']());}catch(_0x2b2e29){_0x4d4ffd['push'](_0x4d4ffd['shift']());}}}(a134_0x15ec,0x6d98e));import{spawnSync}from'node:child_process';import{resolveNpmBin}from'../utils/platform.js';import{LOVRABET_SKILL_SOURCE as a134_0x356e01}from'../constant/distribution.js';import{PRODUCT_CONFIG,productEnvName}from'../constant/product.js';import{resolveInstalledSkill}from'../skills/skill-presence.js';export const LOVRABET_SKILL_SOURCE=a134_0x356e01;function a134_0x15ec(){const _0x31e5c1=['present','state','289844cMoiUl','CHILD_TERMINATED','unknown','2362380bfIhHK','trim','skills@latest','Skill\x20\x22','warn','unverifiable','npx','2pMAjsP','checked','log','presence','npx\x20terminated\x20by\x20signal\x20','NPM_CONFIG_GLOBAL','filter','signal','PERMISSION_DENIED','match','8682069VnhjNu','93858GIeXpW','\x22\x20install\x20state:\x20','2276365OCGrPZ','exit\x20','NPX_NOT_FOUND','add','code','SPAWN_FAILED','EPERM','284170ctHitX','18TUWOzq','EACCES','error','8GrObZY','825850pwePNC','message','55RVgELc','stdio','skipNpxSkillsEnvSuffix','stderr','pipe','stdout','status'];a134_0x15ec=function(){return _0x31e5c1;};return a134_0x15ec();}export const LOVRABET_SKILL_GIT_SOURCE=PRODUCT_CONFIG['internalSkillSource'];function a134_0xf47f(_0x7f11ba,_0x5cd827){_0x7f11ba=_0x7f11ba-0xc9;const _0x15ec77=a134_0x15ec();let _0xf47fbc=_0x15ec77[_0x7f11ba];return _0xf47fbc;}export const LOVRABET_GLOBAL_SKILL_NAME=PRODUCT_CONFIG['globalSkillName'];export function resolveGlobalSkillName(_0x48c64a){const _0x68df59=a134_0xf47f;switch(_0x48c64a[_0x68df59(0xe5)]()){case LOVRABET_SKILL_SOURCE:case LOVRABET_SKILL_GIT_SOURCE:return LOVRABET_GLOBAL_SKILL_NAME;default:return undefined;}}export const LOVRABET_SKIP_NPX_SKILLS_ENV=productEnvName(PRODUCT_CONFIG[a134_0x3a9754(0xda)]);const CHILD_OUTPUT_MAX_BUFFER=0x10*0x400*0x400;function failure(_0x1af5bf,_0x5fd663,_0x8f0ce0){return{'ok':![],'status':_0x5fd663,'code':_0x1af5bf,'error':'['+_0x1af5bf+']\x20'+_0x8f0ce0};}export function shouldSkipNpxSkillsAdd(){return process.env[LOVRABET_SKIP_NPX_SKILLS_ENV]==='1';}export function runNpxSkillsAddGlobal(_0x5cd7a3,_0x49372d=LOVRABET_SKILL_SOURCE,_0x52e6d2){const _0x2b576b=a134_0x3a9754;if(shouldSkipNpxSkillsAdd())return{'ok':!![],'status':0x0,'skipped':!![]};const _0x21bc24=resolveNpmBin(_0x2b576b(0xea)),_0x336c9e=['-y',_0x2b576b(0xe6),_0x2b576b(0xcd),_0x49372d,'-g','-y'],_0x454e88=[_0x21bc24,..._0x336c9e]['join']('\x20');console[_0x2b576b(0xed)]('*\x20'+_0x454e88);const _0x32d20d={...process.env};delete _0x32d20d['npm_config_global'],delete _0x32d20d[_0x2b576b(0xf0)];const _0x15d02e=spawnSync(_0x21bc24,_0x336c9e,{'cwd':_0x5cd7a3,'stdio':'pipe','env':_0x32d20d,'shell':![],'maxBuffer':CHILD_OUTPUT_MAX_BUFFER}),_0x1f04fd=[_0x15d02e[_0x2b576b(0xdd)]?_0x15d02e[_0x2b576b(0xdd)]['toString']():'',_0x15d02e['stderr']?_0x15d02e[_0x2b576b(0xdb)]['toString']():''][_0x2b576b(0xf1)](Boolean)['join']('\x0a')[_0x2b576b(0xe5)]();_0x52e6d2?.[_0x2b576b(0xd9)]!==_0x2b576b(0xdc)&&_0x1f04fd&&console[_0x2b576b(0xed)](_0x1f04fd);if(_0x15d02e[_0x2b576b(0xd4)]){const _0x518a66=_0x15d02e[_0x2b576b(0xd4)],_0x2fa991=_0x518a66[_0x2b576b(0xce)]==='ENOENT'?_0x2b576b(0xcc):_0x518a66['code']===_0x2b576b(0xd0)||_0x518a66[_0x2b576b(0xce)]===_0x2b576b(0xd3)?_0x2b576b(0xf3):_0x2b576b(0xcf);return failure(_0x2fa991,_0x15d02e[_0x2b576b(0xde)],_0x518a66[_0x2b576b(0xd7)]);}if(_0x15d02e[_0x2b576b(0xf2)])return failure(_0x2b576b(0xe2),_0x15d02e['status'],_0x2b576b(0xef)+_0x15d02e[_0x2b576b(0xf2)]);if(_0x15d02e['status']!==0x0)return failure('CHILD_EXIT_NONZERO',_0x15d02e[_0x2b576b(0xde)],_0x1f04fd||_0x2b576b(0xcb)+(_0x15d02e[_0x2b576b(0xde)]??_0x2b576b(0xe3)));const _0x45ee00=_0x52e6d2?.['expectedSkillName']??resolveGlobalSkillName(_0x49372d),_0x2a1d7d=_0x45ee00?resolveInstalledSkill(_0x45ee00,_0x52e6d2?.[_0x2b576b(0xee)]):undefined,_0x55b0fc=_0x1f04fd[_0x2b576b(0xf4)](/Failed to install\s+(\d+)/i);if(_0x55b0fc&&Number(_0x55b0fc[0x1])>0x0){const _0x2be983='Installer\x20reported\x20'+_0x55b0fc[0x1]+'\x20failed\x20target(s)'+(_0x1f04fd?':\x0a'+_0x1f04fd:'');if(_0x2a1d7d?.[_0x2b576b(0xe0)]===_0x2b576b(0xdf))return console[_0x2b576b(0xe8)]('!\x20'+_0x2be983),{'ok':!![],'status':0x0};return failure('INSTALL_PARTIAL',0x0,_0x2be983);}if(_0x45ee00&&_0x2a1d7d){if(_0x2a1d7d[_0x2b576b(0xe0)]==='absent')return failure('SKILL_NOT_INSTALLED',0x0,_0x2b576b(0xe7)+_0x45ee00+'\x22\x20not\x20found\x20after\x20install\x20(checked\x20'+_0x2a1d7d[_0x2b576b(0xec)]['join'](',\x20')+')');_0x2a1d7d[_0x2b576b(0xe0)]===_0x2b576b(0xe9)&&console[_0x2b576b(0xe8)]('!\x20Could\x20not\x20verify\x20\x22'+_0x45ee00+_0x2b576b(0xc9)+_0x2a1d7d['reason']);}return{'ok':!![],'status':0x0};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a135_0x5d82(_0x4e7c8f,_0x2ba76d){_0x4e7c8f=_0x4e7c8f-0x1d1;const _0x582708=a135_0x5827();let _0x5d82d3=_0x582708[_0x4e7c8f];return _0x5d82d3;}const a135_0x5cfb97=a135_0x5d82;(function(_0x3f62b2,_0x4d2f37){const _0x552855=a135_0x5d82,_0x10e99e=_0x3f62b2();while(!![]){try{const _0x46e439=-parseInt(_0x552855(0x1e2))/0x1+parseInt(_0x552855(0x1e4))/0x2*(-parseInt(_0x552855(0x1d6))/0x3)+-parseInt(_0x552855(0x1db))/0x4*(-parseInt(_0x552855(0x1d1))/0x5)+-parseInt(_0x552855(0x1da))/0x6*(parseInt(_0x552855(0x1d8))/0x7)+parseInt(_0x552855(0x1dd))/0x8*(-parseInt(_0x552855(0x1de))/0x9)+-parseInt(_0x552855(0x1e7))/0xa*(parseInt(_0x552855(0x1d7))/0xb)+parseInt(_0x552855(0x1d4))/0xc;if(_0x46e439===_0x4d2f37)break;else _0x10e99e['push'](_0x10e99e['shift']());}catch(_0x3fd28){_0x10e99e['push'](_0x10e99e['shift']());}}}(a135_0x5827,0x36330));export const METADATA_FILE=a135_0x5cfb97(0x1d5);export const SKILL_FILE=a135_0x5cfb97(0x1e6);export const IGNORED_FILE_NAMES=new Set([METADATA_FILE,a135_0x5cfb97(0x1d3)]);function a135_0x5827(){const _0x526b65=['SKILL.md','29130FZbJJP','74020BDhRcY','dist','.DS_Store','14071920fOPxkg','lovrabet.skill.json','430527hoDipH','671McGIaT','140819sndcXI','node_modules','54YtTxOy','16iswHdo','.next','32Pgsxlv','823563PoiWyw','build','coverage','.turbo','141593pZsEgN','.hg','2CXRSoI','.git'];a135_0x5827=function(){return _0x526b65;};return a135_0x5827();}export const IGNORED_DIR_NAMES=new Set([a135_0x5cfb97(0x1e5),a135_0x5cfb97(0x1e3),'.svn',a135_0x5cfb97(0x1d9),a135_0x5cfb97(0x1dc),a135_0x5cfb97(0x1d2),a135_0x5cfb97(0x1df),a135_0x5cfb97(0x1e0),a135_0x5cfb97(0x1e1),'.cache']);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4d495f,_0x30b3b6){const _0x3b8df9=a136_0x275f,_0x38b503=_0x4d495f();while(!![]){try{const _0x1c6953=-parseInt(_0x3b8df9(0x136))/0x1*(-parseInt(_0x3b8df9(0x139))/0x2)+-parseInt(_0x3b8df9(0x12d))/0x3+parseInt(_0x3b8df9(0x13f))/0x4*(parseInt(_0x3b8df9(0x138))/0x5)+-parseInt(_0x3b8df9(0x137))/0x6*(-parseInt(_0x3b8df9(0x132))/0x7)+parseInt(_0x3b8df9(0x13b))/0x8*(-parseInt(_0x3b8df9(0x135))/0x9)+parseInt(_0x3b8df9(0x133))/0xa+-parseInt(_0x3b8df9(0x13d))/0xb;if(_0x1c6953===_0x30b3b6)break;else _0x38b503['push'](_0x38b503['shift']());}catch(_0x31de4c){_0x38b503['push'](_0x38b503['shift']());}}}(a136_0x5d50,0xe99fa));import{lstatSync,readlinkSync,realpathSync,renameSync,rmSync,writeFileSync}from'node:fs';import{dirname,isAbsolute,resolve,sep}from'node:path';import{CliErrors}from'../../errors.js';import{normalizeSkillRelativePath}from'./local-files.js';export function resolveManagedFilePath(_0x48fdd7,_0x2f68eb){const _0x47893c=a136_0x275f,_0x419cb3=normalizeSkillRelativePath(_0x2f68eb),_0x5b9c41=realOrResolved(_0x48fdd7),_0x2c5a01=resolve(_0x5b9c41,..._0x419cb3[_0x47893c(0x12c)]('/'));if(!isPathInside(_0x2c5a01,_0x5b9c41))throw CliErrors['validation'](_0x47893c(0x13c)+_0x2f68eb);return ensureNoSymlinkInManagedPath(_0x5b9c41,_0x419cb3),_0x2c5a01;}function a136_0x275f(_0x48961f,_0x169c82){_0x48961f=_0x48961f-0x12c;const _0x5d50ab=a136_0x5d50();let _0x275f15=_0x5d50ab[_0x48961f];return _0x275f15;}export function ensureNoSymlinkInManagedPath(_0x20b2cb,_0x3a6ab8){const _0x39a565=a136_0x275f;let _0x39d87e=_0x20b2cb;for(const _0x37d0eb of _0x3a6ab8[_0x39a565(0x12c)]('/')){_0x39d87e=resolve(_0x39d87e,_0x37d0eb);const _0x438ea5=lstatIfPresent(_0x39d87e);if(_0x438ea5?.[_0x39a565(0x12f)]())throw CliErrors[_0x39a565(0x130)](_0x39a565(0x131)+_0x3a6ab8);}}export function isDanglingSymlink(_0x556f66){const _0x491bef=a136_0x275f;try{return lstatSync(_0x556f66)[_0x491bef(0x12f)]();}catch{return![];}}export function resolveSymlinkTarget(_0x2389fb){const _0x374190=readlinkSync(_0x2389fb);return isAbsolute(_0x374190)?_0x374190:resolve(dirname(_0x2389fb),_0x374190);}export function isPathInside(_0x529295,_0x48e8bb){const _0x12143f=a136_0x275f,_0x406b83=_0x529295['endsWith'](sep)?_0x529295:''+_0x529295+sep,_0x18b30d=_0x48e8bb[_0x12143f(0x13e)](sep)?_0x48e8bb:''+_0x48e8bb+sep;return _0x529295===_0x48e8bb||_0x406b83[_0x12143f(0x140)](_0x18b30d);}export function realOrResolved(_0x36c91e){try{return realpathSync(_0x36c91e);}catch{return resolve(_0x36c91e);}}function a136_0x5d50(){const _0x142637=['983682cdaZeJ','stringify','isSymbolicLink','validation','Refusing\x20to\x20write\x20through\x20Skill\x20symlink\x20path:\x20','98BATxgE','5290930IGnuNd','from','9QvuHGN','503YvSFIM','586230zgJNRm','2177885ZRBTcJ','6446oWTuMj','.tmp','652984OqMXXh','Unsafe\x20Skill\x20file\x20path:\x20','28459970smpMIU','endsWith','4iblWan','startsWith','split'];a136_0x5d50=function(){return _0x142637;};return a136_0x5d50();}export function lstatIfPresent(_0x200135){try{return lstatSync(_0x200135);}catch{return undefined;}}export function writeTextAtomic(_0x5088b7,_0x110941,_0x6ffd16){const _0x4a528f=a136_0x275f;writeBytesAtomic(_0x5088b7,Buffer[_0x4a528f(0x134)](_0x110941,'utf8'),_0x6ffd16);}export function writeBytesAtomic(_0x7bd665,_0x2bb008,_0xd1b29b){const _0x2760f2=a136_0x275f,_0x44d402=_0x7bd665+_0x2760f2(0x13a);try{writeFileSync(_0x44d402,_0x2bb008,{'mode':_0xd1b29b}),renameSync(_0x44d402,_0x7bd665);}catch(_0x362072){try{rmSync(_0x44d402,{'force':!![]});}catch{}throw _0x362072;}}export function writeJsonAtomic(_0x1e9aa4,_0x303833){const _0x136c69=a136_0x275f;writeTextAtomic(_0x1e9aa4,JSON[_0x136c69(0x12e)](_0x303833,null,0x2)+'\x0a',0x180);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x34a3ec,_0x2d56cc){const _0x5cc57b=a137_0x590e,_0x512594=_0x34a3ec();while(!![]){try{const _0x1405d0=parseInt(_0x5cc57b(0x15e))/0x1+-parseInt(_0x5cc57b(0x15b))/0x2+-parseInt(_0x5cc57b(0x168))/0x3+parseInt(_0x5cc57b(0x162))/0x4*(-parseInt(_0x5cc57b(0x169))/0x5)+-parseInt(_0x5cc57b(0x15c))/0x6+-parseInt(_0x5cc57b(0x161))/0x7*(-parseInt(_0x5cc57b(0x160))/0x8)+parseInt(_0x5cc57b(0x167))/0x9*(parseInt(_0x5cc57b(0x164))/0xa);if(_0x1405d0===_0x2d56cc)break;else _0x512594['push'](_0x512594['shift']());}catch(_0x5d900a){_0x512594['push'](_0x512594['shift']());}}}(a137_0x2151,0x85437));import{createHash}from'node:crypto';import{fileContent,normalizeManifestFiles}from'./local-files.js';function a137_0x590e(_0x1d64d2,_0x23687b){_0x1d64d2=_0x1d64d2-0x15b;const _0x2151c4=a137_0x2151();let _0x590e76=_0x2151c4[_0x1d64d2];return _0x590e76;}function a137_0x2151(){const _0x5c922e=['sha256','10KuMlCL','hex','digest','18079002zccrGe','37545xLMfCb','241475fgfpdr','2030480fIqxiw','1159134HoqyKW','path','540263ezJmMi','update','8SqDEsB','271355NyECyi','68UUiGtq'];a137_0x2151=function(){return _0x5c922e;};return a137_0x2151();}export function contentHash(_0x1b0865){const _0x209428=a137_0x590e;return createHash(_0x209428(0x163))[_0x209428(0x15f)](_0x1b0865)[_0x209428(0x166)](_0x209428(0x165));}export function fileHash(_0x2c7f5d){return bufferSha256(fileContent(_0x2c7f5d));}export function bufferSha256(_0x4e505e){const _0x47555b=a137_0x590e;return createHash(_0x47555b(0x163))[_0x47555b(0x15f)](_0x4e505e)['digest'](_0x47555b(0x165));}export function fileTreeHash(_0x2733fa){const _0x411a3e=a137_0x590e,_0x13ce51=createHash('sha256');for(const _0x4ea380 of normalizeManifestFiles(_0x2733fa)){_0x13ce51['update'](_0x4ea380[_0x411a3e(0x15d)]),_0x13ce51[_0x411a3e(0x15f)]('\x00'),_0x13ce51[_0x411a3e(0x15f)](_0x4ea380[_0x411a3e(0x163)]),_0x13ce51[_0x411a3e(0x15f)]('\x00'),_0x13ce51[_0x411a3e(0x15f)](String(_0x4ea380['size'])),_0x13ce51[_0x411a3e(0x15f)]('\x00');}return _0x13ce51[_0x411a3e(0x166)](_0x411a3e(0x165));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a138_0x4cb224=a138_0x5cac;function a138_0x2f92(){const _0x56a80f=['freeze','10616535lwZRvh','.agents','2GWgMEe','941051KGHtBX','11kJaPHT','cwd','project','1419448OKbXAR','global','3223665BDZZjR','skills','6ikvmHJ','12vTXMnF','38169468sOwKHP','8PyZikT','8574590bALuBe','appCode','3076339efynnp'];a138_0x2f92=function(){return _0x56a80f;};return a138_0x2f92();}(function(_0x2a026a,_0x530ca5){const _0x37e328=a138_0x5cac,_0x44c65f=_0x2a026a();while(!![]){try{const _0x4488d7=-parseInt(_0x37e328(0xd1))/0x1*(-parseInt(_0x37e328(0xd0))/0x2)+parseInt(_0x37e328(0xd9))/0x3*(-parseInt(_0x37e328(0xd5))/0x4)+parseInt(_0x37e328(0xd7))/0x5+parseInt(_0x37e328(0xda))/0x6*(parseInt(_0x37e328(0xdf))/0x7)+parseInt(_0x37e328(0xdc))/0x8*(parseInt(_0x37e328(0xe1))/0x9)+-parseInt(_0x37e328(0xdd))/0xa*(-parseInt(_0x37e328(0xd2))/0xb)+-parseInt(_0x37e328(0xdb))/0xc;if(_0x4488d7===_0x530ca5)break;else _0x44c65f['push'](_0x44c65f['shift']());}catch(_0x7b83dc){_0x44c65f['push'](_0x44c65f['shift']());}}}(a138_0x2f92,0x953e3));import{resolve}from'node:path';function a138_0x5cac(_0x298cf9,_0x40c14e){_0x298cf9=_0x298cf9-0xd0;const _0x2f9235=a138_0x2f92();let _0x5cac2e=_0x2f9235[_0x298cf9];return _0x5cac2e;}import{resolveSkillSyncPaths,runtimeAgentSkillRoots,safePathSegment}from'./paths.js';export function resolveRuntimeSkillInstallTarget(_0x2ff9e1,_0x342b12=a138_0x4cb224(0xd6),_0x398d73={}){const _0x318d58=a138_0x4cb224,_0x37d260=resolveSkillSyncPaths(_0x398d73),_0x20e67d=safePathSegment(_0x2ff9e1,_0x318d58(0xde)),_0x405d7e=_0x342b12===_0x318d58(0xd4)?[resolve(_0x398d73[_0x318d58(0xd3)]??process[_0x318d58(0xd3)](),_0x318d58(0xe2),_0x318d58(0xd8))]:runtimeAgentSkillRoots(_0x37d260);return Object[_0x318d58(0xe0)]({'scope':_0x342b12,'appCode':_0x20e67d,'skillRoots':Object[_0x318d58(0xe0)](_0x405d7e),'managedRoot':_0x37d260['managedRoot']});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a138_0xf7154f=a138_0x22fc;function a138_0x2ed3(){const _0x23d56a=['Refusing\x20to\x20copy\x20Skill\x20symlink:\x20','lovrabet','secret-retriever','5jqbSGG','updated','Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20','agentsSkillsDir','has','linked-from-protected-root','3397112hZnwMh','appCode','skillCode','metadata-mismatch','created','8676441CPVBFZ','258234yZIggf','external-symlink','builtin','Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20','skill','name','70FYlrpd','skipped','dir','Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20','managedRoot','removed','project','validation','unchanged','scopes','get','contentHash','slice','Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20','company','map','startsWith','1946172DyRmJL','accessKey','personal','skillRoots','Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20','isSymbolicLink','Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20','pruneSkillCodes','push','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','isDirectory','protectedLinkRoots','values','307196GcUeLf','filter','Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20','scope','30893mnAKpO','trim','402908MHAYEe'];a138_0x2ed3=function(){return _0x23d56a;};return a138_0x2ed3();}(function(_0x4c993a,_0x58ded3){const _0xf98441=a138_0x22fc,_0x350bae=_0x4c993a();while(!![]){try{const _0xd9ec80=-parseInt(_0xf98441(0x15c))/0x1+parseInt(_0xf98441(0x158))/0x2+-parseInt(_0xf98441(0x185))/0x3+-parseInt(_0xf98441(0x15e))/0x4*(parseInt(_0xf98441(0x162))/0x5)+-parseInt(_0xf98441(0x16e))/0x6*(parseInt(_0xf98441(0x174))/0x7)+parseInt(_0xf98441(0x168))/0x8+parseInt(_0xf98441(0x16d))/0x9;if(_0xd9ec80===_0x58ded3)break;else _0x350bae['push'](_0x350bae['shift']());}catch(_0x43ec7a){_0x350bae['push'](_0x350bae['shift']());}}}(a138_0x2ed3,0x50f20));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import a138_0x44cb17 from'fs-extra';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';function a138_0x22fc(_0x2b8df6,_0x2c5edd){_0x2b8df6=_0x2b8df6-0x152;const _0x2ed31b=a138_0x2ed3();let _0x22fc5c=_0x2ed31b[_0x2b8df6];return _0x22fc5c;}import{isDanglingSymlink,isPathInside,lstatIfPresent,realOrResolved,resolveSymlinkTarget}from'./fs-utils.js';import{readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillCacheRoot,resolveSkillSyncPaths,safePathSegment}from'./paths.js';const {copySync,ensureDirSync,removeSync}=a138_0x44cb17,RESERVED_PROJECT_SKILL_CODES=new Set([a138_0xf7154f(0x160),'runtime-observe',a138_0xf7154f(0x161)]);export function linkEffectiveRuntimeSkills(_0x27212f,_0x11a8b9){const _0x30708e=a138_0xf7154f,_0x11c90b=new Map();for(const _0x30f303 of _0x27212f){const _0x47a202=_0x30f303[_0x30708e(0x172)][_0x30708e(0x16a)];if(!_0x47a202)continue;const _0x4604ff=_0x11c90b[_0x30708e(0x17e)](_0x47a202);(!_0x4604ff||_0x30f303[_0x30708e(0x15b)]===_0x30708e(0x187))&&_0x11c90b['set'](_0x47a202,_0x30f303);}const _0x37cdfe=[];for(const _0x158b65 of _0x11c90b[_0x30708e(0x157)]()){const _0x3017b3=requireSkillCode(_0x158b65[_0x30708e(0x172)]),_0x3e3051=readMetadataIfPresent(_0x158b65['metadataPath']);if(_0x3e3051?.[_0x30708e(0x169)]!==_0x11a8b9[_0x30708e(0x169)]||_0x3e3051[_0x30708e(0x16a)]!==_0x3017b3)throw CliErrors[_0x30708e(0x17b)](_0x30708e(0x18c)+_0x11a8b9[_0x30708e(0x169)]+':\x20'+_0x158b65['metadataPath']);const _0xd47aae=runtimeSkillLinkName(_0x11a8b9,_0x3017b3);for(const _0x3cdd4b of _0x11a8b9['skillRoots']){_0x37cdfe[_0x30708e(0x153)](ensureManagedSymlink(resolve(_0x3cdd4b,_0xd47aae),_0x158b65['dir'],_0x11a8b9,_0x3017b3));}}return _0x37cdfe;}export function pruneStaleRuntimeSkillLinks(_0x373a00,_0x3ada53,_0x361645){const _0x5bda61=a138_0xf7154f,_0x1c245f=new Set([..._0x3ada53][_0x5bda61(0x183)](_0x9c529a=>_0x9c529a[_0x5bda61(0x15d)]())[_0x5bda61(0x159)](Boolean)),_0x263048=_0x361645?new Set([..._0x361645][_0x5bda61(0x183)](_0x15c0c5=>_0x15c0c5[_0x5bda61(0x15d)]())[_0x5bda61(0x159)](Boolean)):undefined,_0x4ea09a=[];for(const _0xcc0f1b of _0x373a00[_0x5bda61(0x188)]){for(const _0x515707 of managedTargetSkillLinkPaths(_0xcc0f1b,_0x373a00)){const _0x486ec4=runtimeSkillCodeFromLink(_0x373a00,_0x515707);if(_0x263048&&!_0x263048[_0x5bda61(0x166)](_0x486ec4))continue;if(_0x1c245f[_0x5bda61(0x166)](_0x486ec4))continue;_0x4ea09a[_0x5bda61(0x153)](removeManagedSkillLink(_0x515707,_0x373a00,_0x486ec4));}}return _0x4ea09a;}export function pruneStaleRuntimeSkillCache(_0x177c82,_0x115595={}){const _0x2d1c59=a138_0xf7154f,_0x21c1e6=new Set([..._0x177c82['activeSkillCodes']][_0x2d1c59(0x183)](_0x4fa7b0=>_0x4fa7b0[_0x2d1c59(0x15d)]())[_0x2d1c59(0x159)](Boolean)),_0x32e011=_0x177c82[_0x2d1c59(0x152)]?new Set([..._0x177c82['pruneSkillCodes']][_0x2d1c59(0x183)](_0x4b0343=>_0x4b0343['trim']())['filter'](Boolean)):undefined,_0x3e54c6=_0x177c82[_0x2d1c59(0x17d)]??[_0x2d1c59(0x187),_0x2d1c59(0x182)],_0x814dfe=resolve(getRuntimeSkillCacheRoot(_0x177c82['env'],_0x177c82[_0x2d1c59(0x186)],_0x115595),safePathSegment(_0x177c82['appCode'],_0x2d1c59(0x169))),_0x59cbb2=[];for(const _0x36a1ea of _0x3e54c6){const _0x4cc75=resolve(_0x814dfe,_0x36a1ea);if(!existsSync(_0x4cc75))continue;for(const _0x19763e of readdirSync(_0x4cc75,{'withFileTypes':!![]})){if(!_0x19763e['isDirectory']())continue;const _0x483a66=_0x19763e[_0x2d1c59(0x173)];if(_0x32e011&&!_0x32e011[_0x2d1c59(0x166)](_0x483a66))continue;if(_0x21c1e6[_0x2d1c59(0x166)](_0x483a66))continue;const _0x45da53=resolve(_0x4cc75,_0x483a66),_0x36ce62=readMetadataIfPresent(resolve(_0x45da53,METADATA_FILE));if(_0x36ce62?.[_0x2d1c59(0x169)]!==_0x177c82[_0x2d1c59(0x169)]||_0x36ce62[_0x2d1c59(0x15b)]!==_0x36a1ea||_0x36ce62[_0x2d1c59(0x16a)]!==_0x483a66){_0x59cbb2[_0x2d1c59(0x153)]({'path':_0x45da53,'action':'skipped','reason':_0x2d1c59(0x16b)});continue;}if(isLinkedFromAnyRoot(_0x45da53,_0x177c82[_0x2d1c59(0x156)]??[])){_0x59cbb2['push']({'path':_0x45da53,'action':_0x2d1c59(0x175),'reason':_0x2d1c59(0x167)});continue;}removeSync(_0x45da53),_0x59cbb2['push']({'path':_0x45da53,'action':_0x2d1c59(0x179)});}}return _0x59cbb2;}export function linkGlobalRuntimeSkills(_0xf04d7d,_0x2e308f={}){const _0x4c559=a138_0xf7154f,_0x3b5972=resolveSkillSyncPaths(_0x2e308f),_0x2b1a3c=[];for(const _0x1d06f8 of _0xf04d7d){if(_0x1d06f8['scope']!==_0x4c559(0x170))throw CliErrors['validation'](_0x4c559(0x154)+_0x1d06f8[_0x4c559(0x15b)]);const _0x361429=requireSkillCode(_0x1d06f8[_0x4c559(0x172)]),_0x332852=copyManagedSkillDirectory(_0x1d06f8['dir'],resolve(_0x3b5972[_0x4c559(0x165)],_0x361429));_0x2b1a3c['push']({..._0x332852,'contentHash':_0x1d06f8[_0x4c559(0x17f)]});}return _0x2b1a3c;}function ensureManagedSymlink(_0x3ce80a,_0x2af573,_0x1727dd,_0x2d73f4){const _0x29bc57=a138_0xf7154f;mkdirSync(dirname(_0x3ce80a),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x3ce80a)||isDanglingSymlink(_0x3ce80a)){const _0x4edebc=lstatSync(_0x3ce80a);if(!_0x4edebc[_0x29bc57(0x18b)]())throw CliErrors['validation'](_0x29bc57(0x177)+_0x3ce80a);const _0x54296b=resolveSymlinkTarget(_0x3ce80a);if(!isPathInside(realOrResolved(_0x54296b),realOrResolved(_0x1727dd[_0x29bc57(0x178)])))throw CliErrors['validation'](_0x29bc57(0x171)+_0x3ce80a);if(realOrResolved(_0x54296b)===realOrResolved(_0x2af573))return{'path':_0x3ce80a,'target':_0x2af573,'action':_0x29bc57(0x17c)};const _0x1038b8=readMetadataIfPresent(resolve(_0x54296b,METADATA_FILE));if(_0x1727dd[_0x29bc57(0x15b)]==='project'&&(_0x1038b8?.[_0x29bc57(0x169)]!==_0x1727dd[_0x29bc57(0x169)]||_0x1038b8[_0x29bc57(0x16a)]!==_0x2d73f4))throw CliErrors['validation'](_0x29bc57(0x181)+_0x3ce80a);return unlinkSync(_0x3ce80a),symlinkSync(_0x2af573,_0x3ce80a,_0x29bc57(0x176)),{'path':_0x3ce80a,'target':_0x2af573,'action':_0x29bc57(0x163)};}return symlinkSync(_0x2af573,_0x3ce80a,_0x29bc57(0x176)),{'path':_0x3ce80a,'target':_0x2af573,'action':'created'};}function managedTargetSkillLinkPaths(_0x31c3da,_0x357ddf){const _0x2815a1=a138_0xf7154f;if(!existsSync(_0x31c3da))return[];const _0x51e0f0=_0x357ddf[_0x2815a1(0x169)]+'--';return readdirSync(_0x31c3da,{'withFileTypes':!![]})[_0x2815a1(0x159)](_0x41e4c1=>_0x357ddf[_0x2815a1(0x15b)]===_0x2815a1(0x17a)||_0x41e4c1[_0x2815a1(0x173)][_0x2815a1(0x184)](_0x51e0f0))[_0x2815a1(0x183)](_0xf35a70=>resolve(_0x31c3da,_0xf35a70[_0x2815a1(0x173)]));}function removeManagedSkillLink(_0x5b581e,_0x2e8457,_0x12e99a){const _0x553db2=a138_0xf7154f,_0x50dad8=lstatIfPresent(_0x5b581e);if(!_0x50dad8?.[_0x553db2(0x18b)]())return{'path':_0x5b581e,'action':'skipped','reason':'not-managed-symlink'};const _0x38cd96=resolveSymlinkTarget(_0x5b581e);if(!isPathInside(realOrResolved(_0x38cd96),realOrResolved(_0x2e8457[_0x553db2(0x178)])))return{'path':_0x5b581e,'action':_0x553db2(0x175),'reason':_0x553db2(0x16f)};const _0x50ab07=readMetadataIfPresent(resolve(_0x38cd96,METADATA_FILE));if(_0x2e8457[_0x553db2(0x15b)]===_0x553db2(0x17a)&&(_0x50ab07?.[_0x553db2(0x169)]!==_0x2e8457['appCode']||_0x50ab07[_0x553db2(0x16a)]!==_0x12e99a))return{'path':_0x5b581e,'action':'skipped','reason':_0x553db2(0x16b)};return unlinkSync(_0x5b581e),{'path':_0x5b581e,'action':_0x553db2(0x179)};}function isLinkedFromAnyRoot(_0x13e37c,_0x24aff6){const _0x1d1c7f=a138_0xf7154f,_0x43b6ff=realOrResolved(_0x13e37c);for(const _0x103924 of _0x24aff6){if(!existsSync(_0x103924))continue;for(const _0x1fcf18 of readdirSync(_0x103924,{'withFileTypes':!![]})){if(!_0x1fcf18[_0x1d1c7f(0x18b)]())continue;const _0x103398=resolve(_0x103924,_0x1fcf18[_0x1d1c7f(0x173)]);if(realOrResolved(resolveSymlinkTarget(_0x103398))===_0x43b6ff)return!![];}}return![];}function runtimeSkillLinkName(_0x517ce3,_0x354c5f){const _0x13d5eb=a138_0xf7154f,_0x171868=safePathSegment(_0x354c5f,_0x13d5eb(0x16a));if(_0x517ce3[_0x13d5eb(0x15b)]==='project'&&RESERVED_PROJECT_SKILL_CODES[_0x13d5eb(0x166)](_0x171868))throw CliErrors[_0x13d5eb(0x17b)](_0x13d5eb(0x15a)+_0x171868);return _0x517ce3[_0x13d5eb(0x15b)]===_0x13d5eb(0x17a)?_0x171868:_0x517ce3[_0x13d5eb(0x169)]+'--'+_0x171868;}function runtimeSkillCodeFromLink(_0x3ceaf1,_0x388311){const _0x5521ee=a138_0xf7154f,_0x4f1a12=basename(_0x388311);return _0x3ceaf1['scope']===_0x5521ee(0x17a)?_0x4f1a12:_0x4f1a12[_0x5521ee(0x180)]((_0x3ceaf1['appCode']+'--')['length']);}export function copyManagedSkillDirectory(_0x54820d,_0x23f062){const _0x253add=a138_0xf7154f,_0x246c9f=resolve(_0x23f062,METADATA_FILE),_0x4383a1=existsSync(_0x23f062);if(_0x4383a1){const _0x1c8a95=lstatSync(_0x23f062);if(_0x1c8a95['isSymbolicLink']())throw CliErrors[_0x253add(0x17b)](_0x253add(0x189)+_0x23f062);if(!_0x1c8a95[_0x253add(0x155)]())throw CliErrors['validation'](_0x253add(0x164)+_0x23f062);const _0x217b45=readMetadataIfPresent(_0x246c9f);if(_0x217b45?.[_0x253add(0x15b)]!==_0x253add(0x170))throw CliErrors[_0x253add(0x17b)](_0x253add(0x18a)+_0x23f062);}ensureDirSync(dirname(_0x23f062));const _0x31d1a5=_0x4383a1?readMetadataIfPresent(_0x246c9f)?.[_0x253add(0x17f)]:undefined,_0x718006=readMetadataIfPresent(resolve(_0x54820d,METADATA_FILE))?.[_0x253add(0x17f)];return _0x4383a1&&removeSync(_0x23f062),copySkillDirectory(_0x54820d,_0x23f062),{'path':_0x23f062,'target':_0x54820d,'action':!_0x4383a1?_0x253add(0x16c):_0x31d1a5===_0x718006?'unchanged':_0x253add(0x163)};}function copySkillDirectory(_0x6b2f78,_0x1b09a5){copySync(_0x6b2f78,_0x1b09a5,{'dereference':![],'overwrite':!![],'filter'(_0x22000c){const _0x7999ef=a138_0x22fc;if(lstatSync(_0x22000c)[_0x7999ef(0x18b)]())throw CliErrors[_0x7999ef(0x17b)](_0x7999ef(0x15f)+_0x22000c);return!![];}});}
|
|
1
|
+
function a139_0x1a26(_0x4654c5,_0x374f6c){_0x4654c5=_0x4654c5-0x1ab;const _0x4c18b8=a139_0x4c18();let _0x1a261e=_0x4c18b8[_0x4654c5];return _0x1a261e;}const a139_0x4ef4ee=a139_0x1a26;(function(_0x4bef12,_0x5da48d){const _0x431d5c=a139_0x1a26,_0x3152be=_0x4bef12();while(!![]){try{const _0x4c2c65=-parseInt(_0x431d5c(0x1dc))/0x1+-parseInt(_0x431d5c(0x1c0))/0x2+parseInt(_0x431d5c(0x1d2))/0x3*(-parseInt(_0x431d5c(0x1b1))/0x4)+parseInt(_0x431d5c(0x1c5))/0x5*(-parseInt(_0x431d5c(0x1df))/0x6)+-parseInt(_0x431d5c(0x1d8))/0x7+-parseInt(_0x431d5c(0x1e3))/0x8+parseInt(_0x431d5c(0x1b5))/0x9*(parseInt(_0x431d5c(0x1d7))/0xa);if(_0x4c2c65===_0x5da48d)break;else _0x3152be['push'](_0x3152be['shift']());}catch(_0x871580){_0x3152be['push'](_0x3152be['shift']());}}}(a139_0x4c18,0x3bed1));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import a139_0x78174f 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';function a139_0x4c18(){const _0xd176fd=['126VhmNuG','appCode','Refusing\x20to\x20copy\x20Skill\x20symlink:\x20','updated','name','scopes','length','runtime-observe','removed','isSymbolicLink','filter','146236FdnWmj','external-symlink','linked-from-protected-root','contentHash','Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20','2288345SBpiKv','startsWith','skill','Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20','slice','project','skillRoots','map','has','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','created','get','pruneSkillCodes','5259aCwLMT','lovrabet','managedRoot','skillCode','values','1282390bujJAj','2207926IOEXzB','metadata-mismatch','builtin','dir','194525gECAUr','set','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20','6hZRhDw','personal','Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20','isDirectory','1254448vmjEgq','scope','secret-retriever','skipped','validation','agentsSkillsDir','env','metadataPath','804LYMCZQ','activeSkillCodes','push','trim'];a139_0x4c18=function(){return _0xd176fd;};return a139_0x4c18();}import{getRuntimeSkillCacheRoot,resolveSkillSyncPaths,safePathSegment}from'./paths.js';const {copySync,ensureDirSync,removeSync}=a139_0x78174f,RESERVED_PROJECT_SKILL_CODES=new Set([a139_0x4ef4ee(0x1d3),a139_0x4ef4ee(0x1bc),a139_0x4ef4ee(0x1ab)]);export function linkEffectiveRuntimeSkills(_0x274eff,_0x7eec09){const _0x1a4333=a139_0x4ef4ee,_0x12f1f3=new Map();for(const _0xc37a8b of _0x274eff){const _0x1ed883=_0xc37a8b[_0x1a4333(0x1c7)]['skillCode'];if(!_0x1ed883)continue;const _0x24906a=_0x12f1f3[_0x1a4333(0x1d0)](_0x1ed883);(!_0x24906a||_0xc37a8b[_0x1a4333(0x1e4)]===_0x1a4333(0x1e0))&&_0x12f1f3[_0x1a4333(0x1dd)](_0x1ed883,_0xc37a8b);}const _0x3534a2=[];for(const _0x2d10d7 of _0x12f1f3[_0x1a4333(0x1d6)]()){const _0x10f23a=requireSkillCode(_0x2d10d7[_0x1a4333(0x1c7)]),_0x2ebf24=readMetadataIfPresent(_0x2d10d7[_0x1a4333(0x1b0)]);if(_0x2ebf24?.[_0x1a4333(0x1b6)]!==_0x7eec09[_0x1a4333(0x1b6)]||_0x2ebf24[_0x1a4333(0x1d5)]!==_0x10f23a)throw CliErrors['validation']('Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20'+_0x7eec09['appCode']+':\x20'+_0x2d10d7[_0x1a4333(0x1b0)]);const _0x4e2e56=runtimeSkillLinkName(_0x7eec09,_0x10f23a);for(const _0x3a6567 of _0x7eec09[_0x1a4333(0x1cb)]){_0x3534a2['push'](ensureManagedSymlink(resolve(_0x3a6567,_0x4e2e56),_0x2d10d7['dir'],_0x7eec09,_0x10f23a));}}return _0x3534a2;}export function pruneStaleRuntimeSkillLinks(_0x402787,_0x45e6d2,_0x3b2fcf){const _0x19ead2=a139_0x4ef4ee,_0x5c7c97=new Set([..._0x45e6d2][_0x19ead2(0x1cc)](_0x29814c=>_0x29814c[_0x19ead2(0x1b4)]())['filter'](Boolean)),_0x534696=_0x3b2fcf?new Set([..._0x3b2fcf][_0x19ead2(0x1cc)](_0xf44d49=>_0xf44d49[_0x19ead2(0x1b4)]())[_0x19ead2(0x1bf)](Boolean)):undefined,_0x22a7ce=[];for(const _0x49eb0d of _0x402787[_0x19ead2(0x1cb)]){for(const _0x31d993 of managedTargetSkillLinkPaths(_0x49eb0d,_0x402787)){const _0x39689d=runtimeSkillCodeFromLink(_0x402787,_0x31d993);if(_0x534696&&!_0x534696[_0x19ead2(0x1cd)](_0x39689d))continue;if(_0x5c7c97[_0x19ead2(0x1cd)](_0x39689d))continue;_0x22a7ce[_0x19ead2(0x1b3)](removeManagedSkillLink(_0x31d993,_0x402787,_0x39689d));}}return _0x22a7ce;}export function pruneStaleRuntimeSkillCache(_0x3048f6,_0x324877={}){const _0x18f2e9=a139_0x4ef4ee,_0x58315e=new Set([..._0x3048f6[_0x18f2e9(0x1b2)]]['map'](_0x2a341f=>_0x2a341f['trim']())[_0x18f2e9(0x1bf)](Boolean)),_0x1ae0e4=_0x3048f6[_0x18f2e9(0x1d1)]?new Set([..._0x3048f6[_0x18f2e9(0x1d1)]]['map'](_0x25771d=>_0x25771d['trim']())[_0x18f2e9(0x1bf)](Boolean)):undefined,_0xf543cc=_0x3048f6[_0x18f2e9(0x1ba)]??['personal','company'],_0x29039a=resolve(getRuntimeSkillCacheRoot(_0x3048f6[_0x18f2e9(0x1af)],_0x3048f6['accessKey'],_0x324877),safePathSegment(_0x3048f6[_0x18f2e9(0x1b6)],'appCode')),_0x385222=[];for(const _0x2ec034 of _0xf543cc){const _0x1444ee=resolve(_0x29039a,_0x2ec034);if(!existsSync(_0x1444ee))continue;for(const _0x486915 of readdirSync(_0x1444ee,{'withFileTypes':!![]})){if(!_0x486915[_0x18f2e9(0x1e2)]())continue;const _0x3c9687=_0x486915['name'];if(_0x1ae0e4&&!_0x1ae0e4['has'](_0x3c9687))continue;if(_0x58315e[_0x18f2e9(0x1cd)](_0x3c9687))continue;const _0x4bec0a=resolve(_0x1444ee,_0x3c9687),_0x5d5315=readMetadataIfPresent(resolve(_0x4bec0a,METADATA_FILE));if(_0x5d5315?.[_0x18f2e9(0x1b6)]!==_0x3048f6[_0x18f2e9(0x1b6)]||_0x5d5315[_0x18f2e9(0x1e4)]!==_0x2ec034||_0x5d5315[_0x18f2e9(0x1d5)]!==_0x3c9687){_0x385222[_0x18f2e9(0x1b3)]({'path':_0x4bec0a,'action':_0x18f2e9(0x1ac),'reason':'metadata-mismatch'});continue;}if(isLinkedFromAnyRoot(_0x4bec0a,_0x3048f6['protectedLinkRoots']??[])){_0x385222[_0x18f2e9(0x1b3)]({'path':_0x4bec0a,'action':'skipped','reason':_0x18f2e9(0x1c2)});continue;}removeSync(_0x4bec0a),_0x385222[_0x18f2e9(0x1b3)]({'path':_0x4bec0a,'action':_0x18f2e9(0x1bd)});}}return _0x385222;}export function linkGlobalRuntimeSkills(_0x5df022,_0x2cbb9f={}){const _0x3f88c4=a139_0x4ef4ee,_0x26bdf5=resolveSkillSyncPaths(_0x2cbb9f),_0x1e1723=[];for(const _0x592721 of _0x5df022){if(_0x592721[_0x3f88c4(0x1e4)]!==_0x3f88c4(0x1da))throw CliErrors[_0x3f88c4(0x1ad)](_0x3f88c4(0x1ce)+_0x592721[_0x3f88c4(0x1e4)]);const _0x59e3e6=requireSkillCode(_0x592721['skill']),_0x2dc181=copyManagedSkillDirectory(_0x592721['dir'],resolve(_0x26bdf5[_0x3f88c4(0x1ae)],_0x59e3e6));_0x1e1723[_0x3f88c4(0x1b3)]({..._0x2dc181,'contentHash':_0x592721['contentHash']});}return _0x1e1723;}function ensureManagedSymlink(_0x25476e,_0x1f12ad,_0x4bc7da,_0x39eaf0){const _0x55098b=a139_0x4ef4ee;mkdirSync(dirname(_0x25476e),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x25476e)||isDanglingSymlink(_0x25476e)){const _0x3a021e=lstatSync(_0x25476e);if(!_0x3a021e['isSymbolicLink']())throw CliErrors[_0x55098b(0x1ad)]('Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20'+_0x25476e);const _0x15b907=resolveSymlinkTarget(_0x25476e);if(!isPathInside(realOrResolved(_0x15b907),realOrResolved(_0x4bc7da['managedRoot'])))throw CliErrors[_0x55098b(0x1ad)](_0x55098b(0x1c8)+_0x25476e);if(realOrResolved(_0x15b907)===realOrResolved(_0x1f12ad))return{'path':_0x25476e,'target':_0x1f12ad,'action':'unchanged'};const _0x29aea0=readMetadataIfPresent(resolve(_0x15b907,METADATA_FILE));if(_0x4bc7da[_0x55098b(0x1e4)]==='project'&&(_0x29aea0?.['appCode']!==_0x4bc7da[_0x55098b(0x1b6)]||_0x29aea0[_0x55098b(0x1d5)]!==_0x39eaf0))throw CliErrors[_0x55098b(0x1ad)](_0x55098b(0x1c4)+_0x25476e);return unlinkSync(_0x25476e),symlinkSync(_0x1f12ad,_0x25476e,_0x55098b(0x1db)),{'path':_0x25476e,'target':_0x1f12ad,'action':_0x55098b(0x1b8)};}return symlinkSync(_0x1f12ad,_0x25476e,'dir'),{'path':_0x25476e,'target':_0x1f12ad,'action':_0x55098b(0x1cf)};}function managedTargetSkillLinkPaths(_0x3b1fbe,_0x120d09){const _0x50e19c=a139_0x4ef4ee;if(!existsSync(_0x3b1fbe))return[];const _0x3be13a=_0x120d09[_0x50e19c(0x1b6)]+'--';return readdirSync(_0x3b1fbe,{'withFileTypes':!![]})[_0x50e19c(0x1bf)](_0xe379b8=>_0x120d09[_0x50e19c(0x1e4)]===_0x50e19c(0x1ca)||_0xe379b8[_0x50e19c(0x1b9)][_0x50e19c(0x1c6)](_0x3be13a))['map'](_0x4df9bd=>resolve(_0x3b1fbe,_0x4df9bd[_0x50e19c(0x1b9)]));}function removeManagedSkillLink(_0x1f3c2e,_0x263220,_0x4afbb9){const _0x1162b4=a139_0x4ef4ee,_0x22063a=lstatIfPresent(_0x1f3c2e);if(!_0x22063a?.[_0x1162b4(0x1be)]())return{'path':_0x1f3c2e,'action':_0x1162b4(0x1ac),'reason':'not-managed-symlink'};const _0x54f14e=resolveSymlinkTarget(_0x1f3c2e);if(!isPathInside(realOrResolved(_0x54f14e),realOrResolved(_0x263220[_0x1162b4(0x1d4)])))return{'path':_0x1f3c2e,'action':_0x1162b4(0x1ac),'reason':_0x1162b4(0x1c1)};const _0x34b608=readMetadataIfPresent(resolve(_0x54f14e,METADATA_FILE));if(_0x263220['scope']===_0x1162b4(0x1ca)&&(_0x34b608?.[_0x1162b4(0x1b6)]!==_0x263220[_0x1162b4(0x1b6)]||_0x34b608[_0x1162b4(0x1d5)]!==_0x4afbb9))return{'path':_0x1f3c2e,'action':_0x1162b4(0x1ac),'reason':_0x1162b4(0x1d9)};return unlinkSync(_0x1f3c2e),{'path':_0x1f3c2e,'action':'removed'};}function isLinkedFromAnyRoot(_0x4d124a,_0x3f65c9){const _0x29da5d=a139_0x4ef4ee,_0x59eebb=realOrResolved(_0x4d124a);for(const _0x2cd66b of _0x3f65c9){if(!existsSync(_0x2cd66b))continue;for(const _0x27f7a4 of readdirSync(_0x2cd66b,{'withFileTypes':!![]})){if(!_0x27f7a4['isSymbolicLink']())continue;const _0x330c11=resolve(_0x2cd66b,_0x27f7a4[_0x29da5d(0x1b9)]);if(realOrResolved(resolveSymlinkTarget(_0x330c11))===_0x59eebb)return!![];}}return![];}function runtimeSkillLinkName(_0x3d16dd,_0x5dbc7b){const _0xbd8a2=a139_0x4ef4ee,_0x3e31ea=safePathSegment(_0x5dbc7b,_0xbd8a2(0x1d5));if(_0x3d16dd[_0xbd8a2(0x1e4)]===_0xbd8a2(0x1ca)&&RESERVED_PROJECT_SKILL_CODES[_0xbd8a2(0x1cd)](_0x3e31ea))throw CliErrors[_0xbd8a2(0x1ad)](_0xbd8a2(0x1e1)+_0x3e31ea);return _0x3d16dd['scope']===_0xbd8a2(0x1ca)?_0x3e31ea:_0x3d16dd[_0xbd8a2(0x1b6)]+'--'+_0x3e31ea;}function runtimeSkillCodeFromLink(_0x507a4b,_0x3bc3a8){const _0xcdc251=a139_0x4ef4ee,_0x2bebda=basename(_0x3bc3a8);return _0x507a4b[_0xcdc251(0x1e4)]===_0xcdc251(0x1ca)?_0x2bebda:_0x2bebda[_0xcdc251(0x1c9)]((_0x507a4b['appCode']+'--')[_0xcdc251(0x1bb)]);}export function copyManagedSkillDirectory(_0x1012e4,_0x19e0eb){const _0x50da5e=a139_0x4ef4ee,_0x408c11=resolve(_0x19e0eb,METADATA_FILE),_0x4f836e=existsSync(_0x19e0eb);if(_0x4f836e){const _0x180a83=lstatSync(_0x19e0eb);if(_0x180a83[_0x50da5e(0x1be)]())throw CliErrors[_0x50da5e(0x1ad)]('Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20'+_0x19e0eb);if(!_0x180a83[_0x50da5e(0x1e2)]())throw CliErrors[_0x50da5e(0x1ad)]('Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20'+_0x19e0eb);const _0x1eb76c=readMetadataIfPresent(_0x408c11);if(_0x1eb76c?.[_0x50da5e(0x1e4)]!==_0x50da5e(0x1da))throw CliErrors[_0x50da5e(0x1ad)](_0x50da5e(0x1de)+_0x19e0eb);}ensureDirSync(dirname(_0x19e0eb));const _0x3ff873=_0x4f836e?readMetadataIfPresent(_0x408c11)?.[_0x50da5e(0x1c3)]:undefined,_0x45edee=readMetadataIfPresent(resolve(_0x1012e4,METADATA_FILE))?.['contentHash'];return _0x4f836e&&removeSync(_0x19e0eb),copySkillDirectory(_0x1012e4,_0x19e0eb),{'path':_0x19e0eb,'target':_0x1012e4,'action':!_0x4f836e?_0x50da5e(0x1cf):_0x3ff873===_0x45edee?'unchanged':_0x50da5e(0x1b8)};}function copySkillDirectory(_0x1f558f,_0x33767c){copySync(_0x1f558f,_0x33767c,{'dereference':![],'overwrite':!![],'filter'(_0x2094a6){const _0x3fcce7=a139_0x1a26;if(lstatSync(_0x2094a6)['isSymbolicLink']())throw CliErrors[_0x3fcce7(0x1ad)](_0x3fcce7(0x1b7)+_0x2094a6);return!![];}});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a140_0x1492(){const _0x5932b6=['skillCode','132074kUQrGx','linkedPath','name','7YlbiXP','skillMdPath','28RYZeNc','startsWith','isArray','18718272nPZZuQ','map','has','dir','1621408luclbB','appCode','628560YpXDxH','2631000RWEIQa','isSymbolicLink','link','tags','scopes','cacheDir','includes','push','builtin','code','localeCompare','local','630125nuRhez','isDirectory','get','\x20!=\x20','metadataPath','set','values','skillRoots','sort','project','Runtime\x20Skill\x20install\x20target\x20app\x20mismatch:\x20','filter','4519974LebJoV','trim','source','scope','linkedPaths','env'];a140_0x1492=function(){return _0x5932b6;};return a140_0x1492();}(function(_0x1dec7e,_0x2e003b){const _0x1bffaa=a140_0x5cf3,_0x44200f=_0x1dec7e();while(!![]){try{const _0x35d2f8=-parseInt(_0x1bffaa(0xc8))/0x1*(-parseInt(_0x1bffaa(0xc5))/0x2)+-parseInt(_0x1bffaa(0xbe))/0x3+parseInt(_0x1bffaa(0xd4))/0x4+-parseInt(_0x1bffaa(0xb2))/0x5+parseInt(_0x1bffaa(0xd3))/0x6*(-parseInt(_0x1bffaa(0xca))/0x7)+-parseInt(_0x1bffaa(0xd1))/0x8+parseInt(_0x1bffaa(0xcd))/0x9;if(_0x35d2f8===_0x2e003b)break;else _0x44200f['push'](_0x44200f['shift']());}catch(_0x221d9b){_0x44200f['push'](_0x44200f['shift']());}}}(a140_0x1492,0xe6d0a));import{existsSync,readdirSync}from'node:fs';function a140_0x5cf3(_0x3be3f7,_0x49fc82){_0x3be3f7=_0x3be3f7-0xac;const _0x1492ab=a140_0x1492();let _0x5cf316=_0x1492ab[_0x3be3f7];return _0x5cf316;}import{resolve}from'node:path';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{readMetadataIfPresent}from'./metadata.js';import{getRuntimeSkillCacheRoot,safePathSegment}from'./paths.js';import{isRuntimeSkillScope,normalizeRuntimeSkillScopes}from'./scopes.js';export function listLocalRuntimeSkills(_0x5617f9,_0x1bb9f4,_0x2ee003={}){const _0x56a87b=a140_0x5cf3,_0x7622ba=safePathSegment(_0x5617f9['appCode'],'appCode');if(_0x1bb9f4['appCode']!==_0x7622ba)throw CliErrors['validation'](_0x56a87b(0xbc)+_0x1bb9f4[_0x56a87b(0xd2)]+_0x56a87b(0xb5)+_0x7622ba);const _0x132709=normalizeRuntimeSkillScopes(_0x5617f9['scopes']),_0x950204=new Set(_0x132709),_0x5a790e=_0x5617f9[_0x56a87b(0xaf)]?.[_0x56a87b(0xbf)](),_0x48c6f6=new Map(),_0x2f22ad=resolve(getRuntimeSkillCacheRoot(_0x5617f9[_0x56a87b(0xc3)],_0x5617f9['accessKey'],_0x2ee003),_0x7622ba);for(const _0x681772 of _0x132709){for(const _0x111dfd of localSkillEntryDirs(resolve(_0x2f22ad,_0x681772))){collectLocalRuntimeSkill(_0x48c6f6,_0x111dfd,{'appCode':_0x7622ba,'scopes':_0x950204,'code':_0x5a790e,'source':'cache'});}}for(const _0x2be525 of _0x1bb9f4[_0x56a87b(0xb9)]){for(const _0x48a9ce of localSkillLinkCandidates(_0x2be525,_0x1bb9f4,_0x950204)){collectLocalRuntimeSkill(_0x48c6f6,_0x48a9ce,{'appCode':_0x7622ba,'scopes':_0x950204,'code':_0x5a790e,'source':_0x56a87b(0xd6),'linkedPath':_0x48a9ce});}}return Array['from'](_0x48c6f6[_0x56a87b(0xb8)]())[_0x56a87b(0xba)](compareLocalRuntimeSkills);}function localSkillEntryDirs(_0x24145c){const _0x476f31=a140_0x5cf3;if(!existsSync(_0x24145c))return[];return readdirSync(_0x24145c,{'withFileTypes':!![]})[_0x476f31(0xbd)](_0x4dd333=>_0x4dd333['isDirectory']()||_0x4dd333[_0x476f31(0xd5)]())['map'](_0x556f58=>resolve(_0x24145c,_0x556f58['name']));}function localSkillLinkCandidates(_0x15e101,_0x2b6ebf,_0x1aae17){const _0x34b332=a140_0x5cf3;if(!existsSync(_0x15e101))return[];const _0x2e4103=_0x2b6ebf[_0x34b332(0xd2)]+'--';return readdirSync(_0x15e101,{'withFileTypes':!![]})[_0x34b332(0xbd)](_0x4e9a93=>_0x4e9a93[_0x34b332(0xb3)]()||_0x4e9a93['isSymbolicLink']())[_0x34b332(0xbd)](_0x2a82f4=>_0x2b6ebf[_0x34b332(0xc1)]===_0x34b332(0xbb)||_0x2a82f4[_0x34b332(0xc7)][_0x34b332(0xcb)](_0x2e4103)||_0x1aae17['has'](_0x34b332(0xae)))[_0x34b332(0xce)](_0x3d1bcc=>resolve(_0x15e101,_0x3d1bcc[_0x34b332(0xc7)]));}function collectLocalRuntimeSkill(_0x1413ed,_0x4e1afd,_0x2f731c){const _0x410b5b=a140_0x5cf3,_0xdcd257=resolve(_0x4e1afd,METADATA_FILE),_0x408296=readMetadataIfPresent(_0xdcd257);if(!_0x408296)return;if(_0x408296[_0x410b5b(0xd2)]!==_0x2f731c[_0x410b5b(0xd2)])return;if(!isRuntimeSkillScope(_0x408296[_0x410b5b(0xc1)])||!_0x2f731c[_0x410b5b(0xd8)][_0x410b5b(0xcf)](_0x408296['scope']))return;const _0x4279a1=_0x408296[_0x410b5b(0xc4)]?.['trim']();if(!_0x4279a1)return;if(_0x2f731c[_0x410b5b(0xaf)]&&_0x4279a1!==_0x2f731c[_0x410b5b(0xaf)])return;const _0x51cec3=_0x408296[_0x410b5b(0xc1)]+':'+_0x4279a1,_0x3b7df8=_0x2f731c[_0x410b5b(0xc6)]?[_0x2f731c['linkedPath']]:[],_0x190e01=_0x1413ed[_0x410b5b(0xb4)](_0x51cec3);if(_0x190e01){_0x2f731c[_0x410b5b(0xc0)]==='cache'&&(_0x190e01[_0x410b5b(0xd0)]=_0x4e1afd,_0x190e01[_0x410b5b(0xd9)]=_0x4e1afd,_0x190e01[_0x410b5b(0xc9)]=resolve(_0x4e1afd,SKILL_FILE),_0x190e01[_0x410b5b(0xb6)]=_0xdcd257);for(const _0x3cfcea of _0x3b7df8){!_0x190e01[_0x410b5b(0xc2)][_0x410b5b(0xac)](_0x3cfcea)&&_0x190e01[_0x410b5b(0xc2)][_0x410b5b(0xad)](_0x3cfcea);}_0x190e01['linkedPaths'][_0x410b5b(0xba)]();return;}_0x1413ed[_0x410b5b(0xb7)](_0x51cec3,{..._0x408296,'tags':Array[_0x410b5b(0xcc)](_0x408296[_0x410b5b(0xd7)])?_0x408296[_0x410b5b(0xd7)]:[],'scope':_0x408296[_0x410b5b(0xc1)],'source':_0x410b5b(0xb1),'dir':_0x4e1afd,'cacheDir':_0x2f731c['source']==='cache'?_0x4e1afd:undefined,'skillMdPath':resolve(_0x4e1afd,SKILL_FILE),'metadataPath':_0xdcd257,'linkedPaths':_0x3b7df8});}function compareLocalRuntimeSkills(_0x38869e,_0x3f5038){const _0x34517a=a140_0x5cf3,_0x4ab83a={'personal':0x0,'company':0x1,'builtin':0x2};return _0x4ab83a[_0x38869e['scope']]-_0x4ab83a[_0x3f5038[_0x34517a(0xc1)]]||_0x38869e[_0x34517a(0xc4)][_0x34517a(0xb0)](_0x3f5038[_0x34517a(0xc4)])||_0x38869e[_0x34517a(0xd0)][_0x34517a(0xb0)](_0x3f5038[_0x34517a(0xd0)]);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1e3f4e,_0x2ca888){const _0x353c54=a141_0x71d5,_0x5a51d9=_0x1e3f4e();while(!![]){try{const _0x1d5b4e=parseInt(_0x353c54(0x178))/0x1*(parseInt(_0x353c54(0x189))/0x2)+-parseInt(_0x353c54(0x19f))/0x3*(parseInt(_0x353c54(0x185))/0x4)+-parseInt(_0x353c54(0x186))/0x5+parseInt(_0x353c54(0x18c))/0x6*(-parseInt(_0x353c54(0x183))/0x7)+parseInt(_0x353c54(0x18f))/0x8*(parseInt(_0x353c54(0x194))/0x9)+-parseInt(_0x353c54(0x17c))/0xa+parseInt(_0x353c54(0x181))/0xb*(parseInt(_0x353c54(0x177))/0xc);if(_0x1d5b4e===_0x2ca888)break;else _0x5a51d9['push'](_0x5a51d9['shift']());}catch(_0x18e09a){_0x5a51d9['push'](_0x5a51d9['shift']());}}}(a141_0x1a43,0x8d182));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(_0xed3aa5){const _0x43cb6b=a141_0x71d5;return _0xed3aa5[_0x43cb6b(0x16d)]??Buffer['from'](_0xed3aa5['content']??'',_0x43cb6b(0x180));}export function fileText(_0x11f878){const _0x2b7031=a141_0x71d5;return fileContent(_0x11f878)[_0x2b7031(0x193)](_0x2b7031(0x180));}export function normalizeLocalFiles(_0xba5461){const _0x2456ed=a141_0x71d5;if(!Array[_0x2456ed(0x17b)](_0xba5461)||_0xba5461[_0x2456ed(0x16f)]===0x0)return[];const _0x10dfce=new Map();for(const _0xb872a0 of _0xba5461){if(!_0xb872a0||typeof _0xb872a0!==_0x2456ed(0x17d)||typeof _0xb872a0['path']!==_0x2456ed(0x18d))throw CliErrors[_0x2456ed(0x196)](_0x2456ed(0x17e));const _0x215e0b=normalizeSkillRelativePath(_0xb872a0['path']);if(_0x10dfce[_0x2456ed(0x1a0)](_0x215e0b))throw CliErrors['validation']('Duplicate\x20Skill\x20file\x20path:\x20'+_0x215e0b);if(_0xb872a0['bytes']!==undefined&&!Buffer[_0x2456ed(0x18a)](_0xb872a0[_0x2456ed(0x16d)]))throw CliErrors[_0x2456ed(0x196)](_0x2456ed(0x18b)+_0x215e0b);if(_0xb872a0['bytes']===undefined&&typeof _0xb872a0['content']!==_0x2456ed(0x18d))throw CliErrors[_0x2456ed(0x196)](_0x2456ed(0x17a)+_0x215e0b);const _0x314b16=fileContent(_0xb872a0);_0x10dfce[_0x2456ed(0x179)](_0x215e0b,{'path':_0x215e0b,'bytes':_0x314b16});}return Array[_0x2456ed(0x19e)](_0x10dfce[_0x2456ed(0x19b)]())[_0x2456ed(0x188)](compareSkillFiles);}export function normalizeManifestFiles(_0x4c41b2){const _0x223b83=a141_0x71d5;if(!Array[_0x223b83(0x17b)](_0x4c41b2)||_0x4c41b2[_0x223b83(0x16f)]===0x0)return[];const _0x2eda3a=new Map();for(const _0x409459 of _0x4c41b2){if(!_0x409459||typeof _0x409459!=='object'||typeof _0x409459[_0x223b83(0x19d)]!==_0x223b83(0x18d))throw CliErrors['validation'](_0x223b83(0x17e));const _0x1b19c3=normalizeSkillRelativePath(_0x409459[_0x223b83(0x19d)]);if(_0x2eda3a['has'](_0x1b19c3))throw CliErrors[_0x223b83(0x196)]('Duplicate\x20Skill\x20file\x20path:\x20'+_0x1b19c3);if(!isSha256Hex(_0x409459[_0x223b83(0x173)]))throw CliErrors[_0x223b83(0x196)](_0x223b83(0x198)+_0x1b19c3);if(!Number[_0x223b83(0x18e)](_0x409459['size'])||_0x409459[_0x223b83(0x16e)]<0x0)throw CliErrors[_0x223b83(0x196)](_0x223b83(0x182)+_0x1b19c3);_0x2eda3a[_0x223b83(0x179)](_0x1b19c3,{'path':_0x1b19c3,'sha256':_0x409459[_0x223b83(0x173)][_0x223b83(0x195)](),'size':_0x409459[_0x223b83(0x16e)]});}return Array['from'](_0x2eda3a[_0x223b83(0x19b)]())[_0x223b83(0x188)](compareSkillFiles);}export function scanSkillDirectory(_0x2c450b,_0x5a60b4={}){const _0x457bc7=a141_0x71d5,_0x4f96e2=realpathSync(_0x2c450b),_0x310bd7=canonicalExcludedFilePaths(_0x5a60b4[_0x457bc7(0x170)]),_0x51cb1f=[];function _0x45f8a4(_0x466a25){const _0x144ad9=_0x457bc7,_0x3b046d=readdirSync(_0x466a25,{'withFileTypes':!![]})['sort']((_0x1443a8,_0x43f3b8)=>_0x1443a8[_0x144ad9(0x199)][_0x144ad9(0x17f)](_0x43f3b8[_0x144ad9(0x199)]));for(const _0x2a1301 of _0x3b046d){if(_0x2a1301['isDirectory']()&&IGNORED_DIR_NAMES['has'](_0x2a1301['name']))continue;if(IGNORED_FILE_NAMES['has'](_0x2a1301['name']))continue;const _0x12fbe4=resolve(_0x466a25,_0x2a1301[_0x144ad9(0x199)]);if(isExcludedFilePath(_0x12fbe4,_0x310bd7))continue;if(_0x2a1301['isSymbolicLink']())throw CliErrors[_0x144ad9(0x196)](_0x144ad9(0x191)+_0x12fbe4);const _0x3e2546=toPosixPath(relative(_0x4f96e2,_0x12fbe4));if(_0x2a1301[_0x144ad9(0x19c)]()){_0x45f8a4(_0x12fbe4);continue;}if(!_0x2a1301[_0x144ad9(0x19a)]())continue;validateSkillRelativePath(_0x3e2546);const _0x26f8b6=readFileSync(_0x12fbe4);_0x51cb1f[_0x144ad9(0x190)]({'path':_0x3e2546,'bytes':_0x26f8b6});}}return _0x45f8a4(_0x4f96e2),normalizeLocalFiles(_0x51cb1f);}function canonicalExcludedFilePaths(_0x3feb1a){const _0x33c94d=a141_0x71d5,_0x2afcfa=new Set();for(const _0x40ebf6 of _0x3feb1a??[]){const _0x3a6368=resolve(_0x40ebf6);_0x2afcfa[_0x33c94d(0x171)](_0x3a6368);try{_0x2afcfa[_0x33c94d(0x171)](realpathSync(_0x3a6368));}catch{}}return _0x2afcfa;}function isExcludedFilePath(_0x5f506d,_0x57bb11){const _0x2527f0=a141_0x71d5;if(_0x57bb11[_0x2527f0(0x1a0)](_0x5f506d))return!![];if(_0x57bb11['size']===0x0)return![];try{return _0x57bb11[_0x2527f0(0x1a0)](realpathSync(_0x5f506d));}catch{return![];}}export function compareSkillFiles(_0x3eba46,_0x308e59){const _0x1086aa=a141_0x71d5;if(_0x3eba46['path']===SKILL_FILE)return _0x308e59[_0x1086aa(0x19d)]===SKILL_FILE?0x0:-0x1;if(_0x308e59[_0x1086aa(0x19d)]===SKILL_FILE)return 0x1;return Buffer[_0x1086aa(0x197)](Buffer[_0x1086aa(0x19e)](_0x3eba46[_0x1086aa(0x19d)],_0x1086aa(0x180)),Buffer[_0x1086aa(0x19e)](_0x308e59[_0x1086aa(0x19d)],_0x1086aa(0x180)));}export function normalizeSkillRelativePath(_0x32279b){const _0x27950c=a141_0x71d5,_0x22a2d0=toPosixPath(_0x32279b[_0x27950c(0x192)]());return validateSkillRelativePath(_0x22a2d0),_0x22a2d0;}export function validateSkillRelativePath(_0x9801e2){const _0x207795=a141_0x71d5;if(!_0x9801e2||_0x9801e2[_0x207795(0x172)]('/')||_0x9801e2[_0x207795(0x184)]('//'))throw CliErrors['validation'](_0x207795(0x174)+_0x9801e2);for(const _0x488e74 of _0x9801e2[_0x207795(0x187)]('/')){if(!_0x488e74||_0x488e74==='.'||_0x488e74==='..')throw CliErrors[_0x207795(0x196)](_0x207795(0x174)+_0x9801e2);}}function a141_0x71d5(_0x55577d,_0x546ac0){_0x55577d=_0x55577d-0x16d;const _0x1a4357=a141_0x1a43();let _0x71d54e=_0x1a4357[_0x55577d];return _0x71d54e;}function a141_0x1a43(){const _0x47b67b=['26OtKeYh','set','Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20','isArray','2931720NnyqSB','object','Skill\x20file\x20path\x20must\x20be\x20text.','localeCompare','utf8','11OChbwo','Skill\x20file\x20size\x20is\x20invalid:\x20','1414378fPJBER','includes','1366724Aupplp','346750ykDWTr','split','sort','64776ejiUXr','isBuffer','Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20','30cafHSb','string','isSafeInteger','16LYFrFv','push','Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20','trim','toString','3785688WonkFx','toLowerCase','validation','compare','Skill\x20file\x20sha256\x20is\x20invalid:\x20','name','isFile','values','isDirectory','path','from','9bGrwFE','has','bytes','size','length','excludedFilePaths','add','startsWith','sha256','Unsafe\x20Skill\x20file\x20path:\x20','test','replace','15508860APoeUA'];a141_0x1a43=function(){return _0x47b67b;};return a141_0x1a43();}export function toPosixPath(_0x364373){const _0x1b9364=a141_0x71d5;return _0x364373[_0x1b9364(0x176)](/\\/g,'/');}export function isSha256Hex(_0x241802){const _0x3431d4=a141_0x71d5;return typeof _0x241802===_0x3431d4(0x18d)&&/^[a-fA-F0-9]{64}$/[_0x3431d4(0x175)](_0x241802);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x4a2cfc,_0x8ba15c){const _0xc4fad7=a141_0x4833,_0x5af903=_0x4a2cfc();while(!![]){try{const _0x48d3a4=-parseInt(_0xc4fad7(0xb3))/0x1*(-parseInt(_0xc4fad7(0xae))/0x2)+-parseInt(_0xc4fad7(0xc5))/0x3*(parseInt(_0xc4fad7(0xdd))/0x4)+parseInt(_0xc4fad7(0xd6))/0x5*(-parseInt(_0xc4fad7(0xbc))/0x6)+-parseInt(_0xc4fad7(0xac))/0x7*(-parseInt(_0xc4fad7(0xda))/0x8)+-parseInt(_0xc4fad7(0xc0))/0x9*(-parseInt(_0xc4fad7(0xcd))/0xa)+-parseInt(_0xc4fad7(0xd3))/0xb+parseInt(_0xc4fad7(0xe0))/0xc;if(_0x48d3a4===_0x8ba15c)break;else _0x5af903['push'](_0x5af903['shift']());}catch(_0x50b369){_0x5af903['push'](_0x5af903['shift']());}}}(a141_0x5358,0x532e0));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(_0x39526a,_0x350df6,_0xd494f6){const _0x424b8b=a141_0x4833,_0x581f8c=requireSkillCode(_0x39526a),_0x32ad6b=requirePackageBytes(_0x581f8c,_0xd494f6[_0x424b8b(0xd8)]),_0x530e65=extractDownloadedPackage(_0x32ad6b),_0x21fc1e=_0x530e65[_0x424b8b(0xc1)](_0x11d127=>_0x11d127[_0x424b8b(0xc3)]===SKILL_FILE);if(!_0x21fc1e)throw CliErrors[_0x424b8b(0xd2)](_0x424b8b(0xc4)+SKILL_FILE+':\x20'+_0x581f8c);const _0x59b8d9=withMaterializedSkillFrontmatter(_0x530e65,_0x39526a,_0x581f8c),_0x309b9a=_0x59b8d9[_0x424b8b(0xc1)](_0x228f42=>_0x228f42[_0x424b8b(0xc3)]===SKILL_FILE),_0x2fe2af=fileText(_0x309b9a),_0x20784f=getRuntimeSkillDir(_0xd494f6[_0x424b8b(0xd0)],_0xd494f6[_0x424b8b(0xe1)],_0xd494f6[_0x424b8b(0xc6)],_0x350df6,_0x581f8c,_0xd494f6['paths']),_0x5c6e29=resolve(_0x20784f,SKILL_FILE),_0x19447f=resolve(_0x20784f,METADATA_FILE),_0x3fa440=contentHash(_0x2fe2af),_0x769a1f=readMetadataIfPresent(_0x19447f)?.[_0x424b8b(0xbf)];ensurePulledFilesCanBeOverwritten(_0x20784f,_0x19447f,_0x59b8d9,_0xd494f6['force']===!![]),mkdirSync(_0x20784f,{'recursive':!![],'mode':0x1c0});const _0x1c97a8=existsSync(_0x5c6e29)?readFileSync(_0x5c6e29,_0x424b8b(0xe3)):undefined;return materializeFiles(_0x20784f,_0x59b8d9),removeStaleManagedFiles(_0x20784f,_0x769a1f,_0x59b8d9),writeJsonAtomic(_0x19447f,buildMetadata(_0x39526a,_0x350df6,_0xd494f6[_0x424b8b(0xc6)],_0x3fa440,_0xd494f6[_0x424b8b(0xbe)],_0x59b8d9,_0x32ad6b)),{'skill':_0x39526a,'scope':_0x350df6,'dir':_0x20784f,'skillMdPath':_0x5c6e29,'metadataPath':_0x19447f,'contentHash':_0x3fa440,'changed':_0x1c97a8!==_0x2fe2af};}export function reuseMaterializedRuntimeSkill(_0x360537,_0x2fe3bc,_0x12104b){const _0x4fcd1e=a141_0x4833,_0x404b6e=_0x360537[_0x4fcd1e(0xb6)]?.[_0x4fcd1e(0xa8)]();if(!_0x404b6e)return undefined;const _0x517751=requireSkillCode(_0x360537),_0x2febb4=getRuntimeSkillDir(_0x12104b[_0x4fcd1e(0xd0)],_0x12104b[_0x4fcd1e(0xe1)],_0x12104b[_0x4fcd1e(0xc6)],_0x2fe3bc,_0x517751,_0x12104b['paths']),_0x466cfc=resolve(_0x2febb4,SKILL_FILE),_0xb74409=resolve(_0x2febb4,METADATA_FILE),_0x58689f=readMetadataIfPresent(_0xb74409);if(!_0x58689f||_0x58689f[_0x4fcd1e(0xb2)]!==0x2||_0x58689f[_0x4fcd1e(0xc6)]!==_0x12104b[_0x4fcd1e(0xc6)]||_0x58689f[_0x4fcd1e(0xca)]!==_0x2fe3bc||_0x58689f[_0x4fcd1e(0xb1)]!==_0x517751||_0x58689f[_0x4fcd1e(0xb6)]!==_0x404b6e||_0x58689f['id']!==_0x360537['id']||_0x58689f['skillName']!==_0x360537[_0x4fcd1e(0xba)]||_0x58689f[_0x4fcd1e(0xad)]!==_0x360537['description']||_0x58689f[_0x4fcd1e(0xdb)]!==_0x360537[_0x4fcd1e(0xdb)]||_0x58689f[_0x4fcd1e(0xb4)]!==_0x360537['status']||!_0x58689f[_0x4fcd1e(0xe2)]||!_0x58689f['fileHashes']||!Object[_0x4fcd1e(0xcc)](_0x58689f[_0x4fcd1e(0xbf)],SKILL_FILE))return undefined;for(const [_0x1636ab,_0x2076ea]of Object[_0x4fcd1e(0xe4)](_0x58689f[_0x4fcd1e(0xbf)])){if(!/^[a-f0-9]{64}$/[_0x4fcd1e(0xbd)](_0x2076ea))return undefined;const _0x3dae74=resolveManagedFilePath(_0x2febb4,_0x1636ab);if(!existsSync(_0x3dae74)||!lstatSync(_0x3dae74)[_0x4fcd1e(0xd7)]())return undefined;if(bufferSha256(readFileSync(_0x3dae74))!==_0x2076ea)return undefined;}return{'skill':_0x360537,'scope':_0x2fe3bc,'dir':_0x2febb4,'skillMdPath':_0x466cfc,'metadataPath':_0xb74409,'contentHash':_0x58689f[_0x4fcd1e(0xe2)],'changed':![]};}function withMaterializedSkillFrontmatter(_0x142158,_0x277271,_0x4e0949){const _0xae5079=a141_0x4833,_0x307fae=skillDisplayName(_0x277271,_0x4e0949),_0x404662=_0x277271[_0xae5079(0xad)]?.[_0xae5079(0xa8)]()||_0x307fae||_0x4e0949;return normalizeLocalFiles(_0x142158)[_0xae5079(0xbb)](_0x370f5c=>{const _0x5ae445=_0xae5079,_0x86afef=fileText(_0x370f5c);if(_0x370f5c['path']!==SKILL_FILE)return _0x370f5c;if(hasYamlFrontmatter(_0x86afef))return{'path':_0x370f5c[_0x5ae445(0xc3)],'content':withSyncedDisplayName(_0x86afef,_0x307fae)};return{'path':_0x370f5c[_0x5ae445(0xc3)],'content':prependSkillFrontmatter(_0x86afef,{'name':_0x4e0949,'displayName':_0x307fae,'description':_0x404662})};});}function hasYamlFrontmatter(_0x31fce1){const _0x647fec=a141_0x4833;return/^\uFEFF?---\s*\r?\n/[_0x647fec(0xbd)](_0x31fce1);}function a141_0x5358(){const _0x2268a5=['schemaVersion','797qHbuWm','status','trimEnd','version','match','---\x0a','displayName:\x20','skillName','map','312olRmRp','test','pulledAt','fileHashes','594QmBDTM','find','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','path','Runtime\x20Skill\x20package\x20is\x20missing\x20','633RKtqBl','appCode','keys','displayName','flow','scope','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','hasOwn','94730LyEqKP','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.','stringify','env','.\x20Changed\x20file:\x20','validation','3130061phFvbW','name:\x20','has','26115JMaOFT','isFile','packageBytes','length','1112WpWWWN','example','Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20','12536jymbSo','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','\x0a---\x0a\x0a','1084824VtWdkC','accessKey','contentHash','utf8','entries','join','description:\x20','trim','replace','---','name','15617BWttiG','description','1336CtKuAp','Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20','set','skillCode'];a141_0x5358=function(){return _0x2268a5;};return a141_0x5358();}function prependSkillFrontmatter(_0x5212cf,_0x25ca3a){const _0x96f4d8=a141_0x4833,_0x282260=_0x5212cf[_0x96f4d8(0xa9)](/^\uFEFF/,'');return[_0x96f4d8(0xaa),_0x96f4d8(0xd4)+yamlString(_0x25ca3a[_0x96f4d8(0xab)]),_0x25ca3a[_0x96f4d8(0xc8)]?_0x96f4d8(0xb9)+yamlString(_0x25ca3a[_0x96f4d8(0xc8)]):undefined,_0x96f4d8(0xa7)+yamlString(_0x25ca3a[_0x96f4d8(0xad)]),_0x96f4d8(0xaa),'',_0x282260]['filter'](_0x3a7f49=>_0x3a7f49!==undefined)[_0x96f4d8(0xe5)]('\x0a');}function yamlString(_0x20fb21){const _0x268612=a141_0x4833;return JSON[_0x268612(0xcf)](_0x20fb21[_0x268612(0xa9)](/\r/g,'')[_0x268612(0xa8)]());}function skillDisplayName(_0x288230,_0x25ccf4){const _0x1d2906=a141_0x4833,_0x52df5c=_0x288230['skillName']?.[_0x1d2906(0xa8)]();return _0x52df5c||_0x25ccf4;}function a141_0x4833(_0x2483a6,_0x1428ca){_0x2483a6=_0x2483a6-0xa7;const _0x5358f9=a141_0x5358();let _0x4833ba=_0x5358f9[_0x2483a6];return _0x4833ba;}function withSyncedDisplayName(_0x547eb3,_0x22d8f8){const _0x55b17a=a141_0x4833,_0x3aee6d=_0x547eb3[_0x55b17a(0xb7)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x3aee6d)return _0x547eb3;const _0x524b68=_0x3aee6d[0x1]??'',_0x281c29=_0x3aee6d[0x2]??'',_0x324613=parseDocument(_0x281c29);if(_0x324613['errors'][_0x55b17a(0xd9)]>0x0||!isMap(_0x324613['contents']))return _0x547eb3;if(_0x22d8f8)_0x324613[_0x55b17a(0xb0)](_0x55b17a(0xc8),_0x22d8f8);else{if(_0x324613[_0x55b17a(0xd5)]('displayName'))_0x324613['delete']('displayName');else return _0x547eb3;}forceBlockCollections(_0x324613['contents']);const _0x3fdaab=_0x324613['toString']({'lineWidth':0x0})[_0x55b17a(0xb5)](),_0x88ee13=_0x547eb3['slice'](_0x3aee6d[0x0][_0x55b17a(0xd9)])[_0x55b17a(0xa9)](/^\r?\n/,'');return _0x524b68+_0x55b17a(0xb8)+_0x3fdaab+_0x55b17a(0xdf)+_0x88ee13;}function forceBlockCollections(_0x5a47fb){if(!isNode(_0x5a47fb))return;visit(_0x5a47fb,(_0x23fd98,_0x40ab52)=>{const _0x2cba0f=a141_0x4833;isCollection(_0x40ab52)&&(_0x40ab52[_0x2cba0f(0xc9)]=![]);});}function ensurePulledFilesCanBeOverwritten(_0x296c62,_0x1fc5f9,_0x455537,_0x1c475a){const _0x3864af=a141_0x4833;if(_0x1c475a||!existsSync(_0x1fc5f9))return;const _0x86b5f8=readMetadataIfPresent(_0x1fc5f9);if(!_0x86b5f8)return;const _0x44c98d=_0x86b5f8[_0x3864af(0xbf)]&&Object[_0x3864af(0xc7)](_0x86b5f8[_0x3864af(0xbf)])[_0x3864af(0xd9)]>0x0?_0x86b5f8[_0x3864af(0xbf)]:undefined;if(_0x44c98d)for(const [_0x18bd8f,_0x1246eb]of Object[_0x3864af(0xe4)](_0x44c98d)){const _0x413ccf=resolveManagedFilePath(_0x296c62,_0x18bd8f);if(!existsSync(_0x413ccf))throw CliErrors['validation'](_0x3864af(0xc2)+_0x296c62,'Managed\x20file\x20was\x20removed\x20locally:\x20'+_0x18bd8f);const _0xa74846=lstatSync(_0x413ccf);if(!_0xa74846['isFile']())throw CliErrors['validation'](_0x3864af(0xc2)+_0x296c62,_0x3864af(0xaf)+_0x18bd8f);const _0x28a793=bufferSha256(readFileSync(_0x413ccf));if(_0x28a793!==_0x1246eb)throw CliErrors['validation'](_0x3864af(0xc2)+_0x296c62+_0x3864af(0xd1)+_0x18bd8f,_0x3864af(0xcb)+_0x18bd8f);}else{const _0x4f5b4d=resolve(_0x296c62,SKILL_FILE);if(existsSync(_0x4f5b4d)&&_0x86b5f8['contentHash']){const _0x267fc6=contentHash(readFileSync(_0x4f5b4d,_0x3864af(0xe3)));if(_0x267fc6!==_0x86b5f8[_0x3864af(0xe2)])throw CliErrors[_0x3864af(0xd2)](_0x3864af(0xde)+_0x4f5b4d,_0x3864af(0xce));}}for(const _0x22cdd1 of normalizeLocalFiles(_0x455537)){if(_0x44c98d?.[_0x22cdd1['path']])continue;if(!_0x44c98d&&_0x22cdd1[_0x3864af(0xc3)]===SKILL_FILE)continue;const _0x190824=resolveManagedFilePath(_0x296c62,_0x22cdd1[_0x3864af(0xc3)]);if(!existsSync(_0x190824))continue;const _0x37f1e6=lstatSync(_0x190824);if(!_0x37f1e6[_0x3864af(0xd7)]())throw CliErrors['validation']('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x296c62,'Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20'+_0x22cdd1[_0x3864af(0xc3)]);const _0x4d3bad=bufferSha256(readFileSync(_0x190824));if(_0x4d3bad!==fileHash(_0x22cdd1))throw CliErrors['validation']('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x296c62,_0x3864af(0xdc)+_0x22cdd1[_0x3864af(0xc3)]);}}function materializeFiles(_0x4bf505,_0x471939){const _0x998050=a141_0x4833;for(const _0x4b9b80 of normalizeLocalFiles(_0x471939)){const _0x4a2b9d=resolveManagedFilePath(_0x4bf505,_0x4b9b80[_0x998050(0xc3)]);mkdirSync(dirname(_0x4a2b9d),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x4a2b9d,fileContent(_0x4b9b80),0x180);}}function removeStaleManagedFiles(_0x47b814,_0x32616b,_0x317512){const _0x3ea91c=a141_0x4833;if(!_0x32616b)return;const _0x15714d=new Set(normalizeLocalFiles(_0x317512)[_0x3ea91c(0xbb)](_0x3c6201=>_0x3c6201[_0x3ea91c(0xc3)]));for(const _0x2e594f of Object[_0x3ea91c(0xc7)](_0x32616b)){if(_0x15714d[_0x3ea91c(0xd5)](_0x2e594f))continue;const _0x2b581a=resolveManagedFilePath(_0x47b814,_0x2e594f);existsSync(_0x2b581a)&&lstatSync(_0x2b581a)[_0x3ea91c(0xd7)]()&&rmSync(_0x2b581a,{'force':!![]});}}
|
|
1
|
+
(function(_0x51a438,_0x3cad60){const _0x590690=a142_0x27d9,_0x25f6f5=_0x51a438();while(!![]){try{const _0x36e955=parseInt(_0x590690(0x106))/0x1*(-parseInt(_0x590690(0xda))/0x2)+parseInt(_0x590690(0x113))/0x3*(parseInt(_0x590690(0x10d))/0x4)+parseInt(_0x590690(0x108))/0x5+parseInt(_0x590690(0xe3))/0x6+parseInt(_0x590690(0x115))/0x7*(parseInt(_0x590690(0xf4))/0x8)+-parseInt(_0x590690(0xe5))/0x9*(-parseInt(_0x590690(0xe0))/0xa)+parseInt(_0x590690(0xe2))/0xb*(-parseInt(_0x590690(0xfe))/0xc);if(_0x36e955===_0x3cad60)break;else _0x25f6f5['push'](_0x25f6f5['shift']());}catch(_0x4739f0){_0x25f6f5['push'](_0x25f6f5['shift']());}}}(a142_0x40ad,0x9b5c3));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';function a142_0x27d9(_0x2cb164,_0x387c3f){_0x2cb164=_0x2cb164-0xda;const _0x40ad78=a142_0x40ad();let _0x27d9d5=_0x40ad78[_0x2cb164];return _0x27d9d5;}export function materializeRuntimeSkill(_0x398f40,_0x21bdda,_0x2b6a8a){const _0x22f2f4=a142_0x27d9,_0x291deb=requireSkillCode(_0x398f40),_0xbf76e=requirePackageBytes(_0x291deb,_0x2b6a8a['packageBytes']),_0x2f1b03=extractDownloadedPackage(_0xbf76e),_0x57a6ef=_0x2f1b03[_0x22f2f4(0x10c)](_0x2586ba=>_0x2586ba[_0x22f2f4(0x104)]===SKILL_FILE);if(!_0x57a6ef)throw CliErrors[_0x22f2f4(0xdd)](_0x22f2f4(0xfd)+SKILL_FILE+':\x20'+_0x291deb);const _0xd7e59d=withMaterializedSkillFrontmatter(_0x2f1b03,_0x398f40,_0x291deb),_0x3635ad=_0xd7e59d[_0x22f2f4(0x10c)](_0x2ffb16=>_0x2ffb16[_0x22f2f4(0x104)]===SKILL_FILE),_0xa7f1b0=fileText(_0x3635ad),_0x507e0d=getRuntimeSkillDir(_0x2b6a8a[_0x22f2f4(0xf6)],_0x2b6a8a[_0x22f2f4(0xe4)],_0x2b6a8a[_0x22f2f4(0xf2)],_0x21bdda,_0x291deb,_0x2b6a8a[_0x22f2f4(0xf0)]),_0x4e336f=resolve(_0x507e0d,SKILL_FILE),_0x3e2857=resolve(_0x507e0d,METADATA_FILE),_0xb76cb4=contentHash(_0xa7f1b0),_0x3481c9=readMetadataIfPresent(_0x3e2857)?.[_0x22f2f4(0xf3)];ensurePulledFilesCanBeOverwritten(_0x507e0d,_0x3e2857,_0xd7e59d,_0x2b6a8a[_0x22f2f4(0xdf)]===!![]),mkdirSync(_0x507e0d,{'recursive':!![],'mode':0x1c0});const _0x177139=existsSync(_0x4e336f)?readFileSync(_0x4e336f,'utf8'):undefined;return materializeFiles(_0x507e0d,_0xd7e59d),removeStaleManagedFiles(_0x507e0d,_0x3481c9,_0xd7e59d),writeJsonAtomic(_0x3e2857,buildMetadata(_0x398f40,_0x21bdda,_0x2b6a8a[_0x22f2f4(0xf2)],_0xb76cb4,_0x2b6a8a[_0x22f2f4(0x114)],_0xd7e59d,_0xbf76e)),{'skill':_0x398f40,'scope':_0x21bdda,'dir':_0x507e0d,'skillMdPath':_0x4e336f,'metadataPath':_0x3e2857,'contentHash':_0xb76cb4,'changed':_0x177139!==_0xa7f1b0};}export function reuseMaterializedRuntimeSkill(_0x21cc0c,_0x19574b,_0x4b6ab3){const _0x50500b=a142_0x27d9,_0x5ea8cc=_0x21cc0c[_0x50500b(0xfa)]?.[_0x50500b(0x105)]();if(!_0x5ea8cc)return undefined;const _0x1bfdb4=requireSkillCode(_0x21cc0c),_0x156d4a=getRuntimeSkillDir(_0x4b6ab3['env'],_0x4b6ab3['accessKey'],_0x4b6ab3[_0x50500b(0xf2)],_0x19574b,_0x1bfdb4,_0x4b6ab3[_0x50500b(0xf0)]),_0x2de8a9=resolve(_0x156d4a,SKILL_FILE),_0x560424=resolve(_0x156d4a,METADATA_FILE),_0x1c39e3=readMetadataIfPresent(_0x560424);if(!_0x1c39e3||_0x1c39e3[_0x50500b(0xeb)]!==0x2||_0x1c39e3[_0x50500b(0xf2)]!==_0x4b6ab3[_0x50500b(0xf2)]||_0x1c39e3[_0x50500b(0x101)]!==_0x19574b||_0x1c39e3['skillCode']!==_0x1bfdb4||_0x1c39e3[_0x50500b(0xfa)]!==_0x5ea8cc||_0x1c39e3['id']!==_0x21cc0c['id']||_0x1c39e3[_0x50500b(0x112)]!==_0x21cc0c[_0x50500b(0x112)]||_0x1c39e3[_0x50500b(0xe7)]!==_0x21cc0c[_0x50500b(0xe7)]||_0x1c39e3[_0x50500b(0x103)]!==_0x21cc0c[_0x50500b(0x103)]||_0x1c39e3[_0x50500b(0xdb)]!==_0x21cc0c[_0x50500b(0xdb)]||!_0x1c39e3['contentHash']||!_0x1c39e3[_0x50500b(0xf3)]||!Object[_0x50500b(0xe9)](_0x1c39e3[_0x50500b(0xf3)],SKILL_FILE))return undefined;for(const [_0x3eaf94,_0x412488]of Object[_0x50500b(0xf8)](_0x1c39e3[_0x50500b(0xf3)])){if(!/^[a-f0-9]{64}$/[_0x50500b(0xea)](_0x412488))return undefined;const _0x58ac54=resolveManagedFilePath(_0x156d4a,_0x3eaf94);if(!existsSync(_0x58ac54)||!lstatSync(_0x58ac54)['isFile']())return undefined;if(bufferSha256(readFileSync(_0x58ac54))!==_0x412488)return undefined;}return{'skill':_0x21cc0c,'scope':_0x19574b,'dir':_0x156d4a,'skillMdPath':_0x2de8a9,'metadataPath':_0x560424,'contentHash':_0x1c39e3[_0x50500b(0xfc)],'changed':![]};}function withMaterializedSkillFrontmatter(_0x4505ff,_0x206534,_0x3135e7){const _0x2ae901=a142_0x27d9,_0xd98e99=skillDisplayName(_0x206534,_0x3135e7),_0x41570f=_0x206534[_0x2ae901(0xe7)]?.[_0x2ae901(0x105)]()||_0xd98e99||_0x3135e7;return normalizeLocalFiles(_0x4505ff)[_0x2ae901(0xe6)](_0x9afd1e=>{const _0x54733b=_0x2ae901,_0x49ec89=fileText(_0x9afd1e);if(_0x9afd1e[_0x54733b(0x104)]!==SKILL_FILE)return _0x9afd1e;if(hasYamlFrontmatter(_0x49ec89))return{'path':_0x9afd1e[_0x54733b(0x104)],'content':withSyncedDisplayName(_0x49ec89,_0xd98e99)};return{'path':_0x9afd1e[_0x54733b(0x104)],'content':prependSkillFrontmatter(_0x49ec89,{'name':_0x3135e7,'displayName':_0xd98e99,'description':_0x41570f})};});}function hasYamlFrontmatter(_0x58a905){return/^\uFEFF?---\s*\r?\n/['test'](_0x58a905);}function prependSkillFrontmatter(_0x56f6cc,_0x1ec5c5){const _0x366ae5=a142_0x27d9,_0x5c5d82=_0x56f6cc[_0x366ae5(0x102)](/^\uFEFF/,'');return[_0x366ae5(0xee),_0x366ae5(0xec)+yamlString(_0x1ec5c5[_0x366ae5(0x107)]),_0x1ec5c5[_0x366ae5(0xef)]?_0x366ae5(0xdc)+yamlString(_0x1ec5c5[_0x366ae5(0xef)]):undefined,'description:\x20'+yamlString(_0x1ec5c5['description']),_0x366ae5(0xee),'',_0x5c5d82][_0x366ae5(0xe1)](_0x26d792=>_0x26d792!==undefined)['join']('\x0a');}function yamlString(_0x1df7a1){const _0x154f73=a142_0x27d9;return JSON[_0x154f73(0xf7)](_0x1df7a1[_0x154f73(0x102)](/\r/g,'')[_0x154f73(0x105)]());}function skillDisplayName(_0x5c3405,_0x542208){const _0x3170c6=a142_0x27d9,_0xcb34f4=_0x5c3405[_0x3170c6(0x112)]?.[_0x3170c6(0x105)]();return _0xcb34f4||_0x542208;}function withSyncedDisplayName(_0x27b498,_0x5b95a1){const _0x4926bd=a142_0x27d9,_0x508f64=_0x27b498['match'](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x508f64)return _0x27b498;const _0x541ecc=_0x508f64[0x1]??'',_0x5bc467=_0x508f64[0x2]??'',_0x46f8e8=parseDocument(_0x5bc467);if(_0x46f8e8[_0x4926bd(0xe8)][_0x4926bd(0x100)]>0x0||!isMap(_0x46f8e8['contents']))return _0x27b498;if(_0x5b95a1)_0x46f8e8['set'](_0x4926bd(0xef),_0x5b95a1);else{if(_0x46f8e8[_0x4926bd(0x10a)]('displayName'))_0x46f8e8['delete']('displayName');else return _0x27b498;}forceBlockCollections(_0x46f8e8[_0x4926bd(0x116)]);const _0x193e52=_0x46f8e8[_0x4926bd(0x10b)]({'lineWidth':0x0})['trimEnd'](),_0x3019af=_0x27b498[_0x4926bd(0xf9)](_0x508f64[0x0][_0x4926bd(0x100)])[_0x4926bd(0x102)](/^\r?\n/,'');return _0x541ecc+_0x4926bd(0xf5)+_0x193e52+_0x4926bd(0x109)+_0x3019af;}function forceBlockCollections(_0x55aae3){if(!isNode(_0x55aae3))return;visit(_0x55aae3,(_0x183257,_0x243944)=>{isCollection(_0x243944)&&(_0x243944['flow']=![]);});}function a142_0x40ad(){const _0x29f8fe=['Runtime\x20Skill\x20package\x20is\x20missing\x20','5277396unuvSd','keys','length','scope','replace','example','path','trim','10yTzTOv','name','399640rcGCET','\x0a---\x0a\x0a','has','toString','find','208ezxOLh','Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20','utf8','skillName','1281ZeVOQa','pulledAt','1363621XvRNfE','contents','95676iNmNch','status','displayName:\x20','validation','Managed\x20file\x20was\x20removed\x20locally:\x20','force','120zDSFQV','filter','11gEkAmq','4057056UIdqDj','accessKey','289953CKRGKU','map','description','errors','hasOwn','test','schemaVersion','name:\x20','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','---','displayName','paths','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','appCode','fileHashes','16PQYdgl','---\x0a','env','stringify','entries','slice','version','isFile','contentHash'];a142_0x40ad=function(){return _0x29f8fe;};return a142_0x40ad();}function ensurePulledFilesCanBeOverwritten(_0x4ae25a,_0x119c97,_0xc84087,_0x1148ed){const _0x1ce1cd=a142_0x27d9;if(_0x1148ed||!existsSync(_0x119c97))return;const _0x2d2a93=readMetadataIfPresent(_0x119c97);if(!_0x2d2a93)return;const _0x5ea323=_0x2d2a93[_0x1ce1cd(0xf3)]&&Object[_0x1ce1cd(0xff)](_0x2d2a93[_0x1ce1cd(0xf3)])[_0x1ce1cd(0x100)]>0x0?_0x2d2a93[_0x1ce1cd(0xf3)]:undefined;if(_0x5ea323)for(const [_0x2d4126,_0x2291ff]of Object[_0x1ce1cd(0xf8)](_0x5ea323)){const _0x12eaae=resolveManagedFilePath(_0x4ae25a,_0x2d4126);if(!existsSync(_0x12eaae))throw CliErrors[_0x1ce1cd(0xdd)](_0x1ce1cd(0xf1)+_0x4ae25a,_0x1ce1cd(0xde)+_0x2d4126);const _0x564ecf=lstatSync(_0x12eaae);if(!_0x564ecf['isFile']())throw CliErrors[_0x1ce1cd(0xdd)](_0x1ce1cd(0xf1)+_0x4ae25a,_0x1ce1cd(0x110)+_0x2d4126);const _0x1d25c8=bufferSha256(readFileSync(_0x12eaae));if(_0x1d25c8!==_0x2291ff)throw CliErrors[_0x1ce1cd(0xdd)](_0x1ce1cd(0xf1)+_0x4ae25a+'.\x20Changed\x20file:\x20'+_0x2d4126,'Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20'+_0x2d4126);}else{const _0x4e49a2=resolve(_0x4ae25a,SKILL_FILE);if(existsSync(_0x4e49a2)&&_0x2d2a93[_0x1ce1cd(0xfc)]){const _0x410185=contentHash(readFileSync(_0x4e49a2,_0x1ce1cd(0x111)));if(_0x410185!==_0x2d2a93[_0x1ce1cd(0xfc)])throw CliErrors[_0x1ce1cd(0xdd)](_0x1ce1cd(0xed)+_0x4e49a2,'Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.');}}for(const _0x3df962 of normalizeLocalFiles(_0xc84087)){if(_0x5ea323?.[_0x3df962[_0x1ce1cd(0x104)]])continue;if(!_0x5ea323&&_0x3df962[_0x1ce1cd(0x104)]===SKILL_FILE)continue;const _0x8bc919=resolveManagedFilePath(_0x4ae25a,_0x3df962[_0x1ce1cd(0x104)]);if(!existsSync(_0x8bc919))continue;const _0x562fd3=lstatSync(_0x8bc919);if(!_0x562fd3[_0x1ce1cd(0xfb)]())throw CliErrors[_0x1ce1cd(0xdd)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x4ae25a,_0x1ce1cd(0x10f)+_0x3df962[_0x1ce1cd(0x104)]);const _0x303f4a=bufferSha256(readFileSync(_0x8bc919));if(_0x303f4a!==fileHash(_0x3df962))throw CliErrors[_0x1ce1cd(0xdd)](_0x1ce1cd(0xf1)+_0x4ae25a,_0x1ce1cd(0x10e)+_0x3df962[_0x1ce1cd(0x104)]);}}function materializeFiles(_0x57a553,_0x43bfd6){const _0x45dce0=a142_0x27d9;for(const _0x4c03f0 of normalizeLocalFiles(_0x43bfd6)){const _0x19fe5f=resolveManagedFilePath(_0x57a553,_0x4c03f0[_0x45dce0(0x104)]);mkdirSync(dirname(_0x19fe5f),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x19fe5f,fileContent(_0x4c03f0),0x180);}}function removeStaleManagedFiles(_0x5dc173,_0x1f880c,_0x35a51a){const _0x5e3268=a142_0x27d9;if(!_0x1f880c)return;const _0x316bf2=new Set(normalizeLocalFiles(_0x35a51a)[_0x5e3268(0xe6)](_0x48333a=>_0x48333a[_0x5e3268(0x104)]));for(const _0x475091 of Object[_0x5e3268(0xff)](_0x1f880c)){if(_0x316bf2[_0x5e3268(0x10a)](_0x475091))continue;const _0x5413db=resolveManagedFilePath(_0x5dc173,_0x475091);existsSync(_0x5413db)&&lstatSync(_0x5413db)['isFile']()&&rmSync(_0x5413db,{'force':!![]});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a143_0x3ff7(_0x4f4149,_0x5cbd8b){_0x4f4149=_0x4f4149-0xbe;const _0x39e29c=a143_0x39e2();let _0x3ff79c=_0x39e29c[_0x4f4149];return _0x3ff79c;}function a143_0x39e2(){const _0xab90a2=['map','userId','zipSha256','validation','skillCode','506298zGnuFf','1008560zAkbKY','skillName','manifest','fromEntries','files','object','sourceSessionId','1884993oyQQmJ','tags','utf8','4290QGapOU','hasUpstreamUpdate','path','isArray','toISOString','status','3550HRxTfs','ossPath','length','personal','forkedFromVersion','trim','version','parse','3891265XIhHYN','5286008bLUlzf','Invalid\x20','483720FuJuuu','example','tenantCode','description','Runtime\x20Skill\x20is\x20missing\x20skillCode.'];a143_0x39e2=function(){return _0xab90a2;};return a143_0x39e2();}(function(_0x3cff06,_0x4fe7e3){const _0x5eeb30=a143_0x3ff7,_0x5b4dd7=_0x3cff06();while(!![]){try{const _0xe1d2f4=-parseInt(_0x5eeb30(0xc0))/0x1+-parseInt(_0x5eeb30(0xc1))/0x2+parseInt(_0x5eeb30(0xc8))/0x3+parseInt(_0x5eeb30(0xdc))/0x4+-parseInt(_0x5eeb30(0xd1))/0x5*(parseInt(_0x5eeb30(0xcb))/0x6)+parseInt(_0x5eeb30(0xd9))/0x7+parseInt(_0x5eeb30(0xda))/0x8;if(_0xe1d2f4===_0x4fe7e3)break;else _0x5b4dd7['push'](_0x5b4dd7['shift']());}catch(_0x46ce8c){_0x5b4dd7['push'](_0x5b4dd7['shift']());}}}(a143_0x39e2,0x6d4bf));import{existsSync,readFileSync}from'node:fs';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';import{fileContent,normalizeLocalFiles}from'./local-files.js';import{buildSkillPackage,localFilesToManifestFiles}from'./zip-package.js';export function buildMetadata(_0x553b70,_0x3a91a1,_0x4f4b15,_0x2d0ffd,_0x720218,_0x3e4db0,_0x580209){const _0x3fbfb1=a143_0x3ff7,_0x4f586b=_0x3e4db0?normalizeLocalFiles(_0x3e4db0):[],_0xb4b294=!_0x580209&&_0x4f586b[_0x3fbfb1(0xd3)]>0x0?buildSkillPackage(_0x4f586b):undefined,_0x123bbf=_0x580209?bufferSha256(_0x580209):_0xb4b294?.[_0x3fbfb1(0xc3)][_0x3fbfb1(0xe3)],_0x28fca0=_0x580209?.['length']??_0xb4b294?.[_0x3fbfb1(0xc3)]['zipSize'],_0x313d59=_0x4f586b['length']>0x0?Object[_0x3fbfb1(0xc4)](_0x4f586b[_0x3fbfb1(0xe1)](_0x24501e=>[_0x24501e[_0x3fbfb1(0xcd)],fileHash(_0x24501e)])):undefined;return{'schemaVersion':_0x4f586b[_0x3fbfb1(0xd3)]>0x0?0x2:0x1,'id':_0x553b70['id'],'appCode':_0x4f4b15,'skillCode':requireSkillCode(_0x553b70),'skillName':_0x553b70[_0x3fbfb1(0xc2)],'description':_0x553b70[_0x3fbfb1(0xdf)],'example':_0x553b70[_0x3fbfb1(0xdd)],'scope':_0x3a91a1,'readonly':_0x3a91a1!==_0x3fbfb1(0xd4)||_0x553b70['readonly']===!![],'tenantCode':_0x553b70[_0x3fbfb1(0xde)],'userId':_0x553b70[_0x3fbfb1(0xe2)],'version':_0x553b70[_0x3fbfb1(0xd7)],'status':_0x553b70[_0x3fbfb1(0xd0)],'tags':Array[_0x3fbfb1(0xce)](_0x553b70[_0x3fbfb1(0xc9)])?_0x553b70[_0x3fbfb1(0xc9)]:[],'hasUpstreamUpdate':_0x553b70[_0x3fbfb1(0xcc)],'forkedFromSkillId':_0x553b70['forkedFromSkillId'],'forkedFromVersion':_0x553b70[_0x3fbfb1(0xd5)],'sourceSessionId':_0x553b70[_0x3fbfb1(0xc7)],'contentHash':_0x2d0ffd,'fileHashes':_0x313d59,'treeHash':_0x4f586b['length']>0x0?fileTreeHash(localFilesToManifestFiles(_0x4f586b)):undefined,'ossPath':remoteManifestOssPath(_0x553b70[_0x3fbfb1(0xc5)]),'zipSha256':_0x123bbf,'zipSize':_0x28fca0,'files':_0x4f586b[_0x3fbfb1(0xd3)]>0x0?_0x4f586b[_0x3fbfb1(0xe1)](_0x2334c4=>({'path':_0x2334c4[_0x3fbfb1(0xcd)],'hash':fileHash(_0x2334c4),'size':fileContent(_0x2334c4)[_0x3fbfb1(0xd3)]})):undefined,'pulledAt':_0x720218??new Date()[_0x3fbfb1(0xcf)]()};}export function requireSkillCode(_0x68366e){const _0x589de5=a143_0x3ff7,_0x4cfcb1=_0x68366e[_0x589de5(0xbf)]?.[_0x589de5(0xd6)]();if(!_0x4cfcb1)throw CliErrors[_0x589de5(0xbe)](_0x589de5(0xe0));return _0x4cfcb1;}export function readMetadataIfPresent(_0x2481bc){const _0x159b2f=a143_0x3ff7;if(!existsSync(_0x2481bc))return undefined;try{const _0x227d9e=JSON[_0x159b2f(0xd8)](readFileSync(_0x2481bc,_0x159b2f(0xca)));return _0x227d9e;}catch{throw CliErrors[_0x159b2f(0xbe)](_0x159b2f(0xdb)+METADATA_FILE+':\x20'+_0x2481bc);}}function remoteManifestOssPath(_0x484e19){const _0x30cdd5=a143_0x3ff7;if(!_0x484e19||typeof _0x484e19!==_0x30cdd5(0xc6)||Array[_0x30cdd5(0xce)](_0x484e19))return undefined;const _0xf105c9=_0x484e19[_0x30cdd5(0xd2)];return typeof _0xf105c9==='string'&&_0xf105c9['trim']()?_0xf105c9[_0x30cdd5(0xd6)]():undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a144_0x34f92c=a144_0x1cf0;(function(_0x52a029,_0x1dabad){const _0x1f7286=a144_0x1cf0,_0x1a4fb0=_0x52a029();while(!![]){try{const _0x288de5=parseInt(_0x1f7286(0x143))/0x1+parseInt(_0x1f7286(0x146))/0x2+-parseInt(_0x1f7286(0x157))/0x3+parseInt(_0x1f7286(0x144))/0x4*(-parseInt(_0x1f7286(0x14b))/0x5)+parseInt(_0x1f7286(0x155))/0x6+parseInt(_0x1f7286(0x158))/0x7*(parseInt(_0x1f7286(0x152))/0x8)+-parseInt(_0x1f7286(0x159))/0x9;if(_0x288de5===_0x1dabad)break;else _0x1a4fb0['push'](_0x1a4fb0['shift']());}catch(_0x29df82){_0x1a4fb0['push'](_0x1a4fb0['shift']());}}}(a144_0x374f,0x3632f));import{existsSync}from'node:fs';import{homedir}from'node:os';function a144_0x374f(){const _0xd0170=['\x20for\x20local\x20path:\x20','SKILL_ROOT','1846512TFVHFp','homeDir','234105aFOlgH','20006RtVhKC','2512170IzNkFK','skills','claudeSkillsDir','422920XhjrtY','1281376uOGApB','validation','6144SXlFPV','includes','.workbuddy','path\x20segment','filter','5aYUFFm','appCode','workbuddySkillsDir','agentsSkillsDir','.claude','homeDirName','cache','464NCqnJe'];a144_0x374f=function(){return _0xd0170;};return a144_0x374f();}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(_0x46509d={}){const _0x243cae=a144_0x1cf0,_0x49f59a=_0x46509d[_0x243cae(0x156)]??homedir(),_0x182f08=resolve(_0x49f59a,PRODUCT_CONFIG['homeDirName'],_0x243cae(0x151)),_0x3dbed1=trimmedEnv(_0x243cae(0x154)),_0x5dfcf9=trimmedEnv('CLAUDE_SKILL_ROOT'),_0x597453=resolve(_0x49f59a,_0x243cae(0x148)),_0x4b4991=_0x46509d[_0x243cae(0x14d)]??(existsSync(_0x597453)?resolve(_0x597453,_0x243cae(0x15a)):undefined);return{'homeDir':_0x49f59a,'cacheRoot':_0x182f08,'managedRoot':resolve(_0x49f59a,PRODUCT_CONFIG[_0x243cae(0x150)]),'agentsSkillsDir':_0x46509d[_0x243cae(0x14e)]??_0x3dbed1??resolve(_0x49f59a,'.agents',_0x243cae(0x15a)),'claudeSkillsDir':_0x46509d[_0x243cae(0x142)]??_0x5dfcf9??resolve(_0x49f59a,_0x243cae(0x14f),_0x243cae(0x15a)),'workbuddySkillsDir':_0x4b4991};}export function runtimeAgentSkillRoots(_0x327051){const _0x3d229e=a144_0x1cf0;return[_0x327051['agentsSkillsDir'],_0x327051[_0x3d229e(0x142)],_0x327051[_0x3d229e(0x14d)]][_0x3d229e(0x14a)](_0x415a18=>Boolean(_0x415a18));}export function getRuntimeSkillCacheRoot(_0xac2b90,_0x278e5a,_0x2d24b3={}){const _0x5234f7=a144_0x1cf0,_0x48a7b2=resolveSkillSyncPaths(_0x2d24b3);return resolve(_0x48a7b2['cacheRoot'],_0xac2b90,fingerprintAccessKey(_0x278e5a),_0x5234f7(0x15a));}export function getRuntimeSkillDir(_0x571d8f,_0xec9d40,_0x4ae034,_0x2b2cc7,_0x315852,_0x4dc1c9={}){const _0x29511f=a144_0x1cf0;return resolve(getRuntimeSkillCacheRoot(_0x571d8f,_0xec9d40,_0x4dc1c9),safePathSegment(_0x4ae034,_0x29511f(0x14c)),_0x2b2cc7,safePathSegment(_0x315852,'skillCode'));}export function safePathSegment(_0x42cf2e,_0x3e42bc=a144_0x34f92c(0x149)){const _0x1ef179=a144_0x34f92c;if(!_0x42cf2e||_0x42cf2e[_0x1ef179(0x147)]('/')||_0x42cf2e[_0x1ef179(0x147)]('\x5c')||_0x42cf2e[_0x1ef179(0x147)]('..'))throw CliErrors[_0x1ef179(0x145)]('Unsafe\x20'+_0x3e42bc+_0x1ef179(0x153)+_0x42cf2e);return _0x42cf2e;}function a144_0x1cf0(_0x3da9e8,_0x4c38e3){_0x3da9e8=_0x3da9e8-0x142;const _0x374fe2=a144_0x374f();let _0x1cf0e1=_0x374fe2[_0x3da9e8];return _0x1cf0e1;}function trimmedEnv(_0x10ff64){const _0x484389=productEnv(_0x10ff64)?.['trim']();return _0x484389?_0x484389:undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x16ec4b,_0x2f98dc){const _0x10811c=a144_0x12ec,_0x4d6df0=_0x16ec4b();while(!![]){try{const _0x111812=-parseInt(_0x10811c(0x1fa))/0x1*(parseInt(_0x10811c(0x1cb))/0x2)+parseInt(_0x10811c(0x207))/0x3+-parseInt(_0x10811c(0x1fe))/0x4*(-parseInt(_0x10811c(0x205))/0x5)+parseInt(_0x10811c(0x1e3))/0x6*(-parseInt(_0x10811c(0x1dc))/0x7)+-parseInt(_0x10811c(0x203))/0x8+parseInt(_0x10811c(0x1d5))/0x9+parseInt(_0x10811c(0x206))/0xa;if(_0x111812===_0x2f98dc)break;else _0x4d6df0['push'](_0x4d6df0['shift']());}catch(_0x2629cf){_0x4d6df0['push'](_0x4d6df0['shift']());}}}(a144_0x2a1d,0xb2d55));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a144_0x4a19ac}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';function a144_0x2a1d(){const _0x28dca4=['\x20has\x20scope=\x22','scope','object','ignoreInvalidMetadata','validation','personal','28742WYemvv','startsWith','match','string','tags','appCode','Missing\x20','\x20name\x20for\x20SkillHub\x20slug\x20generation.','builtin','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20','1190610EiOeIh','ignoreMetadataAppCodeMismatch','path','replace','utf8','number','skillCode','2523332AAfdVk','find','slice','isArray','sourceSessionId','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20','boolean','6KyrFgt','Remote\x20Skill\x20','name','isFile','dir','packageBase64','isDirectory','\x20to\x20submit\x20company\x20Skills\x20for\x20review.','company','ignoreMetadataScope','skillName','example','files','Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20',',\x20or\x20directory\x20name.','refreshedAt','excludedFilePaths','Skill\x20directory\x20not\x20found:\x20','pushedAt','version','content','description','ignoreMetadataForPayload','59FEINNd','displayName','ignoreMetadataSkillCode','metadata','732616gfTUXz','Unable\x20to\x20resolve\x20skillCode\x20from\x20','targetScope','Invalid\x20','trim','7800152hIgsOR','manifest','35zgzoWA','5490990cKXmPl','2857254xdLNWI'];a144_0x2a1d=function(){return _0x28dca4;};return a144_0x2a1d();}import{writeJsonAtomic}from'./fs-utils.js';import{contentHash}from'./hashing.js';function a144_0x12ec(_0x430fbc,_0x129b61){_0x430fbc=_0x430fbc-0x1c9;const _0x2a1dd4=a144_0x2a1d();let _0x12ecfb=_0x2a1dd4[_0x430fbc];return _0x12ecfb;}import{fileText,normalizeLocalFiles,scanSkillDirectory}from'./local-files.js';import{buildMetadata,readMetadataIfPresent}from'./metadata.js';import{buildSkillPackage,tryNormalizePackageManifest}from'./zip-package.js';export function resolvePushDirectoryIdentity(_0x14e544,_0x5a9ee0,_0x4a9160={}){const _0x367009=a144_0x12ec,_0x2508c0=resolvePushDirectoryRoot(_0x14e544),_0x5a4e2d=readPushMetadataIfPresent(resolve(_0x2508c0,METADATA_FILE),{'ignoreInvalidMetadata':_0x4a9160[_0x367009(0x20b)]});if(_0x5a4e2d?.[_0x367009(0x1d0)]&&_0x5a4e2d['appCode']!==_0x5a9ee0&&!_0x4a9160['allowAppCodeRetarget']&&!_0x4a9160[_0x367009(0x1d6)])throw CliErrors[_0x367009(0x1c9)]('Skill\x20metadata\x20appCode\x20\x22'+_0x5a4e2d['appCode']+'\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22'+_0x5a9ee0+'\x22.');const _0xbb0d74=resolvePushSkillCode(_0x2508c0,_0x5a9ee0,_0x5a4e2d,_0x4a9160);if(!_0xbb0d74)throw CliErrors[_0x367009(0x1c9)](_0x367009(0x1ff)+SKILL_FILE+',\x20'+METADATA_FILE+_0x367009(0x1f1));return{'dir':_0x2508c0,'skillCode':_0xbb0d74,'metadata':_0x5a4e2d};}export function readPushDirectory(_0x546b5e,_0x19a699,_0x2f200e={}){const _0x3a7e2a=a144_0x12ec,_0x44520f=resolvePushDirectoryIdentity(_0x546b5e,_0x19a699,_0x2f200e),_0x3727be=_0x44520f[_0x3a7e2a(0x1e7)],_0x5d7b29=resolve(_0x3727be,SKILL_FILE);if(!existsSync(_0x5d7b29)||!lstatSync(_0x5d7b29)[_0x3a7e2a(0x1e6)]())throw CliErrors[_0x3a7e2a(0x1c9)](_0x3a7e2a(0x1d1)+SKILL_FILE+':\x20'+_0x5d7b29);const _0x2942d7=_0x44520f[_0x3a7e2a(0x1fd)],_0x567ebf=_0x2f200e[_0x3a7e2a(0x200)]??_0x3a7e2a(0x1ca);if(!_0x2f200e['ignoreMetadataScope']&&_0x2942d7?.['scope']===_0x3a7e2a(0x1d3))throw CliErrors['validation'](_0x3a7e2a(0x1f0)+METADATA_FILE+_0x3a7e2a(0x208)+_0x2942d7['scope']+'\x22.');if(!_0x2f200e[_0x3a7e2a(0x1ec)]&&_0x567ebf===_0x3a7e2a(0x1ca)&&_0x2942d7?.['scope']&&_0x2942d7[_0x3a7e2a(0x209)]!==_0x3a7e2a(0x1ca))throw CliErrors[_0x3a7e2a(0x1c9)](_0x3a7e2a(0x1d4)+METADATA_FILE+_0x3a7e2a(0x208)+_0x2942d7[_0x3a7e2a(0x209)]+'\x22.',_0x3a7e2a(0x1e1)+_0x3727be+_0x3a7e2a(0x1ea));const _0x36b896=scanSkillDirectory(_0x3727be,{'excludedFilePaths':_0x2f200e[_0x3a7e2a(0x1f3)]}),_0x3c42e6=buildSkillPackage(_0x36b896),_0x22378b=readFileSync(_0x5d7b29,'utf8'),_0x307769=_0x44520f[_0x3a7e2a(0x1db)],_0x5967a9=_0x2f200e[_0x3a7e2a(0x1f9)]?undefined:_0x2942d7,_0x48d3f1=readSkillDisplayName(_0x22378b);return{'skillCode':_0x307769,'metadata':_0x2942d7,'frontmatterDisplayName':_0x48d3f1,'input':{'skillCode':_0x307769,'skillName':_0x48d3f1??_0x5967a9?.[_0x3a7e2a(0x1ed)],'description':_0x5967a9?.[_0x3a7e2a(0x1f8)],'content':_0x22378b,'files':_0x3c42e6[_0x3a7e2a(0x204)],'packageBase64':_0x3c42e6[_0x3a7e2a(0x1e8)],'tags':_0x5967a9?.[_0x3a7e2a(0x1cf)],'version':_0x5967a9?.[_0x3a7e2a(0x1f6)],'sourceSessionId':_0x5967a9?.['sourceSessionId']}};}export function refreshPushDirectoryMetadataFromRemote(_0x3dc65f,_0x1251f1,_0xe75387,_0x2ece6b={}){const _0x5addbd=a144_0x12ec,_0x22e427=resolvePushDirectoryRoot(_0x3dc65f),_0xb21343=readPushMetadataIfPresent(resolve(_0x22e427,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x2b7fb6=requireRemoteScope(_0x1251f1),_0x5bbe18=readLocalSkillContent(_0x22e427),_0x36bd99={..._0x1251f1,'appCode':_0x1251f1['appCode']??_0xe75387,'skillName':_0x1251f1[_0x5addbd(0x1ed)]??_0xb21343?.[_0x5addbd(0x1ed)],'description':_0x1251f1[_0x5addbd(0x1f8)]??_0xb21343?.['description'],'example':_0x1251f1['example']??_0xb21343?.[_0x5addbd(0x1ee)],'tags':Array[_0x5addbd(0x1df)](_0x1251f1[_0x5addbd(0x1cf)])?_0x1251f1[_0x5addbd(0x1cf)]:_0xb21343?.[_0x5addbd(0x1cf)],'sourceSessionId':_0x1251f1[_0x5addbd(0x1e0)]??_0xb21343?.[_0x5addbd(0x1e0)],'content':_0x1251f1[_0x5addbd(0x1f7)]??_0x5bbe18},_0xfa6e9b=buildMetadata(_0x36bd99,_0x2b7fb6,_0xe75387,contentHash(_0x5bbe18),_0x2ece6b[_0x5addbd(0x1f2)]);writeJsonAtomic(resolve(_0x22e427,METADATA_FILE),_0xfa6e9b);}export function recordPushedRuntimeSkill(_0x1b1fb4,_0x23648f,_0x5c4944,_0x17760a={}){const _0x5848ce=a144_0x12ec,_0x5d1a59=resolvePushDirectoryRoot(_0x1b1fb4),_0x1365f5=scanSkillDirectory(_0x5d1a59),_0x4bcbfe=_0x1365f5[_0x5848ce(0x1dd)](_0x115533=>_0x115533[_0x5848ce(0x1d7)]===SKILL_FILE),_0x366376=_0x4bcbfe?fileText(_0x4bcbfe):'',_0x192804=tryNormalizePackageManifest(_0x23648f['files']),_0x14ffee={..._0x23648f,'content':_0x23648f[_0x5848ce(0x1f7)]??_0x366376,'files':_0x192804},_0xe22d0e=_0x192804?normalizeLocalFiles(_0x1365f5)['filter'](_0x4c9877=>_0x192804[_0x5848ce(0x1ef)]['some'](_0x32cdbf=>_0x32cdbf['path']===_0x4c9877['path'])):undefined,_0x4662a4=buildMetadata(_0x14ffee,_0x17760a[_0x5848ce(0x209)]??_0x5848ce(0x1ca),_0x5c4944,contentHash(_0x14ffee['content']??''),_0x17760a[_0x5848ce(0x1f5)],_0xe22d0e);writeJsonAtomic(resolve(_0x5d1a59,METADATA_FILE),_0x4662a4);}export function deriveSkillCodeFromDirectory(_0x94c70,_0x2f3d48){const _0x56dc96=a144_0x12ec,_0x1193e7=basename(resolve(_0x94c70)),_0x2955c2=_0x2f3d48+'--';return _0x1193e7[_0x56dc96(0x1cc)](_0x2955c2)?_0x1193e7[_0x56dc96(0x1de)](_0x2955c2['length']):_0x1193e7;}function resolvePushSkillCode(_0x9af777,_0x5e15d7,_0x1d8380,_0x5ed767){const _0x4e6058=a144_0x12ec,_0xc8fe64=deriveSkillCodeFromSkillFile(_0x9af777)||deriveSkillCodeFromDirectory(_0x9af777,_0x5e15d7);if(_0x5ed767[_0x4e6058(0x1fc)])return _0xc8fe64;return _0x1d8380?.[_0x4e6058(0x1db)]?.['trim']()||_0xc8fe64;}function deriveSkillCodeFromSkillFile(_0x3f1e1d){const _0x400f33=a144_0x12ec,_0x17b8ae=resolve(_0x3f1e1d,SKILL_FILE);if(!existsSync(_0x17b8ae)||!lstatSync(_0x17b8ae)['isFile']())return undefined;const _0x183b5e=readFileSync(_0x17b8ae,_0x400f33(0x1d9)),_0x1e8937=_0x183b5e[_0x400f33(0x1cd)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x1e8937)return undefined;const _0x44b1cc=parseFrontmatterObject(_0x1e8937[0x1]??''),_0x43c12c=scalarToString(_0x44b1cc?.[_0x400f33(0x1e5)]);return _0x43c12c?slugifySkillName(_0x43c12c):undefined;}function readSkillDisplayName(_0x4f4903){const _0x2ca85e=a144_0x12ec,_0x1556fc=_0x4f4903['match'](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x1556fc)return undefined;const _0x2ce7f8=parseFrontmatterObject(_0x1556fc[0x1]??'');return scalarToString(_0x2ce7f8?.[_0x2ca85e(0x1fb)]);}function slugifySkillName(_0x46d4de){const _0x3fd966=a144_0x12ec,_0x53dc4c=_0x46d4de[_0x3fd966(0x202)]()['toLowerCase']()[_0x3fd966(0x1d8)](/[^\p{L}\p{N}\p{So}]+/gu,'-')[_0x3fd966(0x1d8)](/^-+/,'')[_0x3fd966(0x1d8)](/-+$/,'')['replace'](/-{2,}/g,'-');if(!_0x53dc4c)throw CliErrors[_0x3fd966(0x1c9)](_0x3fd966(0x201)+SKILL_FILE+_0x3fd966(0x1d2));return _0x53dc4c;}function parseFrontmatterObject(_0x24edeb){const _0x465b52=a144_0x12ec;try{const _0x172b6c=a144_0x4a19ac(_0x24edeb);return _0x172b6c&&typeof _0x172b6c===_0x465b52(0x20a)&&!Array['isArray'](_0x172b6c)?_0x172b6c:undefined;}catch{return undefined;}}function scalarToString(_0x990be6){const _0x297993=a144_0x12ec;if(typeof _0x990be6===_0x297993(0x1ce))return _0x990be6[_0x297993(0x202)]();if(typeof _0x990be6===_0x297993(0x1da)||typeof _0x990be6===_0x297993(0x1e2))return String(_0x990be6);return undefined;}function resolvePushDirectoryRoot(_0x51a7aa){const _0x5b0db6=a144_0x12ec,_0x16b586=resolve(_0x51a7aa);if(!existsSync(_0x16b586))throw CliErrors[_0x5b0db6(0x1c9)](_0x5b0db6(0x1f4)+_0x51a7aa);const _0xfe8cac=lstatSync(_0x16b586);if(_0xfe8cac[_0x5b0db6(0x1e9)]())return _0x16b586;if(_0xfe8cac['isSymbolicLink']()){const _0x2145e1=realpathSync(_0x16b586);if(lstatSync(_0x2145e1)['isDirectory']())return _0x2145e1;}throw CliErrors[_0x5b0db6(0x1c9)](_0x5b0db6(0x1f4)+_0x51a7aa);}function requireRemoteScope(_0x295242){const _0x60d77b=a144_0x12ec;if(_0x295242['scope']===_0x60d77b(0x1ca)||_0x295242[_0x60d77b(0x209)]===_0x60d77b(0x1eb)||_0x295242[_0x60d77b(0x209)]==='builtin')return _0x295242[_0x60d77b(0x209)];throw CliErrors['validation'](_0x60d77b(0x1e4)+(_0x295242[_0x60d77b(0x1db)]||'(unknown)')+'\x20has\x20unsupported\x20scope\x20\x22'+(_0x295242[_0x60d77b(0x209)]??'unknown')+'\x22.');}function readLocalSkillContent(_0x4b4f7b){const _0x3ad7fc=a144_0x12ec,_0x3abe3d=resolve(_0x4b4f7b,SKILL_FILE);return existsSync(_0x3abe3d)&&lstatSync(_0x3abe3d)[_0x3ad7fc(0x1e6)]()?readFileSync(_0x3abe3d,_0x3ad7fc(0x1d9)):'';}function readPushMetadataIfPresent(_0x12d74d,_0xc59146={}){const _0x36f881=a144_0x12ec;try{return readMetadataIfPresent(_0x12d74d);}catch(_0x34fb52){if(_0xc59146[_0x36f881(0x20b)])return undefined;throw _0x34fb52;}}
|
|
1
|
+
(function(_0x1c5b94,_0x52b2a0){const _0x58e66a=a145_0x3ecc,_0x271ebb=_0x1c5b94();while(!![]){try{const _0x2e991c=-parseInt(_0x58e66a(0x210))/0x1+parseInt(_0x58e66a(0x205))/0x2+-parseInt(_0x58e66a(0x21e))/0x3+-parseInt(_0x58e66a(0x21a))/0x4*(parseInt(_0x58e66a(0x1fb))/0x5)+-parseInt(_0x58e66a(0x202))/0x6*(-parseInt(_0x58e66a(0x1fa))/0x7)+parseInt(_0x58e66a(0x1f6))/0x8+-parseInt(_0x58e66a(0x21c))/0x9;if(_0x2e991c===_0x52b2a0)break;else _0x271ebb['push'](_0x271ebb['shift']());}catch(_0x2d8560){_0x271ebb['push'](_0x271ebb['shift']());}}}(a145_0x16a0,0x5ea00));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a145_0x58cd9b}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{writeJsonAtomic}from'./fs-utils.js';import{contentHash}from'./hashing.js';import{fileText,normalizeLocalFiles,scanSkillDirectory}from'./local-files.js';import{buildMetadata,readMetadataIfPresent}from'./metadata.js';import{buildSkillPackage,tryNormalizePackageManifest}from'./zip-package.js';export function resolvePushDirectoryIdentity(_0x483845,_0x3efe97,_0x43b71f={}){const _0x5728fb=a145_0x3ecc,_0x1a7686=resolvePushDirectoryRoot(_0x483845),_0x42f56b=readPushMetadataIfPresent(resolve(_0x1a7686,METADATA_FILE),{'ignoreInvalidMetadata':_0x43b71f[_0x5728fb(0x1f8)]});if(_0x42f56b?.[_0x5728fb(0x211)]&&_0x42f56b[_0x5728fb(0x211)]!==_0x3efe97&&!_0x43b71f[_0x5728fb(0x223)]&&!_0x43b71f['ignoreMetadataAppCodeMismatch'])throw CliErrors['validation'](_0x5728fb(0x1f7)+_0x42f56b[_0x5728fb(0x211)]+'\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22'+_0x3efe97+'\x22.');const _0x1f0600=resolvePushSkillCode(_0x1a7686,_0x3efe97,_0x42f56b,_0x43b71f);if(!_0x1f0600)throw CliErrors[_0x5728fb(0x20b)](_0x5728fb(0x1ea)+SKILL_FILE+',\x20'+METADATA_FILE+_0x5728fb(0x215));return{'dir':_0x1a7686,'skillCode':_0x1f0600,'metadata':_0x42f56b};}export function readPushDirectory(_0x3c5cd2,_0x1e9e6b,_0x3de903={}){const _0x55a0e6=a145_0x3ecc,_0x10a45e=resolvePushDirectoryIdentity(_0x3c5cd2,_0x1e9e6b,_0x3de903),_0x47d57e=_0x10a45e[_0x55a0e6(0x20d)],_0x7a7bed=resolve(_0x47d57e,SKILL_FILE);if(!existsSync(_0x7a7bed)||!lstatSync(_0x7a7bed)['isFile']())throw CliErrors['validation'](_0x55a0e6(0x204)+SKILL_FILE+':\x20'+_0x7a7bed);const _0x1e91e8=_0x10a45e[_0x55a0e6(0x1ff)],_0x1e456a=_0x3de903[_0x55a0e6(0x21b)]??_0x55a0e6(0x1e9);if(!_0x3de903[_0x55a0e6(0x1f5)]&&_0x1e91e8?.[_0x55a0e6(0x1f3)]===_0x55a0e6(0x217))throw CliErrors[_0x55a0e6(0x20b)](_0x55a0e6(0x1fd)+METADATA_FILE+'\x20has\x20scope=\x22'+_0x1e91e8[_0x55a0e6(0x1f3)]+'\x22.');if(!_0x3de903[_0x55a0e6(0x1f5)]&&_0x1e456a===_0x55a0e6(0x1e9)&&_0x1e91e8?.[_0x55a0e6(0x1f3)]&&_0x1e91e8[_0x55a0e6(0x1f3)]!==_0x55a0e6(0x1e9))throw CliErrors[_0x55a0e6(0x20b)](_0x55a0e6(0x1eb)+METADATA_FILE+_0x55a0e6(0x1fe)+_0x1e91e8[_0x55a0e6(0x1f3)]+'\x22.',_0x55a0e6(0x221)+_0x47d57e+_0x55a0e6(0x207));const _0x353891=scanSkillDirectory(_0x47d57e,{'excludedFilePaths':_0x3de903['excludedFilePaths']}),_0x538e7e=buildSkillPackage(_0x353891),_0x54a649=readFileSync(_0x7a7bed,_0x55a0e6(0x1ec)),_0xcb47ee=_0x10a45e[_0x55a0e6(0x219)],_0x4df830=_0x3de903[_0x55a0e6(0x214)]?undefined:_0x1e91e8,_0x334170=readSkillDisplayName(_0x54a649);return{'skillCode':_0xcb47ee,'metadata':_0x1e91e8,'frontmatterDisplayName':_0x334170,'input':{'skillCode':_0xcb47ee,'skillName':_0x334170??_0x4df830?.[_0x55a0e6(0x1f1)],'description':_0x4df830?.[_0x55a0e6(0x216)],'content':_0x54a649,'files':_0x538e7e[_0x55a0e6(0x1ef)],'packageBase64':_0x538e7e[_0x55a0e6(0x201)],'tags':_0x4df830?.[_0x55a0e6(0x206)],'version':_0x4df830?.[_0x55a0e6(0x220)],'sourceSessionId':_0x4df830?.['sourceSessionId']}};}function a145_0x16a0(){const _0x2c1a0c=['Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20','displayName','allowAppCodeRetarget','match','isArray','slice','startsWith','\x20name\x20for\x20SkillHub\x20slug\x20generation.','trim','personal','Unable\x20to\x20resolve\x20skillCode\x20from\x20','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20','utf8','string','filter','manifest','boolean','skillName','length','scope','toLowerCase','ignoreMetadataScope','3988912ANCqPG','Skill\x20metadata\x20appCode\x20\x22','ignoreInvalidMetadata','isFile','3356185LDYjvK','13660WCtmsV','pushedAt','Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20','\x20has\x20scope=\x22','metadata','name','packageBase64','6PreKjp','ignoreMetadataSkillCode','Missing\x20','1428762LYFRnV','tags','\x20to\x20submit\x20company\x20Skills\x20for\x20review.','path','replace','sourceSessionId','validation','number','dir','isDirectory','Remote\x20Skill\x20','640714yQxwSp','appCode','files','example','ignoreMetadataForPayload',',\x20or\x20directory\x20name.','description','builtin','isSymbolicLink','skillCode','500zBYHwf','targetScope','2404620LSdSGg','Skill\x20directory\x20not\x20found:\x20','166416ZIFDPa','content','version'];a145_0x16a0=function(){return _0x2c1a0c;};return a145_0x16a0();}export function refreshPushDirectoryMetadataFromRemote(_0x57e699,_0x3adb10,_0x3af6dd,_0x45d43c={}){const _0x178320=a145_0x3ecc,_0x4a0e3b=resolvePushDirectoryRoot(_0x57e699),_0x4ce70c=readPushMetadataIfPresent(resolve(_0x4a0e3b,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x1474b5=requireRemoteScope(_0x3adb10),_0x574f6f=readLocalSkillContent(_0x4a0e3b),_0xd08ae9={..._0x3adb10,'appCode':_0x3adb10[_0x178320(0x211)]??_0x3af6dd,'skillName':_0x3adb10['skillName']??_0x4ce70c?.['skillName'],'description':_0x3adb10[_0x178320(0x216)]??_0x4ce70c?.[_0x178320(0x216)],'example':_0x3adb10[_0x178320(0x213)]??_0x4ce70c?.[_0x178320(0x213)],'tags':Array[_0x178320(0x1e4)](_0x3adb10[_0x178320(0x206)])?_0x3adb10[_0x178320(0x206)]:_0x4ce70c?.[_0x178320(0x206)],'sourceSessionId':_0x3adb10[_0x178320(0x20a)]??_0x4ce70c?.[_0x178320(0x20a)],'content':_0x3adb10[_0x178320(0x21f)]??_0x574f6f},_0x2dfd67=buildMetadata(_0xd08ae9,_0x1474b5,_0x3af6dd,contentHash(_0x574f6f),_0x45d43c['refreshedAt']);writeJsonAtomic(resolve(_0x4a0e3b,METADATA_FILE),_0x2dfd67);}export function recordPushedRuntimeSkill(_0x451be5,_0x2b6bd8,_0x4529c8,_0x3022b7={}){const _0x23f9ee=a145_0x3ecc,_0x49e2ce=resolvePushDirectoryRoot(_0x451be5),_0x3095eb=scanSkillDirectory(_0x49e2ce),_0xde0e61=_0x3095eb['find'](_0x3a4df6=>_0x3a4df6[_0x23f9ee(0x208)]===SKILL_FILE),_0x1ef455=_0xde0e61?fileText(_0xde0e61):'',_0x7fc6a3=tryNormalizePackageManifest(_0x2b6bd8[_0x23f9ee(0x212)]),_0x1be5c5={..._0x2b6bd8,'content':_0x2b6bd8['content']??_0x1ef455,'files':_0x7fc6a3},_0x472671=_0x7fc6a3?normalizeLocalFiles(_0x3095eb)[_0x23f9ee(0x1ee)](_0x14dcf4=>_0x7fc6a3[_0x23f9ee(0x212)]['some'](_0xe00400=>_0xe00400[_0x23f9ee(0x208)]===_0x14dcf4[_0x23f9ee(0x208)])):undefined,_0xc38606=buildMetadata(_0x1be5c5,_0x3022b7[_0x23f9ee(0x1f3)]??_0x23f9ee(0x1e9),_0x4529c8,contentHash(_0x1be5c5[_0x23f9ee(0x21f)]??''),_0x3022b7[_0x23f9ee(0x1fc)],_0x472671);writeJsonAtomic(resolve(_0x49e2ce,METADATA_FILE),_0xc38606);}export function deriveSkillCodeFromDirectory(_0x4bfaf2,_0x2c0f06){const _0x1f9021=a145_0x3ecc,_0x1efefd=basename(resolve(_0x4bfaf2)),_0x396ef9=_0x2c0f06+'--';return _0x1efefd[_0x1f9021(0x1e6)](_0x396ef9)?_0x1efefd[_0x1f9021(0x1e5)](_0x396ef9[_0x1f9021(0x1f2)]):_0x1efefd;}function resolvePushSkillCode(_0x1c8667,_0x58cd2d,_0x5829ce,_0x1cc4f1){const _0x14cc6e=a145_0x3ecc,_0x7482ec=deriveSkillCodeFromSkillFile(_0x1c8667)||deriveSkillCodeFromDirectory(_0x1c8667,_0x58cd2d);if(_0x1cc4f1[_0x14cc6e(0x203)])return _0x7482ec;return _0x5829ce?.['skillCode']?.[_0x14cc6e(0x1e8)]()||_0x7482ec;}function deriveSkillCodeFromSkillFile(_0x565d6b){const _0x3a85f5=a145_0x3ecc,_0x18030f=resolve(_0x565d6b,SKILL_FILE);if(!existsSync(_0x18030f)||!lstatSync(_0x18030f)[_0x3a85f5(0x1f9)]())return undefined;const _0x505518=readFileSync(_0x18030f,_0x3a85f5(0x1ec)),_0x3fc279=_0x505518['match'](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x3fc279)return undefined;const _0x11252b=parseFrontmatterObject(_0x3fc279[0x1]??''),_0x57f7e5=scalarToString(_0x11252b?.[_0x3a85f5(0x200)]);return _0x57f7e5?slugifySkillName(_0x57f7e5):undefined;}function readSkillDisplayName(_0x425885){const _0x212df7=a145_0x3ecc,_0x2c89a5=_0x425885[_0x212df7(0x1e3)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x2c89a5)return undefined;const _0x2800c2=parseFrontmatterObject(_0x2c89a5[0x1]??'');return scalarToString(_0x2800c2?.[_0x212df7(0x222)]);}function slugifySkillName(_0x11e4e8){const _0x1f31c1=a145_0x3ecc,_0x5462fd=_0x11e4e8[_0x1f31c1(0x1e8)]()[_0x1f31c1(0x1f4)]()['replace'](/[^\p{L}\p{N}\p{So}]+/gu,'-')[_0x1f31c1(0x209)](/^-+/,'')[_0x1f31c1(0x209)](/-+$/,'')[_0x1f31c1(0x209)](/-{2,}/g,'-');if(!_0x5462fd)throw CliErrors[_0x1f31c1(0x20b)]('Invalid\x20'+SKILL_FILE+_0x1f31c1(0x1e7));return _0x5462fd;}function parseFrontmatterObject(_0x146897){try{const _0x3e3560=a145_0x58cd9b(_0x146897);return _0x3e3560&&typeof _0x3e3560==='object'&&!Array['isArray'](_0x3e3560)?_0x3e3560:undefined;}catch{return undefined;}}function scalarToString(_0x401931){const _0x642abf=a145_0x3ecc;if(typeof _0x401931===_0x642abf(0x1ed))return _0x401931[_0x642abf(0x1e8)]();if(typeof _0x401931===_0x642abf(0x20c)||typeof _0x401931===_0x642abf(0x1f0))return String(_0x401931);return undefined;}function resolvePushDirectoryRoot(_0x148e35){const _0x17277c=a145_0x3ecc,_0x3e8e1f=resolve(_0x148e35);if(!existsSync(_0x3e8e1f))throw CliErrors[_0x17277c(0x20b)](_0x17277c(0x21d)+_0x148e35);const _0x59e8f8=lstatSync(_0x3e8e1f);if(_0x59e8f8[_0x17277c(0x20e)]())return _0x3e8e1f;if(_0x59e8f8[_0x17277c(0x218)]()){const _0x554601=realpathSync(_0x3e8e1f);if(lstatSync(_0x554601)[_0x17277c(0x20e)]())return _0x554601;}throw CliErrors[_0x17277c(0x20b)]('Skill\x20directory\x20not\x20found:\x20'+_0x148e35);}function a145_0x3ecc(_0x1863c8,_0x3c3965){_0x1863c8=_0x1863c8-0x1e3;const _0x16a014=a145_0x16a0();let _0x3ecc34=_0x16a014[_0x1863c8];return _0x3ecc34;}function requireRemoteScope(_0x40492f){const _0x319361=a145_0x3ecc;if(_0x40492f['scope']===_0x319361(0x1e9)||_0x40492f['scope']==='company'||_0x40492f[_0x319361(0x1f3)]===_0x319361(0x217))return _0x40492f[_0x319361(0x1f3)];throw CliErrors[_0x319361(0x20b)](_0x319361(0x20f)+(_0x40492f[_0x319361(0x219)]||'(unknown)')+'\x20has\x20unsupported\x20scope\x20\x22'+(_0x40492f[_0x319361(0x1f3)]??'unknown')+'\x22.');}function readLocalSkillContent(_0xe0e0cd){const _0x28e3eb=a145_0x3ecc,_0x3e3fcb=resolve(_0xe0e0cd,SKILL_FILE);return existsSync(_0x3e3fcb)&&lstatSync(_0x3e3fcb)[_0x28e3eb(0x1f9)]()?readFileSync(_0x3e3fcb,_0x28e3eb(0x1ec)):'';}function readPushMetadataIfPresent(_0x470fa9,_0x38c9c2={}){const _0x51a83e=a145_0x3ecc;try{return readMetadataIfPresent(_0x470fa9);}catch(_0x67d050){if(_0x38c9c2[_0x51a83e(0x1f8)])return undefined;throw _0x67d050;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x343b98,_0x3633f6){const _0x10e1bc=a146_0x31d7,_0x277fcf=_0x343b98();while(!![]){try{const _0x57e248=parseInt(_0x10e1bc(0x184))/0x1+parseInt(_0x10e1bc(0x17e))/0x2+-parseInt(_0x10e1bc(0x183))/0x3+-parseInt(_0x10e1bc(0x181))/0x4*(-parseInt(_0x10e1bc(0x186))/0x5)+-parseInt(_0x10e1bc(0x18b))/0x6*(parseInt(_0x10e1bc(0x185))/0x7)+parseInt(_0x10e1bc(0x18c))/0x8*(-parseInt(_0x10e1bc(0x189))/0x9)+parseInt(_0x10e1bc(0x17d))/0xa;if(_0x57e248===_0x3633f6)break;else _0x277fcf['push'](_0x277fcf['shift']());}catch(_0x51f394){_0x277fcf['push'](_0x277fcf['shift']());}}}(a146_0x6688,0x775d1));function a146_0x6688(){const _0xd289a7=['52535nnahBo','validation','personal','27HVFSQr','Unsupported\x20runtime\x20Skill\x20scope:\x20','210570UYyMor','1300504eLCeXG','length','push','7387090jSIBbG','876908iyEacy','includes','builtin','216FLyRsc','company','2325609dFmPRl','498594IYjIfs','98uJxJMV'];a146_0x6688=function(){return _0xd289a7;};return a146_0x6688();}import{CliErrors}from'../../errors.js';function a146_0x31d7(_0x3edc4f,_0x46b5b5){_0x3edc4f=_0x3edc4f-0x17d;const _0x668859=a146_0x6688();let _0x31d783=_0x668859[_0x3edc4f];return _0x31d783;}export function normalizeRuntimeSkillScopes(_0x3e8863){const _0x36a2c7=a146_0x31d7,_0x199021=_0x3e8863&&_0x3e8863[_0x36a2c7(0x18d)]>0x0?_0x3e8863:['personal',_0x36a2c7(0x182),_0x36a2c7(0x180)],_0xc363b=[];for(const _0x2b2779 of _0x199021){if(!isRuntimeSkillScope(_0x2b2779))throw CliErrors[_0x36a2c7(0x187)](_0x36a2c7(0x18a)+_0x2b2779);!_0xc363b[_0x36a2c7(0x17f)](_0x2b2779)&&_0xc363b[_0x36a2c7(0x18e)](_0x2b2779);}return _0xc363b;}export function isRuntimeSkillScope(_0x20ba8f){const _0xc82e82=a146_0x31d7;return _0x20ba8f===_0xc82e82(0x188)||_0x20ba8f===_0xc82e82(0x182)||_0x20ba8f===_0xc82e82(0x180);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a148_0x42931f=a148_0x3686;function a148_0x3686(_0x5be057,_0x5fb535){_0x5be057=_0x5be057-0xfc;const _0x3e2b27=a148_0x3e2b();let _0x3686e4=_0x3e2b27[_0x5be057];return _0x3686e4;}function a148_0x3e2b(){const _0x4f5d59=['629545gMGeUm','1980-01-01T00:00:00.000Z','659550dHZyaE','42MIBZWq','54nNtyaV','428rGHtfH','validation_error','from','23525DDwVPQ','sort','1513096yWrTxu','951310wpoQqY','endsWith','code','Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.','135lvPKIS','validation','4259101yGEWEO','path','length','Runtime\x20Skill\x20package\x20contains\x20directory\x20entry:\x20','name','map','9954DHAlGy'];a148_0x3e2b=function(){return _0x4f5d59;};return a148_0x3e2b();}(function(_0xcd4fe4,_0x318519){const _0xb6e54f=a148_0x3686,_0x3a1822=_0xcd4fe4();while(!![]){try{const _0x334bda=parseInt(_0xb6e54f(0x101))/0x1+parseInt(_0xb6e54f(0xfe))/0x2*(-parseInt(_0xb6e54f(0x10e))/0x3)+parseInt(_0xb6e54f(0x104))/0x4*(parseInt(_0xb6e54f(0x107))/0x5)+parseInt(_0xb6e54f(0x102))/0x6*(parseInt(_0xb6e54f(0xff))/0x7)+-parseInt(_0xb6e54f(0x109))/0x8+-parseInt(_0xb6e54f(0x103))/0x9*(parseInt(_0xb6e54f(0x10a))/0xa)+-parseInt(_0xb6e54f(0x110))/0xb;if(_0x334bda===_0x318519)break;else _0x3a1822['push'](_0x3a1822['shift']());}catch(_0x4fb24e){_0x3a1822['push'](_0x3a1822['shift']());}}}(a148_0x3e2b,0x66e4b));import{unzipSync,zipSync}from'fflate';import{CliErrors}from'../../errors.js';import{compareSkillFiles,fileContent,normalizeLocalFiles,normalizeSkillRelativePath}from'./local-files.js';const ZIP_MTIME=new Date(a148_0x42931f(0x100));export function createDeterministicZipPackage(_0x396b00){const _0x3039be=a148_0x42931f,_0x539d26={};for(const _0x4b48ba of normalizeLocalFiles(_0x396b00)){_0x539d26[_0x4b48ba[_0x3039be(0x111)]]=fileContent(_0x4b48ba);}return Buffer[_0x3039be(0x106)](zipSync(_0x539d26,{'level':0x0,'mtime':ZIP_MTIME}));}export function parseZipPackage(_0x28010b){const _0x488c5b=a148_0x42931f;if(_0x28010b[_0x488c5b(0x112)]<0x16)throw CliErrors[_0x488c5b(0x10f)]('Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.');let _0x32777a;try{_0x32777a=unzipSync(_0x28010b,{'filter'(_0x4f5f7c){const _0x2a431a=_0x488c5b,_0x3f9638=normalizeSkillRelativePath(_0x4f5f7c[_0x2a431a(0xfc)]);if(_0x3f9638[_0x2a431a(0x10b)]('/'))throw CliErrors[_0x2a431a(0x10f)](_0x2a431a(0x113)+_0x3f9638);return!![];}});}catch(_0x17ecdb){if(isRuntimeSkillValidationError(_0x17ecdb))throw _0x17ecdb;throw CliErrors[_0x488c5b(0x10f)](_0x488c5b(0x10d));}return Object['entries'](_0x32777a)[_0x488c5b(0xfd)](([_0xbb102,_0x5ee852])=>({'path':normalizeSkillRelativePath(_0xbb102),'bytes':Buffer[_0x488c5b(0x106)](_0x5ee852)}))[_0x488c5b(0x108)](compareSkillFiles);}function isRuntimeSkillValidationError(_0x4ff371){const _0xf9426d=a148_0x42931f;return typeof _0x4ff371==='object'&&_0x4ff371!==null&&_0xf9426d(0x10c)in _0x4ff371&&_0x4ff371[_0xf9426d(0x10c)]===_0xf9426d(0x105);}
|