@lovrabet/lovrabet-cli 2.2.7 → 2.3.0-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 (186) hide show
  1. package/lib/cli.js +1 -1
  2. package/lib/commands/api-doc/index.js +1 -1
  3. package/lib/commands/app/cache.js +1 -1
  4. package/lib/commands/app/definitions.js +1 -1
  5. package/lib/commands/app/eligibility.js +1 -1
  6. package/lib/commands/app/mock-loader.js +1 -1
  7. package/lib/commands/app/remote-source.js +1 -1
  8. package/lib/commands/app/shared.js +1 -1
  9. package/lib/commands/app-config/get.js +1 -1
  10. package/lib/commands/app-config/index.js +1 -1
  11. package/lib/commands/artifact/index.js +1 -1
  12. package/lib/commands/auth/device.js +1 -1
  13. package/lib/commands/auth/index.js +1 -1
  14. package/lib/commands/auth/prompt.js +1 -1
  15. package/lib/commands/bff/detail.js +1 -1
  16. package/lib/commands/bff/exec.js +1 -1
  17. package/lib/commands/bff/index.js +1 -1
  18. package/lib/commands/cli-skill/index.js +1 -1
  19. package/lib/commands/common/config-policy.d.ts +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.d.ts +12 -0
  26. package/lib/commands/config/init.js +1 -0
  27. package/lib/commands/config/shared.d.ts +1 -1
  28. package/lib/commands/config/shared.js +1 -1
  29. package/lib/commands/data/index.js +1 -1
  30. package/lib/commands/dataset/detail.js +1 -1
  31. package/lib/commands/dataset/index.js +1 -1
  32. package/lib/commands/dataset/list.js +1 -1
  33. package/lib/commands/dataset/sdk-doc.js +1 -1
  34. package/lib/commands/doctor.js +1 -1
  35. package/lib/commands/file/index.js +1 -1
  36. package/lib/commands/init.js +1 -1
  37. package/lib/commands/kb/index.js +1 -1
  38. package/lib/commands/logs/index.js +1 -1
  39. package/lib/commands/notification/config-list.js +1 -1
  40. package/lib/commands/notification/index.js +1 -1
  41. package/lib/commands/notification/shared.js +1 -1
  42. package/lib/commands/ocr/index.js +1 -1
  43. package/lib/commands/permit/dataset-get.js +1 -1
  44. package/lib/commands/permit/dataset-set.js +1 -1
  45. package/lib/commands/permit/index.js +1 -1
  46. package/lib/commands/permit/page-get.js +1 -1
  47. package/lib/commands/permit/page-set.js +1 -1
  48. package/lib/commands/permit/role-menus-set.js +1 -1
  49. package/lib/commands/permit/role-menus.js +1 -1
  50. package/lib/commands/permit/shared.js +1 -1
  51. package/lib/commands/personal-bff/index.js +1 -1
  52. package/lib/commands/registry.js +1 -1
  53. package/lib/commands/role/create.js +1 -1
  54. package/lib/commands/role/delete.js +1 -1
  55. package/lib/commands/role/detail.js +1 -1
  56. package/lib/commands/role/index.js +1 -1
  57. package/lib/commands/role/list.js +1 -1
  58. package/lib/commands/role/shared.js +1 -1
  59. package/lib/commands/role/update.js +1 -1
  60. package/lib/commands/role/user-add.js +1 -1
  61. package/lib/commands/role/user-remove.js +1 -1
  62. package/lib/commands/schedule/index.js +1 -1
  63. package/lib/commands/schema.js +1 -1
  64. package/lib/commands/service/dynamic.js +1 -1
  65. package/lib/commands/service/function-name-adapter.js +1 -1
  66. package/lib/commands/service/index.js +1 -1
  67. package/lib/commands/service/registry.js +1 -1
  68. package/lib/commands/skill/commands/create.js +1 -1
  69. package/lib/commands/skill/commands/diagram.js +1 -1
  70. package/lib/commands/skill/commands/install.js +1 -1
  71. package/lib/commands/skill/commands/list.js +1 -1
  72. package/lib/commands/skill/commands/push.js +1 -1
  73. package/lib/commands/skill/commands/validate.js +1 -1
  74. package/lib/commands/skill/diagram.js +1 -1
  75. package/lib/commands/skill/flags.js +1 -1
  76. package/lib/commands/skill/index.js +1 -1
  77. package/lib/commands/skill/manifest-helpers.js +1 -1
  78. package/lib/commands/skill/push-execute.js +1 -1
  79. package/lib/commands/skill/push-flow-helpers.js +1 -1
  80. package/lib/commands/skill/push-retarget.js +1 -1
  81. package/lib/commands/skill/scopes.js +1 -1
  82. package/lib/commands/skill/summary.js +1 -1
  83. package/lib/commands/skill/templates.js +1 -1
  84. package/lib/commands/skill/validate.js +1 -1
  85. package/lib/commands/sql/detail.js +1 -1
  86. package/lib/commands/sql/exec.js +1 -1
  87. package/lib/commands/sql/index.js +1 -1
  88. package/lib/commands/update.js +1 -1
  89. package/lib/commands/user-account/bind.js +1 -1
  90. package/lib/commands/user-account/index.js +1 -1
  91. package/lib/commands/workspace/index.js +1 -1
  92. package/lib/config/domain-config.d.ts +11 -0
  93. package/lib/config/domain-config.js +1 -0
  94. package/lib/config/schema.d.ts +7 -1
  95. package/lib/config/schema.js +1 -1
  96. package/lib/constant/app.js +1 -1
  97. package/lib/constant/auth-mode.js +1 -1
  98. package/lib/constant/cli.js +1 -1
  99. package/lib/constant/defaults.js +1 -1
  100. package/lib/constant/distribution.d.ts +4 -0
  101. package/lib/constant/distribution.js +1 -1
  102. package/lib/constant/domain.d.ts +10 -3
  103. package/lib/constant/domain.js +1 -1
  104. package/lib/constant/env.js +1 -1
  105. package/lib/constant/output.js +1 -1
  106. package/lib/constant/product.d.ts +52 -14
  107. package/lib/constant/product.js +1 -1
  108. package/lib/constant/region.d.ts +15 -0
  109. package/lib/constant/region.js +1 -0
  110. package/lib/constant/risk.js +1 -1
  111. package/lib/constant/url.d.ts +2 -0
  112. package/lib/constant/url.js +1 -1
  113. package/lib/context.d.ts +2 -6
  114. package/lib/context.js +1 -1
  115. package/lib/core/api-client.js +1 -1
  116. package/lib/core/db-resolver.js +1 -1
  117. package/lib/core/sdk-client.d.ts +2 -0
  118. package/lib/core/sdk-client.js +1 -1
  119. package/lib/errors.js +1 -1
  120. package/lib/framework/build-all-flags.js +1 -1
  121. package/lib/framework/dryrun.js +1 -1
  122. package/lib/framework/flags.js +1 -1
  123. package/lib/framework/help.js +1 -1
  124. package/lib/framework/index.js +1 -1
  125. package/lib/framework/output.js +1 -1
  126. package/lib/framework/preparse.js +1 -1
  127. package/lib/framework/rate-limit.js +1 -1
  128. package/lib/framework/raw-flags.js +1 -1
  129. package/lib/framework/response.js +1 -1
  130. package/lib/framework/runner-confirmation.js +1 -1
  131. package/lib/framework/runner-error.js +1 -1
  132. package/lib/framework/runner.d.ts +3 -1
  133. package/lib/framework/runner.js +1 -1
  134. package/lib/framework/schema-export.js +1 -1
  135. package/lib/framework/service-order.js +1 -1
  136. package/lib/framework/types.js +1 -1
  137. package/lib/generated/build-info.d.ts +4 -4
  138. package/lib/generated/build-info.js +1 -1
  139. package/lib/help.js +1 -1
  140. package/lib/postinstall.js +1 -1
  141. package/lib/runtime/confirmation.js +1 -1
  142. package/lib/runtime/event.js +1 -1
  143. package/lib/runtime/index.js +1 -1
  144. package/lib/runtime/queue.js +1 -1
  145. package/lib/runtime/resolve.js +1 -1
  146. package/lib/skills/builtin-skill.js +1 -1
  147. package/lib/skills/npx-skills-add.js +1 -1
  148. package/lib/skills/runtime-skill-sync/constants.js +1 -1
  149. package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
  150. package/lib/skills/runtime-skill-sync/hashing.js +1 -1
  151. package/lib/skills/runtime-skill-sync/install-target.js +1 -1
  152. package/lib/skills/runtime-skill-sync/links.js +1 -1
  153. package/lib/skills/runtime-skill-sync/list-local.js +1 -1
  154. package/lib/skills/runtime-skill-sync/local-files.js +1 -1
  155. package/lib/skills/runtime-skill-sync/materialize.js +1 -1
  156. package/lib/skills/runtime-skill-sync/metadata.js +1 -1
  157. package/lib/skills/runtime-skill-sync/paths.js +1 -1
  158. package/lib/skills/runtime-skill-sync/push.js +1 -1
  159. package/lib/skills/runtime-skill-sync/scopes.js +1 -1
  160. package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
  161. package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
  162. package/lib/skills/runtime-skill-sync.js +1 -1
  163. package/lib/skills/skill-presence.js +1 -1
  164. package/lib/utils/access-key-redaction.d.ts +15 -0
  165. package/lib/utils/access-key-redaction.js +1 -0
  166. package/lib/utils/apply-jq-filter.js +1 -1
  167. package/lib/utils/cli-version-check.d.ts +12 -0
  168. package/lib/utils/cli-version-check.js +1 -0
  169. package/lib/utils/cli-version-policy.d.ts +12 -0
  170. package/lib/utils/cli-version-policy.js +1 -0
  171. package/lib/utils/logger.js +1 -1
  172. package/lib/utils/lossless-json.js +1 -1
  173. package/lib/utils/params.js +1 -1
  174. package/lib/utils/platform.js +1 -1
  175. package/lib/utils/update-notice.d.ts +2 -1
  176. package/lib/utils/update-notice.js +1 -1
  177. package/lib/utils/version.js +1 -1
  178. package/lib/utils/write-cli-side-channel.js +1 -1
  179. package/package.json +3 -1
  180. package/skills/lovrabet/SKILL.md +11 -12
  181. package/skills/lovrabet/guides/troubleshooting.md +12 -8
  182. package/skills/lovrabet/references/lovrabet-app.md +1 -1
  183. package/skills/lovrabet/references/lovrabet-auth.md +7 -25
  184. package/skills/lovrabet/references/lovrabet-config-commands.md +42 -5
  185. package/skills/lovrabet/references/lovrabet-config.md +25 -5
  186. package/skills/lovrabet.manifest.json +3 -3
@@ -1 +1 @@
1
- const a129_0x37f425=a129_0x17ae;(function(_0x25daf3,_0x3eec0c){const _0xcfe68f=a129_0x17ae,_0x21775f=_0x25daf3();while(!![]){try{const _0xfa0786=parseInt(_0xcfe68f(0xfc))/0x1+-parseInt(_0xcfe68f(0x105))/0x2+parseInt(_0xcfe68f(0xd6))/0x3+parseInt(_0xcfe68f(0xdb))/0x4+parseInt(_0xcfe68f(0xd3))/0x5+parseInt(_0xcfe68f(0xeb))/0x6*(parseInt(_0xcfe68f(0xf6))/0x7)+-parseInt(_0xcfe68f(0xed))/0x8*(parseInt(_0xcfe68f(0xf9))/0x9);if(_0xfa0786===_0x3eec0c)break;else _0x21775f['push'](_0x21775f['shift']());}catch(_0x3bfe43){_0x21775f['push'](_0x21775f['shift']());}}}(a129_0x162f,0xb4b79));import{createHash}from'node:crypto';function a129_0x162f(){const _0x271aed=['SKILL.md','error','flatMap','content_mismatch','Unsafe\x20manifest\x20path:\x20','state','join','split','digest','isFile','8045922CfRgWX','includes','256whsEru','match',':\x5cs*(.+)$','update','unknown','unverifiable','Symbolic\x20link\x20is\x20not\x20allowed:\x20','packageRoot','parse','7XAuSIR','absent','utf8','931734hzcUBt','sha256','pipe','338887TXuhyR','Installed\x20Skill\x20state\x20is\x20','files','reason','every','startsWith','home','missing','INSTALL_FAILED','262106jXGHJW','schemaVersion','manifest','packageVersion','trim','root','lovrabet.manifest.json','skills','sort','lovrabet\x20cli-skill\x20install','installedPath','lovrabet','4061520cHaiLu','skillVersion','current','2973732QcsXCh','message','present','version','path','2802720TAuRlj','skills@latest\x20exited\x20','length','version_mismatch','isSymbolicLink','name'];a129_0x162f=function(){return _0x271aed;};return a129_0x162f();}import{lstatSync,readFileSync,readdirSync}from'node:fs';import{homedir}from'node:os';import{dirname,join,relative,resolve,sep}from'node:path';import{fileURLToPath}from'node:url';import{runNpxSkillsAddGlobal}from'../skills/npx-skills-add.js';import{resolveInstalledSkill}from'../skills/skill-presence.js';const DEFAULT_PACKAGE_ROOT=resolve(dirname(fileURLToPath(import.meta.url)),'..','..'),REPAIR_COMMAND=a129_0x37f425(0xd0),SKILL_NAME=a129_0x37f425(0xd2);function frontmatterValue(_0x10c562,_0xd00fc1){const _0x519e60=a129_0x37f425;return _0x10c562[_0x519e60(0xee)](new RegExp('^'+_0xd00fc1+_0x519e60(0xef),'m'))?.[0x1]?.[_0x519e60(0x109)]()??'';}function listFiles(_0x404e8f,_0x15a1f9=_0x404e8f){const _0x2a06a1=a129_0x37f425;return readdirSync(_0x15a1f9,{'withFileTypes':!![]})[_0x2a06a1(0xe3)](_0x46b191=>{const _0x8c2973=_0x2a06a1,_0x25d5e3=join(_0x15a1f9,_0x46b191['name']),_0x13c098=lstatSync(_0x25d5e3);if(_0x13c098[_0x8c2973(0xdf)]())throw new Error(_0x8c2973(0xf3)+_0x25d5e3);if(_0x13c098['isDirectory']())return listFiles(_0x404e8f,_0x25d5e3);if(!_0x13c098[_0x8c2973(0xea)]())throw new Error('Unsupported\x20Skill\x20entry:\x20'+_0x25d5e3);return[relative(_0x404e8f,_0x25d5e3)['split'](sep)[_0x8c2973(0xe7)]('/')];})[_0x2a06a1(0xcf)]((_0x323929,_0x11caab)=>_0x323929<_0x11caab?-0x1:_0x323929>_0x11caab?0x1:0x0);}function digestFiles(_0x5aa5cd,_0x2b91f3){const _0x2683cb=a129_0x37f425,_0x1680f1=createHash(_0x2683cb(0xfa));for(const _0x1f7a2c of _0x2b91f3){if(_0x1f7a2c[_0x2683cb(0x101)]('/')||_0x1f7a2c[_0x2683cb(0xe8)]('/')[_0x2683cb(0xec)]('..')||_0x1f7a2c[_0x2683cb(0xec)]('\x5c'))throw new Error(_0x2683cb(0xe5)+_0x1f7a2c);_0x1680f1[_0x2683cb(0xf0)](_0x1f7a2c),_0x1680f1[_0x2683cb(0xf0)]('\x00'),_0x1680f1[_0x2683cb(0xf0)](readFileSync(join(_0x5aa5cd,..._0x1f7a2c[_0x2683cb(0xe8)]('/')))),_0x1680f1[_0x2683cb(0xf0)]('\x00');}return _0x1680f1[_0x2683cb(0xe9)]('hex');}function sameFiles(_0x15e2f7,_0x2fb966){const _0x2f7d8d=a129_0x37f425;return _0x15e2f7[_0x2f7d8d(0xdd)]===_0x2fb966[_0x2f7d8d(0xdd)]&&_0x15e2f7[_0x2f7d8d(0x100)]((_0x386c98,_0x320ab2)=>_0x386c98===_0x2fb966[_0x320ab2]);}function readSource(_0x388819){const _0x22a041=a129_0x37f425,_0x50ab02=JSON[_0x22a041(0xf5)](readFileSync(join(_0x388819,'package.json'),'utf8')),_0x492238=JSON['parse'](readFileSync(join(_0x388819,_0x22a041(0x10c),_0x22a041(0x10b)),_0x22a041(0xf8))),_0x28c62d=join(_0x388819,_0x22a041(0x10c),SKILL_NAME),_0x251bf9=frontmatterValue(readFileSync(join(_0x28c62d,'SKILL.md'),'utf8'),_0x22a041(0xd9)),_0x5d21c7=listFiles(_0x28c62d);if(_0x492238[_0x22a041(0x106)]!==0x1||_0x492238[_0x22a041(0xe0)]!==SKILL_NAME||!_0x50ab02['version']||_0x492238[_0x22a041(0x108)]!==_0x50ab02[_0x22a041(0xd9)]||_0x492238[_0x22a041(0xd4)]!==_0x50ab02['version']||_0x251bf9!==_0x50ab02[_0x22a041(0xd9)]||!sameFiles(_0x5d21c7,_0x492238[_0x22a041(0xfe)])||digestFiles(_0x28c62d,_0x5d21c7)!==_0x492238[_0x22a041(0xe9)])throw new Error('Built-in\x20Skill\x20source\x20does\x20not\x20match\x20its\x20package\x20manifest');return{'packageVersion':_0x50ab02[_0x22a041(0xd9)],'skillVersion':_0x251bf9,'root':_0x28c62d,'manifest':_0x492238};}function installedSkillPath(_0x563f69){const _0x48ef4c=a129_0x37f425,_0x3f4e7a=resolveInstalledSkill(SKILL_NAME,{'home':_0x563f69});if(_0x3f4e7a[_0x48ef4c(0xe6)]==='present')return{'state':_0x48ef4c(0xd8),'path':dirname(_0x3f4e7a[_0x48ef4c(0xda)])};if(_0x3f4e7a['state']===_0x48ef4c(0xf7))return{'state':_0x48ef4c(0x103)};return{'state':_0x48ef4c(0xf2),'reason':_0x3f4e7a[_0x48ef4c(0xff)]};}export function inspectInstalledBuiltinSkillVersion(_0x33bbec,_0x43fbf3={}){const _0x4db1ad=a129_0x37f425,_0x4d5b7c=installedSkillPath(_0x43fbf3['home']??homedir());if(_0x4d5b7c[_0x4db1ad(0xe6)]==='missing')return{'state':'missing','expectedVersion':_0x33bbec,'repairCommand':REPAIR_COMMAND};if(_0x4d5b7c[_0x4db1ad(0xe6)]==='unverifiable')return{'state':'unverifiable','expectedVersion':_0x33bbec,'reason':_0x4d5b7c[_0x4db1ad(0xff)],'repairCommand':REPAIR_COMMAND};try{const _0x1bd686=frontmatterValue(readFileSync(join(_0x4d5b7c[_0x4db1ad(0xda)],_0x4db1ad(0xe1)),'utf8'),_0x4db1ad(0xd9));return{'state':_0x1bd686===_0x33bbec?_0x4db1ad(0xd5):'version_mismatch','expectedVersion':_0x33bbec,'skillVersion':_0x1bd686,'installedPath':_0x4d5b7c[_0x4db1ad(0xda)],'repairCommand':REPAIR_COMMAND};}catch(_0x355056){return{'state':'unverifiable','expectedVersion':_0x33bbec,'installedPath':_0x4d5b7c[_0x4db1ad(0xda)],'reason':_0x355056 instanceof Error?_0x355056[_0x4db1ad(0xd7)]:String(_0x355056),'repairCommand':REPAIR_COMMAND};}}function a129_0x17ae(_0x1ef788,_0x3b83c5){_0x1ef788=_0x1ef788-0xcf;const _0x162f92=a129_0x162f();let _0x17ae71=_0x162f92[_0x1ef788];return _0x17ae71;}export function inspectBuiltinSkill(_0x32b10a={}){const _0x8f856c=a129_0x37f425,_0x1313ae=_0x32b10a[_0x8f856c(0xf4)]??DEFAULT_PACKAGE_ROOT;let _0xbc2dcb;try{_0xbc2dcb=readSource(_0x1313ae);}catch(_0x1fd85d){return{'state':_0x8f856c(0xf2),'packageVersion':_0x8f856c(0xf1),'reason':_0x1fd85d instanceof Error?_0x1fd85d[_0x8f856c(0xd7)]:String(_0x1fd85d),'repairCommand':REPAIR_COMMAND};}const _0x5d0dc0=installedSkillPath(_0x32b10a[_0x8f856c(0x102)]??homedir());if(_0x5d0dc0[_0x8f856c(0xe6)]===_0x8f856c(0x103))return{'state':_0x8f856c(0x103),'packageVersion':_0xbc2dcb[_0x8f856c(0x108)],'repairCommand':REPAIR_COMMAND};if(_0x5d0dc0[_0x8f856c(0xe6)]==='unverifiable')return{'state':_0x8f856c(0xf2),'packageVersion':_0xbc2dcb[_0x8f856c(0x108)],'reason':_0x5d0dc0[_0x8f856c(0xff)],'repairCommand':REPAIR_COMMAND};try{const _0xff80bf=frontmatterValue(readFileSync(join(_0x5d0dc0[_0x8f856c(0xda)],_0x8f856c(0xe1)),_0x8f856c(0xf8)),_0x8f856c(0xd9));if(_0xff80bf!==_0xbc2dcb[_0x8f856c(0xd4)])return{'state':_0x8f856c(0xde),'packageVersion':_0xbc2dcb[_0x8f856c(0x108)],'skillVersion':_0xff80bf,'installedPath':_0x5d0dc0[_0x8f856c(0xda)],'repairCommand':REPAIR_COMMAND};const _0x4dd0fb=listFiles(_0x5d0dc0[_0x8f856c(0xda)]),_0x3bdb77=digestFiles(_0x5d0dc0['path'],_0x4dd0fb);return{'state':sameFiles(_0x4dd0fb,_0xbc2dcb[_0x8f856c(0x107)][_0x8f856c(0xfe)])&&_0x3bdb77===_0xbc2dcb[_0x8f856c(0x107)]['digest']?_0x8f856c(0xd5):_0x8f856c(0xe4),'packageVersion':_0xbc2dcb[_0x8f856c(0x108)],'skillVersion':_0xff80bf,'installedPath':_0x5d0dc0[_0x8f856c(0xda)],'digest':_0x3bdb77,'repairCommand':REPAIR_COMMAND};}catch(_0xc5bcd5){return{'state':_0x8f856c(0xf2),'packageVersion':_0xbc2dcb['packageVersion'],'installedPath':_0x5d0dc0['path'],'reason':_0xc5bcd5 instanceof Error?_0xc5bcd5['message']:String(_0xc5bcd5),'repairCommand':REPAIR_COMMAND};}}function failure(_0x191549,_0x166b04,_0x266c59,_0x3fb194){const _0x35d3db=a129_0x37f425;return{'ok':![],'code':_0x191549,'packageVersion':_0x166b04[_0x35d3db(0x108)],'skillVersion':_0x166b04['skillVersion'],'installedPath':_0x3fb194,'changed':![],'repairCommand':REPAIR_COMMAND,'error':_0x266c59 instanceof Error?_0x266c59[_0x35d3db(0xd7)]:String(_0x266c59)};}export function installBuiltinSkill(_0x286c20={}){const _0x3fe854=a129_0x37f425,_0x3377ab=_0x286c20[_0x3fe854(0xf4)]??DEFAULT_PACKAGE_ROOT,_0x2e0c57=_0x286c20[_0x3fe854(0x102)]??homedir();let _0x54ddbe;try{_0x54ddbe=readSource(_0x3377ab);}catch(_0x3cb7e8){return failure('SOURCE_INVALID',{'packageVersion':'unknown','skillVersion':_0x3fe854(0xf1)},_0x3cb7e8);}const _0x269d35=inspectBuiltinSkill({'packageRoot':_0x3377ab,'home':_0x2e0c57}),_0x457c6a=runNpxSkillsAddGlobal(_0x3377ab,_0x54ddbe[_0x3fe854(0x10a)],{'stdio':_0x286c20['stdio']??_0x3fe854(0xfb),'expectedSkillName':SKILL_NAME,'presence':{'home':_0x2e0c57}});if(_0x457c6a['skipped'])return{'ok':!![],'packageVersion':_0x54ddbe[_0x3fe854(0x108)],'skillVersion':_0x54ddbe[_0x3fe854(0xd4)],'installedPath':_0x269d35['installedPath'],'changed':![],'repairCommand':REPAIR_COMMAND};if(!_0x457c6a['ok'])return failure(_0x3fe854(0x104),_0x54ddbe,_0x457c6a[_0x3fe854(0xe2)]??_0x3fe854(0xdc)+_0x457c6a['status']);const _0x530e5e=inspectBuiltinSkill({'packageRoot':_0x3377ab,'home':_0x2e0c57});if(_0x530e5e['state']!==_0x3fe854(0xd5))return failure('VERIFY_FAILED',_0x54ddbe,_0x530e5e[_0x3fe854(0xff)]??_0x3fe854(0xfd)+_0x530e5e['state'],_0x530e5e[_0x3fe854(0xd1)]);return{'ok':!![],'packageVersion':_0x54ddbe[_0x3fe854(0x108)],'skillVersion':_0x54ddbe['skillVersion'],'installedPath':_0x530e5e['installedPath'],'changed':_0x269d35[_0x3fe854(0xe6)]!==_0x3fe854(0xd5),'repairCommand':REPAIR_COMMAND};}
1
+ (function(_0x5f1bd6,_0x22f3fd){const _0x88d4f5=a132_0x21a1,_0x3bb7a4=_0x5f1bd6();while(!![]){try{const _0x206e45=-parseInt(_0x88d4f5(0x1bb))/0x1+parseInt(_0x88d4f5(0x1d3))/0x2*(parseInt(_0x88d4f5(0x1be))/0x3)+parseInt(_0x88d4f5(0x1a8))/0x4*(-parseInt(_0x88d4f5(0x1aa))/0x5)+parseInt(_0x88d4f5(0x1ce))/0x6*(-parseInt(_0x88d4f5(0x1bc))/0x7)+-parseInt(_0x88d4f5(0x1c4))/0x8*(parseInt(_0x88d4f5(0x1b1))/0x9)+parseInt(_0x88d4f5(0x1ab))/0xa+-parseInt(_0x88d4f5(0x1d9))/0xb*(-parseInt(_0x88d4f5(0x1b6))/0xc);if(_0x206e45===_0x22f3fd)break;else _0x3bb7a4['push'](_0x3bb7a4['shift']());}catch(_0x1c9919){_0x3bb7a4['push'](_0x3bb7a4['shift']());}}}(a132_0x7177,0xd7e8a));import{createHash}from'node:crypto';import{lstatSync,readFileSync,readdirSync}from'node:fs';import{homedir}from'node:os';import{dirname,join,relative,resolve,sep}from'node:path';import{fileURLToPath}from'node:url';function a132_0x21a1(_0x54a203,_0x43fe02){_0x54a203=_0x54a203-0x19d;const _0x7177cc=a132_0x7177();let _0x21a1ee=_0x7177cc[_0x54a203];return _0x21a1ee;}import{runNpxSkillsAddGlobal}from'../skills/npx-skills-add.js';import{resolveInstalledSkill}from'../skills/skill-presence.js';const DEFAULT_PACKAGE_ROOT=resolve(dirname(fileURLToPath(import.meta.url)),'..','..'),REPAIR_COMMAND='lovrabet\x20cli-skill\x20install',SKILL_NAME='lovrabet';function frontmatterValue(_0x348581,_0x3efd3d){const _0x4b2b20=a132_0x21a1;return _0x348581[_0x4b2b20(0x1b9)](new RegExp('^'+_0x3efd3d+_0x4b2b20(0x1ad),'m'))?.[0x1]?.[_0x4b2b20(0x1a3)]()??'';}function listFiles(_0x17c85b,_0x18d521=_0x17c85b){const _0x5c8293=a132_0x21a1;return readdirSync(_0x18d521,{'withFileTypes':!![]})[_0x5c8293(0x1c3)](_0x4229bc=>{const _0x3f8ce9=_0x5c8293,_0x5827c4=join(_0x18d521,_0x4229bc[_0x3f8ce9(0x19d)]),_0x4a8e6d=lstatSync(_0x5827c4);if(_0x4a8e6d[_0x3f8ce9(0x1a1)]())throw new Error(_0x3f8ce9(0x19e)+_0x5827c4);if(_0x4a8e6d['isDirectory']())return listFiles(_0x17c85b,_0x5827c4);if(!_0x4a8e6d['isFile']())throw new Error(_0x3f8ce9(0x1d2)+_0x5827c4);return[relative(_0x17c85b,_0x5827c4)[_0x3f8ce9(0x1d5)](sep)['join']('/')];})[_0x5c8293(0x1af)]((_0x221d7d,_0x262a04)=>_0x221d7d<_0x262a04?-0x1:_0x221d7d>_0x262a04?0x1:0x0);}function digestFiles(_0x15b1cb,_0x581dec){const _0x17651f=a132_0x21a1,_0x2157e2=createHash(_0x17651f(0x1c7));for(const _0xdfb07a of _0x581dec){if(_0xdfb07a[_0x17651f(0x1ba)]('/')||_0xdfb07a[_0x17651f(0x1d5)]('/')[_0x17651f(0x1a7)]('..')||_0xdfb07a[_0x17651f(0x1a7)]('\x5c'))throw new Error(_0x17651f(0x1bd)+_0xdfb07a);_0x2157e2[_0x17651f(0x1ac)](_0xdfb07a),_0x2157e2[_0x17651f(0x1ac)]('\x00'),_0x2157e2[_0x17651f(0x1ac)](readFileSync(join(_0x15b1cb,..._0xdfb07a[_0x17651f(0x1d5)]('/')))),_0x2157e2[_0x17651f(0x1ac)]('\x00');}return _0x2157e2['digest']('hex');}function sameFiles(_0x21e0ce,_0x583a15){const _0x4cfed8=a132_0x21a1;return _0x21e0ce[_0x4cfed8(0x1c9)]===_0x583a15[_0x4cfed8(0x1c9)]&&_0x21e0ce[_0x4cfed8(0x1d0)]((_0x16c057,_0x180746)=>_0x16c057===_0x583a15[_0x180746]);}function readSource(_0x4ea7be){const _0x204369=a132_0x21a1,_0x1f7f40=JSON['parse'](readFileSync(join(_0x4ea7be,_0x204369(0x1d8)),_0x204369(0x19f))),_0x3fa1fc=JSON['parse'](readFileSync(join(_0x4ea7be,_0x204369(0x1c0),_0x204369(0x1c2)),'utf8')),_0x5dcf67=join(_0x4ea7be,'skills',SKILL_NAME),_0x210d50=frontmatterValue(readFileSync(join(_0x5dcf67,_0x204369(0x1bf)),_0x204369(0x19f)),_0x204369(0x1c1)),_0x356861=listFiles(_0x5dcf67);if(_0x3fa1fc['schemaVersion']!==0x1||_0x3fa1fc['name']!==SKILL_NAME||!_0x1f7f40['version']||_0x3fa1fc[_0x204369(0x1d6)]!==_0x1f7f40['version']||_0x3fa1fc[_0x204369(0x1b0)]!==_0x1f7f40[_0x204369(0x1c1)]||_0x210d50!==_0x1f7f40[_0x204369(0x1c1)]||!sameFiles(_0x356861,_0x3fa1fc[_0x204369(0x1c8)])||digestFiles(_0x5dcf67,_0x356861)!==_0x3fa1fc[_0x204369(0x1cc)])throw new Error(_0x204369(0x1d7));return{'packageVersion':_0x1f7f40[_0x204369(0x1c1)],'skillVersion':_0x210d50,'root':_0x5dcf67,'manifest':_0x3fa1fc};}function installedSkillPath(_0x1ee8f0){const _0x34e665=a132_0x21a1,_0x358633=resolveInstalledSkill(SKILL_NAME,{'home':_0x1ee8f0});if(_0x358633['state']==='present')return{'state':_0x34e665(0x1c6),'path':dirname(_0x358633[_0x34e665(0x1cf)])};if(_0x358633['state']===_0x34e665(0x1da))return{'state':'missing'};return{'state':_0x34e665(0x1a4),'reason':_0x358633[_0x34e665(0x1ae)]};}export function inspectInstalledBuiltinSkillVersion(_0x93efa4,_0x5876d9={}){const _0x2493a9=a132_0x21a1,_0x3ab79f=installedSkillPath(_0x5876d9[_0x2493a9(0x1a5)]??homedir());if(_0x3ab79f[_0x2493a9(0x1b3)]===_0x2493a9(0x1c5))return{'state':_0x2493a9(0x1c5),'expectedVersion':_0x93efa4,'repairCommand':REPAIR_COMMAND};if(_0x3ab79f['state']===_0x2493a9(0x1a4))return{'state':'unverifiable','expectedVersion':_0x93efa4,'reason':_0x3ab79f[_0x2493a9(0x1ae)],'repairCommand':REPAIR_COMMAND};try{const _0x52e977=frontmatterValue(readFileSync(join(_0x3ab79f[_0x2493a9(0x1cf)],_0x2493a9(0x1bf)),_0x2493a9(0x19f)),_0x2493a9(0x1c1));return{'state':_0x52e977===_0x93efa4?_0x2493a9(0x1a6):_0x2493a9(0x1b8),'expectedVersion':_0x93efa4,'skillVersion':_0x52e977,'installedPath':_0x3ab79f[_0x2493a9(0x1cf)],'repairCommand':REPAIR_COMMAND};}catch(_0x5c9996){return{'state':_0x2493a9(0x1a4),'expectedVersion':_0x93efa4,'installedPath':_0x3ab79f[_0x2493a9(0x1cf)],'reason':_0x5c9996 instanceof Error?_0x5c9996[_0x2493a9(0x1a9)]:String(_0x5c9996),'repairCommand':REPAIR_COMMAND};}}export function inspectBuiltinSkill(_0x543a6e={}){const _0x1032be=a132_0x21a1,_0x5247bc=_0x543a6e[_0x1032be(0x1cd)]??DEFAULT_PACKAGE_ROOT;let _0x14291e;try{_0x14291e=readSource(_0x5247bc);}catch(_0x3ce96e){return{'state':_0x1032be(0x1a4),'packageVersion':_0x1032be(0x1a0),'reason':_0x3ce96e instanceof Error?_0x3ce96e[_0x1032be(0x1a9)]:String(_0x3ce96e),'repairCommand':REPAIR_COMMAND};}const _0x4c7575=installedSkillPath(_0x543a6e['home']??homedir());if(_0x4c7575[_0x1032be(0x1b3)]==='missing')return{'state':_0x1032be(0x1c5),'packageVersion':_0x14291e[_0x1032be(0x1d6)],'repairCommand':REPAIR_COMMAND};if(_0x4c7575[_0x1032be(0x1b3)]===_0x1032be(0x1a4))return{'state':_0x1032be(0x1a4),'packageVersion':_0x14291e[_0x1032be(0x1d6)],'reason':_0x4c7575['reason'],'repairCommand':REPAIR_COMMAND};try{const _0x2564e9=frontmatterValue(readFileSync(join(_0x4c7575[_0x1032be(0x1cf)],_0x1032be(0x1bf)),_0x1032be(0x19f)),_0x1032be(0x1c1));if(_0x2564e9!==_0x14291e[_0x1032be(0x1b0)])return{'state':_0x1032be(0x1b8),'packageVersion':_0x14291e[_0x1032be(0x1d6)],'skillVersion':_0x2564e9,'installedPath':_0x4c7575[_0x1032be(0x1cf)],'repairCommand':REPAIR_COMMAND};const _0x1b533a=listFiles(_0x4c7575[_0x1032be(0x1cf)]),_0x55e26a=digestFiles(_0x4c7575[_0x1032be(0x1cf)],_0x1b533a);return{'state':sameFiles(_0x1b533a,_0x14291e[_0x1032be(0x1a2)]['files'])&&_0x55e26a===_0x14291e['manifest']['digest']?_0x1032be(0x1a6):'content_mismatch','packageVersion':_0x14291e[_0x1032be(0x1d6)],'skillVersion':_0x2564e9,'installedPath':_0x4c7575[_0x1032be(0x1cf)],'digest':_0x55e26a,'repairCommand':REPAIR_COMMAND};}catch(_0x570ed6){return{'state':_0x1032be(0x1a4),'packageVersion':_0x14291e['packageVersion'],'installedPath':_0x4c7575[_0x1032be(0x1cf)],'reason':_0x570ed6 instanceof Error?_0x570ed6[_0x1032be(0x1a9)]:String(_0x570ed6),'repairCommand':REPAIR_COMMAND};}}function failure(_0x3f0d4c,_0x23c867,_0x36cd2c,_0x598f09){const _0x5d56e9=a132_0x21a1;return{'ok':![],'code':_0x3f0d4c,'packageVersion':_0x23c867[_0x5d56e9(0x1d6)],'skillVersion':_0x23c867[_0x5d56e9(0x1b0)],'installedPath':_0x598f09,'changed':![],'repairCommand':REPAIR_COMMAND,'error':_0x36cd2c instanceof Error?_0x36cd2c[_0x5d56e9(0x1a9)]:String(_0x36cd2c)};}function a132_0x7177(){const _0x5e5a9f=['935613TlxRST','SKILL.md','skills','version','lovrabet.manifest.json','flatMap','8saAxwp','missing','present','sha256','files','length','SOURCE_INVALID','status','digest','packageRoot','6WUQBIH','path','every','error','Unsupported\x20Skill\x20entry:\x20','2erZIxL','stdio','split','packageVersion','Built-in\x20Skill\x20source\x20does\x20not\x20match\x20its\x20package\x20manifest','package.json','20278357RTabXs','absent','name','Symbolic\x20link\x20is\x20not\x20allowed:\x20','utf8','unknown','isSymbolicLink','manifest','trim','unverifiable','home','current','includes','389476DyVQsC','message','5ZIixCS','7526100ZeFtaV','update',':\x5cs*(.+)$','reason','sort','skillVersion','3791808GHWXsP','skipped','state','installedPath','pipe','12HqrYWg','Installed\x20Skill\x20state\x20is\x20','version_mismatch','match','startsWith','185954WhRFns','9232797NFVoeZ','Unsafe\x20manifest\x20path:\x20'];a132_0x7177=function(){return _0x5e5a9f;};return a132_0x7177();}export function installBuiltinSkill(_0x1948c0={}){const _0x444a6c=a132_0x21a1,_0x432d65=_0x1948c0['packageRoot']??DEFAULT_PACKAGE_ROOT,_0x290b2c=_0x1948c0[_0x444a6c(0x1a5)]??homedir();let _0x262ec5;try{_0x262ec5=readSource(_0x432d65);}catch(_0x11a648){return failure(_0x444a6c(0x1ca),{'packageVersion':_0x444a6c(0x1a0),'skillVersion':'unknown'},_0x11a648);}const _0x192646=inspectBuiltinSkill({'packageRoot':_0x432d65,'home':_0x290b2c}),_0x27b07e=runNpxSkillsAddGlobal(_0x432d65,_0x262ec5['root'],{'stdio':_0x1948c0[_0x444a6c(0x1d4)]??_0x444a6c(0x1b5),'expectedSkillName':SKILL_NAME,'presence':{'home':_0x290b2c}});if(_0x27b07e[_0x444a6c(0x1b2)])return{'ok':!![],'packageVersion':_0x262ec5[_0x444a6c(0x1d6)],'skillVersion':_0x262ec5[_0x444a6c(0x1b0)],'installedPath':_0x192646[_0x444a6c(0x1b4)],'changed':![],'repairCommand':REPAIR_COMMAND};if(!_0x27b07e['ok'])return failure('INSTALL_FAILED',_0x262ec5,_0x27b07e[_0x444a6c(0x1d1)]??'skills@latest\x20exited\x20'+_0x27b07e[_0x444a6c(0x1cb)]);const _0x273ffb=inspectBuiltinSkill({'packageRoot':_0x432d65,'home':_0x290b2c});if(_0x273ffb['state']!==_0x444a6c(0x1a6))return failure('VERIFY_FAILED',_0x262ec5,_0x273ffb['reason']??_0x444a6c(0x1b7)+_0x273ffb[_0x444a6c(0x1b3)],_0x273ffb[_0x444a6c(0x1b4)]);return{'ok':!![],'packageVersion':_0x262ec5[_0x444a6c(0x1d6)],'skillVersion':_0x262ec5[_0x444a6c(0x1b0)],'installedPath':_0x273ffb[_0x444a6c(0x1b4)],'changed':_0x192646['state']!==_0x444a6c(0x1a6),'repairCommand':REPAIR_COMMAND};}
@@ -1 +1 @@
1
- const a130_0x5db88f=a130_0x3e4b;(function(_0xddc2b2,_0x55db9f){const _0x2417ca=a130_0x3e4b,_0x5cf29c=_0xddc2b2();while(!![]){try{const _0xcf03e5=parseInt(_0x2417ca(0x9b))/0x1+parseInt(_0x2417ca(0x98))/0x2*(-parseInt(_0x2417ca(0x7c))/0x3)+parseInt(_0x2417ca(0x7a))/0x4+parseInt(_0x2417ca(0x99))/0x5+-parseInt(_0x2417ca(0x8c))/0x6*(-parseInt(_0x2417ca(0x81))/0x7)+parseInt(_0x2417ca(0x88))/0x8*(-parseInt(_0x2417ca(0x7d))/0x9)+parseInt(_0x2417ca(0xa2))/0xa*(parseInt(_0x2417ca(0xa6))/0xb);if(_0xcf03e5===_0x55db9f)break;else _0x5cf29c['push'](_0x5cf29c['shift']());}catch(_0x3c0d8b){_0x5cf29c['push'](_0x5cf29c['shift']());}}}(a130_0x5bda,0x88a55));import{spawnSync}from'node:child_process';import{resolveNpmBin}from'../utils/platform.js';import{LOVRABET_SKILL_SOURCE as a130_0x3678e6}from'../constant/distribution.js';import{PRODUCT_CONFIG,productEnvName}from'../constant/product.js';import{resolveInstalledSkill}from'../skills/skill-presence.js';export const LOVRABET_SKILL_SOURCE=a130_0x3678e6;export const LOVRABET_SKILL_GIT_SOURCE=PRODUCT_CONFIG['internalSkillSource'];export const LOVRABET_GLOBAL_SKILL_NAME=PRODUCT_CONFIG[a130_0x5db88f(0x90)];export function resolveGlobalSkillName(_0x7aca97){switch(_0x7aca97['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[a130_0x5db88f(0x94)]);const CHILD_OUTPUT_MAX_BUFFER=0x10*0x400*0x400;function failure(_0xba0c60,_0x3e0b30,_0x506761){return{'ok':![],'status':_0x3e0b30,'code':_0xba0c60,'error':'['+_0xba0c60+']\x20'+_0x506761};}function a130_0x3e4b(_0x13c527,_0x2211e7){_0x13c527=_0x13c527-0x74;const _0x5bdae1=a130_0x5bda();let _0x3e4bb5=_0x5bdae1[_0x13c527];return _0x3e4bb5;}function a130_0x5bda(){const _0x51c5fc=['signal','reason','4839340HKsNOb','CHILD_TERMINATED','Skill\x20\x22','log','stdio','warn','NPX_NOT_FOUND','2051820uGGTDT','checked','6yxUnnI','9JkIoEi','join','SKILL_NOT_INSTALLED','\x22\x20not\x20found\x20after\x20install\x20(checked\x20','6384PNSviY','message','ENOENT','unknown','NPM_CONFIG_GLOBAL','npx\x20terminated\x20by\x20signal\x20','absent','5889960ucLZQC','code','npx','expectedSkillName','3228qMOjLn','status','add','match','globalSkillName','state','\x22\x20install\x20state:\x20','\x20failed\x20target(s)','skipNpxSkillsEnvSuffix','pipe','toString','trim','645214JehOdO','1941900CKZTby','error','109229vKDtdx','PERMISSION_DENIED','skills@latest','!\x20Could\x20not\x20verify\x20\x22','presence','stdout','stderr','10CJyZCf','filter'];a130_0x5bda=function(){return _0x51c5fc;};return a130_0x5bda();}export function shouldSkipNpxSkillsAdd(){return process.env[LOVRABET_SKIP_NPX_SKILLS_ENV]==='1';}export function runNpxSkillsAddGlobal(_0x5a1c75,_0x522d4c=LOVRABET_SKILL_SOURCE,_0x5abe3c){const _0x16ee75=a130_0x5db88f;if(shouldSkipNpxSkillsAdd())return{'ok':!![],'status':0x0,'skipped':!![]};const _0x5557cb=resolveNpmBin(_0x16ee75(0x8a)),_0x1b3372=['-y',_0x16ee75(0x9d),_0x16ee75(0x8e),_0x522d4c,'-g','-y'],_0x2fcc1a=[_0x5557cb,..._0x1b3372][_0x16ee75(0x7e)]('\x20');console[_0x16ee75(0x76)]('*\x20'+_0x2fcc1a);const _0x36afb3={...process.env};delete _0x36afb3['npm_config_global'],delete _0x36afb3[_0x16ee75(0x85)];const _0x28d5a9=spawnSync(_0x5557cb,_0x1b3372,{'cwd':_0x5a1c75,'stdio':_0x16ee75(0x95),'env':_0x36afb3,'shell':![],'maxBuffer':CHILD_OUTPUT_MAX_BUFFER}),_0x45854a=[_0x28d5a9[_0x16ee75(0xa0)]?_0x28d5a9[_0x16ee75(0xa0)]['toString']():'',_0x28d5a9['stderr']?_0x28d5a9[_0x16ee75(0xa1)][_0x16ee75(0x96)]():''][_0x16ee75(0xa3)](Boolean)[_0x16ee75(0x7e)]('\x0a')[_0x16ee75(0x97)]();_0x5abe3c?.[_0x16ee75(0x77)]!==_0x16ee75(0x95)&&_0x45854a&&console['log'](_0x45854a);if(_0x28d5a9[_0x16ee75(0x9a)]){const _0x88435f=_0x28d5a9[_0x16ee75(0x9a)],_0x1da416=_0x88435f[_0x16ee75(0x89)]===_0x16ee75(0x83)?_0x16ee75(0x79):_0x88435f['code']==='EPERM'||_0x88435f[_0x16ee75(0x89)]==='EACCES'?_0x16ee75(0x9c):'SPAWN_FAILED';return failure(_0x1da416,_0x28d5a9[_0x16ee75(0x8d)],_0x88435f[_0x16ee75(0x82)]);}if(_0x28d5a9[_0x16ee75(0xa4)])return failure(_0x16ee75(0x74),_0x28d5a9['status'],_0x16ee75(0x86)+_0x28d5a9[_0x16ee75(0xa4)]);if(_0x28d5a9[_0x16ee75(0x8d)]!==0x0)return failure('CHILD_EXIT_NONZERO',_0x28d5a9['status'],_0x45854a||'exit\x20'+(_0x28d5a9[_0x16ee75(0x8d)]??_0x16ee75(0x84)));const _0x42243e=_0x45854a[_0x16ee75(0x8f)](/Failed to install\s+(\d+)/i);if(_0x42243e&&Number(_0x42243e[0x1])>0x0)return failure('INSTALL_PARTIAL',0x0,'Installer\x20reported\x20'+_0x42243e[0x1]+_0x16ee75(0x93)+(_0x45854a?':\x0a'+_0x45854a:''));const _0x2a6392=_0x5abe3c?.[_0x16ee75(0x8b)]??resolveGlobalSkillName(_0x522d4c);if(_0x2a6392){const _0x4bc49c=resolveInstalledSkill(_0x2a6392,_0x5abe3c?.[_0x16ee75(0x9f)]);if(_0x4bc49c[_0x16ee75(0x91)]===_0x16ee75(0x87))return failure(_0x16ee75(0x7f),0x0,_0x16ee75(0x75)+_0x2a6392+_0x16ee75(0x80)+_0x4bc49c[_0x16ee75(0x7b)]['join'](',\x20')+')');_0x4bc49c[_0x16ee75(0x91)]==='unverifiable'&&console[_0x16ee75(0x78)](_0x16ee75(0x9e)+_0x2a6392+_0x16ee75(0x92)+_0x4bc49c[_0x16ee75(0xa5)]);}return{'ok':!![],'status':0x0};}
1
+ const a133_0x5524b0=a133_0x49b6;function a133_0x49b6(_0xb002f,_0x4780ae){_0xb002f=_0xb002f-0x1cd;const _0x4672b1=a133_0x4672();let _0x49b629=_0x4672b1[_0xb002f];return _0x49b629;}(function(_0x5748f3,_0x2c7ee9){const _0x3c2e75=a133_0x49b6,_0x154fc4=_0x5748f3();while(!![]){try{const _0x53952c=parseInt(_0x3c2e75(0x1ee))/0x1*(-parseInt(_0x3c2e75(0x1cd))/0x2)+parseInt(_0x3c2e75(0x1d2))/0x3*(parseInt(_0x3c2e75(0x1d1))/0x4)+parseInt(_0x3c2e75(0x1ec))/0x5+-parseInt(_0x3c2e75(0x1d4))/0x6+parseInt(_0x3c2e75(0x1e4))/0x7+parseInt(_0x3c2e75(0x1e8))/0x8+-parseInt(_0x3c2e75(0x1eb))/0x9;if(_0x53952c===_0x2c7ee9)break;else _0x154fc4['push'](_0x154fc4['shift']());}catch(_0x190b01){_0x154fc4['push'](_0x154fc4['shift']());}}}(a133_0x4672,0xcd350));import{spawnSync}from'node:child_process';import{resolveNpmBin}from'../utils/platform.js';import{LOVRABET_SKILL_SOURCE as a133_0x5679a2}from'../constant/distribution.js';import{PRODUCT_CONFIG,productEnvName}from'../constant/product.js';import{resolveInstalledSkill}from'../skills/skill-presence.js';export const LOVRABET_SKILL_SOURCE=a133_0x5679a2;function a133_0x4672(){const _0x271f66=['3037950axIHsR','NPM_CONFIG_GLOBAL','\x20failed\x20target(s)','pipe','stdout','trim','reason','status','join','skills@latest','checked','PERMISSION_DENIED','npx\x20terminated\x20by\x20signal\x20','match','INSTALL_PARTIAL','EPERM','10553641JMvKBc','npm_config_global','stdio','npx','12761072LIBCRS','filter','internalSkillSource','25592931lEmPeH','4153465zXyGNh','ENOENT','87GhtPfG','CHILD_EXIT_NONZERO','SKILL_NOT_INSTALLED','stderr','log','\x22\x20install\x20state:\x20','unverifiable','message','EACCES','25748ctosve','state','absent','NPX_NOT_FOUND','708iXLYxq','23340CPNNvO','Skill\x20\x22'];a133_0x4672=function(){return _0x271f66;};return a133_0x4672();}export const LOVRABET_SKILL_GIT_SOURCE=PRODUCT_CONFIG[a133_0x5524b0(0x1ea)];export const LOVRABET_GLOBAL_SKILL_NAME=PRODUCT_CONFIG['globalSkillName'];export function resolveGlobalSkillName(_0x490e4b){const _0x5b9d81=a133_0x5524b0;switch(_0x490e4b[_0x5b9d81(0x1d9)]()){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['skipNpxSkillsEnvSuffix']);const CHILD_OUTPUT_MAX_BUFFER=0x10*0x400*0x400;function failure(_0x3c144c,_0x201e72,_0x88be69){return{'ok':![],'status':_0x201e72,'code':_0x3c144c,'error':'['+_0x3c144c+']\x20'+_0x88be69};}export function shouldSkipNpxSkillsAdd(){return process.env[LOVRABET_SKIP_NPX_SKILLS_ENV]==='1';}export function runNpxSkillsAddGlobal(_0x9bcb1b,_0x2ff0b3=LOVRABET_SKILL_SOURCE,_0x4eefd9){const _0x11cbe6=a133_0x5524b0;if(shouldSkipNpxSkillsAdd())return{'ok':!![],'status':0x0,'skipped':!![]};const _0x4dc398=resolveNpmBin(_0x11cbe6(0x1e7)),_0x15a4f5=['-y',_0x11cbe6(0x1dd),'add',_0x2ff0b3,'-g','-y'],_0x5071b4=[_0x4dc398,..._0x15a4f5][_0x11cbe6(0x1dc)]('\x20');console[_0x11cbe6(0x1f2)]('*\x20'+_0x5071b4);const _0x56f333={...process.env};delete _0x56f333[_0x11cbe6(0x1e5)],delete _0x56f333[_0x11cbe6(0x1d5)];const _0x2ff8b7=spawnSync(_0x4dc398,_0x15a4f5,{'cwd':_0x9bcb1b,'stdio':_0x11cbe6(0x1d7),'env':_0x56f333,'shell':![],'maxBuffer':CHILD_OUTPUT_MAX_BUFFER}),_0x3a35da=[_0x2ff8b7[_0x11cbe6(0x1d8)]?_0x2ff8b7[_0x11cbe6(0x1d8)]['toString']():'',_0x2ff8b7[_0x11cbe6(0x1f1)]?_0x2ff8b7[_0x11cbe6(0x1f1)]['toString']():''][_0x11cbe6(0x1e9)](Boolean)[_0x11cbe6(0x1dc)]('\x0a')[_0x11cbe6(0x1d9)]();_0x4eefd9?.[_0x11cbe6(0x1e6)]!==_0x11cbe6(0x1d7)&&_0x3a35da&&console[_0x11cbe6(0x1f2)](_0x3a35da);if(_0x2ff8b7['error']){const _0x22b4fc=_0x2ff8b7['error'],_0x31cb5b=_0x22b4fc['code']===_0x11cbe6(0x1ed)?_0x11cbe6(0x1d0):_0x22b4fc['code']===_0x11cbe6(0x1e3)||_0x22b4fc['code']===_0x11cbe6(0x1f6)?_0x11cbe6(0x1df):'SPAWN_FAILED';return failure(_0x31cb5b,_0x2ff8b7[_0x11cbe6(0x1db)],_0x22b4fc[_0x11cbe6(0x1f5)]);}if(_0x2ff8b7['signal'])return failure('CHILD_TERMINATED',_0x2ff8b7['status'],_0x11cbe6(0x1e0)+_0x2ff8b7['signal']);if(_0x2ff8b7[_0x11cbe6(0x1db)]!==0x0)return failure(_0x11cbe6(0x1ef),_0x2ff8b7[_0x11cbe6(0x1db)],_0x3a35da||'exit\x20'+(_0x2ff8b7['status']??'unknown'));const _0x2b241e=_0x3a35da[_0x11cbe6(0x1e1)](/Failed to install\s+(\d+)/i);if(_0x2b241e&&Number(_0x2b241e[0x1])>0x0)return failure(_0x11cbe6(0x1e2),0x0,'Installer\x20reported\x20'+_0x2b241e[0x1]+_0x11cbe6(0x1d6)+(_0x3a35da?':\x0a'+_0x3a35da:''));const _0x1b3622=_0x4eefd9?.['expectedSkillName']??resolveGlobalSkillName(_0x2ff0b3);if(_0x1b3622){const _0x4849a7=resolveInstalledSkill(_0x1b3622,_0x4eefd9?.['presence']);if(_0x4849a7[_0x11cbe6(0x1ce)]===_0x11cbe6(0x1cf))return failure(_0x11cbe6(0x1f0),0x0,_0x11cbe6(0x1d3)+_0x1b3622+'\x22\x20not\x20found\x20after\x20install\x20(checked\x20'+_0x4849a7[_0x11cbe6(0x1de)][_0x11cbe6(0x1dc)](',\x20')+')');_0x4849a7[_0x11cbe6(0x1ce)]===_0x11cbe6(0x1f4)&&console['warn']('!\x20Could\x20not\x20verify\x20\x22'+_0x1b3622+_0x11cbe6(0x1f3)+_0x4849a7[_0x11cbe6(0x1da)]);}return{'ok':!![],'status':0x0};}
@@ -1 +1 @@
1
- const a131_0x3e9007=a131_0x4601;(function(_0x1ad451,_0x21d6f4){const _0x133cd2=a131_0x4601,_0x37dce2=_0x1ad451();while(!![]){try{const _0x441f87=parseInt(_0x133cd2(0x1e5))/0x1*(parseInt(_0x133cd2(0x1eb))/0x2)+parseInt(_0x133cd2(0x1f0))/0x3*(parseInt(_0x133cd2(0x1e6))/0x4)+parseInt(_0x133cd2(0x1f6))/0x5+parseInt(_0x133cd2(0x1ec))/0x6*(parseInt(_0x133cd2(0x1f1))/0x7)+-parseInt(_0x133cd2(0x1f8))/0x8*(-parseInt(_0x133cd2(0x1f2))/0x9)+parseInt(_0x133cd2(0x1ee))/0xa+-parseInt(_0x133cd2(0x1ed))/0xb;if(_0x441f87===_0x21d6f4)break;else _0x37dce2['push'](_0x37dce2['shift']());}catch(_0x32cc52){_0x37dce2['push'](_0x37dce2['shift']());}}}(a131_0x1e33,0x4da45));export const METADATA_FILE=a131_0x3e9007(0x1f5);export const SKILL_FILE=a131_0x3e9007(0x1f7);function a131_0x4601(_0xbcd9e8,_0x4f0dcc){_0xbcd9e8=_0xbcd9e8-0x1e5;const _0x1e3317=a131_0x1e33();let _0x460186=_0x1e3317[_0xbcd9e8];return _0x460186;}function a131_0x1e33(){const _0x3ce04f=['4960233fQWmmR','.cache','build','lovrabet.skill.json','2028265kWuXmK','SKILL.md','8nyfOWP','dist','2izmjZr','4IKtasO','coverage','.DS_Store','node_modules','.turbo','582236tHLAtP','52842UYYmdL','23428185teqxIb','2781820vHfEtr','.git','1548471qCdUYi','91HCzCAN'];a131_0x1e33=function(){return _0x3ce04f;};return a131_0x1e33();}export const IGNORED_FILE_NAMES=new Set([METADATA_FILE,a131_0x3e9007(0x1e8)]);export const IGNORED_DIR_NAMES=new Set([a131_0x3e9007(0x1ef),'.hg','.svn',a131_0x3e9007(0x1e9),'.next',a131_0x3e9007(0x1f9),a131_0x3e9007(0x1f4),a131_0x3e9007(0x1e7),a131_0x3e9007(0x1ea),a131_0x3e9007(0x1f3)]);
1
+ function a134_0x4371(){const _0x47b61d=['.git','.next','12654830LkCiHy','4132SfSBMZ','168228GwNbdn','.svn','6820080UinuJW','344433rrbBzw','15534dqobWI','SKILL.md','node_modules','lovrabet.skill.json','dist','1834syfZof','9bKXusq','175744ecPDSq','.cache','.turbo','2992tNopmH','75tSiozV','build','398SBHxsG','coverage'];a134_0x4371=function(){return _0x47b61d;};return a134_0x4371();}const a134_0x3efbf1=a134_0x4352;(function(_0x3f34a2,_0x149c5a){const _0x50e76f=a134_0x4352,_0x4a3945=_0x3f34a2();while(!![]){try{const _0x3e5495=-parseInt(_0x50e76f(0x171))/0x1*(parseInt(_0x50e76f(0x176))/0x2)+-parseInt(_0x50e76f(0x17a))/0x3+-parseInt(_0x50e76f(0x16b))/0x4*(parseInt(_0x50e76f(0x16f))/0x5)+parseInt(_0x50e76f(0x17b))/0x6*(parseInt(_0x50e76f(0x180))/0x7)+-parseInt(_0x50e76f(0x179))/0x8+-parseInt(_0x50e76f(0x16a))/0x9*(parseInt(_0x50e76f(0x175))/0xa)+-parseInt(_0x50e76f(0x16e))/0xb*(-parseInt(_0x50e76f(0x177))/0xc);if(_0x3e5495===_0x149c5a)break;else _0x4a3945['push'](_0x4a3945['shift']());}catch(_0x4a03e7){_0x4a3945['push'](_0x4a3945['shift']());}}}(a134_0x4371,0xbdc9e));export const METADATA_FILE=a134_0x3efbf1(0x17e);export const SKILL_FILE=a134_0x3efbf1(0x17c);export const IGNORED_FILE_NAMES=new Set([METADATA_FILE,'.DS_Store']);function a134_0x4352(_0x43f248,_0x43b137){_0x43f248=_0x43f248-0x16a;const _0x437159=a134_0x4371();let _0x43524d=_0x437159[_0x43f248];return _0x43524d;}export const IGNORED_DIR_NAMES=new Set([a134_0x3efbf1(0x173),'.hg',a134_0x3efbf1(0x178),a134_0x3efbf1(0x17d),a134_0x3efbf1(0x174),a134_0x3efbf1(0x17f),a134_0x3efbf1(0x170),a134_0x3efbf1(0x172),a134_0x3efbf1(0x16d),a134_0x3efbf1(0x16c)]);
@@ -1 +1 @@
1
- (function(_0x4f1c77,_0x208e55){const _0x625277=a132_0x7536,_0x1f98aa=_0x4f1c77();while(!![]){try{const _0x4dc481=parseInt(_0x625277(0x105))/0x1*(-parseInt(_0x625277(0x10c))/0x2)+-parseInt(_0x625277(0x108))/0x3+parseInt(_0x625277(0xfc))/0x4*(parseInt(_0x625277(0x103))/0x5)+-parseInt(_0x625277(0x107))/0x6*(parseInt(_0x625277(0x10d))/0x7)+-parseInt(_0x625277(0x10b))/0x8*(parseInt(_0x625277(0x100))/0x9)+-parseInt(_0x625277(0x10e))/0xa+parseInt(_0x625277(0xfb))/0xb;if(_0x4dc481===_0x208e55)break;else _0x1f98aa['push'](_0x1f98aa['shift']());}catch(_0x468767){_0x1f98aa['push'](_0x1f98aa['shift']());}}}(a132_0x5b5d,0xb44b8));import{lstatSync,readlinkSync,realpathSync,renameSync,rmSync,writeFileSync}from'node:fs';function a132_0x7536(_0x9ebfec,_0x4448e3){_0x9ebfec=_0x9ebfec-0xfa;const _0x5b5ddf=a132_0x5b5d();let _0x75360e=_0x5b5ddf[_0x9ebfec];return _0x75360e;}import{dirname,isAbsolute,resolve,sep}from'node:path';import{CliErrors}from'../../errors.js';import{normalizeSkillRelativePath}from'./local-files.js';export function resolveManagedFilePath(_0x17f934,_0x5908e9){const _0x1b6169=a132_0x7536,_0x4d9bb4=normalizeSkillRelativePath(_0x5908e9),_0x3fb6e1=realOrResolved(_0x17f934),_0x36458a=resolve(_0x3fb6e1,..._0x4d9bb4[_0x1b6169(0xfa)]('/'));if(!isPathInside(_0x36458a,_0x3fb6e1))throw CliErrors['validation'](_0x1b6169(0xfe)+_0x5908e9);return ensureNoSymlinkInManagedPath(_0x3fb6e1,_0x4d9bb4),_0x36458a;}export function ensureNoSymlinkInManagedPath(_0x48b390,_0x5921c4){const _0x49b5a9=a132_0x7536;let _0x4b3e7f=_0x48b390;for(const _0x52c7cf of _0x5921c4[_0x49b5a9(0xfa)]('/')){_0x4b3e7f=resolve(_0x4b3e7f,_0x52c7cf);const _0x5d4b90=lstatIfPresent(_0x4b3e7f);if(_0x5d4b90?.[_0x49b5a9(0x102)]())throw CliErrors[_0x49b5a9(0x10f)](_0x49b5a9(0xfd)+_0x5921c4);}}export function isDanglingSymlink(_0x1134fd){try{return lstatSync(_0x1134fd)['isSymbolicLink']();}catch{return![];}}export function resolveSymlinkTarget(_0x238ed2){const _0x124252=readlinkSync(_0x238ed2);return isAbsolute(_0x124252)?_0x124252:resolve(dirname(_0x238ed2),_0x124252);}export function isPathInside(_0x39b324,_0x277286){const _0x4f2e15=a132_0x7536,_0x31741e=_0x39b324[_0x4f2e15(0x101)](sep)?_0x39b324:''+_0x39b324+sep,_0x23fbb7=_0x277286['endsWith'](sep)?_0x277286:''+_0x277286+sep;return _0x39b324===_0x277286||_0x31741e[_0x4f2e15(0x104)](_0x23fbb7);}function a132_0x5b5d(){const _0x10ea52=['320960iUwrJd','validation','split','55134343kqJVKR','4coXAQW','Refusing\x20to\x20write\x20through\x20Skill\x20symlink\x20path:\x20','Unsafe\x20Skill\x20file\x20path:\x20','from','549GBnDkt','endsWith','isSymbolicLink','3216505LnkJYQ','startsWith','607XhnXBT','utf8','18DIxcSF','3981591fblibf','stringify','.tmp','163272yZoRWG','2946fmiMTa','3310237zsbEJh'];a132_0x5b5d=function(){return _0x10ea52;};return a132_0x5b5d();}export function realOrResolved(_0x215aff){try{return realpathSync(_0x215aff);}catch{return resolve(_0x215aff);}}export function lstatIfPresent(_0x52f976){try{return lstatSync(_0x52f976);}catch{return undefined;}}export function writeTextAtomic(_0x285fe9,_0x73e9d5,_0x510385){const _0x466ada=a132_0x7536;writeBytesAtomic(_0x285fe9,Buffer[_0x466ada(0xff)](_0x73e9d5,_0x466ada(0x106)),_0x510385);}export function writeBytesAtomic(_0x4b3bc9,_0x41effb,_0x52f16d){const _0x78cad9=a132_0x7536,_0x543c64=_0x4b3bc9+_0x78cad9(0x10a);try{writeFileSync(_0x543c64,_0x41effb,{'mode':_0x52f16d}),renameSync(_0x543c64,_0x4b3bc9);}catch(_0x334649){try{rmSync(_0x543c64,{'force':!![]});}catch{}throw _0x334649;}}export function writeJsonAtomic(_0x54b6ca,_0x54aa69){const _0x2d5f53=a132_0x7536;writeTextAtomic(_0x54b6ca,JSON[_0x2d5f53(0x109)](_0x54aa69,null,0x2)+'\x0a',0x180);}
1
+ (function(_0xf21adc,_0x9ad749){const _0x36e015=a135_0x5f19,_0x5c71d7=_0xf21adc();while(!![]){try{const _0x10087f=-parseInt(_0x36e015(0x1d1))/0x1*(-parseInt(_0x36e015(0x1c7))/0x2)+-parseInt(_0x36e015(0x1c6))/0x3+-parseInt(_0x36e015(0x1ce))/0x4*(-parseInt(_0x36e015(0x1cb))/0x5)+parseInt(_0x36e015(0x1c5))/0x6+parseInt(_0x36e015(0x1bf))/0x7*(-parseInt(_0x36e015(0x1c9))/0x8)+-parseInt(_0x36e015(0x1c2))/0x9+-parseInt(_0x36e015(0x1c8))/0xa*(parseInt(_0x36e015(0x1cf))/0xb);if(_0x10087f===_0x9ad749)break;else _0x5c71d7['push'](_0x5c71d7['shift']());}catch(_0xadb7f0){_0x5c71d7['push'](_0x5c71d7['shift']());}}}(a135_0x3bd6,0x306b6));function a135_0x3bd6(){const _0x37d92b=['77178zGeHBq','from','startsWith','7lQKDiW','Refusing\x20to\x20write\x20through\x20Skill\x20symlink\x20path:\x20','.tmp','27747CQNhaI','validation','endsWith','84918neWINk','30507pQfjzg','2xcRFeI','198590CNEyzD','1811080lXljHX','utf8','5CEECUB','Unsafe\x20Skill\x20file\x20path:\x20','stringify','1465964VBwfwe','11aYceKH','isSymbolicLink'];a135_0x3bd6=function(){return _0x37d92b;};return a135_0x3bd6();}function a135_0x5f19(_0x2a15df,_0x1b58b7){_0x2a15df=_0x2a15df-0x1bf;const _0x3bd666=a135_0x3bd6();let _0x5f1943=_0x3bd666[_0x2a15df];return _0x5f1943;}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(_0x151450,_0x2ec5c7){const _0x592aa6=a135_0x5f19,_0x23ef41=normalizeSkillRelativePath(_0x2ec5c7),_0x5bdbdf=realOrResolved(_0x151450),_0x119ec8=resolve(_0x5bdbdf,..._0x23ef41['split']('/'));if(!isPathInside(_0x119ec8,_0x5bdbdf))throw CliErrors[_0x592aa6(0x1c3)](_0x592aa6(0x1cc)+_0x2ec5c7);return ensureNoSymlinkInManagedPath(_0x5bdbdf,_0x23ef41),_0x119ec8;}export function ensureNoSymlinkInManagedPath(_0x19a25a,_0x56854f){const _0x2cd090=a135_0x5f19;let _0x520771=_0x19a25a;for(const _0x36a9df of _0x56854f['split']('/')){_0x520771=resolve(_0x520771,_0x36a9df);const _0x12f6df=lstatIfPresent(_0x520771);if(_0x12f6df?.[_0x2cd090(0x1d0)]())throw CliErrors['validation'](_0x2cd090(0x1c0)+_0x56854f);}}export function isDanglingSymlink(_0x518458){const _0x56b298=a135_0x5f19;try{return lstatSync(_0x518458)[_0x56b298(0x1d0)]();}catch{return![];}}export function resolveSymlinkTarget(_0x49fd4d){const _0xac70bf=readlinkSync(_0x49fd4d);return isAbsolute(_0xac70bf)?_0xac70bf:resolve(dirname(_0x49fd4d),_0xac70bf);}export function isPathInside(_0x2300fe,_0x28c13b){const _0xe304fd=a135_0x5f19,_0x3dedb8=_0x2300fe[_0xe304fd(0x1c4)](sep)?_0x2300fe:''+_0x2300fe+sep,_0x51a74a=_0x28c13b[_0xe304fd(0x1c4)](sep)?_0x28c13b:''+_0x28c13b+sep;return _0x2300fe===_0x28c13b||_0x3dedb8[_0xe304fd(0x1d3)](_0x51a74a);}export function realOrResolved(_0x571393){try{return realpathSync(_0x571393);}catch{return resolve(_0x571393);}}export function lstatIfPresent(_0x2a175c){try{return lstatSync(_0x2a175c);}catch{return undefined;}}export function writeTextAtomic(_0x1bc23c,_0x4bdb25,_0x204270){const _0x44f129=a135_0x5f19;writeBytesAtomic(_0x1bc23c,Buffer[_0x44f129(0x1d2)](_0x4bdb25,_0x44f129(0x1ca)),_0x204270);}export function writeBytesAtomic(_0x2d3e00,_0x120344,_0x23e5d1){const _0xc7fb57=a135_0x5f19,_0x25f7c5=_0x2d3e00+_0xc7fb57(0x1c1);try{writeFileSync(_0x25f7c5,_0x120344,{'mode':_0x23e5d1}),renameSync(_0x25f7c5,_0x2d3e00);}catch(_0x4bb724){try{rmSync(_0x25f7c5,{'force':!![]});}catch{}throw _0x4bb724;}}export function writeJsonAtomic(_0x2f007a,_0x2d1292){const _0x4d461f=a135_0x5f19;writeTextAtomic(_0x2f007a,JSON[_0x4d461f(0x1cd)](_0x2d1292,null,0x2)+'\x0a',0x180);}
@@ -1 +1 @@
1
- (function(_0x43d68d,_0x3477a2){const _0x56c2b1=a133_0x3316,_0x1ec757=_0x43d68d();while(!![]){try{const _0x3542cb=-parseInt(_0x56c2b1(0x1cd))/0x1*(parseInt(_0x56c2b1(0x1d1))/0x2)+parseInt(_0x56c2b1(0x1c7))/0x3+parseInt(_0x56c2b1(0x1d3))/0x4+parseInt(_0x56c2b1(0x1c8))/0x5*(-parseInt(_0x56c2b1(0x1ca))/0x6)+parseInt(_0x56c2b1(0x1cc))/0x7*(-parseInt(_0x56c2b1(0x1d0))/0x8)+-parseInt(_0x56c2b1(0x1cf))/0x9+parseInt(_0x56c2b1(0x1c5))/0xa*(parseInt(_0x56c2b1(0x1c6))/0xb);if(_0x3542cb===_0x3477a2)break;else _0x1ec757['push'](_0x1ec757['shift']());}catch(_0x55e3d8){_0x1ec757['push'](_0x1ec757['shift']());}}}(a133_0x54e1,0x2cadf));import{createHash}from'node:crypto';import{fileContent,normalizeManifestFiles}from'./local-files.js';function a133_0x54e1(){const _0x149196=['797127EsbcOV','10IVRwaq','hex','192054JcBdvn','size','347466yloPpx','5oNnlOZ','sha256','1960623hWmUVW','24iteiQx','83852hcLAcn','digest','1270036XDrTZf','update','7980BXTujk','3311dCZABD'];a133_0x54e1=function(){return _0x149196;};return a133_0x54e1();}export function contentHash(_0x17505a){const _0x491ef0=a133_0x3316;return createHash(_0x491ef0(0x1ce))[_0x491ef0(0x1c4)](_0x17505a)[_0x491ef0(0x1d2)](_0x491ef0(0x1c9));}export function fileHash(_0x47208d){return bufferSha256(fileContent(_0x47208d));}export function bufferSha256(_0x521314){const _0x36b834=a133_0x3316;return createHash(_0x36b834(0x1ce))[_0x36b834(0x1c4)](_0x521314)['digest']('hex');}function a133_0x3316(_0x19d9c0,_0x5ba03d){_0x19d9c0=_0x19d9c0-0x1c4;const _0x54e1c6=a133_0x54e1();let _0x331673=_0x54e1c6[_0x19d9c0];return _0x331673;}export function fileTreeHash(_0x158b55){const _0x26a449=a133_0x3316,_0x814fe2=createHash(_0x26a449(0x1ce));for(const _0x4b3ce6 of normalizeManifestFiles(_0x158b55)){_0x814fe2[_0x26a449(0x1c4)](_0x4b3ce6['path']),_0x814fe2['update']('\x00'),_0x814fe2[_0x26a449(0x1c4)](_0x4b3ce6[_0x26a449(0x1ce)]),_0x814fe2['update']('\x00'),_0x814fe2[_0x26a449(0x1c4)](String(_0x4b3ce6[_0x26a449(0x1cb)])),_0x814fe2[_0x26a449(0x1c4)]('\x00');}return _0x814fe2[_0x26a449(0x1d2)]('hex');}
1
+ (function(_0x1d8461,_0x3521fb){const _0x5c314e=a136_0x274e,_0x271d9d=_0x1d8461();while(!![]){try{const _0x19ce72=parseInt(_0x5c314e(0x128))/0x1*(parseInt(_0x5c314e(0x132))/0x2)+parseInt(_0x5c314e(0x135))/0x3+parseInt(_0x5c314e(0x130))/0x4+-parseInt(_0x5c314e(0x12a))/0x5*(parseInt(_0x5c314e(0x134))/0x6)+parseInt(_0x5c314e(0x129))/0x7+parseInt(_0x5c314e(0x12d))/0x8+-parseInt(_0x5c314e(0x12c))/0x9;if(_0x19ce72===_0x3521fb)break;else _0x271d9d['push'](_0x271d9d['shift']());}catch(_0x1b9041){_0x271d9d['push'](_0x271d9d['shift']());}}}(a136_0x5b09,0xa6ea4));import{createHash}from'node:crypto';function a136_0x5b09(){const _0x38c1c5=['path','5598eJwksc','size','6468888CbRMHC','767340vinCtc','digest','37wRJKff','9537843lXTFrp','5HBZGzp','hex','15656481ppSFgR','6144304JigcBa','sha256','update','4046044fdRpqf'];a136_0x5b09=function(){return _0x38c1c5;};return a136_0x5b09();}function a136_0x274e(_0x7ae04c,_0x2d6cea){_0x7ae04c=_0x7ae04c-0x127;const _0x5b09c6=a136_0x5b09();let _0x274ee2=_0x5b09c6[_0x7ae04c];return _0x274ee2;}import{fileContent,normalizeManifestFiles}from'./local-files.js';export function contentHash(_0x2185e3){const _0x4c56ad=a136_0x274e;return createHash(_0x4c56ad(0x12e))[_0x4c56ad(0x12f)](_0x2185e3)[_0x4c56ad(0x127)](_0x4c56ad(0x12b));}export function fileHash(_0x576416){return bufferSha256(fileContent(_0x576416));}export function bufferSha256(_0x1a1772){const _0x25810c=a136_0x274e;return createHash(_0x25810c(0x12e))[_0x25810c(0x12f)](_0x1a1772)[_0x25810c(0x127)](_0x25810c(0x12b));}export function fileTreeHash(_0x37fed0){const _0x4448ed=a136_0x274e,_0x5ace9=createHash(_0x4448ed(0x12e));for(const _0x5a49cf of normalizeManifestFiles(_0x37fed0)){_0x5ace9[_0x4448ed(0x12f)](_0x5a49cf[_0x4448ed(0x131)]),_0x5ace9['update']('\x00'),_0x5ace9[_0x4448ed(0x12f)](_0x5a49cf['sha256']),_0x5ace9['update']('\x00'),_0x5ace9[_0x4448ed(0x12f)](String(_0x5a49cf[_0x4448ed(0x133)])),_0x5ace9[_0x4448ed(0x12f)]('\x00');}return _0x5ace9[_0x4448ed(0x127)]('hex');}
@@ -1 +1 @@
1
- const a134_0x17eb62=a134_0x1ab3;(function(_0x5f3131,_0x39b942){const _0x4d6aa1=a134_0x1ab3,_0x6f18ef=_0x5f3131();while(!![]){try{const _0x1d1a4c=-parseInt(_0x4d6aa1(0x133))/0x1+parseInt(_0x4d6aa1(0x13f))/0x2+-parseInt(_0x4d6aa1(0x134))/0x3*(-parseInt(_0x4d6aa1(0x13e))/0x4)+-parseInt(_0x4d6aa1(0x144))/0x5+parseInt(_0x4d6aa1(0x139))/0x6*(parseInt(_0x4d6aa1(0x13d))/0x7)+parseInt(_0x4d6aa1(0x137))/0x8*(-parseInt(_0x4d6aa1(0x135))/0x9)+-parseInt(_0x4d6aa1(0x142))/0xa*(-parseInt(_0x4d6aa1(0x13c))/0xb);if(_0x1d1a4c===_0x39b942)break;else _0x6f18ef['push'](_0x6f18ef['shift']());}catch(_0x411208){_0x6f18ef['push'](_0x6f18ef['shift']());}}}(a134_0x5287,0x96dd0));import{resolve}from'node:path';function a134_0x1ab3(_0x16763b,_0x25567b){_0x16763b=_0x16763b-0x133;const _0x52878d=a134_0x5287();let _0x1ab340=_0x52878d[_0x16763b];return _0x1ab340;}import{resolveSkillSyncPaths,runtimeAgentSkillRoots,safePathSegment}from'./paths.js';export function resolveRuntimeSkillInstallTarget(_0x52e9bd,_0x2b14a2=a134_0x17eb62(0x138),_0x3da04a={}){const _0x372a96=a134_0x17eb62,_0x985a8e=resolveSkillSyncPaths(_0x3da04a),_0x20800f=safePathSegment(_0x52e9bd,_0x372a96(0x13a)),_0x5976c7=_0x2b14a2===_0x372a96(0x13b)?[resolve(_0x3da04a[_0x372a96(0x143)]??process['cwd'](),_0x372a96(0x140),'skills')]:runtimeAgentSkillRoots(_0x985a8e);return Object[_0x372a96(0x141)]({'scope':_0x2b14a2,'appCode':_0x20800f,'skillRoots':Object[_0x372a96(0x141)](_0x5976c7),'managedRoot':_0x985a8e[_0x372a96(0x136)]});}function a134_0x5287(){const _0x26e911=['global','78JpIavq','appCode','project','4432846WSmvsy','12341nHXkFx','692ZOcIFO','1872030LlZfnY','.agents','freeze','10AXNTGm','cwd','2075740kFbIio','329536eYdsuu','6945dLFLfF','1485QcvjGg','managedRoot','19384rXHDEP'];a134_0x5287=function(){return _0x26e911;};return a134_0x5287();}
1
+ function a137_0x87cf(){const _0x215dbd=['global','skills','8ooDnFm','5952pcdnai','20QgGzlt','4318104qbJova','cwd','286104bsqLri','57OBtbux','project','41782DNwbpm','freeze','189TooEbH','3345397ZXcuMQ','20695TEQBtw','.agents','16060soxVGR','80ronmZx','65288hXtwGl','appCode'];a137_0x87cf=function(){return _0x215dbd;};return a137_0x87cf();}const a137_0x4f6542=a137_0x5284;(function(_0x5113f0,_0x5ba561){const _0x4e18ea=a137_0x5284,_0x3738f4=_0x5113f0();while(!![]){try{const _0x3c2c54=parseInt(_0x4e18ea(0x95))/0x1*(-parseInt(_0x4e18ea(0x9d))/0x2)+-parseInt(_0x4e18ea(0x8f))/0x3*(parseInt(_0x4e18ea(0x97))/0x4)+-parseInt(_0x4e18ea(0x98))/0x5*(parseInt(_0x4e18ea(0xa2))/0x6)+-parseInt(_0x4e18ea(0xa0))/0x7+parseInt(_0x4e18ea(0x99))/0x8*(-parseInt(_0x4e18ea(0x93))/0x9)+-parseInt(_0x4e18ea(0x9f))/0xa*(-parseInt(_0x4e18ea(0x94))/0xb)+-parseInt(_0x4e18ea(0x9e))/0xc*(-parseInt(_0x4e18ea(0x91))/0xd);if(_0x3c2c54===_0x5ba561)break;else _0x3738f4['push'](_0x3738f4['shift']());}catch(_0x166e5a){_0x3738f4['push'](_0x3738f4['shift']());}}}(a137_0x87cf,0x78268));import{resolve}from'node:path';function a137_0x5284(_0x1b9524,_0x5d5bcb){_0x1b9524=_0x1b9524-0x8f;const _0x87cfbc=a137_0x87cf();let _0x528423=_0x87cfbc[_0x1b9524];return _0x528423;}import{resolveSkillSyncPaths,runtimeAgentSkillRoots,safePathSegment}from'./paths.js';export function resolveRuntimeSkillInstallTarget(_0x4eab1b,_0x24ed33=a137_0x4f6542(0x9b),_0x3a2734={}){const _0x159de5=a137_0x4f6542,_0x181aa9=resolveSkillSyncPaths(_0x3a2734),_0x2cbc29=safePathSegment(_0x4eab1b,_0x159de5(0x9a)),_0x36725c=_0x24ed33===_0x159de5(0x90)?[resolve(_0x3a2734[_0x159de5(0xa1)]??process[_0x159de5(0xa1)](),_0x159de5(0x96),_0x159de5(0x9c))]:runtimeAgentSkillRoots(_0x181aa9);return Object[_0x159de5(0x92)]({'scope':_0x24ed33,'appCode':_0x2cbc29,'skillRoots':Object['freeze'](_0x36725c),'managedRoot':_0x181aa9['managedRoot']});}
@@ -1 +1 @@
1
- const a135_0x2b007e=a135_0x5883;(function(_0x4087fa,_0x4bb8fd){const _0xda6133=a135_0x5883,_0x58a7b5=_0x4087fa();while(!![]){try{const _0x2baaf7=-parseInt(_0xda6133(0x107))/0x1+-parseInt(_0xda6133(0x121))/0x2+-parseInt(_0xda6133(0x122))/0x3+-parseInt(_0xda6133(0x116))/0x4+-parseInt(_0xda6133(0x109))/0x5*(parseInt(_0xda6133(0x12d))/0x6)+parseInt(_0xda6133(0x106))/0x7+-parseInt(_0xda6133(0x10f))/0x8*(-parseInt(_0xda6133(0x119))/0x9);if(_0x2baaf7===_0x4bb8fd)break;else _0x58a7b5['push'](_0x58a7b5['shift']());}catch(_0x1db4a0){_0x58a7b5['push'](_0x58a7b5['shift']());}}}(a135_0x4599,0x94f8c));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import a135_0x443f17 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';function a135_0x5883(_0x349b0c,_0x11f421){_0x349b0c=_0x349b0c-0x102;const _0x4599cd=a135_0x4599();let _0x58839b=_0x4599cd[_0x349b0c];return _0x58839b;}const {copySync,ensureDirSync,removeSync}=a135_0x443f17,RESERVED_PROJECT_SKILL_CODES=new Set([a135_0x2b007e(0x118),a135_0x2b007e(0x111),a135_0x2b007e(0x110)]);export function linkEffectiveRuntimeSkills(_0x4d8f8f,_0xbdae1f){const _0x18983e=a135_0x2b007e,_0x1ef113=new Map();for(const _0x176dd9 of _0x4d8f8f){const _0x101c0d=_0x176dd9[_0x18983e(0x11e)]['skillCode'];if(!_0x101c0d)continue;const _0x2ad408=_0x1ef113['get'](_0x101c0d);(!_0x2ad408||_0x176dd9[_0x18983e(0x11a)]===_0x18983e(0x112))&&_0x1ef113[_0x18983e(0x113)](_0x101c0d,_0x176dd9);}const _0x18a5cc=[];for(const _0x4bb061 of _0x1ef113[_0x18983e(0x127)]()){const _0x584877=requireSkillCode(_0x4bb061[_0x18983e(0x11e)]),_0x401104=readMetadataIfPresent(_0x4bb061[_0x18983e(0x104)]);if(_0x401104?.[_0x18983e(0x134)]!==_0xbdae1f[_0x18983e(0x134)]||_0x401104[_0x18983e(0x10b)]!==_0x584877)throw CliErrors[_0x18983e(0x10e)](_0x18983e(0x114)+_0xbdae1f[_0x18983e(0x134)]+':\x20'+_0x4bb061['metadataPath']);const _0x1e1186=runtimeSkillLinkName(_0xbdae1f,_0x584877);for(const _0x6b77fd of _0xbdae1f[_0x18983e(0x12e)]){_0x18a5cc[_0x18983e(0x11b)](ensureManagedSymlink(resolve(_0x6b77fd,_0x1e1186),_0x4bb061['dir'],_0xbdae1f,_0x584877));}}return _0x18a5cc;}export function pruneStaleRuntimeSkillLinks(_0x30609f,_0x141574,_0x343fdf){const _0x3ef335=a135_0x2b007e,_0x27cf2c=new Set([..._0x141574]['map'](_0xce9dfd=>_0xce9dfd[_0x3ef335(0x138)]())[_0x3ef335(0x11f)](Boolean)),_0x3ba0e3=_0x343fdf?new Set([..._0x343fdf][_0x3ef335(0x10a)](_0x2b001d=>_0x2b001d['trim']())[_0x3ef335(0x11f)](Boolean)):undefined,_0xfaf9cd=[];for(const _0x4a1ef1 of _0x30609f[_0x3ef335(0x12e)]){for(const _0x3c64ac of managedTargetSkillLinkPaths(_0x4a1ef1,_0x30609f)){const _0x3f1782=runtimeSkillCodeFromLink(_0x30609f,_0x3c64ac);if(_0x3ba0e3&&!_0x3ba0e3[_0x3ef335(0x103)](_0x3f1782))continue;if(_0x27cf2c['has'](_0x3f1782))continue;_0xfaf9cd[_0x3ef335(0x11b)](removeManagedSkillLink(_0x3c64ac,_0x30609f,_0x3f1782));}}return _0xfaf9cd;}export function pruneStaleRuntimeSkillCache(_0x30187b,_0x59ea13={}){const _0x2f706a=a135_0x2b007e,_0x43c7cc=new Set([..._0x30187b['activeSkillCodes']][_0x2f706a(0x10a)](_0x297b92=>_0x297b92['trim']())[_0x2f706a(0x11f)](Boolean)),_0x30715c=_0x30187b[_0x2f706a(0x11d)]?new Set([..._0x30187b[_0x2f706a(0x11d)]][_0x2f706a(0x10a)](_0x4a2bab=>_0x4a2bab[_0x2f706a(0x138)]())['filter'](Boolean)):undefined,_0x48a66c=_0x30187b[_0x2f706a(0x12a)]??[_0x2f706a(0x112),_0x2f706a(0x13c)],_0x45ac8c=resolve(getRuntimeSkillCacheRoot(_0x30187b[_0x2f706a(0x102)],_0x30187b['accessKey'],_0x59ea13),safePathSegment(_0x30187b[_0x2f706a(0x134)],_0x2f706a(0x134))),_0xccece3=[];for(const _0x565ea1 of _0x48a66c){const _0x4c494e=resolve(_0x45ac8c,_0x565ea1);if(!existsSync(_0x4c494e))continue;for(const _0x58380e of readdirSync(_0x4c494e,{'withFileTypes':!![]})){if(!_0x58380e['isDirectory']())continue;const _0x234442=_0x58380e[_0x2f706a(0x137)];if(_0x30715c&&!_0x30715c[_0x2f706a(0x103)](_0x234442))continue;if(_0x43c7cc[_0x2f706a(0x103)](_0x234442))continue;const _0x34df43=resolve(_0x4c494e,_0x234442),_0x3badf5=readMetadataIfPresent(resolve(_0x34df43,METADATA_FILE));if(_0x3badf5?.[_0x2f706a(0x134)]!==_0x30187b[_0x2f706a(0x134)]||_0x3badf5[_0x2f706a(0x11a)]!==_0x565ea1||_0x3badf5[_0x2f706a(0x10b)]!==_0x234442){_0xccece3[_0x2f706a(0x11b)]({'path':_0x34df43,'action':_0x2f706a(0x108),'reason':_0x2f706a(0x124)});continue;}if(isLinkedFromAnyRoot(_0x34df43,_0x30187b[_0x2f706a(0x12c)]??[])){_0xccece3[_0x2f706a(0x11b)]({'path':_0x34df43,'action':'skipped','reason':_0x2f706a(0x11c)});continue;}removeSync(_0x34df43),_0xccece3[_0x2f706a(0x11b)]({'path':_0x34df43,'action':_0x2f706a(0x130)});}}return _0xccece3;}function a135_0x4599(){const _0x2df746=['personal','set','Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20','contentHash','1590484IAYKGU','managedRoot','lovrabet','262467oxmKMD','scope','push','linked-from-protected-root','pruneSkillCodes','skill','filter','Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20','1732746iygCPN','231687LcIkNb','project','metadata-mismatch','isDirectory','Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20','values','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20','Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20','scopes','created','protectedLinkRoots','29754DmymvG','skillRoots','agentsSkillsDir','removed','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','builtin','dir','appCode','isSymbolicLink','length','name','trim','Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20','unchanged','updated','company','env','has','metadataPath','startsWith','883568dHULlW','14419mOHNBu','skipped','1115mhALta','map','skillCode','slice','not-managed-symlink','validation','808WvhwyC','secret-retriever','runtime-observe'];a135_0x4599=function(){return _0x2df746;};return a135_0x4599();}export function linkGlobalRuntimeSkills(_0x1894ad,_0x59741f={}){const _0x26b72f=a135_0x2b007e,_0x46131e=resolveSkillSyncPaths(_0x59741f),_0x1ce406=[];for(const _0x5a59da of _0x1894ad){if(_0x5a59da[_0x26b72f(0x11a)]!==_0x26b72f(0x132))throw CliErrors['validation'](_0x26b72f(0x131)+_0x5a59da[_0x26b72f(0x11a)]);const _0x3fed29=requireSkillCode(_0x5a59da[_0x26b72f(0x11e)]),_0x2aceff=copyManagedSkillDirectory(_0x5a59da[_0x26b72f(0x133)],resolve(_0x46131e[_0x26b72f(0x12f)],_0x3fed29));_0x1ce406['push']({..._0x2aceff,'contentHash':_0x5a59da[_0x26b72f(0x115)]});}return _0x1ce406;}function ensureManagedSymlink(_0x2ab497,_0x3e7f08,_0x47b74b,_0x58dd96){const _0x20ea8d=a135_0x2b007e;mkdirSync(dirname(_0x2ab497),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x2ab497)||isDanglingSymlink(_0x2ab497)){const _0x19bbe5=lstatSync(_0x2ab497);if(!_0x19bbe5['isSymbolicLink']())throw CliErrors[_0x20ea8d(0x10e)](_0x20ea8d(0x139)+_0x2ab497);const _0x1e0837=resolveSymlinkTarget(_0x2ab497);if(!isPathInside(realOrResolved(_0x1e0837),realOrResolved(_0x47b74b['managedRoot'])))throw CliErrors['validation'](_0x20ea8d(0x126)+_0x2ab497);if(realOrResolved(_0x1e0837)===realOrResolved(_0x3e7f08))return{'path':_0x2ab497,'target':_0x3e7f08,'action':_0x20ea8d(0x13a)};const _0x53bdff=readMetadataIfPresent(resolve(_0x1e0837,METADATA_FILE));if(_0x47b74b['scope']===_0x20ea8d(0x123)&&(_0x53bdff?.[_0x20ea8d(0x134)]!==_0x47b74b[_0x20ea8d(0x134)]||_0x53bdff[_0x20ea8d(0x10b)]!==_0x58dd96))throw CliErrors[_0x20ea8d(0x10e)](_0x20ea8d(0x120)+_0x2ab497);return unlinkSync(_0x2ab497),symlinkSync(_0x3e7f08,_0x2ab497,_0x20ea8d(0x133)),{'path':_0x2ab497,'target':_0x3e7f08,'action':_0x20ea8d(0x13b)};}return symlinkSync(_0x3e7f08,_0x2ab497,_0x20ea8d(0x133)),{'path':_0x2ab497,'target':_0x3e7f08,'action':_0x20ea8d(0x12b)};}function managedTargetSkillLinkPaths(_0x2a84b1,_0x14403d){const _0x282158=a135_0x2b007e;if(!existsSync(_0x2a84b1))return[];const _0x241530=_0x14403d[_0x282158(0x134)]+'--';return readdirSync(_0x2a84b1,{'withFileTypes':!![]})[_0x282158(0x11f)](_0xa64ee9=>_0x14403d[_0x282158(0x11a)]==='project'||_0xa64ee9['name'][_0x282158(0x105)](_0x241530))['map'](_0x2e58c9=>resolve(_0x2a84b1,_0x2e58c9[_0x282158(0x137)]));}function removeManagedSkillLink(_0x5153f3,_0x5a2c95,_0x38e3bc){const _0x493f15=a135_0x2b007e,_0xc75bd2=lstatIfPresent(_0x5153f3);if(!_0xc75bd2?.[_0x493f15(0x135)]())return{'path':_0x5153f3,'action':'skipped','reason':_0x493f15(0x10d)};const _0x30e75c=resolveSymlinkTarget(_0x5153f3);if(!isPathInside(realOrResolved(_0x30e75c),realOrResolved(_0x5a2c95[_0x493f15(0x117)])))return{'path':_0x5153f3,'action':'skipped','reason':'external-symlink'};const _0x10600d=readMetadataIfPresent(resolve(_0x30e75c,METADATA_FILE));if(_0x5a2c95[_0x493f15(0x11a)]===_0x493f15(0x123)&&(_0x10600d?.[_0x493f15(0x134)]!==_0x5a2c95[_0x493f15(0x134)]||_0x10600d[_0x493f15(0x10b)]!==_0x38e3bc))return{'path':_0x5153f3,'action':'skipped','reason':_0x493f15(0x124)};return unlinkSync(_0x5153f3),{'path':_0x5153f3,'action':_0x493f15(0x130)};}function isLinkedFromAnyRoot(_0x551f61,_0x2cccbf){const _0x20f3be=a135_0x2b007e,_0x18afd6=realOrResolved(_0x551f61);for(const _0x3355f5 of _0x2cccbf){if(!existsSync(_0x3355f5))continue;for(const _0x4dad6a of readdirSync(_0x3355f5,{'withFileTypes':!![]})){if(!_0x4dad6a[_0x20f3be(0x135)]())continue;const _0x153b86=resolve(_0x3355f5,_0x4dad6a[_0x20f3be(0x137)]);if(realOrResolved(resolveSymlinkTarget(_0x153b86))===_0x18afd6)return!![];}}return![];}function runtimeSkillLinkName(_0x3906ae,_0x35b663){const _0x26cee7=a135_0x2b007e,_0x2fe88d=safePathSegment(_0x35b663,_0x26cee7(0x10b));if(_0x3906ae[_0x26cee7(0x11a)]===_0x26cee7(0x123)&&RESERVED_PROJECT_SKILL_CODES[_0x26cee7(0x103)](_0x2fe88d))throw CliErrors[_0x26cee7(0x10e)]('Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20'+_0x2fe88d);return _0x3906ae[_0x26cee7(0x11a)]===_0x26cee7(0x123)?_0x2fe88d:_0x3906ae[_0x26cee7(0x134)]+'--'+_0x2fe88d;}function runtimeSkillCodeFromLink(_0x4b061e,_0x2057a9){const _0x6223f5=a135_0x2b007e,_0x11fb2f=basename(_0x2057a9);return _0x4b061e[_0x6223f5(0x11a)]===_0x6223f5(0x123)?_0x11fb2f:_0x11fb2f[_0x6223f5(0x10c)]((_0x4b061e[_0x6223f5(0x134)]+'--')[_0x6223f5(0x136)]);}export function copyManagedSkillDirectory(_0x5ce02f,_0xbeeb){const _0x55f6fb=a135_0x2b007e,_0x3d867b=resolve(_0xbeeb,METADATA_FILE),_0x387f2c=existsSync(_0xbeeb);if(_0x387f2c){const _0x33bb3c=lstatSync(_0xbeeb);if(_0x33bb3c[_0x55f6fb(0x135)]())throw CliErrors[_0x55f6fb(0x10e)](_0x55f6fb(0x129)+_0xbeeb);if(!_0x33bb3c[_0x55f6fb(0x125)]())throw CliErrors['validation']('Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20'+_0xbeeb);const _0x29636d=readMetadataIfPresent(_0x3d867b);if(_0x29636d?.[_0x55f6fb(0x11a)]!==_0x55f6fb(0x132))throw CliErrors[_0x55f6fb(0x10e)](_0x55f6fb(0x128)+_0xbeeb);}ensureDirSync(dirname(_0xbeeb));const _0x1fd0ab=_0x387f2c?readMetadataIfPresent(_0x3d867b)?.['contentHash']:undefined,_0x7af3d4=readMetadataIfPresent(resolve(_0x5ce02f,METADATA_FILE))?.[_0x55f6fb(0x115)];return _0x387f2c&&removeSync(_0xbeeb),copySkillDirectory(_0x5ce02f,_0xbeeb),{'path':_0xbeeb,'target':_0x5ce02f,'action':!_0x387f2c?_0x55f6fb(0x12b):_0x1fd0ab===_0x7af3d4?_0x55f6fb(0x13a):_0x55f6fb(0x13b)};}function copySkillDirectory(_0x5b8657,_0x22faf2){copySync(_0x5b8657,_0x22faf2,{'dereference':![],'overwrite':!![],'filter'(_0xd38fa){const _0x4bbd66=a135_0x5883;if(lstatSync(_0xd38fa)[_0x4bbd66(0x135)]())throw CliErrors[_0x4bbd66(0x10e)]('Refusing\x20to\x20copy\x20Skill\x20symlink:\x20'+_0xd38fa);return!![];}});}
1
+ const a138_0x50ac1a=a138_0x294d;(function(_0x534d63,_0x379e4b){const _0x555187=a138_0x294d,_0x3324c5=_0x534d63();while(!![]){try{const _0x39eed3=-parseInt(_0x555187(0xc1))/0x1+-parseInt(_0x555187(0xa4))/0x2*(parseInt(_0x555187(0xaa))/0x3)+-parseInt(_0x555187(0xb0))/0x4+-parseInt(_0x555187(0xcd))/0x5*(parseInt(_0x555187(0xad))/0x6)+parseInt(_0x555187(0xcc))/0x7*(-parseInt(_0x555187(0xd2))/0x8)+-parseInt(_0x555187(0xd3))/0x9+parseInt(_0x555187(0xb9))/0xa;if(_0x39eed3===_0x379e4b)break;else _0x3324c5['push'](_0x3324c5['shift']());}catch(_0x5c037f){_0x3324c5['push'](_0x3324c5['shift']());}}}(a138_0x5644,0x1c6f6));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import a138_0x4600b6 from'fs-extra';import{CliErrors}from'../../errors.js';function a138_0x5644(){const _0x5896bf=['company','set','Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20','trim','name','filter','startsWith','7QvQkuy','5FdyyGC','linked-from-protected-root','get','pruneSkillCodes','Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20','433208ehaVUW','1963062Okomfs','removed','metadata-mismatch','accessKey','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','validation','metadataPath','length','Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20','env','skill','skillRoots','unchanged','Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20','8kACmpY','appCode','push','isSymbolicLink','has','Refusing\x20to\x20copy\x20Skill\x20symlink:\x20','43863pyjglu','not-managed-symlink','agentsSkillsDir','586128QqMWeu','created','lovrabet','143936uuXbCP','scope','values','builtin','skipped','contentHash','personal','protectedLinkRoots','isDirectory','6863920TgsnJe','skillCode','dir','project','scopes','map','updated','Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20','105497fTcyhe','Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20','managedRoot','activeSkillCodes'];a138_0x5644=function(){return _0x5896bf;};return a138_0x5644();}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}=a138_0x4600b6,RESERVED_PROJECT_SKILL_CODES=new Set([a138_0x50ac1a(0xaf),'runtime-observe','secret-retriever']);export function linkEffectiveRuntimeSkills(_0x1d9e29,_0x3619c3){const _0x7722b3=a138_0x50ac1a,_0x3e5488=new Map();for(const _0x1fd6b7 of _0x1d9e29){const _0x6a844d=_0x1fd6b7[_0x7722b3(0xa0)][_0x7722b3(0xba)];if(!_0x6a844d)continue;const _0x558530=_0x3e5488[_0x7722b3(0xcf)](_0x6a844d);(!_0x558530||_0x1fd6b7['scope']===_0x7722b3(0xb6))&&_0x3e5488[_0x7722b3(0xc6)](_0x6a844d,_0x1fd6b7);}const _0x1ac133=[];for(const _0x3e3e96 of _0x3e5488[_0x7722b3(0xb2)]()){const _0x1cefaa=requireSkillCode(_0x3e3e96['skill']),_0x4105cf=readMetadataIfPresent(_0x3e3e96[_0x7722b3(0x9c)]);if(_0x4105cf?.[_0x7722b3(0xa5)]!==_0x3619c3[_0x7722b3(0xa5)]||_0x4105cf['skillCode']!==_0x1cefaa)throw CliErrors[_0x7722b3(0x9b)](_0x7722b3(0xc7)+_0x3619c3[_0x7722b3(0xa5)]+':\x20'+_0x3e3e96[_0x7722b3(0x9c)]);const _0x3422c5=runtimeSkillLinkName(_0x3619c3,_0x1cefaa);for(const _0x3f6c6f of _0x3619c3[_0x7722b3(0xa1)]){_0x1ac133[_0x7722b3(0xa6)](ensureManagedSymlink(resolve(_0x3f6c6f,_0x3422c5),_0x3e3e96[_0x7722b3(0xbb)],_0x3619c3,_0x1cefaa));}}return _0x1ac133;}export function pruneStaleRuntimeSkillLinks(_0x2fcac8,_0x54b047,_0x4a0164){const _0xa697e2=a138_0x50ac1a,_0x3092ec=new Set([..._0x54b047][_0xa697e2(0xbe)](_0x28b291=>_0x28b291[_0xa697e2(0xc8)]())['filter'](Boolean)),_0x34d1bf=_0x4a0164?new Set([..._0x4a0164][_0xa697e2(0xbe)](_0x3750f7=>_0x3750f7[_0xa697e2(0xc8)]())[_0xa697e2(0xca)](Boolean)):undefined,_0x556aeb=[];for(const _0x6deb0b of _0x2fcac8[_0xa697e2(0xa1)]){for(const _0x21f87a of managedTargetSkillLinkPaths(_0x6deb0b,_0x2fcac8)){const _0x18f28a=runtimeSkillCodeFromLink(_0x2fcac8,_0x21f87a);if(_0x34d1bf&&!_0x34d1bf[_0xa697e2(0xa8)](_0x18f28a))continue;if(_0x3092ec[_0xa697e2(0xa8)](_0x18f28a))continue;_0x556aeb[_0xa697e2(0xa6)](removeManagedSkillLink(_0x21f87a,_0x2fcac8,_0x18f28a));}}return _0x556aeb;}export function pruneStaleRuntimeSkillCache(_0x4cd209,_0x38e1cb={}){const _0x30871e=a138_0x50ac1a,_0x1624b9=new Set([..._0x4cd209[_0x30871e(0xc4)]]['map'](_0x16a5e4=>_0x16a5e4[_0x30871e(0xc8)]())[_0x30871e(0xca)](Boolean)),_0x546a75=_0x4cd209[_0x30871e(0xd0)]?new Set([..._0x4cd209['pruneSkillCodes']][_0x30871e(0xbe)](_0x277300=>_0x277300[_0x30871e(0xc8)]())['filter'](Boolean)):undefined,_0x2bceed=_0x4cd209[_0x30871e(0xbd)]??[_0x30871e(0xb6),_0x30871e(0xc5)],_0x408887=resolve(getRuntimeSkillCacheRoot(_0x4cd209[_0x30871e(0x9f)],_0x4cd209[_0x30871e(0xd6)],_0x38e1cb),safePathSegment(_0x4cd209[_0x30871e(0xa5)],_0x30871e(0xa5))),_0x30ba90=[];for(const _0x2d3fb3 of _0x2bceed){const _0x43f99d=resolve(_0x408887,_0x2d3fb3);if(!existsSync(_0x43f99d))continue;for(const _0x5b5380 of readdirSync(_0x43f99d,{'withFileTypes':!![]})){if(!_0x5b5380[_0x30871e(0xb8)]())continue;const _0x20251a=_0x5b5380[_0x30871e(0xc9)];if(_0x546a75&&!_0x546a75[_0x30871e(0xa8)](_0x20251a))continue;if(_0x1624b9[_0x30871e(0xa8)](_0x20251a))continue;const _0x3a0ae4=resolve(_0x43f99d,_0x20251a),_0x384b7f=readMetadataIfPresent(resolve(_0x3a0ae4,METADATA_FILE));if(_0x384b7f?.[_0x30871e(0xa5)]!==_0x4cd209['appCode']||_0x384b7f[_0x30871e(0xb1)]!==_0x2d3fb3||_0x384b7f[_0x30871e(0xba)]!==_0x20251a){_0x30ba90[_0x30871e(0xa6)]({'path':_0x3a0ae4,'action':'skipped','reason':_0x30871e(0xd5)});continue;}if(isLinkedFromAnyRoot(_0x3a0ae4,_0x4cd209[_0x30871e(0xb7)]??[])){_0x30ba90['push']({'path':_0x3a0ae4,'action':_0x30871e(0xb4),'reason':_0x30871e(0xce)});continue;}removeSync(_0x3a0ae4),_0x30ba90[_0x30871e(0xa6)]({'path':_0x3a0ae4,'action':'removed'});}}return _0x30ba90;}function a138_0x294d(_0xefca70,_0x1dd19c){_0xefca70=_0xefca70-0x9a;const _0x5644f0=a138_0x5644();let _0x294db7=_0x5644f0[_0xefca70];return _0x294db7;}export function linkGlobalRuntimeSkills(_0x4780b5,_0x32b8d8={}){const _0x905436=a138_0x50ac1a,_0x2eebaf=resolveSkillSyncPaths(_0x32b8d8),_0x4311d6=[];for(const _0x271799 of _0x4780b5){if(_0x271799[_0x905436(0xb1)]!==_0x905436(0xb3))throw CliErrors[_0x905436(0x9b)](_0x905436(0x9a)+_0x271799[_0x905436(0xb1)]);const _0x3b6a2b=requireSkillCode(_0x271799[_0x905436(0xa0)]),_0x40b49d=copyManagedSkillDirectory(_0x271799['dir'],resolve(_0x2eebaf[_0x905436(0xac)],_0x3b6a2b));_0x4311d6[_0x905436(0xa6)]({..._0x40b49d,'contentHash':_0x271799['contentHash']});}return _0x4311d6;}function ensureManagedSymlink(_0x1c1951,_0x5c88a4,_0x4777a7,_0x428dd9){const _0x28f89f=a138_0x50ac1a;mkdirSync(dirname(_0x1c1951),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x1c1951)||isDanglingSymlink(_0x1c1951)){const _0x187eb7=lstatSync(_0x1c1951);if(!_0x187eb7['isSymbolicLink']())throw CliErrors[_0x28f89f(0x9b)](_0x28f89f(0xd1)+_0x1c1951);const _0x231565=resolveSymlinkTarget(_0x1c1951);if(!isPathInside(realOrResolved(_0x231565),realOrResolved(_0x4777a7[_0x28f89f(0xc3)])))throw CliErrors[_0x28f89f(0x9b)](_0x28f89f(0xc2)+_0x1c1951);if(realOrResolved(_0x231565)===realOrResolved(_0x5c88a4))return{'path':_0x1c1951,'target':_0x5c88a4,'action':_0x28f89f(0xa2)};const _0x172b68=readMetadataIfPresent(resolve(_0x231565,METADATA_FILE));if(_0x4777a7['scope']===_0x28f89f(0xbc)&&(_0x172b68?.[_0x28f89f(0xa5)]!==_0x4777a7[_0x28f89f(0xa5)]||_0x172b68[_0x28f89f(0xba)]!==_0x428dd9))throw CliErrors[_0x28f89f(0x9b)](_0x28f89f(0xa3)+_0x1c1951);return unlinkSync(_0x1c1951),symlinkSync(_0x5c88a4,_0x1c1951,_0x28f89f(0xbb)),{'path':_0x1c1951,'target':_0x5c88a4,'action':_0x28f89f(0xbf)};}return symlinkSync(_0x5c88a4,_0x1c1951,'dir'),{'path':_0x1c1951,'target':_0x5c88a4,'action':_0x28f89f(0xae)};}function managedTargetSkillLinkPaths(_0x128acd,_0x114f8c){const _0x18e85e=a138_0x50ac1a;if(!existsSync(_0x128acd))return[];const _0x2f12a9=_0x114f8c[_0x18e85e(0xa5)]+'--';return readdirSync(_0x128acd,{'withFileTypes':!![]})[_0x18e85e(0xca)](_0x159c71=>_0x114f8c['scope']==='project'||_0x159c71[_0x18e85e(0xc9)][_0x18e85e(0xcb)](_0x2f12a9))[_0x18e85e(0xbe)](_0x2ef18b=>resolve(_0x128acd,_0x2ef18b[_0x18e85e(0xc9)]));}function removeManagedSkillLink(_0x2bfd4f,_0x2a4d0d,_0x282582){const _0x548b83=a138_0x50ac1a,_0x18f665=lstatIfPresent(_0x2bfd4f);if(!_0x18f665?.[_0x548b83(0xa7)]())return{'path':_0x2bfd4f,'action':_0x548b83(0xb4),'reason':_0x548b83(0xab)};const _0x350218=resolveSymlinkTarget(_0x2bfd4f);if(!isPathInside(realOrResolved(_0x350218),realOrResolved(_0x2a4d0d['managedRoot'])))return{'path':_0x2bfd4f,'action':_0x548b83(0xb4),'reason':'external-symlink'};const _0x1e6d56=readMetadataIfPresent(resolve(_0x350218,METADATA_FILE));if(_0x2a4d0d[_0x548b83(0xb1)]===_0x548b83(0xbc)&&(_0x1e6d56?.[_0x548b83(0xa5)]!==_0x2a4d0d[_0x548b83(0xa5)]||_0x1e6d56[_0x548b83(0xba)]!==_0x282582))return{'path':_0x2bfd4f,'action':'skipped','reason':_0x548b83(0xd5)};return unlinkSync(_0x2bfd4f),{'path':_0x2bfd4f,'action':_0x548b83(0xd4)};}function isLinkedFromAnyRoot(_0x32f68f,_0x60c0e4){const _0x222262=realOrResolved(_0x32f68f);for(const _0x1aa0b9 of _0x60c0e4){if(!existsSync(_0x1aa0b9))continue;for(const _0x189b6f of readdirSync(_0x1aa0b9,{'withFileTypes':!![]})){if(!_0x189b6f['isSymbolicLink']())continue;const _0x488124=resolve(_0x1aa0b9,_0x189b6f['name']);if(realOrResolved(resolveSymlinkTarget(_0x488124))===_0x222262)return!![];}}return![];}function runtimeSkillLinkName(_0xada033,_0x10b831){const _0x4bd7c5=a138_0x50ac1a,_0x5760b8=safePathSegment(_0x10b831,'skillCode');if(_0xada033['scope']===_0x4bd7c5(0xbc)&&RESERVED_PROJECT_SKILL_CODES[_0x4bd7c5(0xa8)](_0x5760b8))throw CliErrors['validation'](_0x4bd7c5(0x9e)+_0x5760b8);return _0xada033[_0x4bd7c5(0xb1)]===_0x4bd7c5(0xbc)?_0x5760b8:_0xada033['appCode']+'--'+_0x5760b8;}function runtimeSkillCodeFromLink(_0x1072a0,_0x56301e){const _0x160bc5=a138_0x50ac1a,_0x330a5c=basename(_0x56301e);return _0x1072a0[_0x160bc5(0xb1)]==='project'?_0x330a5c:_0x330a5c['slice']((_0x1072a0['appCode']+'--')[_0x160bc5(0x9d)]);}export function copyManagedSkillDirectory(_0x40d284,_0x2f4159){const _0x22520b=a138_0x50ac1a,_0x29b758=resolve(_0x2f4159,METADATA_FILE),_0xf99c7e=existsSync(_0x2f4159);if(_0xf99c7e){const _0x236a91=lstatSync(_0x2f4159);if(_0x236a91['isSymbolicLink']())throw CliErrors['validation'](_0x22520b(0xc0)+_0x2f4159);if(!_0x236a91[_0x22520b(0xb8)]())throw CliErrors[_0x22520b(0x9b)]('Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20'+_0x2f4159);const _0xb29f8=readMetadataIfPresent(_0x29b758);if(_0xb29f8?.[_0x22520b(0xb1)]!=='builtin')throw CliErrors['validation']('Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20'+_0x2f4159);}ensureDirSync(dirname(_0x2f4159));const _0x5f5b0a=_0xf99c7e?readMetadataIfPresent(_0x29b758)?.[_0x22520b(0xb5)]:undefined,_0x558169=readMetadataIfPresent(resolve(_0x40d284,METADATA_FILE))?.[_0x22520b(0xb5)];return _0xf99c7e&&removeSync(_0x2f4159),copySkillDirectory(_0x40d284,_0x2f4159),{'path':_0x2f4159,'target':_0x40d284,'action':!_0xf99c7e?'created':_0x5f5b0a===_0x558169?'unchanged':'updated'};}function copySkillDirectory(_0x1e8218,_0x123ff9){copySync(_0x1e8218,_0x123ff9,{'dereference':![],'overwrite':!![],'filter'(_0x5a24f2){const _0x45e83f=a138_0x294d;if(lstatSync(_0x5a24f2)['isSymbolicLink']())throw CliErrors[_0x45e83f(0x9b)](_0x45e83f(0xa9)+_0x5a24f2);return!![];}});}
@@ -1 +1 @@
1
- (function(_0x41fa58,_0x139735){const _0x125671=a136_0x5587,_0x72d4a9=_0x41fa58();while(!![]){try{const _0x1bee1d=parseInt(_0x125671(0x1ae))/0x1*(parseInt(_0x125671(0x199))/0x2)+parseInt(_0x125671(0x1a4))/0x3*(-parseInt(_0x125671(0x18b))/0x4)+-parseInt(_0x125671(0x188))/0x5*(parseInt(_0x125671(0x189))/0x6)+parseInt(_0x125671(0x1a5))/0x7*(-parseInt(_0x125671(0x197))/0x8)+-parseInt(_0x125671(0x194))/0x9+parseInt(_0x125671(0x1aa))/0xa+parseInt(_0x125671(0x1a9))/0xb;if(_0x1bee1d===_0x139735)break;else _0x72d4a9['push'](_0x72d4a9['shift']());}catch(_0xcfa6c8){_0x72d4a9['push'](_0x72d4a9['shift']());}}}(a136_0x57f5,0x6efdd));import{existsSync,readdirSync}from'node:fs';import{resolve}from'node:path';import{CliErrors}from'../../errors.js';function a136_0x57f5(){const _0x15c036=['push','source','87306UbkUIw','includes','sort','isDirectory','code','map','3706735EDvnzw','6tojWAf','tags','4zUSWlJ','has','get','skillCode','scope','trim','Runtime\x20Skill\x20install\x20target\x20app\x20mismatch:\x20','project','localeCompare','3767049CkBEsu','skillMdPath','linkedPath','3048LPeWNh','skillRoots','12yubZuA','startsWith','link','isSymbolicLink','builtin','local','scopes','filter','validation','appCode','isArray','129411xKqEfU','9597jHNxYP','linkedPaths','metadataPath','cache','9823242bLKYyg','7631590yETNSj','name'];a136_0x57f5=function(){return _0x15c036;};return a136_0x57f5();}import{METADATA_FILE,SKILL_FILE}from'./constants.js';function a136_0x5587(_0x42df24,_0xfe06d5){_0x42df24=_0x42df24-0x188;const _0x57f5bd=a136_0x57f5();let _0x55878a=_0x57f5bd[_0x42df24];return _0x55878a;}import{readMetadataIfPresent}from'./metadata.js';import{getRuntimeSkillCacheRoot,safePathSegment}from'./paths.js';import{isRuntimeSkillScope,normalizeRuntimeSkillScopes}from'./scopes.js';export function listLocalRuntimeSkills(_0x321a5c,_0x1870f8,_0x2479ac={}){const _0x378ae9=a136_0x5587,_0x556e90=safePathSegment(_0x321a5c[_0x378ae9(0x1a2)],_0x378ae9(0x1a2));if(_0x1870f8[_0x378ae9(0x1a2)]!==_0x556e90)throw CliErrors[_0x378ae9(0x1a1)](_0x378ae9(0x191)+_0x1870f8[_0x378ae9(0x1a2)]+'\x20!=\x20'+_0x556e90);const _0x358b14=normalizeRuntimeSkillScopes(_0x321a5c['scopes']),_0x352367=new Set(_0x358b14),_0x4592df=_0x321a5c[_0x378ae9(0x1b2)]?.[_0x378ae9(0x190)](),_0x17b8f6=new Map(),_0x4e833b=resolve(getRuntimeSkillCacheRoot(_0x321a5c['env'],_0x321a5c['accessKey'],_0x2479ac),_0x556e90);for(const _0x1f17e6 of _0x358b14){for(const _0x5044d3 of localSkillEntryDirs(resolve(_0x4e833b,_0x1f17e6))){collectLocalRuntimeSkill(_0x17b8f6,_0x5044d3,{'appCode':_0x556e90,'scopes':_0x352367,'code':_0x4592df,'source':_0x378ae9(0x1a8)});}}for(const _0x25aca0 of _0x1870f8[_0x378ae9(0x198)]){for(const _0x2d0a74 of localSkillLinkCandidates(_0x25aca0,_0x1870f8,_0x352367)){collectLocalRuntimeSkill(_0x17b8f6,_0x2d0a74,{'appCode':_0x556e90,'scopes':_0x352367,'code':_0x4592df,'source':_0x378ae9(0x19b),'linkedPath':_0x2d0a74});}}return Array['from'](_0x17b8f6['values']())[_0x378ae9(0x1b0)](compareLocalRuntimeSkills);}function localSkillEntryDirs(_0x316504){const _0x35411c=a136_0x5587;if(!existsSync(_0x316504))return[];return readdirSync(_0x316504,{'withFileTypes':!![]})[_0x35411c(0x1a0)](_0x5d0101=>_0x5d0101['isDirectory']()||_0x5d0101[_0x35411c(0x19c)]())['map'](_0x483eba=>resolve(_0x316504,_0x483eba['name']));}function localSkillLinkCandidates(_0x4c9bba,_0x1b8569,_0x32e8ff){const _0x17b4fc=a136_0x5587;if(!existsSync(_0x4c9bba))return[];const _0x28cbb0=_0x1b8569[_0x17b4fc(0x1a2)]+'--';return readdirSync(_0x4c9bba,{'withFileTypes':!![]})[_0x17b4fc(0x1a0)](_0x6d8b39=>_0x6d8b39[_0x17b4fc(0x1b1)]()||_0x6d8b39[_0x17b4fc(0x19c)]())[_0x17b4fc(0x1a0)](_0x1fb274=>_0x1b8569['scope']===_0x17b4fc(0x192)||_0x1fb274[_0x17b4fc(0x1ab)][_0x17b4fc(0x19a)](_0x28cbb0)||_0x32e8ff['has'](_0x17b4fc(0x19d)))[_0x17b4fc(0x1b3)](_0x2cc1d2=>resolve(_0x4c9bba,_0x2cc1d2[_0x17b4fc(0x1ab)]));}function collectLocalRuntimeSkill(_0x59ce58,_0x3b540e,_0x5a63e2){const _0x1c51a7=a136_0x5587,_0x2e494d=resolve(_0x3b540e,METADATA_FILE),_0x4379ea=readMetadataIfPresent(_0x2e494d);if(!_0x4379ea)return;if(_0x4379ea[_0x1c51a7(0x1a2)]!==_0x5a63e2['appCode'])return;if(!isRuntimeSkillScope(_0x4379ea[_0x1c51a7(0x18f)])||!_0x5a63e2[_0x1c51a7(0x19f)][_0x1c51a7(0x18c)](_0x4379ea[_0x1c51a7(0x18f)]))return;const _0x172cf7=_0x4379ea['skillCode']?.[_0x1c51a7(0x190)]();if(!_0x172cf7)return;if(_0x5a63e2[_0x1c51a7(0x1b2)]&&_0x172cf7!==_0x5a63e2['code'])return;const _0x59474b=_0x4379ea['scope']+':'+_0x172cf7,_0x1e5c48=_0x5a63e2[_0x1c51a7(0x196)]?[_0x5a63e2[_0x1c51a7(0x196)]]:[],_0x35808d=_0x59ce58[_0x1c51a7(0x18d)](_0x59474b);if(_0x35808d){_0x5a63e2['source']===_0x1c51a7(0x1a8)&&(_0x35808d['dir']=_0x3b540e,_0x35808d['cacheDir']=_0x3b540e,_0x35808d[_0x1c51a7(0x195)]=resolve(_0x3b540e,SKILL_FILE),_0x35808d[_0x1c51a7(0x1a7)]=_0x2e494d);for(const _0x34be15 of _0x1e5c48){!_0x35808d[_0x1c51a7(0x1a6)][_0x1c51a7(0x1af)](_0x34be15)&&_0x35808d['linkedPaths'][_0x1c51a7(0x1ac)](_0x34be15);}_0x35808d[_0x1c51a7(0x1a6)][_0x1c51a7(0x1b0)]();return;}_0x59ce58['set'](_0x59474b,{..._0x4379ea,'tags':Array[_0x1c51a7(0x1a3)](_0x4379ea[_0x1c51a7(0x18a)])?_0x4379ea[_0x1c51a7(0x18a)]:[],'scope':_0x4379ea[_0x1c51a7(0x18f)],'source':_0x1c51a7(0x19e),'dir':_0x3b540e,'cacheDir':_0x5a63e2[_0x1c51a7(0x1ad)]==='cache'?_0x3b540e:undefined,'skillMdPath':resolve(_0x3b540e,SKILL_FILE),'metadataPath':_0x2e494d,'linkedPaths':_0x1e5c48});}function compareLocalRuntimeSkills(_0x5bbf0d,_0x2bfddc){const _0x510bf2=a136_0x5587,_0x1978aa={'personal':0x0,'company':0x1,'builtin':0x2};return _0x1978aa[_0x5bbf0d[_0x510bf2(0x18f)]]-_0x1978aa[_0x2bfddc[_0x510bf2(0x18f)]]||_0x5bbf0d[_0x510bf2(0x18e)][_0x510bf2(0x193)](_0x2bfddc[_0x510bf2(0x18e)])||_0x5bbf0d['dir']['localeCompare'](_0x2bfddc['dir']);}
1
+ (function(_0x21c68b,_0x169f6b){const _0x60ead4=a139_0x3e8b,_0x369e44=_0x21c68b();while(!![]){try{const _0x299982=parseInt(_0x60ead4(0xd8))/0x1*(parseInt(_0x60ead4(0xe1))/0x2)+-parseInt(_0x60ead4(0xe6))/0x3*(parseInt(_0x60ead4(0xec))/0x4)+parseInt(_0x60ead4(0xf0))/0x5*(parseInt(_0x60ead4(0xf6))/0x6)+-parseInt(_0x60ead4(0xe5))/0x7*(parseInt(_0x60ead4(0x100))/0x8)+-parseInt(_0x60ead4(0x105))/0x9*(parseInt(_0x60ead4(0xdd))/0xa)+-parseInt(_0x60ead4(0xe9))/0xb+parseInt(_0x60ead4(0xe3))/0xc*(parseInt(_0x60ead4(0xf4))/0xd);if(_0x299982===_0x169f6b)break;else _0x369e44['push'](_0x369e44['shift']());}catch(_0x303402){_0x369e44['push'](_0x369e44['shift']());}}}(a139_0x3202,0x89d3a));import{existsSync,readdirSync}from'node:fs';import{resolve}from'node:path';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{readMetadataIfPresent}from'./metadata.js';function a139_0x3202(){const _0x16d84f=['metadataPath','startsWith','1ianEee','values','name','isDirectory','\x20!=\x20','10nyHAYu','source','link','includes','424094lRHemC','local','324fkIeeO','validation','7kJShaf','72sBEbnM','cacheDir','isArray','12321969gezPOQ','map','appCode','106588nNQoUP','linkedPath','linkedPaths','filter','3732995gfAoaU','scopes','isSymbolicLink','cache','1501942LaBQtp','scope','6wKYeGc','skillCode','set','trim','builtin','has','project','skillMdPath','localeCompare','dir','6765384zDxjNh','sort','code','tags','skillRoots','8173314OmdRxf'];a139_0x3202=function(){return _0x16d84f;};return a139_0x3202();}import{getRuntimeSkillCacheRoot,safePathSegment}from'./paths.js';function a139_0x3e8b(_0x14ad41,_0x3996ca){_0x14ad41=_0x14ad41-0xd7;const _0x32026b=a139_0x3202();let _0x3e8b4b=_0x32026b[_0x14ad41];return _0x3e8b4b;}import{isRuntimeSkillScope,normalizeRuntimeSkillScopes}from'./scopes.js';export function listLocalRuntimeSkills(_0x4b98c1,_0x1468ec,_0x46be2d={}){const _0xe2290c=a139_0x3e8b,_0x86b830=safePathSegment(_0x4b98c1[_0xe2290c(0xeb)],'appCode');if(_0x1468ec[_0xe2290c(0xeb)]!==_0x86b830)throw CliErrors[_0xe2290c(0xe4)]('Runtime\x20Skill\x20install\x20target\x20app\x20mismatch:\x20'+_0x1468ec[_0xe2290c(0xeb)]+_0xe2290c(0xdc)+_0x86b830);const _0x26fe90=normalizeRuntimeSkillScopes(_0x4b98c1['scopes']),_0x21de2f=new Set(_0x26fe90),_0x7cbb39=_0x4b98c1[_0xe2290c(0x102)]?.['trim'](),_0x329a34=new Map(),_0x2085ef=resolve(getRuntimeSkillCacheRoot(_0x4b98c1['env'],_0x4b98c1['accessKey'],_0x46be2d),_0x86b830);for(const _0x2100ad of _0x26fe90){for(const _0x51a2a6 of localSkillEntryDirs(resolve(_0x2085ef,_0x2100ad))){collectLocalRuntimeSkill(_0x329a34,_0x51a2a6,{'appCode':_0x86b830,'scopes':_0x21de2f,'code':_0x7cbb39,'source':_0xe2290c(0xf3)});}}for(const _0x1ab8b2 of _0x1468ec[_0xe2290c(0x104)]){for(const _0x543ec9 of localSkillLinkCandidates(_0x1ab8b2,_0x1468ec,_0x21de2f)){collectLocalRuntimeSkill(_0x329a34,_0x543ec9,{'appCode':_0x86b830,'scopes':_0x21de2f,'code':_0x7cbb39,'source':_0xe2290c(0xdf),'linkedPath':_0x543ec9});}}return Array['from'](_0x329a34[_0xe2290c(0xd9)]())[_0xe2290c(0x101)](compareLocalRuntimeSkills);}function localSkillEntryDirs(_0x46d7a2){const _0x1f623a=a139_0x3e8b;if(!existsSync(_0x46d7a2))return[];return readdirSync(_0x46d7a2,{'withFileTypes':!![]})[_0x1f623a(0xef)](_0x17a9f7=>_0x17a9f7[_0x1f623a(0xdb)]()||_0x17a9f7[_0x1f623a(0xf2)]())[_0x1f623a(0xea)](_0x17e254=>resolve(_0x46d7a2,_0x17e254['name']));}function localSkillLinkCandidates(_0x39107a,_0x438bc9,_0x2dea8c){const _0x567b70=a139_0x3e8b;if(!existsSync(_0x39107a))return[];const _0x440238=_0x438bc9[_0x567b70(0xeb)]+'--';return readdirSync(_0x39107a,{'withFileTypes':!![]})['filter'](_0x2db41d=>_0x2db41d[_0x567b70(0xdb)]()||_0x2db41d[_0x567b70(0xf2)]())[_0x567b70(0xef)](_0x7c18e9=>_0x438bc9[_0x567b70(0xf5)]===_0x567b70(0xfc)||_0x7c18e9[_0x567b70(0xda)][_0x567b70(0xd7)](_0x440238)||_0x2dea8c[_0x567b70(0xfb)](_0x567b70(0xfa)))[_0x567b70(0xea)](_0x7b66de=>resolve(_0x39107a,_0x7b66de[_0x567b70(0xda)]));}function collectLocalRuntimeSkill(_0x178575,_0x546b9e,_0x3a21f1){const _0x782a68=a139_0x3e8b,_0x524b23=resolve(_0x546b9e,METADATA_FILE),_0x3530c3=readMetadataIfPresent(_0x524b23);if(!_0x3530c3)return;if(_0x3530c3[_0x782a68(0xeb)]!==_0x3a21f1[_0x782a68(0xeb)])return;if(!isRuntimeSkillScope(_0x3530c3[_0x782a68(0xf5)])||!_0x3a21f1[_0x782a68(0xf1)][_0x782a68(0xfb)](_0x3530c3['scope']))return;const _0x2e187a=_0x3530c3[_0x782a68(0xf7)]?.[_0x782a68(0xf9)]();if(!_0x2e187a)return;if(_0x3a21f1['code']&&_0x2e187a!==_0x3a21f1['code'])return;const _0x34b700=_0x3530c3[_0x782a68(0xf5)]+':'+_0x2e187a,_0x429d11=_0x3a21f1[_0x782a68(0xed)]?[_0x3a21f1[_0x782a68(0xed)]]:[],_0x4b4339=_0x178575['get'](_0x34b700);if(_0x4b4339){_0x3a21f1['source']===_0x782a68(0xf3)&&(_0x4b4339[_0x782a68(0xff)]=_0x546b9e,_0x4b4339[_0x782a68(0xe7)]=_0x546b9e,_0x4b4339[_0x782a68(0xfd)]=resolve(_0x546b9e,SKILL_FILE),_0x4b4339[_0x782a68(0x106)]=_0x524b23);for(const _0x1204dd of _0x429d11){!_0x4b4339[_0x782a68(0xee)][_0x782a68(0xe0)](_0x1204dd)&&_0x4b4339[_0x782a68(0xee)]['push'](_0x1204dd);}_0x4b4339['linkedPaths'][_0x782a68(0x101)]();return;}_0x178575[_0x782a68(0xf8)](_0x34b700,{..._0x3530c3,'tags':Array[_0x782a68(0xe8)](_0x3530c3[_0x782a68(0x103)])?_0x3530c3['tags']:[],'scope':_0x3530c3['scope'],'source':_0x782a68(0xe2),'dir':_0x546b9e,'cacheDir':_0x3a21f1[_0x782a68(0xde)]===_0x782a68(0xf3)?_0x546b9e:undefined,'skillMdPath':resolve(_0x546b9e,SKILL_FILE),'metadataPath':_0x524b23,'linkedPaths':_0x429d11});}function compareLocalRuntimeSkills(_0x34ae99,_0x5dd316){const _0x27b45d=a139_0x3e8b,_0xf25975={'personal':0x0,'company':0x1,'builtin':0x2};return _0xf25975[_0x34ae99[_0x27b45d(0xf5)]]-_0xf25975[_0x5dd316[_0x27b45d(0xf5)]]||_0x34ae99[_0x27b45d(0xf7)][_0x27b45d(0xfe)](_0x5dd316[_0x27b45d(0xf7)])||_0x34ae99[_0x27b45d(0xff)]['localeCompare'](_0x5dd316[_0x27b45d(0xff)]);}
@@ -1 +1 @@
1
- (function(_0x314a3c,_0x1f537f){const _0x3d5673=a137_0x1ba4,_0x213a05=_0x314a3c();while(!![]){try{const _0x56fb87=parseInt(_0x3d5673(0x117))/0x1+-parseInt(_0x3d5673(0x10d))/0x2*(-parseInt(_0x3d5673(0x10c))/0x3)+parseInt(_0x3d5673(0x118))/0x4+-parseInt(_0x3d5673(0x11d))/0x5+parseInt(_0x3d5673(0x104))/0x6+-parseInt(_0x3d5673(0x100))/0x7+-parseInt(_0x3d5673(0x119))/0x8;if(_0x56fb87===_0x1f537f)break;else _0x213a05['push'](_0x213a05['shift']());}catch(_0x24d215){_0x213a05['push'](_0x213a05['shift']());}}}(a137_0x49a0,0x9304a));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(_0x189fba){const _0x340996=a137_0x1ba4;return _0x189fba[_0x340996(0x10e)]??Buffer[_0x340996(0x114)](_0x189fba['content']??'',_0x340996(0xf8));}export function fileText(_0x406a97){const _0x48d507=a137_0x1ba4;return fileContent(_0x406a97)['toString'](_0x48d507(0xf8));}export function normalizeLocalFiles(_0x5585ae){const _0x493a90=a137_0x1ba4;if(!Array['isArray'](_0x5585ae)||_0x5585ae[_0x493a90(0x10b)]===0x0)return[];const _0x2755ec=new Map();for(const _0x23eb5e of _0x5585ae){if(!_0x23eb5e||typeof _0x23eb5e!==_0x493a90(0x116)||typeof _0x23eb5e[_0x493a90(0x10a)]!==_0x493a90(0x112))throw CliErrors[_0x493a90(0xfc)](_0x493a90(0x123));const _0x136467=normalizeSkillRelativePath(_0x23eb5e[_0x493a90(0x10a)]);if(_0x2755ec[_0x493a90(0x122)](_0x136467))throw CliErrors['validation'](_0x493a90(0x108)+_0x136467);if(_0x23eb5e[_0x493a90(0x10e)]!==undefined&&!Buffer[_0x493a90(0xf6)](_0x23eb5e['bytes']))throw CliErrors[_0x493a90(0xfc)](_0x493a90(0xf7)+_0x136467);if(_0x23eb5e[_0x493a90(0x10e)]===undefined&&typeof _0x23eb5e[_0x493a90(0x11c)]!=='string')throw CliErrors['validation'](_0x493a90(0xfb)+_0x136467);const _0x4a208c=fileContent(_0x23eb5e);_0x2755ec[_0x493a90(0x110)](_0x136467,{'path':_0x136467,'bytes':_0x4a208c});}return Array[_0x493a90(0x114)](_0x2755ec[_0x493a90(0x105)]())['sort'](compareSkillFiles);}function a137_0x49a0(){const _0x281b31=['isBuffer','Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20','utf8','push','Skill\x20file\x20size\x20is\x20invalid:\x20','Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20','validation','compare','test','trim','7779149LMvooF','Unsafe\x20Skill\x20file\x20path:\x20','Skill\x20file\x20sha256\x20is\x20invalid:\x20','split','5097990WfrJts','values','isFile','sort','Duplicate\x20Skill\x20file\x20path:\x20','startsWith','path','length','2662494ZiYNgN','2cSeyim','bytes','excludedFilePaths','set','isArray','string','replace','from','sha256','object','397581XZSnFb','4260708ypDIaQ','9205888jHiNVC','isSymbolicLink','toLowerCase','content','1678460hDhajC','isDirectory','Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20','isSafeInteger','name','has','Skill\x20file\x20path\x20must\x20be\x20text.','includes','size'];a137_0x49a0=function(){return _0x281b31;};return a137_0x49a0();}export function normalizeManifestFiles(_0x18d9e6){const _0x1975df=a137_0x1ba4;if(!Array[_0x1975df(0x111)](_0x18d9e6)||_0x18d9e6['length']===0x0)return[];const _0x278a3b=new Map();for(const _0x2e4e2e of _0x18d9e6){if(!_0x2e4e2e||typeof _0x2e4e2e!=='object'||typeof _0x2e4e2e[_0x1975df(0x10a)]!=='string')throw CliErrors[_0x1975df(0xfc)](_0x1975df(0x123));const _0x4d0f03=normalizeSkillRelativePath(_0x2e4e2e['path']);if(_0x278a3b[_0x1975df(0x122)](_0x4d0f03))throw CliErrors[_0x1975df(0xfc)](_0x1975df(0x108)+_0x4d0f03);if(!isSha256Hex(_0x2e4e2e[_0x1975df(0x115)]))throw CliErrors[_0x1975df(0xfc)](_0x1975df(0x102)+_0x4d0f03);if(!Number[_0x1975df(0x120)](_0x2e4e2e[_0x1975df(0x125)])||_0x2e4e2e['size']<0x0)throw CliErrors[_0x1975df(0xfc)](_0x1975df(0xfa)+_0x4d0f03);_0x278a3b[_0x1975df(0x110)](_0x4d0f03,{'path':_0x4d0f03,'sha256':_0x2e4e2e['sha256'][_0x1975df(0x11b)](),'size':_0x2e4e2e['size']});}return Array['from'](_0x278a3b[_0x1975df(0x105)]())[_0x1975df(0x107)](compareSkillFiles);}export function scanSkillDirectory(_0x5cd283,_0x522799={}){const _0x4b7b9a=a137_0x1ba4,_0x58105c=realpathSync(_0x5cd283),_0x22c655=canonicalExcludedFilePaths(_0x522799[_0x4b7b9a(0x10f)]),_0x5ebb86=[];function _0x51318c(_0x3de41f){const _0x31fced=_0x4b7b9a,_0x454304=readdirSync(_0x3de41f,{'withFileTypes':!![]})[_0x31fced(0x107)]((_0x49b39d,_0x37c248)=>_0x49b39d[_0x31fced(0x121)]['localeCompare'](_0x37c248[_0x31fced(0x121)]));for(const _0x2dbece of _0x454304){if(_0x2dbece[_0x31fced(0x11e)]()&&IGNORED_DIR_NAMES[_0x31fced(0x122)](_0x2dbece[_0x31fced(0x121)]))continue;if(IGNORED_FILE_NAMES[_0x31fced(0x122)](_0x2dbece['name']))continue;const _0x1507d3=resolve(_0x3de41f,_0x2dbece[_0x31fced(0x121)]);if(isExcludedFilePath(_0x1507d3,_0x22c655))continue;if(_0x2dbece[_0x31fced(0x11a)]())throw CliErrors[_0x31fced(0xfc)](_0x31fced(0x11f)+_0x1507d3);const _0x41c360=toPosixPath(relative(_0x58105c,_0x1507d3));if(_0x2dbece[_0x31fced(0x11e)]()){_0x51318c(_0x1507d3);continue;}if(!_0x2dbece[_0x31fced(0x106)]())continue;validateSkillRelativePath(_0x41c360);const _0x104d94=readFileSync(_0x1507d3);_0x5ebb86[_0x31fced(0xf9)]({'path':_0x41c360,'bytes':_0x104d94});}}return _0x51318c(_0x58105c),normalizeLocalFiles(_0x5ebb86);}function canonicalExcludedFilePaths(_0x42daff){const _0x4759a2=new Set();for(const _0x1457a8 of _0x42daff??[]){const _0x1c7c1b=resolve(_0x1457a8);_0x4759a2['add'](_0x1c7c1b);try{_0x4759a2['add'](realpathSync(_0x1c7c1b));}catch{}}return _0x4759a2;}function isExcludedFilePath(_0x449b22,_0xd3fa5e){const _0x40ecd5=a137_0x1ba4;if(_0xd3fa5e[_0x40ecd5(0x122)](_0x449b22))return!![];if(_0xd3fa5e['size']===0x0)return![];try{return _0xd3fa5e[_0x40ecd5(0x122)](realpathSync(_0x449b22));}catch{return![];}}export function compareSkillFiles(_0xd42598,_0x25a678){const _0x3f1943=a137_0x1ba4;if(_0xd42598['path']===SKILL_FILE)return _0x25a678[_0x3f1943(0x10a)]===SKILL_FILE?0x0:-0x1;if(_0x25a678[_0x3f1943(0x10a)]===SKILL_FILE)return 0x1;return Buffer[_0x3f1943(0xfd)](Buffer[_0x3f1943(0x114)](_0xd42598['path'],_0x3f1943(0xf8)),Buffer['from'](_0x25a678['path'],_0x3f1943(0xf8)));}export function normalizeSkillRelativePath(_0x3d946f){const _0xc4f42a=a137_0x1ba4,_0x2114d9=toPosixPath(_0x3d946f[_0xc4f42a(0xff)]());return validateSkillRelativePath(_0x2114d9),_0x2114d9;}export function validateSkillRelativePath(_0x3c2b91){const _0x1e33e1=a137_0x1ba4;if(!_0x3c2b91||_0x3c2b91[_0x1e33e1(0x109)]('/')||_0x3c2b91[_0x1e33e1(0x124)]('//'))throw CliErrors['validation']('Unsafe\x20Skill\x20file\x20path:\x20'+_0x3c2b91);for(const _0x2e5690 of _0x3c2b91[_0x1e33e1(0x103)]('/')){if(!_0x2e5690||_0x2e5690==='.'||_0x2e5690==='..')throw CliErrors[_0x1e33e1(0xfc)](_0x1e33e1(0x101)+_0x3c2b91);}}function a137_0x1ba4(_0x5477b2,_0x5f3b83){_0x5477b2=_0x5477b2-0xf6;const _0x49a0ef=a137_0x49a0();let _0x1ba40d=_0x49a0ef[_0x5477b2];return _0x1ba40d;}export function toPosixPath(_0x448d0c){const _0x427df5=a137_0x1ba4;return _0x448d0c[_0x427df5(0x113)](/\\/g,'/');}export function isSha256Hex(_0x3665ea){const _0x2d4b0c=a137_0x1ba4;return typeof _0x3665ea===_0x2d4b0c(0x112)&&/^[a-fA-F0-9]{64}$/[_0x2d4b0c(0xfe)](_0x3665ea);}
1
+ (function(_0x521489,_0x89995e){const _0x36ccef=a140_0x376a,_0x50549f=_0x521489();while(!![]){try{const _0x1ea150=parseInt(_0x36ccef(0xc0))/0x1+-parseInt(_0x36ccef(0xd5))/0x2+parseInt(_0x36ccef(0xea))/0x3*(-parseInt(_0x36ccef(0xd6))/0x4)+-parseInt(_0x36ccef(0xd2))/0x5*(parseInt(_0x36ccef(0xd3))/0x6)+-parseInt(_0x36ccef(0xe0))/0x7*(parseInt(_0x36ccef(0xc9))/0x8)+-parseInt(_0x36ccef(0xd8))/0x9+parseInt(_0x36ccef(0xc1))/0xa;if(_0x1ea150===_0x89995e)break;else _0x50549f['push'](_0x50549f['shift']());}catch(_0x2d25c3){_0x50549f['push'](_0x50549f['shift']());}}}(a140_0x579b,0xc93b1));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 a140_0x376a(_0x52908a,_0x1c5727){_0x52908a=_0x52908a-0xbd;const _0x579b7e=a140_0x579b();let _0x376a89=_0x579b7e[_0x52908a];return _0x376a89;}export function fileContent(_0x2d3293){const _0x2221f1=a140_0x376a;return _0x2d3293[_0x2221f1(0xe7)]??Buffer[_0x2221f1(0xe1)](_0x2d3293[_0x2221f1(0xbf)]??'','utf8');}export function fileText(_0x1bf141){return fileContent(_0x1bf141)['toString']('utf8');}export function normalizeLocalFiles(_0x8e0807){const _0x223cb1=a140_0x376a;if(!Array[_0x223cb1(0xde)](_0x8e0807)||_0x8e0807[_0x223cb1(0xdd)]===0x0)return[];const _0x163c8d=new Map();for(const _0x298dc9 of _0x8e0807){if(!_0x298dc9||typeof _0x298dc9!==_0x223cb1(0xc2)||typeof _0x298dc9[_0x223cb1(0xeb)]!==_0x223cb1(0xd7))throw CliErrors[_0x223cb1(0xcd)](_0x223cb1(0xe2));const _0x451064=normalizeSkillRelativePath(_0x298dc9[_0x223cb1(0xeb)]);if(_0x163c8d[_0x223cb1(0xdb)](_0x451064))throw CliErrors[_0x223cb1(0xcd)](_0x223cb1(0xc4)+_0x451064);if(_0x298dc9[_0x223cb1(0xe7)]!==undefined&&!Buffer[_0x223cb1(0xd0)](_0x298dc9['bytes']))throw CliErrors[_0x223cb1(0xcd)](_0x223cb1(0xbd)+_0x451064);if(_0x298dc9[_0x223cb1(0xe7)]===undefined&&typeof _0x298dc9['content']!==_0x223cb1(0xd7))throw CliErrors[_0x223cb1(0xcd)]('Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20'+_0x451064);const _0x30a5e=fileContent(_0x298dc9);_0x163c8d[_0x223cb1(0xc7)](_0x451064,{'path':_0x451064,'bytes':_0x30a5e});}return Array[_0x223cb1(0xe1)](_0x163c8d[_0x223cb1(0xe6)]())['sort'](compareSkillFiles);}function a140_0x579b(){const _0xac9a4=['validation','isSafeInteger','size','isBuffer','isFile','2256775mtscWN','12Yggkah','name','591282KghWMa','4UQYbWN','string','8170578icqEMo','isSymbolicLink','Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20','has','replace','length','isArray','push','2195606qkIDVU','from','Skill\x20file\x20path\x20must\x20be\x20text.','Unsafe\x20Skill\x20file\x20path:\x20','utf8','compare','values','bytes','Skill\x20file\x20sha256\x20is\x20invalid:\x20','sha256','126363IcfPvr','path','Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20','test','content','1491820CGlxGB','27353670LTTlnf','object','isDirectory','Duplicate\x20Skill\x20file\x20path:\x20','toLowerCase','split','set','Skill\x20file\x20size\x20is\x20invalid:\x20','32yMfDXE','sort','add','startsWith'];a140_0x579b=function(){return _0xac9a4;};return a140_0x579b();}export function normalizeManifestFiles(_0x14af5c){const _0x45c6b5=a140_0x376a;if(!Array[_0x45c6b5(0xde)](_0x14af5c)||_0x14af5c[_0x45c6b5(0xdd)]===0x0)return[];const _0x9e7947=new Map();for(const _0x31556b of _0x14af5c){if(!_0x31556b||typeof _0x31556b!==_0x45c6b5(0xc2)||typeof _0x31556b[_0x45c6b5(0xeb)]!==_0x45c6b5(0xd7))throw CliErrors[_0x45c6b5(0xcd)](_0x45c6b5(0xe2));const _0x2067a2=normalizeSkillRelativePath(_0x31556b[_0x45c6b5(0xeb)]);if(_0x9e7947[_0x45c6b5(0xdb)](_0x2067a2))throw CliErrors['validation'](_0x45c6b5(0xc4)+_0x2067a2);if(!isSha256Hex(_0x31556b[_0x45c6b5(0xe9)]))throw CliErrors[_0x45c6b5(0xcd)](_0x45c6b5(0xe8)+_0x2067a2);if(!Number[_0x45c6b5(0xce)](_0x31556b[_0x45c6b5(0xcf)])||_0x31556b[_0x45c6b5(0xcf)]<0x0)throw CliErrors['validation'](_0x45c6b5(0xc8)+_0x2067a2);_0x9e7947[_0x45c6b5(0xc7)](_0x2067a2,{'path':_0x2067a2,'sha256':_0x31556b[_0x45c6b5(0xe9)][_0x45c6b5(0xc5)](),'size':_0x31556b[_0x45c6b5(0xcf)]});}return Array[_0x45c6b5(0xe1)](_0x9e7947[_0x45c6b5(0xe6)]())[_0x45c6b5(0xca)](compareSkillFiles);}export function scanSkillDirectory(_0x5c1736,_0x17f24b={}){const _0x407380=realpathSync(_0x5c1736),_0x46f99e=canonicalExcludedFilePaths(_0x17f24b['excludedFilePaths']),_0x56269f=[];function _0x1dd5b5(_0x42dc0d){const _0x3be7ee=a140_0x376a,_0x41ab7f=readdirSync(_0x42dc0d,{'withFileTypes':!![]})[_0x3be7ee(0xca)]((_0x5cd767,_0x237a9e)=>_0x5cd767[_0x3be7ee(0xd4)]['localeCompare'](_0x237a9e[_0x3be7ee(0xd4)]));for(const _0x30f40d of _0x41ab7f){if(_0x30f40d[_0x3be7ee(0xc3)]()&&IGNORED_DIR_NAMES[_0x3be7ee(0xdb)](_0x30f40d['name']))continue;if(IGNORED_FILE_NAMES[_0x3be7ee(0xdb)](_0x30f40d[_0x3be7ee(0xd4)]))continue;const _0x3366c5=resolve(_0x42dc0d,_0x30f40d[_0x3be7ee(0xd4)]);if(isExcludedFilePath(_0x3366c5,_0x46f99e))continue;if(_0x30f40d[_0x3be7ee(0xd9)]())throw CliErrors[_0x3be7ee(0xcd)](_0x3be7ee(0xda)+_0x3366c5);const _0x4e6e2c=toPosixPath(relative(_0x407380,_0x3366c5));if(_0x30f40d[_0x3be7ee(0xc3)]()){_0x1dd5b5(_0x3366c5);continue;}if(!_0x30f40d[_0x3be7ee(0xd1)]())continue;validateSkillRelativePath(_0x4e6e2c);const _0x1cc930=readFileSync(_0x3366c5);_0x56269f[_0x3be7ee(0xdf)]({'path':_0x4e6e2c,'bytes':_0x1cc930});}}return _0x1dd5b5(_0x407380),normalizeLocalFiles(_0x56269f);}function canonicalExcludedFilePaths(_0x396ad8){const _0x1a51b9=a140_0x376a,_0x2c65e8=new Set();for(const _0x431d4e of _0x396ad8??[]){const _0x4836aa=resolve(_0x431d4e);_0x2c65e8[_0x1a51b9(0xcb)](_0x4836aa);try{_0x2c65e8[_0x1a51b9(0xcb)](realpathSync(_0x4836aa));}catch{}}return _0x2c65e8;}function isExcludedFilePath(_0x5ce9a5,_0x95151){const _0x186bdf=a140_0x376a;if(_0x95151[_0x186bdf(0xdb)](_0x5ce9a5))return!![];if(_0x95151['size']===0x0)return![];try{return _0x95151['has'](realpathSync(_0x5ce9a5));}catch{return![];}}export function compareSkillFiles(_0x296494,_0x2dfd04){const _0x3ce51c=a140_0x376a;if(_0x296494[_0x3ce51c(0xeb)]===SKILL_FILE)return _0x2dfd04['path']===SKILL_FILE?0x0:-0x1;if(_0x2dfd04['path']===SKILL_FILE)return 0x1;return Buffer[_0x3ce51c(0xe5)](Buffer[_0x3ce51c(0xe1)](_0x296494['path'],_0x3ce51c(0xe4)),Buffer['from'](_0x2dfd04['path'],_0x3ce51c(0xe4)));}export function normalizeSkillRelativePath(_0x2c99ab){const _0x113e57=toPosixPath(_0x2c99ab['trim']());return validateSkillRelativePath(_0x113e57),_0x113e57;}export function validateSkillRelativePath(_0x4d1dfd){const _0x26cc33=a140_0x376a;if(!_0x4d1dfd||_0x4d1dfd[_0x26cc33(0xcc)]('/')||_0x4d1dfd['includes']('//'))throw CliErrors[_0x26cc33(0xcd)](_0x26cc33(0xe3)+_0x4d1dfd);for(const _0x30dd33 of _0x4d1dfd[_0x26cc33(0xc6)]('/')){if(!_0x30dd33||_0x30dd33==='.'||_0x30dd33==='..')throw CliErrors['validation'](_0x26cc33(0xe3)+_0x4d1dfd);}}export function toPosixPath(_0xee05c){const _0xd32c09=a140_0x376a;return _0xee05c[_0xd32c09(0xdc)](/\\/g,'/');}export function isSha256Hex(_0x28c995){const _0x1687b2=a140_0x376a;return typeof _0x28c995===_0x1687b2(0xd7)&&/^[a-fA-F0-9]{64}$/[_0x1687b2(0xbe)](_0x28c995);}
@@ -1 +1 @@
1
- (function(_0x47d8a5,_0x7f3b0c){const _0x2cab07=a138_0x2abd,_0x58cbeb=_0x47d8a5();while(!![]){try{const _0xba0282=parseInt(_0x2cab07(0xbe))/0x1*(-parseInt(_0x2cab07(0xc3))/0x2)+parseInt(_0x2cab07(0xcd))/0x3*(parseInt(_0x2cab07(0xd0))/0x4)+-parseInt(_0x2cab07(0xad))/0x5*(parseInt(_0x2cab07(0xcc))/0x6)+parseInt(_0x2cab07(0xbf))/0x7*(-parseInt(_0x2cab07(0xd6))/0x8)+parseInt(_0x2cab07(0xd2))/0x9+parseInt(_0x2cab07(0xcb))/0xa+parseInt(_0x2cab07(0xe3))/0xb*(-parseInt(_0x2cab07(0xbd))/0xc);if(_0xba0282===_0x7f3b0c)break;else _0x58cbeb['push'](_0x58cbeb['shift']());}catch(_0x12b458){_0x58cbeb['push'](_0x58cbeb['shift']());}}}(a138_0x2454,0xa72ed));function a138_0x2abd(_0x523774,_0x3e85d1){_0x523774=_0x523774-0xa6;const _0x2454de=a138_0x2454();let _0x2abd0f=_0x2454de[_0x523774];return _0x2abd0f;}import{existsSync,lstatSync,mkdirSync,readFileSync,rmSync}from'node:fs';import{dirname,resolve}from'node:path';import{isCollection,isMap,isNode,parseDocument,visit}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{resolveManagedFilePath,writeBytesAtomic,writeJsonAtomic}from'./fs-utils.js';import{bufferSha256,contentHash,fileHash}from'./hashing.js';import{fileContent,fileText,normalizeLocalFiles}from'./local-files.js';function a138_0x2454(){const _0x4cb262=['skillName','has','env','schemaVersion','path','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.','filter','slice','---','contents','displayName:\x20','3498exQUkf','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','Managed\x20file\x20was\x20removed\x20locally:\x20','paths','length','errors','Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20','example','3615505ayztjt','appCode','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','packageBytes','set','isFile','validation','entries','scope','test','toString','find','map','keys','version','11064OqWhjQ','16vPxSmo','110726SwgwaO','utf8','description:\x20','match','81580rWXHXu','status','pulledAt','contentHash','displayName','\x0a---\x0a\x0a','name:\x20','accessKey','4997490qTIuuc','6itLGVJ','36WYdVNa','.\x20Changed\x20file:\x20','force','427912osiCkI','fileHashes','6270993OzhHax','join','replace','description','64JHBvMm','trim'];a138_0x2454=function(){return _0x4cb262;};return a138_0x2454();}import{buildMetadata,readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillDir}from'./paths.js';import{extractDownloadedPackage,requirePackageBytes}from'./zip-package.js';export function materializeRuntimeSkill(_0x3ef524,_0x2f909b,_0x24e00a){const _0x1603d1=a138_0x2abd,_0x1a84c7=requireSkillCode(_0x3ef524),_0x5c8249=requirePackageBytes(_0x1a84c7,_0x24e00a[_0x1603d1(0xb1)]),_0x17371c=extractDownloadedPackage(_0x5c8249),_0x1a8ec4=_0x17371c[_0x1603d1(0xb9)](_0x3390d8=>_0x3390d8[_0x1603d1(0xdc)]===SKILL_FILE);if(!_0x1a8ec4)throw CliErrors[_0x1603d1(0xb4)]('Runtime\x20Skill\x20package\x20is\x20missing\x20'+SKILL_FILE+':\x20'+_0x1a84c7);const _0x5cf3bd=withMaterializedSkillFrontmatter(_0x17371c,_0x3ef524,_0x1a84c7),_0x23a867=_0x5cf3bd[_0x1603d1(0xb9)](_0x141f35=>_0x141f35['path']===SKILL_FILE),_0x113df9=fileText(_0x23a867),_0x4cbdcb=getRuntimeSkillDir(_0x24e00a[_0x1603d1(0xda)],_0x24e00a[_0x1603d1(0xca)],_0x24e00a['appCode'],_0x2f909b,_0x1a84c7,_0x24e00a[_0x1603d1(0xa8)]),_0x1702bc=resolve(_0x4cbdcb,SKILL_FILE),_0x523e48=resolve(_0x4cbdcb,METADATA_FILE),_0x3c7f80=contentHash(_0x113df9),_0x20842e=readMetadataIfPresent(_0x523e48)?.['fileHashes'];ensurePulledFilesCanBeOverwritten(_0x4cbdcb,_0x523e48,_0x5cf3bd,_0x24e00a[_0x1603d1(0xcf)]===!![]),mkdirSync(_0x4cbdcb,{'recursive':!![],'mode':0x1c0});const _0x5389ed=existsSync(_0x1702bc)?readFileSync(_0x1702bc,'utf8'):undefined;return materializeFiles(_0x4cbdcb,_0x5cf3bd),removeStaleManagedFiles(_0x4cbdcb,_0x20842e,_0x5cf3bd),writeJsonAtomic(_0x523e48,buildMetadata(_0x3ef524,_0x2f909b,_0x24e00a['appCode'],_0x3c7f80,_0x24e00a[_0x1603d1(0xc5)],_0x5cf3bd,_0x5c8249)),{'skill':_0x3ef524,'scope':_0x2f909b,'dir':_0x4cbdcb,'skillMdPath':_0x1702bc,'metadataPath':_0x523e48,'contentHash':_0x3c7f80,'changed':_0x5389ed!==_0x113df9};}export function reuseMaterializedRuntimeSkill(_0x3b7518,_0x23c4ca,_0x225df8){const _0x442e85=a138_0x2abd,_0x57a229=_0x3b7518[_0x442e85(0xbc)]?.[_0x442e85(0xd7)]();if(!_0x57a229)return undefined;const _0x2e0ee5=requireSkillCode(_0x3b7518),_0x334736=getRuntimeSkillDir(_0x225df8['env'],_0x225df8[_0x442e85(0xca)],_0x225df8[_0x442e85(0xae)],_0x23c4ca,_0x2e0ee5,_0x225df8[_0x442e85(0xa8)]),_0x1148db=resolve(_0x334736,SKILL_FILE),_0x5735d1=resolve(_0x334736,METADATA_FILE),_0x1bbe78=readMetadataIfPresent(_0x5735d1);if(!_0x1bbe78||_0x1bbe78[_0x442e85(0xdb)]!==0x2||_0x1bbe78[_0x442e85(0xae)]!==_0x225df8[_0x442e85(0xae)]||_0x1bbe78[_0x442e85(0xb6)]!==_0x23c4ca||_0x1bbe78['skillCode']!==_0x2e0ee5||_0x1bbe78[_0x442e85(0xbc)]!==_0x57a229||_0x1bbe78['id']!==_0x3b7518['id']||_0x1bbe78[_0x442e85(0xd8)]!==_0x3b7518['skillName']||_0x1bbe78[_0x442e85(0xd5)]!==_0x3b7518[_0x442e85(0xd5)]||_0x1bbe78[_0x442e85(0xac)]!==_0x3b7518['example']||_0x1bbe78['status']!==_0x3b7518[_0x442e85(0xc4)]||!_0x1bbe78[_0x442e85(0xc6)]||!_0x1bbe78['fileHashes']||!Object['hasOwn'](_0x1bbe78[_0x442e85(0xd1)],SKILL_FILE))return undefined;for(const [_0x3d3122,_0x2ca1b1]of Object[_0x442e85(0xb5)](_0x1bbe78[_0x442e85(0xd1)])){if(!/^[a-f0-9]{64}$/[_0x442e85(0xb7)](_0x2ca1b1))return undefined;const _0x5f0c58=resolveManagedFilePath(_0x334736,_0x3d3122);if(!existsSync(_0x5f0c58)||!lstatSync(_0x5f0c58)[_0x442e85(0xb3)]())return undefined;if(bufferSha256(readFileSync(_0x5f0c58))!==_0x2ca1b1)return undefined;}return{'skill':_0x3b7518,'scope':_0x23c4ca,'dir':_0x334736,'skillMdPath':_0x1148db,'metadataPath':_0x5735d1,'contentHash':_0x1bbe78['contentHash'],'changed':![]};}function withMaterializedSkillFrontmatter(_0x4e5dc4,_0x4c7aac,_0x3fd63c){const _0x8cf341=a138_0x2abd,_0x51d9f0=skillDisplayName(_0x4c7aac,_0x3fd63c),_0x25ccfb=_0x4c7aac[_0x8cf341(0xd5)]?.['trim']()||_0x51d9f0||_0x3fd63c;return normalizeLocalFiles(_0x4e5dc4)[_0x8cf341(0xba)](_0x18d560=>{const _0x1f38a6=_0x8cf341,_0x139760=fileText(_0x18d560);if(_0x18d560['path']!==SKILL_FILE)return _0x18d560;if(hasYamlFrontmatter(_0x139760))return{'path':_0x18d560[_0x1f38a6(0xdc)],'content':withSyncedDisplayName(_0x139760,_0x51d9f0)};return{'path':_0x18d560[_0x1f38a6(0xdc)],'content':prependSkillFrontmatter(_0x139760,{'name':_0x3fd63c,'displayName':_0x51d9f0,'description':_0x25ccfb})};});}function hasYamlFrontmatter(_0x3e87cb){const _0x3af81e=a138_0x2abd;return/^\uFEFF?---\s*\r?\n/[_0x3af81e(0xb7)](_0x3e87cb);}function prependSkillFrontmatter(_0xdfccee,_0x4e85cb){const _0x52d3b0=a138_0x2abd,_0x32e276=_0xdfccee[_0x52d3b0(0xd4)](/^\uFEFF/,'');return[_0x52d3b0(0xe0),_0x52d3b0(0xc9)+yamlString(_0x4e85cb['name']),_0x4e85cb[_0x52d3b0(0xc7)]?_0x52d3b0(0xe2)+yamlString(_0x4e85cb[_0x52d3b0(0xc7)]):undefined,_0x52d3b0(0xc1)+yamlString(_0x4e85cb['description']),'---','',_0x32e276][_0x52d3b0(0xde)](_0x5756e7=>_0x5756e7!==undefined)[_0x52d3b0(0xd3)]('\x0a');}function yamlString(_0x366087){const _0x14bb24=a138_0x2abd;return JSON['stringify'](_0x366087[_0x14bb24(0xd4)](/\r/g,'')[_0x14bb24(0xd7)]());}function skillDisplayName(_0x354059,_0x1448b3){const _0x465b7f=a138_0x2abd,_0x2e026c=_0x354059[_0x465b7f(0xd8)]?.['trim']();return _0x2e026c||_0x1448b3;}function withSyncedDisplayName(_0x328a07,_0x5afd68){const _0xbc3bec=a138_0x2abd,_0x5b0170=_0x328a07[_0xbc3bec(0xc2)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x5b0170)return _0x328a07;const _0x324620=_0x5b0170[0x1]??'',_0x34d9bf=_0x5b0170[0x2]??'',_0x2e467f=parseDocument(_0x34d9bf);if(_0x2e467f[_0xbc3bec(0xaa)][_0xbc3bec(0xa9)]>0x0||!isMap(_0x2e467f[_0xbc3bec(0xe1)]))return _0x328a07;if(_0x5afd68)_0x2e467f[_0xbc3bec(0xb2)]('displayName',_0x5afd68);else{if(_0x2e467f[_0xbc3bec(0xd9)](_0xbc3bec(0xc7)))_0x2e467f['delete'](_0xbc3bec(0xc7));else return _0x328a07;}forceBlockCollections(_0x2e467f[_0xbc3bec(0xe1)]);const _0x5e93cd=_0x2e467f[_0xbc3bec(0xb8)]({'lineWidth':0x0})['trimEnd'](),_0x49f25b=_0x328a07[_0xbc3bec(0xdf)](_0x5b0170[0x0]['length'])[_0xbc3bec(0xd4)](/^\r?\n/,'');return _0x324620+'---\x0a'+_0x5e93cd+_0xbc3bec(0xc8)+_0x49f25b;}function forceBlockCollections(_0x473173){if(!isNode(_0x473173))return;visit(_0x473173,(_0x4dedbd,_0x34fdab)=>{isCollection(_0x34fdab)&&(_0x34fdab['flow']=![]);});}function ensurePulledFilesCanBeOverwritten(_0x53c6be,_0x5d78c0,_0x741fd8,_0x211719){const _0x5614f4=a138_0x2abd;if(_0x211719||!existsSync(_0x5d78c0))return;const _0x2409b1=readMetadataIfPresent(_0x5d78c0);if(!_0x2409b1)return;const _0x13e190=_0x2409b1[_0x5614f4(0xd1)]&&Object[_0x5614f4(0xbb)](_0x2409b1[_0x5614f4(0xd1)])[_0x5614f4(0xa9)]>0x0?_0x2409b1[_0x5614f4(0xd1)]:undefined;if(_0x13e190)for(const [_0x1a1604,_0x4f82e3]of Object[_0x5614f4(0xb5)](_0x13e190)){const _0x443d4c=resolveManagedFilePath(_0x53c6be,_0x1a1604);if(!existsSync(_0x443d4c))throw CliErrors[_0x5614f4(0xb4)](_0x5614f4(0xaf)+_0x53c6be,_0x5614f4(0xa7)+_0x1a1604);const _0x51b9f0=lstatSync(_0x443d4c);if(!_0x51b9f0[_0x5614f4(0xb3)]())throw CliErrors[_0x5614f4(0xb4)](_0x5614f4(0xaf)+_0x53c6be,_0x5614f4(0xab)+_0x1a1604);const _0x205ea1=bufferSha256(readFileSync(_0x443d4c));if(_0x205ea1!==_0x4f82e3)throw CliErrors[_0x5614f4(0xb4)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x53c6be+_0x5614f4(0xce)+_0x1a1604,_0x5614f4(0xb0)+_0x1a1604);}else{const _0x1b3965=resolve(_0x53c6be,SKILL_FILE);if(existsSync(_0x1b3965)&&_0x2409b1[_0x5614f4(0xc6)]){const _0x2d37df=contentHash(readFileSync(_0x1b3965,_0x5614f4(0xc0)));if(_0x2d37df!==_0x2409b1[_0x5614f4(0xc6)])throw CliErrors[_0x5614f4(0xb4)]('Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20'+_0x1b3965,_0x5614f4(0xdd));}}for(const _0x8841de of normalizeLocalFiles(_0x741fd8)){if(_0x13e190?.[_0x8841de[_0x5614f4(0xdc)]])continue;if(!_0x13e190&&_0x8841de['path']===SKILL_FILE)continue;const _0x5a5b2a=resolveManagedFilePath(_0x53c6be,_0x8841de['path']);if(!existsSync(_0x5a5b2a))continue;const _0x4e02ee=lstatSync(_0x5a5b2a);if(!_0x4e02ee[_0x5614f4(0xb3)]())throw CliErrors[_0x5614f4(0xb4)](_0x5614f4(0xaf)+_0x53c6be,_0x5614f4(0xa6)+_0x8841de[_0x5614f4(0xdc)]);const _0x2369f6=bufferSha256(readFileSync(_0x5a5b2a));if(_0x2369f6!==fileHash(_0x8841de))throw CliErrors['validation'](_0x5614f4(0xaf)+_0x53c6be,'Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20'+_0x8841de[_0x5614f4(0xdc)]);}}function materializeFiles(_0x3fa070,_0x14f1fc){const _0xa95fe7=a138_0x2abd;for(const _0xecdc53 of normalizeLocalFiles(_0x14f1fc)){const _0x1d0469=resolveManagedFilePath(_0x3fa070,_0xecdc53[_0xa95fe7(0xdc)]);mkdirSync(dirname(_0x1d0469),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x1d0469,fileContent(_0xecdc53),0x180);}}function removeStaleManagedFiles(_0x10c635,_0x16aeb4,_0x3cd6db){const _0x51682d=a138_0x2abd;if(!_0x16aeb4)return;const _0x3ed07a=new Set(normalizeLocalFiles(_0x3cd6db)[_0x51682d(0xba)](_0x5e270a=>_0x5e270a[_0x51682d(0xdc)]));for(const _0x3949c4 of Object['keys'](_0x16aeb4)){if(_0x3ed07a[_0x51682d(0xd9)](_0x3949c4))continue;const _0x166b2a=resolveManagedFilePath(_0x10c635,_0x3949c4);existsSync(_0x166b2a)&&lstatSync(_0x166b2a)['isFile']()&&rmSync(_0x166b2a,{'force':!![]});}}
1
+ (function(_0x23c458,_0x1d0bfa){const _0x17d2c8=a141_0x570a,_0x29c9db=_0x23c458();while(!![]){try{const _0x557b0f=parseInt(_0x17d2c8(0x147))/0x1*(parseInt(_0x17d2c8(0x178))/0x2)+parseInt(_0x17d2c8(0x174))/0x3+parseInt(_0x17d2c8(0x156))/0x4+-parseInt(_0x17d2c8(0x158))/0x5*(parseInt(_0x17d2c8(0x176))/0x6)+-parseInt(_0x17d2c8(0x15e))/0x7*(-parseInt(_0x17d2c8(0x14d))/0x8)+parseInt(_0x17d2c8(0x164))/0x9+-parseInt(_0x17d2c8(0x15b))/0xa;if(_0x557b0f===_0x1d0bfa)break;else _0x29c9db['push'](_0x29c9db['shift']());}catch(_0x4594cf){_0x29c9db['push'](_0x29c9db['shift']());}}}(a141_0x5acd,0x54aac));import{existsSync,lstatSync,mkdirSync,readFileSync,rmSync}from'node:fs';import{dirname,resolve}from'node:path';import{isCollection,isMap,isNode,parseDocument,visit}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';function a141_0x570a(_0x1b8ebe,_0x51ff2a){_0x1b8ebe=_0x1b8ebe-0x141;const _0x5acd9d=a141_0x5acd();let _0x570a65=_0x5acd9d[_0x1b8ebe];return _0x570a65;}import{resolveManagedFilePath,writeBytesAtomic,writeJsonAtomic}from'./fs-utils.js';import{bufferSha256,contentHash,fileHash}from'./hashing.js';import{fileContent,fileText,normalizeLocalFiles}from'./local-files.js';import{buildMetadata,readMetadataIfPresent,requireSkillCode}from'./metadata.js';function a141_0x5acd(){const _0x1817b9=['---\x0a','force','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','has','1WyKaJB','pulledAt','find','contents','set','name:\x20','2640eIKpXi','skillName','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.','match','version','status','map','filter','path','67892uOZBxi','keys','5sKkCHY','isFile','entries','15587630XmEMgl','join','displayName:\x20','12635gWwSdw','validation','packageBytes','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','trim','Managed\x20file\x20was\x20removed\x20locally:\x20','4239396kQqIPs','---','\x0a---\x0a\x0a','test','scope','displayName','length','description','slice','fileHashes','skillCode','Runtime\x20Skill\x20package\x20is\x20missing\x20','Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20','delete','errors','stringify','1894557DCNboh','accessKey','2265204GjyjgV','env','1135814asfepg','toString','contentHash','Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20','appCode','replace','example','paths','description:\x20','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20'];a141_0x5acd=function(){return _0x1817b9;};return a141_0x5acd();}import{getRuntimeSkillDir}from'./paths.js';import{extractDownloadedPackage,requirePackageBytes}from'./zip-package.js';export function materializeRuntimeSkill(_0x2297bf,_0x59df55,_0x3df78e){const _0x3e92fc=a141_0x570a,_0x56c08e=requireSkillCode(_0x2297bf),_0x3d32a6=requirePackageBytes(_0x56c08e,_0x3df78e[_0x3e92fc(0x160)]),_0x39f8bb=extractDownloadedPackage(_0x3d32a6),_0x49fba9=_0x39f8bb['find'](_0x10800c=>_0x10800c[_0x3e92fc(0x155)]===SKILL_FILE);if(!_0x49fba9)throw CliErrors[_0x3e92fc(0x15f)](_0x3e92fc(0x16f)+SKILL_FILE+':\x20'+_0x56c08e);const _0x1700ea=withMaterializedSkillFrontmatter(_0x39f8bb,_0x2297bf,_0x56c08e),_0x404205=_0x1700ea[_0x3e92fc(0x149)](_0x4d47ff=>_0x4d47ff[_0x3e92fc(0x155)]===SKILL_FILE),_0x50199f=fileText(_0x404205),_0x39668b=getRuntimeSkillDir(_0x3df78e[_0x3e92fc(0x177)],_0x3df78e[_0x3e92fc(0x175)],_0x3df78e[_0x3e92fc(0x17c)],_0x59df55,_0x56c08e,_0x3df78e[_0x3e92fc(0x17f)]),_0x1cbab7=resolve(_0x39668b,SKILL_FILE),_0x32404b=resolve(_0x39668b,METADATA_FILE),_0x195d69=contentHash(_0x50199f),_0x5182c2=readMetadataIfPresent(_0x32404b)?.[_0x3e92fc(0x16d)];ensurePulledFilesCanBeOverwritten(_0x39668b,_0x32404b,_0x1700ea,_0x3df78e[_0x3e92fc(0x144)]===!![]),mkdirSync(_0x39668b,{'recursive':!![],'mode':0x1c0});const _0x5588a8=existsSync(_0x1cbab7)?readFileSync(_0x1cbab7,'utf8'):undefined;return materializeFiles(_0x39668b,_0x1700ea),removeStaleManagedFiles(_0x39668b,_0x5182c2,_0x1700ea),writeJsonAtomic(_0x32404b,buildMetadata(_0x2297bf,_0x59df55,_0x3df78e[_0x3e92fc(0x17c)],_0x195d69,_0x3df78e[_0x3e92fc(0x148)],_0x1700ea,_0x3d32a6)),{'skill':_0x2297bf,'scope':_0x59df55,'dir':_0x39668b,'skillMdPath':_0x1cbab7,'metadataPath':_0x32404b,'contentHash':_0x195d69,'changed':_0x5588a8!==_0x50199f};}export function reuseMaterializedRuntimeSkill(_0x56c9fd,_0x30def2,_0x98c87){const _0x86a0cd=a141_0x570a,_0x475a17=_0x56c9fd[_0x86a0cd(0x151)]?.[_0x86a0cd(0x162)]();if(!_0x475a17)return undefined;const _0x532e48=requireSkillCode(_0x56c9fd),_0x513af4=getRuntimeSkillDir(_0x98c87[_0x86a0cd(0x177)],_0x98c87[_0x86a0cd(0x175)],_0x98c87['appCode'],_0x30def2,_0x532e48,_0x98c87[_0x86a0cd(0x17f)]),_0x4bc365=resolve(_0x513af4,SKILL_FILE),_0x318c6f=resolve(_0x513af4,METADATA_FILE),_0x4efabf=readMetadataIfPresent(_0x318c6f);if(!_0x4efabf||_0x4efabf['schemaVersion']!==0x2||_0x4efabf[_0x86a0cd(0x17c)]!==_0x98c87[_0x86a0cd(0x17c)]||_0x4efabf[_0x86a0cd(0x168)]!==_0x30def2||_0x4efabf[_0x86a0cd(0x16e)]!==_0x532e48||_0x4efabf[_0x86a0cd(0x151)]!==_0x475a17||_0x4efabf['id']!==_0x56c9fd['id']||_0x4efabf[_0x86a0cd(0x14e)]!==_0x56c9fd['skillName']||_0x4efabf[_0x86a0cd(0x16b)]!==_0x56c9fd[_0x86a0cd(0x16b)]||_0x4efabf[_0x86a0cd(0x17e)]!==_0x56c9fd[_0x86a0cd(0x17e)]||_0x4efabf[_0x86a0cd(0x152)]!==_0x56c9fd['status']||!_0x4efabf[_0x86a0cd(0x17a)]||!_0x4efabf['fileHashes']||!Object['hasOwn'](_0x4efabf['fileHashes'],SKILL_FILE))return undefined;for(const [_0xf3bb45,_0x5cac72]of Object[_0x86a0cd(0x15a)](_0x4efabf[_0x86a0cd(0x16d)])){if(!/^[a-f0-9]{64}$/[_0x86a0cd(0x167)](_0x5cac72))return undefined;const _0x926ac9=resolveManagedFilePath(_0x513af4,_0xf3bb45);if(!existsSync(_0x926ac9)||!lstatSync(_0x926ac9)[_0x86a0cd(0x159)]())return undefined;if(bufferSha256(readFileSync(_0x926ac9))!==_0x5cac72)return undefined;}return{'skill':_0x56c9fd,'scope':_0x30def2,'dir':_0x513af4,'skillMdPath':_0x4bc365,'metadataPath':_0x318c6f,'contentHash':_0x4efabf['contentHash'],'changed':![]};}function withMaterializedSkillFrontmatter(_0xc563a5,_0x17f7e0,_0x58caba){const _0x598a9e=skillDisplayName(_0x17f7e0,_0x58caba),_0xa3f7b2=_0x17f7e0['description']?.['trim']()||_0x598a9e||_0x58caba;return normalizeLocalFiles(_0xc563a5)['map'](_0x99003a=>{const _0x915570=a141_0x570a,_0x251099=fileText(_0x99003a);if(_0x99003a['path']!==SKILL_FILE)return _0x99003a;if(hasYamlFrontmatter(_0x251099))return{'path':_0x99003a[_0x915570(0x155)],'content':withSyncedDisplayName(_0x251099,_0x598a9e)};return{'path':_0x99003a[_0x915570(0x155)],'content':prependSkillFrontmatter(_0x251099,{'name':_0x58caba,'displayName':_0x598a9e,'description':_0xa3f7b2})};});}function hasYamlFrontmatter(_0x1056a3){const _0xdc4b02=a141_0x570a;return/^\uFEFF?---\s*\r?\n/[_0xdc4b02(0x167)](_0x1056a3);}function prependSkillFrontmatter(_0x24fe96,_0x203d66){const _0x30f481=a141_0x570a,_0x1555f9=_0x24fe96['replace'](/^\uFEFF/,'');return[_0x30f481(0x165),_0x30f481(0x14c)+yamlString(_0x203d66['name']),_0x203d66[_0x30f481(0x169)]?_0x30f481(0x15d)+yamlString(_0x203d66['displayName']):undefined,_0x30f481(0x141)+yamlString(_0x203d66['description']),'---','',_0x1555f9][_0x30f481(0x154)](_0x4929a2=>_0x4929a2!==undefined)[_0x30f481(0x15c)]('\x0a');}function yamlString(_0xc7b080){const _0x140b2e=a141_0x570a;return JSON[_0x140b2e(0x173)](_0xc7b080['replace'](/\r/g,'')[_0x140b2e(0x162)]());}function skillDisplayName(_0x9d8fdb,_0x22e8a2){const _0x4fd79e=a141_0x570a,_0x57b039=_0x9d8fdb[_0x4fd79e(0x14e)]?.[_0x4fd79e(0x162)]();return _0x57b039||_0x22e8a2;}function withSyncedDisplayName(_0x1b4e25,_0xd664be){const _0x3d08a6=a141_0x570a,_0x2c9707=_0x1b4e25[_0x3d08a6(0x150)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x2c9707)return _0x1b4e25;const _0x2d772f=_0x2c9707[0x1]??'',_0x47784e=_0x2c9707[0x2]??'',_0x4d67b2=parseDocument(_0x47784e);if(_0x4d67b2[_0x3d08a6(0x172)]['length']>0x0||!isMap(_0x4d67b2[_0x3d08a6(0x14a)]))return _0x1b4e25;if(_0xd664be)_0x4d67b2[_0x3d08a6(0x14b)](_0x3d08a6(0x169),_0xd664be);else{if(_0x4d67b2[_0x3d08a6(0x146)](_0x3d08a6(0x169)))_0x4d67b2[_0x3d08a6(0x171)](_0x3d08a6(0x169));else return _0x1b4e25;}forceBlockCollections(_0x4d67b2['contents']);const _0x15e322=_0x4d67b2[_0x3d08a6(0x179)]({'lineWidth':0x0})['trimEnd'](),_0xfc0a30=_0x1b4e25[_0x3d08a6(0x16c)](_0x2c9707[0x0][_0x3d08a6(0x16a)])[_0x3d08a6(0x17d)](/^\r?\n/,'');return _0x2d772f+_0x3d08a6(0x143)+_0x15e322+_0x3d08a6(0x166)+_0xfc0a30;}function forceBlockCollections(_0x1483b5){if(!isNode(_0x1483b5))return;visit(_0x1483b5,(_0x4ae37c,_0x26e9ba)=>{isCollection(_0x26e9ba)&&(_0x26e9ba['flow']=![]);});}function ensurePulledFilesCanBeOverwritten(_0x28e211,_0x39e99f,_0x2bc6c3,_0x2deb60){const _0x21bcbf=a141_0x570a;if(_0x2deb60||!existsSync(_0x39e99f))return;const _0x80a5ae=readMetadataIfPresent(_0x39e99f);if(!_0x80a5ae)return;const _0x460baa=_0x80a5ae[_0x21bcbf(0x16d)]&&Object[_0x21bcbf(0x157)](_0x80a5ae[_0x21bcbf(0x16d)])['length']>0x0?_0x80a5ae['fileHashes']:undefined;if(_0x460baa)for(const [_0x5023fa,_0x392403]of Object[_0x21bcbf(0x15a)](_0x460baa)){const _0x3eb133=resolveManagedFilePath(_0x28e211,_0x5023fa);if(!existsSync(_0x3eb133))throw CliErrors[_0x21bcbf(0x15f)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x28e211,_0x21bcbf(0x163)+_0x5023fa);const _0x39f0d8=lstatSync(_0x3eb133);if(!_0x39f0d8[_0x21bcbf(0x159)]())throw CliErrors[_0x21bcbf(0x15f)](_0x21bcbf(0x161)+_0x28e211,_0x21bcbf(0x17b)+_0x5023fa);const _0x45366e=bufferSha256(readFileSync(_0x3eb133));if(_0x45366e!==_0x392403)throw CliErrors['validation']('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x28e211+'.\x20Changed\x20file:\x20'+_0x5023fa,'Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20'+_0x5023fa);}else{const _0x404bf0=resolve(_0x28e211,SKILL_FILE);if(existsSync(_0x404bf0)&&_0x80a5ae[_0x21bcbf(0x17a)]){const _0x49287b=contentHash(readFileSync(_0x404bf0,'utf8'));if(_0x49287b!==_0x80a5ae[_0x21bcbf(0x17a)])throw CliErrors['validation'](_0x21bcbf(0x145)+_0x404bf0,_0x21bcbf(0x14f));}}for(const _0x129dd9 of normalizeLocalFiles(_0x2bc6c3)){if(_0x460baa?.[_0x129dd9[_0x21bcbf(0x155)]])continue;if(!_0x460baa&&_0x129dd9[_0x21bcbf(0x155)]===SKILL_FILE)continue;const _0x1fcd90=resolveManagedFilePath(_0x28e211,_0x129dd9[_0x21bcbf(0x155)]);if(!existsSync(_0x1fcd90))continue;const _0x2c8fb9=lstatSync(_0x1fcd90);if(!_0x2c8fb9[_0x21bcbf(0x159)]())throw CliErrors[_0x21bcbf(0x15f)](_0x21bcbf(0x161)+_0x28e211,_0x21bcbf(0x142)+_0x129dd9[_0x21bcbf(0x155)]);const _0x193355=bufferSha256(readFileSync(_0x1fcd90));if(_0x193355!==fileHash(_0x129dd9))throw CliErrors[_0x21bcbf(0x15f)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x28e211,_0x21bcbf(0x170)+_0x129dd9['path']);}}function materializeFiles(_0x96d980,_0x15e6f1){const _0x2f0aec=a141_0x570a;for(const _0x5007c8 of normalizeLocalFiles(_0x15e6f1)){const _0x3bf03a=resolveManagedFilePath(_0x96d980,_0x5007c8[_0x2f0aec(0x155)]);mkdirSync(dirname(_0x3bf03a),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x3bf03a,fileContent(_0x5007c8),0x180);}}function removeStaleManagedFiles(_0x3924cc,_0x670ea6,_0x174bdf){const _0x58f372=a141_0x570a;if(!_0x670ea6)return;const _0x59b9d7=new Set(normalizeLocalFiles(_0x174bdf)[_0x58f372(0x153)](_0xf61e1b=>_0xf61e1b['path']));for(const _0x283cf1 of Object[_0x58f372(0x157)](_0x670ea6)){if(_0x59b9d7[_0x58f372(0x146)](_0x283cf1))continue;const _0xe2ed49=resolveManagedFilePath(_0x3924cc,_0x283cf1);existsSync(_0xe2ed49)&&lstatSync(_0xe2ed49)[_0x58f372(0x159)]()&&rmSync(_0xe2ed49,{'force':!![]});}}
@@ -1 +1 @@
1
- (function(_0x33ae1a,_0x45b220){const _0x28243e=a139_0x47a4,_0x5b6dc7=_0x33ae1a();while(!![]){try{const _0x99e0d5=-parseInt(_0x28243e(0x10e))/0x1*(parseInt(_0x28243e(0xf2))/0x2)+-parseInt(_0x28243e(0x10c))/0x3+-parseInt(_0x28243e(0xfe))/0x4+-parseInt(_0x28243e(0xfa))/0x5+-parseInt(_0x28243e(0x110))/0x6+parseInt(_0x28243e(0xf7))/0x7+parseInt(_0x28243e(0xf8))/0x8;if(_0x99e0d5===_0x45b220)break;else _0x5b6dc7['push'](_0x5b6dc7['shift']());}catch(_0x5a3b3d){_0x5b6dc7['push'](_0x5b6dc7['shift']());}}}(a139_0x1c3d,0x45a17));import{existsSync,readFileSync}from'node:fs';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';function a139_0x47a4(_0x1c65c3,_0x17880c){_0x1c65c3=_0x1c65c3-0xf1;const _0x1c3df8=a139_0x1c3d();let _0x47a41a=_0x1c3df8[_0x1c65c3];return _0x47a41a;}import{fileContent,normalizeLocalFiles}from'./local-files.js';import{buildSkillPackage,localFilesToManifestFiles}from'./zip-package.js';export function buildMetadata(_0x4c256c,_0x23391f,_0x2fafae,_0x4da7d3,_0x9e8a45,_0x4278f4,_0x4f737d){const _0x553aab=a139_0x47a4,_0x5bceb6=_0x4278f4?normalizeLocalFiles(_0x4278f4):[],_0x24ba62=!_0x4f737d&&_0x5bceb6['length']>0x0?buildSkillPackage(_0x5bceb6):undefined,_0x27c120=_0x4f737d?bufferSha256(_0x4f737d):_0x24ba62?.[_0x553aab(0x10f)][_0x553aab(0x101)],_0x41a654=_0x4f737d?.['length']??_0x24ba62?.[_0x553aab(0x10f)][_0x553aab(0x107)],_0x7863ba=_0x5bceb6[_0x553aab(0x112)]>0x0?Object[_0x553aab(0x106)](_0x5bceb6['map'](_0x43f4ca=>[_0x43f4ca['path'],fileHash(_0x43f4ca)])):undefined;return{'schemaVersion':_0x5bceb6[_0x553aab(0x112)]>0x0?0x2:0x1,'id':_0x4c256c['id'],'appCode':_0x2fafae,'skillCode':requireSkillCode(_0x4c256c),'skillName':_0x4c256c[_0x553aab(0xf1)],'description':_0x4c256c[_0x553aab(0xf6)],'example':_0x4c256c[_0x553aab(0x103)],'scope':_0x23391f,'readonly':_0x23391f!=='personal'||_0x4c256c[_0x553aab(0xfb)]===!![],'tenantCode':_0x4c256c['tenantCode'],'userId':_0x4c256c[_0x553aab(0x104)],'version':_0x4c256c[_0x553aab(0x113)],'status':_0x4c256c[_0x553aab(0xfd)],'tags':Array[_0x553aab(0xf3)](_0x4c256c[_0x553aab(0x10a)])?_0x4c256c['tags']:[],'hasUpstreamUpdate':_0x4c256c[_0x553aab(0x111)],'forkedFromSkillId':_0x4c256c['forkedFromSkillId'],'forkedFromVersion':_0x4c256c[_0x553aab(0xfc)],'sourceSessionId':_0x4c256c[_0x553aab(0x108)],'contentHash':_0x4da7d3,'fileHashes':_0x7863ba,'treeHash':_0x5bceb6[_0x553aab(0x112)]>0x0?fileTreeHash(localFilesToManifestFiles(_0x5bceb6)):undefined,'ossPath':remoteManifestOssPath(_0x4c256c[_0x553aab(0x10b)]),'zipSha256':_0x27c120,'zipSize':_0x41a654,'files':_0x5bceb6['length']>0x0?_0x5bceb6['map'](_0x18574e=>({'path':_0x18574e[_0x553aab(0x105)],'hash':fileHash(_0x18574e),'size':fileContent(_0x18574e)['length']})):undefined,'pulledAt':_0x9e8a45??new Date()[_0x553aab(0x109)]()};}export function requireSkillCode(_0x20eab1){const _0x468a0a=a139_0x47a4,_0x1e21ee=_0x20eab1[_0x468a0a(0x10d)]?.['trim']();if(!_0x1e21ee)throw CliErrors[_0x468a0a(0xff)](_0x468a0a(0xf4));return _0x1e21ee;}export function readMetadataIfPresent(_0x3b580d){const _0x9c257c=a139_0x47a4;if(!existsSync(_0x3b580d))return undefined;try{const _0x3d01ba=JSON['parse'](readFileSync(_0x3b580d,'utf8'));return _0x3d01ba;}catch{throw CliErrors[_0x9c257c(0xff)](_0x9c257c(0xf5)+METADATA_FILE+':\x20'+_0x3b580d);}}function remoteManifestOssPath(_0x4d12af){const _0x2aa86d=a139_0x47a4;if(!_0x4d12af||typeof _0x4d12af!=='object'||Array['isArray'](_0x4d12af))return undefined;const _0x283ac7=_0x4d12af[_0x2aa86d(0x102)];return typeof _0x283ac7===_0x2aa86d(0x100)&&_0x283ac7[_0x2aa86d(0xf9)]()?_0x283ac7[_0x2aa86d(0xf9)]():undefined;}function a139_0x1c3d(){const _0x27653b=['toISOString','tags','files','140676EAGiEd','skillCode','271fxiSxH','manifest','1470492rCDomd','hasUpstreamUpdate','length','version','skillName','1894dQInWk','isArray','Runtime\x20Skill\x20is\x20missing\x20skillCode.','Invalid\x20','description','127134ftxbXS','13927912YNywoW','trim','2757370PWyTvu','readonly','forkedFromVersion','status','1495436OEPCcE','validation','string','zipSha256','ossPath','example','userId','path','fromEntries','zipSize','sourceSessionId'];a139_0x1c3d=function(){return _0x27653b;};return a139_0x1c3d();}
1
+ (function(_0x3dd455,_0x12180d){const _0x3807b3=a142_0x2015,_0x160060=_0x3dd455();while(!![]){try{const _0x12044f=parseInt(_0x3807b3(0xfd))/0x1+parseInt(_0x3807b3(0xd8))/0x2*(parseInt(_0x3807b3(0xf2))/0x3)+-parseInt(_0x3807b3(0xe7))/0x4*(-parseInt(_0x3807b3(0xea))/0x5)+parseInt(_0x3807b3(0xf5))/0x6*(parseInt(_0x3807b3(0xff))/0x7)+-parseInt(_0x3807b3(0xd7))/0x8*(-parseInt(_0x3807b3(0xf4))/0x9)+-parseInt(_0x3807b3(0xeb))/0xa+parseInt(_0x3807b3(0xe1))/0xb*(-parseInt(_0x3807b3(0xe5))/0xc);if(_0x12044f===_0x12180d)break;else _0x160060['push'](_0x160060['shift']());}catch(_0x3d94ff){_0x160060['push'](_0x160060['shift']());}}}(a142_0x2df4,0x8061f));import{existsSync,readFileSync}from'node:fs';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';import{fileContent,normalizeLocalFiles}from'./local-files.js';import{buildSkillPackage,localFilesToManifestFiles}from'./zip-package.js';function a142_0x2df4(){const _0x1d07ec=['zipSize','24921RWWaEs','toISOString','21834HgRxhq','892716LSDapq','object','isArray','status','Invalid\x20','personal','ossPath','string','761728qyzIww','userId','14KBzwZZ','validation','hasUpstreamUpdate','2192QMbyGc','174SGjekZ','parse','fromEntries','files','Runtime\x20Skill\x20is\x20missing\x20skillCode.','forkedFromSkillId','version','readonly','tenantCode','242pJYfeN','manifest','forkedFromVersion','skillName','970404ROFMKs','path','1406924kkbJPo','length','utf8','10yeHeev','8452660iWhqVc','sourceSessionId','trim','skillCode','map','tags'];a142_0x2df4=function(){return _0x1d07ec;};return a142_0x2df4();}function a142_0x2015(_0x26cb7d,_0x3358b4){_0x26cb7d=_0x26cb7d-0xd7;const _0x2df460=a142_0x2df4();let _0x2015ee=_0x2df460[_0x26cb7d];return _0x2015ee;}export function buildMetadata(_0x3126e8,_0x35785e,_0x305604,_0x1ef716,_0x2a4d5a,_0x19891e,_0x24526a){const _0x3d6e6d=a142_0x2015,_0x535cf0=_0x19891e?normalizeLocalFiles(_0x19891e):[],_0xece199=!_0x24526a&&_0x535cf0['length']>0x0?buildSkillPackage(_0x535cf0):undefined,_0x595d68=_0x24526a?bufferSha256(_0x24526a):_0xece199?.[_0x3d6e6d(0xe2)]['zipSha256'],_0x48a435=_0x24526a?.[_0x3d6e6d(0xe8)]??_0xece199?.[_0x3d6e6d(0xe2)][_0x3d6e6d(0xf1)],_0x8d76d7=_0x535cf0[_0x3d6e6d(0xe8)]>0x0?Object[_0x3d6e6d(0xda)](_0x535cf0[_0x3d6e6d(0xef)](_0x4d1f6e=>[_0x4d1f6e['path'],fileHash(_0x4d1f6e)])):undefined;return{'schemaVersion':_0x535cf0[_0x3d6e6d(0xe8)]>0x0?0x2:0x1,'id':_0x3126e8['id'],'appCode':_0x305604,'skillCode':requireSkillCode(_0x3126e8),'skillName':_0x3126e8[_0x3d6e6d(0xe4)],'description':_0x3126e8['description'],'example':_0x3126e8['example'],'scope':_0x35785e,'readonly':_0x35785e!==_0x3d6e6d(0xfa)||_0x3126e8[_0x3d6e6d(0xdf)]===!![],'tenantCode':_0x3126e8[_0x3d6e6d(0xe0)],'userId':_0x3126e8[_0x3d6e6d(0xfe)],'version':_0x3126e8[_0x3d6e6d(0xde)],'status':_0x3126e8[_0x3d6e6d(0xf8)],'tags':Array[_0x3d6e6d(0xf7)](_0x3126e8[_0x3d6e6d(0xf0)])?_0x3126e8[_0x3d6e6d(0xf0)]:[],'hasUpstreamUpdate':_0x3126e8[_0x3d6e6d(0x101)],'forkedFromSkillId':_0x3126e8[_0x3d6e6d(0xdd)],'forkedFromVersion':_0x3126e8[_0x3d6e6d(0xe3)],'sourceSessionId':_0x3126e8[_0x3d6e6d(0xec)],'contentHash':_0x1ef716,'fileHashes':_0x8d76d7,'treeHash':_0x535cf0['length']>0x0?fileTreeHash(localFilesToManifestFiles(_0x535cf0)):undefined,'ossPath':remoteManifestOssPath(_0x3126e8[_0x3d6e6d(0xdb)]),'zipSha256':_0x595d68,'zipSize':_0x48a435,'files':_0x535cf0[_0x3d6e6d(0xe8)]>0x0?_0x535cf0['map'](_0x5e3b9b=>({'path':_0x5e3b9b[_0x3d6e6d(0xe6)],'hash':fileHash(_0x5e3b9b),'size':fileContent(_0x5e3b9b)[_0x3d6e6d(0xe8)]})):undefined,'pulledAt':_0x2a4d5a??new Date()[_0x3d6e6d(0xf3)]()};}export function requireSkillCode(_0x44ecc3){const _0x35219f=a142_0x2015,_0x841293=_0x44ecc3[_0x35219f(0xee)]?.[_0x35219f(0xed)]();if(!_0x841293)throw CliErrors[_0x35219f(0x100)](_0x35219f(0xdc));return _0x841293;}export function readMetadataIfPresent(_0x487b70){const _0x3390e6=a142_0x2015;if(!existsSync(_0x487b70))return undefined;try{const _0x41a13c=JSON[_0x3390e6(0xd9)](readFileSync(_0x487b70,_0x3390e6(0xe9)));return _0x41a13c;}catch{throw CliErrors[_0x3390e6(0x100)](_0x3390e6(0xf9)+METADATA_FILE+':\x20'+_0x487b70);}}function remoteManifestOssPath(_0x3ad300){const _0x1d96d8=a142_0x2015;if(!_0x3ad300||typeof _0x3ad300!==_0x1d96d8(0xf6)||Array[_0x1d96d8(0xf7)](_0x3ad300))return undefined;const _0x339856=_0x3ad300[_0x1d96d8(0xfb)];return typeof _0x339856===_0x1d96d8(0xfc)&&_0x339856[_0x1d96d8(0xed)]()?_0x339856[_0x1d96d8(0xed)]():undefined;}
@@ -1 +1 @@
1
- (function(_0x2a01ff,_0x261ff5){const _0x49b4cc=a140_0x30ef,_0x2909c0=_0x2a01ff();while(!![]){try{const _0x3fa0a0=parseInt(_0x49b4cc(0x175))/0x1*(-parseInt(_0x49b4cc(0x171))/0x2)+parseInt(_0x49b4cc(0x16f))/0x3+-parseInt(_0x49b4cc(0x166))/0x4*(parseInt(_0x49b4cc(0x173))/0x5)+-parseInt(_0x49b4cc(0x168))/0x6*(-parseInt(_0x49b4cc(0x165))/0x7)+-parseInt(_0x49b4cc(0x16c))/0x8+parseInt(_0x49b4cc(0x179))/0x9*(-parseInt(_0x49b4cc(0x164))/0xa)+parseInt(_0x49b4cc(0x163))/0xb*(parseInt(_0x49b4cc(0x16a))/0xc);if(_0x3fa0a0===_0x261ff5)break;else _0x2909c0['push'](_0x2909c0['shift']());}catch(_0x3a5c2b){_0x2909c0['push'](_0x2909c0['shift']());}}}(a140_0x1fe7,0xeb4ee));import{existsSync}from'node:fs';import{homedir}from'node:os';function a140_0x1fe7(){const _0x4c770f=['.agents','196RLbfFq','claudeSkillsDir','agentsSkillsDir','homeDir','1611UuicYL','skills','includes','CLAUDE_SKILL_ROOT','cacheRoot','homeDirName','101189CWJPYm','76660QVxiSP','161CpxtnL','28AduWBm','validation','347934ADzdfs','trim','6024rOYSmG','.workbuddy','7173256ECStng','workbuddySkillsDir','.claude','2353455FqgxyL','appCode','16672DpBsip','SKILL_ROOT','1335415xuJDeo'];a140_0x1fe7=function(){return _0x4c770f;};return a140_0x1fe7();}import{resolve}from'node:path';import{fingerprintAccessKey}from'../../commands/app/cache.js';import{PRODUCT_CONFIG,productEnv}from'../../constant/product.js';import{CliErrors}from'../../errors.js';export function resolveSkillSyncPaths(_0x19caca={}){const _0x1ee849=a140_0x30ef,_0x1b19a4=_0x19caca[_0x1ee849(0x178)]??homedir(),_0x519b0f=resolve(_0x1b19a4,PRODUCT_CONFIG[_0x1ee849(0x162)],'cache'),_0x49ec1d=trimmedEnv(_0x1ee849(0x172)),_0x576133=trimmedEnv(_0x1ee849(0x160)),_0x5e3bd7=resolve(_0x1b19a4,_0x1ee849(0x16b)),_0x381363=_0x19caca[_0x1ee849(0x16d)]??(existsSync(_0x5e3bd7)?resolve(_0x5e3bd7,_0x1ee849(0x17a)):undefined);return{'homeDir':_0x1b19a4,'cacheRoot':_0x519b0f,'managedRoot':resolve(_0x1b19a4,PRODUCT_CONFIG[_0x1ee849(0x162)]),'agentsSkillsDir':_0x19caca['agentsSkillsDir']??_0x49ec1d??resolve(_0x1b19a4,_0x1ee849(0x174),_0x1ee849(0x17a)),'claudeSkillsDir':_0x19caca[_0x1ee849(0x176)]??_0x576133??resolve(_0x1b19a4,_0x1ee849(0x16e),_0x1ee849(0x17a)),'workbuddySkillsDir':_0x381363};}export function runtimeAgentSkillRoots(_0x131fdf){const _0x5b4941=a140_0x30ef;return[_0x131fdf[_0x5b4941(0x177)],_0x131fdf[_0x5b4941(0x176)],_0x131fdf[_0x5b4941(0x16d)]]['filter'](_0x3dbcb7=>Boolean(_0x3dbcb7));}function a140_0x30ef(_0x4949eb,_0x430aae){_0x4949eb=_0x4949eb-0x15f;const _0x1fe790=a140_0x1fe7();let _0x30ef5d=_0x1fe790[_0x4949eb];return _0x30ef5d;}export function getRuntimeSkillCacheRoot(_0x4ac418,_0x2c5c0e,_0x38f8af={}){const _0x429f77=a140_0x30ef,_0x46846a=resolveSkillSyncPaths(_0x38f8af);return resolve(_0x46846a[_0x429f77(0x161)],_0x4ac418,fingerprintAccessKey(_0x2c5c0e),_0x429f77(0x17a));}export function getRuntimeSkillDir(_0x53f1cc,_0x41aea2,_0x3d7efa,_0x2fe502,_0xc0343a,_0x31ca03={}){const _0x396adf=a140_0x30ef;return resolve(getRuntimeSkillCacheRoot(_0x53f1cc,_0x41aea2,_0x31ca03),safePathSegment(_0x3d7efa,_0x396adf(0x170)),_0x2fe502,safePathSegment(_0xc0343a,'skillCode'));}export function safePathSegment(_0x1520c8,_0x3ca48d='path\x20segment'){const _0x623361=a140_0x30ef;if(!_0x1520c8||_0x1520c8[_0x623361(0x15f)]('/')||_0x1520c8[_0x623361(0x15f)]('\x5c')||_0x1520c8[_0x623361(0x15f)]('..'))throw CliErrors[_0x623361(0x167)]('Unsafe\x20'+_0x3ca48d+'\x20for\x20local\x20path:\x20'+_0x1520c8);return _0x1520c8;}function trimmedEnv(_0x1ec3fe){const _0x2afc56=a140_0x30ef,_0xe56ede=productEnv(_0x1ec3fe)?.[_0x2afc56(0x169)]();return _0xe56ede?_0xe56ede:undefined;}
1
+ const a143_0x19c077=a143_0x415d;(function(_0x478c1f,_0x194241){const _0x28d27a=a143_0x415d,_0x4c332c=_0x478c1f();while(!![]){try{const _0x347446=-parseInt(_0x28d27a(0xb7))/0x1*(parseInt(_0x28d27a(0xb6))/0x2)+parseInt(_0x28d27a(0xc8))/0x3+parseInt(_0x28d27a(0xc1))/0x4*(parseInt(_0x28d27a(0xc2))/0x5)+parseInt(_0x28d27a(0xc7))/0x6*(parseInt(_0x28d27a(0xc0))/0x7)+-parseInt(_0x28d27a(0xce))/0x8*(parseInt(_0x28d27a(0xbb))/0x9)+parseInt(_0x28d27a(0xbc))/0xa*(-parseInt(_0x28d27a(0xba))/0xb)+parseInt(_0x28d27a(0xbe))/0xc;if(_0x347446===_0x194241)break;else _0x4c332c['push'](_0x4c332c['shift']());}catch(_0x56f40b){_0x4c332c['push'](_0x4c332c['shift']());}}}(a143_0x4620,0xec327));import{existsSync}from'node:fs';import{homedir}from'node:os';function a143_0x4620(){const _0xf7e9b3=['633248nWUjwf','9DVqcsi','110aSEBbh','\x20for\x20local\x20path:\x20','13441668SvdvKm','includes','3395iZMXMg','4941988vXcyKG','5rFogii','agentsSkillsDir','homeDir','skillCode','appCode','14562VyGugK','2075988DrFmka','cache','trim','Unsafe\x20','skills','claudeSkillsDir','12523208TVLUsI','homeDirName','.workbuddy','workbuddySkillsDir','path\x20segment','423446mmADfm','5sYFpBK','.claude','CLAUDE_SKILL_ROOT'];a143_0x4620=function(){return _0xf7e9b3;};return a143_0x4620();}import{resolve}from'node:path';import{fingerprintAccessKey}from'../../commands/app/cache.js';function a143_0x415d(_0x4db206,_0x3da071){_0x4db206=_0x4db206-0xb3;const _0x4620c2=a143_0x4620();let _0x415d90=_0x4620c2[_0x4db206];return _0x415d90;}import{PRODUCT_CONFIG,productEnv}from'../../constant/product.js';import{CliErrors}from'../../errors.js';export function resolveSkillSyncPaths(_0x1b24db={}){const _0x459e6d=a143_0x415d,_0x469fbb=_0x1b24db[_0x459e6d(0xc4)]??homedir(),_0x52e027=resolve(_0x469fbb,PRODUCT_CONFIG['homeDirName'],_0x459e6d(0xc9)),_0x170ccd=trimmedEnv('SKILL_ROOT'),_0x23855d=trimmedEnv(_0x459e6d(0xb9)),_0x2d1ac8=resolve(_0x469fbb,_0x459e6d(0xb3)),_0x1a5a23=_0x1b24db[_0x459e6d(0xb4)]??(existsSync(_0x2d1ac8)?resolve(_0x2d1ac8,_0x459e6d(0xcc)):undefined);return{'homeDir':_0x469fbb,'cacheRoot':_0x52e027,'managedRoot':resolve(_0x469fbb,PRODUCT_CONFIG[_0x459e6d(0xcf)]),'agentsSkillsDir':_0x1b24db['agentsSkillsDir']??_0x170ccd??resolve(_0x469fbb,'.agents',_0x459e6d(0xcc)),'claudeSkillsDir':_0x1b24db[_0x459e6d(0xcd)]??_0x23855d??resolve(_0x469fbb,_0x459e6d(0xb8),_0x459e6d(0xcc)),'workbuddySkillsDir':_0x1a5a23};}export function runtimeAgentSkillRoots(_0x4d36b4){const _0x4901d5=a143_0x415d;return[_0x4d36b4[_0x4901d5(0xc3)],_0x4d36b4[_0x4901d5(0xcd)],_0x4d36b4[_0x4901d5(0xb4)]]['filter'](_0x2f2ecb=>Boolean(_0x2f2ecb));}export function getRuntimeSkillCacheRoot(_0x1018f7,_0x35158d,_0x5913e0={}){const _0x4cc1b7=resolveSkillSyncPaths(_0x5913e0);return resolve(_0x4cc1b7['cacheRoot'],_0x1018f7,fingerprintAccessKey(_0x35158d),'skills');}export function getRuntimeSkillDir(_0xfd5375,_0x272a07,_0x1f5ec4,_0x50902e,_0x203725,_0x34dd92={}){const _0x42dccb=a143_0x415d;return resolve(getRuntimeSkillCacheRoot(_0xfd5375,_0x272a07,_0x34dd92),safePathSegment(_0x1f5ec4,_0x42dccb(0xc6)),_0x50902e,safePathSegment(_0x203725,_0x42dccb(0xc5)));}export function safePathSegment(_0x510981,_0x4dddc5=a143_0x19c077(0xb5)){const _0x4d0800=a143_0x19c077;if(!_0x510981||_0x510981[_0x4d0800(0xbf)]('/')||_0x510981['includes']('\x5c')||_0x510981[_0x4d0800(0xbf)]('..'))throw CliErrors['validation'](_0x4d0800(0xcb)+_0x4dddc5+_0x4d0800(0xbd)+_0x510981);return _0x510981;}function trimmedEnv(_0x596ba1){const _0x1fec06=a143_0x19c077,_0x395c2c=productEnv(_0x596ba1)?.[_0x1fec06(0xca)]();return _0x395c2c?_0x395c2c:undefined;}