@lovrabet/lovrabet-cli 2.3.1-beta.2 → 2.3.1-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (179) hide show
  1. package/README.md +53 -1
  2. package/lib/cli.js +1 -1
  3. package/lib/commands/api-doc/index.js +1 -1
  4. package/lib/commands/app/cache.js +1 -1
  5. package/lib/commands/app/definitions.js +1 -1
  6. package/lib/commands/app/eligibility.js +1 -1
  7. package/lib/commands/app/mock-loader.js +1 -1
  8. package/lib/commands/app/remote-source.js +1 -1
  9. package/lib/commands/app/shared.js +1 -1
  10. package/lib/commands/app-config/get.js +1 -1
  11. package/lib/commands/app-config/index.js +1 -1
  12. package/lib/commands/artifact/index.js +1 -1
  13. package/lib/commands/auth/device.js +1 -1
  14. package/lib/commands/auth/index.js +1 -1
  15. package/lib/commands/auth/prompt.js +1 -1
  16. package/lib/commands/bff/detail.js +1 -1
  17. package/lib/commands/bff/exec.js +1 -1
  18. package/lib/commands/bff/index.js +1 -1
  19. package/lib/commands/cli-skill/index.js +1 -1
  20. package/lib/commands/common/config-policy.js +1 -1
  21. package/lib/commands/common/constraints.js +1 -1
  22. package/lib/commands/common/flags.d.ts +2 -0
  23. package/lib/commands/common/flags.js +1 -1
  24. package/lib/commands/common/local-file.js +1 -1
  25. package/lib/commands/config/definitions.js +1 -1
  26. package/lib/commands/config/init.d.ts +2 -0
  27. package/lib/commands/config/init.js +1 -1
  28. package/lib/commands/config/shared.js +1 -1
  29. package/lib/commands/data/index.js +1 -1
  30. package/lib/commands/dataset/detail.js +1 -1
  31. package/lib/commands/dataset/index.js +1 -1
  32. package/lib/commands/dataset/list.js +1 -1
  33. package/lib/commands/dataset/sdk-doc.js +1 -1
  34. package/lib/commands/doctor.js +1 -1
  35. package/lib/commands/file/index.js +1 -1
  36. package/lib/commands/init.js +1 -1
  37. package/lib/commands/kb/index.js +1 -1
  38. package/lib/commands/logs/index.js +1 -1
  39. package/lib/commands/notification/config-list.js +1 -1
  40. package/lib/commands/notification/index.js +1 -1
  41. package/lib/commands/notification/shared.js +1 -1
  42. package/lib/commands/ocr/index.js +1 -1
  43. package/lib/commands/permit/dataset-get.js +1 -1
  44. package/lib/commands/permit/dataset-set.js +1 -1
  45. package/lib/commands/permit/index.js +1 -1
  46. package/lib/commands/permit/page-get.js +1 -1
  47. package/lib/commands/permit/page-set.js +1 -1
  48. package/lib/commands/permit/role-menus-set.js +1 -1
  49. package/lib/commands/permit/role-menus.js +1 -1
  50. package/lib/commands/permit/shared.js +1 -1
  51. package/lib/commands/personal-bff/index.js +1 -1
  52. package/lib/commands/registry.js +1 -1
  53. package/lib/commands/role/create.js +1 -1
  54. package/lib/commands/role/delete.js +1 -1
  55. package/lib/commands/role/detail.js +1 -1
  56. package/lib/commands/role/index.js +1 -1
  57. package/lib/commands/role/list.js +1 -1
  58. package/lib/commands/role/shared.js +1 -1
  59. package/lib/commands/role/update.js +1 -1
  60. package/lib/commands/role/user-add.js +1 -1
  61. package/lib/commands/role/user-remove.js +1 -1
  62. package/lib/commands/schedule/index.js +1 -1
  63. package/lib/commands/schema.js +1 -1
  64. package/lib/commands/service/dynamic.js +1 -1
  65. package/lib/commands/service/function-name-adapter.js +1 -1
  66. package/lib/commands/service/index.js +1 -1
  67. package/lib/commands/service/registry.js +1 -1
  68. package/lib/commands/skill/commands/create.js +1 -1
  69. package/lib/commands/skill/commands/diagram.js +1 -1
  70. package/lib/commands/skill/commands/install.js +1 -1
  71. package/lib/commands/skill/commands/list.js +1 -1
  72. package/lib/commands/skill/commands/push.js +1 -1
  73. package/lib/commands/skill/commands/validate.js +1 -1
  74. package/lib/commands/skill/diagram.js +1 -1
  75. package/lib/commands/skill/flags.js +1 -1
  76. package/lib/commands/skill/index.js +1 -1
  77. package/lib/commands/skill/manifest-helpers.js +1 -1
  78. package/lib/commands/skill/push-execute.js +1 -1
  79. package/lib/commands/skill/push-flow-helpers.js +1 -1
  80. package/lib/commands/skill/push-retarget.js +1 -1
  81. package/lib/commands/skill/scopes.js +1 -1
  82. package/lib/commands/skill/summary.js +1 -1
  83. package/lib/commands/skill/templates.js +1 -1
  84. package/lib/commands/skill/validate.js +1 -1
  85. package/lib/commands/sql/detail.js +1 -1
  86. package/lib/commands/sql/exec.js +1 -1
  87. package/lib/commands/sql/index.js +1 -1
  88. package/lib/commands/update.js +1 -1
  89. package/lib/commands/user-account/bind.js +1 -1
  90. package/lib/commands/user-account/index.js +1 -1
  91. package/lib/commands/workspace/index.js +1 -1
  92. package/lib/config/domain-config.d.ts +33 -1
  93. package/lib/config/domain-config.js +1 -1
  94. package/lib/config/schema.d.ts +1 -1
  95. package/lib/config/schema.js +1 -1
  96. package/lib/constant/app.js +1 -1
  97. package/lib/constant/auth-mode.js +1 -1
  98. package/lib/constant/cli.js +1 -1
  99. package/lib/constant/defaults.js +1 -1
  100. package/lib/constant/distribution.js +1 -1
  101. package/lib/constant/domain.js +1 -1
  102. package/lib/constant/env.js +1 -1
  103. package/lib/constant/output.js +1 -1
  104. package/lib/constant/product.d.ts +0 -51
  105. package/lib/constant/product.js +1 -1
  106. package/lib/constant/region.d.ts +3 -5
  107. package/lib/constant/region.js +1 -1
  108. package/lib/constant/risk.js +1 -1
  109. package/lib/constant/url.js +1 -1
  110. package/lib/context.js +1 -1
  111. package/lib/core/api-client.js +1 -1
  112. package/lib/core/db-resolver.js +1 -1
  113. package/lib/core/kb-search-client.js +1 -1
  114. package/lib/core/sdk-client.js +1 -1
  115. package/lib/errors.js +1 -1
  116. package/lib/framework/build-all-flags.js +1 -1
  117. package/lib/framework/dryrun.js +1 -1
  118. package/lib/framework/flags.js +1 -1
  119. package/lib/framework/help.js +1 -1
  120. package/lib/framework/index.js +1 -1
  121. package/lib/framework/output.js +1 -1
  122. package/lib/framework/preparse.js +1 -1
  123. package/lib/framework/rate-limit.js +1 -1
  124. package/lib/framework/raw-flags.js +1 -1
  125. package/lib/framework/response.js +1 -1
  126. package/lib/framework/runner-confirmation.js +1 -1
  127. package/lib/framework/runner-error.js +1 -1
  128. package/lib/framework/runner.js +1 -1
  129. package/lib/framework/schema-export.js +1 -1
  130. package/lib/framework/service-order.js +1 -1
  131. package/lib/framework/types.js +1 -1
  132. package/lib/generated/build-info.d.ts +4 -4
  133. package/lib/generated/build-info.js +1 -1
  134. package/lib/generated/official-routing.d.ts +59 -0
  135. package/lib/generated/official-routing.js +1 -0
  136. package/lib/generated/routing-contract.d.ts +9 -0
  137. package/lib/generated/routing-contract.js +1 -0
  138. package/lib/help.js +1 -1
  139. package/lib/postinstall.js +1 -1
  140. package/lib/runtime/confirmation.js +1 -1
  141. package/lib/runtime/event.js +1 -1
  142. package/lib/runtime/index.js +1 -1
  143. package/lib/runtime/queue.js +1 -1
  144. package/lib/runtime/resolve.js +1 -1
  145. package/lib/skills/builtin-skill.js +1 -1
  146. package/lib/skills/npx-skills-add.js +1 -1
  147. package/lib/skills/runtime-skill-sync/constants.js +1 -1
  148. package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
  149. package/lib/skills/runtime-skill-sync/hashing.js +1 -1
  150. package/lib/skills/runtime-skill-sync/install-target.js +1 -1
  151. package/lib/skills/runtime-skill-sync/links.js +1 -1
  152. package/lib/skills/runtime-skill-sync/list-local.js +1 -1
  153. package/lib/skills/runtime-skill-sync/local-files.js +1 -1
  154. package/lib/skills/runtime-skill-sync/materialize.js +1 -1
  155. package/lib/skills/runtime-skill-sync/metadata.js +1 -1
  156. package/lib/skills/runtime-skill-sync/paths.js +1 -1
  157. package/lib/skills/runtime-skill-sync/push.js +1 -1
  158. package/lib/skills/runtime-skill-sync/scopes.js +1 -1
  159. package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
  160. package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
  161. package/lib/skills/runtime-skill-sync.js +1 -1
  162. package/lib/skills/skill-presence.js +1 -1
  163. package/lib/utils/access-key-redaction.js +1 -1
  164. package/lib/utils/apply-jq-filter.js +1 -1
  165. package/lib/utils/cli-version-check.js +1 -1
  166. package/lib/utils/cli-version-policy.js +1 -1
  167. package/lib/utils/logger.js +1 -1
  168. package/lib/utils/lossless-json.js +1 -1
  169. package/lib/utils/params.js +1 -1
  170. package/lib/utils/platform.js +1 -1
  171. package/lib/utils/update-notice.js +1 -1
  172. package/lib/utils/version.js +1 -1
  173. package/lib/utils/write-cli-side-channel.js +1 -1
  174. package/package.json +2 -1
  175. package/skills/lovrabet/SKILL.md +3 -3
  176. package/skills/lovrabet/guides/troubleshooting.md +3 -5
  177. package/skills/lovrabet/references/lovrabet-config-commands.md +35 -10
  178. package/skills/lovrabet/references/lovrabet-config.md +7 -19
  179. package/skills/lovrabet.manifest.json +3 -3
@@ -1 +1 @@
1
- (function(_0x1e3f4e,_0x2ca888){const _0x353c54=a141_0x71d5,_0x5a51d9=_0x1e3f4e();while(!![]){try{const _0x1d5b4e=parseInt(_0x353c54(0x178))/0x1*(parseInt(_0x353c54(0x189))/0x2)+-parseInt(_0x353c54(0x19f))/0x3*(parseInt(_0x353c54(0x185))/0x4)+-parseInt(_0x353c54(0x186))/0x5+parseInt(_0x353c54(0x18c))/0x6*(-parseInt(_0x353c54(0x183))/0x7)+parseInt(_0x353c54(0x18f))/0x8*(parseInt(_0x353c54(0x194))/0x9)+-parseInt(_0x353c54(0x17c))/0xa+parseInt(_0x353c54(0x181))/0xb*(parseInt(_0x353c54(0x177))/0xc);if(_0x1d5b4e===_0x2ca888)break;else _0x5a51d9['push'](_0x5a51d9['shift']());}catch(_0x18e09a){_0x5a51d9['push'](_0x5a51d9['shift']());}}}(a141_0x1a43,0x8d182));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(_0xed3aa5){const _0x43cb6b=a141_0x71d5;return _0xed3aa5[_0x43cb6b(0x16d)]??Buffer['from'](_0xed3aa5['content']??'',_0x43cb6b(0x180));}export function fileText(_0x11f878){const _0x2b7031=a141_0x71d5;return fileContent(_0x11f878)[_0x2b7031(0x193)](_0x2b7031(0x180));}export function normalizeLocalFiles(_0xba5461){const _0x2456ed=a141_0x71d5;if(!Array[_0x2456ed(0x17b)](_0xba5461)||_0xba5461[_0x2456ed(0x16f)]===0x0)return[];const _0x10dfce=new Map();for(const _0xb872a0 of _0xba5461){if(!_0xb872a0||typeof _0xb872a0!==_0x2456ed(0x17d)||typeof _0xb872a0['path']!==_0x2456ed(0x18d))throw CliErrors[_0x2456ed(0x196)](_0x2456ed(0x17e));const _0x215e0b=normalizeSkillRelativePath(_0xb872a0['path']);if(_0x10dfce[_0x2456ed(0x1a0)](_0x215e0b))throw CliErrors['validation']('Duplicate\x20Skill\x20file\x20path:\x20'+_0x215e0b);if(_0xb872a0['bytes']!==undefined&&!Buffer[_0x2456ed(0x18a)](_0xb872a0[_0x2456ed(0x16d)]))throw CliErrors[_0x2456ed(0x196)](_0x2456ed(0x18b)+_0x215e0b);if(_0xb872a0['bytes']===undefined&&typeof _0xb872a0['content']!==_0x2456ed(0x18d))throw CliErrors[_0x2456ed(0x196)](_0x2456ed(0x17a)+_0x215e0b);const _0x314b16=fileContent(_0xb872a0);_0x10dfce[_0x2456ed(0x179)](_0x215e0b,{'path':_0x215e0b,'bytes':_0x314b16});}return Array[_0x2456ed(0x19e)](_0x10dfce[_0x2456ed(0x19b)]())[_0x2456ed(0x188)](compareSkillFiles);}export function normalizeManifestFiles(_0x4c41b2){const _0x223b83=a141_0x71d5;if(!Array[_0x223b83(0x17b)](_0x4c41b2)||_0x4c41b2[_0x223b83(0x16f)]===0x0)return[];const _0x2eda3a=new Map();for(const _0x409459 of _0x4c41b2){if(!_0x409459||typeof _0x409459!=='object'||typeof _0x409459[_0x223b83(0x19d)]!==_0x223b83(0x18d))throw CliErrors['validation'](_0x223b83(0x17e));const _0x1b19c3=normalizeSkillRelativePath(_0x409459[_0x223b83(0x19d)]);if(_0x2eda3a['has'](_0x1b19c3))throw CliErrors[_0x223b83(0x196)]('Duplicate\x20Skill\x20file\x20path:\x20'+_0x1b19c3);if(!isSha256Hex(_0x409459[_0x223b83(0x173)]))throw CliErrors[_0x223b83(0x196)](_0x223b83(0x198)+_0x1b19c3);if(!Number[_0x223b83(0x18e)](_0x409459['size'])||_0x409459[_0x223b83(0x16e)]<0x0)throw CliErrors[_0x223b83(0x196)](_0x223b83(0x182)+_0x1b19c3);_0x2eda3a[_0x223b83(0x179)](_0x1b19c3,{'path':_0x1b19c3,'sha256':_0x409459[_0x223b83(0x173)][_0x223b83(0x195)](),'size':_0x409459[_0x223b83(0x16e)]});}return Array['from'](_0x2eda3a[_0x223b83(0x19b)]())[_0x223b83(0x188)](compareSkillFiles);}export function scanSkillDirectory(_0x2c450b,_0x5a60b4={}){const _0x457bc7=a141_0x71d5,_0x4f96e2=realpathSync(_0x2c450b),_0x310bd7=canonicalExcludedFilePaths(_0x5a60b4[_0x457bc7(0x170)]),_0x51cb1f=[];function _0x45f8a4(_0x466a25){const _0x144ad9=_0x457bc7,_0x3b046d=readdirSync(_0x466a25,{'withFileTypes':!![]})['sort']((_0x1443a8,_0x43f3b8)=>_0x1443a8[_0x144ad9(0x199)][_0x144ad9(0x17f)](_0x43f3b8[_0x144ad9(0x199)]));for(const _0x2a1301 of _0x3b046d){if(_0x2a1301['isDirectory']()&&IGNORED_DIR_NAMES['has'](_0x2a1301['name']))continue;if(IGNORED_FILE_NAMES['has'](_0x2a1301['name']))continue;const _0x12fbe4=resolve(_0x466a25,_0x2a1301[_0x144ad9(0x199)]);if(isExcludedFilePath(_0x12fbe4,_0x310bd7))continue;if(_0x2a1301['isSymbolicLink']())throw CliErrors[_0x144ad9(0x196)](_0x144ad9(0x191)+_0x12fbe4);const _0x3e2546=toPosixPath(relative(_0x4f96e2,_0x12fbe4));if(_0x2a1301[_0x144ad9(0x19c)]()){_0x45f8a4(_0x12fbe4);continue;}if(!_0x2a1301[_0x144ad9(0x19a)]())continue;validateSkillRelativePath(_0x3e2546);const _0x26f8b6=readFileSync(_0x12fbe4);_0x51cb1f[_0x144ad9(0x190)]({'path':_0x3e2546,'bytes':_0x26f8b6});}}return _0x45f8a4(_0x4f96e2),normalizeLocalFiles(_0x51cb1f);}function canonicalExcludedFilePaths(_0x3feb1a){const _0x33c94d=a141_0x71d5,_0x2afcfa=new Set();for(const _0x40ebf6 of _0x3feb1a??[]){const _0x3a6368=resolve(_0x40ebf6);_0x2afcfa[_0x33c94d(0x171)](_0x3a6368);try{_0x2afcfa[_0x33c94d(0x171)](realpathSync(_0x3a6368));}catch{}}return _0x2afcfa;}function isExcludedFilePath(_0x5f506d,_0x57bb11){const _0x2527f0=a141_0x71d5;if(_0x57bb11[_0x2527f0(0x1a0)](_0x5f506d))return!![];if(_0x57bb11['size']===0x0)return![];try{return _0x57bb11[_0x2527f0(0x1a0)](realpathSync(_0x5f506d));}catch{return![];}}export function compareSkillFiles(_0x3eba46,_0x308e59){const _0x1086aa=a141_0x71d5;if(_0x3eba46['path']===SKILL_FILE)return _0x308e59[_0x1086aa(0x19d)]===SKILL_FILE?0x0:-0x1;if(_0x308e59[_0x1086aa(0x19d)]===SKILL_FILE)return 0x1;return Buffer[_0x1086aa(0x197)](Buffer[_0x1086aa(0x19e)](_0x3eba46[_0x1086aa(0x19d)],_0x1086aa(0x180)),Buffer[_0x1086aa(0x19e)](_0x308e59[_0x1086aa(0x19d)],_0x1086aa(0x180)));}export function normalizeSkillRelativePath(_0x32279b){const _0x27950c=a141_0x71d5,_0x22a2d0=toPosixPath(_0x32279b[_0x27950c(0x192)]());return validateSkillRelativePath(_0x22a2d0),_0x22a2d0;}export function validateSkillRelativePath(_0x9801e2){const _0x207795=a141_0x71d5;if(!_0x9801e2||_0x9801e2[_0x207795(0x172)]('/')||_0x9801e2[_0x207795(0x184)]('//'))throw CliErrors['validation'](_0x207795(0x174)+_0x9801e2);for(const _0x488e74 of _0x9801e2[_0x207795(0x187)]('/')){if(!_0x488e74||_0x488e74==='.'||_0x488e74==='..')throw CliErrors[_0x207795(0x196)](_0x207795(0x174)+_0x9801e2);}}function a141_0x71d5(_0x55577d,_0x546ac0){_0x55577d=_0x55577d-0x16d;const _0x1a4357=a141_0x1a43();let _0x71d54e=_0x1a4357[_0x55577d];return _0x71d54e;}function a141_0x1a43(){const _0x47b67b=['26OtKeYh','set','Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20','isArray','2931720NnyqSB','object','Skill\x20file\x20path\x20must\x20be\x20text.','localeCompare','utf8','11OChbwo','Skill\x20file\x20size\x20is\x20invalid:\x20','1414378fPJBER','includes','1366724Aupplp','346750ykDWTr','split','sort','64776ejiUXr','isBuffer','Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20','30cafHSb','string','isSafeInteger','16LYFrFv','push','Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20','trim','toString','3785688WonkFx','toLowerCase','validation','compare','Skill\x20file\x20sha256\x20is\x20invalid:\x20','name','isFile','values','isDirectory','path','from','9bGrwFE','has','bytes','size','length','excludedFilePaths','add','startsWith','sha256','Unsafe\x20Skill\x20file\x20path:\x20','test','replace','15508860APoeUA'];a141_0x1a43=function(){return _0x47b67b;};return a141_0x1a43();}export function toPosixPath(_0x364373){const _0x1b9364=a141_0x71d5;return _0x364373[_0x1b9364(0x176)](/\\/g,'/');}export function isSha256Hex(_0x241802){const _0x3431d4=a141_0x71d5;return typeof _0x241802===_0x3431d4(0x18d)&&/^[a-fA-F0-9]{64}$/[_0x3431d4(0x175)](_0x241802);}
1
+ (function(_0x4db48b,_0x3d0d4d){const _0x2a0224=a143_0x17af,_0x588e1b=_0x4db48b();while(!![]){try{const _0x80656a=-parseInt(_0x2a0224(0x138))/0x1*(parseInt(_0x2a0224(0x13d))/0x2)+parseInt(_0x2a0224(0x153))/0x3+parseInt(_0x2a0224(0x140))/0x4+-parseInt(_0x2a0224(0x12a))/0x5*(parseInt(_0x2a0224(0x14b))/0x6)+parseInt(_0x2a0224(0x133))/0x7*(-parseInt(_0x2a0224(0x129))/0x8)+-parseInt(_0x2a0224(0x150))/0x9*(parseInt(_0x2a0224(0x148))/0xa)+parseInt(_0x2a0224(0x126))/0xb*(parseInt(_0x2a0224(0x13e))/0xc);if(_0x80656a===_0x3d0d4d)break;else _0x588e1b['push'](_0x588e1b['shift']());}catch(_0xe6c37e){_0x588e1b['push'](_0x588e1b['shift']());}}}(a143_0x5128,0x41ff9));import{readFileSync,readdirSync,realpathSync}from'node:fs';import{relative,resolve}from'node:path';import{CliErrors}from'../../errors.js';function a143_0x17af(_0xe4558f,_0x4e749d){_0xe4558f=_0xe4558f-0x125;const _0x51282f=a143_0x5128();let _0x17afdf=_0x51282f[_0xe4558f];return _0x17afdf;}import{IGNORED_DIR_NAMES,IGNORED_FILE_NAMES,SKILL_FILE}from'./constants.js';export function fileContent(_0x1b0b5b){const _0x23c106=a143_0x17af;return _0x1b0b5b[_0x23c106(0x134)]??Buffer[_0x23c106(0x132)](_0x1b0b5b[_0x23c106(0x139)]??'',_0x23c106(0x147));}export function fileText(_0x3f719c){const _0x649b42=a143_0x17af;return fileContent(_0x3f719c)[_0x649b42(0x144)]('utf8');}export function normalizeLocalFiles(_0x24d5d2){const _0x2f9fe4=a143_0x17af;if(!Array[_0x2f9fe4(0x14a)](_0x24d5d2)||_0x24d5d2[_0x2f9fe4(0x14e)]===0x0)return[];const _0x5f7c71=new Map();for(const _0x82d5e7 of _0x24d5d2){if(!_0x82d5e7||typeof _0x82d5e7!==_0x2f9fe4(0x13b)||typeof _0x82d5e7[_0x2f9fe4(0x13a)]!=='string')throw CliErrors[_0x2f9fe4(0x152)](_0x2f9fe4(0x127));const _0x5e4164=normalizeSkillRelativePath(_0x82d5e7[_0x2f9fe4(0x13a)]);if(_0x5f7c71[_0x2f9fe4(0x12e)](_0x5e4164))throw CliErrors[_0x2f9fe4(0x152)](_0x2f9fe4(0x14d)+_0x5e4164);if(_0x82d5e7[_0x2f9fe4(0x134)]!==undefined&&!Buffer['isBuffer'](_0x82d5e7['bytes']))throw CliErrors['validation'](_0x2f9fe4(0x12d)+_0x5e4164);if(_0x82d5e7[_0x2f9fe4(0x134)]===undefined&&typeof _0x82d5e7[_0x2f9fe4(0x139)]!==_0x2f9fe4(0x143))throw CliErrors[_0x2f9fe4(0x152)](_0x2f9fe4(0x12f)+_0x5e4164);const _0x2d7e90=fileContent(_0x82d5e7);_0x5f7c71[_0x2f9fe4(0x125)](_0x5e4164,{'path':_0x5e4164,'bytes':_0x2d7e90});}return Array[_0x2f9fe4(0x132)](_0x5f7c71[_0x2f9fe4(0x136)]())['sort'](compareSkillFiles);}export function normalizeManifestFiles(_0x492673){const _0x16ada9=a143_0x17af;if(!Array[_0x16ada9(0x14a)](_0x492673)||_0x492673['length']===0x0)return[];const _0x380619=new Map();for(const _0x5a8029 of _0x492673){if(!_0x5a8029||typeof _0x5a8029!==_0x16ada9(0x13b)||typeof _0x5a8029[_0x16ada9(0x13a)]!==_0x16ada9(0x143))throw CliErrors[_0x16ada9(0x152)](_0x16ada9(0x127));const _0x38a9de=normalizeSkillRelativePath(_0x5a8029[_0x16ada9(0x13a)]);if(_0x380619['has'](_0x38a9de))throw CliErrors[_0x16ada9(0x152)]('Duplicate\x20Skill\x20file\x20path:\x20'+_0x38a9de);if(!isSha256Hex(_0x5a8029[_0x16ada9(0x14f)]))throw CliErrors['validation'](_0x16ada9(0x130)+_0x38a9de);if(!Number[_0x16ada9(0x12c)](_0x5a8029[_0x16ada9(0x13c)])||_0x5a8029['size']<0x0)throw CliErrors[_0x16ada9(0x152)](_0x16ada9(0x142)+_0x38a9de);_0x380619[_0x16ada9(0x125)](_0x38a9de,{'path':_0x38a9de,'sha256':_0x5a8029['sha256']['toLowerCase'](),'size':_0x5a8029[_0x16ada9(0x13c)]});}return Array['from'](_0x380619[_0x16ada9(0x136)]())[_0x16ada9(0x146)](compareSkillFiles);}export function scanSkillDirectory(_0x3d92df,_0x4bf191={}){const _0x2d8741=realpathSync(_0x3d92df),_0x249476=canonicalExcludedFilePaths(_0x4bf191['excludedFilePaths']),_0x569c6c=[];function _0x37b45b(_0x3fcd7e){const _0x3e1500=a143_0x17af,_0x1db6e2=readdirSync(_0x3fcd7e,{'withFileTypes':!![]})['sort']((_0x2fb41d,_0x17e983)=>_0x2fb41d['name'][_0x3e1500(0x128)](_0x17e983[_0x3e1500(0x13f)]));for(const _0x13b6b0 of _0x1db6e2){if(_0x13b6b0['isDirectory']()&&IGNORED_DIR_NAMES[_0x3e1500(0x12e)](_0x13b6b0['name']))continue;if(IGNORED_FILE_NAMES[_0x3e1500(0x12e)](_0x13b6b0[_0x3e1500(0x13f)]))continue;const _0x544eb2=resolve(_0x3fcd7e,_0x13b6b0['name']);if(isExcludedFilePath(_0x544eb2,_0x249476))continue;if(_0x13b6b0['isSymbolicLink']())throw CliErrors[_0x3e1500(0x152)](_0x3e1500(0x149)+_0x544eb2);const _0x2b7ccc=toPosixPath(relative(_0x2d8741,_0x544eb2));if(_0x13b6b0['isDirectory']()){_0x37b45b(_0x544eb2);continue;}if(!_0x13b6b0[_0x3e1500(0x14c)]())continue;validateSkillRelativePath(_0x2b7ccc);const _0x40102a=readFileSync(_0x544eb2);_0x569c6c[_0x3e1500(0x141)]({'path':_0x2b7ccc,'bytes':_0x40102a});}}return _0x37b45b(_0x2d8741),normalizeLocalFiles(_0x569c6c);}function canonicalExcludedFilePaths(_0x4469bf){const _0x1bd769=a143_0x17af,_0x36b215=new Set();for(const _0x5e96f4 of _0x4469bf??[]){const _0x43b33b=resolve(_0x5e96f4);_0x36b215[_0x1bd769(0x12b)](_0x43b33b);try{_0x36b215[_0x1bd769(0x12b)](realpathSync(_0x43b33b));}catch{}}return _0x36b215;}function isExcludedFilePath(_0x430f2e,_0x2e4e31){const _0x2677c2=a143_0x17af;if(_0x2e4e31[_0x2677c2(0x12e)](_0x430f2e))return!![];if(_0x2e4e31[_0x2677c2(0x13c)]===0x0)return![];try{return _0x2e4e31[_0x2677c2(0x12e)](realpathSync(_0x430f2e));}catch{return![];}}export function compareSkillFiles(_0xf1ff76,_0x2f8963){const _0x112fb8=a143_0x17af;if(_0xf1ff76[_0x112fb8(0x13a)]===SKILL_FILE)return _0x2f8963[_0x112fb8(0x13a)]===SKILL_FILE?0x0:-0x1;if(_0x2f8963[_0x112fb8(0x13a)]===SKILL_FILE)return 0x1;return Buffer[_0x112fb8(0x135)](Buffer[_0x112fb8(0x132)](_0xf1ff76[_0x112fb8(0x13a)],_0x112fb8(0x147)),Buffer['from'](_0x2f8963[_0x112fb8(0x13a)],_0x112fb8(0x147)));}function a143_0x5128(){const _0x452353=['name','104472OOgRhn','push','Skill\x20file\x20size\x20is\x20invalid:\x20','string','toString','includes','sort','utf8','7070dPaGGt','Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20','isArray','6qTditH','isFile','Duplicate\x20Skill\x20file\x20path:\x20','length','sha256','3987TSSTDs','test','validation','1302867cUPgoD','set','53141muKjrp','Skill\x20file\x20path\x20must\x20be\x20text.','localeCompare','8QgAlTV','812740FjacXm','add','isSafeInteger','Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20','has','Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20','Skill\x20file\x20sha256\x20is\x20invalid:\x20','split','from','900165qwWBhr','bytes','compare','values','Unsafe\x20Skill\x20file\x20path:\x20','293OAcNXt','content','path','object','size','272ueNLQu','1128NnCwWe'];a143_0x5128=function(){return _0x452353;};return a143_0x5128();}export function normalizeSkillRelativePath(_0x454401){const _0x1caa0=toPosixPath(_0x454401['trim']());return validateSkillRelativePath(_0x1caa0),_0x1caa0;}export function validateSkillRelativePath(_0x50d673){const _0x4477a9=a143_0x17af;if(!_0x50d673||_0x50d673['startsWith']('/')||_0x50d673[_0x4477a9(0x145)]('//'))throw CliErrors[_0x4477a9(0x152)](_0x4477a9(0x137)+_0x50d673);for(const _0x313d62 of _0x50d673[_0x4477a9(0x131)]('/')){if(!_0x313d62||_0x313d62==='.'||_0x313d62==='..')throw CliErrors[_0x4477a9(0x152)](_0x4477a9(0x137)+_0x50d673);}}export function toPosixPath(_0x13b2e0){return _0x13b2e0['replace'](/\\/g,'/');}export function isSha256Hex(_0x2816ef){const _0x3a16f7=a143_0x17af;return typeof _0x2816ef===_0x3a16f7(0x143)&&/^[a-fA-F0-9]{64}$/[_0x3a16f7(0x151)](_0x2816ef);}
@@ -1 +1 @@
1
- (function(_0x51a438,_0x3cad60){const _0x590690=a142_0x27d9,_0x25f6f5=_0x51a438();while(!![]){try{const _0x36e955=parseInt(_0x590690(0x106))/0x1*(-parseInt(_0x590690(0xda))/0x2)+parseInt(_0x590690(0x113))/0x3*(parseInt(_0x590690(0x10d))/0x4)+parseInt(_0x590690(0x108))/0x5+parseInt(_0x590690(0xe3))/0x6+parseInt(_0x590690(0x115))/0x7*(parseInt(_0x590690(0xf4))/0x8)+-parseInt(_0x590690(0xe5))/0x9*(-parseInt(_0x590690(0xe0))/0xa)+parseInt(_0x590690(0xe2))/0xb*(-parseInt(_0x590690(0xfe))/0xc);if(_0x36e955===_0x3cad60)break;else _0x25f6f5['push'](_0x25f6f5['shift']());}catch(_0x4739f0){_0x25f6f5['push'](_0x25f6f5['shift']());}}}(a142_0x40ad,0x9b5c3));import{existsSync,lstatSync,mkdirSync,readFileSync,rmSync}from'node:fs';import{dirname,resolve}from'node:path';import{isCollection,isMap,isNode,parseDocument,visit}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{resolveManagedFilePath,writeBytesAtomic,writeJsonAtomic}from'./fs-utils.js';import{bufferSha256,contentHash,fileHash}from'./hashing.js';import{fileContent,fileText,normalizeLocalFiles}from'./local-files.js';import{buildMetadata,readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillDir}from'./paths.js';import{extractDownloadedPackage,requirePackageBytes}from'./zip-package.js';function a142_0x27d9(_0x2cb164,_0x387c3f){_0x2cb164=_0x2cb164-0xda;const _0x40ad78=a142_0x40ad();let _0x27d9d5=_0x40ad78[_0x2cb164];return _0x27d9d5;}export function materializeRuntimeSkill(_0x398f40,_0x21bdda,_0x2b6a8a){const _0x22f2f4=a142_0x27d9,_0x291deb=requireSkillCode(_0x398f40),_0xbf76e=requirePackageBytes(_0x291deb,_0x2b6a8a['packageBytes']),_0x2f1b03=extractDownloadedPackage(_0xbf76e),_0x57a6ef=_0x2f1b03[_0x22f2f4(0x10c)](_0x2586ba=>_0x2586ba[_0x22f2f4(0x104)]===SKILL_FILE);if(!_0x57a6ef)throw CliErrors[_0x22f2f4(0xdd)](_0x22f2f4(0xfd)+SKILL_FILE+':\x20'+_0x291deb);const _0xd7e59d=withMaterializedSkillFrontmatter(_0x2f1b03,_0x398f40,_0x291deb),_0x3635ad=_0xd7e59d[_0x22f2f4(0x10c)](_0x2ffb16=>_0x2ffb16[_0x22f2f4(0x104)]===SKILL_FILE),_0xa7f1b0=fileText(_0x3635ad),_0x507e0d=getRuntimeSkillDir(_0x2b6a8a[_0x22f2f4(0xf6)],_0x2b6a8a[_0x22f2f4(0xe4)],_0x2b6a8a[_0x22f2f4(0xf2)],_0x21bdda,_0x291deb,_0x2b6a8a[_0x22f2f4(0xf0)]),_0x4e336f=resolve(_0x507e0d,SKILL_FILE),_0x3e2857=resolve(_0x507e0d,METADATA_FILE),_0xb76cb4=contentHash(_0xa7f1b0),_0x3481c9=readMetadataIfPresent(_0x3e2857)?.[_0x22f2f4(0xf3)];ensurePulledFilesCanBeOverwritten(_0x507e0d,_0x3e2857,_0xd7e59d,_0x2b6a8a[_0x22f2f4(0xdf)]===!![]),mkdirSync(_0x507e0d,{'recursive':!![],'mode':0x1c0});const _0x177139=existsSync(_0x4e336f)?readFileSync(_0x4e336f,'utf8'):undefined;return materializeFiles(_0x507e0d,_0xd7e59d),removeStaleManagedFiles(_0x507e0d,_0x3481c9,_0xd7e59d),writeJsonAtomic(_0x3e2857,buildMetadata(_0x398f40,_0x21bdda,_0x2b6a8a[_0x22f2f4(0xf2)],_0xb76cb4,_0x2b6a8a[_0x22f2f4(0x114)],_0xd7e59d,_0xbf76e)),{'skill':_0x398f40,'scope':_0x21bdda,'dir':_0x507e0d,'skillMdPath':_0x4e336f,'metadataPath':_0x3e2857,'contentHash':_0xb76cb4,'changed':_0x177139!==_0xa7f1b0};}export function reuseMaterializedRuntimeSkill(_0x21cc0c,_0x19574b,_0x4b6ab3){const _0x50500b=a142_0x27d9,_0x5ea8cc=_0x21cc0c[_0x50500b(0xfa)]?.[_0x50500b(0x105)]();if(!_0x5ea8cc)return undefined;const _0x1bfdb4=requireSkillCode(_0x21cc0c),_0x156d4a=getRuntimeSkillDir(_0x4b6ab3['env'],_0x4b6ab3['accessKey'],_0x4b6ab3[_0x50500b(0xf2)],_0x19574b,_0x1bfdb4,_0x4b6ab3[_0x50500b(0xf0)]),_0x2de8a9=resolve(_0x156d4a,SKILL_FILE),_0x560424=resolve(_0x156d4a,METADATA_FILE),_0x1c39e3=readMetadataIfPresent(_0x560424);if(!_0x1c39e3||_0x1c39e3[_0x50500b(0xeb)]!==0x2||_0x1c39e3[_0x50500b(0xf2)]!==_0x4b6ab3[_0x50500b(0xf2)]||_0x1c39e3[_0x50500b(0x101)]!==_0x19574b||_0x1c39e3['skillCode']!==_0x1bfdb4||_0x1c39e3[_0x50500b(0xfa)]!==_0x5ea8cc||_0x1c39e3['id']!==_0x21cc0c['id']||_0x1c39e3[_0x50500b(0x112)]!==_0x21cc0c[_0x50500b(0x112)]||_0x1c39e3[_0x50500b(0xe7)]!==_0x21cc0c[_0x50500b(0xe7)]||_0x1c39e3[_0x50500b(0x103)]!==_0x21cc0c[_0x50500b(0x103)]||_0x1c39e3[_0x50500b(0xdb)]!==_0x21cc0c[_0x50500b(0xdb)]||!_0x1c39e3['contentHash']||!_0x1c39e3[_0x50500b(0xf3)]||!Object[_0x50500b(0xe9)](_0x1c39e3[_0x50500b(0xf3)],SKILL_FILE))return undefined;for(const [_0x3eaf94,_0x412488]of Object[_0x50500b(0xf8)](_0x1c39e3[_0x50500b(0xf3)])){if(!/^[a-f0-9]{64}$/[_0x50500b(0xea)](_0x412488))return undefined;const _0x58ac54=resolveManagedFilePath(_0x156d4a,_0x3eaf94);if(!existsSync(_0x58ac54)||!lstatSync(_0x58ac54)['isFile']())return undefined;if(bufferSha256(readFileSync(_0x58ac54))!==_0x412488)return undefined;}return{'skill':_0x21cc0c,'scope':_0x19574b,'dir':_0x156d4a,'skillMdPath':_0x2de8a9,'metadataPath':_0x560424,'contentHash':_0x1c39e3[_0x50500b(0xfc)],'changed':![]};}function withMaterializedSkillFrontmatter(_0x4505ff,_0x206534,_0x3135e7){const _0x2ae901=a142_0x27d9,_0xd98e99=skillDisplayName(_0x206534,_0x3135e7),_0x41570f=_0x206534[_0x2ae901(0xe7)]?.[_0x2ae901(0x105)]()||_0xd98e99||_0x3135e7;return normalizeLocalFiles(_0x4505ff)[_0x2ae901(0xe6)](_0x9afd1e=>{const _0x54733b=_0x2ae901,_0x49ec89=fileText(_0x9afd1e);if(_0x9afd1e[_0x54733b(0x104)]!==SKILL_FILE)return _0x9afd1e;if(hasYamlFrontmatter(_0x49ec89))return{'path':_0x9afd1e[_0x54733b(0x104)],'content':withSyncedDisplayName(_0x49ec89,_0xd98e99)};return{'path':_0x9afd1e[_0x54733b(0x104)],'content':prependSkillFrontmatter(_0x49ec89,{'name':_0x3135e7,'displayName':_0xd98e99,'description':_0x41570f})};});}function hasYamlFrontmatter(_0x58a905){return/^\uFEFF?---\s*\r?\n/['test'](_0x58a905);}function prependSkillFrontmatter(_0x56f6cc,_0x1ec5c5){const _0x366ae5=a142_0x27d9,_0x5c5d82=_0x56f6cc[_0x366ae5(0x102)](/^\uFEFF/,'');return[_0x366ae5(0xee),_0x366ae5(0xec)+yamlString(_0x1ec5c5[_0x366ae5(0x107)]),_0x1ec5c5[_0x366ae5(0xef)]?_0x366ae5(0xdc)+yamlString(_0x1ec5c5[_0x366ae5(0xef)]):undefined,'description:\x20'+yamlString(_0x1ec5c5['description']),_0x366ae5(0xee),'',_0x5c5d82][_0x366ae5(0xe1)](_0x26d792=>_0x26d792!==undefined)['join']('\x0a');}function yamlString(_0x1df7a1){const _0x154f73=a142_0x27d9;return JSON[_0x154f73(0xf7)](_0x1df7a1[_0x154f73(0x102)](/\r/g,'')[_0x154f73(0x105)]());}function skillDisplayName(_0x5c3405,_0x542208){const _0x3170c6=a142_0x27d9,_0xcb34f4=_0x5c3405[_0x3170c6(0x112)]?.[_0x3170c6(0x105)]();return _0xcb34f4||_0x542208;}function withSyncedDisplayName(_0x27b498,_0x5b95a1){const _0x4926bd=a142_0x27d9,_0x508f64=_0x27b498['match'](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x508f64)return _0x27b498;const _0x541ecc=_0x508f64[0x1]??'',_0x5bc467=_0x508f64[0x2]??'',_0x46f8e8=parseDocument(_0x5bc467);if(_0x46f8e8[_0x4926bd(0xe8)][_0x4926bd(0x100)]>0x0||!isMap(_0x46f8e8['contents']))return _0x27b498;if(_0x5b95a1)_0x46f8e8['set'](_0x4926bd(0xef),_0x5b95a1);else{if(_0x46f8e8[_0x4926bd(0x10a)]('displayName'))_0x46f8e8['delete']('displayName');else return _0x27b498;}forceBlockCollections(_0x46f8e8[_0x4926bd(0x116)]);const _0x193e52=_0x46f8e8[_0x4926bd(0x10b)]({'lineWidth':0x0})['trimEnd'](),_0x3019af=_0x27b498[_0x4926bd(0xf9)](_0x508f64[0x0][_0x4926bd(0x100)])[_0x4926bd(0x102)](/^\r?\n/,'');return _0x541ecc+_0x4926bd(0xf5)+_0x193e52+_0x4926bd(0x109)+_0x3019af;}function forceBlockCollections(_0x55aae3){if(!isNode(_0x55aae3))return;visit(_0x55aae3,(_0x183257,_0x243944)=>{isCollection(_0x243944)&&(_0x243944['flow']=![]);});}function a142_0x40ad(){const _0x29f8fe=['Runtime\x20Skill\x20package\x20is\x20missing\x20','5277396unuvSd','keys','length','scope','replace','example','path','trim','10yTzTOv','name','399640rcGCET','\x0a---\x0a\x0a','has','toString','find','208ezxOLh','Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20','utf8','skillName','1281ZeVOQa','pulledAt','1363621XvRNfE','contents','95676iNmNch','status','displayName:\x20','validation','Managed\x20file\x20was\x20removed\x20locally:\x20','force','120zDSFQV','filter','11gEkAmq','4057056UIdqDj','accessKey','289953CKRGKU','map','description','errors','hasOwn','test','schemaVersion','name:\x20','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','---','displayName','paths','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','appCode','fileHashes','16PQYdgl','---\x0a','env','stringify','entries','slice','version','isFile','contentHash'];a142_0x40ad=function(){return _0x29f8fe;};return a142_0x40ad();}function ensurePulledFilesCanBeOverwritten(_0x4ae25a,_0x119c97,_0xc84087,_0x1148ed){const _0x1ce1cd=a142_0x27d9;if(_0x1148ed||!existsSync(_0x119c97))return;const _0x2d2a93=readMetadataIfPresent(_0x119c97);if(!_0x2d2a93)return;const _0x5ea323=_0x2d2a93[_0x1ce1cd(0xf3)]&&Object[_0x1ce1cd(0xff)](_0x2d2a93[_0x1ce1cd(0xf3)])[_0x1ce1cd(0x100)]>0x0?_0x2d2a93[_0x1ce1cd(0xf3)]:undefined;if(_0x5ea323)for(const [_0x2d4126,_0x2291ff]of Object[_0x1ce1cd(0xf8)](_0x5ea323)){const _0x12eaae=resolveManagedFilePath(_0x4ae25a,_0x2d4126);if(!existsSync(_0x12eaae))throw CliErrors[_0x1ce1cd(0xdd)](_0x1ce1cd(0xf1)+_0x4ae25a,_0x1ce1cd(0xde)+_0x2d4126);const _0x564ecf=lstatSync(_0x12eaae);if(!_0x564ecf['isFile']())throw CliErrors[_0x1ce1cd(0xdd)](_0x1ce1cd(0xf1)+_0x4ae25a,_0x1ce1cd(0x110)+_0x2d4126);const _0x1d25c8=bufferSha256(readFileSync(_0x12eaae));if(_0x1d25c8!==_0x2291ff)throw CliErrors[_0x1ce1cd(0xdd)](_0x1ce1cd(0xf1)+_0x4ae25a+'.\x20Changed\x20file:\x20'+_0x2d4126,'Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20'+_0x2d4126);}else{const _0x4e49a2=resolve(_0x4ae25a,SKILL_FILE);if(existsSync(_0x4e49a2)&&_0x2d2a93[_0x1ce1cd(0xfc)]){const _0x410185=contentHash(readFileSync(_0x4e49a2,_0x1ce1cd(0x111)));if(_0x410185!==_0x2d2a93[_0x1ce1cd(0xfc)])throw CliErrors[_0x1ce1cd(0xdd)](_0x1ce1cd(0xed)+_0x4e49a2,'Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.');}}for(const _0x3df962 of normalizeLocalFiles(_0xc84087)){if(_0x5ea323?.[_0x3df962[_0x1ce1cd(0x104)]])continue;if(!_0x5ea323&&_0x3df962[_0x1ce1cd(0x104)]===SKILL_FILE)continue;const _0x8bc919=resolveManagedFilePath(_0x4ae25a,_0x3df962[_0x1ce1cd(0x104)]);if(!existsSync(_0x8bc919))continue;const _0x562fd3=lstatSync(_0x8bc919);if(!_0x562fd3[_0x1ce1cd(0xfb)]())throw CliErrors[_0x1ce1cd(0xdd)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x4ae25a,_0x1ce1cd(0x10f)+_0x3df962[_0x1ce1cd(0x104)]);const _0x303f4a=bufferSha256(readFileSync(_0x8bc919));if(_0x303f4a!==fileHash(_0x3df962))throw CliErrors[_0x1ce1cd(0xdd)](_0x1ce1cd(0xf1)+_0x4ae25a,_0x1ce1cd(0x10e)+_0x3df962[_0x1ce1cd(0x104)]);}}function materializeFiles(_0x57a553,_0x43bfd6){const _0x45dce0=a142_0x27d9;for(const _0x4c03f0 of normalizeLocalFiles(_0x43bfd6)){const _0x19fe5f=resolveManagedFilePath(_0x57a553,_0x4c03f0[_0x45dce0(0x104)]);mkdirSync(dirname(_0x19fe5f),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x19fe5f,fileContent(_0x4c03f0),0x180);}}function removeStaleManagedFiles(_0x5dc173,_0x1f880c,_0x35a51a){const _0x5e3268=a142_0x27d9;if(!_0x1f880c)return;const _0x316bf2=new Set(normalizeLocalFiles(_0x35a51a)[_0x5e3268(0xe6)](_0x48333a=>_0x48333a[_0x5e3268(0x104)]));for(const _0x475091 of Object[_0x5e3268(0xff)](_0x1f880c)){if(_0x316bf2[_0x5e3268(0x10a)](_0x475091))continue;const _0x5413db=resolveManagedFilePath(_0x5dc173,_0x475091);existsSync(_0x5413db)&&lstatSync(_0x5413db)['isFile']()&&rmSync(_0x5413db,{'force':!![]});}}
1
+ (function(_0x480f84,_0x3804fe){const _0x1c77d0=a144_0x25da,_0x2ba737=_0x480f84();while(!![]){try{const _0x58660f=parseInt(_0x1c77d0(0x1c1))/0x1+parseInt(_0x1c77d0(0x1dd))/0x2+parseInt(_0x1c77d0(0x1a9))/0x3+parseInt(_0x1c77d0(0x1bf))/0x4*(parseInt(_0x1c77d0(0x1bb))/0x5)+-parseInt(_0x1c77d0(0x1af))/0x6+-parseInt(_0x1c77d0(0x1d1))/0x7+-parseInt(_0x1c77d0(0x1c6))/0x8;if(_0x58660f===_0x3804fe)break;else _0x2ba737['push'](_0x2ba737['shift']());}catch(_0x6cc6e5){_0x2ba737['push'](_0x2ba737['shift']());}}}(a144_0x3488,0x6294c));import{existsSync,lstatSync,mkdirSync,readFileSync,rmSync}from'node:fs';import{dirname,resolve}from'node:path';import{isCollection,isMap,isNode,parseDocument,visit}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{resolveManagedFilePath,writeBytesAtomic,writeJsonAtomic}from'./fs-utils.js';import{bufferSha256,contentHash,fileHash}from'./hashing.js';function a144_0x3488(){const _0x3e7dfc=['slice','replace','schemaVersion','1205050rYNkNp','skillName','1576755oNkySB','isFile','accessKey','delete','filter','appCode','1961304XjhOvJ','Runtime\x20Skill\x20package\x20is\x20missing\x20','scope','match','entries','status','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.','map','pulledAt','trimEnd','fileHashes','path','5MQmJwD','hasOwn','utf8','---','2089484WuWqfX','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','110372rwUwTt','errors','paths','version','set','2892024zCAXUc','packageBytes','example','---\x0a','displayName','trim','keys','validation','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','test','contentHash','4680746LvtkNr','skillCode','length','contents','env','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','description','force','find'];a144_0x3488=function(){return _0x3e7dfc;};return a144_0x3488();}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(_0x199a9c,_0x55d4e8,_0xca856){const _0x4bbd13=a144_0x25da,_0x32ce15=requireSkillCode(_0x199a9c),_0x4364d0=requirePackageBytes(_0x32ce15,_0xca856[_0x4bbd13(0x1c7)]),_0x3e691c=extractDownloadedPackage(_0x4364d0),_0x59fa04=_0x3e691c[_0x4bbd13(0x1d9)](_0x1d7d8a=>_0x1d7d8a['path']===SKILL_FILE);if(!_0x59fa04)throw CliErrors[_0x4bbd13(0x1cd)](_0x4bbd13(0x1b0)+SKILL_FILE+':\x20'+_0x32ce15);const _0x130247=withMaterializedSkillFrontmatter(_0x3e691c,_0x199a9c,_0x32ce15),_0x3a0f7e=_0x130247[_0x4bbd13(0x1d9)](_0x48fce0=>_0x48fce0[_0x4bbd13(0x1ba)]===SKILL_FILE),_0x307677=fileText(_0x3a0f7e),_0x124ba1=getRuntimeSkillDir(_0xca856[_0x4bbd13(0x1d5)],_0xca856[_0x4bbd13(0x1ab)],_0xca856[_0x4bbd13(0x1ae)],_0x55d4e8,_0x32ce15,_0xca856[_0x4bbd13(0x1c3)]),_0x5a3514=resolve(_0x124ba1,SKILL_FILE),_0x4bbf2e=resolve(_0x124ba1,METADATA_FILE),_0x1cb5ca=contentHash(_0x307677),_0x4e0160=readMetadataIfPresent(_0x4bbf2e)?.[_0x4bbd13(0x1b9)];ensurePulledFilesCanBeOverwritten(_0x124ba1,_0x4bbf2e,_0x130247,_0xca856[_0x4bbd13(0x1d8)]===!![]),mkdirSync(_0x124ba1,{'recursive':!![],'mode':0x1c0});const _0x4a9f42=existsSync(_0x5a3514)?readFileSync(_0x5a3514,_0x4bbd13(0x1bd)):undefined;return materializeFiles(_0x124ba1,_0x130247),removeStaleManagedFiles(_0x124ba1,_0x4e0160,_0x130247),writeJsonAtomic(_0x4bbf2e,buildMetadata(_0x199a9c,_0x55d4e8,_0xca856[_0x4bbd13(0x1ae)],_0x1cb5ca,_0xca856[_0x4bbd13(0x1b7)],_0x130247,_0x4364d0)),{'skill':_0x199a9c,'scope':_0x55d4e8,'dir':_0x124ba1,'skillMdPath':_0x5a3514,'metadataPath':_0x4bbf2e,'contentHash':_0x1cb5ca,'changed':_0x4a9f42!==_0x307677};}export function reuseMaterializedRuntimeSkill(_0x5b1ded,_0xc6d1d8,_0x164dfb){const _0x573236=a144_0x25da,_0x200a1b=_0x5b1ded['version']?.[_0x573236(0x1cb)]();if(!_0x200a1b)return undefined;const _0x3e2b35=requireSkillCode(_0x5b1ded),_0x2d8459=getRuntimeSkillDir(_0x164dfb[_0x573236(0x1d5)],_0x164dfb[_0x573236(0x1ab)],_0x164dfb[_0x573236(0x1ae)],_0xc6d1d8,_0x3e2b35,_0x164dfb[_0x573236(0x1c3)]),_0x4e6257=resolve(_0x2d8459,SKILL_FILE),_0x1f4703=resolve(_0x2d8459,METADATA_FILE),_0x2fc950=readMetadataIfPresent(_0x1f4703);if(!_0x2fc950||_0x2fc950[_0x573236(0x1dc)]!==0x2||_0x2fc950['appCode']!==_0x164dfb['appCode']||_0x2fc950[_0x573236(0x1b1)]!==_0xc6d1d8||_0x2fc950[_0x573236(0x1d2)]!==_0x3e2b35||_0x2fc950[_0x573236(0x1c4)]!==_0x200a1b||_0x2fc950['id']!==_0x5b1ded['id']||_0x2fc950['skillName']!==_0x5b1ded[_0x573236(0x1de)]||_0x2fc950['description']!==_0x5b1ded[_0x573236(0x1d7)]||_0x2fc950[_0x573236(0x1c8)]!==_0x5b1ded[_0x573236(0x1c8)]||_0x2fc950['status']!==_0x5b1ded[_0x573236(0x1b4)]||!_0x2fc950[_0x573236(0x1d0)]||!_0x2fc950[_0x573236(0x1b9)]||!Object[_0x573236(0x1bc)](_0x2fc950[_0x573236(0x1b9)],SKILL_FILE))return undefined;for(const [_0x52dff8,_0x20ef6c]of Object[_0x573236(0x1b3)](_0x2fc950[_0x573236(0x1b9)])){if(!/^[a-f0-9]{64}$/[_0x573236(0x1cf)](_0x20ef6c))return undefined;const _0x2a591d=resolveManagedFilePath(_0x2d8459,_0x52dff8);if(!existsSync(_0x2a591d)||!lstatSync(_0x2a591d)[_0x573236(0x1aa)]())return undefined;if(bufferSha256(readFileSync(_0x2a591d))!==_0x20ef6c)return undefined;}return{'skill':_0x5b1ded,'scope':_0xc6d1d8,'dir':_0x2d8459,'skillMdPath':_0x4e6257,'metadataPath':_0x1f4703,'contentHash':_0x2fc950['contentHash'],'changed':![]};}function withMaterializedSkillFrontmatter(_0x5b086f,_0x513931,_0x559c53){const _0x57214e=a144_0x25da,_0x1367f1=skillDisplayName(_0x513931,_0x559c53),_0x2c429b=_0x513931[_0x57214e(0x1d7)]?.[_0x57214e(0x1cb)]()||_0x1367f1||_0x559c53;return normalizeLocalFiles(_0x5b086f)[_0x57214e(0x1b6)](_0x233bbe=>{const _0x4a46d=_0x57214e,_0x3cfdde=fileText(_0x233bbe);if(_0x233bbe[_0x4a46d(0x1ba)]!==SKILL_FILE)return _0x233bbe;if(hasYamlFrontmatter(_0x3cfdde))return{'path':_0x233bbe['path'],'content':withSyncedDisplayName(_0x3cfdde,_0x1367f1)};return{'path':_0x233bbe[_0x4a46d(0x1ba)],'content':prependSkillFrontmatter(_0x3cfdde,{'name':_0x559c53,'displayName':_0x1367f1,'description':_0x2c429b})};});}function hasYamlFrontmatter(_0xbf28fc){const _0x128b17=a144_0x25da;return/^\uFEFF?---\s*\r?\n/[_0x128b17(0x1cf)](_0xbf28fc);}function prependSkillFrontmatter(_0x599ebb,_0x2fdd5d){const _0x4bfcb7=a144_0x25da,_0x55baef=_0x599ebb[_0x4bfcb7(0x1db)](/^\uFEFF/,'');return[_0x4bfcb7(0x1be),'name:\x20'+yamlString(_0x2fdd5d['name']),_0x2fdd5d[_0x4bfcb7(0x1ca)]?'displayName:\x20'+yamlString(_0x2fdd5d['displayName']):undefined,'description:\x20'+yamlString(_0x2fdd5d[_0x4bfcb7(0x1d7)]),_0x4bfcb7(0x1be),'',_0x55baef][_0x4bfcb7(0x1ad)](_0x5e5ae3=>_0x5e5ae3!==undefined)['join']('\x0a');}function yamlString(_0x57c58d){const _0x5f215e=a144_0x25da;return JSON['stringify'](_0x57c58d[_0x5f215e(0x1db)](/\r/g,'')[_0x5f215e(0x1cb)]());}function skillDisplayName(_0x272283,_0x4fa5c5){const _0x3ab7a3=a144_0x25da,_0x5ab28c=_0x272283[_0x3ab7a3(0x1de)]?.[_0x3ab7a3(0x1cb)]();return _0x5ab28c||_0x4fa5c5;}function withSyncedDisplayName(_0x145290,_0x461997){const _0x495720=a144_0x25da,_0x1eceee=_0x145290[_0x495720(0x1b2)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x1eceee)return _0x145290;const _0x417857=_0x1eceee[0x1]??'',_0x53b203=_0x1eceee[0x2]??'',_0x16cf54=parseDocument(_0x53b203);if(_0x16cf54[_0x495720(0x1c2)][_0x495720(0x1d3)]>0x0||!isMap(_0x16cf54[_0x495720(0x1d4)]))return _0x145290;if(_0x461997)_0x16cf54[_0x495720(0x1c5)]('displayName',_0x461997);else{if(_0x16cf54['has']('displayName'))_0x16cf54[_0x495720(0x1ac)]('displayName');else return _0x145290;}forceBlockCollections(_0x16cf54[_0x495720(0x1d4)]);const _0x527f84=_0x16cf54['toString']({'lineWidth':0x0})[_0x495720(0x1b8)](),_0xfe402b=_0x145290[_0x495720(0x1da)](_0x1eceee[0x0]['length'])[_0x495720(0x1db)](/^\r?\n/,'');return _0x417857+_0x495720(0x1c9)+_0x527f84+'\x0a---\x0a\x0a'+_0xfe402b;}function forceBlockCollections(_0x5cec32){if(!isNode(_0x5cec32))return;visit(_0x5cec32,(_0x5f2889,_0x915190)=>{isCollection(_0x915190)&&(_0x915190['flow']=![]);});}function ensurePulledFilesCanBeOverwritten(_0x18c998,_0xade225,_0xe68576,_0x16266c){const _0x23e751=a144_0x25da;if(_0x16266c||!existsSync(_0xade225))return;const _0x4ca790=readMetadataIfPresent(_0xade225);if(!_0x4ca790)return;const _0x14e08c=_0x4ca790[_0x23e751(0x1b9)]&&Object[_0x23e751(0x1cc)](_0x4ca790[_0x23e751(0x1b9)])['length']>0x0?_0x4ca790['fileHashes']:undefined;if(_0x14e08c)for(const [_0x1c4e04,_0x2d134f]of Object[_0x23e751(0x1b3)](_0x14e08c)){const _0x304f15=resolveManagedFilePath(_0x18c998,_0x1c4e04);if(!existsSync(_0x304f15))throw CliErrors[_0x23e751(0x1cd)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x18c998,'Managed\x20file\x20was\x20removed\x20locally:\x20'+_0x1c4e04);const _0xfbf214=lstatSync(_0x304f15);if(!_0xfbf214[_0x23e751(0x1aa)]())throw CliErrors['validation'](_0x23e751(0x1d6)+_0x18c998,'Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20'+_0x1c4e04);const _0x4ba7d4=bufferSha256(readFileSync(_0x304f15));if(_0x4ba7d4!==_0x2d134f)throw CliErrors[_0x23e751(0x1cd)](_0x23e751(0x1d6)+_0x18c998+'.\x20Changed\x20file:\x20'+_0x1c4e04,'Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20'+_0x1c4e04);}else{const _0x39462a=resolve(_0x18c998,SKILL_FILE);if(existsSync(_0x39462a)&&_0x4ca790[_0x23e751(0x1d0)]){const _0x1ae161=contentHash(readFileSync(_0x39462a,_0x23e751(0x1bd)));if(_0x1ae161!==_0x4ca790[_0x23e751(0x1d0)])throw CliErrors[_0x23e751(0x1cd)](_0x23e751(0x1ce)+_0x39462a,_0x23e751(0x1b5));}}for(const _0x352003 of normalizeLocalFiles(_0xe68576)){if(_0x14e08c?.[_0x352003[_0x23e751(0x1ba)]])continue;if(!_0x14e08c&&_0x352003['path']===SKILL_FILE)continue;const _0x5eee2b=resolveManagedFilePath(_0x18c998,_0x352003[_0x23e751(0x1ba)]);if(!existsSync(_0x5eee2b))continue;const _0x5ea796=lstatSync(_0x5eee2b);if(!_0x5ea796[_0x23e751(0x1aa)]())throw CliErrors['validation']('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x18c998,_0x23e751(0x1c0)+_0x352003[_0x23e751(0x1ba)]);const _0x5d133f=bufferSha256(readFileSync(_0x5eee2b));if(_0x5d133f!==fileHash(_0x352003))throw CliErrors['validation'](_0x23e751(0x1d6)+_0x18c998,'Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20'+_0x352003[_0x23e751(0x1ba)]);}}function a144_0x25da(_0x352e51,_0x10d170){_0x352e51=_0x352e51-0x1a9;const _0x3488de=a144_0x3488();let _0x25daa4=_0x3488de[_0x352e51];return _0x25daa4;}function materializeFiles(_0x46c71e,_0x53610c){for(const _0x1e26bf of normalizeLocalFiles(_0x53610c)){const _0x5ab628=resolveManagedFilePath(_0x46c71e,_0x1e26bf['path']);mkdirSync(dirname(_0x5ab628),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x5ab628,fileContent(_0x1e26bf),0x180);}}function removeStaleManagedFiles(_0x56ec01,_0x56a97c,_0x214b85){const _0x153ac=a144_0x25da;if(!_0x56a97c)return;const _0x2ecb9c=new Set(normalizeLocalFiles(_0x214b85)[_0x153ac(0x1b6)](_0x202f31=>_0x202f31['path']));for(const _0x475c54 of Object['keys'](_0x56a97c)){if(_0x2ecb9c['has'](_0x475c54))continue;const _0x3a30d8=resolveManagedFilePath(_0x56ec01,_0x475c54);existsSync(_0x3a30d8)&&lstatSync(_0x3a30d8)[_0x153ac(0x1aa)]()&&rmSync(_0x3a30d8,{'force':!![]});}}
@@ -1 +1 @@
1
- function a143_0x3ff7(_0x4f4149,_0x5cbd8b){_0x4f4149=_0x4f4149-0xbe;const _0x39e29c=a143_0x39e2();let _0x3ff79c=_0x39e29c[_0x4f4149];return _0x3ff79c;}function a143_0x39e2(){const _0xab90a2=['map','userId','zipSha256','validation','skillCode','506298zGnuFf','1008560zAkbKY','skillName','manifest','fromEntries','files','object','sourceSessionId','1884993oyQQmJ','tags','utf8','4290QGapOU','hasUpstreamUpdate','path','isArray','toISOString','status','3550HRxTfs','ossPath','length','personal','forkedFromVersion','trim','version','parse','3891265XIhHYN','5286008bLUlzf','Invalid\x20','483720FuJuuu','example','tenantCode','description','Runtime\x20Skill\x20is\x20missing\x20skillCode.'];a143_0x39e2=function(){return _0xab90a2;};return a143_0x39e2();}(function(_0x3cff06,_0x4fe7e3){const _0x5eeb30=a143_0x3ff7,_0x5b4dd7=_0x3cff06();while(!![]){try{const _0xe1d2f4=-parseInt(_0x5eeb30(0xc0))/0x1+-parseInt(_0x5eeb30(0xc1))/0x2+parseInt(_0x5eeb30(0xc8))/0x3+parseInt(_0x5eeb30(0xdc))/0x4+-parseInt(_0x5eeb30(0xd1))/0x5*(parseInt(_0x5eeb30(0xcb))/0x6)+parseInt(_0x5eeb30(0xd9))/0x7+parseInt(_0x5eeb30(0xda))/0x8;if(_0xe1d2f4===_0x4fe7e3)break;else _0x5b4dd7['push'](_0x5b4dd7['shift']());}catch(_0x46ce8c){_0x5b4dd7['push'](_0x5b4dd7['shift']());}}}(a143_0x39e2,0x6d4bf));import{existsSync,readFileSync}from'node:fs';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';import{fileContent,normalizeLocalFiles}from'./local-files.js';import{buildSkillPackage,localFilesToManifestFiles}from'./zip-package.js';export function buildMetadata(_0x553b70,_0x3a91a1,_0x4f4b15,_0x2d0ffd,_0x720218,_0x3e4db0,_0x580209){const _0x3fbfb1=a143_0x3ff7,_0x4f586b=_0x3e4db0?normalizeLocalFiles(_0x3e4db0):[],_0xb4b294=!_0x580209&&_0x4f586b[_0x3fbfb1(0xd3)]>0x0?buildSkillPackage(_0x4f586b):undefined,_0x123bbf=_0x580209?bufferSha256(_0x580209):_0xb4b294?.[_0x3fbfb1(0xc3)][_0x3fbfb1(0xe3)],_0x28fca0=_0x580209?.['length']??_0xb4b294?.[_0x3fbfb1(0xc3)]['zipSize'],_0x313d59=_0x4f586b['length']>0x0?Object[_0x3fbfb1(0xc4)](_0x4f586b[_0x3fbfb1(0xe1)](_0x24501e=>[_0x24501e[_0x3fbfb1(0xcd)],fileHash(_0x24501e)])):undefined;return{'schemaVersion':_0x4f586b[_0x3fbfb1(0xd3)]>0x0?0x2:0x1,'id':_0x553b70['id'],'appCode':_0x4f4b15,'skillCode':requireSkillCode(_0x553b70),'skillName':_0x553b70[_0x3fbfb1(0xc2)],'description':_0x553b70[_0x3fbfb1(0xdf)],'example':_0x553b70[_0x3fbfb1(0xdd)],'scope':_0x3a91a1,'readonly':_0x3a91a1!==_0x3fbfb1(0xd4)||_0x553b70['readonly']===!![],'tenantCode':_0x553b70[_0x3fbfb1(0xde)],'userId':_0x553b70[_0x3fbfb1(0xe2)],'version':_0x553b70[_0x3fbfb1(0xd7)],'status':_0x553b70[_0x3fbfb1(0xd0)],'tags':Array[_0x3fbfb1(0xce)](_0x553b70[_0x3fbfb1(0xc9)])?_0x553b70[_0x3fbfb1(0xc9)]:[],'hasUpstreamUpdate':_0x553b70[_0x3fbfb1(0xcc)],'forkedFromSkillId':_0x553b70['forkedFromSkillId'],'forkedFromVersion':_0x553b70[_0x3fbfb1(0xd5)],'sourceSessionId':_0x553b70[_0x3fbfb1(0xc7)],'contentHash':_0x2d0ffd,'fileHashes':_0x313d59,'treeHash':_0x4f586b['length']>0x0?fileTreeHash(localFilesToManifestFiles(_0x4f586b)):undefined,'ossPath':remoteManifestOssPath(_0x553b70[_0x3fbfb1(0xc5)]),'zipSha256':_0x123bbf,'zipSize':_0x28fca0,'files':_0x4f586b[_0x3fbfb1(0xd3)]>0x0?_0x4f586b[_0x3fbfb1(0xe1)](_0x2334c4=>({'path':_0x2334c4[_0x3fbfb1(0xcd)],'hash':fileHash(_0x2334c4),'size':fileContent(_0x2334c4)[_0x3fbfb1(0xd3)]})):undefined,'pulledAt':_0x720218??new Date()[_0x3fbfb1(0xcf)]()};}export function requireSkillCode(_0x68366e){const _0x589de5=a143_0x3ff7,_0x4cfcb1=_0x68366e[_0x589de5(0xbf)]?.[_0x589de5(0xd6)]();if(!_0x4cfcb1)throw CliErrors[_0x589de5(0xbe)](_0x589de5(0xe0));return _0x4cfcb1;}export function readMetadataIfPresent(_0x2481bc){const _0x159b2f=a143_0x3ff7;if(!existsSync(_0x2481bc))return undefined;try{const _0x227d9e=JSON[_0x159b2f(0xd8)](readFileSync(_0x2481bc,_0x159b2f(0xca)));return _0x227d9e;}catch{throw CliErrors[_0x159b2f(0xbe)](_0x159b2f(0xdb)+METADATA_FILE+':\x20'+_0x2481bc);}}function remoteManifestOssPath(_0x484e19){const _0x30cdd5=a143_0x3ff7;if(!_0x484e19||typeof _0x484e19!==_0x30cdd5(0xc6)||Array[_0x30cdd5(0xce)](_0x484e19))return undefined;const _0xf105c9=_0x484e19[_0x30cdd5(0xd2)];return typeof _0xf105c9==='string'&&_0xf105c9['trim']()?_0xf105c9[_0x30cdd5(0xd6)]():undefined;}
1
+ (function(_0x4f6754,_0x115773){const _0x1502c5=a145_0x3c6a,_0x5782ec=_0x4f6754();while(!![]){try{const _0x8cde3=parseInt(_0x1502c5(0x9e))/0x1*(parseInt(_0x1502c5(0xa6))/0x2)+-parseInt(_0x1502c5(0xac))/0x3*(-parseInt(_0x1502c5(0xc3))/0x4)+-parseInt(_0x1502c5(0xa0))/0x5+parseInt(_0x1502c5(0xc2))/0x6+parseInt(_0x1502c5(0xb5))/0x7+-parseInt(_0x1502c5(0xa1))/0x8+-parseInt(_0x1502c5(0xb1))/0x9*(-parseInt(_0x1502c5(0xb9))/0xa);if(_0x8cde3===_0x115773)break;else _0x5782ec['push'](_0x5782ec['shift']());}catch(_0x50beb6){_0x5782ec['push'](_0x5782ec['shift']());}}}(a145_0xa6ad,0x7f239));import{existsSync,readFileSync}from'node:fs';import{CliErrors}from'../../errors.js';function a145_0x3c6a(_0x1b5fce,_0x3fd337){_0x1b5fce=_0x1b5fce-0x9d;const _0xa6adf6=a145_0xa6ad();let _0x3c6a4f=_0xa6adf6[_0x1b5fce];return _0x3c6a4f;}function a145_0xa6ad(){const _0x271eb8=['forkedFromVersion','tags','manifest','trim','10890ULpbEH','status','ossPath','description','2604238WTlXmk','parse','toISOString','path','5930HNsqBk','skillName','forkedFromSkillId','skillCode','zipSize','personal','validation','readonly','zipSha256','2456658OhdIEJ','1730284qDTIeg','map','33EYHyqb','Runtime\x20Skill\x20is\x20missing\x20skillCode.','4820725WXtzCk','3637528MfPyup','example','version','userId','length','486hyvIzU','utf8','isArray','fromEntries','tenantCode','hasUpstreamUpdate','3iWlIKf'];a145_0xa6ad=function(){return _0x271eb8;};return a145_0xa6ad();}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(_0x1cf2a8,_0x4b2080,_0x30a112,_0x39de22,_0x3a2463,_0x33ccf9,_0x145ad6){const _0x385704=a145_0x3c6a,_0xa1a48c=_0x33ccf9?normalizeLocalFiles(_0x33ccf9):[],_0x327ba9=!_0x145ad6&&_0xa1a48c[_0x385704(0xa5)]>0x0?buildSkillPackage(_0xa1a48c):undefined,_0x5f1fdb=_0x145ad6?bufferSha256(_0x145ad6):_0x327ba9?.[_0x385704(0xaf)][_0x385704(0xc1)],_0x15d55b=_0x145ad6?.[_0x385704(0xa5)]??_0x327ba9?.[_0x385704(0xaf)][_0x385704(0xbd)],_0x3064c3=_0xa1a48c[_0x385704(0xa5)]>0x0?Object[_0x385704(0xa9)](_0xa1a48c[_0x385704(0x9d)](_0x4d329d=>[_0x4d329d[_0x385704(0xb8)],fileHash(_0x4d329d)])):undefined;return{'schemaVersion':_0xa1a48c[_0x385704(0xa5)]>0x0?0x2:0x1,'id':_0x1cf2a8['id'],'appCode':_0x30a112,'skillCode':requireSkillCode(_0x1cf2a8),'skillName':_0x1cf2a8[_0x385704(0xba)],'description':_0x1cf2a8[_0x385704(0xb4)],'example':_0x1cf2a8[_0x385704(0xa2)],'scope':_0x4b2080,'readonly':_0x4b2080!==_0x385704(0xbe)||_0x1cf2a8[_0x385704(0xc0)]===!![],'tenantCode':_0x1cf2a8[_0x385704(0xaa)],'userId':_0x1cf2a8[_0x385704(0xa4)],'version':_0x1cf2a8[_0x385704(0xa3)],'status':_0x1cf2a8[_0x385704(0xb2)],'tags':Array[_0x385704(0xa8)](_0x1cf2a8[_0x385704(0xae)])?_0x1cf2a8[_0x385704(0xae)]:[],'hasUpstreamUpdate':_0x1cf2a8[_0x385704(0xab)],'forkedFromSkillId':_0x1cf2a8[_0x385704(0xbb)],'forkedFromVersion':_0x1cf2a8[_0x385704(0xad)],'sourceSessionId':_0x1cf2a8['sourceSessionId'],'contentHash':_0x39de22,'fileHashes':_0x3064c3,'treeHash':_0xa1a48c[_0x385704(0xa5)]>0x0?fileTreeHash(localFilesToManifestFiles(_0xa1a48c)):undefined,'ossPath':remoteManifestOssPath(_0x1cf2a8['files']),'zipSha256':_0x5f1fdb,'zipSize':_0x15d55b,'files':_0xa1a48c[_0x385704(0xa5)]>0x0?_0xa1a48c[_0x385704(0x9d)](_0xc12854=>({'path':_0xc12854[_0x385704(0xb8)],'hash':fileHash(_0xc12854),'size':fileContent(_0xc12854)[_0x385704(0xa5)]})):undefined,'pulledAt':_0x3a2463??new Date()[_0x385704(0xb7)]()};}export function requireSkillCode(_0x59e667){const _0x384ae3=a145_0x3c6a,_0x5a34af=_0x59e667[_0x384ae3(0xbc)]?.[_0x384ae3(0xb0)]();if(!_0x5a34af)throw CliErrors[_0x384ae3(0xbf)](_0x384ae3(0x9f));return _0x5a34af;}export function readMetadataIfPresent(_0x232d94){const _0x54f9b2=a145_0x3c6a;if(!existsSync(_0x232d94))return undefined;try{const _0x1e1179=JSON[_0x54f9b2(0xb6)](readFileSync(_0x232d94,_0x54f9b2(0xa7)));return _0x1e1179;}catch{throw CliErrors[_0x54f9b2(0xbf)]('Invalid\x20'+METADATA_FILE+':\x20'+_0x232d94);}}function remoteManifestOssPath(_0x176acd){const _0x1fa228=a145_0x3c6a;if(!_0x176acd||typeof _0x176acd!=='object'||Array['isArray'](_0x176acd))return undefined;const _0x13f3a3=_0x176acd[_0x1fa228(0xb3)];return typeof _0x13f3a3==='string'&&_0x13f3a3[_0x1fa228(0xb0)]()?_0x13f3a3[_0x1fa228(0xb0)]():undefined;}
@@ -1 +1 @@
1
- const a144_0x34f92c=a144_0x1cf0;(function(_0x52a029,_0x1dabad){const _0x1f7286=a144_0x1cf0,_0x1a4fb0=_0x52a029();while(!![]){try{const _0x288de5=parseInt(_0x1f7286(0x143))/0x1+parseInt(_0x1f7286(0x146))/0x2+-parseInt(_0x1f7286(0x157))/0x3+parseInt(_0x1f7286(0x144))/0x4*(-parseInt(_0x1f7286(0x14b))/0x5)+parseInt(_0x1f7286(0x155))/0x6+parseInt(_0x1f7286(0x158))/0x7*(parseInt(_0x1f7286(0x152))/0x8)+-parseInt(_0x1f7286(0x159))/0x9;if(_0x288de5===_0x1dabad)break;else _0x1a4fb0['push'](_0x1a4fb0['shift']());}catch(_0x29df82){_0x1a4fb0['push'](_0x1a4fb0['shift']());}}}(a144_0x374f,0x3632f));import{existsSync}from'node:fs';import{homedir}from'node:os';function a144_0x374f(){const _0xd0170=['\x20for\x20local\x20path:\x20','SKILL_ROOT','1846512TFVHFp','homeDir','234105aFOlgH','20006RtVhKC','2512170IzNkFK','skills','claudeSkillsDir','422920XhjrtY','1281376uOGApB','validation','6144SXlFPV','includes','.workbuddy','path\x20segment','filter','5aYUFFm','appCode','workbuddySkillsDir','agentsSkillsDir','.claude','homeDirName','cache','464NCqnJe'];a144_0x374f=function(){return _0xd0170;};return a144_0x374f();}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(_0x46509d={}){const _0x243cae=a144_0x1cf0,_0x49f59a=_0x46509d[_0x243cae(0x156)]??homedir(),_0x182f08=resolve(_0x49f59a,PRODUCT_CONFIG['homeDirName'],_0x243cae(0x151)),_0x3dbed1=trimmedEnv(_0x243cae(0x154)),_0x5dfcf9=trimmedEnv('CLAUDE_SKILL_ROOT'),_0x597453=resolve(_0x49f59a,_0x243cae(0x148)),_0x4b4991=_0x46509d[_0x243cae(0x14d)]??(existsSync(_0x597453)?resolve(_0x597453,_0x243cae(0x15a)):undefined);return{'homeDir':_0x49f59a,'cacheRoot':_0x182f08,'managedRoot':resolve(_0x49f59a,PRODUCT_CONFIG[_0x243cae(0x150)]),'agentsSkillsDir':_0x46509d[_0x243cae(0x14e)]??_0x3dbed1??resolve(_0x49f59a,'.agents',_0x243cae(0x15a)),'claudeSkillsDir':_0x46509d[_0x243cae(0x142)]??_0x5dfcf9??resolve(_0x49f59a,_0x243cae(0x14f),_0x243cae(0x15a)),'workbuddySkillsDir':_0x4b4991};}export function runtimeAgentSkillRoots(_0x327051){const _0x3d229e=a144_0x1cf0;return[_0x327051['agentsSkillsDir'],_0x327051[_0x3d229e(0x142)],_0x327051[_0x3d229e(0x14d)]][_0x3d229e(0x14a)](_0x415a18=>Boolean(_0x415a18));}export function getRuntimeSkillCacheRoot(_0xac2b90,_0x278e5a,_0x2d24b3={}){const _0x5234f7=a144_0x1cf0,_0x48a7b2=resolveSkillSyncPaths(_0x2d24b3);return resolve(_0x48a7b2['cacheRoot'],_0xac2b90,fingerprintAccessKey(_0x278e5a),_0x5234f7(0x15a));}export function getRuntimeSkillDir(_0x571d8f,_0xec9d40,_0x4ae034,_0x2b2cc7,_0x315852,_0x4dc1c9={}){const _0x29511f=a144_0x1cf0;return resolve(getRuntimeSkillCacheRoot(_0x571d8f,_0xec9d40,_0x4dc1c9),safePathSegment(_0x4ae034,_0x29511f(0x14c)),_0x2b2cc7,safePathSegment(_0x315852,'skillCode'));}export function safePathSegment(_0x42cf2e,_0x3e42bc=a144_0x34f92c(0x149)){const _0x1ef179=a144_0x34f92c;if(!_0x42cf2e||_0x42cf2e[_0x1ef179(0x147)]('/')||_0x42cf2e[_0x1ef179(0x147)]('\x5c')||_0x42cf2e[_0x1ef179(0x147)]('..'))throw CliErrors[_0x1ef179(0x145)]('Unsafe\x20'+_0x3e42bc+_0x1ef179(0x153)+_0x42cf2e);return _0x42cf2e;}function a144_0x1cf0(_0x3da9e8,_0x4c38e3){_0x3da9e8=_0x3da9e8-0x142;const _0x374fe2=a144_0x374f();let _0x1cf0e1=_0x374fe2[_0x3da9e8];return _0x1cf0e1;}function trimmedEnv(_0x10ff64){const _0x484389=productEnv(_0x10ff64)?.['trim']();return _0x484389?_0x484389:undefined;}
1
+ const a146_0x3197c3=a146_0x4632;(function(_0x29c59e,_0x3cc244){const _0x6dcab9=a146_0x4632,_0x55d7b3=_0x29c59e();while(!![]){try{const _0xc35823=-parseInt(_0x6dcab9(0x111))/0x1+-parseInt(_0x6dcab9(0xfc))/0x2+parseInt(_0x6dcab9(0x10b))/0x3+-parseInt(_0x6dcab9(0xf8))/0x4+-parseInt(_0x6dcab9(0x102))/0x5+-parseInt(_0x6dcab9(0x10e))/0x6+-parseInt(_0x6dcab9(0x109))/0x7*(-parseInt(_0x6dcab9(0x100))/0x8);if(_0xc35823===_0x3cc244)break;else _0x55d7b3['push'](_0x55d7b3['shift']());}catch(_0x219858){_0x55d7b3['push'](_0x55d7b3['shift']());}}}(a146_0x50f0,0x3fe12));import{existsSync}from'node:fs';import{homedir}from'node:os';function a146_0x4632(_0x3cc49d,_0x14d48d){_0x3cc49d=_0x3cc49d-0xf5;const _0x50f076=a146_0x50f0();let _0x46326a=_0x50f076[_0x3cc49d];return _0x46326a;}import{resolve}from'node:path';import{fingerprintAccessKey}from'../../commands/app/cache.js';import{PRODUCT_CONFIG,productEnv}from'../../constant/product.js';function a146_0x50f0(){const _0x289f97=['workbuddySkillsDir','\x20for\x20local\x20path:\x20','trim','validation','path\x20segment','skills','14728TBziFE','appCode','606147qOBTFR','Unsafe\x20','.workbuddy','1582380ejcfVV','filter','CLAUDE_SKILL_ROOT','364170OnAfgU','SKILL_ROOT','skillCode','includes','503976HNaZtf','.claude','cacheRoot','claudeSkillsDir','115360sjtBRO','agentsSkillsDir','homeDirName','cache','3368TpZqyZ','.agents','73045pDRJmm'];a146_0x50f0=function(){return _0x289f97;};return a146_0x50f0();}import{CliErrors}from'../../errors.js';export function resolveSkillSyncPaths(_0x5d1527={}){const _0xc20656=a146_0x4632,_0x29d4b1=_0x5d1527['homeDir']??homedir(),_0xc2174c=resolve(_0x29d4b1,PRODUCT_CONFIG[_0xc20656(0xfe)],_0xc20656(0xff)),_0x899575=trimmedEnv(_0xc20656(0xf5)),_0x5d31f2=trimmedEnv(_0xc20656(0x110)),_0xeac17b=resolve(_0x29d4b1,_0xc20656(0x10d)),_0x28ace9=_0x5d1527[_0xc20656(0x103)]??(existsSync(_0xeac17b)?resolve(_0xeac17b,_0xc20656(0x108)):undefined);return{'homeDir':_0x29d4b1,'cacheRoot':_0xc2174c,'managedRoot':resolve(_0x29d4b1,PRODUCT_CONFIG[_0xc20656(0xfe)]),'agentsSkillsDir':_0x5d1527['agentsSkillsDir']??_0x899575??resolve(_0x29d4b1,_0xc20656(0x101),_0xc20656(0x108)),'claudeSkillsDir':_0x5d1527[_0xc20656(0xfb)]??_0x5d31f2??resolve(_0x29d4b1,_0xc20656(0xf9),_0xc20656(0x108)),'workbuddySkillsDir':_0x28ace9};}export function runtimeAgentSkillRoots(_0x2aa333){const _0x5c0aaa=a146_0x4632;return[_0x2aa333[_0x5c0aaa(0xfd)],_0x2aa333[_0x5c0aaa(0xfb)],_0x2aa333[_0x5c0aaa(0x103)]][_0x5c0aaa(0x10f)](_0x3876e8=>Boolean(_0x3876e8));}export function getRuntimeSkillCacheRoot(_0xb7b8ae,_0x2094eb,_0x548da3={}){const _0x10954a=a146_0x4632,_0x18e3e2=resolveSkillSyncPaths(_0x548da3);return resolve(_0x18e3e2[_0x10954a(0xfa)],_0xb7b8ae,fingerprintAccessKey(_0x2094eb),_0x10954a(0x108));}export function getRuntimeSkillDir(_0x18ae6f,_0x36c5db,_0x39850f,_0x4bfd9c,_0x2911a3,_0x4bc07b={}){const _0x2e517a=a146_0x4632;return resolve(getRuntimeSkillCacheRoot(_0x18ae6f,_0x36c5db,_0x4bc07b),safePathSegment(_0x39850f,_0x2e517a(0x10a)),_0x4bfd9c,safePathSegment(_0x2911a3,_0x2e517a(0xf6)));}export function safePathSegment(_0x51035f,_0xa217a5=a146_0x3197c3(0x107)){const _0x2c9379=a146_0x3197c3;if(!_0x51035f||_0x51035f[_0x2c9379(0xf7)]('/')||_0x51035f[_0x2c9379(0xf7)]('\x5c')||_0x51035f[_0x2c9379(0xf7)]('..'))throw CliErrors[_0x2c9379(0x106)](_0x2c9379(0x10c)+_0xa217a5+_0x2c9379(0x104)+_0x51035f);return _0x51035f;}function trimmedEnv(_0x38a0e){const _0x1d9295=a146_0x3197c3,_0x301f6c=productEnv(_0x38a0e)?.[_0x1d9295(0x105)]();return _0x301f6c?_0x301f6c:undefined;}
@@ -1 +1 @@
1
- (function(_0x1c5b94,_0x52b2a0){const _0x58e66a=a145_0x3ecc,_0x271ebb=_0x1c5b94();while(!![]){try{const _0x2e991c=-parseInt(_0x58e66a(0x210))/0x1+parseInt(_0x58e66a(0x205))/0x2+-parseInt(_0x58e66a(0x21e))/0x3+-parseInt(_0x58e66a(0x21a))/0x4*(parseInt(_0x58e66a(0x1fb))/0x5)+-parseInt(_0x58e66a(0x202))/0x6*(-parseInt(_0x58e66a(0x1fa))/0x7)+parseInt(_0x58e66a(0x1f6))/0x8+-parseInt(_0x58e66a(0x21c))/0x9;if(_0x2e991c===_0x52b2a0)break;else _0x271ebb['push'](_0x271ebb['shift']());}catch(_0x2d8560){_0x271ebb['push'](_0x271ebb['shift']());}}}(a145_0x16a0,0x5ea00));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a145_0x58cd9b}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(_0x483845,_0x3efe97,_0x43b71f={}){const _0x5728fb=a145_0x3ecc,_0x1a7686=resolvePushDirectoryRoot(_0x483845),_0x42f56b=readPushMetadataIfPresent(resolve(_0x1a7686,METADATA_FILE),{'ignoreInvalidMetadata':_0x43b71f[_0x5728fb(0x1f8)]});if(_0x42f56b?.[_0x5728fb(0x211)]&&_0x42f56b[_0x5728fb(0x211)]!==_0x3efe97&&!_0x43b71f[_0x5728fb(0x223)]&&!_0x43b71f['ignoreMetadataAppCodeMismatch'])throw CliErrors['validation'](_0x5728fb(0x1f7)+_0x42f56b[_0x5728fb(0x211)]+'\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22'+_0x3efe97+'\x22.');const _0x1f0600=resolvePushSkillCode(_0x1a7686,_0x3efe97,_0x42f56b,_0x43b71f);if(!_0x1f0600)throw CliErrors[_0x5728fb(0x20b)](_0x5728fb(0x1ea)+SKILL_FILE+',\x20'+METADATA_FILE+_0x5728fb(0x215));return{'dir':_0x1a7686,'skillCode':_0x1f0600,'metadata':_0x42f56b};}export function readPushDirectory(_0x3c5cd2,_0x1e9e6b,_0x3de903={}){const _0x55a0e6=a145_0x3ecc,_0x10a45e=resolvePushDirectoryIdentity(_0x3c5cd2,_0x1e9e6b,_0x3de903),_0x47d57e=_0x10a45e[_0x55a0e6(0x20d)],_0x7a7bed=resolve(_0x47d57e,SKILL_FILE);if(!existsSync(_0x7a7bed)||!lstatSync(_0x7a7bed)['isFile']())throw CliErrors['validation'](_0x55a0e6(0x204)+SKILL_FILE+':\x20'+_0x7a7bed);const _0x1e91e8=_0x10a45e[_0x55a0e6(0x1ff)],_0x1e456a=_0x3de903[_0x55a0e6(0x21b)]??_0x55a0e6(0x1e9);if(!_0x3de903[_0x55a0e6(0x1f5)]&&_0x1e91e8?.[_0x55a0e6(0x1f3)]===_0x55a0e6(0x217))throw CliErrors[_0x55a0e6(0x20b)](_0x55a0e6(0x1fd)+METADATA_FILE+'\x20has\x20scope=\x22'+_0x1e91e8[_0x55a0e6(0x1f3)]+'\x22.');if(!_0x3de903[_0x55a0e6(0x1f5)]&&_0x1e456a===_0x55a0e6(0x1e9)&&_0x1e91e8?.[_0x55a0e6(0x1f3)]&&_0x1e91e8[_0x55a0e6(0x1f3)]!==_0x55a0e6(0x1e9))throw CliErrors[_0x55a0e6(0x20b)](_0x55a0e6(0x1eb)+METADATA_FILE+_0x55a0e6(0x1fe)+_0x1e91e8[_0x55a0e6(0x1f3)]+'\x22.',_0x55a0e6(0x221)+_0x47d57e+_0x55a0e6(0x207));const _0x353891=scanSkillDirectory(_0x47d57e,{'excludedFilePaths':_0x3de903['excludedFilePaths']}),_0x538e7e=buildSkillPackage(_0x353891),_0x54a649=readFileSync(_0x7a7bed,_0x55a0e6(0x1ec)),_0xcb47ee=_0x10a45e[_0x55a0e6(0x219)],_0x4df830=_0x3de903[_0x55a0e6(0x214)]?undefined:_0x1e91e8,_0x334170=readSkillDisplayName(_0x54a649);return{'skillCode':_0xcb47ee,'metadata':_0x1e91e8,'frontmatterDisplayName':_0x334170,'input':{'skillCode':_0xcb47ee,'skillName':_0x334170??_0x4df830?.[_0x55a0e6(0x1f1)],'description':_0x4df830?.[_0x55a0e6(0x216)],'content':_0x54a649,'files':_0x538e7e[_0x55a0e6(0x1ef)],'packageBase64':_0x538e7e[_0x55a0e6(0x201)],'tags':_0x4df830?.[_0x55a0e6(0x206)],'version':_0x4df830?.[_0x55a0e6(0x220)],'sourceSessionId':_0x4df830?.['sourceSessionId']}};}function a145_0x16a0(){const _0x2c1a0c=['Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20','displayName','allowAppCodeRetarget','match','isArray','slice','startsWith','\x20name\x20for\x20SkillHub\x20slug\x20generation.','trim','personal','Unable\x20to\x20resolve\x20skillCode\x20from\x20','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20','utf8','string','filter','manifest','boolean','skillName','length','scope','toLowerCase','ignoreMetadataScope','3988912ANCqPG','Skill\x20metadata\x20appCode\x20\x22','ignoreInvalidMetadata','isFile','3356185LDYjvK','13660WCtmsV','pushedAt','Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20','\x20has\x20scope=\x22','metadata','name','packageBase64','6PreKjp','ignoreMetadataSkillCode','Missing\x20','1428762LYFRnV','tags','\x20to\x20submit\x20company\x20Skills\x20for\x20review.','path','replace','sourceSessionId','validation','number','dir','isDirectory','Remote\x20Skill\x20','640714yQxwSp','appCode','files','example','ignoreMetadataForPayload',',\x20or\x20directory\x20name.','description','builtin','isSymbolicLink','skillCode','500zBYHwf','targetScope','2404620LSdSGg','Skill\x20directory\x20not\x20found:\x20','166416ZIFDPa','content','version'];a145_0x16a0=function(){return _0x2c1a0c;};return a145_0x16a0();}export function refreshPushDirectoryMetadataFromRemote(_0x57e699,_0x3adb10,_0x3af6dd,_0x45d43c={}){const _0x178320=a145_0x3ecc,_0x4a0e3b=resolvePushDirectoryRoot(_0x57e699),_0x4ce70c=readPushMetadataIfPresent(resolve(_0x4a0e3b,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x1474b5=requireRemoteScope(_0x3adb10),_0x574f6f=readLocalSkillContent(_0x4a0e3b),_0xd08ae9={..._0x3adb10,'appCode':_0x3adb10[_0x178320(0x211)]??_0x3af6dd,'skillName':_0x3adb10['skillName']??_0x4ce70c?.['skillName'],'description':_0x3adb10[_0x178320(0x216)]??_0x4ce70c?.[_0x178320(0x216)],'example':_0x3adb10[_0x178320(0x213)]??_0x4ce70c?.[_0x178320(0x213)],'tags':Array[_0x178320(0x1e4)](_0x3adb10[_0x178320(0x206)])?_0x3adb10[_0x178320(0x206)]:_0x4ce70c?.[_0x178320(0x206)],'sourceSessionId':_0x3adb10[_0x178320(0x20a)]??_0x4ce70c?.[_0x178320(0x20a)],'content':_0x3adb10[_0x178320(0x21f)]??_0x574f6f},_0x2dfd67=buildMetadata(_0xd08ae9,_0x1474b5,_0x3af6dd,contentHash(_0x574f6f),_0x45d43c['refreshedAt']);writeJsonAtomic(resolve(_0x4a0e3b,METADATA_FILE),_0x2dfd67);}export function recordPushedRuntimeSkill(_0x451be5,_0x2b6bd8,_0x4529c8,_0x3022b7={}){const _0x23f9ee=a145_0x3ecc,_0x49e2ce=resolvePushDirectoryRoot(_0x451be5),_0x3095eb=scanSkillDirectory(_0x49e2ce),_0xde0e61=_0x3095eb['find'](_0x3a4df6=>_0x3a4df6[_0x23f9ee(0x208)]===SKILL_FILE),_0x1ef455=_0xde0e61?fileText(_0xde0e61):'',_0x7fc6a3=tryNormalizePackageManifest(_0x2b6bd8[_0x23f9ee(0x212)]),_0x1be5c5={..._0x2b6bd8,'content':_0x2b6bd8['content']??_0x1ef455,'files':_0x7fc6a3},_0x472671=_0x7fc6a3?normalizeLocalFiles(_0x3095eb)[_0x23f9ee(0x1ee)](_0x14dcf4=>_0x7fc6a3[_0x23f9ee(0x212)]['some'](_0xe00400=>_0xe00400[_0x23f9ee(0x208)]===_0x14dcf4[_0x23f9ee(0x208)])):undefined,_0xc38606=buildMetadata(_0x1be5c5,_0x3022b7[_0x23f9ee(0x1f3)]??_0x23f9ee(0x1e9),_0x4529c8,contentHash(_0x1be5c5[_0x23f9ee(0x21f)]??''),_0x3022b7[_0x23f9ee(0x1fc)],_0x472671);writeJsonAtomic(resolve(_0x49e2ce,METADATA_FILE),_0xc38606);}export function deriveSkillCodeFromDirectory(_0x4bfaf2,_0x2c0f06){const _0x1f9021=a145_0x3ecc,_0x1efefd=basename(resolve(_0x4bfaf2)),_0x396ef9=_0x2c0f06+'--';return _0x1efefd[_0x1f9021(0x1e6)](_0x396ef9)?_0x1efefd[_0x1f9021(0x1e5)](_0x396ef9[_0x1f9021(0x1f2)]):_0x1efefd;}function resolvePushSkillCode(_0x1c8667,_0x58cd2d,_0x5829ce,_0x1cc4f1){const _0x14cc6e=a145_0x3ecc,_0x7482ec=deriveSkillCodeFromSkillFile(_0x1c8667)||deriveSkillCodeFromDirectory(_0x1c8667,_0x58cd2d);if(_0x1cc4f1[_0x14cc6e(0x203)])return _0x7482ec;return _0x5829ce?.['skillCode']?.[_0x14cc6e(0x1e8)]()||_0x7482ec;}function deriveSkillCodeFromSkillFile(_0x565d6b){const _0x3a85f5=a145_0x3ecc,_0x18030f=resolve(_0x565d6b,SKILL_FILE);if(!existsSync(_0x18030f)||!lstatSync(_0x18030f)[_0x3a85f5(0x1f9)]())return undefined;const _0x505518=readFileSync(_0x18030f,_0x3a85f5(0x1ec)),_0x3fc279=_0x505518['match'](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x3fc279)return undefined;const _0x11252b=parseFrontmatterObject(_0x3fc279[0x1]??''),_0x57f7e5=scalarToString(_0x11252b?.[_0x3a85f5(0x200)]);return _0x57f7e5?slugifySkillName(_0x57f7e5):undefined;}function readSkillDisplayName(_0x425885){const _0x212df7=a145_0x3ecc,_0x2c89a5=_0x425885[_0x212df7(0x1e3)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x2c89a5)return undefined;const _0x2800c2=parseFrontmatterObject(_0x2c89a5[0x1]??'');return scalarToString(_0x2800c2?.[_0x212df7(0x222)]);}function slugifySkillName(_0x11e4e8){const _0x1f31c1=a145_0x3ecc,_0x5462fd=_0x11e4e8[_0x1f31c1(0x1e8)]()[_0x1f31c1(0x1f4)]()['replace'](/[^\p{L}\p{N}\p{So}]+/gu,'-')[_0x1f31c1(0x209)](/^-+/,'')[_0x1f31c1(0x209)](/-+$/,'')[_0x1f31c1(0x209)](/-{2,}/g,'-');if(!_0x5462fd)throw CliErrors[_0x1f31c1(0x20b)]('Invalid\x20'+SKILL_FILE+_0x1f31c1(0x1e7));return _0x5462fd;}function parseFrontmatterObject(_0x146897){try{const _0x3e3560=a145_0x58cd9b(_0x146897);return _0x3e3560&&typeof _0x3e3560==='object'&&!Array['isArray'](_0x3e3560)?_0x3e3560:undefined;}catch{return undefined;}}function scalarToString(_0x401931){const _0x642abf=a145_0x3ecc;if(typeof _0x401931===_0x642abf(0x1ed))return _0x401931[_0x642abf(0x1e8)]();if(typeof _0x401931===_0x642abf(0x20c)||typeof _0x401931===_0x642abf(0x1f0))return String(_0x401931);return undefined;}function resolvePushDirectoryRoot(_0x148e35){const _0x17277c=a145_0x3ecc,_0x3e8e1f=resolve(_0x148e35);if(!existsSync(_0x3e8e1f))throw CliErrors[_0x17277c(0x20b)](_0x17277c(0x21d)+_0x148e35);const _0x59e8f8=lstatSync(_0x3e8e1f);if(_0x59e8f8[_0x17277c(0x20e)]())return _0x3e8e1f;if(_0x59e8f8[_0x17277c(0x218)]()){const _0x554601=realpathSync(_0x3e8e1f);if(lstatSync(_0x554601)[_0x17277c(0x20e)]())return _0x554601;}throw CliErrors[_0x17277c(0x20b)]('Skill\x20directory\x20not\x20found:\x20'+_0x148e35);}function a145_0x3ecc(_0x1863c8,_0x3c3965){_0x1863c8=_0x1863c8-0x1e3;const _0x16a014=a145_0x16a0();let _0x3ecc34=_0x16a014[_0x1863c8];return _0x3ecc34;}function requireRemoteScope(_0x40492f){const _0x319361=a145_0x3ecc;if(_0x40492f['scope']===_0x319361(0x1e9)||_0x40492f['scope']==='company'||_0x40492f[_0x319361(0x1f3)]===_0x319361(0x217))return _0x40492f[_0x319361(0x1f3)];throw CliErrors[_0x319361(0x20b)](_0x319361(0x20f)+(_0x40492f[_0x319361(0x219)]||'(unknown)')+'\x20has\x20unsupported\x20scope\x20\x22'+(_0x40492f[_0x319361(0x1f3)]??'unknown')+'\x22.');}function readLocalSkillContent(_0xe0e0cd){const _0x28e3eb=a145_0x3ecc,_0x3e3fcb=resolve(_0xe0e0cd,SKILL_FILE);return existsSync(_0x3e3fcb)&&lstatSync(_0x3e3fcb)[_0x28e3eb(0x1f9)]()?readFileSync(_0x3e3fcb,_0x28e3eb(0x1ec)):'';}function readPushMetadataIfPresent(_0x470fa9,_0x38c9c2={}){const _0x51a83e=a145_0x3ecc;try{return readMetadataIfPresent(_0x470fa9);}catch(_0x67d050){if(_0x38c9c2[_0x51a83e(0x1f8)])return undefined;throw _0x67d050;}}
1
+ (function(_0x35626e,_0x2cafaf){const _0x4fc7b3=a147_0x3adc,_0x56d972=_0x35626e();while(!![]){try{const _0xc36a6d=-parseInt(_0x4fc7b3(0xc9))/0x1+parseInt(_0x4fc7b3(0xcb))/0x2+-parseInt(_0x4fc7b3(0xe8))/0x3*(parseInt(_0x4fc7b3(0xf4))/0x4)+-parseInt(_0x4fc7b3(0xe2))/0x5+-parseInt(_0x4fc7b3(0xfd))/0x6+-parseInt(_0x4fc7b3(0xd1))/0x7+-parseInt(_0x4fc7b3(0xf1))/0x8*(-parseInt(_0x4fc7b3(0xeb))/0x9);if(_0xc36a6d===_0x2cafaf)break;else _0x56d972['push'](_0x56d972['shift']());}catch(_0x572504){_0x56d972['push'](_0x56d972['shift']());}}}(a147_0x4aae,0x5ccbb));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a147_0x4a969b}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';function a147_0x3adc(_0x2330cc,_0x380723){_0x2330cc=_0x2330cc-0xc5;const _0x4aaecc=a147_0x4aae();let _0x3adc7b=_0x4aaecc[_0x2330cc];return _0x3adc7b;}import{buildSkillPackage,tryNormalizePackageManifest}from'./zip-package.js';export function resolvePushDirectoryIdentity(_0x185a71,_0x49ed53,_0x3815d5={}){const _0x15c843=a147_0x3adc,_0x7ab71d=resolvePushDirectoryRoot(_0x185a71),_0x36b635=readPushMetadataIfPresent(resolve(_0x7ab71d,METADATA_FILE),{'ignoreInvalidMetadata':_0x3815d5['ignoreInvalidMetadata']});if(_0x36b635?.[_0x15c843(0xfa)]&&_0x36b635['appCode']!==_0x49ed53&&!_0x3815d5['allowAppCodeRetarget']&&!_0x3815d5[_0x15c843(0xf2)])throw CliErrors[_0x15c843(0xd3)]('Skill\x20metadata\x20appCode\x20\x22'+_0x36b635[_0x15c843(0xfa)]+_0x15c843(0xde)+_0x49ed53+'\x22.');const _0x257a18=resolvePushSkillCode(_0x7ab71d,_0x49ed53,_0x36b635,_0x3815d5);if(!_0x257a18)throw CliErrors[_0x15c843(0xd3)]('Unable\x20to\x20resolve\x20skillCode\x20from\x20'+SKILL_FILE+',\x20'+METADATA_FILE+_0x15c843(0x102));return{'dir':_0x7ab71d,'skillCode':_0x257a18,'metadata':_0x36b635};}export function readPushDirectory(_0x2f9ca3,_0x1f3e99,_0x256aff={}){const _0xccd2c4=a147_0x3adc,_0x44eee0=resolvePushDirectoryIdentity(_0x2f9ca3,_0x1f3e99,_0x256aff),_0x220669=_0x44eee0[_0xccd2c4(0xd8)],_0x421520=resolve(_0x220669,SKILL_FILE);if(!existsSync(_0x421520)||!lstatSync(_0x421520)[_0xccd2c4(0xf3)]())throw CliErrors[_0xccd2c4(0xd3)](_0xccd2c4(0x104)+SKILL_FILE+':\x20'+_0x421520);const _0xb2a61d=_0x44eee0[_0xccd2c4(0xda)],_0xd2cbb4=_0x256aff[_0xccd2c4(0xf7)]??_0xccd2c4(0xd6);if(!_0x256aff[_0xccd2c4(0xdb)]&&_0xb2a61d?.['scope']===_0xccd2c4(0xf0))throw CliErrors[_0xccd2c4(0xd3)](_0xccd2c4(0xc6)+METADATA_FILE+_0xccd2c4(0xec)+_0xb2a61d[_0xccd2c4(0xe3)]+'\x22.');if(!_0x256aff[_0xccd2c4(0xdb)]&&_0xd2cbb4===_0xccd2c4(0xd6)&&_0xb2a61d?.[_0xccd2c4(0xe3)]&&_0xb2a61d[_0xccd2c4(0xe3)]!=='personal')throw CliErrors['validation'](_0xccd2c4(0xcd)+METADATA_FILE+_0xccd2c4(0xec)+_0xb2a61d['scope']+'\x22.',_0xccd2c4(0xd2)+_0x220669+_0xccd2c4(0xed));const _0x4b1265=scanSkillDirectory(_0x220669,{'excludedFilePaths':_0x256aff[_0xccd2c4(0xf5)]}),_0xd4608b=buildSkillPackage(_0x4b1265),_0x542f05=readFileSync(_0x421520,'utf8'),_0x247e35=_0x44eee0[_0xccd2c4(0xce)],_0x49e46e=_0x256aff[_0xccd2c4(0xcf)]?undefined:_0xb2a61d,_0x2199bc=readSkillDisplayName(_0x542f05);return{'skillCode':_0x247e35,'metadata':_0xb2a61d,'frontmatterDisplayName':_0x2199bc,'input':{'skillCode':_0x247e35,'skillName':_0x2199bc??_0x49e46e?.['skillName'],'description':_0x49e46e?.['description'],'content':_0x542f05,'files':_0xd4608b[_0xccd2c4(0xe0)],'packageBase64':_0xd4608b['packageBase64'],'tags':_0x49e46e?.[_0xccd2c4(0x103)],'version':_0x49e46e?.[_0xccd2c4(0x100)],'sourceSessionId':_0x49e46e?.[_0xccd2c4(0xcc)]}};}export function refreshPushDirectoryMetadataFromRemote(_0x8dc13d,_0x2d652d,_0xee6c8e,_0x13a322={}){const _0xe7fe9c=a147_0x3adc,_0x5bbd6b=resolvePushDirectoryRoot(_0x8dc13d),_0x3aba48=readPushMetadataIfPresent(resolve(_0x5bbd6b,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x2d4862=requireRemoteScope(_0x2d652d),_0x5469b2=readLocalSkillContent(_0x5bbd6b),_0x386994={..._0x2d652d,'appCode':_0x2d652d[_0xe7fe9c(0xfa)]??_0xee6c8e,'skillName':_0x2d652d[_0xe7fe9c(0xca)]??_0x3aba48?.[_0xe7fe9c(0xca)],'description':_0x2d652d[_0xe7fe9c(0xd9)]??_0x3aba48?.[_0xe7fe9c(0xd9)],'example':_0x2d652d[_0xe7fe9c(0xe9)]??_0x3aba48?.[_0xe7fe9c(0xe9)],'tags':Array['isArray'](_0x2d652d['tags'])?_0x2d652d[_0xe7fe9c(0x103)]:_0x3aba48?.[_0xe7fe9c(0x103)],'sourceSessionId':_0x2d652d[_0xe7fe9c(0xcc)]??_0x3aba48?.['sourceSessionId'],'content':_0x2d652d[_0xe7fe9c(0x101)]??_0x5469b2},_0x31dcca=buildMetadata(_0x386994,_0x2d4862,_0xee6c8e,contentHash(_0x5469b2),_0x13a322['refreshedAt']);writeJsonAtomic(resolve(_0x5bbd6b,METADATA_FILE),_0x31dcca);}export function recordPushedRuntimeSkill(_0x27fb4b,_0xe75863,_0xc98044,_0x1cf972={}){const _0x2e8ff8=a147_0x3adc,_0x23869d=resolvePushDirectoryRoot(_0x27fb4b),_0x373b8f=scanSkillDirectory(_0x23869d),_0x3a7f4d=_0x373b8f[_0x2e8ff8(0xd4)](_0xc3fbe3=>_0xc3fbe3[_0x2e8ff8(0xc7)]===SKILL_FILE),_0x2d114e=_0x3a7f4d?fileText(_0x3a7f4d):'',_0x37a4e3=tryNormalizePackageManifest(_0xe75863[_0x2e8ff8(0xee)]),_0xd93ab={..._0xe75863,'content':_0xe75863[_0x2e8ff8(0x101)]??_0x2d114e,'files':_0x37a4e3},_0x30d32d=_0x37a4e3?normalizeLocalFiles(_0x373b8f)[_0x2e8ff8(0xd5)](_0xdb9ab0=>_0x37a4e3[_0x2e8ff8(0xee)][_0x2e8ff8(0xf8)](_0x952fcd=>_0x952fcd['path']===_0xdb9ab0[_0x2e8ff8(0xc7)])):undefined,_0x11a874=buildMetadata(_0xd93ab,_0x1cf972[_0x2e8ff8(0xe3)]??_0x2e8ff8(0xd6),_0xc98044,contentHash(_0xd93ab['content']??''),_0x1cf972[_0x2e8ff8(0xfc)],_0x30d32d);writeJsonAtomic(resolve(_0x23869d,METADATA_FILE),_0x11a874);}export function deriveSkillCodeFromDirectory(_0x1fdce2,_0xa37a01){const _0x773ef2=a147_0x3adc,_0x59d77e=basename(resolve(_0x1fdce2)),_0x3b6144=_0xa37a01+'--';return _0x59d77e[_0x773ef2(0xff)](_0x3b6144)?_0x59d77e['slice'](_0x3b6144[_0x773ef2(0xfe)]):_0x59d77e;}function a147_0x4aae(){const _0x2638db=['find','filter','personal','isArray','dir','description','metadata','ignoreMetadataScope','object','trim','\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22','replace','manifest','Invalid\x20','179680kDRAug','scope','string','unknown','ignoreMetadataSkillCode','displayName','42mNGzqq','example','\x20has\x20unsupported\x20scope\x20\x22','397017CZaPom','\x20has\x20scope=\x22','\x20to\x20submit\x20company\x20Skills\x20for\x20review.','files','number','builtin','328yCvzoj','ignoreMetadataAppCodeMismatch','isFile','159632FBPDtv','excludedFilePaths','name','targetScope','some','Remote\x20Skill\x20','appCode','isDirectory','pushedAt','4103844GJdHQo','length','startsWith','version','content',',\x20or\x20directory\x20name.','tags','Missing\x20','company','match','Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20','path','(unknown)','544418vGZfHZ','skillName','892408IyEuaR','sourceSessionId','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20','skillCode','ignoreMetadataForPayload','utf8','361942ryShdF','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20','validation'];a147_0x4aae=function(){return _0x2638db;};return a147_0x4aae();}function resolvePushSkillCode(_0x3be65e,_0x513262,_0x27141e,_0x558647){const _0x9cd1d0=a147_0x3adc,_0x120fc8=deriveSkillCodeFromSkillFile(_0x3be65e)||deriveSkillCodeFromDirectory(_0x3be65e,_0x513262);if(_0x558647[_0x9cd1d0(0xe6)])return _0x120fc8;return _0x27141e?.[_0x9cd1d0(0xce)]?.['trim']()||_0x120fc8;}function deriveSkillCodeFromSkillFile(_0x311285){const _0x5a8682=a147_0x3adc,_0x3cf26d=resolve(_0x311285,SKILL_FILE);if(!existsSync(_0x3cf26d)||!lstatSync(_0x3cf26d)[_0x5a8682(0xf3)]())return undefined;const _0x12b6e0=readFileSync(_0x3cf26d,_0x5a8682(0xd0)),_0x23cf18=_0x12b6e0[_0x5a8682(0xc5)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x23cf18)return undefined;const _0x1c76c2=parseFrontmatterObject(_0x23cf18[0x1]??''),_0x314ae4=scalarToString(_0x1c76c2?.[_0x5a8682(0xf6)]);return _0x314ae4?slugifySkillName(_0x314ae4):undefined;}function readSkillDisplayName(_0x306bfe){const _0x45b76b=a147_0x3adc,_0x3c13b6=_0x306bfe[_0x45b76b(0xc5)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x3c13b6)return undefined;const _0x4eed77=parseFrontmatterObject(_0x3c13b6[0x1]??'');return scalarToString(_0x4eed77?.[_0x45b76b(0xe7)]);}function slugifySkillName(_0x5a65e1){const _0x4dd08=a147_0x3adc,_0x45fb08=_0x5a65e1[_0x4dd08(0xdd)]()['toLowerCase']()[_0x4dd08(0xdf)](/[^\p{L}\p{N}\p{So}]+/gu,'-')[_0x4dd08(0xdf)](/^-+/,'')['replace'](/-+$/,'')[_0x4dd08(0xdf)](/-{2,}/g,'-');if(!_0x45fb08)throw CliErrors[_0x4dd08(0xd3)](_0x4dd08(0xe1)+SKILL_FILE+'\x20name\x20for\x20SkillHub\x20slug\x20generation.');return _0x45fb08;}function parseFrontmatterObject(_0x1b86c8){const _0x118fa2=a147_0x3adc;try{const _0x3824d8=a147_0x4a969b(_0x1b86c8);return _0x3824d8&&typeof _0x3824d8===_0x118fa2(0xdc)&&!Array[_0x118fa2(0xd7)](_0x3824d8)?_0x3824d8:undefined;}catch{return undefined;}}function scalarToString(_0x236f40){const _0x51d707=a147_0x3adc;if(typeof _0x236f40===_0x51d707(0xe4))return _0x236f40[_0x51d707(0xdd)]();if(typeof _0x236f40===_0x51d707(0xef)||typeof _0x236f40==='boolean')return String(_0x236f40);return undefined;}function resolvePushDirectoryRoot(_0x318568){const _0x584334=a147_0x3adc,_0x492a8d=resolve(_0x318568);if(!existsSync(_0x492a8d))throw CliErrors[_0x584334(0xd3)]('Skill\x20directory\x20not\x20found:\x20'+_0x318568);const _0x3d3610=lstatSync(_0x492a8d);if(_0x3d3610[_0x584334(0xfb)]())return _0x492a8d;if(_0x3d3610['isSymbolicLink']()){const _0x38e776=realpathSync(_0x492a8d);if(lstatSync(_0x38e776)[_0x584334(0xfb)]())return _0x38e776;}throw CliErrors[_0x584334(0xd3)]('Skill\x20directory\x20not\x20found:\x20'+_0x318568);}function requireRemoteScope(_0x3a6ab8){const _0x27514c=a147_0x3adc;if(_0x3a6ab8[_0x27514c(0xe3)]===_0x27514c(0xd6)||_0x3a6ab8[_0x27514c(0xe3)]===_0x27514c(0x105)||_0x3a6ab8[_0x27514c(0xe3)]===_0x27514c(0xf0))return _0x3a6ab8['scope'];throw CliErrors[_0x27514c(0xd3)](_0x27514c(0xf9)+(_0x3a6ab8[_0x27514c(0xce)]||_0x27514c(0xc8))+_0x27514c(0xea)+(_0x3a6ab8[_0x27514c(0xe3)]??_0x27514c(0xe5))+'\x22.');}function readLocalSkillContent(_0x18261e){const _0x33bdf4=a147_0x3adc,_0xac02d7=resolve(_0x18261e,SKILL_FILE);return existsSync(_0xac02d7)&&lstatSync(_0xac02d7)[_0x33bdf4(0xf3)]()?readFileSync(_0xac02d7,_0x33bdf4(0xd0)):'';}function readPushMetadataIfPresent(_0x1575c9,_0x770062={}){try{return readMetadataIfPresent(_0x1575c9);}catch(_0x4dd626){if(_0x770062['ignoreInvalidMetadata'])return undefined;throw _0x4dd626;}}
@@ -1 +1 @@
1
- (function(_0x343b98,_0x3633f6){const _0x10e1bc=a146_0x31d7,_0x277fcf=_0x343b98();while(!![]){try{const _0x57e248=parseInt(_0x10e1bc(0x184))/0x1+parseInt(_0x10e1bc(0x17e))/0x2+-parseInt(_0x10e1bc(0x183))/0x3+-parseInt(_0x10e1bc(0x181))/0x4*(-parseInt(_0x10e1bc(0x186))/0x5)+-parseInt(_0x10e1bc(0x18b))/0x6*(parseInt(_0x10e1bc(0x185))/0x7)+parseInt(_0x10e1bc(0x18c))/0x8*(-parseInt(_0x10e1bc(0x189))/0x9)+parseInt(_0x10e1bc(0x17d))/0xa;if(_0x57e248===_0x3633f6)break;else _0x277fcf['push'](_0x277fcf['shift']());}catch(_0x51f394){_0x277fcf['push'](_0x277fcf['shift']());}}}(a146_0x6688,0x775d1));function a146_0x6688(){const _0xd289a7=['52535nnahBo','validation','personal','27HVFSQr','Unsupported\x20runtime\x20Skill\x20scope:\x20','210570UYyMor','1300504eLCeXG','length','push','7387090jSIBbG','876908iyEacy','includes','builtin','216FLyRsc','company','2325609dFmPRl','498594IYjIfs','98uJxJMV'];a146_0x6688=function(){return _0xd289a7;};return a146_0x6688();}import{CliErrors}from'../../errors.js';function a146_0x31d7(_0x3edc4f,_0x46b5b5){_0x3edc4f=_0x3edc4f-0x17d;const _0x668859=a146_0x6688();let _0x31d783=_0x668859[_0x3edc4f];return _0x31d783;}export function normalizeRuntimeSkillScopes(_0x3e8863){const _0x36a2c7=a146_0x31d7,_0x199021=_0x3e8863&&_0x3e8863[_0x36a2c7(0x18d)]>0x0?_0x3e8863:['personal',_0x36a2c7(0x182),_0x36a2c7(0x180)],_0xc363b=[];for(const _0x2b2779 of _0x199021){if(!isRuntimeSkillScope(_0x2b2779))throw CliErrors[_0x36a2c7(0x187)](_0x36a2c7(0x18a)+_0x2b2779);!_0xc363b[_0x36a2c7(0x17f)](_0x2b2779)&&_0xc363b[_0x36a2c7(0x18e)](_0x2b2779);}return _0xc363b;}export function isRuntimeSkillScope(_0x20ba8f){const _0xc82e82=a146_0x31d7;return _0x20ba8f===_0xc82e82(0x188)||_0x20ba8f===_0xc82e82(0x182)||_0x20ba8f===_0xc82e82(0x180);}
1
+ (function(_0x24e45a,_0x4b9a46){const _0x4cd430=a148_0x5d54,_0x57c167=_0x24e45a();while(!![]){try{const _0x1059b9=-parseInt(_0x4cd430(0x12f))/0x1*(parseInt(_0x4cd430(0x12e))/0x2)+parseInt(_0x4cd430(0x137))/0x3*(-parseInt(_0x4cd430(0x126))/0x4)+parseInt(_0x4cd430(0x12c))/0x5*(-parseInt(_0x4cd430(0x132))/0x6)+-parseInt(_0x4cd430(0x12d))/0x7+parseInt(_0x4cd430(0x12b))/0x8*(-parseInt(_0x4cd430(0x129))/0x9)+parseInt(_0x4cd430(0x135))/0xa+parseInt(_0x4cd430(0x128))/0xb;if(_0x1059b9===_0x4b9a46)break;else _0x57c167['push'](_0x57c167['shift']());}catch(_0x3a2027){_0x57c167['push'](_0x57c167['shift']());}}}(a148_0x3957,0xd01c7));function a148_0x5d54(_0x2c88f4,_0x1519e5){_0x2c88f4=_0x2c88f4-0x126;const _0x395712=a148_0x3957();let _0x5d5456=_0x395712[_0x2c88f4];return _0x5d5456;}import{CliErrors}from'../../errors.js';export function normalizeRuntimeSkillScopes(_0x2cf40d){const _0x52f38d=a148_0x5d54,_0x4581ed=_0x2cf40d&&_0x2cf40d[_0x52f38d(0x131)]>0x0?_0x2cf40d:[_0x52f38d(0x136),_0x52f38d(0x134),'builtin'],_0x17d65d=[];for(const _0x5d2c11 of _0x4581ed){if(!isRuntimeSkillScope(_0x5d2c11))throw CliErrors[_0x52f38d(0x127)](_0x52f38d(0x133)+_0x5d2c11);!_0x17d65d['includes'](_0x5d2c11)&&_0x17d65d[_0x52f38d(0x130)](_0x5d2c11);}return _0x17d65d;}export function isRuntimeSkillScope(_0x3d0d0a){const _0x5823ed=a148_0x5d54;return _0x3d0d0a==='personal'||_0x3d0d0a===_0x5823ed(0x134)||_0x3d0d0a===_0x5823ed(0x12a);}function a148_0x3957(){const _0x4c5d3f=['2428132ivbgIF','299594YkBVoF','9dpyvlI','push','length','1382088yPAnpJ','Unsupported\x20runtime\x20Skill\x20scope:\x20','company','15452280uWmKVc','personal','63tbhrse','95808YooLSk','validation','25874145gnYkCO','280647kSJtPF','builtin','40mfCvMc','15RiUIXI'];a148_0x3957=function(){return _0x4c5d3f;};return a148_0x3957();}
@@ -1 +1 @@
1
- const a148_0x42931f=a148_0x3686;function a148_0x3686(_0x5be057,_0x5fb535){_0x5be057=_0x5be057-0xfc;const _0x3e2b27=a148_0x3e2b();let _0x3686e4=_0x3e2b27[_0x5be057];return _0x3686e4;}function a148_0x3e2b(){const _0x4f5d59=['629545gMGeUm','1980-01-01T00:00:00.000Z','659550dHZyaE','42MIBZWq','54nNtyaV','428rGHtfH','validation_error','from','23525DDwVPQ','sort','1513096yWrTxu','951310wpoQqY','endsWith','code','Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.','135lvPKIS','validation','4259101yGEWEO','path','length','Runtime\x20Skill\x20package\x20contains\x20directory\x20entry:\x20','name','map','9954DHAlGy'];a148_0x3e2b=function(){return _0x4f5d59;};return a148_0x3e2b();}(function(_0xcd4fe4,_0x318519){const _0xb6e54f=a148_0x3686,_0x3a1822=_0xcd4fe4();while(!![]){try{const _0x334bda=parseInt(_0xb6e54f(0x101))/0x1+parseInt(_0xb6e54f(0xfe))/0x2*(-parseInt(_0xb6e54f(0x10e))/0x3)+parseInt(_0xb6e54f(0x104))/0x4*(parseInt(_0xb6e54f(0x107))/0x5)+parseInt(_0xb6e54f(0x102))/0x6*(parseInt(_0xb6e54f(0xff))/0x7)+-parseInt(_0xb6e54f(0x109))/0x8+-parseInt(_0xb6e54f(0x103))/0x9*(parseInt(_0xb6e54f(0x10a))/0xa)+-parseInt(_0xb6e54f(0x110))/0xb;if(_0x334bda===_0x318519)break;else _0x3a1822['push'](_0x3a1822['shift']());}catch(_0x4fb24e){_0x3a1822['push'](_0x3a1822['shift']());}}}(a148_0x3e2b,0x66e4b));import{unzipSync,zipSync}from'fflate';import{CliErrors}from'../../errors.js';import{compareSkillFiles,fileContent,normalizeLocalFiles,normalizeSkillRelativePath}from'./local-files.js';const ZIP_MTIME=new Date(a148_0x42931f(0x100));export function createDeterministicZipPackage(_0x396b00){const _0x3039be=a148_0x42931f,_0x539d26={};for(const _0x4b48ba of normalizeLocalFiles(_0x396b00)){_0x539d26[_0x4b48ba[_0x3039be(0x111)]]=fileContent(_0x4b48ba);}return Buffer[_0x3039be(0x106)](zipSync(_0x539d26,{'level':0x0,'mtime':ZIP_MTIME}));}export function parseZipPackage(_0x28010b){const _0x488c5b=a148_0x42931f;if(_0x28010b[_0x488c5b(0x112)]<0x16)throw CliErrors[_0x488c5b(0x10f)]('Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.');let _0x32777a;try{_0x32777a=unzipSync(_0x28010b,{'filter'(_0x4f5f7c){const _0x2a431a=_0x488c5b,_0x3f9638=normalizeSkillRelativePath(_0x4f5f7c[_0x2a431a(0xfc)]);if(_0x3f9638[_0x2a431a(0x10b)]('/'))throw CliErrors[_0x2a431a(0x10f)](_0x2a431a(0x113)+_0x3f9638);return!![];}});}catch(_0x17ecdb){if(isRuntimeSkillValidationError(_0x17ecdb))throw _0x17ecdb;throw CliErrors[_0x488c5b(0x10f)](_0x488c5b(0x10d));}return Object['entries'](_0x32777a)[_0x488c5b(0xfd)](([_0xbb102,_0x5ee852])=>({'path':normalizeSkillRelativePath(_0xbb102),'bytes':Buffer[_0x488c5b(0x106)](_0x5ee852)}))[_0x488c5b(0x108)](compareSkillFiles);}function isRuntimeSkillValidationError(_0x4ff371){const _0xf9426d=a148_0x42931f;return typeof _0x4ff371==='object'&&_0x4ff371!==null&&_0xf9426d(0x10c)in _0x4ff371&&_0x4ff371[_0xf9426d(0x10c)]===_0xf9426d(0x105);}
1
+ (function(_0x2e3cad,_0x3f6b91){const _0x69403e=a150_0x5c21,_0x165ecf=_0x2e3cad();while(!![]){try{const _0x25b073=parseInt(_0x69403e(0x187))/0x1+parseInt(_0x69403e(0x179))/0x2+parseInt(_0x69403e(0x188))/0x3+parseInt(_0x69403e(0x17a))/0x4+-parseInt(_0x69403e(0x184))/0x5+-parseInt(_0x69403e(0x181))/0x6+parseInt(_0x69403e(0x17e))/0x7;if(_0x25b073===_0x3f6b91)break;else _0x165ecf['push'](_0x165ecf['shift']());}catch(_0x2bad1e){_0x165ecf['push'](_0x165ecf['shift']());}}}(a150_0x3ee5,0x282a5));import{unzipSync,zipSync}from'fflate';import{CliErrors}from'../../errors.js';import{compareSkillFiles,fileContent,normalizeLocalFiles,normalizeSkillRelativePath}from'./local-files.js';const ZIP_MTIME=new Date('1980-01-01T00:00:00.000Z');export function createDeterministicZipPackage(_0xc57836){const _0x4e6e61=a150_0x5c21,_0x5e8b0c={};for(const _0x3a1ad7 of normalizeLocalFiles(_0xc57836)){_0x5e8b0c[_0x3a1ad7[_0x4e6e61(0x18a)]]=fileContent(_0x3a1ad7);}return Buffer['from'](zipSync(_0x5e8b0c,{'level':0x0,'mtime':ZIP_MTIME}));}function a150_0x3ee5(){const _0x143561=['1029426Llgnjq','map','entries','1252175Ytoocb','endsWith','from','108929HWPOlB','252786glYenv','name','path','sort','60574MzktIW','1104740afcDyW','code','length','validation','608020EXYAbG','object','Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.'];a150_0x3ee5=function(){return _0x143561;};return a150_0x3ee5();}export function parseZipPackage(_0x4a227e){const _0x2fa441=a150_0x5c21;if(_0x4a227e[_0x2fa441(0x17c)]<0x16)throw CliErrors[_0x2fa441(0x17d)](_0x2fa441(0x180));let _0x34f269;try{_0x34f269=unzipSync(_0x4a227e,{'filter'(_0x37adcc){const _0x45a66=_0x2fa441,_0x4cb965=normalizeSkillRelativePath(_0x37adcc[_0x45a66(0x189)]);if(_0x4cb965[_0x45a66(0x185)]('/'))throw CliErrors[_0x45a66(0x17d)]('Runtime\x20Skill\x20package\x20contains\x20directory\x20entry:\x20'+_0x4cb965);return!![];}});}catch(_0x168f01){if(isRuntimeSkillValidationError(_0x168f01))throw _0x168f01;throw CliErrors['validation'](_0x2fa441(0x180));}return Object[_0x2fa441(0x183)](_0x34f269)[_0x2fa441(0x182)](([_0x139ba5,_0x2fd281])=>({'path':normalizeSkillRelativePath(_0x139ba5),'bytes':Buffer[_0x2fa441(0x186)](_0x2fd281)}))[_0x2fa441(0x18b)](compareSkillFiles);}function a150_0x5c21(_0x563f7,_0x28f055){_0x563f7=_0x563f7-0x179;const _0x3ee542=a150_0x3ee5();let _0x5c216a=_0x3ee542[_0x563f7];return _0x5c216a;}function isRuntimeSkillValidationError(_0x58d78d){const _0x3eabad=a150_0x5c21;return typeof _0x58d78d===_0x3eabad(0x17f)&&_0x58d78d!==null&&_0x3eabad(0x17b)in _0x58d78d&&_0x58d78d[_0x3eabad(0x17b)]==='validation_error';}
@@ -1 +1 @@
1
- (function(_0x560b42,_0x477829){const _0x2788ab=a149_0xb94a,_0x44dc67=_0x560b42();while(!![]){try{const _0x208471=parseInt(_0x2788ab(0x188))/0x1+-parseInt(_0x2788ab(0x18a))/0x2*(-parseInt(_0x2788ab(0x189))/0x3)+-parseInt(_0x2788ab(0x1a9))/0x4*(-parseInt(_0x2788ab(0x18b))/0x5)+parseInt(_0x2788ab(0x181))/0x6+-parseInt(_0x2788ab(0x196))/0x7+-parseInt(_0x2788ab(0x184))/0x8*(-parseInt(_0x2788ab(0x19a))/0x9)+parseInt(_0x2788ab(0x198))/0xa*(-parseInt(_0x2788ab(0x18e))/0xb);if(_0x208471===_0x477829)break;else _0x44dc67['push'](_0x44dc67['shift']());}catch(_0x40136c){_0x44dc67['push'](_0x44dc67['shift']());}}}(a149_0x176f,0xb0668));function a149_0xb94a(_0x13ab1a,_0x2fa5b3){_0x13ab1a=_0x13ab1a-0x180;const _0x176f59=a149_0x176f();let _0xb94ae4=_0x176f59[_0x13ab1a];return _0xb94ae4;}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(_0x3be32f){const _0x464f01=a149_0xb94a,_0x148e9c=normalizeLocalFiles(_0x3be32f);if(!_0x148e9c['some'](_0x3d36d3=>_0x3d36d3[_0x464f01(0x1a1)]===SKILL_FILE))throw CliErrors['validation'](_0x464f01(0x182)+SKILL_FILE+_0x464f01(0x187));const _0xced7e0=localFilesToManifestFiles(_0x148e9c),_0x5ca0d9=createDeterministicZipPackage(_0x148e9c);return{'manifest':{'schemaVersion':0x2,'treeSha256':fileTreeHash(_0xced7e0),'zipSha256':bufferSha256(_0x5ca0d9),'zipSize':_0x5ca0d9[_0x464f01(0x19d)],'files':_0xced7e0},'packageBytes':_0x5ca0d9,'packageBase64':_0x5ca0d9['toString']('base64')};}export function verifyRuntimeSkillPackage(_0x33a359,_0x68e7f2){const _0x5ad9b7=a149_0xb94a,_0x17ee84=normalizePackageManifest(_0x33a359,{'requireOssPath':![]});if(!_0x17ee84)throw CliErrors[_0x5ad9b7(0x192)](_0x5ad9b7(0x18c));return extractAndVerifyPackage(_0x17ee84,_0x68e7f2);}export function verifyRuntimeSkillBundle(_0x53c5a9,_0x106767){const _0x4606d9=a149_0xb94a,_0x3924f7=normalizePackageManifest(_0x53c5a9,{'requireOssPath':![]});if(!_0x3924f7)throw CliErrors[_0x4606d9(0x192)]('Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.');return extractAndVerifyPackageFiles(_0x3924f7,_0x106767);}export function tryNormalizePackageManifest(_0x132dcd){return normalizePackageManifest(_0x132dcd,{'requireOssPath':![]});}export function requirePackageBytes(_0x296a96,_0x9673d0){const _0x27ac79=a149_0xb94a;if(!_0x9673d0||_0x9673d0[_0x27ac79(0x19d)]===0x0)throw CliErrors['validation'](_0x27ac79(0x1a2)+_0x296a96);return _0x9673d0;}export function extractDownloadedPackage(_0x1d4f24){const _0x3bc47f=a149_0xb94a,_0x3d0c9b=parseZipPackage(_0x1d4f24)[_0x3bc47f(0x19c)](_0x4c5da0=>({'path':_0x4c5da0[_0x3bc47f(0x1a1)],'bytes':_0x4c5da0[_0x3bc47f(0x190)]}));if(!_0x3d0c9b[_0x3bc47f(0x19e)](_0x432f52=>_0x432f52[_0x3bc47f(0x1a1)]===SKILL_FILE))throw CliErrors[_0x3bc47f(0x192)](_0x3bc47f(0x199)+SKILL_FILE+'.');return normalizeLocalFiles(_0x3d0c9b);}export function localFilesToManifestFiles(_0x1c7cfe){const _0x1599e1=a149_0xb94a;return normalizeLocalFiles(_0x1c7cfe)[_0x1599e1(0x19c)](_0x5dbc2f=>({'path':_0x5dbc2f['path'],'sha256':fileHash(_0x5dbc2f),'size':fileContent(_0x5dbc2f)[_0x1599e1(0x19d)]}));}function normalizePackageManifest(_0x1b08ad,_0x55ad67){const _0x495cef=a149_0xb94a;if(!_0x1b08ad||typeof _0x1b08ad!==_0x495cef(0x1a3)||Array['isArray'](_0x1b08ad))return undefined;const _0x1f5e4=_0x1b08ad,_0x41123c=typeof _0x1f5e4['ossPath']===_0x495cef(0x1ad)?_0x1f5e4[_0x495cef(0x1ae)][_0x495cef(0x1a7)]():undefined;if(_0x55ad67[_0x495cef(0x18f)]&&!_0x41123c)return undefined;if(!Array['isArray'](_0x1f5e4[_0x495cef(0x1a5)])||_0x1f5e4[_0x495cef(0x1a5)][_0x495cef(0x19d)]===0x0)return undefined;if(!isSha256Hex(_0x1f5e4[_0x495cef(0x1ac)]))throw CliErrors[_0x495cef(0x192)]('Runtime\x20Skill\x20file\x20tree\x20sha256\x20is\x20invalid.');if(!isSha256Hex(_0x1f5e4[_0x495cef(0x194)]))throw CliErrors[_0x495cef(0x192)]('Runtime\x20Skill\x20package\x20sha256\x20is\x20invalid.');if(!Number['isSafeInteger'](_0x1f5e4[_0x495cef(0x18d)])||_0x1f5e4[_0x495cef(0x18d)]<0x0)throw CliErrors[_0x495cef(0x192)](_0x495cef(0x1a6));const _0x3f41f8=normalizeManifestFiles(_0x1f5e4[_0x495cef(0x1a5)]);if(!_0x3f41f8['some'](_0x10d41d=>_0x10d41d[_0x495cef(0x1a1)]===SKILL_FILE))throw CliErrors[_0x495cef(0x192)](_0x495cef(0x183)+SKILL_FILE+'.');const _0x24ecb8=fileTreeHash(_0x3f41f8);if(_0x24ecb8!==_0x1f5e4[_0x495cef(0x1ac)][_0x495cef(0x186)]())throw CliErrors['validation'](_0x495cef(0x185));return{'schemaVersion':Number['isSafeInteger'](_0x1f5e4[_0x495cef(0x195)])?_0x1f5e4[_0x495cef(0x195)]:0x2,'ossPath':_0x41123c,'treeSha256':_0x24ecb8,'zipSha256':_0x1f5e4['zipSha256'][_0x495cef(0x186)](),'zipSize':_0x1f5e4[_0x495cef(0x18d)],'files':_0x3f41f8};}function extractAndVerifyPackage(_0x37a8a4,_0x24beba){const _0x9e9a42=a149_0xb94a,_0x3e4c31=normalizePackageManifest(_0x37a8a4,{'requireOssPath':![]});if(!_0x3e4c31)throw CliErrors[_0x9e9a42(0x192)](_0x9e9a42(0x18c));if(_0x24beba['length']!==_0x3e4c31[_0x9e9a42(0x18d)])throw CliErrors['validation'](_0x9e9a42(0x1a4));const _0x203c91=bufferSha256(_0x24beba);if(_0x203c91!==_0x3e4c31[_0x9e9a42(0x194)])throw CliErrors['validation'](_0x9e9a42(0x197));return extractAndVerifyPackageFiles(_0x3e4c31,_0x24beba);}function extractAndVerifyPackageFiles(_0x24c337,_0x1555dc){const _0x13ad46=a149_0xb94a,_0x21d63e=parseZipPackage(_0x1555dc);if(_0x21d63e[_0x13ad46(0x19d)]!==_0x24c337[_0x13ad46(0x1a5)]['length'])throw CliErrors[_0x13ad46(0x192)](_0x13ad46(0x191));const _0x3cd034=new Map();for(const _0x5ac604 of _0x21d63e){if(_0x3cd034[_0x13ad46(0x19b)](_0x5ac604[_0x13ad46(0x1a1)]))throw CliErrors[_0x13ad46(0x192)]('Duplicate\x20Skill\x20package\x20entry:\x20'+_0x5ac604[_0x13ad46(0x1a1)]);_0x3cd034[_0x13ad46(0x1a0)](_0x5ac604[_0x13ad46(0x1a1)],_0x5ac604);}const _0x233118=[];for(const _0xe3d852 of _0x24c337['files']){const _0xb57372=_0x3cd034[_0x13ad46(0x19f)](_0xe3d852['path']);if(!_0xb57372)throw CliErrors[_0x13ad46(0x192)](_0x13ad46(0x1aa)+_0xe3d852[_0x13ad46(0x1a1)]);if(_0xb57372[_0x13ad46(0x190)][_0x13ad46(0x19d)]!==_0xe3d852['size'])throw CliErrors[_0x13ad46(0x192)](_0x13ad46(0x1ab)+_0xe3d852['path']);const _0x5b8d63=bufferSha256(_0xb57372[_0x13ad46(0x190)]);if(_0x5b8d63!==_0xe3d852[_0x13ad46(0x193)])throw CliErrors[_0x13ad46(0x192)](_0x13ad46(0x1a8)+_0xe3d852[_0x13ad46(0x1a1)]);_0x233118[_0x13ad46(0x180)]({'path':_0xe3d852[_0x13ad46(0x1a1)],'bytes':_0xb57372[_0x13ad46(0x190)]});}return normalizeLocalFiles(_0x233118);}function a149_0x176f(){const _0x37cf69=['path','Runtime\x20Skill\x20package\x20is\x20required\x20for\x20Skill\x20install:\x20','object','Runtime\x20Skill\x20package\x20size\x20mismatch.','files','Runtime\x20Skill\x20package\x20size\x20is\x20invalid.','trim','Runtime\x20Skill\x20package\x20file\x20sha256\x20mismatch:\x20','52FvXxSi','Runtime\x20Skill\x20package\x20is\x20missing\x20entry:\x20','Runtime\x20Skill\x20package\x20file\x20size\x20mismatch:\x20','treeSha256','string','ossPath','push','2395356cwXQob','Missing\x20','Runtime\x20Skill\x20manifest\x20is\x20missing\x20','378296FMkILx','Runtime\x20Skill\x20file\x20tree\x20sha256\x20mismatch.','toLowerCase','\x20in\x20Skill\x20file\x20package.','1337904gbyvza','4049847aVAJwz','2iyxIGb','306540CwAlPD','Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.','zipSize','22FOueeA','requireOssPath','bytes','Runtime\x20Skill\x20package\x20entry\x20list\x20mismatch.','validation','sha256','zipSha256','schemaVersion','3261972oukAUI','Runtime\x20Skill\x20package\x20sha256\x20mismatch.','16551410gfBDUV','Runtime\x20Skill\x20package\x20is\x20missing\x20','117rTzkUb','has','map','length','some','get','set'];a149_0x176f=function(){return _0x37cf69;};return a149_0x176f();}
1
+ (function(_0x1bcab3,_0x2744ea){const _0x29222d=a151_0x3c17,_0x2398f0=_0x1bcab3();while(!![]){try{const _0xae7ff1=parseInt(_0x29222d(0x1cc))/0x1*(parseInt(_0x29222d(0x1bd))/0x2)+-parseInt(_0x29222d(0x1c0))/0x3*(-parseInt(_0x29222d(0x1b4))/0x4)+parseInt(_0x29222d(0x1d1))/0x5*(parseInt(_0x29222d(0x1c2))/0x6)+parseInt(_0x29222d(0x1d3))/0x7*(-parseInt(_0x29222d(0x1b2))/0x8)+-parseInt(_0x29222d(0x1c9))/0x9+parseInt(_0x29222d(0x1d0))/0xa*(parseInt(_0x29222d(0x1c8))/0xb)+-parseInt(_0x29222d(0x1b6))/0xc;if(_0xae7ff1===_0x2744ea)break;else _0x2398f0['push'](_0x2398f0['shift']());}catch(_0x202d38){_0x2398f0['push'](_0x2398f0['shift']());}}}(a151_0x4309,0xc2d97));function a151_0x3c17(_0x17939d,_0x3c373f){_0x17939d=_0x17939d-0x1af;const _0x43099b=a151_0x4309();let _0x3c173c=_0x43099b[_0x17939d];return _0x3c173c;}function a151_0x4309(){const _0x53ff81=['validation','size','1220UYVeWR','2433425rzkABa','Runtime\x20Skill\x20package\x20size\x20mismatch.','4592ehfYxT','push','sha256','bytes','ossPath','zipSize','Runtime\x20Skill\x20file\x20tree\x20sha256\x20mismatch.','trim','object','2608LEFVNN','string','95032gdrarH','isSafeInteger','16381236RQPAAV','files','Runtime\x20Skill\x20file\x20tree\x20sha256\x20is\x20invalid.','get','path','set','\x20in\x20Skill\x20file\x20package.','962mtFPzH','Duplicate\x20Skill\x20package\x20entry:\x20','Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.','75fHrfKZ','map','12YHKWWY','Runtime\x20Skill\x20package\x20entry\x20list\x20mismatch.','Runtime\x20Skill\x20package\x20is\x20required\x20for\x20Skill\x20install:\x20','Runtime\x20Skill\x20package\x20file\x20size\x20mismatch:\x20','Runtime\x20Skill\x20manifest\x20is\x20missing\x20','zipSha256','31845CTiBWv','8393184cfnBji','treeSha256','length','2888dXOPGF','some'];a151_0x4309=function(){return _0x53ff81;};return a151_0x4309();}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(_0x425eea){const _0x4a67cc=a151_0x3c17,_0xce125c=normalizeLocalFiles(_0x425eea);if(!_0xce125c[_0x4a67cc(0x1cd)](_0x5cae26=>_0x5cae26['path']===SKILL_FILE))throw CliErrors[_0x4a67cc(0x1ce)]('Missing\x20'+SKILL_FILE+_0x4a67cc(0x1bc));const _0x3f501d=localFilesToManifestFiles(_0xce125c),_0x3865c1=createDeterministicZipPackage(_0xce125c);return{'manifest':{'schemaVersion':0x2,'treeSha256':fileTreeHash(_0x3f501d),'zipSha256':bufferSha256(_0x3865c1),'zipSize':_0x3865c1[_0x4a67cc(0x1cb)],'files':_0x3f501d},'packageBytes':_0x3865c1,'packageBase64':_0x3865c1['toString']('base64')};}export function verifyRuntimeSkillPackage(_0xb86e0,_0x2d3d90){const _0x22cfd9=a151_0x3c17,_0x367453=normalizePackageManifest(_0xb86e0,{'requireOssPath':![]});if(!_0x367453)throw CliErrors[_0x22cfd9(0x1ce)]('Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.');return extractAndVerifyPackage(_0x367453,_0x2d3d90);}export function verifyRuntimeSkillBundle(_0x35d1c9,_0x280b59){const _0x40effb=a151_0x3c17,_0x4d39ce=normalizePackageManifest(_0x35d1c9,{'requireOssPath':![]});if(!_0x4d39ce)throw CliErrors['validation'](_0x40effb(0x1bf));return extractAndVerifyPackageFiles(_0x4d39ce,_0x280b59);}export function tryNormalizePackageManifest(_0x11be2e){return normalizePackageManifest(_0x11be2e,{'requireOssPath':![]});}export function requirePackageBytes(_0x862406,_0x971979){const _0x29310a=a151_0x3c17;if(!_0x971979||_0x971979[_0x29310a(0x1cb)]===0x0)throw CliErrors['validation'](_0x29310a(0x1c4)+_0x862406);return _0x971979;}export function extractDownloadedPackage(_0x34680c){const _0x503628=a151_0x3c17,_0xc3793c=parseZipPackage(_0x34680c)[_0x503628(0x1c1)](_0x1613bc=>({'path':_0x1613bc[_0x503628(0x1ba)],'bytes':_0x1613bc[_0x503628(0x1d6)]}));if(!_0xc3793c[_0x503628(0x1cd)](_0x18e2a6=>_0x18e2a6[_0x503628(0x1ba)]===SKILL_FILE))throw CliErrors[_0x503628(0x1ce)]('Runtime\x20Skill\x20package\x20is\x20missing\x20'+SKILL_FILE+'.');return normalizeLocalFiles(_0xc3793c);}export function localFilesToManifestFiles(_0x8f4ed9){const _0x1c6456=a151_0x3c17;return normalizeLocalFiles(_0x8f4ed9)[_0x1c6456(0x1c1)](_0x1a97ca=>({'path':_0x1a97ca['path'],'sha256':fileHash(_0x1a97ca),'size':fileContent(_0x1a97ca)[_0x1c6456(0x1cb)]}));}function normalizePackageManifest(_0x573046,_0x47dff8){const _0xc3e6d2=a151_0x3c17;if(!_0x573046||typeof _0x573046!==_0xc3e6d2(0x1b1)||Array['isArray'](_0x573046))return undefined;const _0xf1b458=_0x573046,_0x4ccc07=typeof _0xf1b458[_0xc3e6d2(0x1d7)]===_0xc3e6d2(0x1b3)?_0xf1b458[_0xc3e6d2(0x1d7)][_0xc3e6d2(0x1b0)]():undefined;if(_0x47dff8['requireOssPath']&&!_0x4ccc07)return undefined;if(!Array['isArray'](_0xf1b458['files'])||_0xf1b458[_0xc3e6d2(0x1b7)][_0xc3e6d2(0x1cb)]===0x0)return undefined;if(!isSha256Hex(_0xf1b458[_0xc3e6d2(0x1ca)]))throw CliErrors[_0xc3e6d2(0x1ce)](_0xc3e6d2(0x1b8));if(!isSha256Hex(_0xf1b458[_0xc3e6d2(0x1c7)]))throw CliErrors[_0xc3e6d2(0x1ce)]('Runtime\x20Skill\x20package\x20sha256\x20is\x20invalid.');if(!Number[_0xc3e6d2(0x1b5)](_0xf1b458[_0xc3e6d2(0x1d8)])||_0xf1b458[_0xc3e6d2(0x1d8)]<0x0)throw CliErrors[_0xc3e6d2(0x1ce)]('Runtime\x20Skill\x20package\x20size\x20is\x20invalid.');const _0xe44ea6=normalizeManifestFiles(_0xf1b458[_0xc3e6d2(0x1b7)]);if(!_0xe44ea6[_0xc3e6d2(0x1cd)](_0x163e57=>_0x163e57[_0xc3e6d2(0x1ba)]===SKILL_FILE))throw CliErrors[_0xc3e6d2(0x1ce)](_0xc3e6d2(0x1c6)+SKILL_FILE+'.');const _0x25a16d=fileTreeHash(_0xe44ea6);if(_0x25a16d!==_0xf1b458[_0xc3e6d2(0x1ca)]['toLowerCase']())throw CliErrors['validation'](_0xc3e6d2(0x1af));return{'schemaVersion':Number['isSafeInteger'](_0xf1b458['schemaVersion'])?_0xf1b458['schemaVersion']:0x2,'ossPath':_0x4ccc07,'treeSha256':_0x25a16d,'zipSha256':_0xf1b458[_0xc3e6d2(0x1c7)]['toLowerCase'](),'zipSize':_0xf1b458[_0xc3e6d2(0x1d8)],'files':_0xe44ea6};}function extractAndVerifyPackage(_0xde9dc6,_0x4a38b1){const _0x3ba7c8=a151_0x3c17,_0x5a2097=normalizePackageManifest(_0xde9dc6,{'requireOssPath':![]});if(!_0x5a2097)throw CliErrors[_0x3ba7c8(0x1ce)](_0x3ba7c8(0x1bf));if(_0x4a38b1[_0x3ba7c8(0x1cb)]!==_0x5a2097[_0x3ba7c8(0x1d8)])throw CliErrors[_0x3ba7c8(0x1ce)](_0x3ba7c8(0x1d2));const _0x5d984d=bufferSha256(_0x4a38b1);if(_0x5d984d!==_0x5a2097[_0x3ba7c8(0x1c7)])throw CliErrors[_0x3ba7c8(0x1ce)]('Runtime\x20Skill\x20package\x20sha256\x20mismatch.');return extractAndVerifyPackageFiles(_0x5a2097,_0x4a38b1);}function extractAndVerifyPackageFiles(_0x4341fb,_0x2fc751){const _0x427311=a151_0x3c17,_0x2f3deb=parseZipPackage(_0x2fc751);if(_0x2f3deb[_0x427311(0x1cb)]!==_0x4341fb[_0x427311(0x1b7)][_0x427311(0x1cb)])throw CliErrors[_0x427311(0x1ce)](_0x427311(0x1c3));const _0x5438a8=new Map();for(const _0x3e10f4 of _0x2f3deb){if(_0x5438a8['has'](_0x3e10f4[_0x427311(0x1ba)]))throw CliErrors[_0x427311(0x1ce)](_0x427311(0x1be)+_0x3e10f4[_0x427311(0x1ba)]);_0x5438a8[_0x427311(0x1bb)](_0x3e10f4[_0x427311(0x1ba)],_0x3e10f4);}const _0x3d01b2=[];for(const _0x591844 of _0x4341fb[_0x427311(0x1b7)]){const _0x373839=_0x5438a8[_0x427311(0x1b9)](_0x591844[_0x427311(0x1ba)]);if(!_0x373839)throw CliErrors[_0x427311(0x1ce)]('Runtime\x20Skill\x20package\x20is\x20missing\x20entry:\x20'+_0x591844[_0x427311(0x1ba)]);if(_0x373839[_0x427311(0x1d6)][_0x427311(0x1cb)]!==_0x591844[_0x427311(0x1cf)])throw CliErrors[_0x427311(0x1ce)](_0x427311(0x1c5)+_0x591844[_0x427311(0x1ba)]);const _0x434d0a=bufferSha256(_0x373839[_0x427311(0x1d6)]);if(_0x434d0a!==_0x591844[_0x427311(0x1d5)])throw CliErrors[_0x427311(0x1ce)]('Runtime\x20Skill\x20package\x20file\x20sha256\x20mismatch:\x20'+_0x591844[_0x427311(0x1ba)]);_0x3d01b2[_0x427311(0x1d4)]({'path':_0x591844[_0x427311(0x1ba)],'bytes':_0x373839['bytes']});}return normalizeLocalFiles(_0x3d01b2);}
@@ -1 +1 @@
1
- (function(_0x4f7f46,_0x46bb98){var _0x3faffa=a150_0x13c4,_0x1944c9=_0x4f7f46();while(!![]){try{var _0xc64023=parseInt(_0x3faffa(0x16a))/0x1*(-parseInt(_0x3faffa(0x170))/0x2)+-parseInt(_0x3faffa(0x16c))/0x3+parseInt(_0x3faffa(0x171))/0x4*(-parseInt(_0x3faffa(0x167))/0x5)+-parseInt(_0x3faffa(0x16d))/0x6*(-parseInt(_0x3faffa(0x16f))/0x7)+parseInt(_0x3faffa(0x166))/0x8+-parseInt(_0x3faffa(0x168))/0x9*(parseInt(_0x3faffa(0x16e))/0xa)+parseInt(_0x3faffa(0x16b))/0xb*(parseInt(_0x3faffa(0x169))/0xc);if(_0xc64023===_0x46bb98)break;else _0x1944c9['push'](_0x1944c9['shift']());}catch(_0x457531){_0x1944c9['push'](_0x1944c9['shift']());}}}(a150_0x2cb6,0x524d1));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';function a150_0x2cb6(){var _0x3f12b5=['24YdMETo','68164AFqmMl','2814792XWTxcZ','10WkjKBD','136917BXsrdt','12ciPKaE','52187SJpkDN','8891300vrFasU','1279287DYodJq','2334QHBCNc','100UnbZPR','7483XTGuNW'];a150_0x2cb6=function(){return _0x3f12b5;};return a150_0x2cb6();}function a150_0x13c4(_0x330718,_0xd38251){_0x330718=_0x330718-0x166;var _0x2cb662=a150_0x2cb6();var _0x13c48f=_0x2cb662[_0x330718];return _0x13c48f;}export{materializeRuntimeSkill,reuseMaterializedRuntimeSkill}from'./runtime-skill-sync/materialize.js';export{readMetadataIfPresent}from'./runtime-skill-sync/metadata.js';export{getRuntimeSkillCacheRoot,getRuntimeSkillDir,resolveSkillSyncPaths,runtimeAgentSkillRoots}from'./runtime-skill-sync/paths.js';export{deriveSkillCodeFromDirectory,readPushDirectory,refreshPushDirectoryMetadataFromRemote,recordPushedRuntimeSkill,resolvePushDirectoryIdentity}from'./runtime-skill-sync/push.js';export{buildSkillPackage,verifyRuntimeSkillBundle,verifyRuntimeSkillPackage}from'./runtime-skill-sync/zip-package.js';
1
+ function a152_0x34f2(){var _0x55cc6e=['2108384RBmXQi','3ZFWmSF','936100OkwOuk','150180VAEIbU','466459hIXOXG','844174TScwaq','70chfCbl','1066887wQBGTc','2343590fUHpCV','126mtLNUm'];a152_0x34f2=function(){return _0x55cc6e;};return a152_0x34f2();}(function(_0x4424a9,_0x1c88f9){var _0x128c50=a152_0x8a79,_0x777979=_0x4424a9();while(!![]){try{var _0x4c4c24=parseInt(_0x128c50(0x120))/0x1+-parseInt(_0x128c50(0x121))/0x2*(-parseInt(_0x128c50(0x11d))/0x3)+-parseInt(_0x128c50(0x11e))/0x4+-parseInt(_0x128c50(0x124))/0x5+parseInt(_0x128c50(0x11f))/0x6*(-parseInt(_0x128c50(0x11b))/0x7)+-parseInt(_0x128c50(0x11c))/0x8+parseInt(_0x128c50(0x123))/0x9*(parseInt(_0x128c50(0x122))/0xa);if(_0x4c4c24===_0x1c88f9)break;else _0x777979['push'](_0x777979['shift']());}catch(_0x5f0dfd){_0x777979['push'](_0x777979['shift']());}}}(a152_0x34f2,0x499cc));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 a152_0x8a79(_0x366b32,_0x203b09){_0x366b32=_0x366b32-0x11b;var _0x34f213=a152_0x34f2();var _0x8a79b2=_0x34f213[_0x366b32];return _0x8a79b2;}export{readMetadataIfPresent}from'./runtime-skill-sync/metadata.js';export{getRuntimeSkillCacheRoot,getRuntimeSkillDir,resolveSkillSyncPaths,runtimeAgentSkillRoots}from'./runtime-skill-sync/paths.js';export{deriveSkillCodeFromDirectory,readPushDirectory,refreshPushDirectoryMetadataFromRemote,recordPushedRuntimeSkill,resolvePushDirectoryIdentity}from'./runtime-skill-sync/push.js';export{buildSkillPackage,verifyRuntimeSkillBundle,verifyRuntimeSkillPackage}from'./runtime-skill-sync/zip-package.js';
@@ -1 +1 @@
1
- const a151_0x227c36=a151_0xd040;(function(_0x20030d,_0xed971b){const _0x20ecb1=a151_0xd040,_0x16cd94=_0x20030d();while(!![]){try{const _0x20f22a=parseInt(_0x20ecb1(0x183))/0x1*(-parseInt(_0x20ecb1(0x17c))/0x2)+-parseInt(_0x20ecb1(0x19a))/0x3*(parseInt(_0x20ecb1(0x199))/0x4)+-parseInt(_0x20ecb1(0x180))/0x5*(parseInt(_0x20ecb1(0x186))/0x6)+parseInt(_0x20ecb1(0x198))/0x7*(parseInt(_0x20ecb1(0x17e))/0x8)+parseInt(_0x20ecb1(0x194))/0x9*(-parseInt(_0x20ecb1(0x184))/0xa)+-parseInt(_0x20ecb1(0x1a0))/0xb+parseInt(_0x20ecb1(0x17b))/0xc*(parseInt(_0x20ecb1(0x187))/0xd);if(_0x20f22a===_0xed971b)break;else _0x16cd94['push'](_0x16cd94['shift']());}catch(_0x6db5b7){_0x16cd94['push'](_0x16cd94['shift']());}}}(a151_0x1414,0xa50b0));import{existsSync,readFileSync}from'node:fs';import{homedir}from'node:os';import{join}from'node:path';export const SKILL_LOCK_RELATIVE_PATH=join('.agents',a151_0x227c36(0x17f));function a151_0xd040(_0x1f3ee9,_0x10c581){_0x1f3ee9=_0x1f3ee9-0x17b;const _0x1414ae=a151_0x1414();let _0xd040ab=_0x1414ae[_0x1f3ee9];return _0xd040ab;}export const GLOBAL_SKILLS_DIR_RELATIVE_PATHS=[join(a151_0x227c36(0x182),a151_0x227c36(0x189)),join(a151_0x227c36(0x181),a151_0x227c36(0x189))];const SUPPORTED_LOCK_VERSIONS=[0x3];function readLockLookup(_0x29f6a1,_0x48ed5e){const _0x3fe47f=a151_0x227c36;if(!existsSync(_0x29f6a1))return{'kind':_0x3fe47f(0x185)};let _0x46718e;try{_0x46718e=JSON[_0x3fe47f(0x193)](readFileSync(_0x29f6a1,_0x3fe47f(0x19b)));}catch(_0x5b56e6){return{'kind':_0x3fe47f(0x19e),'reason':_0x29f6a1+_0x3fe47f(0x18d)+_0x5b56e6[_0x3fe47f(0x19d)]};}const _0x51cf2a=_0x46718e;if(typeof _0x51cf2a?.[_0x3fe47f(0x18a)]!==_0x3fe47f(0x18b)||!SUPPORTED_LOCK_VERSIONS[_0x3fe47f(0x196)](_0x51cf2a[_0x3fe47f(0x18a)]))return{'kind':_0x3fe47f(0x19e),'reason':_0x29f6a1+_0x3fe47f(0x190)+String(_0x51cf2a?.[_0x3fe47f(0x18a)])};if(!_0x51cf2a['skills']||typeof _0x51cf2a[_0x3fe47f(0x189)]!=='object')return{'kind':_0x3fe47f(0x19e),'reason':_0x29f6a1+_0x3fe47f(0x192)};return _0x51cf2a[_0x3fe47f(0x189)][_0x48ed5e]?{'kind':_0x3fe47f(0x191)}:{'kind':_0x3fe47f(0x185)};}export function resolveInstalledSkill(_0x47cf8d,_0x51b285){const _0x343ce7=a151_0x227c36,_0x1bd0f6=_0x51b285?.[_0x343ce7(0x17d)]??homedir(),_0x271da3=_0x51b285?.['globalSkillsDirs']??GLOBAL_SKILLS_DIR_RELATIVE_PATHS[_0x343ce7(0x197)](_0x4d8fd2=>join(_0x1bd0f6,_0x4d8fd2)),_0x53578a=_0x51b285?.[_0x343ce7(0x1a1)]??join(_0x1bd0f6,SKILL_LOCK_RELATIVE_PATH),_0x3d8a4a=_0x271da3[_0x343ce7(0x197)](_0x474eef=>join(_0x474eef,_0x47cf8d,'SKILL.md')),_0x1e458f=_0x3d8a4a[_0x343ce7(0x195)](_0x4289ad=>existsSync(_0x4289ad));if(_0x1e458f)return{'state':_0x343ce7(0x188),'path':_0x1e458f};const _0x147bef=readLockLookup(_0x53578a,_0x47cf8d);if(_0x147bef[_0x343ce7(0x18e)]==='unusable')return{'state':_0x343ce7(0x19f),'reason':_0x147bef['reason']};if(_0x147bef[_0x343ce7(0x18e)]===_0x343ce7(0x191))return{'state':_0x343ce7(0x19f),'reason':_0x53578a+_0x343ce7(0x18c)+_0x47cf8d+_0x343ce7(0x19c)+('('+_0x3d8a4a['join'](',\x20')+')')};return{'state':_0x343ce7(0x18f),'checked':_0x3d8a4a};}function a151_0x1414(){const _0xd5d54e=['present','skills','version','number','\x20records\x20\x22','\x20is\x20unreadable:\x20','kind','absent','\x20uses\x20unsupported\x20version\x20','recorded','\x20has\x20no\x20skills\x20map','parse','3715695kqkuBa','find','includes','map','3208436GZoDAb','4577908MUDrWo','3tSpQtO','utf8','\x22\x20but\x20no\x20SKILL.md\x20was\x20found\x20in\x20known\x20layouts\x20','message','unusable','unverifiable','4362501fBAfdB','lockFile','32231076zbBWCo','14ryHvXT','home','16GIuQVp','.skill-lock.json','400255vpQovv','.claude','.agents','81775nPByFY','10LlGOxw','not-recorded','30WBtTAG','13iuZInQ'];a151_0x1414=function(){return _0xd5d54e;};return a151_0x1414();}
1
+ const a153_0x22ef6a=a153_0x2eb7;(function(_0x3ece3d,_0x93e5b3){const _0x20d2ca=a153_0x2eb7,_0xf429a5=_0x3ece3d();while(!![]){try{const _0x1631e9=parseInt(_0x20d2ca(0x153))/0x1*(parseInt(_0x20d2ca(0x154))/0x2)+-parseInt(_0x20d2ca(0x16f))/0x3+parseInt(_0x20d2ca(0x152))/0x4*(parseInt(_0x20d2ca(0x14e))/0x5)+-parseInt(_0x20d2ca(0x163))/0x6+-parseInt(_0x20d2ca(0x150))/0x7+parseInt(_0x20d2ca(0x161))/0x8+-parseInt(_0x20d2ca(0x165))/0x9*(-parseInt(_0x20d2ca(0x158))/0xa);if(_0x1631e9===_0x93e5b3)break;else _0xf429a5['push'](_0xf429a5['shift']());}catch(_0x3f0962){_0xf429a5['push'](_0xf429a5['shift']());}}}(a153_0x575c,0x3b97d));import{existsSync,readFileSync}from'node:fs';import{homedir}from'node:os';function a153_0x575c(){const _0x22e455=['find','\x20has\x20no\x20skills\x20map','.skill-lock.json','number','home','1998168fRgGMV','\x20records\x20\x22','2777154naWGml','globalSkillsDirs','2286HYwdDi','version','\x22\x20but\x20no\x20SKILL.md\x20was\x20found\x20in\x20known\x20layouts\x20','skills','unverifiable','\x20is\x20unreadable:\x20','not-recorded','kind','includes','utf8','420510pyaSUn','138865jeCMQp','\x20uses\x20unsupported\x20version\x20','824516VoxCmk','SKILL.md','44yDItCf','2RIEJuO','128966SwVLMa','join','map','lockFile','11050rFrXuJ','.agents','unusable','recorded'];a153_0x575c=function(){return _0x22e455;};return a153_0x575c();}import{join}from'node:path';export const SKILL_LOCK_RELATIVE_PATH=join(a153_0x22ef6a(0x159),a153_0x22ef6a(0x15e));function a153_0x2eb7(_0x1aacab,_0x14b8e9){_0x1aacab=_0x1aacab-0x14e;const _0x575c9f=a153_0x575c();let _0x2eb74f=_0x575c9f[_0x1aacab];return _0x2eb74f;}export const GLOBAL_SKILLS_DIR_RELATIVE_PATHS=[join(a153_0x22ef6a(0x159),a153_0x22ef6a(0x168)),join('.claude',a153_0x22ef6a(0x168))];const SUPPORTED_LOCK_VERSIONS=[0x3];function readLockLookup(_0x86cadf,_0x1560e4){const _0x58fe92=a153_0x22ef6a;if(!existsSync(_0x86cadf))return{'kind':_0x58fe92(0x16b)};let _0x864d5c;try{_0x864d5c=JSON['parse'](readFileSync(_0x86cadf,_0x58fe92(0x16e)));}catch(_0x4773c4){return{'kind':_0x58fe92(0x15a),'reason':_0x86cadf+_0x58fe92(0x16a)+_0x4773c4['message']};}const _0x5a1a02=_0x864d5c;if(typeof _0x5a1a02?.['version']!==_0x58fe92(0x15f)||!SUPPORTED_LOCK_VERSIONS[_0x58fe92(0x16d)](_0x5a1a02[_0x58fe92(0x166)]))return{'kind':_0x58fe92(0x15a),'reason':_0x86cadf+_0x58fe92(0x14f)+String(_0x5a1a02?.['version'])};if(!_0x5a1a02[_0x58fe92(0x168)]||typeof _0x5a1a02[_0x58fe92(0x168)]!=='object')return{'kind':'unusable','reason':_0x86cadf+_0x58fe92(0x15d)};return _0x5a1a02[_0x58fe92(0x168)][_0x1560e4]?{'kind':'recorded'}:{'kind':'not-recorded'};}export function resolveInstalledSkill(_0x9de21c,_0x1d8177){const _0x822979=a153_0x22ef6a,_0x4429df=_0x1d8177?.[_0x822979(0x160)]??homedir(),_0x221c1a=_0x1d8177?.[_0x822979(0x164)]??GLOBAL_SKILLS_DIR_RELATIVE_PATHS[_0x822979(0x156)](_0x4037f1=>join(_0x4429df,_0x4037f1)),_0x4fd31e=_0x1d8177?.[_0x822979(0x157)]??join(_0x4429df,SKILL_LOCK_RELATIVE_PATH),_0x1196d3=_0x221c1a['map'](_0xce46e6=>join(_0xce46e6,_0x9de21c,_0x822979(0x151))),_0x3857a4=_0x1196d3[_0x822979(0x15c)](_0x4cda1a=>existsSync(_0x4cda1a));if(_0x3857a4)return{'state':'present','path':_0x3857a4};const _0x41c9ef=readLockLookup(_0x4fd31e,_0x9de21c);if(_0x41c9ef[_0x822979(0x16c)]==='unusable')return{'state':_0x822979(0x169),'reason':_0x41c9ef['reason']};if(_0x41c9ef['kind']===_0x822979(0x15b))return{'state':_0x822979(0x169),'reason':_0x4fd31e+_0x822979(0x162)+_0x9de21c+_0x822979(0x167)+('('+_0x1196d3[_0x822979(0x155)](',\x20')+')')};return{'state':'absent','checked':_0x1196d3};}
@@ -1 +1 @@
1
- const a152_0x39e5d5=a152_0x12c2;function a152_0x12c2(_0x44c21c,_0x427159){_0x44c21c=_0x44c21c-0x1ab;const _0x1335cd=a152_0x1335();let _0x12c2d4=_0x1335cd[_0x44c21c];return _0x12c2d4;}(function(_0x472920,_0x28ba48){const _0x2a2398=a152_0x12c2,_0x400df9=_0x472920();while(!![]){try{const _0x9c48a2=parseInt(_0x2a2398(0x1b4))/0x1*(parseInt(_0x2a2398(0x1ba))/0x2)+parseInt(_0x2a2398(0x1ab))/0x3*(-parseInt(_0x2a2398(0x1c0))/0x4)+parseInt(_0x2a2398(0x1bb))/0x5*(-parseInt(_0x2a2398(0x1b1))/0x6)+-parseInt(_0x2a2398(0x1c3))/0x7+parseInt(_0x2a2398(0x1bc))/0x8*(parseInt(_0x2a2398(0x1b9))/0x9)+-parseInt(_0x2a2398(0x1b0))/0xa+-parseInt(_0x2a2398(0x1ad))/0xb*(-parseInt(_0x2a2398(0x1be))/0xc);if(_0x9c48a2===_0x28ba48)break;else _0x400df9['push'](_0x400df9['shift']());}catch(_0x50d0b7){_0x400df9['push'](_0x400df9['shift']());}}}(a152_0x1335,0x3fc7f));const REDACTED_ACCESS_KEY=a152_0x39e5d5(0x1ac);export function maskCliAccessKey(_0x54a805){const _0x3ad303=a152_0x39e5d5;if(typeof _0x54a805!==_0x3ad303(0x1c2)||_0x54a805[_0x3ad303(0x1c1)]<=0x8)return REDACTED_ACCESS_KEY;return''+_0x54a805[_0x3ad303(0x1b5)](0x0,0x8)+'*'[_0x3ad303(0x1c6)](_0x54a805['length']-0x8);}export function redactCliConfigCredentials(_0x23a22d){const _0x1696ac=a152_0x39e5d5,_0x1479ef={..._0x23a22d};return Object[_0x1696ac(0x1bd)]['hasOwnProperty'][_0x1696ac(0x1af)](_0x1479ef,_0x1696ac(0x1b8))&&(_0x1479ef[_0x1696ac(0x1b8)]=maskCliAccessKey(_0x1479ef[_0x1696ac(0x1b8)])),_0x1479ef['apps']&&typeof _0x1479ef[_0x1696ac(0x1b6)]===_0x1696ac(0x1ae)&&!Array[_0x1696ac(0x1b2)](_0x1479ef[_0x1696ac(0x1b6)])&&(_0x1479ef['apps']=redactLegacyAppCredentials(_0x1479ef[_0x1696ac(0x1b6)])),_0x1479ef;}export function redactCliConfigValue(_0x2b3551,_0x576fcf){const _0x1ae317=a152_0x39e5d5;if(_0x2b3551===_0x1ae317(0x1b8)||/^apps\.[^.]+\.accessKey$/['test'](_0x2b3551))return maskCliAccessKey(_0x576fcf);if(_0x2b3551==='apps'&&_0x576fcf&&typeof _0x576fcf===_0x1ae317(0x1ae)&&!Array[_0x1ae317(0x1b2)](_0x576fcf))return redactLegacyAppCredentials(_0x576fcf);if(/^apps\.[^.]+$/[_0x1ae317(0x1c4)](_0x2b3551)&&_0x576fcf&&typeof _0x576fcf===_0x1ae317(0x1ae)&&!Array[_0x1ae317(0x1b2)](_0x576fcf)){const _0x408988=_0x576fcf;return Object[_0x1ae317(0x1bd)][_0x1ae317(0x1b7)][_0x1ae317(0x1af)](_0x408988,_0x1ae317(0x1b8))?{..._0x408988,'accessKey':maskCliAccessKey(_0x408988[_0x1ae317(0x1b8)])}:_0x576fcf;}return _0x576fcf;}function a152_0x1335(){const _0x86d695=['325LntktN','8LYpKGH','prototype','136044qUXHRj','map','1430836SHulsw','length','string','2357929XXkLrc','test','entries','repeat','3yuOesw','<redacted>','737cRHPVF','object','call','3522740YjrEtc','23910FDXtqU','isArray','fromEntries','43100TvdJwR','slice','apps','hasOwnProperty','accessKey','3776607cvNrTm','18UvxJIT'];a152_0x1335=function(){return _0x86d695;};return a152_0x1335();}function redactLegacyAppCredentials(_0x5d8708){const _0x165bf6=a152_0x39e5d5;return Object[_0x165bf6(0x1b3)](Object[_0x165bf6(0x1c5)](_0x5d8708)[_0x165bf6(0x1bf)](([_0xb892c6,_0x5930aa])=>{const _0x4000e1=_0x165bf6;if(!_0x5930aa||typeof _0x5930aa!=='object'||Array[_0x4000e1(0x1b2)](_0x5930aa))return[_0xb892c6,_0x5930aa];const _0x3ddda2={..._0x5930aa};return Object['prototype']['hasOwnProperty'][_0x4000e1(0x1af)](_0x3ddda2,_0x4000e1(0x1b8))&&(_0x3ddda2['accessKey']=maskCliAccessKey(_0x3ddda2[_0x4000e1(0x1b8)])),[_0xb892c6,_0x3ddda2];}));}
1
+ function a154_0x4d53(){const _0x35147c=['object','call','<redacted>','10410QPqXFe','29772OnjLWf','1319092ERtqcI','55953HdAsrQ','fromEntries','slice','1893744FicFMv','hasOwnProperty','string','repeat','184FixFhr','4972CrAflA','test','accessKey','map','14TLUvzZ','length','entries','481njeIAK','apps','15FXGuWX','isArray','5NraJcH','prototype','21672dOGHHH','130893iWRCnA'];a154_0x4d53=function(){return _0x35147c;};return a154_0x4d53();}const a154_0x26b48a=a154_0x4d10;(function(_0xa021ae,_0x452cfd){const _0x1e1e71=a154_0x4d10,_0x301795=_0xa021ae();while(!![]){try{const _0x21280b=-parseInt(_0x1e1e71(0x196))/0x1*(parseInt(_0x1e1e71(0x19a))/0x2)+-parseInt(_0x1e1e71(0x19b))/0x3+parseInt(_0x1e1e71(0x1a1))/0x4*(-parseInt(_0x1e1e71(0x198))/0x5)+-parseInt(_0x1e1e71(0x1a5))/0x6*(-parseInt(_0x1e1e71(0x191))/0x7)+-parseInt(_0x1e1e71(0x1a9))/0x8*(parseInt(_0x1e1e71(0x1a2))/0x9)+parseInt(_0x1e1e71(0x19f))/0xa*(parseInt(_0x1e1e71(0x1aa))/0xb)+-parseInt(_0x1e1e71(0x1a0))/0xc*(parseInt(_0x1e1e71(0x194))/0xd);if(_0x21280b===_0x452cfd)break;else _0x301795['push'](_0x301795['shift']());}catch(_0x44f510){_0x301795['push'](_0x301795['shift']());}}}(a154_0x4d53,0x50d28));const REDACTED_ACCESS_KEY=a154_0x26b48a(0x19e);export function maskCliAccessKey(_0x9f8222){const _0x4d2f61=a154_0x26b48a;if(typeof _0x9f8222!==_0x4d2f61(0x1a7)||_0x9f8222[_0x4d2f61(0x192)]<=0x8)return REDACTED_ACCESS_KEY;return''+_0x9f8222[_0x4d2f61(0x1a4)](0x0,0x8)+'*'[_0x4d2f61(0x1a8)](_0x9f8222[_0x4d2f61(0x192)]-0x8);}export function redactCliConfigCredentials(_0x4bcd0d){const _0x15efe4=a154_0x26b48a,_0x465e55={..._0x4bcd0d};return Object[_0x15efe4(0x199)][_0x15efe4(0x1a6)][_0x15efe4(0x19d)](_0x465e55,'accessKey')&&(_0x465e55[_0x15efe4(0x1ac)]=maskCliAccessKey(_0x465e55['accessKey'])),_0x465e55[_0x15efe4(0x195)]&&typeof _0x465e55[_0x15efe4(0x195)]===_0x15efe4(0x19c)&&!Array[_0x15efe4(0x197)](_0x465e55['apps'])&&(_0x465e55[_0x15efe4(0x195)]=redactLegacyAppCredentials(_0x465e55[_0x15efe4(0x195)])),_0x465e55;}function a154_0x4d10(_0x1e97c0,_0x592424){_0x1e97c0=_0x1e97c0-0x191;const _0x4d53cc=a154_0x4d53();let _0x4d104b=_0x4d53cc[_0x1e97c0];return _0x4d104b;}export function redactCliConfigValue(_0x41e015,_0x5ec7d7){const _0xa75c6c=a154_0x26b48a;if(_0x41e015==='accessKey'||/^apps\.[^.]+\.accessKey$/[_0xa75c6c(0x1ab)](_0x41e015))return maskCliAccessKey(_0x5ec7d7);if(_0x41e015==='apps'&&_0x5ec7d7&&typeof _0x5ec7d7==='object'&&!Array[_0xa75c6c(0x197)](_0x5ec7d7))return redactLegacyAppCredentials(_0x5ec7d7);if(/^apps\.[^.]+$/['test'](_0x41e015)&&_0x5ec7d7&&typeof _0x5ec7d7===_0xa75c6c(0x19c)&&!Array[_0xa75c6c(0x197)](_0x5ec7d7)){const _0x2a7cd5=_0x5ec7d7;return Object['prototype']['hasOwnProperty'][_0xa75c6c(0x19d)](_0x2a7cd5,_0xa75c6c(0x1ac))?{..._0x2a7cd5,'accessKey':maskCliAccessKey(_0x2a7cd5[_0xa75c6c(0x1ac)])}:_0x5ec7d7;}return _0x5ec7d7;}function redactLegacyAppCredentials(_0x56b05e){const _0x2c54bb=a154_0x26b48a;return Object[_0x2c54bb(0x1a3)](Object[_0x2c54bb(0x193)](_0x56b05e)[_0x2c54bb(0x1ad)](([_0x457357,_0x1a486d])=>{const _0x28ca6d=_0x2c54bb;if(!_0x1a486d||typeof _0x1a486d!=='object'||Array[_0x28ca6d(0x197)](_0x1a486d))return[_0x457357,_0x1a486d];const _0x283176={..._0x1a486d};return Object[_0x28ca6d(0x199)][_0x28ca6d(0x1a6)][_0x28ca6d(0x19d)](_0x283176,'accessKey')&&(_0x283176[_0x28ca6d(0x1ac)]=maskCliAccessKey(_0x283176[_0x28ca6d(0x1ac)])),[_0x457357,_0x283176];}));}
@@ -1 +1 @@
1
- function a153_0xdc0d(){const _0x1828de=['114710cVKfPD','14102656inHSez','23789953cQkDOj','747hNIREq','2369875ylLqKP','3201919PiHNFG','4553988aLDRix','16uaJMCr','6nSqzMw','103158nKatVO','1kAgToG'];a153_0xdc0d=function(){return _0x1828de;};return a153_0xdc0d();}function a153_0x20d5(_0x1f7e1a,_0x424654){_0x1f7e1a=_0x1f7e1a-0x158;const _0xdc0df4=a153_0xdc0d();let _0x20d5f7=_0xdc0df4[_0x1f7e1a];return _0x20d5f7;}(function(_0x1432e9,_0x54dea3){const _0x5f10cf=a153_0x20d5,_0xd3be15=_0x1432e9();while(!![]){try{const _0x1eeb41=-parseInt(_0x5f10cf(0x15f))/0x1*(-parseInt(_0x5f10cf(0x15e))/0x2)+parseInt(_0x5f10cf(0x15b))/0x3+-parseInt(_0x5f10cf(0x15c))/0x4*(-parseInt(_0x5f10cf(0x159))/0x5)+-parseInt(_0x5f10cf(0x15d))/0x6*(-parseInt(_0x5f10cf(0x15a))/0x7)+-parseInt(_0x5f10cf(0x161))/0x8+parseInt(_0x5f10cf(0x158))/0x9*(parseInt(_0x5f10cf(0x160))/0xa)+-parseInt(_0x5f10cf(0x162))/0xb;if(_0x1eeb41===_0x54dea3)break;else _0xd3be15['push'](_0xd3be15['shift']());}catch(_0x446239){_0xd3be15['push'](_0xd3be15['shift']());}}}(a153_0xdc0d,0xe7cb6));import{createJqFilter,resolveBundledJqPaths}from'@lovrabet/cli-framework';import{CliErrors}from'../errors.js';export const applyJqFilter=createJqFilter(CliErrors,{'bundledJqPaths':resolveBundledJqPaths()});
1
+ function a155_0x19ca(_0x42de36,_0x59e716){_0x42de36=_0x42de36-0x76;const _0x282e33=a155_0x282e();let _0x19ca69=_0x282e33[_0x42de36];return _0x19ca69;}function a155_0x282e(){const _0x260973=['7062940WdctAZ','14740njJGiv','14103aKkmsq','6917886BtDrdB','89627SefZbl','10wYeIzd','760445yKYCJW','10609760ytlEnQ','4PffZjl','1193013sjqsys'];a155_0x282e=function(){return _0x260973;};return a155_0x282e();}(function(_0x241f8e,_0xfe900f){const _0x404b55=a155_0x19ca,_0x350b31=_0x241f8e();while(!![]){try{const _0x51574b=-parseInt(_0x404b55(0x7a))/0x1*(parseInt(_0x404b55(0x7b))/0x2)+parseInt(_0x404b55(0x7f))/0x3*(parseInt(_0x404b55(0x7e))/0x4)+-parseInt(_0x404b55(0x76))/0x5+parseInt(_0x404b55(0x79))/0x6+parseInt(_0x404b55(0x7c))/0x7+-parseInt(_0x404b55(0x7d))/0x8+-parseInt(_0x404b55(0x78))/0x9*(-parseInt(_0x404b55(0x77))/0xa);if(_0x51574b===_0xfe900f)break;else _0x350b31['push'](_0x350b31['shift']());}catch(_0x546d65){_0x350b31['push'](_0x350b31['shift']());}}}(a155_0x282e,0xbef16));import{createJqFilter,resolveBundledJqPaths}from'@lovrabet/cli-framework';import{CliErrors}from'../errors.js';export const applyJqFilter=createJqFilter(CliErrors,{'bundledJqPaths':resolveBundledJqPaths()});
@@ -1 +1 @@
1
- (function(_0x47e4cd,_0x1a4e79){const _0x5b32da=a154_0x3ea3,_0x15dee8=_0x47e4cd();while(!![]){try{const _0x533de1=parseInt(_0x5b32da(0x126))/0x1+-parseInt(_0x5b32da(0x119))/0x2*(parseInt(_0x5b32da(0x11e))/0x3)+parseInt(_0x5b32da(0x127))/0x4+parseInt(_0x5b32da(0x125))/0x5+parseInt(_0x5b32da(0x120))/0x6+-parseInt(_0x5b32da(0x12c))/0x7+-parseInt(_0x5b32da(0x118))/0x8*(-parseInt(_0x5b32da(0x117))/0x9);if(_0x533de1===_0x1a4e79)break;else _0x15dee8['push'](_0x15dee8['shift']());}catch(_0x454c5e){_0x15dee8['push'](_0x15dee8['shift']());}}}(a154_0x299a,0x5dbf3));import a154_0x57fa2b from'semver';import{LOVRABET_NPM_PACKAGE_NAME}from'../constant/distribution.js';import{CliErrors}from'../errors.js';import{getCliVersionPolicy}from'../utils/cli-version-policy.js';import{getCliVersion}from'../utils/version.js';export function evaluateCliVersionPolicy(_0x310c2c,_0x1d578d){const _0xa4aee=a154_0x3ea3,_0x1b5830=a154_0x57fa2b[_0xa4aee(0x115)](_0x310c2c)===_0x310c2c,_0x29b443=_0x1d578d?.[_0xa4aee(0x122)]??null,_0x58412a=_0x1d578d?.[_0xa4aee(0x128)]??null,_0x40920a=Boolean(_0x1b5830&&_0x29b443&&a154_0x57fa2b['lt'](_0x310c2c,_0x29b443)),_0x1c3718=Boolean(_0x1b5830&&_0x58412a&&a154_0x57fa2b['lt'](_0x310c2c,_0x58412a));return{'currentVersion':_0x310c2c,'stableVersion':_0x29b443,'minimumVersion':_0x58412a,'needsUpgrade':_0x40920a||_0x1c3718,'belowMinimum':_0x1c3718,'upgradeMessage':_0x1d578d?.[_0xa4aee(0x116)],'minimumVersionMessage':_0x1d578d?.[_0xa4aee(0x123)]};}function a154_0x299a(){const _0x109683=['69220IyUQZq','minimumVersion','join','belowMinimum','filter','1712690DJqSOJ','Minimum\x20supported:\x20','valid','upgradeMessage','215334NhnUew','216RMucmc','4DdNAmO','currentVersion','validation','unavailable','npm\x20install\x20-g\x20','1009491tsdqbP','latest','953202DOwqHQ','Upgrade\x20command:\x20','stableVersion','minimumVersionMessage','Current\x20version:\x20','1030695NNZaQL','273338NtRETk'];a154_0x299a=function(){return _0x109683;};return a154_0x299a();}export async function checkCliVersion(){return evaluateCliVersionPolicy(getCliVersion(),await getCliVersionPolicy());}function a154_0x3ea3(_0x3f87d7,_0x1abd94){_0x3f87d7=_0x3f87d7-0x115;const _0x299a9f=a154_0x299a();let _0x3ea3e6=_0x299a9f[_0x3f87d7];return _0x3ea3e6;}export function getCliUpgradeCommand(_0x255a39){const _0x679183=a154_0x3ea3;return _0x679183(0x11d)+LOVRABET_NPM_PACKAGE_NAME+'@'+(_0x255a39[_0x679183(0x122)]??_0x679183(0x11f));}export function assertCliVersionSupported(_0x31c291){const _0x2bdf3c=a154_0x3ea3;if(!_0x31c291[_0x2bdf3c(0x12a)])return;const _0x330dcd=[_0x31c291['minimumVersionMessage'],_0x2bdf3c(0x124)+_0x31c291[_0x2bdf3c(0x11a)],_0x2bdf3c(0x12d)+_0x31c291['minimumVersion'],'Recommended\x20stable:\x20'+(_0x31c291[_0x2bdf3c(0x122)]??_0x2bdf3c(0x11c)),_0x2bdf3c(0x121)+getCliUpgradeCommand(_0x31c291)][_0x2bdf3c(0x12b)](Boolean)[_0x2bdf3c(0x129)]('\x0a');throw CliErrors[_0x2bdf3c(0x11b)]('Current\x20CLI\x20version\x20is\x20below\x20the\x20minimum\x20supported\x20version.',_0x330dcd);}
1
+ function a156_0xeccf(){const _0x2e0f69=['join','Current\x20version:\x20','1806852wOlZMm','stableVersion','latest','Current\x20CLI\x20version\x20is\x20below\x20the\x20minimum\x20supported\x20version.','80810EHPofM','Recommended\x20stable:\x20','belowMinimum','15970kzbftl','7PCtNyZ','upgradeMessage','Minimum\x20supported:\x20','3YGsdnO','9621648AeHDuN','4503924nnCOXp','1522647VbegTt','24xXtflF','minimumVersionMessage','minimumVersion','89LPOcpn','296087MNEeOr','filter','Upgrade\x20command:\x20','220cfrXIB','npm\x20install\x20-g\x20','validation'];a156_0xeccf=function(){return _0x2e0f69;};return a156_0xeccf();}(function(_0x322792,_0xc57ae3){const _0x41fb9e=a156_0x2fda,_0x37bd1c=_0x322792();while(!![]){try{const _0x4b3c29=parseInt(_0x41fb9e(0x97))/0x1*(parseInt(_0x41fb9e(0xa7))/0x2)+parseInt(_0x41fb9e(0x90))/0x3*(parseInt(_0x41fb9e(0xa0))/0x4)+parseInt(_0x41fb9e(0xa4))/0x5+parseInt(_0x41fb9e(0x92))/0x6*(-parseInt(_0x41fb9e(0xa8))/0x7)+-parseInt(_0x41fb9e(0x94))/0x8*(-parseInt(_0x41fb9e(0x93))/0x9)+parseInt(_0x41fb9e(0x9b))/0xa*(parseInt(_0x41fb9e(0x98))/0xb)+-parseInt(_0x41fb9e(0x91))/0xc;if(_0x4b3c29===_0xc57ae3)break;else _0x37bd1c['push'](_0x37bd1c['shift']());}catch(_0x30dd94){_0x37bd1c['push'](_0x37bd1c['shift']());}}}(a156_0xeccf,0xb132d));import a156_0x36e8f6 from'semver';import{LOVRABET_NPM_PACKAGE_NAME}from'../constant/distribution.js';import{CliErrors}from'../errors.js';import{getCliVersionPolicy}from'../utils/cli-version-policy.js';import{getCliVersion}from'../utils/version.js';export function evaluateCliVersionPolicy(_0x539583,_0x2191bb){const _0x1c1620=a156_0x2fda,_0x34198f=a156_0x36e8f6['valid'](_0x539583)===_0x539583,_0x4ef217=_0x2191bb?.[_0x1c1620(0xa1)]??null,_0x19c28b=_0x2191bb?.[_0x1c1620(0x96)]??null,_0x48c82d=Boolean(_0x34198f&&_0x4ef217&&a156_0x36e8f6['lt'](_0x539583,_0x4ef217)),_0x57aa00=Boolean(_0x34198f&&_0x19c28b&&a156_0x36e8f6['lt'](_0x539583,_0x19c28b));return{'currentVersion':_0x539583,'stableVersion':_0x4ef217,'minimumVersion':_0x19c28b,'needsUpgrade':_0x48c82d||_0x57aa00,'belowMinimum':_0x57aa00,'upgradeMessage':_0x2191bb?.[_0x1c1620(0xa9)],'minimumVersionMessage':_0x2191bb?.[_0x1c1620(0x95)]};}function a156_0x2fda(_0x19ba06,_0x106691){_0x19ba06=_0x19ba06-0x8f;const _0xeccfef=a156_0xeccf();let _0x2fda88=_0xeccfef[_0x19ba06];return _0x2fda88;}export async function checkCliVersion(){return evaluateCliVersionPolicy(getCliVersion(),await getCliVersionPolicy());}export function getCliUpgradeCommand(_0xc645aa){const _0x3ac15d=a156_0x2fda;return _0x3ac15d(0x9c)+LOVRABET_NPM_PACKAGE_NAME+'@'+(_0xc645aa['stableVersion']??_0x3ac15d(0xa2));}export function assertCliVersionSupported(_0x27d55f){const _0x163a00=a156_0x2fda;if(!_0x27d55f[_0x163a00(0xa6)])return;const _0x2a15ed=[_0x27d55f['minimumVersionMessage'],_0x163a00(0x9f)+_0x27d55f['currentVersion'],_0x163a00(0x8f)+_0x27d55f[_0x163a00(0x96)],_0x163a00(0xa5)+(_0x27d55f[_0x163a00(0xa1)]??'unavailable'),_0x163a00(0x9a)+getCliUpgradeCommand(_0x27d55f)][_0x163a00(0x99)](Boolean)[_0x163a00(0x9e)]('\x0a');throw CliErrors[_0x163a00(0x9d)](_0x163a00(0xa3),_0x2a15ed);}
@@ -1 +1 @@
1
- (function(_0x3e4522,_0x5ea68e){const _0x1964ed=a155_0x5d04,_0x27435b=_0x3e4522();while(!![]){try{const _0x13e2c7=parseInt(_0x1964ed(0xac))/0x1+-parseInt(_0x1964ed(0xab))/0x2*(-parseInt(_0x1964ed(0xa7))/0x3)+parseInt(_0x1964ed(0xa1))/0x4+-parseInt(_0x1964ed(0x9d))/0x5*(parseInt(_0x1964ed(0x9b))/0x6)+parseInt(_0x1964ed(0xa2))/0x7*(parseInt(_0x1964ed(0x9e))/0x8)+-parseInt(_0x1964ed(0xaa))/0x9*(parseInt(_0x1964ed(0x98))/0xa)+-parseInt(_0x1964ed(0x9a))/0xb;if(_0x13e2c7===_0x5ea68e)break;else _0x27435b['push'](_0x27435b['shift']());}catch(_0x498720){_0x27435b['push'](_0x27435b['shift']());}}}(a155_0x540b,0x6bcb7));import a155_0x5bb0ed from'semver';import{LOVRABET_CLI_VERSION_POLICY_URL}from'../constant/distribution.js';const SUCCESS_CACHE_TTL_MS=0x5*0x3c*0x3e8,FAILURE_CACHE_TTL_MS=0x3c*0x3e8,FETCH_TIMEOUT_MS=0x5dc;function pickString(_0x3fc817){const _0x296403=a155_0x5d04;return typeof _0x3fc817===_0x296403(0xa9)&&_0x3fc817['trim']()?_0x3fc817[_0x296403(0x9c)]():null;}function pickStrictSemver(_0x20a268){const _0x45e43a=pickString(_0x20a268);return _0x45e43a&&a155_0x5bb0ed['valid'](_0x45e43a)===_0x45e43a?_0x45e43a:null;}export function normalizeCliVersionPolicy(_0x22f364){const _0xa476e8=a155_0x5d04;if(!_0x22f364||typeof _0x22f364!==_0xa476e8(0xa3))return null;const _0xd1f12e=_0x22f364,_0x1883e6=_0xd1f12e['cli']&&typeof _0xd1f12e[_0xa476e8(0x96)]===_0xa476e8(0xa3)?_0xd1f12e[_0xa476e8(0x96)]:_0xd1f12e,_0x3ea576=pickStrictSemver(_0x1883e6['stableVersion']??_0x1883e6['latestVersion']??_0x1883e6[_0xa476e8(0xa5)]),_0x194956=pickStrictSemver(_0x1883e6[_0xa476e8(0x97)]??_0x1883e6[_0xa476e8(0xa8)]);if(!_0x3ea576&&!_0x194956)return null;if(_0x3ea576&&_0x194956&&a155_0x5bb0ed['gt'](_0x194956,_0x3ea576))return null;return{'stableVersion':_0x3ea576,'minimumVersion':_0x194956,'upgradeMessage':pickString(_0x1883e6[_0xa476e8(0x99)])??undefined,'minimumVersionMessage':pickString(_0x1883e6['minimumVersionMessage'])??undefined};}function a155_0x540b(){const _0x571176=['cli','minimumVersion','587010jsHYJC','upgradeMessage','1353132EwoyPv','25476OJysrD','trim','140LdasBX','8YtJMzO','timeout','json','3383564iCPtJU','2655772PpMbgf','object','now','recommendedVersion','finally','685563tcTrhb','minVersion','string','126SkUwwe','2mwaMVf','51433FPxbrg'];a155_0x540b=function(){return _0x571176;};return a155_0x540b();}function a155_0x5d04(_0xbae86b,_0x4d5176){_0xbae86b=_0xbae86b-0x96;const _0x540bb0=a155_0x540b();let _0x5d04da=_0x540bb0[_0xbae86b];return _0x5d04da;}export async function fetchCliVersionPolicy(){const _0x98b98=a155_0x5d04;try{const _0x5d5425=await fetch(LOVRABET_CLI_VERSION_POLICY_URL,{'headers':{'Accept':'application/json'},'signal':AbortSignal[_0x98b98(0x9f)](FETCH_TIMEOUT_MS)});if(!_0x5d5425['ok'])return null;return normalizeCliVersionPolicy(await _0x5d5425[_0x98b98(0xa0)]());}catch{return null;}}let cachedPolicy=null,cachedAt=0x0,hasCachedPolicy=![],pendingPolicy=null;export async function getCliVersionPolicy(){const _0x23257e=a155_0x5d04,_0x4576d1=Date[_0x23257e(0xa4)]();if(hasCachedPolicy){const _0x47b7e8=cachedPolicy?SUCCESS_CACHE_TTL_MS:FAILURE_CACHE_TTL_MS;if(_0x4576d1-cachedAt<_0x47b7e8)return cachedPolicy;}if(pendingPolicy)return pendingPolicy;return pendingPolicy=fetchCliVersionPolicy()['then'](_0x2517ec=>{const _0x57d9ac=_0x23257e;return cachedPolicy=_0x2517ec,cachedAt=Date[_0x57d9ac(0xa4)](),hasCachedPolicy=!![],_0x2517ec;})[_0x23257e(0xa6)](()=>{pendingPolicy=null;}),pendingPolicy;}export function clearCliVersionPolicyCache(){cachedPolicy=null,cachedAt=0x0,hasCachedPolicy=![],pendingPolicy=null;}
1
+ (function(_0x32e8d0,_0x17ec13){const _0xf434c8=a157_0x3f0c,_0x1ce9cf=_0x32e8d0();while(!![]){try{const _0x1cb1eb=-parseInt(_0xf434c8(0xfd))/0x1*(parseInt(_0xf434c8(0x100))/0x2)+-parseInt(_0xf434c8(0x10a))/0x3+parseInt(_0xf434c8(0xfe))/0x4+parseInt(_0xf434c8(0x10b))/0x5+-parseInt(_0xf434c8(0x108))/0x6+-parseInt(_0xf434c8(0xfb))/0x7+-parseInt(_0xf434c8(0x106))/0x8*(-parseInt(_0xf434c8(0x10d))/0x9);if(_0x1cb1eb===_0x17ec13)break;else _0x1ce9cf['push'](_0x1ce9cf['shift']());}catch(_0x294fa3){_0x1ce9cf['push'](_0x1ce9cf['shift']());}}}(a157_0x1f5c,0x48b6c));import a157_0x2f95e1 from'semver';function a157_0x1f5c(){const _0x1906fe=['then','valid','object','67123zjqOSB','minimumVersionMessage','532sIcpwG','2158972pYGBkg','minVersion','582QBlhbw','timeout','cli','upgradeMessage','latestVersion','stableVersion','774024fdtbBL','json','2172738qXBeNG','now','282795KZIuTi','926880NTyIhg','string','18WtIwAh','minimumVersion','trim','finally','application/json'];a157_0x1f5c=function(){return _0x1906fe;};return a157_0x1f5c();}function a157_0x3f0c(_0x534c83,_0xff99ab){_0x534c83=_0x534c83-0xfb;const _0x1f5c82=a157_0x1f5c();let _0x3f0cea=_0x1f5c82[_0x534c83];return _0x3f0cea;}import{LOVRABET_CLI_VERSION_POLICY_URL}from'../constant/distribution.js';const SUCCESS_CACHE_TTL_MS=0x5*0x3c*0x3e8,FAILURE_CACHE_TTL_MS=0x3c*0x3e8,FETCH_TIMEOUT_MS=0x5dc;function pickString(_0x32829a){const _0x43c84c=a157_0x3f0c;return typeof _0x32829a===_0x43c84c(0x10c)&&_0x32829a['trim']()?_0x32829a[_0x43c84c(0x10f)]():null;}function pickStrictSemver(_0x274adf){const _0xd8b4bd=a157_0x3f0c,_0x5bafb4=pickString(_0x274adf);return _0x5bafb4&&a157_0x2f95e1[_0xd8b4bd(0x113)](_0x5bafb4)===_0x5bafb4?_0x5bafb4:null;}export function normalizeCliVersionPolicy(_0xc16f29){const _0x29aa4c=a157_0x3f0c;if(!_0xc16f29||typeof _0xc16f29!=='object')return null;const _0x2304dc=_0xc16f29,_0x2d57d8=_0x2304dc['cli']&&typeof _0x2304dc['cli']===_0x29aa4c(0x114)?_0x2304dc[_0x29aa4c(0x102)]:_0x2304dc,_0x23190e=pickStrictSemver(_0x2d57d8[_0x29aa4c(0x105)]??_0x2d57d8[_0x29aa4c(0x104)]??_0x2d57d8['recommendedVersion']),_0x236b80=pickStrictSemver(_0x2d57d8[_0x29aa4c(0x10e)]??_0x2d57d8[_0x29aa4c(0xff)]);if(!_0x23190e&&!_0x236b80)return null;if(_0x23190e&&_0x236b80&&a157_0x2f95e1['gt'](_0x236b80,_0x23190e))return null;return{'stableVersion':_0x23190e,'minimumVersion':_0x236b80,'upgradeMessage':pickString(_0x2d57d8[_0x29aa4c(0x103)])??undefined,'minimumVersionMessage':pickString(_0x2d57d8[_0x29aa4c(0xfc)])??undefined};}export async function fetchCliVersionPolicy(){const _0x5a28cf=a157_0x3f0c;try{const _0x2015f5=await fetch(LOVRABET_CLI_VERSION_POLICY_URL,{'headers':{'Accept':_0x5a28cf(0x111)},'signal':AbortSignal[_0x5a28cf(0x101)](FETCH_TIMEOUT_MS)});if(!_0x2015f5['ok'])return null;return normalizeCliVersionPolicy(await _0x2015f5[_0x5a28cf(0x107)]());}catch{return null;}}let cachedPolicy=null,cachedAt=0x0,hasCachedPolicy=![],pendingPolicy=null;export async function getCliVersionPolicy(){const _0x1d4a2b=a157_0x3f0c,_0x574433=Date[_0x1d4a2b(0x109)]();if(hasCachedPolicy){const _0x4b3764=cachedPolicy?SUCCESS_CACHE_TTL_MS:FAILURE_CACHE_TTL_MS;if(_0x574433-cachedAt<_0x4b3764)return cachedPolicy;}if(pendingPolicy)return pendingPolicy;return pendingPolicy=fetchCliVersionPolicy()[_0x1d4a2b(0x112)](_0x473c19=>{return cachedPolicy=_0x473c19,cachedAt=Date['now'](),hasCachedPolicy=!![],_0x473c19;})[_0x1d4a2b(0x110)](()=>{pendingPolicy=null;}),pendingPolicy;}export function clearCliVersionPolicyCache(){cachedPolicy=null,cachedAt=0x0,hasCachedPolicy=![],pendingPolicy=null;}
@@ -1 +1 @@
1
- const a156_0x143a4b=a156_0x5b55;function a156_0x5b55(_0x5c81f8,_0x51bd1c){_0x5c81f8=_0x5c81f8-0x1ee;const _0x731675=a156_0x7316();let _0x5b55af=_0x731675[_0x5c81f8];return _0x5b55af;}(function(_0x1eefba,_0x4c5663){const _0x1a3572=a156_0x5b55,_0x217d60=_0x1eefba();while(!![]){try{const _0x4bb584=parseInt(_0x1a3572(0x210))/0x1*(parseInt(_0x1a3572(0x22a))/0x2)+parseInt(_0x1a3572(0x219))/0x3+parseInt(_0x1a3572(0x20a))/0x4*(parseInt(_0x1a3572(0x222))/0x5)+-parseInt(_0x1a3572(0x1f4))/0x6+-parseInt(_0x1a3572(0x1f9))/0x7*(-parseInt(_0x1a3572(0x20b))/0x8)+-parseInt(_0x1a3572(0x21b))/0x9*(parseInt(_0x1a3572(0x224))/0xa)+-parseInt(_0x1a3572(0x215))/0xb;if(_0x4bb584===_0x4c5663)break;else _0x217d60['push'](_0x217d60['shift']());}catch(_0x42b20a){_0x217d60['push'](_0x217d60['shift']());}}}(a156_0x7316,0x61761));import a156_0x3781fc from'winston';function a156_0x7316(){const _0x2ca8b3=['1508yNarlu','1016PAsmOW','unknown','duration','setRawCommand','filter','1MkbhoE','blue','logFileName','dirname','stringify','4014384TfEnfD','printf','format','message','639810pmMkBk','File','162wYnzuc','yellow','map','addColors','Failed:\x20','Failed\x20to\x20read\x20logs:','initWinstonLogger','4735BhDBrY','level','392970HeSrbb','winstonLogger','success','combine','createLogger','mkdirSync','1568472KMddSk','existsSync','utf8','errors','parse','currentRawCommand','toISOString','3778002PnsUGW','details','rawCommand','readFileSync','split','41153RvTQoL','error','trim','clear','Starting:\x20','warn','now','setLogPath','join','logFilePath','red','clearLogs','timestamp','info','Failed\x20to\x20clear\x20logs:','Completed:\x20','logTask'];a156_0x7316=function(){return _0x2ca8b3;};return a156_0x7316();}import a156_0x560a8b from'node:fs';import a156_0x4fc9d5 from'node:path';import{PRODUCT_CONFIG}from'../constant/product.js';class Logger{['winstonLogger'];[a156_0x143a4b(0x202)]='';['currentRawCommand']='';constructor(){}[a156_0x143a4b(0x20e)](_0x4a9d71){const _0x495092=a156_0x143a4b;this[_0x495092(0x1f2)]=_0x4a9d71;}[a156_0x143a4b(0x200)](_0x54cc40){const _0x254311=a156_0x143a4b;this['logFilePath']=a156_0x4fc9d5[_0x254311(0x201)](_0x54cc40,PRODUCT_CONFIG[_0x254311(0x212)]),this['winstonLogger']&&this['winstonLogger'][_0x254311(0x1fc)](),this[_0x254311(0x221)]();}['initWinstonLogger'](){const _0x1b1671=a156_0x143a4b,_0xfc7fb0=a156_0x4fc9d5[_0x1b1671(0x213)](this[_0x1b1671(0x202)]);!a156_0x560a8b[_0x1b1671(0x1ee)](_0xfc7fb0)&&a156_0x560a8b[_0x1b1671(0x229)](_0xfc7fb0,{'recursive':!![]});const _0xa97afd=a156_0x3781fc[_0x1b1671(0x217)][_0x1b1671(0x227)](a156_0x3781fc[_0x1b1671(0x217)][_0x1b1671(0x205)](),a156_0x3781fc['format'][_0x1b1671(0x1f0)]({'stack':!![]}),a156_0x3781fc[_0x1b1671(0x217)][_0x1b1671(0x216)](_0x3e2bb8=>{const _0x3fee5e=_0x1b1671,_0x1ab845={'timestamp':_0x3e2bb8[_0x3fee5e(0x205)]||new Date()[_0x3fee5e(0x1f3)](),'level':_0x3e2bb8[_0x3fee5e(0x223)]||_0x3fee5e(0x206),'command':_0x3e2bb8['command']||_0x3fee5e(0x20c),'rawCommand':_0x3e2bb8[_0x3fee5e(0x1f6)]||this['currentRawCommand']||undefined,'message':_0x3e2bb8[_0x3fee5e(0x218)]||'','duration':_0x3e2bb8[_0x3fee5e(0x20d)]||undefined,'details':_0x3e2bb8[_0x3fee5e(0x1f5)]||undefined};return JSON[_0x3fee5e(0x214)](_0x1ab845);}));this['winstonLogger']=a156_0x3781fc[_0x1b1671(0x228)]({'level':_0x1b1671(0x206),'format':_0xa97afd,'transports':[new a156_0x3781fc['transports'][(_0x1b1671(0x21a))]({'filename':this[_0x1b1671(0x202)],'level':_0x1b1671(0x206)})],'silent':![]}),a156_0x3781fc[_0x1b1671(0x21e)]({'success':'green','error':_0x1b1671(0x203),'warn':_0x1b1671(0x21c),'info':_0x1b1671(0x211)});}[a156_0x143a4b(0x206)](_0x319dfe,_0x292156,_0x29dd13){const _0x121355=a156_0x143a4b;if(!this[_0x121355(0x202)]||!this['winstonLogger'])return;this['winstonLogger'][_0x121355(0x206)](_0x292156,{'command':_0x319dfe,'details':_0x29dd13});}[a156_0x143a4b(0x226)](_0x410b1d,_0x2e1d38,_0x2e4389,_0x171f97){const _0x52ca40=a156_0x143a4b;if(!this[_0x52ca40(0x202)]||!this[_0x52ca40(0x225)])return;this[_0x52ca40(0x225)]['log'](_0x52ca40(0x206),_0x2e1d38,{'level':_0x52ca40(0x226),'command':_0x410b1d,'duration':_0x2e4389,'details':_0x171f97});}['error'](_0x15f3bc,_0xa887f8,_0x3bb5af){const _0x198a96=a156_0x143a4b;if(!this[_0x198a96(0x202)]||!this[_0x198a96(0x225)])return;this[_0x198a96(0x225)][_0x198a96(0x1fa)](_0xa887f8,{'command':_0x15f3bc,'details':_0x3bb5af});}[a156_0x143a4b(0x1fe)](_0xac1332,_0x1adc76,_0x118363){const _0x3e2a29=a156_0x143a4b;if(!this[_0x3e2a29(0x202)]||!this[_0x3e2a29(0x225)])return;this['winstonLogger']['warn'](_0x1adc76,{'command':_0xac1332,'details':_0x118363});}async[a156_0x143a4b(0x209)](_0x586f86,_0x5a6daf,_0x35c0ae){const _0x96c8ab=a156_0x143a4b,_0x581972=Date[_0x96c8ab(0x1ff)]();this['info'](_0x586f86,_0x96c8ab(0x1fd)+_0x5a6daf);try{const _0x47fd60=await _0x35c0ae(),_0x564378=Date[_0x96c8ab(0x1ff)]()-_0x581972;return this[_0x96c8ab(0x226)](_0x586f86,_0x96c8ab(0x208)+_0x5a6daf,_0x564378),_0x47fd60;}catch(_0x18c52f){const _0x3807ee=Date[_0x96c8ab(0x1ff)]()-_0x581972;this[_0x96c8ab(0x1fa)](_0x586f86,_0x96c8ab(0x21f)+_0x5a6daf,{'error':_0x18c52f instanceof Error?_0x18c52f['message']:String(_0x18c52f),'duration':_0x3807ee});throw _0x18c52f;}}['readLogs'](){const _0x479747=a156_0x143a4b;try{if(!a156_0x560a8b[_0x479747(0x1ee)](this[_0x479747(0x202)]))return[];const _0x330d36=a156_0x560a8b[_0x479747(0x1f7)](this['logFilePath'],_0x479747(0x1ef));return _0x330d36[_0x479747(0x1f8)](/\r?\n/)[_0x479747(0x20f)](_0xcb10cc=>_0xcb10cc[_0x479747(0x1fb)]())[_0x479747(0x21d)](_0x3aa44c=>JSON[_0x479747(0x1f1)](_0x3aa44c));}catch(_0x1d589){return console[_0x479747(0x1fe)](_0x479747(0x220),_0x1d589),[];}}[a156_0x143a4b(0x204)](){const _0x523bda=a156_0x143a4b;try{a156_0x560a8b[_0x523bda(0x1ee)](this[_0x523bda(0x202)])&&a156_0x560a8b['writeFileSync'](this[_0x523bda(0x202)],'',_0x523bda(0x1ef));}catch(_0x3c9b86){console[_0x523bda(0x1fe)](_0x523bda(0x207),_0x3c9b86);}}['getWinstonInstance'](){const _0x28e6ec=a156_0x143a4b;return this[_0x28e6ec(0x225)];}}export const logger=new Logger();
1
+ const a158_0x3b3cd1=a158_0x41e0;(function(_0x1e84eb,_0x4ac1ff){const _0x3def96=a158_0x41e0,_0x4f6c71=_0x1e84eb();while(!![]){try{const _0x2bb173=-parseInt(_0x3def96(0x1af))/0x1+parseInt(_0x3def96(0x193))/0x2+-parseInt(_0x3def96(0x190))/0x3*(parseInt(_0x3def96(0x194))/0x4)+-parseInt(_0x3def96(0x1b0))/0x5*(-parseInt(_0x3def96(0x1b1))/0x6)+-parseInt(_0x3def96(0x1a8))/0x7*(-parseInt(_0x3def96(0x1a0))/0x8)+-parseInt(_0x3def96(0x1a4))/0x9*(parseInt(_0x3def96(0x19f))/0xa)+parseInt(_0x3def96(0x19e))/0xb;if(_0x2bb173===_0x4ac1ff)break;else _0x4f6c71['push'](_0x4f6c71['shift']());}catch(_0x58650b){_0x4f6c71['push'](_0x4f6c71['shift']());}}}(a158_0x47af,0xe842e));import a158_0xf34b48 from'winston';import a158_0x440919 from'node:fs';function a158_0x47af(){const _0x46768d=['initWinstonLogger','trim','readLogs','currentRawCommand','Starting:\x20','timestamp','createLogger','error','Failed:\x20','18411294SYloGz','476970wakyie','712424fgNdGi','logTask','errors','details','99OXzFVF','message','yellow','combine','42WBYnuJ','stringify','printf','utf8','rawCommand','info','unknown','948808RpqPwO','5HkaHES','2845446zvOVqM','success','Failed\x20to\x20clear\x20logs:','readFileSync','dirname','File','duration','existsSync','join','setLogPath','winstonLogger','level','transports','logFilePath','warn','Failed\x20to\x20read\x20logs:','Completed:\x20','mkdirSync','command','filter','map','blue','format','4074897iJDLFu','red','now','2201606Bagwvh','4WvYaNW'];a158_0x47af=function(){return _0x46768d;};return a158_0x47af();}import a158_0x182f57 from'node:path';import{PRODUCT_CONFIG}from'../constant/product.js';function a158_0x41e0(_0x3d3c77,_0x5e04cd){_0x3d3c77=_0x3d3c77-0x188;const _0x47af73=a158_0x47af();let _0x41e0fa=_0x47af73[_0x3d3c77];return _0x41e0fa;}class Logger{[a158_0x3b3cd1(0x1bb)];['logFilePath']='';[a158_0x3b3cd1(0x198)]='';constructor(){}['setRawCommand'](_0x3e894f){const _0x33bf57=a158_0x3b3cd1;this[_0x33bf57(0x198)]=_0x3e894f;}[a158_0x3b3cd1(0x1ba)](_0x8dc7fc){const _0x5278bb=a158_0x3b3cd1;this[_0x5278bb(0x1be)]=a158_0x182f57[_0x5278bb(0x1b9)](_0x8dc7fc,PRODUCT_CONFIG['logFileName']),this[_0x5278bb(0x1bb)]&&this['winstonLogger']['clear'](),this[_0x5278bb(0x195)]();}['initWinstonLogger'](){const _0x2aa76e=a158_0x3b3cd1,_0x30eb28=a158_0x182f57[_0x2aa76e(0x1b5)](this[_0x2aa76e(0x1be)]);!a158_0x440919[_0x2aa76e(0x1b8)](_0x30eb28)&&a158_0x440919[_0x2aa76e(0x18a)](_0x30eb28,{'recursive':!![]});const _0x123c9c=a158_0xf34b48[_0x2aa76e(0x18f)][_0x2aa76e(0x1a7)](a158_0xf34b48[_0x2aa76e(0x18f)][_0x2aa76e(0x19a)](),a158_0xf34b48['format'][_0x2aa76e(0x1a2)]({'stack':!![]}),a158_0xf34b48[_0x2aa76e(0x18f)][_0x2aa76e(0x1aa)](_0x22d1c4=>{const _0x5e127d=_0x2aa76e,_0x49ee01={'timestamp':_0x22d1c4[_0x5e127d(0x19a)]||new Date()['toISOString'](),'level':_0x22d1c4[_0x5e127d(0x1bc)]||_0x5e127d(0x1ad),'command':_0x22d1c4[_0x5e127d(0x18b)]||_0x5e127d(0x1ae),'rawCommand':_0x22d1c4[_0x5e127d(0x1ac)]||this['currentRawCommand']||undefined,'message':_0x22d1c4[_0x5e127d(0x1a5)]||'','duration':_0x22d1c4[_0x5e127d(0x1b7)]||undefined,'details':_0x22d1c4[_0x5e127d(0x1a3)]||undefined};return JSON[_0x5e127d(0x1a9)](_0x49ee01);}));this[_0x2aa76e(0x1bb)]=a158_0xf34b48[_0x2aa76e(0x19b)]({'level':_0x2aa76e(0x1ad),'format':_0x123c9c,'transports':[new a158_0xf34b48[(_0x2aa76e(0x1bd))][(_0x2aa76e(0x1b6))]({'filename':this[_0x2aa76e(0x1be)],'level':_0x2aa76e(0x1ad)})],'silent':![]}),a158_0xf34b48['addColors']({'success':'green','error':_0x2aa76e(0x191),'warn':_0x2aa76e(0x1a6),'info':_0x2aa76e(0x18e)});}[a158_0x3b3cd1(0x1ad)](_0x171833,_0x44a516,_0x7a5245){const _0x9ed7a4=a158_0x3b3cd1;if(!this[_0x9ed7a4(0x1be)]||!this['winstonLogger'])return;this['winstonLogger']['info'](_0x44a516,{'command':_0x171833,'details':_0x7a5245});}[a158_0x3b3cd1(0x1b2)](_0x3348d2,_0x2c2f3d,_0x50a0f3,_0x243776){const _0x22638d=a158_0x3b3cd1;if(!this[_0x22638d(0x1be)]||!this[_0x22638d(0x1bb)])return;this['winstonLogger']['log'](_0x22638d(0x1ad),_0x2c2f3d,{'level':_0x22638d(0x1b2),'command':_0x3348d2,'duration':_0x50a0f3,'details':_0x243776});}['error'](_0x317be1,_0x3612ff,_0x36e314){const _0x590713=a158_0x3b3cd1;if(!this[_0x590713(0x1be)]||!this['winstonLogger'])return;this['winstonLogger']['error'](_0x3612ff,{'command':_0x317be1,'details':_0x36e314});}['warn'](_0x29b058,_0x2df268,_0x216a30){const _0x378d77=a158_0x3b3cd1;if(!this['logFilePath']||!this[_0x378d77(0x1bb)])return;this['winstonLogger']['warn'](_0x2df268,{'command':_0x29b058,'details':_0x216a30});}async[a158_0x3b3cd1(0x1a1)](_0x272bd8,_0x46f352,_0x1ea378){const _0x559f5f=a158_0x3b3cd1,_0x479fa8=Date[_0x559f5f(0x192)]();this['info'](_0x272bd8,_0x559f5f(0x199)+_0x46f352);try{const _0x216a3c=await _0x1ea378(),_0x5c13ef=Date[_0x559f5f(0x192)]()-_0x479fa8;return this[_0x559f5f(0x1b2)](_0x272bd8,_0x559f5f(0x189)+_0x46f352,_0x5c13ef),_0x216a3c;}catch(_0xb1b9a1){const _0x2f91df=Date['now']()-_0x479fa8;this[_0x559f5f(0x19c)](_0x272bd8,_0x559f5f(0x19d)+_0x46f352,{'error':_0xb1b9a1 instanceof Error?_0xb1b9a1[_0x559f5f(0x1a5)]:String(_0xb1b9a1),'duration':_0x2f91df});throw _0xb1b9a1;}}[a158_0x3b3cd1(0x197)](){const _0x27b6ee=a158_0x3b3cd1;try{if(!a158_0x440919[_0x27b6ee(0x1b8)](this[_0x27b6ee(0x1be)]))return[];const _0x44e0b9=a158_0x440919[_0x27b6ee(0x1b4)](this[_0x27b6ee(0x1be)],'utf8');return _0x44e0b9['split'](/\r?\n/)[_0x27b6ee(0x18c)](_0x216f2e=>_0x216f2e[_0x27b6ee(0x196)]())[_0x27b6ee(0x18d)](_0x47803b=>JSON['parse'](_0x47803b));}catch(_0x477539){return console['warn'](_0x27b6ee(0x188),_0x477539),[];}}['clearLogs'](){const _0x481a47=a158_0x3b3cd1;try{a158_0x440919['existsSync'](this[_0x481a47(0x1be)])&&a158_0x440919['writeFileSync'](this['logFilePath'],'',_0x481a47(0x1ab));}catch(_0x4fb1ad){console[_0x481a47(0x1bf)](_0x481a47(0x1b3),_0x4fb1ad);}}['getWinstonInstance'](){const _0x1cd35f=a158_0x3b3cd1;return this[_0x1cd35f(0x1bb)];}}export const logger=new Logger();