@lovrabet/lovrabet-cli 2.3.6-beta.1 → 2.3.6-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli.js +1 -1
- package/lib/commands/api-doc/index.js +1 -1
- package/lib/commands/app/cache.js +1 -1
- package/lib/commands/app/definitions.js +1 -1
- package/lib/commands/app/eligibility.js +1 -1
- package/lib/commands/app/mock-loader.js +1 -1
- package/lib/commands/app/remote-source.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/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.d.ts +3 -3
- 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 +1 -0
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/kb-search-client.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.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 +5 -3
- package/skills/lovrabet/guides/app-resolution.md +2 -0
- package/skills/lovrabet/guides/dataset-and-data-workflow.md +10 -1
- package/skills/lovrabet/references/dataset-discovery-workflow.md +14 -1
- package/skills/lovrabet/references/instant-api-workflow.md +2 -0
- package/skills/lovrabet/references/lovrabet-app.md +2 -0
- package/skills/lovrabet.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5e8d6f,_0x1be30f){const _0x5c3b1d=a151_0x2862,_0x1ef553=_0x5e8d6f();while(!![]){try{const _0x586512=parseInt(_0x5c3b1d(0x127))/0x1*(-parseInt(_0x5c3b1d(0x125))/0x2)+-parseInt(_0x5c3b1d(0x12a))/0x3*(-parseInt(_0x5c3b1d(0x12b))/0x4)+-parseInt(_0x5c3b1d(0x120))/0x5+-parseInt(_0x5c3b1d(0x126))/0x6*(-parseInt(_0x5c3b1d(0x122))/0x7)+parseInt(_0x5c3b1d(0x129))/0x8+parseInt(_0x5c3b1d(0x11d))/0x9+-parseInt(_0x5c3b1d(0x121))/0xa;if(_0x586512===_0x1be30f)break;else _0x1ef553['push'](_0x1ef553['shift']());}catch(_0x4886b4){_0x1ef553['push'](_0x1ef553['shift']());}}}(a151_0x6d94,0x766ff));import{createHash}from'node:crypto';import{fileContent,normalizeManifestFiles}from'./local-files.js';export function contentHash(_0x591776){const _0x39ae37=a151_0x2862;return createHash(_0x39ae37(0x12c))[_0x39ae37(0x11e)](_0x591776)[_0x39ae37(0x123)](_0x39ae37(0x11f));}export function fileHash(_0x292efc){return bufferSha256(fileContent(_0x292efc));}function a151_0x6d94(){const _0x136870=['8evBfJC','sha256','6846867boeKVB','update','hex','3194510xXlJEh','5123810bKyYyB','441PIYVRa','digest','size','531820xNNrLw','15528dnvNSE','3XlRZRh','path','4599192DyZczA','1403139MmgggE'];a151_0x6d94=function(){return _0x136870;};return a151_0x6d94();}export function bufferSha256(_0x4e89e2){const _0x373a60=a151_0x2862;return createHash('sha256')[_0x373a60(0x11e)](_0x4e89e2)[_0x373a60(0x123)](_0x373a60(0x11f));}function a151_0x2862(_0x33dac0,_0x10a7b2){_0x33dac0=_0x33dac0-0x11d;const _0x6d9434=a151_0x6d94();let _0x2862a2=_0x6d9434[_0x33dac0];return _0x2862a2;}export function fileTreeHash(_0x2e8126){const _0x4a585d=a151_0x2862,_0xb8af32=createHash(_0x4a585d(0x12c));for(const _0x2f68d9 of normalizeManifestFiles(_0x2e8126)){_0xb8af32[_0x4a585d(0x11e)](_0x2f68d9[_0x4a585d(0x128)]),_0xb8af32[_0x4a585d(0x11e)]('\x00'),_0xb8af32[_0x4a585d(0x11e)](_0x2f68d9[_0x4a585d(0x12c)]),_0xb8af32[_0x4a585d(0x11e)]('\x00'),_0xb8af32['update'](String(_0x2f68d9[_0x4a585d(0x124)])),_0xb8af32[_0x4a585d(0x11e)]('\x00');}return _0xb8af32[_0x4a585d(0x123)](_0x4a585d(0x11f));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x84279f,_0x532616){const _0x1d95f5=a152_0x2653,_0x527ff2=_0x84279f();while(!![]){try{const _0x4b06dc=parseInt(_0x1d95f5(0x118))/0x1*(-parseInt(_0x1d95f5(0x119))/0x2)+-parseInt(_0x1d95f5(0x115))/0x3*(-parseInt(_0x1d95f5(0x11a))/0x4)+-parseInt(_0x1d95f5(0x113))/0x5*(parseInt(_0x1d95f5(0x11b))/0x6)+-parseInt(_0x1d95f5(0x10c))/0x7+parseInt(_0x1d95f5(0x11c))/0x8+-parseInt(_0x1d95f5(0x117))/0x9*(parseInt(_0x1d95f5(0x111))/0xa)+parseInt(_0x1d95f5(0x10b))/0xb*(parseInt(_0x1d95f5(0x116))/0xc);if(_0x4b06dc===_0x532616)break;else _0x527ff2['push'](_0x527ff2['shift']());}catch(_0x59c299){_0x527ff2['push'](_0x527ff2['shift']());}}}(a152_0x2845,0xaaa26));import{resolve}from'node:path';function a152_0x2845(){const _0x13107e=['1087146fydNGM','273mzdHWU','7696NDSaOK','1809308ExbaqQ','10980MRnkWe','9394480JGuRQP','skills','14648425akilMg','1186052fMhLWO','cwd','.agents','managedRoot','freeze','10xbxQRJ','appCode','2510jiZfex','project','3IGoEAb','12NzlAus'];a152_0x2845=function(){return _0x13107e;};return a152_0x2845();}function a152_0x2653(_0x509135,_0xdef196){_0x509135=_0x509135-0x10b;const _0x2845a1=a152_0x2845();let _0x265318=_0x2845a1[_0x509135];return _0x265318;}import{resolveSkillSyncPaths,runtimeAgentSkillRoots,safePathSegment}from'./paths.js';export function resolveRuntimeSkillInstallTarget(_0x175e59,_0x37ec0e='global',_0x3b9503={}){const _0x4c7c64=a152_0x2653,_0xdb0a94=resolveSkillSyncPaths(_0x3b9503),_0x59fb78=safePathSegment(_0x175e59,_0x4c7c64(0x112)),_0x1be098=_0x37ec0e===_0x4c7c64(0x114)?[resolve(_0x3b9503[_0x4c7c64(0x10d)]??process[_0x4c7c64(0x10d)](),_0x4c7c64(0x10e),_0x4c7c64(0x11d))]:runtimeAgentSkillRoots(_0xdb0a94);return Object[_0x4c7c64(0x110)]({'scope':_0x37ec0e,'appCode':_0x59fb78,'skillRoots':Object[_0x4c7c64(0x110)](_0x1be098),'managedRoot':_0xdb0a94[_0x4c7c64(0x10f)]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a153_0x51f9(_0x4752fc,_0x33dbaf){_0x4752fc=_0x4752fc-0x138;const _0x26ad3b=a153_0x26ad();let _0x51f94c=_0x26ad3b[_0x4752fc];return _0x51f94c;}(function(_0x4af788,_0x51fade){const _0x438772=a153_0x51f9,_0x3b5797=_0x4af788();while(!![]){try{const _0x5900b5=-parseInt(_0x438772(0x141))/0x1+parseInt(_0x438772(0x15c))/0x2*(parseInt(_0x438772(0x14d))/0x3)+parseInt(_0x438772(0x151))/0x4*(-parseInt(_0x438772(0x146))/0x5)+parseInt(_0x438772(0x148))/0x6*(-parseInt(_0x438772(0x16a))/0x7)+-parseInt(_0x438772(0x166))/0x8+parseInt(_0x438772(0x13f))/0x9+parseInt(_0x438772(0x14f))/0xa;if(_0x5900b5===_0x51fade)break;else _0x3b5797['push'](_0x3b5797['shift']());}catch(_0x32e5cd){_0x3b5797['push'](_0x3b5797['shift']());}}}(a153_0x26ad,0x63ff9));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';function a153_0x26ad(){const _0x224f64=['isSymbolicLink','push','validation','name','isDirectory','managedRoot','values','personal','skill','2XAouio','updated','metadata-mismatch','scope','external-symlink','Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20','dir','not-managed-symlink','metadataPath','has','3081592uqHhtN','set','project','env','7ufiTct','scopes','Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20','appCode','startsWith','skipped','Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20','accessKey','Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20','company','Refusing\x20to\x20copy\x20Skill\x20symlink:\x20','activeSkillCodes','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','map','skillRoots','2904291EjJJVr','builtin','83502ClYKuH','length','Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20','filter','unchanged','3415GTImVp','pruneSkillCodes','2268924iwqHYg','contentHash','Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20','get','trim','152157pVIcjw','created','11213970rlQJcZ','protectedLinkRoots','1396iEnTtw','skillCode'];a153_0x26ad=function(){return _0x224f64;};return a153_0x26ad();}import{basename,dirname,resolve}from'node:path';import a153_0x609949 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}=a153_0x609949,RESERVED_PROJECT_SKILL_CODES=new Set(['lovrabet','runtime-observe','secret-retriever']);export function linkEffectiveRuntimeSkills(_0x255057,_0x2370ef){const _0x3a497d=a153_0x51f9,_0x1ad881=new Map();for(const _0x438609 of _0x255057){const _0x7d0b14=_0x438609[_0x3a497d(0x15b)][_0x3a497d(0x152)];if(!_0x7d0b14)continue;const _0x4c90e3=_0x1ad881[_0x3a497d(0x14b)](_0x7d0b14);(!_0x4c90e3||_0x438609['scope']===_0x3a497d(0x15a))&&_0x1ad881[_0x3a497d(0x167)](_0x7d0b14,_0x438609);}const _0x1e471b=[];for(const _0x800dc4 of _0x1ad881[_0x3a497d(0x159)]()){const _0x529931=requireSkillCode(_0x800dc4[_0x3a497d(0x15b)]),_0x36eb07=readMetadataIfPresent(_0x800dc4['metadataPath']);if(_0x36eb07?.[_0x3a497d(0x16d)]!==_0x2370ef[_0x3a497d(0x16d)]||_0x36eb07[_0x3a497d(0x152)]!==_0x529931)throw CliErrors['validation'](_0x3a497d(0x16c)+_0x2370ef[_0x3a497d(0x16d)]+':\x20'+_0x800dc4[_0x3a497d(0x164)]);const _0x325c10=runtimeSkillLinkName(_0x2370ef,_0x529931);for(const _0x1f5ae8 of _0x2370ef[_0x3a497d(0x13e)]){_0x1e471b['push'](ensureManagedSymlink(resolve(_0x1f5ae8,_0x325c10),_0x800dc4[_0x3a497d(0x162)],_0x2370ef,_0x529931));}}return _0x1e471b;}export function pruneStaleRuntimeSkillLinks(_0x2878b1,_0x30172a,_0x51be02){const _0x2600ff=a153_0x51f9,_0x1dcacd=new Set([..._0x30172a][_0x2600ff(0x13d)](_0x241302=>_0x241302[_0x2600ff(0x14c)]())[_0x2600ff(0x144)](Boolean)),_0x194384=_0x51be02?new Set([..._0x51be02][_0x2600ff(0x13d)](_0x2197de=>_0x2197de[_0x2600ff(0x14c)]())[_0x2600ff(0x144)](Boolean)):undefined,_0x332939=[];for(const _0x413520 of _0x2878b1[_0x2600ff(0x13e)]){for(const _0x517a94 of managedTargetSkillLinkPaths(_0x413520,_0x2878b1)){const _0x1b2522=runtimeSkillCodeFromLink(_0x2878b1,_0x517a94);if(_0x194384&&!_0x194384[_0x2600ff(0x165)](_0x1b2522))continue;if(_0x1dcacd[_0x2600ff(0x165)](_0x1b2522))continue;_0x332939[_0x2600ff(0x154)](removeManagedSkillLink(_0x517a94,_0x2878b1,_0x1b2522));}}return _0x332939;}export function pruneStaleRuntimeSkillCache(_0xc235ec,_0x1afbf0={}){const _0x6047bf=a153_0x51f9,_0x3a2a44=new Set([..._0xc235ec[_0x6047bf(0x13b)]]['map'](_0x5f566c=>_0x5f566c[_0x6047bf(0x14c)]())[_0x6047bf(0x144)](Boolean)),_0x1d2375=_0xc235ec[_0x6047bf(0x147)]?new Set([..._0xc235ec[_0x6047bf(0x147)]][_0x6047bf(0x13d)](_0x3991eb=>_0x3991eb[_0x6047bf(0x14c)]())['filter'](Boolean)):undefined,_0x4ad6bd=_0xc235ec[_0x6047bf(0x16b)]??[_0x6047bf(0x15a),_0x6047bf(0x139)],_0x8870b2=resolve(getRuntimeSkillCacheRoot(_0xc235ec[_0x6047bf(0x169)],_0xc235ec[_0x6047bf(0x171)],_0x1afbf0),safePathSegment(_0xc235ec[_0x6047bf(0x16d)],_0x6047bf(0x16d))),_0x4226fe=[];for(const _0x1ea0c8 of _0x4ad6bd){const _0x328e0c=resolve(_0x8870b2,_0x1ea0c8);if(!existsSync(_0x328e0c))continue;for(const _0x2b1e8f of readdirSync(_0x328e0c,{'withFileTypes':!![]})){if(!_0x2b1e8f[_0x6047bf(0x157)]())continue;const _0x5a5e96=_0x2b1e8f[_0x6047bf(0x156)];if(_0x1d2375&&!_0x1d2375[_0x6047bf(0x165)](_0x5a5e96))continue;if(_0x3a2a44['has'](_0x5a5e96))continue;const _0x39cd4f=resolve(_0x328e0c,_0x5a5e96),_0x1daea7=readMetadataIfPresent(resolve(_0x39cd4f,METADATA_FILE));if(_0x1daea7?.['appCode']!==_0xc235ec[_0x6047bf(0x16d)]||_0x1daea7[_0x6047bf(0x15f)]!==_0x1ea0c8||_0x1daea7[_0x6047bf(0x152)]!==_0x5a5e96){_0x4226fe['push']({'path':_0x39cd4f,'action':_0x6047bf(0x16f),'reason':_0x6047bf(0x15e)});continue;}if(isLinkedFromAnyRoot(_0x39cd4f,_0xc235ec[_0x6047bf(0x150)]??[])){_0x4226fe['push']({'path':_0x39cd4f,'action':'skipped','reason':'linked-from-protected-root'});continue;}removeSync(_0x39cd4f),_0x4226fe['push']({'path':_0x39cd4f,'action':'removed'});}}return _0x4226fe;}export function linkGlobalRuntimeSkills(_0x277ce0,_0x3135d9={}){const _0x3dbef9=a153_0x51f9,_0x2c86ad=resolveSkillSyncPaths(_0x3135d9),_0xd4371b=[];for(const _0x4bed66 of _0x277ce0){if(_0x4bed66[_0x3dbef9(0x15f)]!=='builtin')throw CliErrors[_0x3dbef9(0x155)](_0x3dbef9(0x13c)+_0x4bed66[_0x3dbef9(0x15f)]);const _0x5f05ef=requireSkillCode(_0x4bed66[_0x3dbef9(0x15b)]),_0x3988c2=copyManagedSkillDirectory(_0x4bed66[_0x3dbef9(0x162)],resolve(_0x2c86ad['agentsSkillsDir'],_0x5f05ef));_0xd4371b[_0x3dbef9(0x154)]({..._0x3988c2,'contentHash':_0x4bed66[_0x3dbef9(0x149)]});}return _0xd4371b;}function ensureManagedSymlink(_0x65f586,_0x3a4d37,_0x314b21,_0xaf4571){const _0x2f9f5b=a153_0x51f9;mkdirSync(dirname(_0x65f586),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x65f586)||isDanglingSymlink(_0x65f586)){const _0x50d761=lstatSync(_0x65f586);if(!_0x50d761[_0x2f9f5b(0x153)]())throw CliErrors[_0x2f9f5b(0x155)](_0x2f9f5b(0x14a)+_0x65f586);const _0x6cd575=resolveSymlinkTarget(_0x65f586);if(!isPathInside(realOrResolved(_0x6cd575),realOrResolved(_0x314b21[_0x2f9f5b(0x158)])))throw CliErrors[_0x2f9f5b(0x155)](_0x2f9f5b(0x170)+_0x65f586);if(realOrResolved(_0x6cd575)===realOrResolved(_0x3a4d37))return{'path':_0x65f586,'target':_0x3a4d37,'action':_0x2f9f5b(0x145)};const _0x27c59c=readMetadataIfPresent(resolve(_0x6cd575,METADATA_FILE));if(_0x314b21[_0x2f9f5b(0x15f)]===_0x2f9f5b(0x168)&&(_0x27c59c?.[_0x2f9f5b(0x16d)]!==_0x314b21[_0x2f9f5b(0x16d)]||_0x27c59c[_0x2f9f5b(0x152)]!==_0xaf4571))throw CliErrors[_0x2f9f5b(0x155)]('Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20'+_0x65f586);return unlinkSync(_0x65f586),symlinkSync(_0x3a4d37,_0x65f586,_0x2f9f5b(0x162)),{'path':_0x65f586,'target':_0x3a4d37,'action':_0x2f9f5b(0x15d)};}return symlinkSync(_0x3a4d37,_0x65f586,_0x2f9f5b(0x162)),{'path':_0x65f586,'target':_0x3a4d37,'action':_0x2f9f5b(0x14e)};}function managedTargetSkillLinkPaths(_0x3b6a29,_0x4fd073){const _0x525f57=a153_0x51f9;if(!existsSync(_0x3b6a29))return[];const _0xc279dc=_0x4fd073[_0x525f57(0x16d)]+'--';return readdirSync(_0x3b6a29,{'withFileTypes':!![]})['filter'](_0x1158f2=>_0x4fd073[_0x525f57(0x15f)]===_0x525f57(0x168)||_0x1158f2[_0x525f57(0x156)][_0x525f57(0x16e)](_0xc279dc))[_0x525f57(0x13d)](_0x33f590=>resolve(_0x3b6a29,_0x33f590['name']));}function removeManagedSkillLink(_0x407149,_0x1be8f3,_0x8e2b67){const _0x15ab48=a153_0x51f9,_0x2123e1=lstatIfPresent(_0x407149);if(!_0x2123e1?.[_0x15ab48(0x153)]())return{'path':_0x407149,'action':_0x15ab48(0x16f),'reason':_0x15ab48(0x163)};const _0xa9dbd5=resolveSymlinkTarget(_0x407149);if(!isPathInside(realOrResolved(_0xa9dbd5),realOrResolved(_0x1be8f3[_0x15ab48(0x158)])))return{'path':_0x407149,'action':_0x15ab48(0x16f),'reason':_0x15ab48(0x160)};const _0x583495=readMetadataIfPresent(resolve(_0xa9dbd5,METADATA_FILE));if(_0x1be8f3[_0x15ab48(0x15f)]===_0x15ab48(0x168)&&(_0x583495?.[_0x15ab48(0x16d)]!==_0x1be8f3[_0x15ab48(0x16d)]||_0x583495[_0x15ab48(0x152)]!==_0x8e2b67))return{'path':_0x407149,'action':_0x15ab48(0x16f),'reason':_0x15ab48(0x15e)};return unlinkSync(_0x407149),{'path':_0x407149,'action':'removed'};}function isLinkedFromAnyRoot(_0x4c8d46,_0x16afe9){const _0x3b1b4c=a153_0x51f9,_0x2b941c=realOrResolved(_0x4c8d46);for(const _0x35987d of _0x16afe9){if(!existsSync(_0x35987d))continue;for(const _0xd0ab06 of readdirSync(_0x35987d,{'withFileTypes':!![]})){if(!_0xd0ab06[_0x3b1b4c(0x153)]())continue;const _0x4bc0ff=resolve(_0x35987d,_0xd0ab06[_0x3b1b4c(0x156)]);if(realOrResolved(resolveSymlinkTarget(_0x4bc0ff))===_0x2b941c)return!![];}}return![];}function runtimeSkillLinkName(_0x4961d8,_0x1d30d9){const _0x4d80fe=a153_0x51f9,_0x5c8651=safePathSegment(_0x1d30d9,_0x4d80fe(0x152));if(_0x4961d8[_0x4d80fe(0x15f)]===_0x4d80fe(0x168)&&RESERVED_PROJECT_SKILL_CODES['has'](_0x5c8651))throw CliErrors[_0x4d80fe(0x155)](_0x4d80fe(0x161)+_0x5c8651);return _0x4961d8['scope']===_0x4d80fe(0x168)?_0x5c8651:_0x4961d8[_0x4d80fe(0x16d)]+'--'+_0x5c8651;}function runtimeSkillCodeFromLink(_0x5b1450,_0x53e875){const _0x34e42d=a153_0x51f9,_0x15a2ef=basename(_0x53e875);return _0x5b1450['scope']===_0x34e42d(0x168)?_0x15a2ef:_0x15a2ef['slice']((_0x5b1450[_0x34e42d(0x16d)]+'--')[_0x34e42d(0x142)]);}export function copyManagedSkillDirectory(_0x27a8fb,_0xda3db7){const _0x189e11=a153_0x51f9,_0x3d52a0=resolve(_0xda3db7,METADATA_FILE),_0x4adb64=existsSync(_0xda3db7);if(_0x4adb64){const _0x291ac2=lstatSync(_0xda3db7);if(_0x291ac2[_0x189e11(0x153)]())throw CliErrors[_0x189e11(0x155)](_0x189e11(0x143)+_0xda3db7);if(!_0x291ac2[_0x189e11(0x157)]())throw CliErrors[_0x189e11(0x155)](_0x189e11(0x138)+_0xda3db7);const _0xaa82bf=readMetadataIfPresent(_0x3d52a0);if(_0xaa82bf?.[_0x189e11(0x15f)]!==_0x189e11(0x140))throw CliErrors[_0x189e11(0x155)]('Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20'+_0xda3db7);}ensureDirSync(dirname(_0xda3db7));const _0x174c22=_0x4adb64?readMetadataIfPresent(_0x3d52a0)?.['contentHash']:undefined,_0x4dcf85=readMetadataIfPresent(resolve(_0x27a8fb,METADATA_FILE))?.['contentHash'];return _0x4adb64&&removeSync(_0xda3db7),copySkillDirectory(_0x27a8fb,_0xda3db7),{'path':_0xda3db7,'target':_0x27a8fb,'action':!_0x4adb64?'created':_0x174c22===_0x4dcf85?_0x189e11(0x145):_0x189e11(0x15d)};}function copySkillDirectory(_0x28c7e4,_0x1d3eeb){copySync(_0x28c7e4,_0x1d3eeb,{'dereference':![],'overwrite':!![],'filter'(_0x2157bd){const _0x4f30e3=a153_0x51f9;if(lstatSync(_0x2157bd)[_0x4f30e3(0x153)]())throw CliErrors['validation'](_0x4f30e3(0x13a)+_0x2157bd);return!![];}});}
|
|
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 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x518e7c,_0x2f6cc6){const _0x16976d=a154_0x5e86,_0x4cb1e0=_0x518e7c();while(!![]){try{const _0x41e2a3=parseInt(_0x16976d(0x124))/0x1*(-parseInt(_0x16976d(0x10c))/0x2)+-parseInt(_0x16976d(0x113))/0x3+-parseInt(_0x16976d(0x11e))/0x4*(-parseInt(_0x16976d(0x126))/0x5)+parseInt(_0x16976d(0x103))/0x6+parseInt(_0x16976d(0xfb))/0x7*(parseInt(_0x16976d(0x10e))/0x8)+parseInt(_0x16976d(0x115))/0x9*(parseInt(_0x16976d(0x119))/0xa)+parseInt(_0x16976d(0x102))/0xb*(-parseInt(_0x16976d(0x108))/0xc);if(_0x41e2a3===_0x2f6cc6)break;else _0x4cb1e0['push'](_0x4cb1e0['shift']());}catch(_0x89de04){_0x4cb1e0['push'](_0x4cb1e0['shift']());}}}(a154_0x2b26,0xa8004));import{existsSync,readdirSync}from'node:fs';import{resolve}from'node:path';function a154_0x5e86(_0xe30be7,_0x5327d8){_0xe30be7=_0xe30be7-0xf9;const _0x2b262a=a154_0x2b26();let _0x5e861f=_0x2b262a[_0xe30be7];return _0x5e861f;}import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{readMetadataIfPresent}from'./metadata.js';import{getRuntimeSkillCacheRoot,safePathSegment}from'./paths.js';function a154_0x2b26(){const _0x47da30=['name','51112yuvFRh','isSymbolicLink','Runtime\x20Skill\x20install\x20target\x20app\x20mismatch:\x20','link','env','1757013mKsvjS','localeCompare','338319FjXSuo','builtin','trim','skillCode','130mWymix','source','\x20!=\x20','linkedPath','from','344ThAjPy','cache','sort','has','set','scope','179hXmQqL','dir','44465foRMbY','startsWith','isArray','scopes','1498ohvymg','get','tags','appCode','accessKey','values','code','429uqiZgw','3777054gqGfOa','metadataPath','includes','skillRoots','local','201996dRxrWM','filter','push','linkedPaths','14748ugcVZB'];a154_0x2b26=function(){return _0x47da30;};return a154_0x2b26();}import{isRuntimeSkillScope,normalizeRuntimeSkillScopes}from'./scopes.js';export function listLocalRuntimeSkills(_0x5a41e3,_0x1ef8cc,_0x50b8ea={}){const _0x2b3c6b=a154_0x5e86,_0x538f5e=safePathSegment(_0x5a41e3[_0x2b3c6b(0xfe)],'appCode');if(_0x1ef8cc[_0x2b3c6b(0xfe)]!==_0x538f5e)throw CliErrors['validation'](_0x2b3c6b(0x110)+_0x1ef8cc[_0x2b3c6b(0xfe)]+_0x2b3c6b(0x11b)+_0x538f5e);const _0x1500d1=normalizeRuntimeSkillScopes(_0x5a41e3[_0x2b3c6b(0xfa)]),_0x3ad2dc=new Set(_0x1500d1),_0xf8f628=_0x5a41e3[_0x2b3c6b(0x101)]?.[_0x2b3c6b(0x117)](),_0x3d21a3=new Map(),_0x95f013=resolve(getRuntimeSkillCacheRoot(_0x5a41e3[_0x2b3c6b(0x112)],_0x5a41e3[_0x2b3c6b(0xff)],_0x50b8ea),_0x538f5e);for(const _0x5248a6 of _0x1500d1){for(const _0x5ce3f2 of localSkillEntryDirs(resolve(_0x95f013,_0x5248a6))){collectLocalRuntimeSkill(_0x3d21a3,_0x5ce3f2,{'appCode':_0x538f5e,'scopes':_0x3ad2dc,'code':_0xf8f628,'source':'cache'});}}for(const _0x5c94a5 of _0x1ef8cc[_0x2b3c6b(0x106)]){for(const _0x3035f8 of localSkillLinkCandidates(_0x5c94a5,_0x1ef8cc,_0x3ad2dc)){collectLocalRuntimeSkill(_0x3d21a3,_0x3035f8,{'appCode':_0x538f5e,'scopes':_0x3ad2dc,'code':_0xf8f628,'source':_0x2b3c6b(0x111),'linkedPath':_0x3035f8});}}return Array[_0x2b3c6b(0x11d)](_0x3d21a3[_0x2b3c6b(0x100)]())[_0x2b3c6b(0x120)](compareLocalRuntimeSkills);}function localSkillEntryDirs(_0x18ec43){const _0x474337=a154_0x5e86;if(!existsSync(_0x18ec43))return[];return readdirSync(_0x18ec43,{'withFileTypes':!![]})[_0x474337(0x109)](_0x58de88=>_0x58de88['isDirectory']()||_0x58de88[_0x474337(0x10f)]())['map'](_0x1545dc=>resolve(_0x18ec43,_0x1545dc[_0x474337(0x10d)]));}function localSkillLinkCandidates(_0x2294d6,_0x543440,_0x316c64){const _0x199516=a154_0x5e86;if(!existsSync(_0x2294d6))return[];const _0x35c95f=_0x543440[_0x199516(0xfe)]+'--';return readdirSync(_0x2294d6,{'withFileTypes':!![]})[_0x199516(0x109)](_0x258d76=>_0x258d76['isDirectory']()||_0x258d76['isSymbolicLink']())[_0x199516(0x109)](_0x22f2d7=>_0x543440[_0x199516(0x123)]==='project'||_0x22f2d7[_0x199516(0x10d)][_0x199516(0x127)](_0x35c95f)||_0x316c64[_0x199516(0x121)](_0x199516(0x116)))['map'](_0x2c1ea9=>resolve(_0x2294d6,_0x2c1ea9[_0x199516(0x10d)]));}function collectLocalRuntimeSkill(_0x37d20d,_0x4f686b,_0x398ec7){const _0x2dc9d4=a154_0x5e86,_0x1a6ce3=resolve(_0x4f686b,METADATA_FILE),_0x15f283=readMetadataIfPresent(_0x1a6ce3);if(!_0x15f283)return;if(_0x15f283[_0x2dc9d4(0xfe)]!==_0x398ec7[_0x2dc9d4(0xfe)])return;if(!isRuntimeSkillScope(_0x15f283[_0x2dc9d4(0x123)])||!_0x398ec7[_0x2dc9d4(0xfa)][_0x2dc9d4(0x121)](_0x15f283[_0x2dc9d4(0x123)]))return;const _0x30859c=_0x15f283[_0x2dc9d4(0x118)]?.['trim']();if(!_0x30859c)return;if(_0x398ec7[_0x2dc9d4(0x101)]&&_0x30859c!==_0x398ec7[_0x2dc9d4(0x101)])return;const _0x3d1f45=_0x15f283['scope']+':'+_0x30859c,_0x2e3ac6=_0x398ec7[_0x2dc9d4(0x11c)]?[_0x398ec7[_0x2dc9d4(0x11c)]]:[],_0xca45bb=_0x37d20d[_0x2dc9d4(0xfc)](_0x3d1f45);if(_0xca45bb){_0x398ec7[_0x2dc9d4(0x11a)]===_0x2dc9d4(0x11f)&&(_0xca45bb['dir']=_0x4f686b,_0xca45bb['cacheDir']=_0x4f686b,_0xca45bb['skillMdPath']=resolve(_0x4f686b,SKILL_FILE),_0xca45bb[_0x2dc9d4(0x104)]=_0x1a6ce3);for(const _0x10b7c0 of _0x2e3ac6){!_0xca45bb[_0x2dc9d4(0x10b)][_0x2dc9d4(0x105)](_0x10b7c0)&&_0xca45bb[_0x2dc9d4(0x10b)][_0x2dc9d4(0x10a)](_0x10b7c0);}_0xca45bb[_0x2dc9d4(0x10b)][_0x2dc9d4(0x120)]();return;}_0x37d20d[_0x2dc9d4(0x122)](_0x3d1f45,{..._0x15f283,'tags':Array[_0x2dc9d4(0xf9)](_0x15f283[_0x2dc9d4(0xfd)])?_0x15f283[_0x2dc9d4(0xfd)]:[],'scope':_0x15f283[_0x2dc9d4(0x123)],'source':_0x2dc9d4(0x107),'dir':_0x4f686b,'cacheDir':_0x398ec7[_0x2dc9d4(0x11a)]===_0x2dc9d4(0x11f)?_0x4f686b:undefined,'skillMdPath':resolve(_0x4f686b,SKILL_FILE),'metadataPath':_0x1a6ce3,'linkedPaths':_0x2e3ac6});}function compareLocalRuntimeSkills(_0x495107,_0x3e7065){const _0x1e3b84=a154_0x5e86,_0x43c9cf={'personal':0x0,'company':0x1,'builtin':0x2};return _0x43c9cf[_0x495107[_0x1e3b84(0x123)]]-_0x43c9cf[_0x3e7065['scope']]||_0x495107[_0x1e3b84(0x118)][_0x1e3b84(0x114)](_0x3e7065[_0x1e3b84(0x118)])||_0x495107[_0x1e3b84(0x125)]['localeCompare'](_0x3e7065[_0x1e3b84(0x125)]);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x416557,_0x49ca01){const _0x499cd1=a155_0x46a5,_0x9d901c=_0x416557();while(!![]){try{const _0x3dd9ef=-parseInt(_0x499cd1(0x181))/0x1*(-parseInt(_0x499cd1(0x18f))/0x2)+parseInt(_0x499cd1(0x175))/0x3+-parseInt(_0x499cd1(0x193))/0x4*(-parseInt(_0x499cd1(0x17b))/0x5)+-parseInt(_0x499cd1(0x182))/0x6*(-parseInt(_0x499cd1(0x187))/0x7)+-parseInt(_0x499cd1(0x18b))/0x8*(parseInt(_0x499cd1(0x17a))/0x9)+-parseInt(_0x499cd1(0x191))/0xa*(-parseInt(_0x499cd1(0x168))/0xb)+-parseInt(_0x499cd1(0x186))/0xc;if(_0x3dd9ef===_0x49ca01)break;else _0x9d901c['push'](_0x9d901c['shift']());}catch(_0x2eabbb){_0x9d901c['push'](_0x9d901c['shift']());}}}(a155_0xa4ed,0xacbf0));import{readFileSync,readdirSync,realpathSync}from'node:fs';import{relative,resolve}from'node:path';import{CliErrors}from'../../errors.js';import{IGNORED_DIR_NAMES,IGNORED_FILE_NAMES,SKILL_FILE}from'./constants.js';export function fileContent(_0x2a51d3){const _0x28b072=a155_0x46a5;return _0x2a51d3[_0x28b072(0x190)]??Buffer[_0x28b072(0x17f)](_0x2a51d3[_0x28b072(0x171)]??'',_0x28b072(0x177));}function a155_0x46a5(_0x1a6d41,_0x41ce06){_0x1a6d41=_0x1a6d41-0x167;const _0xa4edc4=a155_0xa4ed();let _0x46a54c=_0xa4edc4[_0x1a6d41];return _0x46a54c;}export function fileText(_0xa6cc5f){const _0x516a04=a155_0x46a5;return fileContent(_0xa6cc5f)[_0x516a04(0x189)](_0x516a04(0x177));}export function normalizeLocalFiles(_0x38f4d4){const _0xff72e0=a155_0x46a5;if(!Array['isArray'](_0x38f4d4)||_0x38f4d4[_0xff72e0(0x169)]===0x0)return[];const _0x40cda3=new Map();for(const _0x45da8d of _0x38f4d4){if(!_0x45da8d||typeof _0x45da8d!==_0xff72e0(0x184)||typeof _0x45da8d['path']!==_0xff72e0(0x17e))throw CliErrors['validation'](_0xff72e0(0x196));const _0x141af4=normalizeSkillRelativePath(_0x45da8d[_0xff72e0(0x180)]);if(_0x40cda3[_0xff72e0(0x188)](_0x141af4))throw CliErrors[_0xff72e0(0x195)](_0xff72e0(0x17c)+_0x141af4);if(_0x45da8d[_0xff72e0(0x190)]!==undefined&&!Buffer[_0xff72e0(0x176)](_0x45da8d['bytes']))throw CliErrors[_0xff72e0(0x195)](_0xff72e0(0x17d)+_0x141af4);if(_0x45da8d[_0xff72e0(0x190)]===undefined&&typeof _0x45da8d[_0xff72e0(0x171)]!==_0xff72e0(0x17e))throw CliErrors[_0xff72e0(0x195)](_0xff72e0(0x16d)+_0x141af4);const _0x9188e8=fileContent(_0x45da8d);_0x40cda3[_0xff72e0(0x16a)](_0x141af4,{'path':_0x141af4,'bytes':_0x9188e8});}return Array[_0xff72e0(0x17f)](_0x40cda3[_0xff72e0(0x185)]())[_0xff72e0(0x178)](compareSkillFiles);}export function normalizeManifestFiles(_0x46f054){const _0x32756f=a155_0x46a5;if(!Array[_0x32756f(0x18c)](_0x46f054)||_0x46f054[_0x32756f(0x169)]===0x0)return[];const _0x450e1b=new Map();for(const _0x239a22 of _0x46f054){if(!_0x239a22||typeof _0x239a22!==_0x32756f(0x184)||typeof _0x239a22[_0x32756f(0x180)]!==_0x32756f(0x17e))throw CliErrors[_0x32756f(0x195)]('Skill\x20file\x20path\x20must\x20be\x20text.');const _0x7798b7=normalizeSkillRelativePath(_0x239a22[_0x32756f(0x180)]);if(_0x450e1b[_0x32756f(0x188)](_0x7798b7))throw CliErrors[_0x32756f(0x195)](_0x32756f(0x17c)+_0x7798b7);if(!isSha256Hex(_0x239a22['sha256']))throw CliErrors[_0x32756f(0x195)](_0x32756f(0x174)+_0x7798b7);if(!Number[_0x32756f(0x183)](_0x239a22[_0x32756f(0x192)])||_0x239a22['size']<0x0)throw CliErrors[_0x32756f(0x195)](_0x32756f(0x18d)+_0x7798b7);_0x450e1b[_0x32756f(0x16a)](_0x7798b7,{'path':_0x7798b7,'sha256':_0x239a22['sha256'][_0x32756f(0x173)](),'size':_0x239a22['size']});}return Array[_0x32756f(0x17f)](_0x450e1b[_0x32756f(0x185)]())[_0x32756f(0x178)](compareSkillFiles);}export function scanSkillDirectory(_0x210c54,_0x3e0212={}){const _0x4d5401=a155_0x46a5,_0x2747e1=realpathSync(_0x210c54),_0x2731cd=canonicalExcludedFilePaths(_0x3e0212[_0x4d5401(0x172)]),_0x496a8b=[];function _0x32febd(_0x13dd99){const _0x1bcbfa=_0x4d5401,_0x48fde8=readdirSync(_0x13dd99,{'withFileTypes':!![]})[_0x1bcbfa(0x178)]((_0x1d6953,_0x43870b)=>_0x1d6953[_0x1bcbfa(0x179)][_0x1bcbfa(0x167)](_0x43870b['name']));for(const _0x48f598 of _0x48fde8){if(_0x48f598[_0x1bcbfa(0x18e)]()&&IGNORED_DIR_NAMES['has'](_0x48f598['name']))continue;if(IGNORED_FILE_NAMES[_0x1bcbfa(0x188)](_0x48f598['name']))continue;const _0xd356c7=resolve(_0x13dd99,_0x48f598['name']);if(isExcludedFilePath(_0xd356c7,_0x2731cd))continue;if(_0x48f598['isSymbolicLink']())throw CliErrors[_0x1bcbfa(0x195)]('Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20'+_0xd356c7);const _0x31a0e2=toPosixPath(relative(_0x2747e1,_0xd356c7));if(_0x48f598[_0x1bcbfa(0x18e)]()){_0x32febd(_0xd356c7);continue;}if(!_0x48f598['isFile']())continue;validateSkillRelativePath(_0x31a0e2);const _0x38b27d=readFileSync(_0xd356c7);_0x496a8b[_0x1bcbfa(0x16f)]({'path':_0x31a0e2,'bytes':_0x38b27d});}}return _0x32febd(_0x2747e1),normalizeLocalFiles(_0x496a8b);}function canonicalExcludedFilePaths(_0x31aa9b){const _0x51b3d9=a155_0x46a5,_0x1f56e7=new Set();for(const _0x4b21cb of _0x31aa9b??[]){const _0x3708ff=resolve(_0x4b21cb);_0x1f56e7[_0x51b3d9(0x16e)](_0x3708ff);try{_0x1f56e7['add'](realpathSync(_0x3708ff));}catch{}}return _0x1f56e7;}function a155_0xa4ed(){const _0x5c33ce=['Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20','string','from','path','8cABvXq','224340aNgIDy','isSafeInteger','object','values','5672820swtwng','42WiOflU','has','toString','includes','11280296QMqMlI','isArray','Skill\x20file\x20size\x20is\x20invalid:\x20','isDirectory','75146oSqihX','bytes','986380dLlgDF','size','164kvBbZo','compare','validation','Skill\x20file\x20path\x20must\x20be\x20text.','localeCompare','66jqPbNU','length','set','Unsafe\x20Skill\x20file\x20path:\x20','split','Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20','add','push','trim','content','excludedFilePaths','toLowerCase','Skill\x20file\x20sha256\x20is\x20invalid:\x20','3189657baWeZX','isBuffer','utf8','sort','name','9MCFOfT','50045PYGtbc','Duplicate\x20Skill\x20file\x20path:\x20'];a155_0xa4ed=function(){return _0x5c33ce;};return a155_0xa4ed();}function isExcludedFilePath(_0x53df76,_0x255260){const _0x423e6f=a155_0x46a5;if(_0x255260[_0x423e6f(0x188)](_0x53df76))return!![];if(_0x255260[_0x423e6f(0x192)]===0x0)return![];try{return _0x255260[_0x423e6f(0x188)](realpathSync(_0x53df76));}catch{return![];}}export function compareSkillFiles(_0x2d5127,_0x1573eb){const _0x2698b8=a155_0x46a5;if(_0x2d5127[_0x2698b8(0x180)]===SKILL_FILE)return _0x1573eb['path']===SKILL_FILE?0x0:-0x1;if(_0x1573eb[_0x2698b8(0x180)]===SKILL_FILE)return 0x1;return Buffer[_0x2698b8(0x194)](Buffer[_0x2698b8(0x17f)](_0x2d5127[_0x2698b8(0x180)],'utf8'),Buffer[_0x2698b8(0x17f)](_0x1573eb[_0x2698b8(0x180)],_0x2698b8(0x177)));}export function normalizeSkillRelativePath(_0x4432d7){const _0x24a67c=a155_0x46a5,_0x418fbf=toPosixPath(_0x4432d7[_0x24a67c(0x170)]());return validateSkillRelativePath(_0x418fbf),_0x418fbf;}export function validateSkillRelativePath(_0x1b3576){const _0x14be2e=a155_0x46a5;if(!_0x1b3576||_0x1b3576['startsWith']('/')||_0x1b3576[_0x14be2e(0x18a)]('//'))throw CliErrors[_0x14be2e(0x195)](_0x14be2e(0x16b)+_0x1b3576);for(const _0x30b7fa of _0x1b3576[_0x14be2e(0x16c)]('/')){if(!_0x30b7fa||_0x30b7fa==='.'||_0x30b7fa==='..')throw CliErrors[_0x14be2e(0x195)]('Unsafe\x20Skill\x20file\x20path:\x20'+_0x1b3576);}}export function toPosixPath(_0x48c287){return _0x48c287['replace'](/\\/g,'/');}export function isSha256Hex(_0x1758fe){const _0x7736a0=a155_0x46a5;return typeof _0x1758fe===_0x7736a0(0x17e)&&/^[a-fA-F0-9]{64}$/['test'](_0x1758fe);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x17b248,_0x539082){const _0x2f08e9=a156_0x15ca,_0x5164de=_0x17b248();while(!![]){try{const _0x3cce1d=parseInt(_0x2f08e9(0xb7))/0x1*(-parseInt(_0x2f08e9(0xc5))/0x2)+-parseInt(_0x2f08e9(0xa8))/0x3*(-parseInt(_0x2f08e9(0xaf))/0x4)+-parseInt(_0x2f08e9(0xbb))/0x5+-parseInt(_0x2f08e9(0xab))/0x6+parseInt(_0x2f08e9(0xd6))/0x7+parseInt(_0x2f08e9(0xd3))/0x8*(parseInt(_0x2f08e9(0xbe))/0x9)+-parseInt(_0x2f08e9(0xcd))/0xa*(-parseInt(_0x2f08e9(0xc4))/0xb);if(_0x3cce1d===_0x539082)break;else _0x5164de['push'](_0x5164de['shift']());}catch(_0x53fa9f){_0x5164de['push'](_0x5164de['shift']());}}}(a156_0x4cd1,0xe8f29));function a156_0x4cd1(){const _0x19d5fc=['appCode','displayName','join','keys','Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20','name:\x20','name','accessKey','---','replace','toString','slice','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','798ugMIMr','status','schemaVersion','8621076nLtTuE','example','.\x20Changed\x20file:\x20','flow','10932RITqpT','validation','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','trimEnd','map','paths','description','isFile','1gNskas','force','hasOwn','length','5220975NDSjQy','skillCode','contentHash','860193lZjAbn','test','set','packageBytes','path','contents','517tOAdsV','2069338fVwbTZ','match','displayName:\x20','find','skillName','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.','has','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','132670ffLLEF','stringify','entries','Managed\x20file\x20was\x20removed\x20locally:\x20','fileHashes','filter','120OrAKlx','pulledAt','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','11799767JzpRQM','trim','scope','Runtime\x20Skill\x20package\x20is\x20missing\x20','env'];a156_0x4cd1=function(){return _0x19d5fc;};return a156_0x4cd1();}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';function a156_0x15ca(_0x4833ff,_0x35bac1){_0x4833ff=_0x4833ff-0xa7;const _0x4cd1c8=a156_0x4cd1();let _0x15ca9c=_0x4cd1c8[_0x4833ff];return _0x15ca9c;}import{getRuntimeSkillDir}from'./paths.js';import{extractDownloadedPackage,requirePackageBytes}from'./zip-package.js';export function materializeRuntimeSkill(_0x23845c,_0x3dd9d2,_0x5e6479){const _0x25a6d2=a156_0x15ca,_0x568d15=requireSkillCode(_0x23845c),_0x610ef3=requirePackageBytes(_0x568d15,_0x5e6479[_0x25a6d2(0xc1)]),_0x43441a=extractDownloadedPackage(_0x610ef3),_0x302201=_0x43441a[_0x25a6d2(0xc8)](_0x958fd6=>_0x958fd6[_0x25a6d2(0xc2)]===SKILL_FILE);if(!_0x302201)throw CliErrors[_0x25a6d2(0xb0)](_0x25a6d2(0xd9)+SKILL_FILE+':\x20'+_0x568d15);const _0xec96c4=withMaterializedSkillFrontmatter(_0x43441a,_0x23845c,_0x568d15),_0x4a796d=_0xec96c4[_0x25a6d2(0xc8)](_0x22deb1=>_0x22deb1['path']===SKILL_FILE),_0x4a2073=fileText(_0x4a796d),_0x4d9383=getRuntimeSkillDir(_0x5e6479['env'],_0x5e6479[_0x25a6d2(0xe2)],_0x5e6479['appCode'],_0x3dd9d2,_0x568d15,_0x5e6479[_0x25a6d2(0xb4)]),_0x2c3420=resolve(_0x4d9383,SKILL_FILE),_0x1d89ec=resolve(_0x4d9383,METADATA_FILE),_0x7f0b8c=contentHash(_0x4a2073),_0x482996=readMetadataIfPresent(_0x1d89ec)?.[_0x25a6d2(0xd1)];ensurePulledFilesCanBeOverwritten(_0x4d9383,_0x1d89ec,_0xec96c4,_0x5e6479[_0x25a6d2(0xb8)]===!![]),mkdirSync(_0x4d9383,{'recursive':!![],'mode':0x1c0});const _0x23dd68=existsSync(_0x2c3420)?readFileSync(_0x2c3420,'utf8'):undefined;return materializeFiles(_0x4d9383,_0xec96c4),removeStaleManagedFiles(_0x4d9383,_0x482996,_0xec96c4),writeJsonAtomic(_0x1d89ec,buildMetadata(_0x23845c,_0x3dd9d2,_0x5e6479['appCode'],_0x7f0b8c,_0x5e6479[_0x25a6d2(0xd4)],_0xec96c4,_0x610ef3)),{'skill':_0x23845c,'scope':_0x3dd9d2,'dir':_0x4d9383,'skillMdPath':_0x2c3420,'metadataPath':_0x1d89ec,'contentHash':_0x7f0b8c,'changed':_0x23dd68!==_0x4a2073};}export function reuseMaterializedRuntimeSkill(_0x31447a,_0x5b6960,_0x349e4b){const _0x1d3e44=a156_0x15ca,_0x499aba=_0x31447a['version']?.['trim']();if(!_0x499aba)return undefined;const _0x43e380=requireSkillCode(_0x31447a),_0x2879d0=getRuntimeSkillDir(_0x349e4b[_0x1d3e44(0xda)],_0x349e4b[_0x1d3e44(0xe2)],_0x349e4b['appCode'],_0x5b6960,_0x43e380,_0x349e4b['paths']),_0x2cf032=resolve(_0x2879d0,SKILL_FILE),_0x59ccd0=resolve(_0x2879d0,METADATA_FILE),_0x4a6bd4=readMetadataIfPresent(_0x59ccd0);if(!_0x4a6bd4||_0x4a6bd4[_0x1d3e44(0xaa)]!==0x2||_0x4a6bd4['appCode']!==_0x349e4b[_0x1d3e44(0xdb)]||_0x4a6bd4[_0x1d3e44(0xd8)]!==_0x5b6960||_0x4a6bd4[_0x1d3e44(0xbc)]!==_0x43e380||_0x4a6bd4['version']!==_0x499aba||_0x4a6bd4['id']!==_0x31447a['id']||_0x4a6bd4['skillName']!==_0x31447a['skillName']||_0x4a6bd4[_0x1d3e44(0xb5)]!==_0x31447a[_0x1d3e44(0xb5)]||_0x4a6bd4[_0x1d3e44(0xac)]!==_0x31447a['example']||_0x4a6bd4[_0x1d3e44(0xa9)]!==_0x31447a[_0x1d3e44(0xa9)]||!_0x4a6bd4[_0x1d3e44(0xbd)]||!_0x4a6bd4[_0x1d3e44(0xd1)]||!Object[_0x1d3e44(0xb9)](_0x4a6bd4[_0x1d3e44(0xd1)],SKILL_FILE))return undefined;for(const [_0x240b39,_0x29de40]of Object[_0x1d3e44(0xcf)](_0x4a6bd4[_0x1d3e44(0xd1)])){if(!/^[a-f0-9]{64}$/[_0x1d3e44(0xbf)](_0x29de40))return undefined;const _0x547c2b=resolveManagedFilePath(_0x2879d0,_0x240b39);if(!existsSync(_0x547c2b)||!lstatSync(_0x547c2b)[_0x1d3e44(0xb6)]())return undefined;if(bufferSha256(readFileSync(_0x547c2b))!==_0x29de40)return undefined;}return{'skill':_0x31447a,'scope':_0x5b6960,'dir':_0x2879d0,'skillMdPath':_0x2cf032,'metadataPath':_0x59ccd0,'contentHash':_0x4a6bd4[_0x1d3e44(0xbd)],'changed':![]};}function withMaterializedSkillFrontmatter(_0x39e686,_0x30495a,_0x45277c){const _0x2c49cf=a156_0x15ca,_0x592630=skillDisplayName(_0x30495a,_0x45277c),_0x5368b7=_0x30495a[_0x2c49cf(0xb5)]?.[_0x2c49cf(0xd7)]()||_0x592630||_0x45277c;return normalizeLocalFiles(_0x39e686)[_0x2c49cf(0xb3)](_0x1f765d=>{const _0x217dbc=_0x2c49cf,_0x389895=fileText(_0x1f765d);if(_0x1f765d[_0x217dbc(0xc2)]!==SKILL_FILE)return _0x1f765d;if(hasYamlFrontmatter(_0x389895))return{'path':_0x1f765d['path'],'content':withSyncedDisplayName(_0x389895,_0x592630)};return{'path':_0x1f765d[_0x217dbc(0xc2)],'content':prependSkillFrontmatter(_0x389895,{'name':_0x45277c,'displayName':_0x592630,'description':_0x5368b7})};});}function hasYamlFrontmatter(_0x2a9c8a){const _0x518f2c=a156_0x15ca;return/^\uFEFF?---\s*\r?\n/[_0x518f2c(0xbf)](_0x2a9c8a);}function prependSkillFrontmatter(_0x1ddc40,_0xac208f){const _0x1ec6e4=a156_0x15ca,_0x438b29=_0x1ddc40[_0x1ec6e4(0xe4)](/^\uFEFF/,'');return[_0x1ec6e4(0xe3),_0x1ec6e4(0xe0)+yamlString(_0xac208f[_0x1ec6e4(0xe1)]),_0xac208f['displayName']?_0x1ec6e4(0xc7)+yamlString(_0xac208f[_0x1ec6e4(0xdc)]):undefined,'description:\x20'+yamlString(_0xac208f[_0x1ec6e4(0xb5)]),_0x1ec6e4(0xe3),'',_0x438b29][_0x1ec6e4(0xd2)](_0x3285d7=>_0x3285d7!==undefined)[_0x1ec6e4(0xdd)]('\x0a');}function yamlString(_0x58306f){const _0xe943dd=a156_0x15ca;return JSON[_0xe943dd(0xce)](_0x58306f[_0xe943dd(0xe4)](/\r/g,'')[_0xe943dd(0xd7)]());}function skillDisplayName(_0x380765,_0x5c6bc5){const _0x443112=a156_0x15ca,_0x47b7b0=_0x380765[_0x443112(0xc9)]?.['trim']();return _0x47b7b0||_0x5c6bc5;}function withSyncedDisplayName(_0x3cb360,_0x48a4aa){const _0x523a65=a156_0x15ca,_0x5202c0=_0x3cb360[_0x523a65(0xc6)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x5202c0)return _0x3cb360;const _0x3aa49b=_0x5202c0[0x1]??'',_0x1fa895=_0x5202c0[0x2]??'',_0x1da62d=parseDocument(_0x1fa895);if(_0x1da62d['errors'][_0x523a65(0xba)]>0x0||!isMap(_0x1da62d[_0x523a65(0xc3)]))return _0x3cb360;if(_0x48a4aa)_0x1da62d[_0x523a65(0xc0)](_0x523a65(0xdc),_0x48a4aa);else{if(_0x1da62d['has'](_0x523a65(0xdc)))_0x1da62d['delete']('displayName');else return _0x3cb360;}forceBlockCollections(_0x1da62d[_0x523a65(0xc3)]);const _0x49ca28=_0x1da62d[_0x523a65(0xe5)]({'lineWidth':0x0})[_0x523a65(0xb2)](),_0x2116c9=_0x3cb360[_0x523a65(0xe6)](_0x5202c0[0x0][_0x523a65(0xba)])[_0x523a65(0xe4)](/^\r?\n/,'');return _0x3aa49b+'---\x0a'+_0x49ca28+'\x0a---\x0a\x0a'+_0x2116c9;}function forceBlockCollections(_0x4f271f){if(!isNode(_0x4f271f))return;visit(_0x4f271f,(_0x4b3baa,_0x243139)=>{const _0x2d4697=a156_0x15ca;isCollection(_0x243139)&&(_0x243139[_0x2d4697(0xae)]=![]);});}function ensurePulledFilesCanBeOverwritten(_0x1d8fdb,_0x477c0e,_0x5cb99c,_0x146414){const _0x154965=a156_0x15ca;if(_0x146414||!existsSync(_0x477c0e))return;const _0xd3d91=readMetadataIfPresent(_0x477c0e);if(!_0xd3d91)return;const _0x2dbd50=_0xd3d91[_0x154965(0xd1)]&&Object[_0x154965(0xde)](_0xd3d91[_0x154965(0xd1)])[_0x154965(0xba)]>0x0?_0xd3d91[_0x154965(0xd1)]:undefined;if(_0x2dbd50)for(const [_0x4fea05,_0x577879]of Object[_0x154965(0xcf)](_0x2dbd50)){const _0x3f69d2=resolveManagedFilePath(_0x1d8fdb,_0x4fea05);if(!existsSync(_0x3f69d2))throw CliErrors['validation']('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x1d8fdb,_0x154965(0xd0)+_0x4fea05);const _0x2ab7bc=lstatSync(_0x3f69d2);if(!_0x2ab7bc[_0x154965(0xb6)]())throw CliErrors[_0x154965(0xb0)](_0x154965(0xd5)+_0x1d8fdb,_0x154965(0xdf)+_0x4fea05);const _0xfcdf71=bufferSha256(readFileSync(_0x3f69d2));if(_0xfcdf71!==_0x577879)throw CliErrors[_0x154965(0xb0)](_0x154965(0xd5)+_0x1d8fdb+_0x154965(0xad)+_0x4fea05,_0x154965(0xa7)+_0x4fea05);}else{const _0x4df8aa=resolve(_0x1d8fdb,SKILL_FILE);if(existsSync(_0x4df8aa)&&_0xd3d91[_0x154965(0xbd)]){const _0x1e5c61=contentHash(readFileSync(_0x4df8aa,'utf8'));if(_0x1e5c61!==_0xd3d91[_0x154965(0xbd)])throw CliErrors['validation'](_0x154965(0xb1)+_0x4df8aa,_0x154965(0xca));}}for(const _0x160c35 of normalizeLocalFiles(_0x5cb99c)){if(_0x2dbd50?.[_0x160c35['path']])continue;if(!_0x2dbd50&&_0x160c35[_0x154965(0xc2)]===SKILL_FILE)continue;const _0xf7492c=resolveManagedFilePath(_0x1d8fdb,_0x160c35['path']);if(!existsSync(_0xf7492c))continue;const _0x524927=lstatSync(_0xf7492c);if(!_0x524927[_0x154965(0xb6)]())throw CliErrors[_0x154965(0xb0)](_0x154965(0xd5)+_0x1d8fdb,_0x154965(0xcc)+_0x160c35[_0x154965(0xc2)]);const _0x372117=bufferSha256(readFileSync(_0xf7492c));if(_0x372117!==fileHash(_0x160c35))throw CliErrors[_0x154965(0xb0)](_0x154965(0xd5)+_0x1d8fdb,'Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20'+_0x160c35[_0x154965(0xc2)]);}}function materializeFiles(_0x217442,_0x264d9b){const _0x356d86=a156_0x15ca;for(const _0x1e9ab2 of normalizeLocalFiles(_0x264d9b)){const _0x2d72ee=resolveManagedFilePath(_0x217442,_0x1e9ab2[_0x356d86(0xc2)]);mkdirSync(dirname(_0x2d72ee),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x2d72ee,fileContent(_0x1e9ab2),0x180);}}function removeStaleManagedFiles(_0x242803,_0x18d906,_0x61f0a8){const _0x4bee9f=a156_0x15ca;if(!_0x18d906)return;const _0x38fbbd=new Set(normalizeLocalFiles(_0x61f0a8)[_0x4bee9f(0xb3)](_0x32c8e1=>_0x32c8e1[_0x4bee9f(0xc2)]));for(const _0x1efd08 of Object[_0x4bee9f(0xde)](_0x18d906)){if(_0x38fbbd[_0x4bee9f(0xcb)](_0x1efd08))continue;const _0x1d7f2b=resolveManagedFilePath(_0x242803,_0x1efd08);existsSync(_0x1d7f2b)&&lstatSync(_0x1d7f2b)['isFile']()&&rmSync(_0x1d7f2b,{'force':!![]});}}
|
|
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 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xfad9c7,_0x58920b){const _0x4f4614=a157_0x3ca7,_0x33a311=_0xfad9c7();while(!![]){try{const _0x3acebd=-parseInt(_0x4f4614(0x1b3))/0x1+-parseInt(_0x4f4614(0x1c5))/0x2+-parseInt(_0x4f4614(0x1cb))/0x3+parseInt(_0x4f4614(0x1cd))/0x4*(parseInt(_0x4f4614(0x1cf))/0x5)+parseInt(_0x4f4614(0x1be))/0x6*(parseInt(_0x4f4614(0x1bc))/0x7)+-parseInt(_0x4f4614(0x1c8))/0x8+parseInt(_0x4f4614(0x1c7))/0x9*(parseInt(_0x4f4614(0x1d1))/0xa);if(_0x3acebd===_0x58920b)break;else _0x33a311['push'](_0x33a311['shift']());}catch(_0x4d14eb){_0x33a311['push'](_0x33a311['shift']());}}}(a157_0x6e0d,0xc0888));function a157_0x3ca7(_0x22f0e2,_0x1f509d){_0x22f0e2=_0x22f0e2-0x1b2;const _0x6e0d47=a157_0x6e0d();let _0x3ca71e=_0x6e0d47[_0x22f0e2];return _0x3ca71e;}function a157_0x6e0d(){const _0x210c83=['326226NjvBHF','forkedFromSkillId','8GNpdhk','manifest','1589655rWKPLQ','Invalid\x20','1850iPdkIh','personal','1388475OAyKab','length','readonly','validation','tags','status','map','toISOString','string','7cgjXKo','files','6265698Xhflhr','forkedFromVersion','fromEntries','zipSize','isArray','path','example','2035258LSyFFY','hasUpstreamUpdate','122202HZhsli','7108904cAohFY','trim','parse'];a157_0x6e0d=function(){return _0x210c83;};return a157_0x6e0d();}import{existsSync,readFileSync}from'node:fs';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';import{fileContent,normalizeLocalFiles}from'./local-files.js';import{buildSkillPackage,localFilesToManifestFiles}from'./zip-package.js';export function buildMetadata(_0x3cbf57,_0x13b229,_0x3024d4,_0x5b1af7,_0x326e51,_0x58c10d,_0x3fa630){const _0x17bfc1=a157_0x3ca7,_0x5a43b8=_0x58c10d?normalizeLocalFiles(_0x58c10d):[],_0x53ef77=!_0x3fa630&&_0x5a43b8['length']>0x0?buildSkillPackage(_0x5a43b8):undefined,_0x27ff6f=_0x3fa630?bufferSha256(_0x3fa630):_0x53ef77?.[_0x17bfc1(0x1ce)]['zipSha256'],_0x4a65b5=_0x3fa630?.[_0x17bfc1(0x1b4)]??_0x53ef77?.[_0x17bfc1(0x1ce)][_0x17bfc1(0x1c1)],_0x311731=_0x5a43b8[_0x17bfc1(0x1b4)]>0x0?Object[_0x17bfc1(0x1c0)](_0x5a43b8[_0x17bfc1(0x1b9)](_0x133082=>[_0x133082[_0x17bfc1(0x1c3)],fileHash(_0x133082)])):undefined;return{'schemaVersion':_0x5a43b8[_0x17bfc1(0x1b4)]>0x0?0x2:0x1,'id':_0x3cbf57['id'],'appCode':_0x3024d4,'skillCode':requireSkillCode(_0x3cbf57),'skillName':_0x3cbf57['skillName'],'description':_0x3cbf57['description'],'example':_0x3cbf57[_0x17bfc1(0x1c4)],'scope':_0x13b229,'readonly':_0x13b229!==_0x17bfc1(0x1b2)||_0x3cbf57[_0x17bfc1(0x1b5)]===!![],'tenantCode':_0x3cbf57['tenantCode'],'userId':_0x3cbf57['userId'],'version':_0x3cbf57['version'],'status':_0x3cbf57[_0x17bfc1(0x1b8)],'tags':Array[_0x17bfc1(0x1c2)](_0x3cbf57['tags'])?_0x3cbf57[_0x17bfc1(0x1b7)]:[],'hasUpstreamUpdate':_0x3cbf57[_0x17bfc1(0x1c6)],'forkedFromSkillId':_0x3cbf57[_0x17bfc1(0x1cc)],'forkedFromVersion':_0x3cbf57[_0x17bfc1(0x1bf)],'sourceSessionId':_0x3cbf57['sourceSessionId'],'contentHash':_0x5b1af7,'fileHashes':_0x311731,'treeHash':_0x5a43b8[_0x17bfc1(0x1b4)]>0x0?fileTreeHash(localFilesToManifestFiles(_0x5a43b8)):undefined,'ossPath':remoteManifestOssPath(_0x3cbf57[_0x17bfc1(0x1bd)]),'zipSha256':_0x27ff6f,'zipSize':_0x4a65b5,'files':_0x5a43b8[_0x17bfc1(0x1b4)]>0x0?_0x5a43b8['map'](_0x3683d3=>({'path':_0x3683d3[_0x17bfc1(0x1c3)],'hash':fileHash(_0x3683d3),'size':fileContent(_0x3683d3)[_0x17bfc1(0x1b4)]})):undefined,'pulledAt':_0x326e51??new Date()[_0x17bfc1(0x1ba)]()};}export function requireSkillCode(_0x21ab66){const _0x213b89=a157_0x3ca7,_0x2565f9=_0x21ab66['skillCode']?.[_0x213b89(0x1c9)]();if(!_0x2565f9)throw CliErrors[_0x213b89(0x1b6)]('Runtime\x20Skill\x20is\x20missing\x20skillCode.');return _0x2565f9;}export function readMetadataIfPresent(_0x2c9fbf){const _0x121f23=a157_0x3ca7;if(!existsSync(_0x2c9fbf))return undefined;try{const _0x148433=JSON[_0x121f23(0x1ca)](readFileSync(_0x2c9fbf,'utf8'));return _0x148433;}catch{throw CliErrors[_0x121f23(0x1b6)](_0x121f23(0x1d0)+METADATA_FILE+':\x20'+_0x2c9fbf);}}function remoteManifestOssPath(_0x4f236b){const _0x4af17e=a157_0x3ca7;if(!_0x4f236b||typeof _0x4f236b!=='object'||Array[_0x4af17e(0x1c2)](_0x4f236b))return undefined;const _0x4b0286=_0x4f236b['ossPath'];return typeof _0x4b0286===_0x4af17e(0x1bb)&&_0x4b0286[_0x4af17e(0x1c9)]()?_0x4b0286[_0x4af17e(0x1c9)]():undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a158_0x2dcaa9=a158_0x308c;(function(_0x462219,_0x21300e){const _0x55f927=a158_0x308c,_0x2169ef=_0x462219();while(!![]){try{const _0x40564f=-parseInt(_0x55f927(0x1d0))/0x1+parseInt(_0x55f927(0x1cf))/0x2+-parseInt(_0x55f927(0x1e4))/0x3+parseInt(_0x55f927(0x1d4))/0x4*(-parseInt(_0x55f927(0x1cd))/0x5)+-parseInt(_0x55f927(0x1d7))/0x6*(-parseInt(_0x55f927(0x1d5))/0x7)+-parseInt(_0x55f927(0x1d9))/0x8+parseInt(_0x55f927(0x1d6))/0x9*(parseInt(_0x55f927(0x1dc))/0xa);if(_0x40564f===_0x21300e)break;else _0x2169ef['push'](_0x2169ef['shift']());}catch(_0x2115e9){_0x2169ef['push'](_0x2169ef['shift']());}}}(a158_0xde93,0x927b2));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';function a158_0xde93(){const _0x47aa6c=['1030662rgEqmt','142810RJtwYy','agentsSkillsDir','skills','path\x20segment','2232jTKeJh','1813QGLqnp','19485729MYmcXs','3786juUFnX','trim','6232624vNyeDV','Unsafe\x20','workbuddySkillsDir','10PeLZYf','homeDir','homeDirName','SKILL_ROOT','filter','includes','CLAUDE_SKILL_ROOT','cacheRoot','2280183ydSdIA','claudeSkillsDir','skillCode','5035haufNR','.workbuddy'];a158_0xde93=function(){return _0x47aa6c;};return a158_0xde93();}function a158_0x308c(_0x5af389,_0x14274e){_0x5af389=_0x5af389-0x1cc;const _0xde933b=a158_0xde93();let _0x308c2d=_0xde933b[_0x5af389];return _0x308c2d;}import{CliErrors}from'../../errors.js';export function resolveSkillSyncPaths(_0x115c2c={}){const _0xfe2a0d=a158_0x308c,_0x34963b=_0x115c2c[_0xfe2a0d(0x1dd)]??homedir(),_0x5d17b7=resolve(_0x34963b,PRODUCT_CONFIG[_0xfe2a0d(0x1de)],'cache'),_0xf9446=trimmedEnv(_0xfe2a0d(0x1df)),_0x36bdb6=trimmedEnv(_0xfe2a0d(0x1e2)),_0xcf82aa=resolve(_0x34963b,_0xfe2a0d(0x1ce)),_0x462ae7=_0x115c2c['workbuddySkillsDir']??(existsSync(_0xcf82aa)?resolve(_0xcf82aa,'skills'):undefined);return{'homeDir':_0x34963b,'cacheRoot':_0x5d17b7,'managedRoot':resolve(_0x34963b,PRODUCT_CONFIG[_0xfe2a0d(0x1de)]),'agentsSkillsDir':_0x115c2c['agentsSkillsDir']??_0xf9446??resolve(_0x34963b,'.agents',_0xfe2a0d(0x1d2)),'claudeSkillsDir':_0x115c2c[_0xfe2a0d(0x1e5)]??_0x36bdb6??resolve(_0x34963b,'.claude',_0xfe2a0d(0x1d2)),'workbuddySkillsDir':_0x462ae7};}export function runtimeAgentSkillRoots(_0x2551d2){const _0x460826=a158_0x308c;return[_0x2551d2[_0x460826(0x1d1)],_0x2551d2['claudeSkillsDir'],_0x2551d2[_0x460826(0x1db)]][_0x460826(0x1e0)](_0x5828cb=>Boolean(_0x5828cb));}export function getRuntimeSkillCacheRoot(_0x4e5834,_0x306e06,_0x49f960={}){const _0x24bf2a=a158_0x308c,_0x2f2882=resolveSkillSyncPaths(_0x49f960);return resolve(_0x2f2882[_0x24bf2a(0x1e3)],_0x4e5834,fingerprintAccessKey(_0x306e06),'skills');}export function getRuntimeSkillDir(_0x326ef3,_0x5f3b2d,_0x6cbf9,_0x23a816,_0x3c3be1,_0x1434ac={}){const _0x2721e6=a158_0x308c;return resolve(getRuntimeSkillCacheRoot(_0x326ef3,_0x5f3b2d,_0x1434ac),safePathSegment(_0x6cbf9,'appCode'),_0x23a816,safePathSegment(_0x3c3be1,_0x2721e6(0x1cc)));}export function safePathSegment(_0x4ccecb,_0x3501e0=a158_0x2dcaa9(0x1d3)){const _0x200449=a158_0x2dcaa9;if(!_0x4ccecb||_0x4ccecb['includes']('/')||_0x4ccecb[_0x200449(0x1e1)]('\x5c')||_0x4ccecb['includes']('..'))throw CliErrors['validation'](_0x200449(0x1da)+_0x3501e0+'\x20for\x20local\x20path:\x20'+_0x4ccecb);return _0x4ccecb;}function trimmedEnv(_0x420798){const _0x53adbd=a158_0x2dcaa9,_0x37e24c=productEnv(_0x420798)?.[_0x53adbd(0x1d8)]();return _0x37e24c?_0x37e24c:undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0xf09fa5,_0x199e55){const _0x39e474=a159_0x3db2,_0x3d83cf=_0xf09fa5();while(!![]){try{const _0x347f1f=parseInt(_0x39e474(0x1df))/0x1*(parseInt(_0x39e474(0x1da))/0x2)+-parseInt(_0x39e474(0x1c4))/0x3*(parseInt(_0x39e474(0x1d0))/0x4)+-parseInt(_0x39e474(0x1d3))/0x5+parseInt(_0x39e474(0x1d6))/0x6+-parseInt(_0x39e474(0x1bf))/0x7+parseInt(_0x39e474(0x1b4))/0x8+parseInt(_0x39e474(0x1a6))/0x9*(parseInt(_0x39e474(0x1e1))/0xa);if(_0x347f1f===_0x199e55)break;else _0x3d83cf['push'](_0x3d83cf['shift']());}catch(_0x5b809a){_0x3d83cf['push'](_0x3d83cf['shift']());}}}(a159_0x5987,0xc4596));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a159_0x5b8564}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_0x5987(){const _0x59dad8=['Skill\x20directory\x20not\x20found:\x20','\x20has\x20scope=\x22','skillCode','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20','scope','skillName','pushedAt','32lacHIL','content','\x20has\x20unsupported\x20scope\x20\x22','1478500hBkxZF','version','trim','1558224XZLtfx','startsWith','isFile','ignoreMetadataSkillCode','15362sakjZj','boolean','dir','object','displayName','209YZahRE','personal','627130cmbFXE','some','\x20to\x20submit\x20company\x20Skills\x20for\x20review.','(unknown)','Remote\x20Skill\x20','toLowerCase','153HwPArg','number','\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22','sourceSessionId','company','excludedFilePaths','metadata','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20','targetScope','utf8','\x20name\x20for\x20SkillHub\x20slug\x20generation.','replace','validation','string','7782728jXEBaT','ignoreMetadataForPayload','isSymbolicLink','manifest','refreshedAt','example','tags','appCode','allowAppCodeRetarget','Invalid\x20','ignoreMetadataScope','8784727iUpzUC','Missing\x20','name','find','description','580908nZGwoI','files','ignoreInvalidMetadata','match','path'];a159_0x5987=function(){return _0x59dad8;};return a159_0x5987();}export function resolvePushDirectoryIdentity(_0x53892a,_0x33d234,_0x246664={}){const _0x1bc9ed=a159_0x3db2,_0x1d5303=resolvePushDirectoryRoot(_0x53892a),_0x5bca6d=readPushMetadataIfPresent(resolve(_0x1d5303,METADATA_FILE),{'ignoreInvalidMetadata':_0x246664[_0x1bc9ed(0x1c6)]});if(_0x5bca6d?.[_0x1bc9ed(0x1bb)]&&_0x5bca6d[_0x1bc9ed(0x1bb)]!==_0x33d234&&!_0x246664[_0x1bc9ed(0x1bc)]&&!_0x246664['ignoreMetadataAppCodeMismatch'])throw CliErrors['validation']('Skill\x20metadata\x20appCode\x20\x22'+_0x5bca6d[_0x1bc9ed(0x1bb)]+_0x1bc9ed(0x1a8)+_0x33d234+'\x22.');const _0x445e2b=resolvePushSkillCode(_0x1d5303,_0x33d234,_0x5bca6d,_0x246664);if(!_0x445e2b)throw CliErrors[_0x1bc9ed(0x1b2)]('Unable\x20to\x20resolve\x20skillCode\x20from\x20'+SKILL_FILE+',\x20'+METADATA_FILE+',\x20or\x20directory\x20name.');return{'dir':_0x1d5303,'skillCode':_0x445e2b,'metadata':_0x5bca6d};}export function readPushDirectory(_0xed1380,_0xb3af8d,_0x1ea1e2={}){const _0x3f27b1=a159_0x3db2,_0x3b3186=resolvePushDirectoryIdentity(_0xed1380,_0xb3af8d,_0x1ea1e2),_0x391109=_0x3b3186[_0x3f27b1(0x1dc)],_0x5c6a63=resolve(_0x391109,SKILL_FILE);if(!existsSync(_0x5c6a63)||!lstatSync(_0x5c6a63)[_0x3f27b1(0x1d8)]())throw CliErrors[_0x3f27b1(0x1b2)](_0x3f27b1(0x1c0)+SKILL_FILE+':\x20'+_0x5c6a63);const _0x426e80=_0x3b3186[_0x3f27b1(0x1ac)],_0x836e36=_0x1ea1e2[_0x3f27b1(0x1ae)]??_0x3f27b1(0x1e0);if(!_0x1ea1e2[_0x3f27b1(0x1be)]&&_0x426e80?.[_0x3f27b1(0x1cd)]==='builtin')throw CliErrors['validation']('Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20'+METADATA_FILE+_0x3f27b1(0x1ca)+_0x426e80[_0x3f27b1(0x1cd)]+'\x22.');if(!_0x1ea1e2[_0x3f27b1(0x1be)]&&_0x836e36==='personal'&&_0x426e80?.['scope']&&_0x426e80[_0x3f27b1(0x1cd)]!==_0x3f27b1(0x1e0))throw CliErrors[_0x3f27b1(0x1b2)](_0x3f27b1(0x1cc)+METADATA_FILE+_0x3f27b1(0x1ca)+_0x426e80['scope']+'\x22.',_0x3f27b1(0x1ad)+_0x391109+_0x3f27b1(0x1e3));const _0x548df3=scanSkillDirectory(_0x391109,{'excludedFilePaths':_0x1ea1e2[_0x3f27b1(0x1ab)]}),_0x43d6c1=buildSkillPackage(_0x548df3),_0x8b54b9=readFileSync(_0x5c6a63,'utf8'),_0x16ba01=_0x3b3186[_0x3f27b1(0x1cb)],_0x498d52=_0x1ea1e2[_0x3f27b1(0x1b5)]?undefined:_0x426e80,_0x514a34=readSkillDisplayName(_0x8b54b9);return{'skillCode':_0x16ba01,'metadata':_0x426e80,'frontmatterDisplayName':_0x514a34,'input':{'skillCode':_0x16ba01,'skillName':_0x514a34??_0x498d52?.[_0x3f27b1(0x1ce)],'description':_0x498d52?.['description'],'content':_0x8b54b9,'files':_0x43d6c1[_0x3f27b1(0x1b7)],'packageBase64':_0x43d6c1['packageBase64'],'tags':_0x498d52?.[_0x3f27b1(0x1ba)],'version':_0x498d52?.[_0x3f27b1(0x1d4)],'sourceSessionId':_0x498d52?.['sourceSessionId']}};}export function refreshPushDirectoryMetadataFromRemote(_0x1b362d,_0x500e02,_0xf3954a,_0x126f50={}){const _0x976c2c=a159_0x3db2,_0x1c8065=resolvePushDirectoryRoot(_0x1b362d),_0x42d6b8=readPushMetadataIfPresent(resolve(_0x1c8065,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x429122=requireRemoteScope(_0x500e02),_0x4fc4fb=readLocalSkillContent(_0x1c8065),_0x1124e2={..._0x500e02,'appCode':_0x500e02[_0x976c2c(0x1bb)]??_0xf3954a,'skillName':_0x500e02[_0x976c2c(0x1ce)]??_0x42d6b8?.[_0x976c2c(0x1ce)],'description':_0x500e02[_0x976c2c(0x1c3)]??_0x42d6b8?.[_0x976c2c(0x1c3)],'example':_0x500e02[_0x976c2c(0x1b9)]??_0x42d6b8?.['example'],'tags':Array['isArray'](_0x500e02[_0x976c2c(0x1ba)])?_0x500e02[_0x976c2c(0x1ba)]:_0x42d6b8?.[_0x976c2c(0x1ba)],'sourceSessionId':_0x500e02[_0x976c2c(0x1a9)]??_0x42d6b8?.[_0x976c2c(0x1a9)],'content':_0x500e02[_0x976c2c(0x1d1)]??_0x4fc4fb},_0x4cd892=buildMetadata(_0x1124e2,_0x429122,_0xf3954a,contentHash(_0x4fc4fb),_0x126f50[_0x976c2c(0x1b8)]);writeJsonAtomic(resolve(_0x1c8065,METADATA_FILE),_0x4cd892);}export function recordPushedRuntimeSkill(_0x21d929,_0x5adea4,_0x381681,_0x2088c1={}){const _0x11d677=a159_0x3db2,_0x533e84=resolvePushDirectoryRoot(_0x21d929),_0x52695d=scanSkillDirectory(_0x533e84),_0x4807be=_0x52695d[_0x11d677(0x1c2)](_0x4fe4c6=>_0x4fe4c6['path']===SKILL_FILE),_0x4d5667=_0x4807be?fileText(_0x4807be):'',_0x43a7ba=tryNormalizePackageManifest(_0x5adea4['files']),_0x154136={..._0x5adea4,'content':_0x5adea4['content']??_0x4d5667,'files':_0x43a7ba},_0x579848=_0x43a7ba?normalizeLocalFiles(_0x52695d)['filter'](_0x2dda08=>_0x43a7ba[_0x11d677(0x1c5)][_0x11d677(0x1e2)](_0x3b050a=>_0x3b050a['path']===_0x2dda08[_0x11d677(0x1c8)])):undefined,_0x4e1e09=buildMetadata(_0x154136,_0x2088c1[_0x11d677(0x1cd)]??_0x11d677(0x1e0),_0x381681,contentHash(_0x154136[_0x11d677(0x1d1)]??''),_0x2088c1[_0x11d677(0x1cf)],_0x579848);writeJsonAtomic(resolve(_0x533e84,METADATA_FILE),_0x4e1e09);}export function deriveSkillCodeFromDirectory(_0x4170b3,_0x35fb81){const _0x3d2cc6=a159_0x3db2,_0x80697d=basename(resolve(_0x4170b3)),_0x47fedb=_0x35fb81+'--';return _0x80697d[_0x3d2cc6(0x1d7)](_0x47fedb)?_0x80697d['slice'](_0x47fedb['length']):_0x80697d;}function resolvePushSkillCode(_0x4b6a4a,_0x47a9dc,_0x4185a1,_0x9ace86){const _0x28b588=a159_0x3db2,_0x46ec99=deriveSkillCodeFromSkillFile(_0x4b6a4a)||deriveSkillCodeFromDirectory(_0x4b6a4a,_0x47a9dc);if(_0x9ace86[_0x28b588(0x1d9)])return _0x46ec99;return _0x4185a1?.[_0x28b588(0x1cb)]?.[_0x28b588(0x1d5)]()||_0x46ec99;}function deriveSkillCodeFromSkillFile(_0x607a4c){const _0x35134d=a159_0x3db2,_0xca3e9b=resolve(_0x607a4c,SKILL_FILE);if(!existsSync(_0xca3e9b)||!lstatSync(_0xca3e9b)[_0x35134d(0x1d8)]())return undefined;const _0x1856ed=readFileSync(_0xca3e9b,_0x35134d(0x1af)),_0x5f270c=_0x1856ed[_0x35134d(0x1c7)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x5f270c)return undefined;const _0x4d256b=parseFrontmatterObject(_0x5f270c[0x1]??''),_0x10969f=scalarToString(_0x4d256b?.[_0x35134d(0x1c1)]);return _0x10969f?slugifySkillName(_0x10969f):undefined;}function readSkillDisplayName(_0x1f62a4){const _0x36aa0e=a159_0x3db2,_0x459253=_0x1f62a4[_0x36aa0e(0x1c7)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x459253)return undefined;const _0x2a097f=parseFrontmatterObject(_0x459253[0x1]??'');return scalarToString(_0x2a097f?.[_0x36aa0e(0x1de)]);}function slugifySkillName(_0x2ad0f7){const _0x14147b=a159_0x3db2,_0x409fa4=_0x2ad0f7['trim']()[_0x14147b(0x1a5)]()['replace'](/[^\p{L}\p{N}\p{So}]+/gu,'-')[_0x14147b(0x1b1)](/^-+/,'')[_0x14147b(0x1b1)](/-+$/,'')[_0x14147b(0x1b1)](/-{2,}/g,'-');if(!_0x409fa4)throw CliErrors[_0x14147b(0x1b2)](_0x14147b(0x1bd)+SKILL_FILE+_0x14147b(0x1b0));return _0x409fa4;}function a159_0x3db2(_0x46a313,_0x25d0da){_0x46a313=_0x46a313-0x1a4;const _0x59875b=a159_0x5987();let _0x3db241=_0x59875b[_0x46a313];return _0x3db241;}function parseFrontmatterObject(_0x84817f){const _0x2beec5=a159_0x3db2;try{const _0x43e041=a159_0x5b8564(_0x84817f);return _0x43e041&&typeof _0x43e041===_0x2beec5(0x1dd)&&!Array['isArray'](_0x43e041)?_0x43e041:undefined;}catch{return undefined;}}function scalarToString(_0x200919){const _0x4246a6=a159_0x3db2;if(typeof _0x200919===_0x4246a6(0x1b3))return _0x200919[_0x4246a6(0x1d5)]();if(typeof _0x200919===_0x4246a6(0x1a7)||typeof _0x200919===_0x4246a6(0x1db))return String(_0x200919);return undefined;}function resolvePushDirectoryRoot(_0x3d22b2){const _0xec9085=a159_0x3db2,_0x474eab=resolve(_0x3d22b2);if(!existsSync(_0x474eab))throw CliErrors['validation'](_0xec9085(0x1c9)+_0x3d22b2);const _0x2d6dfc=lstatSync(_0x474eab);if(_0x2d6dfc['isDirectory']())return _0x474eab;if(_0x2d6dfc[_0xec9085(0x1b6)]()){const _0x5b9b93=realpathSync(_0x474eab);if(lstatSync(_0x5b9b93)['isDirectory']())return _0x5b9b93;}throw CliErrors[_0xec9085(0x1b2)](_0xec9085(0x1c9)+_0x3d22b2);}function requireRemoteScope(_0x428d0e){const _0x18ded4=a159_0x3db2;if(_0x428d0e[_0x18ded4(0x1cd)]===_0x18ded4(0x1e0)||_0x428d0e['scope']===_0x18ded4(0x1aa)||_0x428d0e['scope']==='builtin')return _0x428d0e[_0x18ded4(0x1cd)];throw CliErrors[_0x18ded4(0x1b2)](_0x18ded4(0x1a4)+(_0x428d0e[_0x18ded4(0x1cb)]||_0x18ded4(0x1e4))+_0x18ded4(0x1d2)+(_0x428d0e['scope']??'unknown')+'\x22.');}function readLocalSkillContent(_0x3428eb){const _0x6e12d8=a159_0x3db2,_0x2f07f5=resolve(_0x3428eb,SKILL_FILE);return existsSync(_0x2f07f5)&&lstatSync(_0x2f07f5)[_0x6e12d8(0x1d8)]()?readFileSync(_0x2f07f5,_0x6e12d8(0x1af)):'';}function readPushMetadataIfPresent(_0x1975e0,_0x3f3f50={}){const _0x5dce54=a159_0x3db2;try{return readMetadataIfPresent(_0x1975e0);}catch(_0x12db9f){if(_0x3f3f50[_0x5dce54(0x1c6)])return undefined;throw _0x12db9f;}}
|
|
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 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a160_0x41da(_0x5d841f,_0x3be283){_0x5d841f=_0x5d841f-0x136;const _0x5e12e6=a160_0x5e12();let _0x41da50=_0x5e12e6[_0x5d841f];return _0x41da50;}(function(_0x329840,_0x1d6811){const _0x538a2a=a160_0x41da,_0xfc43e5=_0x329840();while(!![]){try{const _0x37cd23=parseInt(_0x538a2a(0x143))/0x1+-parseInt(_0x538a2a(0x13f))/0x2+-parseInt(_0x538a2a(0x141))/0x3+-parseInt(_0x538a2a(0x13b))/0x4*(-parseInt(_0x538a2a(0x140))/0x5)+parseInt(_0x538a2a(0x13d))/0x6+-parseInt(_0x538a2a(0x142))/0x7*(-parseInt(_0x538a2a(0x139))/0x8)+-parseInt(_0x538a2a(0x145))/0x9*(parseInt(_0x538a2a(0x144))/0xa);if(_0x37cd23===_0x1d6811)break;else _0xfc43e5['push'](_0xfc43e5['shift']());}catch(_0x2d4079){_0xfc43e5['push'](_0xfc43e5['shift']());}}}(a160_0x5e12,0xc62a2));function a160_0x5e12(){const _0x418c0d=['585801jCnmeS','includes','push','validation','110216vnFbuY','Unsupported\x20runtime\x20Skill\x20scope:\x20','105740uopapo','company','2168262erEsIT','builtin','2652816JWYNuU','290YwEWMV','1873050oXgRpN','371hbTVZr','853631oxCtKD','110hnNhLw'];a160_0x5e12=function(){return _0x418c0d;};return a160_0x5e12();}import{CliErrors}from'../../errors.js';export function normalizeRuntimeSkillScopes(_0x48ad72){const _0x5d300e=a160_0x41da,_0x44e44c=_0x48ad72&&_0x48ad72['length']>0x0?_0x48ad72:['personal',_0x5d300e(0x13c),_0x5d300e(0x13e)],_0x4cd028=[];for(const _0x3987d6 of _0x44e44c){if(!isRuntimeSkillScope(_0x3987d6))throw CliErrors[_0x5d300e(0x138)](_0x5d300e(0x13a)+_0x3987d6);!_0x4cd028[_0x5d300e(0x136)](_0x3987d6)&&_0x4cd028[_0x5d300e(0x137)](_0x3987d6);}return _0x4cd028;}export function isRuntimeSkillScope(_0x31a7bb){const _0x1cbe57=a160_0x41da;return _0x31a7bb==='personal'||_0x31a7bb===_0x1cbe57(0x13c)||_0x31a7bb==='builtin';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x131e07,_0x5a5bef){const _0x294cbb=a162_0x3e08,_0x1b5207=_0x131e07();while(!![]){try{const _0x4d6e11=-parseInt(_0x294cbb(0x19d))/0x1+-parseInt(_0x294cbb(0x195))/0x2*(parseInt(_0x294cbb(0x19e))/0x3)+parseInt(_0x294cbb(0x191))/0x4+parseInt(_0x294cbb(0x199))/0x5+-parseInt(_0x294cbb(0x198))/0x6+-parseInt(_0x294cbb(0x19b))/0x7*(parseInt(_0x294cbb(0x190))/0x8)+-parseInt(_0x294cbb(0x19a))/0x9*(-parseInt(_0x294cbb(0x197))/0xa);if(_0x4d6e11===_0x5a5bef)break;else _0x1b5207['push'](_0x1b5207['shift']());}catch(_0x5f52ed){_0x1b5207['push'](_0x1b5207['shift']());}}}(a162_0x5d83,0xe17cb));import{unzipSync,zipSync}from'fflate';function a162_0x3e08(_0x531888,_0x655394){_0x531888=_0x531888-0x189;const _0x5d8345=a162_0x5d83();let _0x3e0819=_0x5d8345[_0x531888];return _0x3e0819;}import{CliErrors}from'../../errors.js';import{compareSkillFiles,fileContent,normalizeLocalFiles,normalizeSkillRelativePath}from'./local-files.js';function a162_0x5d83(){const _0x216bad=['validation','object','length','Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.','code','8wIqrzi','5489228dRPFGS','name','entries','sort','2RMVyrX','Runtime\x20Skill\x20package\x20contains\x20directory\x20entry:\x20','5057530wKjhom','3523482WdwGhq','3137405KGpdPG','45WBNIzx','11404071ENBMsO','from','352109Omztqz','3109347CrYubC','path','endsWith'];a162_0x5d83=function(){return _0x216bad;};return a162_0x5d83();}const ZIP_MTIME=new Date('1980-01-01T00:00:00.000Z');export function createDeterministicZipPackage(_0x17d2eb){const _0x58f235=a162_0x3e08,_0x3409cf={};for(const _0xa40081 of normalizeLocalFiles(_0x17d2eb)){_0x3409cf[_0xa40081[_0x58f235(0x189)]]=fileContent(_0xa40081);}return Buffer[_0x58f235(0x19c)](zipSync(_0x3409cf,{'level':0x0,'mtime':ZIP_MTIME}));}export function parseZipPackage(_0x721ab6){const _0x504a6a=a162_0x3e08;if(_0x721ab6[_0x504a6a(0x18d)]<0x16)throw CliErrors[_0x504a6a(0x18b)](_0x504a6a(0x18e));let _0x324cf1;try{_0x324cf1=unzipSync(_0x721ab6,{'filter'(_0x4cea55){const _0xc8edcd=_0x504a6a,_0x5e6b56=normalizeSkillRelativePath(_0x4cea55[_0xc8edcd(0x192)]);if(_0x5e6b56[_0xc8edcd(0x18a)]('/'))throw CliErrors[_0xc8edcd(0x18b)](_0xc8edcd(0x196)+_0x5e6b56);return!![];}});}catch(_0x575404){if(isRuntimeSkillValidationError(_0x575404))throw _0x575404;throw CliErrors[_0x504a6a(0x18b)](_0x504a6a(0x18e));}return Object[_0x504a6a(0x193)](_0x324cf1)['map'](([_0x3bfef2,_0x25c118])=>({'path':normalizeSkillRelativePath(_0x3bfef2),'bytes':Buffer[_0x504a6a(0x19c)](_0x25c118)}))[_0x504a6a(0x194)](compareSkillFiles);}function isRuntimeSkillValidationError(_0x343e6){const _0x398d37=a162_0x3e08;return typeof _0x343e6===_0x398d37(0x18c)&&_0x343e6!==null&&_0x398d37(0x18f)in _0x343e6&&_0x343e6[_0x398d37(0x18f)]==='validation_error';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x42ee17,_0x4bb698){const _0x523b30=a163_0x44a8,_0x41766e=_0x42ee17();while(!![]){try{const _0x30102a=-parseInt(_0x523b30(0x18a))/0x1+parseInt(_0x523b30(0x194))/0x2+-parseInt(_0x523b30(0x1a9))/0x3*(parseInt(_0x523b30(0x182))/0x4)+-parseInt(_0x523b30(0x192))/0x5+parseInt(_0x523b30(0x17f))/0x6*(-parseInt(_0x523b30(0x199))/0x7)+parseInt(_0x523b30(0x1ae))/0x8*(-parseInt(_0x523b30(0x1a8))/0x9)+parseInt(_0x523b30(0x197))/0xa;if(_0x30102a===_0x4bb698)break;else _0x41766e['push'](_0x41766e['shift']());}catch(_0x417fb0){_0x41766e['push'](_0x41766e['shift']());}}}(a163_0x1aa9,0x7ffa9));import{CliErrors}from'../../errors.js';import{SKILL_FILE}from'./constants.js';import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';import{fileContent,isSha256Hex,normalizeLocalFiles,normalizeManifestFiles}from'./local-files.js';import{createDeterministicZipPackage,parseZipPackage}from'./zip-codec.js';export function buildSkillPackage(_0xd4f1da){const _0x17bc76=a163_0x44a8,_0x550fb0=normalizeLocalFiles(_0xd4f1da);if(!_0x550fb0[_0x17bc76(0x18e)](_0x1d6ced=>_0x1d6ced[_0x17bc76(0x18c)]===SKILL_FILE))throw CliErrors[_0x17bc76(0x1a6)](_0x17bc76(0x1af)+SKILL_FILE+_0x17bc76(0x1a7));const _0x596ed4=localFilesToManifestFiles(_0x550fb0),_0x474da9=createDeterministicZipPackage(_0x550fb0);return{'manifest':{'schemaVersion':0x2,'treeSha256':fileTreeHash(_0x596ed4),'zipSha256':bufferSha256(_0x474da9),'zipSize':_0x474da9[_0x17bc76(0x1ab)],'files':_0x596ed4},'packageBytes':_0x474da9,'packageBase64':_0x474da9[_0x17bc76(0x191)](_0x17bc76(0x19a))};}export function verifyRuntimeSkillPackage(_0x5790a5,_0x4eeff0){const _0x26e674=a163_0x44a8,_0x45e4ca=normalizePackageManifest(_0x5790a5,{'requireOssPath':![]});if(!_0x45e4ca)throw CliErrors[_0x26e674(0x1a6)](_0x26e674(0x1a0));return extractAndVerifyPackage(_0x45e4ca,_0x4eeff0);}export function verifyRuntimeSkillBundle(_0x5ca77b,_0x9f2541){const _0x4a77d1=a163_0x44a8,_0x40d2f4=normalizePackageManifest(_0x5ca77b,{'requireOssPath':![]});if(!_0x40d2f4)throw CliErrors[_0x4a77d1(0x1a6)](_0x4a77d1(0x1a0));return extractAndVerifyPackageFiles(_0x40d2f4,_0x9f2541);}export function tryNormalizePackageManifest(_0x3f2024){return normalizePackageManifest(_0x3f2024,{'requireOssPath':![]});}export function requirePackageBytes(_0x39c00b,_0x95e7cc){const _0x2c0cde=a163_0x44a8;if(!_0x95e7cc||_0x95e7cc[_0x2c0cde(0x1ab)]===0x0)throw CliErrors['validation'](_0x2c0cde(0x19c)+_0x39c00b);return _0x95e7cc;}function a163_0x1aa9(){const _0x5ec069=['Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.','Runtime\x20Skill\x20file\x20tree\x20sha256\x20mismatch.','isSafeInteger','Runtime\x20Skill\x20package\x20is\x20missing\x20','bytes','object','validation','\x20in\x20Skill\x20file\x20package.','81bwZLcT','24NFKbwN','zipSize','length','push','schemaVersion','806056vqKpaT','Missing\x20','22794qTemTE','requireOssPath','Runtime\x20Skill\x20package\x20file\x20sha256\x20mismatch:\x20','179448fHDfZx','ossPath','isArray','zipSha256','Runtime\x20Skill\x20package\x20sha256\x20is\x20invalid.','files','Duplicate\x20Skill\x20package\x20entry:\x20','set','658903iogWzC','Runtime\x20Skill\x20package\x20size\x20mismatch.','path','has','some','Runtime\x20Skill\x20package\x20entry\x20list\x20mismatch.','Runtime\x20Skill\x20manifest\x20is\x20missing\x20','toString','403880LoQtVJ','toLowerCase','526388cIDfBz','Runtime\x20Skill\x20package\x20size\x20is\x20invalid.','treeSha256','26804860lOGzDP','Runtime\x20Skill\x20package\x20is\x20missing\x20entry:\x20','763CzaYaE','base64','map','Runtime\x20Skill\x20package\x20is\x20required\x20for\x20Skill\x20install:\x20','trim','Runtime\x20Skill\x20package\x20file\x20size\x20mismatch:\x20','Runtime\x20Skill\x20package\x20sha256\x20mismatch.'];a163_0x1aa9=function(){return _0x5ec069;};return a163_0x1aa9();}export function extractDownloadedPackage(_0x28d18c){const _0x15a4b7=a163_0x44a8,_0x3cc0fa=parseZipPackage(_0x28d18c)[_0x15a4b7(0x19b)](_0x3dacf5=>({'path':_0x3dacf5[_0x15a4b7(0x18c)],'bytes':_0x3dacf5[_0x15a4b7(0x1a4)]}));if(!_0x3cc0fa[_0x15a4b7(0x18e)](_0x4680b3=>_0x4680b3[_0x15a4b7(0x18c)]===SKILL_FILE))throw CliErrors[_0x15a4b7(0x1a6)](_0x15a4b7(0x1a3)+SKILL_FILE+'.');return normalizeLocalFiles(_0x3cc0fa);}function a163_0x44a8(_0x2ed533,_0x542875){_0x2ed533=_0x2ed533-0x17f;const _0x1aa9cc=a163_0x1aa9();let _0x44a829=_0x1aa9cc[_0x2ed533];return _0x44a829;}export function localFilesToManifestFiles(_0x417d60){const _0x3a9086=a163_0x44a8;return normalizeLocalFiles(_0x417d60)[_0x3a9086(0x19b)](_0x5a98b9=>({'path':_0x5a98b9[_0x3a9086(0x18c)],'sha256':fileHash(_0x5a98b9),'size':fileContent(_0x5a98b9)[_0x3a9086(0x1ab)]}));}function normalizePackageManifest(_0x33084d,_0x31467d){const _0x4d8eb7=a163_0x44a8;if(!_0x33084d||typeof _0x33084d!==_0x4d8eb7(0x1a5)||Array['isArray'](_0x33084d))return undefined;const _0x39cf2f=_0x33084d,_0x29c9d2=typeof _0x39cf2f['ossPath']==='string'?_0x39cf2f[_0x4d8eb7(0x183)][_0x4d8eb7(0x19d)]():undefined;if(_0x31467d[_0x4d8eb7(0x180)]&&!_0x29c9d2)return undefined;if(!Array[_0x4d8eb7(0x184)](_0x39cf2f[_0x4d8eb7(0x187)])||_0x39cf2f[_0x4d8eb7(0x187)]['length']===0x0)return undefined;if(!isSha256Hex(_0x39cf2f[_0x4d8eb7(0x196)]))throw CliErrors['validation']('Runtime\x20Skill\x20file\x20tree\x20sha256\x20is\x20invalid.');if(!isSha256Hex(_0x39cf2f['zipSha256']))throw CliErrors[_0x4d8eb7(0x1a6)](_0x4d8eb7(0x186));if(!Number[_0x4d8eb7(0x1a2)](_0x39cf2f[_0x4d8eb7(0x1aa)])||_0x39cf2f[_0x4d8eb7(0x1aa)]<0x0)throw CliErrors['validation'](_0x4d8eb7(0x195));const _0xc45222=normalizeManifestFiles(_0x39cf2f[_0x4d8eb7(0x187)]);if(!_0xc45222[_0x4d8eb7(0x18e)](_0x293260=>_0x293260[_0x4d8eb7(0x18c)]===SKILL_FILE))throw CliErrors[_0x4d8eb7(0x1a6)](_0x4d8eb7(0x190)+SKILL_FILE+'.');const _0x48574a=fileTreeHash(_0xc45222);if(_0x48574a!==_0x39cf2f[_0x4d8eb7(0x196)][_0x4d8eb7(0x193)]())throw CliErrors['validation'](_0x4d8eb7(0x1a1));return{'schemaVersion':Number[_0x4d8eb7(0x1a2)](_0x39cf2f[_0x4d8eb7(0x1ad)])?_0x39cf2f[_0x4d8eb7(0x1ad)]:0x2,'ossPath':_0x29c9d2,'treeSha256':_0x48574a,'zipSha256':_0x39cf2f['zipSha256']['toLowerCase'](),'zipSize':_0x39cf2f[_0x4d8eb7(0x1aa)],'files':_0xc45222};}function extractAndVerifyPackage(_0x15b8da,_0x456773){const _0x223bba=a163_0x44a8,_0x28ee68=normalizePackageManifest(_0x15b8da,{'requireOssPath':![]});if(!_0x28ee68)throw CliErrors[_0x223bba(0x1a6)](_0x223bba(0x1a0));if(_0x456773['length']!==_0x28ee68[_0x223bba(0x1aa)])throw CliErrors['validation'](_0x223bba(0x18b));const _0x464a9b=bufferSha256(_0x456773);if(_0x464a9b!==_0x28ee68[_0x223bba(0x185)])throw CliErrors['validation'](_0x223bba(0x19f));return extractAndVerifyPackageFiles(_0x28ee68,_0x456773);}function extractAndVerifyPackageFiles(_0x51186d,_0x278b32){const _0x4314f0=a163_0x44a8,_0x58ce39=parseZipPackage(_0x278b32);if(_0x58ce39[_0x4314f0(0x1ab)]!==_0x51186d[_0x4314f0(0x187)][_0x4314f0(0x1ab)])throw CliErrors[_0x4314f0(0x1a6)](_0x4314f0(0x18f));const _0x18a8f2=new Map();for(const _0x3d22a5 of _0x58ce39){if(_0x18a8f2[_0x4314f0(0x18d)](_0x3d22a5[_0x4314f0(0x18c)]))throw CliErrors['validation'](_0x4314f0(0x188)+_0x3d22a5['path']);_0x18a8f2[_0x4314f0(0x189)](_0x3d22a5[_0x4314f0(0x18c)],_0x3d22a5);}const _0x45ac98=[];for(const _0x533899 of _0x51186d[_0x4314f0(0x187)]){const _0x48079f=_0x18a8f2['get'](_0x533899[_0x4314f0(0x18c)]);if(!_0x48079f)throw CliErrors[_0x4314f0(0x1a6)](_0x4314f0(0x198)+_0x533899[_0x4314f0(0x18c)]);if(_0x48079f[_0x4314f0(0x1a4)]['length']!==_0x533899['size'])throw CliErrors[_0x4314f0(0x1a6)](_0x4314f0(0x19e)+_0x533899[_0x4314f0(0x18c)]);const _0x1e2f5d=bufferSha256(_0x48079f[_0x4314f0(0x1a4)]);if(_0x1e2f5d!==_0x533899['sha256'])throw CliErrors[_0x4314f0(0x1a6)](_0x4314f0(0x181)+_0x533899[_0x4314f0(0x18c)]);_0x45ac98[_0x4314f0(0x1ac)]({'path':_0x533899['path'],'bytes':_0x48079f['bytes']});}return normalizeLocalFiles(_0x45ac98);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a164_0x5486(_0xabfcc0,_0x1e3b3b){_0xabfcc0=_0xabfcc0-0x6a;var _0x220286=a164_0x2202();var _0x5486e6=_0x220286[_0xabfcc0];return _0x5486e6;}(function(_0x48c6df,_0x37d6b1){var _0x2d3aa2=a164_0x5486,_0x1bb00b=_0x48c6df();while(!![]){try{var _0xedfa7=parseInt(_0x2d3aa2(0x70))/0x1+-parseInt(_0x2d3aa2(0x6d))/0x2+-parseInt(_0x2d3aa2(0x6b))/0x3*(parseInt(_0x2d3aa2(0x73))/0x4)+-parseInt(_0x2d3aa2(0x6e))/0x5+-parseInt(_0x2d3aa2(0x6c))/0x6*(-parseInt(_0x2d3aa2(0x6a))/0x7)+parseInt(_0x2d3aa2(0x6f))/0x8+parseInt(_0x2d3aa2(0x72))/0x9*(parseInt(_0x2d3aa2(0x71))/0xa);if(_0xedfa7===_0x37d6b1)break;else _0x1bb00b['push'](_0x1bb00b['shift']());}catch(_0x22d2ea){_0x1bb00b['push'](_0x1bb00b['shift']());}}}(a164_0x2202,0xeef18));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';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';function a164_0x2202(){var _0xa5f604=['2240JJHfMC','123363GTMbEi','6121212MBlkAZ','350TIhsAK','3FdHFRm','174uTEFSu','2343868CMKZXm','1935035dpJgrz','1286272ixQmCc','835354NiWisc'];a164_0x2202=function(){return _0xa5f604;};return a164_0x2202();}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 a165_0x37004d=a165_0x5565;(function(_0x3a11ae,_0x19433b){const _0x44fafd=a165_0x5565,_0x3c008a=_0x3a11ae();while(!![]){try{const _0x5d23df=-parseInt(_0x44fafd(0xe9))/0x1*(-parseInt(_0x44fafd(0x102))/0x2)+parseInt(_0x44fafd(0xfe))/0x3+-parseInt(_0x44fafd(0xed))/0x4*(-parseInt(_0x44fafd(0x105))/0x5)+parseInt(_0x44fafd(0x101))/0x6+-parseInt(_0x44fafd(0x103))/0x7*(-parseInt(_0x44fafd(0x108))/0x8)+-parseInt(_0x44fafd(0xf7))/0x9+-parseInt(_0x44fafd(0xe7))/0xa;if(_0x5d23df===_0x19433b)break;else _0x3c008a['push'](_0x3c008a['shift']());}catch(_0x4b12a0){_0x3c008a['push'](_0x3c008a['shift']());}}}(a165_0x1c73,0xa3f89));import{existsSync,readFileSync}from'node:fs';import{homedir}from'node:os';function a165_0x5565(_0x27dc53,_0x309438){_0x27dc53=_0x27dc53-0xe6;const _0x1c73d1=a165_0x1c73();let _0x55655b=_0x1c73d1[_0x27dc53];return _0x55655b;}function a165_0x1c73(){const _0x13c69b=['version','utf8','join','56sLlmLa','kind','number','skills','present','unverifiable','not-recorded','lockFile','message','map','10554120jfQLkH','globalSkillsDirs','.claude','.agents','home','\x20uses\x20unsupported\x20version\x20','\x20records\x20\x22','3466068kdDOte','object','recorded','7964604ddDCnX','118Igosfp','186809foMGor','unusable','242030msUtsq','absent','\x20has\x20no\x20skills\x20map','144zCLuoX','includes','19375450wSmdeI','\x20is\x20unreadable:\x20','2390WFWKeH'];a165_0x1c73=function(){return _0x13c69b;};return a165_0x1c73();}import{join}from'node:path';export const SKILL_LOCK_RELATIVE_PATH=join(a165_0x37004d(0xfa),'.skill-lock.json');export const GLOBAL_SKILLS_DIR_RELATIVE_PATHS=[join(a165_0x37004d(0xfa),a165_0x37004d(0xf0)),join(a165_0x37004d(0xf9),a165_0x37004d(0xf0))];const SUPPORTED_LOCK_VERSIONS=[0x3];function readLockLookup(_0x17c417,_0x33eddb){const _0x3252fc=a165_0x37004d;if(!existsSync(_0x17c417))return{'kind':_0x3252fc(0xf3)};let _0x4f9699;try{_0x4f9699=JSON['parse'](readFileSync(_0x17c417,_0x3252fc(0xeb)));}catch(_0x240e8f){return{'kind':_0x3252fc(0x104),'reason':_0x17c417+_0x3252fc(0xe8)+_0x240e8f[_0x3252fc(0xf5)]};}const _0x59fe89=_0x4f9699;if(typeof _0x59fe89?.['version']!==_0x3252fc(0xef)||!SUPPORTED_LOCK_VERSIONS[_0x3252fc(0xe6)](_0x59fe89[_0x3252fc(0xea)]))return{'kind':'unusable','reason':_0x17c417+_0x3252fc(0xfc)+String(_0x59fe89?.[_0x3252fc(0xea)])};if(!_0x59fe89[_0x3252fc(0xf0)]||typeof _0x59fe89[_0x3252fc(0xf0)]!==_0x3252fc(0xff))return{'kind':_0x3252fc(0x104),'reason':_0x17c417+_0x3252fc(0x107)};return _0x59fe89[_0x3252fc(0xf0)][_0x33eddb]?{'kind':_0x3252fc(0x100)}:{'kind':_0x3252fc(0xf3)};}export function resolveInstalledSkill(_0x14ea34,_0x32637c){const _0x1609d3=a165_0x37004d,_0x20e213=_0x32637c?.[_0x1609d3(0xfb)]??homedir(),_0x58985f=_0x32637c?.[_0x1609d3(0xf8)]??GLOBAL_SKILLS_DIR_RELATIVE_PATHS[_0x1609d3(0xf6)](_0x5895ec=>join(_0x20e213,_0x5895ec)),_0x4a021c=_0x32637c?.[_0x1609d3(0xf4)]??join(_0x20e213,SKILL_LOCK_RELATIVE_PATH),_0x5d0bf8=_0x58985f['map'](_0x41f49e=>join(_0x41f49e,_0x14ea34,'SKILL.md')),_0x2c93c2=_0x5d0bf8['find'](_0x4b7074=>existsSync(_0x4b7074));if(_0x2c93c2)return{'state':_0x1609d3(0xf1),'path':_0x2c93c2};const _0xb1798a=readLockLookup(_0x4a021c,_0x14ea34);if(_0xb1798a[_0x1609d3(0xee)]===_0x1609d3(0x104))return{'state':'unverifiable','reason':_0xb1798a['reason']};if(_0xb1798a[_0x1609d3(0xee)]===_0x1609d3(0x100))return{'state':_0x1609d3(0xf2),'reason':_0x4a021c+_0x1609d3(0xfd)+_0x14ea34+'\x22\x20but\x20no\x20SKILL.md\x20was\x20found\x20in\x20known\x20layouts\x20'+('('+_0x5d0bf8[_0x1609d3(0xec)](',\x20')+')')};return{'state':_0x1609d3(0x106),'checked':_0x5d0bf8};}
|