@lovrabet/lovrabet-cli 2.3.7-beta.1 → 2.3.8-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (181) hide show
  1. package/README.md +1 -1
  2. package/lib/cli.js +1 -1
  3. package/lib/commands/api-doc/index.js +1 -1
  4. package/lib/commands/app/cache.js +1 -1
  5. package/lib/commands/app/definitions.js +1 -1
  6. package/lib/commands/app/eligibility.js +1 -1
  7. package/lib/commands/app/mock-loader.js +1 -1
  8. package/lib/commands/app/remote-source.js +1 -1
  9. package/lib/commands/app/shared.js +1 -1
  10. package/lib/commands/app-config/get.js +1 -1
  11. package/lib/commands/app-config/index.js +1 -1
  12. package/lib/commands/approval/index.js +1 -1
  13. package/lib/commands/artifact/index.js +1 -1
  14. package/lib/commands/auth/device.js +1 -1
  15. package/lib/commands/auth/index.js +1 -1
  16. package/lib/commands/auth/prompt.js +1 -1
  17. package/lib/commands/bff/detail.js +1 -1
  18. package/lib/commands/bff/exec.js +1 -1
  19. package/lib/commands/bff/index.js +1 -1
  20. package/lib/commands/cli-skill/index.js +1 -1
  21. package/lib/commands/common/config-policy.js +1 -1
  22. package/lib/commands/common/constraints.js +1 -1
  23. package/lib/commands/common/flags.js +1 -1
  24. package/lib/commands/common/local-file.js +1 -1
  25. package/lib/commands/config/definitions.js +1 -1
  26. package/lib/commands/config/init.js +1 -1
  27. package/lib/commands/config/shared.js +1 -1
  28. package/lib/commands/data/import-excel.js +1 -1
  29. package/lib/commands/data/index.js +1 -1
  30. package/lib/commands/dataset/detail.js +1 -1
  31. package/lib/commands/dataset/index.js +1 -1
  32. package/lib/commands/dataset/list.js +1 -1
  33. package/lib/commands/dataset/sdk-doc.js +1 -1
  34. package/lib/commands/doctor.js +1 -1
  35. package/lib/commands/file/index.js +1 -1
  36. package/lib/commands/init.js +1 -1
  37. package/lib/commands/kb/index.js +1 -1
  38. package/lib/commands/logs/index.js +1 -1
  39. package/lib/commands/notification/config-list.js +1 -1
  40. package/lib/commands/notification/index.js +1 -1
  41. package/lib/commands/notification/shared.js +1 -1
  42. package/lib/commands/ocr/index.js +1 -1
  43. package/lib/commands/permit/dataset-get.js +1 -1
  44. package/lib/commands/permit/dataset-set.js +1 -1
  45. package/lib/commands/permit/index.js +1 -1
  46. package/lib/commands/permit/page-get.js +1 -1
  47. package/lib/commands/permit/page-set.js +1 -1
  48. package/lib/commands/permit/role-menus-set.js +1 -1
  49. package/lib/commands/permit/role-menus.js +1 -1
  50. package/lib/commands/permit/shared.js +1 -1
  51. package/lib/commands/personal-bff/index.js +1 -1
  52. package/lib/commands/registry.js +1 -1
  53. package/lib/commands/role/create.js +1 -1
  54. package/lib/commands/role/delete.js +1 -1
  55. package/lib/commands/role/detail.js +1 -1
  56. package/lib/commands/role/index.js +1 -1
  57. package/lib/commands/role/list.js +1 -1
  58. package/lib/commands/role/shared.js +1 -1
  59. package/lib/commands/role/update.js +1 -1
  60. package/lib/commands/role/user-add.js +1 -1
  61. package/lib/commands/role/user-remove.js +1 -1
  62. package/lib/commands/schedule/index.js +1 -1
  63. package/lib/commands/schema.js +1 -1
  64. package/lib/commands/service/dynamic.js +1 -1
  65. package/lib/commands/service/function-name-adapter.js +1 -1
  66. package/lib/commands/service/index.js +1 -1
  67. package/lib/commands/service/registry.js +1 -1
  68. package/lib/commands/skill/commands/create.js +1 -1
  69. package/lib/commands/skill/commands/diagram.js +1 -1
  70. package/lib/commands/skill/commands/install.js +1 -1
  71. package/lib/commands/skill/commands/list.js +1 -1
  72. package/lib/commands/skill/commands/push.js +1 -1
  73. package/lib/commands/skill/commands/validate.js +1 -1
  74. package/lib/commands/skill/diagram.js +1 -1
  75. package/lib/commands/skill/flags.js +1 -1
  76. package/lib/commands/skill/index.js +1 -1
  77. package/lib/commands/skill/manifest-helpers.js +1 -1
  78. package/lib/commands/skill/push-execute.js +1 -1
  79. package/lib/commands/skill/push-flow-helpers.js +1 -1
  80. package/lib/commands/skill/push-retarget.js +1 -1
  81. package/lib/commands/skill/scopes.js +1 -1
  82. package/lib/commands/skill/summary.js +1 -1
  83. package/lib/commands/skill/templates.js +1 -1
  84. package/lib/commands/skill/validate.js +1 -1
  85. package/lib/commands/sql/detail.js +1 -1
  86. package/lib/commands/sql/exec.js +1 -1
  87. package/lib/commands/sql/index.js +1 -1
  88. package/lib/commands/update.js +1 -1
  89. package/lib/commands/user-account/bind.js +1 -1
  90. package/lib/commands/user-account/index.js +1 -1
  91. package/lib/commands/workspace/index.js +1 -1
  92. package/lib/config/domain-config.js +1 -1
  93. package/lib/config/schema.js +1 -1
  94. package/lib/constant/app.js +1 -1
  95. package/lib/constant/auth-mode.js +1 -1
  96. package/lib/constant/cli.js +1 -1
  97. package/lib/constant/defaults.js +1 -1
  98. package/lib/constant/distribution.js +1 -1
  99. package/lib/constant/domain.js +1 -1
  100. package/lib/constant/env.js +1 -1
  101. package/lib/constant/output.js +1 -1
  102. package/lib/constant/product.js +1 -1
  103. package/lib/constant/region.js +1 -1
  104. package/lib/constant/risk.js +1 -1
  105. package/lib/constant/url.js +1 -1
  106. package/lib/context.js +1 -1
  107. package/lib/core/api-client.js +1 -1
  108. package/lib/core/db-resolver.js +1 -1
  109. package/lib/core/kb-management-client.js +1 -1
  110. package/lib/core/kb-search-client.js +1 -1
  111. package/lib/core/sdk-client.js +1 -1
  112. package/lib/errors.js +1 -1
  113. package/lib/framework/access-error.js +1 -1
  114. package/lib/framework/build-all-flags.js +1 -1
  115. package/lib/framework/dryrun.js +1 -1
  116. package/lib/framework/flags.js +1 -1
  117. package/lib/framework/help.js +1 -1
  118. package/lib/framework/index.js +1 -1
  119. package/lib/framework/output.js +1 -1
  120. package/lib/framework/preparse.js +1 -1
  121. package/lib/framework/rate-limit.js +1 -1
  122. package/lib/framework/raw-flags.js +1 -1
  123. package/lib/framework/response.js +1 -1
  124. package/lib/framework/runner-confirmation.js +1 -1
  125. package/lib/framework/runner-error.js +1 -1
  126. package/lib/framework/runner.js +1 -1
  127. package/lib/framework/schema-export.js +1 -1
  128. package/lib/framework/service-order.js +1 -1
  129. package/lib/framework/types.js +1 -1
  130. package/lib/generated/build-info.d.ts +4 -4
  131. package/lib/generated/build-info.js +1 -1
  132. package/lib/generated/official-routing.js +1 -1
  133. package/lib/generated/routing-contract.js +1 -1
  134. package/lib/help.js +1 -1
  135. package/lib/postinstall.js +1 -1
  136. package/lib/runtime/confirmation.js +1 -1
  137. package/lib/runtime/event.js +1 -1
  138. package/lib/runtime/index.js +1 -1
  139. package/lib/runtime/queue.js +1 -1
  140. package/lib/runtime/resolve.js +1 -1
  141. package/lib/services/dataset-import/auto-id-runner.js +1 -1
  142. package/lib/services/dataset-import/excel-reader.js +1 -1
  143. package/lib/services/dataset-import/image-bytes.js +1 -1
  144. package/lib/services/dataset-import/image-ooxml.js +1 -1
  145. package/lib/services/dataset-import/image-runner.js +1 -1
  146. package/lib/services/dataset-import/metadata.js +1 -1
  147. package/lib/services/dataset-import/preview.js +1 -1
  148. package/lib/services/dataset-import/runner.js +1 -1
  149. package/lib/skills/builtin-skill.js +1 -1
  150. package/lib/skills/npx-skills-add.js +1 -1
  151. package/lib/skills/runtime-skill-sync/constants.js +1 -1
  152. package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
  153. package/lib/skills/runtime-skill-sync/hashing.js +1 -1
  154. package/lib/skills/runtime-skill-sync/install-target.js +1 -1
  155. package/lib/skills/runtime-skill-sync/links.js +1 -1
  156. package/lib/skills/runtime-skill-sync/list-local.js +1 -1
  157. package/lib/skills/runtime-skill-sync/local-files.js +1 -1
  158. package/lib/skills/runtime-skill-sync/materialize.js +1 -1
  159. package/lib/skills/runtime-skill-sync/metadata.js +1 -1
  160. package/lib/skills/runtime-skill-sync/paths.js +1 -1
  161. package/lib/skills/runtime-skill-sync/push.js +1 -1
  162. package/lib/skills/runtime-skill-sync/scopes.js +1 -1
  163. package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
  164. package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
  165. package/lib/skills/runtime-skill-sync.js +1 -1
  166. package/lib/skills/skill-presence.js +1 -1
  167. package/lib/utils/access-key-redaction.js +1 -1
  168. package/lib/utils/apply-jq-filter.js +1 -1
  169. package/lib/utils/cli-version-check.js +1 -1
  170. package/lib/utils/cli-version-policy.js +1 -1
  171. package/lib/utils/logger.js +1 -1
  172. package/lib/utils/lossless-json.js +1 -1
  173. package/lib/utils/params.js +1 -1
  174. package/lib/utils/positive-safe-integer.js +1 -1
  175. package/lib/utils/redaction.js +1 -1
  176. package/lib/utils/update-notice.js +1 -1
  177. package/lib/utils/version.js +1 -1
  178. package/lib/utils/write-cli-side-channel.js +1 -1
  179. package/package.json +2 -2
  180. package/skills/lovrabet/SKILL.md +2 -2
  181. package/skills/lovrabet.manifest.json +3 -3
@@ -1 +1 @@
1
- const a154_0x2dd86b=a154_0x2065;(function(_0x3be1cd,_0x30cc82){const _0x4cc42e=a154_0x2065,_0x2efb4b=_0x3be1cd();while(!![]){try{const _0x43233c=parseInt(_0x4cc42e(0x1e7))/0x1+-parseInt(_0x4cc42e(0x1f8))/0x2+parseInt(_0x4cc42e(0x20c))/0x3+-parseInt(_0x4cc42e(0x1f9))/0x4*(-parseInt(_0x4cc42e(0x21b))/0x5)+-parseInt(_0x4cc42e(0x1f7))/0x6+parseInt(_0x4cc42e(0x1f6))/0x7+-parseInt(_0x4cc42e(0x21c))/0x8;if(_0x43233c===_0x30cc82)break;else _0x2efb4b['push'](_0x2efb4b['shift']());}catch(_0x5e31b8){_0x2efb4b['push'](_0x2efb4b['shift']());}}}(a154_0x7060,0x9035a));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import a154_0x2ac90d from'fs-extra';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';import{isDanglingSymlink,isPathInside,lstatIfPresent,realOrResolved,resolveSymlinkTarget}from'./fs-utils.js';import{readMetadataIfPresent,requireSkillCode}from'./metadata.js';function a154_0x2065(_0x55e086,_0x2aff27){_0x55e086=_0x55e086-0x1e3;const _0x7060d=a154_0x7060();let _0x2065ab=_0x7060d[_0x55e086];return _0x2065ab;}import{getRuntimeSkillCacheRoot,resolveSkillSyncPaths,safePathSegment}from'./paths.js';const {copySync,ensureDirSync,removeSync}=a154_0x2ac90d,RESERVED_PROJECT_SKILL_CODES=new Set([a154_0x2dd86b(0x209),a154_0x2dd86b(0x1e5),a154_0x2dd86b(0x201)]);export function linkEffectiveRuntimeSkills(_0x52fab5,_0x1ac813){const _0xcc6bcd=a154_0x2dd86b,_0x32609e=new Map();for(const _0x4e8263 of _0x52fab5){const _0x475c82=_0x4e8263['skill'][_0xcc6bcd(0x1ea)];if(!_0x475c82)continue;const _0x4ee94e=_0x32609e[_0xcc6bcd(0x206)](_0x475c82);(!_0x4ee94e||_0x4e8263[_0xcc6bcd(0x20f)]==='personal')&&_0x32609e[_0xcc6bcd(0x20d)](_0x475c82,_0x4e8263);}const _0x1f1b0f=[];for(const _0x3df4a6 of _0x32609e[_0xcc6bcd(0x1f5)]()){const _0x6ed08f=requireSkillCode(_0x3df4a6[_0xcc6bcd(0x205)]),_0x170330=readMetadataIfPresent(_0x3df4a6[_0xcc6bcd(0x210)]);if(_0x170330?.[_0xcc6bcd(0x219)]!==_0x1ac813[_0xcc6bcd(0x219)]||_0x170330[_0xcc6bcd(0x1ea)]!==_0x6ed08f)throw CliErrors[_0xcc6bcd(0x1eb)](_0xcc6bcd(0x21d)+_0x1ac813[_0xcc6bcd(0x219)]+':\x20'+_0x3df4a6[_0xcc6bcd(0x210)]);const _0x400ae3=runtimeSkillLinkName(_0x1ac813,_0x6ed08f);for(const _0x44837a of _0x1ac813[_0xcc6bcd(0x20b)]){_0x1f1b0f[_0xcc6bcd(0x1fb)](ensureManagedSymlink(resolve(_0x44837a,_0x400ae3),_0x3df4a6[_0xcc6bcd(0x200)],_0x1ac813,_0x6ed08f));}}return _0x1f1b0f;}export function pruneStaleRuntimeSkillLinks(_0x51b69b,_0x3422a6,_0x5ae23a){const _0x310fd5=a154_0x2dd86b,_0xad56fe=new Set([..._0x3422a6][_0x310fd5(0x1ee)](_0x24dd9f=>_0x24dd9f['trim']())[_0x310fd5(0x1fa)](Boolean)),_0x31d4d2=_0x5ae23a?new Set([..._0x5ae23a]['map'](_0x175dfe=>_0x175dfe[_0x310fd5(0x1f1)]())[_0x310fd5(0x1fa)](Boolean)):undefined,_0x4cd33c=[];for(const _0x25b72d of _0x51b69b['skillRoots']){for(const _0x16e4aa of managedTargetSkillLinkPaths(_0x25b72d,_0x51b69b)){const _0x3de972=runtimeSkillCodeFromLink(_0x51b69b,_0x16e4aa);if(_0x31d4d2&&!_0x31d4d2['has'](_0x3de972))continue;if(_0xad56fe['has'](_0x3de972))continue;_0x4cd33c[_0x310fd5(0x1fb)](removeManagedSkillLink(_0x16e4aa,_0x51b69b,_0x3de972));}}return _0x4cd33c;}export function pruneStaleRuntimeSkillCache(_0x51b749,_0x1253d0={}){const _0x1b88a2=a154_0x2dd86b,_0x133d07=new Set([..._0x51b749[_0x1b88a2(0x1f0)]][_0x1b88a2(0x1ee)](_0xcf9876=>_0xcf9876[_0x1b88a2(0x1f1)]())[_0x1b88a2(0x1fa)](Boolean)),_0x908f68=_0x51b749[_0x1b88a2(0x1ff)]?new Set([..._0x51b749[_0x1b88a2(0x1ff)]][_0x1b88a2(0x1ee)](_0x558f17=>_0x558f17['trim']())[_0x1b88a2(0x1fa)](Boolean)):undefined,_0x16c0af=_0x51b749[_0x1b88a2(0x1f4)]??['personal','company'],_0x129172=resolve(getRuntimeSkillCacheRoot(_0x51b749[_0x1b88a2(0x204)],_0x51b749[_0x1b88a2(0x1e9)],_0x1253d0),safePathSegment(_0x51b749['appCode'],_0x1b88a2(0x219))),_0xb047ab=[];for(const _0x413dcd of _0x16c0af){const _0x39334e=resolve(_0x129172,_0x413dcd);if(!existsSync(_0x39334e))continue;for(const _0x2d7d25 of readdirSync(_0x39334e,{'withFileTypes':!![]})){if(!_0x2d7d25[_0x1b88a2(0x213)]())continue;const _0x3af117=_0x2d7d25[_0x1b88a2(0x1fd)];if(_0x908f68&&!_0x908f68[_0x1b88a2(0x215)](_0x3af117))continue;if(_0x133d07[_0x1b88a2(0x215)](_0x3af117))continue;const _0x9c60bc=resolve(_0x39334e,_0x3af117),_0x22e0b8=readMetadataIfPresent(resolve(_0x9c60bc,METADATA_FILE));if(_0x22e0b8?.[_0x1b88a2(0x219)]!==_0x51b749['appCode']||_0x22e0b8[_0x1b88a2(0x20f)]!==_0x413dcd||_0x22e0b8[_0x1b88a2(0x1ea)]!==_0x3af117){_0xb047ab[_0x1b88a2(0x1fb)]({'path':_0x9c60bc,'action':_0x1b88a2(0x203),'reason':_0x1b88a2(0x1ed)});continue;}if(isLinkedFromAnyRoot(_0x9c60bc,_0x51b749[_0x1b88a2(0x1ef)]??[])){_0xb047ab['push']({'path':_0x9c60bc,'action':'skipped','reason':_0x1b88a2(0x1fe)});continue;}removeSync(_0x9c60bc),_0xb047ab[_0x1b88a2(0x1fb)]({'path':_0x9c60bc,'action':_0x1b88a2(0x211)});}}return _0xb047ab;}export function linkGlobalRuntimeSkills(_0x43a395,_0x287f3b={}){const _0x4a6d1b=a154_0x2dd86b,_0x289af8=resolveSkillSyncPaths(_0x287f3b),_0x3c9b70=[];for(const _0x4fa4f4 of _0x43a395){if(_0x4fa4f4[_0x4a6d1b(0x20f)]!==_0x4a6d1b(0x216))throw CliErrors[_0x4a6d1b(0x1eb)](_0x4a6d1b(0x214)+_0x4fa4f4[_0x4a6d1b(0x20f)]);const _0x2baa27=requireSkillCode(_0x4fa4f4['skill']),_0x2720d7=copyManagedSkillDirectory(_0x4fa4f4[_0x4a6d1b(0x200)],resolve(_0x289af8[_0x4a6d1b(0x1fc)],_0x2baa27));_0x3c9b70['push']({..._0x2720d7,'contentHash':_0x4fa4f4['contentHash']});}return _0x3c9b70;}function ensureManagedSymlink(_0x193760,_0x525b42,_0x5e7541,_0xa18c7a){const _0x13a991=a154_0x2dd86b;mkdirSync(dirname(_0x193760),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x193760)||isDanglingSymlink(_0x193760)){const _0x29f7ca=lstatSync(_0x193760);if(!_0x29f7ca[_0x13a991(0x20e)]())throw CliErrors['validation']('Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20'+_0x193760);const _0x181e6e=resolveSymlinkTarget(_0x193760);if(!isPathInside(realOrResolved(_0x181e6e),realOrResolved(_0x5e7541['managedRoot'])))throw CliErrors['validation'](_0x13a991(0x1f2)+_0x193760);if(realOrResolved(_0x181e6e)===realOrResolved(_0x525b42))return{'path':_0x193760,'target':_0x525b42,'action':_0x13a991(0x1e4)};const _0x47b47d=readMetadataIfPresent(resolve(_0x181e6e,METADATA_FILE));if(_0x5e7541[_0x13a991(0x20f)]==='project'&&(_0x47b47d?.[_0x13a991(0x219)]!==_0x5e7541[_0x13a991(0x219)]||_0x47b47d[_0x13a991(0x1ea)]!==_0xa18c7a))throw CliErrors[_0x13a991(0x1eb)](_0x13a991(0x217)+_0x193760);return unlinkSync(_0x193760),symlinkSync(_0x525b42,_0x193760,_0x13a991(0x200)),{'path':_0x193760,'target':_0x525b42,'action':'updated'};}return symlinkSync(_0x525b42,_0x193760,_0x13a991(0x200)),{'path':_0x193760,'target':_0x525b42,'action':_0x13a991(0x207)};}function managedTargetSkillLinkPaths(_0x51f6f5,_0x593dca){const _0x58ef2a=a154_0x2dd86b;if(!existsSync(_0x51f6f5))return[];const _0x36a487=_0x593dca[_0x58ef2a(0x219)]+'--';return readdirSync(_0x51f6f5,{'withFileTypes':!![]})[_0x58ef2a(0x1fa)](_0x3a561c=>_0x593dca[_0x58ef2a(0x20f)]===_0x58ef2a(0x218)||_0x3a561c[_0x58ef2a(0x1fd)][_0x58ef2a(0x1e8)](_0x36a487))[_0x58ef2a(0x1ee)](_0x9f37b2=>resolve(_0x51f6f5,_0x9f37b2[_0x58ef2a(0x1fd)]));}function removeManagedSkillLink(_0x55aa70,_0x2100b6,_0x2c0647){const _0x5e43e0=a154_0x2dd86b,_0x2a55da=lstatIfPresent(_0x55aa70);if(!_0x2a55da?.[_0x5e43e0(0x20e)]())return{'path':_0x55aa70,'action':_0x5e43e0(0x203),'reason':_0x5e43e0(0x212)};const _0x228998=resolveSymlinkTarget(_0x55aa70);if(!isPathInside(realOrResolved(_0x228998),realOrResolved(_0x2100b6[_0x5e43e0(0x208)])))return{'path':_0x55aa70,'action':_0x5e43e0(0x203),'reason':'external-symlink'};const _0x56094f=readMetadataIfPresent(resolve(_0x228998,METADATA_FILE));if(_0x2100b6[_0x5e43e0(0x20f)]===_0x5e43e0(0x218)&&(_0x56094f?.[_0x5e43e0(0x219)]!==_0x2100b6[_0x5e43e0(0x219)]||_0x56094f['skillCode']!==_0x2c0647))return{'path':_0x55aa70,'action':'skipped','reason':'metadata-mismatch'};return unlinkSync(_0x55aa70),{'path':_0x55aa70,'action':_0x5e43e0(0x211)};}function isLinkedFromAnyRoot(_0x2ad7e1,_0x219253){const _0x83144a=a154_0x2dd86b,_0x31ba87=realOrResolved(_0x2ad7e1);for(const _0x524d95 of _0x219253){if(!existsSync(_0x524d95))continue;for(const _0x3cc09f of readdirSync(_0x524d95,{'withFileTypes':!![]})){if(!_0x3cc09f[_0x83144a(0x20e)]())continue;const _0x3c88d7=resolve(_0x524d95,_0x3cc09f['name']);if(realOrResolved(resolveSymlinkTarget(_0x3c88d7))===_0x31ba87)return!![];}}return![];}function runtimeSkillLinkName(_0x13fdaf,_0x1bb6c2){const _0x4fc16e=a154_0x2dd86b,_0x411e67=safePathSegment(_0x1bb6c2,_0x4fc16e(0x1ea));if(_0x13fdaf[_0x4fc16e(0x20f)]===_0x4fc16e(0x218)&&RESERVED_PROJECT_SKILL_CODES['has'](_0x411e67))throw CliErrors[_0x4fc16e(0x1eb)](_0x4fc16e(0x20a)+_0x411e67);return _0x13fdaf['scope']===_0x4fc16e(0x218)?_0x411e67:_0x13fdaf['appCode']+'--'+_0x411e67;}function a154_0x7060(){const _0x4d9f02=['set','isSymbolicLink','scope','metadataPath','removed','not-managed-symlink','isDirectory','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','has','builtin','Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20','project','appCode','Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20','162790jBHZxD','8816872dRwYOf','Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20','contentHash','unchanged','runtime-observe','slice','968251qJwFkq','startsWith','accessKey','skillCode','validation','length','metadata-mismatch','map','protectedLinkRoots','activeSkillCodes','trim','Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20','Refusing\x20to\x20copy\x20Skill\x20symlink:\x20','scopes','values','2632826UijKRW','6809718HmjOWK','539012tHScwM','128WmvaHN','filter','push','agentsSkillsDir','name','linked-from-protected-root','pruneSkillCodes','dir','secret-retriever','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20','skipped','env','skill','get','created','managedRoot','lovrabet','Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20','skillRoots','2133075cfjcwY'];a154_0x7060=function(){return _0x4d9f02;};return a154_0x7060();}function runtimeSkillCodeFromLink(_0x10263a,_0x3fb40d){const _0x42d8fd=a154_0x2dd86b,_0x291f4f=basename(_0x3fb40d);return _0x10263a[_0x42d8fd(0x20f)]==='project'?_0x291f4f:_0x291f4f[_0x42d8fd(0x1e6)]((_0x10263a[_0x42d8fd(0x219)]+'--')[_0x42d8fd(0x1ec)]);}export function copyManagedSkillDirectory(_0x58abc3,_0x57c2c4){const _0x5e6328=a154_0x2dd86b,_0x173ba3=resolve(_0x57c2c4,METADATA_FILE),_0x41c6a1=existsSync(_0x57c2c4);if(_0x41c6a1){const _0x38190e=lstatSync(_0x57c2c4);if(_0x38190e[_0x5e6328(0x20e)]())throw CliErrors[_0x5e6328(0x1eb)](_0x5e6328(0x21a)+_0x57c2c4);if(!_0x38190e[_0x5e6328(0x213)]())throw CliErrors[_0x5e6328(0x1eb)]('Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20'+_0x57c2c4);const _0x3f09cd=readMetadataIfPresent(_0x173ba3);if(_0x3f09cd?.[_0x5e6328(0x20f)]!==_0x5e6328(0x216))throw CliErrors[_0x5e6328(0x1eb)](_0x5e6328(0x202)+_0x57c2c4);}ensureDirSync(dirname(_0x57c2c4));const _0x34698a=_0x41c6a1?readMetadataIfPresent(_0x173ba3)?.[_0x5e6328(0x1e3)]:undefined,_0x2261b7=readMetadataIfPresent(resolve(_0x58abc3,METADATA_FILE))?.['contentHash'];return _0x41c6a1&&removeSync(_0x57c2c4),copySkillDirectory(_0x58abc3,_0x57c2c4),{'path':_0x57c2c4,'target':_0x58abc3,'action':!_0x41c6a1?_0x5e6328(0x207):_0x34698a===_0x2261b7?_0x5e6328(0x1e4):'updated'};}function copySkillDirectory(_0x184b96,_0x51e319){copySync(_0x184b96,_0x51e319,{'dereference':![],'overwrite':!![],'filter'(_0x3a5a2a){const _0x16fd4d=a154_0x2065;if(lstatSync(_0x3a5a2a)[_0x16fd4d(0x20e)]())throw CliErrors[_0x16fd4d(0x1eb)](_0x16fd4d(0x1f3)+_0x3a5a2a);return!![];}});}
1
+ const a154_0x3c9c4a=a154_0x4ef8;(function(_0x1f16a7,_0x50ce07){const _0x48c92d=a154_0x4ef8,_0x166516=_0x1f16a7();while(!![]){try{const _0x55dcc0=parseInt(_0x48c92d(0x188))/0x1+parseInt(_0x48c92d(0x184))/0x2*(parseInt(_0x48c92d(0x18a))/0x3)+-parseInt(_0x48c92d(0x1a6))/0x4*(parseInt(_0x48c92d(0x195))/0x5)+-parseInt(_0x48c92d(0x1a4))/0x6+parseInt(_0x48c92d(0x17c))/0x7+-parseInt(_0x48c92d(0x1ad))/0x8*(-parseInt(_0x48c92d(0x192))/0x9)+parseInt(_0x48c92d(0x18b))/0xa*(parseInt(_0x48c92d(0x1a3))/0xb);if(_0x55dcc0===_0x50ce07)break;else _0x166516['push'](_0x166516['shift']());}catch(_0x28b317){_0x166516['push'](_0x166516['shift']());}}}(a154_0xa21a,0xdd5b4));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import a154_0x3ae89c from'fs-extra';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';import{isDanglingSymlink,isPathInside,lstatIfPresent,realOrResolved,resolveSymlinkTarget}from'./fs-utils.js';import{readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillCacheRoot,resolveSkillSyncPaths,safePathSegment}from'./paths.js';const {copySync,ensureDirSync,removeSync}=a154_0x3ae89c,RESERVED_PROJECT_SKILL_CODES=new Set(['lovrabet','runtime-observe',a154_0x3c9c4a(0x194)]);export function linkEffectiveRuntimeSkills(_0x14387b,_0xd80f6a){const _0x56b918=a154_0x3c9c4a,_0x4c04ce=new Map();for(const _0x919676 of _0x14387b){const _0x3499bc=_0x919676[_0x56b918(0x18e)]['skillCode'];if(!_0x3499bc)continue;const _0x50801f=_0x4c04ce[_0x56b918(0x1a9)](_0x3499bc);(!_0x50801f||_0x919676[_0x56b918(0x18c)]==='personal')&&_0x4c04ce[_0x56b918(0x17f)](_0x3499bc,_0x919676);}const _0x23a374=[];for(const _0x48cccf of _0x4c04ce[_0x56b918(0x19b)]()){const _0x94d0c6=requireSkillCode(_0x48cccf[_0x56b918(0x18e)]),_0x382b44=readMetadataIfPresent(_0x48cccf['metadataPath']);if(_0x382b44?.[_0x56b918(0x17b)]!==_0xd80f6a[_0x56b918(0x17b)]||_0x382b44[_0x56b918(0x1ac)]!==_0x94d0c6)throw CliErrors['validation'](_0x56b918(0x1a8)+_0xd80f6a['appCode']+':\x20'+_0x48cccf['metadataPath']);const _0x3cedc2=runtimeSkillLinkName(_0xd80f6a,_0x94d0c6);for(const _0x19df2c of _0xd80f6a[_0x56b918(0x187)]){_0x23a374[_0x56b918(0x179)](ensureManagedSymlink(resolve(_0x19df2c,_0x3cedc2),_0x48cccf[_0x56b918(0x183)],_0xd80f6a,_0x94d0c6));}}return _0x23a374;}export function pruneStaleRuntimeSkillLinks(_0x1ad39e,_0x1d138e,_0x5acaea){const _0x415f25=a154_0x3c9c4a,_0x2243ad=new Set([..._0x1d138e][_0x415f25(0x199)](_0x2dc3c8=>_0x2dc3c8[_0x415f25(0x1a1)]())['filter'](Boolean)),_0x25ab7d=_0x5acaea?new Set([..._0x5acaea][_0x415f25(0x199)](_0x209c7e=>_0x209c7e[_0x415f25(0x1a1)]())[_0x415f25(0x18f)](Boolean)):undefined,_0x5c95f4=[];for(const _0x393187 of _0x1ad39e[_0x415f25(0x187)]){for(const _0x405fc1 of managedTargetSkillLinkPaths(_0x393187,_0x1ad39e)){const _0x5cf097=runtimeSkillCodeFromLink(_0x1ad39e,_0x405fc1);if(_0x25ab7d&&!_0x25ab7d['has'](_0x5cf097))continue;if(_0x2243ad[_0x415f25(0x178)](_0x5cf097))continue;_0x5c95f4['push'](removeManagedSkillLink(_0x405fc1,_0x1ad39e,_0x5cf097));}}return _0x5c95f4;}export function pruneStaleRuntimeSkillCache(_0x88c4b5,_0xb3c0a0={}){const _0x36c14c=a154_0x3c9c4a,_0x1a9160=new Set([..._0x88c4b5[_0x36c14c(0x19c)]][_0x36c14c(0x199)](_0x18f6a8=>_0x18f6a8['trim']())[_0x36c14c(0x18f)](Boolean)),_0x2acfe6=_0x88c4b5[_0x36c14c(0x185)]?new Set([..._0x88c4b5[_0x36c14c(0x185)]]['map'](_0x3056c2=>_0x3056c2[_0x36c14c(0x1a1)]())['filter'](Boolean)):undefined,_0x3f77db=_0x88c4b5[_0x36c14c(0x1ab)]??[_0x36c14c(0x182),_0x36c14c(0x17a)],_0x58cb24=resolve(getRuntimeSkillCacheRoot(_0x88c4b5[_0x36c14c(0x176)],_0x88c4b5[_0x36c14c(0x19d)],_0xb3c0a0),safePathSegment(_0x88c4b5[_0x36c14c(0x17b)],_0x36c14c(0x17b))),_0x175fd5=[];for(const _0x26af46 of _0x3f77db){const _0x44e590=resolve(_0x58cb24,_0x26af46);if(!existsSync(_0x44e590))continue;for(const _0x5394e5 of readdirSync(_0x44e590,{'withFileTypes':!![]})){if(!_0x5394e5['isDirectory']())continue;const _0x1778c8=_0x5394e5['name'];if(_0x2acfe6&&!_0x2acfe6[_0x36c14c(0x178)](_0x1778c8))continue;if(_0x1a9160[_0x36c14c(0x178)](_0x1778c8))continue;const _0x109010=resolve(_0x44e590,_0x1778c8),_0xec22ab=readMetadataIfPresent(resolve(_0x109010,METADATA_FILE));if(_0xec22ab?.[_0x36c14c(0x17b)]!==_0x88c4b5[_0x36c14c(0x17b)]||_0xec22ab[_0x36c14c(0x18c)]!==_0x26af46||_0xec22ab['skillCode']!==_0x1778c8){_0x175fd5['push']({'path':_0x109010,'action':_0x36c14c(0x18d),'reason':_0x36c14c(0x1ae)});continue;}if(isLinkedFromAnyRoot(_0x109010,_0x88c4b5[_0x36c14c(0x175)]??[])){_0x175fd5[_0x36c14c(0x179)]({'path':_0x109010,'action':'skipped','reason':_0x36c14c(0x177)});continue;}removeSync(_0x109010),_0x175fd5[_0x36c14c(0x179)]({'path':_0x109010,'action':_0x36c14c(0x181)});}}return _0x175fd5;}export function linkGlobalRuntimeSkills(_0x342c54,_0x592f78={}){const _0x3bbd23=a154_0x3c9c4a,_0x2b170c=resolveSkillSyncPaths(_0x592f78),_0x9445ee=[];for(const _0x382431 of _0x342c54){if(_0x382431[_0x3bbd23(0x18c)]!==_0x3bbd23(0x180))throw CliErrors[_0x3bbd23(0x189)](_0x3bbd23(0x196)+_0x382431[_0x3bbd23(0x18c)]);const _0x52aebd=requireSkillCode(_0x382431['skill']),_0x4d4865=copyManagedSkillDirectory(_0x382431[_0x3bbd23(0x183)],resolve(_0x2b170c[_0x3bbd23(0x1a5)],_0x52aebd));_0x9445ee[_0x3bbd23(0x179)]({..._0x4d4865,'contentHash':_0x382431[_0x3bbd23(0x1a7)]});}return _0x9445ee;}function ensureManagedSymlink(_0x21616f,_0x1b4d1b,_0x510a68,_0x29e874){const _0x3f936b=a154_0x3c9c4a;mkdirSync(dirname(_0x21616f),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x21616f)||isDanglingSymlink(_0x21616f)){const _0x39e326=lstatSync(_0x21616f);if(!_0x39e326[_0x3f936b(0x1a0)]())throw CliErrors[_0x3f936b(0x189)](_0x3f936b(0x191)+_0x21616f);const _0x15bf7b=resolveSymlinkTarget(_0x21616f);if(!isPathInside(realOrResolved(_0x15bf7b),realOrResolved(_0x510a68[_0x3f936b(0x1a2)])))throw CliErrors[_0x3f936b(0x189)](_0x3f936b(0x190)+_0x21616f);if(realOrResolved(_0x15bf7b)===realOrResolved(_0x1b4d1b))return{'path':_0x21616f,'target':_0x1b4d1b,'action':'unchanged'};const _0x330661=readMetadataIfPresent(resolve(_0x15bf7b,METADATA_FILE));if(_0x510a68[_0x3f936b(0x18c)]===_0x3f936b(0x17e)&&(_0x330661?.[_0x3f936b(0x17b)]!==_0x510a68[_0x3f936b(0x17b)]||_0x330661[_0x3f936b(0x1ac)]!==_0x29e874))throw CliErrors[_0x3f936b(0x189)]('Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20'+_0x21616f);return unlinkSync(_0x21616f),symlinkSync(_0x1b4d1b,_0x21616f,'dir'),{'path':_0x21616f,'target':_0x1b4d1b,'action':_0x3f936b(0x1aa)};}return symlinkSync(_0x1b4d1b,_0x21616f,'dir'),{'path':_0x21616f,'target':_0x1b4d1b,'action':'created'};}function managedTargetSkillLinkPaths(_0x46acd2,_0x2ec944){const _0x5482d0=a154_0x3c9c4a;if(!existsSync(_0x46acd2))return[];const _0x508eb4=_0x2ec944['appCode']+'--';return readdirSync(_0x46acd2,{'withFileTypes':!![]})[_0x5482d0(0x18f)](_0x5aac9c=>_0x2ec944[_0x5482d0(0x18c)]===_0x5482d0(0x17e)||_0x5aac9c[_0x5482d0(0x17d)][_0x5482d0(0x186)](_0x508eb4))['map'](_0x3355a4=>resolve(_0x46acd2,_0x3355a4[_0x5482d0(0x17d)]));}function a154_0x4ef8(_0x2c28c1,_0x497752){_0x2c28c1=_0x2c28c1-0x175;const _0xa21add=a154_0xa21a();let _0x4ef8c7=_0xa21add[_0x2c28c1];return _0x4ef8c7;}function removeManagedSkillLink(_0x54aa56,_0x50ef32,_0x1e5d52){const _0x36242e=a154_0x3c9c4a,_0x2a5eb5=lstatIfPresent(_0x54aa56);if(!_0x2a5eb5?.[_0x36242e(0x1a0)]())return{'path':_0x54aa56,'action':'skipped','reason':_0x36242e(0x19f)};const _0x42334a=resolveSymlinkTarget(_0x54aa56);if(!isPathInside(realOrResolved(_0x42334a),realOrResolved(_0x50ef32[_0x36242e(0x1a2)])))return{'path':_0x54aa56,'action':'skipped','reason':'external-symlink'};const _0x2f038d=readMetadataIfPresent(resolve(_0x42334a,METADATA_FILE));if(_0x50ef32[_0x36242e(0x18c)]==='project'&&(_0x2f038d?.[_0x36242e(0x17b)]!==_0x50ef32[_0x36242e(0x17b)]||_0x2f038d[_0x36242e(0x1ac)]!==_0x1e5d52))return{'path':_0x54aa56,'action':_0x36242e(0x18d),'reason':_0x36242e(0x1ae)};return unlinkSync(_0x54aa56),{'path':_0x54aa56,'action':_0x36242e(0x181)};}function isLinkedFromAnyRoot(_0x5bebb8,_0x3c18cc){const _0x1019a1=a154_0x3c9c4a,_0x51413d=realOrResolved(_0x5bebb8);for(const _0x578e37 of _0x3c18cc){if(!existsSync(_0x578e37))continue;for(const _0x38081f of readdirSync(_0x578e37,{'withFileTypes':!![]})){if(!_0x38081f[_0x1019a1(0x1a0)]())continue;const _0x31e01a=resolve(_0x578e37,_0x38081f['name']);if(realOrResolved(resolveSymlinkTarget(_0x31e01a))===_0x51413d)return!![];}}return![];}function runtimeSkillLinkName(_0x5b32af,_0x2c2fea){const _0x47376d=a154_0x3c9c4a,_0x3f6fc3=safePathSegment(_0x2c2fea,_0x47376d(0x1ac));if(_0x5b32af['scope']==='project'&&RESERVED_PROJECT_SKILL_CODES[_0x47376d(0x178)](_0x3f6fc3))throw CliErrors[_0x47376d(0x189)](_0x47376d(0x197)+_0x3f6fc3);return _0x5b32af[_0x47376d(0x18c)]===_0x47376d(0x17e)?_0x3f6fc3:_0x5b32af['appCode']+'--'+_0x3f6fc3;}function runtimeSkillCodeFromLink(_0x26709b,_0x559230){const _0x1e721b=a154_0x3c9c4a,_0x51d5d5=basename(_0x559230);return _0x26709b['scope']===_0x1e721b(0x17e)?_0x51d5d5:_0x51d5d5['slice']((_0x26709b[_0x1e721b(0x17b)]+'--')[_0x1e721b(0x19e)]);}export function copyManagedSkillDirectory(_0x260c9d,_0x4ed28f){const _0x363f23=a154_0x3c9c4a,_0x2d6ca2=resolve(_0x4ed28f,METADATA_FILE),_0xd947e=existsSync(_0x4ed28f);if(_0xd947e){const _0x55f133=lstatSync(_0x4ed28f);if(_0x55f133[_0x363f23(0x1a0)]())throw CliErrors[_0x363f23(0x189)]('Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20'+_0x4ed28f);if(!_0x55f133[_0x363f23(0x193)]())throw CliErrors[_0x363f23(0x189)]('Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20'+_0x4ed28f);const _0x1d0fd2=readMetadataIfPresent(_0x2d6ca2);if(_0x1d0fd2?.[_0x363f23(0x18c)]!=='builtin')throw CliErrors[_0x363f23(0x189)](_0x363f23(0x198)+_0x4ed28f);}ensureDirSync(dirname(_0x4ed28f));const _0x171336=_0xd947e?readMetadataIfPresent(_0x2d6ca2)?.[_0x363f23(0x1a7)]:undefined,_0x2a6b89=readMetadataIfPresent(resolve(_0x260c9d,METADATA_FILE))?.[_0x363f23(0x1a7)];return _0xd947e&&removeSync(_0x4ed28f),copySkillDirectory(_0x260c9d,_0x4ed28f),{'path':_0x4ed28f,'target':_0x260c9d,'action':!_0xd947e?'created':_0x171336===_0x2a6b89?'unchanged':_0x363f23(0x1aa)};}function copySkillDirectory(_0x5c012b,_0x1fcef1){copySync(_0x5c012b,_0x1fcef1,{'dereference':![],'overwrite':!![],'filter'(_0x48be37){const _0x1a07cf=a154_0x4ef8;if(lstatSync(_0x48be37)['isSymbolicLink']())throw CliErrors[_0x1a07cf(0x189)](_0x1a07cf(0x19a)+_0x48be37);return!![];}});}function a154_0xa21a(){const _0x2af9c1=['trim','managedRoot','23639GnsVHY','6020082hNLKHi','agentsSkillsDir','4OGZGIT','contentHash','Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20','get','updated','scopes','skillCode','1200rwzFGP','metadata-mismatch','protectedLinkRoots','env','linked-from-protected-root','has','push','company','appCode','1809367ZjaANb','name','project','set','builtin','removed','personal','dir','24AnHmHq','pruneSkillCodes','startsWith','skillRoots','703331ZZAvHo','validation','52461WEbWsp','6870CzrrHP','scope','skipped','skill','filter','Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20','Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20','25677lXKYlS','isDirectory','secret-retriever','5829730eGVMSl','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20','map','Refusing\x20to\x20copy\x20Skill\x20symlink:\x20','values','activeSkillCodes','accessKey','length','not-managed-symlink','isSymbolicLink'];a154_0xa21a=function(){return _0x2af9c1;};return a154_0xa21a();}
@@ -1 +1 @@
1
- (function(_0x21bb6e,_0x1311f0){const _0x4e5be4=a155_0x3173,_0x5f02ce=_0x21bb6e();while(!![]){try{const _0x5b24ff=parseInt(_0x4e5be4(0xbb))/0x1+-parseInt(_0x4e5be4(0xb5))/0x2+-parseInt(_0x4e5be4(0xc3))/0x3*(-parseInt(_0x4e5be4(0xc0))/0x4)+-parseInt(_0x4e5be4(0xb7))/0x5+parseInt(_0x4e5be4(0xad))/0x6+-parseInt(_0x4e5be4(0xc7))/0x7+parseInt(_0x4e5be4(0xaf))/0x8*(-parseInt(_0x4e5be4(0xb2))/0x9);if(_0x5b24ff===_0x1311f0)break;else _0x5f02ce['push'](_0x5f02ce['shift']());}catch(_0x2095e8){_0x5f02ce['push'](_0x5f02ce['shift']());}}}(a155_0x3e37,0x932a3));import{existsSync,readdirSync}from'node:fs';import{resolve}from'node:path';function a155_0x3e37(){const _0x59e134=['945290hovIwm','values','isSymbolicLink','project','trim','156RPYgVL','builtin','scopes','35055CrYDVj','set','validation','push','1513708chDYQG','appCode','localeCompare','map','isDirectory','scope','tags','linkedPath','accessKey','skillRoots','isArray','sort','filter','name','code','skillCode','source','dir','skillMdPath','5110632fTSwnu','link','1273960mekPVv','cacheDir','linkedPaths','9EwUugM','\x20!=\x20','from','162744xaOnhx','metadataPath','5965645NlVikw','cache','Runtime\x20Skill\x20install\x20target\x20app\x20mismatch:\x20','local'];a155_0x3e37=function(){return _0x59e134;};return a155_0x3e37();}function a155_0x3173(_0x58ac28,_0x5783d0){_0x58ac28=_0x58ac28-0xa0;const _0x3e3766=a155_0x3e37();let _0x3173d6=_0x3e3766[_0x58ac28];return _0x3173d6;}import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{readMetadataIfPresent}from'./metadata.js';import{getRuntimeSkillCacheRoot,safePathSegment}from'./paths.js';import{isRuntimeSkillScope,normalizeRuntimeSkillScopes}from'./scopes.js';export function listLocalRuntimeSkills(_0x492e7f,_0x2200d2,_0x435099={}){const _0x6af218=a155_0x3173,_0x21b59e=safePathSegment(_0x492e7f[_0x6af218(0xc8)],_0x6af218(0xc8));if(_0x2200d2['appCode']!==_0x21b59e)throw CliErrors[_0x6af218(0xc5)](_0x6af218(0xb9)+_0x2200d2[_0x6af218(0xc8)]+_0x6af218(0xb3)+_0x21b59e);const _0xcf8f32=normalizeRuntimeSkillScopes(_0x492e7f['scopes']),_0x5e39cb=new Set(_0xcf8f32),_0x20cbfa=_0x492e7f[_0x6af218(0xa8)]?.['trim'](),_0xf61275=new Map(),_0x3614f3=resolve(getRuntimeSkillCacheRoot(_0x492e7f['env'],_0x492e7f[_0x6af218(0xa2)],_0x435099),_0x21b59e);for(const _0x54888e of _0xcf8f32){for(const _0x131fbd of localSkillEntryDirs(resolve(_0x3614f3,_0x54888e))){collectLocalRuntimeSkill(_0xf61275,_0x131fbd,{'appCode':_0x21b59e,'scopes':_0x5e39cb,'code':_0x20cbfa,'source':'cache'});}}for(const _0x1b80f3 of _0x2200d2[_0x6af218(0xa3)]){for(const _0x2cc483 of localSkillLinkCandidates(_0x1b80f3,_0x2200d2,_0x5e39cb)){collectLocalRuntimeSkill(_0xf61275,_0x2cc483,{'appCode':_0x21b59e,'scopes':_0x5e39cb,'code':_0x20cbfa,'source':_0x6af218(0xae),'linkedPath':_0x2cc483});}}return Array[_0x6af218(0xb4)](_0xf61275[_0x6af218(0xbc)]())[_0x6af218(0xa5)](compareLocalRuntimeSkills);}function localSkillEntryDirs(_0x3d0291){const _0x2c02b6=a155_0x3173;if(!existsSync(_0x3d0291))return[];return readdirSync(_0x3d0291,{'withFileTypes':!![]})[_0x2c02b6(0xa6)](_0x80427c=>_0x80427c[_0x2c02b6(0xcb)]()||_0x80427c['isSymbolicLink']())[_0x2c02b6(0xca)](_0xf9e98a=>resolve(_0x3d0291,_0xf9e98a['name']));}function localSkillLinkCandidates(_0x4af6d9,_0x4a293b,_0xa446e2){const _0x19f5cf=a155_0x3173;if(!existsSync(_0x4af6d9))return[];const _0x3f1b6b=_0x4a293b[_0x19f5cf(0xc8)]+'--';return readdirSync(_0x4af6d9,{'withFileTypes':!![]})[_0x19f5cf(0xa6)](_0x48911d=>_0x48911d[_0x19f5cf(0xcb)]()||_0x48911d[_0x19f5cf(0xbd)]())[_0x19f5cf(0xa6)](_0x4df971=>_0x4a293b[_0x19f5cf(0xcc)]===_0x19f5cf(0xbe)||_0x4df971[_0x19f5cf(0xa7)]['startsWith'](_0x3f1b6b)||_0xa446e2['has'](_0x19f5cf(0xc1)))['map'](_0x327d92=>resolve(_0x4af6d9,_0x327d92[_0x19f5cf(0xa7)]));}function collectLocalRuntimeSkill(_0x32e775,_0x7b3d32,_0x10799e){const _0xacd194=a155_0x3173,_0x136c2d=resolve(_0x7b3d32,METADATA_FILE),_0x2e3a42=readMetadataIfPresent(_0x136c2d);if(!_0x2e3a42)return;if(_0x2e3a42[_0xacd194(0xc8)]!==_0x10799e['appCode'])return;if(!isRuntimeSkillScope(_0x2e3a42[_0xacd194(0xcc)])||!_0x10799e[_0xacd194(0xc2)]['has'](_0x2e3a42[_0xacd194(0xcc)]))return;const _0x50c262=_0x2e3a42[_0xacd194(0xa9)]?.[_0xacd194(0xbf)]();if(!_0x50c262)return;if(_0x10799e[_0xacd194(0xa8)]&&_0x50c262!==_0x10799e[_0xacd194(0xa8)])return;const _0x28ef97=_0x2e3a42[_0xacd194(0xcc)]+':'+_0x50c262,_0x5a4801=_0x10799e[_0xacd194(0xa1)]?[_0x10799e['linkedPath']]:[],_0xbb17fa=_0x32e775['get'](_0x28ef97);if(_0xbb17fa){_0x10799e[_0xacd194(0xaa)]===_0xacd194(0xb8)&&(_0xbb17fa['dir']=_0x7b3d32,_0xbb17fa[_0xacd194(0xb0)]=_0x7b3d32,_0xbb17fa[_0xacd194(0xac)]=resolve(_0x7b3d32,SKILL_FILE),_0xbb17fa[_0xacd194(0xb6)]=_0x136c2d);for(const _0x48f447 of _0x5a4801){!_0xbb17fa[_0xacd194(0xb1)]['includes'](_0x48f447)&&_0xbb17fa[_0xacd194(0xb1)][_0xacd194(0xc6)](_0x48f447);}_0xbb17fa['linkedPaths'][_0xacd194(0xa5)]();return;}_0x32e775[_0xacd194(0xc4)](_0x28ef97,{..._0x2e3a42,'tags':Array[_0xacd194(0xa4)](_0x2e3a42[_0xacd194(0xa0)])?_0x2e3a42[_0xacd194(0xa0)]:[],'scope':_0x2e3a42[_0xacd194(0xcc)],'source':_0xacd194(0xba),'dir':_0x7b3d32,'cacheDir':_0x10799e['source']===_0xacd194(0xb8)?_0x7b3d32:undefined,'skillMdPath':resolve(_0x7b3d32,SKILL_FILE),'metadataPath':_0x136c2d,'linkedPaths':_0x5a4801});}function compareLocalRuntimeSkills(_0xc6a6bc,_0x3f7058){const _0x59588c=a155_0x3173,_0x6f9c10={'personal':0x0,'company':0x1,'builtin':0x2};return _0x6f9c10[_0xc6a6bc[_0x59588c(0xcc)]]-_0x6f9c10[_0x3f7058[_0x59588c(0xcc)]]||_0xc6a6bc[_0x59588c(0xa9)][_0x59588c(0xc9)](_0x3f7058['skillCode'])||_0xc6a6bc[_0x59588c(0xab)]['localeCompare'](_0x3f7058[_0x59588c(0xab)]);}
1
+ (function(_0x528c2e,_0x1f4bc6){const _0x194b41=a155_0x355b,_0xf6637a=_0x528c2e();while(!![]){try{const _0x5c3d6a=-parseInt(_0x194b41(0x93))/0x1+-parseInt(_0x194b41(0x6f))/0x2*(parseInt(_0x194b41(0x83))/0x3)+parseInt(_0x194b41(0x6b))/0x4*(parseInt(_0x194b41(0x6c))/0x5)+-parseInt(_0x194b41(0x7b))/0x6+parseInt(_0x194b41(0x79))/0x7+-parseInt(_0x194b41(0x85))/0x8+-parseInt(_0x194b41(0x7d))/0x9*(-parseInt(_0x194b41(0x73))/0xa);if(_0x5c3d6a===_0x1f4bc6)break;else _0xf6637a['push'](_0xf6637a['shift']());}catch(_0x22be11){_0xf6637a['push'](_0xf6637a['shift']());}}}(a155_0x1b71,0xd71a4));import{existsSync,readdirSync}from'node:fs';import{resolve}from'node:path';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{readMetadataIfPresent}from'./metadata.js';import{getRuntimeSkillCacheRoot,safePathSegment}from'./paths.js';import{isRuntimeSkillScope,normalizeRuntimeSkillScopes}from'./scopes.js';export function listLocalRuntimeSkills(_0xd707f7,_0x5aa5ee,_0x5dd666={}){const _0x3b93a2=a155_0x355b,_0x322e3f=safePathSegment(_0xd707f7[_0x3b93a2(0x87)],'appCode');if(_0x5aa5ee['appCode']!==_0x322e3f)throw CliErrors['validation'](_0x3b93a2(0x7f)+_0x5aa5ee[_0x3b93a2(0x87)]+'\x20!=\x20'+_0x322e3f);const _0x1cdfa4=normalizeRuntimeSkillScopes(_0xd707f7[_0x3b93a2(0x8d)]),_0x1c9c97=new Set(_0x1cdfa4),_0x584cfe=_0xd707f7[_0x3b93a2(0x90)]?.[_0x3b93a2(0x77)](),_0x32e603=new Map(),_0x825ab9=resolve(getRuntimeSkillCacheRoot(_0xd707f7[_0x3b93a2(0x78)],_0xd707f7[_0x3b93a2(0x7c)],_0x5dd666),_0x322e3f);for(const _0x59bdb3 of _0x1cdfa4){for(const _0x2e84a8 of localSkillEntryDirs(resolve(_0x825ab9,_0x59bdb3))){collectLocalRuntimeSkill(_0x32e603,_0x2e84a8,{'appCode':_0x322e3f,'scopes':_0x1c9c97,'code':_0x584cfe,'source':'cache'});}}for(const _0x3f5f88 of _0x5aa5ee[_0x3b93a2(0x89)]){for(const _0x17f916 of localSkillLinkCandidates(_0x3f5f88,_0x5aa5ee,_0x1c9c97)){collectLocalRuntimeSkill(_0x32e603,_0x17f916,{'appCode':_0x322e3f,'scopes':_0x1c9c97,'code':_0x584cfe,'source':'link','linkedPath':_0x17f916});}}return Array[_0x3b93a2(0x92)](_0x32e603[_0x3b93a2(0x8c)]())[_0x3b93a2(0x70)](compareLocalRuntimeSkills);}function a155_0x1b71(){const _0x42c9b3=['local','code','source','from','167996pzJsFt','tags','localeCompare','skillCode','2732EXBiMv','8405xmfrXi','set','project','1464DrqpTn','sort','name','cache','564800qHuayC','isSymbolicLink','linkedPaths','filter','trim','env','3476557VNFdOm','cacheDir','654066OgbCdb','accessKey','144kogafP','get','Runtime\x20Skill\x20install\x20target\x20app\x20mismatch:\x20','has','linkedPath','isDirectory','5601jfQImV','startsWith','189944fvhbAT','map','appCode','dir','skillRoots','builtin','isArray','values','scopes','scope'];a155_0x1b71=function(){return _0x42c9b3;};return a155_0x1b71();}function localSkillEntryDirs(_0x54c566){const _0x529b37=a155_0x355b;if(!existsSync(_0x54c566))return[];return readdirSync(_0x54c566,{'withFileTypes':!![]})[_0x529b37(0x76)](_0x5e5350=>_0x5e5350[_0x529b37(0x82)]()||_0x5e5350[_0x529b37(0x74)]())[_0x529b37(0x86)](_0x38370e=>resolve(_0x54c566,_0x38370e[_0x529b37(0x71)]));}function localSkillLinkCandidates(_0x5ef057,_0x5de4bb,_0x5b3f70){const _0x2f53ae=a155_0x355b;if(!existsSync(_0x5ef057))return[];const _0x2442cb=_0x5de4bb[_0x2f53ae(0x87)]+'--';return readdirSync(_0x5ef057,{'withFileTypes':!![]})['filter'](_0x5c6cb5=>_0x5c6cb5['isDirectory']()||_0x5c6cb5[_0x2f53ae(0x74)]())['filter'](_0x2a8bf8=>_0x5de4bb['scope']===_0x2f53ae(0x6e)||_0x2a8bf8[_0x2f53ae(0x71)][_0x2f53ae(0x84)](_0x2442cb)||_0x5b3f70[_0x2f53ae(0x80)](_0x2f53ae(0x8a)))[_0x2f53ae(0x86)](_0x27c641=>resolve(_0x5ef057,_0x27c641[_0x2f53ae(0x71)]));}function collectLocalRuntimeSkill(_0x35225f,_0xa58dd6,_0x120b98){const _0x210c16=a155_0x355b,_0x5e7cab=resolve(_0xa58dd6,METADATA_FILE),_0xeaf1be=readMetadataIfPresent(_0x5e7cab);if(!_0xeaf1be)return;if(_0xeaf1be['appCode']!==_0x120b98[_0x210c16(0x87)])return;if(!isRuntimeSkillScope(_0xeaf1be[_0x210c16(0x8e)])||!_0x120b98['scopes']['has'](_0xeaf1be[_0x210c16(0x8e)]))return;const _0x4ad298=_0xeaf1be[_0x210c16(0x6a)]?.[_0x210c16(0x77)]();if(!_0x4ad298)return;if(_0x120b98[_0x210c16(0x90)]&&_0x4ad298!==_0x120b98[_0x210c16(0x90)])return;const _0x38a34a=_0xeaf1be[_0x210c16(0x8e)]+':'+_0x4ad298,_0x482a87=_0x120b98['linkedPath']?[_0x120b98[_0x210c16(0x81)]]:[],_0xfc0f2=_0x35225f[_0x210c16(0x7e)](_0x38a34a);if(_0xfc0f2){_0x120b98[_0x210c16(0x91)]==='cache'&&(_0xfc0f2[_0x210c16(0x88)]=_0xa58dd6,_0xfc0f2[_0x210c16(0x7a)]=_0xa58dd6,_0xfc0f2['skillMdPath']=resolve(_0xa58dd6,SKILL_FILE),_0xfc0f2['metadataPath']=_0x5e7cab);for(const _0x543707 of _0x482a87){!_0xfc0f2[_0x210c16(0x75)]['includes'](_0x543707)&&_0xfc0f2[_0x210c16(0x75)]['push'](_0x543707);}_0xfc0f2[_0x210c16(0x75)]['sort']();return;}_0x35225f[_0x210c16(0x6d)](_0x38a34a,{..._0xeaf1be,'tags':Array[_0x210c16(0x8b)](_0xeaf1be['tags'])?_0xeaf1be[_0x210c16(0x94)]:[],'scope':_0xeaf1be[_0x210c16(0x8e)],'source':_0x210c16(0x8f),'dir':_0xa58dd6,'cacheDir':_0x120b98[_0x210c16(0x91)]===_0x210c16(0x72)?_0xa58dd6:undefined,'skillMdPath':resolve(_0xa58dd6,SKILL_FILE),'metadataPath':_0x5e7cab,'linkedPaths':_0x482a87});}function a155_0x355b(_0x18feaa,_0x1e0d60){_0x18feaa=_0x18feaa-0x69;const _0x1b71d0=a155_0x1b71();let _0x355b25=_0x1b71d0[_0x18feaa];return _0x355b25;}function compareLocalRuntimeSkills(_0x169079,_0x27e13c){const _0x42696d=a155_0x355b,_0x3ef4e9={'personal':0x0,'company':0x1,'builtin':0x2};return _0x3ef4e9[_0x169079['scope']]-_0x3ef4e9[_0x27e13c[_0x42696d(0x8e)]]||_0x169079[_0x42696d(0x6a)][_0x42696d(0x69)](_0x27e13c[_0x42696d(0x6a)])||_0x169079[_0x42696d(0x88)][_0x42696d(0x69)](_0x27e13c['dir']);}
@@ -1 +1 @@
1
- (function(_0x250f40,_0x4c1b53){const _0x170db7=a156_0x2b7d,_0x55aaca=_0x250f40();while(!![]){try{const _0x363785=-parseInt(_0x170db7(0xc7))/0x1*(parseInt(_0x170db7(0xa0))/0x2)+parseInt(_0x170db7(0xb4))/0x3+-parseInt(_0x170db7(0xaa))/0x4*(-parseInt(_0x170db7(0xb9))/0x5)+parseInt(_0x170db7(0xb7))/0x6+parseInt(_0x170db7(0xba))/0x7*(parseInt(_0x170db7(0x9d))/0x8)+-parseInt(_0x170db7(0xbb))/0x9*(-parseInt(_0x170db7(0xc0))/0xa)+-parseInt(_0x170db7(0x9e))/0xb;if(_0x363785===_0x4c1b53)break;else _0x55aaca['push'](_0x55aaca['shift']());}catch(_0x2ab8aa){_0x55aaca['push'](_0x55aaca['shift']());}}}(a156_0x1e70,0x85efa));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(_0xfa2674){const _0x12760c=a156_0x2b7d;return _0xfa2674[_0x12760c(0xc6)]??Buffer[_0x12760c(0xa2)](_0xfa2674['content']??'',_0x12760c(0xc2));}function a156_0x2b7d(_0x2bac7,_0x3e88cd){_0x2bac7=_0x2bac7-0x9d;const _0x1e704a=a156_0x1e70();let _0x2b7d3e=_0x1e704a[_0x2bac7];return _0x2b7d3e;}export function fileText(_0x84ea72){const _0x2c3808=a156_0x2b7d;return fileContent(_0x84ea72)[_0x2c3808(0xa8)](_0x2c3808(0xc2));}export function normalizeLocalFiles(_0xce59b4){const _0x4bc3d4=a156_0x2b7d;if(!Array[_0x4bc3d4(0xad)](_0xce59b4)||_0xce59b4['length']===0x0)return[];const _0x50ec68=new Map();for(const _0x995d46 of _0xce59b4){if(!_0x995d46||typeof _0x995d46!==_0x4bc3d4(0xbe)||typeof _0x995d46['path']!==_0x4bc3d4(0xc3))throw CliErrors[_0x4bc3d4(0xbf)]('Skill\x20file\x20path\x20must\x20be\x20text.');const _0x2ffbac=normalizeSkillRelativePath(_0x995d46[_0x4bc3d4(0xb2)]);if(_0x50ec68['has'](_0x2ffbac))throw CliErrors['validation'](_0x4bc3d4(0xc8)+_0x2ffbac);if(_0x995d46['bytes']!==undefined&&!Buffer[_0x4bc3d4(0xb3)](_0x995d46['bytes']))throw CliErrors[_0x4bc3d4(0xbf)](_0x4bc3d4(0xc5)+_0x2ffbac);if(_0x995d46[_0x4bc3d4(0xc6)]===undefined&&typeof _0x995d46[_0x4bc3d4(0xb1)]!==_0x4bc3d4(0xc3))throw CliErrors['validation'](_0x4bc3d4(0xae)+_0x2ffbac);const _0x395dbd=fileContent(_0x995d46);_0x50ec68[_0x4bc3d4(0xa4)](_0x2ffbac,{'path':_0x2ffbac,'bytes':_0x395dbd});}return Array[_0x4bc3d4(0xa2)](_0x50ec68[_0x4bc3d4(0x9f)]())['sort'](compareSkillFiles);}export function normalizeManifestFiles(_0x30d313){const _0x4060a0=a156_0x2b7d;if(!Array['isArray'](_0x30d313)||_0x30d313[_0x4060a0(0xa5)]===0x0)return[];const _0x36efaa=new Map();for(const _0x227ee4 of _0x30d313){if(!_0x227ee4||typeof _0x227ee4!=='object'||typeof _0x227ee4[_0x4060a0(0xb2)]!==_0x4060a0(0xc3))throw CliErrors[_0x4060a0(0xbf)](_0x4060a0(0xa7));const _0x7224b4=normalizeSkillRelativePath(_0x227ee4[_0x4060a0(0xb2)]);if(_0x36efaa[_0x4060a0(0xb8)](_0x7224b4))throw CliErrors[_0x4060a0(0xbf)](_0x4060a0(0xc8)+_0x7224b4);if(!isSha256Hex(_0x227ee4[_0x4060a0(0xbc)]))throw CliErrors[_0x4060a0(0xbf)](_0x4060a0(0xc1)+_0x7224b4);if(!Number['isSafeInteger'](_0x227ee4[_0x4060a0(0xa1)])||_0x227ee4['size']<0x0)throw CliErrors[_0x4060a0(0xbf)](_0x4060a0(0xc4)+_0x7224b4);_0x36efaa[_0x4060a0(0xa4)](_0x7224b4,{'path':_0x7224b4,'sha256':_0x227ee4[_0x4060a0(0xbc)][_0x4060a0(0xb6)](),'size':_0x227ee4[_0x4060a0(0xa1)]});}return Array[_0x4060a0(0xa2)](_0x36efaa['values']())['sort'](compareSkillFiles);}function a156_0x1e70(){const _0x261823=['Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20','localeCompare','add','content','path','isBuffer','2287059diEDHq','Unsafe\x20Skill\x20file\x20path:\x20','toLowerCase','670872zfDbsS','has','785gNSEKr','7LOzVUQ','9855qismgB','sha256','Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20','object','validation','3430EetXJE','Skill\x20file\x20sha256\x20is\x20invalid:\x20','utf8','string','Skill\x20file\x20size\x20is\x20invalid:\x20','Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20','bytes','7379PZzAWD','Duplicate\x20Skill\x20file\x20path:\x20','excludedFilePaths','test','push','845464XIBTzR','12736713COztBh','values','118aXYRfK','size','from','isDirectory','set','length','startsWith','Skill\x20file\x20path\x20must\x20be\x20text.','toString','replace','20036epJHyd','trim','name','isArray'];a156_0x1e70=function(){return _0x261823;};return a156_0x1e70();}export function scanSkillDirectory(_0x4522b5,_0x50f138={}){const _0x29edc9=a156_0x2b7d,_0xe165c3=realpathSync(_0x4522b5),_0x19ffc5=canonicalExcludedFilePaths(_0x50f138[_0x29edc9(0xc9)]),_0x30083d=[];function _0x59bb6f(_0x23f71f){const _0x10b2f8=_0x29edc9,_0x24b369=readdirSync(_0x23f71f,{'withFileTypes':!![]})['sort']((_0x2cd67b,_0x540379)=>_0x2cd67b[_0x10b2f8(0xac)][_0x10b2f8(0xaf)](_0x540379['name']));for(const _0x1853b7 of _0x24b369){if(_0x1853b7['isDirectory']()&&IGNORED_DIR_NAMES['has'](_0x1853b7[_0x10b2f8(0xac)]))continue;if(IGNORED_FILE_NAMES[_0x10b2f8(0xb8)](_0x1853b7[_0x10b2f8(0xac)]))continue;const _0x13dafd=resolve(_0x23f71f,_0x1853b7[_0x10b2f8(0xac)]);if(isExcludedFilePath(_0x13dafd,_0x19ffc5))continue;if(_0x1853b7['isSymbolicLink']())throw CliErrors[_0x10b2f8(0xbf)](_0x10b2f8(0xbd)+_0x13dafd);const _0x1879f0=toPosixPath(relative(_0xe165c3,_0x13dafd));if(_0x1853b7[_0x10b2f8(0xa3)]()){_0x59bb6f(_0x13dafd);continue;}if(!_0x1853b7['isFile']())continue;validateSkillRelativePath(_0x1879f0);const _0x56e5e0=readFileSync(_0x13dafd);_0x30083d[_0x10b2f8(0xcb)]({'path':_0x1879f0,'bytes':_0x56e5e0});}}return _0x59bb6f(_0xe165c3),normalizeLocalFiles(_0x30083d);}function canonicalExcludedFilePaths(_0x1e8690){const _0x16987d=a156_0x2b7d,_0x1ab695=new Set();for(const _0x2c48d7 of _0x1e8690??[]){const _0x2e0091=resolve(_0x2c48d7);_0x1ab695[_0x16987d(0xb0)](_0x2e0091);try{_0x1ab695[_0x16987d(0xb0)](realpathSync(_0x2e0091));}catch{}}return _0x1ab695;}function isExcludedFilePath(_0xa6e8ff,_0x26b6ad){const _0x4d7497=a156_0x2b7d;if(_0x26b6ad[_0x4d7497(0xb8)](_0xa6e8ff))return!![];if(_0x26b6ad[_0x4d7497(0xa1)]===0x0)return![];try{return _0x26b6ad[_0x4d7497(0xb8)](realpathSync(_0xa6e8ff));}catch{return![];}}export function compareSkillFiles(_0x14ede1,_0x4a0701){const _0x361dfe=a156_0x2b7d;if(_0x14ede1[_0x361dfe(0xb2)]===SKILL_FILE)return _0x4a0701['path']===SKILL_FILE?0x0:-0x1;if(_0x4a0701[_0x361dfe(0xb2)]===SKILL_FILE)return 0x1;return Buffer['compare'](Buffer[_0x361dfe(0xa2)](_0x14ede1[_0x361dfe(0xb2)],_0x361dfe(0xc2)),Buffer['from'](_0x4a0701[_0x361dfe(0xb2)],'utf8'));}export function normalizeSkillRelativePath(_0x66f87c){const _0x5eddae=a156_0x2b7d,_0x3a9609=toPosixPath(_0x66f87c[_0x5eddae(0xab)]());return validateSkillRelativePath(_0x3a9609),_0x3a9609;}export function validateSkillRelativePath(_0x3ca81b){const _0x2608ff=a156_0x2b7d;if(!_0x3ca81b||_0x3ca81b[_0x2608ff(0xa6)]('/')||_0x3ca81b['includes']('//'))throw CliErrors[_0x2608ff(0xbf)](_0x2608ff(0xb5)+_0x3ca81b);for(const _0x375e85 of _0x3ca81b['split']('/')){if(!_0x375e85||_0x375e85==='.'||_0x375e85==='..')throw CliErrors['validation'](_0x2608ff(0xb5)+_0x3ca81b);}}export function toPosixPath(_0x1516f){const _0x4ea3c2=a156_0x2b7d;return _0x1516f[_0x4ea3c2(0xa9)](/\\/g,'/');}export function isSha256Hex(_0x3329eb){const _0x3ff863=a156_0x2b7d;return typeof _0x3329eb===_0x3ff863(0xc3)&&/^[a-fA-F0-9]{64}$/[_0x3ff863(0xca)](_0x3329eb);}
1
+ (function(_0x4673d9,_0x243a11){const _0x3d3c0e=a156_0x3a38,_0x5f336e=_0x4673d9();while(!![]){try{const _0x4f61ba=-parseInt(_0x3d3c0e(0x15c))/0x1+parseInt(_0x3d3c0e(0x154))/0x2+-parseInt(_0x3d3c0e(0x169))/0x3*(parseInt(_0x3d3c0e(0x146))/0x4)+-parseInt(_0x3d3c0e(0x148))/0x5*(-parseInt(_0x3d3c0e(0x16e))/0x6)+parseInt(_0x3d3c0e(0x155))/0x7+parseInt(_0x3d3c0e(0x150))/0x8*(parseInt(_0x3d3c0e(0x15f))/0x9)+-parseInt(_0x3d3c0e(0x15b))/0xa;if(_0x4f61ba===_0x243a11)break;else _0x5f336e['push'](_0x5f336e['shift']());}catch(_0x479ac3){_0x5f336e['push'](_0x5f336e['shift']());}}}(a156_0x47af,0xedbea));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(_0x1b7090){const _0xbdd0c8=a156_0x3a38;return _0x1b7090[_0xbdd0c8(0x168)]??Buffer[_0xbdd0c8(0x14b)](_0x1b7090[_0xbdd0c8(0x151)]??'','utf8');}export function fileText(_0x5e4d44){const _0x52d437=a156_0x3a38;return fileContent(_0x5e4d44)[_0x52d437(0x163)](_0x52d437(0x16b));}export function normalizeLocalFiles(_0x4a01b0){const _0x55ca15=a156_0x3a38;if(!Array['isArray'](_0x4a01b0)||_0x4a01b0[_0x55ca15(0x14e)]===0x0)return[];const _0x45859a=new Map();for(const _0x51cb8c of _0x4a01b0){if(!_0x51cb8c||typeof _0x51cb8c!==_0x55ca15(0x16c)||typeof _0x51cb8c[_0x55ca15(0x16a)]!=='string')throw CliErrors['validation'](_0x55ca15(0x14d));const _0x335cb4=normalizeSkillRelativePath(_0x51cb8c[_0x55ca15(0x16a)]);if(_0x45859a['has'](_0x335cb4))throw CliErrors['validation']('Duplicate\x20Skill\x20file\x20path:\x20'+_0x335cb4);if(_0x51cb8c[_0x55ca15(0x168)]!==undefined&&!Buffer[_0x55ca15(0x15d)](_0x51cb8c['bytes']))throw CliErrors['validation']('Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20'+_0x335cb4);if(_0x51cb8c[_0x55ca15(0x168)]===undefined&&typeof _0x51cb8c[_0x55ca15(0x151)]!==_0x55ca15(0x167))throw CliErrors[_0x55ca15(0x16d)](_0x55ca15(0x156)+_0x335cb4);const _0x4976e0=fileContent(_0x51cb8c);_0x45859a[_0x55ca15(0x14a)](_0x335cb4,{'path':_0x335cb4,'bytes':_0x4976e0});}return Array[_0x55ca15(0x14b)](_0x45859a[_0x55ca15(0x143)]())[_0x55ca15(0x147)](compareSkillFiles);}export function normalizeManifestFiles(_0x4841ad){const _0x5b8abc=a156_0x3a38;if(!Array['isArray'](_0x4841ad)||_0x4841ad[_0x5b8abc(0x14e)]===0x0)return[];const _0x278746=new Map();for(const _0x3397f8 of _0x4841ad){if(!_0x3397f8||typeof _0x3397f8!==_0x5b8abc(0x16c)||typeof _0x3397f8[_0x5b8abc(0x16a)]!=='string')throw CliErrors[_0x5b8abc(0x16d)](_0x5b8abc(0x14d));const _0x414395=normalizeSkillRelativePath(_0x3397f8[_0x5b8abc(0x16a)]);if(_0x278746[_0x5b8abc(0x152)](_0x414395))throw CliErrors[_0x5b8abc(0x16d)](_0x5b8abc(0x149)+_0x414395);if(!isSha256Hex(_0x3397f8[_0x5b8abc(0x153)]))throw CliErrors['validation'](_0x5b8abc(0x15a)+_0x414395);if(!Number[_0x5b8abc(0x145)](_0x3397f8[_0x5b8abc(0x159)])||_0x3397f8[_0x5b8abc(0x159)]<0x0)throw CliErrors['validation'](_0x5b8abc(0x161)+_0x414395);_0x278746[_0x5b8abc(0x14a)](_0x414395,{'path':_0x414395,'sha256':_0x3397f8['sha256']['toLowerCase'](),'size':_0x3397f8['size']});}return Array[_0x5b8abc(0x14b)](_0x278746['values']())[_0x5b8abc(0x147)](compareSkillFiles);}export function scanSkillDirectory(_0x51564e,_0x268ead={}){const _0x36bd41=realpathSync(_0x51564e),_0x2cf27e=canonicalExcludedFilePaths(_0x268ead['excludedFilePaths']),_0xdf5cdb=[];function _0x2e1046(_0x56b7e0){const _0x22f921=a156_0x3a38,_0x3da09e=readdirSync(_0x56b7e0,{'withFileTypes':!![]})['sort']((_0x30ccb5,_0x49f03c)=>_0x30ccb5[_0x22f921(0x166)]['localeCompare'](_0x49f03c[_0x22f921(0x166)]));for(const _0x47cec1 of _0x3da09e){if(_0x47cec1[_0x22f921(0x162)]()&&IGNORED_DIR_NAMES[_0x22f921(0x152)](_0x47cec1['name']))continue;if(IGNORED_FILE_NAMES[_0x22f921(0x152)](_0x47cec1[_0x22f921(0x166)]))continue;const _0x44afd1=resolve(_0x56b7e0,_0x47cec1['name']);if(isExcludedFilePath(_0x44afd1,_0x2cf27e))continue;if(_0x47cec1[_0x22f921(0x144)]())throw CliErrors[_0x22f921(0x16d)](_0x22f921(0x158)+_0x44afd1);const _0x21e737=toPosixPath(relative(_0x36bd41,_0x44afd1));if(_0x47cec1[_0x22f921(0x162)]()){_0x2e1046(_0x44afd1);continue;}if(!_0x47cec1[_0x22f921(0x160)]())continue;validateSkillRelativePath(_0x21e737);const _0x2eb096=readFileSync(_0x44afd1);_0xdf5cdb['push']({'path':_0x21e737,'bytes':_0x2eb096});}}return _0x2e1046(_0x36bd41),normalizeLocalFiles(_0xdf5cdb);}function canonicalExcludedFilePaths(_0x471393){const _0x4b37ff=a156_0x3a38,_0x5ecc09=new Set();for(const _0x376b89 of _0x471393??[]){const _0x44b567=resolve(_0x376b89);_0x5ecc09[_0x4b37ff(0x14c)](_0x44b567);try{_0x5ecc09[_0x4b37ff(0x14c)](realpathSync(_0x44b567));}catch{}}return _0x5ecc09;}function isExcludedFilePath(_0x5e9ece,_0x555d9d){const _0xa36ea8=a156_0x3a38;if(_0x555d9d[_0xa36ea8(0x152)](_0x5e9ece))return!![];if(_0x555d9d['size']===0x0)return![];try{return _0x555d9d[_0xa36ea8(0x152)](realpathSync(_0x5e9ece));}catch{return![];}}function a156_0x3a38(_0xbd0549,_0x175fa2){_0xbd0549=_0xbd0549-0x143;const _0x47af9f=a156_0x47af();let _0x3a3805=_0x47af9f[_0xbd0549];return _0x3a3805;}export function compareSkillFiles(_0x49cee4,_0x5c34b9){const _0x19ea20=a156_0x3a38;if(_0x49cee4[_0x19ea20(0x16a)]===SKILL_FILE)return _0x5c34b9[_0x19ea20(0x16a)]===SKILL_FILE?0x0:-0x1;if(_0x5c34b9['path']===SKILL_FILE)return 0x1;return Buffer['compare'](Buffer[_0x19ea20(0x14b)](_0x49cee4[_0x19ea20(0x16a)],'utf8'),Buffer[_0x19ea20(0x14b)](_0x5c34b9[_0x19ea20(0x16a)],_0x19ea20(0x16b)));}export function normalizeSkillRelativePath(_0x5268ef){const _0x1f6eaa=a156_0x3a38,_0x3b26f7=toPosixPath(_0x5268ef[_0x1f6eaa(0x16f)]());return validateSkillRelativePath(_0x3b26f7),_0x3b26f7;}function a156_0x47af(){const _0x3f1824=['884730FPHGjB','isBuffer','replace','45ubYIfn','isFile','Skill\x20file\x20size\x20is\x20invalid:\x20','isDirectory','toString','includes','split','name','string','bytes','787002OHOila','path','utf8','object','validation','18LVrXrl','trim','values','isSymbolicLink','isSafeInteger','28CmlJup','sort','2977885RtQqQg','Duplicate\x20Skill\x20file\x20path:\x20','set','from','add','Skill\x20file\x20path\x20must\x20be\x20text.','length','Unsafe\x20Skill\x20file\x20path:\x20','526616lddzIT','content','has','sha256','2328544cwjaJH','11183473BLYlaH','Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20','test','Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20','size','Skill\x20file\x20sha256\x20is\x20invalid:\x20','11829070vCQttB'];a156_0x47af=function(){return _0x3f1824;};return a156_0x47af();}export function validateSkillRelativePath(_0x584f1b){const _0x512351=a156_0x3a38;if(!_0x584f1b||_0x584f1b['startsWith']('/')||_0x584f1b[_0x512351(0x164)]('//'))throw CliErrors[_0x512351(0x16d)](_0x512351(0x14f)+_0x584f1b);for(const _0x3ce79a of _0x584f1b[_0x512351(0x165)]('/')){if(!_0x3ce79a||_0x3ce79a==='.'||_0x3ce79a==='..')throw CliErrors[_0x512351(0x16d)](_0x512351(0x14f)+_0x584f1b);}}export function toPosixPath(_0x313df8){const _0x3a1204=a156_0x3a38;return _0x313df8[_0x3a1204(0x15e)](/\\/g,'/');}export function isSha256Hex(_0x34f6ad){const _0x458dff=a156_0x3a38;return typeof _0x34f6ad===_0x458dff(0x167)&&/^[a-fA-F0-9]{64}$/[_0x458dff(0x157)](_0x34f6ad);}
@@ -1 +1 @@
1
- (function(_0x29e779,_0x2b7616){const _0x5e7bf2=a157_0x26d0,_0x5c3b1c=_0x29e779();while(!![]){try{const _0x2357b1=parseInt(_0x5e7bf2(0x84))/0x1+parseInt(_0x5e7bf2(0x83))/0x2+-parseInt(_0x5e7bf2(0x9a))/0x3*(parseInt(_0x5e7bf2(0x7c))/0x4)+parseInt(_0x5e7bf2(0x6e))/0x5*(-parseInt(_0x5e7bf2(0xa6))/0x6)+-parseInt(_0x5e7bf2(0x72))/0x7*(parseInt(_0x5e7bf2(0x8d))/0x8)+-parseInt(_0x5e7bf2(0xa7))/0x9+parseInt(_0x5e7bf2(0x87))/0xa*(parseInt(_0x5e7bf2(0x7a))/0xb);if(_0x2357b1===_0x2b7616)break;else _0x5c3b1c['push'](_0x5c3b1c['shift']());}catch(_0x1b5a8a){_0x5c3b1c['push'](_0x5c3b1c['shift']());}}}(a157_0x427d,0xa5058));function a157_0x26d0(_0x1b17e0,_0x1de80b){_0x1b17e0=_0x1b17e0-0x6c;const _0x427d2a=a157_0x427d();let _0x26d02b=_0x427d2a[_0x1b17e0];return _0x26d02b;}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(_0x3e90f5,_0x3bc6e7,_0x3547a2){const _0x1c716d=a157_0x26d0,_0x133b42=requireSkillCode(_0x3e90f5),_0xd4bec1=requirePackageBytes(_0x133b42,_0x3547a2[_0x1c716d(0x88)]),_0xc90479=extractDownloadedPackage(_0xd4bec1),_0x42dd78=_0xc90479['find'](_0x148e36=>_0x148e36[_0x1c716d(0x98)]===SKILL_FILE);if(!_0x42dd78)throw CliErrors[_0x1c716d(0x92)]('Runtime\x20Skill\x20package\x20is\x20missing\x20'+SKILL_FILE+':\x20'+_0x133b42);const _0x3cc11a=withMaterializedSkillFrontmatter(_0xc90479,_0x3e90f5,_0x133b42),_0x2cc7df=_0x3cc11a[_0x1c716d(0xaa)](_0x58e9eb=>_0x58e9eb[_0x1c716d(0x98)]===SKILL_FILE),_0x3303d4=fileText(_0x2cc7df),_0x3a2b8e=getRuntimeSkillDir(_0x3547a2[_0x1c716d(0x9f)],_0x3547a2[_0x1c716d(0x95)],_0x3547a2[_0x1c716d(0xa1)],_0x3bc6e7,_0x133b42,_0x3547a2[_0x1c716d(0x7d)]),_0x833da2=resolve(_0x3a2b8e,SKILL_FILE),_0x59a2ce=resolve(_0x3a2b8e,METADATA_FILE),_0x3065f8=contentHash(_0x3303d4),_0x20ca18=readMetadataIfPresent(_0x59a2ce)?.['fileHashes'];ensurePulledFilesCanBeOverwritten(_0x3a2b8e,_0x59a2ce,_0x3cc11a,_0x3547a2[_0x1c716d(0x6d)]===!![]),mkdirSync(_0x3a2b8e,{'recursive':!![],'mode':0x1c0});const _0x483eed=existsSync(_0x833da2)?readFileSync(_0x833da2,_0x1c716d(0x76)):undefined;return materializeFiles(_0x3a2b8e,_0x3cc11a),removeStaleManagedFiles(_0x3a2b8e,_0x20ca18,_0x3cc11a),writeJsonAtomic(_0x59a2ce,buildMetadata(_0x3e90f5,_0x3bc6e7,_0x3547a2[_0x1c716d(0xa1)],_0x3065f8,_0x3547a2[_0x1c716d(0x93)],_0x3cc11a,_0xd4bec1)),{'skill':_0x3e90f5,'scope':_0x3bc6e7,'dir':_0x3a2b8e,'skillMdPath':_0x833da2,'metadataPath':_0x59a2ce,'contentHash':_0x3065f8,'changed':_0x483eed!==_0x3303d4};}export function reuseMaterializedRuntimeSkill(_0x9dd935,_0x323adc,_0x42c08d){const _0x3fb132=a157_0x26d0,_0x2643fd=_0x9dd935['version']?.[_0x3fb132(0xa9)]();if(!_0x2643fd)return undefined;const _0x28418b=requireSkillCode(_0x9dd935),_0x263efd=getRuntimeSkillDir(_0x42c08d['env'],_0x42c08d[_0x3fb132(0x95)],_0x42c08d[_0x3fb132(0xa1)],_0x323adc,_0x28418b,_0x42c08d['paths']),_0x56c664=resolve(_0x263efd,SKILL_FILE),_0x539b2e=resolve(_0x263efd,METADATA_FILE),_0x4aa1ae=readMetadataIfPresent(_0x539b2e);if(!_0x4aa1ae||_0x4aa1ae[_0x3fb132(0x7e)]!==0x2||_0x4aa1ae[_0x3fb132(0xa1)]!==_0x42c08d[_0x3fb132(0xa1)]||_0x4aa1ae[_0x3fb132(0x78)]!==_0x323adc||_0x4aa1ae[_0x3fb132(0x9c)]!==_0x28418b||_0x4aa1ae[_0x3fb132(0x8a)]!==_0x2643fd||_0x4aa1ae['id']!==_0x9dd935['id']||_0x4aa1ae[_0x3fb132(0x77)]!==_0x9dd935['skillName']||_0x4aa1ae['description']!==_0x9dd935['description']||_0x4aa1ae[_0x3fb132(0xa0)]!==_0x9dd935[_0x3fb132(0xa0)]||_0x4aa1ae[_0x3fb132(0xa8)]!==_0x9dd935['status']||!_0x4aa1ae['contentHash']||!_0x4aa1ae['fileHashes']||!Object[_0x3fb132(0x86)](_0x4aa1ae['fileHashes'],SKILL_FILE))return undefined;for(const [_0x3be0c5,_0x3ffa7a]of Object[_0x3fb132(0x8f)](_0x4aa1ae[_0x3fb132(0x9b)])){if(!/^[a-f0-9]{64}$/[_0x3fb132(0x6c)](_0x3ffa7a))return undefined;const _0x5a559e=resolveManagedFilePath(_0x263efd,_0x3be0c5);if(!existsSync(_0x5a559e)||!lstatSync(_0x5a559e)[_0x3fb132(0x9d)]())return undefined;if(bufferSha256(readFileSync(_0x5a559e))!==_0x3ffa7a)return undefined;}return{'skill':_0x9dd935,'scope':_0x323adc,'dir':_0x263efd,'skillMdPath':_0x56c664,'metadataPath':_0x539b2e,'contentHash':_0x4aa1ae['contentHash'],'changed':![]};}function withMaterializedSkillFrontmatter(_0x1f9b0f,_0x176ac0,_0xa95b25){const _0x42609f=a157_0x26d0,_0x4ced70=skillDisplayName(_0x176ac0,_0xa95b25),_0x5a5daf=_0x176ac0[_0x42609f(0x71)]?.[_0x42609f(0xa9)]()||_0x4ced70||_0xa95b25;return normalizeLocalFiles(_0x1f9b0f)[_0x42609f(0x80)](_0x4863d3=>{const _0x1bf566=_0x42609f,_0x4bc82c=fileText(_0x4863d3);if(_0x4863d3['path']!==SKILL_FILE)return _0x4863d3;if(hasYamlFrontmatter(_0x4bc82c))return{'path':_0x4863d3[_0x1bf566(0x98)],'content':withSyncedDisplayName(_0x4bc82c,_0x4ced70)};return{'path':_0x4863d3[_0x1bf566(0x98)],'content':prependSkillFrontmatter(_0x4bc82c,{'name':_0xa95b25,'displayName':_0x4ced70,'description':_0x5a5daf})};});}function hasYamlFrontmatter(_0x1dfd66){const _0x26103f=a157_0x26d0;return/^\uFEFF?---\s*\r?\n/[_0x26103f(0x6c)](_0x1dfd66);}function prependSkillFrontmatter(_0x1164aa,_0x1880e4){const _0x1a9f96=a157_0x26d0,_0x505fef=_0x1164aa['replace'](/^\uFEFF/,'');return['---',_0x1a9f96(0xa2)+yamlString(_0x1880e4[_0x1a9f96(0x8c)]),_0x1880e4['displayName']?_0x1a9f96(0x94)+yamlString(_0x1880e4[_0x1a9f96(0x7b)]):undefined,'description:\x20'+yamlString(_0x1880e4[_0x1a9f96(0x71)]),'---','',_0x505fef]['filter'](_0x17eb76=>_0x17eb76!==undefined)[_0x1a9f96(0x85)]('\x0a');}function yamlString(_0x5736c5){const _0x5ea58f=a157_0x26d0;return JSON[_0x5ea58f(0xa5)](_0x5736c5[_0x5ea58f(0xa3)](/\r/g,'')[_0x5ea58f(0xa9)]());}function skillDisplayName(_0x165bdc,_0x168b6a){const _0x290246=a157_0x26d0,_0x4e1a0d=_0x165bdc[_0x290246(0x77)]?.[_0x290246(0xa9)]();return _0x4e1a0d||_0x168b6a;}function a157_0x427d(){const _0x138fdf=['scope','flow','11bpztjj','displayName','8zdwRtk','paths','schemaVersion','slice','map','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','2577016RLrcWd','257337rhHayh','join','hasOwn','23336170fDNJfO','packageBytes','Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20','version','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','name','57736qpfoYi','match','entries','length','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','validation','pulledAt','displayName:\x20','accessKey','delete','has','path','---\x0a','1702803xlCxqE','fileHashes','skillCode','isFile','\x0a---\x0a\x0a','env','example','appCode','name:\x20','replace','trimEnd','stringify','6iNtmmw','7721568AGWZFq','status','trim','find','test','force','2551655maQrgd','Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','description','679mkgnOi','contentHash','keys','toString','utf8','skillName'];a157_0x427d=function(){return _0x138fdf;};return a157_0x427d();}function withSyncedDisplayName(_0x563a15,_0x4a5361){const _0x3f87dc=a157_0x26d0,_0x5c727c=_0x563a15[_0x3f87dc(0x8e)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x5c727c)return _0x563a15;const _0x4cad3c=_0x5c727c[0x1]??'',_0x51f16c=_0x5c727c[0x2]??'',_0x16c314=parseDocument(_0x51f16c);if(_0x16c314['errors'][_0x3f87dc(0x90)]>0x0||!isMap(_0x16c314['contents']))return _0x563a15;if(_0x4a5361)_0x16c314['set'](_0x3f87dc(0x7b),_0x4a5361);else{if(_0x16c314[_0x3f87dc(0x97)]('displayName'))_0x16c314[_0x3f87dc(0x96)]('displayName');else return _0x563a15;}forceBlockCollections(_0x16c314['contents']);const _0x3e7bc0=_0x16c314[_0x3f87dc(0x75)]({'lineWidth':0x0})[_0x3f87dc(0xa4)](),_0x225c45=_0x563a15[_0x3f87dc(0x7f)](_0x5c727c[0x0][_0x3f87dc(0x90)])['replace'](/^\r?\n/,'');return _0x4cad3c+_0x3f87dc(0x99)+_0x3e7bc0+_0x3f87dc(0x9e)+_0x225c45;}function forceBlockCollections(_0x15a499){if(!isNode(_0x15a499))return;visit(_0x15a499,(_0x41f0ce,_0x5911a6)=>{const _0x3e5500=a157_0x26d0;isCollection(_0x5911a6)&&(_0x5911a6[_0x3e5500(0x79)]=![]);});}function ensurePulledFilesCanBeOverwritten(_0x48b04b,_0x45692b,_0x3fd56a,_0x52246c){const _0x39741e=a157_0x26d0;if(_0x52246c||!existsSync(_0x45692b))return;const _0x4f73af=readMetadataIfPresent(_0x45692b);if(!_0x4f73af)return;const _0x13753a=_0x4f73af['fileHashes']&&Object[_0x39741e(0x74)](_0x4f73af[_0x39741e(0x9b)])[_0x39741e(0x90)]>0x0?_0x4f73af[_0x39741e(0x9b)]:undefined;if(_0x13753a)for(const [_0x1a07b8,_0x3093b2]of Object[_0x39741e(0x8f)](_0x13753a)){const _0x6b1c72=resolveManagedFilePath(_0x48b04b,_0x1a07b8);if(!existsSync(_0x6b1c72))throw CliErrors[_0x39741e(0x92)](_0x39741e(0x82)+_0x48b04b,'Managed\x20file\x20was\x20removed\x20locally:\x20'+_0x1a07b8);const _0x104a0f=lstatSync(_0x6b1c72);if(!_0x104a0f['isFile']())throw CliErrors[_0x39741e(0x92)](_0x39741e(0x82)+_0x48b04b,_0x39741e(0x6f)+_0x1a07b8);const _0x359146=bufferSha256(readFileSync(_0x6b1c72));if(_0x359146!==_0x3093b2)throw CliErrors[_0x39741e(0x92)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x48b04b+'.\x20Changed\x20file:\x20'+_0x1a07b8,_0x39741e(0x8b)+_0x1a07b8);}else{const _0x2c487f=resolve(_0x48b04b,SKILL_FILE);if(existsSync(_0x2c487f)&&_0x4f73af[_0x39741e(0x73)]){const _0x2f843a=contentHash(readFileSync(_0x2c487f,'utf8'));if(_0x2f843a!==_0x4f73af[_0x39741e(0x73)])throw CliErrors['validation'](_0x39741e(0x70)+_0x2c487f,_0x39741e(0x81));}}for(const _0x3fff29 of normalizeLocalFiles(_0x3fd56a)){if(_0x13753a?.[_0x3fff29[_0x39741e(0x98)]])continue;if(!_0x13753a&&_0x3fff29[_0x39741e(0x98)]===SKILL_FILE)continue;const _0x2dcfb3=resolveManagedFilePath(_0x48b04b,_0x3fff29[_0x39741e(0x98)]);if(!existsSync(_0x2dcfb3))continue;const _0xaceb59=lstatSync(_0x2dcfb3);if(!_0xaceb59[_0x39741e(0x9d)]())throw CliErrors[_0x39741e(0x92)](_0x39741e(0x82)+_0x48b04b,_0x39741e(0x91)+_0x3fff29[_0x39741e(0x98)]);const _0x30c512=bufferSha256(readFileSync(_0x2dcfb3));if(_0x30c512!==fileHash(_0x3fff29))throw CliErrors['validation'](_0x39741e(0x82)+_0x48b04b,_0x39741e(0x89)+_0x3fff29[_0x39741e(0x98)]);}}function materializeFiles(_0x3aca18,_0x478073){const _0x29fd0c=a157_0x26d0;for(const _0x1d9edb of normalizeLocalFiles(_0x478073)){const _0x337dd3=resolveManagedFilePath(_0x3aca18,_0x1d9edb[_0x29fd0c(0x98)]);mkdirSync(dirname(_0x337dd3),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x337dd3,fileContent(_0x1d9edb),0x180);}}function removeStaleManagedFiles(_0x22dbb0,_0x3a189d,_0x17e07a){const _0x112b30=a157_0x26d0;if(!_0x3a189d)return;const _0x276f4a=new Set(normalizeLocalFiles(_0x17e07a)[_0x112b30(0x80)](_0x44cd92=>_0x44cd92[_0x112b30(0x98)]));for(const _0x33e121 of Object[_0x112b30(0x74)](_0x3a189d)){if(_0x276f4a[_0x112b30(0x97)](_0x33e121))continue;const _0x2347ae=resolveManagedFilePath(_0x22dbb0,_0x33e121);existsSync(_0x2347ae)&&lstatSync(_0x2347ae)['isFile']()&&rmSync(_0x2347ae,{'force':!![]});}}
1
+ (function(_0x35379f,_0x4bda64){const _0x5e39bb=a157_0xa0bc,_0x1e309c=_0x35379f();while(!![]){try{const _0x45bf60=parseInt(_0x5e39bb(0x1ea))/0x1+parseInt(_0x5e39bb(0x20c))/0x2+-parseInt(_0x5e39bb(0x1e0))/0x3*(parseInt(_0x5e39bb(0x1e7))/0x4)+parseInt(_0x5e39bb(0x20f))/0x5*(parseInt(_0x5e39bb(0x1e6))/0x6)+parseInt(_0x5e39bb(0x201))/0x7+parseInt(_0x5e39bb(0x1da))/0x8+-parseInt(_0x5e39bb(0x1d6))/0x9*(parseInt(_0x5e39bb(0x1e8))/0xa);if(_0x45bf60===_0x4bda64)break;else _0x1e309c['push'](_0x1e309c['shift']());}catch(_0x3debc0){_0x1e309c['push'](_0x1e309c['shift']());}}}(a157_0x5463,0x40410));import{existsSync,lstatSync,mkdirSync,readFileSync,rmSync}from'node:fs';import{dirname,resolve}from'node:path';import{isCollection,isMap,isNode,parseDocument,visit}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{resolveManagedFilePath,writeBytesAtomic,writeJsonAtomic}from'./fs-utils.js';import{bufferSha256,contentHash,fileHash}from'./hashing.js';function a157_0x5463(){const _0x3c5357=['676917JaWqke','trim','hasOwn','join','1967600GhronW','trimEnd','replace','Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20','scope','displayName','909mnxlHQ','Runtime\x20Skill\x20package\x20is\x20missing\x20','contentHash','map','pulledAt','Managed\x20file\x20was\x20removed\x20locally:\x20','474vcgNLn','4208ahNdUD','50votLGD','contents','170653mxihAu','delete','schemaVersion','.\x20Changed\x20file:\x20','entries','name:\x20','displayName:\x20','find','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','accessKey','stringify','force','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.','paths','toString','utf8','skillName','version','test','description','keys','Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20','status','268163BOPzxB','description:\x20','filter','appCode','fileHashes','\x0a---\x0a\x0a','validation','flow','path','has','example','172736LcqDmg','errors','length','26375QRYtjZ','---','slice','isFile'];a157_0x5463=function(){return _0x3c5357;};return a157_0x5463();}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(_0x2fa795,_0x4c2cbe,_0x3d6f75){const _0x2012b8=a157_0xa0bc,_0x4da5e1=requireSkillCode(_0x2fa795),_0x507528=requirePackageBytes(_0x4da5e1,_0x3d6f75['packageBytes']),_0x5d42d2=extractDownloadedPackage(_0x507528),_0x1eb811=_0x5d42d2['find'](_0x1a6f59=>_0x1a6f59['path']===SKILL_FILE);if(!_0x1eb811)throw CliErrors[_0x2012b8(0x207)](_0x2012b8(0x1e1)+SKILL_FILE+':\x20'+_0x4da5e1);const _0x7c42ff=withMaterializedSkillFrontmatter(_0x5d42d2,_0x2fa795,_0x4da5e1),_0x124bdd=_0x7c42ff[_0x2012b8(0x1f1)](_0x2f98fe=>_0x2f98fe[_0x2012b8(0x209)]===SKILL_FILE),_0xe69967=fileText(_0x124bdd),_0x4abd67=getRuntimeSkillDir(_0x3d6f75['env'],_0x3d6f75['accessKey'],_0x3d6f75['appCode'],_0x4c2cbe,_0x4da5e1,_0x3d6f75[_0x2012b8(0x1f7)]),_0x484a87=resolve(_0x4abd67,SKILL_FILE),_0x192ccf=resolve(_0x4abd67,METADATA_FILE),_0x1470f4=contentHash(_0xe69967),_0x1142f8=readMetadataIfPresent(_0x192ccf)?.['fileHashes'];ensurePulledFilesCanBeOverwritten(_0x4abd67,_0x192ccf,_0x7c42ff,_0x3d6f75[_0x2012b8(0x1f5)]===!![]),mkdirSync(_0x4abd67,{'recursive':!![],'mode':0x1c0});const _0x27670a=existsSync(_0x484a87)?readFileSync(_0x484a87,_0x2012b8(0x1f9)):undefined;return materializeFiles(_0x4abd67,_0x7c42ff),removeStaleManagedFiles(_0x4abd67,_0x1142f8,_0x7c42ff),writeJsonAtomic(_0x192ccf,buildMetadata(_0x2fa795,_0x4c2cbe,_0x3d6f75[_0x2012b8(0x204)],_0x1470f4,_0x3d6f75[_0x2012b8(0x1e4)],_0x7c42ff,_0x507528)),{'skill':_0x2fa795,'scope':_0x4c2cbe,'dir':_0x4abd67,'skillMdPath':_0x484a87,'metadataPath':_0x192ccf,'contentHash':_0x1470f4,'changed':_0x27670a!==_0xe69967};}export function reuseMaterializedRuntimeSkill(_0x21521f,_0x155240,_0x36294b){const _0x33dc18=a157_0xa0bc,_0x3e9468=_0x21521f[_0x33dc18(0x1fb)]?.['trim']();if(!_0x3e9468)return undefined;const _0x5541c0=requireSkillCode(_0x21521f),_0x2fbee0=getRuntimeSkillDir(_0x36294b['env'],_0x36294b[_0x33dc18(0x1f3)],_0x36294b[_0x33dc18(0x204)],_0x155240,_0x5541c0,_0x36294b[_0x33dc18(0x1f7)]),_0x3b5063=resolve(_0x2fbee0,SKILL_FILE),_0x3c428d=resolve(_0x2fbee0,METADATA_FILE),_0x53a1bf=readMetadataIfPresent(_0x3c428d);if(!_0x53a1bf||_0x53a1bf[_0x33dc18(0x1ec)]!==0x2||_0x53a1bf[_0x33dc18(0x204)]!==_0x36294b[_0x33dc18(0x204)]||_0x53a1bf[_0x33dc18(0x1de)]!==_0x155240||_0x53a1bf['skillCode']!==_0x5541c0||_0x53a1bf[_0x33dc18(0x1fb)]!==_0x3e9468||_0x53a1bf['id']!==_0x21521f['id']||_0x53a1bf[_0x33dc18(0x1fa)]!==_0x21521f[_0x33dc18(0x1fa)]||_0x53a1bf[_0x33dc18(0x1fd)]!==_0x21521f[_0x33dc18(0x1fd)]||_0x53a1bf[_0x33dc18(0x20b)]!==_0x21521f['example']||_0x53a1bf[_0x33dc18(0x200)]!==_0x21521f['status']||!_0x53a1bf[_0x33dc18(0x1e2)]||!_0x53a1bf[_0x33dc18(0x205)]||!Object[_0x33dc18(0x1d8)](_0x53a1bf[_0x33dc18(0x205)],SKILL_FILE))return undefined;for(const [_0x5c9d46,_0x5eb727]of Object[_0x33dc18(0x1ee)](_0x53a1bf[_0x33dc18(0x205)])){if(!/^[a-f0-9]{64}$/['test'](_0x5eb727))return undefined;const _0x38cf62=resolveManagedFilePath(_0x2fbee0,_0x5c9d46);if(!existsSync(_0x38cf62)||!lstatSync(_0x38cf62)[_0x33dc18(0x1d5)]())return undefined;if(bufferSha256(readFileSync(_0x38cf62))!==_0x5eb727)return undefined;}return{'skill':_0x21521f,'scope':_0x155240,'dir':_0x2fbee0,'skillMdPath':_0x3b5063,'metadataPath':_0x3c428d,'contentHash':_0x53a1bf[_0x33dc18(0x1e2)],'changed':![]};}function withMaterializedSkillFrontmatter(_0xbaf9ea,_0x20213a,_0x1a623b){const _0x2ea1e8=a157_0xa0bc,_0x1f61ba=skillDisplayName(_0x20213a,_0x1a623b),_0x42be03=_0x20213a[_0x2ea1e8(0x1fd)]?.[_0x2ea1e8(0x1d7)]()||_0x1f61ba||_0x1a623b;return normalizeLocalFiles(_0xbaf9ea)[_0x2ea1e8(0x1e3)](_0x15e4b6=>{const _0x1c7027=_0x2ea1e8,_0x1b53df=fileText(_0x15e4b6);if(_0x15e4b6['path']!==SKILL_FILE)return _0x15e4b6;if(hasYamlFrontmatter(_0x1b53df))return{'path':_0x15e4b6[_0x1c7027(0x209)],'content':withSyncedDisplayName(_0x1b53df,_0x1f61ba)};return{'path':_0x15e4b6['path'],'content':prependSkillFrontmatter(_0x1b53df,{'name':_0x1a623b,'displayName':_0x1f61ba,'description':_0x42be03})};});}function hasYamlFrontmatter(_0x386937){const _0x2f7ebd=a157_0xa0bc;return/^\uFEFF?---\s*\r?\n/[_0x2f7ebd(0x1fc)](_0x386937);}function a157_0xa0bc(_0x26f928,_0x3b9563){_0x26f928=_0x26f928-0x1d3;const _0x5463a6=a157_0x5463();let _0xa0bcb5=_0x5463a6[_0x26f928];return _0xa0bcb5;}function prependSkillFrontmatter(_0x590ad8,_0x281367){const _0x3526e0=a157_0xa0bc,_0x45ce9a=_0x590ad8[_0x3526e0(0x1dc)](/^\uFEFF/,'');return[_0x3526e0(0x1d3),_0x3526e0(0x1ef)+yamlString(_0x281367['name']),_0x281367[_0x3526e0(0x1df)]?_0x3526e0(0x1f0)+yamlString(_0x281367[_0x3526e0(0x1df)]):undefined,_0x3526e0(0x202)+yamlString(_0x281367[_0x3526e0(0x1fd)]),_0x3526e0(0x1d3),'',_0x45ce9a][_0x3526e0(0x203)](_0x4007b6=>_0x4007b6!==undefined)[_0x3526e0(0x1d9)]('\x0a');}function yamlString(_0x3e5131){const _0xbf542a=a157_0xa0bc;return JSON[_0xbf542a(0x1f4)](_0x3e5131[_0xbf542a(0x1dc)](/\r/g,'')['trim']());}function skillDisplayName(_0x26194a,_0x860106){const _0x4a50b2=a157_0xa0bc,_0x54bcd2=_0x26194a['skillName']?.[_0x4a50b2(0x1d7)]();return _0x54bcd2||_0x860106;}function withSyncedDisplayName(_0x103d28,_0x527030){const _0x190ffe=a157_0xa0bc,_0x4a7701=_0x103d28['match'](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x4a7701)return _0x103d28;const _0x330194=_0x4a7701[0x1]??'',_0x4f9786=_0x4a7701[0x2]??'',_0x79db05=parseDocument(_0x4f9786);if(_0x79db05[_0x190ffe(0x20d)][_0x190ffe(0x20e)]>0x0||!isMap(_0x79db05[_0x190ffe(0x1e9)]))return _0x103d28;if(_0x527030)_0x79db05['set']('displayName',_0x527030);else{if(_0x79db05[_0x190ffe(0x20a)](_0x190ffe(0x1df)))_0x79db05[_0x190ffe(0x1eb)]('displayName');else return _0x103d28;}forceBlockCollections(_0x79db05[_0x190ffe(0x1e9)]);const _0x5f04c4=_0x79db05[_0x190ffe(0x1f8)]({'lineWidth':0x0})[_0x190ffe(0x1db)](),_0xa0fedb=_0x103d28[_0x190ffe(0x1d4)](_0x4a7701[0x0]['length'])[_0x190ffe(0x1dc)](/^\r?\n/,'');return _0x330194+'---\x0a'+_0x5f04c4+_0x190ffe(0x206)+_0xa0fedb;}function forceBlockCollections(_0x5b502d){if(!isNode(_0x5b502d))return;visit(_0x5b502d,(_0x17586f,_0x24f7c3)=>{const _0x3a0f83=a157_0xa0bc;isCollection(_0x24f7c3)&&(_0x24f7c3[_0x3a0f83(0x208)]=![]);});}function ensurePulledFilesCanBeOverwritten(_0x487d77,_0x228e2d,_0x21e651,_0x677f0b){const _0x42e64c=a157_0xa0bc;if(_0x677f0b||!existsSync(_0x228e2d))return;const _0x43b92e=readMetadataIfPresent(_0x228e2d);if(!_0x43b92e)return;const _0x535b8f=_0x43b92e[_0x42e64c(0x205)]&&Object[_0x42e64c(0x1fe)](_0x43b92e['fileHashes'])[_0x42e64c(0x20e)]>0x0?_0x43b92e[_0x42e64c(0x205)]:undefined;if(_0x535b8f)for(const [_0x360fc0,_0x55f865]of Object['entries'](_0x535b8f)){const _0x58ad27=resolveManagedFilePath(_0x487d77,_0x360fc0);if(!existsSync(_0x58ad27))throw CliErrors[_0x42e64c(0x207)](_0x42e64c(0x1f2)+_0x487d77,_0x42e64c(0x1e5)+_0x360fc0);const _0x392daf=lstatSync(_0x58ad27);if(!_0x392daf[_0x42e64c(0x1d5)]())throw CliErrors[_0x42e64c(0x207)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x487d77,_0x42e64c(0x1dd)+_0x360fc0);const _0x434b27=bufferSha256(readFileSync(_0x58ad27));if(_0x434b27!==_0x55f865)throw CliErrors['validation'](_0x42e64c(0x1f2)+_0x487d77+_0x42e64c(0x1ed)+_0x360fc0,'Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20'+_0x360fc0);}else{const _0x4629f4=resolve(_0x487d77,SKILL_FILE);if(existsSync(_0x4629f4)&&_0x43b92e[_0x42e64c(0x1e2)]){const _0x54d6f8=contentHash(readFileSync(_0x4629f4,_0x42e64c(0x1f9)));if(_0x54d6f8!==_0x43b92e[_0x42e64c(0x1e2)])throw CliErrors[_0x42e64c(0x207)]('Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20'+_0x4629f4,_0x42e64c(0x1f6));}}for(const _0x4f8b1d of normalizeLocalFiles(_0x21e651)){if(_0x535b8f?.[_0x4f8b1d[_0x42e64c(0x209)]])continue;if(!_0x535b8f&&_0x4f8b1d[_0x42e64c(0x209)]===SKILL_FILE)continue;const _0x318198=resolveManagedFilePath(_0x487d77,_0x4f8b1d[_0x42e64c(0x209)]);if(!existsSync(_0x318198))continue;const _0x17e3f8=lstatSync(_0x318198);if(!_0x17e3f8[_0x42e64c(0x1d5)]())throw CliErrors[_0x42e64c(0x207)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x487d77,'Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20'+_0x4f8b1d['path']);const _0xc81044=bufferSha256(readFileSync(_0x318198));if(_0xc81044!==fileHash(_0x4f8b1d))throw CliErrors[_0x42e64c(0x207)](_0x42e64c(0x1f2)+_0x487d77,_0x42e64c(0x1ff)+_0x4f8b1d[_0x42e64c(0x209)]);}}function materializeFiles(_0x4c3f7b,_0x59d95a){const _0x405972=a157_0xa0bc;for(const _0x1a4229 of normalizeLocalFiles(_0x59d95a)){const _0x34a707=resolveManagedFilePath(_0x4c3f7b,_0x1a4229[_0x405972(0x209)]);mkdirSync(dirname(_0x34a707),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x34a707,fileContent(_0x1a4229),0x180);}}function removeStaleManagedFiles(_0xb79844,_0x442ab3,_0x5020c8){const _0x352567=a157_0xa0bc;if(!_0x442ab3)return;const _0xa68cf=new Set(normalizeLocalFiles(_0x5020c8)['map'](_0x32764b=>_0x32764b[_0x352567(0x209)]));for(const _0x1c5228 of Object[_0x352567(0x1fe)](_0x442ab3)){if(_0xa68cf['has'](_0x1c5228))continue;const _0x256b9d=resolveManagedFilePath(_0xb79844,_0x1c5228);existsSync(_0x256b9d)&&lstatSync(_0x256b9d)[_0x352567(0x1d5)]()&&rmSync(_0x256b9d,{'force':!![]});}}
@@ -1 +1 @@
1
- (function(_0x171cd4,_0x394258){const _0x5b8562=a158_0x251d,_0x2f9178=_0x171cd4();while(!![]){try{const _0x34c53c=parseInt(_0x5b8562(0x20e))/0x1*(-parseInt(_0x5b8562(0x1f7))/0x2)+-parseInt(_0x5b8562(0x1f9))/0x3*(-parseInt(_0x5b8562(0x1fc))/0x4)+-parseInt(_0x5b8562(0x20a))/0x5*(parseInt(_0x5b8562(0x213))/0x6)+-parseInt(_0x5b8562(0x212))/0x7*(parseInt(_0x5b8562(0x1f1))/0x8)+-parseInt(_0x5b8562(0x1ff))/0x9+-parseInt(_0x5b8562(0x207))/0xa+-parseInt(_0x5b8562(0x211))/0xb*(-parseInt(_0x5b8562(0x1f8))/0xc);if(_0x34c53c===_0x394258)break;else _0x2f9178['push'](_0x2f9178['shift']());}catch(_0x148593){_0x2f9178['push'](_0x2f9178['shift']());}}}(a158_0x4e4f,0x93997));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';function a158_0x251d(_0x1da522,_0x4c06d4){_0x1da522=_0x1da522-0x1f1;const _0x4e4f72=a158_0x4e4f();let _0x251dd8=_0x4e4f72[_0x1da522];return _0x251dd8;}function a158_0x4e4f(){const _0x234405=['zipSize','skillName','Runtime\x20Skill\x20is\x20missing\x20skillCode.','map','parse','string','path','3325900PfgUqI','trim','toISOString','217510ErTdwr','object','length','files','11rCscVr','isArray','fromEntries','154TDjpWC','7CUunug','132WFFBNu','example','hasUpstreamUpdate','readonly','skillCode','8464528tClWLk','sourceSessionId','manifest','validation','ossPath','tags','29884MmQBAZ','3640404BQPDYB','981nMPwBl','forkedFromSkillId','userId','12Jvmhgb','zipSha256','status','10183410vkxXir'];a158_0x4e4f=function(){return _0x234405;};return a158_0x4e4f();}export function buildMetadata(_0x297d54,_0xba1172,_0x449bc5,_0x5b003,_0x3b3057,_0x210d33,_0x34ce3c){const _0x43812e=a158_0x251d,_0x5fd9de=_0x210d33?normalizeLocalFiles(_0x210d33):[],_0x21ca50=!_0x34ce3c&&_0x5fd9de[_0x43812e(0x20c)]>0x0?buildSkillPackage(_0x5fd9de):undefined,_0xbdaf1f=_0x34ce3c?bufferSha256(_0x34ce3c):_0x21ca50?.[_0x43812e(0x1f3)][_0x43812e(0x1fd)],_0x471980=_0x34ce3c?.['length']??_0x21ca50?.[_0x43812e(0x1f3)][_0x43812e(0x200)],_0x5e47e4=_0x5fd9de[_0x43812e(0x20c)]>0x0?Object[_0x43812e(0x210)](_0x5fd9de[_0x43812e(0x203)](_0x2d6ff4=>[_0x2d6ff4[_0x43812e(0x206)],fileHash(_0x2d6ff4)])):undefined;return{'schemaVersion':_0x5fd9de[_0x43812e(0x20c)]>0x0?0x2:0x1,'id':_0x297d54['id'],'appCode':_0x449bc5,'skillCode':requireSkillCode(_0x297d54),'skillName':_0x297d54[_0x43812e(0x201)],'description':_0x297d54['description'],'example':_0x297d54[_0x43812e(0x214)],'scope':_0xba1172,'readonly':_0xba1172!=='personal'||_0x297d54[_0x43812e(0x216)]===!![],'tenantCode':_0x297d54['tenantCode'],'userId':_0x297d54[_0x43812e(0x1fb)],'version':_0x297d54['version'],'status':_0x297d54[_0x43812e(0x1fe)],'tags':Array[_0x43812e(0x20f)](_0x297d54['tags'])?_0x297d54[_0x43812e(0x1f6)]:[],'hasUpstreamUpdate':_0x297d54[_0x43812e(0x215)],'forkedFromSkillId':_0x297d54[_0x43812e(0x1fa)],'forkedFromVersion':_0x297d54['forkedFromVersion'],'sourceSessionId':_0x297d54[_0x43812e(0x1f2)],'contentHash':_0x5b003,'fileHashes':_0x5e47e4,'treeHash':_0x5fd9de[_0x43812e(0x20c)]>0x0?fileTreeHash(localFilesToManifestFiles(_0x5fd9de)):undefined,'ossPath':remoteManifestOssPath(_0x297d54[_0x43812e(0x20d)]),'zipSha256':_0xbdaf1f,'zipSize':_0x471980,'files':_0x5fd9de[_0x43812e(0x20c)]>0x0?_0x5fd9de[_0x43812e(0x203)](_0xc0df94=>({'path':_0xc0df94['path'],'hash':fileHash(_0xc0df94),'size':fileContent(_0xc0df94)[_0x43812e(0x20c)]})):undefined,'pulledAt':_0x3b3057??new Date()[_0x43812e(0x209)]()};}export function requireSkillCode(_0x29a1eb){const _0x56b0cc=a158_0x251d,_0x3feea3=_0x29a1eb[_0x56b0cc(0x217)]?.[_0x56b0cc(0x208)]();if(!_0x3feea3)throw CliErrors[_0x56b0cc(0x1f4)](_0x56b0cc(0x202));return _0x3feea3;}export function readMetadataIfPresent(_0x1add28){const _0x43cb75=a158_0x251d;if(!existsSync(_0x1add28))return undefined;try{const _0x4d23e1=JSON[_0x43cb75(0x204)](readFileSync(_0x1add28,'utf8'));return _0x4d23e1;}catch{throw CliErrors[_0x43cb75(0x1f4)]('Invalid\x20'+METADATA_FILE+':\x20'+_0x1add28);}}function remoteManifestOssPath(_0x32a5a3){const _0x5d0235=a158_0x251d;if(!_0x32a5a3||typeof _0x32a5a3!==_0x5d0235(0x20b)||Array['isArray'](_0x32a5a3))return undefined;const _0x523a8b=_0x32a5a3[_0x5d0235(0x1f5)];return typeof _0x523a8b===_0x5d0235(0x205)&&_0x523a8b['trim']()?_0x523a8b[_0x5d0235(0x208)]():undefined;}
1
+ (function(_0x252ec4,_0xedeac7){const _0x3d27c4=a158_0x27a0,_0x111ebf=_0x252ec4();while(!![]){try{const _0x329858=-parseInt(_0x3d27c4(0x13a))/0x1*(-parseInt(_0x3d27c4(0x130))/0x2)+-parseInt(_0x3d27c4(0x13f))/0x3+parseInt(_0x3d27c4(0x13d))/0x4*(-parseInt(_0x3d27c4(0x13c))/0x5)+-parseInt(_0x3d27c4(0x126))/0x6+parseInt(_0x3d27c4(0x133))/0x7+parseInt(_0x3d27c4(0x142))/0x8+-parseInt(_0x3d27c4(0x12b))/0x9;if(_0x329858===_0xedeac7)break;else _0x111ebf['push'](_0x111ebf['shift']());}catch(_0x4b80ae){_0x111ebf['push'](_0x111ebf['shift']());}}}(a158_0x5f26,0x73aaa));function a158_0x27a0(_0x1c01e1,_0x2769bb){_0x1c01e1=_0x1c01e1-0x122;const _0x5f26b8=a158_0x5f26();let _0x27a0e4=_0x5f26b8[_0x1c01e1];return _0x27a0e4;}import{existsSync,readFileSync}from'node:fs';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';function a158_0x5f26(){const _0x5d0e05=['hasUpstreamUpdate','2697328niPpir','Invalid\x20','version','Runtime\x20Skill\x20is\x20missing\x20skillCode.','toISOString','isArray','files','fromEntries','723984yfxzcB','utf8','personal','userId','trim','1680201YTYBtI','zipSize','manifest','path','skillCode','88886CZfhze','length','description','6538644PKYiNN','object','map','skillName','string','tags','zipSha256','13yVsWmq','forkedFromVersion','70Eubrqw','101672exMrhC','validation','2136126BuCoOM','ossPath'];a158_0x5f26=function(){return _0x5d0e05;};return a158_0x5f26();}import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';import{fileContent,normalizeLocalFiles}from'./local-files.js';import{buildSkillPackage,localFilesToManifestFiles}from'./zip-package.js';export function buildMetadata(_0x24f3f3,_0x2ca3e7,_0x275e61,_0x3d45e5,_0x57d644,_0x395fd4,_0x2bbd7c){const _0x24d581=a158_0x27a0,_0x2ec8b7=_0x395fd4?normalizeLocalFiles(_0x395fd4):[],_0x5f55b7=!_0x2bbd7c&&_0x2ec8b7[_0x24d581(0x131)]>0x0?buildSkillPackage(_0x2ec8b7):undefined,_0x35ddd5=_0x2bbd7c?bufferSha256(_0x2bbd7c):_0x5f55b7?.[_0x24d581(0x12d)][_0x24d581(0x139)],_0x7bd8cd=_0x2bbd7c?.[_0x24d581(0x131)]??_0x5f55b7?.['manifest'][_0x24d581(0x12c)],_0x363b70=_0x2ec8b7[_0x24d581(0x131)]>0x0?Object[_0x24d581(0x125)](_0x2ec8b7[_0x24d581(0x135)](_0x428878=>[_0x428878[_0x24d581(0x12e)],fileHash(_0x428878)])):undefined;return{'schemaVersion':_0x2ec8b7['length']>0x0?0x2:0x1,'id':_0x24f3f3['id'],'appCode':_0x275e61,'skillCode':requireSkillCode(_0x24f3f3),'skillName':_0x24f3f3[_0x24d581(0x136)],'description':_0x24f3f3[_0x24d581(0x132)],'example':_0x24f3f3['example'],'scope':_0x2ca3e7,'readonly':_0x2ca3e7!==_0x24d581(0x128)||_0x24f3f3['readonly']===!![],'tenantCode':_0x24f3f3['tenantCode'],'userId':_0x24f3f3[_0x24d581(0x129)],'version':_0x24f3f3[_0x24d581(0x144)],'status':_0x24f3f3['status'],'tags':Array[_0x24d581(0x123)](_0x24f3f3[_0x24d581(0x138)])?_0x24f3f3[_0x24d581(0x138)]:[],'hasUpstreamUpdate':_0x24f3f3[_0x24d581(0x141)],'forkedFromSkillId':_0x24f3f3['forkedFromSkillId'],'forkedFromVersion':_0x24f3f3[_0x24d581(0x13b)],'sourceSessionId':_0x24f3f3['sourceSessionId'],'contentHash':_0x3d45e5,'fileHashes':_0x363b70,'treeHash':_0x2ec8b7[_0x24d581(0x131)]>0x0?fileTreeHash(localFilesToManifestFiles(_0x2ec8b7)):undefined,'ossPath':remoteManifestOssPath(_0x24f3f3[_0x24d581(0x124)]),'zipSha256':_0x35ddd5,'zipSize':_0x7bd8cd,'files':_0x2ec8b7[_0x24d581(0x131)]>0x0?_0x2ec8b7['map'](_0x3a7c69=>({'path':_0x3a7c69[_0x24d581(0x12e)],'hash':fileHash(_0x3a7c69),'size':fileContent(_0x3a7c69)[_0x24d581(0x131)]})):undefined,'pulledAt':_0x57d644??new Date()[_0x24d581(0x122)]()};}export function requireSkillCode(_0xd95950){const _0x1e2f00=a158_0x27a0,_0x341db5=_0xd95950[_0x1e2f00(0x12f)]?.[_0x1e2f00(0x12a)]();if(!_0x341db5)throw CliErrors[_0x1e2f00(0x13e)](_0x1e2f00(0x145));return _0x341db5;}export function readMetadataIfPresent(_0x3e4b1f){const _0x5ba7b2=a158_0x27a0;if(!existsSync(_0x3e4b1f))return undefined;try{const _0x93ff99=JSON['parse'](readFileSync(_0x3e4b1f,_0x5ba7b2(0x127)));return _0x93ff99;}catch{throw CliErrors[_0x5ba7b2(0x13e)](_0x5ba7b2(0x143)+METADATA_FILE+':\x20'+_0x3e4b1f);}}function remoteManifestOssPath(_0x5c9ef7){const _0x351a26=a158_0x27a0;if(!_0x5c9ef7||typeof _0x5c9ef7!==_0x351a26(0x134)||Array[_0x351a26(0x123)](_0x5c9ef7))return undefined;const _0x2b7ba1=_0x5c9ef7[_0x351a26(0x140)];return typeof _0x2b7ba1===_0x351a26(0x137)&&_0x2b7ba1['trim']()?_0x2b7ba1[_0x351a26(0x12a)]():undefined;}
@@ -1 +1 @@
1
- const a159_0x23bbb2=a159_0x428f;(function(_0x18fb87,_0x3db6ae){const _0x36d697=a159_0x428f,_0x3ba087=_0x18fb87();while(!![]){try{const _0x14548d=parseInt(_0x36d697(0x10d))/0x1+parseInt(_0x36d697(0x108))/0x2*(-parseInt(_0x36d697(0x11c))/0x3)+-parseInt(_0x36d697(0x118))/0x4+parseInt(_0x36d697(0x11b))/0x5+-parseInt(_0x36d697(0x115))/0x6+-parseInt(_0x36d697(0x10b))/0x7+parseInt(_0x36d697(0x10a))/0x8;if(_0x14548d===_0x3db6ae)break;else _0x3ba087['push'](_0x3ba087['shift']());}catch(_0x141315){_0x3ba087['push'](_0x3ba087['shift']());}}}(a159_0x4551,0x4a875));function a159_0x4551(){const _0x5c123b=['Unsafe\x20','homeDir','homeDirName','filter','396852AYPWuW','skills','workbuddySkillsDir','1371636GceguU','.claude','includes','2731595FPDgoK','6YYlCkO','claudeSkillsDir','cacheRoot','path\x20segment','\x20for\x20local\x20path:\x20','519484uXoImB','skillCode','4480120vxLTke','3359118GiDnWo','.workbuddy','607344MHrOoy','agentsSkillsDir','SKILL_ROOT','.agents'];a159_0x4551=function(){return _0x5c123b;};return a159_0x4551();}import{existsSync}from'node:fs';import{homedir}from'node:os';import{resolve}from'node:path';import{fingerprintAccessKey}from'../../commands/app/cache.js';import{PRODUCT_CONFIG,productEnv}from'../../constant/product.js';import{CliErrors}from'../../errors.js';export function resolveSkillSyncPaths(_0x4bde97={}){const _0x5ac1bd=a159_0x428f,_0x284469=_0x4bde97[_0x5ac1bd(0x112)]??homedir(),_0x38b4e3=resolve(_0x284469,PRODUCT_CONFIG['homeDirName'],'cache'),_0x307b03=trimmedEnv(_0x5ac1bd(0x10f)),_0x17f374=trimmedEnv('CLAUDE_SKILL_ROOT'),_0x5123e1=resolve(_0x284469,_0x5ac1bd(0x10c)),_0x40ce44=_0x4bde97[_0x5ac1bd(0x117)]??(existsSync(_0x5123e1)?resolve(_0x5123e1,'skills'):undefined);return{'homeDir':_0x284469,'cacheRoot':_0x38b4e3,'managedRoot':resolve(_0x284469,PRODUCT_CONFIG[_0x5ac1bd(0x113)]),'agentsSkillsDir':_0x4bde97[_0x5ac1bd(0x10e)]??_0x307b03??resolve(_0x284469,_0x5ac1bd(0x110),'skills'),'claudeSkillsDir':_0x4bde97[_0x5ac1bd(0x11d)]??_0x17f374??resolve(_0x284469,_0x5ac1bd(0x119),_0x5ac1bd(0x116)),'workbuddySkillsDir':_0x40ce44};}export function runtimeAgentSkillRoots(_0x25f545){const _0xf8fb8c=a159_0x428f;return[_0x25f545[_0xf8fb8c(0x10e)],_0x25f545[_0xf8fb8c(0x11d)],_0x25f545[_0xf8fb8c(0x117)]][_0xf8fb8c(0x114)](_0x35d22f=>Boolean(_0x35d22f));}export function getRuntimeSkillCacheRoot(_0x42bf50,_0xe0836e,_0x27d9c5={}){const _0x2c160c=a159_0x428f,_0x180818=resolveSkillSyncPaths(_0x27d9c5);return resolve(_0x180818[_0x2c160c(0x11e)],_0x42bf50,fingerprintAccessKey(_0xe0836e),_0x2c160c(0x116));}function a159_0x428f(_0x459299,_0x157a31){_0x459299=_0x459299-0x106;const _0x455189=a159_0x4551();let _0x428f44=_0x455189[_0x459299];return _0x428f44;}export function getRuntimeSkillDir(_0x163b39,_0x31b905,_0x172e74,_0x51e230,_0xbedbfb,_0x442436={}){const _0x21d7b4=a159_0x428f;return resolve(getRuntimeSkillCacheRoot(_0x163b39,_0x31b905,_0x442436),safePathSegment(_0x172e74,'appCode'),_0x51e230,safePathSegment(_0xbedbfb,_0x21d7b4(0x109)));}export function safePathSegment(_0x1069ed,_0x456d74=a159_0x23bbb2(0x106)){const _0x2b3c07=a159_0x23bbb2;if(!_0x1069ed||_0x1069ed[_0x2b3c07(0x11a)]('/')||_0x1069ed[_0x2b3c07(0x11a)]('\x5c')||_0x1069ed[_0x2b3c07(0x11a)]('..'))throw CliErrors['validation'](_0x2b3c07(0x111)+_0x456d74+_0x2b3c07(0x107)+_0x1069ed);return _0x1069ed;}function trimmedEnv(_0x2ada8c){const _0x46d5de=productEnv(_0x2ada8c)?.['trim']();return _0x46d5de?_0x46d5de:undefined;}
1
+ const a159_0x39df7f=a159_0x207c;(function(_0x1d678a,_0x2f4cf4){const _0x50d293=a159_0x207c,_0x166a77=_0x1d678a();while(!![]){try{const _0x401dd4=parseInt(_0x50d293(0xaa))/0x1+parseInt(_0x50d293(0xad))/0x2*(parseInt(_0x50d293(0xac))/0x3)+-parseInt(_0x50d293(0xaf))/0x4*(parseInt(_0x50d293(0x97))/0x5)+-parseInt(_0x50d293(0x9f))/0x6+-parseInt(_0x50d293(0xa4))/0x7+-parseInt(_0x50d293(0x9e))/0x8+-parseInt(_0x50d293(0xa9))/0x9*(-parseInt(_0x50d293(0x99))/0xa);if(_0x401dd4===_0x2f4cf4)break;else _0x166a77['push'](_0x166a77['shift']());}catch(_0x32e5a0){_0x166a77['push'](_0x166a77['shift']());}}}(a159_0x3ae8,0xa7329));import{existsSync}from'node:fs';import{homedir}from'node:os';import{resolve}from'node:path';import{fingerprintAccessKey}from'../../commands/app/cache.js';function a159_0x3ae8(){const _0x4ee78b=['28KsCrtg','Unsafe\x20','116015zcVTqQ','homeDirName','90JNBgAS','\x20for\x20local\x20path:\x20','agentsSkillsDir','claudeSkillsDir','skillCode','8103856Gpsbxv','5035110rXrWHQ','path\x20segment','SKILL_ROOT','homeDir','.agents','8996526gXFIqA','includes','skills','workbuddySkillsDir','.claude','2629764IEUZjv','167078CwZGMD','trim','3563415FArguj','2zeHCZc','CLAUDE_SKILL_ROOT'];a159_0x3ae8=function(){return _0x4ee78b;};return a159_0x3ae8();}import{PRODUCT_CONFIG,productEnv}from'../../constant/product.js';import{CliErrors}from'../../errors.js';export function resolveSkillSyncPaths(_0x3852d5={}){const _0x2cd2aa=a159_0x207c,_0x3c1f1d=_0x3852d5[_0x2cd2aa(0xa2)]??homedir(),_0x1f691c=resolve(_0x3c1f1d,PRODUCT_CONFIG[_0x2cd2aa(0x98)],'cache'),_0x114223=trimmedEnv(_0x2cd2aa(0xa1)),_0xe54826=trimmedEnv(_0x2cd2aa(0xae)),_0x50232d=resolve(_0x3c1f1d,'.workbuddy'),_0x34d85d=_0x3852d5[_0x2cd2aa(0xa7)]??(existsSync(_0x50232d)?resolve(_0x50232d,_0x2cd2aa(0xa6)):undefined);return{'homeDir':_0x3c1f1d,'cacheRoot':_0x1f691c,'managedRoot':resolve(_0x3c1f1d,PRODUCT_CONFIG[_0x2cd2aa(0x98)]),'agentsSkillsDir':_0x3852d5['agentsSkillsDir']??_0x114223??resolve(_0x3c1f1d,_0x2cd2aa(0xa3),'skills'),'claudeSkillsDir':_0x3852d5[_0x2cd2aa(0x9c)]??_0xe54826??resolve(_0x3c1f1d,_0x2cd2aa(0xa8),_0x2cd2aa(0xa6)),'workbuddySkillsDir':_0x34d85d};}export function runtimeAgentSkillRoots(_0x21a70b){const _0x4e8a3d=a159_0x207c;return[_0x21a70b[_0x4e8a3d(0x9b)],_0x21a70b[_0x4e8a3d(0x9c)],_0x21a70b[_0x4e8a3d(0xa7)]]['filter'](_0x261e58=>Boolean(_0x261e58));}export function getRuntimeSkillCacheRoot(_0x514210,_0x5f2ce7,_0xce6fe4={}){const _0xa1495d=resolveSkillSyncPaths(_0xce6fe4);return resolve(_0xa1495d['cacheRoot'],_0x514210,fingerprintAccessKey(_0x5f2ce7),'skills');}export function getRuntimeSkillDir(_0x55b803,_0x47132c,_0x80938e,_0x5ac3cf,_0x281bc3,_0x2fbdea={}){const _0x3e15f9=a159_0x207c;return resolve(getRuntimeSkillCacheRoot(_0x55b803,_0x47132c,_0x2fbdea),safePathSegment(_0x80938e,'appCode'),_0x5ac3cf,safePathSegment(_0x281bc3,_0x3e15f9(0x9d)));}export function safePathSegment(_0x50a8a2,_0x20ac05=a159_0x39df7f(0xa0)){const _0x2b65a6=a159_0x39df7f;if(!_0x50a8a2||_0x50a8a2['includes']('/')||_0x50a8a2[_0x2b65a6(0xa5)]('\x5c')||_0x50a8a2[_0x2b65a6(0xa5)]('..'))throw CliErrors['validation'](_0x2b65a6(0x96)+_0x20ac05+_0x2b65a6(0x9a)+_0x50a8a2);return _0x50a8a2;}function a159_0x207c(_0x1bd29f,_0x100a20){_0x1bd29f=_0x1bd29f-0x96;const _0x3ae80c=a159_0x3ae8();let _0x207c71=_0x3ae80c[_0x1bd29f];return _0x207c71;}function trimmedEnv(_0x4e8485){const _0x56d2d2=a159_0x39df7f,_0x5b553d=productEnv(_0x4e8485)?.[_0x56d2d2(0xab)]();return _0x5b553d?_0x5b553d:undefined;}
@@ -1 +1 @@
1
- (function(_0x44ff6f,_0x3b2fbf){const _0x40657d=a160_0x3050,_0x366f4e=_0x44ff6f();while(!![]){try{const _0x34ebda=parseInt(_0x40657d(0x19c))/0x1*(-parseInt(_0x40657d(0x1a2))/0x2)+parseInt(_0x40657d(0x1c0))/0x3*(parseInt(_0x40657d(0x1a8))/0x4)+parseInt(_0x40657d(0x199))/0x5+parseInt(_0x40657d(0x1ae))/0x6+parseInt(_0x40657d(0x19b))/0x7*(-parseInt(_0x40657d(0x1a7))/0x8)+parseInt(_0x40657d(0x1b2))/0x9+-parseInt(_0x40657d(0x1b4))/0xa;if(_0x34ebda===_0x3b2fbf)break;else _0x366f4e['push'](_0x366f4e['shift']());}catch(_0x2a8f29){_0x366f4e['push'](_0x366f4e['shift']());}}}(a160_0x3034,0x4ca71));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a160_0x38aa99}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{writeJsonAtomic}from'./fs-utils.js';import{contentHash}from'./hashing.js';import{fileText,normalizeLocalFiles,scanSkillDirectory}from'./local-files.js';import{buildMetadata,readMetadataIfPresent}from'./metadata.js';import{buildSkillPackage,tryNormalizePackageManifest}from'./zip-package.js';export function resolvePushDirectoryIdentity(_0x342585,_0x153e47,_0x21225b={}){const _0x8f7979=a160_0x3050,_0x1a33ae=resolvePushDirectoryRoot(_0x342585),_0x5d0990=readPushMetadataIfPresent(resolve(_0x1a33ae,METADATA_FILE),{'ignoreInvalidMetadata':_0x21225b['ignoreInvalidMetadata']});if(_0x5d0990?.[_0x8f7979(0x189)]&&_0x5d0990[_0x8f7979(0x189)]!==_0x153e47&&!_0x21225b['allowAppCodeRetarget']&&!_0x21225b[_0x8f7979(0x194)])throw CliErrors[_0x8f7979(0x18f)](_0x8f7979(0x1a3)+_0x5d0990[_0x8f7979(0x189)]+_0x8f7979(0x1c1)+_0x153e47+'\x22.');const _0x30a091=resolvePushSkillCode(_0x1a33ae,_0x153e47,_0x5d0990,_0x21225b);if(!_0x30a091)throw CliErrors[_0x8f7979(0x18f)]('Unable\x20to\x20resolve\x20skillCode\x20from\x20'+SKILL_FILE+',\x20'+METADATA_FILE+_0x8f7979(0x1b6));return{'dir':_0x1a33ae,'skillCode':_0x30a091,'metadata':_0x5d0990};}export function readPushDirectory(_0x1aae01,_0x138d91,_0x289972={}){const _0x2e200b=a160_0x3050,_0x4032a8=resolvePushDirectoryIdentity(_0x1aae01,_0x138d91,_0x289972),_0x4724b2=_0x4032a8[_0x2e200b(0x195)],_0x2ffd2a=resolve(_0x4724b2,SKILL_FILE);if(!existsSync(_0x2ffd2a)||!lstatSync(_0x2ffd2a)[_0x2e200b(0x1a9)]())throw CliErrors[_0x2e200b(0x18f)](_0x2e200b(0x18c)+SKILL_FILE+':\x20'+_0x2ffd2a);const _0xf3a548=_0x4032a8['metadata'],_0xbb6214=_0x289972[_0x2e200b(0x186)]??_0x2e200b(0x18b);if(!_0x289972[_0x2e200b(0x191)]&&_0xf3a548?.['scope']===_0x2e200b(0x1b1))throw CliErrors[_0x2e200b(0x18f)](_0x2e200b(0x1ba)+METADATA_FILE+_0x2e200b(0x1a0)+_0xf3a548[_0x2e200b(0x1b5)]+'\x22.');if(!_0x289972[_0x2e200b(0x191)]&&_0xbb6214===_0x2e200b(0x18b)&&_0xf3a548?.[_0x2e200b(0x1b5)]&&_0xf3a548['scope']!==_0x2e200b(0x18b))throw CliErrors[_0x2e200b(0x18f)]('Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20'+METADATA_FILE+_0x2e200b(0x1a0)+_0xf3a548[_0x2e200b(0x1b5)]+'\x22.',_0x2e200b(0x193)+_0x4724b2+_0x2e200b(0x1bc));const _0x562109=scanSkillDirectory(_0x4724b2,{'excludedFilePaths':_0x289972[_0x2e200b(0x1b3)]}),_0x21e932=buildSkillPackage(_0x562109),_0x3e53b1=readFileSync(_0x2ffd2a,'utf8'),_0x52eac1=_0x4032a8[_0x2e200b(0x190)],_0x3a20d1=_0x289972['ignoreMetadataForPayload']?undefined:_0xf3a548,_0x194f7c=readSkillDisplayName(_0x3e53b1);return{'skillCode':_0x52eac1,'metadata':_0xf3a548,'frontmatterDisplayName':_0x194f7c,'input':{'skillCode':_0x52eac1,'skillName':_0x194f7c??_0x3a20d1?.['skillName'],'description':_0x3a20d1?.[_0x2e200b(0x1bb)],'content':_0x3e53b1,'files':_0x21e932[_0x2e200b(0x198)],'packageBase64':_0x21e932[_0x2e200b(0x18a)],'tags':_0x3a20d1?.[_0x2e200b(0x1c2)],'version':_0x3a20d1?.[_0x2e200b(0x188)],'sourceSessionId':_0x3a20d1?.[_0x2e200b(0x187)]}};}export function refreshPushDirectoryMetadataFromRemote(_0x28bdae,_0x555785,_0x191d84,_0x5dec4b={}){const _0x32c3e4=a160_0x3050,_0x275cc6=resolvePushDirectoryRoot(_0x28bdae),_0x4a4281=readPushMetadataIfPresent(resolve(_0x275cc6,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x18a707=requireRemoteScope(_0x555785),_0x423b6d=readLocalSkillContent(_0x275cc6),_0x45d332={..._0x555785,'appCode':_0x555785['appCode']??_0x191d84,'skillName':_0x555785[_0x32c3e4(0x1a4)]??_0x4a4281?.[_0x32c3e4(0x1a4)],'description':_0x555785[_0x32c3e4(0x1bb)]??_0x4a4281?.[_0x32c3e4(0x1bb)],'example':_0x555785[_0x32c3e4(0x1aa)]??_0x4a4281?.[_0x32c3e4(0x1aa)],'tags':Array['isArray'](_0x555785[_0x32c3e4(0x1c2)])?_0x555785[_0x32c3e4(0x1c2)]:_0x4a4281?.[_0x32c3e4(0x1c2)],'sourceSessionId':_0x555785[_0x32c3e4(0x187)]??_0x4a4281?.[_0x32c3e4(0x187)],'content':_0x555785[_0x32c3e4(0x19d)]??_0x423b6d},_0x4949f8=buildMetadata(_0x45d332,_0x18a707,_0x191d84,contentHash(_0x423b6d),_0x5dec4b['refreshedAt']);writeJsonAtomic(resolve(_0x275cc6,METADATA_FILE),_0x4949f8);}export function recordPushedRuntimeSkill(_0x1832ac,_0x344590,_0x425305,_0x1109a8={}){const _0x2a8413=a160_0x3050,_0x5c131c=resolvePushDirectoryRoot(_0x1832ac),_0x23ab95=scanSkillDirectory(_0x5c131c),_0xa21e97=_0x23ab95[_0x2a8413(0x1b9)](_0x527ad6=>_0x527ad6[_0x2a8413(0x185)]===SKILL_FILE),_0xdb8d65=_0xa21e97?fileText(_0xa21e97):'',_0x3306b0=tryNormalizePackageManifest(_0x344590[_0x2a8413(0x1ad)]),_0x144f3f={..._0x344590,'content':_0x344590[_0x2a8413(0x19d)]??_0xdb8d65,'files':_0x3306b0},_0x329634=_0x3306b0?normalizeLocalFiles(_0x23ab95)['filter'](_0x1a14f3=>_0x3306b0[_0x2a8413(0x1ad)][_0x2a8413(0x1af)](_0x2442d8=>_0x2442d8[_0x2a8413(0x185)]===_0x1a14f3[_0x2a8413(0x185)])):undefined,_0x572c64=buildMetadata(_0x144f3f,_0x1109a8[_0x2a8413(0x1b5)]??'personal',_0x425305,contentHash(_0x144f3f[_0x2a8413(0x19d)]??''),_0x1109a8[_0x2a8413(0x1b7)],_0x329634);writeJsonAtomic(resolve(_0x5c131c,METADATA_FILE),_0x572c64);}export function deriveSkillCodeFromDirectory(_0x5079cc,_0x174035){const _0x19453c=a160_0x3050,_0x374bc3=basename(resolve(_0x5079cc)),_0x58117e=_0x174035+'--';return _0x374bc3['startsWith'](_0x58117e)?_0x374bc3['slice'](_0x58117e[_0x19453c(0x1ab)]):_0x374bc3;}function resolvePushSkillCode(_0x5c5cd8,_0x2656b3,_0x16f5cc,_0x5adde0){const _0xa7904c=a160_0x3050,_0x41f195=deriveSkillCodeFromSkillFile(_0x5c5cd8)||deriveSkillCodeFromDirectory(_0x5c5cd8,_0x2656b3);if(_0x5adde0[_0xa7904c(0x19f)])return _0x41f195;return _0x16f5cc?.[_0xa7904c(0x190)]?.[_0xa7904c(0x18d)]()||_0x41f195;}function deriveSkillCodeFromSkillFile(_0x349128){const _0x350a93=a160_0x3050,_0x4ff056=resolve(_0x349128,SKILL_FILE);if(!existsSync(_0x4ff056)||!lstatSync(_0x4ff056)[_0x350a93(0x1a9)]())return undefined;const _0x3fdcb5=readFileSync(_0x4ff056,'utf8'),_0x339b20=_0x3fdcb5[_0x350a93(0x196)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x339b20)return undefined;const _0x3b6d1e=parseFrontmatterObject(_0x339b20[0x1]??''),_0x2e05e0=scalarToString(_0x3b6d1e?.[_0x350a93(0x1bd)]);return _0x2e05e0?slugifySkillName(_0x2e05e0):undefined;}function readSkillDisplayName(_0x1c67b7){const _0x4ee292=a160_0x3050,_0x38d835=_0x1c67b7[_0x4ee292(0x196)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x38d835)return undefined;const _0x128493=parseFrontmatterObject(_0x38d835[0x1]??'');return scalarToString(_0x128493?.[_0x4ee292(0x197)]);}function slugifySkillName(_0x2051f2){const _0x21e2b6=a160_0x3050,_0x1d7554=_0x2051f2[_0x21e2b6(0x18d)]()[_0x21e2b6(0x1b0)]()[_0x21e2b6(0x1b8)](/[^\p{L}\p{N}\p{So}]+/gu,'-')['replace'](/^-+/,'')[_0x21e2b6(0x1b8)](/-+$/,'')[_0x21e2b6(0x1b8)](/-{2,}/g,'-');if(!_0x1d7554)throw CliErrors['validation'](_0x21e2b6(0x1c3)+SKILL_FILE+_0x21e2b6(0x19a));return _0x1d7554;}function parseFrontmatterObject(_0x21289a){const _0x5211a9=a160_0x3050;try{const _0x4e9516=a160_0x38aa99(_0x21289a);return _0x4e9516&&typeof _0x4e9516===_0x5211a9(0x1bf)&&!Array[_0x5211a9(0x18e)](_0x4e9516)?_0x4e9516:undefined;}catch{return undefined;}}function scalarToString(_0x423809){const _0x4e9972=a160_0x3050;if(typeof _0x423809==='string')return _0x423809[_0x4e9972(0x18d)]();if(typeof _0x423809===_0x4e9972(0x192)||typeof _0x423809==='boolean')return String(_0x423809);return undefined;}function a160_0x3034(){const _0x338cdf=['isFile','example','length','company','files','2085528HeWLOJ','some','toLowerCase','builtin','991620eEPMtn','excludedFilePaths','4232370UGUbHs','scope',',\x20or\x20directory\x20name.','pushedAt','replace','find','Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20','description','\x20to\x20submit\x20company\x20Skills\x20for\x20review.','name','(unknown)','object','141BGAisH','\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22','tags','Invalid\x20','Remote\x20Skill\x20','path','targetScope','sourceSessionId','version','appCode','packageBase64','personal','Missing\x20','trim','isArray','validation','skillCode','ignoreMetadataScope','number','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20','ignoreMetadataAppCodeMismatch','dir','match','displayName','manifest','979980CCWlhN','\x20name\x20for\x20SkillHub\x20slug\x20generation.','7mddhlF','2330HmzxAZ','content','Skill\x20directory\x20not\x20found:\x20','ignoreMetadataSkillCode','\x20has\x20scope=\x22','isDirectory','32nqEFUj','Skill\x20metadata\x20appCode\x20\x22','skillName','ignoreInvalidMetadata','utf8','3485688fVaaIJ','47356pfEVxZ'];a160_0x3034=function(){return _0x338cdf;};return a160_0x3034();}function a160_0x3050(_0x514a6c,_0x4f234e){_0x514a6c=_0x514a6c-0x185;const _0x30348e=a160_0x3034();let _0x3050ae=_0x30348e[_0x514a6c];return _0x3050ae;}function resolvePushDirectoryRoot(_0x471463){const _0x2db54e=a160_0x3050,_0x55bc27=resolve(_0x471463);if(!existsSync(_0x55bc27))throw CliErrors[_0x2db54e(0x18f)](_0x2db54e(0x19e)+_0x471463);const _0x3708cb=lstatSync(_0x55bc27);if(_0x3708cb[_0x2db54e(0x1a1)]())return _0x55bc27;if(_0x3708cb['isSymbolicLink']()){const _0x1558fa=realpathSync(_0x55bc27);if(lstatSync(_0x1558fa)['isDirectory']())return _0x1558fa;}throw CliErrors[_0x2db54e(0x18f)]('Skill\x20directory\x20not\x20found:\x20'+_0x471463);}function requireRemoteScope(_0x242333){const _0x21daa2=a160_0x3050;if(_0x242333[_0x21daa2(0x1b5)]===_0x21daa2(0x18b)||_0x242333[_0x21daa2(0x1b5)]===_0x21daa2(0x1ac)||_0x242333[_0x21daa2(0x1b5)]==='builtin')return _0x242333[_0x21daa2(0x1b5)];throw CliErrors[_0x21daa2(0x18f)](_0x21daa2(0x1c4)+(_0x242333['skillCode']||_0x21daa2(0x1be))+'\x20has\x20unsupported\x20scope\x20\x22'+(_0x242333[_0x21daa2(0x1b5)]??'unknown')+'\x22.');}function readLocalSkillContent(_0x28e7b9){const _0x31cc1b=a160_0x3050,_0x444849=resolve(_0x28e7b9,SKILL_FILE);return existsSync(_0x444849)&&lstatSync(_0x444849)[_0x31cc1b(0x1a9)]()?readFileSync(_0x444849,_0x31cc1b(0x1a6)):'';}function readPushMetadataIfPresent(_0x1095ef,_0x216b37={}){const _0x5f2a14=a160_0x3050;try{return readMetadataIfPresent(_0x1095ef);}catch(_0x45699d){if(_0x216b37[_0x5f2a14(0x1a5)])return undefined;throw _0x45699d;}}
1
+ function a160_0x477f(_0x234720,_0xbb1967){_0x234720=_0x234720-0xaa;const _0x25a98e=a160_0x25a9();let _0x477f47=_0x25a98e[_0x234720];return _0x477f47;}(function(_0x16a041,_0x122a9c){const _0x265732=a160_0x477f,_0x38953f=_0x16a041();while(!![]){try{const _0x507992=parseInt(_0x265732(0xda))/0x1+parseInt(_0x265732(0xbc))/0x2*(parseInt(_0x265732(0xd0))/0x3)+-parseInt(_0x265732(0xc5))/0x4+-parseInt(_0x265732(0xd7))/0x5*(parseInt(_0x265732(0xd1))/0x6)+parseInt(_0x265732(0xce))/0x7+-parseInt(_0x265732(0xab))/0x8+-parseInt(_0x265732(0xca))/0x9*(-parseInt(_0x265732(0xcf))/0xa);if(_0x507992===_0x122a9c)break;else _0x38953f['push'](_0x38953f['shift']());}catch(_0x239724){_0x38953f['push'](_0x38953f['shift']());}}}(a160_0x25a9,0xdb02c));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a160_0x1c0ec0}from'yaml';function a160_0x25a9(){const _0x325d9b=['path','3486406ROzJea','5958780KvpIJm','918726mxqyti','2884776DOjzJx','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20','filter','skillName','appCode','utf8','5SYkGnd','description','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20','841846uAiwXV','ignoreMetadataScope','allowAppCodeRetarget','length','isFile','content','startsWith','builtin','sourceSessionId','ignoreMetadataAppCodeMismatch','metadata','pushedAt','number','displayName','isArray','refreshedAt','dir','validation','Missing\x20','13929552cwDwPu','name','Skill\x20directory\x20not\x20found:\x20','manifest','skillCode','trim','Remote\x20Skill\x20','find','Invalid\x20','slice','some','isSymbolicLink','example','Unable\x20to\x20resolve\x20skillCode\x20from\x20','\x20name\x20for\x20SkillHub\x20slug\x20generation.','scope','unknown','4tzRjXd','ignoreInvalidMetadata','match','\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22','files','packageBase64','excludedFilePaths','company','\x20has\x20scope=\x22','2483856aJyVmS','replace','personal','isDirectory','tags','27rXcSvq','\x20to\x20submit\x20company\x20Skills\x20for\x20review.',',\x20or\x20directory\x20name.'];a160_0x25a9=function(){return _0x325d9b;};return a160_0x25a9();}import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{writeJsonAtomic}from'./fs-utils.js';import{contentHash}from'./hashing.js';import{fileText,normalizeLocalFiles,scanSkillDirectory}from'./local-files.js';import{buildMetadata,readMetadataIfPresent}from'./metadata.js';import{buildSkillPackage,tryNormalizePackageManifest}from'./zip-package.js';export function resolvePushDirectoryIdentity(_0x4a6c0b,_0x4522fa,_0x562d04={}){const _0xb643ea=a160_0x477f,_0x463df7=resolvePushDirectoryRoot(_0x4a6c0b),_0x4ceb9a=readPushMetadataIfPresent(resolve(_0x463df7,METADATA_FILE),{'ignoreInvalidMetadata':_0x562d04[_0xb643ea(0xbd)]});if(_0x4ceb9a?.[_0xb643ea(0xd5)]&&_0x4ceb9a[_0xb643ea(0xd5)]!==_0x4522fa&&!_0x562d04[_0xb643ea(0xdc)]&&!_0x562d04[_0xb643ea(0xe3)])throw CliErrors['validation']('Skill\x20metadata\x20appCode\x20\x22'+_0x4ceb9a[_0xb643ea(0xd5)]+_0xb643ea(0xbf)+_0x4522fa+'\x22.');const _0x57c8b1=resolvePushSkillCode(_0x463df7,_0x4522fa,_0x4ceb9a,_0x562d04);if(!_0x57c8b1)throw CliErrors['validation'](_0xb643ea(0xb8)+SKILL_FILE+',\x20'+METADATA_FILE+_0xb643ea(0xcc));return{'dir':_0x463df7,'skillCode':_0x57c8b1,'metadata':_0x4ceb9a};}export function readPushDirectory(_0x383b5c,_0x4b170f,_0x4c22ce={}){const _0x112868=a160_0x477f,_0x19e752=resolvePushDirectoryIdentity(_0x383b5c,_0x4b170f,_0x4c22ce),_0x31fe8c=_0x19e752[_0x112868(0xea)],_0x426965=resolve(_0x31fe8c,SKILL_FILE);if(!existsSync(_0x426965)||!lstatSync(_0x426965)[_0x112868(0xde)]())throw CliErrors['validation'](_0x112868(0xaa)+SKILL_FILE+':\x20'+_0x426965);const _0x1158a9=_0x19e752[_0x112868(0xe4)],_0x25d74b=_0x4c22ce['targetScope']??_0x112868(0xc7);if(!_0x4c22ce[_0x112868(0xdb)]&&_0x1158a9?.[_0x112868(0xba)]===_0x112868(0xe1))throw CliErrors['validation']('Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20'+METADATA_FILE+_0x112868(0xc4)+_0x1158a9[_0x112868(0xba)]+'\x22.');if(!_0x4c22ce[_0x112868(0xdb)]&&_0x25d74b===_0x112868(0xc7)&&_0x1158a9?.[_0x112868(0xba)]&&_0x1158a9[_0x112868(0xba)]!=='personal')throw CliErrors['validation'](_0x112868(0xd9)+METADATA_FILE+_0x112868(0xc4)+_0x1158a9[_0x112868(0xba)]+'\x22.',_0x112868(0xd2)+_0x31fe8c+_0x112868(0xcb));const _0x43b95c=scanSkillDirectory(_0x31fe8c,{'excludedFilePaths':_0x4c22ce[_0x112868(0xc2)]}),_0x44e9a7=buildSkillPackage(_0x43b95c),_0xa0bb1c=readFileSync(_0x426965,_0x112868(0xd6)),_0x56c9b5=_0x19e752[_0x112868(0xaf)],_0x2f87e4=_0x4c22ce['ignoreMetadataForPayload']?undefined:_0x1158a9,_0x1fc202=readSkillDisplayName(_0xa0bb1c);return{'skillCode':_0x56c9b5,'metadata':_0x1158a9,'frontmatterDisplayName':_0x1fc202,'input':{'skillCode':_0x56c9b5,'skillName':_0x1fc202??_0x2f87e4?.['skillName'],'description':_0x2f87e4?.['description'],'content':_0xa0bb1c,'files':_0x44e9a7[_0x112868(0xae)],'packageBase64':_0x44e9a7[_0x112868(0xc1)],'tags':_0x2f87e4?.[_0x112868(0xc9)],'version':_0x2f87e4?.['version'],'sourceSessionId':_0x2f87e4?.[_0x112868(0xe2)]}};}export function refreshPushDirectoryMetadataFromRemote(_0x1a726f,_0xaa727a,_0x28d999,_0x369ec2={}){const _0x1c47da=a160_0x477f,_0x532b53=resolvePushDirectoryRoot(_0x1a726f),_0x4f184c=readPushMetadataIfPresent(resolve(_0x532b53,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x2eba4c=requireRemoteScope(_0xaa727a),_0x4e3c85=readLocalSkillContent(_0x532b53),_0x133fb3={..._0xaa727a,'appCode':_0xaa727a[_0x1c47da(0xd5)]??_0x28d999,'skillName':_0xaa727a[_0x1c47da(0xd4)]??_0x4f184c?.['skillName'],'description':_0xaa727a[_0x1c47da(0xd8)]??_0x4f184c?.['description'],'example':_0xaa727a[_0x1c47da(0xb7)]??_0x4f184c?.[_0x1c47da(0xb7)],'tags':Array[_0x1c47da(0xe8)](_0xaa727a[_0x1c47da(0xc9)])?_0xaa727a['tags']:_0x4f184c?.[_0x1c47da(0xc9)],'sourceSessionId':_0xaa727a[_0x1c47da(0xe2)]??_0x4f184c?.[_0x1c47da(0xe2)],'content':_0xaa727a[_0x1c47da(0xdf)]??_0x4e3c85},_0xc1e0fb=buildMetadata(_0x133fb3,_0x2eba4c,_0x28d999,contentHash(_0x4e3c85),_0x369ec2[_0x1c47da(0xe9)]);writeJsonAtomic(resolve(_0x532b53,METADATA_FILE),_0xc1e0fb);}export function recordPushedRuntimeSkill(_0x211128,_0x325c39,_0x307faf,_0x311653={}){const _0x1a568b=a160_0x477f,_0x19ded9=resolvePushDirectoryRoot(_0x211128),_0x13c4a4=scanSkillDirectory(_0x19ded9),_0x56d5c7=_0x13c4a4[_0x1a568b(0xb2)](_0x2837b0=>_0x2837b0['path']===SKILL_FILE),_0x20786b=_0x56d5c7?fileText(_0x56d5c7):'',_0x59e6f3=tryNormalizePackageManifest(_0x325c39[_0x1a568b(0xc0)]),_0x1c1ce2={..._0x325c39,'content':_0x325c39[_0x1a568b(0xdf)]??_0x20786b,'files':_0x59e6f3},_0x47da1c=_0x59e6f3?normalizeLocalFiles(_0x13c4a4)[_0x1a568b(0xd3)](_0x4a0d2a=>_0x59e6f3[_0x1a568b(0xc0)][_0x1a568b(0xb5)](_0x2bcdf0=>_0x2bcdf0[_0x1a568b(0xcd)]===_0x4a0d2a[_0x1a568b(0xcd)])):undefined,_0x23b01c=buildMetadata(_0x1c1ce2,_0x311653[_0x1a568b(0xba)]??_0x1a568b(0xc7),_0x307faf,contentHash(_0x1c1ce2[_0x1a568b(0xdf)]??''),_0x311653[_0x1a568b(0xe5)],_0x47da1c);writeJsonAtomic(resolve(_0x19ded9,METADATA_FILE),_0x23b01c);}export function deriveSkillCodeFromDirectory(_0x21bb99,_0x509d11){const _0x10d0fa=a160_0x477f,_0x58d545=basename(resolve(_0x21bb99)),_0x4a68b4=_0x509d11+'--';return _0x58d545[_0x10d0fa(0xe0)](_0x4a68b4)?_0x58d545[_0x10d0fa(0xb4)](_0x4a68b4[_0x10d0fa(0xdd)]):_0x58d545;}function resolvePushSkillCode(_0x42245b,_0x327069,_0x24be39,_0x33c847){const _0x516eac=a160_0x477f,_0x4d2519=deriveSkillCodeFromSkillFile(_0x42245b)||deriveSkillCodeFromDirectory(_0x42245b,_0x327069);if(_0x33c847['ignoreMetadataSkillCode'])return _0x4d2519;return _0x24be39?.[_0x516eac(0xaf)]?.[_0x516eac(0xb0)]()||_0x4d2519;}function deriveSkillCodeFromSkillFile(_0x50fe41){const _0xdda977=a160_0x477f,_0x286be8=resolve(_0x50fe41,SKILL_FILE);if(!existsSync(_0x286be8)||!lstatSync(_0x286be8)['isFile']())return undefined;const _0xffebe8=readFileSync(_0x286be8,_0xdda977(0xd6)),_0x1a9e31=_0xffebe8[_0xdda977(0xbe)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x1a9e31)return undefined;const _0x2729fd=parseFrontmatterObject(_0x1a9e31[0x1]??''),_0x201e1a=scalarToString(_0x2729fd?.[_0xdda977(0xac)]);return _0x201e1a?slugifySkillName(_0x201e1a):undefined;}function readSkillDisplayName(_0x284804){const _0x2cc717=a160_0x477f,_0x4776cd=_0x284804['match'](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x4776cd)return undefined;const _0x43c000=parseFrontmatterObject(_0x4776cd[0x1]??'');return scalarToString(_0x43c000?.[_0x2cc717(0xe7)]);}function slugifySkillName(_0x5dcae9){const _0x48fc54=a160_0x477f,_0x377171=_0x5dcae9[_0x48fc54(0xb0)]()['toLowerCase']()['replace'](/[^\p{L}\p{N}\p{So}]+/gu,'-')[_0x48fc54(0xc6)](/^-+/,'')[_0x48fc54(0xc6)](/-+$/,'')[_0x48fc54(0xc6)](/-{2,}/g,'-');if(!_0x377171)throw CliErrors['validation'](_0x48fc54(0xb3)+SKILL_FILE+_0x48fc54(0xb9));return _0x377171;}function parseFrontmatterObject(_0x216387){const _0x2ea911=a160_0x477f;try{const _0x26c824=a160_0x1c0ec0(_0x216387);return _0x26c824&&typeof _0x26c824==='object'&&!Array[_0x2ea911(0xe8)](_0x26c824)?_0x26c824:undefined;}catch{return undefined;}}function scalarToString(_0x5a39b2){const _0x3bdaf4=a160_0x477f;if(typeof _0x5a39b2==='string')return _0x5a39b2[_0x3bdaf4(0xb0)]();if(typeof _0x5a39b2===_0x3bdaf4(0xe6)||typeof _0x5a39b2==='boolean')return String(_0x5a39b2);return undefined;}function resolvePushDirectoryRoot(_0x581074){const _0x9868e4=a160_0x477f,_0x12e72=resolve(_0x581074);if(!existsSync(_0x12e72))throw CliErrors[_0x9868e4(0xeb)](_0x9868e4(0xad)+_0x581074);const _0x50393f=lstatSync(_0x12e72);if(_0x50393f['isDirectory']())return _0x12e72;if(_0x50393f[_0x9868e4(0xb6)]()){const _0x39e8a0=realpathSync(_0x12e72);if(lstatSync(_0x39e8a0)[_0x9868e4(0xc8)]())return _0x39e8a0;}throw CliErrors['validation'](_0x9868e4(0xad)+_0x581074);}function requireRemoteScope(_0x137eda){const _0x5ae9f3=a160_0x477f;if(_0x137eda['scope']==='personal'||_0x137eda['scope']===_0x5ae9f3(0xc3)||_0x137eda[_0x5ae9f3(0xba)]===_0x5ae9f3(0xe1))return _0x137eda[_0x5ae9f3(0xba)];throw CliErrors['validation'](_0x5ae9f3(0xb1)+(_0x137eda[_0x5ae9f3(0xaf)]||'(unknown)')+'\x20has\x20unsupported\x20scope\x20\x22'+(_0x137eda[_0x5ae9f3(0xba)]??_0x5ae9f3(0xbb))+'\x22.');}function readLocalSkillContent(_0x190d8c){const _0xcba404=a160_0x477f,_0x59a817=resolve(_0x190d8c,SKILL_FILE);return existsSync(_0x59a817)&&lstatSync(_0x59a817)['isFile']()?readFileSync(_0x59a817,_0xcba404(0xd6)):'';}function readPushMetadataIfPresent(_0x4ad920,_0x115035={}){const _0xa2ee09=a160_0x477f;try{return readMetadataIfPresent(_0x4ad920);}catch(_0x59e97f){if(_0x115035[_0xa2ee09(0xbd)])return undefined;throw _0x59e97f;}}
@@ -1 +1 @@
1
- (function(_0x1ca1cd,_0x226d19){const _0xb81c27=a161_0xe1f2,_0x34ee56=_0x1ca1cd();while(!![]){try{const _0x29091a=parseInt(_0xb81c27(0xdb))/0x1*(-parseInt(_0xb81c27(0xdf))/0x2)+parseInt(_0xb81c27(0xda))/0x3+parseInt(_0xb81c27(0xd6))/0x4+parseInt(_0xb81c27(0xe4))/0x5*(-parseInt(_0xb81c27(0xe0))/0x6)+parseInt(_0xb81c27(0xde))/0x7+-parseInt(_0xb81c27(0xdc))/0x8+-parseInt(_0xb81c27(0xd7))/0x9;if(_0x29091a===_0x226d19)break;else _0x34ee56['push'](_0x34ee56['shift']());}catch(_0x2d4fea){_0x34ee56['push'](_0x34ee56['shift']());}}}(a161_0x1f62,0x72d0b));function a161_0xe1f2(_0x2d517f,_0x53193d){_0x2d517f=_0x2d517f-0xd6;const _0x1f6260=a161_0x1f62();let _0xe1f27f=_0x1f6260[_0x2d517f];return _0xe1f27f;}import{CliErrors}from'../../errors.js';export function normalizeRuntimeSkillScopes(_0x1a478c){const _0x291c65=a161_0xe1f2,_0x523fae=_0x1a478c&&_0x1a478c[_0x291c65(0xe5)]>0x0?_0x1a478c:[_0x291c65(0xe6),_0x291c65(0xe1),_0x291c65(0xd8)],_0x520560=[];for(const _0x233900 of _0x523fae){if(!isRuntimeSkillScope(_0x233900))throw CliErrors[_0x291c65(0xdd)](_0x291c65(0xe2)+_0x233900);!_0x520560[_0x291c65(0xd9)](_0x233900)&&_0x520560[_0x291c65(0xe3)](_0x233900);}return _0x520560;}function a161_0x1f62(){const _0x3fe68e=['builtin','includes','2316597XnFEZD','5395SIHcUt','1643592cZaNWZ','validation','3635520GlsTkM','290JYeTCJ','12VhXrtT','company','Unsupported\x20runtime\x20Skill\x20scope:\x20','push','1618720tuNsXi','length','personal','3478212ZTXnWH','500553Eljmgt'];a161_0x1f62=function(){return _0x3fe68e;};return a161_0x1f62();}export function isRuntimeSkillScope(_0x12d0f8){const _0x46c093=a161_0xe1f2;return _0x12d0f8===_0x46c093(0xe6)||_0x12d0f8===_0x46c093(0xe1)||_0x12d0f8===_0x46c093(0xd8);}
1
+ (function(_0x19597f,_0x9c6d43){const _0x5a6820=a161_0x5a13,_0xeee222=_0x19597f();while(!![]){try{const _0x392f39=-parseInt(_0x5a6820(0x109))/0x1*(-parseInt(_0x5a6820(0x10d))/0x2)+-parseInt(_0x5a6820(0x10b))/0x3*(-parseInt(_0x5a6820(0x108))/0x4)+-parseInt(_0x5a6820(0x106))/0x5+-parseInt(_0x5a6820(0x10a))/0x6+parseInt(_0x5a6820(0x10c))/0x7+-parseInt(_0x5a6820(0x101))/0x8*(-parseInt(_0x5a6820(0x105))/0x9)+-parseInt(_0x5a6820(0x100))/0xa;if(_0x392f39===_0x9c6d43)break;else _0xeee222['push'](_0xeee222['shift']());}catch(_0x9e3a72){_0xeee222['push'](_0xeee222['shift']());}}}(a161_0x2d81,0x52414));import{CliErrors}from'../../errors.js';function a161_0x5a13(_0x422221,_0x5cb00c){_0x422221=_0x422221-0x100;const _0x2d8154=a161_0x2d81();let _0x5a1384=_0x2d8154[_0x422221];return _0x5a1384;}function a161_0x2d81(){const _0x502e82=['validation','includes','10109440yPETlX','80XCgFfA','length','personal','company','520110iWUhKE','347045kjwiPV','builtin','12MbIUvs','227BNlssA','2246166lKVaNV','534708CdNhaq','4332069YbvGPL','530dLqDvU'];a161_0x2d81=function(){return _0x502e82;};return a161_0x2d81();}export function normalizeRuntimeSkillScopes(_0x48e2bd){const _0x195b80=a161_0x5a13,_0x1f4174=_0x48e2bd&&_0x48e2bd[_0x195b80(0x102)]>0x0?_0x48e2bd:[_0x195b80(0x103),_0x195b80(0x104),_0x195b80(0x107)],_0x31aab5=[];for(const _0x15860d of _0x1f4174){if(!isRuntimeSkillScope(_0x15860d))throw CliErrors[_0x195b80(0x10e)]('Unsupported\x20runtime\x20Skill\x20scope:\x20'+_0x15860d);!_0x31aab5[_0x195b80(0x10f)](_0x15860d)&&_0x31aab5['push'](_0x15860d);}return _0x31aab5;}export function isRuntimeSkillScope(_0x202d07){const _0x128110=a161_0x5a13;return _0x202d07===_0x128110(0x103)||_0x202d07==='company'||_0x202d07===_0x128110(0x107);}
@@ -1 +1 @@
1
- const a163_0x340efa=a163_0x5009;(function(_0x4ce2f0,_0x5b7696){const _0x57503b=a163_0x5009,_0x41ead0=_0x4ce2f0();while(!![]){try{const _0x205ad3=-parseInt(_0x57503b(0x15c))/0x1+-parseInt(_0x57503b(0x152))/0x2+parseInt(_0x57503b(0x160))/0x3+parseInt(_0x57503b(0x162))/0x4*(parseInt(_0x57503b(0x14e))/0x5)+-parseInt(_0x57503b(0x161))/0x6*(parseInt(_0x57503b(0x155))/0x7)+-parseInt(_0x57503b(0x154))/0x8+parseInt(_0x57503b(0x15e))/0x9*(parseInt(_0x57503b(0x164))/0xa);if(_0x205ad3===_0x5b7696)break;else _0x41ead0['push'](_0x41ead0['shift']());}catch(_0x1c3272){_0x41ead0['push'](_0x41ead0['shift']());}}}(a163_0x241e,0xe92ea));import{unzipSync,zipSync}from'fflate';function a163_0x5009(_0x3898e4,_0x42cb32){_0x3898e4=_0x3898e4-0x14e;const _0x241e4b=a163_0x241e();let _0x500982=_0x241e4b[_0x3898e4];return _0x500982;}import{CliErrors}from'../../errors.js';import{compareSkillFiles,fileContent,normalizeLocalFiles,normalizeSkillRelativePath}from'./local-files.js';function a163_0x241e(){const _0x2ab62c=['object','Runtime\x20Skill\x20package\x20contains\x20directory\x20entry:\x20','validation_error','code','validation','1494643OsXXIa','entries','36jwyFcV','map','36141YZJULc','12bpilMX','164HXdWvr','sort','10339870UMrNxs','84305XTIdbf','endsWith','Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.','length','1504902zJVVhd','name','6353360meJMrf','2950213OSBxiq','1980-01-01T00:00:00.000Z'];a163_0x241e=function(){return _0x2ab62c;};return a163_0x241e();}const ZIP_MTIME=new Date(a163_0x340efa(0x156));export function createDeterministicZipPackage(_0x3d56d0){const _0x1715e6={};for(const _0x55f2ea of normalizeLocalFiles(_0x3d56d0)){_0x1715e6[_0x55f2ea['path']]=fileContent(_0x55f2ea);}return Buffer['from'](zipSync(_0x1715e6,{'level':0x0,'mtime':ZIP_MTIME}));}export function parseZipPackage(_0x16c56f){const _0x42f6b2=a163_0x340efa;if(_0x16c56f[_0x42f6b2(0x151)]<0x16)throw CliErrors[_0x42f6b2(0x15b)]('Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.');let _0x487a1b;try{_0x487a1b=unzipSync(_0x16c56f,{'filter'(_0x3e9dd3){const _0x1d8b54=_0x42f6b2,_0x34904f=normalizeSkillRelativePath(_0x3e9dd3[_0x1d8b54(0x153)]);if(_0x34904f[_0x1d8b54(0x14f)]('/'))throw CliErrors[_0x1d8b54(0x15b)](_0x1d8b54(0x158)+_0x34904f);return!![];}});}catch(_0x32a931){if(isRuntimeSkillValidationError(_0x32a931))throw _0x32a931;throw CliErrors['validation'](_0x42f6b2(0x150));}return Object[_0x42f6b2(0x15d)](_0x487a1b)[_0x42f6b2(0x15f)](([_0x4fdd48,_0x269938])=>({'path':normalizeSkillRelativePath(_0x4fdd48),'bytes':Buffer['from'](_0x269938)}))[_0x42f6b2(0x163)](compareSkillFiles);}function isRuntimeSkillValidationError(_0xcaf36b){const _0x511f57=a163_0x340efa;return typeof _0xcaf36b===_0x511f57(0x157)&&_0xcaf36b!==null&&_0x511f57(0x15a)in _0xcaf36b&&_0xcaf36b['code']===_0x511f57(0x159);}
1
+ function a163_0x1980(_0xf6f81b,_0x52e16f){_0xf6f81b=_0xf6f81b-0x15c;const _0xd8ca0e=a163_0xd8ca();let _0x1980cd=_0xd8ca0e[_0xf6f81b];return _0x1980cd;}const a163_0x103653=a163_0x1980;(function(_0x3a6000,_0x305fe5){const _0x2ee665=a163_0x1980,_0x53af65=_0x3a6000();while(!![]){try{const _0xd365c2=parseInt(_0x2ee665(0x15d))/0x1*(-parseInt(_0x2ee665(0x169))/0x2)+parseInt(_0x2ee665(0x16f))/0x3+parseInt(_0x2ee665(0x172))/0x4*(-parseInt(_0x2ee665(0x165))/0x5)+parseInt(_0x2ee665(0x16c))/0x6*(-parseInt(_0x2ee665(0x168))/0x7)+-parseInt(_0x2ee665(0x166))/0x8*(-parseInt(_0x2ee665(0x161))/0x9)+-parseInt(_0x2ee665(0x160))/0xa+parseInt(_0x2ee665(0x167))/0xb;if(_0xd365c2===_0x305fe5)break;else _0x53af65['push'](_0x53af65['shift']());}catch(_0x464d88){_0x53af65['push'](_0x53af65['shift']());}}}(a163_0xd8ca,0x5a5c5));import{unzipSync,zipSync}from'fflate';import{CliErrors}from'../../errors.js';import{compareSkillFiles,fileContent,normalizeLocalFiles,normalizeSkillRelativePath}from'./local-files.js';const ZIP_MTIME=new Date(a163_0x103653(0x170));function a163_0xd8ca(){const _0x4cc825=['43085tMsXwI','8KSwPcq','12895498irLYJX','30499GdeHVL','33452aRlKKE','endsWith','code','588WkPaLw','Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.','from','384747kpggnv','1980-01-01T00:00:00.000Z','validation_error','308FtAGmD','name','entries','map','1dBdHkN','object','validation','3878380CTsUxi','5081481aloeZg','length','sort','Runtime\x20Skill\x20package\x20contains\x20directory\x20entry:\x20'];a163_0xd8ca=function(){return _0x4cc825;};return a163_0xd8ca();}export function createDeterministicZipPackage(_0x315ac9){const _0x36867e=a163_0x103653,_0x278535={};for(const _0x387342 of normalizeLocalFiles(_0x315ac9)){_0x278535[_0x387342['path']]=fileContent(_0x387342);}return Buffer[_0x36867e(0x16e)](zipSync(_0x278535,{'level':0x0,'mtime':ZIP_MTIME}));}export function parseZipPackage(_0x214e77){const _0x56d21f=a163_0x103653;if(_0x214e77[_0x56d21f(0x162)]<0x16)throw CliErrors['validation'](_0x56d21f(0x16d));let _0x559efc;try{_0x559efc=unzipSync(_0x214e77,{'filter'(_0x4e29e0){const _0x19ca23=_0x56d21f,_0x3f7e59=normalizeSkillRelativePath(_0x4e29e0[_0x19ca23(0x173)]);if(_0x3f7e59[_0x19ca23(0x16a)]('/'))throw CliErrors['validation'](_0x19ca23(0x164)+_0x3f7e59);return!![];}});}catch(_0x3940cf){if(isRuntimeSkillValidationError(_0x3940cf))throw _0x3940cf;throw CliErrors[_0x56d21f(0x15f)](_0x56d21f(0x16d));}return Object[_0x56d21f(0x174)](_0x559efc)[_0x56d21f(0x15c)](([_0x5ba932,_0x25460e])=>({'path':normalizeSkillRelativePath(_0x5ba932),'bytes':Buffer[_0x56d21f(0x16e)](_0x25460e)}))[_0x56d21f(0x163)](compareSkillFiles);}function isRuntimeSkillValidationError(_0x188ef0){const _0x3e8bcc=a163_0x103653;return typeof _0x188ef0===_0x3e8bcc(0x15e)&&_0x188ef0!==null&&_0x3e8bcc(0x16b)in _0x188ef0&&_0x188ef0['code']===_0x3e8bcc(0x171);}
@@ -1 +1 @@
1
- (function(_0x1087c,_0x5080b8){const _0x4093ea=a164_0x58dc,_0x19e3f8=_0x1087c();while(!![]){try{const _0x3e3f44=parseInt(_0x4093ea(0x12b))/0x1+parseInt(_0x4093ea(0x115))/0x2+parseInt(_0x4093ea(0x12a))/0x3*(-parseInt(_0x4093ea(0x104))/0x4)+parseInt(_0x4093ea(0x12f))/0x5*(parseInt(_0x4093ea(0x11d))/0x6)+-parseInt(_0x4093ea(0x113))/0x7*(parseInt(_0x4093ea(0x11e))/0x8)+parseInt(_0x4093ea(0x109))/0x9*(parseInt(_0x4093ea(0x107))/0xa)+-parseInt(_0x4093ea(0x12d))/0xb*(-parseInt(_0x4093ea(0x111))/0xc);if(_0x3e3f44===_0x5080b8)break;else _0x19e3f8['push'](_0x19e3f8['shift']());}catch(_0x5a04c6){_0x19e3f8['push'](_0x19e3f8['shift']());}}}(a164_0xdcd9,0x96edd));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(_0x12160b){const _0x2854d8=a164_0x58dc,_0x10d65c=normalizeLocalFiles(_0x12160b);if(!_0x10d65c[_0x2854d8(0x127)](_0x31d915=>_0x31d915[_0x2854d8(0x12c)]===SKILL_FILE))throw CliErrors[_0x2854d8(0x10d)](_0x2854d8(0x126)+SKILL_FILE+_0x2854d8(0x122));const _0x3faf50=localFilesToManifestFiles(_0x10d65c),_0x50687b=createDeterministicZipPackage(_0x10d65c);return{'manifest':{'schemaVersion':0x2,'treeSha256':fileTreeHash(_0x3faf50),'zipSha256':bufferSha256(_0x50687b),'zipSize':_0x50687b[_0x2854d8(0x116)],'files':_0x3faf50},'packageBytes':_0x50687b,'packageBase64':_0x50687b['toString']('base64')};}export function verifyRuntimeSkillPackage(_0x32bf4a,_0x2dce42){const _0x373c23=normalizePackageManifest(_0x32bf4a,{'requireOssPath':![]});if(!_0x373c23)throw CliErrors['validation']('Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.');return extractAndVerifyPackage(_0x373c23,_0x2dce42);}function a164_0xdcd9(){const _0x3d6807=['object','has','Duplicate\x20Skill\x20package\x20entry:\x20','11922KHBLpc','8klqQZs','files','bytes','isArray','\x20in\x20Skill\x20file\x20package.','size','Runtime\x20Skill\x20package\x20file\x20size\x20mismatch:\x20','Runtime\x20Skill\x20package\x20size\x20is\x20invalid.','Missing\x20','some','Runtime\x20Skill\x20package\x20is\x20missing\x20','isSafeInteger','6oKCpuA','1067527IjaTut','path','11NePndm','zipSize','1230DppCrr','ossPath','1898596UufpiX','zipSha256','requireOssPath','10sLGvFe','get','886122eONeAC','set','Runtime\x20Skill\x20package\x20sha256\x20is\x20invalid.','push','validation','Runtime\x20Skill\x20package\x20is\x20required\x20for\x20Skill\x20install:\x20','Runtime\x20Skill\x20package\x20file\x20sha256\x20mismatch:\x20','toLowerCase','5519964debsis','map','7219891FTEdEw','Runtime\x20Skill\x20package\x20sha256\x20mismatch.','968264flMlUl','length','Runtime\x20Skill\x20file\x20tree\x20sha256\x20is\x20invalid.','Runtime\x20Skill\x20file\x20tree\x20sha256\x20mismatch.','sha256'];a164_0xdcd9=function(){return _0x3d6807;};return a164_0xdcd9();}export function verifyRuntimeSkillBundle(_0x5f50d6,_0x2e3cc3){const _0x337f3c=normalizePackageManifest(_0x5f50d6,{'requireOssPath':![]});if(!_0x337f3c)throw CliErrors['validation']('Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.');return extractAndVerifyPackageFiles(_0x337f3c,_0x2e3cc3);}export function tryNormalizePackageManifest(_0x4dc872){return normalizePackageManifest(_0x4dc872,{'requireOssPath':![]});}export function requirePackageBytes(_0x2fec20,_0x3af09e){const _0x43fc38=a164_0x58dc;if(!_0x3af09e||_0x3af09e[_0x43fc38(0x116)]===0x0)throw CliErrors[_0x43fc38(0x10d)](_0x43fc38(0x10e)+_0x2fec20);return _0x3af09e;}export function extractDownloadedPackage(_0x5a196d){const _0x3148f9=a164_0x58dc,_0x1c774c=parseZipPackage(_0x5a196d)[_0x3148f9(0x112)](_0x46448b=>({'path':_0x46448b[_0x3148f9(0x12c)],'bytes':_0x46448b[_0x3148f9(0x120)]}));if(!_0x1c774c['some'](_0x771ceb=>_0x771ceb[_0x3148f9(0x12c)]===SKILL_FILE))throw CliErrors[_0x3148f9(0x10d)](_0x3148f9(0x128)+SKILL_FILE+'.');return normalizeLocalFiles(_0x1c774c);}export function localFilesToManifestFiles(_0x4aba09){const _0x5bf624=a164_0x58dc;return normalizeLocalFiles(_0x4aba09)[_0x5bf624(0x112)](_0x253745=>({'path':_0x253745[_0x5bf624(0x12c)],'sha256':fileHash(_0x253745),'size':fileContent(_0x253745)[_0x5bf624(0x116)]}));}function normalizePackageManifest(_0x2cb406,_0x5f537b){const _0x23f053=a164_0x58dc;if(!_0x2cb406||typeof _0x2cb406!==_0x23f053(0x11a)||Array[_0x23f053(0x121)](_0x2cb406))return undefined;const _0x3450dc=_0x2cb406,_0x22cf3f=typeof _0x3450dc['ossPath']==='string'?_0x3450dc[_0x23f053(0x103)]['trim']():undefined;if(_0x5f537b[_0x23f053(0x106)]&&!_0x22cf3f)return undefined;if(!Array[_0x23f053(0x121)](_0x3450dc[_0x23f053(0x11f)])||_0x3450dc[_0x23f053(0x11f)][_0x23f053(0x116)]===0x0)return undefined;if(!isSha256Hex(_0x3450dc['treeSha256']))throw CliErrors[_0x23f053(0x10d)](_0x23f053(0x117));if(!isSha256Hex(_0x3450dc['zipSha256']))throw CliErrors[_0x23f053(0x10d)](_0x23f053(0x10b));if(!Number['isSafeInteger'](_0x3450dc[_0x23f053(0x12e)])||_0x3450dc['zipSize']<0x0)throw CliErrors['validation'](_0x23f053(0x125));const _0x5e1125=normalizeManifestFiles(_0x3450dc[_0x23f053(0x11f)]);if(!_0x5e1125[_0x23f053(0x127)](_0x4184b1=>_0x4184b1[_0x23f053(0x12c)]===SKILL_FILE))throw CliErrors[_0x23f053(0x10d)]('Runtime\x20Skill\x20manifest\x20is\x20missing\x20'+SKILL_FILE+'.');const _0x2cdabd=fileTreeHash(_0x5e1125);if(_0x2cdabd!==_0x3450dc['treeSha256'][_0x23f053(0x110)]())throw CliErrors[_0x23f053(0x10d)](_0x23f053(0x118));return{'schemaVersion':Number[_0x23f053(0x129)](_0x3450dc['schemaVersion'])?_0x3450dc['schemaVersion']:0x2,'ossPath':_0x22cf3f,'treeSha256':_0x2cdabd,'zipSha256':_0x3450dc['zipSha256']['toLowerCase'](),'zipSize':_0x3450dc[_0x23f053(0x12e)],'files':_0x5e1125};}function a164_0x58dc(_0x201eab,_0x1a1d2f){_0x201eab=_0x201eab-0x103;const _0xdcd91b=a164_0xdcd9();let _0x58dcde=_0xdcd91b[_0x201eab];return _0x58dcde;}function extractAndVerifyPackage(_0x3edef0,_0x564369){const _0x12b816=a164_0x58dc,_0x592c4a=normalizePackageManifest(_0x3edef0,{'requireOssPath':![]});if(!_0x592c4a)throw CliErrors['validation']('Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.');if(_0x564369[_0x12b816(0x116)]!==_0x592c4a[_0x12b816(0x12e)])throw CliErrors['validation']('Runtime\x20Skill\x20package\x20size\x20mismatch.');const _0x5c41a3=bufferSha256(_0x564369);if(_0x5c41a3!==_0x592c4a[_0x12b816(0x105)])throw CliErrors[_0x12b816(0x10d)](_0x12b816(0x114));return extractAndVerifyPackageFiles(_0x592c4a,_0x564369);}function extractAndVerifyPackageFiles(_0x92eef5,_0x22925a){const _0x41392c=a164_0x58dc,_0x34b338=parseZipPackage(_0x22925a);if(_0x34b338[_0x41392c(0x116)]!==_0x92eef5[_0x41392c(0x11f)][_0x41392c(0x116)])throw CliErrors[_0x41392c(0x10d)]('Runtime\x20Skill\x20package\x20entry\x20list\x20mismatch.');const _0x4fcace=new Map();for(const _0xa709b7 of _0x34b338){if(_0x4fcace[_0x41392c(0x11b)](_0xa709b7['path']))throw CliErrors[_0x41392c(0x10d)](_0x41392c(0x11c)+_0xa709b7['path']);_0x4fcace[_0x41392c(0x10a)](_0xa709b7[_0x41392c(0x12c)],_0xa709b7);}const _0x425b32=[];for(const _0x295ef3 of _0x92eef5[_0x41392c(0x11f)]){const _0x5d00b2=_0x4fcace[_0x41392c(0x108)](_0x295ef3[_0x41392c(0x12c)]);if(!_0x5d00b2)throw CliErrors[_0x41392c(0x10d)]('Runtime\x20Skill\x20package\x20is\x20missing\x20entry:\x20'+_0x295ef3[_0x41392c(0x12c)]);if(_0x5d00b2[_0x41392c(0x120)]['length']!==_0x295ef3[_0x41392c(0x123)])throw CliErrors['validation'](_0x41392c(0x124)+_0x295ef3[_0x41392c(0x12c)]);const _0x2fa388=bufferSha256(_0x5d00b2[_0x41392c(0x120)]);if(_0x2fa388!==_0x295ef3[_0x41392c(0x119)])throw CliErrors[_0x41392c(0x10d)](_0x41392c(0x10f)+_0x295ef3[_0x41392c(0x12c)]);_0x425b32[_0x41392c(0x10c)]({'path':_0x295ef3[_0x41392c(0x12c)],'bytes':_0x5d00b2['bytes']});}return normalizeLocalFiles(_0x425b32);}
1
+ (function(_0x5ab386,_0x98646e){const _0x290c3b=a164_0x4564,_0x2a0f55=_0x5ab386();while(!![]){try{const _0x34568c=parseInt(_0x290c3b(0xa6))/0x1*(-parseInt(_0x290c3b(0xb5))/0x2)+parseInt(_0x290c3b(0xac))/0x3+-parseInt(_0x290c3b(0xa1))/0x4+-parseInt(_0x290c3b(0xc9))/0x5+-parseInt(_0x290c3b(0x9f))/0x6+parseInt(_0x290c3b(0xb9))/0x7+parseInt(_0x290c3b(0xc2))/0x8;if(_0x34568c===_0x98646e)break;else _0x2a0f55['push'](_0x2a0f55['shift']());}catch(_0x2cd60f){_0x2a0f55['push'](_0x2a0f55['shift']());}}}(a164_0x581d,0xd8907));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';function a164_0x4564(_0x47007e,_0x3c177d){_0x47007e=_0x47007e-0x9c;const _0x581d1a=a164_0x581d();let _0x456487=_0x581d1a[_0x47007e];return _0x456487;}export function buildSkillPackage(_0xe86694){const _0x243223=a164_0x4564,_0x3bc5ef=normalizeLocalFiles(_0xe86694);if(!_0x3bc5ef[_0x243223(0xb6)](_0x58c8a4=>_0x58c8a4[_0x243223(0xbb)]===SKILL_FILE))throw CliErrors['validation'](_0x243223(0xa5)+SKILL_FILE+_0x243223(0xb1));const _0x2b2e4e=localFilesToManifestFiles(_0x3bc5ef),_0x141282=createDeterministicZipPackage(_0x3bc5ef);return{'manifest':{'schemaVersion':0x2,'treeSha256':fileTreeHash(_0x2b2e4e),'zipSha256':bufferSha256(_0x141282),'zipSize':_0x141282[_0x243223(0xc4)],'files':_0x2b2e4e},'packageBytes':_0x141282,'packageBase64':_0x141282['toString'](_0x243223(0xaa))};}export function verifyRuntimeSkillPackage(_0x317cbf,_0xaf8e88){const _0x5d14fb=a164_0x4564,_0x44884d=normalizePackageManifest(_0x317cbf,{'requireOssPath':![]});if(!_0x44884d)throw CliErrors[_0x5d14fb(0xa4)](_0x5d14fb(0xc7));return extractAndVerifyPackage(_0x44884d,_0xaf8e88);}export function verifyRuntimeSkillBundle(_0x1e28ee,_0x4257c1){const _0x5bffb9=a164_0x4564,_0x1ce639=normalizePackageManifest(_0x1e28ee,{'requireOssPath':![]});if(!_0x1ce639)throw CliErrors['validation'](_0x5bffb9(0xc7));return extractAndVerifyPackageFiles(_0x1ce639,_0x4257c1);}export function tryNormalizePackageManifest(_0x2d75d2){return normalizePackageManifest(_0x2d75d2,{'requireOssPath':![]});}export function requirePackageBytes(_0x4a6169,_0x47b12b){const _0x33588=a164_0x4564;if(!_0x47b12b||_0x47b12b[_0x33588(0xc4)]===0x0)throw CliErrors[_0x33588(0xa4)](_0x33588(0x9c)+_0x4a6169);return _0x47b12b;}export function extractDownloadedPackage(_0x5f4386){const _0xd202fc=a164_0x4564,_0x1af52e=parseZipPackage(_0x5f4386)[_0xd202fc(0xa3)](_0x60f491=>({'path':_0x60f491[_0xd202fc(0xbb)],'bytes':_0x60f491[_0xd202fc(0xca)]}));if(!_0x1af52e[_0xd202fc(0xb6)](_0x479e84=>_0x479e84[_0xd202fc(0xbb)]===SKILL_FILE))throw CliErrors[_0xd202fc(0xa4)](_0xd202fc(0xbc)+SKILL_FILE+'.');return normalizeLocalFiles(_0x1af52e);}export function localFilesToManifestFiles(_0x254ee7){const _0x38f3c8=a164_0x4564;return normalizeLocalFiles(_0x254ee7)['map'](_0x2d4927=>({'path':_0x2d4927['path'],'sha256':fileHash(_0x2d4927),'size':fileContent(_0x2d4927)[_0x38f3c8(0xc4)]}));}function normalizePackageManifest(_0x3c632b,_0x431096){const _0x3fcae2=a164_0x4564;if(!_0x3c632b||typeof _0x3c632b!==_0x3fcae2(0xae)||Array[_0x3fcae2(0xad)](_0x3c632b))return undefined;const _0x345904=_0x3c632b,_0x525f81=typeof _0x345904[_0x3fcae2(0xa9)]===_0x3fcae2(0xa8)?_0x345904[_0x3fcae2(0xa9)][_0x3fcae2(0xb3)]():undefined;if(_0x431096[_0x3fcae2(0xaf)]&&!_0x525f81)return undefined;if(!Array['isArray'](_0x345904[_0x3fcae2(0xc6)])||_0x345904['files'][_0x3fcae2(0xc4)]===0x0)return undefined;if(!isSha256Hex(_0x345904[_0x3fcae2(0xab)]))throw CliErrors['validation'](_0x3fcae2(0xb2));if(!isSha256Hex(_0x345904['zipSha256']))throw CliErrors['validation'](_0x3fcae2(0xc5));if(!Number['isSafeInteger'](_0x345904[_0x3fcae2(0xa2)])||_0x345904[_0x3fcae2(0xa2)]<0x0)throw CliErrors[_0x3fcae2(0xa4)]('Runtime\x20Skill\x20package\x20size\x20is\x20invalid.');const _0x11796e=normalizeManifestFiles(_0x345904[_0x3fcae2(0xc6)]);if(!_0x11796e[_0x3fcae2(0xb6)](_0x2f0878=>_0x2f0878[_0x3fcae2(0xbb)]===SKILL_FILE))throw CliErrors[_0x3fcae2(0xa4)](_0x3fcae2(0xb7)+SKILL_FILE+'.');const _0xdca4ed=fileTreeHash(_0x11796e);if(_0xdca4ed!==_0x345904[_0x3fcae2(0xab)][_0x3fcae2(0x9e)]())throw CliErrors['validation'](_0x3fcae2(0xcc));return{'schemaVersion':Number[_0x3fcae2(0xa7)](_0x345904[_0x3fcae2(0xba)])?_0x345904['schemaVersion']:0x2,'ossPath':_0x525f81,'treeSha256':_0xdca4ed,'zipSha256':_0x345904['zipSha256'][_0x3fcae2(0x9e)](),'zipSize':_0x345904[_0x3fcae2(0xa2)],'files':_0x11796e};}function extractAndVerifyPackage(_0xf48973,_0x205a98){const _0x469450=a164_0x4564,_0x4b98af=normalizePackageManifest(_0xf48973,{'requireOssPath':![]});if(!_0x4b98af)throw CliErrors[_0x469450(0xa4)]('Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.');if(_0x205a98[_0x469450(0xc4)]!==_0x4b98af[_0x469450(0xa2)])throw CliErrors[_0x469450(0xa4)](_0x469450(0x9d));const _0x2ba538=bufferSha256(_0x205a98);if(_0x2ba538!==_0x4b98af[_0x469450(0xbf)])throw CliErrors[_0x469450(0xa4)](_0x469450(0xc1));return extractAndVerifyPackageFiles(_0x4b98af,_0x205a98);}function extractAndVerifyPackageFiles(_0x56157c,_0x1cad49){const _0x3f15ce=a164_0x4564,_0x1414ef=parseZipPackage(_0x1cad49);if(_0x1414ef[_0x3f15ce(0xc4)]!==_0x56157c['files']['length'])throw CliErrors['validation']('Runtime\x20Skill\x20package\x20entry\x20list\x20mismatch.');const _0x2c764c=new Map();for(const _0x1237d5 of _0x1414ef){if(_0x2c764c[_0x3f15ce(0xc3)](_0x1237d5['path']))throw CliErrors[_0x3f15ce(0xa4)](_0x3f15ce(0xc0)+_0x1237d5[_0x3f15ce(0xbb)]);_0x2c764c[_0x3f15ce(0xb8)](_0x1237d5[_0x3f15ce(0xbb)],_0x1237d5);}const _0x4ee50c=[];for(const _0x47fb12 of _0x56157c['files']){const _0x16e026=_0x2c764c[_0x3f15ce(0xa0)](_0x47fb12['path']);if(!_0x16e026)throw CliErrors[_0x3f15ce(0xa4)](_0x3f15ce(0xbd)+_0x47fb12[_0x3f15ce(0xbb)]);if(_0x16e026[_0x3f15ce(0xca)][_0x3f15ce(0xc4)]!==_0x47fb12[_0x3f15ce(0xb4)])throw CliErrors['validation'](_0x3f15ce(0xb0)+_0x47fb12['path']);const _0x4e8192=bufferSha256(_0x16e026[_0x3f15ce(0xca)]);if(_0x4e8192!==_0x47fb12[_0x3f15ce(0xcb)])throw CliErrors['validation'](_0x3f15ce(0xc8)+_0x47fb12['path']);_0x4ee50c[_0x3f15ce(0xbe)]({'path':_0x47fb12[_0x3f15ce(0xbb)],'bytes':_0x16e026['bytes']});}return normalizeLocalFiles(_0x4ee50c);}function a164_0x581d(){const _0x5d7e49=['map','validation','Missing\x20','2WhkzwA','isSafeInteger','string','ossPath','base64','treeSha256','392892AgFcsP','isArray','object','requireOssPath','Runtime\x20Skill\x20package\x20file\x20size\x20mismatch:\x20','\x20in\x20Skill\x20file\x20package.','Runtime\x20Skill\x20file\x20tree\x20sha256\x20is\x20invalid.','trim','size','1334966UegGfE','some','Runtime\x20Skill\x20manifest\x20is\x20missing\x20','set','6066417omNXpE','schemaVersion','path','Runtime\x20Skill\x20package\x20is\x20missing\x20','Runtime\x20Skill\x20package\x20is\x20missing\x20entry:\x20','push','zipSha256','Duplicate\x20Skill\x20package\x20entry:\x20','Runtime\x20Skill\x20package\x20sha256\x20mismatch.','20804008RAEvsk','has','length','Runtime\x20Skill\x20package\x20sha256\x20is\x20invalid.','files','Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.','Runtime\x20Skill\x20package\x20file\x20sha256\x20mismatch:\x20','1926850yDlQvv','bytes','sha256','Runtime\x20Skill\x20file\x20tree\x20sha256\x20mismatch.','Runtime\x20Skill\x20package\x20is\x20required\x20for\x20Skill\x20install:\x20','Runtime\x20Skill\x20package\x20size\x20mismatch.','toLowerCase','2069508Lxkaqf','get','2583180AoWwNw','zipSize'];a164_0x581d=function(){return _0x5d7e49;};return a164_0x581d();}
@@ -1 +1 @@
1
- (function(_0x58f849,_0x5845d6){var _0x5a1df2=a165_0x50c3,_0x2cec78=_0x58f849();while(!![]){try{var _0x40f063=-parseInt(_0x5a1df2(0xa0))/0x1+parseInt(_0x5a1df2(0x96))/0x2*(parseInt(_0x5a1df2(0x9e))/0x3)+-parseInt(_0x5a1df2(0x9c))/0x4*(parseInt(_0x5a1df2(0x98))/0x5)+parseInt(_0x5a1df2(0x9d))/0x6*(parseInt(_0x5a1df2(0x9b))/0x7)+parseInt(_0x5a1df2(0x9a))/0x8*(-parseInt(_0x5a1df2(0x9f))/0x9)+parseInt(_0x5a1df2(0x97))/0xa*(-parseInt(_0x5a1df2(0x99))/0xb)+parseInt(_0x5a1df2(0xa1))/0xc;if(_0x40f063===_0x5845d6)break;else _0x2cec78['push'](_0x2cec78['shift']());}catch(_0x4a9c4a){_0x2cec78['push'](_0x2cec78['shift']());}}}(a165_0x59c5,0xc22d8));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';function a165_0x59c5(){var _0x390fd9=['40qneiXR','31472aEBxZE','4MfxLrd','228tiBnoB','1590NSmXdp','2462139vBWuTB','427833aHlBCo','37442652wmmfhK','3260IDJEzs','10VpvRXg','28300hgdTmE','17140959nQaCyi'];a165_0x59c5=function(){return _0x390fd9;};return a165_0x59c5();}export{listLocalRuntimeSkills}from'./runtime-skill-sync/list-local.js';export{materializeRuntimeSkill,reuseMaterializedRuntimeSkill}from'./runtime-skill-sync/materialize.js';function a165_0x50c3(_0x583983,_0x52789c){_0x583983=_0x583983-0x96;var _0x59c5d1=a165_0x59c5();var _0x50c3f9=_0x59c5d1[_0x583983];return _0x50c3f9;}export{readMetadataIfPresent}from'./runtime-skill-sync/metadata.js';export{getRuntimeSkillCacheRoot,getRuntimeSkillDir,resolveSkillSyncPaths,runtimeAgentSkillRoots}from'./runtime-skill-sync/paths.js';export{deriveSkillCodeFromDirectory,readPushDirectory,refreshPushDirectoryMetadataFromRemote,recordPushedRuntimeSkill,resolvePushDirectoryIdentity}from'./runtime-skill-sync/push.js';export{buildSkillPackage,verifyRuntimeSkillBundle,verifyRuntimeSkillPackage}from'./runtime-skill-sync/zip-package.js';
1
+ function a165_0x1560(_0x3a1092,_0x337c6b){_0x3a1092=_0x3a1092-0xb4;var _0x50f946=a165_0x50f9();var _0x156058=_0x50f946[_0x3a1092];return _0x156058;}(function(_0x3ac275,_0x2b9312){var _0x5e1eba=a165_0x1560,_0x44b81f=_0x3ac275();while(!![]){try{var _0x3ba1e4=parseInt(_0x5e1eba(0xb9))/0x1+parseInt(_0x5e1eba(0xbb))/0x2+-parseInt(_0x5e1eba(0xb6))/0x3+parseInt(_0x5e1eba(0xb4))/0x4*(parseInt(_0x5e1eba(0xbd))/0x5)+parseInt(_0x5e1eba(0xb5))/0x6*(-parseInt(_0x5e1eba(0xbe))/0x7)+parseInt(_0x5e1eba(0xb7))/0x8*(parseInt(_0x5e1eba(0xba))/0x9)+-parseInt(_0x5e1eba(0xbc))/0xa*(-parseInt(_0x5e1eba(0xb8))/0xb);if(_0x3ba1e4===_0x2b9312)break;else _0x44b81f['push'](_0x44b81f['shift']());}catch(_0x1fe9a8){_0x44b81f['push'](_0x44b81f['shift']());}}}(a165_0x50f9,0x77e57));function a165_0x50f9(){var _0x24c94f=['8536790Kpzdmz','3630GRagbU','42441vtqkwL','1348kemwXA','942UeLmNG','2397249GCXsps','8tJfKmG','11CzfyGO','698255OcIryz','3930165KZxHfw','17576sFTLPj'];a165_0x50f9=function(){return _0x24c94f;};return a165_0x50f9();}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';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
- function a166_0x1f16(_0x41819d,_0x3bf51e){_0x41819d=_0x41819d-0x198;const _0x3d0d18=a166_0x3d0d();let _0x1f16c2=_0x3d0d18[_0x41819d];return _0x1f16c2;}const a166_0x1927df=a166_0x1f16;(function(_0xfdb75b,_0xe33e09){const _0x2d650e=a166_0x1f16,_0xe98fc7=_0xfdb75b();while(!![]){try{const _0x4ecec9=parseInt(_0x2d650e(0x19f))/0x1*(parseInt(_0x2d650e(0x1b4))/0x2)+-parseInt(_0x2d650e(0x1b9))/0x3+parseInt(_0x2d650e(0x199))/0x4*(-parseInt(_0x2d650e(0x1a1))/0x5)+parseInt(_0x2d650e(0x198))/0x6*(parseInt(_0x2d650e(0x19b))/0x7)+-parseInt(_0x2d650e(0x19a))/0x8+parseInt(_0x2d650e(0x1a0))/0x9*(-parseInt(_0x2d650e(0x1b1))/0xa)+parseInt(_0x2d650e(0x1a9))/0xb;if(_0x4ecec9===_0xe33e09)break;else _0xe98fc7['push'](_0xe98fc7['shift']());}catch(_0x3d8819){_0xe98fc7['push'](_0xe98fc7['shift']());}}}(a166_0x3d0d,0x7387d));function a166_0x3d0d(){const _0xfb5963=['skills','unusable','17544417iJPFUD','home','number','\x20uses\x20unsupported\x20version\x20','not-recorded','.claude','absent','.skill-lock.json','2400KjIxSc','globalSkillsDirs','\x20has\x20no\x20skills\x20map','672962dxWxGN','kind','object','recorded','\x22\x20but\x20no\x20SKILL.md\x20was\x20found\x20in\x20known\x20layouts\x20','2115675GtWjur','.agents','unverifiable','reason','6tbyrEp','1572CYAYYh','284616IHryeU','174153ZFZaRB','utf8','parse','map','2ydkwjN','14796upUsio','8705rzxSXF','version','find','message','\x20is\x20unreadable:\x20','join'];a166_0x3d0d=function(){return _0xfb5963;};return a166_0x3d0d();}import{existsSync,readFileSync}from'node:fs';import{homedir}from'node:os';import{join}from'node:path';export const SKILL_LOCK_RELATIVE_PATH=join(a166_0x1927df(0x1ba),a166_0x1927df(0x1b0));export const GLOBAL_SKILLS_DIR_RELATIVE_PATHS=[join('.agents',a166_0x1927df(0x1a7)),join(a166_0x1927df(0x1ae),a166_0x1927df(0x1a7))];const SUPPORTED_LOCK_VERSIONS=[0x3];function readLockLookup(_0x835fde,_0x120bd2){const _0x5be7a6=a166_0x1927df;if(!existsSync(_0x835fde))return{'kind':'not-recorded'};let _0x2824f7;try{_0x2824f7=JSON[_0x5be7a6(0x19d)](readFileSync(_0x835fde,_0x5be7a6(0x19c)));}catch(_0x485cd2){return{'kind':'unusable','reason':_0x835fde+_0x5be7a6(0x1a5)+_0x485cd2[_0x5be7a6(0x1a4)]};}const _0xcbcf2f=_0x2824f7;if(typeof _0xcbcf2f?.[_0x5be7a6(0x1a2)]!==_0x5be7a6(0x1ab)||!SUPPORTED_LOCK_VERSIONS['includes'](_0xcbcf2f['version']))return{'kind':_0x5be7a6(0x1a8),'reason':_0x835fde+_0x5be7a6(0x1ac)+String(_0xcbcf2f?.[_0x5be7a6(0x1a2)])};if(!_0xcbcf2f[_0x5be7a6(0x1a7)]||typeof _0xcbcf2f['skills']!==_0x5be7a6(0x1b6))return{'kind':_0x5be7a6(0x1a8),'reason':_0x835fde+_0x5be7a6(0x1b3)};return _0xcbcf2f[_0x5be7a6(0x1a7)][_0x120bd2]?{'kind':_0x5be7a6(0x1b7)}:{'kind':_0x5be7a6(0x1ad)};}export function resolveInstalledSkill(_0x1270a9,_0x131afa){const _0x51de10=a166_0x1927df,_0x3cd814=_0x131afa?.[_0x51de10(0x1aa)]??homedir(),_0x4c74a9=_0x131afa?.[_0x51de10(0x1b2)]??GLOBAL_SKILLS_DIR_RELATIVE_PATHS[_0x51de10(0x19e)](_0x4fb795=>join(_0x3cd814,_0x4fb795)),_0xe482a6=_0x131afa?.['lockFile']??join(_0x3cd814,SKILL_LOCK_RELATIVE_PATH),_0xf358dc=_0x4c74a9['map'](_0x17c235=>join(_0x17c235,_0x1270a9,'SKILL.md')),_0x228972=_0xf358dc[_0x51de10(0x1a3)](_0x95da41=>existsSync(_0x95da41));if(_0x228972)return{'state':'present','path':_0x228972};const _0x426fbc=readLockLookup(_0xe482a6,_0x1270a9);if(_0x426fbc[_0x51de10(0x1b5)]===_0x51de10(0x1a8))return{'state':_0x51de10(0x1bb),'reason':_0x426fbc[_0x51de10(0x1bc)]};if(_0x426fbc['kind']===_0x51de10(0x1b7))return{'state':_0x51de10(0x1bb),'reason':_0xe482a6+'\x20records\x20\x22'+_0x1270a9+_0x51de10(0x1b8)+('('+_0xf358dc[_0x51de10(0x1a6)](',\x20')+')')};return{'state':_0x51de10(0x1af),'checked':_0xf358dc};}
1
+ const a166_0x3e5a1f=a166_0x54f4;(function(_0xd4a47c,_0x4f9e2e){const _0x167db1=a166_0x54f4,_0x2b88ed=_0xd4a47c();while(!![]){try{const _0x40e42b=-parseInt(_0x167db1(0x7c))/0x1+-parseInt(_0x167db1(0x89))/0x2+parseInt(_0x167db1(0x7a))/0x3*(-parseInt(_0x167db1(0x86))/0x4)+-parseInt(_0x167db1(0x80))/0x5*(-parseInt(_0x167db1(0x8c))/0x6)+-parseInt(_0x167db1(0x8d))/0x7*(-parseInt(_0x167db1(0x8e))/0x8)+-parseInt(_0x167db1(0x8f))/0x9*(-parseInt(_0x167db1(0x7d))/0xa)+parseInt(_0x167db1(0x85))/0xb;if(_0x40e42b===_0x4f9e2e)break;else _0x2b88ed['push'](_0x2b88ed['shift']());}catch(_0x3efeb9){_0x2b88ed['push'](_0x2b88ed['shift']());}}}(a166_0xaad7,0x57d45));import{existsSync,readFileSync}from'node:fs';import{homedir}from'node:os';import{join}from'node:path';function a166_0xaad7(){const _0x47275f=['.claude','.agents','\x20has\x20no\x20skills\x20map','11877CookqS','skills','611465QaCoWM','2690kthaxz','\x20is\x20unreadable:\x20','utf8','427115eVGOLg','find','object','includes','kind','5336870YFbILd','524VeuztM','\x20records\x20\x22','not-recorded','1189424cUszYy','\x20uses\x20unsupported\x20version\x20','reason','42ceYceC','11879ymcHUO','2120bVClIU','18459YBEVwJ','home','globalSkillsDirs','unusable','SKILL.md','version','\x22\x20but\x20no\x20SKILL.md\x20was\x20found\x20in\x20known\x20layouts\x20','recorded','map','lockFile','unverifiable'];a166_0xaad7=function(){return _0x47275f;};return a166_0xaad7();}export const SKILL_LOCK_RELATIVE_PATH=join('.agents','.skill-lock.json');function a166_0x54f4(_0x43014c,_0x56ddd3){_0x43014c=_0x43014c-0x6f;const _0xaad7bc=a166_0xaad7();let _0x54f45=_0xaad7bc[_0x43014c];return _0x54f45;}export const GLOBAL_SKILLS_DIR_RELATIVE_PATHS=[join(a166_0x3e5a1f(0x78),'skills'),join(a166_0x3e5a1f(0x77),a166_0x3e5a1f(0x7b))];const SUPPORTED_LOCK_VERSIONS=[0x3];function readLockLookup(_0x4c0fae,_0x14732e){const _0x5a6727=a166_0x3e5a1f;if(!existsSync(_0x4c0fae))return{'kind':_0x5a6727(0x88)};let _0x58c552;try{_0x58c552=JSON['parse'](readFileSync(_0x4c0fae,_0x5a6727(0x7f)));}catch(_0x286d3d){return{'kind':_0x5a6727(0x6f),'reason':_0x4c0fae+_0x5a6727(0x7e)+_0x286d3d['message']};}const _0x524bdd=_0x58c552;if(typeof _0x524bdd?.[_0x5a6727(0x71)]!=='number'||!SUPPORTED_LOCK_VERSIONS[_0x5a6727(0x83)](_0x524bdd['version']))return{'kind':_0x5a6727(0x6f),'reason':_0x4c0fae+_0x5a6727(0x8a)+String(_0x524bdd?.[_0x5a6727(0x71)])};if(!_0x524bdd[_0x5a6727(0x7b)]||typeof _0x524bdd[_0x5a6727(0x7b)]!==_0x5a6727(0x82))return{'kind':_0x5a6727(0x6f),'reason':_0x4c0fae+_0x5a6727(0x79)};return _0x524bdd[_0x5a6727(0x7b)][_0x14732e]?{'kind':_0x5a6727(0x73)}:{'kind':_0x5a6727(0x88)};}export function resolveInstalledSkill(_0x311679,_0x1ddb10){const _0x395ec7=a166_0x3e5a1f,_0x1f1fa7=_0x1ddb10?.[_0x395ec7(0x90)]??homedir(),_0x4fd4dc=_0x1ddb10?.[_0x395ec7(0x91)]??GLOBAL_SKILLS_DIR_RELATIVE_PATHS[_0x395ec7(0x74)](_0x1dbae7=>join(_0x1f1fa7,_0x1dbae7)),_0x1bf4b0=_0x1ddb10?.[_0x395ec7(0x75)]??join(_0x1f1fa7,SKILL_LOCK_RELATIVE_PATH),_0x1beff4=_0x4fd4dc[_0x395ec7(0x74)](_0x4bc12e=>join(_0x4bc12e,_0x311679,_0x395ec7(0x70))),_0x27bbff=_0x1beff4[_0x395ec7(0x81)](_0x74a133=>existsSync(_0x74a133));if(_0x27bbff)return{'state':'present','path':_0x27bbff};const _0x458a2b=readLockLookup(_0x1bf4b0,_0x311679);if(_0x458a2b[_0x395ec7(0x84)]===_0x395ec7(0x6f))return{'state':_0x395ec7(0x76),'reason':_0x458a2b[_0x395ec7(0x8b)]};if(_0x458a2b[_0x395ec7(0x84)]==='recorded')return{'state':_0x395ec7(0x76),'reason':_0x1bf4b0+_0x395ec7(0x87)+_0x311679+_0x395ec7(0x72)+('('+_0x1beff4['join'](',\x20')+')')};return{'state':'absent','checked':_0x1beff4};}
@@ -1 +1 @@
1
- const a167_0x3e4dbf=a167_0x20b8;(function(_0x1b1c5e,_0x4dd5aa){const _0x37cbbd=a167_0x20b8,_0x2e0e5c=_0x1b1c5e();while(!![]){try{const _0x4ea74f=parseInt(_0x37cbbd(0x170))/0x1*(parseInt(_0x37cbbd(0x167))/0x2)+parseInt(_0x37cbbd(0x17d))/0x3+-parseInt(_0x37cbbd(0x178))/0x4*(parseInt(_0x37cbbd(0x17a))/0x5)+parseInt(_0x37cbbd(0x16f))/0x6+parseInt(_0x37cbbd(0x174))/0x7*(parseInt(_0x37cbbd(0x176))/0x8)+parseInt(_0x37cbbd(0x175))/0x9+-parseInt(_0x37cbbd(0x171))/0xa;if(_0x4ea74f===_0x4dd5aa)break;else _0x2e0e5c['push'](_0x2e0e5c['shift']());}catch(_0x1971fc){_0x2e0e5c['push'](_0x2e0e5c['shift']());}}}(a167_0x1ece,0x67ef9));const REDACTED_ACCESS_KEY=a167_0x3e4dbf(0x17c);export function maskCliAccessKey(_0x5cc1e0){const _0x34f9df=a167_0x3e4dbf;if(typeof _0x5cc1e0!=='string'||_0x5cc1e0[_0x34f9df(0x172)]<=0x8)return REDACTED_ACCESS_KEY;return''+_0x5cc1e0[_0x34f9df(0x179)](0x0,0x8)+'*'[_0x34f9df(0x17b)](_0x5cc1e0[_0x34f9df(0x172)]-0x8);}export function redactCliConfigCredentials(_0x41ee43){const _0x396892=a167_0x3e4dbf,_0x51ce8a={..._0x41ee43};return Object[_0x396892(0x173)][_0x396892(0x168)][_0x396892(0x16d)](_0x51ce8a,_0x396892(0x16c))&&(_0x51ce8a['accessKey']=maskCliAccessKey(_0x51ce8a[_0x396892(0x16c)])),_0x51ce8a[_0x396892(0x16b)]&&typeof _0x51ce8a[_0x396892(0x16b)]===_0x396892(0x17e)&&!Array['isArray'](_0x51ce8a[_0x396892(0x16b)])&&(_0x51ce8a['apps']=redactLegacyAppCredentials(_0x51ce8a[_0x396892(0x16b)])),_0x51ce8a;}function a167_0x20b8(_0x69941b,_0x4266dc){_0x69941b=_0x69941b-0x166;const _0x1ece63=a167_0x1ece();let _0x20b8a7=_0x1ece63[_0x69941b];return _0x20b8a7;}function a167_0x1ece(){const _0x3d04a1=['map','670McLUFx','hasOwnProperty','entries','test','apps','accessKey','call','isArray','245628UGbrZI','1648GgviXJ','3040670XaVvIZ','length','prototype','13153WMcPAb','2969019cXlwpa','976SJykYX','fromEntries','61620owxhgJ','slice','235GdBbpc','repeat','<redacted>','905028UfZJEW','object'];a167_0x1ece=function(){return _0x3d04a1;};return a167_0x1ece();}export function redactCliConfigValue(_0x3fa8d8,_0x8f85a3){const _0x315de7=a167_0x3e4dbf;if(_0x3fa8d8==='accessKey'||/^apps\.[^.]+\.accessKey$/[_0x315de7(0x16a)](_0x3fa8d8))return maskCliAccessKey(_0x8f85a3);if(_0x3fa8d8===_0x315de7(0x16b)&&_0x8f85a3&&typeof _0x8f85a3===_0x315de7(0x17e)&&!Array[_0x315de7(0x16e)](_0x8f85a3))return redactLegacyAppCredentials(_0x8f85a3);if(/^apps\.[^.]+$/[_0x315de7(0x16a)](_0x3fa8d8)&&_0x8f85a3&&typeof _0x8f85a3===_0x315de7(0x17e)&&!Array[_0x315de7(0x16e)](_0x8f85a3)){const _0x529a4f=_0x8f85a3;return Object[_0x315de7(0x173)]['hasOwnProperty'][_0x315de7(0x16d)](_0x529a4f,'accessKey')?{..._0x529a4f,'accessKey':maskCliAccessKey(_0x529a4f[_0x315de7(0x16c)])}:_0x8f85a3;}return _0x8f85a3;}function redactLegacyAppCredentials(_0x2333cc){const _0x1b21e5=a167_0x3e4dbf;return Object[_0x1b21e5(0x177)](Object[_0x1b21e5(0x169)](_0x2333cc)[_0x1b21e5(0x166)](([_0x47c1a1,_0x5944fb])=>{const _0x124914=_0x1b21e5;if(!_0x5944fb||typeof _0x5944fb!==_0x124914(0x17e)||Array[_0x124914(0x16e)](_0x5944fb))return[_0x47c1a1,_0x5944fb];const _0x582117={..._0x5944fb};return Object['prototype'][_0x124914(0x168)][_0x124914(0x16d)](_0x582117,'accessKey')&&(_0x582117[_0x124914(0x16c)]=maskCliAccessKey(_0x582117[_0x124914(0x16c)])),[_0x47c1a1,_0x582117];}));}
1
+ const a167_0x3caa63=a167_0x3351;(function(_0x362a12,_0x341805){const _0x4bfd18=a167_0x3351,_0x32c88b=_0x362a12();while(!![]){try{const _0x2fb26e=parseInt(_0x4bfd18(0x1db))/0x1+-parseInt(_0x4bfd18(0x1e9))/0x2+parseInt(_0x4bfd18(0x1de))/0x3*(-parseInt(_0x4bfd18(0x1dd))/0x4)+parseInt(_0x4bfd18(0x1e6))/0x5*(-parseInt(_0x4bfd18(0x1e7))/0x6)+-parseInt(_0x4bfd18(0x1df))/0x7+-parseInt(_0x4bfd18(0x1d7))/0x8*(parseInt(_0x4bfd18(0x1ec))/0x9)+parseInt(_0x4bfd18(0x1d6))/0xa;if(_0x2fb26e===_0x341805)break;else _0x32c88b['push'](_0x32c88b['shift']());}catch(_0x2abd33){_0x32c88b['push'](_0x32c88b['shift']());}}}(a167_0x189b,0x89a2e));const REDACTED_ACCESS_KEY=a167_0x3caa63(0x1ea);function a167_0x189b(){const _0x4a2147=['isArray','repeat','451865axZtRs','42fGtrTf','prototype','122452oXTTZj','<redacted>','accessKey','450ssNElR','test','string','29944850MGuBQU','10720YPUJAw','length','entries','call','200717gwShuJ','slice','64pguGGv','139647rvSVSs','7880761nUVOor','apps','fromEntries','hasOwnProperty','object'];a167_0x189b=function(){return _0x4a2147;};return a167_0x189b();}export function maskCliAccessKey(_0x15cbda){const _0x17069c=a167_0x3caa63;if(typeof _0x15cbda!==_0x17069c(0x1d5)||_0x15cbda[_0x17069c(0x1d8)]<=0x8)return REDACTED_ACCESS_KEY;return''+_0x15cbda[_0x17069c(0x1dc)](0x0,0x8)+'*'[_0x17069c(0x1e5)](_0x15cbda[_0x17069c(0x1d8)]-0x8);}export function redactCliConfigCredentials(_0x447501){const _0x53cfae=a167_0x3caa63,_0xb46612={..._0x447501};return Object['prototype'][_0x53cfae(0x1e2)][_0x53cfae(0x1da)](_0xb46612,_0x53cfae(0x1eb))&&(_0xb46612['accessKey']=maskCliAccessKey(_0xb46612['accessKey'])),_0xb46612[_0x53cfae(0x1e0)]&&typeof _0xb46612['apps']===_0x53cfae(0x1e3)&&!Array['isArray'](_0xb46612[_0x53cfae(0x1e0)])&&(_0xb46612[_0x53cfae(0x1e0)]=redactLegacyAppCredentials(_0xb46612['apps'])),_0xb46612;}function a167_0x3351(_0x3fbca6,_0x622828){_0x3fbca6=_0x3fbca6-0x1d5;const _0x189b8a=a167_0x189b();let _0x335139=_0x189b8a[_0x3fbca6];return _0x335139;}export function redactCliConfigValue(_0x58f0c6,_0x201929){const _0x4bcf0f=a167_0x3caa63;if(_0x58f0c6===_0x4bcf0f(0x1eb)||/^apps\.[^.]+\.accessKey$/[_0x4bcf0f(0x1ed)](_0x58f0c6))return maskCliAccessKey(_0x201929);if(_0x58f0c6===_0x4bcf0f(0x1e0)&&_0x201929&&typeof _0x201929===_0x4bcf0f(0x1e3)&&!Array['isArray'](_0x201929))return redactLegacyAppCredentials(_0x201929);if(/^apps\.[^.]+$/[_0x4bcf0f(0x1ed)](_0x58f0c6)&&_0x201929&&typeof _0x201929==='object'&&!Array[_0x4bcf0f(0x1e4)](_0x201929)){const _0x4d485b=_0x201929;return Object['prototype']['hasOwnProperty']['call'](_0x4d485b,_0x4bcf0f(0x1eb))?{..._0x4d485b,'accessKey':maskCliAccessKey(_0x4d485b[_0x4bcf0f(0x1eb)])}:_0x201929;}return _0x201929;}function redactLegacyAppCredentials(_0x2a6953){const _0xc66ef=a167_0x3caa63;return Object[_0xc66ef(0x1e1)](Object[_0xc66ef(0x1d9)](_0x2a6953)['map'](([_0x3480da,_0x380d11])=>{const _0x36f6c2=_0xc66ef;if(!_0x380d11||typeof _0x380d11!=='object'||Array[_0x36f6c2(0x1e4)](_0x380d11))return[_0x3480da,_0x380d11];const _0x5d6744={..._0x380d11};return Object[_0x36f6c2(0x1e8)][_0x36f6c2(0x1e2)][_0x36f6c2(0x1da)](_0x5d6744,_0x36f6c2(0x1eb))&&(_0x5d6744[_0x36f6c2(0x1eb)]=maskCliAccessKey(_0x5d6744[_0x36f6c2(0x1eb)])),[_0x3480da,_0x5d6744];}));}
@@ -1 +1 @@
1
- function a168_0x3d9a(_0x154898,_0x1b327d){_0x154898=_0x154898-0x10b;const _0x551c73=a168_0x551c();let _0x3d9a44=_0x551c73[_0x154898];return _0x3d9a44;}(function(_0x17a06f,_0x1a56e9){const _0x3dc069=a168_0x3d9a,_0x3b7988=_0x17a06f();while(!![]){try{const _0x12508f=parseInt(_0x3dc069(0x112))/0x1+-parseInt(_0x3dc069(0x113))/0x2+-parseInt(_0x3dc069(0x10b))/0x3*(parseInt(_0x3dc069(0x111))/0x4)+-parseInt(_0x3dc069(0x10e))/0x5+parseInt(_0x3dc069(0x10c))/0x6+parseInt(_0x3dc069(0x110))/0x7+parseInt(_0x3dc069(0x10d))/0x8*(parseInt(_0x3dc069(0x10f))/0x9);if(_0x12508f===_0x1a56e9)break;else _0x3b7988['push'](_0x3b7988['shift']());}catch(_0x43bb37){_0x3b7988['push'](_0x3b7988['shift']());}}}(a168_0x551c,0x2b1ec));import{createJqFilter,resolveBundledJqPaths}from'@lovrabet/cli-framework';import{CliErrors}from'../errors.js';function a168_0x551c(){const _0x3b89cf=['24580lUVCVg','21223WgMBRj','459744OEjJBw','15ThQdYR','335844ETBJwZ','24VOmeON','1462830iZIouU','943146rFFoEJ','2367428tZVzFB'];a168_0x551c=function(){return _0x3b89cf;};return a168_0x551c();}export const applyJqFilter=createJqFilter(CliErrors,{'bundledJqPaths':resolveBundledJqPaths()});
1
+ function a168_0x321a(){const _0x19d6a8=['2491115TCiQAF','1771332enOaPJ','9925576SnySXf','5211144jtoalH','1569914JAvghw','1748370dimnBA','377328jhCulL','7MaMApv'];a168_0x321a=function(){return _0x19d6a8;};return a168_0x321a();}function a168_0x4f63(_0x510aa8,_0x5642e5){_0x510aa8=_0x510aa8-0x1ad;const _0x321a59=a168_0x321a();let _0x4f6338=_0x321a59[_0x510aa8];return _0x4f6338;}(function(_0xb4c570,_0x21c2b7){const _0x2fe9fb=a168_0x4f63,_0x50b1ed=_0xb4c570();while(!![]){try{const _0x352d68=parseInt(_0x2fe9fb(0x1b4))/0x1+-parseInt(_0x2fe9fb(0x1b2))/0x2+parseInt(_0x2fe9fb(0x1b3))/0x3+parseInt(_0x2fe9fb(0x1af))/0x4+-parseInt(_0x2fe9fb(0x1ae))/0x5+-parseInt(_0x2fe9fb(0x1b1))/0x6+-parseInt(_0x2fe9fb(0x1ad))/0x7*(-parseInt(_0x2fe9fb(0x1b0))/0x8);if(_0x352d68===_0x21c2b7)break;else _0x50b1ed['push'](_0x50b1ed['shift']());}catch(_0x3f3d65){_0x50b1ed['push'](_0x50b1ed['shift']());}}}(a168_0x321a,0x781a8));import{createJqFilter,resolveBundledJqPaths}from'@lovrabet/cli-framework';import{CliErrors}from'../errors.js';export const applyJqFilter=createJqFilter(CliErrors,{'bundledJqPaths':resolveBundledJqPaths()});