@lovrabet/lovrabet-cli 2.3.0-beta.3 → 2.3.0-beta.4

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 (164) 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/sdk-client.js +1 -1
  107. package/lib/errors.js +1 -1
  108. package/lib/framework/build-all-flags.js +1 -1
  109. package/lib/framework/dryrun.js +1 -1
  110. package/lib/framework/flags.js +1 -1
  111. package/lib/framework/help.js +1 -1
  112. package/lib/framework/index.js +1 -1
  113. package/lib/framework/output.js +1 -1
  114. package/lib/framework/preparse.js +1 -1
  115. package/lib/framework/rate-limit.js +1 -1
  116. package/lib/framework/raw-flags.js +1 -1
  117. package/lib/framework/response.js +1 -1
  118. package/lib/framework/runner-confirmation.js +1 -1
  119. package/lib/framework/runner-error.js +1 -1
  120. package/lib/framework/runner.js +1 -1
  121. package/lib/framework/schema-export.js +1 -1
  122. package/lib/framework/service-order.js +1 -1
  123. package/lib/framework/types.js +1 -1
  124. package/lib/generated/build-info.d.ts +4 -4
  125. package/lib/generated/build-info.js +1 -1
  126. package/lib/help.js +1 -1
  127. package/lib/postinstall.js +1 -1
  128. package/lib/runtime/confirmation.js +1 -1
  129. package/lib/runtime/event.js +1 -1
  130. package/lib/runtime/index.js +1 -1
  131. package/lib/runtime/queue.js +1 -1
  132. package/lib/runtime/resolve.js +1 -1
  133. package/lib/skills/builtin-skill.js +1 -1
  134. package/lib/skills/npx-skills-add.js +1 -1
  135. package/lib/skills/runtime-skill-sync/constants.js +1 -1
  136. package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
  137. package/lib/skills/runtime-skill-sync/hashing.js +1 -1
  138. package/lib/skills/runtime-skill-sync/install-target.js +1 -1
  139. package/lib/skills/runtime-skill-sync/links.js +1 -1
  140. package/lib/skills/runtime-skill-sync/list-local.js +1 -1
  141. package/lib/skills/runtime-skill-sync/local-files.js +1 -1
  142. package/lib/skills/runtime-skill-sync/materialize.js +1 -1
  143. package/lib/skills/runtime-skill-sync/metadata.js +1 -1
  144. package/lib/skills/runtime-skill-sync/paths.js +1 -1
  145. package/lib/skills/runtime-skill-sync/push.js +1 -1
  146. package/lib/skills/runtime-skill-sync/scopes.js +1 -1
  147. package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
  148. package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
  149. package/lib/skills/runtime-skill-sync.js +1 -1
  150. package/lib/skills/skill-presence.js +1 -1
  151. package/lib/utils/access-key-redaction.js +1 -1
  152. package/lib/utils/apply-jq-filter.js +1 -1
  153. package/lib/utils/cli-version-check.js +1 -1
  154. package/lib/utils/cli-version-policy.js +1 -1
  155. package/lib/utils/logger.js +1 -1
  156. package/lib/utils/lossless-json.js +1 -1
  157. package/lib/utils/params.js +1 -1
  158. package/lib/utils/platform.js +1 -1
  159. package/lib/utils/update-notice.js +1 -1
  160. package/lib/utils/version.js +1 -1
  161. package/lib/utils/write-cli-side-channel.js +1 -1
  162. package/package.json +1 -1
  163. package/skills/lovrabet/SKILL.md +1 -1
  164. package/skills/lovrabet.manifest.json +3 -3
@@ -1 +1 @@
1
- (function(_0x139931,_0x356071){const _0x595782=a135_0x5459,_0x258c69=_0x139931();while(!![]){try{const _0x575b30=-parseInt(_0x595782(0x1fa))/0x1+-parseInt(_0x595782(0x1ff))/0x2*(parseInt(_0x595782(0x1fb))/0x3)+-parseInt(_0x595782(0x1f2))/0x4*(-parseInt(_0x595782(0x1f1))/0x5)+-parseInt(_0x595782(0x1fc))/0x6+-parseInt(_0x595782(0x1f3))/0x7*(parseInt(_0x595782(0x1f8))/0x8)+parseInt(_0x595782(0x1fd))/0x9*(-parseInt(_0x595782(0x203))/0xa)+parseInt(_0x595782(0x1f0))/0xb;if(_0x575b30===_0x356071)break;else _0x258c69['push'](_0x258c69['shift']());}catch(_0x3df783){_0x258c69['push'](_0x258c69['shift']());}}}(a135_0x1a3c,0x6f6f0));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(_0x4d0f20,_0x50fcd6){const _0x434c71=a135_0x5459,_0x2efb7e=normalizeSkillRelativePath(_0x50fcd6),_0x2193fa=realOrResolved(_0x4d0f20),_0x414570=resolve(_0x2193fa,..._0x2efb7e[_0x434c71(0x1f6)]('/'));if(!isPathInside(_0x414570,_0x2193fa))throw CliErrors[_0x434c71(0x1fe)](_0x434c71(0x1f4)+_0x50fcd6);return ensureNoSymlinkInManagedPath(_0x2193fa,_0x2efb7e),_0x414570;}function a135_0x1a3c(){const _0x3e73f5=['190YzUZDg','46792XMPVmP','2961308UhQoDc','Unsafe\x20Skill\x20file\x20path:\x20','from','split','isSymbolicLink','8RLBSvH','Refusing\x20to\x20write\x20through\x20Skill\x20symlink\x20path:\x20','656440nmbVJF','3JyhdPZ','3935286ZGRkXL','5758218HVoHZf','validation','1303314YKUaAE','stringify','endsWith','startsWith','10pZVnOV','33426052NrbftG'];a135_0x1a3c=function(){return _0x3e73f5;};return a135_0x1a3c();}export function ensureNoSymlinkInManagedPath(_0x2a9a14,_0x49b1e2){const _0x57c8ef=a135_0x5459;let _0x560850=_0x2a9a14;for(const _0x5911a3 of _0x49b1e2['split']('/')){_0x560850=resolve(_0x560850,_0x5911a3);const _0x25384e=lstatIfPresent(_0x560850);if(_0x25384e?.[_0x57c8ef(0x1f7)]())throw CliErrors[_0x57c8ef(0x1fe)](_0x57c8ef(0x1f9)+_0x49b1e2);}}export function isDanglingSymlink(_0x271e1e){const _0x3a6778=a135_0x5459;try{return lstatSync(_0x271e1e)[_0x3a6778(0x1f7)]();}catch{return![];}}function a135_0x5459(_0x1eaa4e,_0x2992ea){_0x1eaa4e=_0x1eaa4e-0x1f0;const _0x1a3c45=a135_0x1a3c();let _0x545952=_0x1a3c45[_0x1eaa4e];return _0x545952;}export function resolveSymlinkTarget(_0x163efe){const _0x35e4ef=readlinkSync(_0x163efe);return isAbsolute(_0x35e4ef)?_0x35e4ef:resolve(dirname(_0x163efe),_0x35e4ef);}export function isPathInside(_0x23e70d,_0x47a29d){const _0x5dd82e=a135_0x5459,_0x5909a8=_0x23e70d[_0x5dd82e(0x201)](sep)?_0x23e70d:''+_0x23e70d+sep,_0x3db53d=_0x47a29d[_0x5dd82e(0x201)](sep)?_0x47a29d:''+_0x47a29d+sep;return _0x23e70d===_0x47a29d||_0x5909a8[_0x5dd82e(0x202)](_0x3db53d);}export function realOrResolved(_0xd5921b){try{return realpathSync(_0xd5921b);}catch{return resolve(_0xd5921b);}}export function lstatIfPresent(_0x5a90a8){try{return lstatSync(_0x5a90a8);}catch{return undefined;}}export function writeTextAtomic(_0x1042a0,_0x355335,_0x34fbbc){const _0x408dec=a135_0x5459;writeBytesAtomic(_0x1042a0,Buffer[_0x408dec(0x1f5)](_0x355335,'utf8'),_0x34fbbc);}export function writeBytesAtomic(_0x321f0a,_0x260cce,_0x362260){const _0x4976e9=_0x321f0a+'.tmp';try{writeFileSync(_0x4976e9,_0x260cce,{'mode':_0x362260}),renameSync(_0x4976e9,_0x321f0a);}catch(_0x18b1f5){try{rmSync(_0x4976e9,{'force':!![]});}catch{}throw _0x18b1f5;}}export function writeJsonAtomic(_0x5c50b8,_0x12a354){const _0x5d3cdf=a135_0x5459;writeTextAtomic(_0x5c50b8,JSON[_0x5d3cdf(0x200)](_0x12a354,null,0x2)+'\x0a',0x180);}
1
+ (function(_0x36fbbf,_0x568271){const _0x1054d2=a135_0x100f,_0xfd5a69=_0x36fbbf();while(!![]){try{const _0x249e4b=-parseInt(_0x1054d2(0x1d8))/0x1+-parseInt(_0x1054d2(0x1d6))/0x2*(-parseInt(_0x1054d2(0x1dc))/0x3)+-parseInt(_0x1054d2(0x1cf))/0x4+-parseInt(_0x1054d2(0x1d1))/0x5*(parseInt(_0x1054d2(0x1cc))/0x6)+-parseInt(_0x1054d2(0x1ca))/0x7+-parseInt(_0x1054d2(0x1c9))/0x8+parseInt(_0x1054d2(0x1d9))/0x9*(parseInt(_0x1054d2(0x1cb))/0xa);if(_0x249e4b===_0x568271)break;else _0xfd5a69['push'](_0xfd5a69['shift']());}catch(_0x330deb){_0xfd5a69['push'](_0xfd5a69['shift']());}}}(a135_0x3976,0xb9457));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(_0x13e8fe,_0x50ea1e){const _0x249f41=a135_0x100f,_0x28fd28=normalizeSkillRelativePath(_0x50ea1e),_0x54bf75=realOrResolved(_0x13e8fe),_0x18c537=resolve(_0x54bf75,..._0x28fd28[_0x249f41(0x1ce)]('/'));if(!isPathInside(_0x18c537,_0x54bf75))throw CliErrors['validation'](_0x249f41(0x1d5)+_0x50ea1e);return ensureNoSymlinkInManagedPath(_0x54bf75,_0x28fd28),_0x18c537;}export function ensureNoSymlinkInManagedPath(_0xe7e57b,_0x4255a9){const _0x332f11=a135_0x100f;let _0x530a28=_0xe7e57b;for(const _0x43ea54 of _0x4255a9[_0x332f11(0x1ce)]('/')){_0x530a28=resolve(_0x530a28,_0x43ea54);const _0x4854fc=lstatIfPresent(_0x530a28);if(_0x4854fc?.[_0x332f11(0x1d0)]())throw CliErrors[_0x332f11(0x1d2)](_0x332f11(0x1da)+_0x4255a9);}}function a135_0x100f(_0x24fcc1,_0x1a22f6){_0x24fcc1=_0x24fcc1-0x1c9;const _0x39760e=a135_0x3976();let _0x100fc2=_0x39760e[_0x24fcc1];return _0x100fc2;}export function isDanglingSymlink(_0x46d164){const _0x5dbf11=a135_0x100f;try{return lstatSync(_0x46d164)[_0x5dbf11(0x1d0)]();}catch{return![];}}export function resolveSymlinkTarget(_0x248ffc){const _0x371a4f=readlinkSync(_0x248ffc);return isAbsolute(_0x371a4f)?_0x371a4f:resolve(dirname(_0x248ffc),_0x371a4f);}export function isPathInside(_0x4fcd8f,_0x567246){const _0x14ad35=a135_0x100f,_0x4372d0=_0x4fcd8f[_0x14ad35(0x1d7)](sep)?_0x4fcd8f:''+_0x4fcd8f+sep,_0x634526=_0x567246[_0x14ad35(0x1d7)](sep)?_0x567246:''+_0x567246+sep;return _0x4fcd8f===_0x567246||_0x4372d0[_0x14ad35(0x1d4)](_0x634526);}export function realOrResolved(_0x2a3131){try{return realpathSync(_0x2a3131);}catch{return resolve(_0x2a3131);}}export function lstatIfPresent(_0x5e6187){try{return lstatSync(_0x5e6187);}catch{return undefined;}}export function writeTextAtomic(_0x2dffc0,_0x4d0fe1,_0x4894d4){const _0x2d6541=a135_0x100f;writeBytesAtomic(_0x2dffc0,Buffer[_0x2d6541(0x1d3)](_0x4d0fe1,'utf8'),_0x4894d4);}function a135_0x3976(){const _0x464564=['970hxxWmF','validation','from','startsWith','Unsafe\x20Skill\x20file\x20path:\x20','1045284rwVGuE','endsWith','574771PICzbC','6964038rjSUjb','Refusing\x20to\x20write\x20through\x20Skill\x20symlink\x20path:\x20','stringify','3FGnoZy','5726920rGtxiQ','9026402KMuLPa','50WyZeMp','8046qBFXxM','.tmp','split','3169620CREClh','isSymbolicLink'];a135_0x3976=function(){return _0x464564;};return a135_0x3976();}export function writeBytesAtomic(_0x342c54,_0x32dd1d,_0x5488dc){const _0x1fa295=a135_0x100f,_0x13e6aa=_0x342c54+_0x1fa295(0x1cd);try{writeFileSync(_0x13e6aa,_0x32dd1d,{'mode':_0x5488dc}),renameSync(_0x13e6aa,_0x342c54);}catch(_0x3399f7){try{rmSync(_0x13e6aa,{'force':!![]});}catch{}throw _0x3399f7;}}export function writeJsonAtomic(_0x413dac,_0x4e696e){const _0x3679e3=a135_0x100f;writeTextAtomic(_0x413dac,JSON[_0x3679e3(0x1db)](_0x4e696e,null,0x2)+'\x0a',0x180);}
@@ -1 +1 @@
1
- (function(_0x5aab52,_0x2937e2){const _0x3fb5e3=a136_0x2a7d,_0x106bce=_0x5aab52();while(!![]){try{const _0x4bfbc3=parseInt(_0x3fb5e3(0x161))/0x1+-parseInt(_0x3fb5e3(0x15e))/0x2*(parseInt(_0x3fb5e3(0x159))/0x3)+-parseInt(_0x3fb5e3(0x15b))/0x4+parseInt(_0x3fb5e3(0x15d))/0x5+parseInt(_0x3fb5e3(0x165))/0x6*(-parseInt(_0x3fb5e3(0x157))/0x7)+parseInt(_0x3fb5e3(0x160))/0x8+-parseInt(_0x3fb5e3(0x15a))/0x9*(-parseInt(_0x3fb5e3(0x156))/0xa);if(_0x4bfbc3===_0x2937e2)break;else _0x106bce['push'](_0x106bce['shift']());}catch(_0x269330){_0x106bce['push'](_0x106bce['shift']());}}}(a136_0x4167,0x58632));function a136_0x2a7d(_0xdfb767,_0x1e25d1){_0xdfb767=_0xdfb767-0x156;const _0x41676b=a136_0x4167();let _0x2a7dab=_0x41676b[_0xdfb767];return _0x2a7dab;}import{createHash}from'node:crypto';import{fileContent,normalizeManifestFiles}from'./local-files.js';export function contentHash(_0x1260e5){const _0x218408=a136_0x2a7d;return createHash(_0x218408(0x163))['update'](_0x1260e5)[_0x218408(0x15c)](_0x218408(0x15f));}export function fileHash(_0x5c75a9){return bufferSha256(fileContent(_0x5c75a9));}export function bufferSha256(_0x210cfc){const _0x4fac7a=a136_0x2a7d;return createHash(_0x4fac7a(0x163))[_0x4fac7a(0x164)](_0x210cfc)[_0x4fac7a(0x15c)](_0x4fac7a(0x15f));}function a136_0x4167(){const _0x54e8fe=['path','sha256','update','4276542XYRHXR','149770xNjvMH','7CZQiAH','size','70878jbQScy','261LQVsSj','76796cRGMvv','digest','1176350VGokoL','16OlCknL','hex','4431112fDOlUG','59506DkdabL'];a136_0x4167=function(){return _0x54e8fe;};return a136_0x4167();}export function fileTreeHash(_0xb60a26){const _0x4058ee=a136_0x2a7d,_0x597961=createHash(_0x4058ee(0x163));for(const _0x3c3f5d of normalizeManifestFiles(_0xb60a26)){_0x597961['update'](_0x3c3f5d[_0x4058ee(0x162)]),_0x597961['update']('\x00'),_0x597961['update'](_0x3c3f5d[_0x4058ee(0x163)]),_0x597961[_0x4058ee(0x164)]('\x00'),_0x597961[_0x4058ee(0x164)](String(_0x3c3f5d[_0x4058ee(0x158)])),_0x597961[_0x4058ee(0x164)]('\x00');}return _0x597961[_0x4058ee(0x15c)](_0x4058ee(0x15f));}
1
+ (function(_0x18aed9,_0x44b179){const _0x4b2dd2=a136_0x2712,_0x41278b=_0x18aed9();while(!![]){try{const _0x1c65ac=-parseInt(_0x4b2dd2(0x9b))/0x1+parseInt(_0x4b2dd2(0x93))/0x2+-parseInt(_0x4b2dd2(0x96))/0x3+-parseInt(_0x4b2dd2(0x92))/0x4+-parseInt(_0x4b2dd2(0x9d))/0x5+-parseInt(_0x4b2dd2(0x9e))/0x6*(parseInt(_0x4b2dd2(0x95))/0x7)+parseInt(_0x4b2dd2(0x97))/0x8;if(_0x1c65ac===_0x44b179)break;else _0x41278b['push'](_0x41278b['shift']());}catch(_0x443eab){_0x41278b['push'](_0x41278b['shift']());}}}(a136_0x58c5,0xcc84f));import{createHash}from'node:crypto';function a136_0x2712(_0x36af4c,_0x1256c3){_0x36af4c=_0x36af4c-0x92;const _0x58c50c=a136_0x58c5();let _0x271209=_0x58c50c[_0x36af4c];return _0x271209;}import{fileContent,normalizeManifestFiles}from'./local-files.js';export function contentHash(_0x2f3f5d){const _0x4f6592=a136_0x2712;return createHash(_0x4f6592(0x94))[_0x4f6592(0x98)](_0x2f3f5d)[_0x4f6592(0x9a)](_0x4f6592(0x99));}function a136_0x58c5(){const _0x4601be=['29043216VBmtJB','update','hex','digest','1621051PcKKue','size','1416530pkdWwf','5401902VlHlnw','620860bxTYXO','1462110hFdvyZ','sha256','7tKvRUs','1691571owIqZs'];a136_0x58c5=function(){return _0x4601be;};return a136_0x58c5();}export function fileHash(_0x5bedae){return bufferSha256(fileContent(_0x5bedae));}export function bufferSha256(_0x37c750){const _0x946504=a136_0x2712;return createHash(_0x946504(0x94))[_0x946504(0x98)](_0x37c750)[_0x946504(0x9a)]('hex');}export function fileTreeHash(_0x4080af){const _0xd1a703=a136_0x2712,_0x109b82=createHash(_0xd1a703(0x94));for(const _0x50f0d7 of normalizeManifestFiles(_0x4080af)){_0x109b82[_0xd1a703(0x98)](_0x50f0d7['path']),_0x109b82[_0xd1a703(0x98)]('\x00'),_0x109b82[_0xd1a703(0x98)](_0x50f0d7[_0xd1a703(0x94)]),_0x109b82['update']('\x00'),_0x109b82[_0xd1a703(0x98)](String(_0x50f0d7[_0xd1a703(0x9c)])),_0x109b82[_0xd1a703(0x98)]('\x00');}return _0x109b82['digest'](_0xd1a703(0x99));}
@@ -1 +1 @@
1
- const a137_0x35e6d9=a137_0x4ae1;(function(_0x108db3,_0x43e5a7){const _0x569feb=a137_0x4ae1,_0x2c042a=_0x108db3();while(!![]){try{const _0xb7a3d5=-parseInt(_0x569feb(0x75))/0x1*(-parseInt(_0x569feb(0x70))/0x2)+-parseInt(_0x569feb(0x6b))/0x3+parseInt(_0x569feb(0x6a))/0x4+parseInt(_0x569feb(0x69))/0x5*(parseInt(_0x569feb(0x68))/0x6)+-parseInt(_0x569feb(0x73))/0x7*(parseInt(_0x569feb(0x76))/0x8)+-parseInt(_0x569feb(0x77))/0x9+parseInt(_0x569feb(0x74))/0xa;if(_0xb7a3d5===_0x43e5a7)break;else _0x2c042a['push'](_0x2c042a['shift']());}catch(_0x1db904){_0x2c042a['push'](_0x2c042a['shift']());}}}(a137_0x69e9,0xe8590));import{resolve}from'node:path';function a137_0x69e9(){const _0x13695c=['44nymxDj','4471608KKYTMC','7677450lKODQc','469578pIcXGU','30mszEqI','207432NXWgii','4857921IOLoSP','skills','cwd','appCode','freeze','40854spDnon','global','.agents','14SSFGUB','31217310mrlUpv'];a137_0x69e9=function(){return _0x13695c;};return a137_0x69e9();}function a137_0x4ae1(_0x992105,_0x15df70){_0x992105=_0x992105-0x68;const _0x69e9e8=a137_0x69e9();let _0x4ae12f=_0x69e9e8[_0x992105];return _0x4ae12f;}import{resolveSkillSyncPaths,runtimeAgentSkillRoots,safePathSegment}from'./paths.js';export function resolveRuntimeSkillInstallTarget(_0x2f8d78,_0x42c66f=a137_0x35e6d9(0x71),_0x481b99={}){const _0x34d6cb=a137_0x35e6d9,_0x58909e=resolveSkillSyncPaths(_0x481b99),_0x31b7ce=safePathSegment(_0x2f8d78,_0x34d6cb(0x6e)),_0x16de4a=_0x42c66f==='project'?[resolve(_0x481b99[_0x34d6cb(0x6d)]??process[_0x34d6cb(0x6d)](),_0x34d6cb(0x72),_0x34d6cb(0x6c))]:runtimeAgentSkillRoots(_0x58909e);return Object[_0x34d6cb(0x6f)]({'scope':_0x42c66f,'appCode':_0x31b7ce,'skillRoots':Object[_0x34d6cb(0x6f)](_0x16de4a),'managedRoot':_0x58909e['managedRoot']});}
1
+ function a137_0xf74f(_0x3829a9,_0x3caad0){_0x3829a9=_0x3829a9-0x66;const _0x25b069=a137_0x25b0();let _0xf74fe1=_0x25b069[_0x3829a9];return _0xf74fe1;}const a137_0x2ec9c9=a137_0xf74f;(function(_0x52614e,_0x438888){const _0x2894e8=a137_0xf74f,_0x189aea=_0x52614e();while(!![]){try{const _0x288067=-parseInt(_0x2894e8(0x70))/0x1+-parseInt(_0x2894e8(0x68))/0x2*(parseInt(_0x2894e8(0x69))/0x3)+parseInt(_0x2894e8(0x67))/0x4*(parseInt(_0x2894e8(0x76))/0x5)+parseInt(_0x2894e8(0x66))/0x6+-parseInt(_0x2894e8(0x72))/0x7+parseInt(_0x2894e8(0x6a))/0x8+parseInt(_0x2894e8(0x6f))/0x9;if(_0x288067===_0x438888)break;else _0x189aea['push'](_0x189aea['shift']());}catch(_0x57d192){_0x189aea['push'](_0x189aea['shift']());}}}(a137_0x25b0,0x1a049));function a137_0x25b0(){const _0x486d39=['freeze','35LgLsNn','671346kUomYk','13376Txzrbw','2sZMQlq','569982VRKfMp','18168LXzYMQ','cwd','appCode','project','.agents','3382902EjvVpR','193957oKSzQe','skills','160496ycCYGS','managedRoot','global'];a137_0x25b0=function(){return _0x486d39;};return a137_0x25b0();}import{resolve}from'node:path';import{resolveSkillSyncPaths,runtimeAgentSkillRoots,safePathSegment}from'./paths.js';export function resolveRuntimeSkillInstallTarget(_0x1ee4e5,_0x4bdbd8=a137_0x2ec9c9(0x74),_0x3ef172={}){const _0x1154a4=a137_0x2ec9c9,_0x409aa2=resolveSkillSyncPaths(_0x3ef172),_0x11b5ff=safePathSegment(_0x1ee4e5,_0x1154a4(0x6c)),_0x5afb8e=_0x4bdbd8===_0x1154a4(0x6d)?[resolve(_0x3ef172['cwd']??process[_0x1154a4(0x6b)](),_0x1154a4(0x6e),_0x1154a4(0x71))]:runtimeAgentSkillRoots(_0x409aa2);return Object[_0x1154a4(0x75)]({'scope':_0x4bdbd8,'appCode':_0x11b5ff,'skillRoots':Object[_0x1154a4(0x75)](_0x5afb8e),'managedRoot':_0x409aa2[_0x1154a4(0x73)]});}
@@ -1 +1 @@
1
- const a138_0xc8a214=a138_0x5096;(function(_0x24d554,_0x583fe5){const _0x38d394=a138_0x5096,_0x4225d5=_0x24d554();while(!![]){try{const _0x3fad32=-parseInt(_0x38d394(0x116))/0x1*(-parseInt(_0x38d394(0x11b))/0x2)+parseInt(_0x38d394(0xf5))/0x3*(parseInt(_0x38d394(0x11d))/0x4)+-parseInt(_0x38d394(0x103))/0x5*(parseInt(_0x38d394(0xe7))/0x6)+parseInt(_0x38d394(0x108))/0x7+-parseInt(_0x38d394(0x109))/0x8+parseInt(_0x38d394(0xe9))/0x9+-parseInt(_0x38d394(0xfd))/0xa;if(_0x3fad32===_0x583fe5)break;else _0x4225d5['push'](_0x4225d5['shift']());}catch(_0x563e93){_0x4225d5['push'](_0x4225d5['shift']());}}}(a138_0x412b,0xe977d));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import a138_0x4eac83 from'fs-extra';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';function a138_0x5096(_0x2f0f85,_0xa0a79c){_0x2f0f85=_0x2f0f85-0xe2;const _0x412bc7=a138_0x412b();let _0x5096a9=_0x412bc7[_0x2f0f85];return _0x5096a9;}import{isDanglingSymlink,isPathInside,lstatIfPresent,realOrResolved,resolveSymlinkTarget}from'./fs-utils.js';import{readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillCacheRoot,resolveSkillSyncPaths,safePathSegment}from'./paths.js';const {copySync,ensureDirSync,removeSync}=a138_0x4eac83,RESERVED_PROJECT_SKILL_CODES=new Set([a138_0xc8a214(0x115),'runtime-observe',a138_0xc8a214(0x100)]);export function linkEffectiveRuntimeSkills(_0x547f94,_0x2c1462){const _0x399dd=a138_0xc8a214,_0xfbbd8f=new Map();for(const _0x23289a of _0x547f94){const _0x7c35b0=_0x23289a[_0x399dd(0x118)][_0x399dd(0x11c)];if(!_0x7c35b0)continue;const _0x5ef2b5=_0xfbbd8f[_0x399dd(0x10c)](_0x7c35b0);(!_0x5ef2b5||_0x23289a[_0x399dd(0xee)]===_0x399dd(0xed))&&_0xfbbd8f[_0x399dd(0x114)](_0x7c35b0,_0x23289a);}const _0x3f0b8d=[];for(const _0x562237 of _0xfbbd8f['values']()){const _0x24075c=requireSkillCode(_0x562237[_0x399dd(0x118)]),_0x3778b0=readMetadataIfPresent(_0x562237[_0x399dd(0xe5)]);if(_0x3778b0?.['appCode']!==_0x2c1462[_0x399dd(0x10b)]||_0x3778b0[_0x399dd(0x11c)]!==_0x24075c)throw CliErrors[_0x399dd(0x10a)](_0x399dd(0x11a)+_0x2c1462[_0x399dd(0x10b)]+':\x20'+_0x562237[_0x399dd(0xe5)]);const _0x2de865=runtimeSkillLinkName(_0x2c1462,_0x24075c);for(const _0x2f286b of _0x2c1462[_0x399dd(0xe8)]){_0x3f0b8d[_0x399dd(0xf9)](ensureManagedSymlink(resolve(_0x2f286b,_0x2de865),_0x562237[_0x399dd(0xfa)],_0x2c1462,_0x24075c));}}return _0x3f0b8d;}export function pruneStaleRuntimeSkillLinks(_0x3468b7,_0x532c9e,_0x479dee){const _0x9c26a8=a138_0xc8a214,_0x4d6f66=new Set([..._0x532c9e][_0x9c26a8(0xf7)](_0x4987cf=>_0x4987cf[_0x9c26a8(0x10d)]())[_0x9c26a8(0xe2)](Boolean)),_0x12236b=_0x479dee?new Set([..._0x479dee][_0x9c26a8(0xf7)](_0x4305e8=>_0x4305e8[_0x9c26a8(0x10d)]())[_0x9c26a8(0xe2)](Boolean)):undefined,_0x491121=[];for(const _0xa3fa5a of _0x3468b7[_0x9c26a8(0xe8)]){for(const _0x1ea8ad of managedTargetSkillLinkPaths(_0xa3fa5a,_0x3468b7)){const _0x3aee52=runtimeSkillCodeFromLink(_0x3468b7,_0x1ea8ad);if(_0x12236b&&!_0x12236b[_0x9c26a8(0x102)](_0x3aee52))continue;if(_0x4d6f66[_0x9c26a8(0x102)](_0x3aee52))continue;_0x491121[_0x9c26a8(0xf9)](removeManagedSkillLink(_0x1ea8ad,_0x3468b7,_0x3aee52));}}return _0x491121;}export function pruneStaleRuntimeSkillCache(_0x577dbd,_0x46baba={}){const _0x1459fa=a138_0xc8a214,_0x502215=new Set([..._0x577dbd[_0x1459fa(0x10f)]][_0x1459fa(0xf7)](_0x4ac90d=>_0x4ac90d['trim']())[_0x1459fa(0xe2)](Boolean)),_0xd9dd14=_0x577dbd[_0x1459fa(0x111)]?new Set([..._0x577dbd['pruneSkillCodes']][_0x1459fa(0xf7)](_0x2a1181=>_0x2a1181['trim']())[_0x1459fa(0xe2)](Boolean)):undefined,_0x370b25=_0x577dbd[_0x1459fa(0x113)]??[_0x1459fa(0xed),'company'],_0x4249f5=resolve(getRuntimeSkillCacheRoot(_0x577dbd[_0x1459fa(0x110)],_0x577dbd[_0x1459fa(0xf2)],_0x46baba),safePathSegment(_0x577dbd[_0x1459fa(0x10b)],'appCode')),_0x5c05be=[];for(const _0x5102d5 of _0x370b25){const _0xd6c095=resolve(_0x4249f5,_0x5102d5);if(!existsSync(_0xd6c095))continue;for(const _0xca104d of readdirSync(_0xd6c095,{'withFileTypes':!![]})){if(!_0xca104d['isDirectory']())continue;const _0x3d468b=_0xca104d[_0x1459fa(0xf4)];if(_0xd9dd14&&!_0xd9dd14[_0x1459fa(0x102)](_0x3d468b))continue;if(_0x502215[_0x1459fa(0x102)](_0x3d468b))continue;const _0x9ade0d=resolve(_0xd6c095,_0x3d468b),_0x5e164a=readMetadataIfPresent(resolve(_0x9ade0d,METADATA_FILE));if(_0x5e164a?.[_0x1459fa(0x10b)]!==_0x577dbd[_0x1459fa(0x10b)]||_0x5e164a[_0x1459fa(0xee)]!==_0x5102d5||_0x5e164a['skillCode']!==_0x3d468b){_0x5c05be['push']({'path':_0x9ade0d,'action':'skipped','reason':'metadata-mismatch'});continue;}if(isLinkedFromAnyRoot(_0x9ade0d,_0x577dbd[_0x1459fa(0x106)]??[])){_0x5c05be[_0x1459fa(0xf9)]({'path':_0x9ade0d,'action':_0x1459fa(0xe4),'reason':_0x1459fa(0x117)});continue;}removeSync(_0x9ade0d),_0x5c05be[_0x1459fa(0xf9)]({'path':_0x9ade0d,'action':_0x1459fa(0xeb)});}}return _0x5c05be;}function a138_0x412b(){const _0x328ccb=['1670345eGHptT','linked-from-protected-root','skill','slice','Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20','2aIeugq','skillCode','3851824RSawAu','builtin','filter','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','skipped','metadataPath','isDirectory','1866drHhHD','skillRoots','11747061EmgLiE','Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20','removed','isSymbolicLink','personal','scope','updated','Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20','Refusing\x20to\x20copy\x20Skill\x20symlink:\x20','accessKey','managedRoot','name','3WwNaZI','contentHash','map','project','push','dir','Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20','15986700ioAJAK','agentsSkillsDir','created','secret-retriever','unchanged','has','9795UfRniX','Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20','length','protectedLinkRoots','external-symlink','5558014jUHjOr','12546624nakclS','validation','appCode','get','trim','not-managed-symlink','activeSkillCodes','env','pruneSkillCodes','Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20','scopes','set','lovrabet'];a138_0x412b=function(){return _0x328ccb;};return a138_0x412b();}export function linkGlobalRuntimeSkills(_0x486f41,_0x9be5d={}){const _0x4dabd7=a138_0xc8a214,_0x5cd9e1=resolveSkillSyncPaths(_0x9be5d),_0x3a3008=[];for(const _0x1a63b6 of _0x486f41){if(_0x1a63b6[_0x4dabd7(0xee)]!=='builtin')throw CliErrors[_0x4dabd7(0x10a)](_0x4dabd7(0xe3)+_0x1a63b6[_0x4dabd7(0xee)]);const _0x4dce44=requireSkillCode(_0x1a63b6[_0x4dabd7(0x118)]),_0x4dd9a8=copyManagedSkillDirectory(_0x1a63b6[_0x4dabd7(0xfa)],resolve(_0x5cd9e1[_0x4dabd7(0xfe)],_0x4dce44));_0x3a3008[_0x4dabd7(0xf9)]({..._0x4dd9a8,'contentHash':_0x1a63b6[_0x4dabd7(0xf6)]});}return _0x3a3008;}function ensureManagedSymlink(_0x4b1129,_0x2ead86,_0x2dece6,_0xb136bd){const _0x5b21c1=a138_0xc8a214;mkdirSync(dirname(_0x4b1129),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x4b1129)||isDanglingSymlink(_0x4b1129)){const _0x5dc0b8=lstatSync(_0x4b1129);if(!_0x5dc0b8['isSymbolicLink']())throw CliErrors[_0x5b21c1(0x10a)]('Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20'+_0x4b1129);const _0x5a848a=resolveSymlinkTarget(_0x4b1129);if(!isPathInside(realOrResolved(_0x5a848a),realOrResolved(_0x2dece6[_0x5b21c1(0xf3)])))throw CliErrors[_0x5b21c1(0x10a)](_0x5b21c1(0xea)+_0x4b1129);if(realOrResolved(_0x5a848a)===realOrResolved(_0x2ead86))return{'path':_0x4b1129,'target':_0x2ead86,'action':_0x5b21c1(0x101)};const _0x57b0ac=readMetadataIfPresent(resolve(_0x5a848a,METADATA_FILE));if(_0x2dece6[_0x5b21c1(0xee)]==='project'&&(_0x57b0ac?.[_0x5b21c1(0x10b)]!==_0x2dece6[_0x5b21c1(0x10b)]||_0x57b0ac[_0x5b21c1(0x11c)]!==_0xb136bd))throw CliErrors['validation'](_0x5b21c1(0xf0)+_0x4b1129);return unlinkSync(_0x4b1129),symlinkSync(_0x2ead86,_0x4b1129,_0x5b21c1(0xfa)),{'path':_0x4b1129,'target':_0x2ead86,'action':_0x5b21c1(0xef)};}return symlinkSync(_0x2ead86,_0x4b1129,_0x5b21c1(0xfa)),{'path':_0x4b1129,'target':_0x2ead86,'action':_0x5b21c1(0xff)};}function managedTargetSkillLinkPaths(_0x4dcee7,_0x2ccbde){const _0x43326e=a138_0xc8a214;if(!existsSync(_0x4dcee7))return[];const _0x5750f2=_0x2ccbde[_0x43326e(0x10b)]+'--';return readdirSync(_0x4dcee7,{'withFileTypes':!![]})[_0x43326e(0xe2)](_0x44af9b=>_0x2ccbde[_0x43326e(0xee)]===_0x43326e(0xf8)||_0x44af9b[_0x43326e(0xf4)]['startsWith'](_0x5750f2))[_0x43326e(0xf7)](_0x5750a1=>resolve(_0x4dcee7,_0x5750a1[_0x43326e(0xf4)]));}function removeManagedSkillLink(_0x296a7d,_0x164524,_0x1ead4e){const _0x368055=a138_0xc8a214,_0x5ef060=lstatIfPresent(_0x296a7d);if(!_0x5ef060?.['isSymbolicLink']())return{'path':_0x296a7d,'action':'skipped','reason':_0x368055(0x10e)};const _0x1fffb6=resolveSymlinkTarget(_0x296a7d);if(!isPathInside(realOrResolved(_0x1fffb6),realOrResolved(_0x164524[_0x368055(0xf3)])))return{'path':_0x296a7d,'action':_0x368055(0xe4),'reason':_0x368055(0x107)};const _0x1cf4e6=readMetadataIfPresent(resolve(_0x1fffb6,METADATA_FILE));if(_0x164524[_0x368055(0xee)]===_0x368055(0xf8)&&(_0x1cf4e6?.[_0x368055(0x10b)]!==_0x164524[_0x368055(0x10b)]||_0x1cf4e6[_0x368055(0x11c)]!==_0x1ead4e))return{'path':_0x296a7d,'action':_0x368055(0xe4),'reason':'metadata-mismatch'};return unlinkSync(_0x296a7d),{'path':_0x296a7d,'action':_0x368055(0xeb)};}function isLinkedFromAnyRoot(_0x48f116,_0x4fc461){const _0x2820a3=a138_0xc8a214,_0x241a0f=realOrResolved(_0x48f116);for(const _0x24de0a of _0x4fc461){if(!existsSync(_0x24de0a))continue;for(const _0x5ae044 of readdirSync(_0x24de0a,{'withFileTypes':!![]})){if(!_0x5ae044[_0x2820a3(0xec)]())continue;const _0x4fdf97=resolve(_0x24de0a,_0x5ae044['name']);if(realOrResolved(resolveSymlinkTarget(_0x4fdf97))===_0x241a0f)return!![];}}return![];}function runtimeSkillLinkName(_0xb9114,_0x29a8bf){const _0x1e2f5c=a138_0xc8a214,_0x50d5be=safePathSegment(_0x29a8bf,_0x1e2f5c(0x11c));if(_0xb9114[_0x1e2f5c(0xee)]==='project'&&RESERVED_PROJECT_SKILL_CODES['has'](_0x50d5be))throw CliErrors[_0x1e2f5c(0x10a)](_0x1e2f5c(0x112)+_0x50d5be);return _0xb9114[_0x1e2f5c(0xee)]===_0x1e2f5c(0xf8)?_0x50d5be:_0xb9114[_0x1e2f5c(0x10b)]+'--'+_0x50d5be;}function runtimeSkillCodeFromLink(_0x45a976,_0x144667){const _0x2d85c0=a138_0xc8a214,_0x33c1a0=basename(_0x144667);return _0x45a976[_0x2d85c0(0xee)]==='project'?_0x33c1a0:_0x33c1a0[_0x2d85c0(0x119)]((_0x45a976[_0x2d85c0(0x10b)]+'--')[_0x2d85c0(0x105)]);}export function copyManagedSkillDirectory(_0x507772,_0x19acfd){const _0x5945d1=a138_0xc8a214,_0x666a5f=resolve(_0x19acfd,METADATA_FILE),_0x442367=existsSync(_0x19acfd);if(_0x442367){const _0x42aaae=lstatSync(_0x19acfd);if(_0x42aaae[_0x5945d1(0xec)]())throw CliErrors[_0x5945d1(0x10a)](_0x5945d1(0xfb)+_0x19acfd);if(!_0x42aaae[_0x5945d1(0xe6)]())throw CliErrors['validation'](_0x5945d1(0x104)+_0x19acfd);const _0x19232f=readMetadataIfPresent(_0x666a5f);if(_0x19232f?.[_0x5945d1(0xee)]!==_0x5945d1(0x11e))throw CliErrors[_0x5945d1(0x10a)](_0x5945d1(0xfc)+_0x19acfd);}ensureDirSync(dirname(_0x19acfd));const _0x443e4a=_0x442367?readMetadataIfPresent(_0x666a5f)?.[_0x5945d1(0xf6)]:undefined,_0x1c79d0=readMetadataIfPresent(resolve(_0x507772,METADATA_FILE))?.[_0x5945d1(0xf6)];return _0x442367&&removeSync(_0x19acfd),copySkillDirectory(_0x507772,_0x19acfd),{'path':_0x19acfd,'target':_0x507772,'action':!_0x442367?'created':_0x443e4a===_0x1c79d0?_0x5945d1(0x101):_0x5945d1(0xef)};}function copySkillDirectory(_0x509649,_0x203d5a){copySync(_0x509649,_0x203d5a,{'dereference':![],'overwrite':!![],'filter'(_0x29088e){const _0x691dac=a138_0x5096;if(lstatSync(_0x29088e)[_0x691dac(0xec)]())throw CliErrors[_0x691dac(0x10a)](_0x691dac(0xf1)+_0x29088e);return!![];}});}
1
+ const a138_0x2c9d85=a138_0x41db;(function(_0x10dc5b,_0x28589a){const _0x4a4d81=a138_0x41db,_0x5a7c7c=_0x10dc5b();while(!![]){try{const _0x15345e=parseInt(_0x4a4d81(0xc5))/0x1*(-parseInt(_0x4a4d81(0xe2))/0x2)+parseInt(_0x4a4d81(0xdb))/0x3*(parseInt(_0x4a4d81(0xc6))/0x4)+parseInt(_0x4a4d81(0xb2))/0x5+parseInt(_0x4a4d81(0xb1))/0x6+parseInt(_0x4a4d81(0xb0))/0x7+-parseInt(_0x4a4d81(0xd8))/0x8+-parseInt(_0x4a4d81(0xbf))/0x9;if(_0x15345e===_0x28589a)break;else _0x5a7c7c['push'](_0x5a7c7c['shift']());}catch(_0x5edea7){_0x5a7c7c['push'](_0x5a7c7c['shift']());}}}(a138_0x37df,0x247bb));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';function a138_0x41db(_0x3fd8eb,_0x26ff95){_0x3fd8eb=_0x3fd8eb-0xae;const _0x37df63=a138_0x37df();let _0x41db56=_0x37df63[_0x3fd8eb];return _0x41db56;}import{basename,dirname,resolve}from'node:path';import a138_0x4340d7 from'fs-extra';function a138_0x37df(){const _0xd99389=['map','agentsSkillsDir','set','project','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20','name','removed','skipped','102543iitLTI','1343778Nhghtz','1241015eIRKvK','managedRoot','updated','protectedLinkRoots','contentHash','company','secret-retriever','lovrabet','Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20','length','skillCode','unchanged','filter','1944450xlhORk','validation','metadata-mismatch','pruneSkillCodes','skill','activeSkillCodes','28229DLQvqa','48548ThibSu','Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20','dir','Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20','Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20','startsWith','get','Refusing\x20to\x20copy\x20Skill\x20symlink:\x20','env','push','trim','created','scopes','appCode','has','accessKey','metadataPath','Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20','1137544QSUdTs','builtin','linked-from-protected-root','54LUoDwz','scope','skillRoots','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20','not-managed-symlink','runtime-observe','isDirectory','14zOjvMQ','isSymbolicLink'];a138_0x37df=function(){return _0xd99389;};return a138_0x37df();}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}=a138_0x4340d7,RESERVED_PROJECT_SKILL_CODES=new Set([a138_0x2c9d85(0xb9),a138_0x2c9d85(0xe0),a138_0x2c9d85(0xb8)]);export function linkEffectiveRuntimeSkills(_0x4b4d3d,_0x5309bd){const _0x26913d=a138_0x2c9d85,_0x5bec09=new Map();for(const _0x57ab13 of _0x4b4d3d){const _0x4cb143=_0x57ab13[_0x26913d(0xc3)][_0x26913d(0xbc)];if(!_0x4cb143)continue;const _0x15c107=_0x5bec09[_0x26913d(0xcc)](_0x4cb143);(!_0x15c107||_0x57ab13[_0x26913d(0xdc)]==='personal')&&_0x5bec09[_0x26913d(0xe6)](_0x4cb143,_0x57ab13);}const _0x3c099e=[];for(const _0x5d90f4 of _0x5bec09['values']()){const _0x5502d4=requireSkillCode(_0x5d90f4[_0x26913d(0xc3)]),_0x29a638=readMetadataIfPresent(_0x5d90f4[_0x26913d(0xd6)]);if(_0x29a638?.[_0x26913d(0xd3)]!==_0x5309bd[_0x26913d(0xd3)]||_0x29a638[_0x26913d(0xbc)]!==_0x5502d4)throw CliErrors[_0x26913d(0xc0)](_0x26913d(0xba)+_0x5309bd[_0x26913d(0xd3)]+':\x20'+_0x5d90f4[_0x26913d(0xd6)]);const _0x5cb583=runtimeSkillLinkName(_0x5309bd,_0x5502d4);for(const _0x5daa6c of _0x5309bd[_0x26913d(0xdd)]){_0x3c099e[_0x26913d(0xcf)](ensureManagedSymlink(resolve(_0x5daa6c,_0x5cb583),_0x5d90f4['dir'],_0x5309bd,_0x5502d4));}}return _0x3c099e;}export function pruneStaleRuntimeSkillLinks(_0x5e8e3b,_0x501560,_0x204f64){const _0x192118=a138_0x2c9d85,_0x12b56a=new Set([..._0x501560]['map'](_0x1b7582=>_0x1b7582[_0x192118(0xd0)]())[_0x192118(0xbe)](Boolean)),_0x4efac6=_0x204f64?new Set([..._0x204f64]['map'](_0x14242e=>_0x14242e['trim']())['filter'](Boolean)):undefined,_0x5e4f75=[];for(const _0x288cf8 of _0x5e8e3b[_0x192118(0xdd)]){for(const _0x2b826f of managedTargetSkillLinkPaths(_0x288cf8,_0x5e8e3b)){const _0x3ea09b=runtimeSkillCodeFromLink(_0x5e8e3b,_0x2b826f);if(_0x4efac6&&!_0x4efac6[_0x192118(0xd4)](_0x3ea09b))continue;if(_0x12b56a[_0x192118(0xd4)](_0x3ea09b))continue;_0x5e4f75[_0x192118(0xcf)](removeManagedSkillLink(_0x2b826f,_0x5e8e3b,_0x3ea09b));}}return _0x5e4f75;}export function pruneStaleRuntimeSkillCache(_0x650e53,_0x203720={}){const _0x57db13=a138_0x2c9d85,_0x492b46=new Set([..._0x650e53[_0x57db13(0xc4)]][_0x57db13(0xe4)](_0x554bd5=>_0x554bd5['trim']())['filter'](Boolean)),_0x209c4b=_0x650e53[_0x57db13(0xc2)]?new Set([..._0x650e53[_0x57db13(0xc2)]][_0x57db13(0xe4)](_0x4254a3=>_0x4254a3[_0x57db13(0xd0)]())[_0x57db13(0xbe)](Boolean)):undefined,_0x571a25=_0x650e53[_0x57db13(0xd2)]??['personal',_0x57db13(0xb7)],_0x15b721=resolve(getRuntimeSkillCacheRoot(_0x650e53[_0x57db13(0xce)],_0x650e53[_0x57db13(0xd5)],_0x203720),safePathSegment(_0x650e53[_0x57db13(0xd3)],_0x57db13(0xd3))),_0x6434ba=[];for(const _0xda2162 of _0x571a25){const _0x45c8ab=resolve(_0x15b721,_0xda2162);if(!existsSync(_0x45c8ab))continue;for(const _0x135848 of readdirSync(_0x45c8ab,{'withFileTypes':!![]})){if(!_0x135848['isDirectory']())continue;const _0x23c706=_0x135848[_0x57db13(0xea)];if(_0x209c4b&&!_0x209c4b[_0x57db13(0xd4)](_0x23c706))continue;if(_0x492b46[_0x57db13(0xd4)](_0x23c706))continue;const _0x5e6be2=resolve(_0x45c8ab,_0x23c706),_0xae8d63=readMetadataIfPresent(resolve(_0x5e6be2,METADATA_FILE));if(_0xae8d63?.[_0x57db13(0xd3)]!==_0x650e53[_0x57db13(0xd3)]||_0xae8d63[_0x57db13(0xdc)]!==_0xda2162||_0xae8d63['skillCode']!==_0x23c706){_0x6434ba[_0x57db13(0xcf)]({'path':_0x5e6be2,'action':_0x57db13(0xaf),'reason':'metadata-mismatch'});continue;}if(isLinkedFromAnyRoot(_0x5e6be2,_0x650e53[_0x57db13(0xb5)]??[])){_0x6434ba['push']({'path':_0x5e6be2,'action':'skipped','reason':_0x57db13(0xda)});continue;}removeSync(_0x5e6be2),_0x6434ba[_0x57db13(0xcf)]({'path':_0x5e6be2,'action':_0x57db13(0xae)});}}return _0x6434ba;}export function linkGlobalRuntimeSkills(_0x1618fb,_0x43b98d={}){const _0xbd3c98=a138_0x2c9d85,_0x4adb0c=resolveSkillSyncPaths(_0x43b98d),_0x4b24c2=[];for(const _0x278df2 of _0x1618fb){if(_0x278df2['scope']!==_0xbd3c98(0xd9))throw CliErrors[_0xbd3c98(0xc0)](_0xbd3c98(0xe8)+_0x278df2[_0xbd3c98(0xdc)]);const _0x2d99a8=requireSkillCode(_0x278df2[_0xbd3c98(0xc3)]),_0x2f2fd1=copyManagedSkillDirectory(_0x278df2['dir'],resolve(_0x4adb0c[_0xbd3c98(0xe5)],_0x2d99a8));_0x4b24c2[_0xbd3c98(0xcf)]({..._0x2f2fd1,'contentHash':_0x278df2[_0xbd3c98(0xb6)]});}return _0x4b24c2;}function ensureManagedSymlink(_0x28f051,_0x48971d,_0x2cdcc0,_0x4f84e2){const _0x1754b4=a138_0x2c9d85;mkdirSync(dirname(_0x28f051),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x28f051)||isDanglingSymlink(_0x28f051)){const _0x3fe0a7=lstatSync(_0x28f051);if(!_0x3fe0a7[_0x1754b4(0xe3)]())throw CliErrors[_0x1754b4(0xc0)](_0x1754b4(0xd7)+_0x28f051);const _0x3d1e45=resolveSymlinkTarget(_0x28f051);if(!isPathInside(realOrResolved(_0x3d1e45),realOrResolved(_0x2cdcc0[_0x1754b4(0xb3)])))throw CliErrors[_0x1754b4(0xc0)](_0x1754b4(0xc9)+_0x28f051);if(realOrResolved(_0x3d1e45)===realOrResolved(_0x48971d))return{'path':_0x28f051,'target':_0x48971d,'action':'unchanged'};const _0x11bbdb=readMetadataIfPresent(resolve(_0x3d1e45,METADATA_FILE));if(_0x2cdcc0[_0x1754b4(0xdc)]===_0x1754b4(0xe7)&&(_0x11bbdb?.['appCode']!==_0x2cdcc0[_0x1754b4(0xd3)]||_0x11bbdb['skillCode']!==_0x4f84e2))throw CliErrors[_0x1754b4(0xc0)](_0x1754b4(0xc7)+_0x28f051);return unlinkSync(_0x28f051),symlinkSync(_0x48971d,_0x28f051,_0x1754b4(0xc8)),{'path':_0x28f051,'target':_0x48971d,'action':_0x1754b4(0xb4)};}return symlinkSync(_0x48971d,_0x28f051,_0x1754b4(0xc8)),{'path':_0x28f051,'target':_0x48971d,'action':_0x1754b4(0xd1)};}function managedTargetSkillLinkPaths(_0x4bdaf4,_0x4227eb){const _0x3bf48b=a138_0x2c9d85;if(!existsSync(_0x4bdaf4))return[];const _0x367d4d=_0x4227eb[_0x3bf48b(0xd3)]+'--';return readdirSync(_0x4bdaf4,{'withFileTypes':!![]})[_0x3bf48b(0xbe)](_0x1331e4=>_0x4227eb[_0x3bf48b(0xdc)]===_0x3bf48b(0xe7)||_0x1331e4[_0x3bf48b(0xea)][_0x3bf48b(0xcb)](_0x367d4d))['map'](_0x1f5d3c=>resolve(_0x4bdaf4,_0x1f5d3c[_0x3bf48b(0xea)]));}function removeManagedSkillLink(_0x11f6f6,_0x521651,_0x47d0d4){const _0x544335=a138_0x2c9d85,_0x105681=lstatIfPresent(_0x11f6f6);if(!_0x105681?.[_0x544335(0xe3)]())return{'path':_0x11f6f6,'action':'skipped','reason':_0x544335(0xdf)};const _0x539eee=resolveSymlinkTarget(_0x11f6f6);if(!isPathInside(realOrResolved(_0x539eee),realOrResolved(_0x521651[_0x544335(0xb3)])))return{'path':_0x11f6f6,'action':_0x544335(0xaf),'reason':'external-symlink'};const _0xf03d90=readMetadataIfPresent(resolve(_0x539eee,METADATA_FILE));if(_0x521651[_0x544335(0xdc)]===_0x544335(0xe7)&&(_0xf03d90?.[_0x544335(0xd3)]!==_0x521651[_0x544335(0xd3)]||_0xf03d90['skillCode']!==_0x47d0d4))return{'path':_0x11f6f6,'action':_0x544335(0xaf),'reason':_0x544335(0xc1)};return unlinkSync(_0x11f6f6),{'path':_0x11f6f6,'action':'removed'};}function isLinkedFromAnyRoot(_0x48f916,_0x371fe6){const _0x56deaf=a138_0x2c9d85,_0x1cf923=realOrResolved(_0x48f916);for(const _0x297c8d of _0x371fe6){if(!existsSync(_0x297c8d))continue;for(const _0x1d523c of readdirSync(_0x297c8d,{'withFileTypes':!![]})){if(!_0x1d523c[_0x56deaf(0xe3)]())continue;const _0x3f0049=resolve(_0x297c8d,_0x1d523c[_0x56deaf(0xea)]);if(realOrResolved(resolveSymlinkTarget(_0x3f0049))===_0x1cf923)return!![];}}return![];}function runtimeSkillLinkName(_0x44433d,_0x287763){const _0x2c7032=a138_0x2c9d85,_0x4249f7=safePathSegment(_0x287763,'skillCode');if(_0x44433d[_0x2c7032(0xdc)]==='project'&&RESERVED_PROJECT_SKILL_CODES[_0x2c7032(0xd4)](_0x4249f7))throw CliErrors[_0x2c7032(0xc0)](_0x2c7032(0xe9)+_0x4249f7);return _0x44433d['scope']==='project'?_0x4249f7:_0x44433d['appCode']+'--'+_0x4249f7;}function runtimeSkillCodeFromLink(_0x5f2ee9,_0x193b33){const _0x4cffd4=a138_0x2c9d85,_0xd13829=basename(_0x193b33);return _0x5f2ee9[_0x4cffd4(0xdc)]===_0x4cffd4(0xe7)?_0xd13829:_0xd13829['slice']((_0x5f2ee9[_0x4cffd4(0xd3)]+'--')[_0x4cffd4(0xbb)]);}export function copyManagedSkillDirectory(_0x3fb176,_0x470e6e){const _0x5a8a09=a138_0x2c9d85,_0xe6ed8=resolve(_0x470e6e,METADATA_FILE),_0x3a25bb=existsSync(_0x470e6e);if(_0x3a25bb){const _0x3fe681=lstatSync(_0x470e6e);if(_0x3fe681[_0x5a8a09(0xe3)]())throw CliErrors[_0x5a8a09(0xc0)]('Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20'+_0x470e6e);if(!_0x3fe681[_0x5a8a09(0xe1)]())throw CliErrors[_0x5a8a09(0xc0)](_0x5a8a09(0xca)+_0x470e6e);const _0xc8a8a=readMetadataIfPresent(_0xe6ed8);if(_0xc8a8a?.[_0x5a8a09(0xdc)]!=='builtin')throw CliErrors[_0x5a8a09(0xc0)](_0x5a8a09(0xde)+_0x470e6e);}ensureDirSync(dirname(_0x470e6e));const _0x3ac991=_0x3a25bb?readMetadataIfPresent(_0xe6ed8)?.[_0x5a8a09(0xb6)]:undefined,_0x27acd3=readMetadataIfPresent(resolve(_0x3fb176,METADATA_FILE))?.[_0x5a8a09(0xb6)];return _0x3a25bb&&removeSync(_0x470e6e),copySkillDirectory(_0x3fb176,_0x470e6e),{'path':_0x470e6e,'target':_0x3fb176,'action':!_0x3a25bb?_0x5a8a09(0xd1):_0x3ac991===_0x27acd3?_0x5a8a09(0xbd):_0x5a8a09(0xb4)};}function copySkillDirectory(_0x45709f,_0x55c376){copySync(_0x45709f,_0x55c376,{'dereference':![],'overwrite':!![],'filter'(_0x164390){const _0x5f492e=a138_0x41db;if(lstatSync(_0x164390)[_0x5f492e(0xe3)]())throw CliErrors[_0x5f492e(0xc0)](_0x5f492e(0xcd)+_0x164390);return!![];}});}
@@ -1 +1 @@
1
- (function(_0x30a921,_0x289ff4){const _0x1e3d62=a139_0x3c17,_0x1d5c9c=_0x30a921();while(!![]){try{const _0x472a69=-parseInt(_0x1e3d62(0xcd))/0x1+parseInt(_0x1e3d62(0xdb))/0x2*(-parseInt(_0x1e3d62(0xd8))/0x3)+-parseInt(_0x1e3d62(0xce))/0x4+parseInt(_0x1e3d62(0xb6))/0x5*(-parseInt(_0x1e3d62(0xd6))/0x6)+-parseInt(_0x1e3d62(0xc2))/0x7*(-parseInt(_0x1e3d62(0xd7))/0x8)+parseInt(_0x1e3d62(0xc4))/0x9*(-parseInt(_0x1e3d62(0xbb))/0xa)+-parseInt(_0x1e3d62(0xd4))/0xb*(-parseInt(_0x1e3d62(0xbc))/0xc);if(_0x472a69===_0x289ff4)break;else _0x1d5c9c['push'](_0x1d5c9c['shift']());}catch(_0x391ab6){_0x1d5c9c['push'](_0x1d5c9c['shift']());}}}(a139_0xfede,0x26e29));import{existsSync,readdirSync}from'node:fs';import{resolve}from'node:path';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';function a139_0xfede(){const _0x5477d0=['set','sort','code','includes','skillRoots','builtin','map','241600CrNFni','60848phlcPv','trim','isDirectory','appCode','env','skillMdPath','8951921INXlws','linkedPaths','6iKhUno','82744lKbihC','597WxkyeC','project','cache','2038UvelCH','name','accessKey','isArray','dir','tags','isSymbolicLink','metadataPath','117205OYdlLE','scope','localeCompare','source','link','2232190jxkhRn','12cdcDhy','scopes','skillCode','has','local','validation','35kkZIRh','filter','9HkNudB','values'];a139_0xfede=function(){return _0x5477d0;};return a139_0xfede();}import{readMetadataIfPresent}from'./metadata.js';import{getRuntimeSkillCacheRoot,safePathSegment}from'./paths.js';import{isRuntimeSkillScope,normalizeRuntimeSkillScopes}from'./scopes.js';export function listLocalRuntimeSkills(_0x68f2be,_0x4b2187,_0x2e67d3={}){const _0x189908=a139_0x3c17,_0x1b04e3=safePathSegment(_0x68f2be['appCode'],_0x189908(0xd1));if(_0x4b2187['appCode']!==_0x1b04e3)throw CliErrors[_0x189908(0xc1)]('Runtime\x20Skill\x20install\x20target\x20app\x20mismatch:\x20'+_0x4b2187[_0x189908(0xd1)]+'\x20!=\x20'+_0x1b04e3);const _0x53d2a1=normalizeRuntimeSkillScopes(_0x68f2be['scopes']),_0xc88bed=new Set(_0x53d2a1),_0x53fc28=_0x68f2be[_0x189908(0xc8)]?.[_0x189908(0xcf)](),_0x5ccd4f=new Map(),_0x3c47c1=resolve(getRuntimeSkillCacheRoot(_0x68f2be[_0x189908(0xd2)],_0x68f2be[_0x189908(0xb0)],_0x2e67d3),_0x1b04e3);for(const _0x58745c of _0x53d2a1){for(const _0x21aff0 of localSkillEntryDirs(resolve(_0x3c47c1,_0x58745c))){collectLocalRuntimeSkill(_0x5ccd4f,_0x21aff0,{'appCode':_0x1b04e3,'scopes':_0xc88bed,'code':_0x53fc28,'source':_0x189908(0xda)});}}for(const _0x37486a of _0x4b2187[_0x189908(0xca)]){for(const _0x4ed703 of localSkillLinkCandidates(_0x37486a,_0x4b2187,_0xc88bed)){collectLocalRuntimeSkill(_0x5ccd4f,_0x4ed703,{'appCode':_0x1b04e3,'scopes':_0xc88bed,'code':_0x53fc28,'source':_0x189908(0xba),'linkedPath':_0x4ed703});}}return Array['from'](_0x5ccd4f[_0x189908(0xc5)]())[_0x189908(0xc7)](compareLocalRuntimeSkills);}function a139_0x3c17(_0x4fee90,_0x3b4002){_0x4fee90=_0x4fee90-0xaf;const _0xfede0b=a139_0xfede();let _0x3c17c1=_0xfede0b[_0x4fee90];return _0x3c17c1;}function localSkillEntryDirs(_0x2a8d7d){const _0x37352d=a139_0x3c17;if(!existsSync(_0x2a8d7d))return[];return readdirSync(_0x2a8d7d,{'withFileTypes':!![]})['filter'](_0x424677=>_0x424677[_0x37352d(0xd0)]()||_0x424677['isSymbolicLink']())[_0x37352d(0xcc)](_0x5397a8=>resolve(_0x2a8d7d,_0x5397a8[_0x37352d(0xaf)]));}function localSkillLinkCandidates(_0x3fd58d,_0x361a7d,_0x27ab9d){const _0x5b525c=a139_0x3c17;if(!existsSync(_0x3fd58d))return[];const _0x203dbe=_0x361a7d['appCode']+'--';return readdirSync(_0x3fd58d,{'withFileTypes':!![]})['filter'](_0x23155f=>_0x23155f['isDirectory']()||_0x23155f[_0x5b525c(0xb4)]())[_0x5b525c(0xc3)](_0x4f1468=>_0x361a7d['scope']===_0x5b525c(0xd9)||_0x4f1468[_0x5b525c(0xaf)]['startsWith'](_0x203dbe)||_0x27ab9d[_0x5b525c(0xbf)](_0x5b525c(0xcb)))[_0x5b525c(0xcc)](_0xbd2335=>resolve(_0x3fd58d,_0xbd2335['name']));}function collectLocalRuntimeSkill(_0x1f94d4,_0xff9de5,_0x3497da){const _0xc12744=a139_0x3c17,_0x3cd4ab=resolve(_0xff9de5,METADATA_FILE),_0x267baa=readMetadataIfPresent(_0x3cd4ab);if(!_0x267baa)return;if(_0x267baa[_0xc12744(0xd1)]!==_0x3497da[_0xc12744(0xd1)])return;if(!isRuntimeSkillScope(_0x267baa[_0xc12744(0xb7)])||!_0x3497da[_0xc12744(0xbd)][_0xc12744(0xbf)](_0x267baa[_0xc12744(0xb7)]))return;const _0x5521c0=_0x267baa['skillCode']?.[_0xc12744(0xcf)]();if(!_0x5521c0)return;if(_0x3497da[_0xc12744(0xc8)]&&_0x5521c0!==_0x3497da[_0xc12744(0xc8)])return;const _0x2fc38b=_0x267baa[_0xc12744(0xb7)]+':'+_0x5521c0,_0x1bdc31=_0x3497da['linkedPath']?[_0x3497da['linkedPath']]:[],_0x3f5c44=_0x1f94d4['get'](_0x2fc38b);if(_0x3f5c44){_0x3497da[_0xc12744(0xb9)]==='cache'&&(_0x3f5c44[_0xc12744(0xb2)]=_0xff9de5,_0x3f5c44['cacheDir']=_0xff9de5,_0x3f5c44[_0xc12744(0xd3)]=resolve(_0xff9de5,SKILL_FILE),_0x3f5c44[_0xc12744(0xb5)]=_0x3cd4ab);for(const _0xcde212 of _0x1bdc31){!_0x3f5c44['linkedPaths'][_0xc12744(0xc9)](_0xcde212)&&_0x3f5c44[_0xc12744(0xd5)]['push'](_0xcde212);}_0x3f5c44[_0xc12744(0xd5)][_0xc12744(0xc7)]();return;}_0x1f94d4[_0xc12744(0xc6)](_0x2fc38b,{..._0x267baa,'tags':Array[_0xc12744(0xb1)](_0x267baa['tags'])?_0x267baa[_0xc12744(0xb3)]:[],'scope':_0x267baa['scope'],'source':_0xc12744(0xc0),'dir':_0xff9de5,'cacheDir':_0x3497da[_0xc12744(0xb9)]===_0xc12744(0xda)?_0xff9de5:undefined,'skillMdPath':resolve(_0xff9de5,SKILL_FILE),'metadataPath':_0x3cd4ab,'linkedPaths':_0x1bdc31});}function compareLocalRuntimeSkills(_0x58b412,_0x26a37b){const _0x5b3d87=a139_0x3c17,_0x2b510a={'personal':0x0,'company':0x1,'builtin':0x2};return _0x2b510a[_0x58b412['scope']]-_0x2b510a[_0x26a37b[_0x5b3d87(0xb7)]]||_0x58b412['skillCode'][_0x5b3d87(0xb8)](_0x26a37b[_0x5b3d87(0xbe)])||_0x58b412[_0x5b3d87(0xb2)][_0x5b3d87(0xb8)](_0x26a37b[_0x5b3d87(0xb2)]);}
1
+ (function(_0x545e3,_0x2baa85){const _0x46927=a139_0x2e06,_0x1f179d=_0x545e3();while(!![]){try{const _0x2adb68=parseInt(_0x46927(0x1b9))/0x1+-parseInt(_0x46927(0x1bf))/0x2*(parseInt(_0x46927(0x1bd))/0x3)+parseInt(_0x46927(0x1a1))/0x4+parseInt(_0x46927(0x1b8))/0x5+-parseInt(_0x46927(0x1a0))/0x6+-parseInt(_0x46927(0x198))/0x7*(-parseInt(_0x46927(0x1b4))/0x8)+parseInt(_0x46927(0x1ad))/0x9*(-parseInt(_0x46927(0x1a3))/0xa);if(_0x2adb68===_0x2baa85)break;else _0x1f179d['push'](_0x1f179d['shift']());}catch(_0x4afe59){_0x1f179d['push'](_0x1f179d['shift']());}}}(a139_0x2af6,0x59a49));import{existsSync,readdirSync}from'node:fs';import{resolve}from'node:path';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';function a139_0x2e06(_0xd64196,_0x497214){_0xd64196=_0xd64196-0x198;const _0x2af61a=a139_0x2af6();let _0x2e06e0=_0x2af61a[_0xd64196];return _0x2e06e0;}import{readMetadataIfPresent}from'./metadata.js';import{getRuntimeSkillCacheRoot,safePathSegment}from'./paths.js';import{isRuntimeSkillScope,normalizeRuntimeSkillScopes}from'./scopes.js';export function listLocalRuntimeSkills(_0x1f045e,_0x1ec466,_0x35cd5c={}){const _0x4246bd=a139_0x2e06,_0x838aa8=safePathSegment(_0x1f045e['appCode'],_0x4246bd(0x1a5));if(_0x1ec466[_0x4246bd(0x1a5)]!==_0x838aa8)throw CliErrors['validation'](_0x4246bd(0x19c)+_0x1ec466[_0x4246bd(0x1a5)]+_0x4246bd(0x19b)+_0x838aa8);const _0x59cd1c=normalizeRuntimeSkillScopes(_0x1f045e[_0x4246bd(0x1c2)]),_0x5a3581=new Set(_0x59cd1c),_0x1c097f=_0x1f045e[_0x4246bd(0x19a)]?.[_0x4246bd(0x1ae)](),_0x2950e5=new Map(),_0x1ef15b=resolve(getRuntimeSkillCacheRoot(_0x1f045e[_0x4246bd(0x1a2)],_0x1f045e['accessKey'],_0x35cd5c),_0x838aa8);for(const _0x2fcac9 of _0x59cd1c){for(const _0x8fe04a of localSkillEntryDirs(resolve(_0x1ef15b,_0x2fcac9))){collectLocalRuntimeSkill(_0x2950e5,_0x8fe04a,{'appCode':_0x838aa8,'scopes':_0x5a3581,'code':_0x1c097f,'source':_0x4246bd(0x1b0)});}}for(const _0x4eb4f7 of _0x1ec466[_0x4246bd(0x1af)]){for(const _0x4960ac of localSkillLinkCandidates(_0x4eb4f7,_0x1ec466,_0x5a3581)){collectLocalRuntimeSkill(_0x2950e5,_0x4960ac,{'appCode':_0x838aa8,'scopes':_0x5a3581,'code':_0x1c097f,'source':'link','linkedPath':_0x4960ac});}}return Array[_0x4246bd(0x1a7)](_0x2950e5[_0x4246bd(0x199)]())[_0x4246bd(0x1a4)](compareLocalRuntimeSkills);}function localSkillEntryDirs(_0x26f9e5){const _0x4b60ff=a139_0x2e06;if(!existsSync(_0x26f9e5))return[];return readdirSync(_0x26f9e5,{'withFileTypes':!![]})[_0x4b60ff(0x1ac)](_0x1128d7=>_0x1128d7[_0x4b60ff(0x1ba)]()||_0x1128d7['isSymbolicLink']())[_0x4b60ff(0x1c3)](_0x3c79bf=>resolve(_0x26f9e5,_0x3c79bf['name']));}function localSkillLinkCandidates(_0x270205,_0x78ad99,_0x85cabe){const _0x15e51d=a139_0x2e06;if(!existsSync(_0x270205))return[];const _0x2742c5=_0x78ad99['appCode']+'--';return readdirSync(_0x270205,{'withFileTypes':!![]})[_0x15e51d(0x1ac)](_0x49bd3e=>_0x49bd3e[_0x15e51d(0x1ba)]()||_0x49bd3e[_0x15e51d(0x1a6)]())[_0x15e51d(0x1ac)](_0x158ad6=>_0x78ad99['scope']===_0x15e51d(0x19f)||_0x158ad6[_0x15e51d(0x1a8)][_0x15e51d(0x1a9)](_0x2742c5)||_0x85cabe[_0x15e51d(0x1aa)](_0x15e51d(0x1b3)))['map'](_0x460553=>resolve(_0x270205,_0x460553[_0x15e51d(0x1a8)]));}function collectLocalRuntimeSkill(_0x10c3ac,_0xb743a3,_0x53906c){const _0x456c20=a139_0x2e06,_0x31e54c=resolve(_0xb743a3,METADATA_FILE),_0x5bc80d=readMetadataIfPresent(_0x31e54c);if(!_0x5bc80d)return;if(_0x5bc80d[_0x456c20(0x1a5)]!==_0x53906c[_0x456c20(0x1a5)])return;if(!isRuntimeSkillScope(_0x5bc80d['scope'])||!_0x53906c[_0x456c20(0x1c2)]['has'](_0x5bc80d['scope']))return;const _0x22f027=_0x5bc80d['skillCode']?.[_0x456c20(0x1ae)]();if(!_0x22f027)return;if(_0x53906c[_0x456c20(0x19a)]&&_0x22f027!==_0x53906c[_0x456c20(0x19a)])return;const _0x22d9cb=_0x5bc80d[_0x456c20(0x1bb)]+':'+_0x22f027,_0x5a23ff=_0x53906c[_0x456c20(0x1b5)]?[_0x53906c[_0x456c20(0x1b5)]]:[],_0x5f2021=_0x10c3ac['get'](_0x22d9cb);if(_0x5f2021){_0x53906c[_0x456c20(0x1b7)]==='cache'&&(_0x5f2021[_0x456c20(0x1ab)]=_0xb743a3,_0x5f2021['cacheDir']=_0xb743a3,_0x5f2021[_0x456c20(0x1be)]=resolve(_0xb743a3,SKILL_FILE),_0x5f2021[_0x456c20(0x1b6)]=_0x31e54c);for(const _0x297793 of _0x5a23ff){!_0x5f2021[_0x456c20(0x1b1)][_0x456c20(0x1c0)](_0x297793)&&_0x5f2021[_0x456c20(0x1b1)]['push'](_0x297793);}_0x5f2021[_0x456c20(0x1b1)]['sort']();return;}_0x10c3ac[_0x456c20(0x1c1)](_0x22d9cb,{..._0x5bc80d,'tags':Array[_0x456c20(0x19d)](_0x5bc80d[_0x456c20(0x1b2)])?_0x5bc80d[_0x456c20(0x1b2)]:[],'scope':_0x5bc80d[_0x456c20(0x1bb)],'source':'local','dir':_0xb743a3,'cacheDir':_0x53906c[_0x456c20(0x1b7)]==='cache'?_0xb743a3:undefined,'skillMdPath':resolve(_0xb743a3,SKILL_FILE),'metadataPath':_0x31e54c,'linkedPaths':_0x5a23ff});}function compareLocalRuntimeSkills(_0x10bd7d,_0x12d7f1){const _0x4ce6c3=a139_0x2e06,_0x398d95={'personal':0x0,'company':0x1,'builtin':0x2};return _0x398d95[_0x10bd7d[_0x4ce6c3(0x1bb)]]-_0x398d95[_0x12d7f1[_0x4ce6c3(0x1bb)]]||_0x10bd7d[_0x4ce6c3(0x19e)][_0x4ce6c3(0x1bc)](_0x12d7f1[_0x4ce6c3(0x19e)])||_0x10bd7d['dir'][_0x4ce6c3(0x1bc)](_0x12d7f1[_0x4ce6c3(0x1ab)]);}function a139_0x2af6(){const _0x3d450a=['isDirectory','scope','localeCompare','3MksHUJ','skillMdPath','49804IcScZg','includes','set','scopes','map','2871659RFOiJt','values','code','\x20!=\x20','Runtime\x20Skill\x20install\x20target\x20app\x20mismatch:\x20','isArray','skillCode','project','3280632mBhmvW','941164cMYNde','env','150zYgLSS','sort','appCode','isSymbolicLink','from','name','startsWith','has','dir','filter','41427mQTuOe','trim','skillRoots','cache','linkedPaths','tags','builtin','8zOUrlq','linkedPath','metadataPath','source','450430wNZVQL','272282GyQsIp'];a139_0x2af6=function(){return _0x3d450a;};return a139_0x2af6();}
@@ -1 +1 @@
1
- (function(_0x9469c3,_0x20a61c){const _0x4fdd8f=a140_0x1d7a,_0x356b6b=_0x9469c3();while(!![]){try{const _0x499960=parseInt(_0x4fdd8f(0x12a))/0x1*(-parseInt(_0x4fdd8f(0x12e))/0x2)+-parseInt(_0x4fdd8f(0x129))/0x3*(-parseInt(_0x4fdd8f(0x148))/0x4)+-parseInt(_0x4fdd8f(0x136))/0x5*(parseInt(_0x4fdd8f(0x150))/0x6)+parseInt(_0x4fdd8f(0x126))/0x7+-parseInt(_0x4fdd8f(0x149))/0x8+-parseInt(_0x4fdd8f(0x14e))/0x9+parseInt(_0x4fdd8f(0x137))/0xa;if(_0x499960===_0x20a61c)break;else _0x356b6b['push'](_0x356b6b['shift']());}catch(_0x553859){_0x356b6b['push'](_0x356b6b['shift']());}}}(a140_0x230a,0x63d5f));import{readFileSync,readdirSync,realpathSync}from'node:fs';import{relative,resolve}from'node:path';import{CliErrors}from'../../errors.js';import{IGNORED_DIR_NAMES,IGNORED_FILE_NAMES,SKILL_FILE}from'./constants.js';export function fileContent(_0x43c5e3){const _0x2ff170=a140_0x1d7a;return _0x43c5e3[_0x2ff170(0x12c)]??Buffer[_0x2ff170(0x13b)](_0x43c5e3[_0x2ff170(0x13c)]??'','utf8');}export function fileText(_0x21e3d2){const _0x310f4f=a140_0x1d7a;return fileContent(_0x21e3d2)[_0x310f4f(0x133)](_0x310f4f(0x12d));}export function normalizeLocalFiles(_0x5e11cd){const _0x34f171=a140_0x1d7a;if(!Array[_0x34f171(0x127)](_0x5e11cd)||_0x5e11cd[_0x34f171(0x14a)]===0x0)return[];const _0x5be3af=new Map();for(const _0x21b35f of _0x5e11cd){if(!_0x21b35f||typeof _0x21b35f!=='object'||typeof _0x21b35f['path']!==_0x34f171(0x145))throw CliErrors['validation'](_0x34f171(0x139));const _0x39962f=normalizeSkillRelativePath(_0x21b35f[_0x34f171(0x144)]);if(_0x5be3af[_0x34f171(0x131)](_0x39962f))throw CliErrors[_0x34f171(0x135)](_0x34f171(0x13f)+_0x39962f);if(_0x21b35f[_0x34f171(0x12c)]!==undefined&&!Buffer['isBuffer'](_0x21b35f[_0x34f171(0x12c)]))throw CliErrors['validation']('Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20'+_0x39962f);if(_0x21b35f[_0x34f171(0x12c)]===undefined&&typeof _0x21b35f[_0x34f171(0x13c)]!==_0x34f171(0x145))throw CliErrors[_0x34f171(0x135)](_0x34f171(0x140)+_0x39962f);const _0x1dffb5=fileContent(_0x21b35f);_0x5be3af['set'](_0x39962f,{'path':_0x39962f,'bytes':_0x1dffb5});}return Array['from'](_0x5be3af[_0x34f171(0x14c)]())['sort'](compareSkillFiles);}function a140_0x230a(){const _0x18e33=['isSymbolicLink','includes','trim','path','string','startsWith','size','16JpSRNQ','5115192jiSEhd','length','add','values','replace','5294610smrNke','isFile','96QprLlh','test','object','Skill\x20file\x20sha256\x20is\x20invalid:\x20','3603733tjvdYd','isArray','Skill\x20file\x20size\x20is\x20invalid:\x20','74097nccezc','1oOyZqB','name','bytes','utf8','1337566DTnhCS','Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20','split','has','isDirectory','toString','localeCompare','validation','32880mddphS','17970000HvuoxB','excludedFilePaths','Skill\x20file\x20path\x20must\x20be\x20text.','compare','from','content','sort','sha256','Duplicate\x20Skill\x20file\x20path:\x20','Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20'];a140_0x230a=function(){return _0x18e33;};return a140_0x230a();}export function normalizeManifestFiles(_0xaab96f){const _0x1c35c8=a140_0x1d7a;if(!Array['isArray'](_0xaab96f)||_0xaab96f[_0x1c35c8(0x14a)]===0x0)return[];const _0x4e77a8=new Map();for(const _0x11a4dd of _0xaab96f){if(!_0x11a4dd||typeof _0x11a4dd!==_0x1c35c8(0x152)||typeof _0x11a4dd[_0x1c35c8(0x144)]!==_0x1c35c8(0x145))throw CliErrors[_0x1c35c8(0x135)](_0x1c35c8(0x139));const _0x46fc53=normalizeSkillRelativePath(_0x11a4dd[_0x1c35c8(0x144)]);if(_0x4e77a8[_0x1c35c8(0x131)](_0x46fc53))throw CliErrors['validation'](_0x1c35c8(0x13f)+_0x46fc53);if(!isSha256Hex(_0x11a4dd[_0x1c35c8(0x13e)]))throw CliErrors[_0x1c35c8(0x135)](_0x1c35c8(0x153)+_0x46fc53);if(!Number['isSafeInteger'](_0x11a4dd[_0x1c35c8(0x147)])||_0x11a4dd[_0x1c35c8(0x147)]<0x0)throw CliErrors[_0x1c35c8(0x135)](_0x1c35c8(0x128)+_0x46fc53);_0x4e77a8['set'](_0x46fc53,{'path':_0x46fc53,'sha256':_0x11a4dd[_0x1c35c8(0x13e)]['toLowerCase'](),'size':_0x11a4dd['size']});}return Array[_0x1c35c8(0x13b)](_0x4e77a8[_0x1c35c8(0x14c)]())['sort'](compareSkillFiles);}export function scanSkillDirectory(_0xd02dac,_0xff0f93={}){const _0xc5d87d=a140_0x1d7a,_0x3fa838=realpathSync(_0xd02dac),_0x56c712=canonicalExcludedFilePaths(_0xff0f93[_0xc5d87d(0x138)]),_0x291e40=[];function _0x30442d(_0x1360e4){const _0x5b6979=_0xc5d87d,_0x3b2b63=readdirSync(_0x1360e4,{'withFileTypes':!![]})[_0x5b6979(0x13d)]((_0x5f63f6,_0x51f7e2)=>_0x5f63f6['name'][_0x5b6979(0x134)](_0x51f7e2[_0x5b6979(0x12b)]));for(const _0x40a4da of _0x3b2b63){if(_0x40a4da[_0x5b6979(0x132)]()&&IGNORED_DIR_NAMES[_0x5b6979(0x131)](_0x40a4da[_0x5b6979(0x12b)]))continue;if(IGNORED_FILE_NAMES[_0x5b6979(0x131)](_0x40a4da[_0x5b6979(0x12b)]))continue;const _0x40f479=resolve(_0x1360e4,_0x40a4da['name']);if(isExcludedFilePath(_0x40f479,_0x56c712))continue;if(_0x40a4da[_0x5b6979(0x141)]())throw CliErrors[_0x5b6979(0x135)](_0x5b6979(0x12f)+_0x40f479);const _0x22595c=toPosixPath(relative(_0x3fa838,_0x40f479));if(_0x40a4da[_0x5b6979(0x132)]()){_0x30442d(_0x40f479);continue;}if(!_0x40a4da[_0x5b6979(0x14f)]())continue;validateSkillRelativePath(_0x22595c);const _0x3f7fd3=readFileSync(_0x40f479);_0x291e40['push']({'path':_0x22595c,'bytes':_0x3f7fd3});}}return _0x30442d(_0x3fa838),normalizeLocalFiles(_0x291e40);}function canonicalExcludedFilePaths(_0x43f3fa){const _0x4ae26a=a140_0x1d7a,_0x45b850=new Set();for(const _0x41a948 of _0x43f3fa??[]){const _0x511049=resolve(_0x41a948);_0x45b850[_0x4ae26a(0x14b)](_0x511049);try{_0x45b850[_0x4ae26a(0x14b)](realpathSync(_0x511049));}catch{}}return _0x45b850;}function isExcludedFilePath(_0x3584f8,_0x5a20b2){const _0xff0b60=a140_0x1d7a;if(_0x5a20b2[_0xff0b60(0x131)](_0x3584f8))return!![];if(_0x5a20b2[_0xff0b60(0x147)]===0x0)return![];try{return _0x5a20b2[_0xff0b60(0x131)](realpathSync(_0x3584f8));}catch{return![];}}export function compareSkillFiles(_0x44f9e2,_0x53c129){const _0x336e68=a140_0x1d7a;if(_0x44f9e2[_0x336e68(0x144)]===SKILL_FILE)return _0x53c129['path']===SKILL_FILE?0x0:-0x1;if(_0x53c129[_0x336e68(0x144)]===SKILL_FILE)return 0x1;return Buffer[_0x336e68(0x13a)](Buffer[_0x336e68(0x13b)](_0x44f9e2[_0x336e68(0x144)],_0x336e68(0x12d)),Buffer['from'](_0x53c129[_0x336e68(0x144)],_0x336e68(0x12d)));}export function normalizeSkillRelativePath(_0x112da4){const _0x3315a6=a140_0x1d7a,_0x4335cb=toPosixPath(_0x112da4[_0x3315a6(0x143)]());return validateSkillRelativePath(_0x4335cb),_0x4335cb;}function a140_0x1d7a(_0xba82aa,_0x5e3dd5){_0xba82aa=_0xba82aa-0x126;const _0x230a24=a140_0x230a();let _0x1d7a66=_0x230a24[_0xba82aa];return _0x1d7a66;}export function validateSkillRelativePath(_0x441097){const _0x2df739=a140_0x1d7a;if(!_0x441097||_0x441097[_0x2df739(0x146)]('/')||_0x441097[_0x2df739(0x142)]('//'))throw CliErrors[_0x2df739(0x135)]('Unsafe\x20Skill\x20file\x20path:\x20'+_0x441097);for(const _0xedcbe8 of _0x441097[_0x2df739(0x130)]('/')){if(!_0xedcbe8||_0xedcbe8==='.'||_0xedcbe8==='..')throw CliErrors[_0x2df739(0x135)]('Unsafe\x20Skill\x20file\x20path:\x20'+_0x441097);}}export function toPosixPath(_0x5db5ec){const _0x1c952=a140_0x1d7a;return _0x5db5ec[_0x1c952(0x14d)](/\\/g,'/');}export function isSha256Hex(_0x1d0d7b){const _0x53da48=a140_0x1d7a;return typeof _0x1d0d7b==='string'&&/^[a-fA-F0-9]{64}$/[_0x53da48(0x151)](_0x1d0d7b);}
1
+ (function(_0x5e8572,_0x1455b9){const _0x3a0bbe=a140_0x8bd0,_0x3b2ee7=_0x5e8572();while(!![]){try{const _0x519292=-parseInt(_0x3a0bbe(0x1e4))/0x1*(-parseInt(_0x3a0bbe(0x1d8))/0x2)+-parseInt(_0x3a0bbe(0x1eb))/0x3+parseInt(_0x3a0bbe(0x1c2))/0x4+-parseInt(_0x3a0bbe(0x1e7))/0x5+parseInt(_0x3a0bbe(0x1d4))/0x6+parseInt(_0x3a0bbe(0x1cd))/0x7+parseInt(_0x3a0bbe(0x1ed))/0x8;if(_0x519292===_0x1455b9)break;else _0x3b2ee7['push'](_0x3b2ee7['shift']());}catch(_0xabb155){_0x3b2ee7['push'](_0x3b2ee7['shift']());}}}(a140_0x547e,0x8e471));import{readFileSync,readdirSync,realpathSync}from'node:fs';import{relative,resolve}from'node:path';import{CliErrors}from'../../errors.js';import{IGNORED_DIR_NAMES,IGNORED_FILE_NAMES,SKILL_FILE}from'./constants.js';export function fileContent(_0x49e45f){const _0x1ca3f5=a140_0x8bd0;return _0x49e45f[_0x1ca3f5(0x1d1)]??Buffer[_0x1ca3f5(0x1ea)](_0x49e45f['content']??'',_0x1ca3f5(0x1e0));}export function fileText(_0x5ba5df){const _0x11399c=a140_0x8bd0;return fileContent(_0x5ba5df)[_0x11399c(0x1dc)](_0x11399c(0x1e0));}export function normalizeLocalFiles(_0x4d1205){const _0x41e5a8=a140_0x8bd0;if(!Array[_0x41e5a8(0x1db)](_0x4d1205)||_0x4d1205['length']===0x0)return[];const _0x582241=new Map();for(const _0x5022c2 of _0x4d1205){if(!_0x5022c2||typeof _0x5022c2!==_0x41e5a8(0x1c1)||typeof _0x5022c2[_0x41e5a8(0x1df)]!==_0x41e5a8(0x1da))throw CliErrors['validation'](_0x41e5a8(0x1c5));const _0x1f6c62=normalizeSkillRelativePath(_0x5022c2['path']);if(_0x582241['has'](_0x1f6c62))throw CliErrors['validation']('Duplicate\x20Skill\x20file\x20path:\x20'+_0x1f6c62);if(_0x5022c2[_0x41e5a8(0x1d1)]!==undefined&&!Buffer['isBuffer'](_0x5022c2['bytes']))throw CliErrors['validation'](_0x41e5a8(0x1d5)+_0x1f6c62);if(_0x5022c2[_0x41e5a8(0x1d1)]===undefined&&typeof _0x5022c2['content']!==_0x41e5a8(0x1da))throw CliErrors['validation'](_0x41e5a8(0x1d0)+_0x1f6c62);const _0x785399=fileContent(_0x5022c2);_0x582241[_0x41e5a8(0x1ca)](_0x1f6c62,{'path':_0x1f6c62,'bytes':_0x785399});}return Array[_0x41e5a8(0x1ea)](_0x582241[_0x41e5a8(0x1c0)]())['sort'](compareSkillFiles);}export function normalizeManifestFiles(_0x185a39){const _0x32bbdc=a140_0x8bd0;if(!Array[_0x32bbdc(0x1db)](_0x185a39)||_0x185a39[_0x32bbdc(0x1de)]===0x0)return[];const _0x116c52=new Map();for(const _0x1afd77 of _0x185a39){if(!_0x1afd77||typeof _0x1afd77!==_0x32bbdc(0x1c1)||typeof _0x1afd77[_0x32bbdc(0x1df)]!==_0x32bbdc(0x1da))throw CliErrors[_0x32bbdc(0x1c4)](_0x32bbdc(0x1c5));const _0x14cfc8=normalizeSkillRelativePath(_0x1afd77[_0x32bbdc(0x1df)]);if(_0x116c52[_0x32bbdc(0x1ce)](_0x14cfc8))throw CliErrors[_0x32bbdc(0x1c4)](_0x32bbdc(0x1e6)+_0x14cfc8);if(!isSha256Hex(_0x1afd77[_0x32bbdc(0x1e5)]))throw CliErrors[_0x32bbdc(0x1c4)](_0x32bbdc(0x1d9)+_0x14cfc8);if(!Number[_0x32bbdc(0x1ec)](_0x1afd77['size'])||_0x1afd77['size']<0x0)throw CliErrors[_0x32bbdc(0x1c4)](_0x32bbdc(0x1c6)+_0x14cfc8);_0x116c52[_0x32bbdc(0x1ca)](_0x14cfc8,{'path':_0x14cfc8,'sha256':_0x1afd77[_0x32bbdc(0x1e5)]['toLowerCase'](),'size':_0x1afd77[_0x32bbdc(0x1c9)]});}return Array[_0x32bbdc(0x1ea)](_0x116c52[_0x32bbdc(0x1c0)]())['sort'](compareSkillFiles);}export function scanSkillDirectory(_0x372a0f,_0x26db3f={}){const _0x492144=a140_0x8bd0,_0x4261ba=realpathSync(_0x372a0f),_0x39db59=canonicalExcludedFilePaths(_0x26db3f[_0x492144(0x1e9)]),_0x12daf9=[];function _0x2bc786(_0x4233de){const _0x135804=_0x492144,_0x21162e=readdirSync(_0x4233de,{'withFileTypes':!![]})[_0x135804(0x1c7)]((_0x578461,_0x190da3)=>_0x578461[_0x135804(0x1e8)]['localeCompare'](_0x190da3['name']));for(const _0x2c7c25 of _0x21162e){if(_0x2c7c25['isDirectory']()&&IGNORED_DIR_NAMES[_0x135804(0x1ce)](_0x2c7c25[_0x135804(0x1e8)]))continue;if(IGNORED_FILE_NAMES[_0x135804(0x1ce)](_0x2c7c25['name']))continue;const _0x3695eb=resolve(_0x4233de,_0x2c7c25['name']);if(isExcludedFilePath(_0x3695eb,_0x39db59))continue;if(_0x2c7c25['isSymbolicLink']())throw CliErrors[_0x135804(0x1c4)](_0x135804(0x1d6)+_0x3695eb);const _0x5a6b95=toPosixPath(relative(_0x4261ba,_0x3695eb));if(_0x2c7c25[_0x135804(0x1dd)]()){_0x2bc786(_0x3695eb);continue;}if(!_0x2c7c25[_0x135804(0x1d2)]())continue;validateSkillRelativePath(_0x5a6b95);const _0x3d59e5=readFileSync(_0x3695eb);_0x12daf9[_0x135804(0x1d7)]({'path':_0x5a6b95,'bytes':_0x3d59e5});}}return _0x2bc786(_0x4261ba),normalizeLocalFiles(_0x12daf9);}function a140_0x547e(){const _0x4672ec=['test','validation','Skill\x20file\x20path\x20must\x20be\x20text.','Skill\x20file\x20size\x20is\x20invalid:\x20','sort','compare','size','set','replace','split','595378bgNWBq','has','add','Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20','bytes','isFile','includes','296994VADdgq','Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20','Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20','push','561926GnymkH','Skill\x20file\x20sha256\x20is\x20invalid:\x20','string','isArray','toString','isDirectory','length','path','utf8','Unsafe\x20Skill\x20file\x20path:\x20','startsWith','trim','1FZRJtq','sha256','Duplicate\x20Skill\x20file\x20path:\x20','4872235oCTdNs','name','excludedFilePaths','from','1445613VXUYYF','isSafeInteger','6486360SDDevt','values','object','3251104bXTdtz'];a140_0x547e=function(){return _0x4672ec;};return a140_0x547e();}function canonicalExcludedFilePaths(_0x37fcad){const _0x4ad1eb=a140_0x8bd0,_0x1d611e=new Set();for(const _0x46d939 of _0x37fcad??[]){const _0x454212=resolve(_0x46d939);_0x1d611e[_0x4ad1eb(0x1cf)](_0x454212);try{_0x1d611e[_0x4ad1eb(0x1cf)](realpathSync(_0x454212));}catch{}}return _0x1d611e;}function isExcludedFilePath(_0xa9dd0b,_0x410655){const _0x3100f1=a140_0x8bd0;if(_0x410655['has'](_0xa9dd0b))return!![];if(_0x410655[_0x3100f1(0x1c9)]===0x0)return![];try{return _0x410655[_0x3100f1(0x1ce)](realpathSync(_0xa9dd0b));}catch{return![];}}export function compareSkillFiles(_0x62f558,_0x5dac2f){const _0x1dc808=a140_0x8bd0;if(_0x62f558[_0x1dc808(0x1df)]===SKILL_FILE)return _0x5dac2f[_0x1dc808(0x1df)]===SKILL_FILE?0x0:-0x1;if(_0x5dac2f['path']===SKILL_FILE)return 0x1;return Buffer[_0x1dc808(0x1c8)](Buffer[_0x1dc808(0x1ea)](_0x62f558[_0x1dc808(0x1df)],_0x1dc808(0x1e0)),Buffer['from'](_0x5dac2f[_0x1dc808(0x1df)],_0x1dc808(0x1e0)));}export function normalizeSkillRelativePath(_0x5e2648){const _0x25512a=a140_0x8bd0,_0x4d3b14=toPosixPath(_0x5e2648[_0x25512a(0x1e3)]());return validateSkillRelativePath(_0x4d3b14),_0x4d3b14;}function a140_0x8bd0(_0x587ec6,_0x173ab0){_0x587ec6=_0x587ec6-0x1c0;const _0x547e9a=a140_0x547e();let _0x8bd0bc=_0x547e9a[_0x587ec6];return _0x8bd0bc;}export function validateSkillRelativePath(_0x1558a6){const _0x205da5=a140_0x8bd0;if(!_0x1558a6||_0x1558a6[_0x205da5(0x1e2)]('/')||_0x1558a6[_0x205da5(0x1d3)]('//'))throw CliErrors[_0x205da5(0x1c4)](_0x205da5(0x1e1)+_0x1558a6);for(const _0x13b428 of _0x1558a6[_0x205da5(0x1cc)]('/')){if(!_0x13b428||_0x13b428==='.'||_0x13b428==='..')throw CliErrors[_0x205da5(0x1c4)](_0x205da5(0x1e1)+_0x1558a6);}}export function toPosixPath(_0x87b045){const _0x21752a=a140_0x8bd0;return _0x87b045[_0x21752a(0x1cb)](/\\/g,'/');}export function isSha256Hex(_0x598425){const _0xae5056=a140_0x8bd0;return typeof _0x598425===_0xae5056(0x1da)&&/^[a-fA-F0-9]{64}$/[_0xae5056(0x1c3)](_0x598425);}
@@ -1 +1 @@
1
- (function(_0x35bc33,_0x54d69c){const _0x1707d4=a141_0x2c1b,_0x58aa26=_0x35bc33();while(!![]){try{const _0x94a828=-parseInt(_0x1707d4(0x147))/0x1+parseInt(_0x1707d4(0x124))/0x2+parseInt(_0x1707d4(0x136))/0x3*(parseInt(_0x1707d4(0x114))/0x4)+-parseInt(_0x1707d4(0x130))/0x5+parseInt(_0x1707d4(0x122))/0x6*(parseInt(_0x1707d4(0x113))/0x7)+-parseInt(_0x1707d4(0x125))/0x8+-parseInt(_0x1707d4(0x135))/0x9*(-parseInt(_0x1707d4(0x11d))/0xa);if(_0x94a828===_0x54d69c)break;else _0x58aa26['push'](_0x58aa26['shift']());}catch(_0x3f47fd){_0x58aa26['push'](_0x58aa26['shift']());}}}(a141_0x23b1,0x3b6b3));import{existsSync,lstatSync,mkdirSync,readFileSync,rmSync}from'node:fs';import{dirname,resolve}from'node:path';import{isCollection,isMap,isNode,parseDocument,visit}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';function a141_0x23b1(){const _0x3d9c92=['Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20','displayName','10KPHhuB','Runtime\x20Skill\x20package\x20is\x20missing\x20','displayName:\x20','has','contents','162984FdrsSq','toString','922178PToKUB','2799088BYnrHo','isFile','force','packageBytes','name:\x20','Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20','---\x0a','---','accessKey','Managed\x20file\x20was\x20removed\x20locally:\x20','replace','1534850ERMRRm','version','entries','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','stringify','2899035AgvZbH','6261fxxBpm','test','description:\x20','env','validation','length','.\x20Changed\x20file:\x20','errors','trim','example','description','contentHash','scope','keys','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.','find','delete','52148pvjgFj','path','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','pulledAt','appCode','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','match','paths','\x0a---\x0a\x0a','name','utf8','28glXOnZ','116tchIUw','map','flow','skillName','status','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','fileHashes'];a141_0x23b1=function(){return _0x3d9c92;};return a141_0x23b1();}import{resolveManagedFilePath,writeBytesAtomic,writeJsonAtomic}from'./fs-utils.js';import{bufferSha256,contentHash,fileHash}from'./hashing.js';import{fileContent,fileText,normalizeLocalFiles}from'./local-files.js';function a141_0x2c1b(_0x1ac275,_0x193c16){_0x1ac275=_0x1ac275-0x10c;const _0x23b19c=a141_0x23b1();let _0x2c1ba2=_0x23b19c[_0x1ac275];return _0x2c1ba2;}import{buildMetadata,readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillDir}from'./paths.js';import{extractDownloadedPackage,requirePackageBytes}from'./zip-package.js';export function materializeRuntimeSkill(_0x5125a4,_0x2c0144,_0x30a13d){const _0x4415c4=a141_0x2c1b,_0x5bc14f=requireSkillCode(_0x5125a4),_0x43128b=requirePackageBytes(_0x5bc14f,_0x30a13d[_0x4415c4(0x128)]),_0x43a014=extractDownloadedPackage(_0x43128b),_0x304bf5=_0x43a014[_0x4415c4(0x145)](_0x4ff8b2=>_0x4ff8b2[_0x4415c4(0x148)]===SKILL_FILE);if(!_0x304bf5)throw CliErrors[_0x4415c4(0x13a)](_0x4415c4(0x11e)+SKILL_FILE+':\x20'+_0x5bc14f);const _0x18c4ae=withMaterializedSkillFrontmatter(_0x43a014,_0x5125a4,_0x5bc14f),_0x5bff73=_0x18c4ae[_0x4415c4(0x145)](_0x1b37a1=>_0x1b37a1['path']===SKILL_FILE),_0x28bb0f=fileText(_0x5bff73),_0x107c0b=getRuntimeSkillDir(_0x30a13d[_0x4415c4(0x139)],_0x30a13d[_0x4415c4(0x12d)],_0x30a13d[_0x4415c4(0x10c)],_0x2c0144,_0x5bc14f,_0x30a13d[_0x4415c4(0x10f)]),_0x4548de=resolve(_0x107c0b,SKILL_FILE),_0x3977bc=resolve(_0x107c0b,METADATA_FILE),_0x56e6c9=contentHash(_0x28bb0f),_0x5e34be=readMetadataIfPresent(_0x3977bc)?.[_0x4415c4(0x11a)];ensurePulledFilesCanBeOverwritten(_0x107c0b,_0x3977bc,_0x18c4ae,_0x30a13d[_0x4415c4(0x127)]===!![]),mkdirSync(_0x107c0b,{'recursive':!![],'mode':0x1c0});const _0x12f00b=existsSync(_0x4548de)?readFileSync(_0x4548de,_0x4415c4(0x112)):undefined;return materializeFiles(_0x107c0b,_0x18c4ae),removeStaleManagedFiles(_0x107c0b,_0x5e34be,_0x18c4ae),writeJsonAtomic(_0x3977bc,buildMetadata(_0x5125a4,_0x2c0144,_0x30a13d['appCode'],_0x56e6c9,_0x30a13d[_0x4415c4(0x14a)],_0x18c4ae,_0x43128b)),{'skill':_0x5125a4,'scope':_0x2c0144,'dir':_0x107c0b,'skillMdPath':_0x4548de,'metadataPath':_0x3977bc,'contentHash':_0x56e6c9,'changed':_0x12f00b!==_0x28bb0f};}export function reuseMaterializedRuntimeSkill(_0x4eb881,_0x508e82,_0x5475f7){const _0x53f10a=a141_0x2c1b,_0x28da0e=_0x4eb881['version']?.[_0x53f10a(0x13e)]();if(!_0x28da0e)return undefined;const _0xe63793=requireSkillCode(_0x4eb881),_0x242379=getRuntimeSkillDir(_0x5475f7[_0x53f10a(0x139)],_0x5475f7[_0x53f10a(0x12d)],_0x5475f7[_0x53f10a(0x10c)],_0x508e82,_0xe63793,_0x5475f7['paths']),_0x1eb9c9=resolve(_0x242379,SKILL_FILE),_0x46b06c=resolve(_0x242379,METADATA_FILE),_0x5f04aa=readMetadataIfPresent(_0x46b06c);if(!_0x5f04aa||_0x5f04aa['schemaVersion']!==0x2||_0x5f04aa[_0x53f10a(0x10c)]!==_0x5475f7['appCode']||_0x5f04aa[_0x53f10a(0x142)]!==_0x508e82||_0x5f04aa['skillCode']!==_0xe63793||_0x5f04aa[_0x53f10a(0x131)]!==_0x28da0e||_0x5f04aa['id']!==_0x4eb881['id']||_0x5f04aa['skillName']!==_0x4eb881[_0x53f10a(0x117)]||_0x5f04aa[_0x53f10a(0x140)]!==_0x4eb881[_0x53f10a(0x140)]||_0x5f04aa[_0x53f10a(0x13f)]!==_0x4eb881['example']||_0x5f04aa[_0x53f10a(0x118)]!==_0x4eb881['status']||!_0x5f04aa[_0x53f10a(0x141)]||!_0x5f04aa[_0x53f10a(0x11a)]||!Object['hasOwn'](_0x5f04aa[_0x53f10a(0x11a)],SKILL_FILE))return undefined;for(const [_0xd51f15,_0x6c3994]of Object[_0x53f10a(0x132)](_0x5f04aa[_0x53f10a(0x11a)])){if(!/^[a-f0-9]{64}$/[_0x53f10a(0x137)](_0x6c3994))return undefined;const _0x3fda4d=resolveManagedFilePath(_0x242379,_0xd51f15);if(!existsSync(_0x3fda4d)||!lstatSync(_0x3fda4d)['isFile']())return undefined;if(bufferSha256(readFileSync(_0x3fda4d))!==_0x6c3994)return undefined;}return{'skill':_0x4eb881,'scope':_0x508e82,'dir':_0x242379,'skillMdPath':_0x1eb9c9,'metadataPath':_0x46b06c,'contentHash':_0x5f04aa[_0x53f10a(0x141)],'changed':![]};}function withMaterializedSkillFrontmatter(_0x182f35,_0x4f6534,_0xc0c57){const _0x3f5688=a141_0x2c1b,_0x57b792=skillDisplayName(_0x4f6534,_0xc0c57),_0x2b67cd=_0x4f6534[_0x3f5688(0x140)]?.[_0x3f5688(0x13e)]()||_0x57b792||_0xc0c57;return normalizeLocalFiles(_0x182f35)[_0x3f5688(0x115)](_0x379383=>{const _0x2d033f=_0x3f5688,_0x1e5a2c=fileText(_0x379383);if(_0x379383['path']!==SKILL_FILE)return _0x379383;if(hasYamlFrontmatter(_0x1e5a2c))return{'path':_0x379383[_0x2d033f(0x148)],'content':withSyncedDisplayName(_0x1e5a2c,_0x57b792)};return{'path':_0x379383['path'],'content':prependSkillFrontmatter(_0x1e5a2c,{'name':_0xc0c57,'displayName':_0x57b792,'description':_0x2b67cd})};});}function hasYamlFrontmatter(_0x54e5a1){const _0x5a71f9=a141_0x2c1b;return/^\uFEFF?---\s*\r?\n/[_0x5a71f9(0x137)](_0x54e5a1);}function prependSkillFrontmatter(_0xf0b81f,_0x480c7e){const _0xf4e8ef=a141_0x2c1b,_0x24bfba=_0xf0b81f[_0xf4e8ef(0x12f)](/^\uFEFF/,'');return[_0xf4e8ef(0x12c),_0xf4e8ef(0x129)+yamlString(_0x480c7e[_0xf4e8ef(0x111)]),_0x480c7e['displayName']?_0xf4e8ef(0x11f)+yamlString(_0x480c7e['displayName']):undefined,_0xf4e8ef(0x138)+yamlString(_0x480c7e[_0xf4e8ef(0x140)]),_0xf4e8ef(0x12c),'',_0x24bfba]['filter'](_0x4f7a6b=>_0x4f7a6b!==undefined)['join']('\x0a');}function yamlString(_0x1cd487){const _0x48316e=a141_0x2c1b;return JSON[_0x48316e(0x134)](_0x1cd487['replace'](/\r/g,'')[_0x48316e(0x13e)]());}function skillDisplayName(_0x9c46cc,_0xbcdc2b){const _0x4f9094=a141_0x2c1b,_0x127b6c=_0x9c46cc['skillName']?.[_0x4f9094(0x13e)]();return _0x127b6c||_0xbcdc2b;}function withSyncedDisplayName(_0x373528,_0x3afc2f){const _0x3efa20=a141_0x2c1b,_0x2644d9=_0x373528[_0x3efa20(0x10e)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x2644d9)return _0x373528;const _0x2e1266=_0x2644d9[0x1]??'',_0x1f9977=_0x2644d9[0x2]??'',_0x3d626a=parseDocument(_0x1f9977);if(_0x3d626a[_0x3efa20(0x13d)][_0x3efa20(0x13b)]>0x0||!isMap(_0x3d626a[_0x3efa20(0x121)]))return _0x373528;if(_0x3afc2f)_0x3d626a['set'](_0x3efa20(0x11c),_0x3afc2f);else{if(_0x3d626a[_0x3efa20(0x120)](_0x3efa20(0x11c)))_0x3d626a[_0x3efa20(0x146)](_0x3efa20(0x11c));else return _0x373528;}forceBlockCollections(_0x3d626a['contents']);const _0x2fc56a=_0x3d626a[_0x3efa20(0x123)]({'lineWidth':0x0})['trimEnd'](),_0x1d73f7=_0x373528['slice'](_0x2644d9[0x0]['length'])[_0x3efa20(0x12f)](/^\r?\n/,'');return _0x2e1266+_0x3efa20(0x12b)+_0x2fc56a+_0x3efa20(0x110)+_0x1d73f7;}function forceBlockCollections(_0x544e84){if(!isNode(_0x544e84))return;visit(_0x544e84,(_0x2e9cf8,_0x4c5cdd)=>{const _0x54d298=a141_0x2c1b;isCollection(_0x4c5cdd)&&(_0x4c5cdd[_0x54d298(0x116)]=![]);});}function ensurePulledFilesCanBeOverwritten(_0x472d27,_0x38d9ea,_0x19761b,_0x2c1a3b){const _0x5ef6e7=a141_0x2c1b;if(_0x2c1a3b||!existsSync(_0x38d9ea))return;const _0x24e51e=readMetadataIfPresent(_0x38d9ea);if(!_0x24e51e)return;const _0x18b7aa=_0x24e51e[_0x5ef6e7(0x11a)]&&Object[_0x5ef6e7(0x143)](_0x24e51e[_0x5ef6e7(0x11a)])[_0x5ef6e7(0x13b)]>0x0?_0x24e51e[_0x5ef6e7(0x11a)]:undefined;if(_0x18b7aa)for(const [_0x543163,_0x561085]of Object[_0x5ef6e7(0x132)](_0x18b7aa)){const _0x44f3c5=resolveManagedFilePath(_0x472d27,_0x543163);if(!existsSync(_0x44f3c5))throw CliErrors[_0x5ef6e7(0x13a)](_0x5ef6e7(0x149)+_0x472d27,_0x5ef6e7(0x12e)+_0x543163);const _0x10035d=lstatSync(_0x44f3c5);if(!_0x10035d['isFile']())throw CliErrors[_0x5ef6e7(0x13a)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x472d27,_0x5ef6e7(0x12a)+_0x543163);const _0x591e63=bufferSha256(readFileSync(_0x44f3c5));if(_0x591e63!==_0x561085)throw CliErrors['validation'](_0x5ef6e7(0x149)+_0x472d27+_0x5ef6e7(0x13c)+_0x543163,_0x5ef6e7(0x119)+_0x543163);}else{const _0x399959=resolve(_0x472d27,SKILL_FILE);if(existsSync(_0x399959)&&_0x24e51e[_0x5ef6e7(0x141)]){const _0x53daaa=contentHash(readFileSync(_0x399959,'utf8'));if(_0x53daaa!==_0x24e51e[_0x5ef6e7(0x141)])throw CliErrors[_0x5ef6e7(0x13a)](_0x5ef6e7(0x133)+_0x399959,_0x5ef6e7(0x144));}}for(const _0x543125 of normalizeLocalFiles(_0x19761b)){if(_0x18b7aa?.[_0x543125[_0x5ef6e7(0x148)]])continue;if(!_0x18b7aa&&_0x543125[_0x5ef6e7(0x148)]===SKILL_FILE)continue;const _0x59205b=resolveManagedFilePath(_0x472d27,_0x543125['path']);if(!existsSync(_0x59205b))continue;const _0x374060=lstatSync(_0x59205b);if(!_0x374060[_0x5ef6e7(0x126)]())throw CliErrors[_0x5ef6e7(0x13a)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x472d27,_0x5ef6e7(0x10d)+_0x543125[_0x5ef6e7(0x148)]);const _0x3c7cbf=bufferSha256(readFileSync(_0x59205b));if(_0x3c7cbf!==fileHash(_0x543125))throw CliErrors['validation'](_0x5ef6e7(0x149)+_0x472d27,_0x5ef6e7(0x11b)+_0x543125[_0x5ef6e7(0x148)]);}}function materializeFiles(_0x584390,_0xe09beb){for(const _0x5637e9 of normalizeLocalFiles(_0xe09beb)){const _0x2adc64=resolveManagedFilePath(_0x584390,_0x5637e9['path']);mkdirSync(dirname(_0x2adc64),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x2adc64,fileContent(_0x5637e9),0x180);}}function removeStaleManagedFiles(_0x2abe97,_0x2ace9a,_0x198aba){const _0x2f22de=a141_0x2c1b;if(!_0x2ace9a)return;const _0x510128=new Set(normalizeLocalFiles(_0x198aba)[_0x2f22de(0x115)](_0x296c29=>_0x296c29[_0x2f22de(0x148)]));for(const _0x43b5b9 of Object[_0x2f22de(0x143)](_0x2ace9a)){if(_0x510128[_0x2f22de(0x120)](_0x43b5b9))continue;const _0xd18401=resolveManagedFilePath(_0x2abe97,_0x43b5b9);existsSync(_0xd18401)&&lstatSync(_0xd18401)['isFile']()&&rmSync(_0xd18401,{'force':!![]});}}
1
+ (function(_0x4c6d87,_0x52bb5a){const _0x5ca07d=a141_0x48c7,_0x4e8212=_0x4c6d87();while(!![]){try{const _0x3f2c57=parseInt(_0x5ca07d(0x1f5))/0x1+parseInt(_0x5ca07d(0x1dd))/0x2+-parseInt(_0x5ca07d(0x1fd))/0x3*(parseInt(_0x5ca07d(0x1ec))/0x4)+-parseInt(_0x5ca07d(0x1e8))/0x5*(parseInt(_0x5ca07d(0x1e3))/0x6)+-parseInt(_0x5ca07d(0x1ea))/0x7+parseInt(_0x5ca07d(0x1e9))/0x8*(parseInt(_0x5ca07d(0x20b))/0x9)+-parseInt(_0x5ca07d(0x201))/0xa*(-parseInt(_0x5ca07d(0x1d3))/0xb);if(_0x3f2c57===_0x52bb5a)break;else _0x4e8212['push'](_0x4e8212['shift']());}catch(_0x1d7ddf){_0x4e8212['push'](_0x4e8212['shift']());}}}(a141_0x4c02,0xb88d5));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';import{extractDownloadedPackage,requirePackageBytes}from'./zip-package.js';function a141_0x4c02(){const _0x183965=['packageBytes','contents','\x0a---\x0a\x0a','example','stringify','585MstOrv','242piksfu','slice','path','paths','fileHashes','displayName','name:\x20','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','.\x20Changed\x20file:\x20','Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20','2972954cjnBKY','pulledAt','entries','keys','displayName:\x20','toString','4374XCayId','delete','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','scope','7315ScNsky','130600zjpnHV','4239942wXoZvm','description','14468YXVPmp','set','test','find','validation','---','appCode','has','accessKey','620863nRnbWY','env','match','length','name','isFile','schemaVersion','utf8','699mwACYm','skillName','map','trim','46570prbpGJ','contentHash','version','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','replace'];a141_0x4c02=function(){return _0x183965;};return a141_0x4c02();}export function materializeRuntimeSkill(_0x538793,_0x57b591,_0x593db9){const _0xd93695=a141_0x48c7,_0x5bbf7d=requireSkillCode(_0x538793),_0x28c2cf=requirePackageBytes(_0x5bbf7d,_0x593db9[_0xd93695(0x206)]),_0x526c40=extractDownloadedPackage(_0x28c2cf),_0x157f5e=_0x526c40[_0xd93695(0x1ef)](_0x2323a1=>_0x2323a1['path']===SKILL_FILE);if(!_0x157f5e)throw CliErrors[_0xd93695(0x1f0)]('Runtime\x20Skill\x20package\x20is\x20missing\x20'+SKILL_FILE+':\x20'+_0x5bbf7d);const _0x55bec6=withMaterializedSkillFrontmatter(_0x526c40,_0x538793,_0x5bbf7d),_0x5744f7=_0x55bec6['find'](_0x33f00c=>_0x33f00c[_0xd93695(0x1d5)]===SKILL_FILE),_0x279f7b=fileText(_0x5744f7),_0x14e70e=getRuntimeSkillDir(_0x593db9[_0xd93695(0x1f6)],_0x593db9[_0xd93695(0x1f4)],_0x593db9[_0xd93695(0x1f2)],_0x57b591,_0x5bbf7d,_0x593db9['paths']),_0x11e729=resolve(_0x14e70e,SKILL_FILE),_0x4de224=resolve(_0x14e70e,METADATA_FILE),_0xb5989b=contentHash(_0x279f7b),_0x52d645=readMetadataIfPresent(_0x4de224)?.[_0xd93695(0x1d7)];ensurePulledFilesCanBeOverwritten(_0x14e70e,_0x4de224,_0x55bec6,_0x593db9['force']===!![]),mkdirSync(_0x14e70e,{'recursive':!![],'mode':0x1c0});const _0x49700f=existsSync(_0x11e729)?readFileSync(_0x11e729,_0xd93695(0x1fc)):undefined;return materializeFiles(_0x14e70e,_0x55bec6),removeStaleManagedFiles(_0x14e70e,_0x52d645,_0x55bec6),writeJsonAtomic(_0x4de224,buildMetadata(_0x538793,_0x57b591,_0x593db9[_0xd93695(0x1f2)],_0xb5989b,_0x593db9[_0xd93695(0x1de)],_0x55bec6,_0x28c2cf)),{'skill':_0x538793,'scope':_0x57b591,'dir':_0x14e70e,'skillMdPath':_0x11e729,'metadataPath':_0x4de224,'contentHash':_0xb5989b,'changed':_0x49700f!==_0x279f7b};}export function reuseMaterializedRuntimeSkill(_0x130946,_0x53de5f,_0x551dba){const _0x39a489=a141_0x48c7,_0x410652=_0x130946[_0x39a489(0x203)]?.[_0x39a489(0x200)]();if(!_0x410652)return undefined;const _0x83ae3e=requireSkillCode(_0x130946),_0x4b4443=getRuntimeSkillDir(_0x551dba['env'],_0x551dba[_0x39a489(0x1f4)],_0x551dba[_0x39a489(0x1f2)],_0x53de5f,_0x83ae3e,_0x551dba[_0x39a489(0x1d6)]),_0x2e18f7=resolve(_0x4b4443,SKILL_FILE),_0x1f8800=resolve(_0x4b4443,METADATA_FILE),_0x80344f=readMetadataIfPresent(_0x1f8800);if(!_0x80344f||_0x80344f[_0x39a489(0x1fb)]!==0x2||_0x80344f[_0x39a489(0x1f2)]!==_0x551dba[_0x39a489(0x1f2)]||_0x80344f[_0x39a489(0x1e7)]!==_0x53de5f||_0x80344f['skillCode']!==_0x83ae3e||_0x80344f[_0x39a489(0x203)]!==_0x410652||_0x80344f['id']!==_0x130946['id']||_0x80344f[_0x39a489(0x1fe)]!==_0x130946[_0x39a489(0x1fe)]||_0x80344f[_0x39a489(0x1eb)]!==_0x130946[_0x39a489(0x1eb)]||_0x80344f[_0x39a489(0x209)]!==_0x130946[_0x39a489(0x209)]||_0x80344f['status']!==_0x130946['status']||!_0x80344f['contentHash']||!_0x80344f[_0x39a489(0x1d7)]||!Object['hasOwn'](_0x80344f[_0x39a489(0x1d7)],SKILL_FILE))return undefined;for(const [_0x4482ac,_0x5ac75f]of Object[_0x39a489(0x1df)](_0x80344f['fileHashes'])){if(!/^[a-f0-9]{64}$/['test'](_0x5ac75f))return undefined;const _0x2141ae=resolveManagedFilePath(_0x4b4443,_0x4482ac);if(!existsSync(_0x2141ae)||!lstatSync(_0x2141ae)[_0x39a489(0x1fa)]())return undefined;if(bufferSha256(readFileSync(_0x2141ae))!==_0x5ac75f)return undefined;}return{'skill':_0x130946,'scope':_0x53de5f,'dir':_0x4b4443,'skillMdPath':_0x2e18f7,'metadataPath':_0x1f8800,'contentHash':_0x80344f[_0x39a489(0x202)],'changed':![]};}function withMaterializedSkillFrontmatter(_0x3d577f,_0x3d6dce,_0x569090){const _0x16beae=skillDisplayName(_0x3d6dce,_0x569090),_0x5178d1=_0x3d6dce['description']?.['trim']()||_0x16beae||_0x569090;return normalizeLocalFiles(_0x3d577f)['map'](_0x87c7ba=>{const _0x350f39=a141_0x48c7,_0x4960e7=fileText(_0x87c7ba);if(_0x87c7ba[_0x350f39(0x1d5)]!==SKILL_FILE)return _0x87c7ba;if(hasYamlFrontmatter(_0x4960e7))return{'path':_0x87c7ba[_0x350f39(0x1d5)],'content':withSyncedDisplayName(_0x4960e7,_0x16beae)};return{'path':_0x87c7ba[_0x350f39(0x1d5)],'content':prependSkillFrontmatter(_0x4960e7,{'name':_0x569090,'displayName':_0x16beae,'description':_0x5178d1})};});}function hasYamlFrontmatter(_0x3a89e4){const _0x269ea7=a141_0x48c7;return/^\uFEFF?---\s*\r?\n/[_0x269ea7(0x1ee)](_0x3a89e4);}function prependSkillFrontmatter(_0x17e50b,_0x59bcd9){const _0x36b7d4=a141_0x48c7,_0x12ee56=_0x17e50b['replace'](/^\uFEFF/,'');return[_0x36b7d4(0x1f1),_0x36b7d4(0x1d9)+yamlString(_0x59bcd9[_0x36b7d4(0x1f9)]),_0x59bcd9[_0x36b7d4(0x1d8)]?_0x36b7d4(0x1e1)+yamlString(_0x59bcd9[_0x36b7d4(0x1d8)]):undefined,'description:\x20'+yamlString(_0x59bcd9[_0x36b7d4(0x1eb)]),_0x36b7d4(0x1f1),'',_0x12ee56]['filter'](_0x167c66=>_0x167c66!==undefined)['join']('\x0a');}function yamlString(_0xe8f610){const _0x5bc439=a141_0x48c7;return JSON[_0x5bc439(0x20a)](_0xe8f610[_0x5bc439(0x205)](/\r/g,'')[_0x5bc439(0x200)]());}function skillDisplayName(_0x2195dd,_0x1f5413){const _0x1aa6f8=a141_0x48c7,_0x4e5492=_0x2195dd['skillName']?.[_0x1aa6f8(0x200)]();return _0x4e5492||_0x1f5413;}function withSyncedDisplayName(_0x18adbb,_0x280298){const _0x1b0055=a141_0x48c7,_0x18c10c=_0x18adbb[_0x1b0055(0x1f7)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x18c10c)return _0x18adbb;const _0x490956=_0x18c10c[0x1]??'',_0x497cfc=_0x18c10c[0x2]??'',_0x2b5241=parseDocument(_0x497cfc);if(_0x2b5241['errors'][_0x1b0055(0x1f8)]>0x0||!isMap(_0x2b5241[_0x1b0055(0x207)]))return _0x18adbb;if(_0x280298)_0x2b5241[_0x1b0055(0x1ed)](_0x1b0055(0x1d8),_0x280298);else{if(_0x2b5241[_0x1b0055(0x1f3)](_0x1b0055(0x1d8)))_0x2b5241[_0x1b0055(0x1e4)](_0x1b0055(0x1d8));else return _0x18adbb;}forceBlockCollections(_0x2b5241[_0x1b0055(0x207)]);const _0x212941=_0x2b5241[_0x1b0055(0x1e2)]({'lineWidth':0x0})['trimEnd'](),_0x3dc3de=_0x18adbb[_0x1b0055(0x1d4)](_0x18c10c[0x0][_0x1b0055(0x1f8)])[_0x1b0055(0x205)](/^\r?\n/,'');return _0x490956+'---\x0a'+_0x212941+_0x1b0055(0x208)+_0x3dc3de;}function forceBlockCollections(_0x1c1474){if(!isNode(_0x1c1474))return;visit(_0x1c1474,(_0x53d3ee,_0x411d1f)=>{isCollection(_0x411d1f)&&(_0x411d1f['flow']=![]);});}function ensurePulledFilesCanBeOverwritten(_0x5f377b,_0x3b5006,_0x18a22d,_0x25eb3d){const _0x5be2c3=a141_0x48c7;if(_0x25eb3d||!existsSync(_0x3b5006))return;const _0x583d6d=readMetadataIfPresent(_0x3b5006);if(!_0x583d6d)return;const _0x15131e=_0x583d6d[_0x5be2c3(0x1d7)]&&Object[_0x5be2c3(0x1e0)](_0x583d6d[_0x5be2c3(0x1d7)])[_0x5be2c3(0x1f8)]>0x0?_0x583d6d[_0x5be2c3(0x1d7)]:undefined;if(_0x15131e)for(const [_0x324f2c,_0x48abc2]of Object['entries'](_0x15131e)){const _0x3ac77b=resolveManagedFilePath(_0x5f377b,_0x324f2c);if(!existsSync(_0x3ac77b))throw CliErrors[_0x5be2c3(0x1f0)](_0x5be2c3(0x1da)+_0x5f377b,'Managed\x20file\x20was\x20removed\x20locally:\x20'+_0x324f2c);const _0x22c696=lstatSync(_0x3ac77b);if(!_0x22c696[_0x5be2c3(0x1fa)]())throw CliErrors[_0x5be2c3(0x1f0)](_0x5be2c3(0x1da)+_0x5f377b,'Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20'+_0x324f2c);const _0x5df6cf=bufferSha256(readFileSync(_0x3ac77b));if(_0x5df6cf!==_0x48abc2)throw CliErrors[_0x5be2c3(0x1f0)](_0x5be2c3(0x1da)+_0x5f377b+_0x5be2c3(0x1db)+_0x324f2c,_0x5be2c3(0x204)+_0x324f2c);}else{const _0x51276f=resolve(_0x5f377b,SKILL_FILE);if(existsSync(_0x51276f)&&_0x583d6d[_0x5be2c3(0x202)]){const _0x19650f=contentHash(readFileSync(_0x51276f,_0x5be2c3(0x1fc)));if(_0x19650f!==_0x583d6d[_0x5be2c3(0x202)])throw CliErrors[_0x5be2c3(0x1f0)](_0x5be2c3(0x1e6)+_0x51276f,'Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.');}}for(const _0x28bdec of normalizeLocalFiles(_0x18a22d)){if(_0x15131e?.[_0x28bdec[_0x5be2c3(0x1d5)]])continue;if(!_0x15131e&&_0x28bdec['path']===SKILL_FILE)continue;const _0x22ca9a=resolveManagedFilePath(_0x5f377b,_0x28bdec['path']);if(!existsSync(_0x22ca9a))continue;const _0x150d78=lstatSync(_0x22ca9a);if(!_0x150d78[_0x5be2c3(0x1fa)]())throw CliErrors['validation']('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x5f377b,_0x5be2c3(0x1e5)+_0x28bdec['path']);const _0x4f14e1=bufferSha256(readFileSync(_0x22ca9a));if(_0x4f14e1!==fileHash(_0x28bdec))throw CliErrors['validation']('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x5f377b,_0x5be2c3(0x1dc)+_0x28bdec[_0x5be2c3(0x1d5)]);}}function materializeFiles(_0x5ce2f1,_0x3e446b){for(const _0x23540d of normalizeLocalFiles(_0x3e446b)){const _0x507164=resolveManagedFilePath(_0x5ce2f1,_0x23540d['path']);mkdirSync(dirname(_0x507164),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x507164,fileContent(_0x23540d),0x180);}}function a141_0x48c7(_0x2db9b0,_0x376350){_0x2db9b0=_0x2db9b0-0x1d3;const _0x4c024c=a141_0x4c02();let _0x48c7cc=_0x4c024c[_0x2db9b0];return _0x48c7cc;}function removeStaleManagedFiles(_0x586899,_0x482100,_0x1302ac){const _0x2f3b50=a141_0x48c7;if(!_0x482100)return;const _0x5300fa=new Set(normalizeLocalFiles(_0x1302ac)[_0x2f3b50(0x1ff)](_0x59e5ee=>_0x59e5ee[_0x2f3b50(0x1d5)]));for(const _0x319127 of Object[_0x2f3b50(0x1e0)](_0x482100)){if(_0x5300fa[_0x2f3b50(0x1f3)](_0x319127))continue;const _0x181bc9=resolveManagedFilePath(_0x586899,_0x319127);existsSync(_0x181bc9)&&lstatSync(_0x181bc9)[_0x2f3b50(0x1fa)]()&&rmSync(_0x181bc9,{'force':!![]});}}
@@ -1 +1 @@
1
- function a142_0x8f66(_0x51202f,_0x4982e8){_0x51202f=_0x51202f-0x184;const _0xc4f873=a142_0xc4f8();let _0x8f66ed=_0xc4f873[_0x51202f];return _0x8f66ed;}(function(_0x558717,_0x386a7f){const _0x1b64fb=a142_0x8f66,_0x4acf7d=_0x558717();while(!![]){try{const _0xb60644=parseInt(_0x1b64fb(0x187))/0x1*(-parseInt(_0x1b64fb(0x1a2))/0x2)+-parseInt(_0x1b64fb(0x1a8))/0x3+parseInt(_0x1b64fb(0x193))/0x4*(-parseInt(_0x1b64fb(0x196))/0x5)+-parseInt(_0x1b64fb(0x189))/0x6+-parseInt(_0x1b64fb(0x198))/0x7+-parseInt(_0x1b64fb(0x18f))/0x8+parseInt(_0x1b64fb(0x19d))/0x9;if(_0xb60644===_0x386a7f)break;else _0x4acf7d['push'](_0x4acf7d['shift']());}catch(_0x572a4f){_0x4acf7d['push'](_0x4acf7d['shift']());}}}(a142_0xc4f8,0x50837));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(_0x220c5b,_0x31f3ce,_0x3b0e96,_0x583ce5,_0x407d9a,_0x24e1be,_0x4e1dee){const _0x41f44=a142_0x8f66,_0x40f4d1=_0x24e1be?normalizeLocalFiles(_0x24e1be):[],_0x4cb735=!_0x4e1dee&&_0x40f4d1['length']>0x0?buildSkillPackage(_0x40f4d1):undefined,_0xbf2735=_0x4e1dee?bufferSha256(_0x4e1dee):_0x4cb735?.[_0x41f44(0x1a4)][_0x41f44(0x184)],_0x14a9e7=_0x4e1dee?.[_0x41f44(0x195)]??_0x4cb735?.[_0x41f44(0x1a4)]['zipSize'],_0x258726=_0x40f4d1[_0x41f44(0x195)]>0x0?Object[_0x41f44(0x1a1)](_0x40f4d1[_0x41f44(0x19f)](_0x1d312e=>[_0x1d312e['path'],fileHash(_0x1d312e)])):undefined;return{'schemaVersion':_0x40f4d1['length']>0x0?0x2:0x1,'id':_0x220c5b['id'],'appCode':_0x3b0e96,'skillCode':requireSkillCode(_0x220c5b),'skillName':_0x220c5b[_0x41f44(0x1a0)],'description':_0x220c5b[_0x41f44(0x1a9)],'example':_0x220c5b[_0x41f44(0x197)],'scope':_0x31f3ce,'readonly':_0x31f3ce!==_0x41f44(0x18d)||_0x220c5b['readonly']===!![],'tenantCode':_0x220c5b[_0x41f44(0x191)],'userId':_0x220c5b['userId'],'version':_0x220c5b[_0x41f44(0x18a)],'status':_0x220c5b['status'],'tags':Array[_0x41f44(0x192)](_0x220c5b[_0x41f44(0x18c)])?_0x220c5b[_0x41f44(0x18c)]:[],'hasUpstreamUpdate':_0x220c5b[_0x41f44(0x18e)],'forkedFromSkillId':_0x220c5b[_0x41f44(0x18b)],'forkedFromVersion':_0x220c5b[_0x41f44(0x1aa)],'sourceSessionId':_0x220c5b[_0x41f44(0x1a7)],'contentHash':_0x583ce5,'fileHashes':_0x258726,'treeHash':_0x40f4d1[_0x41f44(0x195)]>0x0?fileTreeHash(localFilesToManifestFiles(_0x40f4d1)):undefined,'ossPath':remoteManifestOssPath(_0x220c5b[_0x41f44(0x185)]),'zipSha256':_0xbf2735,'zipSize':_0x14a9e7,'files':_0x40f4d1[_0x41f44(0x195)]>0x0?_0x40f4d1['map'](_0x3a5de7=>({'path':_0x3a5de7[_0x41f44(0x19c)],'hash':fileHash(_0x3a5de7),'size':fileContent(_0x3a5de7)['length']})):undefined,'pulledAt':_0x407d9a??new Date()[_0x41f44(0x194)]()};}export function requireSkillCode(_0x55ebe9){const _0x3220d3=a142_0x8f66,_0x47e3bd=_0x55ebe9[_0x3220d3(0x186)]?.[_0x3220d3(0x188)]();if(!_0x47e3bd)throw CliErrors[_0x3220d3(0x1a3)](_0x3220d3(0x1a5));return _0x47e3bd;}export function readMetadataIfPresent(_0x587a0c){const _0xa6de93=a142_0x8f66;if(!existsSync(_0x587a0c))return undefined;try{const _0x31b10f=JSON[_0xa6de93(0x19b)](readFileSync(_0x587a0c,_0xa6de93(0x190)));return _0x31b10f;}catch{throw CliErrors[_0xa6de93(0x1a3)](_0xa6de93(0x1a6)+METADATA_FILE+':\x20'+_0x587a0c);}}function remoteManifestOssPath(_0x4985cf){const _0x57608a=a142_0x8f66;if(!_0x4985cf||typeof _0x4985cf!==_0x57608a(0x19a)||Array[_0x57608a(0x192)](_0x4985cf))return undefined;const _0x43d4b3=_0x4985cf[_0x57608a(0x19e)];return typeof _0x43d4b3===_0x57608a(0x199)&&_0x43d4b3[_0x57608a(0x188)]()?_0x43d4b3[_0x57608a(0x188)]():undefined;}function a142_0xc4f8(){const _0xa03914=['tenantCode','isArray','8116MXNnDV','toISOString','length','1105Pqzpcf','example','4316347Usrkgr','string','object','parse','path','22763547XknRlP','ossPath','map','skillName','fromEntries','2oVWkAR','validation','manifest','Runtime\x20Skill\x20is\x20missing\x20skillCode.','Invalid\x20','sourceSessionId','1039917lmELUU','description','forkedFromVersion','zipSha256','files','skillCode','25601cEcxvl','trim','2993022PbogzL','version','forkedFromSkillId','tags','personal','hasUpstreamUpdate','2107144idpXjf','utf8'];a142_0xc4f8=function(){return _0xa03914;};return a142_0xc4f8();}
1
+ (function(_0x59b027,_0x3d2d67){const _0x20b07e=a142_0x5829,_0x2c639d=_0x59b027();while(!![]){try{const _0x229a17=parseInt(_0x20b07e(0x156))/0x1+parseInt(_0x20b07e(0x145))/0x2*(parseInt(_0x20b07e(0x15f))/0x3)+parseInt(_0x20b07e(0x141))/0x4*(-parseInt(_0x20b07e(0x15c))/0x5)+parseInt(_0x20b07e(0x154))/0x6+-parseInt(_0x20b07e(0x144))/0x7*(-parseInt(_0x20b07e(0x148))/0x8)+parseInt(_0x20b07e(0x164))/0x9+-parseInt(_0x20b07e(0x165))/0xa;if(_0x229a17===_0x3d2d67)break;else _0x2c639d['push'](_0x2c639d['shift']());}catch(_0x13d4a7){_0x2c639d['push'](_0x2c639d['shift']());}}}(a142_0x3948,0x8cda4));import{existsSync,readFileSync}from'node:fs';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';function a142_0x5829(_0x25c6ca,_0x119c4c){_0x25c6ca=_0x25c6ca-0x140;const _0x394829=a142_0x3948();let _0x58294e=_0x394829[_0x25c6ca];return _0x58294e;}import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';function a142_0x3948(){const _0x2d215e=['description','389747VuvrEy','isArray','personal','string','utf8','parse','97585MRbTrT','fromEntries','tenantCode','1158oWJfwD','skillCode','example','userId','zipSize','2872512zBtTIA','19565840wmBKXf','path','40jKyriX','sourceSessionId','forkedFromVersion','7287ThoGwC','5638XQSwEE','Invalid\x20','ossPath','4968FlkCuX','length','forkedFromSkillId','map','version','status','trim','toISOString','manifest','validation','Runtime\x20Skill\x20is\x20missing\x20skillCode.','readonly','1711056WVwPmy'];a142_0x3948=function(){return _0x2d215e;};return a142_0x3948();}import{fileContent,normalizeLocalFiles}from'./local-files.js';import{buildSkillPackage,localFilesToManifestFiles}from'./zip-package.js';export function buildMetadata(_0x11e999,_0x4cd9fe,_0x4ff493,_0x6663ee,_0x151279,_0x8a15ec,_0xe5c6b1){const _0x4c9a20=a142_0x5829,_0x2aa5c4=_0x8a15ec?normalizeLocalFiles(_0x8a15ec):[],_0x2fd780=!_0xe5c6b1&&_0x2aa5c4[_0x4c9a20(0x149)]>0x0?buildSkillPackage(_0x2aa5c4):undefined,_0x149520=_0xe5c6b1?bufferSha256(_0xe5c6b1):_0x2fd780?.[_0x4c9a20(0x150)]['zipSha256'],_0x2f8671=_0xe5c6b1?.['length']??_0x2fd780?.[_0x4c9a20(0x150)][_0x4c9a20(0x163)],_0x2ced30=_0x2aa5c4['length']>0x0?Object[_0x4c9a20(0x15d)](_0x2aa5c4['map'](_0x31aa47=>[_0x31aa47[_0x4c9a20(0x140)],fileHash(_0x31aa47)])):undefined;return{'schemaVersion':_0x2aa5c4['length']>0x0?0x2:0x1,'id':_0x11e999['id'],'appCode':_0x4ff493,'skillCode':requireSkillCode(_0x11e999),'skillName':_0x11e999['skillName'],'description':_0x11e999[_0x4c9a20(0x155)],'example':_0x11e999[_0x4c9a20(0x161)],'scope':_0x4cd9fe,'readonly':_0x4cd9fe!==_0x4c9a20(0x158)||_0x11e999[_0x4c9a20(0x153)]===!![],'tenantCode':_0x11e999[_0x4c9a20(0x15e)],'userId':_0x11e999[_0x4c9a20(0x162)],'version':_0x11e999[_0x4c9a20(0x14c)],'status':_0x11e999[_0x4c9a20(0x14d)],'tags':Array['isArray'](_0x11e999['tags'])?_0x11e999['tags']:[],'hasUpstreamUpdate':_0x11e999['hasUpstreamUpdate'],'forkedFromSkillId':_0x11e999[_0x4c9a20(0x14a)],'forkedFromVersion':_0x11e999[_0x4c9a20(0x143)],'sourceSessionId':_0x11e999[_0x4c9a20(0x142)],'contentHash':_0x6663ee,'fileHashes':_0x2ced30,'treeHash':_0x2aa5c4[_0x4c9a20(0x149)]>0x0?fileTreeHash(localFilesToManifestFiles(_0x2aa5c4)):undefined,'ossPath':remoteManifestOssPath(_0x11e999['files']),'zipSha256':_0x149520,'zipSize':_0x2f8671,'files':_0x2aa5c4[_0x4c9a20(0x149)]>0x0?_0x2aa5c4[_0x4c9a20(0x14b)](_0x5ff54c=>({'path':_0x5ff54c[_0x4c9a20(0x140)],'hash':fileHash(_0x5ff54c),'size':fileContent(_0x5ff54c)[_0x4c9a20(0x149)]})):undefined,'pulledAt':_0x151279??new Date()[_0x4c9a20(0x14f)]()};}export function requireSkillCode(_0x194d97){const _0x535ab3=a142_0x5829,_0x104547=_0x194d97[_0x535ab3(0x160)]?.[_0x535ab3(0x14e)]();if(!_0x104547)throw CliErrors[_0x535ab3(0x151)](_0x535ab3(0x152));return _0x104547;}export function readMetadataIfPresent(_0x5f0664){const _0x5e0328=a142_0x5829;if(!existsSync(_0x5f0664))return undefined;try{const _0x18a5de=JSON[_0x5e0328(0x15b)](readFileSync(_0x5f0664,_0x5e0328(0x15a)));return _0x18a5de;}catch{throw CliErrors[_0x5e0328(0x151)](_0x5e0328(0x146)+METADATA_FILE+':\x20'+_0x5f0664);}}function remoteManifestOssPath(_0x3e9421){const _0x2e970a=a142_0x5829;if(!_0x3e9421||typeof _0x3e9421!=='object'||Array[_0x2e970a(0x157)](_0x3e9421))return undefined;const _0x5ac383=_0x3e9421[_0x2e970a(0x147)];return typeof _0x5ac383===_0x2e970a(0x159)&&_0x5ac383[_0x2e970a(0x14e)]()?_0x5ac383[_0x2e970a(0x14e)]():undefined;}
@@ -1 +1 @@
1
- const a143_0x379824=a143_0x32f8;(function(_0x12d51e,_0x4b10a8){const _0x3ff80b=a143_0x32f8,_0x103e44=_0x12d51e();while(!![]){try{const _0x23cc76=parseInt(_0x3ff80b(0x1dd))/0x1*(-parseInt(_0x3ff80b(0x1ec))/0x2)+parseInt(_0x3ff80b(0x1e4))/0x3+parseInt(_0x3ff80b(0x1f3))/0x4*(parseInt(_0x3ff80b(0x1ef))/0x5)+-parseInt(_0x3ff80b(0x1e8))/0x6+parseInt(_0x3ff80b(0x1de))/0x7+-parseInt(_0x3ff80b(0x1f4))/0x8*(parseInt(_0x3ff80b(0x1e3))/0x9)+-parseInt(_0x3ff80b(0x1f5))/0xa;if(_0x23cc76===_0x4b10a8)break;else _0x103e44['push'](_0x103e44['shift']());}catch(_0x55f6fc){_0x103e44['push'](_0x103e44['shift']());}}}(a143_0x4103,0x7dbb8));import{existsSync}from'node:fs';import{homedir}from'node:os';import{resolve}from'node:path';function a143_0x32f8(_0x584951,_0xa1638c){_0x584951=_0x584951-0x1dd;const _0x41032a=a143_0x4103();let _0x32f80b=_0x41032a[_0x584951];return _0x32f80b;}import{fingerprintAccessKey}from'../../commands/app/cache.js';function a143_0x4103(){const _0x55d57d=['SKILL_ROOT','2358fBdBay','2310987DLgYzb','validation','skillCode','\x20for\x20local\x20path:\x20','1960920NdCgkp','.claude','path\x20segment','cacheRoot','4GjkEFT','cache','Unsafe\x20','3257995JDyjvk','includes','claudeSkillsDir','workbuddySkillsDir','4pSjexA','8072gPRAQs','10675980cuQLel','homeDir','124421gkuCiJ','7004830sKKkKQ','homeDirName','appCode','skills'];a143_0x4103=function(){return _0x55d57d;};return a143_0x4103();}import{PRODUCT_CONFIG,productEnv}from'../../constant/product.js';import{CliErrors}from'../../errors.js';export function resolveSkillSyncPaths(_0x2f308d={}){const _0x126eeb=a143_0x32f8,_0x905f0f=_0x2f308d[_0x126eeb(0x1f6)]??homedir(),_0x380db0=resolve(_0x905f0f,PRODUCT_CONFIG[_0x126eeb(0x1df)],_0x126eeb(0x1ed)),_0x45cbff=trimmedEnv(_0x126eeb(0x1e2)),_0x38a478=trimmedEnv('CLAUDE_SKILL_ROOT'),_0x1a2ee6=resolve(_0x905f0f,'.workbuddy'),_0x16f69e=_0x2f308d[_0x126eeb(0x1f2)]??(existsSync(_0x1a2ee6)?resolve(_0x1a2ee6,'skills'):undefined);return{'homeDir':_0x905f0f,'cacheRoot':_0x380db0,'managedRoot':resolve(_0x905f0f,PRODUCT_CONFIG[_0x126eeb(0x1df)]),'agentsSkillsDir':_0x2f308d['agentsSkillsDir']??_0x45cbff??resolve(_0x905f0f,'.agents',_0x126eeb(0x1e1)),'claudeSkillsDir':_0x2f308d[_0x126eeb(0x1f1)]??_0x38a478??resolve(_0x905f0f,_0x126eeb(0x1e9),_0x126eeb(0x1e1)),'workbuddySkillsDir':_0x16f69e};}export function runtimeAgentSkillRoots(_0xc29955){const _0x5d6919=a143_0x32f8;return[_0xc29955['agentsSkillsDir'],_0xc29955[_0x5d6919(0x1f1)],_0xc29955['workbuddySkillsDir']]['filter'](_0x17f665=>Boolean(_0x17f665));}export function getRuntimeSkillCacheRoot(_0x2dee62,_0x121b7b,_0x4b7acf={}){const _0x20ede9=a143_0x32f8,_0xecdb28=resolveSkillSyncPaths(_0x4b7acf);return resolve(_0xecdb28[_0x20ede9(0x1eb)],_0x2dee62,fingerprintAccessKey(_0x121b7b),_0x20ede9(0x1e1));}export function getRuntimeSkillDir(_0x5f248d,_0x495e5c,_0x273a4b,_0x3983bb,_0x3f4899,_0x5acd6b={}){const _0x28e8d1=a143_0x32f8;return resolve(getRuntimeSkillCacheRoot(_0x5f248d,_0x495e5c,_0x5acd6b),safePathSegment(_0x273a4b,_0x28e8d1(0x1e0)),_0x3983bb,safePathSegment(_0x3f4899,_0x28e8d1(0x1e6)));}export function safePathSegment(_0x4160df,_0x53d6b3=a143_0x379824(0x1ea)){const _0x3f3883=a143_0x379824;if(!_0x4160df||_0x4160df[_0x3f3883(0x1f0)]('/')||_0x4160df[_0x3f3883(0x1f0)]('\x5c')||_0x4160df[_0x3f3883(0x1f0)]('..'))throw CliErrors[_0x3f3883(0x1e5)](_0x3f3883(0x1ee)+_0x53d6b3+_0x3f3883(0x1e7)+_0x4160df);return _0x4160df;}function trimmedEnv(_0x121fac){const _0x3aa02a=productEnv(_0x121fac)?.['trim']();return _0x3aa02a?_0x3aa02a:undefined;}
1
+ function a143_0xd4c2(_0x459597,_0x31545f){_0x459597=_0x459597-0x69;const _0x35ad9b=a143_0x35ad();let _0xd4c29b=_0x35ad9b[_0x459597];return _0xd4c29b;}(function(_0x305eb8,_0x598642){const _0x45f331=a143_0xd4c2,_0x177d9e=_0x305eb8();while(!![]){try{const _0x57151e=-parseInt(_0x45f331(0x6c))/0x1+-parseInt(_0x45f331(0x75))/0x2*(parseInt(_0x45f331(0x6b))/0x3)+parseInt(_0x45f331(0x6a))/0x4*(parseInt(_0x45f331(0x70))/0x5)+-parseInt(_0x45f331(0x7d))/0x6+-parseInt(_0x45f331(0x7a))/0x7+-parseInt(_0x45f331(0x81))/0x8*(parseInt(_0x45f331(0x72))/0x9)+parseInt(_0x45f331(0x79))/0xa;if(_0x57151e===_0x598642)break;else _0x177d9e['push'](_0x177d9e['shift']());}catch(_0x4fef27){_0x177d9e['push'](_0x177d9e['shift']());}}}(a143_0x35ad,0xa1a05));import{existsSync}from'node:fs';import{homedir}from'node:os';function a143_0x35ad(){const _0x238841=['4689153rvHuME','includes','.agents','4857528knvWKt','cache','skillCode','claudeSkillsDir','8vUTBIM','.workbuddy','workbuddySkillsDir','homeDirName','SKILL_ROOT','validation','100DJNBWc','3AyLKOj','196506sPOPQf','trim','cacheRoot','homeDir','230515BTDIGx','filter','8716977gzBwJe','skills','.claude','1435438QEDjVl','CLAUDE_SKILL_ROOT','Unsafe\x20','agentsSkillsDir','28716910Jjjdzc'];a143_0x35ad=function(){return _0x238841;};return a143_0x35ad();}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(_0x4c3b7c={}){const _0x51eb2f=a143_0xd4c2,_0x3deac4=_0x4c3b7c[_0x51eb2f(0x6f)]??homedir(),_0x54db29=resolve(_0x3deac4,PRODUCT_CONFIG[_0x51eb2f(0x84)],_0x51eb2f(0x7e)),_0x4cd508=trimmedEnv(_0x51eb2f(0x85)),_0x10eedf=trimmedEnv(_0x51eb2f(0x76)),_0x3f4aed=resolve(_0x3deac4,_0x51eb2f(0x82)),_0x11d565=_0x4c3b7c[_0x51eb2f(0x83)]??(existsSync(_0x3f4aed)?resolve(_0x3f4aed,_0x51eb2f(0x73)):undefined);return{'homeDir':_0x3deac4,'cacheRoot':_0x54db29,'managedRoot':resolve(_0x3deac4,PRODUCT_CONFIG['homeDirName']),'agentsSkillsDir':_0x4c3b7c[_0x51eb2f(0x78)]??_0x4cd508??resolve(_0x3deac4,_0x51eb2f(0x7c),'skills'),'claudeSkillsDir':_0x4c3b7c[_0x51eb2f(0x80)]??_0x10eedf??resolve(_0x3deac4,_0x51eb2f(0x74),'skills'),'workbuddySkillsDir':_0x11d565};}export function runtimeAgentSkillRoots(_0x2365ad){const _0x2cfaff=a143_0xd4c2;return[_0x2365ad[_0x2cfaff(0x78)],_0x2365ad[_0x2cfaff(0x80)],_0x2365ad[_0x2cfaff(0x83)]][_0x2cfaff(0x71)](_0x42ba5c=>Boolean(_0x42ba5c));}export function getRuntimeSkillCacheRoot(_0x46eebf,_0x12e31f,_0x704d1d={}){const _0x1e13f1=a143_0xd4c2,_0xe59670=resolveSkillSyncPaths(_0x704d1d);return resolve(_0xe59670[_0x1e13f1(0x6e)],_0x46eebf,fingerprintAccessKey(_0x12e31f),'skills');}export function getRuntimeSkillDir(_0x10e486,_0x227e5d,_0x191a7b,_0x2bbbea,_0x15ae54,_0x3328fc={}){const _0x55a98b=a143_0xd4c2;return resolve(getRuntimeSkillCacheRoot(_0x10e486,_0x227e5d,_0x3328fc),safePathSegment(_0x191a7b,'appCode'),_0x2bbbea,safePathSegment(_0x15ae54,_0x55a98b(0x7f)));}export function safePathSegment(_0x51c3e9,_0x18719b='path\x20segment'){const _0x59fbaa=a143_0xd4c2;if(!_0x51c3e9||_0x51c3e9[_0x59fbaa(0x7b)]('/')||_0x51c3e9[_0x59fbaa(0x7b)]('\x5c')||_0x51c3e9[_0x59fbaa(0x7b)]('..'))throw CliErrors[_0x59fbaa(0x69)](_0x59fbaa(0x77)+_0x18719b+'\x20for\x20local\x20path:\x20'+_0x51c3e9);return _0x51c3e9;}function trimmedEnv(_0x22e596){const _0x16f338=a143_0xd4c2,_0x25333c=productEnv(_0x22e596)?.[_0x16f338(0x6d)]();return _0x25333c?_0x25333c:undefined;}
@@ -1 +1 @@
1
- (function(_0xf6fd02,_0x7d6c3d){const _0x265b7c=a144_0x4845,_0x41ebe0=_0xf6fd02();while(!![]){try{const _0x64d3a2=-parseInt(_0x265b7c(0x188))/0x1+-parseInt(_0x265b7c(0x199))/0x2*(-parseInt(_0x265b7c(0x1a9))/0x3)+parseInt(_0x265b7c(0x17d))/0x4+-parseInt(_0x265b7c(0x181))/0x5*(-parseInt(_0x265b7c(0x19b))/0x6)+parseInt(_0x265b7c(0x185))/0x7+parseInt(_0x265b7c(0x1a0))/0x8*(parseInt(_0x265b7c(0x178))/0x9)+-parseInt(_0x265b7c(0x195))/0xa;if(_0x64d3a2===_0x7d6c3d)break;else _0x41ebe0['push'](_0x41ebe0['shift']());}catch(_0xf3e3e3){_0x41ebe0['push'](_0x41ebe0['shift']());}}}(a144_0x3525,0x9debb));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a144_0x534908}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{writeJsonAtomic}from'./fs-utils.js';import{contentHash}from'./hashing.js';import{fileText,normalizeLocalFiles,scanSkillDirectory}from'./local-files.js';import{buildMetadata,readMetadataIfPresent}from'./metadata.js';import{buildSkillPackage,tryNormalizePackageManifest}from'./zip-package.js';export function resolvePushDirectoryIdentity(_0x22b975,_0x3b92e2,_0x2655a0={}){const _0x37fd24=a144_0x4845,_0x5312e9=resolvePushDirectoryRoot(_0x22b975),_0x1423b1=readPushMetadataIfPresent(resolve(_0x5312e9,METADATA_FILE),{'ignoreInvalidMetadata':_0x2655a0[_0x37fd24(0x19c)]});if(_0x1423b1?.[_0x37fd24(0x19d)]&&_0x1423b1[_0x37fd24(0x19d)]!==_0x3b92e2&&!_0x2655a0['allowAppCodeRetarget']&&!_0x2655a0[_0x37fd24(0x1a4)])throw CliErrors[_0x37fd24(0x191)](_0x37fd24(0x17c)+_0x1423b1[_0x37fd24(0x19d)]+_0x37fd24(0x1b7)+_0x3b92e2+'\x22.');const _0x2d0866=resolvePushSkillCode(_0x5312e9,_0x3b92e2,_0x1423b1,_0x2655a0);if(!_0x2d0866)throw CliErrors['validation'](_0x37fd24(0x18e)+SKILL_FILE+',\x20'+METADATA_FILE+_0x37fd24(0x1a7));return{'dir':_0x5312e9,'skillCode':_0x2d0866,'metadata':_0x1423b1};}export function readPushDirectory(_0x39fe90,_0x11e077,_0x22f880={}){const _0x1b0bfd=a144_0x4845,_0x163bf6=resolvePushDirectoryIdentity(_0x39fe90,_0x11e077,_0x22f880),_0x7d774f=_0x163bf6[_0x1b0bfd(0x1a1)],_0x1c182f=resolve(_0x7d774f,SKILL_FILE);if(!existsSync(_0x1c182f)||!lstatSync(_0x1c182f)[_0x1b0bfd(0x194)]())throw CliErrors[_0x1b0bfd(0x191)](_0x1b0bfd(0x1b8)+SKILL_FILE+':\x20'+_0x1c182f);const _0xda2663=_0x163bf6[_0x1b0bfd(0x1aa)],_0x1b6cfb=_0x22f880[_0x1b0bfd(0x19a)]??_0x1b0bfd(0x1b3);if(!_0x22f880['ignoreMetadataScope']&&_0xda2663?.[_0x1b0bfd(0x1ac)]===_0x1b0bfd(0x1af))throw CliErrors['validation']('Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20'+METADATA_FILE+_0x1b0bfd(0x17f)+_0xda2663[_0x1b0bfd(0x1ac)]+'\x22.');if(!_0x22f880['ignoreMetadataScope']&&_0x1b6cfb===_0x1b0bfd(0x1b3)&&_0xda2663?.[_0x1b0bfd(0x1ac)]&&_0xda2663[_0x1b0bfd(0x1ac)]!==_0x1b0bfd(0x1b3))throw CliErrors['validation']('Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20'+METADATA_FILE+_0x1b0bfd(0x17f)+_0xda2663[_0x1b0bfd(0x1ac)]+'\x22.',_0x1b0bfd(0x18f)+_0x7d774f+'\x20to\x20submit\x20company\x20Skills\x20for\x20review.');const _0x1f4d94=scanSkillDirectory(_0x7d774f,{'excludedFilePaths':_0x22f880[_0x1b0bfd(0x19e)]}),_0x2f94b8=buildSkillPackage(_0x1f4d94),_0x3bed6e=readFileSync(_0x1c182f,_0x1b0bfd(0x192)),_0x4e6d7e=_0x163bf6[_0x1b0bfd(0x189)],_0x3bbb66=_0x22f880[_0x1b0bfd(0x1ab)]?undefined:_0xda2663,_0x3fb1bd=readSkillDisplayName(_0x3bed6e);return{'skillCode':_0x4e6d7e,'metadata':_0xda2663,'frontmatterDisplayName':_0x3fb1bd,'input':{'skillCode':_0x4e6d7e,'skillName':_0x3fb1bd??_0x3bbb66?.[_0x1b0bfd(0x17a)],'description':_0x3bbb66?.[_0x1b0bfd(0x177)],'content':_0x3bed6e,'files':_0x2f94b8[_0x1b0bfd(0x184)],'packageBase64':_0x2f94b8[_0x1b0bfd(0x18a)],'tags':_0x3bbb66?.[_0x1b0bfd(0x1a8)],'version':_0x3bbb66?.[_0x1b0bfd(0x183)],'sourceSessionId':_0x3bbb66?.[_0x1b0bfd(0x179)]}};}export function refreshPushDirectoryMetadataFromRemote(_0x42c548,_0x26569d,_0x4e1ec0,_0x294b8b={}){const _0x5911d9=a144_0x4845,_0x5cd48c=resolvePushDirectoryRoot(_0x42c548),_0x407fa4=readPushMetadataIfPresent(resolve(_0x5cd48c,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x541969=requireRemoteScope(_0x26569d),_0x2f5570=readLocalSkillContent(_0x5cd48c),_0x5357b8={..._0x26569d,'appCode':_0x26569d[_0x5911d9(0x19d)]??_0x4e1ec0,'skillName':_0x26569d[_0x5911d9(0x17a)]??_0x407fa4?.['skillName'],'description':_0x26569d[_0x5911d9(0x177)]??_0x407fa4?.[_0x5911d9(0x177)],'example':_0x26569d['example']??_0x407fa4?.['example'],'tags':Array[_0x5911d9(0x180)](_0x26569d[_0x5911d9(0x1a8)])?_0x26569d[_0x5911d9(0x1a8)]:_0x407fa4?.[_0x5911d9(0x1a8)],'sourceSessionId':_0x26569d[_0x5911d9(0x179)]??_0x407fa4?.['sourceSessionId'],'content':_0x26569d[_0x5911d9(0x1a2)]??_0x2f5570},_0x418649=buildMetadata(_0x5357b8,_0x541969,_0x4e1ec0,contentHash(_0x2f5570),_0x294b8b[_0x5911d9(0x182)]);writeJsonAtomic(resolve(_0x5cd48c,METADATA_FILE),_0x418649);}export function recordPushedRuntimeSkill(_0x12c009,_0x2de73e,_0x5be39d,_0x111d13={}){const _0x9cf9c=a144_0x4845,_0x549c6e=resolvePushDirectoryRoot(_0x12c009),_0x1e1bc4=scanSkillDirectory(_0x549c6e),_0x1fecb6=_0x1e1bc4['find'](_0x2cd2d7=>_0x2cd2d7[_0x9cf9c(0x17b)]===SKILL_FILE),_0x4b389a=_0x1fecb6?fileText(_0x1fecb6):'',_0x438259=tryNormalizePackageManifest(_0x2de73e[_0x9cf9c(0x1a3)]),_0x71ec98={..._0x2de73e,'content':_0x2de73e[_0x9cf9c(0x1a2)]??_0x4b389a,'files':_0x438259},_0x5349e4=_0x438259?normalizeLocalFiles(_0x1e1bc4)[_0x9cf9c(0x1b0)](_0x22fa91=>_0x438259[_0x9cf9c(0x1a3)]['some'](_0x53ee66=>_0x53ee66['path']===_0x22fa91[_0x9cf9c(0x17b)])):undefined,_0x2aef11=buildMetadata(_0x71ec98,_0x111d13[_0x9cf9c(0x1ac)]??_0x9cf9c(0x1b3),_0x5be39d,contentHash(_0x71ec98[_0x9cf9c(0x1a2)]??''),_0x111d13['pushedAt'],_0x5349e4);writeJsonAtomic(resolve(_0x549c6e,METADATA_FILE),_0x2aef11);}export function deriveSkillCodeFromDirectory(_0x4bcc80,_0x1b2691){const _0x4f072b=a144_0x4845,_0xd29458=basename(resolve(_0x4bcc80)),_0x2cbe43=_0x1b2691+'--';return _0xd29458[_0x4f072b(0x18b)](_0x2cbe43)?_0xd29458[_0x4f072b(0x1b1)](_0x2cbe43[_0x4f072b(0x1b4)]):_0xd29458;}function resolvePushSkillCode(_0x297dcf,_0x205c20,_0x34e0da,_0x28da5b){const _0x5bd36a=a144_0x4845,_0x5ed5a7=deriveSkillCodeFromSkillFile(_0x297dcf)||deriveSkillCodeFromDirectory(_0x297dcf,_0x205c20);if(_0x28da5b['ignoreMetadataSkillCode'])return _0x5ed5a7;return _0x34e0da?.[_0x5bd36a(0x189)]?.['trim']()||_0x5ed5a7;}function deriveSkillCodeFromSkillFile(_0x49992){const _0x2433de=a144_0x4845,_0x21a32c=resolve(_0x49992,SKILL_FILE);if(!existsSync(_0x21a32c)||!lstatSync(_0x21a32c)['isFile']())return undefined;const _0x39ef71=readFileSync(_0x21a32c,_0x2433de(0x192)),_0x40c4cf=_0x39ef71['match'](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x40c4cf)return undefined;const _0xdf8a90=parseFrontmatterObject(_0x40c4cf[0x1]??''),_0x358bdb=scalarToString(_0xdf8a90?.[_0x2433de(0x1b2)]);return _0x358bdb?slugifySkillName(_0x358bdb):undefined;}function readSkillDisplayName(_0x5c2045){const _0x562dc0=a144_0x4845,_0x503c86=_0x5c2045[_0x562dc0(0x1b6)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x503c86)return undefined;const _0x2751eb=parseFrontmatterObject(_0x503c86[0x1]??'');return scalarToString(_0x2751eb?.[_0x562dc0(0x18c)]);}function slugifySkillName(_0x129419){const _0x2e3126=a144_0x4845,_0x419689=_0x129419[_0x2e3126(0x1b5)]()[_0x2e3126(0x186)]()[_0x2e3126(0x17e)](/[^\p{L}\p{N}\p{So}]+/gu,'-')['replace'](/^-+/,'')[_0x2e3126(0x17e)](/-+$/,'')[_0x2e3126(0x17e)](/-{2,}/g,'-');if(!_0x419689)throw CliErrors['validation'](_0x2e3126(0x196)+SKILL_FILE+'\x20name\x20for\x20SkillHub\x20slug\x20generation.');return _0x419689;}function parseFrontmatterObject(_0x386a05){const _0x1d9b70=a144_0x4845;try{const _0x3c12b8=a144_0x534908(_0x386a05);return _0x3c12b8&&typeof _0x3c12b8===_0x1d9b70(0x193)&&!Array[_0x1d9b70(0x180)](_0x3c12b8)?_0x3c12b8:undefined;}catch{return undefined;}}function a144_0x4845(_0x34696a,_0x563d73){_0x34696a=_0x34696a-0x177;const _0x35255d=a144_0x3525();let _0x48456a=_0x35255d[_0x34696a];return _0x48456a;}function scalarToString(_0x58c713){const _0x14aa86=a144_0x4845;if(typeof _0x58c713===_0x14aa86(0x187))return _0x58c713[_0x14aa86(0x1b5)]();if(typeof _0x58c713==='number'||typeof _0x58c713===_0x14aa86(0x1a5))return String(_0x58c713);return undefined;}function resolvePushDirectoryRoot(_0x31870){const _0x312cf3=a144_0x4845,_0x5b47c4=resolve(_0x31870);if(!existsSync(_0x5b47c4))throw CliErrors[_0x312cf3(0x191)](_0x312cf3(0x197)+_0x31870);const _0x39fd4a=lstatSync(_0x5b47c4);if(_0x39fd4a['isDirectory']())return _0x5b47c4;if(_0x39fd4a[_0x312cf3(0x1ae)]()){const _0x286086=realpathSync(_0x5b47c4);if(lstatSync(_0x286086)[_0x312cf3(0x1ad)]())return _0x286086;}throw CliErrors[_0x312cf3(0x191)]('Skill\x20directory\x20not\x20found:\x20'+_0x31870);}function requireRemoteScope(_0x1f7779){const _0x240ffa=a144_0x4845;if(_0x1f7779[_0x240ffa(0x1ac)]===_0x240ffa(0x1b3)||_0x1f7779[_0x240ffa(0x1ac)]===_0x240ffa(0x190)||_0x1f7779[_0x240ffa(0x1ac)]===_0x240ffa(0x1af))return _0x1f7779[_0x240ffa(0x1ac)];throw CliErrors[_0x240ffa(0x191)](_0x240ffa(0x1a6)+(_0x1f7779[_0x240ffa(0x189)]||_0x240ffa(0x198))+_0x240ffa(0x19f)+(_0x1f7779[_0x240ffa(0x1ac)]??_0x240ffa(0x18d))+'\x22.');}function readLocalSkillContent(_0x588ec3){const _0xacedb4=resolve(_0x588ec3,SKILL_FILE);return existsSync(_0xacedb4)&&lstatSync(_0xacedb4)['isFile']()?readFileSync(_0xacedb4,'utf8'):'';}function readPushMetadataIfPresent(_0x1ecbcb,_0x2dbf13={}){const _0x3abd=a144_0x4845;try{return readMetadataIfPresent(_0x1ecbcb);}catch(_0x2c9a0e){if(_0x2dbf13[_0x3abd(0x19c)])return undefined;throw _0x2c9a0e;}}function a144_0x3525(){const _0x516278=['97704GxvDdK','replace','\x20has\x20scope=\x22','isArray','2110jQGDeb','refreshedAt','version','manifest','1120049uJrxKD','toLowerCase','string','968703OEHJrD','skillCode','packageBase64','startsWith','displayName','unknown','Unable\x20to\x20resolve\x20skillCode\x20from\x20','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20','company','validation','utf8','object','isFile','10623150wtmloj','Invalid\x20','Skill\x20directory\x20not\x20found:\x20','(unknown)','579416czXmif','targetScope','15492oFWpWG','ignoreInvalidMetadata','appCode','excludedFilePaths','\x20has\x20unsupported\x20scope\x20\x22','416ExrAik','dir','content','files','ignoreMetadataAppCodeMismatch','boolean','Remote\x20Skill\x20',',\x20or\x20directory\x20name.','tags','6GQHJYt','metadata','ignoreMetadataForPayload','scope','isDirectory','isSymbolicLink','builtin','filter','slice','name','personal','length','trim','match','\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22','Missing\x20','description','142686hDglzz','sourceSessionId','skillName','path','Skill\x20metadata\x20appCode\x20\x22'];a144_0x3525=function(){return _0x516278;};return a144_0x3525();}
1
+ (function(_0x3a7a24,_0x3cc9f2){const _0x1a7b5f=a144_0x24f2,_0x5041bc=_0x3a7a24();while(!![]){try{const _0x124740=parseInt(_0x1a7b5f(0xec))/0x1*(parseInt(_0x1a7b5f(0xf3))/0x2)+parseInt(_0x1a7b5f(0xfb))/0x3+-parseInt(_0x1a7b5f(0x121))/0x4*(-parseInt(_0x1a7b5f(0x104))/0x5)+parseInt(_0x1a7b5f(0x11c))/0x6+-parseInt(_0x1a7b5f(0x109))/0x7*(-parseInt(_0x1a7b5f(0xf0))/0x8)+parseInt(_0x1a7b5f(0x100))/0x9+parseInt(_0x1a7b5f(0xff))/0xa*(-parseInt(_0x1a7b5f(0x113))/0xb);if(_0x124740===_0x3cc9f2)break;else _0x5041bc['push'](_0x5041bc['shift']());}catch(_0x5f318b){_0x5041bc['push'](_0x5041bc['shift']());}}}(a144_0x5ca8,0xbc375));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a144_0xc7253d}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{writeJsonAtomic}from'./fs-utils.js';import{contentHash}from'./hashing.js';import{fileText,normalizeLocalFiles,scanSkillDirectory}from'./local-files.js';import{buildMetadata,readMetadataIfPresent}from'./metadata.js';import{buildSkillPackage,tryNormalizePackageManifest}from'./zip-package.js';export function resolvePushDirectoryIdentity(_0x1b6231,_0x4f4af7,_0x31851d={}){const _0x39363f=a144_0x24f2,_0x40f496=resolvePushDirectoryRoot(_0x1b6231),_0x18758e=readPushMetadataIfPresent(resolve(_0x40f496,METADATA_FILE),{'ignoreInvalidMetadata':_0x31851d['ignoreInvalidMetadata']});if(_0x18758e?.[_0x39363f(0xf7)]&&_0x18758e[_0x39363f(0xf7)]!==_0x4f4af7&&!_0x31851d['allowAppCodeRetarget']&&!_0x31851d[_0x39363f(0x120)])throw CliErrors[_0x39363f(0x114)](_0x39363f(0x116)+_0x18758e[_0x39363f(0xf7)]+'\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22'+_0x4f4af7+'\x22.');const _0x174c48=resolvePushSkillCode(_0x40f496,_0x4f4af7,_0x18758e,_0x31851d);if(!_0x174c48)throw CliErrors[_0x39363f(0x114)](_0x39363f(0xef)+SKILL_FILE+',\x20'+METADATA_FILE+_0x39363f(0x126));return{'dir':_0x40f496,'skillCode':_0x174c48,'metadata':_0x18758e};}export function readPushDirectory(_0x47ddc4,_0x157d21,_0x4daa6c={}){const _0x1582cf=a144_0x24f2,_0x18ef50=resolvePushDirectoryIdentity(_0x47ddc4,_0x157d21,_0x4daa6c),_0x5f2ea2=_0x18ef50['dir'],_0x4019fd=resolve(_0x5f2ea2,SKILL_FILE);if(!existsSync(_0x4019fd)||!lstatSync(_0x4019fd)[_0x1582cf(0x111)]())throw CliErrors['validation']('Missing\x20'+SKILL_FILE+':\x20'+_0x4019fd);const _0x46b496=_0x18ef50[_0x1582cf(0xf2)],_0x548067=_0x4daa6c[_0x1582cf(0xf5)]??_0x1582cf(0x110);if(!_0x4daa6c[_0x1582cf(0x102)]&&_0x46b496?.[_0x1582cf(0x127)]===_0x1582cf(0xed))throw CliErrors[_0x1582cf(0x114)]('Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20'+METADATA_FILE+'\x20has\x20scope=\x22'+_0x46b496['scope']+'\x22.');if(!_0x4daa6c[_0x1582cf(0x102)]&&_0x548067===_0x1582cf(0x110)&&_0x46b496?.['scope']&&_0x46b496[_0x1582cf(0x127)]!=='personal')throw CliErrors[_0x1582cf(0x114)]('Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20'+METADATA_FILE+_0x1582cf(0xf8)+_0x46b496[_0x1582cf(0x127)]+'\x22.','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20'+_0x5f2ea2+_0x1582cf(0x108));const _0x76b668=scanSkillDirectory(_0x5f2ea2,{'excludedFilePaths':_0x4daa6c['excludedFilePaths']}),_0x188789=buildSkillPackage(_0x76b668),_0x2ea4fd=readFileSync(_0x4019fd,'utf8'),_0x28b960=_0x18ef50[_0x1582cf(0x10f)],_0x3cbe3c=_0x4daa6c[_0x1582cf(0xf1)]?undefined:_0x46b496,_0x2862e4=readSkillDisplayName(_0x2ea4fd);return{'skillCode':_0x28b960,'metadata':_0x46b496,'frontmatterDisplayName':_0x2862e4,'input':{'skillCode':_0x28b960,'skillName':_0x2862e4??_0x3cbe3c?.[_0x1582cf(0x10c)],'description':_0x3cbe3c?.['description'],'content':_0x2ea4fd,'files':_0x188789[_0x1582cf(0x105)],'packageBase64':_0x188789[_0x1582cf(0x12a)],'tags':_0x3cbe3c?.[_0x1582cf(0x119)],'version':_0x3cbe3c?.['version'],'sourceSessionId':_0x3cbe3c?.[_0x1582cf(0x10d)]}};}function a144_0x24f2(_0x5e663b,_0x4c4cd9){_0x5e663b=_0x5e663b-0xec;const _0x5ca8ec=a144_0x5ca8();let _0x24f252=_0x5ca8ec[_0x5e663b];return _0x24f252;}export function refreshPushDirectoryMetadataFromRemote(_0x3892c5,_0x47cb13,_0x4a6fae,_0x2c14e6={}){const _0x4add75=a144_0x24f2,_0x1fd16c=resolvePushDirectoryRoot(_0x3892c5),_0x4b97f1=readPushMetadataIfPresent(resolve(_0x1fd16c,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x329b59=requireRemoteScope(_0x47cb13),_0x181834=readLocalSkillContent(_0x1fd16c),_0x4e3531={..._0x47cb13,'appCode':_0x47cb13[_0x4add75(0xf7)]??_0x4a6fae,'skillName':_0x47cb13[_0x4add75(0x10c)]??_0x4b97f1?.[_0x4add75(0x10c)],'description':_0x47cb13[_0x4add75(0x11d)]??_0x4b97f1?.['description'],'example':_0x47cb13[_0x4add75(0xfa)]??_0x4b97f1?.['example'],'tags':Array[_0x4add75(0x10e)](_0x47cb13[_0x4add75(0x119)])?_0x47cb13['tags']:_0x4b97f1?.[_0x4add75(0x119)],'sourceSessionId':_0x47cb13['sourceSessionId']??_0x4b97f1?.['sourceSessionId'],'content':_0x47cb13['content']??_0x181834},_0x213a33=buildMetadata(_0x4e3531,_0x329b59,_0x4a6fae,contentHash(_0x181834),_0x2c14e6[_0x4add75(0x118)]);writeJsonAtomic(resolve(_0x1fd16c,METADATA_FILE),_0x213a33);}export function recordPushedRuntimeSkill(_0x201934,_0x8ef0fd,_0x5570c2,_0x1169f9={}){const _0x2f8785=a144_0x24f2,_0x5e661b=resolvePushDirectoryRoot(_0x201934),_0x13649d=scanSkillDirectory(_0x5e661b),_0x5e9048=_0x13649d[_0x2f8785(0xf4)](_0x3654c0=>_0x3654c0[_0x2f8785(0x101)]===SKILL_FILE),_0x1140a5=_0x5e9048?fileText(_0x5e9048):'',_0x2a5693=tryNormalizePackageManifest(_0x8ef0fd[_0x2f8785(0x107)]),_0x22569d={..._0x8ef0fd,'content':_0x8ef0fd[_0x2f8785(0x11b)]??_0x1140a5,'files':_0x2a5693},_0x226463=_0x2a5693?normalizeLocalFiles(_0x13649d)[_0x2f8785(0x124)](_0x3fcc59=>_0x2a5693[_0x2f8785(0x107)][_0x2f8785(0x11e)](_0x22163b=>_0x22163b['path']===_0x3fcc59[_0x2f8785(0x101)])):undefined,_0x3ffc0c=buildMetadata(_0x22569d,_0x1169f9[_0x2f8785(0x127)]??_0x2f8785(0x110),_0x5570c2,contentHash(_0x22569d[_0x2f8785(0x11b)]??''),_0x1169f9['pushedAt'],_0x226463);writeJsonAtomic(resolve(_0x5e661b,METADATA_FILE),_0x3ffc0c);}export function deriveSkillCodeFromDirectory(_0x5c3286,_0x40f600){const _0xb9ac2c=a144_0x24f2,_0x369b31=basename(resolve(_0x5c3286)),_0x4cb5d3=_0x40f600+'--';return _0x369b31['startsWith'](_0x4cb5d3)?_0x369b31[_0xb9ac2c(0x11f)](_0x4cb5d3['length']):_0x369b31;}function resolvePushSkillCode(_0x245857,_0x1e184a,_0x298d4c,_0x4b4519){const _0x90e980=a144_0x24f2,_0x408ad8=deriveSkillCodeFromSkillFile(_0x245857)||deriveSkillCodeFromDirectory(_0x245857,_0x1e184a);if(_0x4b4519[_0x90e980(0xf6)])return _0x408ad8;return _0x298d4c?.[_0x90e980(0x10f)]?.[_0x90e980(0x115)]()||_0x408ad8;}function deriveSkillCodeFromSkillFile(_0x3d6d0e){const _0xc6c305=a144_0x24f2,_0x464d9c=resolve(_0x3d6d0e,SKILL_FILE);if(!existsSync(_0x464d9c)||!lstatSync(_0x464d9c)['isFile']())return undefined;const _0x3b8437=readFileSync(_0x464d9c,_0xc6c305(0x10a)),_0xf806eb=_0x3b8437[_0xc6c305(0xf9)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0xf806eb)return undefined;const _0x3294f3=parseFrontmatterObject(_0xf806eb[0x1]??''),_0x1d238c=scalarToString(_0x3294f3?.[_0xc6c305(0x125)]);return _0x1d238c?slugifySkillName(_0x1d238c):undefined;}function readSkillDisplayName(_0x2ec07d){const _0x59302e=a144_0x24f2,_0x189a58=_0x2ec07d[_0x59302e(0xf9)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x189a58)return undefined;const _0x187a5e=parseFrontmatterObject(_0x189a58[0x1]??'');return scalarToString(_0x187a5e?.['displayName']);}function slugifySkillName(_0x2df6d4){const _0x3518d8=a144_0x24f2,_0x2dbf78=_0x2df6d4[_0x3518d8(0x115)]()['toLowerCase']()['replace'](/[^\p{L}\p{N}\p{So}]+/gu,'-')[_0x3518d8(0x10b)](/^-+/,'')[_0x3518d8(0x10b)](/-+$/,'')['replace'](/-{2,}/g,'-');if(!_0x2dbf78)throw CliErrors[_0x3518d8(0x114)]('Invalid\x20'+SKILL_FILE+_0x3518d8(0x106));return _0x2dbf78;}function parseFrontmatterObject(_0x204b33){const _0x3cc426=a144_0x24f2;try{const _0x3d6314=a144_0xc7253d(_0x204b33);return _0x3d6314&&typeof _0x3d6314===_0x3cc426(0x123)&&!Array[_0x3cc426(0x10e)](_0x3d6314)?_0x3d6314:undefined;}catch{return undefined;}}function a144_0x5ca8(){const _0x349115=['example','1148994WeGeAR','isDirectory','company','number','1004250nXBUjt','2585952PmALwx','path','ignoreMetadataScope','ignoreInvalidMetadata','5ULkXOK','manifest','\x20name\x20for\x20SkillHub\x20slug\x20generation.','files','\x20to\x20submit\x20company\x20Skills\x20for\x20review.','49oafMGl','utf8','replace','skillName','sourceSessionId','isArray','skillCode','personal','isFile','boolean','330wkfnBN','validation','trim','Skill\x20metadata\x20appCode\x20\x22','\x20has\x20unsupported\x20scope\x20\x22','refreshedAt','tags','isSymbolicLink','content','3358542roJjrn','description','some','slice','ignoreMetadataAppCodeMismatch','962860ItEWwg','Skill\x20directory\x20not\x20found:\x20','object','filter','name',',\x20or\x20directory\x20name.','scope','Remote\x20Skill\x20','unknown','packageBase64','string','31JhvncC','builtin','(unknown)','Unable\x20to\x20resolve\x20skillCode\x20from\x20','1374848FREVtk','ignoreMetadataForPayload','metadata','71606pBbVtX','find','targetScope','ignoreMetadataSkillCode','appCode','\x20has\x20scope=\x22','match'];a144_0x5ca8=function(){return _0x349115;};return a144_0x5ca8();}function scalarToString(_0x478cab){const _0x8a23d4=a144_0x24f2;if(typeof _0x478cab===_0x8a23d4(0x12b))return _0x478cab[_0x8a23d4(0x115)]();if(typeof _0x478cab===_0x8a23d4(0xfe)||typeof _0x478cab===_0x8a23d4(0x112))return String(_0x478cab);return undefined;}function resolvePushDirectoryRoot(_0x280b8f){const _0x268b70=a144_0x24f2,_0x36d941=resolve(_0x280b8f);if(!existsSync(_0x36d941))throw CliErrors['validation'](_0x268b70(0x122)+_0x280b8f);const _0xd9a4d2=lstatSync(_0x36d941);if(_0xd9a4d2['isDirectory']())return _0x36d941;if(_0xd9a4d2[_0x268b70(0x11a)]()){const _0x523b66=realpathSync(_0x36d941);if(lstatSync(_0x523b66)[_0x268b70(0xfc)]())return _0x523b66;}throw CliErrors[_0x268b70(0x114)]('Skill\x20directory\x20not\x20found:\x20'+_0x280b8f);}function requireRemoteScope(_0x8bdf50){const _0x9f221a=a144_0x24f2;if(_0x8bdf50[_0x9f221a(0x127)]===_0x9f221a(0x110)||_0x8bdf50[_0x9f221a(0x127)]===_0x9f221a(0xfd)||_0x8bdf50['scope']===_0x9f221a(0xed))return _0x8bdf50[_0x9f221a(0x127)];throw CliErrors[_0x9f221a(0x114)](_0x9f221a(0x128)+(_0x8bdf50['skillCode']||_0x9f221a(0xee))+_0x9f221a(0x117)+(_0x8bdf50[_0x9f221a(0x127)]??_0x9f221a(0x129))+'\x22.');}function readLocalSkillContent(_0x270de3){const _0x554d38=a144_0x24f2,_0x1d9cce=resolve(_0x270de3,SKILL_FILE);return existsSync(_0x1d9cce)&&lstatSync(_0x1d9cce)['isFile']()?readFileSync(_0x1d9cce,_0x554d38(0x10a)):'';}function readPushMetadataIfPresent(_0x8d8047,_0x2f7447={}){const _0x44dfcc=a144_0x24f2;try{return readMetadataIfPresent(_0x8d8047);}catch(_0x66c5a1){if(_0x2f7447[_0x44dfcc(0x103)])return undefined;throw _0x66c5a1;}}
@@ -1 +1 @@
1
- function a145_0x4e46(){const _0x3cb0e8=['length','746928aBsfGb','117294HEBZtc','Unsupported\x20runtime\x20Skill\x20scope:\x20','8UmiDkY','company','personal','validation','956578TDjyfu','builtin','push','36027gXckWE','91gQzRcu','32ZmUXfZ','154850qOpdcS','4103694YhcrLo','518780FbacsF'];a145_0x4e46=function(){return _0x3cb0e8;};return a145_0x4e46();}(function(_0x558690,_0x1669d5){const _0x120010=a145_0x39b5,_0x105c80=_0x558690();while(!![]){try{const _0x26dce7=parseInt(_0x120010(0x1ec))/0x1+parseInt(_0x120010(0x1e9))/0x2+parseInt(_0x120010(0x1e2))/0x3+parseInt(_0x120010(0x1ee))/0x4*(-parseInt(_0x120010(0x1ef))/0x5)+parseInt(_0x120010(0x1e3))/0x6*(parseInt(_0x120010(0x1ed))/0x7)+-parseInt(_0x120010(0x1e5))/0x8*(parseInt(_0x120010(0x1f0))/0x9)+-parseInt(_0x120010(0x1f1))/0xa;if(_0x26dce7===_0x1669d5)break;else _0x105c80['push'](_0x105c80['shift']());}catch(_0x55ccbb){_0x105c80['push'](_0x105c80['shift']());}}}(a145_0x4e46,0x3fec1));import{CliErrors}from'../../errors.js';function a145_0x39b5(_0xf5ac82,_0x503b2b){_0xf5ac82=_0xf5ac82-0x1e2;const _0x4e46ef=a145_0x4e46();let _0x39b593=_0x4e46ef[_0xf5ac82];return _0x39b593;}export function normalizeRuntimeSkillScopes(_0x4837e9){const _0x37716f=a145_0x39b5,_0xc49b78=_0x4837e9&&_0x4837e9[_0x37716f(0x1f2)]>0x0?_0x4837e9:[_0x37716f(0x1e7),_0x37716f(0x1e6),'builtin'],_0x1fc02c=[];for(const _0x5e915e of _0xc49b78){if(!isRuntimeSkillScope(_0x5e915e))throw CliErrors[_0x37716f(0x1e8)](_0x37716f(0x1e4)+_0x5e915e);!_0x1fc02c['includes'](_0x5e915e)&&_0x1fc02c[_0x37716f(0x1eb)](_0x5e915e);}return _0x1fc02c;}export function isRuntimeSkillScope(_0x5b2047){const _0x989d8b=a145_0x39b5;return _0x5b2047==='personal'||_0x5b2047===_0x989d8b(0x1e6)||_0x5b2047===_0x989d8b(0x1ea);}
1
+ (function(_0x22ffcb,_0x169a26){const _0x56e99d=a145_0x2b8b,_0x4e354e=_0x22ffcb();while(!![]){try{const _0x1a3cab=-parseInt(_0x56e99d(0x1ef))/0x1+parseInt(_0x56e99d(0x1e9))/0x2+parseInt(_0x56e99d(0x1f2))/0x3+-parseInt(_0x56e99d(0x1e8))/0x4*(-parseInt(_0x56e99d(0x1e6))/0x5)+-parseInt(_0x56e99d(0x1e7))/0x6*(-parseInt(_0x56e99d(0x1f1))/0x7)+parseInt(_0x56e99d(0x1ea))/0x8+parseInt(_0x56e99d(0x1f0))/0x9*(-parseInt(_0x56e99d(0x1f3))/0xa);if(_0x1a3cab===_0x169a26)break;else _0x4e354e['push'](_0x4e354e['shift']());}catch(_0x4486e8){_0x4e354e['push'](_0x4e354e['shift']());}}}(a145_0x21f3,0xeecf6));import{CliErrors}from'../../errors.js';export function normalizeRuntimeSkillScopes(_0x4eaf5f){const _0x7477a3=a145_0x2b8b,_0x45ec8c=_0x4eaf5f&&_0x4eaf5f['length']>0x0?_0x4eaf5f:[_0x7477a3(0x1ee),'company','builtin'],_0x50b382=[];for(const _0x3c2776 of _0x45ec8c){if(!isRuntimeSkillScope(_0x3c2776))throw CliErrors['validation'](_0x7477a3(0x1eb)+_0x3c2776);!_0x50b382['includes'](_0x3c2776)&&_0x50b382[_0x7477a3(0x1ec)](_0x3c2776);}return _0x50b382;}export function isRuntimeSkillScope(_0x17257f){const _0x5b84cc=a145_0x2b8b;return _0x17257f===_0x5b84cc(0x1ee)||_0x17257f===_0x5b84cc(0x1ed)||_0x17257f==='builtin';}function a145_0x2b8b(_0x59a6c0,_0x526635){_0x59a6c0=_0x59a6c0-0x1e6;const _0x21f334=a145_0x21f3();let _0x2b8bab=_0x21f334[_0x59a6c0];return _0x2b8bab;}function a145_0x21f3(){const _0x138a79=['282298XxGHib','1359jxciDf','35jVysbj','4708866LEaEnT','268690BVvLDI','5ALbxMd','855534qvzKVu','188616tcumjh','2354762Muasmi','14484648dmpcBC','Unsupported\x20runtime\x20Skill\x20scope:\x20','push','company','personal'];a145_0x21f3=function(){return _0x138a79;};return a145_0x21f3();}
@@ -1 +1 @@
1
- function a147_0x232e(){const _0x2777c3=['sort','24GIBeZv','endsWith','2718576EaKKvl','2296400fZiddj','code','140140CohrIV','from','195088kUcSUt','65vuMphC','1221toNEmM','validation_error','4744rcMmRP','1980-01-01T00:00:00.000Z','Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.','1393bnuLPu','validation','entries','name','97386rnbIak','map','path','Runtime\x20Skill\x20package\x20contains\x20directory\x20entry:\x20'];a147_0x232e=function(){return _0x2777c3;};return a147_0x232e();}const a147_0xc23e46=a147_0x2137;(function(_0x36767f,_0x1312f4){const _0x4652b9=a147_0x2137,_0x1ea6ac=_0x36767f();while(!![]){try{const _0x54bef5=-parseInt(_0x4652b9(0x1e3))/0x1+parseInt(_0x4652b9(0x1de))/0x2*(-parseInt(_0x4652b9(0x1e7))/0x3)+-parseInt(_0x4652b9(0x1e5))/0x4+-parseInt(_0x4652b9(0x1e6))/0x5*(parseInt(_0x4652b9(0x1d9))/0x6)+-parseInt(_0x4652b9(0x1d5))/0x7*(-parseInt(_0x4652b9(0x1e9))/0x8)+parseInt(_0x4652b9(0x1e0))/0x9+parseInt(_0x4652b9(0x1e1))/0xa;if(_0x54bef5===_0x1312f4)break;else _0x1ea6ac['push'](_0x1ea6ac['shift']());}catch(_0x3ea7c0){_0x1ea6ac['push'](_0x1ea6ac['shift']());}}}(a147_0x232e,0x3bcb0));function a147_0x2137(_0x1b3280,_0xccfd82){_0x1b3280=_0x1b3280-0x1d3;const _0x232e64=a147_0x232e();let _0x2137e8=_0x232e64[_0x1b3280];return _0x2137e8;}import{unzipSync,zipSync}from'fflate';import{CliErrors}from'../../errors.js';import{compareSkillFiles,fileContent,normalizeLocalFiles,normalizeSkillRelativePath}from'./local-files.js';const ZIP_MTIME=new Date(a147_0xc23e46(0x1d3));export function createDeterministicZipPackage(_0x34e45a){const _0x424d4d=a147_0xc23e46,_0xefab2c={};for(const _0x419838 of normalizeLocalFiles(_0x34e45a)){_0xefab2c[_0x419838[_0x424d4d(0x1db)]]=fileContent(_0x419838);}return Buffer[_0x424d4d(0x1e4)](zipSync(_0xefab2c,{'level':0x0,'mtime':ZIP_MTIME}));}export function parseZipPackage(_0x44a135){const _0x203e83=a147_0xc23e46;if(_0x44a135['length']<0x16)throw CliErrors[_0x203e83(0x1d6)](_0x203e83(0x1d4));let _0xd1fa4e;try{_0xd1fa4e=unzipSync(_0x44a135,{'filter'(_0x138352){const _0x1c54bf=_0x203e83,_0x54f129=normalizeSkillRelativePath(_0x138352[_0x1c54bf(0x1d8)]);if(_0x54f129[_0x1c54bf(0x1df)]('/'))throw CliErrors['validation'](_0x1c54bf(0x1dc)+_0x54f129);return!![];}});}catch(_0x492dbe){if(isRuntimeSkillValidationError(_0x492dbe))throw _0x492dbe;throw CliErrors['validation'](_0x203e83(0x1d4));}return Object[_0x203e83(0x1d7)](_0xd1fa4e)[_0x203e83(0x1da)](([_0x1c4bd6,_0x186979])=>({'path':normalizeSkillRelativePath(_0x1c4bd6),'bytes':Buffer[_0x203e83(0x1e4)](_0x186979)}))[_0x203e83(0x1dd)](compareSkillFiles);}function isRuntimeSkillValidationError(_0x8afc65){const _0x527da6=a147_0xc23e46;return typeof _0x8afc65==='object'&&_0x8afc65!==null&&'code'in _0x8afc65&&_0x8afc65[_0x527da6(0x1e2)]===_0x527da6(0x1e8);}
1
+ (function(_0x8c80e4,_0x1f8642){const _0x22b435=a147_0x73b1,_0x364294=_0x8c80e4();while(!![]){try{const _0x33ff45=-parseInt(_0x22b435(0x96))/0x1*(parseInt(_0x22b435(0x94))/0x2)+parseInt(_0x22b435(0x89))/0x3*(-parseInt(_0x22b435(0x9b))/0x4)+parseInt(_0x22b435(0x91))/0x5*(-parseInt(_0x22b435(0x8f))/0x6)+-parseInt(_0x22b435(0x8e))/0x7*(-parseInt(_0x22b435(0x8c))/0x8)+-parseInt(_0x22b435(0x97))/0x9+parseInt(_0x22b435(0x93))/0xa+parseInt(_0x22b435(0x90))/0xb;if(_0x33ff45===_0x1f8642)break;else _0x364294['push'](_0x364294['shift']());}catch(_0x51c307){_0x364294['push'](_0x364294['shift']());}}}(a147_0x792a,0xc5160));import{unzipSync,zipSync}from'fflate';import{CliErrors}from'../../errors.js';function a147_0x792a(){const _0x19524b=['23888QcjiOs','Runtime\x20Skill\x20package\x20contains\x20directory\x20entry:\x20','581KLUgVE','245910yKAAOr','56504580XWegSI','170KLkLLF','object','617810UKKgGQ','615034AuEcuO','sort','5ANYOqS','4878360UZPZKq','name','validation','code','26960NuIotL','Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.','length','519WSRQGi','validation_error','path'];a147_0x792a=function(){return _0x19524b;};return a147_0x792a();}import{compareSkillFiles,fileContent,normalizeLocalFiles,normalizeSkillRelativePath}from'./local-files.js';function a147_0x73b1(_0x361ce9,_0x3e5dce){_0x361ce9=_0x361ce9-0x88;const _0x792a07=a147_0x792a();let _0x73b1c0=_0x792a07[_0x361ce9];return _0x73b1c0;}const ZIP_MTIME=new Date('1980-01-01T00:00:00.000Z');export function createDeterministicZipPackage(_0xf2e185){const _0x192281=a147_0x73b1,_0x6c9ee1={};for(const _0xa3c5e1 of normalizeLocalFiles(_0xf2e185)){_0x6c9ee1[_0xa3c5e1[_0x192281(0x8b)]]=fileContent(_0xa3c5e1);}return Buffer['from'](zipSync(_0x6c9ee1,{'level':0x0,'mtime':ZIP_MTIME}));}export function parseZipPackage(_0x57724f){const _0x55e66d=a147_0x73b1;if(_0x57724f[_0x55e66d(0x88)]<0x16)throw CliErrors[_0x55e66d(0x99)](_0x55e66d(0x9c));let _0x36a1e1;try{_0x36a1e1=unzipSync(_0x57724f,{'filter'(_0x18fad7){const _0x21164c=_0x55e66d,_0x4a4efd=normalizeSkillRelativePath(_0x18fad7[_0x21164c(0x98)]);if(_0x4a4efd['endsWith']('/'))throw CliErrors[_0x21164c(0x99)](_0x21164c(0x8d)+_0x4a4efd);return!![];}});}catch(_0x25c0cf){if(isRuntimeSkillValidationError(_0x25c0cf))throw _0x25c0cf;throw CliErrors[_0x55e66d(0x99)]('Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.');}return Object['entries'](_0x36a1e1)['map'](([_0x3dbd13,_0x22eefc])=>({'path':normalizeSkillRelativePath(_0x3dbd13),'bytes':Buffer['from'](_0x22eefc)}))[_0x55e66d(0x95)](compareSkillFiles);}function isRuntimeSkillValidationError(_0x5bc2b0){const _0x57a8e0=a147_0x73b1;return typeof _0x5bc2b0===_0x57a8e0(0x92)&&_0x5bc2b0!==null&&_0x57a8e0(0x9a)in _0x5bc2b0&&_0x5bc2b0['code']===_0x57a8e0(0x8a);}
@@ -1 +1 @@
1
- (function(_0x43421c,_0x1684a8){const _0x1c4170=a148_0x2faa,_0x455025=_0x43421c();while(!![]){try{const _0x193d80=-parseInt(_0x1c4170(0xc7))/0x1*(-parseInt(_0x1c4170(0xc6))/0x2)+-parseInt(_0x1c4170(0xc3))/0x3*(-parseInt(_0x1c4170(0xdb))/0x4)+-parseInt(_0x1c4170(0xcb))/0x5+-parseInt(_0x1c4170(0xd4))/0x6+parseInt(_0x1c4170(0xc8))/0x7*(parseInt(_0x1c4170(0xdc))/0x8)+-parseInt(_0x1c4170(0xe6))/0x9+parseInt(_0x1c4170(0xc1))/0xa*(-parseInt(_0x1c4170(0xbe))/0xb);if(_0x193d80===_0x1684a8)break;else _0x455025['push'](_0x455025['shift']());}catch(_0x4ee757){_0x455025['push'](_0x455025['shift']());}}}(a148_0x3afa,0xc80cd));import{CliErrors}from'../../errors.js';function a148_0x3afa(){const _0x566f80=['schemaVersion','map','path','isSafeInteger','Duplicate\x20Skill\x20package\x20entry:\x20','2494452Dbulwj','Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.','files','Runtime\x20Skill\x20package\x20sha256\x20is\x20invalid.','Runtime\x20Skill\x20package\x20is\x20missing\x20entry:\x20','Runtime\x20Skill\x20package\x20sha256\x20mismatch.','Runtime\x20Skill\x20package\x20is\x20required\x20for\x20Skill\x20install:\x20','3053340VTfxtN','8kItcaf','string','\x20in\x20Skill\x20file\x20package.','Runtime\x20Skill\x20package\x20size\x20is\x20invalid.','Runtime\x20Skill\x20package\x20size\x20mismatch.','Runtime\x20Skill\x20package\x20file\x20sha256\x20mismatch:\x20','object','Runtime\x20Skill\x20file\x20tree\x20sha256\x20is\x20invalid.','some','toLowerCase','9104085cGJHTR','base64','ossPath','set','isArray','10747guXIgI','length','Missing\x20','10430fXmvDo','validation','6uhKQgX','bytes','sha256','2ENyrlu','1378763zFIwqL','10959263LRwQqa','Runtime\x20Skill\x20package\x20is\x20missing\x20','zipSha256','6026595yNPdGE','toString','zipSize','treeSha256'];a148_0x3afa=function(){return _0x566f80;};return a148_0x3afa();}import{SKILL_FILE}from'./constants.js';import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';import{fileContent,isSha256Hex,normalizeLocalFiles,normalizeManifestFiles}from'./local-files.js';import{createDeterministicZipPackage,parseZipPackage}from'./zip-codec.js';export function buildSkillPackage(_0x5ec2bf){const _0x4dec00=a148_0x2faa,_0x41a534=normalizeLocalFiles(_0x5ec2bf);if(!_0x41a534[_0x4dec00(0xe4)](_0xfea4e8=>_0xfea4e8[_0x4dec00(0xd1)]===SKILL_FILE))throw CliErrors['validation'](_0x4dec00(0xc0)+SKILL_FILE+_0x4dec00(0xde));const _0x167e60=localFilesToManifestFiles(_0x41a534),_0x558634=createDeterministicZipPackage(_0x41a534);return{'manifest':{'schemaVersion':0x2,'treeSha256':fileTreeHash(_0x167e60),'zipSha256':bufferSha256(_0x558634),'zipSize':_0x558634[_0x4dec00(0xbf)],'files':_0x167e60},'packageBytes':_0x558634,'packageBase64':_0x558634[_0x4dec00(0xcc)](_0x4dec00(0xe7))};}function a148_0x2faa(_0x1d97a,_0x3e7e4f){_0x1d97a=_0x1d97a-0xbb;const _0x3afacb=a148_0x3afa();let _0x2faa96=_0x3afacb[_0x1d97a];return _0x2faa96;}export function verifyRuntimeSkillPackage(_0x1d0cd2,_0x4c022c){const _0x624485=a148_0x2faa,_0x1ce496=normalizePackageManifest(_0x1d0cd2,{'requireOssPath':![]});if(!_0x1ce496)throw CliErrors[_0x624485(0xc2)]('Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.');return extractAndVerifyPackage(_0x1ce496,_0x4c022c);}export function verifyRuntimeSkillBundle(_0x1bb2a6,_0x2d3208){const _0x413f6a=a148_0x2faa,_0x581a9d=normalizePackageManifest(_0x1bb2a6,{'requireOssPath':![]});if(!_0x581a9d)throw CliErrors[_0x413f6a(0xc2)](_0x413f6a(0xd5));return extractAndVerifyPackageFiles(_0x581a9d,_0x2d3208);}export function tryNormalizePackageManifest(_0x114138){return normalizePackageManifest(_0x114138,{'requireOssPath':![]});}export function requirePackageBytes(_0x59dca8,_0x499004){const _0x2753c5=a148_0x2faa;if(!_0x499004||_0x499004[_0x2753c5(0xbf)]===0x0)throw CliErrors['validation'](_0x2753c5(0xda)+_0x59dca8);return _0x499004;}export function extractDownloadedPackage(_0x529dd1){const _0x15a425=a148_0x2faa,_0x3318a0=parseZipPackage(_0x529dd1)[_0x15a425(0xd0)](_0x269fe8=>({'path':_0x269fe8['path'],'bytes':_0x269fe8[_0x15a425(0xc4)]}));if(!_0x3318a0[_0x15a425(0xe4)](_0x313f4a=>_0x313f4a[_0x15a425(0xd1)]===SKILL_FILE))throw CliErrors['validation'](_0x15a425(0xc9)+SKILL_FILE+'.');return normalizeLocalFiles(_0x3318a0);}export function localFilesToManifestFiles(_0x923ed3){const _0x44de45=a148_0x2faa;return normalizeLocalFiles(_0x923ed3)[_0x44de45(0xd0)](_0x1769d8=>({'path':_0x1769d8[_0x44de45(0xd1)],'sha256':fileHash(_0x1769d8),'size':fileContent(_0x1769d8)[_0x44de45(0xbf)]}));}function normalizePackageManifest(_0x5b96f6,_0x3159d3){const _0x3627ed=a148_0x2faa;if(!_0x5b96f6||typeof _0x5b96f6!==_0x3627ed(0xe2)||Array[_0x3627ed(0xbd)](_0x5b96f6))return undefined;const _0x2948fe=_0x5b96f6,_0x485842=typeof _0x2948fe[_0x3627ed(0xbb)]===_0x3627ed(0xdd)?_0x2948fe[_0x3627ed(0xbb)]['trim']():undefined;if(_0x3159d3['requireOssPath']&&!_0x485842)return undefined;if(!Array[_0x3627ed(0xbd)](_0x2948fe['files'])||_0x2948fe[_0x3627ed(0xd6)]['length']===0x0)return undefined;if(!isSha256Hex(_0x2948fe[_0x3627ed(0xce)]))throw CliErrors[_0x3627ed(0xc2)](_0x3627ed(0xe3));if(!isSha256Hex(_0x2948fe[_0x3627ed(0xca)]))throw CliErrors[_0x3627ed(0xc2)](_0x3627ed(0xd7));if(!Number[_0x3627ed(0xd2)](_0x2948fe[_0x3627ed(0xcd)])||_0x2948fe['zipSize']<0x0)throw CliErrors[_0x3627ed(0xc2)](_0x3627ed(0xdf));const _0x3ce288=normalizeManifestFiles(_0x2948fe['files']);if(!_0x3ce288[_0x3627ed(0xe4)](_0x29cc9c=>_0x29cc9c[_0x3627ed(0xd1)]===SKILL_FILE))throw CliErrors['validation']('Runtime\x20Skill\x20manifest\x20is\x20missing\x20'+SKILL_FILE+'.');const _0x334ca8=fileTreeHash(_0x3ce288);if(_0x334ca8!==_0x2948fe[_0x3627ed(0xce)]['toLowerCase']())throw CliErrors[_0x3627ed(0xc2)]('Runtime\x20Skill\x20file\x20tree\x20sha256\x20mismatch.');return{'schemaVersion':Number['isSafeInteger'](_0x2948fe[_0x3627ed(0xcf)])?_0x2948fe['schemaVersion']:0x2,'ossPath':_0x485842,'treeSha256':_0x334ca8,'zipSha256':_0x2948fe[_0x3627ed(0xca)][_0x3627ed(0xe5)](),'zipSize':_0x2948fe['zipSize'],'files':_0x3ce288};}function extractAndVerifyPackage(_0x1ca2c1,_0x4acade){const _0x5a1289=a148_0x2faa,_0x17f6db=normalizePackageManifest(_0x1ca2c1,{'requireOssPath':![]});if(!_0x17f6db)throw CliErrors[_0x5a1289(0xc2)]('Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.');if(_0x4acade[_0x5a1289(0xbf)]!==_0x17f6db[_0x5a1289(0xcd)])throw CliErrors['validation'](_0x5a1289(0xe0));const _0x222108=bufferSha256(_0x4acade);if(_0x222108!==_0x17f6db[_0x5a1289(0xca)])throw CliErrors['validation'](_0x5a1289(0xd9));return extractAndVerifyPackageFiles(_0x17f6db,_0x4acade);}function extractAndVerifyPackageFiles(_0x4b06fe,_0x506f20){const _0x1aa65e=a148_0x2faa,_0x25a626=parseZipPackage(_0x506f20);if(_0x25a626[_0x1aa65e(0xbf)]!==_0x4b06fe[_0x1aa65e(0xd6)][_0x1aa65e(0xbf)])throw CliErrors['validation']('Runtime\x20Skill\x20package\x20entry\x20list\x20mismatch.');const _0x40e931=new Map();for(const _0x1304f7 of _0x25a626){if(_0x40e931['has'](_0x1304f7[_0x1aa65e(0xd1)]))throw CliErrors[_0x1aa65e(0xc2)](_0x1aa65e(0xd3)+_0x1304f7['path']);_0x40e931[_0x1aa65e(0xbc)](_0x1304f7[_0x1aa65e(0xd1)],_0x1304f7);}const _0x5025ea=[];for(const _0x165515 of _0x4b06fe[_0x1aa65e(0xd6)]){const _0x5c31fb=_0x40e931['get'](_0x165515[_0x1aa65e(0xd1)]);if(!_0x5c31fb)throw CliErrors[_0x1aa65e(0xc2)](_0x1aa65e(0xd8)+_0x165515['path']);if(_0x5c31fb[_0x1aa65e(0xc4)][_0x1aa65e(0xbf)]!==_0x165515['size'])throw CliErrors[_0x1aa65e(0xc2)]('Runtime\x20Skill\x20package\x20file\x20size\x20mismatch:\x20'+_0x165515[_0x1aa65e(0xd1)]);const _0x42273d=bufferSha256(_0x5c31fb['bytes']);if(_0x42273d!==_0x165515[_0x1aa65e(0xc5)])throw CliErrors['validation'](_0x1aa65e(0xe1)+_0x165515[_0x1aa65e(0xd1)]);_0x5025ea['push']({'path':_0x165515['path'],'bytes':_0x5c31fb[_0x1aa65e(0xc4)]});}return normalizeLocalFiles(_0x5025ea);}
1
+ (function(_0xbb95e6,_0x3b902b){const _0x5d77ef=a148_0x24e7,_0x21a741=_0xbb95e6();while(!![]){try{const _0xdc4128=parseInt(_0x5d77ef(0x1ab))/0x1+parseInt(_0x5d77ef(0x1ac))/0x2*(-parseInt(_0x5d77ef(0x1ae))/0x3)+parseInt(_0x5d77ef(0x1cf))/0x4*(parseInt(_0x5d77ef(0x1c0))/0x5)+parseInt(_0x5d77ef(0x1d0))/0x6*(-parseInt(_0x5d77ef(0x1b7))/0x7)+-parseInt(_0x5d77ef(0x1b0))/0x8*(parseInt(_0x5d77ef(0x1ca))/0x9)+-parseInt(_0x5d77ef(0x1be))/0xa*(parseInt(_0x5d77ef(0x1b9))/0xb)+parseInt(_0x5d77ef(0x1b1))/0xc;if(_0xdc4128===_0x3b902b)break;else _0x21a741['push'](_0x21a741['shift']());}catch(_0x5aefaa){_0x21a741['push'](_0x21a741['shift']());}}}(a148_0x39b7,0xc4eba));import{CliErrors}from'../../errors.js';import{SKILL_FILE}from'./constants.js';import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';import{fileContent,isSha256Hex,normalizeLocalFiles,normalizeManifestFiles}from'./local-files.js';import{createDeterministicZipPackage,parseZipPackage}from'./zip-codec.js';function a148_0x24e7(_0x2dbbb0,_0x10aaf6){_0x2dbbb0=_0x2dbbb0-0x1aa;const _0x39b730=a148_0x39b7();let _0x24e7a3=_0x39b730[_0x2dbbb0];return _0x24e7a3;}export function buildSkillPackage(_0x36934a){const _0x48f0ff=a148_0x24e7,_0x78efd3=normalizeLocalFiles(_0x36934a);if(!_0x78efd3[_0x48f0ff(0x1c3)](_0x201e9f=>_0x201e9f[_0x48f0ff(0x1b5)]===SKILL_FILE))throw CliErrors['validation']('Missing\x20'+SKILL_FILE+'\x20in\x20Skill\x20file\x20package.');const _0x578994=localFilesToManifestFiles(_0x78efd3),_0x1225a3=createDeterministicZipPackage(_0x78efd3);return{'manifest':{'schemaVersion':0x2,'treeSha256':fileTreeHash(_0x578994),'zipSha256':bufferSha256(_0x1225a3),'zipSize':_0x1225a3[_0x48f0ff(0x1b8)],'files':_0x578994},'packageBytes':_0x1225a3,'packageBase64':_0x1225a3[_0x48f0ff(0x1c9)](_0x48f0ff(0x1d2))};}export function verifyRuntimeSkillPackage(_0x2c8458,_0x4bc1b9){const _0x129d6b=a148_0x24e7,_0x558f66=normalizePackageManifest(_0x2c8458,{'requireOssPath':![]});if(!_0x558f66)throw CliErrors[_0x129d6b(0x1aa)](_0x129d6b(0x1d4));return extractAndVerifyPackage(_0x558f66,_0x4bc1b9);}export function verifyRuntimeSkillBundle(_0x2c820c,_0x500a4f){const _0x19b4a5=a148_0x24e7,_0x923aea=normalizePackageManifest(_0x2c820c,{'requireOssPath':![]});if(!_0x923aea)throw CliErrors[_0x19b4a5(0x1aa)](_0x19b4a5(0x1d4));return extractAndVerifyPackageFiles(_0x923aea,_0x500a4f);}export function tryNormalizePackageManifest(_0xb963ee){return normalizePackageManifest(_0xb963ee,{'requireOssPath':![]});}export function requirePackageBytes(_0x2b4e85,_0x1c08d4){const _0x1477d4=a148_0x24e7;if(!_0x1c08d4||_0x1c08d4['length']===0x0)throw CliErrors[_0x1477d4(0x1aa)]('Runtime\x20Skill\x20package\x20is\x20required\x20for\x20Skill\x20install:\x20'+_0x2b4e85);return _0x1c08d4;}export function extractDownloadedPackage(_0xd5d2d8){const _0x4f4821=a148_0x24e7,_0x247fd4=parseZipPackage(_0xd5d2d8)[_0x4f4821(0x1c6)](_0x410540=>({'path':_0x410540[_0x4f4821(0x1b5)],'bytes':_0x410540[_0x4f4821(0x1cc)]}));if(!_0x247fd4[_0x4f4821(0x1c3)](_0x508629=>_0x508629[_0x4f4821(0x1b5)]===SKILL_FILE))throw CliErrors['validation']('Runtime\x20Skill\x20package\x20is\x20missing\x20'+SKILL_FILE+'.');return normalizeLocalFiles(_0x247fd4);}function a148_0x39b7(){const _0x35dda3=['1289580QMZNAC','10UEJAjC','has','913431LqRDbT','schemaVersion','84408SefimL','40921920pYVrqj','zipSha256','files','Runtime\x20Skill\x20package\x20file\x20size\x20mismatch:\x20','path','object','3913623MJeohF','length','22OpIsjT','Runtime\x20Skill\x20file\x20tree\x20sha256\x20is\x20invalid.','requireOssPath','Duplicate\x20Skill\x20package\x20entry:\x20','Runtime\x20Skill\x20package\x20sha256\x20is\x20invalid.','3601970TScKRU','isSafeInteger','1465QGWQpa','treeSha256','toLowerCase','some','trim','Runtime\x20Skill\x20package\x20size\x20is\x20invalid.','map','Runtime\x20Skill\x20package\x20size\x20mismatch.','zipSize','toString','1341HliZbe','get','bytes','ossPath','string','6564kfMZCT','6kKEhec','Runtime\x20Skill\x20package\x20file\x20sha256\x20mismatch:\x20','base64','set','Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.','validation'];a148_0x39b7=function(){return _0x35dda3;};return a148_0x39b7();}export function localFilesToManifestFiles(_0x145738){const _0x324bb3=a148_0x24e7;return normalizeLocalFiles(_0x145738)[_0x324bb3(0x1c6)](_0x190694=>({'path':_0x190694['path'],'sha256':fileHash(_0x190694),'size':fileContent(_0x190694)[_0x324bb3(0x1b8)]}));}function normalizePackageManifest(_0x388ee4,_0x19f1bc){const _0x50f2f9=a148_0x24e7;if(!_0x388ee4||typeof _0x388ee4!==_0x50f2f9(0x1b6)||Array['isArray'](_0x388ee4))return undefined;const _0x5a4c5e=_0x388ee4,_0x2cd181=typeof _0x5a4c5e[_0x50f2f9(0x1cd)]===_0x50f2f9(0x1ce)?_0x5a4c5e[_0x50f2f9(0x1cd)][_0x50f2f9(0x1c4)]():undefined;if(_0x19f1bc[_0x50f2f9(0x1bb)]&&!_0x2cd181)return undefined;if(!Array['isArray'](_0x5a4c5e[_0x50f2f9(0x1b3)])||_0x5a4c5e[_0x50f2f9(0x1b3)]['length']===0x0)return undefined;if(!isSha256Hex(_0x5a4c5e['treeSha256']))throw CliErrors['validation'](_0x50f2f9(0x1ba));if(!isSha256Hex(_0x5a4c5e[_0x50f2f9(0x1b2)]))throw CliErrors['validation'](_0x50f2f9(0x1bd));if(!Number[_0x50f2f9(0x1bf)](_0x5a4c5e[_0x50f2f9(0x1c8)])||_0x5a4c5e['zipSize']<0x0)throw CliErrors['validation'](_0x50f2f9(0x1c5));const _0x477ba9=normalizeManifestFiles(_0x5a4c5e[_0x50f2f9(0x1b3)]);if(!_0x477ba9[_0x50f2f9(0x1c3)](_0x25699a=>_0x25699a[_0x50f2f9(0x1b5)]===SKILL_FILE))throw CliErrors[_0x50f2f9(0x1aa)]('Runtime\x20Skill\x20manifest\x20is\x20missing\x20'+SKILL_FILE+'.');const _0x341117=fileTreeHash(_0x477ba9);if(_0x341117!==_0x5a4c5e[_0x50f2f9(0x1c1)][_0x50f2f9(0x1c2)]())throw CliErrors['validation']('Runtime\x20Skill\x20file\x20tree\x20sha256\x20mismatch.');return{'schemaVersion':Number[_0x50f2f9(0x1bf)](_0x5a4c5e[_0x50f2f9(0x1af)])?_0x5a4c5e[_0x50f2f9(0x1af)]:0x2,'ossPath':_0x2cd181,'treeSha256':_0x341117,'zipSha256':_0x5a4c5e[_0x50f2f9(0x1b2)][_0x50f2f9(0x1c2)](),'zipSize':_0x5a4c5e['zipSize'],'files':_0x477ba9};}function extractAndVerifyPackage(_0x2f9012,_0x4f21ee){const _0x22f9e8=a148_0x24e7,_0x990d0d=normalizePackageManifest(_0x2f9012,{'requireOssPath':![]});if(!_0x990d0d)throw CliErrors[_0x22f9e8(0x1aa)]('Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.');if(_0x4f21ee[_0x22f9e8(0x1b8)]!==_0x990d0d['zipSize'])throw CliErrors[_0x22f9e8(0x1aa)](_0x22f9e8(0x1c7));const _0x38976d=bufferSha256(_0x4f21ee);if(_0x38976d!==_0x990d0d['zipSha256'])throw CliErrors[_0x22f9e8(0x1aa)]('Runtime\x20Skill\x20package\x20sha256\x20mismatch.');return extractAndVerifyPackageFiles(_0x990d0d,_0x4f21ee);}function extractAndVerifyPackageFiles(_0x3aee29,_0x34c875){const _0x48bc89=a148_0x24e7,_0x3151de=parseZipPackage(_0x34c875);if(_0x3151de[_0x48bc89(0x1b8)]!==_0x3aee29[_0x48bc89(0x1b3)]['length'])throw CliErrors[_0x48bc89(0x1aa)]('Runtime\x20Skill\x20package\x20entry\x20list\x20mismatch.');const _0x351837=new Map();for(const _0x5dff24 of _0x3151de){if(_0x351837[_0x48bc89(0x1ad)](_0x5dff24[_0x48bc89(0x1b5)]))throw CliErrors[_0x48bc89(0x1aa)](_0x48bc89(0x1bc)+_0x5dff24[_0x48bc89(0x1b5)]);_0x351837[_0x48bc89(0x1d3)](_0x5dff24[_0x48bc89(0x1b5)],_0x5dff24);}const _0xef56f1=[];for(const _0x42f3f5 of _0x3aee29[_0x48bc89(0x1b3)]){const _0x5bff27=_0x351837[_0x48bc89(0x1cb)](_0x42f3f5[_0x48bc89(0x1b5)]);if(!_0x5bff27)throw CliErrors[_0x48bc89(0x1aa)]('Runtime\x20Skill\x20package\x20is\x20missing\x20entry:\x20'+_0x42f3f5[_0x48bc89(0x1b5)]);if(_0x5bff27[_0x48bc89(0x1cc)][_0x48bc89(0x1b8)]!==_0x42f3f5['size'])throw CliErrors[_0x48bc89(0x1aa)](_0x48bc89(0x1b4)+_0x42f3f5['path']);const _0xd4361=bufferSha256(_0x5bff27[_0x48bc89(0x1cc)]);if(_0xd4361!==_0x42f3f5['sha256'])throw CliErrors[_0x48bc89(0x1aa)](_0x48bc89(0x1d1)+_0x42f3f5['path']);_0xef56f1['push']({'path':_0x42f3f5[_0x48bc89(0x1b5)],'bytes':_0x5bff27[_0x48bc89(0x1cc)]});}return normalizeLocalFiles(_0xef56f1);}
@@ -1 +1 @@
1
- (function(_0x4c9a7e,_0xa2462b){var _0x231ee4=a149_0x4268,_0x118cf4=_0x4c9a7e();while(!![]){try{var _0x428910=-parseInt(_0x231ee4(0xdf))/0x1+parseInt(_0x231ee4(0xe6))/0x2*(parseInt(_0x231ee4(0xe2))/0x3)+parseInt(_0x231ee4(0xe4))/0x4+parseInt(_0x231ee4(0xe3))/0x5*(-parseInt(_0x231ee4(0xe9))/0x6)+-parseInt(_0x231ee4(0xe7))/0x7+parseInt(_0x231ee4(0xe0))/0x8*(parseInt(_0x231ee4(0xe5))/0x9)+-parseInt(_0x231ee4(0xe1))/0xa*(-parseInt(_0x231ee4(0xe8))/0xb);if(_0x428910===_0xa2462b)break;else _0x118cf4['push'](_0x118cf4['shift']());}catch(_0x55d645){_0x118cf4['push'](_0x118cf4['shift']());}}}(a149_0x1f60,0x2ee87));export{contentHash,fileTreeHash}from'./runtime-skill-sync/hashing.js';export{linkEffectiveRuntimeSkills,linkGlobalRuntimeSkills,pruneStaleRuntimeSkillCache,pruneStaleRuntimeSkillLinks}from'./runtime-skill-sync/links.js';function a149_0x4268(_0x184e2c,_0x71fa64){_0x184e2c=_0x184e2c-0xdf;var _0x1f60fb=a149_0x1f60();var _0x4268c5=_0x1f60fb[_0x184e2c];return _0x4268c5;}export{resolveRuntimeSkillInstallTarget}from'./runtime-skill-sync/install-target.js';export{listLocalRuntimeSkills}from'./runtime-skill-sync/list-local.js';export{materializeRuntimeSkill,reuseMaterializedRuntimeSkill}from'./runtime-skill-sync/materialize.js';export{readMetadataIfPresent}from'./runtime-skill-sync/metadata.js';export{getRuntimeSkillCacheRoot,getRuntimeSkillDir,resolveSkillSyncPaths,runtimeAgentSkillRoots}from'./runtime-skill-sync/paths.js';export{deriveSkillCodeFromDirectory,readPushDirectory,refreshPushDirectoryMetadataFromRemote,recordPushedRuntimeSkill,resolvePushDirectoryIdentity}from'./runtime-skill-sync/push.js';export{buildSkillPackage,verifyRuntimeSkillBundle,verifyRuntimeSkillPackage}from'./runtime-skill-sync/zip-package.js';function a149_0x1f60(){var _0x2041f5=['4149oOuwHx','16hFWxpn','2016042MRxAOm','33fqQHjU','12imxlDk','86947ntSYuy','1528jkiFLX','752470kWepCo','109854BiQeBN','339695QqvpaI','384920KSIaBR'];a149_0x1f60=function(){return _0x2041f5;};return a149_0x1f60();}
1
+ (function(_0x153acf,_0x2fa787){var _0x12673a=a149_0x42a3,_0x364a59=_0x153acf();while(!![]){try{var _0x2a193d=-parseInt(_0x12673a(0x14b))/0x1+parseInt(_0x12673a(0x14a))/0x2*(parseInt(_0x12673a(0x144))/0x3)+parseInt(_0x12673a(0x147))/0x4+parseInt(_0x12673a(0x149))/0x5*(-parseInt(_0x12673a(0x148))/0x6)+-parseInt(_0x12673a(0x146))/0x7+-parseInt(_0x12673a(0x145))/0x8*(parseInt(_0x12673a(0x14d))/0x9)+-parseInt(_0x12673a(0x14e))/0xa*(-parseInt(_0x12673a(0x14c))/0xb);if(_0x2a193d===_0x2fa787)break;else _0x364a59['push'](_0x364a59['shift']());}catch(_0x98f938){_0x364a59['push'](_0x364a59['shift']());}}}(a149_0x25bc,0x1903e));export{contentHash,fileTreeHash}from'./runtime-skill-sync/hashing.js';export{linkEffectiveRuntimeSkills,linkGlobalRuntimeSkills,pruneStaleRuntimeSkillCache,pruneStaleRuntimeSkillLinks}from'./runtime-skill-sync/links.js';function a149_0x25bc(){var _0x5ebdd8=['36sRcHjU','23570teVhVr','142011DXjfvj','151264hDNSrJ','461797buTXQc','806200hJAQgX','90QUTlyM','9505jdEZDr','4jSIlsy','30715HnZGrT','33OrtJgo'];a149_0x25bc=function(){return _0x5ebdd8;};return a149_0x25bc();}export{resolveRuntimeSkillInstallTarget}from'./runtime-skill-sync/install-target.js';export{listLocalRuntimeSkills}from'./runtime-skill-sync/list-local.js';export{materializeRuntimeSkill,reuseMaterializedRuntimeSkill}from'./runtime-skill-sync/materialize.js';function a149_0x42a3(_0x5dc5e3,_0x3dcc20){_0x5dc5e3=_0x5dc5e3-0x144;var _0x25bcce=a149_0x25bc();var _0x42a358=_0x25bcce[_0x5dc5e3];return _0x42a358;}export{readMetadataIfPresent}from'./runtime-skill-sync/metadata.js';export{getRuntimeSkillCacheRoot,getRuntimeSkillDir,resolveSkillSyncPaths,runtimeAgentSkillRoots}from'./runtime-skill-sync/paths.js';export{deriveSkillCodeFromDirectory,readPushDirectory,refreshPushDirectoryMetadataFromRemote,recordPushedRuntimeSkill,resolvePushDirectoryIdentity}from'./runtime-skill-sync/push.js';export{buildSkillPackage,verifyRuntimeSkillBundle,verifyRuntimeSkillPackage}from'./runtime-skill-sync/zip-package.js';