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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (177) hide show
  1. package/lib/cli.js +1 -1
  2. package/lib/commands/api-doc/index.js +1 -1
  3. package/lib/commands/app/cache.js +1 -1
  4. package/lib/commands/app/definitions.js +1 -1
  5. package/lib/commands/app/eligibility.js +1 -1
  6. package/lib/commands/app/mock-loader.js +1 -1
  7. package/lib/commands/app/remote-source.js +1 -1
  8. package/lib/commands/app/shared.js +1 -1
  9. package/lib/commands/app-config/get.js +1 -1
  10. package/lib/commands/app-config/index.js +1 -1
  11. package/lib/commands/approval/index.js +1 -1
  12. package/lib/commands/artifact/index.js +1 -1
  13. package/lib/commands/auth/device.js +1 -1
  14. package/lib/commands/auth/index.js +1 -1
  15. package/lib/commands/auth/prompt.js +1 -1
  16. package/lib/commands/bff/detail.js +1 -1
  17. package/lib/commands/bff/exec.js +1 -1
  18. package/lib/commands/bff/index.js +1 -1
  19. package/lib/commands/cli-skill/index.js +1 -1
  20. package/lib/commands/common/config-policy.js +1 -1
  21. package/lib/commands/common/constraints.js +1 -1
  22. package/lib/commands/common/flags.js +1 -1
  23. package/lib/commands/common/local-file.js +1 -1
  24. package/lib/commands/config/definitions.js +1 -1
  25. package/lib/commands/config/init.js +1 -1
  26. package/lib/commands/config/shared.js +1 -1
  27. package/lib/commands/data/import-excel.js +1 -1
  28. package/lib/commands/data/index.js +1 -1
  29. package/lib/commands/dataset/detail.js +1 -1
  30. package/lib/commands/dataset/index.js +1 -1
  31. package/lib/commands/dataset/list.js +1 -1
  32. package/lib/commands/dataset/sdk-doc.js +1 -1
  33. package/lib/commands/doctor.js +1 -1
  34. package/lib/commands/file/index.js +1 -1
  35. package/lib/commands/init.js +1 -1
  36. package/lib/commands/kb/index.js +1 -1
  37. package/lib/commands/logs/index.js +1 -1
  38. package/lib/commands/notification/config-list.js +1 -1
  39. package/lib/commands/notification/index.js +1 -1
  40. package/lib/commands/notification/shared.js +1 -1
  41. package/lib/commands/ocr/index.js +1 -1
  42. package/lib/commands/permit/dataset-get.js +1 -1
  43. package/lib/commands/permit/dataset-set.js +1 -1
  44. package/lib/commands/permit/index.js +1 -1
  45. package/lib/commands/permit/page-get.js +1 -1
  46. package/lib/commands/permit/page-set.js +1 -1
  47. package/lib/commands/permit/role-menus-set.js +1 -1
  48. package/lib/commands/permit/role-menus.js +1 -1
  49. package/lib/commands/permit/shared.js +1 -1
  50. package/lib/commands/personal-bff/index.js +1 -1
  51. package/lib/commands/registry.js +1 -1
  52. package/lib/commands/role/create.js +1 -1
  53. package/lib/commands/role/delete.js +1 -1
  54. package/lib/commands/role/detail.js +1 -1
  55. package/lib/commands/role/index.js +1 -1
  56. package/lib/commands/role/list.js +1 -1
  57. package/lib/commands/role/shared.js +1 -1
  58. package/lib/commands/role/update.js +1 -1
  59. package/lib/commands/role/user-add.js +1 -1
  60. package/lib/commands/role/user-remove.js +1 -1
  61. package/lib/commands/schedule/index.js +1 -1
  62. package/lib/commands/schema.js +1 -1
  63. package/lib/commands/service/dynamic.js +1 -1
  64. package/lib/commands/service/function-name-adapter.js +1 -1
  65. package/lib/commands/service/index.js +1 -1
  66. package/lib/commands/service/registry.js +1 -1
  67. package/lib/commands/skill/commands/create.js +1 -1
  68. package/lib/commands/skill/commands/diagram.js +1 -1
  69. package/lib/commands/skill/commands/install.js +1 -1
  70. package/lib/commands/skill/commands/list.js +1 -1
  71. package/lib/commands/skill/commands/push.js +1 -1
  72. package/lib/commands/skill/commands/validate.js +1 -1
  73. package/lib/commands/skill/diagram.js +1 -1
  74. package/lib/commands/skill/flags.js +1 -1
  75. package/lib/commands/skill/index.js +1 -1
  76. package/lib/commands/skill/manifest-helpers.js +1 -1
  77. package/lib/commands/skill/push-execute.js +1 -1
  78. package/lib/commands/skill/push-flow-helpers.js +1 -1
  79. package/lib/commands/skill/push-retarget.js +1 -1
  80. package/lib/commands/skill/scopes.js +1 -1
  81. package/lib/commands/skill/summary.js +1 -1
  82. package/lib/commands/skill/templates.js +1 -1
  83. package/lib/commands/skill/validate.js +1 -1
  84. package/lib/commands/sql/detail.js +1 -1
  85. package/lib/commands/sql/exec.js +1 -1
  86. package/lib/commands/sql/index.js +1 -1
  87. package/lib/commands/update.js +1 -1
  88. package/lib/commands/user-account/bind.js +1 -1
  89. package/lib/commands/user-account/index.js +1 -1
  90. package/lib/commands/workspace/index.js +1 -1
  91. package/lib/config/domain-config.js +1 -1
  92. package/lib/config/schema.js +1 -1
  93. package/lib/constant/app.js +1 -1
  94. package/lib/constant/auth-mode.js +1 -1
  95. package/lib/constant/cli.js +1 -1
  96. package/lib/constant/defaults.js +1 -1
  97. package/lib/constant/distribution.js +1 -1
  98. package/lib/constant/domain.js +1 -1
  99. package/lib/constant/env.js +1 -1
  100. package/lib/constant/output.js +1 -1
  101. package/lib/constant/product.js +1 -1
  102. package/lib/constant/region.js +1 -1
  103. package/lib/constant/risk.js +1 -1
  104. package/lib/constant/url.js +1 -1
  105. package/lib/context.js +1 -1
  106. package/lib/core/api-client.d.ts +2 -0
  107. package/lib/core/api-client.js +1 -1
  108. package/lib/core/db-resolver.js +1 -1
  109. package/lib/core/kb-search-client.js +1 -1
  110. package/lib/core/sdk-client.js +1 -1
  111. package/lib/errors.js +1 -1
  112. package/lib/framework/access-error.js +1 -1
  113. package/lib/framework/build-all-flags.js +1 -1
  114. package/lib/framework/dryrun.js +1 -1
  115. package/lib/framework/flags.js +1 -1
  116. package/lib/framework/help.js +1 -1
  117. package/lib/framework/index.js +1 -1
  118. package/lib/framework/output.js +1 -1
  119. package/lib/framework/preparse.js +1 -1
  120. package/lib/framework/rate-limit.js +1 -1
  121. package/lib/framework/raw-flags.js +1 -1
  122. package/lib/framework/response.js +1 -1
  123. package/lib/framework/runner-confirmation.js +1 -1
  124. package/lib/framework/runner-error.js +1 -1
  125. package/lib/framework/runner.js +1 -1
  126. package/lib/framework/schema-export.js +1 -1
  127. package/lib/framework/service-order.js +1 -1
  128. package/lib/framework/types.js +1 -1
  129. package/lib/generated/build-info.d.ts +4 -4
  130. package/lib/generated/build-info.js +1 -1
  131. package/lib/generated/official-routing.js +1 -1
  132. package/lib/generated/routing-contract.js +1 -1
  133. package/lib/help.js +1 -1
  134. package/lib/postinstall.js +1 -1
  135. package/lib/runtime/confirmation.js +1 -1
  136. package/lib/runtime/event.js +1 -1
  137. package/lib/runtime/index.js +1 -1
  138. package/lib/runtime/queue.js +1 -1
  139. package/lib/runtime/resolve.js +1 -1
  140. package/lib/services/dataset-import/auto-id-runner.js +1 -1
  141. package/lib/services/dataset-import/excel-reader.js +1 -1
  142. package/lib/services/dataset-import/metadata.js +1 -1
  143. package/lib/services/dataset-import/preview.js +1 -1
  144. package/lib/services/dataset-import/runner.js +1 -1
  145. package/lib/skills/builtin-skill.js +1 -1
  146. package/lib/skills/npx-skills-add.js +1 -1
  147. package/lib/skills/runtime-skill-sync/constants.js +1 -1
  148. package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
  149. package/lib/skills/runtime-skill-sync/hashing.js +1 -1
  150. package/lib/skills/runtime-skill-sync/install-target.js +1 -1
  151. package/lib/skills/runtime-skill-sync/links.js +1 -1
  152. package/lib/skills/runtime-skill-sync/list-local.js +1 -1
  153. package/lib/skills/runtime-skill-sync/local-files.js +1 -1
  154. package/lib/skills/runtime-skill-sync/materialize.js +1 -1
  155. package/lib/skills/runtime-skill-sync/metadata.js +1 -1
  156. package/lib/skills/runtime-skill-sync/paths.js +1 -1
  157. package/lib/skills/runtime-skill-sync/push.js +1 -1
  158. package/lib/skills/runtime-skill-sync/scopes.js +1 -1
  159. package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
  160. package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
  161. package/lib/skills/runtime-skill-sync.js +1 -1
  162. package/lib/skills/skill-presence.js +1 -1
  163. package/lib/utils/access-key-redaction.js +1 -1
  164. package/lib/utils/apply-jq-filter.js +1 -1
  165. package/lib/utils/cli-version-check.js +1 -1
  166. package/lib/utils/cli-version-policy.js +1 -1
  167. package/lib/utils/logger.js +1 -1
  168. package/lib/utils/lossless-json.js +1 -1
  169. package/lib/utils/params.js +1 -1
  170. package/lib/utils/positive-safe-integer.js +1 -1
  171. package/lib/utils/redaction.js +1 -1
  172. package/lib/utils/update-notice.js +1 -1
  173. package/lib/utils/version.js +1 -1
  174. package/lib/utils/write-cli-side-channel.js +1 -1
  175. package/package.json +1 -1
  176. package/skills/lovrabet/SKILL.md +1 -1
  177. package/skills/lovrabet.manifest.json +3 -3
@@ -1 +1 @@
1
- function a144_0x1b1a(){const _0x485c59=['status','lovrabet\x20cli-skill\x20install','Installed\x20Skill\x20state\x20is\x20','isSymbolicLink','schemaVersion','isDirectory','flatMap','8100050TmcxpF',':\x5cs*(.+)$','digest','SKILL.md','count','current','1367637YeQrTY','partialFailure','\x20automatically\x20selected\x20installation\x20target(s)\x20could\x20not\x20be\x20installed.','10610760MmQTnM','unverifiable','packageVersion','skipped','root','isFile','name','4rzhGnK','installedPath','lovrabet.manifest.json','utf8','length','SOURCE_INVALID','files','home','reason','sort','Unsafe\x20manifest\x20path:\x20','includes','4278150OssFZW','unknown','924530rUpmCm','message','\x20verified;\x20','state','update','stdio','packageRoot','manifest','content_mismatch','parse','skills@latest\x20exited\x20','CLI\x20Built-in\x20Skill\x20','455160ErIxWk','INSTALL_FAILED','skillVersion','lovrabet','Built-in\x20Skill\x20source\x20does\x20not\x20match\x20its\x20package\x20manifest','hex','path','trim','every','284351FtPALQ','8JNszFB','skills','package.json','version_mismatch','error','version','split','present','missing','117dzbcre','absent'];a144_0x1b1a=function(){return _0x485c59;};return a144_0x1b1a();}const a144_0x2be534=a144_0x2d8c;(function(_0x3da225,_0x289aa6){const _0x315263=a144_0x2d8c,_0xa0b5a3=_0x3da225();while(!![]){try{const _0x473c5b=parseInt(_0x315263(0x163))/0x1*(-parseInt(_0x315263(0x164))/0x2)+parseInt(_0x315263(0x17c))/0x3+-parseInt(_0x315263(0x186))/0x4*(-parseInt(_0x315263(0x194))/0x5)+-parseInt(_0x315263(0x192))/0x6+parseInt(_0x315263(0x176))/0x7+parseInt(_0x315263(0x17f))/0x8+parseInt(_0x315263(0x16d))/0x9*(-parseInt(_0x315263(0x1a0))/0xa);if(_0x473c5b===_0x289aa6)break;else _0xa0b5a3['push'](_0xa0b5a3['shift']());}catch(_0x30b96b){_0xa0b5a3['push'](_0xa0b5a3['shift']());}}}(a144_0x1b1a,0xa689f));import{createHash}from'node:crypto';function a144_0x2d8c(_0x22ef31,_0x48bbd9){_0x22ef31=_0x22ef31-0x15d;const _0x1b1a3c=a144_0x1b1a();let _0x2d8c92=_0x1b1a3c[_0x22ef31];return _0x2d8c92;}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{debuglog}from'node:util';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=a144_0x2be534(0x170),SKILL_NAME=a144_0x2be534(0x15d),debug=debuglog('lovrabet-skills');function frontmatterValue(_0x178ce9,_0x2ec8f8){const _0x324b41=a144_0x2be534;return _0x178ce9['match'](new RegExp('^'+_0x2ec8f8+_0x324b41(0x177),'m'))?.[0x1]?.[_0x324b41(0x161)]()??'';}function listFiles(_0x1d971c,_0x38dc01=_0x1d971c){const _0xc47289=a144_0x2be534;return readdirSync(_0x38dc01,{'withFileTypes':!![]})[_0xc47289(0x175)](_0x1f72d6=>{const _0x1b0aed=_0xc47289,_0x25ac15=join(_0x38dc01,_0x1f72d6[_0x1b0aed(0x185)]),_0x48abc5=lstatSync(_0x25ac15);if(_0x48abc5[_0x1b0aed(0x172)]())throw new Error('Symbolic\x20link\x20is\x20not\x20allowed:\x20'+_0x25ac15);if(_0x48abc5[_0x1b0aed(0x174)]())return listFiles(_0x1d971c,_0x25ac15);if(!_0x48abc5[_0x1b0aed(0x184)]())throw new Error('Unsupported\x20Skill\x20entry:\x20'+_0x25ac15);return[relative(_0x1d971c,_0x25ac15)[_0x1b0aed(0x16a)](sep)['join']('/')];})[_0xc47289(0x18f)]((_0x48ae4b,_0x17bd19)=>_0x48ae4b<_0x17bd19?-0x1:_0x48ae4b>_0x17bd19?0x1:0x0);}function digestFiles(_0x485d21,_0x3fc1e7){const _0x2e140b=a144_0x2be534,_0x51df36=createHash('sha256');for(const _0x48ae5e of _0x3fc1e7){if(_0x48ae5e['startsWith']('/')||_0x48ae5e[_0x2e140b(0x16a)]('/')[_0x2e140b(0x191)]('..')||_0x48ae5e['includes']('\x5c'))throw new Error(_0x2e140b(0x190)+_0x48ae5e);_0x51df36[_0x2e140b(0x198)](_0x48ae5e),_0x51df36[_0x2e140b(0x198)]('\x00'),_0x51df36[_0x2e140b(0x198)](readFileSync(join(_0x485d21,..._0x48ae5e['split']('/')))),_0x51df36[_0x2e140b(0x198)]('\x00');}return _0x51df36[_0x2e140b(0x178)](_0x2e140b(0x15f));}function sameFiles(_0x404e45,_0x3d9cc4){const _0x200bd4=a144_0x2be534;return _0x404e45[_0x200bd4(0x18a)]===_0x3d9cc4[_0x200bd4(0x18a)]&&_0x404e45[_0x200bd4(0x162)]((_0x37a8b,_0x1b54e7)=>_0x37a8b===_0x3d9cc4[_0x1b54e7]);}function readSource(_0x183cab){const _0x57386b=a144_0x2be534,_0x11dcf7=JSON[_0x57386b(0x19d)](readFileSync(join(_0x183cab,_0x57386b(0x166)),'utf8')),_0x165bf3=JSON[_0x57386b(0x19d)](readFileSync(join(_0x183cab,_0x57386b(0x165),_0x57386b(0x188)),_0x57386b(0x189))),_0x4fe844=join(_0x183cab,'skills',SKILL_NAME),_0x10a425=frontmatterValue(readFileSync(join(_0x4fe844,'SKILL.md'),_0x57386b(0x189)),_0x57386b(0x169)),_0x4329b8=listFiles(_0x4fe844);if(_0x165bf3[_0x57386b(0x173)]!==0x1||_0x165bf3[_0x57386b(0x185)]!==SKILL_NAME||!_0x11dcf7['version']||_0x165bf3[_0x57386b(0x181)]!==_0x11dcf7['version']||_0x165bf3[_0x57386b(0x1a2)]!==_0x11dcf7[_0x57386b(0x169)]||_0x10a425!==_0x11dcf7[_0x57386b(0x169)]||!sameFiles(_0x4329b8,_0x165bf3['files'])||digestFiles(_0x4fe844,_0x4329b8)!==_0x165bf3[_0x57386b(0x178)])throw new Error(_0x57386b(0x15e));return{'packageVersion':_0x11dcf7['version'],'skillVersion':_0x10a425,'root':_0x4fe844,'manifest':_0x165bf3};}function installedSkillPath(_0x242ebb){const _0x24e55b=a144_0x2be534,_0x19ae78=resolveInstalledSkill(SKILL_NAME,{'home':_0x242ebb});if(_0x19ae78['state']===_0x24e55b(0x16b))return{'state':_0x24e55b(0x16b),'path':dirname(_0x19ae78[_0x24e55b(0x160)])};if(_0x19ae78[_0x24e55b(0x197)]===_0x24e55b(0x16e))return{'state':_0x24e55b(0x16c)};return{'state':_0x24e55b(0x180),'reason':_0x19ae78[_0x24e55b(0x18e)]};}export function inspectInstalledBuiltinSkillVersion(_0x36e287,_0x17fc1a={}){const _0x16eb68=a144_0x2be534,_0x37be19=installedSkillPath(_0x17fc1a['home']??homedir());if(_0x37be19[_0x16eb68(0x197)]===_0x16eb68(0x16c))return{'state':'missing','expectedVersion':_0x36e287,'repairCommand':REPAIR_COMMAND};if(_0x37be19[_0x16eb68(0x197)]===_0x16eb68(0x180))return{'state':_0x16eb68(0x180),'expectedVersion':_0x36e287,'reason':_0x37be19[_0x16eb68(0x18e)],'repairCommand':REPAIR_COMMAND};try{const _0x5a4885=frontmatterValue(readFileSync(join(_0x37be19[_0x16eb68(0x160)],_0x16eb68(0x179)),_0x16eb68(0x189)),_0x16eb68(0x169));return{'state':_0x5a4885===_0x36e287?_0x16eb68(0x17b):_0x16eb68(0x167),'expectedVersion':_0x36e287,'skillVersion':_0x5a4885,'installedPath':_0x37be19[_0x16eb68(0x160)],'repairCommand':REPAIR_COMMAND};}catch(_0x22fe4e){return{'state':_0x16eb68(0x180),'expectedVersion':_0x36e287,'installedPath':_0x37be19['path'],'reason':_0x22fe4e instanceof Error?_0x22fe4e[_0x16eb68(0x195)]:String(_0x22fe4e),'repairCommand':REPAIR_COMMAND};}}export function inspectBuiltinSkill(_0x4c2225={}){const _0x3d5beb=a144_0x2be534,_0x3d7485=_0x4c2225[_0x3d5beb(0x19a)]??DEFAULT_PACKAGE_ROOT;let _0xe9fc4d;try{_0xe9fc4d=readSource(_0x3d7485);}catch(_0x1e6941){return{'state':_0x3d5beb(0x180),'packageVersion':_0x3d5beb(0x193),'reason':_0x1e6941 instanceof Error?_0x1e6941[_0x3d5beb(0x195)]:String(_0x1e6941),'repairCommand':REPAIR_COMMAND};}const _0x495ef6=installedSkillPath(_0x4c2225[_0x3d5beb(0x18d)]??homedir());if(_0x495ef6[_0x3d5beb(0x197)]===_0x3d5beb(0x16c))return{'state':_0x3d5beb(0x16c),'packageVersion':_0xe9fc4d['packageVersion'],'repairCommand':REPAIR_COMMAND};if(_0x495ef6[_0x3d5beb(0x197)]===_0x3d5beb(0x180))return{'state':_0x3d5beb(0x180),'packageVersion':_0xe9fc4d[_0x3d5beb(0x181)],'reason':_0x495ef6['reason'],'repairCommand':REPAIR_COMMAND};try{const _0x134431=frontmatterValue(readFileSync(join(_0x495ef6['path'],_0x3d5beb(0x179)),_0x3d5beb(0x189)),_0x3d5beb(0x169));if(_0x134431!==_0xe9fc4d[_0x3d5beb(0x1a2)])return{'state':'version_mismatch','packageVersion':_0xe9fc4d[_0x3d5beb(0x181)],'skillVersion':_0x134431,'installedPath':_0x495ef6[_0x3d5beb(0x160)],'repairCommand':REPAIR_COMMAND};const _0x28181d=listFiles(_0x495ef6[_0x3d5beb(0x160)]),_0x294e5d=digestFiles(_0x495ef6[_0x3d5beb(0x160)],_0x28181d);return{'state':sameFiles(_0x28181d,_0xe9fc4d[_0x3d5beb(0x19b)][_0x3d5beb(0x18c)])&&_0x294e5d===_0xe9fc4d[_0x3d5beb(0x19b)][_0x3d5beb(0x178)]?_0x3d5beb(0x17b):_0x3d5beb(0x19c),'packageVersion':_0xe9fc4d[_0x3d5beb(0x181)],'skillVersion':_0x134431,'installedPath':_0x495ef6[_0x3d5beb(0x160)],'digest':_0x294e5d,'repairCommand':REPAIR_COMMAND};}catch(_0x3031c7){return{'state':_0x3d5beb(0x180),'packageVersion':_0xe9fc4d['packageVersion'],'installedPath':_0x495ef6[_0x3d5beb(0x160)],'reason':_0x3031c7 instanceof Error?_0x3031c7[_0x3d5beb(0x195)]:String(_0x3031c7),'repairCommand':REPAIR_COMMAND};}}function failure(_0x4a6952,_0x1c03a0,_0x51917f,_0x3741fb){const _0x4ad3f6=a144_0x2be534;return{'ok':![],'code':_0x4a6952,'packageVersion':_0x1c03a0['packageVersion'],'skillVersion':_0x1c03a0['skillVersion'],'installedPath':_0x3741fb,'changed':![],'repairCommand':REPAIR_COMMAND,'error':_0x51917f instanceof Error?_0x51917f[_0x4ad3f6(0x195)]:String(_0x51917f)};}export function installBuiltinSkill(_0x20b133={}){const _0x2f1051=a144_0x2be534,_0x183294=_0x20b133[_0x2f1051(0x19a)]??DEFAULT_PACKAGE_ROOT,_0x2fdae6=_0x20b133[_0x2f1051(0x18d)]??homedir();let _0x15b597;try{_0x15b597=readSource(_0x183294);}catch(_0x5afa21){return failure(_0x2f1051(0x18b),{'packageVersion':_0x2f1051(0x193),'skillVersion':_0x2f1051(0x193)},_0x5afa21);}const _0x3ec024=inspectBuiltinSkill({'packageRoot':_0x183294,'home':_0x2fdae6}),_0x20a967=runNpxSkillsAddGlobal(_0x183294,_0x15b597[_0x2f1051(0x183)],{'stdio':_0x20b133[_0x2f1051(0x199)]??'pipe','expectedSkillName':SKILL_NAME,'presence':{'home':_0x2fdae6}});if(_0x20a967[_0x2f1051(0x182)])return{'ok':!![],'packageVersion':_0x15b597['packageVersion'],'skillVersion':_0x15b597['skillVersion'],'installedPath':_0x3ec024[_0x2f1051(0x187)],'changed':![],'repairCommand':REPAIR_COMMAND};if(!_0x20a967['ok'])return failure(_0x2f1051(0x1a1),_0x15b597,_0x20a967[_0x2f1051(0x168)]??_0x2f1051(0x19e)+_0x20a967[_0x2f1051(0x16f)]);const _0x4aa26e=inspectBuiltinSkill({'packageRoot':_0x183294,'home':_0x2fdae6});if(_0x4aa26e[_0x2f1051(0x197)]!==_0x2f1051(0x17b)){const _0x4ed3ca=_0x4aa26e['reason']??_0x2f1051(0x171)+_0x4aa26e[_0x2f1051(0x197)];return failure('VERIFY_FAILED',_0x15b597,_0x20a967[_0x2f1051(0x17d)]?_0x4ed3ca+'\x0a'+_0x20a967[_0x2f1051(0x17d)]['output']:_0x4ed3ca,_0x4aa26e[_0x2f1051(0x187)]);}return _0x20a967['partialFailure']&&(debug('Installer\x20reported\x20partial\x20target\x20failures:\x0a%s',_0x20a967[_0x2f1051(0x17d)]['output']),console['log'](_0x2f1051(0x19f)+_0x15b597[_0x2f1051(0x1a2)]+_0x2f1051(0x196)+_0x20a967[_0x2f1051(0x17d)][_0x2f1051(0x17a)]+_0x2f1051(0x17e))),{'ok':!![],'packageVersion':_0x15b597['packageVersion'],'skillVersion':_0x15b597[_0x2f1051(0x1a2)],'installedPath':_0x4aa26e['installedPath'],'changed':_0x3ec024[_0x2f1051(0x197)]!=='current','repairCommand':REPAIR_COMMAND};}
1
+ const a144_0x3b29d2=a144_0x353a;(function(_0xd7df58,_0x1ad755){const _0x5aa542=a144_0x353a,_0x705027=_0xd7df58();while(!![]){try{const _0x10bdf8=-parseInt(_0x5aa542(0x1b3))/0x1+-parseInt(_0x5aa542(0x1a5))/0x2+parseInt(_0x5aa542(0x1bf))/0x3+-parseInt(_0x5aa542(0x1eb))/0x4+-parseInt(_0x5aa542(0x1b6))/0x5*(-parseInt(_0x5aa542(0x1c4))/0x6)+parseInt(_0x5aa542(0x1a7))/0x7*(-parseInt(_0x5aa542(0x1d0))/0x8)+parseInt(_0x5aa542(0x1ca))/0x9;if(_0x10bdf8===_0x1ad755)break;else _0x705027['push'](_0x705027['shift']());}catch(_0x418e8f){_0x705027['push'](_0x705027['shift']());}}}(a144_0x1edb,0x1c156));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';function a144_0x1edb(){const _0x5bd7fd=['8PwWwub','path','pipe','Unsafe\x20manifest\x20path:\x20','version','content_mismatch','unverifiable','schemaVersion','length','SOURCE_INVALID','isFile','skills@latest\x20exited\x20','Installer\x20reported\x20partial\x20target\x20failures:\x0a%s','error','Built-in\x20Skill\x20source\x20does\x20not\x20match\x20its\x20package\x20manifest','split','SKILL.md','skills','state','skipped','Installed\x20Skill\x20state\x20is\x20','sha256','flatMap','skillVersion','join','output','files','620956FLgWnZ','parse','current','lovrabet-skills','444862HozKtH','isDirectory','1224811ZkmKST','stdio','version_mismatch','root','count','missing','home','Unsupported\x20Skill\x20entry:\x20','VERIFY_FAILED','installedPath','isSymbolicLink','present','184007OnKGBY','unknown','manifest','5pkzNCZ','Symbolic\x20link\x20is\x20not\x20allowed:\x20',':\x5cs*(.+)$','digest','sort','\x20verified;\x20','CLI\x20Built-in\x20Skill\x20','match','includes','133557qUDmmf','partialFailure','lovrabet\x20cli-skill\x20install','trim','absent','1066254pGtpQD','name','update','message','packageRoot','log','5665068PPsPBp','packageVersion','startsWith','utf8','\x20automatically\x20selected\x20installation\x20target(s)\x20could\x20not\x20be\x20installed.','reason'];a144_0x1edb=function(){return _0x5bd7fd;};return a144_0x1edb();}import{fileURLToPath}from'node:url';import{debuglog}from'node:util';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=a144_0x3b29d2(0x1c1),SKILL_NAME='lovrabet',debug=debuglog(a144_0x3b29d2(0x1a4));function frontmatterValue(_0x2a83af,_0x19ed9){const _0x54a413=a144_0x3b29d2;return _0x2a83af[_0x54a413(0x1bd)](new RegExp('^'+_0x19ed9+_0x54a413(0x1b8),'m'))?.[0x1]?.[_0x54a413(0x1c2)]()??'';}function listFiles(_0x31bb64,_0x453e89=_0x31bb64){const _0x6331ad=a144_0x3b29d2;return readdirSync(_0x453e89,{'withFileTypes':!![]})[_0x6331ad(0x1e6)](_0x51af1c=>{const _0x548cb2=_0x6331ad,_0x27b66e=join(_0x453e89,_0x51af1c[_0x548cb2(0x1c5)]),_0x37514e=lstatSync(_0x27b66e);if(_0x37514e[_0x548cb2(0x1b1)]())throw new Error(_0x548cb2(0x1b7)+_0x27b66e);if(_0x37514e[_0x548cb2(0x1a6)]())return listFiles(_0x31bb64,_0x27b66e);if(!_0x37514e[_0x548cb2(0x1da)]())throw new Error(_0x548cb2(0x1ae)+_0x27b66e);return[relative(_0x31bb64,_0x27b66e)['split'](sep)[_0x548cb2(0x1e8)]('/')];})[_0x6331ad(0x1ba)]((_0x46e90a,_0x5b899f)=>_0x46e90a<_0x5b899f?-0x1:_0x46e90a>_0x5b899f?0x1:0x0);}function digestFiles(_0x2e438c,_0x1d397d){const _0x25ef2c=a144_0x3b29d2,_0x2d813d=createHash(_0x25ef2c(0x1e5));for(const _0x1bb936 of _0x1d397d){if(_0x1bb936[_0x25ef2c(0x1cc)]('/')||_0x1bb936[_0x25ef2c(0x1df)]('/')[_0x25ef2c(0x1be)]('..')||_0x1bb936[_0x25ef2c(0x1be)]('\x5c'))throw new Error(_0x25ef2c(0x1d3)+_0x1bb936);_0x2d813d['update'](_0x1bb936),_0x2d813d[_0x25ef2c(0x1c6)]('\x00'),_0x2d813d[_0x25ef2c(0x1c6)](readFileSync(join(_0x2e438c,..._0x1bb936[_0x25ef2c(0x1df)]('/')))),_0x2d813d[_0x25ef2c(0x1c6)]('\x00');}return _0x2d813d[_0x25ef2c(0x1b9)]('hex');}function sameFiles(_0x4d1de8,_0x1b47a4){const _0x68ce90=a144_0x3b29d2;return _0x4d1de8['length']===_0x1b47a4[_0x68ce90(0x1d8)]&&_0x4d1de8['every']((_0x1af565,_0x2522f8)=>_0x1af565===_0x1b47a4[_0x2522f8]);}function a144_0x353a(_0x1d0963,_0x40dc54){_0x1d0963=_0x1d0963-0x1a2;const _0x1edb93=a144_0x1edb();let _0x353aa8=_0x1edb93[_0x1d0963];return _0x353aa8;}function readSource(_0x27d00d){const _0x1667f1=a144_0x3b29d2,_0x508ae9=JSON['parse'](readFileSync(join(_0x27d00d,'package.json'),_0x1667f1(0x1cd))),_0x52a5a7=JSON[_0x1667f1(0x1a2)](readFileSync(join(_0x27d00d,_0x1667f1(0x1e1),'lovrabet.manifest.json'),_0x1667f1(0x1cd))),_0x5aeeac=join(_0x27d00d,_0x1667f1(0x1e1),SKILL_NAME),_0x5f464f=frontmatterValue(readFileSync(join(_0x5aeeac,_0x1667f1(0x1e0)),_0x1667f1(0x1cd)),_0x1667f1(0x1d4)),_0x5f2a4e=listFiles(_0x5aeeac);if(_0x52a5a7[_0x1667f1(0x1d7)]!==0x1||_0x52a5a7['name']!==SKILL_NAME||!_0x508ae9[_0x1667f1(0x1d4)]||_0x52a5a7['packageVersion']!==_0x508ae9[_0x1667f1(0x1d4)]||_0x52a5a7[_0x1667f1(0x1e7)]!==_0x508ae9[_0x1667f1(0x1d4)]||_0x5f464f!==_0x508ae9[_0x1667f1(0x1d4)]||!sameFiles(_0x5f2a4e,_0x52a5a7[_0x1667f1(0x1ea)])||digestFiles(_0x5aeeac,_0x5f2a4e)!==_0x52a5a7[_0x1667f1(0x1b9)])throw new Error(_0x1667f1(0x1de));return{'packageVersion':_0x508ae9[_0x1667f1(0x1d4)],'skillVersion':_0x5f464f,'root':_0x5aeeac,'manifest':_0x52a5a7};}function installedSkillPath(_0x5e2712){const _0x7484bd=a144_0x3b29d2,_0x658be5=resolveInstalledSkill(SKILL_NAME,{'home':_0x5e2712});if(_0x658be5[_0x7484bd(0x1e2)]===_0x7484bd(0x1b2))return{'state':'present','path':dirname(_0x658be5[_0x7484bd(0x1d1)])};if(_0x658be5[_0x7484bd(0x1e2)]===_0x7484bd(0x1c3))return{'state':'missing'};return{'state':_0x7484bd(0x1d6),'reason':_0x658be5[_0x7484bd(0x1cf)]};}export function inspectInstalledBuiltinSkillVersion(_0x4486d5,_0x4ea67f={}){const _0x53dcf2=a144_0x3b29d2,_0x527d03=installedSkillPath(_0x4ea67f['home']??homedir());if(_0x527d03[_0x53dcf2(0x1e2)]==='missing')return{'state':'missing','expectedVersion':_0x4486d5,'repairCommand':REPAIR_COMMAND};if(_0x527d03[_0x53dcf2(0x1e2)]===_0x53dcf2(0x1d6))return{'state':_0x53dcf2(0x1d6),'expectedVersion':_0x4486d5,'reason':_0x527d03[_0x53dcf2(0x1cf)],'repairCommand':REPAIR_COMMAND};try{const _0x3c22ae=frontmatterValue(readFileSync(join(_0x527d03[_0x53dcf2(0x1d1)],'SKILL.md'),_0x53dcf2(0x1cd)),'version');return{'state':_0x3c22ae===_0x4486d5?_0x53dcf2(0x1a3):_0x53dcf2(0x1a9),'expectedVersion':_0x4486d5,'skillVersion':_0x3c22ae,'installedPath':_0x527d03[_0x53dcf2(0x1d1)],'repairCommand':REPAIR_COMMAND};}catch(_0x33c5d9){return{'state':_0x53dcf2(0x1d6),'expectedVersion':_0x4486d5,'installedPath':_0x527d03[_0x53dcf2(0x1d1)],'reason':_0x33c5d9 instanceof Error?_0x33c5d9[_0x53dcf2(0x1c7)]:String(_0x33c5d9),'repairCommand':REPAIR_COMMAND};}}export function inspectBuiltinSkill(_0x4959c9={}){const _0x38b31d=a144_0x3b29d2,_0x5aa104=_0x4959c9[_0x38b31d(0x1c8)]??DEFAULT_PACKAGE_ROOT;let _0x479965;try{_0x479965=readSource(_0x5aa104);}catch(_0xd0a3fc){return{'state':_0x38b31d(0x1d6),'packageVersion':_0x38b31d(0x1b4),'reason':_0xd0a3fc instanceof Error?_0xd0a3fc[_0x38b31d(0x1c7)]:String(_0xd0a3fc),'repairCommand':REPAIR_COMMAND};}const _0x1929d3=installedSkillPath(_0x4959c9[_0x38b31d(0x1ad)]??homedir());if(_0x1929d3[_0x38b31d(0x1e2)]===_0x38b31d(0x1ac))return{'state':_0x38b31d(0x1ac),'packageVersion':_0x479965[_0x38b31d(0x1cb)],'repairCommand':REPAIR_COMMAND};if(_0x1929d3['state']===_0x38b31d(0x1d6))return{'state':_0x38b31d(0x1d6),'packageVersion':_0x479965[_0x38b31d(0x1cb)],'reason':_0x1929d3[_0x38b31d(0x1cf)],'repairCommand':REPAIR_COMMAND};try{const _0x5ca735=frontmatterValue(readFileSync(join(_0x1929d3[_0x38b31d(0x1d1)],_0x38b31d(0x1e0)),_0x38b31d(0x1cd)),'version');if(_0x5ca735!==_0x479965['skillVersion'])return{'state':_0x38b31d(0x1a9),'packageVersion':_0x479965['packageVersion'],'skillVersion':_0x5ca735,'installedPath':_0x1929d3[_0x38b31d(0x1d1)],'repairCommand':REPAIR_COMMAND};const _0x12396f=listFiles(_0x1929d3[_0x38b31d(0x1d1)]),_0x1929b1=digestFiles(_0x1929d3[_0x38b31d(0x1d1)],_0x12396f);return{'state':sameFiles(_0x12396f,_0x479965[_0x38b31d(0x1b5)][_0x38b31d(0x1ea)])&&_0x1929b1===_0x479965['manifest'][_0x38b31d(0x1b9)]?_0x38b31d(0x1a3):_0x38b31d(0x1d5),'packageVersion':_0x479965[_0x38b31d(0x1cb)],'skillVersion':_0x5ca735,'installedPath':_0x1929d3[_0x38b31d(0x1d1)],'digest':_0x1929b1,'repairCommand':REPAIR_COMMAND};}catch(_0x27cfbc){return{'state':_0x38b31d(0x1d6),'packageVersion':_0x479965[_0x38b31d(0x1cb)],'installedPath':_0x1929d3[_0x38b31d(0x1d1)],'reason':_0x27cfbc instanceof Error?_0x27cfbc[_0x38b31d(0x1c7)]:String(_0x27cfbc),'repairCommand':REPAIR_COMMAND};}}function failure(_0x235e9d,_0x5badcd,_0xf3718f,_0x2c4eb0){const _0x115fd0=a144_0x3b29d2;return{'ok':![],'code':_0x235e9d,'packageVersion':_0x5badcd[_0x115fd0(0x1cb)],'skillVersion':_0x5badcd[_0x115fd0(0x1e7)],'installedPath':_0x2c4eb0,'changed':![],'repairCommand':REPAIR_COMMAND,'error':_0xf3718f instanceof Error?_0xf3718f['message']:String(_0xf3718f)};}export function installBuiltinSkill(_0x32b6d0={}){const _0xbfe1e9=a144_0x3b29d2,_0x2b7d53=_0x32b6d0[_0xbfe1e9(0x1c8)]??DEFAULT_PACKAGE_ROOT,_0x10e0e7=_0x32b6d0['home']??homedir();let _0x557dea;try{_0x557dea=readSource(_0x2b7d53);}catch(_0x51cc8f){return failure(_0xbfe1e9(0x1d9),{'packageVersion':_0xbfe1e9(0x1b4),'skillVersion':_0xbfe1e9(0x1b4)},_0x51cc8f);}const _0x4424d7=inspectBuiltinSkill({'packageRoot':_0x2b7d53,'home':_0x10e0e7}),_0x1ba7f3=runNpxSkillsAddGlobal(_0x2b7d53,_0x557dea[_0xbfe1e9(0x1aa)],{'stdio':_0x32b6d0[_0xbfe1e9(0x1a8)]??_0xbfe1e9(0x1d2),'expectedSkillName':SKILL_NAME,'presence':{'home':_0x10e0e7}});if(_0x1ba7f3[_0xbfe1e9(0x1e3)])return{'ok':!![],'packageVersion':_0x557dea[_0xbfe1e9(0x1cb)],'skillVersion':_0x557dea[_0xbfe1e9(0x1e7)],'installedPath':_0x4424d7[_0xbfe1e9(0x1b0)],'changed':![],'repairCommand':REPAIR_COMMAND};if(!_0x1ba7f3['ok'])return failure('INSTALL_FAILED',_0x557dea,_0x1ba7f3[_0xbfe1e9(0x1dd)]??_0xbfe1e9(0x1db)+_0x1ba7f3['status']);const _0x178ae7=inspectBuiltinSkill({'packageRoot':_0x2b7d53,'home':_0x10e0e7});if(_0x178ae7['state']!=='current'){const _0x4034d0=_0x178ae7[_0xbfe1e9(0x1cf)]??_0xbfe1e9(0x1e4)+_0x178ae7[_0xbfe1e9(0x1e2)];return failure(_0xbfe1e9(0x1af),_0x557dea,_0x1ba7f3[_0xbfe1e9(0x1c0)]?_0x4034d0+'\x0a'+_0x1ba7f3[_0xbfe1e9(0x1c0)][_0xbfe1e9(0x1e9)]:_0x4034d0,_0x178ae7[_0xbfe1e9(0x1b0)]);}return _0x1ba7f3[_0xbfe1e9(0x1c0)]&&(debug(_0xbfe1e9(0x1dc),_0x1ba7f3[_0xbfe1e9(0x1c0)]['output']),console[_0xbfe1e9(0x1c9)](_0xbfe1e9(0x1bc)+_0x557dea[_0xbfe1e9(0x1e7)]+_0xbfe1e9(0x1bb)+_0x1ba7f3[_0xbfe1e9(0x1c0)][_0xbfe1e9(0x1ab)]+_0xbfe1e9(0x1ce))),{'ok':!![],'packageVersion':_0x557dea['packageVersion'],'skillVersion':_0x557dea[_0xbfe1e9(0x1e7)],'installedPath':_0x178ae7[_0xbfe1e9(0x1b0)],'changed':_0x4424d7['state']!==_0xbfe1e9(0x1a3),'repairCommand':REPAIR_COMMAND};}
@@ -1 +1 @@
1
- const a145_0x1917e8=a145_0x44d6;(function(_0x5cb023,_0x1f34e3){const _0x29714c=a145_0x44d6,_0x11da58=_0x5cb023();while(!![]){try{const _0x4f44c7=-parseInt(_0x29714c(0x118))/0x1+-parseInt(_0x29714c(0x105))/0x2+-parseInt(_0x29714c(0xfd))/0x3*(-parseInt(_0x29714c(0x12a))/0x4)+-parseInt(_0x29714c(0x128))/0x5*(-parseInt(_0x29714c(0x10e))/0x6)+-parseInt(_0x29714c(0x120))/0x7+-parseInt(_0x29714c(0x12b))/0x8*(-parseInt(_0x29714c(0xfe))/0x9)+parseInt(_0x29714c(0x107))/0xa;if(_0x4f44c7===_0x1f34e3)break;else _0x11da58['push'](_0x11da58['shift']());}catch(_0x3df3a8){_0x11da58['push'](_0x11da58['shift']());}}}(a145_0x4c59,0xe82f4));import{execaSync}from'execa';import{LOVRABET_SKILL_SOURCE as a145_0x2eeebd}from'../constant/distribution.js';import{PRODUCT_CONFIG,productEnvName}from'../constant/product.js';import{resolveInstalledSkill}from'../skills/skill-presence.js';function a145_0x44d6(_0x33861d,_0x5c1b4c){_0x33861d=_0x33861d-0xf8;const _0x4c590a=a145_0x4c59();let _0x44d681=_0x4c590a[_0x33861d];return _0x44d681;}export const LOVRABET_SKILL_SOURCE=a145_0x2eeebd;export const LOVRABET_SKILL_GIT_SOURCE=PRODUCT_CONFIG[a145_0x1917e8(0x11e)];export const LOVRABET_GLOBAL_SKILL_NAME=PRODUCT_CONFIG['globalSkillName'];export function resolveGlobalSkillName(_0x4bd1ee){const _0x6c6dd7=a145_0x1917e8;switch(_0x4bd1ee[_0x6c6dd7(0x104)]()){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[a145_0x1917e8(0x10d)]);const CHILD_OUTPUT_MAX_BUFFER=0x10*0x400*0x400;function failure(_0x4ae118,_0x272982,_0x24ee43){return{'ok':![],'status':_0x272982,'code':_0x4ae118,'error':'['+_0x4ae118+']\x20'+_0x24ee43};}export function shouldSkipNpxSkillsAdd(){return process.env[LOVRABET_SKIP_NPX_SKILLS_ENV]==='1';}function a145_0x4c59(){const _0x5a3a99=['2261259Njikse','NPM_CONFIG_GLOBAL','signal','npm_config_global','Installer\x20reported\x20','message','shortMessage','\x22\x20not\x20found\x20after\x20install\x20(checked\x20','1201160ufEcns','add','4UbPpKF','2922032miHxeL','SKILL_NOT_INSTALLED','pipe','filter','failed','!\x20Could\x20not\x20verify\x20\x22','EPERM','Skill\x20\x22','2175561mPmqfr','9dISztH','CHILD_EXIT_NONZERO','npx\x20failed\x20to\x20start','warn','exit\x20','absent','trim','2749816maFdyW','expectedSkillName','6178930vIjDbz','NPX_NOT_FOUND','state','checked','PERMISSION_DENIED','EACCES','skipNpxSkillsEnvSuffix','30biFepD','stderr','code','exitCode','presence','log','stdout','\x20failed\x20target(s)','skills@latest','match','260521KsveOz','join','unverifiable','npx','stdio','CHILD_TERMINATED','internalSkillSource','SPAWN_FAILED'];a145_0x4c59=function(){return _0x5a3a99;};return a145_0x4c59();}export function runNpxSkillsAddGlobal(_0x577342,_0x1b8559=LOVRABET_SKILL_SOURCE,_0x44ae1e){const _0x2721d5=a145_0x1917e8;if(shouldSkipNpxSkillsAdd())return{'ok':!![],'status':0x0,'skipped':!![]};const _0xdafda9=['-y',_0x2721d5(0x116),_0x2721d5(0x129),_0x1b8559,'-g','-y'],_0x2f78b1=['npx',..._0xdafda9][_0x2721d5(0x119)]('\x20');console[_0x2721d5(0x113)]('*\x20'+_0x2f78b1);const _0x48abc7={...process.env};delete _0x48abc7[_0x2721d5(0x123)],delete _0x48abc7[_0x2721d5(0x121)];const _0x252be2=execaSync(_0x2721d5(0x11b),_0xdafda9,{'cwd':_0x577342,'stdio':_0x2721d5(0x12d),'env':_0x48abc7,'extendEnv':![],'shell':![],'reject':![],'maxBuffer':CHILD_OUTPUT_MAX_BUFFER}),_0x3a5276=[_0x252be2[_0x2721d5(0x114)]?String(_0x252be2[_0x2721d5(0x114)]):'',_0x252be2[_0x2721d5(0x10f)]?String(_0x252be2[_0x2721d5(0x10f)]):''][_0x2721d5(0xf8)](Boolean)[_0x2721d5(0x119)]('\x0a')['trim'](),_0x2ceeed=_0x252be2[_0x2721d5(0x111)]??null,_0x4196b7=_0x1585fb=>{const _0x556463=_0x2721d5;return _0x44ae1e?.[_0x556463(0x11c)]!==_0x556463(0x12d)&&!_0x1585fb['partialFailure']&&_0x3a5276&&console['log'](_0x3a5276),_0x1585fb;};if(_0x252be2[_0x2721d5(0x110)]){const _0x3ae2ad=_0x252be2['code']==='ENOENT'?_0x2721d5(0x108):_0x252be2[_0x2721d5(0x110)]===_0x2721d5(0xfb)||_0x252be2[_0x2721d5(0x110)]===_0x2721d5(0x10c)?_0x2721d5(0x10b):'SPAWN_FAILED';return _0x4196b7(failure(_0x3ae2ad,_0x2ceeed,_0x252be2[_0x2721d5(0x126)]??_0x252be2[_0x2721d5(0x125)]??_0x252be2[_0x2721d5(0x110)]));}if(_0x252be2[_0x2721d5(0x122)])return _0x4196b7(failure(_0x2721d5(0x11d),_0x2ceeed,'npx\x20terminated\x20by\x20signal\x20'+_0x252be2['signal']));if(_0x252be2[_0x2721d5(0xf9)]&&_0x2ceeed===null)return _0x4196b7(failure(_0x2721d5(0x11f),_0x2ceeed,_0x252be2[_0x2721d5(0x126)]??_0x252be2[_0x2721d5(0x125)]??_0x2721d5(0x100)));if(_0x2ceeed!==0x0)return _0x4196b7(failure(_0x2721d5(0xff),_0x2ceeed,_0x3a5276||_0x252be2[_0x2721d5(0x126)]||_0x2721d5(0x102)+(_0x2ceeed??'unknown')));const _0x5062d6=_0x44ae1e?.[_0x2721d5(0x106)]??resolveGlobalSkillName(_0x1b8559),_0x57b301=_0x5062d6?resolveInstalledSkill(_0x5062d6,_0x44ae1e?.[_0x2721d5(0x112)]):undefined,_0x10870f=_0x3a5276[_0x2721d5(0x117)](/Failed to install\s+(\d+)/i);if(_0x10870f&&Number(_0x10870f[0x1])>0x0){const _0x1c9716=_0x2721d5(0x124)+_0x10870f[0x1]+_0x2721d5(0x115)+(_0x3a5276?':\x0a'+_0x3a5276:'');if(_0x57b301?.[_0x2721d5(0x109)]==='present')return{'ok':!![],'status':0x0,'partialFailure':{'count':Number(_0x10870f[0x1]),'output':_0x3a5276}};return _0x4196b7(failure('INSTALL_PARTIAL',0x0,_0x1c9716));}if(_0x5062d6&&_0x57b301){if(_0x57b301[_0x2721d5(0x109)]===_0x2721d5(0x103))return _0x4196b7(failure(_0x2721d5(0x12c),0x0,_0x2721d5(0xfc)+_0x5062d6+_0x2721d5(0x127)+_0x57b301[_0x2721d5(0x10a)][_0x2721d5(0x119)](',\x20')+')'));_0x57b301[_0x2721d5(0x109)]===_0x2721d5(0x11a)&&console[_0x2721d5(0x101)](_0x2721d5(0xfa)+_0x5062d6+'\x22\x20install\x20state:\x20'+_0x57b301['reason']);}return _0x4196b7({'ok':!![],'status':0x0});}
1
+ const a145_0x5ea39f=a145_0x3688;(function(_0x140130,_0x17f10b){const _0x5d3017=a145_0x3688,_0xf8a466=_0x140130();while(!![]){try{const _0x5ccb76=-parseInt(_0x5d3017(0x1b0))/0x1*(-parseInt(_0x5d3017(0x18d))/0x2)+parseInt(_0x5d3017(0x193))/0x3*(parseInt(_0x5d3017(0x1bc))/0x4)+-parseInt(_0x5d3017(0x196))/0x5+parseInt(_0x5d3017(0x1be))/0x6*(parseInt(_0x5d3017(0x1ae))/0x7)+-parseInt(_0x5d3017(0x1a3))/0x8*(-parseInt(_0x5d3017(0x191))/0x9)+parseInt(_0x5d3017(0x19e))/0xa+-parseInt(_0x5d3017(0x19a))/0xb*(parseInt(_0x5d3017(0x18f))/0xc);if(_0x5ccb76===_0x17f10b)break;else _0xf8a466['push'](_0xf8a466['shift']());}catch(_0x4b92){_0xf8a466['push'](_0xf8a466['shift']());}}}(a145_0x4f81,0xaa4e9));import{execaSync}from'execa';import{LOVRABET_SKILL_SOURCE as a145_0x298953}from'../constant/distribution.js';function a145_0x4f81(){const _0x533bf2=['694zOzAOX','message','18756FaROLX','PERMISSION_DENIED','9189wIqBNS','stdio','6mGiItb','reason','EPERM','5891825vYzMPv','!\x20Could\x20not\x20verify\x20\x22','\x22\x20not\x20found\x20after\x20install\x20(checked\x20','shortMessage','5753BCIXQO','log','NPX_NOT_FOUND','state','448000IImlrx','stdout','skills@latest','warn','add','5904WEgnpR','failed','signal','npx\x20terminated\x20by\x20signal\x20','trim','join','globalSkillName','skipNpxSkillsEnvSuffix','SKILL_NOT_INSTALLED','CHILD_TERMINATED','expectedSkillName','42MvCikj','npx','2869xFLBIB','internalSkillSource','npx\x20failed\x20to\x20start','exit\x20','partialFailure','SPAWN_FAILED','match','checked','exitCode','code','\x22\x20install\x20state:\x20','pipe','71256wRlMjD','stderr','863922yqaedx','INSTALL_PARTIAL'];a145_0x4f81=function(){return _0x533bf2;};return a145_0x4f81();}import{PRODUCT_CONFIG,productEnvName}from'../constant/product.js';import{resolveInstalledSkill}from'../skills/skill-presence.js';export const LOVRABET_SKILL_SOURCE=a145_0x298953;export const LOVRABET_SKILL_GIT_SOURCE=PRODUCT_CONFIG[a145_0x5ea39f(0x1b1)];function a145_0x3688(_0x52cf07,_0x25e375){_0x52cf07=_0x52cf07-0x18d;const _0x4f8118=a145_0x4f81();let _0x368885=_0x4f8118[_0x52cf07];return _0x368885;}export const LOVRABET_GLOBAL_SKILL_NAME=PRODUCT_CONFIG[a145_0x5ea39f(0x1a9)];export function resolveGlobalSkillName(_0x301114){switch(_0x301114['trim']()){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[a145_0x5ea39f(0x1aa)]);const CHILD_OUTPUT_MAX_BUFFER=0x10*0x400*0x400;function failure(_0x32f449,_0x1d4755,_0x1fdcb9){return{'ok':![],'status':_0x1d4755,'code':_0x32f449,'error':'['+_0x32f449+']\x20'+_0x1fdcb9};}export function shouldSkipNpxSkillsAdd(){return process.env[LOVRABET_SKIP_NPX_SKILLS_ENV]==='1';}export function runNpxSkillsAddGlobal(_0xf37ac0,_0xfe52ca=LOVRABET_SKILL_SOURCE,_0x3153a9){const _0xf6f282=a145_0x5ea39f;if(shouldSkipNpxSkillsAdd())return{'ok':!![],'status':0x0,'skipped':!![]};const _0x904d0d=['-y',_0xf6f282(0x1a0),_0xf6f282(0x1a2),_0xfe52ca,'-g','-y'],_0x5bb263=[_0xf6f282(0x1af),..._0x904d0d]['join']('\x20');console[_0xf6f282(0x19b)]('*\x20'+_0x5bb263);const _0x46b1a6={...process.env};delete _0x46b1a6['npm_config_global'],delete _0x46b1a6['NPM_CONFIG_GLOBAL'];const _0x33c2e0=execaSync('npx',_0x904d0d,{'cwd':_0xf37ac0,'stdio':'pipe','env':_0x46b1a6,'extendEnv':![],'shell':![],'reject':![],'maxBuffer':CHILD_OUTPUT_MAX_BUFFER}),_0x3476f4=[_0x33c2e0[_0xf6f282(0x19f)]?String(_0x33c2e0['stdout']):'',_0x33c2e0[_0xf6f282(0x1bd)]?String(_0x33c2e0[_0xf6f282(0x1bd)]):'']['filter'](Boolean)['join']('\x0a')[_0xf6f282(0x1a7)](),_0x52b017=_0x33c2e0[_0xf6f282(0x1b8)]??null,_0x296603=_0x2a839c=>{const _0x484f25=_0xf6f282;return _0x3153a9?.[_0x484f25(0x192)]!==_0x484f25(0x1bb)&&!_0x2a839c[_0x484f25(0x1b4)]&&_0x3476f4&&console[_0x484f25(0x19b)](_0x3476f4),_0x2a839c;};if(_0x33c2e0[_0xf6f282(0x1b9)]){const _0x29f66d=_0x33c2e0['code']==='ENOENT'?_0xf6f282(0x19c):_0x33c2e0[_0xf6f282(0x1b9)]===_0xf6f282(0x195)||_0x33c2e0['code']==='EACCES'?_0xf6f282(0x190):_0xf6f282(0x1b5);return _0x296603(failure(_0x29f66d,_0x52b017,_0x33c2e0['shortMessage']??_0x33c2e0[_0xf6f282(0x18e)]??_0x33c2e0[_0xf6f282(0x1b9)]));}if(_0x33c2e0[_0xf6f282(0x1a5)])return _0x296603(failure(_0xf6f282(0x1ac),_0x52b017,_0xf6f282(0x1a6)+_0x33c2e0[_0xf6f282(0x1a5)]));if(_0x33c2e0[_0xf6f282(0x1a4)]&&_0x52b017===null)return _0x296603(failure('SPAWN_FAILED',_0x52b017,_0x33c2e0[_0xf6f282(0x199)]??_0x33c2e0[_0xf6f282(0x18e)]??_0xf6f282(0x1b2)));if(_0x52b017!==0x0)return _0x296603(failure('CHILD_EXIT_NONZERO',_0x52b017,_0x3476f4||_0x33c2e0[_0xf6f282(0x199)]||_0xf6f282(0x1b3)+(_0x52b017??'unknown')));const _0x516f00=_0x3153a9?.[_0xf6f282(0x1ad)]??resolveGlobalSkillName(_0xfe52ca),_0x34c3c3=_0x516f00?resolveInstalledSkill(_0x516f00,_0x3153a9?.['presence']):undefined,_0x407ce3=_0x3476f4[_0xf6f282(0x1b6)](/Failed to install\s+(\d+)/i);if(_0x407ce3&&Number(_0x407ce3[0x1])>0x0){const _0x25431b='Installer\x20reported\x20'+_0x407ce3[0x1]+'\x20failed\x20target(s)'+(_0x3476f4?':\x0a'+_0x3476f4:'');if(_0x34c3c3?.[_0xf6f282(0x19d)]==='present')return{'ok':!![],'status':0x0,'partialFailure':{'count':Number(_0x407ce3[0x1]),'output':_0x3476f4}};return _0x296603(failure(_0xf6f282(0x1bf),0x0,_0x25431b));}if(_0x516f00&&_0x34c3c3){if(_0x34c3c3[_0xf6f282(0x19d)]==='absent')return _0x296603(failure(_0xf6f282(0x1ab),0x0,'Skill\x20\x22'+_0x516f00+_0xf6f282(0x198)+_0x34c3c3[_0xf6f282(0x1b7)][_0xf6f282(0x1a8)](',\x20')+')'));_0x34c3c3['state']==='unverifiable'&&console[_0xf6f282(0x1a1)](_0xf6f282(0x197)+_0x516f00+_0xf6f282(0x1ba)+_0x34c3c3[_0xf6f282(0x194)]);}return _0x296603({'ok':!![],'status':0x0});}
@@ -1 +1 @@
1
- const a146_0x56fa21=a146_0x2fca;(function(_0x4dc21b,_0x4b9ca8){const _0x1e1127=a146_0x2fca,_0x2ebf29=_0x4dc21b();while(!![]){try{const _0x2bc7a4=-parseInt(_0x1e1127(0x1a2))/0x1*(-parseInt(_0x1e1127(0x1ab))/0x2)+-parseInt(_0x1e1127(0x1a7))/0x3*(parseInt(_0x1e1127(0x19c))/0x4)+-parseInt(_0x1e1127(0x1ac))/0x5+-parseInt(_0x1e1127(0x19d))/0x6+-parseInt(_0x1e1127(0x1a6))/0x7*(-parseInt(_0x1e1127(0x1a3))/0x8)+parseInt(_0x1e1127(0x19b))/0x9+parseInt(_0x1e1127(0x1aa))/0xa;if(_0x2bc7a4===_0x4b9ca8)break;else _0x2ebf29['push'](_0x2ebf29['shift']());}catch(_0x3292f5){_0x2ebf29['push'](_0x2ebf29['shift']());}}}(a146_0x3783,0xeb32a));function a146_0x3783(){const _0x12192d=['.svn','coverage','.turbo','16381539znQlGC','4PWXeYm','9587118lnXMyl','lovrabet.skill.json','build','.DS_Store','dist','11445xBPzrY','7302048gdaRhb','node_modules','SKILL.md','14EmMkrM','5069091EzTzSA','.next','.git','13521680ArloBP','86trphFm','6195330gPVkIA'];a146_0x3783=function(){return _0x12192d;};return a146_0x3783();}function a146_0x2fca(_0xa9c1c0,_0x5416e4){_0xa9c1c0=_0xa9c1c0-0x19a;const _0x378313=a146_0x3783();let _0x2fca3f=_0x378313[_0xa9c1c0];return _0x2fca3f;}export const METADATA_FILE=a146_0x56fa21(0x19e);export const SKILL_FILE=a146_0x56fa21(0x1a5);export const IGNORED_FILE_NAMES=new Set([METADATA_FILE,a146_0x56fa21(0x1a0)]);export const IGNORED_DIR_NAMES=new Set([a146_0x56fa21(0x1a9),'.hg',a146_0x56fa21(0x1ad),a146_0x56fa21(0x1a4),a146_0x56fa21(0x1a8),a146_0x56fa21(0x1a1),a146_0x56fa21(0x19f),a146_0x56fa21(0x1ae),a146_0x56fa21(0x19a),'.cache']);
1
+ function a146_0x2ba5(_0x1bcbe2,_0x4511c2){_0x1bcbe2=_0x1bcbe2-0x163;const _0x15ee53=a146_0x15ee();let _0x2ba596=_0x15ee53[_0x1bcbe2];return _0x2ba596;}const a146_0x49e474=a146_0x2ba5;(function(_0x5f126c,_0x3fec31){const _0x21369d=a146_0x2ba5,_0x5dbbbf=_0x5f126c();while(!![]){try{const _0x4518ca=-parseInt(_0x21369d(0x16e))/0x1*(parseInt(_0x21369d(0x16f))/0x2)+-parseInt(_0x21369d(0x165))/0x3*(parseInt(_0x21369d(0x169))/0x4)+-parseInt(_0x21369d(0x172))/0x5+parseInt(_0x21369d(0x16c))/0x6+parseInt(_0x21369d(0x16d))/0x7*(parseInt(_0x21369d(0x166))/0x8)+-parseInt(_0x21369d(0x167))/0x9+parseInt(_0x21369d(0x170))/0xa;if(_0x4518ca===_0x3fec31)break;else _0x5dbbbf['push'](_0x5dbbbf['shift']());}catch(_0x1aba33){_0x5dbbbf['push'](_0x5dbbbf['shift']());}}}(a146_0x15ee,0x7a0fd));export const METADATA_FILE=a146_0x49e474(0x164);export const SKILL_FILE=a146_0x49e474(0x174);function a146_0x15ee(){const _0x4a5acb=['.next','3025220UBLoEX','.svn','SKILL.md','.cache','build','lovrabet.skill.json','6VIvToQ','4408gcSFZL','2545578wGPvcz','.git','1793552fnSXQl','node_modules','coverage','3437490PKWoCI','5579faMZKp','715083vobuHM','2BGdECP','19876480BTKjHa'];a146_0x15ee=function(){return _0x4a5acb;};return a146_0x15ee();}export const IGNORED_FILE_NAMES=new Set([METADATA_FILE,'.DS_Store']);export const IGNORED_DIR_NAMES=new Set([a146_0x49e474(0x168),'.hg',a146_0x49e474(0x173),a146_0x49e474(0x16a),a146_0x49e474(0x171),'dist',a146_0x49e474(0x163),a146_0x49e474(0x16b),'.turbo',a146_0x49e474(0x175)]);
@@ -1 +1 @@
1
- function a147_0x1994(_0x1a3582,_0x148ca6){_0x1a3582=_0x1a3582-0x17b;const _0xac03a4=a147_0xac03();let _0x1994c5=_0xac03a4[_0x1a3582];return _0x1994c5;}(function(_0x1339ec,_0x5e2b8b){const _0x530081=a147_0x1994,_0xb24a86=_0x1339ec();while(!![]){try{const _0x1482bb=-parseInt(_0x530081(0x183))/0x1*(parseInt(_0x530081(0x187))/0x2)+-parseInt(_0x530081(0x181))/0x3*(-parseInt(_0x530081(0x186))/0x4)+parseInt(_0x530081(0x18c))/0x5*(parseInt(_0x530081(0x17e))/0x6)+parseInt(_0x530081(0x17d))/0x7+parseInt(_0x530081(0x185))/0x8+-parseInt(_0x530081(0x18a))/0x9+parseInt(_0x530081(0x180))/0xa*(-parseInt(_0x530081(0x18d))/0xb);if(_0x1482bb===_0x5e2b8b)break;else _0xb24a86['push'](_0xb24a86['shift']());}catch(_0x45b1b8){_0xb24a86['push'](_0xb24a86['shift']());}}}(a147_0xac03,0x5412f));import{lstatSync,readlinkSync,realpathSync,renameSync,rmSync,writeFileSync}from'node:fs';import{dirname,isAbsolute,resolve,sep}from'node:path';import{CliErrors}from'../../errors.js';import{normalizeSkillRelativePath}from'./local-files.js';export function resolveManagedFilePath(_0x53d8b9,_0x3295a6){const _0x5cc3db=a147_0x1994,_0x32d876=normalizeSkillRelativePath(_0x3295a6),_0x3a0f70=realOrResolved(_0x53d8b9),_0x13a17d=resolve(_0x3a0f70,..._0x32d876[_0x5cc3db(0x184)]('/'));if(!isPathInside(_0x13a17d,_0x3a0f70))throw CliErrors['validation']('Unsafe\x20Skill\x20file\x20path:\x20'+_0x3295a6);return ensureNoSymlinkInManagedPath(_0x3a0f70,_0x32d876),_0x13a17d;}export function ensureNoSymlinkInManagedPath(_0x134e2d,_0x336844){const _0x55c0c5=a147_0x1994;let _0x712910=_0x134e2d;for(const _0x2ab148 of _0x336844[_0x55c0c5(0x184)]('/')){_0x712910=resolve(_0x712910,_0x2ab148);const _0x900b49=lstatIfPresent(_0x712910);if(_0x900b49?.['isSymbolicLink']())throw CliErrors[_0x55c0c5(0x188)](_0x55c0c5(0x182)+_0x336844);}}export function isDanglingSymlink(_0x9585c9){const _0x35ba4d=a147_0x1994;try{return lstatSync(_0x9585c9)[_0x35ba4d(0x189)]();}catch{return![];}}export function resolveSymlinkTarget(_0x440561){const _0x214071=readlinkSync(_0x440561);return isAbsolute(_0x214071)?_0x214071:resolve(dirname(_0x440561),_0x214071);}export function isPathInside(_0x18eaf8,_0x2ead10){const _0x553228=a147_0x1994,_0x44bb4=_0x18eaf8[_0x553228(0x17f)](sep)?_0x18eaf8:''+_0x18eaf8+sep,_0x41c028=_0x2ead10[_0x553228(0x17f)](sep)?_0x2ead10:''+_0x2ead10+sep;return _0x18eaf8===_0x2ead10||_0x44bb4['startsWith'](_0x41c028);}export function realOrResolved(_0x15b319){try{return realpathSync(_0x15b319);}catch{return resolve(_0x15b319);}}export function lstatIfPresent(_0x2b47d8){try{return lstatSync(_0x2b47d8);}catch{return undefined;}}export function writeTextAtomic(_0x363f53,_0x4c7ed1,_0x5b4223){const _0x1857dc=a147_0x1994;writeBytesAtomic(_0x363f53,Buffer[_0x1857dc(0x18b)](_0x4c7ed1,_0x1857dc(0x17c)),_0x5b4223);}function a147_0xac03(){const _0x1980fc=['40818hNgmTG','endsWith','20lqbrNV','117kPQVGL','Refusing\x20to\x20write\x20through\x20Skill\x20symlink\x20path:\x20','1907CBbbDn','split','4820648DWVFlY','52128xrtNgJ','166QDRWEJ','validation','isSymbolicLink','2011311XXQPkB','from','30yPyutr','3433892xEeGpQ','.tmp','stringify','utf8','1391768vOJaVf'];a147_0xac03=function(){return _0x1980fc;};return a147_0xac03();}export function writeBytesAtomic(_0x5f4a9f,_0x368e4d,_0x15c1ea){const _0x39e274=a147_0x1994,_0x2a9ba7=_0x5f4a9f+_0x39e274(0x18e);try{writeFileSync(_0x2a9ba7,_0x368e4d,{'mode':_0x15c1ea}),renameSync(_0x2a9ba7,_0x5f4a9f);}catch(_0x1ed788){try{rmSync(_0x2a9ba7,{'force':!![]});}catch{}throw _0x1ed788;}}export function writeJsonAtomic(_0x29d984,_0x3162ca){const _0x4b3ad2=a147_0x1994;writeTextAtomic(_0x29d984,JSON[_0x4b3ad2(0x17b)](_0x3162ca,null,0x2)+'\x0a',0x180);}
1
+ function a147_0x5345(_0x41bf7a,_0x2fe0c2){_0x41bf7a=_0x41bf7a-0x1ed;const _0x36eff6=a147_0x36ef();let _0x534590=_0x36eff6[_0x41bf7a];return _0x534590;}(function(_0x1a1f1b,_0x472c56){const _0x903495=a147_0x5345,_0x102f13=_0x1a1f1b();while(!![]){try{const _0x2dc48b=parseInt(_0x903495(0x1f8))/0x1+parseInt(_0x903495(0x1ed))/0x2+-parseInt(_0x903495(0x1f5))/0x3*(parseInt(_0x903495(0x1ef))/0x4)+-parseInt(_0x903495(0x1f7))/0x5+-parseInt(_0x903495(0x1fb))/0x6+-parseInt(_0x903495(0x1fc))/0x7+parseInt(_0x903495(0x1f2))/0x8;if(_0x2dc48b===_0x472c56)break;else _0x102f13['push'](_0x102f13['shift']());}catch(_0x240737){_0x102f13['push'](_0x102f13['shift']());}}}(a147_0x36ef,0x2dcf6));import{lstatSync,readlinkSync,realpathSync,renameSync,rmSync,writeFileSync}from'node:fs';import{dirname,isAbsolute,resolve,sep}from'node:path';function a147_0x36ef(){const _0xa8faeb=['isSymbolicLink','1464ImqJmL','endsWith','1202555uXaaSn','279420XyiJhB','split','Refusing\x20to\x20write\x20through\x20Skill\x20symlink\x20path:\x20','883032CDimtA','1013733WTgCpT','from','217566aClXeb','startsWith','3004FVYayv','stringify','utf8','5587400GYfRas','validation'];a147_0x36ef=function(){return _0xa8faeb;};return a147_0x36ef();}import{CliErrors}from'../../errors.js';import{normalizeSkillRelativePath}from'./local-files.js';export function resolveManagedFilePath(_0x7cc857,_0x29e6d6){const _0x222085=a147_0x5345,_0x19db83=normalizeSkillRelativePath(_0x29e6d6),_0xb2ecab=realOrResolved(_0x7cc857),_0xbe3a81=resolve(_0xb2ecab,..._0x19db83['split']('/'));if(!isPathInside(_0xbe3a81,_0xb2ecab))throw CliErrors[_0x222085(0x1f3)]('Unsafe\x20Skill\x20file\x20path:\x20'+_0x29e6d6);return ensureNoSymlinkInManagedPath(_0xb2ecab,_0x19db83),_0xbe3a81;}export function ensureNoSymlinkInManagedPath(_0x4b0e7b,_0x5662f8){const _0x5e6213=a147_0x5345;let _0x5eeac5=_0x4b0e7b;for(const _0x1902f8 of _0x5662f8[_0x5e6213(0x1f9)]('/')){_0x5eeac5=resolve(_0x5eeac5,_0x1902f8);const _0x149d93=lstatIfPresent(_0x5eeac5);if(_0x149d93?.[_0x5e6213(0x1f4)]())throw CliErrors[_0x5e6213(0x1f3)](_0x5e6213(0x1fa)+_0x5662f8);}}export function isDanglingSymlink(_0x2ee6c9){const _0x47d5b6=a147_0x5345;try{return lstatSync(_0x2ee6c9)[_0x47d5b6(0x1f4)]();}catch{return![];}}export function resolveSymlinkTarget(_0xbe5c7){const _0x4817c0=readlinkSync(_0xbe5c7);return isAbsolute(_0x4817c0)?_0x4817c0:resolve(dirname(_0xbe5c7),_0x4817c0);}export function isPathInside(_0x225948,_0x417b84){const _0x357084=a147_0x5345,_0x35bdef=_0x225948[_0x357084(0x1f6)](sep)?_0x225948:''+_0x225948+sep,_0x557f07=_0x417b84[_0x357084(0x1f6)](sep)?_0x417b84:''+_0x417b84+sep;return _0x225948===_0x417b84||_0x35bdef[_0x357084(0x1ee)](_0x557f07);}export function realOrResolved(_0x8ef6bf){try{return realpathSync(_0x8ef6bf);}catch{return resolve(_0x8ef6bf);}}export function lstatIfPresent(_0x29ebfd){try{return lstatSync(_0x29ebfd);}catch{return undefined;}}export function writeTextAtomic(_0xc2db98,_0x149037,_0x1915cb){const _0x140f23=a147_0x5345;writeBytesAtomic(_0xc2db98,Buffer[_0x140f23(0x1fd)](_0x149037,_0x140f23(0x1f1)),_0x1915cb);}export function writeBytesAtomic(_0x28faf8,_0x1189a5,_0x3bacce){const _0x34d98f=_0x28faf8+'.tmp';try{writeFileSync(_0x34d98f,_0x1189a5,{'mode':_0x3bacce}),renameSync(_0x34d98f,_0x28faf8);}catch(_0x7cf6ac){try{rmSync(_0x34d98f,{'force':!![]});}catch{}throw _0x7cf6ac;}}export function writeJsonAtomic(_0x4b4f6b,_0x3ecdf0){const _0x4382a1=a147_0x5345;writeTextAtomic(_0x4b4f6b,JSON[_0x4382a1(0x1f0)](_0x3ecdf0,null,0x2)+'\x0a',0x180);}
@@ -1 +1 @@
1
- (function(_0x233b42,_0x188ca0){const _0x5a8871=a148_0x5f34,_0x4314b6=_0x233b42();while(!![]){try{const _0x31d454=-parseInt(_0x5a8871(0xab))/0x1+parseInt(_0x5a8871(0xb5))/0x2*(parseInt(_0x5a8871(0xaf))/0x3)+-parseInt(_0x5a8871(0xb0))/0x4*(parseInt(_0x5a8871(0xaa))/0x5)+parseInt(_0x5a8871(0xb7))/0x6*(-parseInt(_0x5a8871(0xac))/0x7)+parseInt(_0x5a8871(0xb3))/0x8+-parseInt(_0x5a8871(0xb2))/0x9+parseInt(_0x5a8871(0xb9))/0xa*(parseInt(_0x5a8871(0xad))/0xb);if(_0x31d454===_0x188ca0)break;else _0x4314b6['push'](_0x4314b6['shift']());}catch(_0x266114){_0x4314b6['push'](_0x4314b6['shift']());}}}(a148_0x387f,0xa3216));import{createHash}from'node:crypto';import{fileContent,normalizeManifestFiles}from'./local-files.js';function a148_0x5f34(_0x3ea7fe,_0x34addb){_0x3ea7fe=_0x3ea7fe-0xaa;const _0x387fac=a148_0x387f();let _0x5f3474=_0x387fac[_0x3ea7fe];return _0x5f3474;}export function contentHash(_0x4b4b5f){const _0x58137d=a148_0x5f34;return createHash(_0x58137d(0xb4))['update'](_0x4b4b5f)[_0x58137d(0xb1)](_0x58137d(0xb6));}export function fileHash(_0x112837){return bufferSha256(fileContent(_0x112837));}function a148_0x387f(){const _0x415389=['223134pMOhFP','4hiLmxg','digest','11800620ObFUAO','6383144XPNMVA','sha256','28lxQJur','hex','1567476DwYfFM','size','70buqaNx','3777290keKbWW','513293LLYMXX','21DdrpqY','3445618LQAwsV','update'];a148_0x387f=function(){return _0x415389;};return a148_0x387f();}export function bufferSha256(_0x4b4884){const _0xd15e1a=a148_0x5f34;return createHash(_0xd15e1a(0xb4))[_0xd15e1a(0xae)](_0x4b4884)[_0xd15e1a(0xb1)]('hex');}export function fileTreeHash(_0x1f01bd){const _0x4c9765=a148_0x5f34,_0x4c6bd1=createHash(_0x4c9765(0xb4));for(const _0x41803c of normalizeManifestFiles(_0x1f01bd)){_0x4c6bd1[_0x4c9765(0xae)](_0x41803c['path']),_0x4c6bd1[_0x4c9765(0xae)]('\x00'),_0x4c6bd1[_0x4c9765(0xae)](_0x41803c['sha256']),_0x4c6bd1['update']('\x00'),_0x4c6bd1['update'](String(_0x41803c[_0x4c9765(0xb8)])),_0x4c6bd1[_0x4c9765(0xae)]('\x00');}return _0x4c6bd1[_0x4c9765(0xb1)](_0x4c9765(0xb6));}
1
+ (function(_0x5aa887,_0x119e37){const _0x3f1bbe=a148_0x51b2,_0x625c28=_0x5aa887();while(!![]){try{const _0x2bbec2=parseInt(_0x3f1bbe(0x98))/0x1*(parseInt(_0x3f1bbe(0x9f))/0x2)+-parseInt(_0x3f1bbe(0xa4))/0x3+-parseInt(_0x3f1bbe(0x99))/0x4+-parseInt(_0x3f1bbe(0x9e))/0x5+-parseInt(_0x3f1bbe(0xa0))/0x6*(-parseInt(_0x3f1bbe(0x9c))/0x7)+parseInt(_0x3f1bbe(0x9b))/0x8+-parseInt(_0x3f1bbe(0x9d))/0x9;if(_0x2bbec2===_0x119e37)break;else _0x625c28['push'](_0x625c28['shift']());}catch(_0x5183d4){_0x625c28['push'](_0x625c28['shift']());}}}(a148_0xd478,0x84519));import{createHash}from'node:crypto';import{fileContent,normalizeManifestFiles}from'./local-files.js';export function contentHash(_0x18621d){const _0x452659=a148_0x51b2;return createHash(_0x452659(0xa3))[_0x452659(0x97)](_0x18621d)[_0x452659(0xa1)]('hex');}export function fileHash(_0x375051){return bufferSha256(fileContent(_0x375051));}function a148_0xd478(){const _0x3feef6=['111805KdOjhi','38OgjbxV','774UkykFi','digest','size','sha256','558918RalWto','update','44586lCWltV','3460840Qczjno','hex','1472392PBFUIJ','34531aRyWGn','465174PDUFIp'];a148_0xd478=function(){return _0x3feef6;};return a148_0xd478();}function a148_0x51b2(_0x507381,_0x444422){_0x507381=_0x507381-0x97;const _0xd47865=a148_0xd478();let _0x51b21d=_0xd47865[_0x507381];return _0x51b21d;}export function bufferSha256(_0x3dc01e){const _0x25a021=a148_0x51b2;return createHash(_0x25a021(0xa3))[_0x25a021(0x97)](_0x3dc01e)['digest'](_0x25a021(0x9a));}export function fileTreeHash(_0x5704ba){const _0x1cbd80=a148_0x51b2,_0x1d5a78=createHash(_0x1cbd80(0xa3));for(const _0x10e704 of normalizeManifestFiles(_0x5704ba)){_0x1d5a78[_0x1cbd80(0x97)](_0x10e704['path']),_0x1d5a78[_0x1cbd80(0x97)]('\x00'),_0x1d5a78['update'](_0x10e704[_0x1cbd80(0xa3)]),_0x1d5a78['update']('\x00'),_0x1d5a78['update'](String(_0x10e704[_0x1cbd80(0xa2)])),_0x1d5a78[_0x1cbd80(0x97)]('\x00');}return _0x1d5a78[_0x1cbd80(0xa1)](_0x1cbd80(0x9a));}
@@ -1 +1 @@
1
- (function(_0x45cbce,_0x4c3807){const _0x58cc1e=a149_0x5a3c,_0x1eb5c9=_0x45cbce();while(!![]){try{const _0x439f55=parseInt(_0x58cc1e(0xdb))/0x1+-parseInt(_0x58cc1e(0xd8))/0x2*(parseInt(_0x58cc1e(0xdd))/0x3)+parseInt(_0x58cc1e(0xd3))/0x4+-parseInt(_0x58cc1e(0xd4))/0x5*(parseInt(_0x58cc1e(0xd6))/0x6)+parseInt(_0x58cc1e(0xe0))/0x7+-parseInt(_0x58cc1e(0xd2))/0x8*(-parseInt(_0x58cc1e(0xde))/0x9)+parseInt(_0x58cc1e(0xd9))/0xa;if(_0x439f55===_0x4c3807)break;else _0x1eb5c9['push'](_0x1eb5c9['shift']());}catch(_0x17416c){_0x1eb5c9['push'](_0x1eb5c9['shift']());}}}(a149_0x1724,0x8df66));import{resolve}from'node:path';function a149_0x5a3c(_0x1a4e7c,_0x29f025){_0x1a4e7c=_0x1a4e7c-0xd2;const _0x172476=a149_0x1724();let _0x5a3c59=_0x172476[_0x1a4e7c];return _0x5a3c59;}function a149_0x1724(){const _0x3fd40e=['freeze','4036896tAhLgl','cwd','990680fmUhcF','8261500KSSwdS','skills','151929HfRRjt','managedRoot','6ZssFor','18XekpPl','project','762895LWJIEU','appCode','3226616kLAhir','1405024fMUVkt','5ZgRrTQ'];a149_0x1724=function(){return _0x3fd40e;};return a149_0x1724();}import{resolveSkillSyncPaths,runtimeAgentSkillRoots,safePathSegment}from'./paths.js';export function resolveRuntimeSkillInstallTarget(_0xc73e5c,_0x2c670f='global',_0x5d64a2={}){const _0x47826f=a149_0x5a3c,_0x1d7988=resolveSkillSyncPaths(_0x5d64a2),_0x3cea24=safePathSegment(_0xc73e5c,_0x47826f(0xe1)),_0x26dd98=_0x2c670f===_0x47826f(0xdf)?[resolve(_0x5d64a2[_0x47826f(0xd7)]??process[_0x47826f(0xd7)](),'.agents',_0x47826f(0xda))]:runtimeAgentSkillRoots(_0x1d7988);return Object[_0x47826f(0xd5)]({'scope':_0x2c670f,'appCode':_0x3cea24,'skillRoots':Object[_0x47826f(0xd5)](_0x26dd98),'managedRoot':_0x1d7988[_0x47826f(0xdc)]});}
1
+ const a149_0x20ce8f=a149_0x4c37;function a149_0x4c37(_0x4b0982,_0x533310){_0x4b0982=_0x4b0982-0x17b;const _0x529c94=a149_0x529c();let _0x4c37d6=_0x529c94[_0x4b0982];return _0x4c37d6;}(function(_0x150b92,_0x5345ec){const _0x29f7fe=a149_0x4c37,_0x1ae5a3=_0x150b92();while(!![]){try{const _0x2e30ee=parseInt(_0x29f7fe(0x180))/0x1+-parseInt(_0x29f7fe(0x185))/0x2*(parseInt(_0x29f7fe(0x181))/0x3)+parseInt(_0x29f7fe(0x17f))/0x4*(parseInt(_0x29f7fe(0x184))/0x5)+-parseInt(_0x29f7fe(0x189))/0x6*(parseInt(_0x29f7fe(0x183))/0x7)+parseInt(_0x29f7fe(0x17d))/0x8*(parseInt(_0x29f7fe(0x17b))/0x9)+-parseInt(_0x29f7fe(0x17c))/0xa*(-parseInt(_0x29f7fe(0x18a))/0xb)+-parseInt(_0x29f7fe(0x182))/0xc;if(_0x2e30ee===_0x5345ec)break;else _0x1ae5a3['push'](_0x1ae5a3['shift']());}catch(_0xc5b989){_0x1ae5a3['push'](_0x1ae5a3['shift']());}}}(a149_0x529c,0x42558));import{resolve}from'node:path';import{resolveSkillSyncPaths,runtimeAgentSkillRoots,safePathSegment}from'./paths.js';export function resolveRuntimeSkillInstallTarget(_0x16e3ce,_0x5b22e4=a149_0x20ce8f(0x18b),_0x2e93a8={}){const _0x494869=a149_0x20ce8f,_0x50890d=resolveSkillSyncPaths(_0x2e93a8),_0x128cac=safePathSegment(_0x16e3ce,_0x494869(0x188)),_0x5cecbd=_0x5b22e4==='project'?[resolve(_0x2e93a8[_0x494869(0x186)]??process[_0x494869(0x186)](),_0x494869(0x17e),_0x494869(0x187))]:runtimeAgentSkillRoots(_0x50890d);return Object['freeze']({'scope':_0x5b22e4,'appCode':_0x128cac,'skillRoots':Object['freeze'](_0x5cecbd),'managedRoot':_0x50890d[_0x494869(0x18c)]});}function a149_0x529c(){const _0x20e9c6=['5EJfElm','27472BnfkdM','cwd','skills','appCode','598626DIWarq','27291YxWYTd','global','managedRoot','45mkAkKZ','410ahzVxk','217656pZcPix','.agents','1614136hpdnOw','305730WnOpQh','48SfIwtA','3071976FVarJt','14gEWCCt'];a149_0x529c=function(){return _0x20e9c6;};return a149_0x529c();}
@@ -1 +1 @@
1
- const a150_0x2e9264=a150_0x29fb;(function(_0x5e1feb,_0xd4f0e7){const _0x418787=a150_0x29fb,_0x52108b=_0x5e1feb();while(!![]){try{const _0x18e4b0=parseInt(_0x418787(0x1f5))/0x1*(-parseInt(_0x418787(0x1d3))/0x2)+parseInt(_0x418787(0x1d7))/0x3+parseInt(_0x418787(0x1cf))/0x4+parseInt(_0x418787(0x1e7))/0x5+-parseInt(_0x418787(0x1d1))/0x6*(parseInt(_0x418787(0x1ed))/0x7)+-parseInt(_0x418787(0x1d8))/0x8+-parseInt(_0x418787(0x1e6))/0x9*(-parseInt(_0x418787(0x1ce))/0xa);if(_0x18e4b0===_0xd4f0e7)break;else _0x52108b['push'](_0x52108b['shift']());}catch(_0x43aba3){_0x52108b['push'](_0x52108b['shift']());}}}(a150_0x3ade,0xc9874));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import a150_0x5889c4 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}=a150_0x5889c4,RESERVED_PROJECT_SKILL_CODES=new Set(['lovrabet',a150_0x2e9264(0x1de),a150_0x2e9264(0x1e2)]);export function linkEffectiveRuntimeSkills(_0x22a5cd,_0x556bee){const _0x1a2189=a150_0x2e9264,_0x504efe=new Map();for(const _0x5bfabb of _0x22a5cd){const _0xd90e5c=_0x5bfabb['skill'][_0x1a2189(0x1db)];if(!_0xd90e5c)continue;const _0x17171a=_0x504efe[_0x1a2189(0x1cd)](_0xd90e5c);(!_0x17171a||_0x5bfabb[_0x1a2189(0x1f1)]==='personal')&&_0x504efe['set'](_0xd90e5c,_0x5bfabb);}const _0x2f271c=[];for(const _0x3a543c of _0x504efe[_0x1a2189(0x1f9)]()){const _0x535a3e=requireSkillCode(_0x3a543c[_0x1a2189(0x1d6)]),_0x29e0c3=readMetadataIfPresent(_0x3a543c['metadataPath']);if(_0x29e0c3?.[_0x1a2189(0x1fe)]!==_0x556bee[_0x1a2189(0x1fe)]||_0x29e0c3[_0x1a2189(0x1db)]!==_0x535a3e)throw CliErrors[_0x1a2189(0x1da)](_0x1a2189(0x1ca)+_0x556bee[_0x1a2189(0x1fe)]+':\x20'+_0x3a543c[_0x1a2189(0x1f4)]);const _0x49ab68=runtimeSkillLinkName(_0x556bee,_0x535a3e);for(const _0x2b4942 of _0x556bee[_0x1a2189(0x1fb)]){_0x2f271c[_0x1a2189(0x1fc)](ensureManagedSymlink(resolve(_0x2b4942,_0x49ab68),_0x3a543c[_0x1a2189(0x1c8)],_0x556bee,_0x535a3e));}}return _0x2f271c;}function a150_0x29fb(_0x1de2c4,_0x40863f){_0x1de2c4=_0x1de2c4-0x1c8;const _0x3adefe=a150_0x3ade();let _0x29fb82=_0x3adefe[_0x1de2c4];return _0x29fb82;}export function pruneStaleRuntimeSkillLinks(_0xa1f1a6,_0x11f277,_0x3ea669){const _0x177c0e=a150_0x2e9264,_0x596351=new Set([..._0x11f277][_0x177c0e(0x1f2)](_0xddae22=>_0xddae22['trim']())[_0x177c0e(0x1ea)](Boolean)),_0x4f4acf=_0x3ea669?new Set([..._0x3ea669]['map'](_0x11ca12=>_0x11ca12[_0x177c0e(0x1f8)]())[_0x177c0e(0x1ea)](Boolean)):undefined,_0xb66f5e=[];for(const _0x3b2f62 of _0xa1f1a6[_0x177c0e(0x1fb)]){for(const _0x5d6ea5 of managedTargetSkillLinkPaths(_0x3b2f62,_0xa1f1a6)){const _0x310a2a=runtimeSkillCodeFromLink(_0xa1f1a6,_0x5d6ea5);if(_0x4f4acf&&!_0x4f4acf[_0x177c0e(0x1eb)](_0x310a2a))continue;if(_0x596351['has'](_0x310a2a))continue;_0xb66f5e[_0x177c0e(0x1fc)](removeManagedSkillLink(_0x5d6ea5,_0xa1f1a6,_0x310a2a));}}return _0xb66f5e;}export function pruneStaleRuntimeSkillCache(_0x149e8f,_0x1fd500={}){const _0x431402=a150_0x2e9264,_0x436a68=new Set([..._0x149e8f[_0x431402(0x1ff)]]['map'](_0x504eb7=>_0x504eb7[_0x431402(0x1f8)]())[_0x431402(0x1ea)](Boolean)),_0x1888ec=_0x149e8f['pruneSkillCodes']?new Set([..._0x149e8f[_0x431402(0x1f3)]][_0x431402(0x1f2)](_0x280ed0=>_0x280ed0['trim']())[_0x431402(0x1ea)](Boolean)):undefined,_0x30f67f=_0x149e8f[_0x431402(0x1d5)]??[_0x431402(0x1d2),_0x431402(0x203)],_0x28754f=resolve(getRuntimeSkillCacheRoot(_0x149e8f[_0x431402(0x1ee)],_0x149e8f['accessKey'],_0x1fd500),safePathSegment(_0x149e8f[_0x431402(0x1fe)],_0x431402(0x1fe))),_0x4c0bd5=[];for(const _0x1ac19c of _0x30f67f){const _0x41b99d=resolve(_0x28754f,_0x1ac19c);if(!existsSync(_0x41b99d))continue;for(const _0x21c68b of readdirSync(_0x41b99d,{'withFileTypes':!![]})){if(!_0x21c68b[_0x431402(0x1e3)]())continue;const _0xeae2f9=_0x21c68b['name'];if(_0x1888ec&&!_0x1888ec['has'](_0xeae2f9))continue;if(_0x436a68[_0x431402(0x1eb)](_0xeae2f9))continue;const _0x446ca9=resolve(_0x41b99d,_0xeae2f9),_0x17d00a=readMetadataIfPresent(resolve(_0x446ca9,METADATA_FILE));if(_0x17d00a?.[_0x431402(0x1fe)]!==_0x149e8f[_0x431402(0x1fe)]||_0x17d00a['scope']!==_0x1ac19c||_0x17d00a[_0x431402(0x1db)]!==_0xeae2f9){_0x4c0bd5['push']({'path':_0x446ca9,'action':'skipped','reason':'metadata-mismatch'});continue;}if(isLinkedFromAnyRoot(_0x446ca9,_0x149e8f[_0x431402(0x1e0)]??[])){_0x4c0bd5[_0x431402(0x1fc)]({'path':_0x446ca9,'action':_0x431402(0x1e5),'reason':'linked-from-protected-root'});continue;}removeSync(_0x446ca9),_0x4c0bd5[_0x431402(0x1fc)]({'path':_0x446ca9,'action':_0x431402(0x1cc)});}}return _0x4c0bd5;}export function linkGlobalRuntimeSkills(_0x3d2f3d,_0x336649={}){const _0x13defe=a150_0x2e9264,_0x35384f=resolveSkillSyncPaths(_0x336649),_0x6fe247=[];for(const _0xacbbe6 of _0x3d2f3d){if(_0xacbbe6[_0x13defe(0x1f1)]!==_0x13defe(0x200))throw CliErrors[_0x13defe(0x1da)](_0x13defe(0x1d0)+_0xacbbe6['scope']);const _0x16019b=requireSkillCode(_0xacbbe6[_0x13defe(0x1d6)]),_0x5345fe=copyManagedSkillDirectory(_0xacbbe6[_0x13defe(0x1c8)],resolve(_0x35384f[_0x13defe(0x1f7)],_0x16019b));_0x6fe247[_0x13defe(0x1fc)]({..._0x5345fe,'contentHash':_0xacbbe6[_0x13defe(0x1e9)]});}return _0x6fe247;}function ensureManagedSymlink(_0x46ad2e,_0x2a3a8f,_0x32deb8,_0x41534d){const _0x158d01=a150_0x2e9264;mkdirSync(dirname(_0x46ad2e),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x46ad2e)||isDanglingSymlink(_0x46ad2e)){const _0x5ac2c3=lstatSync(_0x46ad2e);if(!_0x5ac2c3[_0x158d01(0x1e4)]())throw CliErrors[_0x158d01(0x1da)](_0x158d01(0x1dd)+_0x46ad2e);const _0x26b81f=resolveSymlinkTarget(_0x46ad2e);if(!isPathInside(realOrResolved(_0x26b81f),realOrResolved(_0x32deb8[_0x158d01(0x1df)])))throw CliErrors[_0x158d01(0x1da)](_0x158d01(0x202)+_0x46ad2e);if(realOrResolved(_0x26b81f)===realOrResolved(_0x2a3a8f))return{'path':_0x46ad2e,'target':_0x2a3a8f,'action':'unchanged'};const _0x44e8ca=readMetadataIfPresent(resolve(_0x26b81f,METADATA_FILE));if(_0x32deb8['scope']===_0x158d01(0x1ef)&&(_0x44e8ca?.[_0x158d01(0x1fe)]!==_0x32deb8['appCode']||_0x44e8ca[_0x158d01(0x1db)]!==_0x41534d))throw CliErrors[_0x158d01(0x1da)](_0x158d01(0x1d4)+_0x46ad2e);return unlinkSync(_0x46ad2e),symlinkSync(_0x2a3a8f,_0x46ad2e,_0x158d01(0x1c8)),{'path':_0x46ad2e,'target':_0x2a3a8f,'action':_0x158d01(0x1dc)};}return symlinkSync(_0x2a3a8f,_0x46ad2e,_0x158d01(0x1c8)),{'path':_0x46ad2e,'target':_0x2a3a8f,'action':'created'};}function managedTargetSkillLinkPaths(_0x39bcaf,_0x1206a8){const _0x22570f=a150_0x2e9264;if(!existsSync(_0x39bcaf))return[];const _0x39d821=_0x1206a8[_0x22570f(0x1fe)]+'--';return readdirSync(_0x39bcaf,{'withFileTypes':!![]})[_0x22570f(0x1ea)](_0xb00555=>_0x1206a8[_0x22570f(0x1f1)]==='project'||_0xb00555[_0x22570f(0x1cb)][_0x22570f(0x1fd)](_0x39d821))['map'](_0x233147=>resolve(_0x39bcaf,_0x233147['name']));}function removeManagedSkillLink(_0xff8eb4,_0x421500,_0x5ae907){const _0x2734e6=a150_0x2e9264,_0x47a3f0=lstatIfPresent(_0xff8eb4);if(!_0x47a3f0?.['isSymbolicLink']())return{'path':_0xff8eb4,'action':_0x2734e6(0x1e5),'reason':'not-managed-symlink'};const _0x554b04=resolveSymlinkTarget(_0xff8eb4);if(!isPathInside(realOrResolved(_0x554b04),realOrResolved(_0x421500['managedRoot'])))return{'path':_0xff8eb4,'action':_0x2734e6(0x1e5),'reason':'external-symlink'};const _0x5b8e29=readMetadataIfPresent(resolve(_0x554b04,METADATA_FILE));if(_0x421500[_0x2734e6(0x1f1)]===_0x2734e6(0x1ef)&&(_0x5b8e29?.['appCode']!==_0x421500[_0x2734e6(0x1fe)]||_0x5b8e29[_0x2734e6(0x1db)]!==_0x5ae907))return{'path':_0xff8eb4,'action':_0x2734e6(0x1e5),'reason':_0x2734e6(0x1f0)};return unlinkSync(_0xff8eb4),{'path':_0xff8eb4,'action':_0x2734e6(0x1cc)};}function isLinkedFromAnyRoot(_0x4d3c22,_0x1e4c5f){const _0x495551=a150_0x2e9264,_0x5ac9ab=realOrResolved(_0x4d3c22);for(const _0x554ab8 of _0x1e4c5f){if(!existsSync(_0x554ab8))continue;for(const _0x346406 of readdirSync(_0x554ab8,{'withFileTypes':!![]})){if(!_0x346406['isSymbolicLink']())continue;const _0x5600c3=resolve(_0x554ab8,_0x346406[_0x495551(0x1cb)]);if(realOrResolved(resolveSymlinkTarget(_0x5600c3))===_0x5ac9ab)return!![];}}return![];}function a150_0x3ade(){const _0x8d7cb3=['Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20','runtime-observe','managedRoot','protectedLinkRoots','length','secret-retriever','isDirectory','isSymbolicLink','skipped','14103HQXOgi','1203450UPfqLy','Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20','contentHash','filter','has','Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20','117005yqKqbk','env','project','metadata-mismatch','scope','map','pruneSkillCodes','metadataPath','9265znrKmc','slice','agentsSkillsDir','trim','values','Refusing\x20to\x20copy\x20Skill\x20symlink:\x20','skillRoots','push','startsWith','appCode','activeSkillCodes','builtin','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20','Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20','company','dir','Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20','Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20','name','removed','get','10510wwbCSy','5077168tDKRHa','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','426xoVNCM','personal','122xIlmVP','Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20','scopes','skill','1183698XBTPxM','7792600qmRLMa','created','validation','skillCode','updated'];a150_0x3ade=function(){return _0x8d7cb3;};return a150_0x3ade();}function runtimeSkillLinkName(_0x400310,_0x13208){const _0xd125ac=a150_0x2e9264,_0x2e7fac=safePathSegment(_0x13208,'skillCode');if(_0x400310['scope']===_0xd125ac(0x1ef)&&RESERVED_PROJECT_SKILL_CODES[_0xd125ac(0x1eb)](_0x2e7fac))throw CliErrors['validation'](_0xd125ac(0x1ec)+_0x2e7fac);return _0x400310['scope']===_0xd125ac(0x1ef)?_0x2e7fac:_0x400310['appCode']+'--'+_0x2e7fac;}function runtimeSkillCodeFromLink(_0x5e32b7,_0x244292){const _0x2a1ffc=a150_0x2e9264,_0x3169a3=basename(_0x244292);return _0x5e32b7['scope']===_0x2a1ffc(0x1ef)?_0x3169a3:_0x3169a3[_0x2a1ffc(0x1f6)]((_0x5e32b7[_0x2a1ffc(0x1fe)]+'--')[_0x2a1ffc(0x1e1)]);}export function copyManagedSkillDirectory(_0x4453ad,_0x5249ef){const _0x2c640d=a150_0x2e9264,_0x1f6516=resolve(_0x5249ef,METADATA_FILE),_0x59705e=existsSync(_0x5249ef);if(_0x59705e){const _0x452359=lstatSync(_0x5249ef);if(_0x452359[_0x2c640d(0x1e4)]())throw CliErrors[_0x2c640d(0x1da)](_0x2c640d(0x1c9)+_0x5249ef);if(!_0x452359[_0x2c640d(0x1e3)]())throw CliErrors[_0x2c640d(0x1da)](_0x2c640d(0x1e8)+_0x5249ef);const _0x5ab618=readMetadataIfPresent(_0x1f6516);if(_0x5ab618?.[_0x2c640d(0x1f1)]!==_0x2c640d(0x200))throw CliErrors['validation'](_0x2c640d(0x201)+_0x5249ef);}ensureDirSync(dirname(_0x5249ef));const _0x495cf4=_0x59705e?readMetadataIfPresent(_0x1f6516)?.[_0x2c640d(0x1e9)]:undefined,_0x232622=readMetadataIfPresent(resolve(_0x4453ad,METADATA_FILE))?.['contentHash'];return _0x59705e&&removeSync(_0x5249ef),copySkillDirectory(_0x4453ad,_0x5249ef),{'path':_0x5249ef,'target':_0x4453ad,'action':!_0x59705e?_0x2c640d(0x1d9):_0x495cf4===_0x232622?'unchanged':_0x2c640d(0x1dc)};}function copySkillDirectory(_0xc8073b,_0x93ae97){copySync(_0xc8073b,_0x93ae97,{'dereference':![],'overwrite':!![],'filter'(_0x3ddf4b){const _0x47cd21=a150_0x29fb;if(lstatSync(_0x3ddf4b)[_0x47cd21(0x1e4)]())throw CliErrors[_0x47cd21(0x1da)](_0x47cd21(0x1fa)+_0x3ddf4b);return!![];}});}
1
+ function a150_0x129e(_0x31ed2b,_0x150bd1){_0x31ed2b=_0x31ed2b-0x73;const _0x71b9cd=a150_0x71b9();let _0x129ee3=_0x71b9cd[_0x31ed2b];return _0x129ee3;}const a150_0x5e53cf=a150_0x129e;(function(_0x3695f3,_0x3073b5){const _0x2ed0dc=a150_0x129e,_0x2cc945=_0x3695f3();while(!![]){try{const _0x54d9fa=-parseInt(_0x2ed0dc(0xa7))/0x1+-parseInt(_0x2ed0dc(0x8b))/0x2*(-parseInt(_0x2ed0dc(0xad))/0x3)+parseInt(_0x2ed0dc(0xa8))/0x4*(-parseInt(_0x2ed0dc(0x9a))/0x5)+parseInt(_0x2ed0dc(0x98))/0x6+-parseInt(_0x2ed0dc(0x79))/0x7+parseInt(_0x2ed0dc(0xa3))/0x8+parseInt(_0x2ed0dc(0x93))/0x9;if(_0x54d9fa===_0x3073b5)break;else _0x2cc945['push'](_0x2cc945['shift']());}catch(_0x4f847d){_0x2cc945['push'](_0x2cc945['shift']());}}}(a150_0x71b9,0x442b5));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import a150_0x51c6ba 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}=a150_0x51c6ba,RESERVED_PROJECT_SKILL_CODES=new Set([a150_0x5e53cf(0xaa),'runtime-observe','secret-retriever']);export function linkEffectiveRuntimeSkills(_0x1a8038,_0x1fe487){const _0x746d7f=a150_0x5e53cf,_0xc6cf92=new Map();for(const _0x569db0 of _0x1a8038){const _0x19605e=_0x569db0[_0x746d7f(0xa5)][_0x746d7f(0xa1)];if(!_0x19605e)continue;const _0xdd3be2=_0xc6cf92[_0x746d7f(0x99)](_0x19605e);(!_0xdd3be2||_0x569db0[_0x746d7f(0x77)]==='personal')&&_0xc6cf92[_0x746d7f(0xa9)](_0x19605e,_0x569db0);}const _0x5bd7bd=[];for(const _0x207920 of _0xc6cf92[_0x746d7f(0x94)]()){const _0x390cfa=requireSkillCode(_0x207920[_0x746d7f(0xa5)]),_0x70339c=readMetadataIfPresent(_0x207920['metadataPath']);if(_0x70339c?.[_0x746d7f(0x9f)]!==_0x1fe487['appCode']||_0x70339c[_0x746d7f(0xa1)]!==_0x390cfa)throw CliErrors[_0x746d7f(0x86)]('Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20'+_0x1fe487['appCode']+':\x20'+_0x207920[_0x746d7f(0x7a)]);const _0x599983=runtimeSkillLinkName(_0x1fe487,_0x390cfa);for(const _0x10ded4 of _0x1fe487[_0x746d7f(0x9c)]){_0x5bd7bd[_0x746d7f(0x88)](ensureManagedSymlink(resolve(_0x10ded4,_0x599983),_0x207920[_0x746d7f(0x89)],_0x1fe487,_0x390cfa));}}return _0x5bd7bd;}export function pruneStaleRuntimeSkillLinks(_0x35601f,_0x4d5bdc,_0xf962ba){const _0x3e443e=a150_0x5e53cf,_0x592d07=new Set([..._0x4d5bdc]['map'](_0x214670=>_0x214670['trim']())['filter'](Boolean)),_0x120709=_0xf962ba?new Set([..._0xf962ba][_0x3e443e(0x83)](_0x3e7fae=>_0x3e7fae[_0x3e443e(0x7e)]())['filter'](Boolean)):undefined,_0x3821c4=[];for(const _0x158980 of _0x35601f[_0x3e443e(0x9c)]){for(const _0x359122 of managedTargetSkillLinkPaths(_0x158980,_0x35601f)){const _0x222b7c=runtimeSkillCodeFromLink(_0x35601f,_0x359122);if(_0x120709&&!_0x120709[_0x3e443e(0x8d)](_0x222b7c))continue;if(_0x592d07[_0x3e443e(0x8d)](_0x222b7c))continue;_0x3821c4[_0x3e443e(0x88)](removeManagedSkillLink(_0x359122,_0x35601f,_0x222b7c));}}return _0x3821c4;}export function pruneStaleRuntimeSkillCache(_0x33b0ea,_0x3e385c={}){const _0x4ad17a=a150_0x5e53cf,_0x41a931=new Set([..._0x33b0ea['activeSkillCodes']][_0x4ad17a(0x83)](_0x16ab00=>_0x16ab00[_0x4ad17a(0x7e)]())[_0x4ad17a(0x9e)](Boolean)),_0x11a125=_0x33b0ea[_0x4ad17a(0x91)]?new Set([..._0x33b0ea[_0x4ad17a(0x91)]][_0x4ad17a(0x83)](_0x6417e2=>_0x6417e2[_0x4ad17a(0x7e)]())[_0x4ad17a(0x9e)](Boolean)):undefined,_0x14431c=_0x33b0ea['scopes']??[_0x4ad17a(0x7f),_0x4ad17a(0xa4)],_0x1155b8=resolve(getRuntimeSkillCacheRoot(_0x33b0ea[_0x4ad17a(0x87)],_0x33b0ea[_0x4ad17a(0x8c)],_0x3e385c),safePathSegment(_0x33b0ea[_0x4ad17a(0x9f)],_0x4ad17a(0x9f))),_0xf1dd77=[];for(const _0x216c8c of _0x14431c){const _0x3db252=resolve(_0x1155b8,_0x216c8c);if(!existsSync(_0x3db252))continue;for(const _0x1341c0 of readdirSync(_0x3db252,{'withFileTypes':!![]})){if(!_0x1341c0['isDirectory']())continue;const _0x260bdd=_0x1341c0['name'];if(_0x11a125&&!_0x11a125[_0x4ad17a(0x8d)](_0x260bdd))continue;if(_0x41a931[_0x4ad17a(0x8d)](_0x260bdd))continue;const _0x3fecbe=resolve(_0x3db252,_0x260bdd),_0x2562de=readMetadataIfPresent(resolve(_0x3fecbe,METADATA_FILE));if(_0x2562de?.['appCode']!==_0x33b0ea[_0x4ad17a(0x9f)]||_0x2562de['scope']!==_0x216c8c||_0x2562de[_0x4ad17a(0xa1)]!==_0x260bdd){_0xf1dd77[_0x4ad17a(0x88)]({'path':_0x3fecbe,'action':_0x4ad17a(0x90),'reason':_0x4ad17a(0x76)});continue;}if(isLinkedFromAnyRoot(_0x3fecbe,_0x33b0ea[_0x4ad17a(0x73)]??[])){_0xf1dd77['push']({'path':_0x3fecbe,'action':_0x4ad17a(0x90),'reason':_0x4ad17a(0x9b)});continue;}removeSync(_0x3fecbe),_0xf1dd77[_0x4ad17a(0x88)]({'path':_0x3fecbe,'action':_0x4ad17a(0x75)});}}return _0xf1dd77;}export function linkGlobalRuntimeSkills(_0xc7477b,_0x49b36e={}){const _0x2348bb=a150_0x5e53cf,_0x452ce7=resolveSkillSyncPaths(_0x49b36e),_0x45d86c=[];for(const _0x48b852 of _0xc7477b){if(_0x48b852[_0x2348bb(0x77)]!==_0x2348bb(0x92))throw CliErrors[_0x2348bb(0x86)](_0x2348bb(0xac)+_0x48b852[_0x2348bb(0x77)]);const _0x38b843=requireSkillCode(_0x48b852[_0x2348bb(0xa5)]),_0x1b1ab9=copyManagedSkillDirectory(_0x48b852[_0x2348bb(0x89)],resolve(_0x452ce7[_0x2348bb(0x97)],_0x38b843));_0x45d86c['push']({..._0x1b1ab9,'contentHash':_0x48b852[_0x2348bb(0x8e)]});}return _0x45d86c;}function ensureManagedSymlink(_0x416a53,_0x46ba5b,_0x1db66d,_0x184245){const _0x36426e=a150_0x5e53cf;mkdirSync(dirname(_0x416a53),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x416a53)||isDanglingSymlink(_0x416a53)){const _0x40b2f4=lstatSync(_0x416a53);if(!_0x40b2f4[_0x36426e(0x80)]())throw CliErrors[_0x36426e(0x86)](_0x36426e(0x7c)+_0x416a53);const _0x369182=resolveSymlinkTarget(_0x416a53);if(!isPathInside(realOrResolved(_0x369182),realOrResolved(_0x1db66d[_0x36426e(0x85)])))throw CliErrors['validation'](_0x36426e(0x9d)+_0x416a53);if(realOrResolved(_0x369182)===realOrResolved(_0x46ba5b))return{'path':_0x416a53,'target':_0x46ba5b,'action':_0x36426e(0xa2)};const _0xe0950e=readMetadataIfPresent(resolve(_0x369182,METADATA_FILE));if(_0x1db66d['scope']===_0x36426e(0x95)&&(_0xe0950e?.[_0x36426e(0x9f)]!==_0x1db66d[_0x36426e(0x9f)]||_0xe0950e['skillCode']!==_0x184245))throw CliErrors[_0x36426e(0x86)](_0x36426e(0x78)+_0x416a53);return unlinkSync(_0x416a53),symlinkSync(_0x46ba5b,_0x416a53,_0x36426e(0x89)),{'path':_0x416a53,'target':_0x46ba5b,'action':_0x36426e(0x84)};}return symlinkSync(_0x46ba5b,_0x416a53,'dir'),{'path':_0x416a53,'target':_0x46ba5b,'action':_0x36426e(0xab)};}function managedTargetSkillLinkPaths(_0x563bd7,_0x346dd2){const _0x3cd64f=a150_0x5e53cf;if(!existsSync(_0x563bd7))return[];const _0x20b369=_0x346dd2[_0x3cd64f(0x9f)]+'--';return readdirSync(_0x563bd7,{'withFileTypes':!![]})[_0x3cd64f(0x9e)](_0x5d3619=>_0x346dd2[_0x3cd64f(0x77)]===_0x3cd64f(0x95)||_0x5d3619['name'][_0x3cd64f(0x74)](_0x20b369))[_0x3cd64f(0x83)](_0xb6a79f=>resolve(_0x563bd7,_0xb6a79f[_0x3cd64f(0x82)]));}function removeManagedSkillLink(_0x5407df,_0x2ffdd8,_0x39ed6b){const _0x4ab44b=a150_0x5e53cf,_0x23256a=lstatIfPresent(_0x5407df);if(!_0x23256a?.[_0x4ab44b(0x80)]())return{'path':_0x5407df,'action':'skipped','reason':_0x4ab44b(0x7b)};const _0x4da80b=resolveSymlinkTarget(_0x5407df);if(!isPathInside(realOrResolved(_0x4da80b),realOrResolved(_0x2ffdd8[_0x4ab44b(0x85)])))return{'path':_0x5407df,'action':_0x4ab44b(0x90),'reason':'external-symlink'};const _0x4a6f17=readMetadataIfPresent(resolve(_0x4da80b,METADATA_FILE));if(_0x2ffdd8[_0x4ab44b(0x77)]===_0x4ab44b(0x95)&&(_0x4a6f17?.[_0x4ab44b(0x9f)]!==_0x2ffdd8['appCode']||_0x4a6f17[_0x4ab44b(0xa1)]!==_0x39ed6b))return{'path':_0x5407df,'action':_0x4ab44b(0x90),'reason':_0x4ab44b(0x76)};return unlinkSync(_0x5407df),{'path':_0x5407df,'action':_0x4ab44b(0x75)};}function isLinkedFromAnyRoot(_0x5d359c,_0x21db66){const _0x5b7548=a150_0x5e53cf,_0x355dd1=realOrResolved(_0x5d359c);for(const _0x3f2e6d of _0x21db66){if(!existsSync(_0x3f2e6d))continue;for(const _0xfb812e of readdirSync(_0x3f2e6d,{'withFileTypes':!![]})){if(!_0xfb812e[_0x5b7548(0x80)]())continue;const _0x178638=resolve(_0x3f2e6d,_0xfb812e[_0x5b7548(0x82)]);if(realOrResolved(resolveSymlinkTarget(_0x178638))===_0x355dd1)return!![];}}return![];}function runtimeSkillLinkName(_0x169ada,_0x47ac12){const _0xf61f4c=a150_0x5e53cf,_0x1175a9=safePathSegment(_0x47ac12,_0xf61f4c(0xa1));if(_0x169ada[_0xf61f4c(0x77)]===_0xf61f4c(0x95)&&RESERVED_PROJECT_SKILL_CODES['has'](_0x1175a9))throw CliErrors[_0xf61f4c(0x86)](_0xf61f4c(0xa0)+_0x1175a9);return _0x169ada[_0xf61f4c(0x77)]==='project'?_0x1175a9:_0x169ada[_0xf61f4c(0x9f)]+'--'+_0x1175a9;}function a150_0x71b9(){const _0x3a29c7=['appCode','Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20','skillCode','unchanged','1543688JLOOeV','company','skill','Refusing\x20to\x20copy\x20Skill\x20symlink:\x20','226262dTmipA','289924FIxlbS','set','lovrabet','created','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','360CAiJVS','isDirectory','protectedLinkRoots','startsWith','removed','metadata-mismatch','scope','Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20','2958228yNHtyq','metadataPath','not-managed-symlink','Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20','trim','personal','isSymbolicLink','Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20','name','map','updated','managedRoot','validation','env','push','dir','Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20','6060ZRjlSN','accessKey','has','contentHash','length','skipped','pruneSkillCodes','builtin','1509390GnOGPm','values','project','slice','agentsSkillsDir','1657782hOClwa','get','5LNsbfb','linked-from-protected-root','skillRoots','Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20','filter'];a150_0x71b9=function(){return _0x3a29c7;};return a150_0x71b9();}function runtimeSkillCodeFromLink(_0x2ac5e9,_0x32c237){const _0x7a348b=a150_0x5e53cf,_0x1395ba=basename(_0x32c237);return _0x2ac5e9[_0x7a348b(0x77)]==='project'?_0x1395ba:_0x1395ba[_0x7a348b(0x96)]((_0x2ac5e9['appCode']+'--')[_0x7a348b(0x8f)]);}export function copyManagedSkillDirectory(_0x52a753,_0x389f30){const _0x2088f8=a150_0x5e53cf,_0x5118e0=resolve(_0x389f30,METADATA_FILE),_0x1ab6f5=existsSync(_0x389f30);if(_0x1ab6f5){const _0x17274d=lstatSync(_0x389f30);if(_0x17274d[_0x2088f8(0x80)]())throw CliErrors[_0x2088f8(0x86)](_0x2088f8(0x8a)+_0x389f30);if(!_0x17274d[_0x2088f8(0xae)]())throw CliErrors[_0x2088f8(0x86)](_0x2088f8(0x81)+_0x389f30);const _0x459d2f=readMetadataIfPresent(_0x5118e0);if(_0x459d2f?.[_0x2088f8(0x77)]!==_0x2088f8(0x92))throw CliErrors[_0x2088f8(0x86)](_0x2088f8(0x7d)+_0x389f30);}ensureDirSync(dirname(_0x389f30));const _0x4ee5df=_0x1ab6f5?readMetadataIfPresent(_0x5118e0)?.[_0x2088f8(0x8e)]:undefined,_0x3bebaf=readMetadataIfPresent(resolve(_0x52a753,METADATA_FILE))?.[_0x2088f8(0x8e)];return _0x1ab6f5&&removeSync(_0x389f30),copySkillDirectory(_0x52a753,_0x389f30),{'path':_0x389f30,'target':_0x52a753,'action':!_0x1ab6f5?_0x2088f8(0xab):_0x4ee5df===_0x3bebaf?_0x2088f8(0xa2):_0x2088f8(0x84)};}function copySkillDirectory(_0x15c090,_0x384db5){copySync(_0x15c090,_0x384db5,{'dereference':![],'overwrite':!![],'filter'(_0x30bc67){const _0x48da94=a150_0x129e;if(lstatSync(_0x30bc67)[_0x48da94(0x80)]())throw CliErrors[_0x48da94(0x86)](_0x48da94(0xa6)+_0x30bc67);return!![];}});}
@@ -1 +1 @@
1
- (function(_0x53154f,_0xefa137){const _0x386c84=a151_0x49df,_0x4ea4f9=_0x53154f();while(!![]){try{const _0xd4611d=parseInt(_0x386c84(0x17c))/0x1*(parseInt(_0x386c84(0x165))/0x2)+-parseInt(_0x386c84(0x176))/0x3+parseInt(_0x386c84(0x15f))/0x4+parseInt(_0x386c84(0x185))/0x5*(-parseInt(_0x386c84(0x186))/0x6)+parseInt(_0x386c84(0x175))/0x7+parseInt(_0x386c84(0x17e))/0x8+parseInt(_0x386c84(0x174))/0x9*(-parseInt(_0x386c84(0x17d))/0xa);if(_0xd4611d===_0xefa137)break;else _0x4ea4f9['push'](_0x4ea4f9['shift']());}catch(_0x1d5b1e){_0x4ea4f9['push'](_0x4ea4f9['shift']());}}}(a151_0x1737,0xaace7));import{existsSync,readdirSync}from'node:fs';import{resolve}from'node:path';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{readMetadataIfPresent}from'./metadata.js';import{getRuntimeSkillCacheRoot,safePathSegment}from'./paths.js';function a151_0x1737(){const _0x3dbb54=['filter','get','name','set','project','370715aDTbSm','66LEEBRu','scopes','source','appCode','isDirectory','map','3032228EzDdpE','scope','linkedPaths','trim','tags','accessKey','2QwxtFD','cacheDir','has','metadataPath','skillCode','push','Runtime\x20Skill\x20install\x20target\x20app\x20mismatch:\x20','includes','code','values','dir','isArray','isSymbolicLink','linkedPath','from','509931LhcFhY','7637224VulzdT','3220533hucExp','local','cache','\x20!=\x20','sort','localeCompare','988221ZQyqbo','180HsWkKH','6170072nsEOel','link'];a151_0x1737=function(){return _0x3dbb54;};return a151_0x1737();}import{isRuntimeSkillScope,normalizeRuntimeSkillScopes}from'./scopes.js';export function listLocalRuntimeSkills(_0x11d17a,_0x5acb17,_0x4e092f={}){const _0xdafd27=a151_0x49df,_0x3dc7d8=safePathSegment(_0x11d17a[_0xdafd27(0x189)],_0xdafd27(0x189));if(_0x5acb17[_0xdafd27(0x189)]!==_0x3dc7d8)throw CliErrors['validation'](_0xdafd27(0x16b)+_0x5acb17[_0xdafd27(0x189)]+_0xdafd27(0x179)+_0x3dc7d8);const _0x24abb6=normalizeRuntimeSkillScopes(_0x11d17a['scopes']),_0x2b1be1=new Set(_0x24abb6),_0x355afa=_0x11d17a['code']?.[_0xdafd27(0x162)](),_0x23155d=new Map(),_0x14dc37=resolve(getRuntimeSkillCacheRoot(_0x11d17a['env'],_0x11d17a[_0xdafd27(0x164)],_0x4e092f),_0x3dc7d8);for(const _0x39f637 of _0x24abb6){for(const _0x30f152 of localSkillEntryDirs(resolve(_0x14dc37,_0x39f637))){collectLocalRuntimeSkill(_0x23155d,_0x30f152,{'appCode':_0x3dc7d8,'scopes':_0x2b1be1,'code':_0x355afa,'source':'cache'});}}for(const _0x2025d6 of _0x5acb17['skillRoots']){for(const _0x5ee767 of localSkillLinkCandidates(_0x2025d6,_0x5acb17,_0x2b1be1)){collectLocalRuntimeSkill(_0x23155d,_0x5ee767,{'appCode':_0x3dc7d8,'scopes':_0x2b1be1,'code':_0x355afa,'source':_0xdafd27(0x17f),'linkedPath':_0x5ee767});}}return Array[_0xdafd27(0x173)](_0x23155d[_0xdafd27(0x16e)]())[_0xdafd27(0x17a)](compareLocalRuntimeSkills);}function localSkillEntryDirs(_0x4e38db){const _0x2e81db=a151_0x49df;if(!existsSync(_0x4e38db))return[];return readdirSync(_0x4e38db,{'withFileTypes':!![]})[_0x2e81db(0x180)](_0x1097e1=>_0x1097e1[_0x2e81db(0x18a)]()||_0x1097e1[_0x2e81db(0x171)]())[_0x2e81db(0x18b)](_0x3fcd74=>resolve(_0x4e38db,_0x3fcd74[_0x2e81db(0x182)]));}function a151_0x49df(_0x2d8337,_0x177c40){_0x2d8337=_0x2d8337-0x15f;const _0x1737a7=a151_0x1737();let _0x49df97=_0x1737a7[_0x2d8337];return _0x49df97;}function localSkillLinkCandidates(_0x51ddde,_0x4f3b6e,_0x40cfd8){const _0x5c28b7=a151_0x49df;if(!existsSync(_0x51ddde))return[];const _0x10c60e=_0x4f3b6e[_0x5c28b7(0x189)]+'--';return readdirSync(_0x51ddde,{'withFileTypes':!![]})[_0x5c28b7(0x180)](_0x307891=>_0x307891[_0x5c28b7(0x18a)]()||_0x307891['isSymbolicLink']())[_0x5c28b7(0x180)](_0xae4e93=>_0x4f3b6e[_0x5c28b7(0x160)]===_0x5c28b7(0x184)||_0xae4e93[_0x5c28b7(0x182)]['startsWith'](_0x10c60e)||_0x40cfd8[_0x5c28b7(0x167)]('builtin'))[_0x5c28b7(0x18b)](_0x12f3b4=>resolve(_0x51ddde,_0x12f3b4[_0x5c28b7(0x182)]));}function collectLocalRuntimeSkill(_0x13760d,_0x3c62a7,_0x36278a){const _0x18332b=a151_0x49df,_0x64b6fd=resolve(_0x3c62a7,METADATA_FILE),_0x2ec8be=readMetadataIfPresent(_0x64b6fd);if(!_0x2ec8be)return;if(_0x2ec8be[_0x18332b(0x189)]!==_0x36278a['appCode'])return;if(!isRuntimeSkillScope(_0x2ec8be[_0x18332b(0x160)])||!_0x36278a[_0x18332b(0x187)][_0x18332b(0x167)](_0x2ec8be[_0x18332b(0x160)]))return;const _0x4951cd=_0x2ec8be['skillCode']?.[_0x18332b(0x162)]();if(!_0x4951cd)return;if(_0x36278a[_0x18332b(0x16d)]&&_0x4951cd!==_0x36278a[_0x18332b(0x16d)])return;const _0x3bbcb8=_0x2ec8be[_0x18332b(0x160)]+':'+_0x4951cd,_0x673df3=_0x36278a[_0x18332b(0x172)]?[_0x36278a['linkedPath']]:[],_0x10cdc6=_0x13760d[_0x18332b(0x181)](_0x3bbcb8);if(_0x10cdc6){_0x36278a[_0x18332b(0x188)]==='cache'&&(_0x10cdc6[_0x18332b(0x16f)]=_0x3c62a7,_0x10cdc6[_0x18332b(0x166)]=_0x3c62a7,_0x10cdc6['skillMdPath']=resolve(_0x3c62a7,SKILL_FILE),_0x10cdc6[_0x18332b(0x168)]=_0x64b6fd);for(const _0x18e9aa of _0x673df3){!_0x10cdc6['linkedPaths'][_0x18332b(0x16c)](_0x18e9aa)&&_0x10cdc6[_0x18332b(0x161)][_0x18332b(0x16a)](_0x18e9aa);}_0x10cdc6[_0x18332b(0x161)][_0x18332b(0x17a)]();return;}_0x13760d[_0x18332b(0x183)](_0x3bbcb8,{..._0x2ec8be,'tags':Array[_0x18332b(0x170)](_0x2ec8be[_0x18332b(0x163)])?_0x2ec8be['tags']:[],'scope':_0x2ec8be['scope'],'source':_0x18332b(0x177),'dir':_0x3c62a7,'cacheDir':_0x36278a[_0x18332b(0x188)]===_0x18332b(0x178)?_0x3c62a7:undefined,'skillMdPath':resolve(_0x3c62a7,SKILL_FILE),'metadataPath':_0x64b6fd,'linkedPaths':_0x673df3});}function compareLocalRuntimeSkills(_0x287ea7,_0x54e3c4){const _0x4ed96a=a151_0x49df,_0x5a3aae={'personal':0x0,'company':0x1,'builtin':0x2};return _0x5a3aae[_0x287ea7[_0x4ed96a(0x160)]]-_0x5a3aae[_0x54e3c4[_0x4ed96a(0x160)]]||_0x287ea7[_0x4ed96a(0x169)][_0x4ed96a(0x17b)](_0x54e3c4['skillCode'])||_0x287ea7[_0x4ed96a(0x16f)][_0x4ed96a(0x17b)](_0x54e3c4[_0x4ed96a(0x16f)]);}
1
+ (function(_0xaf4997,_0x32a7d3){const _0x20529a=a151_0x5501,_0x3760a0=_0xaf4997();while(!![]){try{const _0x58dc9=parseInt(_0x20529a(0xaf))/0x1*(parseInt(_0x20529a(0xa1))/0x2)+-parseInt(_0x20529a(0xb4))/0x3+-parseInt(_0x20529a(0xc0))/0x4+parseInt(_0x20529a(0xbd))/0x5+parseInt(_0x20529a(0xa4))/0x6*(-parseInt(_0x20529a(0xa5))/0x7)+parseInt(_0x20529a(0x9f))/0x8+parseInt(_0x20529a(0xab))/0x9;if(_0x58dc9===_0x32a7d3)break;else _0x3760a0['push'](_0x3760a0['shift']());}catch(_0x4dcb6b){_0x3760a0['push'](_0x3760a0['shift']());}}}(a151_0x5419,0xbc0d7));import{existsSync,readdirSync}from'node:fs';import{resolve}from'node:path';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{readMetadataIfPresent}from'./metadata.js';import{getRuntimeSkillCacheRoot,safePathSegment}from'./paths.js';import{isRuntimeSkillScope,normalizeRuntimeSkillScopes}from'./scopes.js';function a151_0x5419(){const _0x5b4137=['isArray','link','code','dir','validation','from','2093250lPEyCj','localeCompare','skillCode','1359812lEEmjB','isDirectory','cacheDir','sort','startsWith','has','env','linkedPaths','project','values','3698448ranlBv','scopes','1495174OpmVIz','filter','Runtime\x20Skill\x20install\x20target\x20app\x20mismatch:\x20','1077486kbNTNr','49bhAzSW','appCode','get','isSymbolicLink','scope','name','20202507kMstHg','linkedPath','local','skillMdPath','1ReKzPm','trim','cache','source','map','4517949KkyJbJ','tags','accessKey'];a151_0x5419=function(){return _0x5b4137;};return a151_0x5419();}function a151_0x5501(_0x14e6c4,_0x5c6bad){_0x14e6c4=_0x14e6c4-0x9c;const _0x5419ba=a151_0x5419();let _0x5501ef=_0x5419ba[_0x14e6c4];return _0x5501ef;}export function listLocalRuntimeSkills(_0xf13914,_0x1bbee2,_0x112489={}){const _0x86ff5=a151_0x5501,_0x42b0f1=safePathSegment(_0xf13914[_0x86ff5(0xa6)],_0x86ff5(0xa6));if(_0x1bbee2[_0x86ff5(0xa6)]!==_0x42b0f1)throw CliErrors[_0x86ff5(0xbb)](_0x86ff5(0xa3)+_0x1bbee2[_0x86ff5(0xa6)]+'\x20!=\x20'+_0x42b0f1);const _0x182bc6=normalizeRuntimeSkillScopes(_0xf13914[_0x86ff5(0xa0)]),_0x591694=new Set(_0x182bc6),_0x3faf8c=_0xf13914[_0x86ff5(0xb9)]?.[_0x86ff5(0xb0)](),_0x473688=new Map(),_0x42683f=resolve(getRuntimeSkillCacheRoot(_0xf13914[_0x86ff5(0xc6)],_0xf13914[_0x86ff5(0xb6)],_0x112489),_0x42b0f1);for(const _0x248981 of _0x182bc6){for(const _0x4ee8d4 of localSkillEntryDirs(resolve(_0x42683f,_0x248981))){collectLocalRuntimeSkill(_0x473688,_0x4ee8d4,{'appCode':_0x42b0f1,'scopes':_0x591694,'code':_0x3faf8c,'source':_0x86ff5(0xb1)});}}for(const _0x5385d4 of _0x1bbee2['skillRoots']){for(const _0x392a13 of localSkillLinkCandidates(_0x5385d4,_0x1bbee2,_0x591694)){collectLocalRuntimeSkill(_0x473688,_0x392a13,{'appCode':_0x42b0f1,'scopes':_0x591694,'code':_0x3faf8c,'source':_0x86ff5(0xb8),'linkedPath':_0x392a13});}}return Array[_0x86ff5(0xbc)](_0x473688[_0x86ff5(0x9e)]())['sort'](compareLocalRuntimeSkills);}function localSkillEntryDirs(_0x318e0f){const _0x23f9a3=a151_0x5501;if(!existsSync(_0x318e0f))return[];return readdirSync(_0x318e0f,{'withFileTypes':!![]})[_0x23f9a3(0xa2)](_0x135b28=>_0x135b28[_0x23f9a3(0xc1)]()||_0x135b28['isSymbolicLink']())[_0x23f9a3(0xb3)](_0x188626=>resolve(_0x318e0f,_0x188626[_0x23f9a3(0xaa)]));}function localSkillLinkCandidates(_0x5ab3ed,_0x5399c3,_0x386863){const _0x14fd1d=a151_0x5501;if(!existsSync(_0x5ab3ed))return[];const _0x59161e=_0x5399c3['appCode']+'--';return readdirSync(_0x5ab3ed,{'withFileTypes':!![]})[_0x14fd1d(0xa2)](_0x5f092f=>_0x5f092f[_0x14fd1d(0xc1)]()||_0x5f092f[_0x14fd1d(0xa8)]())['filter'](_0x1c2cda=>_0x5399c3[_0x14fd1d(0xa9)]===_0x14fd1d(0x9d)||_0x1c2cda[_0x14fd1d(0xaa)][_0x14fd1d(0xc4)](_0x59161e)||_0x386863['has']('builtin'))[_0x14fd1d(0xb3)](_0xde15e9=>resolve(_0x5ab3ed,_0xde15e9['name']));}function collectLocalRuntimeSkill(_0x344458,_0x2e99f0,_0x1f4863){const _0x1f2e97=a151_0x5501,_0x54ed84=resolve(_0x2e99f0,METADATA_FILE),_0x2dbf5c=readMetadataIfPresent(_0x54ed84);if(!_0x2dbf5c)return;if(_0x2dbf5c['appCode']!==_0x1f4863[_0x1f2e97(0xa6)])return;if(!isRuntimeSkillScope(_0x2dbf5c[_0x1f2e97(0xa9)])||!_0x1f4863[_0x1f2e97(0xa0)][_0x1f2e97(0xc5)](_0x2dbf5c[_0x1f2e97(0xa9)]))return;const _0x5c289a=_0x2dbf5c[_0x1f2e97(0xbf)]?.[_0x1f2e97(0xb0)]();if(!_0x5c289a)return;if(_0x1f4863['code']&&_0x5c289a!==_0x1f4863[_0x1f2e97(0xb9)])return;const _0x2f377d=_0x2dbf5c[_0x1f2e97(0xa9)]+':'+_0x5c289a,_0x1b49f9=_0x1f4863[_0x1f2e97(0xac)]?[_0x1f4863[_0x1f2e97(0xac)]]:[],_0x548c41=_0x344458[_0x1f2e97(0xa7)](_0x2f377d);if(_0x548c41){_0x1f4863[_0x1f2e97(0xb2)]===_0x1f2e97(0xb1)&&(_0x548c41[_0x1f2e97(0xba)]=_0x2e99f0,_0x548c41[_0x1f2e97(0xc2)]=_0x2e99f0,_0x548c41[_0x1f2e97(0xae)]=resolve(_0x2e99f0,SKILL_FILE),_0x548c41['metadataPath']=_0x54ed84);for(const _0x1dbdaf of _0x1b49f9){!_0x548c41[_0x1f2e97(0x9c)]['includes'](_0x1dbdaf)&&_0x548c41[_0x1f2e97(0x9c)]['push'](_0x1dbdaf);}_0x548c41[_0x1f2e97(0x9c)][_0x1f2e97(0xc3)]();return;}_0x344458['set'](_0x2f377d,{..._0x2dbf5c,'tags':Array[_0x1f2e97(0xb7)](_0x2dbf5c[_0x1f2e97(0xb5)])?_0x2dbf5c[_0x1f2e97(0xb5)]:[],'scope':_0x2dbf5c[_0x1f2e97(0xa9)],'source':_0x1f2e97(0xad),'dir':_0x2e99f0,'cacheDir':_0x1f4863[_0x1f2e97(0xb2)]===_0x1f2e97(0xb1)?_0x2e99f0:undefined,'skillMdPath':resolve(_0x2e99f0,SKILL_FILE),'metadataPath':_0x54ed84,'linkedPaths':_0x1b49f9});}function compareLocalRuntimeSkills(_0x1df308,_0x555a1a){const _0x158184=a151_0x5501,_0x2e0572={'personal':0x0,'company':0x1,'builtin':0x2};return _0x2e0572[_0x1df308[_0x158184(0xa9)]]-_0x2e0572[_0x555a1a[_0x158184(0xa9)]]||_0x1df308[_0x158184(0xbf)][_0x158184(0xbe)](_0x555a1a['skillCode'])||_0x1df308['dir'][_0x158184(0xbe)](_0x555a1a[_0x158184(0xba)]);}
@@ -1 +1 @@
1
- (function(_0x1b354e,_0x87009b){const _0x4d806a=a152_0x4f5d,_0x3bc3f2=_0x1b354e();while(!![]){try{const _0x13ce99=parseInt(_0x4d806a(0xbe))/0x1*(parseInt(_0x4d806a(0xd6))/0x2)+parseInt(_0x4d806a(0xd8))/0x3+parseInt(_0x4d806a(0xb1))/0x4+-parseInt(_0x4d806a(0xce))/0x5*(-parseInt(_0x4d806a(0xd0))/0x6)+parseInt(_0x4d806a(0xcc))/0x7*(-parseInt(_0x4d806a(0xb7))/0x8)+-parseInt(_0x4d806a(0xc8))/0x9*(parseInt(_0x4d806a(0xb8))/0xa)+parseInt(_0x4d806a(0xb3))/0xb*(-parseInt(_0x4d806a(0xc9))/0xc);if(_0x13ce99===_0x87009b)break;else _0x3bc3f2['push'](_0x3bc3f2['shift']());}catch(_0x13f35e){_0x3bc3f2['push'](_0x3bc3f2['shift']());}}}(a152_0x2eda,0x6c925));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 a152_0x4f5d(_0x315b9a,_0x36add0){_0x315b9a=_0x315b9a-0xae;const _0x2eda84=a152_0x2eda();let _0x4f5dae=_0x2eda84[_0x315b9a];return _0x4f5dae;}export function fileContent(_0x443962){const _0x215379=a152_0x4f5d;return _0x443962[_0x215379(0xd1)]??Buffer[_0x215379(0xcf)](_0x443962[_0x215379(0xd7)]??'',_0x215379(0xba));}export function fileText(_0x4ee274){const _0xd685cc=a152_0x4f5d;return fileContent(_0x4ee274)[_0xd685cc(0xca)](_0xd685cc(0xba));}function a152_0x2eda(){const _0x5a085f=['from','939096KGdtck','bytes','test','isSafeInteger','toLowerCase','push','851718ufhdsc','content','917358OUwZEd','isDirectory','length','add','Duplicate\x20Skill\x20file\x20path:\x20','set','compare','Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20','sha256','path','size','1079596pwhSnq','isSymbolicLink','781EFmCKa','Skill\x20file\x20size\x20is\x20invalid:\x20','string','object','2190984unjFlN','10fCxxfM','excludedFilePaths','utf8','Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20','validation','split','1XqnoqL','name','isFile','values','startsWith','has','includes','Unsafe\x20Skill\x20file\x20path:\x20','trim','sort','2407869FoLtDF','108420SGGXnQ','toString','isArray','7hXNNzw','Skill\x20file\x20path\x20must\x20be\x20text.','20bOcEnA'];a152_0x2eda=function(){return _0x5a085f;};return a152_0x2eda();}export function normalizeLocalFiles(_0x354cfb){const _0x5e7b8b=a152_0x4f5d;if(!Array[_0x5e7b8b(0xcb)](_0x354cfb)||_0x354cfb['length']===0x0)return[];const _0x482f26=new Map();for(const _0x3d3f43 of _0x354cfb){if(!_0x3d3f43||typeof _0x3d3f43!==_0x5e7b8b(0xb6)||typeof _0x3d3f43[_0x5e7b8b(0xaf)]!==_0x5e7b8b(0xb5))throw CliErrors[_0x5e7b8b(0xbc)]('Skill\x20file\x20path\x20must\x20be\x20text.');const _0x296202=normalizeSkillRelativePath(_0x3d3f43[_0x5e7b8b(0xaf)]);if(_0x482f26[_0x5e7b8b(0xc3)](_0x296202))throw CliErrors[_0x5e7b8b(0xbc)](_0x5e7b8b(0xdc)+_0x296202);if(_0x3d3f43[_0x5e7b8b(0xd1)]!==undefined&&!Buffer['isBuffer'](_0x3d3f43['bytes']))throw CliErrors[_0x5e7b8b(0xbc)](_0x5e7b8b(0xbb)+_0x296202);if(_0x3d3f43[_0x5e7b8b(0xd1)]===undefined&&typeof _0x3d3f43['content']!==_0x5e7b8b(0xb5))throw CliErrors['validation'](_0x5e7b8b(0xdf)+_0x296202);const _0x9f44ad=fileContent(_0x3d3f43);_0x482f26[_0x5e7b8b(0xdd)](_0x296202,{'path':_0x296202,'bytes':_0x9f44ad});}return Array['from'](_0x482f26[_0x5e7b8b(0xc1)]())[_0x5e7b8b(0xc7)](compareSkillFiles);}export function normalizeManifestFiles(_0x101368){const _0x37ee5d=a152_0x4f5d;if(!Array[_0x37ee5d(0xcb)](_0x101368)||_0x101368[_0x37ee5d(0xda)]===0x0)return[];const _0x10325a=new Map();for(const _0x51dfe5 of _0x101368){if(!_0x51dfe5||typeof _0x51dfe5!=='object'||typeof _0x51dfe5[_0x37ee5d(0xaf)]!==_0x37ee5d(0xb5))throw CliErrors[_0x37ee5d(0xbc)](_0x37ee5d(0xcd));const _0x259753=normalizeSkillRelativePath(_0x51dfe5[_0x37ee5d(0xaf)]);if(_0x10325a[_0x37ee5d(0xc3)](_0x259753))throw CliErrors[_0x37ee5d(0xbc)](_0x37ee5d(0xdc)+_0x259753);if(!isSha256Hex(_0x51dfe5[_0x37ee5d(0xae)]))throw CliErrors[_0x37ee5d(0xbc)]('Skill\x20file\x20sha256\x20is\x20invalid:\x20'+_0x259753);if(!Number[_0x37ee5d(0xd3)](_0x51dfe5[_0x37ee5d(0xb0)])||_0x51dfe5[_0x37ee5d(0xb0)]<0x0)throw CliErrors[_0x37ee5d(0xbc)](_0x37ee5d(0xb4)+_0x259753);_0x10325a[_0x37ee5d(0xdd)](_0x259753,{'path':_0x259753,'sha256':_0x51dfe5[_0x37ee5d(0xae)][_0x37ee5d(0xd4)](),'size':_0x51dfe5[_0x37ee5d(0xb0)]});}return Array['from'](_0x10325a[_0x37ee5d(0xc1)]())[_0x37ee5d(0xc7)](compareSkillFiles);}export function scanSkillDirectory(_0x385e43,_0x377555={}){const _0x4881b9=a152_0x4f5d,_0x31d722=realpathSync(_0x385e43),_0x3a1570=canonicalExcludedFilePaths(_0x377555[_0x4881b9(0xb9)]),_0x2a41f6=[];function _0x541a10(_0x55fcee){const _0x5c89ec=_0x4881b9,_0x3b39d5=readdirSync(_0x55fcee,{'withFileTypes':!![]})[_0x5c89ec(0xc7)]((_0x17a48c,_0x5e6520)=>_0x17a48c[_0x5c89ec(0xbf)]['localeCompare'](_0x5e6520[_0x5c89ec(0xbf)]));for(const _0x5d505a of _0x3b39d5){if(_0x5d505a[_0x5c89ec(0xd9)]()&&IGNORED_DIR_NAMES[_0x5c89ec(0xc3)](_0x5d505a['name']))continue;if(IGNORED_FILE_NAMES[_0x5c89ec(0xc3)](_0x5d505a[_0x5c89ec(0xbf)]))continue;const _0x351d20=resolve(_0x55fcee,_0x5d505a['name']);if(isExcludedFilePath(_0x351d20,_0x3a1570))continue;if(_0x5d505a[_0x5c89ec(0xb2)]())throw CliErrors[_0x5c89ec(0xbc)]('Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20'+_0x351d20);const _0x4756e5=toPosixPath(relative(_0x31d722,_0x351d20));if(_0x5d505a['isDirectory']()){_0x541a10(_0x351d20);continue;}if(!_0x5d505a[_0x5c89ec(0xc0)]())continue;validateSkillRelativePath(_0x4756e5);const _0x1d85a8=readFileSync(_0x351d20);_0x2a41f6[_0x5c89ec(0xd5)]({'path':_0x4756e5,'bytes':_0x1d85a8});}}return _0x541a10(_0x31d722),normalizeLocalFiles(_0x2a41f6);}function canonicalExcludedFilePaths(_0x24c85b){const _0x17eb32=a152_0x4f5d,_0x511048=new Set();for(const _0xd922d5 of _0x24c85b??[]){const _0x1baffb=resolve(_0xd922d5);_0x511048[_0x17eb32(0xdb)](_0x1baffb);try{_0x511048['add'](realpathSync(_0x1baffb));}catch{}}return _0x511048;}function isExcludedFilePath(_0x456d90,_0x3e6d8e){const _0x1076bf=a152_0x4f5d;if(_0x3e6d8e[_0x1076bf(0xc3)](_0x456d90))return!![];if(_0x3e6d8e['size']===0x0)return![];try{return _0x3e6d8e['has'](realpathSync(_0x456d90));}catch{return![];}}export function compareSkillFiles(_0x5397b5,_0x5d0df5){const _0x427360=a152_0x4f5d;if(_0x5397b5[_0x427360(0xaf)]===SKILL_FILE)return _0x5d0df5[_0x427360(0xaf)]===SKILL_FILE?0x0:-0x1;if(_0x5d0df5[_0x427360(0xaf)]===SKILL_FILE)return 0x1;return Buffer[_0x427360(0xde)](Buffer[_0x427360(0xcf)](_0x5397b5[_0x427360(0xaf)],_0x427360(0xba)),Buffer['from'](_0x5d0df5[_0x427360(0xaf)],_0x427360(0xba)));}export function normalizeSkillRelativePath(_0x2d173f){const _0x400486=a152_0x4f5d,_0x349cbf=toPosixPath(_0x2d173f[_0x400486(0xc6)]());return validateSkillRelativePath(_0x349cbf),_0x349cbf;}export function validateSkillRelativePath(_0x1516eb){const _0x13d2e6=a152_0x4f5d;if(!_0x1516eb||_0x1516eb[_0x13d2e6(0xc2)]('/')||_0x1516eb[_0x13d2e6(0xc4)]('//'))throw CliErrors[_0x13d2e6(0xbc)](_0x13d2e6(0xc5)+_0x1516eb);for(const _0x4a19ef of _0x1516eb[_0x13d2e6(0xbd)]('/')){if(!_0x4a19ef||_0x4a19ef==='.'||_0x4a19ef==='..')throw CliErrors['validation']('Unsafe\x20Skill\x20file\x20path:\x20'+_0x1516eb);}}export function toPosixPath(_0x49b61e){return _0x49b61e['replace'](/\\/g,'/');}export function isSha256Hex(_0x1b959f){const _0x5008ee=a152_0x4f5d;return typeof _0x1b959f===_0x5008ee(0xb5)&&/^[a-fA-F0-9]{64}$/[_0x5008ee(0xd2)](_0x1b959f);}
1
+ function a152_0x52b3(){const _0x36e851=['3126140pBzKpt','3966JRBVyl','localeCompare','isSafeInteger','7663130hmzXab','isFile','string','validation','Skill\x20file\x20path\x20must\x20be\x20text.','length','utf8','Skill\x20file\x20sha256\x20is\x20invalid:\x20','from','26728DelBwX','420YmpYov','Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20','compare','toString','includes','path','Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20','42vERpfc','object','has','isDirectory','content','name','test','replace','isArray','258404ZWTHXA','Unsafe\x20Skill\x20file\x20path:\x20','Duplicate\x20Skill\x20file\x20path:\x20','trim','isBuffer','17989mCGnNs','Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20','add','sha256','push','set','1935SrZZvj','855gWUgal','excludedFilePaths','sort','bytes','size'];a152_0x52b3=function(){return _0x36e851;};return a152_0x52b3();}(function(_0x55b199,_0x1772df){const _0x4adb6f=a152_0x121e,_0x4c8333=_0x55b199();while(!![]){try{const _0x5b2a48=parseInt(_0x4adb6f(0xf4))/0x1*(-parseInt(_0x4adb6f(0xe6))/0x2)+parseInt(_0x4adb6f(0xfb))/0x3+-parseInt(_0x4adb6f(0xef))/0x4+-parseInt(_0x4adb6f(0x100))/0x5+parseInt(_0x4adb6f(0x101))/0x6*(-parseInt(_0x4adb6f(0xdf))/0x7)+parseInt(_0x4adb6f(0xde))/0x8*(parseInt(_0x4adb6f(0xfa))/0x9)+parseInt(_0x4adb6f(0x104))/0xa;if(_0x5b2a48===_0x1772df)break;else _0x4c8333['push'](_0x4c8333['shift']());}catch(_0x3f2a62){_0x4c8333['push'](_0x4c8333['shift']());}}}(a152_0x52b3,0x5c337));function a152_0x121e(_0x320dea,_0x3f4b4a){_0x320dea=_0x320dea-0xd7;const _0x52b3c7=a152_0x52b3();let _0x121e35=_0x52b3c7[_0x320dea];return _0x121e35;}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(_0x48b26c){const _0x4e8d9b=a152_0x121e;return _0x48b26c[_0x4e8d9b(0xfe)]??Buffer['from'](_0x48b26c[_0x4e8d9b(0xea)]??'','utf8');}export function fileText(_0x3a6bb5){const _0x2905f5=a152_0x121e;return fileContent(_0x3a6bb5)[_0x2905f5(0xe2)](_0x2905f5(0xdb));}export function normalizeLocalFiles(_0x294cd7){const _0x4c2865=a152_0x121e;if(!Array[_0x4c2865(0xee)](_0x294cd7)||_0x294cd7[_0x4c2865(0xda)]===0x0)return[];const _0x4f4808=new Map();for(const _0x2f2b50 of _0x294cd7){if(!_0x2f2b50||typeof _0x2f2b50!=='object'||typeof _0x2f2b50[_0x4c2865(0xe4)]!=='string')throw CliErrors[_0x4c2865(0xd8)](_0x4c2865(0xd9));const _0x16c2bb=normalizeSkillRelativePath(_0x2f2b50['path']);if(_0x4f4808[_0x4c2865(0xe8)](_0x16c2bb))throw CliErrors[_0x4c2865(0xd8)](_0x4c2865(0xf1)+_0x16c2bb);if(_0x2f2b50[_0x4c2865(0xfe)]!==undefined&&!Buffer[_0x4c2865(0xf3)](_0x2f2b50[_0x4c2865(0xfe)]))throw CliErrors['validation'](_0x4c2865(0xe5)+_0x16c2bb);if(_0x2f2b50[_0x4c2865(0xfe)]===undefined&&typeof _0x2f2b50[_0x4c2865(0xea)]!==_0x4c2865(0xd7))throw CliErrors[_0x4c2865(0xd8)](_0x4c2865(0xf5)+_0x16c2bb);const _0x25eeec=fileContent(_0x2f2b50);_0x4f4808[_0x4c2865(0xf9)](_0x16c2bb,{'path':_0x16c2bb,'bytes':_0x25eeec});}return Array[_0x4c2865(0xdd)](_0x4f4808['values']())['sort'](compareSkillFiles);}export function normalizeManifestFiles(_0x5317bc){const _0x5d77ea=a152_0x121e;if(!Array[_0x5d77ea(0xee)](_0x5317bc)||_0x5317bc[_0x5d77ea(0xda)]===0x0)return[];const _0x3edefd=new Map();for(const _0x3eed73 of _0x5317bc){if(!_0x3eed73||typeof _0x3eed73!==_0x5d77ea(0xe7)||typeof _0x3eed73['path']!==_0x5d77ea(0xd7))throw CliErrors[_0x5d77ea(0xd8)](_0x5d77ea(0xd9));const _0x193dc3=normalizeSkillRelativePath(_0x3eed73[_0x5d77ea(0xe4)]);if(_0x3edefd[_0x5d77ea(0xe8)](_0x193dc3))throw CliErrors[_0x5d77ea(0xd8)](_0x5d77ea(0xf1)+_0x193dc3);if(!isSha256Hex(_0x3eed73[_0x5d77ea(0xf7)]))throw CliErrors[_0x5d77ea(0xd8)](_0x5d77ea(0xdc)+_0x193dc3);if(!Number[_0x5d77ea(0x103)](_0x3eed73[_0x5d77ea(0xff)])||_0x3eed73[_0x5d77ea(0xff)]<0x0)throw CliErrors[_0x5d77ea(0xd8)]('Skill\x20file\x20size\x20is\x20invalid:\x20'+_0x193dc3);_0x3edefd[_0x5d77ea(0xf9)](_0x193dc3,{'path':_0x193dc3,'sha256':_0x3eed73[_0x5d77ea(0xf7)]['toLowerCase'](),'size':_0x3eed73[_0x5d77ea(0xff)]});}return Array[_0x5d77ea(0xdd)](_0x3edefd['values']())[_0x5d77ea(0xfd)](compareSkillFiles);}export function scanSkillDirectory(_0x5cb862,_0x57810f={}){const _0x2999ac=a152_0x121e,_0x39b442=realpathSync(_0x5cb862),_0x244e97=canonicalExcludedFilePaths(_0x57810f[_0x2999ac(0xfc)]),_0x23da41=[];function _0x109eb7(_0x42cc9f){const _0x49f3fb=_0x2999ac,_0x4323d0=readdirSync(_0x42cc9f,{'withFileTypes':!![]})[_0x49f3fb(0xfd)]((_0x600099,_0x5517e4)=>_0x600099[_0x49f3fb(0xeb)][_0x49f3fb(0x102)](_0x5517e4[_0x49f3fb(0xeb)]));for(const _0x409de3 of _0x4323d0){if(_0x409de3[_0x49f3fb(0xe9)]()&&IGNORED_DIR_NAMES[_0x49f3fb(0xe8)](_0x409de3[_0x49f3fb(0xeb)]))continue;if(IGNORED_FILE_NAMES[_0x49f3fb(0xe8)](_0x409de3['name']))continue;const _0x3e5e03=resolve(_0x42cc9f,_0x409de3[_0x49f3fb(0xeb)]);if(isExcludedFilePath(_0x3e5e03,_0x244e97))continue;if(_0x409de3['isSymbolicLink']())throw CliErrors[_0x49f3fb(0xd8)](_0x49f3fb(0xe0)+_0x3e5e03);const _0xb56167=toPosixPath(relative(_0x39b442,_0x3e5e03));if(_0x409de3['isDirectory']()){_0x109eb7(_0x3e5e03);continue;}if(!_0x409de3[_0x49f3fb(0x105)]())continue;validateSkillRelativePath(_0xb56167);const _0x3a3978=readFileSync(_0x3e5e03);_0x23da41[_0x49f3fb(0xf8)]({'path':_0xb56167,'bytes':_0x3a3978});}}return _0x109eb7(_0x39b442),normalizeLocalFiles(_0x23da41);}function canonicalExcludedFilePaths(_0x2a9a17){const _0x17fe92=a152_0x121e,_0x30616a=new Set();for(const _0x1e444f of _0x2a9a17??[]){const _0x2ac5a8=resolve(_0x1e444f);_0x30616a[_0x17fe92(0xf6)](_0x2ac5a8);try{_0x30616a[_0x17fe92(0xf6)](realpathSync(_0x2ac5a8));}catch{}}return _0x30616a;}function isExcludedFilePath(_0x3e03dd,_0x51616a){const _0x3accf6=a152_0x121e;if(_0x51616a['has'](_0x3e03dd))return!![];if(_0x51616a[_0x3accf6(0xff)]===0x0)return![];try{return _0x51616a[_0x3accf6(0xe8)](realpathSync(_0x3e03dd));}catch{return![];}}export function compareSkillFiles(_0x37945a,_0x2c3fd1){const _0x4b430e=a152_0x121e;if(_0x37945a[_0x4b430e(0xe4)]===SKILL_FILE)return _0x2c3fd1['path']===SKILL_FILE?0x0:-0x1;if(_0x2c3fd1[_0x4b430e(0xe4)]===SKILL_FILE)return 0x1;return Buffer[_0x4b430e(0xe1)](Buffer[_0x4b430e(0xdd)](_0x37945a[_0x4b430e(0xe4)],_0x4b430e(0xdb)),Buffer[_0x4b430e(0xdd)](_0x2c3fd1[_0x4b430e(0xe4)],_0x4b430e(0xdb)));}export function normalizeSkillRelativePath(_0x106960){const _0x5b290f=a152_0x121e,_0x26f98b=toPosixPath(_0x106960[_0x5b290f(0xf2)]());return validateSkillRelativePath(_0x26f98b),_0x26f98b;}export function validateSkillRelativePath(_0x2d8155){const _0x640513=a152_0x121e;if(!_0x2d8155||_0x2d8155['startsWith']('/')||_0x2d8155[_0x640513(0xe3)]('//'))throw CliErrors['validation'](_0x640513(0xf0)+_0x2d8155);for(const _0x2e3613 of _0x2d8155['split']('/')){if(!_0x2e3613||_0x2e3613==='.'||_0x2e3613==='..')throw CliErrors[_0x640513(0xd8)](_0x640513(0xf0)+_0x2d8155);}}export function toPosixPath(_0x11c8d4){const _0x1b66ac=a152_0x121e;return _0x11c8d4[_0x1b66ac(0xed)](/\\/g,'/');}export function isSha256Hex(_0x192f27){const _0x5a9864=a152_0x121e;return typeof _0x192f27==='string'&&/^[a-fA-F0-9]{64}$/[_0x5a9864(0xec)](_0x192f27);}
@@ -1 +1 @@
1
- (function(_0x43907b,_0x37921f){const _0x9896d6=a153_0x2865,_0x30bcd8=_0x43907b();while(!![]){try{const _0x574f53=parseInt(_0x9896d6(0x15e))/0x1*(-parseInt(_0x9896d6(0x131))/0x2)+parseInt(_0x9896d6(0x13a))/0x3*(-parseInt(_0x9896d6(0x151))/0x4)+-parseInt(_0x9896d6(0x15b))/0x5+-parseInt(_0x9896d6(0x132))/0x6*(parseInt(_0x9896d6(0x14a))/0x7)+parseInt(_0x9896d6(0x12d))/0x8+-parseInt(_0x9896d6(0x15f))/0x9*(-parseInt(_0x9896d6(0x153))/0xa)+parseInt(_0x9896d6(0x145))/0xb;if(_0x574f53===_0x37921f)break;else _0x30bcd8['push'](_0x30bcd8['shift']());}catch(_0x32b291){_0x30bcd8['push'](_0x30bcd8['shift']());}}}(a153_0x4eeb,0xb2c44));import{existsSync,lstatSync,mkdirSync,readFileSync,rmSync}from'node:fs';import{dirname,resolve}from'node:path';import{isCollection,isMap,isNode,parseDocument,visit}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{resolveManagedFilePath,writeBytesAtomic,writeJsonAtomic}from'./fs-utils.js';import{bufferSha256,contentHash,fileHash}from'./hashing.js';function a153_0x4eeb(){const _0x2de4c3=['143016ojTYbR','set','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','slice','displayName:\x20','accessKey','skillName','.\x20Changed\x20file:\x20','3czXLRh','validation','replace','example','fileHashes','description:\x20','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','packageBytes','env','status','name:\x20','20968156xrithr','has','errors','hasOwn','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.','28cNLWuR','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','---','Runtime\x20Skill\x20package\x20is\x20missing\x20','version','path','entries','2842624ZEABVh','force','638930eFXbJv','pulledAt','find','test','toString','displayName','utf8','map','6934820HbUSNA','contents','contentHash','15109CbXxJU','189PpRFIS','description','length','skillCode','trim','delete','keys','1527592CvIRDK','appCode','schemaVersion','isFile','68LTHZRa'];a153_0x4eeb=function(){return _0x2de4c3;};return a153_0x4eeb();}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(_0x52e198,_0x25b3de,_0x441180){const _0x372dfc=a153_0x2865,_0x1745f0=requireSkillCode(_0x52e198),_0x251daa=requirePackageBytes(_0x1745f0,_0x441180[_0x372dfc(0x141)]),_0x3a2372=extractDownloadedPackage(_0x251daa),_0x2eb4c3=_0x3a2372[_0x372dfc(0x155)](_0x38128e=>_0x38128e[_0x372dfc(0x14f)]===SKILL_FILE);if(!_0x2eb4c3)throw CliErrors['validation'](_0x372dfc(0x14d)+SKILL_FILE+':\x20'+_0x1745f0);const _0x57fbcc=withMaterializedSkillFrontmatter(_0x3a2372,_0x52e198,_0x1745f0),_0x581e99=_0x57fbcc['find'](_0x2f6007=>_0x2f6007[_0x372dfc(0x14f)]===SKILL_FILE),_0x4de0b2=fileText(_0x581e99),_0x2bcd33=getRuntimeSkillDir(_0x441180[_0x372dfc(0x142)],_0x441180[_0x372dfc(0x137)],_0x441180[_0x372dfc(0x12e)],_0x25b3de,_0x1745f0,_0x441180['paths']),_0x4dc011=resolve(_0x2bcd33,SKILL_FILE),_0x3a833e=resolve(_0x2bcd33,METADATA_FILE),_0x58022b=contentHash(_0x4de0b2),_0x45dc49=readMetadataIfPresent(_0x3a833e)?.['fileHashes'];ensurePulledFilesCanBeOverwritten(_0x2bcd33,_0x3a833e,_0x57fbcc,_0x441180[_0x372dfc(0x152)]===!![]),mkdirSync(_0x2bcd33,{'recursive':!![],'mode':0x1c0});const _0x2c417c=existsSync(_0x4dc011)?readFileSync(_0x4dc011,_0x372dfc(0x159)):undefined;return materializeFiles(_0x2bcd33,_0x57fbcc),removeStaleManagedFiles(_0x2bcd33,_0x45dc49,_0x57fbcc),writeJsonAtomic(_0x3a833e,buildMetadata(_0x52e198,_0x25b3de,_0x441180[_0x372dfc(0x12e)],_0x58022b,_0x441180[_0x372dfc(0x154)],_0x57fbcc,_0x251daa)),{'skill':_0x52e198,'scope':_0x25b3de,'dir':_0x2bcd33,'skillMdPath':_0x4dc011,'metadataPath':_0x3a833e,'contentHash':_0x58022b,'changed':_0x2c417c!==_0x4de0b2};}export function reuseMaterializedRuntimeSkill(_0x48d32c,_0x527bf9,_0x1c2131){const _0x33e1c1=a153_0x2865,_0x1bbe83=_0x48d32c[_0x33e1c1(0x14e)]?.[_0x33e1c1(0x12a)]();if(!_0x1bbe83)return undefined;const _0x33f42e=requireSkillCode(_0x48d32c),_0x525e7c=getRuntimeSkillDir(_0x1c2131[_0x33e1c1(0x142)],_0x1c2131[_0x33e1c1(0x137)],_0x1c2131[_0x33e1c1(0x12e)],_0x527bf9,_0x33f42e,_0x1c2131['paths']),_0x48a320=resolve(_0x525e7c,SKILL_FILE),_0x4a4d69=resolve(_0x525e7c,METADATA_FILE),_0x217fdc=readMetadataIfPresent(_0x4a4d69);if(!_0x217fdc||_0x217fdc[_0x33e1c1(0x12f)]!==0x2||_0x217fdc[_0x33e1c1(0x12e)]!==_0x1c2131['appCode']||_0x217fdc['scope']!==_0x527bf9||_0x217fdc[_0x33e1c1(0x129)]!==_0x33f42e||_0x217fdc['version']!==_0x1bbe83||_0x217fdc['id']!==_0x48d32c['id']||_0x217fdc[_0x33e1c1(0x138)]!==_0x48d32c[_0x33e1c1(0x138)]||_0x217fdc[_0x33e1c1(0x160)]!==_0x48d32c[_0x33e1c1(0x160)]||_0x217fdc['example']!==_0x48d32c[_0x33e1c1(0x13d)]||_0x217fdc[_0x33e1c1(0x143)]!==_0x48d32c['status']||!_0x217fdc[_0x33e1c1(0x15d)]||!_0x217fdc['fileHashes']||!Object[_0x33e1c1(0x148)](_0x217fdc[_0x33e1c1(0x13e)],SKILL_FILE))return undefined;for(const [_0x4da206,_0x547920]of Object[_0x33e1c1(0x150)](_0x217fdc[_0x33e1c1(0x13e)])){if(!/^[a-f0-9]{64}$/[_0x33e1c1(0x156)](_0x547920))return undefined;const _0x19e101=resolveManagedFilePath(_0x525e7c,_0x4da206);if(!existsSync(_0x19e101)||!lstatSync(_0x19e101)['isFile']())return undefined;if(bufferSha256(readFileSync(_0x19e101))!==_0x547920)return undefined;}return{'skill':_0x48d32c,'scope':_0x527bf9,'dir':_0x525e7c,'skillMdPath':_0x48a320,'metadataPath':_0x4a4d69,'contentHash':_0x217fdc[_0x33e1c1(0x15d)],'changed':![]};}function withMaterializedSkillFrontmatter(_0x188f33,_0x223d22,_0x25f350){const _0x5d1abb=a153_0x2865,_0x39c3d9=skillDisplayName(_0x223d22,_0x25f350),_0x1470c8=_0x223d22[_0x5d1abb(0x160)]?.['trim']()||_0x39c3d9||_0x25f350;return normalizeLocalFiles(_0x188f33)[_0x5d1abb(0x15a)](_0x4ba999=>{const _0x1d4814=_0x5d1abb,_0x78e206=fileText(_0x4ba999);if(_0x4ba999[_0x1d4814(0x14f)]!==SKILL_FILE)return _0x4ba999;if(hasYamlFrontmatter(_0x78e206))return{'path':_0x4ba999[_0x1d4814(0x14f)],'content':withSyncedDisplayName(_0x78e206,_0x39c3d9)};return{'path':_0x4ba999[_0x1d4814(0x14f)],'content':prependSkillFrontmatter(_0x78e206,{'name':_0x25f350,'displayName':_0x39c3d9,'description':_0x1470c8})};});}function hasYamlFrontmatter(_0x2ce856){const _0x3ffb17=a153_0x2865;return/^\uFEFF?---\s*\r?\n/[_0x3ffb17(0x156)](_0x2ce856);}function prependSkillFrontmatter(_0x971a82,_0x27490d){const _0x31329e=a153_0x2865,_0x59788d=_0x971a82['replace'](/^\uFEFF/,'');return[_0x31329e(0x14c),_0x31329e(0x144)+yamlString(_0x27490d['name']),_0x27490d['displayName']?_0x31329e(0x136)+yamlString(_0x27490d[_0x31329e(0x158)]):undefined,_0x31329e(0x13f)+yamlString(_0x27490d[_0x31329e(0x160)]),_0x31329e(0x14c),'',_0x59788d]['filter'](_0x2e4f21=>_0x2e4f21!==undefined)['join']('\x0a');}function yamlString(_0x4e9466){const _0x2842b7=a153_0x2865;return JSON['stringify'](_0x4e9466[_0x2842b7(0x13c)](/\r/g,'')[_0x2842b7(0x12a)]());}function skillDisplayName(_0x36d813,_0x248539){const _0x4685bd=a153_0x2865,_0x58db07=_0x36d813[_0x4685bd(0x138)]?.[_0x4685bd(0x12a)]();return _0x58db07||_0x248539;}function withSyncedDisplayName(_0x1b5568,_0x27ec85){const _0x136867=a153_0x2865,_0x3e266a=_0x1b5568['match'](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x3e266a)return _0x1b5568;const _0xaf18a1=_0x3e266a[0x1]??'',_0x474a16=_0x3e266a[0x2]??'',_0xe87300=parseDocument(_0x474a16);if(_0xe87300[_0x136867(0x147)][_0x136867(0x128)]>0x0||!isMap(_0xe87300['contents']))return _0x1b5568;if(_0x27ec85)_0xe87300[_0x136867(0x133)](_0x136867(0x158),_0x27ec85);else{if(_0xe87300[_0x136867(0x146)](_0x136867(0x158)))_0xe87300[_0x136867(0x12b)]('displayName');else return _0x1b5568;}forceBlockCollections(_0xe87300[_0x136867(0x15c)]);const _0x38dd2b=_0xe87300[_0x136867(0x157)]({'lineWidth':0x0})['trimEnd'](),_0x46005d=_0x1b5568[_0x136867(0x135)](_0x3e266a[0x0][_0x136867(0x128)])[_0x136867(0x13c)](/^\r?\n/,'');return _0xaf18a1+'---\x0a'+_0x38dd2b+'\x0a---\x0a\x0a'+_0x46005d;}function forceBlockCollections(_0x59c567){if(!isNode(_0x59c567))return;visit(_0x59c567,(_0x3e4b6a,_0x318451)=>{isCollection(_0x318451)&&(_0x318451['flow']=![]);});}function a153_0x2865(_0x38fa5e,_0x24861c){_0x38fa5e=_0x38fa5e-0x128;const _0x4eeb8f=a153_0x4eeb();let _0x2865bb=_0x4eeb8f[_0x38fa5e];return _0x2865bb;}function ensurePulledFilesCanBeOverwritten(_0x43be21,_0x51ea92,_0x401e5d,_0x14279c){const _0xcac183=a153_0x2865;if(_0x14279c||!existsSync(_0x51ea92))return;const _0x5e7e41=readMetadataIfPresent(_0x51ea92);if(!_0x5e7e41)return;const _0x5b6c9c=_0x5e7e41['fileHashes']&&Object[_0xcac183(0x12c)](_0x5e7e41['fileHashes'])['length']>0x0?_0x5e7e41[_0xcac183(0x13e)]:undefined;if(_0x5b6c9c)for(const [_0x1171ce,_0x315f2c]of Object['entries'](_0x5b6c9c)){const _0x5679a3=resolveManagedFilePath(_0x43be21,_0x1171ce);if(!existsSync(_0x5679a3))throw CliErrors[_0xcac183(0x13b)](_0xcac183(0x14b)+_0x43be21,'Managed\x20file\x20was\x20removed\x20locally:\x20'+_0x1171ce);const _0x432fc6=lstatSync(_0x5679a3);if(!_0x432fc6[_0xcac183(0x130)]())throw CliErrors[_0xcac183(0x13b)](_0xcac183(0x14b)+_0x43be21,'Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20'+_0x1171ce);const _0x412f8f=bufferSha256(readFileSync(_0x5679a3));if(_0x412f8f!==_0x315f2c)throw CliErrors[_0xcac183(0x13b)](_0xcac183(0x14b)+_0x43be21+_0xcac183(0x139)+_0x1171ce,_0xcac183(0x140)+_0x1171ce);}else{const _0x52140a=resolve(_0x43be21,SKILL_FILE);if(existsSync(_0x52140a)&&_0x5e7e41[_0xcac183(0x15d)]){const _0x503cf1=contentHash(readFileSync(_0x52140a,'utf8'));if(_0x503cf1!==_0x5e7e41[_0xcac183(0x15d)])throw CliErrors[_0xcac183(0x13b)]('Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20'+_0x52140a,_0xcac183(0x149));}}for(const _0x138faa of normalizeLocalFiles(_0x401e5d)){if(_0x5b6c9c?.[_0x138faa['path']])continue;if(!_0x5b6c9c&&_0x138faa[_0xcac183(0x14f)]===SKILL_FILE)continue;const _0x44c868=resolveManagedFilePath(_0x43be21,_0x138faa[_0xcac183(0x14f)]);if(!existsSync(_0x44c868))continue;const _0x354680=lstatSync(_0x44c868);if(!_0x354680['isFile']())throw CliErrors['validation']('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x43be21,_0xcac183(0x134)+_0x138faa[_0xcac183(0x14f)]);const _0x3315a7=bufferSha256(readFileSync(_0x44c868));if(_0x3315a7!==fileHash(_0x138faa))throw CliErrors[_0xcac183(0x13b)](_0xcac183(0x14b)+_0x43be21,'Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20'+_0x138faa[_0xcac183(0x14f)]);}}function materializeFiles(_0x55f468,_0x8c91bf){const _0x5505b9=a153_0x2865;for(const _0x495342 of normalizeLocalFiles(_0x8c91bf)){const _0x35970a=resolveManagedFilePath(_0x55f468,_0x495342[_0x5505b9(0x14f)]);mkdirSync(dirname(_0x35970a),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x35970a,fileContent(_0x495342),0x180);}}function removeStaleManagedFiles(_0x20b064,_0x1f1340,_0x54cf3d){const _0x388d8a=a153_0x2865;if(!_0x1f1340)return;const _0xa70a56=new Set(normalizeLocalFiles(_0x54cf3d)[_0x388d8a(0x15a)](_0x38a705=>_0x38a705[_0x388d8a(0x14f)]));for(const _0xa8f0e of Object[_0x388d8a(0x12c)](_0x1f1340)){if(_0xa70a56[_0x388d8a(0x146)](_0xa8f0e))continue;const _0x3545b2=resolveManagedFilePath(_0x20b064,_0xa8f0e);existsSync(_0x3545b2)&&lstatSync(_0x3545b2)[_0x388d8a(0x130)]()&&rmSync(_0x3545b2,{'force':!![]});}}
1
+ (function(_0xea2750,_0xd68719){const _0x404dc6=a153_0x4eb2,_0x3e1dd3=_0xea2750();while(!![]){try{const _0x39b2b8=-parseInt(_0x404dc6(0x120))/0x1+parseInt(_0x404dc6(0x153))/0x2+parseInt(_0x404dc6(0x155))/0x3*(-parseInt(_0x404dc6(0x124))/0x4)+parseInt(_0x404dc6(0x11a))/0x5*(-parseInt(_0x404dc6(0x14b))/0x6)+parseInt(_0x404dc6(0x149))/0x7+parseInt(_0x404dc6(0x139))/0x8*(-parseInt(_0x404dc6(0x143))/0x9)+parseInt(_0x404dc6(0x11f))/0xa*(parseInt(_0x404dc6(0x14f))/0xb);if(_0x39b2b8===_0xd68719)break;else _0x3e1dd3['push'](_0x3e1dd3['shift']());}catch(_0x13f76c){_0x3e1dd3['push'](_0x3e1dd3['shift']());}}}(a153_0xbfba,0x75748));function a153_0x4eb2(_0x5fb2bd,_0x4f11d7){_0x5fb2bd=_0x5fb2bd-0x118;const _0xbfba2c=a153_0xbfba();let _0x4eb27b=_0xbfba2c[_0x5fb2bd];return _0x4eb27b;}import{existsSync,lstatSync,mkdirSync,readFileSync,rmSync}from'node:fs';import{dirname,resolve}from'node:path';import{isCollection,isMap,isNode,parseDocument,visit}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{resolveManagedFilePath,writeBytesAtomic,writeJsonAtomic}from'./fs-utils.js';import{bufferSha256,contentHash,fileHash}from'./hashing.js';function a153_0xbfba(){const _0x1b0673=['---','has','4800607RREjzb','utf8','74130IXAkIa','paths','slice','Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20','165XMXGuI','env','force','status','193828VspcZS','scope','30ygdBSe','example','skillCode','displayName:\x20','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','.\x20Changed\x20file:\x20','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','map','25SNBHPv','pulledAt','filter','length','appCode','808150kqqOUO','289069hEolsl','hasOwn','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.','skillName','123724tbsIHD','trimEnd','name','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','join','accessKey','entries','match','replace','version','displayName','description:\x20','delete','path','fileHashes','set','schemaVersion','packageBytes','---\x0a','errors','validation','6829520fhoSEb','contentHash','keys','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','isFile','test','trim','stringify','flow','find','9RKwoUb','\x0a---\x0a\x0a','contents','description'];a153_0xbfba=function(){return _0x1b0673;};return a153_0xbfba();}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(_0xe1c3d4,_0x5cabc7,_0x2f3ea6){const _0x1ce67c=a153_0x4eb2,_0x18a012=requireSkillCode(_0xe1c3d4),_0x17e8a4=requirePackageBytes(_0x18a012,_0x2f3ea6[_0x1ce67c(0x135)]),_0x3b5a38=extractDownloadedPackage(_0x17e8a4),_0x383e4d=_0x3b5a38[_0x1ce67c(0x142)](_0x204a30=>_0x204a30[_0x1ce67c(0x131)]===SKILL_FILE);if(!_0x383e4d)throw CliErrors[_0x1ce67c(0x138)]('Runtime\x20Skill\x20package\x20is\x20missing\x20'+SKILL_FILE+':\x20'+_0x18a012);const _0x5c3d6b=withMaterializedSkillFrontmatter(_0x3b5a38,_0xe1c3d4,_0x18a012),_0x233de3=_0x5c3d6b[_0x1ce67c(0x142)](_0x4ad228=>_0x4ad228[_0x1ce67c(0x131)]===SKILL_FILE),_0x38715e=fileText(_0x233de3),_0xf1fd61=getRuntimeSkillDir(_0x2f3ea6['env'],_0x2f3ea6[_0x1ce67c(0x129)],_0x2f3ea6[_0x1ce67c(0x11e)],_0x5cabc7,_0x18a012,_0x2f3ea6['paths']),_0x50b2a0=resolve(_0xf1fd61,SKILL_FILE),_0x40285e=resolve(_0xf1fd61,METADATA_FILE),_0x1fa755=contentHash(_0x38715e),_0x2a62dd=readMetadataIfPresent(_0x40285e)?.[_0x1ce67c(0x132)];ensurePulledFilesCanBeOverwritten(_0xf1fd61,_0x40285e,_0x5c3d6b,_0x2f3ea6[_0x1ce67c(0x151)]===!![]),mkdirSync(_0xf1fd61,{'recursive':!![],'mode':0x1c0});const _0x72af07=existsSync(_0x50b2a0)?readFileSync(_0x50b2a0,'utf8'):undefined;return materializeFiles(_0xf1fd61,_0x5c3d6b),removeStaleManagedFiles(_0xf1fd61,_0x2a62dd,_0x5c3d6b),writeJsonAtomic(_0x40285e,buildMetadata(_0xe1c3d4,_0x5cabc7,_0x2f3ea6[_0x1ce67c(0x11e)],_0x1fa755,_0x2f3ea6[_0x1ce67c(0x11b)],_0x5c3d6b,_0x17e8a4)),{'skill':_0xe1c3d4,'scope':_0x5cabc7,'dir':_0xf1fd61,'skillMdPath':_0x50b2a0,'metadataPath':_0x40285e,'contentHash':_0x1fa755,'changed':_0x72af07!==_0x38715e};}export function reuseMaterializedRuntimeSkill(_0x4cef15,_0xf8870d,_0x2fb37f){const _0x39926a=a153_0x4eb2,_0xbf7808=_0x4cef15['version']?.[_0x39926a(0x13f)]();if(!_0xbf7808)return undefined;const _0x1c9d48=requireSkillCode(_0x4cef15),_0x1a9497=getRuntimeSkillDir(_0x2fb37f[_0x39926a(0x150)],_0x2fb37f[_0x39926a(0x129)],_0x2fb37f[_0x39926a(0x11e)],_0xf8870d,_0x1c9d48,_0x2fb37f[_0x39926a(0x14c)]),_0x3d22df=resolve(_0x1a9497,SKILL_FILE),_0x44afa9=resolve(_0x1a9497,METADATA_FILE),_0x3fde93=readMetadataIfPresent(_0x44afa9);if(!_0x3fde93||_0x3fde93[_0x39926a(0x134)]!==0x2||_0x3fde93[_0x39926a(0x11e)]!==_0x2fb37f[_0x39926a(0x11e)]||_0x3fde93[_0x39926a(0x154)]!==_0xf8870d||_0x3fde93[_0x39926a(0x157)]!==_0x1c9d48||_0x3fde93[_0x39926a(0x12d)]!==_0xbf7808||_0x3fde93['id']!==_0x4cef15['id']||_0x3fde93[_0x39926a(0x123)]!==_0x4cef15['skillName']||_0x3fde93[_0x39926a(0x146)]!==_0x4cef15[_0x39926a(0x146)]||_0x3fde93[_0x39926a(0x156)]!==_0x4cef15[_0x39926a(0x156)]||_0x3fde93[_0x39926a(0x152)]!==_0x4cef15[_0x39926a(0x152)]||!_0x3fde93[_0x39926a(0x13a)]||!_0x3fde93['fileHashes']||!Object[_0x39926a(0x121)](_0x3fde93['fileHashes'],SKILL_FILE))return undefined;for(const [_0x4f81dc,_0x23618d]of Object[_0x39926a(0x12a)](_0x3fde93[_0x39926a(0x132)])){if(!/^[a-f0-9]{64}$/['test'](_0x23618d))return undefined;const _0x57ec47=resolveManagedFilePath(_0x1a9497,_0x4f81dc);if(!existsSync(_0x57ec47)||!lstatSync(_0x57ec47)[_0x39926a(0x13d)]())return undefined;if(bufferSha256(readFileSync(_0x57ec47))!==_0x23618d)return undefined;}return{'skill':_0x4cef15,'scope':_0xf8870d,'dir':_0x1a9497,'skillMdPath':_0x3d22df,'metadataPath':_0x44afa9,'contentHash':_0x3fde93[_0x39926a(0x13a)],'changed':![]};}function withMaterializedSkillFrontmatter(_0x16b45d,_0x550d11,_0x5b6fa3){const _0x548b4d=a153_0x4eb2,_0x316232=skillDisplayName(_0x550d11,_0x5b6fa3),_0x30c67d=_0x550d11[_0x548b4d(0x146)]?.['trim']()||_0x316232||_0x5b6fa3;return normalizeLocalFiles(_0x16b45d)[_0x548b4d(0x119)](_0x887a08=>{const _0x13a0d6=_0x548b4d,_0x52bdfb=fileText(_0x887a08);if(_0x887a08[_0x13a0d6(0x131)]!==SKILL_FILE)return _0x887a08;if(hasYamlFrontmatter(_0x52bdfb))return{'path':_0x887a08['path'],'content':withSyncedDisplayName(_0x52bdfb,_0x316232)};return{'path':_0x887a08[_0x13a0d6(0x131)],'content':prependSkillFrontmatter(_0x52bdfb,{'name':_0x5b6fa3,'displayName':_0x316232,'description':_0x30c67d})};});}function hasYamlFrontmatter(_0x12bbc){const _0x4bf3b7=a153_0x4eb2;return/^\uFEFF?---\s*\r?\n/[_0x4bf3b7(0x13e)](_0x12bbc);}function prependSkillFrontmatter(_0x75841f,_0x5cacfa){const _0x508b75=a153_0x4eb2,_0x1b71ab=_0x75841f[_0x508b75(0x12c)](/^\uFEFF/,'');return['---','name:\x20'+yamlString(_0x5cacfa[_0x508b75(0x126)]),_0x5cacfa[_0x508b75(0x12e)]?_0x508b75(0x158)+yamlString(_0x5cacfa[_0x508b75(0x12e)]):undefined,_0x508b75(0x12f)+yamlString(_0x5cacfa[_0x508b75(0x146)]),_0x508b75(0x147),'',_0x1b71ab][_0x508b75(0x11c)](_0x5dc249=>_0x5dc249!==undefined)[_0x508b75(0x128)]('\x0a');}function yamlString(_0x1f359c){const _0x1dfa6e=a153_0x4eb2;return JSON[_0x1dfa6e(0x140)](_0x1f359c[_0x1dfa6e(0x12c)](/\r/g,'')[_0x1dfa6e(0x13f)]());}function skillDisplayName(_0x388adb,_0x15891a){const _0x2028ef=_0x388adb['skillName']?.['trim']();return _0x2028ef||_0x15891a;}function withSyncedDisplayName(_0x4e1cff,_0xce287f){const _0x1ed1a2=a153_0x4eb2,_0x11848c=_0x4e1cff[_0x1ed1a2(0x12b)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x11848c)return _0x4e1cff;const _0x417793=_0x11848c[0x1]??'',_0x45b387=_0x11848c[0x2]??'',_0x562ad5=parseDocument(_0x45b387);if(_0x562ad5[_0x1ed1a2(0x137)][_0x1ed1a2(0x11d)]>0x0||!isMap(_0x562ad5['contents']))return _0x4e1cff;if(_0xce287f)_0x562ad5[_0x1ed1a2(0x133)](_0x1ed1a2(0x12e),_0xce287f);else{if(_0x562ad5[_0x1ed1a2(0x148)](_0x1ed1a2(0x12e)))_0x562ad5[_0x1ed1a2(0x130)]('displayName');else return _0x4e1cff;}forceBlockCollections(_0x562ad5[_0x1ed1a2(0x145)]);const _0x213724=_0x562ad5['toString']({'lineWidth':0x0})[_0x1ed1a2(0x125)](),_0x44b1f4=_0x4e1cff[_0x1ed1a2(0x14d)](_0x11848c[0x0][_0x1ed1a2(0x11d)])[_0x1ed1a2(0x12c)](/^\r?\n/,'');return _0x417793+_0x1ed1a2(0x136)+_0x213724+_0x1ed1a2(0x144)+_0x44b1f4;}function forceBlockCollections(_0x368bba){if(!isNode(_0x368bba))return;visit(_0x368bba,(_0x453df4,_0x32651d)=>{const _0x4ade92=a153_0x4eb2;isCollection(_0x32651d)&&(_0x32651d[_0x4ade92(0x141)]=![]);});}function ensurePulledFilesCanBeOverwritten(_0x215c5b,_0x2cdce0,_0x54313f,_0x31f7d1){const _0x26001b=a153_0x4eb2;if(_0x31f7d1||!existsSync(_0x2cdce0))return;const _0x1752e8=readMetadataIfPresent(_0x2cdce0);if(!_0x1752e8)return;const _0x2b7ea3=_0x1752e8['fileHashes']&&Object[_0x26001b(0x13b)](_0x1752e8[_0x26001b(0x132)])[_0x26001b(0x11d)]>0x0?_0x1752e8['fileHashes']:undefined;if(_0x2b7ea3)for(const [_0x242184,_0x328612]of Object[_0x26001b(0x12a)](_0x2b7ea3)){const _0x21b191=resolveManagedFilePath(_0x215c5b,_0x242184);if(!existsSync(_0x21b191))throw CliErrors[_0x26001b(0x138)](_0x26001b(0x159)+_0x215c5b,'Managed\x20file\x20was\x20removed\x20locally:\x20'+_0x242184);const _0x3addf8=lstatSync(_0x21b191);if(!_0x3addf8[_0x26001b(0x13d)]())throw CliErrors[_0x26001b(0x138)](_0x26001b(0x159)+_0x215c5b,'Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20'+_0x242184);const _0x448d3c=bufferSha256(readFileSync(_0x21b191));if(_0x448d3c!==_0x328612)throw CliErrors[_0x26001b(0x138)](_0x26001b(0x159)+_0x215c5b+_0x26001b(0x15a)+_0x242184,_0x26001b(0x127)+_0x242184);}else{const _0x2b5bd5=resolve(_0x215c5b,SKILL_FILE);if(existsSync(_0x2b5bd5)&&_0x1752e8['contentHash']){const _0x43f87b=contentHash(readFileSync(_0x2b5bd5,_0x26001b(0x14a)));if(_0x43f87b!==_0x1752e8[_0x26001b(0x13a)])throw CliErrors['validation'](_0x26001b(0x118)+_0x2b5bd5,_0x26001b(0x122));}}for(const _0x1e2b1a of normalizeLocalFiles(_0x54313f)){if(_0x2b7ea3?.[_0x1e2b1a['path']])continue;if(!_0x2b7ea3&&_0x1e2b1a[_0x26001b(0x131)]===SKILL_FILE)continue;const _0x38bc3d=resolveManagedFilePath(_0x215c5b,_0x1e2b1a[_0x26001b(0x131)]);if(!existsSync(_0x38bc3d))continue;const _0xf4bdd8=lstatSync(_0x38bc3d);if(!_0xf4bdd8[_0x26001b(0x13d)]())throw CliErrors['validation'](_0x26001b(0x159)+_0x215c5b,_0x26001b(0x13c)+_0x1e2b1a['path']);const _0x31c924=bufferSha256(readFileSync(_0x38bc3d));if(_0x31c924!==fileHash(_0x1e2b1a))throw CliErrors[_0x26001b(0x138)](_0x26001b(0x159)+_0x215c5b,_0x26001b(0x14e)+_0x1e2b1a[_0x26001b(0x131)]);}}function materializeFiles(_0x2f6ebe,_0x4ab20d){const _0x3eb682=a153_0x4eb2;for(const _0x2ba57f of normalizeLocalFiles(_0x4ab20d)){const _0x280089=resolveManagedFilePath(_0x2f6ebe,_0x2ba57f[_0x3eb682(0x131)]);mkdirSync(dirname(_0x280089),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x280089,fileContent(_0x2ba57f),0x180);}}function removeStaleManagedFiles(_0x3476c6,_0x436667,_0x57bd4a){const _0x49b146=a153_0x4eb2;if(!_0x436667)return;const _0x9a7004=new Set(normalizeLocalFiles(_0x57bd4a)['map'](_0x31cf6c=>_0x31cf6c[_0x49b146(0x131)]));for(const _0x308dfb of Object[_0x49b146(0x13b)](_0x436667)){if(_0x9a7004['has'](_0x308dfb))continue;const _0x1c175c=resolveManagedFilePath(_0x3476c6,_0x308dfb);existsSync(_0x1c175c)&&lstatSync(_0x1c175c)['isFile']()&&rmSync(_0x1c175c,{'force':!![]});}}
@@ -1 +1 @@
1
- (function(_0x5f3ee8,_0x5976e2){const _0x4950ef=a154_0x77cc,_0x522de8=_0x5f3ee8();while(!![]){try{const _0x3abfd8=parseInt(_0x4950ef(0x17c))/0x1*(parseInt(_0x4950ef(0x185))/0x2)+parseInt(_0x4950ef(0x195))/0x3+parseInt(_0x4950ef(0x173))/0x4*(-parseInt(_0x4950ef(0x174))/0x5)+parseInt(_0x4950ef(0x17d))/0x6*(parseInt(_0x4950ef(0x17a))/0x7)+-parseInt(_0x4950ef(0x188))/0x8*(-parseInt(_0x4950ef(0x191))/0x9)+-parseInt(_0x4950ef(0x178))/0xa*(parseInt(_0x4950ef(0x186))/0xb)+-parseInt(_0x4950ef(0x192))/0xc;if(_0x3abfd8===_0x5976e2)break;else _0x522de8['push'](_0x522de8['shift']());}catch(_0x2096fd){_0x522de8['push'](_0x522de8['shift']());}}}(a154_0x2d74,0x1e2e9));import{existsSync,readFileSync}from'node:fs';import{CliErrors}from'../../errors.js';function a154_0x2d74(){const _0x20c9ea=['manifest','trim','91143OUlrrJ','526248QpTzzq','sourceSessionId','readonly','687732okPjIN','files','forkedFromSkillId','string','tenantCode','908CnesXN','3495CQCyyf','isArray','skillCode','status','80vJFAvM','validation','84kfbywQ','fromEntries','55AJaocB','31722bEbMPB','map','forkedFromVersion','Runtime\x20Skill\x20is\x20missing\x20skillCode.','utf8','zipSize','skillName','path','3902dvDIXQ','115456LSMlHc','hasUpstreamUpdate','8iNBHgP','version','description','length','parse','tags','personal'];a154_0x2d74=function(){return _0x20c9ea;};return a154_0x2d74();}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(_0x4aefa4,_0x51f3d8,_0x4db51a,_0x4938bd,_0x37b99f,_0x17e97b,_0x4dc276){const _0xf2238a=a154_0x77cc,_0x14f1c3=_0x17e97b?normalizeLocalFiles(_0x17e97b):[],_0x447fc6=!_0x4dc276&&_0x14f1c3['length']>0x0?buildSkillPackage(_0x14f1c3):undefined,_0x3c4577=_0x4dc276?bufferSha256(_0x4dc276):_0x447fc6?.[_0xf2238a(0x18f)]['zipSha256'],_0x38dde2=_0x4dc276?.['length']??_0x447fc6?.['manifest'][_0xf2238a(0x182)],_0x52240a=_0x14f1c3[_0xf2238a(0x18b)]>0x0?Object[_0xf2238a(0x17b)](_0x14f1c3[_0xf2238a(0x17e)](_0x5b8387=>[_0x5b8387[_0xf2238a(0x184)],fileHash(_0x5b8387)])):undefined;return{'schemaVersion':_0x14f1c3[_0xf2238a(0x18b)]>0x0?0x2:0x1,'id':_0x4aefa4['id'],'appCode':_0x4db51a,'skillCode':requireSkillCode(_0x4aefa4),'skillName':_0x4aefa4[_0xf2238a(0x183)],'description':_0x4aefa4[_0xf2238a(0x18a)],'example':_0x4aefa4['example'],'scope':_0x51f3d8,'readonly':_0x51f3d8!==_0xf2238a(0x18e)||_0x4aefa4[_0xf2238a(0x194)]===!![],'tenantCode':_0x4aefa4[_0xf2238a(0x172)],'userId':_0x4aefa4['userId'],'version':_0x4aefa4[_0xf2238a(0x189)],'status':_0x4aefa4[_0xf2238a(0x177)],'tags':Array[_0xf2238a(0x175)](_0x4aefa4[_0xf2238a(0x18d)])?_0x4aefa4[_0xf2238a(0x18d)]:[],'hasUpstreamUpdate':_0x4aefa4[_0xf2238a(0x187)],'forkedFromSkillId':_0x4aefa4[_0xf2238a(0x170)],'forkedFromVersion':_0x4aefa4[_0xf2238a(0x17f)],'sourceSessionId':_0x4aefa4[_0xf2238a(0x193)],'contentHash':_0x4938bd,'fileHashes':_0x52240a,'treeHash':_0x14f1c3[_0xf2238a(0x18b)]>0x0?fileTreeHash(localFilesToManifestFiles(_0x14f1c3)):undefined,'ossPath':remoteManifestOssPath(_0x4aefa4[_0xf2238a(0x196)]),'zipSha256':_0x3c4577,'zipSize':_0x38dde2,'files':_0x14f1c3[_0xf2238a(0x18b)]>0x0?_0x14f1c3['map'](_0x2c8750=>({'path':_0x2c8750[_0xf2238a(0x184)],'hash':fileHash(_0x2c8750),'size':fileContent(_0x2c8750)[_0xf2238a(0x18b)]})):undefined,'pulledAt':_0x37b99f??new Date()['toISOString']()};}export function requireSkillCode(_0x3454ed){const _0x532cba=a154_0x77cc,_0x1c66a2=_0x3454ed[_0x532cba(0x176)]?.[_0x532cba(0x190)]();if(!_0x1c66a2)throw CliErrors[_0x532cba(0x179)](_0x532cba(0x180));return _0x1c66a2;}function a154_0x77cc(_0x1b8c19,_0x24f2fa){_0x1b8c19=_0x1b8c19-0x170;const _0x2d74f1=a154_0x2d74();let _0x77cc67=_0x2d74f1[_0x1b8c19];return _0x77cc67;}export function readMetadataIfPresent(_0x30baf0){const _0x30e7a1=a154_0x77cc;if(!existsSync(_0x30baf0))return undefined;try{const _0x530bb5=JSON[_0x30e7a1(0x18c)](readFileSync(_0x30baf0,_0x30e7a1(0x181)));return _0x530bb5;}catch{throw CliErrors[_0x30e7a1(0x179)]('Invalid\x20'+METADATA_FILE+':\x20'+_0x30baf0);}}function remoteManifestOssPath(_0x2b6449){const _0x507644=a154_0x77cc;if(!_0x2b6449||typeof _0x2b6449!=='object'||Array[_0x507644(0x175)](_0x2b6449))return undefined;const _0x142d93=_0x2b6449['ossPath'];return typeof _0x142d93===_0x507644(0x171)&&_0x142d93[_0x507644(0x190)]()?_0x142d93[_0x507644(0x190)]():undefined;}
1
+ (function(_0x268a50,_0x5d0b84){const _0x37eaf8=a154_0x31fc,_0x22e1b6=_0x268a50();while(!![]){try{const _0x5b2e4d=parseInt(_0x37eaf8(0x17d))/0x1+-parseInt(_0x37eaf8(0x166))/0x2*(-parseInt(_0x37eaf8(0x170))/0x3)+-parseInt(_0x37eaf8(0x163))/0x4*(parseInt(_0x37eaf8(0x182))/0x5)+parseInt(_0x37eaf8(0x162))/0x6*(-parseInt(_0x37eaf8(0x184))/0x7)+-parseInt(_0x37eaf8(0x164))/0x8+-parseInt(_0x37eaf8(0x165))/0x9*(parseInt(_0x37eaf8(0x17b))/0xa)+parseInt(_0x37eaf8(0x161))/0xb;if(_0x5b2e4d===_0x5d0b84)break;else _0x22e1b6['push'](_0x22e1b6['shift']());}catch(_0x2c29ea){_0x22e1b6['push'](_0x22e1b6['shift']());}}}(a154_0x5eca,0xc3103));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';function a154_0x5eca(){const _0xa301b7=['length','forkedFromVersion','map','ossPath','description','path','zipSize','skillName','Invalid\x20','1960RTitnK','readonly','861459spZwuO','forkedFromSkillId','object','hasUpstreamUpdate','validation','103685gxABcP','files','344281RDfcYF','utf8','15778136xcJppO','6gjcLzg','124cjUWNF','6420696ZuHHtT','612REyzWi','2Wnefth','personal','tags','sourceSessionId','Runtime\x20Skill\x20is\x20missing\x20skillCode.','isArray','manifest','trim','userId','status','33267QXuvVM','string'];a154_0x5eca=function(){return _0xa301b7;};return a154_0x5eca();}import{buildSkillPackage,localFilesToManifestFiles}from'./zip-package.js';function a154_0x31fc(_0x45329a,_0x2934a3){_0x45329a=_0x45329a-0x161;const _0x5ecaf0=a154_0x5eca();let _0x31fcbd=_0x5ecaf0[_0x45329a];return _0x31fcbd;}export function buildMetadata(_0x13ccd9,_0x13a640,_0x20a304,_0x150ca0,_0x1ebd34,_0x45cebd,_0x5719bf){const _0x20e1f8=a154_0x31fc,_0x4b5b5a=_0x45cebd?normalizeLocalFiles(_0x45cebd):[],_0x54f225=!_0x5719bf&&_0x4b5b5a[_0x20e1f8(0x172)]>0x0?buildSkillPackage(_0x4b5b5a):undefined,_0x402734=_0x5719bf?bufferSha256(_0x5719bf):_0x54f225?.[_0x20e1f8(0x16c)]['zipSha256'],_0x48d192=_0x5719bf?.[_0x20e1f8(0x172)]??_0x54f225?.[_0x20e1f8(0x16c)][_0x20e1f8(0x178)],_0x3c613b=_0x4b5b5a[_0x20e1f8(0x172)]>0x0?Object['fromEntries'](_0x4b5b5a[_0x20e1f8(0x174)](_0xd6cfd3=>[_0xd6cfd3['path'],fileHash(_0xd6cfd3)])):undefined;return{'schemaVersion':_0x4b5b5a[_0x20e1f8(0x172)]>0x0?0x2:0x1,'id':_0x13ccd9['id'],'appCode':_0x20a304,'skillCode':requireSkillCode(_0x13ccd9),'skillName':_0x13ccd9[_0x20e1f8(0x179)],'description':_0x13ccd9[_0x20e1f8(0x176)],'example':_0x13ccd9['example'],'scope':_0x13a640,'readonly':_0x13a640!==_0x20e1f8(0x167)||_0x13ccd9[_0x20e1f8(0x17c)]===!![],'tenantCode':_0x13ccd9['tenantCode'],'userId':_0x13ccd9[_0x20e1f8(0x16e)],'version':_0x13ccd9['version'],'status':_0x13ccd9[_0x20e1f8(0x16f)],'tags':Array[_0x20e1f8(0x16b)](_0x13ccd9['tags'])?_0x13ccd9[_0x20e1f8(0x168)]:[],'hasUpstreamUpdate':_0x13ccd9[_0x20e1f8(0x180)],'forkedFromSkillId':_0x13ccd9[_0x20e1f8(0x17e)],'forkedFromVersion':_0x13ccd9[_0x20e1f8(0x173)],'sourceSessionId':_0x13ccd9[_0x20e1f8(0x169)],'contentHash':_0x150ca0,'fileHashes':_0x3c613b,'treeHash':_0x4b5b5a[_0x20e1f8(0x172)]>0x0?fileTreeHash(localFilesToManifestFiles(_0x4b5b5a)):undefined,'ossPath':remoteManifestOssPath(_0x13ccd9[_0x20e1f8(0x183)]),'zipSha256':_0x402734,'zipSize':_0x48d192,'files':_0x4b5b5a[_0x20e1f8(0x172)]>0x0?_0x4b5b5a[_0x20e1f8(0x174)](_0x2c303c=>({'path':_0x2c303c[_0x20e1f8(0x177)],'hash':fileHash(_0x2c303c),'size':fileContent(_0x2c303c)[_0x20e1f8(0x172)]})):undefined,'pulledAt':_0x1ebd34??new Date()['toISOString']()};}export function requireSkillCode(_0x24d65f){const _0x3aabae=a154_0x31fc,_0x1b6240=_0x24d65f['skillCode']?.[_0x3aabae(0x16d)]();if(!_0x1b6240)throw CliErrors['validation'](_0x3aabae(0x16a));return _0x1b6240;}export function readMetadataIfPresent(_0x2b9616){const _0xaeeaec=a154_0x31fc;if(!existsSync(_0x2b9616))return undefined;try{const _0x1f1b09=JSON['parse'](readFileSync(_0x2b9616,_0xaeeaec(0x185)));return _0x1f1b09;}catch{throw CliErrors[_0xaeeaec(0x181)](_0xaeeaec(0x17a)+METADATA_FILE+':\x20'+_0x2b9616);}}function remoteManifestOssPath(_0x6b0b4e){const _0x5752da=a154_0x31fc;if(!_0x6b0b4e||typeof _0x6b0b4e!==_0x5752da(0x17f)||Array[_0x5752da(0x16b)](_0x6b0b4e))return undefined;const _0x438c19=_0x6b0b4e[_0x5752da(0x175)];return typeof _0x438c19===_0x5752da(0x171)&&_0x438c19['trim']()?_0x438c19[_0x5752da(0x16d)]():undefined;}
@@ -1 +1 @@
1
- const a155_0xc790ee=a155_0xfbbc;(function(_0x4d7645,_0xc57337){const _0xaba418=a155_0xfbbc,_0x2bba73=_0x4d7645();while(!![]){try{const _0xcb2383=-parseInt(_0xaba418(0xe3))/0x1*(parseInt(_0xaba418(0xd0))/0x2)+parseInt(_0xaba418(0xd3))/0x3+-parseInt(_0xaba418(0xd2))/0x4+parseInt(_0xaba418(0xe1))/0x5*(-parseInt(_0xaba418(0xec))/0x6)+parseInt(_0xaba418(0xe7))/0x7*(parseInt(_0xaba418(0xeb))/0x8)+-parseInt(_0xaba418(0xe5))/0x9*(parseInt(_0xaba418(0xdf))/0xa)+-parseInt(_0xaba418(0xd8))/0xb*(-parseInt(_0xaba418(0xd5))/0xc);if(_0xcb2383===_0xc57337)break;else _0x2bba73['push'](_0x2bba73['shift']());}catch(_0x8b41d6){_0x2bba73['push'](_0x2bba73['shift']());}}}(a155_0x1bf2,0xd8d46));import{existsSync}from'node:fs';import{homedir}from'node:os';import{resolve}from'node:path';function a155_0x1bf2(){const _0x9921d3=['180014wvOuTF','includes','5043468Uqfhyj','5252664hlKFku','path\x20segment','12QyhHbd','filter','SKILL_ROOT','17872019sLXLOg','cacheRoot','skills','.claude','.workbuddy','workbuddySkillsDir','homeDirName','2683180LlnsTX','.agents','10nDVWcP','validation','4YnbTvk','CLAUDE_SKILL_ROOT','9kxlFtA','cache','42IQrQVD','agentsSkillsDir','skillCode','claudeSkillsDir','529792wJcHqh','2986842rHfUof','\x20for\x20local\x20path:\x20'];a155_0x1bf2=function(){return _0x9921d3;};return a155_0x1bf2();}import{fingerprintAccessKey}from'../../commands/app/cache.js';import{PRODUCT_CONFIG,productEnv}from'../../constant/product.js';import{CliErrors}from'../../errors.js';export function resolveSkillSyncPaths(_0x9e9e1f={}){const _0x5254d5=a155_0xfbbc,_0x1c536f=_0x9e9e1f['homeDir']??homedir(),_0x42b0a9=resolve(_0x1c536f,PRODUCT_CONFIG[_0x5254d5(0xde)],_0x5254d5(0xe6)),_0x54e3b6=trimmedEnv(_0x5254d5(0xd7)),_0xa62438=trimmedEnv(_0x5254d5(0xe4)),_0x44e152=resolve(_0x1c536f,_0x5254d5(0xdc)),_0x32cdc3=_0x9e9e1f[_0x5254d5(0xdd)]??(existsSync(_0x44e152)?resolve(_0x44e152,_0x5254d5(0xda)):undefined);return{'homeDir':_0x1c536f,'cacheRoot':_0x42b0a9,'managedRoot':resolve(_0x1c536f,PRODUCT_CONFIG['homeDirName']),'agentsSkillsDir':_0x9e9e1f[_0x5254d5(0xe8)]??_0x54e3b6??resolve(_0x1c536f,_0x5254d5(0xe0),_0x5254d5(0xda)),'claudeSkillsDir':_0x9e9e1f[_0x5254d5(0xea)]??_0xa62438??resolve(_0x1c536f,_0x5254d5(0xdb),'skills'),'workbuddySkillsDir':_0x32cdc3};}export function runtimeAgentSkillRoots(_0x575b84){const _0x7516b9=a155_0xfbbc;return[_0x575b84['agentsSkillsDir'],_0x575b84['claudeSkillsDir'],_0x575b84[_0x7516b9(0xdd)]][_0x7516b9(0xd6)](_0x38c07f=>Boolean(_0x38c07f));}export function getRuntimeSkillCacheRoot(_0xc8eb0e,_0x3ed247,_0x43ef0c={}){const _0x6e16c=a155_0xfbbc,_0x3fb1b7=resolveSkillSyncPaths(_0x43ef0c);return resolve(_0x3fb1b7[_0x6e16c(0xd9)],_0xc8eb0e,fingerprintAccessKey(_0x3ed247),_0x6e16c(0xda));}export function getRuntimeSkillDir(_0x112550,_0x1101bd,_0x88828b,_0x2af814,_0xa49afd,_0x59f6de={}){const _0x52fa09=a155_0xfbbc;return resolve(getRuntimeSkillCacheRoot(_0x112550,_0x1101bd,_0x59f6de),safePathSegment(_0x88828b,'appCode'),_0x2af814,safePathSegment(_0xa49afd,_0x52fa09(0xe9)));}export function safePathSegment(_0x4054f8,_0x4bac32=a155_0xc790ee(0xd4)){const _0x24f052=a155_0xc790ee;if(!_0x4054f8||_0x4054f8[_0x24f052(0xd1)]('/')||_0x4054f8[_0x24f052(0xd1)]('\x5c')||_0x4054f8[_0x24f052(0xd1)]('..'))throw CliErrors[_0x24f052(0xe2)]('Unsafe\x20'+_0x4bac32+_0x24f052(0xed)+_0x4054f8);return _0x4054f8;}function a155_0xfbbc(_0x378be8,_0x39ade3){_0x378be8=_0x378be8-0xd0;const _0x1bf290=a155_0x1bf2();let _0xfbbcfe=_0x1bf290[_0x378be8];return _0xfbbcfe;}function trimmedEnv(_0x58c039){const _0x3d05ef=productEnv(_0x58c039)?.['trim']();return _0x3d05ef?_0x3d05ef:undefined;}
1
+ const a155_0x148c26=a155_0xa35d;(function(_0xc4beb1,_0x2d1b3d){const _0x472661=a155_0xa35d,_0x46ae1b=_0xc4beb1();while(!![]){try{const _0x1ab0a0=parseInt(_0x472661(0x191))/0x1*(parseInt(_0x472661(0x18c))/0x2)+parseInt(_0x472661(0x193))/0x3+parseInt(_0x472661(0x192))/0x4*(-parseInt(_0x472661(0x198))/0x5)+-parseInt(_0x472661(0x195))/0x6+-parseInt(_0x472661(0x18f))/0x7*(-parseInt(_0x472661(0x19d))/0x8)+-parseInt(_0x472661(0x18d))/0x9*(-parseInt(_0x472661(0x19c))/0xa)+-parseInt(_0x472661(0x1a9))/0xb;if(_0x1ab0a0===_0x2d1b3d)break;else _0x46ae1b['push'](_0x46ae1b['shift']());}catch(_0x17cce5){_0x46ae1b['push'](_0x46ae1b['shift']());}}}(a155_0x319d,0x96ed6));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';function a155_0xa35d(_0x409542,_0x4cb5d0){_0x409542=_0x409542-0x18c;const _0x319df4=a155_0x319d();let _0xa35df9=_0x319df4[_0x409542];return _0xa35df9;}export function resolveSkillSyncPaths(_0x1b3840={}){const _0x17b05a=a155_0xa35d,_0x305748=_0x1b3840[_0x17b05a(0x1a8)]??homedir(),_0x325e7a=resolve(_0x305748,PRODUCT_CONFIG[_0x17b05a(0x18e)],_0x17b05a(0x19b)),_0x1d46bf=trimmedEnv('SKILL_ROOT'),_0x288b9f=trimmedEnv('CLAUDE_SKILL_ROOT'),_0x3ba810=resolve(_0x305748,_0x17b05a(0x1a3)),_0x4aa0df=_0x1b3840[_0x17b05a(0x19f)]??(existsSync(_0x3ba810)?resolve(_0x3ba810,_0x17b05a(0x1a0)):undefined);return{'homeDir':_0x305748,'cacheRoot':_0x325e7a,'managedRoot':resolve(_0x305748,PRODUCT_CONFIG[_0x17b05a(0x18e)]),'agentsSkillsDir':_0x1b3840[_0x17b05a(0x1a2)]??_0x1d46bf??resolve(_0x305748,_0x17b05a(0x196),_0x17b05a(0x1a0)),'claudeSkillsDir':_0x1b3840['claudeSkillsDir']??_0x288b9f??resolve(_0x305748,_0x17b05a(0x199),_0x17b05a(0x1a0)),'workbuddySkillsDir':_0x4aa0df};}export function runtimeAgentSkillRoots(_0x2e90ca){const _0x20d13b=a155_0xa35d;return[_0x2e90ca[_0x20d13b(0x1a2)],_0x2e90ca[_0x20d13b(0x19e)],_0x2e90ca[_0x20d13b(0x19f)]][_0x20d13b(0x197)](_0x356360=>Boolean(_0x356360));}export function getRuntimeSkillCacheRoot(_0x225e82,_0x43edf9,_0x2b25a7={}){const _0x122a7c=a155_0xa35d,_0x1ee356=resolveSkillSyncPaths(_0x2b25a7);return resolve(_0x1ee356['cacheRoot'],_0x225e82,fingerprintAccessKey(_0x43edf9),_0x122a7c(0x1a0));}export function getRuntimeSkillDir(_0x270323,_0x3814fc,_0x59c449,_0xbebf9b,_0xcfd778,_0x5094cd={}){const _0x1c8cde=a155_0xa35d;return resolve(getRuntimeSkillCacheRoot(_0x270323,_0x3814fc,_0x5094cd),safePathSegment(_0x59c449,_0x1c8cde(0x19a)),_0xbebf9b,safePathSegment(_0xcfd778,_0x1c8cde(0x1a7)));}function a155_0x319d(){const _0x37ebe3=['1SQzgCw','72egvXyb','3245517ziWznn','path\x20segment','2030922wfTknq','.agents','filter','266510crpFHX','.claude','appCode','cache','1936010bYzKtp','40UzUAuB','claudeSkillsDir','workbuddySkillsDir','skills','validation','agentsSkillsDir','.workbuddy','Unsafe\x20','includes','trim','skillCode','homeDir','8821703ixeafT','1595486EWQguS','18oXFNFk','homeDirName','631834qZptsa','\x20for\x20local\x20path:\x20'];a155_0x319d=function(){return _0x37ebe3;};return a155_0x319d();}export function safePathSegment(_0x5c1a95,_0x17337e=a155_0x148c26(0x194)){const _0x273e32=a155_0x148c26;if(!_0x5c1a95||_0x5c1a95['includes']('/')||_0x5c1a95[_0x273e32(0x1a5)]('\x5c')||_0x5c1a95[_0x273e32(0x1a5)]('..'))throw CliErrors[_0x273e32(0x1a1)](_0x273e32(0x1a4)+_0x17337e+_0x273e32(0x190)+_0x5c1a95);return _0x5c1a95;}function trimmedEnv(_0xab3e91){const _0x52a7cf=a155_0x148c26,_0x2e54d5=productEnv(_0xab3e91)?.[_0x52a7cf(0x1a6)]();return _0x2e54d5?_0x2e54d5:undefined;}
@@ -1 +1 @@
1
- (function(_0x1d55cf,_0x5e39d5){const _0x2b7f5f=a156_0x3b2c,_0x410121=_0x1d55cf();while(!![]){try{const _0x1e4dff=-parseInt(_0x2b7f5f(0xff))/0x1+-parseInt(_0x2b7f5f(0x106))/0x2+parseInt(_0x2b7f5f(0x132))/0x3+parseInt(_0x2b7f5f(0x10a))/0x4*(parseInt(_0x2b7f5f(0x129))/0x5)+parseInt(_0x2b7f5f(0x130))/0x6+-parseInt(_0x2b7f5f(0x12f))/0x7*(parseInt(_0x2b7f5f(0x135))/0x8)+parseInt(_0x2b7f5f(0x113))/0x9;if(_0x1e4dff===_0x5e39d5)break;else _0x410121['push'](_0x410121['shift']());}catch(_0xdcb4ed){_0x410121['push'](_0x410121['shift']());}}}(a156_0x5a4a,0x4896a));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a156_0x2ec424}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(_0x22edc7,_0x10e514,_0x368ff3={}){const _0x40c3ac=a156_0x3b2c,_0x52889b=resolvePushDirectoryRoot(_0x22edc7),_0x1adb99=readPushMetadataIfPresent(resolve(_0x52889b,METADATA_FILE),{'ignoreInvalidMetadata':_0x368ff3[_0x40c3ac(0x12e)]});if(_0x1adb99?.[_0x40c3ac(0x117)]&&_0x1adb99[_0x40c3ac(0x117)]!==_0x10e514&&!_0x368ff3[_0x40c3ac(0x10e)]&&!_0x368ff3[_0x40c3ac(0x118)])throw CliErrors[_0x40c3ac(0x11e)](_0x40c3ac(0x110)+_0x1adb99['appCode']+'\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22'+_0x10e514+'\x22.');const _0x2e4a4f=resolvePushSkillCode(_0x52889b,_0x10e514,_0x1adb99,_0x368ff3);if(!_0x2e4a4f)throw CliErrors['validation']('Unable\x20to\x20resolve\x20skillCode\x20from\x20'+SKILL_FILE+',\x20'+METADATA_FILE+_0x40c3ac(0x133));return{'dir':_0x52889b,'skillCode':_0x2e4a4f,'metadata':_0x1adb99};}export function readPushDirectory(_0x129f79,_0x53c9b5,_0x5508b7={}){const _0x3b4238=a156_0x3b2c,_0x5c2547=resolvePushDirectoryIdentity(_0x129f79,_0x53c9b5,_0x5508b7),_0x33d45b=_0x5c2547[_0x3b4238(0x12d)],_0x13330f=resolve(_0x33d45b,SKILL_FILE);if(!existsSync(_0x13330f)||!lstatSync(_0x13330f)[_0x3b4238(0x11b)]())throw CliErrors['validation'](_0x3b4238(0x12c)+SKILL_FILE+':\x20'+_0x13330f);const _0x3f257c=_0x5c2547['metadata'],_0x1c6567=_0x5508b7[_0x3b4238(0x134)]??_0x3b4238(0x11f);if(!_0x5508b7['ignoreMetadataScope']&&_0x3f257c?.['scope']===_0x3b4238(0x123))throw CliErrors[_0x3b4238(0x11e)](_0x3b4238(0xfe)+METADATA_FILE+_0x3b4238(0x120)+_0x3f257c['scope']+'\x22.');if(!_0x5508b7[_0x3b4238(0x122)]&&_0x1c6567===_0x3b4238(0x11f)&&_0x3f257c?.[_0x3b4238(0x11d)]&&_0x3f257c['scope']!==_0x3b4238(0x11f))throw CliErrors[_0x3b4238(0x11e)](_0x3b4238(0x126)+METADATA_FILE+_0x3b4238(0x120)+_0x3f257c[_0x3b4238(0x11d)]+'\x22.',_0x3b4238(0x10b)+_0x33d45b+'\x20to\x20submit\x20company\x20Skills\x20for\x20review.');const _0x2d9159=scanSkillDirectory(_0x33d45b,{'excludedFilePaths':_0x5508b7[_0x3b4238(0x119)]}),_0x5b9220=buildSkillPackage(_0x2d9159),_0x368aa7=readFileSync(_0x13330f,'utf8'),_0x570f4c=_0x5c2547['skillCode'],_0x123568=_0x5508b7[_0x3b4238(0x128)]?undefined:_0x3f257c,_0x49712f=readSkillDisplayName(_0x368aa7);return{'skillCode':_0x570f4c,'metadata':_0x3f257c,'frontmatterDisplayName':_0x49712f,'input':{'skillCode':_0x570f4c,'skillName':_0x49712f??_0x123568?.[_0x3b4238(0x12a)],'description':_0x123568?.[_0x3b4238(0x10f)],'content':_0x368aa7,'files':_0x5b9220['manifest'],'packageBase64':_0x5b9220[_0x3b4238(0x104)],'tags':_0x123568?.[_0x3b4238(0x115)],'version':_0x123568?.[_0x3b4238(0x111)],'sourceSessionId':_0x123568?.[_0x3b4238(0x112)]}};}export function refreshPushDirectoryMetadataFromRemote(_0xa232c2,_0x31b330,_0x445d47,_0x77a2e5={}){const _0x3e3c15=a156_0x3b2c,_0x2e10d6=resolvePushDirectoryRoot(_0xa232c2),_0x3a1778=readPushMetadataIfPresent(resolve(_0x2e10d6,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x235ff8=requireRemoteScope(_0x31b330),_0x2009e7=readLocalSkillContent(_0x2e10d6),_0x3d0f5f={..._0x31b330,'appCode':_0x31b330[_0x3e3c15(0x117)]??_0x445d47,'skillName':_0x31b330[_0x3e3c15(0x12a)]??_0x3a1778?.[_0x3e3c15(0x12a)],'description':_0x31b330['description']??_0x3a1778?.[_0x3e3c15(0x10f)],'example':_0x31b330[_0x3e3c15(0x114)]??_0x3a1778?.[_0x3e3c15(0x114)],'tags':Array[_0x3e3c15(0x107)](_0x31b330[_0x3e3c15(0x115)])?_0x31b330[_0x3e3c15(0x115)]:_0x3a1778?.[_0x3e3c15(0x115)],'sourceSessionId':_0x31b330[_0x3e3c15(0x112)]??_0x3a1778?.[_0x3e3c15(0x112)],'content':_0x31b330['content']??_0x2009e7},_0xbfc267=buildMetadata(_0x3d0f5f,_0x235ff8,_0x445d47,contentHash(_0x2009e7),_0x77a2e5['refreshedAt']);writeJsonAtomic(resolve(_0x2e10d6,METADATA_FILE),_0xbfc267);}export function recordPushedRuntimeSkill(_0x59ddac,_0x529833,_0x1a1393,_0xbe42de={}){const _0x1acb3b=a156_0x3b2c,_0x23164d=resolvePushDirectoryRoot(_0x59ddac),_0x4f98aa=scanSkillDirectory(_0x23164d),_0x3ef49a=_0x4f98aa[_0x1acb3b(0x105)](_0x2f6433=>_0x2f6433[_0x1acb3b(0x100)]===SKILL_FILE),_0x2f58a5=_0x3ef49a?fileText(_0x3ef49a):'',_0x57c6b1=tryNormalizePackageManifest(_0x529833[_0x1acb3b(0x108)]),_0x4f572b={..._0x529833,'content':_0x529833[_0x1acb3b(0x102)]??_0x2f58a5,'files':_0x57c6b1},_0x9e446e=_0x57c6b1?normalizeLocalFiles(_0x4f98aa)[_0x1acb3b(0xfb)](_0x3f8b08=>_0x57c6b1[_0x1acb3b(0x108)][_0x1acb3b(0x131)](_0x122756=>_0x122756['path']===_0x3f8b08[_0x1acb3b(0x100)])):undefined,_0x1f68ee=buildMetadata(_0x4f572b,_0xbe42de[_0x1acb3b(0x11d)]??'personal',_0x1a1393,contentHash(_0x4f572b[_0x1acb3b(0x102)]??''),_0xbe42de[_0x1acb3b(0x11a)],_0x9e446e);writeJsonAtomic(resolve(_0x23164d,METADATA_FILE),_0x1f68ee);}function a156_0x3b2c(_0x59c621,_0x43e49a){_0x59c621=_0x59c621-0xf9;const _0x5a4ada=a156_0x5a4a();let _0x3b2c37=_0x5a4ada[_0x59c621];return _0x3b2c37;}export function deriveSkillCodeFromDirectory(_0x43c01d,_0x101632){const _0x13864a=a156_0x3b2c,_0x160616=basename(resolve(_0x43c01d)),_0x469d17=_0x101632+'--';return _0x160616[_0x13864a(0x101)](_0x469d17)?_0x160616[_0x13864a(0xf9)](_0x469d17[_0x13864a(0x121)]):_0x160616;}function a156_0x5a4a(){const _0x3e74e1=['version','sourceSessionId','4901553AdiQCj','example','tags','Remote\x20Skill\x20','appCode','ignoreMetadataAppCodeMismatch','excludedFilePaths','pushedAt','isFile','replace','scope','validation','personal','\x20has\x20scope=\x22','length','ignoreMetadataScope','builtin','trim','toLowerCase','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20','match','ignoreMetadataForPayload','802310tHhQhq','skillName','Invalid\x20','Missing\x20','dir','ignoreInvalidMetadata','14wENqph','1098234ATdyXD','some','985737zpJaMo',',\x20or\x20directory\x20name.','targetScope','1197928EKKJPC','slice','isDirectory','filter','skillCode','string','Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20','379361dDujLv','path','startsWith','content','ignoreMetadataSkillCode','packageBase64','find','481064OTiFBx','isArray','files','\x20name\x20for\x20SkillHub\x20slug\x20generation.','4LJWIuj','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20','Skill\x20directory\x20not\x20found:\x20','isSymbolicLink','allowAppCodeRetarget','description','Skill\x20metadata\x20appCode\x20\x22'];a156_0x5a4a=function(){return _0x3e74e1;};return a156_0x5a4a();}function resolvePushSkillCode(_0x32318c,_0x428ad2,_0x4a9ab5,_0x324bf3){const _0x47022c=a156_0x3b2c,_0x2090a1=deriveSkillCodeFromSkillFile(_0x32318c)||deriveSkillCodeFromDirectory(_0x32318c,_0x428ad2);if(_0x324bf3[_0x47022c(0x103)])return _0x2090a1;return _0x4a9ab5?.['skillCode']?.[_0x47022c(0x124)]()||_0x2090a1;}function deriveSkillCodeFromSkillFile(_0xebf16e){const _0x1edf78=a156_0x3b2c,_0xd59831=resolve(_0xebf16e,SKILL_FILE);if(!existsSync(_0xd59831)||!lstatSync(_0xd59831)['isFile']())return undefined;const _0xa3c69c=readFileSync(_0xd59831,'utf8'),_0x15c16f=_0xa3c69c[_0x1edf78(0x127)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x15c16f)return undefined;const _0x2bd81c=parseFrontmatterObject(_0x15c16f[0x1]??''),_0x3a1a2b=scalarToString(_0x2bd81c?.['name']);return _0x3a1a2b?slugifySkillName(_0x3a1a2b):undefined;}function readSkillDisplayName(_0x56050b){const _0x2d2c2c=a156_0x3b2c,_0x54a8e0=_0x56050b[_0x2d2c2c(0x127)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x54a8e0)return undefined;const _0x335e6f=parseFrontmatterObject(_0x54a8e0[0x1]??'');return scalarToString(_0x335e6f?.['displayName']);}function slugifySkillName(_0x2469e5){const _0x39261a=a156_0x3b2c,_0x328a59=_0x2469e5[_0x39261a(0x124)]()[_0x39261a(0x125)]()[_0x39261a(0x11c)](/[^\p{L}\p{N}\p{So}]+/gu,'-')[_0x39261a(0x11c)](/^-+/,'')[_0x39261a(0x11c)](/-+$/,'')[_0x39261a(0x11c)](/-{2,}/g,'-');if(!_0x328a59)throw CliErrors[_0x39261a(0x11e)](_0x39261a(0x12b)+SKILL_FILE+_0x39261a(0x109));return _0x328a59;}function parseFrontmatterObject(_0xa43fd){const _0x2e7d9a=a156_0x3b2c;try{const _0x3b29be=a156_0x2ec424(_0xa43fd);return _0x3b29be&&typeof _0x3b29be==='object'&&!Array[_0x2e7d9a(0x107)](_0x3b29be)?_0x3b29be:undefined;}catch{return undefined;}}function scalarToString(_0x4702c6){const _0x558238=a156_0x3b2c;if(typeof _0x4702c6===_0x558238(0xfd))return _0x4702c6[_0x558238(0x124)]();if(typeof _0x4702c6==='number'||typeof _0x4702c6==='boolean')return String(_0x4702c6);return undefined;}function resolvePushDirectoryRoot(_0x1ae2cf){const _0x5ad8cc=a156_0x3b2c,_0x373770=resolve(_0x1ae2cf);if(!existsSync(_0x373770))throw CliErrors['validation'](_0x5ad8cc(0x10c)+_0x1ae2cf);const _0x2df1ad=lstatSync(_0x373770);if(_0x2df1ad[_0x5ad8cc(0xfa)]())return _0x373770;if(_0x2df1ad[_0x5ad8cc(0x10d)]()){const _0x110419=realpathSync(_0x373770);if(lstatSync(_0x110419)[_0x5ad8cc(0xfa)]())return _0x110419;}throw CliErrors['validation']('Skill\x20directory\x20not\x20found:\x20'+_0x1ae2cf);}function requireRemoteScope(_0x2f2639){const _0x4e748f=a156_0x3b2c;if(_0x2f2639['scope']==='personal'||_0x2f2639[_0x4e748f(0x11d)]==='company'||_0x2f2639['scope']===_0x4e748f(0x123))return _0x2f2639[_0x4e748f(0x11d)];throw CliErrors[_0x4e748f(0x11e)](_0x4e748f(0x116)+(_0x2f2639[_0x4e748f(0xfc)]||'(unknown)')+'\x20has\x20unsupported\x20scope\x20\x22'+(_0x2f2639[_0x4e748f(0x11d)]??'unknown')+'\x22.');}function readLocalSkillContent(_0x294cc5){const _0x5bc7ed=resolve(_0x294cc5,SKILL_FILE);return existsSync(_0x5bc7ed)&&lstatSync(_0x5bc7ed)['isFile']()?readFileSync(_0x5bc7ed,'utf8'):'';}function readPushMetadataIfPresent(_0x1e215b,_0x54aab9={}){const _0xaf450a=a156_0x3b2c;try{return readMetadataIfPresent(_0x1e215b);}catch(_0x42acb2){if(_0x54aab9[_0xaf450a(0x12e)])return undefined;throw _0x42acb2;}}
1
+ (function(_0x1f8231,_0x153d6e){const _0x42e55=a156_0x42ef,_0x3dbbc4=_0x1f8231();while(!![]){try{const _0x4f15d8=-parseInt(_0x42e55(0xc3))/0x1*(-parseInt(_0x42e55(0xcc))/0x2)+parseInt(_0x42e55(0xe7))/0x3+parseInt(_0x42e55(0xc8))/0x4+parseInt(_0x42e55(0xd3))/0x5+-parseInt(_0x42e55(0xe4))/0x6+-parseInt(_0x42e55(0xf3))/0x7*(parseInt(_0x42e55(0xcf))/0x8)+-parseInt(_0x42e55(0xd6))/0x9;if(_0x4f15d8===_0x153d6e)break;else _0x3dbbc4['push'](_0x3dbbc4['shift']());}catch(_0x46edd8){_0x3dbbc4['push'](_0x3dbbc4['shift']());}}}(a156_0x35cc,0x5be1a));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';function a156_0x35cc(){const _0x57f6e7=['56wvHNub','some','(unknown)','trim','3085095zSwxta','startsWith','path','8739072usRyFZ','builtin','toLowerCase','tags','\x20has\x20unsupported\x20scope\x20\x22','ignoreMetadataSkillCode','unknown','isSymbolicLink','isFile','boolean','ignoreMetadataForPayload','allowAppCodeRetarget','packageBase64','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20','2893386mIYOQp','isDirectory','files','77904yqAgQl','ignoreMetadataAppCodeMismatch','Invalid\x20','length','\x20has\x20scope=\x22','Remote\x20Skill\x20','version','sourceSessionId','content','Skill\x20directory\x20not\x20found:\x20','isArray','description','279902OBZrRU','dir','example',',\x20or\x20directory\x20name.','Missing\x20','Skill\x20metadata\x20appCode\x20\x22','company','skillName','pushedAt','refreshedAt','appCode','targetScope','scope','utf8','filter','\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20','ignoreInvalidMetadata','\x20to\x20submit\x20company\x20Skills\x20for\x20review.','2mgtDTz','manifest','find','Unable\x20to\x20resolve\x20skillCode\x20from\x20','name','2983888uHweua','match','replace','validation','720528HoKgok','personal','skillCode'];a156_0x35cc=function(){return _0x57f6e7;};return a156_0x35cc();}import{parse as a156_0x43217a}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(_0x24c7ae,_0x129d36,_0x272f62={}){const _0xe57726=a156_0x42ef,_0x5179fb=resolvePushDirectoryRoot(_0x24c7ae),_0x533b1b=readPushMetadataIfPresent(resolve(_0x5179fb,METADATA_FILE),{'ignoreInvalidMetadata':_0x272f62[_0xe57726(0xc1)]});if(_0x533b1b?.[_0xe57726(0xba)]&&_0x533b1b[_0xe57726(0xba)]!==_0x129d36&&!_0x272f62[_0xe57726(0xe1)]&&!_0x272f62[_0xe57726(0xe8)])throw CliErrors[_0xe57726(0xcb)](_0xe57726(0xf8)+_0x533b1b[_0xe57726(0xba)]+_0xe57726(0xbf)+_0x129d36+'\x22.');const _0x2c925c=resolvePushSkillCode(_0x5179fb,_0x129d36,_0x533b1b,_0x272f62);if(!_0x2c925c)throw CliErrors[_0xe57726(0xcb)](_0xe57726(0xc6)+SKILL_FILE+',\x20'+METADATA_FILE+_0xe57726(0xf6));return{'dir':_0x5179fb,'skillCode':_0x2c925c,'metadata':_0x533b1b};}export function readPushDirectory(_0x8ac207,_0x2882b5,_0x25e563={}){const _0x1c13ad=a156_0x42ef,_0x282457=resolvePushDirectoryIdentity(_0x8ac207,_0x2882b5,_0x25e563),_0x26a5af=_0x282457[_0x1c13ad(0xf4)],_0x415560=resolve(_0x26a5af,SKILL_FILE);if(!existsSync(_0x415560)||!lstatSync(_0x415560)[_0x1c13ad(0xde)]())throw CliErrors[_0x1c13ad(0xcb)](_0x1c13ad(0xf7)+SKILL_FILE+':\x20'+_0x415560);const _0xe4d4e1=_0x282457['metadata'],_0x5e9534=_0x25e563[_0x1c13ad(0xbb)]??'personal';if(!_0x25e563['ignoreMetadataScope']&&_0xe4d4e1?.[_0x1c13ad(0xbc)]===_0x1c13ad(0xd7))throw CliErrors[_0x1c13ad(0xcb)]('Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20'+METADATA_FILE+_0x1c13ad(0xeb)+_0xe4d4e1['scope']+'\x22.');if(!_0x25e563['ignoreMetadataScope']&&_0x5e9534===_0x1c13ad(0xcd)&&_0xe4d4e1?.[_0x1c13ad(0xbc)]&&_0xe4d4e1['scope']!==_0x1c13ad(0xcd))throw CliErrors['validation'](_0x1c13ad(0xe3)+METADATA_FILE+'\x20has\x20scope=\x22'+_0xe4d4e1[_0x1c13ad(0xbc)]+'\x22.',_0x1c13ad(0xc0)+_0x26a5af+_0x1c13ad(0xc2));const _0x128f01=scanSkillDirectory(_0x26a5af,{'excludedFilePaths':_0x25e563['excludedFilePaths']}),_0x3be618=buildSkillPackage(_0x128f01),_0x12835e=readFileSync(_0x415560,_0x1c13ad(0xbd)),_0x3714dd=_0x282457['skillCode'],_0x28ac05=_0x25e563[_0x1c13ad(0xe0)]?undefined:_0xe4d4e1,_0x3ea223=readSkillDisplayName(_0x12835e);return{'skillCode':_0x3714dd,'metadata':_0xe4d4e1,'frontmatterDisplayName':_0x3ea223,'input':{'skillCode':_0x3714dd,'skillName':_0x3ea223??_0x28ac05?.[_0x1c13ad(0xb7)],'description':_0x28ac05?.['description'],'content':_0x12835e,'files':_0x3be618[_0x1c13ad(0xc4)],'packageBase64':_0x3be618[_0x1c13ad(0xe2)],'tags':_0x28ac05?.[_0x1c13ad(0xd9)],'version':_0x28ac05?.[_0x1c13ad(0xed)],'sourceSessionId':_0x28ac05?.[_0x1c13ad(0xee)]}};}export function refreshPushDirectoryMetadataFromRemote(_0x1b2004,_0x54ac04,_0x2d0684,_0x12f58b={}){const _0x3385ac=a156_0x42ef,_0x1e331b=resolvePushDirectoryRoot(_0x1b2004),_0x42f74d=readPushMetadataIfPresent(resolve(_0x1e331b,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x2e139d=requireRemoteScope(_0x54ac04),_0x58287e=readLocalSkillContent(_0x1e331b),_0x1f0766={..._0x54ac04,'appCode':_0x54ac04[_0x3385ac(0xba)]??_0x2d0684,'skillName':_0x54ac04[_0x3385ac(0xb7)]??_0x42f74d?.['skillName'],'description':_0x54ac04[_0x3385ac(0xf2)]??_0x42f74d?.[_0x3385ac(0xf2)],'example':_0x54ac04[_0x3385ac(0xf5)]??_0x42f74d?.['example'],'tags':Array['isArray'](_0x54ac04['tags'])?_0x54ac04[_0x3385ac(0xd9)]:_0x42f74d?.[_0x3385ac(0xd9)],'sourceSessionId':_0x54ac04[_0x3385ac(0xee)]??_0x42f74d?.[_0x3385ac(0xee)],'content':_0x54ac04[_0x3385ac(0xef)]??_0x58287e},_0x3523e8=buildMetadata(_0x1f0766,_0x2e139d,_0x2d0684,contentHash(_0x58287e),_0x12f58b[_0x3385ac(0xb9)]);writeJsonAtomic(resolve(_0x1e331b,METADATA_FILE),_0x3523e8);}export function recordPushedRuntimeSkill(_0x588787,_0x3ca2d0,_0x385159,_0x24a3fa={}){const _0x43c58b=a156_0x42ef,_0x3f59a8=resolvePushDirectoryRoot(_0x588787),_0x3a5576=scanSkillDirectory(_0x3f59a8),_0x3162fa=_0x3a5576[_0x43c58b(0xc5)](_0x236e46=>_0x236e46[_0x43c58b(0xd5)]===SKILL_FILE),_0x350aec=_0x3162fa?fileText(_0x3162fa):'',_0x5c2447=tryNormalizePackageManifest(_0x3ca2d0[_0x43c58b(0xe6)]),_0x426809={..._0x3ca2d0,'content':_0x3ca2d0[_0x43c58b(0xef)]??_0x350aec,'files':_0x5c2447},_0x1c214b=_0x5c2447?normalizeLocalFiles(_0x3a5576)[_0x43c58b(0xbe)](_0x5a41ca=>_0x5c2447[_0x43c58b(0xe6)][_0x43c58b(0xd0)](_0x3bf07b=>_0x3bf07b[_0x43c58b(0xd5)]===_0x5a41ca['path'])):undefined,_0x10474c=buildMetadata(_0x426809,_0x24a3fa[_0x43c58b(0xbc)]??_0x43c58b(0xcd),_0x385159,contentHash(_0x426809[_0x43c58b(0xef)]??''),_0x24a3fa[_0x43c58b(0xb8)],_0x1c214b);writeJsonAtomic(resolve(_0x3f59a8,METADATA_FILE),_0x10474c);}export function deriveSkillCodeFromDirectory(_0x27974a,_0xb2cc4d){const _0x1c5987=a156_0x42ef,_0x485922=basename(resolve(_0x27974a)),_0xcd01bd=_0xb2cc4d+'--';return _0x485922[_0x1c5987(0xd4)](_0xcd01bd)?_0x485922['slice'](_0xcd01bd[_0x1c5987(0xea)]):_0x485922;}function resolvePushSkillCode(_0x3addd6,_0x11b039,_0x7ffeaf,_0x3f84d1){const _0x50865a=a156_0x42ef,_0x4b6b10=deriveSkillCodeFromSkillFile(_0x3addd6)||deriveSkillCodeFromDirectory(_0x3addd6,_0x11b039);if(_0x3f84d1[_0x50865a(0xdb)])return _0x4b6b10;return _0x7ffeaf?.[_0x50865a(0xce)]?.['trim']()||_0x4b6b10;}function deriveSkillCodeFromSkillFile(_0x477b5d){const _0x209409=a156_0x42ef,_0x43175a=resolve(_0x477b5d,SKILL_FILE);if(!existsSync(_0x43175a)||!lstatSync(_0x43175a)[_0x209409(0xde)]())return undefined;const _0x1458d2=readFileSync(_0x43175a,_0x209409(0xbd)),_0x39c1c8=_0x1458d2['match'](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x39c1c8)return undefined;const _0x3b796c=parseFrontmatterObject(_0x39c1c8[0x1]??''),_0x9c4be4=scalarToString(_0x3b796c?.[_0x209409(0xc7)]);return _0x9c4be4?slugifySkillName(_0x9c4be4):undefined;}function readSkillDisplayName(_0x532c08){const _0x4c754b=a156_0x42ef,_0x3d0833=_0x532c08[_0x4c754b(0xc9)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x3d0833)return undefined;const _0x7e0395=parseFrontmatterObject(_0x3d0833[0x1]??'');return scalarToString(_0x7e0395?.['displayName']);}function slugifySkillName(_0x59566c){const _0x14d784=a156_0x42ef,_0x221eba=_0x59566c[_0x14d784(0xd2)]()[_0x14d784(0xd8)]()[_0x14d784(0xca)](/[^\p{L}\p{N}\p{So}]+/gu,'-')[_0x14d784(0xca)](/^-+/,'')[_0x14d784(0xca)](/-+$/,'')[_0x14d784(0xca)](/-{2,}/g,'-');if(!_0x221eba)throw CliErrors[_0x14d784(0xcb)](_0x14d784(0xe9)+SKILL_FILE+'\x20name\x20for\x20SkillHub\x20slug\x20generation.');return _0x221eba;}function parseFrontmatterObject(_0x33c28a){const _0xdb584e=a156_0x42ef;try{const _0x5a3e79=a156_0x43217a(_0x33c28a);return _0x5a3e79&&typeof _0x5a3e79==='object'&&!Array[_0xdb584e(0xf1)](_0x5a3e79)?_0x5a3e79:undefined;}catch{return undefined;}}function scalarToString(_0x3e572a){const _0x4c2c0c=a156_0x42ef;if(typeof _0x3e572a==='string')return _0x3e572a[_0x4c2c0c(0xd2)]();if(typeof _0x3e572a==='number'||typeof _0x3e572a===_0x4c2c0c(0xdf))return String(_0x3e572a);return undefined;}function resolvePushDirectoryRoot(_0x474db0){const _0x513b80=a156_0x42ef,_0x5b4dd8=resolve(_0x474db0);if(!existsSync(_0x5b4dd8))throw CliErrors['validation'](_0x513b80(0xf0)+_0x474db0);const _0x2cff28=lstatSync(_0x5b4dd8);if(_0x2cff28['isDirectory']())return _0x5b4dd8;if(_0x2cff28[_0x513b80(0xdd)]()){const _0x5cb3c7=realpathSync(_0x5b4dd8);if(lstatSync(_0x5cb3c7)[_0x513b80(0xe5)]())return _0x5cb3c7;}throw CliErrors[_0x513b80(0xcb)](_0x513b80(0xf0)+_0x474db0);}function a156_0x42ef(_0x6c4599,_0x5de2b8){_0x6c4599=_0x6c4599-0xb7;const _0x35cc24=a156_0x35cc();let _0x42ef13=_0x35cc24[_0x6c4599];return _0x42ef13;}function requireRemoteScope(_0x2553cc){const _0x2e6478=a156_0x42ef;if(_0x2553cc[_0x2e6478(0xbc)]===_0x2e6478(0xcd)||_0x2553cc[_0x2e6478(0xbc)]===_0x2e6478(0xf9)||_0x2553cc[_0x2e6478(0xbc)]===_0x2e6478(0xd7))return _0x2553cc[_0x2e6478(0xbc)];throw CliErrors[_0x2e6478(0xcb)](_0x2e6478(0xec)+(_0x2553cc[_0x2e6478(0xce)]||_0x2e6478(0xd1))+_0x2e6478(0xda)+(_0x2553cc[_0x2e6478(0xbc)]??_0x2e6478(0xdc))+'\x22.');}function readLocalSkillContent(_0x395aaa){const _0xd01e28=a156_0x42ef,_0x5dcfbe=resolve(_0x395aaa,SKILL_FILE);return existsSync(_0x5dcfbe)&&lstatSync(_0x5dcfbe)[_0xd01e28(0xde)]()?readFileSync(_0x5dcfbe,_0xd01e28(0xbd)):'';}function readPushMetadataIfPresent(_0x2a1955,_0x4af8a6={}){try{return readMetadataIfPresent(_0x2a1955);}catch(_0x47a517){if(_0x4af8a6['ignoreInvalidMetadata'])return undefined;throw _0x47a517;}}