@lovrabet/lovrabet-cli 2.1.23 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (169) hide show
  1. package/README.md +13 -10
  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.js +1 -1
  23. package/lib/commands/common/local-file.js +1 -1
  24. package/lib/commands/config/definitions.js +1 -1
  25. package/lib/commands/config/shared.js +1 -1
  26. package/lib/commands/data/index.js +1 -1
  27. package/lib/commands/dataset/detail.js +1 -1
  28. package/lib/commands/dataset/index.js +1 -1
  29. package/lib/commands/dataset/list.js +1 -1
  30. package/lib/commands/dataset/sdk-doc.js +1 -1
  31. package/lib/commands/doctor.js +1 -1
  32. package/lib/commands/file/index.js +1 -1
  33. package/lib/commands/init.js +1 -1
  34. package/lib/commands/kb/index.js +1 -1
  35. package/lib/commands/logs/index.js +1 -1
  36. package/lib/commands/ocr/index.js +1 -1
  37. package/lib/commands/personal-bff/index.js +1 -1
  38. package/lib/commands/registry.js +1 -1
  39. package/lib/commands/schedule/index.js +1 -1
  40. package/lib/commands/schema.js +1 -1
  41. package/lib/commands/service/dynamic.js +1 -1
  42. package/lib/commands/service/function-name-adapter.js +1 -1
  43. package/lib/commands/service/index.js +1 -1
  44. package/lib/commands/service/registry.js +1 -1
  45. package/lib/commands/skill/commands/create.js +1 -1
  46. package/lib/commands/skill/commands/diagram.js +1 -1
  47. package/lib/commands/skill/commands/install.js +1 -1
  48. package/lib/commands/skill/commands/list.js +1 -1
  49. package/lib/commands/skill/commands/push.js +1 -1
  50. package/lib/commands/skill/commands/validate.js +1 -1
  51. package/lib/commands/skill/diagram.js +1 -1
  52. package/lib/commands/skill/flags.js +1 -1
  53. package/lib/commands/skill/index.js +1 -1
  54. package/lib/commands/skill/manifest-helpers.js +1 -1
  55. package/lib/commands/skill/push-execute.js +1 -1
  56. package/lib/commands/skill/push-flow-helpers.js +1 -1
  57. package/lib/commands/skill/push-retarget.js +1 -1
  58. package/lib/commands/skill/scopes.js +1 -1
  59. package/lib/commands/skill/summary.js +1 -1
  60. package/lib/commands/skill/templates.js +1 -1
  61. package/lib/commands/skill/validate.js +1 -1
  62. package/lib/commands/sql/detail.js +1 -1
  63. package/lib/commands/sql/exec.js +1 -1
  64. package/lib/commands/sql/index.js +1 -1
  65. package/lib/commands/update.d.ts +2 -2
  66. package/lib/commands/update.js +1 -1
  67. package/lib/commands/workspace/index.js +1 -1
  68. package/lib/config/schema.js +1 -1
  69. package/lib/constant/app.js +1 -1
  70. package/lib/constant/auth-mode.js +1 -1
  71. package/lib/constant/cli.js +1 -1
  72. package/lib/constant/defaults.js +1 -1
  73. package/lib/constant/distribution.js +1 -1
  74. package/lib/constant/domain.js +1 -1
  75. package/lib/constant/env.js +1 -1
  76. package/lib/constant/output.js +1 -1
  77. package/lib/constant/product.js +1 -1
  78. package/lib/constant/risk.js +1 -1
  79. package/lib/constant/url.js +1 -1
  80. package/lib/context.js +1 -1
  81. package/lib/core/api-client.js +1 -1
  82. package/lib/core/db-resolver.js +1 -1
  83. package/lib/core/sdk-client.js +1 -1
  84. package/lib/errors.js +1 -1
  85. package/lib/framework/build-all-flags.js +1 -1
  86. package/lib/framework/dryrun.js +1 -1
  87. package/lib/framework/flags.js +1 -1
  88. package/lib/framework/help.js +1 -1
  89. package/lib/framework/index.js +1 -1
  90. package/lib/framework/output.js +1 -1
  91. package/lib/framework/preparse.js +1 -1
  92. package/lib/framework/rate-limit.js +1 -1
  93. package/lib/framework/raw-flags.js +1 -1
  94. package/lib/framework/response.js +1 -1
  95. package/lib/framework/runner-confirmation.js +1 -1
  96. package/lib/framework/runner-error.js +1 -1
  97. package/lib/framework/runner.js +1 -1
  98. package/lib/framework/schema-export.js +1 -1
  99. package/lib/framework/service-order.js +1 -1
  100. package/lib/framework/types.js +1 -1
  101. package/lib/generated/build-info.d.ts +4 -4
  102. package/lib/generated/build-info.js +1 -1
  103. package/lib/help.js +1 -1
  104. package/lib/postinstall.d.ts +2 -0
  105. package/lib/postinstall.js +1 -0
  106. package/lib/runtime/confirmation.js +1 -1
  107. package/lib/runtime/event.js +1 -1
  108. package/lib/runtime/index.js +1 -1
  109. package/lib/runtime/queue.js +1 -1
  110. package/lib/runtime/resolve.js +1 -1
  111. package/lib/skills/builtin-skill.d.ts +37 -0
  112. package/lib/skills/builtin-skill.js +1 -0
  113. package/lib/skills/npx-skills-add.d.ts +3 -1
  114. package/lib/skills/npx-skills-add.js +1 -1
  115. package/lib/skills/runtime-skill-sync/constants.js +1 -1
  116. package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
  117. package/lib/skills/runtime-skill-sync/hashing.js +1 -1
  118. package/lib/skills/runtime-skill-sync/install-target.js +1 -1
  119. package/lib/skills/runtime-skill-sync/links.js +1 -1
  120. package/lib/skills/runtime-skill-sync/list-local.js +1 -1
  121. package/lib/skills/runtime-skill-sync/local-files.js +1 -1
  122. package/lib/skills/runtime-skill-sync/materialize.js +1 -1
  123. package/lib/skills/runtime-skill-sync/metadata.js +1 -1
  124. package/lib/skills/runtime-skill-sync/paths.js +1 -1
  125. package/lib/skills/runtime-skill-sync/push.js +1 -1
  126. package/lib/skills/runtime-skill-sync/scopes.js +1 -1
  127. package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
  128. package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
  129. package/lib/skills/runtime-skill-sync.js +1 -1
  130. package/lib/skills/skill-presence.js +1 -1
  131. package/lib/utils/apply-jq-filter.js +1 -1
  132. package/lib/utils/logger.js +1 -1
  133. package/lib/utils/lossless-json.js +1 -1
  134. package/lib/utils/params.js +1 -1
  135. package/lib/utils/platform.js +1 -1
  136. package/lib/utils/update-notice.js +1 -1
  137. package/lib/utils/version.js +1 -1
  138. package/lib/utils/write-cli-side-channel.js +1 -1
  139. package/package.json +14 -3
  140. package/scripts/postinstall.mjs +24 -0
  141. package/skills/lovrabet/SKILL.md +702 -0
  142. package/skills/lovrabet/guides/app-resolution.md +165 -0
  143. package/skills/lovrabet/guides/dataset-and-data-workflow.md +170 -0
  144. package/skills/lovrabet/guides/sql-and-bff-workflow.md +132 -0
  145. package/skills/lovrabet/guides/troubleshooting.md +91 -0
  146. package/skills/lovrabet/references/dataset-discovery-workflow.md +160 -0
  147. package/skills/lovrabet/references/instant-api-workflow.md +259 -0
  148. package/skills/lovrabet/references/lovrabet-app-config.md +51 -0
  149. package/skills/lovrabet/references/lovrabet-app.md +113 -0
  150. package/skills/lovrabet/references/lovrabet-auth.md +136 -0
  151. package/skills/lovrabet/references/lovrabet-bff-workflow.md +139 -0
  152. package/skills/lovrabet/references/lovrabet-config-commands.md +104 -0
  153. package/skills/lovrabet/references/lovrabet-config.md +124 -0
  154. package/skills/lovrabet/references/lovrabet-doctor.md +26 -0
  155. package/skills/lovrabet/references/lovrabet-file-workflow.md +62 -0
  156. package/skills/lovrabet/references/lovrabet-kb-workflow.md +78 -0
  157. package/skills/lovrabet/references/lovrabet-logs.md +19 -0
  158. package/skills/lovrabet/references/lovrabet-ocr-workflow.md +83 -0
  159. package/skills/lovrabet/references/lovrabet-output-format-jq.md +40 -0
  160. package/skills/lovrabet/references/lovrabet-personal-bff-workflow.md +108 -0
  161. package/skills/lovrabet/references/lovrabet-schedule-workflow.md +175 -0
  162. package/skills/lovrabet/references/lovrabet-service-tree.md +279 -0
  163. package/skills/lovrabet/references/lovrabet-skill-authoring.md +128 -0
  164. package/skills/lovrabet/references/lovrabet-skill-install.md +34 -0
  165. package/skills/lovrabet/references/lovrabet-skill-sync.md +146 -0
  166. package/skills/lovrabet/references/lovrabet-sql-workflow.md +111 -0
  167. package/skills/lovrabet/references/lovrabet-update.md +34 -0
  168. package/skills/lovrabet/references/lovrabet-workspace.md +82 -0
  169. package/skills/lovrabet.manifest.json +38 -0
@@ -1 +1 @@
1
- const a111_0x4ef7e3=a111_0x311e;(function(_0x53bcce,_0x2ae1bb){const _0x12635e=a111_0x311e,_0x5d09ce=_0x53bcce();while(!![]){try{const _0x2310e0=parseInt(_0x12635e(0x11b))/0x1+parseInt(_0x12635e(0x110))/0x2*(-parseInt(_0x12635e(0x146))/0x3)+parseInt(_0x12635e(0x12a))/0x4*(parseInt(_0x12635e(0x11f))/0x5)+-parseInt(_0x12635e(0x139))/0x6+-parseInt(_0x12635e(0x10e))/0x7*(-parseInt(_0x12635e(0x116))/0x8)+-parseInt(_0x12635e(0x127))/0x9*(parseInt(_0x12635e(0x117))/0xa)+parseInt(_0x12635e(0x13a))/0xb;if(_0x2310e0===_0x2ae1bb)break;else _0x5d09ce['push'](_0x5d09ce['shift']());}catch(_0x18cc1c){_0x5d09ce['push'](_0x5d09ce['shift']());}}}(a111_0x3f1b,0x24cbe));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import a111_0x45d3f0 from'fs-extra';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';import{isDanglingSymlink,isPathInside,lstatIfPresent,realOrResolved,resolveSymlinkTarget}from'./fs-utils.js';import{readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillCacheRoot,resolveSkillSyncPaths,safePathSegment}from'./paths.js';function a111_0x311e(_0x4e7588,_0x2f4a89){_0x4e7588=_0x4e7588-0x10c;const _0x3f1bf5=a111_0x3f1b();let _0x311e19=_0x3f1bf5[_0x4e7588];return _0x311e19;}const {copySync,ensureDirSync,removeSync}=a111_0x45d3f0,RESERVED_PROJECT_SKILL_CODES=new Set([a111_0x4ef7e3(0x144),a111_0x4ef7e3(0x145),'secret-retriever']);export function linkEffectiveRuntimeSkills(_0x5a7d86,_0x1f1f13){const _0x3a8d4c=a111_0x4ef7e3,_0x2a7034=new Map();for(const _0x9468e8 of _0x5a7d86){const _0x5a1496=_0x9468e8['skill'][_0x3a8d4c(0x11e)];if(!_0x5a1496)continue;const _0x2ca0bc=_0x2a7034[_0x3a8d4c(0x120)](_0x5a1496);(!_0x2ca0bc||_0x9468e8['scope']==='personal')&&_0x2a7034[_0x3a8d4c(0x129)](_0x5a1496,_0x9468e8);}const _0x4351b4=[];for(const _0x429492 of _0x2a7034['values']()){const _0x36ef89=requireSkillCode(_0x429492[_0x3a8d4c(0x131)]),_0x2a7e34=readMetadataIfPresent(_0x429492['metadataPath']);if(_0x2a7e34?.[_0x3a8d4c(0x13c)]!==_0x1f1f13[_0x3a8d4c(0x13c)]||_0x2a7e34['skillCode']!==_0x36ef89)throw CliErrors['validation'](_0x3a8d4c(0x11d)+_0x1f1f13[_0x3a8d4c(0x13c)]+':\x20'+_0x429492[_0x3a8d4c(0x121)]);const _0x2ce2e5=runtimeSkillLinkName(_0x1f1f13,_0x36ef89);for(const _0x21987c of _0x1f1f13[_0x3a8d4c(0x149)]){_0x4351b4['push'](ensureManagedSymlink(resolve(_0x21987c,_0x2ce2e5),_0x429492[_0x3a8d4c(0x14b)],_0x1f1f13,_0x36ef89));}}return _0x4351b4;}export function pruneStaleRuntimeSkillLinks(_0xc14f8a,_0xd6b08c,_0x4fac51){const _0x994788=a111_0x4ef7e3,_0x2fa759=new Set([..._0xd6b08c][_0x994788(0x111)](_0x1a2db6=>_0x1a2db6[_0x994788(0x10c)]())['filter'](Boolean)),_0x343d1a=_0x4fac51?new Set([..._0x4fac51][_0x994788(0x111)](_0x19c687=>_0x19c687[_0x994788(0x10c)]())['filter'](Boolean)):undefined,_0x9e7a36=[];for(const _0x2abfef of _0xc14f8a['skillRoots']){for(const _0x527e65 of managedTargetSkillLinkPaths(_0x2abfef,_0xc14f8a)){const _0x2b3017=runtimeSkillCodeFromLink(_0xc14f8a,_0x527e65);if(_0x343d1a&&!_0x343d1a[_0x994788(0x113)](_0x2b3017))continue;if(_0x2fa759['has'](_0x2b3017))continue;_0x9e7a36[_0x994788(0x142)](removeManagedSkillLink(_0x527e65,_0xc14f8a,_0x2b3017));}}return _0x9e7a36;}export function pruneStaleRuntimeSkillCache(_0x79a07d,_0x348f1a={}){const _0x32d92c=a111_0x4ef7e3,_0x27a803=new Set([..._0x79a07d[_0x32d92c(0x126)]][_0x32d92c(0x111)](_0x2ffab9=>_0x2ffab9[_0x32d92c(0x10c)]())['filter'](Boolean)),_0xb89967=_0x79a07d[_0x32d92c(0x125)]?new Set([..._0x79a07d[_0x32d92c(0x125)]][_0x32d92c(0x111)](_0x5dd440=>_0x5dd440[_0x32d92c(0x10c)]())[_0x32d92c(0x13f)](Boolean)):undefined,_0x162076=_0x79a07d[_0x32d92c(0x118)]??[_0x32d92c(0x135),'company'],_0x380175=resolve(getRuntimeSkillCacheRoot(_0x79a07d[_0x32d92c(0x148)],_0x79a07d['accessKey'],_0x348f1a),safePathSegment(_0x79a07d['appCode'],_0x32d92c(0x13c))),_0x4860e1=[];for(const _0x13e4fb of _0x162076){const _0x2cebe1=resolve(_0x380175,_0x13e4fb);if(!existsSync(_0x2cebe1))continue;for(const _0x160f4d of readdirSync(_0x2cebe1,{'withFileTypes':!![]})){if(!_0x160f4d[_0x32d92c(0x10f)]())continue;const _0x321743=_0x160f4d['name'];if(_0xb89967&&!_0xb89967[_0x32d92c(0x113)](_0x321743))continue;if(_0x27a803[_0x32d92c(0x113)](_0x321743))continue;const _0x3aee34=resolve(_0x2cebe1,_0x321743),_0x3dfc7e=readMetadataIfPresent(resolve(_0x3aee34,METADATA_FILE));if(_0x3dfc7e?.[_0x32d92c(0x13c)]!==_0x79a07d[_0x32d92c(0x13c)]||_0x3dfc7e[_0x32d92c(0x124)]!==_0x13e4fb||_0x3dfc7e['skillCode']!==_0x321743){_0x4860e1[_0x32d92c(0x142)]({'path':_0x3aee34,'action':_0x32d92c(0x12b),'reason':_0x32d92c(0x11a)});continue;}if(isLinkedFromAnyRoot(_0x3aee34,_0x79a07d[_0x32d92c(0x137)]??[])){_0x4860e1[_0x32d92c(0x142)]({'path':_0x3aee34,'action':_0x32d92c(0x12b),'reason':_0x32d92c(0x13d)});continue;}removeSync(_0x3aee34),_0x4860e1[_0x32d92c(0x142)]({'path':_0x3aee34,'action':_0x32d92c(0x141)});}}return _0x4860e1;}export function linkGlobalRuntimeSkills(_0x1f5f88,_0x5b5e9f={}){const _0x52a389=a111_0x4ef7e3,_0x1df583=resolveSkillSyncPaths(_0x5b5e9f),_0x2b30fc=[];for(const _0x5aa613 of _0x1f5f88){if(_0x5aa613[_0x52a389(0x124)]!==_0x52a389(0x130))throw CliErrors[_0x52a389(0x114)](_0x52a389(0x12f)+_0x5aa613['scope']);const _0xebf498=requireSkillCode(_0x5aa613[_0x52a389(0x131)]),_0xc7a820=copyManagedSkillDirectory(_0x5aa613[_0x52a389(0x14b)],resolve(_0x1df583[_0x52a389(0x136)],_0xebf498));_0x2b30fc['push']({..._0xc7a820,'contentHash':_0x5aa613[_0x52a389(0x119)]});}return _0x2b30fc;}function ensureManagedSymlink(_0x215a8b,_0x1c794b,_0x26057f,_0x3527fc){const _0x2f1194=a111_0x4ef7e3;mkdirSync(dirname(_0x215a8b),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x215a8b)||isDanglingSymlink(_0x215a8b)){const _0x3c3b5d=lstatSync(_0x215a8b);if(!_0x3c3b5d['isSymbolicLink']())throw CliErrors[_0x2f1194(0x114)](_0x2f1194(0x138)+_0x215a8b);const _0x620aa=resolveSymlinkTarget(_0x215a8b);if(!isPathInside(realOrResolved(_0x620aa),realOrResolved(_0x26057f[_0x2f1194(0x12d)])))throw CliErrors['validation'](_0x2f1194(0x122)+_0x215a8b);if(realOrResolved(_0x620aa)===realOrResolved(_0x1c794b))return{'path':_0x215a8b,'target':_0x1c794b,'action':'unchanged'};const _0x4ae89c=readMetadataIfPresent(resolve(_0x620aa,METADATA_FILE));if(_0x26057f['scope']===_0x2f1194(0x134)&&(_0x4ae89c?.[_0x2f1194(0x13c)]!==_0x26057f[_0x2f1194(0x13c)]||_0x4ae89c[_0x2f1194(0x11e)]!==_0x3527fc))throw CliErrors['validation'](_0x2f1194(0x115)+_0x215a8b);return unlinkSync(_0x215a8b),symlinkSync(_0x1c794b,_0x215a8b,'dir'),{'path':_0x215a8b,'target':_0x1c794b,'action':_0x2f1194(0x123)};}return symlinkSync(_0x1c794b,_0x215a8b,_0x2f1194(0x14b)),{'path':_0x215a8b,'target':_0x1c794b,'action':_0x2f1194(0x13b)};}function a111_0x3f1b(){const _0x58c42f=['updated','scope','pruneSkillCodes','activeSkillCodes','18uIHzaf','Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20','set','36184XrTpDj','skipped','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20','managedRoot','not-managed-symlink','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','builtin','skill','Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20','external-symlink','project','personal','agentsSkillsDir','protectedLinkRoots','Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20','568440hDvOqg','4877004CxAVxv','created','appCode','linked-from-protected-root','Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20','filter','name','removed','push','length','lovrabet','runtime-observe','3OljNBW','Refusing\x20to\x20copy\x20Skill\x20symlink:\x20','env','skillRoots','slice','dir','trim','startsWith','33089uNAAai','isDirectory','460802iQcPPk','map','isSymbolicLink','has','validation','Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20','232kviwOU','1409020adeiHY','scopes','contentHash','metadata-mismatch','32480RwtzYT','unchanged','Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20','skillCode','80uPMMhD','get','metadataPath','Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20'];a111_0x3f1b=function(){return _0x58c42f;};return a111_0x3f1b();}function managedTargetSkillLinkPaths(_0x5c8933,_0x4b528a){const _0x5b0ff6=a111_0x4ef7e3;if(!existsSync(_0x5c8933))return[];const _0x5aad49=_0x4b528a['appCode']+'--';return readdirSync(_0x5c8933,{'withFileTypes':!![]})[_0x5b0ff6(0x13f)](_0x2cceb2=>_0x4b528a[_0x5b0ff6(0x124)]===_0x5b0ff6(0x134)||_0x2cceb2[_0x5b0ff6(0x140)][_0x5b0ff6(0x10d)](_0x5aad49))['map'](_0x3ac82c=>resolve(_0x5c8933,_0x3ac82c[_0x5b0ff6(0x140)]));}function removeManagedSkillLink(_0xadac75,_0x56787f,_0xb5526){const _0x50dbd2=a111_0x4ef7e3,_0x465960=lstatIfPresent(_0xadac75);if(!_0x465960?.[_0x50dbd2(0x112)]())return{'path':_0xadac75,'action':_0x50dbd2(0x12b),'reason':_0x50dbd2(0x12e)};const _0x3262dd=resolveSymlinkTarget(_0xadac75);if(!isPathInside(realOrResolved(_0x3262dd),realOrResolved(_0x56787f[_0x50dbd2(0x12d)])))return{'path':_0xadac75,'action':_0x50dbd2(0x12b),'reason':_0x50dbd2(0x133)};const _0x18fd26=readMetadataIfPresent(resolve(_0x3262dd,METADATA_FILE));if(_0x56787f[_0x50dbd2(0x124)]===_0x50dbd2(0x134)&&(_0x18fd26?.[_0x50dbd2(0x13c)]!==_0x56787f[_0x50dbd2(0x13c)]||_0x18fd26['skillCode']!==_0xb5526))return{'path':_0xadac75,'action':_0x50dbd2(0x12b),'reason':_0x50dbd2(0x11a)};return unlinkSync(_0xadac75),{'path':_0xadac75,'action':'removed'};}function isLinkedFromAnyRoot(_0x382151,_0x36f5d5){const _0x1bdf1a=a111_0x4ef7e3,_0x274920=realOrResolved(_0x382151);for(const _0x4333a5 of _0x36f5d5){if(!existsSync(_0x4333a5))continue;for(const _0x192588 of readdirSync(_0x4333a5,{'withFileTypes':!![]})){if(!_0x192588[_0x1bdf1a(0x112)]())continue;const _0x42857c=resolve(_0x4333a5,_0x192588[_0x1bdf1a(0x140)]);if(realOrResolved(resolveSymlinkTarget(_0x42857c))===_0x274920)return!![];}}return![];}function runtimeSkillLinkName(_0x379c16,_0x1b2579){const _0x3b04bf=a111_0x4ef7e3,_0x585986=safePathSegment(_0x1b2579,_0x3b04bf(0x11e));if(_0x379c16[_0x3b04bf(0x124)]===_0x3b04bf(0x134)&&RESERVED_PROJECT_SKILL_CODES['has'](_0x585986))throw CliErrors['validation'](_0x3b04bf(0x132)+_0x585986);return _0x379c16[_0x3b04bf(0x124)]===_0x3b04bf(0x134)?_0x585986:_0x379c16[_0x3b04bf(0x13c)]+'--'+_0x585986;}function runtimeSkillCodeFromLink(_0xeca8be,_0xa057bf){const _0xb5242a=a111_0x4ef7e3,_0xaa2a15=basename(_0xa057bf);return _0xeca8be['scope']===_0xb5242a(0x134)?_0xaa2a15:_0xaa2a15[_0xb5242a(0x14a)]((_0xeca8be['appCode']+'--')[_0xb5242a(0x143)]);}export function copyManagedSkillDirectory(_0x4fd3f8,_0x369d96){const _0x32e8e0=a111_0x4ef7e3,_0x5a4ed0=resolve(_0x369d96,METADATA_FILE),_0x26f4eb=existsSync(_0x369d96);if(_0x26f4eb){const _0x4247c0=lstatSync(_0x369d96);if(_0x4247c0[_0x32e8e0(0x112)]())throw CliErrors[_0x32e8e0(0x114)](_0x32e8e0(0x128)+_0x369d96);if(!_0x4247c0[_0x32e8e0(0x10f)]())throw CliErrors['validation'](_0x32e8e0(0x13e)+_0x369d96);const _0x573877=readMetadataIfPresent(_0x5a4ed0);if(_0x573877?.[_0x32e8e0(0x124)]!==_0x32e8e0(0x130))throw CliErrors[_0x32e8e0(0x114)](_0x32e8e0(0x12c)+_0x369d96);}ensureDirSync(dirname(_0x369d96));const _0x410754=_0x26f4eb?readMetadataIfPresent(_0x5a4ed0)?.['contentHash']:undefined,_0x56c5c3=readMetadataIfPresent(resolve(_0x4fd3f8,METADATA_FILE))?.[_0x32e8e0(0x119)];return _0x26f4eb&&removeSync(_0x369d96),copySkillDirectory(_0x4fd3f8,_0x369d96),{'path':_0x369d96,'target':_0x4fd3f8,'action':!_0x26f4eb?_0x32e8e0(0x13b):_0x410754===_0x56c5c3?_0x32e8e0(0x11c):_0x32e8e0(0x123)};}function copySkillDirectory(_0x5db7b2,_0x1cda64){copySync(_0x5db7b2,_0x1cda64,{'dereference':![],'overwrite':!![],'filter'(_0x298dc4){const _0x1a34e3=a111_0x311e;if(lstatSync(_0x298dc4)[_0x1a34e3(0x112)]())throw CliErrors['validation'](_0x1a34e3(0x147)+_0x298dc4);return!![];}});}
1
+ const a113_0x3603d9=a113_0x5831;(function(_0x361219,_0xf977a2){const _0x1c8ec5=a113_0x5831,_0x9d539c=_0x361219();while(!![]){try{const _0xc327f0=parseInt(_0x1c8ec5(0x1dd))/0x1+parseInt(_0x1c8ec5(0x1f1))/0x2*(-parseInt(_0x1c8ec5(0x1fa))/0x3)+-parseInt(_0x1c8ec5(0x1f0))/0x4*(-parseInt(_0x1c8ec5(0x1f2))/0x5)+-parseInt(_0x1c8ec5(0x1ec))/0x6*(-parseInt(_0x1c8ec5(0x1c1))/0x7)+-parseInt(_0x1c8ec5(0x1cd))/0x8*(-parseInt(_0x1c8ec5(0x1d7))/0x9)+-parseInt(_0x1c8ec5(0x1c6))/0xa*(-parseInt(_0x1c8ec5(0x1f3))/0xb)+-parseInt(_0x1c8ec5(0x1e2))/0xc*(parseInt(_0x1c8ec5(0x1ea))/0xd);if(_0xc327f0===_0xf977a2)break;else _0x9d539c['push'](_0x9d539c['shift']());}catch(_0x33d95b){_0x9d539c['push'](_0x9d539c['shift']());}}}(a113_0x23f7,0xc4a3f));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import a113_0x52b4ad from'fs-extra';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';import{isDanglingSymlink,isPathInside,lstatIfPresent,realOrResolved,resolveSymlinkTarget}from'./fs-utils.js';import{readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillCacheRoot,resolveSkillSyncPaths,safePathSegment}from'./paths.js';const {copySync,ensureDirSync,removeSync}=a113_0x52b4ad,RESERVED_PROJECT_SKILL_CODES=new Set(['lovrabet',a113_0x3603d9(0x1f9),a113_0x3603d9(0x1fc)]);export function linkEffectiveRuntimeSkills(_0x4e7344,_0x1805ee){const _0x537dc7=a113_0x3603d9,_0xb04ce1=new Map();for(const _0x4656fa of _0x4e7344){const _0x4e15ef=_0x4656fa[_0x537dc7(0x1c7)][_0x537dc7(0x1df)];if(!_0x4e15ef)continue;const _0x3c6b08=_0xb04ce1[_0x537dc7(0x1d6)](_0x4e15ef);(!_0x3c6b08||_0x4656fa[_0x537dc7(0x1d9)]===_0x537dc7(0x1c8))&&_0xb04ce1['set'](_0x4e15ef,_0x4656fa);}const _0x230613=[];for(const _0x170fcd of _0xb04ce1['values']()){const _0xb7aa97=requireSkillCode(_0x170fcd[_0x537dc7(0x1c7)]),_0x54ad65=readMetadataIfPresent(_0x170fcd['metadataPath']);if(_0x54ad65?.[_0x537dc7(0x1e9)]!==_0x1805ee['appCode']||_0x54ad65['skillCode']!==_0xb7aa97)throw CliErrors[_0x537dc7(0x1cc)](_0x537dc7(0x1c5)+_0x1805ee[_0x537dc7(0x1e9)]+':\x20'+_0x170fcd[_0x537dc7(0x1eb)]);const _0x227c58=runtimeSkillLinkName(_0x1805ee,_0xb7aa97);for(const _0x286901 of _0x1805ee[_0x537dc7(0x1e3)]){_0x230613[_0x537dc7(0x1f5)](ensureManagedSymlink(resolve(_0x286901,_0x227c58),_0x170fcd['dir'],_0x1805ee,_0xb7aa97));}}return _0x230613;}function a113_0x5831(_0x5d7664,_0x2fbbb3){_0x5d7664=_0x5d7664-0x1c0;const _0x23f7a3=a113_0x23f7();let _0x5831b2=_0x23f7a3[_0x5d7664];return _0x5831b2;}export function pruneStaleRuntimeSkillLinks(_0x32d4c7,_0x2f0281,_0x19902a){const _0x13e788=a113_0x3603d9,_0x19ed73=new Set([..._0x2f0281][_0x13e788(0x1ee)](_0x354ca1=>_0x354ca1[_0x13e788(0x1c3)]())[_0x13e788(0x1ef)](Boolean)),_0xc8ff5d=_0x19902a?new Set([..._0x19902a][_0x13e788(0x1ee)](_0x3780c3=>_0x3780c3[_0x13e788(0x1c3)]())[_0x13e788(0x1ef)](Boolean)):undefined,_0x3fd5ff=[];for(const _0x29cfc6 of _0x32d4c7['skillRoots']){for(const _0x4c416f of managedTargetSkillLinkPaths(_0x29cfc6,_0x32d4c7)){const _0x11e32f=runtimeSkillCodeFromLink(_0x32d4c7,_0x4c416f);if(_0xc8ff5d&&!_0xc8ff5d[_0x13e788(0x1d2)](_0x11e32f))continue;if(_0x19ed73[_0x13e788(0x1d2)](_0x11e32f))continue;_0x3fd5ff[_0x13e788(0x1f5)](removeManagedSkillLink(_0x4c416f,_0x32d4c7,_0x11e32f));}}return _0x3fd5ff;}export function pruneStaleRuntimeSkillCache(_0x163a09,_0x4e32e4={}){const _0x2ee313=a113_0x3603d9,_0x1a1ec4=new Set([..._0x163a09[_0x2ee313(0x1f6)]][_0x2ee313(0x1ee)](_0x1e67f2=>_0x1e67f2[_0x2ee313(0x1c3)]())['filter'](Boolean)),_0x197565=_0x163a09[_0x2ee313(0x1cb)]?new Set([..._0x163a09[_0x2ee313(0x1cb)]][_0x2ee313(0x1ee)](_0x306012=>_0x306012[_0x2ee313(0x1c3)]())[_0x2ee313(0x1ef)](Boolean)):undefined,_0x5cbc14=_0x163a09[_0x2ee313(0x1da)]??['personal','company'],_0x147317=resolve(getRuntimeSkillCacheRoot(_0x163a09[_0x2ee313(0x1f8)],_0x163a09['accessKey'],_0x4e32e4),safePathSegment(_0x163a09['appCode'],_0x2ee313(0x1e9))),_0x4935b0=[];for(const _0x3a1c77 of _0x5cbc14){const _0xfbcc8c=resolve(_0x147317,_0x3a1c77);if(!existsSync(_0xfbcc8c))continue;for(const _0xcac696 of readdirSync(_0xfbcc8c,{'withFileTypes':!![]})){if(!_0xcac696[_0x2ee313(0x1d3)]())continue;const _0x452499=_0xcac696[_0x2ee313(0x1fb)];if(_0x197565&&!_0x197565[_0x2ee313(0x1d2)](_0x452499))continue;if(_0x1a1ec4[_0x2ee313(0x1d2)](_0x452499))continue;const _0x33dab3=resolve(_0xfbcc8c,_0x452499),_0x596356=readMetadataIfPresent(resolve(_0x33dab3,METADATA_FILE));if(_0x596356?.['appCode']!==_0x163a09[_0x2ee313(0x1e9)]||_0x596356[_0x2ee313(0x1d9)]!==_0x3a1c77||_0x596356[_0x2ee313(0x1df)]!==_0x452499){_0x4935b0[_0x2ee313(0x1f5)]({'path':_0x33dab3,'action':_0x2ee313(0x1dc),'reason':'metadata-mismatch'});continue;}if(isLinkedFromAnyRoot(_0x33dab3,_0x163a09[_0x2ee313(0x1de)]??[])){_0x4935b0[_0x2ee313(0x1f5)]({'path':_0x33dab3,'action':_0x2ee313(0x1dc),'reason':_0x2ee313(0x1fd)});continue;}removeSync(_0x33dab3),_0x4935b0[_0x2ee313(0x1f5)]({'path':_0x33dab3,'action':_0x2ee313(0x1d1)});}}return _0x4935b0;}export function linkGlobalRuntimeSkills(_0x3b6f,_0x483b27={}){const _0x5061a8=a113_0x3603d9,_0x579a09=resolveSkillSyncPaths(_0x483b27),_0x24bf12=[];for(const _0x22dbbf of _0x3b6f){if(_0x22dbbf['scope']!==_0x5061a8(0x1d5))throw CliErrors[_0x5061a8(0x1cc)](_0x5061a8(0x1db)+_0x22dbbf[_0x5061a8(0x1d9)]);const _0x2b6332=requireSkillCode(_0x22dbbf['skill']),_0xc312b6=copyManagedSkillDirectory(_0x22dbbf[_0x5061a8(0x1e8)],resolve(_0x579a09[_0x5061a8(0x1d4)],_0x2b6332));_0x24bf12[_0x5061a8(0x1f5)]({..._0xc312b6,'contentHash':_0x22dbbf[_0x5061a8(0x1e4)]});}return _0x24bf12;}function ensureManagedSymlink(_0x13c1bb,_0x344601,_0x513f51,_0x3c7b72){const _0x4cfce0=a113_0x3603d9;mkdirSync(dirname(_0x13c1bb),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x13c1bb)||isDanglingSymlink(_0x13c1bb)){const _0x57d972=lstatSync(_0x13c1bb);if(!_0x57d972[_0x4cfce0(0x1f7)]())throw CliErrors['validation'](_0x4cfce0(0x1e1)+_0x13c1bb);const _0xff66fb=resolveSymlinkTarget(_0x13c1bb);if(!isPathInside(realOrResolved(_0xff66fb),realOrResolved(_0x513f51[_0x4cfce0(0x1ed)])))throw CliErrors[_0x4cfce0(0x1cc)](_0x4cfce0(0x1d0)+_0x13c1bb);if(realOrResolved(_0xff66fb)===realOrResolved(_0x344601))return{'path':_0x13c1bb,'target':_0x344601,'action':_0x4cfce0(0x1c2)};const _0x11fa96=readMetadataIfPresent(resolve(_0xff66fb,METADATA_FILE));if(_0x513f51[_0x4cfce0(0x1d9)]===_0x4cfce0(0x1e6)&&(_0x11fa96?.[_0x4cfce0(0x1e9)]!==_0x513f51[_0x4cfce0(0x1e9)]||_0x11fa96[_0x4cfce0(0x1df)]!==_0x3c7b72))throw CliErrors['validation'](_0x4cfce0(0x1c0)+_0x13c1bb);return unlinkSync(_0x13c1bb),symlinkSync(_0x344601,_0x13c1bb,_0x4cfce0(0x1e8)),{'path':_0x13c1bb,'target':_0x344601,'action':'updated'};}return symlinkSync(_0x344601,_0x13c1bb,'dir'),{'path':_0x13c1bb,'target':_0x344601,'action':'created'};}function managedTargetSkillLinkPaths(_0x50acc4,_0xa9bfdf){const _0xcc7711=a113_0x3603d9;if(!existsSync(_0x50acc4))return[];const _0x48f566=_0xa9bfdf['appCode']+'--';return readdirSync(_0x50acc4,{'withFileTypes':!![]})[_0xcc7711(0x1ef)](_0xcc9199=>_0xa9bfdf['scope']===_0xcc7711(0x1e6)||_0xcc9199[_0xcc7711(0x1fb)][_0xcc7711(0x1c9)](_0x48f566))[_0xcc7711(0x1ee)](_0x51f6f0=>resolve(_0x50acc4,_0x51f6f0['name']));}function a113_0x23f7(){const _0x486dff=['26dBnHhC','metadataPath','18wOLcsd','managedRoot','map','filter','1290396zQFomG','2CUtFXk','5lskQiB','55tbApvi','Refusing\x20to\x20copy\x20Skill\x20symlink:\x20','push','activeSkillCodes','isSymbolicLink','env','runtime-observe','1960611KQjjXN','name','secret-retriever','linked-from-protected-root','Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20','3152401YXgDEf','unchanged','trim','not-managed-symlink','Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20','2830370lDvJlB','skill','personal','startsWith','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20','pruneSkillCodes','validation','10599088BosTin','Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20','metadata-mismatch','Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20','removed','has','isDirectory','agentsSkillsDir','builtin','get','9bBWTfM','created','scope','scopes','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','skipped','120887qNgKNd','protectedLinkRoots','skillCode','slice','Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20','18453660WDsbwe','skillRoots','contentHash','external-symlink','project','length','dir','appCode'];a113_0x23f7=function(){return _0x486dff;};return a113_0x23f7();}function removeManagedSkillLink(_0x1e393d,_0x38114b,_0x21b593){const _0x29e7b8=a113_0x3603d9,_0x2edb4e=lstatIfPresent(_0x1e393d);if(!_0x2edb4e?.[_0x29e7b8(0x1f7)]())return{'path':_0x1e393d,'action':'skipped','reason':_0x29e7b8(0x1c4)};const _0x296670=resolveSymlinkTarget(_0x1e393d);if(!isPathInside(realOrResolved(_0x296670),realOrResolved(_0x38114b[_0x29e7b8(0x1ed)])))return{'path':_0x1e393d,'action':_0x29e7b8(0x1dc),'reason':_0x29e7b8(0x1e5)};const _0x54a168=readMetadataIfPresent(resolve(_0x296670,METADATA_FILE));if(_0x38114b['scope']===_0x29e7b8(0x1e6)&&(_0x54a168?.['appCode']!==_0x38114b[_0x29e7b8(0x1e9)]||_0x54a168['skillCode']!==_0x21b593))return{'path':_0x1e393d,'action':_0x29e7b8(0x1dc),'reason':_0x29e7b8(0x1cf)};return unlinkSync(_0x1e393d),{'path':_0x1e393d,'action':_0x29e7b8(0x1d1)};}function isLinkedFromAnyRoot(_0xe15920,_0x2c977b){const _0x525759=a113_0x3603d9,_0x509d0a=realOrResolved(_0xe15920);for(const _0x2c5682 of _0x2c977b){if(!existsSync(_0x2c5682))continue;for(const _0x3eefc9 of readdirSync(_0x2c5682,{'withFileTypes':!![]})){if(!_0x3eefc9[_0x525759(0x1f7)]())continue;const _0x5e9e9a=resolve(_0x2c5682,_0x3eefc9[_0x525759(0x1fb)]);if(realOrResolved(resolveSymlinkTarget(_0x5e9e9a))===_0x509d0a)return!![];}}return![];}function runtimeSkillLinkName(_0x1cba9c,_0x32d2b8){const _0x1ba25b=a113_0x3603d9,_0x120e7c=safePathSegment(_0x32d2b8,_0x1ba25b(0x1df));if(_0x1cba9c[_0x1ba25b(0x1d9)]===_0x1ba25b(0x1e6)&&RESERVED_PROJECT_SKILL_CODES[_0x1ba25b(0x1d2)](_0x120e7c))throw CliErrors[_0x1ba25b(0x1cc)](_0x1ba25b(0x1ce)+_0x120e7c);return _0x1cba9c['scope']==='project'?_0x120e7c:_0x1cba9c[_0x1ba25b(0x1e9)]+'--'+_0x120e7c;}function runtimeSkillCodeFromLink(_0x5bf535,_0x1f437b){const _0x3c120b=a113_0x3603d9,_0x3d4e78=basename(_0x1f437b);return _0x5bf535['scope']===_0x3c120b(0x1e6)?_0x3d4e78:_0x3d4e78[_0x3c120b(0x1e0)]((_0x5bf535[_0x3c120b(0x1e9)]+'--')[_0x3c120b(0x1e7)]);}export function copyManagedSkillDirectory(_0x1d5363,_0x3adf83){const _0x2a65a2=a113_0x3603d9,_0x24ef4c=resolve(_0x3adf83,METADATA_FILE),_0x5178f7=existsSync(_0x3adf83);if(_0x5178f7){const _0x3fccf0=lstatSync(_0x3adf83);if(_0x3fccf0[_0x2a65a2(0x1f7)]())throw CliErrors[_0x2a65a2(0x1cc)]('Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20'+_0x3adf83);if(!_0x3fccf0[_0x2a65a2(0x1d3)]())throw CliErrors[_0x2a65a2(0x1cc)]('Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20'+_0x3adf83);const _0x411294=readMetadataIfPresent(_0x24ef4c);if(_0x411294?.[_0x2a65a2(0x1d9)]!==_0x2a65a2(0x1d5))throw CliErrors[_0x2a65a2(0x1cc)](_0x2a65a2(0x1ca)+_0x3adf83);}ensureDirSync(dirname(_0x3adf83));const _0x2796e8=_0x5178f7?readMetadataIfPresent(_0x24ef4c)?.[_0x2a65a2(0x1e4)]:undefined,_0x52b951=readMetadataIfPresent(resolve(_0x1d5363,METADATA_FILE))?.['contentHash'];return _0x5178f7&&removeSync(_0x3adf83),copySkillDirectory(_0x1d5363,_0x3adf83),{'path':_0x3adf83,'target':_0x1d5363,'action':!_0x5178f7?_0x2a65a2(0x1d8):_0x2796e8===_0x52b951?_0x2a65a2(0x1c2):'updated'};}function copySkillDirectory(_0x1106b6,_0x5005ab){copySync(_0x1106b6,_0x5005ab,{'dereference':![],'overwrite':!![],'filter'(_0x116a8f){const _0x2f5f7c=a113_0x5831;if(lstatSync(_0x116a8f)[_0x2f5f7c(0x1f7)]())throw CliErrors['validation'](_0x2f5f7c(0x1f4)+_0x116a8f);return!![];}});}
@@ -1 +1 @@
1
- (function(_0x443c72,_0x2d5713){const _0x4f0ab5=a112_0x5df0,_0x5c9007=_0x443c72();while(!![]){try{const _0x590ef5=-parseInt(_0x4f0ab5(0x139))/0x1*(-parseInt(_0x4f0ab5(0x11e))/0x2)+parseInt(_0x4f0ab5(0x112))/0x3+-parseInt(_0x4f0ab5(0x11a))/0x4*(-parseInt(_0x4f0ab5(0x116))/0x5)+parseInt(_0x4f0ab5(0x129))/0x6*(-parseInt(_0x4f0ab5(0x128))/0x7)+parseInt(_0x4f0ab5(0x12c))/0x8+-parseInt(_0x4f0ab5(0x11c))/0x9+parseInt(_0x4f0ab5(0x127))/0xa;if(_0x590ef5===_0x2d5713)break;else _0x5c9007['push'](_0x5c9007['shift']());}catch(_0x3013d4){_0x5c9007['push'](_0x5c9007['shift']());}}}(a112_0x31ee,0x2e937));function a112_0x5df0(_0x5bccf7,_0xf43273){_0x5bccf7=_0x5bccf7-0x10d;const _0x31ee42=a112_0x31ee();let _0x5df00f=_0x31ee42[_0x5bccf7];return _0x5df00f;}import{existsSync,readdirSync}from'node:fs';import{resolve}from'node:path';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{readMetadataIfPresent}from'./metadata.js';import{getRuntimeSkillCacheRoot,safePathSegment}from'./paths.js';import{isRuntimeSkillScope,normalizeRuntimeSkillScopes}from'./scopes.js';export function listLocalRuntimeSkills(_0x18ab20,_0x1de857,_0x59c771={}){const _0x5858bd=a112_0x5df0,_0x304bec=safePathSegment(_0x18ab20[_0x5858bd(0x130)],_0x5858bd(0x130));if(_0x1de857[_0x5858bd(0x130)]!==_0x304bec)throw CliErrors[_0x5858bd(0x12e)]('Runtime\x20Skill\x20install\x20target\x20app\x20mismatch:\x20'+_0x1de857[_0x5858bd(0x130)]+'\x20!=\x20'+_0x304bec);const _0x3f4dbe=normalizeRuntimeSkillScopes(_0x18ab20['scopes']),_0x5e876a=new Set(_0x3f4dbe),_0x4ef3eb=_0x18ab20['code']?.[_0x5858bd(0x119)](),_0x172f55=new Map(),_0x45c693=resolve(getRuntimeSkillCacheRoot(_0x18ab20[_0x5858bd(0x124)],_0x18ab20['accessKey'],_0x59c771),_0x304bec);for(const _0x447f17 of _0x3f4dbe){for(const _0x1f92b4 of localSkillEntryDirs(resolve(_0x45c693,_0x447f17))){collectLocalRuntimeSkill(_0x172f55,_0x1f92b4,{'appCode':_0x304bec,'scopes':_0x5e876a,'code':_0x4ef3eb,'source':'cache'});}}for(const _0xf283ec of _0x1de857[_0x5858bd(0x136)]){for(const _0x27dadb of localSkillLinkCandidates(_0xf283ec,_0x1de857,_0x5e876a)){collectLocalRuntimeSkill(_0x172f55,_0x27dadb,{'appCode':_0x304bec,'scopes':_0x5e876a,'code':_0x4ef3eb,'source':'link','linkedPath':_0x27dadb});}}return Array[_0x5858bd(0x115)](_0x172f55[_0x5858bd(0x118)]())[_0x5858bd(0x134)](compareLocalRuntimeSkills);}function localSkillEntryDirs(_0x25a8f4){const _0x5f5b53=a112_0x5df0;if(!existsSync(_0x25a8f4))return[];return readdirSync(_0x25a8f4,{'withFileTypes':!![]})[_0x5f5b53(0x12d)](_0x36d531=>_0x36d531['isDirectory']()||_0x36d531['isSymbolicLink']())[_0x5f5b53(0x131)](_0x5b5fa0=>resolve(_0x25a8f4,_0x5b5fa0[_0x5f5b53(0x122)]));}function a112_0x31ee(){const _0x55b094=['trim','39092bfZuLD','isDirectory','2818314YSuwxj','local','110566kotClr','project','linkedPaths','skillMdPath','name','scopes','env','cache','code','611830daWJru','74669sEnEWG','120ICOsGh','push','cacheDir','602784IrUoxT','filter','validation','set','appCode','map','linkedPath','isSymbolicLink','sort','dir','skillRoots','source','get','2Kpyqsx','scope','skillCode','has','tags','startsWith','1117302XpLxwr','metadataPath','includes','from','50qiOksR','isArray','values'];a112_0x31ee=function(){return _0x55b094;};return a112_0x31ee();}function localSkillLinkCandidates(_0x5b83d0,_0x58d5a3,_0x1ba748){const _0x59ae16=a112_0x5df0;if(!existsSync(_0x5b83d0))return[];const _0x3d6fd2=_0x58d5a3[_0x59ae16(0x130)]+'--';return readdirSync(_0x5b83d0,{'withFileTypes':!![]})[_0x59ae16(0x12d)](_0x2e587f=>_0x2e587f[_0x59ae16(0x11b)]()||_0x2e587f[_0x59ae16(0x133)]())[_0x59ae16(0x12d)](_0x1711f3=>_0x58d5a3[_0x59ae16(0x10d)]===_0x59ae16(0x11f)||_0x1711f3[_0x59ae16(0x122)][_0x59ae16(0x111)](_0x3d6fd2)||_0x1ba748[_0x59ae16(0x10f)]('builtin'))[_0x59ae16(0x131)](_0x4bf09f=>resolve(_0x5b83d0,_0x4bf09f[_0x59ae16(0x122)]));}function collectLocalRuntimeSkill(_0x500cdd,_0xaca0e4,_0xbe29f1){const _0x5ae4c2=a112_0x5df0,_0x50f163=resolve(_0xaca0e4,METADATA_FILE),_0x5701e3=readMetadataIfPresent(_0x50f163);if(!_0x5701e3)return;if(_0x5701e3[_0x5ae4c2(0x130)]!==_0xbe29f1[_0x5ae4c2(0x130)])return;if(!isRuntimeSkillScope(_0x5701e3[_0x5ae4c2(0x10d)])||!_0xbe29f1[_0x5ae4c2(0x123)]['has'](_0x5701e3['scope']))return;const _0x412e81=_0x5701e3[_0x5ae4c2(0x10e)]?.['trim']();if(!_0x412e81)return;if(_0xbe29f1[_0x5ae4c2(0x126)]&&_0x412e81!==_0xbe29f1[_0x5ae4c2(0x126)])return;const _0x6105d7=_0x5701e3[_0x5ae4c2(0x10d)]+':'+_0x412e81,_0x13cfa3=_0xbe29f1[_0x5ae4c2(0x132)]?[_0xbe29f1['linkedPath']]:[],_0x17b181=_0x500cdd[_0x5ae4c2(0x138)](_0x6105d7);if(_0x17b181){_0xbe29f1[_0x5ae4c2(0x137)]===_0x5ae4c2(0x125)&&(_0x17b181[_0x5ae4c2(0x135)]=_0xaca0e4,_0x17b181[_0x5ae4c2(0x12b)]=_0xaca0e4,_0x17b181[_0x5ae4c2(0x121)]=resolve(_0xaca0e4,SKILL_FILE),_0x17b181[_0x5ae4c2(0x113)]=_0x50f163);for(const _0x1fc1fd of _0x13cfa3){!_0x17b181[_0x5ae4c2(0x120)][_0x5ae4c2(0x114)](_0x1fc1fd)&&_0x17b181[_0x5ae4c2(0x120)][_0x5ae4c2(0x12a)](_0x1fc1fd);}_0x17b181['linkedPaths'][_0x5ae4c2(0x134)]();return;}_0x500cdd[_0x5ae4c2(0x12f)](_0x6105d7,{..._0x5701e3,'tags':Array[_0x5ae4c2(0x117)](_0x5701e3['tags'])?_0x5701e3[_0x5ae4c2(0x110)]:[],'scope':_0x5701e3['scope'],'source':_0x5ae4c2(0x11d),'dir':_0xaca0e4,'cacheDir':_0xbe29f1[_0x5ae4c2(0x137)]==='cache'?_0xaca0e4:undefined,'skillMdPath':resolve(_0xaca0e4,SKILL_FILE),'metadataPath':_0x50f163,'linkedPaths':_0x13cfa3});}function compareLocalRuntimeSkills(_0x54683b,_0xd8774f){const _0x5cb3ca=a112_0x5df0,_0x49a644={'personal':0x0,'company':0x1,'builtin':0x2};return _0x49a644[_0x54683b['scope']]-_0x49a644[_0xd8774f[_0x5cb3ca(0x10d)]]||_0x54683b[_0x5cb3ca(0x10e)]['localeCompare'](_0xd8774f[_0x5cb3ca(0x10e)])||_0x54683b[_0x5cb3ca(0x135)]['localeCompare'](_0xd8774f[_0x5cb3ca(0x135)]);}
1
+ (function(_0x51c4a3,_0x3f8fe6){const _0x2eab54=a114_0x35bf,_0x12a212=_0x51c4a3();while(!![]){try{const _0x3109ce=-parseInt(_0x2eab54(0x127))/0x1*(parseInt(_0x2eab54(0x109))/0x2)+parseInt(_0x2eab54(0x10b))/0x3*(-parseInt(_0x2eab54(0x12d))/0x4)+-parseInt(_0x2eab54(0x101))/0x5+-parseInt(_0x2eab54(0x124))/0x6*(-parseInt(_0x2eab54(0x112))/0x7)+parseInt(_0x2eab54(0x125))/0x8*(-parseInt(_0x2eab54(0x122))/0x9)+parseInt(_0x2eab54(0x110))/0xa*(parseInt(_0x2eab54(0x123))/0xb)+parseInt(_0x2eab54(0x118))/0xc*(parseInt(_0x2eab54(0x113))/0xd);if(_0x3109ce===_0x3f8fe6)break;else _0x12a212['push'](_0x12a212['shift']());}catch(_0x216901){_0x12a212['push'](_0x12a212['shift']());}}}(a114_0x58ba,0x18902));import{existsSync,readdirSync}from'node:fs';import{resolve}from'node:path';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{readMetadataIfPresent}from'./metadata.js';import{getRuntimeSkillCacheRoot,safePathSegment}from'./paths.js';import{isRuntimeSkillScope,normalizeRuntimeSkillScopes}from'./scopes.js';function a114_0x58ba(){const _0x1e7e18=['env','filter','local','get','skillRoots','metadataPath','name','project','1422621eklXRD','58949bBVAKe','6rdWKzn','8ELWjgc','skillMdPath','1sgEwpq','from','cache','skillCode','map','scope','41476IMkJdZ','Runtime\x20Skill\x20install\x20target\x20app\x20mismatch:\x20','builtin','localeCompare','360635iqhRYE','sort','startsWith','trim','dir','source','appCode','\x20!=\x20','238874mkCqMZ','tags','39eBYhIk','accessKey','code','isSymbolicLink','link','10UvOmxp','push','130431bizBDa','1261napuKm','isDirectory','linkedPath','scopes','isArray','69408Vbrvcw','linkedPaths'];a114_0x58ba=function(){return _0x1e7e18;};return a114_0x58ba();}export function listLocalRuntimeSkills(_0x618f59,_0x2d759a,_0x34f79d={}){const _0x2572af=a114_0x35bf,_0x4115d1=safePathSegment(_0x618f59['appCode'],_0x2572af(0x107));if(_0x2d759a[_0x2572af(0x107)]!==_0x4115d1)throw CliErrors['validation'](_0x2572af(0x12e)+_0x2d759a['appCode']+_0x2572af(0x108)+_0x4115d1);const _0x8381e1=normalizeRuntimeSkillScopes(_0x618f59['scopes']),_0x8429fb=new Set(_0x8381e1),_0x5c8999=_0x618f59[_0x2572af(0x10d)]?.['trim'](),_0x4628ef=new Map(),_0x1339c5=resolve(getRuntimeSkillCacheRoot(_0x618f59[_0x2572af(0x11a)],_0x618f59[_0x2572af(0x10c)],_0x34f79d),_0x4115d1);for(const _0x5aa882 of _0x8381e1){for(const _0xff5e08 of localSkillEntryDirs(resolve(_0x1339c5,_0x5aa882))){collectLocalRuntimeSkill(_0x4628ef,_0xff5e08,{'appCode':_0x4115d1,'scopes':_0x8429fb,'code':_0x5c8999,'source':_0x2572af(0x129)});}}for(const _0x1d1a34 of _0x2d759a[_0x2572af(0x11e)]){for(const _0x2cacfb of localSkillLinkCandidates(_0x1d1a34,_0x2d759a,_0x8429fb)){collectLocalRuntimeSkill(_0x4628ef,_0x2cacfb,{'appCode':_0x4115d1,'scopes':_0x8429fb,'code':_0x5c8999,'source':_0x2572af(0x10f),'linkedPath':_0x2cacfb});}}return Array[_0x2572af(0x128)](_0x4628ef['values']())[_0x2572af(0x102)](compareLocalRuntimeSkills);}function localSkillEntryDirs(_0x25af8f){const _0x582209=a114_0x35bf;if(!existsSync(_0x25af8f))return[];return readdirSync(_0x25af8f,{'withFileTypes':!![]})[_0x582209(0x11b)](_0x2680f3=>_0x2680f3[_0x582209(0x114)]()||_0x2680f3[_0x582209(0x10e)]())[_0x582209(0x12b)](_0x417f91=>resolve(_0x25af8f,_0x417f91[_0x582209(0x120)]));}function a114_0x35bf(_0x4580d9,_0x548cb4){_0x4580d9=_0x4580d9-0xff;const _0x58ba42=a114_0x58ba();let _0x35bff2=_0x58ba42[_0x4580d9];return _0x35bff2;}function localSkillLinkCandidates(_0x36f036,_0x9e96cb,_0x57a4e7){const _0x58d483=a114_0x35bf;if(!existsSync(_0x36f036))return[];const _0x295b3e=_0x9e96cb[_0x58d483(0x107)]+'--';return readdirSync(_0x36f036,{'withFileTypes':!![]})[_0x58d483(0x11b)](_0x1ad2b7=>_0x1ad2b7[_0x58d483(0x114)]()||_0x1ad2b7[_0x58d483(0x10e)]())[_0x58d483(0x11b)](_0x214b7d=>_0x9e96cb[_0x58d483(0x12c)]===_0x58d483(0x121)||_0x214b7d['name'][_0x58d483(0x103)](_0x295b3e)||_0x57a4e7['has'](_0x58d483(0xff)))['map'](_0x513004=>resolve(_0x36f036,_0x513004[_0x58d483(0x120)]));}function collectLocalRuntimeSkill(_0x1e0e0f,_0x195132,_0x19d0c6){const _0x4a1023=a114_0x35bf,_0x2918df=resolve(_0x195132,METADATA_FILE),_0x4506a6=readMetadataIfPresent(_0x2918df);if(!_0x4506a6)return;if(_0x4506a6[_0x4a1023(0x107)]!==_0x19d0c6[_0x4a1023(0x107)])return;if(!isRuntimeSkillScope(_0x4506a6[_0x4a1023(0x12c)])||!_0x19d0c6[_0x4a1023(0x116)]['has'](_0x4506a6[_0x4a1023(0x12c)]))return;const _0x22949a=_0x4506a6[_0x4a1023(0x12a)]?.[_0x4a1023(0x104)]();if(!_0x22949a)return;if(_0x19d0c6[_0x4a1023(0x10d)]&&_0x22949a!==_0x19d0c6[_0x4a1023(0x10d)])return;const _0x1332a5=_0x4506a6[_0x4a1023(0x12c)]+':'+_0x22949a,_0x52cd80=_0x19d0c6[_0x4a1023(0x115)]?[_0x19d0c6[_0x4a1023(0x115)]]:[],_0x350f2e=_0x1e0e0f[_0x4a1023(0x11d)](_0x1332a5);if(_0x350f2e){_0x19d0c6[_0x4a1023(0x106)]==='cache'&&(_0x350f2e[_0x4a1023(0x105)]=_0x195132,_0x350f2e['cacheDir']=_0x195132,_0x350f2e[_0x4a1023(0x126)]=resolve(_0x195132,SKILL_FILE),_0x350f2e[_0x4a1023(0x11f)]=_0x2918df);for(const _0x1b8bbb of _0x52cd80){!_0x350f2e[_0x4a1023(0x119)]['includes'](_0x1b8bbb)&&_0x350f2e['linkedPaths'][_0x4a1023(0x111)](_0x1b8bbb);}_0x350f2e['linkedPaths'][_0x4a1023(0x102)]();return;}_0x1e0e0f['set'](_0x1332a5,{..._0x4506a6,'tags':Array[_0x4a1023(0x117)](_0x4506a6[_0x4a1023(0x10a)])?_0x4506a6['tags']:[],'scope':_0x4506a6[_0x4a1023(0x12c)],'source':_0x4a1023(0x11c),'dir':_0x195132,'cacheDir':_0x19d0c6['source']===_0x4a1023(0x129)?_0x195132:undefined,'skillMdPath':resolve(_0x195132,SKILL_FILE),'metadataPath':_0x2918df,'linkedPaths':_0x52cd80});}function compareLocalRuntimeSkills(_0x5d82bc,_0x1bdf16){const _0x219259=a114_0x35bf,_0x4e25e4={'personal':0x0,'company':0x1,'builtin':0x2};return _0x4e25e4[_0x5d82bc[_0x219259(0x12c)]]-_0x4e25e4[_0x1bdf16[_0x219259(0x12c)]]||_0x5d82bc[_0x219259(0x12a)]['localeCompare'](_0x1bdf16[_0x219259(0x12a)])||_0x5d82bc['dir'][_0x219259(0x100)](_0x1bdf16[_0x219259(0x105)]);}
@@ -1 +1 @@
1
- (function(_0x2c066c,_0x48d30c){const _0xfb6b5d=a113_0x2ee8,_0x2d19ca=_0x2c066c();while(!![]){try{const _0x42e779=parseInt(_0xfb6b5d(0x13f))/0x1+-parseInt(_0xfb6b5d(0x13e))/0x2+parseInt(_0xfb6b5d(0x122))/0x3*(parseInt(_0xfb6b5d(0x131))/0x4)+-parseInt(_0xfb6b5d(0x11b))/0x5*(parseInt(_0xfb6b5d(0x123))/0x6)+parseInt(_0xfb6b5d(0x126))/0x7*(-parseInt(_0xfb6b5d(0x11d))/0x8)+parseInt(_0xfb6b5d(0x119))/0x9*(parseInt(_0xfb6b5d(0x133))/0xa)+parseInt(_0xfb6b5d(0x12b))/0xb;if(_0x42e779===_0x48d30c)break;else _0x2d19ca['push'](_0x2d19ca['shift']());}catch(_0x20568d){_0x2d19ca['push'](_0x2d19ca['shift']());}}}(a113_0x36a5,0x7578f));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(_0x562e7c){const _0x404280=a113_0x2ee8;return _0x562e7c['bytes']??Buffer['from'](_0x562e7c['content']??'',_0x404280(0x138));}export function fileText(_0x26a3c8){const _0x272f11=a113_0x2ee8;return fileContent(_0x26a3c8)[_0x272f11(0x140)](_0x272f11(0x138));}export function normalizeLocalFiles(_0x2bc939){const _0x4b16d1=a113_0x2ee8;if(!Array[_0x4b16d1(0x121)](_0x2bc939)||_0x2bc939[_0x4b16d1(0x120)]===0x0)return[];const _0x11f84f=new Map();for(const _0x257031 of _0x2bc939){if(!_0x257031||typeof _0x257031!==_0x4b16d1(0x118)||typeof _0x257031['path']!==_0x4b16d1(0x11c))throw CliErrors[_0x4b16d1(0x132)]('Skill\x20file\x20path\x20must\x20be\x20text.');const _0x2d91e3=normalizeSkillRelativePath(_0x257031[_0x4b16d1(0x117)]);if(_0x11f84f[_0x4b16d1(0x12c)](_0x2d91e3))throw CliErrors['validation'](_0x4b16d1(0x145)+_0x2d91e3);if(_0x257031[_0x4b16d1(0x12f)]!==undefined&&!Buffer[_0x4b16d1(0x13a)](_0x257031[_0x4b16d1(0x12f)]))throw CliErrors['validation'](_0x4b16d1(0x124)+_0x2d91e3);if(_0x257031[_0x4b16d1(0x12f)]===undefined&&typeof _0x257031['content']!==_0x4b16d1(0x11c))throw CliErrors[_0x4b16d1(0x132)](_0x4b16d1(0x11a)+_0x2d91e3);const _0x47f185=fileContent(_0x257031);_0x11f84f[_0x4b16d1(0x136)](_0x2d91e3,{'path':_0x2d91e3,'bytes':_0x47f185});}return Array[_0x4b16d1(0x13d)](_0x11f84f[_0x4b16d1(0x144)]())[_0x4b16d1(0x11f)](compareSkillFiles);}function a113_0x36a5(){const _0xfe6cee=['isBuffer','trim','split','from','1801676vjbNmi','754193IkhbTF','toString','includes','sha256','name','values','Duplicate\x20Skill\x20file\x20path:\x20','path','object','4443651hIUMyO','Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20','375bynemr','string','16jWEMaQ','replace','sort','length','isArray','6CqVMNc','1662Fvhatj','Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20','compare','2131661TqPgnO','Skill\x20file\x20size\x20is\x20invalid:\x20','test','isSymbolicLink','isSafeInteger','8179072mokKeh','has','Skill\x20file\x20sha256\x20is\x20invalid:\x20','isFile','bytes','excludedFilePaths','40684pMkfpx','validation','10bpFnYI','isDirectory','size','set','add','utf8','Unsafe\x20Skill\x20file\x20path:\x20'];a113_0x36a5=function(){return _0xfe6cee;};return a113_0x36a5();}export function normalizeManifestFiles(_0x166b69){const _0x443e66=a113_0x2ee8;if(!Array[_0x443e66(0x121)](_0x166b69)||_0x166b69['length']===0x0)return[];const _0x30e41a=new Map();for(const _0x586c7b of _0x166b69){if(!_0x586c7b||typeof _0x586c7b!=='object'||typeof _0x586c7b[_0x443e66(0x117)]!=='string')throw CliErrors['validation']('Skill\x20file\x20path\x20must\x20be\x20text.');const _0x58e2f7=normalizeSkillRelativePath(_0x586c7b[_0x443e66(0x117)]);if(_0x30e41a['has'](_0x58e2f7))throw CliErrors[_0x443e66(0x132)](_0x443e66(0x145)+_0x58e2f7);if(!isSha256Hex(_0x586c7b['sha256']))throw CliErrors[_0x443e66(0x132)](_0x443e66(0x12d)+_0x58e2f7);if(!Number[_0x443e66(0x12a)](_0x586c7b[_0x443e66(0x135)])||_0x586c7b[_0x443e66(0x135)]<0x0)throw CliErrors[_0x443e66(0x132)](_0x443e66(0x127)+_0x58e2f7);_0x30e41a[_0x443e66(0x136)](_0x58e2f7,{'path':_0x58e2f7,'sha256':_0x586c7b[_0x443e66(0x142)]['toLowerCase'](),'size':_0x586c7b[_0x443e66(0x135)]});}return Array[_0x443e66(0x13d)](_0x30e41a['values']())[_0x443e66(0x11f)](compareSkillFiles);}export function scanSkillDirectory(_0x1f58b3,_0x3a3aa4={}){const _0x14267e=a113_0x2ee8,_0x183a09=realpathSync(_0x1f58b3),_0x32c864=canonicalExcludedFilePaths(_0x3a3aa4[_0x14267e(0x130)]),_0x50de5b=[];function _0x17bef7(_0x582c3c){const _0x2742ba=_0x14267e,_0x13e2ef=readdirSync(_0x582c3c,{'withFileTypes':!![]})['sort']((_0x471194,_0x52ad7a)=>_0x471194['name']['localeCompare'](_0x52ad7a['name']));for(const _0x230558 of _0x13e2ef){if(_0x230558[_0x2742ba(0x134)]()&&IGNORED_DIR_NAMES[_0x2742ba(0x12c)](_0x230558[_0x2742ba(0x143)]))continue;if(IGNORED_FILE_NAMES[_0x2742ba(0x12c)](_0x230558[_0x2742ba(0x143)]))continue;const _0x15cbfd=resolve(_0x582c3c,_0x230558[_0x2742ba(0x143)]);if(isExcludedFilePath(_0x15cbfd,_0x32c864))continue;if(_0x230558[_0x2742ba(0x129)]())throw CliErrors[_0x2742ba(0x132)]('Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20'+_0x15cbfd);const _0x51fe7e=toPosixPath(relative(_0x183a09,_0x15cbfd));if(_0x230558[_0x2742ba(0x134)]()){_0x17bef7(_0x15cbfd);continue;}if(!_0x230558[_0x2742ba(0x12e)]())continue;validateSkillRelativePath(_0x51fe7e);const _0x3a72d5=readFileSync(_0x15cbfd);_0x50de5b['push']({'path':_0x51fe7e,'bytes':_0x3a72d5});}}return _0x17bef7(_0x183a09),normalizeLocalFiles(_0x50de5b);}function a113_0x2ee8(_0x440d8d,_0x4e08d7){_0x440d8d=_0x440d8d-0x117;const _0x36a53a=a113_0x36a5();let _0x2ee867=_0x36a53a[_0x440d8d];return _0x2ee867;}function canonicalExcludedFilePaths(_0xcb5006){const _0x508947=a113_0x2ee8,_0x422d9a=new Set();for(const _0x11b541 of _0xcb5006??[]){const _0xc48b5c=resolve(_0x11b541);_0x422d9a[_0x508947(0x137)](_0xc48b5c);try{_0x422d9a[_0x508947(0x137)](realpathSync(_0xc48b5c));}catch{}}return _0x422d9a;}function isExcludedFilePath(_0x27bba7,_0x49369d){const _0x5189d6=a113_0x2ee8;if(_0x49369d[_0x5189d6(0x12c)](_0x27bba7))return!![];if(_0x49369d[_0x5189d6(0x135)]===0x0)return![];try{return _0x49369d[_0x5189d6(0x12c)](realpathSync(_0x27bba7));}catch{return![];}}export function compareSkillFiles(_0x183493,_0x304e95){const _0x1efa88=a113_0x2ee8;if(_0x183493[_0x1efa88(0x117)]===SKILL_FILE)return _0x304e95[_0x1efa88(0x117)]===SKILL_FILE?0x0:-0x1;if(_0x304e95[_0x1efa88(0x117)]===SKILL_FILE)return 0x1;return Buffer[_0x1efa88(0x125)](Buffer['from'](_0x183493['path'],'utf8'),Buffer['from'](_0x304e95[_0x1efa88(0x117)],_0x1efa88(0x138)));}export function normalizeSkillRelativePath(_0x2a5635){const _0x529d89=a113_0x2ee8,_0x6573b4=toPosixPath(_0x2a5635[_0x529d89(0x13b)]());return validateSkillRelativePath(_0x6573b4),_0x6573b4;}export function validateSkillRelativePath(_0x3e030d){const _0x60972a=a113_0x2ee8;if(!_0x3e030d||_0x3e030d['startsWith']('/')||_0x3e030d[_0x60972a(0x141)]('//'))throw CliErrors[_0x60972a(0x132)](_0x60972a(0x139)+_0x3e030d);for(const _0x410fc6 of _0x3e030d[_0x60972a(0x13c)]('/')){if(!_0x410fc6||_0x410fc6==='.'||_0x410fc6==='..')throw CliErrors[_0x60972a(0x132)]('Unsafe\x20Skill\x20file\x20path:\x20'+_0x3e030d);}}export function toPosixPath(_0x1cba31){const _0x286852=a113_0x2ee8;return _0x1cba31[_0x286852(0x11e)](/\\/g,'/');}export function isSha256Hex(_0x2d7654){const _0x737272=a113_0x2ee8;return typeof _0x2d7654===_0x737272(0x11c)&&/^[a-fA-F0-9]{64}$/[_0x737272(0x128)](_0x2d7654);}
1
+ (function(_0x4e85a5,_0x3f8f86){const _0x213c8e=a115_0x584b,_0x4be3d5=_0x4e85a5();while(!![]){try{const _0x59a609=-parseInt(_0x213c8e(0x1c5))/0x1*(parseInt(_0x213c8e(0x1bf))/0x2)+-parseInt(_0x213c8e(0x1d6))/0x3*(parseInt(_0x213c8e(0x1c2))/0x4)+parseInt(_0x213c8e(0x1bd))/0x5*(parseInt(_0x213c8e(0x1ce))/0x6)+-parseInt(_0x213c8e(0x1c9))/0x7*(parseInt(_0x213c8e(0x1cf))/0x8)+parseInt(_0x213c8e(0x1d1))/0x9+-parseInt(_0x213c8e(0x1d8))/0xa*(-parseInt(_0x213c8e(0x1a9))/0xb)+-parseInt(_0x213c8e(0x1d2))/0xc*(parseInt(_0x213c8e(0x1b0))/0xd);if(_0x59a609===_0x3f8f86)break;else _0x4be3d5['push'](_0x4be3d5['shift']());}catch(_0x46df6e){_0x4be3d5['push'](_0x4be3d5['shift']());}}}(a115_0x4252,0xdcd39));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(_0x388bd8){const _0x59f0b2=a115_0x584b;return _0x388bd8[_0x59f0b2(0x1d7)]??Buffer[_0x59f0b2(0x1c3)](_0x388bd8['content']??'','utf8');}export function fileText(_0x38f5ec){const _0x5f4903=a115_0x584b;return fileContent(_0x38f5ec)[_0x5f4903(0x1b2)]('utf8');}export function normalizeLocalFiles(_0x2b9e8d){const _0x171cd3=a115_0x584b;if(!Array[_0x171cd3(0x1c8)](_0x2b9e8d)||_0x2b9e8d[_0x171cd3(0x1b5)]===0x0)return[];const _0x34e0cf=new Map();for(const _0x435ace of _0x2b9e8d){if(!_0x435ace||typeof _0x435ace!==_0x171cd3(0x1d9)||typeof _0x435ace['path']!==_0x171cd3(0x1ba))throw CliErrors['validation'](_0x171cd3(0x1af));const _0x2211f5=normalizeSkillRelativePath(_0x435ace[_0x171cd3(0x1b7)]);if(_0x34e0cf[_0x171cd3(0x1a8)](_0x2211f5))throw CliErrors[_0x171cd3(0x1bc)]('Duplicate\x20Skill\x20file\x20path:\x20'+_0x2211f5);if(_0x435ace[_0x171cd3(0x1d7)]!==undefined&&!Buffer[_0x171cd3(0x1cd)](_0x435ace[_0x171cd3(0x1d7)]))throw CliErrors[_0x171cd3(0x1bc)]('Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20'+_0x2211f5);if(_0x435ace['bytes']===undefined&&typeof _0x435ace[_0x171cd3(0x1b4)]!==_0x171cd3(0x1ba))throw CliErrors[_0x171cd3(0x1bc)](_0x171cd3(0x1ab)+_0x2211f5);const _0x225dbc=fileContent(_0x435ace);_0x34e0cf[_0x171cd3(0x1aa)](_0x2211f5,{'path':_0x2211f5,'bytes':_0x225dbc});}return Array[_0x171cd3(0x1c3)](_0x34e0cf[_0x171cd3(0x1d4)]())[_0x171cd3(0x1c4)](compareSkillFiles);}export function normalizeManifestFiles(_0x7b1f97){const _0x2b0a7b=a115_0x584b;if(!Array[_0x2b0a7b(0x1c8)](_0x7b1f97)||_0x7b1f97[_0x2b0a7b(0x1b5)]===0x0)return[];const _0x21cff6=new Map();for(const _0x3a6bf7 of _0x7b1f97){if(!_0x3a6bf7||typeof _0x3a6bf7!==_0x2b0a7b(0x1d9)||typeof _0x3a6bf7[_0x2b0a7b(0x1b7)]!==_0x2b0a7b(0x1ba))throw CliErrors['validation'](_0x2b0a7b(0x1af));const _0x1c262d=normalizeSkillRelativePath(_0x3a6bf7[_0x2b0a7b(0x1b7)]);if(_0x21cff6['has'](_0x1c262d))throw CliErrors[_0x2b0a7b(0x1bc)](_0x2b0a7b(0x1d3)+_0x1c262d);if(!isSha256Hex(_0x3a6bf7[_0x2b0a7b(0x1ac)]))throw CliErrors[_0x2b0a7b(0x1bc)](_0x2b0a7b(0x1c7)+_0x1c262d);if(!Number['isSafeInteger'](_0x3a6bf7[_0x2b0a7b(0x1c6)])||_0x3a6bf7[_0x2b0a7b(0x1c6)]<0x0)throw CliErrors['validation'](_0x2b0a7b(0x1ca)+_0x1c262d);_0x21cff6['set'](_0x1c262d,{'path':_0x1c262d,'sha256':_0x3a6bf7['sha256'][_0x2b0a7b(0x1d0)](),'size':_0x3a6bf7[_0x2b0a7b(0x1c6)]});}return Array[_0x2b0a7b(0x1c3)](_0x21cff6[_0x2b0a7b(0x1d4)]())['sort'](compareSkillFiles);}export function scanSkillDirectory(_0x12512e,_0x3985bc={}){const _0x493429=realpathSync(_0x12512e),_0x274f67=canonicalExcludedFilePaths(_0x3985bc['excludedFilePaths']),_0x130282=[];function _0x2be727(_0x2f3d79){const _0x3ec9fd=a115_0x584b,_0x112e70=readdirSync(_0x2f3d79,{'withFileTypes':!![]})[_0x3ec9fd(0x1c4)]((_0x414d62,_0x76d7e0)=>_0x414d62[_0x3ec9fd(0x1d5)][_0x3ec9fd(0x1cb)](_0x76d7e0['name']));for(const _0x8234b3 of _0x112e70){if(_0x8234b3[_0x3ec9fd(0x1b1)]()&&IGNORED_DIR_NAMES['has'](_0x8234b3['name']))continue;if(IGNORED_FILE_NAMES[_0x3ec9fd(0x1a8)](_0x8234b3[_0x3ec9fd(0x1d5)]))continue;const _0x3f7d56=resolve(_0x2f3d79,_0x8234b3[_0x3ec9fd(0x1d5)]);if(isExcludedFilePath(_0x3f7d56,_0x274f67))continue;if(_0x8234b3[_0x3ec9fd(0x1ae)]())throw CliErrors[_0x3ec9fd(0x1bc)](_0x3ec9fd(0x1b9)+_0x3f7d56);const _0x324185=toPosixPath(relative(_0x493429,_0x3f7d56));if(_0x8234b3[_0x3ec9fd(0x1b1)]()){_0x2be727(_0x3f7d56);continue;}if(!_0x8234b3[_0x3ec9fd(0x1b8)]())continue;validateSkillRelativePath(_0x324185);const _0x5206e2=readFileSync(_0x3f7d56);_0x130282['push']({'path':_0x324185,'bytes':_0x5206e2});}}return _0x2be727(_0x493429),normalizeLocalFiles(_0x130282);}function canonicalExcludedFilePaths(_0x36fba4){const _0xcc217a=a115_0x584b,_0x54cc5c=new Set();for(const _0xea2326 of _0x36fba4??[]){const _0x4a23cd=resolve(_0xea2326);_0x54cc5c['add'](_0x4a23cd);try{_0x54cc5c[_0xcc217a(0x1bb)](realpathSync(_0x4a23cd));}catch{}}return _0x54cc5c;}function isExcludedFilePath(_0x136daf,_0x25dc36){const _0x13f157=a115_0x584b;if(_0x25dc36['has'](_0x136daf))return!![];if(_0x25dc36['size']===0x0)return![];try{return _0x25dc36[_0x13f157(0x1a8)](realpathSync(_0x136daf));}catch{return![];}}function a115_0x584b(_0x1b03dc,_0x4ef221){_0x1b03dc=_0x1b03dc-0x1a7;const _0x4252a2=a115_0x4252();let _0x584b1c=_0x4252a2[_0x1b03dc];return _0x584b1c;}export function compareSkillFiles(_0x23f06b,_0x16b481){const _0x540d11=a115_0x584b;if(_0x23f06b[_0x540d11(0x1b7)]===SKILL_FILE)return _0x16b481['path']===SKILL_FILE?0x0:-0x1;if(_0x16b481[_0x540d11(0x1b7)]===SKILL_FILE)return 0x1;return Buffer[_0x540d11(0x1b3)](Buffer[_0x540d11(0x1c3)](_0x23f06b[_0x540d11(0x1b7)],'utf8'),Buffer['from'](_0x16b481[_0x540d11(0x1b7)],'utf8'));}export function normalizeSkillRelativePath(_0x5bac3d){const _0x30cd1d=a115_0x584b,_0x53f340=toPosixPath(_0x5bac3d[_0x30cd1d(0x1cc)]());return validateSkillRelativePath(_0x53f340),_0x53f340;}function a115_0x4252(){const _0x3e2464=['has','16842925kVMLlK','set','Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20','sha256','includes','isSymbolicLink','Skill\x20file\x20path\x20must\x20be\x20text.','26vVqubX','isDirectory','toString','compare','content','length','Unsafe\x20Skill\x20file\x20path:\x20','path','isFile','Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20','string','add','validation','10EVDeiG','split','174gOzKCr','test','startsWith','100HHqZaV','from','sort','10192iKeRhi','size','Skill\x20file\x20sha256\x20is\x20invalid:\x20','isArray','363293QwEbbx','Skill\x20file\x20size\x20is\x20invalid:\x20','localeCompare','trim','isBuffer','3536634JBmqLd','272ubufSs','toLowerCase','13550067PDNrHY','2942196mPkuqr','Duplicate\x20Skill\x20file\x20path:\x20','values','name','20337vvNXKX','bytes','10RgAoVo','object','replace'];a115_0x4252=function(){return _0x3e2464;};return a115_0x4252();}export function validateSkillRelativePath(_0x20bd71){const _0x47a7a3=a115_0x584b;if(!_0x20bd71||_0x20bd71[_0x47a7a3(0x1c1)]('/')||_0x20bd71[_0x47a7a3(0x1ad)]('//'))throw CliErrors['validation'](_0x47a7a3(0x1b6)+_0x20bd71);for(const _0x2cdf30 of _0x20bd71[_0x47a7a3(0x1be)]('/')){if(!_0x2cdf30||_0x2cdf30==='.'||_0x2cdf30==='..')throw CliErrors[_0x47a7a3(0x1bc)](_0x47a7a3(0x1b6)+_0x20bd71);}}export function toPosixPath(_0x32b874){const _0x2caa34=a115_0x584b;return _0x32b874[_0x2caa34(0x1a7)](/\\/g,'/');}export function isSha256Hex(_0x4814cb){const _0xd9936=a115_0x584b;return typeof _0x4814cb===_0xd9936(0x1ba)&&/^[a-fA-F0-9]{64}$/[_0xd9936(0x1c0)](_0x4814cb);}
@@ -1 +1 @@
1
- (function(_0x3577ed,_0x3c062a){const _0x29036f=a114_0x5160,_0x438be2=_0x3577ed();while(!![]){try{const _0x3b3001=parseInt(_0x29036f(0x9a))/0x1+parseInt(_0x29036f(0xa3))/0x2+parseInt(_0x29036f(0xb6))/0x3*(-parseInt(_0x29036f(0x8f))/0x4)+-parseInt(_0x29036f(0x91))/0x5*(parseInt(_0x29036f(0xba))/0x6)+-parseInt(_0x29036f(0x99))/0x7*(parseInt(_0x29036f(0xa0))/0x8)+-parseInt(_0x29036f(0xac))/0x9*(-parseInt(_0x29036f(0xa1))/0xa)+parseInt(_0x29036f(0xb1))/0xb;if(_0x3b3001===_0x3c062a)break;else _0x438be2['push'](_0x438be2['shift']());}catch(_0x1d57ea){_0x438be2['push'](_0x438be2['shift']());}}}(a114_0x6460,0x6f372));function a114_0x6460(){const _0x45a4f1=['6odLVZM','flow','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.','set','---','errors','join','find','contents','replace','name','---\x0a','filter','6836zmPhtb','name:\x20','2673485AqJjNc','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20','path','accessKey','validation','Runtime\x20Skill\x20package\x20is\x20missing\x20','Managed\x20file\x20was\x20removed\x20locally:\x20','5948124IbMEBf','39039BzOvZG','appCode','slice','utf8','map','entries','8jddcmL','10oPEHCb','displayName','1697030LVQkuF','has','packageBytes','trim','length','skillName','toString','displayName:\x20','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','3029139edUuwc','keys','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','description','paths','12921535lXbxMN','Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20','fileHashes','contentHash','trimEnd','981VIkMIU','env','isFile','\x0a---\x0a\x0a'];a114_0x6460=function(){return _0x45a4f1;};return a114_0x6460();}import{existsSync,lstatSync,mkdirSync,readFileSync,rmSync}from'node:fs';import{dirname,resolve}from'node:path';import{isCollection,isMap,isNode,parseDocument,visit}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{resolveManagedFilePath,writeBytesAtomic,writeJsonAtomic}from'./fs-utils.js';import{bufferSha256,contentHash,fileHash}from'./hashing.js';import{fileContent,fileText,normalizeLocalFiles}from'./local-files.js';function a114_0x5160(_0x16473f,_0x57c357){_0x16473f=_0x16473f-0x8e;const _0x646038=a114_0x6460();let _0x516063=_0x646038[_0x16473f];return _0x516063;}import{buildMetadata,readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillDir}from'./paths.js';import{extractDownloadedPackage,requirePackageBytes}from'./zip-package.js';export function materializeRuntimeSkill(_0x2ed8d0,_0x48bc0c,_0x3d2230){const _0x5f4211=a114_0x5160,_0x23a216=requireSkillCode(_0x2ed8d0),_0x1a74d5=requirePackageBytes(_0x23a216,_0x3d2230[_0x5f4211(0xa5)]),_0x3c2284=extractDownloadedPackage(_0x1a74d5),_0x39a76d=_0x3c2284[_0x5f4211(0xc1)](_0x24eb87=>_0x24eb87[_0x5f4211(0x94)]===SKILL_FILE);if(!_0x39a76d)throw CliErrors['validation'](_0x5f4211(0x97)+SKILL_FILE+':\x20'+_0x23a216);const _0x4c248c=withMaterializedSkillFrontmatter(_0x3c2284,_0x2ed8d0,_0x23a216),_0x1c3a8f=_0x4c248c['find'](_0x11a742=>_0x11a742[_0x5f4211(0x94)]===SKILL_FILE),_0xf2aa7e=fileText(_0x1c3a8f),_0x1c22b3=getRuntimeSkillDir(_0x3d2230[_0x5f4211(0xb7)],_0x3d2230[_0x5f4211(0x95)],_0x3d2230[_0x5f4211(0x9b)],_0x48bc0c,_0x23a216,_0x3d2230[_0x5f4211(0xb0)]),_0x460752=resolve(_0x1c22b3,SKILL_FILE),_0x585458=resolve(_0x1c22b3,METADATA_FILE),_0x527177=contentHash(_0xf2aa7e),_0x8bf846=readMetadataIfPresent(_0x585458)?.[_0x5f4211(0xb3)];ensurePulledFilesCanBeOverwritten(_0x1c22b3,_0x585458,_0x4c248c,_0x3d2230['force']===!![]),mkdirSync(_0x1c22b3,{'recursive':!![],'mode':0x1c0});const _0x2c0539=existsSync(_0x460752)?readFileSync(_0x460752,_0x5f4211(0x9d)):undefined;return materializeFiles(_0x1c22b3,_0x4c248c),removeStaleManagedFiles(_0x1c22b3,_0x8bf846,_0x4c248c),writeJsonAtomic(_0x585458,buildMetadata(_0x2ed8d0,_0x48bc0c,_0x3d2230[_0x5f4211(0x9b)],_0x527177,_0x3d2230['pulledAt'],_0x4c248c,_0x1a74d5)),{'skill':_0x2ed8d0,'scope':_0x48bc0c,'dir':_0x1c22b3,'skillMdPath':_0x460752,'metadataPath':_0x585458,'contentHash':_0x527177,'changed':_0x2c0539!==_0xf2aa7e};}function withMaterializedSkillFrontmatter(_0x4f6e3a,_0x4f0632,_0x484393){const _0x3cbceb=a114_0x5160,_0x553e81=skillDisplayName(_0x4f0632,_0x484393),_0x501b7a=_0x4f0632[_0x3cbceb(0xaf)]?.['trim']()||_0x553e81||_0x484393;return normalizeLocalFiles(_0x4f6e3a)[_0x3cbceb(0x9e)](_0x272be0=>{const _0x27a52d=_0x3cbceb,_0x45620e=fileText(_0x272be0);if(_0x272be0['path']!==SKILL_FILE)return _0x272be0;if(hasYamlFrontmatter(_0x45620e))return{'path':_0x272be0[_0x27a52d(0x94)],'content':withSyncedDisplayName(_0x45620e,_0x553e81)};return{'path':_0x272be0[_0x27a52d(0x94)],'content':prependSkillFrontmatter(_0x45620e,{'name':_0x484393,'displayName':_0x553e81,'description':_0x501b7a})};});}function hasYamlFrontmatter(_0x58d83c){return/^\uFEFF?---\s*\r?\n/['test'](_0x58d83c);}function prependSkillFrontmatter(_0x43c30f,_0x19e4f8){const _0x42ff7c=a114_0x5160,_0x154ca7=_0x43c30f[_0x42ff7c(0xc3)](/^\uFEFF/,'');return['---',_0x42ff7c(0x90)+yamlString(_0x19e4f8[_0x42ff7c(0xc4)]),_0x19e4f8[_0x42ff7c(0xa2)]?_0x42ff7c(0xaa)+yamlString(_0x19e4f8[_0x42ff7c(0xa2)]):undefined,'description:\x20'+yamlString(_0x19e4f8[_0x42ff7c(0xaf)]),_0x42ff7c(0xbe),'',_0x154ca7][_0x42ff7c(0x8e)](_0x2c255c=>_0x2c255c!==undefined)[_0x42ff7c(0xc0)]('\x0a');}function yamlString(_0x330396){const _0x5cd924=a114_0x5160;return JSON['stringify'](_0x330396[_0x5cd924(0xc3)](/\r/g,'')[_0x5cd924(0xa6)]());}function skillDisplayName(_0x374613,_0x2da2db){const _0x17e259=a114_0x5160,_0x44396d=_0x374613[_0x17e259(0xa8)]?.[_0x17e259(0xa6)]();return _0x44396d||_0x2da2db;}function withSyncedDisplayName(_0x2763a9,_0x2deac2){const _0x4bf730=a114_0x5160,_0x3cce70=_0x2763a9['match'](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x3cce70)return _0x2763a9;const _0x532a54=_0x3cce70[0x1]??'',_0x4c676e=_0x3cce70[0x2]??'',_0x1f30ea=parseDocument(_0x4c676e);if(_0x1f30ea[_0x4bf730(0xbf)][_0x4bf730(0xa7)]>0x0||!isMap(_0x1f30ea['contents']))return _0x2763a9;if(_0x2deac2)_0x1f30ea[_0x4bf730(0xbd)](_0x4bf730(0xa2),_0x2deac2);else{if(_0x1f30ea[_0x4bf730(0xa4)](_0x4bf730(0xa2)))_0x1f30ea['delete'](_0x4bf730(0xa2));else return _0x2763a9;}forceBlockCollections(_0x1f30ea[_0x4bf730(0xc2)]);const _0x47feea=_0x1f30ea[_0x4bf730(0xa9)]({'lineWidth':0x0})[_0x4bf730(0xb5)](),_0x10e646=_0x2763a9[_0x4bf730(0x9c)](_0x3cce70[0x0]['length'])[_0x4bf730(0xc3)](/^\r?\n/,'');return _0x532a54+_0x4bf730(0xc5)+_0x47feea+_0x4bf730(0xb9)+_0x10e646;}function forceBlockCollections(_0x10dbd8){if(!isNode(_0x10dbd8))return;visit(_0x10dbd8,(_0x4e7c2e,_0x475501)=>{const _0x64ba92=a114_0x5160;isCollection(_0x475501)&&(_0x475501[_0x64ba92(0xbb)]=![]);});}function ensurePulledFilesCanBeOverwritten(_0x9ed722,_0x1e0b25,_0x307d13,_0x309aaf){const _0x499ffa=a114_0x5160;if(_0x309aaf||!existsSync(_0x1e0b25))return;const _0xe1d97=readMetadataIfPresent(_0x1e0b25);if(!_0xe1d97)return;const _0x4ccbb0=_0xe1d97[_0x499ffa(0xb3)]&&Object[_0x499ffa(0xad)](_0xe1d97[_0x499ffa(0xb3)])[_0x499ffa(0xa7)]>0x0?_0xe1d97[_0x499ffa(0xb3)]:undefined;if(_0x4ccbb0)for(const [_0xf6b675,_0x2c67a4]of Object[_0x499ffa(0x9f)](_0x4ccbb0)){const _0x4efbed=resolveManagedFilePath(_0x9ed722,_0xf6b675);if(!existsSync(_0x4efbed))throw CliErrors['validation'](_0x499ffa(0xab)+_0x9ed722,_0x499ffa(0x98)+_0xf6b675);const _0x47893f=lstatSync(_0x4efbed);if(!_0x47893f[_0x499ffa(0xb8)]())throw CliErrors[_0x499ffa(0x96)](_0x499ffa(0xab)+_0x9ed722,_0x499ffa(0x93)+_0xf6b675);const _0x292823=bufferSha256(readFileSync(_0x4efbed));if(_0x292823!==_0x2c67a4)throw CliErrors[_0x499ffa(0x96)](_0x499ffa(0xab)+_0x9ed722+'.\x20Changed\x20file:\x20'+_0xf6b675,_0x499ffa(0x92)+_0xf6b675);}else{const _0xb31692=resolve(_0x9ed722,SKILL_FILE);if(existsSync(_0xb31692)&&_0xe1d97[_0x499ffa(0xb4)]){const _0x1982d7=contentHash(readFileSync(_0xb31692,_0x499ffa(0x9d)));if(_0x1982d7!==_0xe1d97[_0x499ffa(0xb4)])throw CliErrors[_0x499ffa(0x96)]('Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20'+_0xb31692,_0x499ffa(0xbc));}}for(const _0xf33346 of normalizeLocalFiles(_0x307d13)){if(_0x4ccbb0?.[_0xf33346[_0x499ffa(0x94)]])continue;if(!_0x4ccbb0&&_0xf33346[_0x499ffa(0x94)]===SKILL_FILE)continue;const _0x595074=resolveManagedFilePath(_0x9ed722,_0xf33346[_0x499ffa(0x94)]);if(!existsSync(_0x595074))continue;const _0x136756=lstatSync(_0x595074);if(!_0x136756[_0x499ffa(0xb8)]())throw CliErrors[_0x499ffa(0x96)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x9ed722,_0x499ffa(0xae)+_0xf33346[_0x499ffa(0x94)]);const _0x5bee17=bufferSha256(readFileSync(_0x595074));if(_0x5bee17!==fileHash(_0xf33346))throw CliErrors[_0x499ffa(0x96)](_0x499ffa(0xab)+_0x9ed722,_0x499ffa(0xb2)+_0xf33346['path']);}}function materializeFiles(_0x204b5c,_0x2ab194){const _0x3d4fce=a114_0x5160;for(const _0x677f04 of normalizeLocalFiles(_0x2ab194)){const _0x1dea57=resolveManagedFilePath(_0x204b5c,_0x677f04[_0x3d4fce(0x94)]);mkdirSync(dirname(_0x1dea57),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x1dea57,fileContent(_0x677f04),0x180);}}function removeStaleManagedFiles(_0x21b275,_0x5241ea,_0x5e3217){const _0x5e67d7=a114_0x5160;if(!_0x5241ea)return;const _0x3cc7c7=new Set(normalizeLocalFiles(_0x5e3217)[_0x5e67d7(0x9e)](_0x3edd9b=>_0x3edd9b['path']));for(const _0x548e2c of Object[_0x5e67d7(0xad)](_0x5241ea)){if(_0x3cc7c7['has'](_0x548e2c))continue;const _0x17fb4d=resolveManagedFilePath(_0x21b275,_0x548e2c);existsSync(_0x17fb4d)&&lstatSync(_0x17fb4d)[_0x5e67d7(0xb8)]()&&rmSync(_0x17fb4d,{'force':!![]});}}
1
+ (function(_0x4c6088,_0x337c44){const _0x3e58d5=a116_0x51ef,_0x26868a=_0x4c6088();while(!![]){try{const _0xf22af3=parseInt(_0x3e58d5(0xa1))/0x1+-parseInt(_0x3e58d5(0xc4))/0x2*(-parseInt(_0x3e58d5(0xb7))/0x3)+-parseInt(_0x3e58d5(0xb2))/0x4*(parseInt(_0x3e58d5(0xb9))/0x5)+parseInt(_0x3e58d5(0xbe))/0x6+-parseInt(_0x3e58d5(0x9c))/0x7*(-parseInt(_0x3e58d5(0x92))/0x8)+-parseInt(_0x3e58d5(0x94))/0x9*(-parseInt(_0x3e58d5(0x9b))/0xa)+-parseInt(_0x3e58d5(0xac))/0xb;if(_0xf22af3===_0x337c44)break;else _0x26868a['push'](_0x26868a['shift']());}catch(_0xb96385){_0x26868a['push'](_0x26868a['shift']());}}}(a116_0x3324,0xcd365));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 a116_0x3324(){const _0x3df250=['length','5838276mPkaJR','description:\x20','replace','fileHashes','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','join','66242fawYxt','.\x20Changed\x20file:\x20','errors','displayName','utf8','paths','---\x0a','find','12960cIQYvN','trimEnd','13004028uFVXoK','name','match','map','---','isFile','test','10nXXjHz','2940kmfVZT','stringify','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','flow','606316bJconk','Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20','filter','\x0a---\x0a\x0a','contents','env','name:\x20','displayName:\x20','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','keys','trim','22739431aZCgfw','has','slice','contentHash','Runtime\x20Skill\x20package\x20is\x20missing\x20','Managed\x20file\x20was\x20removed\x20locally:\x20','68FsLwvj','set','skillName','delete','Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20','15QDvbaz','description','283085FDwVRa','path','validation','toString'];a116_0x3324=function(){return _0x3df250;};return a116_0x3324();}import{fileContent,fileText,normalizeLocalFiles}from'./local-files.js';import{buildMetadata,readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillDir}from'./paths.js';function a116_0x51ef(_0x3828e7,_0x53cac0){_0x3828e7=_0x3828e7-0x8e;const _0x33243b=a116_0x3324();let _0x51efe8=_0x33243b[_0x3828e7];return _0x51efe8;}import{extractDownloadedPackage,requirePackageBytes}from'./zip-package.js';export function materializeRuntimeSkill(_0x3e66c6,_0x3f584c,_0x23d784){const _0x42ef18=a116_0x51ef,_0x1dc582=requireSkillCode(_0x3e66c6),_0x519990=requirePackageBytes(_0x1dc582,_0x23d784['packageBytes']),_0xb407a9=extractDownloadedPackage(_0x519990),_0x375f6f=_0xb407a9[_0x42ef18(0x91)](_0x1c7980=>_0x1c7980[_0x42ef18(0xba)]===SKILL_FILE);if(!_0x375f6f)throw CliErrors['validation'](_0x42ef18(0xb0)+SKILL_FILE+':\x20'+_0x1dc582);const _0x4f2abe=withMaterializedSkillFrontmatter(_0xb407a9,_0x3e66c6,_0x1dc582),_0x1f706a=_0x4f2abe[_0x42ef18(0x91)](_0x35fa35=>_0x35fa35[_0x42ef18(0xba)]===SKILL_FILE),_0x967c27=fileText(_0x1f706a),_0x5f2b44=getRuntimeSkillDir(_0x23d784[_0x42ef18(0xa6)],_0x23d784['accessKey'],_0x23d784['appCode'],_0x3f584c,_0x1dc582,_0x23d784[_0x42ef18(0x8f)]),_0x574ab3=resolve(_0x5f2b44,SKILL_FILE),_0x349a68=resolve(_0x5f2b44,METADATA_FILE),_0x2da5de=contentHash(_0x967c27),_0xe7427a=readMetadataIfPresent(_0x349a68)?.[_0x42ef18(0xc1)];ensurePulledFilesCanBeOverwritten(_0x5f2b44,_0x349a68,_0x4f2abe,_0x23d784['force']===!![]),mkdirSync(_0x5f2b44,{'recursive':!![],'mode':0x1c0});const _0x3574f4=existsSync(_0x574ab3)?readFileSync(_0x574ab3,_0x42ef18(0x8e)):undefined;return materializeFiles(_0x5f2b44,_0x4f2abe),removeStaleManagedFiles(_0x5f2b44,_0xe7427a,_0x4f2abe),writeJsonAtomic(_0x349a68,buildMetadata(_0x3e66c6,_0x3f584c,_0x23d784['appCode'],_0x2da5de,_0x23d784['pulledAt'],_0x4f2abe,_0x519990)),{'skill':_0x3e66c6,'scope':_0x3f584c,'dir':_0x5f2b44,'skillMdPath':_0x574ab3,'metadataPath':_0x349a68,'contentHash':_0x2da5de,'changed':_0x3574f4!==_0x967c27};}function withMaterializedSkillFrontmatter(_0x4c26d5,_0x34efa9,_0x44d601){const _0x371302=a116_0x51ef,_0x40a598=skillDisplayName(_0x34efa9,_0x44d601),_0x368eeb=_0x34efa9[_0x371302(0xb8)]?.[_0x371302(0xab)]()||_0x40a598||_0x44d601;return normalizeLocalFiles(_0x4c26d5)[_0x371302(0x97)](_0x4e44df=>{const _0x6660c=_0x371302,_0x5d7a7d=fileText(_0x4e44df);if(_0x4e44df[_0x6660c(0xba)]!==SKILL_FILE)return _0x4e44df;if(hasYamlFrontmatter(_0x5d7a7d))return{'path':_0x4e44df[_0x6660c(0xba)],'content':withSyncedDisplayName(_0x5d7a7d,_0x40a598)};return{'path':_0x4e44df[_0x6660c(0xba)],'content':prependSkillFrontmatter(_0x5d7a7d,{'name':_0x44d601,'displayName':_0x40a598,'description':_0x368eeb})};});}function hasYamlFrontmatter(_0x8eab52){const _0x5e0b92=a116_0x51ef;return/^\uFEFF?---\s*\r?\n/[_0x5e0b92(0x9a)](_0x8eab52);}function prependSkillFrontmatter(_0xf8d593,_0x3f2c97){const _0x1a7b24=a116_0x51ef,_0x39a84e=_0xf8d593[_0x1a7b24(0xc0)](/^\uFEFF/,'');return[_0x1a7b24(0x98),_0x1a7b24(0xa7)+yamlString(_0x3f2c97[_0x1a7b24(0x95)]),_0x3f2c97['displayName']?_0x1a7b24(0xa8)+yamlString(_0x3f2c97[_0x1a7b24(0xc7)]):undefined,_0x1a7b24(0xbf)+yamlString(_0x3f2c97[_0x1a7b24(0xb8)]),_0x1a7b24(0x98),'',_0x39a84e][_0x1a7b24(0xa3)](_0x17b2cd=>_0x17b2cd!==undefined)[_0x1a7b24(0xc3)]('\x0a');}function yamlString(_0x1f6186){const _0x33a225=a116_0x51ef;return JSON[_0x33a225(0x9d)](_0x1f6186[_0x33a225(0xc0)](/\r/g,'')[_0x33a225(0xab)]());}function skillDisplayName(_0x118703,_0x42c023){const _0x13a504=a116_0x51ef,_0x39ac69=_0x118703[_0x13a504(0xb4)]?.[_0x13a504(0xab)]();return _0x39ac69||_0x42c023;}function withSyncedDisplayName(_0x421d9f,_0x50d0e2){const _0x47c121=a116_0x51ef,_0x249cfa=_0x421d9f[_0x47c121(0x96)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x249cfa)return _0x421d9f;const _0x29953b=_0x249cfa[0x1]??'',_0x9b3d5=_0x249cfa[0x2]??'',_0x9fb0db=parseDocument(_0x9b3d5);if(_0x9fb0db[_0x47c121(0xc6)][_0x47c121(0xbd)]>0x0||!isMap(_0x9fb0db[_0x47c121(0xa5)]))return _0x421d9f;if(_0x50d0e2)_0x9fb0db[_0x47c121(0xb3)](_0x47c121(0xc7),_0x50d0e2);else{if(_0x9fb0db[_0x47c121(0xad)]('displayName'))_0x9fb0db[_0x47c121(0xb5)](_0x47c121(0xc7));else return _0x421d9f;}forceBlockCollections(_0x9fb0db[_0x47c121(0xa5)]);const _0x2b9eb2=_0x9fb0db[_0x47c121(0xbc)]({'lineWidth':0x0})[_0x47c121(0x93)](),_0x3ad61b=_0x421d9f[_0x47c121(0xae)](_0x249cfa[0x0][_0x47c121(0xbd)])[_0x47c121(0xc0)](/^\r?\n/,'');return _0x29953b+_0x47c121(0x90)+_0x2b9eb2+_0x47c121(0xa4)+_0x3ad61b;}function forceBlockCollections(_0x465b12){if(!isNode(_0x465b12))return;visit(_0x465b12,(_0x3a59fa,_0x28e20d)=>{const _0x4b5c05=a116_0x51ef;isCollection(_0x28e20d)&&(_0x28e20d[_0x4b5c05(0xa0)]=![]);});}function ensurePulledFilesCanBeOverwritten(_0x5f1cea,_0x537aca,_0x1591c8,_0x1c1d6a){const _0x3a517c=a116_0x51ef;if(_0x1c1d6a||!existsSync(_0x537aca))return;const _0x26d98e=readMetadataIfPresent(_0x537aca);if(!_0x26d98e)return;const _0x3a6676=_0x26d98e[_0x3a517c(0xc1)]&&Object[_0x3a517c(0xaa)](_0x26d98e[_0x3a517c(0xc1)])[_0x3a517c(0xbd)]>0x0?_0x26d98e[_0x3a517c(0xc1)]:undefined;if(_0x3a6676)for(const [_0x3c2e48,_0x4234f9]of Object['entries'](_0x3a6676)){const _0x6cb076=resolveManagedFilePath(_0x5f1cea,_0x3c2e48);if(!existsSync(_0x6cb076))throw CliErrors[_0x3a517c(0xbb)](_0x3a517c(0xc2)+_0x5f1cea,_0x3a517c(0xb1)+_0x3c2e48);const _0x1dfb05=lstatSync(_0x6cb076);if(!_0x1dfb05[_0x3a517c(0x99)]())throw CliErrors[_0x3a517c(0xbb)](_0x3a517c(0xc2)+_0x5f1cea,_0x3a517c(0xb6)+_0x3c2e48);const _0x4e1227=bufferSha256(readFileSync(_0x6cb076));if(_0x4e1227!==_0x4234f9)throw CliErrors[_0x3a517c(0xbb)](_0x3a517c(0xc2)+_0x5f1cea+_0x3a517c(0xc5)+_0x3c2e48,_0x3a517c(0x9f)+_0x3c2e48);}else{const _0x443f91=resolve(_0x5f1cea,SKILL_FILE);if(existsSync(_0x443f91)&&_0x26d98e[_0x3a517c(0xaf)]){const _0x3beb54=contentHash(readFileSync(_0x443f91,_0x3a517c(0x8e)));if(_0x3beb54!==_0x26d98e[_0x3a517c(0xaf)])throw CliErrors[_0x3a517c(0xbb)](_0x3a517c(0x9e)+_0x443f91,'Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.');}}for(const _0x3bed17 of normalizeLocalFiles(_0x1591c8)){if(_0x3a6676?.[_0x3bed17['path']])continue;if(!_0x3a6676&&_0x3bed17['path']===SKILL_FILE)continue;const _0x51bf90=resolveManagedFilePath(_0x5f1cea,_0x3bed17[_0x3a517c(0xba)]);if(!existsSync(_0x51bf90))continue;const _0x3b548a=lstatSync(_0x51bf90);if(!_0x3b548a[_0x3a517c(0x99)]())throw CliErrors[_0x3a517c(0xbb)](_0x3a517c(0xc2)+_0x5f1cea,_0x3a517c(0xa9)+_0x3bed17['path']);const _0x1410a6=bufferSha256(readFileSync(_0x51bf90));if(_0x1410a6!==fileHash(_0x3bed17))throw CliErrors['validation'](_0x3a517c(0xc2)+_0x5f1cea,_0x3a517c(0xa2)+_0x3bed17['path']);}}function materializeFiles(_0xdac6d2,_0x5df81a){const _0x399eac=a116_0x51ef;for(const _0x45803d of normalizeLocalFiles(_0x5df81a)){const _0x205bcb=resolveManagedFilePath(_0xdac6d2,_0x45803d[_0x399eac(0xba)]);mkdirSync(dirname(_0x205bcb),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x205bcb,fileContent(_0x45803d),0x180);}}function removeStaleManagedFiles(_0x1b6e2c,_0x33b395,_0x3329a5){const _0xee60db=a116_0x51ef;if(!_0x33b395)return;const _0x39b438=new Set(normalizeLocalFiles(_0x3329a5)[_0xee60db(0x97)](_0x13291e=>_0x13291e[_0xee60db(0xba)]));for(const _0x1c19bb of Object[_0xee60db(0xaa)](_0x33b395)){if(_0x39b438[_0xee60db(0xad)](_0x1c19bb))continue;const _0x32b9d1=resolveManagedFilePath(_0x1b6e2c,_0x1c19bb);existsSync(_0x32b9d1)&&lstatSync(_0x32b9d1)[_0xee60db(0x99)]()&&rmSync(_0x32b9d1,{'force':!![]});}}
@@ -1 +1 @@
1
- (function(_0x37a6a6,_0x528f0d){const _0x196331=a115_0x3b90,_0x55214c=_0x37a6a6();while(!![]){try{const _0x47425f=parseInt(_0x196331(0x103))/0x1*(parseInt(_0x196331(0xfa))/0x2)+parseInt(_0x196331(0xf5))/0x3*(-parseInt(_0x196331(0x10a))/0x4)+parseInt(_0x196331(0x112))/0x5+-parseInt(_0x196331(0xfd))/0x6*(-parseInt(_0x196331(0x10c))/0x7)+parseInt(_0x196331(0x105))/0x8*(parseInt(_0x196331(0x104))/0x9)+parseInt(_0x196331(0xfb))/0xa+-parseInt(_0x196331(0x116))/0xb*(parseInt(_0x196331(0x115))/0xc);if(_0x47425f===_0x528f0d)break;else _0x55214c['push'](_0x55214c['shift']());}catch(_0x101998){_0x55214c['push'](_0x55214c['shift']());}}}(a115_0x253b,0x47d38));import{existsSync,readFileSync}from'node:fs';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';import{fileContent,normalizeLocalFiles}from'./local-files.js';function a115_0x3b90(_0x510feb,_0x4f44c5){_0x510feb=_0x510feb-0xf5;const _0x253bef=a115_0x253b();let _0x3b90e7=_0x253bef[_0x510feb];return _0x3b90e7;}import{buildSkillPackage,localFilesToManifestFiles}from'./zip-package.js';export function buildMetadata(_0x455dbb,_0x5f14ef,_0x26b2f7,_0x43743d,_0x14fb6b,_0x5ee133,_0x4d58b5){const _0x22535a=a115_0x3b90,_0x360c91=_0x5ee133?normalizeLocalFiles(_0x5ee133):[],_0x262890=!_0x4d58b5&&_0x360c91[_0x22535a(0x102)]>0x0?buildSkillPackage(_0x360c91):undefined,_0x5338ff=_0x4d58b5?bufferSha256(_0x4d58b5):_0x262890?.[_0x22535a(0x111)][_0x22535a(0x110)],_0x5e7d20=_0x4d58b5?.[_0x22535a(0x102)]??_0x262890?.[_0x22535a(0x111)]['zipSize'],_0x241bcb=_0x360c91[_0x22535a(0x102)]>0x0?Object['fromEntries'](_0x360c91[_0x22535a(0x107)](_0x2aece1=>[_0x2aece1[_0x22535a(0x101)],fileHash(_0x2aece1)])):undefined;return{'schemaVersion':_0x360c91[_0x22535a(0x102)]>0x0?0x2:0x1,'id':_0x455dbb['id'],'appCode':_0x26b2f7,'skillCode':requireSkillCode(_0x455dbb),'skillName':_0x455dbb[_0x22535a(0xf8)],'description':_0x455dbb[_0x22535a(0x119)],'scope':_0x5f14ef,'readonly':_0x5f14ef!==_0x22535a(0x117)||_0x455dbb['readonly']===!![],'tenantCode':_0x455dbb[_0x22535a(0xfe)],'userId':_0x455dbb[_0x22535a(0xff)],'version':_0x455dbb['version'],'status':_0x455dbb[_0x22535a(0x108)],'tags':Array[_0x22535a(0x100)](_0x455dbb['tags'])?_0x455dbb['tags']:[],'hasUpstreamUpdate':_0x455dbb[_0x22535a(0x10f)],'forkedFromSkillId':_0x455dbb[_0x22535a(0x10e)],'forkedFromVersion':_0x455dbb[_0x22535a(0x113)],'sourceSessionId':_0x455dbb[_0x22535a(0x10d)],'contentHash':_0x43743d,'fileHashes':_0x241bcb,'treeHash':_0x360c91['length']>0x0?fileTreeHash(localFilesToManifestFiles(_0x360c91)):undefined,'ossPath':remoteManifestOssPath(_0x455dbb[_0x22535a(0xf9)]),'zipSha256':_0x5338ff,'zipSize':_0x5e7d20,'files':_0x360c91[_0x22535a(0x102)]>0x0?_0x360c91[_0x22535a(0x107)](_0x2dc06e=>({'path':_0x2dc06e[_0x22535a(0x101)],'hash':fileHash(_0x2dc06e),'size':fileContent(_0x2dc06e)['length']})):undefined,'pulledAt':_0x14fb6b??new Date()[_0x22535a(0x118)]()};}function a115_0x253b(){const _0x23fb49=['description','3cBZhJD','utf8','object','skillName','files','240010uMXSXx','5113720jCaoGs','skillCode','6HLDZCG','tenantCode','userId','isArray','path','length','3hubWPI','508347jejLdd','64fIaJvW','trim','map','status','validation','988772cDNsFq','ossPath','3350571cuiBDP','sourceSessionId','forkedFromSkillId','hasUpstreamUpdate','zipSha256','manifest','1968820KRpzcG','forkedFromVersion','parse','60eXkGuO','3639405SUFUMu','personal','toISOString'];a115_0x253b=function(){return _0x23fb49;};return a115_0x253b();}export function requireSkillCode(_0x35b41d){const _0x15ecbb=a115_0x3b90,_0x47038b=_0x35b41d[_0x15ecbb(0xfc)]?.['trim']();if(!_0x47038b)throw CliErrors[_0x15ecbb(0x109)]('Runtime\x20Skill\x20is\x20missing\x20skillCode.');return _0x47038b;}export function readMetadataIfPresent(_0x29f72f){const _0x5d86ba=a115_0x3b90;if(!existsSync(_0x29f72f))return undefined;try{const _0x5d1e04=JSON[_0x5d86ba(0x114)](readFileSync(_0x29f72f,_0x5d86ba(0xf6)));return _0x5d1e04;}catch{throw CliErrors['validation']('Invalid\x20'+METADATA_FILE+':\x20'+_0x29f72f);}}function remoteManifestOssPath(_0x58c60a){const _0xb2896f=a115_0x3b90;if(!_0x58c60a||typeof _0x58c60a!==_0xb2896f(0xf7)||Array['isArray'](_0x58c60a))return undefined;const _0x310a21=_0x58c60a[_0xb2896f(0x10b)];return typeof _0x310a21==='string'&&_0x310a21[_0xb2896f(0x106)]()?_0x310a21[_0xb2896f(0x106)]():undefined;}
1
+ function a117_0x3b62(_0xab9bc6,_0x597c05){_0xab9bc6=_0xab9bc6-0x8a;const _0x744cd3=a117_0x744c();let _0x3b6268=_0x744cd3[_0xab9bc6];return _0x3b6268;}(function(_0x306a92,_0x2ff30d){const _0x53ab0a=a117_0x3b62,_0x475dd1=_0x306a92();while(!![]){try{const _0x1a4e63=parseInt(_0x53ab0a(0xab))/0x1+parseInt(_0x53ab0a(0x92))/0x2*(-parseInt(_0x53ab0a(0x9b))/0x3)+-parseInt(_0x53ab0a(0x9f))/0x4*(-parseInt(_0x53ab0a(0x94))/0x5)+parseInt(_0x53ab0a(0x98))/0x6+parseInt(_0x53ab0a(0x9e))/0x7*(parseInt(_0x53ab0a(0x91))/0x8)+parseInt(_0x53ab0a(0x97))/0x9+parseInt(_0x53ab0a(0xa1))/0xa*(-parseInt(_0x53ab0a(0x8e))/0xb);if(_0x1a4e63===_0x2ff30d)break;else _0x475dd1['push'](_0x475dd1['shift']());}catch(_0x20eb94){_0x475dd1['push'](_0x475dd1['shift']());}}}(a117_0x744c,0x8e6b1));function a117_0x744c(){const _0x2c34fc=['skillName','385672CNjLYI','61512RxzmUd','tags','158330RFEvDF','fromEntries','path','1229769cgAqyZ','3693942CxAMqf','forkedFromVersion','trim','39FpiPeN','ossPath','userId','49zTRHWY','4jKNsBc','status','5740420rucOaS','hasUpstreamUpdate','manifest','validation','Runtime\x20Skill\x20is\x20missing\x20skillCode.','sourceSessionId','version','zipSize','files','parse','1009830xzcZHA','string','personal','isArray','forkedFromSkillId','object','readonly','skillCode','zipSha256','22sjmuYS','length'];a117_0x744c=function(){return _0x2c34fc;};return a117_0x744c();}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(_0x1eaeb2,_0x3a1d00,_0x24d7bd,_0x4a6778,_0x32215e,_0x590050,_0x3f4adc){const _0x55c736=a117_0x3b62,_0x3cd35d=_0x590050?normalizeLocalFiles(_0x590050):[],_0x42fc47=!_0x3f4adc&&_0x3cd35d[_0x55c736(0x8f)]>0x0?buildSkillPackage(_0x3cd35d):undefined,_0x169644=_0x3f4adc?bufferSha256(_0x3f4adc):_0x42fc47?.[_0x55c736(0xa3)][_0x55c736(0x8d)],_0x498e4e=_0x3f4adc?.[_0x55c736(0x8f)]??_0x42fc47?.[_0x55c736(0xa3)][_0x55c736(0xa8)],_0x2bc20a=_0x3cd35d[_0x55c736(0x8f)]>0x0?Object[_0x55c736(0x95)](_0x3cd35d['map'](_0x2080f5=>[_0x2080f5[_0x55c736(0x96)],fileHash(_0x2080f5)])):undefined;return{'schemaVersion':_0x3cd35d[_0x55c736(0x8f)]>0x0?0x2:0x1,'id':_0x1eaeb2['id'],'appCode':_0x24d7bd,'skillCode':requireSkillCode(_0x1eaeb2),'skillName':_0x1eaeb2[_0x55c736(0x90)],'description':_0x1eaeb2['description'],'scope':_0x3a1d00,'readonly':_0x3a1d00!==_0x55c736(0xad)||_0x1eaeb2[_0x55c736(0x8b)]===!![],'tenantCode':_0x1eaeb2['tenantCode'],'userId':_0x1eaeb2[_0x55c736(0x9d)],'version':_0x1eaeb2[_0x55c736(0xa7)],'status':_0x1eaeb2[_0x55c736(0xa0)],'tags':Array[_0x55c736(0xae)](_0x1eaeb2[_0x55c736(0x93)])?_0x1eaeb2[_0x55c736(0x93)]:[],'hasUpstreamUpdate':_0x1eaeb2[_0x55c736(0xa2)],'forkedFromSkillId':_0x1eaeb2[_0x55c736(0xaf)],'forkedFromVersion':_0x1eaeb2[_0x55c736(0x99)],'sourceSessionId':_0x1eaeb2[_0x55c736(0xa6)],'contentHash':_0x4a6778,'fileHashes':_0x2bc20a,'treeHash':_0x3cd35d[_0x55c736(0x8f)]>0x0?fileTreeHash(localFilesToManifestFiles(_0x3cd35d)):undefined,'ossPath':remoteManifestOssPath(_0x1eaeb2[_0x55c736(0xa9)]),'zipSha256':_0x169644,'zipSize':_0x498e4e,'files':_0x3cd35d[_0x55c736(0x8f)]>0x0?_0x3cd35d['map'](_0x4395d7=>({'path':_0x4395d7[_0x55c736(0x96)],'hash':fileHash(_0x4395d7),'size':fileContent(_0x4395d7)['length']})):undefined,'pulledAt':_0x32215e??new Date()['toISOString']()};}export function requireSkillCode(_0x331ee1){const _0x5f458b=a117_0x3b62,_0x5b87f3=_0x331ee1[_0x5f458b(0x8c)]?.[_0x5f458b(0x9a)]();if(!_0x5b87f3)throw CliErrors['validation'](_0x5f458b(0xa5));return _0x5b87f3;}export function readMetadataIfPresent(_0xc81db7){const _0x4511d7=a117_0x3b62;if(!existsSync(_0xc81db7))return undefined;try{const _0x5ea202=JSON[_0x4511d7(0xaa)](readFileSync(_0xc81db7,'utf8'));return _0x5ea202;}catch{throw CliErrors[_0x4511d7(0xa4)]('Invalid\x20'+METADATA_FILE+':\x20'+_0xc81db7);}}function remoteManifestOssPath(_0x49df17){const _0x2bb7a6=a117_0x3b62;if(!_0x49df17||typeof _0x49df17!==_0x2bb7a6(0x8a)||Array[_0x2bb7a6(0xae)](_0x49df17))return undefined;const _0x4d3397=_0x49df17[_0x2bb7a6(0x9c)];return typeof _0x4d3397===_0x2bb7a6(0xac)&&_0x4d3397[_0x2bb7a6(0x9a)]()?_0x4d3397['trim']():undefined;}
@@ -1 +1 @@
1
- const a116_0x19bda2=a116_0x34f2;function a116_0x34f2(_0x3d34b0,_0x4db176){_0x3d34b0=_0x3d34b0-0x1a6;const _0x490cb1=a116_0x490c();let _0x34f273=_0x490cb1[_0x3d34b0];return _0x34f273;}(function(_0x40ef44,_0x34560b){const _0x6e0531=a116_0x34f2,_0x2fed25=_0x40ef44();while(!![]){try{const _0x15cb69=-parseInt(_0x6e0531(0x1b2))/0x1+parseInt(_0x6e0531(0x1a7))/0x2+-parseInt(_0x6e0531(0x1a9))/0x3*(parseInt(_0x6e0531(0x1c0))/0x4)+-parseInt(_0x6e0531(0x1bf))/0x5+parseInt(_0x6e0531(0x1b9))/0x6*(parseInt(_0x6e0531(0x1af))/0x7)+parseInt(_0x6e0531(0x1c1))/0x8+-parseInt(_0x6e0531(0x1bb))/0x9;if(_0x15cb69===_0x34560b)break;else _0x2fed25['push'](_0x2fed25['shift']());}catch(_0x42e3ad){_0x2fed25['push'](_0x2fed25['shift']());}}}(a116_0x490c,0x71116));import{existsSync}from'node:fs';import{homedir}from'node:os';import{resolve}from'node:path';function a116_0x490c(){const _0x2aa42f=['agentsSkillsDir','2563825sHTQmG','356HRKnjA','2252992DbLhck','path\x20segment','claudeSkillsDir','815148ltgWlc','.claude','3681aEICMI','\x20for\x20local\x20path:\x20','Unsafe\x20','validation','cacheRoot','trim','6178144TXQhoT','appCode','filter','297370rYBVlr','homeDir','homeDirName','cache','includes','skills','.agents','6aLsfao','skillCode','1703934LXJwoK','SKILL_ROOT','workbuddySkillsDir'];a116_0x490c=function(){return _0x2aa42f;};return a116_0x490c();}import{fingerprintAccessKey}from'../../commands/app/cache.js';import{PRODUCT_CONFIG,productEnv}from'../../constant/product.js';import{CliErrors}from'../../errors.js';export function resolveSkillSyncPaths(_0x26adfd={}){const _0x354b34=a116_0x34f2,_0x25dc09=_0x26adfd[_0x354b34(0x1b3)]??homedir(),_0x5ca2fa=resolve(_0x25dc09,PRODUCT_CONFIG[_0x354b34(0x1b4)],_0x354b34(0x1b5)),_0x31004c=trimmedEnv(_0x354b34(0x1bc)),_0x2bc4a6=trimmedEnv('CLAUDE_SKILL_ROOT'),_0x2961f9=resolve(_0x25dc09,'.workbuddy'),_0x52e9d9=_0x26adfd['workbuddySkillsDir']??(existsSync(_0x2961f9)?resolve(_0x2961f9,_0x354b34(0x1b7)):undefined);return{'homeDir':_0x25dc09,'cacheRoot':_0x5ca2fa,'managedRoot':resolve(_0x25dc09,PRODUCT_CONFIG[_0x354b34(0x1b4)]),'agentsSkillsDir':_0x26adfd[_0x354b34(0x1be)]??_0x31004c??resolve(_0x25dc09,_0x354b34(0x1b8),_0x354b34(0x1b7)),'claudeSkillsDir':_0x26adfd['claudeSkillsDir']??_0x2bc4a6??resolve(_0x25dc09,_0x354b34(0x1a8),_0x354b34(0x1b7)),'workbuddySkillsDir':_0x52e9d9};}export function runtimeAgentSkillRoots(_0x2ef032){const _0x523125=a116_0x34f2;return[_0x2ef032[_0x523125(0x1be)],_0x2ef032[_0x523125(0x1a6)],_0x2ef032[_0x523125(0x1bd)]][_0x523125(0x1b1)](_0x530fbe=>Boolean(_0x530fbe));}export function getRuntimeSkillCacheRoot(_0x364fda,_0x3718dd,_0x3e5b7e={}){const _0x32983b=a116_0x34f2,_0x2bbf1d=resolveSkillSyncPaths(_0x3e5b7e);return resolve(_0x2bbf1d[_0x32983b(0x1ad)],_0x364fda,fingerprintAccessKey(_0x3718dd),_0x32983b(0x1b7));}export function getRuntimeSkillDir(_0x27bf0c,_0x400afe,_0x17fa78,_0x5ba9f4,_0x2ee1e3,_0x2cda0e={}){const _0x1ae76c=a116_0x34f2;return resolve(getRuntimeSkillCacheRoot(_0x27bf0c,_0x400afe,_0x2cda0e),safePathSegment(_0x17fa78,_0x1ae76c(0x1b0)),_0x5ba9f4,safePathSegment(_0x2ee1e3,_0x1ae76c(0x1ba)));}export function safePathSegment(_0x5dd16e,_0x525c7f=a116_0x19bda2(0x1c2)){const _0x1728a1=a116_0x19bda2;if(!_0x5dd16e||_0x5dd16e[_0x1728a1(0x1b6)]('/')||_0x5dd16e[_0x1728a1(0x1b6)]('\x5c')||_0x5dd16e['includes']('..'))throw CliErrors[_0x1728a1(0x1ac)](_0x1728a1(0x1ab)+_0x525c7f+_0x1728a1(0x1aa)+_0x5dd16e);return _0x5dd16e;}function trimmedEnv(_0x2ed962){const _0x590912=a116_0x19bda2,_0x18d779=productEnv(_0x2ed962)?.[_0x590912(0x1ae)]();return _0x18d779?_0x18d779:undefined;}
1
+ const a118_0x336e93=a118_0x4a19;(function(_0x8fc3ba,_0x53cb4a){const _0x4e07a=a118_0x4a19,_0x5a0930=_0x8fc3ba();while(!![]){try{const _0x489b57=parseInt(_0x4e07a(0x154))/0x1*(parseInt(_0x4e07a(0x14c))/0x2)+-parseInt(_0x4e07a(0x139))/0x3*(-parseInt(_0x4e07a(0x13f))/0x4)+-parseInt(_0x4e07a(0x151))/0x5*(parseInt(_0x4e07a(0x13e))/0x6)+-parseInt(_0x4e07a(0x146))/0x7+parseInt(_0x4e07a(0x153))/0x8+parseInt(_0x4e07a(0x144))/0x9+parseInt(_0x4e07a(0x148))/0xa*(-parseInt(_0x4e07a(0x149))/0xb);if(_0x489b57===_0x53cb4a)break;else _0x5a0930['push'](_0x5a0930['shift']());}catch(_0x39b073){_0x5a0930['push'](_0x5a0930['shift']());}}}(a118_0x48c4,0x9ce62));import{existsSync}from'node:fs';import{homedir}from'node:os';function a118_0x48c4(){const _0x319383=['Unsafe\x20','appCode','CLAUDE_SKILL_ROOT','4782bUQMuw','47420mKuvdy','includes','filter','.claude','\x20for\x20local\x20path:\x20','4098321OFwMVo','path\x20segment','668675wnassH','claudeSkillsDir','19390QQouvq','5555DVzdDL','skills','homeDirName','158mQXWhh','.agents','cacheRoot','homeDir','validation','1985awzNiI','workbuddySkillsDir','4492240JdzhXC','1017DbXDKD','trim','237QJFvpI','.workbuddy'];a118_0x48c4=function(){return _0x319383;};return a118_0x48c4();}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(_0xedd2b0={}){const _0x4fdf82=a118_0x4a19,_0x246fef=_0xedd2b0[_0x4fdf82(0x14f)]??homedir(),_0x21d6d2=resolve(_0x246fef,PRODUCT_CONFIG[_0x4fdf82(0x14b)],'cache'),_0x51ef44=trimmedEnv('SKILL_ROOT'),_0x47b0ec=trimmedEnv(_0x4fdf82(0x13d)),_0x4ea8f9=resolve(_0x246fef,_0x4fdf82(0x13a)),_0x588618=_0xedd2b0[_0x4fdf82(0x152)]??(existsSync(_0x4ea8f9)?resolve(_0x4ea8f9,'skills'):undefined);return{'homeDir':_0x246fef,'cacheRoot':_0x21d6d2,'managedRoot':resolve(_0x246fef,PRODUCT_CONFIG[_0x4fdf82(0x14b)]),'agentsSkillsDir':_0xedd2b0['agentsSkillsDir']??_0x51ef44??resolve(_0x246fef,_0x4fdf82(0x14d),_0x4fdf82(0x14a)),'claudeSkillsDir':_0xedd2b0[_0x4fdf82(0x147)]??_0x47b0ec??resolve(_0x246fef,_0x4fdf82(0x142),'skills'),'workbuddySkillsDir':_0x588618};}export function runtimeAgentSkillRoots(_0xa02688){const _0xfeccb9=a118_0x4a19;return[_0xa02688['agentsSkillsDir'],_0xa02688['claudeSkillsDir'],_0xa02688[_0xfeccb9(0x152)]][_0xfeccb9(0x141)](_0x2968fc=>Boolean(_0x2968fc));}function a118_0x4a19(_0x4f664e,_0x181dc0){_0x4f664e=_0x4f664e-0x139;const _0x48c4a7=a118_0x48c4();let _0x4a19ff=_0x48c4a7[_0x4f664e];return _0x4a19ff;}export function getRuntimeSkillCacheRoot(_0x4011a6,_0x1e72be,_0x425681={}){const _0x4ee23f=a118_0x4a19,_0x4659b2=resolveSkillSyncPaths(_0x425681);return resolve(_0x4659b2[_0x4ee23f(0x14e)],_0x4011a6,fingerprintAccessKey(_0x1e72be),'skills');}export function getRuntimeSkillDir(_0x2d9f8a,_0x527889,_0x500e9a,_0x31cb83,_0x3374c5,_0x5182a8={}){const _0x5ac51e=a118_0x4a19;return resolve(getRuntimeSkillCacheRoot(_0x2d9f8a,_0x527889,_0x5182a8),safePathSegment(_0x500e9a,_0x5ac51e(0x13c)),_0x31cb83,safePathSegment(_0x3374c5,'skillCode'));}export function safePathSegment(_0x5e63e7,_0x27211f=a118_0x336e93(0x145)){const _0x1d8882=a118_0x336e93;if(!_0x5e63e7||_0x5e63e7[_0x1d8882(0x140)]('/')||_0x5e63e7[_0x1d8882(0x140)]('\x5c')||_0x5e63e7['includes']('..'))throw CliErrors[_0x1d8882(0x150)](_0x1d8882(0x13b)+_0x27211f+_0x1d8882(0x143)+_0x5e63e7);return _0x5e63e7;}function trimmedEnv(_0x49089f){const _0x171dd8=a118_0x336e93,_0x2b4225=productEnv(_0x49089f)?.[_0x171dd8(0x155)]();return _0x2b4225?_0x2b4225:undefined;}
@@ -1 +1 @@
1
- (function(_0x620bf0,_0x4a4eed){const _0x44aa52=a117_0x533a,_0x5252af=_0x620bf0();while(!![]){try{const _0x1fb4ee=parseInt(_0x44aa52(0xc2))/0x1+-parseInt(_0x44aa52(0xf3))/0x2*(-parseInt(_0x44aa52(0xc5))/0x3)+parseInt(_0x44aa52(0xc6))/0x4*(parseInt(_0x44aa52(0xe1))/0x5)+-parseInt(_0x44aa52(0xc7))/0x6*(-parseInt(_0x44aa52(0xd7))/0x7)+parseInt(_0x44aa52(0xc3))/0x8*(parseInt(_0x44aa52(0xf7))/0x9)+-parseInt(_0x44aa52(0xed))/0xa+-parseInt(_0x44aa52(0xcd))/0xb;if(_0x1fb4ee===_0x4a4eed)break;else _0x5252af['push'](_0x5252af['shift']());}catch(_0x4a4a07){_0x5252af['push'](_0x5252af['shift']());}}}(a117_0x1791,0x84478));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a117_0xbc08f1}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 a117_0x1791(){const _0x2c6d64=['displayName','4360RZeydR','number','isFile','isArray','614277UOtxMr','ignoreMetadataScope','(unknown)','utf8','match','sourceSessionId','tags','replace','isDirectory','\x20to\x20submit\x20company\x20Skills\x20for\x20review.','ignoreMetadataForPayload','allowAppCodeRetarget','1057241bMyQVl','24QSNGph','description','420YfemSz','2891516iDAbTN','59082pasDaJ','ignoreMetadataAppCodeMismatch','builtin','length','validation','Remote\x20Skill\x20','25262314QpVRhe','string','object','isSymbolicLink','unknown','version','skillName','Unable\x20to\x20resolve\x20skillCode\x20from\x20','toLowerCase','name','441rMpDep','refreshedAt','personal','trim','skillCode','dir','company','\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22','ignoreInvalidMetadata','files','5cwrUfJ','path','\x20has\x20unsupported\x20scope\x20\x22','Skill\x20metadata\x20appCode\x20\x22','scope','startsWith','excludedFilePaths','content','Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20','slice','appCode','Skill\x20directory\x20not\x20found:\x20','720500gTDvXY','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20','pushedAt','some','boolean'];a117_0x1791=function(){return _0x2c6d64;};return a117_0x1791();}import{buildSkillPackage,tryNormalizePackageManifest}from'./zip-package.js';export function resolvePushDirectoryIdentity(_0x1075ab,_0x435f49,_0x35fde2={}){const _0x540976=a117_0x533a,_0x5cea1d=resolvePushDirectoryRoot(_0x1075ab),_0x2b1564=readPushMetadataIfPresent(resolve(_0x5cea1d,METADATA_FILE),{'ignoreInvalidMetadata':_0x35fde2[_0x540976(0xdf)]});if(_0x2b1564?.[_0x540976(0xeb)]&&_0x2b1564[_0x540976(0xeb)]!==_0x435f49&&!_0x35fde2[_0x540976(0xc1)]&&!_0x35fde2[_0x540976(0xc8)])throw CliErrors[_0x540976(0xcb)](_0x540976(0xe4)+_0x2b1564[_0x540976(0xeb)]+_0x540976(0xde)+_0x435f49+'\x22.');const _0x1dab02=resolvePushSkillCode(_0x5cea1d,_0x435f49,_0x2b1564,_0x35fde2);if(!_0x1dab02)throw CliErrors[_0x540976(0xcb)](_0x540976(0xd4)+SKILL_FILE+',\x20'+METADATA_FILE+',\x20or\x20directory\x20name.');return{'dir':_0x5cea1d,'skillCode':_0x1dab02,'metadata':_0x2b1564};}export function readPushDirectory(_0x522733,_0x2356ed,_0x2acdc7={}){const _0x4f7b40=a117_0x533a,_0x5f10b5=resolvePushDirectoryIdentity(_0x522733,_0x2356ed,_0x2acdc7),_0x5bc4f7=_0x5f10b5[_0x4f7b40(0xdc)],_0x658122=resolve(_0x5bc4f7,SKILL_FILE);if(!existsSync(_0x658122)||!lstatSync(_0x658122)[_0x4f7b40(0xf5)]())throw CliErrors[_0x4f7b40(0xcb)]('Missing\x20'+SKILL_FILE+':\x20'+_0x658122);const _0x8662a=_0x5f10b5['metadata'],_0x28447c=_0x2acdc7['targetScope']??_0x4f7b40(0xd9);if(!_0x2acdc7[_0x4f7b40(0xf8)]&&_0x8662a?.[_0x4f7b40(0xe5)]===_0x4f7b40(0xc9))throw CliErrors[_0x4f7b40(0xcb)](_0x4f7b40(0xe9)+METADATA_FILE+'\x20has\x20scope=\x22'+_0x8662a[_0x4f7b40(0xe5)]+'\x22.');if(!_0x2acdc7['ignoreMetadataScope']&&_0x28447c===_0x4f7b40(0xd9)&&_0x8662a?.[_0x4f7b40(0xe5)]&&_0x8662a['scope']!==_0x4f7b40(0xd9))throw CliErrors['validation']('Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20'+METADATA_FILE+'\x20has\x20scope=\x22'+_0x8662a[_0x4f7b40(0xe5)]+'\x22.',_0x4f7b40(0xee)+_0x5bc4f7+_0x4f7b40(0xbf));const _0x1dbe4a=scanSkillDirectory(_0x5bc4f7,{'excludedFilePaths':_0x2acdc7[_0x4f7b40(0xe7)]}),_0x4ad6bf=buildSkillPackage(_0x1dbe4a),_0x40cd97=readFileSync(_0x658122,'utf8'),_0x412397=_0x5f10b5['skillCode'],_0x2b56dd=_0x2acdc7[_0x4f7b40(0xc0)]?undefined:_0x8662a,_0x3b3ca8=readSkillDisplayName(_0x40cd97);return{'skillCode':_0x412397,'metadata':_0x8662a,'frontmatterDisplayName':_0x3b3ca8,'input':{'skillCode':_0x412397,'skillName':_0x3b3ca8??_0x2b56dd?.['skillName'],'description':_0x2b56dd?.[_0x4f7b40(0xc4)],'content':_0x40cd97,'files':_0x4ad6bf['manifest'],'packageBase64':_0x4ad6bf['packageBase64'],'tags':_0x2b56dd?.['tags'],'version':_0x2b56dd?.[_0x4f7b40(0xd2)],'sourceSessionId':_0x2b56dd?.[_0x4f7b40(0xfc)]}};}export function refreshPushDirectoryMetadataFromRemote(_0x46c6fb,_0x385e00,_0x40833a,_0xe3d0f6={}){const _0x126ef1=a117_0x533a,_0x10aa13=resolvePushDirectoryRoot(_0x46c6fb),_0x27ab99=readPushMetadataIfPresent(resolve(_0x10aa13,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x1287a6=requireRemoteScope(_0x385e00),_0x1b7d10=readLocalSkillContent(_0x10aa13),_0x292545={..._0x385e00,'appCode':_0x385e00[_0x126ef1(0xeb)]??_0x40833a,'skillName':_0x385e00[_0x126ef1(0xd3)]??_0x27ab99?.['skillName'],'description':_0x385e00[_0x126ef1(0xc4)]??_0x27ab99?.['description'],'tags':Array['isArray'](_0x385e00[_0x126ef1(0xfd)])?_0x385e00[_0x126ef1(0xfd)]:_0x27ab99?.[_0x126ef1(0xfd)],'sourceSessionId':_0x385e00[_0x126ef1(0xfc)]??_0x27ab99?.[_0x126ef1(0xfc)],'content':_0x385e00[_0x126ef1(0xe8)]??_0x1b7d10},_0x135708=buildMetadata(_0x292545,_0x1287a6,_0x40833a,contentHash(_0x1b7d10),_0xe3d0f6[_0x126ef1(0xd8)]);writeJsonAtomic(resolve(_0x10aa13,METADATA_FILE),_0x135708);}export function recordPushedRuntimeSkill(_0x1c3946,_0x1a53ba,_0x5f37dd,_0x587206={}){const _0x33a0a2=a117_0x533a,_0x44d114=resolvePushDirectoryRoot(_0x1c3946),_0x26433f=scanSkillDirectory(_0x44d114),_0x155a20=_0x26433f['find'](_0x1bd387=>_0x1bd387['path']===SKILL_FILE),_0x579220=_0x155a20?fileText(_0x155a20):'',_0x41054a=tryNormalizePackageManifest(_0x1a53ba[_0x33a0a2(0xe0)]),_0x4787b7={..._0x1a53ba,'content':_0x1a53ba[_0x33a0a2(0xe8)]??_0x579220,'files':_0x41054a},_0x3f360a=_0x41054a?normalizeLocalFiles(_0x26433f)['filter'](_0x393b3e=>_0x41054a[_0x33a0a2(0xe0)][_0x33a0a2(0xf0)](_0x12cac3=>_0x12cac3[_0x33a0a2(0xe2)]===_0x393b3e[_0x33a0a2(0xe2)])):undefined,_0x5838f1=buildMetadata(_0x4787b7,_0x587206[_0x33a0a2(0xe5)]??_0x33a0a2(0xd9),_0x5f37dd,contentHash(_0x4787b7['content']??''),_0x587206[_0x33a0a2(0xef)],_0x3f360a);writeJsonAtomic(resolve(_0x44d114,METADATA_FILE),_0x5838f1);}export function deriveSkillCodeFromDirectory(_0x253733,_0x5a2c81){const _0x31db47=a117_0x533a,_0x495699=basename(resolve(_0x253733)),_0x6b8213=_0x5a2c81+'--';return _0x495699[_0x31db47(0xe6)](_0x6b8213)?_0x495699[_0x31db47(0xea)](_0x6b8213[_0x31db47(0xca)]):_0x495699;}function resolvePushSkillCode(_0xb267bd,_0x402f19,_0x3360ac,_0x30e2fb){const _0x1dd069=a117_0x533a,_0x590ab9=deriveSkillCodeFromSkillFile(_0xb267bd)||deriveSkillCodeFromDirectory(_0xb267bd,_0x402f19);if(_0x30e2fb['ignoreMetadataSkillCode'])return _0x590ab9;return _0x3360ac?.[_0x1dd069(0xdb)]?.[_0x1dd069(0xda)]()||_0x590ab9;}function deriveSkillCodeFromSkillFile(_0x4ef3e4){const _0x3deb5f=a117_0x533a,_0xc71fa9=resolve(_0x4ef3e4,SKILL_FILE);if(!existsSync(_0xc71fa9)||!lstatSync(_0xc71fa9)['isFile']())return undefined;const _0x10609c=readFileSync(_0xc71fa9,'utf8'),_0x44cfaa=_0x10609c['match'](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x44cfaa)return undefined;const _0x817904=parseFrontmatterObject(_0x44cfaa[0x1]??''),_0x39b2eb=scalarToString(_0x817904?.[_0x3deb5f(0xd6)]);return _0x39b2eb?slugifySkillName(_0x39b2eb):undefined;}function readSkillDisplayName(_0x2ad41f){const _0xc809ba=a117_0x533a,_0xb5c863=_0x2ad41f[_0xc809ba(0xfb)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0xb5c863)return undefined;const _0x22be75=parseFrontmatterObject(_0xb5c863[0x1]??'');return scalarToString(_0x22be75?.[_0xc809ba(0xf2)]);}function a117_0x533a(_0x146443,_0x249edb){_0x146443=_0x146443-0xbd;const _0x17916f=a117_0x1791();let _0x533ac1=_0x17916f[_0x146443];return _0x533ac1;}function slugifySkillName(_0x486982){const _0x2e24ec=a117_0x533a,_0x17769d=_0x486982[_0x2e24ec(0xda)]()[_0x2e24ec(0xd5)]()[_0x2e24ec(0xbd)](/[^\p{L}\p{N}\p{So}]+/gu,'-')[_0x2e24ec(0xbd)](/^-+/,'')[_0x2e24ec(0xbd)](/-+$/,'')[_0x2e24ec(0xbd)](/-{2,}/g,'-');if(!_0x17769d)throw CliErrors[_0x2e24ec(0xcb)]('Invalid\x20'+SKILL_FILE+'\x20name\x20for\x20SkillHub\x20slug\x20generation.');return _0x17769d;}function parseFrontmatterObject(_0x1e2519){const _0x3f564a=a117_0x533a;try{const _0x23e18a=a117_0xbc08f1(_0x1e2519);return _0x23e18a&&typeof _0x23e18a===_0x3f564a(0xcf)&&!Array[_0x3f564a(0xf6)](_0x23e18a)?_0x23e18a:undefined;}catch{return undefined;}}function scalarToString(_0x51037a){const _0x5a4f43=a117_0x533a;if(typeof _0x51037a===_0x5a4f43(0xce))return _0x51037a[_0x5a4f43(0xda)]();if(typeof _0x51037a===_0x5a4f43(0xf4)||typeof _0x51037a===_0x5a4f43(0xf1))return String(_0x51037a);return undefined;}function resolvePushDirectoryRoot(_0x42c969){const _0x35e39e=a117_0x533a,_0x2832ab=resolve(_0x42c969);if(!existsSync(_0x2832ab))throw CliErrors[_0x35e39e(0xcb)](_0x35e39e(0xec)+_0x42c969);const _0x1cf246=lstatSync(_0x2832ab);if(_0x1cf246[_0x35e39e(0xbe)]())return _0x2832ab;if(_0x1cf246[_0x35e39e(0xd0)]()){const _0x22f71a=realpathSync(_0x2832ab);if(lstatSync(_0x22f71a)[_0x35e39e(0xbe)]())return _0x22f71a;}throw CliErrors['validation'](_0x35e39e(0xec)+_0x42c969);}function requireRemoteScope(_0x5881a7){const _0x48976b=a117_0x533a;if(_0x5881a7[_0x48976b(0xe5)]===_0x48976b(0xd9)||_0x5881a7[_0x48976b(0xe5)]===_0x48976b(0xdd)||_0x5881a7[_0x48976b(0xe5)]===_0x48976b(0xc9))return _0x5881a7[_0x48976b(0xe5)];throw CliErrors[_0x48976b(0xcb)](_0x48976b(0xcc)+(_0x5881a7[_0x48976b(0xdb)]||_0x48976b(0xf9))+_0x48976b(0xe3)+(_0x5881a7[_0x48976b(0xe5)]??_0x48976b(0xd1))+'\x22.');}function readLocalSkillContent(_0x38c12d){const _0x55a238=a117_0x533a,_0x2a896f=resolve(_0x38c12d,SKILL_FILE);return existsSync(_0x2a896f)&&lstatSync(_0x2a896f)[_0x55a238(0xf5)]()?readFileSync(_0x2a896f,_0x55a238(0xfa)):'';}function readPushMetadataIfPresent(_0x1210b7,_0x310498={}){try{return readMetadataIfPresent(_0x1210b7);}catch(_0xae9ef6){if(_0x310498['ignoreInvalidMetadata'])return undefined;throw _0xae9ef6;}}
1
+ (function(_0x131381,_0x1ced35){const _0x138680=a119_0x156a,_0x470356=_0x131381();while(!![]){try{const _0x237e7e=parseInt(_0x138680(0x1f8))/0x1*(-parseInt(_0x138680(0x1c5))/0x2)+parseInt(_0x138680(0x1d0))/0x3+-parseInt(_0x138680(0x1eb))/0x4*(-parseInt(_0x138680(0x1f2))/0x5)+parseInt(_0x138680(0x1ec))/0x6+parseInt(_0x138680(0x1df))/0x7+-parseInt(_0x138680(0x1c9))/0x8+-parseInt(_0x138680(0x1d5))/0x9;if(_0x237e7e===_0x1ced35)break;else _0x470356['push'](_0x470356['shift']());}catch(_0x59df55){_0x470356['push'](_0x470356['shift']());}}}(a119_0x5198,0xb2f63));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a119_0x93a14a}from'yaml';import{CliErrors}from'../../errors.js';function a119_0x5198(){const _0x4d88ba=['3859366bTAvhl','company','content','ignoreMetadataAppCodeMismatch','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20','toLowerCase','description','isDirectory','ignoreMetadataScope','Remote\x20Skill\x20','find','\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22','10848NrhXxv','4912536PILaqO','path','replace','Invalid\x20','isSymbolicLink','filter','300oghLQs','builtin','utf8','tags','object','Skill\x20directory\x20not\x20found:\x20','7AQRdXi','files','Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20','Unable\x20to\x20resolve\x20skillCode\x20from\x20','\x20name\x20for\x20SkillHub\x20slug\x20generation.','boolean','skillCode','unknown','skillName','trim','\x20has\x20scope=\x22','packageBase64','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20','isArray','111858ShNlZd','pushedAt','slice','some','1812688yKwixl','isFile','dir','appCode','validation','string','displayName','4332537GMERyd','name','ignoreInvalidMetadata','sourceSessionId','Missing\x20','14632893NmkZjb','scope','personal','excludedFilePaths','(unknown)','ignoreMetadataSkillCode','match','number','length','targetScope'];a119_0x5198=function(){return _0x4d88ba;};return a119_0x5198();}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(_0x3999b8,_0x5bd171,_0x56d37b={}){const _0x35bb46=a119_0x156a,_0x4ebfe0=resolvePushDirectoryRoot(_0x3999b8),_0x1dd126=readPushMetadataIfPresent(resolve(_0x4ebfe0,METADATA_FILE),{'ignoreInvalidMetadata':_0x56d37b['ignoreInvalidMetadata']});if(_0x1dd126?.[_0x35bb46(0x1cc)]&&_0x1dd126[_0x35bb46(0x1cc)]!==_0x5bd171&&!_0x56d37b['allowAppCodeRetarget']&&!_0x56d37b[_0x35bb46(0x1e2)])throw CliErrors['validation']('Skill\x20metadata\x20appCode\x20\x22'+_0x1dd126[_0x35bb46(0x1cc)]+_0x35bb46(0x1ea)+_0x5bd171+'\x22.');const _0x49d73d=resolvePushSkillCode(_0x4ebfe0,_0x5bd171,_0x1dd126,_0x56d37b);if(!_0x49d73d)throw CliErrors[_0x35bb46(0x1cd)](_0x35bb46(0x1fb)+SKILL_FILE+',\x20'+METADATA_FILE+',\x20or\x20directory\x20name.');return{'dir':_0x4ebfe0,'skillCode':_0x49d73d,'metadata':_0x1dd126};}export function readPushDirectory(_0x256c1d,_0x2f90de,_0x4854ce={}){const _0x50d629=a119_0x156a,_0x4538dd=resolvePushDirectoryIdentity(_0x256c1d,_0x2f90de,_0x4854ce),_0x49cde7=_0x4538dd[_0x50d629(0x1cb)],_0x2fc0b2=resolve(_0x49cde7,SKILL_FILE);if(!existsSync(_0x2fc0b2)||!lstatSync(_0x2fc0b2)[_0x50d629(0x1ca)]())throw CliErrors['validation'](_0x50d629(0x1d4)+SKILL_FILE+':\x20'+_0x2fc0b2);const _0x37dda8=_0x4538dd['metadata'],_0x28ebc3=_0x4854ce[_0x50d629(0x1de)]??_0x50d629(0x1d7);if(!_0x4854ce[_0x50d629(0x1e7)]&&_0x37dda8?.[_0x50d629(0x1d6)]===_0x50d629(0x1f3))throw CliErrors[_0x50d629(0x1cd)](_0x50d629(0x1fa)+METADATA_FILE+_0x50d629(0x1c1)+_0x37dda8[_0x50d629(0x1d6)]+'\x22.');if(!_0x4854ce[_0x50d629(0x1e7)]&&_0x28ebc3===_0x50d629(0x1d7)&&_0x37dda8?.['scope']&&_0x37dda8[_0x50d629(0x1d6)]!==_0x50d629(0x1d7))throw CliErrors[_0x50d629(0x1cd)](_0x50d629(0x1e3)+METADATA_FILE+_0x50d629(0x1c1)+_0x37dda8['scope']+'\x22.',_0x50d629(0x1c3)+_0x49cde7+'\x20to\x20submit\x20company\x20Skills\x20for\x20review.');const _0x20a437=scanSkillDirectory(_0x49cde7,{'excludedFilePaths':_0x4854ce[_0x50d629(0x1d8)]}),_0x7feffa=buildSkillPackage(_0x20a437),_0x1a8ed8=readFileSync(_0x2fc0b2,'utf8'),_0x34e944=_0x4538dd[_0x50d629(0x1bd)],_0x5698f2=_0x4854ce['ignoreMetadataForPayload']?undefined:_0x37dda8,_0x2685d2=readSkillDisplayName(_0x1a8ed8);return{'skillCode':_0x34e944,'metadata':_0x37dda8,'frontmatterDisplayName':_0x2685d2,'input':{'skillCode':_0x34e944,'skillName':_0x2685d2??_0x5698f2?.[_0x50d629(0x1bf)],'description':_0x5698f2?.[_0x50d629(0x1e5)],'content':_0x1a8ed8,'files':_0x7feffa['manifest'],'packageBase64':_0x7feffa[_0x50d629(0x1c2)],'tags':_0x5698f2?.[_0x50d629(0x1f5)],'version':_0x5698f2?.['version'],'sourceSessionId':_0x5698f2?.['sourceSessionId']}};}export function refreshPushDirectoryMetadataFromRemote(_0x37ee24,_0x1cb770,_0x4eb9ad,_0x56c06e={}){const _0x151ba7=a119_0x156a,_0x9d23aa=resolvePushDirectoryRoot(_0x37ee24),_0x347acf=readPushMetadataIfPresent(resolve(_0x9d23aa,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x4b6123=requireRemoteScope(_0x1cb770),_0x3a14fd=readLocalSkillContent(_0x9d23aa),_0x212eed={..._0x1cb770,'appCode':_0x1cb770['appCode']??_0x4eb9ad,'skillName':_0x1cb770[_0x151ba7(0x1bf)]??_0x347acf?.[_0x151ba7(0x1bf)],'description':_0x1cb770[_0x151ba7(0x1e5)]??_0x347acf?.[_0x151ba7(0x1e5)],'tags':Array['isArray'](_0x1cb770['tags'])?_0x1cb770['tags']:_0x347acf?.[_0x151ba7(0x1f5)],'sourceSessionId':_0x1cb770[_0x151ba7(0x1d3)]??_0x347acf?.[_0x151ba7(0x1d3)],'content':_0x1cb770[_0x151ba7(0x1e1)]??_0x3a14fd},_0x499901=buildMetadata(_0x212eed,_0x4b6123,_0x4eb9ad,contentHash(_0x3a14fd),_0x56c06e['refreshedAt']);writeJsonAtomic(resolve(_0x9d23aa,METADATA_FILE),_0x499901);}export function recordPushedRuntimeSkill(_0x2a0fa5,_0x59d47b,_0x5833f6,_0x425146={}){const _0xad996a=a119_0x156a,_0x57d069=resolvePushDirectoryRoot(_0x2a0fa5),_0xb9e6ed=scanSkillDirectory(_0x57d069),_0xfc93fe=_0xb9e6ed[_0xad996a(0x1e9)](_0x2aba13=>_0x2aba13[_0xad996a(0x1ed)]===SKILL_FILE),_0x19dcd3=_0xfc93fe?fileText(_0xfc93fe):'',_0x25cd9e=tryNormalizePackageManifest(_0x59d47b[_0xad996a(0x1f9)]),_0x5b97b6={..._0x59d47b,'content':_0x59d47b['content']??_0x19dcd3,'files':_0x25cd9e},_0x3f5263=_0x25cd9e?normalizeLocalFiles(_0xb9e6ed)[_0xad996a(0x1f1)](_0x4142ff=>_0x25cd9e['files'][_0xad996a(0x1c8)](_0x3190ae=>_0x3190ae['path']===_0x4142ff[_0xad996a(0x1ed)])):undefined,_0x300571=buildMetadata(_0x5b97b6,_0x425146['scope']??_0xad996a(0x1d7),_0x5833f6,contentHash(_0x5b97b6[_0xad996a(0x1e1)]??''),_0x425146[_0xad996a(0x1c6)],_0x3f5263);writeJsonAtomic(resolve(_0x57d069,METADATA_FILE),_0x300571);}export function deriveSkillCodeFromDirectory(_0x43b0f4,_0x2ec7b8){const _0x2f7b3d=a119_0x156a,_0xe1c6d=basename(resolve(_0x43b0f4)),_0x1798e9=_0x2ec7b8+'--';return _0xe1c6d['startsWith'](_0x1798e9)?_0xe1c6d[_0x2f7b3d(0x1c7)](_0x1798e9[_0x2f7b3d(0x1dd)]):_0xe1c6d;}function resolvePushSkillCode(_0x24f2af,_0x3e776b,_0x40615a,_0x1e1ff7){const _0x477112=a119_0x156a,_0x8dad66=deriveSkillCodeFromSkillFile(_0x24f2af)||deriveSkillCodeFromDirectory(_0x24f2af,_0x3e776b);if(_0x1e1ff7[_0x477112(0x1da)])return _0x8dad66;return _0x40615a?.[_0x477112(0x1bd)]?.[_0x477112(0x1c0)]()||_0x8dad66;}function deriveSkillCodeFromSkillFile(_0x43c565){const _0xbbd869=a119_0x156a,_0x4c801d=resolve(_0x43c565,SKILL_FILE);if(!existsSync(_0x4c801d)||!lstatSync(_0x4c801d)[_0xbbd869(0x1ca)]())return undefined;const _0x78f134=readFileSync(_0x4c801d,_0xbbd869(0x1f4)),_0x42c717=_0x78f134[_0xbbd869(0x1db)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x42c717)return undefined;const _0x40d3b8=parseFrontmatterObject(_0x42c717[0x1]??''),_0x182084=scalarToString(_0x40d3b8?.[_0xbbd869(0x1d1)]);return _0x182084?slugifySkillName(_0x182084):undefined;}function readSkillDisplayName(_0x382a0){const _0x4a09fc=a119_0x156a,_0x423ee8=_0x382a0[_0x4a09fc(0x1db)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x423ee8)return undefined;const _0x273e2f=parseFrontmatterObject(_0x423ee8[0x1]??'');return scalarToString(_0x273e2f?.[_0x4a09fc(0x1cf)]);}function slugifySkillName(_0x1c10c7){const _0x20ddb5=a119_0x156a,_0x165a7f=_0x1c10c7[_0x20ddb5(0x1c0)]()[_0x20ddb5(0x1e4)]()[_0x20ddb5(0x1ee)](/[^\p{L}\p{N}\p{So}]+/gu,'-')[_0x20ddb5(0x1ee)](/^-+/,'')[_0x20ddb5(0x1ee)](/-+$/,'')[_0x20ddb5(0x1ee)](/-{2,}/g,'-');if(!_0x165a7f)throw CliErrors['validation'](_0x20ddb5(0x1ef)+SKILL_FILE+_0x20ddb5(0x1fc));return _0x165a7f;}function a119_0x156a(_0x38947a,_0x4583ab){_0x38947a=_0x38947a-0x1bd;const _0x519813=a119_0x5198();let _0x156a23=_0x519813[_0x38947a];return _0x156a23;}function parseFrontmatterObject(_0x421139){const _0x21cd13=a119_0x156a;try{const _0x4dabaf=a119_0x93a14a(_0x421139);return _0x4dabaf&&typeof _0x4dabaf===_0x21cd13(0x1f6)&&!Array[_0x21cd13(0x1c4)](_0x4dabaf)?_0x4dabaf:undefined;}catch{return undefined;}}function scalarToString(_0x3d1b8b){const _0x534ac6=a119_0x156a;if(typeof _0x3d1b8b===_0x534ac6(0x1ce))return _0x3d1b8b[_0x534ac6(0x1c0)]();if(typeof _0x3d1b8b===_0x534ac6(0x1dc)||typeof _0x3d1b8b===_0x534ac6(0x1fd))return String(_0x3d1b8b);return undefined;}function resolvePushDirectoryRoot(_0x22503b){const _0x5315c0=a119_0x156a,_0xd6f4f9=resolve(_0x22503b);if(!existsSync(_0xd6f4f9))throw CliErrors[_0x5315c0(0x1cd)](_0x5315c0(0x1f7)+_0x22503b);const _0x35061b=lstatSync(_0xd6f4f9);if(_0x35061b[_0x5315c0(0x1e6)]())return _0xd6f4f9;if(_0x35061b[_0x5315c0(0x1f0)]()){const _0xee1304=realpathSync(_0xd6f4f9);if(lstatSync(_0xee1304)['isDirectory']())return _0xee1304;}throw CliErrors['validation'](_0x5315c0(0x1f7)+_0x22503b);}function requireRemoteScope(_0x2e69f6){const _0x14ca49=a119_0x156a;if(_0x2e69f6[_0x14ca49(0x1d6)]===_0x14ca49(0x1d7)||_0x2e69f6[_0x14ca49(0x1d6)]===_0x14ca49(0x1e0)||_0x2e69f6[_0x14ca49(0x1d6)]===_0x14ca49(0x1f3))return _0x2e69f6[_0x14ca49(0x1d6)];throw CliErrors[_0x14ca49(0x1cd)](_0x14ca49(0x1e8)+(_0x2e69f6[_0x14ca49(0x1bd)]||_0x14ca49(0x1d9))+'\x20has\x20unsupported\x20scope\x20\x22'+(_0x2e69f6[_0x14ca49(0x1d6)]??_0x14ca49(0x1be))+'\x22.');}function readLocalSkillContent(_0x3ade64){const _0x52d89a=a119_0x156a,_0x1a0dfc=resolve(_0x3ade64,SKILL_FILE);return existsSync(_0x1a0dfc)&&lstatSync(_0x1a0dfc)[_0x52d89a(0x1ca)]()?readFileSync(_0x1a0dfc,_0x52d89a(0x1f4)):'';}function readPushMetadataIfPresent(_0x34ef39,_0x3617e4={}){const _0x38031b=a119_0x156a;try{return readMetadataIfPresent(_0x34ef39);}catch(_0x54e663){if(_0x3617e4[_0x38031b(0x1d2)])return undefined;throw _0x54e663;}}
@@ -1 +1 @@
1
- (function(_0xaea109,_0x459faf){const _0x5c9b89=a118_0x157b,_0x5e30c2=_0xaea109();while(!![]){try{const _0x33ba94=parseInt(_0x5c9b89(0xd0))/0x1+parseInt(_0x5c9b89(0xcb))/0x2+parseInt(_0x5c9b89(0xcf))/0x3*(parseInt(_0x5c9b89(0xd8))/0x4)+-parseInt(_0x5c9b89(0xcd))/0x5+-parseInt(_0x5c9b89(0xd5))/0x6*(-parseInt(_0x5c9b89(0xcc))/0x7)+parseInt(_0x5c9b89(0xd6))/0x8*(parseInt(_0x5c9b89(0xd4))/0x9)+parseInt(_0x5c9b89(0xd7))/0xa*(-parseInt(_0x5c9b89(0xd3))/0xb);if(_0x33ba94===_0x459faf)break;else _0x5e30c2['push'](_0x5e30c2['shift']());}catch(_0x3c7a31){_0x5e30c2['push'](_0x5e30c2['shift']());}}}(a118_0x279d,0xbfc92));import{CliErrors}from'../../errors.js';function a118_0x157b(_0x470d48,_0x1e9e24){_0x470d48=_0x470d48-0xc8;const _0x279db5=a118_0x279d();let _0x157bb4=_0x279db5[_0x470d48];return _0x157bb4;}export function normalizeRuntimeSkillScopes(_0x4950a9){const _0x151cb2=a118_0x157b,_0x48f2b4=_0x4950a9&&_0x4950a9[_0x151cb2(0xd2)]>0x0?_0x4950a9:[_0x151cb2(0xca),_0x151cb2(0xc8),_0x151cb2(0xce)],_0x451719=[];for(const _0x350d32 of _0x48f2b4){if(!isRuntimeSkillScope(_0x350d32))throw CliErrors['validation'](_0x151cb2(0xc9)+_0x350d32);!_0x451719[_0x151cb2(0xd1)](_0x350d32)&&_0x451719['push'](_0x350d32);}return _0x451719;}export function isRuntimeSkillScope(_0xf5e47c){const _0x42c0a6=a118_0x157b;return _0xf5e47c===_0x42c0a6(0xca)||_0xf5e47c==='company'||_0xf5e47c===_0x42c0a6(0xce);}function a118_0x279d(){const _0x546f43=['1880606vXNLho','7516820foQsVz','builtin','1083765DlgfCw','190464LsPNaZ','includes','length','57189vQnKsX','18sjpRbS','24LocHCq','4031792zOWmOY','1720NSCLTk','4oMxjzK','company','Unsupported\x20runtime\x20Skill\x20scope:\x20','personal','1097694BJBnJm'];a118_0x279d=function(){return _0x546f43;};return a118_0x279d();}
1
+ (function(_0x59e3dc,_0x4a65eb){const _0x359460=a120_0x3971,_0x32bce1=_0x59e3dc();while(!![]){try{const _0xb3f273=-parseInt(_0x359460(0x6b))/0x1+-parseInt(_0x359460(0x68))/0x2*(-parseInt(_0x359460(0x67))/0x3)+parseInt(_0x359460(0x74))/0x4*(parseInt(_0x359460(0x78))/0x5)+parseInt(_0x359460(0x6d))/0x6+parseInt(_0x359460(0x72))/0x7*(-parseInt(_0x359460(0x75))/0x8)+-parseInt(_0x359460(0x76))/0x9*(-parseInt(_0x359460(0x6c))/0xa)+-parseInt(_0x359460(0x6f))/0xb*(parseInt(_0x359460(0x73))/0xc);if(_0xb3f273===_0x4a65eb)break;else _0x32bce1['push'](_0x32bce1['shift']());}catch(_0x3d1567){_0x32bce1['push'](_0x32bce1['shift']());}}}(a120_0xb14f,0x358cc));function a120_0xb14f(){const _0x4201b1=['48oLobxG','1004PheddO','304408PHbvPs','342eRoVNV','includes','3060KgwFBo','company','1210938FTRNGd','2ICqibH','personal','push','210944SyOnwo','42590oZdtyr','2295342XCbVhj','length','1113794JArsFr','builtin','Unsupported\x20runtime\x20Skill\x20scope:\x20','49ZQWQBk'];a120_0xb14f=function(){return _0x4201b1;};return a120_0xb14f();}function a120_0x3971(_0xd7d5e8,_0x28515d){_0xd7d5e8=_0xd7d5e8-0x66;const _0xb14f02=a120_0xb14f();let _0x397164=_0xb14f02[_0xd7d5e8];return _0x397164;}import{CliErrors}from'../../errors.js';export function normalizeRuntimeSkillScopes(_0x4f4005){const _0x1af2e0=a120_0x3971,_0x47bcb1=_0x4f4005&&_0x4f4005[_0x1af2e0(0x6e)]>0x0?_0x4f4005:[_0x1af2e0(0x69),_0x1af2e0(0x66),_0x1af2e0(0x70)],_0x2487f6=[];for(const _0x22dd80 of _0x47bcb1){if(!isRuntimeSkillScope(_0x22dd80))throw CliErrors['validation'](_0x1af2e0(0x71)+_0x22dd80);!_0x2487f6[_0x1af2e0(0x77)](_0x22dd80)&&_0x2487f6[_0x1af2e0(0x6a)](_0x22dd80);}return _0x2487f6;}export function isRuntimeSkillScope(_0x18b26c){const _0x81c41a=a120_0x3971;return _0x18b26c==='personal'||_0x18b26c===_0x81c41a(0x66)||_0x18b26c==='builtin';}
@@ -1 +1 @@
1
- (function(_0x5c3e37,_0x136ab2){const _0x2c07ec=a120_0x2b2d,_0x8dbf9c=_0x5c3e37();while(!![]){try{const _0x3961f4=parseInt(_0x2c07ec(0x129))/0x1*(-parseInt(_0x2c07ec(0x115))/0x2)+-parseInt(_0x2c07ec(0x117))/0x3+-parseInt(_0x2c07ec(0x127))/0x4*(parseInt(_0x2c07ec(0x128))/0x5)+-parseInt(_0x2c07ec(0x11f))/0x6*(-parseInt(_0x2c07ec(0x11e))/0x7)+-parseInt(_0x2c07ec(0x125))/0x8*(parseInt(_0x2c07ec(0x119))/0x9)+parseInt(_0x2c07ec(0x123))/0xa+parseInt(_0x2c07ec(0x11c))/0xb*(parseInt(_0x2c07ec(0x12a))/0xc);if(_0x3961f4===_0x136ab2)break;else _0x8dbf9c['push'](_0x8dbf9c['shift']());}catch(_0x423e7c){_0x8dbf9c['push'](_0x8dbf9c['shift']());}}}(a120_0x49da,0xba3c2));import{unzipSync,zipSync}from'fflate';function a120_0x49da(){const _0x52f171=['655140WEcmwz','entries','64ejEjMo','validation','676JQqLNH','38795UzEOqX','17NZbOVS','21816CuRbcz','name','Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.','51430eCBiIk','validation_error','21078RADFTA','length','105003tGCPay','from','code','13563yyrcSD','object','1065743TcvVLl','12Czgprt','endsWith','sort','Runtime\x20Skill\x20package\x20contains\x20directory\x20entry:\x20'];a120_0x49da=function(){return _0x52f171;};return a120_0x49da();}import{CliErrors}from'../../errors.js';function a120_0x2b2d(_0xed8d2e,_0x1be0ce){_0xed8d2e=_0xed8d2e-0x113;const _0x49da12=a120_0x49da();let _0x2b2d86=_0x49da12[_0xed8d2e];return _0x2b2d86;}import{compareSkillFiles,fileContent,normalizeLocalFiles,normalizeSkillRelativePath}from'./local-files.js';const ZIP_MTIME=new Date('1980-01-01T00:00:00.000Z');export function createDeterministicZipPackage(_0xa8cf79){const _0x4489e8={};for(const _0x37d028 of normalizeLocalFiles(_0xa8cf79)){_0x4489e8[_0x37d028['path']]=fileContent(_0x37d028);}return Buffer['from'](zipSync(_0x4489e8,{'level':0x0,'mtime':ZIP_MTIME}));}export function parseZipPackage(_0x525cf9){const _0x4b2fa4=a120_0x2b2d;if(_0x525cf9[_0x4b2fa4(0x118)]<0x16)throw CliErrors[_0x4b2fa4(0x126)](_0x4b2fa4(0x114));let _0x193dcc;try{_0x193dcc=unzipSync(_0x525cf9,{'filter'(_0x316c04){const _0x39063c=_0x4b2fa4,_0x57a533=normalizeSkillRelativePath(_0x316c04[_0x39063c(0x113)]);if(_0x57a533[_0x39063c(0x120)]('/'))throw CliErrors[_0x39063c(0x126)](_0x39063c(0x122)+_0x57a533);return!![];}});}catch(_0x30aef3){if(isRuntimeSkillValidationError(_0x30aef3))throw _0x30aef3;throw CliErrors['validation']('Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.');}return Object[_0x4b2fa4(0x124)](_0x193dcc)['map'](([_0x24b6c5,_0x25fe2e])=>({'path':normalizeSkillRelativePath(_0x24b6c5),'bytes':Buffer[_0x4b2fa4(0x11a)](_0x25fe2e)}))[_0x4b2fa4(0x121)](compareSkillFiles);}function isRuntimeSkillValidationError(_0x1a9c28){const _0x539adc=a120_0x2b2d;return typeof _0x1a9c28===_0x539adc(0x11d)&&_0x1a9c28!==null&&_0x539adc(0x11b)in _0x1a9c28&&_0x1a9c28[_0x539adc(0x11b)]===_0x539adc(0x116);}
1
+ const a122_0x987955=a122_0x147d;function a122_0x147d(_0x17e091,_0x1af019){_0x17e091=_0x17e091-0x153;const _0x4ad354=a122_0x4ad3();let _0x147d2b=_0x4ad354[_0x17e091];return _0x147d2b;}function a122_0x4ad3(){const _0x175a25=['36YLPCZH','5210595iTYKLm','1436481oCMUHz','from','18568qHenOc','map','Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.','validation','2uYAlYA','151085aPgSKE','path','2529428IYfzeR','entries','1980-01-01T00:00:00.000Z','431525xNnAey','name','length','15800570XeoXdu','code','7jmMXpj'];a122_0x4ad3=function(){return _0x175a25;};return a122_0x4ad3();}(function(_0x4f95fa,_0x5a5e08){const _0x4da297=a122_0x147d,_0x311e5f=_0x4f95fa();while(!![]){try{const _0x1a0dac=-parseInt(_0x4da297(0x154))/0x1+-parseInt(_0x4da297(0x153))/0x2*(parseInt(_0x4da297(0x161))/0x3)+-parseInt(_0x4da297(0x156))/0x4+-parseInt(_0x4da297(0x159))/0x5*(parseInt(_0x4da297(0x15f))/0x6)+-parseInt(_0x4da297(0x15e))/0x7*(parseInt(_0x4da297(0x163))/0x8)+parseInt(_0x4da297(0x160))/0x9+parseInt(_0x4da297(0x15c))/0xa;if(_0x1a0dac===_0x5a5e08)break;else _0x311e5f['push'](_0x311e5f['shift']());}catch(_0x4f984d){_0x311e5f['push'](_0x311e5f['shift']());}}}(a122_0x4ad3,0x5bf10));import{unzipSync,zipSync}from'fflate';import{CliErrors}from'../../errors.js';import{compareSkillFiles,fileContent,normalizeLocalFiles,normalizeSkillRelativePath}from'./local-files.js';const ZIP_MTIME=new Date(a122_0x987955(0x158));export function createDeterministicZipPackage(_0x46a1ea){const _0x4d7b35=a122_0x987955,_0x2cb748={};for(const _0x1ddad8 of normalizeLocalFiles(_0x46a1ea)){_0x2cb748[_0x1ddad8[_0x4d7b35(0x155)]]=fileContent(_0x1ddad8);}return Buffer[_0x4d7b35(0x162)](zipSync(_0x2cb748,{'level':0x0,'mtime':ZIP_MTIME}));}export function parseZipPackage(_0x260999){const _0x208d56=a122_0x987955;if(_0x260999[_0x208d56(0x15b)]<0x16)throw CliErrors[_0x208d56(0x166)](_0x208d56(0x165));let _0x59188e;try{_0x59188e=unzipSync(_0x260999,{'filter'(_0x46ae43){const _0x3a0379=_0x208d56,_0x359ef9=normalizeSkillRelativePath(_0x46ae43[_0x3a0379(0x15a)]);if(_0x359ef9['endsWith']('/'))throw CliErrors[_0x3a0379(0x166)]('Runtime\x20Skill\x20package\x20contains\x20directory\x20entry:\x20'+_0x359ef9);return!![];}});}catch(_0x57848b){if(isRuntimeSkillValidationError(_0x57848b))throw _0x57848b;throw CliErrors[_0x208d56(0x166)](_0x208d56(0x165));}return Object[_0x208d56(0x157)](_0x59188e)[_0x208d56(0x164)](([_0x5e8dad,_0x4c4156])=>({'path':normalizeSkillRelativePath(_0x5e8dad),'bytes':Buffer[_0x208d56(0x162)](_0x4c4156)}))['sort'](compareSkillFiles);}function isRuntimeSkillValidationError(_0x3facbb){const _0x30f195=a122_0x987955;return typeof _0x3facbb==='object'&&_0x3facbb!==null&&'code'in _0x3facbb&&_0x3facbb[_0x30f195(0x15d)]==='validation_error';}
@@ -1 +1 @@
1
- (function(_0xcadfea,_0x4a1410){const _0x119049=a121_0x5c4b,_0x51c731=_0xcadfea();while(!![]){try{const _0x464da2=-parseInt(_0x119049(0xfc))/0x1*(-parseInt(_0x119049(0xe2))/0x2)+parseInt(_0x119049(0x108))/0x3*(-parseInt(_0x119049(0xf3))/0x4)+-parseInt(_0x119049(0xf4))/0x5*(-parseInt(_0x119049(0xec))/0x6)+-parseInt(_0x119049(0xf9))/0x7+parseInt(_0x119049(0xf5))/0x8+parseInt(_0x119049(0x115))/0x9*(parseInt(_0x119049(0x10f))/0xa)+parseInt(_0x119049(0x109))/0xb*(-parseInt(_0x119049(0xfb))/0xc);if(_0x464da2===_0x4a1410)break;else _0x51c731['push'](_0x51c731['shift']());}catch(_0x24266e){_0x51c731['push'](_0x51c731['shift']());}}}(a121_0x5c52,0x5e855));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';function a121_0x5c4b(_0x37be8d,_0x5e4f3e){_0x37be8d=_0x37be8d-0xe2;const _0x5c5274=a121_0x5c52();let _0x5c4bf7=_0x5c5274[_0x37be8d];return _0x5c4bf7;}import{createDeterministicZipPackage,parseZipPackage}from'./zip-codec.js';export function buildSkillPackage(_0x1047f3){const _0x876ae3=a121_0x5c4b,_0x14cabe=normalizeLocalFiles(_0x1047f3);if(!_0x14cabe[_0x876ae3(0x10e)](_0x34cc85=>_0x34cc85[_0x876ae3(0x10a)]===SKILL_FILE))throw CliErrors[_0x876ae3(0x10c)](_0x876ae3(0x116)+SKILL_FILE+_0x876ae3(0x102));const _0x19d8d5=localFilesToManifestFiles(_0x14cabe),_0x5ddd74=createDeterministicZipPackage(_0x14cabe);return{'manifest':{'schemaVersion':0x2,'treeSha256':fileTreeHash(_0x19d8d5),'zipSha256':bufferSha256(_0x5ddd74),'zipSize':_0x5ddd74['length'],'files':_0x19d8d5},'packageBytes':_0x5ddd74,'packageBase64':_0x5ddd74[_0x876ae3(0xfd)](_0x876ae3(0x106))};}function a121_0x5c52(){const _0x59959c=['609323YfUZtD','path','Runtime\x20Skill\x20file\x20tree\x20sha256\x20mismatch.','validation','bytes','some','2203430nFPAUK','push','Runtime\x20Skill\x20package\x20sha256\x20is\x20invalid.','trim','Runtime\x20Skill\x20package\x20is\x20missing\x20','isSafeInteger','27bEaevb','Missing\x20','20SgUyAj','Runtime\x20Skill\x20package\x20size\x20mismatch.','size','toLowerCase','Runtime\x20Skill\x20file\x20tree\x20sha256\x20is\x20invalid.','Runtime\x20Skill\x20package\x20size\x20is\x20invalid.','ossPath','zipSize','Runtime\x20Skill\x20package\x20file\x20size\x20mismatch:\x20','sha256','17454YoBSeG','zipSha256','requireOssPath','isArray','treeSha256','Duplicate\x20Skill\x20package\x20entry:\x20','length','4HtKWkP','565cBTrBC','3572624jkBTIm','Runtime\x20Skill\x20package\x20file\x20sha256\x20mismatch:\x20','files','get','3776255ZKfirN','map','60kqueRU','15761mlMgsk','toString','schemaVersion','Runtime\x20Skill\x20package\x20sha256\x20mismatch.','Runtime\x20Skill\x20package\x20is\x20missing\x20entry:\x20','string','\x20in\x20Skill\x20file\x20package.','Runtime\x20Skill\x20package\x20is\x20required\x20for\x20Skill\x20install:\x20','has','Runtime\x20Skill\x20manifest\x20is\x20missing\x20','base64','Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.','1171041MuViaD'];a121_0x5c52=function(){return _0x59959c;};return a121_0x5c52();}export function verifyRuntimeSkillPackage(_0x34ce34,_0x5ed6ac){const _0xad46b0=a121_0x5c4b,_0x2274a8=normalizePackageManifest(_0x34ce34,{'requireOssPath':![]});if(!_0x2274a8)throw CliErrors['validation'](_0xad46b0(0x107));return extractAndVerifyPackage(_0x2274a8,_0x5ed6ac);}export function verifyRuntimeSkillBundle(_0x16fb6e,_0x8ee642){const _0x5be13f=a121_0x5c4b,_0x2dccaa=normalizePackageManifest(_0x16fb6e,{'requireOssPath':![]});if(!_0x2dccaa)throw CliErrors[_0x5be13f(0x10c)](_0x5be13f(0x107));return extractAndVerifyPackageFiles(_0x2dccaa,_0x8ee642);}export function tryNormalizePackageManifest(_0x5c622e){return normalizePackageManifest(_0x5c622e,{'requireOssPath':![]});}export function requirePackageBytes(_0x583b46,_0x1a47c1){const _0x278119=a121_0x5c4b;if(!_0x1a47c1||_0x1a47c1[_0x278119(0xf2)]===0x0)throw CliErrors['validation'](_0x278119(0x103)+_0x583b46);return _0x1a47c1;}export function extractDownloadedPackage(_0x5b95c2){const _0x2a8e09=a121_0x5c4b,_0x46ba1b=parseZipPackage(_0x5b95c2)[_0x2a8e09(0xfa)](_0x24f9b1=>({'path':_0x24f9b1[_0x2a8e09(0x10a)],'bytes':_0x24f9b1['bytes']}));if(!_0x46ba1b[_0x2a8e09(0x10e)](_0x21fa6a=>_0x21fa6a['path']===SKILL_FILE))throw CliErrors[_0x2a8e09(0x10c)](_0x2a8e09(0x113)+SKILL_FILE+'.');return normalizeLocalFiles(_0x46ba1b);}export function localFilesToManifestFiles(_0x4efbf6){const _0x377d5c=a121_0x5c4b;return normalizeLocalFiles(_0x4efbf6)[_0x377d5c(0xfa)](_0x40968f=>({'path':_0x40968f[_0x377d5c(0x10a)],'sha256':fileHash(_0x40968f),'size':fileContent(_0x40968f)[_0x377d5c(0xf2)]}));}function normalizePackageManifest(_0x3542c9,_0x89828e){const _0xebce50=a121_0x5c4b;if(!_0x3542c9||typeof _0x3542c9!=='object'||Array[_0xebce50(0xef)](_0x3542c9))return undefined;const _0x52a10a=_0x3542c9,_0x1b008f=typeof _0x52a10a[_0xebce50(0xe8)]===_0xebce50(0x101)?_0x52a10a[_0xebce50(0xe8)][_0xebce50(0x112)]():undefined;if(_0x89828e[_0xebce50(0xee)]&&!_0x1b008f)return undefined;if(!Array[_0xebce50(0xef)](_0x52a10a[_0xebce50(0xf7)])||_0x52a10a[_0xebce50(0xf7)]['length']===0x0)return undefined;if(!isSha256Hex(_0x52a10a[_0xebce50(0xf0)]))throw CliErrors[_0xebce50(0x10c)](_0xebce50(0xe6));if(!isSha256Hex(_0x52a10a[_0xebce50(0xed)]))throw CliErrors['validation'](_0xebce50(0x111));if(!Number[_0xebce50(0x114)](_0x52a10a[_0xebce50(0xe9)])||_0x52a10a[_0xebce50(0xe9)]<0x0)throw CliErrors[_0xebce50(0x10c)](_0xebce50(0xe7));const _0x510af6=normalizeManifestFiles(_0x52a10a[_0xebce50(0xf7)]);if(!_0x510af6[_0xebce50(0x10e)](_0x341a30=>_0x341a30[_0xebce50(0x10a)]===SKILL_FILE))throw CliErrors[_0xebce50(0x10c)](_0xebce50(0x105)+SKILL_FILE+'.');const _0x49b96d=fileTreeHash(_0x510af6);if(_0x49b96d!==_0x52a10a[_0xebce50(0xf0)][_0xebce50(0xe5)]())throw CliErrors[_0xebce50(0x10c)](_0xebce50(0x10b));return{'schemaVersion':Number[_0xebce50(0x114)](_0x52a10a[_0xebce50(0xfe)])?_0x52a10a[_0xebce50(0xfe)]:0x2,'ossPath':_0x1b008f,'treeSha256':_0x49b96d,'zipSha256':_0x52a10a[_0xebce50(0xed)][_0xebce50(0xe5)](),'zipSize':_0x52a10a[_0xebce50(0xe9)],'files':_0x510af6};}function extractAndVerifyPackage(_0x3c067b,_0x207016){const _0x3ab224=a121_0x5c4b,_0x135d5c=normalizePackageManifest(_0x3c067b,{'requireOssPath':![]});if(!_0x135d5c)throw CliErrors[_0x3ab224(0x10c)](_0x3ab224(0x107));if(_0x207016[_0x3ab224(0xf2)]!==_0x135d5c['zipSize'])throw CliErrors['validation'](_0x3ab224(0xe3));const _0x5e3112=bufferSha256(_0x207016);if(_0x5e3112!==_0x135d5c[_0x3ab224(0xed)])throw CliErrors[_0x3ab224(0x10c)](_0x3ab224(0xff));return extractAndVerifyPackageFiles(_0x135d5c,_0x207016);}function extractAndVerifyPackageFiles(_0x1dc692,_0x3a4a30){const _0x4678f2=a121_0x5c4b,_0x397f2d=parseZipPackage(_0x3a4a30);if(_0x397f2d[_0x4678f2(0xf2)]!==_0x1dc692['files'][_0x4678f2(0xf2)])throw CliErrors[_0x4678f2(0x10c)]('Runtime\x20Skill\x20package\x20entry\x20list\x20mismatch.');const _0x132454=new Map();for(const _0x56cdc5 of _0x397f2d){if(_0x132454[_0x4678f2(0x104)](_0x56cdc5[_0x4678f2(0x10a)]))throw CliErrors[_0x4678f2(0x10c)](_0x4678f2(0xf1)+_0x56cdc5[_0x4678f2(0x10a)]);_0x132454['set'](_0x56cdc5[_0x4678f2(0x10a)],_0x56cdc5);}const _0x449369=[];for(const _0x4ca046 of _0x1dc692[_0x4678f2(0xf7)]){const _0x17b981=_0x132454[_0x4678f2(0xf8)](_0x4ca046[_0x4678f2(0x10a)]);if(!_0x17b981)throw CliErrors[_0x4678f2(0x10c)](_0x4678f2(0x100)+_0x4ca046[_0x4678f2(0x10a)]);if(_0x17b981[_0x4678f2(0x10d)]['length']!==_0x4ca046[_0x4678f2(0xe4)])throw CliErrors[_0x4678f2(0x10c)](_0x4678f2(0xea)+_0x4ca046[_0x4678f2(0x10a)]);const _0x2113b9=bufferSha256(_0x17b981[_0x4678f2(0x10d)]);if(_0x2113b9!==_0x4ca046[_0x4678f2(0xeb)])throw CliErrors['validation'](_0x4678f2(0xf6)+_0x4ca046['path']);_0x449369[_0x4678f2(0x110)]({'path':_0x4ca046[_0x4678f2(0x10a)],'bytes':_0x17b981[_0x4678f2(0x10d)]});}return normalizeLocalFiles(_0x449369);}
1
+ (function(_0x10ccf7,_0x4e28e3){const _0x3d8ab0=a123_0x3041,_0x45786f=_0x10ccf7();while(!![]){try{const _0x401a27=-parseInt(_0x3d8ab0(0xc5))/0x1+-parseInt(_0x3d8ab0(0xbb))/0x2*(-parseInt(_0x3d8ab0(0xc0))/0x3)+parseInt(_0x3d8ab0(0xc4))/0x4+-parseInt(_0x3d8ab0(0xd3))/0x5+-parseInt(_0x3d8ab0(0xcf))/0x6*(parseInt(_0x3d8ab0(0xd2))/0x7)+parseInt(_0x3d8ab0(0xcd))/0x8+parseInt(_0x3d8ab0(0xe0))/0x9*(parseInt(_0x3d8ab0(0xc8))/0xa);if(_0x401a27===_0x4e28e3)break;else _0x45786f['push'](_0x45786f['shift']());}catch(_0x5695a5){_0x45786f['push'](_0x45786f['shift']());}}}(a123_0x4876,0xa39fa));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';function a123_0x3041(_0xd5d985,_0xb7e205){_0xd5d985=_0xd5d985-0xb8;const _0x48765b=a123_0x4876();let _0x304129=_0x48765b[_0xd5d985];return _0x304129;}import{createDeterministicZipPackage,parseZipPackage}from'./zip-codec.js';export function buildSkillPackage(_0x34cbb4){const _0x1221e5=a123_0x3041,_0x3d9cba=normalizeLocalFiles(_0x34cbb4);if(!_0x3d9cba[_0x1221e5(0xd5)](_0x379012=>_0x379012['path']===SKILL_FILE))throw CliErrors[_0x1221e5(0xc1)](_0x1221e5(0xce)+SKILL_FILE+_0x1221e5(0xd0));const _0x57b5e2=localFilesToManifestFiles(_0x3d9cba),_0x4eb4cc=createDeterministicZipPackage(_0x3d9cba);return{'manifest':{'schemaVersion':0x2,'treeSha256':fileTreeHash(_0x57b5e2),'zipSha256':bufferSha256(_0x4eb4cc),'zipSize':_0x4eb4cc['length'],'files':_0x57b5e2},'packageBytes':_0x4eb4cc,'packageBase64':_0x4eb4cc['toString'](_0x1221e5(0xc7))};}export function verifyRuntimeSkillPackage(_0x2c4927,_0x3c75a6){const _0x24e00f=a123_0x3041,_0x51feba=normalizePackageManifest(_0x2c4927,{'requireOssPath':![]});if(!_0x51feba)throw CliErrors[_0x24e00f(0xc1)](_0x24e00f(0xda));return extractAndVerifyPackage(_0x51feba,_0x3c75a6);}export function verifyRuntimeSkillBundle(_0x183b36,_0x2e8198){const _0x42ea9e=a123_0x3041,_0x1a8d05=normalizePackageManifest(_0x183b36,{'requireOssPath':![]});if(!_0x1a8d05)throw CliErrors[_0x42ea9e(0xc1)]('Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.');return extractAndVerifyPackageFiles(_0x1a8d05,_0x2e8198);}export function tryNormalizePackageManifest(_0xfa69b2){return normalizePackageManifest(_0xfa69b2,{'requireOssPath':![]});}export function requirePackageBytes(_0x4f98ed,_0x5b4c6d){const _0x18f47b=a123_0x3041;if(!_0x5b4c6d||_0x5b4c6d[_0x18f47b(0xe3)]===0x0)throw CliErrors[_0x18f47b(0xc1)](_0x18f47b(0xd8)+_0x4f98ed);return _0x5b4c6d;}export function extractDownloadedPackage(_0x1fe935){const _0xd7dffe=a123_0x3041,_0x347d95=parseZipPackage(_0x1fe935)[_0xd7dffe(0xc2)](_0x27f2d3=>({'path':_0x27f2d3[_0xd7dffe(0xbc)],'bytes':_0x27f2d3['bytes']}));if(!_0x347d95[_0xd7dffe(0xd5)](_0x7d4ee2=>_0x7d4ee2[_0xd7dffe(0xbc)]===SKILL_FILE))throw CliErrors[_0xd7dffe(0xc1)](_0xd7dffe(0xe5)+SKILL_FILE+'.');return normalizeLocalFiles(_0x347d95);}function a123_0x4876(){const _0x430c09=['5699560dvlqns','sha256','some','Runtime\x20Skill\x20manifest\x20is\x20missing\x20','treeSha256','Runtime\x20Skill\x20package\x20is\x20required\x20for\x20Skill\x20install:\x20','bytes','Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.','schemaVersion','isSafeInteger','Runtime\x20Skill\x20file\x20tree\x20sha256\x20mismatch.','Runtime\x20Skill\x20package\x20sha256\x20mismatch.','push','729441oFAGIA','Runtime\x20Skill\x20package\x20size\x20mismatch.','zipSize','length','isArray','Runtime\x20Skill\x20package\x20is\x20missing\x20','set','Runtime\x20Skill\x20package\x20entry\x20list\x20mismatch.','toLowerCase','3566aXvOxi','path','size','Runtime\x20Skill\x20package\x20size\x20is\x20invalid.','Runtime\x20Skill\x20package\x20sha256\x20is\x20invalid.','879kokzjR','validation','map','Runtime\x20Skill\x20package\x20file\x20size\x20mismatch:\x20','1353580shnPWm','312180KYOnDr','get','base64','110dIfqqT','ossPath','files','Runtime\x20Skill\x20package\x20file\x20sha256\x20mismatch:\x20','object','6446608WUVYdf','Missing\x20','523062liKlFP','\x20in\x20Skill\x20file\x20package.','string','35SEMiLN'];a123_0x4876=function(){return _0x430c09;};return a123_0x4876();}export function localFilesToManifestFiles(_0x4b2752){const _0x4df587=a123_0x3041;return normalizeLocalFiles(_0x4b2752)[_0x4df587(0xc2)](_0x27959b=>({'path':_0x27959b['path'],'sha256':fileHash(_0x27959b),'size':fileContent(_0x27959b)['length']}));}function normalizePackageManifest(_0x1584f8,_0x14f771){const _0x26b184=a123_0x3041;if(!_0x1584f8||typeof _0x1584f8!==_0x26b184(0xcc)||Array[_0x26b184(0xe4)](_0x1584f8))return undefined;const _0x215594=_0x1584f8,_0x553130=typeof _0x215594[_0x26b184(0xc9)]===_0x26b184(0xd1)?_0x215594[_0x26b184(0xc9)]['trim']():undefined;if(_0x14f771['requireOssPath']&&!_0x553130)return undefined;if(!Array[_0x26b184(0xe4)](_0x215594['files'])||_0x215594[_0x26b184(0xca)][_0x26b184(0xe3)]===0x0)return undefined;if(!isSha256Hex(_0x215594[_0x26b184(0xd7)]))throw CliErrors['validation']('Runtime\x20Skill\x20file\x20tree\x20sha256\x20is\x20invalid.');if(!isSha256Hex(_0x215594['zipSha256']))throw CliErrors[_0x26b184(0xc1)](_0x26b184(0xbf));if(!Number['isSafeInteger'](_0x215594[_0x26b184(0xe2)])||_0x215594[_0x26b184(0xe2)]<0x0)throw CliErrors[_0x26b184(0xc1)](_0x26b184(0xbe));const _0x1dae2b=normalizeManifestFiles(_0x215594[_0x26b184(0xca)]);if(!_0x1dae2b[_0x26b184(0xd5)](_0x4af39c=>_0x4af39c['path']===SKILL_FILE))throw CliErrors[_0x26b184(0xc1)](_0x26b184(0xd6)+SKILL_FILE+'.');const _0x335500=fileTreeHash(_0x1dae2b);if(_0x335500!==_0x215594[_0x26b184(0xd7)][_0x26b184(0xba)]())throw CliErrors[_0x26b184(0xc1)](_0x26b184(0xdd));return{'schemaVersion':Number[_0x26b184(0xdc)](_0x215594[_0x26b184(0xdb)])?_0x215594['schemaVersion']:0x2,'ossPath':_0x553130,'treeSha256':_0x335500,'zipSha256':_0x215594['zipSha256'][_0x26b184(0xba)](),'zipSize':_0x215594['zipSize'],'files':_0x1dae2b};}function extractAndVerifyPackage(_0x4f547a,_0x2f2cba){const _0x270ec9=a123_0x3041,_0x21b56a=normalizePackageManifest(_0x4f547a,{'requireOssPath':![]});if(!_0x21b56a)throw CliErrors[_0x270ec9(0xc1)](_0x270ec9(0xda));if(_0x2f2cba[_0x270ec9(0xe3)]!==_0x21b56a['zipSize'])throw CliErrors['validation'](_0x270ec9(0xe1));const _0x4454c1=bufferSha256(_0x2f2cba);if(_0x4454c1!==_0x21b56a['zipSha256'])throw CliErrors[_0x270ec9(0xc1)](_0x270ec9(0xde));return extractAndVerifyPackageFiles(_0x21b56a,_0x2f2cba);}function extractAndVerifyPackageFiles(_0x2a0bd6,_0x286dc5){const _0xba59f6=a123_0x3041,_0x4ec72d=parseZipPackage(_0x286dc5);if(_0x4ec72d['length']!==_0x2a0bd6[_0xba59f6(0xca)]['length'])throw CliErrors[_0xba59f6(0xc1)](_0xba59f6(0xb9));const _0x114c5a=new Map();for(const _0x32ee01 of _0x4ec72d){if(_0x114c5a['has'](_0x32ee01['path']))throw CliErrors[_0xba59f6(0xc1)]('Duplicate\x20Skill\x20package\x20entry:\x20'+_0x32ee01['path']);_0x114c5a[_0xba59f6(0xb8)](_0x32ee01[_0xba59f6(0xbc)],_0x32ee01);}const _0x8a4100=[];for(const _0x1840d4 of _0x2a0bd6[_0xba59f6(0xca)]){const _0x2d44be=_0x114c5a[_0xba59f6(0xc6)](_0x1840d4[_0xba59f6(0xbc)]);if(!_0x2d44be)throw CliErrors[_0xba59f6(0xc1)]('Runtime\x20Skill\x20package\x20is\x20missing\x20entry:\x20'+_0x1840d4[_0xba59f6(0xbc)]);if(_0x2d44be[_0xba59f6(0xd9)][_0xba59f6(0xe3)]!==_0x1840d4[_0xba59f6(0xbd)])throw CliErrors[_0xba59f6(0xc1)](_0xba59f6(0xc3)+_0x1840d4[_0xba59f6(0xbc)]);const _0x552bf5=bufferSha256(_0x2d44be[_0xba59f6(0xd9)]);if(_0x552bf5!==_0x1840d4[_0xba59f6(0xd4)])throw CliErrors[_0xba59f6(0xc1)](_0xba59f6(0xcb)+_0x1840d4['path']);_0x8a4100[_0xba59f6(0xdf)]({'path':_0x1840d4[_0xba59f6(0xbc)],'bytes':_0x2d44be[_0xba59f6(0xd9)]});}return normalizeLocalFiles(_0x8a4100);}
@@ -1 +1 @@
1
- (function(_0x2519b2,_0x2f44f5){var _0x2e6aeb=a122_0x6e45,_0x35f7bd=_0x2519b2();while(!![]){try{var _0x239600=parseInt(_0x2e6aeb(0x14b))/0x1+parseInt(_0x2e6aeb(0x14a))/0x2+-parseInt(_0x2e6aeb(0x14d))/0x3+-parseInt(_0x2e6aeb(0x14c))/0x4+parseInt(_0x2e6aeb(0x14e))/0x5+parseInt(_0x2e6aeb(0x14f))/0x6+parseInt(_0x2e6aeb(0x150))/0x7;if(_0x239600===_0x2f44f5)break;else _0x35f7bd['push'](_0x35f7bd['shift']());}catch(_0x4d011c){_0x35f7bd['push'](_0x35f7bd['shift']());}}}(a122_0x4e65,0xeacbd));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}from'./runtime-skill-sync/materialize.js';function a122_0x6e45(_0x35efc0,_0x7fa9b){_0x35efc0=_0x35efc0-0x14a;var _0x4e6527=a122_0x4e65();var _0x6e4582=_0x4e6527[_0x35efc0];return _0x6e4582;}export{readMetadataIfPresent}from'./runtime-skill-sync/metadata.js';export{getRuntimeSkillCacheRoot,getRuntimeSkillDir,resolveSkillSyncPaths,runtimeAgentSkillRoots}from'./runtime-skill-sync/paths.js';export{deriveSkillCodeFromDirectory,readPushDirectory,refreshPushDirectoryMetadataFromRemote,recordPushedRuntimeSkill,resolvePushDirectoryIdentity}from'./runtime-skill-sync/push.js';function a122_0x4e65(){var _0x91b2d0=['3890376FApyPl','5661500ptUGZX','7324458oOHuCn','1694889iXIyzD','1413776BZzfoq','127813oFzCqN','4685416anzLjp'];a122_0x4e65=function(){return _0x91b2d0;};return a122_0x4e65();}export{buildSkillPackage,verifyRuntimeSkillBundle,verifyRuntimeSkillPackage}from'./runtime-skill-sync/zip-package.js';
1
+ (function(_0x4bfea9,_0x55b7c9){var _0x2bcdd1=a124_0x4858,_0x3575d1=_0x4bfea9();while(!![]){try{var _0x211d05=parseInt(_0x2bcdd1(0x13a))/0x1*(parseInt(_0x2bcdd1(0x13d))/0x2)+parseInt(_0x2bcdd1(0x13f))/0x3*(-parseInt(_0x2bcdd1(0x141))/0x4)+-parseInt(_0x2bcdd1(0x13e))/0x5*(-parseInt(_0x2bcdd1(0x13b))/0x6)+-parseInt(_0x2bcdd1(0x13c))/0x7*(parseInt(_0x2bcdd1(0x143))/0x8)+-parseInt(_0x2bcdd1(0x139))/0x9+-parseInt(_0x2bcdd1(0x142))/0xa+parseInt(_0x2bcdd1(0x140))/0xb;if(_0x211d05===_0x55b7c9)break;else _0x3575d1['push'](_0x3575d1['shift']());}catch(_0x19015d){_0x3575d1['push'](_0x3575d1['shift']());}}}(a124_0x7221,0x53522));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}from'./runtime-skill-sync/materialize.js';export{readMetadataIfPresent}from'./runtime-skill-sync/metadata.js';function a124_0x4858(_0x135699,_0x2a5383){_0x135699=_0x135699-0x139;var _0x72217e=a124_0x7221();var _0x485889=_0x72217e[_0x135699];return _0x485889;}export{getRuntimeSkillCacheRoot,getRuntimeSkillDir,resolveSkillSyncPaths,runtimeAgentSkillRoots}from'./runtime-skill-sync/paths.js';export{deriveSkillCodeFromDirectory,readPushDirectory,refreshPushDirectoryMetadataFromRemote,recordPushedRuntimeSkill,resolvePushDirectoryIdentity}from'./runtime-skill-sync/push.js';export{buildSkillPackage,verifyRuntimeSkillBundle,verifyRuntimeSkillPackage}from'./runtime-skill-sync/zip-package.js';function a124_0x7221(){var _0x1aea13=['5849690IANYsP','8xVjcqA','2856168IyDRtw','207745ZFBDJs','24WWiSxr','2896502mTHvvN','2NklZUa','295BOgOeX','951LHwpNY','18764471ofyJIX','3236GPtVQd'];a124_0x7221=function(){return _0x1aea13;};return a124_0x7221();}
@@ -1 +1 @@
1
- const a123_0x429e5a=a123_0x4562;(function(_0x2d4d83,_0x3bd202){const _0x39a36d=a123_0x4562,_0x42c522=_0x2d4d83();while(!![]){try{const _0x256794=parseInt(_0x39a36d(0x190))/0x1*(-parseInt(_0x39a36d(0x17e))/0x2)+-parseInt(_0x39a36d(0x18d))/0x3*(-parseInt(_0x39a36d(0x193))/0x4)+-parseInt(_0x39a36d(0x18a))/0x5+parseInt(_0x39a36d(0x17b))/0x6+parseInt(_0x39a36d(0x196))/0x7+-parseInt(_0x39a36d(0x182))/0x8+parseInt(_0x39a36d(0x18f))/0x9*(parseInt(_0x39a36d(0x180))/0xa);if(_0x256794===_0x3bd202)break;else _0x42c522['push'](_0x42c522['shift']());}catch(_0x52ecb5){_0x42c522['push'](_0x42c522['shift']());}}}(a123_0x4536,0x3b706));function a123_0x4562(_0x592b69,_0x3884ab){_0x592b69=_0x592b69-0x178;const _0x4536a3=a123_0x4536();let _0x4562f8=_0x4536a3[_0x592b69];return _0x4562f8;}import{existsSync,readFileSync}from'node:fs';import{homedir}from'node:os';function a123_0x4536(){const _0x140e8b=['find','present','220370qJgEhr','globalSkillsDirs','11650njaJwg','recorded','2865856sGOPIk','\x20is\x20unreadable:\x20','object','.agents','\x20uses\x20unsupported\x20version\x20','.claude','home','\x20records\x20\x22','73430ZQtcdy','lockFile','unverifiable','336759OGFzLf','version','3177KHCXxW','3myVlNR','reason','map','4grDLKa','message','not-recorded','566657AWEJmv','unusable','join','SKILL.md','\x20has\x20no\x20skills\x20map','skills','kind','utf8','2054916mjkXSW'];a123_0x4536=function(){return _0x140e8b;};return a123_0x4536();}import{join}from'node:path';export const SKILL_LOCK_RELATIVE_PATH=join(a123_0x429e5a(0x185),'.skill-lock.json');export const GLOBAL_SKILLS_DIR_RELATIVE_PATHS=[join(a123_0x429e5a(0x185),'skills'),join(a123_0x429e5a(0x187),a123_0x429e5a(0x178))];const SUPPORTED_LOCK_VERSIONS=[0x3];function readLockLookup(_0x590285,_0x21b489){const _0x3c26d2=a123_0x429e5a;if(!existsSync(_0x590285))return{'kind':_0x3c26d2(0x195)};let _0x2b1b6e;try{_0x2b1b6e=JSON['parse'](readFileSync(_0x590285,_0x3c26d2(0x17a)));}catch(_0x11de94){return{'kind':_0x3c26d2(0x197),'reason':_0x590285+_0x3c26d2(0x183)+_0x11de94[_0x3c26d2(0x194)]};}const _0x416d89=_0x2b1b6e;if(typeof _0x416d89?.['version']!=='number'||!SUPPORTED_LOCK_VERSIONS['includes'](_0x416d89[_0x3c26d2(0x18e)]))return{'kind':_0x3c26d2(0x197),'reason':_0x590285+_0x3c26d2(0x186)+String(_0x416d89?.[_0x3c26d2(0x18e)])};if(!_0x416d89[_0x3c26d2(0x178)]||typeof _0x416d89[_0x3c26d2(0x178)]!==_0x3c26d2(0x184))return{'kind':_0x3c26d2(0x197),'reason':_0x590285+_0x3c26d2(0x19a)};return _0x416d89[_0x3c26d2(0x178)][_0x21b489]?{'kind':_0x3c26d2(0x181)}:{'kind':'not-recorded'};}export function resolveInstalledSkill(_0x9d66a5,_0x26875f){const _0x36ce6f=a123_0x429e5a,_0x19bdef=_0x26875f?.[_0x36ce6f(0x188)]??homedir(),_0x3cc3a9=_0x26875f?.[_0x36ce6f(0x17f)]??GLOBAL_SKILLS_DIR_RELATIVE_PATHS[_0x36ce6f(0x192)](_0x29b3b1=>join(_0x19bdef,_0x29b3b1)),_0x29f795=_0x26875f?.[_0x36ce6f(0x18b)]??join(_0x19bdef,SKILL_LOCK_RELATIVE_PATH),_0x3856ba=_0x3cc3a9[_0x36ce6f(0x192)](_0xb5d3eb=>join(_0xb5d3eb,_0x9d66a5,_0x36ce6f(0x199))),_0x5bab9a=_0x3856ba[_0x36ce6f(0x17c)](_0x47a31f=>existsSync(_0x47a31f));if(_0x5bab9a)return{'state':_0x36ce6f(0x17d),'path':_0x5bab9a};const _0x5aeb4d=readLockLookup(_0x29f795,_0x9d66a5);if(_0x5aeb4d['kind']===_0x36ce6f(0x197))return{'state':_0x36ce6f(0x18c),'reason':_0x5aeb4d[_0x36ce6f(0x191)]};if(_0x5aeb4d[_0x36ce6f(0x179)]===_0x36ce6f(0x181))return{'state':_0x36ce6f(0x18c),'reason':_0x29f795+_0x36ce6f(0x189)+_0x9d66a5+'\x22\x20but\x20no\x20SKILL.md\x20was\x20found\x20in\x20known\x20layouts\x20'+('('+_0x3856ba[_0x36ce6f(0x198)](',\x20')+')')};return{'state':'absent','checked':_0x3856ba};}
1
+ function a125_0x2f34(){const _0x5da75f=['unusable','kind','367590SSoduB','99XLijJJ','skills','14fdgZFM','\x20records\x20\x22','.agents','parse','includes','5upJXCN','not-recorded','map','9gpJlTU','join','2332614lsbcoD','124886sIeNnf','version','globalSkillsDirs','.claude','1MedIlN','SKILL.md','home','84TIfAyu','find','3614091TUFZlV','unverifiable','object','absent','2352004HEcyKf','.skill-lock.json','lockFile','present','828372KVeYjR','number','6842312aMqFDk'];a125_0x2f34=function(){return _0x5da75f;};return a125_0x2f34();}const a125_0x1fec5d=a125_0x1c27;(function(_0x31b44c,_0x4432a0){const _0x14b4c3=a125_0x1c27,_0x458664=_0x31b44c();while(!![]){try{const _0x36c388=-parseInt(_0x14b4c3(0x16e))/0x1*(parseInt(_0x14b4c3(0x16a))/0x2)+parseInt(_0x14b4c3(0x169))/0x3+-parseInt(_0x14b4c3(0x177))/0x4*(parseInt(_0x14b4c3(0x164))/0x5)+-parseInt(_0x14b4c3(0x17b))/0x6*(parseInt(_0x14b4c3(0x183))/0x7)+-parseInt(_0x14b4c3(0x17d))/0x8*(parseInt(_0x14b4c3(0x167))/0x9)+-parseInt(_0x14b4c3(0x180))/0xa*(parseInt(_0x14b4c3(0x181))/0xb)+-parseInt(_0x14b4c3(0x171))/0xc*(-parseInt(_0x14b4c3(0x173))/0xd);if(_0x36c388===_0x4432a0)break;else _0x458664['push'](_0x458664['shift']());}catch(_0x3aeb30){_0x458664['push'](_0x458664['shift']());}}}(a125_0x2f34,0x95253));import{existsSync,readFileSync}from'node:fs';import{homedir}from'node:os';import{join}from'node:path';export const SKILL_LOCK_RELATIVE_PATH=join(a125_0x1fec5d(0x185),a125_0x1fec5d(0x178));function a125_0x1c27(_0x1fcb8f,_0x389454){_0x1fcb8f=_0x1fcb8f-0x162;const _0x2f3489=a125_0x2f34();let _0x1c273a=_0x2f3489[_0x1fcb8f];return _0x1c273a;}export const GLOBAL_SKILLS_DIR_RELATIVE_PATHS=[join('.agents',a125_0x1fec5d(0x182)),join(a125_0x1fec5d(0x16d),a125_0x1fec5d(0x182))];const SUPPORTED_LOCK_VERSIONS=[0x3];function readLockLookup(_0x31efd1,_0xf4e5ba){const _0x4311ae=a125_0x1fec5d;if(!existsSync(_0x31efd1))return{'kind':_0x4311ae(0x165)};let _0x319044;try{_0x319044=JSON[_0x4311ae(0x162)](readFileSync(_0x31efd1,'utf8'));}catch(_0x634620){return{'kind':_0x4311ae(0x17e),'reason':_0x31efd1+'\x20is\x20unreadable:\x20'+_0x634620['message']};}const _0x409ba5=_0x319044;if(typeof _0x409ba5?.[_0x4311ae(0x16b)]!==_0x4311ae(0x17c)||!SUPPORTED_LOCK_VERSIONS[_0x4311ae(0x163)](_0x409ba5[_0x4311ae(0x16b)]))return{'kind':_0x4311ae(0x17e),'reason':_0x31efd1+'\x20uses\x20unsupported\x20version\x20'+String(_0x409ba5?.['version'])};if(!_0x409ba5[_0x4311ae(0x182)]||typeof _0x409ba5[_0x4311ae(0x182)]!==_0x4311ae(0x175))return{'kind':_0x4311ae(0x17e),'reason':_0x31efd1+'\x20has\x20no\x20skills\x20map'};return _0x409ba5[_0x4311ae(0x182)][_0xf4e5ba]?{'kind':'recorded'}:{'kind':_0x4311ae(0x165)};}export function resolveInstalledSkill(_0x37ee46,_0x31595d){const _0x334962=a125_0x1fec5d,_0x1751f1=_0x31595d?.[_0x334962(0x170)]??homedir(),_0x3fdded=_0x31595d?.[_0x334962(0x16c)]??GLOBAL_SKILLS_DIR_RELATIVE_PATHS[_0x334962(0x166)](_0x30e3d6=>join(_0x1751f1,_0x30e3d6)),_0x4b4808=_0x31595d?.[_0x334962(0x179)]??join(_0x1751f1,SKILL_LOCK_RELATIVE_PATH),_0x1f438e=_0x3fdded[_0x334962(0x166)](_0x5622ed=>join(_0x5622ed,_0x37ee46,_0x334962(0x16f))),_0x37a850=_0x1f438e[_0x334962(0x172)](_0x398b68=>existsSync(_0x398b68));if(_0x37a850)return{'state':_0x334962(0x17a),'path':_0x37a850};const _0x5b5517=readLockLookup(_0x4b4808,_0x37ee46);if(_0x5b5517[_0x334962(0x17f)]===_0x334962(0x17e))return{'state':_0x334962(0x174),'reason':_0x5b5517['reason']};if(_0x5b5517['kind']==='recorded')return{'state':'unverifiable','reason':_0x4b4808+_0x334962(0x184)+_0x37ee46+'\x22\x20but\x20no\x20SKILL.md\x20was\x20found\x20in\x20known\x20layouts\x20'+('('+_0x1f438e[_0x334962(0x168)](',\x20')+')')};return{'state':_0x334962(0x176),'checked':_0x1f438e};}
@@ -1 +1 @@
1
- (function(_0x3dcd06,_0x5e4619){const _0x4b1d8d=a124_0x256f,_0x13a262=_0x3dcd06();while(!![]){try{const _0x3458f4=-parseInt(_0x4b1d8d(0x112))/0x1+-parseInt(_0x4b1d8d(0x10f))/0x2*(-parseInt(_0x4b1d8d(0x114))/0x3)+parseInt(_0x4b1d8d(0x115))/0x4+parseInt(_0x4b1d8d(0x113))/0x5+parseInt(_0x4b1d8d(0x111))/0x6*(parseInt(_0x4b1d8d(0x10d))/0x7)+parseInt(_0x4b1d8d(0x110))/0x8+-parseInt(_0x4b1d8d(0x10e))/0x9;if(_0x3458f4===_0x5e4619)break;else _0x13a262['push'](_0x13a262['shift']());}catch(_0x3e70d6){_0x13a262['push'](_0x13a262['shift']());}}}(a124_0x2bc8,0x61b4b));import{createJqFilter,resolveBundledJqPaths}from'@lovrabet/cli-framework';import{CliErrors}from'../errors.js';function a124_0x256f(_0x5f3ad2,_0x3c426e){_0x5f3ad2=_0x5f3ad2-0x10d;const _0x2bc8b5=a124_0x2bc8();let _0x256f9c=_0x2bc8b5[_0x5f3ad2];return _0x256f9c;}export const applyJqFilter=createJqFilter(CliErrors,{'bundledJqPaths':resolveBundledJqPaths()});function a124_0x2bc8(){const _0x54c6de=['321909OGzdcH','319616ldDVNS','252203WUdBpS','4131639zlGVme','2xwxotO','4887984ZvySFn','42OxAeEu','675065czwZWz','2419655lyMYGR'];a124_0x2bc8=function(){return _0x54c6de;};return a124_0x2bc8();}
1
+ (function(_0x3f715e,_0x32fe3f){const _0x44a2e1=a126_0x5be8,_0x2fa22f=_0x3f715e();while(!![]){try{const _0x1c055d=parseInt(_0x44a2e1(0x17a))/0x1+-parseInt(_0x44a2e1(0x181))/0x2+parseInt(_0x44a2e1(0x180))/0x3*(-parseInt(_0x44a2e1(0x17d))/0x4)+parseInt(_0x44a2e1(0x183))/0x5*(-parseInt(_0x44a2e1(0x17f))/0x6)+parseInt(_0x44a2e1(0x182))/0x7*(-parseInt(_0x44a2e1(0x17b))/0x8)+-parseInt(_0x44a2e1(0x179))/0x9+-parseInt(_0x44a2e1(0x17c))/0xa*(-parseInt(_0x44a2e1(0x17e))/0xb);if(_0x1c055d===_0x32fe3f)break;else _0x2fa22f['push'](_0x2fa22f['shift']());}catch(_0x2dd569){_0x2fa22f['push'](_0x2fa22f['shift']());}}}(a126_0x1d53,0xf164f));import{createJqFilter,resolveBundledJqPaths}from'@lovrabet/cli-framework';import{CliErrors}from'../errors.js';export const applyJqFilter=createJqFilter(CliErrors,{'bundledJqPaths':resolveBundledJqPaths()});function a126_0x5be8(_0x20d485,_0x1d0bbc){_0x20d485=_0x20d485-0x179;const _0x1d53b5=a126_0x1d53();let _0x5be842=_0x1d53b5[_0x20d485];return _0x5be842;}function a126_0x1d53(){const _0x11567d=['79340IybgMC','532MKaEHO','8426rvRhSj','126ESqXeo','11991vONPbM','3110226lbfwxX','7TtezID','373100mtMlNX','10927602PHCbUI','666218FKtWlS','7095992VhaWAm'];a126_0x1d53=function(){return _0x11567d;};return a126_0x1d53();}