@lovrabet/lovrabet-cli 2.3.8-beta.3 → 2.3.8-beta.4

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 (184) 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-sdk-errors.d.ts +3 -0
  110. package/lib/core/kb-sdk-errors.js +1 -0
  111. package/lib/core/kb-search-client.d.ts +3 -21
  112. package/lib/core/kb-search-client.js +1 -1
  113. package/lib/core/sdk-client.js +1 -1
  114. package/lib/errors.js +1 -1
  115. package/lib/framework/access-error.js +1 -1
  116. package/lib/framework/build-all-flags.js +1 -1
  117. package/lib/framework/dryrun.js +1 -1
  118. package/lib/framework/flags.js +1 -1
  119. package/lib/framework/help.js +1 -1
  120. package/lib/framework/index.js +1 -1
  121. package/lib/framework/output.js +1 -1
  122. package/lib/framework/preparse.js +1 -1
  123. package/lib/framework/rate-limit.js +1 -1
  124. package/lib/framework/raw-flags.js +1 -1
  125. package/lib/framework/response.js +1 -1
  126. package/lib/framework/runner-confirmation.js +1 -1
  127. package/lib/framework/runner-error.js +1 -1
  128. package/lib/framework/runner.js +1 -1
  129. package/lib/framework/schema-export.js +1 -1
  130. package/lib/framework/service-order.js +1 -1
  131. package/lib/framework/types.js +1 -1
  132. package/lib/generated/build-info.d.ts +4 -4
  133. package/lib/generated/build-info.js +1 -1
  134. package/lib/generated/official-routing.js +1 -1
  135. package/lib/generated/routing-contract.js +1 -1
  136. package/lib/help.js +1 -1
  137. package/lib/postinstall.js +1 -1
  138. package/lib/runtime/confirmation.js +1 -1
  139. package/lib/runtime/event.js +1 -1
  140. package/lib/runtime/index.js +1 -1
  141. package/lib/runtime/queue.js +1 -1
  142. package/lib/runtime/resolve.js +1 -1
  143. package/lib/services/dataset-import/auto-id-runner.js +1 -1
  144. package/lib/services/dataset-import/excel-reader.js +1 -1
  145. package/lib/services/dataset-import/image-bytes.js +1 -1
  146. package/lib/services/dataset-import/image-ooxml.js +1 -1
  147. package/lib/services/dataset-import/image-runner.js +1 -1
  148. package/lib/services/dataset-import/metadata.js +1 -1
  149. package/lib/services/dataset-import/preview.js +1 -1
  150. package/lib/services/dataset-import/runner.js +1 -1
  151. package/lib/skills/builtin-skill.js +1 -1
  152. package/lib/skills/npx-skills-add.js +1 -1
  153. package/lib/skills/runtime-skill-sync/constants.js +1 -1
  154. package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
  155. package/lib/skills/runtime-skill-sync/hashing.js +1 -1
  156. package/lib/skills/runtime-skill-sync/install-target.js +1 -1
  157. package/lib/skills/runtime-skill-sync/links.js +1 -1
  158. package/lib/skills/runtime-skill-sync/list-local.js +1 -1
  159. package/lib/skills/runtime-skill-sync/local-files.js +1 -1
  160. package/lib/skills/runtime-skill-sync/materialize.js +1 -1
  161. package/lib/skills/runtime-skill-sync/metadata.js +1 -1
  162. package/lib/skills/runtime-skill-sync/paths.js +1 -1
  163. package/lib/skills/runtime-skill-sync/push.js +1 -1
  164. package/lib/skills/runtime-skill-sync/scopes.js +1 -1
  165. package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
  166. package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
  167. package/lib/skills/runtime-skill-sync.js +1 -1
  168. package/lib/skills/skill-presence.js +1 -1
  169. package/lib/utils/access-key-redaction.js +1 -1
  170. package/lib/utils/apply-jq-filter.js +1 -1
  171. package/lib/utils/cli-version-check.js +1 -1
  172. package/lib/utils/cli-version-policy.js +1 -1
  173. package/lib/utils/logger.js +1 -1
  174. package/lib/utils/lossless-json.js +1 -1
  175. package/lib/utils/params.js +1 -1
  176. package/lib/utils/positive-safe-integer.js +1 -1
  177. package/lib/utils/redaction.js +1 -1
  178. package/lib/utils/runtime-user-id.js +1 -1
  179. package/lib/utils/update-notice.js +1 -1
  180. package/lib/utils/version.js +1 -1
  181. package/lib/utils/write-cli-side-channel.js +1 -1
  182. package/package.json +2 -2
  183. package/skills/lovrabet/SKILL.md +1 -1
  184. package/skills/lovrabet.manifest.json +3 -3
@@ -1 +1 @@
1
- const a154_0x4ff7b6=a154_0x28bb;(function(_0x36a6ad,_0x2ad959){const _0x6e211=a154_0x28bb,_0x3b1974=_0x36a6ad();while(!![]){try{const _0x5b08dc=-parseInt(_0x6e211(0xa1))/0x1+-parseInt(_0x6e211(0xaa))/0x2+parseInt(_0x6e211(0x98))/0x3+-parseInt(_0x6e211(0xbb))/0x4+parseInt(_0x6e211(0xb7))/0x5*(parseInt(_0x6e211(0xbd))/0x6)+parseInt(_0x6e211(0x89))/0x7+parseInt(_0x6e211(0xac))/0x8;if(_0x5b08dc===_0x2ad959)break;else _0x3b1974['push'](_0x3b1974['shift']());}catch(_0x290ffd){_0x3b1974['push'](_0x3b1974['shift']());}}}(a154_0x3f30,0x4797d));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import a154_0x238485 from'fs-extra';function a154_0x28bb(_0x5c6ff4,_0x46c653){_0x5c6ff4=_0x5c6ff4-0x87;const _0x3f3007=a154_0x3f30();let _0x28bb53=_0x3f3007[_0x5c6ff4];return _0x28bb53;}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_0x238485,RESERVED_PROJECT_SKILL_CODES=new Set([a154_0x4ff7b6(0x87),a154_0x4ff7b6(0x8f),a154_0x4ff7b6(0x97)]);export function linkEffectiveRuntimeSkills(_0x1e2a50,_0x1e187d){const _0x4ee76=a154_0x4ff7b6,_0x208844=new Map();for(const _0x48e0e5 of _0x1e2a50){const _0x1049f4=_0x48e0e5[_0x4ee76(0xa5)][_0x4ee76(0xa9)];if(!_0x1049f4)continue;const _0x4e5085=_0x208844[_0x4ee76(0xa4)](_0x1049f4);(!_0x4e5085||_0x48e0e5[_0x4ee76(0x9d)]===_0x4ee76(0x88))&&_0x208844[_0x4ee76(0xa8)](_0x1049f4,_0x48e0e5);}const _0x2a21ce=[];for(const _0x1aff37 of _0x208844[_0x4ee76(0x96)]()){const _0x17b7cf=requireSkillCode(_0x1aff37[_0x4ee76(0xa5)]),_0x160ad9=readMetadataIfPresent(_0x1aff37['metadataPath']);if(_0x160ad9?.[_0x4ee76(0xa7)]!==_0x1e187d[_0x4ee76(0xa7)]||_0x160ad9[_0x4ee76(0xa9)]!==_0x17b7cf)throw CliErrors[_0x4ee76(0xb1)]('Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20'+_0x1e187d['appCode']+':\x20'+_0x1aff37[_0x4ee76(0xb9)]);const _0xd45a02=runtimeSkillLinkName(_0x1e187d,_0x17b7cf);for(const _0x28bacc of _0x1e187d[_0x4ee76(0xae)]){_0x2a21ce[_0x4ee76(0xa2)](ensureManagedSymlink(resolve(_0x28bacc,_0xd45a02),_0x1aff37['dir'],_0x1e187d,_0x17b7cf));}}return _0x2a21ce;}export function pruneStaleRuntimeSkillLinks(_0x5504bb,_0x57ceb5,_0x5ceef5){const _0x155c67=a154_0x4ff7b6,_0x53c042=new Set([..._0x57ceb5]['map'](_0x59a76e=>_0x59a76e['trim']())[_0x155c67(0xb0)](Boolean)),_0xfbcdce=_0x5ceef5?new Set([..._0x5ceef5][_0x155c67(0x99)](_0x5640cd=>_0x5640cd[_0x155c67(0xad)]())[_0x155c67(0xb0)](Boolean)):undefined,_0x381633=[];for(const _0x2196fa of _0x5504bb['skillRoots']){for(const _0x12d8ad of managedTargetSkillLinkPaths(_0x2196fa,_0x5504bb)){const _0x528ffa=runtimeSkillCodeFromLink(_0x5504bb,_0x12d8ad);if(_0xfbcdce&&!_0xfbcdce['has'](_0x528ffa))continue;if(_0x53c042['has'](_0x528ffa))continue;_0x381633['push'](removeManagedSkillLink(_0x12d8ad,_0x5504bb,_0x528ffa));}}return _0x381633;}export function pruneStaleRuntimeSkillCache(_0x2b3a5f,_0x128a56={}){const _0x5dace2=a154_0x4ff7b6,_0x5b8987=new Set([..._0x2b3a5f[_0x5dace2(0x8b)]][_0x5dace2(0x99)](_0x17c985=>_0x17c985[_0x5dace2(0xad)]())[_0x5dace2(0xb0)](Boolean)),_0x312b0c=_0x2b3a5f[_0x5dace2(0x9f)]?new Set([..._0x2b3a5f[_0x5dace2(0x9f)]][_0x5dace2(0x99)](_0x49a107=>_0x49a107['trim']())[_0x5dace2(0xb0)](Boolean)):undefined,_0x33bf18=_0x2b3a5f[_0x5dace2(0xb6)]??[_0x5dace2(0x88),_0x5dace2(0x93)],_0x52846a=resolve(getRuntimeSkillCacheRoot(_0x2b3a5f[_0x5dace2(0x94)],_0x2b3a5f[_0x5dace2(0xa6)],_0x128a56),safePathSegment(_0x2b3a5f[_0x5dace2(0xa7)],_0x5dace2(0xa7))),_0x5acf7b=[];for(const _0xda44d0 of _0x33bf18){const _0x5080a7=resolve(_0x52846a,_0xda44d0);if(!existsSync(_0x5080a7))continue;for(const _0x14451b of readdirSync(_0x5080a7,{'withFileTypes':!![]})){if(!_0x14451b[_0x5dace2(0xb8)]())continue;const _0x56d0ca=_0x14451b[_0x5dace2(0xba)];if(_0x312b0c&&!_0x312b0c[_0x5dace2(0x92)](_0x56d0ca))continue;if(_0x5b8987['has'](_0x56d0ca))continue;const _0x5bba02=resolve(_0x5080a7,_0x56d0ca),_0x540bc7=readMetadataIfPresent(resolve(_0x5bba02,METADATA_FILE));if(_0x540bc7?.['appCode']!==_0x2b3a5f[_0x5dace2(0xa7)]||_0x540bc7[_0x5dace2(0x9d)]!==_0xda44d0||_0x540bc7[_0x5dace2(0xa9)]!==_0x56d0ca){_0x5acf7b[_0x5dace2(0xa2)]({'path':_0x5bba02,'action':_0x5dace2(0x9a),'reason':_0x5dace2(0xab)});continue;}if(isLinkedFromAnyRoot(_0x5bba02,_0x2b3a5f[_0x5dace2(0x8a)]??[])){_0x5acf7b[_0x5dace2(0xa2)]({'path':_0x5bba02,'action':_0x5dace2(0x9a),'reason':_0x5dace2(0xb2)});continue;}removeSync(_0x5bba02),_0x5acf7b['push']({'path':_0x5bba02,'action':_0x5dace2(0xb5)});}}return _0x5acf7b;}function a154_0x3f30(){const _0x3dddbf=['Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','6JmdWzv','lovrabet','personal','604618VDeCPD','protectedLinkRoots','activeSkillCodes','not-managed-symlink','length','Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20','runtime-observe','project','Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20','has','company','env','created','values','secret-retriever','845715unrDUl','map','skipped','dir','slice','scope','updated','pruneSkillCodes','contentHash','265610qGNaJW','push','Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20','get','skill','accessKey','appCode','set','skillCode','318560PMtrgF','metadata-mismatch','4136760yKZvNJ','trim','skillRoots','Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20','filter','validation','linked-from-protected-root','isSymbolicLink','builtin','removed','scopes','2043710kSbPbR','isDirectory','metadataPath','name','2303924LvAaYW'];a154_0x3f30=function(){return _0x3dddbf;};return a154_0x3f30();}export function linkGlobalRuntimeSkills(_0x1b8826,_0x5f52c2={}){const _0x46a635=a154_0x4ff7b6,_0x250e04=resolveSkillSyncPaths(_0x5f52c2),_0x441cc2=[];for(const _0xd86f4f of _0x1b8826){if(_0xd86f4f[_0x46a635(0x9d)]!=='builtin')throw CliErrors[_0x46a635(0xb1)](_0x46a635(0xbc)+_0xd86f4f[_0x46a635(0x9d)]);const _0x1ddc47=requireSkillCode(_0xd86f4f['skill']),_0x1528de=copyManagedSkillDirectory(_0xd86f4f['dir'],resolve(_0x250e04['agentsSkillsDir'],_0x1ddc47));_0x441cc2['push']({..._0x1528de,'contentHash':_0xd86f4f[_0x46a635(0xa0)]});}return _0x441cc2;}function ensureManagedSymlink(_0x22fe03,_0x302a74,_0x5bfd21,_0x2e20a3){const _0x4fe035=a154_0x4ff7b6;mkdirSync(dirname(_0x22fe03),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x22fe03)||isDanglingSymlink(_0x22fe03)){const _0x25b0fe=lstatSync(_0x22fe03);if(!_0x25b0fe[_0x4fe035(0xb3)]())throw CliErrors[_0x4fe035(0xb1)](_0x4fe035(0xa3)+_0x22fe03);const _0x246626=resolveSymlinkTarget(_0x22fe03);if(!isPathInside(realOrResolved(_0x246626),realOrResolved(_0x5bfd21['managedRoot'])))throw CliErrors[_0x4fe035(0xb1)]('Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20'+_0x22fe03);if(realOrResolved(_0x246626)===realOrResolved(_0x302a74))return{'path':_0x22fe03,'target':_0x302a74,'action':'unchanged'};const _0x1a6989=readMetadataIfPresent(resolve(_0x246626,METADATA_FILE));if(_0x5bfd21[_0x4fe035(0x9d)]===_0x4fe035(0x90)&&(_0x1a6989?.['appCode']!==_0x5bfd21[_0x4fe035(0xa7)]||_0x1a6989[_0x4fe035(0xa9)]!==_0x2e20a3))throw CliErrors['validation'](_0x4fe035(0xaf)+_0x22fe03);return unlinkSync(_0x22fe03),symlinkSync(_0x302a74,_0x22fe03,_0x4fe035(0x9b)),{'path':_0x22fe03,'target':_0x302a74,'action':_0x4fe035(0x9e)};}return symlinkSync(_0x302a74,_0x22fe03,_0x4fe035(0x9b)),{'path':_0x22fe03,'target':_0x302a74,'action':_0x4fe035(0x95)};}function managedTargetSkillLinkPaths(_0x483147,_0x790a14){const _0x523c03=a154_0x4ff7b6;if(!existsSync(_0x483147))return[];const _0x2ebf94=_0x790a14['appCode']+'--';return readdirSync(_0x483147,{'withFileTypes':!![]})['filter'](_0x25181d=>_0x790a14[_0x523c03(0x9d)]==='project'||_0x25181d[_0x523c03(0xba)]['startsWith'](_0x2ebf94))[_0x523c03(0x99)](_0x35a4e4=>resolve(_0x483147,_0x35a4e4[_0x523c03(0xba)]));}function removeManagedSkillLink(_0x11210f,_0x2cafbb,_0xf0f3b9){const _0x401cb7=a154_0x4ff7b6,_0x462300=lstatIfPresent(_0x11210f);if(!_0x462300?.[_0x401cb7(0xb3)]())return{'path':_0x11210f,'action':_0x401cb7(0x9a),'reason':_0x401cb7(0x8c)};const _0x43624c=resolveSymlinkTarget(_0x11210f);if(!isPathInside(realOrResolved(_0x43624c),realOrResolved(_0x2cafbb['managedRoot'])))return{'path':_0x11210f,'action':_0x401cb7(0x9a),'reason':'external-symlink'};const _0x5612d7=readMetadataIfPresent(resolve(_0x43624c,METADATA_FILE));if(_0x2cafbb[_0x401cb7(0x9d)]==='project'&&(_0x5612d7?.[_0x401cb7(0xa7)]!==_0x2cafbb['appCode']||_0x5612d7['skillCode']!==_0xf0f3b9))return{'path':_0x11210f,'action':_0x401cb7(0x9a),'reason':'metadata-mismatch'};return unlinkSync(_0x11210f),{'path':_0x11210f,'action':_0x401cb7(0xb5)};}function isLinkedFromAnyRoot(_0x3eeea7,_0x3b686d){const _0x4ccbc5=a154_0x4ff7b6,_0x72a8dc=realOrResolved(_0x3eeea7);for(const _0xe020d7 of _0x3b686d){if(!existsSync(_0xe020d7))continue;for(const _0x1008e4 of readdirSync(_0xe020d7,{'withFileTypes':!![]})){if(!_0x1008e4['isSymbolicLink']())continue;const _0x211fa2=resolve(_0xe020d7,_0x1008e4[_0x4ccbc5(0xba)]);if(realOrResolved(resolveSymlinkTarget(_0x211fa2))===_0x72a8dc)return!![];}}return![];}function runtimeSkillLinkName(_0xa583e3,_0x54106b){const _0x3f506a=a154_0x4ff7b6,_0x294cad=safePathSegment(_0x54106b,_0x3f506a(0xa9));if(_0xa583e3[_0x3f506a(0x9d)]==='project'&&RESERVED_PROJECT_SKILL_CODES[_0x3f506a(0x92)](_0x294cad))throw CliErrors['validation'](_0x3f506a(0x8e)+_0x294cad);return _0xa583e3[_0x3f506a(0x9d)]==='project'?_0x294cad:_0xa583e3[_0x3f506a(0xa7)]+'--'+_0x294cad;}function runtimeSkillCodeFromLink(_0x21ecd0,_0x2c30cf){const _0x49b922=a154_0x4ff7b6,_0x3044f0=basename(_0x2c30cf);return _0x21ecd0['scope']===_0x49b922(0x90)?_0x3044f0:_0x3044f0[_0x49b922(0x9c)]((_0x21ecd0[_0x49b922(0xa7)]+'--')[_0x49b922(0x8d)]);}export function copyManagedSkillDirectory(_0xe40fe7,_0x56d527){const _0x43a03f=a154_0x4ff7b6,_0x4c3573=resolve(_0x56d527,METADATA_FILE),_0x4a81b6=existsSync(_0x56d527);if(_0x4a81b6){const _0x1b953a=lstatSync(_0x56d527);if(_0x1b953a[_0x43a03f(0xb3)]())throw CliErrors[_0x43a03f(0xb1)]('Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20'+_0x56d527);if(!_0x1b953a['isDirectory']())throw CliErrors[_0x43a03f(0xb1)](_0x43a03f(0x91)+_0x56d527);const _0x293077=readMetadataIfPresent(_0x4c3573);if(_0x293077?.['scope']!==_0x43a03f(0xb4))throw CliErrors[_0x43a03f(0xb1)]('Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20'+_0x56d527);}ensureDirSync(dirname(_0x56d527));const _0x5595f6=_0x4a81b6?readMetadataIfPresent(_0x4c3573)?.['contentHash']:undefined,_0x2005cd=readMetadataIfPresent(resolve(_0xe40fe7,METADATA_FILE))?.[_0x43a03f(0xa0)];return _0x4a81b6&&removeSync(_0x56d527),copySkillDirectory(_0xe40fe7,_0x56d527),{'path':_0x56d527,'target':_0xe40fe7,'action':!_0x4a81b6?_0x43a03f(0x95):_0x5595f6===_0x2005cd?'unchanged':_0x43a03f(0x9e)};}function copySkillDirectory(_0x5d3c65,_0x165ae0){copySync(_0x5d3c65,_0x165ae0,{'dereference':![],'overwrite':!![],'filter'(_0x2c3862){const _0x8e0769=a154_0x28bb;if(lstatSync(_0x2c3862)[_0x8e0769(0xb3)]())throw CliErrors[_0x8e0769(0xb1)]('Refusing\x20to\x20copy\x20Skill\x20symlink:\x20'+_0x2c3862);return!![];}});}
1
+ const a155_0x18f945=a155_0x760f;(function(_0xd009a,_0x34b39c){const _0x2d4d33=a155_0x760f,_0x1d8b4c=_0xd009a();while(!![]){try{const _0x5c6526=parseInt(_0x2d4d33(0x1e9))/0x1+-parseInt(_0x2d4d33(0x1e2))/0x2*(parseInt(_0x2d4d33(0x1ef))/0x3)+parseInt(_0x2d4d33(0x1ec))/0x4*(-parseInt(_0x2d4d33(0x208))/0x5)+-parseInt(_0x2d4d33(0x1f7))/0x6*(parseInt(_0x2d4d33(0x1f9))/0x7)+parseInt(_0x2d4d33(0x1e0))/0x8+-parseInt(_0x2d4d33(0x204))/0x9*(-parseInt(_0x2d4d33(0x1ff))/0xa)+parseInt(_0x2d4d33(0x1fc))/0xb;if(_0x5c6526===_0x34b39c)break;else _0x1d8b4c['push'](_0x1d8b4c['shift']());}catch(_0x147d7e){_0x1d8b4c['push'](_0x1d8b4c['shift']());}}}(a155_0x524a,0x7c1d5));function a155_0x524a(){const _0x46a865=['scope','1552190sMcrrS','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20','has','removed','runtime-observe','45LtFhaw','Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20','env','values','445HtsYvA','filter','metadataPath','unchanged','builtin','contentHash','skillRoots','skillCode','Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20','slice','trim','external-symlink','created','managedRoot','get','map','Refusing\x20to\x20copy\x20Skill\x20symlink:\x20','metadata-mismatch','updated','548856JzSBjL','dir','762IfzQms','pruneSkillCodes','linked-from-protected-root','personal','activeSkillCodes','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','not-managed-symlink','401389JkJKNJ','skill','secret-retriever','27088dNDXdA','name','appCode','276soMJCV','Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20','validation','isSymbolicLink','skipped','Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20','Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20','project','3252MkZnqS','push','5817guXQRF','company','scopes','3854884StEjvH','agentsSkillsDir'];a155_0x524a=function(){return _0x46a865;};return a155_0x524a();}import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';function a155_0x760f(_0x4d3737,_0x294bf3){_0x4d3737=_0x4d3737-0x1d3;const _0x524af0=a155_0x524a();let _0x760f35=_0x524af0[_0x4d3737];return _0x760f35;}import a155_0x1ef1ab 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}=a155_0x1ef1ab,RESERVED_PROJECT_SKILL_CODES=new Set(['lovrabet',a155_0x18f945(0x203),a155_0x18f945(0x1eb)]);export function linkEffectiveRuntimeSkills(_0x72ca99,_0x34180f){const _0x3e4c31=a155_0x18f945,_0xe307f1=new Map();for(const _0x27d74a of _0x72ca99){const _0x59d09c=_0x27d74a[_0x3e4c31(0x1ea)][_0x3e4c31(0x1d4)];if(!_0x59d09c)continue;const _0x59a7e8=_0xe307f1[_0x3e4c31(0x1db)](_0x59d09c);(!_0x59a7e8||_0x27d74a[_0x3e4c31(0x1fe)]===_0x3e4c31(0x1e5))&&_0xe307f1['set'](_0x59d09c,_0x27d74a);}const _0x36fd6f=[];for(const _0x5603fe of _0xe307f1[_0x3e4c31(0x207)]()){const _0x3d07b2=requireSkillCode(_0x5603fe[_0x3e4c31(0x1ea)]),_0x17a04e=readMetadataIfPresent(_0x5603fe[_0x3e4c31(0x20a)]);if(_0x17a04e?.[_0x3e4c31(0x1ee)]!==_0x34180f[_0x3e4c31(0x1ee)]||_0x17a04e[_0x3e4c31(0x1d4)]!==_0x3d07b2)throw CliErrors[_0x3e4c31(0x1f1)](_0x3e4c31(0x1d5)+_0x34180f[_0x3e4c31(0x1ee)]+':\x20'+_0x5603fe[_0x3e4c31(0x20a)]);const _0x1ff646=runtimeSkillLinkName(_0x34180f,_0x3d07b2);for(const _0x44ebd9 of _0x34180f[_0x3e4c31(0x1d3)]){_0x36fd6f[_0x3e4c31(0x1f8)](ensureManagedSymlink(resolve(_0x44ebd9,_0x1ff646),_0x5603fe[_0x3e4c31(0x1e1)],_0x34180f,_0x3d07b2));}}return _0x36fd6f;}export function pruneStaleRuntimeSkillLinks(_0x4cba53,_0x5d0e5c,_0x44c9a1){const _0x2609a0=a155_0x18f945,_0x35dc9=new Set([..._0x5d0e5c][_0x2609a0(0x1dc)](_0x469f8b=>_0x469f8b[_0x2609a0(0x1d7)]())[_0x2609a0(0x209)](Boolean)),_0x1bcce6=_0x44c9a1?new Set([..._0x44c9a1]['map'](_0x3709f2=>_0x3709f2[_0x2609a0(0x1d7)]())['filter'](Boolean)):undefined,_0x5ea9f1=[];for(const _0x22a9b9 of _0x4cba53[_0x2609a0(0x1d3)]){for(const _0x4a2780 of managedTargetSkillLinkPaths(_0x22a9b9,_0x4cba53)){const _0x38d121=runtimeSkillCodeFromLink(_0x4cba53,_0x4a2780);if(_0x1bcce6&&!_0x1bcce6['has'](_0x38d121))continue;if(_0x35dc9[_0x2609a0(0x201)](_0x38d121))continue;_0x5ea9f1[_0x2609a0(0x1f8)](removeManagedSkillLink(_0x4a2780,_0x4cba53,_0x38d121));}}return _0x5ea9f1;}export function pruneStaleRuntimeSkillCache(_0x9b65d6,_0x408381={}){const _0x4a002c=a155_0x18f945,_0x3c7024=new Set([..._0x9b65d6[_0x4a002c(0x1e6)]]['map'](_0x5e6240=>_0x5e6240['trim']())[_0x4a002c(0x209)](Boolean)),_0x2f2c7a=_0x9b65d6[_0x4a002c(0x1e3)]?new Set([..._0x9b65d6['pruneSkillCodes']][_0x4a002c(0x1dc)](_0x1893e0=>_0x1893e0['trim']())[_0x4a002c(0x209)](Boolean)):undefined,_0x1aa664=_0x9b65d6[_0x4a002c(0x1fb)]??['personal',_0x4a002c(0x1fa)],_0x566b45=resolve(getRuntimeSkillCacheRoot(_0x9b65d6[_0x4a002c(0x206)],_0x9b65d6['accessKey'],_0x408381),safePathSegment(_0x9b65d6[_0x4a002c(0x1ee)],_0x4a002c(0x1ee))),_0xd90c72=[];for(const _0x5a3fcf of _0x1aa664){const _0x51231f=resolve(_0x566b45,_0x5a3fcf);if(!existsSync(_0x51231f))continue;for(const _0x25ff1e of readdirSync(_0x51231f,{'withFileTypes':!![]})){if(!_0x25ff1e['isDirectory']())continue;const _0x2aee89=_0x25ff1e[_0x4a002c(0x1ed)];if(_0x2f2c7a&&!_0x2f2c7a['has'](_0x2aee89))continue;if(_0x3c7024[_0x4a002c(0x201)](_0x2aee89))continue;const _0x1e25a0=resolve(_0x51231f,_0x2aee89),_0x10bc90=readMetadataIfPresent(resolve(_0x1e25a0,METADATA_FILE));if(_0x10bc90?.[_0x4a002c(0x1ee)]!==_0x9b65d6[_0x4a002c(0x1ee)]||_0x10bc90['scope']!==_0x5a3fcf||_0x10bc90[_0x4a002c(0x1d4)]!==_0x2aee89){_0xd90c72[_0x4a002c(0x1f8)]({'path':_0x1e25a0,'action':_0x4a002c(0x1f3),'reason':_0x4a002c(0x1de)});continue;}if(isLinkedFromAnyRoot(_0x1e25a0,_0x9b65d6['protectedLinkRoots']??[])){_0xd90c72[_0x4a002c(0x1f8)]({'path':_0x1e25a0,'action':_0x4a002c(0x1f3),'reason':_0x4a002c(0x1e4)});continue;}removeSync(_0x1e25a0),_0xd90c72[_0x4a002c(0x1f8)]({'path':_0x1e25a0,'action':_0x4a002c(0x202)});}}return _0xd90c72;}export function linkGlobalRuntimeSkills(_0x2272a9,_0x29e19d={}){const _0x457940=a155_0x18f945,_0x4b121e=resolveSkillSyncPaths(_0x29e19d),_0x59ccf6=[];for(const _0x2d085e of _0x2272a9){if(_0x2d085e[_0x457940(0x1fe)]!=='builtin')throw CliErrors[_0x457940(0x1f1)](_0x457940(0x1e7)+_0x2d085e[_0x457940(0x1fe)]);const _0x3483bb=requireSkillCode(_0x2d085e[_0x457940(0x1ea)]),_0x26d876=copyManagedSkillDirectory(_0x2d085e['dir'],resolve(_0x4b121e[_0x457940(0x1fd)],_0x3483bb));_0x59ccf6['push']({..._0x26d876,'contentHash':_0x2d085e[_0x457940(0x20d)]});}return _0x59ccf6;}function ensureManagedSymlink(_0x3c4de9,_0x3be348,_0x44b073,_0x133e37){const _0x5dcc77=a155_0x18f945;mkdirSync(dirname(_0x3c4de9),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x3c4de9)||isDanglingSymlink(_0x3c4de9)){const _0x6f8dec=lstatSync(_0x3c4de9);if(!_0x6f8dec[_0x5dcc77(0x1f2)]())throw CliErrors[_0x5dcc77(0x1f1)]('Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20'+_0x3c4de9);const _0x94218d=resolveSymlinkTarget(_0x3c4de9);if(!isPathInside(realOrResolved(_0x94218d),realOrResolved(_0x44b073['managedRoot'])))throw CliErrors['validation'](_0x5dcc77(0x1f0)+_0x3c4de9);if(realOrResolved(_0x94218d)===realOrResolved(_0x3be348))return{'path':_0x3c4de9,'target':_0x3be348,'action':_0x5dcc77(0x20b)};const _0xa0388d=readMetadataIfPresent(resolve(_0x94218d,METADATA_FILE));if(_0x44b073[_0x5dcc77(0x1fe)]===_0x5dcc77(0x1f6)&&(_0xa0388d?.['appCode']!==_0x44b073[_0x5dcc77(0x1ee)]||_0xa0388d['skillCode']!==_0x133e37))throw CliErrors['validation'](_0x5dcc77(0x205)+_0x3c4de9);return unlinkSync(_0x3c4de9),symlinkSync(_0x3be348,_0x3c4de9,_0x5dcc77(0x1e1)),{'path':_0x3c4de9,'target':_0x3be348,'action':_0x5dcc77(0x1df)};}return symlinkSync(_0x3be348,_0x3c4de9,_0x5dcc77(0x1e1)),{'path':_0x3c4de9,'target':_0x3be348,'action':_0x5dcc77(0x1d9)};}function managedTargetSkillLinkPaths(_0x405cbf,_0x319844){const _0x5f5b8f=a155_0x18f945;if(!existsSync(_0x405cbf))return[];const _0x80c395=_0x319844[_0x5f5b8f(0x1ee)]+'--';return readdirSync(_0x405cbf,{'withFileTypes':!![]})[_0x5f5b8f(0x209)](_0x177c99=>_0x319844[_0x5f5b8f(0x1fe)]===_0x5f5b8f(0x1f6)||_0x177c99[_0x5f5b8f(0x1ed)]['startsWith'](_0x80c395))[_0x5f5b8f(0x1dc)](_0x16107b=>resolve(_0x405cbf,_0x16107b['name']));}function removeManagedSkillLink(_0x580a5e,_0x5aabb,_0x211d5d){const _0x354bd5=a155_0x18f945,_0x38ed5a=lstatIfPresent(_0x580a5e);if(!_0x38ed5a?.['isSymbolicLink']())return{'path':_0x580a5e,'action':_0x354bd5(0x1f3),'reason':_0x354bd5(0x1e8)};const _0x3ee49f=resolveSymlinkTarget(_0x580a5e);if(!isPathInside(realOrResolved(_0x3ee49f),realOrResolved(_0x5aabb[_0x354bd5(0x1da)])))return{'path':_0x580a5e,'action':_0x354bd5(0x1f3),'reason':_0x354bd5(0x1d8)};const _0x4a133f=readMetadataIfPresent(resolve(_0x3ee49f,METADATA_FILE));if(_0x5aabb['scope']===_0x354bd5(0x1f6)&&(_0x4a133f?.[_0x354bd5(0x1ee)]!==_0x5aabb[_0x354bd5(0x1ee)]||_0x4a133f[_0x354bd5(0x1d4)]!==_0x211d5d))return{'path':_0x580a5e,'action':_0x354bd5(0x1f3),'reason':_0x354bd5(0x1de)};return unlinkSync(_0x580a5e),{'path':_0x580a5e,'action':_0x354bd5(0x202)};}function isLinkedFromAnyRoot(_0x1bfab1,_0x304f03){const _0x3c3e57=realOrResolved(_0x1bfab1);for(const _0x5bcb43 of _0x304f03){if(!existsSync(_0x5bcb43))continue;for(const _0x1138a7 of readdirSync(_0x5bcb43,{'withFileTypes':!![]})){if(!_0x1138a7['isSymbolicLink']())continue;const _0x4ab7f0=resolve(_0x5bcb43,_0x1138a7['name']);if(realOrResolved(resolveSymlinkTarget(_0x4ab7f0))===_0x3c3e57)return!![];}}return![];}function runtimeSkillLinkName(_0x27aa2b,_0x4b90de){const _0x5dec5c=a155_0x18f945,_0x25b39a=safePathSegment(_0x4b90de,_0x5dec5c(0x1d4));if(_0x27aa2b[_0x5dec5c(0x1fe)]===_0x5dec5c(0x1f6)&&RESERVED_PROJECT_SKILL_CODES[_0x5dec5c(0x201)](_0x25b39a))throw CliErrors[_0x5dec5c(0x1f1)](_0x5dec5c(0x1f5)+_0x25b39a);return _0x27aa2b[_0x5dec5c(0x1fe)]===_0x5dec5c(0x1f6)?_0x25b39a:_0x27aa2b[_0x5dec5c(0x1ee)]+'--'+_0x25b39a;}function runtimeSkillCodeFromLink(_0x57053a,_0x21358e){const _0x4e881d=a155_0x18f945,_0x906aae=basename(_0x21358e);return _0x57053a[_0x4e881d(0x1fe)]==='project'?_0x906aae:_0x906aae[_0x4e881d(0x1d6)]((_0x57053a[_0x4e881d(0x1ee)]+'--')['length']);}export function copyManagedSkillDirectory(_0x5d2cab,_0x3c0f83){const _0x32415a=a155_0x18f945,_0x110d18=resolve(_0x3c0f83,METADATA_FILE),_0x3aded7=existsSync(_0x3c0f83);if(_0x3aded7){const _0x518d8b=lstatSync(_0x3c0f83);if(_0x518d8b[_0x32415a(0x1f2)]())throw CliErrors['validation'](_0x32415a(0x1f4)+_0x3c0f83);if(!_0x518d8b['isDirectory']())throw CliErrors[_0x32415a(0x1f1)]('Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20'+_0x3c0f83);const _0x246bb0=readMetadataIfPresent(_0x110d18);if(_0x246bb0?.[_0x32415a(0x1fe)]!==_0x32415a(0x20c))throw CliErrors[_0x32415a(0x1f1)](_0x32415a(0x200)+_0x3c0f83);}ensureDirSync(dirname(_0x3c0f83));const _0x8e16cc=_0x3aded7?readMetadataIfPresent(_0x110d18)?.[_0x32415a(0x20d)]:undefined,_0x1de5fe=readMetadataIfPresent(resolve(_0x5d2cab,METADATA_FILE))?.[_0x32415a(0x20d)];return _0x3aded7&&removeSync(_0x3c0f83),copySkillDirectory(_0x5d2cab,_0x3c0f83),{'path':_0x3c0f83,'target':_0x5d2cab,'action':!_0x3aded7?'created':_0x8e16cc===_0x1de5fe?_0x32415a(0x20b):'updated'};}function copySkillDirectory(_0x54adf9,_0x52568f){copySync(_0x54adf9,_0x52568f,{'dereference':![],'overwrite':!![],'filter'(_0x28715f){const _0x5b1267=a155_0x760f;if(lstatSync(_0x28715f)[_0x5b1267(0x1f2)]())throw CliErrors[_0x5b1267(0x1f1)](_0x5b1267(0x1dd)+_0x28715f);return!![];}});}
@@ -1 +1 @@
1
- (function(_0x4ff7eb,_0x5772d9){const _0x3f8ab8=a155_0x2c49,_0x572bc5=_0x4ff7eb();while(!![]){try{const _0xa1e5bf=-parseInt(_0x3f8ab8(0x107))/0x1*(-parseInt(_0x3f8ab8(0x11e))/0x2)+parseInt(_0x3f8ab8(0x118))/0x3+-parseInt(_0x3f8ab8(0x115))/0x4*(-parseInt(_0x3f8ab8(0x12c))/0x5)+parseInt(_0x3f8ab8(0x10d))/0x6*(parseInt(_0x3f8ab8(0x128))/0x7)+parseInt(_0x3f8ab8(0x12a))/0x8+-parseInt(_0x3f8ab8(0x11c))/0x9*(parseInt(_0x3f8ab8(0x10e))/0xa)+-parseInt(_0x3f8ab8(0x10a))/0xb;if(_0xa1e5bf===_0x5772d9)break;else _0x572bc5['push'](_0x572bc5['shift']());}catch(_0x136580){_0x572bc5['push'](_0x572bc5['shift']());}}}(a155_0x438d,0x81112));function a155_0x2c49(_0x193f25,_0x21ece2){_0x193f25=_0x193f25-0x101;const _0x438d80=a155_0x438d();let _0x2c493c=_0x438d80[_0x193f25];return _0x2c493c;}import{existsSync,readdirSync}from'node:fs';import{resolve}from'node:path';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{readMetadataIfPresent}from'./metadata.js';import{getRuntimeSkillCacheRoot,safePathSegment}from'./paths.js';import{isRuntimeSkillScope,normalizeRuntimeSkillScopes}from'./scopes.js';export function listLocalRuntimeSkills(_0x55fdea,_0x2a10b7,_0x4cf0af={}){const _0x52519b=a155_0x2c49,_0x1ab650=safePathSegment(_0x55fdea[_0x52519b(0x123)],_0x52519b(0x123));if(_0x2a10b7['appCode']!==_0x1ab650)throw CliErrors[_0x52519b(0x126)](_0x52519b(0x104)+_0x2a10b7[_0x52519b(0x123)]+'\x20!=\x20'+_0x1ab650);const _0xb33824=normalizeRuntimeSkillScopes(_0x55fdea[_0x52519b(0x102)]),_0x55aab9=new Set(_0xb33824),_0x460033=_0x55fdea[_0x52519b(0x112)]?.['trim'](),_0x5a5f8e=new Map(),_0x5b7cca=resolve(getRuntimeSkillCacheRoot(_0x55fdea['env'],_0x55fdea[_0x52519b(0x109)],_0x4cf0af),_0x1ab650);for(const _0x43f334 of _0xb33824){for(const _0x434270 of localSkillEntryDirs(resolve(_0x5b7cca,_0x43f334))){collectLocalRuntimeSkill(_0x5a5f8e,_0x434270,{'appCode':_0x1ab650,'scopes':_0x55aab9,'code':_0x460033,'source':_0x52519b(0x122)});}}for(const _0x5dc45b of _0x2a10b7[_0x52519b(0x121)]){for(const _0x3049ba of localSkillLinkCandidates(_0x5dc45b,_0x2a10b7,_0x55aab9)){collectLocalRuntimeSkill(_0x5a5f8e,_0x3049ba,{'appCode':_0x1ab650,'scopes':_0x55aab9,'code':_0x460033,'source':_0x52519b(0x117),'linkedPath':_0x3049ba});}}return Array[_0x52519b(0x113)](_0x5a5f8e['values']())[_0x52519b(0x10b)](compareLocalRuntimeSkills);}function localSkillEntryDirs(_0x1953f3){const _0x1e4404=a155_0x2c49;if(!existsSync(_0x1953f3))return[];return readdirSync(_0x1953f3,{'withFileTypes':!![]})[_0x1e4404(0x127)](_0x2ae911=>_0x2ae911[_0x1e4404(0x111)]()||_0x2ae911[_0x1e4404(0x119)]())['map'](_0x32c405=>resolve(_0x1953f3,_0x32c405[_0x1e4404(0x105)]));}function a155_0x438d(){const _0x56e949=['isDirectory','code','from','linkedPath','4eAPWrn','includes','link','2622021lMovHD','isSymbolicLink','startsWith','tags','201735yiwFtb','has','1784494BdEVTT','skillCode','source','skillRoots','cache','appCode','builtin','cacheDir','validation','filter','345429TygDmD','linkedPaths','3150432vvPfwv','isArray','4743145DhbuxY','set','scopes','dir','Runtime\x20Skill\x20install\x20target\x20app\x20mismatch:\x20','name','metadataPath','1PridDp','trim','accessKey','23991836NxawVO','sort','localeCompare','6VQvaHs','200JUvlyv','scope','get'];a155_0x438d=function(){return _0x56e949;};return a155_0x438d();}function localSkillLinkCandidates(_0x396799,_0xfab4ed,_0x289f06){const _0x501c60=a155_0x2c49;if(!existsSync(_0x396799))return[];const _0x4102e=_0xfab4ed[_0x501c60(0x123)]+'--';return readdirSync(_0x396799,{'withFileTypes':!![]})[_0x501c60(0x127)](_0x58ce86=>_0x58ce86['isDirectory']()||_0x58ce86['isSymbolicLink']())[_0x501c60(0x127)](_0x55c81a=>_0xfab4ed[_0x501c60(0x10f)]==='project'||_0x55c81a[_0x501c60(0x105)][_0x501c60(0x11a)](_0x4102e)||_0x289f06[_0x501c60(0x11d)](_0x501c60(0x124)))['map'](_0x5d7075=>resolve(_0x396799,_0x5d7075[_0x501c60(0x105)]));}function collectLocalRuntimeSkill(_0x115e27,_0x4b4aae,_0xca49a5){const _0x210787=a155_0x2c49,_0x232273=resolve(_0x4b4aae,METADATA_FILE),_0x4f4281=readMetadataIfPresent(_0x232273);if(!_0x4f4281)return;if(_0x4f4281[_0x210787(0x123)]!==_0xca49a5[_0x210787(0x123)])return;if(!isRuntimeSkillScope(_0x4f4281['scope'])||!_0xca49a5[_0x210787(0x102)][_0x210787(0x11d)](_0x4f4281[_0x210787(0x10f)]))return;const _0x32aba3=_0x4f4281[_0x210787(0x11f)]?.[_0x210787(0x108)]();if(!_0x32aba3)return;if(_0xca49a5[_0x210787(0x112)]&&_0x32aba3!==_0xca49a5[_0x210787(0x112)])return;const _0x476831=_0x4f4281[_0x210787(0x10f)]+':'+_0x32aba3,_0x276fff=_0xca49a5[_0x210787(0x114)]?[_0xca49a5[_0x210787(0x114)]]:[],_0xb9eb19=_0x115e27[_0x210787(0x110)](_0x476831);if(_0xb9eb19){_0xca49a5[_0x210787(0x120)]===_0x210787(0x122)&&(_0xb9eb19[_0x210787(0x103)]=_0x4b4aae,_0xb9eb19[_0x210787(0x125)]=_0x4b4aae,_0xb9eb19['skillMdPath']=resolve(_0x4b4aae,SKILL_FILE),_0xb9eb19[_0x210787(0x106)]=_0x232273);for(const _0x12f9f9 of _0x276fff){!_0xb9eb19[_0x210787(0x129)][_0x210787(0x116)](_0x12f9f9)&&_0xb9eb19[_0x210787(0x129)]['push'](_0x12f9f9);}_0xb9eb19['linkedPaths'][_0x210787(0x10b)]();return;}_0x115e27[_0x210787(0x101)](_0x476831,{..._0x4f4281,'tags':Array[_0x210787(0x12b)](_0x4f4281[_0x210787(0x11b)])?_0x4f4281[_0x210787(0x11b)]:[],'scope':_0x4f4281['scope'],'source':'local','dir':_0x4b4aae,'cacheDir':_0xca49a5[_0x210787(0x120)]===_0x210787(0x122)?_0x4b4aae:undefined,'skillMdPath':resolve(_0x4b4aae,SKILL_FILE),'metadataPath':_0x232273,'linkedPaths':_0x276fff});}function compareLocalRuntimeSkills(_0x200e4f,_0x21bf15){const _0x1daa42=a155_0x2c49,_0x3c94a9={'personal':0x0,'company':0x1,'builtin':0x2};return _0x3c94a9[_0x200e4f[_0x1daa42(0x10f)]]-_0x3c94a9[_0x21bf15[_0x1daa42(0x10f)]]||_0x200e4f[_0x1daa42(0x11f)][_0x1daa42(0x10c)](_0x21bf15[_0x1daa42(0x11f)])||_0x200e4f[_0x1daa42(0x103)][_0x1daa42(0x10c)](_0x21bf15[_0x1daa42(0x103)]);}
1
+ function a156_0x5d8b(){const _0x9e157c=['Runtime\x20Skill\x20install\x20target\x20app\x20mismatch:\x20','isDirectory','includes','cacheDir','set','271838bdGbKf','1057577vXqfKb','2KheEdM','isArray','values','push','sort','source','5863670oXBuTS','has','9xEDGRl','localeCompare','from','18QIxtLA','skillRoots','trim','metadataPath','link','dir','22195620EoAlKY','map','skillCode','4774888IHyKvO','appCode','scopes','\x20!=\x20','filter','get','name','accessKey','env','startsWith','skillMdPath','linkedPaths','scope','validation','3709662xdJohE','project','linkedPath','isSymbolicLink','cache','builtin','1554528TYwfvg'];a156_0x5d8b=function(){return _0x9e157c;};return a156_0x5d8b();}(function(_0x579418,_0x10b7be){const _0x3cbd97=a156_0x2e55,_0x44aa32=_0x579418();while(!![]){try{const _0x32efe7=-parseInt(_0x3cbd97(0x1da))/0x1*(parseInt(_0x3cbd97(0x1db))/0x2)+-parseInt(_0x3cbd97(0x1cd))/0x3+parseInt(_0x3cbd97(0x1d3))/0x4+parseInt(_0x3cbd97(0x1e1))/0x5+-parseInt(_0x3cbd97(0x1b6))/0x6*(parseInt(_0x3cbd97(0x1d9))/0x7)+-parseInt(_0x3cbd97(0x1bf))/0x8*(parseInt(_0x3cbd97(0x1e3))/0x9)+parseInt(_0x3cbd97(0x1bc))/0xa;if(_0x32efe7===_0x10b7be)break;else _0x44aa32['push'](_0x44aa32['shift']());}catch(_0x4c7dcd){_0x44aa32['push'](_0x44aa32['shift']());}}}(a156_0x5d8b,0xbcd3a));import{existsSync,readdirSync}from'node:fs';import{resolve}from'node:path';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{readMetadataIfPresent}from'./metadata.js';import{getRuntimeSkillCacheRoot,safePathSegment}from'./paths.js';import{isRuntimeSkillScope,normalizeRuntimeSkillScopes}from'./scopes.js';export function listLocalRuntimeSkills(_0x55c288,_0x4e2833,_0x2f7529={}){const _0x58e4b2=a156_0x2e55,_0x1f76fe=safePathSegment(_0x55c288[_0x58e4b2(0x1c0)],_0x58e4b2(0x1c0));if(_0x4e2833['appCode']!==_0x1f76fe)throw CliErrors[_0x58e4b2(0x1cc)](_0x58e4b2(0x1d4)+_0x4e2833[_0x58e4b2(0x1c0)]+_0x58e4b2(0x1c2)+_0x1f76fe);const _0x347e30=normalizeRuntimeSkillScopes(_0x55c288['scopes']),_0x37b9c9=new Set(_0x347e30),_0x484723=_0x55c288['code']?.[_0x58e4b2(0x1b8)](),_0x43abcd=new Map(),_0x232a7a=resolve(getRuntimeSkillCacheRoot(_0x55c288[_0x58e4b2(0x1c7)],_0x55c288[_0x58e4b2(0x1c6)],_0x2f7529),_0x1f76fe);for(const _0x4464e8 of _0x347e30){for(const _0x2eab51 of localSkillEntryDirs(resolve(_0x232a7a,_0x4464e8))){collectLocalRuntimeSkill(_0x43abcd,_0x2eab51,{'appCode':_0x1f76fe,'scopes':_0x37b9c9,'code':_0x484723,'source':'cache'});}}for(const _0x27f36f of _0x4e2833[_0x58e4b2(0x1b7)]){for(const _0xf7b797 of localSkillLinkCandidates(_0x27f36f,_0x4e2833,_0x37b9c9)){collectLocalRuntimeSkill(_0x43abcd,_0xf7b797,{'appCode':_0x1f76fe,'scopes':_0x37b9c9,'code':_0x484723,'source':_0x58e4b2(0x1ba),'linkedPath':_0xf7b797});}}return Array[_0x58e4b2(0x1e5)](_0x43abcd[_0x58e4b2(0x1dd)]())[_0x58e4b2(0x1df)](compareLocalRuntimeSkills);}function localSkillEntryDirs(_0x29c501){const _0x35a666=a156_0x2e55;if(!existsSync(_0x29c501))return[];return readdirSync(_0x29c501,{'withFileTypes':!![]})['filter'](_0x2deaa7=>_0x2deaa7[_0x35a666(0x1d5)]()||_0x2deaa7[_0x35a666(0x1d0)]())[_0x35a666(0x1bd)](_0x15c75c=>resolve(_0x29c501,_0x15c75c[_0x35a666(0x1c5)]));}function a156_0x2e55(_0x16702c,_0x180c5d){_0x16702c=_0x16702c-0x1b6;const _0x5d8bd1=a156_0x5d8b();let _0x2e5537=_0x5d8bd1[_0x16702c];return _0x2e5537;}function localSkillLinkCandidates(_0x1365ea,_0x574f82,_0x281159){const _0x3a7c26=a156_0x2e55;if(!existsSync(_0x1365ea))return[];const _0x523e69=_0x574f82[_0x3a7c26(0x1c0)]+'--';return readdirSync(_0x1365ea,{'withFileTypes':!![]})['filter'](_0x56df93=>_0x56df93[_0x3a7c26(0x1d5)]()||_0x56df93[_0x3a7c26(0x1d0)]())[_0x3a7c26(0x1c3)](_0x3f3117=>_0x574f82[_0x3a7c26(0x1cb)]===_0x3a7c26(0x1ce)||_0x3f3117['name'][_0x3a7c26(0x1c8)](_0x523e69)||_0x281159[_0x3a7c26(0x1e2)](_0x3a7c26(0x1d2)))[_0x3a7c26(0x1bd)](_0x212eeb=>resolve(_0x1365ea,_0x212eeb[_0x3a7c26(0x1c5)]));}function collectLocalRuntimeSkill(_0x22b5d1,_0x53e48a,_0x39584b){const _0x304811=a156_0x2e55,_0x16765e=resolve(_0x53e48a,METADATA_FILE),_0x49be51=readMetadataIfPresent(_0x16765e);if(!_0x49be51)return;if(_0x49be51[_0x304811(0x1c0)]!==_0x39584b[_0x304811(0x1c0)])return;if(!isRuntimeSkillScope(_0x49be51['scope'])||!_0x39584b[_0x304811(0x1c1)][_0x304811(0x1e2)](_0x49be51['scope']))return;const _0x825234=_0x49be51[_0x304811(0x1be)]?.[_0x304811(0x1b8)]();if(!_0x825234)return;if(_0x39584b['code']&&_0x825234!==_0x39584b['code'])return;const _0x1c54b6=_0x49be51[_0x304811(0x1cb)]+':'+_0x825234,_0x3c10af=_0x39584b[_0x304811(0x1cf)]?[_0x39584b[_0x304811(0x1cf)]]:[],_0x1a8c2f=_0x22b5d1[_0x304811(0x1c4)](_0x1c54b6);if(_0x1a8c2f){_0x39584b[_0x304811(0x1e0)]===_0x304811(0x1d1)&&(_0x1a8c2f['dir']=_0x53e48a,_0x1a8c2f[_0x304811(0x1d7)]=_0x53e48a,_0x1a8c2f[_0x304811(0x1c9)]=resolve(_0x53e48a,SKILL_FILE),_0x1a8c2f[_0x304811(0x1b9)]=_0x16765e);for(const _0x1e7105 of _0x3c10af){!_0x1a8c2f[_0x304811(0x1ca)][_0x304811(0x1d6)](_0x1e7105)&&_0x1a8c2f['linkedPaths'][_0x304811(0x1de)](_0x1e7105);}_0x1a8c2f[_0x304811(0x1ca)]['sort']();return;}_0x22b5d1[_0x304811(0x1d8)](_0x1c54b6,{..._0x49be51,'tags':Array[_0x304811(0x1dc)](_0x49be51['tags'])?_0x49be51['tags']:[],'scope':_0x49be51[_0x304811(0x1cb)],'source':'local','dir':_0x53e48a,'cacheDir':_0x39584b[_0x304811(0x1e0)]===_0x304811(0x1d1)?_0x53e48a:undefined,'skillMdPath':resolve(_0x53e48a,SKILL_FILE),'metadataPath':_0x16765e,'linkedPaths':_0x3c10af});}function compareLocalRuntimeSkills(_0x2c4b33,_0x176ca1){const _0x5c2f79=a156_0x2e55,_0x30d5df={'personal':0x0,'company':0x1,'builtin':0x2};return _0x30d5df[_0x2c4b33[_0x5c2f79(0x1cb)]]-_0x30d5df[_0x176ca1[_0x5c2f79(0x1cb)]]||_0x2c4b33[_0x5c2f79(0x1be)][_0x5c2f79(0x1e4)](_0x176ca1[_0x5c2f79(0x1be)])||_0x2c4b33[_0x5c2f79(0x1bb)][_0x5c2f79(0x1e4)](_0x176ca1['dir']);}
@@ -1 +1 @@
1
- (function(_0x3a3083,_0x19486b){const _0x3f7510=a156_0x1548,_0x375b37=_0x3a3083();while(!![]){try{const _0x1679cd=-parseInt(_0x3f7510(0xf0))/0x1+-parseInt(_0x3f7510(0xf9))/0x2*(-parseInt(_0x3f7510(0x10a))/0x3)+parseInt(_0x3f7510(0x112))/0x4*(parseInt(_0x3f7510(0x118))/0x5)+-parseInt(_0x3f7510(0xf3))/0x6*(-parseInt(_0x3f7510(0xf1))/0x7)+-parseInt(_0x3f7510(0x101))/0x8+-parseInt(_0x3f7510(0x103))/0x9+-parseInt(_0x3f7510(0x111))/0xa*(-parseInt(_0x3f7510(0x11b))/0xb);if(_0x1679cd===_0x19486b)break;else _0x375b37['push'](_0x375b37['shift']());}catch(_0x3dd949){_0x375b37['push'](_0x375b37['shift']());}}}(a156_0x8b31,0x2b87a));import{readFileSync,readdirSync,realpathSync}from'node:fs';import{relative,resolve}from'node:path';function a156_0x1548(_0x4dfdc1,_0x58ce7c){_0x4dfdc1=_0x4dfdc1-0xee;const _0x8b316a=a156_0x8b31();let _0x1548f5=_0x8b316a[_0x4dfdc1];return _0x1548f5;}import{CliErrors}from'../../errors.js';import{IGNORED_DIR_NAMES,IGNORED_FILE_NAMES,SKILL_FILE}from'./constants.js';function a156_0x8b31(){const _0x4b12cf=['utf8','sort','isSymbolicLink','sha256','100063HfolUD','11774wsOIFR','bytes','654olIwPz','localeCompare','Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20','path','length','startsWith','2WZnEQV','Skill\x20file\x20sha256\x20is\x20invalid:\x20','compare','object','from','Skill\x20file\x20path\x20must\x20be\x20text.','has','toLowerCase','1262472ytpEvV','isArray','2012787whFnQJ','name','add','string','isDirectory','set','toString','359439LSaUxR','values','Duplicate\x20Skill\x20file\x20path:\x20','test','includes','Unsafe\x20Skill\x20file\x20path:\x20','trim','21850mvGzVf','4CRUXDA','size','Skill\x20file\x20size\x20is\x20invalid:\x20','isSafeInteger','excludedFilePaths','content','395835DgMVKe','Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20','replace','1397JHvNsg','isFile','validation'];a156_0x8b31=function(){return _0x4b12cf;};return a156_0x8b31();}export function fileContent(_0x2c1314){const _0x2fead5=a156_0x1548;return _0x2c1314[_0x2fead5(0xf2)]??Buffer['from'](_0x2c1314[_0x2fead5(0x117)]??'',_0x2fead5(0x11e));}export function fileText(_0x3d979e){const _0x50e648=a156_0x1548;return fileContent(_0x3d979e)[_0x50e648(0x109)](_0x50e648(0x11e));}export function normalizeLocalFiles(_0x3add99){const _0x548205=a156_0x1548;if(!Array[_0x548205(0x102)](_0x3add99)||_0x3add99[_0x548205(0xf7)]===0x0)return[];const _0x23e077=new Map();for(const _0x10c666 of _0x3add99){if(!_0x10c666||typeof _0x10c666!=='object'||typeof _0x10c666['path']!==_0x548205(0x106))throw CliErrors[_0x548205(0x11d)](_0x548205(0xfe));const _0x17a96e=normalizeSkillRelativePath(_0x10c666[_0x548205(0xf6)]);if(_0x23e077[_0x548205(0xff)](_0x17a96e))throw CliErrors[_0x548205(0x11d)](_0x548205(0x10c)+_0x17a96e);if(_0x10c666[_0x548205(0xf2)]!==undefined&&!Buffer['isBuffer'](_0x10c666[_0x548205(0xf2)]))throw CliErrors['validation'](_0x548205(0x119)+_0x17a96e);if(_0x10c666[_0x548205(0xf2)]===undefined&&typeof _0x10c666[_0x548205(0x117)]!==_0x548205(0x106))throw CliErrors[_0x548205(0x11d)](_0x548205(0xf5)+_0x17a96e);const _0x45d3c3=fileContent(_0x10c666);_0x23e077['set'](_0x17a96e,{'path':_0x17a96e,'bytes':_0x45d3c3});}return Array['from'](_0x23e077['values']())[_0x548205(0x11f)](compareSkillFiles);}export function normalizeManifestFiles(_0x514fc2){const _0x4cb1ce=a156_0x1548;if(!Array[_0x4cb1ce(0x102)](_0x514fc2)||_0x514fc2[_0x4cb1ce(0xf7)]===0x0)return[];const _0x1e997b=new Map();for(const _0x428795 of _0x514fc2){if(!_0x428795||typeof _0x428795!==_0x4cb1ce(0xfc)||typeof _0x428795['path']!==_0x4cb1ce(0x106))throw CliErrors[_0x4cb1ce(0x11d)](_0x4cb1ce(0xfe));const _0x5286a3=normalizeSkillRelativePath(_0x428795[_0x4cb1ce(0xf6)]);if(_0x1e997b[_0x4cb1ce(0xff)](_0x5286a3))throw CliErrors[_0x4cb1ce(0x11d)](_0x4cb1ce(0x10c)+_0x5286a3);if(!isSha256Hex(_0x428795[_0x4cb1ce(0xef)]))throw CliErrors[_0x4cb1ce(0x11d)](_0x4cb1ce(0xfa)+_0x5286a3);if(!Number[_0x4cb1ce(0x115)](_0x428795[_0x4cb1ce(0x113)])||_0x428795[_0x4cb1ce(0x113)]<0x0)throw CliErrors[_0x4cb1ce(0x11d)](_0x4cb1ce(0x114)+_0x5286a3);_0x1e997b[_0x4cb1ce(0x108)](_0x5286a3,{'path':_0x5286a3,'sha256':_0x428795['sha256'][_0x4cb1ce(0x100)](),'size':_0x428795[_0x4cb1ce(0x113)]});}return Array[_0x4cb1ce(0xfd)](_0x1e997b[_0x4cb1ce(0x10b)]())[_0x4cb1ce(0x11f)](compareSkillFiles);}export function scanSkillDirectory(_0x22d580,_0x4f5fe2={}){const _0x529109=a156_0x1548,_0x279a98=realpathSync(_0x22d580),_0x1ef65f=canonicalExcludedFilePaths(_0x4f5fe2[_0x529109(0x116)]),_0x31f363=[];function _0x16f19b(_0x5c1e26){const _0x2c5d68=_0x529109,_0x36a20f=readdirSync(_0x5c1e26,{'withFileTypes':!![]})[_0x2c5d68(0x11f)]((_0x21ea97,_0x350321)=>_0x21ea97[_0x2c5d68(0x104)][_0x2c5d68(0xf4)](_0x350321[_0x2c5d68(0x104)]));for(const _0x356e5b of _0x36a20f){if(_0x356e5b[_0x2c5d68(0x107)]()&&IGNORED_DIR_NAMES[_0x2c5d68(0xff)](_0x356e5b[_0x2c5d68(0x104)]))continue;if(IGNORED_FILE_NAMES['has'](_0x356e5b['name']))continue;const _0x1bd458=resolve(_0x5c1e26,_0x356e5b[_0x2c5d68(0x104)]);if(isExcludedFilePath(_0x1bd458,_0x1ef65f))continue;if(_0x356e5b[_0x2c5d68(0xee)]())throw CliErrors['validation']('Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20'+_0x1bd458);const _0x1b7f88=toPosixPath(relative(_0x279a98,_0x1bd458));if(_0x356e5b[_0x2c5d68(0x107)]()){_0x16f19b(_0x1bd458);continue;}if(!_0x356e5b[_0x2c5d68(0x11c)]())continue;validateSkillRelativePath(_0x1b7f88);const _0x19d363=readFileSync(_0x1bd458);_0x31f363['push']({'path':_0x1b7f88,'bytes':_0x19d363});}}return _0x16f19b(_0x279a98),normalizeLocalFiles(_0x31f363);}function canonicalExcludedFilePaths(_0x4c2605){const _0x291258=a156_0x1548,_0xc91a17=new Set();for(const _0x56b0a5 of _0x4c2605??[]){const _0x5eda67=resolve(_0x56b0a5);_0xc91a17[_0x291258(0x105)](_0x5eda67);try{_0xc91a17[_0x291258(0x105)](realpathSync(_0x5eda67));}catch{}}return _0xc91a17;}function isExcludedFilePath(_0x53d5a4,_0x2f7ee3){const _0x327da7=a156_0x1548;if(_0x2f7ee3['has'](_0x53d5a4))return!![];if(_0x2f7ee3[_0x327da7(0x113)]===0x0)return![];try{return _0x2f7ee3['has'](realpathSync(_0x53d5a4));}catch{return![];}}export function compareSkillFiles(_0x3a1c42,_0x4908b3){const _0x1aad01=a156_0x1548;if(_0x3a1c42['path']===SKILL_FILE)return _0x4908b3[_0x1aad01(0xf6)]===SKILL_FILE?0x0:-0x1;if(_0x4908b3[_0x1aad01(0xf6)]===SKILL_FILE)return 0x1;return Buffer[_0x1aad01(0xfb)](Buffer[_0x1aad01(0xfd)](_0x3a1c42[_0x1aad01(0xf6)],_0x1aad01(0x11e)),Buffer[_0x1aad01(0xfd)](_0x4908b3[_0x1aad01(0xf6)],'utf8'));}export function normalizeSkillRelativePath(_0x372a66){const _0x2c6605=a156_0x1548,_0xf3246=toPosixPath(_0x372a66[_0x2c6605(0x110)]());return validateSkillRelativePath(_0xf3246),_0xf3246;}export function validateSkillRelativePath(_0xe00dab){const _0x143846=a156_0x1548;if(!_0xe00dab||_0xe00dab[_0x143846(0xf8)]('/')||_0xe00dab[_0x143846(0x10e)]('//'))throw CliErrors['validation'](_0x143846(0x10f)+_0xe00dab);for(const _0x1a1cdd of _0xe00dab['split']('/')){if(!_0x1a1cdd||_0x1a1cdd==='.'||_0x1a1cdd==='..')throw CliErrors[_0x143846(0x11d)](_0x143846(0x10f)+_0xe00dab);}}export function toPosixPath(_0x5dd3d2){const _0x5a3acd=a156_0x1548;return _0x5dd3d2[_0x5a3acd(0x11a)](/\\/g,'/');}export function isSha256Hex(_0x12c886){const _0x1ab233=a156_0x1548;return typeof _0x12c886===_0x1ab233(0x106)&&/^[a-fA-F0-9]{64}$/[_0x1ab233(0x10d)](_0x12c886);}
1
+ (function(_0x51365a,_0x2ca31e){const _0x401dd3=a157_0x59e0,_0x25e11b=_0x51365a();while(!![]){try{const _0x57f82d=-parseInt(_0x401dd3(0x1ab))/0x1+-parseInt(_0x401dd3(0x1ad))/0x2+-parseInt(_0x401dd3(0x1ba))/0x3+parseInt(_0x401dd3(0x199))/0x4+-parseInt(_0x401dd3(0x1b9))/0x5+-parseInt(_0x401dd3(0x1c4))/0x6*(-parseInt(_0x401dd3(0x1b1))/0x7)+parseInt(_0x401dd3(0x19a))/0x8;if(_0x57f82d===_0x2ca31e)break;else _0x25e11b['push'](_0x25e11b['shift']());}catch(_0x248f47){_0x25e11b['push'](_0x25e11b['shift']());}}}(a157_0x569d,0x4d0a7));import{readFileSync,readdirSync,realpathSync}from'node:fs';import{relative,resolve}from'node:path';function a157_0x59e0(_0x1902b8,_0x20db67){_0x1902b8=_0x1902b8-0x196;const _0x569d1c=a157_0x569d();let _0x59e0df=_0x569d1c[_0x1902b8];return _0x59e0df;}import{CliErrors}from'../../errors.js';import{IGNORED_DIR_NAMES,IGNORED_FILE_NAMES,SKILL_FILE}from'./constants.js';function a157_0x569d(){const _0x2a5761=['compare','1437805yXtdsH','837555mvsAzc','values','sha256','Skill\x20file\x20path\x20must\x20be\x20text.','excludedFilePaths','toString','sort','has','path','from','516576JTehdQ','bytes','Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20','trim','171332OmTJrj','12806144VpFocp','size','validation','string','utf8','push','isArray','isDirectory','isSafeInteger','toLowerCase','replace','Duplicate\x20Skill\x20file\x20path:\x20','startsWith','name','localeCompare','isSymbolicLink','add','526991LfFODV','set','812994vYqkCo','length','content','Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20','14GjANLV','split','Unsafe\x20Skill\x20file\x20path:\x20','isBuffer','object','includes','isFile'];a157_0x569d=function(){return _0x2a5761;};return a157_0x569d();}export function fileContent(_0x5f303c){const _0x386dbf=a157_0x59e0;return _0x5f303c[_0x386dbf(0x196)]??Buffer[_0x386dbf(0x1c3)](_0x5f303c[_0x386dbf(0x1af)]??'',_0x386dbf(0x19e));}export function fileText(_0x5641e4){const _0x5ba653=a157_0x59e0;return fileContent(_0x5641e4)[_0x5ba653(0x1bf)](_0x5ba653(0x19e));}export function normalizeLocalFiles(_0x1627c6){const _0x1f5d52=a157_0x59e0;if(!Array[_0x1f5d52(0x1a0)](_0x1627c6)||_0x1627c6[_0x1f5d52(0x1ae)]===0x0)return[];const _0x1dbef9=new Map();for(const _0x5159b0 of _0x1627c6){if(!_0x5159b0||typeof _0x5159b0!==_0x1f5d52(0x1b5)||typeof _0x5159b0['path']!==_0x1f5d52(0x19d))throw CliErrors[_0x1f5d52(0x19c)](_0x1f5d52(0x1bd));const _0x4e2a7c=normalizeSkillRelativePath(_0x5159b0[_0x1f5d52(0x1c2)]);if(_0x1dbef9[_0x1f5d52(0x1c1)](_0x4e2a7c))throw CliErrors[_0x1f5d52(0x19c)](_0x1f5d52(0x1a5)+_0x4e2a7c);if(_0x5159b0[_0x1f5d52(0x196)]!==undefined&&!Buffer[_0x1f5d52(0x1b4)](_0x5159b0[_0x1f5d52(0x196)]))throw CliErrors[_0x1f5d52(0x19c)]('Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20'+_0x4e2a7c);if(_0x5159b0[_0x1f5d52(0x196)]===undefined&&typeof _0x5159b0[_0x1f5d52(0x1af)]!==_0x1f5d52(0x19d))throw CliErrors[_0x1f5d52(0x19c)](_0x1f5d52(0x197)+_0x4e2a7c);const _0x4ef87f=fileContent(_0x5159b0);_0x1dbef9[_0x1f5d52(0x1ac)](_0x4e2a7c,{'path':_0x4e2a7c,'bytes':_0x4ef87f});}return Array[_0x1f5d52(0x1c3)](_0x1dbef9[_0x1f5d52(0x1bb)]())[_0x1f5d52(0x1c0)](compareSkillFiles);}export function normalizeManifestFiles(_0xe90f2c){const _0x590acd=a157_0x59e0;if(!Array[_0x590acd(0x1a0)](_0xe90f2c)||_0xe90f2c[_0x590acd(0x1ae)]===0x0)return[];const _0x6148c0=new Map();for(const _0x1b781f of _0xe90f2c){if(!_0x1b781f||typeof _0x1b781f!==_0x590acd(0x1b5)||typeof _0x1b781f[_0x590acd(0x1c2)]!=='string')throw CliErrors[_0x590acd(0x19c)]('Skill\x20file\x20path\x20must\x20be\x20text.');const _0x4fabae=normalizeSkillRelativePath(_0x1b781f[_0x590acd(0x1c2)]);if(_0x6148c0[_0x590acd(0x1c1)](_0x4fabae))throw CliErrors[_0x590acd(0x19c)](_0x590acd(0x1a5)+_0x4fabae);if(!isSha256Hex(_0x1b781f['sha256']))throw CliErrors[_0x590acd(0x19c)]('Skill\x20file\x20sha256\x20is\x20invalid:\x20'+_0x4fabae);if(!Number[_0x590acd(0x1a2)](_0x1b781f[_0x590acd(0x19b)])||_0x1b781f[_0x590acd(0x19b)]<0x0)throw CliErrors['validation']('Skill\x20file\x20size\x20is\x20invalid:\x20'+_0x4fabae);_0x6148c0[_0x590acd(0x1ac)](_0x4fabae,{'path':_0x4fabae,'sha256':_0x1b781f[_0x590acd(0x1bc)][_0x590acd(0x1a3)](),'size':_0x1b781f['size']});}return Array[_0x590acd(0x1c3)](_0x6148c0[_0x590acd(0x1bb)]())[_0x590acd(0x1c0)](compareSkillFiles);}export function scanSkillDirectory(_0x2b3922,_0x129e76={}){const _0x155426=a157_0x59e0,_0x1cbe0d=realpathSync(_0x2b3922),_0x5e6f8c=canonicalExcludedFilePaths(_0x129e76[_0x155426(0x1be)]),_0x40f8d0=[];function _0x279782(_0x167a19){const _0x58f8ea=_0x155426,_0x50a82b=readdirSync(_0x167a19,{'withFileTypes':!![]})['sort']((_0x2a19f8,_0x28ea3b)=>_0x2a19f8[_0x58f8ea(0x1a7)][_0x58f8ea(0x1a8)](_0x28ea3b['name']));for(const _0x3af74b of _0x50a82b){if(_0x3af74b['isDirectory']()&&IGNORED_DIR_NAMES[_0x58f8ea(0x1c1)](_0x3af74b[_0x58f8ea(0x1a7)]))continue;if(IGNORED_FILE_NAMES[_0x58f8ea(0x1c1)](_0x3af74b[_0x58f8ea(0x1a7)]))continue;const _0x30fe6d=resolve(_0x167a19,_0x3af74b['name']);if(isExcludedFilePath(_0x30fe6d,_0x5e6f8c))continue;if(_0x3af74b[_0x58f8ea(0x1a9)]())throw CliErrors[_0x58f8ea(0x19c)](_0x58f8ea(0x1b0)+_0x30fe6d);const _0x4c20b1=toPosixPath(relative(_0x1cbe0d,_0x30fe6d));if(_0x3af74b[_0x58f8ea(0x1a1)]()){_0x279782(_0x30fe6d);continue;}if(!_0x3af74b[_0x58f8ea(0x1b7)]())continue;validateSkillRelativePath(_0x4c20b1);const _0x181aae=readFileSync(_0x30fe6d);_0x40f8d0[_0x58f8ea(0x19f)]({'path':_0x4c20b1,'bytes':_0x181aae});}}return _0x279782(_0x1cbe0d),normalizeLocalFiles(_0x40f8d0);}function canonicalExcludedFilePaths(_0x4f05d0){const _0x192971=a157_0x59e0,_0x378b5e=new Set();for(const _0x2c7d0a of _0x4f05d0??[]){const _0x18ab6a=resolve(_0x2c7d0a);_0x378b5e[_0x192971(0x1aa)](_0x18ab6a);try{_0x378b5e[_0x192971(0x1aa)](realpathSync(_0x18ab6a));}catch{}}return _0x378b5e;}function isExcludedFilePath(_0x310e0e,_0x5844ac){const _0x569111=a157_0x59e0;if(_0x5844ac[_0x569111(0x1c1)](_0x310e0e))return!![];if(_0x5844ac[_0x569111(0x19b)]===0x0)return![];try{return _0x5844ac[_0x569111(0x1c1)](realpathSync(_0x310e0e));}catch{return![];}}export function compareSkillFiles(_0x593579,_0x33f472){const _0xed4cd0=a157_0x59e0;if(_0x593579[_0xed4cd0(0x1c2)]===SKILL_FILE)return _0x33f472[_0xed4cd0(0x1c2)]===SKILL_FILE?0x0:-0x1;if(_0x33f472[_0xed4cd0(0x1c2)]===SKILL_FILE)return 0x1;return Buffer[_0xed4cd0(0x1b8)](Buffer[_0xed4cd0(0x1c3)](_0x593579['path'],_0xed4cd0(0x19e)),Buffer[_0xed4cd0(0x1c3)](_0x33f472[_0xed4cd0(0x1c2)],_0xed4cd0(0x19e)));}export function normalizeSkillRelativePath(_0x1dcf8e){const _0x4ac83d=a157_0x59e0,_0x5bc3e6=toPosixPath(_0x1dcf8e[_0x4ac83d(0x198)]());return validateSkillRelativePath(_0x5bc3e6),_0x5bc3e6;}export function validateSkillRelativePath(_0x2a6107){const _0x4639a1=a157_0x59e0;if(!_0x2a6107||_0x2a6107[_0x4639a1(0x1a6)]('/')||_0x2a6107[_0x4639a1(0x1b6)]('//'))throw CliErrors[_0x4639a1(0x19c)]('Unsafe\x20Skill\x20file\x20path:\x20'+_0x2a6107);for(const _0x31e7c0 of _0x2a6107[_0x4639a1(0x1b2)]('/')){if(!_0x31e7c0||_0x31e7c0==='.'||_0x31e7c0==='..')throw CliErrors[_0x4639a1(0x19c)](_0x4639a1(0x1b3)+_0x2a6107);}}export function toPosixPath(_0x3bd2bb){const _0x57bc38=a157_0x59e0;return _0x3bd2bb[_0x57bc38(0x1a4)](/\\/g,'/');}export function isSha256Hex(_0x360f43){const _0x1928f5=a157_0x59e0;return typeof _0x360f43===_0x1928f5(0x19d)&&/^[a-fA-F0-9]{64}$/['test'](_0x360f43);}
@@ -1 +1 @@
1
- (function(_0x261ab9,_0x58c1d7){const _0x2ca746=a157_0x43b6,_0x2b4f0a=_0x261ab9();while(!![]){try{const _0x2488d6=parseInt(_0x2ca746(0x105))/0x1+parseInt(_0x2ca746(0xfe))/0x2*(-parseInt(_0x2ca746(0x11c))/0x3)+parseInt(_0x2ca746(0xff))/0x4*(-parseInt(_0x2ca746(0xea))/0x5)+-parseInt(_0x2ca746(0x108))/0x6*(-parseInt(_0x2ca746(0x122))/0x7)+parseInt(_0x2ca746(0x107))/0x8*(-parseInt(_0x2ca746(0xfd))/0x9)+-parseInt(_0x2ca746(0x112))/0xa*(-parseInt(_0x2ca746(0x101))/0xb)+parseInt(_0x2ca746(0x11f))/0xc*(parseInt(_0x2ca746(0x104))/0xd);if(_0x2488d6===_0x58c1d7)break;else _0x2b4f0a['push'](_0x2b4f0a['shift']());}catch(_0x300083){_0x2b4f0a['push'](_0x2b4f0a['shift']());}}}(a157_0x1922,0x5ba2d));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';function a157_0x1922(){const _0x52e4e6=['12LTLZKs','force','path','293636AmCFoM','skillName','version','set','contents','displayName:\x20','64265WmDijr','example','paths','errors','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','entries','appCode','validation','name:\x20','toString','packageBytes','description:\x20','Runtime\x20Skill\x20package\x20is\x20missing\x20','delete','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','status','contentHash','trimEnd','find','18ezCsBy','26gGouCf','116KRqdGU','length','9823lhGBet','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','---\x0a','16024541JxBEWb','41835rHwtJV','test','2395736AMcwOy','12fTqFJb','accessKey','description','map','replace','keys','schemaVersion','env','skillCode','scope','4910qsQBuy','has','filter','isFile','fileHashes','trim','hasOwn','displayName','---','utf8','103809cTSNSR','Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20','flow'];a157_0x1922=function(){return _0x52e4e6;};return a157_0x1922();}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(_0x501c21,_0xec3987,_0x21a6af){const _0x399dde=a157_0x43b6,_0x3d59c3=requireSkillCode(_0x501c21),_0x5bdd94=requirePackageBytes(_0x3d59c3,_0x21a6af[_0x399dde(0xf4)]),_0x44a11b=extractDownloadedPackage(_0x5bdd94),_0x3544fd=_0x44a11b[_0x399dde(0xfc)](_0x3ece27=>_0x3ece27[_0x399dde(0x121)]===SKILL_FILE);if(!_0x3544fd)throw CliErrors[_0x399dde(0xf1)](_0x399dde(0xf6)+SKILL_FILE+':\x20'+_0x3d59c3);const _0x209e2a=withMaterializedSkillFrontmatter(_0x44a11b,_0x501c21,_0x3d59c3),_0x6f0fe4=_0x209e2a['find'](_0x229006=>_0x229006[_0x399dde(0x121)]===SKILL_FILE),_0x20cca8=fileText(_0x6f0fe4),_0x48d0bc=getRuntimeSkillDir(_0x21a6af[_0x399dde(0x10f)],_0x21a6af[_0x399dde(0x109)],_0x21a6af[_0x399dde(0xf0)],_0xec3987,_0x3d59c3,_0x21a6af[_0x399dde(0xec)]),_0x197cc7=resolve(_0x48d0bc,SKILL_FILE),_0x7c4813=resolve(_0x48d0bc,METADATA_FILE),_0x3d5c75=contentHash(_0x20cca8),_0x13f6e6=readMetadataIfPresent(_0x7c4813)?.[_0x399dde(0x116)];ensurePulledFilesCanBeOverwritten(_0x48d0bc,_0x7c4813,_0x209e2a,_0x21a6af[_0x399dde(0x120)]===!![]),mkdirSync(_0x48d0bc,{'recursive':!![],'mode':0x1c0});const _0x134b30=existsSync(_0x197cc7)?readFileSync(_0x197cc7,'utf8'):undefined;return materializeFiles(_0x48d0bc,_0x209e2a),removeStaleManagedFiles(_0x48d0bc,_0x13f6e6,_0x209e2a),writeJsonAtomic(_0x7c4813,buildMetadata(_0x501c21,_0xec3987,_0x21a6af['appCode'],_0x3d5c75,_0x21a6af['pulledAt'],_0x209e2a,_0x5bdd94)),{'skill':_0x501c21,'scope':_0xec3987,'dir':_0x48d0bc,'skillMdPath':_0x197cc7,'metadataPath':_0x7c4813,'contentHash':_0x3d5c75,'changed':_0x134b30!==_0x20cca8};}export function reuseMaterializedRuntimeSkill(_0x36a8b0,_0x694d97,_0x288333){const _0x312363=a157_0x43b6,_0x2608c4=_0x36a8b0[_0x312363(0x124)]?.[_0x312363(0x117)]();if(!_0x2608c4)return undefined;const _0x39aa7e=requireSkillCode(_0x36a8b0),_0x598b9b=getRuntimeSkillDir(_0x288333[_0x312363(0x10f)],_0x288333[_0x312363(0x109)],_0x288333[_0x312363(0xf0)],_0x694d97,_0x39aa7e,_0x288333[_0x312363(0xec)]),_0x15d1b9=resolve(_0x598b9b,SKILL_FILE),_0x2a1df8=resolve(_0x598b9b,METADATA_FILE),_0x1735b3=readMetadataIfPresent(_0x2a1df8);if(!_0x1735b3||_0x1735b3[_0x312363(0x10e)]!==0x2||_0x1735b3[_0x312363(0xf0)]!==_0x288333[_0x312363(0xf0)]||_0x1735b3[_0x312363(0x111)]!==_0x694d97||_0x1735b3[_0x312363(0x110)]!==_0x39aa7e||_0x1735b3[_0x312363(0x124)]!==_0x2608c4||_0x1735b3['id']!==_0x36a8b0['id']||_0x1735b3[_0x312363(0x123)]!==_0x36a8b0[_0x312363(0x123)]||_0x1735b3['description']!==_0x36a8b0['description']||_0x1735b3[_0x312363(0xeb)]!==_0x36a8b0[_0x312363(0xeb)]||_0x1735b3[_0x312363(0xf9)]!==_0x36a8b0['status']||!_0x1735b3[_0x312363(0xfa)]||!_0x1735b3[_0x312363(0x116)]||!Object[_0x312363(0x118)](_0x1735b3[_0x312363(0x116)],SKILL_FILE))return undefined;for(const [_0x4189d0,_0x3c45b1]of Object[_0x312363(0xef)](_0x1735b3[_0x312363(0x116)])){if(!/^[a-f0-9]{64}$/[_0x312363(0x106)](_0x3c45b1))return undefined;const _0x5236cd=resolveManagedFilePath(_0x598b9b,_0x4189d0);if(!existsSync(_0x5236cd)||!lstatSync(_0x5236cd)['isFile']())return undefined;if(bufferSha256(readFileSync(_0x5236cd))!==_0x3c45b1)return undefined;}return{'skill':_0x36a8b0,'scope':_0x694d97,'dir':_0x598b9b,'skillMdPath':_0x15d1b9,'metadataPath':_0x2a1df8,'contentHash':_0x1735b3[_0x312363(0xfa)],'changed':![]};}function withMaterializedSkillFrontmatter(_0x16c226,_0x8a8930,_0x103efc){const _0x3e6129=a157_0x43b6,_0x206d4c=skillDisplayName(_0x8a8930,_0x103efc),_0x3413bc=_0x8a8930['description']?.[_0x3e6129(0x117)]()||_0x206d4c||_0x103efc;return normalizeLocalFiles(_0x16c226)[_0x3e6129(0x10b)](_0x23ead4=>{const _0x1da699=_0x3e6129,_0x1b85a0=fileText(_0x23ead4);if(_0x23ead4[_0x1da699(0x121)]!==SKILL_FILE)return _0x23ead4;if(hasYamlFrontmatter(_0x1b85a0))return{'path':_0x23ead4[_0x1da699(0x121)],'content':withSyncedDisplayName(_0x1b85a0,_0x206d4c)};return{'path':_0x23ead4['path'],'content':prependSkillFrontmatter(_0x1b85a0,{'name':_0x103efc,'displayName':_0x206d4c,'description':_0x3413bc})};});}function a157_0x43b6(_0x2c6dea,_0x3c396f){_0x2c6dea=_0x2c6dea-0xe8;const _0x192295=a157_0x1922();let _0x43b66f=_0x192295[_0x2c6dea];return _0x43b66f;}function hasYamlFrontmatter(_0x4c1df0){const _0x2480e3=a157_0x43b6;return/^\uFEFF?---\s*\r?\n/[_0x2480e3(0x106)](_0x4c1df0);}function prependSkillFrontmatter(_0x5bf6ce,_0x53c297){const _0x336a2f=a157_0x43b6,_0x4a57dc=_0x5bf6ce['replace'](/^\uFEFF/,'');return[_0x336a2f(0x11a),_0x336a2f(0xf2)+yamlString(_0x53c297['name']),_0x53c297['displayName']?_0x336a2f(0xe9)+yamlString(_0x53c297[_0x336a2f(0x119)]):undefined,_0x336a2f(0xf5)+yamlString(_0x53c297[_0x336a2f(0x10a)]),_0x336a2f(0x11a),'',_0x4a57dc][_0x336a2f(0x114)](_0x40d8de=>_0x40d8de!==undefined)['join']('\x0a');}function yamlString(_0x3fab05){const _0x5e9dd1=a157_0x43b6;return JSON['stringify'](_0x3fab05['replace'](/\r/g,'')[_0x5e9dd1(0x117)]());}function skillDisplayName(_0x4a6083,_0x5dfe9c){const _0x53a5d7=a157_0x43b6,_0x5986cc=_0x4a6083[_0x53a5d7(0x123)]?.['trim']();return _0x5986cc||_0x5dfe9c;}function withSyncedDisplayName(_0x51033a,_0x499a8f){const _0x10f98a=a157_0x43b6,_0x3da97f=_0x51033a['match'](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x3da97f)return _0x51033a;const _0x401aa1=_0x3da97f[0x1]??'',_0x138daa=_0x3da97f[0x2]??'',_0x10ab7e=parseDocument(_0x138daa);if(_0x10ab7e[_0x10f98a(0xed)][_0x10f98a(0x100)]>0x0||!isMap(_0x10ab7e[_0x10f98a(0xe8)]))return _0x51033a;if(_0x499a8f)_0x10ab7e[_0x10f98a(0x125)]('displayName',_0x499a8f);else{if(_0x10ab7e['has']('displayName'))_0x10ab7e[_0x10f98a(0xf7)](_0x10f98a(0x119));else return _0x51033a;}forceBlockCollections(_0x10ab7e['contents']);const _0x305a03=_0x10ab7e[_0x10f98a(0xf3)]({'lineWidth':0x0})[_0x10f98a(0xfb)](),_0x2bbf06=_0x51033a['slice'](_0x3da97f[0x0][_0x10f98a(0x100)])[_0x10f98a(0x10c)](/^\r?\n/,'');return _0x401aa1+_0x10f98a(0x103)+_0x305a03+'\x0a---\x0a\x0a'+_0x2bbf06;}function forceBlockCollections(_0x17ad5d){if(!isNode(_0x17ad5d))return;visit(_0x17ad5d,(_0x2a0702,_0x3d4edc)=>{const _0x2fd5bf=a157_0x43b6;isCollection(_0x3d4edc)&&(_0x3d4edc[_0x2fd5bf(0x11e)]=![]);});}function ensurePulledFilesCanBeOverwritten(_0x25e86d,_0x2c82a6,_0x4523b4,_0x3e8b29){const _0x30403e=a157_0x43b6;if(_0x3e8b29||!existsSync(_0x2c82a6))return;const _0x904009=readMetadataIfPresent(_0x2c82a6);if(!_0x904009)return;const _0x58b4f7=_0x904009['fileHashes']&&Object[_0x30403e(0x10d)](_0x904009[_0x30403e(0x116)])['length']>0x0?_0x904009['fileHashes']:undefined;if(_0x58b4f7)for(const [_0x944b4b,_0x499e8e]of Object['entries'](_0x58b4f7)){const _0x239b83=resolveManagedFilePath(_0x25e86d,_0x944b4b);if(!existsSync(_0x239b83))throw CliErrors[_0x30403e(0xf1)](_0x30403e(0x102)+_0x25e86d,'Managed\x20file\x20was\x20removed\x20locally:\x20'+_0x944b4b);const _0x2256a5=lstatSync(_0x239b83);if(!_0x2256a5[_0x30403e(0x115)]())throw CliErrors[_0x30403e(0xf1)](_0x30403e(0x102)+_0x25e86d,_0x30403e(0x11d)+_0x944b4b);const _0x3e0ab5=bufferSha256(readFileSync(_0x239b83));if(_0x3e0ab5!==_0x499e8e)throw CliErrors[_0x30403e(0xf1)](_0x30403e(0x102)+_0x25e86d+'.\x20Changed\x20file:\x20'+_0x944b4b,'Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20'+_0x944b4b);}else{const _0xfe3095=resolve(_0x25e86d,SKILL_FILE);if(existsSync(_0xfe3095)&&_0x904009[_0x30403e(0xfa)]){const _0x382e13=contentHash(readFileSync(_0xfe3095,_0x30403e(0x11b)));if(_0x382e13!==_0x904009[_0x30403e(0xfa)])throw CliErrors['validation'](_0x30403e(0xf8)+_0xfe3095,'Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.');}}for(const _0x222424 of normalizeLocalFiles(_0x4523b4)){if(_0x58b4f7?.[_0x222424[_0x30403e(0x121)]])continue;if(!_0x58b4f7&&_0x222424[_0x30403e(0x121)]===SKILL_FILE)continue;const _0x1e8fa3=resolveManagedFilePath(_0x25e86d,_0x222424[_0x30403e(0x121)]);if(!existsSync(_0x1e8fa3))continue;const _0x51d9d4=lstatSync(_0x1e8fa3);if(!_0x51d9d4[_0x30403e(0x115)]())throw CliErrors['validation'](_0x30403e(0x102)+_0x25e86d,_0x30403e(0xee)+_0x222424['path']);const _0x99b7c3=bufferSha256(readFileSync(_0x1e8fa3));if(_0x99b7c3!==fileHash(_0x222424))throw CliErrors[_0x30403e(0xf1)](_0x30403e(0x102)+_0x25e86d,'Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20'+_0x222424[_0x30403e(0x121)]);}}function materializeFiles(_0x3a843d,_0x3a0f74){const _0x22a828=a157_0x43b6;for(const _0x379a63 of normalizeLocalFiles(_0x3a0f74)){const _0x346c10=resolveManagedFilePath(_0x3a843d,_0x379a63[_0x22a828(0x121)]);mkdirSync(dirname(_0x346c10),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x346c10,fileContent(_0x379a63),0x180);}}function removeStaleManagedFiles(_0x2fcc1c,_0x4e9308,_0x524ff1){const _0x2a9a68=a157_0x43b6;if(!_0x4e9308)return;const _0x4a73f4=new Set(normalizeLocalFiles(_0x524ff1)[_0x2a9a68(0x10b)](_0x2bc74=>_0x2bc74[_0x2a9a68(0x121)]));for(const _0x4e85c5 of Object[_0x2a9a68(0x10d)](_0x4e9308)){if(_0x4a73f4[_0x2a9a68(0x113)](_0x4e85c5))continue;const _0x492633=resolveManagedFilePath(_0x2fcc1c,_0x4e85c5);existsSync(_0x492633)&&lstatSync(_0x492633)[_0x2a9a68(0x115)]()&&rmSync(_0x492633,{'force':!![]});}}
1
+ (function(_0x2f8e34,_0x563318){const _0x2df6f5=a158_0x3777,_0x166697=_0x2f8e34();while(!![]){try{const _0x11f5b0=parseInt(_0x2df6f5(0x14d))/0x1*(-parseInt(_0x2df6f5(0x166))/0x2)+parseInt(_0x2df6f5(0x15c))/0x3*(-parseInt(_0x2df6f5(0x154))/0x4)+-parseInt(_0x2df6f5(0x17b))/0x5*(parseInt(_0x2df6f5(0x14b))/0x6)+parseInt(_0x2df6f5(0x17d))/0x7*(-parseInt(_0x2df6f5(0x16d))/0x8)+parseInt(_0x2df6f5(0x179))/0x9*(-parseInt(_0x2df6f5(0x17e))/0xa)+parseInt(_0x2df6f5(0x16a))/0xb*(-parseInt(_0x2df6f5(0x15f))/0xc)+parseInt(_0x2df6f5(0x17f))/0xd*(parseInt(_0x2df6f5(0x145))/0xe);if(_0x11f5b0===_0x563318)break;else _0x166697['push'](_0x166697['shift']());}catch(_0x4198ef){_0x166697['push'](_0x166697['shift']());}}}(a158_0x4744,0xb539d));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';function a158_0x4744(){const _0x182403=['Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','2781644PKNrFu','Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20','filter','find','trimEnd','status','test','isFile','3AygVDp','skillName','stringify','4415244fhKkkN','trim','version','has','fileHashes','toString','---','8554ODhwnb','flow','hasOwn','skillCode','22mkFMYD','displayName','join','480HLBVAk','description','match','delete','scope','name:\x20','length','path','contents','appCode','keys','description:\x20','3778209stgIWz','schemaVersion','13555fSBcIQ','Runtime\x20Skill\x20package\x20is\x20missing\x20','136059hUZbyT','10IPsMkn','884ySVbxQ','.\x20Changed\x20file:\x20','force','accessKey','replace','displayName:\x20','paths','example','1243592tkMTtM','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','utf8','Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20','pulledAt','entries','2454LLNHVJ','map','274yIHeHB','contentHash','---\x0a','validation','slice','\x0a---\x0a\x0a'];a158_0x4744=function(){return _0x182403;};return a158_0x4744();}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(_0x2b8814,_0x49faad,_0x6af071){const _0x3f42f2=a158_0x3777,_0x49b7ca=requireSkillCode(_0x2b8814),_0x210147=requirePackageBytes(_0x49b7ca,_0x6af071['packageBytes']),_0x2d1f51=extractDownloadedPackage(_0x210147),_0x15d5ab=_0x2d1f51[_0x3f42f2(0x157)](_0x156608=>_0x156608[_0x3f42f2(0x174)]===SKILL_FILE);if(!_0x15d5ab)throw CliErrors[_0x3f42f2(0x150)](_0x3f42f2(0x17c)+SKILL_FILE+':\x20'+_0x49b7ca);const _0xc02b2f=withMaterializedSkillFrontmatter(_0x2d1f51,_0x2b8814,_0x49b7ca),_0x30c2d2=_0xc02b2f['find'](_0x8f26e9=>_0x8f26e9[_0x3f42f2(0x174)]===SKILL_FILE),_0x32c3f6=fileText(_0x30c2d2),_0x20390d=getRuntimeSkillDir(_0x6af071['env'],_0x6af071[_0x3f42f2(0x140)],_0x6af071['appCode'],_0x49faad,_0x49b7ca,_0x6af071[_0x3f42f2(0x143)]),_0x20bb38=resolve(_0x20390d,SKILL_FILE),_0x20e1cc=resolve(_0x20390d,METADATA_FILE),_0x2ab71c=contentHash(_0x32c3f6),_0x7d4766=readMetadataIfPresent(_0x20e1cc)?.['fileHashes'];ensurePulledFilesCanBeOverwritten(_0x20390d,_0x20e1cc,_0xc02b2f,_0x6af071[_0x3f42f2(0x13f)]===!![]),mkdirSync(_0x20390d,{'recursive':!![],'mode':0x1c0});const _0x350373=existsSync(_0x20bb38)?readFileSync(_0x20bb38,_0x3f42f2(0x147)):undefined;return materializeFiles(_0x20390d,_0xc02b2f),removeStaleManagedFiles(_0x20390d,_0x7d4766,_0xc02b2f),writeJsonAtomic(_0x20e1cc,buildMetadata(_0x2b8814,_0x49faad,_0x6af071[_0x3f42f2(0x176)],_0x2ab71c,_0x6af071[_0x3f42f2(0x149)],_0xc02b2f,_0x210147)),{'skill':_0x2b8814,'scope':_0x49faad,'dir':_0x20390d,'skillMdPath':_0x20bb38,'metadataPath':_0x20e1cc,'contentHash':_0x2ab71c,'changed':_0x350373!==_0x32c3f6};}export function reuseMaterializedRuntimeSkill(_0x2ece1a,_0x334928,_0xf9c736){const _0x43b94e=a158_0x3777,_0x34d07b=_0x2ece1a[_0x43b94e(0x161)]?.[_0x43b94e(0x160)]();if(!_0x34d07b)return undefined;const _0x3c4039=requireSkillCode(_0x2ece1a),_0x4d4533=getRuntimeSkillDir(_0xf9c736['env'],_0xf9c736[_0x43b94e(0x140)],_0xf9c736[_0x43b94e(0x176)],_0x334928,_0x3c4039,_0xf9c736[_0x43b94e(0x143)]),_0x547b7b=resolve(_0x4d4533,SKILL_FILE),_0x347017=resolve(_0x4d4533,METADATA_FILE),_0x44a794=readMetadataIfPresent(_0x347017);if(!_0x44a794||_0x44a794[_0x43b94e(0x17a)]!==0x2||_0x44a794[_0x43b94e(0x176)]!==_0xf9c736['appCode']||_0x44a794[_0x43b94e(0x171)]!==_0x334928||_0x44a794[_0x43b94e(0x169)]!==_0x3c4039||_0x44a794[_0x43b94e(0x161)]!==_0x34d07b||_0x44a794['id']!==_0x2ece1a['id']||_0x44a794['skillName']!==_0x2ece1a[_0x43b94e(0x15d)]||_0x44a794[_0x43b94e(0x16e)]!==_0x2ece1a[_0x43b94e(0x16e)]||_0x44a794[_0x43b94e(0x144)]!==_0x2ece1a[_0x43b94e(0x144)]||_0x44a794[_0x43b94e(0x159)]!==_0x2ece1a['status']||!_0x44a794[_0x43b94e(0x14e)]||!_0x44a794['fileHashes']||!Object[_0x43b94e(0x168)](_0x44a794['fileHashes'],SKILL_FILE))return undefined;for(const [_0x23730b,_0x30aa90]of Object[_0x43b94e(0x14a)](_0x44a794[_0x43b94e(0x163)])){if(!/^[a-f0-9]{64}$/[_0x43b94e(0x15a)](_0x30aa90))return undefined;const _0x360c86=resolveManagedFilePath(_0x4d4533,_0x23730b);if(!existsSync(_0x360c86)||!lstatSync(_0x360c86)['isFile']())return undefined;if(bufferSha256(readFileSync(_0x360c86))!==_0x30aa90)return undefined;}return{'skill':_0x2ece1a,'scope':_0x334928,'dir':_0x4d4533,'skillMdPath':_0x547b7b,'metadataPath':_0x347017,'contentHash':_0x44a794[_0x43b94e(0x14e)],'changed':![]};}function withMaterializedSkillFrontmatter(_0x57b3ce,_0x27a2a9,_0x478b76){const _0x4bdba2=a158_0x3777,_0x585940=skillDisplayName(_0x27a2a9,_0x478b76),_0x1805c8=_0x27a2a9['description']?.['trim']()||_0x585940||_0x478b76;return normalizeLocalFiles(_0x57b3ce)[_0x4bdba2(0x14c)](_0x4ec4ab=>{const _0x2b5303=_0x4bdba2,_0x30069c=fileText(_0x4ec4ab);if(_0x4ec4ab['path']!==SKILL_FILE)return _0x4ec4ab;if(hasYamlFrontmatter(_0x30069c))return{'path':_0x4ec4ab['path'],'content':withSyncedDisplayName(_0x30069c,_0x585940)};return{'path':_0x4ec4ab[_0x2b5303(0x174)],'content':prependSkillFrontmatter(_0x30069c,{'name':_0x478b76,'displayName':_0x585940,'description':_0x1805c8})};});}function hasYamlFrontmatter(_0x26e28f){const _0x2cd7d2=a158_0x3777;return/^\uFEFF?---\s*\r?\n/[_0x2cd7d2(0x15a)](_0x26e28f);}function prependSkillFrontmatter(_0x38a0a0,_0x4b3f92){const _0x5b57e=a158_0x3777,_0x466f8a=_0x38a0a0[_0x5b57e(0x141)](/^\uFEFF/,'');return[_0x5b57e(0x165),_0x5b57e(0x172)+yamlString(_0x4b3f92['name']),_0x4b3f92[_0x5b57e(0x16b)]?_0x5b57e(0x142)+yamlString(_0x4b3f92['displayName']):undefined,_0x5b57e(0x178)+yamlString(_0x4b3f92[_0x5b57e(0x16e)]),_0x5b57e(0x165),'',_0x466f8a][_0x5b57e(0x156)](_0x508a46=>_0x508a46!==undefined)[_0x5b57e(0x16c)]('\x0a');}function yamlString(_0x174922){const _0x10898f=a158_0x3777;return JSON[_0x10898f(0x15e)](_0x174922['replace'](/\r/g,'')[_0x10898f(0x160)]());}function skillDisplayName(_0x5c159c,_0x105f90){const _0x393a21=a158_0x3777,_0x4e71ff=_0x5c159c[_0x393a21(0x15d)]?.['trim']();return _0x4e71ff||_0x105f90;}function withSyncedDisplayName(_0x1b08be,_0x2c2185){const _0x34ee4a=a158_0x3777,_0x2a4e04=_0x1b08be[_0x34ee4a(0x16f)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x2a4e04)return _0x1b08be;const _0xc3ade0=_0x2a4e04[0x1]??'',_0x5b783f=_0x2a4e04[0x2]??'',_0x44c885=parseDocument(_0x5b783f);if(_0x44c885['errors']['length']>0x0||!isMap(_0x44c885['contents']))return _0x1b08be;if(_0x2c2185)_0x44c885['set'](_0x34ee4a(0x16b),_0x2c2185);else{if(_0x44c885[_0x34ee4a(0x162)](_0x34ee4a(0x16b)))_0x44c885[_0x34ee4a(0x170)](_0x34ee4a(0x16b));else return _0x1b08be;}forceBlockCollections(_0x44c885[_0x34ee4a(0x175)]);const _0x23e338=_0x44c885[_0x34ee4a(0x164)]({'lineWidth':0x0})[_0x34ee4a(0x158)](),_0x3b8fed=_0x1b08be[_0x34ee4a(0x151)](_0x2a4e04[0x0][_0x34ee4a(0x173)])[_0x34ee4a(0x141)](/^\r?\n/,'');return _0xc3ade0+_0x34ee4a(0x14f)+_0x23e338+_0x34ee4a(0x152)+_0x3b8fed;}function forceBlockCollections(_0x2b9ebf){if(!isNode(_0x2b9ebf))return;visit(_0x2b9ebf,(_0xf494df,_0x3ba21e)=>{const _0x4a9a4d=a158_0x3777;isCollection(_0x3ba21e)&&(_0x3ba21e[_0x4a9a4d(0x167)]=![]);});}function ensurePulledFilesCanBeOverwritten(_0x9ebe3,_0x57246b,_0x4758cf,_0x356ce7){const _0x44742d=a158_0x3777;if(_0x356ce7||!existsSync(_0x57246b))return;const _0x25219c=readMetadataIfPresent(_0x57246b);if(!_0x25219c)return;const _0x1b61f9=_0x25219c[_0x44742d(0x163)]&&Object[_0x44742d(0x177)](_0x25219c[_0x44742d(0x163)])['length']>0x0?_0x25219c[_0x44742d(0x163)]:undefined;if(_0x1b61f9)for(const [_0x470efe,_0x3cc8f6]of Object['entries'](_0x1b61f9)){const _0x2f8740=resolveManagedFilePath(_0x9ebe3,_0x470efe);if(!existsSync(_0x2f8740))throw CliErrors[_0x44742d(0x150)](_0x44742d(0x153)+_0x9ebe3,'Managed\x20file\x20was\x20removed\x20locally:\x20'+_0x470efe);const _0x4b11bb=lstatSync(_0x2f8740);if(!_0x4b11bb[_0x44742d(0x15b)]())throw CliErrors[_0x44742d(0x150)](_0x44742d(0x153)+_0x9ebe3,_0x44742d(0x148)+_0x470efe);const _0x47a10d=bufferSha256(readFileSync(_0x2f8740));if(_0x47a10d!==_0x3cc8f6)throw CliErrors[_0x44742d(0x150)](_0x44742d(0x153)+_0x9ebe3+_0x44742d(0x13e)+_0x470efe,_0x44742d(0x146)+_0x470efe);}else{const _0x2cc39c=resolve(_0x9ebe3,SKILL_FILE);if(existsSync(_0x2cc39c)&&_0x25219c['contentHash']){const _0x1b15ce=contentHash(readFileSync(_0x2cc39c,'utf8'));if(_0x1b15ce!==_0x25219c['contentHash'])throw CliErrors[_0x44742d(0x150)]('Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20'+_0x2cc39c,'Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.');}}for(const _0x364e33 of normalizeLocalFiles(_0x4758cf)){if(_0x1b61f9?.[_0x364e33['path']])continue;if(!_0x1b61f9&&_0x364e33[_0x44742d(0x174)]===SKILL_FILE)continue;const _0x371359=resolveManagedFilePath(_0x9ebe3,_0x364e33[_0x44742d(0x174)]);if(!existsSync(_0x371359))continue;const _0x369acb=lstatSync(_0x371359);if(!_0x369acb[_0x44742d(0x15b)]())throw CliErrors[_0x44742d(0x150)](_0x44742d(0x153)+_0x9ebe3,'Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20'+_0x364e33[_0x44742d(0x174)]);const _0x8e4ba1=bufferSha256(readFileSync(_0x371359));if(_0x8e4ba1!==fileHash(_0x364e33))throw CliErrors[_0x44742d(0x150)](_0x44742d(0x153)+_0x9ebe3,_0x44742d(0x155)+_0x364e33[_0x44742d(0x174)]);}}function a158_0x3777(_0x3af79c,_0x4313be){_0x3af79c=_0x3af79c-0x13e;const _0x47446a=a158_0x4744();let _0x377727=_0x47446a[_0x3af79c];return _0x377727;}function materializeFiles(_0x8dbdc6,_0x456895){const _0x52f973=a158_0x3777;for(const _0x19b715 of normalizeLocalFiles(_0x456895)){const _0x5e5c89=resolveManagedFilePath(_0x8dbdc6,_0x19b715[_0x52f973(0x174)]);mkdirSync(dirname(_0x5e5c89),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x5e5c89,fileContent(_0x19b715),0x180);}}function removeStaleManagedFiles(_0x89c85d,_0x1be84f,_0x4198c6){const _0x1937cd=a158_0x3777;if(!_0x1be84f)return;const _0x29c6b6=new Set(normalizeLocalFiles(_0x4198c6)['map'](_0x10e34b=>_0x10e34b[_0x1937cd(0x174)]));for(const _0x247573 of Object[_0x1937cd(0x177)](_0x1be84f)){if(_0x29c6b6[_0x1937cd(0x162)](_0x247573))continue;const _0x4970a3=resolveManagedFilePath(_0x89c85d,_0x247573);existsSync(_0x4970a3)&&lstatSync(_0x4970a3)[_0x1937cd(0x15b)]()&&rmSync(_0x4970a3,{'force':!![]});}}
@@ -1 +1 @@
1
- (function(_0x483d4f,_0x3e92ba){const _0x5569e5=a158_0x51c5,_0x3cb548=_0x483d4f();while(!![]){try{const _0x5cd66a=-parseInt(_0x5569e5(0x1b5))/0x1+parseInt(_0x5569e5(0x1b1))/0x2*(parseInt(_0x5569e5(0x1a7))/0x3)+parseInt(_0x5569e5(0x19d))/0x4+parseInt(_0x5569e5(0x199))/0x5+-parseInt(_0x5569e5(0x196))/0x6+parseInt(_0x5569e5(0x1a5))/0x7*(parseInt(_0x5569e5(0x1b7))/0x8)+-parseInt(_0x5569e5(0x1a0))/0x9;if(_0x5cd66a===_0x3e92ba)break;else _0x3cb548['push'](_0x3cb548['shift']());}catch(_0x37a819){_0x3cb548['push'](_0x3cb548['shift']());}}}(a158_0x58ce,0x21d24));import{existsSync,readFileSync}from'node:fs';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';function a158_0x58ce(){const _0xad2129=['userId','Runtime\x20Skill\x20is\x20missing\x20skillCode.','fromEntries','forkedFromVersion','description','36PvWOpf','hasUpstreamUpdate','utf8','status','164085eddOVs','trim','554056pWPXFD','zipSha256','string','personal','object','664512SiFfmr','manifest','ossPath','1260635gByaIx','length','tenantCode','validation','178572NFloNz','zipSize','readonly','1473696nxLgcj','tags','path','isArray','skillCode','7uXLSqf','skillName','35181xNvyWI','parse','toISOString','files','version'];a158_0x58ce=function(){return _0xad2129;};return a158_0x58ce();}import{fileContent,normalizeLocalFiles}from'./local-files.js';function a158_0x51c5(_0x5ea6ef,_0x34bcd2){_0x5ea6ef=_0x5ea6ef-0x194;const _0x58ce9d=a158_0x58ce();let _0x51c53e=_0x58ce9d[_0x5ea6ef];return _0x51c53e;}import{buildSkillPackage,localFilesToManifestFiles}from'./zip-package.js';export function buildMetadata(_0x241d26,_0x31ae06,_0x315b1f,_0x5d735a,_0x258174,_0x2d52a1,_0x509b35){const _0x312a31=a158_0x51c5,_0x6cd6ff=_0x2d52a1?normalizeLocalFiles(_0x2d52a1):[],_0x484a4e=!_0x509b35&&_0x6cd6ff[_0x312a31(0x19a)]>0x0?buildSkillPackage(_0x6cd6ff):undefined,_0x314a00=_0x509b35?bufferSha256(_0x509b35):_0x484a4e?.[_0x312a31(0x197)][_0x312a31(0x1b8)],_0x254d05=_0x509b35?.['length']??_0x484a4e?.[_0x312a31(0x197)][_0x312a31(0x19e)],_0xe5370c=_0x6cd6ff[_0x312a31(0x19a)]>0x0?Object[_0x312a31(0x1ae)](_0x6cd6ff['map'](_0x525422=>[_0x525422[_0x312a31(0x1a2)],fileHash(_0x525422)])):undefined;return{'schemaVersion':_0x6cd6ff[_0x312a31(0x19a)]>0x0?0x2:0x1,'id':_0x241d26['id'],'appCode':_0x315b1f,'skillCode':requireSkillCode(_0x241d26),'skillName':_0x241d26[_0x312a31(0x1a6)],'description':_0x241d26[_0x312a31(0x1b0)],'example':_0x241d26['example'],'scope':_0x31ae06,'readonly':_0x31ae06!==_0x312a31(0x194)||_0x241d26[_0x312a31(0x19f)]===!![],'tenantCode':_0x241d26[_0x312a31(0x19b)],'userId':_0x241d26[_0x312a31(0x1ac)],'version':_0x241d26[_0x312a31(0x1ab)],'status':_0x241d26[_0x312a31(0x1b4)],'tags':Array[_0x312a31(0x1a3)](_0x241d26[_0x312a31(0x1a1)])?_0x241d26['tags']:[],'hasUpstreamUpdate':_0x241d26[_0x312a31(0x1b2)],'forkedFromSkillId':_0x241d26['forkedFromSkillId'],'forkedFromVersion':_0x241d26[_0x312a31(0x1af)],'sourceSessionId':_0x241d26['sourceSessionId'],'contentHash':_0x5d735a,'fileHashes':_0xe5370c,'treeHash':_0x6cd6ff[_0x312a31(0x19a)]>0x0?fileTreeHash(localFilesToManifestFiles(_0x6cd6ff)):undefined,'ossPath':remoteManifestOssPath(_0x241d26[_0x312a31(0x1aa)]),'zipSha256':_0x314a00,'zipSize':_0x254d05,'files':_0x6cd6ff[_0x312a31(0x19a)]>0x0?_0x6cd6ff['map'](_0x1f1263=>({'path':_0x1f1263[_0x312a31(0x1a2)],'hash':fileHash(_0x1f1263),'size':fileContent(_0x1f1263)[_0x312a31(0x19a)]})):undefined,'pulledAt':_0x258174??new Date()[_0x312a31(0x1a9)]()};}export function requireSkillCode(_0x171d03){const _0x467bf2=a158_0x51c5,_0x4cabff=_0x171d03[_0x467bf2(0x1a4)]?.[_0x467bf2(0x1b6)]();if(!_0x4cabff)throw CliErrors[_0x467bf2(0x19c)](_0x467bf2(0x1ad));return _0x4cabff;}export function readMetadataIfPresent(_0x44f4a8){const _0x18e0d9=a158_0x51c5;if(!existsSync(_0x44f4a8))return undefined;try{const _0x1d275b=JSON[_0x18e0d9(0x1a8)](readFileSync(_0x44f4a8,_0x18e0d9(0x1b3)));return _0x1d275b;}catch{throw CliErrors[_0x18e0d9(0x19c)]('Invalid\x20'+METADATA_FILE+':\x20'+_0x44f4a8);}}function remoteManifestOssPath(_0x408eaa){const _0x86d395=a158_0x51c5;if(!_0x408eaa||typeof _0x408eaa!==_0x86d395(0x195)||Array[_0x86d395(0x1a3)](_0x408eaa))return undefined;const _0x4a0164=_0x408eaa[_0x86d395(0x198)];return typeof _0x4a0164===_0x86d395(0x1b9)&&_0x4a0164['trim']()?_0x4a0164[_0x86d395(0x1b6)]():undefined;}
1
+ function a159_0x2792(_0x185fdb,_0x3ea2dc){_0x185fdb=_0x185fdb-0x9c;const _0x56e2b1=a159_0x56e2();let _0x2792e2=_0x56e2b1[_0x185fdb];return _0x2792e2;}(function(_0x48d188,_0x361a3b){const _0x2b3acb=a159_0x2792,_0x5cc911=_0x48d188();while(!![]){try{const _0x95125=parseInt(_0x2b3acb(0xa5))/0x1*(-parseInt(_0x2b3acb(0xac))/0x2)+-parseInt(_0x2b3acb(0xba))/0x3*(-parseInt(_0x2b3acb(0xbd))/0x4)+-parseInt(_0x2b3acb(0xb7))/0x5+-parseInt(_0x2b3acb(0xb6))/0x6+parseInt(_0x2b3acb(0xbc))/0x7*(-parseInt(_0x2b3acb(0xae))/0x8)+-parseInt(_0x2b3acb(0xbb))/0x9+parseInt(_0x2b3acb(0xa9))/0xa;if(_0x95125===_0x361a3b)break;else _0x5cc911['push'](_0x5cc911['shift']());}catch(_0x2795f3){_0x5cc911['push'](_0x5cc911['shift']());}}}(a159_0x56e2,0xc2ac6));function a159_0x56e2(){const _0x47efb1=['zipSize','skillCode','Runtime\x20Skill\x20is\x20missing\x20skillCode.','sourceSessionId','status','version','utf8','userId','path','description','trim','192263guGpEB','parse','forkedFromSkillId','zipSha256','47186860hOBNmV','toISOString','personal','14GQqnkW','manifest','1064VAHzAy','tenantCode','isArray','object','forkedFromVersion','tags','fromEntries','Invalid\x20','6867648GtSeOx','4332855IKkYdu','length','validation','3VhiqBn','1789533exZByG','41832jsEQnT','1717444sjbKAq','map'];a159_0x56e2=function(){return _0x47efb1;};return a159_0x56e2();}import{existsSync,readFileSync}from'node:fs';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';import{fileContent,normalizeLocalFiles}from'./local-files.js';import{buildSkillPackage,localFilesToManifestFiles}from'./zip-package.js';export function buildMetadata(_0x16c0e7,_0x5ccd28,_0x48943f,_0x469819,_0x26856c,_0x5c8a2a,_0x5e0a31){const _0x46bf91=a159_0x2792,_0x590dc9=_0x5c8a2a?normalizeLocalFiles(_0x5c8a2a):[],_0x262799=!_0x5e0a31&&_0x590dc9['length']>0x0?buildSkillPackage(_0x590dc9):undefined,_0x24af09=_0x5e0a31?bufferSha256(_0x5e0a31):_0x262799?.[_0x46bf91(0xad)][_0x46bf91(0xa8)],_0x23e370=_0x5e0a31?.[_0x46bf91(0xb8)]??_0x262799?.[_0x46bf91(0xad)][_0x46bf91(0xbf)],_0xf2976f=_0x590dc9[_0x46bf91(0xb8)]>0x0?Object[_0x46bf91(0xb4)](_0x590dc9['map'](_0x270e40=>[_0x270e40[_0x46bf91(0xa2)],fileHash(_0x270e40)])):undefined;return{'schemaVersion':_0x590dc9[_0x46bf91(0xb8)]>0x0?0x2:0x1,'id':_0x16c0e7['id'],'appCode':_0x48943f,'skillCode':requireSkillCode(_0x16c0e7),'skillName':_0x16c0e7['skillName'],'description':_0x16c0e7[_0x46bf91(0xa3)],'example':_0x16c0e7['example'],'scope':_0x5ccd28,'readonly':_0x5ccd28!==_0x46bf91(0xab)||_0x16c0e7['readonly']===!![],'tenantCode':_0x16c0e7[_0x46bf91(0xaf)],'userId':_0x16c0e7[_0x46bf91(0xa1)],'version':_0x16c0e7[_0x46bf91(0x9f)],'status':_0x16c0e7[_0x46bf91(0x9e)],'tags':Array[_0x46bf91(0xb0)](_0x16c0e7['tags'])?_0x16c0e7[_0x46bf91(0xb3)]:[],'hasUpstreamUpdate':_0x16c0e7['hasUpstreamUpdate'],'forkedFromSkillId':_0x16c0e7[_0x46bf91(0xa7)],'forkedFromVersion':_0x16c0e7[_0x46bf91(0xb2)],'sourceSessionId':_0x16c0e7[_0x46bf91(0x9d)],'contentHash':_0x469819,'fileHashes':_0xf2976f,'treeHash':_0x590dc9[_0x46bf91(0xb8)]>0x0?fileTreeHash(localFilesToManifestFiles(_0x590dc9)):undefined,'ossPath':remoteManifestOssPath(_0x16c0e7['files']),'zipSha256':_0x24af09,'zipSize':_0x23e370,'files':_0x590dc9[_0x46bf91(0xb8)]>0x0?_0x590dc9[_0x46bf91(0xbe)](_0x1af452=>({'path':_0x1af452[_0x46bf91(0xa2)],'hash':fileHash(_0x1af452),'size':fileContent(_0x1af452)[_0x46bf91(0xb8)]})):undefined,'pulledAt':_0x26856c??new Date()[_0x46bf91(0xaa)]()};}export function requireSkillCode(_0x4558e0){const _0x51fc35=a159_0x2792,_0x3f7c61=_0x4558e0[_0x51fc35(0xc0)]?.['trim']();if(!_0x3f7c61)throw CliErrors['validation'](_0x51fc35(0x9c));return _0x3f7c61;}export function readMetadataIfPresent(_0x3ea02b){const _0x1ef29c=a159_0x2792;if(!existsSync(_0x3ea02b))return undefined;try{const _0x23962a=JSON[_0x1ef29c(0xa6)](readFileSync(_0x3ea02b,_0x1ef29c(0xa0)));return _0x23962a;}catch{throw CliErrors[_0x1ef29c(0xb9)](_0x1ef29c(0xb5)+METADATA_FILE+':\x20'+_0x3ea02b);}}function remoteManifestOssPath(_0x180963){const _0x59afb8=a159_0x2792;if(!_0x180963||typeof _0x180963!==_0x59afb8(0xb1)||Array['isArray'](_0x180963))return undefined;const _0x457151=_0x180963['ossPath'];return typeof _0x457151==='string'&&_0x457151[_0x59afb8(0xa4)]()?_0x457151['trim']():undefined;}
@@ -1 +1 @@
1
- (function(_0x545efb,_0x3cb482){const _0x3571f6=a159_0x359a,_0x5f0a67=_0x545efb();while(!![]){try{const _0x1a0118=parseInt(_0x3571f6(0x134))/0x1*(-parseInt(_0x3571f6(0x135))/0x2)+-parseInt(_0x3571f6(0x11d))/0x3+parseInt(_0x3571f6(0x11e))/0x4*(-parseInt(_0x3571f6(0x119))/0x5)+-parseInt(_0x3571f6(0x12d))/0x6*(-parseInt(_0x3571f6(0x122))/0x7)+-parseInt(_0x3571f6(0x124))/0x8*(parseInt(_0x3571f6(0x128))/0x9)+-parseInt(_0x3571f6(0x123))/0xa*(-parseInt(_0x3571f6(0x12c))/0xb)+-parseInt(_0x3571f6(0x125))/0xc*(-parseInt(_0x3571f6(0x130))/0xd);if(_0x1a0118===_0x3cb482)break;else _0x5f0a67['push'](_0x5f0a67['shift']());}catch(_0x5182a8){_0x5f0a67['push'](_0x5f0a67['shift']());}}}(a159_0x3b9e,0x440a3));import{existsSync}from'node:fs';function a159_0x3b9e(){const _0x465a2c=['SKILL_ROOT','filter','skills','11iastPB','201384vxZxrJ','homeDir','homeDirName','13cffAAu','validation','CLAUDE_SKILL_ROOT','claudeSkillsDir','214wfUmyp','2252GUxIkm','289415bLrxcm','trim','Unsafe\x20','includes','1459122SJPTau','8rAbkgY','skillCode','.workbuddy','agentsSkillsDir','112Umnuwz','1353960NnuxoC','22576XRUZpo','8609580YAktpq','workbuddySkillsDir','cacheRoot','855HiEDDL'];a159_0x3b9e=function(){return _0x465a2c;};return a159_0x3b9e();}import{homedir}from'node:os';import{resolve}from'node:path';import{fingerprintAccessKey}from'../../commands/app/cache.js';function a159_0x359a(_0x3c4728,_0x8baf0a){_0x3c4728=_0x3c4728-0x119;const _0x3b9e61=a159_0x3b9e();let _0x359ac5=_0x3b9e61[_0x3c4728];return _0x359ac5;}import{PRODUCT_CONFIG,productEnv}from'../../constant/product.js';import{CliErrors}from'../../errors.js';export function resolveSkillSyncPaths(_0x23b53b={}){const _0x402f12=a159_0x359a,_0x215b52=_0x23b53b[_0x402f12(0x12e)]??homedir(),_0x330295=resolve(_0x215b52,PRODUCT_CONFIG['homeDirName'],'cache'),_0x229218=trimmedEnv(_0x402f12(0x129)),_0xb578a5=trimmedEnv(_0x402f12(0x132)),_0x240fb2=resolve(_0x215b52,_0x402f12(0x120)),_0x4007bd=_0x23b53b[_0x402f12(0x126)]??(existsSync(_0x240fb2)?resolve(_0x240fb2,_0x402f12(0x12b)):undefined);return{'homeDir':_0x215b52,'cacheRoot':_0x330295,'managedRoot':resolve(_0x215b52,PRODUCT_CONFIG[_0x402f12(0x12f)]),'agentsSkillsDir':_0x23b53b[_0x402f12(0x121)]??_0x229218??resolve(_0x215b52,'.agents',_0x402f12(0x12b)),'claudeSkillsDir':_0x23b53b['claudeSkillsDir']??_0xb578a5??resolve(_0x215b52,'.claude',_0x402f12(0x12b)),'workbuddySkillsDir':_0x4007bd};}export function runtimeAgentSkillRoots(_0x5045a5){const _0x3b29fc=a159_0x359a;return[_0x5045a5[_0x3b29fc(0x121)],_0x5045a5[_0x3b29fc(0x133)],_0x5045a5[_0x3b29fc(0x126)]][_0x3b29fc(0x12a)](_0x150d12=>Boolean(_0x150d12));}export function getRuntimeSkillCacheRoot(_0x250457,_0x43ca67,_0x1e6a07={}){const _0x229a4a=a159_0x359a,_0x47d3c6=resolveSkillSyncPaths(_0x1e6a07);return resolve(_0x47d3c6[_0x229a4a(0x127)],_0x250457,fingerprintAccessKey(_0x43ca67),_0x229a4a(0x12b));}export function getRuntimeSkillDir(_0x98970e,_0x43ab10,_0x3961fe,_0x3230c5,_0x415f15,_0x40a261={}){const _0x38460d=a159_0x359a;return resolve(getRuntimeSkillCacheRoot(_0x98970e,_0x43ab10,_0x40a261),safePathSegment(_0x3961fe,'appCode'),_0x3230c5,safePathSegment(_0x415f15,_0x38460d(0x11f)));}export function safePathSegment(_0x58012a,_0x2ae131='path\x20segment'){const _0x29af8d=a159_0x359a;if(!_0x58012a||_0x58012a[_0x29af8d(0x11c)]('/')||_0x58012a[_0x29af8d(0x11c)]('\x5c')||_0x58012a[_0x29af8d(0x11c)]('..'))throw CliErrors[_0x29af8d(0x131)](_0x29af8d(0x11b)+_0x2ae131+'\x20for\x20local\x20path:\x20'+_0x58012a);return _0x58012a;}function trimmedEnv(_0x48bf4e){const _0x4f5401=a159_0x359a,_0x329baf=productEnv(_0x48bf4e)?.[_0x4f5401(0x11a)]();return _0x329baf?_0x329baf:undefined;}
1
+ const a160_0x210c63=a160_0x39e9;(function(_0x326c1a,_0x6cbb1f){const _0x25032c=a160_0x39e9,_0x5cb25a=_0x326c1a();while(!![]){try{const _0x53feca=-parseInt(_0x25032c(0x16b))/0x1*(-parseInt(_0x25032c(0x181))/0x2)+-parseInt(_0x25032c(0x168))/0x3*(parseInt(_0x25032c(0x176))/0x4)+parseInt(_0x25032c(0x172))/0x5*(-parseInt(_0x25032c(0x17e))/0x6)+parseInt(_0x25032c(0x164))/0x7*(parseInt(_0x25032c(0x169))/0x8)+-parseInt(_0x25032c(0x16c))/0x9+parseInt(_0x25032c(0x17b))/0xa+parseInt(_0x25032c(0x17a))/0xb;if(_0x53feca===_0x6cbb1f)break;else _0x5cb25a['push'](_0x5cb25a['shift']());}catch(_0x13c33a){_0x5cb25a['push'](_0x5cb25a['shift']());}}}(a160_0xcc26,0x83e28));import{existsSync}from'node:fs';import{homedir}from'node:os';function a160_0xcc26(){const _0x1e2611=['filter','11119273KVduqE','6090150qGqeeD','Unsafe\x20','path\x20segment','145242dKvjOU','trim','validation','12226ZiCyJl','SKILL_ROOT','\x20for\x20local\x20path:\x20','266edZxzM','skills','agentsSkillsDir','skillCode','1398kOyOYv','10168qNrboq','cache','3YiQhRZ','6517791qklBFJ','claudeSkillsDir','.agents','CLAUDE_SKILL_ROOT','workbuddySkillsDir','homeDirName','20pjCVYp','includes','.claude','homeDir','2792uEHsFH','appCode','cacheRoot'];a160_0xcc26=function(){return _0x1e2611;};return a160_0xcc26();}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(_0x3c0d26={}){const _0x8a9f90=a160_0x39e9,_0x211d66=_0x3c0d26[_0x8a9f90(0x175)]??homedir(),_0x4c8ec7=resolve(_0x211d66,PRODUCT_CONFIG[_0x8a9f90(0x171)],_0x8a9f90(0x16a)),_0xa815e4=trimmedEnv(_0x8a9f90(0x162)),_0x11b5e5=trimmedEnv(_0x8a9f90(0x16f)),_0x1f9800=resolve(_0x211d66,'.workbuddy'),_0x13c36f=_0x3c0d26[_0x8a9f90(0x170)]??(existsSync(_0x1f9800)?resolve(_0x1f9800,_0x8a9f90(0x165)):undefined);return{'homeDir':_0x211d66,'cacheRoot':_0x4c8ec7,'managedRoot':resolve(_0x211d66,PRODUCT_CONFIG[_0x8a9f90(0x171)]),'agentsSkillsDir':_0x3c0d26[_0x8a9f90(0x166)]??_0xa815e4??resolve(_0x211d66,_0x8a9f90(0x16e),_0x8a9f90(0x165)),'claudeSkillsDir':_0x3c0d26[_0x8a9f90(0x16d)]??_0x11b5e5??resolve(_0x211d66,_0x8a9f90(0x174),'skills'),'workbuddySkillsDir':_0x13c36f};}function a160_0x39e9(_0x5aeee1,_0x381b59){_0x5aeee1=_0x5aeee1-0x162;const _0xcc2673=a160_0xcc26();let _0x39e981=_0xcc2673[_0x5aeee1];return _0x39e981;}export function runtimeAgentSkillRoots(_0x3e604d){const _0x56ffbe=a160_0x39e9;return[_0x3e604d[_0x56ffbe(0x166)],_0x3e604d[_0x56ffbe(0x16d)],_0x3e604d[_0x56ffbe(0x170)]][_0x56ffbe(0x179)](_0x1bb9b9=>Boolean(_0x1bb9b9));}export function getRuntimeSkillCacheRoot(_0x38a765,_0x1253e0,_0x7614ae={}){const _0x418a83=a160_0x39e9,_0x16644f=resolveSkillSyncPaths(_0x7614ae);return resolve(_0x16644f[_0x418a83(0x178)],_0x38a765,fingerprintAccessKey(_0x1253e0),'skills');}export function getRuntimeSkillDir(_0x50f59e,_0x5bdeae,_0x13f01a,_0x10b73f,_0x57771a,_0x1515a4={}){const _0x34d682=a160_0x39e9;return resolve(getRuntimeSkillCacheRoot(_0x50f59e,_0x5bdeae,_0x1515a4),safePathSegment(_0x13f01a,_0x34d682(0x177)),_0x10b73f,safePathSegment(_0x57771a,_0x34d682(0x167)));}export function safePathSegment(_0x2ebdc1,_0x2a0d87=a160_0x210c63(0x17d)){const _0x42d6cb=a160_0x210c63;if(!_0x2ebdc1||_0x2ebdc1[_0x42d6cb(0x173)]('/')||_0x2ebdc1[_0x42d6cb(0x173)]('\x5c')||_0x2ebdc1['includes']('..'))throw CliErrors[_0x42d6cb(0x180)](_0x42d6cb(0x17c)+_0x2a0d87+_0x42d6cb(0x163)+_0x2ebdc1);return _0x2ebdc1;}function trimmedEnv(_0x4e868f){const _0x59cb1c=a160_0x210c63,_0x54e487=productEnv(_0x4e868f)?.[_0x59cb1c(0x17f)]();return _0x54e487?_0x54e487:undefined;}
@@ -1 +1 @@
1
- (function(_0x1b8dca,_0x357736){const _0x4ddaff=a160_0x2c98,_0x103e21=_0x1b8dca();while(!![]){try{const _0x4d624d=-parseInt(_0x4ddaff(0x1d1))/0x1*(-parseInt(_0x4ddaff(0x1b1))/0x2)+parseInt(_0x4ddaff(0x1c0))/0x3*(parseInt(_0x4ddaff(0x1a4))/0x4)+parseInt(_0x4ddaff(0x1af))/0x5*(parseInt(_0x4ddaff(0x1d4))/0x6)+-parseInt(_0x4ddaff(0x1c7))/0x7+parseInt(_0x4ddaff(0x1a5))/0x8+parseInt(_0x4ddaff(0x1d6))/0x9+parseInt(_0x4ddaff(0x1b2))/0xa*(-parseInt(_0x4ddaff(0x1ba))/0xb);if(_0x4d624d===_0x357736)break;else _0x103e21['push'](_0x103e21['shift']());}catch(_0x1866dd){_0x103e21['push'](_0x103e21['shift']());}}}(a160_0x2449,0x9979c));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a160_0x97acaf}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';function a160_0x2c98(_0x237e21,_0x550e69){_0x237e21=_0x237e21-0x196;const _0x244926=a160_0x2449();let _0x2c98d8=_0x244926[_0x237e21];return _0x2c98d8;}import{buildMetadata,readMetadataIfPresent}from'./metadata.js';import{buildSkillPackage,tryNormalizePackageManifest}from'./zip-package.js';export function resolvePushDirectoryIdentity(_0x11a4d8,_0x14475e,_0x279a71={}){const _0x5a8a95=a160_0x2c98,_0x4320ec=resolvePushDirectoryRoot(_0x11a4d8),_0x240213=readPushMetadataIfPresent(resolve(_0x4320ec,METADATA_FILE),{'ignoreInvalidMetadata':_0x279a71['ignoreInvalidMetadata']});if(_0x240213?.[_0x5a8a95(0x1ac)]&&_0x240213[_0x5a8a95(0x1ac)]!==_0x14475e&&!_0x279a71['allowAppCodeRetarget']&&!_0x279a71['ignoreMetadataAppCodeMismatch'])throw CliErrors[_0x5a8a95(0x1a6)](_0x5a8a95(0x1ce)+_0x240213['appCode']+'\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22'+_0x14475e+'\x22.');const _0x11be59=resolvePushSkillCode(_0x4320ec,_0x14475e,_0x240213,_0x279a71);if(!_0x11be59)throw CliErrors[_0x5a8a95(0x1a6)]('Unable\x20to\x20resolve\x20skillCode\x20from\x20'+SKILL_FILE+',\x20'+METADATA_FILE+_0x5a8a95(0x1b0));return{'dir':_0x4320ec,'skillCode':_0x11be59,'metadata':_0x240213};}function a160_0x2449(){const _0x2770bd=['refreshedAt','Skill\x20directory\x20not\x20found:\x20','dir','(unknown)','files','Skill\x20metadata\x20appCode\x20\x22','toLowerCase','isFile','248377GwlFVE','ignoreInvalidMetadata','string','6rCCXUC','company','1566261JGqCFL','name','object','\x20has\x20scope=\x22','isArray','trim','tags','scope','description','Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20','number','\x20name\x20for\x20SkillHub\x20slug\x20generation.','slice','version','skillName','example','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20','isSymbolicLink','displayName','61844OReggC','4436424plZXWl','validation','skillCode','isDirectory','match','replace','\x20to\x20submit\x20company\x20Skills\x20for\x20review.','appCode','length','excludedFilePaths','3535355yaAaUG',',\x20or\x20directory\x20name.','4uuxEaU','1120SPGAxc','Remote\x20Skill\x20','manifest','utf8','Invalid\x20','metadata','unknown','content','62106UasNai','find','some','personal','path','boolean','57CPhKQP','ignoreMetadataForPayload','ignoreMetadataScope','startsWith','targetScope','ignoreMetadataSkillCode','builtin','6756246ZCzQTP','sourceSessionId'];a160_0x2449=function(){return _0x2770bd;};return a160_0x2449();}export function readPushDirectory(_0x187e92,_0x362f31,_0x17dde3={}){const _0x22fa78=a160_0x2c98,_0x2c2a51=resolvePushDirectoryIdentity(_0x187e92,_0x362f31,_0x17dde3),_0x180963=_0x2c2a51[_0x22fa78(0x1cb)],_0x3bf74f=resolve(_0x180963,SKILL_FILE);if(!existsSync(_0x3bf74f)||!lstatSync(_0x3bf74f)[_0x22fa78(0x1d0)]())throw CliErrors[_0x22fa78(0x1a6)]('Missing\x20'+SKILL_FILE+':\x20'+_0x3bf74f);const _0x5bc166=_0x2c2a51[_0x22fa78(0x1b7)],_0x5b2bb1=_0x17dde3[_0x22fa78(0x1c4)]??_0x22fa78(0x1bd);if(!_0x17dde3['ignoreMetadataScope']&&_0x5bc166?.[_0x22fa78(0x198)]==='builtin')throw CliErrors[_0x22fa78(0x1a6)](_0x22fa78(0x19a)+METADATA_FILE+_0x22fa78(0x1d9)+_0x5bc166['scope']+'\x22.');if(!_0x17dde3[_0x22fa78(0x1c2)]&&_0x5b2bb1==='personal'&&_0x5bc166?.['scope']&&_0x5bc166['scope']!==_0x22fa78(0x1bd))throw CliErrors[_0x22fa78(0x1a6)](_0x22fa78(0x1a1)+METADATA_FILE+_0x22fa78(0x1d9)+_0x5bc166[_0x22fa78(0x198)]+'\x22.','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20'+_0x180963+_0x22fa78(0x1ab));const _0xef562b=scanSkillDirectory(_0x180963,{'excludedFilePaths':_0x17dde3[_0x22fa78(0x1ae)]}),_0x2a6fea=buildSkillPackage(_0xef562b),_0x211cec=readFileSync(_0x3bf74f,_0x22fa78(0x1b5)),_0x1d93fd=_0x2c2a51[_0x22fa78(0x1a7)],_0x30f4cb=_0x17dde3[_0x22fa78(0x1c1)]?undefined:_0x5bc166,_0x2a570f=readSkillDisplayName(_0x211cec);return{'skillCode':_0x1d93fd,'metadata':_0x5bc166,'frontmatterDisplayName':_0x2a570f,'input':{'skillCode':_0x1d93fd,'skillName':_0x2a570f??_0x30f4cb?.[_0x22fa78(0x19f)],'description':_0x30f4cb?.['description'],'content':_0x211cec,'files':_0x2a6fea[_0x22fa78(0x1b4)],'packageBase64':_0x2a6fea['packageBase64'],'tags':_0x30f4cb?.[_0x22fa78(0x197)],'version':_0x30f4cb?.[_0x22fa78(0x19e)],'sourceSessionId':_0x30f4cb?.[_0x22fa78(0x1c8)]}};}export function refreshPushDirectoryMetadataFromRemote(_0x571f32,_0x24e4b3,_0x5fe483,_0x207e49={}){const _0x476744=a160_0x2c98,_0x1a62ec=resolvePushDirectoryRoot(_0x571f32),_0x1002c4=readPushMetadataIfPresent(resolve(_0x1a62ec,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x3a42c0=requireRemoteScope(_0x24e4b3),_0xbb02c6=readLocalSkillContent(_0x1a62ec),_0xd3cddf={..._0x24e4b3,'appCode':_0x24e4b3[_0x476744(0x1ac)]??_0x5fe483,'skillName':_0x24e4b3['skillName']??_0x1002c4?.['skillName'],'description':_0x24e4b3['description']??_0x1002c4?.[_0x476744(0x199)],'example':_0x24e4b3['example']??_0x1002c4?.[_0x476744(0x1a0)],'tags':Array[_0x476744(0x1da)](_0x24e4b3[_0x476744(0x197)])?_0x24e4b3[_0x476744(0x197)]:_0x1002c4?.[_0x476744(0x197)],'sourceSessionId':_0x24e4b3[_0x476744(0x1c8)]??_0x1002c4?.[_0x476744(0x1c8)],'content':_0x24e4b3[_0x476744(0x1b9)]??_0xbb02c6},_0x1df278=buildMetadata(_0xd3cddf,_0x3a42c0,_0x5fe483,contentHash(_0xbb02c6),_0x207e49[_0x476744(0x1c9)]);writeJsonAtomic(resolve(_0x1a62ec,METADATA_FILE),_0x1df278);}export function recordPushedRuntimeSkill(_0x2e6395,_0x3d65ed,_0x425047,_0x4e20e4={}){const _0xffbf60=a160_0x2c98,_0x5b164b=resolvePushDirectoryRoot(_0x2e6395),_0x5dc820=scanSkillDirectory(_0x5b164b),_0x2a3ab9=_0x5dc820[_0xffbf60(0x1bb)](_0x20f70f=>_0x20f70f['path']===SKILL_FILE),_0x7b9662=_0x2a3ab9?fileText(_0x2a3ab9):'',_0x3e71df=tryNormalizePackageManifest(_0x3d65ed['files']),_0x503ccb={..._0x3d65ed,'content':_0x3d65ed[_0xffbf60(0x1b9)]??_0x7b9662,'files':_0x3e71df},_0xedb044=_0x3e71df?normalizeLocalFiles(_0x5dc820)['filter'](_0xfcb2e6=>_0x3e71df[_0xffbf60(0x1cd)][_0xffbf60(0x1bc)](_0x457168=>_0x457168['path']===_0xfcb2e6[_0xffbf60(0x1be)])):undefined,_0x5f0129=buildMetadata(_0x503ccb,_0x4e20e4[_0xffbf60(0x198)]??_0xffbf60(0x1bd),_0x425047,contentHash(_0x503ccb['content']??''),_0x4e20e4['pushedAt'],_0xedb044);writeJsonAtomic(resolve(_0x5b164b,METADATA_FILE),_0x5f0129);}export function deriveSkillCodeFromDirectory(_0x491500,_0x2e7062){const _0x3cc67f=a160_0x2c98,_0x2f0f86=basename(resolve(_0x491500)),_0x1ac9f8=_0x2e7062+'--';return _0x2f0f86[_0x3cc67f(0x1c3)](_0x1ac9f8)?_0x2f0f86[_0x3cc67f(0x19d)](_0x1ac9f8[_0x3cc67f(0x1ad)]):_0x2f0f86;}function resolvePushSkillCode(_0x3a3de3,_0x5b5465,_0x49edac,_0x47c099){const _0x11fec5=a160_0x2c98,_0x55338c=deriveSkillCodeFromSkillFile(_0x3a3de3)||deriveSkillCodeFromDirectory(_0x3a3de3,_0x5b5465);if(_0x47c099[_0x11fec5(0x1c5)])return _0x55338c;return _0x49edac?.[_0x11fec5(0x1a7)]?.['trim']()||_0x55338c;}function deriveSkillCodeFromSkillFile(_0xde76a6){const _0x504294=a160_0x2c98,_0x4ecfde=resolve(_0xde76a6,SKILL_FILE);if(!existsSync(_0x4ecfde)||!lstatSync(_0x4ecfde)[_0x504294(0x1d0)]())return undefined;const _0x43443d=readFileSync(_0x4ecfde,_0x504294(0x1b5)),_0x5a171b=_0x43443d[_0x504294(0x1a9)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x5a171b)return undefined;const _0x133c3d=parseFrontmatterObject(_0x5a171b[0x1]??''),_0xe36a2f=scalarToString(_0x133c3d?.[_0x504294(0x1d7)]);return _0xe36a2f?slugifySkillName(_0xe36a2f):undefined;}function readSkillDisplayName(_0x16c3c5){const _0x2aa6f6=a160_0x2c98,_0x2e0218=_0x16c3c5['match'](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x2e0218)return undefined;const _0x99c0d8=parseFrontmatterObject(_0x2e0218[0x1]??'');return scalarToString(_0x99c0d8?.[_0x2aa6f6(0x1a3)]);}function slugifySkillName(_0x3dfef5){const _0x17953b=a160_0x2c98,_0x48b025=_0x3dfef5[_0x17953b(0x196)]()[_0x17953b(0x1cf)]()[_0x17953b(0x1aa)](/[^\p{L}\p{N}\p{So}]+/gu,'-')['replace'](/^-+/,'')['replace'](/-+$/,'')[_0x17953b(0x1aa)](/-{2,}/g,'-');if(!_0x48b025)throw CliErrors[_0x17953b(0x1a6)](_0x17953b(0x1b6)+SKILL_FILE+_0x17953b(0x19c));return _0x48b025;}function parseFrontmatterObject(_0x2938c6){const _0x12c65c=a160_0x2c98;try{const _0x2739da=a160_0x97acaf(_0x2938c6);return _0x2739da&&typeof _0x2739da===_0x12c65c(0x1d8)&&!Array[_0x12c65c(0x1da)](_0x2739da)?_0x2739da:undefined;}catch{return undefined;}}function scalarToString(_0x57152b){const _0x184ddf=a160_0x2c98;if(typeof _0x57152b===_0x184ddf(0x1d3))return _0x57152b[_0x184ddf(0x196)]();if(typeof _0x57152b===_0x184ddf(0x19b)||typeof _0x57152b===_0x184ddf(0x1bf))return String(_0x57152b);return undefined;}function resolvePushDirectoryRoot(_0x10fb19){const _0x17e99a=a160_0x2c98,_0x169b55=resolve(_0x10fb19);if(!existsSync(_0x169b55))throw CliErrors[_0x17e99a(0x1a6)](_0x17e99a(0x1ca)+_0x10fb19);const _0x472fdd=lstatSync(_0x169b55);if(_0x472fdd['isDirectory']())return _0x169b55;if(_0x472fdd[_0x17e99a(0x1a2)]()){const _0x12c928=realpathSync(_0x169b55);if(lstatSync(_0x12c928)[_0x17e99a(0x1a8)]())return _0x12c928;}throw CliErrors['validation'](_0x17e99a(0x1ca)+_0x10fb19);}function requireRemoteScope(_0x10bce6){const _0x5c0deb=a160_0x2c98;if(_0x10bce6['scope']===_0x5c0deb(0x1bd)||_0x10bce6[_0x5c0deb(0x198)]===_0x5c0deb(0x1d5)||_0x10bce6[_0x5c0deb(0x198)]===_0x5c0deb(0x1c6))return _0x10bce6[_0x5c0deb(0x198)];throw CliErrors[_0x5c0deb(0x1a6)](_0x5c0deb(0x1b3)+(_0x10bce6[_0x5c0deb(0x1a7)]||_0x5c0deb(0x1cc))+'\x20has\x20unsupported\x20scope\x20\x22'+(_0x10bce6['scope']??_0x5c0deb(0x1b8))+'\x22.');}function readLocalSkillContent(_0x1cbe07){const _0xb9a23a=a160_0x2c98,_0x1065e4=resolve(_0x1cbe07,SKILL_FILE);return existsSync(_0x1065e4)&&lstatSync(_0x1065e4)[_0xb9a23a(0x1d0)]()?readFileSync(_0x1065e4,'utf8'):'';}function readPushMetadataIfPresent(_0x13db10,_0x5421f8={}){const _0x61a28b=a160_0x2c98;try{return readMetadataIfPresent(_0x13db10);}catch(_0x128564){if(_0x5421f8[_0x61a28b(0x1d2)])return undefined;throw _0x128564;}}
1
+ (function(_0x16df2a,_0x449eb9){const _0xabbfe2=a161_0x3a16,_0x57f30f=_0x16df2a();while(!![]){try{const _0x48b2d0=-parseInt(_0xabbfe2(0x1b8))/0x1*(parseInt(_0xabbfe2(0x1b1))/0x2)+-parseInt(_0xabbfe2(0x19a))/0x3+parseInt(_0xabbfe2(0x1a1))/0x4*(parseInt(_0xabbfe2(0x1b7))/0x5)+-parseInt(_0xabbfe2(0x1ab))/0x6*(parseInt(_0xabbfe2(0x1b3))/0x7)+parseInt(_0xabbfe2(0x1c9))/0x8+-parseInt(_0xabbfe2(0x1a8))/0x9*(parseInt(_0xabbfe2(0x1ad))/0xa)+parseInt(_0xabbfe2(0x1ac))/0xb*(parseInt(_0xabbfe2(0x198))/0xc);if(_0x48b2d0===_0x449eb9)break;else _0x57f30f['push'](_0x57f30f['shift']());}catch(_0x40e6ab){_0x57f30f['push'](_0x57f30f['shift']());}}}(a161_0x43f2,0x191db));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a161_0x379468}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(_0x4fa43e,_0x35f9a7,_0x332467={}){const _0x541ffd=a161_0x3a16,_0x3abb2d=resolvePushDirectoryRoot(_0x4fa43e),_0x36306d=readPushMetadataIfPresent(resolve(_0x3abb2d,METADATA_FILE),{'ignoreInvalidMetadata':_0x332467[_0x541ffd(0x1bf)]});if(_0x36306d?.[_0x541ffd(0x1d0)]&&_0x36306d[_0x541ffd(0x1d0)]!==_0x35f9a7&&!_0x332467[_0x541ffd(0x1a4)]&&!_0x332467['ignoreMetadataAppCodeMismatch'])throw CliErrors[_0x541ffd(0x197)](_0x541ffd(0x1c4)+_0x36306d['appCode']+_0x541ffd(0x1c8)+_0x35f9a7+'\x22.');const _0x28eb29=resolvePushSkillCode(_0x3abb2d,_0x35f9a7,_0x36306d,_0x332467);if(!_0x28eb29)throw CliErrors[_0x541ffd(0x197)](_0x541ffd(0x19d)+SKILL_FILE+',\x20'+METADATA_FILE+_0x541ffd(0x195));return{'dir':_0x3abb2d,'skillCode':_0x28eb29,'metadata':_0x36306d};}export function readPushDirectory(_0x538767,_0x1b02aa,_0x36ef9a={}){const _0x25a0ac=a161_0x3a16,_0x4e3759=resolvePushDirectoryIdentity(_0x538767,_0x1b02aa,_0x36ef9a),_0x33fc84=_0x4e3759[_0x25a0ac(0x1a3)],_0x3e650a=resolve(_0x33fc84,SKILL_FILE);if(!existsSync(_0x3e650a)||!lstatSync(_0x3e650a)[_0x25a0ac(0x1cc)]())throw CliErrors[_0x25a0ac(0x197)](_0x25a0ac(0x1d3)+SKILL_FILE+':\x20'+_0x3e650a);const _0x4122dd=_0x4e3759[_0x25a0ac(0x1b6)],_0xe905ce=_0x36ef9a[_0x25a0ac(0x19c)]??'personal';if(!_0x36ef9a['ignoreMetadataScope']&&_0x4122dd?.[_0x25a0ac(0x19e)]===_0x25a0ac(0x1ce))throw CliErrors[_0x25a0ac(0x197)](_0x25a0ac(0x1d1)+METADATA_FILE+_0x25a0ac(0x1ae)+_0x4122dd[_0x25a0ac(0x19e)]+'\x22.');if(!_0x36ef9a[_0x25a0ac(0x1c5)]&&_0xe905ce===_0x25a0ac(0x1bb)&&_0x4122dd?.[_0x25a0ac(0x19e)]&&_0x4122dd[_0x25a0ac(0x19e)]!==_0x25a0ac(0x1bb))throw CliErrors['validation']('Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20'+METADATA_FILE+_0x25a0ac(0x1ae)+_0x4122dd[_0x25a0ac(0x19e)]+'\x22.',_0x25a0ac(0x1bd)+_0x33fc84+'\x20to\x20submit\x20company\x20Skills\x20for\x20review.');const _0x59c54e=scanSkillDirectory(_0x33fc84,{'excludedFilePaths':_0x36ef9a[_0x25a0ac(0x196)]}),_0x2ec48a=buildSkillPackage(_0x59c54e),_0x4d6dd2=readFileSync(_0x3e650a,'utf8'),_0x19a4e3=_0x4e3759['skillCode'],_0x3a2a0f=_0x36ef9a['ignoreMetadataForPayload']?undefined:_0x4122dd,_0x547140=readSkillDisplayName(_0x4d6dd2);return{'skillCode':_0x19a4e3,'metadata':_0x4122dd,'frontmatterDisplayName':_0x547140,'input':{'skillCode':_0x19a4e3,'skillName':_0x547140??_0x3a2a0f?.[_0x25a0ac(0x1b9)],'description':_0x3a2a0f?.[_0x25a0ac(0x19f)],'content':_0x4d6dd2,'files':_0x2ec48a[_0x25a0ac(0x1a7)],'packageBase64':_0x2ec48a['packageBase64'],'tags':_0x3a2a0f?.[_0x25a0ac(0x1a9)],'version':_0x3a2a0f?.[_0x25a0ac(0x1ba)],'sourceSessionId':_0x3a2a0f?.[_0x25a0ac(0x1aa)]}};}export function refreshPushDirectoryMetadataFromRemote(_0x33fc29,_0x37b17a,_0x795d46,_0x15a1c1={}){const _0x14ccce=a161_0x3a16,_0x3e51e2=resolvePushDirectoryRoot(_0x33fc29),_0x535dfd=readPushMetadataIfPresent(resolve(_0x3e51e2,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x2568bc=requireRemoteScope(_0x37b17a),_0x426a1b=readLocalSkillContent(_0x3e51e2),_0x51bba6={..._0x37b17a,'appCode':_0x37b17a[_0x14ccce(0x1d0)]??_0x795d46,'skillName':_0x37b17a[_0x14ccce(0x1b9)]??_0x535dfd?.[_0x14ccce(0x1b9)],'description':_0x37b17a[_0x14ccce(0x19f)]??_0x535dfd?.[_0x14ccce(0x19f)],'example':_0x37b17a[_0x14ccce(0x1d5)]??_0x535dfd?.[_0x14ccce(0x1d5)],'tags':Array[_0x14ccce(0x1c1)](_0x37b17a[_0x14ccce(0x1a9)])?_0x37b17a['tags']:_0x535dfd?.[_0x14ccce(0x1a9)],'sourceSessionId':_0x37b17a['sourceSessionId']??_0x535dfd?.[_0x14ccce(0x1aa)],'content':_0x37b17a['content']??_0x426a1b},_0x46d389=buildMetadata(_0x51bba6,_0x2568bc,_0x795d46,contentHash(_0x426a1b),_0x15a1c1['refreshedAt']);writeJsonAtomic(resolve(_0x3e51e2,METADATA_FILE),_0x46d389);}export function recordPushedRuntimeSkill(_0x1d54d6,_0x4e4eb4,_0x5a1fe2,_0x2db433={}){const _0x5304af=a161_0x3a16,_0x1c8b16=resolvePushDirectoryRoot(_0x1d54d6),_0x16e3eb=scanSkillDirectory(_0x1c8b16),_0x2ec93f=_0x16e3eb[_0x5304af(0x1b5)](_0x4d832a=>_0x4d832a['path']===SKILL_FILE),_0x218e34=_0x2ec93f?fileText(_0x2ec93f):'',_0x1ebb2f=tryNormalizePackageManifest(_0x4e4eb4[_0x5304af(0x1cb)]),_0x33757f={..._0x4e4eb4,'content':_0x4e4eb4[_0x5304af(0x1cd)]??_0x218e34,'files':_0x1ebb2f},_0xb2b064=_0x1ebb2f?normalizeLocalFiles(_0x16e3eb)[_0x5304af(0x1cf)](_0x179a3d=>_0x1ebb2f[_0x5304af(0x1cb)]['some'](_0x35bed7=>_0x35bed7[_0x5304af(0x1c6)]===_0x179a3d['path'])):undefined,_0x313527=buildMetadata(_0x33757f,_0x2db433[_0x5304af(0x19e)]??_0x5304af(0x1bb),_0x5a1fe2,contentHash(_0x33757f['content']??''),_0x2db433['pushedAt'],_0xb2b064);writeJsonAtomic(resolve(_0x1c8b16,METADATA_FILE),_0x313527);}export function deriveSkillCodeFromDirectory(_0x1e46af,_0x32e520){const _0x5d7cb8=a161_0x3a16,_0x3b5d3b=basename(resolve(_0x1e46af)),_0x1f7200=_0x32e520+'--';return _0x3b5d3b[_0x5d7cb8(0x1c0)](_0x1f7200)?_0x3b5d3b[_0x5d7cb8(0x1be)](_0x1f7200['length']):_0x3b5d3b;}function resolvePushSkillCode(_0x430793,_0x482f33,_0xaff42,_0x244071){const _0x54bca7=a161_0x3a16,_0x33cb1b=deriveSkillCodeFromSkillFile(_0x430793)||deriveSkillCodeFromDirectory(_0x430793,_0x482f33);if(_0x244071['ignoreMetadataSkillCode'])return _0x33cb1b;return _0xaff42?.[_0x54bca7(0x1c3)]?.[_0x54bca7(0x1a6)]()||_0x33cb1b;}function deriveSkillCodeFromSkillFile(_0x9fa5a2){const _0x3f9ce1=a161_0x3a16,_0x3aff2f=resolve(_0x9fa5a2,SKILL_FILE);if(!existsSync(_0x3aff2f)||!lstatSync(_0x3aff2f)[_0x3f9ce1(0x1cc)]())return undefined;const _0x4cf99b=readFileSync(_0x3aff2f,'utf8'),_0x6eedfc=_0x4cf99b['match'](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x6eedfc)return undefined;const _0x577f75=parseFrontmatterObject(_0x6eedfc[0x1]??''),_0x4fc288=scalarToString(_0x577f75?.['name']);return _0x4fc288?slugifySkillName(_0x4fc288):undefined;}function readSkillDisplayName(_0x559faf){const _0x1527ec=a161_0x3a16,_0x2591ff=_0x559faf[_0x1527ec(0x1b0)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x2591ff)return undefined;const _0x20fb03=parseFrontmatterObject(_0x2591ff[0x1]??'');return scalarToString(_0x20fb03?.[_0x1527ec(0x1b2)]);}function a161_0x3a16(_0xdbd7ce,_0x3f96a2){_0xdbd7ce=_0xdbd7ce-0x195;const _0x43f2ac=a161_0x43f2();let _0x3a16e8=_0x43f2ac[_0xdbd7ce];return _0x3a16e8;}function a161_0x43f2(){const _0x44698d=['Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20','isDirectory','Missing\x20','Invalid\x20','example',',\x20or\x20directory\x20name.','excludedFilePaths','validation','84bkzDCV','toLowerCase','243834NGkdLZ','(unknown)','targetScope','Unable\x20to\x20resolve\x20skillCode\x20from\x20','scope','description','utf8','1572uKHikh','\x20has\x20unsupported\x20scope\x20\x22','dir','allowAppCodeRetarget','Skill\x20directory\x20not\x20found:\x20','trim','manifest','9rAuQXK','tags','sourceSessionId','77046ggFYPg','134717dbIMyq','1448980aayZQs','\x20has\x20scope=\x22','object','match','3466JZElJV','displayName','7nnRoUN','replace','find','metadata','1585FTWLdu','11CAAtZQ','skillName','version','personal','number','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20','slice','ignoreInvalidMetadata','startsWith','isArray','company','skillCode','Skill\x20metadata\x20appCode\x20\x22','ignoreMetadataScope','path','\x20name\x20for\x20SkillHub\x20slug\x20generation.','\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22','1205160IAQMTJ','isSymbolicLink','files','isFile','content','builtin','filter','appCode'];a161_0x43f2=function(){return _0x44698d;};return a161_0x43f2();}function slugifySkillName(_0x306cbf){const _0x369be1=a161_0x3a16,_0x3ae505=_0x306cbf['trim']()[_0x369be1(0x199)]()[_0x369be1(0x1b4)](/[^\p{L}\p{N}\p{So}]+/gu,'-')['replace'](/^-+/,'')[_0x369be1(0x1b4)](/-+$/,'')[_0x369be1(0x1b4)](/-{2,}/g,'-');if(!_0x3ae505)throw CliErrors[_0x369be1(0x197)](_0x369be1(0x1d4)+SKILL_FILE+_0x369be1(0x1c7));return _0x3ae505;}function parseFrontmatterObject(_0x44d8eb){const _0x2d5507=a161_0x3a16;try{const _0x24545f=a161_0x379468(_0x44d8eb);return _0x24545f&&typeof _0x24545f===_0x2d5507(0x1af)&&!Array[_0x2d5507(0x1c1)](_0x24545f)?_0x24545f:undefined;}catch{return undefined;}}function scalarToString(_0x110d37){const _0x26d6a4=a161_0x3a16;if(typeof _0x110d37==='string')return _0x110d37[_0x26d6a4(0x1a6)]();if(typeof _0x110d37===_0x26d6a4(0x1bc)||typeof _0x110d37==='boolean')return String(_0x110d37);return undefined;}function resolvePushDirectoryRoot(_0x2a1c83){const _0x1ce3ae=a161_0x3a16,_0x5797a4=resolve(_0x2a1c83);if(!existsSync(_0x5797a4))throw CliErrors[_0x1ce3ae(0x197)](_0x1ce3ae(0x1a5)+_0x2a1c83);const _0x22208d=lstatSync(_0x5797a4);if(_0x22208d['isDirectory']())return _0x5797a4;if(_0x22208d[_0x1ce3ae(0x1ca)]()){const _0x293088=realpathSync(_0x5797a4);if(lstatSync(_0x293088)[_0x1ce3ae(0x1d2)]())return _0x293088;}throw CliErrors['validation'](_0x1ce3ae(0x1a5)+_0x2a1c83);}function requireRemoteScope(_0x2e2fac){const _0x1d228d=a161_0x3a16;if(_0x2e2fac[_0x1d228d(0x19e)]==='personal'||_0x2e2fac[_0x1d228d(0x19e)]===_0x1d228d(0x1c2)||_0x2e2fac[_0x1d228d(0x19e)]==='builtin')return _0x2e2fac[_0x1d228d(0x19e)];throw CliErrors[_0x1d228d(0x197)]('Remote\x20Skill\x20'+(_0x2e2fac['skillCode']||_0x1d228d(0x19b))+_0x1d228d(0x1a2)+(_0x2e2fac[_0x1d228d(0x19e)]??'unknown')+'\x22.');}function readLocalSkillContent(_0x463247){const _0x2b009f=a161_0x3a16,_0x616135=resolve(_0x463247,SKILL_FILE);return existsSync(_0x616135)&&lstatSync(_0x616135)['isFile']()?readFileSync(_0x616135,_0x2b009f(0x1a0)):'';}function readPushMetadataIfPresent(_0x248ae7,_0x1bc7d0={}){try{return readMetadataIfPresent(_0x248ae7);}catch(_0x25a14b){if(_0x1bc7d0['ignoreInvalidMetadata'])return undefined;throw _0x25a14b;}}
@@ -1 +1 @@
1
- function a161_0x2f8d(_0x540e73,_0x4c6107){_0x540e73=_0x540e73-0x1d8;const _0x18b5de=a161_0x18b5();let _0x2f8d73=_0x18b5de[_0x540e73];return _0x2f8d73;}function a161_0x18b5(){const _0x53e84d=['171877dKEufr','4531736Rpvurg','validation','1093890mahoOQ','company','6esThmR','length','135246VscWAN','55WFavlp','33039vRsISP','builtin','2410490DSZucC','Unsupported\x20runtime\x20Skill\x20scope:\x20','push','2528NgZBmi','6112827REBfXz','personal'];a161_0x18b5=function(){return _0x53e84d;};return a161_0x18b5();}(function(_0x12cd1c,_0x29abb2){const _0xf28b4c=a161_0x2f8d,_0x540156=_0x12cd1c();while(!![]){try{const _0x436d51=-parseInt(_0xf28b4c(0x1d8))/0x1*(parseInt(_0xf28b4c(0x1dd))/0x2)+parseInt(_0xf28b4c(0x1db))/0x3+parseInt(_0xf28b4c(0x1d9))/0x4+-parseInt(_0xf28b4c(0x1e0))/0x5*(parseInt(_0xf28b4c(0x1df))/0x6)+-parseInt(_0xf28b4c(0x1e7))/0x7+parseInt(_0xf28b4c(0x1e6))/0x8*(parseInt(_0xf28b4c(0x1e1))/0x9)+-parseInt(_0xf28b4c(0x1e3))/0xa;if(_0x436d51===_0x29abb2)break;else _0x540156['push'](_0x540156['shift']());}catch(_0x5ee69e){_0x540156['push'](_0x540156['shift']());}}}(a161_0x18b5,0xbe5bc));import{CliErrors}from'../../errors.js';export function normalizeRuntimeSkillScopes(_0xc8056f){const _0x65b008=a161_0x2f8d,_0xf2467c=_0xc8056f&&_0xc8056f[_0x65b008(0x1de)]>0x0?_0xc8056f:[_0x65b008(0x1e8),'company',_0x65b008(0x1e2)],_0x1ea740=[];for(const _0x379164 of _0xf2467c){if(!isRuntimeSkillScope(_0x379164))throw CliErrors[_0x65b008(0x1da)](_0x65b008(0x1e4)+_0x379164);!_0x1ea740['includes'](_0x379164)&&_0x1ea740[_0x65b008(0x1e5)](_0x379164);}return _0x1ea740;}export function isRuntimeSkillScope(_0x6ccbcd){const _0xdecbc0=a161_0x2f8d;return _0x6ccbcd===_0xdecbc0(0x1e8)||_0x6ccbcd===_0xdecbc0(0x1dc)||_0x6ccbcd===_0xdecbc0(0x1e2);}
1
+ function a162_0x24f4(){const _0x4d2840=['3334455VVEaMt','128FzNguR','builtin','company','Unsupported\x20runtime\x20Skill\x20scope:\x20','4542KfMxis','validation','3691452iIlVtC','126ycHyQW','push','285894JFPRiR','1463BNIifC','1052ghrehR','52840YKNAMt','personal','16IkJFOK','70843cfXTtE','182273KkHChF'];a162_0x24f4=function(){return _0x4d2840;};return a162_0x24f4();}function a162_0x2137(_0x79aa60,_0x18d396){_0x79aa60=_0x79aa60-0x118;const _0x24f40f=a162_0x24f4();let _0x213774=_0x24f40f[_0x79aa60];return _0x213774;}(function(_0x2c9cc5,_0x2f9ab8){const _0x228fd6=a162_0x2137,_0x3ed2b8=_0x2c9cc5();while(!![]){try{const _0x552a7f=parseInt(_0x228fd6(0x125))/0x1*(parseInt(_0x228fd6(0x124))/0x2)+parseInt(_0x228fd6(0x11a))/0x3*(-parseInt(_0x228fd6(0x121))/0x4)+parseInt(_0x228fd6(0x127))/0x5+parseInt(_0x228fd6(0x11d))/0x6*(parseInt(_0x228fd6(0x126))/0x7)+parseInt(_0x228fd6(0x128))/0x8*(-parseInt(_0x228fd6(0x11f))/0x9)+parseInt(_0x228fd6(0x122))/0xa*(-parseInt(_0x228fd6(0x120))/0xb)+parseInt(_0x228fd6(0x11c))/0xc;if(_0x552a7f===_0x2f9ab8)break;else _0x3ed2b8['push'](_0x3ed2b8['shift']());}catch(_0x3d5c74){_0x3ed2b8['push'](_0x3ed2b8['shift']());}}}(a162_0x24f4,0x74e91));import{CliErrors}from'../../errors.js';export function normalizeRuntimeSkillScopes(_0x3590d8){const _0x58d4ee=a162_0x2137,_0x3de230=_0x3590d8&&_0x3590d8['length']>0x0?_0x3590d8:[_0x58d4ee(0x123),_0x58d4ee(0x118),_0x58d4ee(0x129)],_0x1d6a2b=[];for(const _0x306895 of _0x3de230){if(!isRuntimeSkillScope(_0x306895))throw CliErrors[_0x58d4ee(0x11b)](_0x58d4ee(0x119)+_0x306895);!_0x1d6a2b['includes'](_0x306895)&&_0x1d6a2b[_0x58d4ee(0x11e)](_0x306895);}return _0x1d6a2b;}export function isRuntimeSkillScope(_0x5114a2){const _0x53588f=a162_0x2137;return _0x5114a2==='personal'||_0x5114a2==='company'||_0x5114a2===_0x53588f(0x129);}
@@ -1 +1 @@
1
- function a163_0x1701(){const _0x3e9480=['name','92oIwjGD','124faoZrx','63426IrSASS','188919wzeNoW','map','1333354kCtPfG','2107856szSeoZ','125UPdBkw','validation_error','sort','code','24933zsyfyZ','entries','Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.','1980-01-01T00:00:00.000Z','12uIMqen','object','from','3986OKdrVL','770805mXEDEa','endsWith','validation','130sPltGQ','Runtime\x20Skill\x20package\x20contains\x20directory\x20entry:\x20'];a163_0x1701=function(){return _0x3e9480;};return a163_0x1701();}function a163_0x4f2c(_0x137373,_0x3d76a5){_0x137373=_0x137373-0xd2;const _0x170104=a163_0x1701();let _0x4f2ce2=_0x170104[_0x137373];return _0x4f2ce2;}const a163_0x2943d7=a163_0x4f2c;(function(_0x4710d7,_0x415298){const _0x33f058=a163_0x4f2c,_0x199bae=_0x4710d7();while(!![]){try{const _0x5d109e=parseInt(_0x33f058(0xe3))/0x1*(parseInt(_0x33f058(0xdb))/0x2)+parseInt(_0x33f058(0xd4))/0x3*(parseInt(_0x33f058(0xe2))/0x4)+parseInt(_0x33f058(0xe9))/0x5*(parseInt(_0x33f058(0xe4))/0x6)+parseInt(_0x33f058(0xdc))/0x7+-parseInt(_0x33f058(0xe8))/0x8+parseInt(_0x33f058(0xe5))/0x9*(-parseInt(_0x33f058(0xdf))/0xa)+-parseInt(_0x33f058(0xe7))/0xb*(parseInt(_0x33f058(0xd8))/0xc);if(_0x5d109e===_0x415298)break;else _0x199bae['push'](_0x199bae['shift']());}catch(_0x5c15ea){_0x199bae['push'](_0x199bae['shift']());}}}(a163_0x1701,0x25dd8));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_0x2943d7(0xd7));export function createDeterministicZipPackage(_0x259118){const _0x175f06={};for(const _0x5b1339 of normalizeLocalFiles(_0x259118)){_0x175f06[_0x5b1339['path']]=fileContent(_0x5b1339);}return Buffer['from'](zipSync(_0x175f06,{'level':0x0,'mtime':ZIP_MTIME}));}export function parseZipPackage(_0x5d21fd){const _0x99492=a163_0x2943d7;if(_0x5d21fd['length']<0x16)throw CliErrors[_0x99492(0xde)](_0x99492(0xd6));let _0x4a71be;try{_0x4a71be=unzipSync(_0x5d21fd,{'filter'(_0xd5defc){const _0x7812a8=_0x99492,_0x405c99=normalizeSkillRelativePath(_0xd5defc[_0x7812a8(0xe1)]);if(_0x405c99[_0x7812a8(0xdd)]('/'))throw CliErrors[_0x7812a8(0xde)](_0x7812a8(0xe0)+_0x405c99);return!![];}});}catch(_0x38372c){if(isRuntimeSkillValidationError(_0x38372c))throw _0x38372c;throw CliErrors['validation']('Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.');}return Object[_0x99492(0xd5)](_0x4a71be)[_0x99492(0xe6)](([_0x443112,_0x221b53])=>({'path':normalizeSkillRelativePath(_0x443112),'bytes':Buffer[_0x99492(0xda)](_0x221b53)}))[_0x99492(0xd2)](compareSkillFiles);}function isRuntimeSkillValidationError(_0x597eb3){const _0x390bc6=a163_0x2943d7;return typeof _0x597eb3===_0x390bc6(0xd9)&&_0x597eb3!==null&&_0x390bc6(0xd3)in _0x597eb3&&_0x597eb3[_0x390bc6(0xd3)]===_0x390bc6(0xea);}
1
+ const a164_0x34a5bb=a164_0x2778;(function(_0x4784f5,_0x22588f){const _0x2b8543=a164_0x2778,_0x4edb8d=_0x4784f5();while(!![]){try{const _0x53f43d=-parseInt(_0x2b8543(0xc9))/0x1+-parseInt(_0x2b8543(0xbc))/0x2+-parseInt(_0x2b8543(0xc8))/0x3*(-parseInt(_0x2b8543(0xbd))/0x4)+parseInt(_0x2b8543(0xba))/0x5*(parseInt(_0x2b8543(0xca))/0x6)+-parseInt(_0x2b8543(0xb5))/0x7*(-parseInt(_0x2b8543(0xb6))/0x8)+-parseInt(_0x2b8543(0xbb))/0x9+parseInt(_0x2b8543(0xc0))/0xa*(-parseInt(_0x2b8543(0xbf))/0xb);if(_0x53f43d===_0x22588f)break;else _0x4edb8d['push'](_0x4edb8d['shift']());}catch(_0x49b7b6){_0x4edb8d['push'](_0x4edb8d['shift']());}}}(a164_0x36d0,0x38f2f));import{unzipSync,zipSync}from'fflate';import{CliErrors}from'../../errors.js';import{compareSkillFiles,fileContent,normalizeLocalFiles,normalizeSkillRelativePath}from'./local-files.js';function a164_0x36d0(){const _0x15125a=['validation','550SYUwLa','4180iQdcNi','from','map','validation_error','name','object','Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.','Runtime\x20Skill\x20package\x20contains\x20directory\x20entry:\x20','1252497QiQWyS','21930JHAWIF','32862yQAitA','21kBbFBc','559712EOSKRm','1980-01-01T00:00:00.000Z','endsWith','code','95OjZZxt','549567QWJjSg','788596ZCKJjS','4GMxHXa'];a164_0x36d0=function(){return _0x15125a;};return a164_0x36d0();}const ZIP_MTIME=new Date(a164_0x34a5bb(0xb7));export function createDeterministicZipPackage(_0x1c3122){const _0x468c7d=a164_0x34a5bb,_0x4025a4={};for(const _0xc9fed2 of normalizeLocalFiles(_0x1c3122)){_0x4025a4[_0xc9fed2['path']]=fileContent(_0xc9fed2);}return Buffer[_0x468c7d(0xc1)](zipSync(_0x4025a4,{'level':0x0,'mtime':ZIP_MTIME}));}export function parseZipPackage(_0x4fefd0){const _0x246019=a164_0x34a5bb;if(_0x4fefd0['length']<0x16)throw CliErrors[_0x246019(0xbe)](_0x246019(0xc6));let _0x15b949;try{_0x15b949=unzipSync(_0x4fefd0,{'filter'(_0x23fc12){const _0x539d07=_0x246019,_0x2a30ce=normalizeSkillRelativePath(_0x23fc12[_0x539d07(0xc4)]);if(_0x2a30ce[_0x539d07(0xb8)]('/'))throw CliErrors[_0x539d07(0xbe)](_0x539d07(0xc7)+_0x2a30ce);return!![];}});}catch(_0x349ef4){if(isRuntimeSkillValidationError(_0x349ef4))throw _0x349ef4;throw CliErrors[_0x246019(0xbe)](_0x246019(0xc6));}return Object['entries'](_0x15b949)[_0x246019(0xc2)](([_0x290866,_0x545153])=>({'path':normalizeSkillRelativePath(_0x290866),'bytes':Buffer['from'](_0x545153)}))['sort'](compareSkillFiles);}function a164_0x2778(_0x1c6f2e,_0xc458bb){_0x1c6f2e=_0x1c6f2e-0xb5;const _0x36d08f=a164_0x36d0();let _0x2778e9=_0x36d08f[_0x1c6f2e];return _0x2778e9;}function isRuntimeSkillValidationError(_0x47ac5e){const _0x3d24fc=a164_0x34a5bb;return typeof _0x47ac5e===_0x3d24fc(0xc5)&&_0x47ac5e!==null&&'code'in _0x47ac5e&&_0x47ac5e[_0x3d24fc(0xb9)]===_0x3d24fc(0xc3);}
@@ -1 +1 @@
1
- (function(_0x5078a4,_0x14a7a2){const _0x167d09=a164_0x3848,_0x250283=_0x5078a4();while(!![]){try{const _0x266f3b=parseInt(_0x167d09(0xa1))/0x1+parseInt(_0x167d09(0xae))/0x2+-parseInt(_0x167d09(0xbb))/0x3*(parseInt(_0x167d09(0xbf))/0x4)+parseInt(_0x167d09(0xa9))/0x5+parseInt(_0x167d09(0xb9))/0x6*(-parseInt(_0x167d09(0xb8))/0x7)+-parseInt(_0x167d09(0xa0))/0x8+-parseInt(_0x167d09(0xbe))/0x9*(-parseInt(_0x167d09(0x94))/0xa);if(_0x266f3b===_0x14a7a2)break;else _0x250283['push'](_0x250283['shift']());}catch(_0x104551){_0x250283['push'](_0x250283['shift']());}}}(a164_0x5b89,0x45df0));import{CliErrors}from'../../errors.js';import{SKILL_FILE}from'./constants.js';import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';import{fileContent,isSha256Hex,normalizeLocalFiles,normalizeManifestFiles}from'./local-files.js';import{createDeterministicZipPackage,parseZipPackage}from'./zip-codec.js';export function buildSkillPackage(_0x464c98){const _0x207975=a164_0x3848,_0x409855=normalizeLocalFiles(_0x464c98);if(!_0x409855[_0x207975(0xb5)](_0x1d037b=>_0x1d037b[_0x207975(0x91)]===SKILL_FILE))throw CliErrors[_0x207975(0xa5)]('Missing\x20'+SKILL_FILE+_0x207975(0xaf));const _0x1558d1=localFilesToManifestFiles(_0x409855),_0x47a9af=createDeterministicZipPackage(_0x409855);return{'manifest':{'schemaVersion':0x2,'treeSha256':fileTreeHash(_0x1558d1),'zipSha256':bufferSha256(_0x47a9af),'zipSize':_0x47a9af[_0x207975(0xa6)],'files':_0x1558d1},'packageBytes':_0x47a9af,'packageBase64':_0x47a9af['toString'](_0x207975(0x99))};}export function verifyRuntimeSkillPackage(_0x543bb0,_0x4a02a7){const _0xdd87d2=a164_0x3848,_0x1e5a69=normalizePackageManifest(_0x543bb0,{'requireOssPath':![]});if(!_0x1e5a69)throw CliErrors[_0xdd87d2(0xa5)](_0xdd87d2(0xb2));return extractAndVerifyPackage(_0x1e5a69,_0x4a02a7);}export function verifyRuntimeSkillBundle(_0x30f058,_0x3f9f67){const _0x5ecd20=a164_0x3848,_0x5ee8a8=normalizePackageManifest(_0x30f058,{'requireOssPath':![]});if(!_0x5ee8a8)throw CliErrors[_0x5ecd20(0xa5)](_0x5ecd20(0xb2));return extractAndVerifyPackageFiles(_0x5ee8a8,_0x3f9f67);}export function tryNormalizePackageManifest(_0xa415b9){return normalizePackageManifest(_0xa415b9,{'requireOssPath':![]});}function a164_0x5b89(){const _0x982f89=['Runtime\x20Skill\x20file\x20tree\x20sha256\x20mismatch.','751910HMYFUj','zipSha256','schemaVersion','trim','Runtime\x20Skill\x20package\x20file\x20size\x20mismatch:\x20','53400SZnPVI','\x20in\x20Skill\x20file\x20package.','Runtime\x20Skill\x20package\x20is\x20required\x20for\x20Skill\x20install:\x20','files','Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.','Runtime\x20Skill\x20package\x20is\x20missing\x20','Runtime\x20Skill\x20manifest\x20is\x20missing\x20','some','Runtime\x20Skill\x20package\x20size\x20is\x20invalid.','Duplicate\x20Skill\x20package\x20entry:\x20','3017xEcnrA','6078yUzcxG','Runtime\x20Skill\x20package\x20sha256\x20mismatch.','14142NSDeYh','Runtime\x20Skill\x20package\x20file\x20sha256\x20mismatch:\x20','has','10715076RbBBAL','444GgPEQr','isSafeInteger','push','path','get','map','10TjpykZ','object','set','isArray','zipSize','base64','Runtime\x20Skill\x20package\x20is\x20missing\x20entry:\x20','requireOssPath','Runtime\x20Skill\x20file\x20tree\x20sha256\x20is\x20invalid.','size','string','bytes','1036528CYDPIq','7969eOzTMr','treeSha256','Runtime\x20Skill\x20package\x20sha256\x20is\x20invalid.','toLowerCase','validation','length','ossPath'];a164_0x5b89=function(){return _0x982f89;};return a164_0x5b89();}export function requirePackageBytes(_0x3bc928,_0x511eac){const _0x4b15b4=a164_0x3848;if(!_0x511eac||_0x511eac[_0x4b15b4(0xa6)]===0x0)throw CliErrors[_0x4b15b4(0xa5)](_0x4b15b4(0xb0)+_0x3bc928);return _0x511eac;}export function extractDownloadedPackage(_0x47dcf7){const _0x3ff346=a164_0x3848,_0x2acbbe=parseZipPackage(_0x47dcf7)[_0x3ff346(0x93)](_0x56c72c=>({'path':_0x56c72c[_0x3ff346(0x91)],'bytes':_0x56c72c['bytes']}));if(!_0x2acbbe[_0x3ff346(0xb5)](_0x1abee8=>_0x1abee8[_0x3ff346(0x91)]===SKILL_FILE))throw CliErrors[_0x3ff346(0xa5)](_0x3ff346(0xb3)+SKILL_FILE+'.');return normalizeLocalFiles(_0x2acbbe);}export function localFilesToManifestFiles(_0x44b853){const _0xc50f52=a164_0x3848;return normalizeLocalFiles(_0x44b853)[_0xc50f52(0x93)](_0x1f705a=>({'path':_0x1f705a[_0xc50f52(0x91)],'sha256':fileHash(_0x1f705a),'size':fileContent(_0x1f705a)['length']}));}function a164_0x3848(_0x8d6957,_0x12c90a){_0x8d6957=_0x8d6957-0x90;const _0x5b897a=a164_0x5b89();let _0x38487e=_0x5b897a[_0x8d6957];return _0x38487e;}function normalizePackageManifest(_0x26e53d,_0x1d49cc){const _0x337a39=a164_0x3848;if(!_0x26e53d||typeof _0x26e53d!==_0x337a39(0x95)||Array[_0x337a39(0x97)](_0x26e53d))return undefined;const _0x2b77b6=_0x26e53d,_0x49c858=typeof _0x2b77b6['ossPath']===_0x337a39(0x9e)?_0x2b77b6[_0x337a39(0xa7)][_0x337a39(0xac)]():undefined;if(_0x1d49cc[_0x337a39(0x9b)]&&!_0x49c858)return undefined;if(!Array[_0x337a39(0x97)](_0x2b77b6[_0x337a39(0xb1)])||_0x2b77b6['files'][_0x337a39(0xa6)]===0x0)return undefined;if(!isSha256Hex(_0x2b77b6[_0x337a39(0xa2)]))throw CliErrors[_0x337a39(0xa5)](_0x337a39(0x9c));if(!isSha256Hex(_0x2b77b6[_0x337a39(0xaa)]))throw CliErrors[_0x337a39(0xa5)](_0x337a39(0xa3));if(!Number[_0x337a39(0xc0)](_0x2b77b6[_0x337a39(0x98)])||_0x2b77b6[_0x337a39(0x98)]<0x0)throw CliErrors[_0x337a39(0xa5)](_0x337a39(0xb6));const _0x2704ec=normalizeManifestFiles(_0x2b77b6[_0x337a39(0xb1)]);if(!_0x2704ec[_0x337a39(0xb5)](_0x32f58f=>_0x32f58f[_0x337a39(0x91)]===SKILL_FILE))throw CliErrors['validation'](_0x337a39(0xb4)+SKILL_FILE+'.');const _0x488739=fileTreeHash(_0x2704ec);if(_0x488739!==_0x2b77b6[_0x337a39(0xa2)][_0x337a39(0xa4)]())throw CliErrors[_0x337a39(0xa5)](_0x337a39(0xa8));return{'schemaVersion':Number[_0x337a39(0xc0)](_0x2b77b6[_0x337a39(0xab)])?_0x2b77b6[_0x337a39(0xab)]:0x2,'ossPath':_0x49c858,'treeSha256':_0x488739,'zipSha256':_0x2b77b6[_0x337a39(0xaa)]['toLowerCase'](),'zipSize':_0x2b77b6[_0x337a39(0x98)],'files':_0x2704ec};}function extractAndVerifyPackage(_0x333f43,_0x10c74d){const _0x263046=a164_0x3848,_0x9aba2c=normalizePackageManifest(_0x333f43,{'requireOssPath':![]});if(!_0x9aba2c)throw CliErrors[_0x263046(0xa5)]('Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.');if(_0x10c74d[_0x263046(0xa6)]!==_0x9aba2c['zipSize'])throw CliErrors[_0x263046(0xa5)]('Runtime\x20Skill\x20package\x20size\x20mismatch.');const _0x409749=bufferSha256(_0x10c74d);if(_0x409749!==_0x9aba2c[_0x263046(0xaa)])throw CliErrors[_0x263046(0xa5)](_0x263046(0xba));return extractAndVerifyPackageFiles(_0x9aba2c,_0x10c74d);}function extractAndVerifyPackageFiles(_0x573e00,_0x490306){const _0x4902df=a164_0x3848,_0x4f0feb=parseZipPackage(_0x490306);if(_0x4f0feb['length']!==_0x573e00[_0x4902df(0xb1)][_0x4902df(0xa6)])throw CliErrors[_0x4902df(0xa5)]('Runtime\x20Skill\x20package\x20entry\x20list\x20mismatch.');const _0x4d72e4=new Map();for(const _0x2200c0 of _0x4f0feb){if(_0x4d72e4[_0x4902df(0xbd)](_0x2200c0[_0x4902df(0x91)]))throw CliErrors[_0x4902df(0xa5)](_0x4902df(0xb7)+_0x2200c0[_0x4902df(0x91)]);_0x4d72e4[_0x4902df(0x96)](_0x2200c0[_0x4902df(0x91)],_0x2200c0);}const _0x47b084=[];for(const _0x3d562e of _0x573e00[_0x4902df(0xb1)]){const _0x2a7f0d=_0x4d72e4[_0x4902df(0x92)](_0x3d562e[_0x4902df(0x91)]);if(!_0x2a7f0d)throw CliErrors[_0x4902df(0xa5)](_0x4902df(0x9a)+_0x3d562e[_0x4902df(0x91)]);if(_0x2a7f0d[_0x4902df(0x9f)]['length']!==_0x3d562e[_0x4902df(0x9d)])throw CliErrors[_0x4902df(0xa5)](_0x4902df(0xad)+_0x3d562e[_0x4902df(0x91)]);const _0x4a43d3=bufferSha256(_0x2a7f0d[_0x4902df(0x9f)]);if(_0x4a43d3!==_0x3d562e['sha256'])throw CliErrors['validation'](_0x4902df(0xbc)+_0x3d562e[_0x4902df(0x91)]);_0x47b084[_0x4902df(0x90)]({'path':_0x3d562e[_0x4902df(0x91)],'bytes':_0x2a7f0d[_0x4902df(0x9f)]});}return normalizeLocalFiles(_0x47b084);}
1
+ (function(_0x5d1cbc,_0x4ea880){const _0x386c50=a165_0xa507,_0x893356=_0x5d1cbc();while(!![]){try{const _0x21cae2=parseInt(_0x386c50(0x134))/0x1+-parseInt(_0x386c50(0x13c))/0x2+-parseInt(_0x386c50(0x142))/0x3*(-parseInt(_0x386c50(0x120))/0x4)+parseInt(_0x386c50(0x13b))/0x5*(parseInt(_0x386c50(0x127))/0x6)+-parseInt(_0x386c50(0x128))/0x7+-parseInt(_0x386c50(0x132))/0x8*(-parseInt(_0x386c50(0x12a))/0x9)+-parseInt(_0x386c50(0x12e))/0xa*(-parseInt(_0x386c50(0x121))/0xb);if(_0x21cae2===_0x4ea880)break;else _0x893356['push'](_0x893356['shift']());}catch(_0x1ff317){_0x893356['push'](_0x893356['shift']());}}}(a165_0xaef9,0xe0a46));import{CliErrors}from'../../errors.js';function a165_0xaef9(){const _0x13f85f=['Runtime\x20Skill\x20package\x20sha256\x20is\x20invalid.','1118405ukXVDj','2290008ZqlKVB','zipSha256','Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.','push','Runtime\x20Skill\x20manifest\x20is\x20missing\x20','path','18846wvjxCx','Runtime\x20Skill\x20package\x20is\x20missing\x20','Runtime\x20Skill\x20package\x20is\x20missing\x20entry:\x20','Runtime\x20Skill\x20file\x20tree\x20sha256\x20is\x20invalid.','toLowerCase','Runtime\x20Skill\x20package\x20file\x20sha256\x20mismatch:\x20','152YXTNDy','1023kfYRNy','get','schemaVersion','isArray','Runtime\x20Skill\x20package\x20entry\x20list\x20mismatch.','Runtime\x20Skill\x20package\x20is\x20required\x20for\x20Skill\x20install:\x20','12sxsCCo','9635255hSWlMO','zipSize','1899WDnwHI','bytes','files','Runtime\x20Skill\x20package\x20file\x20size\x20mismatch:\x20','280380toblHX','validation','toString','map','4168rrDOrX','sha256','38060yqJIES','some','Duplicate\x20Skill\x20package\x20entry:\x20','treeSha256','length','string'];a165_0xaef9=function(){return _0x13f85f;};return a165_0xaef9();}import{SKILL_FILE}from'./constants.js';import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';import{fileContent,isSha256Hex,normalizeLocalFiles,normalizeManifestFiles}from'./local-files.js';import{createDeterministicZipPackage,parseZipPackage}from'./zip-codec.js';function a165_0xa507(_0x222b37,_0x1603d8){_0x222b37=_0x222b37-0x11e;const _0xaef91c=a165_0xaef9();let _0xa507e3=_0xaef91c[_0x222b37];return _0xa507e3;}export function buildSkillPackage(_0x20ad2f){const _0x4c28c6=a165_0xa507,_0x15432f=normalizeLocalFiles(_0x20ad2f);if(!_0x15432f[_0x4c28c6(0x135)](_0x12fb5d=>_0x12fb5d[_0x4c28c6(0x141)]===SKILL_FILE))throw CliErrors[_0x4c28c6(0x12f)]('Missing\x20'+SKILL_FILE+'\x20in\x20Skill\x20file\x20package.');const _0x1af9e3=localFilesToManifestFiles(_0x15432f),_0x44d7ae=createDeterministicZipPackage(_0x15432f);return{'manifest':{'schemaVersion':0x2,'treeSha256':fileTreeHash(_0x1af9e3),'zipSha256':bufferSha256(_0x44d7ae),'zipSize':_0x44d7ae['length'],'files':_0x1af9e3},'packageBytes':_0x44d7ae,'packageBase64':_0x44d7ae[_0x4c28c6(0x130)]('base64')};}export function verifyRuntimeSkillPackage(_0x424ca3,_0xe39105){const _0xf22014=a165_0xa507,_0x15c0d9=normalizePackageManifest(_0x424ca3,{'requireOssPath':![]});if(!_0x15c0d9)throw CliErrors['validation'](_0xf22014(0x13e));return extractAndVerifyPackage(_0x15c0d9,_0xe39105);}export function verifyRuntimeSkillBundle(_0xb1ae5b,_0x47a672){const _0x136213=a165_0xa507,_0x1758a8=normalizePackageManifest(_0xb1ae5b,{'requireOssPath':![]});if(!_0x1758a8)throw CliErrors[_0x136213(0x12f)](_0x136213(0x13e));return extractAndVerifyPackageFiles(_0x1758a8,_0x47a672);}export function tryNormalizePackageManifest(_0x4fc00d){return normalizePackageManifest(_0x4fc00d,{'requireOssPath':![]});}export function requirePackageBytes(_0xafdcf9,_0x5cc176){const _0x43c1e5=a165_0xa507;if(!_0x5cc176||_0x5cc176[_0x43c1e5(0x138)]===0x0)throw CliErrors[_0x43c1e5(0x12f)](_0x43c1e5(0x126)+_0xafdcf9);return _0x5cc176;}export function extractDownloadedPackage(_0x506404){const _0x3cde42=a165_0xa507,_0xecc4b8=parseZipPackage(_0x506404)[_0x3cde42(0x131)](_0x3342c8=>({'path':_0x3342c8[_0x3cde42(0x141)],'bytes':_0x3342c8[_0x3cde42(0x12b)]}));if(!_0xecc4b8[_0x3cde42(0x135)](_0x23760f=>_0x23760f['path']===SKILL_FILE))throw CliErrors[_0x3cde42(0x12f)](_0x3cde42(0x143)+SKILL_FILE+'.');return normalizeLocalFiles(_0xecc4b8);}export function localFilesToManifestFiles(_0x20b537){const _0x13ac33=a165_0xa507;return normalizeLocalFiles(_0x20b537)['map'](_0x504c8b=>({'path':_0x504c8b[_0x13ac33(0x141)],'sha256':fileHash(_0x504c8b),'size':fileContent(_0x504c8b)[_0x13ac33(0x138)]}));}function normalizePackageManifest(_0x444467,_0x2152af){const _0x1c72cd=a165_0xa507;if(!_0x444467||typeof _0x444467!=='object'||Array['isArray'](_0x444467))return undefined;const _0x40d449=_0x444467,_0x39cd99=typeof _0x40d449['ossPath']===_0x1c72cd(0x139)?_0x40d449['ossPath']['trim']():undefined;if(_0x2152af['requireOssPath']&&!_0x39cd99)return undefined;if(!Array[_0x1c72cd(0x124)](_0x40d449['files'])||_0x40d449[_0x1c72cd(0x12c)]['length']===0x0)return undefined;if(!isSha256Hex(_0x40d449[_0x1c72cd(0x137)]))throw CliErrors[_0x1c72cd(0x12f)](_0x1c72cd(0x145));if(!isSha256Hex(_0x40d449['zipSha256']))throw CliErrors[_0x1c72cd(0x12f)](_0x1c72cd(0x13a));if(!Number['isSafeInteger'](_0x40d449[_0x1c72cd(0x129)])||_0x40d449[_0x1c72cd(0x129)]<0x0)throw CliErrors[_0x1c72cd(0x12f)]('Runtime\x20Skill\x20package\x20size\x20is\x20invalid.');const _0x3f9457=normalizeManifestFiles(_0x40d449[_0x1c72cd(0x12c)]);if(!_0x3f9457[_0x1c72cd(0x135)](_0x4a5806=>_0x4a5806['path']===SKILL_FILE))throw CliErrors[_0x1c72cd(0x12f)](_0x1c72cd(0x140)+SKILL_FILE+'.');const _0x32f167=fileTreeHash(_0x3f9457);if(_0x32f167!==_0x40d449[_0x1c72cd(0x137)][_0x1c72cd(0x11e)]())throw CliErrors[_0x1c72cd(0x12f)]('Runtime\x20Skill\x20file\x20tree\x20sha256\x20mismatch.');return{'schemaVersion':Number['isSafeInteger'](_0x40d449[_0x1c72cd(0x123)])?_0x40d449[_0x1c72cd(0x123)]:0x2,'ossPath':_0x39cd99,'treeSha256':_0x32f167,'zipSha256':_0x40d449[_0x1c72cd(0x13d)][_0x1c72cd(0x11e)](),'zipSize':_0x40d449[_0x1c72cd(0x129)],'files':_0x3f9457};}function extractAndVerifyPackage(_0x2fccbd,_0x1fdb86){const _0x29f0d4=a165_0xa507,_0x17ec2b=normalizePackageManifest(_0x2fccbd,{'requireOssPath':![]});if(!_0x17ec2b)throw CliErrors[_0x29f0d4(0x12f)]('Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.');if(_0x1fdb86[_0x29f0d4(0x138)]!==_0x17ec2b[_0x29f0d4(0x129)])throw CliErrors[_0x29f0d4(0x12f)]('Runtime\x20Skill\x20package\x20size\x20mismatch.');const _0x1ee9df=bufferSha256(_0x1fdb86);if(_0x1ee9df!==_0x17ec2b['zipSha256'])throw CliErrors[_0x29f0d4(0x12f)]('Runtime\x20Skill\x20package\x20sha256\x20mismatch.');return extractAndVerifyPackageFiles(_0x17ec2b,_0x1fdb86);}function extractAndVerifyPackageFiles(_0x59a0b3,_0x3e8f38){const _0x46166d=a165_0xa507,_0x5a2819=parseZipPackage(_0x3e8f38);if(_0x5a2819[_0x46166d(0x138)]!==_0x59a0b3['files'][_0x46166d(0x138)])throw CliErrors[_0x46166d(0x12f)](_0x46166d(0x125));const _0x5dc383=new Map();for(const _0x35a9b2 of _0x5a2819){if(_0x5dc383['has'](_0x35a9b2[_0x46166d(0x141)]))throw CliErrors['validation'](_0x46166d(0x136)+_0x35a9b2[_0x46166d(0x141)]);_0x5dc383['set'](_0x35a9b2[_0x46166d(0x141)],_0x35a9b2);}const _0x85bb6e=[];for(const _0x23f487 of _0x59a0b3['files']){const _0x331f6d=_0x5dc383[_0x46166d(0x122)](_0x23f487[_0x46166d(0x141)]);if(!_0x331f6d)throw CliErrors[_0x46166d(0x12f)](_0x46166d(0x144)+_0x23f487[_0x46166d(0x141)]);if(_0x331f6d[_0x46166d(0x12b)][_0x46166d(0x138)]!==_0x23f487['size'])throw CliErrors['validation'](_0x46166d(0x12d)+_0x23f487[_0x46166d(0x141)]);const _0x1f0dd1=bufferSha256(_0x331f6d[_0x46166d(0x12b)]);if(_0x1f0dd1!==_0x23f487[_0x46166d(0x133)])throw CliErrors[_0x46166d(0x12f)](_0x46166d(0x11f)+_0x23f487[_0x46166d(0x141)]);_0x85bb6e[_0x46166d(0x13f)]({'path':_0x23f487[_0x46166d(0x141)],'bytes':_0x331f6d[_0x46166d(0x12b)]});}return normalizeLocalFiles(_0x85bb6e);}
@@ -1 +1 @@
1
- function a165_0x17fb(){var _0x51c697=['9368dVnlSr','115997YNNYmF','2HHoKKS','253956iPJaUB','588556NrQAnZ','170928xhZRMF','5mtEzCG','662249yWHPEC','423FjBRYX','623310HoqyQx'];a165_0x17fb=function(){return _0x51c697;};return a165_0x17fb();}(function(_0x3c0786,_0x589814){var _0x340612=a165_0x4513,_0x4249ac=_0x3c0786();while(!![]){try{var _0x4fbe86=-parseInt(_0x340612(0x1bd))/0x1+parseInt(_0x340612(0x1be))/0x2*(parseInt(_0x340612(0x1b5))/0x3)+-parseInt(_0x340612(0x1b6))/0x4*(-parseInt(_0x340612(0x1b8))/0x5)+parseInt(_0x340612(0x1b7))/0x6+parseInt(_0x340612(0x1b9))/0x7+-parseInt(_0x340612(0x1bc))/0x8*(parseInt(_0x340612(0x1ba))/0x9)+-parseInt(_0x340612(0x1bb))/0xa;if(_0x4fbe86===_0x589814)break;else _0x4249ac['push'](_0x4249ac['shift']());}catch(_0x2bcc12){_0x4249ac['push'](_0x4249ac['shift']());}}}(a165_0x17fb,0x1dab1));function a165_0x4513(_0x57a2e8,_0x14404e){_0x57a2e8=_0x57a2e8-0x1b5;var _0x17fbb6=a165_0x17fb();var _0x4513c1=_0x17fbb6[_0x57a2e8];return _0x4513c1;}export{contentHash,fileTreeHash}from'./runtime-skill-sync/hashing.js';export{linkEffectiveRuntimeSkills,linkGlobalRuntimeSkills,pruneStaleRuntimeSkillCache,pruneStaleRuntimeSkillLinks}from'./runtime-skill-sync/links.js';export{resolveRuntimeSkillInstallTarget}from'./runtime-skill-sync/install-target.js';export{listLocalRuntimeSkills}from'./runtime-skill-sync/list-local.js';export{materializeRuntimeSkill,reuseMaterializedRuntimeSkill}from'./runtime-skill-sync/materialize.js';export{readMetadataIfPresent}from'./runtime-skill-sync/metadata.js';export{getRuntimeSkillCacheRoot,getRuntimeSkillDir,resolveSkillSyncPaths,runtimeAgentSkillRoots}from'./runtime-skill-sync/paths.js';export{deriveSkillCodeFromDirectory,readPushDirectory,refreshPushDirectoryMetadataFromRemote,recordPushedRuntimeSkill,resolvePushDirectoryIdentity}from'./runtime-skill-sync/push.js';export{buildSkillPackage,verifyRuntimeSkillBundle,verifyRuntimeSkillPackage}from'./runtime-skill-sync/zip-package.js';
1
+ (function(_0x361794,_0x39207b){var _0xe79503=a166_0x1ebf,_0x429706=_0x361794();while(!![]){try{var _0x1e060a=-parseInt(_0xe79503(0x115))/0x1*(-parseInt(_0xe79503(0x10e))/0x2)+parseInt(_0xe79503(0x110))/0x3*(parseInt(_0xe79503(0x10c))/0x4)+parseInt(_0xe79503(0x114))/0x5+-parseInt(_0xe79503(0x113))/0x6*(parseInt(_0xe79503(0x10f))/0x7)+-parseInt(_0xe79503(0x10d))/0x8+parseInt(_0xe79503(0x111))/0x9+-parseInt(_0xe79503(0x112))/0xa;if(_0x1e060a===_0x39207b)break;else _0x429706['push'](_0x429706['shift']());}catch(_0x1d3b1c){_0x429706['push'](_0x429706['shift']());}}}(a166_0x5dfd,0xb91f5));export{contentHash,fileTreeHash}from'./runtime-skill-sync/hashing.js';export{linkEffectiveRuntimeSkills,linkGlobalRuntimeSkills,pruneStaleRuntimeSkillCache,pruneStaleRuntimeSkillLinks}from'./runtime-skill-sync/links.js';function a166_0x5dfd(){var _0x3302f8=['19042100JhngwW','77490YdVCrT','7524545ZzlDhD','1404181IlnjIE','4nBMGEl','9632096OSNuXT','2MCGqqN','609nErWtK','3361812QIxesd','8643546GCOaCx'];a166_0x5dfd=function(){return _0x3302f8;};return a166_0x5dfd();}export{resolveRuntimeSkillInstallTarget}from'./runtime-skill-sync/install-target.js';export{listLocalRuntimeSkills}from'./runtime-skill-sync/list-local.js';export{materializeRuntimeSkill,reuseMaterializedRuntimeSkill}from'./runtime-skill-sync/materialize.js';export{readMetadataIfPresent}from'./runtime-skill-sync/metadata.js';function a166_0x1ebf(_0x25b901,_0x548c84){_0x25b901=_0x25b901-0x10c;var _0x5dfdf9=a166_0x5dfd();var _0x1ebf60=_0x5dfdf9[_0x25b901];return _0x1ebf60;}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_0x281028=a166_0x42e6;(function(_0x124dd4,_0xdb8cdf){const _0x114007=a166_0x42e6,_0x2f6551=_0x124dd4();while(!![]){try{const _0x37cc59=-parseInt(_0x114007(0x10e))/0x1*(-parseInt(_0x114007(0x12b))/0x2)+-parseInt(_0x114007(0x124))/0x3+-parseInt(_0x114007(0x11b))/0x4+parseInt(_0x114007(0x116))/0x5+-parseInt(_0x114007(0x10f))/0x6+parseInt(_0x114007(0x118))/0x7*(parseInt(_0x114007(0x10c))/0x8)+-parseInt(_0x114007(0x120))/0x9;if(_0x37cc59===_0xdb8cdf)break;else _0x2f6551['push'](_0x2f6551['shift']());}catch(_0x3a3567){_0x2f6551['push'](_0x2f6551['shift']());}}}(a166_0x565f,0xd8446));import{existsSync,readFileSync}from'node:fs';import{homedir}from'node:os';import{join}from'node:path';export const SKILL_LOCK_RELATIVE_PATH=join(a166_0x281028(0x125),a166_0x281028(0x11c));export const GLOBAL_SKILLS_DIR_RELATIVE_PATHS=[join(a166_0x281028(0x125),a166_0x281028(0x112)),join(a166_0x281028(0x113),a166_0x281028(0x112))];function a166_0x565f(){const _0x2bdbaf=['reason','220704qsoZAI','.agents','parse','includes','utf8','unusable','map','2044946LanEkC','SKILL.md','unverifiable','lockFile','\x20uses\x20unsupported\x20version\x20','3967496DMXleZ','\x20has\x20no\x20skills\x20map','1LXINCs','8478426boFfqv','number','present','skills','.claude','globalSkillsDirs','not-recorded','5315415VVghTH','kind','21aUzZwV','\x22\x20but\x20no\x20SKILL.md\x20was\x20found\x20in\x20known\x20layouts\x20','version','1698400TmESzV','.skill-lock.json','recorded','\x20records\x20\x22','find','6986682fKraPU','\x20is\x20unreadable:\x20','join'];a166_0x565f=function(){return _0x2bdbaf;};return a166_0x565f();}const SUPPORTED_LOCK_VERSIONS=[0x3];function a166_0x42e6(_0x122f96,_0x3b51e8){_0x122f96=_0x122f96-0x10a;const _0x565fae=a166_0x565f();let _0x42e621=_0x565fae[_0x122f96];return _0x42e621;}function readLockLookup(_0xc4c1b4,_0x2671ab){const _0x1cce7b=a166_0x281028;if(!existsSync(_0xc4c1b4))return{'kind':_0x1cce7b(0x115)};let _0x1a730d;try{_0x1a730d=JSON[_0x1cce7b(0x126)](readFileSync(_0xc4c1b4,_0x1cce7b(0x128)));}catch(_0x2ac594){return{'kind':_0x1cce7b(0x129),'reason':_0xc4c1b4+_0x1cce7b(0x121)+_0x2ac594['message']};}const _0x1cc7e1=_0x1a730d;if(typeof _0x1cc7e1?.[_0x1cce7b(0x11a)]!==_0x1cce7b(0x110)||!SUPPORTED_LOCK_VERSIONS[_0x1cce7b(0x127)](_0x1cc7e1[_0x1cce7b(0x11a)]))return{'kind':_0x1cce7b(0x129),'reason':_0xc4c1b4+_0x1cce7b(0x10b)+String(_0x1cc7e1?.[_0x1cce7b(0x11a)])};if(!_0x1cc7e1['skills']||typeof _0x1cc7e1[_0x1cce7b(0x112)]!=='object')return{'kind':_0x1cce7b(0x129),'reason':_0xc4c1b4+_0x1cce7b(0x10d)};return _0x1cc7e1[_0x1cce7b(0x112)][_0x2671ab]?{'kind':_0x1cce7b(0x11d)}:{'kind':_0x1cce7b(0x115)};}export function resolveInstalledSkill(_0x574115,_0x5e9bf4){const _0x3e7f14=a166_0x281028,_0x483f8e=_0x5e9bf4?.['home']??homedir(),_0x5ae654=_0x5e9bf4?.[_0x3e7f14(0x114)]??GLOBAL_SKILLS_DIR_RELATIVE_PATHS[_0x3e7f14(0x12a)](_0x201903=>join(_0x483f8e,_0x201903)),_0x3b629e=_0x5e9bf4?.[_0x3e7f14(0x10a)]??join(_0x483f8e,SKILL_LOCK_RELATIVE_PATH),_0x1d0773=_0x5ae654[_0x3e7f14(0x12a)](_0x157ae5=>join(_0x157ae5,_0x574115,_0x3e7f14(0x12c))),_0x10cd90=_0x1d0773[_0x3e7f14(0x11f)](_0x461a47=>existsSync(_0x461a47));if(_0x10cd90)return{'state':_0x3e7f14(0x111),'path':_0x10cd90};const _0x466336=readLockLookup(_0x3b629e,_0x574115);if(_0x466336[_0x3e7f14(0x117)]===_0x3e7f14(0x129))return{'state':_0x3e7f14(0x12d),'reason':_0x466336[_0x3e7f14(0x123)]};if(_0x466336[_0x3e7f14(0x117)]===_0x3e7f14(0x11d))return{'state':'unverifiable','reason':_0x3b629e+_0x3e7f14(0x11e)+_0x574115+_0x3e7f14(0x119)+('('+_0x1d0773[_0x3e7f14(0x122)](',\x20')+')')};return{'state':'absent','checked':_0x1d0773};}
1
+ const a167_0x258cce=a167_0x9d5c;(function(_0x25d766,_0x480f4d){const _0x172a86=a167_0x9d5c,_0x4553fc=_0x25d766();while(!![]){try{const _0x5e5d02=-parseInt(_0x172a86(0x17d))/0x1+parseInt(_0x172a86(0x165))/0x2+-parseInt(_0x172a86(0x185))/0x3*(-parseInt(_0x172a86(0x172))/0x4)+parseInt(_0x172a86(0x181))/0x5*(-parseInt(_0x172a86(0x17f))/0x6)+-parseInt(_0x172a86(0x16e))/0x7*(-parseInt(_0x172a86(0x171))/0x8)+-parseInt(_0x172a86(0x183))/0x9*(parseInt(_0x172a86(0x178))/0xa)+parseInt(_0x172a86(0x168))/0xb;if(_0x5e5d02===_0x480f4d)break;else _0x4553fc['push'](_0x4553fc['shift']());}catch(_0x5236bb){_0x4553fc['push'](_0x4553fc['shift']());}}}(a167_0x5300,0x9b5da));function a167_0x9d5c(_0x175eeb,_0x331045){_0x175eeb=_0x175eeb-0x165;const _0x530089=a167_0x5300();let _0x9d5cb2=_0x530089[_0x175eeb];return _0x9d5cb2;}import{existsSync,readFileSync}from'node:fs';import{homedir}from'node:os';import{join}from'node:path';export const SKILL_LOCK_RELATIVE_PATH=join(a167_0x258cce(0x17b),'.skill-lock.json');export const GLOBAL_SKILLS_DIR_RELATIVE_PATHS=[join(a167_0x258cce(0x17b),a167_0x258cce(0x173)),join(a167_0x258cce(0x180),a167_0x258cce(0x173))];const SUPPORTED_LOCK_VERSIONS=[0x3];function a167_0x5300(){const _0x50efe8=['includes','1275850FnecIs','\x22\x20but\x20no\x20SKILL.md\x20was\x20found\x20in\x20known\x20layouts\x20','globalSkillsDirs','2197030RlJaxK','kind','message','join','utf8','\x20records\x20\x22','7OMkivQ','object','home','8574128HkLNbT','80JaqpKW','skills','\x20has\x20no\x20skills\x20map','lockFile','unusable','not-recorded','550510xInKDM','version','recorded','.agents','map','875007VYhLko','\x20uses\x20unsupported\x20version\x20','10986itBRGC','.claude','1045mrVjgx','absent','63IOLfRD','unverifiable','55500gIjXVl'];a167_0x5300=function(){return _0x50efe8;};return a167_0x5300();}function readLockLookup(_0x2564f8,_0x270b72){const _0x3da419=a167_0x258cce;if(!existsSync(_0x2564f8))return{'kind':'not-recorded'};let _0x7038e8;try{_0x7038e8=JSON['parse'](readFileSync(_0x2564f8,_0x3da419(0x16c)));}catch(_0x2be55d){return{'kind':_0x3da419(0x176),'reason':_0x2564f8+'\x20is\x20unreadable:\x20'+_0x2be55d[_0x3da419(0x16a)]};}const _0x379676=_0x7038e8;if(typeof _0x379676?.['version']!=='number'||!SUPPORTED_LOCK_VERSIONS[_0x3da419(0x186)](_0x379676[_0x3da419(0x179)]))return{'kind':_0x3da419(0x176),'reason':_0x2564f8+_0x3da419(0x17e)+String(_0x379676?.[_0x3da419(0x179)])};if(!_0x379676[_0x3da419(0x173)]||typeof _0x379676[_0x3da419(0x173)]!==_0x3da419(0x16f))return{'kind':_0x3da419(0x176),'reason':_0x2564f8+_0x3da419(0x174)};return _0x379676['skills'][_0x270b72]?{'kind':_0x3da419(0x17a)}:{'kind':_0x3da419(0x177)};}export function resolveInstalledSkill(_0x61c500,_0x2a33dc){const _0x562ce5=a167_0x258cce,_0x33b334=_0x2a33dc?.[_0x562ce5(0x170)]??homedir(),_0x38fc95=_0x2a33dc?.[_0x562ce5(0x167)]??GLOBAL_SKILLS_DIR_RELATIVE_PATHS[_0x562ce5(0x17c)](_0x3c9c1d=>join(_0x33b334,_0x3c9c1d)),_0x47a8c3=_0x2a33dc?.[_0x562ce5(0x175)]??join(_0x33b334,SKILL_LOCK_RELATIVE_PATH),_0x1c07ed=_0x38fc95[_0x562ce5(0x17c)](_0x85cbad=>join(_0x85cbad,_0x61c500,'SKILL.md')),_0x1dcbf0=_0x1c07ed['find'](_0x4f7917=>existsSync(_0x4f7917));if(_0x1dcbf0)return{'state':'present','path':_0x1dcbf0};const _0x1ff58b=readLockLookup(_0x47a8c3,_0x61c500);if(_0x1ff58b[_0x562ce5(0x169)]==='unusable')return{'state':'unverifiable','reason':_0x1ff58b['reason']};if(_0x1ff58b[_0x562ce5(0x169)]===_0x562ce5(0x17a))return{'state':_0x562ce5(0x184),'reason':_0x47a8c3+_0x562ce5(0x16d)+_0x61c500+_0x562ce5(0x166)+('('+_0x1c07ed[_0x562ce5(0x16b)](',\x20')+')')};return{'state':_0x562ce5(0x182),'checked':_0x1c07ed};}
@@ -1 +1 @@
1
- const a167_0x7337e=a167_0x55bd;(function(_0x55dc15,_0xda907f){const _0x13b15e=a167_0x55bd,_0x5a4eb5=_0x55dc15();while(!![]){try{const _0x50920c=parseInt(_0x13b15e(0x1e8))/0x1*(parseInt(_0x13b15e(0x1f0))/0x2)+-parseInt(_0x13b15e(0x1f3))/0x3*(-parseInt(_0x13b15e(0x1f6))/0x4)+parseInt(_0x13b15e(0x1fc))/0x5+parseInt(_0x13b15e(0x1f7))/0x6+parseInt(_0x13b15e(0x1fb))/0x7+parseInt(_0x13b15e(0x1f4))/0x8+-parseInt(_0x13b15e(0x1f8))/0x9;if(_0x50920c===_0xda907f)break;else _0x5a4eb5['push'](_0x5a4eb5['shift']());}catch(_0x41253b){_0x5a4eb5['push'](_0x5a4eb5['shift']());}}}(a167_0x19b5,0xd79aa));const REDACTED_ACCESS_KEY=a167_0x7337e(0x1ef);function a167_0x19b5(){const _0x212075=['hasOwnProperty','apps','9617251AcYRNA','6410505jFbGZf','test','fromEntries','284489GWJetD','slice','string','accessKey','prototype','isArray','map','<redacted>','2krgLBJ','object','length','447897TCjPWp','9756368MlTsah','call','16ieeUEV','4983372aCpEsx','42342057INZOoe'];a167_0x19b5=function(){return _0x212075;};return a167_0x19b5();}export function maskCliAccessKey(_0x41ce9a){const _0x7a13f3=a167_0x7337e;if(typeof _0x41ce9a!==_0x7a13f3(0x1ea)||_0x41ce9a['length']<=0x8)return REDACTED_ACCESS_KEY;return''+_0x41ce9a[_0x7a13f3(0x1e9)](0x0,0x8)+'*'['repeat'](_0x41ce9a[_0x7a13f3(0x1f2)]-0x8);}export function redactCliConfigCredentials(_0x5409f1){const _0x3f199f=a167_0x7337e,_0x26ee66={..._0x5409f1};return Object['prototype'][_0x3f199f(0x1f9)][_0x3f199f(0x1f5)](_0x26ee66,_0x3f199f(0x1eb))&&(_0x26ee66['accessKey']=maskCliAccessKey(_0x26ee66[_0x3f199f(0x1eb)])),_0x26ee66[_0x3f199f(0x1fa)]&&typeof _0x26ee66[_0x3f199f(0x1fa)]===_0x3f199f(0x1f1)&&!Array[_0x3f199f(0x1ed)](_0x26ee66[_0x3f199f(0x1fa)])&&(_0x26ee66[_0x3f199f(0x1fa)]=redactLegacyAppCredentials(_0x26ee66[_0x3f199f(0x1fa)])),_0x26ee66;}function a167_0x55bd(_0x35beda,_0x6b964e){_0x35beda=_0x35beda-0x1e8;const _0x19b581=a167_0x19b5();let _0x55bdb0=_0x19b581[_0x35beda];return _0x55bdb0;}export function redactCliConfigValue(_0x130fb9,_0x46fb79){const _0x5e5ec7=a167_0x7337e;if(_0x130fb9==='accessKey'||/^apps\.[^.]+\.accessKey$/[_0x5e5ec7(0x1fd)](_0x130fb9))return maskCliAccessKey(_0x46fb79);if(_0x130fb9===_0x5e5ec7(0x1fa)&&_0x46fb79&&typeof _0x46fb79===_0x5e5ec7(0x1f1)&&!Array[_0x5e5ec7(0x1ed)](_0x46fb79))return redactLegacyAppCredentials(_0x46fb79);if(/^apps\.[^.]+$/[_0x5e5ec7(0x1fd)](_0x130fb9)&&_0x46fb79&&typeof _0x46fb79===_0x5e5ec7(0x1f1)&&!Array[_0x5e5ec7(0x1ed)](_0x46fb79)){const _0x25d528=_0x46fb79;return Object[_0x5e5ec7(0x1ec)]['hasOwnProperty'][_0x5e5ec7(0x1f5)](_0x25d528,'accessKey')?{..._0x25d528,'accessKey':maskCliAccessKey(_0x25d528['accessKey'])}:_0x46fb79;}return _0x46fb79;}function redactLegacyAppCredentials(_0x555f6b){const _0x48af31=a167_0x7337e;return Object[_0x48af31(0x1fe)](Object['entries'](_0x555f6b)[_0x48af31(0x1ee)](([_0x398f3b,_0x5d9181])=>{const _0x455076=_0x48af31;if(!_0x5d9181||typeof _0x5d9181!==_0x455076(0x1f1)||Array[_0x455076(0x1ed)](_0x5d9181))return[_0x398f3b,_0x5d9181];const _0x33f5fc={..._0x5d9181};return Object[_0x455076(0x1ec)]['hasOwnProperty']['call'](_0x33f5fc,'accessKey')&&(_0x33f5fc[_0x455076(0x1eb)]=maskCliAccessKey(_0x33f5fc[_0x455076(0x1eb)])),[_0x398f3b,_0x33f5fc];}));}
1
+ const a168_0x5cd415=a168_0x4a53;(function(_0x40e02a,_0x384f1b){const _0x553668=a168_0x4a53,_0x40c341=_0x40e02a();while(!![]){try{const _0x20dbc8=-parseInt(_0x553668(0x1dd))/0x1*(-parseInt(_0x553668(0x1df))/0x2)+parseInt(_0x553668(0x1d0))/0x3+-parseInt(_0x553668(0x1e2))/0x4+-parseInt(_0x553668(0x1d4))/0x5+-parseInt(_0x553668(0x1de))/0x6+parseInt(_0x553668(0x1d3))/0x7+parseInt(_0x553668(0x1cd))/0x8;if(_0x20dbc8===_0x384f1b)break;else _0x40c341['push'](_0x40c341['shift']());}catch(_0x512c86){_0x40c341['push'](_0x40c341['shift']());}}}(a168_0x479a,0x58e8d));const REDACTED_ACCESS_KEY=a168_0x5cd415(0x1da);export function maskCliAccessKey(_0x2da887){const _0x2e83a0=a168_0x5cd415;if(typeof _0x2da887!==_0x2e83a0(0x1d8)||_0x2da887[_0x2e83a0(0x1dc)]<=0x8)return REDACTED_ACCESS_KEY;return''+_0x2da887[_0x2e83a0(0x1cf)](0x0,0x8)+'*'['repeat'](_0x2da887[_0x2e83a0(0x1dc)]-0x8);}function a168_0x479a(){const _0x12d1be=['266pMvXiu','object','call','2168992QkRMqD','accessKey','11854656SKTCUJ','test','slice','80679xeryLh','fromEntries','isArray','1634528QIsbeZ','3310190wyHYge','prototype','entries','apps','string','map','<redacted>','hasOwnProperty','length','2009prDYfA','2645802ABIIwB'];a168_0x479a=function(){return _0x12d1be;};return a168_0x479a();}export function redactCliConfigCredentials(_0x135a9d){const _0x4cb392=a168_0x5cd415,_0x587de1={..._0x135a9d};return Object[_0x4cb392(0x1d5)][_0x4cb392(0x1db)]['call'](_0x587de1,_0x4cb392(0x1cc))&&(_0x587de1['accessKey']=maskCliAccessKey(_0x587de1['accessKey'])),_0x587de1['apps']&&typeof _0x587de1[_0x4cb392(0x1d7)]===_0x4cb392(0x1e0)&&!Array[_0x4cb392(0x1d2)](_0x587de1['apps'])&&(_0x587de1[_0x4cb392(0x1d7)]=redactLegacyAppCredentials(_0x587de1[_0x4cb392(0x1d7)])),_0x587de1;}export function redactCliConfigValue(_0x16adf4,_0x3949b3){const _0x2d8a87=a168_0x5cd415;if(_0x16adf4===_0x2d8a87(0x1cc)||/^apps\.[^.]+\.accessKey$/[_0x2d8a87(0x1ce)](_0x16adf4))return maskCliAccessKey(_0x3949b3);if(_0x16adf4===_0x2d8a87(0x1d7)&&_0x3949b3&&typeof _0x3949b3===_0x2d8a87(0x1e0)&&!Array[_0x2d8a87(0x1d2)](_0x3949b3))return redactLegacyAppCredentials(_0x3949b3);if(/^apps\.[^.]+$/['test'](_0x16adf4)&&_0x3949b3&&typeof _0x3949b3===_0x2d8a87(0x1e0)&&!Array[_0x2d8a87(0x1d2)](_0x3949b3)){const _0x5b9395=_0x3949b3;return Object[_0x2d8a87(0x1d5)]['hasOwnProperty'][_0x2d8a87(0x1e1)](_0x5b9395,_0x2d8a87(0x1cc))?{..._0x5b9395,'accessKey':maskCliAccessKey(_0x5b9395[_0x2d8a87(0x1cc)])}:_0x3949b3;}return _0x3949b3;}function a168_0x4a53(_0x182d4b,_0x517963){_0x182d4b=_0x182d4b-0x1cc;const _0x479a3f=a168_0x479a();let _0x4a5327=_0x479a3f[_0x182d4b];return _0x4a5327;}function redactLegacyAppCredentials(_0x62fbe0){const _0x5c208e=a168_0x5cd415;return Object[_0x5c208e(0x1d1)](Object[_0x5c208e(0x1d6)](_0x62fbe0)[_0x5c208e(0x1d9)](([_0x3e625c,_0x59256d])=>{const _0x39b9fa=_0x5c208e;if(!_0x59256d||typeof _0x59256d!==_0x39b9fa(0x1e0)||Array[_0x39b9fa(0x1d2)](_0x59256d))return[_0x3e625c,_0x59256d];const _0xcadf9={..._0x59256d};return Object[_0x39b9fa(0x1d5)][_0x39b9fa(0x1db)][_0x39b9fa(0x1e1)](_0xcadf9,'accessKey')&&(_0xcadf9[_0x39b9fa(0x1cc)]=maskCliAccessKey(_0xcadf9[_0x39b9fa(0x1cc)])),[_0x3e625c,_0xcadf9];}));}
@@ -1 +1 @@
1
- (function(_0x238f9c,_0x3b0802){const _0x28d967=a168_0x53d4,_0x292e99=_0x238f9c();while(!![]){try{const _0xeee7f9=parseInt(_0x28d967(0x1c2))/0x1*(parseInt(_0x28d967(0x1c4))/0x2)+parseInt(_0x28d967(0x1c5))/0x3*(-parseInt(_0x28d967(0x1bc))/0x4)+parseInt(_0x28d967(0x1bf))/0x5+parseInt(_0x28d967(0x1c1))/0x6+-parseInt(_0x28d967(0x1c3))/0x7+-parseInt(_0x28d967(0x1c0))/0x8*(-parseInt(_0x28d967(0x1c6))/0x9)+parseInt(_0x28d967(0x1bd))/0xa*(-parseInt(_0x28d967(0x1be))/0xb);if(_0xeee7f9===_0x3b0802)break;else _0x292e99['push'](_0x292e99['shift']());}catch(_0x1029bf){_0x292e99['push'](_0x292e99['shift']());}}}(a168_0xef1e,0xd44fd));function a168_0x53d4(_0x5c292c,_0x5dae8f){_0x5c292c=_0x5c292c-0x1bc;const _0xef1ebb=a168_0xef1e();let _0x53d4d9=_0xef1ebb[_0x5c292c];return _0x53d4d9;}import{createJqFilter,resolveBundledJqPaths}from'@lovrabet/cli-framework';import{CliErrors}from'../errors.js';function a168_0xef1e(){const _0x5257d5=['6370140ThiHOM','2CdJiuX','2273152ASnQQb','317530QvhXiK','410217bgRwWm','27SSgEAZ','32AilKuI','670dbyAhB','136532uEtLzi','8419475ScLbqU','151376MqZgNQ'];a168_0xef1e=function(){return _0x5257d5;};return a168_0xef1e();}export const applyJqFilter=createJqFilter(CliErrors,{'bundledJqPaths':resolveBundledJqPaths()});
1
+ (function(_0x4f24e2,_0x4f48f5){const _0x49f259=a169_0x1dfd,_0x3081ca=_0x4f24e2();while(!![]){try{const _0x84e221=-parseInt(_0x49f259(0x82))/0x1*(-parseInt(_0x49f259(0x7f))/0x2)+parseInt(_0x49f259(0x7e))/0x3+-parseInt(_0x49f259(0x86))/0x4+parseInt(_0x49f259(0x83))/0x5*(parseInt(_0x49f259(0x81))/0x6)+-parseInt(_0x49f259(0x80))/0x7+-parseInt(_0x49f259(0x7d))/0x8+-parseInt(_0x49f259(0x84))/0x9*(parseInt(_0x49f259(0x85))/0xa);if(_0x84e221===_0x4f48f5)break;else _0x3081ca['push'](_0x3081ca['shift']());}catch(_0x2851b8){_0x3081ca['push'](_0x3081ca['shift']());}}}(a169_0x39f6,0x6fd08));function a169_0x1dfd(_0x205804,_0x470718){_0x205804=_0x205804-0x7d;const _0x39f6a7=a169_0x39f6();let _0x1dfdbe=_0x39f6a7[_0x205804];return _0x1dfdbe;}import{createJqFilter,resolveBundledJqPaths}from'@lovrabet/cli-framework';function a169_0x39f6(){const _0x5da3d9=['429632XevrHB','4254440ZLJJoc','2210841Cwhvbz','534264rhfZPW','1918203BxCJsI','5020188TRDPXP','2Eflfdb','5rQGvVZ','45GpkBZQ','1473350XoQVJm'];a169_0x39f6=function(){return _0x5da3d9;};return a169_0x39f6();}import{CliErrors}from'../errors.js';export const applyJqFilter=createJqFilter(CliErrors,{'bundledJqPaths':resolveBundledJqPaths()});