@lovrabet/lovrabet-cli 2.3.0-beta.6 → 2.3.0

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
- const a134_0x19dbfe=a134_0x3670;(function(_0x24a612,_0x22a59d){const _0x2e64eb=a134_0x3670,_0x5d55c4=_0x24a612();while(!![]){try{const _0x599380=-parseInt(_0x2e64eb(0x84))/0x1*(parseInt(_0x2e64eb(0x92))/0x2)+parseInt(_0x2e64eb(0x87))/0x3*(parseInt(_0x2e64eb(0x8e))/0x4)+-parseInt(_0x2e64eb(0x7f))/0x5*(parseInt(_0x2e64eb(0x89))/0x6)+-parseInt(_0x2e64eb(0x8f))/0x7+parseInt(_0x2e64eb(0x91))/0x8*(parseInt(_0x2e64eb(0x8d))/0x9)+-parseInt(_0x2e64eb(0x81))/0xa+-parseInt(_0x2e64eb(0x88))/0xb*(-parseInt(_0x2e64eb(0x86))/0xc);if(_0x599380===_0x22a59d)break;else _0x5d55c4['push'](_0x5d55c4['shift']());}catch(_0x32f255){_0x5d55c4['push'](_0x5d55c4['shift']());}}}(a134_0x2677,0x964a6));function a134_0x3670(_0x407231,_0x3a6563){_0x407231=_0x407231-0x7f;const _0x267775=a134_0x2677();let _0x3670b5=_0x267775[_0x407231];return _0x3670b5;}export const METADATA_FILE=a134_0x19dbfe(0x83);function a134_0x2677(){const _0x2a3b08=['dist','.cache','9wKvitM','176TqzXbe','6247941ycZWVD','build','1980672umDSbJ','129244Mectzy','.turbo','.DS_Store','12280UfGBYe','.svn','8741310WbjVaC','.next','lovrabet.skill.json','1DmHgWk','.git','72IrdgAz','46365Hipxtu','3055547VjWDde','360LEKVXW','coverage'];a134_0x2677=function(){return _0x2a3b08;};return a134_0x2677();}export const SKILL_FILE='SKILL.md';export const IGNORED_FILE_NAMES=new Set([METADATA_FILE,a134_0x19dbfe(0x94)]);export const IGNORED_DIR_NAMES=new Set([a134_0x19dbfe(0x85),'.hg',a134_0x19dbfe(0x80),'node_modules',a134_0x19dbfe(0x82),a134_0x19dbfe(0x8b),a134_0x19dbfe(0x90),a134_0x19dbfe(0x8a),a134_0x19dbfe(0x93),a134_0x19dbfe(0x8c)]);
1
+ const a134_0x559e2e=a134_0x2ff1;function a134_0x2271(){const _0x1634ab=['12AjWJfz','.next','839249Pcxoyl','77aIEcxS','.hg','.DS_Store','.turbo','SKILL.md','.git','5797745lLWvJj','lovrabet.skill.json','build','.cache','.svn','885672PcuRCT','dist','2393262mAyGdE','node_modules','7902054tXHxQN','497151WqAytu','coverage','1504776HXYcUf'];a134_0x2271=function(){return _0x1634ab;};return a134_0x2271();}function a134_0x2ff1(_0x539be3,_0x42ba9b){_0x539be3=_0x539be3-0x1a4;const _0x227154=a134_0x2271();let _0x2ff10a=_0x227154[_0x539be3];return _0x2ff10a;}(function(_0x20be9f,_0x49b002){const _0x3cddfe=a134_0x2ff1,_0x5679c6=_0x20be9f();while(!![]){try{const _0x5612b3=-parseInt(_0x3cddfe(0x1b7))/0x1+-parseInt(_0x3cddfe(0x1b5))/0x2*(-parseInt(_0x3cddfe(0x1b2))/0x3)+-parseInt(_0x3cddfe(0x1b4))/0x4+parseInt(_0x3cddfe(0x1a8))/0x5+parseInt(_0x3cddfe(0x1b1))/0x6+parseInt(_0x3cddfe(0x1b8))/0x7*(-parseInt(_0x3cddfe(0x1ad))/0x8)+-parseInt(_0x3cddfe(0x1af))/0x9;if(_0x5612b3===_0x49b002)break;else _0x5679c6['push'](_0x5679c6['shift']());}catch(_0x2d8e96){_0x5679c6['push'](_0x5679c6['shift']());}}}(a134_0x2271,0xbc674));export const METADATA_FILE=a134_0x559e2e(0x1a9);export const SKILL_FILE=a134_0x559e2e(0x1a6);export const IGNORED_FILE_NAMES=new Set([METADATA_FILE,a134_0x559e2e(0x1a4)]);export const IGNORED_DIR_NAMES=new Set([a134_0x559e2e(0x1a7),a134_0x559e2e(0x1b9),a134_0x559e2e(0x1ac),a134_0x559e2e(0x1b0),a134_0x559e2e(0x1b6),a134_0x559e2e(0x1ae),a134_0x559e2e(0x1aa),a134_0x559e2e(0x1b3),a134_0x559e2e(0x1a5),a134_0x559e2e(0x1ab)]);
@@ -1 +1 @@
1
- (function(_0x4f5cfe,_0x31bebf){const _0x2dc2f9=a135_0x1d16,_0x900743=_0x4f5cfe();while(!![]){try{const _0x4584c7=-parseInt(_0x2dc2f9(0xfa))/0x1+-parseInt(_0x2dc2f9(0x100))/0x2+-parseInt(_0x2dc2f9(0xf6))/0x3+parseInt(_0x2dc2f9(0xf7))/0x4*(-parseInt(_0x2dc2f9(0xf8))/0x5)+parseInt(_0x2dc2f9(0x105))/0x6*(parseInt(_0x2dc2f9(0xfb))/0x7)+-parseInt(_0x2dc2f9(0x104))/0x8*(-parseInt(_0x2dc2f9(0xfd))/0x9)+-parseInt(_0x2dc2f9(0x106))/0xa*(-parseInt(_0x2dc2f9(0x103))/0xb);if(_0x4584c7===_0x31bebf)break;else _0x900743['push'](_0x900743['shift']());}catch(_0x56b96d){_0x900743['push'](_0x900743['shift']());}}}(a135_0x2e1a,0x32db9));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(_0x5cfbfc,_0xca78cb){const _0x25a405=a135_0x1d16,_0x298511=normalizeSkillRelativePath(_0xca78cb),_0x3cbebd=realOrResolved(_0x5cfbfc),_0x1d11a1=resolve(_0x3cbebd,..._0x298511[_0x25a405(0xfc)]('/'));if(!isPathInside(_0x1d11a1,_0x3cbebd))throw CliErrors[_0x25a405(0xf3)]('Unsafe\x20Skill\x20file\x20path:\x20'+_0xca78cb);return ensureNoSymlinkInManagedPath(_0x3cbebd,_0x298511),_0x1d11a1;}function a135_0x1d16(_0x260a38,_0x3f554c){_0x260a38=_0x260a38-0xf3;const _0x2e1a7d=a135_0x2e1a();let _0x1d16d6=_0x2e1a7d[_0x260a38];return _0x1d16d6;}export function ensureNoSymlinkInManagedPath(_0x59a391,_0x40f56d){const _0x582ab6=a135_0x1d16;let _0x32bb5e=_0x59a391;for(const _0x291624 of _0x40f56d['split']('/')){_0x32bb5e=resolve(_0x32bb5e,_0x291624);const _0x551f37=lstatIfPresent(_0x32bb5e);if(_0x551f37?.[_0x582ab6(0xf5)]())throw CliErrors[_0x582ab6(0xf3)](_0x582ab6(0x102)+_0x40f56d);}}export function isDanglingSymlink(_0x26b847){try{return lstatSync(_0x26b847)['isSymbolicLink']();}catch{return![];}}export function resolveSymlinkTarget(_0xe6a825){const _0x1cd4dd=readlinkSync(_0xe6a825);return isAbsolute(_0x1cd4dd)?_0x1cd4dd:resolve(dirname(_0xe6a825),_0x1cd4dd);}export function isPathInside(_0x276944,_0x46bc23){const _0x8ff39e=a135_0x1d16,_0x507829=_0x276944['endsWith'](sep)?_0x276944:''+_0x276944+sep,_0x36f3e5=_0x46bc23[_0x8ff39e(0xf4)](sep)?_0x46bc23:''+_0x46bc23+sep;return _0x276944===_0x46bc23||_0x507829[_0x8ff39e(0xfe)](_0x36f3e5);}export function realOrResolved(_0x53bf5f){try{return realpathSync(_0x53bf5f);}catch{return resolve(_0x53bf5f);}}function a135_0x2e1a(){const _0x558d3d=['2956275Wshymu','startsWith','utf8','560412VhkhEi','.tmp','Refusing\x20to\x20write\x20through\x20Skill\x20symlink\x20path:\x20','3037089uoHeLF','8uBqmkG','156378rsIMzj','10gAixWt','validation','endsWith','isSymbolicLink','779301DOELIs','100388GKaOzr','35mEHxrh','from','19428ntprOx','91AQWNlH','split'];a135_0x2e1a=function(){return _0x558d3d;};return a135_0x2e1a();}export function lstatIfPresent(_0x42beb3){try{return lstatSync(_0x42beb3);}catch{return undefined;}}export function writeTextAtomic(_0x561ba2,_0x79da14,_0x74d3d8){const _0x56704b=a135_0x1d16;writeBytesAtomic(_0x561ba2,Buffer[_0x56704b(0xf9)](_0x79da14,_0x56704b(0xff)),_0x74d3d8);}export function writeBytesAtomic(_0x144063,_0x144d7e,_0x1213c9){const _0x31a8d6=a135_0x1d16,_0x4a9daf=_0x144063+_0x31a8d6(0x101);try{writeFileSync(_0x4a9daf,_0x144d7e,{'mode':_0x1213c9}),renameSync(_0x4a9daf,_0x144063);}catch(_0xcea32){try{rmSync(_0x4a9daf,{'force':!![]});}catch{}throw _0xcea32;}}export function writeJsonAtomic(_0x578e02,_0x6a03c2){writeTextAtomic(_0x578e02,JSON['stringify'](_0x6a03c2,null,0x2)+'\x0a',0x180);}
1
+ (function(_0x3d8862,_0x300a22){const _0x2c1b15=a135_0x7dba,_0x49d4c8=_0x3d8862();while(!![]){try{const _0xff56d7=parseInt(_0x2c1b15(0x1f3))/0x1*(-parseInt(_0x2c1b15(0x1ee))/0x2)+parseInt(_0x2c1b15(0x1e9))/0x3+-parseInt(_0x2c1b15(0x1f2))/0x4*(-parseInt(_0x2c1b15(0x1fd))/0x5)+-parseInt(_0x2c1b15(0x1ec))/0x6+-parseInt(_0x2c1b15(0x1f6))/0x7*(parseInt(_0x2c1b15(0x1f0))/0x8)+parseInt(_0x2c1b15(0x1eb))/0x9*(parseInt(_0x2c1b15(0x1fa))/0xa)+parseInt(_0x2c1b15(0x1fe))/0xb;if(_0xff56d7===_0x300a22)break;else _0x49d4c8['push'](_0x49d4c8['shift']());}catch(_0x27185d){_0x49d4c8['push'](_0x49d4c8['shift']());}}}(a135_0x4b2f,0x6c031));import{lstatSync,readlinkSync,realpathSync,renameSync,rmSync,writeFileSync}from'node:fs';import{dirname,isAbsolute,resolve,sep}from'node:path';import{CliErrors}from'../../errors.js';function a135_0x4b2f(){const _0x55a697=['1635237VrnQLN','2847228gLEaOO','endsWith','86kcHPsd','validation','32ejqRtz','.tmp','4moVvbp','12093mFNxYG','Refusing\x20to\x20write\x20through\x20Skill\x20symlink\x20path:\x20','from','171794bCtYOn','startsWith','utf8','stringify','20VFLfuO','Unsafe\x20Skill\x20file\x20path:\x20','isSymbolicLink','849025RfYVcY','9399269KtkJVm','442356WIXfoZ','split'];a135_0x4b2f=function(){return _0x55a697;};return a135_0x4b2f();}import{normalizeSkillRelativePath}from'./local-files.js';export function resolveManagedFilePath(_0x53a1cb,_0x517c48){const _0x1f475e=a135_0x7dba,_0x347714=normalizeSkillRelativePath(_0x517c48),_0x434668=realOrResolved(_0x53a1cb),_0x29cea4=resolve(_0x434668,..._0x347714[_0x1f475e(0x1ea)]('/'));if(!isPathInside(_0x29cea4,_0x434668))throw CliErrors[_0x1f475e(0x1ef)](_0x1f475e(0x1fb)+_0x517c48);return ensureNoSymlinkInManagedPath(_0x434668,_0x347714),_0x29cea4;}function a135_0x7dba(_0x110284,_0x378030){_0x110284=_0x110284-0x1e9;const _0x4b2f3d=a135_0x4b2f();let _0x7dba3d=_0x4b2f3d[_0x110284];return _0x7dba3d;}export function ensureNoSymlinkInManagedPath(_0x56629d,_0x446417){const _0x10f155=a135_0x7dba;let _0x2a8a8c=_0x56629d;for(const _0x2b2350 of _0x446417[_0x10f155(0x1ea)]('/')){_0x2a8a8c=resolve(_0x2a8a8c,_0x2b2350);const _0x2c9162=lstatIfPresent(_0x2a8a8c);if(_0x2c9162?.['isSymbolicLink']())throw CliErrors[_0x10f155(0x1ef)](_0x10f155(0x1f4)+_0x446417);}}export function isDanglingSymlink(_0x3890bb){const _0x5ae033=a135_0x7dba;try{return lstatSync(_0x3890bb)[_0x5ae033(0x1fc)]();}catch{return![];}}export function resolveSymlinkTarget(_0xc12404){const _0x5a0bcc=readlinkSync(_0xc12404);return isAbsolute(_0x5a0bcc)?_0x5a0bcc:resolve(dirname(_0xc12404),_0x5a0bcc);}export function isPathInside(_0x3a81c9,_0x19fe71){const _0x12b61d=a135_0x7dba,_0x3dad42=_0x3a81c9[_0x12b61d(0x1ed)](sep)?_0x3a81c9:''+_0x3a81c9+sep,_0x4839a8=_0x19fe71[_0x12b61d(0x1ed)](sep)?_0x19fe71:''+_0x19fe71+sep;return _0x3a81c9===_0x19fe71||_0x3dad42[_0x12b61d(0x1f7)](_0x4839a8);}export function realOrResolved(_0x319afb){try{return realpathSync(_0x319afb);}catch{return resolve(_0x319afb);}}export function lstatIfPresent(_0xdf2bcc){try{return lstatSync(_0xdf2bcc);}catch{return undefined;}}export function writeTextAtomic(_0x1249bf,_0x5807e9,_0x1f1b5a){const _0x403c5a=a135_0x7dba;writeBytesAtomic(_0x1249bf,Buffer[_0x403c5a(0x1f5)](_0x5807e9,_0x403c5a(0x1f8)),_0x1f1b5a);}export function writeBytesAtomic(_0x11695a,_0x570f01,_0xf003e2){const _0x1bd6b9=a135_0x7dba,_0x1489f8=_0x11695a+_0x1bd6b9(0x1f1);try{writeFileSync(_0x1489f8,_0x570f01,{'mode':_0xf003e2}),renameSync(_0x1489f8,_0x11695a);}catch(_0x14d1b0){try{rmSync(_0x1489f8,{'force':!![]});}catch{}throw _0x14d1b0;}}export function writeJsonAtomic(_0x20e0c6,_0x28d7e3){const _0x419de4=a135_0x7dba;writeTextAtomic(_0x20e0c6,JSON[_0x419de4(0x1f9)](_0x28d7e3,null,0x2)+'\x0a',0x180);}
@@ -1 +1 @@
1
- (function(_0x18e005,_0x4f9bc9){const _0x57010=a136_0x1149,_0x257d20=_0x18e005();while(!![]){try{const _0x58555b=-parseInt(_0x57010(0x66))/0x1*(-parseInt(_0x57010(0x74))/0x2)+-parseInt(_0x57010(0x71))/0x3*(-parseInt(_0x57010(0x72))/0x4)+-parseInt(_0x57010(0x76))/0x5*(parseInt(_0x57010(0x6e))/0x6)+-parseInt(_0x57010(0x6c))/0x7*(-parseInt(_0x57010(0x75))/0x8)+-parseInt(_0x57010(0x6a))/0x9+-parseInt(_0x57010(0x73))/0xa+parseInt(_0x57010(0x6d))/0xb;if(_0x58555b===_0x4f9bc9)break;else _0x257d20['push'](_0x257d20['shift']());}catch(_0x34f370){_0x257d20['push'](_0x257d20['shift']());}}}(a136_0x1491,0x1c344));import{createHash}from'node:crypto';function a136_0x1149(_0x67c1a,_0x467ce9){_0x67c1a=_0x67c1a-0x66;const _0x14913c=a136_0x1491();let _0x114915=_0x14913c[_0x67c1a];return _0x114915;}import{fileContent,normalizeManifestFiles}from'./local-files.js';export function contentHash(_0x21dbff){const _0x5bec2d=a136_0x1149;return createHash(_0x5bec2d(0x6f))['update'](_0x21dbff)[_0x5bec2d(0x69)](_0x5bec2d(0x6b));}function a136_0x1491(){const _0x19e6cd=['7YGmAFI','694804xIIjfR','6414JKifQx','sha256','update','9ZrfHHK','12708TQiXjE','41860lfdnSd','2KFObzE','1675232RDjwdy','1020VWtkEL','121289VTkpev','path','size','digest','590418mnaYYM','hex'];a136_0x1491=function(){return _0x19e6cd;};return a136_0x1491();}export function fileHash(_0x1fbf78){return bufferSha256(fileContent(_0x1fbf78));}export function bufferSha256(_0x42aa3d){return createHash('sha256')['update'](_0x42aa3d)['digest']('hex');}export function fileTreeHash(_0x4e2012){const _0x134c2e=a136_0x1149,_0x993834=createHash(_0x134c2e(0x6f));for(const _0x2f70fb of normalizeManifestFiles(_0x4e2012)){_0x993834[_0x134c2e(0x70)](_0x2f70fb[_0x134c2e(0x67)]),_0x993834[_0x134c2e(0x70)]('\x00'),_0x993834[_0x134c2e(0x70)](_0x2f70fb[_0x134c2e(0x6f)]),_0x993834[_0x134c2e(0x70)]('\x00'),_0x993834['update'](String(_0x2f70fb[_0x134c2e(0x68)])),_0x993834[_0x134c2e(0x70)]('\x00');}return _0x993834['digest']('hex');}
1
+ (function(_0x5cb072,_0x40baf3){const _0x4181b9=a136_0x17f4,_0x5cdd09=_0x5cb072();while(!![]){try{const _0x5e5f58=parseInt(_0x4181b9(0xf2))/0x1+-parseInt(_0x4181b9(0xe4))/0x2*(-parseInt(_0x4181b9(0xf4))/0x3)+-parseInt(_0x4181b9(0xeb))/0x4*(-parseInt(_0x4181b9(0xf0))/0x5)+-parseInt(_0x4181b9(0xe8))/0x6*(parseInt(_0x4181b9(0xe9))/0x7)+-parseInt(_0x4181b9(0xef))/0x8+parseInt(_0x4181b9(0xec))/0x9*(parseInt(_0x4181b9(0xee))/0xa)+-parseInt(_0x4181b9(0xea))/0xb;if(_0x5e5f58===_0x40baf3)break;else _0x5cdd09['push'](_0x5cdd09['shift']());}catch(_0x46f908){_0x5cdd09['push'](_0x5cdd09['shift']());}}}(a136_0x87db,0xea5b1));import{createHash}from'node:crypto';import{fileContent,normalizeManifestFiles}from'./local-files.js';function a136_0x17f4(_0x771dc6,_0x343169){_0x771dc6=_0x771dc6-0xe4;const _0x87db81=a136_0x87db();let _0x17f416=_0x87db81[_0x771dc6];return _0x17f416;}export function contentHash(_0x577fec){const _0x5a4cb3=a136_0x17f4;return createHash(_0x5a4cb3(0xe6))[_0x5a4cb3(0xed)](_0x577fec)[_0x5a4cb3(0xf3)](_0x5a4cb3(0xe7));}export function fileHash(_0x3634b0){return bufferSha256(fileContent(_0x3634b0));}function a136_0x87db(){const _0x195cd6=['digest','33yaYdYf','128846EvttlF','path','sha256','hex','3672534ohzEyi','7QoLkCW','12208075WSuYth','60508yHkJAx','9JWVUvH','update','16973130GgJBST','11901168AryZuj','260WSKOyP','size','976911HrnbtT'];a136_0x87db=function(){return _0x195cd6;};return a136_0x87db();}export function bufferSha256(_0x49c9fe){const _0x52663e=a136_0x17f4;return createHash('sha256')[_0x52663e(0xed)](_0x49c9fe)[_0x52663e(0xf3)]('hex');}export function fileTreeHash(_0xedfc31){const _0x587bf4=a136_0x17f4,_0x45ef73=createHash('sha256');for(const _0x1f84af of normalizeManifestFiles(_0xedfc31)){_0x45ef73[_0x587bf4(0xed)](_0x1f84af[_0x587bf4(0xe5)]),_0x45ef73['update']('\x00'),_0x45ef73[_0x587bf4(0xed)](_0x1f84af[_0x587bf4(0xe6)]),_0x45ef73[_0x587bf4(0xed)]('\x00'),_0x45ef73['update'](String(_0x1f84af[_0x587bf4(0xf1)])),_0x45ef73[_0x587bf4(0xed)]('\x00');}return _0x45ef73[_0x587bf4(0xf3)]('hex');}
@@ -1 +1 @@
1
- function a137_0x7adf(_0x4a2223,_0xf0ba35){_0x4a2223=_0x4a2223-0x1f4;const _0xe60d1d=a137_0xe60d();let _0x7adfc=_0xe60d1d[_0x4a2223];return _0x7adfc;}function a137_0xe60d(){const _0x1532dd=['project','1436LMELly','13991700kaSyzZ','263406DARLeL','450EdCXDD','37244durOHb','16PgqwVm','552150Mxvcem','78eyVHiP','appCode','global','managedRoot','.agents','skills','cwd','1119839xoGnei','284740ZTCYzA'];a137_0xe60d=function(){return _0x1532dd;};return a137_0xe60d();}const a137_0x44825e=a137_0x7adf;(function(_0x3ca448,_0x3170d9){const _0x31bb4e=a137_0x7adf,_0x4d232a=_0x3ca448();while(!![]){try{const _0x185f6d=-parseInt(_0x31bb4e(0x1fa))/0x1+parseInt(_0x31bb4e(0x200))/0x2*(-parseInt(_0x31bb4e(0x203))/0x3)+parseInt(_0x31bb4e(0x1fc))/0x4*(-parseInt(_0x31bb4e(0x1ff))/0x5)+parseInt(_0x31bb4e(0x1fe))/0x6+-parseInt(_0x31bb4e(0x1f9))/0x7*(parseInt(_0x31bb4e(0x201))/0x8)+-parseInt(_0x31bb4e(0x202))/0x9+parseInt(_0x31bb4e(0x1fd))/0xa;if(_0x185f6d===_0x3170d9)break;else _0x4d232a['push'](_0x4d232a['shift']());}catch(_0x15d045){_0x4d232a['push'](_0x4d232a['shift']());}}}(a137_0xe60d,0x3f9c1));import{resolve}from'node:path';import{resolveSkillSyncPaths,runtimeAgentSkillRoots,safePathSegment}from'./paths.js';export function resolveRuntimeSkillInstallTarget(_0x3ce809,_0x4bbde7=a137_0x44825e(0x1f4),_0x1fc05b={}){const _0x1f248b=a137_0x44825e,_0x3ad750=resolveSkillSyncPaths(_0x1fc05b),_0x240251=safePathSegment(_0x3ce809,_0x1f248b(0x204)),_0x98bff=_0x4bbde7===_0x1f248b(0x1fb)?[resolve(_0x1fc05b[_0x1f248b(0x1f8)]??process[_0x1f248b(0x1f8)](),_0x1f248b(0x1f6),_0x1f248b(0x1f7))]:runtimeAgentSkillRoots(_0x3ad750);return Object['freeze']({'scope':_0x4bbde7,'appCode':_0x240251,'skillRoots':Object['freeze'](_0x98bff),'managedRoot':_0x3ad750[_0x1f248b(0x1f5)]});}
1
+ const a137_0xc26423=a137_0x1cf6;(function(_0x4ee45e,_0x2784e7){const _0x5f20a8=a137_0x1cf6,_0x52e966=_0x4ee45e();while(!![]){try{const _0x5c3cf3=parseInt(_0x5f20a8(0x10d))/0x1*(-parseInt(_0x5f20a8(0xff))/0x2)+-parseInt(_0x5f20a8(0x109))/0x3+-parseInt(_0x5f20a8(0x10e))/0x4*(-parseInt(_0x5f20a8(0x100))/0x5)+-parseInt(_0x5f20a8(0x10c))/0x6+parseInt(_0x5f20a8(0x103))/0x7*(-parseInt(_0x5f20a8(0xfe))/0x8)+parseInt(_0x5f20a8(0x102))/0x9+parseInt(_0x5f20a8(0x104))/0xa*(parseInt(_0x5f20a8(0x107))/0xb);if(_0x5c3cf3===_0x2784e7)break;else _0x52e966['push'](_0x52e966['shift']());}catch(_0x1f1b23){_0x52e966['push'](_0x52e966['shift']());}}}(a137_0x4428,0x34a78));import{resolve}from'node:path';function a137_0x1cf6(_0xc16e76,_0x333b2e){_0xc16e76=_0xc16e76-0xfe;const _0x442896=a137_0x4428();let _0x1cf636=_0x442896[_0xc16e76];return _0x1cf636;}import{resolveSkillSyncPaths,runtimeAgentSkillRoots,safePathSegment}from'./paths.js';function a137_0x4428(){const _0x253c30=['freeze','2812923wgPKhK','2114tWaYVd','10uvofKK','.agents','global','9291238ciHQDz','skills','30903NabYtg','appCode','project','2511714LrVlZn','10DeMoNT','10732JVrBRH','cwd','7064cNNNuD','81922TYSiZR','305dqQcsg'];a137_0x4428=function(){return _0x253c30;};return a137_0x4428();}export function resolveRuntimeSkillInstallTarget(_0x5d0350,_0x673fe9=a137_0xc26423(0x106),_0x18fe60={}){const _0x828b10=a137_0xc26423,_0x1d59eb=resolveSkillSyncPaths(_0x18fe60),_0x41da14=safePathSegment(_0x5d0350,_0x828b10(0x10a)),_0x4c44bd=_0x673fe9===_0x828b10(0x10b)?[resolve(_0x18fe60['cwd']??process[_0x828b10(0x10f)](),_0x828b10(0x105),_0x828b10(0x108))]:runtimeAgentSkillRoots(_0x1d59eb);return Object[_0x828b10(0x101)]({'scope':_0x673fe9,'appCode':_0x41da14,'skillRoots':Object[_0x828b10(0x101)](_0x4c44bd),'managedRoot':_0x1d59eb['managedRoot']});}
@@ -1 +1 @@
1
- const a138_0xf6c9f7=a138_0x33e4;(function(_0x118999,_0x58f304){const _0x602b55=a138_0x33e4,_0x4b5842=_0x118999();while(!![]){try{const _0x2432bc=parseInt(_0x602b55(0xb5))/0x1*(parseInt(_0x602b55(0xb1))/0x2)+-parseInt(_0x602b55(0x97))/0x3+parseInt(_0x602b55(0xb6))/0x4+parseInt(_0x602b55(0xa7))/0x5+parseInt(_0x602b55(0x8d))/0x6*(-parseInt(_0x602b55(0x86))/0x7)+-parseInt(_0x602b55(0xb2))/0x8+parseInt(_0x602b55(0xa9))/0x9*(parseInt(_0x602b55(0x8e))/0xa);if(_0x2432bc===_0x58f304)break;else _0x4b5842['push'](_0x4b5842['shift']());}catch(_0x367aa7){_0x4b5842['push'](_0x4b5842['shift']());}}}(a138_0x56bb,0x3a834));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import a138_0x37d3c5 from'fs-extra';function a138_0x33e4(_0x5e14ec,_0x379e10){_0x5e14ec=_0x5e14ec-0x81;const _0x56bb87=a138_0x56bb();let _0x33e493=_0x56bb87[_0x5e14ec];return _0x33e493;}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_0x37d3c5,RESERVED_PROJECT_SKILL_CODES=new Set([a138_0xf6c9f7(0x87),a138_0xf6c9f7(0x8c),'secret-retriever']);export function linkEffectiveRuntimeSkills(_0x406f76,_0x3f443a){const _0x2ff86d=a138_0xf6c9f7,_0x1445c8=new Map();for(const _0x1ece20 of _0x406f76){const _0x9400c5=_0x1ece20[_0x2ff86d(0x81)][_0x2ff86d(0x83)];if(!_0x9400c5)continue;const _0x257a93=_0x1445c8[_0x2ff86d(0xae)](_0x9400c5);(!_0x257a93||_0x1ece20[_0x2ff86d(0x9a)]===_0x2ff86d(0x8f))&&_0x1445c8[_0x2ff86d(0x9e)](_0x9400c5,_0x1ece20);}const _0x5e34ab=[];for(const _0x1793e0 of _0x1445c8[_0x2ff86d(0x93)]()){const _0xe370c=requireSkillCode(_0x1793e0[_0x2ff86d(0x81)]),_0x21d4e6=readMetadataIfPresent(_0x1793e0[_0x2ff86d(0x85)]);if(_0x21d4e6?.[_0x2ff86d(0xaf)]!==_0x3f443a[_0x2ff86d(0xaf)]||_0x21d4e6['skillCode']!==_0xe370c)throw CliErrors[_0x2ff86d(0xa3)](_0x2ff86d(0x9c)+_0x3f443a[_0x2ff86d(0xaf)]+':\x20'+_0x1793e0[_0x2ff86d(0x85)]);const _0x1555ce=runtimeSkillLinkName(_0x3f443a,_0xe370c);for(const _0x2d78ff of _0x3f443a[_0x2ff86d(0xad)]){_0x5e34ab[_0x2ff86d(0x96)](ensureManagedSymlink(resolve(_0x2d78ff,_0x1555ce),_0x1793e0[_0x2ff86d(0xaa)],_0x3f443a,_0xe370c));}}return _0x5e34ab;}export function pruneStaleRuntimeSkillLinks(_0x4b515c,_0x59d4c0,_0x44aab6){const _0x6f90f2=a138_0xf6c9f7,_0x42543d=new Set([..._0x59d4c0][_0x6f90f2(0x9f)](_0x212f59=>_0x212f59[_0x6f90f2(0x90)]())[_0x6f90f2(0x89)](Boolean)),_0x520e81=_0x44aab6?new Set([..._0x44aab6][_0x6f90f2(0x9f)](_0x3dbf96=>_0x3dbf96[_0x6f90f2(0x90)]())[_0x6f90f2(0x89)](Boolean)):undefined,_0x208dc7=[];for(const _0x2621e8 of _0x4b515c[_0x6f90f2(0xad)]){for(const _0x1c0344 of managedTargetSkillLinkPaths(_0x2621e8,_0x4b515c)){const _0x422ceb=runtimeSkillCodeFromLink(_0x4b515c,_0x1c0344);if(_0x520e81&&!_0x520e81[_0x6f90f2(0x8b)](_0x422ceb))continue;if(_0x42543d[_0x6f90f2(0x8b)](_0x422ceb))continue;_0x208dc7[_0x6f90f2(0x96)](removeManagedSkillLink(_0x1c0344,_0x4b515c,_0x422ceb));}}return _0x208dc7;}export function pruneStaleRuntimeSkillCache(_0x2215d3,_0x37d237={}){const _0x2fe329=a138_0xf6c9f7,_0x4792e2=new Set([..._0x2215d3['activeSkillCodes']][_0x2fe329(0x9f)](_0x2557c9=>_0x2557c9['trim']())[_0x2fe329(0x89)](Boolean)),_0x5a998d=_0x2215d3['pruneSkillCodes']?new Set([..._0x2215d3[_0x2fe329(0xb0)]][_0x2fe329(0x9f)](_0x6c198=>_0x6c198['trim']())['filter'](Boolean)):undefined,_0x18f1bd=_0x2215d3[_0x2fe329(0xa5)]??['personal',_0x2fe329(0x98)],_0x245f50=resolve(getRuntimeSkillCacheRoot(_0x2215d3[_0x2fe329(0xb9)],_0x2215d3[_0x2fe329(0xb8)],_0x37d237),safePathSegment(_0x2215d3[_0x2fe329(0xaf)],_0x2fe329(0xaf))),_0x50e936=[];for(const _0x491c83 of _0x18f1bd){const _0x5110c2=resolve(_0x245f50,_0x491c83);if(!existsSync(_0x5110c2))continue;for(const _0x7aabb of readdirSync(_0x5110c2,{'withFileTypes':!![]})){if(!_0x7aabb[_0x2fe329(0xb7)]())continue;const _0x3a58d3=_0x7aabb[_0x2fe329(0x9d)];if(_0x5a998d&&!_0x5a998d['has'](_0x3a58d3))continue;if(_0x4792e2[_0x2fe329(0x8b)](_0x3a58d3))continue;const _0x51ca75=resolve(_0x5110c2,_0x3a58d3),_0x366c58=readMetadataIfPresent(resolve(_0x51ca75,METADATA_FILE));if(_0x366c58?.[_0x2fe329(0xaf)]!==_0x2215d3[_0x2fe329(0xaf)]||_0x366c58['scope']!==_0x491c83||_0x366c58[_0x2fe329(0x83)]!==_0x3a58d3){_0x50e936[_0x2fe329(0x96)]({'path':_0x51ca75,'action':_0x2fe329(0x8a),'reason':'metadata-mismatch'});continue;}if(isLinkedFromAnyRoot(_0x51ca75,_0x2215d3['protectedLinkRoots']??[])){_0x50e936[_0x2fe329(0x96)]({'path':_0x51ca75,'action':_0x2fe329(0x8a),'reason':'linked-from-protected-root'});continue;}removeSync(_0x51ca75),_0x50e936[_0x2fe329(0x96)]({'path':_0x51ca75,'action':_0x2fe329(0xa8)});}}return _0x50e936;}export function linkGlobalRuntimeSkills(_0xe410f1,_0xbdd939={}){const _0x21dec6=a138_0xf6c9f7,_0x44408d=resolveSkillSyncPaths(_0xbdd939),_0x5c0b8f=[];for(const _0x3f234d of _0xe410f1){if(_0x3f234d[_0x21dec6(0x9a)]!==_0x21dec6(0xab))throw CliErrors[_0x21dec6(0xa3)](_0x21dec6(0x91)+_0x3f234d['scope']);const _0x1e5d71=requireSkillCode(_0x3f234d[_0x21dec6(0x81)]),_0xa29da8=copyManagedSkillDirectory(_0x3f234d['dir'],resolve(_0x44408d['agentsSkillsDir'],_0x1e5d71));_0x5c0b8f[_0x21dec6(0x96)]({..._0xa29da8,'contentHash':_0x3f234d[_0x21dec6(0xa2)]});}return _0x5c0b8f;}function ensureManagedSymlink(_0x157046,_0x29efb4,_0x3a3aa4,_0xd5cafa){const _0xfe4669=a138_0xf6c9f7;mkdirSync(dirname(_0x157046),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x157046)||isDanglingSymlink(_0x157046)){const _0x15f0f7=lstatSync(_0x157046);if(!_0x15f0f7[_0xfe4669(0x94)]())throw CliErrors[_0xfe4669(0xa3)](_0xfe4669(0x92)+_0x157046);const _0x4559d1=resolveSymlinkTarget(_0x157046);if(!isPathInside(realOrResolved(_0x4559d1),realOrResolved(_0x3a3aa4['managedRoot'])))throw CliErrors[_0xfe4669(0xa3)](_0xfe4669(0xa1)+_0x157046);if(realOrResolved(_0x4559d1)===realOrResolved(_0x29efb4))return{'path':_0x157046,'target':_0x29efb4,'action':_0xfe4669(0xb3)};const _0x31e540=readMetadataIfPresent(resolve(_0x4559d1,METADATA_FILE));if(_0x3a3aa4[_0xfe4669(0x9a)]===_0xfe4669(0xa4)&&(_0x31e540?.[_0xfe4669(0xaf)]!==_0x3a3aa4[_0xfe4669(0xaf)]||_0x31e540[_0xfe4669(0x83)]!==_0xd5cafa))throw CliErrors[_0xfe4669(0xa3)]('Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20'+_0x157046);return unlinkSync(_0x157046),symlinkSync(_0x29efb4,_0x157046,'dir'),{'path':_0x157046,'target':_0x29efb4,'action':_0xfe4669(0xac)};}return symlinkSync(_0x29efb4,_0x157046,_0xfe4669(0xaa)),{'path':_0x157046,'target':_0x29efb4,'action':'created'};}function managedTargetSkillLinkPaths(_0x2bd8c0,_0x546018){const _0x44ce1b=a138_0xf6c9f7;if(!existsSync(_0x2bd8c0))return[];const _0x2b2eab=_0x546018[_0x44ce1b(0xaf)]+'--';return readdirSync(_0x2bd8c0,{'withFileTypes':!![]})[_0x44ce1b(0x89)](_0x1d27cc=>_0x546018[_0x44ce1b(0x9a)]==='project'||_0x1d27cc[_0x44ce1b(0x9d)][_0x44ce1b(0xb4)](_0x2b2eab))[_0x44ce1b(0x9f)](_0x2fd3ef=>resolve(_0x2bd8c0,_0x2fd3ef[_0x44ce1b(0x9d)]));}function removeManagedSkillLink(_0x3d89eb,_0x332456,_0x5efd38){const _0x506f44=a138_0xf6c9f7,_0x207d2f=lstatIfPresent(_0x3d89eb);if(!_0x207d2f?.[_0x506f44(0x94)]())return{'path':_0x3d89eb,'action':'skipped','reason':_0x506f44(0x82)};const _0x4d50e6=resolveSymlinkTarget(_0x3d89eb);if(!isPathInside(realOrResolved(_0x4d50e6),realOrResolved(_0x332456[_0x506f44(0xa0)])))return{'path':_0x3d89eb,'action':_0x506f44(0x8a),'reason':_0x506f44(0x99)};const _0x3f6334=readMetadataIfPresent(resolve(_0x4d50e6,METADATA_FILE));if(_0x332456[_0x506f44(0x9a)]===_0x506f44(0xa4)&&(_0x3f6334?.[_0x506f44(0xaf)]!==_0x332456[_0x506f44(0xaf)]||_0x3f6334[_0x506f44(0x83)]!==_0x5efd38))return{'path':_0x3d89eb,'action':_0x506f44(0x8a),'reason':_0x506f44(0x9b)};return unlinkSync(_0x3d89eb),{'path':_0x3d89eb,'action':_0x506f44(0xa8)};}function isLinkedFromAnyRoot(_0x2b9757,_0x149491){const _0x145853=a138_0xf6c9f7,_0x2284f5=realOrResolved(_0x2b9757);for(const _0x50bc73 of _0x149491){if(!existsSync(_0x50bc73))continue;for(const _0x303871 of readdirSync(_0x50bc73,{'withFileTypes':!![]})){if(!_0x303871[_0x145853(0x94)]())continue;const _0x213bf5=resolve(_0x50bc73,_0x303871[_0x145853(0x9d)]);if(realOrResolved(resolveSymlinkTarget(_0x213bf5))===_0x2284f5)return!![];}}return![];}function runtimeSkillLinkName(_0x382bd3,_0x492895){const _0x2f1bc4=a138_0xf6c9f7,_0x55aca1=safePathSegment(_0x492895,_0x2f1bc4(0x83));if(_0x382bd3['scope']===_0x2f1bc4(0xa4)&&RESERVED_PROJECT_SKILL_CODES[_0x2f1bc4(0x8b)](_0x55aca1))throw CliErrors[_0x2f1bc4(0xa3)]('Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20'+_0x55aca1);return _0x382bd3[_0x2f1bc4(0x9a)]===_0x2f1bc4(0xa4)?_0x55aca1:_0x382bd3['appCode']+'--'+_0x55aca1;}function runtimeSkillCodeFromLink(_0x5a8dca,_0x480fb6){const _0x4ee251=a138_0xf6c9f7,_0x1924fd=basename(_0x480fb6);return _0x5a8dca['scope']===_0x4ee251(0xa4)?_0x1924fd:_0x1924fd[_0x4ee251(0x84)]((_0x5a8dca[_0x4ee251(0xaf)]+'--')['length']);}function a138_0x56bb(){const _0x4dfc44=['966065uBFQRm','removed','3781287HFnPHJ','dir','builtin','updated','skillRoots','get','appCode','pruneSkillCodes','122zsOUqX','727144MQkReZ','unchanged','startsWith','5901ZxzIwP','210068mmLKXb','isDirectory','accessKey','env','skill','not-managed-symlink','skillCode','slice','metadataPath','35NUqzdz','lovrabet','Refusing\x20to\x20copy\x20Skill\x20symlink:\x20','filter','skipped','has','runtime-observe','417588uRjhYA','10sAaJhX','personal','trim','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20','values','isSymbolicLink','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20','push','1041849PoaOtd','company','external-symlink','scope','metadata-mismatch','Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20','name','set','map','managedRoot','Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20','contentHash','validation','project','scopes','created'];a138_0x56bb=function(){return _0x4dfc44;};return a138_0x56bb();}export function copyManagedSkillDirectory(_0x140f92,_0x3f76c3){const _0x186034=a138_0xf6c9f7,_0x2699fc=resolve(_0x3f76c3,METADATA_FILE),_0xdff03f=existsSync(_0x3f76c3);if(_0xdff03f){const _0x3b95a2=lstatSync(_0x3f76c3);if(_0x3b95a2[_0x186034(0x94)]())throw CliErrors[_0x186034(0xa3)]('Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20'+_0x3f76c3);if(!_0x3b95a2[_0x186034(0xb7)]())throw CliErrors[_0x186034(0xa3)]('Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20'+_0x3f76c3);const _0x31757d=readMetadataIfPresent(_0x2699fc);if(_0x31757d?.[_0x186034(0x9a)]!==_0x186034(0xab))throw CliErrors['validation'](_0x186034(0x95)+_0x3f76c3);}ensureDirSync(dirname(_0x3f76c3));const _0x7c314c=_0xdff03f?readMetadataIfPresent(_0x2699fc)?.[_0x186034(0xa2)]:undefined,_0x273dd0=readMetadataIfPresent(resolve(_0x140f92,METADATA_FILE))?.[_0x186034(0xa2)];return _0xdff03f&&removeSync(_0x3f76c3),copySkillDirectory(_0x140f92,_0x3f76c3),{'path':_0x3f76c3,'target':_0x140f92,'action':!_0xdff03f?_0x186034(0xa6):_0x7c314c===_0x273dd0?_0x186034(0xb3):_0x186034(0xac)};}function copySkillDirectory(_0x13b8e3,_0x4922db){copySync(_0x13b8e3,_0x4922db,{'dereference':![],'overwrite':!![],'filter'(_0x4ae3cb){const _0xd783e3=a138_0x33e4;if(lstatSync(_0x4ae3cb)[_0xd783e3(0x94)]())throw CliErrors[_0xd783e3(0xa3)](_0xd783e3(0x88)+_0x4ae3cb);return!![];}});}
1
+ const a138_0xf7154f=a138_0x22fc;function a138_0x2ed3(){const _0x23d56a=['Refusing\x20to\x20copy\x20Skill\x20symlink:\x20','lovrabet','secret-retriever','5jqbSGG','updated','Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20','agentsSkillsDir','has','linked-from-protected-root','3397112hZnwMh','appCode','skillCode','metadata-mismatch','created','8676441CPVBFZ','258234yZIggf','external-symlink','builtin','Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20','skill','name','70FYlrpd','skipped','dir','Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20','managedRoot','removed','project','validation','unchanged','scopes','get','contentHash','slice','Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20','company','map','startsWith','1946172DyRmJL','accessKey','personal','skillRoots','Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20','isSymbolicLink','Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20','pruneSkillCodes','push','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','isDirectory','protectedLinkRoots','values','307196GcUeLf','filter','Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20','scope','30893mnAKpO','trim','402908MHAYEe'];a138_0x2ed3=function(){return _0x23d56a;};return a138_0x2ed3();}(function(_0x4c993a,_0x58ded3){const _0xf98441=a138_0x22fc,_0x350bae=_0x4c993a();while(!![]){try{const _0xd9ec80=-parseInt(_0xf98441(0x15c))/0x1+parseInt(_0xf98441(0x158))/0x2+-parseInt(_0xf98441(0x185))/0x3+-parseInt(_0xf98441(0x15e))/0x4*(parseInt(_0xf98441(0x162))/0x5)+-parseInt(_0xf98441(0x16e))/0x6*(parseInt(_0xf98441(0x174))/0x7)+parseInt(_0xf98441(0x168))/0x8+parseInt(_0xf98441(0x16d))/0x9;if(_0xd9ec80===_0x58ded3)break;else _0x350bae['push'](_0x350bae['shift']());}catch(_0x43ec7a){_0x350bae['push'](_0x350bae['shift']());}}}(a138_0x2ed3,0x50f20));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import a138_0x44cb17 from'fs-extra';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';function a138_0x22fc(_0x2b8df6,_0x2c5edd){_0x2b8df6=_0x2b8df6-0x152;const _0x2ed31b=a138_0x2ed3();let _0x22fc5c=_0x2ed31b[_0x2b8df6];return _0x22fc5c;}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_0x44cb17,RESERVED_PROJECT_SKILL_CODES=new Set([a138_0xf7154f(0x160),'runtime-observe',a138_0xf7154f(0x161)]);export function linkEffectiveRuntimeSkills(_0x27212f,_0x11a8b9){const _0x30708e=a138_0xf7154f,_0x11c90b=new Map();for(const _0x30f303 of _0x27212f){const _0x47a202=_0x30f303[_0x30708e(0x172)][_0x30708e(0x16a)];if(!_0x47a202)continue;const _0x4604ff=_0x11c90b[_0x30708e(0x17e)](_0x47a202);(!_0x4604ff||_0x30f303[_0x30708e(0x15b)]===_0x30708e(0x187))&&_0x11c90b['set'](_0x47a202,_0x30f303);}const _0x37cdfe=[];for(const _0x158b65 of _0x11c90b[_0x30708e(0x157)]()){const _0x3017b3=requireSkillCode(_0x158b65[_0x30708e(0x172)]),_0x3e3051=readMetadataIfPresent(_0x158b65['metadataPath']);if(_0x3e3051?.[_0x30708e(0x169)]!==_0x11a8b9[_0x30708e(0x169)]||_0x3e3051[_0x30708e(0x16a)]!==_0x3017b3)throw CliErrors[_0x30708e(0x17b)](_0x30708e(0x18c)+_0x11a8b9[_0x30708e(0x169)]+':\x20'+_0x158b65['metadataPath']);const _0xd47aae=runtimeSkillLinkName(_0x11a8b9,_0x3017b3);for(const _0x3cdd4b of _0x11a8b9['skillRoots']){_0x37cdfe[_0x30708e(0x153)](ensureManagedSymlink(resolve(_0x3cdd4b,_0xd47aae),_0x158b65['dir'],_0x11a8b9,_0x3017b3));}}return _0x37cdfe;}export function pruneStaleRuntimeSkillLinks(_0x373a00,_0x3ada53,_0x361645){const _0x5bda61=a138_0xf7154f,_0x1c245f=new Set([..._0x3ada53][_0x5bda61(0x183)](_0x9c529a=>_0x9c529a[_0x5bda61(0x15d)]())[_0x5bda61(0x159)](Boolean)),_0x263048=_0x361645?new Set([..._0x361645][_0x5bda61(0x183)](_0x15c0c5=>_0x15c0c5[_0x5bda61(0x15d)]())[_0x5bda61(0x159)](Boolean)):undefined,_0x4ea09a=[];for(const _0xcc0f1b of _0x373a00[_0x5bda61(0x188)]){for(const _0x515707 of managedTargetSkillLinkPaths(_0xcc0f1b,_0x373a00)){const _0x486ec4=runtimeSkillCodeFromLink(_0x373a00,_0x515707);if(_0x263048&&!_0x263048[_0x5bda61(0x166)](_0x486ec4))continue;if(_0x1c245f[_0x5bda61(0x166)](_0x486ec4))continue;_0x4ea09a[_0x5bda61(0x153)](removeManagedSkillLink(_0x515707,_0x373a00,_0x486ec4));}}return _0x4ea09a;}export function pruneStaleRuntimeSkillCache(_0x177c82,_0x115595={}){const _0x2d1c59=a138_0xf7154f,_0x21c1e6=new Set([..._0x177c82['activeSkillCodes']][_0x2d1c59(0x183)](_0x4fa7b0=>_0x4fa7b0[_0x2d1c59(0x15d)]())[_0x2d1c59(0x159)](Boolean)),_0x32e011=_0x177c82[_0x2d1c59(0x152)]?new Set([..._0x177c82['pruneSkillCodes']][_0x2d1c59(0x183)](_0x4b0343=>_0x4b0343['trim']())['filter'](Boolean)):undefined,_0x3e54c6=_0x177c82[_0x2d1c59(0x17d)]??[_0x2d1c59(0x187),_0x2d1c59(0x182)],_0x814dfe=resolve(getRuntimeSkillCacheRoot(_0x177c82['env'],_0x177c82[_0x2d1c59(0x186)],_0x115595),safePathSegment(_0x177c82['appCode'],_0x2d1c59(0x169))),_0x59cbb2=[];for(const _0x36a1ea of _0x3e54c6){const _0x4cc75=resolve(_0x814dfe,_0x36a1ea);if(!existsSync(_0x4cc75))continue;for(const _0x19763e of readdirSync(_0x4cc75,{'withFileTypes':!![]})){if(!_0x19763e['isDirectory']())continue;const _0x483a66=_0x19763e[_0x2d1c59(0x173)];if(_0x32e011&&!_0x32e011[_0x2d1c59(0x166)](_0x483a66))continue;if(_0x21c1e6[_0x2d1c59(0x166)](_0x483a66))continue;const _0x45da53=resolve(_0x4cc75,_0x483a66),_0x36ce62=readMetadataIfPresent(resolve(_0x45da53,METADATA_FILE));if(_0x36ce62?.[_0x2d1c59(0x169)]!==_0x177c82[_0x2d1c59(0x169)]||_0x36ce62[_0x2d1c59(0x15b)]!==_0x36a1ea||_0x36ce62[_0x2d1c59(0x16a)]!==_0x483a66){_0x59cbb2[_0x2d1c59(0x153)]({'path':_0x45da53,'action':'skipped','reason':_0x2d1c59(0x16b)});continue;}if(isLinkedFromAnyRoot(_0x45da53,_0x177c82[_0x2d1c59(0x156)]??[])){_0x59cbb2['push']({'path':_0x45da53,'action':_0x2d1c59(0x175),'reason':_0x2d1c59(0x167)});continue;}removeSync(_0x45da53),_0x59cbb2['push']({'path':_0x45da53,'action':_0x2d1c59(0x179)});}}return _0x59cbb2;}export function linkGlobalRuntimeSkills(_0xf04d7d,_0x2e308f={}){const _0x4c559=a138_0xf7154f,_0x3b5972=resolveSkillSyncPaths(_0x2e308f),_0x2b1a3c=[];for(const _0x1d06f8 of _0xf04d7d){if(_0x1d06f8['scope']!==_0x4c559(0x170))throw CliErrors['validation'](_0x4c559(0x154)+_0x1d06f8[_0x4c559(0x15b)]);const _0x361429=requireSkillCode(_0x1d06f8[_0x4c559(0x172)]),_0x332852=copyManagedSkillDirectory(_0x1d06f8['dir'],resolve(_0x3b5972[_0x4c559(0x165)],_0x361429));_0x2b1a3c['push']({..._0x332852,'contentHash':_0x1d06f8[_0x4c559(0x17f)]});}return _0x2b1a3c;}function ensureManagedSymlink(_0x3ce80a,_0x2af573,_0x1727dd,_0x2d73f4){const _0x29bc57=a138_0xf7154f;mkdirSync(dirname(_0x3ce80a),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x3ce80a)||isDanglingSymlink(_0x3ce80a)){const _0x4edebc=lstatSync(_0x3ce80a);if(!_0x4edebc[_0x29bc57(0x18b)]())throw CliErrors['validation'](_0x29bc57(0x177)+_0x3ce80a);const _0x54296b=resolveSymlinkTarget(_0x3ce80a);if(!isPathInside(realOrResolved(_0x54296b),realOrResolved(_0x1727dd[_0x29bc57(0x178)])))throw CliErrors['validation'](_0x29bc57(0x171)+_0x3ce80a);if(realOrResolved(_0x54296b)===realOrResolved(_0x2af573))return{'path':_0x3ce80a,'target':_0x2af573,'action':_0x29bc57(0x17c)};const _0x1038b8=readMetadataIfPresent(resolve(_0x54296b,METADATA_FILE));if(_0x1727dd[_0x29bc57(0x15b)]==='project'&&(_0x1038b8?.[_0x29bc57(0x169)]!==_0x1727dd[_0x29bc57(0x169)]||_0x1038b8[_0x29bc57(0x16a)]!==_0x2d73f4))throw CliErrors['validation'](_0x29bc57(0x181)+_0x3ce80a);return unlinkSync(_0x3ce80a),symlinkSync(_0x2af573,_0x3ce80a,_0x29bc57(0x176)),{'path':_0x3ce80a,'target':_0x2af573,'action':_0x29bc57(0x163)};}return symlinkSync(_0x2af573,_0x3ce80a,_0x29bc57(0x176)),{'path':_0x3ce80a,'target':_0x2af573,'action':'created'};}function managedTargetSkillLinkPaths(_0x31c3da,_0x357ddf){const _0x2815a1=a138_0xf7154f;if(!existsSync(_0x31c3da))return[];const _0x51e0f0=_0x357ddf[_0x2815a1(0x169)]+'--';return readdirSync(_0x31c3da,{'withFileTypes':!![]})[_0x2815a1(0x159)](_0x41e4c1=>_0x357ddf[_0x2815a1(0x15b)]===_0x2815a1(0x17a)||_0x41e4c1[_0x2815a1(0x173)][_0x2815a1(0x184)](_0x51e0f0))[_0x2815a1(0x183)](_0xf35a70=>resolve(_0x31c3da,_0xf35a70[_0x2815a1(0x173)]));}function removeManagedSkillLink(_0x5b581e,_0x2e8457,_0x12e99a){const _0x553db2=a138_0xf7154f,_0x50dad8=lstatIfPresent(_0x5b581e);if(!_0x50dad8?.[_0x553db2(0x18b)]())return{'path':_0x5b581e,'action':'skipped','reason':'not-managed-symlink'};const _0x38cd96=resolveSymlinkTarget(_0x5b581e);if(!isPathInside(realOrResolved(_0x38cd96),realOrResolved(_0x2e8457[_0x553db2(0x178)])))return{'path':_0x5b581e,'action':_0x553db2(0x175),'reason':_0x553db2(0x16f)};const _0x50ab07=readMetadataIfPresent(resolve(_0x38cd96,METADATA_FILE));if(_0x2e8457[_0x553db2(0x15b)]===_0x553db2(0x17a)&&(_0x50ab07?.[_0x553db2(0x169)]!==_0x2e8457['appCode']||_0x50ab07[_0x553db2(0x16a)]!==_0x12e99a))return{'path':_0x5b581e,'action':'skipped','reason':_0x553db2(0x16b)};return unlinkSync(_0x5b581e),{'path':_0x5b581e,'action':_0x553db2(0x179)};}function isLinkedFromAnyRoot(_0x13e37c,_0x24aff6){const _0x1d1c7f=a138_0xf7154f,_0x43b6ff=realOrResolved(_0x13e37c);for(const _0x103924 of _0x24aff6){if(!existsSync(_0x103924))continue;for(const _0x1fcf18 of readdirSync(_0x103924,{'withFileTypes':!![]})){if(!_0x1fcf18[_0x1d1c7f(0x18b)]())continue;const _0x103398=resolve(_0x103924,_0x1fcf18[_0x1d1c7f(0x173)]);if(realOrResolved(resolveSymlinkTarget(_0x103398))===_0x43b6ff)return!![];}}return![];}function runtimeSkillLinkName(_0x517ce3,_0x354c5f){const _0x13d5eb=a138_0xf7154f,_0x171868=safePathSegment(_0x354c5f,_0x13d5eb(0x16a));if(_0x517ce3[_0x13d5eb(0x15b)]==='project'&&RESERVED_PROJECT_SKILL_CODES[_0x13d5eb(0x166)](_0x171868))throw CliErrors[_0x13d5eb(0x17b)](_0x13d5eb(0x15a)+_0x171868);return _0x517ce3[_0x13d5eb(0x15b)]===_0x13d5eb(0x17a)?_0x171868:_0x517ce3[_0x13d5eb(0x169)]+'--'+_0x171868;}function runtimeSkillCodeFromLink(_0x3ceaf1,_0x388311){const _0x5521ee=a138_0xf7154f,_0x4f1a12=basename(_0x388311);return _0x3ceaf1['scope']===_0x5521ee(0x17a)?_0x4f1a12:_0x4f1a12[_0x5521ee(0x180)]((_0x3ceaf1['appCode']+'--')['length']);}export function copyManagedSkillDirectory(_0x54820d,_0x23f062){const _0x253add=a138_0xf7154f,_0x246c9f=resolve(_0x23f062,METADATA_FILE),_0x4383a1=existsSync(_0x23f062);if(_0x4383a1){const _0x1c8a95=lstatSync(_0x23f062);if(_0x1c8a95['isSymbolicLink']())throw CliErrors[_0x253add(0x17b)](_0x253add(0x189)+_0x23f062);if(!_0x1c8a95[_0x253add(0x155)]())throw CliErrors['validation'](_0x253add(0x164)+_0x23f062);const _0x217b45=readMetadataIfPresent(_0x246c9f);if(_0x217b45?.[_0x253add(0x15b)]!==_0x253add(0x170))throw CliErrors[_0x253add(0x17b)](_0x253add(0x18a)+_0x23f062);}ensureDirSync(dirname(_0x23f062));const _0x31d1a5=_0x4383a1?readMetadataIfPresent(_0x246c9f)?.[_0x253add(0x17f)]:undefined,_0x718006=readMetadataIfPresent(resolve(_0x54820d,METADATA_FILE))?.[_0x253add(0x17f)];return _0x4383a1&&removeSync(_0x23f062),copySkillDirectory(_0x54820d,_0x23f062),{'path':_0x23f062,'target':_0x54820d,'action':!_0x4383a1?_0x253add(0x16c):_0x31d1a5===_0x718006?'unchanged':_0x253add(0x163)};}function copySkillDirectory(_0x6b2f78,_0x1b09a5){copySync(_0x6b2f78,_0x1b09a5,{'dereference':![],'overwrite':!![],'filter'(_0x22000c){const _0x7999ef=a138_0x22fc;if(lstatSync(_0x22000c)[_0x7999ef(0x18b)]())throw CliErrors[_0x7999ef(0x17b)](_0x7999ef(0x15f)+_0x22000c);return!![];}});}
@@ -1 +1 @@
1
- (function(_0x25d46f,_0x3737f8){const _0x70aadc=a139_0x19d3,_0x1b6fd6=_0x25d46f();while(!![]){try{const _0x30c81=-parseInt(_0x70aadc(0x1f2))/0x1*(-parseInt(_0x70aadc(0x1e8))/0x2)+-parseInt(_0x70aadc(0x1fd))/0x3+parseInt(_0x70aadc(0x1de))/0x4*(-parseInt(_0x70aadc(0x1d1))/0x5)+parseInt(_0x70aadc(0x1f6))/0x6+parseInt(_0x70aadc(0x1e3))/0x7*(-parseInt(_0x70aadc(0x1dd))/0x8)+parseInt(_0x70aadc(0x1ec))/0x9+-parseInt(_0x70aadc(0x1cf))/0xa*(-parseInt(_0x70aadc(0x1f8))/0xb);if(_0x30c81===_0x3737f8)break;else _0x1b6fd6['push'](_0x1b6fd6['shift']());}catch(_0x37efe0){_0x1b6fd6['push'](_0x1b6fd6['shift']());}}}(a139_0x2f32,0x95b17));function a139_0x2f32(){const _0x11e8b9=['has','filter','metadataPath','startsWith','skillRoots','274070kTPciG','link','isSymbolicLink','cacheDir','6014784eqqCiK','map','54967gziSlN','cache','project','scope','accessKey','2964321uuseVl','local','2040ZwToBB','localeCompare','1070PuUiWj','Runtime\x20Skill\x20install\x20target\x20app\x20mismatch:\x20','builtin','linkedPaths','linkedPath','tags','validation','get','sort','skillMdPath','trim','from','77536dXUVlL','18100sNhkVW','skillCode','scopes','appCode','name','350TfEtXX','set','code','push','\x20!=\x20','2HpvEFI','dir','source','includes','6824502yTlQzl'];a139_0x2f32=function(){return _0x11e8b9;};return a139_0x2f32();}import{existsSync,readdirSync}from'node:fs';function a139_0x19d3(_0x4a18a1,_0x399e49){_0x4a18a1=_0x4a18a1-0x1ce;const _0x2f3299=a139_0x2f32();let _0x19d3bf=_0x2f3299[_0x4a18a1];return _0x19d3bf;}import{resolve}from'node:path';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{readMetadataIfPresent}from'./metadata.js';import{getRuntimeSkillCacheRoot,safePathSegment}from'./paths.js';import{isRuntimeSkillScope,normalizeRuntimeSkillScopes}from'./scopes.js';export function listLocalRuntimeSkills(_0x3adec5,_0x3ef509,_0x4928c6={}){const _0x33220a=a139_0x19d3,_0x2227c7=safePathSegment(_0x3adec5['appCode'],_0x33220a(0x1e1));if(_0x3ef509[_0x33220a(0x1e1)]!==_0x2227c7)throw CliErrors[_0x33220a(0x1d7)](_0x33220a(0x1d2)+_0x3ef509[_0x33220a(0x1e1)]+_0x33220a(0x1e7)+_0x2227c7);const _0x5770ef=normalizeRuntimeSkillScopes(_0x3adec5[_0x33220a(0x1e0)]),_0x22fd13=new Set(_0x5770ef),_0x55402d=_0x3adec5[_0x33220a(0x1e5)]?.['trim'](),_0x104431=new Map(),_0x2dc108=resolve(getRuntimeSkillCacheRoot(_0x3adec5['env'],_0x3adec5[_0x33220a(0x1fc)],_0x4928c6),_0x2227c7);for(const _0x704264 of _0x5770ef){for(const _0x122a58 of localSkillEntryDirs(resolve(_0x2dc108,_0x704264))){collectLocalRuntimeSkill(_0x104431,_0x122a58,{'appCode':_0x2227c7,'scopes':_0x22fd13,'code':_0x55402d,'source':_0x33220a(0x1f9)});}}for(const _0x4d0c03 of _0x3ef509[_0x33220a(0x1f1)]){for(const _0x291e20 of localSkillLinkCandidates(_0x4d0c03,_0x3ef509,_0x22fd13)){collectLocalRuntimeSkill(_0x104431,_0x291e20,{'appCode':_0x2227c7,'scopes':_0x22fd13,'code':_0x55402d,'source':_0x33220a(0x1f3),'linkedPath':_0x291e20});}}return Array[_0x33220a(0x1dc)](_0x104431['values']())[_0x33220a(0x1d9)](compareLocalRuntimeSkills);}function localSkillEntryDirs(_0x33eb7f){const _0x920709=a139_0x19d3;if(!existsSync(_0x33eb7f))return[];return readdirSync(_0x33eb7f,{'withFileTypes':!![]})[_0x920709(0x1ee)](_0x2dfcd7=>_0x2dfcd7['isDirectory']()||_0x2dfcd7[_0x920709(0x1f4)]())[_0x920709(0x1f7)](_0x1b51b4=>resolve(_0x33eb7f,_0x1b51b4[_0x920709(0x1e2)]));}function localSkillLinkCandidates(_0x340b76,_0x425713,_0x3836f0){const _0x2b0065=a139_0x19d3;if(!existsSync(_0x340b76))return[];const _0x397535=_0x425713[_0x2b0065(0x1e1)]+'--';return readdirSync(_0x340b76,{'withFileTypes':!![]})[_0x2b0065(0x1ee)](_0x4eeab9=>_0x4eeab9['isDirectory']()||_0x4eeab9[_0x2b0065(0x1f4)]())[_0x2b0065(0x1ee)](_0x508812=>_0x425713[_0x2b0065(0x1fb)]===_0x2b0065(0x1fa)||_0x508812['name'][_0x2b0065(0x1f0)](_0x397535)||_0x3836f0[_0x2b0065(0x1ed)](_0x2b0065(0x1d3)))[_0x2b0065(0x1f7)](_0x2b9211=>resolve(_0x340b76,_0x2b9211[_0x2b0065(0x1e2)]));}function collectLocalRuntimeSkill(_0x45ea80,_0x216b06,_0x318926){const _0x1fd205=a139_0x19d3,_0x5a41f7=resolve(_0x216b06,METADATA_FILE),_0xa8de78=readMetadataIfPresent(_0x5a41f7);if(!_0xa8de78)return;if(_0xa8de78[_0x1fd205(0x1e1)]!==_0x318926[_0x1fd205(0x1e1)])return;if(!isRuntimeSkillScope(_0xa8de78[_0x1fd205(0x1fb)])||!_0x318926[_0x1fd205(0x1e0)][_0x1fd205(0x1ed)](_0xa8de78[_0x1fd205(0x1fb)]))return;const _0x585cb4=_0xa8de78[_0x1fd205(0x1df)]?.[_0x1fd205(0x1db)]();if(!_0x585cb4)return;if(_0x318926[_0x1fd205(0x1e5)]&&_0x585cb4!==_0x318926['code'])return;const _0x1038cb=_0xa8de78[_0x1fd205(0x1fb)]+':'+_0x585cb4,_0x1ec1fe=_0x318926[_0x1fd205(0x1d5)]?[_0x318926[_0x1fd205(0x1d5)]]:[],_0x49ef0f=_0x45ea80[_0x1fd205(0x1d8)](_0x1038cb);if(_0x49ef0f){_0x318926[_0x1fd205(0x1ea)]===_0x1fd205(0x1f9)&&(_0x49ef0f[_0x1fd205(0x1e9)]=_0x216b06,_0x49ef0f[_0x1fd205(0x1f5)]=_0x216b06,_0x49ef0f[_0x1fd205(0x1da)]=resolve(_0x216b06,SKILL_FILE),_0x49ef0f[_0x1fd205(0x1ef)]=_0x5a41f7);for(const _0x1067a6 of _0x1ec1fe){!_0x49ef0f['linkedPaths'][_0x1fd205(0x1eb)](_0x1067a6)&&_0x49ef0f[_0x1fd205(0x1d4)][_0x1fd205(0x1e6)](_0x1067a6);}_0x49ef0f[_0x1fd205(0x1d4)][_0x1fd205(0x1d9)]();return;}_0x45ea80[_0x1fd205(0x1e4)](_0x1038cb,{..._0xa8de78,'tags':Array['isArray'](_0xa8de78[_0x1fd205(0x1d6)])?_0xa8de78[_0x1fd205(0x1d6)]:[],'scope':_0xa8de78[_0x1fd205(0x1fb)],'source':_0x1fd205(0x1ce),'dir':_0x216b06,'cacheDir':_0x318926['source']===_0x1fd205(0x1f9)?_0x216b06:undefined,'skillMdPath':resolve(_0x216b06,SKILL_FILE),'metadataPath':_0x5a41f7,'linkedPaths':_0x1ec1fe});}function compareLocalRuntimeSkills(_0x24b05e,_0x1248f9){const _0x3f5ae6=a139_0x19d3,_0x4ccb32={'personal':0x0,'company':0x1,'builtin':0x2};return _0x4ccb32[_0x24b05e['scope']]-_0x4ccb32[_0x1248f9[_0x3f5ae6(0x1fb)]]||_0x24b05e[_0x3f5ae6(0x1df)][_0x3f5ae6(0x1d0)](_0x1248f9['skillCode'])||_0x24b05e['dir']['localeCompare'](_0x1248f9[_0x3f5ae6(0x1e9)]);}
1
+ (function(_0x2b7cc3,_0x607847){const _0x2f2eab=a139_0x41af,_0x458ec0=_0x2b7cc3();while(!![]){try{const _0x59aea5=-parseInt(_0x2f2eab(0x15e))/0x1*(parseInt(_0x2f2eab(0x17c))/0x2)+parseInt(_0x2f2eab(0x162))/0x3+parseInt(_0x2f2eab(0x165))/0x4*(parseInt(_0x2f2eab(0x168))/0x5)+-parseInt(_0x2f2eab(0x172))/0x6+parseInt(_0x2f2eab(0x156))/0x7*(parseInt(_0x2f2eab(0x155))/0x8)+parseInt(_0x2f2eab(0x167))/0x9*(-parseInt(_0x2f2eab(0x158))/0xa)+parseInt(_0x2f2eab(0x15c))/0xb;if(_0x59aea5===_0x607847)break;else _0x458ec0['push'](_0x458ec0['shift']());}catch(_0x207beb){_0x458ec0['push'](_0x458ec0['shift']());}}}(a139_0x495c,0x64ff8));import{existsSync,readdirSync}from'node:fs';import{resolve}from'node:path';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{readMetadataIfPresent}from'./metadata.js';function a139_0x41af(_0x913e20,_0x3d6288){_0x913e20=_0x913e20-0x152;const _0x495c2e=a139_0x495c();let _0x41af6d=_0x495c2e[_0x913e20];return _0x41af6d;}import{getRuntimeSkillCacheRoot,safePathSegment}from'./paths.js';import{isRuntimeSkillScope,normalizeRuntimeSkillScopes}from'./scopes.js';function a139_0x495c(){const _0x161394=['appCode','name','16aRFkaB','dir','cache','skillRoots','includes','set','get','178472cgwRBF','105yvRKJW','env','580KAEIXH','tags','validation','filter','3570897CmqUPN','sort','73288BFEWZt','trim','skillMdPath','linkedPath','1125822PwhZKk','scope','isSymbolicLink','162916ZfmXvf','push','6552dJwiYs','35mXoBgc','project','Runtime\x20Skill\x20install\x20target\x20app\x20mismatch:\x20','startsWith','builtin','\x20!=\x20','source','code','cacheDir','linkedPaths','1664538KtSYfZ','localeCompare','accessKey','has','skillCode','values','isDirectory','scopes'];a139_0x495c=function(){return _0x161394;};return a139_0x495c();}export function listLocalRuntimeSkills(_0xd34e67,_0x190580,_0x26bc0e={}){const _0xd0b501=a139_0x41af,_0x34c5c4=safePathSegment(_0xd34e67[_0xd0b501(0x17a)],_0xd0b501(0x17a));if(_0x190580[_0xd0b501(0x17a)]!==_0x34c5c4)throw CliErrors[_0xd0b501(0x15a)](_0xd0b501(0x16a)+_0x190580[_0xd0b501(0x17a)]+_0xd0b501(0x16d)+_0x34c5c4);const _0x576a55=normalizeRuntimeSkillScopes(_0xd34e67[_0xd0b501(0x179)]),_0xb1b6e9=new Set(_0x576a55),_0x5707e7=_0xd34e67[_0xd0b501(0x16f)]?.[_0xd0b501(0x15f)](),_0x22b893=new Map(),_0x1a476c=resolve(getRuntimeSkillCacheRoot(_0xd34e67[_0xd0b501(0x157)],_0xd34e67[_0xd0b501(0x174)],_0x26bc0e),_0x34c5c4);for(const _0x565426 of _0x576a55){for(const _0x494013 of localSkillEntryDirs(resolve(_0x1a476c,_0x565426))){collectLocalRuntimeSkill(_0x22b893,_0x494013,{'appCode':_0x34c5c4,'scopes':_0xb1b6e9,'code':_0x5707e7,'source':_0xd0b501(0x17e)});}}for(const _0x548706 of _0x190580[_0xd0b501(0x17f)]){for(const _0x74da12 of localSkillLinkCandidates(_0x548706,_0x190580,_0xb1b6e9)){collectLocalRuntimeSkill(_0x22b893,_0x74da12,{'appCode':_0x34c5c4,'scopes':_0xb1b6e9,'code':_0x5707e7,'source':'link','linkedPath':_0x74da12});}}return Array['from'](_0x22b893[_0xd0b501(0x177)]())[_0xd0b501(0x15d)](compareLocalRuntimeSkills);}function localSkillEntryDirs(_0x4e0b92){const _0x5587c3=a139_0x41af;if(!existsSync(_0x4e0b92))return[];return readdirSync(_0x4e0b92,{'withFileTypes':!![]})[_0x5587c3(0x15b)](_0x3d75e1=>_0x3d75e1[_0x5587c3(0x178)]()||_0x3d75e1['isSymbolicLink']())['map'](_0x30aab4=>resolve(_0x4e0b92,_0x30aab4[_0x5587c3(0x17b)]));}function localSkillLinkCandidates(_0x2e2ea9,_0x534523,_0x1da339){const _0x18d7c8=a139_0x41af;if(!existsSync(_0x2e2ea9))return[];const _0x18c066=_0x534523[_0x18d7c8(0x17a)]+'--';return readdirSync(_0x2e2ea9,{'withFileTypes':!![]})['filter'](_0x34ab09=>_0x34ab09[_0x18d7c8(0x178)]()||_0x34ab09[_0x18d7c8(0x164)]())[_0x18d7c8(0x15b)](_0x1a4191=>_0x534523[_0x18d7c8(0x163)]===_0x18d7c8(0x169)||_0x1a4191[_0x18d7c8(0x17b)][_0x18d7c8(0x16b)](_0x18c066)||_0x1da339[_0x18d7c8(0x175)](_0x18d7c8(0x16c)))['map'](_0x229546=>resolve(_0x2e2ea9,_0x229546['name']));}function collectLocalRuntimeSkill(_0x397a34,_0x449d05,_0x567753){const _0x3172df=a139_0x41af,_0x672a95=resolve(_0x449d05,METADATA_FILE),_0x358831=readMetadataIfPresent(_0x672a95);if(!_0x358831)return;if(_0x358831[_0x3172df(0x17a)]!==_0x567753[_0x3172df(0x17a)])return;if(!isRuntimeSkillScope(_0x358831['scope'])||!_0x567753[_0x3172df(0x179)]['has'](_0x358831[_0x3172df(0x163)]))return;const _0x3e4c94=_0x358831[_0x3172df(0x176)]?.['trim']();if(!_0x3e4c94)return;if(_0x567753['code']&&_0x3e4c94!==_0x567753['code'])return;const _0x416f70=_0x358831['scope']+':'+_0x3e4c94,_0x26f0d9=_0x567753[_0x3172df(0x161)]?[_0x567753[_0x3172df(0x161)]]:[],_0x3d5b95=_0x397a34[_0x3172df(0x154)](_0x416f70);if(_0x3d5b95){_0x567753[_0x3172df(0x16e)]===_0x3172df(0x17e)&&(_0x3d5b95[_0x3172df(0x17d)]=_0x449d05,_0x3d5b95[_0x3172df(0x170)]=_0x449d05,_0x3d5b95[_0x3172df(0x160)]=resolve(_0x449d05,SKILL_FILE),_0x3d5b95['metadataPath']=_0x672a95);for(const _0x5c9493 of _0x26f0d9){!_0x3d5b95[_0x3172df(0x171)][_0x3172df(0x152)](_0x5c9493)&&_0x3d5b95[_0x3172df(0x171)][_0x3172df(0x166)](_0x5c9493);}_0x3d5b95[_0x3172df(0x171)][_0x3172df(0x15d)]();return;}_0x397a34[_0x3172df(0x153)](_0x416f70,{..._0x358831,'tags':Array['isArray'](_0x358831['tags'])?_0x358831[_0x3172df(0x159)]:[],'scope':_0x358831[_0x3172df(0x163)],'source':'local','dir':_0x449d05,'cacheDir':_0x567753['source']===_0x3172df(0x17e)?_0x449d05:undefined,'skillMdPath':resolve(_0x449d05,SKILL_FILE),'metadataPath':_0x672a95,'linkedPaths':_0x26f0d9});}function compareLocalRuntimeSkills(_0x135a4a,_0x2683d8){const _0x2c0022=a139_0x41af,_0x4aab6d={'personal':0x0,'company':0x1,'builtin':0x2};return _0x4aab6d[_0x135a4a[_0x2c0022(0x163)]]-_0x4aab6d[_0x2683d8[_0x2c0022(0x163)]]||_0x135a4a[_0x2c0022(0x176)][_0x2c0022(0x173)](_0x2683d8[_0x2c0022(0x176)])||_0x135a4a[_0x2c0022(0x17d)][_0x2c0022(0x173)](_0x2683d8[_0x2c0022(0x17d)]);}
@@ -1 +1 @@
1
- (function(_0x4d8415,_0x201023){const _0x4bcac2=a140_0x37e5,_0x14b260=_0x4d8415();while(!![]){try{const _0x5e2a49=parseInt(_0x4bcac2(0x8d))/0x1+-parseInt(_0x4bcac2(0x7e))/0x2*(-parseInt(_0x4bcac2(0x83))/0x3)+parseInt(_0x4bcac2(0x8a))/0x4+-parseInt(_0x4bcac2(0x84))/0x5+-parseInt(_0x4bcac2(0x74))/0x6+parseInt(_0x4bcac2(0x71))/0x7*(-parseInt(_0x4bcac2(0x9c))/0x8)+-parseInt(_0x4bcac2(0x7a))/0x9*(-parseInt(_0x4bcac2(0x9e))/0xa);if(_0x5e2a49===_0x201023)break;else _0x14b260['push'](_0x14b260['shift']());}catch(_0x49ac2d){_0x14b260['push'](_0x14b260['shift']());}}}(a140_0x37a1,0xcc630));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(_0x1882d3){const _0x40a605=a140_0x37e5;return _0x1882d3['bytes']??Buffer['from'](_0x1882d3[_0x40a605(0x72)]??'',_0x40a605(0x95));}function a140_0x37a1(){const _0x24632c=['27ekmLNt','isBuffer','from','validation','142veLyGK','toLowerCase','add','Skill\x20file\x20sha256\x20is\x20invalid:\x20','object','22341wgIAjK','1945960pjARqg','replace','isArray','Skill\x20file\x20size\x20is\x20invalid:\x20','excludedFilePaths','string','313860hgjBzN','toString','startsWith','97441fEJwcj','localeCompare','size','compare','isSafeInteger','length','sort','isDirectory','utf8','name','push','Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20','Unsafe\x20Skill\x20file\x20path:\x20','Skill\x20file\x20path\x20must\x20be\x20text.','Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20','634152ucIXyJ','path','9125110zygeoJ','Duplicate\x20Skill\x20file\x20path:\x20','isSymbolicLink','includes','has','91KHzylf','content','values','7111914ILxzPg','bytes','test','split','set','isFile'];a140_0x37a1=function(){return _0x24632c;};return a140_0x37a1();}export function fileText(_0x21b95f){const _0x28559a=a140_0x37e5;return fileContent(_0x21b95f)[_0x28559a(0x8b)]('utf8');}export function normalizeLocalFiles(_0x9640b6){const _0x61238a=a140_0x37e5;if(!Array[_0x61238a(0x86)](_0x9640b6)||_0x9640b6['length']===0x0)return[];const _0x56898f=new Map();for(const _0x660c3f of _0x9640b6){if(!_0x660c3f||typeof _0x660c3f!=='object'||typeof _0x660c3f[_0x61238a(0x9d)]!==_0x61238a(0x89))throw CliErrors['validation']('Skill\x20file\x20path\x20must\x20be\x20text.');const _0x22b035=normalizeSkillRelativePath(_0x660c3f['path']);if(_0x56898f['has'](_0x22b035))throw CliErrors['validation']('Duplicate\x20Skill\x20file\x20path:\x20'+_0x22b035);if(_0x660c3f['bytes']!==undefined&&!Buffer[_0x61238a(0x7b)](_0x660c3f[_0x61238a(0x75)]))throw CliErrors[_0x61238a(0x7d)]('Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20'+_0x22b035);if(_0x660c3f['bytes']===undefined&&typeof _0x660c3f['content']!==_0x61238a(0x89))throw CliErrors[_0x61238a(0x7d)](_0x61238a(0x98)+_0x22b035);const _0x12acac=fileContent(_0x660c3f);_0x56898f[_0x61238a(0x78)](_0x22b035,{'path':_0x22b035,'bytes':_0x12acac});}return Array[_0x61238a(0x7c)](_0x56898f[_0x61238a(0x73)]())['sort'](compareSkillFiles);}export function normalizeManifestFiles(_0xd01f3b){const _0x78c22e=a140_0x37e5;if(!Array['isArray'](_0xd01f3b)||_0xd01f3b[_0x78c22e(0x92)]===0x0)return[];const _0x10661b=new Map();for(const _0x5211a2 of _0xd01f3b){if(!_0x5211a2||typeof _0x5211a2!==_0x78c22e(0x82)||typeof _0x5211a2[_0x78c22e(0x9d)]!==_0x78c22e(0x89))throw CliErrors[_0x78c22e(0x7d)](_0x78c22e(0x9a));const _0xb5b9f=normalizeSkillRelativePath(_0x5211a2['path']);if(_0x10661b['has'](_0xb5b9f))throw CliErrors['validation'](_0x78c22e(0x9f)+_0xb5b9f);if(!isSha256Hex(_0x5211a2['sha256']))throw CliErrors['validation'](_0x78c22e(0x81)+_0xb5b9f);if(!Number[_0x78c22e(0x91)](_0x5211a2['size'])||_0x5211a2[_0x78c22e(0x8f)]<0x0)throw CliErrors[_0x78c22e(0x7d)](_0x78c22e(0x87)+_0xb5b9f);_0x10661b['set'](_0xb5b9f,{'path':_0xb5b9f,'sha256':_0x5211a2['sha256'][_0x78c22e(0x7f)](),'size':_0x5211a2[_0x78c22e(0x8f)]});}return Array[_0x78c22e(0x7c)](_0x10661b[_0x78c22e(0x73)]())['sort'](compareSkillFiles);}export function scanSkillDirectory(_0x4e2158,_0x127de4={}){const _0x29f05f=a140_0x37e5,_0x3ad5ef=realpathSync(_0x4e2158),_0x2dad7a=canonicalExcludedFilePaths(_0x127de4[_0x29f05f(0x88)]),_0x34690e=[];function _0x263ba6(_0x36ce35){const _0x50cc2b=_0x29f05f,_0x2b1515=readdirSync(_0x36ce35,{'withFileTypes':!![]})[_0x50cc2b(0x93)]((_0x524f49,_0x528cf6)=>_0x524f49[_0x50cc2b(0x96)][_0x50cc2b(0x8e)](_0x528cf6['name']));for(const _0x562184 of _0x2b1515){if(_0x562184[_0x50cc2b(0x94)]()&&IGNORED_DIR_NAMES['has'](_0x562184['name']))continue;if(IGNORED_FILE_NAMES[_0x50cc2b(0x70)](_0x562184[_0x50cc2b(0x96)]))continue;const _0xcc183d=resolve(_0x36ce35,_0x562184[_0x50cc2b(0x96)]);if(isExcludedFilePath(_0xcc183d,_0x2dad7a))continue;if(_0x562184[_0x50cc2b(0xa0)]())throw CliErrors[_0x50cc2b(0x7d)](_0x50cc2b(0x9b)+_0xcc183d);const _0x5cd7b0=toPosixPath(relative(_0x3ad5ef,_0xcc183d));if(_0x562184['isDirectory']()){_0x263ba6(_0xcc183d);continue;}if(!_0x562184[_0x50cc2b(0x79)]())continue;validateSkillRelativePath(_0x5cd7b0);const _0x30ca6d=readFileSync(_0xcc183d);_0x34690e[_0x50cc2b(0x97)]({'path':_0x5cd7b0,'bytes':_0x30ca6d});}}return _0x263ba6(_0x3ad5ef),normalizeLocalFiles(_0x34690e);}function canonicalExcludedFilePaths(_0x45ef58){const _0xa39945=a140_0x37e5,_0x223f4d=new Set();for(const _0x5e78a9 of _0x45ef58??[]){const _0x2e6a50=resolve(_0x5e78a9);_0x223f4d[_0xa39945(0x80)](_0x2e6a50);try{_0x223f4d[_0xa39945(0x80)](realpathSync(_0x2e6a50));}catch{}}return _0x223f4d;}function isExcludedFilePath(_0x5bfb14,_0x336457){const _0x534bb7=a140_0x37e5;if(_0x336457[_0x534bb7(0x70)](_0x5bfb14))return!![];if(_0x336457[_0x534bb7(0x8f)]===0x0)return![];try{return _0x336457[_0x534bb7(0x70)](realpathSync(_0x5bfb14));}catch{return![];}}export function compareSkillFiles(_0x5bcf03,_0x41eeab){const _0xc617ba=a140_0x37e5;if(_0x5bcf03[_0xc617ba(0x9d)]===SKILL_FILE)return _0x41eeab[_0xc617ba(0x9d)]===SKILL_FILE?0x0:-0x1;if(_0x41eeab[_0xc617ba(0x9d)]===SKILL_FILE)return 0x1;return Buffer[_0xc617ba(0x90)](Buffer[_0xc617ba(0x7c)](_0x5bcf03['path'],_0xc617ba(0x95)),Buffer[_0xc617ba(0x7c)](_0x41eeab[_0xc617ba(0x9d)],_0xc617ba(0x95)));}export function normalizeSkillRelativePath(_0x1abf80){const _0x19def0=toPosixPath(_0x1abf80['trim']());return validateSkillRelativePath(_0x19def0),_0x19def0;}export function validateSkillRelativePath(_0x2f5639){const _0x17da57=a140_0x37e5;if(!_0x2f5639||_0x2f5639[_0x17da57(0x8c)]('/')||_0x2f5639[_0x17da57(0xa1)]('//'))throw CliErrors[_0x17da57(0x7d)](_0x17da57(0x99)+_0x2f5639);for(const _0x5e291f of _0x2f5639[_0x17da57(0x77)]('/')){if(!_0x5e291f||_0x5e291f==='.'||_0x5e291f==='..')throw CliErrors[_0x17da57(0x7d)](_0x17da57(0x99)+_0x2f5639);}}export function toPosixPath(_0x47cee5){const _0x18d2ea=a140_0x37e5;return _0x47cee5[_0x18d2ea(0x85)](/\\/g,'/');}function a140_0x37e5(_0x15a844,_0xd8f9){_0x15a844=_0x15a844-0x70;const _0x37a114=a140_0x37a1();let _0x37e5ec=_0x37a114[_0x15a844];return _0x37e5ec;}export function isSha256Hex(_0x231399){const _0x3d0886=a140_0x37e5;return typeof _0x231399==='string'&&/^[a-fA-F0-9]{64}$/[_0x3d0886(0x76)](_0x231399);}
1
+ (function(_0xe606e0,_0x2e03b8){const _0x389378=a140_0x2108,_0x20883a=_0xe606e0();while(!![]){try{const _0x2409d7=parseInt(_0x389378(0x20f))/0x1+parseInt(_0x389378(0x20e))/0x2+parseInt(_0x389378(0x1ff))/0x3+parseInt(_0x389378(0x20a))/0x4*(-parseInt(_0x389378(0x217))/0x5)+parseInt(_0x389378(0x1fe))/0x6+parseInt(_0x389378(0x1f7))/0x7*(parseInt(_0x389378(0x1f9))/0x8)+-parseInt(_0x389378(0x1f6))/0x9;if(_0x2409d7===_0x2e03b8)break;else _0x20883a['push'](_0x20883a['shift']());}catch(_0x4171e6){_0x20883a['push'](_0x20883a['shift']());}}}(a140_0x2600,0x36b25));import{readFileSync,readdirSync,realpathSync}from'node:fs';import{relative,resolve}from'node:path';function a140_0x2600(){const _0x200943=['add','has','size','Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20','string','utf8','Skill\x20file\x20size\x20is\x20invalid:\x20','125CZGogS','toLowerCase','Skill\x20file\x20path\x20must\x20be\x20text.','validation','from','bytes','Skill\x20file\x20sha256\x20is\x20invalid:\x20','sha256','isDirectory','push','test','8584767DLzkty','765982oIwypt','isSymbolicLink','32yUgQmY','object','Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20','isSafeInteger','isArray','2035494jiVJuR','1056768iJZIIy','isFile','sort','compare','length','Unsafe\x20Skill\x20file\x20path:\x20','Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20','content','name','Duplicate\x20Skill\x20file\x20path:\x20','startsWith','63868qZmSnM','path','values','toString','261398VFdLiO','317167JYdfZo'];a140_0x2600=function(){return _0x200943;};return a140_0x2600();}import{CliErrors}from'../../errors.js';import{IGNORED_DIR_NAMES,IGNORED_FILE_NAMES,SKILL_FILE}from'./constants.js';export function fileContent(_0x3cc60d){const _0x5b8258=a140_0x2108;return _0x3cc60d[_0x5b8258(0x1f0)]??Buffer[_0x5b8258(0x1ef)](_0x3cc60d[_0x5b8258(0x206)]??'',_0x5b8258(0x215));}export function fileText(_0x57585e){const _0x44ead3=a140_0x2108;return fileContent(_0x57585e)[_0x44ead3(0x20d)](_0x44ead3(0x215));}export function normalizeLocalFiles(_0x4b0600){const _0x474f50=a140_0x2108;if(!Array['isArray'](_0x4b0600)||_0x4b0600[_0x474f50(0x203)]===0x0)return[];const _0x4be9f0=new Map();for(const _0x47816b of _0x4b0600){if(!_0x47816b||typeof _0x47816b!==_0x474f50(0x1fa)||typeof _0x47816b[_0x474f50(0x20b)]!==_0x474f50(0x214))throw CliErrors[_0x474f50(0x1ee)](_0x474f50(0x1ed));const _0xe97904=normalizeSkillRelativePath(_0x47816b[_0x474f50(0x20b)]);if(_0x4be9f0['has'](_0xe97904))throw CliErrors[_0x474f50(0x1ee)](_0x474f50(0x208)+_0xe97904);if(_0x47816b[_0x474f50(0x1f0)]!==undefined&&!Buffer['isBuffer'](_0x47816b[_0x474f50(0x1f0)]))throw CliErrors[_0x474f50(0x1ee)](_0x474f50(0x205)+_0xe97904);if(_0x47816b[_0x474f50(0x1f0)]===undefined&&typeof _0x47816b[_0x474f50(0x206)]!=='string')throw CliErrors[_0x474f50(0x1ee)](_0x474f50(0x213)+_0xe97904);const _0x52ae2e=fileContent(_0x47816b);_0x4be9f0['set'](_0xe97904,{'path':_0xe97904,'bytes':_0x52ae2e});}return Array[_0x474f50(0x1ef)](_0x4be9f0[_0x474f50(0x20c)]())[_0x474f50(0x201)](compareSkillFiles);}export function normalizeManifestFiles(_0x99b936){const _0x27405b=a140_0x2108;if(!Array[_0x27405b(0x1fd)](_0x99b936)||_0x99b936[_0x27405b(0x203)]===0x0)return[];const _0xcd8502=new Map();for(const _0xbf9a59 of _0x99b936){if(!_0xbf9a59||typeof _0xbf9a59!=='object'||typeof _0xbf9a59['path']!==_0x27405b(0x214))throw CliErrors['validation'](_0x27405b(0x1ed));const _0x522500=normalizeSkillRelativePath(_0xbf9a59['path']);if(_0xcd8502[_0x27405b(0x211)](_0x522500))throw CliErrors[_0x27405b(0x1ee)](_0x27405b(0x208)+_0x522500);if(!isSha256Hex(_0xbf9a59[_0x27405b(0x1f2)]))throw CliErrors[_0x27405b(0x1ee)](_0x27405b(0x1f1)+_0x522500);if(!Number[_0x27405b(0x1fc)](_0xbf9a59[_0x27405b(0x212)])||_0xbf9a59[_0x27405b(0x212)]<0x0)throw CliErrors[_0x27405b(0x1ee)](_0x27405b(0x216)+_0x522500);_0xcd8502['set'](_0x522500,{'path':_0x522500,'sha256':_0xbf9a59[_0x27405b(0x1f2)][_0x27405b(0x1ec)](),'size':_0xbf9a59[_0x27405b(0x212)]});}return Array['from'](_0xcd8502[_0x27405b(0x20c)]())[_0x27405b(0x201)](compareSkillFiles);}export function scanSkillDirectory(_0x127f6c,_0x5e5f11={}){const _0x2dc428=realpathSync(_0x127f6c),_0x371e7a=canonicalExcludedFilePaths(_0x5e5f11['excludedFilePaths']),_0x377c5d=[];function _0x380ed6(_0x12914c){const _0x524623=a140_0x2108,_0x583413=readdirSync(_0x12914c,{'withFileTypes':!![]})[_0x524623(0x201)]((_0x423424,_0x51e0e5)=>_0x423424[_0x524623(0x207)]['localeCompare'](_0x51e0e5['name']));for(const _0x35b340 of _0x583413){if(_0x35b340[_0x524623(0x1f3)]()&&IGNORED_DIR_NAMES[_0x524623(0x211)](_0x35b340[_0x524623(0x207)]))continue;if(IGNORED_FILE_NAMES['has'](_0x35b340[_0x524623(0x207)]))continue;const _0x13c916=resolve(_0x12914c,_0x35b340[_0x524623(0x207)]);if(isExcludedFilePath(_0x13c916,_0x371e7a))continue;if(_0x35b340[_0x524623(0x1f8)]())throw CliErrors[_0x524623(0x1ee)](_0x524623(0x1fb)+_0x13c916);const _0x20dccd=toPosixPath(relative(_0x2dc428,_0x13c916));if(_0x35b340[_0x524623(0x1f3)]()){_0x380ed6(_0x13c916);continue;}if(!_0x35b340[_0x524623(0x200)]())continue;validateSkillRelativePath(_0x20dccd);const _0x3f1afa=readFileSync(_0x13c916);_0x377c5d[_0x524623(0x1f4)]({'path':_0x20dccd,'bytes':_0x3f1afa});}}return _0x380ed6(_0x2dc428),normalizeLocalFiles(_0x377c5d);}function canonicalExcludedFilePaths(_0x477cc6){const _0x830f80=a140_0x2108,_0x429317=new Set();for(const _0x5c88e2 of _0x477cc6??[]){const _0x592703=resolve(_0x5c88e2);_0x429317[_0x830f80(0x210)](_0x592703);try{_0x429317[_0x830f80(0x210)](realpathSync(_0x592703));}catch{}}return _0x429317;}function isExcludedFilePath(_0x531179,_0x287aeb){const _0xab4477=a140_0x2108;if(_0x287aeb[_0xab4477(0x211)](_0x531179))return!![];if(_0x287aeb[_0xab4477(0x212)]===0x0)return![];try{return _0x287aeb[_0xab4477(0x211)](realpathSync(_0x531179));}catch{return![];}}export function compareSkillFiles(_0xe6d0e8,_0x1c7b80){const _0x5dc283=a140_0x2108;if(_0xe6d0e8['path']===SKILL_FILE)return _0x1c7b80[_0x5dc283(0x20b)]===SKILL_FILE?0x0:-0x1;if(_0x1c7b80[_0x5dc283(0x20b)]===SKILL_FILE)return 0x1;return Buffer[_0x5dc283(0x202)](Buffer[_0x5dc283(0x1ef)](_0xe6d0e8['path'],'utf8'),Buffer[_0x5dc283(0x1ef)](_0x1c7b80['path'],_0x5dc283(0x215)));}export function normalizeSkillRelativePath(_0x5dbb33){const _0x3e93a5=toPosixPath(_0x5dbb33['trim']());return validateSkillRelativePath(_0x3e93a5),_0x3e93a5;}function a140_0x2108(_0x435efb,_0x569997){_0x435efb=_0x435efb-0x1ec;const _0x260072=a140_0x2600();let _0x210896=_0x260072[_0x435efb];return _0x210896;}export function validateSkillRelativePath(_0x3fe261){const _0x8d4f7d=a140_0x2108;if(!_0x3fe261||_0x3fe261[_0x8d4f7d(0x209)]('/')||_0x3fe261['includes']('//'))throw CliErrors['validation']('Unsafe\x20Skill\x20file\x20path:\x20'+_0x3fe261);for(const _0x243ff3 of _0x3fe261['split']('/')){if(!_0x243ff3||_0x243ff3==='.'||_0x243ff3==='..')throw CliErrors[_0x8d4f7d(0x1ee)](_0x8d4f7d(0x204)+_0x3fe261);}}export function toPosixPath(_0xbffb1){return _0xbffb1['replace'](/\\/g,'/');}export function isSha256Hex(_0x41cc72){const _0x50e940=a140_0x2108;return typeof _0x41cc72===_0x50e940(0x214)&&/^[a-fA-F0-9]{64}$/[_0x50e940(0x1f5)](_0x41cc72);}
@@ -1 +1 @@
1
- (function(_0xa47dcc,_0x567a25){const _0x1db448=a141_0x1fd7,_0x2db293=_0xa47dcc();while(!![]){try{const _0x535f76=-parseInt(_0x1db448(0x18e))/0x1+-parseInt(_0x1db448(0x1a5))/0x2+-parseInt(_0x1db448(0x18f))/0x3*(parseInt(_0x1db448(0x1b3))/0x4)+-parseInt(_0x1db448(0x19a))/0x5+-parseInt(_0x1db448(0x1a2))/0x6*(-parseInt(_0x1db448(0x17e))/0x7)+parseInt(_0x1db448(0x1b5))/0x8+parseInt(_0x1db448(0x180))/0x9;if(_0x535f76===_0x567a25)break;else _0x2db293['push'](_0x2db293['shift']());}catch(_0x53e4cd){_0x2db293['push'](_0x2db293['shift']());}}}(a141_0x452f,0xddefb));function a141_0x1fd7(_0x1f2877,_0x38926e){_0x1f2877=_0x1f2877-0x17b;const _0x452fbf=a141_0x452f();let _0x1fd714=_0x452fbf[_0x1f2877];return _0x1fd714;}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';export function materializeRuntimeSkill(_0x199400,_0x5ab8a1,_0x223bba){const _0x58a0aa=a141_0x1fd7,_0x3e6c16=requireSkillCode(_0x199400),_0x3fc0d9=requirePackageBytes(_0x3e6c16,_0x223bba[_0x58a0aa(0x17f)]),_0x8f25db=extractDownloadedPackage(_0x3fc0d9),_0x32b259=_0x8f25db[_0x58a0aa(0x199)](_0x4e8956=>_0x4e8956[_0x58a0aa(0x1ad)]===SKILL_FILE);if(!_0x32b259)throw CliErrors[_0x58a0aa(0x1a8)](_0x58a0aa(0x18d)+SKILL_FILE+':\x20'+_0x3e6c16);const _0x285e0c=withMaterializedSkillFrontmatter(_0x8f25db,_0x199400,_0x3e6c16),_0x6c1b00=_0x285e0c[_0x58a0aa(0x199)](_0x319d64=>_0x319d64['path']===SKILL_FILE),_0x22d4fb=fileText(_0x6c1b00),_0x346cda=getRuntimeSkillDir(_0x223bba[_0x58a0aa(0x17b)],_0x223bba[_0x58a0aa(0x186)],_0x223bba['appCode'],_0x5ab8a1,_0x3e6c16,_0x223bba['paths']),_0x60e41b=resolve(_0x346cda,SKILL_FILE),_0x17a76d=resolve(_0x346cda,METADATA_FILE),_0x272633=contentHash(_0x22d4fb),_0x114b26=readMetadataIfPresent(_0x17a76d)?.['fileHashes'];ensurePulledFilesCanBeOverwritten(_0x346cda,_0x17a76d,_0x285e0c,_0x223bba['force']===!![]),mkdirSync(_0x346cda,{'recursive':!![],'mode':0x1c0});const _0x259f9f=existsSync(_0x60e41b)?readFileSync(_0x60e41b,_0x58a0aa(0x192)):undefined;return materializeFiles(_0x346cda,_0x285e0c),removeStaleManagedFiles(_0x346cda,_0x114b26,_0x285e0c),writeJsonAtomic(_0x17a76d,buildMetadata(_0x199400,_0x5ab8a1,_0x223bba['appCode'],_0x272633,_0x223bba[_0x58a0aa(0x191)],_0x285e0c,_0x3fc0d9)),{'skill':_0x199400,'scope':_0x5ab8a1,'dir':_0x346cda,'skillMdPath':_0x60e41b,'metadataPath':_0x17a76d,'contentHash':_0x272633,'changed':_0x259f9f!==_0x22d4fb};}export function reuseMaterializedRuntimeSkill(_0x3a103f,_0x3c499c,_0x23116d){const _0x5f4947=a141_0x1fd7,_0x462cad=_0x3a103f[_0x5f4947(0x1b7)]?.[_0x5f4947(0x1b4)]();if(!_0x462cad)return undefined;const _0x20134b=requireSkillCode(_0x3a103f),_0x3e5244=getRuntimeSkillDir(_0x23116d[_0x5f4947(0x17b)],_0x23116d[_0x5f4947(0x186)],_0x23116d[_0x5f4947(0x184)],_0x3c499c,_0x20134b,_0x23116d[_0x5f4947(0x19e)]),_0x49539e=resolve(_0x3e5244,SKILL_FILE),_0x302310=resolve(_0x3e5244,METADATA_FILE),_0x4f1410=readMetadataIfPresent(_0x302310);if(!_0x4f1410||_0x4f1410[_0x5f4947(0x187)]!==0x2||_0x4f1410['appCode']!==_0x23116d['appCode']||_0x4f1410['scope']!==_0x3c499c||_0x4f1410[_0x5f4947(0x1a6)]!==_0x20134b||_0x4f1410[_0x5f4947(0x1b7)]!==_0x462cad||_0x4f1410['id']!==_0x3a103f['id']||_0x4f1410[_0x5f4947(0x188)]!==_0x3a103f[_0x5f4947(0x188)]||_0x4f1410['description']!==_0x3a103f[_0x5f4947(0x1aa)]||_0x4f1410[_0x5f4947(0x17c)]!==_0x3a103f[_0x5f4947(0x17c)]||_0x4f1410[_0x5f4947(0x1b1)]!==_0x3a103f[_0x5f4947(0x1b1)]||!_0x4f1410[_0x5f4947(0x1ab)]||!_0x4f1410[_0x5f4947(0x1a9)]||!Object[_0x5f4947(0x1af)](_0x4f1410[_0x5f4947(0x1a9)],SKILL_FILE))return undefined;for(const [_0x1c1105,_0x7071b5]of Object[_0x5f4947(0x19f)](_0x4f1410[_0x5f4947(0x1a9)])){if(!/^[a-f0-9]{64}$/['test'](_0x7071b5))return undefined;const _0x5ed6ef=resolveManagedFilePath(_0x3e5244,_0x1c1105);if(!existsSync(_0x5ed6ef)||!lstatSync(_0x5ed6ef)[_0x5f4947(0x194)]())return undefined;if(bufferSha256(readFileSync(_0x5ed6ef))!==_0x7071b5)return undefined;}return{'skill':_0x3a103f,'scope':_0x3c499c,'dir':_0x3e5244,'skillMdPath':_0x49539e,'metadataPath':_0x302310,'contentHash':_0x4f1410[_0x5f4947(0x1ab)],'changed':![]};}function a141_0x452f(){const _0x3cbf24=['name','version','env','example','slice','14AUsQys','packageBytes','20362311KCSebu','keys','Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20','errors','appCode','length','accessKey','schemaVersion','skillName','set','description:\x20','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.','---','Runtime\x20Skill\x20package\x20is\x20missing\x20','1626124nDxCwT','1356987sdYqSE','match','pulledAt','utf8','contents','isFile','displayName:\x20','Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20','displayName','has','find','2641500CgoyPh','trimEnd','delete','join','paths','entries','map','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','3781830JovGAn','filter','toString','1028878xfznGB','skillCode','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','validation','fileHashes','description','contentHash','name:\x20','path','replace','hasOwn','\x0a---\x0a\x0a','status','---\x0a','4UqQNxm','trim','4057232RsYdxV'];a141_0x452f=function(){return _0x3cbf24;};return a141_0x452f();}function withMaterializedSkillFrontmatter(_0x1c90aa,_0xe48b13,_0x15fb47){const _0x36895a=a141_0x1fd7,_0x25f4f6=skillDisplayName(_0xe48b13,_0x15fb47),_0x548ce0=_0xe48b13[_0x36895a(0x1aa)]?.[_0x36895a(0x1b4)]()||_0x25f4f6||_0x15fb47;return normalizeLocalFiles(_0x1c90aa)['map'](_0x362a36=>{const _0xa9634=_0x36895a,_0x3f0490=fileText(_0x362a36);if(_0x362a36['path']!==SKILL_FILE)return _0x362a36;if(hasYamlFrontmatter(_0x3f0490))return{'path':_0x362a36[_0xa9634(0x1ad)],'content':withSyncedDisplayName(_0x3f0490,_0x25f4f6)};return{'path':_0x362a36[_0xa9634(0x1ad)],'content':prependSkillFrontmatter(_0x3f0490,{'name':_0x15fb47,'displayName':_0x25f4f6,'description':_0x548ce0})};});}function hasYamlFrontmatter(_0x38d27c){return/^\uFEFF?---\s*\r?\n/['test'](_0x38d27c);}function prependSkillFrontmatter(_0x23f69a,_0x1c8690){const _0x3e6d05=a141_0x1fd7,_0x303a42=_0x23f69a[_0x3e6d05(0x1ae)](/^\uFEFF/,'');return[_0x3e6d05(0x18c),_0x3e6d05(0x1ac)+yamlString(_0x1c8690[_0x3e6d05(0x1b6)]),_0x1c8690[_0x3e6d05(0x197)]?_0x3e6d05(0x195)+yamlString(_0x1c8690[_0x3e6d05(0x197)]):undefined,_0x3e6d05(0x18a)+yamlString(_0x1c8690[_0x3e6d05(0x1aa)]),_0x3e6d05(0x18c),'',_0x303a42][_0x3e6d05(0x1a3)](_0x553395=>_0x553395!==undefined)[_0x3e6d05(0x19d)]('\x0a');}function yamlString(_0x2ff8b5){const _0x23e491=a141_0x1fd7;return JSON['stringify'](_0x2ff8b5['replace'](/\r/g,'')[_0x23e491(0x1b4)]());}function skillDisplayName(_0x296ad0,_0x201c2b){const _0x3b7983=_0x296ad0['skillName']?.['trim']();return _0x3b7983||_0x201c2b;}function withSyncedDisplayName(_0x3c0ddb,_0x3db787){const _0x5874ee=a141_0x1fd7,_0x3083be=_0x3c0ddb[_0x5874ee(0x190)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x3083be)return _0x3c0ddb;const _0x5ab180=_0x3083be[0x1]??'',_0x1dd185=_0x3083be[0x2]??'',_0x456522=parseDocument(_0x1dd185);if(_0x456522[_0x5874ee(0x183)]['length']>0x0||!isMap(_0x456522[_0x5874ee(0x193)]))return _0x3c0ddb;if(_0x3db787)_0x456522[_0x5874ee(0x189)](_0x5874ee(0x197),_0x3db787);else{if(_0x456522[_0x5874ee(0x198)](_0x5874ee(0x197)))_0x456522[_0x5874ee(0x19c)](_0x5874ee(0x197));else return _0x3c0ddb;}forceBlockCollections(_0x456522[_0x5874ee(0x193)]);const _0x593bd2=_0x456522[_0x5874ee(0x1a4)]({'lineWidth':0x0})[_0x5874ee(0x19b)](),_0x1b0b57=_0x3c0ddb[_0x5874ee(0x17d)](_0x3083be[0x0][_0x5874ee(0x185)])[_0x5874ee(0x1ae)](/^\r?\n/,'');return _0x5ab180+_0x5874ee(0x1b2)+_0x593bd2+_0x5874ee(0x1b0)+_0x1b0b57;}function forceBlockCollections(_0x48de30){if(!isNode(_0x48de30))return;visit(_0x48de30,(_0x4c3515,_0xc094b5)=>{isCollection(_0xc094b5)&&(_0xc094b5['flow']=![]);});}function ensurePulledFilesCanBeOverwritten(_0x25fcbd,_0x503c2d,_0xa407b3,_0x210480){const _0x4fec35=a141_0x1fd7;if(_0x210480||!existsSync(_0x503c2d))return;const _0x58dd73=readMetadataIfPresent(_0x503c2d);if(!_0x58dd73)return;const _0x2cbf5b=_0x58dd73['fileHashes']&&Object[_0x4fec35(0x181)](_0x58dd73[_0x4fec35(0x1a9)])['length']>0x0?_0x58dd73[_0x4fec35(0x1a9)]:undefined;if(_0x2cbf5b)for(const [_0x605248,_0x500f14]of Object[_0x4fec35(0x19f)](_0x2cbf5b)){const _0x1030f5=resolveManagedFilePath(_0x25fcbd,_0x605248);if(!existsSync(_0x1030f5))throw CliErrors[_0x4fec35(0x1a8)](_0x4fec35(0x1a1)+_0x25fcbd,'Managed\x20file\x20was\x20removed\x20locally:\x20'+_0x605248);const _0x53b4eb=lstatSync(_0x1030f5);if(!_0x53b4eb[_0x4fec35(0x194)]())throw CliErrors['validation'](_0x4fec35(0x1a1)+_0x25fcbd,_0x4fec35(0x182)+_0x605248);const _0x4a870f=bufferSha256(readFileSync(_0x1030f5));if(_0x4a870f!==_0x500f14)throw CliErrors[_0x4fec35(0x1a8)](_0x4fec35(0x1a1)+_0x25fcbd+'.\x20Changed\x20file:\x20'+_0x605248,_0x4fec35(0x1a7)+_0x605248);}else{const _0x16734b=resolve(_0x25fcbd,SKILL_FILE);if(existsSync(_0x16734b)&&_0x58dd73['contentHash']){const _0x27730e=contentHash(readFileSync(_0x16734b,_0x4fec35(0x192)));if(_0x27730e!==_0x58dd73['contentHash'])throw CliErrors['validation']('Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20'+_0x16734b,_0x4fec35(0x18b));}}for(const _0x9e329a of normalizeLocalFiles(_0xa407b3)){if(_0x2cbf5b?.[_0x9e329a[_0x4fec35(0x1ad)]])continue;if(!_0x2cbf5b&&_0x9e329a[_0x4fec35(0x1ad)]===SKILL_FILE)continue;const _0x10ed64=resolveManagedFilePath(_0x25fcbd,_0x9e329a['path']);if(!existsSync(_0x10ed64))continue;const _0x1ecc37=lstatSync(_0x10ed64);if(!_0x1ecc37[_0x4fec35(0x194)]())throw CliErrors['validation']('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x25fcbd,'Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20'+_0x9e329a['path']);const _0x5a78fd=bufferSha256(readFileSync(_0x10ed64));if(_0x5a78fd!==fileHash(_0x9e329a))throw CliErrors['validation'](_0x4fec35(0x1a1)+_0x25fcbd,_0x4fec35(0x196)+_0x9e329a[_0x4fec35(0x1ad)]);}}function materializeFiles(_0x4fbb46,_0x1d43bd){for(const _0x114406 of normalizeLocalFiles(_0x1d43bd)){const _0x5be432=resolveManagedFilePath(_0x4fbb46,_0x114406['path']);mkdirSync(dirname(_0x5be432),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x5be432,fileContent(_0x114406),0x180);}}function removeStaleManagedFiles(_0x168fd4,_0x469d11,_0x45ae72){const _0x253d9a=a141_0x1fd7;if(!_0x469d11)return;const _0x313efe=new Set(normalizeLocalFiles(_0x45ae72)[_0x253d9a(0x1a0)](_0x5dfb57=>_0x5dfb57[_0x253d9a(0x1ad)]));for(const _0x5abc7d of Object[_0x253d9a(0x181)](_0x469d11)){if(_0x313efe['has'](_0x5abc7d))continue;const _0x39643d=resolveManagedFilePath(_0x168fd4,_0x5abc7d);existsSync(_0x39643d)&&lstatSync(_0x39643d)[_0x253d9a(0x194)]()&&rmSync(_0x39643d,{'force':!![]});}}
1
+ (function(_0x4a2cfc,_0x8ba15c){const _0xc4fad7=a141_0x4833,_0x5af903=_0x4a2cfc();while(!![]){try{const _0x48d3a4=-parseInt(_0xc4fad7(0xb3))/0x1*(-parseInt(_0xc4fad7(0xae))/0x2)+-parseInt(_0xc4fad7(0xc5))/0x3*(parseInt(_0xc4fad7(0xdd))/0x4)+parseInt(_0xc4fad7(0xd6))/0x5*(-parseInt(_0xc4fad7(0xbc))/0x6)+-parseInt(_0xc4fad7(0xac))/0x7*(-parseInt(_0xc4fad7(0xda))/0x8)+-parseInt(_0xc4fad7(0xc0))/0x9*(-parseInt(_0xc4fad7(0xcd))/0xa)+-parseInt(_0xc4fad7(0xd3))/0xb+parseInt(_0xc4fad7(0xe0))/0xc;if(_0x48d3a4===_0x8ba15c)break;else _0x5af903['push'](_0x5af903['shift']());}catch(_0x50b369){_0x5af903['push'](_0x5af903['shift']());}}}(a141_0x5358,0x532e0));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';export function materializeRuntimeSkill(_0x39526a,_0x350df6,_0xd494f6){const _0x424b8b=a141_0x4833,_0x581f8c=requireSkillCode(_0x39526a),_0x32ad6b=requirePackageBytes(_0x581f8c,_0xd494f6[_0x424b8b(0xd8)]),_0x530e65=extractDownloadedPackage(_0x32ad6b),_0x21fc1e=_0x530e65[_0x424b8b(0xc1)](_0x11d127=>_0x11d127[_0x424b8b(0xc3)]===SKILL_FILE);if(!_0x21fc1e)throw CliErrors[_0x424b8b(0xd2)](_0x424b8b(0xc4)+SKILL_FILE+':\x20'+_0x581f8c);const _0x59b8d9=withMaterializedSkillFrontmatter(_0x530e65,_0x39526a,_0x581f8c),_0x309b9a=_0x59b8d9[_0x424b8b(0xc1)](_0x228f42=>_0x228f42[_0x424b8b(0xc3)]===SKILL_FILE),_0x2fe2af=fileText(_0x309b9a),_0x20784f=getRuntimeSkillDir(_0xd494f6[_0x424b8b(0xd0)],_0xd494f6[_0x424b8b(0xe1)],_0xd494f6[_0x424b8b(0xc6)],_0x350df6,_0x581f8c,_0xd494f6['paths']),_0x5c6e29=resolve(_0x20784f,SKILL_FILE),_0x19447f=resolve(_0x20784f,METADATA_FILE),_0x3fa440=contentHash(_0x2fe2af),_0x769a1f=readMetadataIfPresent(_0x19447f)?.[_0x424b8b(0xbf)];ensurePulledFilesCanBeOverwritten(_0x20784f,_0x19447f,_0x59b8d9,_0xd494f6['force']===!![]),mkdirSync(_0x20784f,{'recursive':!![],'mode':0x1c0});const _0x1c97a8=existsSync(_0x5c6e29)?readFileSync(_0x5c6e29,_0x424b8b(0xe3)):undefined;return materializeFiles(_0x20784f,_0x59b8d9),removeStaleManagedFiles(_0x20784f,_0x769a1f,_0x59b8d9),writeJsonAtomic(_0x19447f,buildMetadata(_0x39526a,_0x350df6,_0xd494f6[_0x424b8b(0xc6)],_0x3fa440,_0xd494f6[_0x424b8b(0xbe)],_0x59b8d9,_0x32ad6b)),{'skill':_0x39526a,'scope':_0x350df6,'dir':_0x20784f,'skillMdPath':_0x5c6e29,'metadataPath':_0x19447f,'contentHash':_0x3fa440,'changed':_0x1c97a8!==_0x2fe2af};}export function reuseMaterializedRuntimeSkill(_0x360537,_0x2fe3bc,_0x12104b){const _0x4fcd1e=a141_0x4833,_0x404b6e=_0x360537[_0x4fcd1e(0xb6)]?.[_0x4fcd1e(0xa8)]();if(!_0x404b6e)return undefined;const _0x517751=requireSkillCode(_0x360537),_0x2febb4=getRuntimeSkillDir(_0x12104b[_0x4fcd1e(0xd0)],_0x12104b[_0x4fcd1e(0xe1)],_0x12104b[_0x4fcd1e(0xc6)],_0x2fe3bc,_0x517751,_0x12104b['paths']),_0x466cfc=resolve(_0x2febb4,SKILL_FILE),_0xb74409=resolve(_0x2febb4,METADATA_FILE),_0x58689f=readMetadataIfPresent(_0xb74409);if(!_0x58689f||_0x58689f[_0x4fcd1e(0xb2)]!==0x2||_0x58689f[_0x4fcd1e(0xc6)]!==_0x12104b[_0x4fcd1e(0xc6)]||_0x58689f[_0x4fcd1e(0xca)]!==_0x2fe3bc||_0x58689f[_0x4fcd1e(0xb1)]!==_0x517751||_0x58689f[_0x4fcd1e(0xb6)]!==_0x404b6e||_0x58689f['id']!==_0x360537['id']||_0x58689f['skillName']!==_0x360537[_0x4fcd1e(0xba)]||_0x58689f[_0x4fcd1e(0xad)]!==_0x360537['description']||_0x58689f[_0x4fcd1e(0xdb)]!==_0x360537[_0x4fcd1e(0xdb)]||_0x58689f[_0x4fcd1e(0xb4)]!==_0x360537['status']||!_0x58689f[_0x4fcd1e(0xe2)]||!_0x58689f['fileHashes']||!Object[_0x4fcd1e(0xcc)](_0x58689f[_0x4fcd1e(0xbf)],SKILL_FILE))return undefined;for(const [_0x1636ab,_0x2076ea]of Object[_0x4fcd1e(0xe4)](_0x58689f[_0x4fcd1e(0xbf)])){if(!/^[a-f0-9]{64}$/[_0x4fcd1e(0xbd)](_0x2076ea))return undefined;const _0x3dae74=resolveManagedFilePath(_0x2febb4,_0x1636ab);if(!existsSync(_0x3dae74)||!lstatSync(_0x3dae74)[_0x4fcd1e(0xd7)]())return undefined;if(bufferSha256(readFileSync(_0x3dae74))!==_0x2076ea)return undefined;}return{'skill':_0x360537,'scope':_0x2fe3bc,'dir':_0x2febb4,'skillMdPath':_0x466cfc,'metadataPath':_0xb74409,'contentHash':_0x58689f[_0x4fcd1e(0xe2)],'changed':![]};}function withMaterializedSkillFrontmatter(_0x142158,_0x277271,_0x4e0949){const _0xae5079=a141_0x4833,_0x307fae=skillDisplayName(_0x277271,_0x4e0949),_0x404662=_0x277271[_0xae5079(0xad)]?.[_0xae5079(0xa8)]()||_0x307fae||_0x4e0949;return normalizeLocalFiles(_0x142158)[_0xae5079(0xbb)](_0x370f5c=>{const _0x5ae445=_0xae5079,_0x86afef=fileText(_0x370f5c);if(_0x370f5c['path']!==SKILL_FILE)return _0x370f5c;if(hasYamlFrontmatter(_0x86afef))return{'path':_0x370f5c[_0x5ae445(0xc3)],'content':withSyncedDisplayName(_0x86afef,_0x307fae)};return{'path':_0x370f5c[_0x5ae445(0xc3)],'content':prependSkillFrontmatter(_0x86afef,{'name':_0x4e0949,'displayName':_0x307fae,'description':_0x404662})};});}function hasYamlFrontmatter(_0x31fce1){const _0x647fec=a141_0x4833;return/^\uFEFF?---\s*\r?\n/[_0x647fec(0xbd)](_0x31fce1);}function a141_0x5358(){const _0x2268a5=['schemaVersion','797qHbuWm','status','trimEnd','version','match','---\x0a','displayName:\x20','skillName','map','312olRmRp','test','pulledAt','fileHashes','594QmBDTM','find','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','path','Runtime\x20Skill\x20package\x20is\x20missing\x20','633RKtqBl','appCode','keys','displayName','flow','scope','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','hasOwn','94730LyEqKP','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.','stringify','env','.\x20Changed\x20file:\x20','validation','3130061phFvbW','name:\x20','has','26115JMaOFT','isFile','packageBytes','length','1112WpWWWN','example','Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20','12536jymbSo','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','\x0a---\x0a\x0a','1084824VtWdkC','accessKey','contentHash','utf8','entries','join','description:\x20','trim','replace','---','name','15617BWttiG','description','1336CtKuAp','Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20','set','skillCode'];a141_0x5358=function(){return _0x2268a5;};return a141_0x5358();}function prependSkillFrontmatter(_0x5212cf,_0x25ca3a){const _0x96f4d8=a141_0x4833,_0x282260=_0x5212cf[_0x96f4d8(0xa9)](/^\uFEFF/,'');return[_0x96f4d8(0xaa),_0x96f4d8(0xd4)+yamlString(_0x25ca3a[_0x96f4d8(0xab)]),_0x25ca3a[_0x96f4d8(0xc8)]?_0x96f4d8(0xb9)+yamlString(_0x25ca3a[_0x96f4d8(0xc8)]):undefined,_0x96f4d8(0xa7)+yamlString(_0x25ca3a[_0x96f4d8(0xad)]),_0x96f4d8(0xaa),'',_0x282260]['filter'](_0x3a7f49=>_0x3a7f49!==undefined)[_0x96f4d8(0xe5)]('\x0a');}function yamlString(_0x20fb21){const _0x268612=a141_0x4833;return JSON[_0x268612(0xcf)](_0x20fb21[_0x268612(0xa9)](/\r/g,'')[_0x268612(0xa8)]());}function skillDisplayName(_0x288230,_0x25ccf4){const _0x1d2906=a141_0x4833,_0x52df5c=_0x288230['skillName']?.[_0x1d2906(0xa8)]();return _0x52df5c||_0x25ccf4;}function a141_0x4833(_0x2483a6,_0x1428ca){_0x2483a6=_0x2483a6-0xa7;const _0x5358f9=a141_0x5358();let _0x4833ba=_0x5358f9[_0x2483a6];return _0x4833ba;}function withSyncedDisplayName(_0x547eb3,_0x22d8f8){const _0x55b17a=a141_0x4833,_0x3aee6d=_0x547eb3[_0x55b17a(0xb7)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x3aee6d)return _0x547eb3;const _0x524b68=_0x3aee6d[0x1]??'',_0x281c29=_0x3aee6d[0x2]??'',_0x324613=parseDocument(_0x281c29);if(_0x324613['errors'][_0x55b17a(0xd9)]>0x0||!isMap(_0x324613['contents']))return _0x547eb3;if(_0x22d8f8)_0x324613[_0x55b17a(0xb0)](_0x55b17a(0xc8),_0x22d8f8);else{if(_0x324613[_0x55b17a(0xd5)]('displayName'))_0x324613['delete']('displayName');else return _0x547eb3;}forceBlockCollections(_0x324613['contents']);const _0x3fdaab=_0x324613['toString']({'lineWidth':0x0})[_0x55b17a(0xb5)](),_0x88ee13=_0x547eb3['slice'](_0x3aee6d[0x0][_0x55b17a(0xd9)])[_0x55b17a(0xa9)](/^\r?\n/,'');return _0x524b68+_0x55b17a(0xb8)+_0x3fdaab+_0x55b17a(0xdf)+_0x88ee13;}function forceBlockCollections(_0x5a47fb){if(!isNode(_0x5a47fb))return;visit(_0x5a47fb,(_0x23fd98,_0x40ab52)=>{const _0x2cba0f=a141_0x4833;isCollection(_0x40ab52)&&(_0x40ab52[_0x2cba0f(0xc9)]=![]);});}function ensurePulledFilesCanBeOverwritten(_0x296c62,_0x1fc5f9,_0x455537,_0x1c475a){const _0x3864af=a141_0x4833;if(_0x1c475a||!existsSync(_0x1fc5f9))return;const _0x86b5f8=readMetadataIfPresent(_0x1fc5f9);if(!_0x86b5f8)return;const _0x44c98d=_0x86b5f8[_0x3864af(0xbf)]&&Object[_0x3864af(0xc7)](_0x86b5f8[_0x3864af(0xbf)])[_0x3864af(0xd9)]>0x0?_0x86b5f8[_0x3864af(0xbf)]:undefined;if(_0x44c98d)for(const [_0x18bd8f,_0x1246eb]of Object[_0x3864af(0xe4)](_0x44c98d)){const _0x413ccf=resolveManagedFilePath(_0x296c62,_0x18bd8f);if(!existsSync(_0x413ccf))throw CliErrors['validation'](_0x3864af(0xc2)+_0x296c62,'Managed\x20file\x20was\x20removed\x20locally:\x20'+_0x18bd8f);const _0xa74846=lstatSync(_0x413ccf);if(!_0xa74846['isFile']())throw CliErrors['validation'](_0x3864af(0xc2)+_0x296c62,_0x3864af(0xaf)+_0x18bd8f);const _0x28a793=bufferSha256(readFileSync(_0x413ccf));if(_0x28a793!==_0x1246eb)throw CliErrors['validation'](_0x3864af(0xc2)+_0x296c62+_0x3864af(0xd1)+_0x18bd8f,_0x3864af(0xcb)+_0x18bd8f);}else{const _0x4f5b4d=resolve(_0x296c62,SKILL_FILE);if(existsSync(_0x4f5b4d)&&_0x86b5f8['contentHash']){const _0x267fc6=contentHash(readFileSync(_0x4f5b4d,_0x3864af(0xe3)));if(_0x267fc6!==_0x86b5f8[_0x3864af(0xe2)])throw CliErrors[_0x3864af(0xd2)](_0x3864af(0xde)+_0x4f5b4d,_0x3864af(0xce));}}for(const _0x22cdd1 of normalizeLocalFiles(_0x455537)){if(_0x44c98d?.[_0x22cdd1['path']])continue;if(!_0x44c98d&&_0x22cdd1[_0x3864af(0xc3)]===SKILL_FILE)continue;const _0x190824=resolveManagedFilePath(_0x296c62,_0x22cdd1[_0x3864af(0xc3)]);if(!existsSync(_0x190824))continue;const _0x37f1e6=lstatSync(_0x190824);if(!_0x37f1e6[_0x3864af(0xd7)]())throw CliErrors['validation']('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x296c62,'Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20'+_0x22cdd1[_0x3864af(0xc3)]);const _0x4d3bad=bufferSha256(readFileSync(_0x190824));if(_0x4d3bad!==fileHash(_0x22cdd1))throw CliErrors['validation']('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x296c62,_0x3864af(0xdc)+_0x22cdd1[_0x3864af(0xc3)]);}}function materializeFiles(_0x4bf505,_0x471939){const _0x998050=a141_0x4833;for(const _0x4b9b80 of normalizeLocalFiles(_0x471939)){const _0x4a2b9d=resolveManagedFilePath(_0x4bf505,_0x4b9b80[_0x998050(0xc3)]);mkdirSync(dirname(_0x4a2b9d),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x4a2b9d,fileContent(_0x4b9b80),0x180);}}function removeStaleManagedFiles(_0x47b814,_0x32616b,_0x317512){const _0x3ea91c=a141_0x4833;if(!_0x32616b)return;const _0x15714d=new Set(normalizeLocalFiles(_0x317512)[_0x3ea91c(0xbb)](_0x3c6201=>_0x3c6201[_0x3ea91c(0xc3)]));for(const _0x2e594f of Object[_0x3ea91c(0xc7)](_0x32616b)){if(_0x15714d[_0x3ea91c(0xd5)](_0x2e594f))continue;const _0x2b581a=resolveManagedFilePath(_0x47b814,_0x2e594f);existsSync(_0x2b581a)&&lstatSync(_0x2b581a)[_0x3ea91c(0xd7)]()&&rmSync(_0x2b581a,{'force':!![]});}}
@@ -1 +1 @@
1
- (function(_0x47ef52,_0x113021){const _0x38e83b=a142_0x3800,_0x439c09=_0x47ef52();while(!![]){try{const _0x52fc3b=parseInt(_0x38e83b(0x177))/0x1*(parseInt(_0x38e83b(0x190))/0x2)+parseInt(_0x38e83b(0x178))/0x3+-parseInt(_0x38e83b(0x186))/0x4*(parseInt(_0x38e83b(0x174))/0x5)+-parseInt(_0x38e83b(0x181))/0x6*(parseInt(_0x38e83b(0x170))/0x7)+parseInt(_0x38e83b(0x171))/0x8*(parseInt(_0x38e83b(0x18b))/0x9)+-parseInt(_0x38e83b(0x173))/0xa+-parseInt(_0x38e83b(0x176))/0xb*(-parseInt(_0x38e83b(0x18a))/0xc);if(_0x52fc3b===_0x113021)break;else _0x439c09['push'](_0x439c09['shift']());}catch(_0x2f89c5){_0x439c09['push'](_0x439c09['shift']());}}}(a142_0x3ead,0xdd8d2));function a142_0x3ead(){const _0x4d015f=['skillName','forkedFromSkillId','Runtime\x20Skill\x20is\x20missing\x20skillCode.','6147828DRjEzn','27VWlOGE','ossPath','description','object','path','534398JKEXbc','utf8','Invalid\x20','sourceSessionId','isArray','manifest','zipSize','43183INevaK','3704920EdWrIm','trim','2709500lPmKdg','25dpdrhM','validation','11IQWFCJ','3wyiuYF','1331043AuoBDn','tags','tenantCode','example','skillCode','personal','version','toISOString','status','342phASvH','userId','hasUpstreamUpdate','forkedFromVersion','length','1293508IGxfTQ'];a142_0x3ead=function(){return _0x4d015f;};return a142_0x3ead();}import{existsSync,readFileSync}from'node:fs';import{CliErrors}from'../../errors.js';function a142_0x3800(_0x1787ec,_0x4e29b2){_0x1787ec=_0x1787ec-0x16f;const _0x3eaddf=a142_0x3ead();let _0x380073=_0x3eaddf[_0x1787ec];return _0x380073;}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(_0xee60cf,_0xd0b6c7,_0x241ba9,_0x6a1cc8,_0x4a8251,_0x13fc95,_0x13aeed){const _0x2525a0=a142_0x3800,_0x5a10d6=_0x13fc95?normalizeLocalFiles(_0x13fc95):[],_0x55da55=!_0x13aeed&&_0x5a10d6[_0x2525a0(0x185)]>0x0?buildSkillPackage(_0x5a10d6):undefined,_0x400ea8=_0x13aeed?bufferSha256(_0x13aeed):_0x55da55?.[_0x2525a0(0x195)]['zipSha256'],_0x41d9a6=_0x13aeed?.['length']??_0x55da55?.['manifest'][_0x2525a0(0x16f)],_0x33c0a1=_0x5a10d6[_0x2525a0(0x185)]>0x0?Object['fromEntries'](_0x5a10d6['map'](_0x1e52d9=>[_0x1e52d9[_0x2525a0(0x18f)],fileHash(_0x1e52d9)])):undefined;return{'schemaVersion':_0x5a10d6[_0x2525a0(0x185)]>0x0?0x2:0x1,'id':_0xee60cf['id'],'appCode':_0x241ba9,'skillCode':requireSkillCode(_0xee60cf),'skillName':_0xee60cf[_0x2525a0(0x187)],'description':_0xee60cf[_0x2525a0(0x18d)],'example':_0xee60cf[_0x2525a0(0x17b)],'scope':_0xd0b6c7,'readonly':_0xd0b6c7!==_0x2525a0(0x17d)||_0xee60cf['readonly']===!![],'tenantCode':_0xee60cf[_0x2525a0(0x17a)],'userId':_0xee60cf[_0x2525a0(0x182)],'version':_0xee60cf[_0x2525a0(0x17e)],'status':_0xee60cf[_0x2525a0(0x180)],'tags':Array[_0x2525a0(0x194)](_0xee60cf[_0x2525a0(0x179)])?_0xee60cf[_0x2525a0(0x179)]:[],'hasUpstreamUpdate':_0xee60cf[_0x2525a0(0x183)],'forkedFromSkillId':_0xee60cf[_0x2525a0(0x188)],'forkedFromVersion':_0xee60cf[_0x2525a0(0x184)],'sourceSessionId':_0xee60cf[_0x2525a0(0x193)],'contentHash':_0x6a1cc8,'fileHashes':_0x33c0a1,'treeHash':_0x5a10d6['length']>0x0?fileTreeHash(localFilesToManifestFiles(_0x5a10d6)):undefined,'ossPath':remoteManifestOssPath(_0xee60cf['files']),'zipSha256':_0x400ea8,'zipSize':_0x41d9a6,'files':_0x5a10d6['length']>0x0?_0x5a10d6['map'](_0x1929c3=>({'path':_0x1929c3[_0x2525a0(0x18f)],'hash':fileHash(_0x1929c3),'size':fileContent(_0x1929c3)[_0x2525a0(0x185)]})):undefined,'pulledAt':_0x4a8251??new Date()[_0x2525a0(0x17f)]()};}export function requireSkillCode(_0x5b81b7){const _0x3ad136=a142_0x3800,_0x437b60=_0x5b81b7[_0x3ad136(0x17c)]?.[_0x3ad136(0x172)]();if(!_0x437b60)throw CliErrors['validation'](_0x3ad136(0x189));return _0x437b60;}export function readMetadataIfPresent(_0x112a25){const _0x4334cd=a142_0x3800;if(!existsSync(_0x112a25))return undefined;try{const _0x14ee97=JSON['parse'](readFileSync(_0x112a25,_0x4334cd(0x191)));return _0x14ee97;}catch{throw CliErrors[_0x4334cd(0x175)](_0x4334cd(0x192)+METADATA_FILE+':\x20'+_0x112a25);}}function remoteManifestOssPath(_0x29cf95){const _0x153907=a142_0x3800;if(!_0x29cf95||typeof _0x29cf95!==_0x153907(0x18e)||Array[_0x153907(0x194)](_0x29cf95))return undefined;const _0xc6a5=_0x29cf95[_0x153907(0x18c)];return typeof _0xc6a5==='string'&&_0xc6a5[_0x153907(0x172)]()?_0xc6a5['trim']():undefined;}
1
+ (function(_0x338144,_0x8148eb){const _0x29b6b0=a142_0x1771,_0xf0c5ad=_0x338144();while(!![]){try{const _0x434c34=parseInt(_0x29b6b0(0x14b))/0x1+parseInt(_0x29b6b0(0x14c))/0x2+-parseInt(_0x29b6b0(0x147))/0x3*(parseInt(_0x29b6b0(0x150))/0x4)+parseInt(_0x29b6b0(0x158))/0x5+parseInt(_0x29b6b0(0x137))/0x6*(-parseInt(_0x29b6b0(0x134))/0x7)+parseInt(_0x29b6b0(0x13e))/0x8+-parseInt(_0x29b6b0(0x149))/0x9;if(_0x434c34===_0x8148eb)break;else _0xf0c5ad['push'](_0xf0c5ad['shift']());}catch(_0x3b198e){_0xf0c5ad['push'](_0xf0c5ad['shift']());}}}(a142_0x47a5,0x4c822));import{existsSync,readFileSync}from'node:fs';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';function a142_0x1771(_0xdfe8f9,_0x26acd3){_0xdfe8f9=_0xdfe8f9-0x134;const _0x47a54d=a142_0x47a5();let _0x17711d=_0x47a54d[_0xdfe8f9];return _0x17711d;}import{fileContent,normalizeLocalFiles}from'./local-files.js';import{buildSkillPackage,localFilesToManifestFiles}from'./zip-package.js';export function buildMetadata(_0x4f6dfe,_0x294063,_0x864835,_0x343230,_0x1d5b77,_0x556082,_0x4e1474){const _0x394622=a142_0x1771,_0x3193f3=_0x556082?normalizeLocalFiles(_0x556082):[],_0x5f210c=!_0x4e1474&&_0x3193f3[_0x394622(0x146)]>0x0?buildSkillPackage(_0x3193f3):undefined,_0x2f4be2=_0x4e1474?bufferSha256(_0x4e1474):_0x5f210c?.[_0x394622(0x14a)][_0x394622(0x156)],_0x5bda64=_0x4e1474?.[_0x394622(0x146)]??_0x5f210c?.[_0x394622(0x14a)]['zipSize'],_0x2e921d=_0x3193f3['length']>0x0?Object[_0x394622(0x142)](_0x3193f3[_0x394622(0x144)](_0x211ff7=>[_0x211ff7[_0x394622(0x14e)],fileHash(_0x211ff7)])):undefined;return{'schemaVersion':_0x3193f3['length']>0x0?0x2:0x1,'id':_0x4f6dfe['id'],'appCode':_0x864835,'skillCode':requireSkillCode(_0x4f6dfe),'skillName':_0x4f6dfe[_0x394622(0x157)],'description':_0x4f6dfe[_0x394622(0x145)],'example':_0x4f6dfe[_0x394622(0x13a)],'scope':_0x294063,'readonly':_0x294063!=='personal'||_0x4f6dfe['readonly']===!![],'tenantCode':_0x4f6dfe[_0x394622(0x138)],'userId':_0x4f6dfe[_0x394622(0x135)],'version':_0x4f6dfe['version'],'status':_0x4f6dfe[_0x394622(0x143)],'tags':Array[_0x394622(0x152)](_0x4f6dfe[_0x394622(0x14f)])?_0x4f6dfe[_0x394622(0x14f)]:[],'hasUpstreamUpdate':_0x4f6dfe[_0x394622(0x13d)],'forkedFromSkillId':_0x4f6dfe[_0x394622(0x136)],'forkedFromVersion':_0x4f6dfe[_0x394622(0x14d)],'sourceSessionId':_0x4f6dfe[_0x394622(0x140)],'contentHash':_0x343230,'fileHashes':_0x2e921d,'treeHash':_0x3193f3[_0x394622(0x146)]>0x0?fileTreeHash(localFilesToManifestFiles(_0x3193f3)):undefined,'ossPath':remoteManifestOssPath(_0x4f6dfe[_0x394622(0x154)]),'zipSha256':_0x2f4be2,'zipSize':_0x5bda64,'files':_0x3193f3[_0x394622(0x146)]>0x0?_0x3193f3['map'](_0x3a13aa=>({'path':_0x3a13aa[_0x394622(0x14e)],'hash':fileHash(_0x3a13aa),'size':fileContent(_0x3a13aa)[_0x394622(0x146)]})):undefined,'pulledAt':_0x1d5b77??new Date()[_0x394622(0x155)]()};}export function requireSkillCode(_0x3d8926){const _0x50524a=a142_0x1771,_0x273c20=_0x3d8926[_0x50524a(0x13b)]?.[_0x50524a(0x139)]();if(!_0x273c20)throw CliErrors['validation'](_0x50524a(0x151));return _0x273c20;}function a142_0x47a5(){const _0x5665c0=['status','map','description','length','1168083EkOLND','ossPath','1247229hYHjSn','manifest','193783IfCdjQ','449080vZDqhi','forkedFromVersion','path','tags','4SYiYAf','Runtime\x20Skill\x20is\x20missing\x20skillCode.','isArray','parse','files','toISOString','zipSha256','skillName','881090aNIMJe','458759jHqIHj','userId','forkedFromSkillId','24KHHoHr','tenantCode','trim','example','skillCode','validation','hasUpstreamUpdate','4071416pxzGLS','object','sourceSessionId','string','fromEntries'];a142_0x47a5=function(){return _0x5665c0;};return a142_0x47a5();}export function readMetadataIfPresent(_0x13dba7){const _0x187cb1=a142_0x1771;if(!existsSync(_0x13dba7))return undefined;try{const _0x229fca=JSON[_0x187cb1(0x153)](readFileSync(_0x13dba7,'utf8'));return _0x229fca;}catch{throw CliErrors[_0x187cb1(0x13c)]('Invalid\x20'+METADATA_FILE+':\x20'+_0x13dba7);}}function remoteManifestOssPath(_0x592708){const _0x4a78eb=a142_0x1771;if(!_0x592708||typeof _0x592708!==_0x4a78eb(0x13f)||Array[_0x4a78eb(0x152)](_0x592708))return undefined;const _0x5a147e=_0x592708[_0x4a78eb(0x148)];return typeof _0x5a147e===_0x4a78eb(0x141)&&_0x5a147e[_0x4a78eb(0x139)]()?_0x5a147e['trim']():undefined;}
@@ -1 +1 @@
1
- function a143_0x2628(){const _0x2f4b69=['appCode','.claude','skills','validation','126PTqkDQ','SKILL_ROOT','8SahlyL','7504875pWYaTs','claudeSkillsDir','26970atNhpV','homeDirName','5720092MLgIMl','650116nKWDqB','includes','skillCode','5262960GOFhDY','2eGAlSg','trim','cacheRoot','446655WMpOXa','27140VWBPUX','3377EedoJD','filter','.workbuddy','agentsSkillsDir','cache'];a143_0x2628=function(){return _0x2f4b69;};return a143_0x2628();}(function(_0x6462be,_0x423cfa){const _0x2817ef=a143_0x5e1b,_0x33419e=_0x6462be();while(!![]){try{const _0x4fd416=parseInt(_0x2817ef(0x1ef))/0x1*(parseInt(_0x2817ef(0x1f3))/0x2)+-parseInt(_0x2817ef(0x1dc))/0x3*(-parseInt(_0x2817ef(0x1e9))/0x4)+parseInt(_0x2817ef(0x1dd))/0x5*(-parseInt(_0x2817ef(0x1e7))/0x6)+parseInt(_0x2817ef(0x1ee))/0x7+parseInt(_0x2817ef(0x1f2))/0x8+-parseInt(_0x2817ef(0x1ea))/0x9+-parseInt(_0x2817ef(0x1ec))/0xa*(parseInt(_0x2817ef(0x1de))/0xb);if(_0x4fd416===_0x423cfa)break;else _0x33419e['push'](_0x33419e['shift']());}catch(_0x5d01a4){_0x33419e['push'](_0x33419e['shift']());}}}(a143_0x2628,0x9df9e));import{existsSync}from'node:fs';import{homedir}from'node:os';import{resolve}from'node:path';import{fingerprintAccessKey}from'../../commands/app/cache.js';import{PRODUCT_CONFIG,productEnv}from'../../constant/product.js';import{CliErrors}from'../../errors.js';export function resolveSkillSyncPaths(_0x5a2205={}){const _0x17bb15=a143_0x5e1b,_0x36c30d=_0x5a2205['homeDir']??homedir(),_0x4b3936=resolve(_0x36c30d,PRODUCT_CONFIG[_0x17bb15(0x1ed)],_0x17bb15(0x1e2)),_0x5b555c=trimmedEnv(_0x17bb15(0x1e8)),_0x4e404d=trimmedEnv('CLAUDE_SKILL_ROOT'),_0x4b506f=resolve(_0x36c30d,_0x17bb15(0x1e0)),_0x37489a=_0x5a2205['workbuddySkillsDir']??(existsSync(_0x4b506f)?resolve(_0x4b506f,_0x17bb15(0x1e5)):undefined);return{'homeDir':_0x36c30d,'cacheRoot':_0x4b3936,'managedRoot':resolve(_0x36c30d,PRODUCT_CONFIG[_0x17bb15(0x1ed)]),'agentsSkillsDir':_0x5a2205[_0x17bb15(0x1e1)]??_0x5b555c??resolve(_0x36c30d,'.agents',_0x17bb15(0x1e5)),'claudeSkillsDir':_0x5a2205['claudeSkillsDir']??_0x4e404d??resolve(_0x36c30d,_0x17bb15(0x1e4),'skills'),'workbuddySkillsDir':_0x37489a};}export function runtimeAgentSkillRoots(_0x3dd1ba){const _0x306e6c=a143_0x5e1b;return[_0x3dd1ba['agentsSkillsDir'],_0x3dd1ba[_0x306e6c(0x1eb)],_0x3dd1ba['workbuddySkillsDir']][_0x306e6c(0x1df)](_0x317d7c=>Boolean(_0x317d7c));}export function getRuntimeSkillCacheRoot(_0x4e58b3,_0x14ea36,_0x550ffa={}){const _0x1d274c=a143_0x5e1b,_0x5b77a0=resolveSkillSyncPaths(_0x550ffa);return resolve(_0x5b77a0[_0x1d274c(0x1db)],_0x4e58b3,fingerprintAccessKey(_0x14ea36),_0x1d274c(0x1e5));}function a143_0x5e1b(_0x4cdf6e,_0x4b0b18){_0x4cdf6e=_0x4cdf6e-0x1db;const _0x2628df=a143_0x2628();let _0x5e1b4e=_0x2628df[_0x4cdf6e];return _0x5e1b4e;}export function getRuntimeSkillDir(_0x10f460,_0x523f4e,_0x1385e2,_0x22ff24,_0x377e30,_0x29584f={}){const _0x44c736=a143_0x5e1b;return resolve(getRuntimeSkillCacheRoot(_0x10f460,_0x523f4e,_0x29584f),safePathSegment(_0x1385e2,_0x44c736(0x1e3)),_0x22ff24,safePathSegment(_0x377e30,_0x44c736(0x1f1)));}export function safePathSegment(_0x41a2fc,_0x44c0f6='path\x20segment'){const _0x1953ae=a143_0x5e1b;if(!_0x41a2fc||_0x41a2fc[_0x1953ae(0x1f0)]('/')||_0x41a2fc[_0x1953ae(0x1f0)]('\x5c')||_0x41a2fc[_0x1953ae(0x1f0)]('..'))throw CliErrors[_0x1953ae(0x1e6)]('Unsafe\x20'+_0x44c0f6+'\x20for\x20local\x20path:\x20'+_0x41a2fc);return _0x41a2fc;}function trimmedEnv(_0x579517){const _0x4a3e9a=a143_0x5e1b,_0x5d43ae=productEnv(_0x579517)?.[_0x4a3e9a(0x1f4)]();return _0x5d43ae?_0x5d43ae:undefined;}
1
+ const a143_0x4f44d=a143_0x5d5a;function a143_0xd577(){const _0xeccac8=['615VDRRyo','homeDirName','skills','.claude','cache','cacheRoot','path\x20segment','claudeSkillsDir','skillCode','1054973iiwUXe','2482252ahObxr','\x20for\x20local\x20path:\x20','trim','SKILL_ROOT','homeDir','agentsSkillsDir','56NIspmH','648557YwycNF','6474852EySqIQ','CLAUDE_SKILL_ROOT','2afSfBN','1229427esfIht','Unsafe\x20','includes','6720kUvBpZ','.workbuddy','7194740DbgQlA','workbuddySkillsDir'];a143_0xd577=function(){return _0xeccac8;};return a143_0xd577();}(function(_0x2663de,_0x341571){const _0x332236=a143_0x5d5a,_0x3ac3a3=_0x2663de();while(!![]){try{const _0xb0c32d=parseInt(_0x332236(0xb2))/0x1+parseInt(_0x332236(0xbd))/0x2*(-parseInt(_0x332236(0xbe))/0x3)+-parseInt(_0x332236(0xb3))/0x4+parseInt(_0x332236(0xa9))/0x5*(-parseInt(_0x332236(0xa5))/0x6)+parseInt(_0x332236(0xba))/0x7*(parseInt(_0x332236(0xb9))/0x8)+-parseInt(_0x332236(0xbb))/0x9+parseInt(_0x332236(0xa7))/0xa;if(_0xb0c32d===_0x341571)break;else _0x3ac3a3['push'](_0x3ac3a3['shift']());}catch(_0x203897){_0x3ac3a3['push'](_0x3ac3a3['shift']());}}}(a143_0xd577,0x82b94));import{existsSync}from'node:fs';import{homedir}from'node:os';import{resolve}from'node:path';import{fingerprintAccessKey}from'../../commands/app/cache.js';function a143_0x5d5a(_0x217d7f,_0x51e584){_0x217d7f=_0x217d7f-0xa5;const _0xd57750=a143_0xd577();let _0x5d5a49=_0xd57750[_0x217d7f];return _0x5d5a49;}import{PRODUCT_CONFIG,productEnv}from'../../constant/product.js';import{CliErrors}from'../../errors.js';export function resolveSkillSyncPaths(_0x555724={}){const _0x43e96b=a143_0x5d5a,_0x100b17=_0x555724[_0x43e96b(0xb7)]??homedir(),_0x11b009=resolve(_0x100b17,PRODUCT_CONFIG[_0x43e96b(0xaa)],_0x43e96b(0xad)),_0x13a641=trimmedEnv(_0x43e96b(0xb6)),_0x5ddb10=trimmedEnv(_0x43e96b(0xbc)),_0x11d310=resolve(_0x100b17,_0x43e96b(0xa6)),_0x148071=_0x555724[_0x43e96b(0xa8)]??(existsSync(_0x11d310)?resolve(_0x11d310,'skills'):undefined);return{'homeDir':_0x100b17,'cacheRoot':_0x11b009,'managedRoot':resolve(_0x100b17,PRODUCT_CONFIG[_0x43e96b(0xaa)]),'agentsSkillsDir':_0x555724[_0x43e96b(0xb8)]??_0x13a641??resolve(_0x100b17,'.agents','skills'),'claudeSkillsDir':_0x555724[_0x43e96b(0xb0)]??_0x5ddb10??resolve(_0x100b17,_0x43e96b(0xac),'skills'),'workbuddySkillsDir':_0x148071};}export function runtimeAgentSkillRoots(_0x2f104e){const _0x1798a3=a143_0x5d5a;return[_0x2f104e[_0x1798a3(0xb8)],_0x2f104e[_0x1798a3(0xb0)],_0x2f104e[_0x1798a3(0xa8)]]['filter'](_0x2d5129=>Boolean(_0x2d5129));}export function getRuntimeSkillCacheRoot(_0x5aa2b8,_0x26c98a,_0x5e54fa={}){const _0x3e7516=a143_0x5d5a,_0x32f1a1=resolveSkillSyncPaths(_0x5e54fa);return resolve(_0x32f1a1[_0x3e7516(0xae)],_0x5aa2b8,fingerprintAccessKey(_0x26c98a),_0x3e7516(0xab));}export function getRuntimeSkillDir(_0x282780,_0x43b641,_0x1098d5,_0x327e73,_0x2a8735,_0x2ef681={}){const _0x143970=a143_0x5d5a;return resolve(getRuntimeSkillCacheRoot(_0x282780,_0x43b641,_0x2ef681),safePathSegment(_0x1098d5,'appCode'),_0x327e73,safePathSegment(_0x2a8735,_0x143970(0xb1)));}export function safePathSegment(_0x8a195f,_0x8aaf20=a143_0x4f44d(0xaf)){const _0x13f292=a143_0x4f44d;if(!_0x8a195f||_0x8a195f[_0x13f292(0xc0)]('/')||_0x8a195f['includes']('\x5c')||_0x8a195f['includes']('..'))throw CliErrors['validation'](_0x13f292(0xbf)+_0x8aaf20+_0x13f292(0xb4)+_0x8a195f);return _0x8a195f;}function trimmedEnv(_0x344924){const _0x9e3a78=a143_0x4f44d,_0x13e036=productEnv(_0x344924)?.[_0x9e3a78(0xb5)]();return _0x13e036?_0x13e036:undefined;}
@@ -1 +1 @@
1
- function a144_0x3426(){const _0xa18545=['ignoreMetadataSkillCode','utf8','Remote\x20Skill\x20','12dkEffs','metadata','sourceSessionId','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20','displayName','Skill\x20metadata\x20appCode\x20\x22','Unable\x20to\x20resolve\x20skillCode\x20from\x20','name','isArray','Missing\x20','skillName','trim','version','manifest','boolean','\x20has\x20unsupported\x20scope\x20\x22','example','ignoreMetadataAppCodeMismatch','310484nZFmcA','object','toLowerCase','some','dir','isDirectory','skillCode','allowAppCodeRetarget','111220voSMkH','isSymbolicLink','packageBase64','personal','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20','targetScope','1986192DwmBNv','203DzfIZH','\x20to\x20submit\x20company\x20Skills\x20for\x20review.','replace','length','25490GNJnco','\x20name\x20for\x20SkillHub\x20slug\x20generation.','slice','(unknown)',',\x20or\x20directory\x20name.','appCode','scope','Skill\x20directory\x20not\x20found:\x20','tags','match','455841Ynqvzu','3GEkcQf','builtin','isFile','files','Invalid\x20','ignoreMetadataScope','validation','company','319DJNiya','ignoreInvalidMetadata','excludedFilePaths','104kunWLd','31056fSkmgv','Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20','pushedAt','number','\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22','path','content'];a144_0x3426=function(){return _0xa18545;};return a144_0x3426();}(function(_0x76318f,_0x21a81e){const _0x4014f2=a144_0x46e8,_0xdf8187=_0x76318f();while(!![]){try{const _0x92dcc6=-parseInt(_0x4014f2(0x112))/0x1+-parseInt(_0x4014f2(0x12e))/0x2*(-parseInt(_0x4014f2(0x14c))/0x3)+parseInt(_0x4014f2(0x111))/0x4*(parseInt(_0x4014f2(0x141))/0x5)+-parseInt(_0x4014f2(0x11c))/0x6*(-parseInt(_0x4014f2(0x13d))/0x7)+parseInt(_0x4014f2(0x13c))/0x8+-parseInt(_0x4014f2(0x14b))/0x9+-parseInt(_0x4014f2(0x136))/0xa*(parseInt(_0x4014f2(0x10e))/0xb);if(_0x92dcc6===_0x21a81e)break;else _0xdf8187['push'](_0xdf8187['shift']());}catch(_0x5abfaf){_0xdf8187['push'](_0xdf8187['shift']());}}}(a144_0x3426,0x20327));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';function a144_0x46e8(_0x371021,_0x2f89be){_0x371021=_0x371021-0x108;const _0x3426d1=a144_0x3426();let _0x46e8c8=_0x3426d1[_0x371021];return _0x46e8c8;}import{basename,resolve}from'node:path';import{parse as a144_0x213816}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(_0x411721,_0x56e6a2,_0x16d3e7={}){const _0x13a7f2=a144_0x46e8,_0x59cb9a=resolvePushDirectoryRoot(_0x411721),_0x4c328d=readPushMetadataIfPresent(resolve(_0x59cb9a,METADATA_FILE),{'ignoreInvalidMetadata':_0x16d3e7['ignoreInvalidMetadata']});if(_0x4c328d?.[_0x13a7f2(0x146)]&&_0x4c328d['appCode']!==_0x56e6a2&&!_0x16d3e7[_0x13a7f2(0x135)]&&!_0x16d3e7[_0x13a7f2(0x12d)])throw CliErrors['validation'](_0x13a7f2(0x121)+_0x4c328d[_0x13a7f2(0x146)]+_0x13a7f2(0x116)+_0x56e6a2+'\x22.');const _0x495e41=resolvePushSkillCode(_0x59cb9a,_0x56e6a2,_0x4c328d,_0x16d3e7);if(!_0x495e41)throw CliErrors[_0x13a7f2(0x10c)](_0x13a7f2(0x122)+SKILL_FILE+',\x20'+METADATA_FILE+_0x13a7f2(0x145));return{'dir':_0x59cb9a,'skillCode':_0x495e41,'metadata':_0x4c328d};}export function readPushDirectory(_0x2bb2ec,_0x185dc8,_0x24e776={}){const _0x4864b9=a144_0x46e8,_0x3ad7d8=resolvePushDirectoryIdentity(_0x2bb2ec,_0x185dc8,_0x24e776),_0x5d7a0e=_0x3ad7d8[_0x4864b9(0x132)],_0xf1e6ad=resolve(_0x5d7a0e,SKILL_FILE);if(!existsSync(_0xf1e6ad)||!lstatSync(_0xf1e6ad)[_0x4864b9(0x108)]())throw CliErrors[_0x4864b9(0x10c)](_0x4864b9(0x125)+SKILL_FILE+':\x20'+_0xf1e6ad);const _0x2a598d=_0x3ad7d8[_0x4864b9(0x11d)],_0x40fe51=_0x24e776[_0x4864b9(0x13b)]??_0x4864b9(0x139);if(!_0x24e776[_0x4864b9(0x10b)]&&_0x2a598d?.[_0x4864b9(0x147)]===_0x4864b9(0x14d))throw CliErrors[_0x4864b9(0x10c)](_0x4864b9(0x113)+METADATA_FILE+'\x20has\x20scope=\x22'+_0x2a598d[_0x4864b9(0x147)]+'\x22.');if(!_0x24e776[_0x4864b9(0x10b)]&&_0x40fe51===_0x4864b9(0x139)&&_0x2a598d?.[_0x4864b9(0x147)]&&_0x2a598d[_0x4864b9(0x147)]!==_0x4864b9(0x139))throw CliErrors[_0x4864b9(0x10c)](_0x4864b9(0x13a)+METADATA_FILE+'\x20has\x20scope=\x22'+_0x2a598d[_0x4864b9(0x147)]+'\x22.',_0x4864b9(0x11f)+_0x5d7a0e+_0x4864b9(0x13e));const _0x47dbd7=scanSkillDirectory(_0x5d7a0e,{'excludedFilePaths':_0x24e776[_0x4864b9(0x110)]}),_0x148e8c=buildSkillPackage(_0x47dbd7),_0xb09459=readFileSync(_0xf1e6ad,_0x4864b9(0x11a)),_0xd69087=_0x3ad7d8[_0x4864b9(0x134)],_0x5aa5f4=_0x24e776['ignoreMetadataForPayload']?undefined:_0x2a598d,_0xd80455=readSkillDisplayName(_0xb09459);return{'skillCode':_0xd69087,'metadata':_0x2a598d,'frontmatterDisplayName':_0xd80455,'input':{'skillCode':_0xd69087,'skillName':_0xd80455??_0x5aa5f4?.['skillName'],'description':_0x5aa5f4?.['description'],'content':_0xb09459,'files':_0x148e8c[_0x4864b9(0x129)],'packageBase64':_0x148e8c[_0x4864b9(0x138)],'tags':_0x5aa5f4?.[_0x4864b9(0x149)],'version':_0x5aa5f4?.[_0x4864b9(0x128)],'sourceSessionId':_0x5aa5f4?.['sourceSessionId']}};}export function refreshPushDirectoryMetadataFromRemote(_0x2ed2ae,_0x29e702,_0x6423e1,_0x56821f={}){const _0x12baf0=a144_0x46e8,_0x1a9493=resolvePushDirectoryRoot(_0x2ed2ae),_0x208e57=readPushMetadataIfPresent(resolve(_0x1a9493,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x209b9e=requireRemoteScope(_0x29e702),_0xfc23=readLocalSkillContent(_0x1a9493),_0x27b5b5={..._0x29e702,'appCode':_0x29e702[_0x12baf0(0x146)]??_0x6423e1,'skillName':_0x29e702['skillName']??_0x208e57?.[_0x12baf0(0x126)],'description':_0x29e702['description']??_0x208e57?.['description'],'example':_0x29e702[_0x12baf0(0x12c)]??_0x208e57?.[_0x12baf0(0x12c)],'tags':Array[_0x12baf0(0x124)](_0x29e702[_0x12baf0(0x149)])?_0x29e702[_0x12baf0(0x149)]:_0x208e57?.[_0x12baf0(0x149)],'sourceSessionId':_0x29e702[_0x12baf0(0x11e)]??_0x208e57?.[_0x12baf0(0x11e)],'content':_0x29e702['content']??_0xfc23},_0x375e6f=buildMetadata(_0x27b5b5,_0x209b9e,_0x6423e1,contentHash(_0xfc23),_0x56821f['refreshedAt']);writeJsonAtomic(resolve(_0x1a9493,METADATA_FILE),_0x375e6f);}export function recordPushedRuntimeSkill(_0x5226f5,_0x37f401,_0x2a43ac,_0x2e474c={}){const _0x5d680a=a144_0x46e8,_0x5ea048=resolvePushDirectoryRoot(_0x5226f5),_0x188824=scanSkillDirectory(_0x5ea048),_0x29ddc6=_0x188824['find'](_0x19d3f4=>_0x19d3f4[_0x5d680a(0x117)]===SKILL_FILE),_0x7ceb38=_0x29ddc6?fileText(_0x29ddc6):'',_0x4d1b1e=tryNormalizePackageManifest(_0x37f401[_0x5d680a(0x109)]),_0x5c5a7e={..._0x37f401,'content':_0x37f401[_0x5d680a(0x118)]??_0x7ceb38,'files':_0x4d1b1e},_0x21caf7=_0x4d1b1e?normalizeLocalFiles(_0x188824)['filter'](_0x3585fd=>_0x4d1b1e[_0x5d680a(0x109)][_0x5d680a(0x131)](_0x2c80e2=>_0x2c80e2[_0x5d680a(0x117)]===_0x3585fd['path'])):undefined,_0x1b281b=buildMetadata(_0x5c5a7e,_0x2e474c[_0x5d680a(0x147)]??_0x5d680a(0x139),_0x2a43ac,contentHash(_0x5c5a7e['content']??''),_0x2e474c[_0x5d680a(0x114)],_0x21caf7);writeJsonAtomic(resolve(_0x5ea048,METADATA_FILE),_0x1b281b);}export function deriveSkillCodeFromDirectory(_0x485ed2,_0x57c57e){const _0x4a20d2=a144_0x46e8,_0x583624=basename(resolve(_0x485ed2)),_0x473480=_0x57c57e+'--';return _0x583624['startsWith'](_0x473480)?_0x583624[_0x4a20d2(0x143)](_0x473480[_0x4a20d2(0x140)]):_0x583624;}function resolvePushSkillCode(_0x594099,_0x257c16,_0x40383b,_0x3396a9){const _0x3276fe=a144_0x46e8,_0x400952=deriveSkillCodeFromSkillFile(_0x594099)||deriveSkillCodeFromDirectory(_0x594099,_0x257c16);if(_0x3396a9[_0x3276fe(0x119)])return _0x400952;return _0x40383b?.[_0x3276fe(0x134)]?.[_0x3276fe(0x127)]()||_0x400952;}function deriveSkillCodeFromSkillFile(_0xb38b43){const _0x3fbbdd=a144_0x46e8,_0x221119=resolve(_0xb38b43,SKILL_FILE);if(!existsSync(_0x221119)||!lstatSync(_0x221119)[_0x3fbbdd(0x108)]())return undefined;const _0x5cf96c=readFileSync(_0x221119,_0x3fbbdd(0x11a)),_0xf11308=_0x5cf96c[_0x3fbbdd(0x14a)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0xf11308)return undefined;const _0x1c3b35=parseFrontmatterObject(_0xf11308[0x1]??''),_0x530b1e=scalarToString(_0x1c3b35?.[_0x3fbbdd(0x123)]);return _0x530b1e?slugifySkillName(_0x530b1e):undefined;}function readSkillDisplayName(_0x291c33){const _0x28e785=a144_0x46e8,_0x45c258=_0x291c33[_0x28e785(0x14a)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x45c258)return undefined;const _0xf2cf27=parseFrontmatterObject(_0x45c258[0x1]??'');return scalarToString(_0xf2cf27?.[_0x28e785(0x120)]);}function slugifySkillName(_0x79d69b){const _0xe70285=a144_0x46e8,_0x20eac7=_0x79d69b['trim']()[_0xe70285(0x130)]()[_0xe70285(0x13f)](/[^\p{L}\p{N}\p{So}]+/gu,'-')[_0xe70285(0x13f)](/^-+/,'')[_0xe70285(0x13f)](/-+$/,'')[_0xe70285(0x13f)](/-{2,}/g,'-');if(!_0x20eac7)throw CliErrors[_0xe70285(0x10c)](_0xe70285(0x10a)+SKILL_FILE+_0xe70285(0x142));return _0x20eac7;}function parseFrontmatterObject(_0x3f7182){const _0x20a33e=a144_0x46e8;try{const _0x275e38=a144_0x213816(_0x3f7182);return _0x275e38&&typeof _0x275e38===_0x20a33e(0x12f)&&!Array[_0x20a33e(0x124)](_0x275e38)?_0x275e38:undefined;}catch{return undefined;}}function scalarToString(_0x349813){const _0x593d47=a144_0x46e8;if(typeof _0x349813==='string')return _0x349813[_0x593d47(0x127)]();if(typeof _0x349813===_0x593d47(0x115)||typeof _0x349813===_0x593d47(0x12a))return String(_0x349813);return undefined;}function resolvePushDirectoryRoot(_0x4a77c2){const _0x1d45f9=a144_0x46e8,_0xf089a7=resolve(_0x4a77c2);if(!existsSync(_0xf089a7))throw CliErrors['validation'](_0x1d45f9(0x148)+_0x4a77c2);const _0x402e4e=lstatSync(_0xf089a7);if(_0x402e4e[_0x1d45f9(0x133)]())return _0xf089a7;if(_0x402e4e[_0x1d45f9(0x137)]()){const _0xb0669f=realpathSync(_0xf089a7);if(lstatSync(_0xb0669f)['isDirectory']())return _0xb0669f;}throw CliErrors[_0x1d45f9(0x10c)]('Skill\x20directory\x20not\x20found:\x20'+_0x4a77c2);}function requireRemoteScope(_0x121c24){const _0x459bd=a144_0x46e8;if(_0x121c24[_0x459bd(0x147)]===_0x459bd(0x139)||_0x121c24[_0x459bd(0x147)]===_0x459bd(0x10d)||_0x121c24[_0x459bd(0x147)]==='builtin')return _0x121c24['scope'];throw CliErrors[_0x459bd(0x10c)](_0x459bd(0x11b)+(_0x121c24['skillCode']||_0x459bd(0x144))+_0x459bd(0x12b)+(_0x121c24[_0x459bd(0x147)]??'unknown')+'\x22.');}function readLocalSkillContent(_0x107648){const _0x5ec5ee=a144_0x46e8,_0x591896=resolve(_0x107648,SKILL_FILE);return existsSync(_0x591896)&&lstatSync(_0x591896)[_0x5ec5ee(0x108)]()?readFileSync(_0x591896,_0x5ec5ee(0x11a)):'';}function readPushMetadataIfPresent(_0x40ff0a,_0x471f69={}){const _0x42a8eb=a144_0x46e8;try{return readMetadataIfPresent(_0x40ff0a);}catch(_0x446125){if(_0x471f69[_0x42a8eb(0x10f)])return undefined;throw _0x446125;}}
1
+ (function(_0x16ec4b,_0x2f98dc){const _0x10811c=a144_0x12ec,_0x4d6df0=_0x16ec4b();while(!![]){try{const _0x111812=-parseInt(_0x10811c(0x1fa))/0x1*(parseInt(_0x10811c(0x1cb))/0x2)+parseInt(_0x10811c(0x207))/0x3+-parseInt(_0x10811c(0x1fe))/0x4*(-parseInt(_0x10811c(0x205))/0x5)+parseInt(_0x10811c(0x1e3))/0x6*(-parseInt(_0x10811c(0x1dc))/0x7)+-parseInt(_0x10811c(0x203))/0x8+parseInt(_0x10811c(0x1d5))/0x9+parseInt(_0x10811c(0x206))/0xa;if(_0x111812===_0x2f98dc)break;else _0x4d6df0['push'](_0x4d6df0['shift']());}catch(_0x2629cf){_0x4d6df0['push'](_0x4d6df0['shift']());}}}(a144_0x2a1d,0xb2d55));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a144_0x4a19ac}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';function a144_0x2a1d(){const _0x28dca4=['\x20has\x20scope=\x22','scope','object','ignoreInvalidMetadata','validation','personal','28742WYemvv','startsWith','match','string','tags','appCode','Missing\x20','\x20name\x20for\x20SkillHub\x20slug\x20generation.','builtin','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20','1190610EiOeIh','ignoreMetadataAppCodeMismatch','path','replace','utf8','number','skillCode','2523332AAfdVk','find','slice','isArray','sourceSessionId','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20','boolean','6KyrFgt','Remote\x20Skill\x20','name','isFile','dir','packageBase64','isDirectory','\x20to\x20submit\x20company\x20Skills\x20for\x20review.','company','ignoreMetadataScope','skillName','example','files','Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20',',\x20or\x20directory\x20name.','refreshedAt','excludedFilePaths','Skill\x20directory\x20not\x20found:\x20','pushedAt','version','content','description','ignoreMetadataForPayload','59FEINNd','displayName','ignoreMetadataSkillCode','metadata','732616gfTUXz','Unable\x20to\x20resolve\x20skillCode\x20from\x20','targetScope','Invalid\x20','trim','7800152hIgsOR','manifest','35zgzoWA','5490990cKXmPl','2857254xdLNWI'];a144_0x2a1d=function(){return _0x28dca4;};return a144_0x2a1d();}import{writeJsonAtomic}from'./fs-utils.js';import{contentHash}from'./hashing.js';function a144_0x12ec(_0x430fbc,_0x129b61){_0x430fbc=_0x430fbc-0x1c9;const _0x2a1dd4=a144_0x2a1d();let _0x12ecfb=_0x2a1dd4[_0x430fbc];return _0x12ecfb;}import{fileText,normalizeLocalFiles,scanSkillDirectory}from'./local-files.js';import{buildMetadata,readMetadataIfPresent}from'./metadata.js';import{buildSkillPackage,tryNormalizePackageManifest}from'./zip-package.js';export function resolvePushDirectoryIdentity(_0x14e544,_0x5a9ee0,_0x4a9160={}){const _0x367009=a144_0x12ec,_0x2508c0=resolvePushDirectoryRoot(_0x14e544),_0x5a4e2d=readPushMetadataIfPresent(resolve(_0x2508c0,METADATA_FILE),{'ignoreInvalidMetadata':_0x4a9160[_0x367009(0x20b)]});if(_0x5a4e2d?.[_0x367009(0x1d0)]&&_0x5a4e2d['appCode']!==_0x5a9ee0&&!_0x4a9160['allowAppCodeRetarget']&&!_0x4a9160[_0x367009(0x1d6)])throw CliErrors[_0x367009(0x1c9)]('Skill\x20metadata\x20appCode\x20\x22'+_0x5a4e2d['appCode']+'\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22'+_0x5a9ee0+'\x22.');const _0xbb0d74=resolvePushSkillCode(_0x2508c0,_0x5a9ee0,_0x5a4e2d,_0x4a9160);if(!_0xbb0d74)throw CliErrors[_0x367009(0x1c9)](_0x367009(0x1ff)+SKILL_FILE+',\x20'+METADATA_FILE+_0x367009(0x1f1));return{'dir':_0x2508c0,'skillCode':_0xbb0d74,'metadata':_0x5a4e2d};}export function readPushDirectory(_0x546b5e,_0x19a699,_0x2f200e={}){const _0x3a7e2a=a144_0x12ec,_0x44520f=resolvePushDirectoryIdentity(_0x546b5e,_0x19a699,_0x2f200e),_0x3727be=_0x44520f[_0x3a7e2a(0x1e7)],_0x5d7b29=resolve(_0x3727be,SKILL_FILE);if(!existsSync(_0x5d7b29)||!lstatSync(_0x5d7b29)[_0x3a7e2a(0x1e6)]())throw CliErrors[_0x3a7e2a(0x1c9)](_0x3a7e2a(0x1d1)+SKILL_FILE+':\x20'+_0x5d7b29);const _0x2942d7=_0x44520f[_0x3a7e2a(0x1fd)],_0x567ebf=_0x2f200e[_0x3a7e2a(0x200)]??_0x3a7e2a(0x1ca);if(!_0x2f200e['ignoreMetadataScope']&&_0x2942d7?.['scope']===_0x3a7e2a(0x1d3))throw CliErrors['validation'](_0x3a7e2a(0x1f0)+METADATA_FILE+_0x3a7e2a(0x208)+_0x2942d7['scope']+'\x22.');if(!_0x2f200e[_0x3a7e2a(0x1ec)]&&_0x567ebf===_0x3a7e2a(0x1ca)&&_0x2942d7?.['scope']&&_0x2942d7[_0x3a7e2a(0x209)]!==_0x3a7e2a(0x1ca))throw CliErrors[_0x3a7e2a(0x1c9)](_0x3a7e2a(0x1d4)+METADATA_FILE+_0x3a7e2a(0x208)+_0x2942d7[_0x3a7e2a(0x209)]+'\x22.',_0x3a7e2a(0x1e1)+_0x3727be+_0x3a7e2a(0x1ea));const _0x36b896=scanSkillDirectory(_0x3727be,{'excludedFilePaths':_0x2f200e[_0x3a7e2a(0x1f3)]}),_0x3c42e6=buildSkillPackage(_0x36b896),_0x22378b=readFileSync(_0x5d7b29,'utf8'),_0x307769=_0x44520f[_0x3a7e2a(0x1db)],_0x5967a9=_0x2f200e[_0x3a7e2a(0x1f9)]?undefined:_0x2942d7,_0x48d3f1=readSkillDisplayName(_0x22378b);return{'skillCode':_0x307769,'metadata':_0x2942d7,'frontmatterDisplayName':_0x48d3f1,'input':{'skillCode':_0x307769,'skillName':_0x48d3f1??_0x5967a9?.[_0x3a7e2a(0x1ed)],'description':_0x5967a9?.[_0x3a7e2a(0x1f8)],'content':_0x22378b,'files':_0x3c42e6[_0x3a7e2a(0x204)],'packageBase64':_0x3c42e6[_0x3a7e2a(0x1e8)],'tags':_0x5967a9?.[_0x3a7e2a(0x1cf)],'version':_0x5967a9?.[_0x3a7e2a(0x1f6)],'sourceSessionId':_0x5967a9?.['sourceSessionId']}};}export function refreshPushDirectoryMetadataFromRemote(_0x3dc65f,_0x1251f1,_0xe75387,_0x2ece6b={}){const _0x5addbd=a144_0x12ec,_0x22e427=resolvePushDirectoryRoot(_0x3dc65f),_0xb21343=readPushMetadataIfPresent(resolve(_0x22e427,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x2b7fb6=requireRemoteScope(_0x1251f1),_0x5bbe18=readLocalSkillContent(_0x22e427),_0x36bd99={..._0x1251f1,'appCode':_0x1251f1['appCode']??_0xe75387,'skillName':_0x1251f1[_0x5addbd(0x1ed)]??_0xb21343?.[_0x5addbd(0x1ed)],'description':_0x1251f1[_0x5addbd(0x1f8)]??_0xb21343?.['description'],'example':_0x1251f1['example']??_0xb21343?.[_0x5addbd(0x1ee)],'tags':Array[_0x5addbd(0x1df)](_0x1251f1[_0x5addbd(0x1cf)])?_0x1251f1[_0x5addbd(0x1cf)]:_0xb21343?.[_0x5addbd(0x1cf)],'sourceSessionId':_0x1251f1[_0x5addbd(0x1e0)]??_0xb21343?.[_0x5addbd(0x1e0)],'content':_0x1251f1[_0x5addbd(0x1f7)]??_0x5bbe18},_0xfa6e9b=buildMetadata(_0x36bd99,_0x2b7fb6,_0xe75387,contentHash(_0x5bbe18),_0x2ece6b[_0x5addbd(0x1f2)]);writeJsonAtomic(resolve(_0x22e427,METADATA_FILE),_0xfa6e9b);}export function recordPushedRuntimeSkill(_0x1b1fb4,_0x23648f,_0x5c4944,_0x17760a={}){const _0x5848ce=a144_0x12ec,_0x5d1a59=resolvePushDirectoryRoot(_0x1b1fb4),_0x1365f5=scanSkillDirectory(_0x5d1a59),_0x4bcbfe=_0x1365f5[_0x5848ce(0x1dd)](_0x115533=>_0x115533[_0x5848ce(0x1d7)]===SKILL_FILE),_0x366376=_0x4bcbfe?fileText(_0x4bcbfe):'',_0x192804=tryNormalizePackageManifest(_0x23648f['files']),_0x14ffee={..._0x23648f,'content':_0x23648f[_0x5848ce(0x1f7)]??_0x366376,'files':_0x192804},_0xe22d0e=_0x192804?normalizeLocalFiles(_0x1365f5)['filter'](_0x4c9877=>_0x192804[_0x5848ce(0x1ef)]['some'](_0x32cdbf=>_0x32cdbf['path']===_0x4c9877['path'])):undefined,_0x4662a4=buildMetadata(_0x14ffee,_0x17760a[_0x5848ce(0x209)]??_0x5848ce(0x1ca),_0x5c4944,contentHash(_0x14ffee['content']??''),_0x17760a[_0x5848ce(0x1f5)],_0xe22d0e);writeJsonAtomic(resolve(_0x5d1a59,METADATA_FILE),_0x4662a4);}export function deriveSkillCodeFromDirectory(_0x94c70,_0x2f3d48){const _0x56dc96=a144_0x12ec,_0x1193e7=basename(resolve(_0x94c70)),_0x2955c2=_0x2f3d48+'--';return _0x1193e7[_0x56dc96(0x1cc)](_0x2955c2)?_0x1193e7[_0x56dc96(0x1de)](_0x2955c2['length']):_0x1193e7;}function resolvePushSkillCode(_0x9af777,_0x5e15d7,_0x1d8380,_0x5ed767){const _0x4e6058=a144_0x12ec,_0xc8fe64=deriveSkillCodeFromSkillFile(_0x9af777)||deriveSkillCodeFromDirectory(_0x9af777,_0x5e15d7);if(_0x5ed767[_0x4e6058(0x1fc)])return _0xc8fe64;return _0x1d8380?.[_0x4e6058(0x1db)]?.['trim']()||_0xc8fe64;}function deriveSkillCodeFromSkillFile(_0x3f1e1d){const _0x400f33=a144_0x12ec,_0x17b8ae=resolve(_0x3f1e1d,SKILL_FILE);if(!existsSync(_0x17b8ae)||!lstatSync(_0x17b8ae)['isFile']())return undefined;const _0x183b5e=readFileSync(_0x17b8ae,_0x400f33(0x1d9)),_0x1e8937=_0x183b5e[_0x400f33(0x1cd)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x1e8937)return undefined;const _0x44b1cc=parseFrontmatterObject(_0x1e8937[0x1]??''),_0x43c12c=scalarToString(_0x44b1cc?.[_0x400f33(0x1e5)]);return _0x43c12c?slugifySkillName(_0x43c12c):undefined;}function readSkillDisplayName(_0x4f4903){const _0x2ca85e=a144_0x12ec,_0x1556fc=_0x4f4903['match'](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x1556fc)return undefined;const _0x2ce7f8=parseFrontmatterObject(_0x1556fc[0x1]??'');return scalarToString(_0x2ce7f8?.[_0x2ca85e(0x1fb)]);}function slugifySkillName(_0x46d4de){const _0x3fd966=a144_0x12ec,_0x53dc4c=_0x46d4de[_0x3fd966(0x202)]()['toLowerCase']()[_0x3fd966(0x1d8)](/[^\p{L}\p{N}\p{So}]+/gu,'-')[_0x3fd966(0x1d8)](/^-+/,'')[_0x3fd966(0x1d8)](/-+$/,'')['replace'](/-{2,}/g,'-');if(!_0x53dc4c)throw CliErrors[_0x3fd966(0x1c9)](_0x3fd966(0x201)+SKILL_FILE+_0x3fd966(0x1d2));return _0x53dc4c;}function parseFrontmatterObject(_0x24edeb){const _0x465b52=a144_0x12ec;try{const _0x172b6c=a144_0x4a19ac(_0x24edeb);return _0x172b6c&&typeof _0x172b6c===_0x465b52(0x20a)&&!Array['isArray'](_0x172b6c)?_0x172b6c:undefined;}catch{return undefined;}}function scalarToString(_0x990be6){const _0x297993=a144_0x12ec;if(typeof _0x990be6===_0x297993(0x1ce))return _0x990be6[_0x297993(0x202)]();if(typeof _0x990be6===_0x297993(0x1da)||typeof _0x990be6===_0x297993(0x1e2))return String(_0x990be6);return undefined;}function resolvePushDirectoryRoot(_0x51a7aa){const _0x5b0db6=a144_0x12ec,_0x16b586=resolve(_0x51a7aa);if(!existsSync(_0x16b586))throw CliErrors[_0x5b0db6(0x1c9)](_0x5b0db6(0x1f4)+_0x51a7aa);const _0xfe8cac=lstatSync(_0x16b586);if(_0xfe8cac[_0x5b0db6(0x1e9)]())return _0x16b586;if(_0xfe8cac['isSymbolicLink']()){const _0x2145e1=realpathSync(_0x16b586);if(lstatSync(_0x2145e1)['isDirectory']())return _0x2145e1;}throw CliErrors[_0x5b0db6(0x1c9)](_0x5b0db6(0x1f4)+_0x51a7aa);}function requireRemoteScope(_0x295242){const _0x60d77b=a144_0x12ec;if(_0x295242['scope']===_0x60d77b(0x1ca)||_0x295242[_0x60d77b(0x209)]===_0x60d77b(0x1eb)||_0x295242[_0x60d77b(0x209)]==='builtin')return _0x295242[_0x60d77b(0x209)];throw CliErrors['validation'](_0x60d77b(0x1e4)+(_0x295242[_0x60d77b(0x1db)]||'(unknown)')+'\x20has\x20unsupported\x20scope\x20\x22'+(_0x295242[_0x60d77b(0x209)]??'unknown')+'\x22.');}function readLocalSkillContent(_0x4b4f7b){const _0x3ad7fc=a144_0x12ec,_0x3abe3d=resolve(_0x4b4f7b,SKILL_FILE);return existsSync(_0x3abe3d)&&lstatSync(_0x3abe3d)[_0x3ad7fc(0x1e6)]()?readFileSync(_0x3abe3d,_0x3ad7fc(0x1d9)):'';}function readPushMetadataIfPresent(_0x12d74d,_0xc59146={}){const _0x36f881=a144_0x12ec;try{return readMetadataIfPresent(_0x12d74d);}catch(_0x34fb52){if(_0xc59146[_0x36f881(0x20b)])return undefined;throw _0x34fb52;}}
@@ -1 +1 @@
1
- (function(_0x440c60,_0x2227ab){const _0x44e993=a145_0x47fb,_0x51e003=_0x440c60();while(!![]){try{const _0x47fe5a=-parseInt(_0x44e993(0x1e0))/0x1+parseInt(_0x44e993(0x1d5))/0x2+-parseInt(_0x44e993(0x1e2))/0x3+-parseInt(_0x44e993(0x1dd))/0x4+parseInt(_0x44e993(0x1d6))/0x5+-parseInt(_0x44e993(0x1dc))/0x6*(-parseInt(_0x44e993(0x1d9))/0x7)+parseInt(_0x44e993(0x1e1))/0x8*(parseInt(_0x44e993(0x1df))/0x9);if(_0x47fe5a===_0x2227ab)break;else _0x51e003['push'](_0x51e003['shift']());}catch(_0x2c8516){_0x51e003['push'](_0x51e003['shift']());}}}(a145_0x1648,0xc5bac));function a145_0x47fb(_0x24b436,_0x58feeb){_0x24b436=_0x24b436-0x1d5;const _0x164863=a145_0x1648();let _0x47fba5=_0x164863[_0x24b436];return _0x47fba5;}import{CliErrors}from'../../errors.js';export function normalizeRuntimeSkillScopes(_0x131d4f){const _0x525600=a145_0x47fb,_0x2dfbec=_0x131d4f&&_0x131d4f[_0x525600(0x1e3)]>0x0?_0x131d4f:[_0x525600(0x1e4),_0x525600(0x1d7),'builtin'],_0x25dc0a=[];for(const _0x4464ec of _0x2dfbec){if(!isRuntimeSkillScope(_0x4464ec))throw CliErrors[_0x525600(0x1da)](_0x525600(0x1d8)+_0x4464ec);!_0x25dc0a[_0x525600(0x1db)](_0x4464ec)&&_0x25dc0a[_0x525600(0x1de)](_0x4464ec);}return _0x25dc0a;}export function isRuntimeSkillScope(_0x2bfb7){return _0x2bfb7==='personal'||_0x2bfb7==='company'||_0x2bfb7==='builtin';}function a145_0x1648(){const _0x4862f4=['6006195SJNwOH','company','Unsupported\x20runtime\x20Skill\x20scope:\x20','21Rppums','validation','includes','692862qkLQkx','4139268jDCTAy','push','9918ZFINrD','49967QVmFIQ','2176ZBcxgZ','1750035ACIdtl','length','personal','1261230nWcsaD'];a145_0x1648=function(){return _0x4862f4;};return a145_0x1648();}
1
+ (function(_0x174369,_0x531a43){const _0x460fea=a145_0x2ddb,_0x25eb2f=_0x174369();while(!![]){try{const _0xde1bf9=parseInt(_0x460fea(0x7a))/0x1+parseInt(_0x460fea(0x6f))/0x2*(-parseInt(_0x460fea(0x73))/0x3)+-parseInt(_0x460fea(0x6c))/0x4*(-parseInt(_0x460fea(0x6e))/0x5)+-parseInt(_0x460fea(0x79))/0x6+-parseInt(_0x460fea(0x77))/0x7*(parseInt(_0x460fea(0x72))/0x8)+parseInt(_0x460fea(0x75))/0x9+parseInt(_0x460fea(0x71))/0xa;if(_0xde1bf9===_0x531a43)break;else _0x25eb2f['push'](_0x25eb2f['shift']());}catch(_0x3bae84){_0x25eb2f['push'](_0x25eb2f['shift']());}}}(a145_0x54ee,0x949f7));import{CliErrors}from'../../errors.js';export function normalizeRuntimeSkillScopes(_0x599cf4){const _0xb0c86e=a145_0x2ddb,_0x4fca01=_0x599cf4&&_0x599cf4[_0xb0c86e(0x6b)]>0x0?_0x599cf4:[_0xb0c86e(0x70),_0xb0c86e(0x6d),_0xb0c86e(0x78)],_0x883ae1=[];for(const _0x43f8fa of _0x4fca01){if(!isRuntimeSkillScope(_0x43f8fa))throw CliErrors['validation'](_0xb0c86e(0x76)+_0x43f8fa);!_0x883ae1['includes'](_0x43f8fa)&&_0x883ae1[_0xb0c86e(0x74)](_0x43f8fa);}return _0x883ae1;}function a145_0x2ddb(_0x1653fd,_0x345176){_0x1653fd=_0x1653fd-0x6b;const _0x54ee79=a145_0x54ee();let _0x2ddb67=_0x54ee79[_0x1653fd];return _0x2ddb67;}function a145_0x54ee(){const _0x2db18d=['builtin','6552474XwkHmp','307962CgyBTA','length','4QdqNLg','company','1947415tfhVjQ','8psDNQN','personal','28909540QIpGKd','5758712AwDehj','897363VXVZzn','push','258858rJzLJW','Unsupported\x20runtime\x20Skill\x20scope:\x20','7hJHXkm'];a145_0x54ee=function(){return _0x2db18d;};return a145_0x54ee();}export function isRuntimeSkillScope(_0x520bde){const _0x566bf4=a145_0x2ddb;return _0x520bde===_0x566bf4(0x70)||_0x520bde===_0x566bf4(0x6d)||_0x520bde===_0x566bf4(0x78);}
@@ -1 +1 @@
1
- function a147_0x1024(_0x4a315b,_0x52a04c){_0x4a315b=_0x4a315b-0x16f;const _0x41f591=a147_0x41f5();let _0x102428=_0x41f591[_0x4a315b];return _0x102428;}const a147_0x3fbdb7=a147_0x1024;(function(_0x210dec,_0x19b256){const _0xaf6c2e=a147_0x1024,_0x1b95a5=_0x210dec();while(!![]){try{const _0x24607a=parseInt(_0xaf6c2e(0x181))/0x1+parseInt(_0xaf6c2e(0x174))/0x2*(-parseInt(_0xaf6c2e(0x177))/0x3)+-parseInt(_0xaf6c2e(0x184))/0x4*(parseInt(_0xaf6c2e(0x16f))/0x5)+-parseInt(_0xaf6c2e(0x172))/0x6*(parseInt(_0xaf6c2e(0x17a))/0x7)+-parseInt(_0xaf6c2e(0x185))/0x8+-parseInt(_0xaf6c2e(0x186))/0x9*(parseInt(_0xaf6c2e(0x182))/0xa)+-parseInt(_0xaf6c2e(0x171))/0xb*(-parseInt(_0xaf6c2e(0x17c))/0xc);if(_0x24607a===_0x19b256)break;else _0x1b95a5['push'](_0x1b95a5['shift']());}catch(_0x48f479){_0x1b95a5['push'](_0x1b95a5['shift']());}}}(a147_0x41f5,0x83a11));function a147_0x41f5(){const _0x461ec2=['validation_error','1980-01-01T00:00:00.000Z','424334pIfTZX','6077390tbSbVT','endsWith','282476cRHisc','426376spJIUX','9qlUEpf','70vlEiQy','object','1835317jrqFVv','182118QJYklo','entries','112106xTAmjj','path','Runtime\x20Skill\x20package\x20contains\x20directory\x20entry:\x20','33nUWuFz','map','code','105cIjvLF','length','204fXiYSb','from','validation'];a147_0x41f5=function(){return _0x461ec2;};return a147_0x41f5();}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_0x3fbdb7(0x180));export function createDeterministicZipPackage(_0x1a697a){const _0x38dcab=a147_0x3fbdb7,_0x28f465={};for(const _0x2f62e5 of normalizeLocalFiles(_0x1a697a)){_0x28f465[_0x2f62e5[_0x38dcab(0x175)]]=fileContent(_0x2f62e5);}return Buffer[_0x38dcab(0x17d)](zipSync(_0x28f465,{'level':0x0,'mtime':ZIP_MTIME}));}export function parseZipPackage(_0x5b57ba){const _0x473320=a147_0x3fbdb7;if(_0x5b57ba[_0x473320(0x17b)]<0x16)throw CliErrors[_0x473320(0x17e)]('Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.');let _0x5b8cad;try{_0x5b8cad=unzipSync(_0x5b57ba,{'filter'(_0x13bcc3){const _0xf222ca=_0x473320,_0x1b4b9d=normalizeSkillRelativePath(_0x13bcc3['name']);if(_0x1b4b9d[_0xf222ca(0x183)]('/'))throw CliErrors[_0xf222ca(0x17e)](_0xf222ca(0x176)+_0x1b4b9d);return!![];}});}catch(_0xb895aa){if(isRuntimeSkillValidationError(_0xb895aa))throw _0xb895aa;throw CliErrors[_0x473320(0x17e)]('Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.');}return Object[_0x473320(0x173)](_0x5b8cad)[_0x473320(0x178)](([_0x1a56a9,_0x5806d3])=>({'path':normalizeSkillRelativePath(_0x1a56a9),'bytes':Buffer['from'](_0x5806d3)}))['sort'](compareSkillFiles);}function isRuntimeSkillValidationError(_0x542254){const _0x3f2680=a147_0x3fbdb7;return typeof _0x542254===_0x3f2680(0x170)&&_0x542254!==null&&'code'in _0x542254&&_0x542254[_0x3f2680(0x179)]===_0x3f2680(0x17f);}
1
+ const a147_0x57ec36=a147_0x25b2;function a147_0x25b2(_0x825bfc,_0x333291){_0x825bfc=_0x825bfc-0xcd;const _0x1fe5e2=a147_0x1fe5();let _0x25b2d8=_0x1fe5e2[_0x825bfc];return _0x25b2d8;}function a147_0x1fe5(){const _0x30494f=['4852836hjEflJ','Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.','1980-01-01T00:00:00.000Z','642176zwHtiS','from','sort','30sOvbeU','map','11TYZBSe','endsWith','Runtime\x20Skill\x20package\x20contains\x20directory\x20entry:\x20','validation','59517GHMlgO','name','57916gmkKhL','1090718OktVLa','6FwnvjT','length','104126lhJMjq','7HXcCjg','path','1802230CnLUZR','21VsNMBk','object','code','entries'];a147_0x1fe5=function(){return _0x30494f;};return a147_0x1fe5();}(function(_0x918d93,_0x193df0){const _0x1de214=a147_0x25b2,_0x58c6f7=_0x918d93();while(!![]){try{const _0x31dddf=-parseInt(_0x1de214(0xd1))/0x1+parseInt(_0x1de214(0xce))/0x2+parseInt(_0x1de214(0xd5))/0x3*(-parseInt(_0x1de214(0xcd))/0x4)+-parseInt(_0x1de214(0xd4))/0x5*(parseInt(_0x1de214(0xcf))/0x6)+-parseInt(_0x1de214(0xd2))/0x7*(parseInt(_0x1de214(0xdc))/0x8)+parseInt(_0x1de214(0xe5))/0x9*(-parseInt(_0x1de214(0xdf))/0xa)+-parseInt(_0x1de214(0xe1))/0xb*(-parseInt(_0x1de214(0xd9))/0xc);if(_0x31dddf===_0x193df0)break;else _0x58c6f7['push'](_0x58c6f7['shift']());}catch(_0x5f12b0){_0x58c6f7['push'](_0x58c6f7['shift']());}}}(a147_0x1fe5,0x4544e));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_0x57ec36(0xdb));export function createDeterministicZipPackage(_0x197aed){const _0x503d29=a147_0x57ec36,_0x121925={};for(const _0x4c63ef of normalizeLocalFiles(_0x197aed)){_0x121925[_0x4c63ef[_0x503d29(0xd3)]]=fileContent(_0x4c63ef);}return Buffer[_0x503d29(0xdd)](zipSync(_0x121925,{'level':0x0,'mtime':ZIP_MTIME}));}export function parseZipPackage(_0x80f1f7){const _0x4e020c=a147_0x57ec36;if(_0x80f1f7[_0x4e020c(0xd0)]<0x16)throw CliErrors[_0x4e020c(0xe4)](_0x4e020c(0xda));let _0x22aafa;try{_0x22aafa=unzipSync(_0x80f1f7,{'filter'(_0x5eae10){const _0x287c39=_0x4e020c,_0x3ffde9=normalizeSkillRelativePath(_0x5eae10[_0x287c39(0xe6)]);if(_0x3ffde9[_0x287c39(0xe2)]('/'))throw CliErrors[_0x287c39(0xe4)](_0x287c39(0xe3)+_0x3ffde9);return!![];}});}catch(_0xf1a8cb){if(isRuntimeSkillValidationError(_0xf1a8cb))throw _0xf1a8cb;throw CliErrors['validation'](_0x4e020c(0xda));}return Object[_0x4e020c(0xd8)](_0x22aafa)[_0x4e020c(0xe0)](([_0x1971b4,_0x25d74f])=>({'path':normalizeSkillRelativePath(_0x1971b4),'bytes':Buffer[_0x4e020c(0xdd)](_0x25d74f)}))[_0x4e020c(0xde)](compareSkillFiles);}function isRuntimeSkillValidationError(_0x5e39a5){const _0x440877=a147_0x57ec36;return typeof _0x5e39a5===_0x440877(0xd6)&&_0x5e39a5!==null&&_0x440877(0xd7)in _0x5e39a5&&_0x5e39a5['code']==='validation_error';}
@@ -1 +1 @@
1
- (function(_0x5a206c,_0x133f6b){const _0x306504=a148_0x3a66,_0x3a206f=_0x5a206c();while(!![]){try{const _0x131ca2=-parseInt(_0x306504(0x153))/0x1+-parseInt(_0x306504(0x15a))/0x2+-parseInt(_0x306504(0x16d))/0x3*(parseInt(_0x306504(0x15e))/0x4)+-parseInt(_0x306504(0x178))/0x5+-parseInt(_0x306504(0x15d))/0x6*(parseInt(_0x306504(0x15c))/0x7)+-parseInt(_0x306504(0x14b))/0x8*(parseInt(_0x306504(0x14d))/0x9)+parseInt(_0x306504(0x163))/0xa;if(_0x131ca2===_0x133f6b)break;else _0x3a206f['push'](_0x3a206f['shift']());}catch(_0xeae04d){_0x3a206f['push'](_0x3a206f['shift']());}}}(a148_0x19be,0xb0ae1));function a148_0x3a66(_0x23a456,_0x2ae848){_0x23a456=_0x23a456-0x14b;const _0x19bec9=a148_0x19be();let _0x3a667f=_0x19bec9[_0x23a456];return _0x3a667f;}import{CliErrors}from'../../errors.js';import{SKILL_FILE}from'./constants.js';function a148_0x19be(){const _0x3e2325=['validation','27FhCeYV','Runtime\x20Skill\x20package\x20is\x20missing\x20','toLowerCase','files','Missing\x20','path','1392879nfszZf','base64','bytes','object','map','zipSha256','treeSha256','832204jJnGrd','requireOssPath','7dUSRUF','943182JQMEcd','8420tiQgXs','schemaVersion','toString','Runtime\x20Skill\x20file\x20tree\x20sha256\x20mismatch.','Duplicate\x20Skill\x20package\x20entry:\x20','57495720wGJpGd','Runtime\x20Skill\x20package\x20size\x20mismatch.','length','size','has','zipSize','isArray','Runtime\x20Skill\x20package\x20sha256\x20mismatch.','some','Runtime\x20Skill\x20package\x20entry\x20list\x20mismatch.','1662SzqUFm','Runtime\x20Skill\x20package\x20sha256\x20is\x20invalid.','sha256','Runtime\x20Skill\x20package\x20size\x20is\x20invalid.','Runtime\x20Skill\x20package\x20file\x20sha256\x20mismatch:\x20','Runtime\x20Skill\x20package\x20is\x20missing\x20entry:\x20','string','\x20in\x20Skill\x20file\x20package.','push','Runtime\x20Skill\x20file\x20tree\x20sha256\x20is\x20invalid.','Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.','6984660mhdvZh','trim','ossPath','1324296MKLzNb'];a148_0x19be=function(){return _0x3e2325;};return a148_0x19be();}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(_0x38814){const _0x5dcb61=a148_0x3a66,_0x14116b=normalizeLocalFiles(_0x38814);if(!_0x14116b[_0x5dcb61(0x16b)](_0x36fc8a=>_0x36fc8a[_0x5dcb61(0x152)]===SKILL_FILE))throw CliErrors[_0x5dcb61(0x14c)](_0x5dcb61(0x151)+SKILL_FILE+_0x5dcb61(0x174));const _0x5254c1=localFilesToManifestFiles(_0x14116b),_0x36446c=createDeterministicZipPackage(_0x14116b);return{'manifest':{'schemaVersion':0x2,'treeSha256':fileTreeHash(_0x5254c1),'zipSha256':bufferSha256(_0x36446c),'zipSize':_0x36446c['length'],'files':_0x5254c1},'packageBytes':_0x36446c,'packageBase64':_0x36446c[_0x5dcb61(0x160)](_0x5dcb61(0x154))};}export function verifyRuntimeSkillPackage(_0x1d6054,_0x3fa33f){const _0x422ca5=a148_0x3a66,_0x5cd70d=normalizePackageManifest(_0x1d6054,{'requireOssPath':![]});if(!_0x5cd70d)throw CliErrors['validation'](_0x422ca5(0x177));return extractAndVerifyPackage(_0x5cd70d,_0x3fa33f);}export function verifyRuntimeSkillBundle(_0xfce767,_0x4cedd3){const _0x2292ab=a148_0x3a66,_0x1b0903=normalizePackageManifest(_0xfce767,{'requireOssPath':![]});if(!_0x1b0903)throw CliErrors[_0x2292ab(0x14c)](_0x2292ab(0x177));return extractAndVerifyPackageFiles(_0x1b0903,_0x4cedd3);}export function tryNormalizePackageManifest(_0x1bd48b){return normalizePackageManifest(_0x1bd48b,{'requireOssPath':![]});}export function requirePackageBytes(_0x21cb36,_0x458c3d){const _0x1c69a7=a148_0x3a66;if(!_0x458c3d||_0x458c3d[_0x1c69a7(0x165)]===0x0)throw CliErrors[_0x1c69a7(0x14c)]('Runtime\x20Skill\x20package\x20is\x20required\x20for\x20Skill\x20install:\x20'+_0x21cb36);return _0x458c3d;}export function extractDownloadedPackage(_0x42d55b){const _0x44154b=a148_0x3a66,_0x1f0912=parseZipPackage(_0x42d55b)[_0x44154b(0x157)](_0x3c0f4a=>({'path':_0x3c0f4a[_0x44154b(0x152)],'bytes':_0x3c0f4a[_0x44154b(0x155)]}));if(!_0x1f0912[_0x44154b(0x16b)](_0x3667f7=>_0x3667f7[_0x44154b(0x152)]===SKILL_FILE))throw CliErrors[_0x44154b(0x14c)](_0x44154b(0x14e)+SKILL_FILE+'.');return normalizeLocalFiles(_0x1f0912);}export function localFilesToManifestFiles(_0x4e9b66){const _0x27c62b=a148_0x3a66;return normalizeLocalFiles(_0x4e9b66)['map'](_0x198479=>({'path':_0x198479[_0x27c62b(0x152)],'sha256':fileHash(_0x198479),'size':fileContent(_0x198479)[_0x27c62b(0x165)]}));}function normalizePackageManifest(_0x4895f4,_0x4fe855){const _0x544ead=a148_0x3a66;if(!_0x4895f4||typeof _0x4895f4!==_0x544ead(0x156)||Array[_0x544ead(0x169)](_0x4895f4))return undefined;const _0x5daf3a=_0x4895f4,_0x2c3220=typeof _0x5daf3a[_0x544ead(0x17a)]===_0x544ead(0x173)?_0x5daf3a['ossPath'][_0x544ead(0x179)]():undefined;if(_0x4fe855[_0x544ead(0x15b)]&&!_0x2c3220)return undefined;if(!Array['isArray'](_0x5daf3a[_0x544ead(0x150)])||_0x5daf3a[_0x544ead(0x150)][_0x544ead(0x165)]===0x0)return undefined;if(!isSha256Hex(_0x5daf3a[_0x544ead(0x159)]))throw CliErrors['validation'](_0x544ead(0x176));if(!isSha256Hex(_0x5daf3a[_0x544ead(0x158)]))throw CliErrors[_0x544ead(0x14c)](_0x544ead(0x16e));if(!Number['isSafeInteger'](_0x5daf3a[_0x544ead(0x168)])||_0x5daf3a['zipSize']<0x0)throw CliErrors[_0x544ead(0x14c)](_0x544ead(0x170));const _0x163eb1=normalizeManifestFiles(_0x5daf3a['files']);if(!_0x163eb1[_0x544ead(0x16b)](_0x1b02bc=>_0x1b02bc['path']===SKILL_FILE))throw CliErrors[_0x544ead(0x14c)]('Runtime\x20Skill\x20manifest\x20is\x20missing\x20'+SKILL_FILE+'.');const _0x3cd450=fileTreeHash(_0x163eb1);if(_0x3cd450!==_0x5daf3a[_0x544ead(0x159)][_0x544ead(0x14f)]())throw CliErrors['validation'](_0x544ead(0x161));return{'schemaVersion':Number['isSafeInteger'](_0x5daf3a[_0x544ead(0x15f)])?_0x5daf3a['schemaVersion']:0x2,'ossPath':_0x2c3220,'treeSha256':_0x3cd450,'zipSha256':_0x5daf3a[_0x544ead(0x158)]['toLowerCase'](),'zipSize':_0x5daf3a['zipSize'],'files':_0x163eb1};}function extractAndVerifyPackage(_0x3a7858,_0x5b6356){const _0x23e8ec=a148_0x3a66,_0x37614a=normalizePackageManifest(_0x3a7858,{'requireOssPath':![]});if(!_0x37614a)throw CliErrors['validation']('Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.');if(_0x5b6356['length']!==_0x37614a[_0x23e8ec(0x168)])throw CliErrors[_0x23e8ec(0x14c)](_0x23e8ec(0x164));const _0x3b2c79=bufferSha256(_0x5b6356);if(_0x3b2c79!==_0x37614a['zipSha256'])throw CliErrors[_0x23e8ec(0x14c)](_0x23e8ec(0x16a));return extractAndVerifyPackageFiles(_0x37614a,_0x5b6356);}function extractAndVerifyPackageFiles(_0x4d9bd1,_0x542f94){const _0xf86b8f=a148_0x3a66,_0x6df19f=parseZipPackage(_0x542f94);if(_0x6df19f['length']!==_0x4d9bd1[_0xf86b8f(0x150)]['length'])throw CliErrors['validation'](_0xf86b8f(0x16c));const _0x29ef34=new Map();for(const _0x7ab26d of _0x6df19f){if(_0x29ef34[_0xf86b8f(0x167)](_0x7ab26d[_0xf86b8f(0x152)]))throw CliErrors['validation'](_0xf86b8f(0x162)+_0x7ab26d['path']);_0x29ef34['set'](_0x7ab26d['path'],_0x7ab26d);}const _0x1f393b=[];for(const _0x4c609b of _0x4d9bd1['files']){const _0x5be8d9=_0x29ef34['get'](_0x4c609b[_0xf86b8f(0x152)]);if(!_0x5be8d9)throw CliErrors[_0xf86b8f(0x14c)](_0xf86b8f(0x172)+_0x4c609b['path']);if(_0x5be8d9[_0xf86b8f(0x155)][_0xf86b8f(0x165)]!==_0x4c609b[_0xf86b8f(0x166)])throw CliErrors[_0xf86b8f(0x14c)]('Runtime\x20Skill\x20package\x20file\x20size\x20mismatch:\x20'+_0x4c609b[_0xf86b8f(0x152)]);const _0x4da738=bufferSha256(_0x5be8d9[_0xf86b8f(0x155)]);if(_0x4da738!==_0x4c609b[_0xf86b8f(0x16f)])throw CliErrors[_0xf86b8f(0x14c)](_0xf86b8f(0x171)+_0x4c609b[_0xf86b8f(0x152)]);_0x1f393b[_0xf86b8f(0x175)]({'path':_0x4c609b[_0xf86b8f(0x152)],'bytes':_0x5be8d9[_0xf86b8f(0x155)]});}return normalizeLocalFiles(_0x1f393b);}
1
+ (function(_0x561d2d,_0x5354ad){const _0x7a3d6c=a148_0x4fcf,_0x1a3cfa=_0x561d2d();while(!![]){try{const _0x478d38=-parseInt(_0x7a3d6c(0xe4))/0x1+-parseInt(_0x7a3d6c(0xd5))/0x2+-parseInt(_0x7a3d6c(0xea))/0x3+-parseInt(_0x7a3d6c(0xd7))/0x4+-parseInt(_0x7a3d6c(0xd2))/0x5*(-parseInt(_0x7a3d6c(0xee))/0x6)+parseInt(_0x7a3d6c(0xef))/0x7+parseInt(_0x7a3d6c(0xf9))/0x8*(parseInt(_0x7a3d6c(0xf2))/0x9);if(_0x478d38===_0x5354ad)break;else _0x1a3cfa['push'](_0x1a3cfa['shift']());}catch(_0x250d42){_0x1a3cfa['push'](_0x1a3cfa['shift']());}}}(a148_0x2bb7,0xaecf7));function a148_0x2bb7(){const _0xaab651=['1705885OKZMIh','Runtime\x20Skill\x20package\x20entry\x20list\x20mismatch.','get','2853014kqMZHL','map','3561844nWkXBY','files','Runtime\x20Skill\x20package\x20size\x20mismatch.','Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.','bytes','requireOssPath','Runtime\x20Skill\x20package\x20is\x20missing\x20','Runtime\x20Skill\x20package\x20sha256\x20is\x20invalid.','toLowerCase','isSafeInteger','Missing\x20','Runtime\x20Skill\x20package\x20sha256\x20mismatch.','base64','1056159joPBqV','trim','string','Duplicate\x20Skill\x20package\x20entry:\x20','object','treeSha256','4147443lsJWhq','has','length','Runtime\x20Skill\x20package\x20is\x20missing\x20entry:\x20','6HzxMGr','1079533VoRVXL','push','zipSha256','4455JErEOv','isArray','\x20in\x20Skill\x20file\x20package.','Runtime\x20Skill\x20file\x20tree\x20sha256\x20mismatch.','schemaVersion','zipSize','path','80424eDjsiu','ossPath','set','validation','Runtime\x20Skill\x20file\x20tree\x20sha256\x20is\x20invalid.','Runtime\x20Skill\x20package\x20file\x20size\x20mismatch:\x20','some','Runtime\x20Skill\x20manifest\x20is\x20missing\x20'];a148_0x2bb7=function(){return _0xaab651;};return a148_0x2bb7();}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';export function buildSkillPackage(_0x25ae40){const _0x84685=a148_0x4fcf,_0x26dcc6=normalizeLocalFiles(_0x25ae40);if(!_0x26dcc6[_0x84685(0xd0)](_0x6f6b32=>_0x6f6b32[_0x84685(0xf8)]===SKILL_FILE))throw CliErrors[_0x84685(0xfc)](_0x84685(0xe1)+SKILL_FILE+_0x84685(0xf4));const _0x2dd307=localFilesToManifestFiles(_0x26dcc6),_0x4e4cf7=createDeterministicZipPackage(_0x26dcc6);return{'manifest':{'schemaVersion':0x2,'treeSha256':fileTreeHash(_0x2dd307),'zipSha256':bufferSha256(_0x4e4cf7),'zipSize':_0x4e4cf7['length'],'files':_0x2dd307},'packageBytes':_0x4e4cf7,'packageBase64':_0x4e4cf7['toString'](_0x84685(0xe3))};}export function verifyRuntimeSkillPackage(_0x4e16b1,_0x2235a6){const _0x290e9c=a148_0x4fcf,_0x54f652=normalizePackageManifest(_0x4e16b1,{'requireOssPath':![]});if(!_0x54f652)throw CliErrors[_0x290e9c(0xfc)](_0x290e9c(0xda));return extractAndVerifyPackage(_0x54f652,_0x2235a6);}export function verifyRuntimeSkillBundle(_0x4557b6,_0x50f24d){const _0x40db41=a148_0x4fcf,_0x36f24f=normalizePackageManifest(_0x4557b6,{'requireOssPath':![]});if(!_0x36f24f)throw CliErrors[_0x40db41(0xfc)]('Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.');return extractAndVerifyPackageFiles(_0x36f24f,_0x50f24d);}export function tryNormalizePackageManifest(_0x45c636){return normalizePackageManifest(_0x45c636,{'requireOssPath':![]});}export function requirePackageBytes(_0xd31f58,_0x550517){const _0x435813=a148_0x4fcf;if(!_0x550517||_0x550517[_0x435813(0xec)]===0x0)throw CliErrors[_0x435813(0xfc)]('Runtime\x20Skill\x20package\x20is\x20required\x20for\x20Skill\x20install:\x20'+_0xd31f58);return _0x550517;}export function extractDownloadedPackage(_0x306167){const _0x39476d=a148_0x4fcf,_0x51d529=parseZipPackage(_0x306167)[_0x39476d(0xd6)](_0x221c33=>({'path':_0x221c33[_0x39476d(0xf8)],'bytes':_0x221c33['bytes']}));if(!_0x51d529['some'](_0x244797=>_0x244797[_0x39476d(0xf8)]===SKILL_FILE))throw CliErrors[_0x39476d(0xfc)](_0x39476d(0xdd)+SKILL_FILE+'.');return normalizeLocalFiles(_0x51d529);}export function localFilesToManifestFiles(_0xd98488){const _0x46c1fd=a148_0x4fcf;return normalizeLocalFiles(_0xd98488)[_0x46c1fd(0xd6)](_0x3220eb=>({'path':_0x3220eb[_0x46c1fd(0xf8)],'sha256':fileHash(_0x3220eb),'size':fileContent(_0x3220eb)[_0x46c1fd(0xec)]}));}function normalizePackageManifest(_0x37edef,_0x10499f){const _0x57c30e=a148_0x4fcf;if(!_0x37edef||typeof _0x37edef!==_0x57c30e(0xe8)||Array[_0x57c30e(0xf3)](_0x37edef))return undefined;const _0x5906e4=_0x37edef,_0x8e1f51=typeof _0x5906e4[_0x57c30e(0xfa)]===_0x57c30e(0xe6)?_0x5906e4[_0x57c30e(0xfa)][_0x57c30e(0xe5)]():undefined;if(_0x10499f[_0x57c30e(0xdc)]&&!_0x8e1f51)return undefined;if(!Array['isArray'](_0x5906e4[_0x57c30e(0xd8)])||_0x5906e4['files']['length']===0x0)return undefined;if(!isSha256Hex(_0x5906e4[_0x57c30e(0xe9)]))throw CliErrors[_0x57c30e(0xfc)](_0x57c30e(0xfd));if(!isSha256Hex(_0x5906e4['zipSha256']))throw CliErrors['validation'](_0x57c30e(0xde));if(!Number[_0x57c30e(0xe0)](_0x5906e4['zipSize'])||_0x5906e4[_0x57c30e(0xf7)]<0x0)throw CliErrors[_0x57c30e(0xfc)]('Runtime\x20Skill\x20package\x20size\x20is\x20invalid.');const _0x25de82=normalizeManifestFiles(_0x5906e4[_0x57c30e(0xd8)]);if(!_0x25de82['some'](_0x57fd12=>_0x57fd12[_0x57c30e(0xf8)]===SKILL_FILE))throw CliErrors[_0x57c30e(0xfc)](_0x57c30e(0xd1)+SKILL_FILE+'.');const _0x5b4ad9=fileTreeHash(_0x25de82);if(_0x5b4ad9!==_0x5906e4['treeSha256'][_0x57c30e(0xdf)]())throw CliErrors[_0x57c30e(0xfc)](_0x57c30e(0xf5));return{'schemaVersion':Number['isSafeInteger'](_0x5906e4[_0x57c30e(0xf6)])?_0x5906e4[_0x57c30e(0xf6)]:0x2,'ossPath':_0x8e1f51,'treeSha256':_0x5b4ad9,'zipSha256':_0x5906e4[_0x57c30e(0xf1)][_0x57c30e(0xdf)](),'zipSize':_0x5906e4[_0x57c30e(0xf7)],'files':_0x25de82};}function a148_0x4fcf(_0x13518f,_0x264c5a){_0x13518f=_0x13518f-0xd0;const _0x2bb76a=a148_0x2bb7();let _0x4fcf49=_0x2bb76a[_0x13518f];return _0x4fcf49;}function extractAndVerifyPackage(_0x30e88e,_0x2af6d1){const _0x233f81=a148_0x4fcf,_0x4fda98=normalizePackageManifest(_0x30e88e,{'requireOssPath':![]});if(!_0x4fda98)throw CliErrors[_0x233f81(0xfc)](_0x233f81(0xda));if(_0x2af6d1['length']!==_0x4fda98[_0x233f81(0xf7)])throw CliErrors[_0x233f81(0xfc)](_0x233f81(0xd9));const _0x49f632=bufferSha256(_0x2af6d1);if(_0x49f632!==_0x4fda98[_0x233f81(0xf1)])throw CliErrors['validation'](_0x233f81(0xe2));return extractAndVerifyPackageFiles(_0x4fda98,_0x2af6d1);}function extractAndVerifyPackageFiles(_0x1afa4d,_0x6120a0){const _0x10ba6f=a148_0x4fcf,_0x38d7f2=parseZipPackage(_0x6120a0);if(_0x38d7f2['length']!==_0x1afa4d[_0x10ba6f(0xd8)]['length'])throw CliErrors[_0x10ba6f(0xfc)](_0x10ba6f(0xd3));const _0x5cb372=new Map();for(const _0x4a40e0 of _0x38d7f2){if(_0x5cb372[_0x10ba6f(0xeb)](_0x4a40e0[_0x10ba6f(0xf8)]))throw CliErrors['validation'](_0x10ba6f(0xe7)+_0x4a40e0[_0x10ba6f(0xf8)]);_0x5cb372[_0x10ba6f(0xfb)](_0x4a40e0[_0x10ba6f(0xf8)],_0x4a40e0);}const _0x14e29d=[];for(const _0x3f5014 of _0x1afa4d[_0x10ba6f(0xd8)]){const _0x45b2a1=_0x5cb372[_0x10ba6f(0xd4)](_0x3f5014[_0x10ba6f(0xf8)]);if(!_0x45b2a1)throw CliErrors[_0x10ba6f(0xfc)](_0x10ba6f(0xed)+_0x3f5014[_0x10ba6f(0xf8)]);if(_0x45b2a1['bytes'][_0x10ba6f(0xec)]!==_0x3f5014['size'])throw CliErrors['validation'](_0x10ba6f(0xfe)+_0x3f5014[_0x10ba6f(0xf8)]);const _0x1d03e5=bufferSha256(_0x45b2a1[_0x10ba6f(0xdb)]);if(_0x1d03e5!==_0x3f5014['sha256'])throw CliErrors['validation']('Runtime\x20Skill\x20package\x20file\x20sha256\x20mismatch:\x20'+_0x3f5014[_0x10ba6f(0xf8)]);_0x14e29d[_0x10ba6f(0xf0)]({'path':_0x3f5014[_0x10ba6f(0xf8)],'bytes':_0x45b2a1[_0x10ba6f(0xdb)]});}return normalizeLocalFiles(_0x14e29d);}
@@ -1 +1 @@
1
- (function(_0x36cf4d,_0x11d4ea){var _0x5ed1bf=a149_0x100f,_0x411576=_0x36cf4d();while(!![]){try{var _0x1f9366=parseInt(_0x5ed1bf(0x14e))/0x1*(-parseInt(_0x5ed1bf(0x151))/0x2)+parseInt(_0x5ed1bf(0x150))/0x3*(parseInt(_0x5ed1bf(0x14c))/0x4)+-parseInt(_0x5ed1bf(0x14a))/0x5*(parseInt(_0x5ed1bf(0x152))/0x6)+-parseInt(_0x5ed1bf(0x153))/0x7*(-parseInt(_0x5ed1bf(0x14b))/0x8)+parseInt(_0x5ed1bf(0x14f))/0x9*(-parseInt(_0x5ed1bf(0x154))/0xa)+parseInt(_0x5ed1bf(0x149))/0xb*(-parseInt(_0x5ed1bf(0x155))/0xc)+parseInt(_0x5ed1bf(0x14d))/0xd*(parseInt(_0x5ed1bf(0x156))/0xe);if(_0x1f9366===_0x11d4ea)break;else _0x411576['push'](_0x411576['shift']());}catch(_0x5f56c6){_0x411576['push'](_0x411576['shift']());}}}(a149_0x3105,0x26670));export{contentHash,fileTreeHash}from'./runtime-skill-sync/hashing.js';export{linkEffectiveRuntimeSkills,linkGlobalRuntimeSkills,pruneStaleRuntimeSkillCache,pruneStaleRuntimeSkillLinks}from'./runtime-skill-sync/links.js';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_0x3105(){var _0x4e3099=['4358FNIvDz','8676YikOrD','7jtWheO','184390GcIXQq','247716GeRIdY','96572OPCrRj','88tVfGov','595UGoqOT','303440BGGyQP','1720ZlrqXI','715gfLQdH','83emXNmu','9XCNUAp','1929HXrMOX'];a149_0x3105=function(){return _0x4e3099;};return a149_0x3105();}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';function a149_0x100f(_0x147fb6,_0x340be8){_0x147fb6=_0x147fb6-0x149;var _0x310570=a149_0x3105();var _0x100f94=_0x310570[_0x147fb6];return _0x100f94;}export{buildSkillPackage,verifyRuntimeSkillBundle,verifyRuntimeSkillPackage}from'./runtime-skill-sync/zip-package.js';
1
+ (function(_0x519f74,_0x37ac7f){var _0x2a3b3c=a149_0x118b,_0x3ac2c3=_0x519f74();while(!![]){try{var _0x1781fb=parseInt(_0x2a3b3c(0x1eb))/0x1+parseInt(_0x2a3b3c(0x1ea))/0x2+-parseInt(_0x2a3b3c(0x1e7))/0x3*(parseInt(_0x2a3b3c(0x1e4))/0x4)+-parseInt(_0x2a3b3c(0x1e6))/0x5+parseInt(_0x2a3b3c(0x1e8))/0x6*(-parseInt(_0x2a3b3c(0x1e5))/0x7)+parseInt(_0x2a3b3c(0x1e3))/0x8+-parseInt(_0x2a3b3c(0x1e9))/0x9;if(_0x1781fb===_0x37ac7f)break;else _0x3ac2c3['push'](_0x3ac2c3['shift']());}catch(_0x5a85de){_0x3ac2c3['push'](_0x3ac2c3['shift']());}}}(a149_0x51e8,0x5a392));export{contentHash,fileTreeHash}from'./runtime-skill-sync/hashing.js';export{linkEffectiveRuntimeSkills,linkGlobalRuntimeSkills,pruneStaleRuntimeSkillCache,pruneStaleRuntimeSkillLinks}from'./runtime-skill-sync/links.js';export{resolveRuntimeSkillInstallTarget}from'./runtime-skill-sync/install-target.js';function a149_0x118b(_0x16f2d0,_0x21b772){_0x16f2d0=_0x16f2d0-0x1e3;var _0x51e877=a149_0x51e8();var _0x118bf9=_0x51e877[_0x16f2d0];return _0x118bf9;}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';function a149_0x51e8(){var _0x335e5b=['536583fzKKOE','6JgsWMn','3246615SrnWmk','489320OXPbeX','487441oYIerV','5286528jIokpw','8QHEvll','1572613AlpaYG','401235BNTYSx'];a149_0x51e8=function(){return _0x335e5b;};return a149_0x51e8();}export{buildSkillPackage,verifyRuntimeSkillBundle,verifyRuntimeSkillPackage}from'./runtime-skill-sync/zip-package.js';