@lovrabet/lovrabet-cli 2.1.22-beta.2 → 2.1.22-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli.js +1 -1
- package/lib/commands/api-doc/index.js +1 -1
- package/lib/commands/app/cache.js +1 -1
- package/lib/commands/app/definitions.js +1 -1
- package/lib/commands/app/eligibility.js +1 -1
- package/lib/commands/app/mock-loader.js +1 -1
- package/lib/commands/app/remote-source.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/artifact/index.js +1 -1
- package/lib/commands/auth/device.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/auth/prompt.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/exec.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/common/config-policy.js +1 -1
- package/lib/commands/common/constraints.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/config/definitions.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/sdk-doc.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/personal-bff/index.js +1 -1
- package/lib/commands/registry.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/workspace/index.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/app.js +1 -1
- package/lib/constant/auth-mode.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/distribution.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/product.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/preparse.js +1 -1
- package/lib/framework/rate-limit.js +1 -1
- package/lib/framework/raw-flags.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-confirmation.js +1 -1
- package/lib/framework/runner-error.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/service-order.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/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/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/utils/apply-jq-filter.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/lossless-json.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
package/lib/runtime/resolve.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x366c14,_0x34bb56){const _0x396f90=a103_0x3e34,_0x1c6d93=_0x366c14();while(!![]){try{const _0x2e0db0=-parseInt(_0x396f90(0x192))/0x1*(parseInt(_0x396f90(0x18a))/0x2)+parseInt(_0x396f90(0x185))/0x3+parseInt(_0x396f90(0x18e))/0x4*(parseInt(_0x396f90(0x17e))/0x5)+parseInt(_0x396f90(0x189))/0x6*(-parseInt(_0x396f90(0x182))/0x7)+parseInt(_0x396f90(0x191))/0x8*(-parseInt(_0x396f90(0x183))/0x9)+parseInt(_0x396f90(0x187))/0xa*(parseInt(_0x396f90(0x186))/0xb)+parseInt(_0x396f90(0x188))/0xc;if(_0x2e0db0===_0x34bb56)break;else _0x1c6d93['push'](_0x1c6d93['shift']());}catch(_0x2ea061){_0x1c6d93['push'](_0x1c6d93['shift']());}}}(a103_0x2e85,0x7f1d0));import a103_0x28461f from'meow';import{findDefinition,getServiceEntry,isKnownService}from'../commands/registry.js';function a103_0x2e85(){const _0x2cda87=['2196xRrVVa','95486wVKyzV','slice','Lovrabet\x20argv\x20must\x20include\x20a\x20service\x20and\x20command.','defaultCommand','1532760VyaDtW','validation','definition','6707368kybZdD','18EdHEHh','unknownCommand','join','flatMap','10Rmxkxu','assign','Lovrabet\x20argv\x20must\x20include\x20a\x20command\x20for\x20service\x20\x22','../commands/registry.js','18991AOGniT','9IgKQOS','flags','1913697rOSMWN','121bgcjmU','128220rzRHtn','19993056Vlbmyt'];a103_0x2e85=function(){return _0x2cda87;};return a103_0x2e85();}import{resolveDynamicServiceCommand}from'../commands/service/dynamic.js';function a103_0x3e34(_0x1eb872,_0x1dc031){_0x1eb872=_0x1eb872-0x17d;const _0x2e85c7=a103_0x2e85();let _0x3e3435=_0x2e85c7[_0x1eb872];return _0x3e3435;}import{buildMeowFlags}from'../constant/cli.js';import{CliErrors}from'../errors.js';export async function resolveLovrabetInvocation(_0x313213){const _0x1e35c9=a103_0x3e34,_0x213f09=a103_0x28461f('',{'importMeta':import.meta,'argv':_0x313213,'flags':buildMeowFlags(),'autoHelp':![],'autoVersion':![]}),_0x59d34c=[..._0x213f09['input']],_0x425af6=_0x213f09[_0x1e35c9(0x184)];await correctFlags(_0x425af6);const _0x29e40f=_0x59d34c[0x0];if(!_0x29e40f)throw CliErrors[_0x1e35c9(0x18f)](_0x1e35c9(0x18c));if(!isKnownService(_0x29e40f)){const _0x5cb803=resolveDynamicServiceCommand(_0x59d34c,_0x425af6);if(!_0x5cb803)throw CliErrors['unknownCommand'](_0x59d34c[_0x1e35c9(0x194)]('\x20'));return Object[_0x1e35c9(0x17f)](_0x425af6,_0x5cb803[_0x1e35c9(0x184)]),{'definition':_0x5cb803[_0x1e35c9(0x190)],'rawFlags':_0x425af6,'args':_0x5cb803['args']};}const _0x27d057=getServiceEntry(_0x29e40f),_0x184c6e=_0x59d34c[0x1]||_0x27d057[_0x1e35c9(0x18d)];if(!_0x184c6e)throw CliErrors[_0x1e35c9(0x18f)](_0x1e35c9(0x180)+_0x29e40f+'\x22.');const _0x41507f=findDefinition(_0x29e40f,_0x184c6e);if(!_0x41507f)throw CliErrors[_0x1e35c9(0x193)](_0x29e40f+'\x20'+_0x184c6e);return{'definition':_0x41507f,'rawFlags':_0x425af6,'args':_0x59d34c[_0x1e35c9(0x18b)](0x2)};}async function correctFlags(_0x429732){const _0x1538ba=a103_0x3e34;try{const {correctFlags:_0xeddf06}=await import('../framework/preparse.js'),{getAllDefinitions:_0x46ed40}=await import(_0x1538ba(0x181)),_0x413d02=_0x46ed40()[_0x1538ba(0x17d)](_0x357629=>_0x357629['flags']??[]),_0x545e23=_0xeddf06(_0x429732,_0x413d02);Object['assign'](_0x429732,_0x545e23['flags']);}catch{}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a105_0x2ebf44=a105_0x2a11;function a105_0x2a11(_0x3ca540,_0x50812e){_0x3ca540=_0x3ca540-0x123;const _0x8c2337=a105_0x8c23();let _0x2a11c8=_0x8c2337[_0x3ca540];return _0x2a11c8;}(function(_0x4e3326,_0x54234b){const _0x2623d4=a105_0x2a11,_0x106777=_0x4e3326();while(!![]){try{const _0x36fea3=-parseInt(_0x2623d4(0x135))/0x1*(-parseInt(_0x2623d4(0x13c))/0x2)+parseInt(_0x2623d4(0x12f))/0x3+-parseInt(_0x2623d4(0x125))/0x4*(-parseInt(_0x2623d4(0x131))/0x5)+parseInt(_0x2623d4(0x12a))/0x6+-parseInt(_0x2623d4(0x13a))/0x7+-parseInt(_0x2623d4(0x12b))/0x8*(parseInt(_0x2623d4(0x124))/0x9)+-parseInt(_0x2623d4(0x128))/0xa*(parseInt(_0x2623d4(0x12d))/0xb);if(_0x36fea3===_0x54234b)break;else _0x106777['push'](_0x106777['shift']());}catch(_0x2798b7){_0x106777['push'](_0x106777['shift']());}}}(a105_0x8c23,0x5bdc2));import{spawnSync}from'node:child_process';import{resolveNpmBin}from'../utils/platform.js';import{LOVRABET_SKILL_SOURCE as a105_0x39170d}from'../constant/distribution.js';import{PRODUCT_CONFIG,productEnvName}from'../constant/product.js';export const LOVRABET_SKILL_SOURCE=a105_0x39170d;export const LOVRABET_SKIP_NPX_SKILLS_ENV=productEnvName(PRODUCT_CONFIG[a105_0x2ebf44(0x137)]);export function shouldSkipNpxSkillsAdd(){return process.env[LOVRABET_SKIP_NPX_SKILLS_ENV]==='1';}export function runNpxSkillsAddGlobal(_0x3c5e28,_0x17659c=LOVRABET_SKILL_SOURCE,_0xe1ffc6){const _0x36eb99=a105_0x2ebf44;if(shouldSkipNpxSkillsAdd())return{'ok':!![],'status':0x0,'skipped':!![]};const _0x51b316=_0xe1ffc6?.[_0x36eb99(0x132)]??_0x36eb99(0x129),_0x146994=resolveNpmBin(_0x36eb99(0x138)),_0x4f5576=[_0x36eb99(0x136),_0x36eb99(0x13b),_0x17659c,'-g','-y'],_0x497b02=[_0x146994,..._0x4f5576][_0x36eb99(0x126)]('\x20');console[_0x36eb99(0x139)]('*\x20'+_0x497b02);const _0x41212e=spawnSync(_0x146994,_0x4f5576,{'cwd':_0x3c5e28,'stdio':_0x51b316,'env':process.env,'shell':![]});if(_0x41212e[_0x36eb99(0x12c)]===0x0)return{'ok':!![],'status':0x0};let _0x37c9a6=_0x36eb99(0x134)+(_0x41212e[_0x36eb99(0x12c)]??'unknown');if(_0x51b316===_0x36eb99(0x133)){const _0x2980f6=_0x41212e[_0x36eb99(0x12e)]?_0x41212e[_0x36eb99(0x12e)]['toString']()[_0x36eb99(0x127)]():'',_0x99830c=_0x41212e[_0x36eb99(0x123)]?_0x41212e[_0x36eb99(0x123)][_0x36eb99(0x130)]()[_0x36eb99(0x127)]():'';if(_0x2980f6)_0x37c9a6=_0x2980f6;else{if(_0x99830c)_0x37c9a6=_0x99830c;}}return{'ok':![],'status':_0x41212e[_0x36eb99(0x12c)]??null,'error':_0x37c9a6};}function a105_0x8c23(){const _0x16ad45=['1TMQOpZ','skills','skipNpxSkillsEnvSuffix','npx','log','3925194uQumPF','add','863354BzPdsn','stdout','1701GVSdsG','36iMqRbl','join','trim','1167360hDswwM','inherit','3835710RgWRAY','25728Lpoyfb','status','22Crqrdl','stderr','912564Rwabzd','toString','223970unjlDj','stdio','pipe','exit\x20'];a105_0x8c23=function(){return _0x16ad45;};return a105_0x8c23();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a106_0x40885f=a106_0x2e96;function a106_0x2e96(_0x5f054d,_0x5ab9b1){_0x5f054d=_0x5f054d-0x7b;const _0x31e38c=a106_0x31e3();let _0x2e965b=_0x31e38c[_0x5f054d];return _0x2e965b;}(function(_0x4f7ccb,_0x21748d){const _0x1e8f36=a106_0x2e96,_0x1c38ea=_0x4f7ccb();while(!![]){try{const _0x3ca744=-parseInt(_0x1e8f36(0x8b))/0x1*(-parseInt(_0x1e8f36(0x89))/0x2)+parseInt(_0x1e8f36(0x8d))/0x3+parseInt(_0x1e8f36(0x7b))/0x4+parseInt(_0x1e8f36(0x81))/0x5+-parseInt(_0x1e8f36(0x85))/0x6+parseInt(_0x1e8f36(0x87))/0x7+-parseInt(_0x1e8f36(0x7d))/0x8*(parseInt(_0x1e8f36(0x8a))/0x9);if(_0x3ca744===_0x21748d)break;else _0x1c38ea['push'](_0x1c38ea['shift']());}catch(_0x3c74a4){_0x1c38ea['push'](_0x1c38ea['shift']());}}}(a106_0x31e3,0x1b0ae));export const METADATA_FILE=a106_0x40885f(0x7c);export const SKILL_FILE=a106_0x40885f(0x82);function a106_0x31e3(){const _0x52b051=['.cache','522387OFojcc','305504drNYlP','lovrabet.skill.json','25496huBgQm','build','.turbo','.DS_Store','468545dBWzGf','SKILL.md','dist','.next','508590bUkKpm','.git','631407LTIhaI','node_modules','39076UqaiuG','1116dUbkwl','8EnbKio'];a106_0x31e3=function(){return _0x52b051;};return a106_0x31e3();}export const IGNORED_FILE_NAMES=new Set([METADATA_FILE,a106_0x40885f(0x80)]);export const IGNORED_DIR_NAMES=new Set([a106_0x40885f(0x86),'.hg','.svn',a106_0x40885f(0x88),a106_0x40885f(0x84),a106_0x40885f(0x83),a106_0x40885f(0x7e),'coverage',a106_0x40885f(0x7f),a106_0x40885f(0x8c)]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x37c8c9,_0x5c141e){const _0x1662d2=a107_0x3cf0,_0x121a3e=_0x37c8c9();while(!![]){try{const _0x1e6987=parseInt(_0x1662d2(0xef))/0x1+parseInt(_0x1662d2(0xe8))/0x2*(-parseInt(_0x1662d2(0xe7))/0x3)+parseInt(_0x1662d2(0xf6))/0x4*(-parseInt(_0x1662d2(0xea))/0x5)+parseInt(_0x1662d2(0xec))/0x6*(-parseInt(_0x1662d2(0xf2))/0x7)+parseInt(_0x1662d2(0xe9))/0x8+-parseInt(_0x1662d2(0xf7))/0x9*(parseInt(_0x1662d2(0xf3))/0xa)+parseInt(_0x1662d2(0xf8))/0xb;if(_0x1e6987===_0x5c141e)break;else _0x121a3e['push'](_0x121a3e['shift']());}catch(_0x27c595){_0x121a3e['push'](_0x121a3e['shift']());}}}(a107_0x1c0c,0x71245));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(_0x3f9036,_0x226899){const _0x5d2c87=a107_0x3cf0,_0x240a30=normalizeSkillRelativePath(_0x226899),_0x4594e2=realOrResolved(_0x3f9036),_0x3fa0e0=resolve(_0x4594e2,..._0x240a30[_0x5d2c87(0xf0)]('/'));if(!isPathInside(_0x3fa0e0,_0x4594e2))throw CliErrors[_0x5d2c87(0xf4)](_0x5d2c87(0xf5)+_0x226899);return ensureNoSymlinkInManagedPath(_0x4594e2,_0x240a30),_0x3fa0e0;}export function ensureNoSymlinkInManagedPath(_0x23fa3f,_0x146a39){const _0x347b4b=a107_0x3cf0;let _0x3129f8=_0x23fa3f;for(const _0x35629d of _0x146a39['split']('/')){_0x3129f8=resolve(_0x3129f8,_0x35629d);const _0x194a1f=lstatIfPresent(_0x3129f8);if(_0x194a1f?.[_0x347b4b(0xee)]())throw CliErrors[_0x347b4b(0xf4)](_0x347b4b(0xfb)+_0x146a39);}}export function isDanglingSymlink(_0x33e07a){const _0x40a707=a107_0x3cf0;try{return lstatSync(_0x33e07a)[_0x40a707(0xee)]();}catch{return![];}}export function resolveSymlinkTarget(_0x4ab877){const _0x5087a1=readlinkSync(_0x4ab877);return isAbsolute(_0x5087a1)?_0x5087a1:resolve(dirname(_0x4ab877),_0x5087a1);}export function isPathInside(_0x133cdc,_0x2b56a8){const _0x55608d=a107_0x3cf0,_0x5109c3=_0x133cdc[_0x55608d(0xf9)](sep)?_0x133cdc:''+_0x133cdc+sep,_0x5ea913=_0x2b56a8[_0x55608d(0xf9)](sep)?_0x2b56a8:''+_0x2b56a8+sep;return _0x133cdc===_0x2b56a8||_0x5109c3['startsWith'](_0x5ea913);}export function realOrResolved(_0x4850fc){try{return realpathSync(_0x4850fc);}catch{return resolve(_0x4850fc);}}export function lstatIfPresent(_0xabe706){try{return lstatSync(_0xabe706);}catch{return undefined;}}function a107_0x1c0c(){const _0x1a6fb2=['1614oBRrKW','.tmp','isSymbolicLink','761669vNJdDL','split','utf8','19691wEQjyp','260LNRoMP','validation','Unsafe\x20Skill\x20file\x20path:\x20','2522396DEhUZK','219609sBuPmW','24475759QPREeL','endsWith','from','Refusing\x20to\x20write\x20through\x20Skill\x20symlink\x20path:\x20','6qSALoW','528648QkMslB','216488nkaBAY','5ZRQUxq','stringify'];a107_0x1c0c=function(){return _0x1a6fb2;};return a107_0x1c0c();}export function writeTextAtomic(_0x560cc0,_0x3f8f8d,_0x1529eb){const _0x38d2fa=a107_0x3cf0;writeBytesAtomic(_0x560cc0,Buffer[_0x38d2fa(0xfa)](_0x3f8f8d,_0x38d2fa(0xf1)),_0x1529eb);}export function writeBytesAtomic(_0x15bf0b,_0x436d85,_0x282efa){const _0x5e9997=a107_0x3cf0,_0x1ae588=_0x15bf0b+_0x5e9997(0xed);try{writeFileSync(_0x1ae588,_0x436d85,{'mode':_0x282efa}),renameSync(_0x1ae588,_0x15bf0b);}catch(_0x529c40){try{rmSync(_0x1ae588,{'force':!![]});}catch{}throw _0x529c40;}}function a107_0x3cf0(_0x3f1d93,_0x4bbc0f){_0x3f1d93=_0x3f1d93-0xe7;const _0x1c0c70=a107_0x1c0c();let _0x3cf0d5=_0x1c0c70[_0x3f1d93];return _0x3cf0d5;}export function writeJsonAtomic(_0x6a359f,_0x1e06da){const _0x40bf48=a107_0x3cf0;writeTextAtomic(_0x6a359f,JSON[_0x40bf48(0xeb)](_0x1e06da,null,0x2)+'\x0a',0x180);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x150575,_0x5cc371){const _0x2d2a93=a108_0x107f,_0x12b283=_0x150575();while(!![]){try{const _0xfd3308=-parseInt(_0x2d2a93(0x7a))/0x1*(parseInt(_0x2d2a93(0x73))/0x2)+parseInt(_0x2d2a93(0x75))/0x3*(-parseInt(_0x2d2a93(0x74))/0x4)+parseInt(_0x2d2a93(0x71))/0x5*(parseInt(_0x2d2a93(0x6f))/0x6)+parseInt(_0x2d2a93(0x6b))/0x7*(-parseInt(_0x2d2a93(0x6c))/0x8)+parseInt(_0x2d2a93(0x6a))/0x9+-parseInt(_0x2d2a93(0x78))/0xa+-parseInt(_0x2d2a93(0x6e))/0xb*(-parseInt(_0x2d2a93(0x70))/0xc);if(_0xfd3308===_0x5cc371)break;else _0x12b283['push'](_0x12b283['shift']());}catch(_0x31cd41){_0x12b283['push'](_0x12b283['shift']());}}}(a108_0x4af7,0xd9a71));import{createHash}from'node:crypto';import{fileContent,normalizeManifestFiles}from'./local-files.js';export function contentHash(_0xa44ffd){const _0x48986d=a108_0x107f;return createHash(_0x48986d(0x76))[_0x48986d(0x72)](_0xa44ffd)[_0x48986d(0x79)](_0x48986d(0x6d));}function a108_0x107f(_0x5a1a42,_0x42fdea){_0x5a1a42=_0x5a1a42-0x6a;const _0x4af7a7=a108_0x4af7();let _0x107ff3=_0x4af7a7[_0x5a1a42];return _0x107ff3;}function a108_0x4af7(){const _0x333dfc=['path','17687740PZpNbO','digest','1GMQErD','size','13356747cMzocv','7kQQKNA','4694552NNlftL','hex','34056djYpTC','24618rnyeax','11292HvMXTh','780MLfETp','update','271186XDLUAy','3309592BlTQad','6qQHCkm','sha256'];a108_0x4af7=function(){return _0x333dfc;};return a108_0x4af7();}export function fileHash(_0x44a005){return bufferSha256(fileContent(_0x44a005));}export function bufferSha256(_0x2f5495){const _0x100af2=a108_0x107f;return createHash('sha256')[_0x100af2(0x72)](_0x2f5495)[_0x100af2(0x79)]('hex');}export function fileTreeHash(_0x19f213){const _0x4ca64e=a108_0x107f,_0x22fb6b=createHash(_0x4ca64e(0x76));for(const _0x21ca3c of normalizeManifestFiles(_0x19f213)){_0x22fb6b['update'](_0x21ca3c[_0x4ca64e(0x77)]),_0x22fb6b['update']('\x00'),_0x22fb6b[_0x4ca64e(0x72)](_0x21ca3c[_0x4ca64e(0x76)]),_0x22fb6b[_0x4ca64e(0x72)]('\x00'),_0x22fb6b[_0x4ca64e(0x72)](String(_0x21ca3c[_0x4ca64e(0x7b)])),_0x22fb6b[_0x4ca64e(0x72)]('\x00');}return _0x22fb6b[_0x4ca64e(0x79)](_0x4ca64e(0x6d));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x58317b,_0x5ad293){const _0x211424=a109_0x48c7,_0x832fe4=_0x58317b();while(!![]){try{const _0x5c349a=parseInt(_0x211424(0xff))/0x1+-parseInt(_0x211424(0x105))/0x2+-parseInt(_0x211424(0x101))/0x3*(parseInt(_0x211424(0xfb))/0x4)+parseInt(_0x211424(0x108))/0x5*(-parseInt(_0x211424(0xfd))/0x6)+-parseInt(_0x211424(0x109))/0x7*(parseInt(_0x211424(0x104))/0x8)+parseInt(_0x211424(0xfe))/0x9+parseInt(_0x211424(0xfc))/0xa;if(_0x5c349a===_0x5ad293)break;else _0x832fe4['push'](_0x832fe4['shift']());}catch(_0x43c297){_0x832fe4['push'](_0x832fe4['shift']());}}}(a109_0x38e1,0xec7a1));import{resolve}from'node:path';import{resolveSkillSyncPaths,runtimeAgentSkillRoots,safePathSegment}from'./paths.js';function a109_0x48c7(_0x1b257d,_0x3face7){_0x1b257d=_0x1b257d-0xfb;const _0x38e15e=a109_0x38e1();let _0x48c724=_0x38e15e[_0x1b257d];return _0x48c724;}function a109_0x38e1(){const _0x2be499=['87zBRvku','freeze','skills','6119632wDNjGo','2415072YFyHZQ','appCode','cwd','755fTSqCH','7TvROoa','managedRoot','6092KLZyOX','16966240PELNYf','8850QRzRlR','6807600kxMZIi','754967leqLoP','.agents'];a109_0x38e1=function(){return _0x2be499;};return a109_0x38e1();}export function resolveRuntimeSkillInstallTarget(_0x3bfede,_0x138e06='global',_0x480313={}){const _0x836d65=a109_0x48c7,_0x4c706a=resolveSkillSyncPaths(_0x480313),_0x50b796=safePathSegment(_0x3bfede,_0x836d65(0x106)),_0x273fba=_0x138e06==='project'?[resolve(_0x480313[_0x836d65(0x107)]??process['cwd'](),_0x836d65(0x100),_0x836d65(0x103))]:runtimeAgentSkillRoots(_0x4c706a);return Object[_0x836d65(0x102)]({'scope':_0x138e06,'appCode':_0x50b796,'skillRoots':Object[_0x836d65(0x102)](_0x273fba),'managedRoot':_0x4c706a[_0x836d65(0x10a)]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a110_0x25f8f5=a110_0x5089;(function(_0x5556ea,_0x16727d){const _0xc2c7a6=a110_0x5089,_0xe1b40d=_0x5556ea();while(!![]){try{const _0x48e69a=parseInt(_0xc2c7a6(0x150))/0x1*(-parseInt(_0xc2c7a6(0x172))/0x2)+-parseInt(_0xc2c7a6(0x173))/0x3+parseInt(_0xc2c7a6(0x156))/0x4+-parseInt(_0xc2c7a6(0x164))/0x5+-parseInt(_0xc2c7a6(0x15b))/0x6+parseInt(_0xc2c7a6(0x17f))/0x7*(-parseInt(_0xc2c7a6(0x177))/0x8)+parseInt(_0xc2c7a6(0x16b))/0x9;if(_0x48e69a===_0x16727d)break;else _0xe1b40d['push'](_0xe1b40d['shift']());}catch(_0x523f61){_0xe1b40d['push'](_0xe1b40d['shift']());}}}(a110_0x54ba,0xb02fc));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import a110_0x42ca26 from'fs-extra';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';import{isDanglingSymlink,isPathInside,lstatIfPresent,realOrResolved,resolveSymlinkTarget}from'./fs-utils.js';function a110_0x54ba(){const _0x32922f=['Refusing\x20to\x20copy\x20Skill\x20symlink:\x20','1543dfhqQv','project','metadataPath','length','set','contentHash','1466512xxyDwU','values','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20','startsWith','7214688jZnVQW','Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20','map','env','skillRoots','accessKey','runtime-observe','push','not-managed-symlink','2652985xuzFCF','pruneSkillCodes','Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20','appCode','personal','scope','Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20','37747521uUlaZt','isDirectory','external-symlink','builtin','validation','created','unchanged','344ZjMomJ','2618337pjIWdr','metadata-mismatch','dir','company','24tDdYWp','lovrabet','isSymbolicLink','scopes','skipped','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20','linked-from-protected-root','skillCode','2258473CXkGAC','get','filter','Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20','removed','protectedLinkRoots','agentsSkillsDir','has','trim','activeSkillCodes','managedRoot','skill','name','Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20','Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20'];a110_0x54ba=function(){return _0x32922f;};return a110_0x54ba();}import{readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillCacheRoot,resolveSkillSyncPaths,safePathSegment}from'./paths.js';const {copySync,ensureDirSync,removeSync}=a110_0x42ca26,RESERVED_PROJECT_SKILL_CODES=new Set([a110_0x25f8f5(0x178),a110_0x25f8f5(0x161),'secret-retriever']);export function linkEffectiveRuntimeSkills(_0x67485f,_0x240dae){const _0x5655dd=a110_0x25f8f5,_0x141d1d=new Map();for(const _0x521847 of _0x67485f){const _0x21d596=_0x521847['skill'][_0x5655dd(0x17e)];if(!_0x21d596)continue;const _0x53143a=_0x141d1d[_0x5655dd(0x180)](_0x21d596);(!_0x53143a||_0x521847[_0x5655dd(0x169)]===_0x5655dd(0x168))&&_0x141d1d[_0x5655dd(0x154)](_0x21d596,_0x521847);}const _0x264174=[];for(const _0x2a8374 of _0x141d1d[_0x5655dd(0x157)]()){const _0x30c33b=requireSkillCode(_0x2a8374['skill']),_0x354faf=readMetadataIfPresent(_0x2a8374['metadataPath']);if(_0x354faf?.['appCode']!==_0x240dae[_0x5655dd(0x167)]||_0x354faf[_0x5655dd(0x17e)]!==_0x30c33b)throw CliErrors[_0x5655dd(0x16f)](_0x5655dd(0x15c)+_0x240dae[_0x5655dd(0x167)]+':\x20'+_0x2a8374[_0x5655dd(0x152)]);const _0x18d715=runtimeSkillLinkName(_0x240dae,_0x30c33b);for(const _0x447c4b of _0x240dae[_0x5655dd(0x15f)]){_0x264174[_0x5655dd(0x162)](ensureManagedSymlink(resolve(_0x447c4b,_0x18d715),_0x2a8374['dir'],_0x240dae,_0x30c33b));}}return _0x264174;}export function pruneStaleRuntimeSkillLinks(_0xcfb6,_0x487c9b,_0x57ebdf){const _0x260bd4=a110_0x25f8f5,_0x5d5fb2=new Set([..._0x487c9b][_0x260bd4(0x15d)](_0x8434c5=>_0x8434c5[_0x260bd4(0x148)]())[_0x260bd4(0x181)](Boolean)),_0xc75592=_0x57ebdf?new Set([..._0x57ebdf][_0x260bd4(0x15d)](_0x9cf2a4=>_0x9cf2a4[_0x260bd4(0x148)]())[_0x260bd4(0x181)](Boolean)):undefined,_0x2f383f=[];for(const _0x2cc253 of _0xcfb6[_0x260bd4(0x15f)]){for(const _0x2e5fdd of managedTargetSkillLinkPaths(_0x2cc253,_0xcfb6)){const _0x4c998c=runtimeSkillCodeFromLink(_0xcfb6,_0x2e5fdd);if(_0xc75592&&!_0xc75592[_0x260bd4(0x147)](_0x4c998c))continue;if(_0x5d5fb2[_0x260bd4(0x147)](_0x4c998c))continue;_0x2f383f[_0x260bd4(0x162)](removeManagedSkillLink(_0x2e5fdd,_0xcfb6,_0x4c998c));}}return _0x2f383f;}export function pruneStaleRuntimeSkillCache(_0xbd4f51,_0x35280a={}){const _0x4ecce2=a110_0x25f8f5,_0x14a944=new Set([..._0xbd4f51[_0x4ecce2(0x149)]][_0x4ecce2(0x15d)](_0x3ce3ba=>_0x3ce3ba[_0x4ecce2(0x148)]())[_0x4ecce2(0x181)](Boolean)),_0x27f3db=_0xbd4f51[_0x4ecce2(0x165)]?new Set([..._0xbd4f51[_0x4ecce2(0x165)]][_0x4ecce2(0x15d)](_0x3fa05d=>_0x3fa05d[_0x4ecce2(0x148)]())[_0x4ecce2(0x181)](Boolean)):undefined,_0x91c51a=_0xbd4f51[_0x4ecce2(0x17a)]??['personal',_0x4ecce2(0x176)],_0x4088e7=resolve(getRuntimeSkillCacheRoot(_0xbd4f51[_0x4ecce2(0x15e)],_0xbd4f51[_0x4ecce2(0x160)],_0x35280a),safePathSegment(_0xbd4f51[_0x4ecce2(0x167)],_0x4ecce2(0x167))),_0xfd1e02=[];for(const _0x1dff2f of _0x91c51a){const _0x750b5c=resolve(_0x4088e7,_0x1dff2f);if(!existsSync(_0x750b5c))continue;for(const _0x52e607 of readdirSync(_0x750b5c,{'withFileTypes':!![]})){if(!_0x52e607[_0x4ecce2(0x16c)]())continue;const _0x24da32=_0x52e607[_0x4ecce2(0x14c)];if(_0x27f3db&&!_0x27f3db[_0x4ecce2(0x147)](_0x24da32))continue;if(_0x14a944[_0x4ecce2(0x147)](_0x24da32))continue;const _0x110416=resolve(_0x750b5c,_0x24da32),_0x233430=readMetadataIfPresent(resolve(_0x110416,METADATA_FILE));if(_0x233430?.[_0x4ecce2(0x167)]!==_0xbd4f51['appCode']||_0x233430[_0x4ecce2(0x169)]!==_0x1dff2f||_0x233430[_0x4ecce2(0x17e)]!==_0x24da32){_0xfd1e02[_0x4ecce2(0x162)]({'path':_0x110416,'action':_0x4ecce2(0x17b),'reason':_0x4ecce2(0x174)});continue;}if(isLinkedFromAnyRoot(_0x110416,_0xbd4f51[_0x4ecce2(0x145)]??[])){_0xfd1e02[_0x4ecce2(0x162)]({'path':_0x110416,'action':'skipped','reason':_0x4ecce2(0x17d)});continue;}removeSync(_0x110416),_0xfd1e02[_0x4ecce2(0x162)]({'path':_0x110416,'action':_0x4ecce2(0x183)});}}return _0xfd1e02;}export function linkGlobalRuntimeSkills(_0x3004fd,_0x1cca58={}){const _0x2e4238=a110_0x25f8f5,_0x500be2=resolveSkillSyncPaths(_0x1cca58),_0x17ee46=[];for(const _0x27b662 of _0x3004fd){if(_0x27b662[_0x2e4238(0x169)]!==_0x2e4238(0x16e))throw CliErrors[_0x2e4238(0x16f)](_0x2e4238(0x158)+_0x27b662[_0x2e4238(0x169)]);const _0x508120=requireSkillCode(_0x27b662[_0x2e4238(0x14b)]),_0x4c54c2=copyManagedSkillDirectory(_0x27b662['dir'],resolve(_0x500be2[_0x2e4238(0x146)],_0x508120));_0x17ee46[_0x2e4238(0x162)]({..._0x4c54c2,'contentHash':_0x27b662[_0x2e4238(0x155)]});}return _0x17ee46;}function ensureManagedSymlink(_0x1811cc,_0x1fb20f,_0x15aa40,_0x352070){const _0x163725=a110_0x25f8f5;mkdirSync(dirname(_0x1811cc),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x1811cc)||isDanglingSymlink(_0x1811cc)){const _0x5a71dc=lstatSync(_0x1811cc);if(!_0x5a71dc['isSymbolicLink']())throw CliErrors[_0x163725(0x16f)](_0x163725(0x159)+_0x1811cc);const _0x46bab8=resolveSymlinkTarget(_0x1811cc);if(!isPathInside(realOrResolved(_0x46bab8),realOrResolved(_0x15aa40['managedRoot'])))throw CliErrors[_0x163725(0x16f)](_0x163725(0x16a)+_0x1811cc);if(realOrResolved(_0x46bab8)===realOrResolved(_0x1fb20f))return{'path':_0x1811cc,'target':_0x1fb20f,'action':_0x163725(0x171)};const _0x1cf819=readMetadataIfPresent(resolve(_0x46bab8,METADATA_FILE));if(_0x15aa40[_0x163725(0x169)]===_0x163725(0x151)&&(_0x1cf819?.[_0x163725(0x167)]!==_0x15aa40['appCode']||_0x1cf819['skillCode']!==_0x352070))throw CliErrors[_0x163725(0x16f)](_0x163725(0x166)+_0x1811cc);return unlinkSync(_0x1811cc),symlinkSync(_0x1fb20f,_0x1811cc,_0x163725(0x175)),{'path':_0x1811cc,'target':_0x1fb20f,'action':'updated'};}return symlinkSync(_0x1fb20f,_0x1811cc,_0x163725(0x175)),{'path':_0x1811cc,'target':_0x1fb20f,'action':_0x163725(0x170)};}function managedTargetSkillLinkPaths(_0x39166d,_0xd52d){const _0x132381=a110_0x25f8f5;if(!existsSync(_0x39166d))return[];const _0x3a1380=_0xd52d['appCode']+'--';return readdirSync(_0x39166d,{'withFileTypes':!![]})[_0x132381(0x181)](_0x321dc0=>_0xd52d[_0x132381(0x169)]===_0x132381(0x151)||_0x321dc0[_0x132381(0x14c)][_0x132381(0x15a)](_0x3a1380))[_0x132381(0x15d)](_0x2cfe14=>resolve(_0x39166d,_0x2cfe14['name']));}function removeManagedSkillLink(_0x4a8228,_0x10c11e,_0x1a405e){const _0x4d5fd7=a110_0x25f8f5,_0x2bb4f3=lstatIfPresent(_0x4a8228);if(!_0x2bb4f3?.[_0x4d5fd7(0x179)]())return{'path':_0x4a8228,'action':'skipped','reason':_0x4d5fd7(0x163)};const _0x1b4118=resolveSymlinkTarget(_0x4a8228);if(!isPathInside(realOrResolved(_0x1b4118),realOrResolved(_0x10c11e[_0x4d5fd7(0x14a)])))return{'path':_0x4a8228,'action':'skipped','reason':_0x4d5fd7(0x16d)};const _0x260af3=readMetadataIfPresent(resolve(_0x1b4118,METADATA_FILE));if(_0x10c11e[_0x4d5fd7(0x169)]===_0x4d5fd7(0x151)&&(_0x260af3?.['appCode']!==_0x10c11e[_0x4d5fd7(0x167)]||_0x260af3['skillCode']!==_0x1a405e))return{'path':_0x4a8228,'action':_0x4d5fd7(0x17b),'reason':_0x4d5fd7(0x174)};return unlinkSync(_0x4a8228),{'path':_0x4a8228,'action':_0x4d5fd7(0x183)};}function a110_0x5089(_0x39c620,_0x190933){_0x39c620=_0x39c620-0x145;const _0x54bae8=a110_0x54ba();let _0x508963=_0x54bae8[_0x39c620];return _0x508963;}function isLinkedFromAnyRoot(_0x311d64,_0x1cb995){const _0x465880=a110_0x25f8f5,_0x41e7a2=realOrResolved(_0x311d64);for(const _0x373363 of _0x1cb995){if(!existsSync(_0x373363))continue;for(const _0x5bb266 of readdirSync(_0x373363,{'withFileTypes':!![]})){if(!_0x5bb266[_0x465880(0x179)]())continue;const _0xa2468f=resolve(_0x373363,_0x5bb266[_0x465880(0x14c)]);if(realOrResolved(resolveSymlinkTarget(_0xa2468f))===_0x41e7a2)return!![];}}return![];}function runtimeSkillLinkName(_0x2d1dd0,_0x58992e){const _0x4db7fc=a110_0x25f8f5,_0x4045db=safePathSegment(_0x58992e,'skillCode');if(_0x2d1dd0[_0x4db7fc(0x169)]===_0x4db7fc(0x151)&&RESERVED_PROJECT_SKILL_CODES[_0x4db7fc(0x147)](_0x4045db))throw CliErrors['validation'](_0x4db7fc(0x14e)+_0x4045db);return _0x2d1dd0[_0x4db7fc(0x169)]==='project'?_0x4045db:_0x2d1dd0[_0x4db7fc(0x167)]+'--'+_0x4045db;}function runtimeSkillCodeFromLink(_0xb44c5b,_0x33c5e4){const _0x2c7a15=a110_0x25f8f5,_0x20c0c4=basename(_0x33c5e4);return _0xb44c5b[_0x2c7a15(0x169)]===_0x2c7a15(0x151)?_0x20c0c4:_0x20c0c4['slice']((_0xb44c5b[_0x2c7a15(0x167)]+'--')[_0x2c7a15(0x153)]);}export function copyManagedSkillDirectory(_0x188501,_0x1d56bd){const _0x153738=a110_0x25f8f5,_0x5a1efd=resolve(_0x1d56bd,METADATA_FILE),_0x7cfcbf=existsSync(_0x1d56bd);if(_0x7cfcbf){const _0x327e61=lstatSync(_0x1d56bd);if(_0x327e61[_0x153738(0x179)]())throw CliErrors[_0x153738(0x16f)](_0x153738(0x14d)+_0x1d56bd);if(!_0x327e61[_0x153738(0x16c)]())throw CliErrors[_0x153738(0x16f)](_0x153738(0x182)+_0x1d56bd);const _0x489412=readMetadataIfPresent(_0x5a1efd);if(_0x489412?.['scope']!==_0x153738(0x16e))throw CliErrors[_0x153738(0x16f)](_0x153738(0x17c)+_0x1d56bd);}ensureDirSync(dirname(_0x1d56bd));const _0x4f3427=_0x7cfcbf?readMetadataIfPresent(_0x5a1efd)?.[_0x153738(0x155)]:undefined,_0x12e166=readMetadataIfPresent(resolve(_0x188501,METADATA_FILE))?.[_0x153738(0x155)];return _0x7cfcbf&&removeSync(_0x1d56bd),copySkillDirectory(_0x188501,_0x1d56bd),{'path':_0x1d56bd,'target':_0x188501,'action':!_0x7cfcbf?_0x153738(0x170):_0x4f3427===_0x12e166?'unchanged':'updated'};}function copySkillDirectory(_0x381bfc,_0xee2b93){copySync(_0x381bfc,_0xee2b93,{'dereference':![],'overwrite':!![],'filter'(_0x5da4d1){const _0x3c3c45=a110_0x5089;if(lstatSync(_0x5da4d1)[_0x3c3c45(0x179)]())throw CliErrors[_0x3c3c45(0x16f)](_0x3c3c45(0x14f)+_0x5da4d1);return!![];}});}
|
|
1
|
+
const a110_0x1f2130=a110_0x9036;(function(_0x51c0cf,_0x1e48ad){const _0x623675=a110_0x9036,_0x3bf3a5=_0x51c0cf();while(!![]){try{const _0x1d2635=-parseInt(_0x623675(0x1b7))/0x1+parseInt(_0x623675(0x1a8))/0x2*(parseInt(_0x623675(0x1b1))/0x3)+-parseInt(_0x623675(0x1b6))/0x4*(parseInt(_0x623675(0x1dc))/0x5)+-parseInt(_0x623675(0x1c2))/0x6+-parseInt(_0x623675(0x1d5))/0x7*(parseInt(_0x623675(0x1ba))/0x8)+parseInt(_0x623675(0x1c6))/0x9*(-parseInt(_0x623675(0x1a5))/0xa)+parseInt(_0x623675(0x1c1))/0xb;if(_0x1d2635===_0x1e48ad)break;else _0x3bf3a5['push'](_0x3bf3a5['shift']());}catch(_0x453273){_0x3bf3a5['push'](_0x3bf3a5['shift']());}}}(a110_0xf9fa,0x81ed7));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import a110_0x4e6c91 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 a110_0x9036(_0x1939a4,_0x1ebfc4){_0x1939a4=_0x1939a4-0x1a4;const _0xf9faa8=a110_0xf9fa();let _0x90362f=_0xf9faa8[_0x1939a4];return _0x90362f;}import{getRuntimeSkillCacheRoot,resolveSkillSyncPaths,safePathSegment}from'./paths.js';const {copySync,ensureDirSync,removeSync}=a110_0x4e6c91,RESERVED_PROJECT_SKILL_CODES=new Set(['lovrabet',a110_0x1f2130(0x1a7),'secret-retriever']);export function linkEffectiveRuntimeSkills(_0x4c461c,_0x369298){const _0x176c01=a110_0x1f2130,_0x32ae85=new Map();for(const _0x526f24 of _0x4c461c){const _0x4f4e8a=_0x526f24['skill'][_0x176c01(0x1c5)];if(!_0x4f4e8a)continue;const _0x5d9447=_0x32ae85[_0x176c01(0x1a6)](_0x4f4e8a);(!_0x5d9447||_0x526f24[_0x176c01(0x1d7)]===_0x176c01(0x1a9))&&_0x32ae85['set'](_0x4f4e8a,_0x526f24);}const _0x18acf5=[];for(const _0x4175d7 of _0x32ae85[_0x176c01(0x1a4)]()){const _0x298105=requireSkillCode(_0x4175d7['skill']),_0x4fe5b2=readMetadataIfPresent(_0x4175d7[_0x176c01(0x1b3)]);if(_0x4fe5b2?.[_0x176c01(0x1c8)]!==_0x369298[_0x176c01(0x1c8)]||_0x4fe5b2[_0x176c01(0x1c5)]!==_0x298105)throw CliErrors[_0x176c01(0x1aa)]('Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20'+_0x369298[_0x176c01(0x1c8)]+':\x20'+_0x4175d7[_0x176c01(0x1b3)]);const _0x4bef61=runtimeSkillLinkName(_0x369298,_0x298105);for(const _0x41cbda of _0x369298[_0x176c01(0x1bc)]){_0x18acf5[_0x176c01(0x1ac)](ensureManagedSymlink(resolve(_0x41cbda,_0x4bef61),_0x4175d7[_0x176c01(0x1b0)],_0x369298,_0x298105));}}return _0x18acf5;}function a110_0xf9fa(){const _0x29ab18=['32837431LTfAyr','1612818oMeDWk','Refusing\x20to\x20copy\x20Skill\x20symlink:\x20','company','skillCode','9CVtyAL','name','appCode','filter','protectedLinkRoots','managedRoot','removed','contentHash','slice','map','unchanged','project','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20','startsWith','Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20','729253DwGPtw','Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20','scope','isSymbolicLink','Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20','metadata-mismatch','created','495ybkskn','activeSkillCodes','external-symlink','values','9662330XkUEYT','get','runtime-observe','2FJFGcN','personal','validation','agentsSkillsDir','push','Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20','trim','Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20','dir','361359pUqbym','Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20','metadataPath','skipped','updated','13488RBFEUC','796269rtSsOP','length','not-managed-symlink','16wvcaNP','has','skillRoots','isDirectory','pruneSkillCodes','linked-from-protected-root','builtin'];a110_0xf9fa=function(){return _0x29ab18;};return a110_0xf9fa();}export function pruneStaleRuntimeSkillLinks(_0x11f6ef,_0x1f2156,_0x2c08db){const _0x2b0bd8=a110_0x1f2130,_0x4b8c6d=new Set([..._0x1f2156][_0x2b0bd8(0x1cf)](_0x1af763=>_0x1af763[_0x2b0bd8(0x1ae)]())[_0x2b0bd8(0x1c9)](Boolean)),_0x50e77f=_0x2c08db?new Set([..._0x2c08db][_0x2b0bd8(0x1cf)](_0x51fdd8=>_0x51fdd8[_0x2b0bd8(0x1ae)]())[_0x2b0bd8(0x1c9)](Boolean)):undefined,_0x44e11c=[];for(const _0x93b4d4 of _0x11f6ef[_0x2b0bd8(0x1bc)]){for(const _0x5855dc of managedTargetSkillLinkPaths(_0x93b4d4,_0x11f6ef)){const _0x10e7ba=runtimeSkillCodeFromLink(_0x11f6ef,_0x5855dc);if(_0x50e77f&&!_0x50e77f[_0x2b0bd8(0x1bb)](_0x10e7ba))continue;if(_0x4b8c6d[_0x2b0bd8(0x1bb)](_0x10e7ba))continue;_0x44e11c['push'](removeManagedSkillLink(_0x5855dc,_0x11f6ef,_0x10e7ba));}}return _0x44e11c;}export function pruneStaleRuntimeSkillCache(_0x17b3bd,_0x24921e={}){const _0x44f54c=a110_0x1f2130,_0x4940fa=new Set([..._0x17b3bd[_0x44f54c(0x1dd)]][_0x44f54c(0x1cf)](_0x118a34=>_0x118a34[_0x44f54c(0x1ae)]())['filter'](Boolean)),_0x33b375=_0x17b3bd[_0x44f54c(0x1be)]?new Set([..._0x17b3bd['pruneSkillCodes']][_0x44f54c(0x1cf)](_0x5bd8c2=>_0x5bd8c2['trim']())[_0x44f54c(0x1c9)](Boolean)):undefined,_0x5ad8d2=_0x17b3bd['scopes']??[_0x44f54c(0x1a9),_0x44f54c(0x1c4)],_0x125ae3=resolve(getRuntimeSkillCacheRoot(_0x17b3bd['env'],_0x17b3bd['accessKey'],_0x24921e),safePathSegment(_0x17b3bd[_0x44f54c(0x1c8)],_0x44f54c(0x1c8))),_0x28b680=[];for(const _0x2296c1 of _0x5ad8d2){const _0x129a74=resolve(_0x125ae3,_0x2296c1);if(!existsSync(_0x129a74))continue;for(const _0x50b394 of readdirSync(_0x129a74,{'withFileTypes':!![]})){if(!_0x50b394[_0x44f54c(0x1bd)]())continue;const _0x3bbee4=_0x50b394[_0x44f54c(0x1c7)];if(_0x33b375&&!_0x33b375[_0x44f54c(0x1bb)](_0x3bbee4))continue;if(_0x4940fa[_0x44f54c(0x1bb)](_0x3bbee4))continue;const _0x436d27=resolve(_0x129a74,_0x3bbee4),_0xac3532=readMetadataIfPresent(resolve(_0x436d27,METADATA_FILE));if(_0xac3532?.[_0x44f54c(0x1c8)]!==_0x17b3bd[_0x44f54c(0x1c8)]||_0xac3532[_0x44f54c(0x1d7)]!==_0x2296c1||_0xac3532[_0x44f54c(0x1c5)]!==_0x3bbee4){_0x28b680[_0x44f54c(0x1ac)]({'path':_0x436d27,'action':_0x44f54c(0x1b4),'reason':_0x44f54c(0x1da)});continue;}if(isLinkedFromAnyRoot(_0x436d27,_0x17b3bd[_0x44f54c(0x1ca)]??[])){_0x28b680[_0x44f54c(0x1ac)]({'path':_0x436d27,'action':'skipped','reason':_0x44f54c(0x1bf)});continue;}removeSync(_0x436d27),_0x28b680[_0x44f54c(0x1ac)]({'path':_0x436d27,'action':'removed'});}}return _0x28b680;}export function linkGlobalRuntimeSkills(_0x431ce4,_0x3f2c58={}){const _0x1d44ae=a110_0x1f2130,_0x3273ce=resolveSkillSyncPaths(_0x3f2c58),_0x1b1fec=[];for(const _0x30c986 of _0x431ce4){if(_0x30c986[_0x1d44ae(0x1d7)]!==_0x1d44ae(0x1c0))throw CliErrors[_0x1d44ae(0x1aa)]('Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20'+_0x30c986['scope']);const _0x435604=requireSkillCode(_0x30c986['skill']),_0x65a058=copyManagedSkillDirectory(_0x30c986[_0x1d44ae(0x1b0)],resolve(_0x3273ce[_0x1d44ae(0x1ab)],_0x435604));_0x1b1fec[_0x1d44ae(0x1ac)]({..._0x65a058,'contentHash':_0x30c986[_0x1d44ae(0x1cd)]});}return _0x1b1fec;}function ensureManagedSymlink(_0x365933,_0x3df7fa,_0x4c30af,_0x57b3ec){const _0x5774be=a110_0x1f2130;mkdirSync(dirname(_0x365933),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x365933)||isDanglingSymlink(_0x365933)){const _0x32518d=lstatSync(_0x365933);if(!_0x32518d[_0x5774be(0x1d8)]())throw CliErrors[_0x5774be(0x1aa)](_0x5774be(0x1d9)+_0x365933);const _0x3d5616=resolveSymlinkTarget(_0x365933);if(!isPathInside(realOrResolved(_0x3d5616),realOrResolved(_0x4c30af[_0x5774be(0x1cb)])))throw CliErrors['validation'](_0x5774be(0x1ad)+_0x365933);if(realOrResolved(_0x3d5616)===realOrResolved(_0x3df7fa))return{'path':_0x365933,'target':_0x3df7fa,'action':_0x5774be(0x1d0)};const _0x53b153=readMetadataIfPresent(resolve(_0x3d5616,METADATA_FILE));if(_0x4c30af['scope']===_0x5774be(0x1d1)&&(_0x53b153?.['appCode']!==_0x4c30af[_0x5774be(0x1c8)]||_0x53b153[_0x5774be(0x1c5)]!==_0x57b3ec))throw CliErrors[_0x5774be(0x1aa)](_0x5774be(0x1d4)+_0x365933);return unlinkSync(_0x365933),symlinkSync(_0x3df7fa,_0x365933,'dir'),{'path':_0x365933,'target':_0x3df7fa,'action':_0x5774be(0x1b5)};}return symlinkSync(_0x3df7fa,_0x365933,'dir'),{'path':_0x365933,'target':_0x3df7fa,'action':_0x5774be(0x1db)};}function managedTargetSkillLinkPaths(_0x6d9fa7,_0x392e11){const _0x12c4cf=a110_0x1f2130;if(!existsSync(_0x6d9fa7))return[];const _0x3d6323=_0x392e11['appCode']+'--';return readdirSync(_0x6d9fa7,{'withFileTypes':!![]})['filter'](_0x5159be=>_0x392e11[_0x12c4cf(0x1d7)]===_0x12c4cf(0x1d1)||_0x5159be[_0x12c4cf(0x1c7)][_0x12c4cf(0x1d3)](_0x3d6323))['map'](_0x1724af=>resolve(_0x6d9fa7,_0x1724af[_0x12c4cf(0x1c7)]));}function removeManagedSkillLink(_0x453593,_0x5536fc,_0x460e0b){const _0x5862ee=a110_0x1f2130,_0xcf75e4=lstatIfPresent(_0x453593);if(!_0xcf75e4?.['isSymbolicLink']())return{'path':_0x453593,'action':_0x5862ee(0x1b4),'reason':_0x5862ee(0x1b9)};const _0x510a89=resolveSymlinkTarget(_0x453593);if(!isPathInside(realOrResolved(_0x510a89),realOrResolved(_0x5536fc['managedRoot'])))return{'path':_0x453593,'action':'skipped','reason':_0x5862ee(0x1de)};const _0xce2d48=readMetadataIfPresent(resolve(_0x510a89,METADATA_FILE));if(_0x5536fc['scope']===_0x5862ee(0x1d1)&&(_0xce2d48?.['appCode']!==_0x5536fc[_0x5862ee(0x1c8)]||_0xce2d48[_0x5862ee(0x1c5)]!==_0x460e0b))return{'path':_0x453593,'action':_0x5862ee(0x1b4),'reason':_0x5862ee(0x1da)};return unlinkSync(_0x453593),{'path':_0x453593,'action':_0x5862ee(0x1cc)};}function isLinkedFromAnyRoot(_0x15426d,_0x5744e0){const _0x413a0c=realOrResolved(_0x15426d);for(const _0x21b460 of _0x5744e0){if(!existsSync(_0x21b460))continue;for(const _0x47f226 of readdirSync(_0x21b460,{'withFileTypes':!![]})){if(!_0x47f226['isSymbolicLink']())continue;const _0x339eec=resolve(_0x21b460,_0x47f226['name']);if(realOrResolved(resolveSymlinkTarget(_0x339eec))===_0x413a0c)return!![];}}return![];}function runtimeSkillLinkName(_0x20bfe4,_0x23a2da){const _0x4c7842=a110_0x1f2130,_0x577dfb=safePathSegment(_0x23a2da,_0x4c7842(0x1c5));if(_0x20bfe4[_0x4c7842(0x1d7)]===_0x4c7842(0x1d1)&&RESERVED_PROJECT_SKILL_CODES['has'](_0x577dfb))throw CliErrors[_0x4c7842(0x1aa)](_0x4c7842(0x1d6)+_0x577dfb);return _0x20bfe4[_0x4c7842(0x1d7)]===_0x4c7842(0x1d1)?_0x577dfb:_0x20bfe4[_0x4c7842(0x1c8)]+'--'+_0x577dfb;}function runtimeSkillCodeFromLink(_0x5358c5,_0x222470){const _0x5202ec=a110_0x1f2130,_0x42e2cb=basename(_0x222470);return _0x5358c5['scope']===_0x5202ec(0x1d1)?_0x42e2cb:_0x42e2cb[_0x5202ec(0x1ce)]((_0x5358c5[_0x5202ec(0x1c8)]+'--')[_0x5202ec(0x1b8)]);}export function copyManagedSkillDirectory(_0x201dac,_0x1c1428){const _0x220a72=a110_0x1f2130,_0x6c0462=resolve(_0x1c1428,METADATA_FILE),_0x16947c=existsSync(_0x1c1428);if(_0x16947c){const _0x5bf6dc=lstatSync(_0x1c1428);if(_0x5bf6dc['isSymbolicLink']())throw CliErrors[_0x220a72(0x1aa)](_0x220a72(0x1b2)+_0x1c1428);if(!_0x5bf6dc[_0x220a72(0x1bd)]())throw CliErrors[_0x220a72(0x1aa)](_0x220a72(0x1af)+_0x1c1428);const _0x49074a=readMetadataIfPresent(_0x6c0462);if(_0x49074a?.['scope']!=='builtin')throw CliErrors[_0x220a72(0x1aa)](_0x220a72(0x1d2)+_0x1c1428);}ensureDirSync(dirname(_0x1c1428));const _0x107bd8=_0x16947c?readMetadataIfPresent(_0x6c0462)?.[_0x220a72(0x1cd)]:undefined,_0x304b08=readMetadataIfPresent(resolve(_0x201dac,METADATA_FILE))?.[_0x220a72(0x1cd)];return _0x16947c&&removeSync(_0x1c1428),copySkillDirectory(_0x201dac,_0x1c1428),{'path':_0x1c1428,'target':_0x201dac,'action':!_0x16947c?_0x220a72(0x1db):_0x107bd8===_0x304b08?_0x220a72(0x1d0):_0x220a72(0x1b5)};}function copySkillDirectory(_0x12b3bc,_0x7a7e33){copySync(_0x12b3bc,_0x7a7e33,{'dereference':![],'overwrite':!![],'filter'(_0x34f44b){const _0x111b3f=a110_0x9036;if(lstatSync(_0x34f44b)[_0x111b3f(0x1d8)]())throw CliErrors['validation'](_0x111b3f(0x1c3)+_0x34f44b);return!![];}});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1727e8,_0x1f07bd){const _0x473111=a111_0x5b95,_0x53119c=_0x1727e8();while(!![]){try{const _0x4e3638=parseInt(_0x473111(0xf8))/0x1*(parseInt(_0x473111(0xe2))/0x2)+-parseInt(_0x473111(0x107))/0x3*(-parseInt(_0x473111(0xf3))/0x4)+-parseInt(_0x473111(0xf6))/0x5*(-parseInt(_0x473111(0xf1))/0x6)+parseInt(_0x473111(0x100))/0x7+parseInt(_0x473111(0xfe))/0x8+-parseInt(_0x473111(0x109))/0x9*(parseInt(_0x473111(0xec))/0xa)+-parseInt(_0x473111(0xf0))/0xb*(parseInt(_0x473111(0xea))/0xc);if(_0x4e3638===_0x1f07bd)break;else _0x53119c['push'](_0x53119c['shift']());}catch(_0x564268){_0x53119c['push'](_0x53119c['shift']());}}}(a111_0x183c,0xda647));function a111_0x183c(){const _0x21be91=['linkedPaths','3395436OoMfOo','appCode','11512840sPMaen','trim','\x20!=\x20','map','165sMGYmr','6kXGlPi','scopes','688YckbAm','code','skillMdPath','8471620xdJPAw','includes','7022CByiHm','filter','local','accessKey','name','dir','4577000UOqnSe','validation','11870705huHZaQ','tags','scope','has','startsWith','Runtime\x20Skill\x20install\x20target\x20app\x20mismatch:\x20','set','11820crZFVD','metadataPath','9bFarmv','builtin','linkedPath','isDirectory','isSymbolicLink','cacheDir','project','470RWzrcC','sort','source','link','skillCode','cache','values'];a111_0x183c=function(){return _0x21be91;};return a111_0x183c();}import{existsSync,readdirSync}from'node:fs';import{resolve}from'node:path';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{readMetadataIfPresent}from'./metadata.js';import{getRuntimeSkillCacheRoot,safePathSegment}from'./paths.js';import{isRuntimeSkillScope,normalizeRuntimeSkillScopes}from'./scopes.js';export function listLocalRuntimeSkills(_0xb06614,_0x3a4814,_0x1c07a8={}){const _0x856959=a111_0x5b95,_0x100756=safePathSegment(_0xb06614[_0x856959(0xeb)],_0x856959(0xeb));if(_0x3a4814[_0x856959(0xeb)]!==_0x100756)throw CliErrors[_0x856959(0xff)](_0x856959(0x105)+_0x3a4814[_0x856959(0xeb)]+_0x856959(0xee)+_0x100756);const _0x380e07=normalizeRuntimeSkillScopes(_0xb06614['scopes']),_0x278b3f=new Set(_0x380e07),_0x1f47bd=_0xb06614[_0x856959(0xf4)]?.[_0x856959(0xed)](),_0x170b99=new Map(),_0xd68350=resolve(getRuntimeSkillCacheRoot(_0xb06614['env'],_0xb06614[_0x856959(0xfb)],_0x1c07a8),_0x100756);for(const _0x39b99e of _0x380e07){for(const _0x153980 of localSkillEntryDirs(resolve(_0xd68350,_0x39b99e))){collectLocalRuntimeSkill(_0x170b99,_0x153980,{'appCode':_0x100756,'scopes':_0x278b3f,'code':_0x1f47bd,'source':_0x856959(0xe7)});}}for(const _0x4a0bc2 of _0x3a4814['skillRoots']){for(const _0x137cee of localSkillLinkCandidates(_0x4a0bc2,_0x3a4814,_0x278b3f)){collectLocalRuntimeSkill(_0x170b99,_0x137cee,{'appCode':_0x100756,'scopes':_0x278b3f,'code':_0x1f47bd,'source':_0x856959(0xe5),'linkedPath':_0x137cee});}}return Array['from'](_0x170b99[_0x856959(0xe8)]())[_0x856959(0xe3)](compareLocalRuntimeSkills);}function localSkillEntryDirs(_0x33f96c){const _0x2360ed=a111_0x5b95;if(!existsSync(_0x33f96c))return[];return readdirSync(_0x33f96c,{'withFileTypes':!![]})[_0x2360ed(0xf9)](_0x2aebe9=>_0x2aebe9[_0x2360ed(0xde)]()||_0x2aebe9[_0x2360ed(0xdf)]())[_0x2360ed(0xef)](_0x3d7a0b=>resolve(_0x33f96c,_0x3d7a0b['name']));}function localSkillLinkCandidates(_0x2b277e,_0x513446,_0x5518dc){const _0x40bb46=a111_0x5b95;if(!existsSync(_0x2b277e))return[];const _0x4fd76e=_0x513446[_0x40bb46(0xeb)]+'--';return readdirSync(_0x2b277e,{'withFileTypes':!![]})['filter'](_0x52498b=>_0x52498b['isDirectory']()||_0x52498b[_0x40bb46(0xdf)]())[_0x40bb46(0xf9)](_0x42aa4b=>_0x513446[_0x40bb46(0x102)]===_0x40bb46(0xe1)||_0x42aa4b[_0x40bb46(0xfc)][_0x40bb46(0x104)](_0x4fd76e)||_0x5518dc[_0x40bb46(0x103)](_0x40bb46(0xdc)))[_0x40bb46(0xef)](_0x57b8e1=>resolve(_0x2b277e,_0x57b8e1['name']));}function a111_0x5b95(_0x40e3e5,_0x31497a){_0x40e3e5=_0x40e3e5-0xdc;const _0x183c9d=a111_0x183c();let _0x5b9580=_0x183c9d[_0x40e3e5];return _0x5b9580;}function collectLocalRuntimeSkill(_0x2b7b2d,_0x17cb64,_0x3abf5c){const _0x9d31f0=a111_0x5b95,_0x4a47df=resolve(_0x17cb64,METADATA_FILE),_0x2d43e7=readMetadataIfPresent(_0x4a47df);if(!_0x2d43e7)return;if(_0x2d43e7['appCode']!==_0x3abf5c['appCode'])return;if(!isRuntimeSkillScope(_0x2d43e7[_0x9d31f0(0x102)])||!_0x3abf5c[_0x9d31f0(0xf2)][_0x9d31f0(0x103)](_0x2d43e7[_0x9d31f0(0x102)]))return;const _0x45825e=_0x2d43e7[_0x9d31f0(0xe6)]?.[_0x9d31f0(0xed)]();if(!_0x45825e)return;if(_0x3abf5c['code']&&_0x45825e!==_0x3abf5c['code'])return;const _0x1c51f4=_0x2d43e7[_0x9d31f0(0x102)]+':'+_0x45825e,_0x5d7ef7=_0x3abf5c['linkedPath']?[_0x3abf5c[_0x9d31f0(0xdd)]]:[],_0x4293f8=_0x2b7b2d['get'](_0x1c51f4);if(_0x4293f8){_0x3abf5c[_0x9d31f0(0xe4)]===_0x9d31f0(0xe7)&&(_0x4293f8['dir']=_0x17cb64,_0x4293f8[_0x9d31f0(0xe0)]=_0x17cb64,_0x4293f8[_0x9d31f0(0xf5)]=resolve(_0x17cb64,SKILL_FILE),_0x4293f8[_0x9d31f0(0x108)]=_0x4a47df);for(const _0x583a08 of _0x5d7ef7){!_0x4293f8[_0x9d31f0(0xe9)][_0x9d31f0(0xf7)](_0x583a08)&&_0x4293f8['linkedPaths']['push'](_0x583a08);}_0x4293f8['linkedPaths'][_0x9d31f0(0xe3)]();return;}_0x2b7b2d[_0x9d31f0(0x106)](_0x1c51f4,{..._0x2d43e7,'tags':Array['isArray'](_0x2d43e7[_0x9d31f0(0x101)])?_0x2d43e7[_0x9d31f0(0x101)]:[],'scope':_0x2d43e7[_0x9d31f0(0x102)],'source':_0x9d31f0(0xfa),'dir':_0x17cb64,'cacheDir':_0x3abf5c[_0x9d31f0(0xe4)]==='cache'?_0x17cb64:undefined,'skillMdPath':resolve(_0x17cb64,SKILL_FILE),'metadataPath':_0x4a47df,'linkedPaths':_0x5d7ef7});}function compareLocalRuntimeSkills(_0x1b2898,_0x36fa9f){const _0x49e4b7=a111_0x5b95,_0x19dad0={'personal':0x0,'company':0x1,'builtin':0x2};return _0x19dad0[_0x1b2898[_0x49e4b7(0x102)]]-_0x19dad0[_0x36fa9f['scope']]||_0x1b2898[_0x49e4b7(0xe6)]['localeCompare'](_0x36fa9f[_0x49e4b7(0xe6)])||_0x1b2898[_0x49e4b7(0xfd)]['localeCompare'](_0x36fa9f[_0x49e4b7(0xfd)]);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3b3a7e,_0x38d55f){const _0x3bb3b9=a112_0x5b25,_0x138698=_0x3b3a7e();while(!![]){try{const _0x345d61=-parseInt(_0x3bb3b9(0x127))/0x1*(parseInt(_0x3bb3b9(0x13b))/0x2)+parseInt(_0x3bb3b9(0x138))/0x3*(parseInt(_0x3bb3b9(0x134))/0x4)+-parseInt(_0x3bb3b9(0x140))/0x5+-parseInt(_0x3bb3b9(0x136))/0x6*(parseInt(_0x3bb3b9(0x12a))/0x7)+parseInt(_0x3bb3b9(0x12f))/0x8*(parseInt(_0x3bb3b9(0x125))/0x9)+-parseInt(_0x3bb3b9(0x144))/0xa*(-parseInt(_0x3bb3b9(0x128))/0xb)+parseInt(_0x3bb3b9(0x126))/0xc;if(_0x345d61===_0x38d55f)break;else _0x138698['push'](_0x138698['shift']());}catch(_0x2762fb){_0x138698['push'](_0x138698['shift']());}}}(a112_0x104b,0x43707));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(_0x23734d){const _0x4d2926=a112_0x5b25;return _0x23734d['bytes']??Buffer[_0x4d2926(0x11c)](_0x23734d[_0x4d2926(0x118)]??'',_0x4d2926(0x11b));}function a112_0x104b(){const _0x2f539c=['utf8','from','values','has','toString','isArray','push','Skill\x20file\x20size\x20is\x20invalid:\x20','validation','Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20','36lXDFlP','5582172GBOxZR','1UXWIJJ','11693XIFAhc','length','7oAQESt','startsWith','Unsafe\x20Skill\x20file\x20path:\x20','Duplicate\x20Skill\x20file\x20path:\x20','sort','293464YOWDzg','string','name','Skill\x20file\x20sha256\x20is\x20invalid:\x20','object','616300hFNpAw','size','1736424OxrCVz','isSymbolicLink','6TlspJS','isFile','split','519704DeVZmj','bytes','Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20','set','toLowerCase','1376430VgUMcb','path','compare','sha256','1700jWOBQc','isSafeInteger','isBuffer','replace','content','isDirectory','Skill\x20file\x20path\x20must\x20be\x20text.'];a112_0x104b=function(){return _0x2f539c;};return a112_0x104b();}export function fileText(_0x45d565){const _0x3aa535=a112_0x5b25;return fileContent(_0x45d565)[_0x3aa535(0x11f)](_0x3aa535(0x11b));}export function normalizeLocalFiles(_0x1894da){const _0x511850=a112_0x5b25;if(!Array[_0x511850(0x120)](_0x1894da)||_0x1894da[_0x511850(0x129)]===0x0)return[];const _0x4f9b74=new Map();for(const _0x40139c of _0x1894da){if(!_0x40139c||typeof _0x40139c!==_0x511850(0x133)||typeof _0x40139c[_0x511850(0x141)]!==_0x511850(0x130))throw CliErrors['validation']('Skill\x20file\x20path\x20must\x20be\x20text.');const _0x41158b=normalizeSkillRelativePath(_0x40139c[_0x511850(0x141)]);if(_0x4f9b74['has'](_0x41158b))throw CliErrors[_0x511850(0x123)]('Duplicate\x20Skill\x20file\x20path:\x20'+_0x41158b);if(_0x40139c[_0x511850(0x13c)]!==undefined&&!Buffer[_0x511850(0x116)](_0x40139c[_0x511850(0x13c)]))throw CliErrors[_0x511850(0x123)](_0x511850(0x13d)+_0x41158b);if(_0x40139c[_0x511850(0x13c)]===undefined&&typeof _0x40139c[_0x511850(0x118)]!==_0x511850(0x130))throw CliErrors[_0x511850(0x123)](_0x511850(0x124)+_0x41158b);const _0xb8dddb=fileContent(_0x40139c);_0x4f9b74[_0x511850(0x13e)](_0x41158b,{'path':_0x41158b,'bytes':_0xb8dddb});}return Array[_0x511850(0x11c)](_0x4f9b74[_0x511850(0x11d)]())[_0x511850(0x12e)](compareSkillFiles);}export function normalizeManifestFiles(_0x325b3f){const _0xe28165=a112_0x5b25;if(!Array[_0xe28165(0x120)](_0x325b3f)||_0x325b3f[_0xe28165(0x129)]===0x0)return[];const _0x22fa82=new Map();for(const _0xc562b7 of _0x325b3f){if(!_0xc562b7||typeof _0xc562b7!==_0xe28165(0x133)||typeof _0xc562b7[_0xe28165(0x141)]!==_0xe28165(0x130))throw CliErrors[_0xe28165(0x123)](_0xe28165(0x11a));const _0xcd9d2e=normalizeSkillRelativePath(_0xc562b7[_0xe28165(0x141)]);if(_0x22fa82[_0xe28165(0x11e)](_0xcd9d2e))throw CliErrors['validation'](_0xe28165(0x12d)+_0xcd9d2e);if(!isSha256Hex(_0xc562b7[_0xe28165(0x143)]))throw CliErrors[_0xe28165(0x123)](_0xe28165(0x132)+_0xcd9d2e);if(!Number[_0xe28165(0x115)](_0xc562b7[_0xe28165(0x135)])||_0xc562b7[_0xe28165(0x135)]<0x0)throw CliErrors[_0xe28165(0x123)](_0xe28165(0x122)+_0xcd9d2e);_0x22fa82[_0xe28165(0x13e)](_0xcd9d2e,{'path':_0xcd9d2e,'sha256':_0xc562b7[_0xe28165(0x143)][_0xe28165(0x13f)](),'size':_0xc562b7[_0xe28165(0x135)]});}return Array[_0xe28165(0x11c)](_0x22fa82['values']())['sort'](compareSkillFiles);}export function scanSkillDirectory(_0x184f9c){const _0x512add=realpathSync(_0x184f9c),_0x39e2d1=[];function _0x34cb2e(_0x3a5734){const _0x386cf1=a112_0x5b25,_0x58f1b6=readdirSync(_0x3a5734,{'withFileTypes':!![]})['sort']((_0x4a6020,_0x43f00a)=>_0x4a6020[_0x386cf1(0x131)]['localeCompare'](_0x43f00a[_0x386cf1(0x131)]));for(const _0x449ece of _0x58f1b6){if(_0x449ece[_0x386cf1(0x119)]()&&IGNORED_DIR_NAMES[_0x386cf1(0x11e)](_0x449ece[_0x386cf1(0x131)]))continue;if(IGNORED_FILE_NAMES[_0x386cf1(0x11e)](_0x449ece['name']))continue;const _0x413ead=resolve(_0x3a5734,_0x449ece['name']);if(_0x449ece[_0x386cf1(0x137)]())throw CliErrors[_0x386cf1(0x123)]('Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20'+_0x413ead);const _0x4539b4=toPosixPath(relative(_0x512add,_0x413ead));if(_0x449ece[_0x386cf1(0x119)]()){_0x34cb2e(_0x413ead);continue;}if(!_0x449ece[_0x386cf1(0x139)]())continue;validateSkillRelativePath(_0x4539b4);const _0x1e9212=readFileSync(_0x413ead);_0x39e2d1[_0x386cf1(0x121)]({'path':_0x4539b4,'bytes':_0x1e9212});}}return _0x34cb2e(_0x512add),normalizeLocalFiles(_0x39e2d1);}function a112_0x5b25(_0x311897,_0x3b5026){_0x311897=_0x311897-0x115;const _0x104bd1=a112_0x104b();let _0x5b2518=_0x104bd1[_0x311897];return _0x5b2518;}export function compareSkillFiles(_0x555fb4,_0x4c2136){const _0x14048c=a112_0x5b25;if(_0x555fb4[_0x14048c(0x141)]===SKILL_FILE)return _0x4c2136[_0x14048c(0x141)]===SKILL_FILE?0x0:-0x1;if(_0x4c2136[_0x14048c(0x141)]===SKILL_FILE)return 0x1;return Buffer[_0x14048c(0x142)](Buffer[_0x14048c(0x11c)](_0x555fb4[_0x14048c(0x141)],_0x14048c(0x11b)),Buffer[_0x14048c(0x11c)](_0x4c2136['path'],_0x14048c(0x11b)));}export function normalizeSkillRelativePath(_0x1eb1f3){const _0x53a885=toPosixPath(_0x1eb1f3['trim']());return validateSkillRelativePath(_0x53a885),_0x53a885;}export function validateSkillRelativePath(_0x309e04){const _0x8d8466=a112_0x5b25;if(!_0x309e04||_0x309e04[_0x8d8466(0x12b)]('/')||_0x309e04['includes']('//'))throw CliErrors[_0x8d8466(0x123)]('Unsafe\x20Skill\x20file\x20path:\x20'+_0x309e04);for(const _0x5ba5d2 of _0x309e04[_0x8d8466(0x13a)]('/')){if(!_0x5ba5d2||_0x5ba5d2==='.'||_0x5ba5d2==='..')throw CliErrors[_0x8d8466(0x123)](_0x8d8466(0x12c)+_0x309e04);}}export function toPosixPath(_0x4340cb){const _0xc15296=a112_0x5b25;return _0x4340cb[_0xc15296(0x117)](/\\/g,'/');}export function isSha256Hex(_0x13aa9c){const _0x100332=a112_0x5b25;return typeof _0x13aa9c===_0x100332(0x130)&&/^[a-fA-F0-9]{64}$/['test'](_0x13aa9c);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4bbdc6,_0x142551){const _0x85d600=a113_0x5deb,_0x47bbaa=_0x4bbdc6();while(!![]){try{const _0x178ee4=parseInt(_0x85d600(0x1ef))/0x1*(-parseInt(_0x85d600(0x1c2))/0x2)+-parseInt(_0x85d600(0x1d8))/0x3*(-parseInt(_0x85d600(0x1e6))/0x4)+parseInt(_0x85d600(0x1e5))/0x5*(-parseInt(_0x85d600(0x1cd))/0x6)+-parseInt(_0x85d600(0x1f5))/0x7+parseInt(_0x85d600(0x1f3))/0x8*(parseInt(_0x85d600(0x1c0))/0x9)+-parseInt(_0x85d600(0x1de))/0xa+-parseInt(_0x85d600(0x1dc))/0xb*(-parseInt(_0x85d600(0x1d0))/0xc);if(_0x178ee4===_0x142551)break;else _0x47bbaa['push'](_0x47bbaa['shift']());}catch(_0x5054c8){_0x47bbaa['push'](_0x47bbaa['shift']());}}}(a113_0x5e85,0x8e575));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';function a113_0x5deb(_0xcc2b6b,_0x4a587f){_0xcc2b6b=_0xcc2b6b-0x1c0;const _0x5e851e=a113_0x5e85();let _0x5debaa=_0x5e851e[_0xcc2b6b];return _0x5debaa;}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(_0x37ca68,_0x2c1b75,_0x32c3bd){const _0x27c0ef=a113_0x5deb,_0x1af73b=requireSkillCode(_0x37ca68),_0x5afae6=requirePackageBytes(_0x1af73b,_0x32c3bd['packageBytes']),_0x5caf86=extractDownloadedPackage(_0x5afae6),_0x2a48ff=_0x5caf86[_0x27c0ef(0x1d3)](_0x59b14d=>_0x59b14d['path']===SKILL_FILE);if(!_0x2a48ff)throw CliErrors[_0x27c0ef(0x1dd)](_0x27c0ef(0x1d2)+SKILL_FILE+':\x20'+_0x1af73b);const _0x8a9f67=withMaterializedSkillFrontmatter(_0x5caf86,_0x37ca68,_0x1af73b),_0x47d6cb=_0x8a9f67[_0x27c0ef(0x1d3)](_0x4cecad=>_0x4cecad[_0x27c0ef(0x1ed)]===SKILL_FILE),_0x201040=fileText(_0x47d6cb),_0x14eaa2=getRuntimeSkillDir(_0x32c3bd[_0x27c0ef(0x1f2)],_0x32c3bd[_0x27c0ef(0x1cf)],_0x32c3bd[_0x27c0ef(0x1ea)],_0x2c1b75,_0x1af73b,_0x32c3bd[_0x27c0ef(0x1d1)]),_0x148c1b=resolve(_0x14eaa2,SKILL_FILE),_0x3b18ce=resolve(_0x14eaa2,METADATA_FILE),_0x7b40ab=contentHash(_0x201040),_0x32f10a=readMetadataIfPresent(_0x3b18ce)?.[_0x27c0ef(0x1e2)];ensurePulledFilesCanBeOverwritten(_0x14eaa2,_0x3b18ce,_0x8a9f67,_0x32c3bd[_0x27c0ef(0x1e7)]===!![]),mkdirSync(_0x14eaa2,{'recursive':!![],'mode':0x1c0});const _0x276067=existsSync(_0x148c1b)?readFileSync(_0x148c1b,'utf8'):undefined;return materializeFiles(_0x14eaa2,_0x8a9f67),removeStaleManagedFiles(_0x14eaa2,_0x32f10a,_0x8a9f67),writeJsonAtomic(_0x3b18ce,buildMetadata(_0x37ca68,_0x2c1b75,_0x32c3bd[_0x27c0ef(0x1ea)],_0x7b40ab,_0x32c3bd[_0x27c0ef(0x1e9)],_0x8a9f67,_0x5afae6)),{'skill':_0x37ca68,'scope':_0x2c1b75,'dir':_0x14eaa2,'skillMdPath':_0x148c1b,'metadataPath':_0x3b18ce,'contentHash':_0x7b40ab,'changed':_0x276067!==_0x201040};}function withMaterializedSkillFrontmatter(_0x2ee35a,_0x4603b4,_0x49bd24){const _0xd3f775=a113_0x5deb,_0x59fd97=skillDisplayName(_0x4603b4,_0x49bd24),_0x2acd5c=_0x4603b4[_0xd3f775(0x1ca)]?.[_0xd3f775(0x1c5)]()||_0x59fd97||_0x49bd24;return normalizeLocalFiles(_0x2ee35a)[_0xd3f775(0x1c8)](_0x8892bf=>{const _0x485481=_0xd3f775,_0x17fd4c=fileText(_0x8892bf);if(_0x8892bf[_0x485481(0x1ed)]!==SKILL_FILE)return _0x8892bf;if(hasYamlFrontmatter(_0x17fd4c))return{'path':_0x8892bf['path'],'content':withSyncedDisplayName(_0x17fd4c,_0x59fd97)};return{'path':_0x8892bf[_0x485481(0x1ed)],'content':prependSkillFrontmatter(_0x17fd4c,{'name':_0x49bd24,'displayName':_0x59fd97,'description':_0x2acd5c})};});}function hasYamlFrontmatter(_0x584ca4){const _0x5809f9=a113_0x5deb;return/^\uFEFF?---\s*\r?\n/[_0x5809f9(0x1d7)](_0x584ca4);}function prependSkillFrontmatter(_0x2a0663,_0xbb6f56){const _0xc3eeb4=a113_0x5deb,_0x272c00=_0x2a0663[_0xc3eeb4(0x1e0)](/^\uFEFF/,'');return['---',_0xc3eeb4(0x1df)+yamlString(_0xbb6f56[_0xc3eeb4(0x1fa)]),_0xbb6f56[_0xc3eeb4(0x1c7)]?_0xc3eeb4(0x1f0)+yamlString(_0xbb6f56[_0xc3eeb4(0x1c7)]):undefined,_0xc3eeb4(0x1f6)+yamlString(_0xbb6f56[_0xc3eeb4(0x1ca)]),_0xc3eeb4(0x1d4),'',_0x272c00][_0xc3eeb4(0x1e4)](_0x50fbe6=>_0x50fbe6!==undefined)[_0xc3eeb4(0x1ec)]('\x0a');}function yamlString(_0x12ebdf){const _0x3ed4e0=a113_0x5deb;return JSON[_0x3ed4e0(0x1ce)](_0x12ebdf['replace'](/\r/g,'')['trim']());}function skillDisplayName(_0x1331cf,_0x40bbf0){const _0x2b065a=a113_0x5deb,_0xf6f8e5=_0x1331cf[_0x2b065a(0x1f7)]?.[_0x2b065a(0x1c5)]();return _0xf6f8e5||_0x40bbf0;}function withSyncedDisplayName(_0x45b74e,_0x4ddb0b){const _0x560152=a113_0x5deb,_0x3f3bc4=_0x45b74e['match'](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x3f3bc4)return _0x45b74e;const _0x176369=_0x3f3bc4[0x1]??'',_0x100a70=_0x3f3bc4[0x2]??'',_0x10752f=parseDocument(_0x100a70);if(_0x10752f[_0x560152(0x1db)][_0x560152(0x1fb)]>0x0||!isMap(_0x10752f[_0x560152(0x1e3)]))return _0x45b74e;if(_0x4ddb0b)_0x10752f[_0x560152(0x1ee)]('displayName',_0x4ddb0b);else{if(_0x10752f[_0x560152(0x1c3)]('displayName'))_0x10752f[_0x560152(0x1c9)](_0x560152(0x1c7));else return _0x45b74e;}forceBlockCollections(_0x10752f[_0x560152(0x1e3)]);const _0x3e091c=_0x10752f[_0x560152(0x1f1)]({'lineWidth':0x0})[_0x560152(0x1f9)](),_0x252261=_0x45b74e[_0x560152(0x1d5)](_0x3f3bc4[0x0][_0x560152(0x1fb)])[_0x560152(0x1e0)](/^\r?\n/,'');return _0x176369+_0x560152(0x1c4)+_0x3e091c+'\x0a---\x0a\x0a'+_0x252261;}function forceBlockCollections(_0x51b678){if(!isNode(_0x51b678))return;visit(_0x51b678,(_0x48e043,_0x361f89)=>{const _0x5ad0ed=a113_0x5deb;isCollection(_0x361f89)&&(_0x361f89[_0x5ad0ed(0x1f8)]=![]);});}function ensurePulledFilesCanBeOverwritten(_0x1bd490,_0x3a1f1f,_0x1f11d8,_0x2fded6){const _0x460188=a113_0x5deb;if(_0x2fded6||!existsSync(_0x3a1f1f))return;const _0x10dfb1=readMetadataIfPresent(_0x3a1f1f);if(!_0x10dfb1)return;const _0x358713=_0x10dfb1['fileHashes']&&Object[_0x460188(0x1c6)](_0x10dfb1['fileHashes'])[_0x460188(0x1fb)]>0x0?_0x10dfb1['fileHashes']:undefined;if(_0x358713)for(const [_0x184b2,_0x2ff708]of Object[_0x460188(0x1e8)](_0x358713)){const _0x5a19f6=resolveManagedFilePath(_0x1bd490,_0x184b2);if(!existsSync(_0x5a19f6))throw CliErrors['validation'](_0x460188(0x1cb)+_0x1bd490,_0x460188(0x1eb)+_0x184b2);const _0x373943=lstatSync(_0x5a19f6);if(!_0x373943[_0x460188(0x1e1)]())throw CliErrors[_0x460188(0x1dd)](_0x460188(0x1cb)+_0x1bd490,_0x460188(0x1f4)+_0x184b2);const _0x22174c=bufferSha256(readFileSync(_0x5a19f6));if(_0x22174c!==_0x2ff708)throw CliErrors['validation'](_0x460188(0x1cb)+_0x1bd490+'.\x20Changed\x20file:\x20'+_0x184b2,'Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20'+_0x184b2);}else{const _0x71cfd8=resolve(_0x1bd490,SKILL_FILE);if(existsSync(_0x71cfd8)&&_0x10dfb1[_0x460188(0x1d9)]){const _0x1da350=contentHash(readFileSync(_0x71cfd8,'utf8'));if(_0x1da350!==_0x10dfb1[_0x460188(0x1d9)])throw CliErrors['validation'](_0x460188(0x1d6)+_0x71cfd8,_0x460188(0x1da));}}for(const _0x53fd23 of normalizeLocalFiles(_0x1f11d8)){if(_0x358713?.[_0x53fd23[_0x460188(0x1ed)]])continue;if(!_0x358713&&_0x53fd23['path']===SKILL_FILE)continue;const _0x2becce=resolveManagedFilePath(_0x1bd490,_0x53fd23[_0x460188(0x1ed)]);if(!existsSync(_0x2becce))continue;const _0x32fb94=lstatSync(_0x2becce);if(!_0x32fb94[_0x460188(0x1e1)]())throw CliErrors['validation'](_0x460188(0x1cb)+_0x1bd490,_0x460188(0x1c1)+_0x53fd23[_0x460188(0x1ed)]);const _0x14dd64=bufferSha256(readFileSync(_0x2becce));if(_0x14dd64!==fileHash(_0x53fd23))throw CliErrors[_0x460188(0x1dd)](_0x460188(0x1cb)+_0x1bd490,_0x460188(0x1cc)+_0x53fd23[_0x460188(0x1ed)]);}}function materializeFiles(_0x3c84ef,_0x210df2){const _0x556751=a113_0x5deb;for(const _0x20f57c of normalizeLocalFiles(_0x210df2)){const _0x4dcd2d=resolveManagedFilePath(_0x3c84ef,_0x20f57c[_0x556751(0x1ed)]);mkdirSync(dirname(_0x4dcd2d),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x4dcd2d,fileContent(_0x20f57c),0x180);}}function removeStaleManagedFiles(_0x32f07b,_0x401662,_0x5adc3b){const _0x4ffb0e=a113_0x5deb;if(!_0x401662)return;const _0x215e93=new Set(normalizeLocalFiles(_0x5adc3b)[_0x4ffb0e(0x1c8)](_0x2c9677=>_0x2c9677['path']));for(const _0x202adb of Object[_0x4ffb0e(0x1c6)](_0x401662)){if(_0x215e93[_0x4ffb0e(0x1c3)](_0x202adb))continue;const _0x4f5ebe=resolveManagedFilePath(_0x32f07b,_0x202adb);existsSync(_0x4f5ebe)&&lstatSync(_0x4f5ebe)[_0x4ffb0e(0x1e1)]()&&rmSync(_0x4f5ebe,{'force':!![]});}}function a113_0x5e85(){const _0x3c5407=['568572rYHjTW','stringify','accessKey','79260EPoVZZ','paths','Runtime\x20Skill\x20package\x20is\x20missing\x20','find','---','slice','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','test','6417xHVLPP','contentHash','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.','errors','2222EMjBuq','validation','606870PDVRoH','name:\x20','replace','isFile','fileHashes','contents','filter','30FtMRkz','872FQFyPz','force','entries','pulledAt','appCode','Managed\x20file\x20was\x20removed\x20locally:\x20','join','path','set','942QXBosn','displayName:\x20','toString','env','61192kJDvlU','Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20','4956035mbJmcm','description:\x20','skillName','flow','trimEnd','name','length','837Qzjonk','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','1256wSWkfR','has','---\x0a','trim','keys','displayName','map','delete','description','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20'];a113_0x5e85=function(){return _0x3c5407;};return a113_0x5e85();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xa4a6f8,_0xc4e201){const _0x3e2d1b=a114_0x18ae,_0x4539a6=_0xa4a6f8();while(!![]){try{const _0x98a29d=-parseInt(_0x3e2d1b(0x147))/0x1+-parseInt(_0x3e2d1b(0x14d))/0x2*(-parseInt(_0x3e2d1b(0x148))/0x3)+parseInt(_0x3e2d1b(0x159))/0x4*(-parseInt(_0x3e2d1b(0x155))/0x5)+parseInt(_0x3e2d1b(0x151))/0x6*(parseInt(_0x3e2d1b(0x161))/0x7)+-parseInt(_0x3e2d1b(0x15c))/0x8+-parseInt(_0x3e2d1b(0x14e))/0x9*(parseInt(_0x3e2d1b(0x15a))/0xa)+parseInt(_0x3e2d1b(0x14a))/0xb;if(_0x98a29d===_0xc4e201)break;else _0x4539a6['push'](_0x4539a6['shift']());}catch(_0x2b45d2){_0x4539a6['push'](_0x4539a6['shift']());}}}(a114_0x4cf9,0x86c77));import{existsSync,readFileSync}from'node:fs';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';function a114_0x4cf9(){const _0x38efc0=['validation','toISOString','hasUpstreamUpdate','length','zipSha256','object','isArray','skillCode','zipSize','version','forkedFromVersion','path','439050aWYFdC','11469YkLAzq','personal','18970017xGAdgY','string','tenantCode','98ZpVXQb','18YyUpsT','fromEntries','map','6XZnEaF','Invalid\x20','description','Runtime\x20Skill\x20is\x20missing\x20skillCode.','5EoXHdp','readonly','skillName','trim','3989904gahXJe','2335010JveoAQ','userId','1701552soOOap','tags','status','utf8','manifest','5294821uFTKvm'];a114_0x4cf9=function(){return _0x38efc0;};return a114_0x4cf9();}import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';import{fileContent,normalizeLocalFiles}from'./local-files.js';import{buildSkillPackage,localFilesToManifestFiles}from'./zip-package.js';function a114_0x18ae(_0x1260f1,_0x1947a8){_0x1260f1=_0x1260f1-0x13e;const _0x4cf9d0=a114_0x4cf9();let _0x18ae36=_0x4cf9d0[_0x1260f1];return _0x18ae36;}export function buildMetadata(_0x4d9954,_0xc00183,_0x3de236,_0x38449a,_0x5005bb,_0x23e0c1,_0x1e9ba4){const _0xdbe70d=a114_0x18ae,_0x21fb88=_0x23e0c1?normalizeLocalFiles(_0x23e0c1):[],_0x39fbee=!_0x1e9ba4&&_0x21fb88[_0xdbe70d(0x13e)]>0x0?buildSkillPackage(_0x21fb88):undefined,_0x4f05f4=_0x1e9ba4?bufferSha256(_0x1e9ba4):_0x39fbee?.[_0xdbe70d(0x160)][_0xdbe70d(0x13f)],_0x11f4e8=_0x1e9ba4?.[_0xdbe70d(0x13e)]??_0x39fbee?.[_0xdbe70d(0x160)][_0xdbe70d(0x143)],_0x5b8cbf=_0x21fb88[_0xdbe70d(0x13e)]>0x0?Object[_0xdbe70d(0x14f)](_0x21fb88['map'](_0xd8a9e6=>[_0xd8a9e6['path'],fileHash(_0xd8a9e6)])):undefined;return{'schemaVersion':_0x21fb88[_0xdbe70d(0x13e)]>0x0?0x2:0x1,'id':_0x4d9954['id'],'appCode':_0x3de236,'skillCode':requireSkillCode(_0x4d9954),'skillName':_0x4d9954[_0xdbe70d(0x157)],'description':_0x4d9954[_0xdbe70d(0x153)],'scope':_0xc00183,'readonly':_0xc00183!==_0xdbe70d(0x149)||_0x4d9954[_0xdbe70d(0x156)]===!![],'tenantCode':_0x4d9954[_0xdbe70d(0x14c)],'userId':_0x4d9954[_0xdbe70d(0x15b)],'version':_0x4d9954[_0xdbe70d(0x144)],'status':_0x4d9954[_0xdbe70d(0x15e)],'tags':Array[_0xdbe70d(0x141)](_0x4d9954['tags'])?_0x4d9954[_0xdbe70d(0x15d)]:[],'hasUpstreamUpdate':_0x4d9954[_0xdbe70d(0x164)],'forkedFromSkillId':_0x4d9954['forkedFromSkillId'],'forkedFromVersion':_0x4d9954[_0xdbe70d(0x145)],'sourceSessionId':_0x4d9954['sourceSessionId'],'contentHash':_0x38449a,'fileHashes':_0x5b8cbf,'treeHash':_0x21fb88[_0xdbe70d(0x13e)]>0x0?fileTreeHash(localFilesToManifestFiles(_0x21fb88)):undefined,'ossPath':remoteManifestOssPath(_0x4d9954['files']),'zipSha256':_0x4f05f4,'zipSize':_0x11f4e8,'files':_0x21fb88['length']>0x0?_0x21fb88[_0xdbe70d(0x150)](_0x429d55=>({'path':_0x429d55[_0xdbe70d(0x146)],'hash':fileHash(_0x429d55),'size':fileContent(_0x429d55)[_0xdbe70d(0x13e)]})):undefined,'pulledAt':_0x5005bb??new Date()[_0xdbe70d(0x163)]()};}export function requireSkillCode(_0x3bfae6){const _0x23c0fa=a114_0x18ae,_0xc9af2f=_0x3bfae6[_0x23c0fa(0x142)]?.[_0x23c0fa(0x158)]();if(!_0xc9af2f)throw CliErrors[_0x23c0fa(0x162)](_0x23c0fa(0x154));return _0xc9af2f;}export function readMetadataIfPresent(_0xdf9adf){const _0x5a99e3=a114_0x18ae;if(!existsSync(_0xdf9adf))return undefined;try{const _0x24186c=JSON['parse'](readFileSync(_0xdf9adf,_0x5a99e3(0x15f)));return _0x24186c;}catch{throw CliErrors[_0x5a99e3(0x162)](_0x5a99e3(0x152)+METADATA_FILE+':\x20'+_0xdf9adf);}}function remoteManifestOssPath(_0x2cb195){const _0x40dfe0=a114_0x18ae;if(!_0x2cb195||typeof _0x2cb195!==_0x40dfe0(0x140)||Array[_0x40dfe0(0x141)](_0x2cb195))return undefined;const _0x4629b9=_0x2cb195['ossPath'];return typeof _0x4629b9===_0x40dfe0(0x14b)&&_0x4629b9[_0x40dfe0(0x158)]()?_0x4629b9[_0x40dfe0(0x158)]():undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a115_0x1058a7=a115_0x4cf4;(function(_0x3c729e,_0xaed8aa){const _0xbb02c2=a115_0x4cf4,_0x4c5c7b=_0x3c729e();while(!![]){try{const _0x42a0d=-parseInt(_0xbb02c2(0x159))/0x1*(parseInt(_0xbb02c2(0x15f))/0x2)+parseInt(_0xbb02c2(0x164))/0x3*(parseInt(_0xbb02c2(0x14c))/0x4)+-parseInt(_0xbb02c2(0x158))/0x5+-parseInt(_0xbb02c2(0x152))/0x6+-parseInt(_0xbb02c2(0x15c))/0x7+-parseInt(_0xbb02c2(0x15d))/0x8+-parseInt(_0xbb02c2(0x15e))/0x9*(-parseInt(_0xbb02c2(0x15a))/0xa);if(_0x42a0d===_0xaed8aa)break;else _0x4c5c7b['push'](_0x4c5c7b['shift']());}catch(_0xc8b7e9){_0x4c5c7b['push'](_0x4c5c7b['shift']());}}}(a115_0x52a0,0x25549));import{existsSync}from'node:fs';import{homedir}from'node:os';import{resolve}from'node:path';function a115_0x4cf4(_0x12fe3f,_0x442290){_0x12fe3f=_0x12fe3f-0x148;const _0x52a032=a115_0x52a0();let _0x4cf41e=_0x52a032[_0x12fe3f];return _0x4cf41e;}import{fingerprintAccessKey}from'../../commands/app/cache.js';import{PRODUCT_CONFIG,productEnv}from'../../constant/product.js';import{CliErrors}from'../../errors.js';export function resolveSkillSyncPaths(_0x210dc2={}){const _0x4b4bcf=a115_0x4cf4,_0x2a095c=_0x210dc2[_0x4b4bcf(0x162)]??homedir(),_0x54923c=resolve(_0x2a095c,PRODUCT_CONFIG[_0x4b4bcf(0x14f)],_0x4b4bcf(0x148)),_0x430765=trimmedEnv(_0x4b4bcf(0x161)),_0x439254=trimmedEnv(_0x4b4bcf(0x14a)),_0x5f4f21=resolve(_0x2a095c,_0x4b4bcf(0x15b)),_0x33ca62=_0x210dc2[_0x4b4bcf(0x151)]??(existsSync(_0x5f4f21)?resolve(_0x5f4f21,'skills'):undefined);return{'homeDir':_0x2a095c,'cacheRoot':_0x54923c,'managedRoot':resolve(_0x2a095c,PRODUCT_CONFIG['homeDirName']),'agentsSkillsDir':_0x210dc2[_0x4b4bcf(0x149)]??_0x430765??resolve(_0x2a095c,_0x4b4bcf(0x14e),_0x4b4bcf(0x157)),'claudeSkillsDir':_0x210dc2[_0x4b4bcf(0x150)]??_0x439254??resolve(_0x2a095c,'.claude',_0x4b4bcf(0x157)),'workbuddySkillsDir':_0x33ca62};}export function runtimeAgentSkillRoots(_0x5cf11a){const _0xc7b4b4=a115_0x4cf4;return[_0x5cf11a['agentsSkillsDir'],_0x5cf11a[_0xc7b4b4(0x150)],_0x5cf11a['workbuddySkillsDir']][_0xc7b4b4(0x163)](_0x3915c5=>Boolean(_0x3915c5));}export function getRuntimeSkillCacheRoot(_0x4cf3be,_0x2f8bb6,_0x25f9df={}){const _0x11e107=a115_0x4cf4,_0x30adba=resolveSkillSyncPaths(_0x25f9df);return resolve(_0x30adba['cacheRoot'],_0x4cf3be,fingerprintAccessKey(_0x2f8bb6),_0x11e107(0x157));}export function getRuntimeSkillDir(_0x1421df,_0x3a7f34,_0x3df8d1,_0x110465,_0x36c6dc,_0x1a1287={}){const _0x54cdd1=a115_0x4cf4;return resolve(getRuntimeSkillCacheRoot(_0x1421df,_0x3a7f34,_0x1a1287),safePathSegment(_0x3df8d1,_0x54cdd1(0x156)),_0x110465,safePathSegment(_0x36c6dc,_0x54cdd1(0x153)));}function a115_0x52a0(){const _0x8f654b=['workbuddySkillsDir','704868lEDJjc','skillCode','Unsafe\x20','path\x20segment','appCode','skills','1146940EIOpDH','47478sQFZCp','830lCthWC','.workbuddy','1160327xneUPH','2009680JqcWGX','91593ODTMeo','2nabPfi','validation','SKILL_ROOT','homeDir','filter','358587xehhSh','cache','agentsSkillsDir','CLAUDE_SKILL_ROOT','\x20for\x20local\x20path:\x20','4nvZrzH','includes','.agents','homeDirName','claudeSkillsDir'];a115_0x52a0=function(){return _0x8f654b;};return a115_0x52a0();}export function safePathSegment(_0x27b8c0,_0x5c3c29=a115_0x1058a7(0x155)){const _0x4db3f6=a115_0x1058a7;if(!_0x27b8c0||_0x27b8c0[_0x4db3f6(0x14d)]('/')||_0x27b8c0['includes']('\x5c')||_0x27b8c0[_0x4db3f6(0x14d)]('..'))throw CliErrors[_0x4db3f6(0x160)](_0x4db3f6(0x154)+_0x5c3c29+_0x4db3f6(0x14b)+_0x27b8c0);return _0x27b8c0;}function trimmedEnv(_0x1195db){const _0x3f4cbc=productEnv(_0x1195db)?.['trim']();return _0x3f4cbc?_0x3f4cbc:undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x5d94cd,_0x3209d7){const _0x38ece2=a116_0x4ef1,_0xfb8de0=_0x5d94cd();while(!![]){try{const _0x81d5ef=-parseInt(_0x38ece2(0x186))/0x1*(parseInt(_0x38ece2(0x1af))/0x2)+parseInt(_0x38ece2(0x1a3))/0x3*(parseInt(_0x38ece2(0x1a6))/0x4)+-parseInt(_0x38ece2(0x1ad))/0x5+-parseInt(_0x38ece2(0x19c))/0x6+-parseInt(_0x38ece2(0x1b0))/0x7+parseInt(_0x38ece2(0x190))/0x8+parseInt(_0x38ece2(0x18d))/0x9;if(_0x81d5ef===_0x3209d7)break;else _0xfb8de0['push'](_0xfb8de0['shift']());}catch(_0x2d94f3){_0xfb8de0['push'](_0xfb8de0['shift']());}}}(a116_0x5eb8,0xa615c));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a116_0x3ee954}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(_0x4a10a2,_0x178ffa,_0x4a6d10={}){const _0x3f3e8d=a116_0x4ef1,_0x2670d0=resolvePushDirectoryRoot(_0x4a10a2),_0x3fffa4=readPushMetadataIfPresent(resolve(_0x2670d0,METADATA_FILE),{'ignoreInvalidMetadata':_0x4a6d10[_0x3f3e8d(0x1b1)]});if(_0x3fffa4?.[_0x3f3e8d(0x185)]&&_0x3fffa4[_0x3f3e8d(0x185)]!==_0x178ffa&&!_0x4a6d10[_0x3f3e8d(0x180)]&&!_0x4a6d10['ignoreMetadataAppCodeMismatch'])throw CliErrors[_0x3f3e8d(0x1b5)](_0x3f3e8d(0x1a7)+_0x3fffa4[_0x3f3e8d(0x185)]+_0x3f3e8d(0x1a5)+_0x178ffa+'\x22.');const _0x2fba72=resolvePushSkillCode(_0x2670d0,_0x178ffa,_0x3fffa4,_0x4a6d10);if(!_0x2fba72)throw CliErrors[_0x3f3e8d(0x1b5)]('Unable\x20to\x20resolve\x20skillCode\x20from\x20'+SKILL_FILE+',\x20'+METADATA_FILE+_0x3f3e8d(0x177));return{'dir':_0x2670d0,'skillCode':_0x2fba72,'metadata':_0x3fffa4};}export function readPushDirectory(_0x5940cc,_0x4251f3,_0xf946a1={}){const _0x52cefe=a116_0x4ef1,_0x4c924b=resolvePushDirectoryIdentity(_0x5940cc,_0x4251f3,_0xf946a1),_0x19f399=_0x4c924b[_0x52cefe(0x198)],_0xad5cee=resolve(_0x19f399,SKILL_FILE);if(!existsSync(_0xad5cee)||!lstatSync(_0xad5cee)[_0x52cefe(0x18e)]())throw CliErrors[_0x52cefe(0x1b5)](_0x52cefe(0x179)+SKILL_FILE+':\x20'+_0xad5cee);const _0x5a87c7=_0x4c924b[_0x52cefe(0x1a2)],_0x130144=_0xf946a1[_0x52cefe(0x1b2)]??'personal';if(!_0xf946a1['ignoreMetadataScope']&&_0x5a87c7?.['scope']===_0x52cefe(0x192))throw CliErrors[_0x52cefe(0x1b5)]('Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20'+METADATA_FILE+'\x20has\x20scope=\x22'+_0x5a87c7[_0x52cefe(0x176)]+'\x22.');if(!_0xf946a1[_0x52cefe(0x187)]&&_0x130144===_0x52cefe(0x188)&&_0x5a87c7?.[_0x52cefe(0x176)]&&_0x5a87c7[_0x52cefe(0x176)]!==_0x52cefe(0x188))throw CliErrors['validation'](_0x52cefe(0x19e)+METADATA_FILE+_0x52cefe(0x1aa)+_0x5a87c7[_0x52cefe(0x176)]+'\x22.',_0x52cefe(0x178)+_0x19f399+_0x52cefe(0x19d));const _0x2ca268=scanSkillDirectory(_0x19f399),_0x586fea=buildSkillPackage(_0x2ca268),_0x54afe8=readFileSync(_0xad5cee,_0x52cefe(0x1a8)),_0x53da84=_0x4c924b[_0x52cefe(0x18b)],_0x720293=_0xf946a1['ignoreMetadataForPayload']?undefined:_0x5a87c7,_0x5749a6=readSkillDisplayName(_0x54afe8);return{'skillCode':_0x53da84,'metadata':_0x5a87c7,'frontmatterDisplayName':_0x5749a6,'input':{'skillCode':_0x53da84,'skillName':_0x5749a6??_0x720293?.[_0x52cefe(0x17b)],'description':_0x720293?.['description'],'content':_0x54afe8,'files':_0x586fea[_0x52cefe(0x1b3)],'packageBase64':_0x586fea[_0x52cefe(0x195)],'tags':_0x720293?.[_0x52cefe(0x1ab)],'version':_0x720293?.['version'],'sourceSessionId':_0x720293?.[_0x52cefe(0x191)]}};}function a116_0x4ef1(_0x3ca8fe,_0x22c49e){_0x3ca8fe=_0x3ca8fe-0x175;const _0x5eb8ed=a116_0x5eb8();let _0x4ef117=_0x5eb8ed[_0x3ca8fe];return _0x4ef117;}export function refreshPushDirectoryMetadataFromRemote(_0x3acb95,_0x3e76ce,_0x3bbd66,_0x49893c={}){const _0xde5bba=a116_0x4ef1,_0x51223a=resolvePushDirectoryRoot(_0x3acb95),_0x3674cf=readPushMetadataIfPresent(resolve(_0x51223a,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x48d59f=requireRemoteScope(_0x3e76ce),_0x5bb728=readLocalSkillContent(_0x51223a),_0x4a519f={..._0x3e76ce,'appCode':_0x3e76ce['appCode']??_0x3bbd66,'skillName':_0x3e76ce[_0xde5bba(0x17b)]??_0x3674cf?.[_0xde5bba(0x17b)],'description':_0x3e76ce['description']??_0x3674cf?.[_0xde5bba(0x196)],'tags':Array[_0xde5bba(0x175)](_0x3e76ce[_0xde5bba(0x1ab)])?_0x3e76ce[_0xde5bba(0x1ab)]:_0x3674cf?.[_0xde5bba(0x1ab)],'sourceSessionId':_0x3e76ce['sourceSessionId']??_0x3674cf?.[_0xde5bba(0x191)],'content':_0x3e76ce[_0xde5bba(0x181)]??_0x5bb728},_0xb424d9=buildMetadata(_0x4a519f,_0x48d59f,_0x3bbd66,contentHash(_0x5bb728),_0x49893c[_0xde5bba(0x197)]);writeJsonAtomic(resolve(_0x51223a,METADATA_FILE),_0xb424d9);}export function recordPushedRuntimeSkill(_0x593767,_0x22afd1,_0x1a9d2c,_0x432e2b={}){const _0x2e5082=a116_0x4ef1,_0x5aca0f=resolvePushDirectoryRoot(_0x593767),_0x3a2641=scanSkillDirectory(_0x5aca0f),_0x162f3=_0x3a2641[_0x2e5082(0x18a)](_0x1c6a6e=>_0x1c6a6e[_0x2e5082(0x1ac)]===SKILL_FILE),_0x464624=_0x162f3?fileText(_0x162f3):'',_0x1f8e8b=tryNormalizePackageManifest(_0x22afd1[_0x2e5082(0x18f)]),_0x57ed0a={..._0x22afd1,'content':_0x22afd1[_0x2e5082(0x181)]??_0x464624,'files':_0x1f8e8b},_0x46579d=_0x1f8e8b?normalizeLocalFiles(_0x3a2641)[_0x2e5082(0x194)](_0x12c15f=>_0x1f8e8b[_0x2e5082(0x18f)][_0x2e5082(0x17e)](_0x391984=>_0x391984[_0x2e5082(0x1ac)]===_0x12c15f['path'])):undefined,_0x4a6a65=buildMetadata(_0x57ed0a,_0x432e2b[_0x2e5082(0x176)]??_0x2e5082(0x188),_0x1a9d2c,contentHash(_0x57ed0a[_0x2e5082(0x181)]??''),_0x432e2b[_0x2e5082(0x17c)],_0x46579d);writeJsonAtomic(resolve(_0x5aca0f,METADATA_FILE),_0x4a6a65);}export function deriveSkillCodeFromDirectory(_0x56c14f,_0x544879){const _0x4d4d73=a116_0x4ef1,_0xe87b02=basename(resolve(_0x56c14f)),_0x24dbd3=_0x544879+'--';return _0xe87b02[_0x4d4d73(0x19f)](_0x24dbd3)?_0xe87b02[_0x4d4d73(0x193)](_0x24dbd3[_0x4d4d73(0x19b)]):_0xe87b02;}function a116_0x5eb8(){const _0x432e86=['utf8','ignoreMetadataSkillCode','\x20has\x20scope=\x22','tags','path','1724575KoLRkr','object','1233330LmOgHD','341138khFVRo','ignoreInvalidMetadata','targetScope','manifest','company','validation','isArray','scope',',\x20or\x20directory\x20name.','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20','Missing\x20','match','skillName','pushedAt','isDirectory','some','Skill\x20directory\x20not\x20found:\x20','allowAppCodeRetarget','content','isSymbolicLink','name','\x20has\x20unsupported\x20scope\x20\x22','appCode','1vcpSZl','ignoreMetadataScope','personal','replace','find','skillCode','displayName','4196592dDoFif','isFile','files','2408088dFUptA','sourceSessionId','builtin','slice','filter','packageBase64','description','refreshedAt','dir','(unknown)','unknown','length','1876488YshQDZ','\x20to\x20submit\x20company\x20Skills\x20for\x20review.','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20','startsWith','trim','toLowerCase','metadata','3057hIenFd','Invalid\x20','\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22','4852DHCTHK','Skill\x20metadata\x20appCode\x20\x22'];a116_0x5eb8=function(){return _0x432e86;};return a116_0x5eb8();}function resolvePushSkillCode(_0x2b2cc9,_0xaa8a6,_0x5ad974,_0x521521){const _0xe67d43=a116_0x4ef1,_0x4f233b=deriveSkillCodeFromSkillFile(_0x2b2cc9)||deriveSkillCodeFromDirectory(_0x2b2cc9,_0xaa8a6);if(_0x521521[_0xe67d43(0x1a9)])return _0x4f233b;return _0x5ad974?.[_0xe67d43(0x18b)]?.[_0xe67d43(0x1a0)]()||_0x4f233b;}function deriveSkillCodeFromSkillFile(_0x21fef1){const _0x1eb0fe=a116_0x4ef1,_0xeca6ac=resolve(_0x21fef1,SKILL_FILE);if(!existsSync(_0xeca6ac)||!lstatSync(_0xeca6ac)[_0x1eb0fe(0x18e)]())return undefined;const _0x3f856b=readFileSync(_0xeca6ac,_0x1eb0fe(0x1a8)),_0x19fad2=_0x3f856b[_0x1eb0fe(0x17a)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x19fad2)return undefined;const _0x419199=parseFrontmatterObject(_0x19fad2[0x1]??''),_0x257779=scalarToString(_0x419199?.[_0x1eb0fe(0x183)]);return _0x257779?slugifySkillName(_0x257779):undefined;}function readSkillDisplayName(_0x1e7eb1){const _0x497447=a116_0x4ef1,_0x530bd4=_0x1e7eb1[_0x497447(0x17a)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x530bd4)return undefined;const _0x43c283=parseFrontmatterObject(_0x530bd4[0x1]??'');return scalarToString(_0x43c283?.[_0x497447(0x18c)]);}function slugifySkillName(_0x4b672a){const _0xae025=a116_0x4ef1,_0x114df0=_0x4b672a['trim']()[_0xae025(0x1a1)]()['replace'](/[^\p{L}\p{N}\p{So}]+/gu,'-')['replace'](/^-+/,'')[_0xae025(0x189)](/-+$/,'')[_0xae025(0x189)](/-{2,}/g,'-');if(!_0x114df0)throw CliErrors[_0xae025(0x1b5)](_0xae025(0x1a4)+SKILL_FILE+'\x20name\x20for\x20SkillHub\x20slug\x20generation.');return _0x114df0;}function parseFrontmatterObject(_0x5c01a6){const _0x295380=a116_0x4ef1;try{const _0x18db07=a116_0x3ee954(_0x5c01a6);return _0x18db07&&typeof _0x18db07===_0x295380(0x1ae)&&!Array[_0x295380(0x175)](_0x18db07)?_0x18db07:undefined;}catch{return undefined;}}function scalarToString(_0x9f9b41){const _0x89544b=a116_0x4ef1;if(typeof _0x9f9b41==='string')return _0x9f9b41[_0x89544b(0x1a0)]();if(typeof _0x9f9b41==='number'||typeof _0x9f9b41==='boolean')return String(_0x9f9b41);return undefined;}function resolvePushDirectoryRoot(_0x588502){const _0x4a9f80=a116_0x4ef1,_0x350c69=resolve(_0x588502);if(!existsSync(_0x350c69))throw CliErrors[_0x4a9f80(0x1b5)](_0x4a9f80(0x17f)+_0x588502);const _0x22e78c=lstatSync(_0x350c69);if(_0x22e78c[_0x4a9f80(0x17d)]())return _0x350c69;if(_0x22e78c[_0x4a9f80(0x182)]()){const _0x4c7586=realpathSync(_0x350c69);if(lstatSync(_0x4c7586)['isDirectory']())return _0x4c7586;}throw CliErrors[_0x4a9f80(0x1b5)](_0x4a9f80(0x17f)+_0x588502);}function requireRemoteScope(_0xdfc5f7){const _0x45ebc1=a116_0x4ef1;if(_0xdfc5f7[_0x45ebc1(0x176)]===_0x45ebc1(0x188)||_0xdfc5f7[_0x45ebc1(0x176)]===_0x45ebc1(0x1b4)||_0xdfc5f7['scope']===_0x45ebc1(0x192))return _0xdfc5f7[_0x45ebc1(0x176)];throw CliErrors[_0x45ebc1(0x1b5)]('Remote\x20Skill\x20'+(_0xdfc5f7['skillCode']||_0x45ebc1(0x199))+_0x45ebc1(0x184)+(_0xdfc5f7[_0x45ebc1(0x176)]??_0x45ebc1(0x19a))+'\x22.');}function readLocalSkillContent(_0xdfabc){const _0x344dd1=a116_0x4ef1,_0x4834e9=resolve(_0xdfabc,SKILL_FILE);return existsSync(_0x4834e9)&&lstatSync(_0x4834e9)[_0x344dd1(0x18e)]()?readFileSync(_0x4834e9,_0x344dd1(0x1a8)):'';}function readPushMetadataIfPresent(_0x4a01fe,_0x9271fd={}){const _0x5151d3=a116_0x4ef1;try{return readMetadataIfPresent(_0x4a01fe);}catch(_0x382b90){if(_0x9271fd[_0x5151d3(0x1b1)])return undefined;throw _0x382b90;}}
|
|
1
|
+
(function(_0x1d2f6b,_0x5968c4){const _0x4be13b=a116_0x4336,_0x3a5351=_0x1d2f6b();while(!![]){try{const _0xce684f=parseInt(_0x4be13b(0x1b5))/0x1+parseInt(_0x4be13b(0x1cb))/0x2+parseInt(_0x4be13b(0x1ac))/0x3+-parseInt(_0x4be13b(0x1c4))/0x4*(-parseInt(_0x4be13b(0x1cf))/0x5)+parseInt(_0x4be13b(0x1ce))/0x6+parseInt(_0x4be13b(0x1da))/0x7+-parseInt(_0x4be13b(0x1a4))/0x8*(parseInt(_0x4be13b(0x1ae))/0x9);if(_0xce684f===_0x5968c4)break;else _0x3a5351['push'](_0x3a5351['shift']());}catch(_0x127ba9){_0x3a5351['push'](_0x3a5351['shift']());}}}(a116_0x299c,0x33ea4));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a116_0x457c7d}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(_0x2080d6,_0x271172,_0x1174bb={}){const _0x12b8e0=a116_0x4336,_0x181346=resolvePushDirectoryRoot(_0x2080d6),_0x39ce3c=readPushMetadataIfPresent(resolve(_0x181346,METADATA_FILE),{'ignoreInvalidMetadata':_0x1174bb['ignoreInvalidMetadata']});if(_0x39ce3c?.[_0x12b8e0(0x1c6)]&&_0x39ce3c[_0x12b8e0(0x1c6)]!==_0x271172&&!_0x1174bb['allowAppCodeRetarget']&&!_0x1174bb[_0x12b8e0(0x1c3)])throw CliErrors[_0x12b8e0(0x1c2)](_0x12b8e0(0x1d0)+_0x39ce3c[_0x12b8e0(0x1c6)]+'\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22'+_0x271172+'\x22.');const _0x114c71=resolvePushSkillCode(_0x181346,_0x271172,_0x39ce3c,_0x1174bb);if(!_0x114c71)throw CliErrors[_0x12b8e0(0x1c2)]('Unable\x20to\x20resolve\x20skillCode\x20from\x20'+SKILL_FILE+',\x20'+METADATA_FILE+_0x12b8e0(0x1db));return{'dir':_0x181346,'skillCode':_0x114c71,'metadata':_0x39ce3c};}function a116_0x299c(){const _0x56f37a=['isFile','ignoreMetadataScope','isArray','Skill\x20directory\x20not\x20found:\x20','utf8','filter','105630HYTKGC',',\x20or\x20directory\x20name.','toLowerCase','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20','pushedAt','3203192QFQwUZ','skillName','isDirectory','ignoreMetadataSkillCode','\x20has\x20unsupported\x20scope\x20\x22','company','trim','name','607884dXxvdP','boolean','9yHtiAr','startsWith','\x20has\x20scope=\x22','Invalid\x20','targetScope','refreshedAt','length','7601XOwCoc','builtin','personal','files','scope','tags','skillCode','metadata','version','slice','\x20name\x20for\x20SkillHub\x20slug\x20generation.','match','Missing\x20','validation','ignoreMetadataAppCodeMismatch','38908IuLfpx','content','appCode','object','(unknown)','number','sourceSessionId','55066KcYUUK','replace','description','1344078UHifMV','70QUdPoF','Skill\x20metadata\x20appCode\x20\x22','dir','ignoreInvalidMetadata','string'];a116_0x299c=function(){return _0x56f37a;};return a116_0x299c();}function a116_0x4336(_0x234d3d,_0x12a12c){_0x234d3d=_0x234d3d-0x1a4;const _0x299c3d=a116_0x299c();let _0x4336a2=_0x299c3d[_0x234d3d];return _0x4336a2;}export function readPushDirectory(_0xc55c8e,_0x28d93a,_0x18152b={}){const _0x46a2f3=a116_0x4336,_0x5ceccd=resolvePushDirectoryIdentity(_0xc55c8e,_0x28d93a,_0x18152b),_0x276e17=_0x5ceccd[_0x46a2f3(0x1d1)],_0x5b4686=resolve(_0x276e17,SKILL_FILE);if(!existsSync(_0x5b4686)||!lstatSync(_0x5b4686)[_0x46a2f3(0x1d4)]())throw CliErrors[_0x46a2f3(0x1c2)](_0x46a2f3(0x1c1)+SKILL_FILE+':\x20'+_0x5b4686);const _0x5afcef=_0x5ceccd[_0x46a2f3(0x1bc)],_0x5ae260=_0x18152b[_0x46a2f3(0x1b2)]??'personal';if(!_0x18152b[_0x46a2f3(0x1d5)]&&_0x5afcef?.[_0x46a2f3(0x1b9)]===_0x46a2f3(0x1b6))throw CliErrors['validation']('Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20'+METADATA_FILE+_0x46a2f3(0x1b0)+_0x5afcef[_0x46a2f3(0x1b9)]+'\x22.');if(!_0x18152b[_0x46a2f3(0x1d5)]&&_0x5ae260===_0x46a2f3(0x1b7)&&_0x5afcef?.['scope']&&_0x5afcef[_0x46a2f3(0x1b9)]!==_0x46a2f3(0x1b7))throw CliErrors[_0x46a2f3(0x1c2)]('Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20'+METADATA_FILE+_0x46a2f3(0x1b0)+_0x5afcef[_0x46a2f3(0x1b9)]+'\x22.',_0x46a2f3(0x1dd)+_0x276e17+'\x20to\x20submit\x20company\x20Skills\x20for\x20review.');const _0x1287a6=scanSkillDirectory(_0x276e17),_0x298978=buildSkillPackage(_0x1287a6),_0x30352d=readFileSync(_0x5b4686,'utf8'),_0x39cca8=_0x5ceccd[_0x46a2f3(0x1bb)],_0x3a0efe=_0x18152b['ignoreMetadataForPayload']?undefined:_0x5afcef,_0x4087d9=readSkillDisplayName(_0x30352d);return{'skillCode':_0x39cca8,'metadata':_0x5afcef,'frontmatterDisplayName':_0x4087d9,'input':{'skillCode':_0x39cca8,'skillName':_0x4087d9??_0x3a0efe?.[_0x46a2f3(0x1a5)],'description':_0x3a0efe?.[_0x46a2f3(0x1cd)],'content':_0x30352d,'files':_0x298978['manifest'],'packageBase64':_0x298978['packageBase64'],'tags':_0x3a0efe?.[_0x46a2f3(0x1ba)],'version':_0x3a0efe?.[_0x46a2f3(0x1bd)],'sourceSessionId':_0x3a0efe?.[_0x46a2f3(0x1ca)]}};}export function refreshPushDirectoryMetadataFromRemote(_0x4e8157,_0x28c534,_0x1ba07e,_0x305e58={}){const _0x259a8d=a116_0x4336,_0x3d9c9a=resolvePushDirectoryRoot(_0x4e8157),_0x178d97=readPushMetadataIfPresent(resolve(_0x3d9c9a,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x31bd46=requireRemoteScope(_0x28c534),_0x100c6d=readLocalSkillContent(_0x3d9c9a),_0x69438e={..._0x28c534,'appCode':_0x28c534[_0x259a8d(0x1c6)]??_0x1ba07e,'skillName':_0x28c534['skillName']??_0x178d97?.['skillName'],'description':_0x28c534['description']??_0x178d97?.[_0x259a8d(0x1cd)],'tags':Array[_0x259a8d(0x1d6)](_0x28c534['tags'])?_0x28c534[_0x259a8d(0x1ba)]:_0x178d97?.[_0x259a8d(0x1ba)],'sourceSessionId':_0x28c534[_0x259a8d(0x1ca)]??_0x178d97?.['sourceSessionId'],'content':_0x28c534[_0x259a8d(0x1c5)]??_0x100c6d},_0x117077=buildMetadata(_0x69438e,_0x31bd46,_0x1ba07e,contentHash(_0x100c6d),_0x305e58[_0x259a8d(0x1b3)]);writeJsonAtomic(resolve(_0x3d9c9a,METADATA_FILE),_0x117077);}export function recordPushedRuntimeSkill(_0x2ff4ca,_0x4056a5,_0x38966a,_0xe636ea={}){const _0x4c4643=a116_0x4336,_0x1b1f46=resolvePushDirectoryRoot(_0x2ff4ca),_0x25993a=scanSkillDirectory(_0x1b1f46),_0x3219d6=_0x25993a['find'](_0x416afe=>_0x416afe['path']===SKILL_FILE),_0x559a9a=_0x3219d6?fileText(_0x3219d6):'',_0x544beb=tryNormalizePackageManifest(_0x4056a5['files']),_0x5791d6={..._0x4056a5,'content':_0x4056a5[_0x4c4643(0x1c5)]??_0x559a9a,'files':_0x544beb},_0x5a3b24=_0x544beb?normalizeLocalFiles(_0x25993a)[_0x4c4643(0x1d9)](_0x5059c0=>_0x544beb[_0x4c4643(0x1b8)]['some'](_0x3b8a43=>_0x3b8a43['path']===_0x5059c0['path'])):undefined,_0x4bf771=buildMetadata(_0x5791d6,_0xe636ea[_0x4c4643(0x1b9)]??_0x4c4643(0x1b7),_0x38966a,contentHash(_0x5791d6[_0x4c4643(0x1c5)]??''),_0xe636ea[_0x4c4643(0x1de)],_0x5a3b24);writeJsonAtomic(resolve(_0x1b1f46,METADATA_FILE),_0x4bf771);}export function deriveSkillCodeFromDirectory(_0x3a55fb,_0x5b63cb){const _0x461701=a116_0x4336,_0x3b5f02=basename(resolve(_0x3a55fb)),_0x2a7b31=_0x5b63cb+'--';return _0x3b5f02[_0x461701(0x1af)](_0x2a7b31)?_0x3b5f02[_0x461701(0x1be)](_0x2a7b31[_0x461701(0x1b4)]):_0x3b5f02;}function resolvePushSkillCode(_0x2a4d11,_0x1b7f69,_0x2f30b4,_0x1efc0b){const _0x2cbcd0=a116_0x4336,_0x7c150d=deriveSkillCodeFromSkillFile(_0x2a4d11)||deriveSkillCodeFromDirectory(_0x2a4d11,_0x1b7f69);if(_0x1efc0b[_0x2cbcd0(0x1a7)])return _0x7c150d;return _0x2f30b4?.[_0x2cbcd0(0x1bb)]?.[_0x2cbcd0(0x1aa)]()||_0x7c150d;}function deriveSkillCodeFromSkillFile(_0x529d73){const _0xe4f993=a116_0x4336,_0x407172=resolve(_0x529d73,SKILL_FILE);if(!existsSync(_0x407172)||!lstatSync(_0x407172)[_0xe4f993(0x1d4)]())return undefined;const _0x17d38f=readFileSync(_0x407172,_0xe4f993(0x1d8)),_0x43fa7b=_0x17d38f['match'](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x43fa7b)return undefined;const _0x3e53b4=parseFrontmatterObject(_0x43fa7b[0x1]??''),_0x15955a=scalarToString(_0x3e53b4?.[_0xe4f993(0x1ab)]);return _0x15955a?slugifySkillName(_0x15955a):undefined;}function readSkillDisplayName(_0x383d1e){const _0xd13e05=a116_0x4336,_0x2cb0e9=_0x383d1e[_0xd13e05(0x1c0)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x2cb0e9)return undefined;const _0x39d72=parseFrontmatterObject(_0x2cb0e9[0x1]??'');return scalarToString(_0x39d72?.['displayName']);}function slugifySkillName(_0x30165a){const _0x26c649=a116_0x4336,_0x4832e7=_0x30165a[_0x26c649(0x1aa)]()[_0x26c649(0x1dc)]()[_0x26c649(0x1cc)](/[^\p{L}\p{N}\p{So}]+/gu,'-')[_0x26c649(0x1cc)](/^-+/,'')[_0x26c649(0x1cc)](/-+$/,'')[_0x26c649(0x1cc)](/-{2,}/g,'-');if(!_0x4832e7)throw CliErrors[_0x26c649(0x1c2)](_0x26c649(0x1b1)+SKILL_FILE+_0x26c649(0x1bf));return _0x4832e7;}function parseFrontmatterObject(_0x204071){const _0x27c39e=a116_0x4336;try{const _0x371e19=a116_0x457c7d(_0x204071);return _0x371e19&&typeof _0x371e19===_0x27c39e(0x1c7)&&!Array['isArray'](_0x371e19)?_0x371e19:undefined;}catch{return undefined;}}function scalarToString(_0x3da9a5){const _0x2b8f6d=a116_0x4336;if(typeof _0x3da9a5===_0x2b8f6d(0x1d3))return _0x3da9a5[_0x2b8f6d(0x1aa)]();if(typeof _0x3da9a5===_0x2b8f6d(0x1c9)||typeof _0x3da9a5===_0x2b8f6d(0x1ad))return String(_0x3da9a5);return undefined;}function resolvePushDirectoryRoot(_0x720e4b){const _0x1810e0=a116_0x4336,_0x4baf23=resolve(_0x720e4b);if(!existsSync(_0x4baf23))throw CliErrors[_0x1810e0(0x1c2)]('Skill\x20directory\x20not\x20found:\x20'+_0x720e4b);const _0x1764ae=lstatSync(_0x4baf23);if(_0x1764ae[_0x1810e0(0x1a6)]())return _0x4baf23;if(_0x1764ae['isSymbolicLink']()){const _0x313959=realpathSync(_0x4baf23);if(lstatSync(_0x313959)[_0x1810e0(0x1a6)]())return _0x313959;}throw CliErrors[_0x1810e0(0x1c2)](_0x1810e0(0x1d7)+_0x720e4b);}function requireRemoteScope(_0x302c3a){const _0x2868de=a116_0x4336;if(_0x302c3a[_0x2868de(0x1b9)]===_0x2868de(0x1b7)||_0x302c3a['scope']===_0x2868de(0x1a9)||_0x302c3a['scope']===_0x2868de(0x1b6))return _0x302c3a['scope'];throw CliErrors[_0x2868de(0x1c2)]('Remote\x20Skill\x20'+(_0x302c3a[_0x2868de(0x1bb)]||_0x2868de(0x1c8))+_0x2868de(0x1a8)+(_0x302c3a[_0x2868de(0x1b9)]??'unknown')+'\x22.');}function readLocalSkillContent(_0x213a6a){const _0x38ec59=a116_0x4336,_0x42987b=resolve(_0x213a6a,SKILL_FILE);return existsSync(_0x42987b)&&lstatSync(_0x42987b)[_0x38ec59(0x1d4)]()?readFileSync(_0x42987b,_0x38ec59(0x1d8)):'';}function readPushMetadataIfPresent(_0x2c316c,_0x111509={}){const _0x54610a=a116_0x4336;try{return readMetadataIfPresent(_0x2c316c);}catch(_0x393ea3){if(_0x111509[_0x54610a(0x1d2)])return undefined;throw _0x393ea3;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x5022e3,_0x31523a){const _0x1a10e4=a117_0x4f31,_0x228d3f=_0x5022e3();while(!![]){try{const _0x2b837c=parseInt(_0x1a10e4(0x95))/0x1+parseInt(_0x1a10e4(0x94))/0x2+parseInt(_0x1a10e4(0x93))/0x3*(-parseInt(_0x1a10e4(0xa0))/0x4)+-parseInt(_0x1a10e4(0x9c))/0x5+parseInt(_0x1a10e4(0x9b))/0x6+-parseInt(_0x1a10e4(0x9f))/0x7*(-parseInt(_0x1a10e4(0x98))/0x8)+-parseInt(_0x1a10e4(0xa3))/0x9*(-parseInt(_0x1a10e4(0x9d))/0xa);if(_0x2b837c===_0x31523a)break;else _0x228d3f['push'](_0x228d3f['shift']());}catch(_0x185096){_0x228d3f['push'](_0x228d3f['shift']());}}}(a117_0x524d,0x713b7));import{CliErrors}from'../../errors.js';export function normalizeRuntimeSkillScopes(_0x21f7d7){const _0x477a1a=a117_0x4f31,_0x1c185e=_0x21f7d7&&_0x21f7d7[_0x477a1a(0x9e)]>0x0?_0x21f7d7:[_0x477a1a(0x99),_0x477a1a(0xa4),_0x477a1a(0x9a)],_0x5116ed=[];for(const _0x5605de of _0x1c185e){if(!isRuntimeSkillScope(_0x5605de))throw CliErrors[_0x477a1a(0x97)](_0x477a1a(0xa2)+_0x5605de);!_0x5116ed[_0x477a1a(0xa1)](_0x5605de)&&_0x5116ed[_0x477a1a(0x96)](_0x5605de);}return _0x5116ed;}export function isRuntimeSkillScope(_0x447a4a){const _0x695d7=a117_0x4f31;return _0x447a4a===_0x695d7(0x99)||_0x447a4a===_0x695d7(0xa4)||_0x447a4a===_0x695d7(0x9a);}function a117_0x4f31(_0x3fc956,_0x460ea0){_0x3fc956=_0x3fc956-0x93;const _0x524dba=a117_0x524d();let _0x4f31f8=_0x524dba[_0x3fc956];return _0x4f31f8;}function a117_0x524d(){const _0x4531f8=['26272gwmsYb','personal','builtin','1042140qYcMys','2550865oTuMyC','1713110nAnuLz','length','315yWdKfQ','20CCUjBm','includes','Unsupported\x20runtime\x20Skill\x20scope:\x20','27NLpmnf','company','344565rIeMPm','1139372scACDJ','143158YPEEKu','push','validation'];a117_0x524d=function(){return _0x4531f8;};return a117_0x524d();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a119_0x1e959f=a119_0x5a60;(function(_0x8be4da,_0x28758c){const _0x59c874=a119_0x5a60,_0x391800=_0x8be4da();while(!![]){try{const _0x12b46a=parseInt(_0x59c874(0xcc))/0x1*(-parseInt(_0x59c874(0xce))/0x2)+parseInt(_0x59c874(0xc5))/0x3+-parseInt(_0x59c874(0xd8))/0x4*(parseInt(_0x59c874(0xc6))/0x5)+-parseInt(_0x59c874(0xcd))/0x6+parseInt(_0x59c874(0xc7))/0x7*(-parseInt(_0x59c874(0xd0))/0x8)+-parseInt(_0x59c874(0xd2))/0x9*(parseInt(_0x59c874(0xc8))/0xa)+parseInt(_0x59c874(0xcf))/0xb*(parseInt(_0x59c874(0xd4))/0xc);if(_0x12b46a===_0x28758c)break;else _0x391800['push'](_0x391800['shift']());}catch(_0x2c9c31){_0x391800['push'](_0x391800['shift']());}}}(a119_0x4d0b,0x65c34));function a119_0x5a60(_0xaa908c,_0x1854cf){_0xaa908c=_0xaa908c-0xc3;const _0x4d0bcd=a119_0x4d0b();let _0x5a60ba=_0x4d0bcd[_0xaa908c];return _0x5a60ba;}import{unzipSync,zipSync}from'fflate';import{CliErrors}from'../../errors.js';import{compareSkillFiles,fileContent,normalizeLocalFiles,normalizeSkillRelativePath}from'./local-files.js';function a119_0x4d0b(){const _0x4e0447=['map','3iYKdaP','3450696uTioPi','442322xBeUgX','11tIhUhg','928zGeDAt','Runtime\x20Skill\x20package\x20contains\x20directory\x20entry:\x20','144sfrojf','validation_error','28133088TsGCMt','validation','length','code','3172rFticU','Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.','name','from','1321344bmqbNn','4765eEAPkj','10297NAgKBo','126930wTQYJU','path','1980-01-01T00:00:00.000Z'];a119_0x4d0b=function(){return _0x4e0447;};return a119_0x4d0b();}const ZIP_MTIME=new Date(a119_0x1e959f(0xca));export function createDeterministicZipPackage(_0x65f6c5){const _0x10b147=a119_0x1e959f,_0x266dc8={};for(const _0x2afe8f of normalizeLocalFiles(_0x65f6c5)){_0x266dc8[_0x2afe8f[_0x10b147(0xc9)]]=fileContent(_0x2afe8f);}return Buffer[_0x10b147(0xc4)](zipSync(_0x266dc8,{'level':0x0,'mtime':ZIP_MTIME}));}export function parseZipPackage(_0x204714){const _0x45e07f=a119_0x1e959f;if(_0x204714[_0x45e07f(0xd6)]<0x16)throw CliErrors['validation'](_0x45e07f(0xd9));let _0x2fd1ca;try{_0x2fd1ca=unzipSync(_0x204714,{'filter'(_0x1d61ec){const _0x364f26=_0x45e07f,_0x3747b9=normalizeSkillRelativePath(_0x1d61ec[_0x364f26(0xc3)]);if(_0x3747b9['endsWith']('/'))throw CliErrors[_0x364f26(0xd5)](_0x364f26(0xd1)+_0x3747b9);return!![];}});}catch(_0x41cba4){if(isRuntimeSkillValidationError(_0x41cba4))throw _0x41cba4;throw CliErrors[_0x45e07f(0xd5)]('Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.');}return Object['entries'](_0x2fd1ca)[_0x45e07f(0xcb)](([_0x2f6bfa,_0x17545f])=>({'path':normalizeSkillRelativePath(_0x2f6bfa),'bytes':Buffer[_0x45e07f(0xc4)](_0x17545f)}))['sort'](compareSkillFiles);}function isRuntimeSkillValidationError(_0x6a8b4c){const _0x206cf0=a119_0x1e959f;return typeof _0x6a8b4c==='object'&&_0x6a8b4c!==null&&_0x206cf0(0xd7)in _0x6a8b4c&&_0x6a8b4c['code']===_0x206cf0(0xd3);}
|