@lovrabet/lovrabet-cli 2.3.4-beta.2 → 2.3.5-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +44 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api-doc/index.js +1 -1
- package/lib/commands/app/cache.js +1 -1
- package/lib/commands/app/definitions.js +1 -1
- package/lib/commands/app/eligibility.js +1 -1
- package/lib/commands/app/mock-loader.js +1 -1
- package/lib/commands/app/remote-source.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/approval/index.js +1 -1
- package/lib/commands/artifact/index.js +1 -1
- package/lib/commands/auth/device.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/auth/prompt.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/exec.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/common/config-policy.js +1 -1
- package/lib/commands/common/constraints.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/config/definitions.js +1 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/import-excel.d.ts +2 -0
- package/lib/commands/data/import-excel.js +1 -0
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/sdk-doc.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/permit/dataset-get.js +1 -1
- package/lib/commands/permit/dataset-set.js +1 -1
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.js +1 -1
- package/lib/commands/personal-bff/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/schedule/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/service/dynamic.js +1 -1
- package/lib/commands/service/function-name-adapter.js +1 -1
- package/lib/commands/service/index.js +1 -1
- package/lib/commands/service/registry.js +1 -1
- package/lib/commands/skill/commands/create.js +1 -1
- package/lib/commands/skill/commands/diagram.js +1 -1
- package/lib/commands/skill/commands/install.js +1 -1
- package/lib/commands/skill/commands/list.js +1 -1
- package/lib/commands/skill/commands/push.js +1 -1
- package/lib/commands/skill/commands/validate.js +1 -1
- package/lib/commands/skill/diagram.js +1 -1
- package/lib/commands/skill/flags.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/skill/manifest-helpers.js +1 -1
- package/lib/commands/skill/push-execute.js +1 -1
- package/lib/commands/skill/push-flow-helpers.js +1 -1
- package/lib/commands/skill/push-retarget.js +1 -1
- package/lib/commands/skill/scopes.js +1 -1
- package/lib/commands/skill/summary.js +1 -1
- package/lib/commands/skill/templates.js +1 -1
- package/lib/commands/skill/validate.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/update.js +1 -1
- package/lib/commands/user-account/bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/config/domain-config.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/app.js +1 -1
- package/lib/constant/auth-mode.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/distribution.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/product.js +1 -1
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/api-client.d.ts +19 -5
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/kb-search-client.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.d.ts +1 -0
- package/lib/errors.js +1 -1
- package/lib/framework/access-error.d.ts +5 -0
- package/lib/framework/access-error.js +1 -0
- 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.d.ts +2 -17
- package/lib/framework/runner-error.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/service-order.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/services/dataset-import/auto-id-runner.d.ts +25 -0
- package/lib/services/dataset-import/auto-id-runner.js +1 -0
- package/lib/services/dataset-import/excel-reader.d.ts +3 -0
- package/lib/services/dataset-import/excel-reader.js +1 -0
- package/lib/services/dataset-import/metadata.d.ts +2 -0
- package/lib/services/dataset-import/metadata.js +1 -0
- package/lib/services/dataset-import/preview.d.ts +4 -0
- package/lib/services/dataset-import/preview.js +1 -0
- package/lib/services/dataset-import/runner.d.ts +63 -0
- package/lib/services/dataset-import/runner.js +1 -0
- package/lib/services/dataset-import/types.d.ts +33 -0
- package/lib/services/dataset-import/types.js +1 -0
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/runtime-skill-sync/constants.js +1 -1
- package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
- package/lib/skills/runtime-skill-sync/hashing.js +1 -1
- package/lib/skills/runtime-skill-sync/install-target.js +1 -1
- package/lib/skills/runtime-skill-sync/links.js +1 -1
- package/lib/skills/runtime-skill-sync/list-local.js +1 -1
- package/lib/skills/runtime-skill-sync/local-files.js +1 -1
- package/lib/skills/runtime-skill-sync/materialize.js +1 -1
- package/lib/skills/runtime-skill-sync/metadata.js +1 -1
- package/lib/skills/runtime-skill-sync/paths.js +1 -1
- package/lib/skills/runtime-skill-sync/push.js +1 -1
- package/lib/skills/runtime-skill-sync/scopes.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/utils/access-key-redaction.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/lossless-json.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/positive-safe-integer.js +1 -1
- package/lib/utils/redaction.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +8 -3
- package/skills/lovrabet/SKILL.md +10 -5
- package/skills/lovrabet/guides/dataset-and-data-workflow.md +4 -2
- package/skills/lovrabet/guides/role-and-permission-workflow.md +14 -0
- package/skills/lovrabet/guides/sql-and-bff-workflow.md +1 -1
- package/skills/lovrabet/guides/troubleshooting.md +7 -1
- package/skills/lovrabet/references/instant-api-workflow.md +6 -2
- package/skills/lovrabet/references/lovrabet-approval-workflow.md +16 -2
- package/skills/lovrabet/references/lovrabet-bff-workflow.md +9 -0
- package/skills/lovrabet/references/lovrabet-db-table-excel-import.md +113 -0
- package/skills/lovrabet/references/lovrabet-excel-import.md +31 -0
- package/skills/lovrabet/references/lovrabet-kb-workflow.md +1 -1
- package/skills/lovrabet/references/lovrabet-personal-bff-workflow.md +2 -0
- package/skills/lovrabet.manifest.json +5 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a145_0x1917e8=a145_0x44d6;(function(_0x5cb023,_0x1f34e3){const _0x29714c=a145_0x44d6,_0x11da58=_0x5cb023();while(!![]){try{const _0x4f44c7=-parseInt(_0x29714c(0x118))/0x1+-parseInt(_0x29714c(0x105))/0x2+-parseInt(_0x29714c(0xfd))/0x3*(-parseInt(_0x29714c(0x12a))/0x4)+-parseInt(_0x29714c(0x128))/0x5*(-parseInt(_0x29714c(0x10e))/0x6)+-parseInt(_0x29714c(0x120))/0x7+-parseInt(_0x29714c(0x12b))/0x8*(-parseInt(_0x29714c(0xfe))/0x9)+parseInt(_0x29714c(0x107))/0xa;if(_0x4f44c7===_0x1f34e3)break;else _0x11da58['push'](_0x11da58['shift']());}catch(_0x3df3a8){_0x11da58['push'](_0x11da58['shift']());}}}(a145_0x4c59,0xe82f4));import{execaSync}from'execa';import{LOVRABET_SKILL_SOURCE as a145_0x2eeebd}from'../constant/distribution.js';import{PRODUCT_CONFIG,productEnvName}from'../constant/product.js';import{resolveInstalledSkill}from'../skills/skill-presence.js';function a145_0x44d6(_0x33861d,_0x5c1b4c){_0x33861d=_0x33861d-0xf8;const _0x4c590a=a145_0x4c59();let _0x44d681=_0x4c590a[_0x33861d];return _0x44d681;}export const LOVRABET_SKILL_SOURCE=a145_0x2eeebd;export const LOVRABET_SKILL_GIT_SOURCE=PRODUCT_CONFIG[a145_0x1917e8(0x11e)];export const LOVRABET_GLOBAL_SKILL_NAME=PRODUCT_CONFIG['globalSkillName'];export function resolveGlobalSkillName(_0x4bd1ee){const _0x6c6dd7=a145_0x1917e8;switch(_0x4bd1ee[_0x6c6dd7(0x104)]()){case LOVRABET_SKILL_SOURCE:case LOVRABET_SKILL_GIT_SOURCE:return LOVRABET_GLOBAL_SKILL_NAME;default:return undefined;}}export const LOVRABET_SKIP_NPX_SKILLS_ENV=productEnvName(PRODUCT_CONFIG[a145_0x1917e8(0x10d)]);const CHILD_OUTPUT_MAX_BUFFER=0x10*0x400*0x400;function failure(_0x4ae118,_0x272982,_0x24ee43){return{'ok':![],'status':_0x272982,'code':_0x4ae118,'error':'['+_0x4ae118+']\x20'+_0x24ee43};}export function shouldSkipNpxSkillsAdd(){return process.env[LOVRABET_SKIP_NPX_SKILLS_ENV]==='1';}function a145_0x4c59(){const _0x5a3a99=['2261259Njikse','NPM_CONFIG_GLOBAL','signal','npm_config_global','Installer\x20reported\x20','message','shortMessage','\x22\x20not\x20found\x20after\x20install\x20(checked\x20','1201160ufEcns','add','4UbPpKF','2922032miHxeL','SKILL_NOT_INSTALLED','pipe','filter','failed','!\x20Could\x20not\x20verify\x20\x22','EPERM','Skill\x20\x22','2175561mPmqfr','9dISztH','CHILD_EXIT_NONZERO','npx\x20failed\x20to\x20start','warn','exit\x20','absent','trim','2749816maFdyW','expectedSkillName','6178930vIjDbz','NPX_NOT_FOUND','state','checked','PERMISSION_DENIED','EACCES','skipNpxSkillsEnvSuffix','30biFepD','stderr','code','exitCode','presence','log','stdout','\x20failed\x20target(s)','skills@latest','match','260521KsveOz','join','unverifiable','npx','stdio','CHILD_TERMINATED','internalSkillSource','SPAWN_FAILED'];a145_0x4c59=function(){return _0x5a3a99;};return a145_0x4c59();}export function runNpxSkillsAddGlobal(_0x577342,_0x1b8559=LOVRABET_SKILL_SOURCE,_0x44ae1e){const _0x2721d5=a145_0x1917e8;if(shouldSkipNpxSkillsAdd())return{'ok':!![],'status':0x0,'skipped':!![]};const _0xdafda9=['-y',_0x2721d5(0x116),_0x2721d5(0x129),_0x1b8559,'-g','-y'],_0x2f78b1=['npx',..._0xdafda9][_0x2721d5(0x119)]('\x20');console[_0x2721d5(0x113)]('*\x20'+_0x2f78b1);const _0x48abc7={...process.env};delete _0x48abc7[_0x2721d5(0x123)],delete _0x48abc7[_0x2721d5(0x121)];const _0x252be2=execaSync(_0x2721d5(0x11b),_0xdafda9,{'cwd':_0x577342,'stdio':_0x2721d5(0x12d),'env':_0x48abc7,'extendEnv':![],'shell':![],'reject':![],'maxBuffer':CHILD_OUTPUT_MAX_BUFFER}),_0x3a5276=[_0x252be2[_0x2721d5(0x114)]?String(_0x252be2[_0x2721d5(0x114)]):'',_0x252be2[_0x2721d5(0x10f)]?String(_0x252be2[_0x2721d5(0x10f)]):''][_0x2721d5(0xf8)](Boolean)[_0x2721d5(0x119)]('\x0a')['trim'](),_0x2ceeed=_0x252be2[_0x2721d5(0x111)]??null,_0x4196b7=_0x1585fb=>{const _0x556463=_0x2721d5;return _0x44ae1e?.[_0x556463(0x11c)]!==_0x556463(0x12d)&&!_0x1585fb['partialFailure']&&_0x3a5276&&console['log'](_0x3a5276),_0x1585fb;};if(_0x252be2[_0x2721d5(0x110)]){const _0x3ae2ad=_0x252be2['code']==='ENOENT'?_0x2721d5(0x108):_0x252be2[_0x2721d5(0x110)]===_0x2721d5(0xfb)||_0x252be2[_0x2721d5(0x110)]===_0x2721d5(0x10c)?_0x2721d5(0x10b):'SPAWN_FAILED';return _0x4196b7(failure(_0x3ae2ad,_0x2ceeed,_0x252be2[_0x2721d5(0x126)]??_0x252be2[_0x2721d5(0x125)]??_0x252be2[_0x2721d5(0x110)]));}if(_0x252be2[_0x2721d5(0x122)])return _0x4196b7(failure(_0x2721d5(0x11d),_0x2ceeed,'npx\x20terminated\x20by\x20signal\x20'+_0x252be2['signal']));if(_0x252be2[_0x2721d5(0xf9)]&&_0x2ceeed===null)return _0x4196b7(failure(_0x2721d5(0x11f),_0x2ceeed,_0x252be2[_0x2721d5(0x126)]??_0x252be2[_0x2721d5(0x125)]??_0x2721d5(0x100)));if(_0x2ceeed!==0x0)return _0x4196b7(failure(_0x2721d5(0xff),_0x2ceeed,_0x3a5276||_0x252be2[_0x2721d5(0x126)]||_0x2721d5(0x102)+(_0x2ceeed??'unknown')));const _0x5062d6=_0x44ae1e?.[_0x2721d5(0x106)]??resolveGlobalSkillName(_0x1b8559),_0x57b301=_0x5062d6?resolveInstalledSkill(_0x5062d6,_0x44ae1e?.[_0x2721d5(0x112)]):undefined,_0x10870f=_0x3a5276[_0x2721d5(0x117)](/Failed to install\s+(\d+)/i);if(_0x10870f&&Number(_0x10870f[0x1])>0x0){const _0x1c9716=_0x2721d5(0x124)+_0x10870f[0x1]+_0x2721d5(0x115)+(_0x3a5276?':\x0a'+_0x3a5276:'');if(_0x57b301?.[_0x2721d5(0x109)]==='present')return{'ok':!![],'status':0x0,'partialFailure':{'count':Number(_0x10870f[0x1]),'output':_0x3a5276}};return _0x4196b7(failure('INSTALL_PARTIAL',0x0,_0x1c9716));}if(_0x5062d6&&_0x57b301){if(_0x57b301[_0x2721d5(0x109)]===_0x2721d5(0x103))return _0x4196b7(failure(_0x2721d5(0x12c),0x0,_0x2721d5(0xfc)+_0x5062d6+_0x2721d5(0x127)+_0x57b301[_0x2721d5(0x10a)][_0x2721d5(0x119)](',\x20')+')'));_0x57b301[_0x2721d5(0x109)]===_0x2721d5(0x11a)&&console[_0x2721d5(0x101)](_0x2721d5(0xfa)+_0x5062d6+'\x22\x20install\x20state:\x20'+_0x57b301['reason']);}return _0x4196b7({'ok':!![],'status':0x0});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a146_0x56fa21=a146_0x2fca;(function(_0x4dc21b,_0x4b9ca8){const _0x1e1127=a146_0x2fca,_0x2ebf29=_0x4dc21b();while(!![]){try{const _0x2bc7a4=-parseInt(_0x1e1127(0x1a2))/0x1*(-parseInt(_0x1e1127(0x1ab))/0x2)+-parseInt(_0x1e1127(0x1a7))/0x3*(parseInt(_0x1e1127(0x19c))/0x4)+-parseInt(_0x1e1127(0x1ac))/0x5+-parseInt(_0x1e1127(0x19d))/0x6+-parseInt(_0x1e1127(0x1a6))/0x7*(-parseInt(_0x1e1127(0x1a3))/0x8)+parseInt(_0x1e1127(0x19b))/0x9+parseInt(_0x1e1127(0x1aa))/0xa;if(_0x2bc7a4===_0x4b9ca8)break;else _0x2ebf29['push'](_0x2ebf29['shift']());}catch(_0x3292f5){_0x2ebf29['push'](_0x2ebf29['shift']());}}}(a146_0x3783,0xeb32a));function a146_0x3783(){const _0x12192d=['.svn','coverage','.turbo','16381539znQlGC','4PWXeYm','9587118lnXMyl','lovrabet.skill.json','build','.DS_Store','dist','11445xBPzrY','7302048gdaRhb','node_modules','SKILL.md','14EmMkrM','5069091EzTzSA','.next','.git','13521680ArloBP','86trphFm','6195330gPVkIA'];a146_0x3783=function(){return _0x12192d;};return a146_0x3783();}function a146_0x2fca(_0xa9c1c0,_0x5416e4){_0xa9c1c0=_0xa9c1c0-0x19a;const _0x378313=a146_0x3783();let _0x2fca3f=_0x378313[_0xa9c1c0];return _0x2fca3f;}export const METADATA_FILE=a146_0x56fa21(0x19e);export const SKILL_FILE=a146_0x56fa21(0x1a5);export const IGNORED_FILE_NAMES=new Set([METADATA_FILE,a146_0x56fa21(0x1a0)]);export const IGNORED_DIR_NAMES=new Set([a146_0x56fa21(0x1a9),'.hg',a146_0x56fa21(0x1ad),a146_0x56fa21(0x1a4),a146_0x56fa21(0x1a8),a146_0x56fa21(0x1a1),a146_0x56fa21(0x19f),a146_0x56fa21(0x1ae),a146_0x56fa21(0x19a),'.cache']);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a147_0x1994(_0x1a3582,_0x148ca6){_0x1a3582=_0x1a3582-0x17b;const _0xac03a4=a147_0xac03();let _0x1994c5=_0xac03a4[_0x1a3582];return _0x1994c5;}(function(_0x1339ec,_0x5e2b8b){const _0x530081=a147_0x1994,_0xb24a86=_0x1339ec();while(!![]){try{const _0x1482bb=-parseInt(_0x530081(0x183))/0x1*(parseInt(_0x530081(0x187))/0x2)+-parseInt(_0x530081(0x181))/0x3*(-parseInt(_0x530081(0x186))/0x4)+parseInt(_0x530081(0x18c))/0x5*(parseInt(_0x530081(0x17e))/0x6)+parseInt(_0x530081(0x17d))/0x7+parseInt(_0x530081(0x185))/0x8+-parseInt(_0x530081(0x18a))/0x9+parseInt(_0x530081(0x180))/0xa*(-parseInt(_0x530081(0x18d))/0xb);if(_0x1482bb===_0x5e2b8b)break;else _0xb24a86['push'](_0xb24a86['shift']());}catch(_0x45b1b8){_0xb24a86['push'](_0xb24a86['shift']());}}}(a147_0xac03,0x5412f));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(_0x53d8b9,_0x3295a6){const _0x5cc3db=a147_0x1994,_0x32d876=normalizeSkillRelativePath(_0x3295a6),_0x3a0f70=realOrResolved(_0x53d8b9),_0x13a17d=resolve(_0x3a0f70,..._0x32d876[_0x5cc3db(0x184)]('/'));if(!isPathInside(_0x13a17d,_0x3a0f70))throw CliErrors['validation']('Unsafe\x20Skill\x20file\x20path:\x20'+_0x3295a6);return ensureNoSymlinkInManagedPath(_0x3a0f70,_0x32d876),_0x13a17d;}export function ensureNoSymlinkInManagedPath(_0x134e2d,_0x336844){const _0x55c0c5=a147_0x1994;let _0x712910=_0x134e2d;for(const _0x2ab148 of _0x336844[_0x55c0c5(0x184)]('/')){_0x712910=resolve(_0x712910,_0x2ab148);const _0x900b49=lstatIfPresent(_0x712910);if(_0x900b49?.['isSymbolicLink']())throw CliErrors[_0x55c0c5(0x188)](_0x55c0c5(0x182)+_0x336844);}}export function isDanglingSymlink(_0x9585c9){const _0x35ba4d=a147_0x1994;try{return lstatSync(_0x9585c9)[_0x35ba4d(0x189)]();}catch{return![];}}export function resolveSymlinkTarget(_0x440561){const _0x214071=readlinkSync(_0x440561);return isAbsolute(_0x214071)?_0x214071:resolve(dirname(_0x440561),_0x214071);}export function isPathInside(_0x18eaf8,_0x2ead10){const _0x553228=a147_0x1994,_0x44bb4=_0x18eaf8[_0x553228(0x17f)](sep)?_0x18eaf8:''+_0x18eaf8+sep,_0x41c028=_0x2ead10[_0x553228(0x17f)](sep)?_0x2ead10:''+_0x2ead10+sep;return _0x18eaf8===_0x2ead10||_0x44bb4['startsWith'](_0x41c028);}export function realOrResolved(_0x15b319){try{return realpathSync(_0x15b319);}catch{return resolve(_0x15b319);}}export function lstatIfPresent(_0x2b47d8){try{return lstatSync(_0x2b47d8);}catch{return undefined;}}export function writeTextAtomic(_0x363f53,_0x4c7ed1,_0x5b4223){const _0x1857dc=a147_0x1994;writeBytesAtomic(_0x363f53,Buffer[_0x1857dc(0x18b)](_0x4c7ed1,_0x1857dc(0x17c)),_0x5b4223);}function a147_0xac03(){const _0x1980fc=['40818hNgmTG','endsWith','20lqbrNV','117kPQVGL','Refusing\x20to\x20write\x20through\x20Skill\x20symlink\x20path:\x20','1907CBbbDn','split','4820648DWVFlY','52128xrtNgJ','166QDRWEJ','validation','isSymbolicLink','2011311XXQPkB','from','30yPyutr','3433892xEeGpQ','.tmp','stringify','utf8','1391768vOJaVf'];a147_0xac03=function(){return _0x1980fc;};return a147_0xac03();}export function writeBytesAtomic(_0x5f4a9f,_0x368e4d,_0x15c1ea){const _0x39e274=a147_0x1994,_0x2a9ba7=_0x5f4a9f+_0x39e274(0x18e);try{writeFileSync(_0x2a9ba7,_0x368e4d,{'mode':_0x15c1ea}),renameSync(_0x2a9ba7,_0x5f4a9f);}catch(_0x1ed788){try{rmSync(_0x2a9ba7,{'force':!![]});}catch{}throw _0x1ed788;}}export function writeJsonAtomic(_0x29d984,_0x3162ca){const _0x4b3ad2=a147_0x1994;writeTextAtomic(_0x29d984,JSON[_0x4b3ad2(0x17b)](_0x3162ca,null,0x2)+'\x0a',0x180);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x233b42,_0x188ca0){const _0x5a8871=a148_0x5f34,_0x4314b6=_0x233b42();while(!![]){try{const _0x31d454=-parseInt(_0x5a8871(0xab))/0x1+parseInt(_0x5a8871(0xb5))/0x2*(parseInt(_0x5a8871(0xaf))/0x3)+-parseInt(_0x5a8871(0xb0))/0x4*(parseInt(_0x5a8871(0xaa))/0x5)+parseInt(_0x5a8871(0xb7))/0x6*(-parseInt(_0x5a8871(0xac))/0x7)+parseInt(_0x5a8871(0xb3))/0x8+-parseInt(_0x5a8871(0xb2))/0x9+parseInt(_0x5a8871(0xb9))/0xa*(parseInt(_0x5a8871(0xad))/0xb);if(_0x31d454===_0x188ca0)break;else _0x4314b6['push'](_0x4314b6['shift']());}catch(_0x266114){_0x4314b6['push'](_0x4314b6['shift']());}}}(a148_0x387f,0xa3216));import{createHash}from'node:crypto';import{fileContent,normalizeManifestFiles}from'./local-files.js';function a148_0x5f34(_0x3ea7fe,_0x34addb){_0x3ea7fe=_0x3ea7fe-0xaa;const _0x387fac=a148_0x387f();let _0x5f3474=_0x387fac[_0x3ea7fe];return _0x5f3474;}export function contentHash(_0x4b4b5f){const _0x58137d=a148_0x5f34;return createHash(_0x58137d(0xb4))['update'](_0x4b4b5f)[_0x58137d(0xb1)](_0x58137d(0xb6));}export function fileHash(_0x112837){return bufferSha256(fileContent(_0x112837));}function a148_0x387f(){const _0x415389=['223134pMOhFP','4hiLmxg','digest','11800620ObFUAO','6383144XPNMVA','sha256','28lxQJur','hex','1567476DwYfFM','size','70buqaNx','3777290keKbWW','513293LLYMXX','21DdrpqY','3445618LQAwsV','update'];a148_0x387f=function(){return _0x415389;};return a148_0x387f();}export function bufferSha256(_0x4b4884){const _0xd15e1a=a148_0x5f34;return createHash(_0xd15e1a(0xb4))[_0xd15e1a(0xae)](_0x4b4884)[_0xd15e1a(0xb1)]('hex');}export function fileTreeHash(_0x1f01bd){const _0x4c9765=a148_0x5f34,_0x4c6bd1=createHash(_0x4c9765(0xb4));for(const _0x41803c of normalizeManifestFiles(_0x1f01bd)){_0x4c6bd1[_0x4c9765(0xae)](_0x41803c['path']),_0x4c6bd1[_0x4c9765(0xae)]('\x00'),_0x4c6bd1[_0x4c9765(0xae)](_0x41803c['sha256']),_0x4c6bd1['update']('\x00'),_0x4c6bd1['update'](String(_0x41803c[_0x4c9765(0xb8)])),_0x4c6bd1[_0x4c9765(0xae)]('\x00');}return _0x4c6bd1[_0x4c9765(0xb1)](_0x4c9765(0xb6));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x45cbce,_0x4c3807){const _0x58cc1e=a149_0x5a3c,_0x1eb5c9=_0x45cbce();while(!![]){try{const _0x439f55=parseInt(_0x58cc1e(0xdb))/0x1+-parseInt(_0x58cc1e(0xd8))/0x2*(parseInt(_0x58cc1e(0xdd))/0x3)+parseInt(_0x58cc1e(0xd3))/0x4+-parseInt(_0x58cc1e(0xd4))/0x5*(parseInt(_0x58cc1e(0xd6))/0x6)+parseInt(_0x58cc1e(0xe0))/0x7+-parseInt(_0x58cc1e(0xd2))/0x8*(-parseInt(_0x58cc1e(0xde))/0x9)+parseInt(_0x58cc1e(0xd9))/0xa;if(_0x439f55===_0x4c3807)break;else _0x1eb5c9['push'](_0x1eb5c9['shift']());}catch(_0x17416c){_0x1eb5c9['push'](_0x1eb5c9['shift']());}}}(a149_0x1724,0x8df66));import{resolve}from'node:path';function a149_0x5a3c(_0x1a4e7c,_0x29f025){_0x1a4e7c=_0x1a4e7c-0xd2;const _0x172476=a149_0x1724();let _0x5a3c59=_0x172476[_0x1a4e7c];return _0x5a3c59;}function a149_0x1724(){const _0x3fd40e=['freeze','4036896tAhLgl','cwd','990680fmUhcF','8261500KSSwdS','skills','151929HfRRjt','managedRoot','6ZssFor','18XekpPl','project','762895LWJIEU','appCode','3226616kLAhir','1405024fMUVkt','5ZgRrTQ'];a149_0x1724=function(){return _0x3fd40e;};return a149_0x1724();}import{resolveSkillSyncPaths,runtimeAgentSkillRoots,safePathSegment}from'./paths.js';export function resolveRuntimeSkillInstallTarget(_0xc73e5c,_0x2c670f='global',_0x5d64a2={}){const _0x47826f=a149_0x5a3c,_0x1d7988=resolveSkillSyncPaths(_0x5d64a2),_0x3cea24=safePathSegment(_0xc73e5c,_0x47826f(0xe1)),_0x26dd98=_0x2c670f===_0x47826f(0xdf)?[resolve(_0x5d64a2[_0x47826f(0xd7)]??process[_0x47826f(0xd7)](),'.agents',_0x47826f(0xda))]:runtimeAgentSkillRoots(_0x1d7988);return Object[_0x47826f(0xd5)]({'scope':_0x2c670f,'appCode':_0x3cea24,'skillRoots':Object[_0x47826f(0xd5)](_0x26dd98),'managedRoot':_0x1d7988[_0x47826f(0xdc)]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a142_0x1635b4=a142_0x244c;(function(_0x1c0963,_0x1f3c7b){const _0x709521=a142_0x244c,_0xef4a71=_0x1c0963();while(!![]){try{const _0x1d321d=-parseInt(_0x709521(0x1c4))/0x1+-parseInt(_0x709521(0x1c8))/0x2*(parseInt(_0x709521(0x1c9))/0x3)+-parseInt(_0x709521(0x1bb))/0x4*(-parseInt(_0x709521(0x1c2))/0x5)+parseInt(_0x709521(0x1b6))/0x6+-parseInt(_0x709521(0x1ea))/0x7+-parseInt(_0x709521(0x1d1))/0x8*(-parseInt(_0x709521(0x1f1))/0x9)+-parseInt(_0x709521(0x1d6))/0xa*(parseInt(_0x709521(0x1e0))/0xb);if(_0x1d321d===_0x1f3c7b)break;else _0xef4a71['push'](_0xef4a71['shift']());}catch(_0x49b223){_0xef4a71['push'](_0xef4a71['shift']());}}}(a142_0x53b1,0xa4ee8));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import a142_0x4be12c from'fs-extra';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';import{isDanglingSymlink,isPathInside,lstatIfPresent,realOrResolved,resolveSymlinkTarget}from'./fs-utils.js';import{readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillCacheRoot,resolveSkillSyncPaths,safePathSegment}from'./paths.js';const {copySync,ensureDirSync,removeSync}=a142_0x4be12c,RESERVED_PROJECT_SKILL_CODES=new Set([a142_0x1635b4(0x1ee),a142_0x1635b4(0x1e6),a142_0x1635b4(0x1eb)]);export function linkEffectiveRuntimeSkills(_0xac8b53,_0x3ecc43){const _0x1688d9=a142_0x1635b4,_0x38e03c=new Map();for(const _0x144ce6 of _0xac8b53){const _0x585f69=_0x144ce6[_0x1688d9(0x1bd)][_0x1688d9(0x1bf)];if(!_0x585f69)continue;const _0x4f136d=_0x38e03c[_0x1688d9(0x1d9)](_0x585f69);(!_0x4f136d||_0x144ce6[_0x1688d9(0x1e5)]==='personal')&&_0x38e03c[_0x1688d9(0x1d7)](_0x585f69,_0x144ce6);}const _0x2d12e0=[];for(const _0x141377 of _0x38e03c[_0x1688d9(0x1be)]()){const _0x773345=requireSkillCode(_0x141377['skill']),_0x36e391=readMetadataIfPresent(_0x141377[_0x1688d9(0x1d4)]);if(_0x36e391?.[_0x1688d9(0x1e2)]!==_0x3ecc43['appCode']||_0x36e391[_0x1688d9(0x1bf)]!==_0x773345)throw CliErrors[_0x1688d9(0x1e1)](_0x1688d9(0x1dd)+_0x3ecc43[_0x1688d9(0x1e2)]+':\x20'+_0x141377[_0x1688d9(0x1d4)]);const _0x58d92a=runtimeSkillLinkName(_0x3ecc43,_0x773345);for(const _0x322b97 of _0x3ecc43['skillRoots']){_0x2d12e0[_0x1688d9(0x1dc)](ensureManagedSymlink(resolve(_0x322b97,_0x58d92a),_0x141377[_0x1688d9(0x1c1)],_0x3ecc43,_0x773345));}}return _0x2d12e0;}export function pruneStaleRuntimeSkillLinks(_0x18b48c,_0x1e107d,_0x568ffd){const _0x465939=a142_0x1635b4,_0x368118=new Set([..._0x1e107d][_0x465939(0x1ed)](_0x83cca0=>_0x83cca0['trim']())[_0x465939(0x1b4)](Boolean)),_0x1d468b=_0x568ffd?new Set([..._0x568ffd][_0x465939(0x1ed)](_0x20914e=>_0x20914e[_0x465939(0x1c7)]())['filter'](Boolean)):undefined,_0x173ca6=[];for(const _0x218b8a of _0x18b48c[_0x465939(0x1cd)]){for(const _0x23c0ca of managedTargetSkillLinkPaths(_0x218b8a,_0x18b48c)){const _0x278dde=runtimeSkillCodeFromLink(_0x18b48c,_0x23c0ca);if(_0x1d468b&&!_0x1d468b['has'](_0x278dde))continue;if(_0x368118[_0x465939(0x1f2)](_0x278dde))continue;_0x173ca6['push'](removeManagedSkillLink(_0x23c0ca,_0x18b48c,_0x278dde));}}return _0x173ca6;}export function pruneStaleRuntimeSkillCache(_0xa7125a,_0x555991={}){const _0x513d8f=a142_0x1635b4,_0x222af7=new Set([..._0xa7125a[_0x513d8f(0x1d5)]][_0x513d8f(0x1ed)](_0x5e06e9=>_0x5e06e9[_0x513d8f(0x1c7)]())[_0x513d8f(0x1b4)](Boolean)),_0x23d65e=_0xa7125a[_0x513d8f(0x1ba)]?new Set([..._0xa7125a[_0x513d8f(0x1ba)]]['map'](_0x6e47d5=>_0x6e47d5[_0x513d8f(0x1c7)]())[_0x513d8f(0x1b4)](Boolean)):undefined,_0x153eb1=_0xa7125a[_0x513d8f(0x1c5)]??[_0x513d8f(0x1c0),_0x513d8f(0x1da)],_0x25c469=resolve(getRuntimeSkillCacheRoot(_0xa7125a[_0x513d8f(0x1c3)],_0xa7125a[_0x513d8f(0x1c6)],_0x555991),safePathSegment(_0xa7125a[_0x513d8f(0x1e2)],_0x513d8f(0x1e2))),_0x6cc1fe=[];for(const _0x4d67a2 of _0x153eb1){const _0x29e9d8=resolve(_0x25c469,_0x4d67a2);if(!existsSync(_0x29e9d8))continue;for(const _0x855b38 of readdirSync(_0x29e9d8,{'withFileTypes':!![]})){if(!_0x855b38['isDirectory']())continue;const _0xa7516=_0x855b38[_0x513d8f(0x1ce)];if(_0x23d65e&&!_0x23d65e[_0x513d8f(0x1f2)](_0xa7516))continue;if(_0x222af7[_0x513d8f(0x1f2)](_0xa7516))continue;const _0x1b55c5=resolve(_0x29e9d8,_0xa7516),_0x5ee1e1=readMetadataIfPresent(resolve(_0x1b55c5,METADATA_FILE));if(_0x5ee1e1?.[_0x513d8f(0x1e2)]!==_0xa7125a['appCode']||_0x5ee1e1[_0x513d8f(0x1e5)]!==_0x4d67a2||_0x5ee1e1[_0x513d8f(0x1bf)]!==_0xa7516){_0x6cc1fe[_0x513d8f(0x1dc)]({'path':_0x1b55c5,'action':_0x513d8f(0x1cb),'reason':_0x513d8f(0x1e7)});continue;}if(isLinkedFromAnyRoot(_0x1b55c5,_0xa7125a[_0x513d8f(0x1ef)]??[])){_0x6cc1fe[_0x513d8f(0x1dc)]({'path':_0x1b55c5,'action':_0x513d8f(0x1cb),'reason':_0x513d8f(0x1b7)});continue;}removeSync(_0x1b55c5),_0x6cc1fe[_0x513d8f(0x1dc)]({'path':_0x1b55c5,'action':_0x513d8f(0x1ec)});}}return _0x6cc1fe;}export function linkGlobalRuntimeSkills(_0x392e85,_0x2bf7eb={}){const _0x1671d5=a142_0x1635b4,_0x5c7fc7=resolveSkillSyncPaths(_0x2bf7eb),_0x4cd1f8=[];for(const _0x30a189 of _0x392e85){if(_0x30a189[_0x1671d5(0x1e5)]!==_0x1671d5(0x1d3))throw CliErrors[_0x1671d5(0x1e1)](_0x1671d5(0x1e9)+_0x30a189[_0x1671d5(0x1e5)]);const _0x3f7b23=requireSkillCode(_0x30a189[_0x1671d5(0x1bd)]),_0x29303f=copyManagedSkillDirectory(_0x30a189[_0x1671d5(0x1c1)],resolve(_0x5c7fc7[_0x1671d5(0x1de)],_0x3f7b23));_0x4cd1f8['push']({..._0x29303f,'contentHash':_0x30a189[_0x1671d5(0x1cc)]});}return _0x4cd1f8;}function ensureManagedSymlink(_0xd6b231,_0x18f420,_0x123d32,_0x5cf4b5){const _0x27610c=a142_0x1635b4;mkdirSync(dirname(_0xd6b231),{'recursive':!![],'mode':0x1c0});if(existsSync(_0xd6b231)||isDanglingSymlink(_0xd6b231)){const _0x5a8766=lstatSync(_0xd6b231);if(!_0x5a8766[_0x27610c(0x1e4)]())throw CliErrors[_0x27610c(0x1e1)](_0x27610c(0x1bc)+_0xd6b231);const _0xc45789=resolveSymlinkTarget(_0xd6b231);if(!isPathInside(realOrResolved(_0xc45789),realOrResolved(_0x123d32[_0x27610c(0x1f0)])))throw CliErrors[_0x27610c(0x1e1)]('Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20'+_0xd6b231);if(realOrResolved(_0xc45789)===realOrResolved(_0x18f420))return{'path':_0xd6b231,'target':_0x18f420,'action':_0x27610c(0x1e3)};const _0x25c0d8=readMetadataIfPresent(resolve(_0xc45789,METADATA_FILE));if(_0x123d32[_0x27610c(0x1e5)]==='project'&&(_0x25c0d8?.[_0x27610c(0x1e2)]!==_0x123d32[_0x27610c(0x1e2)]||_0x25c0d8[_0x27610c(0x1bf)]!==_0x5cf4b5))throw CliErrors['validation'](_0x27610c(0x1df)+_0xd6b231);return unlinkSync(_0xd6b231),symlinkSync(_0x18f420,_0xd6b231,_0x27610c(0x1c1)),{'path':_0xd6b231,'target':_0x18f420,'action':'updated'};}return symlinkSync(_0x18f420,_0xd6b231,_0x27610c(0x1c1)),{'path':_0xd6b231,'target':_0x18f420,'action':_0x27610c(0x1b5)};}function managedTargetSkillLinkPaths(_0x2f8d42,_0x2a9c02){const _0x12707e=a142_0x1635b4;if(!existsSync(_0x2f8d42))return[];const _0x43c9c2=_0x2a9c02[_0x12707e(0x1e2)]+'--';return readdirSync(_0x2f8d42,{'withFileTypes':!![]})['filter'](_0xbe8e17=>_0x2a9c02[_0x12707e(0x1e5)]===_0x12707e(0x1e8)||_0xbe8e17[_0x12707e(0x1ce)][_0x12707e(0x1d2)](_0x43c9c2))[_0x12707e(0x1ed)](_0x4914f0=>resolve(_0x2f8d42,_0x4914f0[_0x12707e(0x1ce)]));}function removeManagedSkillLink(_0x27970f,_0x3080af,_0x223fb1){const _0x1436de=a142_0x1635b4,_0x234559=lstatIfPresent(_0x27970f);if(!_0x234559?.[_0x1436de(0x1e4)]())return{'path':_0x27970f,'action':'skipped','reason':'not-managed-symlink'};const _0x40ee16=resolveSymlinkTarget(_0x27970f);if(!isPathInside(realOrResolved(_0x40ee16),realOrResolved(_0x3080af[_0x1436de(0x1f0)])))return{'path':_0x27970f,'action':_0x1436de(0x1cb),'reason':'external-symlink'};const _0x4e47c2=readMetadataIfPresent(resolve(_0x40ee16,METADATA_FILE));if(_0x3080af[_0x1436de(0x1e5)]===_0x1436de(0x1e8)&&(_0x4e47c2?.[_0x1436de(0x1e2)]!==_0x3080af['appCode']||_0x4e47c2[_0x1436de(0x1bf)]!==_0x223fb1))return{'path':_0x27970f,'action':_0x1436de(0x1cb),'reason':'metadata-mismatch'};return unlinkSync(_0x27970f),{'path':_0x27970f,'action':_0x1436de(0x1ec)};}function isLinkedFromAnyRoot(_0x30cc4c,_0x33c9ef){const _0xa975e1=a142_0x1635b4,_0x42d5e5=realOrResolved(_0x30cc4c);for(const _0xb55839 of _0x33c9ef){if(!existsSync(_0xb55839))continue;for(const _0x123c32 of readdirSync(_0xb55839,{'withFileTypes':!![]})){if(!_0x123c32[_0xa975e1(0x1e4)]())continue;const _0x23e9f6=resolve(_0xb55839,_0x123c32[_0xa975e1(0x1ce)]);if(realOrResolved(resolveSymlinkTarget(_0x23e9f6))===_0x42d5e5)return!![];}}return![];}function runtimeSkillLinkName(_0x2ea6fc,_0x32fa42){const _0x2041d8=a142_0x1635b4,_0x1efb8a=safePathSegment(_0x32fa42,_0x2041d8(0x1bf));if(_0x2ea6fc[_0x2041d8(0x1e5)]===_0x2041d8(0x1e8)&&RESERVED_PROJECT_SKILL_CODES[_0x2041d8(0x1f2)](_0x1efb8a))throw CliErrors[_0x2041d8(0x1e1)](_0x2041d8(0x1b8)+_0x1efb8a);return _0x2ea6fc[_0x2041d8(0x1e5)]===_0x2041d8(0x1e8)?_0x1efb8a:_0x2ea6fc[_0x2041d8(0x1e2)]+'--'+_0x1efb8a;}function a142_0x53b1(){const _0x444abf=['builtin','metadataPath','activeSkillCodes','850530fBWNCX','set','Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20','get','company','updated','push','Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20','agentsSkillsDir','Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20','33eWELgE','validation','appCode','unchanged','isSymbolicLink','scope','runtime-observe','metadata-mismatch','project','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','3159618iLCRUX','secret-retriever','removed','map','lovrabet','protectedLinkRoots','managedRoot','12105630XwHXAi','has','length','filter','created','1624812fntMHO','linked-from-protected-root','Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20','Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20','pruneSkillCodes','1781908QdyytH','Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20','skill','values','skillCode','personal','dir','10BZWxcn','env','432213WbRXGb','scopes','accessKey','trim','120Usqice','34626HQvJSv','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20','skipped','contentHash','skillRoots','name','slice','Refusing\x20to\x20copy\x20Skill\x20symlink:\x20','8ImJuqn','startsWith'];a142_0x53b1=function(){return _0x444abf;};return a142_0x53b1();}function a142_0x244c(_0xf22f1a,_0x5eebb0){_0xf22f1a=_0xf22f1a-0x1b4;const _0x53b1c2=a142_0x53b1();let _0x244c38=_0x53b1c2[_0xf22f1a];return _0x244c38;}function runtimeSkillCodeFromLink(_0x1ce9e6,_0x54b371){const _0x5320e4=a142_0x1635b4,_0x4aa568=basename(_0x54b371);return _0x1ce9e6['scope']===_0x5320e4(0x1e8)?_0x4aa568:_0x4aa568[_0x5320e4(0x1cf)]((_0x1ce9e6['appCode']+'--')[_0x5320e4(0x1f3)]);}export function copyManagedSkillDirectory(_0x2d1a52,_0x49fe5b){const _0x559def=a142_0x1635b4,_0x584bd=resolve(_0x49fe5b,METADATA_FILE),_0x2994ad=existsSync(_0x49fe5b);if(_0x2994ad){const _0x5e5baa=lstatSync(_0x49fe5b);if(_0x5e5baa[_0x559def(0x1e4)]())throw CliErrors[_0x559def(0x1e1)](_0x559def(0x1b9)+_0x49fe5b);if(!_0x5e5baa['isDirectory']())throw CliErrors[_0x559def(0x1e1)](_0x559def(0x1d8)+_0x49fe5b);const _0x32aafa=readMetadataIfPresent(_0x584bd);if(_0x32aafa?.[_0x559def(0x1e5)]!==_0x559def(0x1d3))throw CliErrors[_0x559def(0x1e1)](_0x559def(0x1ca)+_0x49fe5b);}ensureDirSync(dirname(_0x49fe5b));const _0x4ff9f7=_0x2994ad?readMetadataIfPresent(_0x584bd)?.[_0x559def(0x1cc)]:undefined,_0x384997=readMetadataIfPresent(resolve(_0x2d1a52,METADATA_FILE))?.['contentHash'];return _0x2994ad&&removeSync(_0x49fe5b),copySkillDirectory(_0x2d1a52,_0x49fe5b),{'path':_0x49fe5b,'target':_0x2d1a52,'action':!_0x2994ad?_0x559def(0x1b5):_0x4ff9f7===_0x384997?'unchanged':_0x559def(0x1db)};}function copySkillDirectory(_0x3a223b,_0x2b3048){copySync(_0x3a223b,_0x2b3048,{'dereference':![],'overwrite':!![],'filter'(_0x4ddc88){const _0x2fe5c0=a142_0x244c;if(lstatSync(_0x4ddc88)['isSymbolicLink']())throw CliErrors[_0x2fe5c0(0x1e1)](_0x2fe5c0(0x1d0)+_0x4ddc88);return!![];}});}
|
|
1
|
+
const a150_0x2e9264=a150_0x29fb;(function(_0x5e1feb,_0xd4f0e7){const _0x418787=a150_0x29fb,_0x52108b=_0x5e1feb();while(!![]){try{const _0x18e4b0=parseInt(_0x418787(0x1f5))/0x1*(-parseInt(_0x418787(0x1d3))/0x2)+parseInt(_0x418787(0x1d7))/0x3+parseInt(_0x418787(0x1cf))/0x4+parseInt(_0x418787(0x1e7))/0x5+-parseInt(_0x418787(0x1d1))/0x6*(parseInt(_0x418787(0x1ed))/0x7)+-parseInt(_0x418787(0x1d8))/0x8+-parseInt(_0x418787(0x1e6))/0x9*(-parseInt(_0x418787(0x1ce))/0xa);if(_0x18e4b0===_0xd4f0e7)break;else _0x52108b['push'](_0x52108b['shift']());}catch(_0x43aba3){_0x52108b['push'](_0x52108b['shift']());}}}(a150_0x3ade,0xc9874));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import a150_0x5889c4 from'fs-extra';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';import{isDanglingSymlink,isPathInside,lstatIfPresent,realOrResolved,resolveSymlinkTarget}from'./fs-utils.js';import{readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillCacheRoot,resolveSkillSyncPaths,safePathSegment}from'./paths.js';const {copySync,ensureDirSync,removeSync}=a150_0x5889c4,RESERVED_PROJECT_SKILL_CODES=new Set(['lovrabet',a150_0x2e9264(0x1de),a150_0x2e9264(0x1e2)]);export function linkEffectiveRuntimeSkills(_0x22a5cd,_0x556bee){const _0x1a2189=a150_0x2e9264,_0x504efe=new Map();for(const _0x5bfabb of _0x22a5cd){const _0xd90e5c=_0x5bfabb['skill'][_0x1a2189(0x1db)];if(!_0xd90e5c)continue;const _0x17171a=_0x504efe[_0x1a2189(0x1cd)](_0xd90e5c);(!_0x17171a||_0x5bfabb[_0x1a2189(0x1f1)]==='personal')&&_0x504efe['set'](_0xd90e5c,_0x5bfabb);}const _0x2f271c=[];for(const _0x3a543c of _0x504efe[_0x1a2189(0x1f9)]()){const _0x535a3e=requireSkillCode(_0x3a543c[_0x1a2189(0x1d6)]),_0x29e0c3=readMetadataIfPresent(_0x3a543c['metadataPath']);if(_0x29e0c3?.[_0x1a2189(0x1fe)]!==_0x556bee[_0x1a2189(0x1fe)]||_0x29e0c3[_0x1a2189(0x1db)]!==_0x535a3e)throw CliErrors[_0x1a2189(0x1da)](_0x1a2189(0x1ca)+_0x556bee[_0x1a2189(0x1fe)]+':\x20'+_0x3a543c[_0x1a2189(0x1f4)]);const _0x49ab68=runtimeSkillLinkName(_0x556bee,_0x535a3e);for(const _0x2b4942 of _0x556bee[_0x1a2189(0x1fb)]){_0x2f271c[_0x1a2189(0x1fc)](ensureManagedSymlink(resolve(_0x2b4942,_0x49ab68),_0x3a543c[_0x1a2189(0x1c8)],_0x556bee,_0x535a3e));}}return _0x2f271c;}function a150_0x29fb(_0x1de2c4,_0x40863f){_0x1de2c4=_0x1de2c4-0x1c8;const _0x3adefe=a150_0x3ade();let _0x29fb82=_0x3adefe[_0x1de2c4];return _0x29fb82;}export function pruneStaleRuntimeSkillLinks(_0xa1f1a6,_0x11f277,_0x3ea669){const _0x177c0e=a150_0x2e9264,_0x596351=new Set([..._0x11f277][_0x177c0e(0x1f2)](_0xddae22=>_0xddae22['trim']())[_0x177c0e(0x1ea)](Boolean)),_0x4f4acf=_0x3ea669?new Set([..._0x3ea669]['map'](_0x11ca12=>_0x11ca12[_0x177c0e(0x1f8)]())[_0x177c0e(0x1ea)](Boolean)):undefined,_0xb66f5e=[];for(const _0x3b2f62 of _0xa1f1a6[_0x177c0e(0x1fb)]){for(const _0x5d6ea5 of managedTargetSkillLinkPaths(_0x3b2f62,_0xa1f1a6)){const _0x310a2a=runtimeSkillCodeFromLink(_0xa1f1a6,_0x5d6ea5);if(_0x4f4acf&&!_0x4f4acf[_0x177c0e(0x1eb)](_0x310a2a))continue;if(_0x596351['has'](_0x310a2a))continue;_0xb66f5e[_0x177c0e(0x1fc)](removeManagedSkillLink(_0x5d6ea5,_0xa1f1a6,_0x310a2a));}}return _0xb66f5e;}export function pruneStaleRuntimeSkillCache(_0x149e8f,_0x1fd500={}){const _0x431402=a150_0x2e9264,_0x436a68=new Set([..._0x149e8f[_0x431402(0x1ff)]]['map'](_0x504eb7=>_0x504eb7[_0x431402(0x1f8)]())[_0x431402(0x1ea)](Boolean)),_0x1888ec=_0x149e8f['pruneSkillCodes']?new Set([..._0x149e8f[_0x431402(0x1f3)]][_0x431402(0x1f2)](_0x280ed0=>_0x280ed0['trim']())[_0x431402(0x1ea)](Boolean)):undefined,_0x30f67f=_0x149e8f[_0x431402(0x1d5)]??[_0x431402(0x1d2),_0x431402(0x203)],_0x28754f=resolve(getRuntimeSkillCacheRoot(_0x149e8f[_0x431402(0x1ee)],_0x149e8f['accessKey'],_0x1fd500),safePathSegment(_0x149e8f[_0x431402(0x1fe)],_0x431402(0x1fe))),_0x4c0bd5=[];for(const _0x1ac19c of _0x30f67f){const _0x41b99d=resolve(_0x28754f,_0x1ac19c);if(!existsSync(_0x41b99d))continue;for(const _0x21c68b of readdirSync(_0x41b99d,{'withFileTypes':!![]})){if(!_0x21c68b[_0x431402(0x1e3)]())continue;const _0xeae2f9=_0x21c68b['name'];if(_0x1888ec&&!_0x1888ec['has'](_0xeae2f9))continue;if(_0x436a68[_0x431402(0x1eb)](_0xeae2f9))continue;const _0x446ca9=resolve(_0x41b99d,_0xeae2f9),_0x17d00a=readMetadataIfPresent(resolve(_0x446ca9,METADATA_FILE));if(_0x17d00a?.[_0x431402(0x1fe)]!==_0x149e8f[_0x431402(0x1fe)]||_0x17d00a['scope']!==_0x1ac19c||_0x17d00a[_0x431402(0x1db)]!==_0xeae2f9){_0x4c0bd5['push']({'path':_0x446ca9,'action':'skipped','reason':'metadata-mismatch'});continue;}if(isLinkedFromAnyRoot(_0x446ca9,_0x149e8f[_0x431402(0x1e0)]??[])){_0x4c0bd5[_0x431402(0x1fc)]({'path':_0x446ca9,'action':_0x431402(0x1e5),'reason':'linked-from-protected-root'});continue;}removeSync(_0x446ca9),_0x4c0bd5[_0x431402(0x1fc)]({'path':_0x446ca9,'action':_0x431402(0x1cc)});}}return _0x4c0bd5;}export function linkGlobalRuntimeSkills(_0x3d2f3d,_0x336649={}){const _0x13defe=a150_0x2e9264,_0x35384f=resolveSkillSyncPaths(_0x336649),_0x6fe247=[];for(const _0xacbbe6 of _0x3d2f3d){if(_0xacbbe6[_0x13defe(0x1f1)]!==_0x13defe(0x200))throw CliErrors[_0x13defe(0x1da)](_0x13defe(0x1d0)+_0xacbbe6['scope']);const _0x16019b=requireSkillCode(_0xacbbe6[_0x13defe(0x1d6)]),_0x5345fe=copyManagedSkillDirectory(_0xacbbe6[_0x13defe(0x1c8)],resolve(_0x35384f[_0x13defe(0x1f7)],_0x16019b));_0x6fe247[_0x13defe(0x1fc)]({..._0x5345fe,'contentHash':_0xacbbe6[_0x13defe(0x1e9)]});}return _0x6fe247;}function ensureManagedSymlink(_0x46ad2e,_0x2a3a8f,_0x32deb8,_0x41534d){const _0x158d01=a150_0x2e9264;mkdirSync(dirname(_0x46ad2e),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x46ad2e)||isDanglingSymlink(_0x46ad2e)){const _0x5ac2c3=lstatSync(_0x46ad2e);if(!_0x5ac2c3[_0x158d01(0x1e4)]())throw CliErrors[_0x158d01(0x1da)](_0x158d01(0x1dd)+_0x46ad2e);const _0x26b81f=resolveSymlinkTarget(_0x46ad2e);if(!isPathInside(realOrResolved(_0x26b81f),realOrResolved(_0x32deb8[_0x158d01(0x1df)])))throw CliErrors[_0x158d01(0x1da)](_0x158d01(0x202)+_0x46ad2e);if(realOrResolved(_0x26b81f)===realOrResolved(_0x2a3a8f))return{'path':_0x46ad2e,'target':_0x2a3a8f,'action':'unchanged'};const _0x44e8ca=readMetadataIfPresent(resolve(_0x26b81f,METADATA_FILE));if(_0x32deb8['scope']===_0x158d01(0x1ef)&&(_0x44e8ca?.[_0x158d01(0x1fe)]!==_0x32deb8['appCode']||_0x44e8ca[_0x158d01(0x1db)]!==_0x41534d))throw CliErrors[_0x158d01(0x1da)](_0x158d01(0x1d4)+_0x46ad2e);return unlinkSync(_0x46ad2e),symlinkSync(_0x2a3a8f,_0x46ad2e,_0x158d01(0x1c8)),{'path':_0x46ad2e,'target':_0x2a3a8f,'action':_0x158d01(0x1dc)};}return symlinkSync(_0x2a3a8f,_0x46ad2e,_0x158d01(0x1c8)),{'path':_0x46ad2e,'target':_0x2a3a8f,'action':'created'};}function managedTargetSkillLinkPaths(_0x39bcaf,_0x1206a8){const _0x22570f=a150_0x2e9264;if(!existsSync(_0x39bcaf))return[];const _0x39d821=_0x1206a8[_0x22570f(0x1fe)]+'--';return readdirSync(_0x39bcaf,{'withFileTypes':!![]})[_0x22570f(0x1ea)](_0xb00555=>_0x1206a8[_0x22570f(0x1f1)]==='project'||_0xb00555[_0x22570f(0x1cb)][_0x22570f(0x1fd)](_0x39d821))['map'](_0x233147=>resolve(_0x39bcaf,_0x233147['name']));}function removeManagedSkillLink(_0xff8eb4,_0x421500,_0x5ae907){const _0x2734e6=a150_0x2e9264,_0x47a3f0=lstatIfPresent(_0xff8eb4);if(!_0x47a3f0?.['isSymbolicLink']())return{'path':_0xff8eb4,'action':_0x2734e6(0x1e5),'reason':'not-managed-symlink'};const _0x554b04=resolveSymlinkTarget(_0xff8eb4);if(!isPathInside(realOrResolved(_0x554b04),realOrResolved(_0x421500['managedRoot'])))return{'path':_0xff8eb4,'action':_0x2734e6(0x1e5),'reason':'external-symlink'};const _0x5b8e29=readMetadataIfPresent(resolve(_0x554b04,METADATA_FILE));if(_0x421500[_0x2734e6(0x1f1)]===_0x2734e6(0x1ef)&&(_0x5b8e29?.['appCode']!==_0x421500[_0x2734e6(0x1fe)]||_0x5b8e29[_0x2734e6(0x1db)]!==_0x5ae907))return{'path':_0xff8eb4,'action':_0x2734e6(0x1e5),'reason':_0x2734e6(0x1f0)};return unlinkSync(_0xff8eb4),{'path':_0xff8eb4,'action':_0x2734e6(0x1cc)};}function isLinkedFromAnyRoot(_0x4d3c22,_0x1e4c5f){const _0x495551=a150_0x2e9264,_0x5ac9ab=realOrResolved(_0x4d3c22);for(const _0x554ab8 of _0x1e4c5f){if(!existsSync(_0x554ab8))continue;for(const _0x346406 of readdirSync(_0x554ab8,{'withFileTypes':!![]})){if(!_0x346406['isSymbolicLink']())continue;const _0x5600c3=resolve(_0x554ab8,_0x346406[_0x495551(0x1cb)]);if(realOrResolved(resolveSymlinkTarget(_0x5600c3))===_0x5ac9ab)return!![];}}return![];}function a150_0x3ade(){const _0x8d7cb3=['Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20','runtime-observe','managedRoot','protectedLinkRoots','length','secret-retriever','isDirectory','isSymbolicLink','skipped','14103HQXOgi','1203450UPfqLy','Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20','contentHash','filter','has','Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20','117005yqKqbk','env','project','metadata-mismatch','scope','map','pruneSkillCodes','metadataPath','9265znrKmc','slice','agentsSkillsDir','trim','values','Refusing\x20to\x20copy\x20Skill\x20symlink:\x20','skillRoots','push','startsWith','appCode','activeSkillCodes','builtin','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20','Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20','company','dir','Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20','Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20','name','removed','get','10510wwbCSy','5077168tDKRHa','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','426xoVNCM','personal','122xIlmVP','Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20','scopes','skill','1183698XBTPxM','7792600qmRLMa','created','validation','skillCode','updated'];a150_0x3ade=function(){return _0x8d7cb3;};return a150_0x3ade();}function runtimeSkillLinkName(_0x400310,_0x13208){const _0xd125ac=a150_0x2e9264,_0x2e7fac=safePathSegment(_0x13208,'skillCode');if(_0x400310['scope']===_0xd125ac(0x1ef)&&RESERVED_PROJECT_SKILL_CODES[_0xd125ac(0x1eb)](_0x2e7fac))throw CliErrors['validation'](_0xd125ac(0x1ec)+_0x2e7fac);return _0x400310['scope']===_0xd125ac(0x1ef)?_0x2e7fac:_0x400310['appCode']+'--'+_0x2e7fac;}function runtimeSkillCodeFromLink(_0x5e32b7,_0x244292){const _0x2a1ffc=a150_0x2e9264,_0x3169a3=basename(_0x244292);return _0x5e32b7['scope']===_0x2a1ffc(0x1ef)?_0x3169a3:_0x3169a3[_0x2a1ffc(0x1f6)]((_0x5e32b7[_0x2a1ffc(0x1fe)]+'--')[_0x2a1ffc(0x1e1)]);}export function copyManagedSkillDirectory(_0x4453ad,_0x5249ef){const _0x2c640d=a150_0x2e9264,_0x1f6516=resolve(_0x5249ef,METADATA_FILE),_0x59705e=existsSync(_0x5249ef);if(_0x59705e){const _0x452359=lstatSync(_0x5249ef);if(_0x452359[_0x2c640d(0x1e4)]())throw CliErrors[_0x2c640d(0x1da)](_0x2c640d(0x1c9)+_0x5249ef);if(!_0x452359[_0x2c640d(0x1e3)]())throw CliErrors[_0x2c640d(0x1da)](_0x2c640d(0x1e8)+_0x5249ef);const _0x5ab618=readMetadataIfPresent(_0x1f6516);if(_0x5ab618?.[_0x2c640d(0x1f1)]!==_0x2c640d(0x200))throw CliErrors['validation'](_0x2c640d(0x201)+_0x5249ef);}ensureDirSync(dirname(_0x5249ef));const _0x495cf4=_0x59705e?readMetadataIfPresent(_0x1f6516)?.[_0x2c640d(0x1e9)]:undefined,_0x232622=readMetadataIfPresent(resolve(_0x4453ad,METADATA_FILE))?.['contentHash'];return _0x59705e&&removeSync(_0x5249ef),copySkillDirectory(_0x4453ad,_0x5249ef),{'path':_0x5249ef,'target':_0x4453ad,'action':!_0x59705e?_0x2c640d(0x1d9):_0x495cf4===_0x232622?'unchanged':_0x2c640d(0x1dc)};}function copySkillDirectory(_0xc8073b,_0x93ae97){copySync(_0xc8073b,_0x93ae97,{'dereference':![],'overwrite':!![],'filter'(_0x3ddf4b){const _0x47cd21=a150_0x29fb;if(lstatSync(_0x3ddf4b)[_0x47cd21(0x1e4)]())throw CliErrors[_0x47cd21(0x1da)](_0x47cd21(0x1fa)+_0x3ddf4b);return!![];}});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x53154f,_0xefa137){const _0x386c84=a151_0x49df,_0x4ea4f9=_0x53154f();while(!![]){try{const _0xd4611d=parseInt(_0x386c84(0x17c))/0x1*(parseInt(_0x386c84(0x165))/0x2)+-parseInt(_0x386c84(0x176))/0x3+parseInt(_0x386c84(0x15f))/0x4+parseInt(_0x386c84(0x185))/0x5*(-parseInt(_0x386c84(0x186))/0x6)+parseInt(_0x386c84(0x175))/0x7+parseInt(_0x386c84(0x17e))/0x8+parseInt(_0x386c84(0x174))/0x9*(-parseInt(_0x386c84(0x17d))/0xa);if(_0xd4611d===_0xefa137)break;else _0x4ea4f9['push'](_0x4ea4f9['shift']());}catch(_0x1d5b1e){_0x4ea4f9['push'](_0x4ea4f9['shift']());}}}(a151_0x1737,0xaace7));import{existsSync,readdirSync}from'node:fs';import{resolve}from'node:path';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{readMetadataIfPresent}from'./metadata.js';import{getRuntimeSkillCacheRoot,safePathSegment}from'./paths.js';function a151_0x1737(){const _0x3dbb54=['filter','get','name','set','project','370715aDTbSm','66LEEBRu','scopes','source','appCode','isDirectory','map','3032228EzDdpE','scope','linkedPaths','trim','tags','accessKey','2QwxtFD','cacheDir','has','metadataPath','skillCode','push','Runtime\x20Skill\x20install\x20target\x20app\x20mismatch:\x20','includes','code','values','dir','isArray','isSymbolicLink','linkedPath','from','509931LhcFhY','7637224VulzdT','3220533hucExp','local','cache','\x20!=\x20','sort','localeCompare','988221ZQyqbo','180HsWkKH','6170072nsEOel','link'];a151_0x1737=function(){return _0x3dbb54;};return a151_0x1737();}import{isRuntimeSkillScope,normalizeRuntimeSkillScopes}from'./scopes.js';export function listLocalRuntimeSkills(_0x11d17a,_0x5acb17,_0x4e092f={}){const _0xdafd27=a151_0x49df,_0x3dc7d8=safePathSegment(_0x11d17a[_0xdafd27(0x189)],_0xdafd27(0x189));if(_0x5acb17[_0xdafd27(0x189)]!==_0x3dc7d8)throw CliErrors['validation'](_0xdafd27(0x16b)+_0x5acb17[_0xdafd27(0x189)]+_0xdafd27(0x179)+_0x3dc7d8);const _0x24abb6=normalizeRuntimeSkillScopes(_0x11d17a['scopes']),_0x2b1be1=new Set(_0x24abb6),_0x355afa=_0x11d17a['code']?.[_0xdafd27(0x162)](),_0x23155d=new Map(),_0x14dc37=resolve(getRuntimeSkillCacheRoot(_0x11d17a['env'],_0x11d17a[_0xdafd27(0x164)],_0x4e092f),_0x3dc7d8);for(const _0x39f637 of _0x24abb6){for(const _0x30f152 of localSkillEntryDirs(resolve(_0x14dc37,_0x39f637))){collectLocalRuntimeSkill(_0x23155d,_0x30f152,{'appCode':_0x3dc7d8,'scopes':_0x2b1be1,'code':_0x355afa,'source':'cache'});}}for(const _0x2025d6 of _0x5acb17['skillRoots']){for(const _0x5ee767 of localSkillLinkCandidates(_0x2025d6,_0x5acb17,_0x2b1be1)){collectLocalRuntimeSkill(_0x23155d,_0x5ee767,{'appCode':_0x3dc7d8,'scopes':_0x2b1be1,'code':_0x355afa,'source':_0xdafd27(0x17f),'linkedPath':_0x5ee767});}}return Array[_0xdafd27(0x173)](_0x23155d[_0xdafd27(0x16e)]())[_0xdafd27(0x17a)](compareLocalRuntimeSkills);}function localSkillEntryDirs(_0x4e38db){const _0x2e81db=a151_0x49df;if(!existsSync(_0x4e38db))return[];return readdirSync(_0x4e38db,{'withFileTypes':!![]})[_0x2e81db(0x180)](_0x1097e1=>_0x1097e1[_0x2e81db(0x18a)]()||_0x1097e1[_0x2e81db(0x171)]())[_0x2e81db(0x18b)](_0x3fcd74=>resolve(_0x4e38db,_0x3fcd74[_0x2e81db(0x182)]));}function a151_0x49df(_0x2d8337,_0x177c40){_0x2d8337=_0x2d8337-0x15f;const _0x1737a7=a151_0x1737();let _0x49df97=_0x1737a7[_0x2d8337];return _0x49df97;}function localSkillLinkCandidates(_0x51ddde,_0x4f3b6e,_0x40cfd8){const _0x5c28b7=a151_0x49df;if(!existsSync(_0x51ddde))return[];const _0x10c60e=_0x4f3b6e[_0x5c28b7(0x189)]+'--';return readdirSync(_0x51ddde,{'withFileTypes':!![]})[_0x5c28b7(0x180)](_0x307891=>_0x307891[_0x5c28b7(0x18a)]()||_0x307891['isSymbolicLink']())[_0x5c28b7(0x180)](_0xae4e93=>_0x4f3b6e[_0x5c28b7(0x160)]===_0x5c28b7(0x184)||_0xae4e93[_0x5c28b7(0x182)]['startsWith'](_0x10c60e)||_0x40cfd8[_0x5c28b7(0x167)]('builtin'))[_0x5c28b7(0x18b)](_0x12f3b4=>resolve(_0x51ddde,_0x12f3b4[_0x5c28b7(0x182)]));}function collectLocalRuntimeSkill(_0x13760d,_0x3c62a7,_0x36278a){const _0x18332b=a151_0x49df,_0x64b6fd=resolve(_0x3c62a7,METADATA_FILE),_0x2ec8be=readMetadataIfPresent(_0x64b6fd);if(!_0x2ec8be)return;if(_0x2ec8be[_0x18332b(0x189)]!==_0x36278a['appCode'])return;if(!isRuntimeSkillScope(_0x2ec8be[_0x18332b(0x160)])||!_0x36278a[_0x18332b(0x187)][_0x18332b(0x167)](_0x2ec8be[_0x18332b(0x160)]))return;const _0x4951cd=_0x2ec8be['skillCode']?.[_0x18332b(0x162)]();if(!_0x4951cd)return;if(_0x36278a[_0x18332b(0x16d)]&&_0x4951cd!==_0x36278a[_0x18332b(0x16d)])return;const _0x3bbcb8=_0x2ec8be[_0x18332b(0x160)]+':'+_0x4951cd,_0x673df3=_0x36278a[_0x18332b(0x172)]?[_0x36278a['linkedPath']]:[],_0x10cdc6=_0x13760d[_0x18332b(0x181)](_0x3bbcb8);if(_0x10cdc6){_0x36278a[_0x18332b(0x188)]==='cache'&&(_0x10cdc6[_0x18332b(0x16f)]=_0x3c62a7,_0x10cdc6[_0x18332b(0x166)]=_0x3c62a7,_0x10cdc6['skillMdPath']=resolve(_0x3c62a7,SKILL_FILE),_0x10cdc6[_0x18332b(0x168)]=_0x64b6fd);for(const _0x18e9aa of _0x673df3){!_0x10cdc6['linkedPaths'][_0x18332b(0x16c)](_0x18e9aa)&&_0x10cdc6[_0x18332b(0x161)][_0x18332b(0x16a)](_0x18e9aa);}_0x10cdc6[_0x18332b(0x161)][_0x18332b(0x17a)]();return;}_0x13760d[_0x18332b(0x183)](_0x3bbcb8,{..._0x2ec8be,'tags':Array[_0x18332b(0x170)](_0x2ec8be[_0x18332b(0x163)])?_0x2ec8be['tags']:[],'scope':_0x2ec8be['scope'],'source':_0x18332b(0x177),'dir':_0x3c62a7,'cacheDir':_0x36278a[_0x18332b(0x188)]===_0x18332b(0x178)?_0x3c62a7:undefined,'skillMdPath':resolve(_0x3c62a7,SKILL_FILE),'metadataPath':_0x64b6fd,'linkedPaths':_0x673df3});}function compareLocalRuntimeSkills(_0x287ea7,_0x54e3c4){const _0x4ed96a=a151_0x49df,_0x5a3aae={'personal':0x0,'company':0x1,'builtin':0x2};return _0x5a3aae[_0x287ea7[_0x4ed96a(0x160)]]-_0x5a3aae[_0x54e3c4[_0x4ed96a(0x160)]]||_0x287ea7[_0x4ed96a(0x169)][_0x4ed96a(0x17b)](_0x54e3c4['skillCode'])||_0x287ea7[_0x4ed96a(0x16f)][_0x4ed96a(0x17b)](_0x54e3c4[_0x4ed96a(0x16f)]);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1b354e,_0x87009b){const _0x4d806a=a152_0x4f5d,_0x3bc3f2=_0x1b354e();while(!![]){try{const _0x13ce99=parseInt(_0x4d806a(0xbe))/0x1*(parseInt(_0x4d806a(0xd6))/0x2)+parseInt(_0x4d806a(0xd8))/0x3+parseInt(_0x4d806a(0xb1))/0x4+-parseInt(_0x4d806a(0xce))/0x5*(-parseInt(_0x4d806a(0xd0))/0x6)+parseInt(_0x4d806a(0xcc))/0x7*(-parseInt(_0x4d806a(0xb7))/0x8)+-parseInt(_0x4d806a(0xc8))/0x9*(parseInt(_0x4d806a(0xb8))/0xa)+parseInt(_0x4d806a(0xb3))/0xb*(-parseInt(_0x4d806a(0xc9))/0xc);if(_0x13ce99===_0x87009b)break;else _0x3bc3f2['push'](_0x3bc3f2['shift']());}catch(_0x13f35e){_0x3bc3f2['push'](_0x3bc3f2['shift']());}}}(a152_0x2eda,0x6c925));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';function a152_0x4f5d(_0x315b9a,_0x36add0){_0x315b9a=_0x315b9a-0xae;const _0x2eda84=a152_0x2eda();let _0x4f5dae=_0x2eda84[_0x315b9a];return _0x4f5dae;}export function fileContent(_0x443962){const _0x215379=a152_0x4f5d;return _0x443962[_0x215379(0xd1)]??Buffer[_0x215379(0xcf)](_0x443962[_0x215379(0xd7)]??'',_0x215379(0xba));}export function fileText(_0x4ee274){const _0xd685cc=a152_0x4f5d;return fileContent(_0x4ee274)[_0xd685cc(0xca)](_0xd685cc(0xba));}function a152_0x2eda(){const _0x5a085f=['from','939096KGdtck','bytes','test','isSafeInteger','toLowerCase','push','851718ufhdsc','content','917358OUwZEd','isDirectory','length','add','Duplicate\x20Skill\x20file\x20path:\x20','set','compare','Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20','sha256','path','size','1079596pwhSnq','isSymbolicLink','781EFmCKa','Skill\x20file\x20size\x20is\x20invalid:\x20','string','object','2190984unjFlN','10fCxxfM','excludedFilePaths','utf8','Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20','validation','split','1XqnoqL','name','isFile','values','startsWith','has','includes','Unsafe\x20Skill\x20file\x20path:\x20','trim','sort','2407869FoLtDF','108420SGGXnQ','toString','isArray','7hXNNzw','Skill\x20file\x20path\x20must\x20be\x20text.','20bOcEnA'];a152_0x2eda=function(){return _0x5a085f;};return a152_0x2eda();}export function normalizeLocalFiles(_0x354cfb){const _0x5e7b8b=a152_0x4f5d;if(!Array[_0x5e7b8b(0xcb)](_0x354cfb)||_0x354cfb['length']===0x0)return[];const _0x482f26=new Map();for(const _0x3d3f43 of _0x354cfb){if(!_0x3d3f43||typeof _0x3d3f43!==_0x5e7b8b(0xb6)||typeof _0x3d3f43[_0x5e7b8b(0xaf)]!==_0x5e7b8b(0xb5))throw CliErrors[_0x5e7b8b(0xbc)]('Skill\x20file\x20path\x20must\x20be\x20text.');const _0x296202=normalizeSkillRelativePath(_0x3d3f43[_0x5e7b8b(0xaf)]);if(_0x482f26[_0x5e7b8b(0xc3)](_0x296202))throw CliErrors[_0x5e7b8b(0xbc)](_0x5e7b8b(0xdc)+_0x296202);if(_0x3d3f43[_0x5e7b8b(0xd1)]!==undefined&&!Buffer['isBuffer'](_0x3d3f43['bytes']))throw CliErrors[_0x5e7b8b(0xbc)](_0x5e7b8b(0xbb)+_0x296202);if(_0x3d3f43[_0x5e7b8b(0xd1)]===undefined&&typeof _0x3d3f43['content']!==_0x5e7b8b(0xb5))throw CliErrors['validation'](_0x5e7b8b(0xdf)+_0x296202);const _0x9f44ad=fileContent(_0x3d3f43);_0x482f26[_0x5e7b8b(0xdd)](_0x296202,{'path':_0x296202,'bytes':_0x9f44ad});}return Array['from'](_0x482f26[_0x5e7b8b(0xc1)]())[_0x5e7b8b(0xc7)](compareSkillFiles);}export function normalizeManifestFiles(_0x101368){const _0x37ee5d=a152_0x4f5d;if(!Array[_0x37ee5d(0xcb)](_0x101368)||_0x101368[_0x37ee5d(0xda)]===0x0)return[];const _0x10325a=new Map();for(const _0x51dfe5 of _0x101368){if(!_0x51dfe5||typeof _0x51dfe5!=='object'||typeof _0x51dfe5[_0x37ee5d(0xaf)]!==_0x37ee5d(0xb5))throw CliErrors[_0x37ee5d(0xbc)](_0x37ee5d(0xcd));const _0x259753=normalizeSkillRelativePath(_0x51dfe5[_0x37ee5d(0xaf)]);if(_0x10325a[_0x37ee5d(0xc3)](_0x259753))throw CliErrors[_0x37ee5d(0xbc)](_0x37ee5d(0xdc)+_0x259753);if(!isSha256Hex(_0x51dfe5[_0x37ee5d(0xae)]))throw CliErrors[_0x37ee5d(0xbc)]('Skill\x20file\x20sha256\x20is\x20invalid:\x20'+_0x259753);if(!Number[_0x37ee5d(0xd3)](_0x51dfe5[_0x37ee5d(0xb0)])||_0x51dfe5[_0x37ee5d(0xb0)]<0x0)throw CliErrors[_0x37ee5d(0xbc)](_0x37ee5d(0xb4)+_0x259753);_0x10325a[_0x37ee5d(0xdd)](_0x259753,{'path':_0x259753,'sha256':_0x51dfe5[_0x37ee5d(0xae)][_0x37ee5d(0xd4)](),'size':_0x51dfe5[_0x37ee5d(0xb0)]});}return Array['from'](_0x10325a[_0x37ee5d(0xc1)]())[_0x37ee5d(0xc7)](compareSkillFiles);}export function scanSkillDirectory(_0x385e43,_0x377555={}){const _0x4881b9=a152_0x4f5d,_0x31d722=realpathSync(_0x385e43),_0x3a1570=canonicalExcludedFilePaths(_0x377555[_0x4881b9(0xb9)]),_0x2a41f6=[];function _0x541a10(_0x55fcee){const _0x5c89ec=_0x4881b9,_0x3b39d5=readdirSync(_0x55fcee,{'withFileTypes':!![]})[_0x5c89ec(0xc7)]((_0x17a48c,_0x5e6520)=>_0x17a48c[_0x5c89ec(0xbf)]['localeCompare'](_0x5e6520[_0x5c89ec(0xbf)]));for(const _0x5d505a of _0x3b39d5){if(_0x5d505a[_0x5c89ec(0xd9)]()&&IGNORED_DIR_NAMES[_0x5c89ec(0xc3)](_0x5d505a['name']))continue;if(IGNORED_FILE_NAMES[_0x5c89ec(0xc3)](_0x5d505a[_0x5c89ec(0xbf)]))continue;const _0x351d20=resolve(_0x55fcee,_0x5d505a['name']);if(isExcludedFilePath(_0x351d20,_0x3a1570))continue;if(_0x5d505a[_0x5c89ec(0xb2)]())throw CliErrors[_0x5c89ec(0xbc)]('Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20'+_0x351d20);const _0x4756e5=toPosixPath(relative(_0x31d722,_0x351d20));if(_0x5d505a['isDirectory']()){_0x541a10(_0x351d20);continue;}if(!_0x5d505a[_0x5c89ec(0xc0)]())continue;validateSkillRelativePath(_0x4756e5);const _0x1d85a8=readFileSync(_0x351d20);_0x2a41f6[_0x5c89ec(0xd5)]({'path':_0x4756e5,'bytes':_0x1d85a8});}}return _0x541a10(_0x31d722),normalizeLocalFiles(_0x2a41f6);}function canonicalExcludedFilePaths(_0x24c85b){const _0x17eb32=a152_0x4f5d,_0x511048=new Set();for(const _0xd922d5 of _0x24c85b??[]){const _0x1baffb=resolve(_0xd922d5);_0x511048[_0x17eb32(0xdb)](_0x1baffb);try{_0x511048['add'](realpathSync(_0x1baffb));}catch{}}return _0x511048;}function isExcludedFilePath(_0x456d90,_0x3e6d8e){const _0x1076bf=a152_0x4f5d;if(_0x3e6d8e[_0x1076bf(0xc3)](_0x456d90))return!![];if(_0x3e6d8e['size']===0x0)return![];try{return _0x3e6d8e['has'](realpathSync(_0x456d90));}catch{return![];}}export function compareSkillFiles(_0x5397b5,_0x5d0df5){const _0x427360=a152_0x4f5d;if(_0x5397b5[_0x427360(0xaf)]===SKILL_FILE)return _0x5d0df5[_0x427360(0xaf)]===SKILL_FILE?0x0:-0x1;if(_0x5d0df5[_0x427360(0xaf)]===SKILL_FILE)return 0x1;return Buffer[_0x427360(0xde)](Buffer[_0x427360(0xcf)](_0x5397b5[_0x427360(0xaf)],_0x427360(0xba)),Buffer['from'](_0x5d0df5[_0x427360(0xaf)],_0x427360(0xba)));}export function normalizeSkillRelativePath(_0x2d173f){const _0x400486=a152_0x4f5d,_0x349cbf=toPosixPath(_0x2d173f[_0x400486(0xc6)]());return validateSkillRelativePath(_0x349cbf),_0x349cbf;}export function validateSkillRelativePath(_0x1516eb){const _0x13d2e6=a152_0x4f5d;if(!_0x1516eb||_0x1516eb[_0x13d2e6(0xc2)]('/')||_0x1516eb[_0x13d2e6(0xc4)]('//'))throw CliErrors[_0x13d2e6(0xbc)](_0x13d2e6(0xc5)+_0x1516eb);for(const _0x4a19ef of _0x1516eb[_0x13d2e6(0xbd)]('/')){if(!_0x4a19ef||_0x4a19ef==='.'||_0x4a19ef==='..')throw CliErrors['validation']('Unsafe\x20Skill\x20file\x20path:\x20'+_0x1516eb);}}export function toPosixPath(_0x49b61e){return _0x49b61e['replace'](/\\/g,'/');}export function isSha256Hex(_0x1b959f){const _0x5008ee=a152_0x4f5d;return typeof _0x1b959f===_0x5008ee(0xb5)&&/^[a-fA-F0-9]{64}$/[_0x5008ee(0xd2)](_0x1b959f);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x395b1c,_0x583abe){const _0x3f2b6f=a145_0x329c,_0x1acf97=_0x395b1c();while(!![]){try{const _0x384c35=parseInt(_0x3f2b6f(0xad))/0x1*(parseInt(_0x3f2b6f(0xac))/0x2)+-parseInt(_0x3f2b6f(0xd2))/0x3*(-parseInt(_0x3f2b6f(0xc2))/0x4)+parseInt(_0x3f2b6f(0xd0))/0x5+parseInt(_0x3f2b6f(0xb1))/0x6*(-parseInt(_0x3f2b6f(0xa7))/0x7)+-parseInt(_0x3f2b6f(0x97))/0x8+parseInt(_0x3f2b6f(0xa2))/0x9+parseInt(_0x3f2b6f(0xd5))/0xa*(-parseInt(_0x3f2b6f(0xbe))/0xb);if(_0x384c35===_0x583abe)break;else _0x1acf97['push'](_0x1acf97['shift']());}catch(_0x32c778){_0x1acf97['push'](_0x1acf97['shift']());}}}(a145_0x8cd5,0x9f601));import{existsSync,lstatSync,mkdirSync,readFileSync,rmSync}from'node:fs';import{dirname,resolve}from'node:path';import{isCollection,isMap,isNode,parseDocument,visit}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{resolveManagedFilePath,writeBytesAtomic,writeJsonAtomic}from'./fs-utils.js';import{bufferSha256,contentHash,fileHash}from'./hashing.js';import{fileContent,fileText,normalizeLocalFiles}from'./local-files.js';import{buildMetadata,readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillDir}from'./paths.js';import{extractDownloadedPackage,requirePackageBytes}from'./zip-package.js';export function materializeRuntimeSkill(_0x3e7c3d,_0x78eaf1,_0x32394a){const _0x40f572=a145_0x329c,_0x8f7697=requireSkillCode(_0x3e7c3d),_0x1ecd6a=requirePackageBytes(_0x8f7697,_0x32394a[_0x40f572(0xbf)]),_0x524dc7=extractDownloadedPackage(_0x1ecd6a),_0x12f730=_0x524dc7['find'](_0x3bacdf=>_0x3bacdf[_0x40f572(0xca)]===SKILL_FILE);if(!_0x12f730)throw CliErrors['validation'](_0x40f572(0x9c)+SKILL_FILE+':\x20'+_0x8f7697);const _0x2e9e4e=withMaterializedSkillFrontmatter(_0x524dc7,_0x3e7c3d,_0x8f7697),_0x4cfd3c=_0x2e9e4e[_0x40f572(0xbc)](_0x3666ed=>_0x3666ed[_0x40f572(0xca)]===SKILL_FILE),_0x48751a=fileText(_0x4cfd3c),_0x30a98b=getRuntimeSkillDir(_0x32394a[_0x40f572(0xa6)],_0x32394a['accessKey'],_0x32394a[_0x40f572(0xc1)],_0x78eaf1,_0x8f7697,_0x32394a[_0x40f572(0x9e)]),_0xadf274=resolve(_0x30a98b,SKILL_FILE),_0x653f04=resolve(_0x30a98b,METADATA_FILE),_0x338a7c=contentHash(_0x48751a),_0x420658=readMetadataIfPresent(_0x653f04)?.[_0x40f572(0xc4)];ensurePulledFilesCanBeOverwritten(_0x30a98b,_0x653f04,_0x2e9e4e,_0x32394a[_0x40f572(0xb6)]===!![]),mkdirSync(_0x30a98b,{'recursive':!![],'mode':0x1c0});const _0x24eb6c=existsSync(_0xadf274)?readFileSync(_0xadf274,_0x40f572(0xb5)):undefined;return materializeFiles(_0x30a98b,_0x2e9e4e),removeStaleManagedFiles(_0x30a98b,_0x420658,_0x2e9e4e),writeJsonAtomic(_0x653f04,buildMetadata(_0x3e7c3d,_0x78eaf1,_0x32394a[_0x40f572(0xc1)],_0x338a7c,_0x32394a[_0x40f572(0xb8)],_0x2e9e4e,_0x1ecd6a)),{'skill':_0x3e7c3d,'scope':_0x78eaf1,'dir':_0x30a98b,'skillMdPath':_0xadf274,'metadataPath':_0x653f04,'contentHash':_0x338a7c,'changed':_0x24eb6c!==_0x48751a};}export function reuseMaterializedRuntimeSkill(_0x478ea7,_0x3cadd5,_0x164369){const _0x4b26f6=a145_0x329c,_0x2aad80=_0x478ea7[_0x4b26f6(0xd6)]?.[_0x4b26f6(0x99)]();if(!_0x2aad80)return undefined;const _0x5d0b52=requireSkillCode(_0x478ea7),_0x1743f8=getRuntimeSkillDir(_0x164369[_0x4b26f6(0xa6)],_0x164369[_0x4b26f6(0xcf)],_0x164369[_0x4b26f6(0xc1)],_0x3cadd5,_0x5d0b52,_0x164369['paths']),_0x1a78f5=resolve(_0x1743f8,SKILL_FILE),_0x442003=resolve(_0x1743f8,METADATA_FILE),_0xe371d2=readMetadataIfPresent(_0x442003);if(!_0xe371d2||_0xe371d2[_0x4b26f6(0xc8)]!==0x2||_0xe371d2['appCode']!==_0x164369[_0x4b26f6(0xc1)]||_0xe371d2[_0x4b26f6(0xcb)]!==_0x3cadd5||_0xe371d2[_0x4b26f6(0xb2)]!==_0x5d0b52||_0xe371d2[_0x4b26f6(0xd6)]!==_0x2aad80||_0xe371d2['id']!==_0x478ea7['id']||_0xe371d2[_0x4b26f6(0xbb)]!==_0x478ea7[_0x4b26f6(0xbb)]||_0xe371d2['description']!==_0x478ea7[_0x4b26f6(0xc5)]||_0xe371d2[_0x4b26f6(0xb7)]!==_0x478ea7[_0x4b26f6(0xb7)]||_0xe371d2[_0x4b26f6(0xa8)]!==_0x478ea7[_0x4b26f6(0xa8)]||!_0xe371d2[_0x4b26f6(0xb0)]||!_0xe371d2[_0x4b26f6(0xc4)]||!Object[_0x4b26f6(0xba)](_0xe371d2['fileHashes'],SKILL_FILE))return undefined;for(const [_0x47d3d2,_0x4ed0c8]of Object[_0x4b26f6(0xd3)](_0xe371d2[_0x4b26f6(0xc4)])){if(!/^[a-f0-9]{64}$/[_0x4b26f6(0xc6)](_0x4ed0c8))return undefined;const _0x12b32c=resolveManagedFilePath(_0x1743f8,_0x47d3d2);if(!existsSync(_0x12b32c)||!lstatSync(_0x12b32c)[_0x4b26f6(0xb3)]())return undefined;if(bufferSha256(readFileSync(_0x12b32c))!==_0x4ed0c8)return undefined;}return{'skill':_0x478ea7,'scope':_0x3cadd5,'dir':_0x1743f8,'skillMdPath':_0x1a78f5,'metadataPath':_0x442003,'contentHash':_0xe371d2[_0x4b26f6(0xb0)],'changed':![]};}function withMaterializedSkillFrontmatter(_0x4f2994,_0x52f0c2,_0x43408c){const _0xd78397=a145_0x329c,_0xc6eca5=skillDisplayName(_0x52f0c2,_0x43408c),_0x5d134e=_0x52f0c2[_0xd78397(0xc5)]?.[_0xd78397(0x99)]()||_0xc6eca5||_0x43408c;return normalizeLocalFiles(_0x4f2994)[_0xd78397(0xbd)](_0xc11a74=>{const _0x4217e0=_0xd78397,_0x4fe0a2=fileText(_0xc11a74);if(_0xc11a74[_0x4217e0(0xca)]!==SKILL_FILE)return _0xc11a74;if(hasYamlFrontmatter(_0x4fe0a2))return{'path':_0xc11a74['path'],'content':withSyncedDisplayName(_0x4fe0a2,_0xc6eca5)};return{'path':_0xc11a74[_0x4217e0(0xca)],'content':prependSkillFrontmatter(_0x4fe0a2,{'name':_0x43408c,'displayName':_0xc6eca5,'description':_0x5d134e})};});}function hasYamlFrontmatter(_0x4be184){const _0x311c10=a145_0x329c;return/^\uFEFF?---\s*\r?\n/[_0x311c10(0xc6)](_0x4be184);}function prependSkillFrontmatter(_0x522c3d,_0x17106a){const _0x1bd0ee=a145_0x329c,_0x4e3df8=_0x522c3d[_0x1bd0ee(0xb9)](/^\uFEFF/,'');return[_0x1bd0ee(0xcc),_0x1bd0ee(0xa3)+yamlString(_0x17106a['name']),_0x17106a['displayName']?_0x1bd0ee(0xa5)+yamlString(_0x17106a['displayName']):undefined,_0x1bd0ee(0xaf)+yamlString(_0x17106a[_0x1bd0ee(0xc5)]),_0x1bd0ee(0xcc),'',_0x4e3df8][_0x1bd0ee(0xc7)](_0x217a02=>_0x217a02!==undefined)[_0x1bd0ee(0xcd)]('\x0a');}function yamlString(_0x20f2a0){const _0x3196c9=a145_0x329c;return JSON[_0x3196c9(0xc3)](_0x20f2a0[_0x3196c9(0xb9)](/\r/g,'')['trim']());}function skillDisplayName(_0x38f0cd,_0x4a4ab3){const _0xf2076=a145_0x329c,_0x13bb9e=_0x38f0cd[_0xf2076(0xbb)]?.[_0xf2076(0x99)]();return _0x13bb9e||_0x4a4ab3;}function withSyncedDisplayName(_0x3889b0,_0x16ee81){const _0x120959=a145_0x329c,_0x3a190c=_0x3889b0[_0x120959(0x9f)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x3a190c)return _0x3889b0;const _0x21120b=_0x3a190c[0x1]??'',_0x584fdc=_0x3a190c[0x2]??'',_0x303c0b=parseDocument(_0x584fdc);if(_0x303c0b[_0x120959(0xc0)][_0x120959(0x9b)]>0x0||!isMap(_0x303c0b[_0x120959(0xc9)]))return _0x3889b0;if(_0x16ee81)_0x303c0b[_0x120959(0xaa)]('displayName',_0x16ee81);else{if(_0x303c0b[_0x120959(0xae)](_0x120959(0xa4)))_0x303c0b[_0x120959(0x98)]('displayName');else return _0x3889b0;}forceBlockCollections(_0x303c0b[_0x120959(0xc9)]);const _0x37abbd=_0x303c0b[_0x120959(0x9a)]({'lineWidth':0x0})[_0x120959(0x9d)](),_0x2a5857=_0x3889b0[_0x120959(0xb4)](_0x3a190c[0x0][_0x120959(0x9b)])[_0x120959(0xb9)](/^\r?\n/,'');return _0x21120b+'---\x0a'+_0x37abbd+_0x120959(0xd1)+_0x2a5857;}function a145_0x329c(_0x1aaea7,_0x2790f2){_0x1aaea7=_0x1aaea7-0x97;const _0x8cd57a=a145_0x8cd5();let _0x329c07=_0x8cd57a[_0x1aaea7];return _0x329c07;}function forceBlockCollections(_0x40b272){if(!isNode(_0x40b272))return;visit(_0x40b272,(_0x15f693,_0x4db59d)=>{isCollection(_0x4db59d)&&(_0x4db59d['flow']=![]);});}function ensurePulledFilesCanBeOverwritten(_0x317d22,_0xa6acd2,_0x91628a,_0x72db43){const _0x2ba62a=a145_0x329c;if(_0x72db43||!existsSync(_0xa6acd2))return;const _0x3d08a0=readMetadataIfPresent(_0xa6acd2);if(!_0x3d08a0)return;const _0x3bbfda=_0x3d08a0[_0x2ba62a(0xc4)]&&Object[_0x2ba62a(0xa1)](_0x3d08a0['fileHashes'])[_0x2ba62a(0x9b)]>0x0?_0x3d08a0[_0x2ba62a(0xc4)]:undefined;if(_0x3bbfda)for(const [_0x38b9a6,_0x10f22e]of Object[_0x2ba62a(0xd3)](_0x3bbfda)){const _0xbaadb=resolveManagedFilePath(_0x317d22,_0x38b9a6);if(!existsSync(_0xbaadb))throw CliErrors['validation']('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x317d22,'Managed\x20file\x20was\x20removed\x20locally:\x20'+_0x38b9a6);const _0x5c23b6=lstatSync(_0xbaadb);if(!_0x5c23b6['isFile']())throw CliErrors['validation'](_0x2ba62a(0xd4)+_0x317d22,_0x2ba62a(0xce)+_0x38b9a6);const _0x3b2ae2=bufferSha256(readFileSync(_0xbaadb));if(_0x3b2ae2!==_0x10f22e)throw CliErrors[_0x2ba62a(0xa0)](_0x2ba62a(0xd4)+_0x317d22+'.\x20Changed\x20file:\x20'+_0x38b9a6,_0x2ba62a(0xa9)+_0x38b9a6);}else{const _0x24d62a=resolve(_0x317d22,SKILL_FILE);if(existsSync(_0x24d62a)&&_0x3d08a0[_0x2ba62a(0xb0)]){const _0x1189af=contentHash(readFileSync(_0x24d62a,_0x2ba62a(0xb5)));if(_0x1189af!==_0x3d08a0[_0x2ba62a(0xb0)])throw CliErrors[_0x2ba62a(0xa0)]('Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20'+_0x24d62a,_0x2ba62a(0xab));}}for(const _0x151dd3 of normalizeLocalFiles(_0x91628a)){if(_0x3bbfda?.[_0x151dd3[_0x2ba62a(0xca)]])continue;if(!_0x3bbfda&&_0x151dd3[_0x2ba62a(0xca)]===SKILL_FILE)continue;const _0x40cc97=resolveManagedFilePath(_0x317d22,_0x151dd3[_0x2ba62a(0xca)]);if(!existsSync(_0x40cc97))continue;const _0x3f0af1=lstatSync(_0x40cc97);if(!_0x3f0af1['isFile']())throw CliErrors[_0x2ba62a(0xa0)](_0x2ba62a(0xd4)+_0x317d22,'Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20'+_0x151dd3['path']);const _0x3d7369=bufferSha256(readFileSync(_0x40cc97));if(_0x3d7369!==fileHash(_0x151dd3))throw CliErrors[_0x2ba62a(0xa0)](_0x2ba62a(0xd4)+_0x317d22,'Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20'+_0x151dd3[_0x2ba62a(0xca)]);}}function materializeFiles(_0x2d20be,_0x5e5f89){const _0x142fbb=a145_0x329c;for(const _0x1bdc73 of normalizeLocalFiles(_0x5e5f89)){const _0x347088=resolveManagedFilePath(_0x2d20be,_0x1bdc73[_0x142fbb(0xca)]);mkdirSync(dirname(_0x347088),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x347088,fileContent(_0x1bdc73),0x180);}}function a145_0x8cd5(){const _0x7e008e=['Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','1058950zsHkXs','version','2310248MPTNna','delete','trim','toString','length','Runtime\x20Skill\x20package\x20is\x20missing\x20','trimEnd','paths','match','validation','keys','6399261jKQPJs','name:\x20','displayName','displayName:\x20','env','1102395RrZLPe','status','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','set','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.','6044dfZSGS','267SLbFjn','has','description:\x20','contentHash','6qvTWYb','skillCode','isFile','slice','utf8','force','example','pulledAt','replace','hasOwn','skillName','find','map','187oRohTF','packageBytes','errors','appCode','646084gctTab','stringify','fileHashes','description','test','filter','schemaVersion','contents','path','scope','---','join','Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20','accessKey','2868870KFdhGn','\x0a---\x0a\x0a','15mvpYZn','entries'];a145_0x8cd5=function(){return _0x7e008e;};return a145_0x8cd5();}function removeStaleManagedFiles(_0x289a44,_0x17189e,_0x1ca1a7){const _0x443460=a145_0x329c;if(!_0x17189e)return;const _0x4d082d=new Set(normalizeLocalFiles(_0x1ca1a7)[_0x443460(0xbd)](_0x1dcb12=>_0x1dcb12[_0x443460(0xca)]));for(const _0x576c8a of Object['keys'](_0x17189e)){if(_0x4d082d[_0x443460(0xae)](_0x576c8a))continue;const _0x595834=resolveManagedFilePath(_0x289a44,_0x576c8a);existsSync(_0x595834)&&lstatSync(_0x595834)['isFile']()&&rmSync(_0x595834,{'force':!![]});}}
|
|
1
|
+
(function(_0x43907b,_0x37921f){const _0x9896d6=a153_0x2865,_0x30bcd8=_0x43907b();while(!![]){try{const _0x574f53=parseInt(_0x9896d6(0x15e))/0x1*(-parseInt(_0x9896d6(0x131))/0x2)+parseInt(_0x9896d6(0x13a))/0x3*(-parseInt(_0x9896d6(0x151))/0x4)+-parseInt(_0x9896d6(0x15b))/0x5+-parseInt(_0x9896d6(0x132))/0x6*(parseInt(_0x9896d6(0x14a))/0x7)+parseInt(_0x9896d6(0x12d))/0x8+-parseInt(_0x9896d6(0x15f))/0x9*(-parseInt(_0x9896d6(0x153))/0xa)+parseInt(_0x9896d6(0x145))/0xb;if(_0x574f53===_0x37921f)break;else _0x30bcd8['push'](_0x30bcd8['shift']());}catch(_0x32b291){_0x30bcd8['push'](_0x30bcd8['shift']());}}}(a153_0x4eeb,0xb2c44));import{existsSync,lstatSync,mkdirSync,readFileSync,rmSync}from'node:fs';import{dirname,resolve}from'node:path';import{isCollection,isMap,isNode,parseDocument,visit}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{resolveManagedFilePath,writeBytesAtomic,writeJsonAtomic}from'./fs-utils.js';import{bufferSha256,contentHash,fileHash}from'./hashing.js';function a153_0x4eeb(){const _0x2de4c3=['143016ojTYbR','set','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','slice','displayName:\x20','accessKey','skillName','.\x20Changed\x20file:\x20','3czXLRh','validation','replace','example','fileHashes','description:\x20','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','packageBytes','env','status','name:\x20','20968156xrithr','has','errors','hasOwn','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.','28cNLWuR','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','---','Runtime\x20Skill\x20package\x20is\x20missing\x20','version','path','entries','2842624ZEABVh','force','638930eFXbJv','pulledAt','find','test','toString','displayName','utf8','map','6934820HbUSNA','contents','contentHash','15109CbXxJU','189PpRFIS','description','length','skillCode','trim','delete','keys','1527592CvIRDK','appCode','schemaVersion','isFile','68LTHZRa'];a153_0x4eeb=function(){return _0x2de4c3;};return a153_0x4eeb();}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(_0x52e198,_0x25b3de,_0x441180){const _0x372dfc=a153_0x2865,_0x1745f0=requireSkillCode(_0x52e198),_0x251daa=requirePackageBytes(_0x1745f0,_0x441180[_0x372dfc(0x141)]),_0x3a2372=extractDownloadedPackage(_0x251daa),_0x2eb4c3=_0x3a2372[_0x372dfc(0x155)](_0x38128e=>_0x38128e[_0x372dfc(0x14f)]===SKILL_FILE);if(!_0x2eb4c3)throw CliErrors['validation'](_0x372dfc(0x14d)+SKILL_FILE+':\x20'+_0x1745f0);const _0x57fbcc=withMaterializedSkillFrontmatter(_0x3a2372,_0x52e198,_0x1745f0),_0x581e99=_0x57fbcc['find'](_0x2f6007=>_0x2f6007[_0x372dfc(0x14f)]===SKILL_FILE),_0x4de0b2=fileText(_0x581e99),_0x2bcd33=getRuntimeSkillDir(_0x441180[_0x372dfc(0x142)],_0x441180[_0x372dfc(0x137)],_0x441180[_0x372dfc(0x12e)],_0x25b3de,_0x1745f0,_0x441180['paths']),_0x4dc011=resolve(_0x2bcd33,SKILL_FILE),_0x3a833e=resolve(_0x2bcd33,METADATA_FILE),_0x58022b=contentHash(_0x4de0b2),_0x45dc49=readMetadataIfPresent(_0x3a833e)?.['fileHashes'];ensurePulledFilesCanBeOverwritten(_0x2bcd33,_0x3a833e,_0x57fbcc,_0x441180[_0x372dfc(0x152)]===!![]),mkdirSync(_0x2bcd33,{'recursive':!![],'mode':0x1c0});const _0x2c417c=existsSync(_0x4dc011)?readFileSync(_0x4dc011,_0x372dfc(0x159)):undefined;return materializeFiles(_0x2bcd33,_0x57fbcc),removeStaleManagedFiles(_0x2bcd33,_0x45dc49,_0x57fbcc),writeJsonAtomic(_0x3a833e,buildMetadata(_0x52e198,_0x25b3de,_0x441180[_0x372dfc(0x12e)],_0x58022b,_0x441180[_0x372dfc(0x154)],_0x57fbcc,_0x251daa)),{'skill':_0x52e198,'scope':_0x25b3de,'dir':_0x2bcd33,'skillMdPath':_0x4dc011,'metadataPath':_0x3a833e,'contentHash':_0x58022b,'changed':_0x2c417c!==_0x4de0b2};}export function reuseMaterializedRuntimeSkill(_0x48d32c,_0x527bf9,_0x1c2131){const _0x33e1c1=a153_0x2865,_0x1bbe83=_0x48d32c[_0x33e1c1(0x14e)]?.[_0x33e1c1(0x12a)]();if(!_0x1bbe83)return undefined;const _0x33f42e=requireSkillCode(_0x48d32c),_0x525e7c=getRuntimeSkillDir(_0x1c2131[_0x33e1c1(0x142)],_0x1c2131[_0x33e1c1(0x137)],_0x1c2131[_0x33e1c1(0x12e)],_0x527bf9,_0x33f42e,_0x1c2131['paths']),_0x48a320=resolve(_0x525e7c,SKILL_FILE),_0x4a4d69=resolve(_0x525e7c,METADATA_FILE),_0x217fdc=readMetadataIfPresent(_0x4a4d69);if(!_0x217fdc||_0x217fdc[_0x33e1c1(0x12f)]!==0x2||_0x217fdc[_0x33e1c1(0x12e)]!==_0x1c2131['appCode']||_0x217fdc['scope']!==_0x527bf9||_0x217fdc[_0x33e1c1(0x129)]!==_0x33f42e||_0x217fdc['version']!==_0x1bbe83||_0x217fdc['id']!==_0x48d32c['id']||_0x217fdc[_0x33e1c1(0x138)]!==_0x48d32c[_0x33e1c1(0x138)]||_0x217fdc[_0x33e1c1(0x160)]!==_0x48d32c[_0x33e1c1(0x160)]||_0x217fdc['example']!==_0x48d32c[_0x33e1c1(0x13d)]||_0x217fdc[_0x33e1c1(0x143)]!==_0x48d32c['status']||!_0x217fdc[_0x33e1c1(0x15d)]||!_0x217fdc['fileHashes']||!Object[_0x33e1c1(0x148)](_0x217fdc[_0x33e1c1(0x13e)],SKILL_FILE))return undefined;for(const [_0x4da206,_0x547920]of Object[_0x33e1c1(0x150)](_0x217fdc[_0x33e1c1(0x13e)])){if(!/^[a-f0-9]{64}$/[_0x33e1c1(0x156)](_0x547920))return undefined;const _0x19e101=resolveManagedFilePath(_0x525e7c,_0x4da206);if(!existsSync(_0x19e101)||!lstatSync(_0x19e101)['isFile']())return undefined;if(bufferSha256(readFileSync(_0x19e101))!==_0x547920)return undefined;}return{'skill':_0x48d32c,'scope':_0x527bf9,'dir':_0x525e7c,'skillMdPath':_0x48a320,'metadataPath':_0x4a4d69,'contentHash':_0x217fdc[_0x33e1c1(0x15d)],'changed':![]};}function withMaterializedSkillFrontmatter(_0x188f33,_0x223d22,_0x25f350){const _0x5d1abb=a153_0x2865,_0x39c3d9=skillDisplayName(_0x223d22,_0x25f350),_0x1470c8=_0x223d22[_0x5d1abb(0x160)]?.['trim']()||_0x39c3d9||_0x25f350;return normalizeLocalFiles(_0x188f33)[_0x5d1abb(0x15a)](_0x4ba999=>{const _0x1d4814=_0x5d1abb,_0x78e206=fileText(_0x4ba999);if(_0x4ba999[_0x1d4814(0x14f)]!==SKILL_FILE)return _0x4ba999;if(hasYamlFrontmatter(_0x78e206))return{'path':_0x4ba999[_0x1d4814(0x14f)],'content':withSyncedDisplayName(_0x78e206,_0x39c3d9)};return{'path':_0x4ba999[_0x1d4814(0x14f)],'content':prependSkillFrontmatter(_0x78e206,{'name':_0x25f350,'displayName':_0x39c3d9,'description':_0x1470c8})};});}function hasYamlFrontmatter(_0x2ce856){const _0x3ffb17=a153_0x2865;return/^\uFEFF?---\s*\r?\n/[_0x3ffb17(0x156)](_0x2ce856);}function prependSkillFrontmatter(_0x971a82,_0x27490d){const _0x31329e=a153_0x2865,_0x59788d=_0x971a82['replace'](/^\uFEFF/,'');return[_0x31329e(0x14c),_0x31329e(0x144)+yamlString(_0x27490d['name']),_0x27490d['displayName']?_0x31329e(0x136)+yamlString(_0x27490d[_0x31329e(0x158)]):undefined,_0x31329e(0x13f)+yamlString(_0x27490d[_0x31329e(0x160)]),_0x31329e(0x14c),'',_0x59788d]['filter'](_0x2e4f21=>_0x2e4f21!==undefined)['join']('\x0a');}function yamlString(_0x4e9466){const _0x2842b7=a153_0x2865;return JSON['stringify'](_0x4e9466[_0x2842b7(0x13c)](/\r/g,'')[_0x2842b7(0x12a)]());}function skillDisplayName(_0x36d813,_0x248539){const _0x4685bd=a153_0x2865,_0x58db07=_0x36d813[_0x4685bd(0x138)]?.[_0x4685bd(0x12a)]();return _0x58db07||_0x248539;}function withSyncedDisplayName(_0x1b5568,_0x27ec85){const _0x136867=a153_0x2865,_0x3e266a=_0x1b5568['match'](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x3e266a)return _0x1b5568;const _0xaf18a1=_0x3e266a[0x1]??'',_0x474a16=_0x3e266a[0x2]??'',_0xe87300=parseDocument(_0x474a16);if(_0xe87300[_0x136867(0x147)][_0x136867(0x128)]>0x0||!isMap(_0xe87300['contents']))return _0x1b5568;if(_0x27ec85)_0xe87300[_0x136867(0x133)](_0x136867(0x158),_0x27ec85);else{if(_0xe87300[_0x136867(0x146)](_0x136867(0x158)))_0xe87300[_0x136867(0x12b)]('displayName');else return _0x1b5568;}forceBlockCollections(_0xe87300[_0x136867(0x15c)]);const _0x38dd2b=_0xe87300[_0x136867(0x157)]({'lineWidth':0x0})['trimEnd'](),_0x46005d=_0x1b5568[_0x136867(0x135)](_0x3e266a[0x0][_0x136867(0x128)])[_0x136867(0x13c)](/^\r?\n/,'');return _0xaf18a1+'---\x0a'+_0x38dd2b+'\x0a---\x0a\x0a'+_0x46005d;}function forceBlockCollections(_0x59c567){if(!isNode(_0x59c567))return;visit(_0x59c567,(_0x3e4b6a,_0x318451)=>{isCollection(_0x318451)&&(_0x318451['flow']=![]);});}function a153_0x2865(_0x38fa5e,_0x24861c){_0x38fa5e=_0x38fa5e-0x128;const _0x4eeb8f=a153_0x4eeb();let _0x2865bb=_0x4eeb8f[_0x38fa5e];return _0x2865bb;}function ensurePulledFilesCanBeOverwritten(_0x43be21,_0x51ea92,_0x401e5d,_0x14279c){const _0xcac183=a153_0x2865;if(_0x14279c||!existsSync(_0x51ea92))return;const _0x5e7e41=readMetadataIfPresent(_0x51ea92);if(!_0x5e7e41)return;const _0x5b6c9c=_0x5e7e41['fileHashes']&&Object[_0xcac183(0x12c)](_0x5e7e41['fileHashes'])['length']>0x0?_0x5e7e41[_0xcac183(0x13e)]:undefined;if(_0x5b6c9c)for(const [_0x1171ce,_0x315f2c]of Object['entries'](_0x5b6c9c)){const _0x5679a3=resolveManagedFilePath(_0x43be21,_0x1171ce);if(!existsSync(_0x5679a3))throw CliErrors[_0xcac183(0x13b)](_0xcac183(0x14b)+_0x43be21,'Managed\x20file\x20was\x20removed\x20locally:\x20'+_0x1171ce);const _0x432fc6=lstatSync(_0x5679a3);if(!_0x432fc6[_0xcac183(0x130)]())throw CliErrors[_0xcac183(0x13b)](_0xcac183(0x14b)+_0x43be21,'Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20'+_0x1171ce);const _0x412f8f=bufferSha256(readFileSync(_0x5679a3));if(_0x412f8f!==_0x315f2c)throw CliErrors[_0xcac183(0x13b)](_0xcac183(0x14b)+_0x43be21+_0xcac183(0x139)+_0x1171ce,_0xcac183(0x140)+_0x1171ce);}else{const _0x52140a=resolve(_0x43be21,SKILL_FILE);if(existsSync(_0x52140a)&&_0x5e7e41[_0xcac183(0x15d)]){const _0x503cf1=contentHash(readFileSync(_0x52140a,'utf8'));if(_0x503cf1!==_0x5e7e41[_0xcac183(0x15d)])throw CliErrors[_0xcac183(0x13b)]('Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20'+_0x52140a,_0xcac183(0x149));}}for(const _0x138faa of normalizeLocalFiles(_0x401e5d)){if(_0x5b6c9c?.[_0x138faa['path']])continue;if(!_0x5b6c9c&&_0x138faa[_0xcac183(0x14f)]===SKILL_FILE)continue;const _0x44c868=resolveManagedFilePath(_0x43be21,_0x138faa[_0xcac183(0x14f)]);if(!existsSync(_0x44c868))continue;const _0x354680=lstatSync(_0x44c868);if(!_0x354680['isFile']())throw CliErrors['validation']('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x43be21,_0xcac183(0x134)+_0x138faa[_0xcac183(0x14f)]);const _0x3315a7=bufferSha256(readFileSync(_0x44c868));if(_0x3315a7!==fileHash(_0x138faa))throw CliErrors[_0xcac183(0x13b)](_0xcac183(0x14b)+_0x43be21,'Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20'+_0x138faa[_0xcac183(0x14f)]);}}function materializeFiles(_0x55f468,_0x8c91bf){const _0x5505b9=a153_0x2865;for(const _0x495342 of normalizeLocalFiles(_0x8c91bf)){const _0x35970a=resolveManagedFilePath(_0x55f468,_0x495342[_0x5505b9(0x14f)]);mkdirSync(dirname(_0x35970a),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x35970a,fileContent(_0x495342),0x180);}}function removeStaleManagedFiles(_0x20b064,_0x1f1340,_0x54cf3d){const _0x388d8a=a153_0x2865;if(!_0x1f1340)return;const _0xa70a56=new Set(normalizeLocalFiles(_0x54cf3d)[_0x388d8a(0x15a)](_0x38a705=>_0x38a705[_0x388d8a(0x14f)]));for(const _0xa8f0e of Object[_0x388d8a(0x12c)](_0x1f1340)){if(_0xa70a56[_0x388d8a(0x146)](_0xa8f0e))continue;const _0x3545b2=resolveManagedFilePath(_0x20b064,_0xa8f0e);existsSync(_0x3545b2)&&lstatSync(_0x3545b2)[_0x388d8a(0x130)]()&&rmSync(_0x3545b2,{'force':!![]});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5f3ee8,_0x5976e2){const _0x4950ef=a154_0x77cc,_0x522de8=_0x5f3ee8();while(!![]){try{const _0x3abfd8=parseInt(_0x4950ef(0x17c))/0x1*(parseInt(_0x4950ef(0x185))/0x2)+parseInt(_0x4950ef(0x195))/0x3+parseInt(_0x4950ef(0x173))/0x4*(-parseInt(_0x4950ef(0x174))/0x5)+parseInt(_0x4950ef(0x17d))/0x6*(parseInt(_0x4950ef(0x17a))/0x7)+-parseInt(_0x4950ef(0x188))/0x8*(-parseInt(_0x4950ef(0x191))/0x9)+-parseInt(_0x4950ef(0x178))/0xa*(parseInt(_0x4950ef(0x186))/0xb)+-parseInt(_0x4950ef(0x192))/0xc;if(_0x3abfd8===_0x5976e2)break;else _0x522de8['push'](_0x522de8['shift']());}catch(_0x2096fd){_0x522de8['push'](_0x522de8['shift']());}}}(a154_0x2d74,0x1e2e9));import{existsSync,readFileSync}from'node:fs';import{CliErrors}from'../../errors.js';function a154_0x2d74(){const _0x20c9ea=['manifest','trim','91143OUlrrJ','526248QpTzzq','sourceSessionId','readonly','687732okPjIN','files','forkedFromSkillId','string','tenantCode','908CnesXN','3495CQCyyf','isArray','skillCode','status','80vJFAvM','validation','84kfbywQ','fromEntries','55AJaocB','31722bEbMPB','map','forkedFromVersion','Runtime\x20Skill\x20is\x20missing\x20skillCode.','utf8','zipSize','skillName','path','3902dvDIXQ','115456LSMlHc','hasUpstreamUpdate','8iNBHgP','version','description','length','parse','tags','personal'];a154_0x2d74=function(){return _0x20c9ea;};return a154_0x2d74();}import{METADATA_FILE}from'./constants.js';import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';import{fileContent,normalizeLocalFiles}from'./local-files.js';import{buildSkillPackage,localFilesToManifestFiles}from'./zip-package.js';export function buildMetadata(_0x4aefa4,_0x51f3d8,_0x4db51a,_0x4938bd,_0x37b99f,_0x17e97b,_0x4dc276){const _0xf2238a=a154_0x77cc,_0x14f1c3=_0x17e97b?normalizeLocalFiles(_0x17e97b):[],_0x447fc6=!_0x4dc276&&_0x14f1c3['length']>0x0?buildSkillPackage(_0x14f1c3):undefined,_0x3c4577=_0x4dc276?bufferSha256(_0x4dc276):_0x447fc6?.[_0xf2238a(0x18f)]['zipSha256'],_0x38dde2=_0x4dc276?.['length']??_0x447fc6?.['manifest'][_0xf2238a(0x182)],_0x52240a=_0x14f1c3[_0xf2238a(0x18b)]>0x0?Object[_0xf2238a(0x17b)](_0x14f1c3[_0xf2238a(0x17e)](_0x5b8387=>[_0x5b8387[_0xf2238a(0x184)],fileHash(_0x5b8387)])):undefined;return{'schemaVersion':_0x14f1c3[_0xf2238a(0x18b)]>0x0?0x2:0x1,'id':_0x4aefa4['id'],'appCode':_0x4db51a,'skillCode':requireSkillCode(_0x4aefa4),'skillName':_0x4aefa4[_0xf2238a(0x183)],'description':_0x4aefa4[_0xf2238a(0x18a)],'example':_0x4aefa4['example'],'scope':_0x51f3d8,'readonly':_0x51f3d8!==_0xf2238a(0x18e)||_0x4aefa4[_0xf2238a(0x194)]===!![],'tenantCode':_0x4aefa4[_0xf2238a(0x172)],'userId':_0x4aefa4['userId'],'version':_0x4aefa4[_0xf2238a(0x189)],'status':_0x4aefa4[_0xf2238a(0x177)],'tags':Array[_0xf2238a(0x175)](_0x4aefa4[_0xf2238a(0x18d)])?_0x4aefa4[_0xf2238a(0x18d)]:[],'hasUpstreamUpdate':_0x4aefa4[_0xf2238a(0x187)],'forkedFromSkillId':_0x4aefa4[_0xf2238a(0x170)],'forkedFromVersion':_0x4aefa4[_0xf2238a(0x17f)],'sourceSessionId':_0x4aefa4[_0xf2238a(0x193)],'contentHash':_0x4938bd,'fileHashes':_0x52240a,'treeHash':_0x14f1c3[_0xf2238a(0x18b)]>0x0?fileTreeHash(localFilesToManifestFiles(_0x14f1c3)):undefined,'ossPath':remoteManifestOssPath(_0x4aefa4[_0xf2238a(0x196)]),'zipSha256':_0x3c4577,'zipSize':_0x38dde2,'files':_0x14f1c3[_0xf2238a(0x18b)]>0x0?_0x14f1c3['map'](_0x2c8750=>({'path':_0x2c8750[_0xf2238a(0x184)],'hash':fileHash(_0x2c8750),'size':fileContent(_0x2c8750)[_0xf2238a(0x18b)]})):undefined,'pulledAt':_0x37b99f??new Date()['toISOString']()};}export function requireSkillCode(_0x3454ed){const _0x532cba=a154_0x77cc,_0x1c66a2=_0x3454ed[_0x532cba(0x176)]?.[_0x532cba(0x190)]();if(!_0x1c66a2)throw CliErrors[_0x532cba(0x179)](_0x532cba(0x180));return _0x1c66a2;}function a154_0x77cc(_0x1b8c19,_0x24f2fa){_0x1b8c19=_0x1b8c19-0x170;const _0x2d74f1=a154_0x2d74();let _0x77cc67=_0x2d74f1[_0x1b8c19];return _0x77cc67;}export function readMetadataIfPresent(_0x30baf0){const _0x30e7a1=a154_0x77cc;if(!existsSync(_0x30baf0))return undefined;try{const _0x530bb5=JSON[_0x30e7a1(0x18c)](readFileSync(_0x30baf0,_0x30e7a1(0x181)));return _0x530bb5;}catch{throw CliErrors[_0x30e7a1(0x179)]('Invalid\x20'+METADATA_FILE+':\x20'+_0x30baf0);}}function remoteManifestOssPath(_0x2b6449){const _0x507644=a154_0x77cc;if(!_0x2b6449||typeof _0x2b6449!=='object'||Array[_0x507644(0x175)](_0x2b6449))return undefined;const _0x142d93=_0x2b6449['ossPath'];return typeof _0x142d93===_0x507644(0x171)&&_0x142d93[_0x507644(0x190)]()?_0x142d93[_0x507644(0x190)]():undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a155_0xc790ee=a155_0xfbbc;(function(_0x4d7645,_0xc57337){const _0xaba418=a155_0xfbbc,_0x2bba73=_0x4d7645();while(!![]){try{const _0xcb2383=-parseInt(_0xaba418(0xe3))/0x1*(parseInt(_0xaba418(0xd0))/0x2)+parseInt(_0xaba418(0xd3))/0x3+-parseInt(_0xaba418(0xd2))/0x4+parseInt(_0xaba418(0xe1))/0x5*(-parseInt(_0xaba418(0xec))/0x6)+parseInt(_0xaba418(0xe7))/0x7*(parseInt(_0xaba418(0xeb))/0x8)+-parseInt(_0xaba418(0xe5))/0x9*(parseInt(_0xaba418(0xdf))/0xa)+-parseInt(_0xaba418(0xd8))/0xb*(-parseInt(_0xaba418(0xd5))/0xc);if(_0xcb2383===_0xc57337)break;else _0x2bba73['push'](_0x2bba73['shift']());}catch(_0x8b41d6){_0x2bba73['push'](_0x2bba73['shift']());}}}(a155_0x1bf2,0xd8d46));import{existsSync}from'node:fs';import{homedir}from'node:os';import{resolve}from'node:path';function a155_0x1bf2(){const _0x9921d3=['180014wvOuTF','includes','5043468Uqfhyj','5252664hlKFku','path\x20segment','12QyhHbd','filter','SKILL_ROOT','17872019sLXLOg','cacheRoot','skills','.claude','.workbuddy','workbuddySkillsDir','homeDirName','2683180LlnsTX','.agents','10nDVWcP','validation','4YnbTvk','CLAUDE_SKILL_ROOT','9kxlFtA','cache','42IQrQVD','agentsSkillsDir','skillCode','claudeSkillsDir','529792wJcHqh','2986842rHfUof','\x20for\x20local\x20path:\x20'];a155_0x1bf2=function(){return _0x9921d3;};return a155_0x1bf2();}import{fingerprintAccessKey}from'../../commands/app/cache.js';import{PRODUCT_CONFIG,productEnv}from'../../constant/product.js';import{CliErrors}from'../../errors.js';export function resolveSkillSyncPaths(_0x9e9e1f={}){const _0x5254d5=a155_0xfbbc,_0x1c536f=_0x9e9e1f['homeDir']??homedir(),_0x42b0a9=resolve(_0x1c536f,PRODUCT_CONFIG[_0x5254d5(0xde)],_0x5254d5(0xe6)),_0x54e3b6=trimmedEnv(_0x5254d5(0xd7)),_0xa62438=trimmedEnv(_0x5254d5(0xe4)),_0x44e152=resolve(_0x1c536f,_0x5254d5(0xdc)),_0x32cdc3=_0x9e9e1f[_0x5254d5(0xdd)]??(existsSync(_0x44e152)?resolve(_0x44e152,_0x5254d5(0xda)):undefined);return{'homeDir':_0x1c536f,'cacheRoot':_0x42b0a9,'managedRoot':resolve(_0x1c536f,PRODUCT_CONFIG['homeDirName']),'agentsSkillsDir':_0x9e9e1f[_0x5254d5(0xe8)]??_0x54e3b6??resolve(_0x1c536f,_0x5254d5(0xe0),_0x5254d5(0xda)),'claudeSkillsDir':_0x9e9e1f[_0x5254d5(0xea)]??_0xa62438??resolve(_0x1c536f,_0x5254d5(0xdb),'skills'),'workbuddySkillsDir':_0x32cdc3};}export function runtimeAgentSkillRoots(_0x575b84){const _0x7516b9=a155_0xfbbc;return[_0x575b84['agentsSkillsDir'],_0x575b84['claudeSkillsDir'],_0x575b84[_0x7516b9(0xdd)]][_0x7516b9(0xd6)](_0x38c07f=>Boolean(_0x38c07f));}export function getRuntimeSkillCacheRoot(_0xc8eb0e,_0x3ed247,_0x43ef0c={}){const _0x6e16c=a155_0xfbbc,_0x3fb1b7=resolveSkillSyncPaths(_0x43ef0c);return resolve(_0x3fb1b7[_0x6e16c(0xd9)],_0xc8eb0e,fingerprintAccessKey(_0x3ed247),_0x6e16c(0xda));}export function getRuntimeSkillDir(_0x112550,_0x1101bd,_0x88828b,_0x2af814,_0xa49afd,_0x59f6de={}){const _0x52fa09=a155_0xfbbc;return resolve(getRuntimeSkillCacheRoot(_0x112550,_0x1101bd,_0x59f6de),safePathSegment(_0x88828b,'appCode'),_0x2af814,safePathSegment(_0xa49afd,_0x52fa09(0xe9)));}export function safePathSegment(_0x4054f8,_0x4bac32=a155_0xc790ee(0xd4)){const _0x24f052=a155_0xc790ee;if(!_0x4054f8||_0x4054f8[_0x24f052(0xd1)]('/')||_0x4054f8[_0x24f052(0xd1)]('\x5c')||_0x4054f8[_0x24f052(0xd1)]('..'))throw CliErrors[_0x24f052(0xe2)]('Unsafe\x20'+_0x4bac32+_0x24f052(0xed)+_0x4054f8);return _0x4054f8;}function a155_0xfbbc(_0x378be8,_0x39ade3){_0x378be8=_0x378be8-0xd0;const _0x1bf290=a155_0x1bf2();let _0xfbbcfe=_0x1bf290[_0x378be8];return _0xfbbcfe;}function trimmedEnv(_0x58c039){const _0x3d05ef=productEnv(_0x58c039)?.['trim']();return _0x3d05ef?_0x3d05ef:undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x3f2c6f,_0x28eef6){const _0x37a080=a148_0x1ebb,_0x25e738=_0x3f2c6f();while(!![]){try{const _0x292265=-parseInt(_0x37a080(0x1b3))/0x1*(-parseInt(_0x37a080(0x1c3))/0x2)+parseInt(_0x37a080(0x1be))/0x3*(parseInt(_0x37a080(0x1ab))/0x4)+-parseInt(_0x37a080(0x1e2))/0x5*(parseInt(_0x37a080(0x1e4))/0x6)+parseInt(_0x37a080(0x1cf))/0x7+-parseInt(_0x37a080(0x1e6))/0x8+-parseInt(_0x37a080(0x1bd))/0x9*(parseInt(_0x37a080(0x1de))/0xa)+-parseInt(_0x37a080(0x1e0))/0xb;if(_0x292265===_0x28eef6)break;else _0x25e738['push'](_0x25e738['shift']());}catch(_0x270f5f){_0x25e738['push'](_0x25e738['shift']());}}}(a148_0x4302,0xa91ef));function a148_0x4302(){const _0x1304d7=['ignoreMetadataAppCodeMismatch','1434CbXPMV','appCode','ignoreMetadataScope','dir','ignoreInvalidMetadata','path','displayName','toLowerCase','unknown','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20','tags','targetScope','9633421JwttTr','object','\x20has\x20unsupported\x20scope\x20\x22','utf8','content','files','scope','length','personal','description','\x20name\x20for\x20SkillHub\x20slug\x20generation.','excludedFilePaths','refreshedAt','pushedAt','Invalid\x20','310ZMUBJb','packageBase64','9549914HlHLAS','validation','1755QaSszN','boolean','3858UXfgvX','slice','3211872nTXmuv','\x20to\x20submit\x20company\x20Skills\x20for\x20review.',',\x20or\x20directory\x20name.','company','isSymbolicLink','version','manifest','startsWith','skillCode','replace','sourceSessionId','allowAppCodeRetarget','Unable\x20to\x20resolve\x20skillCode\x20from\x20','filter','match','71968kiTwns','isDirectory','ignoreMetadataSkillCode','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20','isFile','isArray','string','trim','1089YNENvU','skillName','ignoreMetadataForPayload','example','builtin','number','Skill\x20metadata\x20appCode\x20\x22','find','Skill\x20directory\x20not\x20found:\x20','\x20has\x20scope=\x22','95454MlbLgb','60AWQpBA','Remote\x20Skill\x20','Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20','\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22'];a148_0x4302=function(){return _0x1304d7;};return a148_0x4302();}import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a148_0x4e6977}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(_0x5eccb7,_0x3fffc5,_0x3cc9e4={}){const _0x1eedb6=a148_0x1ebb,_0x11b3a0=resolvePushDirectoryRoot(_0x5eccb7),_0x549ec5=readPushMetadataIfPresent(resolve(_0x11b3a0,METADATA_FILE),{'ignoreInvalidMetadata':_0x3cc9e4[_0x1eedb6(0x1c7)]});if(_0x549ec5?.['appCode']&&_0x549ec5[_0x1eedb6(0x1c4)]!==_0x3fffc5&&!_0x3cc9e4[_0x1eedb6(0x1f1)]&&!_0x3cc9e4[_0x1eedb6(0x1c2)])throw CliErrors['validation'](_0x1eedb6(0x1b9)+_0x549ec5['appCode']+_0x1eedb6(0x1c1)+_0x3fffc5+'\x22.');const _0x1e10eb=resolvePushSkillCode(_0x11b3a0,_0x3fffc5,_0x549ec5,_0x3cc9e4);if(!_0x1e10eb)throw CliErrors[_0x1eedb6(0x1e1)](_0x1eedb6(0x1f2)+SKILL_FILE+',\x20'+METADATA_FILE+_0x1eedb6(0x1e8));return{'dir':_0x11b3a0,'skillCode':_0x1e10eb,'metadata':_0x549ec5};}export function readPushDirectory(_0x18ea8e,_0x2b8344,_0x19849e={}){const _0x2b7378=a148_0x1ebb,_0x592f80=resolvePushDirectoryIdentity(_0x18ea8e,_0x2b8344,_0x19849e),_0x52afdc=_0x592f80[_0x2b7378(0x1c6)],_0x4c40b3=resolve(_0x52afdc,SKILL_FILE);if(!existsSync(_0x4c40b3)||!lstatSync(_0x4c40b3)[_0x2b7378(0x1af)]())throw CliErrors[_0x2b7378(0x1e1)]('Missing\x20'+SKILL_FILE+':\x20'+_0x4c40b3);const _0x37d02c=_0x592f80['metadata'],_0x1ee8ef=_0x19849e[_0x2b7378(0x1ce)]??_0x2b7378(0x1d7);if(!_0x19849e[_0x2b7378(0x1c5)]&&_0x37d02c?.[_0x2b7378(0x1d5)]===_0x2b7378(0x1b7))throw CliErrors[_0x2b7378(0x1e1)](_0x2b7378(0x1c0)+METADATA_FILE+_0x2b7378(0x1bc)+_0x37d02c[_0x2b7378(0x1d5)]+'\x22.');if(!_0x19849e[_0x2b7378(0x1c5)]&&_0x1ee8ef==='personal'&&_0x37d02c?.['scope']&&_0x37d02c[_0x2b7378(0x1d5)]!==_0x2b7378(0x1d7))throw CliErrors[_0x2b7378(0x1e1)](_0x2b7378(0x1ae)+METADATA_FILE+'\x20has\x20scope=\x22'+_0x37d02c[_0x2b7378(0x1d5)]+'\x22.',_0x2b7378(0x1cc)+_0x52afdc+_0x2b7378(0x1e7));const _0x1ccdcd=scanSkillDirectory(_0x52afdc,{'excludedFilePaths':_0x19849e[_0x2b7378(0x1da)]}),_0xd68205=buildSkillPackage(_0x1ccdcd),_0x3af38a=readFileSync(_0x4c40b3,_0x2b7378(0x1d2)),_0x29bc3d=_0x592f80['skillCode'],_0x4e593e=_0x19849e[_0x2b7378(0x1b5)]?undefined:_0x37d02c,_0x237b5d=readSkillDisplayName(_0x3af38a);return{'skillCode':_0x29bc3d,'metadata':_0x37d02c,'frontmatterDisplayName':_0x237b5d,'input':{'skillCode':_0x29bc3d,'skillName':_0x237b5d??_0x4e593e?.['skillName'],'description':_0x4e593e?.[_0x2b7378(0x1d8)],'content':_0x3af38a,'files':_0xd68205[_0x2b7378(0x1ec)],'packageBase64':_0xd68205[_0x2b7378(0x1df)],'tags':_0x4e593e?.[_0x2b7378(0x1cd)],'version':_0x4e593e?.[_0x2b7378(0x1eb)],'sourceSessionId':_0x4e593e?.['sourceSessionId']}};}export function refreshPushDirectoryMetadataFromRemote(_0x1fb32e,_0x18e53b,_0x5c191d,_0x449660={}){const _0x57f682=a148_0x1ebb,_0x48c9f3=resolvePushDirectoryRoot(_0x1fb32e),_0x5cc1fd=readPushMetadataIfPresent(resolve(_0x48c9f3,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x564f63=requireRemoteScope(_0x18e53b),_0x4e3d6a=readLocalSkillContent(_0x48c9f3),_0x49766d={..._0x18e53b,'appCode':_0x18e53b[_0x57f682(0x1c4)]??_0x5c191d,'skillName':_0x18e53b[_0x57f682(0x1b4)]??_0x5cc1fd?.['skillName'],'description':_0x18e53b['description']??_0x5cc1fd?.[_0x57f682(0x1d8)],'example':_0x18e53b[_0x57f682(0x1b6)]??_0x5cc1fd?.[_0x57f682(0x1b6)],'tags':Array['isArray'](_0x18e53b[_0x57f682(0x1cd)])?_0x18e53b[_0x57f682(0x1cd)]:_0x5cc1fd?.['tags'],'sourceSessionId':_0x18e53b['sourceSessionId']??_0x5cc1fd?.[_0x57f682(0x1f0)],'content':_0x18e53b[_0x57f682(0x1d3)]??_0x4e3d6a},_0x2b9330=buildMetadata(_0x49766d,_0x564f63,_0x5c191d,contentHash(_0x4e3d6a),_0x449660[_0x57f682(0x1db)]);writeJsonAtomic(resolve(_0x48c9f3,METADATA_FILE),_0x2b9330);}export function recordPushedRuntimeSkill(_0x30703e,_0x340931,_0xfd255b,_0x436ff8={}){const _0x56f882=a148_0x1ebb,_0x4d8fda=resolvePushDirectoryRoot(_0x30703e),_0x570278=scanSkillDirectory(_0x4d8fda),_0x3ed228=_0x570278[_0x56f882(0x1ba)](_0x49a3d2=>_0x49a3d2['path']===SKILL_FILE),_0x339f9e=_0x3ed228?fileText(_0x3ed228):'',_0x5eab97=tryNormalizePackageManifest(_0x340931[_0x56f882(0x1d4)]),_0x1d2f67={..._0x340931,'content':_0x340931[_0x56f882(0x1d3)]??_0x339f9e,'files':_0x5eab97},_0x1f83b5=_0x5eab97?normalizeLocalFiles(_0x570278)[_0x56f882(0x1a9)](_0x5dd6b8=>_0x5eab97[_0x56f882(0x1d4)]['some'](_0x50e844=>_0x50e844[_0x56f882(0x1c8)]===_0x5dd6b8[_0x56f882(0x1c8)])):undefined,_0x513f2c=buildMetadata(_0x1d2f67,_0x436ff8[_0x56f882(0x1d5)]??_0x56f882(0x1d7),_0xfd255b,contentHash(_0x1d2f67[_0x56f882(0x1d3)]??''),_0x436ff8[_0x56f882(0x1dc)],_0x1f83b5);writeJsonAtomic(resolve(_0x4d8fda,METADATA_FILE),_0x513f2c);}export function deriveSkillCodeFromDirectory(_0x32d915,_0x37777e){const _0x59d797=a148_0x1ebb,_0x563f92=basename(resolve(_0x32d915)),_0xc3585f=_0x37777e+'--';return _0x563f92[_0x59d797(0x1ed)](_0xc3585f)?_0x563f92[_0x59d797(0x1e5)](_0xc3585f[_0x59d797(0x1d6)]):_0x563f92;}function resolvePushSkillCode(_0x1f3ac6,_0x4057c9,_0x2e2228,_0x2481f3){const _0x2a356b=a148_0x1ebb,_0x146a0e=deriveSkillCodeFromSkillFile(_0x1f3ac6)||deriveSkillCodeFromDirectory(_0x1f3ac6,_0x4057c9);if(_0x2481f3[_0x2a356b(0x1ad)])return _0x146a0e;return _0x2e2228?.[_0x2a356b(0x1ee)]?.[_0x2a356b(0x1b2)]()||_0x146a0e;}function a148_0x1ebb(_0x290e7b,_0x46ca58){_0x290e7b=_0x290e7b-0x1a9;const _0x4302c5=a148_0x4302();let _0x1ebbf3=_0x4302c5[_0x290e7b];return _0x1ebbf3;}function deriveSkillCodeFromSkillFile(_0x580570){const _0x5ed5bc=a148_0x1ebb,_0x178d44=resolve(_0x580570,SKILL_FILE);if(!existsSync(_0x178d44)||!lstatSync(_0x178d44)['isFile']())return undefined;const _0x23f54=readFileSync(_0x178d44,_0x5ed5bc(0x1d2)),_0x13f108=_0x23f54[_0x5ed5bc(0x1aa)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x13f108)return undefined;const _0x39e555=parseFrontmatterObject(_0x13f108[0x1]??''),_0x4e1db0=scalarToString(_0x39e555?.['name']);return _0x4e1db0?slugifySkillName(_0x4e1db0):undefined;}function readSkillDisplayName(_0x4224fe){const _0x5155c7=a148_0x1ebb,_0x56abd3=_0x4224fe[_0x5155c7(0x1aa)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x56abd3)return undefined;const _0x331005=parseFrontmatterObject(_0x56abd3[0x1]??'');return scalarToString(_0x331005?.[_0x5155c7(0x1c9)]);}function slugifySkillName(_0x52d51f){const _0x1ddea9=a148_0x1ebb,_0x3363e5=_0x52d51f[_0x1ddea9(0x1b2)]()[_0x1ddea9(0x1ca)]()['replace'](/[^\p{L}\p{N}\p{So}]+/gu,'-')[_0x1ddea9(0x1ef)](/^-+/,'')[_0x1ddea9(0x1ef)](/-+$/,'')[_0x1ddea9(0x1ef)](/-{2,}/g,'-');if(!_0x3363e5)throw CliErrors[_0x1ddea9(0x1e1)](_0x1ddea9(0x1dd)+SKILL_FILE+_0x1ddea9(0x1d9));return _0x3363e5;}function parseFrontmatterObject(_0x194b99){const _0x386342=a148_0x1ebb;try{const _0xadf802=a148_0x4e6977(_0x194b99);return _0xadf802&&typeof _0xadf802===_0x386342(0x1d0)&&!Array[_0x386342(0x1b0)](_0xadf802)?_0xadf802:undefined;}catch{return undefined;}}function scalarToString(_0x8f0954){const _0x47abea=a148_0x1ebb;if(typeof _0x8f0954===_0x47abea(0x1b1))return _0x8f0954['trim']();if(typeof _0x8f0954===_0x47abea(0x1b8)||typeof _0x8f0954===_0x47abea(0x1e3))return String(_0x8f0954);return undefined;}function resolvePushDirectoryRoot(_0x581bb3){const _0x2d4543=a148_0x1ebb,_0x241008=resolve(_0x581bb3);if(!existsSync(_0x241008))throw CliErrors[_0x2d4543(0x1e1)](_0x2d4543(0x1bb)+_0x581bb3);const _0x3555d7=lstatSync(_0x241008);if(_0x3555d7[_0x2d4543(0x1ac)]())return _0x241008;if(_0x3555d7[_0x2d4543(0x1ea)]()){const _0x42e653=realpathSync(_0x241008);if(lstatSync(_0x42e653)['isDirectory']())return _0x42e653;}throw CliErrors['validation']('Skill\x20directory\x20not\x20found:\x20'+_0x581bb3);}function requireRemoteScope(_0x46a73c){const _0x2c26c3=a148_0x1ebb;if(_0x46a73c[_0x2c26c3(0x1d5)]===_0x2c26c3(0x1d7)||_0x46a73c[_0x2c26c3(0x1d5)]===_0x2c26c3(0x1e9)||_0x46a73c[_0x2c26c3(0x1d5)]===_0x2c26c3(0x1b7))return _0x46a73c[_0x2c26c3(0x1d5)];throw CliErrors[_0x2c26c3(0x1e1)](_0x2c26c3(0x1bf)+(_0x46a73c[_0x2c26c3(0x1ee)]||'(unknown)')+_0x2c26c3(0x1d1)+(_0x46a73c[_0x2c26c3(0x1d5)]??_0x2c26c3(0x1cb))+'\x22.');}function readLocalSkillContent(_0x258098){const _0x153663=a148_0x1ebb,_0x2f795d=resolve(_0x258098,SKILL_FILE);return existsSync(_0x2f795d)&&lstatSync(_0x2f795d)['isFile']()?readFileSync(_0x2f795d,_0x153663(0x1d2)):'';}function readPushMetadataIfPresent(_0x2ca4ee,_0x16ea96={}){const _0x42e5f3=a148_0x1ebb;try{return readMetadataIfPresent(_0x2ca4ee);}catch(_0x404076){if(_0x16ea96[_0x42e5f3(0x1c7)])return undefined;throw _0x404076;}}
|
|
1
|
+
(function(_0x1d55cf,_0x5e39d5){const _0x2b7f5f=a156_0x3b2c,_0x410121=_0x1d55cf();while(!![]){try{const _0x1e4dff=-parseInt(_0x2b7f5f(0xff))/0x1+-parseInt(_0x2b7f5f(0x106))/0x2+parseInt(_0x2b7f5f(0x132))/0x3+parseInt(_0x2b7f5f(0x10a))/0x4*(parseInt(_0x2b7f5f(0x129))/0x5)+parseInt(_0x2b7f5f(0x130))/0x6+-parseInt(_0x2b7f5f(0x12f))/0x7*(parseInt(_0x2b7f5f(0x135))/0x8)+parseInt(_0x2b7f5f(0x113))/0x9;if(_0x1e4dff===_0x5e39d5)break;else _0x410121['push'](_0x410121['shift']());}catch(_0xdcb4ed){_0x410121['push'](_0x410121['shift']());}}}(a156_0x5a4a,0x4896a));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a156_0x2ec424}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(_0x22edc7,_0x10e514,_0x368ff3={}){const _0x40c3ac=a156_0x3b2c,_0x52889b=resolvePushDirectoryRoot(_0x22edc7),_0x1adb99=readPushMetadataIfPresent(resolve(_0x52889b,METADATA_FILE),{'ignoreInvalidMetadata':_0x368ff3[_0x40c3ac(0x12e)]});if(_0x1adb99?.[_0x40c3ac(0x117)]&&_0x1adb99[_0x40c3ac(0x117)]!==_0x10e514&&!_0x368ff3[_0x40c3ac(0x10e)]&&!_0x368ff3[_0x40c3ac(0x118)])throw CliErrors[_0x40c3ac(0x11e)](_0x40c3ac(0x110)+_0x1adb99['appCode']+'\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22'+_0x10e514+'\x22.');const _0x2e4a4f=resolvePushSkillCode(_0x52889b,_0x10e514,_0x1adb99,_0x368ff3);if(!_0x2e4a4f)throw CliErrors['validation']('Unable\x20to\x20resolve\x20skillCode\x20from\x20'+SKILL_FILE+',\x20'+METADATA_FILE+_0x40c3ac(0x133));return{'dir':_0x52889b,'skillCode':_0x2e4a4f,'metadata':_0x1adb99};}export function readPushDirectory(_0x129f79,_0x53c9b5,_0x5508b7={}){const _0x3b4238=a156_0x3b2c,_0x5c2547=resolvePushDirectoryIdentity(_0x129f79,_0x53c9b5,_0x5508b7),_0x33d45b=_0x5c2547[_0x3b4238(0x12d)],_0x13330f=resolve(_0x33d45b,SKILL_FILE);if(!existsSync(_0x13330f)||!lstatSync(_0x13330f)[_0x3b4238(0x11b)]())throw CliErrors['validation'](_0x3b4238(0x12c)+SKILL_FILE+':\x20'+_0x13330f);const _0x3f257c=_0x5c2547['metadata'],_0x1c6567=_0x5508b7[_0x3b4238(0x134)]??_0x3b4238(0x11f);if(!_0x5508b7['ignoreMetadataScope']&&_0x3f257c?.['scope']===_0x3b4238(0x123))throw CliErrors[_0x3b4238(0x11e)](_0x3b4238(0xfe)+METADATA_FILE+_0x3b4238(0x120)+_0x3f257c['scope']+'\x22.');if(!_0x5508b7[_0x3b4238(0x122)]&&_0x1c6567===_0x3b4238(0x11f)&&_0x3f257c?.[_0x3b4238(0x11d)]&&_0x3f257c['scope']!==_0x3b4238(0x11f))throw CliErrors[_0x3b4238(0x11e)](_0x3b4238(0x126)+METADATA_FILE+_0x3b4238(0x120)+_0x3f257c[_0x3b4238(0x11d)]+'\x22.',_0x3b4238(0x10b)+_0x33d45b+'\x20to\x20submit\x20company\x20Skills\x20for\x20review.');const _0x2d9159=scanSkillDirectory(_0x33d45b,{'excludedFilePaths':_0x5508b7[_0x3b4238(0x119)]}),_0x5b9220=buildSkillPackage(_0x2d9159),_0x368aa7=readFileSync(_0x13330f,'utf8'),_0x570f4c=_0x5c2547['skillCode'],_0x123568=_0x5508b7[_0x3b4238(0x128)]?undefined:_0x3f257c,_0x49712f=readSkillDisplayName(_0x368aa7);return{'skillCode':_0x570f4c,'metadata':_0x3f257c,'frontmatterDisplayName':_0x49712f,'input':{'skillCode':_0x570f4c,'skillName':_0x49712f??_0x123568?.[_0x3b4238(0x12a)],'description':_0x123568?.[_0x3b4238(0x10f)],'content':_0x368aa7,'files':_0x5b9220['manifest'],'packageBase64':_0x5b9220[_0x3b4238(0x104)],'tags':_0x123568?.[_0x3b4238(0x115)],'version':_0x123568?.[_0x3b4238(0x111)],'sourceSessionId':_0x123568?.[_0x3b4238(0x112)]}};}export function refreshPushDirectoryMetadataFromRemote(_0xa232c2,_0x31b330,_0x445d47,_0x77a2e5={}){const _0x3e3c15=a156_0x3b2c,_0x2e10d6=resolvePushDirectoryRoot(_0xa232c2),_0x3a1778=readPushMetadataIfPresent(resolve(_0x2e10d6,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x235ff8=requireRemoteScope(_0x31b330),_0x2009e7=readLocalSkillContent(_0x2e10d6),_0x3d0f5f={..._0x31b330,'appCode':_0x31b330[_0x3e3c15(0x117)]??_0x445d47,'skillName':_0x31b330[_0x3e3c15(0x12a)]??_0x3a1778?.[_0x3e3c15(0x12a)],'description':_0x31b330['description']??_0x3a1778?.[_0x3e3c15(0x10f)],'example':_0x31b330[_0x3e3c15(0x114)]??_0x3a1778?.[_0x3e3c15(0x114)],'tags':Array[_0x3e3c15(0x107)](_0x31b330[_0x3e3c15(0x115)])?_0x31b330[_0x3e3c15(0x115)]:_0x3a1778?.[_0x3e3c15(0x115)],'sourceSessionId':_0x31b330[_0x3e3c15(0x112)]??_0x3a1778?.[_0x3e3c15(0x112)],'content':_0x31b330['content']??_0x2009e7},_0xbfc267=buildMetadata(_0x3d0f5f,_0x235ff8,_0x445d47,contentHash(_0x2009e7),_0x77a2e5['refreshedAt']);writeJsonAtomic(resolve(_0x2e10d6,METADATA_FILE),_0xbfc267);}export function recordPushedRuntimeSkill(_0x59ddac,_0x529833,_0x1a1393,_0xbe42de={}){const _0x1acb3b=a156_0x3b2c,_0x23164d=resolvePushDirectoryRoot(_0x59ddac),_0x4f98aa=scanSkillDirectory(_0x23164d),_0x3ef49a=_0x4f98aa[_0x1acb3b(0x105)](_0x2f6433=>_0x2f6433[_0x1acb3b(0x100)]===SKILL_FILE),_0x2f58a5=_0x3ef49a?fileText(_0x3ef49a):'',_0x57c6b1=tryNormalizePackageManifest(_0x529833[_0x1acb3b(0x108)]),_0x4f572b={..._0x529833,'content':_0x529833[_0x1acb3b(0x102)]??_0x2f58a5,'files':_0x57c6b1},_0x9e446e=_0x57c6b1?normalizeLocalFiles(_0x4f98aa)[_0x1acb3b(0xfb)](_0x3f8b08=>_0x57c6b1[_0x1acb3b(0x108)][_0x1acb3b(0x131)](_0x122756=>_0x122756['path']===_0x3f8b08[_0x1acb3b(0x100)])):undefined,_0x1f68ee=buildMetadata(_0x4f572b,_0xbe42de[_0x1acb3b(0x11d)]??'personal',_0x1a1393,contentHash(_0x4f572b[_0x1acb3b(0x102)]??''),_0xbe42de[_0x1acb3b(0x11a)],_0x9e446e);writeJsonAtomic(resolve(_0x23164d,METADATA_FILE),_0x1f68ee);}function a156_0x3b2c(_0x59c621,_0x43e49a){_0x59c621=_0x59c621-0xf9;const _0x5a4ada=a156_0x5a4a();let _0x3b2c37=_0x5a4ada[_0x59c621];return _0x3b2c37;}export function deriveSkillCodeFromDirectory(_0x43c01d,_0x101632){const _0x13864a=a156_0x3b2c,_0x160616=basename(resolve(_0x43c01d)),_0x469d17=_0x101632+'--';return _0x160616[_0x13864a(0x101)](_0x469d17)?_0x160616[_0x13864a(0xf9)](_0x469d17[_0x13864a(0x121)]):_0x160616;}function a156_0x5a4a(){const _0x3e74e1=['version','sourceSessionId','4901553AdiQCj','example','tags','Remote\x20Skill\x20','appCode','ignoreMetadataAppCodeMismatch','excludedFilePaths','pushedAt','isFile','replace','scope','validation','personal','\x20has\x20scope=\x22','length','ignoreMetadataScope','builtin','trim','toLowerCase','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20','match','ignoreMetadataForPayload','802310tHhQhq','skillName','Invalid\x20','Missing\x20','dir','ignoreInvalidMetadata','14wENqph','1098234ATdyXD','some','985737zpJaMo',',\x20or\x20directory\x20name.','targetScope','1197928EKKJPC','slice','isDirectory','filter','skillCode','string','Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20','379361dDujLv','path','startsWith','content','ignoreMetadataSkillCode','packageBase64','find','481064OTiFBx','isArray','files','\x20name\x20for\x20SkillHub\x20slug\x20generation.','4LJWIuj','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20','Skill\x20directory\x20not\x20found:\x20','isSymbolicLink','allowAppCodeRetarget','description','Skill\x20metadata\x20appCode\x20\x22'];a156_0x5a4a=function(){return _0x3e74e1;};return a156_0x5a4a();}function resolvePushSkillCode(_0x32318c,_0x428ad2,_0x4a9ab5,_0x324bf3){const _0x47022c=a156_0x3b2c,_0x2090a1=deriveSkillCodeFromSkillFile(_0x32318c)||deriveSkillCodeFromDirectory(_0x32318c,_0x428ad2);if(_0x324bf3[_0x47022c(0x103)])return _0x2090a1;return _0x4a9ab5?.['skillCode']?.[_0x47022c(0x124)]()||_0x2090a1;}function deriveSkillCodeFromSkillFile(_0xebf16e){const _0x1edf78=a156_0x3b2c,_0xd59831=resolve(_0xebf16e,SKILL_FILE);if(!existsSync(_0xd59831)||!lstatSync(_0xd59831)['isFile']())return undefined;const _0xa3c69c=readFileSync(_0xd59831,'utf8'),_0x15c16f=_0xa3c69c[_0x1edf78(0x127)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x15c16f)return undefined;const _0x2bd81c=parseFrontmatterObject(_0x15c16f[0x1]??''),_0x3a1a2b=scalarToString(_0x2bd81c?.['name']);return _0x3a1a2b?slugifySkillName(_0x3a1a2b):undefined;}function readSkillDisplayName(_0x56050b){const _0x2d2c2c=a156_0x3b2c,_0x54a8e0=_0x56050b[_0x2d2c2c(0x127)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x54a8e0)return undefined;const _0x335e6f=parseFrontmatterObject(_0x54a8e0[0x1]??'');return scalarToString(_0x335e6f?.['displayName']);}function slugifySkillName(_0x2469e5){const _0x39261a=a156_0x3b2c,_0x328a59=_0x2469e5[_0x39261a(0x124)]()[_0x39261a(0x125)]()[_0x39261a(0x11c)](/[^\p{L}\p{N}\p{So}]+/gu,'-')[_0x39261a(0x11c)](/^-+/,'')[_0x39261a(0x11c)](/-+$/,'')[_0x39261a(0x11c)](/-{2,}/g,'-');if(!_0x328a59)throw CliErrors[_0x39261a(0x11e)](_0x39261a(0x12b)+SKILL_FILE+_0x39261a(0x109));return _0x328a59;}function parseFrontmatterObject(_0xa43fd){const _0x2e7d9a=a156_0x3b2c;try{const _0x3b29be=a156_0x2ec424(_0xa43fd);return _0x3b29be&&typeof _0x3b29be==='object'&&!Array[_0x2e7d9a(0x107)](_0x3b29be)?_0x3b29be:undefined;}catch{return undefined;}}function scalarToString(_0x4702c6){const _0x558238=a156_0x3b2c;if(typeof _0x4702c6===_0x558238(0xfd))return _0x4702c6[_0x558238(0x124)]();if(typeof _0x4702c6==='number'||typeof _0x4702c6==='boolean')return String(_0x4702c6);return undefined;}function resolvePushDirectoryRoot(_0x1ae2cf){const _0x5ad8cc=a156_0x3b2c,_0x373770=resolve(_0x1ae2cf);if(!existsSync(_0x373770))throw CliErrors['validation'](_0x5ad8cc(0x10c)+_0x1ae2cf);const _0x2df1ad=lstatSync(_0x373770);if(_0x2df1ad[_0x5ad8cc(0xfa)]())return _0x373770;if(_0x2df1ad[_0x5ad8cc(0x10d)]()){const _0x110419=realpathSync(_0x373770);if(lstatSync(_0x110419)[_0x5ad8cc(0xfa)]())return _0x110419;}throw CliErrors['validation']('Skill\x20directory\x20not\x20found:\x20'+_0x1ae2cf);}function requireRemoteScope(_0x2f2639){const _0x4e748f=a156_0x3b2c;if(_0x2f2639['scope']==='personal'||_0x2f2639[_0x4e748f(0x11d)]==='company'||_0x2f2639['scope']===_0x4e748f(0x123))return _0x2f2639[_0x4e748f(0x11d)];throw CliErrors[_0x4e748f(0x11e)](_0x4e748f(0x116)+(_0x2f2639[_0x4e748f(0xfc)]||'(unknown)')+'\x20has\x20unsupported\x20scope\x20\x22'+(_0x2f2639[_0x4e748f(0x11d)]??'unknown')+'\x22.');}function readLocalSkillContent(_0x294cc5){const _0x5bc7ed=resolve(_0x294cc5,SKILL_FILE);return existsSync(_0x5bc7ed)&&lstatSync(_0x5bc7ed)['isFile']()?readFileSync(_0x5bc7ed,'utf8'):'';}function readPushMetadataIfPresent(_0x1e215b,_0x54aab9={}){const _0xaf450a=a156_0x3b2c;try{return readMetadataIfPresent(_0x1e215b);}catch(_0x42acb2){if(_0x54aab9[_0xaf450a(0x12e)])return undefined;throw _0x42acb2;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x210f57,_0xeff0d4){const _0x117482=a157_0x279c,_0x310844=_0x210f57();while(!![]){try{const _0x2bfce0=-parseInt(_0x117482(0x1e9))/0x1*(-parseInt(_0x117482(0x1ea))/0x2)+parseInt(_0x117482(0x1e4))/0x3+parseInt(_0x117482(0x1e0))/0x4*(parseInt(_0x117482(0x1eb))/0x5)+-parseInt(_0x117482(0x1ee))/0x6+-parseInt(_0x117482(0x1e3))/0x7+parseInt(_0x117482(0x1f0))/0x8*(parseInt(_0x117482(0x1e8))/0x9)+-parseInt(_0x117482(0x1e5))/0xa*(parseInt(_0x117482(0x1ed))/0xb);if(_0x2bfce0===_0xeff0d4)break;else _0x310844['push'](_0x310844['shift']());}catch(_0x15b729){_0x310844['push'](_0x310844['shift']());}}}(a157_0x5f22,0x37a6c));import{CliErrors}from'../../errors.js';export function normalizeRuntimeSkillScopes(_0x1d442){const _0x44eef0=a157_0x279c,_0x1da550=_0x1d442&&_0x1d442[_0x44eef0(0x1f1)]>0x0?_0x1d442:['personal',_0x44eef0(0x1e7),'builtin'],_0x31c304=[];for(const _0x1a317b of _0x1da550){if(!isRuntimeSkillScope(_0x1a317b))throw CliErrors[_0x44eef0(0x1e1)](_0x44eef0(0x1ec)+_0x1a317b);!_0x31c304['includes'](_0x1a317b)&&_0x31c304[_0x44eef0(0x1e2)](_0x1a317b);}return _0x31c304;}function a157_0x279c(_0x105b19,_0x509d78){_0x105b19=_0x105b19-0x1e0;const _0x5f22dc=a157_0x5f22();let _0x279c44=_0x5f22dc[_0x105b19];return _0x279c44;}export function isRuntimeSkillScope(_0x415c32){const _0xb37440=a157_0x279c;return _0x415c32===_0xb37440(0x1e6)||_0x415c32===_0xb37440(0x1e7)||_0x415c32===_0xb37440(0x1ef);}function a157_0x5f22(){const _0x5d427c=['23298MVzQls','645972RzkyXt','builtin','16nEYrff','length','88nHmqhA','validation','push','667093JtXDWx','693447agOANy','3310bXwGsd','personal','company','1957239hTqWaO','2irBNJu','127274ZQMMls','76955TkkWPk','Unsupported\x20runtime\x20Skill\x20scope:\x20'];a157_0x5f22=function(){return _0x5d427c;};return a157_0x5f22();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x55b709,_0x14ba70){const _0x5d98cb=a159_0x535b,_0x500d63=_0x55b709();while(!![]){try{const _0x49d5b8=parseInt(_0x5d98cb(0xfe))/0x1*(parseInt(_0x5d98cb(0x10b))/0x2)+-parseInt(_0x5d98cb(0x10a))/0x3+-parseInt(_0x5d98cb(0x10e))/0x4*(parseInt(_0x5d98cb(0x107))/0x5)+parseInt(_0x5d98cb(0x10f))/0x6*(-parseInt(_0x5d98cb(0x109))/0x7)+parseInt(_0x5d98cb(0x110))/0x8+-parseInt(_0x5d98cb(0xfc))/0x9*(parseInt(_0x5d98cb(0x100))/0xa)+parseInt(_0x5d98cb(0x106))/0xb*(parseInt(_0x5d98cb(0xfb))/0xc);if(_0x49d5b8===_0x14ba70)break;else _0x500d63['push'](_0x500d63['shift']());}catch(_0x1ef58d){_0x500d63['push'](_0x500d63['shift']());}}}(a159_0x4592,0xc9eaf));function a159_0x4592(){const _0x3ec578=['19558eMSGYg','4321170bfeiCL','34lDlSxx','length','map','20xpcbfm','2322mDkGnI','11184800vEHBWL','29916IXmubp','585DUgaTl','validation','59915GbvwwR','path','120050nnXlhu','Runtime\x20Skill\x20package\x20contains\x20directory\x20entry:\x20','entries','Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.','name','from','7711UpskvS','35200cmtGWz','code'];a159_0x4592=function(){return _0x3ec578;};return a159_0x4592();}import{unzipSync,zipSync}from'fflate';import{CliErrors}from'../../errors.js';import{compareSkillFiles,fileContent,normalizeLocalFiles,normalizeSkillRelativePath}from'./local-files.js';const ZIP_MTIME=new Date('1980-01-01T00:00:00.000Z');export function createDeterministicZipPackage(_0x3a5b9f){const _0x1be5c9=a159_0x535b,_0x2a6165={};for(const _0x581019 of normalizeLocalFiles(_0x3a5b9f)){_0x2a6165[_0x581019[_0x1be5c9(0xff)]]=fileContent(_0x581019);}return Buffer[_0x1be5c9(0x105)](zipSync(_0x2a6165,{'level':0x0,'mtime':ZIP_MTIME}));}export function parseZipPackage(_0x2c1f0b){const _0x1b6f72=a159_0x535b;if(_0x2c1f0b[_0x1b6f72(0x10c)]<0x16)throw CliErrors[_0x1b6f72(0xfd)](_0x1b6f72(0x103));let _0x1c573d;try{_0x1c573d=unzipSync(_0x2c1f0b,{'filter'(_0x4ef90b){const _0x30c7be=_0x1b6f72,_0x2f8016=normalizeSkillRelativePath(_0x4ef90b[_0x30c7be(0x104)]);if(_0x2f8016['endsWith']('/'))throw CliErrors[_0x30c7be(0xfd)](_0x30c7be(0x101)+_0x2f8016);return!![];}});}catch(_0x3d294c){if(isRuntimeSkillValidationError(_0x3d294c))throw _0x3d294c;throw CliErrors[_0x1b6f72(0xfd)](_0x1b6f72(0x103));}return Object[_0x1b6f72(0x102)](_0x1c573d)[_0x1b6f72(0x10d)](([_0x5a1363,_0x8c3713])=>({'path':normalizeSkillRelativePath(_0x5a1363),'bytes':Buffer[_0x1b6f72(0x105)](_0x8c3713)}))['sort'](compareSkillFiles);}function a159_0x535b(_0x551074,_0x4b50cb){_0x551074=_0x551074-0xfb;const _0x4592bc=a159_0x4592();let _0x535b0b=_0x4592bc[_0x551074];return _0x535b0b;}function isRuntimeSkillValidationError(_0x4bb5d9){const _0x4fafb6=a159_0x535b;return typeof _0x4bb5d9==='object'&&_0x4bb5d9!==null&&_0x4fafb6(0x108)in _0x4bb5d9&&_0x4bb5d9[_0x4fafb6(0x108)]==='validation_error';}
|