@lovrabet/lovrabet-cli 2.3.3 → 2.3.4-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (176) hide show
  1. package/README.md +11 -0
  2. package/lib/cli.js +1 -1
  3. package/lib/commands/api-doc/index.js +1 -1
  4. package/lib/commands/app/cache.js +1 -1
  5. package/lib/commands/app/definitions.js +1 -1
  6. package/lib/commands/app/eligibility.js +1 -1
  7. package/lib/commands/app/mock-loader.js +1 -1
  8. package/lib/commands/app/remote-source.js +1 -1
  9. package/lib/commands/app/shared.js +1 -1
  10. package/lib/commands/app-config/get.js +1 -1
  11. package/lib/commands/app-config/index.js +1 -1
  12. package/lib/commands/approval/index.js +1 -1
  13. package/lib/commands/artifact/index.js +1 -1
  14. package/lib/commands/auth/device.js +1 -1
  15. package/lib/commands/auth/index.js +1 -1
  16. package/lib/commands/auth/prompt.js +1 -1
  17. package/lib/commands/bff/detail.js +1 -1
  18. package/lib/commands/bff/exec.js +1 -1
  19. package/lib/commands/bff/index.js +1 -1
  20. package/lib/commands/cli-skill/index.js +1 -1
  21. package/lib/commands/common/config-policy.js +1 -1
  22. package/lib/commands/common/constraints.js +1 -1
  23. package/lib/commands/common/flags.js +1 -1
  24. package/lib/commands/common/local-file.js +1 -1
  25. package/lib/commands/config/definitions.js +1 -1
  26. package/lib/commands/config/init.js +1 -1
  27. package/lib/commands/config/shared.js +1 -1
  28. package/lib/commands/data/index.js +1 -1
  29. package/lib/commands/dataset/detail.js +1 -1
  30. package/lib/commands/dataset/index.js +1 -1
  31. package/lib/commands/dataset/list.js +1 -1
  32. package/lib/commands/dataset/sdk-doc.js +1 -1
  33. package/lib/commands/doctor.js +1 -1
  34. package/lib/commands/file/index.js +1 -1
  35. package/lib/commands/init.js +1 -1
  36. package/lib/commands/kb/index.js +1 -1
  37. package/lib/commands/logs/index.js +1 -1
  38. package/lib/commands/notification/config-list.js +1 -1
  39. package/lib/commands/notification/index.js +1 -1
  40. package/lib/commands/notification/shared.js +1 -1
  41. package/lib/commands/ocr/index.js +1 -1
  42. package/lib/commands/permit/dataset-get.js +1 -1
  43. package/lib/commands/permit/dataset-set.js +1 -1
  44. package/lib/commands/permit/index.js +1 -1
  45. package/lib/commands/permit/page-get.js +1 -1
  46. package/lib/commands/permit/page-set.js +1 -1
  47. package/lib/commands/permit/role-menus-set.js +1 -1
  48. package/lib/commands/permit/role-menus.js +1 -1
  49. package/lib/commands/permit/shared.js +1 -1
  50. package/lib/commands/personal-bff/index.js +1 -1
  51. package/lib/commands/registry.js +1 -1
  52. package/lib/commands/role/create.js +1 -1
  53. package/lib/commands/role/delete.js +1 -1
  54. package/lib/commands/role/detail.js +1 -1
  55. package/lib/commands/role/index.js +1 -1
  56. package/lib/commands/role/list.js +1 -1
  57. package/lib/commands/role/shared.js +1 -1
  58. package/lib/commands/role/update.js +1 -1
  59. package/lib/commands/role/user-add.js +1 -1
  60. package/lib/commands/role/user-remove.js +1 -1
  61. package/lib/commands/schedule/index.js +1 -1
  62. package/lib/commands/schema.js +1 -1
  63. package/lib/commands/service/dynamic.js +1 -1
  64. package/lib/commands/service/function-name-adapter.js +1 -1
  65. package/lib/commands/service/index.js +1 -1
  66. package/lib/commands/service/registry.js +1 -1
  67. package/lib/commands/skill/commands/create.js +1 -1
  68. package/lib/commands/skill/commands/diagram.js +1 -1
  69. package/lib/commands/skill/commands/install.js +1 -1
  70. package/lib/commands/skill/commands/list.js +1 -1
  71. package/lib/commands/skill/commands/push.js +1 -1
  72. package/lib/commands/skill/commands/validate.js +1 -1
  73. package/lib/commands/skill/diagram.js +1 -1
  74. package/lib/commands/skill/flags.js +1 -1
  75. package/lib/commands/skill/index.js +1 -1
  76. package/lib/commands/skill/manifest-helpers.js +1 -1
  77. package/lib/commands/skill/push-execute.js +1 -1
  78. package/lib/commands/skill/push-flow-helpers.js +1 -1
  79. package/lib/commands/skill/push-retarget.js +1 -1
  80. package/lib/commands/skill/scopes.js +1 -1
  81. package/lib/commands/skill/summary.js +1 -1
  82. package/lib/commands/skill/templates.js +1 -1
  83. package/lib/commands/skill/validate.js +1 -1
  84. package/lib/commands/sql/detail.js +1 -1
  85. package/lib/commands/sql/exec.js +1 -1
  86. package/lib/commands/sql/index.js +1 -1
  87. package/lib/commands/update.js +1 -1
  88. package/lib/commands/user-account/bind.js +1 -1
  89. package/lib/commands/user-account/index.js +1 -1
  90. package/lib/commands/workspace/index.js +1 -1
  91. package/lib/config/domain-config.js +1 -1
  92. package/lib/config/schema.js +1 -1
  93. package/lib/constant/app.js +1 -1
  94. package/lib/constant/auth-mode.js +1 -1
  95. package/lib/constant/cli.js +1 -1
  96. package/lib/constant/defaults.js +1 -1
  97. package/lib/constant/distribution.js +1 -1
  98. package/lib/constant/domain.js +1 -1
  99. package/lib/constant/env.js +1 -1
  100. package/lib/constant/output.js +1 -1
  101. package/lib/constant/product.js +1 -1
  102. package/lib/constant/region.js +1 -1
  103. package/lib/constant/risk.js +1 -1
  104. package/lib/constant/url.js +1 -1
  105. package/lib/context.js +1 -1
  106. package/lib/core/api-client.js +1 -1
  107. package/lib/core/db-resolver.js +1 -1
  108. package/lib/core/kb-search-client.d.ts +7 -1
  109. package/lib/core/kb-search-client.js +1 -1
  110. package/lib/core/sdk-client.js +1 -1
  111. package/lib/errors.js +1 -1
  112. package/lib/framework/build-all-flags.js +1 -1
  113. package/lib/framework/dryrun.js +1 -1
  114. package/lib/framework/flags.js +1 -1
  115. package/lib/framework/help.js +1 -1
  116. package/lib/framework/index.js +1 -1
  117. package/lib/framework/output.js +1 -1
  118. package/lib/framework/preparse.js +1 -1
  119. package/lib/framework/rate-limit.js +1 -1
  120. package/lib/framework/raw-flags.js +1 -1
  121. package/lib/framework/response.js +1 -1
  122. package/lib/framework/runner-confirmation.js +1 -1
  123. package/lib/framework/runner-error.js +1 -1
  124. package/lib/framework/runner.js +1 -1
  125. package/lib/framework/schema-export.js +1 -1
  126. package/lib/framework/service-order.js +1 -1
  127. package/lib/framework/types.js +1 -1
  128. package/lib/generated/build-info.d.ts +4 -4
  129. package/lib/generated/build-info.js +1 -1
  130. package/lib/generated/official-routing.js +1 -1
  131. package/lib/generated/routing-contract.js +1 -1
  132. package/lib/help.js +1 -1
  133. package/lib/postinstall.js +1 -1
  134. package/lib/runtime/confirmation.js +1 -1
  135. package/lib/runtime/event.js +1 -1
  136. package/lib/runtime/index.js +1 -1
  137. package/lib/runtime/queue.js +1 -1
  138. package/lib/runtime/resolve.js +1 -1
  139. package/lib/skills/builtin-skill.js +1 -1
  140. package/lib/skills/npx-skills-add.js +1 -1
  141. package/lib/skills/runtime-skill-sync/constants.js +1 -1
  142. package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
  143. package/lib/skills/runtime-skill-sync/hashing.js +1 -1
  144. package/lib/skills/runtime-skill-sync/install-target.js +1 -1
  145. package/lib/skills/runtime-skill-sync/links.js +1 -1
  146. package/lib/skills/runtime-skill-sync/list-local.js +1 -1
  147. package/lib/skills/runtime-skill-sync/local-files.js +1 -1
  148. package/lib/skills/runtime-skill-sync/materialize.js +1 -1
  149. package/lib/skills/runtime-skill-sync/metadata.js +1 -1
  150. package/lib/skills/runtime-skill-sync/paths.js +1 -1
  151. package/lib/skills/runtime-skill-sync/push.js +1 -1
  152. package/lib/skills/runtime-skill-sync/scopes.js +1 -1
  153. package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
  154. package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
  155. package/lib/skills/runtime-skill-sync.js +1 -1
  156. package/lib/skills/skill-presence.js +1 -1
  157. package/lib/utils/access-key-redaction.js +1 -1
  158. package/lib/utils/apply-jq-filter.js +1 -1
  159. package/lib/utils/cli-version-check.js +1 -1
  160. package/lib/utils/cli-version-policy.js +1 -1
  161. package/lib/utils/logger.js +1 -1
  162. package/lib/utils/lossless-json.js +1 -1
  163. package/lib/utils/params.js +1 -1
  164. package/lib/utils/positive-safe-integer.js +1 -1
  165. package/lib/utils/redaction.js +1 -1
  166. package/lib/utils/update-notice.js +1 -1
  167. package/lib/utils/version.js +1 -1
  168. package/lib/utils/write-cli-side-channel.js +1 -1
  169. package/package.json +1 -1
  170. package/skills/lovrabet/SKILL.md +4 -2
  171. package/skills/lovrabet/references/lovrabet-config-commands.md +1 -1
  172. package/skills/lovrabet/references/lovrabet-config.md +2 -2
  173. package/skills/lovrabet/references/lovrabet-doctor.md +1 -1
  174. package/skills/lovrabet/references/lovrabet-kb-workflow.md +16 -6
  175. package/skills/lovrabet/references/lovrabet-service-tree.md +1 -1
  176. package/skills/lovrabet.manifest.json +3 -3
@@ -1 +1 @@
1
- function a136_0x7755(){const _0x47dc69=['isSymbolicLink','reason','length','SKILL.md','sort','missing','current','94854UwPOOx','skipped','package.json','split','INSTALL_FAILED','sha256','schemaVersion','files','Built-in\x20Skill\x20source\x20does\x20not\x20match\x20its\x20package\x20manifest','2499602LPYkwz','message','packageVersion','home','root','2154856OvpaPe','path','present','trim','572885iWGiVE','Unsafe\x20manifest\x20path:\x20','isDirectory','lovrabet','unverifiable','parse',':\x5cs*(.+)$','13476617kPmcGM','Installed\x20Skill\x20state\x20is\x20','includes','manifest','state','every','44190EKfPfe','skillVersion','unknown','name','70RIfmhT','join','version','skills@latest\x20exited\x20','152UBrtAc','installedPath','lovrabet.manifest.json','SOURCE_INVALID','startsWith','skills','absent','flatMap','hex','2aRYSow','lovrabet\x20cli-skill\x20install','6310IRLqtH','7911vpteEh','packageRoot','digest','utf8','isFile','update','stdio'];a136_0x7755=function(){return _0x47dc69;};return a136_0x7755();}const a136_0x4cd20e=a136_0x1d80;(function(_0x5ac6be,_0x5d809c){const _0x1d3dde=a136_0x1d80,_0x49ed7a=_0x5ac6be();while(!![]){try{const _0x24feaf=parseInt(_0x1d3dde(0x1e5))/0x1*(-parseInt(_0x1d3dde(0x203))/0x2)+parseInt(_0x1d3dde(0x1f2))/0x3*(-parseInt(_0x1d3dde(0x1fa))/0x4)+parseInt(_0x1d3dde(0x1f6))/0x5*(-parseInt(_0x1d3dde(0x214))/0x6)+-parseInt(_0x1d3dde(0x1dc))/0x7+parseInt(_0x1d3dde(0x1e1))/0x8+parseInt(_0x1d3dde(0x206))/0x9*(parseInt(_0x1d3dde(0x205))/0xa)+parseInt(_0x1d3dde(0x1ec))/0xb;if(_0x24feaf===_0x5d809c)break;else _0x49ed7a['push'](_0x49ed7a['shift']());}catch(_0x2ad123){_0x49ed7a['push'](_0x49ed7a['shift']());}}}(a136_0x7755,0x528c4));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=a136_0x4cd20e(0x204),SKILL_NAME=a136_0x4cd20e(0x1e8);function frontmatterValue(_0x546c14,_0x2cbcf5){const _0x421182=a136_0x4cd20e;return _0x546c14['match'](new RegExp('^'+_0x2cbcf5+_0x421182(0x1eb),'m'))?.[0x1]?.[_0x421182(0x1e4)]()??'';}function listFiles(_0x31f5ad,_0x974fdf=_0x31f5ad){const _0x3122e1=a136_0x4cd20e;return readdirSync(_0x974fdf,{'withFileTypes':!![]})[_0x3122e1(0x201)](_0x24d55c=>{const _0xa8eac0=_0x3122e1,_0x2046b6=join(_0x974fdf,_0x24d55c[_0xa8eac0(0x1f5)]),_0x3b2a55=lstatSync(_0x2046b6);if(_0x3b2a55[_0xa8eac0(0x20d)]())throw new Error('Symbolic\x20link\x20is\x20not\x20allowed:\x20'+_0x2046b6);if(_0x3b2a55[_0xa8eac0(0x1e7)]())return listFiles(_0x31f5ad,_0x2046b6);if(!_0x3b2a55[_0xa8eac0(0x20a)]())throw new Error('Unsupported\x20Skill\x20entry:\x20'+_0x2046b6);return[relative(_0x31f5ad,_0x2046b6)['split'](sep)[_0xa8eac0(0x1f7)]('/')];})[_0x3122e1(0x211)]((_0x37d315,_0x5abfdb)=>_0x37d315<_0x5abfdb?-0x1:_0x37d315>_0x5abfdb?0x1:0x0);}function digestFiles(_0x54a406,_0x5252ef){const _0x4cc654=a136_0x4cd20e,_0x55ec33=createHash(_0x4cc654(0x219));for(const _0x555a78 of _0x5252ef){if(_0x555a78[_0x4cc654(0x1fe)]('/')||_0x555a78[_0x4cc654(0x217)]('/')[_0x4cc654(0x1ee)]('..')||_0x555a78[_0x4cc654(0x1ee)]('\x5c'))throw new Error(_0x4cc654(0x1e6)+_0x555a78);_0x55ec33[_0x4cc654(0x20b)](_0x555a78),_0x55ec33['update']('\x00'),_0x55ec33[_0x4cc654(0x20b)](readFileSync(join(_0x54a406,..._0x555a78[_0x4cc654(0x217)]('/')))),_0x55ec33[_0x4cc654(0x20b)]('\x00');}return _0x55ec33['digest'](_0x4cc654(0x202));}function sameFiles(_0x81974f,_0x5bb2b6){const _0x3b4105=a136_0x4cd20e;return _0x81974f['length']===_0x5bb2b6[_0x3b4105(0x20f)]&&_0x81974f[_0x3b4105(0x1f1)]((_0xa691c9,_0x386a59)=>_0xa691c9===_0x5bb2b6[_0x386a59]);}function readSource(_0x3e1020){const _0x5aab44=a136_0x4cd20e,_0x40e36d=JSON[_0x5aab44(0x1ea)](readFileSync(join(_0x3e1020,_0x5aab44(0x216)),'utf8')),_0x1a39a4=JSON['parse'](readFileSync(join(_0x3e1020,_0x5aab44(0x1ff),_0x5aab44(0x1fc)),_0x5aab44(0x209))),_0x176da2=join(_0x3e1020,'skills',SKILL_NAME),_0x264650=frontmatterValue(readFileSync(join(_0x176da2,'SKILL.md'),_0x5aab44(0x209)),_0x5aab44(0x1f8)),_0x30b46a=listFiles(_0x176da2);if(_0x1a39a4[_0x5aab44(0x1d9)]!==0x1||_0x1a39a4[_0x5aab44(0x1f5)]!==SKILL_NAME||!_0x40e36d['version']||_0x1a39a4[_0x5aab44(0x1de)]!==_0x40e36d[_0x5aab44(0x1f8)]||_0x1a39a4[_0x5aab44(0x1f3)]!==_0x40e36d[_0x5aab44(0x1f8)]||_0x264650!==_0x40e36d[_0x5aab44(0x1f8)]||!sameFiles(_0x30b46a,_0x1a39a4[_0x5aab44(0x1da)])||digestFiles(_0x176da2,_0x30b46a)!==_0x1a39a4[_0x5aab44(0x208)])throw new Error(_0x5aab44(0x1db));return{'packageVersion':_0x40e36d[_0x5aab44(0x1f8)],'skillVersion':_0x264650,'root':_0x176da2,'manifest':_0x1a39a4};}function installedSkillPath(_0xdcb356){const _0x14aa5b=a136_0x4cd20e,_0x343295=resolveInstalledSkill(SKILL_NAME,{'home':_0xdcb356});if(_0x343295['state']===_0x14aa5b(0x1e3))return{'state':_0x14aa5b(0x1e3),'path':dirname(_0x343295[_0x14aa5b(0x1e2)])};if(_0x343295['state']===_0x14aa5b(0x200))return{'state':_0x14aa5b(0x212)};return{'state':_0x14aa5b(0x1e9),'reason':_0x343295[_0x14aa5b(0x20e)]};}export function inspectInstalledBuiltinSkillVersion(_0x5360f7,_0x5c9df2={}){const _0x43994c=a136_0x4cd20e,_0x14af0c=installedSkillPath(_0x5c9df2[_0x43994c(0x1df)]??homedir());if(_0x14af0c['state']===_0x43994c(0x212))return{'state':_0x43994c(0x212),'expectedVersion':_0x5360f7,'repairCommand':REPAIR_COMMAND};if(_0x14af0c[_0x43994c(0x1f0)]===_0x43994c(0x1e9))return{'state':_0x43994c(0x1e9),'expectedVersion':_0x5360f7,'reason':_0x14af0c['reason'],'repairCommand':REPAIR_COMMAND};try{const _0x5c3014=frontmatterValue(readFileSync(join(_0x14af0c[_0x43994c(0x1e2)],'SKILL.md'),_0x43994c(0x209)),'version');return{'state':_0x5c3014===_0x5360f7?_0x43994c(0x213):'version_mismatch','expectedVersion':_0x5360f7,'skillVersion':_0x5c3014,'installedPath':_0x14af0c['path'],'repairCommand':REPAIR_COMMAND};}catch(_0x5b405e){return{'state':_0x43994c(0x1e9),'expectedVersion':_0x5360f7,'installedPath':_0x14af0c[_0x43994c(0x1e2)],'reason':_0x5b405e instanceof Error?_0x5b405e[_0x43994c(0x1dd)]:String(_0x5b405e),'repairCommand':REPAIR_COMMAND};}}export function inspectBuiltinSkill(_0x4db9d7={}){const _0x25e118=a136_0x4cd20e,_0x1a09a3=_0x4db9d7[_0x25e118(0x207)]??DEFAULT_PACKAGE_ROOT;let _0x149c4;try{_0x149c4=readSource(_0x1a09a3);}catch(_0x441e81){return{'state':'unverifiable','packageVersion':'unknown','reason':_0x441e81 instanceof Error?_0x441e81[_0x25e118(0x1dd)]:String(_0x441e81),'repairCommand':REPAIR_COMMAND};}const _0x440ec7=installedSkillPath(_0x4db9d7['home']??homedir());if(_0x440ec7[_0x25e118(0x1f0)]==='missing')return{'state':_0x25e118(0x212),'packageVersion':_0x149c4['packageVersion'],'repairCommand':REPAIR_COMMAND};if(_0x440ec7['state']===_0x25e118(0x1e9))return{'state':_0x25e118(0x1e9),'packageVersion':_0x149c4[_0x25e118(0x1de)],'reason':_0x440ec7[_0x25e118(0x20e)],'repairCommand':REPAIR_COMMAND};try{const _0x10491b=frontmatterValue(readFileSync(join(_0x440ec7[_0x25e118(0x1e2)],_0x25e118(0x210)),_0x25e118(0x209)),_0x25e118(0x1f8));if(_0x10491b!==_0x149c4[_0x25e118(0x1f3)])return{'state':'version_mismatch','packageVersion':_0x149c4['packageVersion'],'skillVersion':_0x10491b,'installedPath':_0x440ec7[_0x25e118(0x1e2)],'repairCommand':REPAIR_COMMAND};const _0x3299b2=listFiles(_0x440ec7['path']),_0x4b0a19=digestFiles(_0x440ec7[_0x25e118(0x1e2)],_0x3299b2);return{'state':sameFiles(_0x3299b2,_0x149c4[_0x25e118(0x1ef)][_0x25e118(0x1da)])&&_0x4b0a19===_0x149c4[_0x25e118(0x1ef)]['digest']?_0x25e118(0x213):'content_mismatch','packageVersion':_0x149c4[_0x25e118(0x1de)],'skillVersion':_0x10491b,'installedPath':_0x440ec7[_0x25e118(0x1e2)],'digest':_0x4b0a19,'repairCommand':REPAIR_COMMAND};}catch(_0x15881e){return{'state':_0x25e118(0x1e9),'packageVersion':_0x149c4[_0x25e118(0x1de)],'installedPath':_0x440ec7['path'],'reason':_0x15881e instanceof Error?_0x15881e['message']:String(_0x15881e),'repairCommand':REPAIR_COMMAND};}}function a136_0x1d80(_0x4ba359,_0x3cf8c5){_0x4ba359=_0x4ba359-0x1d9;const _0x77551f=a136_0x7755();let _0x1d8061=_0x77551f[_0x4ba359];return _0x1d8061;}function failure(_0x4d5dc0,_0x177b21,_0x295ca8,_0x3440c1){const _0x17680b=a136_0x4cd20e;return{'ok':![],'code':_0x4d5dc0,'packageVersion':_0x177b21['packageVersion'],'skillVersion':_0x177b21[_0x17680b(0x1f3)],'installedPath':_0x3440c1,'changed':![],'repairCommand':REPAIR_COMMAND,'error':_0x295ca8 instanceof Error?_0x295ca8[_0x17680b(0x1dd)]:String(_0x295ca8)};}export function installBuiltinSkill(_0x33015b={}){const _0xa8726b=a136_0x4cd20e,_0x1b176c=_0x33015b[_0xa8726b(0x207)]??DEFAULT_PACKAGE_ROOT,_0xa0d1c4=_0x33015b[_0xa8726b(0x1df)]??homedir();let _0x75c2d2;try{_0x75c2d2=readSource(_0x1b176c);}catch(_0x4e8f24){return failure(_0xa8726b(0x1fd),{'packageVersion':'unknown','skillVersion':_0xa8726b(0x1f4)},_0x4e8f24);}const _0x4f5306=inspectBuiltinSkill({'packageRoot':_0x1b176c,'home':_0xa0d1c4}),_0x50e89d=runNpxSkillsAddGlobal(_0x1b176c,_0x75c2d2[_0xa8726b(0x1e0)],{'stdio':_0x33015b[_0xa8726b(0x20c)]??'pipe','expectedSkillName':SKILL_NAME,'presence':{'home':_0xa0d1c4}});if(_0x50e89d[_0xa8726b(0x215)])return{'ok':!![],'packageVersion':_0x75c2d2[_0xa8726b(0x1de)],'skillVersion':_0x75c2d2[_0xa8726b(0x1f3)],'installedPath':_0x4f5306[_0xa8726b(0x1fb)],'changed':![],'repairCommand':REPAIR_COMMAND};if(!_0x50e89d['ok'])return failure(_0xa8726b(0x218),_0x75c2d2,_0x50e89d['error']??_0xa8726b(0x1f9)+_0x50e89d['status']);const _0x26fcc8=inspectBuiltinSkill({'packageRoot':_0x1b176c,'home':_0xa0d1c4});if(_0x26fcc8[_0xa8726b(0x1f0)]!==_0xa8726b(0x213))return failure('VERIFY_FAILED',_0x75c2d2,_0x26fcc8['reason']??_0xa8726b(0x1ed)+_0x26fcc8[_0xa8726b(0x1f0)],_0x26fcc8[_0xa8726b(0x1fb)]);return{'ok':!![],'packageVersion':_0x75c2d2[_0xa8726b(0x1de)],'skillVersion':_0x75c2d2[_0xa8726b(0x1f3)],'installedPath':_0x26fcc8[_0xa8726b(0x1fb)],'changed':_0x4f5306['state']!==_0xa8726b(0x213),'repairCommand':REPAIR_COMMAND};}
1
+ function a136_0x4721(){const _0x319fcf=['flatMap','startsWith','20826GwNacV','path','1460352QbLyMg','digest','4293070EgLTnQ','message','current','VERIFY_FAILED','present','utf8','length','every','version','includes','skills@latest\x20exited\x20','skillVersion','version_mismatch','skills','unknown','installedPath','packageVersion','SKILL.md','match','state','content_mismatch','14483iGhhsP','root',':\x5cs*(.+)$','isSymbolicLink','INSTALL_FAILED','reason','lovrabet','Installed\x20Skill\x20state\x20is\x20','Unsupported\x20Skill\x20entry:\x20','absent','468181cgGjwu','sha256','parse','unverifiable','missing','Symbolic\x20link\x20is\x20not\x20allowed:\x20','hex','join','files','error','packageRoot','update','9dKIcPn','status','home','schemaVersion','name','136CxFKIv','manifest','pipe','16qFvUAV','split','85200QzRyVX','package.json','Built-in\x20Skill\x20source\x20does\x20not\x20match\x20its\x20package\x20manifest','15860OiBPIE'];a136_0x4721=function(){return _0x319fcf;};return a136_0x4721();}const a136_0x46a372=a136_0x5e52;(function(_0x6dfcc8,_0x836ce5){const _0x15cbbc=a136_0x5e52,_0x10710e=_0x6dfcc8();while(!![]){try{const _0x478703=parseInt(_0x15cbbc(0x122))/0x1+-parseInt(_0x15cbbc(0x13b))/0x2+parseInt(_0x15cbbc(0x13e))/0x3*(-parseInt(_0x15cbbc(0x136))/0x4)+-parseInt(_0x15cbbc(0x138))/0x5+parseInt(_0x15cbbc(0x140))/0x6+-parseInt(_0x15cbbc(0x118))/0x7*(-parseInt(_0x15cbbc(0x133))/0x8)+parseInt(_0x15cbbc(0x12e))/0x9*(-parseInt(_0x15cbbc(0x142))/0xa);if(_0x478703===_0x836ce5)break;else _0x10710e['push'](_0x10710e['shift']());}catch(_0xe812c0){_0x10710e['push'](_0x10710e['shift']());}}}(a136_0x4721,0x409fd));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=a136_0x46a372(0x11e);function frontmatterValue(_0x2c53cc,_0x3a7ee4){const _0x3094db=a136_0x46a372;return _0x2c53cc[_0x3094db(0x115)](new RegExp('^'+_0x3a7ee4+_0x3094db(0x11a),'m'))?.[0x1]?.['trim']()??'';}function listFiles(_0x5606ff,_0xa11f09=_0x5606ff){const _0x4d38a3=a136_0x46a372;return readdirSync(_0xa11f09,{'withFileTypes':!![]})[_0x4d38a3(0x13c)](_0x1e11fd=>{const _0x8385a0=_0x4d38a3,_0x3828a8=join(_0xa11f09,_0x1e11fd['name']),_0x13d924=lstatSync(_0x3828a8);if(_0x13d924[_0x8385a0(0x11b)]())throw new Error(_0x8385a0(0x127)+_0x3828a8);if(_0x13d924['isDirectory']())return listFiles(_0x5606ff,_0x3828a8);if(!_0x13d924['isFile']())throw new Error(_0x8385a0(0x120)+_0x3828a8);return[relative(_0x5606ff,_0x3828a8)[_0x8385a0(0x137)](sep)[_0x8385a0(0x129)]('/')];})['sort']((_0x14fd6a,_0x2b9f39)=>_0x14fd6a<_0x2b9f39?-0x1:_0x14fd6a>_0x2b9f39?0x1:0x0);}function digestFiles(_0x4266c1,_0x1da61b){const _0x182a6f=a136_0x46a372,_0x2264b6=createHash(_0x182a6f(0x123));for(const _0x435cef of _0x1da61b){if(_0x435cef[_0x182a6f(0x13d)]('/')||_0x435cef['split']('/')[_0x182a6f(0x14b)]('..')||_0x435cef[_0x182a6f(0x14b)]('\x5c'))throw new Error('Unsafe\x20manifest\x20path:\x20'+_0x435cef);_0x2264b6['update'](_0x435cef),_0x2264b6[_0x182a6f(0x12d)]('\x00'),_0x2264b6['update'](readFileSync(join(_0x4266c1,..._0x435cef['split']('/')))),_0x2264b6[_0x182a6f(0x12d)]('\x00');}return _0x2264b6[_0x182a6f(0x141)](_0x182a6f(0x128));}function sameFiles(_0x2fcf37,_0x45e641){const _0x38b577=a136_0x46a372;return _0x2fcf37['length']===_0x45e641[_0x38b577(0x148)]&&_0x2fcf37[_0x38b577(0x149)]((_0x146858,_0x1d35d1)=>_0x146858===_0x45e641[_0x1d35d1]);}function readSource(_0x26ce66){const _0x3ed253=a136_0x46a372,_0x546ba9=JSON['parse'](readFileSync(join(_0x26ce66,_0x3ed253(0x139)),_0x3ed253(0x147))),_0xab99fe=JSON[_0x3ed253(0x124)](readFileSync(join(_0x26ce66,_0x3ed253(0x14f),'lovrabet.manifest.json'),_0x3ed253(0x147))),_0x4ebcf2=join(_0x26ce66,_0x3ed253(0x14f),SKILL_NAME),_0x5f4be8=frontmatterValue(readFileSync(join(_0x4ebcf2,_0x3ed253(0x114)),_0x3ed253(0x147)),_0x3ed253(0x14a)),_0x46411f=listFiles(_0x4ebcf2);if(_0xab99fe[_0x3ed253(0x131)]!==0x1||_0xab99fe[_0x3ed253(0x132)]!==SKILL_NAME||!_0x546ba9['version']||_0xab99fe[_0x3ed253(0x113)]!==_0x546ba9[_0x3ed253(0x14a)]||_0xab99fe[_0x3ed253(0x14d)]!==_0x546ba9[_0x3ed253(0x14a)]||_0x5f4be8!==_0x546ba9['version']||!sameFiles(_0x46411f,_0xab99fe[_0x3ed253(0x12a)])||digestFiles(_0x4ebcf2,_0x46411f)!==_0xab99fe[_0x3ed253(0x141)])throw new Error(_0x3ed253(0x13a));return{'packageVersion':_0x546ba9['version'],'skillVersion':_0x5f4be8,'root':_0x4ebcf2,'manifest':_0xab99fe};}function installedSkillPath(_0x2936d4){const _0x1adea9=a136_0x46a372,_0x45fff3=resolveInstalledSkill(SKILL_NAME,{'home':_0x2936d4});if(_0x45fff3['state']===_0x1adea9(0x146))return{'state':_0x1adea9(0x146),'path':dirname(_0x45fff3['path'])};if(_0x45fff3[_0x1adea9(0x116)]===_0x1adea9(0x121))return{'state':_0x1adea9(0x126)};return{'state':_0x1adea9(0x125),'reason':_0x45fff3[_0x1adea9(0x11d)]};}function a136_0x5e52(_0xe56e30,_0x7fc7d){_0xe56e30=_0xe56e30-0x111;const _0x4721aa=a136_0x4721();let _0x5e52bf=_0x4721aa[_0xe56e30];return _0x5e52bf;}export function inspectInstalledBuiltinSkillVersion(_0x1ef990,_0x1b0008={}){const _0x42a7ac=a136_0x46a372,_0x34b630=installedSkillPath(_0x1b0008['home']??homedir());if(_0x34b630['state']===_0x42a7ac(0x126))return{'state':_0x42a7ac(0x126),'expectedVersion':_0x1ef990,'repairCommand':REPAIR_COMMAND};if(_0x34b630['state']===_0x42a7ac(0x125))return{'state':'unverifiable','expectedVersion':_0x1ef990,'reason':_0x34b630[_0x42a7ac(0x11d)],'repairCommand':REPAIR_COMMAND};try{const _0x3abd4a=frontmatterValue(readFileSync(join(_0x34b630[_0x42a7ac(0x13f)],_0x42a7ac(0x114)),_0x42a7ac(0x147)),_0x42a7ac(0x14a));return{'state':_0x3abd4a===_0x1ef990?'current':_0x42a7ac(0x14e),'expectedVersion':_0x1ef990,'skillVersion':_0x3abd4a,'installedPath':_0x34b630[_0x42a7ac(0x13f)],'repairCommand':REPAIR_COMMAND};}catch(_0x1bbfe6){return{'state':_0x42a7ac(0x125),'expectedVersion':_0x1ef990,'installedPath':_0x34b630[_0x42a7ac(0x13f)],'reason':_0x1bbfe6 instanceof Error?_0x1bbfe6[_0x42a7ac(0x143)]:String(_0x1bbfe6),'repairCommand':REPAIR_COMMAND};}}export function inspectBuiltinSkill(_0x3bebc1={}){const _0x41c217=a136_0x46a372,_0x33ef43=_0x3bebc1['packageRoot']??DEFAULT_PACKAGE_ROOT;let _0x4c833d;try{_0x4c833d=readSource(_0x33ef43);}catch(_0x4d33e0){return{'state':_0x41c217(0x125),'packageVersion':_0x41c217(0x111),'reason':_0x4d33e0 instanceof Error?_0x4d33e0[_0x41c217(0x143)]:String(_0x4d33e0),'repairCommand':REPAIR_COMMAND};}const _0x1f2a7e=installedSkillPath(_0x3bebc1['home']??homedir());if(_0x1f2a7e['state']===_0x41c217(0x126))return{'state':_0x41c217(0x126),'packageVersion':_0x4c833d[_0x41c217(0x113)],'repairCommand':REPAIR_COMMAND};if(_0x1f2a7e[_0x41c217(0x116)]==='unverifiable')return{'state':_0x41c217(0x125),'packageVersion':_0x4c833d[_0x41c217(0x113)],'reason':_0x1f2a7e['reason'],'repairCommand':REPAIR_COMMAND};try{const _0x17833b=frontmatterValue(readFileSync(join(_0x1f2a7e[_0x41c217(0x13f)],_0x41c217(0x114)),_0x41c217(0x147)),_0x41c217(0x14a));if(_0x17833b!==_0x4c833d[_0x41c217(0x14d)])return{'state':_0x41c217(0x14e),'packageVersion':_0x4c833d['packageVersion'],'skillVersion':_0x17833b,'installedPath':_0x1f2a7e[_0x41c217(0x13f)],'repairCommand':REPAIR_COMMAND};const _0x48b704=listFiles(_0x1f2a7e[_0x41c217(0x13f)]),_0x34855f=digestFiles(_0x1f2a7e[_0x41c217(0x13f)],_0x48b704);return{'state':sameFiles(_0x48b704,_0x4c833d['manifest'][_0x41c217(0x12a)])&&_0x34855f===_0x4c833d[_0x41c217(0x134)][_0x41c217(0x141)]?_0x41c217(0x144):_0x41c217(0x117),'packageVersion':_0x4c833d[_0x41c217(0x113)],'skillVersion':_0x17833b,'installedPath':_0x1f2a7e[_0x41c217(0x13f)],'digest':_0x34855f,'repairCommand':REPAIR_COMMAND};}catch(_0x220cc5){return{'state':_0x41c217(0x125),'packageVersion':_0x4c833d[_0x41c217(0x113)],'installedPath':_0x1f2a7e[_0x41c217(0x13f)],'reason':_0x220cc5 instanceof Error?_0x220cc5[_0x41c217(0x143)]:String(_0x220cc5),'repairCommand':REPAIR_COMMAND};}}function failure(_0x264c12,_0x3dd2a9,_0x44eafd,_0x503444){const _0xb79be=a136_0x46a372;return{'ok':![],'code':_0x264c12,'packageVersion':_0x3dd2a9[_0xb79be(0x113)],'skillVersion':_0x3dd2a9['skillVersion'],'installedPath':_0x503444,'changed':![],'repairCommand':REPAIR_COMMAND,'error':_0x44eafd instanceof Error?_0x44eafd['message']:String(_0x44eafd)};}export function installBuiltinSkill(_0x20a79c={}){const _0xa1fd94=a136_0x46a372,_0x32c07c=_0x20a79c[_0xa1fd94(0x12c)]??DEFAULT_PACKAGE_ROOT,_0x2d4e25=_0x20a79c[_0xa1fd94(0x130)]??homedir();let _0x5bbb8a;try{_0x5bbb8a=readSource(_0x32c07c);}catch(_0x196343){return failure('SOURCE_INVALID',{'packageVersion':_0xa1fd94(0x111),'skillVersion':_0xa1fd94(0x111)},_0x196343);}const _0x1cf0ba=inspectBuiltinSkill({'packageRoot':_0x32c07c,'home':_0x2d4e25}),_0xf9b5a3=runNpxSkillsAddGlobal(_0x32c07c,_0x5bbb8a[_0xa1fd94(0x119)],{'stdio':_0x20a79c['stdio']??_0xa1fd94(0x135),'expectedSkillName':SKILL_NAME,'presence':{'home':_0x2d4e25}});if(_0xf9b5a3['skipped'])return{'ok':!![],'packageVersion':_0x5bbb8a['packageVersion'],'skillVersion':_0x5bbb8a[_0xa1fd94(0x14d)],'installedPath':_0x1cf0ba['installedPath'],'changed':![],'repairCommand':REPAIR_COMMAND};if(!_0xf9b5a3['ok'])return failure(_0xa1fd94(0x11c),_0x5bbb8a,_0xf9b5a3[_0xa1fd94(0x12b)]??_0xa1fd94(0x14c)+_0xf9b5a3[_0xa1fd94(0x12f)]);const _0x273931=inspectBuiltinSkill({'packageRoot':_0x32c07c,'home':_0x2d4e25});if(_0x273931[_0xa1fd94(0x116)]!==_0xa1fd94(0x144))return failure(_0xa1fd94(0x145),_0x5bbb8a,_0x273931['reason']??_0xa1fd94(0x11f)+_0x273931[_0xa1fd94(0x116)],_0x273931[_0xa1fd94(0x112)]);return{'ok':!![],'packageVersion':_0x5bbb8a[_0xa1fd94(0x113)],'skillVersion':_0x5bbb8a['skillVersion'],'installedPath':_0x273931['installedPath'],'changed':_0x1cf0ba[_0xa1fd94(0x116)]!==_0xa1fd94(0x144),'repairCommand':REPAIR_COMMAND};}
@@ -1 +1 @@
1
- const a137_0x255dca=a137_0x46b7;(function(_0x59b216,_0x3f70ae){const _0x223b86=a137_0x46b7,_0x2dd993=_0x59b216();while(!![]){try{const _0x5293b4=-parseInt(_0x223b86(0x1c6))/0x1*(-parseInt(_0x223b86(0x1b4))/0x2)+parseInt(_0x223b86(0x1c1))/0x3+-parseInt(_0x223b86(0x1ac))/0x4*(parseInt(_0x223b86(0x1ca))/0x5)+parseInt(_0x223b86(0x1c4))/0x6+-parseInt(_0x223b86(0x1c0))/0x7+-parseInt(_0x223b86(0x1b0))/0x8*(parseInt(_0x223b86(0x1aa))/0x9)+-parseInt(_0x223b86(0x1d8))/0xa*(parseInt(_0x223b86(0x1b2))/0xb);if(_0x5293b4===_0x3f70ae)break;else _0x2dd993['push'](_0x2dd993['shift']());}catch(_0x2c5bee){_0x2dd993['push'](_0x2dd993['shift']());}}}(a137_0x558f,0x4a46d));import{execaSync}from'execa';import{LOVRABET_SKILL_SOURCE as a137_0x18d3ac}from'../constant/distribution.js';import{PRODUCT_CONFIG,productEnvName}from'../constant/product.js';import{resolveInstalledSkill}from'../skills/skill-presence.js';export const LOVRABET_SKILL_SOURCE=a137_0x18d3ac;export const LOVRABET_SKILL_GIT_SOURCE=PRODUCT_CONFIG[a137_0x255dca(0x1a9)];export const LOVRABET_GLOBAL_SKILL_NAME=PRODUCT_CONFIG[a137_0x255dca(0x1db)];export function resolveGlobalSkillName(_0x558313){const _0x99c2ba=a137_0x255dca;switch(_0x558313[_0x99c2ba(0x1c2)]()){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[a137_0x255dca(0x1d1)]);const CHILD_OUTPUT_MAX_BUFFER=0x10*0x400*0x400;function failure(_0x1fe91b,_0x1e21c5,_0x19b588){return{'ok':![],'status':_0x1e21c5,'code':_0x1fe91b,'error':'['+_0x1fe91b+']\x20'+_0x19b588};}export function shouldSkipNpxSkillsAdd(){return process.env[LOVRABET_SKIP_NPX_SKILLS_ENV]==='1';}function a137_0x46b7(_0x20761e,_0x33d4b5){_0x20761e=_0x20761e-0x1a7;const _0x558f02=a137_0x558f();let _0x46b77d=_0x558f02[_0x20761e];return _0x46b77d;}export function runNpxSkillsAddGlobal(_0x1c1f7a,_0x26d7e5=LOVRABET_SKILL_SOURCE,_0x2becc5){const _0x2e54b8=a137_0x255dca;if(shouldSkipNpxSkillsAdd())return{'ok':!![],'status':0x0,'skipped':!![]};const _0x2c1fd4=['-y',_0x2e54b8(0x1ae),_0x2e54b8(0x1d4),_0x26d7e5,'-g','-y'],_0x2670e3=[_0x2e54b8(0x1be),..._0x2c1fd4]['join']('\x20');console[_0x2e54b8(0x1cf)]('*\x20'+_0x2670e3);const _0x3cc241={...process.env};delete _0x3cc241[_0x2e54b8(0x1bd)],delete _0x3cc241['NPM_CONFIG_GLOBAL'];const _0x265a68=execaSync(_0x2e54b8(0x1be),_0x2c1fd4,{'cwd':_0x1c1f7a,'stdio':_0x2e54b8(0x1a8),'env':_0x3cc241,'extendEnv':![],'shell':![],'reject':![],'maxBuffer':CHILD_OUTPUT_MAX_BUFFER}),_0xd386bb=[_0x265a68[_0x2e54b8(0x1cb)]?String(_0x265a68[_0x2e54b8(0x1cb)]):'',_0x265a68[_0x2e54b8(0x1d7)]?String(_0x265a68[_0x2e54b8(0x1d7)]):''][_0x2e54b8(0x1d2)](Boolean)['join']('\x0a')[_0x2e54b8(0x1c2)](),_0x53a769=_0x265a68[_0x2e54b8(0x1c3)]??null;_0x2becc5?.[_0x2e54b8(0x1af)]!=='pipe'&&_0xd386bb&&console[_0x2e54b8(0x1cf)](_0xd386bb);if(_0x265a68[_0x2e54b8(0x1ab)]){const _0x540ff9=_0x265a68[_0x2e54b8(0x1ab)]==='ENOENT'?_0x2e54b8(0x1b5):_0x265a68[_0x2e54b8(0x1ab)]==='EPERM'||_0x265a68[_0x2e54b8(0x1ab)]===_0x2e54b8(0x1d9)?_0x2e54b8(0x1bc):_0x2e54b8(0x1dc);return failure(_0x540ff9,_0x53a769,_0x265a68['shortMessage']??_0x265a68[_0x2e54b8(0x1d5)]??_0x265a68[_0x2e54b8(0x1ab)]);}if(_0x265a68[_0x2e54b8(0x1ba)])return failure(_0x2e54b8(0x1c5),_0x53a769,_0x2e54b8(0x1d3)+_0x265a68[_0x2e54b8(0x1ba)]);if(_0x265a68['failed']&&_0x53a769===null)return failure('SPAWN_FAILED',_0x53a769,_0x265a68['shortMessage']??_0x265a68[_0x2e54b8(0x1d5)]??_0x2e54b8(0x1d0));if(_0x53a769!==0x0)return failure('CHILD_EXIT_NONZERO',_0x53a769,_0xd386bb||_0x265a68['shortMessage']||'exit\x20'+(_0x53a769??_0x2e54b8(0x1ce)));const _0x4e74fc=_0x2becc5?.[_0x2e54b8(0x1bb)]??resolveGlobalSkillName(_0x26d7e5),_0x452c8=_0x4e74fc?resolveInstalledSkill(_0x4e74fc,_0x2becc5?.[_0x2e54b8(0x1b1)]):undefined,_0x1d9401=_0xd386bb['match'](/Failed to install\s+(\d+)/i);if(_0x1d9401&&Number(_0x1d9401[0x1])>0x0){const _0x1c144a=_0x2e54b8(0x1c7)+_0x1d9401[0x1]+_0x2e54b8(0x1cc)+(_0xd386bb?':\x0a'+_0xd386bb:'');if(_0x452c8?.['state']===_0x2e54b8(0x1cd))return console[_0x2e54b8(0x1bf)]('!\x20'+_0x1c144a),{'ok':!![],'status':0x0};return failure(_0x2e54b8(0x1c8),0x0,_0x1c144a);}if(_0x4e74fc&&_0x452c8){if(_0x452c8[_0x2e54b8(0x1b6)]===_0x2e54b8(0x1d6))return failure(_0x2e54b8(0x1b7),0x0,_0x2e54b8(0x1ad)+_0x4e74fc+_0x2e54b8(0x1da)+_0x452c8[_0x2e54b8(0x1b3)][_0x2e54b8(0x1b8)](',\x20')+')');_0x452c8['state']==='unverifiable'&&console['warn'](_0x2e54b8(0x1c9)+_0x4e74fc+_0x2e54b8(0x1b9)+_0x452c8[_0x2e54b8(0x1a7)]);}return{'ok':!![],'status':0x0};}function a137_0x558f(){const _0x4446a0=['171CZtauM','code','268usJaGA','Skill\x20\x22','skills@latest','stdio','20392GPuXZr','presence','11nfRmxK','checked','4tWpTGo','NPX_NOT_FOUND','state','SKILL_NOT_INSTALLED','join','\x22\x20install\x20state:\x20','signal','expectedSkillName','PERMISSION_DENIED','npm_config_global','npx','warn','1967126hZHcKh','504747aUgskb','trim','exitCode','3563694OKCiwp','CHILD_TERMINATED','252986lSviOH','Installer\x20reported\x20','INSTALL_PARTIAL','!\x20Could\x20not\x20verify\x20\x22','24045MVbXNX','stdout','\x20failed\x20target(s)','present','unknown','log','npx\x20failed\x20to\x20start','skipNpxSkillsEnvSuffix','filter','npx\x20terminated\x20by\x20signal\x20','add','message','absent','stderr','3122810qaOsoM','EACCES','\x22\x20not\x20found\x20after\x20install\x20(checked\x20','globalSkillName','SPAWN_FAILED','reason','pipe','internalSkillSource'];a137_0x558f=function(){return _0x4446a0;};return a137_0x558f();}
1
+ function a137_0x94ac(){const _0x33c117=['message','CHILD_EXIT_NONZERO','shortMessage','stdout','SPAWN_FAILED','336750ViJFjX','SKILL_NOT_INSTALLED','54666TxvfgY','stdio','INSTALL_PARTIAL','Skill\x20\x22','246yVsjJT','failed','warn','pipe','npx','absent','state','949616xvntJl','add','skipNpxSkillsEnvSuffix','PERMISSION_DENIED','158747qHigQA','npx\x20terminated\x20by\x20signal\x20','code','\x22\x20install\x20state:\x20','ENOENT','stderr','Installer\x20reported\x20','EPERM','exitCode','filter','signal','25735bDTZPp','1060NqsKhy','8UHAvnD','join','174600MbeCdx','checked','!\x20Could\x20not\x20verify\x20\x22','260302OqzEUv','match','reason','unknown','NPX_NOT_FOUND','log','presence','trim','npx\x20failed\x20to\x20start','globalSkillName','NPM_CONFIG_GLOBAL','internalSkillSource'];a137_0x94ac=function(){return _0x33c117;};return a137_0x94ac();}const a137_0x54e360=a137_0xd9b7;(function(_0x16aa8d,_0x40bc3e){const _0x2ec239=a137_0xd9b7,_0x58345e=_0x16aa8d();while(!![]){try{const _0x3d7245=parseInt(_0x2ec239(0x17c))/0x1+-parseInt(_0x2ec239(0x16b))/0x2+parseInt(_0x2ec239(0x18b))/0x3*(-parseInt(_0x2ec239(0x189))/0x4)+parseInt(_0x2ec239(0x187))/0x5*(-parseInt(_0x2ec239(0x171))/0x6)+-parseInt(_0x2ec239(0x18e))/0x7+-parseInt(_0x2ec239(0x178))/0x8+-parseInt(_0x2ec239(0x16d))/0x9*(-parseInt(_0x2ec239(0x188))/0xa);if(_0x3d7245===_0x40bc3e)break;else _0x58345e['push'](_0x58345e['shift']());}catch(_0x8a300b){_0x58345e['push'](_0x58345e['shift']());}}}(a137_0x94ac,0x24d75));import{execaSync}from'execa';import{LOVRABET_SKILL_SOURCE as a137_0x35977b}from'../constant/distribution.js';import{PRODUCT_CONFIG,productEnvName}from'../constant/product.js';import{resolveInstalledSkill}from'../skills/skill-presence.js';export const LOVRABET_SKILL_SOURCE=a137_0x35977b;export const LOVRABET_SKILL_GIT_SOURCE=PRODUCT_CONFIG[a137_0x54e360(0x199)];export const LOVRABET_GLOBAL_SKILL_NAME=PRODUCT_CONFIG[a137_0x54e360(0x197)];function a137_0xd9b7(_0x2df32d,_0x3c37ad){_0x2df32d=_0x2df32d-0x16a;const _0x94aca9=a137_0x94ac();let _0xd9b76c=_0x94aca9[_0x2df32d];return _0xd9b76c;}export function resolveGlobalSkillName(_0x3933a0){const _0x3ecd7e=a137_0x54e360;switch(_0x3933a0[_0x3ecd7e(0x195)]()){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[a137_0x54e360(0x17a)]);const CHILD_OUTPUT_MAX_BUFFER=0x10*0x400*0x400;function failure(_0x26200d,_0xfa70d2,_0x403761){return{'ok':![],'status':_0xfa70d2,'code':_0x26200d,'error':'['+_0x26200d+']\x20'+_0x403761};}export function shouldSkipNpxSkillsAdd(){return process.env[LOVRABET_SKIP_NPX_SKILLS_ENV]==='1';}export function runNpxSkillsAddGlobal(_0x57cbd3,_0x2894da=LOVRABET_SKILL_SOURCE,_0x2178e2){const _0x246bbf=a137_0x54e360;if(shouldSkipNpxSkillsAdd())return{'ok':!![],'status':0x0,'skipped':!![]};const _0x5d6f60=['-y','skills@latest',_0x246bbf(0x179),_0x2894da,'-g','-y'],_0x2cc200=[_0x246bbf(0x175),..._0x5d6f60][_0x246bbf(0x18a)]('\x20');console[_0x246bbf(0x193)]('*\x20'+_0x2cc200);const _0xcdf548={...process.env};delete _0xcdf548['npm_config_global'],delete _0xcdf548[_0x246bbf(0x198)];const _0x477a43=execaSync(_0x246bbf(0x175),_0x5d6f60,{'cwd':_0x57cbd3,'stdio':'pipe','env':_0xcdf548,'extendEnv':![],'shell':![],'reject':![],'maxBuffer':CHILD_OUTPUT_MAX_BUFFER}),_0x5123ac=[_0x477a43['stdout']?String(_0x477a43[_0x246bbf(0x19d)]):'',_0x477a43['stderr']?String(_0x477a43[_0x246bbf(0x181)]):''][_0x246bbf(0x185)](Boolean)['join']('\x0a')[_0x246bbf(0x195)](),_0x37c363=_0x477a43[_0x246bbf(0x184)]??null;_0x2178e2?.[_0x246bbf(0x16e)]!==_0x246bbf(0x174)&&_0x5123ac&&console[_0x246bbf(0x193)](_0x5123ac);if(_0x477a43[_0x246bbf(0x17e)]){const _0x1fb433=_0x477a43['code']===_0x246bbf(0x180)?_0x246bbf(0x192):_0x477a43[_0x246bbf(0x17e)]===_0x246bbf(0x183)||_0x477a43['code']==='EACCES'?_0x246bbf(0x17b):_0x246bbf(0x16a);return failure(_0x1fb433,_0x37c363,_0x477a43[_0x246bbf(0x19c)]??_0x477a43[_0x246bbf(0x19a)]??_0x477a43[_0x246bbf(0x17e)]);}if(_0x477a43[_0x246bbf(0x186)])return failure('CHILD_TERMINATED',_0x37c363,_0x246bbf(0x17d)+_0x477a43[_0x246bbf(0x186)]);if(_0x477a43[_0x246bbf(0x172)]&&_0x37c363===null)return failure(_0x246bbf(0x16a),_0x37c363,_0x477a43['shortMessage']??_0x477a43[_0x246bbf(0x19a)]??_0x246bbf(0x196));if(_0x37c363!==0x0)return failure(_0x246bbf(0x19b),_0x37c363,_0x5123ac||_0x477a43['shortMessage']||'exit\x20'+(_0x37c363??_0x246bbf(0x191)));const _0x5859f1=_0x2178e2?.['expectedSkillName']??resolveGlobalSkillName(_0x2894da),_0x450b40=_0x5859f1?resolveInstalledSkill(_0x5859f1,_0x2178e2?.[_0x246bbf(0x194)]):undefined,_0x15a063=_0x5123ac[_0x246bbf(0x18f)](/Failed to install\s+(\d+)/i);if(_0x15a063&&Number(_0x15a063[0x1])>0x0){const _0xc34dee=_0x246bbf(0x182)+_0x15a063[0x1]+'\x20failed\x20target(s)'+(_0x5123ac?':\x0a'+_0x5123ac:'');if(_0x450b40?.[_0x246bbf(0x177)]==='present')return console[_0x246bbf(0x173)]('!\x20'+_0xc34dee),{'ok':!![],'status':0x0};return failure(_0x246bbf(0x16f),0x0,_0xc34dee);}if(_0x5859f1&&_0x450b40){if(_0x450b40[_0x246bbf(0x177)]===_0x246bbf(0x176))return failure(_0x246bbf(0x16c),0x0,_0x246bbf(0x170)+_0x5859f1+'\x22\x20not\x20found\x20after\x20install\x20(checked\x20'+_0x450b40[_0x246bbf(0x18c)][_0x246bbf(0x18a)](',\x20')+')');_0x450b40[_0x246bbf(0x177)]==='unverifiable'&&console[_0x246bbf(0x173)](_0x246bbf(0x18d)+_0x5859f1+_0x246bbf(0x17f)+_0x450b40[_0x246bbf(0x190)]);}return{'ok':!![],'status':0x0};}
@@ -1 +1 @@
1
- const a138_0x15caba=a138_0x46ac;function a138_0x549b(){const _0x3b6ef5=['.svn','2439104edDJxp','lovrabet.skill.json','build','282ymWDcG','133847qdVwZC','dist','5rKbKsr','167028KRVfYb','4451428nFXdIG','17178SbYcjj','.git','node_modules','218XAgNdH','.next','6508593bVJrLH','.cache','.turbo','7391780uZplwt'];a138_0x549b=function(){return _0x3b6ef5;};return a138_0x549b();}(function(_0x565adc,_0xd4f433){const _0x1a51d5=a138_0x46ac,_0x333eb6=_0x565adc();while(!![]){try{const _0x587e25=-parseInt(_0x1a51d5(0x1d0))/0x1+parseInt(_0x1a51d5(0x1d5))/0x2*(parseInt(_0x1a51d5(0x1d2))/0x3)+-parseInt(_0x1a51d5(0x1d1))/0x4*(-parseInt(_0x1a51d5(0x1cf))/0x5)+parseInt(_0x1a51d5(0x1cc))/0x6*(parseInt(_0x1a51d5(0x1cd))/0x7)+-parseInt(_0x1a51d5(0x1c9))/0x8+-parseInt(_0x1a51d5(0x1d7))/0x9+-parseInt(_0x1a51d5(0x1c7))/0xa;if(_0x587e25===_0xd4f433)break;else _0x333eb6['push'](_0x333eb6['shift']());}catch(_0x1b1fc8){_0x333eb6['push'](_0x333eb6['shift']());}}}(a138_0x549b,0xab3df));export const METADATA_FILE=a138_0x15caba(0x1ca);export const SKILL_FILE='SKILL.md';export const IGNORED_FILE_NAMES=new Set([METADATA_FILE,'.DS_Store']);function a138_0x46ac(_0x5c8627,_0x5ad842){_0x5c8627=_0x5c8627-0x1c7;const _0x549bb9=a138_0x549b();let _0x46accb=_0x549bb9[_0x5c8627];return _0x46accb;}export const IGNORED_DIR_NAMES=new Set([a138_0x15caba(0x1d3),'.hg',a138_0x15caba(0x1c8),a138_0x15caba(0x1d4),a138_0x15caba(0x1d6),a138_0x15caba(0x1ce),a138_0x15caba(0x1cb),'coverage',a138_0x15caba(0x1d9),a138_0x15caba(0x1d8)]);
1
+ const a138_0x2c3d8c=a138_0x5720;(function(_0x2e7a82,_0x50f3bb){const _0x3cafe7=a138_0x5720,_0x2730f6=_0x2e7a82();while(!![]){try{const _0x38e8c4=-parseInt(_0x3cafe7(0xf3))/0x1*(parseInt(_0x3cafe7(0xf6))/0x2)+parseInt(_0x3cafe7(0xed))/0x3+parseInt(_0x3cafe7(0xf7))/0x4+-parseInt(_0x3cafe7(0xfa))/0x5+-parseInt(_0x3cafe7(0xf9))/0x6+parseInt(_0x3cafe7(0xf4))/0x7+-parseInt(_0x3cafe7(0xec))/0x8*(-parseInt(_0x3cafe7(0xeb))/0x9);if(_0x38e8c4===_0x50f3bb)break;else _0x2730f6['push'](_0x2730f6['shift']());}catch(_0x2a2f00){_0x2730f6['push'](_0x2730f6['shift']());}}}(a138_0x16ba,0xcfb57));function a138_0x16ba(){const _0xe27681=['node_modules','.svn','.DS_Store','.hg','.git','16429lbzboR','9119215PQIPfr','build','162AqAbCd','6394248Cndnbh','.cache','3551064ESbovX','7286365jJUmFk','SKILL.md','594tiLaLh','36488ZiRknj','3084924eusqTq'];a138_0x16ba=function(){return _0xe27681;};return a138_0x16ba();}export const METADATA_FILE='lovrabet.skill.json';export const SKILL_FILE=a138_0x2c3d8c(0xfb);export const IGNORED_FILE_NAMES=new Set([METADATA_FILE,a138_0x2c3d8c(0xf0)]);function a138_0x5720(_0xb03182,_0x5db023){_0xb03182=_0xb03182-0xeb;const _0x16ba13=a138_0x16ba();let _0x5720bf=_0x16ba13[_0xb03182];return _0x5720bf;}export const IGNORED_DIR_NAMES=new Set([a138_0x2c3d8c(0xf2),a138_0x2c3d8c(0xf1),a138_0x2c3d8c(0xef),a138_0x2c3d8c(0xee),'.next','dist',a138_0x2c3d8c(0xf5),'coverage','.turbo',a138_0x2c3d8c(0xf8)]);
@@ -1 +1 @@
1
- (function(_0x4e2a47,_0x21b51e){const _0x3e67e3=a139_0x5b13,_0xa592a5=_0x4e2a47();while(!![]){try{const _0x44eab2=parseInt(_0x3e67e3(0x132))/0x1+parseInt(_0x3e67e3(0x13d))/0x2*(parseInt(_0x3e67e3(0x136))/0x3)+-parseInt(_0x3e67e3(0x130))/0x4*(-parseInt(_0x3e67e3(0x12d))/0x5)+-parseInt(_0x3e67e3(0x13e))/0x6+parseInt(_0x3e67e3(0x133))/0x7*(parseInt(_0x3e67e3(0x12f))/0x8)+parseInt(_0x3e67e3(0x137))/0x9*(-parseInt(_0x3e67e3(0x139))/0xa)+-parseInt(_0x3e67e3(0x131))/0xb*(parseInt(_0x3e67e3(0x134))/0xc);if(_0x44eab2===_0x21b51e)break;else _0xa592a5['push'](_0xa592a5['shift']());}catch(_0x276bae){_0xa592a5['push'](_0xa592a5['shift']());}}}(a139_0x5c48,0xb0e30));import{lstatSync,readlinkSync,realpathSync,renameSync,rmSync,writeFileSync}from'node:fs';import{dirname,isAbsolute,resolve,sep}from'node:path';import{CliErrors}from'../../errors.js';function a139_0x5b13(_0xd1612,_0x4f4d97){_0xd1612=_0xd1612-0x12c;const _0x5c484c=a139_0x5c48();let _0x5b13c0=_0x5c484c[_0xd1612];return _0x5b13c0;}function a139_0x5c48(){const _0x2d3eb8=['75867JAVnSH','1081987xKvuov','1141588FgOrgD','1740YMqHuD','startsWith','463071HwJGyM','4359240ClXRJL','stringify','10RShFZT','validation','.tmp','split','2tefXmm','4894134LGADID','isSymbolicLink','endsWith','323355THJAlm','Unsafe\x20Skill\x20file\x20path:\x20','56xGJiya','40TieRwW'];a139_0x5c48=function(){return _0x2d3eb8;};return a139_0x5c48();}import{normalizeSkillRelativePath}from'./local-files.js';export function resolveManagedFilePath(_0xa68f7c,_0x42d2cc){const _0x574f2d=a139_0x5b13,_0x1d6e12=normalizeSkillRelativePath(_0x42d2cc),_0xc45e99=realOrResolved(_0xa68f7c),_0x2375ca=resolve(_0xc45e99,..._0x1d6e12[_0x574f2d(0x13c)]('/'));if(!isPathInside(_0x2375ca,_0xc45e99))throw CliErrors['validation'](_0x574f2d(0x12e)+_0x42d2cc);return ensureNoSymlinkInManagedPath(_0xc45e99,_0x1d6e12),_0x2375ca;}export function ensureNoSymlinkInManagedPath(_0x3c3076,_0x461840){const _0x5ed3f4=a139_0x5b13;let _0x4518f3=_0x3c3076;for(const _0x239546 of _0x461840[_0x5ed3f4(0x13c)]('/')){_0x4518f3=resolve(_0x4518f3,_0x239546);const _0x3fc469=lstatIfPresent(_0x4518f3);if(_0x3fc469?.[_0x5ed3f4(0x13f)]())throw CliErrors[_0x5ed3f4(0x13a)]('Refusing\x20to\x20write\x20through\x20Skill\x20symlink\x20path:\x20'+_0x461840);}}export function isDanglingSymlink(_0x46c1b7){const _0x4c3fc8=a139_0x5b13;try{return lstatSync(_0x46c1b7)[_0x4c3fc8(0x13f)]();}catch{return![];}}export function resolveSymlinkTarget(_0x2bcbaa){const _0x3e7227=readlinkSync(_0x2bcbaa);return isAbsolute(_0x3e7227)?_0x3e7227:resolve(dirname(_0x2bcbaa),_0x3e7227);}export function isPathInside(_0x2ae540,_0x17cf71){const _0x1e977b=a139_0x5b13,_0x2324fb=_0x2ae540[_0x1e977b(0x12c)](sep)?_0x2ae540:''+_0x2ae540+sep,_0x2a8f0d=_0x17cf71[_0x1e977b(0x12c)](sep)?_0x17cf71:''+_0x17cf71+sep;return _0x2ae540===_0x17cf71||_0x2324fb[_0x1e977b(0x135)](_0x2a8f0d);}export function realOrResolved(_0x5b0d6b){try{return realpathSync(_0x5b0d6b);}catch{return resolve(_0x5b0d6b);}}export function lstatIfPresent(_0x5a60a6){try{return lstatSync(_0x5a60a6);}catch{return undefined;}}export function writeTextAtomic(_0x3a7c1d,_0x1e84a7,_0x2c3b75){writeBytesAtomic(_0x3a7c1d,Buffer['from'](_0x1e84a7,'utf8'),_0x2c3b75);}export function writeBytesAtomic(_0x10551d,_0x872374,_0xfc0a26){const _0x4dcee2=a139_0x5b13,_0x2352ff=_0x10551d+_0x4dcee2(0x13b);try{writeFileSync(_0x2352ff,_0x872374,{'mode':_0xfc0a26}),renameSync(_0x2352ff,_0x10551d);}catch(_0x299eb3){try{rmSync(_0x2352ff,{'force':!![]});}catch{}throw _0x299eb3;}}export function writeJsonAtomic(_0x146ab8,_0x1092df){const _0x49b916=a139_0x5b13;writeTextAtomic(_0x146ab8,JSON[_0x49b916(0x138)](_0x1092df,null,0x2)+'\x0a',0x180);}
1
+ (function(_0x25c221,_0x5b5fd6){const _0x5d4852=a139_0x77ee,_0x238a57=_0x25c221();while(!![]){try{const _0x39b539=-parseInt(_0x5d4852(0x13c))/0x1*(-parseInt(_0x5d4852(0x146))/0x2)+parseInt(_0x5d4852(0x144))/0x3+-parseInt(_0x5d4852(0x140))/0x4+parseInt(_0x5d4852(0x14a))/0x5+-parseInt(_0x5d4852(0x143))/0x6*(-parseInt(_0x5d4852(0x13f))/0x7)+parseInt(_0x5d4852(0x149))/0x8+-parseInt(_0x5d4852(0x145))/0x9;if(_0x39b539===_0x5b5fd6)break;else _0x238a57['push'](_0x238a57['shift']());}catch(_0xefe3ed){_0x238a57['push'](_0x238a57['shift']());}}}(a139_0x3193,0x1a873));import{lstatSync,readlinkSync,realpathSync,renameSync,rmSync,writeFileSync}from'node:fs';import{dirname,isAbsolute,resolve,sep}from'node:path';function a139_0x77ee(_0x6af751,_0x58608e){_0x6af751=_0x6af751-0x13a;const _0x3193a6=a139_0x3193();let _0x77ee94=_0x3193a6[_0x6af751];return _0x77ee94;}import{CliErrors}from'../../errors.js';import{normalizeSkillRelativePath}from'./local-files.js';function a139_0x3193(){const _0x421367=['142816TqvgMs','305880ybbyns','validation','Refusing\x20to\x20write\x20through\x20Skill\x20symlink\x20path:\x20','Unsafe\x20Skill\x20file\x20path:\x20','3oyUTGn','endsWith','from','28GXICmr','286656ngUqcK','startsWith','split','117408ZiKpZf','176739zpFDEP','2074365OSyQCu','129730kTwMyy','.tmp','isSymbolicLink'];a139_0x3193=function(){return _0x421367;};return a139_0x3193();}export function resolveManagedFilePath(_0x22edf5,_0x3984a3){const _0x33bec3=a139_0x77ee,_0x219487=normalizeSkillRelativePath(_0x3984a3),_0x3d2224=realOrResolved(_0x22edf5),_0x2716e1=resolve(_0x3d2224,..._0x219487[_0x33bec3(0x142)]('/'));if(!isPathInside(_0x2716e1,_0x3d2224))throw CliErrors[_0x33bec3(0x14b)](_0x33bec3(0x13b)+_0x3984a3);return ensureNoSymlinkInManagedPath(_0x3d2224,_0x219487),_0x2716e1;}export function ensureNoSymlinkInManagedPath(_0x571812,_0x54a55b){const _0x56d79c=a139_0x77ee;let _0x2eb6a6=_0x571812;for(const _0x30cbea of _0x54a55b[_0x56d79c(0x142)]('/')){_0x2eb6a6=resolve(_0x2eb6a6,_0x30cbea);const _0x40fdda=lstatIfPresent(_0x2eb6a6);if(_0x40fdda?.[_0x56d79c(0x148)]())throw CliErrors[_0x56d79c(0x14b)](_0x56d79c(0x13a)+_0x54a55b);}}export function isDanglingSymlink(_0x306977){const _0x119656=a139_0x77ee;try{return lstatSync(_0x306977)[_0x119656(0x148)]();}catch{return![];}}export function resolveSymlinkTarget(_0x489c74){const _0x25c332=readlinkSync(_0x489c74);return isAbsolute(_0x25c332)?_0x25c332:resolve(dirname(_0x489c74),_0x25c332);}export function isPathInside(_0x4d8a0c,_0x2456d5){const _0x491e80=a139_0x77ee,_0x428275=_0x4d8a0c[_0x491e80(0x13d)](sep)?_0x4d8a0c:''+_0x4d8a0c+sep,_0x42f617=_0x2456d5[_0x491e80(0x13d)](sep)?_0x2456d5:''+_0x2456d5+sep;return _0x4d8a0c===_0x2456d5||_0x428275[_0x491e80(0x141)](_0x42f617);}export function realOrResolved(_0x50355f){try{return realpathSync(_0x50355f);}catch{return resolve(_0x50355f);}}export function lstatIfPresent(_0x3809d5){try{return lstatSync(_0x3809d5);}catch{return undefined;}}export function writeTextAtomic(_0x5e0b50,_0x5bbe98,_0x176477){const _0x2ad33e=a139_0x77ee;writeBytesAtomic(_0x5e0b50,Buffer[_0x2ad33e(0x13e)](_0x5bbe98,'utf8'),_0x176477);}export function writeBytesAtomic(_0x300374,_0x4d8b3d,_0x23002f){const _0x3bf53b=a139_0x77ee,_0x1e9435=_0x300374+_0x3bf53b(0x147);try{writeFileSync(_0x1e9435,_0x4d8b3d,{'mode':_0x23002f}),renameSync(_0x1e9435,_0x300374);}catch(_0x1e771e){try{rmSync(_0x1e9435,{'force':!![]});}catch{}throw _0x1e771e;}}export function writeJsonAtomic(_0xc6fa51,_0x495b6c){writeTextAtomic(_0xc6fa51,JSON['stringify'](_0x495b6c,null,0x2)+'\x0a',0x180);}
@@ -1 +1 @@
1
- (function(_0x273e2f,_0x406335){const _0xf7e3cf=a140_0x2057,_0x4ef0c5=_0x273e2f();while(!![]){try{const _0x1a0ae6=parseInt(_0xf7e3cf(0x127))/0x1*(parseInt(_0xf7e3cf(0x12a))/0x2)+parseInt(_0xf7e3cf(0x124))/0x3+-parseInt(_0xf7e3cf(0x11e))/0x4+parseInt(_0xf7e3cf(0x123))/0x5*(-parseInt(_0xf7e3cf(0x129))/0x6)+parseInt(_0xf7e3cf(0x128))/0x7*(parseInt(_0xf7e3cf(0x11f))/0x8)+parseInt(_0xf7e3cf(0x120))/0x9*(-parseInt(_0xf7e3cf(0x11b))/0xa)+-parseInt(_0xf7e3cf(0x122))/0xb;if(_0x1a0ae6===_0x406335)break;else _0x4ef0c5['push'](_0x4ef0c5['shift']());}catch(_0x170583){_0x4ef0c5['push'](_0x4ef0c5['shift']());}}}(a140_0xc09b,0xb85e5));function a140_0x2057(_0x332ade,_0x2a561f){_0x332ade=_0x332ade-0x11b;const _0xc09be7=a140_0xc09b();let _0x205734=_0xc09be7[_0x332ade];return _0x205734;}import{createHash}from'node:crypto';import{fileContent,normalizeManifestFiles}from'./local-files.js';function a140_0xc09b(){const _0x1326ee=['9svCCgH','sha256','2769360tOdJfp','45rbYqpN','3657435ZBTNvP','path','digest','1IrHcHu','427xGwmzC','414516OzesaL','235986FRUbFg','1238630ntxeIN','update','hex','889048vmItdi','83632pUTtBS'];a140_0xc09b=function(){return _0x1326ee;};return a140_0xc09b();}export function contentHash(_0x461726){const _0x30f28a=a140_0x2057;return createHash('sha256')[_0x30f28a(0x11c)](_0x461726)['digest'](_0x30f28a(0x11d));}export function fileHash(_0x4eedbe){return bufferSha256(fileContent(_0x4eedbe));}export function bufferSha256(_0xb4c12e){const _0x5bdf20=a140_0x2057;return createHash(_0x5bdf20(0x121))[_0x5bdf20(0x11c)](_0xb4c12e)[_0x5bdf20(0x126)](_0x5bdf20(0x11d));}export function fileTreeHash(_0x58cf23){const _0x96a2e7=a140_0x2057,_0x5d63d9=createHash(_0x96a2e7(0x121));for(const _0x5c5fb3 of normalizeManifestFiles(_0x58cf23)){_0x5d63d9[_0x96a2e7(0x11c)](_0x5c5fb3[_0x96a2e7(0x125)]),_0x5d63d9[_0x96a2e7(0x11c)]('\x00'),_0x5d63d9[_0x96a2e7(0x11c)](_0x5c5fb3[_0x96a2e7(0x121)]),_0x5d63d9[_0x96a2e7(0x11c)]('\x00'),_0x5d63d9[_0x96a2e7(0x11c)](String(_0x5c5fb3['size'])),_0x5d63d9[_0x96a2e7(0x11c)]('\x00');}return _0x5d63d9['digest'](_0x96a2e7(0x11d));}
1
+ function a140_0x58fd(_0x48a158,_0x1848cb){_0x48a158=_0x48a158-0x1e1;const _0x2f8587=a140_0x2f85();let _0x58fd1e=_0x2f8587[_0x48a158];return _0x58fd1e;}(function(_0x208f5b,_0x1ff84c){const _0x595ec4=a140_0x58fd,_0xb94f02=_0x208f5b();while(!![]){try{const _0xbf45da=-parseInt(_0x595ec4(0x1e5))/0x1+-parseInt(_0x595ec4(0x1ec))/0x2*(parseInt(_0x595ec4(0x1e9))/0x3)+-parseInt(_0x595ec4(0x1e7))/0x4*(parseInt(_0x595ec4(0x1f0))/0x5)+-parseInt(_0x595ec4(0x1e8))/0x6*(parseInt(_0x595ec4(0x1ea))/0x7)+-parseInt(_0x595ec4(0x1ed))/0x8+parseInt(_0x595ec4(0x1ef))/0x9+parseInt(_0x595ec4(0x1e2))/0xa;if(_0xbf45da===_0x1ff84c)break;else _0xb94f02['push'](_0xb94f02['shift']());}catch(_0x17a42e){_0xb94f02['push'](_0xb94f02['shift']());}}}(a140_0x2f85,0x87442));import{createHash}from'node:crypto';function a140_0x2f85(){const _0x44ae11=['update','60QwFlnj','12jMXErU','1374VRSTbb','332633JrAQsm','path','116LPEnjC','3440056WdSJjs','hex','5877441OfwQXP','72895lcFMOy','size','17041410FQIoxv','digest','sha256','1032846zmDVvP'];a140_0x2f85=function(){return _0x44ae11;};return a140_0x2f85();}import{fileContent,normalizeManifestFiles}from'./local-files.js';export function contentHash(_0x510db3){const _0x439abf=a140_0x58fd;return createHash(_0x439abf(0x1e4))[_0x439abf(0x1e6)](_0x510db3)[_0x439abf(0x1e3)]('hex');}export function fileHash(_0x2703e9){return bufferSha256(fileContent(_0x2703e9));}export function bufferSha256(_0x1a087c){const _0x285717=a140_0x58fd;return createHash(_0x285717(0x1e4))[_0x285717(0x1e6)](_0x1a087c)[_0x285717(0x1e3)](_0x285717(0x1ee));}export function fileTreeHash(_0x518e99){const _0x5d3640=a140_0x58fd,_0x4a209c=createHash(_0x5d3640(0x1e4));for(const _0x36f95d of normalizeManifestFiles(_0x518e99)){_0x4a209c[_0x5d3640(0x1e6)](_0x36f95d[_0x5d3640(0x1eb)]),_0x4a209c[_0x5d3640(0x1e6)]('\x00'),_0x4a209c[_0x5d3640(0x1e6)](_0x36f95d['sha256']),_0x4a209c['update']('\x00'),_0x4a209c[_0x5d3640(0x1e6)](String(_0x36f95d[_0x5d3640(0x1e1)])),_0x4a209c[_0x5d3640(0x1e6)]('\x00');}return _0x4a209c['digest'](_0x5d3640(0x1ee));}
@@ -1 +1 @@
1
- function a141_0x54d8(_0x4ec79b,_0x23ffbb){_0x4ec79b=_0x4ec79b-0xd0;const _0x4d6f03=a141_0x4d6f();let _0x54d87a=_0x4d6f03[_0x4ec79b];return _0x54d87a;}(function(_0x436630,_0x2b8c20){const _0x27fab8=a141_0x54d8,_0x4513f2=_0x436630();while(!![]){try{const _0x2bf574=-parseInt(_0x27fab8(0xd3))/0x1+parseInt(_0x27fab8(0xd1))/0x2+-parseInt(_0x27fab8(0xd2))/0x3+-parseInt(_0x27fab8(0xd4))/0x4*(-parseInt(_0x27fab8(0xdb))/0x5)+-parseInt(_0x27fab8(0xd5))/0x6+parseInt(_0x27fab8(0xda))/0x7+-parseInt(_0x27fab8(0xd6))/0x8*(parseInt(_0x27fab8(0xd9))/0x9);if(_0x2bf574===_0x2b8c20)break;else _0x4513f2['push'](_0x4513f2['shift']());}catch(_0xc80e0f){_0x4513f2['push'](_0x4513f2['shift']());}}}(a141_0x4d6f,0x35823));import{resolve}from'node:path';function a141_0x4d6f(){const _0x27bd83=['project','freeze','skills','700346WXQRIq','88437goZDrW','175692iXFUIQ','20kBvxKQ','154104cJjOUf','16ZVpYAs','managedRoot','.agents','2970486zNfzXF','2579682ItYwcD','391435MJFjuN','cwd'];a141_0x4d6f=function(){return _0x27bd83;};return a141_0x4d6f();}import{resolveSkillSyncPaths,runtimeAgentSkillRoots,safePathSegment}from'./paths.js';export function resolveRuntimeSkillInstallTarget(_0x490002,_0x32aebf='global',_0x41f3da={}){const _0x2b97f7=a141_0x54d8,_0xd0a73d=resolveSkillSyncPaths(_0x41f3da),_0x3e5f12=safePathSegment(_0x490002,'appCode'),_0x1eebbb=_0x32aebf===_0x2b97f7(0xdd)?[resolve(_0x41f3da[_0x2b97f7(0xdc)]??process[_0x2b97f7(0xdc)](),_0x2b97f7(0xd8),_0x2b97f7(0xd0))]:runtimeAgentSkillRoots(_0xd0a73d);return Object[_0x2b97f7(0xde)]({'scope':_0x32aebf,'appCode':_0x3e5f12,'skillRoots':Object[_0x2b97f7(0xde)](_0x1eebbb),'managedRoot':_0xd0a73d[_0x2b97f7(0xd7)]});}
1
+ function a141_0x2aba(_0x1d5459,_0x20d8a0){_0x1d5459=_0x1d5459-0x93;const _0x40ce5b=a141_0x40ce();let _0x2abac0=_0x40ce5b[_0x1d5459];return _0x2abac0;}const a141_0x5b2882=a141_0x2aba;(function(_0x14d88f,_0x2fcd79){const _0x3364a4=a141_0x2aba,_0x53571e=_0x14d88f();while(!![]){try{const _0x3d52ef=-parseInt(_0x3364a4(0x99))/0x1*(parseInt(_0x3364a4(0x9f))/0x2)+parseInt(_0x3364a4(0x9d))/0x3+parseInt(_0x3364a4(0x95))/0x4*(parseInt(_0x3364a4(0x9b))/0x5)+parseInt(_0x3364a4(0xa2))/0x6*(-parseInt(_0x3364a4(0x96))/0x7)+parseInt(_0x3364a4(0x94))/0x8+parseInt(_0x3364a4(0xa4))/0x9+-parseInt(_0x3364a4(0x98))/0xa*(-parseInt(_0x3364a4(0x97))/0xb);if(_0x3d52ef===_0x2fcd79)break;else _0x53571e['push'](_0x53571e['shift']());}catch(_0x289f12){_0x53571e['push'](_0x53571e['shift']());}}}(a141_0x40ce,0xc0e57));import{resolve}from'node:path';import{resolveSkillSyncPaths,runtimeAgentSkillRoots,safePathSegment}from'./paths.js';export function resolveRuntimeSkillInstallTarget(_0x3e5729,_0x1a65fd=a141_0x5b2882(0x9a),_0x319213={}){const _0x2c6523=a141_0x5b2882,_0x10565d=resolveSkillSyncPaths(_0x319213),_0x1eacf1=safePathSegment(_0x3e5729,_0x2c6523(0xa1)),_0x398a22=_0x1a65fd===_0x2c6523(0xa0)?[resolve(_0x319213[_0x2c6523(0x93)]??process[_0x2c6523(0x93)](),_0x2c6523(0x9c),'skills')]:runtimeAgentSkillRoots(_0x10565d);return Object[_0x2c6523(0xa3)]({'scope':_0x1a65fd,'appCode':_0x1eacf1,'skillRoots':Object[_0x2c6523(0xa3)](_0x398a22),'managedRoot':_0x10565d[_0x2c6523(0x9e)]});}function a141_0x40ce(){const _0x3c9f7b=['948970yotoHC','project','appCode','4880994owewIi','freeze','6118488IfaJQl','cwd','2669896ePTVoh','8DTaMwL','7WBrhkf','11IBBMom','2859820VYISAC','2XeyIlZ','global','2352770laLhHU','.agents','935739BPVsvj','managedRoot'];a141_0x40ce=function(){return _0x3c9f7b;};return a141_0x40ce();}
@@ -1 +1 @@
1
- const a142_0x2e161c=a142_0x1005;(function(_0x3ae6b9,_0x38b550){const _0x162420=a142_0x1005,_0x1bb553=_0x3ae6b9();while(!![]){try{const _0x5cf624=-parseInt(_0x162420(0x182))/0x1+-parseInt(_0x162420(0x193))/0x2+-parseInt(_0x162420(0x1b1))/0x3*(-parseInt(_0x162420(0x184))/0x4)+-parseInt(_0x162420(0x18b))/0x5+parseInt(_0x162420(0x186))/0x6*(-parseInt(_0x162420(0x195))/0x7)+-parseInt(_0x162420(0x18a))/0x8+-parseInt(_0x162420(0x1aa))/0x9*(-parseInt(_0x162420(0x19d))/0xa);if(_0x5cf624===_0x38b550)break;else _0x1bb553['push'](_0x1bb553['shift']());}catch(_0x12569d){_0x1bb553['push'](_0x1bb553['shift']());}}}(a142_0x1aba,0x2f394));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import a142_0x152fd2 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}=a142_0x152fd2,RESERVED_PROJECT_SKILL_CODES=new Set(['lovrabet',a142_0x2e161c(0x1b5),a142_0x2e161c(0x17b)]);function a142_0x1005(_0x42da6d,_0x53fd4c){_0x42da6d=_0x42da6d-0x179;const _0x1aba01=a142_0x1aba();let _0x10051f=_0x1aba01[_0x42da6d];return _0x10051f;}export function linkEffectiveRuntimeSkills(_0x292411,_0x33014e){const _0x58c893=a142_0x2e161c,_0x37275f=new Map();for(const _0x3617cf of _0x292411){const _0x2b8938=_0x3617cf[_0x58c893(0x1b0)][_0x58c893(0x191)];if(!_0x2b8938)continue;const _0x3acde5=_0x37275f['get'](_0x2b8938);(!_0x3acde5||_0x3617cf[_0x58c893(0x1ae)]===_0x58c893(0x188))&&_0x37275f[_0x58c893(0x189)](_0x2b8938,_0x3617cf);}const _0x38a3b1=[];for(const _0x117869 of _0x37275f['values']()){const _0x2e37b3=requireSkillCode(_0x117869[_0x58c893(0x1b0)]),_0x36dcf7=readMetadataIfPresent(_0x117869[_0x58c893(0x1a4)]);if(_0x36dcf7?.[_0x58c893(0x1ab)]!==_0x33014e[_0x58c893(0x1ab)]||_0x36dcf7[_0x58c893(0x191)]!==_0x2e37b3)throw CliErrors[_0x58c893(0x19b)](_0x58c893(0x1b4)+_0x33014e['appCode']+':\x20'+_0x117869['metadataPath']);const _0x224821=runtimeSkillLinkName(_0x33014e,_0x2e37b3);for(const _0x2c9c90 of _0x33014e[_0x58c893(0x179)]){_0x38a3b1[_0x58c893(0x1a3)](ensureManagedSymlink(resolve(_0x2c9c90,_0x224821),_0x117869[_0x58c893(0x1a8)],_0x33014e,_0x2e37b3));}}return _0x38a3b1;}function a142_0x1aba(){const _0x7bd955=['84380Uawpuj','Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20','slice','activeSkillCodes','Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20','managedRoot','push','metadataPath','scopes','accessKey','external-symlink','dir','Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20','1422jXPOUA','appCode','Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20','metadata-mismatch','scope','env','skill','3YgXnMX','filter','length','Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20','runtime-observe','trim','skillRoots','has','secret-retriever','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','company','created','isSymbolicLink','linked-from-protected-root','name','374012pyHbNR','not-managed-symlink','298428soSGng','skipped','148206rPycQN','map','personal','set','2661224VkMGdr','939280EASwEe','pruneSkillCodes','protectedLinkRoots','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20','updated','startsWith','skillCode','project','145704qPZPwL','builtin','70qHqYWO','Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20','contentHash','unchanged','agentsSkillsDir','isDirectory','validation','removed'];a142_0x1aba=function(){return _0x7bd955;};return a142_0x1aba();}export function pruneStaleRuntimeSkillLinks(_0x259c83,_0xbee37,_0x5f2465){const _0x515dc8=a142_0x2e161c,_0x5ab605=new Set([..._0xbee37][_0x515dc8(0x187)](_0x15555c=>_0x15555c[_0x515dc8(0x1b6)]())[_0x515dc8(0x1b2)](Boolean)),_0x442a6b=_0x5f2465?new Set([..._0x5f2465][_0x515dc8(0x187)](_0x23c1e9=>_0x23c1e9['trim']())[_0x515dc8(0x1b2)](Boolean)):undefined,_0x1cba37=[];for(const _0x1b7317 of _0x259c83[_0x515dc8(0x179)]){for(const _0x556c0e of managedTargetSkillLinkPaths(_0x1b7317,_0x259c83)){const _0x2b4d6f=runtimeSkillCodeFromLink(_0x259c83,_0x556c0e);if(_0x442a6b&&!_0x442a6b['has'](_0x2b4d6f))continue;if(_0x5ab605[_0x515dc8(0x17a)](_0x2b4d6f))continue;_0x1cba37[_0x515dc8(0x1a3)](removeManagedSkillLink(_0x556c0e,_0x259c83,_0x2b4d6f));}}return _0x1cba37;}export function pruneStaleRuntimeSkillCache(_0x2f5980,_0x5aa2ef={}){const _0x1fbeb5=a142_0x2e161c,_0x2c70de=new Set([..._0x2f5980[_0x1fbeb5(0x1a0)]][_0x1fbeb5(0x187)](_0x1008a6=>_0x1008a6[_0x1fbeb5(0x1b6)]())['filter'](Boolean)),_0x40fe56=_0x2f5980[_0x1fbeb5(0x18c)]?new Set([..._0x2f5980[_0x1fbeb5(0x18c)]][_0x1fbeb5(0x187)](_0x18c4dc=>_0x18c4dc[_0x1fbeb5(0x1b6)]())[_0x1fbeb5(0x1b2)](Boolean)):undefined,_0x163e10=_0x2f5980[_0x1fbeb5(0x1a5)]??['personal',_0x1fbeb5(0x17d)],_0x3d430c=resolve(getRuntimeSkillCacheRoot(_0x2f5980[_0x1fbeb5(0x1af)],_0x2f5980[_0x1fbeb5(0x1a6)],_0x5aa2ef),safePathSegment(_0x2f5980['appCode'],_0x1fbeb5(0x1ab))),_0x1ce61c=[];for(const _0x5049d8 of _0x163e10){const _0x36df87=resolve(_0x3d430c,_0x5049d8);if(!existsSync(_0x36df87))continue;for(const _0x144fc6 of readdirSync(_0x36df87,{'withFileTypes':!![]})){if(!_0x144fc6['isDirectory']())continue;const _0x16119a=_0x144fc6[_0x1fbeb5(0x181)];if(_0x40fe56&&!_0x40fe56['has'](_0x16119a))continue;if(_0x2c70de[_0x1fbeb5(0x17a)](_0x16119a))continue;const _0x2799d1=resolve(_0x36df87,_0x16119a),_0x5a8d4b=readMetadataIfPresent(resolve(_0x2799d1,METADATA_FILE));if(_0x5a8d4b?.[_0x1fbeb5(0x1ab)]!==_0x2f5980['appCode']||_0x5a8d4b['scope']!==_0x5049d8||_0x5a8d4b[_0x1fbeb5(0x191)]!==_0x16119a){_0x1ce61c['push']({'path':_0x2799d1,'action':_0x1fbeb5(0x185),'reason':_0x1fbeb5(0x1ad)});continue;}if(isLinkedFromAnyRoot(_0x2799d1,_0x2f5980[_0x1fbeb5(0x18d)]??[])){_0x1ce61c[_0x1fbeb5(0x1a3)]({'path':_0x2799d1,'action':_0x1fbeb5(0x185),'reason':_0x1fbeb5(0x180)});continue;}removeSync(_0x2799d1),_0x1ce61c[_0x1fbeb5(0x1a3)]({'path':_0x2799d1,'action':_0x1fbeb5(0x19c)});}}return _0x1ce61c;}export function linkGlobalRuntimeSkills(_0x309c30,_0x40472e={}){const _0x6e8277=a142_0x2e161c,_0x465e8d=resolveSkillSyncPaths(_0x40472e),_0x253521=[];for(const _0x5023a7 of _0x309c30){if(_0x5023a7[_0x6e8277(0x1ae)]!=='builtin')throw CliErrors['validation'](_0x6e8277(0x17c)+_0x5023a7['scope']);const _0x1a6446=requireSkillCode(_0x5023a7[_0x6e8277(0x1b0)]),_0x50c29f=copyManagedSkillDirectory(_0x5023a7[_0x6e8277(0x1a8)],resolve(_0x465e8d[_0x6e8277(0x199)],_0x1a6446));_0x253521[_0x6e8277(0x1a3)]({..._0x50c29f,'contentHash':_0x5023a7[_0x6e8277(0x197)]});}return _0x253521;}function ensureManagedSymlink(_0x1360ac,_0x15b65e,_0x5a8fcb,_0x537455){const _0x44cf54=a142_0x2e161c;mkdirSync(dirname(_0x1360ac),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x1360ac)||isDanglingSymlink(_0x1360ac)){const _0x26965b=lstatSync(_0x1360ac);if(!_0x26965b[_0x44cf54(0x17f)]())throw CliErrors[_0x44cf54(0x19b)](_0x44cf54(0x196)+_0x1360ac);const _0x60e75f=resolveSymlinkTarget(_0x1360ac);if(!isPathInside(realOrResolved(_0x60e75f),realOrResolved(_0x5a8fcb[_0x44cf54(0x1a2)])))throw CliErrors[_0x44cf54(0x19b)]('Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20'+_0x1360ac);if(realOrResolved(_0x60e75f)===realOrResolved(_0x15b65e))return{'path':_0x1360ac,'target':_0x15b65e,'action':_0x44cf54(0x198)};const _0x206c28=readMetadataIfPresent(resolve(_0x60e75f,METADATA_FILE));if(_0x5a8fcb[_0x44cf54(0x1ae)]===_0x44cf54(0x192)&&(_0x206c28?.[_0x44cf54(0x1ab)]!==_0x5a8fcb[_0x44cf54(0x1ab)]||_0x206c28[_0x44cf54(0x191)]!==_0x537455))throw CliErrors[_0x44cf54(0x19b)](_0x44cf54(0x19e)+_0x1360ac);return unlinkSync(_0x1360ac),symlinkSync(_0x15b65e,_0x1360ac,_0x44cf54(0x1a8)),{'path':_0x1360ac,'target':_0x15b65e,'action':_0x44cf54(0x18f)};}return symlinkSync(_0x15b65e,_0x1360ac,'dir'),{'path':_0x1360ac,'target':_0x15b65e,'action':'created'};}function managedTargetSkillLinkPaths(_0x434ffa,_0x1040ce){const _0x17e52c=a142_0x2e161c;if(!existsSync(_0x434ffa))return[];const _0x25abb4=_0x1040ce[_0x17e52c(0x1ab)]+'--';return readdirSync(_0x434ffa,{'withFileTypes':!![]})[_0x17e52c(0x1b2)](_0x12bc9a=>_0x1040ce[_0x17e52c(0x1ae)]===_0x17e52c(0x192)||_0x12bc9a[_0x17e52c(0x181)][_0x17e52c(0x190)](_0x25abb4))[_0x17e52c(0x187)](_0x1c5c68=>resolve(_0x434ffa,_0x1c5c68['name']));}function removeManagedSkillLink(_0x3da645,_0x4662d7,_0x735770){const _0x416536=a142_0x2e161c,_0x19a2ec=lstatIfPresent(_0x3da645);if(!_0x19a2ec?.[_0x416536(0x17f)]())return{'path':_0x3da645,'action':'skipped','reason':_0x416536(0x183)};const _0x24a4b8=resolveSymlinkTarget(_0x3da645);if(!isPathInside(realOrResolved(_0x24a4b8),realOrResolved(_0x4662d7['managedRoot'])))return{'path':_0x3da645,'action':_0x416536(0x185),'reason':_0x416536(0x1a7)};const _0x48cb55=readMetadataIfPresent(resolve(_0x24a4b8,METADATA_FILE));if(_0x4662d7['scope']===_0x416536(0x192)&&(_0x48cb55?.['appCode']!==_0x4662d7[_0x416536(0x1ab)]||_0x48cb55[_0x416536(0x191)]!==_0x735770))return{'path':_0x3da645,'action':_0x416536(0x185),'reason':_0x416536(0x1ad)};return unlinkSync(_0x3da645),{'path':_0x3da645,'action':'removed'};}function isLinkedFromAnyRoot(_0x52aadf,_0x1e995f){const _0x3e145f=a142_0x2e161c,_0x3dc2aa=realOrResolved(_0x52aadf);for(const _0xea5972 of _0x1e995f){if(!existsSync(_0xea5972))continue;for(const _0x467542 of readdirSync(_0xea5972,{'withFileTypes':!![]})){if(!_0x467542[_0x3e145f(0x17f)]())continue;const _0xc38391=resolve(_0xea5972,_0x467542['name']);if(realOrResolved(resolveSymlinkTarget(_0xc38391))===_0x3dc2aa)return!![];}}return![];}function runtimeSkillLinkName(_0x130328,_0x52eff3){const _0x562c89=a142_0x2e161c,_0x3db72b=safePathSegment(_0x52eff3,'skillCode');if(_0x130328['scope']===_0x562c89(0x192)&&RESERVED_PROJECT_SKILL_CODES['has'](_0x3db72b))throw CliErrors[_0x562c89(0x19b)](_0x562c89(0x1a9)+_0x3db72b);return _0x130328[_0x562c89(0x1ae)]===_0x562c89(0x192)?_0x3db72b:_0x130328[_0x562c89(0x1ab)]+'--'+_0x3db72b;}function runtimeSkillCodeFromLink(_0x2bbba7,_0x34cf80){const _0x2c2a69=a142_0x2e161c,_0x45e1aa=basename(_0x34cf80);return _0x2bbba7[_0x2c2a69(0x1ae)]===_0x2c2a69(0x192)?_0x45e1aa:_0x45e1aa[_0x2c2a69(0x19f)]((_0x2bbba7['appCode']+'--')[_0x2c2a69(0x1b3)]);}export function copyManagedSkillDirectory(_0x311dda,_0x5a64bb){const _0x1088c7=a142_0x2e161c,_0x37e442=resolve(_0x5a64bb,METADATA_FILE),_0x19fe72=existsSync(_0x5a64bb);if(_0x19fe72){const _0x64e1e2=lstatSync(_0x5a64bb);if(_0x64e1e2[_0x1088c7(0x17f)]())throw CliErrors['validation'](_0x1088c7(0x1ac)+_0x5a64bb);if(!_0x64e1e2[_0x1088c7(0x19a)]())throw CliErrors['validation'](_0x1088c7(0x1a1)+_0x5a64bb);const _0x29cdcc=readMetadataIfPresent(_0x37e442);if(_0x29cdcc?.[_0x1088c7(0x1ae)]!==_0x1088c7(0x194))throw CliErrors[_0x1088c7(0x19b)](_0x1088c7(0x18e)+_0x5a64bb);}ensureDirSync(dirname(_0x5a64bb));const _0x597e22=_0x19fe72?readMetadataIfPresent(_0x37e442)?.[_0x1088c7(0x197)]:undefined,_0x2ffd5f=readMetadataIfPresent(resolve(_0x311dda,METADATA_FILE))?.[_0x1088c7(0x197)];return _0x19fe72&&removeSync(_0x5a64bb),copySkillDirectory(_0x311dda,_0x5a64bb),{'path':_0x5a64bb,'target':_0x311dda,'action':!_0x19fe72?_0x1088c7(0x17e):_0x597e22===_0x2ffd5f?_0x1088c7(0x198):_0x1088c7(0x18f)};}function copySkillDirectory(_0x3ad0a7,_0x32d356){copySync(_0x3ad0a7,_0x32d356,{'dereference':![],'overwrite':!![],'filter'(_0x3a6f5c){const _0x4e63df=a142_0x1005;if(lstatSync(_0x3a6f5c)[_0x4e63df(0x17f)]())throw CliErrors[_0x4e63df(0x19b)]('Refusing\x20to\x20copy\x20Skill\x20symlink:\x20'+_0x3a6f5c);return!![];}});}
1
+ const a142_0x581b36=a142_0x3852;(function(_0x959768,_0x317602){const _0x53e541=a142_0x3852,_0x4b7fa1=_0x959768();while(!![]){try{const _0x155d27=parseInt(_0x53e541(0x16f))/0x1*(-parseInt(_0x53e541(0x169))/0x2)+parseInt(_0x53e541(0x16a))/0x3+-parseInt(_0x53e541(0x17a))/0x4+parseInt(_0x53e541(0x18f))/0x5+-parseInt(_0x53e541(0x18e))/0x6+-parseInt(_0x53e541(0x18a))/0x7*(parseInt(_0x53e541(0x18b))/0x8)+-parseInt(_0x53e541(0x171))/0x9*(-parseInt(_0x53e541(0x16c))/0xa);if(_0x155d27===_0x317602)break;else _0x4b7fa1['push'](_0x4b7fa1['shift']());}catch(_0x6cab92){_0x4b7fa1['push'](_0x4b7fa1['shift']());}}}(a142_0x229f,0x2ee9c));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import a142_0xf9ae13 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}=a142_0xf9ae13,RESERVED_PROJECT_SKILL_CODES=new Set([a142_0x581b36(0x199),a142_0x581b36(0x19d),a142_0x581b36(0x187)]);export function linkEffectiveRuntimeSkills(_0x19b406,_0x1ece1d){const _0x85844f=a142_0x581b36,_0x57b057=new Map();for(const _0x54b441 of _0x19b406){const _0xbe8768=_0x54b441[_0x85844f(0x177)][_0x85844f(0x190)];if(!_0xbe8768)continue;const _0x279125=_0x57b057[_0x85844f(0x19a)](_0xbe8768);(!_0x279125||_0x54b441[_0x85844f(0x195)]===_0x85844f(0x180))&&_0x57b057[_0x85844f(0x162)](_0xbe8768,_0x54b441);}const _0x850747=[];for(const _0x2df78a of _0x57b057['values']()){const _0x2a4c37=requireSkillCode(_0x2df78a[_0x85844f(0x177)]),_0x32ef80=readMetadataIfPresent(_0x2df78a[_0x85844f(0x186)]);if(_0x32ef80?.['appCode']!==_0x1ece1d['appCode']||_0x32ef80['skillCode']!==_0x2a4c37)throw CliErrors['validation'](_0x85844f(0x194)+_0x1ece1d[_0x85844f(0x18c)]+':\x20'+_0x2df78a['metadataPath']);const _0x197b44=runtimeSkillLinkName(_0x1ece1d,_0x2a4c37);for(const _0x49cb9e of _0x1ece1d[_0x85844f(0x175)]){_0x850747[_0x85844f(0x182)](ensureManagedSymlink(resolve(_0x49cb9e,_0x197b44),_0x2df78a['dir'],_0x1ece1d,_0x2a4c37));}}return _0x850747;}export function pruneStaleRuntimeSkillLinks(_0x49a8c2,_0x299c78,_0x43d8e0){const _0x41d90a=a142_0x581b36,_0x614281=new Set([..._0x299c78]['map'](_0x461418=>_0x461418[_0x41d90a(0x166)]())[_0x41d90a(0x188)](Boolean)),_0xf8721=_0x43d8e0?new Set([..._0x43d8e0]['map'](_0x435930=>_0x435930[_0x41d90a(0x166)]())[_0x41d90a(0x188)](Boolean)):undefined,_0xd331d2=[];for(const _0x4e8c9a of _0x49a8c2['skillRoots']){for(const _0x4523a0 of managedTargetSkillLinkPaths(_0x4e8c9a,_0x49a8c2)){const _0x12b2d6=runtimeSkillCodeFromLink(_0x49a8c2,_0x4523a0);if(_0xf8721&&!_0xf8721[_0x41d90a(0x168)](_0x12b2d6))continue;if(_0x614281[_0x41d90a(0x168)](_0x12b2d6))continue;_0xd331d2['push'](removeManagedSkillLink(_0x4523a0,_0x49a8c2,_0x12b2d6));}}return _0xd331d2;}export function pruneStaleRuntimeSkillCache(_0xc415d,_0x3cc3b1={}){const _0x463975=a142_0x581b36,_0x507480=new Set([..._0xc415d[_0x463975(0x173)]][_0x463975(0x165)](_0x4dc5e9=>_0x4dc5e9[_0x463975(0x166)]())['filter'](Boolean)),_0x3b08e4=_0xc415d['pruneSkillCodes']?new Set([..._0xc415d[_0x463975(0x196)]][_0x463975(0x165)](_0x511bfe=>_0x511bfe[_0x463975(0x166)]())['filter'](Boolean)):undefined,_0x563427=_0xc415d[_0x463975(0x197)]??[_0x463975(0x180),_0x463975(0x172)],_0x17d4b1=resolve(getRuntimeSkillCacheRoot(_0xc415d[_0x463975(0x17d)],_0xc415d[_0x463975(0x19b)],_0x3cc3b1),safePathSegment(_0xc415d['appCode'],'appCode')),_0x31a818=[];for(const _0x45e668 of _0x563427){const _0x137f0e=resolve(_0x17d4b1,_0x45e668);if(!existsSync(_0x137f0e))continue;for(const _0x52b7bb of readdirSync(_0x137f0e,{'withFileTypes':!![]})){if(!_0x52b7bb[_0x463975(0x179)]())continue;const _0x18c050=_0x52b7bb['name'];if(_0x3b08e4&&!_0x3b08e4[_0x463975(0x168)](_0x18c050))continue;if(_0x507480[_0x463975(0x168)](_0x18c050))continue;const _0x277668=resolve(_0x137f0e,_0x18c050),_0x1e0f2c=readMetadataIfPresent(resolve(_0x277668,METADATA_FILE));if(_0x1e0f2c?.[_0x463975(0x18c)]!==_0xc415d['appCode']||_0x1e0f2c[_0x463975(0x195)]!==_0x45e668||_0x1e0f2c[_0x463975(0x190)]!==_0x18c050){_0x31a818[_0x463975(0x182)]({'path':_0x277668,'action':_0x463975(0x191),'reason':_0x463975(0x181)});continue;}if(isLinkedFromAnyRoot(_0x277668,_0xc415d['protectedLinkRoots']??[])){_0x31a818[_0x463975(0x182)]({'path':_0x277668,'action':_0x463975(0x191),'reason':_0x463975(0x16d)});continue;}removeSync(_0x277668),_0x31a818['push']({'path':_0x277668,'action':'removed'});}}return _0x31a818;}export function linkGlobalRuntimeSkills(_0xde5f0f,_0x1b4ba3={}){const _0x52d86b=a142_0x581b36,_0x3f9b84=resolveSkillSyncPaths(_0x1b4ba3),_0x1568a3=[];for(const _0x1aa955 of _0xde5f0f){if(_0x1aa955[_0x52d86b(0x195)]!==_0x52d86b(0x164))throw CliErrors[_0x52d86b(0x163)](_0x52d86b(0x185)+_0x1aa955[_0x52d86b(0x195)]);const _0x2154d2=requireSkillCode(_0x1aa955[_0x52d86b(0x177)]),_0x162030=copyManagedSkillDirectory(_0x1aa955[_0x52d86b(0x18d)],resolve(_0x3f9b84[_0x52d86b(0x184)],_0x2154d2));_0x1568a3['push']({..._0x162030,'contentHash':_0x1aa955[_0x52d86b(0x16b)]});}return _0x1568a3;}function ensureManagedSymlink(_0x3bc33b,_0x5af908,_0x12e2fc,_0x4472dc){const _0x54b026=a142_0x581b36;mkdirSync(dirname(_0x3bc33b),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x3bc33b)||isDanglingSymlink(_0x3bc33b)){const _0x581719=lstatSync(_0x3bc33b);if(!_0x581719[_0x54b026(0x167)]())throw CliErrors[_0x54b026(0x163)](_0x54b026(0x174)+_0x3bc33b);const _0x3136b9=resolveSymlinkTarget(_0x3bc33b);if(!isPathInside(realOrResolved(_0x3136b9),realOrResolved(_0x12e2fc[_0x54b026(0x178)])))throw CliErrors[_0x54b026(0x163)](_0x54b026(0x17e)+_0x3bc33b);if(realOrResolved(_0x3136b9)===realOrResolved(_0x5af908))return{'path':_0x3bc33b,'target':_0x5af908,'action':_0x54b026(0x183)};const _0xe4571a=readMetadataIfPresent(resolve(_0x3136b9,METADATA_FILE));if(_0x12e2fc[_0x54b026(0x195)]==='project'&&(_0xe4571a?.[_0x54b026(0x18c)]!==_0x12e2fc['appCode']||_0xe4571a['skillCode']!==_0x4472dc))throw CliErrors['validation'](_0x54b026(0x17c)+_0x3bc33b);return unlinkSync(_0x3bc33b),symlinkSync(_0x5af908,_0x3bc33b,'dir'),{'path':_0x3bc33b,'target':_0x5af908,'action':'updated'};}return symlinkSync(_0x5af908,_0x3bc33b,_0x54b026(0x18d)),{'path':_0x3bc33b,'target':_0x5af908,'action':_0x54b026(0x192)};}function a142_0x229f(){const _0x54569f=['356552GqIjoj','appCode','dir','902286CJvPTe','510560nkRQmC','skillCode','skipped','created','removed','Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20','scope','pruneSkillCodes','scopes','startsWith','lovrabet','get','accessKey','not-managed-symlink','runtime-observe','set','validation','builtin','map','trim','isSymbolicLink','has','2yqHzNN','726873kzGpUo','contentHash','100CeXPsi','linked-from-protected-root','external-symlink','80947ANGkXV','slice','455571CLdXdI','company','activeSkillCodes','Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20','skillRoots','project','skill','managedRoot','isDirectory','460504frYAHw','name','Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20','env','Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20','Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20','personal','metadata-mismatch','push','unchanged','agentsSkillsDir','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','metadataPath','secret-retriever','filter','Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20','49vXqMZx'];a142_0x229f=function(){return _0x54569f;};return a142_0x229f();}function managedTargetSkillLinkPaths(_0x2da9c9,_0x3a8f02){const _0x3486c8=a142_0x581b36;if(!existsSync(_0x2da9c9))return[];const _0x544249=_0x3a8f02['appCode']+'--';return readdirSync(_0x2da9c9,{'withFileTypes':!![]})[_0x3486c8(0x188)](_0x577938=>_0x3a8f02[_0x3486c8(0x195)]===_0x3486c8(0x176)||_0x577938[_0x3486c8(0x17b)][_0x3486c8(0x198)](_0x544249))[_0x3486c8(0x165)](_0x1c188b=>resolve(_0x2da9c9,_0x1c188b[_0x3486c8(0x17b)]));}function removeManagedSkillLink(_0x5cbffe,_0x433c35,_0x3f7fe3){const _0x3e9309=a142_0x581b36,_0x3e4e94=lstatIfPresent(_0x5cbffe);if(!_0x3e4e94?.[_0x3e9309(0x167)]())return{'path':_0x5cbffe,'action':'skipped','reason':_0x3e9309(0x19c)};const _0xc8022c=resolveSymlinkTarget(_0x5cbffe);if(!isPathInside(realOrResolved(_0xc8022c),realOrResolved(_0x433c35[_0x3e9309(0x178)])))return{'path':_0x5cbffe,'action':_0x3e9309(0x191),'reason':_0x3e9309(0x16e)};const _0x1253c3=readMetadataIfPresent(resolve(_0xc8022c,METADATA_FILE));if(_0x433c35['scope']==='project'&&(_0x1253c3?.[_0x3e9309(0x18c)]!==_0x433c35[_0x3e9309(0x18c)]||_0x1253c3['skillCode']!==_0x3f7fe3))return{'path':_0x5cbffe,'action':_0x3e9309(0x191),'reason':'metadata-mismatch'};return unlinkSync(_0x5cbffe),{'path':_0x5cbffe,'action':_0x3e9309(0x193)};}function isLinkedFromAnyRoot(_0xdba4ec,_0xedc0ce){const _0x1b1154=a142_0x581b36,_0x141fc8=realOrResolved(_0xdba4ec);for(const _0x10bb28 of _0xedc0ce){if(!existsSync(_0x10bb28))continue;for(const _0x3c7f1b of readdirSync(_0x10bb28,{'withFileTypes':!![]})){if(!_0x3c7f1b[_0x1b1154(0x167)]())continue;const _0x7781bb=resolve(_0x10bb28,_0x3c7f1b[_0x1b1154(0x17b)]);if(realOrResolved(resolveSymlinkTarget(_0x7781bb))===_0x141fc8)return!![];}}return![];}function runtimeSkillLinkName(_0x3daacb,_0x1d3b94){const _0x12e1f7=a142_0x581b36,_0x3c79f6=safePathSegment(_0x1d3b94,'skillCode');if(_0x3daacb[_0x12e1f7(0x195)]===_0x12e1f7(0x176)&&RESERVED_PROJECT_SKILL_CODES[_0x12e1f7(0x168)](_0x3c79f6))throw CliErrors[_0x12e1f7(0x163)]('Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20'+_0x3c79f6);return _0x3daacb[_0x12e1f7(0x195)]===_0x12e1f7(0x176)?_0x3c79f6:_0x3daacb[_0x12e1f7(0x18c)]+'--'+_0x3c79f6;}function a142_0x3852(_0x310f71,_0x3bd54e){_0x310f71=_0x310f71-0x162;const _0x229ffa=a142_0x229f();let _0x3852a7=_0x229ffa[_0x310f71];return _0x3852a7;}function runtimeSkillCodeFromLink(_0x53ab57,_0x136f5b){const _0x4366b3=a142_0x581b36,_0x1d01fa=basename(_0x136f5b);return _0x53ab57[_0x4366b3(0x195)]===_0x4366b3(0x176)?_0x1d01fa:_0x1d01fa[_0x4366b3(0x170)]((_0x53ab57[_0x4366b3(0x18c)]+'--')['length']);}export function copyManagedSkillDirectory(_0x2acfa0,_0x42f730){const _0x39d1d1=a142_0x581b36,_0x1eed2f=resolve(_0x42f730,METADATA_FILE),_0x3b2bc9=existsSync(_0x42f730);if(_0x3b2bc9){const _0x51c00e=lstatSync(_0x42f730);if(_0x51c00e[_0x39d1d1(0x167)]())throw CliErrors[_0x39d1d1(0x163)](_0x39d1d1(0x189)+_0x42f730);if(!_0x51c00e['isDirectory']())throw CliErrors[_0x39d1d1(0x163)](_0x39d1d1(0x17f)+_0x42f730);const _0x48c651=readMetadataIfPresent(_0x1eed2f);if(_0x48c651?.[_0x39d1d1(0x195)]!==_0x39d1d1(0x164))throw CliErrors[_0x39d1d1(0x163)]('Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20'+_0x42f730);}ensureDirSync(dirname(_0x42f730));const _0x272969=_0x3b2bc9?readMetadataIfPresent(_0x1eed2f)?.[_0x39d1d1(0x16b)]:undefined,_0x2224e2=readMetadataIfPresent(resolve(_0x2acfa0,METADATA_FILE))?.[_0x39d1d1(0x16b)];return _0x3b2bc9&&removeSync(_0x42f730),copySkillDirectory(_0x2acfa0,_0x42f730),{'path':_0x42f730,'target':_0x2acfa0,'action':!_0x3b2bc9?_0x39d1d1(0x192):_0x272969===_0x2224e2?_0x39d1d1(0x183):'updated'};}function copySkillDirectory(_0x4c3c05,_0x7108c9){copySync(_0x4c3c05,_0x7108c9,{'dereference':![],'overwrite':!![],'filter'(_0x4291c5){const _0x2d11fd=a142_0x3852;if(lstatSync(_0x4291c5)[_0x2d11fd(0x167)]())throw CliErrors[_0x2d11fd(0x163)]('Refusing\x20to\x20copy\x20Skill\x20symlink:\x20'+_0x4291c5);return!![];}});}
@@ -1 +1 @@
1
- (function(_0x5d0a94,_0x3ed663){const _0x3f1c72=a143_0x1321,_0x3bafeb=_0x5d0a94();while(!![]){try{const _0x3540fd=-parseInt(_0x3f1c72(0x125))/0x1*(parseInt(_0x3f1c72(0x107))/0x2)+parseInt(_0x3f1c72(0x12c))/0x3*(parseInt(_0x3f1c72(0x11f))/0x4)+parseInt(_0x3f1c72(0x12e))/0x5+-parseInt(_0x3f1c72(0x10f))/0x6+parseInt(_0x3f1c72(0x111))/0x7+-parseInt(_0x3f1c72(0x11e))/0x8*(-parseInt(_0x3f1c72(0x128))/0x9)+-parseInt(_0x3f1c72(0x121))/0xa*(-parseInt(_0x3f1c72(0x123))/0xb);if(_0x3540fd===_0x3ed663)break;else _0x3bafeb['push'](_0x3bafeb['shift']());}catch(_0x2463c4){_0x3bafeb['push'](_0x3bafeb['shift']());}}}(a143_0x4c9f,0x89669));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(_0x3e20c2,_0x1b0852,_0x42b0b9={}){const _0x1158e4=a143_0x1321,_0xb9619=safePathSegment(_0x3e20c2[_0x1158e4(0x124)],_0x1158e4(0x124));if(_0x1b0852[_0x1158e4(0x124)]!==_0xb9619)throw CliErrors[_0x1158e4(0x130)](_0x1158e4(0x129)+_0x1b0852['appCode']+_0x1158e4(0x109)+_0xb9619);const _0x128d25=normalizeRuntimeSkillScopes(_0x3e20c2[_0x1158e4(0x132)]),_0x51fa0d=new Set(_0x128d25),_0xad4878=_0x3e20c2['code']?.[_0x1158e4(0x114)](),_0x37fa9c=new Map(),_0x3c6c43=resolve(getRuntimeSkillCacheRoot(_0x3e20c2['env'],_0x3e20c2['accessKey'],_0x42b0b9),_0xb9619);for(const _0x1d2fcd of _0x128d25){for(const _0x1c2f4a of localSkillEntryDirs(resolve(_0x3c6c43,_0x1d2fcd))){collectLocalRuntimeSkill(_0x37fa9c,_0x1c2f4a,{'appCode':_0xb9619,'scopes':_0x51fa0d,'code':_0xad4878,'source':_0x1158e4(0x10e)});}}for(const _0x451759 of _0x1b0852['skillRoots']){for(const _0x8b1375 of localSkillLinkCandidates(_0x451759,_0x1b0852,_0x51fa0d)){collectLocalRuntimeSkill(_0x37fa9c,_0x8b1375,{'appCode':_0xb9619,'scopes':_0x51fa0d,'code':_0xad4878,'source':_0x1158e4(0x10c),'linkedPath':_0x8b1375});}}return Array[_0x1158e4(0x11d)](_0x37fa9c[_0x1158e4(0x11b)]())['sort'](compareLocalRuntimeSkills);}function localSkillEntryDirs(_0x4a700b){const _0x1ce0b6=a143_0x1321;if(!existsSync(_0x4a700b))return[];return readdirSync(_0x4a700b,{'withFileTypes':!![]})['filter'](_0x1fe48d=>_0x1fe48d[_0x1ce0b6(0x110)]()||_0x1fe48d[_0x1ce0b6(0x126)]())[_0x1ce0b6(0x12d)](_0x4adb6e=>resolve(_0x4a700b,_0x4adb6e[_0x1ce0b6(0x131)]));}function localSkillLinkCandidates(_0x20e1a8,_0x252ef4,_0x124b9d){const _0x18af4a=a143_0x1321;if(!existsSync(_0x20e1a8))return[];const _0x1fcc13=_0x252ef4[_0x18af4a(0x124)]+'--';return readdirSync(_0x20e1a8,{'withFileTypes':!![]})[_0x18af4a(0x12b)](_0xa954f6=>_0xa954f6['isDirectory']()||_0xa954f6[_0x18af4a(0x126)]())[_0x18af4a(0x12b)](_0x2bc694=>_0x252ef4[_0x18af4a(0x116)]===_0x18af4a(0x115)||_0x2bc694['name'][_0x18af4a(0x10b)](_0x1fcc13)||_0x124b9d[_0x18af4a(0x12a)](_0x18af4a(0x11c)))['map'](_0x2fdcbf=>resolve(_0x20e1a8,_0x2fdcbf[_0x18af4a(0x131)]));}function a143_0x1321(_0x4a612c,_0x3821f0){_0x4a612c=_0x4a612c-0x107;const _0x4c9f3e=a143_0x4c9f();let _0x1321fa=_0x4c9f3e[_0x4a612c];return _0x1321fa;}function collectLocalRuntimeSkill(_0x4a6690,_0x532022,_0x4377f2){const _0x51f45f=a143_0x1321,_0x57cc07=resolve(_0x532022,METADATA_FILE),_0x19ae07=readMetadataIfPresent(_0x57cc07);if(!_0x19ae07)return;if(_0x19ae07['appCode']!==_0x4377f2['appCode'])return;if(!isRuntimeSkillScope(_0x19ae07[_0x51f45f(0x116)])||!_0x4377f2[_0x51f45f(0x132)][_0x51f45f(0x12a)](_0x19ae07[_0x51f45f(0x116)]))return;const _0x3f32e6=_0x19ae07[_0x51f45f(0x113)]?.['trim']();if(!_0x3f32e6)return;if(_0x4377f2[_0x51f45f(0x10d)]&&_0x3f32e6!==_0x4377f2[_0x51f45f(0x10d)])return;const _0x1ad079=_0x19ae07[_0x51f45f(0x116)]+':'+_0x3f32e6,_0x3e9dec=_0x4377f2[_0x51f45f(0x120)]?[_0x4377f2[_0x51f45f(0x120)]]:[],_0x50e0d8=_0x4a6690['get'](_0x1ad079);if(_0x50e0d8){_0x4377f2[_0x51f45f(0x12f)]==='cache'&&(_0x50e0d8[_0x51f45f(0x108)]=_0x532022,_0x50e0d8['cacheDir']=_0x532022,_0x50e0d8['skillMdPath']=resolve(_0x532022,SKILL_FILE),_0x50e0d8[_0x51f45f(0x118)]=_0x57cc07);for(const _0xb751f5 of _0x3e9dec){!_0x50e0d8['linkedPaths']['includes'](_0xb751f5)&&_0x50e0d8[_0x51f45f(0x10a)][_0x51f45f(0x112)](_0xb751f5);}_0x50e0d8[_0x51f45f(0x10a)][_0x51f45f(0x117)]();return;}_0x4a6690[_0x51f45f(0x127)](_0x1ad079,{..._0x19ae07,'tags':Array[_0x51f45f(0x11a)](_0x19ae07[_0x51f45f(0x119)])?_0x19ae07['tags']:[],'scope':_0x19ae07[_0x51f45f(0x116)],'source':'local','dir':_0x532022,'cacheDir':_0x4377f2[_0x51f45f(0x12f)]===_0x51f45f(0x10e)?_0x532022:undefined,'skillMdPath':resolve(_0x532022,SKILL_FILE),'metadataPath':_0x57cc07,'linkedPaths':_0x3e9dec});}function compareLocalRuntimeSkills(_0x4e05c4,_0x56c788){const _0x340370=a143_0x1321,_0x185973={'personal':0x0,'company':0x1,'builtin':0x2};return _0x185973[_0x4e05c4[_0x340370(0x116)]]-_0x185973[_0x56c788[_0x340370(0x116)]]||_0x4e05c4[_0x340370(0x113)][_0x340370(0x122)](_0x56c788[_0x340370(0x113)])||_0x4e05c4[_0x340370(0x108)]['localeCompare'](_0x56c788[_0x340370(0x108)]);}function a143_0x4c9f(){const _0x121216=['filter','1047327cBJvGQ','map','333995ypjFSN','source','validation','name','scopes','2EtibBm','dir','\x20!=\x20','linkedPaths','startsWith','link','code','cache','6448806aApZkJ','isDirectory','3881192wfRQca','push','skillCode','trim','project','scope','sort','metadataPath','tags','isArray','values','builtin','from','72208rBzwGI','4fJOSqU','linkedPath','10TdNqXM','localeCompare','4967897PjRxtA','appCode','425243MEkXWX','isSymbolicLink','set','639GeXCER','Runtime\x20Skill\x20install\x20target\x20app\x20mismatch:\x20','has'];a143_0x4c9f=function(){return _0x121216;};return a143_0x4c9f();}
1
+ (function(_0x4127c8,_0x56613e){const _0xf0bcd9=a143_0x1f51,_0x2651b2=_0x4127c8();while(!![]){try{const _0xe5198c=parseInt(_0xf0bcd9(0x17c))/0x1*(parseInt(_0xf0bcd9(0x191))/0x2)+-parseInt(_0xf0bcd9(0x18f))/0x3*(-parseInt(_0xf0bcd9(0x17f))/0x4)+-parseInt(_0xf0bcd9(0x184))/0x5*(parseInt(_0xf0bcd9(0x16f))/0x6)+parseInt(_0xf0bcd9(0x195))/0x7*(-parseInt(_0xf0bcd9(0x178))/0x8)+-parseInt(_0xf0bcd9(0x181))/0x9+parseInt(_0xf0bcd9(0x16b))/0xa*(-parseInt(_0xf0bcd9(0x192))/0xb)+-parseInt(_0xf0bcd9(0x177))/0xc*(-parseInt(_0xf0bcd9(0x179))/0xd);if(_0xe5198c===_0x56613e)break;else _0x2651b2['push'](_0x2651b2['shift']());}catch(_0x48a76a){_0x2651b2['push'](_0x2651b2['shift']());}}}(a143_0x5579,0x6b193));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';function a143_0x1f51(_0x319570,_0x965fae){_0x319570=_0x319570-0x168;const _0x5579fe=a143_0x5579();let _0x1f51cf=_0x5579fe[_0x319570];return _0x1f51cf;}import{getRuntimeSkillCacheRoot,safePathSegment}from'./paths.js';import{isRuntimeSkillScope,normalizeRuntimeSkillScopes}from'./scopes.js';export function listLocalRuntimeSkills(_0x3dc9d2,_0x1ff3a7,_0x3da10f={}){const _0x2a4856=a143_0x1f51,_0x422e29=safePathSegment(_0x3dc9d2['appCode'],_0x2a4856(0x168));if(_0x1ff3a7[_0x2a4856(0x168)]!==_0x422e29)throw CliErrors[_0x2a4856(0x182)](_0x2a4856(0x173)+_0x1ff3a7[_0x2a4856(0x168)]+'\x20!=\x20'+_0x422e29);const _0x504b11=normalizeRuntimeSkillScopes(_0x3dc9d2[_0x2a4856(0x189)]),_0x1284ed=new Set(_0x504b11),_0x261008=_0x3dc9d2[_0x2a4856(0x196)]?.[_0x2a4856(0x16c)](),_0x5df708=new Map(),_0x2e843c=resolve(getRuntimeSkillCacheRoot(_0x3dc9d2[_0x2a4856(0x17a)],_0x3dc9d2[_0x2a4856(0x16e)],_0x3da10f),_0x422e29);for(const _0x12bc2d of _0x504b11){for(const _0x3816ce of localSkillEntryDirs(resolve(_0x2e843c,_0x12bc2d))){collectLocalRuntimeSkill(_0x5df708,_0x3816ce,{'appCode':_0x422e29,'scopes':_0x1284ed,'code':_0x261008,'source':_0x2a4856(0x197)});}}for(const _0x35b3b4 of _0x1ff3a7[_0x2a4856(0x180)]){for(const _0x5a047c of localSkillLinkCandidates(_0x35b3b4,_0x1ff3a7,_0x1284ed)){collectLocalRuntimeSkill(_0x5df708,_0x5a047c,{'appCode':_0x422e29,'scopes':_0x1284ed,'code':_0x261008,'source':_0x2a4856(0x174),'linkedPath':_0x5a047c});}}return Array[_0x2a4856(0x17b)](_0x5df708['values']())['sort'](compareLocalRuntimeSkills);}function localSkillEntryDirs(_0x46ab7c){const _0x55f7c3=a143_0x1f51;if(!existsSync(_0x46ab7c))return[];return readdirSync(_0x46ab7c,{'withFileTypes':!![]})[_0x55f7c3(0x186)](_0x42ab1b=>_0x42ab1b['isDirectory']()||_0x42ab1b[_0x55f7c3(0x187)]())[_0x55f7c3(0x16a)](_0x41c409=>resolve(_0x46ab7c,_0x41c409[_0x55f7c3(0x17d)]));}function localSkillLinkCandidates(_0x2ee27b,_0x18c2f2,_0x47a982){const _0x5acc90=a143_0x1f51;if(!existsSync(_0x2ee27b))return[];const _0xae57fb=_0x18c2f2['appCode']+'--';return readdirSync(_0x2ee27b,{'withFileTypes':!![]})[_0x5acc90(0x186)](_0x2a2587=>_0x2a2587[_0x5acc90(0x18c)]()||_0x2a2587[_0x5acc90(0x187)]())[_0x5acc90(0x186)](_0x190e1e=>_0x18c2f2[_0x5acc90(0x198)]==='project'||_0x190e1e['name'][_0x5acc90(0x18e)](_0xae57fb)||_0x47a982[_0x5acc90(0x193)](_0x5acc90(0x18d)))[_0x5acc90(0x16a)](_0x1b9732=>resolve(_0x2ee27b,_0x1b9732[_0x5acc90(0x17d)]));}function collectLocalRuntimeSkill(_0x310093,_0x1db6c0,_0x560f8a){const _0x528130=a143_0x1f51,_0xd9f622=resolve(_0x1db6c0,METADATA_FILE),_0x3ec752=readMetadataIfPresent(_0xd9f622);if(!_0x3ec752)return;if(_0x3ec752['appCode']!==_0x560f8a[_0x528130(0x168)])return;if(!isRuntimeSkillScope(_0x3ec752[_0x528130(0x198)])||!_0x560f8a[_0x528130(0x189)][_0x528130(0x193)](_0x3ec752[_0x528130(0x198)]))return;const _0x2571cc=_0x3ec752[_0x528130(0x175)]?.[_0x528130(0x16c)]();if(!_0x2571cc)return;if(_0x560f8a[_0x528130(0x196)]&&_0x2571cc!==_0x560f8a[_0x528130(0x196)])return;const _0x4d7c54=_0x3ec752[_0x528130(0x198)]+':'+_0x2571cc,_0x1f834b=_0x560f8a['linkedPath']?[_0x560f8a['linkedPath']]:[],_0x2230ab=_0x310093[_0x528130(0x183)](_0x4d7c54);if(_0x2230ab){_0x560f8a[_0x528130(0x188)]===_0x528130(0x197)&&(_0x2230ab['dir']=_0x1db6c0,_0x2230ab[_0x528130(0x17e)]=_0x1db6c0,_0x2230ab['skillMdPath']=resolve(_0x1db6c0,SKILL_FILE),_0x2230ab[_0x528130(0x190)]=_0xd9f622);for(const _0x2d23f4 of _0x1f834b){!_0x2230ab[_0x528130(0x16d)][_0x528130(0x176)](_0x2d23f4)&&_0x2230ab[_0x528130(0x16d)][_0x528130(0x18a)](_0x2d23f4);}_0x2230ab['linkedPaths'][_0x528130(0x169)]();return;}_0x310093[_0x528130(0x172)](_0x4d7c54,{..._0x3ec752,'tags':Array[_0x528130(0x170)](_0x3ec752[_0x528130(0x194)])?_0x3ec752[_0x528130(0x194)]:[],'scope':_0x3ec752[_0x528130(0x198)],'source':_0x528130(0x18b),'dir':_0x1db6c0,'cacheDir':_0x560f8a[_0x528130(0x188)]===_0x528130(0x197)?_0x1db6c0:undefined,'skillMdPath':resolve(_0x1db6c0,SKILL_FILE),'metadataPath':_0xd9f622,'linkedPaths':_0x1f834b});}function a143_0x5579(){const _0x21964d=['dir','set','Runtime\x20Skill\x20install\x20target\x20app\x20mismatch:\x20','link','skillCode','includes','24918192CLynAv','1320KwZGwB','13ibzbzd','env','from','22SaesNE','name','cacheDir','28cZFCMt','skillRoots','2327589LzoEWS','validation','get','5IXEvIW','localeCompare','filter','isSymbolicLink','source','scopes','push','local','isDirectory','builtin','startsWith','122637RhyvFY','metadataPath','32860kAGuxm','8392065XhVokL','has','tags','18949HcFVwn','code','cache','scope','appCode','sort','map','10ufZtGn','trim','linkedPaths','accessKey','4903578urCqWQ','isArray'];a143_0x5579=function(){return _0x21964d;};return a143_0x5579();}function compareLocalRuntimeSkills(_0x4ec76d,_0x508120){const _0x362cd5=a143_0x1f51,_0x3a2153={'personal':0x0,'company':0x1,'builtin':0x2};return _0x3a2153[_0x4ec76d[_0x362cd5(0x198)]]-_0x3a2153[_0x508120['scope']]||_0x4ec76d[_0x362cd5(0x175)][_0x362cd5(0x185)](_0x508120[_0x362cd5(0x175)])||_0x4ec76d[_0x362cd5(0x171)][_0x362cd5(0x185)](_0x508120[_0x362cd5(0x171)]);}
@@ -1 +1 @@
1
- (function(_0x28c79f,_0x334ebc){const _0x115db6=a144_0x7695,_0x2c7106=_0x28c79f();while(!![]){try{const _0x3b88da=-parseInt(_0x115db6(0x1a1))/0x1*(-parseInt(_0x115db6(0x1a3))/0x2)+-parseInt(_0x115db6(0x1be))/0x3*(-parseInt(_0x115db6(0x1a0))/0x4)+parseInt(_0x115db6(0x1a8))/0x5+-parseInt(_0x115db6(0x1c8))/0x6*(-parseInt(_0x115db6(0x1bc))/0x7)+parseInt(_0x115db6(0x1a6))/0x8+-parseInt(_0x115db6(0x1bd))/0x9*(-parseInt(_0x115db6(0x1b1))/0xa)+-parseInt(_0x115db6(0x19e))/0xb;if(_0x3b88da===_0x334ebc)break;else _0x2c7106['push'](_0x2c7106['shift']());}catch(_0x22d24d){_0x2c7106['push'](_0x2c7106['shift']());}}}(a144_0x52fc,0x3c58d));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 a144_0x7695(_0x203f5e,_0x2f7862){_0x203f5e=_0x203f5e-0x19e;const _0x52fc35=a144_0x52fc();let _0x769515=_0x52fc35[_0x203f5e];return _0x769515;}export function fileContent(_0x2641dc){const _0x7a55c7=a144_0x7695;return _0x2641dc[_0x7a55c7(0x1cc)]??Buffer[_0x7a55c7(0x19f)](_0x2641dc[_0x7a55c7(0x1b5)]??'','utf8');}export function fileText(_0x280935){const _0xe1d90=a144_0x7695;return fileContent(_0x280935)[_0xe1d90(0x1ba)](_0xe1d90(0x1b7));}export function normalizeLocalFiles(_0x1ceb1f){const _0x2a3628=a144_0x7695;if(!Array[_0x2a3628(0x1c2)](_0x1ceb1f)||_0x1ceb1f[_0x2a3628(0x1b9)]===0x0)return[];const _0x4bec5c=new Map();for(const _0x165595 of _0x1ceb1f){if(!_0x165595||typeof _0x165595!==_0x2a3628(0x1bb)||typeof _0x165595[_0x2a3628(0x1a4)]!==_0x2a3628(0x1b8))throw CliErrors[_0x2a3628(0x1c3)](_0x2a3628(0x1b2));const _0x1cb5cd=normalizeSkillRelativePath(_0x165595[_0x2a3628(0x1a4)]);if(_0x4bec5c['has'](_0x1cb5cd))throw CliErrors[_0x2a3628(0x1c3)](_0x2a3628(0x1b6)+_0x1cb5cd);if(_0x165595['bytes']!==undefined&&!Buffer['isBuffer'](_0x165595[_0x2a3628(0x1cc)]))throw CliErrors[_0x2a3628(0x1c3)]('Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20'+_0x1cb5cd);if(_0x165595[_0x2a3628(0x1cc)]===undefined&&typeof _0x165595[_0x2a3628(0x1b5)]!==_0x2a3628(0x1b8))throw CliErrors[_0x2a3628(0x1c3)]('Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20'+_0x1cb5cd);const _0x4ce47b=fileContent(_0x165595);_0x4bec5c['set'](_0x1cb5cd,{'path':_0x1cb5cd,'bytes':_0x4ce47b});}return Array[_0x2a3628(0x19f)](_0x4bec5c[_0x2a3628(0x1b4)]())['sort'](compareSkillFiles);}export function normalizeManifestFiles(_0x26911b){const _0x46eb22=a144_0x7695;if(!Array[_0x46eb22(0x1c2)](_0x26911b)||_0x26911b[_0x46eb22(0x1b9)]===0x0)return[];const _0x4224e6=new Map();for(const _0x50820f of _0x26911b){if(!_0x50820f||typeof _0x50820f!=='object'||typeof _0x50820f[_0x46eb22(0x1a4)]!==_0x46eb22(0x1b8))throw CliErrors['validation'](_0x46eb22(0x1b2));const _0x448497=normalizeSkillRelativePath(_0x50820f[_0x46eb22(0x1a4)]);if(_0x4224e6[_0x46eb22(0x1cb)](_0x448497))throw CliErrors[_0x46eb22(0x1c3)](_0x46eb22(0x1b6)+_0x448497);if(!isSha256Hex(_0x50820f['sha256']))throw CliErrors[_0x46eb22(0x1c3)](_0x46eb22(0x1bf)+_0x448497);if(!Number['isSafeInteger'](_0x50820f[_0x46eb22(0x1c0)])||_0x50820f['size']<0x0)throw CliErrors[_0x46eb22(0x1c3)](_0x46eb22(0x1c4)+_0x448497);_0x4224e6[_0x46eb22(0x1c5)](_0x448497,{'path':_0x448497,'sha256':_0x50820f['sha256'][_0x46eb22(0x1c6)](),'size':_0x50820f[_0x46eb22(0x1c0)]});}return Array[_0x46eb22(0x19f)](_0x4224e6['values']())[_0x46eb22(0x1ca)](compareSkillFiles);}export function scanSkillDirectory(_0x171ba9,_0x2465bb={}){const _0x4a4b23=a144_0x7695,_0x4b030b=realpathSync(_0x171ba9),_0x4918a5=canonicalExcludedFilePaths(_0x2465bb[_0x4a4b23(0x1ae)]),_0x457579=[];function _0x25281b(_0x38c2f7){const _0x4e4ce5=_0x4a4b23,_0xc6db38=readdirSync(_0x38c2f7,{'withFileTypes':!![]})[_0x4e4ce5(0x1ca)]((_0x250224,_0x46327d)=>_0x250224[_0x4e4ce5(0x1a2)][_0x4e4ce5(0x1b0)](_0x46327d['name']));for(const _0x4b42b2 of _0xc6db38){if(_0x4b42b2[_0x4e4ce5(0x1c1)]()&&IGNORED_DIR_NAMES[_0x4e4ce5(0x1cb)](_0x4b42b2[_0x4e4ce5(0x1a2)]))continue;if(IGNORED_FILE_NAMES[_0x4e4ce5(0x1cb)](_0x4b42b2[_0x4e4ce5(0x1a2)]))continue;const _0x298072=resolve(_0x38c2f7,_0x4b42b2['name']);if(isExcludedFilePath(_0x298072,_0x4918a5))continue;if(_0x4b42b2[_0x4e4ce5(0x1a7)]())throw CliErrors[_0x4e4ce5(0x1c3)](_0x4e4ce5(0x1ad)+_0x298072);const _0x59318b=toPosixPath(relative(_0x4b030b,_0x298072));if(_0x4b42b2[_0x4e4ce5(0x1c1)]()){_0x25281b(_0x298072);continue;}if(!_0x4b42b2[_0x4e4ce5(0x1cd)]())continue;validateSkillRelativePath(_0x59318b);const _0x3504ce=readFileSync(_0x298072);_0x457579[_0x4e4ce5(0x1a9)]({'path':_0x59318b,'bytes':_0x3504ce});}}return _0x25281b(_0x4b030b),normalizeLocalFiles(_0x457579);}function canonicalExcludedFilePaths(_0x11fe3b){const _0x2866dc=new Set();for(const _0x475d22 of _0x11fe3b??[]){const _0x13976b=resolve(_0x475d22);_0x2866dc['add'](_0x13976b);try{_0x2866dc['add'](realpathSync(_0x13976b));}catch{}}return _0x2866dc;}function a144_0x52fc(){const _0x42110d=['bytes','isFile','14411023bOWBnn','from','3492EiDYrU','2ipfWIS','name','308654TmEeaI','path','replace','2078136YTboHM','isSymbolicLink','990380zpsjqt','push','Unsafe\x20Skill\x20file\x20path:\x20','split','compare','Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20','excludedFilePaths','startsWith','localeCompare','10JKgFJJ','Skill\x20file\x20path\x20must\x20be\x20text.','includes','values','content','Duplicate\x20Skill\x20file\x20path:\x20','utf8','string','length','toString','object','758436grhrlC','4075470pjXYRm','789uZPiSY','Skill\x20file\x20sha256\x20is\x20invalid:\x20','size','isDirectory','isArray','validation','Skill\x20file\x20size\x20is\x20invalid:\x20','set','toLowerCase','test','6KKJIvx','trim','sort','has'];a144_0x52fc=function(){return _0x42110d;};return a144_0x52fc();}function isExcludedFilePath(_0x4b3d93,_0x3faf9d){const _0x1fe022=a144_0x7695;if(_0x3faf9d[_0x1fe022(0x1cb)](_0x4b3d93))return!![];if(_0x3faf9d['size']===0x0)return![];try{return _0x3faf9d[_0x1fe022(0x1cb)](realpathSync(_0x4b3d93));}catch{return![];}}export function compareSkillFiles(_0x3ff4d9,_0x99b14b){const _0x12454a=a144_0x7695;if(_0x3ff4d9['path']===SKILL_FILE)return _0x99b14b[_0x12454a(0x1a4)]===SKILL_FILE?0x0:-0x1;if(_0x99b14b[_0x12454a(0x1a4)]===SKILL_FILE)return 0x1;return Buffer[_0x12454a(0x1ac)](Buffer['from'](_0x3ff4d9[_0x12454a(0x1a4)],_0x12454a(0x1b7)),Buffer[_0x12454a(0x19f)](_0x99b14b[_0x12454a(0x1a4)],_0x12454a(0x1b7)));}export function normalizeSkillRelativePath(_0x302fc4){const _0x6e42e7=a144_0x7695,_0x508fe7=toPosixPath(_0x302fc4[_0x6e42e7(0x1c9)]());return validateSkillRelativePath(_0x508fe7),_0x508fe7;}export function validateSkillRelativePath(_0x57476e){const _0x2e250e=a144_0x7695;if(!_0x57476e||_0x57476e[_0x2e250e(0x1af)]('/')||_0x57476e[_0x2e250e(0x1b3)]('//'))throw CliErrors[_0x2e250e(0x1c3)](_0x2e250e(0x1aa)+_0x57476e);for(const _0x51388c of _0x57476e[_0x2e250e(0x1ab)]('/')){if(!_0x51388c||_0x51388c==='.'||_0x51388c==='..')throw CliErrors['validation'](_0x2e250e(0x1aa)+_0x57476e);}}export function toPosixPath(_0x38c2bd){const _0x33b9b5=a144_0x7695;return _0x38c2bd[_0x33b9b5(0x1a5)](/\\/g,'/');}export function isSha256Hex(_0x25340f){const _0x1eac1e=a144_0x7695;return typeof _0x25340f===_0x1eac1e(0x1b8)&&/^[a-fA-F0-9]{64}$/[_0x1eac1e(0x1c7)](_0x25340f);}
1
+ (function(_0xa65b,_0xf1a507){const _0x270b35=a144_0x273f,_0x3663d9=_0xa65b();while(!![]){try{const _0x102608=-parseInt(_0x270b35(0xd9))/0x1*(parseInt(_0x270b35(0xd6))/0x2)+parseInt(_0x270b35(0xce))/0x3*(parseInt(_0x270b35(0xd5))/0x4)+parseInt(_0x270b35(0xe8))/0x5*(parseInt(_0x270b35(0xe9))/0x6)+parseInt(_0x270b35(0xc2))/0x7*(parseInt(_0x270b35(0xd3))/0x8)+-parseInt(_0x270b35(0xd0))/0x9*(parseInt(_0x270b35(0xd8))/0xa)+-parseInt(_0x270b35(0xb9))/0xb+parseInt(_0x270b35(0xcb))/0xc*(parseInt(_0x270b35(0xda))/0xd);if(_0x102608===_0xf1a507)break;else _0x3663d9['push'](_0x3663d9['shift']());}catch(_0x4959e3){_0x3663d9['push'](_0x3663d9['shift']());}}}(a144_0x42ed,0x73844));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(_0x2d4256){const _0x5d756e=a144_0x273f;return _0x2d4256[_0x5d756e(0xdf)]??Buffer[_0x5d756e(0xd1)](_0x2d4256[_0x5d756e(0xcd)]??'','utf8');}export function fileText(_0xa463c2){const _0x36a33a=a144_0x273f;return fileContent(_0xa463c2)[_0x36a33a(0xc8)](_0x36a33a(0xeb));}export function normalizeLocalFiles(_0x18a311){const _0x4ca1d2=a144_0x273f;if(!Array[_0x4ca1d2(0xca)](_0x18a311)||_0x18a311['length']===0x0)return[];const _0x455477=new Map();for(const _0x5736a6 of _0x18a311){if(!_0x5736a6||typeof _0x5736a6!==_0x4ca1d2(0xc4)||typeof _0x5736a6[_0x4ca1d2(0xd7)]!==_0x4ca1d2(0xbf))throw CliErrors[_0x4ca1d2(0xbe)](_0x4ca1d2(0xde));const _0x19b7c0=normalizeSkillRelativePath(_0x5736a6[_0x4ca1d2(0xd7)]);if(_0x455477['has'](_0x19b7c0))throw CliErrors[_0x4ca1d2(0xbe)]('Duplicate\x20Skill\x20file\x20path:\x20'+_0x19b7c0);if(_0x5736a6[_0x4ca1d2(0xdf)]!==undefined&&!Buffer[_0x4ca1d2(0xe6)](_0x5736a6[_0x4ca1d2(0xdf)]))throw CliErrors[_0x4ca1d2(0xbe)](_0x4ca1d2(0xbb)+_0x19b7c0);if(_0x5736a6['bytes']===undefined&&typeof _0x5736a6['content']!=='string')throw CliErrors['validation']('Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20'+_0x19b7c0);const _0x387ad9=fileContent(_0x5736a6);_0x455477[_0x4ca1d2(0xc7)](_0x19b7c0,{'path':_0x19b7c0,'bytes':_0x387ad9});}return Array[_0x4ca1d2(0xd1)](_0x455477['values']())[_0x4ca1d2(0xe3)](compareSkillFiles);}export function normalizeManifestFiles(_0x2331bf){const _0x5bd3a8=a144_0x273f;if(!Array[_0x5bd3a8(0xca)](_0x2331bf)||_0x2331bf[_0x5bd3a8(0xe2)]===0x0)return[];const _0x206700=new Map();for(const _0x25110d of _0x2331bf){if(!_0x25110d||typeof _0x25110d!==_0x5bd3a8(0xc4)||typeof _0x25110d['path']!==_0x5bd3a8(0xbf))throw CliErrors[_0x5bd3a8(0xbe)]('Skill\x20file\x20path\x20must\x20be\x20text.');const _0x5992f6=normalizeSkillRelativePath(_0x25110d['path']);if(_0x206700['has'](_0x5992f6))throw CliErrors['validation'](_0x5bd3a8(0xc1)+_0x5992f6);if(!isSha256Hex(_0x25110d[_0x5bd3a8(0xc5)]))throw CliErrors[_0x5bd3a8(0xbe)]('Skill\x20file\x20sha256\x20is\x20invalid:\x20'+_0x5992f6);if(!Number[_0x5bd3a8(0xe0)](_0x25110d[_0x5bd3a8(0xdb)])||_0x25110d[_0x5bd3a8(0xdb)]<0x0)throw CliErrors[_0x5bd3a8(0xbe)](_0x5bd3a8(0xc3)+_0x5992f6);_0x206700[_0x5bd3a8(0xc7)](_0x5992f6,{'path':_0x5992f6,'sha256':_0x25110d[_0x5bd3a8(0xc5)][_0x5bd3a8(0xe5)](),'size':_0x25110d[_0x5bd3a8(0xdb)]});}return Array[_0x5bd3a8(0xd1)](_0x206700['values']())['sort'](compareSkillFiles);}function a144_0x273f(_0x127cbb,_0x16dd07){_0x127cbb=_0x127cbb-0xb9;const _0x42ed5f=a144_0x42ed();let _0x273f72=_0x42ed5f[_0x127cbb];return _0x273f72;}export function scanSkillDirectory(_0x5e0d69,_0x1409d6={}){const _0x3949df=a144_0x273f,_0x34eb2e=realpathSync(_0x5e0d69),_0x4c9883=canonicalExcludedFilePaths(_0x1409d6[_0x3949df(0xd4)]),_0x5b7913=[];function _0x9c3d07(_0x5bb08c){const _0x372447=_0x3949df,_0x20269e=readdirSync(_0x5bb08c,{'withFileTypes':!![]})[_0x372447(0xe3)]((_0x4b6777,_0x340ebf)=>_0x4b6777['name'][_0x372447(0xe1)](_0x340ebf[_0x372447(0xba)]));for(const _0x130bbb of _0x20269e){if(_0x130bbb[_0x372447(0xc9)]()&&IGNORED_DIR_NAMES[_0x372447(0xea)](_0x130bbb[_0x372447(0xba)]))continue;if(IGNORED_FILE_NAMES['has'](_0x130bbb[_0x372447(0xba)]))continue;const _0x1945d3=resolve(_0x5bb08c,_0x130bbb[_0x372447(0xba)]);if(isExcludedFilePath(_0x1945d3,_0x4c9883))continue;if(_0x130bbb['isSymbolicLink']())throw CliErrors[_0x372447(0xbe)](_0x372447(0xcf)+_0x1945d3);const _0x550e13=toPosixPath(relative(_0x34eb2e,_0x1945d3));if(_0x130bbb[_0x372447(0xc9)]()){_0x9c3d07(_0x1945d3);continue;}if(!_0x130bbb[_0x372447(0xbd)]())continue;validateSkillRelativePath(_0x550e13);const _0x52d0a7=readFileSync(_0x1945d3);_0x5b7913[_0x372447(0xc0)]({'path':_0x550e13,'bytes':_0x52d0a7});}}return _0x9c3d07(_0x34eb2e),normalizeLocalFiles(_0x5b7913);}function canonicalExcludedFilePaths(_0x1b47c2){const _0x32c012=a144_0x273f,_0x5382f8=new Set();for(const _0x53de8f of _0x1b47c2??[]){const _0x5f39b5=resolve(_0x53de8f);_0x5382f8[_0x32c012(0xdd)](_0x5f39b5);try{_0x5382f8[_0x32c012(0xdd)](realpathSync(_0x5f39b5));}catch{}}return _0x5382f8;}function isExcludedFilePath(_0x1dc59e,_0x6c2f68){const _0x8ed818=a144_0x273f;if(_0x6c2f68['has'](_0x1dc59e))return!![];if(_0x6c2f68['size']===0x0)return![];try{return _0x6c2f68[_0x8ed818(0xea)](realpathSync(_0x1dc59e));}catch{return![];}}export function compareSkillFiles(_0x22a749,_0x2d86e8){const _0x348a0d=a144_0x273f;if(_0x22a749['path']===SKILL_FILE)return _0x2d86e8['path']===SKILL_FILE?0x0:-0x1;if(_0x2d86e8[_0x348a0d(0xd7)]===SKILL_FILE)return 0x1;return Buffer[_0x348a0d(0xcc)](Buffer[_0x348a0d(0xd1)](_0x22a749[_0x348a0d(0xd7)],_0x348a0d(0xeb)),Buffer[_0x348a0d(0xd1)](_0x2d86e8[_0x348a0d(0xd7)],_0x348a0d(0xeb)));}export function normalizeSkillRelativePath(_0x68a158){const _0x10b551=toPosixPath(_0x68a158['trim']());return validateSkillRelativePath(_0x10b551),_0x10b551;}export function validateSkillRelativePath(_0x312265){const _0x292ba8=a144_0x273f;if(!_0x312265||_0x312265[_0x292ba8(0xe7)]('/')||_0x312265[_0x292ba8(0xbc)]('//'))throw CliErrors[_0x292ba8(0xbe)](_0x292ba8(0xdc)+_0x312265);for(const _0x309224 of _0x312265[_0x292ba8(0xd2)]('/')){if(!_0x309224||_0x309224==='.'||_0x309224==='..')throw CliErrors['validation'](_0x292ba8(0xdc)+_0x312265);}}export function toPosixPath(_0x40dfb2){const _0x2d2d70=a144_0x273f;return _0x40dfb2[_0x2d2d70(0xc6)](/\\/g,'/');}function a144_0x42ed(){const _0x8f8431=['validation','string','push','Duplicate\x20Skill\x20file\x20path:\x20','381647wiWTrN','Skill\x20file\x20size\x20is\x20invalid:\x20','object','sha256','replace','set','toString','isDirectory','isArray','9468408OnucWD','compare','content','146154iTINxv','Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20','6882237AhlGqK','from','split','32OyZpdn','excludedFilePaths','68dbUnWI','68mnCweK','path','10qJaZGA','10975DQPdIj','13rNQnZt','size','Unsafe\x20Skill\x20file\x20path:\x20','add','Skill\x20file\x20path\x20must\x20be\x20text.','bytes','isSafeInteger','localeCompare','length','sort','test','toLowerCase','isBuffer','startsWith','335IxRtqS','3912bjVLXN','has','utf8','2948099HoMPww','name','Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20','includes','isFile'];a144_0x42ed=function(){return _0x8f8431;};return a144_0x42ed();}export function isSha256Hex(_0x11881b){const _0x43c456=a144_0x273f;return typeof _0x11881b===_0x43c456(0xbf)&&/^[a-fA-F0-9]{64}$/[_0x43c456(0xe4)](_0x11881b);}
@@ -1 +1 @@
1
- (function(_0x2988ef,_0x1f15d3){const _0xda9c48=a145_0x4e63,_0x21ac0c=_0x2988ef();while(!![]){try{const _0x2f1e29=-parseInt(_0xda9c48(0x13f))/0x1+parseInt(_0xda9c48(0x152))/0x2+-parseInt(_0xda9c48(0x15a))/0x3*(parseInt(_0xda9c48(0x168))/0x4)+parseInt(_0xda9c48(0x159))/0x5+parseInt(_0xda9c48(0x178))/0x6+-parseInt(_0xda9c48(0x162))/0x7*(parseInt(_0xda9c48(0x14b))/0x8)+parseInt(_0xda9c48(0x155))/0x9*(parseInt(_0xda9c48(0x15c))/0xa);if(_0x2f1e29===_0x1f15d3)break;else _0x21ac0c['push'](_0x21ac0c['shift']());}catch(_0x5bed64){_0x21ac0c['push'](_0x21ac0c['shift']());}}}(a145_0x409a,0x6c8ec));import{existsSync,lstatSync,mkdirSync,readFileSync,rmSync}from'node:fs';import{dirname,resolve}from'node:path';import{isCollection,isMap,isNode,parseDocument,visit}from'yaml';function a145_0x4e63(_0x4b960b,_0x3c43a1){_0x4b960b=_0x4b960b-0x13b;const _0x409ab6=a145_0x409a();let _0x4e6309=_0x409ab6[_0x4b960b];return _0x4e6309;}import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{resolveManagedFilePath,writeBytesAtomic,writeJsonAtomic}from'./fs-utils.js';import{bufferSha256,contentHash,fileHash}from'./hashing.js';import{fileContent,fileText,normalizeLocalFiles}from'./local-files.js';import{buildMetadata,readMetadataIfPresent,requireSkillCode}from'./metadata.js';function a145_0x409a(){const _0xd983eb=['errors','104419TXjPTW','paths','env','name:\x20','appCode','toString','scope','test','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.','skillCode','skillName','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','550640YKYPJj','\x0a---\x0a\x0a','trim','utf8','length','contents','replace','1257540cXxjjY','hasOwn','isFile','90SfQcjB','set','displayName','validation','3281490kgrhNK','7782nIwipN','match','16630mSEbqm','slice','keys','Runtime\x20Skill\x20package\x20is\x20missing\x20','status','description','77FGMJze','schemaVersion','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','flow','find','220dmBuUn','contentHash','pulledAt','---','path','Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20','name','version','map','packageBytes','entries','example','accessKey','trimEnd','force','has','883038LyFkeY','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','fileHashes','join'];a145_0x409a=function(){return _0xd983eb;};return a145_0x409a();}import{getRuntimeSkillDir}from'./paths.js';import{extractDownloadedPackage,requirePackageBytes}from'./zip-package.js';export function materializeRuntimeSkill(_0x381219,_0x3db26b,_0x1bfb8b){const _0x3200b8=a145_0x4e63,_0x57f3cf=requireSkillCode(_0x381219),_0x676078=requirePackageBytes(_0x57f3cf,_0x1bfb8b[_0x3200b8(0x171)]),_0x1e2947=extractDownloadedPackage(_0x676078),_0x432db8=_0x1e2947[_0x3200b8(0x167)](_0x441183=>_0x441183[_0x3200b8(0x16c)]===SKILL_FILE);if(!_0x432db8)throw CliErrors[_0x3200b8(0x158)](_0x3200b8(0x15f)+SKILL_FILE+':\x20'+_0x57f3cf);const _0x2acce7=withMaterializedSkillFrontmatter(_0x1e2947,_0x381219,_0x57f3cf),_0x1c4c03=_0x2acce7['find'](_0x4112ec=>_0x4112ec[_0x3200b8(0x16c)]===SKILL_FILE),_0x474fd7=fileText(_0x1c4c03),_0x252464=getRuntimeSkillDir(_0x1bfb8b[_0x3200b8(0x141)],_0x1bfb8b[_0x3200b8(0x174)],_0x1bfb8b[_0x3200b8(0x143)],_0x3db26b,_0x57f3cf,_0x1bfb8b['paths']),_0x2d0917=resolve(_0x252464,SKILL_FILE),_0x116968=resolve(_0x252464,METADATA_FILE),_0x2d9704=contentHash(_0x474fd7),_0x1c6e65=readMetadataIfPresent(_0x116968)?.[_0x3200b8(0x13c)];ensurePulledFilesCanBeOverwritten(_0x252464,_0x116968,_0x2acce7,_0x1bfb8b[_0x3200b8(0x176)]===!![]),mkdirSync(_0x252464,{'recursive':!![],'mode':0x1c0});const _0x115024=existsSync(_0x2d0917)?readFileSync(_0x2d0917,_0x3200b8(0x14e)):undefined;return materializeFiles(_0x252464,_0x2acce7),removeStaleManagedFiles(_0x252464,_0x1c6e65,_0x2acce7),writeJsonAtomic(_0x116968,buildMetadata(_0x381219,_0x3db26b,_0x1bfb8b[_0x3200b8(0x143)],_0x2d9704,_0x1bfb8b[_0x3200b8(0x16a)],_0x2acce7,_0x676078)),{'skill':_0x381219,'scope':_0x3db26b,'dir':_0x252464,'skillMdPath':_0x2d0917,'metadataPath':_0x116968,'contentHash':_0x2d9704,'changed':_0x115024!==_0x474fd7};}export function reuseMaterializedRuntimeSkill(_0x5ae6b6,_0x54dd83,_0x32e1fb){const _0x29aa9f=a145_0x4e63,_0x24471e=_0x5ae6b6[_0x29aa9f(0x16f)]?.[_0x29aa9f(0x14d)]();if(!_0x24471e)return undefined;const _0x3f7fcd=requireSkillCode(_0x5ae6b6),_0x356542=getRuntimeSkillDir(_0x32e1fb[_0x29aa9f(0x141)],_0x32e1fb[_0x29aa9f(0x174)],_0x32e1fb[_0x29aa9f(0x143)],_0x54dd83,_0x3f7fcd,_0x32e1fb[_0x29aa9f(0x140)]),_0x4b546c=resolve(_0x356542,SKILL_FILE),_0x202a3d=resolve(_0x356542,METADATA_FILE),_0x2eb13d=readMetadataIfPresent(_0x202a3d);if(!_0x2eb13d||_0x2eb13d[_0x29aa9f(0x163)]!==0x2||_0x2eb13d['appCode']!==_0x32e1fb[_0x29aa9f(0x143)]||_0x2eb13d[_0x29aa9f(0x145)]!==_0x54dd83||_0x2eb13d[_0x29aa9f(0x148)]!==_0x3f7fcd||_0x2eb13d[_0x29aa9f(0x16f)]!==_0x24471e||_0x2eb13d['id']!==_0x5ae6b6['id']||_0x2eb13d[_0x29aa9f(0x149)]!==_0x5ae6b6['skillName']||_0x2eb13d['description']!==_0x5ae6b6[_0x29aa9f(0x161)]||_0x2eb13d[_0x29aa9f(0x173)]!==_0x5ae6b6['example']||_0x2eb13d['status']!==_0x5ae6b6[_0x29aa9f(0x160)]||!_0x2eb13d['contentHash']||!_0x2eb13d[_0x29aa9f(0x13c)]||!Object[_0x29aa9f(0x153)](_0x2eb13d[_0x29aa9f(0x13c)],SKILL_FILE))return undefined;for(const [_0x27dbcc,_0x18c554]of Object[_0x29aa9f(0x172)](_0x2eb13d['fileHashes'])){if(!/^[a-f0-9]{64}$/[_0x29aa9f(0x146)](_0x18c554))return undefined;const _0x21127c=resolveManagedFilePath(_0x356542,_0x27dbcc);if(!existsSync(_0x21127c)||!lstatSync(_0x21127c)[_0x29aa9f(0x154)]())return undefined;if(bufferSha256(readFileSync(_0x21127c))!==_0x18c554)return undefined;}return{'skill':_0x5ae6b6,'scope':_0x54dd83,'dir':_0x356542,'skillMdPath':_0x4b546c,'metadataPath':_0x202a3d,'contentHash':_0x2eb13d[_0x29aa9f(0x169)],'changed':![]};}function withMaterializedSkillFrontmatter(_0x6bb234,_0x318935,_0x164a84){const _0x20ed7e=a145_0x4e63,_0x5a0483=skillDisplayName(_0x318935,_0x164a84),_0x367f86=_0x318935[_0x20ed7e(0x161)]?.[_0x20ed7e(0x14d)]()||_0x5a0483||_0x164a84;return normalizeLocalFiles(_0x6bb234)[_0x20ed7e(0x170)](_0x337d99=>{const _0x5a572d=_0x20ed7e,_0x17795e=fileText(_0x337d99);if(_0x337d99['path']!==SKILL_FILE)return _0x337d99;if(hasYamlFrontmatter(_0x17795e))return{'path':_0x337d99[_0x5a572d(0x16c)],'content':withSyncedDisplayName(_0x17795e,_0x5a0483)};return{'path':_0x337d99[_0x5a572d(0x16c)],'content':prependSkillFrontmatter(_0x17795e,{'name':_0x164a84,'displayName':_0x5a0483,'description':_0x367f86})};});}function hasYamlFrontmatter(_0x107a10){const _0x2f5093=a145_0x4e63;return/^\uFEFF?---\s*\r?\n/[_0x2f5093(0x146)](_0x107a10);}function prependSkillFrontmatter(_0x5df0f1,_0x2cfdb8){const _0x1aa6d2=a145_0x4e63,_0x2fce37=_0x5df0f1['replace'](/^\uFEFF/,'');return[_0x1aa6d2(0x16b),_0x1aa6d2(0x142)+yamlString(_0x2cfdb8[_0x1aa6d2(0x16e)]),_0x2cfdb8[_0x1aa6d2(0x157)]?'displayName:\x20'+yamlString(_0x2cfdb8[_0x1aa6d2(0x157)]):undefined,'description:\x20'+yamlString(_0x2cfdb8[_0x1aa6d2(0x161)]),_0x1aa6d2(0x16b),'',_0x2fce37]['filter'](_0x1fbcb1=>_0x1fbcb1!==undefined)[_0x1aa6d2(0x13d)]('\x0a');}function yamlString(_0x4c2949){const _0x56282c=a145_0x4e63;return JSON['stringify'](_0x4c2949[_0x56282c(0x151)](/\r/g,'')['trim']());}function skillDisplayName(_0x168f74,_0x366ae2){const _0x38f2ab=a145_0x4e63,_0x1ed9e9=_0x168f74[_0x38f2ab(0x149)]?.[_0x38f2ab(0x14d)]();return _0x1ed9e9||_0x366ae2;}function withSyncedDisplayName(_0x3277e6,_0x4c46bb){const _0x8455fd=a145_0x4e63,_0x3a366f=_0x3277e6[_0x8455fd(0x15b)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x3a366f)return _0x3277e6;const _0xdb5814=_0x3a366f[0x1]??'',_0x43d6dd=_0x3a366f[0x2]??'',_0x2ed9c5=parseDocument(_0x43d6dd);if(_0x2ed9c5[_0x8455fd(0x13e)]['length']>0x0||!isMap(_0x2ed9c5[_0x8455fd(0x150)]))return _0x3277e6;if(_0x4c46bb)_0x2ed9c5[_0x8455fd(0x156)]('displayName',_0x4c46bb);else{if(_0x2ed9c5[_0x8455fd(0x177)](_0x8455fd(0x157)))_0x2ed9c5['delete'](_0x8455fd(0x157));else return _0x3277e6;}forceBlockCollections(_0x2ed9c5['contents']);const _0x52037c=_0x2ed9c5[_0x8455fd(0x144)]({'lineWidth':0x0})[_0x8455fd(0x175)](),_0x3c7aa1=_0x3277e6[_0x8455fd(0x15d)](_0x3a366f[0x0][_0x8455fd(0x14f)])['replace'](/^\r?\n/,'');return _0xdb5814+'---\x0a'+_0x52037c+_0x8455fd(0x14c)+_0x3c7aa1;}function forceBlockCollections(_0x535414){if(!isNode(_0x535414))return;visit(_0x535414,(_0x486f6e,_0x48cc10)=>{const _0x3b2719=a145_0x4e63;isCollection(_0x48cc10)&&(_0x48cc10[_0x3b2719(0x166)]=![]);});}function ensurePulledFilesCanBeOverwritten(_0x25607f,_0x367c37,_0x5e0448,_0x2d3a75){const _0x2dcfb5=a145_0x4e63;if(_0x2d3a75||!existsSync(_0x367c37))return;const _0x59ab47=readMetadataIfPresent(_0x367c37);if(!_0x59ab47)return;const _0x333ef6=_0x59ab47['fileHashes']&&Object[_0x2dcfb5(0x15e)](_0x59ab47['fileHashes'])[_0x2dcfb5(0x14f)]>0x0?_0x59ab47[_0x2dcfb5(0x13c)]:undefined;if(_0x333ef6)for(const [_0x2023ab,_0x1de605]of Object[_0x2dcfb5(0x172)](_0x333ef6)){const _0x3bc4ec=resolveManagedFilePath(_0x25607f,_0x2023ab);if(!existsSync(_0x3bc4ec))throw CliErrors[_0x2dcfb5(0x158)](_0x2dcfb5(0x14a)+_0x25607f,'Managed\x20file\x20was\x20removed\x20locally:\x20'+_0x2023ab);const _0x4f5403=lstatSync(_0x3bc4ec);if(!_0x4f5403[_0x2dcfb5(0x154)]())throw CliErrors[_0x2dcfb5(0x158)](_0x2dcfb5(0x14a)+_0x25607f,_0x2dcfb5(0x16d)+_0x2023ab);const _0x4c96c5=bufferSha256(readFileSync(_0x3bc4ec));if(_0x4c96c5!==_0x1de605)throw CliErrors[_0x2dcfb5(0x158)](_0x2dcfb5(0x14a)+_0x25607f+'.\x20Changed\x20file:\x20'+_0x2023ab,_0x2dcfb5(0x165)+_0x2023ab);}else{const _0x13ea2d=resolve(_0x25607f,SKILL_FILE);if(existsSync(_0x13ea2d)&&_0x59ab47[_0x2dcfb5(0x169)]){const _0x17a39c=contentHash(readFileSync(_0x13ea2d,_0x2dcfb5(0x14e)));if(_0x17a39c!==_0x59ab47[_0x2dcfb5(0x169)])throw CliErrors['validation'](_0x2dcfb5(0x13b)+_0x13ea2d,_0x2dcfb5(0x147));}}for(const _0x44d4d7 of normalizeLocalFiles(_0x5e0448)){if(_0x333ef6?.[_0x44d4d7[_0x2dcfb5(0x16c)]])continue;if(!_0x333ef6&&_0x44d4d7['path']===SKILL_FILE)continue;const _0x56a093=resolveManagedFilePath(_0x25607f,_0x44d4d7[_0x2dcfb5(0x16c)]);if(!existsSync(_0x56a093))continue;const _0x11c979=lstatSync(_0x56a093);if(!_0x11c979[_0x2dcfb5(0x154)]())throw CliErrors[_0x2dcfb5(0x158)](_0x2dcfb5(0x14a)+_0x25607f,_0x2dcfb5(0x164)+_0x44d4d7['path']);const _0x608625=bufferSha256(readFileSync(_0x56a093));if(_0x608625!==fileHash(_0x44d4d7))throw CliErrors['validation'](_0x2dcfb5(0x14a)+_0x25607f,'Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20'+_0x44d4d7['path']);}}function materializeFiles(_0x246485,_0xd7f912){const _0x596189=a145_0x4e63;for(const _0x4bb6f5 of normalizeLocalFiles(_0xd7f912)){const _0x22a320=resolveManagedFilePath(_0x246485,_0x4bb6f5[_0x596189(0x16c)]);mkdirSync(dirname(_0x22a320),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x22a320,fileContent(_0x4bb6f5),0x180);}}function removeStaleManagedFiles(_0x53fe6a,_0x3ab8e7,_0x418c68){const _0x2e833c=a145_0x4e63;if(!_0x3ab8e7)return;const _0xbc1a12=new Set(normalizeLocalFiles(_0x418c68)[_0x2e833c(0x170)](_0x108fcb=>_0x108fcb[_0x2e833c(0x16c)]));for(const _0x1dcae7 of Object[_0x2e833c(0x15e)](_0x3ab8e7)){if(_0xbc1a12[_0x2e833c(0x177)](_0x1dcae7))continue;const _0x476dda=resolveManagedFilePath(_0x53fe6a,_0x1dcae7);existsSync(_0x476dda)&&lstatSync(_0x476dda)[_0x2e833c(0x154)]()&&rmSync(_0x476dda,{'force':!![]});}}
1
+ (function(_0x4e38a6,_0x139c88){const _0x3682de=a145_0x56c5,_0x3da7d4=_0x4e38a6();while(!![]){try{const _0x442a02=-parseInt(_0x3682de(0x18e))/0x1+-parseInt(_0x3682de(0x1a5))/0x2+parseInt(_0x3682de(0x1a7))/0x3+-parseInt(_0x3682de(0x19e))/0x4*(parseInt(_0x3682de(0x192))/0x5)+parseInt(_0x3682de(0x1a1))/0x6+-parseInt(_0x3682de(0x1a8))/0x7+parseInt(_0x3682de(0x1a3))/0x8;if(_0x442a02===_0x139c88)break;else _0x3da7d4['push'](_0x3da7d4['shift']());}catch(_0x39d805){_0x3da7d4['push'](_0x3da7d4['shift']());}}}(a145_0x57ce,0xad02e));function a145_0x57ce(){const _0x1be525=['contents','example','version','validation','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.','name:\x20','353924YeArwY','.\x20Changed\x20file:\x20','env','5031540Oofqcr','hasOwn','27113760FgMxtd','appCode','2698920OQJyHK','status','679377avaOyr','1314054LKdIhp','force','keys','skillCode','errors','accessKey','Managed\x20file\x20was\x20removed\x20locally:\x20','utf8','toString','---\x0a','test','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','has','find','skillName','displayName:\x20','description','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','slice','isFile','stringify','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','trimEnd','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','paths','scope','contentHash','trim','Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20','path','name','delete','flow','1323623fWUEVQ','length','entries','---','50ocMIET','replace','match','fileHashes','pulledAt','displayName'];a145_0x57ce=function(){return _0x1be525;};return a145_0x57ce();}import{existsSync,lstatSync,mkdirSync,readFileSync,rmSync}from'node:fs';import{dirname,resolve}from'node:path';function a145_0x56c5(_0x398523,_0x49b446){_0x398523=_0x398523-0x17a;const _0x57ce75=a145_0x57ce();let _0x56c5e6=_0x57ce75[_0x398523];return _0x56c5e6;}import{isCollection,isMap,isNode,parseDocument,visit}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{resolveManagedFilePath,writeBytesAtomic,writeJsonAtomic}from'./fs-utils.js';import{bufferSha256,contentHash,fileHash}from'./hashing.js';import{fileContent,fileText,normalizeLocalFiles}from'./local-files.js';import{buildMetadata,readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillDir}from'./paths.js';import{extractDownloadedPackage,requirePackageBytes}from'./zip-package.js';export function materializeRuntimeSkill(_0x577ac9,_0x42fc04,_0x3ed19b){const _0x174670=a145_0x56c5,_0x4e4034=requireSkillCode(_0x577ac9),_0x339094=requirePackageBytes(_0x4e4034,_0x3ed19b['packageBytes']),_0x23d8fa=extractDownloadedPackage(_0x339094),_0x13a2bb=_0x23d8fa[_0x174670(0x17a)](_0x517bee=>_0x517bee[_0x174670(0x18a)]===SKILL_FILE);if(!_0x13a2bb)throw CliErrors[_0x174670(0x19b)]('Runtime\x20Skill\x20package\x20is\x20missing\x20'+SKILL_FILE+':\x20'+_0x4e4034);const _0x59da50=withMaterializedSkillFrontmatter(_0x23d8fa,_0x577ac9,_0x4e4034),_0x263d61=_0x59da50['find'](_0x39f06a=>_0x39f06a[_0x174670(0x18a)]===SKILL_FILE),_0x2507a7=fileText(_0x263d61),_0x8d0ae=getRuntimeSkillDir(_0x3ed19b[_0x174670(0x1a0)],_0x3ed19b[_0x174670(0x1ad)],_0x3ed19b['appCode'],_0x42fc04,_0x4e4034,_0x3ed19b[_0x174670(0x185)]),_0x25d2f0=resolve(_0x8d0ae,SKILL_FILE),_0xe83d9f=resolve(_0x8d0ae,METADATA_FILE),_0x544741=contentHash(_0x2507a7),_0x39c7ec=readMetadataIfPresent(_0xe83d9f)?.[_0x174670(0x195)];ensurePulledFilesCanBeOverwritten(_0x8d0ae,_0xe83d9f,_0x59da50,_0x3ed19b[_0x174670(0x1a9)]===!![]),mkdirSync(_0x8d0ae,{'recursive':!![],'mode':0x1c0});const _0x5b3390=existsSync(_0x25d2f0)?readFileSync(_0x25d2f0,_0x174670(0x1af)):undefined;return materializeFiles(_0x8d0ae,_0x59da50),removeStaleManagedFiles(_0x8d0ae,_0x39c7ec,_0x59da50),writeJsonAtomic(_0xe83d9f,buildMetadata(_0x577ac9,_0x42fc04,_0x3ed19b[_0x174670(0x1a4)],_0x544741,_0x3ed19b[_0x174670(0x196)],_0x59da50,_0x339094)),{'skill':_0x577ac9,'scope':_0x42fc04,'dir':_0x8d0ae,'skillMdPath':_0x25d2f0,'metadataPath':_0xe83d9f,'contentHash':_0x544741,'changed':_0x5b3390!==_0x2507a7};}export function reuseMaterializedRuntimeSkill(_0x307747,_0x595097,_0x3981bd){const _0x3f48a4=a145_0x56c5,_0x15e25c=_0x307747[_0x3f48a4(0x19a)]?.[_0x3f48a4(0x188)]();if(!_0x15e25c)return undefined;const _0x3a8575=requireSkillCode(_0x307747),_0x58dd43=getRuntimeSkillDir(_0x3981bd[_0x3f48a4(0x1a0)],_0x3981bd[_0x3f48a4(0x1ad)],_0x3981bd[_0x3f48a4(0x1a4)],_0x595097,_0x3a8575,_0x3981bd[_0x3f48a4(0x185)]),_0x47cfd0=resolve(_0x58dd43,SKILL_FILE),_0x3ae9a3=resolve(_0x58dd43,METADATA_FILE),_0x274a72=readMetadataIfPresent(_0x3ae9a3);if(!_0x274a72||_0x274a72['schemaVersion']!==0x2||_0x274a72['appCode']!==_0x3981bd[_0x3f48a4(0x1a4)]||_0x274a72[_0x3f48a4(0x186)]!==_0x595097||_0x274a72[_0x3f48a4(0x1ab)]!==_0x3a8575||_0x274a72['version']!==_0x15e25c||_0x274a72['id']!==_0x307747['id']||_0x274a72[_0x3f48a4(0x17b)]!==_0x307747[_0x3f48a4(0x17b)]||_0x274a72['description']!==_0x307747[_0x3f48a4(0x17d)]||_0x274a72[_0x3f48a4(0x199)]!==_0x307747['example']||_0x274a72[_0x3f48a4(0x1a6)]!==_0x307747['status']||!_0x274a72[_0x3f48a4(0x187)]||!_0x274a72[_0x3f48a4(0x195)]||!Object[_0x3f48a4(0x1a2)](_0x274a72[_0x3f48a4(0x195)],SKILL_FILE))return undefined;for(const [_0x2bcc6d,_0x2fa846]of Object[_0x3f48a4(0x190)](_0x274a72[_0x3f48a4(0x195)])){if(!/^[a-f0-9]{64}$/['test'](_0x2fa846))return undefined;const _0x84c2bf=resolveManagedFilePath(_0x58dd43,_0x2bcc6d);if(!existsSync(_0x84c2bf)||!lstatSync(_0x84c2bf)[_0x3f48a4(0x180)]())return undefined;if(bufferSha256(readFileSync(_0x84c2bf))!==_0x2fa846)return undefined;}return{'skill':_0x307747,'scope':_0x595097,'dir':_0x58dd43,'skillMdPath':_0x47cfd0,'metadataPath':_0x3ae9a3,'contentHash':_0x274a72[_0x3f48a4(0x187)],'changed':![]};}function withMaterializedSkillFrontmatter(_0x16728d,_0x3f21d3,_0x4b90e8){const _0x355a92=a145_0x56c5,_0x2c8601=skillDisplayName(_0x3f21d3,_0x4b90e8),_0x5aaf10=_0x3f21d3[_0x355a92(0x17d)]?.[_0x355a92(0x188)]()||_0x2c8601||_0x4b90e8;return normalizeLocalFiles(_0x16728d)['map'](_0x811543=>{const _0xf249a7=_0x355a92,_0x43c785=fileText(_0x811543);if(_0x811543['path']!==SKILL_FILE)return _0x811543;if(hasYamlFrontmatter(_0x43c785))return{'path':_0x811543[_0xf249a7(0x18a)],'content':withSyncedDisplayName(_0x43c785,_0x2c8601)};return{'path':_0x811543[_0xf249a7(0x18a)],'content':prependSkillFrontmatter(_0x43c785,{'name':_0x4b90e8,'displayName':_0x2c8601,'description':_0x5aaf10})};});}function hasYamlFrontmatter(_0x5f15e0){const _0x48a7ed=a145_0x56c5;return/^\uFEFF?---\s*\r?\n/[_0x48a7ed(0x1b2)](_0x5f15e0);}function prependSkillFrontmatter(_0x338d2c,_0x17529d){const _0x3f65c=a145_0x56c5,_0x741f34=_0x338d2c[_0x3f65c(0x193)](/^\uFEFF/,'');return[_0x3f65c(0x191),_0x3f65c(0x19d)+yamlString(_0x17529d[_0x3f65c(0x18b)]),_0x17529d['displayName']?_0x3f65c(0x17c)+yamlString(_0x17529d['displayName']):undefined,'description:\x20'+yamlString(_0x17529d[_0x3f65c(0x17d)]),_0x3f65c(0x191),'',_0x741f34]['filter'](_0x3efdbb=>_0x3efdbb!==undefined)['join']('\x0a');}function yamlString(_0x3d88ed){const _0xb159ec=a145_0x56c5;return JSON[_0xb159ec(0x181)](_0x3d88ed['replace'](/\r/g,'')[_0xb159ec(0x188)]());}function skillDisplayName(_0x4ef448,_0x3b0723){const _0x2452dc=a145_0x56c5,_0x5168e2=_0x4ef448[_0x2452dc(0x17b)]?.[_0x2452dc(0x188)]();return _0x5168e2||_0x3b0723;}function withSyncedDisplayName(_0x5adec1,_0x4d6a27){const _0x293d40=a145_0x56c5,_0x8ff034=_0x5adec1[_0x293d40(0x194)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x8ff034)return _0x5adec1;const _0x59b148=_0x8ff034[0x1]??'',_0xf85c8a=_0x8ff034[0x2]??'',_0x3c06be=parseDocument(_0xf85c8a);if(_0x3c06be[_0x293d40(0x1ac)][_0x293d40(0x18f)]>0x0||!isMap(_0x3c06be[_0x293d40(0x198)]))return _0x5adec1;if(_0x4d6a27)_0x3c06be['set'](_0x293d40(0x197),_0x4d6a27);else{if(_0x3c06be[_0x293d40(0x1b4)]('displayName'))_0x3c06be[_0x293d40(0x18c)](_0x293d40(0x197));else return _0x5adec1;}forceBlockCollections(_0x3c06be[_0x293d40(0x198)]);const _0x506b89=_0x3c06be[_0x293d40(0x1b0)]({'lineWidth':0x0})[_0x293d40(0x183)](),_0x3b25dd=_0x5adec1[_0x293d40(0x17f)](_0x8ff034[0x0][_0x293d40(0x18f)])['replace'](/^\r?\n/,'');return _0x59b148+_0x293d40(0x1b1)+_0x506b89+'\x0a---\x0a\x0a'+_0x3b25dd;}function forceBlockCollections(_0x57dbbf){if(!isNode(_0x57dbbf))return;visit(_0x57dbbf,(_0x5c347f,_0xaa246c)=>{const _0x12a8d8=a145_0x56c5;isCollection(_0xaa246c)&&(_0xaa246c[_0x12a8d8(0x18d)]=![]);});}function ensurePulledFilesCanBeOverwritten(_0x1a6d4e,_0x127378,_0x22897e,_0x3a2ae6){const _0x23375b=a145_0x56c5;if(_0x3a2ae6||!existsSync(_0x127378))return;const _0x248af5=readMetadataIfPresent(_0x127378);if(!_0x248af5)return;const _0x20adcd=_0x248af5[_0x23375b(0x195)]&&Object[_0x23375b(0x1aa)](_0x248af5[_0x23375b(0x195)])[_0x23375b(0x18f)]>0x0?_0x248af5['fileHashes']:undefined;if(_0x20adcd)for(const [_0x49f163,_0x16a3b7]of Object[_0x23375b(0x190)](_0x20adcd)){const _0x1047f4=resolveManagedFilePath(_0x1a6d4e,_0x49f163);if(!existsSync(_0x1047f4))throw CliErrors[_0x23375b(0x19b)](_0x23375b(0x184)+_0x1a6d4e,_0x23375b(0x1ae)+_0x49f163);const _0x245d23=lstatSync(_0x1047f4);if(!_0x245d23[_0x23375b(0x180)]())throw CliErrors[_0x23375b(0x19b)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x1a6d4e,_0x23375b(0x189)+_0x49f163);const _0x1e1773=bufferSha256(readFileSync(_0x1047f4));if(_0x1e1773!==_0x16a3b7)throw CliErrors['validation'](_0x23375b(0x184)+_0x1a6d4e+_0x23375b(0x19f)+_0x49f163,_0x23375b(0x1b3)+_0x49f163);}else{const _0x5d9610=resolve(_0x1a6d4e,SKILL_FILE);if(existsSync(_0x5d9610)&&_0x248af5[_0x23375b(0x187)]){const _0xe88e9e=contentHash(readFileSync(_0x5d9610,_0x23375b(0x1af)));if(_0xe88e9e!==_0x248af5['contentHash'])throw CliErrors[_0x23375b(0x19b)](_0x23375b(0x17e)+_0x5d9610,_0x23375b(0x19c));}}for(const _0x3863a7 of normalizeLocalFiles(_0x22897e)){if(_0x20adcd?.[_0x3863a7['path']])continue;if(!_0x20adcd&&_0x3863a7[_0x23375b(0x18a)]===SKILL_FILE)continue;const _0x274962=resolveManagedFilePath(_0x1a6d4e,_0x3863a7[_0x23375b(0x18a)]);if(!existsSync(_0x274962))continue;const _0x419145=lstatSync(_0x274962);if(!_0x419145['isFile']())throw CliErrors[_0x23375b(0x19b)](_0x23375b(0x184)+_0x1a6d4e,_0x23375b(0x182)+_0x3863a7[_0x23375b(0x18a)]);const _0x5a6d38=bufferSha256(readFileSync(_0x274962));if(_0x5a6d38!==fileHash(_0x3863a7))throw CliErrors[_0x23375b(0x19b)](_0x23375b(0x184)+_0x1a6d4e,'Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20'+_0x3863a7[_0x23375b(0x18a)]);}}function materializeFiles(_0x2d7434,_0x16143e){const _0x393c06=a145_0x56c5;for(const _0x438517 of normalizeLocalFiles(_0x16143e)){const _0x200e25=resolveManagedFilePath(_0x2d7434,_0x438517[_0x393c06(0x18a)]);mkdirSync(dirname(_0x200e25),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x200e25,fileContent(_0x438517),0x180);}}function removeStaleManagedFiles(_0x4d5390,_0x4150c0,_0x1e337c){const _0x1d4b12=a145_0x56c5;if(!_0x4150c0)return;const _0x4a8e84=new Set(normalizeLocalFiles(_0x1e337c)['map'](_0x33b518=>_0x33b518['path']));for(const _0x17883d of Object[_0x1d4b12(0x1aa)](_0x4150c0)){if(_0x4a8e84[_0x1d4b12(0x1b4)](_0x17883d))continue;const _0x362695=resolveManagedFilePath(_0x4d5390,_0x17883d);existsSync(_0x362695)&&lstatSync(_0x362695)[_0x1d4b12(0x180)]()&&rmSync(_0x362695,{'force':!![]});}}
@@ -1 +1 @@
1
- (function(_0x5eaeae,_0x43dee9){const _0x1959f7=a146_0x2a1f,_0x548e37=_0x5eaeae();while(!![]){try{const _0x2b191f=-parseInt(_0x1959f7(0x1f0))/0x1+-parseInt(_0x1959f7(0x1ee))/0x2*(parseInt(_0x1959f7(0x1e8))/0x3)+parseInt(_0x1959f7(0x1ea))/0x4*(parseInt(_0x1959f7(0x206))/0x5)+parseInt(_0x1959f7(0x1e0))/0x6*(parseInt(_0x1959f7(0x1e2))/0x7)+parseInt(_0x1959f7(0x1f2))/0x8+-parseInt(_0x1959f7(0x1f9))/0x9*(-parseInt(_0x1959f7(0x1fd))/0xa)+parseInt(_0x1959f7(0x1e9))/0xb*(-parseInt(_0x1959f7(0x1e6))/0xc);if(_0x2b191f===_0x43dee9)break;else _0x548e37['push'](_0x548e37['shift']());}catch(_0x16cac9){_0x548e37['push'](_0x548e37['shift']());}}}(a146_0x16df,0xe7ffe));import{existsSync,readFileSync}from'node:fs';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';function a146_0x16df(){const _0x3a2f3f=['personal','21gXzSwe','25638173PbuMDp','4BiMLlR','object','description','zipSize','305154GiAaea','version','513065RYvBLf','forkedFromSkillId','7170720nVPeUL','ossPath','userId','zipSha256','tenantCode','status','path','670455WEkeDg','validation','map','parse','130poqHeq','files','trim','forkedFromVersion','tags','sourceSessionId','skillCode','skillName','manifest','7620685NOUrlR','isArray','1767846drbnxd','readonly','35KbGywK','length','utf8','toISOString','12llypAE'];a146_0x16df=function(){return _0x3a2f3f;};return a146_0x16df();}import{fileContent,normalizeLocalFiles}from'./local-files.js';import{buildSkillPackage,localFilesToManifestFiles}from'./zip-package.js';export function buildMetadata(_0x2e9502,_0x7345ba,_0x56f89f,_0x45eb88,_0x5cee47,_0x3dfe8d,_0xf906cf){const _0x1214ce=a146_0x2a1f,_0x20d53f=_0x3dfe8d?normalizeLocalFiles(_0x3dfe8d):[],_0x5b383c=!_0xf906cf&&_0x20d53f[_0x1214ce(0x1e3)]>0x0?buildSkillPackage(_0x20d53f):undefined,_0x38e6ae=_0xf906cf?bufferSha256(_0xf906cf):_0x5b383c?.['manifest'][_0x1214ce(0x1f5)],_0x4fdab0=_0xf906cf?.[_0x1214ce(0x1e3)]??_0x5b383c?.[_0x1214ce(0x205)][_0x1214ce(0x1ed)],_0x50f64b=_0x20d53f[_0x1214ce(0x1e3)]>0x0?Object['fromEntries'](_0x20d53f[_0x1214ce(0x1fb)](_0x3acd1d=>[_0x3acd1d[_0x1214ce(0x1f8)],fileHash(_0x3acd1d)])):undefined;return{'schemaVersion':_0x20d53f['length']>0x0?0x2:0x1,'id':_0x2e9502['id'],'appCode':_0x56f89f,'skillCode':requireSkillCode(_0x2e9502),'skillName':_0x2e9502[_0x1214ce(0x204)],'description':_0x2e9502[_0x1214ce(0x1ec)],'example':_0x2e9502['example'],'scope':_0x7345ba,'readonly':_0x7345ba!==_0x1214ce(0x1e7)||_0x2e9502[_0x1214ce(0x1e1)]===!![],'tenantCode':_0x2e9502[_0x1214ce(0x1f6)],'userId':_0x2e9502[_0x1214ce(0x1f4)],'version':_0x2e9502[_0x1214ce(0x1ef)],'status':_0x2e9502[_0x1214ce(0x1f7)],'tags':Array['isArray'](_0x2e9502[_0x1214ce(0x201)])?_0x2e9502['tags']:[],'hasUpstreamUpdate':_0x2e9502['hasUpstreamUpdate'],'forkedFromSkillId':_0x2e9502[_0x1214ce(0x1f1)],'forkedFromVersion':_0x2e9502[_0x1214ce(0x200)],'sourceSessionId':_0x2e9502[_0x1214ce(0x202)],'contentHash':_0x45eb88,'fileHashes':_0x50f64b,'treeHash':_0x20d53f['length']>0x0?fileTreeHash(localFilesToManifestFiles(_0x20d53f)):undefined,'ossPath':remoteManifestOssPath(_0x2e9502[_0x1214ce(0x1fe)]),'zipSha256':_0x38e6ae,'zipSize':_0x4fdab0,'files':_0x20d53f[_0x1214ce(0x1e3)]>0x0?_0x20d53f[_0x1214ce(0x1fb)](_0x169866=>({'path':_0x169866['path'],'hash':fileHash(_0x169866),'size':fileContent(_0x169866)[_0x1214ce(0x1e3)]})):undefined,'pulledAt':_0x5cee47??new Date()[_0x1214ce(0x1e5)]()};}export function requireSkillCode(_0x44754f){const _0x136ae0=a146_0x2a1f,_0x1fe44a=_0x44754f[_0x136ae0(0x203)]?.[_0x136ae0(0x1ff)]();if(!_0x1fe44a)throw CliErrors[_0x136ae0(0x1fa)]('Runtime\x20Skill\x20is\x20missing\x20skillCode.');return _0x1fe44a;}function a146_0x2a1f(_0x467dcd,_0x393c33){_0x467dcd=_0x467dcd-0x1e0;const _0x16dfeb=a146_0x16df();let _0x2a1f30=_0x16dfeb[_0x467dcd];return _0x2a1f30;}export function readMetadataIfPresent(_0x3fd27f){const _0x1715e4=a146_0x2a1f;if(!existsSync(_0x3fd27f))return undefined;try{const _0x3f7a97=JSON[_0x1715e4(0x1fc)](readFileSync(_0x3fd27f,_0x1715e4(0x1e4)));return _0x3f7a97;}catch{throw CliErrors[_0x1715e4(0x1fa)]('Invalid\x20'+METADATA_FILE+':\x20'+_0x3fd27f);}}function remoteManifestOssPath(_0x401739){const _0x34882b=a146_0x2a1f;if(!_0x401739||typeof _0x401739!==_0x34882b(0x1eb)||Array[_0x34882b(0x207)](_0x401739))return undefined;const _0x367877=_0x401739[_0x34882b(0x1f3)];return typeof _0x367877==='string'&&_0x367877['trim']()?_0x367877['trim']():undefined;}
1
+ function a146_0xf439(_0x1e5a43,_0x23990d){_0x1e5a43=_0x1e5a43-0x106;const _0x478ad4=a146_0x478a();let _0xf4399a=_0x478ad4[_0x1e5a43];return _0xf4399a;}(function(_0x253ca5,_0x4aebad){const _0x10f6a2=a146_0xf439,_0x1bbca9=_0x253ca5();while(!![]){try{const _0x166ff7=-parseInt(_0x10f6a2(0x109))/0x1+-parseInt(_0x10f6a2(0x120))/0x2+-parseInt(_0x10f6a2(0x11a))/0x3*(parseInt(_0x10f6a2(0x10f))/0x4)+-parseInt(_0x10f6a2(0x11c))/0x5+parseInt(_0x10f6a2(0x11d))/0x6+parseInt(_0x10f6a2(0x10c))/0x7+parseInt(_0x10f6a2(0x108))/0x8;if(_0x166ff7===_0x4aebad)break;else _0x1bbca9['push'](_0x1bbca9['shift']());}catch(_0x46361c){_0x1bbca9['push'](_0x1bbca9['shift']());}}}(a146_0x478a,0xb76c7));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(_0x58c43a,_0x40342b,_0x5c763d,_0x118a81,_0x3fbf55,_0x511409,_0xfd1cde){const _0x266ec3=a146_0xf439,_0x282a4f=_0x511409?normalizeLocalFiles(_0x511409):[],_0x2a2f72=!_0xfd1cde&&_0x282a4f[_0x266ec3(0x121)]>0x0?buildSkillPackage(_0x282a4f):undefined,_0x2947f6=_0xfd1cde?bufferSha256(_0xfd1cde):_0x2a2f72?.[_0x266ec3(0x11b)][_0x266ec3(0x111)],_0x3a18ae=_0xfd1cde?.['length']??_0x2a2f72?.[_0x266ec3(0x11b)][_0x266ec3(0x11e)],_0x126762=_0x282a4f['length']>0x0?Object[_0x266ec3(0x112)](_0x282a4f[_0x266ec3(0x10e)](_0x1160f9=>[_0x1160f9[_0x266ec3(0x115)],fileHash(_0x1160f9)])):undefined;return{'schemaVersion':_0x282a4f[_0x266ec3(0x121)]>0x0?0x2:0x1,'id':_0x58c43a['id'],'appCode':_0x5c763d,'skillCode':requireSkillCode(_0x58c43a),'skillName':_0x58c43a['skillName'],'description':_0x58c43a['description'],'example':_0x58c43a['example'],'scope':_0x40342b,'readonly':_0x40342b!==_0x266ec3(0x110)||_0x58c43a[_0x266ec3(0x122)]===!![],'tenantCode':_0x58c43a[_0x266ec3(0x116)],'userId':_0x58c43a[_0x266ec3(0x125)],'version':_0x58c43a[_0x266ec3(0x106)],'status':_0x58c43a['status'],'tags':Array[_0x266ec3(0x119)](_0x58c43a[_0x266ec3(0x114)])?_0x58c43a[_0x266ec3(0x114)]:[],'hasUpstreamUpdate':_0x58c43a['hasUpstreamUpdate'],'forkedFromSkillId':_0x58c43a['forkedFromSkillId'],'forkedFromVersion':_0x58c43a[_0x266ec3(0x118)],'sourceSessionId':_0x58c43a['sourceSessionId'],'contentHash':_0x118a81,'fileHashes':_0x126762,'treeHash':_0x282a4f[_0x266ec3(0x121)]>0x0?fileTreeHash(localFilesToManifestFiles(_0x282a4f)):undefined,'ossPath':remoteManifestOssPath(_0x58c43a[_0x266ec3(0x10b)]),'zipSha256':_0x2947f6,'zipSize':_0x3a18ae,'files':_0x282a4f[_0x266ec3(0x121)]>0x0?_0x282a4f[_0x266ec3(0x10e)](_0x25bec4=>({'path':_0x25bec4[_0x266ec3(0x115)],'hash':fileHash(_0x25bec4),'size':fileContent(_0x25bec4)[_0x266ec3(0x121)]})):undefined,'pulledAt':_0x3fbf55??new Date()['toISOString']()};}export function requireSkillCode(_0x531d71){const _0x468e68=a146_0xf439,_0xa25071=_0x531d71[_0x468e68(0x123)]?.[_0x468e68(0x107)]();if(!_0xa25071)throw CliErrors[_0x468e68(0x113)](_0x468e68(0x10a));return _0xa25071;}export function readMetadataIfPresent(_0x3266b7){const _0x503a4a=a146_0xf439;if(!existsSync(_0x3266b7))return undefined;try{const _0x5cd3db=JSON[_0x503a4a(0x10d)](readFileSync(_0x3266b7,_0x503a4a(0x117)));return _0x5cd3db;}catch{throw CliErrors[_0x503a4a(0x113)]('Invalid\x20'+METADATA_FILE+':\x20'+_0x3266b7);}}function remoteManifestOssPath(_0x601ac5){const _0x28d3e1=a146_0xf439;if(!_0x601ac5||typeof _0x601ac5!==_0x28d3e1(0x124)||Array[_0x28d3e1(0x119)](_0x601ac5))return undefined;const _0x19c517=_0x601ac5['ossPath'];return typeof _0x19c517===_0x28d3e1(0x11f)&&_0x19c517['trim']()?_0x19c517[_0x28d3e1(0x107)]():undefined;}function a146_0x478a(){const _0x1bef64=['tags','path','tenantCode','utf8','forkedFromVersion','isArray','3eqOMVJ','manifest','5245215KASaPn','8906154QIMYRq','zipSize','string','241478OtcpuD','length','readonly','skillCode','object','userId','version','trim','16120504juQnqC','1238106tsVCjQ','Runtime\x20Skill\x20is\x20missing\x20skillCode.','files','4005064UhjXiT','parse','map','3649532Ivvdhd','personal','zipSha256','fromEntries','validation'];a146_0x478a=function(){return _0x1bef64;};return a146_0x478a();}
@@ -1 +1 @@
1
- const a147_0x315409=a147_0x102d;(function(_0xd687c8,_0x427e74){const _0x2bed4e=a147_0x102d,_0x581c80=_0xd687c8();while(!![]){try{const _0x306bef=parseInt(_0x2bed4e(0x1cb))/0x1+parseInt(_0x2bed4e(0x1e2))/0x2*(-parseInt(_0x2bed4e(0x1c9))/0x3)+parseInt(_0x2bed4e(0x1e1))/0x4+parseInt(_0x2bed4e(0x1d0))/0x5*(parseInt(_0x2bed4e(0x1d9))/0x6)+-parseInt(_0x2bed4e(0x1d5))/0x7+parseInt(_0x2bed4e(0x1dc))/0x8*(parseInt(_0x2bed4e(0x1d3))/0x9)+-parseInt(_0x2bed4e(0x1ce))/0xa*(parseInt(_0x2bed4e(0x1c8))/0xb);if(_0x306bef===_0x427e74)break;else _0x581c80['push'](_0x581c80['shift']());}catch(_0x106e4a){_0x581c80['push'](_0x581c80['shift']());}}}(a147_0x2664,0x7e66c));import{existsSync}from'node:fs';import{homedir}from'node:os';import{resolve}from'node:path';function a147_0x102d(_0x2d336a,_0x153b64){_0x2d336a=_0x2d336a-0x1c6;const _0x2664c7=a147_0x2664();let _0x102da7=_0x2664c7[_0x2d336a];return _0x102da7;}import{fingerprintAccessKey}from'../../commands/app/cache.js';function a147_0x2664(){const _0x104bde=['11BKFaYl','132aBImjt','validation','663860xhyCSB','path\x20segment','Unsafe\x20','15623470meFQDK','cache','30795AQXuSA','.workbuddy','homeDirName','549FsXanZ','.claude','4292155mytLko','\x20for\x20local\x20path:\x20','skills','.agents','642FjPWqh','appCode','filter','74936VePKSq','homeDir','trim','skillCode','includes','3502032HlPcAU','3478LIMVzY','agentsSkillsDir','workbuddySkillsDir','claudeSkillsDir'];a147_0x2664=function(){return _0x104bde;};return a147_0x2664();}import{PRODUCT_CONFIG,productEnv}from'../../constant/product.js';import{CliErrors}from'../../errors.js';export function resolveSkillSyncPaths(_0xc10eec={}){const _0x46cd1a=a147_0x102d,_0x58cc3=_0xc10eec[_0x46cd1a(0x1dd)]??homedir(),_0x171990=resolve(_0x58cc3,PRODUCT_CONFIG[_0x46cd1a(0x1d2)],_0x46cd1a(0x1cf)),_0x5d76ef=trimmedEnv('SKILL_ROOT'),_0x411947=trimmedEnv('CLAUDE_SKILL_ROOT'),_0x3d7451=resolve(_0x58cc3,_0x46cd1a(0x1d1)),_0x1d9494=_0xc10eec[_0x46cd1a(0x1c6)]??(existsSync(_0x3d7451)?resolve(_0x3d7451,'skills'):undefined);return{'homeDir':_0x58cc3,'cacheRoot':_0x171990,'managedRoot':resolve(_0x58cc3,PRODUCT_CONFIG[_0x46cd1a(0x1d2)]),'agentsSkillsDir':_0xc10eec[_0x46cd1a(0x1e3)]??_0x5d76ef??resolve(_0x58cc3,_0x46cd1a(0x1d8),'skills'),'claudeSkillsDir':_0xc10eec[_0x46cd1a(0x1c7)]??_0x411947??resolve(_0x58cc3,_0x46cd1a(0x1d4),_0x46cd1a(0x1d7)),'workbuddySkillsDir':_0x1d9494};}export function runtimeAgentSkillRoots(_0x2aa2b8){const _0x512007=a147_0x102d;return[_0x2aa2b8['agentsSkillsDir'],_0x2aa2b8[_0x512007(0x1c7)],_0x2aa2b8['workbuddySkillsDir']][_0x512007(0x1db)](_0x591aec=>Boolean(_0x591aec));}export function getRuntimeSkillCacheRoot(_0x4c4a9a,_0x1c382b,_0x1ee9b4={}){const _0x5427d0=a147_0x102d,_0x5ef3c2=resolveSkillSyncPaths(_0x1ee9b4);return resolve(_0x5ef3c2['cacheRoot'],_0x4c4a9a,fingerprintAccessKey(_0x1c382b),_0x5427d0(0x1d7));}export function getRuntimeSkillDir(_0x89f7db,_0x269171,_0x20fb54,_0x4adb00,_0x4eda8c,_0x169285={}){const _0x31f880=a147_0x102d;return resolve(getRuntimeSkillCacheRoot(_0x89f7db,_0x269171,_0x169285),safePathSegment(_0x20fb54,_0x31f880(0x1da)),_0x4adb00,safePathSegment(_0x4eda8c,_0x31f880(0x1df)));}export function safePathSegment(_0x24c2bc,_0x521e7f=a147_0x315409(0x1cc)){const _0x2c4176=a147_0x315409;if(!_0x24c2bc||_0x24c2bc[_0x2c4176(0x1e0)]('/')||_0x24c2bc[_0x2c4176(0x1e0)]('\x5c')||_0x24c2bc[_0x2c4176(0x1e0)]('..'))throw CliErrors[_0x2c4176(0x1ca)](_0x2c4176(0x1cd)+_0x521e7f+_0x2c4176(0x1d6)+_0x24c2bc);return _0x24c2bc;}function trimmedEnv(_0x55cf92){const _0x464f71=a147_0x315409,_0x140b20=productEnv(_0x55cf92)?.[_0x464f71(0x1de)]();return _0x140b20?_0x140b20:undefined;}
1
+ const a147_0x3972b4=a147_0x2569;(function(_0x533924,_0x4686d3){const _0x18d2bf=a147_0x2569,_0x49c90f=_0x533924();while(!![]){try{const _0x5b376b=-parseInt(_0x18d2bf(0x149))/0x1*(-parseInt(_0x18d2bf(0x13e))/0x2)+-parseInt(_0x18d2bf(0x135))/0x3*(parseInt(_0x18d2bf(0x14a))/0x4)+parseInt(_0x18d2bf(0x12f))/0x5+-parseInt(_0x18d2bf(0x12d))/0x6*(parseInt(_0x18d2bf(0x142))/0x7)+parseInt(_0x18d2bf(0x130))/0x8*(-parseInt(_0x18d2bf(0x132))/0x9)+parseInt(_0x18d2bf(0x13d))/0xa+-parseInt(_0x18d2bf(0x134))/0xb*(-parseInt(_0x18d2bf(0x13c))/0xc);if(_0x5b376b===_0x4686d3)break;else _0x49c90f['push'](_0x49c90f['shift']());}catch(_0x356027){_0x49c90f['push'](_0x49c90f['shift']());}}}(a147_0x11aa,0x4ad7b));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(_0x28ee46={}){const _0x49bc98=a147_0x2569,_0x51bce4=_0x28ee46[_0x49bc98(0x144)]??homedir(),_0x547b86=resolve(_0x51bce4,PRODUCT_CONFIG[_0x49bc98(0x143)],_0x49bc98(0x146)),_0x4b786e=trimmedEnv('SKILL_ROOT'),_0x1b0b69=trimmedEnv(_0x49bc98(0x140)),_0xcd3326=resolve(_0x51bce4,'.workbuddy'),_0x12d2c6=_0x28ee46[_0x49bc98(0x145)]??(existsSync(_0xcd3326)?resolve(_0xcd3326,_0x49bc98(0x13a)):undefined);return{'homeDir':_0x51bce4,'cacheRoot':_0x547b86,'managedRoot':resolve(_0x51bce4,PRODUCT_CONFIG[_0x49bc98(0x143)]),'agentsSkillsDir':_0x28ee46['agentsSkillsDir']??_0x4b786e??resolve(_0x51bce4,_0x49bc98(0x13f),_0x49bc98(0x13a)),'claudeSkillsDir':_0x28ee46[_0x49bc98(0x138)]??_0x1b0b69??resolve(_0x51bce4,_0x49bc98(0x13b),_0x49bc98(0x13a)),'workbuddySkillsDir':_0x12d2c6};}export function runtimeAgentSkillRoots(_0x5da661){const _0x1c914d=a147_0x2569;return[_0x5da661[_0x1c914d(0x12e)],_0x5da661['claudeSkillsDir'],_0x5da661['workbuddySkillsDir']][_0x1c914d(0x147)](_0x4b4f46=>Boolean(_0x4b4f46));}export function getRuntimeSkillCacheRoot(_0x3cc709,_0x47c6cc,_0x4a41fc={}){const _0x34212e=a147_0x2569,_0x2bc7f4=resolveSkillSyncPaths(_0x4a41fc);return resolve(_0x2bc7f4['cacheRoot'],_0x3cc709,fingerprintAccessKey(_0x47c6cc),_0x34212e(0x13a));}export function getRuntimeSkillDir(_0x269c06,_0x5b7360,_0x21b355,_0x3e1cca,_0xe5e254,_0x2d7889={}){const _0x268fa6=a147_0x2569;return resolve(getRuntimeSkillCacheRoot(_0x269c06,_0x5b7360,_0x2d7889),safePathSegment(_0x21b355,_0x268fa6(0x137)),_0x3e1cca,safePathSegment(_0xe5e254,_0x268fa6(0x141)));}export function safePathSegment(_0x335cb8,_0x156ca4=a147_0x3972b4(0x136)){const _0x1fdf41=a147_0x3972b4;if(!_0x335cb8||_0x335cb8[_0x1fdf41(0x14b)]('/')||_0x335cb8['includes']('\x5c')||_0x335cb8[_0x1fdf41(0x14b)]('..'))throw CliErrors[_0x1fdf41(0x133)](_0x1fdf41(0x139)+_0x156ca4+_0x1fdf41(0x131)+_0x335cb8);return _0x335cb8;}function a147_0x11aa(){const _0x4247bc=['579400JIuWlT','1335736vsFhtp','\x20for\x20local\x20path:\x20','27yPRfHt','validation','671429YIdziy','833133sijGwq','path\x20segment','appCode','claudeSkillsDir','Unsafe\x20','skills','.claude','264noERrf','2911100sBVeDb','42mXFWeN','.agents','CLAUDE_SKILL_ROOT','skillCode','21zRAtQl','homeDirName','homeDir','workbuddySkillsDir','cache','filter','trim','599rvYiAC','8QjBKBq','includes','799098ovYdzq','agentsSkillsDir'];a147_0x11aa=function(){return _0x4247bc;};return a147_0x11aa();}function a147_0x2569(_0x16893c,_0x39ea9f){_0x16893c=_0x16893c-0x12d;const _0x11aad7=a147_0x11aa();let _0x25699b=_0x11aad7[_0x16893c];return _0x25699b;}function trimmedEnv(_0xaaaf6a){const _0x597ba2=a147_0x3972b4,_0x1478fa=productEnv(_0xaaaf6a)?.[_0x597ba2(0x148)]();return _0x1478fa?_0x1478fa:undefined;}
@@ -1 +1 @@
1
- (function(_0x222a1d,_0x18b75a){const _0x147333=a148_0x28c7,_0x4cbd17=_0x222a1d();while(!![]){try{const _0x45d2c3=parseInt(_0x147333(0x8a))/0x1*(parseInt(_0x147333(0x9f))/0x2)+-parseInt(_0x147333(0xbf))/0x3*(-parseInt(_0x147333(0xb1))/0x4)+parseInt(_0x147333(0xab))/0x5*(-parseInt(_0x147333(0xb8))/0x6)+parseInt(_0x147333(0xa1))/0x7*(-parseInt(_0x147333(0xc3))/0x8)+parseInt(_0x147333(0xc1))/0x9+-parseInt(_0x147333(0x99))/0xa+parseInt(_0x147333(0x9e))/0xb;if(_0x45d2c3===_0x18b75a)break;else _0x4cbd17['push'](_0x4cbd17['shift']());}catch(_0x3dbdf5){_0x4cbd17['push'](_0x4cbd17['shift']());}}}(a148_0x4a3d,0x55059));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a148_0x361280}from'yaml';import{CliErrors}from'../../errors.js';function a148_0x28c7(_0x3730c0,_0x6a5ea0){_0x3730c0=_0x3730c0-0x87;const _0x4a3d63=a148_0x4a3d();let _0x28c7ae=_0x4a3d63[_0x3730c0];return _0x28c7ae;}import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{writeJsonAtomic}from'./fs-utils.js';function a148_0x4a3d(){const _0x3d2ec7=['version','Remote\x20Skill\x20','allowAppCodeRetarget','appCode','3271301gmQBvA','16826rIQFep','ignoreMetadataSkillCode','2815526yWfRfA','replace','\x20name\x20for\x20SkillHub\x20slug\x20generation.','pushedAt','find','slice','Skill\x20directory\x20not\x20found:\x20','path','description','builtin','20pygnmE','unknown','ignoreMetadataForPayload','skillName','scope','metadata','1008060cjnUkl','displayName','isDirectory','isArray','ignoreMetadataAppCodeMismatch','\x20has\x20unsupported\x20scope\x20\x22','manifest','611934DJihfi','utf8','sourceSessionId','Missing\x20','refreshedAt','tags','\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22','3CjKMDk','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20','4595283MqflRc','skillCode','8DHdhBv','ignoreMetadataScope','some','\x20has\x20scope=\x22','trim','69mgFDwI','personal','ignoreInvalidMetadata','example','content','validation','files','number','company','Skill\x20metadata\x20appCode\x20\x22','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20','dir','isFile','excludedFilePaths','name','4820670XnAsij'];a148_0x4a3d=function(){return _0x3d2ec7;};return a148_0x4a3d();}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(_0x106966,_0x11caf7,_0x220121={}){const _0x387bbd=a148_0x28c7,_0x2067cf=resolvePushDirectoryRoot(_0x106966),_0xe0425f=readPushMetadataIfPresent(resolve(_0x2067cf,METADATA_FILE),{'ignoreInvalidMetadata':_0x220121[_0x387bbd(0x8c)]});if(_0xe0425f?.[_0x387bbd(0x9d)]&&_0xe0425f[_0x387bbd(0x9d)]!==_0x11caf7&&!_0x220121[_0x387bbd(0x9c)]&&!_0x220121[_0x387bbd(0xb5)])throw CliErrors['validation'](_0x387bbd(0x93)+_0xe0425f[_0x387bbd(0x9d)]+_0x387bbd(0xbe)+_0x11caf7+'\x22.');const _0x16a221=resolvePushSkillCode(_0x2067cf,_0x11caf7,_0xe0425f,_0x220121);if(!_0x16a221)throw CliErrors[_0x387bbd(0x8f)]('Unable\x20to\x20resolve\x20skillCode\x20from\x20'+SKILL_FILE+',\x20'+METADATA_FILE+',\x20or\x20directory\x20name.');return{'dir':_0x2067cf,'skillCode':_0x16a221,'metadata':_0xe0425f};}export function readPushDirectory(_0x5ae6b4,_0x3754c2,_0x446ca0={}){const _0x57df75=a148_0x28c7,_0x5def0c=resolvePushDirectoryIdentity(_0x5ae6b4,_0x3754c2,_0x446ca0),_0x26fac8=_0x5def0c[_0x57df75(0x95)],_0x59b792=resolve(_0x26fac8,SKILL_FILE);if(!existsSync(_0x59b792)||!lstatSync(_0x59b792)[_0x57df75(0x96)]())throw CliErrors[_0x57df75(0x8f)](_0x57df75(0xbb)+SKILL_FILE+':\x20'+_0x59b792);const _0x4a5cd7=_0x5def0c[_0x57df75(0xb0)],_0xeda864=_0x446ca0['targetScope']??_0x57df75(0x8b);if(!_0x446ca0[_0x57df75(0xc4)]&&_0x4a5cd7?.[_0x57df75(0xaf)]===_0x57df75(0xaa))throw CliErrors[_0x57df75(0x8f)]('Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20'+METADATA_FILE+_0x57df75(0x88)+_0x4a5cd7[_0x57df75(0xaf)]+'\x22.');if(!_0x446ca0[_0x57df75(0xc4)]&&_0xeda864===_0x57df75(0x8b)&&_0x4a5cd7?.['scope']&&_0x4a5cd7[_0x57df75(0xaf)]!==_0x57df75(0x8b))throw CliErrors[_0x57df75(0x8f)](_0x57df75(0x94)+METADATA_FILE+'\x20has\x20scope=\x22'+_0x4a5cd7[_0x57df75(0xaf)]+'\x22.',_0x57df75(0xc0)+_0x26fac8+'\x20to\x20submit\x20company\x20Skills\x20for\x20review.');const _0x4eb4d0=scanSkillDirectory(_0x26fac8,{'excludedFilePaths':_0x446ca0[_0x57df75(0x97)]}),_0x80434a=buildSkillPackage(_0x4eb4d0),_0x390426=readFileSync(_0x59b792,_0x57df75(0xb9)),_0x1bb2c0=_0x5def0c['skillCode'],_0x1bd90c=_0x446ca0[_0x57df75(0xad)]?undefined:_0x4a5cd7,_0x34846c=readSkillDisplayName(_0x390426);return{'skillCode':_0x1bb2c0,'metadata':_0x4a5cd7,'frontmatterDisplayName':_0x34846c,'input':{'skillCode':_0x1bb2c0,'skillName':_0x34846c??_0x1bd90c?.[_0x57df75(0xae)],'description':_0x1bd90c?.[_0x57df75(0xa9)],'content':_0x390426,'files':_0x80434a[_0x57df75(0xb7)],'packageBase64':_0x80434a['packageBase64'],'tags':_0x1bd90c?.['tags'],'version':_0x1bd90c?.[_0x57df75(0x9a)],'sourceSessionId':_0x1bd90c?.[_0x57df75(0xba)]}};}export function refreshPushDirectoryMetadataFromRemote(_0x58f235,_0x339a0a,_0x3eec95,_0x3316e9={}){const _0x2147c5=a148_0x28c7,_0x1a7989=resolvePushDirectoryRoot(_0x58f235),_0x5e11df=readPushMetadataIfPresent(resolve(_0x1a7989,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x221eed=requireRemoteScope(_0x339a0a),_0x16621d=readLocalSkillContent(_0x1a7989),_0x1497c0={..._0x339a0a,'appCode':_0x339a0a[_0x2147c5(0x9d)]??_0x3eec95,'skillName':_0x339a0a[_0x2147c5(0xae)]??_0x5e11df?.[_0x2147c5(0xae)],'description':_0x339a0a['description']??_0x5e11df?.['description'],'example':_0x339a0a[_0x2147c5(0x8d)]??_0x5e11df?.['example'],'tags':Array[_0x2147c5(0xb4)](_0x339a0a[_0x2147c5(0xbd)])?_0x339a0a['tags']:_0x5e11df?.[_0x2147c5(0xbd)],'sourceSessionId':_0x339a0a[_0x2147c5(0xba)]??_0x5e11df?.[_0x2147c5(0xba)],'content':_0x339a0a['content']??_0x16621d},_0x194bed=buildMetadata(_0x1497c0,_0x221eed,_0x3eec95,contentHash(_0x16621d),_0x3316e9[_0x2147c5(0xbc)]);writeJsonAtomic(resolve(_0x1a7989,METADATA_FILE),_0x194bed);}export function recordPushedRuntimeSkill(_0x41b43e,_0x2291fc,_0x52a1a8,_0x1c389f={}){const _0x1ada55=a148_0x28c7,_0x4a1ead=resolvePushDirectoryRoot(_0x41b43e),_0x410942=scanSkillDirectory(_0x4a1ead),_0x54d8eb=_0x410942[_0x1ada55(0xa5)](_0x497d52=>_0x497d52[_0x1ada55(0xa8)]===SKILL_FILE),_0x13c256=_0x54d8eb?fileText(_0x54d8eb):'',_0xe29271=tryNormalizePackageManifest(_0x2291fc[_0x1ada55(0x90)]),_0x2b22f2={..._0x2291fc,'content':_0x2291fc[_0x1ada55(0x8e)]??_0x13c256,'files':_0xe29271},_0x453978=_0xe29271?normalizeLocalFiles(_0x410942)['filter'](_0x68a9a1=>_0xe29271['files'][_0x1ada55(0x87)](_0x45477c=>_0x45477c[_0x1ada55(0xa8)]===_0x68a9a1['path'])):undefined,_0x3527e8=buildMetadata(_0x2b22f2,_0x1c389f[_0x1ada55(0xaf)]??_0x1ada55(0x8b),_0x52a1a8,contentHash(_0x2b22f2['content']??''),_0x1c389f[_0x1ada55(0xa4)],_0x453978);writeJsonAtomic(resolve(_0x4a1ead,METADATA_FILE),_0x3527e8);}export function deriveSkillCodeFromDirectory(_0x1d3696,_0x4cb926){const _0x28a31d=a148_0x28c7,_0x301927=basename(resolve(_0x1d3696)),_0x2aa0ba=_0x4cb926+'--';return _0x301927['startsWith'](_0x2aa0ba)?_0x301927[_0x28a31d(0xa6)](_0x2aa0ba['length']):_0x301927;}function resolvePushSkillCode(_0x463dec,_0x43e9ff,_0x6523c6,_0x2629ee){const _0x58e1a8=a148_0x28c7,_0x16ae8c=deriveSkillCodeFromSkillFile(_0x463dec)||deriveSkillCodeFromDirectory(_0x463dec,_0x43e9ff);if(_0x2629ee[_0x58e1a8(0xa0)])return _0x16ae8c;return _0x6523c6?.[_0x58e1a8(0xc2)]?.[_0x58e1a8(0x89)]()||_0x16ae8c;}function deriveSkillCodeFromSkillFile(_0x909e07){const _0x4f69cd=a148_0x28c7,_0x454a96=resolve(_0x909e07,SKILL_FILE);if(!existsSync(_0x454a96)||!lstatSync(_0x454a96)['isFile']())return undefined;const _0x37bd20=readFileSync(_0x454a96,_0x4f69cd(0xb9)),_0x324832=_0x37bd20['match'](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x324832)return undefined;const _0x43af18=parseFrontmatterObject(_0x324832[0x1]??''),_0x2fee11=scalarToString(_0x43af18?.[_0x4f69cd(0x98)]);return _0x2fee11?slugifySkillName(_0x2fee11):undefined;}function readSkillDisplayName(_0x271d52){const _0x67d5e5=a148_0x28c7,_0x76d1e7=_0x271d52['match'](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x76d1e7)return undefined;const _0x142f15=parseFrontmatterObject(_0x76d1e7[0x1]??'');return scalarToString(_0x142f15?.[_0x67d5e5(0xb2)]);}function slugifySkillName(_0x4668fa){const _0x1a7092=a148_0x28c7,_0x11921f=_0x4668fa[_0x1a7092(0x89)]()['toLowerCase']()[_0x1a7092(0xa2)](/[^\p{L}\p{N}\p{So}]+/gu,'-')[_0x1a7092(0xa2)](/^-+/,'')[_0x1a7092(0xa2)](/-+$/,'')[_0x1a7092(0xa2)](/-{2,}/g,'-');if(!_0x11921f)throw CliErrors[_0x1a7092(0x8f)]('Invalid\x20'+SKILL_FILE+_0x1a7092(0xa3));return _0x11921f;}function parseFrontmatterObject(_0x5f4860){try{const _0x417242=a148_0x361280(_0x5f4860);return _0x417242&&typeof _0x417242==='object'&&!Array['isArray'](_0x417242)?_0x417242:undefined;}catch{return undefined;}}function scalarToString(_0x5bc232){const _0x4ce689=a148_0x28c7;if(typeof _0x5bc232==='string')return _0x5bc232[_0x4ce689(0x89)]();if(typeof _0x5bc232===_0x4ce689(0x91)||typeof _0x5bc232==='boolean')return String(_0x5bc232);return undefined;}function resolvePushDirectoryRoot(_0x391969){const _0x576973=a148_0x28c7,_0x2ab8d5=resolve(_0x391969);if(!existsSync(_0x2ab8d5))throw CliErrors[_0x576973(0x8f)](_0x576973(0xa7)+_0x391969);const _0x50849c=lstatSync(_0x2ab8d5);if(_0x50849c[_0x576973(0xb3)]())return _0x2ab8d5;if(_0x50849c['isSymbolicLink']()){const _0x5623bd=realpathSync(_0x2ab8d5);if(lstatSync(_0x5623bd)['isDirectory']())return _0x5623bd;}throw CliErrors[_0x576973(0x8f)](_0x576973(0xa7)+_0x391969);}function requireRemoteScope(_0x5873c1){const _0x2a4374=a148_0x28c7;if(_0x5873c1[_0x2a4374(0xaf)]===_0x2a4374(0x8b)||_0x5873c1[_0x2a4374(0xaf)]===_0x2a4374(0x92)||_0x5873c1[_0x2a4374(0xaf)]===_0x2a4374(0xaa))return _0x5873c1[_0x2a4374(0xaf)];throw CliErrors[_0x2a4374(0x8f)](_0x2a4374(0x9b)+(_0x5873c1[_0x2a4374(0xc2)]||'(unknown)')+_0x2a4374(0xb6)+(_0x5873c1[_0x2a4374(0xaf)]??_0x2a4374(0xac))+'\x22.');}function readLocalSkillContent(_0x143361){const _0x4580a0=a148_0x28c7,_0xa7991e=resolve(_0x143361,SKILL_FILE);return existsSync(_0xa7991e)&&lstatSync(_0xa7991e)['isFile']()?readFileSync(_0xa7991e,_0x4580a0(0xb9)):'';}function readPushMetadataIfPresent(_0x2094f4,_0x537c2d={}){const _0x300cbb=a148_0x28c7;try{return readMetadataIfPresent(_0x2094f4);}catch(_0x5324c3){if(_0x537c2d[_0x300cbb(0x8c)])return undefined;throw _0x5324c3;}}
1
+ (function(_0x115a9c,_0x2a7be1){const _0x4e975d=a148_0x118c,_0x295ef4=_0x115a9c();while(!![]){try{const _0x58053c=parseInt(_0x4e975d(0x102))/0x1+-parseInt(_0x4e975d(0xff))/0x2+-parseInt(_0x4e975d(0x11f))/0x3*(-parseInt(_0x4e975d(0x135))/0x4)+parseInt(_0x4e975d(0x13f))/0x5+-parseInt(_0x4e975d(0x120))/0x6*(-parseInt(_0x4e975d(0x126))/0x7)+parseInt(_0x4e975d(0x122))/0x8*(parseInt(_0x4e975d(0x13d))/0x9)+parseInt(_0x4e975d(0x13b))/0xa*(-parseInt(_0x4e975d(0x128))/0xb);if(_0x58053c===_0x2a7be1)break;else _0x295ef4['push'](_0x295ef4['shift']());}catch(_0x4fa90d){_0x295ef4['push'](_0x295ef4['shift']());}}}(a148_0x29c3,0x3e8fd));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a148_0x46d59d}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(_0x4cf804,_0x516acf,_0x1ea4ea={}){const _0x26bf5f=a148_0x118c,_0x344fb4=resolvePushDirectoryRoot(_0x4cf804),_0x11e77a=readPushMetadataIfPresent(resolve(_0x344fb4,METADATA_FILE),{'ignoreInvalidMetadata':_0x1ea4ea['ignoreInvalidMetadata']});if(_0x11e77a?.[_0x26bf5f(0x101)]&&_0x11e77a[_0x26bf5f(0x101)]!==_0x516acf&&!_0x1ea4ea['allowAppCodeRetarget']&&!_0x1ea4ea[_0x26bf5f(0x116)])throw CliErrors[_0x26bf5f(0x132)](_0x26bf5f(0x140)+_0x11e77a[_0x26bf5f(0x101)]+_0x26bf5f(0x103)+_0x516acf+'\x22.');const _0x49c8c9=resolvePushSkillCode(_0x344fb4,_0x516acf,_0x11e77a,_0x1ea4ea);if(!_0x49c8c9)throw CliErrors[_0x26bf5f(0x132)](_0x26bf5f(0x136)+SKILL_FILE+',\x20'+METADATA_FILE+_0x26bf5f(0x10f));return{'dir':_0x344fb4,'skillCode':_0x49c8c9,'metadata':_0x11e77a};}export function readPushDirectory(_0x45a80a,_0x120d2b,_0x1c079b={}){const _0x563628=a148_0x118c,_0x4d2bff=resolvePushDirectoryIdentity(_0x45a80a,_0x120d2b,_0x1c079b),_0xa39486=_0x4d2bff[_0x563628(0x13a)],_0x32e6bc=resolve(_0xa39486,SKILL_FILE);if(!existsSync(_0x32e6bc)||!lstatSync(_0x32e6bc)[_0x563628(0x12a)]())throw CliErrors['validation'](_0x563628(0x10d)+SKILL_FILE+':\x20'+_0x32e6bc);const _0x5224bd=_0x4d2bff['metadata'],_0x3825a7=_0x1c079b[_0x563628(0x11e)]??_0x563628(0x12c);if(!_0x1c079b[_0x563628(0x105)]&&_0x5224bd?.[_0x563628(0x104)]==='builtin')throw CliErrors['validation'](_0x563628(0x121)+METADATA_FILE+_0x563628(0x137)+_0x5224bd[_0x563628(0x104)]+'\x22.');if(!_0x1c079b[_0x563628(0x105)]&&_0x3825a7===_0x563628(0x12c)&&_0x5224bd?.[_0x563628(0x104)]&&_0x5224bd[_0x563628(0x104)]!==_0x563628(0x12c))throw CliErrors[_0x563628(0x132)](_0x563628(0x118)+METADATA_FILE+_0x563628(0x137)+_0x5224bd[_0x563628(0x104)]+'\x22.',_0x563628(0x10a)+_0xa39486+_0x563628(0x115));const _0x4b6a30=scanSkillDirectory(_0xa39486,{'excludedFilePaths':_0x1c079b[_0x563628(0x134)]}),_0x47aa24=buildSkillPackage(_0x4b6a30),_0x4bc213=readFileSync(_0x32e6bc,_0x563628(0x127)),_0x2b9bbd=_0x4d2bff[_0x563628(0x109)],_0x49c385=_0x1c079b[_0x563628(0x10e)]?undefined:_0x5224bd,_0x2e678e=readSkillDisplayName(_0x4bc213);return{'skillCode':_0x2b9bbd,'metadata':_0x5224bd,'frontmatterDisplayName':_0x2e678e,'input':{'skillCode':_0x2b9bbd,'skillName':_0x2e678e??_0x49c385?.[_0x563628(0x114)],'description':_0x49c385?.[_0x563628(0x138)],'content':_0x4bc213,'files':_0x47aa24[_0x563628(0x123)],'packageBase64':_0x47aa24[_0x563628(0x110)],'tags':_0x49c385?.['tags'],'version':_0x49c385?.[_0x563628(0x139)],'sourceSessionId':_0x49c385?.[_0x563628(0xfe)]}};}export function refreshPushDirectoryMetadataFromRemote(_0xd3e3dd,_0x443060,_0x49b090,_0x201a85={}){const _0x2f5abe=a148_0x118c,_0x3206af=resolvePushDirectoryRoot(_0xd3e3dd),_0xd83caa=readPushMetadataIfPresent(resolve(_0x3206af,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0xe3116c=requireRemoteScope(_0x443060),_0x1c2a96=readLocalSkillContent(_0x3206af),_0x525cd9={..._0x443060,'appCode':_0x443060[_0x2f5abe(0x101)]??_0x49b090,'skillName':_0x443060['skillName']??_0xd83caa?.[_0x2f5abe(0x114)],'description':_0x443060[_0x2f5abe(0x138)]??_0xd83caa?.[_0x2f5abe(0x138)],'example':_0x443060[_0x2f5abe(0x12d)]??_0xd83caa?.['example'],'tags':Array[_0x2f5abe(0x100)](_0x443060[_0x2f5abe(0x133)])?_0x443060['tags']:_0xd83caa?.[_0x2f5abe(0x133)],'sourceSessionId':_0x443060[_0x2f5abe(0xfe)]??_0xd83caa?.[_0x2f5abe(0xfe)],'content':_0x443060[_0x2f5abe(0x13e)]??_0x1c2a96},_0x30c9f3=buildMetadata(_0x525cd9,_0xe3116c,_0x49b090,contentHash(_0x1c2a96),_0x201a85[_0x2f5abe(0x11c)]);writeJsonAtomic(resolve(_0x3206af,METADATA_FILE),_0x30c9f3);}export function recordPushedRuntimeSkill(_0x8a0fa0,_0x369070,_0x269ffd,_0x4dd280={}){const _0x57d0ed=a148_0x118c,_0x1d48d3=resolvePushDirectoryRoot(_0x8a0fa0),_0x1d0aef=scanSkillDirectory(_0x1d48d3),_0xedd510=_0x1d0aef[_0x57d0ed(0xfd)](_0x1c261c=>_0x1c261c[_0x57d0ed(0x112)]===SKILL_FILE),_0x1b6d7f=_0xedd510?fileText(_0xedd510):'',_0x407393=tryNormalizePackageManifest(_0x369070[_0x57d0ed(0x124)]),_0x28f230={..._0x369070,'content':_0x369070[_0x57d0ed(0x13e)]??_0x1b6d7f,'files':_0x407393},_0x3cc1fe=_0x407393?normalizeLocalFiles(_0x1d0aef)['filter'](_0x25c53e=>_0x407393[_0x57d0ed(0x124)][_0x57d0ed(0x12b)](_0x34963b=>_0x34963b[_0x57d0ed(0x112)]===_0x25c53e['path'])):undefined,_0x1c2861=buildMetadata(_0x28f230,_0x4dd280[_0x57d0ed(0x104)]??'personal',_0x269ffd,contentHash(_0x28f230['content']??''),_0x4dd280[_0x57d0ed(0x12e)],_0x3cc1fe);writeJsonAtomic(resolve(_0x1d48d3,METADATA_FILE),_0x1c2861);}export function deriveSkillCodeFromDirectory(_0x4ef033,_0x3ad58c){const _0xfd7a27=a148_0x118c,_0x3b29cb=basename(resolve(_0x4ef033)),_0x50af08=_0x3ad58c+'--';return _0x3b29cb['startsWith'](_0x50af08)?_0x3b29cb[_0xfd7a27(0x12f)](_0x50af08[_0xfd7a27(0x125)]):_0x3b29cb;}function resolvePushSkillCode(_0x121ae1,_0x18eeb2,_0x3ddfd1,_0x718694){const _0x861ce1=a148_0x118c,_0x2ae9b7=deriveSkillCodeFromSkillFile(_0x121ae1)||deriveSkillCodeFromDirectory(_0x121ae1,_0x18eeb2);if(_0x718694['ignoreMetadataSkillCode'])return _0x2ae9b7;return _0x3ddfd1?.['skillCode']?.[_0x861ce1(0x11a)]()||_0x2ae9b7;}function a148_0x29c3(){const _0x2cf81d=['\x20has\x20unsupported\x20scope\x20\x22','name','validation','tags','excludedFilePaths','20VGAVIS','Unable\x20to\x20resolve\x20skillCode\x20from\x20','\x20has\x20scope=\x22','description','version','dir','10uFOXeR','displayName','9taJEzX','content','567165xczYEJ','Skill\x20metadata\x20appCode\x20\x22','find','sourceSessionId','716218LXZQIt','isArray','appCode','99336DWvGYD','\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22','scope','ignoreMetadataScope','replace','isDirectory','(unknown)','skillCode','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20','builtin','isSymbolicLink','Missing\x20','ignoreMetadataForPayload',',\x20or\x20directory\x20name.','packageBase64','\x20name\x20for\x20SkillHub\x20slug\x20generation.','path','string','skillName','\x20to\x20submit\x20company\x20Skills\x20for\x20review.','ignoreMetadataAppCodeMismatch','Skill\x20directory\x20not\x20found:\x20','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20','match','trim','toLowerCase','refreshedAt','ignoreInvalidMetadata','targetScope','268602peqCuO','120UIeMIp','Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20','3443816HQwsWO','manifest','files','length','777rHokOW','utf8','5266514MdcykP','object','isFile','some','personal','example','pushedAt','slice'];a148_0x29c3=function(){return _0x2cf81d;};return a148_0x29c3();}function deriveSkillCodeFromSkillFile(_0x24f528){const _0x24d851=a148_0x118c,_0x118687=resolve(_0x24f528,SKILL_FILE);if(!existsSync(_0x118687)||!lstatSync(_0x118687)['isFile']())return undefined;const _0x4be27f=readFileSync(_0x118687,'utf8'),_0x122fda=_0x4be27f[_0x24d851(0x119)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x122fda)return undefined;const _0x559bda=parseFrontmatterObject(_0x122fda[0x1]??''),_0x2d886e=scalarToString(_0x559bda?.[_0x24d851(0x131)]);return _0x2d886e?slugifySkillName(_0x2d886e):undefined;}function readSkillDisplayName(_0x45ca82){const _0xb01a05=a148_0x118c,_0x648b5a=_0x45ca82[_0xb01a05(0x119)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x648b5a)return undefined;const _0x1266fd=parseFrontmatterObject(_0x648b5a[0x1]??'');return scalarToString(_0x1266fd?.[_0xb01a05(0x13c)]);}function slugifySkillName(_0x1a83b9){const _0xa9d4a=a148_0x118c,_0xbd5f9e=_0x1a83b9[_0xa9d4a(0x11a)]()[_0xa9d4a(0x11b)]()[_0xa9d4a(0x106)](/[^\p{L}\p{N}\p{So}]+/gu,'-')[_0xa9d4a(0x106)](/^-+/,'')['replace'](/-+$/,'')['replace'](/-{2,}/g,'-');if(!_0xbd5f9e)throw CliErrors[_0xa9d4a(0x132)]('Invalid\x20'+SKILL_FILE+_0xa9d4a(0x111));return _0xbd5f9e;}function parseFrontmatterObject(_0x17ee8d){const _0x22b857=a148_0x118c;try{const _0x22e841=a148_0x46d59d(_0x17ee8d);return _0x22e841&&typeof _0x22e841===_0x22b857(0x129)&&!Array[_0x22b857(0x100)](_0x22e841)?_0x22e841:undefined;}catch{return undefined;}}function scalarToString(_0x55f4cf){const _0x861b95=a148_0x118c;if(typeof _0x55f4cf===_0x861b95(0x113))return _0x55f4cf[_0x861b95(0x11a)]();if(typeof _0x55f4cf==='number'||typeof _0x55f4cf==='boolean')return String(_0x55f4cf);return undefined;}function resolvePushDirectoryRoot(_0x15ad94){const _0x53b89b=a148_0x118c,_0x18493d=resolve(_0x15ad94);if(!existsSync(_0x18493d))throw CliErrors[_0x53b89b(0x132)](_0x53b89b(0x117)+_0x15ad94);const _0x5c7915=lstatSync(_0x18493d);if(_0x5c7915[_0x53b89b(0x107)]())return _0x18493d;if(_0x5c7915[_0x53b89b(0x10c)]()){const _0x19204=realpathSync(_0x18493d);if(lstatSync(_0x19204)[_0x53b89b(0x107)]())return _0x19204;}throw CliErrors[_0x53b89b(0x132)](_0x53b89b(0x117)+_0x15ad94);}function requireRemoteScope(_0x25637e){const _0x4000df=a148_0x118c;if(_0x25637e[_0x4000df(0x104)]===_0x4000df(0x12c)||_0x25637e[_0x4000df(0x104)]==='company'||_0x25637e[_0x4000df(0x104)]===_0x4000df(0x10b))return _0x25637e[_0x4000df(0x104)];throw CliErrors[_0x4000df(0x132)]('Remote\x20Skill\x20'+(_0x25637e[_0x4000df(0x109)]||_0x4000df(0x108))+_0x4000df(0x130)+(_0x25637e[_0x4000df(0x104)]??'unknown')+'\x22.');}function a148_0x118c(_0x65e665,_0xaedb56){_0x65e665=_0x65e665-0xfd;const _0x29c391=a148_0x29c3();let _0x118c66=_0x29c391[_0x65e665];return _0x118c66;}function readLocalSkillContent(_0x4cc313){const _0x2c6acf=a148_0x118c,_0x5e592e=resolve(_0x4cc313,SKILL_FILE);return existsSync(_0x5e592e)&&lstatSync(_0x5e592e)[_0x2c6acf(0x12a)]()?readFileSync(_0x5e592e,_0x2c6acf(0x127)):'';}function readPushMetadataIfPresent(_0x3cc482,_0x4512ff={}){const _0x580fc4=a148_0x118c;try{return readMetadataIfPresent(_0x3cc482);}catch(_0x224480){if(_0x4512ff[_0x580fc4(0x11d)])return undefined;throw _0x224480;}}
@@ -1 +1 @@
1
- function a149_0x35c5(_0x3c0687,_0x1e6995){_0x3c0687=_0x3c0687-0xa2;const _0x447bba=a149_0x447b();let _0x35c54d=_0x447bba[_0x3c0687];return _0x35c54d;}(function(_0x55336f,_0x2e6029){const _0x1a3197=a149_0x35c5,_0x101b35=_0x55336f();while(!![]){try{const _0x4569ec=parseInt(_0x1a3197(0xb1))/0x1+-parseInt(_0x1a3197(0xac))/0x2*(-parseInt(_0x1a3197(0xa4))/0x3)+-parseInt(_0x1a3197(0xaf))/0x4+-parseInt(_0x1a3197(0xb2))/0x5*(parseInt(_0x1a3197(0xa3))/0x6)+parseInt(_0x1a3197(0xa9))/0x7*(-parseInt(_0x1a3197(0xa2))/0x8)+parseInt(_0x1a3197(0xa7))/0x9+parseInt(_0x1a3197(0xab))/0xa*(parseInt(_0x1a3197(0xae))/0xb);if(_0x4569ec===_0x2e6029)break;else _0x101b35['push'](_0x101b35['shift']());}catch(_0x38f5dd){_0x101b35['push'](_0x101b35['shift']());}}}(a149_0x447b,0x9f82d));import{CliErrors}from'../../errors.js';export function normalizeRuntimeSkillScopes(_0x29ebaf){const _0x2904ca=a149_0x35c5,_0x319430=_0x29ebaf&&_0x29ebaf['length']>0x0?_0x29ebaf:[_0x2904ca(0xb0),_0x2904ca(0xa6),_0x2904ca(0xa5)],_0x52984a=[];for(const _0x2f9f6a of _0x319430){if(!isRuntimeSkillScope(_0x2f9f6a))throw CliErrors[_0x2904ca(0xaa)](_0x2904ca(0xa8)+_0x2f9f6a);!_0x52984a[_0x2904ca(0xad)](_0x2f9f6a)&&_0x52984a['push'](_0x2f9f6a);}return _0x52984a;}function a149_0x447b(){const _0x3fce27=['22gBipMJ','4366912wERUGT','personal','156852knTKKZ','1158785vNDTFF','48HrxvLL','6aMsnjk','402669JvqhqU','builtin','company','5084937kqQREu','Unsupported\x20runtime\x20Skill\x20scope:\x20','543900OqTbmv','validation','7934870KMunYI','2hxrMGK','includes'];a149_0x447b=function(){return _0x3fce27;};return a149_0x447b();}export function isRuntimeSkillScope(_0x7240f){const _0xc1fa8b=a149_0x35c5;return _0x7240f==='personal'||_0x7240f==='company'||_0x7240f===_0xc1fa8b(0xa5);}
1
+ function a149_0x67c6(){const _0x150b59=['includes','1701335LGWeMb','5149560yTeNTy','511741mKJXTB','validation','356022grqHIK','Unsupported\x20runtime\x20Skill\x20scope:\x20','company','7509qclyBS','1756930NWlURf','length','776RCFvBE','builtin','personal','2639730BvVcOZ'];a149_0x67c6=function(){return _0x150b59;};return a149_0x67c6();}(function(_0x4a18ee,_0x535cc0){const _0x2d43a0=a149_0x22c3,_0x194c87=_0x4a18ee();while(!![]){try{const _0x3aa6d0=parseInt(_0x2d43a0(0x148))/0x1+-parseInt(_0x2d43a0(0x14a))/0x2+-parseInt(_0x2d43a0(0x14d))/0x3*(-parseInt(_0x2d43a0(0x150))/0x4)+parseInt(_0x2d43a0(0x146))/0x5+-parseInt(_0x2d43a0(0x153))/0x6+parseInt(_0x2d43a0(0x14e))/0x7+-parseInt(_0x2d43a0(0x147))/0x8;if(_0x3aa6d0===_0x535cc0)break;else _0x194c87['push'](_0x194c87['shift']());}catch(_0x34a32f){_0x194c87['push'](_0x194c87['shift']());}}}(a149_0x67c6,0x4fd07));import{CliErrors}from'../../errors.js';export function normalizeRuntimeSkillScopes(_0x1fe5a1){const _0x3aa1be=a149_0x22c3,_0x1a9943=_0x1fe5a1&&_0x1fe5a1[_0x3aa1be(0x14f)]>0x0?_0x1fe5a1:[_0x3aa1be(0x152),_0x3aa1be(0x14c),_0x3aa1be(0x151)],_0x1a4fc6=[];for(const _0x58ac8f of _0x1a9943){if(!isRuntimeSkillScope(_0x58ac8f))throw CliErrors[_0x3aa1be(0x149)](_0x3aa1be(0x14b)+_0x58ac8f);!_0x1a4fc6[_0x3aa1be(0x154)](_0x58ac8f)&&_0x1a4fc6['push'](_0x58ac8f);}return _0x1a4fc6;}function a149_0x22c3(_0x11abb8,_0x73814){_0x11abb8=_0x11abb8-0x146;const _0x67c63d=a149_0x67c6();let _0x22c335=_0x67c63d[_0x11abb8];return _0x22c335;}export function isRuntimeSkillScope(_0x4c9d8){const _0x5cd92a=a149_0x22c3;return _0x4c9d8===_0x5cd92a(0x152)||_0x4c9d8==='company'||_0x4c9d8==='builtin';}