@lovrabet/lovrabet-cli 2.3.6-beta.2 → 2.3.6
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 +33 -2
- 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.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/sdk-doc.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/permit/dataset-get.js +1 -1
- package/lib/commands/permit/dataset-set.js +1 -1
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.js +1 -1
- package/lib/commands/personal-bff/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/schedule/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/service/dynamic.js +1 -1
- package/lib/commands/service/function-name-adapter.js +1 -1
- package/lib/commands/service/index.js +1 -1
- package/lib/commands/service/registry.js +1 -1
- package/lib/commands/skill/commands/create.js +1 -1
- package/lib/commands/skill/commands/diagram.js +1 -1
- package/lib/commands/skill/commands/install.js +1 -1
- package/lib/commands/skill/commands/list.js +1 -1
- package/lib/commands/skill/commands/push.js +1 -1
- package/lib/commands/skill/commands/validate.js +1 -1
- package/lib/commands/skill/diagram.js +1 -1
- package/lib/commands/skill/flags.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/skill/manifest-helpers.js +1 -1
- package/lib/commands/skill/push-execute.js +1 -1
- package/lib/commands/skill/push-flow-helpers.js +1 -1
- package/lib/commands/skill/push-retarget.js +1 -1
- package/lib/commands/skill/scopes.js +1 -1
- package/lib/commands/skill/summary.js +1 -1
- package/lib/commands/skill/templates.js +1 -1
- package/lib/commands/skill/validate.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/update.js +1 -1
- package/lib/commands/user-account/bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/config/domain-config.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/app.js +1 -1
- package/lib/constant/auth-mode.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/distribution.js +1 -1
- package/lib/constant/domain.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 +6 -6
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/kb-management-client.d.ts +17 -0
- package/lib/core/kb-management-client.js +1 -0
- package/lib/core/kb-search-client.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/access-error.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/preparse.js +1 -1
- package/lib/framework/rate-limit.js +1 -1
- package/lib/framework/raw-flags.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-confirmation.js +1 -1
- package/lib/framework/runner-error.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/service-order.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/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.js +1 -1
- package/lib/services/dataset-import/excel-reader.js +1 -1
- package/lib/services/dataset-import/image-bytes.js +1 -1
- package/lib/services/dataset-import/image-ooxml.js +1 -1
- package/lib/services/dataset-import/image-runner.js +1 -1
- package/lib/services/dataset-import/metadata.js +1 -1
- package/lib/services/dataset-import/preview.js +1 -1
- package/lib/services/dataset-import/runner.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/runtime-skill-sync/constants.js +1 -1
- package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
- package/lib/skills/runtime-skill-sync/hashing.js +1 -1
- package/lib/skills/runtime-skill-sync/install-target.js +1 -1
- package/lib/skills/runtime-skill-sync/links.js +1 -1
- package/lib/skills/runtime-skill-sync/list-local.js +1 -1
- package/lib/skills/runtime-skill-sync/local-files.js +1 -1
- package/lib/skills/runtime-skill-sync/materialize.js +1 -1
- package/lib/skills/runtime-skill-sync/metadata.js +1 -1
- package/lib/skills/runtime-skill-sync/paths.js +1 -1
- package/lib/skills/runtime-skill-sync/push.js +1 -1
- package/lib/skills/runtime-skill-sync/scopes.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/utils/access-key-redaction.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/lossless-json.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/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 +1 -1
- package/skills/lovrabet/SKILL.md +1 -1
- package/skills/lovrabet/references/lovrabet-kb-workflow.md +7 -3
- package/skills/lovrabet.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a152_0x4cd1(){const _0x48fe56=['83544nKDZGz','4FbhaLm','5417096TMeGsU','digest','276xgBddJ','13370910aMejqC','6410qhZvsB','67752bhdJNT','sha256','14893749BiUAaT','size','path','hex','update','545DFSsLk','10007410lENyUc'];a152_0x4cd1=function(){return _0x48fe56;};return a152_0x4cd1();}function a152_0x29af(_0x4e4c1c,_0x1009f1){_0x4e4c1c=_0x4e4c1c-0x1a8;const _0x4cd1ea=a152_0x4cd1();let _0x29af5e=_0x4cd1ea[_0x4e4c1c];return _0x29af5e;}(function(_0x1d9900,_0x3f7333){const _0x1148e5=a152_0x29af,_0x48b822=_0x1d9900();while(!![]){try{const _0x5f5819=-parseInt(_0x1148e5(0x1b1))/0x1*(parseInt(_0x1148e5(0x1ac))/0x2)+-parseInt(_0x1148e5(0x1af))/0x3*(parseInt(_0x1148e5(0x1b2))/0x4)+parseInt(_0x1148e5(0x1a9))/0x5*(parseInt(_0x1148e5(0x1ab))/0x6)+-parseInt(_0x1148e5(0x1aa))/0x7+-parseInt(_0x1148e5(0x1ad))/0x8+parseInt(_0x1148e5(0x1b4))/0x9+parseInt(_0x1148e5(0x1b0))/0xa;if(_0x5f5819===_0x3f7333)break;else _0x48b822['push'](_0x48b822['shift']());}catch(_0x53cc5f){_0x48b822['push'](_0x48b822['shift']());}}}(a152_0x4cd1,0xcb129));import{createHash}from'node:crypto';import{fileContent,normalizeManifestFiles}from'./local-files.js';export function contentHash(_0x3a6f5d){const _0x4a2401=a152_0x29af;return createHash(_0x4a2401(0x1b3))[_0x4a2401(0x1a8)](_0x3a6f5d)[_0x4a2401(0x1ae)](_0x4a2401(0x1b7));}export function fileHash(_0xe8627){return bufferSha256(fileContent(_0xe8627));}export function bufferSha256(_0x2fce76){const _0xc65d96=a152_0x29af;return createHash('sha256')['update'](_0x2fce76)['digest'](_0xc65d96(0x1b7));}export function fileTreeHash(_0x45b2e6){const _0x20cf3b=a152_0x29af,_0x519438=createHash('sha256');for(const _0x9c51bd of normalizeManifestFiles(_0x45b2e6)){_0x519438['update'](_0x9c51bd[_0x20cf3b(0x1b6)]),_0x519438[_0x20cf3b(0x1a8)]('\x00'),_0x519438[_0x20cf3b(0x1a8)](_0x9c51bd[_0x20cf3b(0x1b3)]),_0x519438['update']('\x00'),_0x519438[_0x20cf3b(0x1a8)](String(_0x9c51bd[_0x20cf3b(0x1b5)])),_0x519438[_0x20cf3b(0x1a8)]('\x00');}return _0x519438[_0x20cf3b(0x1ae)]('hex');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
const a153_0x333160=a153_0x19e0;(function(_0x198608,_0x2428df){const _0x577d78=a153_0x19e0,_0x261625=_0x198608();while(!![]){try{const _0x331010=-parseInt(_0x577d78(0x70))/0x1+-parseInt(_0x577d78(0x6c))/0x2*(parseInt(_0x577d78(0x78))/0x3)+parseInt(_0x577d78(0x74))/0x4+-parseInt(_0x577d78(0x6b))/0x5+-parseInt(_0x577d78(0x69))/0x6*(-parseInt(_0x577d78(0x75))/0x7)+parseInt(_0x577d78(0x6e))/0x8*(parseInt(_0x577d78(0x6d))/0x9)+parseInt(_0x577d78(0x72))/0xa;if(_0x331010===_0x2428df)break;else _0x261625['push'](_0x261625['shift']());}catch(_0x4b2336){_0x261625['push'](_0x261625['shift']());}}}(a153_0x2f5f,0x6ee5a));import{resolve}from'node:path';function a153_0x19e0(_0x90b0c3,_0x3d5f2a){_0x90b0c3=_0x90b0c3-0x69;const _0x2f5f4d=a153_0x2f5f();let _0x19e060=_0x2f5f4d[_0x90b0c3];return _0x19e060;}import{resolveSkillSyncPaths,runtimeAgentSkillRoots,safePathSegment}from'./paths.js';function a153_0x2f5f(){const _0x4fa644=['project','830334BBPnqH','managedRoot','1143945rQFDOC','3398yJjqRz','9UptSwL','587024DUTTcs','global','729756iXNIVL','appCode','3943940uhugxj','.agents','2174364FXbnvo','35frNmdE','cwd','freeze','513RABtqy'];a153_0x2f5f=function(){return _0x4fa644;};return a153_0x2f5f();}export function resolveRuntimeSkillInstallTarget(_0x4bf008,_0x7b6472=a153_0x333160(0x6f),_0x2415a4={}){const _0x140d14=a153_0x333160,_0x3a7d7e=resolveSkillSyncPaths(_0x2415a4),_0x31d875=safePathSegment(_0x4bf008,_0x140d14(0x71)),_0xa56bcd=_0x7b6472===_0x140d14(0x79)?[resolve(_0x2415a4[_0x140d14(0x76)]??process[_0x140d14(0x76)](),_0x140d14(0x73),'skills')]:runtimeAgentSkillRoots(_0x3a7d7e);return Object[_0x140d14(0x77)]({'scope':_0x7b6472,'appCode':_0x31d875,'skillRoots':Object['freeze'](_0xa56bcd),'managedRoot':_0x3a7d7e[_0x140d14(0x6a)]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a153_0x5c4f35=a153_0xafb7;(function(_0x3c9144,_0x24edc6){const _0x16989e=a153_0xafb7,_0x49f983=_0x3c9144();while(!![]){try{const _0x46a0a7=-parseInt(_0x16989e(0x183))/0x1+-parseInt(_0x16989e(0x174))/0x2*(parseInt(_0x16989e(0x17f))/0x3)+-parseInt(_0x16989e(0x17a))/0x4*(parseInt(_0x16989e(0x169))/0x5)+parseInt(_0x16989e(0x15e))/0x6+-parseInt(_0x16989e(0x16e))/0x7*(-parseInt(_0x16989e(0x16f))/0x8)+parseInt(_0x16989e(0x186))/0x9+-parseInt(_0x16989e(0x162))/0xa*(parseInt(_0x16989e(0x155))/0xb);if(_0x46a0a7===_0x24edc6)break;else _0x49f983['push'](_0x49f983['shift']());}catch(_0x49d730){_0x49f983['push'](_0x49f983['shift']());}}}(a153_0x4230,0x8096a));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import a153_0x211ddb from'fs-extra';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';import{isDanglingSymlink,isPathInside,lstatIfPresent,realOrResolved,resolveSymlinkTarget}from'./fs-utils.js';function a153_0x4230(){const _0x50651b=['created','trim','push','filter','Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20','6134328xHDRuh','removed','skillRoots','Refusing\x20to\x20copy\x20Skill\x20symlink:\x20','20cdNuLG','appCode','linked-from-protected-root','scope','runtime-observe','dir','get','30qzjSpn','length','Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20','builtin','project','7zcqzfc','4724528fkETAz','accessKey','Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20','skill','metadataPath','316wyPdVu','contentHash','lovrabet','not-managed-symlink','unchanged','name','409588FhERsT','protectedLinkRoots','isSymbolicLink','managedRoot','env','3165wavxVE','metadata-mismatch','skillCode','company','322011amlisz','set','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','6037119oILWpq','skipped','has','validation','slice','startsWith','external-symlink','Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20','Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20','3596802rgywpl','updated','map','personal'];a153_0x4230=function(){return _0x50651b;};return a153_0x4230();}import{readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillCacheRoot,resolveSkillSyncPaths,safePathSegment}from'./paths.js';const {copySync,ensureDirSync,removeSync}=a153_0x211ddb,RESERVED_PROJECT_SKILL_CODES=new Set([a153_0x5c4f35(0x176),a153_0x5c4f35(0x166),'secret-retriever']);export function linkEffectiveRuntimeSkills(_0xa42c1,_0x5202fa){const _0x5110ed=a153_0x5c4f35,_0x12cad4=new Map();for(const _0x467ef7 of _0xa42c1){const _0x2d97a4=_0x467ef7[_0x5110ed(0x172)]['skillCode'];if(!_0x2d97a4)continue;const _0x278980=_0x12cad4[_0x5110ed(0x168)](_0x2d97a4);(!_0x278980||_0x467ef7[_0x5110ed(0x165)]==='personal')&&_0x12cad4[_0x5110ed(0x184)](_0x2d97a4,_0x467ef7);}const _0x4ff8ee=[];for(const _0x4cc8fc of _0x12cad4['values']()){const _0x2fde3b=requireSkillCode(_0x4cc8fc[_0x5110ed(0x172)]),_0x6bee99=readMetadataIfPresent(_0x4cc8fc[_0x5110ed(0x173)]);if(_0x6bee99?.[_0x5110ed(0x163)]!==_0x5202fa[_0x5110ed(0x163)]||_0x6bee99[_0x5110ed(0x181)]!==_0x2fde3b)throw CliErrors[_0x5110ed(0x189)](_0x5110ed(0x16b)+_0x5202fa[_0x5110ed(0x163)]+':\x20'+_0x4cc8fc['metadataPath']);const _0x243387=runtimeSkillLinkName(_0x5202fa,_0x2fde3b);for(const _0x32a755 of _0x5202fa['skillRoots']){_0x4ff8ee['push'](ensureManagedSymlink(resolve(_0x32a755,_0x243387),_0x4cc8fc[_0x5110ed(0x167)],_0x5202fa,_0x2fde3b));}}return _0x4ff8ee;}function a153_0xafb7(_0x5c2790,_0x15e405){_0x5c2790=_0x5c2790-0x150;const _0x42309f=a153_0x4230();let _0xafb77d=_0x42309f[_0x5c2790];return _0xafb77d;}export function pruneStaleRuntimeSkillLinks(_0x152d9b,_0xf77387,_0x482e30){const _0x5eb8fc=a153_0x5c4f35,_0x57d308=new Set([..._0xf77387][_0x5eb8fc(0x157)](_0x13d56a=>_0x13d56a[_0x5eb8fc(0x15a)]())[_0x5eb8fc(0x15c)](Boolean)),_0xd85c3a=_0x482e30?new Set([..._0x482e30][_0x5eb8fc(0x157)](_0x9ee4d8=>_0x9ee4d8['trim']())[_0x5eb8fc(0x15c)](Boolean)):undefined,_0x2ab1b6=[];for(const _0x4e98b8 of _0x152d9b[_0x5eb8fc(0x160)]){for(const _0x4a9a54 of managedTargetSkillLinkPaths(_0x4e98b8,_0x152d9b)){const _0x1bacc1=runtimeSkillCodeFromLink(_0x152d9b,_0x4a9a54);if(_0xd85c3a&&!_0xd85c3a[_0x5eb8fc(0x188)](_0x1bacc1))continue;if(_0x57d308['has'](_0x1bacc1))continue;_0x2ab1b6[_0x5eb8fc(0x15b)](removeManagedSkillLink(_0x4a9a54,_0x152d9b,_0x1bacc1));}}return _0x2ab1b6;}export function pruneStaleRuntimeSkillCache(_0x46a213,_0x132973={}){const _0x20b833=a153_0x5c4f35,_0x319078=new Set([..._0x46a213['activeSkillCodes']][_0x20b833(0x157)](_0x169ea8=>_0x169ea8[_0x20b833(0x15a)]())[_0x20b833(0x15c)](Boolean)),_0xd9e8d7=_0x46a213['pruneSkillCodes']?new Set([..._0x46a213['pruneSkillCodes']]['map'](_0x4ef440=>_0x4ef440[_0x20b833(0x15a)]())['filter'](Boolean)):undefined,_0x306618=_0x46a213['scopes']??[_0x20b833(0x158),_0x20b833(0x182)],_0x4f2970=resolve(getRuntimeSkillCacheRoot(_0x46a213[_0x20b833(0x17e)],_0x46a213[_0x20b833(0x170)],_0x132973),safePathSegment(_0x46a213[_0x20b833(0x163)],'appCode')),_0x29b8b8=[];for(const _0x2decea of _0x306618){const _0x1097da=resolve(_0x4f2970,_0x2decea);if(!existsSync(_0x1097da))continue;for(const _0x21bebe of readdirSync(_0x1097da,{'withFileTypes':!![]})){if(!_0x21bebe['isDirectory']())continue;const _0x18f007=_0x21bebe[_0x20b833(0x179)];if(_0xd9e8d7&&!_0xd9e8d7[_0x20b833(0x188)](_0x18f007))continue;if(_0x319078[_0x20b833(0x188)](_0x18f007))continue;const _0x1f4d08=resolve(_0x1097da,_0x18f007),_0x30ec4e=readMetadataIfPresent(resolve(_0x1f4d08,METADATA_FILE));if(_0x30ec4e?.[_0x20b833(0x163)]!==_0x46a213['appCode']||_0x30ec4e[_0x20b833(0x165)]!==_0x2decea||_0x30ec4e['skillCode']!==_0x18f007){_0x29b8b8[_0x20b833(0x15b)]({'path':_0x1f4d08,'action':_0x20b833(0x187),'reason':_0x20b833(0x180)});continue;}if(isLinkedFromAnyRoot(_0x1f4d08,_0x46a213[_0x20b833(0x17b)]??[])){_0x29b8b8[_0x20b833(0x15b)]({'path':_0x1f4d08,'action':'skipped','reason':_0x20b833(0x164)});continue;}removeSync(_0x1f4d08),_0x29b8b8[_0x20b833(0x15b)]({'path':_0x1f4d08,'action':_0x20b833(0x15f)});}}return _0x29b8b8;}export function linkGlobalRuntimeSkills(_0x3a83c3,_0x53b78d={}){const _0x5bc40b=a153_0x5c4f35,_0x59c782=resolveSkillSyncPaths(_0x53b78d),_0x3a72f1=[];for(const _0x5ec13f of _0x3a83c3){if(_0x5ec13f['scope']!==_0x5bc40b(0x16c))throw CliErrors[_0x5bc40b(0x189)](_0x5bc40b(0x185)+_0x5ec13f[_0x5bc40b(0x165)]);const _0x10506a=requireSkillCode(_0x5ec13f[_0x5bc40b(0x172)]),_0x5abd4c=copyManagedSkillDirectory(_0x5ec13f[_0x5bc40b(0x167)],resolve(_0x59c782['agentsSkillsDir'],_0x10506a));_0x3a72f1[_0x5bc40b(0x15b)]({..._0x5abd4c,'contentHash':_0x5ec13f[_0x5bc40b(0x175)]});}return _0x3a72f1;}function ensureManagedSymlink(_0x254920,_0x4e5003,_0x2df6b7,_0x35309f){const _0x1980f0=a153_0x5c4f35;mkdirSync(dirname(_0x254920),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x254920)||isDanglingSymlink(_0x254920)){const _0x4636c7=lstatSync(_0x254920);if(!_0x4636c7['isSymbolicLink']())throw CliErrors[_0x1980f0(0x189)](_0x1980f0(0x171)+_0x254920);const _0x21bb36=resolveSymlinkTarget(_0x254920);if(!isPathInside(realOrResolved(_0x21bb36),realOrResolved(_0x2df6b7[_0x1980f0(0x17d)])))throw CliErrors[_0x1980f0(0x189)]('Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20'+_0x254920);if(realOrResolved(_0x21bb36)===realOrResolved(_0x4e5003))return{'path':_0x254920,'target':_0x4e5003,'action':_0x1980f0(0x178)};const _0x19e8d6=readMetadataIfPresent(resolve(_0x21bb36,METADATA_FILE));if(_0x2df6b7[_0x1980f0(0x165)]===_0x1980f0(0x16d)&&(_0x19e8d6?.[_0x1980f0(0x163)]!==_0x2df6b7[_0x1980f0(0x163)]||_0x19e8d6[_0x1980f0(0x181)]!==_0x35309f))throw CliErrors['validation']('Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20'+_0x254920);return unlinkSync(_0x254920),symlinkSync(_0x4e5003,_0x254920,'dir'),{'path':_0x254920,'target':_0x4e5003,'action':'updated'};}return symlinkSync(_0x4e5003,_0x254920,_0x1980f0(0x167)),{'path':_0x254920,'target':_0x4e5003,'action':_0x1980f0(0x159)};}function managedTargetSkillLinkPaths(_0x42e37b,_0x153a2e){const _0xf61a85=a153_0x5c4f35;if(!existsSync(_0x42e37b))return[];const _0x14d167=_0x153a2e[_0xf61a85(0x163)]+'--';return readdirSync(_0x42e37b,{'withFileTypes':!![]})[_0xf61a85(0x15c)](_0x4462c1=>_0x153a2e[_0xf61a85(0x165)]===_0xf61a85(0x16d)||_0x4462c1[_0xf61a85(0x179)][_0xf61a85(0x151)](_0x14d167))[_0xf61a85(0x157)](_0x37539f=>resolve(_0x42e37b,_0x37539f[_0xf61a85(0x179)]));}function removeManagedSkillLink(_0x4e39f9,_0x2065f0,_0x29767e){const _0x124bf7=a153_0x5c4f35,_0x3af73f=lstatIfPresent(_0x4e39f9);if(!_0x3af73f?.[_0x124bf7(0x17c)]())return{'path':_0x4e39f9,'action':_0x124bf7(0x187),'reason':_0x124bf7(0x177)};const _0x12ce8b=resolveSymlinkTarget(_0x4e39f9);if(!isPathInside(realOrResolved(_0x12ce8b),realOrResolved(_0x2065f0['managedRoot'])))return{'path':_0x4e39f9,'action':_0x124bf7(0x187),'reason':_0x124bf7(0x152)};const _0x646c92=readMetadataIfPresent(resolve(_0x12ce8b,METADATA_FILE));if(_0x2065f0[_0x124bf7(0x165)]==='project'&&(_0x646c92?.[_0x124bf7(0x163)]!==_0x2065f0[_0x124bf7(0x163)]||_0x646c92[_0x124bf7(0x181)]!==_0x29767e))return{'path':_0x4e39f9,'action':'skipped','reason':_0x124bf7(0x180)};return unlinkSync(_0x4e39f9),{'path':_0x4e39f9,'action':'removed'};}function isLinkedFromAnyRoot(_0x2d60c2,_0x2ff361){const _0x5814d2=a153_0x5c4f35,_0x1ceb81=realOrResolved(_0x2d60c2);for(const _0x4a702b of _0x2ff361){if(!existsSync(_0x4a702b))continue;for(const _0x1950de of readdirSync(_0x4a702b,{'withFileTypes':!![]})){if(!_0x1950de[_0x5814d2(0x17c)]())continue;const _0x3db22a=resolve(_0x4a702b,_0x1950de[_0x5814d2(0x179)]);if(realOrResolved(resolveSymlinkTarget(_0x3db22a))===_0x1ceb81)return!![];}}return![];}function runtimeSkillLinkName(_0x2d83d3,_0xeb6da1){const _0x1ac70f=a153_0x5c4f35,_0x4f177f=safePathSegment(_0xeb6da1,_0x1ac70f(0x181));if(_0x2d83d3[_0x1ac70f(0x165)]===_0x1ac70f(0x16d)&&RESERVED_PROJECT_SKILL_CODES['has'](_0x4f177f))throw CliErrors[_0x1ac70f(0x189)](_0x1ac70f(0x153)+_0x4f177f);return _0x2d83d3['scope']===_0x1ac70f(0x16d)?_0x4f177f:_0x2d83d3[_0x1ac70f(0x163)]+'--'+_0x4f177f;}function runtimeSkillCodeFromLink(_0x24492a,_0x5e6660){const _0xa8976e=a153_0x5c4f35,_0x313d48=basename(_0x5e6660);return _0x24492a[_0xa8976e(0x165)]===_0xa8976e(0x16d)?_0x313d48:_0x313d48[_0xa8976e(0x150)]((_0x24492a['appCode']+'--')[_0xa8976e(0x16a)]);}export function copyManagedSkillDirectory(_0x4ffa54,_0x1a2fe0){const _0x52eb5e=a153_0x5c4f35,_0x9e1c4f=resolve(_0x1a2fe0,METADATA_FILE),_0x20b9ca=existsSync(_0x1a2fe0);if(_0x20b9ca){const _0x312827=lstatSync(_0x1a2fe0);if(_0x312827[_0x52eb5e(0x17c)]())throw CliErrors['validation'](_0x52eb5e(0x154)+_0x1a2fe0);if(!_0x312827['isDirectory']())throw CliErrors[_0x52eb5e(0x189)](_0x52eb5e(0x15d)+_0x1a2fe0);const _0x5ddd27=readMetadataIfPresent(_0x9e1c4f);if(_0x5ddd27?.[_0x52eb5e(0x165)]!==_0x52eb5e(0x16c))throw CliErrors[_0x52eb5e(0x189)]('Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20'+_0x1a2fe0);}ensureDirSync(dirname(_0x1a2fe0));const _0x4de112=_0x20b9ca?readMetadataIfPresent(_0x9e1c4f)?.[_0x52eb5e(0x175)]:undefined,_0x5e5bcf=readMetadataIfPresent(resolve(_0x4ffa54,METADATA_FILE))?.[_0x52eb5e(0x175)];return _0x20b9ca&&removeSync(_0x1a2fe0),copySkillDirectory(_0x4ffa54,_0x1a2fe0),{'path':_0x1a2fe0,'target':_0x4ffa54,'action':!_0x20b9ca?'created':_0x4de112===_0x5e5bcf?_0x52eb5e(0x178):_0x52eb5e(0x156)};}function copySkillDirectory(_0x2b5628,_0x1ae5b9){copySync(_0x2b5628,_0x1ae5b9,{'dereference':![],'overwrite':!![],'filter'(_0x340225){const _0x1d6510=a153_0xafb7;if(lstatSync(_0x340225)[_0x1d6510(0x17c)]())throw CliErrors[_0x1d6510(0x189)](_0x1d6510(0x161)+_0x340225);return!![];}});}
|
|
1
|
+
const a154_0xbd8b71=a154_0xcff4;function a154_0x2f07(){const _0x519155=['Refusing\x20to\x20copy\x20Skill\x20symlink:\x20','protectedLinkRoots','metadataPath','dir','accessKey','isDirectory','builtin','push','map','get','name','length','1420463JvDoAe','Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20','filter','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','updated','external-symlink','lovrabet','skill','project','21684qyzShe','39637500tMnSID','1785gqENCs','unchanged','not-managed-symlink','skillRoots','validation','contentHash','metadata-mismatch','scope','12454371PUVLuf','pruneSkillCodes','agentsSkillsDir','has','activeSkillCodes','1200174qiwRvx','runtime-observe','secret-retriever','managedRoot','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20','personal','134781QlgqnD','skipped','slice','set','Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20','Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20','company','isSymbolicLink','scopes','32xXxlPi','trim','skillCode','appCode','20UTwUaS','linked-from-protected-root','removed','Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20','values','2414713dvOupG'];a154_0x2f07=function(){return _0x519155;};return a154_0x2f07();}(function(_0x52fb5e,_0x2708dd){const _0x36868f=a154_0xcff4,_0x48db94=_0x52fb5e();while(!![]){try{const _0x4fdcf6=-parseInt(_0x36868f(0x101))/0x1+-parseInt(_0x36868f(0xdc))/0x2+-parseInt(_0x36868f(0xe2))/0x3*(-parseInt(_0x36868f(0xef))/0x4)+parseInt(_0x36868f(0xcf))/0x5*(-parseInt(_0x36868f(0xcd))/0x6)+-parseInt(_0x36868f(0xf4))/0x7*(parseInt(_0x36868f(0xeb))/0x8)+parseInt(_0x36868f(0xd7))/0x9+parseInt(_0x36868f(0xce))/0xa;if(_0x4fdcf6===_0x2708dd)break;else _0x48db94['push'](_0x48db94['shift']());}catch(_0x4a2e30){_0x48db94['push'](_0x48db94['shift']());}}}(a154_0x2f07,0xd73d4));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import a154_0x587f10 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}=a154_0x587f10,RESERVED_PROJECT_SKILL_CODES=new Set([a154_0xbd8b71(0xca),a154_0xbd8b71(0xdd),a154_0xbd8b71(0xde)]);export function linkEffectiveRuntimeSkills(_0xba4ec4,_0x1fec3f){const _0x183b1e=a154_0xbd8b71,_0xf08ce0=new Map();for(const _0x3d1ddf of _0xba4ec4){const _0x55ec69=_0x3d1ddf[_0x183b1e(0xcb)][_0x183b1e(0xed)];if(!_0x55ec69)continue;const _0x50828f=_0xf08ce0[_0x183b1e(0xfe)](_0x55ec69);(!_0x50828f||_0x3d1ddf['scope']===_0x183b1e(0xe1))&&_0xf08ce0[_0x183b1e(0xe5)](_0x55ec69,_0x3d1ddf);}const _0x37615a=[];for(const _0x2fa396 of _0xf08ce0[_0x183b1e(0xf3)]()){const _0x5aa577=requireSkillCode(_0x2fa396[_0x183b1e(0xcb)]),_0x2db19d=readMetadataIfPresent(_0x2fa396[_0x183b1e(0xf7)]);if(_0x2db19d?.[_0x183b1e(0xee)]!==_0x1fec3f[_0x183b1e(0xee)]||_0x2db19d[_0x183b1e(0xed)]!==_0x5aa577)throw CliErrors['validation'](_0x183b1e(0xe6)+_0x1fec3f['appCode']+':\x20'+_0x2fa396[_0x183b1e(0xf7)]);const _0x58526c=runtimeSkillLinkName(_0x1fec3f,_0x5aa577);for(const _0x3ea85e of _0x1fec3f[_0x183b1e(0xd2)]){_0x37615a['push'](ensureManagedSymlink(resolve(_0x3ea85e,_0x58526c),_0x2fa396[_0x183b1e(0xf8)],_0x1fec3f,_0x5aa577));}}return _0x37615a;}export function pruneStaleRuntimeSkillLinks(_0x2d4d38,_0xcd47b5,_0x5bd5a5){const _0x5b6c41=a154_0xbd8b71,_0x5e37f8=new Set([..._0xcd47b5][_0x5b6c41(0xfd)](_0x1b1d14=>_0x1b1d14[_0x5b6c41(0xec)]())[_0x5b6c41(0x103)](Boolean)),_0x40db25=_0x5bd5a5?new Set([..._0x5bd5a5][_0x5b6c41(0xfd)](_0x5653b9=>_0x5653b9[_0x5b6c41(0xec)]())['filter'](Boolean)):undefined,_0x15305a=[];for(const _0x523ecd of _0x2d4d38[_0x5b6c41(0xd2)]){for(const _0xf14cf6 of managedTargetSkillLinkPaths(_0x523ecd,_0x2d4d38)){const _0x3b9404=runtimeSkillCodeFromLink(_0x2d4d38,_0xf14cf6);if(_0x40db25&&!_0x40db25[_0x5b6c41(0xda)](_0x3b9404))continue;if(_0x5e37f8['has'](_0x3b9404))continue;_0x15305a[_0x5b6c41(0xfc)](removeManagedSkillLink(_0xf14cf6,_0x2d4d38,_0x3b9404));}}return _0x15305a;}export function pruneStaleRuntimeSkillCache(_0x500cbc,_0xf401f1={}){const _0x788768=a154_0xbd8b71,_0x7d44cc=new Set([..._0x500cbc[_0x788768(0xdb)]][_0x788768(0xfd)](_0x17cba8=>_0x17cba8[_0x788768(0xec)]())['filter'](Boolean)),_0x595755=_0x500cbc[_0x788768(0xd8)]?new Set([..._0x500cbc['pruneSkillCodes']][_0x788768(0xfd)](_0x430fc6=>_0x430fc6[_0x788768(0xec)]())['filter'](Boolean)):undefined,_0x571aba=_0x500cbc[_0x788768(0xea)]??['personal',_0x788768(0xe8)],_0x15543f=resolve(getRuntimeSkillCacheRoot(_0x500cbc['env'],_0x500cbc[_0x788768(0xf9)],_0xf401f1),safePathSegment(_0x500cbc[_0x788768(0xee)],'appCode')),_0x181b0a=[];for(const _0x47aac1 of _0x571aba){const _0x5134e7=resolve(_0x15543f,_0x47aac1);if(!existsSync(_0x5134e7))continue;for(const _0x4360f0 of readdirSync(_0x5134e7,{'withFileTypes':!![]})){if(!_0x4360f0[_0x788768(0xfa)]())continue;const _0xc579c3=_0x4360f0['name'];if(_0x595755&&!_0x595755[_0x788768(0xda)](_0xc579c3))continue;if(_0x7d44cc['has'](_0xc579c3))continue;const _0x4ac8a7=resolve(_0x5134e7,_0xc579c3),_0x39e34b=readMetadataIfPresent(resolve(_0x4ac8a7,METADATA_FILE));if(_0x39e34b?.[_0x788768(0xee)]!==_0x500cbc[_0x788768(0xee)]||_0x39e34b[_0x788768(0xd6)]!==_0x47aac1||_0x39e34b[_0x788768(0xed)]!==_0xc579c3){_0x181b0a[_0x788768(0xfc)]({'path':_0x4ac8a7,'action':'skipped','reason':_0x788768(0xd5)});continue;}if(isLinkedFromAnyRoot(_0x4ac8a7,_0x500cbc[_0x788768(0xf6)]??[])){_0x181b0a[_0x788768(0xfc)]({'path':_0x4ac8a7,'action':_0x788768(0xe3),'reason':_0x788768(0xf0)});continue;}removeSync(_0x4ac8a7),_0x181b0a[_0x788768(0xfc)]({'path':_0x4ac8a7,'action':_0x788768(0xf1)});}}return _0x181b0a;}export function linkGlobalRuntimeSkills(_0x4c6e7b,_0x388497={}){const _0x5c584e=a154_0xbd8b71,_0x1c0281=resolveSkillSyncPaths(_0x388497),_0xec35ec=[];for(const _0x214225 of _0x4c6e7b){if(_0x214225[_0x5c584e(0xd6)]!==_0x5c584e(0xfb))throw CliErrors[_0x5c584e(0xd3)](_0x5c584e(0x104)+_0x214225[_0x5c584e(0xd6)]);const _0x1433bd=requireSkillCode(_0x214225[_0x5c584e(0xcb)]),_0x35b80e=copyManagedSkillDirectory(_0x214225[_0x5c584e(0xf8)],resolve(_0x1c0281[_0x5c584e(0xd9)],_0x1433bd));_0xec35ec[_0x5c584e(0xfc)]({..._0x35b80e,'contentHash':_0x214225[_0x5c584e(0xd4)]});}return _0xec35ec;}function ensureManagedSymlink(_0x21807d,_0x43728f,_0xa500ec,_0x4e90eb){const _0x6bd61c=a154_0xbd8b71;mkdirSync(dirname(_0x21807d),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x21807d)||isDanglingSymlink(_0x21807d)){const _0x4026db=lstatSync(_0x21807d);if(!_0x4026db[_0x6bd61c(0xe9)]())throw CliErrors['validation'](_0x6bd61c(0xe7)+_0x21807d);const _0x335d9b=resolveSymlinkTarget(_0x21807d);if(!isPathInside(realOrResolved(_0x335d9b),realOrResolved(_0xa500ec['managedRoot'])))throw CliErrors['validation']('Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20'+_0x21807d);if(realOrResolved(_0x335d9b)===realOrResolved(_0x43728f))return{'path':_0x21807d,'target':_0x43728f,'action':'unchanged'};const _0x478b8c=readMetadataIfPresent(resolve(_0x335d9b,METADATA_FILE));if(_0xa500ec[_0x6bd61c(0xd6)]===_0x6bd61c(0xcc)&&(_0x478b8c?.[_0x6bd61c(0xee)]!==_0xa500ec[_0x6bd61c(0xee)]||_0x478b8c[_0x6bd61c(0xed)]!==_0x4e90eb))throw CliErrors[_0x6bd61c(0xd3)]('Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20'+_0x21807d);return unlinkSync(_0x21807d),symlinkSync(_0x43728f,_0x21807d,_0x6bd61c(0xf8)),{'path':_0x21807d,'target':_0x43728f,'action':_0x6bd61c(0x105)};}return symlinkSync(_0x43728f,_0x21807d,_0x6bd61c(0xf8)),{'path':_0x21807d,'target':_0x43728f,'action':'created'};}function managedTargetSkillLinkPaths(_0x3cf628,_0x480ed3){const _0x27b1e4=a154_0xbd8b71;if(!existsSync(_0x3cf628))return[];const _0x46bc20=_0x480ed3['appCode']+'--';return readdirSync(_0x3cf628,{'withFileTypes':!![]})[_0x27b1e4(0x103)](_0x1eb987=>_0x480ed3[_0x27b1e4(0xd6)]===_0x27b1e4(0xcc)||_0x1eb987[_0x27b1e4(0xff)]['startsWith'](_0x46bc20))[_0x27b1e4(0xfd)](_0x568d92=>resolve(_0x3cf628,_0x568d92[_0x27b1e4(0xff)]));}function removeManagedSkillLink(_0x2bd7c0,_0x119897,_0x489224){const _0x905c8a=a154_0xbd8b71,_0x50a342=lstatIfPresent(_0x2bd7c0);if(!_0x50a342?.[_0x905c8a(0xe9)]())return{'path':_0x2bd7c0,'action':'skipped','reason':_0x905c8a(0xd1)};const _0x41d86c=resolveSymlinkTarget(_0x2bd7c0);if(!isPathInside(realOrResolved(_0x41d86c),realOrResolved(_0x119897[_0x905c8a(0xdf)])))return{'path':_0x2bd7c0,'action':_0x905c8a(0xe3),'reason':_0x905c8a(0xc9)};const _0x54f4a1=readMetadataIfPresent(resolve(_0x41d86c,METADATA_FILE));if(_0x119897[_0x905c8a(0xd6)]===_0x905c8a(0xcc)&&(_0x54f4a1?.['appCode']!==_0x119897[_0x905c8a(0xee)]||_0x54f4a1[_0x905c8a(0xed)]!==_0x489224))return{'path':_0x2bd7c0,'action':_0x905c8a(0xe3),'reason':_0x905c8a(0xd5)};return unlinkSync(_0x2bd7c0),{'path':_0x2bd7c0,'action':_0x905c8a(0xf1)};}function a154_0xcff4(_0x2da048,_0x49e2b4){_0x2da048=_0x2da048-0xc9;const _0x2f0798=a154_0x2f07();let _0xcff445=_0x2f0798[_0x2da048];return _0xcff445;}function isLinkedFromAnyRoot(_0x13295c,_0x82e3cf){const _0x476667=a154_0xbd8b71,_0x1a7883=realOrResolved(_0x13295c);for(const _0x32b9db of _0x82e3cf){if(!existsSync(_0x32b9db))continue;for(const _0x5a6ae8 of readdirSync(_0x32b9db,{'withFileTypes':!![]})){if(!_0x5a6ae8['isSymbolicLink']())continue;const _0x3c56e2=resolve(_0x32b9db,_0x5a6ae8[_0x476667(0xff)]);if(realOrResolved(resolveSymlinkTarget(_0x3c56e2))===_0x1a7883)return!![];}}return![];}function runtimeSkillLinkName(_0x1ab7ce,_0x2599b9){const _0x27df2=a154_0xbd8b71,_0x34fb82=safePathSegment(_0x2599b9,'skillCode');if(_0x1ab7ce[_0x27df2(0xd6)]===_0x27df2(0xcc)&&RESERVED_PROJECT_SKILL_CODES['has'](_0x34fb82))throw CliErrors['validation'](_0x27df2(0x102)+_0x34fb82);return _0x1ab7ce[_0x27df2(0xd6)]===_0x27df2(0xcc)?_0x34fb82:_0x1ab7ce['appCode']+'--'+_0x34fb82;}function runtimeSkillCodeFromLink(_0x1227b5,_0x1581d3){const _0x57f55a=a154_0xbd8b71,_0xdb4693=basename(_0x1581d3);return _0x1227b5[_0x57f55a(0xd6)]==='project'?_0xdb4693:_0xdb4693[_0x57f55a(0xe4)]((_0x1227b5['appCode']+'--')[_0x57f55a(0x100)]);}export function copyManagedSkillDirectory(_0x253a33,_0x5be75b){const _0x21ec44=a154_0xbd8b71,_0x2c09d3=resolve(_0x5be75b,METADATA_FILE),_0x182679=existsSync(_0x5be75b);if(_0x182679){const _0x228fa5=lstatSync(_0x5be75b);if(_0x228fa5[_0x21ec44(0xe9)]())throw CliErrors[_0x21ec44(0xd3)](_0x21ec44(0xf2)+_0x5be75b);if(!_0x228fa5[_0x21ec44(0xfa)]())throw CliErrors[_0x21ec44(0xd3)]('Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20'+_0x5be75b);const _0x4e4dba=readMetadataIfPresent(_0x2c09d3);if(_0x4e4dba?.[_0x21ec44(0xd6)]!=='builtin')throw CliErrors['validation'](_0x21ec44(0xe0)+_0x5be75b);}ensureDirSync(dirname(_0x5be75b));const _0x21cac=_0x182679?readMetadataIfPresent(_0x2c09d3)?.[_0x21ec44(0xd4)]:undefined,_0x4bf3bd=readMetadataIfPresent(resolve(_0x253a33,METADATA_FILE))?.[_0x21ec44(0xd4)];return _0x182679&&removeSync(_0x5be75b),copySkillDirectory(_0x253a33,_0x5be75b),{'path':_0x5be75b,'target':_0x253a33,'action':!_0x182679?'created':_0x21cac===_0x4bf3bd?_0x21ec44(0xd0):_0x21ec44(0x105)};}function copySkillDirectory(_0x2d9fbb,_0x4c8610){copySync(_0x2d9fbb,_0x4c8610,{'dereference':![],'overwrite':!![],'filter'(_0x1492e1){const _0x3e35dd=a154_0xcff4;if(lstatSync(_0x1492e1)[_0x3e35dd(0xe9)]())throw CliErrors[_0x3e35dd(0xd3)](_0x3e35dd(0xf5)+_0x1492e1);return!![];}});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x51aba1,_0x1bbe28){const _0x1b0e72=a155_0x11f1,_0x19c4c5=_0x51aba1();while(!![]){try{const _0xa4bdb2=-parseInt(_0x1b0e72(0x75))/0x1+-parseInt(_0x1b0e72(0x77))/0x2+parseInt(_0x1b0e72(0x85))/0x3*(-parseInt(_0x1b0e72(0x91))/0x4)+parseInt(_0x1b0e72(0x8f))/0x5*(parseInt(_0x1b0e72(0x8e))/0x6)+-parseInt(_0x1b0e72(0x97))/0x7+-parseInt(_0x1b0e72(0x92))/0x8*(parseInt(_0x1b0e72(0x84))/0x9)+parseInt(_0x1b0e72(0x74))/0xa;if(_0xa4bdb2===_0x1bbe28)break;else _0x19c4c5['push'](_0x19c4c5['shift']());}catch(_0x4a4a4e){_0x19c4c5['push'](_0x19c4c5['shift']());}}}(a155_0x4631,0x6d3b8));import{existsSync,readdirSync}from'node:fs';import{resolve}from'node:path';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{readMetadataIfPresent}from'./metadata.js';import{getRuntimeSkillCacheRoot,safePathSegment}from'./paths.js';import{isRuntimeSkillScope,normalizeRuntimeSkillScopes}from'./scopes.js';function a155_0x11f1(_0x569cb5,_0xf5b85d){_0x569cb5=_0x569cb5-0x6b;const _0x463128=a155_0x4631();let _0x11f199=_0x463128[_0x569cb5];return _0x11f199;}export function listLocalRuntimeSkills(_0x3bac15,_0xa325ff,_0x28cf6e={}){const _0x387e04=a155_0x11f1,_0x35c1c9=safePathSegment(_0x3bac15[_0x387e04(0x6b)],_0x387e04(0x6b));if(_0xa325ff[_0x387e04(0x6b)]!==_0x35c1c9)throw CliErrors[_0x387e04(0x86)](_0x387e04(0x6d)+_0xa325ff[_0x387e04(0x6b)]+_0x387e04(0x83)+_0x35c1c9);const _0x9b11d3=normalizeRuntimeSkillScopes(_0x3bac15[_0x387e04(0x7c)]),_0x38cf8e=new Set(_0x9b11d3),_0x109502=_0x3bac15[_0x387e04(0x9a)]?.[_0x387e04(0x8d)](),_0x207d91=new Map(),_0x1189b0=resolve(getRuntimeSkillCacheRoot(_0x3bac15[_0x387e04(0x7f)],_0x3bac15[_0x387e04(0x6f)],_0x28cf6e),_0x35c1c9);for(const _0x157189 of _0x9b11d3){for(const _0x72059d of localSkillEntryDirs(resolve(_0x1189b0,_0x157189))){collectLocalRuntimeSkill(_0x207d91,_0x72059d,{'appCode':_0x35c1c9,'scopes':_0x38cf8e,'code':_0x109502,'source':_0x387e04(0x87)});}}for(const _0x3969a6 of _0xa325ff['skillRoots']){for(const _0x1797ee of localSkillLinkCandidates(_0x3969a6,_0xa325ff,_0x38cf8e)){collectLocalRuntimeSkill(_0x207d91,_0x1797ee,{'appCode':_0x35c1c9,'scopes':_0x38cf8e,'code':_0x109502,'source':_0x387e04(0x73),'linkedPath':_0x1797ee});}}return Array[_0x387e04(0x89)](_0x207d91[_0x387e04(0x79)]())[_0x387e04(0x93)](compareLocalRuntimeSkills);}function a155_0x4631(){const _0x9da080=['52236fnkMSC','6jdOqMA','validation','cache','linkedPath','from','get','linkedPaths','tags','trim','985416kJjuqp','5kXwrxn','isSymbolicLink','141716YzFQAh','376ZnYBNU','sort','skillMdPath','localeCompare','project','2603062tdWfnB','metadataPath','map','code','appCode','cacheDir','Runtime\x20Skill\x20install\x20target\x20app\x20mismatch:\x20','isArray','accessKey','isDirectory','includes','builtin','link','15533900tyxNkF','259287PlAWgC','push','590822tPOGQy','filter','values','startsWith','set','scopes','scope','dir','env','skillCode','name','source','\x20!=\x20'];a155_0x4631=function(){return _0x9da080;};return a155_0x4631();}function localSkillEntryDirs(_0x160842){const _0x56adfa=a155_0x11f1;if(!existsSync(_0x160842))return[];return readdirSync(_0x160842,{'withFileTypes':!![]})[_0x56adfa(0x78)](_0x5791d3=>_0x5791d3[_0x56adfa(0x70)]()||_0x5791d3['isSymbolicLink']())[_0x56adfa(0x99)](_0x5e4f2c=>resolve(_0x160842,_0x5e4f2c['name']));}function localSkillLinkCandidates(_0xd005bf,_0x2276f0,_0x3e816d){const _0x21972c=a155_0x11f1;if(!existsSync(_0xd005bf))return[];const _0x745af=_0x2276f0['appCode']+'--';return readdirSync(_0xd005bf,{'withFileTypes':!![]})[_0x21972c(0x78)](_0x3331f9=>_0x3331f9['isDirectory']()||_0x3331f9[_0x21972c(0x90)]())[_0x21972c(0x78)](_0x33a02b=>_0x2276f0[_0x21972c(0x7d)]===_0x21972c(0x96)||_0x33a02b['name'][_0x21972c(0x7a)](_0x745af)||_0x3e816d['has'](_0x21972c(0x72)))[_0x21972c(0x99)](_0x572b41=>resolve(_0xd005bf,_0x572b41[_0x21972c(0x81)]));}function collectLocalRuntimeSkill(_0x1bb151,_0x5bf195,_0x548e07){const _0x465a1b=a155_0x11f1,_0x10baba=resolve(_0x5bf195,METADATA_FILE),_0x2ee410=readMetadataIfPresent(_0x10baba);if(!_0x2ee410)return;if(_0x2ee410['appCode']!==_0x548e07[_0x465a1b(0x6b)])return;if(!isRuntimeSkillScope(_0x2ee410[_0x465a1b(0x7d)])||!_0x548e07[_0x465a1b(0x7c)]['has'](_0x2ee410[_0x465a1b(0x7d)]))return;const _0x3e6744=_0x2ee410['skillCode']?.[_0x465a1b(0x8d)]();if(!_0x3e6744)return;if(_0x548e07[_0x465a1b(0x9a)]&&_0x3e6744!==_0x548e07[_0x465a1b(0x9a)])return;const _0x20c91d=_0x2ee410[_0x465a1b(0x7d)]+':'+_0x3e6744,_0x16d621=_0x548e07['linkedPath']?[_0x548e07[_0x465a1b(0x88)]]:[],_0x169621=_0x1bb151[_0x465a1b(0x8a)](_0x20c91d);if(_0x169621){_0x548e07['source']===_0x465a1b(0x87)&&(_0x169621[_0x465a1b(0x7e)]=_0x5bf195,_0x169621[_0x465a1b(0x6c)]=_0x5bf195,_0x169621[_0x465a1b(0x94)]=resolve(_0x5bf195,SKILL_FILE),_0x169621[_0x465a1b(0x98)]=_0x10baba);for(const _0x27cf6b of _0x16d621){!_0x169621['linkedPaths'][_0x465a1b(0x71)](_0x27cf6b)&&_0x169621[_0x465a1b(0x8b)][_0x465a1b(0x76)](_0x27cf6b);}_0x169621['linkedPaths'][_0x465a1b(0x93)]();return;}_0x1bb151[_0x465a1b(0x7b)](_0x20c91d,{..._0x2ee410,'tags':Array[_0x465a1b(0x6e)](_0x2ee410[_0x465a1b(0x8c)])?_0x2ee410[_0x465a1b(0x8c)]:[],'scope':_0x2ee410['scope'],'source':'local','dir':_0x5bf195,'cacheDir':_0x548e07[_0x465a1b(0x82)]===_0x465a1b(0x87)?_0x5bf195:undefined,'skillMdPath':resolve(_0x5bf195,SKILL_FILE),'metadataPath':_0x10baba,'linkedPaths':_0x16d621});}function compareLocalRuntimeSkills(_0x1aba8f,_0x4e55a9){const _0x80a4fc=a155_0x11f1,_0x5cc9ef={'personal':0x0,'company':0x1,'builtin':0x2};return _0x5cc9ef[_0x1aba8f[_0x80a4fc(0x7d)]]-_0x5cc9ef[_0x4e55a9[_0x80a4fc(0x7d)]]||_0x1aba8f['skillCode'][_0x80a4fc(0x95)](_0x4e55a9[_0x80a4fc(0x80)])||_0x1aba8f[_0x80a4fc(0x7e)][_0x80a4fc(0x95)](_0x4e55a9[_0x80a4fc(0x7e)]);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x43c6f1,_0x2abdd7){const _0xab2275=a156_0x1851,_0x37e92b=_0x43c6f1();while(!![]){try{const _0x5973fc=-parseInt(_0xab2275(0x168))/0x1*(parseInt(_0xab2275(0x173))/0x2)+-parseInt(_0xab2275(0x163))/0x3*(-parseInt(_0xab2275(0x15d))/0x4)+-parseInt(_0xab2275(0x171))/0x5*(-parseInt(_0xab2275(0x188))/0x6)+parseInt(_0xab2275(0x185))/0x7*(-parseInt(_0xab2275(0x15e))/0x8)+parseInt(_0xab2275(0x15c))/0x9+parseInt(_0xab2275(0x16c))/0xa*(-parseInt(_0xab2275(0x167))/0xb)+parseInt(_0xab2275(0x169))/0xc;if(_0x5973fc===_0x2abdd7)break;else _0x37e92b['push'](_0x37e92b['shift']());}catch(_0x4e5e69){_0x37e92b['push'](_0x37e92b['shift']());}}}(a156_0x1894,0xb3b21));import{readFileSync,readdirSync,realpathSync}from'node:fs';function a156_0x1894(){const _0x5e7754=['isFile','255122GTUhfI','validation','values','1242GHelxD','trim','name','toLowerCase','6973155uYkDTU','4972AVVlxt','24bcKbjm','isBuffer','path','startsWith','isDirectory','840MutEwx','includes','Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20','sort','449537sHOvAR','247MQNejK','3878148SxFmmO','has','isArray','170dRfdQH','sha256','push','content','add','28005XUojpS','from','8626gKuwvr','set','bytes','length','Skill\x20file\x20size\x20is\x20invalid:\x20','utf8','test','object','split','Duplicate\x20Skill\x20file\x20path:\x20','toString','size','string','localeCompare','Unsafe\x20Skill\x20file\x20path:\x20','Skill\x20file\x20path\x20must\x20be\x20text.','isSymbolicLink'];a156_0x1894=function(){return _0x5e7754;};return a156_0x1894();}import{relative,resolve}from'node:path';import{CliErrors}from'../../errors.js';import{IGNORED_DIR_NAMES,IGNORED_FILE_NAMES,SKILL_FILE}from'./constants.js';function a156_0x1851(_0x1f5e44,_0x1fe8f2){_0x1f5e44=_0x1f5e44-0x15b;const _0x1894b9=a156_0x1894();let _0x1851bf=_0x1894b9[_0x1f5e44];return _0x1851bf;}export function fileContent(_0x590dfa){const _0x1f1555=a156_0x1851;return _0x590dfa['bytes']??Buffer[_0x1f1555(0x172)](_0x590dfa[_0x1f1555(0x16f)]??'',_0x1f1555(0x178));}export function fileText(_0x55a2e3){const _0x444b43=a156_0x1851;return fileContent(_0x55a2e3)[_0x444b43(0x17d)](_0x444b43(0x178));}export function normalizeLocalFiles(_0x3eecfb){const _0x1d16a0=a156_0x1851;if(!Array[_0x1d16a0(0x16b)](_0x3eecfb)||_0x3eecfb[_0x1d16a0(0x176)]===0x0)return[];const _0x3d681f=new Map();for(const _0x439008 of _0x3eecfb){if(!_0x439008||typeof _0x439008!==_0x1d16a0(0x17a)||typeof _0x439008[_0x1d16a0(0x160)]!==_0x1d16a0(0x17f))throw CliErrors[_0x1d16a0(0x186)](_0x1d16a0(0x182));const _0x2d4943=normalizeSkillRelativePath(_0x439008[_0x1d16a0(0x160)]);if(_0x3d681f[_0x1d16a0(0x16a)](_0x2d4943))throw CliErrors[_0x1d16a0(0x186)](_0x1d16a0(0x17c)+_0x2d4943);if(_0x439008[_0x1d16a0(0x175)]!==undefined&&!Buffer[_0x1d16a0(0x15f)](_0x439008[_0x1d16a0(0x175)]))throw CliErrors[_0x1d16a0(0x186)]('Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20'+_0x2d4943);if(_0x439008[_0x1d16a0(0x175)]===undefined&&typeof _0x439008[_0x1d16a0(0x16f)]!==_0x1d16a0(0x17f))throw CliErrors[_0x1d16a0(0x186)](_0x1d16a0(0x165)+_0x2d4943);const _0x301a39=fileContent(_0x439008);_0x3d681f[_0x1d16a0(0x174)](_0x2d4943,{'path':_0x2d4943,'bytes':_0x301a39});}return Array[_0x1d16a0(0x172)](_0x3d681f[_0x1d16a0(0x187)]())['sort'](compareSkillFiles);}export function normalizeManifestFiles(_0x4c1375){const _0x508795=a156_0x1851;if(!Array[_0x508795(0x16b)](_0x4c1375)||_0x4c1375[_0x508795(0x176)]===0x0)return[];const _0x1f3454=new Map();for(const _0x2a5910 of _0x4c1375){if(!_0x2a5910||typeof _0x2a5910!==_0x508795(0x17a)||typeof _0x2a5910[_0x508795(0x160)]!==_0x508795(0x17f))throw CliErrors[_0x508795(0x186)](_0x508795(0x182));const _0x4ec4fe=normalizeSkillRelativePath(_0x2a5910['path']);if(_0x1f3454[_0x508795(0x16a)](_0x4ec4fe))throw CliErrors[_0x508795(0x186)]('Duplicate\x20Skill\x20file\x20path:\x20'+_0x4ec4fe);if(!isSha256Hex(_0x2a5910[_0x508795(0x16d)]))throw CliErrors[_0x508795(0x186)]('Skill\x20file\x20sha256\x20is\x20invalid:\x20'+_0x4ec4fe);if(!Number['isSafeInteger'](_0x2a5910['size'])||_0x2a5910[_0x508795(0x17e)]<0x0)throw CliErrors[_0x508795(0x186)](_0x508795(0x177)+_0x4ec4fe);_0x1f3454['set'](_0x4ec4fe,{'path':_0x4ec4fe,'sha256':_0x2a5910[_0x508795(0x16d)][_0x508795(0x15b)](),'size':_0x2a5910[_0x508795(0x17e)]});}return Array[_0x508795(0x172)](_0x1f3454['values']())[_0x508795(0x166)](compareSkillFiles);}export function scanSkillDirectory(_0x4bdf8e,_0x4f68ec={}){const _0x4c8e15=realpathSync(_0x4bdf8e),_0x562a59=canonicalExcludedFilePaths(_0x4f68ec['excludedFilePaths']),_0x3bf2bb=[];function _0x55dd3c(_0x2f7f71){const _0x252420=a156_0x1851,_0x41fa6c=readdirSync(_0x2f7f71,{'withFileTypes':!![]})[_0x252420(0x166)]((_0x1d39c0,_0x1b42ac)=>_0x1d39c0[_0x252420(0x18a)][_0x252420(0x180)](_0x1b42ac['name']));for(const _0x451802 of _0x41fa6c){if(_0x451802['isDirectory']()&&IGNORED_DIR_NAMES[_0x252420(0x16a)](_0x451802[_0x252420(0x18a)]))continue;if(IGNORED_FILE_NAMES['has'](_0x451802[_0x252420(0x18a)]))continue;const _0x52feb3=resolve(_0x2f7f71,_0x451802[_0x252420(0x18a)]);if(isExcludedFilePath(_0x52feb3,_0x562a59))continue;if(_0x451802[_0x252420(0x183)]())throw CliErrors['validation']('Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20'+_0x52feb3);const _0x372d7e=toPosixPath(relative(_0x4c8e15,_0x52feb3));if(_0x451802[_0x252420(0x162)]()){_0x55dd3c(_0x52feb3);continue;}if(!_0x451802[_0x252420(0x184)]())continue;validateSkillRelativePath(_0x372d7e);const _0x51711b=readFileSync(_0x52feb3);_0x3bf2bb[_0x252420(0x16e)]({'path':_0x372d7e,'bytes':_0x51711b});}}return _0x55dd3c(_0x4c8e15),normalizeLocalFiles(_0x3bf2bb);}function canonicalExcludedFilePaths(_0x461e15){const _0x58418f=a156_0x1851,_0xca1e9d=new Set();for(const _0x2a8175 of _0x461e15??[]){const _0x1244ca=resolve(_0x2a8175);_0xca1e9d['add'](_0x1244ca);try{_0xca1e9d[_0x58418f(0x170)](realpathSync(_0x1244ca));}catch{}}return _0xca1e9d;}function isExcludedFilePath(_0x5f0b5c,_0x147bbe){const _0x21d608=a156_0x1851;if(_0x147bbe[_0x21d608(0x16a)](_0x5f0b5c))return!![];if(_0x147bbe[_0x21d608(0x17e)]===0x0)return![];try{return _0x147bbe['has'](realpathSync(_0x5f0b5c));}catch{return![];}}export function compareSkillFiles(_0x5b217b,_0x1386ce){const _0x3704c2=a156_0x1851;if(_0x5b217b['path']===SKILL_FILE)return _0x1386ce['path']===SKILL_FILE?0x0:-0x1;if(_0x1386ce[_0x3704c2(0x160)]===SKILL_FILE)return 0x1;return Buffer['compare'](Buffer['from'](_0x5b217b[_0x3704c2(0x160)],_0x3704c2(0x178)),Buffer['from'](_0x1386ce['path'],'utf8'));}export function normalizeSkillRelativePath(_0x5b5110){const _0x3d5ea6=a156_0x1851,_0x5f0302=toPosixPath(_0x5b5110[_0x3d5ea6(0x189)]());return validateSkillRelativePath(_0x5f0302),_0x5f0302;}export function validateSkillRelativePath(_0x57da9e){const _0x2ce156=a156_0x1851;if(!_0x57da9e||_0x57da9e[_0x2ce156(0x161)]('/')||_0x57da9e[_0x2ce156(0x164)]('//'))throw CliErrors[_0x2ce156(0x186)](_0x2ce156(0x181)+_0x57da9e);for(const _0x2c64f8 of _0x57da9e[_0x2ce156(0x17b)]('/')){if(!_0x2c64f8||_0x2c64f8==='.'||_0x2c64f8==='..')throw CliErrors[_0x2ce156(0x186)]('Unsafe\x20Skill\x20file\x20path:\x20'+_0x57da9e);}}export function toPosixPath(_0x55f658){return _0x55f658['replace'](/\\/g,'/');}export function isSha256Hex(_0x38e71a){const _0x4c81f0=a156_0x1851;return typeof _0x38e71a===_0x4c81f0(0x17f)&&/^[a-fA-F0-9]{64}$/[_0x4c81f0(0x179)](_0x38e71a);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x1c2c7d,_0x147e45){const _0x387eae=a156_0x3c11,_0x13b82b=_0x1c2c7d();while(!![]){try{const _0x2b46aa=parseInt(_0x387eae(0x11b))/0x1*(parseInt(_0x387eae(0x130))/0x2)+-parseInt(_0x387eae(0x11f))/0x3*(-parseInt(_0x387eae(0x125))/0x4)+parseInt(_0x387eae(0x137))/0x5+parseInt(_0x387eae(0x126))/0x6+parseInt(_0x387eae(0x13f))/0x7*(parseInt(_0x387eae(0x120))/0x8)+parseInt(_0x387eae(0x149))/0x9*(-parseInt(_0x387eae(0x121))/0xa)+-parseInt(_0x387eae(0x123))/0xb;if(_0x2b46aa===_0x147e45)break;else _0x13b82b['push'](_0x13b82b['shift']());}catch(_0x47296c){_0x13b82b['push'](_0x13b82b['shift']());}}}(a156_0x3d55,0xc5a0f));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(_0x5b6869,_0x10fedf,_0xa507dd){const _0x549c2f=a156_0x3c11,_0x402082=requireSkillCode(_0x5b6869),_0x1a03cf=requirePackageBytes(_0x402082,_0xa507dd['packageBytes']),_0x5dfa30=extractDownloadedPackage(_0x1a03cf),_0x3c53af=_0x5dfa30[_0x549c2f(0x13e)](_0x7ef646=>_0x7ef646[_0x549c2f(0x13c)]===SKILL_FILE);if(!_0x3c53af)throw CliErrors['validation']('Runtime\x20Skill\x20package\x20is\x20missing\x20'+SKILL_FILE+':\x20'+_0x402082);const _0x42cc3a=withMaterializedSkillFrontmatter(_0x5dfa30,_0x5b6869,_0x402082),_0x2ddec1=_0x42cc3a[_0x549c2f(0x13e)](_0x28d81d=>_0x28d81d[_0x549c2f(0x13c)]===SKILL_FILE),_0x74b5c5=fileText(_0x2ddec1),_0x12d488=getRuntimeSkillDir(_0xa507dd[_0x549c2f(0x134)],_0xa507dd[_0x549c2f(0x13b)],_0xa507dd['appCode'],_0x10fedf,_0x402082,_0xa507dd[_0x549c2f(0x148)]),_0x5b3f51=resolve(_0x12d488,SKILL_FILE),_0x5afc0a=resolve(_0x12d488,METADATA_FILE),_0x56d168=contentHash(_0x74b5c5),_0x5d7993=readMetadataIfPresent(_0x5afc0a)?.[_0x549c2f(0x14f)];ensurePulledFilesCanBeOverwritten(_0x12d488,_0x5afc0a,_0x42cc3a,_0xa507dd[_0x549c2f(0x13a)]===!![]),mkdirSync(_0x12d488,{'recursive':!![],'mode':0x1c0});const _0x163113=existsSync(_0x5b3f51)?readFileSync(_0x5b3f51,_0x549c2f(0x143)):undefined;return materializeFiles(_0x12d488,_0x42cc3a),removeStaleManagedFiles(_0x12d488,_0x5d7993,_0x42cc3a),writeJsonAtomic(_0x5afc0a,buildMetadata(_0x5b6869,_0x10fedf,_0xa507dd[_0x549c2f(0x14a)],_0x56d168,_0xa507dd[_0x549c2f(0x12c)],_0x42cc3a,_0x1a03cf)),{'skill':_0x5b6869,'scope':_0x10fedf,'dir':_0x12d488,'skillMdPath':_0x5b3f51,'metadataPath':_0x5afc0a,'contentHash':_0x56d168,'changed':_0x163113!==_0x74b5c5};}function a156_0x3d55(){const _0x58cddd=['198HkoNBS','appCode','Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20','replace','flow','slice','fileHashes','---','join','stringify','.\x20Changed\x20file:\x20','scope','match','status','has','name:\x20','2aOyRmx','test','length','delete','588465eCdRXL','8qoUYLj','562310odvcrc','contentHash','38767861KBZOSH','set','20PSBHjo','6790398CJHwnF','schemaVersion','validation','---\x0a','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','pulledAt','example','name','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','846908GkvWPC','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.','skillName','displayName','env','\x0a---\x0a\x0a','Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20','6951925QIZvAR','description','contents','force','accessKey','path','isFile','find','8547833NGNTRf','version','trimEnd','errors','utf8','map','trim','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','entries','paths'];a156_0x3d55=function(){return _0x58cddd;};return a156_0x3d55();}export function reuseMaterializedRuntimeSkill(_0x41ecc5,_0x6833e7,_0x21c8b9){const _0x113b83=a156_0x3c11,_0x21976b=_0x41ecc5[_0x113b83(0x140)]?.[_0x113b83(0x145)]();if(!_0x21976b)return undefined;const _0x10a77a=requireSkillCode(_0x41ecc5),_0x5f1c38=getRuntimeSkillDir(_0x21c8b9['env'],_0x21c8b9[_0x113b83(0x13b)],_0x21c8b9[_0x113b83(0x14a)],_0x6833e7,_0x10a77a,_0x21c8b9[_0x113b83(0x148)]),_0x426cd1=resolve(_0x5f1c38,SKILL_FILE),_0x1f649d=resolve(_0x5f1c38,METADATA_FILE),_0x22698b=readMetadataIfPresent(_0x1f649d);if(!_0x22698b||_0x22698b[_0x113b83(0x127)]!==0x2||_0x22698b['appCode']!==_0x21c8b9[_0x113b83(0x14a)]||_0x22698b[_0x113b83(0x116)]!==_0x6833e7||_0x22698b['skillCode']!==_0x10a77a||_0x22698b['version']!==_0x21976b||_0x22698b['id']!==_0x41ecc5['id']||_0x22698b[_0x113b83(0x132)]!==_0x41ecc5[_0x113b83(0x132)]||_0x22698b[_0x113b83(0x138)]!==_0x41ecc5[_0x113b83(0x138)]||_0x22698b[_0x113b83(0x12d)]!==_0x41ecc5['example']||_0x22698b['status']!==_0x41ecc5[_0x113b83(0x118)]||!_0x22698b['contentHash']||!_0x22698b[_0x113b83(0x14f)]||!Object['hasOwn'](_0x22698b[_0x113b83(0x14f)],SKILL_FILE))return undefined;for(const [_0xbdc377,_0x582f20]of Object[_0x113b83(0x147)](_0x22698b[_0x113b83(0x14f)])){if(!/^[a-f0-9]{64}$/[_0x113b83(0x11c)](_0x582f20))return undefined;const _0x446b1b=resolveManagedFilePath(_0x5f1c38,_0xbdc377);if(!existsSync(_0x446b1b)||!lstatSync(_0x446b1b)[_0x113b83(0x13d)]())return undefined;if(bufferSha256(readFileSync(_0x446b1b))!==_0x582f20)return undefined;}return{'skill':_0x41ecc5,'scope':_0x6833e7,'dir':_0x5f1c38,'skillMdPath':_0x426cd1,'metadataPath':_0x1f649d,'contentHash':_0x22698b[_0x113b83(0x122)],'changed':![]};}function withMaterializedSkillFrontmatter(_0xd29348,_0x5e8b83,_0x47feba){const _0x24a900=a156_0x3c11,_0x5ed368=skillDisplayName(_0x5e8b83,_0x47feba),_0x1ca861=_0x5e8b83[_0x24a900(0x138)]?.[_0x24a900(0x145)]()||_0x5ed368||_0x47feba;return normalizeLocalFiles(_0xd29348)['map'](_0x1bcf1c=>{const _0x17b493=_0x24a900,_0x4c83be=fileText(_0x1bcf1c);if(_0x1bcf1c[_0x17b493(0x13c)]!==SKILL_FILE)return _0x1bcf1c;if(hasYamlFrontmatter(_0x4c83be))return{'path':_0x1bcf1c['path'],'content':withSyncedDisplayName(_0x4c83be,_0x5ed368)};return{'path':_0x1bcf1c[_0x17b493(0x13c)],'content':prependSkillFrontmatter(_0x4c83be,{'name':_0x47feba,'displayName':_0x5ed368,'description':_0x1ca861})};});}function hasYamlFrontmatter(_0x2fda18){const _0x495223=a156_0x3c11;return/^\uFEFF?---\s*\r?\n/[_0x495223(0x11c)](_0x2fda18);}function prependSkillFrontmatter(_0x19a35c,_0x394ae5){const _0x537d11=a156_0x3c11,_0xc11792=_0x19a35c[_0x537d11(0x14c)](/^\uFEFF/,'');return[_0x537d11(0x150),_0x537d11(0x11a)+yamlString(_0x394ae5[_0x537d11(0x12e)]),_0x394ae5[_0x537d11(0x133)]?'displayName:\x20'+yamlString(_0x394ae5[_0x537d11(0x133)]):undefined,'description:\x20'+yamlString(_0x394ae5[_0x537d11(0x138)]),_0x537d11(0x150),'',_0xc11792]['filter'](_0x4565b8=>_0x4565b8!==undefined)[_0x537d11(0x151)]('\x0a');}function yamlString(_0x5015aa){const _0x318afc=a156_0x3c11;return JSON[_0x318afc(0x152)](_0x5015aa[_0x318afc(0x14c)](/\r/g,'')[_0x318afc(0x145)]());}function skillDisplayName(_0x3a643b,_0x1bcecd){const _0x1ac0b1=a156_0x3c11,_0x464128=_0x3a643b[_0x1ac0b1(0x132)]?.['trim']();return _0x464128||_0x1bcecd;}function withSyncedDisplayName(_0x269a6e,_0x54cea8){const _0x16cbd0=a156_0x3c11,_0x1036e9=_0x269a6e[_0x16cbd0(0x117)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x1036e9)return _0x269a6e;const _0x4e9967=_0x1036e9[0x1]??'',_0x3a5644=_0x1036e9[0x2]??'',_0x36246b=parseDocument(_0x3a5644);if(_0x36246b[_0x16cbd0(0x142)][_0x16cbd0(0x11d)]>0x0||!isMap(_0x36246b[_0x16cbd0(0x139)]))return _0x269a6e;if(_0x54cea8)_0x36246b[_0x16cbd0(0x124)](_0x16cbd0(0x133),_0x54cea8);else{if(_0x36246b[_0x16cbd0(0x119)](_0x16cbd0(0x133)))_0x36246b[_0x16cbd0(0x11e)](_0x16cbd0(0x133));else return _0x269a6e;}forceBlockCollections(_0x36246b[_0x16cbd0(0x139)]);const _0x14f3e5=_0x36246b['toString']({'lineWidth':0x0})[_0x16cbd0(0x141)](),_0x131f47=_0x269a6e[_0x16cbd0(0x14e)](_0x1036e9[0x0][_0x16cbd0(0x11d)])[_0x16cbd0(0x14c)](/^\r?\n/,'');return _0x4e9967+_0x16cbd0(0x129)+_0x14f3e5+_0x16cbd0(0x135)+_0x131f47;}function forceBlockCollections(_0x57655c){if(!isNode(_0x57655c))return;visit(_0x57655c,(_0x460237,_0x1ff901)=>{const _0x3f9063=a156_0x3c11;isCollection(_0x1ff901)&&(_0x1ff901[_0x3f9063(0x14d)]=![]);});}function ensurePulledFilesCanBeOverwritten(_0x252e47,_0x2a51ac,_0x44f312,_0x251caf){const _0x275a44=a156_0x3c11;if(_0x251caf||!existsSync(_0x2a51ac))return;const _0x148bb4=readMetadataIfPresent(_0x2a51ac);if(!_0x148bb4)return;const _0x3446f8=_0x148bb4['fileHashes']&&Object['keys'](_0x148bb4[_0x275a44(0x14f)])['length']>0x0?_0x148bb4[_0x275a44(0x14f)]:undefined;if(_0x3446f8)for(const [_0x464255,_0x1bdba1]of Object[_0x275a44(0x147)](_0x3446f8)){const _0x41f8b9=resolveManagedFilePath(_0x252e47,_0x464255);if(!existsSync(_0x41f8b9))throw CliErrors[_0x275a44(0x128)](_0x275a44(0x12f)+_0x252e47,'Managed\x20file\x20was\x20removed\x20locally:\x20'+_0x464255);const _0x20ed8c=lstatSync(_0x41f8b9);if(!_0x20ed8c[_0x275a44(0x13d)]())throw CliErrors[_0x275a44(0x128)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x252e47,_0x275a44(0x14b)+_0x464255);const _0xfa6113=bufferSha256(readFileSync(_0x41f8b9));if(_0xfa6113!==_0x1bdba1)throw CliErrors['validation'](_0x275a44(0x12f)+_0x252e47+_0x275a44(0x115)+_0x464255,_0x275a44(0x146)+_0x464255);}else{const _0x49feb8=resolve(_0x252e47,SKILL_FILE);if(existsSync(_0x49feb8)&&_0x148bb4[_0x275a44(0x122)]){const _0x2f9bf3=contentHash(readFileSync(_0x49feb8,_0x275a44(0x143)));if(_0x2f9bf3!==_0x148bb4['contentHash'])throw CliErrors[_0x275a44(0x128)](_0x275a44(0x12a)+_0x49feb8,_0x275a44(0x131));}}for(const _0x3edbc9 of normalizeLocalFiles(_0x44f312)){if(_0x3446f8?.[_0x3edbc9[_0x275a44(0x13c)]])continue;if(!_0x3446f8&&_0x3edbc9[_0x275a44(0x13c)]===SKILL_FILE)continue;const _0x271660=resolveManagedFilePath(_0x252e47,_0x3edbc9[_0x275a44(0x13c)]);if(!existsSync(_0x271660))continue;const _0x2f93f6=lstatSync(_0x271660);if(!_0x2f93f6['isFile']())throw CliErrors[_0x275a44(0x128)](_0x275a44(0x12f)+_0x252e47,_0x275a44(0x12b)+_0x3edbc9['path']);const _0x30b762=bufferSha256(readFileSync(_0x271660));if(_0x30b762!==fileHash(_0x3edbc9))throw CliErrors[_0x275a44(0x128)](_0x275a44(0x12f)+_0x252e47,_0x275a44(0x136)+_0x3edbc9[_0x275a44(0x13c)]);}}function a156_0x3c11(_0x7e9f2f,_0x49c7ca){_0x7e9f2f=_0x7e9f2f-0x115;const _0x3d5550=a156_0x3d55();let _0x3c11a4=_0x3d5550[_0x7e9f2f];return _0x3c11a4;}function materializeFiles(_0x31e06c,_0x2458dc){const _0x2ae10c=a156_0x3c11;for(const _0x16e65f of normalizeLocalFiles(_0x2458dc)){const _0x3e3149=resolveManagedFilePath(_0x31e06c,_0x16e65f[_0x2ae10c(0x13c)]);mkdirSync(dirname(_0x3e3149),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x3e3149,fileContent(_0x16e65f),0x180);}}function removeStaleManagedFiles(_0xcd9928,_0x535326,_0x373b1d){const _0x4d0747=a156_0x3c11;if(!_0x535326)return;const _0x363353=new Set(normalizeLocalFiles(_0x373b1d)[_0x4d0747(0x144)](_0x56454d=>_0x56454d[_0x4d0747(0x13c)]));for(const _0x3743de of Object['keys'](_0x535326)){if(_0x363353['has'](_0x3743de))continue;const _0x847ce=resolveManagedFilePath(_0xcd9928,_0x3743de);existsSync(_0x847ce)&&lstatSync(_0x847ce)['isFile']()&&rmSync(_0x847ce,{'force':!![]});}}
|
|
1
|
+
(function(_0x163936,_0x4110b2){const _0xab849a=a157_0x31b7,_0x36ed11=_0x163936();while(!![]){try{const _0x542395=-parseInt(_0xab849a(0x1fd))/0x1*(-parseInt(_0xab849a(0x21c))/0x2)+parseInt(_0xab849a(0x210))/0x3+-parseInt(_0xab849a(0x200))/0x4+-parseInt(_0xab849a(0x1fb))/0x5+-parseInt(_0xab849a(0x21e))/0x6+-parseInt(_0xab849a(0x20d))/0x7*(-parseInt(_0xab849a(0x208))/0x8)+-parseInt(_0xab849a(0x1fe))/0x9;if(_0x542395===_0x4110b2)break;else _0x36ed11['push'](_0x36ed11['shift']());}catch(_0x7a9f5c){_0x36ed11['push'](_0x36ed11['shift']());}}}(a157_0x33c7,0x347cf));import{existsSync,lstatSync,mkdirSync,readFileSync,rmSync}from'node:fs';import{dirname,resolve}from'node:path';import{isCollection,isMap,isNode,parseDocument,visit}from'yaml';function a157_0x33c7(){const _0xf3580=['test','entries','340407zEEaaf','find','length','toString','name:\x20','paths','appCode','scope','flow','trim','trimEnd','filter','274tuNcpm','contents','1093572fAGYal','example','validation','slice','status','description','name','replace','displayName:\x20','contentHash','force','schemaVersion','displayName','version','packageBytes','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','accessKey','isFile','skillCode','\x0a---\x0a\x0a','---','keys','utf8','has','183315hVVEoC','pulledAt','2887rKOZVf','234630aYLcPk','join','877444GNnkxc','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','path','errors','Managed\x20file\x20was\x20removed\x20locally:\x20','delete','fileHashes','skillName','1362872ZcVoLp','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','---\x0a','map','env','7gCZirA'];a157_0x33c7=function(){return _0xf3580;};return a157_0x33c7();}function a157_0x31b7(_0xf55e9e,_0x205ac3){_0xf55e9e=_0xf55e9e-0x1e8;const _0x33c7f0=a157_0x33c7();let _0x31b77c=_0x33c7f0[_0xf55e9e];return _0x31b77c;}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(_0x2442a1,_0x108fe0,_0x5ec250){const _0xb1145a=a157_0x31b7,_0x241f79=requireSkillCode(_0x2442a1),_0x48abd1=requirePackageBytes(_0x241f79,_0x5ec250[_0xb1145a(0x1f1)]),_0x1e191e=extractDownloadedPackage(_0x48abd1),_0x1d40c6=_0x1e191e[_0xb1145a(0x211)](_0x1e7071=>_0x1e7071[_0xb1145a(0x202)]===SKILL_FILE);if(!_0x1d40c6)throw CliErrors[_0xb1145a(0x220)]('Runtime\x20Skill\x20package\x20is\x20missing\x20'+SKILL_FILE+':\x20'+_0x241f79);const _0x3e1196=withMaterializedSkillFrontmatter(_0x1e191e,_0x2442a1,_0x241f79),_0x13d18e=_0x3e1196[_0xb1145a(0x211)](_0x405985=>_0x405985[_0xb1145a(0x202)]===SKILL_FILE),_0x22452d=fileText(_0x13d18e),_0x2c8073=getRuntimeSkillDir(_0x5ec250[_0xb1145a(0x20c)],_0x5ec250[_0xb1145a(0x1f3)],_0x5ec250[_0xb1145a(0x216)],_0x108fe0,_0x241f79,_0x5ec250[_0xb1145a(0x215)]),_0x273652=resolve(_0x2c8073,SKILL_FILE),_0x4fb079=resolve(_0x2c8073,METADATA_FILE),_0x4a3f96=contentHash(_0x22452d),_0x268080=readMetadataIfPresent(_0x4fb079)?.[_0xb1145a(0x206)];ensurePulledFilesCanBeOverwritten(_0x2c8073,_0x4fb079,_0x3e1196,_0x5ec250[_0xb1145a(0x1ed)]===!![]),mkdirSync(_0x2c8073,{'recursive':!![],'mode':0x1c0});const _0x1e9a6c=existsSync(_0x273652)?readFileSync(_0x273652,_0xb1145a(0x1f9)):undefined;return materializeFiles(_0x2c8073,_0x3e1196),removeStaleManagedFiles(_0x2c8073,_0x268080,_0x3e1196),writeJsonAtomic(_0x4fb079,buildMetadata(_0x2442a1,_0x108fe0,_0x5ec250['appCode'],_0x4a3f96,_0x5ec250[_0xb1145a(0x1fc)],_0x3e1196,_0x48abd1)),{'skill':_0x2442a1,'scope':_0x108fe0,'dir':_0x2c8073,'skillMdPath':_0x273652,'metadataPath':_0x4fb079,'contentHash':_0x4a3f96,'changed':_0x1e9a6c!==_0x22452d};}export function reuseMaterializedRuntimeSkill(_0x359e07,_0x432795,_0x5b6306){const _0x2b49cc=a157_0x31b7,_0xee8e30=_0x359e07[_0x2b49cc(0x1f0)]?.[_0x2b49cc(0x219)]();if(!_0xee8e30)return undefined;const _0x4ec556=requireSkillCode(_0x359e07),_0x2d6239=getRuntimeSkillDir(_0x5b6306[_0x2b49cc(0x20c)],_0x5b6306[_0x2b49cc(0x1f3)],_0x5b6306[_0x2b49cc(0x216)],_0x432795,_0x4ec556,_0x5b6306[_0x2b49cc(0x215)]),_0x43ee5f=resolve(_0x2d6239,SKILL_FILE),_0x40b645=resolve(_0x2d6239,METADATA_FILE),_0x2e0aaf=readMetadataIfPresent(_0x40b645);if(!_0x2e0aaf||_0x2e0aaf[_0x2b49cc(0x1ee)]!==0x2||_0x2e0aaf[_0x2b49cc(0x216)]!==_0x5b6306[_0x2b49cc(0x216)]||_0x2e0aaf[_0x2b49cc(0x217)]!==_0x432795||_0x2e0aaf[_0x2b49cc(0x1f5)]!==_0x4ec556||_0x2e0aaf[_0x2b49cc(0x1f0)]!==_0xee8e30||_0x2e0aaf['id']!==_0x359e07['id']||_0x2e0aaf['skillName']!==_0x359e07['skillName']||_0x2e0aaf[_0x2b49cc(0x1e8)]!==_0x359e07[_0x2b49cc(0x1e8)]||_0x2e0aaf['example']!==_0x359e07[_0x2b49cc(0x21f)]||_0x2e0aaf[_0x2b49cc(0x222)]!==_0x359e07[_0x2b49cc(0x222)]||!_0x2e0aaf[_0x2b49cc(0x1ec)]||!_0x2e0aaf[_0x2b49cc(0x206)]||!Object['hasOwn'](_0x2e0aaf['fileHashes'],SKILL_FILE))return undefined;for(const [_0x1fdca8,_0x19b851]of Object[_0x2b49cc(0x20f)](_0x2e0aaf['fileHashes'])){if(!/^[a-f0-9]{64}$/[_0x2b49cc(0x20e)](_0x19b851))return undefined;const _0x471211=resolveManagedFilePath(_0x2d6239,_0x1fdca8);if(!existsSync(_0x471211)||!lstatSync(_0x471211)[_0x2b49cc(0x1f4)]())return undefined;if(bufferSha256(readFileSync(_0x471211))!==_0x19b851)return undefined;}return{'skill':_0x359e07,'scope':_0x432795,'dir':_0x2d6239,'skillMdPath':_0x43ee5f,'metadataPath':_0x40b645,'contentHash':_0x2e0aaf[_0x2b49cc(0x1ec)],'changed':![]};}function withMaterializedSkillFrontmatter(_0x14ec1b,_0x3b4d4a,_0x576543){const _0x9618c3=a157_0x31b7,_0x1a6570=skillDisplayName(_0x3b4d4a,_0x576543),_0x3a3b10=_0x3b4d4a[_0x9618c3(0x1e8)]?.[_0x9618c3(0x219)]()||_0x1a6570||_0x576543;return normalizeLocalFiles(_0x14ec1b)[_0x9618c3(0x20b)](_0x1184bc=>{const _0x18d9bb=_0x9618c3,_0x40d7dd=fileText(_0x1184bc);if(_0x1184bc[_0x18d9bb(0x202)]!==SKILL_FILE)return _0x1184bc;if(hasYamlFrontmatter(_0x40d7dd))return{'path':_0x1184bc[_0x18d9bb(0x202)],'content':withSyncedDisplayName(_0x40d7dd,_0x1a6570)};return{'path':_0x1184bc[_0x18d9bb(0x202)],'content':prependSkillFrontmatter(_0x40d7dd,{'name':_0x576543,'displayName':_0x1a6570,'description':_0x3a3b10})};});}function hasYamlFrontmatter(_0x1864d1){const _0xca089b=a157_0x31b7;return/^\uFEFF?---\s*\r?\n/[_0xca089b(0x20e)](_0x1864d1);}function prependSkillFrontmatter(_0x5e24c8,_0x44d66c){const _0x4be27c=a157_0x31b7,_0xeaf7a6=_0x5e24c8[_0x4be27c(0x1ea)](/^\uFEFF/,'');return['---',_0x4be27c(0x214)+yamlString(_0x44d66c[_0x4be27c(0x1e9)]),_0x44d66c[_0x4be27c(0x1ef)]?_0x4be27c(0x1eb)+yamlString(_0x44d66c[_0x4be27c(0x1ef)]):undefined,'description:\x20'+yamlString(_0x44d66c['description']),_0x4be27c(0x1f7),'',_0xeaf7a6][_0x4be27c(0x21b)](_0x572287=>_0x572287!==undefined)[_0x4be27c(0x1ff)]('\x0a');}function yamlString(_0x34589d){const _0x466e19=a157_0x31b7;return JSON['stringify'](_0x34589d['replace'](/\r/g,'')[_0x466e19(0x219)]());}function skillDisplayName(_0x2bf8f0,_0x5a1c05){const _0x2baca9=a157_0x31b7,_0x13af9d=_0x2bf8f0[_0x2baca9(0x207)]?.['trim']();return _0x13af9d||_0x5a1c05;}function withSyncedDisplayName(_0xb666f9,_0xddc29c){const _0xd4c821=a157_0x31b7,_0x5b84ea=_0xb666f9['match'](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x5b84ea)return _0xb666f9;const _0x54fe08=_0x5b84ea[0x1]??'',_0x273837=_0x5b84ea[0x2]??'',_0x30279f=parseDocument(_0x273837);if(_0x30279f[_0xd4c821(0x203)][_0xd4c821(0x212)]>0x0||!isMap(_0x30279f[_0xd4c821(0x21d)]))return _0xb666f9;if(_0xddc29c)_0x30279f['set']('displayName',_0xddc29c);else{if(_0x30279f[_0xd4c821(0x1fa)](_0xd4c821(0x1ef)))_0x30279f[_0xd4c821(0x205)]('displayName');else return _0xb666f9;}forceBlockCollections(_0x30279f[_0xd4c821(0x21d)]);const _0xe6ae9d=_0x30279f[_0xd4c821(0x213)]({'lineWidth':0x0})[_0xd4c821(0x21a)](),_0x380d6a=_0xb666f9[_0xd4c821(0x221)](_0x5b84ea[0x0]['length'])[_0xd4c821(0x1ea)](/^\r?\n/,'');return _0x54fe08+_0xd4c821(0x20a)+_0xe6ae9d+_0xd4c821(0x1f6)+_0x380d6a;}function forceBlockCollections(_0x312c04){if(!isNode(_0x312c04))return;visit(_0x312c04,(_0x306cf8,_0x57b830)=>{const _0x1cf2a9=a157_0x31b7;isCollection(_0x57b830)&&(_0x57b830[_0x1cf2a9(0x218)]=![]);});}function ensurePulledFilesCanBeOverwritten(_0x5da8b4,_0x8aa7e7,_0x2eeb6f,_0x5b2d5a){const _0x23fcc1=a157_0x31b7;if(_0x5b2d5a||!existsSync(_0x8aa7e7))return;const _0x9d5c92=readMetadataIfPresent(_0x8aa7e7);if(!_0x9d5c92)return;const _0x5649ae=_0x9d5c92['fileHashes']&&Object[_0x23fcc1(0x1f8)](_0x9d5c92[_0x23fcc1(0x206)])['length']>0x0?_0x9d5c92[_0x23fcc1(0x206)]:undefined;if(_0x5649ae)for(const [_0x47a7fd,_0x50bdf3]of Object['entries'](_0x5649ae)){const _0x2180c1=resolveManagedFilePath(_0x5da8b4,_0x47a7fd);if(!existsSync(_0x2180c1))throw CliErrors[_0x23fcc1(0x220)](_0x23fcc1(0x201)+_0x5da8b4,_0x23fcc1(0x204)+_0x47a7fd);const _0x1b17d4=lstatSync(_0x2180c1);if(!_0x1b17d4[_0x23fcc1(0x1f4)]())throw CliErrors[_0x23fcc1(0x220)](_0x23fcc1(0x201)+_0x5da8b4,'Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20'+_0x47a7fd);const _0x327033=bufferSha256(readFileSync(_0x2180c1));if(_0x327033!==_0x50bdf3)throw CliErrors[_0x23fcc1(0x220)](_0x23fcc1(0x201)+_0x5da8b4+'.\x20Changed\x20file:\x20'+_0x47a7fd,_0x23fcc1(0x1f2)+_0x47a7fd);}else{const _0x42a987=resolve(_0x5da8b4,SKILL_FILE);if(existsSync(_0x42a987)&&_0x9d5c92['contentHash']){const _0x4bd7d7=contentHash(readFileSync(_0x42a987,_0x23fcc1(0x1f9)));if(_0x4bd7d7!==_0x9d5c92[_0x23fcc1(0x1ec)])throw CliErrors[_0x23fcc1(0x220)]('Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20'+_0x42a987,'Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.');}}for(const _0x4a43ce of normalizeLocalFiles(_0x2eeb6f)){if(_0x5649ae?.[_0x4a43ce[_0x23fcc1(0x202)]])continue;if(!_0x5649ae&&_0x4a43ce[_0x23fcc1(0x202)]===SKILL_FILE)continue;const _0x52d476=resolveManagedFilePath(_0x5da8b4,_0x4a43ce[_0x23fcc1(0x202)]);if(!existsSync(_0x52d476))continue;const _0x3ff14f=lstatSync(_0x52d476);if(!_0x3ff14f['isFile']())throw CliErrors['validation'](_0x23fcc1(0x201)+_0x5da8b4,_0x23fcc1(0x209)+_0x4a43ce[_0x23fcc1(0x202)]);const _0x521e12=bufferSha256(readFileSync(_0x52d476));if(_0x521e12!==fileHash(_0x4a43ce))throw CliErrors[_0x23fcc1(0x220)](_0x23fcc1(0x201)+_0x5da8b4,'Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20'+_0x4a43ce[_0x23fcc1(0x202)]);}}function materializeFiles(_0x50d146,_0x5ae596){for(const _0x391fef of normalizeLocalFiles(_0x5ae596)){const _0x1a5151=resolveManagedFilePath(_0x50d146,_0x391fef['path']);mkdirSync(dirname(_0x1a5151),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x1a5151,fileContent(_0x391fef),0x180);}}function removeStaleManagedFiles(_0x2e1c8a,_0x27dabd,_0x331b20){const _0x6d4d67=a157_0x31b7;if(!_0x27dabd)return;const _0x4e3793=new Set(normalizeLocalFiles(_0x331b20)['map'](_0x4c8291=>_0x4c8291[_0x6d4d67(0x202)]));for(const _0x9ee4c5 of Object['keys'](_0x27dabd)){if(_0x4e3793[_0x6d4d67(0x1fa)](_0x9ee4c5))continue;const _0xfa04dc=resolveManagedFilePath(_0x2e1c8a,_0x9ee4c5);existsSync(_0xfa04dc)&&lstatSync(_0xfa04dc)['isFile']()&&rmSync(_0xfa04dc,{'force':!![]});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a158_0x17f2(){const _0x586171=['example','version','69526QKmLoZ','object','length','24JfXcVZ','tags','2112649fzBygF','Invalid\x20','71868LQeXWt','map','4KaIAfv','1186adRpyt','skillName','readonly','parse','forkedFromVersion','skillCode','trim','1305ZQSKLe','status','isArray','string','forkedFromSkillId','6gQkYIa','validation','toISOString','manifest','Runtime\x20Skill\x20is\x20missing\x20skillCode.','2998480XRNVwz','413685PMQLYE','description','1947nVmMnx','sourceSessionId','436715isABcy','zipSha256','files','path','zipSize','personal','tenantCode'];a158_0x17f2=function(){return _0x586171;};return a158_0x17f2();}(function(_0x41641e,_0x4e1210){const _0x38cdf3=a158_0x39f2,_0x29077f=_0x41641e();while(!![]){try{const _0x3c8a24=-parseInt(_0x38cdf3(0x11f))/0x1+-parseInt(_0x38cdf3(0x129))/0x2*(parseInt(_0x38cdf3(0x130))/0x3)+-parseInt(_0x38cdf3(0x128))/0x4*(parseInt(_0x38cdf3(0x13f))/0x5)+-parseInt(_0x38cdf3(0x135))/0x6*(parseInt(_0x38cdf3(0x124))/0x7)+-parseInt(_0x38cdf3(0x122))/0x8*(-parseInt(_0x38cdf3(0x13b))/0x9)+-parseInt(_0x38cdf3(0x13a))/0xa+parseInt(_0x38cdf3(0x13d))/0xb*(parseInt(_0x38cdf3(0x126))/0xc);if(_0x3c8a24===_0x4e1210)break;else _0x29077f['push'](_0x29077f['shift']());}catch(_0x592c95){_0x29077f['push'](_0x29077f['shift']());}}}(a158_0x17f2,0x2c4dd));import{existsSync,readFileSync}from'node:fs';import{CliErrors}from'../../errors.js';function a158_0x39f2(_0x1a390a,_0x597a2a){_0x1a390a=_0x1a390a-0x119;const _0x17f279=a158_0x17f2();let _0x39f218=_0x17f279[_0x1a390a];return _0x39f218;}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(_0x3f10cb,_0x13a713,_0x4a5f0c,_0x38e51d,_0x47ad64,_0xba0692,_0x1eed14){const _0x113109=a158_0x39f2,_0x461cf2=_0xba0692?normalizeLocalFiles(_0xba0692):[],_0x4772d4=!_0x1eed14&&_0x461cf2[_0x113109(0x121)]>0x0?buildSkillPackage(_0x461cf2):undefined,_0x263654=_0x1eed14?bufferSha256(_0x1eed14):_0x4772d4?.['manifest'][_0x113109(0x140)],_0x5299bd=_0x1eed14?.[_0x113109(0x121)]??_0x4772d4?.[_0x113109(0x138)][_0x113109(0x11a)],_0x1551fe=_0x461cf2[_0x113109(0x121)]>0x0?Object['fromEntries'](_0x461cf2[_0x113109(0x127)](_0x2a3314=>[_0x2a3314['path'],fileHash(_0x2a3314)])):undefined;return{'schemaVersion':_0x461cf2[_0x113109(0x121)]>0x0?0x2:0x1,'id':_0x3f10cb['id'],'appCode':_0x4a5f0c,'skillCode':requireSkillCode(_0x3f10cb),'skillName':_0x3f10cb[_0x113109(0x12a)],'description':_0x3f10cb[_0x113109(0x13c)],'example':_0x3f10cb[_0x113109(0x11d)],'scope':_0x13a713,'readonly':_0x13a713!==_0x113109(0x11b)||_0x3f10cb[_0x113109(0x12b)]===!![],'tenantCode':_0x3f10cb[_0x113109(0x11c)],'userId':_0x3f10cb['userId'],'version':_0x3f10cb[_0x113109(0x11e)],'status':_0x3f10cb[_0x113109(0x131)],'tags':Array[_0x113109(0x132)](_0x3f10cb[_0x113109(0x123)])?_0x3f10cb[_0x113109(0x123)]:[],'hasUpstreamUpdate':_0x3f10cb['hasUpstreamUpdate'],'forkedFromSkillId':_0x3f10cb[_0x113109(0x134)],'forkedFromVersion':_0x3f10cb[_0x113109(0x12d)],'sourceSessionId':_0x3f10cb[_0x113109(0x13e)],'contentHash':_0x38e51d,'fileHashes':_0x1551fe,'treeHash':_0x461cf2[_0x113109(0x121)]>0x0?fileTreeHash(localFilesToManifestFiles(_0x461cf2)):undefined,'ossPath':remoteManifestOssPath(_0x3f10cb[_0x113109(0x141)]),'zipSha256':_0x263654,'zipSize':_0x5299bd,'files':_0x461cf2['length']>0x0?_0x461cf2[_0x113109(0x127)](_0x2e12a3=>({'path':_0x2e12a3[_0x113109(0x119)],'hash':fileHash(_0x2e12a3),'size':fileContent(_0x2e12a3)[_0x113109(0x121)]})):undefined,'pulledAt':_0x47ad64??new Date()[_0x113109(0x137)]()};}export function requireSkillCode(_0x3f60e8){const _0x10d8ce=a158_0x39f2,_0x1ba616=_0x3f60e8[_0x10d8ce(0x12e)]?.[_0x10d8ce(0x12f)]();if(!_0x1ba616)throw CliErrors[_0x10d8ce(0x136)](_0x10d8ce(0x139));return _0x1ba616;}export function readMetadataIfPresent(_0x2bf87b){const _0x3ba7a7=a158_0x39f2;if(!existsSync(_0x2bf87b))return undefined;try{const _0x99a567=JSON[_0x3ba7a7(0x12c)](readFileSync(_0x2bf87b,'utf8'));return _0x99a567;}catch{throw CliErrors[_0x3ba7a7(0x136)](_0x3ba7a7(0x125)+METADATA_FILE+':\x20'+_0x2bf87b);}}function remoteManifestOssPath(_0xcf1b09){const _0x3c82f1=a158_0x39f2;if(!_0xcf1b09||typeof _0xcf1b09!==_0x3c82f1(0x120)||Array[_0x3c82f1(0x132)](_0xcf1b09))return undefined;const _0x455735=_0xcf1b09['ossPath'];return typeof _0x455735===_0x3c82f1(0x133)&&_0x455735[_0x3c82f1(0x12f)]()?_0x455735[_0x3c82f1(0x12f)]():undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x17de2a,_0x20a3a6){const _0x1d9993=a159_0x3c5e,_0x95026=_0x17de2a();while(!![]){try{const _0x453e89=-parseInt(_0x1d9993(0x1bd))/0x1*(-parseInt(_0x1d9993(0x1b8))/0x2)+parseInt(_0x1d9993(0x1c1))/0x3+parseInt(_0x1d9993(0x1cd))/0x4*(-parseInt(_0x1d9993(0x1c8))/0x5)+-parseInt(_0x1d9993(0x1c2))/0x6+parseInt(_0x1d9993(0x1b6))/0x7*(-parseInt(_0x1d9993(0x1c4))/0x8)+-parseInt(_0x1d9993(0x1c0))/0x9*(-parseInt(_0x1d9993(0x1b9))/0xa)+-parseInt(_0x1d9993(0x1bc))/0xb;if(_0x453e89===_0x20a3a6)break;else _0x95026['push'](_0x95026['shift']());}catch(_0x4a00f5){_0x95026['push'](_0x95026['shift']());}}}(a159_0x2c8f,0xb6f17));function a159_0x3c5e(_0x1b8fd3,_0x10ab6a){_0x1b8fd3=_0x1b8fd3-0x1b5;const _0x2c8f2e=a159_0x2c8f();let _0x3c5e83=_0x2c8f2e[_0x1b8fd3];return _0x3c5e83;}import{existsSync}from'node:fs';import{homedir}from'node:os';import{resolve}from'node:path';import{fingerprintAccessKey}from'../../commands/app/cache.js';import{PRODUCT_CONFIG,productEnv}from'../../constant/product.js';import{CliErrors}from'../../errors.js';export function resolveSkillSyncPaths(_0x34c979={}){const _0x3b705f=a159_0x3c5e,_0x3d252a=_0x34c979['homeDir']??homedir(),_0x4b5b3e=resolve(_0x3d252a,PRODUCT_CONFIG[_0x3b705f(0x1be)],_0x3b705f(0x1b7)),_0x42eab9=trimmedEnv(_0x3b705f(0x1c6)),_0x37e3c0=trimmedEnv('CLAUDE_SKILL_ROOT'),_0x1613ac=resolve(_0x3d252a,_0x3b705f(0x1ca)),_0x24ee24=_0x34c979[_0x3b705f(0x1bb)]??(existsSync(_0x1613ac)?resolve(_0x1613ac,_0x3b705f(0x1bf)):undefined);return{'homeDir':_0x3d252a,'cacheRoot':_0x4b5b3e,'managedRoot':resolve(_0x3d252a,PRODUCT_CONFIG[_0x3b705f(0x1be)]),'agentsSkillsDir':_0x34c979['agentsSkillsDir']??_0x42eab9??resolve(_0x3d252a,'.agents','skills'),'claudeSkillsDir':_0x34c979['claudeSkillsDir']??_0x37e3c0??resolve(_0x3d252a,'.claude','skills'),'workbuddySkillsDir':_0x24ee24};}export function runtimeAgentSkillRoots(_0x419fc2){const _0x308963=a159_0x3c5e;return[_0x419fc2[_0x308963(0x1b5)],_0x419fc2[_0x308963(0x1c3)],_0x419fc2[_0x308963(0x1bb)]][_0x308963(0x1cc)](_0x36dfd3=>Boolean(_0x36dfd3));}export function getRuntimeSkillCacheRoot(_0x22ba49,_0x1baa01,_0x2a542d={}){const _0x1bc010=a159_0x3c5e,_0xd6d7d=resolveSkillSyncPaths(_0x2a542d);return resolve(_0xd6d7d['cacheRoot'],_0x22ba49,fingerprintAccessKey(_0x1baa01),_0x1bc010(0x1bf));}function a159_0x2c8f(){const _0x28a597=['claudeSkillsDir','344lGmEMl','Unsafe\x20','SKILL_ROOT','trim','35SIwQWv','appCode','.workbuddy','includes','filter','390012ueEENS','agentsSkillsDir','12061ZHaaFy','cache','62402IXClIh','1800dfBRar','\x20for\x20local\x20path:\x20','workbuddySkillsDir','14058902xgVcjI','47LHQMYs','homeDirName','skills','30888yquXWN','3790275BoyUWW','3381630sEYjbV'];a159_0x2c8f=function(){return _0x28a597;};return a159_0x2c8f();}export function getRuntimeSkillDir(_0x224a90,_0x9a21e8,_0x28146f,_0x2bd54b,_0x229acf,_0x47452c={}){const _0x1d1cc2=a159_0x3c5e;return resolve(getRuntimeSkillCacheRoot(_0x224a90,_0x9a21e8,_0x47452c),safePathSegment(_0x28146f,_0x1d1cc2(0x1c9)),_0x2bd54b,safePathSegment(_0x229acf,'skillCode'));}export function safePathSegment(_0x2dd342,_0x36778d='path\x20segment'){const _0xc079d4=a159_0x3c5e;if(!_0x2dd342||_0x2dd342[_0xc079d4(0x1cb)]('/')||_0x2dd342[_0xc079d4(0x1cb)]('\x5c')||_0x2dd342['includes']('..'))throw CliErrors['validation'](_0xc079d4(0x1c5)+_0x36778d+_0xc079d4(0x1ba)+_0x2dd342);return _0x2dd342;}function trimmedEnv(_0x1b46df){const _0x4393f6=a159_0x3c5e,_0x51a4ba=productEnv(_0x1b46df)?.[_0x4393f6(0x1c7)]();return _0x51a4ba?_0x51a4ba:undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x21ecce,_0x1e50de){const _0x94d037=a159_0x40d4,_0x418a53=_0x21ecce();while(!![]){try{const _0x29a282=-parseInt(_0x94d037(0x73))/0x1+parseInt(_0x94d037(0x94))/0x2*(parseInt(_0x94d037(0x8a))/0x3)+-parseInt(_0x94d037(0x81))/0x4*(-parseInt(_0x94d037(0x7d))/0x5)+-parseInt(_0x94d037(0x8f))/0x6*(-parseInt(_0x94d037(0x8b))/0x7)+parseInt(_0x94d037(0x98))/0x8*(parseInt(_0x94d037(0x8e))/0x9)+parseInt(_0x94d037(0x89))/0xa*(parseInt(_0x94d037(0xab))/0xb)+-parseInt(_0x94d037(0x8d))/0xc;if(_0x29a282===_0x1e50de)break;else _0x418a53['push'](_0x418a53['shift']());}catch(_0x68e954){_0x418a53['push'](_0x418a53['shift']());}}}(a159_0x34cb,0x7108e));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a159_0x5cbc80}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{writeJsonAtomic}from'./fs-utils.js';import{contentHash}from'./hashing.js';import{fileText,normalizeLocalFiles,scanSkillDirectory}from'./local-files.js';import{buildMetadata,readMetadataIfPresent}from'./metadata.js';import{buildSkillPackage,tryNormalizePackageManifest}from'./zip-package.js';function a159_0x34cb(){const _0x35946b=['ignoreMetadataAppCodeMismatch','11121qgYJru','packageBase64','isArray','content','96886tzHAxx','builtin','length','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20','boolean','skillName','isDirectory','refreshedAt','slice','scope','1896205BPMblg','trim','unknown','isSymbolicLink','4bXbSBX','ignoreInvalidMetadata','ignoreMetadataSkillCode','personal','filter','pushedAt','appCode','sourceSessionId','3570YszxgR','389283YwKwBS','28ASYgSZ','displayName','22689432AzLstQ','8203941NIfaOa','1003776DuJzMv','\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22','\x20name\x20for\x20SkillHub\x20slug\x20generation.','metadata','company','2ZqHIEx','ignoreMetadataForPayload','Remote\x20Skill\x20',',\x20or\x20directory\x20name.','8iFOpBu','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20','number','tags','path','ignoreMetadataScope','utf8','string','example','validation','replace','description','manifest','Invalid\x20','isFile','files','skillCode','\x20has\x20unsupported\x20scope\x20\x22'];a159_0x34cb=function(){return _0x35946b;};return a159_0x34cb();}export function resolvePushDirectoryIdentity(_0x314ede,_0x1cba84,_0x12d75b={}){const _0x27cd76=a159_0x40d4,_0x5be13a=resolvePushDirectoryRoot(_0x314ede),_0x1ab982=readPushMetadataIfPresent(resolve(_0x5be13a,METADATA_FILE),{'ignoreInvalidMetadata':_0x12d75b[_0x27cd76(0x82)]});if(_0x1ab982?.[_0x27cd76(0x87)]&&_0x1ab982[_0x27cd76(0x87)]!==_0x1cba84&&!_0x12d75b['allowAppCodeRetarget']&&!_0x12d75b[_0x27cd76(0xaa)])throw CliErrors[_0x27cd76(0xa1)]('Skill\x20metadata\x20appCode\x20\x22'+_0x1ab982[_0x27cd76(0x87)]+_0x27cd76(0x90)+_0x1cba84+'\x22.');const _0xf841a3=resolvePushSkillCode(_0x5be13a,_0x1cba84,_0x1ab982,_0x12d75b);if(!_0xf841a3)throw CliErrors[_0x27cd76(0xa1)]('Unable\x20to\x20resolve\x20skillCode\x20from\x20'+SKILL_FILE+',\x20'+METADATA_FILE+_0x27cd76(0x97));return{'dir':_0x5be13a,'skillCode':_0xf841a3,'metadata':_0x1ab982};}export function readPushDirectory(_0x2c4b15,_0x4ad487,_0x71ba52={}){const _0x5e295b=a159_0x40d4,_0x18b596=resolvePushDirectoryIdentity(_0x2c4b15,_0x4ad487,_0x71ba52),_0x1ce6ce=_0x18b596['dir'],_0x16aed6=resolve(_0x1ce6ce,SKILL_FILE);if(!existsSync(_0x16aed6)||!lstatSync(_0x16aed6)['isFile']())throw CliErrors[_0x5e295b(0xa1)]('Missing\x20'+SKILL_FILE+':\x20'+_0x16aed6);const _0x4b9b0a=_0x18b596[_0x5e295b(0x92)],_0x527364=_0x71ba52['targetScope']??_0x5e295b(0x84);if(!_0x71ba52[_0x5e295b(0x9d)]&&_0x4b9b0a?.[_0x5e295b(0x7c)]===_0x5e295b(0x74))throw CliErrors[_0x5e295b(0xa1)]('Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20'+METADATA_FILE+'\x20has\x20scope=\x22'+_0x4b9b0a[_0x5e295b(0x7c)]+'\x22.');if(!_0x71ba52[_0x5e295b(0x9d)]&&_0x527364===_0x5e295b(0x84)&&_0x4b9b0a?.['scope']&&_0x4b9b0a[_0x5e295b(0x7c)]!=='personal')throw CliErrors['validation'](_0x5e295b(0x76)+METADATA_FILE+'\x20has\x20scope=\x22'+_0x4b9b0a['scope']+'\x22.',_0x5e295b(0x99)+_0x1ce6ce+'\x20to\x20submit\x20company\x20Skills\x20for\x20review.');const _0x2b8e68=scanSkillDirectory(_0x1ce6ce,{'excludedFilePaths':_0x71ba52['excludedFilePaths']}),_0x3a5a53=buildSkillPackage(_0x2b8e68),_0xd7180=readFileSync(_0x16aed6,_0x5e295b(0x9e)),_0xae66cc=_0x18b596[_0x5e295b(0xa8)],_0x1385d7=_0x71ba52[_0x5e295b(0x95)]?undefined:_0x4b9b0a,_0x170a73=readSkillDisplayName(_0xd7180);return{'skillCode':_0xae66cc,'metadata':_0x4b9b0a,'frontmatterDisplayName':_0x170a73,'input':{'skillCode':_0xae66cc,'skillName':_0x170a73??_0x1385d7?.[_0x5e295b(0x78)],'description':_0x1385d7?.['description'],'content':_0xd7180,'files':_0x3a5a53[_0x5e295b(0xa4)],'packageBase64':_0x3a5a53[_0x5e295b(0x70)],'tags':_0x1385d7?.[_0x5e295b(0x9b)],'version':_0x1385d7?.['version'],'sourceSessionId':_0x1385d7?.[_0x5e295b(0x88)]}};}export function refreshPushDirectoryMetadataFromRemote(_0x2f09f9,_0x4bcce8,_0x473b7b,_0x4409b6={}){const _0x30b2f8=a159_0x40d4,_0x10e911=resolvePushDirectoryRoot(_0x2f09f9),_0x5f33aa=readPushMetadataIfPresent(resolve(_0x10e911,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x244dcd=requireRemoteScope(_0x4bcce8),_0x178624=readLocalSkillContent(_0x10e911),_0x306ac9={..._0x4bcce8,'appCode':_0x4bcce8[_0x30b2f8(0x87)]??_0x473b7b,'skillName':_0x4bcce8[_0x30b2f8(0x78)]??_0x5f33aa?.[_0x30b2f8(0x78)],'description':_0x4bcce8['description']??_0x5f33aa?.[_0x30b2f8(0xa3)],'example':_0x4bcce8['example']??_0x5f33aa?.[_0x30b2f8(0xa0)],'tags':Array[_0x30b2f8(0x71)](_0x4bcce8[_0x30b2f8(0x9b)])?_0x4bcce8[_0x30b2f8(0x9b)]:_0x5f33aa?.[_0x30b2f8(0x9b)],'sourceSessionId':_0x4bcce8[_0x30b2f8(0x88)]??_0x5f33aa?.[_0x30b2f8(0x88)],'content':_0x4bcce8[_0x30b2f8(0x72)]??_0x178624},_0x49baea=buildMetadata(_0x306ac9,_0x244dcd,_0x473b7b,contentHash(_0x178624),_0x4409b6[_0x30b2f8(0x7a)]);writeJsonAtomic(resolve(_0x10e911,METADATA_FILE),_0x49baea);}function a159_0x40d4(_0x18e142,_0x301686){_0x18e142=_0x18e142-0x70;const _0x34cb93=a159_0x34cb();let _0x40d444=_0x34cb93[_0x18e142];return _0x40d444;}export function recordPushedRuntimeSkill(_0x2a9121,_0x51f075,_0x48135f,_0x5c233a={}){const _0x56d9d2=a159_0x40d4,_0x4fe9d7=resolvePushDirectoryRoot(_0x2a9121),_0x31731a=scanSkillDirectory(_0x4fe9d7),_0x3f3077=_0x31731a['find'](_0x16e1ac=>_0x16e1ac[_0x56d9d2(0x9c)]===SKILL_FILE),_0x59aec1=_0x3f3077?fileText(_0x3f3077):'',_0x5b1889=tryNormalizePackageManifest(_0x51f075[_0x56d9d2(0xa7)]),_0x2b84e6={..._0x51f075,'content':_0x51f075[_0x56d9d2(0x72)]??_0x59aec1,'files':_0x5b1889},_0x2be3bb=_0x5b1889?normalizeLocalFiles(_0x31731a)[_0x56d9d2(0x85)](_0x23e0ff=>_0x5b1889['files']['some'](_0x470cde=>_0x470cde[_0x56d9d2(0x9c)]===_0x23e0ff['path'])):undefined,_0x489579=buildMetadata(_0x2b84e6,_0x5c233a[_0x56d9d2(0x7c)]??_0x56d9d2(0x84),_0x48135f,contentHash(_0x2b84e6[_0x56d9d2(0x72)]??''),_0x5c233a[_0x56d9d2(0x86)],_0x2be3bb);writeJsonAtomic(resolve(_0x4fe9d7,METADATA_FILE),_0x489579);}export function deriveSkillCodeFromDirectory(_0x36a778,_0x54f9e9){const _0x4b77a8=a159_0x40d4,_0x4f320c=basename(resolve(_0x36a778)),_0x2bf3c6=_0x54f9e9+'--';return _0x4f320c['startsWith'](_0x2bf3c6)?_0x4f320c[_0x4b77a8(0x7b)](_0x2bf3c6[_0x4b77a8(0x75)]):_0x4f320c;}function resolvePushSkillCode(_0x3880c6,_0x305b1a,_0x2abb4f,_0x3a29bb){const _0x5dba7b=a159_0x40d4,_0x1f06b8=deriveSkillCodeFromSkillFile(_0x3880c6)||deriveSkillCodeFromDirectory(_0x3880c6,_0x305b1a);if(_0x3a29bb[_0x5dba7b(0x83)])return _0x1f06b8;return _0x2abb4f?.[_0x5dba7b(0xa8)]?.[_0x5dba7b(0x7e)]()||_0x1f06b8;}function deriveSkillCodeFromSkillFile(_0x13aad2){const _0x332017=a159_0x40d4,_0x4c4e2b=resolve(_0x13aad2,SKILL_FILE);if(!existsSync(_0x4c4e2b)||!lstatSync(_0x4c4e2b)[_0x332017(0xa6)]())return undefined;const _0x154e6c=readFileSync(_0x4c4e2b,'utf8'),_0xa9136d=_0x154e6c['match'](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0xa9136d)return undefined;const _0x418d29=parseFrontmatterObject(_0xa9136d[0x1]??''),_0x4cf779=scalarToString(_0x418d29?.['name']);return _0x4cf779?slugifySkillName(_0x4cf779):undefined;}function readSkillDisplayName(_0x27db66){const _0x4fce13=a159_0x40d4,_0x9fb183=_0x27db66['match'](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x9fb183)return undefined;const _0x550b6c=parseFrontmatterObject(_0x9fb183[0x1]??'');return scalarToString(_0x550b6c?.[_0x4fce13(0x8c)]);}function slugifySkillName(_0x3a4b28){const _0x30d2f2=a159_0x40d4,_0x1e56f8=_0x3a4b28[_0x30d2f2(0x7e)]()['toLowerCase']()[_0x30d2f2(0xa2)](/[^\p{L}\p{N}\p{So}]+/gu,'-')['replace'](/^-+/,'')[_0x30d2f2(0xa2)](/-+$/,'')[_0x30d2f2(0xa2)](/-{2,}/g,'-');if(!_0x1e56f8)throw CliErrors[_0x30d2f2(0xa1)](_0x30d2f2(0xa5)+SKILL_FILE+_0x30d2f2(0x91));return _0x1e56f8;}function parseFrontmatterObject(_0x4f4701){try{const _0x2386d4=a159_0x5cbc80(_0x4f4701);return _0x2386d4&&typeof _0x2386d4==='object'&&!Array['isArray'](_0x2386d4)?_0x2386d4:undefined;}catch{return undefined;}}function scalarToString(_0x25ab92){const _0x195ee1=a159_0x40d4;if(typeof _0x25ab92===_0x195ee1(0x9f))return _0x25ab92[_0x195ee1(0x7e)]();if(typeof _0x25ab92===_0x195ee1(0x9a)||typeof _0x25ab92===_0x195ee1(0x77))return String(_0x25ab92);return undefined;}function resolvePushDirectoryRoot(_0x5a140d){const _0x396523=a159_0x40d4,_0x2ffded=resolve(_0x5a140d);if(!existsSync(_0x2ffded))throw CliErrors[_0x396523(0xa1)]('Skill\x20directory\x20not\x20found:\x20'+_0x5a140d);const _0x4ed2b3=lstatSync(_0x2ffded);if(_0x4ed2b3[_0x396523(0x79)]())return _0x2ffded;if(_0x4ed2b3[_0x396523(0x80)]()){const _0x531853=realpathSync(_0x2ffded);if(lstatSync(_0x531853)['isDirectory']())return _0x531853;}throw CliErrors[_0x396523(0xa1)]('Skill\x20directory\x20not\x20found:\x20'+_0x5a140d);}function requireRemoteScope(_0x1426f5){const _0x4b7d47=a159_0x40d4;if(_0x1426f5[_0x4b7d47(0x7c)]===_0x4b7d47(0x84)||_0x1426f5['scope']===_0x4b7d47(0x93)||_0x1426f5[_0x4b7d47(0x7c)]===_0x4b7d47(0x74))return _0x1426f5[_0x4b7d47(0x7c)];throw CliErrors['validation'](_0x4b7d47(0x96)+(_0x1426f5['skillCode']||'(unknown)')+_0x4b7d47(0xa9)+(_0x1426f5[_0x4b7d47(0x7c)]??_0x4b7d47(0x7f))+'\x22.');}function readLocalSkillContent(_0x4439e9){const _0x243cb5=a159_0x40d4,_0x5d429e=resolve(_0x4439e9,SKILL_FILE);return existsSync(_0x5d429e)&&lstatSync(_0x5d429e)[_0x243cb5(0xa6)]()?readFileSync(_0x5d429e,_0x243cb5(0x9e)):'';}function readPushMetadataIfPresent(_0x182301,_0xf34e5a={}){const _0x5c5479=a159_0x40d4;try{return readMetadataIfPresent(_0x182301);}catch(_0x113529){if(_0xf34e5a[_0x5c5479(0x82)])return undefined;throw _0x113529;}}
|
|
1
|
+
(function(_0x2b65fc,_0x4da59d){const _0xb5406e=a160_0x2207,_0x3081dd=_0x2b65fc();while(!![]){try{const _0x1f67c5=-parseInt(_0xb5406e(0x166))/0x1+parseInt(_0xb5406e(0x156))/0x2+-parseInt(_0xb5406e(0x169))/0x3*(parseInt(_0xb5406e(0x152))/0x4)+-parseInt(_0xb5406e(0x14a))/0x5*(-parseInt(_0xb5406e(0x170))/0x6)+parseInt(_0xb5406e(0x14b))/0x7+parseInt(_0xb5406e(0x14c))/0x8*(-parseInt(_0xb5406e(0x153))/0x9)+parseInt(_0xb5406e(0x144))/0xa;if(_0x1f67c5===_0x4da59d)break;else _0x3081dd['push'](_0x3081dd['shift']());}catch(_0x6ab1cd){_0x3081dd['push'](_0x3081dd['shift']());}}}(a160_0x36c5,0xc73e7));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a160_0x50084b}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(_0xd4078f,_0x32d64e,_0x59bd61={}){const _0x1111b0=a160_0x2207,_0x4e4865=resolvePushDirectoryRoot(_0xd4078f),_0x123798=readPushMetadataIfPresent(resolve(_0x4e4865,METADATA_FILE),{'ignoreInvalidMetadata':_0x59bd61[_0x1111b0(0x150)]});if(_0x123798?.[_0x1111b0(0x165)]&&_0x123798['appCode']!==_0x32d64e&&!_0x59bd61['allowAppCodeRetarget']&&!_0x59bd61['ignoreMetadataAppCodeMismatch'])throw CliErrors[_0x1111b0(0x172)](_0x1111b0(0x155)+_0x123798[_0x1111b0(0x165)]+'\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22'+_0x32d64e+'\x22.');const _0x3a3a2b=resolvePushSkillCode(_0x4e4865,_0x32d64e,_0x123798,_0x59bd61);if(!_0x3a3a2b)throw CliErrors[_0x1111b0(0x172)](_0x1111b0(0x141)+SKILL_FILE+',\x20'+METADATA_FILE+_0x1111b0(0x161));return{'dir':_0x4e4865,'skillCode':_0x3a3a2b,'metadata':_0x123798};}export function readPushDirectory(_0x9fb146,_0xb9ded0,_0x5287a4={}){const _0x3a745f=a160_0x2207,_0x226b70=resolvePushDirectoryIdentity(_0x9fb146,_0xb9ded0,_0x5287a4),_0x57deee=_0x226b70[_0x3a745f(0x168)],_0x3b0542=resolve(_0x57deee,SKILL_FILE);if(!existsSync(_0x3b0542)||!lstatSync(_0x3b0542)[_0x3a745f(0x16f)]())throw CliErrors[_0x3a745f(0x172)](_0x3a745f(0x171)+SKILL_FILE+':\x20'+_0x3b0542);const _0x5191c8=_0x226b70['metadata'],_0xd95abf=_0x5287a4[_0x3a745f(0x148)]??_0x3a745f(0x15e);if(!_0x5287a4['ignoreMetadataScope']&&_0x5191c8?.[_0x3a745f(0x163)]===_0x3a745f(0x16b))throw CliErrors[_0x3a745f(0x172)](_0x3a745f(0x158)+METADATA_FILE+_0x3a745f(0x15d)+_0x5191c8['scope']+'\x22.');if(!_0x5287a4[_0x3a745f(0x136)]&&_0xd95abf==='personal'&&_0x5191c8?.['scope']&&_0x5191c8[_0x3a745f(0x163)]!==_0x3a745f(0x15e))throw CliErrors['validation']('Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20'+METADATA_FILE+_0x3a745f(0x15d)+_0x5191c8[_0x3a745f(0x163)]+'\x22.',_0x3a745f(0x142)+_0x57deee+'\x20to\x20submit\x20company\x20Skills\x20for\x20review.');const _0x4526b4=scanSkillDirectory(_0x57deee,{'excludedFilePaths':_0x5287a4[_0x3a745f(0x162)]}),_0x5638f2=buildSkillPackage(_0x4526b4),_0x15fd8f=readFileSync(_0x3b0542,_0x3a745f(0x151)),_0x1f9f3b=_0x226b70[_0x3a745f(0x15c)],_0x1d189d=_0x5287a4[_0x3a745f(0x13f)]?undefined:_0x5191c8,_0xc2e18d=readSkillDisplayName(_0x15fd8f);return{'skillCode':_0x1f9f3b,'metadata':_0x5191c8,'frontmatterDisplayName':_0xc2e18d,'input':{'skillCode':_0x1f9f3b,'skillName':_0xc2e18d??_0x1d189d?.[_0x3a745f(0x16a)],'description':_0x1d189d?.['description'],'content':_0x15fd8f,'files':_0x5638f2['manifest'],'packageBase64':_0x5638f2[_0x3a745f(0x147)],'tags':_0x1d189d?.[_0x3a745f(0x15f)],'version':_0x1d189d?.[_0x3a745f(0x13a)],'sourceSessionId':_0x1d189d?.[_0x3a745f(0x14e)]}};}export function refreshPushDirectoryMetadataFromRemote(_0x2c5f0e,_0x5a4de0,_0x479ad9,_0x58210e={}){const _0x1a42b6=a160_0x2207,_0x5236ef=resolvePushDirectoryRoot(_0x2c5f0e),_0x457333=readPushMetadataIfPresent(resolve(_0x5236ef,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x4f3461=requireRemoteScope(_0x5a4de0),_0x139c1b=readLocalSkillContent(_0x5236ef),_0x5d9c1d={..._0x5a4de0,'appCode':_0x5a4de0[_0x1a42b6(0x165)]??_0x479ad9,'skillName':_0x5a4de0['skillName']??_0x457333?.['skillName'],'description':_0x5a4de0[_0x1a42b6(0x139)]??_0x457333?.[_0x1a42b6(0x139)],'example':_0x5a4de0['example']??_0x457333?.['example'],'tags':Array[_0x1a42b6(0x140)](_0x5a4de0[_0x1a42b6(0x15f)])?_0x5a4de0['tags']:_0x457333?.[_0x1a42b6(0x15f)],'sourceSessionId':_0x5a4de0[_0x1a42b6(0x14e)]??_0x457333?.[_0x1a42b6(0x14e)],'content':_0x5a4de0['content']??_0x139c1b},_0x887585=buildMetadata(_0x5d9c1d,_0x4f3461,_0x479ad9,contentHash(_0x139c1b),_0x58210e[_0x1a42b6(0x13e)]);writeJsonAtomic(resolve(_0x5236ef,METADATA_FILE),_0x887585);}export function recordPushedRuntimeSkill(_0xf33c6e,_0x20b91b,_0x45e275,_0x31269d={}){const _0x14e5af=a160_0x2207,_0x125d4a=resolvePushDirectoryRoot(_0xf33c6e),_0x10a766=scanSkillDirectory(_0x125d4a),_0x734190=_0x10a766[_0x14e5af(0x16c)](_0x11ac57=>_0x11ac57[_0x14e5af(0x173)]===SKILL_FILE),_0x3678dd=_0x734190?fileText(_0x734190):'',_0x5b16a2=tryNormalizePackageManifest(_0x20b91b[_0x14e5af(0x14f)]),_0x41a13f={..._0x20b91b,'content':_0x20b91b[_0x14e5af(0x16e)]??_0x3678dd,'files':_0x5b16a2},_0xd658d=_0x5b16a2?normalizeLocalFiles(_0x10a766)[_0x14e5af(0x137)](_0xae6e02=>_0x5b16a2[_0x14e5af(0x14f)]['some'](_0x267cac=>_0x267cac[_0x14e5af(0x173)]===_0xae6e02[_0x14e5af(0x173)])):undefined,_0x9cd1d=buildMetadata(_0x41a13f,_0x31269d['scope']??'personal',_0x45e275,contentHash(_0x41a13f[_0x14e5af(0x16e)]??''),_0x31269d[_0x14e5af(0x159)],_0xd658d);writeJsonAtomic(resolve(_0x125d4a,METADATA_FILE),_0x9cd1d);}function a160_0x2207(_0x184acf,_0x404e0c){_0x184acf=_0x184acf-0x136;const _0x36c532=a160_0x36c5();let _0x2207cf=_0x36c532[_0x184acf];return _0x2207cf;}function a160_0x36c5(){const _0x2a5906=['targetScope','ignoreMetadataSkillCode','5YlHyMB','10005611zLYKmZ','1492696NRytlR','isDirectory','sourceSessionId','files','ignoreInvalidMetadata','utf8','1553452yBPaQj','54EFvVmc','match','Skill\x20metadata\x20appCode\x20\x22','1822256hixtfk','name','Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20','pushedAt','string','startsWith','skillCode','\x20has\x20scope=\x22','personal','tags','(unknown)',',\x20or\x20directory\x20name.','excludedFilePaths','scope','slice','appCode','1408400WHpiVW','number','dir','9YdwJDw','skillName','builtin','find','\x20has\x20unsupported\x20scope\x20\x22','content','isFile','8007966GYkSVL','Missing\x20','validation','path','boolean','replace','ignoreMetadataScope','filter','toLowerCase','description','version','Remote\x20Skill\x20','unknown','displayName','refreshedAt','ignoreMetadataForPayload','isArray','Unable\x20to\x20resolve\x20skillCode\x20from\x20','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20','Skill\x20directory\x20not\x20found:\x20','8339520gVZMbz','trim','object','packageBase64'];a160_0x36c5=function(){return _0x2a5906;};return a160_0x36c5();}export function deriveSkillCodeFromDirectory(_0x4b3d68,_0x38745f){const _0x3c9b01=a160_0x2207,_0xf71cb8=basename(resolve(_0x4b3d68)),_0x29c074=_0x38745f+'--';return _0xf71cb8[_0x3c9b01(0x15b)](_0x29c074)?_0xf71cb8[_0x3c9b01(0x164)](_0x29c074['length']):_0xf71cb8;}function resolvePushSkillCode(_0x38649c,_0x4c1a3b,_0x519240,_0x3295f1){const _0x43f6de=a160_0x2207,_0x4a5f7b=deriveSkillCodeFromSkillFile(_0x38649c)||deriveSkillCodeFromDirectory(_0x38649c,_0x4c1a3b);if(_0x3295f1[_0x43f6de(0x149)])return _0x4a5f7b;return _0x519240?.[_0x43f6de(0x15c)]?.['trim']()||_0x4a5f7b;}function deriveSkillCodeFromSkillFile(_0x156683){const _0x4b803f=a160_0x2207,_0x23f909=resolve(_0x156683,SKILL_FILE);if(!existsSync(_0x23f909)||!lstatSync(_0x23f909)[_0x4b803f(0x16f)]())return undefined;const _0x2933fd=readFileSync(_0x23f909,_0x4b803f(0x151)),_0x40d5a7=_0x2933fd[_0x4b803f(0x154)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x40d5a7)return undefined;const _0x556fc8=parseFrontmatterObject(_0x40d5a7[0x1]??''),_0x36b8a8=scalarToString(_0x556fc8?.[_0x4b803f(0x157)]);return _0x36b8a8?slugifySkillName(_0x36b8a8):undefined;}function readSkillDisplayName(_0x26cd57){const _0x4316a2=a160_0x2207,_0x2c6b28=_0x26cd57['match'](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x2c6b28)return undefined;const _0x7cdb54=parseFrontmatterObject(_0x2c6b28[0x1]??'');return scalarToString(_0x7cdb54?.[_0x4316a2(0x13d)]);}function slugifySkillName(_0x1a1525){const _0x4d3b79=a160_0x2207,_0x2d72cf=_0x1a1525['trim']()[_0x4d3b79(0x138)]()[_0x4d3b79(0x175)](/[^\p{L}\p{N}\p{So}]+/gu,'-')[_0x4d3b79(0x175)](/^-+/,'')[_0x4d3b79(0x175)](/-+$/,'')['replace'](/-{2,}/g,'-');if(!_0x2d72cf)throw CliErrors[_0x4d3b79(0x172)]('Invalid\x20'+SKILL_FILE+'\x20name\x20for\x20SkillHub\x20slug\x20generation.');return _0x2d72cf;}function parseFrontmatterObject(_0x3e1478){const _0x40d436=a160_0x2207;try{const _0x4079f7=a160_0x50084b(_0x3e1478);return _0x4079f7&&typeof _0x4079f7===_0x40d436(0x146)&&!Array[_0x40d436(0x140)](_0x4079f7)?_0x4079f7:undefined;}catch{return undefined;}}function scalarToString(_0xa7b9dc){const _0x6e84c5=a160_0x2207;if(typeof _0xa7b9dc===_0x6e84c5(0x15a))return _0xa7b9dc[_0x6e84c5(0x145)]();if(typeof _0xa7b9dc===_0x6e84c5(0x167)||typeof _0xa7b9dc===_0x6e84c5(0x174))return String(_0xa7b9dc);return undefined;}function resolvePushDirectoryRoot(_0x3acad0){const _0xaeebec=a160_0x2207,_0x8b000=resolve(_0x3acad0);if(!existsSync(_0x8b000))throw CliErrors[_0xaeebec(0x172)]('Skill\x20directory\x20not\x20found:\x20'+_0x3acad0);const _0x3b7920=lstatSync(_0x8b000);if(_0x3b7920[_0xaeebec(0x14d)]())return _0x8b000;if(_0x3b7920['isSymbolicLink']()){const _0x6b0245=realpathSync(_0x8b000);if(lstatSync(_0x6b0245)[_0xaeebec(0x14d)]())return _0x6b0245;}throw CliErrors[_0xaeebec(0x172)](_0xaeebec(0x143)+_0x3acad0);}function requireRemoteScope(_0xa08b16){const _0x175be8=a160_0x2207;if(_0xa08b16[_0x175be8(0x163)]==='personal'||_0xa08b16[_0x175be8(0x163)]==='company'||_0xa08b16['scope']==='builtin')return _0xa08b16['scope'];throw CliErrors[_0x175be8(0x172)](_0x175be8(0x13b)+(_0xa08b16['skillCode']||_0x175be8(0x160))+_0x175be8(0x16d)+(_0xa08b16[_0x175be8(0x163)]??_0x175be8(0x13c))+'\x22.');}function readLocalSkillContent(_0x642e31){const _0x271584=resolve(_0x642e31,SKILL_FILE);return existsSync(_0x271584)&&lstatSync(_0x271584)['isFile']()?readFileSync(_0x271584,'utf8'):'';}function readPushMetadataIfPresent(_0x189bfa,_0x33b490={}){const _0x38dbde=a160_0x2207;try{return readMetadataIfPresent(_0x189bfa);}catch(_0x38420a){if(_0x33b490[_0x38dbde(0x150)])return undefined;throw _0x38420a;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x5d2037,_0x1cbe95){const _0x41821c=a161_0x515e,_0x330827=_0x5d2037();while(!![]){try{const _0x5766f8=-parseInt(_0x41821c(0x105))/0x1*(-parseInt(_0x41821c(0xfd))/0x2)+parseInt(_0x41821c(0xfb))/0x3+-parseInt(_0x41821c(0x106))/0x4+-parseInt(_0x41821c(0x101))/0x5*(-parseInt(_0x41821c(0x104))/0x6)+parseInt(_0x41821c(0x100))/0x7*(parseInt(_0x41821c(0x103))/0x8)+-parseInt(_0x41821c(0xfa))/0x9+-parseInt(_0x41821c(0xf9))/0xa*(-parseInt(_0x41821c(0xfc))/0xb);if(_0x5766f8===_0x1cbe95)break;else _0x330827['push'](_0x330827['shift']());}catch(_0x11e6d8){_0x330827['push'](_0x330827['shift']());}}}(a161_0x30a4,0x5cbc1));function a161_0x515e(_0xe147e8,_0x91a71c){_0xe147e8=_0xe147e8-0xf8;const _0x30a480=a161_0x30a4();let _0x515eb8=_0x30a480[_0xe147e8];return _0x515eb8;}import{CliErrors}from'../../errors.js';export function normalizeRuntimeSkillScopes(_0xf4bdbf){const _0x1b1f23=a161_0x515e,_0x3b5030=_0xf4bdbf&&_0xf4bdbf['length']>0x0?_0xf4bdbf:['personal',_0x1b1f23(0xff),'builtin'],_0x519a92=[];for(const _0x1fabee of _0x3b5030){if(!isRuntimeSkillScope(_0x1fabee))throw CliErrors[_0x1b1f23(0xfe)](_0x1b1f23(0x107)+_0x1fabee);!_0x519a92['includes'](_0x1fabee)&&_0x519a92[_0x1b1f23(0x108)](_0x1fabee);}return _0x519a92;}export function isRuntimeSkillScope(_0x3de40a){const _0x4f5832=a161_0x515e;return _0x3de40a===_0x4f5832(0x102)||_0x3de40a==='company'||_0x3de40a===_0x4f5832(0xf8);}function a161_0x30a4(){const _0x6702e0=['29380crpqBH','personal','6472xLFKfi','270BRYROz','1dkuOdq','1912548FzHkMS','Unsupported\x20runtime\x20Skill\x20scope:\x20','push','builtin','427610HgGmno','6759045YJZbed','434388lvjoxw','11huDeHW','1150670TVKxOq','validation','company','5033JvTppw'];a161_0x30a4=function(){return _0x6702e0;};return a161_0x30a4();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
const a163_0x4821e1=a163_0x47b9;(function(_0x48b392,_0x4410c9){const _0x187509=a163_0x47b9,_0x189882=_0x48b392();while(!![]){try{const _0x502bc2=parseInt(_0x187509(0x1b5))/0x1+-parseInt(_0x187509(0x1ae))/0x2*(-parseInt(_0x187509(0x1b6))/0x3)+-parseInt(_0x187509(0x1c2))/0x4+-parseInt(_0x187509(0x1b8))/0x5*(parseInt(_0x187509(0x1b1))/0x6)+-parseInt(_0x187509(0x1b0))/0x7+parseInt(_0x187509(0x1af))/0x8*(-parseInt(_0x187509(0x1bb))/0x9)+parseInt(_0x187509(0x1c0))/0xa;if(_0x502bc2===_0x4410c9)break;else _0x189882['push'](_0x189882['shift']());}catch(_0x364417){_0x189882['push'](_0x189882['shift']());}}}(a163_0xa2b1,0x692b9));import{unzipSync,zipSync}from'fflate';import{CliErrors}from'../../errors.js';import{compareSkillFiles,fileContent,normalizeLocalFiles,normalizeSkillRelativePath}from'./local-files.js';const ZIP_MTIME=new Date(a163_0x4821e1(0x1bf));export function createDeterministicZipPackage(_0x49109c){const _0x5dcbc3=a163_0x4821e1,_0x2f9405={};for(const _0x5e0390 of normalizeLocalFiles(_0x49109c)){_0x2f9405[_0x5e0390[_0x5dcbc3(0x1b4)]]=fileContent(_0x5e0390);}return Buffer[_0x5dcbc3(0x1c3)](zipSync(_0x2f9405,{'level':0x0,'mtime':ZIP_MTIME}));}export function parseZipPackage(_0x28d55b){const _0x2cb6a5=a163_0x4821e1;if(_0x28d55b[_0x2cb6a5(0x1b7)]<0x16)throw CliErrors['validation']('Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.');let _0x143976;try{_0x143976=unzipSync(_0x28d55b,{'filter'(_0x3a3471){const _0x2b0721=_0x2cb6a5,_0x388c7d=normalizeSkillRelativePath(_0x3a3471[_0x2b0721(0x1b2)]);if(_0x388c7d['endsWith']('/'))throw CliErrors[_0x2b0721(0x1be)](_0x2b0721(0x1c1)+_0x388c7d);return!![];}});}catch(_0x50b260){if(isRuntimeSkillValidationError(_0x50b260))throw _0x50b260;throw CliErrors[_0x2cb6a5(0x1be)]('Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.');}return Object[_0x2cb6a5(0x1b9)](_0x143976)[_0x2cb6a5(0x1bc)](([_0x15f03c,_0x54e31b])=>({'path':normalizeSkillRelativePath(_0x15f03c),'bytes':Buffer['from'](_0x54e31b)}))[_0x2cb6a5(0x1b3)](compareSkillFiles);}function a163_0x47b9(_0x19874b,_0x21a8a7){_0x19874b=_0x19874b-0x1ae;const _0xa2b195=a163_0xa2b1();let _0x47b926=_0xa2b195[_0x19874b];return _0x47b926;}function a163_0xa2b1(){const _0x5cf6c3=['code','32571ZqoHNB','map','validation_error','validation','1980-01-01T00:00:00.000Z','3013890GbFuXa','Runtime\x20Skill\x20package\x20contains\x20directory\x20entry:\x20','1251164VIVppF','from','object','724PGVSdk','520Ichguy','403235mEhlUm','17862emsigI','name','sort','path','488631QIPynQ','2634KfyPmu','length','120qvEgOs','entries'];a163_0xa2b1=function(){return _0x5cf6c3;};return a163_0xa2b1();}function isRuntimeSkillValidationError(_0x410b13){const _0x4ac99a=a163_0x4821e1;return typeof _0x410b13===_0x4ac99a(0x1c4)&&_0x410b13!==null&&_0x4ac99a(0x1ba)in _0x410b13&&_0x410b13['code']===_0x4ac99a(0x1bd);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x526e68,_0x1f9512){const _0x3ba879=a164_0x9fec,_0x523ac8=_0x526e68();while(!![]){try{const _0x286909=-parseInt(_0x3ba879(0x18e))/0x1*(-parseInt(_0x3ba879(0x185))/0x2)+-parseInt(_0x3ba879(0x17d))/0x3*(parseInt(_0x3ba879(0x188))/0x4)+-parseInt(_0x3ba879(0x199))/0x5*(-parseInt(_0x3ba879(0x176))/0x6)+-parseInt(_0x3ba879(0x19b))/0x7+parseInt(_0x3ba879(0x19a))/0x8*(-parseInt(_0x3ba879(0x18b))/0x9)+parseInt(_0x3ba879(0x197))/0xa+-parseInt(_0x3ba879(0x191))/0xb*(-parseInt(_0x3ba879(0x19c))/0xc);if(_0x286909===_0x1f9512)break;else _0x523ac8['push'](_0x523ac8['shift']());}catch(_0x2f7428){_0x523ac8['push'](_0x523ac8['shift']());}}}(a164_0x18d8,0x199ea));import{CliErrors}from'../../errors.js';import{SKILL_FILE}from'./constants.js';function a164_0x9fec(_0x5e94dd,_0x55a7ec){_0x5e94dd=_0x5e94dd-0x16d;const _0x18d80d=a164_0x18d8();let _0x9fec06=_0x18d80d[_0x5e94dd];return _0x9fec06;}import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';import{fileContent,isSha256Hex,normalizeLocalFiles,normalizeManifestFiles}from'./local-files.js';function a164_0x18d8(){const _0x2c8446=['63769gXyKLc','push','Missing\x20','220fFSgzF','Runtime\x20Skill\x20file\x20tree\x20sha256\x20is\x20invalid.','Runtime\x20Skill\x20package\x20file\x20size\x20mismatch:\x20','Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.','Runtime\x20Skill\x20package\x20sha256\x20is\x20invalid.','Runtime\x20Skill\x20manifest\x20is\x20missing\x20','597650MUFAsN','files','35oWOzYK','1362776UsLFXd','1279880QsQXAx','180672LRxlCn','zipSize','map','treeSha256','validation','Runtime\x20Skill\x20package\x20size\x20mismatch.','sha256','ossPath','isSafeInteger','schemaVersion','Runtime\x20Skill\x20file\x20tree\x20sha256\x20mismatch.','70674NMEqlX','Runtime\x20Skill\x20package\x20is\x20missing\x20entry:\x20','Runtime\x20Skill\x20package\x20entry\x20list\x20mismatch.','size','Runtime\x20Skill\x20package\x20is\x20missing\x20','some','Runtime\x20Skill\x20package\x20file\x20sha256\x20mismatch:\x20','24NUVlgU','\x20in\x20Skill\x20file\x20package.','string','isArray','base64','Runtime\x20Skill\x20package\x20size\x20is\x20invalid.','zipSha256','bytes','6hEYelt','has','path','88260asvsBh','Runtime\x20Skill\x20package\x20sha256\x20mismatch.','length','9YLaXaK','toLowerCase','object'];a164_0x18d8=function(){return _0x2c8446;};return a164_0x18d8();}import{createDeterministicZipPackage,parseZipPackage}from'./zip-codec.js';export function buildSkillPackage(_0x522003){const _0x3e783f=a164_0x9fec,_0x56906b=normalizeLocalFiles(_0x522003);if(!_0x56906b[_0x3e783f(0x17b)](_0x3af88f=>_0x3af88f[_0x3e783f(0x187)]===SKILL_FILE))throw CliErrors['validation'](_0x3e783f(0x190)+SKILL_FILE+_0x3e783f(0x17e));const _0x518b19=localFilesToManifestFiles(_0x56906b),_0x110b59=createDeterministicZipPackage(_0x56906b);return{'manifest':{'schemaVersion':0x2,'treeSha256':fileTreeHash(_0x518b19),'zipSha256':bufferSha256(_0x110b59),'zipSize':_0x110b59[_0x3e783f(0x18a)],'files':_0x518b19},'packageBytes':_0x110b59,'packageBase64':_0x110b59['toString'](_0x3e783f(0x181))};}export function verifyRuntimeSkillPackage(_0xc33501,_0x42ec07){const _0x3af120=a164_0x9fec,_0xa112b9=normalizePackageManifest(_0xc33501,{'requireOssPath':![]});if(!_0xa112b9)throw CliErrors['validation'](_0x3af120(0x194));return extractAndVerifyPackage(_0xa112b9,_0x42ec07);}export function verifyRuntimeSkillBundle(_0x59dd0e,_0x1b4488){const _0x3811aa=a164_0x9fec,_0x4e5d1f=normalizePackageManifest(_0x59dd0e,{'requireOssPath':![]});if(!_0x4e5d1f)throw CliErrors[_0x3811aa(0x16f)](_0x3811aa(0x194));return extractAndVerifyPackageFiles(_0x4e5d1f,_0x1b4488);}export function tryNormalizePackageManifest(_0x4d32cd){return normalizePackageManifest(_0x4d32cd,{'requireOssPath':![]});}export function requirePackageBytes(_0x38aefb,_0xf0621e){if(!_0xf0621e||_0xf0621e['length']===0x0)throw CliErrors['validation']('Runtime\x20Skill\x20package\x20is\x20required\x20for\x20Skill\x20install:\x20'+_0x38aefb);return _0xf0621e;}export function extractDownloadedPackage(_0x2fa1ce){const _0x48847d=a164_0x9fec,_0x231fb3=parseZipPackage(_0x2fa1ce)[_0x48847d(0x16d)](_0x564632=>({'path':_0x564632[_0x48847d(0x187)],'bytes':_0x564632[_0x48847d(0x184)]}));if(!_0x231fb3[_0x48847d(0x17b)](_0x4e92f3=>_0x4e92f3[_0x48847d(0x187)]===SKILL_FILE))throw CliErrors[_0x48847d(0x16f)](_0x48847d(0x17a)+SKILL_FILE+'.');return normalizeLocalFiles(_0x231fb3);}export function localFilesToManifestFiles(_0x12acad){const _0x44dce1=a164_0x9fec;return normalizeLocalFiles(_0x12acad)[_0x44dce1(0x16d)](_0x1ea1bf=>({'path':_0x1ea1bf[_0x44dce1(0x187)],'sha256':fileHash(_0x1ea1bf),'size':fileContent(_0x1ea1bf)['length']}));}function normalizePackageManifest(_0x216450,_0x32cdbf){const _0x29b8a2=a164_0x9fec;if(!_0x216450||typeof _0x216450!==_0x29b8a2(0x18d)||Array[_0x29b8a2(0x180)](_0x216450))return undefined;const _0x34546f=_0x216450,_0x6b493d=typeof _0x34546f['ossPath']===_0x29b8a2(0x17f)?_0x34546f[_0x29b8a2(0x172)]['trim']():undefined;if(_0x32cdbf['requireOssPath']&&!_0x6b493d)return undefined;if(!Array[_0x29b8a2(0x180)](_0x34546f[_0x29b8a2(0x198)])||_0x34546f[_0x29b8a2(0x198)][_0x29b8a2(0x18a)]===0x0)return undefined;if(!isSha256Hex(_0x34546f[_0x29b8a2(0x16e)]))throw CliErrors['validation'](_0x29b8a2(0x192));if(!isSha256Hex(_0x34546f[_0x29b8a2(0x183)]))throw CliErrors[_0x29b8a2(0x16f)](_0x29b8a2(0x195));if(!Number[_0x29b8a2(0x173)](_0x34546f[_0x29b8a2(0x19d)])||_0x34546f[_0x29b8a2(0x19d)]<0x0)throw CliErrors[_0x29b8a2(0x16f)](_0x29b8a2(0x182));const _0x3e3fdd=normalizeManifestFiles(_0x34546f['files']);if(!_0x3e3fdd[_0x29b8a2(0x17b)](_0x3d1868=>_0x3d1868['path']===SKILL_FILE))throw CliErrors[_0x29b8a2(0x16f)](_0x29b8a2(0x196)+SKILL_FILE+'.');const _0x885f82=fileTreeHash(_0x3e3fdd);if(_0x885f82!==_0x34546f[_0x29b8a2(0x16e)]['toLowerCase']())throw CliErrors[_0x29b8a2(0x16f)](_0x29b8a2(0x175));return{'schemaVersion':Number[_0x29b8a2(0x173)](_0x34546f[_0x29b8a2(0x174)])?_0x34546f[_0x29b8a2(0x174)]:0x2,'ossPath':_0x6b493d,'treeSha256':_0x885f82,'zipSha256':_0x34546f[_0x29b8a2(0x183)][_0x29b8a2(0x18c)](),'zipSize':_0x34546f[_0x29b8a2(0x19d)],'files':_0x3e3fdd};}function extractAndVerifyPackage(_0x34bf4d,_0x173efb){const _0x3e130b=a164_0x9fec,_0x4489c6=normalizePackageManifest(_0x34bf4d,{'requireOssPath':![]});if(!_0x4489c6)throw CliErrors[_0x3e130b(0x16f)](_0x3e130b(0x194));if(_0x173efb[_0x3e130b(0x18a)]!==_0x4489c6['zipSize'])throw CliErrors['validation'](_0x3e130b(0x170));const _0x2a5d01=bufferSha256(_0x173efb);if(_0x2a5d01!==_0x4489c6['zipSha256'])throw CliErrors[_0x3e130b(0x16f)](_0x3e130b(0x189));return extractAndVerifyPackageFiles(_0x4489c6,_0x173efb);}function extractAndVerifyPackageFiles(_0x1369c4,_0x469566){const _0x3f82bd=a164_0x9fec,_0x4e9e7f=parseZipPackage(_0x469566);if(_0x4e9e7f['length']!==_0x1369c4[_0x3f82bd(0x198)][_0x3f82bd(0x18a)])throw CliErrors[_0x3f82bd(0x16f)](_0x3f82bd(0x178));const _0x396937=new Map();for(const _0x433fec of _0x4e9e7f){if(_0x396937[_0x3f82bd(0x186)](_0x433fec[_0x3f82bd(0x187)]))throw CliErrors[_0x3f82bd(0x16f)]('Duplicate\x20Skill\x20package\x20entry:\x20'+_0x433fec[_0x3f82bd(0x187)]);_0x396937['set'](_0x433fec[_0x3f82bd(0x187)],_0x433fec);}const _0x33b67d=[];for(const _0x2565d4 of _0x1369c4['files']){const _0x2d1796=_0x396937['get'](_0x2565d4[_0x3f82bd(0x187)]);if(!_0x2d1796)throw CliErrors[_0x3f82bd(0x16f)](_0x3f82bd(0x177)+_0x2565d4[_0x3f82bd(0x187)]);if(_0x2d1796[_0x3f82bd(0x184)][_0x3f82bd(0x18a)]!==_0x2565d4[_0x3f82bd(0x179)])throw CliErrors[_0x3f82bd(0x16f)](_0x3f82bd(0x193)+_0x2565d4['path']);const _0x513359=bufferSha256(_0x2d1796[_0x3f82bd(0x184)]);if(_0x513359!==_0x2565d4[_0x3f82bd(0x171)])throw CliErrors['validation'](_0x3f82bd(0x17c)+_0x2565d4[_0x3f82bd(0x187)]);_0x33b67d[_0x3f82bd(0x18f)]({'path':_0x2565d4[_0x3f82bd(0x187)],'bytes':_0x2d1796[_0x3f82bd(0x184)]});}return normalizeLocalFiles(_0x33b67d);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x3fa34a,_0x5d25ad){var _0x469c56=a165_0x4f6b,_0x3a7073=_0x3fa34a();while(!![]){try{var _0x2a40d3=parseInt(_0x469c56(0x1e5))/0x1+-parseInt(_0x469c56(0x1eb))/0x2*(-parseInt(_0x469c56(0x1e3))/0x3)+parseInt(_0x469c56(0x1e6))/0x4+parseInt(_0x469c56(0x1ec))/0x5+parseInt(_0x469c56(0x1e8))/0x6+-parseInt(_0x469c56(0x1e7))/0x7*(parseInt(_0x469c56(0x1ea))/0x8)+parseInt(_0x469c56(0x1e9))/0x9*(-parseInt(_0x469c56(0x1e4))/0xa);if(_0x2a40d3===_0x5d25ad)break;else _0x3a7073['push'](_0x3a7073['shift']());}catch(_0x120a2f){_0x3a7073['push'](_0x3a7073['shift']());}}}(a165_0x3a9a,0x257a5));export{contentHash,fileTreeHash}from'./runtime-skill-sync/hashing.js';export{linkEffectiveRuntimeSkills,linkGlobalRuntimeSkills,pruneStaleRuntimeSkillCache,pruneStaleRuntimeSkillLinks}from'./runtime-skill-sync/links.js';export{resolveRuntimeSkillInstallTarget}from'./runtime-skill-sync/install-target.js';export{listLocalRuntimeSkills}from'./runtime-skill-sync/list-local.js';function a165_0x4f6b(_0x1f3207,_0x50c79c){_0x1f3207=_0x1f3207-0x1e3;var _0x3a9a6f=a165_0x3a9a();var _0x4f6b71=_0x3a9a6f[_0x1f3207];return _0x4f6b71;}function a165_0x3a9a(){var _0x49757c=['11038VlTFgl','821560yOJlgx','45NUBGag','5540ZuKBzk','130586ecIUHm','392880nkWYpb','3171WfRvEe','1541136MkRrkV','7173NwhGgd','2432SySqLF'];a165_0x3a9a=function(){return _0x49757c;};return a165_0x3a9a();}export{materializeRuntimeSkill,reuseMaterializedRuntimeSkill}from'./runtime-skill-sync/materialize.js';export{readMetadataIfPresent}from'./runtime-skill-sync/metadata.js';export{getRuntimeSkillCacheRoot,getRuntimeSkillDir,resolveSkillSyncPaths,runtimeAgentSkillRoots}from'./runtime-skill-sync/paths.js';export{deriveSkillCodeFromDirectory,readPushDirectory,refreshPushDirectoryMetadataFromRemote,recordPushedRuntimeSkill,resolvePushDirectoryIdentity}from'./runtime-skill-sync/push.js';export{buildSkillPackage,verifyRuntimeSkillBundle,verifyRuntimeSkillPackage}from'./runtime-skill-sync/zip-package.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a166_0x3648dc=a166_0x30d0;function a166_0x30d0(_0x3b6975,_0x926d76){_0x3b6975=_0x3b6975-0x9d;const _0x2c0259=a166_0x2c02();let _0x30d03d=_0x2c0259[_0x3b6975];return _0x30d03d;}(function(_0x2bd404,_0x4e3500){const _0x381c7e=a166_0x30d0,_0x3dcb98=_0x2bd404();while(!![]){try{const _0x20d51b=-parseInt(_0x381c7e(0xbc))/0x1*(-parseInt(_0x381c7e(0xad))/0x2)+-parseInt(_0x381c7e(0xb7))/0x3+-parseInt(_0x381c7e(0xa5))/0x4*(parseInt(_0x381c7e(0x9e))/0x5)+parseInt(_0x381c7e(0xa7))/0x6*(parseInt(_0x381c7e(0xb1))/0x7)+-parseInt(_0x381c7e(0xb2))/0x8+-parseInt(_0x381c7e(0xb6))/0x9*(-parseInt(_0x381c7e(0xba))/0xa)+parseInt(_0x381c7e(0xaa))/0xb;if(_0x20d51b===_0x4e3500)break;else _0x3dcb98['push'](_0x3dcb98['shift']());}catch(_0x27bc8b){_0x3dcb98['push'](_0x3dcb98['shift']());}}}(a166_0x2c02,0x6f90f));function a166_0x2c02(){const _0x33766e=['\x22\x20but\x20no\x20SKILL.md\x20was\x20found\x20in\x20known\x20layouts\x20','119WxZODw','3506104kXfOEO','map','skills','kind','18awGtIo','1325130Ebomll','includes','\x20records\x20\x22','73240GbsFgR','.skill-lock.json','877SFUGhE','recorded','not-recorded','object','parse','join','unusable','absent','938020izKEGu','\x20uses\x20unsupported\x20version\x20','number','unverifiable','SKILL.md','find','lockFile','4XtbDFC','present','262302cGstZm','reason','message','21681CSUQyu','utf8','home','1744OsdKGz','version','globalSkillsDirs'];a166_0x2c02=function(){return _0x33766e;};return a166_0x2c02();}import{existsSync,readFileSync}from'node:fs';import{homedir}from'node:os';import{join}from'node:path';export const SKILL_LOCK_RELATIVE_PATH=join('.agents',a166_0x3648dc(0xbb));export const GLOBAL_SKILLS_DIR_RELATIVE_PATHS=[join('.agents',a166_0x3648dc(0xb4)),join('.claude',a166_0x3648dc(0xb4))];const SUPPORTED_LOCK_VERSIONS=[0x3];function readLockLookup(_0x5a2763,_0x43b334){const _0x5b5f88=a166_0x3648dc;if(!existsSync(_0x5a2763))return{'kind':_0x5b5f88(0xbe)};let _0x4eabc6;try{_0x4eabc6=JSON[_0x5b5f88(0xc0)](readFileSync(_0x5a2763,_0x5b5f88(0xab)));}catch(_0x5da1f1){return{'kind':_0x5b5f88(0xc2),'reason':_0x5a2763+'\x20is\x20unreadable:\x20'+_0x5da1f1[_0x5b5f88(0xa9)]};}const _0x4216dc=_0x4eabc6;if(typeof _0x4216dc?.[_0x5b5f88(0xae)]!==_0x5b5f88(0xa0)||!SUPPORTED_LOCK_VERSIONS[_0x5b5f88(0xb8)](_0x4216dc[_0x5b5f88(0xae)]))return{'kind':_0x5b5f88(0xc2),'reason':_0x5a2763+_0x5b5f88(0x9f)+String(_0x4216dc?.[_0x5b5f88(0xae)])};if(!_0x4216dc[_0x5b5f88(0xb4)]||typeof _0x4216dc['skills']!==_0x5b5f88(0xbf))return{'kind':_0x5b5f88(0xc2),'reason':_0x5a2763+'\x20has\x20no\x20skills\x20map'};return _0x4216dc['skills'][_0x43b334]?{'kind':_0x5b5f88(0xbd)}:{'kind':_0x5b5f88(0xbe)};}export function resolveInstalledSkill(_0x2080c4,_0x19ef78){const _0x36d363=a166_0x3648dc,_0x4e3236=_0x19ef78?.[_0x36d363(0xac)]??homedir(),_0x1b18ec=_0x19ef78?.[_0x36d363(0xaf)]??GLOBAL_SKILLS_DIR_RELATIVE_PATHS[_0x36d363(0xb3)](_0x2e9e43=>join(_0x4e3236,_0x2e9e43)),_0x38528d=_0x19ef78?.[_0x36d363(0xa4)]??join(_0x4e3236,SKILL_LOCK_RELATIVE_PATH),_0x265bab=_0x1b18ec['map'](_0x263d63=>join(_0x263d63,_0x2080c4,_0x36d363(0xa2))),_0x5b36c5=_0x265bab[_0x36d363(0xa3)](_0x3598ad=>existsSync(_0x3598ad));if(_0x5b36c5)return{'state':_0x36d363(0xa6),'path':_0x5b36c5};const _0x291117=readLockLookup(_0x38528d,_0x2080c4);if(_0x291117[_0x36d363(0xb5)]===_0x36d363(0xc2))return{'state':_0x36d363(0xa1),'reason':_0x291117[_0x36d363(0xa8)]};if(_0x291117[_0x36d363(0xb5)]===_0x36d363(0xbd))return{'state':_0x36d363(0xa1),'reason':_0x38528d+_0x36d363(0xb9)+_0x2080c4+_0x36d363(0xb0)+('('+_0x265bab[_0x36d363(0xc1)](',\x20')+')')};return{'state':_0x36d363(0x9d),'checked':_0x265bab};}
|