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

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 (166) hide show
  1. package/lib/cli.js +1 -1
  2. package/lib/commands/api-doc/index.js +1 -1
  3. package/lib/commands/app/cache.js +1 -1
  4. package/lib/commands/app/definitions.js +1 -1
  5. package/lib/commands/app/eligibility.js +1 -1
  6. package/lib/commands/app/mock-loader.js +1 -1
  7. package/lib/commands/app/remote-source.js +1 -1
  8. package/lib/commands/app/shared.js +1 -1
  9. package/lib/commands/app-config/get.js +1 -1
  10. package/lib/commands/app-config/index.js +1 -1
  11. package/lib/commands/artifact/index.js +1 -1
  12. package/lib/commands/auth/device.js +1 -1
  13. package/lib/commands/auth/index.js +1 -1
  14. package/lib/commands/auth/prompt.js +1 -1
  15. package/lib/commands/bff/detail.js +1 -1
  16. package/lib/commands/bff/exec.js +1 -1
  17. package/lib/commands/bff/index.js +1 -1
  18. package/lib/commands/cli-skill/index.js +1 -1
  19. package/lib/commands/common/config-policy.js +1 -1
  20. package/lib/commands/common/constraints.js +1 -1
  21. package/lib/commands/common/flags.js +1 -1
  22. package/lib/commands/common/local-file.js +1 -1
  23. package/lib/commands/config/definitions.js +1 -1
  24. package/lib/commands/config/init.js +1 -1
  25. package/lib/commands/config/shared.js +1 -1
  26. package/lib/commands/data/index.js +1 -1
  27. package/lib/commands/dataset/detail.js +1 -1
  28. package/lib/commands/dataset/index.js +1 -1
  29. package/lib/commands/dataset/list.js +1 -1
  30. package/lib/commands/dataset/sdk-doc.js +1 -1
  31. package/lib/commands/doctor.js +1 -1
  32. package/lib/commands/file/index.js +1 -1
  33. package/lib/commands/init.js +1 -1
  34. package/lib/commands/kb/index.js +1 -1
  35. package/lib/commands/logs/index.js +1 -1
  36. package/lib/commands/notification/config-list.js +1 -1
  37. package/lib/commands/notification/index.js +1 -1
  38. package/lib/commands/notification/shared.js +1 -1
  39. package/lib/commands/ocr/index.js +1 -1
  40. package/lib/commands/permit/dataset-get.js +1 -1
  41. package/lib/commands/permit/dataset-set.js +1 -1
  42. package/lib/commands/permit/index.js +1 -1
  43. package/lib/commands/permit/page-get.js +1 -1
  44. package/lib/commands/permit/page-set.js +1 -1
  45. package/lib/commands/permit/role-menus-set.js +1 -1
  46. package/lib/commands/permit/role-menus.js +1 -1
  47. package/lib/commands/permit/shared.js +1 -1
  48. package/lib/commands/personal-bff/index.js +1 -1
  49. package/lib/commands/registry.js +1 -1
  50. package/lib/commands/role/create.js +1 -1
  51. package/lib/commands/role/delete.js +1 -1
  52. package/lib/commands/role/detail.js +1 -1
  53. package/lib/commands/role/index.js +1 -1
  54. package/lib/commands/role/list.js +1 -1
  55. package/lib/commands/role/shared.js +1 -1
  56. package/lib/commands/role/update.js +1 -1
  57. package/lib/commands/role/user-add.js +1 -1
  58. package/lib/commands/role/user-remove.js +1 -1
  59. package/lib/commands/schedule/index.js +1 -1
  60. package/lib/commands/schema.js +1 -1
  61. package/lib/commands/service/dynamic.js +1 -1
  62. package/lib/commands/service/function-name-adapter.js +1 -1
  63. package/lib/commands/service/index.js +1 -1
  64. package/lib/commands/service/registry.js +1 -1
  65. package/lib/commands/skill/commands/create.js +1 -1
  66. package/lib/commands/skill/commands/diagram.js +1 -1
  67. package/lib/commands/skill/commands/install.js +1 -1
  68. package/lib/commands/skill/commands/list.js +1 -1
  69. package/lib/commands/skill/commands/push.js +1 -1
  70. package/lib/commands/skill/commands/validate.js +1 -1
  71. package/lib/commands/skill/diagram.js +1 -1
  72. package/lib/commands/skill/flags.js +1 -1
  73. package/lib/commands/skill/index.js +1 -1
  74. package/lib/commands/skill/manifest-helpers.js +1 -1
  75. package/lib/commands/skill/push-execute.js +1 -1
  76. package/lib/commands/skill/push-flow-helpers.js +1 -1
  77. package/lib/commands/skill/push-retarget.js +1 -1
  78. package/lib/commands/skill/scopes.js +1 -1
  79. package/lib/commands/skill/summary.js +1 -1
  80. package/lib/commands/skill/templates.js +1 -1
  81. package/lib/commands/skill/validate.js +1 -1
  82. package/lib/commands/sql/detail.js +1 -1
  83. package/lib/commands/sql/exec.js +1 -1
  84. package/lib/commands/sql/index.js +1 -1
  85. package/lib/commands/update.js +1 -1
  86. package/lib/commands/user-account/bind.js +1 -1
  87. package/lib/commands/user-account/index.js +1 -1
  88. package/lib/commands/workspace/index.js +1 -1
  89. package/lib/config/domain-config.js +1 -1
  90. package/lib/config/schema.js +1 -1
  91. package/lib/constant/app.js +1 -1
  92. package/lib/constant/auth-mode.js +1 -1
  93. package/lib/constant/cli.js +1 -1
  94. package/lib/constant/defaults.js +1 -1
  95. package/lib/constant/distribution.js +1 -1
  96. package/lib/constant/domain.js +1 -1
  97. package/lib/constant/env.js +1 -1
  98. package/lib/constant/output.js +1 -1
  99. package/lib/constant/product.js +1 -1
  100. package/lib/constant/region.js +1 -1
  101. package/lib/constant/risk.js +1 -1
  102. package/lib/constant/url.js +1 -1
  103. package/lib/context.js +1 -1
  104. package/lib/core/api-client.js +1 -1
  105. package/lib/core/db-resolver.js +1 -1
  106. package/lib/core/kb-search-client.js +1 -1
  107. package/lib/core/sdk-client.js +1 -1
  108. package/lib/errors.js +1 -1
  109. package/lib/framework/build-all-flags.js +1 -1
  110. package/lib/framework/dryrun.js +1 -1
  111. package/lib/framework/flags.js +1 -1
  112. package/lib/framework/help.js +1 -1
  113. package/lib/framework/index.js +1 -1
  114. package/lib/framework/output.js +1 -1
  115. package/lib/framework/preparse.js +1 -1
  116. package/lib/framework/rate-limit.js +1 -1
  117. package/lib/framework/raw-flags.js +1 -1
  118. package/lib/framework/response.js +1 -1
  119. package/lib/framework/runner-confirmation.js +1 -1
  120. package/lib/framework/runner-error.js +1 -1
  121. package/lib/framework/runner.js +1 -1
  122. package/lib/framework/schema-export.js +1 -1
  123. package/lib/framework/service-order.js +1 -1
  124. package/lib/framework/types.js +1 -1
  125. package/lib/generated/build-info.d.ts +4 -4
  126. package/lib/generated/build-info.js +1 -1
  127. package/lib/generated/official-routing.js +1 -1
  128. package/lib/generated/routing-contract.js +1 -1
  129. package/lib/help.js +1 -1
  130. package/lib/postinstall.js +1 -1
  131. package/lib/runtime/confirmation.js +1 -1
  132. package/lib/runtime/event.js +1 -1
  133. package/lib/runtime/index.js +1 -1
  134. package/lib/runtime/queue.js +1 -1
  135. package/lib/runtime/resolve.js +1 -1
  136. package/lib/skills/builtin-skill.js +1 -1
  137. package/lib/skills/npx-skills-add.js +1 -1
  138. package/lib/skills/runtime-skill-sync/constants.js +1 -1
  139. package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
  140. package/lib/skills/runtime-skill-sync/hashing.js +1 -1
  141. package/lib/skills/runtime-skill-sync/install-target.js +1 -1
  142. package/lib/skills/runtime-skill-sync/links.js +1 -1
  143. package/lib/skills/runtime-skill-sync/list-local.js +1 -1
  144. package/lib/skills/runtime-skill-sync/local-files.js +1 -1
  145. package/lib/skills/runtime-skill-sync/materialize.js +1 -1
  146. package/lib/skills/runtime-skill-sync/metadata.js +1 -1
  147. package/lib/skills/runtime-skill-sync/paths.js +1 -1
  148. package/lib/skills/runtime-skill-sync/push.js +1 -1
  149. package/lib/skills/runtime-skill-sync/scopes.js +1 -1
  150. package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
  151. package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
  152. package/lib/skills/runtime-skill-sync.js +1 -1
  153. package/lib/skills/skill-presence.js +1 -1
  154. package/lib/utils/access-key-redaction.js +1 -1
  155. package/lib/utils/apply-jq-filter.js +1 -1
  156. package/lib/utils/cli-version-check.js +1 -1
  157. package/lib/utils/cli-version-policy.js +1 -1
  158. package/lib/utils/logger.js +1 -1
  159. package/lib/utils/lossless-json.js +1 -1
  160. package/lib/utils/params.js +1 -1
  161. package/lib/utils/update-notice.js +1 -1
  162. package/lib/utils/version.js +1 -1
  163. package/lib/utils/write-cli-side-channel.js +1 -1
  164. package/package.json +1 -1
  165. package/skills/lovrabet/SKILL.md +1 -1
  166. package/skills/lovrabet.manifest.json +3 -3
@@ -1 +1 @@
1
- (function(_0x3afe87,_0x52aad2){const _0x51cd7a=a133_0x13ea,_0x296f62=_0x3afe87();while(!![]){try{const _0x26814a=parseInt(_0x51cd7a(0x160))/0x1*(parseInt(_0x51cd7a(0x152))/0x2)+parseInt(_0x51cd7a(0x14f))/0x3+parseInt(_0x51cd7a(0x150))/0x4+-parseInt(_0x51cd7a(0x15c))/0x5*(-parseInt(_0x51cd7a(0x157))/0x6)+-parseInt(_0x51cd7a(0x156))/0x7+parseInt(_0x51cd7a(0x164))/0x8+-parseInt(_0x51cd7a(0x15e))/0x9*(parseInt(_0x51cd7a(0x15a))/0xa);if(_0x26814a===_0x52aad2)break;else _0x296f62['push'](_0x296f62['shift']());}catch(_0x175494){_0x296f62['push'](_0x296f62['shift']());}}}(a133_0x3650,0x9aa12));function a133_0x13ea(_0x279dda,_0x330136){_0x279dda=_0x279dda-0x14f;const _0x365066=a133_0x3650();let _0x13ea21=_0x365066[_0x279dda];return _0x13ea21;}import a133_0x228bed from'meow';import{findDefinition,getServiceEntry,isKnownService,resolveRemovedCommand}from'../commands/registry.js';import{resolveDynamicServiceCommand}from'../commands/service/dynamic.js';import{buildMeowFlags}from'../constant/cli.js';import{CliErrors}from'../errors.js';export async function resolveLovrabetInvocation(_0x45a70f){const _0x240354=a133_0x13ea,_0x3990b0=a133_0x228bed('',{'importMeta':import.meta,'argv':_0x45a70f,'flags':buildMeowFlags(),'autoHelp':![],'autoVersion':![]}),_0x36f1a1=[..._0x3990b0[_0x240354(0x151)]],_0x557321=_0x3990b0[_0x240354(0x166)];await correctFlags(_0x557321);const _0x413d87=_0x36f1a1[0x0];if(!_0x413d87)throw CliErrors['validation'](_0x240354(0x162));const _0x29b67a=resolveRemovedCommand(_0x413d87,_0x36f1a1[0x1]);if(_0x29b67a)throw CliErrors[_0x240354(0x154)](_0x29b67a[_0x240354(0x15b)],_0x29b67a[_0x240354(0x165)]);if(!isKnownService(_0x413d87)){const _0x1e326c=resolveDynamicServiceCommand(_0x36f1a1,_0x557321);if(!_0x1e326c)throw CliErrors[_0x240354(0x158)](_0x36f1a1['join']('\x20'));return Object[_0x240354(0x15f)](_0x557321,_0x1e326c[_0x240354(0x166)]),{'definition':_0x1e326c[_0x240354(0x161)],'rawFlags':_0x557321,'args':_0x1e326c[_0x240354(0x153)]};}const _0x236851=getServiceEntry(_0x413d87),_0x591ab6=_0x36f1a1[0x1]||_0x236851['defaultCommand'];if(!_0x591ab6)throw CliErrors['validation'](_0x240354(0x15d)+_0x413d87+'\x22.');const _0x31c128=findDefinition(_0x413d87,_0x591ab6);if(!_0x31c128)throw CliErrors[_0x240354(0x158)](_0x413d87+'\x20'+_0x591ab6);return{'definition':_0x31c128,'rawFlags':_0x557321,'args':_0x36f1a1['slice'](0x2)};}async function correctFlags(_0x185f11){const _0x3efda7=a133_0x13ea;try{const {correctFlags:_0x797ce1}=await import(_0x3efda7(0x159)),{getAllDefinitions:_0x1e9cef}=await import(_0x3efda7(0x163)),_0x47504e=_0x1e9cef()[_0x3efda7(0x155)](_0x468afc=>_0x468afc['flags']??[]),_0x5c6f95=_0x797ce1(_0x185f11,_0x47504e);Object['assign'](_0x185f11,_0x5c6f95['flags']);}catch{}}function a133_0x3650(){const _0x4df8d9=['unknownCommand','../framework/preparse.js','3267650eGZOTs','message','80rtZxvR','Lovrabet\x20argv\x20must\x20include\x20a\x20command\x20for\x20service\x20\x22','36dvTQHk','assign','59253FImPOH','definition','Lovrabet\x20argv\x20must\x20include\x20a\x20service\x20and\x20command.','../commands/registry.js','7034920HVuqem','hint','flags','824601jpTKHv','742540hhPABh','input','38Rbljxq','args','validation','flatMap','7743260rvUkoO','217848QJALWV'];a133_0x3650=function(){return _0x4df8d9;};return a133_0x3650();}
1
+ (function(_0x5d8713,_0x246733){const _0x279ef0=a133_0x4ef3,_0x4570d5=_0x5d8713();while(!![]){try{const _0x4e573f=-parseInt(_0x279ef0(0xfb))/0x1+-parseInt(_0x279ef0(0xfe))/0x2+parseInt(_0x279ef0(0xef))/0x3+-parseInt(_0x279ef0(0xf6))/0x4+parseInt(_0x279ef0(0xf3))/0x5+-parseInt(_0x279ef0(0xf7))/0x6*(-parseInt(_0x279ef0(0x104))/0x7)+parseInt(_0x279ef0(0x102))/0x8;if(_0x4e573f===_0x246733)break;else _0x4570d5['push'](_0x4570d5['shift']());}catch(_0xa6c640){_0x4570d5['push'](_0x4570d5['shift']());}}}(a133_0x5aea,0x58728));function a133_0x4ef3(_0x30914b,_0x1ec590){_0x30914b=_0x30914b-0xee;const _0x5aea68=a133_0x5aea();let _0x4ef33b=_0x5aea68[_0x30914b];return _0x4ef33b;}import a133_0x264755 from'meow';function a133_0x5aea(){const _0x5540ed=['536594hgaFgG','assign','validation','539128JtSlJT','defaultCommand','definition','flags','10599528VcCokH','hint','7oFBkGh','Lovrabet\x20argv\x20must\x20include\x20a\x20service\x20and\x20command.','99018nsKCLl','../commands/registry.js','unknownCommand','slice','16050ULCPME','flatMap','args','1931320vqaldG','1740666DaqQbE','input','Lovrabet\x20argv\x20must\x20include\x20a\x20command\x20for\x20service\x20\x22','../framework/preparse.js'];a133_0x5aea=function(){return _0x5540ed;};return a133_0x5aea();}import{findDefinition,getServiceEntry,isKnownService,resolveRemovedCommand}from'../commands/registry.js';import{resolveDynamicServiceCommand}from'../commands/service/dynamic.js';import{buildMeowFlags}from'../constant/cli.js';import{CliErrors}from'../errors.js';export async function resolveLovrabetInvocation(_0x1c4d73){const _0x47f09b=a133_0x4ef3,_0x3aed1e=a133_0x264755('',{'importMeta':import.meta,'argv':_0x1c4d73,'flags':buildMeowFlags(),'autoHelp':![],'autoVersion':![]}),_0xdf3e69=[..._0x3aed1e[_0x47f09b(0xf8)]],_0x1b0ff6=_0x3aed1e[_0x47f09b(0x101)];await correctFlags(_0x1b0ff6);const _0x2b7050=_0xdf3e69[0x0];if(!_0x2b7050)throw CliErrors[_0x47f09b(0xfd)](_0x47f09b(0xee));const _0x348e07=resolveRemovedCommand(_0x2b7050,_0xdf3e69[0x1]);if(_0x348e07)throw CliErrors[_0x47f09b(0xfd)](_0x348e07['message'],_0x348e07[_0x47f09b(0x103)]);if(!isKnownService(_0x2b7050)){const _0x5d368b=resolveDynamicServiceCommand(_0xdf3e69,_0x1b0ff6);if(!_0x5d368b)throw CliErrors['unknownCommand'](_0xdf3e69['join']('\x20'));return Object[_0x47f09b(0xfc)](_0x1b0ff6,_0x5d368b['flags']),{'definition':_0x5d368b[_0x47f09b(0x100)],'rawFlags':_0x1b0ff6,'args':_0x5d368b[_0x47f09b(0xf5)]};}const _0x293921=getServiceEntry(_0x2b7050),_0x4aff75=_0xdf3e69[0x1]||_0x293921[_0x47f09b(0xff)];if(!_0x4aff75)throw CliErrors[_0x47f09b(0xfd)](_0x47f09b(0xf9)+_0x2b7050+'\x22.');const _0x4f2dee=findDefinition(_0x2b7050,_0x4aff75);if(!_0x4f2dee)throw CliErrors[_0x47f09b(0xf1)](_0x2b7050+'\x20'+_0x4aff75);return{'definition':_0x4f2dee,'rawFlags':_0x1b0ff6,'args':_0xdf3e69[_0x47f09b(0xf2)](0x2)};}async function correctFlags(_0x330cea){const _0xc3792a=a133_0x4ef3;try{const {correctFlags:_0x231d03}=await import(_0xc3792a(0xfa)),{getAllDefinitions:_0x207018}=await import(_0xc3792a(0xf0)),_0x3bfed1=_0x207018()[_0xc3792a(0xf4)](_0x3adea1=>_0x3adea1[_0xc3792a(0x101)]??[]),_0x59feae=_0x231d03(_0x330cea,_0x3bfed1);Object[_0xc3792a(0xfc)](_0x330cea,_0x59feae['flags']);}catch{}}
@@ -1 +1 @@
1
- function a135_0x5007(){const _0x5d06ba=['SKILL.md','message','62cqWzSJ','SOURCE_INVALID','Installed\x20Skill\x20state\x20is\x20','installedPath','580968pgjsqD','utf8','9254JZnlCt','version_mismatch','66110RmwuDa','1301994VaEkzq','Symbolic\x20link\x20is\x20not\x20allowed:\x20','unknown','parse','7WjPAGo','packageRoot','split','9FdhILf','content_mismatch','skills@latest\x20exited\x20','packageVersion','pipe','package.json','flatMap','sort','380jDttMZ','update','skillVersion','manifest','name','current','home','absent','state','stdio','trim','every','version','missing','digest','26tWarNX','reason','path','1396175ptWyuv','2408584qCKTpN',':\x5cs*(.+)$','556vPlcQU','unverifiable','skills','join','Built-in\x20Skill\x20source\x20does\x20not\x20match\x20its\x20package\x20manifest','root','Unsupported\x20Skill\x20entry:\x20','lovrabet','VERIFY_FAILED','hex','isDirectory','schemaVersion','status','sha256','2661OoZRNd','files','present'];a135_0x5007=function(){return _0x5d06ba;};return a135_0x5007();}const a135_0x50fb5d=a135_0x4c1e;(function(_0x444c1f,_0xc1ea74){const _0x1813ce=a135_0x4c1e,_0x5c6742=_0x444c1f();while(!![]){try{const _0x4ada80=-parseInt(_0x1813ce(0x1ce))/0x1*(parseInt(_0x1813ce(0x1c8))/0x2)+parseInt(_0x1813ce(0x1c3))/0x3*(-parseInt(_0x1813ce(0x1f5))/0x4)+-parseInt(_0x1813ce(0x1f2))/0x5+parseInt(_0x1813ce(0x1d1))/0x6*(parseInt(_0x1813ce(0x1d5))/0x7)+-parseInt(_0x1813ce(0x1f3))/0x8*(-parseInt(_0x1813ce(0x1d8))/0x9)+-parseInt(_0x1813ce(0x1e0))/0xa*(-parseInt(_0x1813ce(0x1d0))/0xb)+parseInt(_0x1813ce(0x1cc))/0xc*(parseInt(_0x1813ce(0x1ef))/0xd);if(_0x4ada80===_0xc1ea74)break;else _0x5c6742['push'](_0x5c6742['shift']());}catch(_0x4e40e8){_0x5c6742['push'](_0x5c6742['shift']());}}}(a135_0x5007,0x25916));import{createHash}from'node:crypto';import{lstatSync,readFileSync,readdirSync}from'node:fs';import{homedir}from'node:os';import{dirname,join,relative,resolve,sep}from'node:path';import{fileURLToPath}from'node:url';import{runNpxSkillsAddGlobal}from'../skills/npx-skills-add.js';import{resolveInstalledSkill}from'../skills/skill-presence.js';const DEFAULT_PACKAGE_ROOT=resolve(dirname(fileURLToPath(import.meta.url)),'..','..'),REPAIR_COMMAND='lovrabet\x20cli-skill\x20install',SKILL_NAME=a135_0x50fb5d(0x1bc);function frontmatterValue(_0x1c3d73,_0x5bd9a8){const _0x34905b=a135_0x50fb5d;return _0x1c3d73['match'](new RegExp('^'+_0x5bd9a8+_0x34905b(0x1f4),'m'))?.[0x1]?.[_0x34905b(0x1ea)]()??'';}function listFiles(_0x187306,_0x40b9a5=_0x187306){const _0x2e1dc7=a135_0x50fb5d;return readdirSync(_0x40b9a5,{'withFileTypes':!![]})[_0x2e1dc7(0x1de)](_0x1d12ae=>{const _0x333d8b=_0x2e1dc7,_0x2601dc=join(_0x40b9a5,_0x1d12ae[_0x333d8b(0x1e4)]),_0x30d5e6=lstatSync(_0x2601dc);if(_0x30d5e6['isSymbolicLink']())throw new Error(_0x333d8b(0x1d2)+_0x2601dc);if(_0x30d5e6[_0x333d8b(0x1bf)]())return listFiles(_0x187306,_0x2601dc);if(!_0x30d5e6['isFile']())throw new Error(_0x333d8b(0x1bb)+_0x2601dc);return[relative(_0x187306,_0x2601dc)[_0x333d8b(0x1d7)](sep)[_0x333d8b(0x1b8)]('/')];})[_0x2e1dc7(0x1df)]((_0xa66182,_0x1162c3)=>_0xa66182<_0x1162c3?-0x1:_0xa66182>_0x1162c3?0x1:0x0);}function digestFiles(_0x293f61,_0x11a76a){const _0x130a7c=a135_0x50fb5d,_0xb2ff7e=createHash(_0x130a7c(0x1c2));for(const _0x392f65 of _0x11a76a){if(_0x392f65['startsWith']('/')||_0x392f65[_0x130a7c(0x1d7)]('/')['includes']('..')||_0x392f65['includes']('\x5c'))throw new Error('Unsafe\x20manifest\x20path:\x20'+_0x392f65);_0xb2ff7e[_0x130a7c(0x1e1)](_0x392f65),_0xb2ff7e[_0x130a7c(0x1e1)]('\x00'),_0xb2ff7e['update'](readFileSync(join(_0x293f61,..._0x392f65[_0x130a7c(0x1d7)]('/')))),_0xb2ff7e['update']('\x00');}return _0xb2ff7e[_0x130a7c(0x1ee)](_0x130a7c(0x1be));}function sameFiles(_0x1fcde6,_0x3906df){const _0x206d13=a135_0x50fb5d;return _0x1fcde6['length']===_0x3906df['length']&&_0x1fcde6[_0x206d13(0x1eb)]((_0x441cbb,_0x349465)=>_0x441cbb===_0x3906df[_0x349465]);}function readSource(_0x46785a){const _0x224df7=a135_0x50fb5d,_0x30e754=JSON['parse'](readFileSync(join(_0x46785a,_0x224df7(0x1dd)),_0x224df7(0x1cd))),_0x1d44fb=JSON[_0x224df7(0x1d4)](readFileSync(join(_0x46785a,'skills','lovrabet.manifest.json'),_0x224df7(0x1cd))),_0x432ec6=join(_0x46785a,_0x224df7(0x1f7),SKILL_NAME),_0xd4290c=frontmatterValue(readFileSync(join(_0x432ec6,_0x224df7(0x1c6)),_0x224df7(0x1cd)),_0x224df7(0x1ec)),_0x5d9d22=listFiles(_0x432ec6);if(_0x1d44fb[_0x224df7(0x1c0)]!==0x1||_0x1d44fb[_0x224df7(0x1e4)]!==SKILL_NAME||!_0x30e754[_0x224df7(0x1ec)]||_0x1d44fb[_0x224df7(0x1db)]!==_0x30e754['version']||_0x1d44fb['skillVersion']!==_0x30e754['version']||_0xd4290c!==_0x30e754['version']||!sameFiles(_0x5d9d22,_0x1d44fb[_0x224df7(0x1c4)])||digestFiles(_0x432ec6,_0x5d9d22)!==_0x1d44fb[_0x224df7(0x1ee)])throw new Error(_0x224df7(0x1b9));return{'packageVersion':_0x30e754[_0x224df7(0x1ec)],'skillVersion':_0xd4290c,'root':_0x432ec6,'manifest':_0x1d44fb};}function a135_0x4c1e(_0x164675,_0x1cde36){_0x164675=_0x164675-0x1b8;const _0x50076e=a135_0x5007();let _0x4c1e7f=_0x50076e[_0x164675];return _0x4c1e7f;}function installedSkillPath(_0x49e171){const _0x526284=a135_0x50fb5d,_0x4fc0e5=resolveInstalledSkill(SKILL_NAME,{'home':_0x49e171});if(_0x4fc0e5['state']===_0x526284(0x1c5))return{'state':_0x526284(0x1c5),'path':dirname(_0x4fc0e5[_0x526284(0x1f1)])};if(_0x4fc0e5['state']===_0x526284(0x1e7))return{'state':_0x526284(0x1ed)};return{'state':_0x526284(0x1f6),'reason':_0x4fc0e5[_0x526284(0x1f0)]};}export function inspectInstalledBuiltinSkillVersion(_0x606422,_0x4d2254={}){const _0x19596f=a135_0x50fb5d,_0x3b6afe=installedSkillPath(_0x4d2254[_0x19596f(0x1e6)]??homedir());if(_0x3b6afe[_0x19596f(0x1e8)]==='missing')return{'state':_0x19596f(0x1ed),'expectedVersion':_0x606422,'repairCommand':REPAIR_COMMAND};if(_0x3b6afe[_0x19596f(0x1e8)]==='unverifiable')return{'state':_0x19596f(0x1f6),'expectedVersion':_0x606422,'reason':_0x3b6afe[_0x19596f(0x1f0)],'repairCommand':REPAIR_COMMAND};try{const _0x19f498=frontmatterValue(readFileSync(join(_0x3b6afe[_0x19596f(0x1f1)],_0x19596f(0x1c6)),_0x19596f(0x1cd)),_0x19596f(0x1ec));return{'state':_0x19f498===_0x606422?'current':_0x19596f(0x1cf),'expectedVersion':_0x606422,'skillVersion':_0x19f498,'installedPath':_0x3b6afe[_0x19596f(0x1f1)],'repairCommand':REPAIR_COMMAND};}catch(_0x17cfcb){return{'state':'unverifiable','expectedVersion':_0x606422,'installedPath':_0x3b6afe[_0x19596f(0x1f1)],'reason':_0x17cfcb instanceof Error?_0x17cfcb[_0x19596f(0x1c7)]:String(_0x17cfcb),'repairCommand':REPAIR_COMMAND};}}export function inspectBuiltinSkill(_0x162702={}){const _0x5bed1d=a135_0x50fb5d,_0x2de2ab=_0x162702[_0x5bed1d(0x1d6)]??DEFAULT_PACKAGE_ROOT;let _0x2bf339;try{_0x2bf339=readSource(_0x2de2ab);}catch(_0x10cf9b){return{'state':_0x5bed1d(0x1f6),'packageVersion':_0x5bed1d(0x1d3),'reason':_0x10cf9b instanceof Error?_0x10cf9b[_0x5bed1d(0x1c7)]:String(_0x10cf9b),'repairCommand':REPAIR_COMMAND};}const _0xaf2b4d=installedSkillPath(_0x162702[_0x5bed1d(0x1e6)]??homedir());if(_0xaf2b4d[_0x5bed1d(0x1e8)]===_0x5bed1d(0x1ed))return{'state':_0x5bed1d(0x1ed),'packageVersion':_0x2bf339['packageVersion'],'repairCommand':REPAIR_COMMAND};if(_0xaf2b4d[_0x5bed1d(0x1e8)]===_0x5bed1d(0x1f6))return{'state':'unverifiable','packageVersion':_0x2bf339[_0x5bed1d(0x1db)],'reason':_0xaf2b4d[_0x5bed1d(0x1f0)],'repairCommand':REPAIR_COMMAND};try{const _0xaff6c2=frontmatterValue(readFileSync(join(_0xaf2b4d[_0x5bed1d(0x1f1)],'SKILL.md'),_0x5bed1d(0x1cd)),'version');if(_0xaff6c2!==_0x2bf339[_0x5bed1d(0x1e2)])return{'state':_0x5bed1d(0x1cf),'packageVersion':_0x2bf339['packageVersion'],'skillVersion':_0xaff6c2,'installedPath':_0xaf2b4d[_0x5bed1d(0x1f1)],'repairCommand':REPAIR_COMMAND};const _0x3919a0=listFiles(_0xaf2b4d[_0x5bed1d(0x1f1)]),_0x853995=digestFiles(_0xaf2b4d[_0x5bed1d(0x1f1)],_0x3919a0);return{'state':sameFiles(_0x3919a0,_0x2bf339[_0x5bed1d(0x1e3)]['files'])&&_0x853995===_0x2bf339[_0x5bed1d(0x1e3)][_0x5bed1d(0x1ee)]?_0x5bed1d(0x1e5):_0x5bed1d(0x1d9),'packageVersion':_0x2bf339['packageVersion'],'skillVersion':_0xaff6c2,'installedPath':_0xaf2b4d[_0x5bed1d(0x1f1)],'digest':_0x853995,'repairCommand':REPAIR_COMMAND};}catch(_0x3bdec9){return{'state':_0x5bed1d(0x1f6),'packageVersion':_0x2bf339[_0x5bed1d(0x1db)],'installedPath':_0xaf2b4d[_0x5bed1d(0x1f1)],'reason':_0x3bdec9 instanceof Error?_0x3bdec9[_0x5bed1d(0x1c7)]:String(_0x3bdec9),'repairCommand':REPAIR_COMMAND};}}function failure(_0x8e98dc,_0x24dd51,_0x3bae8d,_0x43d895){const _0x126498=a135_0x50fb5d;return{'ok':![],'code':_0x8e98dc,'packageVersion':_0x24dd51[_0x126498(0x1db)],'skillVersion':_0x24dd51[_0x126498(0x1e2)],'installedPath':_0x43d895,'changed':![],'repairCommand':REPAIR_COMMAND,'error':_0x3bae8d instanceof Error?_0x3bae8d[_0x126498(0x1c7)]:String(_0x3bae8d)};}export function installBuiltinSkill(_0xd1c0d={}){const _0x303306=a135_0x50fb5d,_0x8e29c2=_0xd1c0d[_0x303306(0x1d6)]??DEFAULT_PACKAGE_ROOT,_0x110482=_0xd1c0d[_0x303306(0x1e6)]??homedir();let _0x16939b;try{_0x16939b=readSource(_0x8e29c2);}catch(_0x92d195){return failure(_0x303306(0x1c9),{'packageVersion':_0x303306(0x1d3),'skillVersion':_0x303306(0x1d3)},_0x92d195);}const _0xd79f65=inspectBuiltinSkill({'packageRoot':_0x8e29c2,'home':_0x110482}),_0x58ec79=runNpxSkillsAddGlobal(_0x8e29c2,_0x16939b[_0x303306(0x1ba)],{'stdio':_0xd1c0d[_0x303306(0x1e9)]??_0x303306(0x1dc),'expectedSkillName':SKILL_NAME,'presence':{'home':_0x110482}});if(_0x58ec79['skipped'])return{'ok':!![],'packageVersion':_0x16939b[_0x303306(0x1db)],'skillVersion':_0x16939b[_0x303306(0x1e2)],'installedPath':_0xd79f65['installedPath'],'changed':![],'repairCommand':REPAIR_COMMAND};if(!_0x58ec79['ok'])return failure('INSTALL_FAILED',_0x16939b,_0x58ec79['error']??_0x303306(0x1da)+_0x58ec79[_0x303306(0x1c1)]);const _0x3ccf35=inspectBuiltinSkill({'packageRoot':_0x8e29c2,'home':_0x110482});if(_0x3ccf35[_0x303306(0x1e8)]!==_0x303306(0x1e5))return failure(_0x303306(0x1bd),_0x16939b,_0x3ccf35[_0x303306(0x1f0)]??_0x303306(0x1ca)+_0x3ccf35[_0x303306(0x1e8)],_0x3ccf35[_0x303306(0x1cb)]);return{'ok':!![],'packageVersion':_0x16939b[_0x303306(0x1db)],'skillVersion':_0x16939b[_0x303306(0x1e2)],'installedPath':_0x3ccf35[_0x303306(0x1cb)],'changed':_0xd79f65[_0x303306(0x1e8)]!==_0x303306(0x1e5),'repairCommand':REPAIR_COMMAND};}
1
+ (function(_0x3e6945,_0x30f1d9){const _0x5dcce7=a135_0x2f5e,_0x2cf767=_0x3e6945();while(!![]){try{const _0xa6847d=parseInt(_0x5dcce7(0x1e2))/0x1+-parseInt(_0x5dcce7(0x1ec))/0x2+parseInt(_0x5dcce7(0x200))/0x3+parseInt(_0x5dcce7(0x1d7))/0x4*(-parseInt(_0x5dcce7(0x1d0))/0x5)+-parseInt(_0x5dcce7(0x1de))/0x6+parseInt(_0x5dcce7(0x1e4))/0x7*(parseInt(_0x5dcce7(0x1e0))/0x8)+-parseInt(_0x5dcce7(0x1f4))/0x9;if(_0xa6847d===_0x30f1d9)break;else _0x2cf767['push'](_0x2cf767['shift']());}catch(_0x3c98c6){_0x2cf767['push'](_0x2cf767['shift']());}}}(a135_0x397a,0x5104a));import{createHash}from'node:crypto';function a135_0x397a(){const _0x4d861a=['Symbolic\x20link\x20is\x20not\x20allowed:\x20','skills','version_mismatch','stdio','current','missing','reason','match','15hDcBIr','packageRoot','digest','unknown','skills@latest\x20exited\x20','split','status','448388wdpDRo','message','sort','path','isDirectory','present','sha256','9564YKpmXW','skillVersion','438704DeUoMR','absent','629318Skmaun','every','49OVdqvs','state','hex','trim','packageVersion','name','Installed\x20Skill\x20state\x20is\x20','skipped','990404gTncyP','root','isSymbolicLink','home','length','join','content_mismatch','utf8','4094928JqDEbS','SKILL.md','parse','package.json','manifest','unverifiable','installedPath','version','startsWith','update','error','Unsupported\x20Skill\x20entry:\x20','1820235RBxTYf','includes'];a135_0x397a=function(){return _0x4d861a;};return a135_0x397a();}import{lstatSync,readFileSync,readdirSync}from'node:fs';import{homedir}from'node:os';import{dirname,join,relative,resolve,sep}from'node:path';import{fileURLToPath}from'node:url';import{runNpxSkillsAddGlobal}from'../skills/npx-skills-add.js';import{resolveInstalledSkill}from'../skills/skill-presence.js';const DEFAULT_PACKAGE_ROOT=resolve(dirname(fileURLToPath(import.meta.url)),'..','..'),REPAIR_COMMAND='lovrabet\x20cli-skill\x20install',SKILL_NAME='lovrabet';function frontmatterValue(_0x24e65b,_0x4f7cc9){const _0xc4e926=a135_0x2f5e;return _0x24e65b[_0xc4e926(0x1cf)](new RegExp('^'+_0x4f7cc9+':\x5cs*(.+)$','m'))?.[0x1]?.[_0xc4e926(0x1e7)]()??'';}function listFiles(_0x859aef,_0x294765=_0x859aef){const _0xec9881=a135_0x2f5e;return readdirSync(_0x294765,{'withFileTypes':!![]})['flatMap'](_0x3658c8=>{const _0x44df09=a135_0x2f5e,_0x5e8a82=join(_0x294765,_0x3658c8[_0x44df09(0x1e9)]),_0x18ba23=lstatSync(_0x5e8a82);if(_0x18ba23[_0x44df09(0x1ee)]())throw new Error(_0x44df09(0x202)+_0x5e8a82);if(_0x18ba23[_0x44df09(0x1db)]())return listFiles(_0x859aef,_0x5e8a82);if(!_0x18ba23['isFile']())throw new Error(_0x44df09(0x1ff)+_0x5e8a82);return[relative(_0x859aef,_0x5e8a82)[_0x44df09(0x1d5)](sep)[_0x44df09(0x1f1)]('/')];})[_0xec9881(0x1d9)]((_0x250de0,_0x81f433)=>_0x250de0<_0x81f433?-0x1:_0x250de0>_0x81f433?0x1:0x0);}function digestFiles(_0x4a223b,_0x3171a1){const _0x409151=a135_0x2f5e,_0x95a770=createHash(_0x409151(0x1dd));for(const _0x2ee79d of _0x3171a1){if(_0x2ee79d[_0x409151(0x1fc)]('/')||_0x2ee79d[_0x409151(0x1d5)]('/')[_0x409151(0x201)]('..')||_0x2ee79d[_0x409151(0x201)]('\x5c'))throw new Error('Unsafe\x20manifest\x20path:\x20'+_0x2ee79d);_0x95a770[_0x409151(0x1fd)](_0x2ee79d),_0x95a770[_0x409151(0x1fd)]('\x00'),_0x95a770['update'](readFileSync(join(_0x4a223b,..._0x2ee79d['split']('/')))),_0x95a770[_0x409151(0x1fd)]('\x00');}return _0x95a770[_0x409151(0x1d2)](_0x409151(0x1e6));}function sameFiles(_0xb7a694,_0x1ee81f){const _0x469260=a135_0x2f5e;return _0xb7a694[_0x469260(0x1f0)]===_0x1ee81f[_0x469260(0x1f0)]&&_0xb7a694[_0x469260(0x1e3)]((_0x449711,_0x56e7be)=>_0x449711===_0x1ee81f[_0x56e7be]);}function readSource(_0x283e09){const _0x5aae37=a135_0x2f5e,_0x4aa23e=JSON[_0x5aae37(0x1f6)](readFileSync(join(_0x283e09,_0x5aae37(0x1f7)),_0x5aae37(0x1f3))),_0x3cedca=JSON['parse'](readFileSync(join(_0x283e09,_0x5aae37(0x1c9),'lovrabet.manifest.json'),_0x5aae37(0x1f3))),_0x4190ac=join(_0x283e09,'skills',SKILL_NAME),_0x999f3c=frontmatterValue(readFileSync(join(_0x4190ac,_0x5aae37(0x1f5)),_0x5aae37(0x1f3)),_0x5aae37(0x1fb)),_0x418632=listFiles(_0x4190ac);if(_0x3cedca['schemaVersion']!==0x1||_0x3cedca[_0x5aae37(0x1e9)]!==SKILL_NAME||!_0x4aa23e[_0x5aae37(0x1fb)]||_0x3cedca[_0x5aae37(0x1e8)]!==_0x4aa23e['version']||_0x3cedca[_0x5aae37(0x1df)]!==_0x4aa23e[_0x5aae37(0x1fb)]||_0x999f3c!==_0x4aa23e[_0x5aae37(0x1fb)]||!sameFiles(_0x418632,_0x3cedca['files'])||digestFiles(_0x4190ac,_0x418632)!==_0x3cedca['digest'])throw new Error('Built-in\x20Skill\x20source\x20does\x20not\x20match\x20its\x20package\x20manifest');return{'packageVersion':_0x4aa23e[_0x5aae37(0x1fb)],'skillVersion':_0x999f3c,'root':_0x4190ac,'manifest':_0x3cedca};}function installedSkillPath(_0x1fa1b5){const _0x3e4a2f=a135_0x2f5e,_0x5144df=resolveInstalledSkill(SKILL_NAME,{'home':_0x1fa1b5});if(_0x5144df[_0x3e4a2f(0x1e5)]===_0x3e4a2f(0x1dc))return{'state':_0x3e4a2f(0x1dc),'path':dirname(_0x5144df['path'])};if(_0x5144df[_0x3e4a2f(0x1e5)]===_0x3e4a2f(0x1e1))return{'state':_0x3e4a2f(0x1cd)};return{'state':_0x3e4a2f(0x1f9),'reason':_0x5144df[_0x3e4a2f(0x1ce)]};}export function inspectInstalledBuiltinSkillVersion(_0x4fe757,_0x43eb95={}){const _0x4803ca=a135_0x2f5e,_0x4d5e5b=installedSkillPath(_0x43eb95['home']??homedir());if(_0x4d5e5b[_0x4803ca(0x1e5)]===_0x4803ca(0x1cd))return{'state':_0x4803ca(0x1cd),'expectedVersion':_0x4fe757,'repairCommand':REPAIR_COMMAND};if(_0x4d5e5b[_0x4803ca(0x1e5)]==='unverifiable')return{'state':_0x4803ca(0x1f9),'expectedVersion':_0x4fe757,'reason':_0x4d5e5b[_0x4803ca(0x1ce)],'repairCommand':REPAIR_COMMAND};try{const _0x392954=frontmatterValue(readFileSync(join(_0x4d5e5b['path'],_0x4803ca(0x1f5)),_0x4803ca(0x1f3)),'version');return{'state':_0x392954===_0x4fe757?_0x4803ca(0x1cc):_0x4803ca(0x1ca),'expectedVersion':_0x4fe757,'skillVersion':_0x392954,'installedPath':_0x4d5e5b[_0x4803ca(0x1da)],'repairCommand':REPAIR_COMMAND};}catch(_0x2abd08){return{'state':_0x4803ca(0x1f9),'expectedVersion':_0x4fe757,'installedPath':_0x4d5e5b[_0x4803ca(0x1da)],'reason':_0x2abd08 instanceof Error?_0x2abd08['message']:String(_0x2abd08),'repairCommand':REPAIR_COMMAND};}}export function inspectBuiltinSkill(_0x165f70={}){const _0x246416=a135_0x2f5e,_0x416eb0=_0x165f70['packageRoot']??DEFAULT_PACKAGE_ROOT;let _0x4afda7;try{_0x4afda7=readSource(_0x416eb0);}catch(_0x28ca3c){return{'state':_0x246416(0x1f9),'packageVersion':_0x246416(0x1d3),'reason':_0x28ca3c instanceof Error?_0x28ca3c[_0x246416(0x1d8)]:String(_0x28ca3c),'repairCommand':REPAIR_COMMAND};}const _0x3f0ab3=installedSkillPath(_0x165f70['home']??homedir());if(_0x3f0ab3['state']===_0x246416(0x1cd))return{'state':_0x246416(0x1cd),'packageVersion':_0x4afda7[_0x246416(0x1e8)],'repairCommand':REPAIR_COMMAND};if(_0x3f0ab3[_0x246416(0x1e5)]===_0x246416(0x1f9))return{'state':_0x246416(0x1f9),'packageVersion':_0x4afda7[_0x246416(0x1e8)],'reason':_0x3f0ab3['reason'],'repairCommand':REPAIR_COMMAND};try{const _0x5725c0=frontmatterValue(readFileSync(join(_0x3f0ab3[_0x246416(0x1da)],'SKILL.md'),'utf8'),'version');if(_0x5725c0!==_0x4afda7['skillVersion'])return{'state':_0x246416(0x1ca),'packageVersion':_0x4afda7[_0x246416(0x1e8)],'skillVersion':_0x5725c0,'installedPath':_0x3f0ab3['path'],'repairCommand':REPAIR_COMMAND};const _0x22a983=listFiles(_0x3f0ab3['path']),_0x364904=digestFiles(_0x3f0ab3[_0x246416(0x1da)],_0x22a983);return{'state':sameFiles(_0x22a983,_0x4afda7[_0x246416(0x1f8)]['files'])&&_0x364904===_0x4afda7['manifest'][_0x246416(0x1d2)]?_0x246416(0x1cc):_0x246416(0x1f2),'packageVersion':_0x4afda7[_0x246416(0x1e8)],'skillVersion':_0x5725c0,'installedPath':_0x3f0ab3[_0x246416(0x1da)],'digest':_0x364904,'repairCommand':REPAIR_COMMAND};}catch(_0x3fa259){return{'state':_0x246416(0x1f9),'packageVersion':_0x4afda7[_0x246416(0x1e8)],'installedPath':_0x3f0ab3[_0x246416(0x1da)],'reason':_0x3fa259 instanceof Error?_0x3fa259[_0x246416(0x1d8)]:String(_0x3fa259),'repairCommand':REPAIR_COMMAND};}}function a135_0x2f5e(_0x6282b3,_0x222356){_0x6282b3=_0x6282b3-0x1c9;const _0x397a66=a135_0x397a();let _0x2f5e7d=_0x397a66[_0x6282b3];return _0x2f5e7d;}function failure(_0x566f7a,_0x9b1f5,_0x4120b7,_0x2fa482){const _0x57a38c=a135_0x2f5e;return{'ok':![],'code':_0x566f7a,'packageVersion':_0x9b1f5[_0x57a38c(0x1e8)],'skillVersion':_0x9b1f5['skillVersion'],'installedPath':_0x2fa482,'changed':![],'repairCommand':REPAIR_COMMAND,'error':_0x4120b7 instanceof Error?_0x4120b7[_0x57a38c(0x1d8)]:String(_0x4120b7)};}export function installBuiltinSkill(_0x4c5837={}){const _0x3cc50e=a135_0x2f5e,_0x507509=_0x4c5837[_0x3cc50e(0x1d1)]??DEFAULT_PACKAGE_ROOT,_0x2c6072=_0x4c5837[_0x3cc50e(0x1ef)]??homedir();let _0x1a2090;try{_0x1a2090=readSource(_0x507509);}catch(_0x264804){return failure('SOURCE_INVALID',{'packageVersion':'unknown','skillVersion':_0x3cc50e(0x1d3)},_0x264804);}const _0x4bafac=inspectBuiltinSkill({'packageRoot':_0x507509,'home':_0x2c6072}),_0x1ec9d0=runNpxSkillsAddGlobal(_0x507509,_0x1a2090[_0x3cc50e(0x1ed)],{'stdio':_0x4c5837[_0x3cc50e(0x1cb)]??'pipe','expectedSkillName':SKILL_NAME,'presence':{'home':_0x2c6072}});if(_0x1ec9d0[_0x3cc50e(0x1eb)])return{'ok':!![],'packageVersion':_0x1a2090[_0x3cc50e(0x1e8)],'skillVersion':_0x1a2090[_0x3cc50e(0x1df)],'installedPath':_0x4bafac[_0x3cc50e(0x1fa)],'changed':![],'repairCommand':REPAIR_COMMAND};if(!_0x1ec9d0['ok'])return failure('INSTALL_FAILED',_0x1a2090,_0x1ec9d0[_0x3cc50e(0x1fe)]??_0x3cc50e(0x1d4)+_0x1ec9d0[_0x3cc50e(0x1d6)]);const _0x232230=inspectBuiltinSkill({'packageRoot':_0x507509,'home':_0x2c6072});if(_0x232230[_0x3cc50e(0x1e5)]!==_0x3cc50e(0x1cc))return failure('VERIFY_FAILED',_0x1a2090,_0x232230['reason']??_0x3cc50e(0x1ea)+_0x232230[_0x3cc50e(0x1e5)],_0x232230[_0x3cc50e(0x1fa)]);return{'ok':!![],'packageVersion':_0x1a2090[_0x3cc50e(0x1e8)],'skillVersion':_0x1a2090[_0x3cc50e(0x1df)],'installedPath':_0x232230[_0x3cc50e(0x1fa)],'changed':_0x4bafac['state']!=='current','repairCommand':REPAIR_COMMAND};}
@@ -1 +1 @@
1
- const a136_0x40dc49=a136_0x54a1;(function(_0x224042,_0x47bcf6){const _0xf7097e=a136_0x54a1,_0x15dc45=_0x224042();while(!![]){try{const _0x36bac5=-parseInt(_0xf7097e(0x17d))/0x1+parseInt(_0xf7097e(0x15a))/0x2*(-parseInt(_0xf7097e(0x172))/0x3)+parseInt(_0xf7097e(0x17c))/0x4*(parseInt(_0xf7097e(0x14e))/0x5)+-parseInt(_0xf7097e(0x17f))/0x6+-parseInt(_0xf7097e(0x164))/0x7*(-parseInt(_0xf7097e(0x16f))/0x8)+-parseInt(_0xf7097e(0x162))/0x9*(-parseInt(_0xf7097e(0x14b))/0xa)+parseInt(_0xf7097e(0x15f))/0xb*(parseInt(_0xf7097e(0x161))/0xc);if(_0x36bac5===_0x47bcf6)break;else _0x15dc45['push'](_0x15dc45['shift']());}catch(_0x42a13f){_0x15dc45['push'](_0x15dc45['shift']());}}}(a136_0x3c43,0x5935e));import{execaSync}from'execa';import{LOVRABET_SKILL_SOURCE as a136_0x112132}from'../constant/distribution.js';import{PRODUCT_CONFIG,productEnvName}from'../constant/product.js';import{resolveInstalledSkill}from'../skills/skill-presence.js';export const LOVRABET_SKILL_SOURCE=a136_0x112132;function a136_0x3c43(){const _0x1d14ee=['CHILD_TERMINATED','!\x20Could\x20not\x20verify\x20\x22','Installer\x20reported\x20','12YaTnca','434423dpfmhJ','signal','2494476xjCBgY','34420vrlQVX','state','filter','296710zcExYG','Skill\x20\x22','npm_config_global','absent','ENOENT','SPAWN_FAILED','add','\x20failed\x20target(s)','EACCES','stdout','message','checked','2JfisCH','unknown','skills@latest','warn','stderr','11WvPpmp','npx','12369792VQtQtx','162cHHNYI','failed','14aIAYSU','trim','expectedSkillName','log','pipe','join','skipNpxSkillsEnvSuffix','code','EPERM','internalSkillSource','presence','620176HJMPhh','\x22\x20not\x20found\x20after\x20install\x20(checked\x20','present','630801XIpsWU','CHILD_EXIT_NONZERO','INSTALL_PARTIAL','shortMessage','stdio','reason','exitCode'];a136_0x3c43=function(){return _0x1d14ee;};return a136_0x3c43();}export const LOVRABET_SKILL_GIT_SOURCE=PRODUCT_CONFIG[a136_0x40dc49(0x16d)];export const LOVRABET_GLOBAL_SKILL_NAME=PRODUCT_CONFIG['globalSkillName'];export function resolveGlobalSkillName(_0x416f00){const _0x3d0c6e=a136_0x40dc49;switch(_0x416f00[_0x3d0c6e(0x165)]()){case LOVRABET_SKILL_SOURCE:case LOVRABET_SKILL_GIT_SOURCE:return LOVRABET_GLOBAL_SKILL_NAME;default:return undefined;}}export const LOVRABET_SKIP_NPX_SKILLS_ENV=productEnvName(PRODUCT_CONFIG[a136_0x40dc49(0x16a)]);const CHILD_OUTPUT_MAX_BUFFER=0x10*0x400*0x400;function failure(_0x3d1be1,_0x52137a,_0x467f89){return{'ok':![],'status':_0x52137a,'code':_0x3d1be1,'error':'['+_0x3d1be1+']\x20'+_0x467f89};}export function shouldSkipNpxSkillsAdd(){return process.env[LOVRABET_SKIP_NPX_SKILLS_ENV]==='1';}function a136_0x54a1(_0x4d7b65,_0x4f008e){_0x4d7b65=_0x4d7b65-0x14b;const _0x3c4370=a136_0x3c43();let _0x54a198=_0x3c4370[_0x4d7b65];return _0x54a198;}export function runNpxSkillsAddGlobal(_0x5376f6,_0x5919fc=LOVRABET_SKILL_SOURCE,_0x276052){const _0x1eb5a5=a136_0x40dc49;if(shouldSkipNpxSkillsAdd())return{'ok':!![],'status':0x0,'skipped':!![]};const _0x157ae2=['-y',_0x1eb5a5(0x15c),_0x1eb5a5(0x154),_0x5919fc,'-g','-y'],_0x463497=[_0x1eb5a5(0x160),..._0x157ae2][_0x1eb5a5(0x169)]('\x20');console[_0x1eb5a5(0x167)]('*\x20'+_0x463497);const _0x41a007={...process.env};delete _0x41a007[_0x1eb5a5(0x150)],delete _0x41a007['NPM_CONFIG_GLOBAL'];const _0x24f139=execaSync('npx',_0x157ae2,{'cwd':_0x5376f6,'stdio':_0x1eb5a5(0x168),'env':_0x41a007,'extendEnv':![],'shell':![],'reject':![],'maxBuffer':CHILD_OUTPUT_MAX_BUFFER}),_0x20f3ac=[_0x24f139[_0x1eb5a5(0x157)]?String(_0x24f139[_0x1eb5a5(0x157)]):'',_0x24f139[_0x1eb5a5(0x15e)]?String(_0x24f139[_0x1eb5a5(0x15e)]):''][_0x1eb5a5(0x14d)](Boolean)[_0x1eb5a5(0x169)]('\x0a')[_0x1eb5a5(0x165)](),_0x400164=_0x24f139[_0x1eb5a5(0x178)]??null;_0x276052?.[_0x1eb5a5(0x176)]!==_0x1eb5a5(0x168)&&_0x20f3ac&&console[_0x1eb5a5(0x167)](_0x20f3ac);if(_0x24f139[_0x1eb5a5(0x16b)]){const _0x5e47d4=_0x24f139[_0x1eb5a5(0x16b)]===_0x1eb5a5(0x152)?'NPX_NOT_FOUND':_0x24f139[_0x1eb5a5(0x16b)]===_0x1eb5a5(0x16c)||_0x24f139[_0x1eb5a5(0x16b)]===_0x1eb5a5(0x156)?'PERMISSION_DENIED':_0x1eb5a5(0x153);return failure(_0x5e47d4,_0x400164,_0x24f139[_0x1eb5a5(0x175)]??_0x24f139[_0x1eb5a5(0x158)]??_0x24f139[_0x1eb5a5(0x16b)]);}if(_0x24f139[_0x1eb5a5(0x17e)])return failure(_0x1eb5a5(0x179),_0x400164,'npx\x20terminated\x20by\x20signal\x20'+_0x24f139[_0x1eb5a5(0x17e)]);if(_0x24f139[_0x1eb5a5(0x163)]&&_0x400164===null)return failure(_0x1eb5a5(0x153),_0x400164,_0x24f139[_0x1eb5a5(0x175)]??_0x24f139[_0x1eb5a5(0x158)]??'npx\x20failed\x20to\x20start');if(_0x400164!==0x0)return failure(_0x1eb5a5(0x173),_0x400164,_0x20f3ac||_0x24f139[_0x1eb5a5(0x175)]||'exit\x20'+(_0x400164??_0x1eb5a5(0x15b)));const _0x3af9cf=_0x276052?.[_0x1eb5a5(0x166)]??resolveGlobalSkillName(_0x5919fc),_0x5901d4=_0x3af9cf?resolveInstalledSkill(_0x3af9cf,_0x276052?.[_0x1eb5a5(0x16e)]):undefined,_0x21e42e=_0x20f3ac['match'](/Failed to install\s+(\d+)/i);if(_0x21e42e&&Number(_0x21e42e[0x1])>0x0){const _0x4f5442=_0x1eb5a5(0x17b)+_0x21e42e[0x1]+_0x1eb5a5(0x155)+(_0x20f3ac?':\x0a'+_0x20f3ac:'');if(_0x5901d4?.['state']===_0x1eb5a5(0x171))return console[_0x1eb5a5(0x15d)]('!\x20'+_0x4f5442),{'ok':!![],'status':0x0};return failure(_0x1eb5a5(0x174),0x0,_0x4f5442);}if(_0x3af9cf&&_0x5901d4){if(_0x5901d4[_0x1eb5a5(0x14c)]===_0x1eb5a5(0x151))return failure('SKILL_NOT_INSTALLED',0x0,_0x1eb5a5(0x14f)+_0x3af9cf+_0x1eb5a5(0x170)+_0x5901d4[_0x1eb5a5(0x159)]['join'](',\x20')+')');_0x5901d4[_0x1eb5a5(0x14c)]==='unverifiable'&&console[_0x1eb5a5(0x15d)](_0x1eb5a5(0x17a)+_0x3af9cf+'\x22\x20install\x20state:\x20'+_0x5901d4[_0x1eb5a5(0x177)]);}return{'ok':!![],'status':0x0};}
1
+ function a136_0x4d55(){const _0x7b88d6=['Skill\x20\x22','presence','4078305chlWIu','code','reason','\x22\x20not\x20found\x20after\x20install\x20(checked\x20','expectedSkillName','CHILD_TERMINATED','log','pipe','CHILD_EXIT_NONZERO','SKILL_NOT_INSTALLED','npx\x20terminated\x20by\x20signal\x20','state','skills@latest','INSTALL_PARTIAL','signal','PERMISSION_DENIED','\x22\x20install\x20state:\x20','globalSkillName','stderr','809526AvkPcZ','npm_config_global','shortMessage','message','555344PsvBqM','trim','10MFzUFz','Installer\x20reported\x20','join','warn','840404hBXtjx','!\x20Could\x20not\x20verify\x20\x22','checked','EPERM','2EticWn','exit\x20','stdout','ENOENT','npx\x20failed\x20to\x20start','SPAWN_FAILED','1079064OsGSLr','175599fkPAYf','stdio','unknown','EACCES','npx','NPX_NOT_FOUND','present','unverifiable','\x20failed\x20target(s)','absent','1549098YydfAf'];a136_0x4d55=function(){return _0x7b88d6;};return a136_0x4d55();}const a136_0x5c496b=a136_0x575c;(function(_0xa40a3d,_0x530914){const _0x1ab1d1=a136_0x575c,_0x4a4180=_0xa40a3d();while(!![]){try{const _0x1f617d=parseInt(_0x1ab1d1(0x13c))/0x1*(parseInt(_0x1ab1d1(0x146))/0x2)+-parseInt(_0x1ab1d1(0x138))/0x3+parseInt(_0x1ab1d1(0x142))/0x4+-parseInt(_0x1ab1d1(0x13e))/0x5*(-parseInt(_0x1ab1d1(0x122))/0x6)+-parseInt(_0x1ab1d1(0x125))/0x7+-parseInt(_0x1ab1d1(0x14c))/0x8+parseInt(_0x1ab1d1(0x14d))/0x9;if(_0x1f617d===_0x530914)break;else _0x4a4180['push'](_0x4a4180['shift']());}catch(_0x4c35ad){_0x4a4180['push'](_0x4a4180['shift']());}}}(a136_0x4d55,0x4ca7e));function a136_0x575c(_0x318c66,_0x5e3629){_0x318c66=_0x318c66-0x119;const _0x4d5567=a136_0x4d55();let _0x575c1a=_0x4d5567[_0x318c66];return _0x575c1a;}import{execaSync}from'execa';import{LOVRABET_SKILL_SOURCE as a136_0x3a36d3}from'../constant/distribution.js';import{PRODUCT_CONFIG,productEnvName}from'../constant/product.js';import{resolveInstalledSkill}from'../skills/skill-presence.js';export const LOVRABET_SKILL_SOURCE=a136_0x3a36d3;export const LOVRABET_SKILL_GIT_SOURCE=PRODUCT_CONFIG['internalSkillSource'];export const LOVRABET_GLOBAL_SKILL_NAME=PRODUCT_CONFIG[a136_0x5c496b(0x136)];export function resolveGlobalSkillName(_0x2c6fbf){const _0x16b602=a136_0x5c496b;switch(_0x2c6fbf[_0x16b602(0x13d)]()){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(_0x339306,_0x582577,_0x3197d6){return{'ok':![],'status':_0x582577,'code':_0x339306,'error':'['+_0x339306+']\x20'+_0x3197d6};}export function shouldSkipNpxSkillsAdd(){return process.env[LOVRABET_SKIP_NPX_SKILLS_ENV]==='1';}export function runNpxSkillsAddGlobal(_0x43a86c,_0x2d0933=LOVRABET_SKILL_SOURCE,_0x511e0f){const _0x27fef8=a136_0x5c496b;if(shouldSkipNpxSkillsAdd())return{'ok':!![],'status':0x0,'skipped':!![]};const _0x47baa1=['-y',_0x27fef8(0x131),'add',_0x2d0933,'-g','-y'],_0x574c51=[_0x27fef8(0x11c),..._0x47baa1][_0x27fef8(0x140)]('\x20');console[_0x27fef8(0x12b)]('*\x20'+_0x574c51);const _0x4f21e9={...process.env};delete _0x4f21e9[_0x27fef8(0x139)],delete _0x4f21e9['NPM_CONFIG_GLOBAL'];const _0x401694=execaSync('npx',_0x47baa1,{'cwd':_0x43a86c,'stdio':'pipe','env':_0x4f21e9,'extendEnv':![],'shell':![],'reject':![],'maxBuffer':CHILD_OUTPUT_MAX_BUFFER}),_0x26e3c7=[_0x401694[_0x27fef8(0x148)]?String(_0x401694['stdout']):'',_0x401694[_0x27fef8(0x137)]?String(_0x401694['stderr']):'']['filter'](Boolean)[_0x27fef8(0x140)]('\x0a')['trim'](),_0x274363=_0x401694['exitCode']??null;_0x511e0f?.[_0x27fef8(0x119)]!==_0x27fef8(0x12c)&&_0x26e3c7&&console[_0x27fef8(0x12b)](_0x26e3c7);if(_0x401694[_0x27fef8(0x126)]){const _0x3c3b62=_0x401694[_0x27fef8(0x126)]===_0x27fef8(0x149)?_0x27fef8(0x11d):_0x401694[_0x27fef8(0x126)]===_0x27fef8(0x145)||_0x401694[_0x27fef8(0x126)]===_0x27fef8(0x11b)?_0x27fef8(0x134):_0x27fef8(0x14b);return failure(_0x3c3b62,_0x274363,_0x401694[_0x27fef8(0x13a)]??_0x401694['message']??_0x401694[_0x27fef8(0x126)]);}if(_0x401694[_0x27fef8(0x133)])return failure(_0x27fef8(0x12a),_0x274363,_0x27fef8(0x12f)+_0x401694[_0x27fef8(0x133)]);if(_0x401694['failed']&&_0x274363===null)return failure(_0x27fef8(0x14b),_0x274363,_0x401694[_0x27fef8(0x13a)]??_0x401694[_0x27fef8(0x13b)]??_0x27fef8(0x14a));if(_0x274363!==0x0)return failure(_0x27fef8(0x12d),_0x274363,_0x26e3c7||_0x401694['shortMessage']||_0x27fef8(0x147)+(_0x274363??_0x27fef8(0x11a)));const _0x621615=_0x511e0f?.[_0x27fef8(0x129)]??resolveGlobalSkillName(_0x2d0933),_0x180f87=_0x621615?resolveInstalledSkill(_0x621615,_0x511e0f?.[_0x27fef8(0x124)]):undefined,_0x538265=_0x26e3c7['match'](/Failed to install\s+(\d+)/i);if(_0x538265&&Number(_0x538265[0x1])>0x0){const _0x400e5b=_0x27fef8(0x13f)+_0x538265[0x1]+_0x27fef8(0x120)+(_0x26e3c7?':\x0a'+_0x26e3c7:'');if(_0x180f87?.[_0x27fef8(0x130)]===_0x27fef8(0x11e))return console[_0x27fef8(0x141)]('!\x20'+_0x400e5b),{'ok':!![],'status':0x0};return failure(_0x27fef8(0x132),0x0,_0x400e5b);}if(_0x621615&&_0x180f87){if(_0x180f87[_0x27fef8(0x130)]===_0x27fef8(0x121))return failure(_0x27fef8(0x12e),0x0,_0x27fef8(0x123)+_0x621615+_0x27fef8(0x128)+_0x180f87[_0x27fef8(0x144)][_0x27fef8(0x140)](',\x20')+')');_0x180f87[_0x27fef8(0x130)]===_0x27fef8(0x11f)&&console[_0x27fef8(0x141)](_0x27fef8(0x143)+_0x621615+_0x27fef8(0x135)+_0x180f87[_0x27fef8(0x127)]);}return{'ok':!![],'status':0x0};}
@@ -1 +1 @@
1
- const a137_0x254896=a137_0xbc9e;function a137_0xbc9e(_0x193a07,_0x3bb74e){_0x193a07=_0x193a07-0xf3;const _0x50ebbc=a137_0x50eb();let _0xbc9e26=_0x50ebbc[_0x193a07];return _0xbc9e26;}(function(_0x327d39,_0x27396a){const _0x48f123=a137_0xbc9e,_0x1649e6=_0x327d39();while(!![]){try{const _0x22a57b=-parseInt(_0x48f123(0x104))/0x1*(parseInt(_0x48f123(0xff))/0x2)+parseInt(_0x48f123(0x10b))/0x3*(parseInt(_0x48f123(0xf3))/0x4)+-parseInt(_0x48f123(0x106))/0x5*(parseInt(_0x48f123(0x108))/0x6)+-parseInt(_0x48f123(0x10a))/0x7+parseInt(_0x48f123(0xfe))/0x8*(-parseInt(_0x48f123(0xf9))/0x9)+parseInt(_0x48f123(0xfb))/0xa*(parseInt(_0x48f123(0xfc))/0xb)+-parseInt(_0x48f123(0x105))/0xc*(-parseInt(_0x48f123(0x103))/0xd);if(_0x22a57b===_0x27396a)break;else _0x1649e6['push'](_0x1649e6['shift']());}catch(_0x2c94ae){_0x1649e6['push'](_0x1649e6['shift']());}}}(a137_0x50eb,0x80d87));export const METADATA_FILE='lovrabet.skill.json';export const SKILL_FILE=a137_0x254896(0x102);export const IGNORED_FILE_NAMES=new Set([METADATA_FILE,a137_0x254896(0xfd)]);export const IGNORED_DIR_NAMES=new Set([a137_0x254896(0x109),a137_0x254896(0xf8),a137_0x254896(0xf5),a137_0x254896(0xfa),a137_0x254896(0xf6),a137_0x254896(0x107),a137_0x254896(0x100),a137_0x254896(0xf4),a137_0x254896(0xf7),a137_0x254896(0x101)]);function a137_0x50eb(){const _0x1ebbdd=['488VopzoP','coverage','.svn','.next','.turbo','.hg','9NqUWgI','node_modules','10ZaEBYC','8461255aHWBEe','.DS_Store','3411896uQQRhU','2CfcCpb','build','.cache','SKILL.md','13qfUzSn','960229HkUhJw','25642464PRDdJb','790975RHqXJS','dist','24zXxYKi','.git','3894436ZIfkBj','4857FSYLAq'];a137_0x50eb=function(){return _0x1ebbdd;};return a137_0x50eb();}
1
+ const a137_0x2b3601=a137_0x4817;(function(_0x101e96,_0x5914fe){const _0x37ce62=a137_0x4817,_0x3ea6ae=_0x101e96();while(!![]){try{const _0x45bc31=-parseInt(_0x37ce62(0x17b))/0x1+-parseInt(_0x37ce62(0x170))/0x2+parseInt(_0x37ce62(0x17c))/0x3*(parseInt(_0x37ce62(0x16e))/0x4)+parseInt(_0x37ce62(0x171))/0x5+parseInt(_0x37ce62(0x177))/0x6*(parseInt(_0x37ce62(0x174))/0x7)+parseInt(_0x37ce62(0x172))/0x8+parseInt(_0x37ce62(0x17e))/0x9;if(_0x45bc31===_0x5914fe)break;else _0x3ea6ae['push'](_0x3ea6ae['shift']());}catch(_0x470b16){_0x3ea6ae['push'](_0x3ea6ae['shift']());}}}(a137_0x7d1d,0x892d7));function a137_0x4817(_0x34b6c5,_0x1e3520){_0x34b6c5=_0x34b6c5-0x16d;const _0x7d1de4=a137_0x7d1d();let _0x4817e2=_0x7d1de4[_0x34b6c5];return _0x4817e2;}export const METADATA_FILE='lovrabet.skill.json';function a137_0x7d1d(){const _0x3eb8e5=['build','node_modules','.cache','723733ZPafta','3UhpEWe','.svn','7037694eqYNQc','.DS_Store','.git','851348AJfSis','SKILL.md','1708094AaDKsg','344320wDzkzk','4428936ruhJDb','.hg','243775ShqvGF','dist','coverage','90osmBXr'];a137_0x7d1d=function(){return _0x3eb8e5;};return a137_0x7d1d();}export const SKILL_FILE=a137_0x2b3601(0x16f);export const IGNORED_FILE_NAMES=new Set([METADATA_FILE,a137_0x2b3601(0x17f)]);export const IGNORED_DIR_NAMES=new Set([a137_0x2b3601(0x16d),a137_0x2b3601(0x173),a137_0x2b3601(0x17d),a137_0x2b3601(0x179),'.next',a137_0x2b3601(0x175),a137_0x2b3601(0x178),a137_0x2b3601(0x176),'.turbo',a137_0x2b3601(0x17a)]);
@@ -1 +1 @@
1
- (function(_0x543e83,_0x1cf9b3){const _0x132bb4=a138_0xcecd,_0xddcd26=_0x543e83();while(!![]){try{const _0x3536ff=parseInt(_0x132bb4(0xdb))/0x1*(-parseInt(_0x132bb4(0xd8))/0x2)+parseInt(_0x132bb4(0xd9))/0x3*(parseInt(_0x132bb4(0xeb))/0x4)+parseInt(_0x132bb4(0xd7))/0x5*(parseInt(_0x132bb4(0xdc))/0x6)+parseInt(_0x132bb4(0xda))/0x7*(parseInt(_0x132bb4(0xe3))/0x8)+-parseInt(_0x132bb4(0xe1))/0x9+-parseInt(_0x132bb4(0xdf))/0xa+parseInt(_0x132bb4(0xde))/0xb*(parseInt(_0x132bb4(0xdd))/0xc);if(_0x3536ff===_0x1cf9b3)break;else _0xddcd26['push'](_0xddcd26['shift']());}catch(_0x25cc39){_0xddcd26['push'](_0xddcd26['shift']());}}}(a138_0x686a,0x7940a));import{lstatSync,readlinkSync,realpathSync,renameSync,rmSync,writeFileSync}from'node:fs';import{dirname,isAbsolute,resolve,sep}from'node:path';import{CliErrors}from'../../errors.js';import{normalizeSkillRelativePath}from'./local-files.js';export function resolveManagedFilePath(_0x139868,_0x1e39f8){const _0x2b4701=a138_0xcecd,_0x369a34=normalizeSkillRelativePath(_0x1e39f8),_0x5ae2bb=realOrResolved(_0x139868),_0xa85693=resolve(_0x5ae2bb,..._0x369a34['split']('/'));if(!isPathInside(_0xa85693,_0x5ae2bb))throw CliErrors[_0x2b4701(0xea)](_0x2b4701(0xe4)+_0x1e39f8);return ensureNoSymlinkInManagedPath(_0x5ae2bb,_0x369a34),_0xa85693;}export function ensureNoSymlinkInManagedPath(_0xe102b5,_0xe0ab1b){const _0x6526ab=a138_0xcecd;let _0xdc296e=_0xe102b5;for(const _0x2b2764 of _0xe0ab1b[_0x6526ab(0xe7)]('/')){_0xdc296e=resolve(_0xdc296e,_0x2b2764);const _0x59e1c8=lstatIfPresent(_0xdc296e);if(_0x59e1c8?.[_0x6526ab(0xe0)]())throw CliErrors[_0x6526ab(0xea)]('Refusing\x20to\x20write\x20through\x20Skill\x20symlink\x20path:\x20'+_0xe0ab1b);}}export function isDanglingSymlink(_0x5775cf){const _0x124583=a138_0xcecd;try{return lstatSync(_0x5775cf)[_0x124583(0xe0)]();}catch{return![];}}function a138_0xcecd(_0x56109e,_0x319eb8){_0x56109e=_0x56109e-0xd7;const _0x686a08=a138_0x686a();let _0xcecdfe=_0x686a08[_0x56109e];return _0xcecdfe;}function a138_0x686a(){const _0x8df653=['3jqYsxd','5449591EALMHv','7002qRfYSp','18cqMyCt','12JkaXKk','881551emDMaR','4449170OoueBu','isSymbolicLink','1636443XkZPPF','startsWith','8YozIxE','Unsafe\x20Skill\x20file\x20path:\x20','endsWith','.tmp','split','from','stringify','validation','1645208IXokrY','utf8','899390NruLnM','196VIJdmR'];a138_0x686a=function(){return _0x8df653;};return a138_0x686a();}export function resolveSymlinkTarget(_0x196c63){const _0x31029e=readlinkSync(_0x196c63);return isAbsolute(_0x31029e)?_0x31029e:resolve(dirname(_0x196c63),_0x31029e);}export function isPathInside(_0xf8e0f2,_0x17983e){const _0x55ebd8=a138_0xcecd,_0x3e96b6=_0xf8e0f2['endsWith'](sep)?_0xf8e0f2:''+_0xf8e0f2+sep,_0x3f6028=_0x17983e[_0x55ebd8(0xe5)](sep)?_0x17983e:''+_0x17983e+sep;return _0xf8e0f2===_0x17983e||_0x3e96b6[_0x55ebd8(0xe2)](_0x3f6028);}export function realOrResolved(_0x12afad){try{return realpathSync(_0x12afad);}catch{return resolve(_0x12afad);}}export function lstatIfPresent(_0x290ab8){try{return lstatSync(_0x290ab8);}catch{return undefined;}}export function writeTextAtomic(_0x5847d2,_0x56296c,_0x1bd67a){const _0x26cff4=a138_0xcecd;writeBytesAtomic(_0x5847d2,Buffer[_0x26cff4(0xe8)](_0x56296c,_0x26cff4(0xec)),_0x1bd67a);}export function writeBytesAtomic(_0xe94b21,_0x4de70a,_0x4c923e){const _0x1c562c=a138_0xcecd,_0x58a801=_0xe94b21+_0x1c562c(0xe6);try{writeFileSync(_0x58a801,_0x4de70a,{'mode':_0x4c923e}),renameSync(_0x58a801,_0xe94b21);}catch(_0x3687b7){try{rmSync(_0x58a801,{'force':!![]});}catch{}throw _0x3687b7;}}export function writeJsonAtomic(_0x447193,_0x55b27a){const _0x424f0a=a138_0xcecd;writeTextAtomic(_0x447193,JSON[_0x424f0a(0xe9)](_0x55b27a,null,0x2)+'\x0a',0x180);}
1
+ (function(_0xa8f9c9,_0x2a5008){const _0x549775=a138_0x2afa,_0x5860a9=_0xa8f9c9();while(!![]){try{const _0xfb081=-parseInt(_0x549775(0xd5))/0x1*(parseInt(_0x549775(0xc5))/0x2)+parseInt(_0x549775(0xd2))/0x3*(parseInt(_0x549775(0xd0))/0x4)+parseInt(_0x549775(0xca))/0x5*(-parseInt(_0x549775(0xc9))/0x6)+parseInt(_0x549775(0xd7))/0x7+-parseInt(_0x549775(0xcf))/0x8+-parseInt(_0x549775(0xd9))/0x9+-parseInt(_0x549775(0xce))/0xa*(-parseInt(_0x549775(0xc7))/0xb);if(_0xfb081===_0x2a5008)break;else _0x5860a9['push'](_0x5860a9['shift']());}catch(_0x5a24e3){_0x5860a9['push'](_0x5860a9['shift']());}}}(a138_0x110c,0x82875));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(_0x5b5f3a,_0x3a62bd){const _0x1d37e5=a138_0x2afa,_0x5b21fb=normalizeSkillRelativePath(_0x3a62bd),_0x56ffa4=realOrResolved(_0x5b5f3a),_0x17d46d=resolve(_0x56ffa4,..._0x5b21fb[_0x1d37e5(0xd8)]('/'));if(!isPathInside(_0x17d46d,_0x56ffa4))throw CliErrors[_0x1d37e5(0xcd)](_0x1d37e5(0xc8)+_0x3a62bd);return ensureNoSymlinkInManagedPath(_0x56ffa4,_0x5b21fb),_0x17d46d;}export function ensureNoSymlinkInManagedPath(_0x180cc5,_0x1f9965){const _0x3399ed=a138_0x2afa;let _0x2a83a8=_0x180cc5;for(const _0x358528 of _0x1f9965[_0x3399ed(0xd8)]('/')){_0x2a83a8=resolve(_0x2a83a8,_0x358528);const _0xd0c58b=lstatIfPresent(_0x2a83a8);if(_0xd0c58b?.[_0x3399ed(0xd6)]())throw CliErrors[_0x3399ed(0xcd)](_0x3399ed(0xd3)+_0x1f9965);}}export function isDanglingSymlink(_0x4cf3cd){const _0x5d3b2a=a138_0x2afa;try{return lstatSync(_0x4cf3cd)[_0x5d3b2a(0xd6)]();}catch{return![];}}function a138_0x110c(){const _0x17cabf=['422789IUTjVv','isSymbolicLink','2486911fRuJaI','split','22293KcQmKv','4fZqwon','endsWith','77BuQRXi','Unsafe\x20Skill\x20file\x20path:\x20','12Cwghdk','331845AUlMHN','.tmp','from','validation','1812950CkyNtv','6473512wggwMP','38372ATgfoY','utf8','219aFCpjL','Refusing\x20to\x20write\x20through\x20Skill\x20symlink\x20path:\x20','startsWith'];a138_0x110c=function(){return _0x17cabf;};return a138_0x110c();}export function resolveSymlinkTarget(_0x52c80d){const _0x413d24=readlinkSync(_0x52c80d);return isAbsolute(_0x413d24)?_0x413d24:resolve(dirname(_0x52c80d),_0x413d24);}export function isPathInside(_0x58b282,_0x558635){const _0x3afffa=a138_0x2afa,_0x5883b=_0x58b282[_0x3afffa(0xc6)](sep)?_0x58b282:''+_0x58b282+sep,_0x2c1720=_0x558635['endsWith'](sep)?_0x558635:''+_0x558635+sep;return _0x58b282===_0x558635||_0x5883b[_0x3afffa(0xd4)](_0x2c1720);}function a138_0x2afa(_0x5aae21,_0x4f895d){_0x5aae21=_0x5aae21-0xc5;const _0x110cde=a138_0x110c();let _0x2afa6d=_0x110cde[_0x5aae21];return _0x2afa6d;}export function realOrResolved(_0x4b042b){try{return realpathSync(_0x4b042b);}catch{return resolve(_0x4b042b);}}export function lstatIfPresent(_0x43899d){try{return lstatSync(_0x43899d);}catch{return undefined;}}export function writeTextAtomic(_0x408533,_0x119820,_0x366c2d){const _0x567cfe=a138_0x2afa;writeBytesAtomic(_0x408533,Buffer[_0x567cfe(0xcc)](_0x119820,_0x567cfe(0xd1)),_0x366c2d);}export function writeBytesAtomic(_0x3409c9,_0x344c9a,_0xee711d){const _0x3a0ac3=a138_0x2afa,_0x707c3f=_0x3409c9+_0x3a0ac3(0xcb);try{writeFileSync(_0x707c3f,_0x344c9a,{'mode':_0xee711d}),renameSync(_0x707c3f,_0x3409c9);}catch(_0x235519){try{rmSync(_0x707c3f,{'force':!![]});}catch{}throw _0x235519;}}export function writeJsonAtomic(_0x2a05ac,_0x41aa65){writeTextAtomic(_0x2a05ac,JSON['stringify'](_0x41aa65,null,0x2)+'\x0a',0x180);}
@@ -1 +1 @@
1
- (function(_0x4b5eb4,_0x3e3c5c){const _0x36d3d0=a139_0x3e59,_0x4d6d05=_0x4b5eb4();while(!![]){try{const _0x2310a1=parseInt(_0x36d3d0(0xeb))/0x1+-parseInt(_0x36d3d0(0xef))/0x2*(-parseInt(_0x36d3d0(0xe8))/0x3)+parseInt(_0x36d3d0(0xf0))/0x4+-parseInt(_0x36d3d0(0xee))/0x5+-parseInt(_0x36d3d0(0xf1))/0x6+-parseInt(_0x36d3d0(0xe9))/0x7*(-parseInt(_0x36d3d0(0xed))/0x8)+-parseInt(_0x36d3d0(0xec))/0x9;if(_0x2310a1===_0x3e3c5c)break;else _0x4d6d05['push'](_0x4d6d05['shift']());}catch(_0x5eca4e){_0x4d6d05['push'](_0x4d6d05['shift']());}}}(a139_0x23d0,0x2de77));import{createHash}from'node:crypto';function a139_0x23d0(){const _0x22a959=['468174rsdGSd','path','digest','sha256','update','765987IkaXOg','14NxqAVa','hex','97106DLvIWR','1192833FvsmNm','670936dfyjTi','739470YgkRoJ','2VHBCgx','105256CLIHiZ'];a139_0x23d0=function(){return _0x22a959;};return a139_0x23d0();}import{fileContent,normalizeManifestFiles}from'./local-files.js';export function contentHash(_0xdd26ea){const _0x35417b=a139_0x3e59;return createHash('sha256')['update'](_0xdd26ea)[_0x35417b(0xf3)](_0x35417b(0xea));}export function fileHash(_0x44eeab){return bufferSha256(fileContent(_0x44eeab));}function a139_0x3e59(_0x51a173,_0x598d9d){_0x51a173=_0x51a173-0xe6;const _0x23d036=a139_0x23d0();let _0x3e59a0=_0x23d036[_0x51a173];return _0x3e59a0;}export function bufferSha256(_0x266167){const _0x1aaccd=a139_0x3e59;return createHash(_0x1aaccd(0xe6))[_0x1aaccd(0xe7)](_0x266167)[_0x1aaccd(0xf3)](_0x1aaccd(0xea));}export function fileTreeHash(_0x4300b8){const _0x53819a=a139_0x3e59,_0x3c8a5b=createHash('sha256');for(const _0x2b3d59 of normalizeManifestFiles(_0x4300b8)){_0x3c8a5b[_0x53819a(0xe7)](_0x2b3d59[_0x53819a(0xf2)]),_0x3c8a5b[_0x53819a(0xe7)]('\x00'),_0x3c8a5b[_0x53819a(0xe7)](_0x2b3d59['sha256']),_0x3c8a5b[_0x53819a(0xe7)]('\x00'),_0x3c8a5b[_0x53819a(0xe7)](String(_0x2b3d59['size'])),_0x3c8a5b['update']('\x00');}return _0x3c8a5b[_0x53819a(0xf3)](_0x53819a(0xea));}
1
+ function a139_0x2fd4(){const _0x40bf84=['update','6429534oRwnIZ','36toqEim','size','sha256','digest','1157846BxMmfT','144EgYiON','1296320pukmny','63NfyDUF','2135796qstslJ','3795519QsNTCF','10549hLNTLU','940575ZwPDGY'];a139_0x2fd4=function(){return _0x40bf84;};return a139_0x2fd4();}(function(_0x1bbdfa,_0xe0db5d){const _0x10ce7b=a139_0x4dc2,_0x4cddb9=_0x1bbdfa();while(!![]){try{const _0x6aec99=-parseInt(_0x10ce7b(0x76))/0x1+parseInt(_0x10ce7b(0x6c))/0x2+parseInt(_0x10ce7b(0x6d))/0x3+-parseInt(_0x10ce7b(0x72))/0x4*(-parseInt(_0x10ce7b(0x6f))/0x5)+-parseInt(_0x10ce7b(0x71))/0x6+-parseInt(_0x10ce7b(0x6e))/0x7*(-parseInt(_0x10ce7b(0x77))/0x8)+-parseInt(_0x10ce7b(0x6b))/0x9*(parseInt(_0x10ce7b(0x6a))/0xa);if(_0x6aec99===_0xe0db5d)break;else _0x4cddb9['push'](_0x4cddb9['shift']());}catch(_0x168ac6){_0x4cddb9['push'](_0x4cddb9['shift']());}}}(a139_0x2fd4,0xdfb95));import{createHash}from'node:crypto';import{fileContent,normalizeManifestFiles}from'./local-files.js';export function contentHash(_0xc70c5b){const _0xd185e9=a139_0x4dc2;return createHash(_0xd185e9(0x74))[_0xd185e9(0x70)](_0xc70c5b)[_0xd185e9(0x75)]('hex');}export function fileHash(_0x1a9c64){return bufferSha256(fileContent(_0x1a9c64));}export function bufferSha256(_0x28eefe){const _0x10fac2=a139_0x4dc2;return createHash('sha256')[_0x10fac2(0x70)](_0x28eefe)['digest']('hex');}function a139_0x4dc2(_0x57086d,_0x198725){_0x57086d=_0x57086d-0x6a;const _0x2fd4ce=a139_0x2fd4();let _0x4dc2d4=_0x2fd4ce[_0x57086d];return _0x4dc2d4;}export function fileTreeHash(_0xcd7e6){const _0x921c05=a139_0x4dc2,_0x1b9770=createHash(_0x921c05(0x74));for(const _0xc03be8 of normalizeManifestFiles(_0xcd7e6)){_0x1b9770[_0x921c05(0x70)](_0xc03be8['path']),_0x1b9770[_0x921c05(0x70)]('\x00'),_0x1b9770[_0x921c05(0x70)](_0xc03be8[_0x921c05(0x74)]),_0x1b9770[_0x921c05(0x70)]('\x00'),_0x1b9770[_0x921c05(0x70)](String(_0xc03be8[_0x921c05(0x73)])),_0x1b9770[_0x921c05(0x70)]('\x00');}return _0x1b9770[_0x921c05(0x75)]('hex');}
@@ -1 +1 @@
1
- const a140_0x3eb2bb=a140_0x5a63;(function(_0x20c10a,_0x599182){const _0x2963d1=a140_0x5a63,_0x13945f=_0x20c10a();while(!![]){try{const _0x1bccbe=-parseInt(_0x2963d1(0x1d7))/0x1*(-parseInt(_0x2963d1(0x1d3))/0x2)+parseInt(_0x2963d1(0x1ce))/0x3+-parseInt(_0x2963d1(0x1d2))/0x4+-parseInt(_0x2963d1(0x1d1))/0x5+-parseInt(_0x2963d1(0x1cf))/0x6+parseInt(_0x2963d1(0x1d6))/0x7*(parseInt(_0x2963d1(0x1ca))/0x8)+-parseInt(_0x2963d1(0x1d0))/0x9*(-parseInt(_0x2963d1(0x1d4))/0xa);if(_0x1bccbe===_0x599182)break;else _0x13945f['push'](_0x13945f['shift']());}catch(_0x50b7bc){_0x13945f['push'](_0x13945f['shift']());}}}(a140_0x7982,0xbe2db));import{resolve}from'node:path';import{resolveSkillSyncPaths,runtimeAgentSkillRoots,safePathSegment}from'./paths.js';function a140_0x7982(){const _0x465739=['890nnlHNG','freeze','3466855TyHqgN','1dKDdhb','skills','.agents','cwd','8UnMJBP','appCode','project','global','1320498svInXO','4034802CVBtbb','132903mTuTEe','1595825jWTRSs','4668640llvOqj','1376138kPaSsY'];a140_0x7982=function(){return _0x465739;};return a140_0x7982();}function a140_0x5a63(_0x59f6eb,_0x11108c){_0x59f6eb=_0x59f6eb-0x1ca;const _0x798233=a140_0x7982();let _0x5a63da=_0x798233[_0x59f6eb];return _0x5a63da;}export function resolveRuntimeSkillInstallTarget(_0x435a88,_0x16b3d3=a140_0x3eb2bb(0x1cd),_0x3b8b63={}){const _0x104e62=a140_0x3eb2bb,_0x2e1b71=resolveSkillSyncPaths(_0x3b8b63),_0x27b762=safePathSegment(_0x435a88,_0x104e62(0x1cb)),_0x4c5e2e=_0x16b3d3===_0x104e62(0x1cc)?[resolve(_0x3b8b63[_0x104e62(0x1da)]??process['cwd'](),_0x104e62(0x1d9),_0x104e62(0x1d8))]:runtimeAgentSkillRoots(_0x2e1b71);return Object['freeze']({'scope':_0x16b3d3,'appCode':_0x27b762,'skillRoots':Object[_0x104e62(0x1d5)](_0x4c5e2e),'managedRoot':_0x2e1b71['managedRoot']});}
1
+ function a140_0x3442(_0xb06847,_0x5a5d7c){_0xb06847=_0xb06847-0x66;const _0x463d16=a140_0x463d();let _0x34422c=_0x463d16[_0xb06847];return _0x34422c;}(function(_0x54f62a,_0x37dd07){const _0x508a3a=a140_0x3442,_0xdebff5=_0x54f62a();while(!![]){try{const _0x46847a=-parseInt(_0x508a3a(0x6c))/0x1*(parseInt(_0x508a3a(0x70))/0x2)+parseInt(_0x508a3a(0x76))/0x3*(parseInt(_0x508a3a(0x6e))/0x4)+parseInt(_0x508a3a(0x68))/0x5*(-parseInt(_0x508a3a(0x67))/0x6)+-parseInt(_0x508a3a(0x78))/0x7+parseInt(_0x508a3a(0x73))/0x8*(-parseInt(_0x508a3a(0x69))/0x9)+-parseInt(_0x508a3a(0x6d))/0xa*(-parseInt(_0x508a3a(0x75))/0xb)+parseInt(_0x508a3a(0x77))/0xc*(-parseInt(_0x508a3a(0x72))/0xd);if(_0x46847a===_0x37dd07)break;else _0xdebff5['push'](_0xdebff5['shift']());}catch(_0x1ae3e6){_0xdebff5['push'](_0xdebff5['shift']());}}}(a140_0x463d,0x34290));import{resolve}from'node:path';import{resolveSkillSyncPaths,runtimeAgentSkillRoots,safePathSegment}from'./paths.js';export function resolveRuntimeSkillInstallTarget(_0x5a6a5a,_0x12b28e='global',_0x550442={}){const _0x4f9273=a140_0x3442,_0x2cd1c5=resolveSkillSyncPaths(_0x550442),_0x3f472d=safePathSegment(_0x5a6a5a,_0x4f9273(0x71)),_0x391c40=_0x12b28e==='project'?[resolve(_0x550442[_0x4f9273(0x6f)]??process[_0x4f9273(0x6f)](),_0x4f9273(0x66),_0x4f9273(0x6a))]:runtimeAgentSkillRoots(_0x2cd1c5);return Object[_0x4f9273(0x6b)]({'scope':_0x12b28e,'appCode':_0x3f472d,'skillRoots':Object[_0x4f9273(0x6b)](_0x391c40),'managedRoot':_0x2cd1c5[_0x4f9273(0x74)]});}function a140_0x463d(){const _0x13ebbe=['2082213zoagGb','skills','freeze','34ZDQzSy','392790ucHJKV','4piYMVB','cwd','5416PwmVMq','appCode','257062YwpJpt','8jHBRHe','managedRoot','99jeLZSC','804639ZEeQzL','24levABc','61446UteqwA','.agents','18WOalaf','60535xsSjwv'];a140_0x463d=function(){return _0x13ebbe;};return a140_0x463d();}
@@ -1 +1 @@
1
- const a141_0x33b670=a141_0x14f2;(function(_0x2eabba,_0x4f8488){const _0x5762de=a141_0x14f2,_0x178157=_0x2eabba();while(!![]){try{const _0x46506e=-parseInt(_0x5762de(0x9f))/0x1*(parseInt(_0x5762de(0xb7))/0x2)+-parseInt(_0x5762de(0xa1))/0x3+-parseInt(_0x5762de(0xc7))/0x4+-parseInt(_0x5762de(0x9b))/0x5+parseInt(_0x5762de(0xab))/0x6+-parseInt(_0x5762de(0xa5))/0x7*(-parseInt(_0x5762de(0xb1))/0x8)+parseInt(_0x5762de(0xb2))/0x9;if(_0x46506e===_0x4f8488)break;else _0x178157['push'](_0x178157['shift']());}catch(_0x59f6e1){_0x178157['push'](_0x178157['shift']());}}}(a141_0x3df8,0x9971d));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import a141_0x50d24e from'fs-extra';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';import{isDanglingSymlink,isPathInside,lstatIfPresent,realOrResolved,resolveSymlinkTarget}from'./fs-utils.js';import{readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillCacheRoot,resolveSkillSyncPaths,safePathSegment}from'./paths.js';const {copySync,ensureDirSync,removeSync}=a141_0x50d24e,RESERVED_PROJECT_SKILL_CODES=new Set([a141_0x33b670(0xa6),a141_0x33b670(0xc4),a141_0x33b670(0xbc)]);export function linkEffectiveRuntimeSkills(_0x57cb8c,_0x31057a){const _0x1c77fd=a141_0x33b670,_0x256639=new Map();for(const _0x3874b3 of _0x57cb8c){const _0x316008=_0x3874b3['skill'][_0x1c77fd(0xcf)];if(!_0x316008)continue;const _0x3164a1=_0x256639[_0x1c77fd(0xa4)](_0x316008);(!_0x3164a1||_0x3874b3['scope']===_0x1c77fd(0xc8))&&_0x256639[_0x1c77fd(0xa8)](_0x316008,_0x3874b3);}const _0x21bfba=[];for(const _0x4d107d of _0x256639['values']()){const _0x1a150b=requireSkillCode(_0x4d107d[_0x1c77fd(0xc1)]),_0x3b5ada=readMetadataIfPresent(_0x4d107d[_0x1c77fd(0xad)]);if(_0x3b5ada?.[_0x1c77fd(0xae)]!==_0x31057a[_0x1c77fd(0xae)]||_0x3b5ada[_0x1c77fd(0xcf)]!==_0x1a150b)throw CliErrors[_0x1c77fd(0xc6)]('Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20'+_0x31057a['appCode']+':\x20'+_0x4d107d[_0x1c77fd(0xad)]);const _0x38986c=runtimeSkillLinkName(_0x31057a,_0x1a150b);for(const _0x33b850 of _0x31057a[_0x1c77fd(0xd0)]){_0x21bfba[_0x1c77fd(0xb9)](ensureManagedSymlink(resolve(_0x33b850,_0x38986c),_0x4d107d[_0x1c77fd(0xb6)],_0x31057a,_0x1a150b));}}return _0x21bfba;}export function pruneStaleRuntimeSkillLinks(_0x43407b,_0x1343ee,_0x391f7d){const _0x58a280=a141_0x33b670,_0x1a590a=new Set([..._0x1343ee][_0x58a280(0x9a)](_0x44515a=>_0x44515a[_0x58a280(0xb3)]())[_0x58a280(0xbf)](Boolean)),_0x4e3c3f=_0x391f7d?new Set([..._0x391f7d][_0x58a280(0x9a)](_0x403045=>_0x403045[_0x58a280(0xb3)]())[_0x58a280(0xbf)](Boolean)):undefined,_0x22b1bd=[];for(const _0x1faaa4 of _0x43407b['skillRoots']){for(const _0x3ea6ad of managedTargetSkillLinkPaths(_0x1faaa4,_0x43407b)){const _0x223bbe=runtimeSkillCodeFromLink(_0x43407b,_0x3ea6ad);if(_0x4e3c3f&&!_0x4e3c3f[_0x58a280(0xa2)](_0x223bbe))continue;if(_0x1a590a[_0x58a280(0xa2)](_0x223bbe))continue;_0x22b1bd[_0x58a280(0xb9)](removeManagedSkillLink(_0x3ea6ad,_0x43407b,_0x223bbe));}}return _0x22b1bd;}export function pruneStaleRuntimeSkillCache(_0x27b952,_0x5c5002={}){const _0x1ba0bb=a141_0x33b670,_0x5ccf69=new Set([..._0x27b952[_0x1ba0bb(0xc5)]][_0x1ba0bb(0x9a)](_0x1acdcc=>_0x1acdcc['trim']())[_0x1ba0bb(0xbf)](Boolean)),_0x24fd3e=_0x27b952['pruneSkillCodes']?new Set([..._0x27b952['pruneSkillCodes']][_0x1ba0bb(0x9a)](_0xb0ad0e=>_0xb0ad0e[_0x1ba0bb(0xb3)]())['filter'](Boolean)):undefined,_0x50e321=_0x27b952['scopes']??[_0x1ba0bb(0xc8),'company'],_0x146b58=resolve(getRuntimeSkillCacheRoot(_0x27b952[_0x1ba0bb(0xa3)],_0x27b952[_0x1ba0bb(0xcb)],_0x5c5002),safePathSegment(_0x27b952[_0x1ba0bb(0xae)],_0x1ba0bb(0xae))),_0x3085de=[];for(const _0x55a8b4 of _0x50e321){const _0x4408b1=resolve(_0x146b58,_0x55a8b4);if(!existsSync(_0x4408b1))continue;for(const _0x1d6311 of readdirSync(_0x4408b1,{'withFileTypes':!![]})){if(!_0x1d6311[_0x1ba0bb(0x9c)]())continue;const _0x499ba5=_0x1d6311[_0x1ba0bb(0xa0)];if(_0x24fd3e&&!_0x24fd3e[_0x1ba0bb(0xa2)](_0x499ba5))continue;if(_0x5ccf69[_0x1ba0bb(0xa2)](_0x499ba5))continue;const _0x54bf66=resolve(_0x4408b1,_0x499ba5),_0x23da76=readMetadataIfPresent(resolve(_0x54bf66,METADATA_FILE));if(_0x23da76?.[_0x1ba0bb(0xae)]!==_0x27b952[_0x1ba0bb(0xae)]||_0x23da76[_0x1ba0bb(0xc9)]!==_0x55a8b4||_0x23da76[_0x1ba0bb(0xcf)]!==_0x499ba5){_0x3085de['push']({'path':_0x54bf66,'action':_0x1ba0bb(0xba),'reason':_0x1ba0bb(0xcc)});continue;}if(isLinkedFromAnyRoot(_0x54bf66,_0x27b952[_0x1ba0bb(0xa9)]??[])){_0x3085de[_0x1ba0bb(0xb9)]({'path':_0x54bf66,'action':'skipped','reason':'linked-from-protected-root'});continue;}removeSync(_0x54bf66),_0x3085de[_0x1ba0bb(0xb9)]({'path':_0x54bf66,'action':'removed'});}}return _0x3085de;}function a141_0x3df8(){const _0x5cb55e=['secret-retriever','Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20','removed','filter','builtin','skill','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','not-managed-symlink','runtime-observe','activeSkillCodes','validation','3691516vTDhWf','personal','scope','created','accessKey','metadata-mismatch','length','Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20','skillCode','skillRoots','Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20','startsWith','map','1392460pJeHCu','isDirectory','Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20','1vkqyed','name','3456615ebRmiL','has','env','get','29239sLXSTd','lovrabet','agentsSkillsDir','set','protectedLinkRoots','unchanged','6918204AdBTDt','managedRoot','metadataPath','appCode','project','Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20','2056LnpNiJ','16160940dlEHys','trim','isSymbolicLink','updated','dir','2080196HDyAdk','contentHash','push','skipped','Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20'];a141_0x3df8=function(){return _0x5cb55e;};return a141_0x3df8();}export function linkGlobalRuntimeSkills(_0xdfdaa3,_0x50cd97={}){const _0x5ef831=a141_0x33b670,_0x26258f=resolveSkillSyncPaths(_0x50cd97),_0x466567=[];for(const _0x43707e of _0xdfdaa3){if(_0x43707e[_0x5ef831(0xc9)]!==_0x5ef831(0xc0))throw CliErrors['validation'](_0x5ef831(0xc2)+_0x43707e[_0x5ef831(0xc9)]);const _0x241305=requireSkillCode(_0x43707e['skill']),_0x658c04=copyManagedSkillDirectory(_0x43707e[_0x5ef831(0xb6)],resolve(_0x26258f[_0x5ef831(0xa7)],_0x241305));_0x466567['push']({..._0x658c04,'contentHash':_0x43707e[_0x5ef831(0xb8)]});}return _0x466567;}function ensureManagedSymlink(_0x17dcee,_0x3ded41,_0x4d2a32,_0x490eed){const _0x201e46=a141_0x33b670;mkdirSync(dirname(_0x17dcee),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x17dcee)||isDanglingSymlink(_0x17dcee)){const _0x486b1a=lstatSync(_0x17dcee);if(!_0x486b1a[_0x201e46(0xb4)]())throw CliErrors[_0x201e46(0xc6)](_0x201e46(0x9d)+_0x17dcee);const _0x28737f=resolveSymlinkTarget(_0x17dcee);if(!isPathInside(realOrResolved(_0x28737f),realOrResolved(_0x4d2a32[_0x201e46(0xac)])))throw CliErrors['validation'](_0x201e46(0x98)+_0x17dcee);if(realOrResolved(_0x28737f)===realOrResolved(_0x3ded41))return{'path':_0x17dcee,'target':_0x3ded41,'action':_0x201e46(0xaa)};const _0x390f02=readMetadataIfPresent(resolve(_0x28737f,METADATA_FILE));if(_0x4d2a32[_0x201e46(0xc9)]===_0x201e46(0xaf)&&(_0x390f02?.[_0x201e46(0xae)]!==_0x4d2a32[_0x201e46(0xae)]||_0x390f02['skillCode']!==_0x490eed))throw CliErrors['validation'](_0x201e46(0xbb)+_0x17dcee);return unlinkSync(_0x17dcee),symlinkSync(_0x3ded41,_0x17dcee,_0x201e46(0xb6)),{'path':_0x17dcee,'target':_0x3ded41,'action':_0x201e46(0xb5)};}return symlinkSync(_0x3ded41,_0x17dcee,_0x201e46(0xb6)),{'path':_0x17dcee,'target':_0x3ded41,'action':'created'};}function managedTargetSkillLinkPaths(_0x42dc0f,_0x42830e){const _0x3ceb5b=a141_0x33b670;if(!existsSync(_0x42dc0f))return[];const _0x3d8300=_0x42830e[_0x3ceb5b(0xae)]+'--';return readdirSync(_0x42dc0f,{'withFileTypes':!![]})[_0x3ceb5b(0xbf)](_0x6d232f=>_0x42830e[_0x3ceb5b(0xc9)]===_0x3ceb5b(0xaf)||_0x6d232f[_0x3ceb5b(0xa0)][_0x3ceb5b(0x99)](_0x3d8300))[_0x3ceb5b(0x9a)](_0x4982c1=>resolve(_0x42dc0f,_0x4982c1['name']));}function a141_0x14f2(_0x2dee04,_0x55560c){_0x2dee04=_0x2dee04-0x98;const _0x3df8f=a141_0x3df8();let _0x14f2a0=_0x3df8f[_0x2dee04];return _0x14f2a0;}function removeManagedSkillLink(_0x5d648c,_0x88c4b9,_0x23e00b){const _0x3a30f4=a141_0x33b670,_0x493991=lstatIfPresent(_0x5d648c);if(!_0x493991?.[_0x3a30f4(0xb4)]())return{'path':_0x5d648c,'action':_0x3a30f4(0xba),'reason':_0x3a30f4(0xc3)};const _0x21ea66=resolveSymlinkTarget(_0x5d648c);if(!isPathInside(realOrResolved(_0x21ea66),realOrResolved(_0x88c4b9['managedRoot'])))return{'path':_0x5d648c,'action':_0x3a30f4(0xba),'reason':'external-symlink'};const _0x1565e2=readMetadataIfPresent(resolve(_0x21ea66,METADATA_FILE));if(_0x88c4b9[_0x3a30f4(0xc9)]===_0x3a30f4(0xaf)&&(_0x1565e2?.[_0x3a30f4(0xae)]!==_0x88c4b9[_0x3a30f4(0xae)]||_0x1565e2[_0x3a30f4(0xcf)]!==_0x23e00b))return{'path':_0x5d648c,'action':_0x3a30f4(0xba),'reason':_0x3a30f4(0xcc)};return unlinkSync(_0x5d648c),{'path':_0x5d648c,'action':_0x3a30f4(0xbe)};}function isLinkedFromAnyRoot(_0x26b89b,_0x42a75e){const _0x53ad11=a141_0x33b670,_0x393e63=realOrResolved(_0x26b89b);for(const _0x509abe of _0x42a75e){if(!existsSync(_0x509abe))continue;for(const _0x2c6edc of readdirSync(_0x509abe,{'withFileTypes':!![]})){if(!_0x2c6edc['isSymbolicLink']())continue;const _0x3a1a46=resolve(_0x509abe,_0x2c6edc[_0x53ad11(0xa0)]);if(realOrResolved(resolveSymlinkTarget(_0x3a1a46))===_0x393e63)return!![];}}return![];}function runtimeSkillLinkName(_0x85fd78,_0x2b9c92){const _0x378b8b=a141_0x33b670,_0xa8cb4=safePathSegment(_0x2b9c92,_0x378b8b(0xcf));if(_0x85fd78['scope']===_0x378b8b(0xaf)&&RESERVED_PROJECT_SKILL_CODES[_0x378b8b(0xa2)](_0xa8cb4))throw CliErrors[_0x378b8b(0xc6)](_0x378b8b(0xce)+_0xa8cb4);return _0x85fd78['scope']==='project'?_0xa8cb4:_0x85fd78[_0x378b8b(0xae)]+'--'+_0xa8cb4;}function runtimeSkillCodeFromLink(_0x3d0b96,_0x4966a2){const _0xc7388d=a141_0x33b670,_0x4edbd0=basename(_0x4966a2);return _0x3d0b96[_0xc7388d(0xc9)]===_0xc7388d(0xaf)?_0x4edbd0:_0x4edbd0['slice']((_0x3d0b96[_0xc7388d(0xae)]+'--')[_0xc7388d(0xcd)]);}export function copyManagedSkillDirectory(_0x355df4,_0x330124){const _0x5bfe87=a141_0x33b670,_0x2c6cf4=resolve(_0x330124,METADATA_FILE),_0x2473cb=existsSync(_0x330124);if(_0x2473cb){const _0x3b56e7=lstatSync(_0x330124);if(_0x3b56e7[_0x5bfe87(0xb4)]())throw CliErrors['validation'](_0x5bfe87(0xbd)+_0x330124);if(!_0x3b56e7[_0x5bfe87(0x9c)]())throw CliErrors['validation'](_0x5bfe87(0xb0)+_0x330124);const _0x221000=readMetadataIfPresent(_0x2c6cf4);if(_0x221000?.[_0x5bfe87(0xc9)]!==_0x5bfe87(0xc0))throw CliErrors[_0x5bfe87(0xc6)](_0x5bfe87(0x9e)+_0x330124);}ensureDirSync(dirname(_0x330124));const _0x1a3553=_0x2473cb?readMetadataIfPresent(_0x2c6cf4)?.[_0x5bfe87(0xb8)]:undefined,_0x34e260=readMetadataIfPresent(resolve(_0x355df4,METADATA_FILE))?.[_0x5bfe87(0xb8)];return _0x2473cb&&removeSync(_0x330124),copySkillDirectory(_0x355df4,_0x330124),{'path':_0x330124,'target':_0x355df4,'action':!_0x2473cb?_0x5bfe87(0xca):_0x1a3553===_0x34e260?_0x5bfe87(0xaa):_0x5bfe87(0xb5)};}function copySkillDirectory(_0x423b06,_0x4a6d21){copySync(_0x423b06,_0x4a6d21,{'dereference':![],'overwrite':!![],'filter'(_0x2e32b){const _0x4d298b=a141_0x14f2;if(lstatSync(_0x2e32b)[_0x4d298b(0xb4)]())throw CliErrors[_0x4d298b(0xc6)]('Refusing\x20to\x20copy\x20Skill\x20symlink:\x20'+_0x2e32b);return!![];}});}
1
+ const a141_0x43b936=a141_0x1571;(function(_0x570382,_0x1f7e00){const _0x547639=a141_0x1571,_0x26469a=_0x570382();while(!![]){try{const _0x3eba58=-parseInt(_0x547639(0x103))/0x1+-parseInt(_0x547639(0x109))/0x2*(-parseInt(_0x547639(0xe6))/0x3)+-parseInt(_0x547639(0x10b))/0x4+parseInt(_0x547639(0xd9))/0x5+parseInt(_0x547639(0x104))/0x6*(-parseInt(_0x547639(0xf4))/0x7)+parseInt(_0x547639(0xea))/0x8*(parseInt(_0x547639(0x101))/0x9)+parseInt(_0x547639(0xff))/0xa;if(_0x3eba58===_0x1f7e00)break;else _0x26469a['push'](_0x26469a['shift']());}catch(_0xc0a455){_0x26469a['push'](_0x26469a['shift']());}}}(a141_0x5f41,0xd4128));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import a141_0x945652 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 a141_0x5f41(){const _0x24d9ad=['Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20','skillRoots','isDirectory','has','metadata-mismatch','1043ZcrAln','push','Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20','Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20','scope','set','name','validation','runtime-observe','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20','map','7196510LdFWtR','pruneSkillCodes','2495925QwUpKN','scopes','1509278ZCmRVT','5754jQtUMV','project','company','builtin','accessKey','16YviTgS','Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20','280232XmBLpO','lovrabet','Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20','length','protectedLinkRoots','agentsSkillsDir','filter','dir','447190giCNKI','get','unchanged','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','trim','skipped','created','managedRoot','Refusing\x20to\x20copy\x20Skill\x20symlink:\x20','Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20','removed','env','skillCode','460176nlMygC','metadataPath','contentHash','personal','16yqEXcW','skill','updated','appCode','isSymbolicLink'];a141_0x5f41=function(){return _0x24d9ad;};return a141_0x5f41();}const {copySync,ensureDirSync,removeSync}=a141_0x945652,RESERVED_PROJECT_SKILL_CODES=new Set([a141_0x43b936(0x10c),a141_0x43b936(0xfc),'secret-retriever']);export function linkEffectiveRuntimeSkills(_0x1634a1,_0x13ca88){const _0xfcb71f=a141_0x43b936,_0x2f0054=new Map();for(const _0x56352d of _0x1634a1){const _0x1af7dc=_0x56352d[_0xfcb71f(0xeb)][_0xfcb71f(0xe5)];if(!_0x1af7dc)continue;const _0x11ffaf=_0x2f0054[_0xfcb71f(0xda)](_0x1af7dc);(!_0x11ffaf||_0x56352d[_0xfcb71f(0xf8)]===_0xfcb71f(0xe9))&&_0x2f0054[_0xfcb71f(0xf9)](_0x1af7dc,_0x56352d);}const _0x47cb9c=[];for(const _0x2da968 of _0x2f0054['values']()){const _0x2a31bc=requireSkillCode(_0x2da968['skill']),_0x5130ef=readMetadataIfPresent(_0x2da968[_0xfcb71f(0xe7)]);if(_0x5130ef?.[_0xfcb71f(0xed)]!==_0x13ca88[_0xfcb71f(0xed)]||_0x5130ef[_0xfcb71f(0xe5)]!==_0x2a31bc)throw CliErrors[_0xfcb71f(0xfb)](_0xfcb71f(0xf6)+_0x13ca88[_0xfcb71f(0xed)]+':\x20'+_0x2da968[_0xfcb71f(0xe7)]);const _0x1cccd3=runtimeSkillLinkName(_0x13ca88,_0x2a31bc);for(const _0x6e0639 of _0x13ca88['skillRoots']){_0x47cb9c['push'](ensureManagedSymlink(resolve(_0x6e0639,_0x1cccd3),_0x2da968[_0xfcb71f(0xd8)],_0x13ca88,_0x2a31bc));}}return _0x47cb9c;}export function pruneStaleRuntimeSkillLinks(_0x11e2da,_0x4393e0,_0x57dbc1){const _0x3b6d68=a141_0x43b936,_0x4bb534=new Set([..._0x4393e0][_0x3b6d68(0xfe)](_0x475b4d=>_0x475b4d[_0x3b6d68(0xdd)]())[_0x3b6d68(0xd7)](Boolean)),_0x25c3b0=_0x57dbc1?new Set([..._0x57dbc1]['map'](_0x3ae8e7=>_0x3ae8e7[_0x3b6d68(0xdd)]())[_0x3b6d68(0xd7)](Boolean)):undefined,_0x188e5c=[];for(const _0x50403d of _0x11e2da[_0x3b6d68(0xf0)]){for(const _0x49b6bd of managedTargetSkillLinkPaths(_0x50403d,_0x11e2da)){const _0x4cf207=runtimeSkillCodeFromLink(_0x11e2da,_0x49b6bd);if(_0x25c3b0&&!_0x25c3b0[_0x3b6d68(0xf2)](_0x4cf207))continue;if(_0x4bb534[_0x3b6d68(0xf2)](_0x4cf207))continue;_0x188e5c['push'](removeManagedSkillLink(_0x49b6bd,_0x11e2da,_0x4cf207));}}return _0x188e5c;}export function pruneStaleRuntimeSkillCache(_0x595e56,_0x342739={}){const _0x310956=a141_0x43b936,_0x45fef0=new Set([..._0x595e56['activeSkillCodes']][_0x310956(0xfe)](_0x256631=>_0x256631[_0x310956(0xdd)]())[_0x310956(0xd7)](Boolean)),_0x191418=_0x595e56[_0x310956(0x100)]?new Set([..._0x595e56[_0x310956(0x100)]][_0x310956(0xfe)](_0x2187f3=>_0x2187f3[_0x310956(0xdd)]())[_0x310956(0xd7)](Boolean)):undefined,_0x4c0b00=_0x595e56[_0x310956(0x102)]??[_0x310956(0xe9),_0x310956(0x106)],_0x206997=resolve(getRuntimeSkillCacheRoot(_0x595e56[_0x310956(0xe4)],_0x595e56[_0x310956(0x108)],_0x342739),safePathSegment(_0x595e56[_0x310956(0xed)],_0x310956(0xed))),_0x34af49=[];for(const _0x5992a9 of _0x4c0b00){const _0x18196c=resolve(_0x206997,_0x5992a9);if(!existsSync(_0x18196c))continue;for(const _0xf3eacf of readdirSync(_0x18196c,{'withFileTypes':!![]})){if(!_0xf3eacf['isDirectory']())continue;const _0x1fb408=_0xf3eacf[_0x310956(0xfa)];if(_0x191418&&!_0x191418['has'](_0x1fb408))continue;if(_0x45fef0[_0x310956(0xf2)](_0x1fb408))continue;const _0x56e5f2=resolve(_0x18196c,_0x1fb408),_0x138d48=readMetadataIfPresent(resolve(_0x56e5f2,METADATA_FILE));if(_0x138d48?.[_0x310956(0xed)]!==_0x595e56['appCode']||_0x138d48[_0x310956(0xf8)]!==_0x5992a9||_0x138d48['skillCode']!==_0x1fb408){_0x34af49[_0x310956(0xf5)]({'path':_0x56e5f2,'action':'skipped','reason':_0x310956(0xf3)});continue;}if(isLinkedFromAnyRoot(_0x56e5f2,_0x595e56[_0x310956(0xd5)]??[])){_0x34af49[_0x310956(0xf5)]({'path':_0x56e5f2,'action':_0x310956(0xde),'reason':'linked-from-protected-root'});continue;}removeSync(_0x56e5f2),_0x34af49[_0x310956(0xf5)]({'path':_0x56e5f2,'action':'removed'});}}return _0x34af49;}export function linkGlobalRuntimeSkills(_0x218c76,_0xb56663={}){const _0x23d072=a141_0x43b936,_0x2ee043=resolveSkillSyncPaths(_0xb56663),_0x1a9592=[];for(const _0xe1eb52 of _0x218c76){if(_0xe1eb52[_0x23d072(0xf8)]!==_0x23d072(0x107))throw CliErrors[_0x23d072(0xfb)](_0x23d072(0xdc)+_0xe1eb52[_0x23d072(0xf8)]);const _0x1ca21a=requireSkillCode(_0xe1eb52[_0x23d072(0xeb)]),_0x15210a=copyManagedSkillDirectory(_0xe1eb52[_0x23d072(0xd8)],resolve(_0x2ee043[_0x23d072(0xd6)],_0x1ca21a));_0x1a9592[_0x23d072(0xf5)]({..._0x15210a,'contentHash':_0xe1eb52[_0x23d072(0xe8)]});}return _0x1a9592;}function ensureManagedSymlink(_0x2039a9,_0x52d1d0,_0x14510e,_0x591c4a){const _0x2a8681=a141_0x43b936;mkdirSync(dirname(_0x2039a9),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x2039a9)||isDanglingSymlink(_0x2039a9)){const _0x3259c1=lstatSync(_0x2039a9);if(!_0x3259c1[_0x2a8681(0xee)]())throw CliErrors[_0x2a8681(0xfb)]('Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20'+_0x2039a9);const _0x3e69cc=resolveSymlinkTarget(_0x2039a9);if(!isPathInside(realOrResolved(_0x3e69cc),realOrResolved(_0x14510e[_0x2a8681(0xe0)])))throw CliErrors[_0x2a8681(0xfb)](_0x2a8681(0xef)+_0x2039a9);if(realOrResolved(_0x3e69cc)===realOrResolved(_0x52d1d0))return{'path':_0x2039a9,'target':_0x52d1d0,'action':'unchanged'};const _0x14bf54=readMetadataIfPresent(resolve(_0x3e69cc,METADATA_FILE));if(_0x14510e['scope']==='project'&&(_0x14bf54?.[_0x2a8681(0xed)]!==_0x14510e[_0x2a8681(0xed)]||_0x14bf54[_0x2a8681(0xe5)]!==_0x591c4a))throw CliErrors['validation'](_0x2a8681(0xf7)+_0x2039a9);return unlinkSync(_0x2039a9),symlinkSync(_0x52d1d0,_0x2039a9,'dir'),{'path':_0x2039a9,'target':_0x52d1d0,'action':_0x2a8681(0xec)};}return symlinkSync(_0x52d1d0,_0x2039a9,_0x2a8681(0xd8)),{'path':_0x2039a9,'target':_0x52d1d0,'action':_0x2a8681(0xdf)};}function managedTargetSkillLinkPaths(_0x1deee7,_0x10adea){const _0x332357=a141_0x43b936;if(!existsSync(_0x1deee7))return[];const _0x4e400f=_0x10adea[_0x332357(0xed)]+'--';return readdirSync(_0x1deee7,{'withFileTypes':!![]})[_0x332357(0xd7)](_0x2547fa=>_0x10adea['scope']===_0x332357(0x105)||_0x2547fa[_0x332357(0xfa)]['startsWith'](_0x4e400f))[_0x332357(0xfe)](_0x38d30a=>resolve(_0x1deee7,_0x38d30a['name']));}function a141_0x1571(_0x1fe9d9,_0x2d5ddb){_0x1fe9d9=_0x1fe9d9-0xd4;const _0x5f41b6=a141_0x5f41();let _0x1571c5=_0x5f41b6[_0x1fe9d9];return _0x1571c5;}function removeManagedSkillLink(_0x11dd40,_0x7bc7cd,_0x453ac1){const _0x33f7b8=a141_0x43b936,_0x37c7e0=lstatIfPresent(_0x11dd40);if(!_0x37c7e0?.['isSymbolicLink']())return{'path':_0x11dd40,'action':_0x33f7b8(0xde),'reason':'not-managed-symlink'};const _0x53f911=resolveSymlinkTarget(_0x11dd40);if(!isPathInside(realOrResolved(_0x53f911),realOrResolved(_0x7bc7cd['managedRoot'])))return{'path':_0x11dd40,'action':'skipped','reason':'external-symlink'};const _0x43f531=readMetadataIfPresent(resolve(_0x53f911,METADATA_FILE));if(_0x7bc7cd[_0x33f7b8(0xf8)]==='project'&&(_0x43f531?.['appCode']!==_0x7bc7cd[_0x33f7b8(0xed)]||_0x43f531[_0x33f7b8(0xe5)]!==_0x453ac1))return{'path':_0x11dd40,'action':'skipped','reason':_0x33f7b8(0xf3)};return unlinkSync(_0x11dd40),{'path':_0x11dd40,'action':_0x33f7b8(0xe3)};}function isLinkedFromAnyRoot(_0x880525,_0x1d5a33){const _0x4f52d5=a141_0x43b936,_0x5cb203=realOrResolved(_0x880525);for(const _0x1438eb of _0x1d5a33){if(!existsSync(_0x1438eb))continue;for(const _0x5ab9e7 of readdirSync(_0x1438eb,{'withFileTypes':!![]})){if(!_0x5ab9e7[_0x4f52d5(0xee)]())continue;const _0xec4b51=resolve(_0x1438eb,_0x5ab9e7[_0x4f52d5(0xfa)]);if(realOrResolved(resolveSymlinkTarget(_0xec4b51))===_0x5cb203)return!![];}}return![];}function runtimeSkillLinkName(_0x50b3a0,_0x12a737){const _0x1f15b0=a141_0x43b936,_0x5ab87a=safePathSegment(_0x12a737,_0x1f15b0(0xe5));if(_0x50b3a0[_0x1f15b0(0xf8)]===_0x1f15b0(0x105)&&RESERVED_PROJECT_SKILL_CODES[_0x1f15b0(0xf2)](_0x5ab87a))throw CliErrors['validation'](_0x1f15b0(0xe2)+_0x5ab87a);return _0x50b3a0[_0x1f15b0(0xf8)]===_0x1f15b0(0x105)?_0x5ab87a:_0x50b3a0[_0x1f15b0(0xed)]+'--'+_0x5ab87a;}function runtimeSkillCodeFromLink(_0x1d0446,_0x3369f0){const _0x14c603=a141_0x43b936,_0x4ae6cc=basename(_0x3369f0);return _0x1d0446[_0x14c603(0xf8)]===_0x14c603(0x105)?_0x4ae6cc:_0x4ae6cc['slice']((_0x1d0446['appCode']+'--')[_0x14c603(0xd4)]);}export function copyManagedSkillDirectory(_0x5af521,_0x347b6e){const _0x5902f1=a141_0x43b936,_0x59b72d=resolve(_0x347b6e,METADATA_FILE),_0x251901=existsSync(_0x347b6e);if(_0x251901){const _0x12ea20=lstatSync(_0x347b6e);if(_0x12ea20[_0x5902f1(0xee)]())throw CliErrors[_0x5902f1(0xfb)](_0x5902f1(0x10a)+_0x347b6e);if(!_0x12ea20[_0x5902f1(0xf1)]())throw CliErrors[_0x5902f1(0xfb)](_0x5902f1(0x10d)+_0x347b6e);const _0x13a97a=readMetadataIfPresent(_0x59b72d);if(_0x13a97a?.['scope']!==_0x5902f1(0x107))throw CliErrors[_0x5902f1(0xfb)](_0x5902f1(0xfd)+_0x347b6e);}ensureDirSync(dirname(_0x347b6e));const _0x2dc318=_0x251901?readMetadataIfPresent(_0x59b72d)?.['contentHash']:undefined,_0x59f4bd=readMetadataIfPresent(resolve(_0x5af521,METADATA_FILE))?.[_0x5902f1(0xe8)];return _0x251901&&removeSync(_0x347b6e),copySkillDirectory(_0x5af521,_0x347b6e),{'path':_0x347b6e,'target':_0x5af521,'action':!_0x251901?_0x5902f1(0xdf):_0x2dc318===_0x59f4bd?_0x5902f1(0xdb):_0x5902f1(0xec)};}function copySkillDirectory(_0x1ebb50,_0x139d03){copySync(_0x1ebb50,_0x139d03,{'dereference':![],'overwrite':!![],'filter'(_0x3169d3){const _0x2f2c15=a141_0x1571;if(lstatSync(_0x3169d3)['isSymbolicLink']())throw CliErrors[_0x2f2c15(0xfb)](_0x2f2c15(0xe1)+_0x3169d3);return!![];}});}
@@ -1 +1 @@
1
- function a142_0x5f1c(){const _0x2b7d55=['2498468ewXbIb','map','2567995tFvVrv','skillRoots','name','trim','accessKey','env','has','1144233LUOrYm','isSymbolicLink','link','cacheDir','values','includes','2485370gVOivg','builtin','tags','\x20!=\x20','89120wrMfZj','cache','linkedPaths','sort','48WiBqje','scope','filter','source','appCode','12wtLokW','skillMdPath','startsWith','localeCompare','code','project','get','set','isArray','56204ujouZP','dir','Runtime\x20Skill\x20install\x20target\x20app\x20mismatch:\x20','isDirectory','local','16781967uzLNaU','metadataPath','skillCode','linkedPath'];a142_0x5f1c=function(){return _0x2b7d55;};return a142_0x5f1c();}(function(_0x5bab61,_0x2497ca){const _0x233d8c=a142_0x23b6,_0x1f5923=_0x5bab61();while(!![]){try{const _0x45282a=parseInt(_0x233d8c(0x175))/0x1+parseInt(_0x233d8c(0x17b))/0x2+parseInt(_0x233d8c(0x183))/0x3*(parseInt(_0x233d8c(0x163))/0x4)+-parseInt(_0x233d8c(0x16e))/0x5+-parseInt(_0x233d8c(0x188))/0x6*(-parseInt(_0x233d8c(0x16c))/0x7)+-parseInt(_0x233d8c(0x17f))/0x8+-parseInt(_0x233d8c(0x168))/0x9;if(_0x45282a===_0x2497ca)break;else _0x1f5923['push'](_0x1f5923['shift']());}catch(_0x572c18){_0x1f5923['push'](_0x1f5923['shift']());}}}(a142_0x5f1c,0xe48f4));import{existsSync,readdirSync}from'node:fs';import{resolve}from'node:path';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{readMetadataIfPresent}from'./metadata.js';import{getRuntimeSkillCacheRoot,safePathSegment}from'./paths.js';function a142_0x23b6(_0x405ba5,_0x4f5901){_0x405ba5=_0x405ba5-0x163;const _0x5f1c98=a142_0x5f1c();let _0x23b66e=_0x5f1c98[_0x405ba5];return _0x23b66e;}import{isRuntimeSkillScope,normalizeRuntimeSkillScopes}from'./scopes.js';export function listLocalRuntimeSkills(_0x20a312,_0x3f21eb,_0x4a5d94={}){const _0x132983=a142_0x23b6,_0x52ad3b=safePathSegment(_0x20a312[_0x132983(0x187)],'appCode');if(_0x3f21eb[_0x132983(0x187)]!==_0x52ad3b)throw CliErrors['validation'](_0x132983(0x165)+_0x3f21eb[_0x132983(0x187)]+_0x132983(0x17e)+_0x52ad3b);const _0x487f24=normalizeRuntimeSkillScopes(_0x20a312['scopes']),_0x4ad575=new Set(_0x487f24),_0x5820fb=_0x20a312[_0x132983(0x18c)]?.[_0x132983(0x171)](),_0x464223=new Map(),_0x204c65=resolve(getRuntimeSkillCacheRoot(_0x20a312[_0x132983(0x173)],_0x20a312[_0x132983(0x172)],_0x4a5d94),_0x52ad3b);for(const _0x3612e3 of _0x487f24){for(const _0x334be0 of localSkillEntryDirs(resolve(_0x204c65,_0x3612e3))){collectLocalRuntimeSkill(_0x464223,_0x334be0,{'appCode':_0x52ad3b,'scopes':_0x4ad575,'code':_0x5820fb,'source':_0x132983(0x180)});}}for(const _0x378445 of _0x3f21eb[_0x132983(0x16f)]){for(const _0x50f097 of localSkillLinkCandidates(_0x378445,_0x3f21eb,_0x4ad575)){collectLocalRuntimeSkill(_0x464223,_0x50f097,{'appCode':_0x52ad3b,'scopes':_0x4ad575,'code':_0x5820fb,'source':_0x132983(0x177),'linkedPath':_0x50f097});}}return Array['from'](_0x464223[_0x132983(0x179)]())[_0x132983(0x182)](compareLocalRuntimeSkills);}function localSkillEntryDirs(_0x6d2cfa){const _0x2cb311=a142_0x23b6;if(!existsSync(_0x6d2cfa))return[];return readdirSync(_0x6d2cfa,{'withFileTypes':!![]})[_0x2cb311(0x185)](_0x31a38c=>_0x31a38c['isDirectory']()||_0x31a38c[_0x2cb311(0x176)]())[_0x2cb311(0x16d)](_0x1910da=>resolve(_0x6d2cfa,_0x1910da[_0x2cb311(0x170)]));}function localSkillLinkCandidates(_0x318a6d,_0x2737f8,_0x31870a){const _0x533c25=a142_0x23b6;if(!existsSync(_0x318a6d))return[];const _0x8a021b=_0x2737f8[_0x533c25(0x187)]+'--';return readdirSync(_0x318a6d,{'withFileTypes':!![]})[_0x533c25(0x185)](_0x34fd41=>_0x34fd41[_0x533c25(0x166)]()||_0x34fd41[_0x533c25(0x176)]())[_0x533c25(0x185)](_0x2edc85=>_0x2737f8['scope']===_0x533c25(0x18d)||_0x2edc85[_0x533c25(0x170)][_0x533c25(0x18a)](_0x8a021b)||_0x31870a[_0x533c25(0x174)](_0x533c25(0x17c)))[_0x533c25(0x16d)](_0x3e1c60=>resolve(_0x318a6d,_0x3e1c60[_0x533c25(0x170)]));}function collectLocalRuntimeSkill(_0x278368,_0x2aeae0,_0x8f3e3e){const _0x1d404f=a142_0x23b6,_0x4ff287=resolve(_0x2aeae0,METADATA_FILE),_0x417ffd=readMetadataIfPresent(_0x4ff287);if(!_0x417ffd)return;if(_0x417ffd[_0x1d404f(0x187)]!==_0x8f3e3e[_0x1d404f(0x187)])return;if(!isRuntimeSkillScope(_0x417ffd[_0x1d404f(0x184)])||!_0x8f3e3e['scopes']['has'](_0x417ffd[_0x1d404f(0x184)]))return;const _0x5381d8=_0x417ffd[_0x1d404f(0x16a)]?.[_0x1d404f(0x171)]();if(!_0x5381d8)return;if(_0x8f3e3e[_0x1d404f(0x18c)]&&_0x5381d8!==_0x8f3e3e['code'])return;const _0x2be0cb=_0x417ffd[_0x1d404f(0x184)]+':'+_0x5381d8,_0x15174f=_0x8f3e3e[_0x1d404f(0x16b)]?[_0x8f3e3e[_0x1d404f(0x16b)]]:[],_0x1a749e=_0x278368[_0x1d404f(0x18e)](_0x2be0cb);if(_0x1a749e){_0x8f3e3e['source']===_0x1d404f(0x180)&&(_0x1a749e[_0x1d404f(0x164)]=_0x2aeae0,_0x1a749e[_0x1d404f(0x178)]=_0x2aeae0,_0x1a749e[_0x1d404f(0x189)]=resolve(_0x2aeae0,SKILL_FILE),_0x1a749e[_0x1d404f(0x169)]=_0x4ff287);for(const _0xf7a86a of _0x15174f){!_0x1a749e['linkedPaths'][_0x1d404f(0x17a)](_0xf7a86a)&&_0x1a749e[_0x1d404f(0x181)]['push'](_0xf7a86a);}_0x1a749e[_0x1d404f(0x181)][_0x1d404f(0x182)]();return;}_0x278368[_0x1d404f(0x18f)](_0x2be0cb,{..._0x417ffd,'tags':Array[_0x1d404f(0x190)](_0x417ffd[_0x1d404f(0x17d)])?_0x417ffd[_0x1d404f(0x17d)]:[],'scope':_0x417ffd[_0x1d404f(0x184)],'source':_0x1d404f(0x167),'dir':_0x2aeae0,'cacheDir':_0x8f3e3e[_0x1d404f(0x186)]===_0x1d404f(0x180)?_0x2aeae0:undefined,'skillMdPath':resolve(_0x2aeae0,SKILL_FILE),'metadataPath':_0x4ff287,'linkedPaths':_0x15174f});}function compareLocalRuntimeSkills(_0xa1f403,_0x3b8c8c){const _0x29e6d2=a142_0x23b6,_0x176380={'personal':0x0,'company':0x1,'builtin':0x2};return _0x176380[_0xa1f403[_0x29e6d2(0x184)]]-_0x176380[_0x3b8c8c[_0x29e6d2(0x184)]]||_0xa1f403[_0x29e6d2(0x16a)][_0x29e6d2(0x18b)](_0x3b8c8c[_0x29e6d2(0x16a)])||_0xa1f403[_0x29e6d2(0x164)][_0x29e6d2(0x18b)](_0x3b8c8c[_0x29e6d2(0x164)]);}
1
+ (function(_0x302035,_0x3eaece){const _0x155ea3=a142_0x5459,_0x53f00b=_0x302035();while(!![]){try{const _0x3e359c=parseInt(_0x155ea3(0x15f))/0x1*(-parseInt(_0x155ea3(0x17a))/0x2)+parseInt(_0x155ea3(0x167))/0x3+parseInt(_0x155ea3(0x171))/0x4*(parseInt(_0x155ea3(0x179))/0x5)+parseInt(_0x155ea3(0x14f))/0x6+parseInt(_0x155ea3(0x153))/0x7*(-parseInt(_0x155ea3(0x170))/0x8)+-parseInt(_0x155ea3(0x16a))/0x9+-parseInt(_0x155ea3(0x162))/0xa;if(_0x3e359c===_0x3eaece)break;else _0x53f00b['push'](_0x53f00b['shift']());}catch(_0x51a589){_0x53f00b['push'](_0x53f00b['shift']());}}}(a142_0x7d6a,0xb479f));import{existsSync,readdirSync}from'node:fs';import{resolve}from'node:path';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{readMetadataIfPresent}from'./metadata.js';import{getRuntimeSkillCacheRoot,safePathSegment}from'./paths.js';import{isRuntimeSkillScope,normalizeRuntimeSkillScopes}from'./scopes.js';export function listLocalRuntimeSkills(_0x18d60a,_0x29deda,_0x2f0cbb={}){const _0x5195d0=a142_0x5459,_0x1b85e2=safePathSegment(_0x18d60a[_0x5195d0(0x166)],_0x5195d0(0x166));if(_0x29deda[_0x5195d0(0x166)]!==_0x1b85e2)throw CliErrors[_0x5195d0(0x155)](_0x5195d0(0x159)+_0x29deda[_0x5195d0(0x166)]+_0x5195d0(0x15b)+_0x1b85e2);const _0x141d7b=normalizeRuntimeSkillScopes(_0x18d60a[_0x5195d0(0x154)]),_0x908f56=new Set(_0x141d7b),_0x20f12d=_0x18d60a['code']?.[_0x5195d0(0x16f)](),_0x4ec920=new Map(),_0x2a63e6=resolve(getRuntimeSkillCacheRoot(_0x18d60a['env'],_0x18d60a['accessKey'],_0x2f0cbb),_0x1b85e2);for(const _0x2b3463 of _0x141d7b){for(const _0x2bd67e of localSkillEntryDirs(resolve(_0x2a63e6,_0x2b3463))){collectLocalRuntimeSkill(_0x4ec920,_0x2bd67e,{'appCode':_0x1b85e2,'scopes':_0x908f56,'code':_0x20f12d,'source':_0x5195d0(0x15a)});}}for(const _0x52e1a1 of _0x29deda[_0x5195d0(0x15d)]){for(const _0x2c9c90 of localSkillLinkCandidates(_0x52e1a1,_0x29deda,_0x908f56)){collectLocalRuntimeSkill(_0x4ec920,_0x2c9c90,{'appCode':_0x1b85e2,'scopes':_0x908f56,'code':_0x20f12d,'source':_0x5195d0(0x172),'linkedPath':_0x2c9c90});}}return Array[_0x5195d0(0x158)](_0x4ec920['values']())['sort'](compareLocalRuntimeSkills);}function localSkillEntryDirs(_0x521519){const _0x57bb1a=a142_0x5459;if(!existsSync(_0x521519))return[];return readdirSync(_0x521519,{'withFileTypes':!![]})[_0x57bb1a(0x176)](_0x32ecab=>_0x32ecab['isDirectory']()||_0x32ecab[_0x57bb1a(0x16b)]())[_0x57bb1a(0x165)](_0x136cf7=>resolve(_0x521519,_0x136cf7[_0x57bb1a(0x16e)]));}function localSkillLinkCandidates(_0x5413d2,_0x3ee288,_0x42b673){const _0xdfb4a5=a142_0x5459;if(!existsSync(_0x5413d2))return[];const _0x3bf820=_0x3ee288[_0xdfb4a5(0x166)]+'--';return readdirSync(_0x5413d2,{'withFileTypes':!![]})[_0xdfb4a5(0x176)](_0x4a5278=>_0x4a5278[_0xdfb4a5(0x177)]()||_0x4a5278[_0xdfb4a5(0x16b)]())['filter'](_0x3216ce=>_0x3ee288[_0xdfb4a5(0x160)]===_0xdfb4a5(0x169)||_0x3216ce['name'][_0xdfb4a5(0x161)](_0x3bf820)||_0x42b673[_0xdfb4a5(0x150)](_0xdfb4a5(0x16d)))[_0xdfb4a5(0x165)](_0x1c485d=>resolve(_0x5413d2,_0x1c485d['name']));}function a142_0x5459(_0x53b563,_0x2d1dd0){_0x53b563=_0x53b563-0x14f;const _0x7d6aec=a142_0x7d6a();let _0x5459ac=_0x7d6aec[_0x53b563];return _0x5459ac;}function collectLocalRuntimeSkill(_0x6a3c30,_0x280431,_0x39d3a5){const _0x5d1824=a142_0x5459,_0x439bd7=resolve(_0x280431,METADATA_FILE),_0x3bf4c2=readMetadataIfPresent(_0x439bd7);if(!_0x3bf4c2)return;if(_0x3bf4c2[_0x5d1824(0x166)]!==_0x39d3a5[_0x5d1824(0x166)])return;if(!isRuntimeSkillScope(_0x3bf4c2[_0x5d1824(0x160)])||!_0x39d3a5[_0x5d1824(0x154)]['has'](_0x3bf4c2[_0x5d1824(0x160)]))return;const _0x5a32d8=_0x3bf4c2[_0x5d1824(0x173)]?.[_0x5d1824(0x16f)]();if(!_0x5a32d8)return;if(_0x39d3a5['code']&&_0x5a32d8!==_0x39d3a5['code'])return;const _0x2cb5ff=_0x3bf4c2['scope']+':'+_0x5a32d8,_0x4a87e3=_0x39d3a5['linkedPath']?[_0x39d3a5[_0x5d1824(0x15c)]]:[],_0x1a86e5=_0x6a3c30[_0x5d1824(0x15e)](_0x2cb5ff);if(_0x1a86e5){_0x39d3a5[_0x5d1824(0x178)]==='cache'&&(_0x1a86e5[_0x5d1824(0x16c)]=_0x280431,_0x1a86e5[_0x5d1824(0x157)]=_0x280431,_0x1a86e5[_0x5d1824(0x164)]=resolve(_0x280431,SKILL_FILE),_0x1a86e5[_0x5d1824(0x174)]=_0x439bd7);for(const _0x4a0eb1 of _0x4a87e3){!_0x1a86e5['linkedPaths'][_0x5d1824(0x168)](_0x4a0eb1)&&_0x1a86e5['linkedPaths']['push'](_0x4a0eb1);}_0x1a86e5['linkedPaths'][_0x5d1824(0x156)]();return;}_0x6a3c30[_0x5d1824(0x151)](_0x2cb5ff,{..._0x3bf4c2,'tags':Array[_0x5d1824(0x152)](_0x3bf4c2['tags'])?_0x3bf4c2['tags']:[],'scope':_0x3bf4c2[_0x5d1824(0x160)],'source':_0x5d1824(0x175),'dir':_0x280431,'cacheDir':_0x39d3a5[_0x5d1824(0x178)]===_0x5d1824(0x15a)?_0x280431:undefined,'skillMdPath':resolve(_0x280431,SKILL_FILE),'metadataPath':_0x439bd7,'linkedPaths':_0x4a87e3});}function a142_0x7d6a(){const _0x179b2f=['skillCode','metadataPath','local','filter','isDirectory','source','35uScTkb','32zLIgKc','7963440LQOIbE','has','set','isArray','8610ZlvZfj','scopes','validation','sort','cacheDir','from','Runtime\x20Skill\x20install\x20target\x20app\x20mismatch:\x20','cache','\x20!=\x20','linkedPath','skillRoots','get','14171NsMLGP','scope','startsWith','22380770jUZrgs','localeCompare','skillMdPath','map','appCode','4067952qNVHZT','includes','project','1059399SFgUml','isSymbolicLink','dir','builtin','name','trim','4360PfGMPm','747932jfKedE','link'];a142_0x7d6a=function(){return _0x179b2f;};return a142_0x7d6a();}function compareLocalRuntimeSkills(_0x6dc428,_0x21810b){const _0x2d9086=a142_0x5459,_0x5f5566={'personal':0x0,'company':0x1,'builtin':0x2};return _0x5f5566[_0x6dc428[_0x2d9086(0x160)]]-_0x5f5566[_0x21810b[_0x2d9086(0x160)]]||_0x6dc428['skillCode'][_0x2d9086(0x163)](_0x21810b[_0x2d9086(0x173)])||_0x6dc428[_0x2d9086(0x16c)][_0x2d9086(0x163)](_0x21810b[_0x2d9086(0x16c)]);}
@@ -1 +1 @@
1
- (function(_0x11a292,_0x141eb6){const _0x4b4ca1=a143_0x5097,_0x197dab=_0x11a292();while(!![]){try{const _0x4054da=-parseInt(_0x4b4ca1(0x118))/0x1+-parseInt(_0x4b4ca1(0x121))/0x2*(-parseInt(_0x4b4ca1(0x116))/0x3)+parseInt(_0x4b4ca1(0x114))/0x4*(-parseInt(_0x4b4ca1(0x13a))/0x5)+-parseInt(_0x4b4ca1(0x13d))/0x6+-parseInt(_0x4b4ca1(0x111))/0x7+-parseInt(_0x4b4ca1(0x133))/0x8+-parseInt(_0x4b4ca1(0x13b))/0x9*(-parseInt(_0x4b4ca1(0x11e))/0xa);if(_0x4054da===_0x141eb6)break;else _0x197dab['push'](_0x197dab['shift']());}catch(_0x5e9bb5){_0x197dab['push'](_0x197dab['shift']());}}}(a143_0x2fcb,0x1af6f));import{readFileSync,readdirSync,realpathSync}from'node:fs';import{relative,resolve}from'node:path';import{CliErrors}from'../../errors.js';import{IGNORED_DIR_NAMES,IGNORED_FILE_NAMES,SKILL_FILE}from'./constants.js';function a143_0x5097(_0x2eb530,_0x9d70d0){_0x2eb530=_0x2eb530-0x111;const _0x2fcb7b=a143_0x2fcb();let _0x5097df=_0x2fcb7b[_0x2eb530];return _0x5097df;}export function fileContent(_0x3d9110){const _0x78c76d=a143_0x5097;return _0x3d9110[_0x78c76d(0x12c)]??Buffer[_0x78c76d(0x126)](_0x3d9110['content']??'',_0x78c76d(0x119));}export function fileText(_0x45dd7a){const _0x3c3c89=a143_0x5097;return fileContent(_0x45dd7a)[_0x3c3c89(0x11d)](_0x3c3c89(0x119));}export function normalizeLocalFiles(_0x471834){const _0x50c5b8=a143_0x5097;if(!Array[_0x50c5b8(0x12e)](_0x471834)||_0x471834[_0x50c5b8(0x132)]===0x0)return[];const _0x514600=new Map();for(const _0x51b919 of _0x471834){if(!_0x51b919||typeof _0x51b919!==_0x50c5b8(0x13c)||typeof _0x51b919[_0x50c5b8(0x130)]!==_0x50c5b8(0x124))throw CliErrors['validation'](_0x50c5b8(0x120));const _0x100512=normalizeSkillRelativePath(_0x51b919[_0x50c5b8(0x130)]);if(_0x514600[_0x50c5b8(0x122)](_0x100512))throw CliErrors[_0x50c5b8(0x11f)](_0x50c5b8(0x128)+_0x100512);if(_0x51b919[_0x50c5b8(0x12c)]!==undefined&&!Buffer[_0x50c5b8(0x138)](_0x51b919[_0x50c5b8(0x12c)]))throw CliErrors[_0x50c5b8(0x11f)]('Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20'+_0x100512);if(_0x51b919[_0x50c5b8(0x12c)]===undefined&&typeof _0x51b919['content']!==_0x50c5b8(0x124))throw CliErrors[_0x50c5b8(0x11f)](_0x50c5b8(0x11c)+_0x100512);const _0x49657e=fileContent(_0x51b919);_0x514600[_0x50c5b8(0x139)](_0x100512,{'path':_0x100512,'bytes':_0x49657e});}return Array[_0x50c5b8(0x126)](_0x514600[_0x50c5b8(0x12f)]())['sort'](compareSkillFiles);}export function normalizeManifestFiles(_0x17cb7f){const _0x3986ab=a143_0x5097;if(!Array['isArray'](_0x17cb7f)||_0x17cb7f['length']===0x0)return[];const _0x2ca3d6=new Map();for(const _0x544ca3 of _0x17cb7f){if(!_0x544ca3||typeof _0x544ca3!==_0x3986ab(0x13c)||typeof _0x544ca3[_0x3986ab(0x130)]!==_0x3986ab(0x124))throw CliErrors['validation'](_0x3986ab(0x120));const _0x50b9f2=normalizeSkillRelativePath(_0x544ca3[_0x3986ab(0x130)]);if(_0x2ca3d6['has'](_0x50b9f2))throw CliErrors[_0x3986ab(0x11f)]('Duplicate\x20Skill\x20file\x20path:\x20'+_0x50b9f2);if(!isSha256Hex(_0x544ca3['sha256']))throw CliErrors[_0x3986ab(0x11f)](_0x3986ab(0x11b)+_0x50b9f2);if(!Number[_0x3986ab(0x137)](_0x544ca3['size'])||_0x544ca3[_0x3986ab(0x12d)]<0x0)throw CliErrors[_0x3986ab(0x11f)](_0x3986ab(0x131)+_0x50b9f2);_0x2ca3d6['set'](_0x50b9f2,{'path':_0x50b9f2,'sha256':_0x544ca3[_0x3986ab(0x129)][_0x3986ab(0x113)](),'size':_0x544ca3[_0x3986ab(0x12d)]});}return Array[_0x3986ab(0x126)](_0x2ca3d6[_0x3986ab(0x12f)]())[_0x3986ab(0x125)](compareSkillFiles);}export function scanSkillDirectory(_0x14fb17,_0x171a53={}){const _0x11e36e=a143_0x5097,_0x422041=realpathSync(_0x14fb17),_0x3ea8b9=canonicalExcludedFilePaths(_0x171a53[_0x11e36e(0x13e)]),_0x4b0212=[];function _0x1eb793(_0x294ed0){const _0xf9e74c=_0x11e36e,_0x5e0a61=readdirSync(_0x294ed0,{'withFileTypes':!![]})[_0xf9e74c(0x125)]((_0xcee4aa,_0x5bf16c)=>_0xcee4aa['name'][_0xf9e74c(0x117)](_0x5bf16c['name']));for(const _0x448394 of _0x5e0a61){if(_0x448394[_0xf9e74c(0x12b)]()&&IGNORED_DIR_NAMES[_0xf9e74c(0x122)](_0x448394[_0xf9e74c(0x123)]))continue;if(IGNORED_FILE_NAMES[_0xf9e74c(0x122)](_0x448394[_0xf9e74c(0x123)]))continue;const _0x5d0190=resolve(_0x294ed0,_0x448394[_0xf9e74c(0x123)]);if(isExcludedFilePath(_0x5d0190,_0x3ea8b9))continue;if(_0x448394[_0xf9e74c(0x134)]())throw CliErrors[_0xf9e74c(0x11f)](_0xf9e74c(0x135)+_0x5d0190);const _0x1b76ca=toPosixPath(relative(_0x422041,_0x5d0190));if(_0x448394[_0xf9e74c(0x12b)]()){_0x1eb793(_0x5d0190);continue;}if(!_0x448394['isFile']())continue;validateSkillRelativePath(_0x1b76ca);const _0x572356=readFileSync(_0x5d0190);_0x4b0212[_0xf9e74c(0x115)]({'path':_0x1b76ca,'bytes':_0x572356});}}return _0x1eb793(_0x422041),normalizeLocalFiles(_0x4b0212);}function a143_0x2fcb(){const _0x2d60dc=['excludedFilePaths','450464tidmpV','split','toLowerCase','1340jNeFYW','push','648078qHtyBR','localeCompare','147620qzKiEI','utf8','test','Skill\x20file\x20sha256\x20is\x20invalid:\x20','Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20','toString','1672810aHpgAK','validation','Skill\x20file\x20path\x20must\x20be\x20text.','2cOpXLI','has','name','string','sort','from','add','Duplicate\x20Skill\x20file\x20path:\x20','sha256','includes','isDirectory','bytes','size','isArray','values','path','Skill\x20file\x20size\x20is\x20invalid:\x20','length','68824cJpHQI','isSymbolicLink','Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20','Unsafe\x20Skill\x20file\x20path:\x20','isSafeInteger','isBuffer','set','2155NuRuie','18rpxRlQ','object','451086HewOKK'];a143_0x2fcb=function(){return _0x2d60dc;};return a143_0x2fcb();}function canonicalExcludedFilePaths(_0x216790){const _0x15b362=a143_0x5097,_0x4ac033=new Set();for(const _0xb16ec8 of _0x216790??[]){const _0x21cbfe=resolve(_0xb16ec8);_0x4ac033[_0x15b362(0x127)](_0x21cbfe);try{_0x4ac033[_0x15b362(0x127)](realpathSync(_0x21cbfe));}catch{}}return _0x4ac033;}function isExcludedFilePath(_0x5f1203,_0x483498){const _0x5236ee=a143_0x5097;if(_0x483498[_0x5236ee(0x122)](_0x5f1203))return!![];if(_0x483498[_0x5236ee(0x12d)]===0x0)return![];try{return _0x483498[_0x5236ee(0x122)](realpathSync(_0x5f1203));}catch{return![];}}export function compareSkillFiles(_0x1dcd5a,_0x11d179){const _0x35e2ac=a143_0x5097;if(_0x1dcd5a['path']===SKILL_FILE)return _0x11d179['path']===SKILL_FILE?0x0:-0x1;if(_0x11d179[_0x35e2ac(0x130)]===SKILL_FILE)return 0x1;return Buffer['compare'](Buffer[_0x35e2ac(0x126)](_0x1dcd5a['path'],'utf8'),Buffer['from'](_0x11d179[_0x35e2ac(0x130)],_0x35e2ac(0x119)));}export function normalizeSkillRelativePath(_0x13504c){const _0x2fbb5a=toPosixPath(_0x13504c['trim']());return validateSkillRelativePath(_0x2fbb5a),_0x2fbb5a;}export function validateSkillRelativePath(_0x3cf2f8){const _0x2948be=a143_0x5097;if(!_0x3cf2f8||_0x3cf2f8['startsWith']('/')||_0x3cf2f8[_0x2948be(0x12a)]('//'))throw CliErrors['validation'](_0x2948be(0x136)+_0x3cf2f8);for(const _0x43d124 of _0x3cf2f8[_0x2948be(0x112)]('/')){if(!_0x43d124||_0x43d124==='.'||_0x43d124==='..')throw CliErrors[_0x2948be(0x11f)](_0x2948be(0x136)+_0x3cf2f8);}}export function toPosixPath(_0xeddce8){return _0xeddce8['replace'](/\\/g,'/');}export function isSha256Hex(_0x23206a){const _0x175825=a143_0x5097;return typeof _0x23206a===_0x175825(0x124)&&/^[a-fA-F0-9]{64}$/[_0x175825(0x11a)](_0x23206a);}
1
+ (function(_0x215b4f,_0x42e446){const _0x14aa8a=a143_0x5c90,_0x35e917=_0x215b4f();while(!![]){try{const _0x28c2e3=parseInt(_0x14aa8a(0xaf))/0x1+-parseInt(_0x14aa8a(0xc1))/0x2+parseInt(_0x14aa8a(0xa2))/0x3*(parseInt(_0x14aa8a(0xa3))/0x4)+-parseInt(_0x14aa8a(0xab))/0x5*(parseInt(_0x14aa8a(0xb1))/0x6)+-parseInt(_0x14aa8a(0xad))/0x7+-parseInt(_0x14aa8a(0x9e))/0x8+-parseInt(_0x14aa8a(0x97))/0x9*(-parseInt(_0x14aa8a(0xac))/0xa);if(_0x28c2e3===_0x42e446)break;else _0x35e917['push'](_0x35e917['shift']());}catch(_0x558b36){_0x35e917['push'](_0x35e917['shift']());}}}(a143_0x3c74,0xf18dc));import{readFileSync,readdirSync,realpathSync}from'node:fs';import{relative,resolve}from'node:path';import{CliErrors}from'../../errors.js';import{IGNORED_DIR_NAMES,IGNORED_FILE_NAMES,SKILL_FILE}from'./constants.js';function a143_0x5c90(_0x3b1b42,_0x26a1d0){_0x3b1b42=_0x3b1b42-0x91;const _0x3c7471=a143_0x3c74();let _0x5c904d=_0x3c7471[_0x3b1b42];return _0x5c904d;}export function fileContent(_0x26a40d){const _0x135198=a143_0x5c90;return _0x26a40d[_0x135198(0xa1)]??Buffer['from'](_0x26a40d['content']??'',_0x135198(0xb2));}export function fileText(_0x5de311){const _0x141a23=a143_0x5c90;return fileContent(_0x5de311)[_0x141a23(0xba)](_0x141a23(0xb2));}export function normalizeLocalFiles(_0x4e6e05){const _0x2f7f17=a143_0x5c90;if(!Array[_0x2f7f17(0x95)](_0x4e6e05)||_0x4e6e05[_0x2f7f17(0xbd)]===0x0)return[];const _0x570ba1=new Map();for(const _0x33a906 of _0x4e6e05){if(!_0x33a906||typeof _0x33a906!=='object'||typeof _0x33a906['path']!=='string')throw CliErrors[_0x2f7f17(0x91)](_0x2f7f17(0xb5));const _0x77b177=normalizeSkillRelativePath(_0x33a906[_0x2f7f17(0xa5)]);if(_0x570ba1[_0x2f7f17(0xb6)](_0x77b177))throw CliErrors[_0x2f7f17(0x91)](_0x2f7f17(0xb4)+_0x77b177);if(_0x33a906['bytes']!==undefined&&!Buffer[_0x2f7f17(0x99)](_0x33a906['bytes']))throw CliErrors[_0x2f7f17(0x91)](_0x2f7f17(0xb8)+_0x77b177);if(_0x33a906[_0x2f7f17(0xa1)]===undefined&&typeof _0x33a906[_0x2f7f17(0x96)]!=='string')throw CliErrors['validation'](_0x2f7f17(0xa4)+_0x77b177);const _0x9a5893=fileContent(_0x33a906);_0x570ba1[_0x2f7f17(0xaa)](_0x77b177,{'path':_0x77b177,'bytes':_0x9a5893});}return Array['from'](_0x570ba1[_0x2f7f17(0x9b)]())[_0x2f7f17(0xc0)](compareSkillFiles);}export function normalizeManifestFiles(_0x392baf){const _0x489c12=a143_0x5c90;if(!Array[_0x489c12(0x95)](_0x392baf)||_0x392baf['length']===0x0)return[];const _0x241c34=new Map();for(const _0x41b236 of _0x392baf){if(!_0x41b236||typeof _0x41b236!==_0x489c12(0x93)||typeof _0x41b236[_0x489c12(0xa5)]!==_0x489c12(0xa7))throw CliErrors['validation'](_0x489c12(0xb5));const _0x500b8f=normalizeSkillRelativePath(_0x41b236[_0x489c12(0xa5)]);if(_0x241c34[_0x489c12(0xb6)](_0x500b8f))throw CliErrors[_0x489c12(0x91)](_0x489c12(0xb4)+_0x500b8f);if(!isSha256Hex(_0x41b236[_0x489c12(0xb3)]))throw CliErrors['validation'](_0x489c12(0x9c)+_0x500b8f);if(!Number[_0x489c12(0x92)](_0x41b236[_0x489c12(0xa9)])||_0x41b236[_0x489c12(0xa9)]<0x0)throw CliErrors[_0x489c12(0x91)](_0x489c12(0xbc)+_0x500b8f);_0x241c34['set'](_0x500b8f,{'path':_0x500b8f,'sha256':_0x41b236['sha256'][_0x489c12(0xbf)](),'size':_0x41b236[_0x489c12(0xa9)]});}return Array[_0x489c12(0xb0)](_0x241c34[_0x489c12(0x9b)]())[_0x489c12(0xc0)](compareSkillFiles);}function a143_0x3c74(){const _0x100d02=['length','test','toLowerCase','sort','3954712cYfwKv','validation','isSafeInteger','object','trim','isArray','content','18417177civQAs','add','isBuffer','name','values','Skill\x20file\x20sha256\x20is\x20invalid:\x20','excludedFilePaths','3793664bPJZZz','split','Unsafe\x20Skill\x20file\x20path:\x20','bytes','60AIsvBX','199324iDJwbD','Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20','path','isSymbolicLink','string','Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20','size','set','5AAkDJn','20zonTMw','10537842GmGHZl','compare','707724tWjgxj','from','5104056AuTqGK','utf8','sha256','Duplicate\x20Skill\x20file\x20path:\x20','Skill\x20file\x20path\x20must\x20be\x20text.','has','isDirectory','Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20','includes','toString','startsWith','Skill\x20file\x20size\x20is\x20invalid:\x20'];a143_0x3c74=function(){return _0x100d02;};return a143_0x3c74();}export function scanSkillDirectory(_0x5de986,_0x301c38={}){const _0x1ed7dd=a143_0x5c90,_0x4d19e4=realpathSync(_0x5de986),_0x42b11c=canonicalExcludedFilePaths(_0x301c38[_0x1ed7dd(0x9d)]),_0x40e740=[];function _0x16489e(_0x4b4efe){const _0x567894=_0x1ed7dd,_0x5a2f45=readdirSync(_0x4b4efe,{'withFileTypes':!![]})[_0x567894(0xc0)]((_0x424030,_0x499d9f)=>_0x424030[_0x567894(0x9a)]['localeCompare'](_0x499d9f['name']));for(const _0x482353 of _0x5a2f45){if(_0x482353[_0x567894(0xb7)]()&&IGNORED_DIR_NAMES[_0x567894(0xb6)](_0x482353[_0x567894(0x9a)]))continue;if(IGNORED_FILE_NAMES[_0x567894(0xb6)](_0x482353['name']))continue;const _0x45c9e8=resolve(_0x4b4efe,_0x482353[_0x567894(0x9a)]);if(isExcludedFilePath(_0x45c9e8,_0x42b11c))continue;if(_0x482353[_0x567894(0xa6)]())throw CliErrors[_0x567894(0x91)](_0x567894(0xa8)+_0x45c9e8);const _0x57733f=toPosixPath(relative(_0x4d19e4,_0x45c9e8));if(_0x482353[_0x567894(0xb7)]()){_0x16489e(_0x45c9e8);continue;}if(!_0x482353['isFile']())continue;validateSkillRelativePath(_0x57733f);const _0xded98d=readFileSync(_0x45c9e8);_0x40e740['push']({'path':_0x57733f,'bytes':_0xded98d});}}return _0x16489e(_0x4d19e4),normalizeLocalFiles(_0x40e740);}function canonicalExcludedFilePaths(_0x37cb58){const _0x3a30f6=a143_0x5c90,_0xda3849=new Set();for(const _0x5c5a73 of _0x37cb58??[]){const _0x10bfc7=resolve(_0x5c5a73);_0xda3849[_0x3a30f6(0x98)](_0x10bfc7);try{_0xda3849[_0x3a30f6(0x98)](realpathSync(_0x10bfc7));}catch{}}return _0xda3849;}function isExcludedFilePath(_0x5c21a2,_0x108e00){const _0x42b22a=a143_0x5c90;if(_0x108e00[_0x42b22a(0xb6)](_0x5c21a2))return!![];if(_0x108e00[_0x42b22a(0xa9)]===0x0)return![];try{return _0x108e00[_0x42b22a(0xb6)](realpathSync(_0x5c21a2));}catch{return![];}}export function compareSkillFiles(_0x19e89b,_0x4baf21){const _0x3e1c52=a143_0x5c90;if(_0x19e89b[_0x3e1c52(0xa5)]===SKILL_FILE)return _0x4baf21[_0x3e1c52(0xa5)]===SKILL_FILE?0x0:-0x1;if(_0x4baf21[_0x3e1c52(0xa5)]===SKILL_FILE)return 0x1;return Buffer[_0x3e1c52(0xae)](Buffer[_0x3e1c52(0xb0)](_0x19e89b['path'],_0x3e1c52(0xb2)),Buffer['from'](_0x4baf21['path'],'utf8'));}export function normalizeSkillRelativePath(_0x4c4b42){const _0xb04a68=a143_0x5c90,_0x2ef774=toPosixPath(_0x4c4b42[_0xb04a68(0x94)]());return validateSkillRelativePath(_0x2ef774),_0x2ef774;}export function validateSkillRelativePath(_0x2068cf){const _0x4bd169=a143_0x5c90;if(!_0x2068cf||_0x2068cf[_0x4bd169(0xbb)]('/')||_0x2068cf[_0x4bd169(0xb9)]('//'))throw CliErrors[_0x4bd169(0x91)](_0x4bd169(0xa0)+_0x2068cf);for(const _0x47d3be of _0x2068cf[_0x4bd169(0x9f)]('/')){if(!_0x47d3be||_0x47d3be==='.'||_0x47d3be==='..')throw CliErrors[_0x4bd169(0x91)](_0x4bd169(0xa0)+_0x2068cf);}}export function toPosixPath(_0x22a0ef){return _0x22a0ef['replace'](/\\/g,'/');}export function isSha256Hex(_0x5c15f7){const _0x2657c1=a143_0x5c90;return typeof _0x5c15f7==='string'&&/^[a-fA-F0-9]{64}$/[_0x2657c1(0xbe)](_0x5c15f7);}
@@ -1 +1 @@
1
- (function(_0x377478,_0x1fea2f){const _0x5b3b89=a144_0xa471,_0x2882de=_0x377478();while(!![]){try{const _0x270d19=parseInt(_0x5b3b89(0x1e2))/0x1*(-parseInt(_0x5b3b89(0x1d7))/0x2)+parseInt(_0x5b3b89(0x1ed))/0x3*(parseInt(_0x5b3b89(0x1fd))/0x4)+-parseInt(_0x5b3b89(0x1cd))/0x5+-parseInt(_0x5b3b89(0x1de))/0x6*(parseInt(_0x5b3b89(0x1d8))/0x7)+-parseInt(_0x5b3b89(0x1ca))/0x8*(parseInt(_0x5b3b89(0x1d3))/0x9)+-parseInt(_0x5b3b89(0x1e8))/0xa*(-parseInt(_0x5b3b89(0x1f0))/0xb)+parseInt(_0x5b3b89(0x1cb))/0xc*(parseInt(_0x5b3b89(0x1e9))/0xd);if(_0x270d19===_0x1fea2f)break;else _0x2882de['push'](_0x2882de['shift']());}catch(_0x3b6b89){_0x2882de['push'](_0x2882de['shift']());}}}(a144_0x5593,0x64cd0));import{existsSync,lstatSync,mkdirSync,readFileSync,rmSync}from'node:fs';import{dirname,resolve}from'node:path';import{isCollection,isMap,isNode,parseDocument,visit}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{resolveManagedFilePath,writeBytesAtomic,writeJsonAtomic}from'./fs-utils.js';import{bufferSha256,contentHash,fileHash}from'./hashing.js';import{fileContent,fileText,normalizeLocalFiles}from'./local-files.js';import{buildMetadata,readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillDir}from'./paths.js';function a144_0xa471(_0x70f290,_0x3eca7a){_0x70f290=_0x70f290-0x1c7;const _0x55939d=a144_0x5593();let _0xa47114=_0x55939d[_0x70f290];return _0xa47114;}import{extractDownloadedPackage,requirePackageBytes}from'./zip-package.js';export function materializeRuntimeSkill(_0x3dc8c7,_0x1878f7,_0x1e9a06){const _0x4c4057=a144_0xa471,_0x712a2a=requireSkillCode(_0x3dc8c7),_0xaebe1c=requirePackageBytes(_0x712a2a,_0x1e9a06['packageBytes']),_0x5b5cde=extractDownloadedPackage(_0xaebe1c),_0xee5873=_0x5b5cde[_0x4c4057(0x1df)](_0x4a4861=>_0x4a4861[_0x4c4057(0x1f3)]===SKILL_FILE);if(!_0xee5873)throw CliErrors[_0x4c4057(0x1ec)](_0x4c4057(0x1dd)+SKILL_FILE+':\x20'+_0x712a2a);const _0x353d88=withMaterializedSkillFrontmatter(_0x5b5cde,_0x3dc8c7,_0x712a2a),_0x2acc4a=_0x353d88[_0x4c4057(0x1df)](_0x292b94=>_0x292b94[_0x4c4057(0x1f3)]===SKILL_FILE),_0x4e9036=fileText(_0x2acc4a),_0x5a4678=getRuntimeSkillDir(_0x1e9a06[_0x4c4057(0x1f1)],_0x1e9a06['accessKey'],_0x1e9a06[_0x4c4057(0x1c9)],_0x1878f7,_0x712a2a,_0x1e9a06[_0x4c4057(0x1f4)]),_0x2ad7c7=resolve(_0x5a4678,SKILL_FILE),_0x2d9541=resolve(_0x5a4678,METADATA_FILE),_0x3dd2c9=contentHash(_0x4e9036),_0x47404d=readMetadataIfPresent(_0x2d9541)?.[_0x4c4057(0x1e6)];ensurePulledFilesCanBeOverwritten(_0x5a4678,_0x2d9541,_0x353d88,_0x1e9a06['force']===!![]),mkdirSync(_0x5a4678,{'recursive':!![],'mode':0x1c0});const _0x59b8ea=existsSync(_0x2ad7c7)?readFileSync(_0x2ad7c7,_0x4c4057(0x1f2)):undefined;return materializeFiles(_0x5a4678,_0x353d88),removeStaleManagedFiles(_0x5a4678,_0x47404d,_0x353d88),writeJsonAtomic(_0x2d9541,buildMetadata(_0x3dc8c7,_0x1878f7,_0x1e9a06[_0x4c4057(0x1c9)],_0x3dd2c9,_0x1e9a06['pulledAt'],_0x353d88,_0xaebe1c)),{'skill':_0x3dc8c7,'scope':_0x1878f7,'dir':_0x5a4678,'skillMdPath':_0x2ad7c7,'metadataPath':_0x2d9541,'contentHash':_0x3dd2c9,'changed':_0x59b8ea!==_0x4e9036};}function a144_0x5593(){const _0x276e94=['length','delete','472baaPIl','match','keys','test','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.','description','join','status','Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20','\x0a---\x0a\x0a','hasOwn','appCode','120gggdhK','19092xclSBk','schemaVersion','1628175cXBYXJ','trim','---','isFile','---\x0a','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','48294dohICm','displayName:\x20','trimEnd','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','693790iOPyrn','4683147XHfJgv','has','example','description:\x20','replace','Runtime\x20Skill\x20package\x20is\x20missing\x20','6xAeYlp','find','contentHash','accessKey','2iEogqR','skillName','slice','version','fileHashes','name','1065640xJECPn','11596lWcIUf','toString','displayName','validation','16680UhHnlR','scope','set','11VzVxIo','env','utf8','path','paths','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','name:\x20','stringify','flow','Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20','filter'];a144_0x5593=function(){return _0x276e94;};return a144_0x5593();}export function reuseMaterializedRuntimeSkill(_0x2d90b0,_0x388ae7,_0x1f9f4d){const _0x29d4a0=a144_0xa471,_0x194034=_0x2d90b0['version']?.[_0x29d4a0(0x1ce)]();if(!_0x194034)return undefined;const _0x219371=requireSkillCode(_0x2d90b0),_0x558a52=getRuntimeSkillDir(_0x1f9f4d['env'],_0x1f9f4d[_0x29d4a0(0x1e1)],_0x1f9f4d[_0x29d4a0(0x1c9)],_0x388ae7,_0x219371,_0x1f9f4d['paths']),_0x461729=resolve(_0x558a52,SKILL_FILE),_0x593cdb=resolve(_0x558a52,METADATA_FILE),_0x5ac551=readMetadataIfPresent(_0x593cdb);if(!_0x5ac551||_0x5ac551[_0x29d4a0(0x1cc)]!==0x2||_0x5ac551[_0x29d4a0(0x1c9)]!==_0x1f9f4d['appCode']||_0x5ac551[_0x29d4a0(0x1ee)]!==_0x388ae7||_0x5ac551['skillCode']!==_0x219371||_0x5ac551[_0x29d4a0(0x1e5)]!==_0x194034||_0x5ac551['id']!==_0x2d90b0['id']||_0x5ac551[_0x29d4a0(0x1e3)]!==_0x2d90b0[_0x29d4a0(0x1e3)]||_0x5ac551['description']!==_0x2d90b0['description']||_0x5ac551[_0x29d4a0(0x1da)]!==_0x2d90b0[_0x29d4a0(0x1da)]||_0x5ac551[_0x29d4a0(0x204)]!==_0x2d90b0[_0x29d4a0(0x204)]||!_0x5ac551[_0x29d4a0(0x1e0)]||!_0x5ac551[_0x29d4a0(0x1e6)]||!Object[_0x29d4a0(0x1c8)](_0x5ac551[_0x29d4a0(0x1e6)],SKILL_FILE))return undefined;for(const [_0x52404d,_0x5eabe9]of Object['entries'](_0x5ac551[_0x29d4a0(0x1e6)])){if(!/^[a-f0-9]{64}$/[_0x29d4a0(0x200)](_0x5eabe9))return undefined;const _0x4e87b9=resolveManagedFilePath(_0x558a52,_0x52404d);if(!existsSync(_0x4e87b9)||!lstatSync(_0x4e87b9)[_0x29d4a0(0x1d0)]())return undefined;if(bufferSha256(readFileSync(_0x4e87b9))!==_0x5eabe9)return undefined;}return{'skill':_0x2d90b0,'scope':_0x388ae7,'dir':_0x558a52,'skillMdPath':_0x461729,'metadataPath':_0x593cdb,'contentHash':_0x5ac551[_0x29d4a0(0x1e0)],'changed':![]};}function withMaterializedSkillFrontmatter(_0x4f6264,_0x1856fb,_0x11a307){const _0x3f331f=a144_0xa471,_0xd47f36=skillDisplayName(_0x1856fb,_0x11a307),_0x120ae7=_0x1856fb['description']?.[_0x3f331f(0x1ce)]()||_0xd47f36||_0x11a307;return normalizeLocalFiles(_0x4f6264)['map'](_0x3c6f26=>{const _0x6296c5=fileText(_0x3c6f26);if(_0x3c6f26['path']!==SKILL_FILE)return _0x3c6f26;if(hasYamlFrontmatter(_0x6296c5))return{'path':_0x3c6f26['path'],'content':withSyncedDisplayName(_0x6296c5,_0xd47f36)};return{'path':_0x3c6f26['path'],'content':prependSkillFrontmatter(_0x6296c5,{'name':_0x11a307,'displayName':_0xd47f36,'description':_0x120ae7})};});}function hasYamlFrontmatter(_0x1ca4ed){const _0x3e3bb2=a144_0xa471;return/^\uFEFF?---\s*\r?\n/[_0x3e3bb2(0x200)](_0x1ca4ed);}function prependSkillFrontmatter(_0x1f7f8f,_0x16f227){const _0xb174e7=a144_0xa471,_0x3fd64c=_0x1f7f8f[_0xb174e7(0x1dc)](/^\uFEFF/,'');return[_0xb174e7(0x1cf),_0xb174e7(0x1f6)+yamlString(_0x16f227[_0xb174e7(0x1e7)]),_0x16f227[_0xb174e7(0x1eb)]?_0xb174e7(0x1d4)+yamlString(_0x16f227['displayName']):undefined,_0xb174e7(0x1db)+yamlString(_0x16f227[_0xb174e7(0x202)]),_0xb174e7(0x1cf),'',_0x3fd64c][_0xb174e7(0x1fa)](_0x347140=>_0x347140!==undefined)[_0xb174e7(0x203)]('\x0a');}function yamlString(_0x2b5b3e){const _0x24ef05=a144_0xa471;return JSON[_0x24ef05(0x1f7)](_0x2b5b3e['replace'](/\r/g,'')[_0x24ef05(0x1ce)]());}function skillDisplayName(_0x141221,_0x4db976){const _0x5660b5=a144_0xa471,_0x41c84b=_0x141221[_0x5660b5(0x1e3)]?.[_0x5660b5(0x1ce)]();return _0x41c84b||_0x4db976;}function withSyncedDisplayName(_0x391b78,_0x2cd503){const _0x4725a7=a144_0xa471,_0x1eb31e=_0x391b78[_0x4725a7(0x1fe)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x1eb31e)return _0x391b78;const _0xaa016e=_0x1eb31e[0x1]??'',_0x1ba58d=_0x1eb31e[0x2]??'',_0x4403bf=parseDocument(_0x1ba58d);if(_0x4403bf['errors'][_0x4725a7(0x1fb)]>0x0||!isMap(_0x4403bf['contents']))return _0x391b78;if(_0x2cd503)_0x4403bf[_0x4725a7(0x1ef)](_0x4725a7(0x1eb),_0x2cd503);else{if(_0x4403bf['has']('displayName'))_0x4403bf[_0x4725a7(0x1fc)](_0x4725a7(0x1eb));else return _0x391b78;}forceBlockCollections(_0x4403bf['contents']);const _0x3d1d77=_0x4403bf[_0x4725a7(0x1ea)]({'lineWidth':0x0})[_0x4725a7(0x1d5)](),_0x17b2d8=_0x391b78[_0x4725a7(0x1e4)](_0x1eb31e[0x0][_0x4725a7(0x1fb)])[_0x4725a7(0x1dc)](/^\r?\n/,'');return _0xaa016e+_0x4725a7(0x1d1)+_0x3d1d77+_0x4725a7(0x1c7)+_0x17b2d8;}function forceBlockCollections(_0x507f49){if(!isNode(_0x507f49))return;visit(_0x507f49,(_0x1f7a18,_0x3e3b7c)=>{const _0x446f37=a144_0xa471;isCollection(_0x3e3b7c)&&(_0x3e3b7c[_0x446f37(0x1f8)]=![]);});}function ensurePulledFilesCanBeOverwritten(_0x560e7a,_0xbddb66,_0x13e349,_0x1a34db){const _0x37b90d=a144_0xa471;if(_0x1a34db||!existsSync(_0xbddb66))return;const _0xb4324c=readMetadataIfPresent(_0xbddb66);if(!_0xb4324c)return;const _0x128567=_0xb4324c[_0x37b90d(0x1e6)]&&Object['keys'](_0xb4324c[_0x37b90d(0x1e6)])[_0x37b90d(0x1fb)]>0x0?_0xb4324c[_0x37b90d(0x1e6)]:undefined;if(_0x128567)for(const [_0x12e9cc,_0x24175d]of Object['entries'](_0x128567)){const _0x43f44b=resolveManagedFilePath(_0x560e7a,_0x12e9cc);if(!existsSync(_0x43f44b))throw CliErrors[_0x37b90d(0x1ec)](_0x37b90d(0x1d6)+_0x560e7a,'Managed\x20file\x20was\x20removed\x20locally:\x20'+_0x12e9cc);const _0x3f385e=lstatSync(_0x43f44b);if(!_0x3f385e[_0x37b90d(0x1d0)]())throw CliErrors['validation'](_0x37b90d(0x1d6)+_0x560e7a,_0x37b90d(0x205)+_0x12e9cc);const _0x2524b3=bufferSha256(readFileSync(_0x43f44b));if(_0x2524b3!==_0x24175d)throw CliErrors['validation'](_0x37b90d(0x1d6)+_0x560e7a+'.\x20Changed\x20file:\x20'+_0x12e9cc,_0x37b90d(0x1d2)+_0x12e9cc);}else{const _0x3c04d4=resolve(_0x560e7a,SKILL_FILE);if(existsSync(_0x3c04d4)&&_0xb4324c['contentHash']){const _0x1f2383=contentHash(readFileSync(_0x3c04d4,_0x37b90d(0x1f2)));if(_0x1f2383!==_0xb4324c[_0x37b90d(0x1e0)])throw CliErrors[_0x37b90d(0x1ec)]('Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20'+_0x3c04d4,_0x37b90d(0x201));}}for(const _0x15090f of normalizeLocalFiles(_0x13e349)){if(_0x128567?.[_0x15090f[_0x37b90d(0x1f3)]])continue;if(!_0x128567&&_0x15090f[_0x37b90d(0x1f3)]===SKILL_FILE)continue;const _0x55dd16=resolveManagedFilePath(_0x560e7a,_0x15090f[_0x37b90d(0x1f3)]);if(!existsSync(_0x55dd16))continue;const _0x52f87d=lstatSync(_0x55dd16);if(!_0x52f87d[_0x37b90d(0x1d0)]())throw CliErrors[_0x37b90d(0x1ec)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x560e7a,_0x37b90d(0x1f5)+_0x15090f['path']);const _0x399289=bufferSha256(readFileSync(_0x55dd16));if(_0x399289!==fileHash(_0x15090f))throw CliErrors[_0x37b90d(0x1ec)](_0x37b90d(0x1d6)+_0x560e7a,_0x37b90d(0x1f9)+_0x15090f[_0x37b90d(0x1f3)]);}}function materializeFiles(_0x483420,_0x5dde1c){const _0x3f4727=a144_0xa471;for(const _0x1d4483 of normalizeLocalFiles(_0x5dde1c)){const _0x456c11=resolveManagedFilePath(_0x483420,_0x1d4483[_0x3f4727(0x1f3)]);mkdirSync(dirname(_0x456c11),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x456c11,fileContent(_0x1d4483),0x180);}}function removeStaleManagedFiles(_0x56ce27,_0x23c003,_0x21bfa4){const _0x376824=a144_0xa471;if(!_0x23c003)return;const _0x1e3cf8=new Set(normalizeLocalFiles(_0x21bfa4)['map'](_0x3880e5=>_0x3880e5[_0x376824(0x1f3)]));for(const _0x37dc4a of Object[_0x376824(0x1ff)](_0x23c003)){if(_0x1e3cf8[_0x376824(0x1d9)](_0x37dc4a))continue;const _0x57663f=resolveManagedFilePath(_0x56ce27,_0x37dc4a);existsSync(_0x57663f)&&lstatSync(_0x57663f)[_0x376824(0x1d0)]()&&rmSync(_0x57663f,{'force':!![]});}}
1
+ (function(_0x124b52,_0x388416){const _0x157669=a144_0x7383,_0x4394cf=_0x124b52();while(!![]){try{const _0x55b2e5=-parseInt(_0x157669(0x1e9))/0x1+-parseInt(_0x157669(0x1d5))/0x2*(-parseInt(_0x157669(0x1e5))/0x3)+parseInt(_0x157669(0x1e8))/0x4+-parseInt(_0x157669(0x1dd))/0x5+parseInt(_0x157669(0x1e1))/0x6+parseInt(_0x157669(0x1e7))/0x7*(-parseInt(_0x157669(0x1f6))/0x8)+-parseInt(_0x157669(0x1c0))/0x9*(-parseInt(_0x157669(0x1cd))/0xa);if(_0x55b2e5===_0x388416)break;else _0x4394cf['push'](_0x4394cf['shift']());}catch(_0x5ead7e){_0x4394cf['push'](_0x4394cf['shift']());}}}(a144_0x364f,0xd7fe7));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 a144_0x364f(){const _0x5b9a53=['5121720lFexbj','env','appCode','skillCode','10375722mYFXWj','status','validation','Managed\x20file\x20was\x20removed\x20locally:\x20','771ydDgQK','displayName:\x20','19418OLtYTv','3366944eSmrvE','1001271quRunP','join','\x0a---\x0a\x0a','accessKey','.\x20Changed\x20file:\x20','example','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','trim','force','match','length','hasOwn','skillName','4768OKFnoY','packageBytes','entries','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','---\x0a','Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20','test','has','34947iylJCa','fileHashes','Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20','pulledAt','isFile','scope','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','keys','slice','flow','contentHash','delete','toString','4620BCfXvg','paths','errors','path','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','map','utf8','version','1546cZSNdO','contents','filter','name','replace','description','set','---'];a144_0x364f=function(){return _0x5b9a53;};return a144_0x364f();}import{resolveManagedFilePath,writeBytesAtomic,writeJsonAtomic}from'./fs-utils.js';import{bufferSha256,contentHash,fileHash}from'./hashing.js';import{fileContent,fileText,normalizeLocalFiles}from'./local-files.js';import{buildMetadata,readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillDir}from'./paths.js';import{extractDownloadedPackage,requirePackageBytes}from'./zip-package.js';export function materializeRuntimeSkill(_0xfeb18c,_0x258845,_0x2a2c71){const _0x4a02f7=a144_0x7383,_0x436d6f=requireSkillCode(_0xfeb18c),_0x26e17d=requirePackageBytes(_0x436d6f,_0x2a2c71[_0x4a02f7(0x1f7)]),_0x36d277=extractDownloadedPackage(_0x26e17d),_0x126fe6=_0x36d277['find'](_0x303aa1=>_0x303aa1[_0x4a02f7(0x1d0)]===SKILL_FILE);if(!_0x126fe6)throw CliErrors['validation']('Runtime\x20Skill\x20package\x20is\x20missing\x20'+SKILL_FILE+':\x20'+_0x436d6f);const _0x397ee3=withMaterializedSkillFrontmatter(_0x36d277,_0xfeb18c,_0x436d6f),_0xec0872=_0x397ee3['find'](_0x15e733=>_0x15e733['path']===SKILL_FILE),_0x5569b8=fileText(_0xec0872),_0x3a065f=getRuntimeSkillDir(_0x2a2c71['env'],_0x2a2c71[_0x4a02f7(0x1ec)],_0x2a2c71[_0x4a02f7(0x1df)],_0x258845,_0x436d6f,_0x2a2c71[_0x4a02f7(0x1ce)]),_0x342ae6=resolve(_0x3a065f,SKILL_FILE),_0x2abed7=resolve(_0x3a065f,METADATA_FILE),_0x5d189c=contentHash(_0x5569b8),_0x2009a9=readMetadataIfPresent(_0x2abed7)?.['fileHashes'];ensurePulledFilesCanBeOverwritten(_0x3a065f,_0x2abed7,_0x397ee3,_0x2a2c71[_0x4a02f7(0x1f1)]===!![]),mkdirSync(_0x3a065f,{'recursive':!![],'mode':0x1c0});const _0x142f28=existsSync(_0x342ae6)?readFileSync(_0x342ae6,_0x4a02f7(0x1d3)):undefined;return materializeFiles(_0x3a065f,_0x397ee3),removeStaleManagedFiles(_0x3a065f,_0x2009a9,_0x397ee3),writeJsonAtomic(_0x2abed7,buildMetadata(_0xfeb18c,_0x258845,_0x2a2c71['appCode'],_0x5d189c,_0x2a2c71[_0x4a02f7(0x1c3)],_0x397ee3,_0x26e17d)),{'skill':_0xfeb18c,'scope':_0x258845,'dir':_0x3a065f,'skillMdPath':_0x342ae6,'metadataPath':_0x2abed7,'contentHash':_0x5d189c,'changed':_0x142f28!==_0x5569b8};}export function reuseMaterializedRuntimeSkill(_0xfafc93,_0x38250f,_0xd633e9){const _0x49f122=a144_0x7383,_0x286164=_0xfafc93['version']?.['trim']();if(!_0x286164)return undefined;const _0x1f8204=requireSkillCode(_0xfafc93),_0x1ae8fa=getRuntimeSkillDir(_0xd633e9[_0x49f122(0x1de)],_0xd633e9[_0x49f122(0x1ec)],_0xd633e9[_0x49f122(0x1df)],_0x38250f,_0x1f8204,_0xd633e9[_0x49f122(0x1ce)]),_0x3371f8=resolve(_0x1ae8fa,SKILL_FILE),_0xb3b7a4=resolve(_0x1ae8fa,METADATA_FILE),_0x1b44d9=readMetadataIfPresent(_0xb3b7a4);if(!_0x1b44d9||_0x1b44d9['schemaVersion']!==0x2||_0x1b44d9[_0x49f122(0x1df)]!==_0xd633e9[_0x49f122(0x1df)]||_0x1b44d9[_0x49f122(0x1c5)]!==_0x38250f||_0x1b44d9[_0x49f122(0x1e0)]!==_0x1f8204||_0x1b44d9[_0x49f122(0x1d4)]!==_0x286164||_0x1b44d9['id']!==_0xfafc93['id']||_0x1b44d9[_0x49f122(0x1f5)]!==_0xfafc93[_0x49f122(0x1f5)]||_0x1b44d9[_0x49f122(0x1da)]!==_0xfafc93['description']||_0x1b44d9[_0x49f122(0x1ee)]!==_0xfafc93[_0x49f122(0x1ee)]||_0x1b44d9[_0x49f122(0x1e2)]!==_0xfafc93[_0x49f122(0x1e2)]||!_0x1b44d9[_0x49f122(0x1ca)]||!_0x1b44d9[_0x49f122(0x1c1)]||!Object[_0x49f122(0x1f4)](_0x1b44d9[_0x49f122(0x1c1)],SKILL_FILE))return undefined;for(const [_0x540ac4,_0x5ad553]of Object[_0x49f122(0x1f8)](_0x1b44d9[_0x49f122(0x1c1)])){if(!/^[a-f0-9]{64}$/[_0x49f122(0x1be)](_0x5ad553))return undefined;const _0x3dfcba=resolveManagedFilePath(_0x1ae8fa,_0x540ac4);if(!existsSync(_0x3dfcba)||!lstatSync(_0x3dfcba)[_0x49f122(0x1c4)]())return undefined;if(bufferSha256(readFileSync(_0x3dfcba))!==_0x5ad553)return undefined;}return{'skill':_0xfafc93,'scope':_0x38250f,'dir':_0x1ae8fa,'skillMdPath':_0x3371f8,'metadataPath':_0xb3b7a4,'contentHash':_0x1b44d9[_0x49f122(0x1ca)],'changed':![]};}function withMaterializedSkillFrontmatter(_0x57cf0d,_0x2bfac6,_0xfcb3de){const _0x39d70e=a144_0x7383,_0x342b0a=skillDisplayName(_0x2bfac6,_0xfcb3de),_0x5a353d=_0x2bfac6[_0x39d70e(0x1da)]?.[_0x39d70e(0x1f0)]()||_0x342b0a||_0xfcb3de;return normalizeLocalFiles(_0x57cf0d)['map'](_0x42dd2f=>{const _0x35ce61=_0x39d70e,_0x1b3905=fileText(_0x42dd2f);if(_0x42dd2f[_0x35ce61(0x1d0)]!==SKILL_FILE)return _0x42dd2f;if(hasYamlFrontmatter(_0x1b3905))return{'path':_0x42dd2f['path'],'content':withSyncedDisplayName(_0x1b3905,_0x342b0a)};return{'path':_0x42dd2f[_0x35ce61(0x1d0)],'content':prependSkillFrontmatter(_0x1b3905,{'name':_0xfcb3de,'displayName':_0x342b0a,'description':_0x5a353d})};});}function a144_0x7383(_0x169ade,_0x4d4b2a){_0x169ade=_0x169ade-0x1be;const _0x364f96=a144_0x364f();let _0x73834d=_0x364f96[_0x169ade];return _0x73834d;}function hasYamlFrontmatter(_0x45eaba){const _0x503514=a144_0x7383;return/^\uFEFF?---\s*\r?\n/[_0x503514(0x1be)](_0x45eaba);}function prependSkillFrontmatter(_0x110a50,_0x94bf69){const _0x2d9449=a144_0x7383,_0x3b09f7=_0x110a50[_0x2d9449(0x1d9)](/^\uFEFF/,'');return[_0x2d9449(0x1dc),'name:\x20'+yamlString(_0x94bf69[_0x2d9449(0x1d8)]),_0x94bf69['displayName']?_0x2d9449(0x1e6)+yamlString(_0x94bf69['displayName']):undefined,'description:\x20'+yamlString(_0x94bf69[_0x2d9449(0x1da)]),_0x2d9449(0x1dc),'',_0x3b09f7][_0x2d9449(0x1d7)](_0x5c17ea=>_0x5c17ea!==undefined)[_0x2d9449(0x1ea)]('\x0a');}function yamlString(_0x546d1b){const _0xb8fbb3=a144_0x7383;return JSON['stringify'](_0x546d1b[_0xb8fbb3(0x1d9)](/\r/g,'')[_0xb8fbb3(0x1f0)]());}function skillDisplayName(_0x12afcd,_0x38d40a){const _0x3ab949=a144_0x7383,_0x5e8a2f=_0x12afcd['skillName']?.[_0x3ab949(0x1f0)]();return _0x5e8a2f||_0x38d40a;}function withSyncedDisplayName(_0x504334,_0x428027){const _0x460a8a=a144_0x7383,_0x5219a1=_0x504334[_0x460a8a(0x1f2)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x5219a1)return _0x504334;const _0x562fa5=_0x5219a1[0x1]??'',_0x54f68c=_0x5219a1[0x2]??'',_0x53d149=parseDocument(_0x54f68c);if(_0x53d149[_0x460a8a(0x1cf)][_0x460a8a(0x1f3)]>0x0||!isMap(_0x53d149[_0x460a8a(0x1d6)]))return _0x504334;if(_0x428027)_0x53d149[_0x460a8a(0x1db)]('displayName',_0x428027);else{if(_0x53d149[_0x460a8a(0x1bf)]('displayName'))_0x53d149[_0x460a8a(0x1cb)]('displayName');else return _0x504334;}forceBlockCollections(_0x53d149['contents']);const _0x295473=_0x53d149[_0x460a8a(0x1cc)]({'lineWidth':0x0})['trimEnd'](),_0x156411=_0x504334[_0x460a8a(0x1c8)](_0x5219a1[0x0][_0x460a8a(0x1f3)])[_0x460a8a(0x1d9)](/^\r?\n/,'');return _0x562fa5+_0x460a8a(0x1fa)+_0x295473+_0x460a8a(0x1eb)+_0x156411;}function forceBlockCollections(_0x314c28){if(!isNode(_0x314c28))return;visit(_0x314c28,(_0x76c526,_0x4bf1fe)=>{const _0x641af7=a144_0x7383;isCollection(_0x4bf1fe)&&(_0x4bf1fe[_0x641af7(0x1c9)]=![]);});}function ensurePulledFilesCanBeOverwritten(_0xfeb777,_0x4160be,_0xcd11c7,_0x583a45){const _0x266ab2=a144_0x7383;if(_0x583a45||!existsSync(_0x4160be))return;const _0x1d10ad=readMetadataIfPresent(_0x4160be);if(!_0x1d10ad)return;const _0x70a2c3=_0x1d10ad[_0x266ab2(0x1c1)]&&Object[_0x266ab2(0x1c7)](_0x1d10ad['fileHashes'])[_0x266ab2(0x1f3)]>0x0?_0x1d10ad[_0x266ab2(0x1c1)]:undefined;if(_0x70a2c3)for(const [_0x5c537a,_0x375c28]of Object[_0x266ab2(0x1f8)](_0x70a2c3)){const _0x3ddc4f=resolveManagedFilePath(_0xfeb777,_0x5c537a);if(!existsSync(_0x3ddc4f))throw CliErrors[_0x266ab2(0x1e3)](_0x266ab2(0x1c6)+_0xfeb777,_0x266ab2(0x1e4)+_0x5c537a);const _0x2e22ad=lstatSync(_0x3ddc4f);if(!_0x2e22ad[_0x266ab2(0x1c4)]())throw CliErrors[_0x266ab2(0x1e3)](_0x266ab2(0x1c6)+_0xfeb777,_0x266ab2(0x1fb)+_0x5c537a);const _0x4f684e=bufferSha256(readFileSync(_0x3ddc4f));if(_0x4f684e!==_0x375c28)throw CliErrors[_0x266ab2(0x1e3)](_0x266ab2(0x1c6)+_0xfeb777+_0x266ab2(0x1ed)+_0x5c537a,_0x266ab2(0x1f9)+_0x5c537a);}else{const _0xdb3504=resolve(_0xfeb777,SKILL_FILE);if(existsSync(_0xdb3504)&&_0x1d10ad[_0x266ab2(0x1ca)]){const _0x22129e=contentHash(readFileSync(_0xdb3504,_0x266ab2(0x1d3)));if(_0x22129e!==_0x1d10ad[_0x266ab2(0x1ca)])throw CliErrors['validation'](_0x266ab2(0x1d1)+_0xdb3504,'Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.');}}for(const _0x610344 of normalizeLocalFiles(_0xcd11c7)){if(_0x70a2c3?.[_0x610344[_0x266ab2(0x1d0)]])continue;if(!_0x70a2c3&&_0x610344[_0x266ab2(0x1d0)]===SKILL_FILE)continue;const _0x46941d=resolveManagedFilePath(_0xfeb777,_0x610344[_0x266ab2(0x1d0)]);if(!existsSync(_0x46941d))continue;const _0x5e4c37=lstatSync(_0x46941d);if(!_0x5e4c37['isFile']())throw CliErrors[_0x266ab2(0x1e3)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0xfeb777,_0x266ab2(0x1ef)+_0x610344[_0x266ab2(0x1d0)]);const _0x40726b=bufferSha256(readFileSync(_0x46941d));if(_0x40726b!==fileHash(_0x610344))throw CliErrors['validation'](_0x266ab2(0x1c6)+_0xfeb777,_0x266ab2(0x1c2)+_0x610344['path']);}}function materializeFiles(_0x2d30a8,_0xb0b3f4){for(const _0xfcff6b of normalizeLocalFiles(_0xb0b3f4)){const _0x501ad5=resolveManagedFilePath(_0x2d30a8,_0xfcff6b['path']);mkdirSync(dirname(_0x501ad5),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x501ad5,fileContent(_0xfcff6b),0x180);}}function removeStaleManagedFiles(_0x19bc33,_0x11cc17,_0x4eeb7f){const _0x507162=a144_0x7383;if(!_0x11cc17)return;const _0x12e9ba=new Set(normalizeLocalFiles(_0x4eeb7f)[_0x507162(0x1d2)](_0x3618f1=>_0x3618f1[_0x507162(0x1d0)]));for(const _0x5342b6 of Object['keys'](_0x11cc17)){if(_0x12e9ba[_0x507162(0x1bf)](_0x5342b6))continue;const _0x2f30d4=resolveManagedFilePath(_0x19bc33,_0x5342b6);existsSync(_0x2f30d4)&&lstatSync(_0x2f30d4)['isFile']()&&rmSync(_0x2f30d4,{'force':!![]});}}
@@ -1 +1 @@
1
- (function(_0x41bd4e,_0x34908e){const _0x41f131=a145_0x136d,_0xcf678=_0x41bd4e();while(!![]){try{const _0xb087a4=parseInt(_0x41f131(0x95))/0x1+-parseInt(_0x41f131(0x9b))/0x2*(-parseInt(_0x41f131(0x8c))/0x3)+parseInt(_0x41f131(0x7b))/0x4+parseInt(_0x41f131(0x7d))/0x5*(-parseInt(_0x41f131(0x8e))/0x6)+parseInt(_0x41f131(0x94))/0x7*(-parseInt(_0x41f131(0x92))/0x8)+parseInt(_0x41f131(0x85))/0x9*(parseInt(_0x41f131(0x79))/0xa)+-parseInt(_0x41f131(0x8b))/0xb;if(_0xb087a4===_0x34908e)break;else _0xcf678['push'](_0xcf678['shift']());}catch(_0x1372ce){_0xcf678['push'](_0xcf678['shift']());}}}(a145_0x46b2,0x51258));function a145_0x136d(_0x2e73e3,_0x5193b5){_0x2e73e3=_0x2e73e3-0x79;const _0x46b291=a145_0x46b2();let _0x136d2f=_0x46b291[_0x2e73e3];return _0x136d2f;}import{existsSync,readFileSync}from'node:fs';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';import{fileContent,normalizeLocalFiles}from'./local-files.js';import{buildSkillPackage,localFilesToManifestFiles}from'./zip-package.js';export function buildMetadata(_0x5dffb3,_0x1b9920,_0x3dac3e,_0x4381c0,_0x144fa4,_0x540895,_0xd96d06){const _0x10f67a=a145_0x136d,_0x5ce160=_0x540895?normalizeLocalFiles(_0x540895):[],_0x232718=!_0xd96d06&&_0x5ce160[_0x10f67a(0x83)]>0x0?buildSkillPackage(_0x5ce160):undefined,_0x48bb15=_0xd96d06?bufferSha256(_0xd96d06):_0x232718?.[_0x10f67a(0x80)][_0x10f67a(0x82)],_0x5241c9=_0xd96d06?.['length']??_0x232718?.[_0x10f67a(0x80)][_0x10f67a(0x84)],_0x5107ea=_0x5ce160[_0x10f67a(0x83)]>0x0?Object[_0x10f67a(0x87)](_0x5ce160[_0x10f67a(0x8a)](_0x1eee29=>[_0x1eee29[_0x10f67a(0x8f)],fileHash(_0x1eee29)])):undefined;return{'schemaVersion':_0x5ce160['length']>0x0?0x2:0x1,'id':_0x5dffb3['id'],'appCode':_0x3dac3e,'skillCode':requireSkillCode(_0x5dffb3),'skillName':_0x5dffb3[_0x10f67a(0x89)],'description':_0x5dffb3['description'],'example':_0x5dffb3[_0x10f67a(0x81)],'scope':_0x1b9920,'readonly':_0x1b9920!==_0x10f67a(0x93)||_0x5dffb3[_0x10f67a(0x8d)]===!![],'tenantCode':_0x5dffb3[_0x10f67a(0x86)],'userId':_0x5dffb3['userId'],'version':_0x5dffb3[_0x10f67a(0x99)],'status':_0x5dffb3[_0x10f67a(0x7f)],'tags':Array[_0x10f67a(0x96)](_0x5dffb3['tags'])?_0x5dffb3[_0x10f67a(0x7c)]:[],'hasUpstreamUpdate':_0x5dffb3['hasUpstreamUpdate'],'forkedFromSkillId':_0x5dffb3['forkedFromSkillId'],'forkedFromVersion':_0x5dffb3['forkedFromVersion'],'sourceSessionId':_0x5dffb3[_0x10f67a(0x7e)],'contentHash':_0x4381c0,'fileHashes':_0x5107ea,'treeHash':_0x5ce160[_0x10f67a(0x83)]>0x0?fileTreeHash(localFilesToManifestFiles(_0x5ce160)):undefined,'ossPath':remoteManifestOssPath(_0x5dffb3['files']),'zipSha256':_0x48bb15,'zipSize':_0x5241c9,'files':_0x5ce160[_0x10f67a(0x83)]>0x0?_0x5ce160[_0x10f67a(0x8a)](_0x126a40=>({'path':_0x126a40[_0x10f67a(0x8f)],'hash':fileHash(_0x126a40),'size':fileContent(_0x126a40)['length']})):undefined,'pulledAt':_0x144fa4??new Date()['toISOString']()};}function a145_0x46b2(){const _0x20b168=['203fPCQpg','268754ddynVi','isArray','utf8','trim','version','validation','167306NMsGSp','1090EUNovR','object','2619104vvCrNQ','tags','15pYBntX','sourceSessionId','status','manifest','example','zipSha256','length','zipSize','13491eqSDBy','tenantCode','fromEntries','ossPath','skillName','map','6657761UttTOV','18SDWZnX','readonly','17202OnMuIi','path','Invalid\x20','string','177272MFsCFz','personal'];a145_0x46b2=function(){return _0x20b168;};return a145_0x46b2();}export function requireSkillCode(_0x38a278){const _0x5e01b2=a145_0x136d,_0x19359e=_0x38a278['skillCode']?.['trim']();if(!_0x19359e)throw CliErrors[_0x5e01b2(0x9a)]('Runtime\x20Skill\x20is\x20missing\x20skillCode.');return _0x19359e;}export function readMetadataIfPresent(_0x5e6fc4){const _0x84b284=a145_0x136d;if(!existsSync(_0x5e6fc4))return undefined;try{const _0x24ba58=JSON['parse'](readFileSync(_0x5e6fc4,_0x84b284(0x97)));return _0x24ba58;}catch{throw CliErrors[_0x84b284(0x9a)](_0x84b284(0x90)+METADATA_FILE+':\x20'+_0x5e6fc4);}}function remoteManifestOssPath(_0x591209){const _0x1f6736=a145_0x136d;if(!_0x591209||typeof _0x591209!==_0x1f6736(0x7a)||Array[_0x1f6736(0x96)](_0x591209))return undefined;const _0x28e4f8=_0x591209[_0x1f6736(0x88)];return typeof _0x28e4f8===_0x1f6736(0x91)&&_0x28e4f8['trim']()?_0x28e4f8[_0x1f6736(0x98)]():undefined;}
1
+ (function(_0xd28599,_0x5e90e7){const _0x390884=a145_0x3c6a,_0x2182b3=_0xd28599();while(!![]){try{const _0x40866f=-parseInt(_0x390884(0x1f4))/0x1+-parseInt(_0x390884(0x1db))/0x2*(-parseInt(_0x390884(0x1d8))/0x3)+-parseInt(_0x390884(0x1d5))/0x4*(parseInt(_0x390884(0x1d9))/0x5)+parseInt(_0x390884(0x1f1))/0x6*(-parseInt(_0x390884(0x1e6))/0x7)+parseInt(_0x390884(0x1f2))/0x8+parseInt(_0x390884(0x1e2))/0x9+-parseInt(_0x390884(0x1ee))/0xa;if(_0x40866f===_0x5e90e7)break;else _0x2182b3['push'](_0x2182b3['shift']());}catch(_0x19e33e){_0x2182b3['push'](_0x2182b3['shift']());}}}(a145_0x4563,0x55839));import{existsSync,readFileSync}from'node:fs';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';import{fileContent,normalizeLocalFiles}from'./local-files.js';function a145_0x4563(){const _0x476202=['files','1218kUxixS','Invalid\x20','string','length','tenantCode','object','trim','tags','3908830chPFwx','example','zipSize','23928XiLNwY','4541464ZDomCd','map','9689GfbfCm','Runtime\x20Skill\x20is\x20missing\x20skillCode.','skillName','sourceSessionId','readonly','version','ossPath','4ZaWHAM','utf8','toISOString','9vbblbo','1082085xRXBee','userId','461792eQLgbG','path','description','validation','manifest','forkedFromSkillId','skillCode','3607155gQDgaK','forkedFromVersion','fromEntries'];a145_0x4563=function(){return _0x476202;};return a145_0x4563();}import{buildSkillPackage,localFilesToManifestFiles}from'./zip-package.js';export function buildMetadata(_0x17574f,_0x5a70f1,_0xa03bf8,_0x412402,_0x7dcb64,_0x21d8ef,_0x40e20a){const _0x431f5e=a145_0x3c6a,_0xa97ce0=_0x21d8ef?normalizeLocalFiles(_0x21d8ef):[],_0x315a1c=!_0x40e20a&&_0xa97ce0['length']>0x0?buildSkillPackage(_0xa97ce0):undefined,_0x29e956=_0x40e20a?bufferSha256(_0x40e20a):_0x315a1c?.[_0x431f5e(0x1df)]['zipSha256'],_0x15470b=_0x40e20a?.[_0x431f5e(0x1e9)]??_0x315a1c?.[_0x431f5e(0x1df)][_0x431f5e(0x1f0)],_0x5d8452=_0xa97ce0[_0x431f5e(0x1e9)]>0x0?Object[_0x431f5e(0x1e4)](_0xa97ce0[_0x431f5e(0x1f3)](_0x2af52d=>[_0x2af52d['path'],fileHash(_0x2af52d)])):undefined;return{'schemaVersion':_0xa97ce0[_0x431f5e(0x1e9)]>0x0?0x2:0x1,'id':_0x17574f['id'],'appCode':_0xa03bf8,'skillCode':requireSkillCode(_0x17574f),'skillName':_0x17574f[_0x431f5e(0x1d0)],'description':_0x17574f[_0x431f5e(0x1dd)],'example':_0x17574f[_0x431f5e(0x1ef)],'scope':_0x5a70f1,'readonly':_0x5a70f1!=='personal'||_0x17574f[_0x431f5e(0x1d2)]===!![],'tenantCode':_0x17574f[_0x431f5e(0x1ea)],'userId':_0x17574f[_0x431f5e(0x1da)],'version':_0x17574f[_0x431f5e(0x1d3)],'status':_0x17574f['status'],'tags':Array['isArray'](_0x17574f[_0x431f5e(0x1ed)])?_0x17574f['tags']:[],'hasUpstreamUpdate':_0x17574f['hasUpstreamUpdate'],'forkedFromSkillId':_0x17574f[_0x431f5e(0x1e0)],'forkedFromVersion':_0x17574f[_0x431f5e(0x1e3)],'sourceSessionId':_0x17574f[_0x431f5e(0x1d1)],'contentHash':_0x412402,'fileHashes':_0x5d8452,'treeHash':_0xa97ce0[_0x431f5e(0x1e9)]>0x0?fileTreeHash(localFilesToManifestFiles(_0xa97ce0)):undefined,'ossPath':remoteManifestOssPath(_0x17574f[_0x431f5e(0x1e5)]),'zipSha256':_0x29e956,'zipSize':_0x15470b,'files':_0xa97ce0[_0x431f5e(0x1e9)]>0x0?_0xa97ce0[_0x431f5e(0x1f3)](_0x1a7cb7=>({'path':_0x1a7cb7[_0x431f5e(0x1dc)],'hash':fileHash(_0x1a7cb7),'size':fileContent(_0x1a7cb7)['length']})):undefined,'pulledAt':_0x7dcb64??new Date()[_0x431f5e(0x1d7)]()};}function a145_0x3c6a(_0x5b9d9c,_0x26cc8c){_0x5b9d9c=_0x5b9d9c-0x1d0;const _0x4563fb=a145_0x4563();let _0x3c6af8=_0x4563fb[_0x5b9d9c];return _0x3c6af8;}export function requireSkillCode(_0xbca055){const _0x4bdd3f=a145_0x3c6a,_0x4cb24e=_0xbca055[_0x4bdd3f(0x1e1)]?.[_0x4bdd3f(0x1ec)]();if(!_0x4cb24e)throw CliErrors[_0x4bdd3f(0x1de)](_0x4bdd3f(0x1f5));return _0x4cb24e;}export function readMetadataIfPresent(_0x5a33ee){const _0x4c7307=a145_0x3c6a;if(!existsSync(_0x5a33ee))return undefined;try{const _0x3124b2=JSON['parse'](readFileSync(_0x5a33ee,_0x4c7307(0x1d6)));return _0x3124b2;}catch{throw CliErrors[_0x4c7307(0x1de)](_0x4c7307(0x1e7)+METADATA_FILE+':\x20'+_0x5a33ee);}}function remoteManifestOssPath(_0x24c164){const _0x3e2783=a145_0x3c6a;if(!_0x24c164||typeof _0x24c164!==_0x3e2783(0x1eb)||Array['isArray'](_0x24c164))return undefined;const _0x8095c3=_0x24c164[_0x3e2783(0x1d4)];return typeof _0x8095c3===_0x3e2783(0x1e8)&&_0x8095c3[_0x3e2783(0x1ec)]()?_0x8095c3[_0x3e2783(0x1ec)]():undefined;}
@@ -1 +1 @@
1
- function a146_0x3633(_0x2fe6f8,_0x56bff6){_0x2fe6f8=_0x2fe6f8-0x1d3;const _0x22776c=a146_0x2277();let _0x36339b=_0x22776c[_0x2fe6f8];return _0x36339b;}const a146_0x5cde96=a146_0x3633;(function(_0x14bb8d,_0x371f7c){const _0x3d1a3e=a146_0x3633,_0xf9a705=_0x14bb8d();while(!![]){try{const _0x4483b7=-parseInt(_0x3d1a3e(0x1e2))/0x1*(parseInt(_0x3d1a3e(0x1e7))/0x2)+parseInt(_0x3d1a3e(0x1d8))/0x3*(-parseInt(_0x3d1a3e(0x1d7))/0x4)+-parseInt(_0x3d1a3e(0x1d3))/0x5+parseInt(_0x3d1a3e(0x1eb))/0x6*(parseInt(_0x3d1a3e(0x1d5))/0x7)+-parseInt(_0x3d1a3e(0x1e5))/0x8*(parseInt(_0x3d1a3e(0x1e0))/0x9)+-parseInt(_0x3d1a3e(0x1e4))/0xa+-parseInt(_0x3d1a3e(0x1ea))/0xb*(-parseInt(_0x3d1a3e(0x1ec))/0xc);if(_0x4483b7===_0x371f7c)break;else _0xf9a705['push'](_0xf9a705['shift']());}catch(_0x5a573d){_0xf9a705['push'](_0xf9a705['shift']());}}}(a146_0x2277,0x8e68a));import{existsSync}from'node:fs';import{homedir}from'node:os';import{resolve}from'node:path';import{fingerprintAccessKey}from'../../commands/app/cache.js';import{PRODUCT_CONFIG,productEnv}from'../../constant/product.js';import{CliErrors}from'../../errors.js';export function resolveSkillSyncPaths(_0x407b78={}){const _0x12cdcb=a146_0x3633,_0x32981b=_0x407b78['homeDir']??homedir(),_0x4479d5=resolve(_0x32981b,PRODUCT_CONFIG['homeDirName'],_0x12cdcb(0x1e8)),_0x416286=trimmedEnv(_0x12cdcb(0x1e1)),_0x42db33=trimmedEnv(_0x12cdcb(0x1ed)),_0x66f40d=resolve(_0x32981b,_0x12cdcb(0x1d4)),_0x5a5c9d=_0x407b78['workbuddySkillsDir']??(existsSync(_0x66f40d)?resolve(_0x66f40d,_0x12cdcb(0x1e3)):undefined);return{'homeDir':_0x32981b,'cacheRoot':_0x4479d5,'managedRoot':resolve(_0x32981b,PRODUCT_CONFIG['homeDirName']),'agentsSkillsDir':_0x407b78[_0x12cdcb(0x1e6)]??_0x416286??resolve(_0x32981b,_0x12cdcb(0x1ee),_0x12cdcb(0x1e3)),'claudeSkillsDir':_0x407b78[_0x12cdcb(0x1df)]??_0x42db33??resolve(_0x32981b,'.claude',_0x12cdcb(0x1e3)),'workbuddySkillsDir':_0x5a5c9d};}export function runtimeAgentSkillRoots(_0x37abe3){const _0x18ae21=a146_0x3633;return[_0x37abe3[_0x18ae21(0x1e6)],_0x37abe3[_0x18ae21(0x1df)],_0x37abe3['workbuddySkillsDir']][_0x18ae21(0x1de)](_0x165287=>Boolean(_0x165287));}export function getRuntimeSkillCacheRoot(_0x3ddbdf,_0x5aba17,_0x55745d={}){const _0x368a30=a146_0x3633,_0x21d7f1=resolveSkillSyncPaths(_0x55745d);return resolve(_0x21d7f1[_0x368a30(0x1dd)],_0x3ddbdf,fingerprintAccessKey(_0x5aba17),_0x368a30(0x1e3));}function a146_0x2277(){const _0x2670e0=['4tQmHiA','cache','\x20for\x20local\x20path:\x20','11giKrNL','240282jWvXOt','51210060hOFTBD','CLAUDE_SKILL_ROOT','.agents','4299280BEzCaw','.workbuddy','35vbIQlG','skillCode','4kSSatl','2352471NWnGVM','Unsafe\x20','includes','trim','path\x20segment','cacheRoot','filter','claudeSkillsDir','4272165eLyQjQ','SKILL_ROOT','182353FYdrOw','skills','9263450ipSAlx','16GaNLZW','agentsSkillsDir'];a146_0x2277=function(){return _0x2670e0;};return a146_0x2277();}export function getRuntimeSkillDir(_0x184a18,_0x5ff848,_0x11e56e,_0x1d1fba,_0x36b9ee,_0x5c6f70={}){const _0x1e1091=a146_0x3633;return resolve(getRuntimeSkillCacheRoot(_0x184a18,_0x5ff848,_0x5c6f70),safePathSegment(_0x11e56e,'appCode'),_0x1d1fba,safePathSegment(_0x36b9ee,_0x1e1091(0x1d6)));}export function safePathSegment(_0x3d28f2,_0x2a9fbc=a146_0x5cde96(0x1dc)){const _0x38c43d=a146_0x5cde96;if(!_0x3d28f2||_0x3d28f2[_0x38c43d(0x1da)]('/')||_0x3d28f2[_0x38c43d(0x1da)]('\x5c')||_0x3d28f2[_0x38c43d(0x1da)]('..'))throw CliErrors['validation'](_0x38c43d(0x1d9)+_0x2a9fbc+_0x38c43d(0x1e9)+_0x3d28f2);return _0x3d28f2;}function trimmedEnv(_0x40c3ed){const _0x58d3e2=a146_0x5cde96,_0x4a8a1e=productEnv(_0x40c3ed)?.[_0x58d3e2(0x1db)]();return _0x4a8a1e?_0x4a8a1e:undefined;}
1
+ const a146_0x548213=a146_0x1563;(function(_0x2b7694,_0xac6c0){const _0x340d0e=a146_0x1563,_0x20d6c7=_0x2b7694();while(!![]){try{const _0x2f0d8f=-parseInt(_0x340d0e(0x13a))/0x1+-parseInt(_0x340d0e(0x144))/0x2*(parseInt(_0x340d0e(0x13f))/0x3)+-parseInt(_0x340d0e(0x146))/0x4+parseInt(_0x340d0e(0x135))/0x5+parseInt(_0x340d0e(0x134))/0x6+-parseInt(_0x340d0e(0x142))/0x7*(parseInt(_0x340d0e(0x129))/0x8)+-parseInt(_0x340d0e(0x12c))/0x9*(-parseInt(_0x340d0e(0x13c))/0xa);if(_0x2f0d8f===_0xac6c0)break;else _0x20d6c7['push'](_0x20d6c7['shift']());}catch(_0x2ec5bf){_0x20d6c7['push'](_0x20d6c7['shift']());}}}(a146_0x5007,0xbd16f));import{existsSync}from'node:fs';import{homedir}from'node:os';import{resolve}from'node:path';import{fingerprintAccessKey}from'../../commands/app/cache.js';function a146_0x5007(){const _0x2b1413=['216231ZNKhjB','cacheRoot','workbuddySkillsDir','7sIdrcE','filter','6SAftgJ','homeDir','2855536AueDLw','.claude','5617168bkUQfg','trim','cache','9TMkjKE','appCode','validation','path\x20segment','skillCode','SKILL_ROOT','.workbuddy','claudeSkillsDir','1447320gNkOJM','5318880xDGSeF','Unsafe\x20','skills','.agents','CLAUDE_SKILL_ROOT','256883PLrIyI','agentsSkillsDir','13586590rccARp','homeDirName','includes'];a146_0x5007=function(){return _0x2b1413;};return a146_0x5007();}import{PRODUCT_CONFIG,productEnv}from'../../constant/product.js';import{CliErrors}from'../../errors.js';export function resolveSkillSyncPaths(_0x1fbe7a={}){const _0x5304be=a146_0x1563,_0x2cca3d=_0x1fbe7a[_0x5304be(0x145)]??homedir(),_0x107c05=resolve(_0x2cca3d,PRODUCT_CONFIG['homeDirName'],_0x5304be(0x12b)),_0x52fc8d=trimmedEnv(_0x5304be(0x131)),_0x51aa57=trimmedEnv(_0x5304be(0x139)),_0x464ad9=resolve(_0x2cca3d,_0x5304be(0x132)),_0x54786e=_0x1fbe7a['workbuddySkillsDir']??(existsSync(_0x464ad9)?resolve(_0x464ad9,_0x5304be(0x137)):undefined);return{'homeDir':_0x2cca3d,'cacheRoot':_0x107c05,'managedRoot':resolve(_0x2cca3d,PRODUCT_CONFIG[_0x5304be(0x13d)]),'agentsSkillsDir':_0x1fbe7a[_0x5304be(0x13b)]??_0x52fc8d??resolve(_0x2cca3d,_0x5304be(0x138),_0x5304be(0x137)),'claudeSkillsDir':_0x1fbe7a['claudeSkillsDir']??_0x51aa57??resolve(_0x2cca3d,_0x5304be(0x128),_0x5304be(0x137)),'workbuddySkillsDir':_0x54786e};}function a146_0x1563(_0x1a083e,_0x1e918f){_0x1a083e=_0x1a083e-0x128;const _0x50071b=a146_0x5007();let _0x1563dc=_0x50071b[_0x1a083e];return _0x1563dc;}export function runtimeAgentSkillRoots(_0x206d1f){const _0x319a81=a146_0x1563;return[_0x206d1f[_0x319a81(0x13b)],_0x206d1f[_0x319a81(0x133)],_0x206d1f[_0x319a81(0x141)]][_0x319a81(0x143)](_0x565174=>Boolean(_0x565174));}export function getRuntimeSkillCacheRoot(_0x4054b4,_0x542ca4,_0x3218c7={}){const _0x9af559=a146_0x1563,_0x92a80=resolveSkillSyncPaths(_0x3218c7);return resolve(_0x92a80[_0x9af559(0x140)],_0x4054b4,fingerprintAccessKey(_0x542ca4),_0x9af559(0x137));}export function getRuntimeSkillDir(_0x37aad1,_0x20dfd5,_0x5ed02f,_0x5abc23,_0x208d26,_0x1d567d={}){const _0x30f4ff=a146_0x1563;return resolve(getRuntimeSkillCacheRoot(_0x37aad1,_0x20dfd5,_0x1d567d),safePathSegment(_0x5ed02f,_0x30f4ff(0x12d)),_0x5abc23,safePathSegment(_0x208d26,_0x30f4ff(0x130)));}export function safePathSegment(_0x29e713,_0x175be9=a146_0x548213(0x12f)){const _0x420ff2=a146_0x548213;if(!_0x29e713||_0x29e713[_0x420ff2(0x13e)]('/')||_0x29e713[_0x420ff2(0x13e)]('\x5c')||_0x29e713['includes']('..'))throw CliErrors[_0x420ff2(0x12e)](_0x420ff2(0x136)+_0x175be9+'\x20for\x20local\x20path:\x20'+_0x29e713);return _0x29e713;}function trimmedEnv(_0x4afd2a){const _0x846af8=a146_0x548213,_0x2d7a4b=productEnv(_0x4afd2a)?.[_0x846af8(0x12a)]();return _0x2d7a4b?_0x2d7a4b:undefined;}