@lovrabet/lovrabet-cli 2.3.2-beta.1 → 2.3.2-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (168) 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/artifact/index.js +1 -1
  12. package/lib/commands/auth/device.js +1 -1
  13. package/lib/commands/auth/index.js +1 -1
  14. package/lib/commands/auth/prompt.js +1 -1
  15. package/lib/commands/bff/detail.js +1 -1
  16. package/lib/commands/bff/exec.js +1 -1
  17. package/lib/commands/bff/index.js +1 -1
  18. package/lib/commands/cli-skill/index.js +1 -1
  19. package/lib/commands/common/config-policy.js +1 -1
  20. package/lib/commands/common/constraints.js +1 -1
  21. package/lib/commands/common/flags.js +1 -1
  22. package/lib/commands/common/local-file.js +1 -1
  23. package/lib/commands/config/definitions.js +1 -1
  24. package/lib/commands/config/init.js +1 -1
  25. package/lib/commands/config/shared.js +1 -1
  26. package/lib/commands/data/index.js +1 -1
  27. package/lib/commands/dataset/detail.js +1 -1
  28. package/lib/commands/dataset/index.js +1 -1
  29. package/lib/commands/dataset/list.js +1 -1
  30. package/lib/commands/dataset/sdk-doc.js +1 -1
  31. package/lib/commands/doctor.js +1 -1
  32. package/lib/commands/file/index.js +1 -1
  33. package/lib/commands/init.js +1 -1
  34. package/lib/commands/kb/index.js +1 -1
  35. package/lib/commands/logs/index.js +1 -1
  36. package/lib/commands/notification/config-list.js +1 -1
  37. package/lib/commands/notification/index.js +1 -1
  38. package/lib/commands/notification/shared.js +1 -1
  39. package/lib/commands/ocr/index.js +1 -1
  40. package/lib/commands/permit/dataset-get.js +1 -1
  41. package/lib/commands/permit/dataset-set.js +1 -1
  42. package/lib/commands/permit/index.js +1 -1
  43. package/lib/commands/permit/page-get.js +1 -1
  44. package/lib/commands/permit/page-set.js +1 -1
  45. package/lib/commands/permit/role-menus-set.js +1 -1
  46. package/lib/commands/permit/role-menus.js +1 -1
  47. package/lib/commands/permit/shared.js +1 -1
  48. package/lib/commands/personal-bff/index.js +1 -1
  49. package/lib/commands/registry.js +1 -1
  50. package/lib/commands/role/create.js +1 -1
  51. package/lib/commands/role/delete.js +1 -1
  52. package/lib/commands/role/detail.js +1 -1
  53. package/lib/commands/role/index.js +1 -1
  54. package/lib/commands/role/list.js +1 -1
  55. package/lib/commands/role/shared.js +1 -1
  56. package/lib/commands/role/update.js +1 -1
  57. package/lib/commands/role/user-add.js +1 -1
  58. package/lib/commands/role/user-remove.js +1 -1
  59. package/lib/commands/schedule/index.js +1 -1
  60. package/lib/commands/schema.js +1 -1
  61. package/lib/commands/service/dynamic.js +1 -1
  62. package/lib/commands/service/function-name-adapter.js +1 -1
  63. package/lib/commands/service/index.js +1 -1
  64. package/lib/commands/service/registry.js +1 -1
  65. package/lib/commands/skill/commands/create.js +1 -1
  66. package/lib/commands/skill/commands/diagram.js +1 -1
  67. package/lib/commands/skill/commands/install.js +1 -1
  68. package/lib/commands/skill/commands/list.js +1 -1
  69. package/lib/commands/skill/commands/push.js +1 -1
  70. package/lib/commands/skill/commands/validate.js +1 -1
  71. package/lib/commands/skill/diagram.js +1 -1
  72. package/lib/commands/skill/flags.js +1 -1
  73. package/lib/commands/skill/index.js +1 -1
  74. package/lib/commands/skill/manifest-helpers.js +1 -1
  75. package/lib/commands/skill/push-execute.js +1 -1
  76. package/lib/commands/skill/push-flow-helpers.js +1 -1
  77. package/lib/commands/skill/push-retarget.js +1 -1
  78. package/lib/commands/skill/scopes.js +1 -1
  79. package/lib/commands/skill/summary.js +1 -1
  80. package/lib/commands/skill/templates.js +1 -1
  81. package/lib/commands/skill/validate.js +1 -1
  82. package/lib/commands/sql/detail.js +1 -1
  83. package/lib/commands/sql/exec.js +1 -1
  84. package/lib/commands/sql/index.js +1 -1
  85. package/lib/commands/update.js +1 -1
  86. package/lib/commands/user-account/bind.js +1 -1
  87. package/lib/commands/user-account/index.js +1 -1
  88. package/lib/commands/workspace/index.js +1 -1
  89. package/lib/config/domain-config.js +1 -1
  90. package/lib/config/schema.js +1 -1
  91. package/lib/constant/app.js +1 -1
  92. package/lib/constant/auth-mode.js +1 -1
  93. package/lib/constant/cli.js +1 -1
  94. package/lib/constant/defaults.js +1 -1
  95. package/lib/constant/distribution.js +1 -1
  96. package/lib/constant/domain.js +1 -1
  97. package/lib/constant/env.js +1 -1
  98. package/lib/constant/output.js +1 -1
  99. package/lib/constant/product.js +1 -1
  100. package/lib/constant/region.js +1 -1
  101. package/lib/constant/risk.js +1 -1
  102. package/lib/constant/url.js +1 -1
  103. package/lib/context.js +1 -1
  104. package/lib/core/api-client.js +1 -1
  105. package/lib/core/db-resolver.js +1 -1
  106. package/lib/core/kb-search-client.js +1 -1
  107. package/lib/core/sdk-client.js +1 -1
  108. package/lib/errors.js +1 -1
  109. package/lib/framework/build-all-flags.js +1 -1
  110. package/lib/framework/dryrun.js +1 -1
  111. package/lib/framework/flags.js +1 -1
  112. package/lib/framework/help.js +1 -1
  113. package/lib/framework/index.js +1 -1
  114. package/lib/framework/output.js +1 -1
  115. package/lib/framework/preparse.js +1 -1
  116. package/lib/framework/rate-limit.js +1 -1
  117. package/lib/framework/raw-flags.js +1 -1
  118. package/lib/framework/response.js +1 -1
  119. package/lib/framework/runner-confirmation.js +1 -1
  120. package/lib/framework/runner-error.js +1 -1
  121. package/lib/framework/runner.js +1 -1
  122. package/lib/framework/schema-export.js +1 -1
  123. package/lib/framework/service-order.js +1 -1
  124. package/lib/framework/types.js +1 -1
  125. package/lib/generated/build-info.d.ts +4 -4
  126. package/lib/generated/build-info.js +1 -1
  127. package/lib/generated/official-routing.js +1 -1
  128. package/lib/generated/routing-contract.js +1 -1
  129. package/lib/help.js +1 -1
  130. package/lib/postinstall.js +1 -1
  131. package/lib/runtime/confirmation.js +1 -1
  132. package/lib/runtime/event.js +1 -1
  133. package/lib/runtime/index.js +1 -1
  134. package/lib/runtime/queue.js +1 -1
  135. package/lib/runtime/resolve.js +1 -1
  136. package/lib/skills/builtin-skill.js +1 -1
  137. package/lib/skills/npx-skills-add.js +1 -1
  138. package/lib/skills/runtime-skill-sync/constants.js +1 -1
  139. package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
  140. package/lib/skills/runtime-skill-sync/hashing.js +1 -1
  141. package/lib/skills/runtime-skill-sync/install-target.js +1 -1
  142. package/lib/skills/runtime-skill-sync/links.js +1 -1
  143. package/lib/skills/runtime-skill-sync/list-local.js +1 -1
  144. package/lib/skills/runtime-skill-sync/local-files.js +1 -1
  145. package/lib/skills/runtime-skill-sync/materialize.js +1 -1
  146. package/lib/skills/runtime-skill-sync/metadata.js +1 -1
  147. package/lib/skills/runtime-skill-sync/paths.js +1 -1
  148. package/lib/skills/runtime-skill-sync/push.js +1 -1
  149. package/lib/skills/runtime-skill-sync/scopes.js +1 -1
  150. package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
  151. package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
  152. package/lib/skills/runtime-skill-sync.js +1 -1
  153. package/lib/skills/skill-presence.js +1 -1
  154. package/lib/utils/access-key-redaction.js +1 -1
  155. package/lib/utils/apply-jq-filter.js +1 -1
  156. package/lib/utils/cli-version-check.js +1 -1
  157. package/lib/utils/cli-version-policy.js +1 -1
  158. package/lib/utils/logger.js +1 -1
  159. package/lib/utils/lossless-json.js +1 -1
  160. package/lib/utils/params.js +1 -1
  161. package/lib/utils/update-notice.js +1 -1
  162. package/lib/utils/version.js +1 -1
  163. package/lib/utils/write-cli-side-channel.js +1 -1
  164. package/package.json +2 -1
  165. package/skills/lovrabet/SKILL.md +1 -1
  166. package/skills/lovrabet.manifest.json +3 -3
  167. package/lib/utils/platform.d.ts +0 -17
  168. package/lib/utils/platform.js +0 -1
@@ -1 +1 @@
1
- const a135_0x4681f0=a135_0x2419;(function(_0x5632b3,_0x492890){const _0x2f5ca5=a135_0x2419,_0x47ca37=_0x5632b3();while(!![]){try{const _0x4b7f40=parseInt(_0x2f5ca5(0x1bb))/0x1+parseInt(_0x2f5ca5(0x1e7))/0x2*(parseInt(_0x2f5ca5(0x1ab))/0x3)+-parseInt(_0x2f5ca5(0x1d9))/0x4*(parseInt(_0x2f5ca5(0x1dd))/0x5)+-parseInt(_0x2f5ca5(0x1ce))/0x6*(-parseInt(_0x2f5ca5(0x1bd))/0x7)+parseInt(_0x2f5ca5(0x1d4))/0x8+-parseInt(_0x2f5ca5(0x1d2))/0x9*(parseInt(_0x2f5ca5(0x1db))/0xa)+-parseInt(_0x2f5ca5(0x1b6))/0xb;if(_0x4b7f40===_0x492890)break;else _0x47ca37['push'](_0x47ca37['shift']());}catch(_0x24716b){_0x47ca37['push'](_0x47ca37['shift']());}}}(a135_0xaa48,0x723da));import{createHash}from'node:crypto';function a135_0xaa48(){const _0x1711cd=['split','887097BKGJwX','pipe','1066716fBXzqe','utf8','message','Unsafe\x20manifest\x20path:\x20','files','lovrabet','skills@latest\x20exited\x20','skipped','installedPath','Installed\x20Skill\x20state\x20is\x20','content_mismatch','isSymbolicLink','home','root','reason','update','path','12WdJXUV','version','INSTALL_FAILED','hex','153JZbJrf','skills','218192OuksKA','sha256','packageRoot','error','absent','2260CcRLjj','present','17860ksYmuX','isDirectory','1730disUxf','unverifiable','length','missing','packageVersion','package.json','version_mismatch','stdio','name','skillVersion','9572SSrvip','schemaVersion','SKILL.md','isFile','state','digest','15SabGzW','flatMap','current','includes','manifest','join','match','startsWith','lovrabet.manifest.json','unknown','Unsupported\x20Skill\x20entry:\x20','6042245DgFvmZ','SOURCE_INVALID','sort','parse'];a135_0xaa48=function(){return _0x1711cd;};return a135_0xaa48();}import{lstatSync,readFileSync,readdirSync}from'node:fs';import{homedir}from'node:os';import{dirname,join,relative,resolve,sep}from'node:path';import{fileURLToPath}from'node:url';import{runNpxSkillsAddGlobal}from'../skills/npx-skills-add.js';import{resolveInstalledSkill}from'../skills/skill-presence.js';function a135_0x2419(_0x380c36,_0x4e240a){_0x380c36=_0x380c36-0x1a8;const _0xaa48ee=a135_0xaa48();let _0x241946=_0xaa48ee[_0x380c36];return _0x241946;}const DEFAULT_PACKAGE_ROOT=resolve(dirname(fileURLToPath(import.meta.url)),'..','..'),REPAIR_COMMAND='lovrabet\x20cli-skill\x20install',SKILL_NAME=a135_0x4681f0(0x1c2);function frontmatterValue(_0x29709d,_0x1ac62a){const _0x419207=a135_0x4681f0;return _0x29709d[_0x419207(0x1b1)](new RegExp('^'+_0x1ac62a+':\x5cs*(.+)$','m'))?.[0x1]?.['trim']()??'';}function listFiles(_0x5a868f,_0x3e607a=_0x5a868f){const _0x44ed84=a135_0x4681f0;return readdirSync(_0x3e607a,{'withFileTypes':!![]})[_0x44ed84(0x1ac)](_0x11f193=>{const _0x4bd59c=_0x44ed84,_0xff07df=join(_0x3e607a,_0x11f193[_0x4bd59c(0x1e5)]),_0x5922e3=lstatSync(_0xff07df);if(_0x5922e3[_0x4bd59c(0x1c8)]())throw new Error('Symbolic\x20link\x20is\x20not\x20allowed:\x20'+_0xff07df);if(_0x5922e3[_0x4bd59c(0x1dc)]())return listFiles(_0x5a868f,_0xff07df);if(!_0x5922e3[_0x4bd59c(0x1a8)]())throw new Error(_0x4bd59c(0x1b5)+_0xff07df);return[relative(_0x5a868f,_0xff07df)[_0x4bd59c(0x1ba)](sep)[_0x4bd59c(0x1b0)]('/')];})[_0x44ed84(0x1b8)]((_0x189b13,_0x5ca92b)=>_0x189b13<_0x5ca92b?-0x1:_0x189b13>_0x5ca92b?0x1:0x0);}function digestFiles(_0x1926e6,_0x5789d1){const _0x1d44e1=a135_0x4681f0,_0x393968=createHash(_0x1d44e1(0x1d5));for(const _0x11079c of _0x5789d1){if(_0x11079c[_0x1d44e1(0x1b2)]('/')||_0x11079c[_0x1d44e1(0x1ba)]('/')[_0x1d44e1(0x1ae)]('..')||_0x11079c['includes']('\x5c'))throw new Error(_0x1d44e1(0x1c0)+_0x11079c);_0x393968['update'](_0x11079c),_0x393968[_0x1d44e1(0x1cc)]('\x00'),_0x393968['update'](readFileSync(join(_0x1926e6,..._0x11079c[_0x1d44e1(0x1ba)]('/')))),_0x393968['update']('\x00');}return _0x393968[_0x1d44e1(0x1aa)](_0x1d44e1(0x1d1));}function sameFiles(_0x1830f5,_0x82beb9){const _0x58088e=a135_0x4681f0;return _0x1830f5['length']===_0x82beb9[_0x58088e(0x1df)]&&_0x1830f5['every']((_0x2e24f3,_0x346a27)=>_0x2e24f3===_0x82beb9[_0x346a27]);}function readSource(_0x48e8f5){const _0xe0162e=a135_0x4681f0,_0x3b2fad=JSON[_0xe0162e(0x1b9)](readFileSync(join(_0x48e8f5,_0xe0162e(0x1e2)),_0xe0162e(0x1be))),_0x4c276f=JSON[_0xe0162e(0x1b9)](readFileSync(join(_0x48e8f5,_0xe0162e(0x1d3),_0xe0162e(0x1b3)),_0xe0162e(0x1be))),_0x38ba23=join(_0x48e8f5,_0xe0162e(0x1d3),SKILL_NAME),_0x2c1748=frontmatterValue(readFileSync(join(_0x38ba23,'SKILL.md'),'utf8'),_0xe0162e(0x1cf)),_0x1754a9=listFiles(_0x38ba23);if(_0x4c276f[_0xe0162e(0x1e8)]!==0x1||_0x4c276f[_0xe0162e(0x1e5)]!==SKILL_NAME||!_0x3b2fad['version']||_0x4c276f['packageVersion']!==_0x3b2fad[_0xe0162e(0x1cf)]||_0x4c276f[_0xe0162e(0x1e6)]!==_0x3b2fad[_0xe0162e(0x1cf)]||_0x2c1748!==_0x3b2fad[_0xe0162e(0x1cf)]||!sameFiles(_0x1754a9,_0x4c276f[_0xe0162e(0x1c1)])||digestFiles(_0x38ba23,_0x1754a9)!==_0x4c276f['digest'])throw new Error('Built-in\x20Skill\x20source\x20does\x20not\x20match\x20its\x20package\x20manifest');return{'packageVersion':_0x3b2fad[_0xe0162e(0x1cf)],'skillVersion':_0x2c1748,'root':_0x38ba23,'manifest':_0x4c276f};}function installedSkillPath(_0x5de4ba){const _0x737921=a135_0x4681f0,_0x5376e0=resolveInstalledSkill(SKILL_NAME,{'home':_0x5de4ba});if(_0x5376e0['state']===_0x737921(0x1da))return{'state':_0x737921(0x1da),'path':dirname(_0x5376e0[_0x737921(0x1cd)])};if(_0x5376e0[_0x737921(0x1a9)]===_0x737921(0x1d8))return{'state':_0x737921(0x1e0)};return{'state':_0x737921(0x1de),'reason':_0x5376e0['reason']};}export function inspectInstalledBuiltinSkillVersion(_0x39a38f,_0x2d052d={}){const _0x330334=a135_0x4681f0,_0x4671de=installedSkillPath(_0x2d052d[_0x330334(0x1c9)]??homedir());if(_0x4671de[_0x330334(0x1a9)]===_0x330334(0x1e0))return{'state':_0x330334(0x1e0),'expectedVersion':_0x39a38f,'repairCommand':REPAIR_COMMAND};if(_0x4671de[_0x330334(0x1a9)]===_0x330334(0x1de))return{'state':_0x330334(0x1de),'expectedVersion':_0x39a38f,'reason':_0x4671de[_0x330334(0x1cb)],'repairCommand':REPAIR_COMMAND};try{const _0x5a4c65=frontmatterValue(readFileSync(join(_0x4671de['path'],_0x330334(0x1e9)),_0x330334(0x1be)),_0x330334(0x1cf));return{'state':_0x5a4c65===_0x39a38f?_0x330334(0x1ad):'version_mismatch','expectedVersion':_0x39a38f,'skillVersion':_0x5a4c65,'installedPath':_0x4671de[_0x330334(0x1cd)],'repairCommand':REPAIR_COMMAND};}catch(_0x36c18e){return{'state':'unverifiable','expectedVersion':_0x39a38f,'installedPath':_0x4671de[_0x330334(0x1cd)],'reason':_0x36c18e instanceof Error?_0x36c18e[_0x330334(0x1bf)]:String(_0x36c18e),'repairCommand':REPAIR_COMMAND};}}export function inspectBuiltinSkill(_0x4bbbd6={}){const _0x4ab2d1=a135_0x4681f0,_0xb1dbb7=_0x4bbbd6[_0x4ab2d1(0x1d6)]??DEFAULT_PACKAGE_ROOT;let _0xbba8ef;try{_0xbba8ef=readSource(_0xb1dbb7);}catch(_0x3084ae){return{'state':_0x4ab2d1(0x1de),'packageVersion':_0x4ab2d1(0x1b4),'reason':_0x3084ae instanceof Error?_0x3084ae[_0x4ab2d1(0x1bf)]:String(_0x3084ae),'repairCommand':REPAIR_COMMAND};}const _0x158b80=installedSkillPath(_0x4bbbd6[_0x4ab2d1(0x1c9)]??homedir());if(_0x158b80[_0x4ab2d1(0x1a9)]===_0x4ab2d1(0x1e0))return{'state':_0x4ab2d1(0x1e0),'packageVersion':_0xbba8ef['packageVersion'],'repairCommand':REPAIR_COMMAND};if(_0x158b80[_0x4ab2d1(0x1a9)]===_0x4ab2d1(0x1de))return{'state':_0x4ab2d1(0x1de),'packageVersion':_0xbba8ef[_0x4ab2d1(0x1e1)],'reason':_0x158b80[_0x4ab2d1(0x1cb)],'repairCommand':REPAIR_COMMAND};try{const _0x546f78=frontmatterValue(readFileSync(join(_0x158b80['path'],_0x4ab2d1(0x1e9)),'utf8'),_0x4ab2d1(0x1cf));if(_0x546f78!==_0xbba8ef[_0x4ab2d1(0x1e6)])return{'state':_0x4ab2d1(0x1e3),'packageVersion':_0xbba8ef[_0x4ab2d1(0x1e1)],'skillVersion':_0x546f78,'installedPath':_0x158b80['path'],'repairCommand':REPAIR_COMMAND};const _0x36370c=listFiles(_0x158b80[_0x4ab2d1(0x1cd)]),_0x342c09=digestFiles(_0x158b80['path'],_0x36370c);return{'state':sameFiles(_0x36370c,_0xbba8ef[_0x4ab2d1(0x1af)][_0x4ab2d1(0x1c1)])&&_0x342c09===_0xbba8ef[_0x4ab2d1(0x1af)][_0x4ab2d1(0x1aa)]?_0x4ab2d1(0x1ad):_0x4ab2d1(0x1c7),'packageVersion':_0xbba8ef[_0x4ab2d1(0x1e1)],'skillVersion':_0x546f78,'installedPath':_0x158b80['path'],'digest':_0x342c09,'repairCommand':REPAIR_COMMAND};}catch(_0x1c9195){return{'state':_0x4ab2d1(0x1de),'packageVersion':_0xbba8ef[_0x4ab2d1(0x1e1)],'installedPath':_0x158b80['path'],'reason':_0x1c9195 instanceof Error?_0x1c9195[_0x4ab2d1(0x1bf)]:String(_0x1c9195),'repairCommand':REPAIR_COMMAND};}}function failure(_0x7a1034,_0x333e6e,_0x4b01f3,_0x15aca2){const _0x5bc56d=a135_0x4681f0;return{'ok':![],'code':_0x7a1034,'packageVersion':_0x333e6e[_0x5bc56d(0x1e1)],'skillVersion':_0x333e6e['skillVersion'],'installedPath':_0x15aca2,'changed':![],'repairCommand':REPAIR_COMMAND,'error':_0x4b01f3 instanceof Error?_0x4b01f3['message']:String(_0x4b01f3)};}export function installBuiltinSkill(_0x53c19f={}){const _0x51d977=a135_0x4681f0,_0x40fe09=_0x53c19f[_0x51d977(0x1d6)]??DEFAULT_PACKAGE_ROOT,_0x4de076=_0x53c19f['home']??homedir();let _0x2500b3;try{_0x2500b3=readSource(_0x40fe09);}catch(_0x41066a){return failure(_0x51d977(0x1b7),{'packageVersion':_0x51d977(0x1b4),'skillVersion':'unknown'},_0x41066a);}const _0x550b6c=inspectBuiltinSkill({'packageRoot':_0x40fe09,'home':_0x4de076}),_0x5dc269=runNpxSkillsAddGlobal(_0x40fe09,_0x2500b3[_0x51d977(0x1ca)],{'stdio':_0x53c19f[_0x51d977(0x1e4)]??_0x51d977(0x1bc),'expectedSkillName':SKILL_NAME,'presence':{'home':_0x4de076}});if(_0x5dc269[_0x51d977(0x1c4)])return{'ok':!![],'packageVersion':_0x2500b3[_0x51d977(0x1e1)],'skillVersion':_0x2500b3[_0x51d977(0x1e6)],'installedPath':_0x550b6c[_0x51d977(0x1c5)],'changed':![],'repairCommand':REPAIR_COMMAND};if(!_0x5dc269['ok'])return failure(_0x51d977(0x1d0),_0x2500b3,_0x5dc269[_0x51d977(0x1d7)]??_0x51d977(0x1c3)+_0x5dc269['status']);const _0xdd1fab=inspectBuiltinSkill({'packageRoot':_0x40fe09,'home':_0x4de076});if(_0xdd1fab[_0x51d977(0x1a9)]!==_0x51d977(0x1ad))return failure('VERIFY_FAILED',_0x2500b3,_0xdd1fab['reason']??_0x51d977(0x1c6)+_0xdd1fab[_0x51d977(0x1a9)],_0xdd1fab[_0x51d977(0x1c5)]);return{'ok':!![],'packageVersion':_0x2500b3[_0x51d977(0x1e1)],'skillVersion':_0x2500b3[_0x51d977(0x1e6)],'installedPath':_0xdd1fab['installedPath'],'changed':_0x550b6c[_0x51d977(0x1a9)]!==_0x51d977(0x1ad),'repairCommand':REPAIR_COMMAND};}
1
+ function a135_0x5007(){const _0x5d06ba=['SKILL.md','message','62cqWzSJ','SOURCE_INVALID','Installed\x20Skill\x20state\x20is\x20','installedPath','580968pgjsqD','utf8','9254JZnlCt','version_mismatch','66110RmwuDa','1301994VaEkzq','Symbolic\x20link\x20is\x20not\x20allowed:\x20','unknown','parse','7WjPAGo','packageRoot','split','9FdhILf','content_mismatch','skills@latest\x20exited\x20','packageVersion','pipe','package.json','flatMap','sort','380jDttMZ','update','skillVersion','manifest','name','current','home','absent','state','stdio','trim','every','version','missing','digest','26tWarNX','reason','path','1396175ptWyuv','2408584qCKTpN',':\x5cs*(.+)$','556vPlcQU','unverifiable','skills','join','Built-in\x20Skill\x20source\x20does\x20not\x20match\x20its\x20package\x20manifest','root','Unsupported\x20Skill\x20entry:\x20','lovrabet','VERIFY_FAILED','hex','isDirectory','schemaVersion','status','sha256','2661OoZRNd','files','present'];a135_0x5007=function(){return _0x5d06ba;};return a135_0x5007();}const a135_0x50fb5d=a135_0x4c1e;(function(_0x444c1f,_0xc1ea74){const _0x1813ce=a135_0x4c1e,_0x5c6742=_0x444c1f();while(!![]){try{const _0x4ada80=-parseInt(_0x1813ce(0x1ce))/0x1*(parseInt(_0x1813ce(0x1c8))/0x2)+parseInt(_0x1813ce(0x1c3))/0x3*(-parseInt(_0x1813ce(0x1f5))/0x4)+-parseInt(_0x1813ce(0x1f2))/0x5+parseInt(_0x1813ce(0x1d1))/0x6*(parseInt(_0x1813ce(0x1d5))/0x7)+-parseInt(_0x1813ce(0x1f3))/0x8*(-parseInt(_0x1813ce(0x1d8))/0x9)+-parseInt(_0x1813ce(0x1e0))/0xa*(-parseInt(_0x1813ce(0x1d0))/0xb)+parseInt(_0x1813ce(0x1cc))/0xc*(parseInt(_0x1813ce(0x1ef))/0xd);if(_0x4ada80===_0xc1ea74)break;else _0x5c6742['push'](_0x5c6742['shift']());}catch(_0x4e40e8){_0x5c6742['push'](_0x5c6742['shift']());}}}(a135_0x5007,0x25916));import{createHash}from'node:crypto';import{lstatSync,readFileSync,readdirSync}from'node:fs';import{homedir}from'node:os';import{dirname,join,relative,resolve,sep}from'node:path';import{fileURLToPath}from'node:url';import{runNpxSkillsAddGlobal}from'../skills/npx-skills-add.js';import{resolveInstalledSkill}from'../skills/skill-presence.js';const DEFAULT_PACKAGE_ROOT=resolve(dirname(fileURLToPath(import.meta.url)),'..','..'),REPAIR_COMMAND='lovrabet\x20cli-skill\x20install',SKILL_NAME=a135_0x50fb5d(0x1bc);function frontmatterValue(_0x1c3d73,_0x5bd9a8){const _0x34905b=a135_0x50fb5d;return _0x1c3d73['match'](new RegExp('^'+_0x5bd9a8+_0x34905b(0x1f4),'m'))?.[0x1]?.[_0x34905b(0x1ea)]()??'';}function listFiles(_0x187306,_0x40b9a5=_0x187306){const _0x2e1dc7=a135_0x50fb5d;return readdirSync(_0x40b9a5,{'withFileTypes':!![]})[_0x2e1dc7(0x1de)](_0x1d12ae=>{const _0x333d8b=_0x2e1dc7,_0x2601dc=join(_0x40b9a5,_0x1d12ae[_0x333d8b(0x1e4)]),_0x30d5e6=lstatSync(_0x2601dc);if(_0x30d5e6['isSymbolicLink']())throw new Error(_0x333d8b(0x1d2)+_0x2601dc);if(_0x30d5e6[_0x333d8b(0x1bf)]())return listFiles(_0x187306,_0x2601dc);if(!_0x30d5e6['isFile']())throw new Error(_0x333d8b(0x1bb)+_0x2601dc);return[relative(_0x187306,_0x2601dc)[_0x333d8b(0x1d7)](sep)[_0x333d8b(0x1b8)]('/')];})[_0x2e1dc7(0x1df)]((_0xa66182,_0x1162c3)=>_0xa66182<_0x1162c3?-0x1:_0xa66182>_0x1162c3?0x1:0x0);}function digestFiles(_0x293f61,_0x11a76a){const _0x130a7c=a135_0x50fb5d,_0xb2ff7e=createHash(_0x130a7c(0x1c2));for(const _0x392f65 of _0x11a76a){if(_0x392f65['startsWith']('/')||_0x392f65[_0x130a7c(0x1d7)]('/')['includes']('..')||_0x392f65['includes']('\x5c'))throw new Error('Unsafe\x20manifest\x20path:\x20'+_0x392f65);_0xb2ff7e[_0x130a7c(0x1e1)](_0x392f65),_0xb2ff7e[_0x130a7c(0x1e1)]('\x00'),_0xb2ff7e['update'](readFileSync(join(_0x293f61,..._0x392f65[_0x130a7c(0x1d7)]('/')))),_0xb2ff7e['update']('\x00');}return _0xb2ff7e[_0x130a7c(0x1ee)](_0x130a7c(0x1be));}function sameFiles(_0x1fcde6,_0x3906df){const _0x206d13=a135_0x50fb5d;return _0x1fcde6['length']===_0x3906df['length']&&_0x1fcde6[_0x206d13(0x1eb)]((_0x441cbb,_0x349465)=>_0x441cbb===_0x3906df[_0x349465]);}function readSource(_0x46785a){const _0x224df7=a135_0x50fb5d,_0x30e754=JSON['parse'](readFileSync(join(_0x46785a,_0x224df7(0x1dd)),_0x224df7(0x1cd))),_0x1d44fb=JSON[_0x224df7(0x1d4)](readFileSync(join(_0x46785a,'skills','lovrabet.manifest.json'),_0x224df7(0x1cd))),_0x432ec6=join(_0x46785a,_0x224df7(0x1f7),SKILL_NAME),_0xd4290c=frontmatterValue(readFileSync(join(_0x432ec6,_0x224df7(0x1c6)),_0x224df7(0x1cd)),_0x224df7(0x1ec)),_0x5d9d22=listFiles(_0x432ec6);if(_0x1d44fb[_0x224df7(0x1c0)]!==0x1||_0x1d44fb[_0x224df7(0x1e4)]!==SKILL_NAME||!_0x30e754[_0x224df7(0x1ec)]||_0x1d44fb[_0x224df7(0x1db)]!==_0x30e754['version']||_0x1d44fb['skillVersion']!==_0x30e754['version']||_0xd4290c!==_0x30e754['version']||!sameFiles(_0x5d9d22,_0x1d44fb[_0x224df7(0x1c4)])||digestFiles(_0x432ec6,_0x5d9d22)!==_0x1d44fb[_0x224df7(0x1ee)])throw new Error(_0x224df7(0x1b9));return{'packageVersion':_0x30e754[_0x224df7(0x1ec)],'skillVersion':_0xd4290c,'root':_0x432ec6,'manifest':_0x1d44fb};}function a135_0x4c1e(_0x164675,_0x1cde36){_0x164675=_0x164675-0x1b8;const _0x50076e=a135_0x5007();let _0x4c1e7f=_0x50076e[_0x164675];return _0x4c1e7f;}function installedSkillPath(_0x49e171){const _0x526284=a135_0x50fb5d,_0x4fc0e5=resolveInstalledSkill(SKILL_NAME,{'home':_0x49e171});if(_0x4fc0e5['state']===_0x526284(0x1c5))return{'state':_0x526284(0x1c5),'path':dirname(_0x4fc0e5[_0x526284(0x1f1)])};if(_0x4fc0e5['state']===_0x526284(0x1e7))return{'state':_0x526284(0x1ed)};return{'state':_0x526284(0x1f6),'reason':_0x4fc0e5[_0x526284(0x1f0)]};}export function inspectInstalledBuiltinSkillVersion(_0x606422,_0x4d2254={}){const _0x19596f=a135_0x50fb5d,_0x3b6afe=installedSkillPath(_0x4d2254[_0x19596f(0x1e6)]??homedir());if(_0x3b6afe[_0x19596f(0x1e8)]==='missing')return{'state':_0x19596f(0x1ed),'expectedVersion':_0x606422,'repairCommand':REPAIR_COMMAND};if(_0x3b6afe[_0x19596f(0x1e8)]==='unverifiable')return{'state':_0x19596f(0x1f6),'expectedVersion':_0x606422,'reason':_0x3b6afe[_0x19596f(0x1f0)],'repairCommand':REPAIR_COMMAND};try{const _0x19f498=frontmatterValue(readFileSync(join(_0x3b6afe[_0x19596f(0x1f1)],_0x19596f(0x1c6)),_0x19596f(0x1cd)),_0x19596f(0x1ec));return{'state':_0x19f498===_0x606422?'current':_0x19596f(0x1cf),'expectedVersion':_0x606422,'skillVersion':_0x19f498,'installedPath':_0x3b6afe[_0x19596f(0x1f1)],'repairCommand':REPAIR_COMMAND};}catch(_0x17cfcb){return{'state':'unverifiable','expectedVersion':_0x606422,'installedPath':_0x3b6afe[_0x19596f(0x1f1)],'reason':_0x17cfcb instanceof Error?_0x17cfcb[_0x19596f(0x1c7)]:String(_0x17cfcb),'repairCommand':REPAIR_COMMAND};}}export function inspectBuiltinSkill(_0x162702={}){const _0x5bed1d=a135_0x50fb5d,_0x2de2ab=_0x162702[_0x5bed1d(0x1d6)]??DEFAULT_PACKAGE_ROOT;let _0x2bf339;try{_0x2bf339=readSource(_0x2de2ab);}catch(_0x10cf9b){return{'state':_0x5bed1d(0x1f6),'packageVersion':_0x5bed1d(0x1d3),'reason':_0x10cf9b instanceof Error?_0x10cf9b[_0x5bed1d(0x1c7)]:String(_0x10cf9b),'repairCommand':REPAIR_COMMAND};}const _0xaf2b4d=installedSkillPath(_0x162702[_0x5bed1d(0x1e6)]??homedir());if(_0xaf2b4d[_0x5bed1d(0x1e8)]===_0x5bed1d(0x1ed))return{'state':_0x5bed1d(0x1ed),'packageVersion':_0x2bf339['packageVersion'],'repairCommand':REPAIR_COMMAND};if(_0xaf2b4d[_0x5bed1d(0x1e8)]===_0x5bed1d(0x1f6))return{'state':'unverifiable','packageVersion':_0x2bf339[_0x5bed1d(0x1db)],'reason':_0xaf2b4d[_0x5bed1d(0x1f0)],'repairCommand':REPAIR_COMMAND};try{const _0xaff6c2=frontmatterValue(readFileSync(join(_0xaf2b4d[_0x5bed1d(0x1f1)],'SKILL.md'),_0x5bed1d(0x1cd)),'version');if(_0xaff6c2!==_0x2bf339[_0x5bed1d(0x1e2)])return{'state':_0x5bed1d(0x1cf),'packageVersion':_0x2bf339['packageVersion'],'skillVersion':_0xaff6c2,'installedPath':_0xaf2b4d[_0x5bed1d(0x1f1)],'repairCommand':REPAIR_COMMAND};const _0x3919a0=listFiles(_0xaf2b4d[_0x5bed1d(0x1f1)]),_0x853995=digestFiles(_0xaf2b4d[_0x5bed1d(0x1f1)],_0x3919a0);return{'state':sameFiles(_0x3919a0,_0x2bf339[_0x5bed1d(0x1e3)]['files'])&&_0x853995===_0x2bf339[_0x5bed1d(0x1e3)][_0x5bed1d(0x1ee)]?_0x5bed1d(0x1e5):_0x5bed1d(0x1d9),'packageVersion':_0x2bf339['packageVersion'],'skillVersion':_0xaff6c2,'installedPath':_0xaf2b4d[_0x5bed1d(0x1f1)],'digest':_0x853995,'repairCommand':REPAIR_COMMAND};}catch(_0x3bdec9){return{'state':_0x5bed1d(0x1f6),'packageVersion':_0x2bf339[_0x5bed1d(0x1db)],'installedPath':_0xaf2b4d[_0x5bed1d(0x1f1)],'reason':_0x3bdec9 instanceof Error?_0x3bdec9[_0x5bed1d(0x1c7)]:String(_0x3bdec9),'repairCommand':REPAIR_COMMAND};}}function failure(_0x8e98dc,_0x24dd51,_0x3bae8d,_0x43d895){const _0x126498=a135_0x50fb5d;return{'ok':![],'code':_0x8e98dc,'packageVersion':_0x24dd51[_0x126498(0x1db)],'skillVersion':_0x24dd51[_0x126498(0x1e2)],'installedPath':_0x43d895,'changed':![],'repairCommand':REPAIR_COMMAND,'error':_0x3bae8d instanceof Error?_0x3bae8d[_0x126498(0x1c7)]:String(_0x3bae8d)};}export function installBuiltinSkill(_0xd1c0d={}){const _0x303306=a135_0x50fb5d,_0x8e29c2=_0xd1c0d[_0x303306(0x1d6)]??DEFAULT_PACKAGE_ROOT,_0x110482=_0xd1c0d[_0x303306(0x1e6)]??homedir();let _0x16939b;try{_0x16939b=readSource(_0x8e29c2);}catch(_0x92d195){return failure(_0x303306(0x1c9),{'packageVersion':_0x303306(0x1d3),'skillVersion':_0x303306(0x1d3)},_0x92d195);}const _0xd79f65=inspectBuiltinSkill({'packageRoot':_0x8e29c2,'home':_0x110482}),_0x58ec79=runNpxSkillsAddGlobal(_0x8e29c2,_0x16939b[_0x303306(0x1ba)],{'stdio':_0xd1c0d[_0x303306(0x1e9)]??_0x303306(0x1dc),'expectedSkillName':SKILL_NAME,'presence':{'home':_0x110482}});if(_0x58ec79['skipped'])return{'ok':!![],'packageVersion':_0x16939b[_0x303306(0x1db)],'skillVersion':_0x16939b[_0x303306(0x1e2)],'installedPath':_0xd79f65['installedPath'],'changed':![],'repairCommand':REPAIR_COMMAND};if(!_0x58ec79['ok'])return failure('INSTALL_FAILED',_0x16939b,_0x58ec79['error']??_0x303306(0x1da)+_0x58ec79[_0x303306(0x1c1)]);const _0x3ccf35=inspectBuiltinSkill({'packageRoot':_0x8e29c2,'home':_0x110482});if(_0x3ccf35[_0x303306(0x1e8)]!==_0x303306(0x1e5))return failure(_0x303306(0x1bd),_0x16939b,_0x3ccf35[_0x303306(0x1f0)]??_0x303306(0x1ca)+_0x3ccf35[_0x303306(0x1e8)],_0x3ccf35[_0x303306(0x1cb)]);return{'ok':!![],'packageVersion':_0x16939b[_0x303306(0x1db)],'skillVersion':_0x16939b[_0x303306(0x1e2)],'installedPath':_0x3ccf35[_0x303306(0x1cb)],'changed':_0xd79f65[_0x303306(0x1e8)]!==_0x303306(0x1e5),'repairCommand':REPAIR_COMMAND};}
@@ -1 +1 @@
1
- const a136_0x521a15=a136_0x11e0;function a136_0x11e0(_0x1d4e1d,_0x399afd){_0x1d4e1d=_0x1d4e1d-0x127;const _0x25c9be=a136_0x25c9();let _0x11e043=_0x25c9be[_0x1d4e1d];return _0x11e043;}(function(_0x18f881,_0x40ef2){const _0x51d52d=a136_0x11e0,_0x456a7c=_0x18f881();while(!![]){try{const _0x2a3092=parseInt(_0x51d52d(0x12f))/0x1+parseInt(_0x51d52d(0x12a))/0x2*(-parseInt(_0x51d52d(0x12d))/0x3)+-parseInt(_0x51d52d(0x14e))/0x4+parseInt(_0x51d52d(0x129))/0x5*(-parseInt(_0x51d52d(0x128))/0x6)+parseInt(_0x51d52d(0x139))/0x7*(parseInt(_0x51d52d(0x14d))/0x8)+parseInt(_0x51d52d(0x148))/0x9*(-parseInt(_0x51d52d(0x14a))/0xa)+-parseInt(_0x51d52d(0x147))/0xb*(-parseInt(_0x51d52d(0x13a))/0xc);if(_0x2a3092===_0x40ef2)break;else _0x456a7c['push'](_0x456a7c['shift']());}catch(_0x21a4ca){_0x456a7c['push'](_0x456a7c['shift']());}}}(a136_0x25c9,0x9925e));import{spawnSync}from'node:child_process';import{resolveNpmBin}from'../utils/platform.js';import{LOVRABET_SKILL_SOURCE as a136_0x337327}from'../constant/distribution.js';import{PRODUCT_CONFIG,productEnvName}from'../constant/product.js';import{resolveInstalledSkill}from'../skills/skill-presence.js';export const LOVRABET_SKILL_SOURCE=a136_0x337327;export const LOVRABET_SKILL_GIT_SOURCE=PRODUCT_CONFIG[a136_0x521a15(0x13b)];export const LOVRABET_GLOBAL_SKILL_NAME=PRODUCT_CONFIG[a136_0x521a15(0x157)];export function resolveGlobalSkillName(_0x4ab3e5){const _0x3d532a=a136_0x521a15;switch(_0x4ab3e5[_0x3d532a(0x158)]()){case LOVRABET_SKILL_SOURCE:case LOVRABET_SKILL_GIT_SOURCE:return LOVRABET_GLOBAL_SKILL_NAME;default:return undefined;}}export const LOVRABET_SKIP_NPX_SKILLS_ENV=productEnvName(PRODUCT_CONFIG[a136_0x521a15(0x142)]);const CHILD_OUTPUT_MAX_BUFFER=0x10*0x400*0x400;function a136_0x25c9(){const _0x2d6e16=['error','SKILL_NOT_INSTALLED','PERMISSION_DENIED','INSTALL_PARTIAL','absent','warn','SPAWN_FAILED','presence','\x22\x20install\x20state:\x20','48517GXPbJq','322524prMGep','internalSkillSource','pipe','exit\x20','signal','unverifiable','checked','state','skipNpxSkillsEnvSuffix','present','\x20failed\x20target(s)','ENOENT','NPX_NOT_FOUND','1056AzFdZd','9hacLZO','status','10763360HrDhSN','expectedSkillName','toString','400XRiTkf','2492608Wgfynm','skills@latest','code','log','join','filter','CHILD_TERMINATED','unknown','!\x20Could\x20not\x20verify\x20\x22','globalSkillName','trim','NPM_CONFIG_GLOBAL','12smezYt','2092235BaEWrh','6vACvOs','CHILD_EXIT_NONZERO','reason','762069VPvTnn','match','999003BRpyTn'];a136_0x25c9=function(){return _0x2d6e16;};return a136_0x25c9();}function failure(_0x14126c,_0x4386dd,_0x4c385b){return{'ok':![],'status':_0x4386dd,'code':_0x14126c,'error':'['+_0x14126c+']\x20'+_0x4c385b};}export function shouldSkipNpxSkillsAdd(){return process.env[LOVRABET_SKIP_NPX_SKILLS_ENV]==='1';}export function runNpxSkillsAddGlobal(_0x243489,_0xbb5ec6=LOVRABET_SKILL_SOURCE,_0x2cfdae){const _0x2cca1d=a136_0x521a15;if(shouldSkipNpxSkillsAdd())return{'ok':!![],'status':0x0,'skipped':!![]};const _0x2a9a7a=resolveNpmBin('npx'),_0x544c55=['-y',_0x2cca1d(0x14f),'add',_0xbb5ec6,'-g','-y'],_0xd9ace9=[_0x2a9a7a,..._0x544c55][_0x2cca1d(0x152)]('\x20');console['log']('*\x20'+_0xd9ace9);const _0x528dd5={...process.env};delete _0x528dd5['npm_config_global'],delete _0x528dd5[_0x2cca1d(0x127)];const _0x2fedb5=spawnSync(_0x2a9a7a,_0x544c55,{'cwd':_0x243489,'stdio':_0x2cca1d(0x13c),'env':_0x528dd5,'shell':![],'maxBuffer':CHILD_OUTPUT_MAX_BUFFER}),_0x2a083b=[_0x2fedb5['stdout']?_0x2fedb5['stdout'][_0x2cca1d(0x14c)]():'',_0x2fedb5['stderr']?_0x2fedb5['stderr']['toString']():''][_0x2cca1d(0x153)](Boolean)[_0x2cca1d(0x152)]('\x0a')[_0x2cca1d(0x158)]();_0x2cfdae?.['stdio']!==_0x2cca1d(0x13c)&&_0x2a083b&&console[_0x2cca1d(0x151)](_0x2a083b);if(_0x2fedb5['error']){const _0x2158b7=_0x2fedb5[_0x2cca1d(0x130)],_0x2e43bb=_0x2158b7[_0x2cca1d(0x150)]===_0x2cca1d(0x145)?_0x2cca1d(0x146):_0x2158b7[_0x2cca1d(0x150)]==='EPERM'||_0x2158b7[_0x2cca1d(0x150)]==='EACCES'?_0x2cca1d(0x132):_0x2cca1d(0x136);return failure(_0x2e43bb,_0x2fedb5[_0x2cca1d(0x149)],_0x2158b7['message']);}if(_0x2fedb5['signal'])return failure(_0x2cca1d(0x154),_0x2fedb5['status'],'npx\x20terminated\x20by\x20signal\x20'+_0x2fedb5[_0x2cca1d(0x13e)]);if(_0x2fedb5[_0x2cca1d(0x149)]!==0x0)return failure(_0x2cca1d(0x12b),_0x2fedb5[_0x2cca1d(0x149)],_0x2a083b||_0x2cca1d(0x13d)+(_0x2fedb5[_0x2cca1d(0x149)]??_0x2cca1d(0x155)));const _0x348b92=_0x2cfdae?.[_0x2cca1d(0x14b)]??resolveGlobalSkillName(_0xbb5ec6),_0x5986cd=_0x348b92?resolveInstalledSkill(_0x348b92,_0x2cfdae?.[_0x2cca1d(0x137)]):undefined,_0x47966a=_0x2a083b[_0x2cca1d(0x12e)](/Failed to install\s+(\d+)/i);if(_0x47966a&&Number(_0x47966a[0x1])>0x0){const _0xfaee4a='Installer\x20reported\x20'+_0x47966a[0x1]+_0x2cca1d(0x144)+(_0x2a083b?':\x0a'+_0x2a083b:'');if(_0x5986cd?.['state']===_0x2cca1d(0x143))return console[_0x2cca1d(0x135)]('!\x20'+_0xfaee4a),{'ok':!![],'status':0x0};return failure(_0x2cca1d(0x133),0x0,_0xfaee4a);}if(_0x348b92&&_0x5986cd){if(_0x5986cd['state']===_0x2cca1d(0x134))return failure(_0x2cca1d(0x131),0x0,'Skill\x20\x22'+_0x348b92+'\x22\x20not\x20found\x20after\x20install\x20(checked\x20'+_0x5986cd[_0x2cca1d(0x140)][_0x2cca1d(0x152)](',\x20')+')');_0x5986cd[_0x2cca1d(0x141)]===_0x2cca1d(0x13f)&&console[_0x2cca1d(0x135)](_0x2cca1d(0x156)+_0x348b92+_0x2cca1d(0x138)+_0x5986cd[_0x2cca1d(0x12c)]);}return{'ok':!![],'status':0x0};}
1
+ const a136_0x40dc49=a136_0x54a1;(function(_0x224042,_0x47bcf6){const _0xf7097e=a136_0x54a1,_0x15dc45=_0x224042();while(!![]){try{const _0x36bac5=-parseInt(_0xf7097e(0x17d))/0x1+parseInt(_0xf7097e(0x15a))/0x2*(-parseInt(_0xf7097e(0x172))/0x3)+parseInt(_0xf7097e(0x17c))/0x4*(parseInt(_0xf7097e(0x14e))/0x5)+-parseInt(_0xf7097e(0x17f))/0x6+-parseInt(_0xf7097e(0x164))/0x7*(-parseInt(_0xf7097e(0x16f))/0x8)+-parseInt(_0xf7097e(0x162))/0x9*(-parseInt(_0xf7097e(0x14b))/0xa)+parseInt(_0xf7097e(0x15f))/0xb*(parseInt(_0xf7097e(0x161))/0xc);if(_0x36bac5===_0x47bcf6)break;else _0x15dc45['push'](_0x15dc45['shift']());}catch(_0x42a13f){_0x15dc45['push'](_0x15dc45['shift']());}}}(a136_0x3c43,0x5935e));import{execaSync}from'execa';import{LOVRABET_SKILL_SOURCE as a136_0x112132}from'../constant/distribution.js';import{PRODUCT_CONFIG,productEnvName}from'../constant/product.js';import{resolveInstalledSkill}from'../skills/skill-presence.js';export const LOVRABET_SKILL_SOURCE=a136_0x112132;function a136_0x3c43(){const _0x1d14ee=['CHILD_TERMINATED','!\x20Could\x20not\x20verify\x20\x22','Installer\x20reported\x20','12YaTnca','434423dpfmhJ','signal','2494476xjCBgY','34420vrlQVX','state','filter','296710zcExYG','Skill\x20\x22','npm_config_global','absent','ENOENT','SPAWN_FAILED','add','\x20failed\x20target(s)','EACCES','stdout','message','checked','2JfisCH','unknown','skills@latest','warn','stderr','11WvPpmp','npx','12369792VQtQtx','162cHHNYI','failed','14aIAYSU','trim','expectedSkillName','log','pipe','join','skipNpxSkillsEnvSuffix','code','EPERM','internalSkillSource','presence','620176HJMPhh','\x22\x20not\x20found\x20after\x20install\x20(checked\x20','present','630801XIpsWU','CHILD_EXIT_NONZERO','INSTALL_PARTIAL','shortMessage','stdio','reason','exitCode'];a136_0x3c43=function(){return _0x1d14ee;};return a136_0x3c43();}export const LOVRABET_SKILL_GIT_SOURCE=PRODUCT_CONFIG[a136_0x40dc49(0x16d)];export const LOVRABET_GLOBAL_SKILL_NAME=PRODUCT_CONFIG['globalSkillName'];export function resolveGlobalSkillName(_0x416f00){const _0x3d0c6e=a136_0x40dc49;switch(_0x416f00[_0x3d0c6e(0x165)]()){case LOVRABET_SKILL_SOURCE:case LOVRABET_SKILL_GIT_SOURCE:return LOVRABET_GLOBAL_SKILL_NAME;default:return undefined;}}export const LOVRABET_SKIP_NPX_SKILLS_ENV=productEnvName(PRODUCT_CONFIG[a136_0x40dc49(0x16a)]);const CHILD_OUTPUT_MAX_BUFFER=0x10*0x400*0x400;function failure(_0x3d1be1,_0x52137a,_0x467f89){return{'ok':![],'status':_0x52137a,'code':_0x3d1be1,'error':'['+_0x3d1be1+']\x20'+_0x467f89};}export function shouldSkipNpxSkillsAdd(){return process.env[LOVRABET_SKIP_NPX_SKILLS_ENV]==='1';}function a136_0x54a1(_0x4d7b65,_0x4f008e){_0x4d7b65=_0x4d7b65-0x14b;const _0x3c4370=a136_0x3c43();let _0x54a198=_0x3c4370[_0x4d7b65];return _0x54a198;}export function runNpxSkillsAddGlobal(_0x5376f6,_0x5919fc=LOVRABET_SKILL_SOURCE,_0x276052){const _0x1eb5a5=a136_0x40dc49;if(shouldSkipNpxSkillsAdd())return{'ok':!![],'status':0x0,'skipped':!![]};const _0x157ae2=['-y',_0x1eb5a5(0x15c),_0x1eb5a5(0x154),_0x5919fc,'-g','-y'],_0x463497=[_0x1eb5a5(0x160),..._0x157ae2][_0x1eb5a5(0x169)]('\x20');console[_0x1eb5a5(0x167)]('*\x20'+_0x463497);const _0x41a007={...process.env};delete _0x41a007[_0x1eb5a5(0x150)],delete _0x41a007['NPM_CONFIG_GLOBAL'];const _0x24f139=execaSync('npx',_0x157ae2,{'cwd':_0x5376f6,'stdio':_0x1eb5a5(0x168),'env':_0x41a007,'extendEnv':![],'shell':![],'reject':![],'maxBuffer':CHILD_OUTPUT_MAX_BUFFER}),_0x20f3ac=[_0x24f139[_0x1eb5a5(0x157)]?String(_0x24f139[_0x1eb5a5(0x157)]):'',_0x24f139[_0x1eb5a5(0x15e)]?String(_0x24f139[_0x1eb5a5(0x15e)]):''][_0x1eb5a5(0x14d)](Boolean)[_0x1eb5a5(0x169)]('\x0a')[_0x1eb5a5(0x165)](),_0x400164=_0x24f139[_0x1eb5a5(0x178)]??null;_0x276052?.[_0x1eb5a5(0x176)]!==_0x1eb5a5(0x168)&&_0x20f3ac&&console[_0x1eb5a5(0x167)](_0x20f3ac);if(_0x24f139[_0x1eb5a5(0x16b)]){const _0x5e47d4=_0x24f139[_0x1eb5a5(0x16b)]===_0x1eb5a5(0x152)?'NPX_NOT_FOUND':_0x24f139[_0x1eb5a5(0x16b)]===_0x1eb5a5(0x16c)||_0x24f139[_0x1eb5a5(0x16b)]===_0x1eb5a5(0x156)?'PERMISSION_DENIED':_0x1eb5a5(0x153);return failure(_0x5e47d4,_0x400164,_0x24f139[_0x1eb5a5(0x175)]??_0x24f139[_0x1eb5a5(0x158)]??_0x24f139[_0x1eb5a5(0x16b)]);}if(_0x24f139[_0x1eb5a5(0x17e)])return failure(_0x1eb5a5(0x179),_0x400164,'npx\x20terminated\x20by\x20signal\x20'+_0x24f139[_0x1eb5a5(0x17e)]);if(_0x24f139[_0x1eb5a5(0x163)]&&_0x400164===null)return failure(_0x1eb5a5(0x153),_0x400164,_0x24f139[_0x1eb5a5(0x175)]??_0x24f139[_0x1eb5a5(0x158)]??'npx\x20failed\x20to\x20start');if(_0x400164!==0x0)return failure(_0x1eb5a5(0x173),_0x400164,_0x20f3ac||_0x24f139[_0x1eb5a5(0x175)]||'exit\x20'+(_0x400164??_0x1eb5a5(0x15b)));const _0x3af9cf=_0x276052?.[_0x1eb5a5(0x166)]??resolveGlobalSkillName(_0x5919fc),_0x5901d4=_0x3af9cf?resolveInstalledSkill(_0x3af9cf,_0x276052?.[_0x1eb5a5(0x16e)]):undefined,_0x21e42e=_0x20f3ac['match'](/Failed to install\s+(\d+)/i);if(_0x21e42e&&Number(_0x21e42e[0x1])>0x0){const _0x4f5442=_0x1eb5a5(0x17b)+_0x21e42e[0x1]+_0x1eb5a5(0x155)+(_0x20f3ac?':\x0a'+_0x20f3ac:'');if(_0x5901d4?.['state']===_0x1eb5a5(0x171))return console[_0x1eb5a5(0x15d)]('!\x20'+_0x4f5442),{'ok':!![],'status':0x0};return failure(_0x1eb5a5(0x174),0x0,_0x4f5442);}if(_0x3af9cf&&_0x5901d4){if(_0x5901d4[_0x1eb5a5(0x14c)]===_0x1eb5a5(0x151))return failure('SKILL_NOT_INSTALLED',0x0,_0x1eb5a5(0x14f)+_0x3af9cf+_0x1eb5a5(0x170)+_0x5901d4[_0x1eb5a5(0x159)]['join'](',\x20')+')');_0x5901d4[_0x1eb5a5(0x14c)]==='unverifiable'&&console[_0x1eb5a5(0x15d)](_0x1eb5a5(0x17a)+_0x3af9cf+'\x22\x20install\x20state:\x20'+_0x5901d4[_0x1eb5a5(0x177)]);}return{'ok':!![],'status':0x0};}
@@ -1 +1 @@
1
- const a137_0x2d5142=a137_0x71e6;function a137_0x71e6(_0x493490,_0x5a9998){_0x493490=_0x493490-0x192;const _0x453c25=a137_0x453c();let _0x71e6b0=_0x453c25[_0x493490];return _0x71e6b0;}(function(_0x354a20,_0x5f7b8c){const _0x474b12=a137_0x71e6,_0x4bdc37=_0x354a20();while(!![]){try{const _0x1eadfd=parseInt(_0x474b12(0x1a0))/0x1*(-parseInt(_0x474b12(0x193))/0x2)+parseInt(_0x474b12(0x1a4))/0x3*(-parseInt(_0x474b12(0x199))/0x4)+-parseInt(_0x474b12(0x194))/0x5*(parseInt(_0x474b12(0x19e))/0x6)+parseInt(_0x474b12(0x195))/0x7+-parseInt(_0x474b12(0x19d))/0x8*(parseInt(_0x474b12(0x1a1))/0x9)+parseInt(_0x474b12(0x19b))/0xa*(-parseInt(_0x474b12(0x1a3))/0xb)+parseInt(_0x474b12(0x19c))/0xc*(parseInt(_0x474b12(0x1a7))/0xd);if(_0x1eadfd===_0x5f7b8c)break;else _0x4bdc37['push'](_0x4bdc37['shift']());}catch(_0x432441){_0x4bdc37['push'](_0x4bdc37['shift']());}}}(a137_0x453c,0x1c9a5));export const METADATA_FILE=a137_0x2d5142(0x196);export const SKILL_FILE=a137_0x2d5142(0x192);function a137_0x453c(){const _0x5dc020=['node_modules','1679dpDpHf','27KTTyDB','build','1455135LukssP','161358RpITHk','.hg','coverage','299JprmfZ','.cache','.DS_Store','SKILL.md','190UvqqEk','5fRsZBf','1116696RVlFee','lovrabet.skill.json','.next','.turbo','8hThAdu','.svn','10KzwqGe','244344uujAuw','76688kMsbYS','495462pgCJeL'];a137_0x453c=function(){return _0x5dc020;};return a137_0x453c();}export const IGNORED_FILE_NAMES=new Set([METADATA_FILE,a137_0x2d5142(0x1a9)]);export const IGNORED_DIR_NAMES=new Set(['.git',a137_0x2d5142(0x1a5),a137_0x2d5142(0x19a),a137_0x2d5142(0x19f),a137_0x2d5142(0x197),'dist',a137_0x2d5142(0x1a2),a137_0x2d5142(0x1a6),a137_0x2d5142(0x198),a137_0x2d5142(0x1a8)]);
1
+ const a137_0x254896=a137_0xbc9e;function a137_0xbc9e(_0x193a07,_0x3bb74e){_0x193a07=_0x193a07-0xf3;const _0x50ebbc=a137_0x50eb();let _0xbc9e26=_0x50ebbc[_0x193a07];return _0xbc9e26;}(function(_0x327d39,_0x27396a){const _0x48f123=a137_0xbc9e,_0x1649e6=_0x327d39();while(!![]){try{const _0x22a57b=-parseInt(_0x48f123(0x104))/0x1*(parseInt(_0x48f123(0xff))/0x2)+parseInt(_0x48f123(0x10b))/0x3*(parseInt(_0x48f123(0xf3))/0x4)+-parseInt(_0x48f123(0x106))/0x5*(parseInt(_0x48f123(0x108))/0x6)+-parseInt(_0x48f123(0x10a))/0x7+parseInt(_0x48f123(0xfe))/0x8*(-parseInt(_0x48f123(0xf9))/0x9)+parseInt(_0x48f123(0xfb))/0xa*(parseInt(_0x48f123(0xfc))/0xb)+-parseInt(_0x48f123(0x105))/0xc*(-parseInt(_0x48f123(0x103))/0xd);if(_0x22a57b===_0x27396a)break;else _0x1649e6['push'](_0x1649e6['shift']());}catch(_0x2c94ae){_0x1649e6['push'](_0x1649e6['shift']());}}}(a137_0x50eb,0x80d87));export const METADATA_FILE='lovrabet.skill.json';export const SKILL_FILE=a137_0x254896(0x102);export const IGNORED_FILE_NAMES=new Set([METADATA_FILE,a137_0x254896(0xfd)]);export const IGNORED_DIR_NAMES=new Set([a137_0x254896(0x109),a137_0x254896(0xf8),a137_0x254896(0xf5),a137_0x254896(0xfa),a137_0x254896(0xf6),a137_0x254896(0x107),a137_0x254896(0x100),a137_0x254896(0xf4),a137_0x254896(0xf7),a137_0x254896(0x101)]);function a137_0x50eb(){const _0x1ebbdd=['488VopzoP','coverage','.svn','.next','.turbo','.hg','9NqUWgI','node_modules','10ZaEBYC','8461255aHWBEe','.DS_Store','3411896uQQRhU','2CfcCpb','build','.cache','SKILL.md','13qfUzSn','960229HkUhJw','25642464PRDdJb','790975RHqXJS','dist','24zXxYKi','.git','3894436ZIfkBj','4857FSYLAq'];a137_0x50eb=function(){return _0x1ebbdd;};return a137_0x50eb();}
@@ -1 +1 @@
1
- (function(_0x5e3a95,_0x144ca8){const _0x2a3451=a138_0x4705,_0x4cd8bb=_0x5e3a95();while(!![]){try{const _0x36d991=-parseInt(_0x2a3451(0xb4))/0x1*(-parseInt(_0x2a3451(0xb8))/0x2)+parseInt(_0x2a3451(0xbb))/0x3*(parseInt(_0x2a3451(0xc0))/0x4)+parseInt(_0x2a3451(0xb9))/0x5+-parseInt(_0x2a3451(0xbc))/0x6+parseInt(_0x2a3451(0xb2))/0x7+-parseInt(_0x2a3451(0xba))/0x8*(parseInt(_0x2a3451(0xb3))/0x9)+parseInt(_0x2a3451(0xb5))/0xa*(parseInt(_0x2a3451(0xb7))/0xb);if(_0x36d991===_0x144ca8)break;else _0x4cd8bb['push'](_0x4cd8bb['shift']());}catch(_0x4be8ab){_0x4cd8bb['push'](_0x4cd8bb['shift']());}}}(a138_0x363a,0x500be));import{lstatSync,readlinkSync,realpathSync,renameSync,rmSync,writeFileSync}from'node:fs';import{dirname,isAbsolute,resolve,sep}from'node:path';import{CliErrors}from'../../errors.js';import{normalizeSkillRelativePath}from'./local-files.js';export function resolveManagedFilePath(_0xaec243,_0x5b0f83){const _0xe2a7e9=a138_0x4705,_0x2ecd6a=normalizeSkillRelativePath(_0x5b0f83),_0x225674=realOrResolved(_0xaec243),_0x56c33e=resolve(_0x225674,..._0x2ecd6a['split']('/'));if(!isPathInside(_0x56c33e,_0x225674))throw CliErrors[_0xe2a7e9(0xbe)]('Unsafe\x20Skill\x20file\x20path:\x20'+_0x5b0f83);return ensureNoSymlinkInManagedPath(_0x225674,_0x2ecd6a),_0x56c33e;}export function ensureNoSymlinkInManagedPath(_0x54e3f4,_0x519c36){const _0x7ec0fe=a138_0x4705;let _0x580dba=_0x54e3f4;for(const _0x35b81e of _0x519c36[_0x7ec0fe(0xc2)]('/')){_0x580dba=resolve(_0x580dba,_0x35b81e);const _0x45ea2d=lstatIfPresent(_0x580dba);if(_0x45ea2d?.[_0x7ec0fe(0xb6)]())throw CliErrors[_0x7ec0fe(0xbe)](_0x7ec0fe(0xb1)+_0x519c36);}}function a138_0x4705(_0x47a2e0,_0x3317a1){_0x47a2e0=_0x47a2e0-0xaf;const _0x363a8b=a138_0x363a();let _0x4705c9=_0x363a8b[_0x47a2e0];return _0x4705c9;}export function isDanglingSymlink(_0x24d080){const _0x391c44=a138_0x4705;try{return lstatSync(_0x24d080)[_0x391c44(0xb6)]();}catch{return![];}}export function resolveSymlinkTarget(_0x45ecd1){const _0x1471bc=readlinkSync(_0x45ecd1);return isAbsolute(_0x1471bc)?_0x1471bc:resolve(dirname(_0x45ecd1),_0x1471bc);}function a138_0x363a(){const _0x1e7b33=['5169274WIfzHY','898ydqruZ','7990EcEReV','184QPLpNb','60YoqHWz','2235582wWXJWS','stringify','validation','startsWith','8488OTjBhP','from','split','utf8','.tmp','Refusing\x20to\x20write\x20through\x20Skill\x20symlink\x20path:\x20','465990tKEZrQ','22824UEZRsf','397oCQqrA','10wqEjOE','isSymbolicLink'];a138_0x363a=function(){return _0x1e7b33;};return a138_0x363a();}export function isPathInside(_0x1336c8,_0x2e979f){const _0x2dd635=a138_0x4705,_0x31a709=_0x1336c8['endsWith'](sep)?_0x1336c8:''+_0x1336c8+sep,_0x542d96=_0x2e979f['endsWith'](sep)?_0x2e979f:''+_0x2e979f+sep;return _0x1336c8===_0x2e979f||_0x31a709[_0x2dd635(0xbf)](_0x542d96);}export function realOrResolved(_0x3e024a){try{return realpathSync(_0x3e024a);}catch{return resolve(_0x3e024a);}}export function lstatIfPresent(_0x55882a){try{return lstatSync(_0x55882a);}catch{return undefined;}}export function writeTextAtomic(_0x338277,_0x4d7db5,_0x1284b9){const _0x4b71f2=a138_0x4705;writeBytesAtomic(_0x338277,Buffer[_0x4b71f2(0xc1)](_0x4d7db5,_0x4b71f2(0xaf)),_0x1284b9);}export function writeBytesAtomic(_0x139fe0,_0x2e6c6b,_0xa007e7){const _0x4fc7f2=a138_0x4705,_0x146a18=_0x139fe0+_0x4fc7f2(0xb0);try{writeFileSync(_0x146a18,_0x2e6c6b,{'mode':_0xa007e7}),renameSync(_0x146a18,_0x139fe0);}catch(_0xe2b1cc){try{rmSync(_0x146a18,{'force':!![]});}catch{}throw _0xe2b1cc;}}export function writeJsonAtomic(_0x3afb54,_0x521c7c){const _0x4650df=a138_0x4705;writeTextAtomic(_0x3afb54,JSON[_0x4650df(0xbd)](_0x521c7c,null,0x2)+'\x0a',0x180);}
1
+ (function(_0x543e83,_0x1cf9b3){const _0x132bb4=a138_0xcecd,_0xddcd26=_0x543e83();while(!![]){try{const _0x3536ff=parseInt(_0x132bb4(0xdb))/0x1*(-parseInt(_0x132bb4(0xd8))/0x2)+parseInt(_0x132bb4(0xd9))/0x3*(parseInt(_0x132bb4(0xeb))/0x4)+parseInt(_0x132bb4(0xd7))/0x5*(parseInt(_0x132bb4(0xdc))/0x6)+parseInt(_0x132bb4(0xda))/0x7*(parseInt(_0x132bb4(0xe3))/0x8)+-parseInt(_0x132bb4(0xe1))/0x9+-parseInt(_0x132bb4(0xdf))/0xa+parseInt(_0x132bb4(0xde))/0xb*(parseInt(_0x132bb4(0xdd))/0xc);if(_0x3536ff===_0x1cf9b3)break;else _0xddcd26['push'](_0xddcd26['shift']());}catch(_0x25cc39){_0xddcd26['push'](_0xddcd26['shift']());}}}(a138_0x686a,0x7940a));import{lstatSync,readlinkSync,realpathSync,renameSync,rmSync,writeFileSync}from'node:fs';import{dirname,isAbsolute,resolve,sep}from'node:path';import{CliErrors}from'../../errors.js';import{normalizeSkillRelativePath}from'./local-files.js';export function resolveManagedFilePath(_0x139868,_0x1e39f8){const _0x2b4701=a138_0xcecd,_0x369a34=normalizeSkillRelativePath(_0x1e39f8),_0x5ae2bb=realOrResolved(_0x139868),_0xa85693=resolve(_0x5ae2bb,..._0x369a34['split']('/'));if(!isPathInside(_0xa85693,_0x5ae2bb))throw CliErrors[_0x2b4701(0xea)](_0x2b4701(0xe4)+_0x1e39f8);return ensureNoSymlinkInManagedPath(_0x5ae2bb,_0x369a34),_0xa85693;}export function ensureNoSymlinkInManagedPath(_0xe102b5,_0xe0ab1b){const _0x6526ab=a138_0xcecd;let _0xdc296e=_0xe102b5;for(const _0x2b2764 of _0xe0ab1b[_0x6526ab(0xe7)]('/')){_0xdc296e=resolve(_0xdc296e,_0x2b2764);const _0x59e1c8=lstatIfPresent(_0xdc296e);if(_0x59e1c8?.[_0x6526ab(0xe0)]())throw CliErrors[_0x6526ab(0xea)]('Refusing\x20to\x20write\x20through\x20Skill\x20symlink\x20path:\x20'+_0xe0ab1b);}}export function isDanglingSymlink(_0x5775cf){const _0x124583=a138_0xcecd;try{return lstatSync(_0x5775cf)[_0x124583(0xe0)]();}catch{return![];}}function a138_0xcecd(_0x56109e,_0x319eb8){_0x56109e=_0x56109e-0xd7;const _0x686a08=a138_0x686a();let _0xcecdfe=_0x686a08[_0x56109e];return _0xcecdfe;}function a138_0x686a(){const _0x8df653=['3jqYsxd','5449591EALMHv','7002qRfYSp','18cqMyCt','12JkaXKk','881551emDMaR','4449170OoueBu','isSymbolicLink','1636443XkZPPF','startsWith','8YozIxE','Unsafe\x20Skill\x20file\x20path:\x20','endsWith','.tmp','split','from','stringify','validation','1645208IXokrY','utf8','899390NruLnM','196VIJdmR'];a138_0x686a=function(){return _0x8df653;};return a138_0x686a();}export function resolveSymlinkTarget(_0x196c63){const _0x31029e=readlinkSync(_0x196c63);return isAbsolute(_0x31029e)?_0x31029e:resolve(dirname(_0x196c63),_0x31029e);}export function isPathInside(_0xf8e0f2,_0x17983e){const _0x55ebd8=a138_0xcecd,_0x3e96b6=_0xf8e0f2['endsWith'](sep)?_0xf8e0f2:''+_0xf8e0f2+sep,_0x3f6028=_0x17983e[_0x55ebd8(0xe5)](sep)?_0x17983e:''+_0x17983e+sep;return _0xf8e0f2===_0x17983e||_0x3e96b6[_0x55ebd8(0xe2)](_0x3f6028);}export function realOrResolved(_0x12afad){try{return realpathSync(_0x12afad);}catch{return resolve(_0x12afad);}}export function lstatIfPresent(_0x290ab8){try{return lstatSync(_0x290ab8);}catch{return undefined;}}export function writeTextAtomic(_0x5847d2,_0x56296c,_0x1bd67a){const _0x26cff4=a138_0xcecd;writeBytesAtomic(_0x5847d2,Buffer[_0x26cff4(0xe8)](_0x56296c,_0x26cff4(0xec)),_0x1bd67a);}export function writeBytesAtomic(_0xe94b21,_0x4de70a,_0x4c923e){const _0x1c562c=a138_0xcecd,_0x58a801=_0xe94b21+_0x1c562c(0xe6);try{writeFileSync(_0x58a801,_0x4de70a,{'mode':_0x4c923e}),renameSync(_0x58a801,_0xe94b21);}catch(_0x3687b7){try{rmSync(_0x58a801,{'force':!![]});}catch{}throw _0x3687b7;}}export function writeJsonAtomic(_0x447193,_0x55b27a){const _0x424f0a=a138_0xcecd;writeTextAtomic(_0x447193,JSON[_0x424f0a(0xe9)](_0x55b27a,null,0x2)+'\x0a',0x180);}
@@ -1 +1 @@
1
- (function(_0x31f926,_0xaa81ff){const _0x41f23=a139_0x2400,_0x4655e5=_0x31f926();while(!![]){try{const _0x108ee0=-parseInt(_0x41f23(0x1aa))/0x1+parseInt(_0x41f23(0x1a8))/0x2*(parseInt(_0x41f23(0x19f))/0x3)+-parseInt(_0x41f23(0x1a1))/0x4*(-parseInt(_0x41f23(0x1a7))/0x5)+-parseInt(_0x41f23(0x1ad))/0x6+-parseInt(_0x41f23(0x1a9))/0x7+-parseInt(_0x41f23(0x1a5))/0x8*(-parseInt(_0x41f23(0x1a3))/0x9)+parseInt(_0x41f23(0x1a6))/0xa;if(_0x108ee0===_0xaa81ff)break;else _0x4655e5['push'](_0x4655e5['shift']());}catch(_0x50061a){_0x4655e5['push'](_0x4655e5['shift']());}}}(a139_0x39dc,0x4bd8c));import{createHash}from'node:crypto';import{fileContent,normalizeManifestFiles}from'./local-files.js';export function contentHash(_0x132bca){const _0x5c1de8=a139_0x2400;return createHash(_0x5c1de8(0x1ac))[_0x5c1de8(0x1ab)](_0x132bca)[_0x5c1de8(0x1ae)](_0x5c1de8(0x1a2));}function a139_0x39dc(){const _0xd6b0ee=['update','sha256','3618090UTcMQZ','digest','611517DZbzAW','path','1984420yrbbBq','hex','1240497uwILml','size','16BvOeru','5519910QNZeoL','5kxdunk','2DjBUBB','3169453gJxdHr','161139qYZpbA'];a139_0x39dc=function(){return _0xd6b0ee;};return a139_0x39dc();}function a139_0x2400(_0x24b167,_0x21e19f){_0x24b167=_0x24b167-0x19f;const _0x39dca1=a139_0x39dc();let _0x2400cc=_0x39dca1[_0x24b167];return _0x2400cc;}export function fileHash(_0xeb5dff){return bufferSha256(fileContent(_0xeb5dff));}export function bufferSha256(_0x59200d){const _0x3b92a3=a139_0x2400;return createHash(_0x3b92a3(0x1ac))[_0x3b92a3(0x1ab)](_0x59200d)[_0x3b92a3(0x1ae)](_0x3b92a3(0x1a2));}export function fileTreeHash(_0x13885e){const _0x5ccc87=a139_0x2400,_0x50c7e9=createHash(_0x5ccc87(0x1ac));for(const _0x1ccd3d of normalizeManifestFiles(_0x13885e)){_0x50c7e9[_0x5ccc87(0x1ab)](_0x1ccd3d[_0x5ccc87(0x1a0)]),_0x50c7e9[_0x5ccc87(0x1ab)]('\x00'),_0x50c7e9['update'](_0x1ccd3d[_0x5ccc87(0x1ac)]),_0x50c7e9[_0x5ccc87(0x1ab)]('\x00'),_0x50c7e9[_0x5ccc87(0x1ab)](String(_0x1ccd3d[_0x5ccc87(0x1a4)])),_0x50c7e9[_0x5ccc87(0x1ab)]('\x00');}return _0x50c7e9['digest'](_0x5ccc87(0x1a2));}
1
+ (function(_0x4b5eb4,_0x3e3c5c){const _0x36d3d0=a139_0x3e59,_0x4d6d05=_0x4b5eb4();while(!![]){try{const _0x2310a1=parseInt(_0x36d3d0(0xeb))/0x1+-parseInt(_0x36d3d0(0xef))/0x2*(-parseInt(_0x36d3d0(0xe8))/0x3)+parseInt(_0x36d3d0(0xf0))/0x4+-parseInt(_0x36d3d0(0xee))/0x5+-parseInt(_0x36d3d0(0xf1))/0x6+-parseInt(_0x36d3d0(0xe9))/0x7*(-parseInt(_0x36d3d0(0xed))/0x8)+-parseInt(_0x36d3d0(0xec))/0x9;if(_0x2310a1===_0x3e3c5c)break;else _0x4d6d05['push'](_0x4d6d05['shift']());}catch(_0x5eca4e){_0x4d6d05['push'](_0x4d6d05['shift']());}}}(a139_0x23d0,0x2de77));import{createHash}from'node:crypto';function a139_0x23d0(){const _0x22a959=['468174rsdGSd','path','digest','sha256','update','765987IkaXOg','14NxqAVa','hex','97106DLvIWR','1192833FvsmNm','670936dfyjTi','739470YgkRoJ','2VHBCgx','105256CLIHiZ'];a139_0x23d0=function(){return _0x22a959;};return a139_0x23d0();}import{fileContent,normalizeManifestFiles}from'./local-files.js';export function contentHash(_0xdd26ea){const _0x35417b=a139_0x3e59;return createHash('sha256')['update'](_0xdd26ea)[_0x35417b(0xf3)](_0x35417b(0xea));}export function fileHash(_0x44eeab){return bufferSha256(fileContent(_0x44eeab));}function a139_0x3e59(_0x51a173,_0x598d9d){_0x51a173=_0x51a173-0xe6;const _0x23d036=a139_0x23d0();let _0x3e59a0=_0x23d036[_0x51a173];return _0x3e59a0;}export function bufferSha256(_0x266167){const _0x1aaccd=a139_0x3e59;return createHash(_0x1aaccd(0xe6))[_0x1aaccd(0xe7)](_0x266167)[_0x1aaccd(0xf3)](_0x1aaccd(0xea));}export function fileTreeHash(_0x4300b8){const _0x53819a=a139_0x3e59,_0x3c8a5b=createHash('sha256');for(const _0x2b3d59 of normalizeManifestFiles(_0x4300b8)){_0x3c8a5b[_0x53819a(0xe7)](_0x2b3d59[_0x53819a(0xf2)]),_0x3c8a5b[_0x53819a(0xe7)]('\x00'),_0x3c8a5b[_0x53819a(0xe7)](_0x2b3d59['sha256']),_0x3c8a5b[_0x53819a(0xe7)]('\x00'),_0x3c8a5b[_0x53819a(0xe7)](String(_0x2b3d59['size'])),_0x3c8a5b['update']('\x00');}return _0x3c8a5b[_0x53819a(0xf3)](_0x53819a(0xea));}
@@ -1 +1 @@
1
- const a140_0x170d4c=a140_0xd649;(function(_0x547e53,_0x15147a){const _0x556cac=a140_0xd649,_0x429fbf=_0x547e53();while(!![]){try{const _0x521c6b=parseInt(_0x556cac(0x1c8))/0x1*(parseInt(_0x556cac(0x1c5))/0x2)+-parseInt(_0x556cac(0x1c0))/0x3+-parseInt(_0x556cac(0x1bb))/0x4*(-parseInt(_0x556cac(0x1c3))/0x5)+-parseInt(_0x556cac(0x1be))/0x6+-parseInt(_0x556cac(0x1bc))/0x7+parseInt(_0x556cac(0x1c6))/0x8+parseInt(_0x556cac(0x1bd))/0x9;if(_0x521c6b===_0x15147a)break;else _0x429fbf['push'](_0x429fbf['shift']());}catch(_0x780009){_0x429fbf['push'](_0x429fbf['shift']());}}}(a140_0xfea1,0xbc2e7));import{resolve}from'node:path';import{resolveSkillSyncPaths,runtimeAgentSkillRoots,safePathSegment}from'./paths.js';function a140_0xd649(_0x11c263,_0x2b398a){_0x11c263=_0x11c263-0x1ba;const _0xfea13e=a140_0xfea1();let _0xd64950=_0xfea13e[_0x11c263];return _0xd64950;}export function resolveRuntimeSkillInstallTarget(_0x8fb442,_0x102db0=a140_0x170d4c(0x1bf),_0x39565a={}){const _0x263e8a=a140_0x170d4c,_0x595809=resolveSkillSyncPaths(_0x39565a),_0x5781d4=safePathSegment(_0x8fb442,_0x263e8a(0x1c4)),_0x2db079=_0x102db0===_0x263e8a(0x1c2)?[resolve(_0x39565a[_0x263e8a(0x1c7)]??process['cwd'](),_0x263e8a(0x1ba),'skills')]:runtimeAgentSkillRoots(_0x595809);return Object[_0x263e8a(0x1c1)]({'scope':_0x102db0,'appCode':_0x5781d4,'skillRoots':Object[_0x263e8a(0x1c1)](_0x2db079),'managedRoot':_0x595809['managedRoot']});}function a140_0xfea1(){const _0x1b06fc=['552HeuyDb','5358416NGozCT','4980321OIhmEF','3853272sCpZVw','global','4058310xxcNoW','freeze','project','28940iPBGIb','appCode','238OmoqDy','7044008aTonuM','cwd','10913DOsVrJ','.agents'];a140_0xfea1=function(){return _0x1b06fc;};return a140_0xfea1();}
1
+ const a140_0x3eb2bb=a140_0x5a63;(function(_0x20c10a,_0x599182){const _0x2963d1=a140_0x5a63,_0x13945f=_0x20c10a();while(!![]){try{const _0x1bccbe=-parseInt(_0x2963d1(0x1d7))/0x1*(-parseInt(_0x2963d1(0x1d3))/0x2)+parseInt(_0x2963d1(0x1ce))/0x3+-parseInt(_0x2963d1(0x1d2))/0x4+-parseInt(_0x2963d1(0x1d1))/0x5+-parseInt(_0x2963d1(0x1cf))/0x6+parseInt(_0x2963d1(0x1d6))/0x7*(parseInt(_0x2963d1(0x1ca))/0x8)+-parseInt(_0x2963d1(0x1d0))/0x9*(-parseInt(_0x2963d1(0x1d4))/0xa);if(_0x1bccbe===_0x599182)break;else _0x13945f['push'](_0x13945f['shift']());}catch(_0x50b7bc){_0x13945f['push'](_0x13945f['shift']());}}}(a140_0x7982,0xbe2db));import{resolve}from'node:path';import{resolveSkillSyncPaths,runtimeAgentSkillRoots,safePathSegment}from'./paths.js';function a140_0x7982(){const _0x465739=['890nnlHNG','freeze','3466855TyHqgN','1dKDdhb','skills','.agents','cwd','8UnMJBP','appCode','project','global','1320498svInXO','4034802CVBtbb','132903mTuTEe','1595825jWTRSs','4668640llvOqj','1376138kPaSsY'];a140_0x7982=function(){return _0x465739;};return a140_0x7982();}function a140_0x5a63(_0x59f6eb,_0x11108c){_0x59f6eb=_0x59f6eb-0x1ca;const _0x798233=a140_0x7982();let _0x5a63da=_0x798233[_0x59f6eb];return _0x5a63da;}export function resolveRuntimeSkillInstallTarget(_0x435a88,_0x16b3d3=a140_0x3eb2bb(0x1cd),_0x3b8b63={}){const _0x104e62=a140_0x3eb2bb,_0x2e1b71=resolveSkillSyncPaths(_0x3b8b63),_0x27b762=safePathSegment(_0x435a88,_0x104e62(0x1cb)),_0x4c5e2e=_0x16b3d3===_0x104e62(0x1cc)?[resolve(_0x3b8b63[_0x104e62(0x1da)]??process['cwd'](),_0x104e62(0x1d9),_0x104e62(0x1d8))]:runtimeAgentSkillRoots(_0x2e1b71);return Object['freeze']({'scope':_0x16b3d3,'appCode':_0x27b762,'skillRoots':Object[_0x104e62(0x1d5)](_0x4c5e2e),'managedRoot':_0x2e1b71['managedRoot']});}
@@ -1 +1 @@
1
- const a141_0x1e6a6c=a141_0x17b4;(function(_0x2f85fc,_0x161a03){const _0x18af69=a141_0x17b4,_0x1cb30b=_0x2f85fc();while(!![]){try{const _0x3a0b5e=-parseInt(_0x18af69(0x16d))/0x1*(parseInt(_0x18af69(0x153))/0x2)+parseInt(_0x18af69(0x158))/0x3*(parseInt(_0x18af69(0x14c))/0x4)+-parseInt(_0x18af69(0x154))/0x5+parseInt(_0x18af69(0x156))/0x6*(parseInt(_0x18af69(0x169))/0x7)+-parseInt(_0x18af69(0x143))/0x8*(-parseInt(_0x18af69(0x172))/0x9)+parseInt(_0x18af69(0x146))/0xa*(-parseInt(_0x18af69(0x16c))/0xb)+parseInt(_0x18af69(0x16b))/0xc*(parseInt(_0x18af69(0x152))/0xd);if(_0x3a0b5e===_0x161a03)break;else _0x1cb30b['push'](_0x1cb30b['shift']());}catch(_0x291c4f){_0x1cb30b['push'](_0x1cb30b['shift']());}}}(a141_0x3bb6,0x9b3bd));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import a141_0x461107 from'fs-extra';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';function a141_0x17b4(_0x365f38,_0x48e53d){_0x365f38=_0x365f38-0x13e;const _0x3bb6f3=a141_0x3bb6();let _0x17b4f5=_0x3bb6f3[_0x365f38];return _0x17b4f5;}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}=a141_0x461107,RESERVED_PROJECT_SKILL_CODES=new Set([a141_0x1e6a6c(0x162),a141_0x1e6a6c(0x178),a141_0x1e6a6c(0x15c)]);export function linkEffectiveRuntimeSkills(_0x2806b6,_0x5006f8){const _0x442a4f=a141_0x1e6a6c,_0x3e5e9e=new Map();for(const _0x926d97 of _0x2806b6){const _0x594ea4=_0x926d97['skill'][_0x442a4f(0x168)];if(!_0x594ea4)continue;const _0xf392b4=_0x3e5e9e[_0x442a4f(0x14b)](_0x594ea4);(!_0xf392b4||_0x926d97[_0x442a4f(0x15b)]==='personal')&&_0x3e5e9e[_0x442a4f(0x15f)](_0x594ea4,_0x926d97);}const _0x40098a=[];for(const _0x2dc31a of _0x3e5e9e['values']()){const _0x3db848=requireSkillCode(_0x2dc31a['skill']),_0x3b79fe=readMetadataIfPresent(_0x2dc31a[_0x442a4f(0x148)]);if(_0x3b79fe?.[_0x442a4f(0x161)]!==_0x5006f8[_0x442a4f(0x161)]||_0x3b79fe[_0x442a4f(0x168)]!==_0x3db848)throw CliErrors[_0x442a4f(0x173)]('Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20'+_0x5006f8[_0x442a4f(0x161)]+':\x20'+_0x2dc31a[_0x442a4f(0x148)]);const _0xe7ef70=runtimeSkillLinkName(_0x5006f8,_0x3db848);for(const _0xd305c7 of _0x5006f8['skillRoots']){_0x40098a[_0x442a4f(0x176)](ensureManagedSymlink(resolve(_0xd305c7,_0xe7ef70),_0x2dc31a['dir'],_0x5006f8,_0x3db848));}}return _0x40098a;}function a141_0x3bb6(){const _0x38da38=['4623505gFaDei','startsWith','168fFfiVY','Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20','18KdUxRb','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','updated','scope','secret-retriever','unchanged','removed','set','has','appCode','lovrabet','agentsSkillsDir','accessKey','pruneSkillCodes','Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20','metadata-mismatch','skillCode','192101MYFOfM','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20','32784EWFDpH','407mhCfQb','1yEbyQV','scopes','isDirectory','filter','skillRoots','27XCnhWr','validation','project','managedRoot','push','skipped','runtime-observe','Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20','linked-from-protected-root','dir','name','trim','Refusing\x20to\x20copy\x20Skill\x20symlink:\x20','2988904PKqSHU','external-symlink','contentHash','30070SzkhGs','env','metadataPath','activeSkillCodes','isSymbolicLink','get','52604bDokGi','slice','company','map','created','builtin','156AlrEgK','658272lWsFzp'];a141_0x3bb6=function(){return _0x38da38;};return a141_0x3bb6();}export function pruneStaleRuntimeSkillLinks(_0xe997d7,_0xc65782,_0x2d1c5d){const _0x29acf0=a141_0x1e6a6c,_0x35055f=new Set([..._0xc65782]['map'](_0x4e9afe=>_0x4e9afe[_0x29acf0(0x141)]())['filter'](Boolean)),_0x21aa03=_0x2d1c5d?new Set([..._0x2d1c5d][_0x29acf0(0x14f)](_0x1cea9f=>_0x1cea9f[_0x29acf0(0x141)]())[_0x29acf0(0x170)](Boolean)):undefined,_0x1ee56b=[];for(const _0xcd99be of _0xe997d7[_0x29acf0(0x171)]){for(const _0x45e463 of managedTargetSkillLinkPaths(_0xcd99be,_0xe997d7)){const _0x5172a1=runtimeSkillCodeFromLink(_0xe997d7,_0x45e463);if(_0x21aa03&&!_0x21aa03[_0x29acf0(0x160)](_0x5172a1))continue;if(_0x35055f[_0x29acf0(0x160)](_0x5172a1))continue;_0x1ee56b[_0x29acf0(0x176)](removeManagedSkillLink(_0x45e463,_0xe997d7,_0x5172a1));}}return _0x1ee56b;}export function pruneStaleRuntimeSkillCache(_0x58bb8b,_0x5abac2={}){const _0x328843=a141_0x1e6a6c,_0x1f023f=new Set([..._0x58bb8b[_0x328843(0x149)]][_0x328843(0x14f)](_0x389c76=>_0x389c76[_0x328843(0x141)]())[_0x328843(0x170)](Boolean)),_0x514471=_0x58bb8b[_0x328843(0x165)]?new Set([..._0x58bb8b[_0x328843(0x165)]][_0x328843(0x14f)](_0x416110=>_0x416110[_0x328843(0x141)]())[_0x328843(0x170)](Boolean)):undefined,_0xf9a24=_0x58bb8b[_0x328843(0x16e)]??['personal',_0x328843(0x14e)],_0xfbf312=resolve(getRuntimeSkillCacheRoot(_0x58bb8b[_0x328843(0x147)],_0x58bb8b[_0x328843(0x164)],_0x5abac2),safePathSegment(_0x58bb8b['appCode'],_0x328843(0x161))),_0x48a5d8=[];for(const _0x2720de of _0xf9a24){const _0x1d87d5=resolve(_0xfbf312,_0x2720de);if(!existsSync(_0x1d87d5))continue;for(const _0x5b1777 of readdirSync(_0x1d87d5,{'withFileTypes':!![]})){if(!_0x5b1777[_0x328843(0x16f)]())continue;const _0x5ef883=_0x5b1777[_0x328843(0x140)];if(_0x514471&&!_0x514471[_0x328843(0x160)](_0x5ef883))continue;if(_0x1f023f[_0x328843(0x160)](_0x5ef883))continue;const _0x2e961d=resolve(_0x1d87d5,_0x5ef883),_0x4b0bb2=readMetadataIfPresent(resolve(_0x2e961d,METADATA_FILE));if(_0x4b0bb2?.[_0x328843(0x161)]!==_0x58bb8b['appCode']||_0x4b0bb2[_0x328843(0x15b)]!==_0x2720de||_0x4b0bb2[_0x328843(0x168)]!==_0x5ef883){_0x48a5d8[_0x328843(0x176)]({'path':_0x2e961d,'action':_0x328843(0x177),'reason':_0x328843(0x167)});continue;}if(isLinkedFromAnyRoot(_0x2e961d,_0x58bb8b['protectedLinkRoots']??[])){_0x48a5d8[_0x328843(0x176)]({'path':_0x2e961d,'action':_0x328843(0x177),'reason':_0x328843(0x13e)});continue;}removeSync(_0x2e961d),_0x48a5d8[_0x328843(0x176)]({'path':_0x2e961d,'action':_0x328843(0x15e)});}}return _0x48a5d8;}export function linkGlobalRuntimeSkills(_0x53aca2,_0x311297={}){const _0x5bde39=a141_0x1e6a6c,_0x5b2cd5=resolveSkillSyncPaths(_0x311297),_0x4613a0=[];for(const _0x2925e2 of _0x53aca2){if(_0x2925e2['scope']!==_0x5bde39(0x151))throw CliErrors[_0x5bde39(0x173)](_0x5bde39(0x159)+_0x2925e2[_0x5bde39(0x15b)]);const _0x49b655=requireSkillCode(_0x2925e2['skill']),_0x4dbb21=copyManagedSkillDirectory(_0x2925e2[_0x5bde39(0x13f)],resolve(_0x5b2cd5[_0x5bde39(0x163)],_0x49b655));_0x4613a0['push']({..._0x4dbb21,'contentHash':_0x2925e2[_0x5bde39(0x145)]});}return _0x4613a0;}function ensureManagedSymlink(_0x24dc8d,_0x48db3d,_0x410075,_0x31647d){const _0x28e429=a141_0x1e6a6c;mkdirSync(dirname(_0x24dc8d),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x24dc8d)||isDanglingSymlink(_0x24dc8d)){const _0x89f025=lstatSync(_0x24dc8d);if(!_0x89f025[_0x28e429(0x14a)]())throw CliErrors[_0x28e429(0x173)](_0x28e429(0x157)+_0x24dc8d);const _0x45ca35=resolveSymlinkTarget(_0x24dc8d);if(!isPathInside(realOrResolved(_0x45ca35),realOrResolved(_0x410075[_0x28e429(0x175)])))throw CliErrors[_0x28e429(0x173)]('Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20'+_0x24dc8d);if(realOrResolved(_0x45ca35)===realOrResolved(_0x48db3d))return{'path':_0x24dc8d,'target':_0x48db3d,'action':'unchanged'};const _0x274d44=readMetadataIfPresent(resolve(_0x45ca35,METADATA_FILE));if(_0x410075[_0x28e429(0x15b)]==='project'&&(_0x274d44?.['appCode']!==_0x410075[_0x28e429(0x161)]||_0x274d44[_0x28e429(0x168)]!==_0x31647d))throw CliErrors[_0x28e429(0x173)](_0x28e429(0x166)+_0x24dc8d);return unlinkSync(_0x24dc8d),symlinkSync(_0x48db3d,_0x24dc8d,_0x28e429(0x13f)),{'path':_0x24dc8d,'target':_0x48db3d,'action':_0x28e429(0x15a)};}return symlinkSync(_0x48db3d,_0x24dc8d,_0x28e429(0x13f)),{'path':_0x24dc8d,'target':_0x48db3d,'action':'created'};}function managedTargetSkillLinkPaths(_0x31cb02,_0x4e7e18){const _0x41c4c7=a141_0x1e6a6c;if(!existsSync(_0x31cb02))return[];const _0x3111d6=_0x4e7e18[_0x41c4c7(0x161)]+'--';return readdirSync(_0x31cb02,{'withFileTypes':!![]})['filter'](_0x1ddfe3=>_0x4e7e18[_0x41c4c7(0x15b)]===_0x41c4c7(0x174)||_0x1ddfe3['name'][_0x41c4c7(0x155)](_0x3111d6))[_0x41c4c7(0x14f)](_0x3463d2=>resolve(_0x31cb02,_0x3463d2[_0x41c4c7(0x140)]));}function removeManagedSkillLink(_0x36b616,_0x1a61b4,_0x510378){const _0x2530b9=a141_0x1e6a6c,_0x3d58f8=lstatIfPresent(_0x36b616);if(!_0x3d58f8?.['isSymbolicLink']())return{'path':_0x36b616,'action':_0x2530b9(0x177),'reason':'not-managed-symlink'};const _0x1eed56=resolveSymlinkTarget(_0x36b616);if(!isPathInside(realOrResolved(_0x1eed56),realOrResolved(_0x1a61b4[_0x2530b9(0x175)])))return{'path':_0x36b616,'action':_0x2530b9(0x177),'reason':_0x2530b9(0x144)};const _0x31c27c=readMetadataIfPresent(resolve(_0x1eed56,METADATA_FILE));if(_0x1a61b4[_0x2530b9(0x15b)]===_0x2530b9(0x174)&&(_0x31c27c?.[_0x2530b9(0x161)]!==_0x1a61b4['appCode']||_0x31c27c[_0x2530b9(0x168)]!==_0x510378))return{'path':_0x36b616,'action':_0x2530b9(0x177),'reason':_0x2530b9(0x167)};return unlinkSync(_0x36b616),{'path':_0x36b616,'action':'removed'};}function isLinkedFromAnyRoot(_0x272f73,_0xc4f7a3){const _0x173586=a141_0x1e6a6c,_0x5e1945=realOrResolved(_0x272f73);for(const _0x50a548 of _0xc4f7a3){if(!existsSync(_0x50a548))continue;for(const _0x2cdc0d of readdirSync(_0x50a548,{'withFileTypes':!![]})){if(!_0x2cdc0d[_0x173586(0x14a)]())continue;const _0xa4eb84=resolve(_0x50a548,_0x2cdc0d[_0x173586(0x140)]);if(realOrResolved(resolveSymlinkTarget(_0xa4eb84))===_0x5e1945)return!![];}}return![];}function runtimeSkillLinkName(_0x35671e,_0x7071bd){const _0x39f9ab=a141_0x1e6a6c,_0x5a5c07=safePathSegment(_0x7071bd,'skillCode');if(_0x35671e[_0x39f9ab(0x15b)]===_0x39f9ab(0x174)&&RESERVED_PROJECT_SKILL_CODES[_0x39f9ab(0x160)](_0x5a5c07))throw CliErrors['validation'](_0x39f9ab(0x179)+_0x5a5c07);return _0x35671e['scope']==='project'?_0x5a5c07:_0x35671e[_0x39f9ab(0x161)]+'--'+_0x5a5c07;}function runtimeSkillCodeFromLink(_0x587362,_0x1ecd70){const _0x2bb05e=a141_0x1e6a6c,_0x40edd5=basename(_0x1ecd70);return _0x587362[_0x2bb05e(0x15b)]===_0x2bb05e(0x174)?_0x40edd5:_0x40edd5[_0x2bb05e(0x14d)]((_0x587362[_0x2bb05e(0x161)]+'--')['length']);}export function copyManagedSkillDirectory(_0x44dfc6,_0x362eb5){const _0x2bc197=a141_0x1e6a6c,_0x8175b3=resolve(_0x362eb5,METADATA_FILE),_0x524391=existsSync(_0x362eb5);if(_0x524391){const _0x3158fc=lstatSync(_0x362eb5);if(_0x3158fc['isSymbolicLink']())throw CliErrors['validation']('Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20'+_0x362eb5);if(!_0x3158fc[_0x2bc197(0x16f)]())throw CliErrors['validation']('Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20'+_0x362eb5);const _0xc5dbd4=readMetadataIfPresent(_0x8175b3);if(_0xc5dbd4?.['scope']!==_0x2bc197(0x151))throw CliErrors[_0x2bc197(0x173)](_0x2bc197(0x16a)+_0x362eb5);}ensureDirSync(dirname(_0x362eb5));const _0x161c07=_0x524391?readMetadataIfPresent(_0x8175b3)?.[_0x2bc197(0x145)]:undefined,_0x59708b=readMetadataIfPresent(resolve(_0x44dfc6,METADATA_FILE))?.[_0x2bc197(0x145)];return _0x524391&&removeSync(_0x362eb5),copySkillDirectory(_0x44dfc6,_0x362eb5),{'path':_0x362eb5,'target':_0x44dfc6,'action':!_0x524391?_0x2bc197(0x150):_0x161c07===_0x59708b?_0x2bc197(0x15d):_0x2bc197(0x15a)};}function copySkillDirectory(_0x5a8166,_0x4aac0b){copySync(_0x5a8166,_0x4aac0b,{'dereference':![],'overwrite':!![],'filter'(_0x515a0d){const _0x310e36=a141_0x17b4;if(lstatSync(_0x515a0d)[_0x310e36(0x14a)]())throw CliErrors[_0x310e36(0x173)](_0x310e36(0x142)+_0x515a0d);return!![];}});}
1
+ const a141_0x33b670=a141_0x14f2;(function(_0x2eabba,_0x4f8488){const _0x5762de=a141_0x14f2,_0x178157=_0x2eabba();while(!![]){try{const _0x46506e=-parseInt(_0x5762de(0x9f))/0x1*(parseInt(_0x5762de(0xb7))/0x2)+-parseInt(_0x5762de(0xa1))/0x3+-parseInt(_0x5762de(0xc7))/0x4+-parseInt(_0x5762de(0x9b))/0x5+parseInt(_0x5762de(0xab))/0x6+-parseInt(_0x5762de(0xa5))/0x7*(-parseInt(_0x5762de(0xb1))/0x8)+parseInt(_0x5762de(0xb2))/0x9;if(_0x46506e===_0x4f8488)break;else _0x178157['push'](_0x178157['shift']());}catch(_0x59f6e1){_0x178157['push'](_0x178157['shift']());}}}(a141_0x3df8,0x9971d));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import a141_0x50d24e 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}=a141_0x50d24e,RESERVED_PROJECT_SKILL_CODES=new Set([a141_0x33b670(0xa6),a141_0x33b670(0xc4),a141_0x33b670(0xbc)]);export function linkEffectiveRuntimeSkills(_0x57cb8c,_0x31057a){const _0x1c77fd=a141_0x33b670,_0x256639=new Map();for(const _0x3874b3 of _0x57cb8c){const _0x316008=_0x3874b3['skill'][_0x1c77fd(0xcf)];if(!_0x316008)continue;const _0x3164a1=_0x256639[_0x1c77fd(0xa4)](_0x316008);(!_0x3164a1||_0x3874b3['scope']===_0x1c77fd(0xc8))&&_0x256639[_0x1c77fd(0xa8)](_0x316008,_0x3874b3);}const _0x21bfba=[];for(const _0x4d107d of _0x256639['values']()){const _0x1a150b=requireSkillCode(_0x4d107d[_0x1c77fd(0xc1)]),_0x3b5ada=readMetadataIfPresent(_0x4d107d[_0x1c77fd(0xad)]);if(_0x3b5ada?.[_0x1c77fd(0xae)]!==_0x31057a[_0x1c77fd(0xae)]||_0x3b5ada[_0x1c77fd(0xcf)]!==_0x1a150b)throw CliErrors[_0x1c77fd(0xc6)]('Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20'+_0x31057a['appCode']+':\x20'+_0x4d107d[_0x1c77fd(0xad)]);const _0x38986c=runtimeSkillLinkName(_0x31057a,_0x1a150b);for(const _0x33b850 of _0x31057a[_0x1c77fd(0xd0)]){_0x21bfba[_0x1c77fd(0xb9)](ensureManagedSymlink(resolve(_0x33b850,_0x38986c),_0x4d107d[_0x1c77fd(0xb6)],_0x31057a,_0x1a150b));}}return _0x21bfba;}export function pruneStaleRuntimeSkillLinks(_0x43407b,_0x1343ee,_0x391f7d){const _0x58a280=a141_0x33b670,_0x1a590a=new Set([..._0x1343ee][_0x58a280(0x9a)](_0x44515a=>_0x44515a[_0x58a280(0xb3)]())[_0x58a280(0xbf)](Boolean)),_0x4e3c3f=_0x391f7d?new Set([..._0x391f7d][_0x58a280(0x9a)](_0x403045=>_0x403045[_0x58a280(0xb3)]())[_0x58a280(0xbf)](Boolean)):undefined,_0x22b1bd=[];for(const _0x1faaa4 of _0x43407b['skillRoots']){for(const _0x3ea6ad of managedTargetSkillLinkPaths(_0x1faaa4,_0x43407b)){const _0x223bbe=runtimeSkillCodeFromLink(_0x43407b,_0x3ea6ad);if(_0x4e3c3f&&!_0x4e3c3f[_0x58a280(0xa2)](_0x223bbe))continue;if(_0x1a590a[_0x58a280(0xa2)](_0x223bbe))continue;_0x22b1bd[_0x58a280(0xb9)](removeManagedSkillLink(_0x3ea6ad,_0x43407b,_0x223bbe));}}return _0x22b1bd;}export function pruneStaleRuntimeSkillCache(_0x27b952,_0x5c5002={}){const _0x1ba0bb=a141_0x33b670,_0x5ccf69=new Set([..._0x27b952[_0x1ba0bb(0xc5)]][_0x1ba0bb(0x9a)](_0x1acdcc=>_0x1acdcc['trim']())[_0x1ba0bb(0xbf)](Boolean)),_0x24fd3e=_0x27b952['pruneSkillCodes']?new Set([..._0x27b952['pruneSkillCodes']][_0x1ba0bb(0x9a)](_0xb0ad0e=>_0xb0ad0e[_0x1ba0bb(0xb3)]())['filter'](Boolean)):undefined,_0x50e321=_0x27b952['scopes']??[_0x1ba0bb(0xc8),'company'],_0x146b58=resolve(getRuntimeSkillCacheRoot(_0x27b952[_0x1ba0bb(0xa3)],_0x27b952[_0x1ba0bb(0xcb)],_0x5c5002),safePathSegment(_0x27b952[_0x1ba0bb(0xae)],_0x1ba0bb(0xae))),_0x3085de=[];for(const _0x55a8b4 of _0x50e321){const _0x4408b1=resolve(_0x146b58,_0x55a8b4);if(!existsSync(_0x4408b1))continue;for(const _0x1d6311 of readdirSync(_0x4408b1,{'withFileTypes':!![]})){if(!_0x1d6311[_0x1ba0bb(0x9c)]())continue;const _0x499ba5=_0x1d6311[_0x1ba0bb(0xa0)];if(_0x24fd3e&&!_0x24fd3e[_0x1ba0bb(0xa2)](_0x499ba5))continue;if(_0x5ccf69[_0x1ba0bb(0xa2)](_0x499ba5))continue;const _0x54bf66=resolve(_0x4408b1,_0x499ba5),_0x23da76=readMetadataIfPresent(resolve(_0x54bf66,METADATA_FILE));if(_0x23da76?.[_0x1ba0bb(0xae)]!==_0x27b952[_0x1ba0bb(0xae)]||_0x23da76[_0x1ba0bb(0xc9)]!==_0x55a8b4||_0x23da76[_0x1ba0bb(0xcf)]!==_0x499ba5){_0x3085de['push']({'path':_0x54bf66,'action':_0x1ba0bb(0xba),'reason':_0x1ba0bb(0xcc)});continue;}if(isLinkedFromAnyRoot(_0x54bf66,_0x27b952[_0x1ba0bb(0xa9)]??[])){_0x3085de[_0x1ba0bb(0xb9)]({'path':_0x54bf66,'action':'skipped','reason':'linked-from-protected-root'});continue;}removeSync(_0x54bf66),_0x3085de[_0x1ba0bb(0xb9)]({'path':_0x54bf66,'action':'removed'});}}return _0x3085de;}function a141_0x3df8(){const _0x5cb55e=['secret-retriever','Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20','removed','filter','builtin','skill','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','not-managed-symlink','runtime-observe','activeSkillCodes','validation','3691516vTDhWf','personal','scope','created','accessKey','metadata-mismatch','length','Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20','skillCode','skillRoots','Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20','startsWith','map','1392460pJeHCu','isDirectory','Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20','1vkqyed','name','3456615ebRmiL','has','env','get','29239sLXSTd','lovrabet','agentsSkillsDir','set','protectedLinkRoots','unchanged','6918204AdBTDt','managedRoot','metadataPath','appCode','project','Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20','2056LnpNiJ','16160940dlEHys','trim','isSymbolicLink','updated','dir','2080196HDyAdk','contentHash','push','skipped','Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20'];a141_0x3df8=function(){return _0x5cb55e;};return a141_0x3df8();}export function linkGlobalRuntimeSkills(_0xdfdaa3,_0x50cd97={}){const _0x5ef831=a141_0x33b670,_0x26258f=resolveSkillSyncPaths(_0x50cd97),_0x466567=[];for(const _0x43707e of _0xdfdaa3){if(_0x43707e[_0x5ef831(0xc9)]!==_0x5ef831(0xc0))throw CliErrors['validation'](_0x5ef831(0xc2)+_0x43707e[_0x5ef831(0xc9)]);const _0x241305=requireSkillCode(_0x43707e['skill']),_0x658c04=copyManagedSkillDirectory(_0x43707e[_0x5ef831(0xb6)],resolve(_0x26258f[_0x5ef831(0xa7)],_0x241305));_0x466567['push']({..._0x658c04,'contentHash':_0x43707e[_0x5ef831(0xb8)]});}return _0x466567;}function ensureManagedSymlink(_0x17dcee,_0x3ded41,_0x4d2a32,_0x490eed){const _0x201e46=a141_0x33b670;mkdirSync(dirname(_0x17dcee),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x17dcee)||isDanglingSymlink(_0x17dcee)){const _0x486b1a=lstatSync(_0x17dcee);if(!_0x486b1a[_0x201e46(0xb4)]())throw CliErrors[_0x201e46(0xc6)](_0x201e46(0x9d)+_0x17dcee);const _0x28737f=resolveSymlinkTarget(_0x17dcee);if(!isPathInside(realOrResolved(_0x28737f),realOrResolved(_0x4d2a32[_0x201e46(0xac)])))throw CliErrors['validation'](_0x201e46(0x98)+_0x17dcee);if(realOrResolved(_0x28737f)===realOrResolved(_0x3ded41))return{'path':_0x17dcee,'target':_0x3ded41,'action':_0x201e46(0xaa)};const _0x390f02=readMetadataIfPresent(resolve(_0x28737f,METADATA_FILE));if(_0x4d2a32[_0x201e46(0xc9)]===_0x201e46(0xaf)&&(_0x390f02?.[_0x201e46(0xae)]!==_0x4d2a32[_0x201e46(0xae)]||_0x390f02['skillCode']!==_0x490eed))throw CliErrors['validation'](_0x201e46(0xbb)+_0x17dcee);return unlinkSync(_0x17dcee),symlinkSync(_0x3ded41,_0x17dcee,_0x201e46(0xb6)),{'path':_0x17dcee,'target':_0x3ded41,'action':_0x201e46(0xb5)};}return symlinkSync(_0x3ded41,_0x17dcee,_0x201e46(0xb6)),{'path':_0x17dcee,'target':_0x3ded41,'action':'created'};}function managedTargetSkillLinkPaths(_0x42dc0f,_0x42830e){const _0x3ceb5b=a141_0x33b670;if(!existsSync(_0x42dc0f))return[];const _0x3d8300=_0x42830e[_0x3ceb5b(0xae)]+'--';return readdirSync(_0x42dc0f,{'withFileTypes':!![]})[_0x3ceb5b(0xbf)](_0x6d232f=>_0x42830e[_0x3ceb5b(0xc9)]===_0x3ceb5b(0xaf)||_0x6d232f[_0x3ceb5b(0xa0)][_0x3ceb5b(0x99)](_0x3d8300))[_0x3ceb5b(0x9a)](_0x4982c1=>resolve(_0x42dc0f,_0x4982c1['name']));}function a141_0x14f2(_0x2dee04,_0x55560c){_0x2dee04=_0x2dee04-0x98;const _0x3df8f=a141_0x3df8();let _0x14f2a0=_0x3df8f[_0x2dee04];return _0x14f2a0;}function removeManagedSkillLink(_0x5d648c,_0x88c4b9,_0x23e00b){const _0x3a30f4=a141_0x33b670,_0x493991=lstatIfPresent(_0x5d648c);if(!_0x493991?.[_0x3a30f4(0xb4)]())return{'path':_0x5d648c,'action':_0x3a30f4(0xba),'reason':_0x3a30f4(0xc3)};const _0x21ea66=resolveSymlinkTarget(_0x5d648c);if(!isPathInside(realOrResolved(_0x21ea66),realOrResolved(_0x88c4b9['managedRoot'])))return{'path':_0x5d648c,'action':_0x3a30f4(0xba),'reason':'external-symlink'};const _0x1565e2=readMetadataIfPresent(resolve(_0x21ea66,METADATA_FILE));if(_0x88c4b9[_0x3a30f4(0xc9)]===_0x3a30f4(0xaf)&&(_0x1565e2?.[_0x3a30f4(0xae)]!==_0x88c4b9[_0x3a30f4(0xae)]||_0x1565e2[_0x3a30f4(0xcf)]!==_0x23e00b))return{'path':_0x5d648c,'action':_0x3a30f4(0xba),'reason':_0x3a30f4(0xcc)};return unlinkSync(_0x5d648c),{'path':_0x5d648c,'action':_0x3a30f4(0xbe)};}function isLinkedFromAnyRoot(_0x26b89b,_0x42a75e){const _0x53ad11=a141_0x33b670,_0x393e63=realOrResolved(_0x26b89b);for(const _0x509abe of _0x42a75e){if(!existsSync(_0x509abe))continue;for(const _0x2c6edc of readdirSync(_0x509abe,{'withFileTypes':!![]})){if(!_0x2c6edc['isSymbolicLink']())continue;const _0x3a1a46=resolve(_0x509abe,_0x2c6edc[_0x53ad11(0xa0)]);if(realOrResolved(resolveSymlinkTarget(_0x3a1a46))===_0x393e63)return!![];}}return![];}function runtimeSkillLinkName(_0x85fd78,_0x2b9c92){const _0x378b8b=a141_0x33b670,_0xa8cb4=safePathSegment(_0x2b9c92,_0x378b8b(0xcf));if(_0x85fd78['scope']===_0x378b8b(0xaf)&&RESERVED_PROJECT_SKILL_CODES[_0x378b8b(0xa2)](_0xa8cb4))throw CliErrors[_0x378b8b(0xc6)](_0x378b8b(0xce)+_0xa8cb4);return _0x85fd78['scope']==='project'?_0xa8cb4:_0x85fd78[_0x378b8b(0xae)]+'--'+_0xa8cb4;}function runtimeSkillCodeFromLink(_0x3d0b96,_0x4966a2){const _0xc7388d=a141_0x33b670,_0x4edbd0=basename(_0x4966a2);return _0x3d0b96[_0xc7388d(0xc9)]===_0xc7388d(0xaf)?_0x4edbd0:_0x4edbd0['slice']((_0x3d0b96[_0xc7388d(0xae)]+'--')[_0xc7388d(0xcd)]);}export function copyManagedSkillDirectory(_0x355df4,_0x330124){const _0x5bfe87=a141_0x33b670,_0x2c6cf4=resolve(_0x330124,METADATA_FILE),_0x2473cb=existsSync(_0x330124);if(_0x2473cb){const _0x3b56e7=lstatSync(_0x330124);if(_0x3b56e7[_0x5bfe87(0xb4)]())throw CliErrors['validation'](_0x5bfe87(0xbd)+_0x330124);if(!_0x3b56e7[_0x5bfe87(0x9c)]())throw CliErrors['validation'](_0x5bfe87(0xb0)+_0x330124);const _0x221000=readMetadataIfPresent(_0x2c6cf4);if(_0x221000?.[_0x5bfe87(0xc9)]!==_0x5bfe87(0xc0))throw CliErrors[_0x5bfe87(0xc6)](_0x5bfe87(0x9e)+_0x330124);}ensureDirSync(dirname(_0x330124));const _0x1a3553=_0x2473cb?readMetadataIfPresent(_0x2c6cf4)?.[_0x5bfe87(0xb8)]:undefined,_0x34e260=readMetadataIfPresent(resolve(_0x355df4,METADATA_FILE))?.[_0x5bfe87(0xb8)];return _0x2473cb&&removeSync(_0x330124),copySkillDirectory(_0x355df4,_0x330124),{'path':_0x330124,'target':_0x355df4,'action':!_0x2473cb?_0x5bfe87(0xca):_0x1a3553===_0x34e260?_0x5bfe87(0xaa):_0x5bfe87(0xb5)};}function copySkillDirectory(_0x423b06,_0x4a6d21){copySync(_0x423b06,_0x4a6d21,{'dereference':![],'overwrite':!![],'filter'(_0x2e32b){const _0x4d298b=a141_0x14f2;if(lstatSync(_0x2e32b)[_0x4d298b(0xb4)]())throw CliErrors[_0x4d298b(0xc6)]('Refusing\x20to\x20copy\x20Skill\x20symlink:\x20'+_0x2e32b);return!![];}});}
@@ -1 +1 @@
1
- (function(_0x1ecd44,_0x43e0b0){const _0x2bdf99=a142_0x4e30,_0x263b67=_0x1ecd44();while(!![]){try{const _0x32de62=-parseInt(_0x2bdf99(0xda))/0x1*(parseInt(_0x2bdf99(0xc1))/0x2)+-parseInt(_0x2bdf99(0xc4))/0x3*(-parseInt(_0x2bdf99(0xd9))/0x4)+-parseInt(_0x2bdf99(0xc9))/0x5+-parseInt(_0x2bdf99(0xc3))/0x6*(-parseInt(_0x2bdf99(0xcf))/0x7)+parseInt(_0x2bdf99(0xd1))/0x8*(-parseInt(_0x2bdf99(0xd8))/0x9)+parseInt(_0x2bdf99(0xd0))/0xa+parseInt(_0x2bdf99(0xb0))/0xb;if(_0x32de62===_0x43e0b0)break;else _0x263b67['push'](_0x263b67['shift']());}catch(_0x1a1885){_0x263b67['push'](_0x263b67['shift']());}}}(a142_0x3ef4,0x36d72));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(_0x216043,_0x4a9acf,_0x29587b={}){const _0x9ef3e5=a142_0x4e30,_0x5a2fe7=safePathSegment(_0x216043[_0x9ef3e5(0xc6)],_0x9ef3e5(0xc6));if(_0x4a9acf['appCode']!==_0x5a2fe7)throw CliErrors[_0x9ef3e5(0xb8)](_0x9ef3e5(0xb2)+_0x4a9acf['appCode']+_0x9ef3e5(0xd5)+_0x5a2fe7);const _0x344314=normalizeRuntimeSkillScopes(_0x216043[_0x9ef3e5(0xb7)]),_0x21cdae=new Set(_0x344314),_0x2d688d=_0x216043['code']?.['trim'](),_0x1ab501=new Map(),_0xc18726=resolve(getRuntimeSkillCacheRoot(_0x216043['env'],_0x216043[_0x9ef3e5(0xc8)],_0x29587b),_0x5a2fe7);for(const _0x1abfe3 of _0x344314){for(const _0xd83143 of localSkillEntryDirs(resolve(_0xc18726,_0x1abfe3))){collectLocalRuntimeSkill(_0x1ab501,_0xd83143,{'appCode':_0x5a2fe7,'scopes':_0x21cdae,'code':_0x2d688d,'source':_0x9ef3e5(0xc5)});}}for(const _0x55d7d9 of _0x4a9acf[_0x9ef3e5(0xb9)]){for(const _0x57b44d of localSkillLinkCandidates(_0x55d7d9,_0x4a9acf,_0x21cdae)){collectLocalRuntimeSkill(_0x1ab501,_0x57b44d,{'appCode':_0x5a2fe7,'scopes':_0x21cdae,'code':_0x2d688d,'source':'link','linkedPath':_0x57b44d});}}return Array[_0x9ef3e5(0xb3)](_0x1ab501[_0x9ef3e5(0xd7)]())[_0x9ef3e5(0xd3)](compareLocalRuntimeSkills);}function localSkillEntryDirs(_0x27f1b6){const _0x19195e=a142_0x4e30;if(!existsSync(_0x27f1b6))return[];return readdirSync(_0x27f1b6,{'withFileTypes':!![]})['filter'](_0x361118=>_0x361118[_0x19195e(0xd6)]()||_0x361118[_0x19195e(0xaf)]())[_0x19195e(0xba)](_0x4881ee=>resolve(_0x27f1b6,_0x4881ee[_0x19195e(0xc7)]));}function localSkillLinkCandidates(_0x2ec58e,_0x5a91c0,_0x2ee7e6){const _0x2b28fa=a142_0x4e30;if(!existsSync(_0x2ec58e))return[];const _0x4e8f1b=_0x5a91c0[_0x2b28fa(0xc6)]+'--';return readdirSync(_0x2ec58e,{'withFileTypes':!![]})['filter'](_0x5c1a68=>_0x5c1a68[_0x2b28fa(0xd6)]()||_0x5c1a68[_0x2b28fa(0xaf)]())['filter'](_0x4a9a9f=>_0x5a91c0['scope']===_0x2b28fa(0xb1)||_0x4a9a9f[_0x2b28fa(0xc7)]['startsWith'](_0x4e8f1b)||_0x2ee7e6[_0x2b28fa(0xca)]('builtin'))[_0x2b28fa(0xba)](_0x38101=>resolve(_0x2ec58e,_0x38101['name']));}function a142_0x4e30(_0x1a9c76,_0x4b9e4b){_0x1a9c76=_0x1a9c76-0xae;const _0x3ef45a=a142_0x3ef4();let _0x4e30c5=_0x3ef45a[_0x1a9c76];return _0x4e30c5;}function a142_0x3ef4(){const _0x4a4e53=['metadataPath','linkedPaths','skillCode','76xMfGuD','localeCompare','66OOCufd','1119765gUgFZo','cache','appCode','name','accessKey','2028510ohiUFo','has','dir','linkedPath','source','trim','77133BZvErD','3679310CZXqNT','151088xepZIS','cacheDir','sort','set','\x20!=\x20','isDirectory','values','9stLnaX','4OKSkhh','8058PfnquY','includes','isSymbolicLink','1023253lrCLQW','project','Runtime\x20Skill\x20install\x20target\x20app\x20mismatch:\x20','from','skillMdPath','scope','isArray','scopes','validation','skillRoots','map','code','push','local'];a142_0x3ef4=function(){return _0x4a4e53;};return a142_0x3ef4();}function collectLocalRuntimeSkill(_0x3a6640,_0x3f12f1,_0x33b554){const _0x1d00e2=a142_0x4e30,_0xf0e3ac=resolve(_0x3f12f1,METADATA_FILE),_0x326e1a=readMetadataIfPresent(_0xf0e3ac);if(!_0x326e1a)return;if(_0x326e1a[_0x1d00e2(0xc6)]!==_0x33b554[_0x1d00e2(0xc6)])return;if(!isRuntimeSkillScope(_0x326e1a[_0x1d00e2(0xb5)])||!_0x33b554['scopes'][_0x1d00e2(0xca)](_0x326e1a[_0x1d00e2(0xb5)]))return;const _0x4a5b4a=_0x326e1a[_0x1d00e2(0xc0)]?.[_0x1d00e2(0xce)]();if(!_0x4a5b4a)return;if(_0x33b554[_0x1d00e2(0xbb)]&&_0x4a5b4a!==_0x33b554[_0x1d00e2(0xbb)])return;const _0x4dc67e=_0x326e1a[_0x1d00e2(0xb5)]+':'+_0x4a5b4a,_0x19e9c5=_0x33b554['linkedPath']?[_0x33b554[_0x1d00e2(0xcc)]]:[],_0x549b0b=_0x3a6640['get'](_0x4dc67e);if(_0x549b0b){_0x33b554[_0x1d00e2(0xcd)]===_0x1d00e2(0xc5)&&(_0x549b0b[_0x1d00e2(0xcb)]=_0x3f12f1,_0x549b0b[_0x1d00e2(0xd2)]=_0x3f12f1,_0x549b0b[_0x1d00e2(0xb4)]=resolve(_0x3f12f1,SKILL_FILE),_0x549b0b[_0x1d00e2(0xbe)]=_0xf0e3ac);for(const _0x265212 of _0x19e9c5){!_0x549b0b[_0x1d00e2(0xbf)][_0x1d00e2(0xae)](_0x265212)&&_0x549b0b[_0x1d00e2(0xbf)][_0x1d00e2(0xbc)](_0x265212);}_0x549b0b[_0x1d00e2(0xbf)]['sort']();return;}_0x3a6640[_0x1d00e2(0xd4)](_0x4dc67e,{..._0x326e1a,'tags':Array[_0x1d00e2(0xb6)](_0x326e1a['tags'])?_0x326e1a['tags']:[],'scope':_0x326e1a['scope'],'source':_0x1d00e2(0xbd),'dir':_0x3f12f1,'cacheDir':_0x33b554['source']===_0x1d00e2(0xc5)?_0x3f12f1:undefined,'skillMdPath':resolve(_0x3f12f1,SKILL_FILE),'metadataPath':_0xf0e3ac,'linkedPaths':_0x19e9c5});}function compareLocalRuntimeSkills(_0x185aa9,_0x17ed88){const _0x5297ac=a142_0x4e30,_0x103336={'personal':0x0,'company':0x1,'builtin':0x2};return _0x103336[_0x185aa9[_0x5297ac(0xb5)]]-_0x103336[_0x17ed88[_0x5297ac(0xb5)]]||_0x185aa9['skillCode'][_0x5297ac(0xc2)](_0x17ed88[_0x5297ac(0xc0)])||_0x185aa9[_0x5297ac(0xcb)][_0x5297ac(0xc2)](_0x17ed88[_0x5297ac(0xcb)]);}
1
+ function a142_0x5f1c(){const _0x2b7d55=['2498468ewXbIb','map','2567995tFvVrv','skillRoots','name','trim','accessKey','env','has','1144233LUOrYm','isSymbolicLink','link','cacheDir','values','includes','2485370gVOivg','builtin','tags','\x20!=\x20','89120wrMfZj','cache','linkedPaths','sort','48WiBqje','scope','filter','source','appCode','12wtLokW','skillMdPath','startsWith','localeCompare','code','project','get','set','isArray','56204ujouZP','dir','Runtime\x20Skill\x20install\x20target\x20app\x20mismatch:\x20','isDirectory','local','16781967uzLNaU','metadataPath','skillCode','linkedPath'];a142_0x5f1c=function(){return _0x2b7d55;};return a142_0x5f1c();}(function(_0x5bab61,_0x2497ca){const _0x233d8c=a142_0x23b6,_0x1f5923=_0x5bab61();while(!![]){try{const _0x45282a=parseInt(_0x233d8c(0x175))/0x1+parseInt(_0x233d8c(0x17b))/0x2+parseInt(_0x233d8c(0x183))/0x3*(parseInt(_0x233d8c(0x163))/0x4)+-parseInt(_0x233d8c(0x16e))/0x5+-parseInt(_0x233d8c(0x188))/0x6*(-parseInt(_0x233d8c(0x16c))/0x7)+-parseInt(_0x233d8c(0x17f))/0x8+-parseInt(_0x233d8c(0x168))/0x9;if(_0x45282a===_0x2497ca)break;else _0x1f5923['push'](_0x1f5923['shift']());}catch(_0x572c18){_0x1f5923['push'](_0x1f5923['shift']());}}}(a142_0x5f1c,0xe48f4));import{existsSync,readdirSync}from'node:fs';import{resolve}from'node:path';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{readMetadataIfPresent}from'./metadata.js';import{getRuntimeSkillCacheRoot,safePathSegment}from'./paths.js';function a142_0x23b6(_0x405ba5,_0x4f5901){_0x405ba5=_0x405ba5-0x163;const _0x5f1c98=a142_0x5f1c();let _0x23b66e=_0x5f1c98[_0x405ba5];return _0x23b66e;}import{isRuntimeSkillScope,normalizeRuntimeSkillScopes}from'./scopes.js';export function listLocalRuntimeSkills(_0x20a312,_0x3f21eb,_0x4a5d94={}){const _0x132983=a142_0x23b6,_0x52ad3b=safePathSegment(_0x20a312[_0x132983(0x187)],'appCode');if(_0x3f21eb[_0x132983(0x187)]!==_0x52ad3b)throw CliErrors['validation'](_0x132983(0x165)+_0x3f21eb[_0x132983(0x187)]+_0x132983(0x17e)+_0x52ad3b);const _0x487f24=normalizeRuntimeSkillScopes(_0x20a312['scopes']),_0x4ad575=new Set(_0x487f24),_0x5820fb=_0x20a312[_0x132983(0x18c)]?.[_0x132983(0x171)](),_0x464223=new Map(),_0x204c65=resolve(getRuntimeSkillCacheRoot(_0x20a312[_0x132983(0x173)],_0x20a312[_0x132983(0x172)],_0x4a5d94),_0x52ad3b);for(const _0x3612e3 of _0x487f24){for(const _0x334be0 of localSkillEntryDirs(resolve(_0x204c65,_0x3612e3))){collectLocalRuntimeSkill(_0x464223,_0x334be0,{'appCode':_0x52ad3b,'scopes':_0x4ad575,'code':_0x5820fb,'source':_0x132983(0x180)});}}for(const _0x378445 of _0x3f21eb[_0x132983(0x16f)]){for(const _0x50f097 of localSkillLinkCandidates(_0x378445,_0x3f21eb,_0x4ad575)){collectLocalRuntimeSkill(_0x464223,_0x50f097,{'appCode':_0x52ad3b,'scopes':_0x4ad575,'code':_0x5820fb,'source':_0x132983(0x177),'linkedPath':_0x50f097});}}return Array['from'](_0x464223[_0x132983(0x179)]())[_0x132983(0x182)](compareLocalRuntimeSkills);}function localSkillEntryDirs(_0x6d2cfa){const _0x2cb311=a142_0x23b6;if(!existsSync(_0x6d2cfa))return[];return readdirSync(_0x6d2cfa,{'withFileTypes':!![]})[_0x2cb311(0x185)](_0x31a38c=>_0x31a38c['isDirectory']()||_0x31a38c[_0x2cb311(0x176)]())[_0x2cb311(0x16d)](_0x1910da=>resolve(_0x6d2cfa,_0x1910da[_0x2cb311(0x170)]));}function localSkillLinkCandidates(_0x318a6d,_0x2737f8,_0x31870a){const _0x533c25=a142_0x23b6;if(!existsSync(_0x318a6d))return[];const _0x8a021b=_0x2737f8[_0x533c25(0x187)]+'--';return readdirSync(_0x318a6d,{'withFileTypes':!![]})[_0x533c25(0x185)](_0x34fd41=>_0x34fd41[_0x533c25(0x166)]()||_0x34fd41[_0x533c25(0x176)]())[_0x533c25(0x185)](_0x2edc85=>_0x2737f8['scope']===_0x533c25(0x18d)||_0x2edc85[_0x533c25(0x170)][_0x533c25(0x18a)](_0x8a021b)||_0x31870a[_0x533c25(0x174)](_0x533c25(0x17c)))[_0x533c25(0x16d)](_0x3e1c60=>resolve(_0x318a6d,_0x3e1c60[_0x533c25(0x170)]));}function collectLocalRuntimeSkill(_0x278368,_0x2aeae0,_0x8f3e3e){const _0x1d404f=a142_0x23b6,_0x4ff287=resolve(_0x2aeae0,METADATA_FILE),_0x417ffd=readMetadataIfPresent(_0x4ff287);if(!_0x417ffd)return;if(_0x417ffd[_0x1d404f(0x187)]!==_0x8f3e3e[_0x1d404f(0x187)])return;if(!isRuntimeSkillScope(_0x417ffd[_0x1d404f(0x184)])||!_0x8f3e3e['scopes']['has'](_0x417ffd[_0x1d404f(0x184)]))return;const _0x5381d8=_0x417ffd[_0x1d404f(0x16a)]?.[_0x1d404f(0x171)]();if(!_0x5381d8)return;if(_0x8f3e3e[_0x1d404f(0x18c)]&&_0x5381d8!==_0x8f3e3e['code'])return;const _0x2be0cb=_0x417ffd[_0x1d404f(0x184)]+':'+_0x5381d8,_0x15174f=_0x8f3e3e[_0x1d404f(0x16b)]?[_0x8f3e3e[_0x1d404f(0x16b)]]:[],_0x1a749e=_0x278368[_0x1d404f(0x18e)](_0x2be0cb);if(_0x1a749e){_0x8f3e3e['source']===_0x1d404f(0x180)&&(_0x1a749e[_0x1d404f(0x164)]=_0x2aeae0,_0x1a749e[_0x1d404f(0x178)]=_0x2aeae0,_0x1a749e[_0x1d404f(0x189)]=resolve(_0x2aeae0,SKILL_FILE),_0x1a749e[_0x1d404f(0x169)]=_0x4ff287);for(const _0xf7a86a of _0x15174f){!_0x1a749e['linkedPaths'][_0x1d404f(0x17a)](_0xf7a86a)&&_0x1a749e[_0x1d404f(0x181)]['push'](_0xf7a86a);}_0x1a749e[_0x1d404f(0x181)][_0x1d404f(0x182)]();return;}_0x278368[_0x1d404f(0x18f)](_0x2be0cb,{..._0x417ffd,'tags':Array[_0x1d404f(0x190)](_0x417ffd[_0x1d404f(0x17d)])?_0x417ffd[_0x1d404f(0x17d)]:[],'scope':_0x417ffd[_0x1d404f(0x184)],'source':_0x1d404f(0x167),'dir':_0x2aeae0,'cacheDir':_0x8f3e3e[_0x1d404f(0x186)]===_0x1d404f(0x180)?_0x2aeae0:undefined,'skillMdPath':resolve(_0x2aeae0,SKILL_FILE),'metadataPath':_0x4ff287,'linkedPaths':_0x15174f});}function compareLocalRuntimeSkills(_0xa1f403,_0x3b8c8c){const _0x29e6d2=a142_0x23b6,_0x176380={'personal':0x0,'company':0x1,'builtin':0x2};return _0x176380[_0xa1f403[_0x29e6d2(0x184)]]-_0x176380[_0x3b8c8c[_0x29e6d2(0x184)]]||_0xa1f403[_0x29e6d2(0x16a)][_0x29e6d2(0x18b)](_0x3b8c8c[_0x29e6d2(0x16a)])||_0xa1f403[_0x29e6d2(0x164)][_0x29e6d2(0x18b)](_0x3b8c8c[_0x29e6d2(0x164)]);}
@@ -1 +1 @@
1
- (function(_0x109b59,_0x45ac89){const _0x9e3d2a=a143_0x357d,_0x44b039=_0x109b59();while(!![]){try{const _0x4ac55f=parseInt(_0x9e3d2a(0xb1))/0x1+-parseInt(_0x9e3d2a(0xaa))/0x2+-parseInt(_0x9e3d2a(0xaf))/0x3+-parseInt(_0x9e3d2a(0x9c))/0x4*(-parseInt(_0x9e3d2a(0xad))/0x5)+parseInt(_0x9e3d2a(0x8e))/0x6+parseInt(_0x9e3d2a(0xa9))/0x7*(-parseInt(_0x9e3d2a(0x9b))/0x8)+parseInt(_0x9e3d2a(0x94))/0x9*(parseInt(_0x9e3d2a(0x9e))/0xa);if(_0x4ac55f===_0x45ac89)break;else _0x44b039['push'](_0x44b039['shift']());}catch(_0x4cf605){_0x44b039['push'](_0x44b039['shift']());}}}(a143_0x36d6,0x5b8fa));import{readFileSync,readdirSync,realpathSync}from'node:fs';import{relative,resolve}from'node:path';import{CliErrors}from'../../errors.js';import{IGNORED_DIR_NAMES,IGNORED_FILE_NAMES,SKILL_FILE}from'./constants.js';export function fileContent(_0x134a12){const _0x240111=a143_0x357d;return _0x134a12[_0x240111(0xa5)]??Buffer[_0x240111(0xb6)](_0x134a12[_0x240111(0x95)]??'','utf8');}function a143_0x357d(_0x4c5be7,_0x459f4b){_0x4c5be7=_0x4c5be7-0x8e;const _0x36d69e=a143_0x36d6();let _0x357d13=_0x36d69e[_0x4c5be7];return _0x357d13;}export function fileText(_0x1f202f){const _0x8ca962=a143_0x357d;return fileContent(_0x1f202f)['toString'](_0x8ca962(0xb4));}export function normalizeLocalFiles(_0x49f626){const _0x1b6b94=a143_0x357d;if(!Array['isArray'](_0x49f626)||_0x49f626[_0x1b6b94(0x9f)]===0x0)return[];const _0xe3556c=new Map();for(const _0x458420 of _0x49f626){if(!_0x458420||typeof _0x458420!==_0x1b6b94(0x90)||typeof _0x458420[_0x1b6b94(0xb3)]!==_0x1b6b94(0xa2))throw CliErrors[_0x1b6b94(0xac)](_0x1b6b94(0x96));const _0x180a1d=normalizeSkillRelativePath(_0x458420[_0x1b6b94(0xb3)]);if(_0xe3556c[_0x1b6b94(0xba)](_0x180a1d))throw CliErrors['validation'](_0x1b6b94(0xb7)+_0x180a1d);if(_0x458420[_0x1b6b94(0xa5)]!==undefined&&!Buffer[_0x1b6b94(0xb2)](_0x458420[_0x1b6b94(0xa5)]))throw CliErrors['validation'](_0x1b6b94(0x8f)+_0x180a1d);if(_0x458420[_0x1b6b94(0xa5)]===undefined&&typeof _0x458420['content']!==_0x1b6b94(0xa2))throw CliErrors[_0x1b6b94(0xac)]('Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20'+_0x180a1d);const _0x2a806b=fileContent(_0x458420);_0xe3556c[_0x1b6b94(0xb5)](_0x180a1d,{'path':_0x180a1d,'bytes':_0x2a806b});}return Array[_0x1b6b94(0xb6)](_0xe3556c[_0x1b6b94(0xa1)]())[_0x1b6b94(0xb8)](compareSkillFiles);}export function normalizeManifestFiles(_0x44eeb4){const _0x1ea441=a143_0x357d;if(!Array[_0x1ea441(0xa0)](_0x44eeb4)||_0x44eeb4[_0x1ea441(0x9f)]===0x0)return[];const _0xb73ebd=new Map();for(const _0x11aa56 of _0x44eeb4){if(!_0x11aa56||typeof _0x11aa56!==_0x1ea441(0x90)||typeof _0x11aa56[_0x1ea441(0xb3)]!==_0x1ea441(0xa2))throw CliErrors[_0x1ea441(0xac)](_0x1ea441(0x96));const _0x8ae8d9=normalizeSkillRelativePath(_0x11aa56[_0x1ea441(0xb3)]);if(_0xb73ebd[_0x1ea441(0xba)](_0x8ae8d9))throw CliErrors[_0x1ea441(0xac)](_0x1ea441(0xb7)+_0x8ae8d9);if(!isSha256Hex(_0x11aa56[_0x1ea441(0xa4)]))throw CliErrors['validation']('Skill\x20file\x20sha256\x20is\x20invalid:\x20'+_0x8ae8d9);if(!Number[_0x1ea441(0xa8)](_0x11aa56[_0x1ea441(0xb0)])||_0x11aa56[_0x1ea441(0xb0)]<0x0)throw CliErrors[_0x1ea441(0xac)](_0x1ea441(0x9d)+_0x8ae8d9);_0xb73ebd[_0x1ea441(0xb5)](_0x8ae8d9,{'path':_0x8ae8d9,'sha256':_0x11aa56[_0x1ea441(0xa4)][_0x1ea441(0x9a)](),'size':_0x11aa56[_0x1ea441(0xb0)]});}return Array[_0x1ea441(0xb6)](_0xb73ebd['values']())['sort'](compareSkillFiles);}export function scanSkillDirectory(_0x187813,_0x19796f={}){const _0xb34ba4=a143_0x357d,_0x123531=realpathSync(_0x187813),_0x51c296=canonicalExcludedFilePaths(_0x19796f[_0xb34ba4(0x91)]),_0x4d99a8=[];function _0x2e517d(_0x4d9fee){const _0x204ebd=_0xb34ba4,_0x2e42f2=readdirSync(_0x4d9fee,{'withFileTypes':!![]})[_0x204ebd(0xb8)]((_0x19ae88,_0x16b752)=>_0x19ae88[_0x204ebd(0xab)]['localeCompare'](_0x16b752[_0x204ebd(0xab)]));for(const _0x1dd2f1 of _0x2e42f2){if(_0x1dd2f1[_0x204ebd(0x97)]()&&IGNORED_DIR_NAMES[_0x204ebd(0xba)](_0x1dd2f1[_0x204ebd(0xab)]))continue;if(IGNORED_FILE_NAMES['has'](_0x1dd2f1[_0x204ebd(0xab)]))continue;const _0x65bc29=resolve(_0x4d9fee,_0x1dd2f1[_0x204ebd(0xab)]);if(isExcludedFilePath(_0x65bc29,_0x51c296))continue;if(_0x1dd2f1[_0x204ebd(0x92)]())throw CliErrors[_0x204ebd(0xac)](_0x204ebd(0xbd)+_0x65bc29);const _0x305dac=toPosixPath(relative(_0x123531,_0x65bc29));if(_0x1dd2f1[_0x204ebd(0x97)]()){_0x2e517d(_0x65bc29);continue;}if(!_0x1dd2f1['isFile']())continue;validateSkillRelativePath(_0x305dac);const _0xf853a3=readFileSync(_0x65bc29);_0x4d99a8[_0x204ebd(0x93)]({'path':_0x305dac,'bytes':_0xf853a3});}}return _0x2e517d(_0x123531),normalizeLocalFiles(_0x4d99a8);}function canonicalExcludedFilePaths(_0x1f7951){const _0x58c12a=a143_0x357d,_0x5328e1=new Set();for(const _0x377de4 of _0x1f7951??[]){const _0x4b2d09=resolve(_0x377de4);_0x5328e1[_0x58c12a(0xae)](_0x4b2d09);try{_0x5328e1[_0x58c12a(0xae)](realpathSync(_0x4b2d09));}catch{}}return _0x5328e1;}function a143_0x36d6(){const _0x155ba6=['sort','Unsafe\x20Skill\x20file\x20path:\x20','has','trim','test','Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20','2402736DRqavn','Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20','object','excludedFilePaths','isSymbolicLink','push','18mqwVuE','content','Skill\x20file\x20path\x20must\x20be\x20text.','isDirectory','replace','split','toLowerCase','5617016KKwpyN','4FsPcma','Skill\x20file\x20size\x20is\x20invalid:\x20','6871050YhmOiR','length','isArray','values','string','includes','sha256','bytes','compare','startsWith','isSafeInteger','7hLKQMA','1390370uvUiXV','name','validation','1052820EFIqbf','add','1644039apEMGj','size','335129TxzWTE','isBuffer','path','utf8','set','from','Duplicate\x20Skill\x20file\x20path:\x20'];a143_0x36d6=function(){return _0x155ba6;};return a143_0x36d6();}function isExcludedFilePath(_0x269464,_0x2b0cb9){const _0x213e2a=a143_0x357d;if(_0x2b0cb9[_0x213e2a(0xba)](_0x269464))return!![];if(_0x2b0cb9[_0x213e2a(0xb0)]===0x0)return![];try{return _0x2b0cb9[_0x213e2a(0xba)](realpathSync(_0x269464));}catch{return![];}}export function compareSkillFiles(_0x59d320,_0xb1e0fe){const _0xfa47ed=a143_0x357d;if(_0x59d320[_0xfa47ed(0xb3)]===SKILL_FILE)return _0xb1e0fe[_0xfa47ed(0xb3)]===SKILL_FILE?0x0:-0x1;if(_0xb1e0fe['path']===SKILL_FILE)return 0x1;return Buffer[_0xfa47ed(0xa6)](Buffer['from'](_0x59d320[_0xfa47ed(0xb3)],_0xfa47ed(0xb4)),Buffer[_0xfa47ed(0xb6)](_0xb1e0fe[_0xfa47ed(0xb3)],_0xfa47ed(0xb4)));}export function normalizeSkillRelativePath(_0x34e8b5){const _0xf96bb6=a143_0x357d,_0x1e003d=toPosixPath(_0x34e8b5[_0xf96bb6(0xbb)]());return validateSkillRelativePath(_0x1e003d),_0x1e003d;}export function validateSkillRelativePath(_0x4358d1){const _0x136f69=a143_0x357d;if(!_0x4358d1||_0x4358d1[_0x136f69(0xa7)]('/')||_0x4358d1[_0x136f69(0xa3)]('//'))throw CliErrors[_0x136f69(0xac)](_0x136f69(0xb9)+_0x4358d1);for(const _0x26b0c4 of _0x4358d1[_0x136f69(0x99)]('/')){if(!_0x26b0c4||_0x26b0c4==='.'||_0x26b0c4==='..')throw CliErrors[_0x136f69(0xac)]('Unsafe\x20Skill\x20file\x20path:\x20'+_0x4358d1);}}export function toPosixPath(_0x131238){const _0x195817=a143_0x357d;return _0x131238[_0x195817(0x98)](/\\/g,'/');}export function isSha256Hex(_0x2fa398){const _0x59cb5f=a143_0x357d;return typeof _0x2fa398===_0x59cb5f(0xa2)&&/^[a-fA-F0-9]{64}$/[_0x59cb5f(0xbc)](_0x2fa398);}
1
+ (function(_0x11a292,_0x141eb6){const _0x4b4ca1=a143_0x5097,_0x197dab=_0x11a292();while(!![]){try{const _0x4054da=-parseInt(_0x4b4ca1(0x118))/0x1+-parseInt(_0x4b4ca1(0x121))/0x2*(-parseInt(_0x4b4ca1(0x116))/0x3)+parseInt(_0x4b4ca1(0x114))/0x4*(-parseInt(_0x4b4ca1(0x13a))/0x5)+-parseInt(_0x4b4ca1(0x13d))/0x6+-parseInt(_0x4b4ca1(0x111))/0x7+-parseInt(_0x4b4ca1(0x133))/0x8+-parseInt(_0x4b4ca1(0x13b))/0x9*(-parseInt(_0x4b4ca1(0x11e))/0xa);if(_0x4054da===_0x141eb6)break;else _0x197dab['push'](_0x197dab['shift']());}catch(_0x5e9bb5){_0x197dab['push'](_0x197dab['shift']());}}}(a143_0x2fcb,0x1af6f));import{readFileSync,readdirSync,realpathSync}from'node:fs';import{relative,resolve}from'node:path';import{CliErrors}from'../../errors.js';import{IGNORED_DIR_NAMES,IGNORED_FILE_NAMES,SKILL_FILE}from'./constants.js';function a143_0x5097(_0x2eb530,_0x9d70d0){_0x2eb530=_0x2eb530-0x111;const _0x2fcb7b=a143_0x2fcb();let _0x5097df=_0x2fcb7b[_0x2eb530];return _0x5097df;}export function fileContent(_0x3d9110){const _0x78c76d=a143_0x5097;return _0x3d9110[_0x78c76d(0x12c)]??Buffer[_0x78c76d(0x126)](_0x3d9110['content']??'',_0x78c76d(0x119));}export function fileText(_0x45dd7a){const _0x3c3c89=a143_0x5097;return fileContent(_0x45dd7a)[_0x3c3c89(0x11d)](_0x3c3c89(0x119));}export function normalizeLocalFiles(_0x471834){const _0x50c5b8=a143_0x5097;if(!Array[_0x50c5b8(0x12e)](_0x471834)||_0x471834[_0x50c5b8(0x132)]===0x0)return[];const _0x514600=new Map();for(const _0x51b919 of _0x471834){if(!_0x51b919||typeof _0x51b919!==_0x50c5b8(0x13c)||typeof _0x51b919[_0x50c5b8(0x130)]!==_0x50c5b8(0x124))throw CliErrors['validation'](_0x50c5b8(0x120));const _0x100512=normalizeSkillRelativePath(_0x51b919[_0x50c5b8(0x130)]);if(_0x514600[_0x50c5b8(0x122)](_0x100512))throw CliErrors[_0x50c5b8(0x11f)](_0x50c5b8(0x128)+_0x100512);if(_0x51b919[_0x50c5b8(0x12c)]!==undefined&&!Buffer[_0x50c5b8(0x138)](_0x51b919[_0x50c5b8(0x12c)]))throw CliErrors[_0x50c5b8(0x11f)]('Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20'+_0x100512);if(_0x51b919[_0x50c5b8(0x12c)]===undefined&&typeof _0x51b919['content']!==_0x50c5b8(0x124))throw CliErrors[_0x50c5b8(0x11f)](_0x50c5b8(0x11c)+_0x100512);const _0x49657e=fileContent(_0x51b919);_0x514600[_0x50c5b8(0x139)](_0x100512,{'path':_0x100512,'bytes':_0x49657e});}return Array[_0x50c5b8(0x126)](_0x514600[_0x50c5b8(0x12f)]())['sort'](compareSkillFiles);}export function normalizeManifestFiles(_0x17cb7f){const _0x3986ab=a143_0x5097;if(!Array['isArray'](_0x17cb7f)||_0x17cb7f['length']===0x0)return[];const _0x2ca3d6=new Map();for(const _0x544ca3 of _0x17cb7f){if(!_0x544ca3||typeof _0x544ca3!==_0x3986ab(0x13c)||typeof _0x544ca3[_0x3986ab(0x130)]!==_0x3986ab(0x124))throw CliErrors['validation'](_0x3986ab(0x120));const _0x50b9f2=normalizeSkillRelativePath(_0x544ca3[_0x3986ab(0x130)]);if(_0x2ca3d6['has'](_0x50b9f2))throw CliErrors[_0x3986ab(0x11f)]('Duplicate\x20Skill\x20file\x20path:\x20'+_0x50b9f2);if(!isSha256Hex(_0x544ca3['sha256']))throw CliErrors[_0x3986ab(0x11f)](_0x3986ab(0x11b)+_0x50b9f2);if(!Number[_0x3986ab(0x137)](_0x544ca3['size'])||_0x544ca3[_0x3986ab(0x12d)]<0x0)throw CliErrors[_0x3986ab(0x11f)](_0x3986ab(0x131)+_0x50b9f2);_0x2ca3d6['set'](_0x50b9f2,{'path':_0x50b9f2,'sha256':_0x544ca3[_0x3986ab(0x129)][_0x3986ab(0x113)](),'size':_0x544ca3[_0x3986ab(0x12d)]});}return Array[_0x3986ab(0x126)](_0x2ca3d6[_0x3986ab(0x12f)]())[_0x3986ab(0x125)](compareSkillFiles);}export function scanSkillDirectory(_0x14fb17,_0x171a53={}){const _0x11e36e=a143_0x5097,_0x422041=realpathSync(_0x14fb17),_0x3ea8b9=canonicalExcludedFilePaths(_0x171a53[_0x11e36e(0x13e)]),_0x4b0212=[];function _0x1eb793(_0x294ed0){const _0xf9e74c=_0x11e36e,_0x5e0a61=readdirSync(_0x294ed0,{'withFileTypes':!![]})[_0xf9e74c(0x125)]((_0xcee4aa,_0x5bf16c)=>_0xcee4aa['name'][_0xf9e74c(0x117)](_0x5bf16c['name']));for(const _0x448394 of _0x5e0a61){if(_0x448394[_0xf9e74c(0x12b)]()&&IGNORED_DIR_NAMES[_0xf9e74c(0x122)](_0x448394[_0xf9e74c(0x123)]))continue;if(IGNORED_FILE_NAMES[_0xf9e74c(0x122)](_0x448394[_0xf9e74c(0x123)]))continue;const _0x5d0190=resolve(_0x294ed0,_0x448394[_0xf9e74c(0x123)]);if(isExcludedFilePath(_0x5d0190,_0x3ea8b9))continue;if(_0x448394[_0xf9e74c(0x134)]())throw CliErrors[_0xf9e74c(0x11f)](_0xf9e74c(0x135)+_0x5d0190);const _0x1b76ca=toPosixPath(relative(_0x422041,_0x5d0190));if(_0x448394[_0xf9e74c(0x12b)]()){_0x1eb793(_0x5d0190);continue;}if(!_0x448394['isFile']())continue;validateSkillRelativePath(_0x1b76ca);const _0x572356=readFileSync(_0x5d0190);_0x4b0212[_0xf9e74c(0x115)]({'path':_0x1b76ca,'bytes':_0x572356});}}return _0x1eb793(_0x422041),normalizeLocalFiles(_0x4b0212);}function a143_0x2fcb(){const _0x2d60dc=['excludedFilePaths','450464tidmpV','split','toLowerCase','1340jNeFYW','push','648078qHtyBR','localeCompare','147620qzKiEI','utf8','test','Skill\x20file\x20sha256\x20is\x20invalid:\x20','Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20','toString','1672810aHpgAK','validation','Skill\x20file\x20path\x20must\x20be\x20text.','2cOpXLI','has','name','string','sort','from','add','Duplicate\x20Skill\x20file\x20path:\x20','sha256','includes','isDirectory','bytes','size','isArray','values','path','Skill\x20file\x20size\x20is\x20invalid:\x20','length','68824cJpHQI','isSymbolicLink','Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20','Unsafe\x20Skill\x20file\x20path:\x20','isSafeInteger','isBuffer','set','2155NuRuie','18rpxRlQ','object','451086HewOKK'];a143_0x2fcb=function(){return _0x2d60dc;};return a143_0x2fcb();}function canonicalExcludedFilePaths(_0x216790){const _0x15b362=a143_0x5097,_0x4ac033=new Set();for(const _0xb16ec8 of _0x216790??[]){const _0x21cbfe=resolve(_0xb16ec8);_0x4ac033[_0x15b362(0x127)](_0x21cbfe);try{_0x4ac033[_0x15b362(0x127)](realpathSync(_0x21cbfe));}catch{}}return _0x4ac033;}function isExcludedFilePath(_0x5f1203,_0x483498){const _0x5236ee=a143_0x5097;if(_0x483498[_0x5236ee(0x122)](_0x5f1203))return!![];if(_0x483498[_0x5236ee(0x12d)]===0x0)return![];try{return _0x483498[_0x5236ee(0x122)](realpathSync(_0x5f1203));}catch{return![];}}export function compareSkillFiles(_0x1dcd5a,_0x11d179){const _0x35e2ac=a143_0x5097;if(_0x1dcd5a['path']===SKILL_FILE)return _0x11d179['path']===SKILL_FILE?0x0:-0x1;if(_0x11d179[_0x35e2ac(0x130)]===SKILL_FILE)return 0x1;return Buffer['compare'](Buffer[_0x35e2ac(0x126)](_0x1dcd5a['path'],'utf8'),Buffer['from'](_0x11d179[_0x35e2ac(0x130)],_0x35e2ac(0x119)));}export function normalizeSkillRelativePath(_0x13504c){const _0x2fbb5a=toPosixPath(_0x13504c['trim']());return validateSkillRelativePath(_0x2fbb5a),_0x2fbb5a;}export function validateSkillRelativePath(_0x3cf2f8){const _0x2948be=a143_0x5097;if(!_0x3cf2f8||_0x3cf2f8['startsWith']('/')||_0x3cf2f8[_0x2948be(0x12a)]('//'))throw CliErrors['validation'](_0x2948be(0x136)+_0x3cf2f8);for(const _0x43d124 of _0x3cf2f8[_0x2948be(0x112)]('/')){if(!_0x43d124||_0x43d124==='.'||_0x43d124==='..')throw CliErrors[_0x2948be(0x11f)](_0x2948be(0x136)+_0x3cf2f8);}}export function toPosixPath(_0xeddce8){return _0xeddce8['replace'](/\\/g,'/');}export function isSha256Hex(_0x23206a){const _0x175825=a143_0x5097;return typeof _0x23206a===_0x175825(0x124)&&/^[a-fA-F0-9]{64}$/[_0x175825(0x11a)](_0x23206a);}
@@ -1 +1 @@
1
- (function(_0x218faa,_0x5922ec){const _0x451a89=a144_0x9ead,_0x47b33c=_0x218faa();while(!![]){try{const _0x4e33c8=parseInt(_0x451a89(0x11e))/0x1*(parseInt(_0x451a89(0x12d))/0x2)+-parseInt(_0x451a89(0x125))/0x3+-parseInt(_0x451a89(0x152))/0x4*(parseInt(_0x451a89(0x12c))/0x5)+-parseInt(_0x451a89(0x14f))/0x6+-parseInt(_0x451a89(0x141))/0x7+parseInt(_0x451a89(0x130))/0x8*(parseInt(_0x451a89(0x11a))/0x9)+parseInt(_0x451a89(0x131))/0xa;if(_0x4e33c8===_0x5922ec)break;else _0x47b33c['push'](_0x47b33c['shift']());}catch(_0x4dcb69){_0x47b33c['push'](_0x47b33c['shift']());}}}(a144_0x22c4,0x7bdae));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';function a144_0x22c4(){const _0x92d862=['4207791DwNKgT','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','find','validation','skillName','example','name:\x20','trimEnd','packageBytes','schemaVersion','fileHashes','env','utf8','scope','1085508JLTQDz','replace','trim','68PmKjfQ','filter','387VSSrTl','join','force','slice','195OlLpXy','length','map','errors','appCode','match','description:\x20','1531914ERWImT','test','status','paths','flow','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.','accessKey','174490eAhdlf','8398aniUIs','description','set','162208BmbloD','7025720BCqQmu','contentHash','has','contents','isFile','---\x0a','displayName:\x20','entries','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','delete','version','---','hasOwn','path','displayName','keys'];a144_0x22c4=function(){return _0x92d862;};return a144_0x22c4();}import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{resolveManagedFilePath,writeBytesAtomic,writeJsonAtomic}from'./fs-utils.js';import{bufferSha256,contentHash,fileHash}from'./hashing.js';import{fileContent,fileText,normalizeLocalFiles}from'./local-files.js';import{buildMetadata,readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillDir}from'./paths.js';import{extractDownloadedPackage,requirePackageBytes}from'./zip-package.js';export function materializeRuntimeSkill(_0xf86f83,_0x1e60c7,_0x1101dc){const _0x25426c=a144_0x9ead,_0x457081=requireSkillCode(_0xf86f83),_0x57d25f=requirePackageBytes(_0x457081,_0x1101dc[_0x25426c(0x149)]),_0x4c8357=extractDownloadedPackage(_0x57d25f),_0x33edc8=_0x4c8357[_0x25426c(0x143)](_0x4dbc95=>_0x4dbc95[_0x25426c(0x13e)]===SKILL_FILE);if(!_0x33edc8)throw CliErrors['validation']('Runtime\x20Skill\x20package\x20is\x20missing\x20'+SKILL_FILE+':\x20'+_0x457081);const _0x5a26da=withMaterializedSkillFrontmatter(_0x4c8357,_0xf86f83,_0x457081),_0x5214d4=_0x5a26da[_0x25426c(0x143)](_0x541615=>_0x541615[_0x25426c(0x13e)]===SKILL_FILE),_0x110125=fileText(_0x5214d4),_0x415fb1=getRuntimeSkillDir(_0x1101dc['env'],_0x1101dc['accessKey'],_0x1101dc[_0x25426c(0x122)],_0x1e60c7,_0x457081,_0x1101dc[_0x25426c(0x128)]),_0x73f899=resolve(_0x415fb1,SKILL_FILE),_0x241261=resolve(_0x415fb1,METADATA_FILE),_0x27bee2=contentHash(_0x110125),_0x52b9a2=readMetadataIfPresent(_0x241261)?.[_0x25426c(0x14b)];ensurePulledFilesCanBeOverwritten(_0x415fb1,_0x241261,_0x5a26da,_0x1101dc[_0x25426c(0x11c)]===!![]),mkdirSync(_0x415fb1,{'recursive':!![],'mode':0x1c0});const _0x29775b=existsSync(_0x73f899)?readFileSync(_0x73f899,_0x25426c(0x14d)):undefined;return materializeFiles(_0x415fb1,_0x5a26da),removeStaleManagedFiles(_0x415fb1,_0x52b9a2,_0x5a26da),writeJsonAtomic(_0x241261,buildMetadata(_0xf86f83,_0x1e60c7,_0x1101dc[_0x25426c(0x122)],_0x27bee2,_0x1101dc['pulledAt'],_0x5a26da,_0x57d25f)),{'skill':_0xf86f83,'scope':_0x1e60c7,'dir':_0x415fb1,'skillMdPath':_0x73f899,'metadataPath':_0x241261,'contentHash':_0x27bee2,'changed':_0x29775b!==_0x110125};}export function reuseMaterializedRuntimeSkill(_0x42619a,_0x465917,_0x3c71ae){const _0x11161e=a144_0x9ead,_0x3e4063=_0x42619a['version']?.[_0x11161e(0x151)]();if(!_0x3e4063)return undefined;const _0x1be1a9=requireSkillCode(_0x42619a),_0x156157=getRuntimeSkillDir(_0x3c71ae[_0x11161e(0x14c)],_0x3c71ae[_0x11161e(0x12b)],_0x3c71ae[_0x11161e(0x122)],_0x465917,_0x1be1a9,_0x3c71ae[_0x11161e(0x128)]),_0x4d334b=resolve(_0x156157,SKILL_FILE),_0x2365c5=resolve(_0x156157,METADATA_FILE),_0x54b800=readMetadataIfPresent(_0x2365c5);if(!_0x54b800||_0x54b800[_0x11161e(0x14a)]!==0x2||_0x54b800[_0x11161e(0x122)]!==_0x3c71ae[_0x11161e(0x122)]||_0x54b800[_0x11161e(0x14e)]!==_0x465917||_0x54b800['skillCode']!==_0x1be1a9||_0x54b800[_0x11161e(0x13b)]!==_0x3e4063||_0x54b800['id']!==_0x42619a['id']||_0x54b800['skillName']!==_0x42619a[_0x11161e(0x145)]||_0x54b800[_0x11161e(0x12e)]!==_0x42619a[_0x11161e(0x12e)]||_0x54b800['example']!==_0x42619a[_0x11161e(0x146)]||_0x54b800[_0x11161e(0x127)]!==_0x42619a['status']||!_0x54b800[_0x11161e(0x132)]||!_0x54b800['fileHashes']||!Object[_0x11161e(0x13d)](_0x54b800['fileHashes'],SKILL_FILE))return undefined;for(const [_0xe0070,_0x3eb24d]of Object['entries'](_0x54b800[_0x11161e(0x14b)])){if(!/^[a-f0-9]{64}$/[_0x11161e(0x126)](_0x3eb24d))return undefined;const _0x1296e9=resolveManagedFilePath(_0x156157,_0xe0070);if(!existsSync(_0x1296e9)||!lstatSync(_0x1296e9)[_0x11161e(0x135)]())return undefined;if(bufferSha256(readFileSync(_0x1296e9))!==_0x3eb24d)return undefined;}return{'skill':_0x42619a,'scope':_0x465917,'dir':_0x156157,'skillMdPath':_0x4d334b,'metadataPath':_0x2365c5,'contentHash':_0x54b800[_0x11161e(0x132)],'changed':![]};}function withMaterializedSkillFrontmatter(_0x18b2ff,_0x1eba7c,_0x4d920b){const _0x10e3ff=a144_0x9ead,_0x16a860=skillDisplayName(_0x1eba7c,_0x4d920b),_0x58c90e=_0x1eba7c['description']?.[_0x10e3ff(0x151)]()||_0x16a860||_0x4d920b;return normalizeLocalFiles(_0x18b2ff)[_0x10e3ff(0x120)](_0x13ee36=>{const _0x2c45dc=_0x10e3ff,_0xcef726=fileText(_0x13ee36);if(_0x13ee36['path']!==SKILL_FILE)return _0x13ee36;if(hasYamlFrontmatter(_0xcef726))return{'path':_0x13ee36[_0x2c45dc(0x13e)],'content':withSyncedDisplayName(_0xcef726,_0x16a860)};return{'path':_0x13ee36[_0x2c45dc(0x13e)],'content':prependSkillFrontmatter(_0xcef726,{'name':_0x4d920b,'displayName':_0x16a860,'description':_0x58c90e})};});}function hasYamlFrontmatter(_0x42ee47){return/^\uFEFF?---\s*\r?\n/['test'](_0x42ee47);}function a144_0x9ead(_0x14a929,_0x1378ca){_0x14a929=_0x14a929-0x119;const _0x22c495=a144_0x22c4();let _0x9eade1=_0x22c495[_0x14a929];return _0x9eade1;}function prependSkillFrontmatter(_0x4a81af,_0x256916){const _0x1097d0=a144_0x9ead,_0x19fab6=_0x4a81af[_0x1097d0(0x150)](/^\uFEFF/,'');return[_0x1097d0(0x13c),_0x1097d0(0x147)+yamlString(_0x256916['name']),_0x256916[_0x1097d0(0x13f)]?_0x1097d0(0x137)+yamlString(_0x256916[_0x1097d0(0x13f)]):undefined,_0x1097d0(0x124)+yamlString(_0x256916[_0x1097d0(0x12e)]),_0x1097d0(0x13c),'',_0x19fab6][_0x1097d0(0x119)](_0x256ae8=>_0x256ae8!==undefined)[_0x1097d0(0x11b)]('\x0a');}function yamlString(_0x33e6ac){return JSON['stringify'](_0x33e6ac['replace'](/\r/g,'')['trim']());}function skillDisplayName(_0x2115f8,_0x1a0ee6){const _0x5e0175=a144_0x9ead,_0x298534=_0x2115f8[_0x5e0175(0x145)]?.['trim']();return _0x298534||_0x1a0ee6;}function withSyncedDisplayName(_0x26f132,_0x490ddc){const _0x272e8b=a144_0x9ead,_0x26880e=_0x26f132[_0x272e8b(0x123)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x26880e)return _0x26f132;const _0x1e1d1a=_0x26880e[0x1]??'',_0x53322f=_0x26880e[0x2]??'',_0x31a131=parseDocument(_0x53322f);if(_0x31a131[_0x272e8b(0x121)][_0x272e8b(0x11f)]>0x0||!isMap(_0x31a131['contents']))return _0x26f132;if(_0x490ddc)_0x31a131[_0x272e8b(0x12f)]('displayName',_0x490ddc);else{if(_0x31a131[_0x272e8b(0x133)](_0x272e8b(0x13f)))_0x31a131[_0x272e8b(0x13a)]('displayName');else return _0x26f132;}forceBlockCollections(_0x31a131[_0x272e8b(0x134)]);const _0x464534=_0x31a131['toString']({'lineWidth':0x0})[_0x272e8b(0x148)](),_0x2e1eb0=_0x26f132[_0x272e8b(0x11d)](_0x26880e[0x0][_0x272e8b(0x11f)])['replace'](/^\r?\n/,'');return _0x1e1d1a+_0x272e8b(0x136)+_0x464534+'\x0a---\x0a\x0a'+_0x2e1eb0;}function forceBlockCollections(_0x1a99c7){if(!isNode(_0x1a99c7))return;visit(_0x1a99c7,(_0x19a802,_0x4a8582)=>{const _0x737ca9=a144_0x9ead;isCollection(_0x4a8582)&&(_0x4a8582[_0x737ca9(0x129)]=![]);});}function ensurePulledFilesCanBeOverwritten(_0x56cc02,_0xddb72a,_0x4d0e3e,_0x2b9f5d){const _0x1c4149=a144_0x9ead;if(_0x2b9f5d||!existsSync(_0xddb72a))return;const _0x16e4ab=readMetadataIfPresent(_0xddb72a);if(!_0x16e4ab)return;const _0x3a38da=_0x16e4ab['fileHashes']&&Object[_0x1c4149(0x140)](_0x16e4ab[_0x1c4149(0x14b)])[_0x1c4149(0x11f)]>0x0?_0x16e4ab[_0x1c4149(0x14b)]:undefined;if(_0x3a38da)for(const [_0x1ce750,_0x3a2b3c]of Object[_0x1c4149(0x138)](_0x3a38da)){const _0x2d151c=resolveManagedFilePath(_0x56cc02,_0x1ce750);if(!existsSync(_0x2d151c))throw CliErrors[_0x1c4149(0x144)](_0x1c4149(0x139)+_0x56cc02,'Managed\x20file\x20was\x20removed\x20locally:\x20'+_0x1ce750);const _0x367a48=lstatSync(_0x2d151c);if(!_0x367a48[_0x1c4149(0x135)]())throw CliErrors['validation'](_0x1c4149(0x139)+_0x56cc02,'Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20'+_0x1ce750);const _0x1046bf=bufferSha256(readFileSync(_0x2d151c));if(_0x1046bf!==_0x3a2b3c)throw CliErrors['validation'](_0x1c4149(0x139)+_0x56cc02+'.\x20Changed\x20file:\x20'+_0x1ce750,'Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20'+_0x1ce750);}else{const _0x28f311=resolve(_0x56cc02,SKILL_FILE);if(existsSync(_0x28f311)&&_0x16e4ab['contentHash']){const _0xe2bf50=contentHash(readFileSync(_0x28f311,_0x1c4149(0x14d)));if(_0xe2bf50!==_0x16e4ab[_0x1c4149(0x132)])throw CliErrors['validation']('Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20'+_0x28f311,_0x1c4149(0x12a));}}for(const _0x43e6f6 of normalizeLocalFiles(_0x4d0e3e)){if(_0x3a38da?.[_0x43e6f6[_0x1c4149(0x13e)]])continue;if(!_0x3a38da&&_0x43e6f6[_0x1c4149(0x13e)]===SKILL_FILE)continue;const _0x51bb6a=resolveManagedFilePath(_0x56cc02,_0x43e6f6['path']);if(!existsSync(_0x51bb6a))continue;const _0x1d5a81=lstatSync(_0x51bb6a);if(!_0x1d5a81[_0x1c4149(0x135)]())throw CliErrors[_0x1c4149(0x144)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x56cc02,_0x1c4149(0x142)+_0x43e6f6[_0x1c4149(0x13e)]);const _0x4b955a=bufferSha256(readFileSync(_0x51bb6a));if(_0x4b955a!==fileHash(_0x43e6f6))throw CliErrors[_0x1c4149(0x144)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x56cc02,'Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20'+_0x43e6f6[_0x1c4149(0x13e)]);}}function materializeFiles(_0xa8f207,_0x50b41a){const _0x15863a=a144_0x9ead;for(const _0x3f4b72 of normalizeLocalFiles(_0x50b41a)){const _0x4afebf=resolveManagedFilePath(_0xa8f207,_0x3f4b72[_0x15863a(0x13e)]);mkdirSync(dirname(_0x4afebf),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x4afebf,fileContent(_0x3f4b72),0x180);}}function removeStaleManagedFiles(_0xff33c9,_0x116378,_0x370812){const _0x462381=a144_0x9ead;if(!_0x116378)return;const _0x98288e=new Set(normalizeLocalFiles(_0x370812)[_0x462381(0x120)](_0x363c98=>_0x363c98[_0x462381(0x13e)]));for(const _0x5e3669 of Object[_0x462381(0x140)](_0x116378)){if(_0x98288e[_0x462381(0x133)](_0x5e3669))continue;const _0x42dd2c=resolveManagedFilePath(_0xff33c9,_0x5e3669);existsSync(_0x42dd2c)&&lstatSync(_0x42dd2c)['isFile']()&&rmSync(_0x42dd2c,{'force':!![]});}}
1
+ (function(_0x377478,_0x1fea2f){const _0x5b3b89=a144_0xa471,_0x2882de=_0x377478();while(!![]){try{const _0x270d19=parseInt(_0x5b3b89(0x1e2))/0x1*(-parseInt(_0x5b3b89(0x1d7))/0x2)+parseInt(_0x5b3b89(0x1ed))/0x3*(parseInt(_0x5b3b89(0x1fd))/0x4)+-parseInt(_0x5b3b89(0x1cd))/0x5+-parseInt(_0x5b3b89(0x1de))/0x6*(parseInt(_0x5b3b89(0x1d8))/0x7)+-parseInt(_0x5b3b89(0x1ca))/0x8*(parseInt(_0x5b3b89(0x1d3))/0x9)+-parseInt(_0x5b3b89(0x1e8))/0xa*(-parseInt(_0x5b3b89(0x1f0))/0xb)+parseInt(_0x5b3b89(0x1cb))/0xc*(parseInt(_0x5b3b89(0x1e9))/0xd);if(_0x270d19===_0x1fea2f)break;else _0x2882de['push'](_0x2882de['shift']());}catch(_0x3b6b89){_0x2882de['push'](_0x2882de['shift']());}}}(a144_0x5593,0x64cd0));import{existsSync,lstatSync,mkdirSync,readFileSync,rmSync}from'node:fs';import{dirname,resolve}from'node:path';import{isCollection,isMap,isNode,parseDocument,visit}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{resolveManagedFilePath,writeBytesAtomic,writeJsonAtomic}from'./fs-utils.js';import{bufferSha256,contentHash,fileHash}from'./hashing.js';import{fileContent,fileText,normalizeLocalFiles}from'./local-files.js';import{buildMetadata,readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillDir}from'./paths.js';function a144_0xa471(_0x70f290,_0x3eca7a){_0x70f290=_0x70f290-0x1c7;const _0x55939d=a144_0x5593();let _0xa47114=_0x55939d[_0x70f290];return _0xa47114;}import{extractDownloadedPackage,requirePackageBytes}from'./zip-package.js';export function materializeRuntimeSkill(_0x3dc8c7,_0x1878f7,_0x1e9a06){const _0x4c4057=a144_0xa471,_0x712a2a=requireSkillCode(_0x3dc8c7),_0xaebe1c=requirePackageBytes(_0x712a2a,_0x1e9a06['packageBytes']),_0x5b5cde=extractDownloadedPackage(_0xaebe1c),_0xee5873=_0x5b5cde[_0x4c4057(0x1df)](_0x4a4861=>_0x4a4861[_0x4c4057(0x1f3)]===SKILL_FILE);if(!_0xee5873)throw CliErrors[_0x4c4057(0x1ec)](_0x4c4057(0x1dd)+SKILL_FILE+':\x20'+_0x712a2a);const _0x353d88=withMaterializedSkillFrontmatter(_0x5b5cde,_0x3dc8c7,_0x712a2a),_0x2acc4a=_0x353d88[_0x4c4057(0x1df)](_0x292b94=>_0x292b94[_0x4c4057(0x1f3)]===SKILL_FILE),_0x4e9036=fileText(_0x2acc4a),_0x5a4678=getRuntimeSkillDir(_0x1e9a06[_0x4c4057(0x1f1)],_0x1e9a06['accessKey'],_0x1e9a06[_0x4c4057(0x1c9)],_0x1878f7,_0x712a2a,_0x1e9a06[_0x4c4057(0x1f4)]),_0x2ad7c7=resolve(_0x5a4678,SKILL_FILE),_0x2d9541=resolve(_0x5a4678,METADATA_FILE),_0x3dd2c9=contentHash(_0x4e9036),_0x47404d=readMetadataIfPresent(_0x2d9541)?.[_0x4c4057(0x1e6)];ensurePulledFilesCanBeOverwritten(_0x5a4678,_0x2d9541,_0x353d88,_0x1e9a06['force']===!![]),mkdirSync(_0x5a4678,{'recursive':!![],'mode':0x1c0});const _0x59b8ea=existsSync(_0x2ad7c7)?readFileSync(_0x2ad7c7,_0x4c4057(0x1f2)):undefined;return materializeFiles(_0x5a4678,_0x353d88),removeStaleManagedFiles(_0x5a4678,_0x47404d,_0x353d88),writeJsonAtomic(_0x2d9541,buildMetadata(_0x3dc8c7,_0x1878f7,_0x1e9a06[_0x4c4057(0x1c9)],_0x3dd2c9,_0x1e9a06['pulledAt'],_0x353d88,_0xaebe1c)),{'skill':_0x3dc8c7,'scope':_0x1878f7,'dir':_0x5a4678,'skillMdPath':_0x2ad7c7,'metadataPath':_0x2d9541,'contentHash':_0x3dd2c9,'changed':_0x59b8ea!==_0x4e9036};}function a144_0x5593(){const _0x276e94=['length','delete','472baaPIl','match','keys','test','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.','description','join','status','Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20','\x0a---\x0a\x0a','hasOwn','appCode','120gggdhK','19092xclSBk','schemaVersion','1628175cXBYXJ','trim','---','isFile','---\x0a','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','48294dohICm','displayName:\x20','trimEnd','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','693790iOPyrn','4683147XHfJgv','has','example','description:\x20','replace','Runtime\x20Skill\x20package\x20is\x20missing\x20','6xAeYlp','find','contentHash','accessKey','2iEogqR','skillName','slice','version','fileHashes','name','1065640xJECPn','11596lWcIUf','toString','displayName','validation','16680UhHnlR','scope','set','11VzVxIo','env','utf8','path','paths','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','name:\x20','stringify','flow','Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20','filter'];a144_0x5593=function(){return _0x276e94;};return a144_0x5593();}export function reuseMaterializedRuntimeSkill(_0x2d90b0,_0x388ae7,_0x1f9f4d){const _0x29d4a0=a144_0xa471,_0x194034=_0x2d90b0['version']?.[_0x29d4a0(0x1ce)]();if(!_0x194034)return undefined;const _0x219371=requireSkillCode(_0x2d90b0),_0x558a52=getRuntimeSkillDir(_0x1f9f4d['env'],_0x1f9f4d[_0x29d4a0(0x1e1)],_0x1f9f4d[_0x29d4a0(0x1c9)],_0x388ae7,_0x219371,_0x1f9f4d['paths']),_0x461729=resolve(_0x558a52,SKILL_FILE),_0x593cdb=resolve(_0x558a52,METADATA_FILE),_0x5ac551=readMetadataIfPresent(_0x593cdb);if(!_0x5ac551||_0x5ac551[_0x29d4a0(0x1cc)]!==0x2||_0x5ac551[_0x29d4a0(0x1c9)]!==_0x1f9f4d['appCode']||_0x5ac551[_0x29d4a0(0x1ee)]!==_0x388ae7||_0x5ac551['skillCode']!==_0x219371||_0x5ac551[_0x29d4a0(0x1e5)]!==_0x194034||_0x5ac551['id']!==_0x2d90b0['id']||_0x5ac551[_0x29d4a0(0x1e3)]!==_0x2d90b0[_0x29d4a0(0x1e3)]||_0x5ac551['description']!==_0x2d90b0['description']||_0x5ac551[_0x29d4a0(0x1da)]!==_0x2d90b0[_0x29d4a0(0x1da)]||_0x5ac551[_0x29d4a0(0x204)]!==_0x2d90b0[_0x29d4a0(0x204)]||!_0x5ac551[_0x29d4a0(0x1e0)]||!_0x5ac551[_0x29d4a0(0x1e6)]||!Object[_0x29d4a0(0x1c8)](_0x5ac551[_0x29d4a0(0x1e6)],SKILL_FILE))return undefined;for(const [_0x52404d,_0x5eabe9]of Object['entries'](_0x5ac551[_0x29d4a0(0x1e6)])){if(!/^[a-f0-9]{64}$/[_0x29d4a0(0x200)](_0x5eabe9))return undefined;const _0x4e87b9=resolveManagedFilePath(_0x558a52,_0x52404d);if(!existsSync(_0x4e87b9)||!lstatSync(_0x4e87b9)[_0x29d4a0(0x1d0)]())return undefined;if(bufferSha256(readFileSync(_0x4e87b9))!==_0x5eabe9)return undefined;}return{'skill':_0x2d90b0,'scope':_0x388ae7,'dir':_0x558a52,'skillMdPath':_0x461729,'metadataPath':_0x593cdb,'contentHash':_0x5ac551[_0x29d4a0(0x1e0)],'changed':![]};}function withMaterializedSkillFrontmatter(_0x4f6264,_0x1856fb,_0x11a307){const _0x3f331f=a144_0xa471,_0xd47f36=skillDisplayName(_0x1856fb,_0x11a307),_0x120ae7=_0x1856fb['description']?.[_0x3f331f(0x1ce)]()||_0xd47f36||_0x11a307;return normalizeLocalFiles(_0x4f6264)['map'](_0x3c6f26=>{const _0x6296c5=fileText(_0x3c6f26);if(_0x3c6f26['path']!==SKILL_FILE)return _0x3c6f26;if(hasYamlFrontmatter(_0x6296c5))return{'path':_0x3c6f26['path'],'content':withSyncedDisplayName(_0x6296c5,_0xd47f36)};return{'path':_0x3c6f26['path'],'content':prependSkillFrontmatter(_0x6296c5,{'name':_0x11a307,'displayName':_0xd47f36,'description':_0x120ae7})};});}function hasYamlFrontmatter(_0x1ca4ed){const _0x3e3bb2=a144_0xa471;return/^\uFEFF?---\s*\r?\n/[_0x3e3bb2(0x200)](_0x1ca4ed);}function prependSkillFrontmatter(_0x1f7f8f,_0x16f227){const _0xb174e7=a144_0xa471,_0x3fd64c=_0x1f7f8f[_0xb174e7(0x1dc)](/^\uFEFF/,'');return[_0xb174e7(0x1cf),_0xb174e7(0x1f6)+yamlString(_0x16f227[_0xb174e7(0x1e7)]),_0x16f227[_0xb174e7(0x1eb)]?_0xb174e7(0x1d4)+yamlString(_0x16f227['displayName']):undefined,_0xb174e7(0x1db)+yamlString(_0x16f227[_0xb174e7(0x202)]),_0xb174e7(0x1cf),'',_0x3fd64c][_0xb174e7(0x1fa)](_0x347140=>_0x347140!==undefined)[_0xb174e7(0x203)]('\x0a');}function yamlString(_0x2b5b3e){const _0x24ef05=a144_0xa471;return JSON[_0x24ef05(0x1f7)](_0x2b5b3e['replace'](/\r/g,'')[_0x24ef05(0x1ce)]());}function skillDisplayName(_0x141221,_0x4db976){const _0x5660b5=a144_0xa471,_0x41c84b=_0x141221[_0x5660b5(0x1e3)]?.[_0x5660b5(0x1ce)]();return _0x41c84b||_0x4db976;}function withSyncedDisplayName(_0x391b78,_0x2cd503){const _0x4725a7=a144_0xa471,_0x1eb31e=_0x391b78[_0x4725a7(0x1fe)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x1eb31e)return _0x391b78;const _0xaa016e=_0x1eb31e[0x1]??'',_0x1ba58d=_0x1eb31e[0x2]??'',_0x4403bf=parseDocument(_0x1ba58d);if(_0x4403bf['errors'][_0x4725a7(0x1fb)]>0x0||!isMap(_0x4403bf['contents']))return _0x391b78;if(_0x2cd503)_0x4403bf[_0x4725a7(0x1ef)](_0x4725a7(0x1eb),_0x2cd503);else{if(_0x4403bf['has']('displayName'))_0x4403bf[_0x4725a7(0x1fc)](_0x4725a7(0x1eb));else return _0x391b78;}forceBlockCollections(_0x4403bf['contents']);const _0x3d1d77=_0x4403bf[_0x4725a7(0x1ea)]({'lineWidth':0x0})[_0x4725a7(0x1d5)](),_0x17b2d8=_0x391b78[_0x4725a7(0x1e4)](_0x1eb31e[0x0][_0x4725a7(0x1fb)])[_0x4725a7(0x1dc)](/^\r?\n/,'');return _0xaa016e+_0x4725a7(0x1d1)+_0x3d1d77+_0x4725a7(0x1c7)+_0x17b2d8;}function forceBlockCollections(_0x507f49){if(!isNode(_0x507f49))return;visit(_0x507f49,(_0x1f7a18,_0x3e3b7c)=>{const _0x446f37=a144_0xa471;isCollection(_0x3e3b7c)&&(_0x3e3b7c[_0x446f37(0x1f8)]=![]);});}function ensurePulledFilesCanBeOverwritten(_0x560e7a,_0xbddb66,_0x13e349,_0x1a34db){const _0x37b90d=a144_0xa471;if(_0x1a34db||!existsSync(_0xbddb66))return;const _0xb4324c=readMetadataIfPresent(_0xbddb66);if(!_0xb4324c)return;const _0x128567=_0xb4324c[_0x37b90d(0x1e6)]&&Object['keys'](_0xb4324c[_0x37b90d(0x1e6)])[_0x37b90d(0x1fb)]>0x0?_0xb4324c[_0x37b90d(0x1e6)]:undefined;if(_0x128567)for(const [_0x12e9cc,_0x24175d]of Object['entries'](_0x128567)){const _0x43f44b=resolveManagedFilePath(_0x560e7a,_0x12e9cc);if(!existsSync(_0x43f44b))throw CliErrors[_0x37b90d(0x1ec)](_0x37b90d(0x1d6)+_0x560e7a,'Managed\x20file\x20was\x20removed\x20locally:\x20'+_0x12e9cc);const _0x3f385e=lstatSync(_0x43f44b);if(!_0x3f385e[_0x37b90d(0x1d0)]())throw CliErrors['validation'](_0x37b90d(0x1d6)+_0x560e7a,_0x37b90d(0x205)+_0x12e9cc);const _0x2524b3=bufferSha256(readFileSync(_0x43f44b));if(_0x2524b3!==_0x24175d)throw CliErrors['validation'](_0x37b90d(0x1d6)+_0x560e7a+'.\x20Changed\x20file:\x20'+_0x12e9cc,_0x37b90d(0x1d2)+_0x12e9cc);}else{const _0x3c04d4=resolve(_0x560e7a,SKILL_FILE);if(existsSync(_0x3c04d4)&&_0xb4324c['contentHash']){const _0x1f2383=contentHash(readFileSync(_0x3c04d4,_0x37b90d(0x1f2)));if(_0x1f2383!==_0xb4324c[_0x37b90d(0x1e0)])throw CliErrors[_0x37b90d(0x1ec)]('Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20'+_0x3c04d4,_0x37b90d(0x201));}}for(const _0x15090f of normalizeLocalFiles(_0x13e349)){if(_0x128567?.[_0x15090f[_0x37b90d(0x1f3)]])continue;if(!_0x128567&&_0x15090f[_0x37b90d(0x1f3)]===SKILL_FILE)continue;const _0x55dd16=resolveManagedFilePath(_0x560e7a,_0x15090f[_0x37b90d(0x1f3)]);if(!existsSync(_0x55dd16))continue;const _0x52f87d=lstatSync(_0x55dd16);if(!_0x52f87d[_0x37b90d(0x1d0)]())throw CliErrors[_0x37b90d(0x1ec)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x560e7a,_0x37b90d(0x1f5)+_0x15090f['path']);const _0x399289=bufferSha256(readFileSync(_0x55dd16));if(_0x399289!==fileHash(_0x15090f))throw CliErrors[_0x37b90d(0x1ec)](_0x37b90d(0x1d6)+_0x560e7a,_0x37b90d(0x1f9)+_0x15090f[_0x37b90d(0x1f3)]);}}function materializeFiles(_0x483420,_0x5dde1c){const _0x3f4727=a144_0xa471;for(const _0x1d4483 of normalizeLocalFiles(_0x5dde1c)){const _0x456c11=resolveManagedFilePath(_0x483420,_0x1d4483[_0x3f4727(0x1f3)]);mkdirSync(dirname(_0x456c11),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x456c11,fileContent(_0x1d4483),0x180);}}function removeStaleManagedFiles(_0x56ce27,_0x23c003,_0x21bfa4){const _0x376824=a144_0xa471;if(!_0x23c003)return;const _0x1e3cf8=new Set(normalizeLocalFiles(_0x21bfa4)['map'](_0x3880e5=>_0x3880e5[_0x376824(0x1f3)]));for(const _0x37dc4a of Object[_0x376824(0x1ff)](_0x23c003)){if(_0x1e3cf8[_0x376824(0x1d9)](_0x37dc4a))continue;const _0x57663f=resolveManagedFilePath(_0x56ce27,_0x37dc4a);existsSync(_0x57663f)&&lstatSync(_0x57663f)[_0x376824(0x1d0)]()&&rmSync(_0x57663f,{'force':!![]});}}
@@ -1 +1 @@
1
- function a145_0x3d04(_0x78b928,_0x5ad615){_0x78b928=_0x78b928-0x171;const _0x5ad89f=a145_0x5ad8();let _0x3d0465=_0x5ad89f[_0x78b928];return _0x3d0465;}function a145_0x5ad8(){const _0xea11af=['path','files','6irTsxE','5487480Ypgyar','description','userId','parse','tags','fromEntries','trim','validation','1163533BrMdfU','version','skillCode','2UhOOIS','map','1208200lBTnEk','145164xNKnYQ','forkedFromVersion','57259HXpaaz','length','Invalid\x20','zipSha256','1008160ufHaoD','isArray','Runtime\x20Skill\x20is\x20missing\x20skillCode.','utf8','854668QFwCEY','example','readonly','manifest'];a145_0x5ad8=function(){return _0xea11af;};return a145_0x5ad8();}(function(_0x28a34b,_0x3f6001){const _0x4a6704=a145_0x3d04,_0x4da386=_0x28a34b();while(!![]){try{const _0x56ae75=-parseInt(_0x4a6704(0x18b))/0x1*(parseInt(_0x4a6704(0x186))/0x2)+parseInt(_0x4a6704(0x189))/0x3+parseInt(_0x4a6704(0x174))/0x4+parseInt(_0x4a6704(0x18f))/0x5+-parseInt(_0x4a6704(0x17a))/0x6*(-parseInt(_0x4a6704(0x183))/0x7)+parseInt(_0x4a6704(0x188))/0x8+-parseInt(_0x4a6704(0x17b))/0x9;if(_0x56ae75===_0x3f6001)break;else _0x4da386['push'](_0x4da386['shift']());}catch(_0xdaaf25){_0x4da386['push'](_0x4da386['shift']());}}}(a145_0x5ad8,0x1bd20));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(_0x14c7c1,_0x5684c2,_0x2bb11d,_0x540bc6,_0x1c787d,_0x1d5e4e,_0x8fe5d9){const _0x24a7eb=a145_0x3d04,_0x2acffa=_0x1d5e4e?normalizeLocalFiles(_0x1d5e4e):[],_0x2b92c0=!_0x8fe5d9&&_0x2acffa[_0x24a7eb(0x18c)]>0x0?buildSkillPackage(_0x2acffa):undefined,_0x1e934a=_0x8fe5d9?bufferSha256(_0x8fe5d9):_0x2b92c0?.['manifest'][_0x24a7eb(0x18e)],_0x11df0e=_0x8fe5d9?.['length']??_0x2b92c0?.[_0x24a7eb(0x177)]['zipSize'],_0x73e35=_0x2acffa[_0x24a7eb(0x18c)]>0x0?Object[_0x24a7eb(0x180)](_0x2acffa[_0x24a7eb(0x187)](_0x5daabf=>[_0x5daabf[_0x24a7eb(0x178)],fileHash(_0x5daabf)])):undefined;return{'schemaVersion':_0x2acffa[_0x24a7eb(0x18c)]>0x0?0x2:0x1,'id':_0x14c7c1['id'],'appCode':_0x2bb11d,'skillCode':requireSkillCode(_0x14c7c1),'skillName':_0x14c7c1['skillName'],'description':_0x14c7c1[_0x24a7eb(0x17c)],'example':_0x14c7c1[_0x24a7eb(0x175)],'scope':_0x5684c2,'readonly':_0x5684c2!=='personal'||_0x14c7c1[_0x24a7eb(0x176)]===!![],'tenantCode':_0x14c7c1['tenantCode'],'userId':_0x14c7c1[_0x24a7eb(0x17d)],'version':_0x14c7c1[_0x24a7eb(0x184)],'status':_0x14c7c1['status'],'tags':Array[_0x24a7eb(0x171)](_0x14c7c1[_0x24a7eb(0x17f)])?_0x14c7c1['tags']:[],'hasUpstreamUpdate':_0x14c7c1['hasUpstreamUpdate'],'forkedFromSkillId':_0x14c7c1['forkedFromSkillId'],'forkedFromVersion':_0x14c7c1[_0x24a7eb(0x18a)],'sourceSessionId':_0x14c7c1['sourceSessionId'],'contentHash':_0x540bc6,'fileHashes':_0x73e35,'treeHash':_0x2acffa[_0x24a7eb(0x18c)]>0x0?fileTreeHash(localFilesToManifestFiles(_0x2acffa)):undefined,'ossPath':remoteManifestOssPath(_0x14c7c1[_0x24a7eb(0x179)]),'zipSha256':_0x1e934a,'zipSize':_0x11df0e,'files':_0x2acffa[_0x24a7eb(0x18c)]>0x0?_0x2acffa[_0x24a7eb(0x187)](_0x5352fc=>({'path':_0x5352fc[_0x24a7eb(0x178)],'hash':fileHash(_0x5352fc),'size':fileContent(_0x5352fc)[_0x24a7eb(0x18c)]})):undefined,'pulledAt':_0x1c787d??new Date()['toISOString']()};}export function requireSkillCode(_0x316dd8){const _0x5b3943=a145_0x3d04,_0x3bd2d9=_0x316dd8[_0x5b3943(0x185)]?.[_0x5b3943(0x181)]();if(!_0x3bd2d9)throw CliErrors['validation'](_0x5b3943(0x172));return _0x3bd2d9;}export function readMetadataIfPresent(_0xa781ca){const _0x45315c=a145_0x3d04;if(!existsSync(_0xa781ca))return undefined;try{const _0x1c983=JSON[_0x45315c(0x17e)](readFileSync(_0xa781ca,_0x45315c(0x173)));return _0x1c983;}catch{throw CliErrors[_0x45315c(0x182)](_0x45315c(0x18d)+METADATA_FILE+':\x20'+_0xa781ca);}}function remoteManifestOssPath(_0x476e61){const _0x41aab2=a145_0x3d04;if(!_0x476e61||typeof _0x476e61!=='object'||Array[_0x41aab2(0x171)](_0x476e61))return undefined;const _0x1a52be=_0x476e61['ossPath'];return typeof _0x1a52be==='string'&&_0x1a52be[_0x41aab2(0x181)]()?_0x1a52be[_0x41aab2(0x181)]():undefined;}
1
+ (function(_0x41bd4e,_0x34908e){const _0x41f131=a145_0x136d,_0xcf678=_0x41bd4e();while(!![]){try{const _0xb087a4=parseInt(_0x41f131(0x95))/0x1+-parseInt(_0x41f131(0x9b))/0x2*(-parseInt(_0x41f131(0x8c))/0x3)+parseInt(_0x41f131(0x7b))/0x4+parseInt(_0x41f131(0x7d))/0x5*(-parseInt(_0x41f131(0x8e))/0x6)+parseInt(_0x41f131(0x94))/0x7*(-parseInt(_0x41f131(0x92))/0x8)+parseInt(_0x41f131(0x85))/0x9*(parseInt(_0x41f131(0x79))/0xa)+-parseInt(_0x41f131(0x8b))/0xb;if(_0xb087a4===_0x34908e)break;else _0xcf678['push'](_0xcf678['shift']());}catch(_0x1372ce){_0xcf678['push'](_0xcf678['shift']());}}}(a145_0x46b2,0x51258));function a145_0x136d(_0x2e73e3,_0x5193b5){_0x2e73e3=_0x2e73e3-0x79;const _0x46b291=a145_0x46b2();let _0x136d2f=_0x46b291[_0x2e73e3];return _0x136d2f;}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(_0x5dffb3,_0x1b9920,_0x3dac3e,_0x4381c0,_0x144fa4,_0x540895,_0xd96d06){const _0x10f67a=a145_0x136d,_0x5ce160=_0x540895?normalizeLocalFiles(_0x540895):[],_0x232718=!_0xd96d06&&_0x5ce160[_0x10f67a(0x83)]>0x0?buildSkillPackage(_0x5ce160):undefined,_0x48bb15=_0xd96d06?bufferSha256(_0xd96d06):_0x232718?.[_0x10f67a(0x80)][_0x10f67a(0x82)],_0x5241c9=_0xd96d06?.['length']??_0x232718?.[_0x10f67a(0x80)][_0x10f67a(0x84)],_0x5107ea=_0x5ce160[_0x10f67a(0x83)]>0x0?Object[_0x10f67a(0x87)](_0x5ce160[_0x10f67a(0x8a)](_0x1eee29=>[_0x1eee29[_0x10f67a(0x8f)],fileHash(_0x1eee29)])):undefined;return{'schemaVersion':_0x5ce160['length']>0x0?0x2:0x1,'id':_0x5dffb3['id'],'appCode':_0x3dac3e,'skillCode':requireSkillCode(_0x5dffb3),'skillName':_0x5dffb3[_0x10f67a(0x89)],'description':_0x5dffb3['description'],'example':_0x5dffb3[_0x10f67a(0x81)],'scope':_0x1b9920,'readonly':_0x1b9920!==_0x10f67a(0x93)||_0x5dffb3[_0x10f67a(0x8d)]===!![],'tenantCode':_0x5dffb3[_0x10f67a(0x86)],'userId':_0x5dffb3['userId'],'version':_0x5dffb3[_0x10f67a(0x99)],'status':_0x5dffb3[_0x10f67a(0x7f)],'tags':Array[_0x10f67a(0x96)](_0x5dffb3['tags'])?_0x5dffb3[_0x10f67a(0x7c)]:[],'hasUpstreamUpdate':_0x5dffb3['hasUpstreamUpdate'],'forkedFromSkillId':_0x5dffb3['forkedFromSkillId'],'forkedFromVersion':_0x5dffb3['forkedFromVersion'],'sourceSessionId':_0x5dffb3[_0x10f67a(0x7e)],'contentHash':_0x4381c0,'fileHashes':_0x5107ea,'treeHash':_0x5ce160[_0x10f67a(0x83)]>0x0?fileTreeHash(localFilesToManifestFiles(_0x5ce160)):undefined,'ossPath':remoteManifestOssPath(_0x5dffb3['files']),'zipSha256':_0x48bb15,'zipSize':_0x5241c9,'files':_0x5ce160[_0x10f67a(0x83)]>0x0?_0x5ce160[_0x10f67a(0x8a)](_0x126a40=>({'path':_0x126a40[_0x10f67a(0x8f)],'hash':fileHash(_0x126a40),'size':fileContent(_0x126a40)['length']})):undefined,'pulledAt':_0x144fa4??new Date()['toISOString']()};}function a145_0x46b2(){const _0x20b168=['203fPCQpg','268754ddynVi','isArray','utf8','trim','version','validation','167306NMsGSp','1090EUNovR','object','2619104vvCrNQ','tags','15pYBntX','sourceSessionId','status','manifest','example','zipSha256','length','zipSize','13491eqSDBy','tenantCode','fromEntries','ossPath','skillName','map','6657761UttTOV','18SDWZnX','readonly','17202OnMuIi','path','Invalid\x20','string','177272MFsCFz','personal'];a145_0x46b2=function(){return _0x20b168;};return a145_0x46b2();}export function requireSkillCode(_0x38a278){const _0x5e01b2=a145_0x136d,_0x19359e=_0x38a278['skillCode']?.['trim']();if(!_0x19359e)throw CliErrors[_0x5e01b2(0x9a)]('Runtime\x20Skill\x20is\x20missing\x20skillCode.');return _0x19359e;}export function readMetadataIfPresent(_0x5e6fc4){const _0x84b284=a145_0x136d;if(!existsSync(_0x5e6fc4))return undefined;try{const _0x24ba58=JSON['parse'](readFileSync(_0x5e6fc4,_0x84b284(0x97)));return _0x24ba58;}catch{throw CliErrors[_0x84b284(0x9a)](_0x84b284(0x90)+METADATA_FILE+':\x20'+_0x5e6fc4);}}function remoteManifestOssPath(_0x591209){const _0x1f6736=a145_0x136d;if(!_0x591209||typeof _0x591209!==_0x1f6736(0x7a)||Array[_0x1f6736(0x96)](_0x591209))return undefined;const _0x28e4f8=_0x591209[_0x1f6736(0x88)];return typeof _0x28e4f8===_0x1f6736(0x91)&&_0x28e4f8['trim']()?_0x28e4f8[_0x1f6736(0x98)]():undefined;}
@@ -1 +1 @@
1
- const a146_0x3eac2e=a146_0x14a6;(function(_0x3e33eb,_0x159827){const _0x4d45a1=a146_0x14a6,_0x968a02=_0x3e33eb();while(!![]){try{const _0x4bb774=-parseInt(_0x4d45a1(0x6f))/0x1+-parseInt(_0x4d45a1(0x74))/0x2*(parseInt(_0x4d45a1(0x6b))/0x3)+parseInt(_0x4d45a1(0x67))/0x4*(-parseInt(_0x4d45a1(0x77))/0x5)+parseInt(_0x4d45a1(0x79))/0x6*(-parseInt(_0x4d45a1(0x7d))/0x7)+parseInt(_0x4d45a1(0x71))/0x8*(parseInt(_0x4d45a1(0x6e))/0x9)+-parseInt(_0x4d45a1(0x6c))/0xa*(-parseInt(_0x4d45a1(0x75))/0xb)+parseInt(_0x4d45a1(0x6d))/0xc;if(_0x4bb774===_0x159827)break;else _0x968a02['push'](_0x968a02['shift']());}catch(_0x3e9bf1){_0x968a02['push'](_0x968a02['shift']());}}}(a146_0x2e24,0x24f42));import{existsSync}from'node:fs';import{homedir}from'node:os';import{resolve}from'node:path';import{fingerprintAccessKey}from'../../commands/app/cache.js';import{PRODUCT_CONFIG,productEnv}from'../../constant/product.js';import{CliErrors}from'../../errors.js';export function resolveSkillSyncPaths(_0x57c9b6={}){const _0x3c1ba7=a146_0x14a6,_0x11c3cf=_0x57c9b6[_0x3c1ba7(0x84)]??homedir(),_0x3e885e=resolve(_0x11c3cf,PRODUCT_CONFIG[_0x3c1ba7(0x7f)],_0x3c1ba7(0x6a)),_0x570ec3=trimmedEnv(_0x3c1ba7(0x69)),_0x426685=trimmedEnv(_0x3c1ba7(0x72)),_0x283b8d=resolve(_0x11c3cf,_0x3c1ba7(0x68)),_0x4be05f=_0x57c9b6[_0x3c1ba7(0x7e)]??(existsSync(_0x283b8d)?resolve(_0x283b8d,_0x3c1ba7(0x78)):undefined);return{'homeDir':_0x11c3cf,'cacheRoot':_0x3e885e,'managedRoot':resolve(_0x11c3cf,PRODUCT_CONFIG[_0x3c1ba7(0x7f)]),'agentsSkillsDir':_0x57c9b6[_0x3c1ba7(0x73)]??_0x570ec3??resolve(_0x11c3cf,_0x3c1ba7(0x7c),_0x3c1ba7(0x78)),'claudeSkillsDir':_0x57c9b6[_0x3c1ba7(0x65)]??_0x426685??resolve(_0x11c3cf,_0x3c1ba7(0x7b),_0x3c1ba7(0x78)),'workbuddySkillsDir':_0x4be05f};}function a146_0x2e24(){const _0x30c21d=['includes','filter','appCode','\x20for\x20local\x20path:\x20','homeDir','cacheRoot','claudeSkillsDir','validation','172weyDwg','.workbuddy','SKILL_ROOT','cache','3rNCiHY','2813410IzOaIc','2348688vlWGxQ','45mYPaBe','286961BRMgSM','trim','446024ssulJN','CLAUDE_SKILL_ROOT','agentsSkillsDir','183574prdqKs','11Rhvabd','path\x20segment','8105roxYvT','skills','534LuqQMK','Unsafe\x20','.claude','.agents','12271Fezngk','workbuddySkillsDir','homeDirName'];a146_0x2e24=function(){return _0x30c21d;};return a146_0x2e24();}export function runtimeAgentSkillRoots(_0x388077){const _0x130bc7=a146_0x14a6;return[_0x388077[_0x130bc7(0x73)],_0x388077[_0x130bc7(0x65)],_0x388077[_0x130bc7(0x7e)]][_0x130bc7(0x81)](_0x207172=>Boolean(_0x207172));}export function getRuntimeSkillCacheRoot(_0x1dd95b,_0x1d1943,_0x529071={}){const _0xa7ba95=a146_0x14a6,_0x16bad7=resolveSkillSyncPaths(_0x529071);return resolve(_0x16bad7[_0xa7ba95(0x64)],_0x1dd95b,fingerprintAccessKey(_0x1d1943),'skills');}export function getRuntimeSkillDir(_0x25ee78,_0x316975,_0x3feed4,_0x46e768,_0x210de6,_0x28ba4d={}){const _0x11264c=a146_0x14a6;return resolve(getRuntimeSkillCacheRoot(_0x25ee78,_0x316975,_0x28ba4d),safePathSegment(_0x3feed4,_0x11264c(0x82)),_0x46e768,safePathSegment(_0x210de6,'skillCode'));}function a146_0x14a6(_0x3d9ce7,_0x38508c){_0x3d9ce7=_0x3d9ce7-0x64;const _0x2e2493=a146_0x2e24();let _0x14a648=_0x2e2493[_0x3d9ce7];return _0x14a648;}export function safePathSegment(_0x289cee,_0x34fa1f=a146_0x3eac2e(0x76)){const _0x1e4a21=a146_0x3eac2e;if(!_0x289cee||_0x289cee[_0x1e4a21(0x80)]('/')||_0x289cee[_0x1e4a21(0x80)]('\x5c')||_0x289cee[_0x1e4a21(0x80)]('..'))throw CliErrors[_0x1e4a21(0x66)](_0x1e4a21(0x7a)+_0x34fa1f+_0x1e4a21(0x83)+_0x289cee);return _0x289cee;}function trimmedEnv(_0x2b2f11){const _0x27c2a1=a146_0x3eac2e,_0x7ebf1e=productEnv(_0x2b2f11)?.[_0x27c2a1(0x70)]();return _0x7ebf1e?_0x7ebf1e:undefined;}
1
+ function a146_0x3633(_0x2fe6f8,_0x56bff6){_0x2fe6f8=_0x2fe6f8-0x1d3;const _0x22776c=a146_0x2277();let _0x36339b=_0x22776c[_0x2fe6f8];return _0x36339b;}const a146_0x5cde96=a146_0x3633;(function(_0x14bb8d,_0x371f7c){const _0x3d1a3e=a146_0x3633,_0xf9a705=_0x14bb8d();while(!![]){try{const _0x4483b7=-parseInt(_0x3d1a3e(0x1e2))/0x1*(parseInt(_0x3d1a3e(0x1e7))/0x2)+parseInt(_0x3d1a3e(0x1d8))/0x3*(-parseInt(_0x3d1a3e(0x1d7))/0x4)+-parseInt(_0x3d1a3e(0x1d3))/0x5+parseInt(_0x3d1a3e(0x1eb))/0x6*(parseInt(_0x3d1a3e(0x1d5))/0x7)+-parseInt(_0x3d1a3e(0x1e5))/0x8*(parseInt(_0x3d1a3e(0x1e0))/0x9)+-parseInt(_0x3d1a3e(0x1e4))/0xa+-parseInt(_0x3d1a3e(0x1ea))/0xb*(-parseInt(_0x3d1a3e(0x1ec))/0xc);if(_0x4483b7===_0x371f7c)break;else _0xf9a705['push'](_0xf9a705['shift']());}catch(_0x5a573d){_0xf9a705['push'](_0xf9a705['shift']());}}}(a146_0x2277,0x8e68a));import{existsSync}from'node:fs';import{homedir}from'node:os';import{resolve}from'node:path';import{fingerprintAccessKey}from'../../commands/app/cache.js';import{PRODUCT_CONFIG,productEnv}from'../../constant/product.js';import{CliErrors}from'../../errors.js';export function resolveSkillSyncPaths(_0x407b78={}){const _0x12cdcb=a146_0x3633,_0x32981b=_0x407b78['homeDir']??homedir(),_0x4479d5=resolve(_0x32981b,PRODUCT_CONFIG['homeDirName'],_0x12cdcb(0x1e8)),_0x416286=trimmedEnv(_0x12cdcb(0x1e1)),_0x42db33=trimmedEnv(_0x12cdcb(0x1ed)),_0x66f40d=resolve(_0x32981b,_0x12cdcb(0x1d4)),_0x5a5c9d=_0x407b78['workbuddySkillsDir']??(existsSync(_0x66f40d)?resolve(_0x66f40d,_0x12cdcb(0x1e3)):undefined);return{'homeDir':_0x32981b,'cacheRoot':_0x4479d5,'managedRoot':resolve(_0x32981b,PRODUCT_CONFIG['homeDirName']),'agentsSkillsDir':_0x407b78[_0x12cdcb(0x1e6)]??_0x416286??resolve(_0x32981b,_0x12cdcb(0x1ee),_0x12cdcb(0x1e3)),'claudeSkillsDir':_0x407b78[_0x12cdcb(0x1df)]??_0x42db33??resolve(_0x32981b,'.claude',_0x12cdcb(0x1e3)),'workbuddySkillsDir':_0x5a5c9d};}export function runtimeAgentSkillRoots(_0x37abe3){const _0x18ae21=a146_0x3633;return[_0x37abe3[_0x18ae21(0x1e6)],_0x37abe3[_0x18ae21(0x1df)],_0x37abe3['workbuddySkillsDir']][_0x18ae21(0x1de)](_0x165287=>Boolean(_0x165287));}export function getRuntimeSkillCacheRoot(_0x3ddbdf,_0x5aba17,_0x55745d={}){const _0x368a30=a146_0x3633,_0x21d7f1=resolveSkillSyncPaths(_0x55745d);return resolve(_0x21d7f1[_0x368a30(0x1dd)],_0x3ddbdf,fingerprintAccessKey(_0x5aba17),_0x368a30(0x1e3));}function a146_0x2277(){const _0x2670e0=['4tQmHiA','cache','\x20for\x20local\x20path:\x20','11giKrNL','240282jWvXOt','51210060hOFTBD','CLAUDE_SKILL_ROOT','.agents','4299280BEzCaw','.workbuddy','35vbIQlG','skillCode','4kSSatl','2352471NWnGVM','Unsafe\x20','includes','trim','path\x20segment','cacheRoot','filter','claudeSkillsDir','4272165eLyQjQ','SKILL_ROOT','182353FYdrOw','skills','9263450ipSAlx','16GaNLZW','agentsSkillsDir'];a146_0x2277=function(){return _0x2670e0;};return a146_0x2277();}export function getRuntimeSkillDir(_0x184a18,_0x5ff848,_0x11e56e,_0x1d1fba,_0x36b9ee,_0x5c6f70={}){const _0x1e1091=a146_0x3633;return resolve(getRuntimeSkillCacheRoot(_0x184a18,_0x5ff848,_0x5c6f70),safePathSegment(_0x11e56e,'appCode'),_0x1d1fba,safePathSegment(_0x36b9ee,_0x1e1091(0x1d6)));}export function safePathSegment(_0x3d28f2,_0x2a9fbc=a146_0x5cde96(0x1dc)){const _0x38c43d=a146_0x5cde96;if(!_0x3d28f2||_0x3d28f2[_0x38c43d(0x1da)]('/')||_0x3d28f2[_0x38c43d(0x1da)]('\x5c')||_0x3d28f2[_0x38c43d(0x1da)]('..'))throw CliErrors['validation'](_0x38c43d(0x1d9)+_0x2a9fbc+_0x38c43d(0x1e9)+_0x3d28f2);return _0x3d28f2;}function trimmedEnv(_0x40c3ed){const _0x58d3e2=a146_0x5cde96,_0x4a8a1e=productEnv(_0x40c3ed)?.[_0x58d3e2(0x1db)]();return _0x4a8a1e?_0x4a8a1e:undefined;}
@@ -1 +1 @@
1
- (function(_0x3646a0,_0x56b5f6){const _0x253b33=a147_0x3bb5,_0x29e706=_0x3646a0();while(!![]){try{const _0x592c09=parseInt(_0x253b33(0xe7))/0x1+parseInt(_0x253b33(0xcb))/0x2*(parseInt(_0x253b33(0xbb))/0x3)+parseInt(_0x253b33(0xd6))/0x4+-parseInt(_0x253b33(0xb5))/0x5*(parseInt(_0x253b33(0xd1))/0x6)+-parseInt(_0x253b33(0xe2))/0x7+-parseInt(_0x253b33(0xd2))/0x8*(parseInt(_0x253b33(0xb2))/0x9)+parseInt(_0x253b33(0xcc))/0xa;if(_0x592c09===_0x56b5f6)break;else _0x29e706['push'](_0x29e706['shift']());}catch(_0x3f5db2){_0x29e706['push'](_0x29e706['shift']());}}}(a147_0x536e,0xa1844));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';function a147_0x536e(){const _0x5f4234=['5382fgZMxq','skillName','manifest','755zpSDrP','find','(unknown)','object','description','trim','376590hKFJXw','ignoreMetadataAppCodeMismatch','sourceSessionId','isSymbolicLink','\x20to\x20submit\x20company\x20Skills\x20for\x20review.','name','isFile','number','displayName','\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22','allowAppCodeRetarget','path','ignoreMetadataScope','Remote\x20Skill\x20','tags','match','2NFROoA','12136120vWaUHo','replace','validation','refreshedAt','scope','30330KGJFPs','976AiHTmL','Missing\x20','slice','toLowerCase','244400hPjmgP','targetScope','isDirectory','Invalid\x20','content','boolean','utf8','files','ignoreInvalidMetadata',',\x20or\x20directory\x20name.','\x20has\x20scope=\x22','\x20name\x20for\x20SkillHub\x20slug\x20generation.','657832TmPthT','example','builtin','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20','some','191567dnQQGi','personal','filter','skillCode','Unable\x20to\x20resolve\x20skillCode\x20from\x20','pushedAt','metadata','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20','Skill\x20directory\x20not\x20found:\x20','length','appCode','unknown'];a147_0x536e=function(){return _0x5f4234;};return a147_0x536e();}import{parse as a147_0x4c8feb}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(_0x4d8440,_0x532ae5,_0x141ebb={}){const _0x48aa86=a147_0x3bb5,_0x692798=resolvePushDirectoryRoot(_0x4d8440),_0x16f304=readPushMetadataIfPresent(resolve(_0x692798,METADATA_FILE),{'ignoreInvalidMetadata':_0x141ebb[_0x48aa86(0xde)]});if(_0x16f304?.['appCode']&&_0x16f304[_0x48aa86(0xb0)]!==_0x532ae5&&!_0x141ebb[_0x48aa86(0xc5)]&&!_0x141ebb[_0x48aa86(0xbc)])throw CliErrors['validation']('Skill\x20metadata\x20appCode\x20\x22'+_0x16f304[_0x48aa86(0xb0)]+_0x48aa86(0xc4)+_0x532ae5+'\x22.');const _0x4dceb6=resolvePushSkillCode(_0x692798,_0x532ae5,_0x16f304,_0x141ebb);if(!_0x4dceb6)throw CliErrors[_0x48aa86(0xce)](_0x48aa86(0xaa)+SKILL_FILE+',\x20'+METADATA_FILE+_0x48aa86(0xdf));return{'dir':_0x692798,'skillCode':_0x4dceb6,'metadata':_0x16f304};}export function readPushDirectory(_0x3ef825,_0x553f5b,_0x2370de={}){const _0x171793=a147_0x3bb5,_0x2c76da=resolvePushDirectoryIdentity(_0x3ef825,_0x553f5b,_0x2370de),_0x103a76=_0x2c76da['dir'],_0x3f58d6=resolve(_0x103a76,SKILL_FILE);if(!existsSync(_0x3f58d6)||!lstatSync(_0x3f58d6)['isFile']())throw CliErrors[_0x171793(0xce)](_0x171793(0xd3)+SKILL_FILE+':\x20'+_0x3f58d6);const _0xdc6aea=_0x2c76da[_0x171793(0xac)],_0x13febe=_0x2370de[_0x171793(0xd7)]??_0x171793(0xe8);if(!_0x2370de[_0x171793(0xc7)]&&_0xdc6aea?.[_0x171793(0xd0)]===_0x171793(0xe4))throw CliErrors[_0x171793(0xce)]('Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20'+METADATA_FILE+_0x171793(0xe0)+_0xdc6aea['scope']+'\x22.');if(!_0x2370de[_0x171793(0xc7)]&&_0x13febe===_0x171793(0xe8)&&_0xdc6aea?.[_0x171793(0xd0)]&&_0xdc6aea[_0x171793(0xd0)]!=='personal')throw CliErrors['validation'](_0x171793(0xe5)+METADATA_FILE+_0x171793(0xe0)+_0xdc6aea[_0x171793(0xd0)]+'\x22.',_0x171793(0xad)+_0x103a76+_0x171793(0xbf));const _0x2827ae=scanSkillDirectory(_0x103a76,{'excludedFilePaths':_0x2370de['excludedFilePaths']}),_0x54d1bf=buildSkillPackage(_0x2827ae),_0x1f28af=readFileSync(_0x3f58d6,_0x171793(0xdc)),_0x42e041=_0x2c76da[_0x171793(0xea)],_0x59da92=_0x2370de['ignoreMetadataForPayload']?undefined:_0xdc6aea,_0x3cf13c=readSkillDisplayName(_0x1f28af);return{'skillCode':_0x42e041,'metadata':_0xdc6aea,'frontmatterDisplayName':_0x3cf13c,'input':{'skillCode':_0x42e041,'skillName':_0x3cf13c??_0x59da92?.[_0x171793(0xb3)],'description':_0x59da92?.[_0x171793(0xb9)],'content':_0x1f28af,'files':_0x54d1bf[_0x171793(0xb4)],'packageBase64':_0x54d1bf['packageBase64'],'tags':_0x59da92?.[_0x171793(0xc9)],'version':_0x59da92?.['version'],'sourceSessionId':_0x59da92?.[_0x171793(0xbd)]}};}export function refreshPushDirectoryMetadataFromRemote(_0x58c35f,_0x4f1d86,_0x1e5548,_0x5b5b4f={}){const _0x371a83=a147_0x3bb5,_0x1bdb79=resolvePushDirectoryRoot(_0x58c35f),_0x6d4a4b=readPushMetadataIfPresent(resolve(_0x1bdb79,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x16de1d=requireRemoteScope(_0x4f1d86),_0x1cdc74=readLocalSkillContent(_0x1bdb79),_0x5e80c7={..._0x4f1d86,'appCode':_0x4f1d86[_0x371a83(0xb0)]??_0x1e5548,'skillName':_0x4f1d86[_0x371a83(0xb3)]??_0x6d4a4b?.[_0x371a83(0xb3)],'description':_0x4f1d86[_0x371a83(0xb9)]??_0x6d4a4b?.[_0x371a83(0xb9)],'example':_0x4f1d86[_0x371a83(0xe3)]??_0x6d4a4b?.[_0x371a83(0xe3)],'tags':Array['isArray'](_0x4f1d86[_0x371a83(0xc9)])?_0x4f1d86[_0x371a83(0xc9)]:_0x6d4a4b?.[_0x371a83(0xc9)],'sourceSessionId':_0x4f1d86['sourceSessionId']??_0x6d4a4b?.[_0x371a83(0xbd)],'content':_0x4f1d86[_0x371a83(0xda)]??_0x1cdc74},_0x22b53f=buildMetadata(_0x5e80c7,_0x16de1d,_0x1e5548,contentHash(_0x1cdc74),_0x5b5b4f[_0x371a83(0xcf)]);writeJsonAtomic(resolve(_0x1bdb79,METADATA_FILE),_0x22b53f);}export function recordPushedRuntimeSkill(_0x52f6f6,_0x23f540,_0x34da81,_0x554ed5={}){const _0x584cf4=a147_0x3bb5,_0x1e3f9d=resolvePushDirectoryRoot(_0x52f6f6),_0x15f8e5=scanSkillDirectory(_0x1e3f9d),_0x23329e=_0x15f8e5[_0x584cf4(0xb6)](_0x5bc337=>_0x5bc337['path']===SKILL_FILE),_0x429b81=_0x23329e?fileText(_0x23329e):'',_0x4b6bff=tryNormalizePackageManifest(_0x23f540[_0x584cf4(0xdd)]),_0x35fc9b={..._0x23f540,'content':_0x23f540[_0x584cf4(0xda)]??_0x429b81,'files':_0x4b6bff},_0x37b2e9=_0x4b6bff?normalizeLocalFiles(_0x15f8e5)[_0x584cf4(0xe9)](_0x4aa1cf=>_0x4b6bff[_0x584cf4(0xdd)][_0x584cf4(0xe6)](_0x389f1d=>_0x389f1d[_0x584cf4(0xc6)]===_0x4aa1cf[_0x584cf4(0xc6)])):undefined,_0x51c9fa=buildMetadata(_0x35fc9b,_0x554ed5[_0x584cf4(0xd0)]??_0x584cf4(0xe8),_0x34da81,contentHash(_0x35fc9b['content']??''),_0x554ed5[_0x584cf4(0xab)],_0x37b2e9);writeJsonAtomic(resolve(_0x1e3f9d,METADATA_FILE),_0x51c9fa);}function a147_0x3bb5(_0x2219b1,_0x4a040b){_0x2219b1=_0x2219b1-0xaa;const _0x536e3f=a147_0x536e();let _0x3bb593=_0x536e3f[_0x2219b1];return _0x3bb593;}export function deriveSkillCodeFromDirectory(_0x44ac6c,_0x34da43){const _0x1b4804=a147_0x3bb5,_0x3d27c5=basename(resolve(_0x44ac6c)),_0x8ea4f1=_0x34da43+'--';return _0x3d27c5['startsWith'](_0x8ea4f1)?_0x3d27c5[_0x1b4804(0xd4)](_0x8ea4f1[_0x1b4804(0xaf)]):_0x3d27c5;}function resolvePushSkillCode(_0x36820f,_0x2469b4,_0x527ae8,_0x213b6b){const _0xc07822=a147_0x3bb5,_0x1c0c20=deriveSkillCodeFromSkillFile(_0x36820f)||deriveSkillCodeFromDirectory(_0x36820f,_0x2469b4);if(_0x213b6b['ignoreMetadataSkillCode'])return _0x1c0c20;return _0x527ae8?.[_0xc07822(0xea)]?.[_0xc07822(0xba)]()||_0x1c0c20;}function deriveSkillCodeFromSkillFile(_0x17b968){const _0x23e8ff=a147_0x3bb5,_0x6077b0=resolve(_0x17b968,SKILL_FILE);if(!existsSync(_0x6077b0)||!lstatSync(_0x6077b0)[_0x23e8ff(0xc1)]())return undefined;const _0x473c4a=readFileSync(_0x6077b0,_0x23e8ff(0xdc)),_0x299191=_0x473c4a[_0x23e8ff(0xca)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x299191)return undefined;const _0x372ae6=parseFrontmatterObject(_0x299191[0x1]??''),_0x26f06f=scalarToString(_0x372ae6?.[_0x23e8ff(0xc0)]);return _0x26f06f?slugifySkillName(_0x26f06f):undefined;}function readSkillDisplayName(_0x11e057){const _0xd711bf=a147_0x3bb5,_0x41d545=_0x11e057[_0xd711bf(0xca)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x41d545)return undefined;const _0x216b27=parseFrontmatterObject(_0x41d545[0x1]??'');return scalarToString(_0x216b27?.[_0xd711bf(0xc3)]);}function slugifySkillName(_0xb7eb1a){const _0x2b6d65=a147_0x3bb5,_0x58d4cf=_0xb7eb1a[_0x2b6d65(0xba)]()[_0x2b6d65(0xd5)]()[_0x2b6d65(0xcd)](/[^\p{L}\p{N}\p{So}]+/gu,'-')[_0x2b6d65(0xcd)](/^-+/,'')[_0x2b6d65(0xcd)](/-+$/,'')[_0x2b6d65(0xcd)](/-{2,}/g,'-');if(!_0x58d4cf)throw CliErrors[_0x2b6d65(0xce)](_0x2b6d65(0xd9)+SKILL_FILE+_0x2b6d65(0xe1));return _0x58d4cf;}function parseFrontmatterObject(_0x4ff298){const _0x2fab6c=a147_0x3bb5;try{const _0x181d89=a147_0x4c8feb(_0x4ff298);return _0x181d89&&typeof _0x181d89===_0x2fab6c(0xb8)&&!Array['isArray'](_0x181d89)?_0x181d89:undefined;}catch{return undefined;}}function scalarToString(_0x360b56){const _0x51d650=a147_0x3bb5;if(typeof _0x360b56==='string')return _0x360b56[_0x51d650(0xba)]();if(typeof _0x360b56===_0x51d650(0xc2)||typeof _0x360b56===_0x51d650(0xdb))return String(_0x360b56);return undefined;}function resolvePushDirectoryRoot(_0x1ce1b1){const _0x457d06=a147_0x3bb5,_0x24fece=resolve(_0x1ce1b1);if(!existsSync(_0x24fece))throw CliErrors[_0x457d06(0xce)](_0x457d06(0xae)+_0x1ce1b1);const _0x247a7d=lstatSync(_0x24fece);if(_0x247a7d['isDirectory']())return _0x24fece;if(_0x247a7d[_0x457d06(0xbe)]()){const _0x55e24a=realpathSync(_0x24fece);if(lstatSync(_0x55e24a)[_0x457d06(0xd8)]())return _0x55e24a;}throw CliErrors[_0x457d06(0xce)](_0x457d06(0xae)+_0x1ce1b1);}function requireRemoteScope(_0x3e7198){const _0x26ec78=a147_0x3bb5;if(_0x3e7198[_0x26ec78(0xd0)]===_0x26ec78(0xe8)||_0x3e7198['scope']==='company'||_0x3e7198[_0x26ec78(0xd0)]===_0x26ec78(0xe4))return _0x3e7198[_0x26ec78(0xd0)];throw CliErrors['validation'](_0x26ec78(0xc8)+(_0x3e7198[_0x26ec78(0xea)]||_0x26ec78(0xb7))+'\x20has\x20unsupported\x20scope\x20\x22'+(_0x3e7198['scope']??_0x26ec78(0xb1))+'\x22.');}function readLocalSkillContent(_0x238f32){const _0x5c34c0=a147_0x3bb5,_0x1733bb=resolve(_0x238f32,SKILL_FILE);return existsSync(_0x1733bb)&&lstatSync(_0x1733bb)[_0x5c34c0(0xc1)]()?readFileSync(_0x1733bb,_0x5c34c0(0xdc)):'';}function readPushMetadataIfPresent(_0x1ad2f0,_0x3213ef={}){const _0x18a168=a147_0x3bb5;try{return readMetadataIfPresent(_0x1ad2f0);}catch(_0x231f6d){if(_0x3213ef[_0x18a168(0xde)])return undefined;throw _0x231f6d;}}
1
+ (function(_0x182910,_0x35a669){const _0xc74c02=a147_0x3195,_0xdc365b=_0x182910();while(!![]){try{const _0x23eed0=parseInt(_0xc74c02(0x11f))/0x1+parseInt(_0xc74c02(0x149))/0x2+parseInt(_0xc74c02(0x129))/0x3+-parseInt(_0xc74c02(0x151))/0x4*(-parseInt(_0xc74c02(0x122))/0x5)+-parseInt(_0xc74c02(0x139))/0x6*(-parseInt(_0xc74c02(0x12a))/0x7)+-parseInt(_0xc74c02(0x11d))/0x8*(-parseInt(_0xc74c02(0x127))/0x9)+-parseInt(_0xc74c02(0x12f))/0xa;if(_0x23eed0===_0x35a669)break;else _0xdc365b['push'](_0xdc365b['shift']());}catch(_0xefb99a){_0xdc365b['push'](_0xdc365b['shift']());}}}(a147_0x13c5,0x20075));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a147_0x4d476c}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';function a147_0x3195(_0x572602,_0xfede50){_0x572602=_0x572602-0x11a;const _0x13c5b5=a147_0x13c5();let _0x319522=_0x13c5b5[_0x572602];return _0x319522;}import{buildSkillPackage,tryNormalizePackageManifest}from'./zip-package.js';export function resolvePushDirectoryIdentity(_0x3d924a,_0x2f822d,_0x109669={}){const _0x6901f0=a147_0x3195,_0x258708=resolvePushDirectoryRoot(_0x3d924a),_0x246a84=readPushMetadataIfPresent(resolve(_0x258708,METADATA_FILE),{'ignoreInvalidMetadata':_0x109669[_0x6901f0(0x125)]});if(_0x246a84?.[_0x6901f0(0x140)]&&_0x246a84[_0x6901f0(0x140)]!==_0x2f822d&&!_0x109669[_0x6901f0(0x13a)]&&!_0x109669[_0x6901f0(0x12b)])throw CliErrors[_0x6901f0(0x12e)]('Skill\x20metadata\x20appCode\x20\x22'+_0x246a84[_0x6901f0(0x140)]+_0x6901f0(0x143)+_0x2f822d+'\x22.');const _0x150e28=resolvePushSkillCode(_0x258708,_0x2f822d,_0x246a84,_0x109669);if(!_0x150e28)throw CliErrors['validation'](_0x6901f0(0x135)+SKILL_FILE+',\x20'+METADATA_FILE+_0x6901f0(0x15b));return{'dir':_0x258708,'skillCode':_0x150e28,'metadata':_0x246a84};}export function readPushDirectory(_0x5a66db,_0x3d7d8d,_0x2631b8={}){const _0x10ee9b=a147_0x3195,_0x37f928=resolvePushDirectoryIdentity(_0x5a66db,_0x3d7d8d,_0x2631b8),_0x9181f3=_0x37f928[_0x10ee9b(0x141)],_0x41d861=resolve(_0x9181f3,SKILL_FILE);if(!existsSync(_0x41d861)||!lstatSync(_0x41d861)['isFile']())throw CliErrors[_0x10ee9b(0x12e)](_0x10ee9b(0x12c)+SKILL_FILE+':\x20'+_0x41d861);const _0x23bb73=_0x37f928[_0x10ee9b(0x133)],_0x4d25c3=_0x2631b8[_0x10ee9b(0x123)]??_0x10ee9b(0x15a);if(!_0x2631b8[_0x10ee9b(0x137)]&&_0x23bb73?.[_0x10ee9b(0x11c)]==='builtin')throw CliErrors[_0x10ee9b(0x12e)](_0x10ee9b(0x144)+METADATA_FILE+_0x10ee9b(0x147)+_0x23bb73[_0x10ee9b(0x11c)]+'\x22.');if(!_0x2631b8[_0x10ee9b(0x137)]&&_0x4d25c3===_0x10ee9b(0x15a)&&_0x23bb73?.[_0x10ee9b(0x11c)]&&_0x23bb73['scope']!==_0x10ee9b(0x15a))throw CliErrors['validation'](_0x10ee9b(0x138)+METADATA_FILE+_0x10ee9b(0x147)+_0x23bb73[_0x10ee9b(0x11c)]+'\x22.',_0x10ee9b(0x13d)+_0x9181f3+_0x10ee9b(0x136));const _0x2d74f5=scanSkillDirectory(_0x9181f3,{'excludedFilePaths':_0x2631b8[_0x10ee9b(0x120)]}),_0x459881=buildSkillPackage(_0x2d74f5),_0x2b8aa4=readFileSync(_0x41d861,_0x10ee9b(0x11a)),_0xef8d4f=_0x37f928[_0x10ee9b(0x13e)],_0x529879=_0x2631b8[_0x10ee9b(0x12d)]?undefined:_0x23bb73,_0xc58b43=readSkillDisplayName(_0x2b8aa4);return{'skillCode':_0xef8d4f,'metadata':_0x23bb73,'frontmatterDisplayName':_0xc58b43,'input':{'skillCode':_0xef8d4f,'skillName':_0xc58b43??_0x529879?.[_0x10ee9b(0x142)],'description':_0x529879?.['description'],'content':_0x2b8aa4,'files':_0x459881['manifest'],'packageBase64':_0x459881[_0x10ee9b(0x11e)],'tags':_0x529879?.[_0x10ee9b(0x146)],'version':_0x529879?.['version'],'sourceSessionId':_0x529879?.[_0x10ee9b(0x154)]}};}export function refreshPushDirectoryMetadataFromRemote(_0x1addc5,_0x26646d,_0x38c0fc,_0x149699={}){const _0x3f3156=a147_0x3195,_0x3dcd65=resolvePushDirectoryRoot(_0x1addc5),_0x412a37=readPushMetadataIfPresent(resolve(_0x3dcd65,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x47d4f7=requireRemoteScope(_0x26646d),_0x2f9893=readLocalSkillContent(_0x3dcd65),_0x3cb5f0={..._0x26646d,'appCode':_0x26646d['appCode']??_0x38c0fc,'skillName':_0x26646d['skillName']??_0x412a37?.[_0x3f3156(0x142)],'description':_0x26646d['description']??_0x412a37?.['description'],'example':_0x26646d[_0x3f3156(0x132)]??_0x412a37?.[_0x3f3156(0x132)],'tags':Array['isArray'](_0x26646d['tags'])?_0x26646d[_0x3f3156(0x146)]:_0x412a37?.[_0x3f3156(0x146)],'sourceSessionId':_0x26646d[_0x3f3156(0x154)]??_0x412a37?.['sourceSessionId'],'content':_0x26646d['content']??_0x2f9893},_0xfe7964=buildMetadata(_0x3cb5f0,_0x47d4f7,_0x38c0fc,contentHash(_0x2f9893),_0x149699[_0x3f3156(0x128)]);writeJsonAtomic(resolve(_0x3dcd65,METADATA_FILE),_0xfe7964);}export function recordPushedRuntimeSkill(_0x19e369,_0x49404f,_0x10b515,_0x170cb3={}){const _0x52118f=a147_0x3195,_0x5234e0=resolvePushDirectoryRoot(_0x19e369),_0x5abae3=scanSkillDirectory(_0x5234e0),_0x397cec=_0x5abae3[_0x52118f(0x14e)](_0xdbd168=>_0xdbd168[_0x52118f(0x145)]===SKILL_FILE),_0x860db6=_0x397cec?fileText(_0x397cec):'',_0x3b78cf=tryNormalizePackageManifest(_0x49404f['files']),_0x1828cf={..._0x49404f,'content':_0x49404f[_0x52118f(0x13c)]??_0x860db6,'files':_0x3b78cf},_0x50fcc7=_0x3b78cf?normalizeLocalFiles(_0x5abae3)['filter'](_0xb77cd4=>_0x3b78cf['files'][_0x52118f(0x121)](_0x40cd2a=>_0x40cd2a[_0x52118f(0x145)]===_0xb77cd4[_0x52118f(0x145)])):undefined,_0x45911e=buildMetadata(_0x1828cf,_0x170cb3['scope']??_0x52118f(0x15a),_0x10b515,contentHash(_0x1828cf[_0x52118f(0x13c)]??''),_0x170cb3['pushedAt'],_0x50fcc7);writeJsonAtomic(resolve(_0x5234e0,METADATA_FILE),_0x45911e);}function a147_0x13c5(){const _0x306dc6=['boolean','\x20has\x20unsupported\x20scope\x20\x22','\x20name\x20for\x20SkillHub\x20slug\x20generation.','personal',',\x20or\x20directory\x20name.','utf8','isArray','scope','440912JQwkOB','packageBase64','95287lqtsga','excludedFilePaths','some','5dwtLCg','targetScope','Skill\x20directory\x20not\x20found:\x20','ignoreInvalidMetadata','company','9iOvEHp','refreshedAt','111567JCGCNz','409927cAxuFl','ignoreMetadataAppCodeMismatch','Missing\x20','ignoreMetadataForPayload','validation','5202790esSMog','unknown','name','example','metadata','match','Unable\x20to\x20resolve\x20skillCode\x20from\x20','\x20to\x20submit\x20company\x20Skills\x20for\x20review.','ignoreMetadataScope','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20','24tbpRzX','allowAppCodeRetarget','trim','content','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20','skillCode','replace','appCode','dir','skillName','\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22','Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20','path','tags','\x20has\x20scope=\x22','isSymbolicLink','260592DfSeHh','toLowerCase','isFile','displayName','string','find','Remote\x20Skill\x20','object','397352IEVbPP','isDirectory','startsWith','sourceSessionId','slice','builtin'];a147_0x13c5=function(){return _0x306dc6;};return a147_0x13c5();}export function deriveSkillCodeFromDirectory(_0x571c0f,_0x9f2800){const _0x2816d6=a147_0x3195,_0x546366=basename(resolve(_0x571c0f)),_0x22d01c=_0x9f2800+'--';return _0x546366[_0x2816d6(0x153)](_0x22d01c)?_0x546366[_0x2816d6(0x155)](_0x22d01c['length']):_0x546366;}function resolvePushSkillCode(_0x5f053a,_0x19fc65,_0x322683,_0xd252d0){const _0x43355f=deriveSkillCodeFromSkillFile(_0x5f053a)||deriveSkillCodeFromDirectory(_0x5f053a,_0x19fc65);if(_0xd252d0['ignoreMetadataSkillCode'])return _0x43355f;return _0x322683?.['skillCode']?.['trim']()||_0x43355f;}function deriveSkillCodeFromSkillFile(_0x347b7b){const _0xeb2f1e=a147_0x3195,_0x362a8c=resolve(_0x347b7b,SKILL_FILE);if(!existsSync(_0x362a8c)||!lstatSync(_0x362a8c)['isFile']())return undefined;const _0x2b82d4=readFileSync(_0x362a8c,'utf8'),_0x572bb1=_0x2b82d4[_0xeb2f1e(0x134)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x572bb1)return undefined;const _0xc8905a=parseFrontmatterObject(_0x572bb1[0x1]??''),_0x452bb6=scalarToString(_0xc8905a?.[_0xeb2f1e(0x131)]);return _0x452bb6?slugifySkillName(_0x452bb6):undefined;}function readSkillDisplayName(_0x4862c5){const _0x54df88=a147_0x3195,_0x4f1cdc=_0x4862c5[_0x54df88(0x134)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x4f1cdc)return undefined;const _0x407eee=parseFrontmatterObject(_0x4f1cdc[0x1]??'');return scalarToString(_0x407eee?.[_0x54df88(0x14c)]);}function slugifySkillName(_0x505a7f){const _0xd3cc64=a147_0x3195,_0x4e36d2=_0x505a7f[_0xd3cc64(0x13b)]()[_0xd3cc64(0x14a)]()[_0xd3cc64(0x13f)](/[^\p{L}\p{N}\p{So}]+/gu,'-')[_0xd3cc64(0x13f)](/^-+/,'')[_0xd3cc64(0x13f)](/-+$/,'')['replace'](/-{2,}/g,'-');if(!_0x4e36d2)throw CliErrors[_0xd3cc64(0x12e)]('Invalid\x20'+SKILL_FILE+_0xd3cc64(0x159));return _0x4e36d2;}function parseFrontmatterObject(_0x503872){const _0x5b5061=a147_0x3195;try{const _0x25b197=a147_0x4d476c(_0x503872);return _0x25b197&&typeof _0x25b197===_0x5b5061(0x150)&&!Array[_0x5b5061(0x11b)](_0x25b197)?_0x25b197:undefined;}catch{return undefined;}}function scalarToString(_0x27e4bc){const _0x154695=a147_0x3195;if(typeof _0x27e4bc===_0x154695(0x14d))return _0x27e4bc[_0x154695(0x13b)]();if(typeof _0x27e4bc==='number'||typeof _0x27e4bc===_0x154695(0x157))return String(_0x27e4bc);return undefined;}function resolvePushDirectoryRoot(_0xa4424){const _0x5aac2a=a147_0x3195,_0x172e75=resolve(_0xa4424);if(!existsSync(_0x172e75))throw CliErrors[_0x5aac2a(0x12e)](_0x5aac2a(0x124)+_0xa4424);const _0x139367=lstatSync(_0x172e75);if(_0x139367[_0x5aac2a(0x152)]())return _0x172e75;if(_0x139367[_0x5aac2a(0x148)]()){const _0x260fd9=realpathSync(_0x172e75);if(lstatSync(_0x260fd9)[_0x5aac2a(0x152)]())return _0x260fd9;}throw CliErrors['validation'](_0x5aac2a(0x124)+_0xa4424);}function requireRemoteScope(_0xd04f25){const _0x2212a4=a147_0x3195;if(_0xd04f25[_0x2212a4(0x11c)]==='personal'||_0xd04f25['scope']===_0x2212a4(0x126)||_0xd04f25[_0x2212a4(0x11c)]===_0x2212a4(0x156))return _0xd04f25['scope'];throw CliErrors[_0x2212a4(0x12e)](_0x2212a4(0x14f)+(_0xd04f25[_0x2212a4(0x13e)]||'(unknown)')+_0x2212a4(0x158)+(_0xd04f25[_0x2212a4(0x11c)]??_0x2212a4(0x130))+'\x22.');}function readLocalSkillContent(_0x266986){const _0x2fbbf4=a147_0x3195,_0x1767f8=resolve(_0x266986,SKILL_FILE);return existsSync(_0x1767f8)&&lstatSync(_0x1767f8)[_0x2fbbf4(0x14b)]()?readFileSync(_0x1767f8,_0x2fbbf4(0x11a)):'';}function readPushMetadataIfPresent(_0x2acea2,_0x281914={}){const _0x457f9c=a147_0x3195;try{return readMetadataIfPresent(_0x2acea2);}catch(_0x4253ce){if(_0x281914[_0x457f9c(0x125)])return undefined;throw _0x4253ce;}}
@@ -1 +1 @@
1
- (function(_0x25cfab,_0x446059){const _0x3ebc54=a148_0x5501,_0x45602a=_0x25cfab();while(!![]){try{const _0x1c64d9=-parseInt(_0x3ebc54(0x1eb))/0x1+-parseInt(_0x3ebc54(0x1f2))/0x2+parseInt(_0x3ebc54(0x1f4))/0x3+parseInt(_0x3ebc54(0x1ed))/0x4+-parseInt(_0x3ebc54(0x1f6))/0x5+parseInt(_0x3ebc54(0x1ee))/0x6+parseInt(_0x3ebc54(0x1f5))/0x7*(parseInt(_0x3ebc54(0x1f3))/0x8);if(_0x1c64d9===_0x446059)break;else _0x45602a['push'](_0x45602a['shift']());}catch(_0x835b62){_0x45602a['push'](_0x45602a['shift']());}}}(a148_0x4987,0x5076d));import{CliErrors}from'../../errors.js';function a148_0x5501(_0xdbf7f5,_0x51e0d7){_0xdbf7f5=_0xdbf7f5-0x1ea;const _0x4987a8=a148_0x4987();let _0x5501b2=_0x4987a8[_0xdbf7f5];return _0x5501b2;}export function normalizeRuntimeSkillScopes(_0x4236bb){const _0xf85f46=a148_0x5501,_0x204d37=_0x4236bb&&_0x4236bb[_0xf85f46(0x1ea)]>0x0?_0x4236bb:[_0xf85f46(0x1ec),'company',_0xf85f46(0x1f7)],_0x5e770b=[];for(const _0x54243b of _0x204d37){if(!isRuntimeSkillScope(_0x54243b))throw CliErrors[_0xf85f46(0x1f0)]('Unsupported\x20runtime\x20Skill\x20scope:\x20'+_0x54243b);!_0x5e770b[_0xf85f46(0x1ef)](_0x54243b)&&_0x5e770b['push'](_0x54243b);}return _0x5e770b;}export function isRuntimeSkillScope(_0x54494e){const _0x2c010b=a148_0x5501;return _0x54494e===_0x2c010b(0x1ec)||_0x54494e===_0x2c010b(0x1f1)||_0x54494e===_0x2c010b(0x1f7);}function a148_0x4987(){const _0x229f52=['company','963998VaqNNU','7008504iUfnjP','1537812EDPDyp','7JYSuGF','2398955aLaPDP','builtin','length','192167tpYnpR','personal','266676vdBKhC','169212FrsFPb','includes','validation'];a148_0x4987=function(){return _0x229f52;};return a148_0x4987();}
1
+ function a148_0x455a(){const _0x516da7=['Unsupported\x20runtime\x20Skill\x20scope:\x20','includes','3885092oxpICK','personal','24KsiSnO','4777773tEGPmK','4953645viKCyb','11KMSJDi','10sPNnXN','builtin','length','push','267706jZwrfK','8129445lVJMEB','3617400AOVcdn','company','6jpuTuU','15524729OpqecY'];a148_0x455a=function(){return _0x516da7;};return a148_0x455a();}function a148_0xb0eb(_0x44aca3,_0x27422f){_0x44aca3=_0x44aca3-0x111;const _0x455ae2=a148_0x455a();let _0xb0eb79=_0x455ae2[_0x44aca3];return _0xb0eb79;}(function(_0x16f0c8,_0x4fff49){const _0x14b4e0=a148_0xb0eb,_0x286c16=_0x16f0c8();while(!![]){try{const _0x5a651f=-parseInt(_0x14b4e0(0x121))/0x1*(-parseInt(_0x14b4e0(0x114))/0x2)+-parseInt(_0x14b4e0(0x118))/0x3*(parseInt(_0x14b4e0(0x11c))/0x4)+parseInt(_0x14b4e0(0x115))/0x5+-parseInt(_0x14b4e0(0x116))/0x6+parseInt(_0x14b4e0(0x11f))/0x7+-parseInt(_0x14b4e0(0x11e))/0x8*(parseInt(_0x14b4e0(0x120))/0x9)+parseInt(_0x14b4e0(0x122))/0xa*(parseInt(_0x14b4e0(0x119))/0xb);if(_0x5a651f===_0x4fff49)break;else _0x286c16['push'](_0x286c16['shift']());}catch(_0x32252e){_0x286c16['push'](_0x286c16['shift']());}}}(a148_0x455a,0xf30a1));import{CliErrors}from'../../errors.js';export function normalizeRuntimeSkillScopes(_0x311723){const _0x120968=a148_0xb0eb,_0x251a0b=_0x311723&&_0x311723[_0x120968(0x112)]>0x0?_0x311723:[_0x120968(0x11d),_0x120968(0x117),_0x120968(0x111)],_0x249422=[];for(const _0x3bd250 of _0x251a0b){if(!isRuntimeSkillScope(_0x3bd250))throw CliErrors['validation'](_0x120968(0x11a)+_0x3bd250);!_0x249422[_0x120968(0x11b)](_0x3bd250)&&_0x249422[_0x120968(0x113)](_0x3bd250);}return _0x249422;}export function isRuntimeSkillScope(_0x3a19aa){const _0x4b11cd=a148_0xb0eb;return _0x3a19aa===_0x4b11cd(0x11d)||_0x3a19aa==='company'||_0x3a19aa===_0x4b11cd(0x111);}