@lovrabet/lovrabet-cli 2.3.6-beta.3 → 2.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (180) hide show
  1. package/lib/cli.js +1 -1
  2. package/lib/commands/api-doc/index.js +1 -1
  3. package/lib/commands/app/cache.js +1 -1
  4. package/lib/commands/app/definitions.js +1 -1
  5. package/lib/commands/app/eligibility.js +1 -1
  6. package/lib/commands/app/mock-loader.js +1 -1
  7. package/lib/commands/app/remote-source.js +1 -1
  8. package/lib/commands/app/shared.js +1 -1
  9. package/lib/commands/app-config/get.js +1 -1
  10. package/lib/commands/app-config/index.js +1 -1
  11. package/lib/commands/approval/index.js +1 -1
  12. package/lib/commands/artifact/index.js +1 -1
  13. package/lib/commands/auth/device.js +1 -1
  14. package/lib/commands/auth/index.js +1 -1
  15. package/lib/commands/auth/prompt.js +1 -1
  16. package/lib/commands/bff/detail.js +1 -1
  17. package/lib/commands/bff/exec.js +1 -1
  18. package/lib/commands/bff/index.js +1 -1
  19. package/lib/commands/cli-skill/index.js +1 -1
  20. package/lib/commands/common/config-policy.js +1 -1
  21. package/lib/commands/common/constraints.js +1 -1
  22. package/lib/commands/common/flags.js +1 -1
  23. package/lib/commands/common/local-file.js +1 -1
  24. package/lib/commands/config/definitions.js +1 -1
  25. package/lib/commands/config/init.js +1 -1
  26. package/lib/commands/config/shared.js +1 -1
  27. package/lib/commands/data/import-excel.js +1 -1
  28. package/lib/commands/data/index.js +1 -1
  29. package/lib/commands/dataset/detail.js +1 -1
  30. package/lib/commands/dataset/index.js +1 -1
  31. package/lib/commands/dataset/list.js +1 -1
  32. package/lib/commands/dataset/sdk-doc.js +1 -1
  33. package/lib/commands/doctor.js +1 -1
  34. package/lib/commands/file/index.js +1 -1
  35. package/lib/commands/init.js +1 -1
  36. package/lib/commands/kb/index.js +1 -1
  37. package/lib/commands/logs/index.js +1 -1
  38. package/lib/commands/notification/config-list.js +1 -1
  39. package/lib/commands/notification/index.js +1 -1
  40. package/lib/commands/notification/shared.js +1 -1
  41. package/lib/commands/ocr/index.js +1 -1
  42. package/lib/commands/permit/dataset-get.js +1 -1
  43. package/lib/commands/permit/dataset-set.js +1 -1
  44. package/lib/commands/permit/index.js +1 -1
  45. package/lib/commands/permit/page-get.js +1 -1
  46. package/lib/commands/permit/page-set.js +1 -1
  47. package/lib/commands/permit/role-menus-set.js +1 -1
  48. package/lib/commands/permit/role-menus.js +1 -1
  49. package/lib/commands/permit/shared.js +1 -1
  50. package/lib/commands/personal-bff/index.js +1 -1
  51. package/lib/commands/registry.js +1 -1
  52. package/lib/commands/role/create.js +1 -1
  53. package/lib/commands/role/delete.js +1 -1
  54. package/lib/commands/role/detail.js +1 -1
  55. package/lib/commands/role/index.js +1 -1
  56. package/lib/commands/role/list.js +1 -1
  57. package/lib/commands/role/shared.js +1 -1
  58. package/lib/commands/role/update.js +1 -1
  59. package/lib/commands/role/user-add.js +1 -1
  60. package/lib/commands/role/user-remove.js +1 -1
  61. package/lib/commands/schedule/index.js +1 -1
  62. package/lib/commands/schema.js +1 -1
  63. package/lib/commands/service/dynamic.js +1 -1
  64. package/lib/commands/service/function-name-adapter.js +1 -1
  65. package/lib/commands/service/index.js +1 -1
  66. package/lib/commands/service/registry.js +1 -1
  67. package/lib/commands/skill/commands/create.js +1 -1
  68. package/lib/commands/skill/commands/diagram.js +1 -1
  69. package/lib/commands/skill/commands/install.js +1 -1
  70. package/lib/commands/skill/commands/list.js +1 -1
  71. package/lib/commands/skill/commands/push.js +1 -1
  72. package/lib/commands/skill/commands/validate.js +1 -1
  73. package/lib/commands/skill/diagram.js +1 -1
  74. package/lib/commands/skill/flags.js +1 -1
  75. package/lib/commands/skill/index.js +1 -1
  76. package/lib/commands/skill/manifest-helpers.js +1 -1
  77. package/lib/commands/skill/push-execute.js +1 -1
  78. package/lib/commands/skill/push-flow-helpers.js +1 -1
  79. package/lib/commands/skill/push-retarget.js +1 -1
  80. package/lib/commands/skill/scopes.js +1 -1
  81. package/lib/commands/skill/summary.js +1 -1
  82. package/lib/commands/skill/templates.js +1 -1
  83. package/lib/commands/skill/validate.js +1 -1
  84. package/lib/commands/sql/detail.js +1 -1
  85. package/lib/commands/sql/exec.js +1 -1
  86. package/lib/commands/sql/index.js +1 -1
  87. package/lib/commands/update.js +1 -1
  88. package/lib/commands/user-account/bind.js +1 -1
  89. package/lib/commands/user-account/index.js +1 -1
  90. package/lib/commands/workspace/index.js +1 -1
  91. package/lib/config/domain-config.js +1 -1
  92. package/lib/config/schema.js +1 -1
  93. package/lib/constant/app.js +1 -1
  94. package/lib/constant/auth-mode.js +1 -1
  95. package/lib/constant/cli.js +1 -1
  96. package/lib/constant/defaults.js +1 -1
  97. package/lib/constant/distribution.js +1 -1
  98. package/lib/constant/domain.js +1 -1
  99. package/lib/constant/env.js +1 -1
  100. package/lib/constant/output.js +1 -1
  101. package/lib/constant/product.js +1 -1
  102. package/lib/constant/region.js +1 -1
  103. package/lib/constant/risk.js +1 -1
  104. package/lib/constant/url.js +1 -1
  105. package/lib/context.js +1 -1
  106. package/lib/core/api-client.js +1 -1
  107. package/lib/core/db-resolver.js +1 -1
  108. package/lib/core/kb-management-client.js +1 -1
  109. package/lib/core/kb-search-client.js +1 -1
  110. package/lib/core/sdk-client.js +1 -1
  111. package/lib/errors.js +1 -1
  112. package/lib/framework/access-error.js +1 -1
  113. package/lib/framework/build-all-flags.js +1 -1
  114. package/lib/framework/dryrun.js +1 -1
  115. package/lib/framework/flags.js +1 -1
  116. package/lib/framework/help.js +1 -1
  117. package/lib/framework/index.js +1 -1
  118. package/lib/framework/output.js +1 -1
  119. package/lib/framework/preparse.js +1 -1
  120. package/lib/framework/rate-limit.js +1 -1
  121. package/lib/framework/raw-flags.js +1 -1
  122. package/lib/framework/response.js +1 -1
  123. package/lib/framework/runner-confirmation.js +1 -1
  124. package/lib/framework/runner-error.js +1 -1
  125. package/lib/framework/runner.js +1 -1
  126. package/lib/framework/schema-export.js +1 -1
  127. package/lib/framework/service-order.js +1 -1
  128. package/lib/framework/types.js +1 -1
  129. package/lib/generated/build-info.d.ts +4 -4
  130. package/lib/generated/build-info.js +1 -1
  131. package/lib/generated/official-routing.js +1 -1
  132. package/lib/generated/routing-contract.js +1 -1
  133. package/lib/help.js +1 -1
  134. package/lib/postinstall.js +1 -1
  135. package/lib/runtime/confirmation.js +1 -1
  136. package/lib/runtime/event.js +1 -1
  137. package/lib/runtime/index.js +1 -1
  138. package/lib/runtime/queue.js +1 -1
  139. package/lib/runtime/resolve.js +1 -1
  140. package/lib/services/dataset-import/auto-id-runner.js +1 -1
  141. package/lib/services/dataset-import/excel-reader.js +1 -1
  142. package/lib/services/dataset-import/image-bytes.js +1 -1
  143. package/lib/services/dataset-import/image-ooxml.js +1 -1
  144. package/lib/services/dataset-import/image-runner.js +1 -1
  145. package/lib/services/dataset-import/metadata.js +1 -1
  146. package/lib/services/dataset-import/preview.js +1 -1
  147. package/lib/services/dataset-import/runner.js +1 -1
  148. package/lib/skills/builtin-skill.js +1 -1
  149. package/lib/skills/npx-skills-add.js +1 -1
  150. package/lib/skills/runtime-skill-sync/constants.js +1 -1
  151. package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
  152. package/lib/skills/runtime-skill-sync/hashing.js +1 -1
  153. package/lib/skills/runtime-skill-sync/install-target.js +1 -1
  154. package/lib/skills/runtime-skill-sync/links.js +1 -1
  155. package/lib/skills/runtime-skill-sync/list-local.js +1 -1
  156. package/lib/skills/runtime-skill-sync/local-files.js +1 -1
  157. package/lib/skills/runtime-skill-sync/materialize.js +1 -1
  158. package/lib/skills/runtime-skill-sync/metadata.js +1 -1
  159. package/lib/skills/runtime-skill-sync/paths.js +1 -1
  160. package/lib/skills/runtime-skill-sync/push.js +1 -1
  161. package/lib/skills/runtime-skill-sync/scopes.js +1 -1
  162. package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
  163. package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
  164. package/lib/skills/runtime-skill-sync.js +1 -1
  165. package/lib/skills/skill-presence.js +1 -1
  166. package/lib/utils/access-key-redaction.js +1 -1
  167. package/lib/utils/apply-jq-filter.js +1 -1
  168. package/lib/utils/cli-version-check.js +1 -1
  169. package/lib/utils/cli-version-policy.js +1 -1
  170. package/lib/utils/logger.js +1 -1
  171. package/lib/utils/lossless-json.js +1 -1
  172. package/lib/utils/params.js +1 -1
  173. package/lib/utils/positive-safe-integer.js +1 -1
  174. package/lib/utils/redaction.js +1 -1
  175. package/lib/utils/update-notice.js +1 -1
  176. package/lib/utils/version.js +1 -1
  177. package/lib/utils/write-cli-side-channel.js +1 -1
  178. package/package.json +1 -1
  179. package/skills/lovrabet/SKILL.md +1 -1
  180. package/skills/lovrabet.manifest.json +3 -3
@@ -1 +1 @@
1
- const a154_0x4f48b2=a154_0x2537;(function(_0x294322,_0x37f4b7){const _0x383e1a=a154_0x2537,_0x831736=_0x294322();while(!![]){try{const _0x5d9bb4=parseInt(_0x383e1a(0x139))/0x1+-parseInt(_0x383e1a(0x122))/0x2+-parseInt(_0x383e1a(0x141))/0x3*(-parseInt(_0x383e1a(0x129))/0x4)+-parseInt(_0x383e1a(0x137))/0x5+parseInt(_0x383e1a(0x13c))/0x6+-parseInt(_0x383e1a(0x145))/0x7+-parseInt(_0x383e1a(0x142))/0x8*(-parseInt(_0x383e1a(0x14d))/0x9);if(_0x5d9bb4===_0x37f4b7)break;else _0x831736['push'](_0x831736['shift']());}catch(_0x328d2e){_0x831736['push'](_0x831736['shift']());}}}(a154_0x1e8c,0x7ff24));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';function a154_0x1e8c(){const _0x2f2ace=['length','2169040ujymnG','isDirectory','970379ZmNtUt','validation','builtin','1537692XZDKoG','pruneSkillCodes','removed','created','personal','3OtzDDf','3694072NsUCIY','has','activeSkillCodes','1475264BNWGrv','env','filter','linked-from-protected-root','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20','metadataPath','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','managedRoot','9moUsPb','appCode','unchanged','runtime-observe','accessKey','name','updated','startsWith','skillCode','protectedLinkRoots','scope','get','metadata-mismatch','agentsSkillsDir','dir','1774738aEzPRz','trim','skipped','push','Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20','Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20','project','1470308dilFbG','Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20','set','contentHash','skill','Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20','map','skillRoots','values','not-managed-symlink','scopes','lovrabet','isSymbolicLink'];a154_0x1e8c=function(){return _0x2f2ace;};return a154_0x1e8c();}import a154_0x4074fc from'fs-extra';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';function a154_0x2537(_0x41392d,_0x138511){_0x41392d=_0x41392d-0x122;const _0x1e8c59=a154_0x1e8c();let _0x25372a=_0x1e8c59[_0x41392d];return _0x25372a;}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_0x4074fc,RESERVED_PROJECT_SKILL_CODES=new Set([a154_0x4f48b2(0x134),a154_0x4f48b2(0x150),'secret-retriever']);export function linkEffectiveRuntimeSkills(_0x3c429b,_0x1d1b0a){const _0x564e4e=a154_0x4f48b2,_0x323cd4=new Map();for(const _0x30b8a9 of _0x3c429b){const _0x580931=_0x30b8a9[_0x564e4e(0x12d)]['skillCode'];if(!_0x580931)continue;const _0x4dafb6=_0x323cd4[_0x564e4e(0x158)](_0x580931);(!_0x4dafb6||_0x30b8a9[_0x564e4e(0x157)]===_0x564e4e(0x140))&&_0x323cd4[_0x564e4e(0x12b)](_0x580931,_0x30b8a9);}const _0x1af2cf=[];for(const _0x3ad5b4 of _0x323cd4[_0x564e4e(0x131)]()){const _0x384034=requireSkillCode(_0x3ad5b4[_0x564e4e(0x12d)]),_0x42e09a=readMetadataIfPresent(_0x3ad5b4[_0x564e4e(0x14a)]);if(_0x42e09a?.[_0x564e4e(0x14e)]!==_0x1d1b0a[_0x564e4e(0x14e)]||_0x42e09a[_0x564e4e(0x155)]!==_0x384034)throw CliErrors[_0x564e4e(0x13a)](_0x564e4e(0x126)+_0x1d1b0a['appCode']+':\x20'+_0x3ad5b4[_0x564e4e(0x14a)]);const _0x2968a0=runtimeSkillLinkName(_0x1d1b0a,_0x384034);for(const _0x3f03f0 of _0x1d1b0a[_0x564e4e(0x130)]){_0x1af2cf[_0x564e4e(0x125)](ensureManagedSymlink(resolve(_0x3f03f0,_0x2968a0),_0x3ad5b4[_0x564e4e(0x15b)],_0x1d1b0a,_0x384034));}}return _0x1af2cf;}export function pruneStaleRuntimeSkillLinks(_0x3bb2bb,_0x8792ae,_0x17708b){const _0x585c18=a154_0x4f48b2,_0x44f0c2=new Set([..._0x8792ae][_0x585c18(0x12f)](_0x296b8c=>_0x296b8c[_0x585c18(0x123)]())[_0x585c18(0x147)](Boolean)),_0x38b333=_0x17708b?new Set([..._0x17708b][_0x585c18(0x12f)](_0x20d19a=>_0x20d19a[_0x585c18(0x123)]())[_0x585c18(0x147)](Boolean)):undefined,_0x5dff34=[];for(const _0x553cf6 of _0x3bb2bb['skillRoots']){for(const _0x10b27a of managedTargetSkillLinkPaths(_0x553cf6,_0x3bb2bb)){const _0x4d45a1=runtimeSkillCodeFromLink(_0x3bb2bb,_0x10b27a);if(_0x38b333&&!_0x38b333['has'](_0x4d45a1))continue;if(_0x44f0c2[_0x585c18(0x143)](_0x4d45a1))continue;_0x5dff34[_0x585c18(0x125)](removeManagedSkillLink(_0x10b27a,_0x3bb2bb,_0x4d45a1));}}return _0x5dff34;}export function pruneStaleRuntimeSkillCache(_0x54c9ef,_0x2adaac={}){const _0x462dc5=a154_0x4f48b2,_0x1a149e=new Set([..._0x54c9ef[_0x462dc5(0x144)]][_0x462dc5(0x12f)](_0x960c26=>_0x960c26[_0x462dc5(0x123)]())[_0x462dc5(0x147)](Boolean)),_0x993b78=_0x54c9ef[_0x462dc5(0x13d)]?new Set([..._0x54c9ef[_0x462dc5(0x13d)]][_0x462dc5(0x12f)](_0x23d701=>_0x23d701['trim']())[_0x462dc5(0x147)](Boolean)):undefined,_0x5c8d3e=_0x54c9ef[_0x462dc5(0x133)]??['personal','company'],_0x2642f2=resolve(getRuntimeSkillCacheRoot(_0x54c9ef[_0x462dc5(0x146)],_0x54c9ef[_0x462dc5(0x151)],_0x2adaac),safePathSegment(_0x54c9ef[_0x462dc5(0x14e)],_0x462dc5(0x14e))),_0x375534=[];for(const _0x535567 of _0x5c8d3e){const _0x3e53d5=resolve(_0x2642f2,_0x535567);if(!existsSync(_0x3e53d5))continue;for(const _0x520055 of readdirSync(_0x3e53d5,{'withFileTypes':!![]})){if(!_0x520055[_0x462dc5(0x138)]())continue;const _0x43687a=_0x520055[_0x462dc5(0x152)];if(_0x993b78&&!_0x993b78['has'](_0x43687a))continue;if(_0x1a149e[_0x462dc5(0x143)](_0x43687a))continue;const _0x56cc65=resolve(_0x3e53d5,_0x43687a),_0x5d8ca0=readMetadataIfPresent(resolve(_0x56cc65,METADATA_FILE));if(_0x5d8ca0?.[_0x462dc5(0x14e)]!==_0x54c9ef['appCode']||_0x5d8ca0[_0x462dc5(0x157)]!==_0x535567||_0x5d8ca0[_0x462dc5(0x155)]!==_0x43687a){_0x375534[_0x462dc5(0x125)]({'path':_0x56cc65,'action':_0x462dc5(0x124),'reason':_0x462dc5(0x159)});continue;}if(isLinkedFromAnyRoot(_0x56cc65,_0x54c9ef[_0x462dc5(0x156)]??[])){_0x375534[_0x462dc5(0x125)]({'path':_0x56cc65,'action':_0x462dc5(0x124),'reason':_0x462dc5(0x148)});continue;}removeSync(_0x56cc65),_0x375534['push']({'path':_0x56cc65,'action':_0x462dc5(0x13e)});}}return _0x375534;}export function linkGlobalRuntimeSkills(_0xb14023,_0x17b8f0={}){const _0x521f26=a154_0x4f48b2,_0x3c3ed5=resolveSkillSyncPaths(_0x17b8f0),_0x26b180=[];for(const _0x412460 of _0xb14023){if(_0x412460[_0x521f26(0x157)]!==_0x521f26(0x13b))throw CliErrors['validation'](_0x521f26(0x14b)+_0x412460[_0x521f26(0x157)]);const _0x3ea320=requireSkillCode(_0x412460['skill']),_0x4537d1=copyManagedSkillDirectory(_0x412460['dir'],resolve(_0x3c3ed5[_0x521f26(0x15a)],_0x3ea320));_0x26b180[_0x521f26(0x125)]({..._0x4537d1,'contentHash':_0x412460['contentHash']});}return _0x26b180;}function ensureManagedSymlink(_0x29be1a,_0x1cc73e,_0x2cf0d1,_0xbd05b7){const _0x1b6ab9=a154_0x4f48b2;mkdirSync(dirname(_0x29be1a),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x29be1a)||isDanglingSymlink(_0x29be1a)){const _0x15c654=lstatSync(_0x29be1a);if(!_0x15c654['isSymbolicLink']())throw CliErrors[_0x1b6ab9(0x13a)]('Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20'+_0x29be1a);const _0xdc1632=resolveSymlinkTarget(_0x29be1a);if(!isPathInside(realOrResolved(_0xdc1632),realOrResolved(_0x2cf0d1[_0x1b6ab9(0x14c)])))throw CliErrors[_0x1b6ab9(0x13a)](_0x1b6ab9(0x127)+_0x29be1a);if(realOrResolved(_0xdc1632)===realOrResolved(_0x1cc73e))return{'path':_0x29be1a,'target':_0x1cc73e,'action':_0x1b6ab9(0x14f)};const _0x2f9fd9=readMetadataIfPresent(resolve(_0xdc1632,METADATA_FILE));if(_0x2cf0d1[_0x1b6ab9(0x157)]===_0x1b6ab9(0x128)&&(_0x2f9fd9?.[_0x1b6ab9(0x14e)]!==_0x2cf0d1[_0x1b6ab9(0x14e)]||_0x2f9fd9[_0x1b6ab9(0x155)]!==_0xbd05b7))throw CliErrors['validation']('Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20'+_0x29be1a);return unlinkSync(_0x29be1a),symlinkSync(_0x1cc73e,_0x29be1a,_0x1b6ab9(0x15b)),{'path':_0x29be1a,'target':_0x1cc73e,'action':_0x1b6ab9(0x153)};}return symlinkSync(_0x1cc73e,_0x29be1a,_0x1b6ab9(0x15b)),{'path':_0x29be1a,'target':_0x1cc73e,'action':_0x1b6ab9(0x13f)};}function managedTargetSkillLinkPaths(_0x45e084,_0x3f4ca8){const _0xf3b102=a154_0x4f48b2;if(!existsSync(_0x45e084))return[];const _0x19abd1=_0x3f4ca8[_0xf3b102(0x14e)]+'--';return readdirSync(_0x45e084,{'withFileTypes':!![]})[_0xf3b102(0x147)](_0x40b1c8=>_0x3f4ca8['scope']==='project'||_0x40b1c8[_0xf3b102(0x152)][_0xf3b102(0x154)](_0x19abd1))[_0xf3b102(0x12f)](_0x393272=>resolve(_0x45e084,_0x393272[_0xf3b102(0x152)]));}function removeManagedSkillLink(_0x128796,_0x1ab515,_0x87549c){const _0x160981=a154_0x4f48b2,_0x14f7a8=lstatIfPresent(_0x128796);if(!_0x14f7a8?.[_0x160981(0x135)]())return{'path':_0x128796,'action':_0x160981(0x124),'reason':_0x160981(0x132)};const _0x3a651c=resolveSymlinkTarget(_0x128796);if(!isPathInside(realOrResolved(_0x3a651c),realOrResolved(_0x1ab515[_0x160981(0x14c)])))return{'path':_0x128796,'action':_0x160981(0x124),'reason':'external-symlink'};const _0x5f02fa=readMetadataIfPresent(resolve(_0x3a651c,METADATA_FILE));if(_0x1ab515[_0x160981(0x157)]===_0x160981(0x128)&&(_0x5f02fa?.['appCode']!==_0x1ab515[_0x160981(0x14e)]||_0x5f02fa[_0x160981(0x155)]!==_0x87549c))return{'path':_0x128796,'action':'skipped','reason':_0x160981(0x159)};return unlinkSync(_0x128796),{'path':_0x128796,'action':_0x160981(0x13e)};}function isLinkedFromAnyRoot(_0x560a22,_0x45b0d1){const _0xa90981=a154_0x4f48b2,_0x3203e3=realOrResolved(_0x560a22);for(const _0x2c2758 of _0x45b0d1){if(!existsSync(_0x2c2758))continue;for(const _0x41db32 of readdirSync(_0x2c2758,{'withFileTypes':!![]})){if(!_0x41db32[_0xa90981(0x135)]())continue;const _0x4e441f=resolve(_0x2c2758,_0x41db32['name']);if(realOrResolved(resolveSymlinkTarget(_0x4e441f))===_0x3203e3)return!![];}}return![];}function runtimeSkillLinkName(_0x6697ed,_0x4b4bda){const _0x2f507d=a154_0x4f48b2,_0x5f53fa=safePathSegment(_0x4b4bda,_0x2f507d(0x155));if(_0x6697ed['scope']===_0x2f507d(0x128)&&RESERVED_PROJECT_SKILL_CODES[_0x2f507d(0x143)](_0x5f53fa))throw CliErrors[_0x2f507d(0x13a)]('Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20'+_0x5f53fa);return _0x6697ed[_0x2f507d(0x157)]===_0x2f507d(0x128)?_0x5f53fa:_0x6697ed['appCode']+'--'+_0x5f53fa;}function runtimeSkillCodeFromLink(_0x4ec1a0,_0x2b8f01){const _0x5ca20c=a154_0x4f48b2,_0x174761=basename(_0x2b8f01);return _0x4ec1a0[_0x5ca20c(0x157)]===_0x5ca20c(0x128)?_0x174761:_0x174761['slice']((_0x4ec1a0['appCode']+'--')[_0x5ca20c(0x136)]);}export function copyManagedSkillDirectory(_0x27b0d,_0x218e26){const _0x44f47a=a154_0x4f48b2,_0xd7cb5c=resolve(_0x218e26,METADATA_FILE),_0x1b5618=existsSync(_0x218e26);if(_0x1b5618){const _0x4d6bcc=lstatSync(_0x218e26);if(_0x4d6bcc[_0x44f47a(0x135)]())throw CliErrors[_0x44f47a(0x13a)](_0x44f47a(0x12e)+_0x218e26);if(!_0x4d6bcc['isDirectory']())throw CliErrors[_0x44f47a(0x13a)](_0x44f47a(0x12a)+_0x218e26);const _0x5f00e1=readMetadataIfPresent(_0xd7cb5c);if(_0x5f00e1?.[_0x44f47a(0x157)]!=='builtin')throw CliErrors[_0x44f47a(0x13a)](_0x44f47a(0x149)+_0x218e26);}ensureDirSync(dirname(_0x218e26));const _0x388c9b=_0x1b5618?readMetadataIfPresent(_0xd7cb5c)?.[_0x44f47a(0x12c)]:undefined,_0x29f13d=readMetadataIfPresent(resolve(_0x27b0d,METADATA_FILE))?.['contentHash'];return _0x1b5618&&removeSync(_0x218e26),copySkillDirectory(_0x27b0d,_0x218e26),{'path':_0x218e26,'target':_0x27b0d,'action':!_0x1b5618?_0x44f47a(0x13f):_0x388c9b===_0x29f13d?'unchanged':'updated'};}function copySkillDirectory(_0x1f3774,_0x42dfb4){copySync(_0x1f3774,_0x42dfb4,{'dereference':![],'overwrite':!![],'filter'(_0xfe6ec8){const _0x145cad=a154_0x2537;if(lstatSync(_0xfe6ec8)[_0x145cad(0x135)]())throw CliErrors[_0x145cad(0x13a)]('Refusing\x20to\x20copy\x20Skill\x20symlink:\x20'+_0xfe6ec8);return!![];}});}
1
+ const a154_0xbd8b71=a154_0xcff4;function a154_0x2f07(){const _0x519155=['Refusing\x20to\x20copy\x20Skill\x20symlink:\x20','protectedLinkRoots','metadataPath','dir','accessKey','isDirectory','builtin','push','map','get','name','length','1420463JvDoAe','Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20','filter','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','updated','external-symlink','lovrabet','skill','project','21684qyzShe','39637500tMnSID','1785gqENCs','unchanged','not-managed-symlink','skillRoots','validation','contentHash','metadata-mismatch','scope','12454371PUVLuf','pruneSkillCodes','agentsSkillsDir','has','activeSkillCodes','1200174qiwRvx','runtime-observe','secret-retriever','managedRoot','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20','personal','134781QlgqnD','skipped','slice','set','Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20','Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20','company','isSymbolicLink','scopes','32xXxlPi','trim','skillCode','appCode','20UTwUaS','linked-from-protected-root','removed','Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20','values','2414713dvOupG'];a154_0x2f07=function(){return _0x519155;};return a154_0x2f07();}(function(_0x52fb5e,_0x2708dd){const _0x36868f=a154_0xcff4,_0x48db94=_0x52fb5e();while(!![]){try{const _0x4fdcf6=-parseInt(_0x36868f(0x101))/0x1+-parseInt(_0x36868f(0xdc))/0x2+-parseInt(_0x36868f(0xe2))/0x3*(-parseInt(_0x36868f(0xef))/0x4)+parseInt(_0x36868f(0xcf))/0x5*(-parseInt(_0x36868f(0xcd))/0x6)+-parseInt(_0x36868f(0xf4))/0x7*(parseInt(_0x36868f(0xeb))/0x8)+parseInt(_0x36868f(0xd7))/0x9+parseInt(_0x36868f(0xce))/0xa;if(_0x4fdcf6===_0x2708dd)break;else _0x48db94['push'](_0x48db94['shift']());}catch(_0x4a2e30){_0x48db94['push'](_0x48db94['shift']());}}}(a154_0x2f07,0xd73d4));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import a154_0x587f10 from'fs-extra';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';import{isDanglingSymlink,isPathInside,lstatIfPresent,realOrResolved,resolveSymlinkTarget}from'./fs-utils.js';import{readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillCacheRoot,resolveSkillSyncPaths,safePathSegment}from'./paths.js';const {copySync,ensureDirSync,removeSync}=a154_0x587f10,RESERVED_PROJECT_SKILL_CODES=new Set([a154_0xbd8b71(0xca),a154_0xbd8b71(0xdd),a154_0xbd8b71(0xde)]);export function linkEffectiveRuntimeSkills(_0xba4ec4,_0x1fec3f){const _0x183b1e=a154_0xbd8b71,_0xf08ce0=new Map();for(const _0x3d1ddf of _0xba4ec4){const _0x55ec69=_0x3d1ddf[_0x183b1e(0xcb)][_0x183b1e(0xed)];if(!_0x55ec69)continue;const _0x50828f=_0xf08ce0[_0x183b1e(0xfe)](_0x55ec69);(!_0x50828f||_0x3d1ddf['scope']===_0x183b1e(0xe1))&&_0xf08ce0[_0x183b1e(0xe5)](_0x55ec69,_0x3d1ddf);}const _0x37615a=[];for(const _0x2fa396 of _0xf08ce0[_0x183b1e(0xf3)]()){const _0x5aa577=requireSkillCode(_0x2fa396[_0x183b1e(0xcb)]),_0x2db19d=readMetadataIfPresent(_0x2fa396[_0x183b1e(0xf7)]);if(_0x2db19d?.[_0x183b1e(0xee)]!==_0x1fec3f[_0x183b1e(0xee)]||_0x2db19d[_0x183b1e(0xed)]!==_0x5aa577)throw CliErrors['validation'](_0x183b1e(0xe6)+_0x1fec3f['appCode']+':\x20'+_0x2fa396[_0x183b1e(0xf7)]);const _0x58526c=runtimeSkillLinkName(_0x1fec3f,_0x5aa577);for(const _0x3ea85e of _0x1fec3f[_0x183b1e(0xd2)]){_0x37615a['push'](ensureManagedSymlink(resolve(_0x3ea85e,_0x58526c),_0x2fa396[_0x183b1e(0xf8)],_0x1fec3f,_0x5aa577));}}return _0x37615a;}export function pruneStaleRuntimeSkillLinks(_0x2d4d38,_0xcd47b5,_0x5bd5a5){const _0x5b6c41=a154_0xbd8b71,_0x5e37f8=new Set([..._0xcd47b5][_0x5b6c41(0xfd)](_0x1b1d14=>_0x1b1d14[_0x5b6c41(0xec)]())[_0x5b6c41(0x103)](Boolean)),_0x40db25=_0x5bd5a5?new Set([..._0x5bd5a5][_0x5b6c41(0xfd)](_0x5653b9=>_0x5653b9[_0x5b6c41(0xec)]())['filter'](Boolean)):undefined,_0x15305a=[];for(const _0x523ecd of _0x2d4d38[_0x5b6c41(0xd2)]){for(const _0xf14cf6 of managedTargetSkillLinkPaths(_0x523ecd,_0x2d4d38)){const _0x3b9404=runtimeSkillCodeFromLink(_0x2d4d38,_0xf14cf6);if(_0x40db25&&!_0x40db25[_0x5b6c41(0xda)](_0x3b9404))continue;if(_0x5e37f8['has'](_0x3b9404))continue;_0x15305a[_0x5b6c41(0xfc)](removeManagedSkillLink(_0xf14cf6,_0x2d4d38,_0x3b9404));}}return _0x15305a;}export function pruneStaleRuntimeSkillCache(_0x500cbc,_0xf401f1={}){const _0x788768=a154_0xbd8b71,_0x7d44cc=new Set([..._0x500cbc[_0x788768(0xdb)]][_0x788768(0xfd)](_0x17cba8=>_0x17cba8[_0x788768(0xec)]())['filter'](Boolean)),_0x595755=_0x500cbc[_0x788768(0xd8)]?new Set([..._0x500cbc['pruneSkillCodes']][_0x788768(0xfd)](_0x430fc6=>_0x430fc6[_0x788768(0xec)]())['filter'](Boolean)):undefined,_0x571aba=_0x500cbc[_0x788768(0xea)]??['personal',_0x788768(0xe8)],_0x15543f=resolve(getRuntimeSkillCacheRoot(_0x500cbc['env'],_0x500cbc[_0x788768(0xf9)],_0xf401f1),safePathSegment(_0x500cbc[_0x788768(0xee)],'appCode')),_0x181b0a=[];for(const _0x47aac1 of _0x571aba){const _0x5134e7=resolve(_0x15543f,_0x47aac1);if(!existsSync(_0x5134e7))continue;for(const _0x4360f0 of readdirSync(_0x5134e7,{'withFileTypes':!![]})){if(!_0x4360f0[_0x788768(0xfa)]())continue;const _0xc579c3=_0x4360f0['name'];if(_0x595755&&!_0x595755[_0x788768(0xda)](_0xc579c3))continue;if(_0x7d44cc['has'](_0xc579c3))continue;const _0x4ac8a7=resolve(_0x5134e7,_0xc579c3),_0x39e34b=readMetadataIfPresent(resolve(_0x4ac8a7,METADATA_FILE));if(_0x39e34b?.[_0x788768(0xee)]!==_0x500cbc[_0x788768(0xee)]||_0x39e34b[_0x788768(0xd6)]!==_0x47aac1||_0x39e34b[_0x788768(0xed)]!==_0xc579c3){_0x181b0a[_0x788768(0xfc)]({'path':_0x4ac8a7,'action':'skipped','reason':_0x788768(0xd5)});continue;}if(isLinkedFromAnyRoot(_0x4ac8a7,_0x500cbc[_0x788768(0xf6)]??[])){_0x181b0a[_0x788768(0xfc)]({'path':_0x4ac8a7,'action':_0x788768(0xe3),'reason':_0x788768(0xf0)});continue;}removeSync(_0x4ac8a7),_0x181b0a[_0x788768(0xfc)]({'path':_0x4ac8a7,'action':_0x788768(0xf1)});}}return _0x181b0a;}export function linkGlobalRuntimeSkills(_0x4c6e7b,_0x388497={}){const _0x5c584e=a154_0xbd8b71,_0x1c0281=resolveSkillSyncPaths(_0x388497),_0xec35ec=[];for(const _0x214225 of _0x4c6e7b){if(_0x214225[_0x5c584e(0xd6)]!==_0x5c584e(0xfb))throw CliErrors[_0x5c584e(0xd3)](_0x5c584e(0x104)+_0x214225[_0x5c584e(0xd6)]);const _0x1433bd=requireSkillCode(_0x214225[_0x5c584e(0xcb)]),_0x35b80e=copyManagedSkillDirectory(_0x214225[_0x5c584e(0xf8)],resolve(_0x1c0281[_0x5c584e(0xd9)],_0x1433bd));_0xec35ec[_0x5c584e(0xfc)]({..._0x35b80e,'contentHash':_0x214225[_0x5c584e(0xd4)]});}return _0xec35ec;}function ensureManagedSymlink(_0x21807d,_0x43728f,_0xa500ec,_0x4e90eb){const _0x6bd61c=a154_0xbd8b71;mkdirSync(dirname(_0x21807d),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x21807d)||isDanglingSymlink(_0x21807d)){const _0x4026db=lstatSync(_0x21807d);if(!_0x4026db[_0x6bd61c(0xe9)]())throw CliErrors['validation'](_0x6bd61c(0xe7)+_0x21807d);const _0x335d9b=resolveSymlinkTarget(_0x21807d);if(!isPathInside(realOrResolved(_0x335d9b),realOrResolved(_0xa500ec['managedRoot'])))throw CliErrors['validation']('Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20'+_0x21807d);if(realOrResolved(_0x335d9b)===realOrResolved(_0x43728f))return{'path':_0x21807d,'target':_0x43728f,'action':'unchanged'};const _0x478b8c=readMetadataIfPresent(resolve(_0x335d9b,METADATA_FILE));if(_0xa500ec[_0x6bd61c(0xd6)]===_0x6bd61c(0xcc)&&(_0x478b8c?.[_0x6bd61c(0xee)]!==_0xa500ec[_0x6bd61c(0xee)]||_0x478b8c[_0x6bd61c(0xed)]!==_0x4e90eb))throw CliErrors[_0x6bd61c(0xd3)]('Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20'+_0x21807d);return unlinkSync(_0x21807d),symlinkSync(_0x43728f,_0x21807d,_0x6bd61c(0xf8)),{'path':_0x21807d,'target':_0x43728f,'action':_0x6bd61c(0x105)};}return symlinkSync(_0x43728f,_0x21807d,_0x6bd61c(0xf8)),{'path':_0x21807d,'target':_0x43728f,'action':'created'};}function managedTargetSkillLinkPaths(_0x3cf628,_0x480ed3){const _0x27b1e4=a154_0xbd8b71;if(!existsSync(_0x3cf628))return[];const _0x46bc20=_0x480ed3['appCode']+'--';return readdirSync(_0x3cf628,{'withFileTypes':!![]})[_0x27b1e4(0x103)](_0x1eb987=>_0x480ed3[_0x27b1e4(0xd6)]===_0x27b1e4(0xcc)||_0x1eb987[_0x27b1e4(0xff)]['startsWith'](_0x46bc20))[_0x27b1e4(0xfd)](_0x568d92=>resolve(_0x3cf628,_0x568d92[_0x27b1e4(0xff)]));}function removeManagedSkillLink(_0x2bd7c0,_0x119897,_0x489224){const _0x905c8a=a154_0xbd8b71,_0x50a342=lstatIfPresent(_0x2bd7c0);if(!_0x50a342?.[_0x905c8a(0xe9)]())return{'path':_0x2bd7c0,'action':'skipped','reason':_0x905c8a(0xd1)};const _0x41d86c=resolveSymlinkTarget(_0x2bd7c0);if(!isPathInside(realOrResolved(_0x41d86c),realOrResolved(_0x119897[_0x905c8a(0xdf)])))return{'path':_0x2bd7c0,'action':_0x905c8a(0xe3),'reason':_0x905c8a(0xc9)};const _0x54f4a1=readMetadataIfPresent(resolve(_0x41d86c,METADATA_FILE));if(_0x119897[_0x905c8a(0xd6)]===_0x905c8a(0xcc)&&(_0x54f4a1?.['appCode']!==_0x119897[_0x905c8a(0xee)]||_0x54f4a1[_0x905c8a(0xed)]!==_0x489224))return{'path':_0x2bd7c0,'action':_0x905c8a(0xe3),'reason':_0x905c8a(0xd5)};return unlinkSync(_0x2bd7c0),{'path':_0x2bd7c0,'action':_0x905c8a(0xf1)};}function a154_0xcff4(_0x2da048,_0x49e2b4){_0x2da048=_0x2da048-0xc9;const _0x2f0798=a154_0x2f07();let _0xcff445=_0x2f0798[_0x2da048];return _0xcff445;}function isLinkedFromAnyRoot(_0x13295c,_0x82e3cf){const _0x476667=a154_0xbd8b71,_0x1a7883=realOrResolved(_0x13295c);for(const _0x32b9db of _0x82e3cf){if(!existsSync(_0x32b9db))continue;for(const _0x5a6ae8 of readdirSync(_0x32b9db,{'withFileTypes':!![]})){if(!_0x5a6ae8['isSymbolicLink']())continue;const _0x3c56e2=resolve(_0x32b9db,_0x5a6ae8[_0x476667(0xff)]);if(realOrResolved(resolveSymlinkTarget(_0x3c56e2))===_0x1a7883)return!![];}}return![];}function runtimeSkillLinkName(_0x1ab7ce,_0x2599b9){const _0x27df2=a154_0xbd8b71,_0x34fb82=safePathSegment(_0x2599b9,'skillCode');if(_0x1ab7ce[_0x27df2(0xd6)]===_0x27df2(0xcc)&&RESERVED_PROJECT_SKILL_CODES['has'](_0x34fb82))throw CliErrors['validation'](_0x27df2(0x102)+_0x34fb82);return _0x1ab7ce[_0x27df2(0xd6)]===_0x27df2(0xcc)?_0x34fb82:_0x1ab7ce['appCode']+'--'+_0x34fb82;}function runtimeSkillCodeFromLink(_0x1227b5,_0x1581d3){const _0x57f55a=a154_0xbd8b71,_0xdb4693=basename(_0x1581d3);return _0x1227b5[_0x57f55a(0xd6)]==='project'?_0xdb4693:_0xdb4693[_0x57f55a(0xe4)]((_0x1227b5['appCode']+'--')[_0x57f55a(0x100)]);}export function copyManagedSkillDirectory(_0x253a33,_0x5be75b){const _0x21ec44=a154_0xbd8b71,_0x2c09d3=resolve(_0x5be75b,METADATA_FILE),_0x182679=existsSync(_0x5be75b);if(_0x182679){const _0x228fa5=lstatSync(_0x5be75b);if(_0x228fa5[_0x21ec44(0xe9)]())throw CliErrors[_0x21ec44(0xd3)](_0x21ec44(0xf2)+_0x5be75b);if(!_0x228fa5[_0x21ec44(0xfa)]())throw CliErrors[_0x21ec44(0xd3)]('Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20'+_0x5be75b);const _0x4e4dba=readMetadataIfPresent(_0x2c09d3);if(_0x4e4dba?.[_0x21ec44(0xd6)]!=='builtin')throw CliErrors['validation'](_0x21ec44(0xe0)+_0x5be75b);}ensureDirSync(dirname(_0x5be75b));const _0x21cac=_0x182679?readMetadataIfPresent(_0x2c09d3)?.[_0x21ec44(0xd4)]:undefined,_0x4bf3bd=readMetadataIfPresent(resolve(_0x253a33,METADATA_FILE))?.[_0x21ec44(0xd4)];return _0x182679&&removeSync(_0x5be75b),copySkillDirectory(_0x253a33,_0x5be75b),{'path':_0x5be75b,'target':_0x253a33,'action':!_0x182679?'created':_0x21cac===_0x4bf3bd?_0x21ec44(0xd0):_0x21ec44(0x105)};}function copySkillDirectory(_0x2d9fbb,_0x4c8610){copySync(_0x2d9fbb,_0x4c8610,{'dereference':![],'overwrite':!![],'filter'(_0x1492e1){const _0x3e35dd=a154_0xcff4;if(lstatSync(_0x1492e1)[_0x3e35dd(0xe9)]())throw CliErrors[_0x3e35dd(0xd3)](_0x3e35dd(0xf5)+_0x1492e1);return!![];}});}
@@ -1 +1 @@
1
- (function(_0x8f5cce,_0x39fc75){const _0x297e1b=a155_0x546d,_0x11aafe=_0x8f5cce();while(!![]){try{const _0x330618=parseInt(_0x297e1b(0x14e))/0x1+-parseInt(_0x297e1b(0x150))/0x2*(parseInt(_0x297e1b(0x165))/0x3)+-parseInt(_0x297e1b(0x160))/0x4+-parseInt(_0x297e1b(0x157))/0x5*(-parseInt(_0x297e1b(0x146))/0x6)+parseInt(_0x297e1b(0x154))/0x7*(parseInt(_0x297e1b(0x14a))/0x8)+parseInt(_0x297e1b(0x142))/0x9*(-parseInt(_0x297e1b(0x13c))/0xa)+parseInt(_0x297e1b(0x15f))/0xb*(parseInt(_0x297e1b(0x164))/0xc);if(_0x330618===_0x39fc75)break;else _0x11aafe['push'](_0x11aafe['shift']());}catch(_0x4e57a9){_0x11aafe['push'](_0x11aafe['shift']());}}}(a155_0x3921,0x5755b));import{existsSync,readdirSync}from'node:fs';import{resolve}from'node:path';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{readMetadataIfPresent}from'./metadata.js';import{getRuntimeSkillCacheRoot,safePathSegment}from'./paths.js';function a155_0x546d(_0x105289,_0x3a74e2){_0x105289=_0x105289-0x13a;const _0x392188=a155_0x3921();let _0x546dd3=_0x392188[_0x105289];return _0x546dd3;}import{isRuntimeSkillScope,normalizeRuntimeSkillScopes}from'./scopes.js';export function listLocalRuntimeSkills(_0x4f3329,_0x19eba0,_0x25ad8a={}){const _0x50bf2e=a155_0x546d,_0x432e1a=safePathSegment(_0x4f3329['appCode'],_0x50bf2e(0x153));if(_0x19eba0[_0x50bf2e(0x153)]!==_0x432e1a)throw CliErrors[_0x50bf2e(0x14c)](_0x50bf2e(0x15d)+_0x19eba0[_0x50bf2e(0x153)]+'\x20!=\x20'+_0x432e1a);const _0x1cafc3=normalizeRuntimeSkillScopes(_0x4f3329[_0x50bf2e(0x152)]),_0x34cc68=new Set(_0x1cafc3),_0xe650f9=_0x4f3329[_0x50bf2e(0x156)]?.['trim'](),_0x184787=new Map(),_0x5b83be=resolve(getRuntimeSkillCacheRoot(_0x4f3329[_0x50bf2e(0x162)],_0x4f3329[_0x50bf2e(0x13a)],_0x25ad8a),_0x432e1a);for(const _0x1dbec3 of _0x1cafc3){for(const _0x1cdbd3 of localSkillEntryDirs(resolve(_0x5b83be,_0x1dbec3))){collectLocalRuntimeSkill(_0x184787,_0x1cdbd3,{'appCode':_0x432e1a,'scopes':_0x34cc68,'code':_0xe650f9,'source':'cache'});}}for(const _0x429bfd of _0x19eba0['skillRoots']){for(const _0x4fe50c of localSkillLinkCandidates(_0x429bfd,_0x19eba0,_0x34cc68)){collectLocalRuntimeSkill(_0x184787,_0x4fe50c,{'appCode':_0x432e1a,'scopes':_0x34cc68,'code':_0xe650f9,'source':'link','linkedPath':_0x4fe50c});}}return Array[_0x50bf2e(0x148)](_0x184787['values']())[_0x50bf2e(0x15b)](compareLocalRuntimeSkills);}function localSkillEntryDirs(_0x247b24){const _0x650f30=a155_0x546d;if(!existsSync(_0x247b24))return[];return readdirSync(_0x247b24,{'withFileTypes':!![]})[_0x650f30(0x13d)](_0x439c66=>_0x439c66[_0x650f30(0x13f)]()||_0x439c66[_0x650f30(0x159)]())[_0x650f30(0x15e)](_0x54f19a=>resolve(_0x247b24,_0x54f19a[_0x650f30(0x151)]));}function localSkillLinkCandidates(_0x394913,_0x557b2b,_0x1f0c6f){const _0x3ff691=a155_0x546d;if(!existsSync(_0x394913))return[];const _0x5f1bf9=_0x557b2b[_0x3ff691(0x153)]+'--';return readdirSync(_0x394913,{'withFileTypes':!![]})['filter'](_0x258a8f=>_0x258a8f[_0x3ff691(0x13f)]()||_0x258a8f[_0x3ff691(0x159)]())[_0x3ff691(0x13d)](_0x164725=>_0x557b2b[_0x3ff691(0x149)]===_0x3ff691(0x140)||_0x164725[_0x3ff691(0x151)]['startsWith'](_0x5f1bf9)||_0x1f0c6f['has'](_0x3ff691(0x141)))[_0x3ff691(0x15e)](_0x513d7d=>resolve(_0x394913,_0x513d7d[_0x3ff691(0x151)]));}function a155_0x3921(){const _0xdb4777=['trim','2938HAihbp','name','scopes','appCode','913157xOuyBR','has','code','605gKdLgz','cache','isSymbolicLink','tags','sort','metadataPath','Runtime\x20Skill\x20install\x20target\x20app\x20mismatch:\x20','map','11SDtcMI','1556668nArLwd','skillCode','env','get','6594096EMuTUp','201DGlRxp','source','accessKey','localeCompare','60UDtMdj','filter','linkedPaths','isDirectory','project','builtin','507933HCqxYt','linkedPath','set','skillMdPath','2478CQkmEV','isArray','from','scope','8duZSnC','dir','validation','push','454003qssKMz'];a155_0x3921=function(){return _0xdb4777;};return a155_0x3921();}function collectLocalRuntimeSkill(_0x47827a,_0x10c619,_0x481075){const _0x262a6d=a155_0x546d,_0x5246b6=resolve(_0x10c619,METADATA_FILE),_0x318909=readMetadataIfPresent(_0x5246b6);if(!_0x318909)return;if(_0x318909['appCode']!==_0x481075[_0x262a6d(0x153)])return;if(!isRuntimeSkillScope(_0x318909[_0x262a6d(0x149)])||!_0x481075[_0x262a6d(0x152)][_0x262a6d(0x155)](_0x318909[_0x262a6d(0x149)]))return;const _0x1823f3=_0x318909[_0x262a6d(0x161)]?.[_0x262a6d(0x14f)]();if(!_0x1823f3)return;if(_0x481075[_0x262a6d(0x156)]&&_0x1823f3!==_0x481075[_0x262a6d(0x156)])return;const _0x200367=_0x318909[_0x262a6d(0x149)]+':'+_0x1823f3,_0xb30287=_0x481075[_0x262a6d(0x143)]?[_0x481075[_0x262a6d(0x143)]]:[],_0x1509c4=_0x47827a[_0x262a6d(0x163)](_0x200367);if(_0x1509c4){_0x481075[_0x262a6d(0x166)]===_0x262a6d(0x158)&&(_0x1509c4[_0x262a6d(0x14b)]=_0x10c619,_0x1509c4['cacheDir']=_0x10c619,_0x1509c4[_0x262a6d(0x145)]=resolve(_0x10c619,SKILL_FILE),_0x1509c4[_0x262a6d(0x15c)]=_0x5246b6);for(const _0x389481 of _0xb30287){!_0x1509c4['linkedPaths']['includes'](_0x389481)&&_0x1509c4[_0x262a6d(0x13e)][_0x262a6d(0x14d)](_0x389481);}_0x1509c4[_0x262a6d(0x13e)][_0x262a6d(0x15b)]();return;}_0x47827a[_0x262a6d(0x144)](_0x200367,{..._0x318909,'tags':Array[_0x262a6d(0x147)](_0x318909[_0x262a6d(0x15a)])?_0x318909[_0x262a6d(0x15a)]:[],'scope':_0x318909[_0x262a6d(0x149)],'source':'local','dir':_0x10c619,'cacheDir':_0x481075[_0x262a6d(0x166)]===_0x262a6d(0x158)?_0x10c619:undefined,'skillMdPath':resolve(_0x10c619,SKILL_FILE),'metadataPath':_0x5246b6,'linkedPaths':_0xb30287});}function compareLocalRuntimeSkills(_0x1ca03f,_0x3e5bcd){const _0x1a0d1b=a155_0x546d,_0x102afa={'personal':0x0,'company':0x1,'builtin':0x2};return _0x102afa[_0x1ca03f[_0x1a0d1b(0x149)]]-_0x102afa[_0x3e5bcd[_0x1a0d1b(0x149)]]||_0x1ca03f[_0x1a0d1b(0x161)][_0x1a0d1b(0x13b)](_0x3e5bcd['skillCode'])||_0x1ca03f[_0x1a0d1b(0x14b)][_0x1a0d1b(0x13b)](_0x3e5bcd['dir']);}
1
+ (function(_0x51aba1,_0x1bbe28){const _0x1b0e72=a155_0x11f1,_0x19c4c5=_0x51aba1();while(!![]){try{const _0xa4bdb2=-parseInt(_0x1b0e72(0x75))/0x1+-parseInt(_0x1b0e72(0x77))/0x2+parseInt(_0x1b0e72(0x85))/0x3*(-parseInt(_0x1b0e72(0x91))/0x4)+parseInt(_0x1b0e72(0x8f))/0x5*(parseInt(_0x1b0e72(0x8e))/0x6)+-parseInt(_0x1b0e72(0x97))/0x7+-parseInt(_0x1b0e72(0x92))/0x8*(parseInt(_0x1b0e72(0x84))/0x9)+parseInt(_0x1b0e72(0x74))/0xa;if(_0xa4bdb2===_0x1bbe28)break;else _0x19c4c5['push'](_0x19c4c5['shift']());}catch(_0x4a4a4e){_0x19c4c5['push'](_0x19c4c5['shift']());}}}(a155_0x4631,0x6d3b8));import{existsSync,readdirSync}from'node:fs';import{resolve}from'node:path';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{readMetadataIfPresent}from'./metadata.js';import{getRuntimeSkillCacheRoot,safePathSegment}from'./paths.js';import{isRuntimeSkillScope,normalizeRuntimeSkillScopes}from'./scopes.js';function a155_0x11f1(_0x569cb5,_0xf5b85d){_0x569cb5=_0x569cb5-0x6b;const _0x463128=a155_0x4631();let _0x11f199=_0x463128[_0x569cb5];return _0x11f199;}export function listLocalRuntimeSkills(_0x3bac15,_0xa325ff,_0x28cf6e={}){const _0x387e04=a155_0x11f1,_0x35c1c9=safePathSegment(_0x3bac15[_0x387e04(0x6b)],_0x387e04(0x6b));if(_0xa325ff[_0x387e04(0x6b)]!==_0x35c1c9)throw CliErrors[_0x387e04(0x86)](_0x387e04(0x6d)+_0xa325ff[_0x387e04(0x6b)]+_0x387e04(0x83)+_0x35c1c9);const _0x9b11d3=normalizeRuntimeSkillScopes(_0x3bac15[_0x387e04(0x7c)]),_0x38cf8e=new Set(_0x9b11d3),_0x109502=_0x3bac15[_0x387e04(0x9a)]?.[_0x387e04(0x8d)](),_0x207d91=new Map(),_0x1189b0=resolve(getRuntimeSkillCacheRoot(_0x3bac15[_0x387e04(0x7f)],_0x3bac15[_0x387e04(0x6f)],_0x28cf6e),_0x35c1c9);for(const _0x157189 of _0x9b11d3){for(const _0x72059d of localSkillEntryDirs(resolve(_0x1189b0,_0x157189))){collectLocalRuntimeSkill(_0x207d91,_0x72059d,{'appCode':_0x35c1c9,'scopes':_0x38cf8e,'code':_0x109502,'source':_0x387e04(0x87)});}}for(const _0x3969a6 of _0xa325ff['skillRoots']){for(const _0x1797ee of localSkillLinkCandidates(_0x3969a6,_0xa325ff,_0x38cf8e)){collectLocalRuntimeSkill(_0x207d91,_0x1797ee,{'appCode':_0x35c1c9,'scopes':_0x38cf8e,'code':_0x109502,'source':_0x387e04(0x73),'linkedPath':_0x1797ee});}}return Array[_0x387e04(0x89)](_0x207d91[_0x387e04(0x79)]())[_0x387e04(0x93)](compareLocalRuntimeSkills);}function a155_0x4631(){const _0x9da080=['52236fnkMSC','6jdOqMA','validation','cache','linkedPath','from','get','linkedPaths','tags','trim','985416kJjuqp','5kXwrxn','isSymbolicLink','141716YzFQAh','376ZnYBNU','sort','skillMdPath','localeCompare','project','2603062tdWfnB','metadataPath','map','code','appCode','cacheDir','Runtime\x20Skill\x20install\x20target\x20app\x20mismatch:\x20','isArray','accessKey','isDirectory','includes','builtin','link','15533900tyxNkF','259287PlAWgC','push','590822tPOGQy','filter','values','startsWith','set','scopes','scope','dir','env','skillCode','name','source','\x20!=\x20'];a155_0x4631=function(){return _0x9da080;};return a155_0x4631();}function localSkillEntryDirs(_0x160842){const _0x56adfa=a155_0x11f1;if(!existsSync(_0x160842))return[];return readdirSync(_0x160842,{'withFileTypes':!![]})[_0x56adfa(0x78)](_0x5791d3=>_0x5791d3[_0x56adfa(0x70)]()||_0x5791d3['isSymbolicLink']())[_0x56adfa(0x99)](_0x5e4f2c=>resolve(_0x160842,_0x5e4f2c['name']));}function localSkillLinkCandidates(_0xd005bf,_0x2276f0,_0x3e816d){const _0x21972c=a155_0x11f1;if(!existsSync(_0xd005bf))return[];const _0x745af=_0x2276f0['appCode']+'--';return readdirSync(_0xd005bf,{'withFileTypes':!![]})[_0x21972c(0x78)](_0x3331f9=>_0x3331f9['isDirectory']()||_0x3331f9[_0x21972c(0x90)]())[_0x21972c(0x78)](_0x33a02b=>_0x2276f0[_0x21972c(0x7d)]===_0x21972c(0x96)||_0x33a02b['name'][_0x21972c(0x7a)](_0x745af)||_0x3e816d['has'](_0x21972c(0x72)))[_0x21972c(0x99)](_0x572b41=>resolve(_0xd005bf,_0x572b41[_0x21972c(0x81)]));}function collectLocalRuntimeSkill(_0x1bb151,_0x5bf195,_0x548e07){const _0x465a1b=a155_0x11f1,_0x10baba=resolve(_0x5bf195,METADATA_FILE),_0x2ee410=readMetadataIfPresent(_0x10baba);if(!_0x2ee410)return;if(_0x2ee410['appCode']!==_0x548e07[_0x465a1b(0x6b)])return;if(!isRuntimeSkillScope(_0x2ee410[_0x465a1b(0x7d)])||!_0x548e07[_0x465a1b(0x7c)]['has'](_0x2ee410[_0x465a1b(0x7d)]))return;const _0x3e6744=_0x2ee410['skillCode']?.[_0x465a1b(0x8d)]();if(!_0x3e6744)return;if(_0x548e07[_0x465a1b(0x9a)]&&_0x3e6744!==_0x548e07[_0x465a1b(0x9a)])return;const _0x20c91d=_0x2ee410[_0x465a1b(0x7d)]+':'+_0x3e6744,_0x16d621=_0x548e07['linkedPath']?[_0x548e07[_0x465a1b(0x88)]]:[],_0x169621=_0x1bb151[_0x465a1b(0x8a)](_0x20c91d);if(_0x169621){_0x548e07['source']===_0x465a1b(0x87)&&(_0x169621[_0x465a1b(0x7e)]=_0x5bf195,_0x169621[_0x465a1b(0x6c)]=_0x5bf195,_0x169621[_0x465a1b(0x94)]=resolve(_0x5bf195,SKILL_FILE),_0x169621[_0x465a1b(0x98)]=_0x10baba);for(const _0x27cf6b of _0x16d621){!_0x169621['linkedPaths'][_0x465a1b(0x71)](_0x27cf6b)&&_0x169621[_0x465a1b(0x8b)][_0x465a1b(0x76)](_0x27cf6b);}_0x169621['linkedPaths'][_0x465a1b(0x93)]();return;}_0x1bb151[_0x465a1b(0x7b)](_0x20c91d,{..._0x2ee410,'tags':Array[_0x465a1b(0x6e)](_0x2ee410[_0x465a1b(0x8c)])?_0x2ee410[_0x465a1b(0x8c)]:[],'scope':_0x2ee410['scope'],'source':'local','dir':_0x5bf195,'cacheDir':_0x548e07[_0x465a1b(0x82)]===_0x465a1b(0x87)?_0x5bf195:undefined,'skillMdPath':resolve(_0x5bf195,SKILL_FILE),'metadataPath':_0x10baba,'linkedPaths':_0x16d621});}function compareLocalRuntimeSkills(_0x1aba8f,_0x4e55a9){const _0x80a4fc=a155_0x11f1,_0x5cc9ef={'personal':0x0,'company':0x1,'builtin':0x2};return _0x5cc9ef[_0x1aba8f[_0x80a4fc(0x7d)]]-_0x5cc9ef[_0x4e55a9[_0x80a4fc(0x7d)]]||_0x1aba8f['skillCode'][_0x80a4fc(0x95)](_0x4e55a9[_0x80a4fc(0x80)])||_0x1aba8f[_0x80a4fc(0x7e)][_0x80a4fc(0x95)](_0x4e55a9[_0x80a4fc(0x7e)]);}
@@ -1 +1 @@
1
- function a156_0x5b04(){const _0x3881e1=['add','92thOjOe','Duplicate\x20Skill\x20file\x20path:\x20','44355yEEKta','values','has','Skill\x20file\x20path\x20must\x20be\x20text.','Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20','path','Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20','utf8','Skill\x20file\x20size\x20is\x20invalid:\x20','91666IvInxT','string','21790PREVUB','validation','startsWith','isDirectory','isFile','test','Unsafe\x20Skill\x20file\x20path:\x20','split','content','size','toLowerCase','22QCHNJv','4525002bxwQEW','trim','bytes','6602776vrurZe','localeCompare','4107510RhArCP','compare','isSafeInteger','replace','push','set','Skill\x20file\x20sha256\x20is\x20invalid:\x20','isSymbolicLink','sha256','length','12JMwRxG','20284kdsdaI','isArray','from','2156315klerAM','object','sort','name'];a156_0x5b04=function(){return _0x3881e1;};return a156_0x5b04();}(function(_0x15208c,_0xacaef){const _0x3b1bc6=a156_0x2e26,_0x3a84e0=_0x15208c();while(!![]){try{const _0x22ca14=parseInt(_0x3b1bc6(0x1b9))/0x1*(-parseInt(_0x3b1bc6(0x1ac))/0x2)+-parseInt(_0x3b1bc6(0x1d4))/0x3*(-parseInt(_0x3b1bc6(0x1d2))/0x4)+-parseInt(_0x3b1bc6(0x1bf))/0x5+parseInt(_0x3b1bc6(0x1c9))/0x6*(-parseInt(_0x3b1bc6(0x1cd))/0x7)+-parseInt(_0x3b1bc6(0x1bd))/0x8+-parseInt(_0x3b1bc6(0x1ba))/0x9+-parseInt(_0x3b1bc6(0x1ae))/0xa*(-parseInt(_0x3b1bc6(0x1ca))/0xb);if(_0x22ca14===_0xacaef)break;else _0x3a84e0['push'](_0x3a84e0['shift']());}catch(_0x500e3c){_0x3a84e0['push'](_0x3a84e0['shift']());}}}(a156_0x5b04,0x8e998));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(_0x23b4d6){const _0x42de7a=a156_0x2e26;return _0x23b4d6[_0x42de7a(0x1bc)]??Buffer[_0x42de7a(0x1cc)](_0x23b4d6[_0x42de7a(0x1b6)]??'',_0x42de7a(0x1aa));}export function fileText(_0x2d9561){const _0x421549=a156_0x2e26;return fileContent(_0x2d9561)['toString'](_0x421549(0x1aa));}export function normalizeLocalFiles(_0x3f0903){const _0x465f01=a156_0x2e26;if(!Array[_0x465f01(0x1cb)](_0x3f0903)||_0x3f0903['length']===0x0)return[];const _0x5c566c=new Map();for(const _0x3072b7 of _0x3f0903){if(!_0x3072b7||typeof _0x3072b7!==_0x465f01(0x1ce)||typeof _0x3072b7[_0x465f01(0x1a8)]!==_0x465f01(0x1ad))throw CliErrors['validation']('Skill\x20file\x20path\x20must\x20be\x20text.');const _0x3600ab=normalizeSkillRelativePath(_0x3072b7[_0x465f01(0x1a8)]);if(_0x5c566c[_0x465f01(0x1a5)](_0x3600ab))throw CliErrors['validation'](_0x465f01(0x1d3)+_0x3600ab);if(_0x3072b7[_0x465f01(0x1bc)]!==undefined&&!Buffer['isBuffer'](_0x3072b7[_0x465f01(0x1bc)]))throw CliErrors[_0x465f01(0x1af)]('Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20'+_0x3600ab);if(_0x3072b7[_0x465f01(0x1bc)]===undefined&&typeof _0x3072b7[_0x465f01(0x1b6)]!==_0x465f01(0x1ad))throw CliErrors['validation'](_0x465f01(0x1a9)+_0x3600ab);const _0x31d17a=fileContent(_0x3072b7);_0x5c566c[_0x465f01(0x1c4)](_0x3600ab,{'path':_0x3600ab,'bytes':_0x31d17a});}return Array[_0x465f01(0x1cc)](_0x5c566c[_0x465f01(0x1d5)]())[_0x465f01(0x1cf)](compareSkillFiles);}export function normalizeManifestFiles(_0x11d0fa){const _0x1d4c97=a156_0x2e26;if(!Array[_0x1d4c97(0x1cb)](_0x11d0fa)||_0x11d0fa[_0x1d4c97(0x1c8)]===0x0)return[];const _0x392c13=new Map();for(const _0xec5c89 of _0x11d0fa){if(!_0xec5c89||typeof _0xec5c89!==_0x1d4c97(0x1ce)||typeof _0xec5c89['path']!==_0x1d4c97(0x1ad))throw CliErrors['validation'](_0x1d4c97(0x1a6));const _0x11eba1=normalizeSkillRelativePath(_0xec5c89[_0x1d4c97(0x1a8)]);if(_0x392c13[_0x1d4c97(0x1a5)](_0x11eba1))throw CliErrors['validation'](_0x1d4c97(0x1d3)+_0x11eba1);if(!isSha256Hex(_0xec5c89[_0x1d4c97(0x1c7)]))throw CliErrors[_0x1d4c97(0x1af)](_0x1d4c97(0x1c5)+_0x11eba1);if(!Number[_0x1d4c97(0x1c1)](_0xec5c89[_0x1d4c97(0x1b7)])||_0xec5c89[_0x1d4c97(0x1b7)]<0x0)throw CliErrors['validation'](_0x1d4c97(0x1ab)+_0x11eba1);_0x392c13[_0x1d4c97(0x1c4)](_0x11eba1,{'path':_0x11eba1,'sha256':_0xec5c89['sha256'][_0x1d4c97(0x1b8)](),'size':_0xec5c89[_0x1d4c97(0x1b7)]});}return Array[_0x1d4c97(0x1cc)](_0x392c13[_0x1d4c97(0x1d5)]())[_0x1d4c97(0x1cf)](compareSkillFiles);}export function scanSkillDirectory(_0x166bd2,_0x1b0a8b={}){const _0x5c9a09=realpathSync(_0x166bd2),_0x24ce19=canonicalExcludedFilePaths(_0x1b0a8b['excludedFilePaths']),_0x3903ca=[];function _0x47e955(_0x194967){const _0x1376e8=a156_0x2e26,_0x3bce59=readdirSync(_0x194967,{'withFileTypes':!![]})[_0x1376e8(0x1cf)]((_0x56eec6,_0x51b64b)=>_0x56eec6[_0x1376e8(0x1d0)][_0x1376e8(0x1be)](_0x51b64b[_0x1376e8(0x1d0)]));for(const _0x958a96 of _0x3bce59){if(_0x958a96[_0x1376e8(0x1b1)]()&&IGNORED_DIR_NAMES[_0x1376e8(0x1a5)](_0x958a96[_0x1376e8(0x1d0)]))continue;if(IGNORED_FILE_NAMES['has'](_0x958a96[_0x1376e8(0x1d0)]))continue;const _0x5ea343=resolve(_0x194967,_0x958a96[_0x1376e8(0x1d0)]);if(isExcludedFilePath(_0x5ea343,_0x24ce19))continue;if(_0x958a96[_0x1376e8(0x1c6)]())throw CliErrors[_0x1376e8(0x1af)](_0x1376e8(0x1a7)+_0x5ea343);const _0x562d27=toPosixPath(relative(_0x5c9a09,_0x5ea343));if(_0x958a96[_0x1376e8(0x1b1)]()){_0x47e955(_0x5ea343);continue;}if(!_0x958a96[_0x1376e8(0x1b2)]())continue;validateSkillRelativePath(_0x562d27);const _0xa4b735=readFileSync(_0x5ea343);_0x3903ca[_0x1376e8(0x1c3)]({'path':_0x562d27,'bytes':_0xa4b735});}}return _0x47e955(_0x5c9a09),normalizeLocalFiles(_0x3903ca);}function canonicalExcludedFilePaths(_0x9f7057){const _0x52b9d4=a156_0x2e26,_0x4820f5=new Set();for(const _0x4fae0c of _0x9f7057??[]){const _0x5e934b=resolve(_0x4fae0c);_0x4820f5[_0x52b9d4(0x1d1)](_0x5e934b);try{_0x4820f5['add'](realpathSync(_0x5e934b));}catch{}}return _0x4820f5;}function isExcludedFilePath(_0x187417,_0x1aedf5){const _0x567122=a156_0x2e26;if(_0x1aedf5[_0x567122(0x1a5)](_0x187417))return!![];if(_0x1aedf5[_0x567122(0x1b7)]===0x0)return![];try{return _0x1aedf5[_0x567122(0x1a5)](realpathSync(_0x187417));}catch{return![];}}function a156_0x2e26(_0x5e495d,_0x2cd941){_0x5e495d=_0x5e495d-0x1a5;const _0x5b041f=a156_0x5b04();let _0x2e2683=_0x5b041f[_0x5e495d];return _0x2e2683;}export function compareSkillFiles(_0x3eda97,_0x3d5008){const _0x48f2be=a156_0x2e26;if(_0x3eda97[_0x48f2be(0x1a8)]===SKILL_FILE)return _0x3d5008['path']===SKILL_FILE?0x0:-0x1;if(_0x3d5008[_0x48f2be(0x1a8)]===SKILL_FILE)return 0x1;return Buffer[_0x48f2be(0x1c0)](Buffer['from'](_0x3eda97[_0x48f2be(0x1a8)],_0x48f2be(0x1aa)),Buffer[_0x48f2be(0x1cc)](_0x3d5008['path'],'utf8'));}export function normalizeSkillRelativePath(_0x11af39){const _0xbd7ee4=a156_0x2e26,_0x42054b=toPosixPath(_0x11af39[_0xbd7ee4(0x1bb)]());return validateSkillRelativePath(_0x42054b),_0x42054b;}export function validateSkillRelativePath(_0x2de128){const _0x1577cc=a156_0x2e26;if(!_0x2de128||_0x2de128[_0x1577cc(0x1b0)]('/')||_0x2de128['includes']('//'))throw CliErrors[_0x1577cc(0x1af)](_0x1577cc(0x1b4)+_0x2de128);for(const _0x57edb0 of _0x2de128[_0x1577cc(0x1b5)]('/')){if(!_0x57edb0||_0x57edb0==='.'||_0x57edb0==='..')throw CliErrors['validation'](_0x1577cc(0x1b4)+_0x2de128);}}export function toPosixPath(_0x2e7966){const _0x1e55d1=a156_0x2e26;return _0x2e7966[_0x1e55d1(0x1c2)](/\\/g,'/');}export function isSha256Hex(_0x731ff3){const _0x1a9ce3=a156_0x2e26;return typeof _0x731ff3===_0x1a9ce3(0x1ad)&&/^[a-fA-F0-9]{64}$/[_0x1a9ce3(0x1b3)](_0x731ff3);}
1
+ (function(_0x43c6f1,_0x2abdd7){const _0xab2275=a156_0x1851,_0x37e92b=_0x43c6f1();while(!![]){try{const _0x5973fc=-parseInt(_0xab2275(0x168))/0x1*(parseInt(_0xab2275(0x173))/0x2)+-parseInt(_0xab2275(0x163))/0x3*(-parseInt(_0xab2275(0x15d))/0x4)+-parseInt(_0xab2275(0x171))/0x5*(-parseInt(_0xab2275(0x188))/0x6)+parseInt(_0xab2275(0x185))/0x7*(-parseInt(_0xab2275(0x15e))/0x8)+parseInt(_0xab2275(0x15c))/0x9+parseInt(_0xab2275(0x16c))/0xa*(-parseInt(_0xab2275(0x167))/0xb)+parseInt(_0xab2275(0x169))/0xc;if(_0x5973fc===_0x2abdd7)break;else _0x37e92b['push'](_0x37e92b['shift']());}catch(_0x4e5e69){_0x37e92b['push'](_0x37e92b['shift']());}}}(a156_0x1894,0xb3b21));import{readFileSync,readdirSync,realpathSync}from'node:fs';function a156_0x1894(){const _0x5e7754=['isFile','255122GTUhfI','validation','values','1242GHelxD','trim','name','toLowerCase','6973155uYkDTU','4972AVVlxt','24bcKbjm','isBuffer','path','startsWith','isDirectory','840MutEwx','includes','Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20','sort','449537sHOvAR','247MQNejK','3878148SxFmmO','has','isArray','170dRfdQH','sha256','push','content','add','28005XUojpS','from','8626gKuwvr','set','bytes','length','Skill\x20file\x20size\x20is\x20invalid:\x20','utf8','test','object','split','Duplicate\x20Skill\x20file\x20path:\x20','toString','size','string','localeCompare','Unsafe\x20Skill\x20file\x20path:\x20','Skill\x20file\x20path\x20must\x20be\x20text.','isSymbolicLink'];a156_0x1894=function(){return _0x5e7754;};return a156_0x1894();}import{relative,resolve}from'node:path';import{CliErrors}from'../../errors.js';import{IGNORED_DIR_NAMES,IGNORED_FILE_NAMES,SKILL_FILE}from'./constants.js';function a156_0x1851(_0x1f5e44,_0x1fe8f2){_0x1f5e44=_0x1f5e44-0x15b;const _0x1894b9=a156_0x1894();let _0x1851bf=_0x1894b9[_0x1f5e44];return _0x1851bf;}export function fileContent(_0x590dfa){const _0x1f1555=a156_0x1851;return _0x590dfa['bytes']??Buffer[_0x1f1555(0x172)](_0x590dfa[_0x1f1555(0x16f)]??'',_0x1f1555(0x178));}export function fileText(_0x55a2e3){const _0x444b43=a156_0x1851;return fileContent(_0x55a2e3)[_0x444b43(0x17d)](_0x444b43(0x178));}export function normalizeLocalFiles(_0x3eecfb){const _0x1d16a0=a156_0x1851;if(!Array[_0x1d16a0(0x16b)](_0x3eecfb)||_0x3eecfb[_0x1d16a0(0x176)]===0x0)return[];const _0x3d681f=new Map();for(const _0x439008 of _0x3eecfb){if(!_0x439008||typeof _0x439008!==_0x1d16a0(0x17a)||typeof _0x439008[_0x1d16a0(0x160)]!==_0x1d16a0(0x17f))throw CliErrors[_0x1d16a0(0x186)](_0x1d16a0(0x182));const _0x2d4943=normalizeSkillRelativePath(_0x439008[_0x1d16a0(0x160)]);if(_0x3d681f[_0x1d16a0(0x16a)](_0x2d4943))throw CliErrors[_0x1d16a0(0x186)](_0x1d16a0(0x17c)+_0x2d4943);if(_0x439008[_0x1d16a0(0x175)]!==undefined&&!Buffer[_0x1d16a0(0x15f)](_0x439008[_0x1d16a0(0x175)]))throw CliErrors[_0x1d16a0(0x186)]('Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20'+_0x2d4943);if(_0x439008[_0x1d16a0(0x175)]===undefined&&typeof _0x439008[_0x1d16a0(0x16f)]!==_0x1d16a0(0x17f))throw CliErrors[_0x1d16a0(0x186)](_0x1d16a0(0x165)+_0x2d4943);const _0x301a39=fileContent(_0x439008);_0x3d681f[_0x1d16a0(0x174)](_0x2d4943,{'path':_0x2d4943,'bytes':_0x301a39});}return Array[_0x1d16a0(0x172)](_0x3d681f[_0x1d16a0(0x187)]())['sort'](compareSkillFiles);}export function normalizeManifestFiles(_0x4c1375){const _0x508795=a156_0x1851;if(!Array[_0x508795(0x16b)](_0x4c1375)||_0x4c1375[_0x508795(0x176)]===0x0)return[];const _0x1f3454=new Map();for(const _0x2a5910 of _0x4c1375){if(!_0x2a5910||typeof _0x2a5910!==_0x508795(0x17a)||typeof _0x2a5910[_0x508795(0x160)]!==_0x508795(0x17f))throw CliErrors[_0x508795(0x186)](_0x508795(0x182));const _0x4ec4fe=normalizeSkillRelativePath(_0x2a5910['path']);if(_0x1f3454[_0x508795(0x16a)](_0x4ec4fe))throw CliErrors[_0x508795(0x186)]('Duplicate\x20Skill\x20file\x20path:\x20'+_0x4ec4fe);if(!isSha256Hex(_0x2a5910[_0x508795(0x16d)]))throw CliErrors[_0x508795(0x186)]('Skill\x20file\x20sha256\x20is\x20invalid:\x20'+_0x4ec4fe);if(!Number['isSafeInteger'](_0x2a5910['size'])||_0x2a5910[_0x508795(0x17e)]<0x0)throw CliErrors[_0x508795(0x186)](_0x508795(0x177)+_0x4ec4fe);_0x1f3454['set'](_0x4ec4fe,{'path':_0x4ec4fe,'sha256':_0x2a5910[_0x508795(0x16d)][_0x508795(0x15b)](),'size':_0x2a5910[_0x508795(0x17e)]});}return Array[_0x508795(0x172)](_0x1f3454['values']())[_0x508795(0x166)](compareSkillFiles);}export function scanSkillDirectory(_0x4bdf8e,_0x4f68ec={}){const _0x4c8e15=realpathSync(_0x4bdf8e),_0x562a59=canonicalExcludedFilePaths(_0x4f68ec['excludedFilePaths']),_0x3bf2bb=[];function _0x55dd3c(_0x2f7f71){const _0x252420=a156_0x1851,_0x41fa6c=readdirSync(_0x2f7f71,{'withFileTypes':!![]})[_0x252420(0x166)]((_0x1d39c0,_0x1b42ac)=>_0x1d39c0[_0x252420(0x18a)][_0x252420(0x180)](_0x1b42ac['name']));for(const _0x451802 of _0x41fa6c){if(_0x451802['isDirectory']()&&IGNORED_DIR_NAMES[_0x252420(0x16a)](_0x451802[_0x252420(0x18a)]))continue;if(IGNORED_FILE_NAMES['has'](_0x451802[_0x252420(0x18a)]))continue;const _0x52feb3=resolve(_0x2f7f71,_0x451802[_0x252420(0x18a)]);if(isExcludedFilePath(_0x52feb3,_0x562a59))continue;if(_0x451802[_0x252420(0x183)]())throw CliErrors['validation']('Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20'+_0x52feb3);const _0x372d7e=toPosixPath(relative(_0x4c8e15,_0x52feb3));if(_0x451802[_0x252420(0x162)]()){_0x55dd3c(_0x52feb3);continue;}if(!_0x451802[_0x252420(0x184)]())continue;validateSkillRelativePath(_0x372d7e);const _0x51711b=readFileSync(_0x52feb3);_0x3bf2bb[_0x252420(0x16e)]({'path':_0x372d7e,'bytes':_0x51711b});}}return _0x55dd3c(_0x4c8e15),normalizeLocalFiles(_0x3bf2bb);}function canonicalExcludedFilePaths(_0x461e15){const _0x58418f=a156_0x1851,_0xca1e9d=new Set();for(const _0x2a8175 of _0x461e15??[]){const _0x1244ca=resolve(_0x2a8175);_0xca1e9d['add'](_0x1244ca);try{_0xca1e9d[_0x58418f(0x170)](realpathSync(_0x1244ca));}catch{}}return _0xca1e9d;}function isExcludedFilePath(_0x5f0b5c,_0x147bbe){const _0x21d608=a156_0x1851;if(_0x147bbe[_0x21d608(0x16a)](_0x5f0b5c))return!![];if(_0x147bbe[_0x21d608(0x17e)]===0x0)return![];try{return _0x147bbe['has'](realpathSync(_0x5f0b5c));}catch{return![];}}export function compareSkillFiles(_0x5b217b,_0x1386ce){const _0x3704c2=a156_0x1851;if(_0x5b217b['path']===SKILL_FILE)return _0x1386ce['path']===SKILL_FILE?0x0:-0x1;if(_0x1386ce[_0x3704c2(0x160)]===SKILL_FILE)return 0x1;return Buffer['compare'](Buffer['from'](_0x5b217b[_0x3704c2(0x160)],_0x3704c2(0x178)),Buffer['from'](_0x1386ce['path'],'utf8'));}export function normalizeSkillRelativePath(_0x5b5110){const _0x3d5ea6=a156_0x1851,_0x5f0302=toPosixPath(_0x5b5110[_0x3d5ea6(0x189)]());return validateSkillRelativePath(_0x5f0302),_0x5f0302;}export function validateSkillRelativePath(_0x57da9e){const _0x2ce156=a156_0x1851;if(!_0x57da9e||_0x57da9e[_0x2ce156(0x161)]('/')||_0x57da9e[_0x2ce156(0x164)]('//'))throw CliErrors[_0x2ce156(0x186)](_0x2ce156(0x181)+_0x57da9e);for(const _0x2c64f8 of _0x57da9e[_0x2ce156(0x17b)]('/')){if(!_0x2c64f8||_0x2c64f8==='.'||_0x2c64f8==='..')throw CliErrors[_0x2ce156(0x186)]('Unsafe\x20Skill\x20file\x20path:\x20'+_0x57da9e);}}export function toPosixPath(_0x55f658){return _0x55f658['replace'](/\\/g,'/');}export function isSha256Hex(_0x38e71a){const _0x4c81f0=a156_0x1851;return typeof _0x38e71a===_0x4c81f0(0x17f)&&/^[a-fA-F0-9]{64}$/[_0x4c81f0(0x179)](_0x38e71a);}
@@ -1 +1 @@
1
- (function(_0x13fe32,_0x464234){const _0xfced55=a157_0x482f,_0x19818b=_0x13fe32();while(!![]){try{const _0x2b2c27=-parseInt(_0xfced55(0x97))/0x1+parseInt(_0xfced55(0xa0))/0x2+-parseInt(_0xfced55(0x79))/0x3+parseInt(_0xfced55(0x7f))/0x4+parseInt(_0xfced55(0x8e))/0x5*(parseInt(_0xfced55(0x88))/0x6)+parseInt(_0xfced55(0xa7))/0x7*(-parseInt(_0xfced55(0xa2))/0x8)+parseInt(_0xfced55(0x8a))/0x9*(parseInt(_0xfced55(0x96))/0xa);if(_0x2b2c27===_0x464234)break;else _0x19818b['push'](_0x19818b['shift']());}catch(_0xfbe954){_0x19818b['push'](_0x19818b['shift']());}}}(a157_0x29bd,0x57eba));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';function a157_0x482f(_0x5abea9,_0x3ac3c3){_0x5abea9=_0x5abea9-0x72;const _0x29bdf1=a157_0x29bd();let _0x482fde=_0x29bdf1[_0x5abea9];return _0x482fde;}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';function a157_0x29bd(){const _0x23ac5c=['displayName','936XvTPcz','map','trim','displayName:\x20','schemaVersion','28007woEAkX','has','flow','.\x20Changed\x20file:\x20','skillCode','paths','validation','description','hasOwn','trimEnd','contents','path','1781907sSIetc','set','toString','appCode','length','name','2488640BdSHOb','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','description:\x20','Runtime\x20Skill\x20package\x20is\x20missing\x20','delete','contentHash','isFile','utf8','1051692LxapkI','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','9fvWggq','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','\x0a---\x0a\x0a','skillName','5EzkUqS','env','errors','keys','packageBytes','filter','find','join','6266710hPRxyL','585215iKmRHI','version','example','pulledAt','scope','fileHashes','status','entries','---','1166620ASBMPI'];a157_0x29bd=function(){return _0x23ac5c;};return a157_0x29bd();}export function materializeRuntimeSkill(_0x580078,_0x816b62,_0x45a53c){const _0x3f9d80=a157_0x482f,_0x417c72=requireSkillCode(_0x580078),_0x26515e=requirePackageBytes(_0x417c72,_0x45a53c[_0x3f9d80(0x92)]),_0x400325=extractDownloadedPackage(_0x26515e),_0x1f8f60=_0x400325[_0x3f9d80(0x94)](_0x270160=>_0x270160[_0x3f9d80(0x78)]===SKILL_FILE);if(!_0x1f8f60)throw CliErrors[_0x3f9d80(0x73)](_0x3f9d80(0x83)+SKILL_FILE+':\x20'+_0x417c72);const _0x7eb0e=withMaterializedSkillFrontmatter(_0x400325,_0x580078,_0x417c72),_0x20aace=_0x7eb0e['find'](_0x467889=>_0x467889[_0x3f9d80(0x78)]===SKILL_FILE),_0x385682=fileText(_0x20aace),_0x10a959=getRuntimeSkillDir(_0x45a53c[_0x3f9d80(0x8f)],_0x45a53c['accessKey'],_0x45a53c['appCode'],_0x816b62,_0x417c72,_0x45a53c['paths']),_0x43f324=resolve(_0x10a959,SKILL_FILE),_0x56a550=resolve(_0x10a959,METADATA_FILE),_0xfd98e6=contentHash(_0x385682),_0x32f1e7=readMetadataIfPresent(_0x56a550)?.[_0x3f9d80(0x9c)];ensurePulledFilesCanBeOverwritten(_0x10a959,_0x56a550,_0x7eb0e,_0x45a53c['force']===!![]),mkdirSync(_0x10a959,{'recursive':!![],'mode':0x1c0});const _0x3f10c=existsSync(_0x43f324)?readFileSync(_0x43f324,_0x3f9d80(0x87)):undefined;return materializeFiles(_0x10a959,_0x7eb0e),removeStaleManagedFiles(_0x10a959,_0x32f1e7,_0x7eb0e),writeJsonAtomic(_0x56a550,buildMetadata(_0x580078,_0x816b62,_0x45a53c[_0x3f9d80(0x7c)],_0xfd98e6,_0x45a53c[_0x3f9d80(0x9a)],_0x7eb0e,_0x26515e)),{'skill':_0x580078,'scope':_0x816b62,'dir':_0x10a959,'skillMdPath':_0x43f324,'metadataPath':_0x56a550,'contentHash':_0xfd98e6,'changed':_0x3f10c!==_0x385682};}export function reuseMaterializedRuntimeSkill(_0x2635d2,_0x383221,_0x5561b6){const _0x1ed846=a157_0x482f,_0x1dbc8d=_0x2635d2[_0x1ed846(0x98)]?.[_0x1ed846(0xa4)]();if(!_0x1dbc8d)return undefined;const _0x24c9f0=requireSkillCode(_0x2635d2),_0x8c3e37=getRuntimeSkillDir(_0x5561b6[_0x1ed846(0x8f)],_0x5561b6['accessKey'],_0x5561b6[_0x1ed846(0x7c)],_0x383221,_0x24c9f0,_0x5561b6[_0x1ed846(0x72)]),_0x57b02e=resolve(_0x8c3e37,SKILL_FILE),_0xb99b17=resolve(_0x8c3e37,METADATA_FILE),_0x1713f6=readMetadataIfPresent(_0xb99b17);if(!_0x1713f6||_0x1713f6[_0x1ed846(0xa6)]!==0x2||_0x1713f6[_0x1ed846(0x7c)]!==_0x5561b6['appCode']||_0x1713f6[_0x1ed846(0x9b)]!==_0x383221||_0x1713f6[_0x1ed846(0xab)]!==_0x24c9f0||_0x1713f6[_0x1ed846(0x98)]!==_0x1dbc8d||_0x1713f6['id']!==_0x2635d2['id']||_0x1713f6[_0x1ed846(0x8d)]!==_0x2635d2['skillName']||_0x1713f6[_0x1ed846(0x74)]!==_0x2635d2['description']||_0x1713f6[_0x1ed846(0x99)]!==_0x2635d2[_0x1ed846(0x99)]||_0x1713f6[_0x1ed846(0x9d)]!==_0x2635d2['status']||!_0x1713f6[_0x1ed846(0x85)]||!_0x1713f6[_0x1ed846(0x9c)]||!Object[_0x1ed846(0x75)](_0x1713f6['fileHashes'],SKILL_FILE))return undefined;for(const [_0x169369,_0xbf5757]of Object['entries'](_0x1713f6[_0x1ed846(0x9c)])){if(!/^[a-f0-9]{64}$/['test'](_0xbf5757))return undefined;const _0x483864=resolveManagedFilePath(_0x8c3e37,_0x169369);if(!existsSync(_0x483864)||!lstatSync(_0x483864)[_0x1ed846(0x86)]())return undefined;if(bufferSha256(readFileSync(_0x483864))!==_0xbf5757)return undefined;}return{'skill':_0x2635d2,'scope':_0x383221,'dir':_0x8c3e37,'skillMdPath':_0x57b02e,'metadataPath':_0xb99b17,'contentHash':_0x1713f6['contentHash'],'changed':![]};}function withMaterializedSkillFrontmatter(_0x4307fe,_0x489535,_0x4acc06){const _0xa477ac=a157_0x482f,_0x5e99db=skillDisplayName(_0x489535,_0x4acc06),_0x4061f7=_0x489535[_0xa477ac(0x74)]?.['trim']()||_0x5e99db||_0x4acc06;return normalizeLocalFiles(_0x4307fe)['map'](_0x30f86f=>{const _0x848609=_0xa477ac,_0x20dc34=fileText(_0x30f86f);if(_0x30f86f['path']!==SKILL_FILE)return _0x30f86f;if(hasYamlFrontmatter(_0x20dc34))return{'path':_0x30f86f[_0x848609(0x78)],'content':withSyncedDisplayName(_0x20dc34,_0x5e99db)};return{'path':_0x30f86f[_0x848609(0x78)],'content':prependSkillFrontmatter(_0x20dc34,{'name':_0x4acc06,'displayName':_0x5e99db,'description':_0x4061f7})};});}function hasYamlFrontmatter(_0x3061b2){return/^\uFEFF?---\s*\r?\n/['test'](_0x3061b2);}function prependSkillFrontmatter(_0x1a2fee,_0x2a221d){const _0x3d131d=a157_0x482f,_0x13e24f=_0x1a2fee['replace'](/^\uFEFF/,'');return[_0x3d131d(0x9f),'name:\x20'+yamlString(_0x2a221d[_0x3d131d(0x7e)]),_0x2a221d[_0x3d131d(0xa1)]?_0x3d131d(0xa5)+yamlString(_0x2a221d[_0x3d131d(0xa1)]):undefined,_0x3d131d(0x82)+yamlString(_0x2a221d[_0x3d131d(0x74)]),'---','',_0x13e24f][_0x3d131d(0x93)](_0x9709c5=>_0x9709c5!==undefined)[_0x3d131d(0x95)]('\x0a');}function yamlString(_0x495d71){return JSON['stringify'](_0x495d71['replace'](/\r/g,'')['trim']());}function skillDisplayName(_0x28dd60,_0x8a8e3d){const _0x2ca564=_0x28dd60['skillName']?.['trim']();return _0x2ca564||_0x8a8e3d;}function withSyncedDisplayName(_0x1f27c3,_0x1ca207){const _0x260e38=a157_0x482f,_0x184c9f=_0x1f27c3['match'](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x184c9f)return _0x1f27c3;const _0x2341a0=_0x184c9f[0x1]??'',_0x5ccef0=_0x184c9f[0x2]??'',_0x192574=parseDocument(_0x5ccef0);if(_0x192574[_0x260e38(0x90)][_0x260e38(0x7d)]>0x0||!isMap(_0x192574[_0x260e38(0x77)]))return _0x1f27c3;if(_0x1ca207)_0x192574[_0x260e38(0x7a)](_0x260e38(0xa1),_0x1ca207);else{if(_0x192574[_0x260e38(0xa8)](_0x260e38(0xa1)))_0x192574[_0x260e38(0x84)]('displayName');else return _0x1f27c3;}forceBlockCollections(_0x192574['contents']);const _0x4612a7=_0x192574[_0x260e38(0x7b)]({'lineWidth':0x0})[_0x260e38(0x76)](),_0x56b0e8=_0x1f27c3['slice'](_0x184c9f[0x0][_0x260e38(0x7d)])['replace'](/^\r?\n/,'');return _0x2341a0+'---\x0a'+_0x4612a7+_0x260e38(0x8c)+_0x56b0e8;}function forceBlockCollections(_0x381ee6){if(!isNode(_0x381ee6))return;visit(_0x381ee6,(_0x1d30ef,_0x2c137a)=>{const _0x3ebdb7=a157_0x482f;isCollection(_0x2c137a)&&(_0x2c137a[_0x3ebdb7(0xa9)]=![]);});}function ensurePulledFilesCanBeOverwritten(_0x14afde,_0x344aeb,_0x4305da,_0x2976f8){const _0x44344b=a157_0x482f;if(_0x2976f8||!existsSync(_0x344aeb))return;const _0x42e39d=readMetadataIfPresent(_0x344aeb);if(!_0x42e39d)return;const _0x20f56d=_0x42e39d[_0x44344b(0x9c)]&&Object[_0x44344b(0x91)](_0x42e39d['fileHashes'])['length']>0x0?_0x42e39d[_0x44344b(0x9c)]:undefined;if(_0x20f56d)for(const [_0x23657f,_0x483ee9]of Object[_0x44344b(0x9e)](_0x20f56d)){const _0x20de67=resolveManagedFilePath(_0x14afde,_0x23657f);if(!existsSync(_0x20de67))throw CliErrors[_0x44344b(0x73)](_0x44344b(0x8b)+_0x14afde,'Managed\x20file\x20was\x20removed\x20locally:\x20'+_0x23657f);const _0x4c5bdc=lstatSync(_0x20de67);if(!_0x4c5bdc[_0x44344b(0x86)]())throw CliErrors[_0x44344b(0x73)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x14afde,'Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20'+_0x23657f);const _0x546364=bufferSha256(readFileSync(_0x20de67));if(_0x546364!==_0x483ee9)throw CliErrors['validation']('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x14afde+_0x44344b(0xaa)+_0x23657f,_0x44344b(0x81)+_0x23657f);}else{const _0x5a3ec1=resolve(_0x14afde,SKILL_FILE);if(existsSync(_0x5a3ec1)&&_0x42e39d[_0x44344b(0x85)]){const _0x575a40=contentHash(readFileSync(_0x5a3ec1,_0x44344b(0x87)));if(_0x575a40!==_0x42e39d[_0x44344b(0x85)])throw CliErrors[_0x44344b(0x73)](_0x44344b(0x80)+_0x5a3ec1,'Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.');}}for(const _0x30c093 of normalizeLocalFiles(_0x4305da)){if(_0x20f56d?.[_0x30c093[_0x44344b(0x78)]])continue;if(!_0x20f56d&&_0x30c093[_0x44344b(0x78)]===SKILL_FILE)continue;const _0x4fec02=resolveManagedFilePath(_0x14afde,_0x30c093[_0x44344b(0x78)]);if(!existsSync(_0x4fec02))continue;const _0x6a64a0=lstatSync(_0x4fec02);if(!_0x6a64a0['isFile']())throw CliErrors['validation'](_0x44344b(0x8b)+_0x14afde,_0x44344b(0x89)+_0x30c093[_0x44344b(0x78)]);const _0x1050ee=bufferSha256(readFileSync(_0x4fec02));if(_0x1050ee!==fileHash(_0x30c093))throw CliErrors[_0x44344b(0x73)](_0x44344b(0x8b)+_0x14afde,'Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20'+_0x30c093[_0x44344b(0x78)]);}}function materializeFiles(_0x206afa,_0x4cc908){const _0x44be1d=a157_0x482f;for(const _0x341df5 of normalizeLocalFiles(_0x4cc908)){const _0x567631=resolveManagedFilePath(_0x206afa,_0x341df5[_0x44be1d(0x78)]);mkdirSync(dirname(_0x567631),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x567631,fileContent(_0x341df5),0x180);}}function removeStaleManagedFiles(_0x184027,_0x3175e4,_0xdee6e9){const _0x5e0080=a157_0x482f;if(!_0x3175e4)return;const _0x3f631a=new Set(normalizeLocalFiles(_0xdee6e9)[_0x5e0080(0xa3)](_0x3dab6d=>_0x3dab6d[_0x5e0080(0x78)]));for(const _0xd0a7ff of Object['keys'](_0x3175e4)){if(_0x3f631a['has'](_0xd0a7ff))continue;const _0x9fa248=resolveManagedFilePath(_0x184027,_0xd0a7ff);existsSync(_0x9fa248)&&lstatSync(_0x9fa248)['isFile']()&&rmSync(_0x9fa248,{'force':!![]});}}
1
+ (function(_0x163936,_0x4110b2){const _0xab849a=a157_0x31b7,_0x36ed11=_0x163936();while(!![]){try{const _0x542395=-parseInt(_0xab849a(0x1fd))/0x1*(-parseInt(_0xab849a(0x21c))/0x2)+parseInt(_0xab849a(0x210))/0x3+-parseInt(_0xab849a(0x200))/0x4+-parseInt(_0xab849a(0x1fb))/0x5+-parseInt(_0xab849a(0x21e))/0x6+-parseInt(_0xab849a(0x20d))/0x7*(-parseInt(_0xab849a(0x208))/0x8)+-parseInt(_0xab849a(0x1fe))/0x9;if(_0x542395===_0x4110b2)break;else _0x36ed11['push'](_0x36ed11['shift']());}catch(_0x7a9f5c){_0x36ed11['push'](_0x36ed11['shift']());}}}(a157_0x33c7,0x347cf));import{existsSync,lstatSync,mkdirSync,readFileSync,rmSync}from'node:fs';import{dirname,resolve}from'node:path';import{isCollection,isMap,isNode,parseDocument,visit}from'yaml';function a157_0x33c7(){const _0xf3580=['test','entries','340407zEEaaf','find','length','toString','name:\x20','paths','appCode','scope','flow','trim','trimEnd','filter','274tuNcpm','contents','1093572fAGYal','example','validation','slice','status','description','name','replace','displayName:\x20','contentHash','force','schemaVersion','displayName','version','packageBytes','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','accessKey','isFile','skillCode','\x0a---\x0a\x0a','---','keys','utf8','has','183315hVVEoC','pulledAt','2887rKOZVf','234630aYLcPk','join','877444GNnkxc','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','path','errors','Managed\x20file\x20was\x20removed\x20locally:\x20','delete','fileHashes','skillName','1362872ZcVoLp','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','---\x0a','map','env','7gCZirA'];a157_0x33c7=function(){return _0xf3580;};return a157_0x33c7();}function a157_0x31b7(_0xf55e9e,_0x205ac3){_0xf55e9e=_0xf55e9e-0x1e8;const _0x33c7f0=a157_0x33c7();let _0x31b77c=_0x33c7f0[_0xf55e9e];return _0x31b77c;}import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{resolveManagedFilePath,writeBytesAtomic,writeJsonAtomic}from'./fs-utils.js';import{bufferSha256,contentHash,fileHash}from'./hashing.js';import{fileContent,fileText,normalizeLocalFiles}from'./local-files.js';import{buildMetadata,readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillDir}from'./paths.js';import{extractDownloadedPackage,requirePackageBytes}from'./zip-package.js';export function materializeRuntimeSkill(_0x2442a1,_0x108fe0,_0x5ec250){const _0xb1145a=a157_0x31b7,_0x241f79=requireSkillCode(_0x2442a1),_0x48abd1=requirePackageBytes(_0x241f79,_0x5ec250[_0xb1145a(0x1f1)]),_0x1e191e=extractDownloadedPackage(_0x48abd1),_0x1d40c6=_0x1e191e[_0xb1145a(0x211)](_0x1e7071=>_0x1e7071[_0xb1145a(0x202)]===SKILL_FILE);if(!_0x1d40c6)throw CliErrors[_0xb1145a(0x220)]('Runtime\x20Skill\x20package\x20is\x20missing\x20'+SKILL_FILE+':\x20'+_0x241f79);const _0x3e1196=withMaterializedSkillFrontmatter(_0x1e191e,_0x2442a1,_0x241f79),_0x13d18e=_0x3e1196[_0xb1145a(0x211)](_0x405985=>_0x405985[_0xb1145a(0x202)]===SKILL_FILE),_0x22452d=fileText(_0x13d18e),_0x2c8073=getRuntimeSkillDir(_0x5ec250[_0xb1145a(0x20c)],_0x5ec250[_0xb1145a(0x1f3)],_0x5ec250[_0xb1145a(0x216)],_0x108fe0,_0x241f79,_0x5ec250[_0xb1145a(0x215)]),_0x273652=resolve(_0x2c8073,SKILL_FILE),_0x4fb079=resolve(_0x2c8073,METADATA_FILE),_0x4a3f96=contentHash(_0x22452d),_0x268080=readMetadataIfPresent(_0x4fb079)?.[_0xb1145a(0x206)];ensurePulledFilesCanBeOverwritten(_0x2c8073,_0x4fb079,_0x3e1196,_0x5ec250[_0xb1145a(0x1ed)]===!![]),mkdirSync(_0x2c8073,{'recursive':!![],'mode':0x1c0});const _0x1e9a6c=existsSync(_0x273652)?readFileSync(_0x273652,_0xb1145a(0x1f9)):undefined;return materializeFiles(_0x2c8073,_0x3e1196),removeStaleManagedFiles(_0x2c8073,_0x268080,_0x3e1196),writeJsonAtomic(_0x4fb079,buildMetadata(_0x2442a1,_0x108fe0,_0x5ec250['appCode'],_0x4a3f96,_0x5ec250[_0xb1145a(0x1fc)],_0x3e1196,_0x48abd1)),{'skill':_0x2442a1,'scope':_0x108fe0,'dir':_0x2c8073,'skillMdPath':_0x273652,'metadataPath':_0x4fb079,'contentHash':_0x4a3f96,'changed':_0x1e9a6c!==_0x22452d};}export function reuseMaterializedRuntimeSkill(_0x359e07,_0x432795,_0x5b6306){const _0x2b49cc=a157_0x31b7,_0xee8e30=_0x359e07[_0x2b49cc(0x1f0)]?.[_0x2b49cc(0x219)]();if(!_0xee8e30)return undefined;const _0x4ec556=requireSkillCode(_0x359e07),_0x2d6239=getRuntimeSkillDir(_0x5b6306[_0x2b49cc(0x20c)],_0x5b6306[_0x2b49cc(0x1f3)],_0x5b6306[_0x2b49cc(0x216)],_0x432795,_0x4ec556,_0x5b6306[_0x2b49cc(0x215)]),_0x43ee5f=resolve(_0x2d6239,SKILL_FILE),_0x40b645=resolve(_0x2d6239,METADATA_FILE),_0x2e0aaf=readMetadataIfPresent(_0x40b645);if(!_0x2e0aaf||_0x2e0aaf[_0x2b49cc(0x1ee)]!==0x2||_0x2e0aaf[_0x2b49cc(0x216)]!==_0x5b6306[_0x2b49cc(0x216)]||_0x2e0aaf[_0x2b49cc(0x217)]!==_0x432795||_0x2e0aaf[_0x2b49cc(0x1f5)]!==_0x4ec556||_0x2e0aaf[_0x2b49cc(0x1f0)]!==_0xee8e30||_0x2e0aaf['id']!==_0x359e07['id']||_0x2e0aaf['skillName']!==_0x359e07['skillName']||_0x2e0aaf[_0x2b49cc(0x1e8)]!==_0x359e07[_0x2b49cc(0x1e8)]||_0x2e0aaf['example']!==_0x359e07[_0x2b49cc(0x21f)]||_0x2e0aaf[_0x2b49cc(0x222)]!==_0x359e07[_0x2b49cc(0x222)]||!_0x2e0aaf[_0x2b49cc(0x1ec)]||!_0x2e0aaf[_0x2b49cc(0x206)]||!Object['hasOwn'](_0x2e0aaf['fileHashes'],SKILL_FILE))return undefined;for(const [_0x1fdca8,_0x19b851]of Object[_0x2b49cc(0x20f)](_0x2e0aaf['fileHashes'])){if(!/^[a-f0-9]{64}$/[_0x2b49cc(0x20e)](_0x19b851))return undefined;const _0x471211=resolveManagedFilePath(_0x2d6239,_0x1fdca8);if(!existsSync(_0x471211)||!lstatSync(_0x471211)[_0x2b49cc(0x1f4)]())return undefined;if(bufferSha256(readFileSync(_0x471211))!==_0x19b851)return undefined;}return{'skill':_0x359e07,'scope':_0x432795,'dir':_0x2d6239,'skillMdPath':_0x43ee5f,'metadataPath':_0x40b645,'contentHash':_0x2e0aaf[_0x2b49cc(0x1ec)],'changed':![]};}function withMaterializedSkillFrontmatter(_0x14ec1b,_0x3b4d4a,_0x576543){const _0x9618c3=a157_0x31b7,_0x1a6570=skillDisplayName(_0x3b4d4a,_0x576543),_0x3a3b10=_0x3b4d4a[_0x9618c3(0x1e8)]?.[_0x9618c3(0x219)]()||_0x1a6570||_0x576543;return normalizeLocalFiles(_0x14ec1b)[_0x9618c3(0x20b)](_0x1184bc=>{const _0x18d9bb=_0x9618c3,_0x40d7dd=fileText(_0x1184bc);if(_0x1184bc[_0x18d9bb(0x202)]!==SKILL_FILE)return _0x1184bc;if(hasYamlFrontmatter(_0x40d7dd))return{'path':_0x1184bc[_0x18d9bb(0x202)],'content':withSyncedDisplayName(_0x40d7dd,_0x1a6570)};return{'path':_0x1184bc[_0x18d9bb(0x202)],'content':prependSkillFrontmatter(_0x40d7dd,{'name':_0x576543,'displayName':_0x1a6570,'description':_0x3a3b10})};});}function hasYamlFrontmatter(_0x1864d1){const _0xca089b=a157_0x31b7;return/^\uFEFF?---\s*\r?\n/[_0xca089b(0x20e)](_0x1864d1);}function prependSkillFrontmatter(_0x5e24c8,_0x44d66c){const _0x4be27c=a157_0x31b7,_0xeaf7a6=_0x5e24c8[_0x4be27c(0x1ea)](/^\uFEFF/,'');return['---',_0x4be27c(0x214)+yamlString(_0x44d66c[_0x4be27c(0x1e9)]),_0x44d66c[_0x4be27c(0x1ef)]?_0x4be27c(0x1eb)+yamlString(_0x44d66c[_0x4be27c(0x1ef)]):undefined,'description:\x20'+yamlString(_0x44d66c['description']),_0x4be27c(0x1f7),'',_0xeaf7a6][_0x4be27c(0x21b)](_0x572287=>_0x572287!==undefined)[_0x4be27c(0x1ff)]('\x0a');}function yamlString(_0x34589d){const _0x466e19=a157_0x31b7;return JSON['stringify'](_0x34589d['replace'](/\r/g,'')[_0x466e19(0x219)]());}function skillDisplayName(_0x2bf8f0,_0x5a1c05){const _0x2baca9=a157_0x31b7,_0x13af9d=_0x2bf8f0[_0x2baca9(0x207)]?.['trim']();return _0x13af9d||_0x5a1c05;}function withSyncedDisplayName(_0xb666f9,_0xddc29c){const _0xd4c821=a157_0x31b7,_0x5b84ea=_0xb666f9['match'](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x5b84ea)return _0xb666f9;const _0x54fe08=_0x5b84ea[0x1]??'',_0x273837=_0x5b84ea[0x2]??'',_0x30279f=parseDocument(_0x273837);if(_0x30279f[_0xd4c821(0x203)][_0xd4c821(0x212)]>0x0||!isMap(_0x30279f[_0xd4c821(0x21d)]))return _0xb666f9;if(_0xddc29c)_0x30279f['set']('displayName',_0xddc29c);else{if(_0x30279f[_0xd4c821(0x1fa)](_0xd4c821(0x1ef)))_0x30279f[_0xd4c821(0x205)]('displayName');else return _0xb666f9;}forceBlockCollections(_0x30279f[_0xd4c821(0x21d)]);const _0xe6ae9d=_0x30279f[_0xd4c821(0x213)]({'lineWidth':0x0})[_0xd4c821(0x21a)](),_0x380d6a=_0xb666f9[_0xd4c821(0x221)](_0x5b84ea[0x0]['length'])[_0xd4c821(0x1ea)](/^\r?\n/,'');return _0x54fe08+_0xd4c821(0x20a)+_0xe6ae9d+_0xd4c821(0x1f6)+_0x380d6a;}function forceBlockCollections(_0x312c04){if(!isNode(_0x312c04))return;visit(_0x312c04,(_0x306cf8,_0x57b830)=>{const _0x1cf2a9=a157_0x31b7;isCollection(_0x57b830)&&(_0x57b830[_0x1cf2a9(0x218)]=![]);});}function ensurePulledFilesCanBeOverwritten(_0x5da8b4,_0x8aa7e7,_0x2eeb6f,_0x5b2d5a){const _0x23fcc1=a157_0x31b7;if(_0x5b2d5a||!existsSync(_0x8aa7e7))return;const _0x9d5c92=readMetadataIfPresent(_0x8aa7e7);if(!_0x9d5c92)return;const _0x5649ae=_0x9d5c92['fileHashes']&&Object[_0x23fcc1(0x1f8)](_0x9d5c92[_0x23fcc1(0x206)])['length']>0x0?_0x9d5c92[_0x23fcc1(0x206)]:undefined;if(_0x5649ae)for(const [_0x47a7fd,_0x50bdf3]of Object['entries'](_0x5649ae)){const _0x2180c1=resolveManagedFilePath(_0x5da8b4,_0x47a7fd);if(!existsSync(_0x2180c1))throw CliErrors[_0x23fcc1(0x220)](_0x23fcc1(0x201)+_0x5da8b4,_0x23fcc1(0x204)+_0x47a7fd);const _0x1b17d4=lstatSync(_0x2180c1);if(!_0x1b17d4[_0x23fcc1(0x1f4)]())throw CliErrors[_0x23fcc1(0x220)](_0x23fcc1(0x201)+_0x5da8b4,'Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20'+_0x47a7fd);const _0x327033=bufferSha256(readFileSync(_0x2180c1));if(_0x327033!==_0x50bdf3)throw CliErrors[_0x23fcc1(0x220)](_0x23fcc1(0x201)+_0x5da8b4+'.\x20Changed\x20file:\x20'+_0x47a7fd,_0x23fcc1(0x1f2)+_0x47a7fd);}else{const _0x42a987=resolve(_0x5da8b4,SKILL_FILE);if(existsSync(_0x42a987)&&_0x9d5c92['contentHash']){const _0x4bd7d7=contentHash(readFileSync(_0x42a987,_0x23fcc1(0x1f9)));if(_0x4bd7d7!==_0x9d5c92[_0x23fcc1(0x1ec)])throw CliErrors[_0x23fcc1(0x220)]('Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20'+_0x42a987,'Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.');}}for(const _0x4a43ce of normalizeLocalFiles(_0x2eeb6f)){if(_0x5649ae?.[_0x4a43ce[_0x23fcc1(0x202)]])continue;if(!_0x5649ae&&_0x4a43ce[_0x23fcc1(0x202)]===SKILL_FILE)continue;const _0x52d476=resolveManagedFilePath(_0x5da8b4,_0x4a43ce[_0x23fcc1(0x202)]);if(!existsSync(_0x52d476))continue;const _0x3ff14f=lstatSync(_0x52d476);if(!_0x3ff14f['isFile']())throw CliErrors['validation'](_0x23fcc1(0x201)+_0x5da8b4,_0x23fcc1(0x209)+_0x4a43ce[_0x23fcc1(0x202)]);const _0x521e12=bufferSha256(readFileSync(_0x52d476));if(_0x521e12!==fileHash(_0x4a43ce))throw CliErrors[_0x23fcc1(0x220)](_0x23fcc1(0x201)+_0x5da8b4,'Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20'+_0x4a43ce[_0x23fcc1(0x202)]);}}function materializeFiles(_0x50d146,_0x5ae596){for(const _0x391fef of normalizeLocalFiles(_0x5ae596)){const _0x1a5151=resolveManagedFilePath(_0x50d146,_0x391fef['path']);mkdirSync(dirname(_0x1a5151),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x1a5151,fileContent(_0x391fef),0x180);}}function removeStaleManagedFiles(_0x2e1c8a,_0x27dabd,_0x331b20){const _0x6d4d67=a157_0x31b7;if(!_0x27dabd)return;const _0x4e3793=new Set(normalizeLocalFiles(_0x331b20)['map'](_0x4c8291=>_0x4c8291[_0x6d4d67(0x202)]));for(const _0x9ee4c5 of Object['keys'](_0x27dabd)){if(_0x4e3793[_0x6d4d67(0x1fa)](_0x9ee4c5))continue;const _0xfa04dc=resolveManagedFilePath(_0x2e1c8a,_0x9ee4c5);existsSync(_0xfa04dc)&&lstatSync(_0xfa04dc)['isFile']()&&rmSync(_0xfa04dc,{'force':!![]});}}
@@ -1 +1 @@
1
- (function(_0x3ffa4f,_0x49baba){const _0x554152=a158_0xbbc2,_0xb22440=_0x3ffa4f();while(!![]){try{const _0x489778=-parseInt(_0x554152(0x131))/0x1+parseInt(_0x554152(0x11a))/0x2*(-parseInt(_0x554152(0x125))/0x3)+parseInt(_0x554152(0x12f))/0x4+-parseInt(_0x554152(0x129))/0x5+-parseInt(_0x554152(0x122))/0x6+parseInt(_0x554152(0x12c))/0x7+parseInt(_0x554152(0x116))/0x8;if(_0x489778===_0x49baba)break;else _0xb22440['push'](_0xb22440['shift']());}catch(_0x1bec13){_0xb22440['push'](_0xb22440['shift']());}}}(a158_0x4cd6,0xc4076));import{existsSync,readFileSync}from'node:fs';import{CliErrors}from'../../errors.js';function a158_0xbbc2(_0x2b9bb3,_0x363073){_0x2b9bb3=_0x2b9bb3-0x116;const _0x4cd65b=a158_0x4cd6();let _0xbbc26b=_0x4cd65b[_0x2b9bb3];return _0xbbc26b;}import{METADATA_FILE}from'./constants.js';import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';import{fileContent,normalizeLocalFiles}from'./local-files.js';import{buildSkillPackage,localFilesToManifestFiles}from'./zip-package.js';export function buildMetadata(_0x1b65c7,_0x2aa448,_0x12d63a,_0x5760f7,_0x3058d4,_0x347ab5,_0x18aa00){const _0x778e6a=a158_0xbbc2,_0x536c6a=_0x347ab5?normalizeLocalFiles(_0x347ab5):[],_0xc6a67e=!_0x18aa00&&_0x536c6a[_0x778e6a(0x132)]>0x0?buildSkillPackage(_0x536c6a):undefined,_0x3a7385=_0x18aa00?bufferSha256(_0x18aa00):_0xc6a67e?.[_0x778e6a(0x11d)][_0x778e6a(0x119)],_0x37180f=_0x18aa00?.[_0x778e6a(0x132)]??_0xc6a67e?.['manifest']['zipSize'],_0x4b4040=_0x536c6a[_0x778e6a(0x132)]>0x0?Object['fromEntries'](_0x536c6a[_0x778e6a(0x12e)](_0x163ab9=>[_0x163ab9['path'],fileHash(_0x163ab9)])):undefined;return{'schemaVersion':_0x536c6a[_0x778e6a(0x132)]>0x0?0x2:0x1,'id':_0x1b65c7['id'],'appCode':_0x12d63a,'skillCode':requireSkillCode(_0x1b65c7),'skillName':_0x1b65c7['skillName'],'description':_0x1b65c7['description'],'example':_0x1b65c7[_0x778e6a(0x11b)],'scope':_0x2aa448,'readonly':_0x2aa448!=='personal'||_0x1b65c7[_0x778e6a(0x126)]===!![],'tenantCode':_0x1b65c7[_0x778e6a(0x117)],'userId':_0x1b65c7[_0x778e6a(0x11f)],'version':_0x1b65c7['version'],'status':_0x1b65c7['status'],'tags':Array[_0x778e6a(0x133)](_0x1b65c7[_0x778e6a(0x12a)])?_0x1b65c7['tags']:[],'hasUpstreamUpdate':_0x1b65c7[_0x778e6a(0x123)],'forkedFromSkillId':_0x1b65c7['forkedFromSkillId'],'forkedFromVersion':_0x1b65c7[_0x778e6a(0x118)],'sourceSessionId':_0x1b65c7[_0x778e6a(0x11e)],'contentHash':_0x5760f7,'fileHashes':_0x4b4040,'treeHash':_0x536c6a[_0x778e6a(0x132)]>0x0?fileTreeHash(localFilesToManifestFiles(_0x536c6a)):undefined,'ossPath':remoteManifestOssPath(_0x1b65c7['files']),'zipSha256':_0x3a7385,'zipSize':_0x37180f,'files':_0x536c6a[_0x778e6a(0x132)]>0x0?_0x536c6a[_0x778e6a(0x12e)](_0x1f500f=>({'path':_0x1f500f[_0x778e6a(0x121)],'hash':fileHash(_0x1f500f),'size':fileContent(_0x1f500f)['length']})):undefined,'pulledAt':_0x3058d4??new Date()[_0x778e6a(0x130)]()};}export function requireSkillCode(_0x168e02){const _0x417d51=a158_0xbbc2,_0xdef41d=_0x168e02[_0x417d51(0x11c)]?.[_0x417d51(0x135)]();if(!_0xdef41d)throw CliErrors[_0x417d51(0x124)](_0x417d51(0x134));return _0xdef41d;}function a158_0x4cd6(){const _0x1a8dc9=['ossPath','path','5266308xfMxJF','hasUpstreamUpdate','validation','3TgFoeK','readonly','utf8','object','5471350JJOsBH','tags','parse','1474977RQuFpA','string','map','4946252LrKJka','toISOString','623280WpDDxP','length','isArray','Runtime\x20Skill\x20is\x20missing\x20skillCode.','trim','16624088LxXWAS','tenantCode','forkedFromVersion','zipSha256','254166NsQWRr','example','skillCode','manifest','sourceSessionId','userId'];a158_0x4cd6=function(){return _0x1a8dc9;};return a158_0x4cd6();}export function readMetadataIfPresent(_0x1581b0){const _0x4111dc=a158_0xbbc2;if(!existsSync(_0x1581b0))return undefined;try{const _0xeb4bb9=JSON[_0x4111dc(0x12b)](readFileSync(_0x1581b0,_0x4111dc(0x127)));return _0xeb4bb9;}catch{throw CliErrors[_0x4111dc(0x124)]('Invalid\x20'+METADATA_FILE+':\x20'+_0x1581b0);}}function remoteManifestOssPath(_0x77b9fc){const _0x2bd6bf=a158_0xbbc2;if(!_0x77b9fc||typeof _0x77b9fc!==_0x2bd6bf(0x128)||Array['isArray'](_0x77b9fc))return undefined;const _0x1d1389=_0x77b9fc[_0x2bd6bf(0x120)];return typeof _0x1d1389===_0x2bd6bf(0x12d)&&_0x1d1389[_0x2bd6bf(0x135)]()?_0x1d1389[_0x2bd6bf(0x135)]():undefined;}
1
+ function a158_0x17f2(){const _0x586171=['example','version','69526QKmLoZ','object','length','24JfXcVZ','tags','2112649fzBygF','Invalid\x20','71868LQeXWt','map','4KaIAfv','1186adRpyt','skillName','readonly','parse','forkedFromVersion','skillCode','trim','1305ZQSKLe','status','isArray','string','forkedFromSkillId','6gQkYIa','validation','toISOString','manifest','Runtime\x20Skill\x20is\x20missing\x20skillCode.','2998480XRNVwz','413685PMQLYE','description','1947nVmMnx','sourceSessionId','436715isABcy','zipSha256','files','path','zipSize','personal','tenantCode'];a158_0x17f2=function(){return _0x586171;};return a158_0x17f2();}(function(_0x41641e,_0x4e1210){const _0x38cdf3=a158_0x39f2,_0x29077f=_0x41641e();while(!![]){try{const _0x3c8a24=-parseInt(_0x38cdf3(0x11f))/0x1+-parseInt(_0x38cdf3(0x129))/0x2*(parseInt(_0x38cdf3(0x130))/0x3)+-parseInt(_0x38cdf3(0x128))/0x4*(parseInt(_0x38cdf3(0x13f))/0x5)+-parseInt(_0x38cdf3(0x135))/0x6*(parseInt(_0x38cdf3(0x124))/0x7)+-parseInt(_0x38cdf3(0x122))/0x8*(-parseInt(_0x38cdf3(0x13b))/0x9)+-parseInt(_0x38cdf3(0x13a))/0xa+parseInt(_0x38cdf3(0x13d))/0xb*(parseInt(_0x38cdf3(0x126))/0xc);if(_0x3c8a24===_0x4e1210)break;else _0x29077f['push'](_0x29077f['shift']());}catch(_0x592c95){_0x29077f['push'](_0x29077f['shift']());}}}(a158_0x17f2,0x2c4dd));import{existsSync,readFileSync}from'node:fs';import{CliErrors}from'../../errors.js';function a158_0x39f2(_0x1a390a,_0x597a2a){_0x1a390a=_0x1a390a-0x119;const _0x17f279=a158_0x17f2();let _0x39f218=_0x17f279[_0x1a390a];return _0x39f218;}import{METADATA_FILE}from'./constants.js';import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';import{fileContent,normalizeLocalFiles}from'./local-files.js';import{buildSkillPackage,localFilesToManifestFiles}from'./zip-package.js';export function buildMetadata(_0x3f10cb,_0x13a713,_0x4a5f0c,_0x38e51d,_0x47ad64,_0xba0692,_0x1eed14){const _0x113109=a158_0x39f2,_0x461cf2=_0xba0692?normalizeLocalFiles(_0xba0692):[],_0x4772d4=!_0x1eed14&&_0x461cf2[_0x113109(0x121)]>0x0?buildSkillPackage(_0x461cf2):undefined,_0x263654=_0x1eed14?bufferSha256(_0x1eed14):_0x4772d4?.['manifest'][_0x113109(0x140)],_0x5299bd=_0x1eed14?.[_0x113109(0x121)]??_0x4772d4?.[_0x113109(0x138)][_0x113109(0x11a)],_0x1551fe=_0x461cf2[_0x113109(0x121)]>0x0?Object['fromEntries'](_0x461cf2[_0x113109(0x127)](_0x2a3314=>[_0x2a3314['path'],fileHash(_0x2a3314)])):undefined;return{'schemaVersion':_0x461cf2[_0x113109(0x121)]>0x0?0x2:0x1,'id':_0x3f10cb['id'],'appCode':_0x4a5f0c,'skillCode':requireSkillCode(_0x3f10cb),'skillName':_0x3f10cb[_0x113109(0x12a)],'description':_0x3f10cb[_0x113109(0x13c)],'example':_0x3f10cb[_0x113109(0x11d)],'scope':_0x13a713,'readonly':_0x13a713!==_0x113109(0x11b)||_0x3f10cb[_0x113109(0x12b)]===!![],'tenantCode':_0x3f10cb[_0x113109(0x11c)],'userId':_0x3f10cb['userId'],'version':_0x3f10cb[_0x113109(0x11e)],'status':_0x3f10cb[_0x113109(0x131)],'tags':Array[_0x113109(0x132)](_0x3f10cb[_0x113109(0x123)])?_0x3f10cb[_0x113109(0x123)]:[],'hasUpstreamUpdate':_0x3f10cb['hasUpstreamUpdate'],'forkedFromSkillId':_0x3f10cb[_0x113109(0x134)],'forkedFromVersion':_0x3f10cb[_0x113109(0x12d)],'sourceSessionId':_0x3f10cb[_0x113109(0x13e)],'contentHash':_0x38e51d,'fileHashes':_0x1551fe,'treeHash':_0x461cf2[_0x113109(0x121)]>0x0?fileTreeHash(localFilesToManifestFiles(_0x461cf2)):undefined,'ossPath':remoteManifestOssPath(_0x3f10cb[_0x113109(0x141)]),'zipSha256':_0x263654,'zipSize':_0x5299bd,'files':_0x461cf2['length']>0x0?_0x461cf2[_0x113109(0x127)](_0x2e12a3=>({'path':_0x2e12a3[_0x113109(0x119)],'hash':fileHash(_0x2e12a3),'size':fileContent(_0x2e12a3)[_0x113109(0x121)]})):undefined,'pulledAt':_0x47ad64??new Date()[_0x113109(0x137)]()};}export function requireSkillCode(_0x3f60e8){const _0x10d8ce=a158_0x39f2,_0x1ba616=_0x3f60e8[_0x10d8ce(0x12e)]?.[_0x10d8ce(0x12f)]();if(!_0x1ba616)throw CliErrors[_0x10d8ce(0x136)](_0x10d8ce(0x139));return _0x1ba616;}export function readMetadataIfPresent(_0x2bf87b){const _0x3ba7a7=a158_0x39f2;if(!existsSync(_0x2bf87b))return undefined;try{const _0x99a567=JSON[_0x3ba7a7(0x12c)](readFileSync(_0x2bf87b,'utf8'));return _0x99a567;}catch{throw CliErrors[_0x3ba7a7(0x136)](_0x3ba7a7(0x125)+METADATA_FILE+':\x20'+_0x2bf87b);}}function remoteManifestOssPath(_0xcf1b09){const _0x3c82f1=a158_0x39f2;if(!_0xcf1b09||typeof _0xcf1b09!==_0x3c82f1(0x120)||Array[_0x3c82f1(0x132)](_0xcf1b09))return undefined;const _0x455735=_0xcf1b09['ossPath'];return typeof _0x455735===_0x3c82f1(0x133)&&_0x455735[_0x3c82f1(0x12f)]()?_0x455735[_0x3c82f1(0x12f)]():undefined;}
@@ -1 +1 @@
1
- const a159_0x2aa850=a159_0x3d32;(function(_0x40572d,_0x34bcda){const _0x290a89=a159_0x3d32,_0x4007b1=_0x40572d();while(!![]){try{const _0x4c8bf4=parseInt(_0x290a89(0x184))/0x1*(-parseInt(_0x290a89(0x18d))/0x2)+parseInt(_0x290a89(0x189))/0x3+-parseInt(_0x290a89(0x186))/0x4+parseInt(_0x290a89(0x195))/0x5+parseInt(_0x290a89(0x192))/0x6+-parseInt(_0x290a89(0x18e))/0x7+parseInt(_0x290a89(0x19b))/0x8*(parseInt(_0x290a89(0x191))/0x9);if(_0x4c8bf4===_0x34bcda)break;else _0x4007b1['push'](_0x4007b1['shift']());}catch(_0x2f0c98){_0x4007b1['push'](_0x4007b1['shift']());}}}(a159_0x2024,0xade2b));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(_0x313724={}){const _0xd23c70=a159_0x3d32,_0x42030d=_0x313724[_0xd23c70(0x199)]??homedir(),_0x3e7d83=resolve(_0x42030d,PRODUCT_CONFIG[_0xd23c70(0x193)],_0xd23c70(0x185)),_0xaff057=trimmedEnv(_0xd23c70(0x18c)),_0x24b84c=trimmedEnv(_0xd23c70(0x18b)),_0x26423b=resolve(_0x42030d,_0xd23c70(0x198)),_0x2aebf2=_0x313724[_0xd23c70(0x18a)]??(existsSync(_0x26423b)?resolve(_0x26423b,'skills'):undefined);return{'homeDir':_0x42030d,'cacheRoot':_0x3e7d83,'managedRoot':resolve(_0x42030d,PRODUCT_CONFIG[_0xd23c70(0x193)]),'agentsSkillsDir':_0x313724[_0xd23c70(0x19d)]??_0xaff057??resolve(_0x42030d,_0xd23c70(0x190),'skills'),'claudeSkillsDir':_0x313724[_0xd23c70(0x187)]??_0x24b84c??resolve(_0x42030d,_0xd23c70(0x194),_0xd23c70(0x18f)),'workbuddySkillsDir':_0x2aebf2};}function a159_0x2024(){const _0x1c9837=['filter','3171270OjsamD','workbuddySkillsDir','CLAUDE_SKILL_ROOT','SKILL_ROOT','2DEpQHM','8360884GkDhZv','skills','.agents','5328ejIENA','3716766EcNjmS','homeDirName','.claude','1404550tAwgyH','\x20for\x20local\x20path:\x20','skillCode','.workbuddy','homeDir','Unsafe\x20','13096RZVojR','path\x20segment','agentsSkillsDir','validation','927683RtFpWR','cache','368940LkvHss','claudeSkillsDir'];a159_0x2024=function(){return _0x1c9837;};return a159_0x2024();}function a159_0x3d32(_0x1f3a93,_0x329bef){_0x1f3a93=_0x1f3a93-0x183;const _0x202454=a159_0x2024();let _0x3d3249=_0x202454[_0x1f3a93];return _0x3d3249;}export function runtimeAgentSkillRoots(_0x21a6eb){const _0x144372=a159_0x3d32;return[_0x21a6eb[_0x144372(0x19d)],_0x21a6eb[_0x144372(0x187)],_0x21a6eb['workbuddySkillsDir']][_0x144372(0x188)](_0x28cffd=>Boolean(_0x28cffd));}export function getRuntimeSkillCacheRoot(_0xdb480c,_0x42083c,_0x13ab36={}){const _0x563783=a159_0x3d32,_0x1334ef=resolveSkillSyncPaths(_0x13ab36);return resolve(_0x1334ef['cacheRoot'],_0xdb480c,fingerprintAccessKey(_0x42083c),_0x563783(0x18f));}export function getRuntimeSkillDir(_0x37b15f,_0x5bb966,_0xf31ece,_0xa2bf71,_0x257ad6,_0x586e84={}){const _0x500547=a159_0x3d32;return resolve(getRuntimeSkillCacheRoot(_0x37b15f,_0x5bb966,_0x586e84),safePathSegment(_0xf31ece,'appCode'),_0xa2bf71,safePathSegment(_0x257ad6,_0x500547(0x197)));}export function safePathSegment(_0x377688,_0x45a052=a159_0x2aa850(0x19c)){const _0x536baf=a159_0x2aa850;if(!_0x377688||_0x377688['includes']('/')||_0x377688['includes']('\x5c')||_0x377688['includes']('..'))throw CliErrors[_0x536baf(0x183)](_0x536baf(0x19a)+_0x45a052+_0x536baf(0x196)+_0x377688);return _0x377688;}function trimmedEnv(_0x1ad7cc){const _0x416880=productEnv(_0x1ad7cc)?.['trim']();return _0x416880?_0x416880:undefined;}
1
+ (function(_0x17de2a,_0x20a3a6){const _0x1d9993=a159_0x3c5e,_0x95026=_0x17de2a();while(!![]){try{const _0x453e89=-parseInt(_0x1d9993(0x1bd))/0x1*(-parseInt(_0x1d9993(0x1b8))/0x2)+parseInt(_0x1d9993(0x1c1))/0x3+parseInt(_0x1d9993(0x1cd))/0x4*(-parseInt(_0x1d9993(0x1c8))/0x5)+-parseInt(_0x1d9993(0x1c2))/0x6+parseInt(_0x1d9993(0x1b6))/0x7*(-parseInt(_0x1d9993(0x1c4))/0x8)+-parseInt(_0x1d9993(0x1c0))/0x9*(-parseInt(_0x1d9993(0x1b9))/0xa)+-parseInt(_0x1d9993(0x1bc))/0xb;if(_0x453e89===_0x20a3a6)break;else _0x95026['push'](_0x95026['shift']());}catch(_0x4a00f5){_0x95026['push'](_0x95026['shift']());}}}(a159_0x2c8f,0xb6f17));function a159_0x3c5e(_0x1b8fd3,_0x10ab6a){_0x1b8fd3=_0x1b8fd3-0x1b5;const _0x2c8f2e=a159_0x2c8f();let _0x3c5e83=_0x2c8f2e[_0x1b8fd3];return _0x3c5e83;}import{existsSync}from'node:fs';import{homedir}from'node:os';import{resolve}from'node:path';import{fingerprintAccessKey}from'../../commands/app/cache.js';import{PRODUCT_CONFIG,productEnv}from'../../constant/product.js';import{CliErrors}from'../../errors.js';export function resolveSkillSyncPaths(_0x34c979={}){const _0x3b705f=a159_0x3c5e,_0x3d252a=_0x34c979['homeDir']??homedir(),_0x4b5b3e=resolve(_0x3d252a,PRODUCT_CONFIG[_0x3b705f(0x1be)],_0x3b705f(0x1b7)),_0x42eab9=trimmedEnv(_0x3b705f(0x1c6)),_0x37e3c0=trimmedEnv('CLAUDE_SKILL_ROOT'),_0x1613ac=resolve(_0x3d252a,_0x3b705f(0x1ca)),_0x24ee24=_0x34c979[_0x3b705f(0x1bb)]??(existsSync(_0x1613ac)?resolve(_0x1613ac,_0x3b705f(0x1bf)):undefined);return{'homeDir':_0x3d252a,'cacheRoot':_0x4b5b3e,'managedRoot':resolve(_0x3d252a,PRODUCT_CONFIG[_0x3b705f(0x1be)]),'agentsSkillsDir':_0x34c979['agentsSkillsDir']??_0x42eab9??resolve(_0x3d252a,'.agents','skills'),'claudeSkillsDir':_0x34c979['claudeSkillsDir']??_0x37e3c0??resolve(_0x3d252a,'.claude','skills'),'workbuddySkillsDir':_0x24ee24};}export function runtimeAgentSkillRoots(_0x419fc2){const _0x308963=a159_0x3c5e;return[_0x419fc2[_0x308963(0x1b5)],_0x419fc2[_0x308963(0x1c3)],_0x419fc2[_0x308963(0x1bb)]][_0x308963(0x1cc)](_0x36dfd3=>Boolean(_0x36dfd3));}export function getRuntimeSkillCacheRoot(_0x22ba49,_0x1baa01,_0x2a542d={}){const _0x1bc010=a159_0x3c5e,_0xd6d7d=resolveSkillSyncPaths(_0x2a542d);return resolve(_0xd6d7d['cacheRoot'],_0x22ba49,fingerprintAccessKey(_0x1baa01),_0x1bc010(0x1bf));}function a159_0x2c8f(){const _0x28a597=['claudeSkillsDir','344lGmEMl','Unsafe\x20','SKILL_ROOT','trim','35SIwQWv','appCode','.workbuddy','includes','filter','390012ueEENS','agentsSkillsDir','12061ZHaaFy','cache','62402IXClIh','1800dfBRar','\x20for\x20local\x20path:\x20','workbuddySkillsDir','14058902xgVcjI','47LHQMYs','homeDirName','skills','30888yquXWN','3790275BoyUWW','3381630sEYjbV'];a159_0x2c8f=function(){return _0x28a597;};return a159_0x2c8f();}export function getRuntimeSkillDir(_0x224a90,_0x9a21e8,_0x28146f,_0x2bd54b,_0x229acf,_0x47452c={}){const _0x1d1cc2=a159_0x3c5e;return resolve(getRuntimeSkillCacheRoot(_0x224a90,_0x9a21e8,_0x47452c),safePathSegment(_0x28146f,_0x1d1cc2(0x1c9)),_0x2bd54b,safePathSegment(_0x229acf,'skillCode'));}export function safePathSegment(_0x2dd342,_0x36778d='path\x20segment'){const _0xc079d4=a159_0x3c5e;if(!_0x2dd342||_0x2dd342[_0xc079d4(0x1cb)]('/')||_0x2dd342[_0xc079d4(0x1cb)]('\x5c')||_0x2dd342['includes']('..'))throw CliErrors['validation'](_0xc079d4(0x1c5)+_0x36778d+_0xc079d4(0x1ba)+_0x2dd342);return _0x2dd342;}function trimmedEnv(_0x1b46df){const _0x4393f6=a159_0x3c5e,_0x51a4ba=productEnv(_0x1b46df)?.[_0x4393f6(0x1c7)]();return _0x51a4ba?_0x51a4ba:undefined;}
@@ -1 +1 @@
1
- (function(_0x519097,_0x3128e4){const _0x4618dd=a160_0x5b09,_0x136c30=_0x519097();while(!![]){try{const _0x5aafbd=-parseInt(_0x4618dd(0x1cb))/0x1*(parseInt(_0x4618dd(0x1f0))/0x2)+parseInt(_0x4618dd(0x1e3))/0x3*(parseInt(_0x4618dd(0x1c8))/0x4)+parseInt(_0x4618dd(0x1db))/0x5+-parseInt(_0x4618dd(0x1bd))/0x6+parseInt(_0x4618dd(0x1f9))/0x7+parseInt(_0x4618dd(0x1eb))/0x8+parseInt(_0x4618dd(0x1ed))/0x9;if(_0x5aafbd===_0x3128e4)break;else _0x136c30['push'](_0x136c30['shift']());}catch(_0x20377b){_0x136c30['push'](_0x136c30['shift']());}}}(a160_0x5cda,0x93727));function a160_0x5b09(_0x1fe1d7,_0x704082){_0x1fe1d7=_0x1fe1d7-0x1bd;const _0x5cda91=a160_0x5cda();let _0x5b09db=_0x5cda91[_0x1fe1d7];return _0x5b09db;}import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a160_0x4bfce9}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';function a160_0x5cda(){const _0x2eedf3=['string','targetScope','name','1267288oAzLKt','number','3143286xHMBVw','ignoreInvalidMetadata','builtin','46ZDzDZX','sourceSessionId','ignoreMetadataForPayload','personal','skillName','path','example','pushedAt','\x20name\x20for\x20SkillHub\x20slug\x20generation.','2607801zZAWZl','toLowerCase','boolean','5108718PZXBTZ','some','isFile','validation','packageBase64','ignoreMetadataScope','dir','replace','object','ignoreMetadataSkillCode','(unknown)','4SmuBrG','isSymbolicLink','utf8','39646KbnNJk','Remote\x20Skill\x20','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20','Skill\x20directory\x20not\x20found:\x20','Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20','displayName','ignoreMetadataAppCodeMismatch','match','description','isDirectory','Unable\x20to\x20resolve\x20skillCode\x20from\x20','Missing\x20','find','\x20has\x20unsupported\x20scope\x20\x22','scope','trim','3259295NClCHP','tags','slice','length','isArray','skillCode','unknown',',\x20or\x20directory\x20name.','2505561tKwYRy','startsWith','appCode','content','files'];a160_0x5cda=function(){return _0x2eedf3;};return a160_0x5cda();}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(_0x71e2fe,_0x5d9aae,_0x5d4568={}){const _0x5b4630=a160_0x5b09,_0x5263a7=resolvePushDirectoryRoot(_0x71e2fe),_0x3c499f=readPushMetadataIfPresent(resolve(_0x5263a7,METADATA_FILE),{'ignoreInvalidMetadata':_0x5d4568[_0x5b4630(0x1ee)]});if(_0x3c499f?.[_0x5b4630(0x1e5)]&&_0x3c499f[_0x5b4630(0x1e5)]!==_0x5d9aae&&!_0x5d4568['allowAppCodeRetarget']&&!_0x5d4568[_0x5b4630(0x1d1)])throw CliErrors['validation']('Skill\x20metadata\x20appCode\x20\x22'+_0x3c499f['appCode']+'\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22'+_0x5d9aae+'\x22.');const _0x36ef46=resolvePushSkillCode(_0x5263a7,_0x5d9aae,_0x3c499f,_0x5d4568);if(!_0x36ef46)throw CliErrors['validation'](_0x5b4630(0x1d5)+SKILL_FILE+',\x20'+METADATA_FILE+_0x5b4630(0x1e2));return{'dir':_0x5263a7,'skillCode':_0x36ef46,'metadata':_0x3c499f};}export function readPushDirectory(_0x52d0d8,_0x55db40,_0x30b84f={}){const _0x252771=a160_0x5b09,_0x2968a5=resolvePushDirectoryIdentity(_0x52d0d8,_0x55db40,_0x30b84f),_0x488571=_0x2968a5[_0x252771(0x1c3)],_0x1dcc72=resolve(_0x488571,SKILL_FILE);if(!existsSync(_0x1dcc72)||!lstatSync(_0x1dcc72)[_0x252771(0x1bf)]())throw CliErrors[_0x252771(0x1c0)](_0x252771(0x1d6)+SKILL_FILE+':\x20'+_0x1dcc72);const _0xdc79bc=_0x2968a5['metadata'],_0x120df0=_0x30b84f[_0x252771(0x1e9)]??_0x252771(0x1f3);if(!_0x30b84f[_0x252771(0x1c2)]&&_0xdc79bc?.['scope']===_0x252771(0x1ef))throw CliErrors[_0x252771(0x1c0)](_0x252771(0x1cf)+METADATA_FILE+'\x20has\x20scope=\x22'+_0xdc79bc[_0x252771(0x1d9)]+'\x22.');if(!_0x30b84f[_0x252771(0x1c2)]&&_0x120df0===_0x252771(0x1f3)&&_0xdc79bc?.['scope']&&_0xdc79bc[_0x252771(0x1d9)]!==_0x252771(0x1f3))throw CliErrors[_0x252771(0x1c0)](_0x252771(0x1cd)+METADATA_FILE+'\x20has\x20scope=\x22'+_0xdc79bc['scope']+'\x22.','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20'+_0x488571+'\x20to\x20submit\x20company\x20Skills\x20for\x20review.');const _0x3a8df3=scanSkillDirectory(_0x488571,{'excludedFilePaths':_0x30b84f['excludedFilePaths']}),_0x2e8c49=buildSkillPackage(_0x3a8df3),_0xd49a49=readFileSync(_0x1dcc72,'utf8'),_0x1cc794=_0x2968a5[_0x252771(0x1e0)],_0xd5d2f6=_0x30b84f[_0x252771(0x1f2)]?undefined:_0xdc79bc,_0x509f60=readSkillDisplayName(_0xd49a49);return{'skillCode':_0x1cc794,'metadata':_0xdc79bc,'frontmatterDisplayName':_0x509f60,'input':{'skillCode':_0x1cc794,'skillName':_0x509f60??_0xd5d2f6?.['skillName'],'description':_0xd5d2f6?.[_0x252771(0x1d3)],'content':_0xd49a49,'files':_0x2e8c49['manifest'],'packageBase64':_0x2e8c49[_0x252771(0x1c1)],'tags':_0xd5d2f6?.['tags'],'version':_0xd5d2f6?.['version'],'sourceSessionId':_0xd5d2f6?.[_0x252771(0x1f1)]}};}export function refreshPushDirectoryMetadataFromRemote(_0x5a620d,_0x5f4160,_0x2f21b2,_0x183c92={}){const _0x598f06=a160_0x5b09,_0x7a9b61=resolvePushDirectoryRoot(_0x5a620d),_0x296ffa=readPushMetadataIfPresent(resolve(_0x7a9b61,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x119803=requireRemoteScope(_0x5f4160),_0x44f5e1=readLocalSkillContent(_0x7a9b61),_0x98b50a={..._0x5f4160,'appCode':_0x5f4160['appCode']??_0x2f21b2,'skillName':_0x5f4160[_0x598f06(0x1f4)]??_0x296ffa?.[_0x598f06(0x1f4)],'description':_0x5f4160[_0x598f06(0x1d3)]??_0x296ffa?.[_0x598f06(0x1d3)],'example':_0x5f4160['example']??_0x296ffa?.[_0x598f06(0x1f6)],'tags':Array[_0x598f06(0x1df)](_0x5f4160[_0x598f06(0x1dc)])?_0x5f4160[_0x598f06(0x1dc)]:_0x296ffa?.['tags'],'sourceSessionId':_0x5f4160['sourceSessionId']??_0x296ffa?.[_0x598f06(0x1f1)],'content':_0x5f4160[_0x598f06(0x1e6)]??_0x44f5e1},_0x3a39a1=buildMetadata(_0x98b50a,_0x119803,_0x2f21b2,contentHash(_0x44f5e1),_0x183c92['refreshedAt']);writeJsonAtomic(resolve(_0x7a9b61,METADATA_FILE),_0x3a39a1);}export function recordPushedRuntimeSkill(_0x793179,_0x566e44,_0x5d093e,_0x15fd8d={}){const _0x909a62=a160_0x5b09,_0x18020e=resolvePushDirectoryRoot(_0x793179),_0xc6067f=scanSkillDirectory(_0x18020e),_0x3a9ce0=_0xc6067f[_0x909a62(0x1d7)](_0x5f109f=>_0x5f109f[_0x909a62(0x1f5)]===SKILL_FILE),_0xea6a8a=_0x3a9ce0?fileText(_0x3a9ce0):'',_0x2f97d3=tryNormalizePackageManifest(_0x566e44[_0x909a62(0x1e7)]),_0xd8e5e9={..._0x566e44,'content':_0x566e44[_0x909a62(0x1e6)]??_0xea6a8a,'files':_0x2f97d3},_0x52ed02=_0x2f97d3?normalizeLocalFiles(_0xc6067f)['filter'](_0x26d9ae=>_0x2f97d3[_0x909a62(0x1e7)][_0x909a62(0x1be)](_0x431697=>_0x431697['path']===_0x26d9ae['path'])):undefined,_0x3fe55f=buildMetadata(_0xd8e5e9,_0x15fd8d[_0x909a62(0x1d9)]??'personal',_0x5d093e,contentHash(_0xd8e5e9['content']??''),_0x15fd8d[_0x909a62(0x1f7)],_0x52ed02);writeJsonAtomic(resolve(_0x18020e,METADATA_FILE),_0x3fe55f);}export function deriveSkillCodeFromDirectory(_0x461f51,_0xd0a6ef){const _0x4d4f3f=a160_0x5b09,_0x189731=basename(resolve(_0x461f51)),_0x437180=_0xd0a6ef+'--';return _0x189731[_0x4d4f3f(0x1e4)](_0x437180)?_0x189731[_0x4d4f3f(0x1dd)](_0x437180[_0x4d4f3f(0x1de)]):_0x189731;}function resolvePushSkillCode(_0x47c8e6,_0x1d85c2,_0x3127be,_0x2d170d){const _0x50d038=a160_0x5b09,_0xbb28bd=deriveSkillCodeFromSkillFile(_0x47c8e6)||deriveSkillCodeFromDirectory(_0x47c8e6,_0x1d85c2);if(_0x2d170d[_0x50d038(0x1c6)])return _0xbb28bd;return _0x3127be?.['skillCode']?.[_0x50d038(0x1da)]()||_0xbb28bd;}function deriveSkillCodeFromSkillFile(_0x2c3cd4){const _0x2bc3e6=a160_0x5b09,_0x44aea7=resolve(_0x2c3cd4,SKILL_FILE);if(!existsSync(_0x44aea7)||!lstatSync(_0x44aea7)[_0x2bc3e6(0x1bf)]())return undefined;const _0x261c87=readFileSync(_0x44aea7,_0x2bc3e6(0x1ca)),_0x31d26a=_0x261c87[_0x2bc3e6(0x1d2)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x31d26a)return undefined;const _0x574f0a=parseFrontmatterObject(_0x31d26a[0x1]??''),_0x477a21=scalarToString(_0x574f0a?.[_0x2bc3e6(0x1ea)]);return _0x477a21?slugifySkillName(_0x477a21):undefined;}function readSkillDisplayName(_0x4ad7cd){const _0x4ea083=a160_0x5b09,_0x10f8d8=_0x4ad7cd[_0x4ea083(0x1d2)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x10f8d8)return undefined;const _0x1e20bf=parseFrontmatterObject(_0x10f8d8[0x1]??'');return scalarToString(_0x1e20bf?.[_0x4ea083(0x1d0)]);}function slugifySkillName(_0x343f13){const _0x3f368d=a160_0x5b09,_0x5ee0e3=_0x343f13[_0x3f368d(0x1da)]()[_0x3f368d(0x1fa)]()[_0x3f368d(0x1c4)](/[^\p{L}\p{N}\p{So}]+/gu,'-')[_0x3f368d(0x1c4)](/^-+/,'')['replace'](/-+$/,'')[_0x3f368d(0x1c4)](/-{2,}/g,'-');if(!_0x5ee0e3)throw CliErrors[_0x3f368d(0x1c0)]('Invalid\x20'+SKILL_FILE+_0x3f368d(0x1f8));return _0x5ee0e3;}function parseFrontmatterObject(_0x4b507a){const _0x3e0440=a160_0x5b09;try{const _0x33dd27=a160_0x4bfce9(_0x4b507a);return _0x33dd27&&typeof _0x33dd27===_0x3e0440(0x1c5)&&!Array[_0x3e0440(0x1df)](_0x33dd27)?_0x33dd27:undefined;}catch{return undefined;}}function scalarToString(_0x390be1){const _0x5b7039=a160_0x5b09;if(typeof _0x390be1===_0x5b7039(0x1e8))return _0x390be1[_0x5b7039(0x1da)]();if(typeof _0x390be1===_0x5b7039(0x1ec)||typeof _0x390be1===_0x5b7039(0x1fb))return String(_0x390be1);return undefined;}function resolvePushDirectoryRoot(_0x2aec4c){const _0x208ca5=a160_0x5b09,_0x48b9fa=resolve(_0x2aec4c);if(!existsSync(_0x48b9fa))throw CliErrors['validation'](_0x208ca5(0x1ce)+_0x2aec4c);const _0x5eac01=lstatSync(_0x48b9fa);if(_0x5eac01[_0x208ca5(0x1d4)]())return _0x48b9fa;if(_0x5eac01[_0x208ca5(0x1c9)]()){const _0x177dda=realpathSync(_0x48b9fa);if(lstatSync(_0x177dda)[_0x208ca5(0x1d4)]())return _0x177dda;}throw CliErrors[_0x208ca5(0x1c0)]('Skill\x20directory\x20not\x20found:\x20'+_0x2aec4c);}function requireRemoteScope(_0x3ba88c){const _0x13213b=a160_0x5b09;if(_0x3ba88c[_0x13213b(0x1d9)]==='personal'||_0x3ba88c[_0x13213b(0x1d9)]==='company'||_0x3ba88c[_0x13213b(0x1d9)]==='builtin')return _0x3ba88c[_0x13213b(0x1d9)];throw CliErrors[_0x13213b(0x1c0)](_0x13213b(0x1cc)+(_0x3ba88c[_0x13213b(0x1e0)]||_0x13213b(0x1c7))+_0x13213b(0x1d8)+(_0x3ba88c['scope']??_0x13213b(0x1e1))+'\x22.');}function readLocalSkillContent(_0x4f2901){const _0x10db26=a160_0x5b09,_0x7996f6=resolve(_0x4f2901,SKILL_FILE);return existsSync(_0x7996f6)&&lstatSync(_0x7996f6)['isFile']()?readFileSync(_0x7996f6,_0x10db26(0x1ca)):'';}function readPushMetadataIfPresent(_0x2da55e,_0xc6c4ab={}){try{return readMetadataIfPresent(_0x2da55e);}catch(_0x137b09){if(_0xc6c4ab['ignoreInvalidMetadata'])return undefined;throw _0x137b09;}}
1
+ (function(_0x2b65fc,_0x4da59d){const _0xb5406e=a160_0x2207,_0x3081dd=_0x2b65fc();while(!![]){try{const _0x1f67c5=-parseInt(_0xb5406e(0x166))/0x1+parseInt(_0xb5406e(0x156))/0x2+-parseInt(_0xb5406e(0x169))/0x3*(parseInt(_0xb5406e(0x152))/0x4)+-parseInt(_0xb5406e(0x14a))/0x5*(-parseInt(_0xb5406e(0x170))/0x6)+parseInt(_0xb5406e(0x14b))/0x7+parseInt(_0xb5406e(0x14c))/0x8*(-parseInt(_0xb5406e(0x153))/0x9)+parseInt(_0xb5406e(0x144))/0xa;if(_0x1f67c5===_0x4da59d)break;else _0x3081dd['push'](_0x3081dd['shift']());}catch(_0x6ab1cd){_0x3081dd['push'](_0x3081dd['shift']());}}}(a160_0x36c5,0xc73e7));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a160_0x50084b}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{writeJsonAtomic}from'./fs-utils.js';import{contentHash}from'./hashing.js';import{fileText,normalizeLocalFiles,scanSkillDirectory}from'./local-files.js';import{buildMetadata,readMetadataIfPresent}from'./metadata.js';import{buildSkillPackage,tryNormalizePackageManifest}from'./zip-package.js';export function resolvePushDirectoryIdentity(_0xd4078f,_0x32d64e,_0x59bd61={}){const _0x1111b0=a160_0x2207,_0x4e4865=resolvePushDirectoryRoot(_0xd4078f),_0x123798=readPushMetadataIfPresent(resolve(_0x4e4865,METADATA_FILE),{'ignoreInvalidMetadata':_0x59bd61[_0x1111b0(0x150)]});if(_0x123798?.[_0x1111b0(0x165)]&&_0x123798['appCode']!==_0x32d64e&&!_0x59bd61['allowAppCodeRetarget']&&!_0x59bd61['ignoreMetadataAppCodeMismatch'])throw CliErrors[_0x1111b0(0x172)](_0x1111b0(0x155)+_0x123798[_0x1111b0(0x165)]+'\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22'+_0x32d64e+'\x22.');const _0x3a3a2b=resolvePushSkillCode(_0x4e4865,_0x32d64e,_0x123798,_0x59bd61);if(!_0x3a3a2b)throw CliErrors[_0x1111b0(0x172)](_0x1111b0(0x141)+SKILL_FILE+',\x20'+METADATA_FILE+_0x1111b0(0x161));return{'dir':_0x4e4865,'skillCode':_0x3a3a2b,'metadata':_0x123798};}export function readPushDirectory(_0x9fb146,_0xb9ded0,_0x5287a4={}){const _0x3a745f=a160_0x2207,_0x226b70=resolvePushDirectoryIdentity(_0x9fb146,_0xb9ded0,_0x5287a4),_0x57deee=_0x226b70[_0x3a745f(0x168)],_0x3b0542=resolve(_0x57deee,SKILL_FILE);if(!existsSync(_0x3b0542)||!lstatSync(_0x3b0542)[_0x3a745f(0x16f)]())throw CliErrors[_0x3a745f(0x172)](_0x3a745f(0x171)+SKILL_FILE+':\x20'+_0x3b0542);const _0x5191c8=_0x226b70['metadata'],_0xd95abf=_0x5287a4[_0x3a745f(0x148)]??_0x3a745f(0x15e);if(!_0x5287a4['ignoreMetadataScope']&&_0x5191c8?.[_0x3a745f(0x163)]===_0x3a745f(0x16b))throw CliErrors[_0x3a745f(0x172)](_0x3a745f(0x158)+METADATA_FILE+_0x3a745f(0x15d)+_0x5191c8['scope']+'\x22.');if(!_0x5287a4[_0x3a745f(0x136)]&&_0xd95abf==='personal'&&_0x5191c8?.['scope']&&_0x5191c8[_0x3a745f(0x163)]!==_0x3a745f(0x15e))throw CliErrors['validation']('Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20'+METADATA_FILE+_0x3a745f(0x15d)+_0x5191c8[_0x3a745f(0x163)]+'\x22.',_0x3a745f(0x142)+_0x57deee+'\x20to\x20submit\x20company\x20Skills\x20for\x20review.');const _0x4526b4=scanSkillDirectory(_0x57deee,{'excludedFilePaths':_0x5287a4[_0x3a745f(0x162)]}),_0x5638f2=buildSkillPackage(_0x4526b4),_0x15fd8f=readFileSync(_0x3b0542,_0x3a745f(0x151)),_0x1f9f3b=_0x226b70[_0x3a745f(0x15c)],_0x1d189d=_0x5287a4[_0x3a745f(0x13f)]?undefined:_0x5191c8,_0xc2e18d=readSkillDisplayName(_0x15fd8f);return{'skillCode':_0x1f9f3b,'metadata':_0x5191c8,'frontmatterDisplayName':_0xc2e18d,'input':{'skillCode':_0x1f9f3b,'skillName':_0xc2e18d??_0x1d189d?.[_0x3a745f(0x16a)],'description':_0x1d189d?.['description'],'content':_0x15fd8f,'files':_0x5638f2['manifest'],'packageBase64':_0x5638f2[_0x3a745f(0x147)],'tags':_0x1d189d?.[_0x3a745f(0x15f)],'version':_0x1d189d?.[_0x3a745f(0x13a)],'sourceSessionId':_0x1d189d?.[_0x3a745f(0x14e)]}};}export function refreshPushDirectoryMetadataFromRemote(_0x2c5f0e,_0x5a4de0,_0x479ad9,_0x58210e={}){const _0x1a42b6=a160_0x2207,_0x5236ef=resolvePushDirectoryRoot(_0x2c5f0e),_0x457333=readPushMetadataIfPresent(resolve(_0x5236ef,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x4f3461=requireRemoteScope(_0x5a4de0),_0x139c1b=readLocalSkillContent(_0x5236ef),_0x5d9c1d={..._0x5a4de0,'appCode':_0x5a4de0[_0x1a42b6(0x165)]??_0x479ad9,'skillName':_0x5a4de0['skillName']??_0x457333?.['skillName'],'description':_0x5a4de0[_0x1a42b6(0x139)]??_0x457333?.[_0x1a42b6(0x139)],'example':_0x5a4de0['example']??_0x457333?.['example'],'tags':Array[_0x1a42b6(0x140)](_0x5a4de0[_0x1a42b6(0x15f)])?_0x5a4de0['tags']:_0x457333?.[_0x1a42b6(0x15f)],'sourceSessionId':_0x5a4de0[_0x1a42b6(0x14e)]??_0x457333?.[_0x1a42b6(0x14e)],'content':_0x5a4de0['content']??_0x139c1b},_0x887585=buildMetadata(_0x5d9c1d,_0x4f3461,_0x479ad9,contentHash(_0x139c1b),_0x58210e[_0x1a42b6(0x13e)]);writeJsonAtomic(resolve(_0x5236ef,METADATA_FILE),_0x887585);}export function recordPushedRuntimeSkill(_0xf33c6e,_0x20b91b,_0x45e275,_0x31269d={}){const _0x14e5af=a160_0x2207,_0x125d4a=resolvePushDirectoryRoot(_0xf33c6e),_0x10a766=scanSkillDirectory(_0x125d4a),_0x734190=_0x10a766[_0x14e5af(0x16c)](_0x11ac57=>_0x11ac57[_0x14e5af(0x173)]===SKILL_FILE),_0x3678dd=_0x734190?fileText(_0x734190):'',_0x5b16a2=tryNormalizePackageManifest(_0x20b91b[_0x14e5af(0x14f)]),_0x41a13f={..._0x20b91b,'content':_0x20b91b[_0x14e5af(0x16e)]??_0x3678dd,'files':_0x5b16a2},_0xd658d=_0x5b16a2?normalizeLocalFiles(_0x10a766)[_0x14e5af(0x137)](_0xae6e02=>_0x5b16a2[_0x14e5af(0x14f)]['some'](_0x267cac=>_0x267cac[_0x14e5af(0x173)]===_0xae6e02[_0x14e5af(0x173)])):undefined,_0x9cd1d=buildMetadata(_0x41a13f,_0x31269d['scope']??'personal',_0x45e275,contentHash(_0x41a13f[_0x14e5af(0x16e)]??''),_0x31269d[_0x14e5af(0x159)],_0xd658d);writeJsonAtomic(resolve(_0x125d4a,METADATA_FILE),_0x9cd1d);}function a160_0x2207(_0x184acf,_0x404e0c){_0x184acf=_0x184acf-0x136;const _0x36c532=a160_0x36c5();let _0x2207cf=_0x36c532[_0x184acf];return _0x2207cf;}function a160_0x36c5(){const _0x2a5906=['targetScope','ignoreMetadataSkillCode','5YlHyMB','10005611zLYKmZ','1492696NRytlR','isDirectory','sourceSessionId','files','ignoreInvalidMetadata','utf8','1553452yBPaQj','54EFvVmc','match','Skill\x20metadata\x20appCode\x20\x22','1822256hixtfk','name','Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20','pushedAt','string','startsWith','skillCode','\x20has\x20scope=\x22','personal','tags','(unknown)',',\x20or\x20directory\x20name.','excludedFilePaths','scope','slice','appCode','1408400WHpiVW','number','dir','9YdwJDw','skillName','builtin','find','\x20has\x20unsupported\x20scope\x20\x22','content','isFile','8007966GYkSVL','Missing\x20','validation','path','boolean','replace','ignoreMetadataScope','filter','toLowerCase','description','version','Remote\x20Skill\x20','unknown','displayName','refreshedAt','ignoreMetadataForPayload','isArray','Unable\x20to\x20resolve\x20skillCode\x20from\x20','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20','Skill\x20directory\x20not\x20found:\x20','8339520gVZMbz','trim','object','packageBase64'];a160_0x36c5=function(){return _0x2a5906;};return a160_0x36c5();}export function deriveSkillCodeFromDirectory(_0x4b3d68,_0x38745f){const _0x3c9b01=a160_0x2207,_0xf71cb8=basename(resolve(_0x4b3d68)),_0x29c074=_0x38745f+'--';return _0xf71cb8[_0x3c9b01(0x15b)](_0x29c074)?_0xf71cb8[_0x3c9b01(0x164)](_0x29c074['length']):_0xf71cb8;}function resolvePushSkillCode(_0x38649c,_0x4c1a3b,_0x519240,_0x3295f1){const _0x43f6de=a160_0x2207,_0x4a5f7b=deriveSkillCodeFromSkillFile(_0x38649c)||deriveSkillCodeFromDirectory(_0x38649c,_0x4c1a3b);if(_0x3295f1[_0x43f6de(0x149)])return _0x4a5f7b;return _0x519240?.[_0x43f6de(0x15c)]?.['trim']()||_0x4a5f7b;}function deriveSkillCodeFromSkillFile(_0x156683){const _0x4b803f=a160_0x2207,_0x23f909=resolve(_0x156683,SKILL_FILE);if(!existsSync(_0x23f909)||!lstatSync(_0x23f909)[_0x4b803f(0x16f)]())return undefined;const _0x2933fd=readFileSync(_0x23f909,_0x4b803f(0x151)),_0x40d5a7=_0x2933fd[_0x4b803f(0x154)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x40d5a7)return undefined;const _0x556fc8=parseFrontmatterObject(_0x40d5a7[0x1]??''),_0x36b8a8=scalarToString(_0x556fc8?.[_0x4b803f(0x157)]);return _0x36b8a8?slugifySkillName(_0x36b8a8):undefined;}function readSkillDisplayName(_0x26cd57){const _0x4316a2=a160_0x2207,_0x2c6b28=_0x26cd57['match'](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x2c6b28)return undefined;const _0x7cdb54=parseFrontmatterObject(_0x2c6b28[0x1]??'');return scalarToString(_0x7cdb54?.[_0x4316a2(0x13d)]);}function slugifySkillName(_0x1a1525){const _0x4d3b79=a160_0x2207,_0x2d72cf=_0x1a1525['trim']()[_0x4d3b79(0x138)]()[_0x4d3b79(0x175)](/[^\p{L}\p{N}\p{So}]+/gu,'-')[_0x4d3b79(0x175)](/^-+/,'')[_0x4d3b79(0x175)](/-+$/,'')['replace'](/-{2,}/g,'-');if(!_0x2d72cf)throw CliErrors[_0x4d3b79(0x172)]('Invalid\x20'+SKILL_FILE+'\x20name\x20for\x20SkillHub\x20slug\x20generation.');return _0x2d72cf;}function parseFrontmatterObject(_0x3e1478){const _0x40d436=a160_0x2207;try{const _0x4079f7=a160_0x50084b(_0x3e1478);return _0x4079f7&&typeof _0x4079f7===_0x40d436(0x146)&&!Array[_0x40d436(0x140)](_0x4079f7)?_0x4079f7:undefined;}catch{return undefined;}}function scalarToString(_0xa7b9dc){const _0x6e84c5=a160_0x2207;if(typeof _0xa7b9dc===_0x6e84c5(0x15a))return _0xa7b9dc[_0x6e84c5(0x145)]();if(typeof _0xa7b9dc===_0x6e84c5(0x167)||typeof _0xa7b9dc===_0x6e84c5(0x174))return String(_0xa7b9dc);return undefined;}function resolvePushDirectoryRoot(_0x3acad0){const _0xaeebec=a160_0x2207,_0x8b000=resolve(_0x3acad0);if(!existsSync(_0x8b000))throw CliErrors[_0xaeebec(0x172)]('Skill\x20directory\x20not\x20found:\x20'+_0x3acad0);const _0x3b7920=lstatSync(_0x8b000);if(_0x3b7920[_0xaeebec(0x14d)]())return _0x8b000;if(_0x3b7920['isSymbolicLink']()){const _0x6b0245=realpathSync(_0x8b000);if(lstatSync(_0x6b0245)[_0xaeebec(0x14d)]())return _0x6b0245;}throw CliErrors[_0xaeebec(0x172)](_0xaeebec(0x143)+_0x3acad0);}function requireRemoteScope(_0xa08b16){const _0x175be8=a160_0x2207;if(_0xa08b16[_0x175be8(0x163)]==='personal'||_0xa08b16[_0x175be8(0x163)]==='company'||_0xa08b16['scope']==='builtin')return _0xa08b16['scope'];throw CliErrors[_0x175be8(0x172)](_0x175be8(0x13b)+(_0xa08b16['skillCode']||_0x175be8(0x160))+_0x175be8(0x16d)+(_0xa08b16[_0x175be8(0x163)]??_0x175be8(0x13c))+'\x22.');}function readLocalSkillContent(_0x642e31){const _0x271584=resolve(_0x642e31,SKILL_FILE);return existsSync(_0x271584)&&lstatSync(_0x271584)['isFile']()?readFileSync(_0x271584,'utf8'):'';}function readPushMetadataIfPresent(_0x189bfa,_0x33b490={}){const _0x38dbde=a160_0x2207;try{return readMetadataIfPresent(_0x189bfa);}catch(_0x38420a){if(_0x33b490[_0x38dbde(0x150)])return undefined;throw _0x38420a;}}
@@ -1 +1 @@
1
- function a161_0x3d27(){const _0x13c160=['552008PBCQgY','validation','3wPBIEm','27CZxVrX','personal','Unsupported\x20runtime\x20Skill\x20scope:\x20','2382335YcgJjK','includes','1duQeeM','306355oJIREw','3577892KbHFIG','4165554XxSuaX','12898336ICFUBN','push','477290TyyHXd','company','length'];a161_0x3d27=function(){return _0x13c160;};return a161_0x3d27();}(function(_0x3ed027,_0x59ead8){const _0x3a3b3a=a161_0x38f1,_0x1efc31=_0x3ed027();while(!![]){try{const _0x34f945=-parseInt(_0x3a3b3a(0x158))/0x1*(-parseInt(_0x3a3b3a(0x150))/0x2)+-parseInt(_0x3a3b3a(0x152))/0x3*(-parseInt(_0x3a3b3a(0x15a))/0x4)+parseInt(_0x3a3b3a(0x156))/0x5+parseInt(_0x3a3b3a(0x14a))/0x6+-parseInt(_0x3a3b3a(0x159))/0x7+-parseInt(_0x3a3b3a(0x14b))/0x8+parseInt(_0x3a3b3a(0x153))/0x9*(parseInt(_0x3a3b3a(0x14d))/0xa);if(_0x34f945===_0x59ead8)break;else _0x1efc31['push'](_0x1efc31['shift']());}catch(_0x253788){_0x1efc31['push'](_0x1efc31['shift']());}}}(a161_0x3d27,0xca3ad));import{CliErrors}from'../../errors.js';function a161_0x38f1(_0x431307,_0x296084){_0x431307=_0x431307-0x14a;const _0x3d2739=a161_0x3d27();let _0x38f1a9=_0x3d2739[_0x431307];return _0x38f1a9;}export function normalizeRuntimeSkillScopes(_0x4dff04){const _0x4bef6d=a161_0x38f1,_0x206a3c=_0x4dff04&&_0x4dff04[_0x4bef6d(0x14f)]>0x0?_0x4dff04:[_0x4bef6d(0x154),_0x4bef6d(0x14e),'builtin'],_0x1a5a39=[];for(const _0x3765eb of _0x206a3c){if(!isRuntimeSkillScope(_0x3765eb))throw CliErrors[_0x4bef6d(0x151)](_0x4bef6d(0x155)+_0x3765eb);!_0x1a5a39[_0x4bef6d(0x157)](_0x3765eb)&&_0x1a5a39[_0x4bef6d(0x14c)](_0x3765eb);}return _0x1a5a39;}export function isRuntimeSkillScope(_0x4dae91){const _0x33b9b2=a161_0x38f1;return _0x4dae91==='personal'||_0x4dae91===_0x33b9b2(0x14e)||_0x4dae91==='builtin';}
1
+ (function(_0x5d2037,_0x1cbe95){const _0x41821c=a161_0x515e,_0x330827=_0x5d2037();while(!![]){try{const _0x5766f8=-parseInt(_0x41821c(0x105))/0x1*(-parseInt(_0x41821c(0xfd))/0x2)+parseInt(_0x41821c(0xfb))/0x3+-parseInt(_0x41821c(0x106))/0x4+-parseInt(_0x41821c(0x101))/0x5*(-parseInt(_0x41821c(0x104))/0x6)+parseInt(_0x41821c(0x100))/0x7*(parseInt(_0x41821c(0x103))/0x8)+-parseInt(_0x41821c(0xfa))/0x9+-parseInt(_0x41821c(0xf9))/0xa*(-parseInt(_0x41821c(0xfc))/0xb);if(_0x5766f8===_0x1cbe95)break;else _0x330827['push'](_0x330827['shift']());}catch(_0x11e6d8){_0x330827['push'](_0x330827['shift']());}}}(a161_0x30a4,0x5cbc1));function a161_0x515e(_0xe147e8,_0x91a71c){_0xe147e8=_0xe147e8-0xf8;const _0x30a480=a161_0x30a4();let _0x515eb8=_0x30a480[_0xe147e8];return _0x515eb8;}import{CliErrors}from'../../errors.js';export function normalizeRuntimeSkillScopes(_0xf4bdbf){const _0x1b1f23=a161_0x515e,_0x3b5030=_0xf4bdbf&&_0xf4bdbf['length']>0x0?_0xf4bdbf:['personal',_0x1b1f23(0xff),'builtin'],_0x519a92=[];for(const _0x1fabee of _0x3b5030){if(!isRuntimeSkillScope(_0x1fabee))throw CliErrors[_0x1b1f23(0xfe)](_0x1b1f23(0x107)+_0x1fabee);!_0x519a92['includes'](_0x1fabee)&&_0x519a92[_0x1b1f23(0x108)](_0x1fabee);}return _0x519a92;}export function isRuntimeSkillScope(_0x3de40a){const _0x4f5832=a161_0x515e;return _0x3de40a===_0x4f5832(0x102)||_0x3de40a==='company'||_0x3de40a===_0x4f5832(0xf8);}function a161_0x30a4(){const _0x6702e0=['29380crpqBH','personal','6472xLFKfi','270BRYROz','1dkuOdq','1912548FzHkMS','Unsupported\x20runtime\x20Skill\x20scope:\x20','push','builtin','427610HgGmno','6759045YJZbed','434388lvjoxw','11huDeHW','1150670TVKxOq','validation','company','5033JvTppw'];a161_0x30a4=function(){return _0x6702e0;};return a161_0x30a4();}
@@ -1 +1 @@
1
- const a163_0x5415cb=a163_0x324c;(function(_0x159b96,_0xf2945f){const _0x4d7c1d=a163_0x324c,_0x5babd8=_0x159b96();while(!![]){try{const _0x4084c2=-parseInt(_0x4d7c1d(0x10e))/0x1+-parseInt(_0x4d7c1d(0x104))/0x2*(-parseInt(_0x4d7c1d(0x10b))/0x3)+-parseInt(_0x4d7c1d(0xf8))/0x4+parseInt(_0x4d7c1d(0x102))/0x5*(-parseInt(_0x4d7c1d(0xf9))/0x6)+-parseInt(_0x4d7c1d(0x105))/0x7+-parseInt(_0x4d7c1d(0x101))/0x8*(parseInt(_0x4d7c1d(0x107))/0x9)+parseInt(_0x4d7c1d(0xfa))/0xa*(parseInt(_0x4d7c1d(0x106))/0xb);if(_0x4084c2===_0xf2945f)break;else _0x5babd8['push'](_0x5babd8['shift']());}catch(_0x55a033){_0x5babd8['push'](_0x5babd8['shift']());}}}(a163_0x4d6a,0x283c7));import{unzipSync,zipSync}from'fflate';function a163_0x4d6a(){const _0x3d3553=['object','Runtime\x20Skill\x20package\x20contains\x20directory\x20entry:\x20','endsWith','Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.','1240528gpQQPY','6780xIamDr','validation','262osQurD','631204SKoiKC','1760KYcZgD','9NglYDs','sort','validation_error','1980-01-01T00:00:00.000Z','6681ALqZFT','name','path','304254RjrZOd','entries','1019624McBhMT','162PvjGZV','44630PCPewt','length','from'];a163_0x4d6a=function(){return _0x3d3553;};return a163_0x4d6a();}import{CliErrors}from'../../errors.js';import{compareSkillFiles,fileContent,normalizeLocalFiles,normalizeSkillRelativePath}from'./local-files.js';const ZIP_MTIME=new Date(a163_0x5415cb(0x10a));export function createDeterministicZipPackage(_0x23dba4){const _0x44e5cc=a163_0x5415cb,_0x27d32e={};for(const _0x20755b of normalizeLocalFiles(_0x23dba4)){_0x27d32e[_0x20755b[_0x44e5cc(0x10d)]]=fileContent(_0x20755b);}return Buffer['from'](zipSync(_0x27d32e,{'level':0x0,'mtime':ZIP_MTIME}));}function a163_0x324c(_0x15aff5,_0x17ac32){_0x15aff5=_0x15aff5-0xf7;const _0x4d6a24=a163_0x4d6a();let _0x324c94=_0x4d6a24[_0x15aff5];return _0x324c94;}export function parseZipPackage(_0x471c2b){const _0x56119a=a163_0x5415cb;if(_0x471c2b[_0x56119a(0xfb)]<0x16)throw CliErrors[_0x56119a(0x103)]('Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.');let _0x999578;try{_0x999578=unzipSync(_0x471c2b,{'filter'(_0x582ad3){const _0x5c4716=_0x56119a,_0x3b469b=normalizeSkillRelativePath(_0x582ad3[_0x5c4716(0x10c)]);if(_0x3b469b[_0x5c4716(0xff)]('/'))throw CliErrors[_0x5c4716(0x103)](_0x5c4716(0xfe)+_0x3b469b);return!![];}});}catch(_0x2c532b){if(isRuntimeSkillValidationError(_0x2c532b))throw _0x2c532b;throw CliErrors[_0x56119a(0x103)](_0x56119a(0x100));}return Object[_0x56119a(0xf7)](_0x999578)['map'](([_0x59f77d,_0x32e00a])=>({'path':normalizeSkillRelativePath(_0x59f77d),'bytes':Buffer[_0x56119a(0xfc)](_0x32e00a)}))[_0x56119a(0x108)](compareSkillFiles);}function isRuntimeSkillValidationError(_0x3c57c4){const _0x563073=a163_0x5415cb;return typeof _0x3c57c4===_0x563073(0xfd)&&_0x3c57c4!==null&&'code'in _0x3c57c4&&_0x3c57c4['code']===_0x563073(0x109);}
1
+ const a163_0x4821e1=a163_0x47b9;(function(_0x48b392,_0x4410c9){const _0x187509=a163_0x47b9,_0x189882=_0x48b392();while(!![]){try{const _0x502bc2=parseInt(_0x187509(0x1b5))/0x1+-parseInt(_0x187509(0x1ae))/0x2*(-parseInt(_0x187509(0x1b6))/0x3)+-parseInt(_0x187509(0x1c2))/0x4+-parseInt(_0x187509(0x1b8))/0x5*(parseInt(_0x187509(0x1b1))/0x6)+-parseInt(_0x187509(0x1b0))/0x7+parseInt(_0x187509(0x1af))/0x8*(-parseInt(_0x187509(0x1bb))/0x9)+parseInt(_0x187509(0x1c0))/0xa;if(_0x502bc2===_0x4410c9)break;else _0x189882['push'](_0x189882['shift']());}catch(_0x364417){_0x189882['push'](_0x189882['shift']());}}}(a163_0xa2b1,0x692b9));import{unzipSync,zipSync}from'fflate';import{CliErrors}from'../../errors.js';import{compareSkillFiles,fileContent,normalizeLocalFiles,normalizeSkillRelativePath}from'./local-files.js';const ZIP_MTIME=new Date(a163_0x4821e1(0x1bf));export function createDeterministicZipPackage(_0x49109c){const _0x5dcbc3=a163_0x4821e1,_0x2f9405={};for(const _0x5e0390 of normalizeLocalFiles(_0x49109c)){_0x2f9405[_0x5e0390[_0x5dcbc3(0x1b4)]]=fileContent(_0x5e0390);}return Buffer[_0x5dcbc3(0x1c3)](zipSync(_0x2f9405,{'level':0x0,'mtime':ZIP_MTIME}));}export function parseZipPackage(_0x28d55b){const _0x2cb6a5=a163_0x4821e1;if(_0x28d55b[_0x2cb6a5(0x1b7)]<0x16)throw CliErrors['validation']('Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.');let _0x143976;try{_0x143976=unzipSync(_0x28d55b,{'filter'(_0x3a3471){const _0x2b0721=_0x2cb6a5,_0x388c7d=normalizeSkillRelativePath(_0x3a3471[_0x2b0721(0x1b2)]);if(_0x388c7d['endsWith']('/'))throw CliErrors[_0x2b0721(0x1be)](_0x2b0721(0x1c1)+_0x388c7d);return!![];}});}catch(_0x50b260){if(isRuntimeSkillValidationError(_0x50b260))throw _0x50b260;throw CliErrors[_0x2cb6a5(0x1be)]('Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.');}return Object[_0x2cb6a5(0x1b9)](_0x143976)[_0x2cb6a5(0x1bc)](([_0x15f03c,_0x54e31b])=>({'path':normalizeSkillRelativePath(_0x15f03c),'bytes':Buffer['from'](_0x54e31b)}))[_0x2cb6a5(0x1b3)](compareSkillFiles);}function a163_0x47b9(_0x19874b,_0x21a8a7){_0x19874b=_0x19874b-0x1ae;const _0xa2b195=a163_0xa2b1();let _0x47b926=_0xa2b195[_0x19874b];return _0x47b926;}function a163_0xa2b1(){const _0x5cf6c3=['code','32571ZqoHNB','map','validation_error','validation','1980-01-01T00:00:00.000Z','3013890GbFuXa','Runtime\x20Skill\x20package\x20contains\x20directory\x20entry:\x20','1251164VIVppF','from','object','724PGVSdk','520Ichguy','403235mEhlUm','17862emsigI','name','sort','path','488631QIPynQ','2634KfyPmu','length','120qvEgOs','entries'];a163_0xa2b1=function(){return _0x5cf6c3;};return a163_0xa2b1();}function isRuntimeSkillValidationError(_0x410b13){const _0x4ac99a=a163_0x4821e1;return typeof _0x410b13===_0x4ac99a(0x1c4)&&_0x410b13!==null&&_0x4ac99a(0x1ba)in _0x410b13&&_0x410b13['code']===_0x4ac99a(0x1bd);}
@@ -1 +1 @@
1
- (function(_0x428fec,_0x371fc0){const _0x4cccea=a164_0x643a,_0xb670a4=_0x428fec();while(!![]){try{const _0x3f5555=parseInt(_0x4cccea(0xd4))/0x1*(parseInt(_0x4cccea(0xbb))/0x2)+-parseInt(_0x4cccea(0xcb))/0x3+parseInt(_0x4cccea(0xe9))/0x4*(-parseInt(_0x4cccea(0xe0))/0x5)+parseInt(_0x4cccea(0xec))/0x6*(-parseInt(_0x4cccea(0xe2))/0x7)+-parseInt(_0x4cccea(0xca))/0x8*(-parseInt(_0x4cccea(0xd8))/0x9)+parseInt(_0x4cccea(0xd5))/0xa*(-parseInt(_0x4cccea(0xdd))/0xb)+parseInt(_0x4cccea(0xe7))/0xc;if(_0x3f5555===_0x371fc0)break;else _0xb670a4['push'](_0xb670a4['shift']());}catch(_0xac42e0){_0xb670a4['push'](_0xb670a4['shift']());}}}(a164_0x36cc,0xb8005));import{CliErrors}from'../../errors.js';function a164_0x36cc(){const _0x4cd80f=['\x20in\x20Skill\x20file\x20package.','Runtime\x20Skill\x20file\x20tree\x20sha256\x20is\x20invalid.','Runtime\x20Skill\x20package\x20size\x20mismatch.','path','has','422536DGgawc','546426evMRJE','size','toLowerCase','sha256','zipSha256','files','Missing\x20','Runtime\x20Skill\x20manifest\x20is\x20missing\x20','get','50961afEMzU','20lhcYxQ','Runtime\x20Skill\x20package\x20entry\x20list\x20mismatch.','requireOssPath','18evwyki','some','treeSha256','toString','object','4860196bTsRMF','validation','ossPath','65AECLDM','length','1874320CxOcBa','push','base64','Runtime\x20Skill\x20package\x20sha256\x20is\x20invalid.','schemaVersion','28007508moxhux','isSafeInteger','41708ejSccO','string','Runtime\x20Skill\x20package\x20file\x20sha256\x20mismatch:\x20','12IzYstf','Runtime\x20Skill\x20package\x20size\x20is\x20invalid.','2DiuPhU','map','trim','Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.','zipSize','Runtime\x20Skill\x20package\x20is\x20required\x20for\x20Skill\x20install:\x20','isArray','Runtime\x20Skill\x20package\x20is\x20missing\x20','bytes','set'];a164_0x36cc=function(){return _0x4cd80f;};return a164_0x36cc();}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(_0xed422b){const _0x5e0872=a164_0x643a,_0x2abb97=normalizeLocalFiles(_0xed422b);if(!_0x2abb97[_0x5e0872(0xd9)](_0xb73e8d=>_0xb73e8d[_0x5e0872(0xc8)]===SKILL_FILE))throw CliErrors[_0x5e0872(0xde)](_0x5e0872(0xd1)+SKILL_FILE+_0x5e0872(0xc5));const _0x45ad94=localFilesToManifestFiles(_0x2abb97),_0x52903e=createDeterministicZipPackage(_0x2abb97);return{'manifest':{'schemaVersion':0x2,'treeSha256':fileTreeHash(_0x45ad94),'zipSha256':bufferSha256(_0x52903e),'zipSize':_0x52903e['length'],'files':_0x45ad94},'packageBytes':_0x52903e,'packageBase64':_0x52903e[_0x5e0872(0xdb)](_0x5e0872(0xe4))};}export function verifyRuntimeSkillPackage(_0x30b26d,_0x17eac0){const _0x3905a6=a164_0x643a,_0x5c1a48=normalizePackageManifest(_0x30b26d,{'requireOssPath':![]});if(!_0x5c1a48)throw CliErrors[_0x3905a6(0xde)]('Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.');return extractAndVerifyPackage(_0x5c1a48,_0x17eac0);}function a164_0x643a(_0x4de038,_0x955b20){_0x4de038=_0x4de038-0xbb;const _0x36cc85=a164_0x36cc();let _0x643a28=_0x36cc85[_0x4de038];return _0x643a28;}export function verifyRuntimeSkillBundle(_0x2f59bb,_0x3627ed){const _0x537bab=a164_0x643a,_0x1a2186=normalizePackageManifest(_0x2f59bb,{'requireOssPath':![]});if(!_0x1a2186)throw CliErrors['validation'](_0x537bab(0xbe));return extractAndVerifyPackageFiles(_0x1a2186,_0x3627ed);}export function tryNormalizePackageManifest(_0x53eba6){return normalizePackageManifest(_0x53eba6,{'requireOssPath':![]});}export function requirePackageBytes(_0x29ad6b,_0x155e06){const _0x157dea=a164_0x643a;if(!_0x155e06||_0x155e06[_0x157dea(0xe1)]===0x0)throw CliErrors[_0x157dea(0xde)](_0x157dea(0xc0)+_0x29ad6b);return _0x155e06;}export function extractDownloadedPackage(_0x192022){const _0x230551=a164_0x643a,_0x4019ad=parseZipPackage(_0x192022)[_0x230551(0xbc)](_0x3b3c6f=>({'path':_0x3b3c6f[_0x230551(0xc8)],'bytes':_0x3b3c6f[_0x230551(0xc3)]}));if(!_0x4019ad['some'](_0x2cc40e=>_0x2cc40e[_0x230551(0xc8)]===SKILL_FILE))throw CliErrors[_0x230551(0xde)](_0x230551(0xc2)+SKILL_FILE+'.');return normalizeLocalFiles(_0x4019ad);}export function localFilesToManifestFiles(_0x2f4a23){const _0x58c000=a164_0x643a;return normalizeLocalFiles(_0x2f4a23)[_0x58c000(0xbc)](_0x430173=>({'path':_0x430173['path'],'sha256':fileHash(_0x430173),'size':fileContent(_0x430173)[_0x58c000(0xe1)]}));}function normalizePackageManifest(_0x38ec01,_0x36631c){const _0x521e5f=a164_0x643a;if(!_0x38ec01||typeof _0x38ec01!==_0x521e5f(0xdc)||Array['isArray'](_0x38ec01))return undefined;const _0x569372=_0x38ec01,_0x3125a1=typeof _0x569372[_0x521e5f(0xdf)]===_0x521e5f(0xea)?_0x569372[_0x521e5f(0xdf)][_0x521e5f(0xbd)]():undefined;if(_0x36631c[_0x521e5f(0xd7)]&&!_0x3125a1)return undefined;if(!Array[_0x521e5f(0xc1)](_0x569372[_0x521e5f(0xd0)])||_0x569372['files'][_0x521e5f(0xe1)]===0x0)return undefined;if(!isSha256Hex(_0x569372[_0x521e5f(0xda)]))throw CliErrors[_0x521e5f(0xde)](_0x521e5f(0xc6));if(!isSha256Hex(_0x569372['zipSha256']))throw CliErrors[_0x521e5f(0xde)](_0x521e5f(0xe5));if(!Number[_0x521e5f(0xe8)](_0x569372[_0x521e5f(0xbf)])||_0x569372[_0x521e5f(0xbf)]<0x0)throw CliErrors[_0x521e5f(0xde)](_0x521e5f(0xed));const _0x3752f0=normalizeManifestFiles(_0x569372[_0x521e5f(0xd0)]);if(!_0x3752f0[_0x521e5f(0xd9)](_0x396903=>_0x396903['path']===SKILL_FILE))throw CliErrors[_0x521e5f(0xde)](_0x521e5f(0xd2)+SKILL_FILE+'.');const _0x21543d=fileTreeHash(_0x3752f0);if(_0x21543d!==_0x569372['treeSha256'][_0x521e5f(0xcd)]())throw CliErrors[_0x521e5f(0xde)]('Runtime\x20Skill\x20file\x20tree\x20sha256\x20mismatch.');return{'schemaVersion':Number[_0x521e5f(0xe8)](_0x569372[_0x521e5f(0xe6)])?_0x569372[_0x521e5f(0xe6)]:0x2,'ossPath':_0x3125a1,'treeSha256':_0x21543d,'zipSha256':_0x569372['zipSha256']['toLowerCase'](),'zipSize':_0x569372[_0x521e5f(0xbf)],'files':_0x3752f0};}function extractAndVerifyPackage(_0x386682,_0xaf86ab){const _0x5337d1=a164_0x643a,_0x4c70c9=normalizePackageManifest(_0x386682,{'requireOssPath':![]});if(!_0x4c70c9)throw CliErrors[_0x5337d1(0xde)]('Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.');if(_0xaf86ab[_0x5337d1(0xe1)]!==_0x4c70c9[_0x5337d1(0xbf)])throw CliErrors[_0x5337d1(0xde)](_0x5337d1(0xc7));const _0x5b17d8=bufferSha256(_0xaf86ab);if(_0x5b17d8!==_0x4c70c9[_0x5337d1(0xcf)])throw CliErrors[_0x5337d1(0xde)]('Runtime\x20Skill\x20package\x20sha256\x20mismatch.');return extractAndVerifyPackageFiles(_0x4c70c9,_0xaf86ab);}function extractAndVerifyPackageFiles(_0x503066,_0x4de958){const _0x546a24=a164_0x643a,_0x256160=parseZipPackage(_0x4de958);if(_0x256160['length']!==_0x503066[_0x546a24(0xd0)][_0x546a24(0xe1)])throw CliErrors['validation'](_0x546a24(0xd6));const _0x40dccb=new Map();for(const _0x5d39e1 of _0x256160){if(_0x40dccb[_0x546a24(0xc9)](_0x5d39e1[_0x546a24(0xc8)]))throw CliErrors[_0x546a24(0xde)]('Duplicate\x20Skill\x20package\x20entry:\x20'+_0x5d39e1[_0x546a24(0xc8)]);_0x40dccb[_0x546a24(0xc4)](_0x5d39e1[_0x546a24(0xc8)],_0x5d39e1);}const _0x370f5c=[];for(const _0x344bc7 of _0x503066[_0x546a24(0xd0)]){const _0x303e90=_0x40dccb[_0x546a24(0xd3)](_0x344bc7['path']);if(!_0x303e90)throw CliErrors[_0x546a24(0xde)]('Runtime\x20Skill\x20package\x20is\x20missing\x20entry:\x20'+_0x344bc7['path']);if(_0x303e90[_0x546a24(0xc3)][_0x546a24(0xe1)]!==_0x344bc7[_0x546a24(0xcc)])throw CliErrors[_0x546a24(0xde)]('Runtime\x20Skill\x20package\x20file\x20size\x20mismatch:\x20'+_0x344bc7['path']);const _0x8853eb=bufferSha256(_0x303e90['bytes']);if(_0x8853eb!==_0x344bc7[_0x546a24(0xce)])throw CliErrors[_0x546a24(0xde)](_0x546a24(0xeb)+_0x344bc7[_0x546a24(0xc8)]);_0x370f5c[_0x546a24(0xe3)]({'path':_0x344bc7['path'],'bytes':_0x303e90[_0x546a24(0xc3)]});}return normalizeLocalFiles(_0x370f5c);}
1
+ (function(_0x526e68,_0x1f9512){const _0x3ba879=a164_0x9fec,_0x523ac8=_0x526e68();while(!![]){try{const _0x286909=-parseInt(_0x3ba879(0x18e))/0x1*(-parseInt(_0x3ba879(0x185))/0x2)+-parseInt(_0x3ba879(0x17d))/0x3*(parseInt(_0x3ba879(0x188))/0x4)+-parseInt(_0x3ba879(0x199))/0x5*(-parseInt(_0x3ba879(0x176))/0x6)+-parseInt(_0x3ba879(0x19b))/0x7+parseInt(_0x3ba879(0x19a))/0x8*(-parseInt(_0x3ba879(0x18b))/0x9)+parseInt(_0x3ba879(0x197))/0xa+-parseInt(_0x3ba879(0x191))/0xb*(-parseInt(_0x3ba879(0x19c))/0xc);if(_0x286909===_0x1f9512)break;else _0x523ac8['push'](_0x523ac8['shift']());}catch(_0x2f7428){_0x523ac8['push'](_0x523ac8['shift']());}}}(a164_0x18d8,0x199ea));import{CliErrors}from'../../errors.js';import{SKILL_FILE}from'./constants.js';function a164_0x9fec(_0x5e94dd,_0x55a7ec){_0x5e94dd=_0x5e94dd-0x16d;const _0x18d80d=a164_0x18d8();let _0x9fec06=_0x18d80d[_0x5e94dd];return _0x9fec06;}import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';import{fileContent,isSha256Hex,normalizeLocalFiles,normalizeManifestFiles}from'./local-files.js';function a164_0x18d8(){const _0x2c8446=['63769gXyKLc','push','Missing\x20','220fFSgzF','Runtime\x20Skill\x20file\x20tree\x20sha256\x20is\x20invalid.','Runtime\x20Skill\x20package\x20file\x20size\x20mismatch:\x20','Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.','Runtime\x20Skill\x20package\x20sha256\x20is\x20invalid.','Runtime\x20Skill\x20manifest\x20is\x20missing\x20','597650MUFAsN','files','35oWOzYK','1362776UsLFXd','1279880QsQXAx','180672LRxlCn','zipSize','map','treeSha256','validation','Runtime\x20Skill\x20package\x20size\x20mismatch.','sha256','ossPath','isSafeInteger','schemaVersion','Runtime\x20Skill\x20file\x20tree\x20sha256\x20mismatch.','70674NMEqlX','Runtime\x20Skill\x20package\x20is\x20missing\x20entry:\x20','Runtime\x20Skill\x20package\x20entry\x20list\x20mismatch.','size','Runtime\x20Skill\x20package\x20is\x20missing\x20','some','Runtime\x20Skill\x20package\x20file\x20sha256\x20mismatch:\x20','24NUVlgU','\x20in\x20Skill\x20file\x20package.','string','isArray','base64','Runtime\x20Skill\x20package\x20size\x20is\x20invalid.','zipSha256','bytes','6hEYelt','has','path','88260asvsBh','Runtime\x20Skill\x20package\x20sha256\x20mismatch.','length','9YLaXaK','toLowerCase','object'];a164_0x18d8=function(){return _0x2c8446;};return a164_0x18d8();}import{createDeterministicZipPackage,parseZipPackage}from'./zip-codec.js';export function buildSkillPackage(_0x522003){const _0x3e783f=a164_0x9fec,_0x56906b=normalizeLocalFiles(_0x522003);if(!_0x56906b[_0x3e783f(0x17b)](_0x3af88f=>_0x3af88f[_0x3e783f(0x187)]===SKILL_FILE))throw CliErrors['validation'](_0x3e783f(0x190)+SKILL_FILE+_0x3e783f(0x17e));const _0x518b19=localFilesToManifestFiles(_0x56906b),_0x110b59=createDeterministicZipPackage(_0x56906b);return{'manifest':{'schemaVersion':0x2,'treeSha256':fileTreeHash(_0x518b19),'zipSha256':bufferSha256(_0x110b59),'zipSize':_0x110b59[_0x3e783f(0x18a)],'files':_0x518b19},'packageBytes':_0x110b59,'packageBase64':_0x110b59['toString'](_0x3e783f(0x181))};}export function verifyRuntimeSkillPackage(_0xc33501,_0x42ec07){const _0x3af120=a164_0x9fec,_0xa112b9=normalizePackageManifest(_0xc33501,{'requireOssPath':![]});if(!_0xa112b9)throw CliErrors['validation'](_0x3af120(0x194));return extractAndVerifyPackage(_0xa112b9,_0x42ec07);}export function verifyRuntimeSkillBundle(_0x59dd0e,_0x1b4488){const _0x3811aa=a164_0x9fec,_0x4e5d1f=normalizePackageManifest(_0x59dd0e,{'requireOssPath':![]});if(!_0x4e5d1f)throw CliErrors[_0x3811aa(0x16f)](_0x3811aa(0x194));return extractAndVerifyPackageFiles(_0x4e5d1f,_0x1b4488);}export function tryNormalizePackageManifest(_0x4d32cd){return normalizePackageManifest(_0x4d32cd,{'requireOssPath':![]});}export function requirePackageBytes(_0x38aefb,_0xf0621e){if(!_0xf0621e||_0xf0621e['length']===0x0)throw CliErrors['validation']('Runtime\x20Skill\x20package\x20is\x20required\x20for\x20Skill\x20install:\x20'+_0x38aefb);return _0xf0621e;}export function extractDownloadedPackage(_0x2fa1ce){const _0x48847d=a164_0x9fec,_0x231fb3=parseZipPackage(_0x2fa1ce)[_0x48847d(0x16d)](_0x564632=>({'path':_0x564632[_0x48847d(0x187)],'bytes':_0x564632[_0x48847d(0x184)]}));if(!_0x231fb3[_0x48847d(0x17b)](_0x4e92f3=>_0x4e92f3[_0x48847d(0x187)]===SKILL_FILE))throw CliErrors[_0x48847d(0x16f)](_0x48847d(0x17a)+SKILL_FILE+'.');return normalizeLocalFiles(_0x231fb3);}export function localFilesToManifestFiles(_0x12acad){const _0x44dce1=a164_0x9fec;return normalizeLocalFiles(_0x12acad)[_0x44dce1(0x16d)](_0x1ea1bf=>({'path':_0x1ea1bf[_0x44dce1(0x187)],'sha256':fileHash(_0x1ea1bf),'size':fileContent(_0x1ea1bf)['length']}));}function normalizePackageManifest(_0x216450,_0x32cdbf){const _0x29b8a2=a164_0x9fec;if(!_0x216450||typeof _0x216450!==_0x29b8a2(0x18d)||Array[_0x29b8a2(0x180)](_0x216450))return undefined;const _0x34546f=_0x216450,_0x6b493d=typeof _0x34546f['ossPath']===_0x29b8a2(0x17f)?_0x34546f[_0x29b8a2(0x172)]['trim']():undefined;if(_0x32cdbf['requireOssPath']&&!_0x6b493d)return undefined;if(!Array[_0x29b8a2(0x180)](_0x34546f[_0x29b8a2(0x198)])||_0x34546f[_0x29b8a2(0x198)][_0x29b8a2(0x18a)]===0x0)return undefined;if(!isSha256Hex(_0x34546f[_0x29b8a2(0x16e)]))throw CliErrors['validation'](_0x29b8a2(0x192));if(!isSha256Hex(_0x34546f[_0x29b8a2(0x183)]))throw CliErrors[_0x29b8a2(0x16f)](_0x29b8a2(0x195));if(!Number[_0x29b8a2(0x173)](_0x34546f[_0x29b8a2(0x19d)])||_0x34546f[_0x29b8a2(0x19d)]<0x0)throw CliErrors[_0x29b8a2(0x16f)](_0x29b8a2(0x182));const _0x3e3fdd=normalizeManifestFiles(_0x34546f['files']);if(!_0x3e3fdd[_0x29b8a2(0x17b)](_0x3d1868=>_0x3d1868['path']===SKILL_FILE))throw CliErrors[_0x29b8a2(0x16f)](_0x29b8a2(0x196)+SKILL_FILE+'.');const _0x885f82=fileTreeHash(_0x3e3fdd);if(_0x885f82!==_0x34546f[_0x29b8a2(0x16e)]['toLowerCase']())throw CliErrors[_0x29b8a2(0x16f)](_0x29b8a2(0x175));return{'schemaVersion':Number[_0x29b8a2(0x173)](_0x34546f[_0x29b8a2(0x174)])?_0x34546f[_0x29b8a2(0x174)]:0x2,'ossPath':_0x6b493d,'treeSha256':_0x885f82,'zipSha256':_0x34546f[_0x29b8a2(0x183)][_0x29b8a2(0x18c)](),'zipSize':_0x34546f[_0x29b8a2(0x19d)],'files':_0x3e3fdd};}function extractAndVerifyPackage(_0x34bf4d,_0x173efb){const _0x3e130b=a164_0x9fec,_0x4489c6=normalizePackageManifest(_0x34bf4d,{'requireOssPath':![]});if(!_0x4489c6)throw CliErrors[_0x3e130b(0x16f)](_0x3e130b(0x194));if(_0x173efb[_0x3e130b(0x18a)]!==_0x4489c6['zipSize'])throw CliErrors['validation'](_0x3e130b(0x170));const _0x2a5d01=bufferSha256(_0x173efb);if(_0x2a5d01!==_0x4489c6['zipSha256'])throw CliErrors[_0x3e130b(0x16f)](_0x3e130b(0x189));return extractAndVerifyPackageFiles(_0x4489c6,_0x173efb);}function extractAndVerifyPackageFiles(_0x1369c4,_0x469566){const _0x3f82bd=a164_0x9fec,_0x4e9e7f=parseZipPackage(_0x469566);if(_0x4e9e7f['length']!==_0x1369c4[_0x3f82bd(0x198)][_0x3f82bd(0x18a)])throw CliErrors[_0x3f82bd(0x16f)](_0x3f82bd(0x178));const _0x396937=new Map();for(const _0x433fec of _0x4e9e7f){if(_0x396937[_0x3f82bd(0x186)](_0x433fec[_0x3f82bd(0x187)]))throw CliErrors[_0x3f82bd(0x16f)]('Duplicate\x20Skill\x20package\x20entry:\x20'+_0x433fec[_0x3f82bd(0x187)]);_0x396937['set'](_0x433fec[_0x3f82bd(0x187)],_0x433fec);}const _0x33b67d=[];for(const _0x2565d4 of _0x1369c4['files']){const _0x2d1796=_0x396937['get'](_0x2565d4[_0x3f82bd(0x187)]);if(!_0x2d1796)throw CliErrors[_0x3f82bd(0x16f)](_0x3f82bd(0x177)+_0x2565d4[_0x3f82bd(0x187)]);if(_0x2d1796[_0x3f82bd(0x184)][_0x3f82bd(0x18a)]!==_0x2565d4[_0x3f82bd(0x179)])throw CliErrors[_0x3f82bd(0x16f)](_0x3f82bd(0x193)+_0x2565d4['path']);const _0x513359=bufferSha256(_0x2d1796[_0x3f82bd(0x184)]);if(_0x513359!==_0x2565d4[_0x3f82bd(0x171)])throw CliErrors['validation'](_0x3f82bd(0x17c)+_0x2565d4[_0x3f82bd(0x187)]);_0x33b67d[_0x3f82bd(0x18f)]({'path':_0x2565d4[_0x3f82bd(0x187)],'bytes':_0x2d1796[_0x3f82bd(0x184)]});}return normalizeLocalFiles(_0x33b67d);}
@@ -1 +1 @@
1
- (function(_0x28b267,_0x173b07){var _0x67f9c9=a165_0x876f,_0x3240f0=_0x28b267();while(!![]){try{var _0x97bda3=parseInt(_0x67f9c9(0xbe))/0x1*(-parseInt(_0x67f9c9(0xbc))/0x2)+parseInt(_0x67f9c9(0xc7))/0x3*(-parseInt(_0x67f9c9(0xc2))/0x4)+-parseInt(_0x67f9c9(0xc0))/0x5*(parseInt(_0x67f9c9(0xc1))/0x6)+parseInt(_0x67f9c9(0xbb))/0x7*(parseInt(_0x67f9c9(0xc6))/0x8)+parseInt(_0x67f9c9(0xba))/0x9*(-parseInt(_0x67f9c9(0xbd))/0xa)+parseInt(_0x67f9c9(0xc4))/0xb*(-parseInt(_0x67f9c9(0xc5))/0xc)+parseInt(_0x67f9c9(0xc3))/0xd*(parseInt(_0x67f9c9(0xbf))/0xe);if(_0x97bda3===_0x173b07)break;else _0x3240f0['push'](_0x3240f0['shift']());}catch(_0xd42fb1){_0x3240f0['push'](_0x3240f0['shift']());}}}(a165_0x3559,0x721cf));export{contentHash,fileTreeHash}from'./runtime-skill-sync/hashing.js';export{linkEffectiveRuntimeSkills,linkGlobalRuntimeSkills,pruneStaleRuntimeSkillCache,pruneStaleRuntimeSkillLinks}from'./runtime-skill-sync/links.js';export{resolveRuntimeSkillInstallTarget}from'./runtime-skill-sync/install-target.js';export{listLocalRuntimeSkills}from'./runtime-skill-sync/list-local.js';function a165_0x876f(_0x4c5d7e,_0x4977fb){_0x4c5d7e=_0x4c5d7e-0xba;var _0x3559dd=a165_0x3559();var _0x876f2a=_0x3559dd[_0x4c5d7e];return _0x876f2a;}function a165_0x3559(){var _0x3f91f6=['26658asHaFu','4421683mwMOgZ','547574KFAibR','1690BmZsAD','3IGImwB','14TEAsFl','20mIoPtZ','72324bummMo','234796cGrUaJ','26818753ByRRZA','22DixTmA','3029364OOOKSN','8egubsE','18bHQcaq'];a165_0x3559=function(){return _0x3f91f6;};return a165_0x3559();}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
+ (function(_0x3fa34a,_0x5d25ad){var _0x469c56=a165_0x4f6b,_0x3a7073=_0x3fa34a();while(!![]){try{var _0x2a40d3=parseInt(_0x469c56(0x1e5))/0x1+-parseInt(_0x469c56(0x1eb))/0x2*(-parseInt(_0x469c56(0x1e3))/0x3)+parseInt(_0x469c56(0x1e6))/0x4+parseInt(_0x469c56(0x1ec))/0x5+parseInt(_0x469c56(0x1e8))/0x6+-parseInt(_0x469c56(0x1e7))/0x7*(parseInt(_0x469c56(0x1ea))/0x8)+parseInt(_0x469c56(0x1e9))/0x9*(-parseInt(_0x469c56(0x1e4))/0xa);if(_0x2a40d3===_0x5d25ad)break;else _0x3a7073['push'](_0x3a7073['shift']());}catch(_0x120a2f){_0x3a7073['push'](_0x3a7073['shift']());}}}(a165_0x3a9a,0x257a5));export{contentHash,fileTreeHash}from'./runtime-skill-sync/hashing.js';export{linkEffectiveRuntimeSkills,linkGlobalRuntimeSkills,pruneStaleRuntimeSkillCache,pruneStaleRuntimeSkillLinks}from'./runtime-skill-sync/links.js';export{resolveRuntimeSkillInstallTarget}from'./runtime-skill-sync/install-target.js';export{listLocalRuntimeSkills}from'./runtime-skill-sync/list-local.js';function a165_0x4f6b(_0x1f3207,_0x50c79c){_0x1f3207=_0x1f3207-0x1e3;var _0x3a9a6f=a165_0x3a9a();var _0x4f6b71=_0x3a9a6f[_0x1f3207];return _0x4f6b71;}function a165_0x3a9a(){var _0x49757c=['11038VlTFgl','821560yOJlgx','45NUBGag','5540ZuKBzk','130586ecIUHm','392880nkWYpb','3171WfRvEe','1541136MkRrkV','7173NwhGgd','2432SySqLF'];a165_0x3a9a=function(){return _0x49757c;};return a165_0x3a9a();}export{materializeRuntimeSkill,reuseMaterializedRuntimeSkill}from'./runtime-skill-sync/materialize.js';export{readMetadataIfPresent}from'./runtime-skill-sync/metadata.js';export{getRuntimeSkillCacheRoot,getRuntimeSkillDir,resolveSkillSyncPaths,runtimeAgentSkillRoots}from'./runtime-skill-sync/paths.js';export{deriveSkillCodeFromDirectory,readPushDirectory,refreshPushDirectoryMetadataFromRemote,recordPushedRuntimeSkill,resolvePushDirectoryIdentity}from'./runtime-skill-sync/push.js';export{buildSkillPackage,verifyRuntimeSkillBundle,verifyRuntimeSkillPackage}from'./runtime-skill-sync/zip-package.js';
@@ -1 +1 @@
1
- const a166_0x1d1c0f=a166_0x56e6;function a166_0x56e6(_0x55c350,_0x52c72f){_0x55c350=_0x55c350-0x147;const _0x2580e4=a166_0x2580();let _0x56e673=_0x2580e4[_0x55c350];return _0x56e673;}(function(_0x3c85c5,_0x3ee470){const _0xd171af=a166_0x56e6,_0x4579c7=_0x3c85c5();while(!![]){try{const _0x27d57a=parseInt(_0xd171af(0x147))/0x1+parseInt(_0xd171af(0x158))/0x2*(-parseInt(_0xd171af(0x162))/0x3)+-parseInt(_0xd171af(0x163))/0x4+-parseInt(_0xd171af(0x14a))/0x5*(-parseInt(_0xd171af(0x148))/0x6)+-parseInt(_0xd171af(0x166))/0x7*(parseInt(_0xd171af(0x14b))/0x8)+-parseInt(_0xd171af(0x152))/0x9+parseInt(_0xd171af(0x15c))/0xa;if(_0x27d57a===_0x3ee470)break;else _0x4579c7['push'](_0x4579c7['shift']());}catch(_0x2e7431){_0x4579c7['push'](_0x4579c7['shift']());}}}(a166_0x2580,0x7e8ef));import{existsSync,readFileSync}from'node:fs';function a166_0x2580(){const _0x3395a3=['recorded','4921911JNHurj','\x20has\x20no\x20skills\x20map','present','.agents','home','\x20is\x20unreadable:\x20','404VgnUrJ','not-recorded','kind','find','6719840nZZTtb','utf8','absent','unverifiable','unusable','parse','4251tJQBrM','1206952jGmfkC','version','.skill-lock.json','14000nVYgdz','.claude','\x22\x20but\x20no\x20SKILL.md\x20was\x20found\x20in\x20known\x20layouts\x20','lockFile','object','865884eYhnSw','6nMOkzr','globalSkillsDirs','686830uUgwbu','88skrxcJ','\x20uses\x20unsupported\x20version\x20','skills','map','SKILL.md','includes'];a166_0x2580=function(){return _0x3395a3;};return a166_0x2580();}import{homedir}from'node:os';import{join}from'node:path';export const SKILL_LOCK_RELATIVE_PATH=join(a166_0x1d1c0f(0x155),a166_0x1d1c0f(0x165));export const GLOBAL_SKILLS_DIR_RELATIVE_PATHS=[join(a166_0x1d1c0f(0x155),a166_0x1d1c0f(0x14d)),join(a166_0x1d1c0f(0x167),'skills')];const SUPPORTED_LOCK_VERSIONS=[0x3];function readLockLookup(_0x559327,_0x42afe4){const _0x51136b=a166_0x1d1c0f;if(!existsSync(_0x559327))return{'kind':'not-recorded'};let _0x868ae0;try{_0x868ae0=JSON[_0x51136b(0x161)](readFileSync(_0x559327,_0x51136b(0x15d)));}catch(_0x57e4a4){return{'kind':_0x51136b(0x160),'reason':_0x559327+_0x51136b(0x157)+_0x57e4a4['message']};}const _0x19e92e=_0x868ae0;if(typeof _0x19e92e?.['version']!=='number'||!SUPPORTED_LOCK_VERSIONS[_0x51136b(0x150)](_0x19e92e[_0x51136b(0x164)]))return{'kind':'unusable','reason':_0x559327+_0x51136b(0x14c)+String(_0x19e92e?.[_0x51136b(0x164)])};if(!_0x19e92e[_0x51136b(0x14d)]||typeof _0x19e92e[_0x51136b(0x14d)]!==_0x51136b(0x16a))return{'kind':_0x51136b(0x160),'reason':_0x559327+_0x51136b(0x153)};return _0x19e92e['skills'][_0x42afe4]?{'kind':_0x51136b(0x151)}:{'kind':_0x51136b(0x159)};}export function resolveInstalledSkill(_0x2886be,_0x36bd7b){const _0x1e936f=a166_0x1d1c0f,_0x4511cb=_0x36bd7b?.[_0x1e936f(0x156)]??homedir(),_0x13dd9d=_0x36bd7b?.[_0x1e936f(0x149)]??GLOBAL_SKILLS_DIR_RELATIVE_PATHS[_0x1e936f(0x14e)](_0x375363=>join(_0x4511cb,_0x375363)),_0x256baf=_0x36bd7b?.[_0x1e936f(0x169)]??join(_0x4511cb,SKILL_LOCK_RELATIVE_PATH),_0x424f31=_0x13dd9d[_0x1e936f(0x14e)](_0x23143d=>join(_0x23143d,_0x2886be,_0x1e936f(0x14f))),_0x5a4ee7=_0x424f31[_0x1e936f(0x15b)](_0x28e3bf=>existsSync(_0x28e3bf));if(_0x5a4ee7)return{'state':_0x1e936f(0x154),'path':_0x5a4ee7};const _0x5d91a3=readLockLookup(_0x256baf,_0x2886be);if(_0x5d91a3[_0x1e936f(0x15a)]===_0x1e936f(0x160))return{'state':_0x1e936f(0x15f),'reason':_0x5d91a3['reason']};if(_0x5d91a3[_0x1e936f(0x15a)]===_0x1e936f(0x151))return{'state':'unverifiable','reason':_0x256baf+'\x20records\x20\x22'+_0x2886be+_0x1e936f(0x168)+('('+_0x424f31['join'](',\x20')+')')};return{'state':_0x1e936f(0x15e),'checked':_0x424f31};}
1
+ const a166_0x3648dc=a166_0x30d0;function a166_0x30d0(_0x3b6975,_0x926d76){_0x3b6975=_0x3b6975-0x9d;const _0x2c0259=a166_0x2c02();let _0x30d03d=_0x2c0259[_0x3b6975];return _0x30d03d;}(function(_0x2bd404,_0x4e3500){const _0x381c7e=a166_0x30d0,_0x3dcb98=_0x2bd404();while(!![]){try{const _0x20d51b=-parseInt(_0x381c7e(0xbc))/0x1*(-parseInt(_0x381c7e(0xad))/0x2)+-parseInt(_0x381c7e(0xb7))/0x3+-parseInt(_0x381c7e(0xa5))/0x4*(parseInt(_0x381c7e(0x9e))/0x5)+parseInt(_0x381c7e(0xa7))/0x6*(parseInt(_0x381c7e(0xb1))/0x7)+-parseInt(_0x381c7e(0xb2))/0x8+-parseInt(_0x381c7e(0xb6))/0x9*(-parseInt(_0x381c7e(0xba))/0xa)+parseInt(_0x381c7e(0xaa))/0xb;if(_0x20d51b===_0x4e3500)break;else _0x3dcb98['push'](_0x3dcb98['shift']());}catch(_0x27bc8b){_0x3dcb98['push'](_0x3dcb98['shift']());}}}(a166_0x2c02,0x6f90f));function a166_0x2c02(){const _0x33766e=['\x22\x20but\x20no\x20SKILL.md\x20was\x20found\x20in\x20known\x20layouts\x20','119WxZODw','3506104kXfOEO','map','skills','kind','18awGtIo','1325130Ebomll','includes','\x20records\x20\x22','73240GbsFgR','.skill-lock.json','877SFUGhE','recorded','not-recorded','object','parse','join','unusable','absent','938020izKEGu','\x20uses\x20unsupported\x20version\x20','number','unverifiable','SKILL.md','find','lockFile','4XtbDFC','present','262302cGstZm','reason','message','21681CSUQyu','utf8','home','1744OsdKGz','version','globalSkillsDirs'];a166_0x2c02=function(){return _0x33766e;};return a166_0x2c02();}import{existsSync,readFileSync}from'node:fs';import{homedir}from'node:os';import{join}from'node:path';export const SKILL_LOCK_RELATIVE_PATH=join('.agents',a166_0x3648dc(0xbb));export const GLOBAL_SKILLS_DIR_RELATIVE_PATHS=[join('.agents',a166_0x3648dc(0xb4)),join('.claude',a166_0x3648dc(0xb4))];const SUPPORTED_LOCK_VERSIONS=[0x3];function readLockLookup(_0x5a2763,_0x43b334){const _0x5b5f88=a166_0x3648dc;if(!existsSync(_0x5a2763))return{'kind':_0x5b5f88(0xbe)};let _0x4eabc6;try{_0x4eabc6=JSON[_0x5b5f88(0xc0)](readFileSync(_0x5a2763,_0x5b5f88(0xab)));}catch(_0x5da1f1){return{'kind':_0x5b5f88(0xc2),'reason':_0x5a2763+'\x20is\x20unreadable:\x20'+_0x5da1f1[_0x5b5f88(0xa9)]};}const _0x4216dc=_0x4eabc6;if(typeof _0x4216dc?.[_0x5b5f88(0xae)]!==_0x5b5f88(0xa0)||!SUPPORTED_LOCK_VERSIONS[_0x5b5f88(0xb8)](_0x4216dc[_0x5b5f88(0xae)]))return{'kind':_0x5b5f88(0xc2),'reason':_0x5a2763+_0x5b5f88(0x9f)+String(_0x4216dc?.[_0x5b5f88(0xae)])};if(!_0x4216dc[_0x5b5f88(0xb4)]||typeof _0x4216dc['skills']!==_0x5b5f88(0xbf))return{'kind':_0x5b5f88(0xc2),'reason':_0x5a2763+'\x20has\x20no\x20skills\x20map'};return _0x4216dc['skills'][_0x43b334]?{'kind':_0x5b5f88(0xbd)}:{'kind':_0x5b5f88(0xbe)};}export function resolveInstalledSkill(_0x2080c4,_0x19ef78){const _0x36d363=a166_0x3648dc,_0x4e3236=_0x19ef78?.[_0x36d363(0xac)]??homedir(),_0x1b18ec=_0x19ef78?.[_0x36d363(0xaf)]??GLOBAL_SKILLS_DIR_RELATIVE_PATHS[_0x36d363(0xb3)](_0x2e9e43=>join(_0x4e3236,_0x2e9e43)),_0x38528d=_0x19ef78?.[_0x36d363(0xa4)]??join(_0x4e3236,SKILL_LOCK_RELATIVE_PATH),_0x265bab=_0x1b18ec['map'](_0x263d63=>join(_0x263d63,_0x2080c4,_0x36d363(0xa2))),_0x5b36c5=_0x265bab[_0x36d363(0xa3)](_0x3598ad=>existsSync(_0x3598ad));if(_0x5b36c5)return{'state':_0x36d363(0xa6),'path':_0x5b36c5};const _0x291117=readLockLookup(_0x38528d,_0x2080c4);if(_0x291117[_0x36d363(0xb5)]===_0x36d363(0xc2))return{'state':_0x36d363(0xa1),'reason':_0x291117[_0x36d363(0xa8)]};if(_0x291117[_0x36d363(0xb5)]===_0x36d363(0xbd))return{'state':_0x36d363(0xa1),'reason':_0x38528d+_0x36d363(0xb9)+_0x2080c4+_0x36d363(0xb0)+('('+_0x265bab[_0x36d363(0xc1)](',\x20')+')')};return{'state':_0x36d363(0x9d),'checked':_0x265bab};}
@@ -1 +1 @@
1
- const a167_0x581f07=a167_0x4c8e;(function(_0x4030b1,_0x5fcd03){const _0x36649e=a167_0x4c8e,_0x3fac4b=_0x4030b1();while(!![]){try{const _0x29a940=-parseInt(_0x36649e(0xf5))/0x1*(-parseInt(_0x36649e(0xf4))/0x2)+parseInt(_0x36649e(0xf6))/0x3+parseInt(_0x36649e(0xfd))/0x4*(-parseInt(_0x36649e(0xfa))/0x5)+parseInt(_0x36649e(0xe8))/0x6+-parseInt(_0x36649e(0xee))/0x7+parseInt(_0x36649e(0xe7))/0x8*(parseInt(_0x36649e(0xf2))/0x9)+parseInt(_0x36649e(0xed))/0xa*(parseInt(_0x36649e(0xf8))/0xb);if(_0x29a940===_0x5fcd03)break;else _0x3fac4b['push'](_0x3fac4b['shift']());}catch(_0x467e99){_0x3fac4b['push'](_0x3fac4b['shift']());}}}(a167_0x5d9d,0x42770));const REDACTED_ACCESS_KEY=a167_0x581f07(0xfc);function a167_0x4c8e(_0x4e385c,_0x3a7812){_0x4e385c=_0x4e385c-0xe7;const _0x5d9d8c=a167_0x5d9d();let _0x4c8efb=_0x5d9d8c[_0x4e385c];return _0x4c8efb;}function a167_0x5d9d(){const _0x516f91=['fromEntries','55Nxhwvu','length','39110BzuFFx','isArray','<redacted>','232mkSeTZ','1016YabYIm','51900bciwJW','call','string','slice','object','1624650covNWv','1689618KkaXjS','apps','entries','accessKey','3816WfzcrM','test','18366xRhKah','9QljqCq','29460VAOmIf'];a167_0x5d9d=function(){return _0x516f91;};return a167_0x5d9d();}export function maskCliAccessKey(_0x560346){const _0x3a8b06=a167_0x581f07;if(typeof _0x560346!==_0x3a8b06(0xea)||_0x560346['length']<=0x8)return REDACTED_ACCESS_KEY;return''+_0x560346[_0x3a8b06(0xeb)](0x0,0x8)+'*'['repeat'](_0x560346[_0x3a8b06(0xf9)]-0x8);}export function redactCliConfigCredentials(_0x5bd30c){const _0x404737=a167_0x581f07,_0x14cb6b={..._0x5bd30c};return Object['prototype']['hasOwnProperty']['call'](_0x14cb6b,'accessKey')&&(_0x14cb6b[_0x404737(0xf1)]=maskCliAccessKey(_0x14cb6b[_0x404737(0xf1)])),_0x14cb6b[_0x404737(0xef)]&&typeof _0x14cb6b['apps']===_0x404737(0xec)&&!Array[_0x404737(0xfb)](_0x14cb6b[_0x404737(0xef)])&&(_0x14cb6b[_0x404737(0xef)]=redactLegacyAppCredentials(_0x14cb6b[_0x404737(0xef)])),_0x14cb6b;}export function redactCliConfigValue(_0x5861e2,_0x129606){const _0x17ca9e=a167_0x581f07;if(_0x5861e2==='accessKey'||/^apps\.[^.]+\.accessKey$/[_0x17ca9e(0xf3)](_0x5861e2))return maskCliAccessKey(_0x129606);if(_0x5861e2===_0x17ca9e(0xef)&&_0x129606&&typeof _0x129606===_0x17ca9e(0xec)&&!Array[_0x17ca9e(0xfb)](_0x129606))return redactLegacyAppCredentials(_0x129606);if(/^apps\.[^.]+$/[_0x17ca9e(0xf3)](_0x5861e2)&&_0x129606&&typeof _0x129606===_0x17ca9e(0xec)&&!Array[_0x17ca9e(0xfb)](_0x129606)){const _0x5e8f16=_0x129606;return Object['prototype']['hasOwnProperty']['call'](_0x5e8f16,_0x17ca9e(0xf1))?{..._0x5e8f16,'accessKey':maskCliAccessKey(_0x5e8f16[_0x17ca9e(0xf1)])}:_0x129606;}return _0x129606;}function redactLegacyAppCredentials(_0x4fec0a){const _0x2220ae=a167_0x581f07;return Object[_0x2220ae(0xf7)](Object[_0x2220ae(0xf0)](_0x4fec0a)['map'](([_0x43a54d,_0x23bc31])=>{const _0x43d1d9=_0x2220ae;if(!_0x23bc31||typeof _0x23bc31!==_0x43d1d9(0xec)||Array[_0x43d1d9(0xfb)](_0x23bc31))return[_0x43a54d,_0x23bc31];const _0x1a8bae={..._0x23bc31};return Object['prototype']['hasOwnProperty'][_0x43d1d9(0xe9)](_0x1a8bae,_0x43d1d9(0xf1))&&(_0x1a8bae[_0x43d1d9(0xf1)]=maskCliAccessKey(_0x1a8bae[_0x43d1d9(0xf1)])),[_0x43a54d,_0x1a8bae];}));}
1
+ const a167_0x440617=a167_0x296c;(function(_0x128aec,_0x2a4d1e){const _0xfb2a23=a167_0x296c,_0x583b60=_0x128aec();while(!![]){try{const _0x168fd1=-parseInt(_0xfb2a23(0x154))/0x1+parseInt(_0xfb2a23(0x14d))/0x2*(-parseInt(_0xfb2a23(0x15f))/0x3)+parseInt(_0xfb2a23(0x158))/0x4+-parseInt(_0xfb2a23(0x157))/0x5*(-parseInt(_0xfb2a23(0x14a))/0x6)+-parseInt(_0xfb2a23(0x147))/0x7*(parseInt(_0xfb2a23(0x148))/0x8)+parseInt(_0xfb2a23(0x14b))/0x9+-parseInt(_0xfb2a23(0x15e))/0xa;if(_0x168fd1===_0x2a4d1e)break;else _0x583b60['push'](_0x583b60['shift']());}catch(_0xaf671b){_0x583b60['push'](_0x583b60['shift']());}}}(a167_0x3608,0xa2f64));const REDACTED_ACCESS_KEY=a167_0x440617(0x159);export function maskCliAccessKey(_0x5af7ba){const _0x52fa0e=a167_0x440617;if(typeof _0x5af7ba!==_0x52fa0e(0x14c)||_0x5af7ba[_0x52fa0e(0x150)]<=0x8)return REDACTED_ACCESS_KEY;return''+_0x5af7ba[_0x52fa0e(0x153)](0x0,0x8)+'*'[_0x52fa0e(0x149)](_0x5af7ba[_0x52fa0e(0x150)]-0x8);}function a167_0x3608(){const _0x2b7802=['slice','717677jGNCeT','call','accessKey','2984430TIntMR','3614824lvTwof','<redacted>','apps','isArray','entries','fromEntries','6437710VXxXKl','1028163TIysZQ','2637159kftMNl','8hVJqkr','repeat','6DRpTvK','11230254cmtfRf','string','2xUvWHx','test','prototype','length','object','hasOwnProperty'];a167_0x3608=function(){return _0x2b7802;};return a167_0x3608();}function a167_0x296c(_0x339f9,_0x437b2a){_0x339f9=_0x339f9-0x147;const _0x36089b=a167_0x3608();let _0x296c0d=_0x36089b[_0x339f9];return _0x296c0d;}export function redactCliConfigCredentials(_0x3aa683){const _0x5428c4=a167_0x440617,_0x1b306e={..._0x3aa683};return Object[_0x5428c4(0x14f)]['hasOwnProperty']['call'](_0x1b306e,_0x5428c4(0x156))&&(_0x1b306e[_0x5428c4(0x156)]=maskCliAccessKey(_0x1b306e[_0x5428c4(0x156)])),_0x1b306e[_0x5428c4(0x15a)]&&typeof _0x1b306e['apps']===_0x5428c4(0x151)&&!Array['isArray'](_0x1b306e[_0x5428c4(0x15a)])&&(_0x1b306e[_0x5428c4(0x15a)]=redactLegacyAppCredentials(_0x1b306e[_0x5428c4(0x15a)])),_0x1b306e;}export function redactCliConfigValue(_0x2b065e,_0x4fee2e){const _0x38061e=a167_0x440617;if(_0x2b065e===_0x38061e(0x156)||/^apps\.[^.]+\.accessKey$/[_0x38061e(0x14e)](_0x2b065e))return maskCliAccessKey(_0x4fee2e);if(_0x2b065e===_0x38061e(0x15a)&&_0x4fee2e&&typeof _0x4fee2e===_0x38061e(0x151)&&!Array['isArray'](_0x4fee2e))return redactLegacyAppCredentials(_0x4fee2e);if(/^apps\.[^.]+$/[_0x38061e(0x14e)](_0x2b065e)&&_0x4fee2e&&typeof _0x4fee2e==='object'&&!Array[_0x38061e(0x15b)](_0x4fee2e)){const _0x2aed53=_0x4fee2e;return Object[_0x38061e(0x14f)][_0x38061e(0x152)][_0x38061e(0x155)](_0x2aed53,_0x38061e(0x156))?{..._0x2aed53,'accessKey':maskCliAccessKey(_0x2aed53[_0x38061e(0x156)])}:_0x4fee2e;}return _0x4fee2e;}function redactLegacyAppCredentials(_0x48d4d5){const _0x298842=a167_0x440617;return Object[_0x298842(0x15d)](Object[_0x298842(0x15c)](_0x48d4d5)['map'](([_0x50f755,_0x5d0a3a])=>{const _0x310cee=_0x298842;if(!_0x5d0a3a||typeof _0x5d0a3a!==_0x310cee(0x151)||Array[_0x310cee(0x15b)](_0x5d0a3a))return[_0x50f755,_0x5d0a3a];const _0x3d3a70={..._0x5d0a3a};return Object[_0x310cee(0x14f)]['hasOwnProperty'][_0x310cee(0x155)](_0x3d3a70,_0x310cee(0x156))&&(_0x3d3a70[_0x310cee(0x156)]=maskCliAccessKey(_0x3d3a70['accessKey'])),[_0x50f755,_0x3d3a70];}));}
@@ -1 +1 @@
1
- function a168_0x1aef(){const _0x4a8402=['1727680UtRkSP','5gGKPgg','11bYrDJH','562956EbborM','3424690pHJFHy','1989211JLBRmj','24IrhWzh','18034qZZrAt','341040kaBdPc','4845087rbTAsQ','6raPOpG'];a168_0x1aef=function(){return _0x4a8402;};return a168_0x1aef();}(function(_0xd03ad5,_0x10d8df){const _0x462779=a168_0x4e3d,_0x4bb6df=_0xd03ad5();while(!![]){try{const _0x5231d3=-parseInt(_0x462779(0x1d2))/0x1+parseInt(_0x462779(0x1d1))/0x2*(-parseInt(_0x462779(0x1d4))/0x3)+parseInt(_0x462779(0x1d5))/0x4+parseInt(_0x462779(0x1d6))/0x5*(-parseInt(_0x462779(0x1d8))/0x6)+-parseInt(_0x462779(0x1cf))/0x7*(-parseInt(_0x462779(0x1d0))/0x8)+-parseInt(_0x462779(0x1d3))/0x9+parseInt(_0x462779(0x1d9))/0xa*(parseInt(_0x462779(0x1d7))/0xb);if(_0x5231d3===_0x10d8df)break;else _0x4bb6df['push'](_0x4bb6df['shift']());}catch(_0xcd017f){_0x4bb6df['push'](_0x4bb6df['shift']());}}}(a168_0x1aef,0x9b311));import{createJqFilter,resolveBundledJqPaths}from'@lovrabet/cli-framework';import{CliErrors}from'../errors.js';function a168_0x4e3d(_0x33c42a,_0x2d5bea){_0x33c42a=_0x33c42a-0x1cf;const _0x1aef16=a168_0x1aef();let _0x4e3d07=_0x1aef16[_0x33c42a];return _0x4e3d07;}export const applyJqFilter=createJqFilter(CliErrors,{'bundledJqPaths':resolveBundledJqPaths()});
1
+ function a168_0x4d43(_0x4f0cb4,_0x551669){_0x4f0cb4=_0x4f0cb4-0x1e6;const _0x5d24ba=a168_0x5d24();let _0x4d43ad=_0x5d24ba[_0x4f0cb4];return _0x4d43ad;}(function(_0x568c67,_0x437cda){const _0x43bbb9=a168_0x4d43,_0x59c6b6=_0x568c67();while(!![]){try{const _0x3afe24=-parseInt(_0x43bbb9(0x1ee))/0x1+parseInt(_0x43bbb9(0x1e9))/0x2+parseInt(_0x43bbb9(0x1ea))/0x3*(parseInt(_0x43bbb9(0x1e6))/0x4)+parseInt(_0x43bbb9(0x1ed))/0x5+-parseInt(_0x43bbb9(0x1ec))/0x6+-parseInt(_0x43bbb9(0x1e8))/0x7+parseInt(_0x43bbb9(0x1e7))/0x8*(parseInt(_0x43bbb9(0x1eb))/0x9);if(_0x3afe24===_0x437cda)break;else _0x59c6b6['push'](_0x59c6b6['shift']());}catch(_0x3556b5){_0x59c6b6['push'](_0x59c6b6['shift']());}}}(a168_0x5d24,0x76be1));import{createJqFilter,resolveBundledJqPaths}from'@lovrabet/cli-framework';function a168_0x5d24(){const _0x2cc46b=['893590lXvwSb','154234DJfrbD','306676VUXmNf','3896OlPJsk','6758682hduNVL','1610766IgbOvh','12oIxYNu','15462QiBRms','3127884nFotWp'];a168_0x5d24=function(){return _0x2cc46b;};return a168_0x5d24();}import{CliErrors}from'../errors.js';export const applyJqFilter=createJqFilter(CliErrors,{'bundledJqPaths':resolveBundledJqPaths()});