@lovrabet/lovrabet-cli 2.2.5-beta.1 → 2.2.5

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 (160) hide show
  1. package/lib/cli.js +1 -1
  2. package/lib/commands/api-doc/index.js +1 -1
  3. package/lib/commands/app/cache.js +1 -1
  4. package/lib/commands/app/definitions.js +1 -1
  5. package/lib/commands/app/eligibility.js +1 -1
  6. package/lib/commands/app/mock-loader.js +1 -1
  7. package/lib/commands/app/remote-source.js +1 -1
  8. package/lib/commands/app/shared.js +1 -1
  9. package/lib/commands/app-config/get.js +1 -1
  10. package/lib/commands/app-config/index.js +1 -1
  11. package/lib/commands/artifact/index.js +1 -1
  12. package/lib/commands/auth/device.js +1 -1
  13. package/lib/commands/auth/index.js +1 -1
  14. package/lib/commands/auth/prompt.js +1 -1
  15. package/lib/commands/bff/detail.js +1 -1
  16. package/lib/commands/bff/exec.js +1 -1
  17. package/lib/commands/bff/index.js +1 -1
  18. package/lib/commands/cli-skill/index.js +1 -1
  19. package/lib/commands/common/config-policy.js +1 -1
  20. package/lib/commands/common/constraints.js +1 -1
  21. package/lib/commands/common/flags.js +1 -1
  22. package/lib/commands/common/local-file.js +1 -1
  23. package/lib/commands/config/definitions.js +1 -1
  24. package/lib/commands/config/shared.js +1 -1
  25. package/lib/commands/data/index.js +1 -1
  26. package/lib/commands/dataset/detail.js +1 -1
  27. package/lib/commands/dataset/index.js +1 -1
  28. package/lib/commands/dataset/list.js +1 -1
  29. package/lib/commands/dataset/sdk-doc.js +1 -1
  30. package/lib/commands/doctor.js +1 -1
  31. package/lib/commands/file/index.js +1 -1
  32. package/lib/commands/init.js +1 -1
  33. package/lib/commands/kb/index.js +1 -1
  34. package/lib/commands/logs/index.js +1 -1
  35. package/lib/commands/notification/config-list.js +1 -1
  36. package/lib/commands/notification/index.js +1 -1
  37. package/lib/commands/notification/shared.js +1 -1
  38. package/lib/commands/ocr/index.js +1 -1
  39. package/lib/commands/permit/dataset-get.js +1 -1
  40. package/lib/commands/permit/dataset-set.js +1 -1
  41. package/lib/commands/permit/index.js +1 -1
  42. package/lib/commands/permit/page-get.js +1 -1
  43. package/lib/commands/permit/page-set.js +1 -1
  44. package/lib/commands/permit/role-menus-set.js +1 -1
  45. package/lib/commands/permit/role-menus.js +1 -1
  46. package/lib/commands/permit/shared.js +1 -1
  47. package/lib/commands/personal-bff/index.js +1 -1
  48. package/lib/commands/registry.js +1 -1
  49. package/lib/commands/role/create.js +1 -1
  50. package/lib/commands/role/delete.js +1 -1
  51. package/lib/commands/role/detail.js +1 -1
  52. package/lib/commands/role/index.js +1 -1
  53. package/lib/commands/role/list.js +1 -1
  54. package/lib/commands/role/shared.js +1 -1
  55. package/lib/commands/role/update.js +1 -1
  56. package/lib/commands/role/user-add.js +1 -1
  57. package/lib/commands/role/user-remove.js +1 -1
  58. package/lib/commands/schedule/index.js +1 -1
  59. package/lib/commands/schema.js +1 -1
  60. package/lib/commands/service/dynamic.js +1 -1
  61. package/lib/commands/service/function-name-adapter.js +1 -1
  62. package/lib/commands/service/index.js +1 -1
  63. package/lib/commands/service/registry.js +1 -1
  64. package/lib/commands/skill/commands/create.js +1 -1
  65. package/lib/commands/skill/commands/diagram.js +1 -1
  66. package/lib/commands/skill/commands/install.js +1 -1
  67. package/lib/commands/skill/commands/list.js +1 -1
  68. package/lib/commands/skill/commands/push.js +1 -1
  69. package/lib/commands/skill/commands/validate.js +1 -1
  70. package/lib/commands/skill/diagram.js +1 -1
  71. package/lib/commands/skill/flags.js +1 -1
  72. package/lib/commands/skill/index.js +1 -1
  73. package/lib/commands/skill/manifest-helpers.js +1 -1
  74. package/lib/commands/skill/push-execute.js +1 -1
  75. package/lib/commands/skill/push-flow-helpers.js +1 -1
  76. package/lib/commands/skill/push-retarget.js +1 -1
  77. package/lib/commands/skill/scopes.js +1 -1
  78. package/lib/commands/skill/summary.js +1 -1
  79. package/lib/commands/skill/templates.js +1 -1
  80. package/lib/commands/skill/validate.js +1 -1
  81. package/lib/commands/sql/detail.js +1 -1
  82. package/lib/commands/sql/exec.js +1 -1
  83. package/lib/commands/sql/index.js +1 -1
  84. package/lib/commands/update.js +1 -1
  85. package/lib/commands/user-account/bind.js +1 -1
  86. package/lib/commands/user-account/index.js +1 -1
  87. package/lib/commands/workspace/index.js +1 -1
  88. package/lib/config/schema.js +1 -1
  89. package/lib/constant/app.js +1 -1
  90. package/lib/constant/auth-mode.js +1 -1
  91. package/lib/constant/cli.js +1 -1
  92. package/lib/constant/defaults.js +1 -1
  93. package/lib/constant/distribution.js +1 -1
  94. package/lib/constant/domain.js +1 -1
  95. package/lib/constant/env.js +1 -1
  96. package/lib/constant/output.js +1 -1
  97. package/lib/constant/product.js +1 -1
  98. package/lib/constant/risk.js +1 -1
  99. package/lib/constant/url.js +1 -1
  100. package/lib/context.js +1 -1
  101. package/lib/core/api-client.d.ts +3 -3
  102. package/lib/core/api-client.js +1 -1
  103. package/lib/core/db-resolver.js +1 -1
  104. package/lib/core/sdk-client.js +1 -1
  105. package/lib/errors.js +1 -1
  106. package/lib/framework/build-all-flags.js +1 -1
  107. package/lib/framework/dryrun.js +1 -1
  108. package/lib/framework/flags.js +1 -1
  109. package/lib/framework/help.js +1 -1
  110. package/lib/framework/index.js +1 -1
  111. package/lib/framework/output.js +1 -1
  112. package/lib/framework/preparse.js +1 -1
  113. package/lib/framework/rate-limit.js +1 -1
  114. package/lib/framework/raw-flags.js +1 -1
  115. package/lib/framework/response.js +1 -1
  116. package/lib/framework/runner-confirmation.js +1 -1
  117. package/lib/framework/runner-error.js +1 -1
  118. package/lib/framework/runner.js +1 -1
  119. package/lib/framework/schema-export.js +1 -1
  120. package/lib/framework/service-order.js +1 -1
  121. package/lib/framework/types.js +1 -1
  122. package/lib/generated/build-info.d.ts +4 -4
  123. package/lib/generated/build-info.js +1 -1
  124. package/lib/help.js +1 -1
  125. package/lib/postinstall.js +1 -1
  126. package/lib/runtime/confirmation.js +1 -1
  127. package/lib/runtime/event.js +1 -1
  128. package/lib/runtime/index.js +1 -1
  129. package/lib/runtime/queue.js +1 -1
  130. package/lib/runtime/resolve.js +1 -1
  131. package/lib/skills/builtin-skill.js +1 -1
  132. package/lib/skills/npx-skills-add.js +1 -1
  133. package/lib/skills/runtime-skill-sync/constants.js +1 -1
  134. package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
  135. package/lib/skills/runtime-skill-sync/hashing.js +1 -1
  136. package/lib/skills/runtime-skill-sync/install-target.js +1 -1
  137. package/lib/skills/runtime-skill-sync/links.js +1 -1
  138. package/lib/skills/runtime-skill-sync/list-local.js +1 -1
  139. package/lib/skills/runtime-skill-sync/local-files.js +1 -1
  140. package/lib/skills/runtime-skill-sync/materialize.js +1 -1
  141. package/lib/skills/runtime-skill-sync/metadata.js +1 -1
  142. package/lib/skills/runtime-skill-sync/paths.js +1 -1
  143. package/lib/skills/runtime-skill-sync/push.js +1 -1
  144. package/lib/skills/runtime-skill-sync/scopes.js +1 -1
  145. package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
  146. package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
  147. package/lib/skills/runtime-skill-sync.js +1 -1
  148. package/lib/skills/skill-presence.js +1 -1
  149. package/lib/utils/apply-jq-filter.js +1 -1
  150. package/lib/utils/logger.js +1 -1
  151. package/lib/utils/lossless-json.js +1 -1
  152. package/lib/utils/params.js +1 -1
  153. package/lib/utils/platform.js +1 -1
  154. package/lib/utils/update-notice.js +1 -1
  155. package/lib/utils/version.js +1 -1
  156. package/lib/utils/write-cli-side-channel.js +1 -1
  157. package/package.json +1 -1
  158. package/skills/lovrabet/SKILL.md +4 -4
  159. package/skills/lovrabet/references/lovrabet-schedule-workflow.md +7 -6
  160. package/skills/lovrabet.manifest.json +3 -3
@@ -1 +1 @@
1
- const a135_0x5e7187=a135_0x218e;(function(_0x34bce0,_0x280657){const _0xa9fd6d=a135_0x218e,_0x4b4b03=_0x34bce0();while(!![]){try{const _0x29ee50=parseInt(_0xa9fd6d(0x12a))/0x1+-parseInt(_0xa9fd6d(0x12d))/0x2*(parseInt(_0xa9fd6d(0x145))/0x3)+parseInt(_0xa9fd6d(0x15b))/0x4*(-parseInt(_0xa9fd6d(0x147))/0x5)+parseInt(_0xa9fd6d(0x13d))/0x6*(-parseInt(_0xa9fd6d(0x130))/0x7)+-parseInt(_0xa9fd6d(0x13b))/0x8+parseInt(_0xa9fd6d(0x13f))/0x9+parseInt(_0xa9fd6d(0x13a))/0xa;if(_0x29ee50===_0x280657)break;else _0x4b4b03['push'](_0x4b4b03['shift']());}catch(_0x50495){_0x4b4b03['push'](_0x4b4b03['shift']());}}}(a135_0x1fb0,0x3dd94));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import a135_0x686360 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}=a135_0x686360,RESERVED_PROJECT_SKILL_CODES=new Set([a135_0x5e7187(0x139),a135_0x5e7187(0x129),'secret-retriever']);export function linkEffectiveRuntimeSkills(_0x5c197e,_0x13575b){const _0x3c5836=a135_0x5e7187,_0x4648cf=new Map();for(const _0x2b2450 of _0x5c197e){const _0x8750f=_0x2b2450[_0x3c5836(0x134)][_0x3c5836(0x12b)];if(!_0x8750f)continue;const _0x3dd299=_0x4648cf[_0x3c5836(0x156)](_0x8750f);(!_0x3dd299||_0x2b2450[_0x3c5836(0x128)]===_0x3c5836(0x148))&&_0x4648cf[_0x3c5836(0x14b)](_0x8750f,_0x2b2450);}const _0x1451e3=[];for(const _0xe4af5 of _0x4648cf[_0x3c5836(0x14e)]()){const _0x51249a=requireSkillCode(_0xe4af5[_0x3c5836(0x134)]),_0x258428=readMetadataIfPresent(_0xe4af5[_0x3c5836(0x13c)]);if(_0x258428?.[_0x3c5836(0x151)]!==_0x13575b['appCode']||_0x258428[_0x3c5836(0x12b)]!==_0x51249a)throw CliErrors[_0x3c5836(0x144)]('Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20'+_0x13575b[_0x3c5836(0x151)]+':\x20'+_0xe4af5[_0x3c5836(0x13c)]);const _0x49358c=runtimeSkillLinkName(_0x13575b,_0x51249a);for(const _0xbb02d1 of _0x13575b['skillRoots']){_0x1451e3[_0x3c5836(0x149)](ensureManagedSymlink(resolve(_0xbb02d1,_0x49358c),_0xe4af5[_0x3c5836(0x146)],_0x13575b,_0x51249a));}}return _0x1451e3;}export function pruneStaleRuntimeSkillLinks(_0x386ea6,_0x5b2940,_0x16a6cc){const _0x46cfcd=a135_0x5e7187,_0x454656=new Set([..._0x5b2940][_0x46cfcd(0x15a)](_0x134408=>_0x134408[_0x46cfcd(0x15c)]())[_0x46cfcd(0x154)](Boolean)),_0x587e8b=_0x16a6cc?new Set([..._0x16a6cc][_0x46cfcd(0x15a)](_0x475dff=>_0x475dff['trim']())['filter'](Boolean)):undefined,_0x368336=[];for(const _0x29584e of _0x386ea6[_0x46cfcd(0x14a)]){for(const _0x2d257e of managedTargetSkillLinkPaths(_0x29584e,_0x386ea6)){const _0x4b9eab=runtimeSkillCodeFromLink(_0x386ea6,_0x2d257e);if(_0x587e8b&&!_0x587e8b[_0x46cfcd(0x133)](_0x4b9eab))continue;if(_0x454656['has'](_0x4b9eab))continue;_0x368336[_0x46cfcd(0x149)](removeManagedSkillLink(_0x2d257e,_0x386ea6,_0x4b9eab));}}return _0x368336;}function a135_0x1fb0(){const _0x47efdf=['appCode','skipped','env','filter','isDirectory','get','managedRoot','scopes','updated','map','4QTBJkm','trim','Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20','linked-from-protected-root','accessKey','Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20','created','protectedLinkRoots','Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20','scope','runtime-observe','80149gEefgT','skillCode','startsWith','9242CZQfXS','length','Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20','14nMvhlp','project','name','has','skill','isSymbolicLink','removed','contentHash','company','lovrabet','6446740fEBpAP','46856kocHkG','metadataPath','854130GTSojc','Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20','555624XUUgPd','unchanged','Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','Refusing\x20to\x20copy\x20Skill\x20symlink:\x20','validation','9CjpbsQ','dir','1143985wyzDBl','personal','push','skillRoots','set','metadata-mismatch','builtin','values','activeSkillCodes','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20'];a135_0x1fb0=function(){return _0x47efdf;};return a135_0x1fb0();}export function pruneStaleRuntimeSkillCache(_0x74a69c,_0x345880={}){const _0x477199=a135_0x5e7187,_0x4da99f=new Set([..._0x74a69c[_0x477199(0x14f)]][_0x477199(0x15a)](_0x535c51=>_0x535c51['trim']())['filter'](Boolean)),_0x525082=_0x74a69c['pruneSkillCodes']?new Set([..._0x74a69c['pruneSkillCodes']][_0x477199(0x15a)](_0x1c25df=>_0x1c25df[_0x477199(0x15c)]())[_0x477199(0x154)](Boolean)):undefined,_0x152bfb=_0x74a69c[_0x477199(0x158)]??['personal',_0x477199(0x138)],_0x1bc035=resolve(getRuntimeSkillCacheRoot(_0x74a69c[_0x477199(0x153)],_0x74a69c[_0x477199(0x15f)],_0x345880),safePathSegment(_0x74a69c[_0x477199(0x151)],_0x477199(0x151))),_0x259c73=[];for(const _0x24d54b of _0x152bfb){const _0x41fcf0=resolve(_0x1bc035,_0x24d54b);if(!existsSync(_0x41fcf0))continue;for(const _0x5286fc of readdirSync(_0x41fcf0,{'withFileTypes':!![]})){if(!_0x5286fc[_0x477199(0x155)]())continue;const _0x26d621=_0x5286fc['name'];if(_0x525082&&!_0x525082[_0x477199(0x133)](_0x26d621))continue;if(_0x4da99f['has'](_0x26d621))continue;const _0x367ea0=resolve(_0x41fcf0,_0x26d621),_0x318763=readMetadataIfPresent(resolve(_0x367ea0,METADATA_FILE));if(_0x318763?.[_0x477199(0x151)]!==_0x74a69c[_0x477199(0x151)]||_0x318763['scope']!==_0x24d54b||_0x318763[_0x477199(0x12b)]!==_0x26d621){_0x259c73[_0x477199(0x149)]({'path':_0x367ea0,'action':'skipped','reason':_0x477199(0x14c)});continue;}if(isLinkedFromAnyRoot(_0x367ea0,_0x74a69c[_0x477199(0x126)]??[])){_0x259c73['push']({'path':_0x367ea0,'action':_0x477199(0x152),'reason':_0x477199(0x15e)});continue;}removeSync(_0x367ea0),_0x259c73[_0x477199(0x149)]({'path':_0x367ea0,'action':'removed'});}}return _0x259c73;}function a135_0x218e(_0x41aaf7,_0x348e51){_0x41aaf7=_0x41aaf7-0x124;const _0x1fb00b=a135_0x1fb0();let _0x218e29=_0x1fb00b[_0x41aaf7];return _0x218e29;}export function linkGlobalRuntimeSkills(_0x49433d,_0x265134={}){const _0xb000d6=a135_0x5e7187,_0x50bfb8=resolveSkillSyncPaths(_0x265134),_0x33c26e=[];for(const _0x14ed78 of _0x49433d){if(_0x14ed78[_0xb000d6(0x128)]!==_0xb000d6(0x14d))throw CliErrors[_0xb000d6(0x144)](_0xb000d6(0x142)+_0x14ed78[_0xb000d6(0x128)]);const _0x36e701=requireSkillCode(_0x14ed78['skill']),_0x3a2d03=copyManagedSkillDirectory(_0x14ed78[_0xb000d6(0x146)],resolve(_0x50bfb8['agentsSkillsDir'],_0x36e701));_0x33c26e[_0xb000d6(0x149)]({..._0x3a2d03,'contentHash':_0x14ed78[_0xb000d6(0x137)]});}return _0x33c26e;}function ensureManagedSymlink(_0x44db1d,_0xc59045,_0x30016b,_0x10174f){const _0x1e9bd7=a135_0x5e7187;mkdirSync(dirname(_0x44db1d),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x44db1d)||isDanglingSymlink(_0x44db1d)){const _0x3f0004=lstatSync(_0x44db1d);if(!_0x3f0004[_0x1e9bd7(0x135)]())throw CliErrors[_0x1e9bd7(0x144)](_0x1e9bd7(0x13e)+_0x44db1d);const _0x32e51b=resolveSymlinkTarget(_0x44db1d);if(!isPathInside(realOrResolved(_0x32e51b),realOrResolved(_0x30016b[_0x1e9bd7(0x157)])))throw CliErrors[_0x1e9bd7(0x144)](_0x1e9bd7(0x12f)+_0x44db1d);if(realOrResolved(_0x32e51b)===realOrResolved(_0xc59045))return{'path':_0x44db1d,'target':_0xc59045,'action':'unchanged'};const _0x5d4340=readMetadataIfPresent(resolve(_0x32e51b,METADATA_FILE));if(_0x30016b[_0x1e9bd7(0x128)]===_0x1e9bd7(0x131)&&(_0x5d4340?.['appCode']!==_0x30016b[_0x1e9bd7(0x151)]||_0x5d4340[_0x1e9bd7(0x12b)]!==_0x10174f))throw CliErrors[_0x1e9bd7(0x144)](_0x1e9bd7(0x15d)+_0x44db1d);return unlinkSync(_0x44db1d),symlinkSync(_0xc59045,_0x44db1d,_0x1e9bd7(0x146)),{'path':_0x44db1d,'target':_0xc59045,'action':_0x1e9bd7(0x159)};}return symlinkSync(_0xc59045,_0x44db1d,_0x1e9bd7(0x146)),{'path':_0x44db1d,'target':_0xc59045,'action':_0x1e9bd7(0x125)};}function managedTargetSkillLinkPaths(_0x5b86f8,_0x3911d4){const _0x2d8679=a135_0x5e7187;if(!existsSync(_0x5b86f8))return[];const _0x3ae699=_0x3911d4[_0x2d8679(0x151)]+'--';return readdirSync(_0x5b86f8,{'withFileTypes':!![]})[_0x2d8679(0x154)](_0x3e5a45=>_0x3911d4[_0x2d8679(0x128)]==='project'||_0x3e5a45[_0x2d8679(0x132)][_0x2d8679(0x12c)](_0x3ae699))[_0x2d8679(0x15a)](_0x5a08f0=>resolve(_0x5b86f8,_0x5a08f0[_0x2d8679(0x132)]));}function removeManagedSkillLink(_0xdb0ac9,_0x4031a5,_0x266d5a){const _0x40e021=a135_0x5e7187,_0x2b41dd=lstatIfPresent(_0xdb0ac9);if(!_0x2b41dd?.[_0x40e021(0x135)]())return{'path':_0xdb0ac9,'action':_0x40e021(0x152),'reason':'not-managed-symlink'};const _0x9ee880=resolveSymlinkTarget(_0xdb0ac9);if(!isPathInside(realOrResolved(_0x9ee880),realOrResolved(_0x4031a5[_0x40e021(0x157)])))return{'path':_0xdb0ac9,'action':_0x40e021(0x152),'reason':'external-symlink'};const _0x4da84d=readMetadataIfPresent(resolve(_0x9ee880,METADATA_FILE));if(_0x4031a5[_0x40e021(0x128)]==='project'&&(_0x4da84d?.[_0x40e021(0x151)]!==_0x4031a5[_0x40e021(0x151)]||_0x4da84d['skillCode']!==_0x266d5a))return{'path':_0xdb0ac9,'action':'skipped','reason':_0x40e021(0x14c)};return unlinkSync(_0xdb0ac9),{'path':_0xdb0ac9,'action':_0x40e021(0x136)};}function isLinkedFromAnyRoot(_0x33cd6b,_0x5bf4a9){const _0x428337=a135_0x5e7187,_0x266505=realOrResolved(_0x33cd6b);for(const _0x297554 of _0x5bf4a9){if(!existsSync(_0x297554))continue;for(const _0x153c84 of readdirSync(_0x297554,{'withFileTypes':!![]})){if(!_0x153c84[_0x428337(0x135)]())continue;const _0x307999=resolve(_0x297554,_0x153c84[_0x428337(0x132)]);if(realOrResolved(resolveSymlinkTarget(_0x307999))===_0x266505)return!![];}}return![];}function runtimeSkillLinkName(_0x49ceea,_0x5990f5){const _0x432404=a135_0x5e7187,_0x2f34ee=safePathSegment(_0x5990f5,_0x432404(0x12b));if(_0x49ceea[_0x432404(0x128)]===_0x432404(0x131)&&RESERVED_PROJECT_SKILL_CODES[_0x432404(0x133)](_0x2f34ee))throw CliErrors[_0x432404(0x144)](_0x432404(0x127)+_0x2f34ee);return _0x49ceea[_0x432404(0x128)]===_0x432404(0x131)?_0x2f34ee:_0x49ceea[_0x432404(0x151)]+'--'+_0x2f34ee;}function runtimeSkillCodeFromLink(_0x57b135,_0x5c8512){const _0xd1546c=a135_0x5e7187,_0x2a0dab=basename(_0x5c8512);return _0x57b135[_0xd1546c(0x128)]===_0xd1546c(0x131)?_0x2a0dab:_0x2a0dab['slice']((_0x57b135[_0xd1546c(0x151)]+'--')[_0xd1546c(0x12e)]);}export function copyManagedSkillDirectory(_0x46cf4a,_0x479854){const _0x50b662=a135_0x5e7187,_0x2a9652=resolve(_0x479854,METADATA_FILE),_0x56612d=existsSync(_0x479854);if(_0x56612d){const _0x38cdc4=lstatSync(_0x479854);if(_0x38cdc4[_0x50b662(0x135)]())throw CliErrors['validation'](_0x50b662(0x124)+_0x479854);if(!_0x38cdc4['isDirectory']())throw CliErrors[_0x50b662(0x144)](_0x50b662(0x141)+_0x479854);const _0x1369e9=readMetadataIfPresent(_0x2a9652);if(_0x1369e9?.[_0x50b662(0x128)]!==_0x50b662(0x14d))throw CliErrors[_0x50b662(0x144)](_0x50b662(0x150)+_0x479854);}ensureDirSync(dirname(_0x479854));const _0x39e0ba=_0x56612d?readMetadataIfPresent(_0x2a9652)?.[_0x50b662(0x137)]:undefined,_0x3c5933=readMetadataIfPresent(resolve(_0x46cf4a,METADATA_FILE))?.[_0x50b662(0x137)];return _0x56612d&&removeSync(_0x479854),copySkillDirectory(_0x46cf4a,_0x479854),{'path':_0x479854,'target':_0x46cf4a,'action':!_0x56612d?_0x50b662(0x125):_0x39e0ba===_0x3c5933?_0x50b662(0x140):_0x50b662(0x159)};}function copySkillDirectory(_0x34cda4,_0x2904a0){copySync(_0x34cda4,_0x2904a0,{'dereference':![],'overwrite':!![],'filter'(_0x547ddb){const _0x5406a6=a135_0x218e;if(lstatSync(_0x547ddb)[_0x5406a6(0x135)]())throw CliErrors[_0x5406a6(0x144)](_0x5406a6(0x143)+_0x547ddb);return!![];}});}
1
+ const a135_0xb05b96=a135_0x165d;(function(_0x2e03d6,_0x2ad5ec){const _0x28dc11=a135_0x165d,_0x44ff10=_0x2e03d6();while(!![]){try{const _0x1b4dd3=parseInt(_0x28dc11(0xbe))/0x1+-parseInt(_0x28dc11(0xc5))/0x2*(parseInt(_0x28dc11(0x8f))/0x3)+-parseInt(_0x28dc11(0x9f))/0x4*(parseInt(_0x28dc11(0xbb))/0x5)+parseInt(_0x28dc11(0xbc))/0x6+parseInt(_0x28dc11(0xad))/0x7*(-parseInt(_0x28dc11(0x90))/0x8)+-parseInt(_0x28dc11(0x9b))/0x9*(parseInt(_0x28dc11(0xa4))/0xa)+-parseInt(_0x28dc11(0xb6))/0xb*(-parseInt(_0x28dc11(0x94))/0xc);if(_0x1b4dd3===_0x2ad5ec)break;else _0x44ff10['push'](_0x44ff10['shift']());}catch(_0x1f4650){_0x44ff10['push'](_0x44ff10['shift']());}}}(a135_0x3e26,0x8bcef));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import a135_0x2eeded 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';function a135_0x3e26(){const _0x18dc76=['appCode','9mvlFJT','slice','Refusing\x20to\x20copy\x20Skill\x20symlink:\x20','Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20','4JcRsxa','scope','company','pruneSkillCodes','removed','2723010qxrgea','unchanged','agentsSkillsDir','contentHash','skill','length','filter','map','personal','1417794dkUXTm','managedRoot','set','startsWith','linked-from-protected-root','validation','get','Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20','isDirectory','5742erZdLd','updated','env','values','name','2600930XScfDj','174504rKODfy','created','27768yOTlhj','has','external-symlink','push','metadata-mismatch','dir','lovrabet','14GyyJuq','isSymbolicLink','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20','Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20','metadataPath','protectedLinkRoots','runtime-observe','skillCode','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20','278004uxJlhi','16JJZhlO','skipped','project','scopes','54300BHxAaY','accessKey','builtin','Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20','activeSkillCodes','trim'];a135_0x3e26=function(){return _0x18dc76;};return a135_0x3e26();}import{getRuntimeSkillCacheRoot,resolveSkillSyncPaths,safePathSegment}from'./paths.js';const {copySync,ensureDirSync,removeSync}=a135_0x2eeded,RESERVED_PROJECT_SKILL_CODES=new Set([a135_0xb05b96(0xc4),a135_0xb05b96(0x8c),'secret-retriever']);export function linkEffectiveRuntimeSkills(_0x14cfa7,_0x24c451){const _0x25fb03=a135_0xb05b96,_0xed5468=new Map();for(const _0xebd9ea of _0x14cfa7){const _0x43a4ba=_0xebd9ea[_0x25fb03(0xa8)][_0x25fb03(0x8d)];if(!_0x43a4ba)continue;const _0x1ad549=_0xed5468[_0x25fb03(0xb3)](_0x43a4ba);(!_0x1ad549||_0xebd9ea[_0x25fb03(0xa0)]===_0x25fb03(0xac))&&_0xed5468[_0x25fb03(0xaf)](_0x43a4ba,_0xebd9ea);}const _0x4d1f7d=[];for(const _0x20cb03 of _0xed5468[_0x25fb03(0xb9)]()){const _0x7c4b3f=requireSkillCode(_0x20cb03['skill']),_0x41d781=readMetadataIfPresent(_0x20cb03[_0x25fb03(0x8a)]);if(_0x41d781?.[_0x25fb03(0x9a)]!==_0x24c451['appCode']||_0x41d781[_0x25fb03(0x8d)]!==_0x7c4b3f)throw CliErrors[_0x25fb03(0xb2)](_0x25fb03(0x89)+_0x24c451[_0x25fb03(0x9a)]+':\x20'+_0x20cb03[_0x25fb03(0x8a)]);const _0x2c06a7=runtimeSkillLinkName(_0x24c451,_0x7c4b3f);for(const _0x17e95f of _0x24c451['skillRoots']){_0x4d1f7d[_0x25fb03(0xc1)](ensureManagedSymlink(resolve(_0x17e95f,_0x2c06a7),_0x20cb03['dir'],_0x24c451,_0x7c4b3f));}}return _0x4d1f7d;}export function pruneStaleRuntimeSkillLinks(_0x43f9fa,_0x18a683,_0x3ae2a6){const _0x2c6ee5=a135_0xb05b96,_0x2fa7d0=new Set([..._0x18a683]['map'](_0xe29fc7=>_0xe29fc7[_0x2c6ee5(0x99)]())[_0x2c6ee5(0xaa)](Boolean)),_0x21524f=_0x3ae2a6?new Set([..._0x3ae2a6][_0x2c6ee5(0xab)](_0x37904b=>_0x37904b[_0x2c6ee5(0x99)]())[_0x2c6ee5(0xaa)](Boolean)):undefined,_0x468e0b=[];for(const _0x264580 of _0x43f9fa['skillRoots']){for(const _0x29ddde of managedTargetSkillLinkPaths(_0x264580,_0x43f9fa)){const _0x2c70a8=runtimeSkillCodeFromLink(_0x43f9fa,_0x29ddde);if(_0x21524f&&!_0x21524f[_0x2c6ee5(0xbf)](_0x2c70a8))continue;if(_0x2fa7d0[_0x2c6ee5(0xbf)](_0x2c70a8))continue;_0x468e0b[_0x2c6ee5(0xc1)](removeManagedSkillLink(_0x29ddde,_0x43f9fa,_0x2c70a8));}}return _0x468e0b;}export function pruneStaleRuntimeSkillCache(_0x579935,_0x5c3419={}){const _0x5e7668=a135_0xb05b96,_0x1c9419=new Set([..._0x579935[_0x5e7668(0x98)]]['map'](_0x5aa4cd=>_0x5aa4cd[_0x5e7668(0x99)]())['filter'](Boolean)),_0x5350f0=_0x579935['pruneSkillCodes']?new Set([..._0x579935[_0x5e7668(0xa2)]][_0x5e7668(0xab)](_0x265dd7=>_0x265dd7[_0x5e7668(0x99)]())[_0x5e7668(0xaa)](Boolean)):undefined,_0x3904ca=_0x579935[_0x5e7668(0x93)]??[_0x5e7668(0xac),_0x5e7668(0xa1)],_0x1320e0=resolve(getRuntimeSkillCacheRoot(_0x579935[_0x5e7668(0xb8)],_0x579935[_0x5e7668(0x95)],_0x5c3419),safePathSegment(_0x579935[_0x5e7668(0x9a)],_0x5e7668(0x9a))),_0x33be22=[];for(const _0x44d373 of _0x3904ca){const _0x15bdef=resolve(_0x1320e0,_0x44d373);if(!existsSync(_0x15bdef))continue;for(const _0x1c4958 of readdirSync(_0x15bdef,{'withFileTypes':!![]})){if(!_0x1c4958[_0x5e7668(0xb5)]())continue;const _0x2d1b8c=_0x1c4958[_0x5e7668(0xba)];if(_0x5350f0&&!_0x5350f0[_0x5e7668(0xbf)](_0x2d1b8c))continue;if(_0x1c9419[_0x5e7668(0xbf)](_0x2d1b8c))continue;const _0x315316=resolve(_0x15bdef,_0x2d1b8c),_0x1ed912=readMetadataIfPresent(resolve(_0x315316,METADATA_FILE));if(_0x1ed912?.['appCode']!==_0x579935['appCode']||_0x1ed912[_0x5e7668(0xa0)]!==_0x44d373||_0x1ed912['skillCode']!==_0x2d1b8c){_0x33be22[_0x5e7668(0xc1)]({'path':_0x315316,'action':_0x5e7668(0x91),'reason':_0x5e7668(0xc2)});continue;}if(isLinkedFromAnyRoot(_0x315316,_0x579935[_0x5e7668(0x8b)]??[])){_0x33be22[_0x5e7668(0xc1)]({'path':_0x315316,'action':_0x5e7668(0x91),'reason':_0x5e7668(0xb1)});continue;}removeSync(_0x315316),_0x33be22[_0x5e7668(0xc1)]({'path':_0x315316,'action':'removed'});}}return _0x33be22;}export function linkGlobalRuntimeSkills(_0x3fdff7,_0x894f2c={}){const _0x51dc8a=a135_0xb05b96,_0x22059b=resolveSkillSyncPaths(_0x894f2c),_0x2160c8=[];for(const _0x3c731f of _0x3fdff7){if(_0x3c731f[_0x51dc8a(0xa0)]!==_0x51dc8a(0x96))throw CliErrors[_0x51dc8a(0xb2)](_0x51dc8a(0x87)+_0x3c731f[_0x51dc8a(0xa0)]);const _0x11382e=requireSkillCode(_0x3c731f[_0x51dc8a(0xa8)]),_0x76989d=copyManagedSkillDirectory(_0x3c731f['dir'],resolve(_0x22059b[_0x51dc8a(0xa6)],_0x11382e));_0x2160c8[_0x51dc8a(0xc1)]({..._0x76989d,'contentHash':_0x3c731f[_0x51dc8a(0xa7)]});}return _0x2160c8;}function a135_0x165d(_0x530487,_0x4a4aa5){_0x530487=_0x530487-0x87;const _0x3e26c3=a135_0x3e26();let _0x165db6=_0x3e26c3[_0x530487];return _0x165db6;}function ensureManagedSymlink(_0xde98ac,_0x571024,_0xcb1ecd,_0x541f6f){const _0x376418=a135_0xb05b96;mkdirSync(dirname(_0xde98ac),{'recursive':!![],'mode':0x1c0});if(existsSync(_0xde98ac)||isDanglingSymlink(_0xde98ac)){const _0x5a2e18=lstatSync(_0xde98ac);if(!_0x5a2e18[_0x376418(0xc6)]())throw CliErrors['validation'](_0x376418(0x97)+_0xde98ac);const _0xb987b7=resolveSymlinkTarget(_0xde98ac);if(!isPathInside(realOrResolved(_0xb987b7),realOrResolved(_0xcb1ecd['managedRoot'])))throw CliErrors[_0x376418(0xb2)]('Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20'+_0xde98ac);if(realOrResolved(_0xb987b7)===realOrResolved(_0x571024))return{'path':_0xde98ac,'target':_0x571024,'action':_0x376418(0xa5)};const _0x4b8819=readMetadataIfPresent(resolve(_0xb987b7,METADATA_FILE));if(_0xcb1ecd[_0x376418(0xa0)]===_0x376418(0x92)&&(_0x4b8819?.[_0x376418(0x9a)]!==_0xcb1ecd[_0x376418(0x9a)]||_0x4b8819['skillCode']!==_0x541f6f))throw CliErrors['validation']('Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20'+_0xde98ac);return unlinkSync(_0xde98ac),symlinkSync(_0x571024,_0xde98ac,_0x376418(0xc3)),{'path':_0xde98ac,'target':_0x571024,'action':_0x376418(0xb7)};}return symlinkSync(_0x571024,_0xde98ac,'dir'),{'path':_0xde98ac,'target':_0x571024,'action':_0x376418(0xbd)};}function managedTargetSkillLinkPaths(_0x13e110,_0x3f2df2){const _0xa437b7=a135_0xb05b96;if(!existsSync(_0x13e110))return[];const _0x10bc66=_0x3f2df2[_0xa437b7(0x9a)]+'--';return readdirSync(_0x13e110,{'withFileTypes':!![]})[_0xa437b7(0xaa)](_0x62339=>_0x3f2df2[_0xa437b7(0xa0)]===_0xa437b7(0x92)||_0x62339[_0xa437b7(0xba)][_0xa437b7(0xb0)](_0x10bc66))[_0xa437b7(0xab)](_0x3c6986=>resolve(_0x13e110,_0x3c6986[_0xa437b7(0xba)]));}function removeManagedSkillLink(_0x14eb6b,_0x5b9408,_0x160440){const _0x9856e=a135_0xb05b96,_0xd6f5b6=lstatIfPresent(_0x14eb6b);if(!_0xd6f5b6?.[_0x9856e(0xc6)]())return{'path':_0x14eb6b,'action':_0x9856e(0x91),'reason':'not-managed-symlink'};const _0x63b37e=resolveSymlinkTarget(_0x14eb6b);if(!isPathInside(realOrResolved(_0x63b37e),realOrResolved(_0x5b9408[_0x9856e(0xae)])))return{'path':_0x14eb6b,'action':_0x9856e(0x91),'reason':_0x9856e(0xc0)};const _0x5bfde2=readMetadataIfPresent(resolve(_0x63b37e,METADATA_FILE));if(_0x5b9408[_0x9856e(0xa0)]===_0x9856e(0x92)&&(_0x5bfde2?.[_0x9856e(0x9a)]!==_0x5b9408[_0x9856e(0x9a)]||_0x5bfde2[_0x9856e(0x8d)]!==_0x160440))return{'path':_0x14eb6b,'action':_0x9856e(0x91),'reason':_0x9856e(0xc2)};return unlinkSync(_0x14eb6b),{'path':_0x14eb6b,'action':_0x9856e(0xa3)};}function isLinkedFromAnyRoot(_0x1da732,_0x4816f7){const _0x24757d=a135_0xb05b96,_0x559720=realOrResolved(_0x1da732);for(const _0x30828e of _0x4816f7){if(!existsSync(_0x30828e))continue;for(const _0x1d2d0e of readdirSync(_0x30828e,{'withFileTypes':!![]})){if(!_0x1d2d0e[_0x24757d(0xc6)]())continue;const _0x280b0a=resolve(_0x30828e,_0x1d2d0e[_0x24757d(0xba)]);if(realOrResolved(resolveSymlinkTarget(_0x280b0a))===_0x559720)return!![];}}return![];}function runtimeSkillLinkName(_0x574d14,_0x1b3a5a){const _0x577532=a135_0xb05b96,_0x507ac1=safePathSegment(_0x1b3a5a,_0x577532(0x8d));if(_0x574d14[_0x577532(0xa0)]===_0x577532(0x92)&&RESERVED_PROJECT_SKILL_CODES[_0x577532(0xbf)](_0x507ac1))throw CliErrors[_0x577532(0xb2)](_0x577532(0x88)+_0x507ac1);return _0x574d14[_0x577532(0xa0)]===_0x577532(0x92)?_0x507ac1:_0x574d14[_0x577532(0x9a)]+'--'+_0x507ac1;}function runtimeSkillCodeFromLink(_0x419e06,_0x55fe37){const _0x97865a=a135_0xb05b96,_0x4ea05a=basename(_0x55fe37);return _0x419e06['scope']===_0x97865a(0x92)?_0x4ea05a:_0x4ea05a[_0x97865a(0x9c)]((_0x419e06[_0x97865a(0x9a)]+'--')[_0x97865a(0xa9)]);}export function copyManagedSkillDirectory(_0x59a715,_0xe7fb11){const _0x4a7717=a135_0xb05b96,_0x6d88d7=resolve(_0xe7fb11,METADATA_FILE),_0x3ff01c=existsSync(_0xe7fb11);if(_0x3ff01c){const _0x2e15f8=lstatSync(_0xe7fb11);if(_0x2e15f8[_0x4a7717(0xc6)]())throw CliErrors[_0x4a7717(0xb2)](_0x4a7717(0xb4)+_0xe7fb11);if(!_0x2e15f8['isDirectory']())throw CliErrors[_0x4a7717(0xb2)](_0x4a7717(0x9e)+_0xe7fb11);const _0x93442c=readMetadataIfPresent(_0x6d88d7);if(_0x93442c?.['scope']!==_0x4a7717(0x96))throw CliErrors['validation'](_0x4a7717(0x8e)+_0xe7fb11);}ensureDirSync(dirname(_0xe7fb11));const _0x3616bc=_0x3ff01c?readMetadataIfPresent(_0x6d88d7)?.[_0x4a7717(0xa7)]:undefined,_0x2752ad=readMetadataIfPresent(resolve(_0x59a715,METADATA_FILE))?.[_0x4a7717(0xa7)];return _0x3ff01c&&removeSync(_0xe7fb11),copySkillDirectory(_0x59a715,_0xe7fb11),{'path':_0xe7fb11,'target':_0x59a715,'action':!_0x3ff01c?_0x4a7717(0xbd):_0x3616bc===_0x2752ad?_0x4a7717(0xa5):'updated'};}function copySkillDirectory(_0x3838f7,_0x45c32b){copySync(_0x3838f7,_0x45c32b,{'dereference':![],'overwrite':!![],'filter'(_0x113215){const _0xe30d1e=a135_0x165d;if(lstatSync(_0x113215)[_0xe30d1e(0xc6)]())throw CliErrors[_0xe30d1e(0xb2)](_0xe30d1e(0x9d)+_0x113215);return!![];}});}
@@ -1 +1 @@
1
- (function(_0x554f80,_0x2b3918){const _0x4842d6=a136_0x5266,_0x317d93=_0x554f80();while(!![]){try{const _0x1adfff=parseInt(_0x4842d6(0xac))/0x1*(parseInt(_0x4842d6(0x93))/0x2)+-parseInt(_0x4842d6(0x9d))/0x3*(-parseInt(_0x4842d6(0xbd))/0x4)+parseInt(_0x4842d6(0xa8))/0x5+parseInt(_0x4842d6(0x94))/0x6+parseInt(_0x4842d6(0xb6))/0x7+-parseInt(_0x4842d6(0xbb))/0x8*(-parseInt(_0x4842d6(0xaa))/0x9)+-parseInt(_0x4842d6(0x95))/0xa;if(_0x1adfff===_0x2b3918)break;else _0x317d93['push'](_0x317d93['shift']());}catch(_0x583f35){_0x317d93['push'](_0x317d93['shift']());}}}(a136_0x8332,0xe9da0));import{existsSync,readdirSync}from'node:fs';function a136_0x5266(_0x1edb91,_0x5d8f68){_0x1edb91=_0x1edb91-0x90;const _0x83321d=a136_0x8332();let _0x5266d1=_0x83321d[_0x1edb91];return _0x5266d1;}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 a136_0x8332(){const _0x54a869=['push','filter','10906196LfGdbj','has','linkedPaths','isArray','link','2319920yMjrpc','env','528124TemDXQ','validation','includes','tags','map','isDirectory','2846962HFbjyX','7550256MXBtGP','71005240GLUsmg','code','cacheDir','accessKey','trim','\x20!=\x20','startsWith','builtin','27rugLpQ','get','appCode','scopes','set','scope','Runtime\x20Skill\x20install\x20target\x20app\x20mismatch:\x20','values','name','from','dir','8801230GrfepY','isSymbolicLink','27CJbANQ','cache','1uUPLyH','linkedPath','localeCompare','project','skillCode','source','sort','skillRoots'];a136_0x8332=function(){return _0x54a869;};return a136_0x8332();}export function listLocalRuntimeSkills(_0x42830c,_0x401a41,_0x33124c={}){const _0x50d701=a136_0x5266,_0x556d97=safePathSegment(_0x42830c[_0x50d701(0x9f)],'appCode');if(_0x401a41[_0x50d701(0x9f)]!==_0x556d97)throw CliErrors[_0x50d701(0xbe)](_0x50d701(0xa3)+_0x401a41[_0x50d701(0x9f)]+_0x50d701(0x9a)+_0x556d97);const _0x5c3e2b=normalizeRuntimeSkillScopes(_0x42830c[_0x50d701(0xa0)]),_0x1a66fc=new Set(_0x5c3e2b),_0x3b5e28=_0x42830c[_0x50d701(0x96)]?.[_0x50d701(0x99)](),_0x22678a=new Map(),_0x5a7b39=resolve(getRuntimeSkillCacheRoot(_0x42830c[_0x50d701(0xbc)],_0x42830c[_0x50d701(0x98)],_0x33124c),_0x556d97);for(const _0x50b6ca of _0x5c3e2b){for(const _0x10418d of localSkillEntryDirs(resolve(_0x5a7b39,_0x50b6ca))){collectLocalRuntimeSkill(_0x22678a,_0x10418d,{'appCode':_0x556d97,'scopes':_0x1a66fc,'code':_0x3b5e28,'source':'cache'});}}for(const _0xeea6c5 of _0x401a41[_0x50d701(0xb3)]){for(const _0x42e79b of localSkillLinkCandidates(_0xeea6c5,_0x401a41,_0x1a66fc)){collectLocalRuntimeSkill(_0x22678a,_0x42e79b,{'appCode':_0x556d97,'scopes':_0x1a66fc,'code':_0x3b5e28,'source':_0x50d701(0xba),'linkedPath':_0x42e79b});}}return Array[_0x50d701(0xa6)](_0x22678a[_0x50d701(0xa4)]())[_0x50d701(0xb2)](compareLocalRuntimeSkills);}function localSkillEntryDirs(_0x2a6efd){const _0x48edc2=a136_0x5266;if(!existsSync(_0x2a6efd))return[];return readdirSync(_0x2a6efd,{'withFileTypes':!![]})['filter'](_0x39c493=>_0x39c493[_0x48edc2(0x92)]()||_0x39c493['isSymbolicLink']())[_0x48edc2(0x91)](_0x1f2d87=>resolve(_0x2a6efd,_0x1f2d87[_0x48edc2(0xa5)]));}function localSkillLinkCandidates(_0x13ae17,_0x5610f6,_0x58f135){const _0x2da995=a136_0x5266;if(!existsSync(_0x13ae17))return[];const _0x29dbb5=_0x5610f6[_0x2da995(0x9f)]+'--';return readdirSync(_0x13ae17,{'withFileTypes':!![]})[_0x2da995(0xb5)](_0x263a92=>_0x263a92['isDirectory']()||_0x263a92[_0x2da995(0xa9)]())[_0x2da995(0xb5)](_0x1aca9d=>_0x5610f6[_0x2da995(0xa2)]===_0x2da995(0xaf)||_0x1aca9d['name'][_0x2da995(0x9b)](_0x29dbb5)||_0x58f135[_0x2da995(0xb7)](_0x2da995(0x9c)))[_0x2da995(0x91)](_0x1f16dc=>resolve(_0x13ae17,_0x1f16dc[_0x2da995(0xa5)]));}function collectLocalRuntimeSkill(_0x3c2fc9,_0x5da805,_0x2fd770){const _0x2eb86c=a136_0x5266,_0x3b0f21=resolve(_0x5da805,METADATA_FILE),_0x3394d1=readMetadataIfPresent(_0x3b0f21);if(!_0x3394d1)return;if(_0x3394d1[_0x2eb86c(0x9f)]!==_0x2fd770[_0x2eb86c(0x9f)])return;if(!isRuntimeSkillScope(_0x3394d1[_0x2eb86c(0xa2)])||!_0x2fd770[_0x2eb86c(0xa0)][_0x2eb86c(0xb7)](_0x3394d1[_0x2eb86c(0xa2)]))return;const _0x24e4d5=_0x3394d1['skillCode']?.[_0x2eb86c(0x99)]();if(!_0x24e4d5)return;if(_0x2fd770[_0x2eb86c(0x96)]&&_0x24e4d5!==_0x2fd770[_0x2eb86c(0x96)])return;const _0x59dbd9=_0x3394d1[_0x2eb86c(0xa2)]+':'+_0x24e4d5,_0x2177bc=_0x2fd770[_0x2eb86c(0xad)]?[_0x2fd770['linkedPath']]:[],_0x371f51=_0x3c2fc9[_0x2eb86c(0x9e)](_0x59dbd9);if(_0x371f51){_0x2fd770[_0x2eb86c(0xb1)]===_0x2eb86c(0xab)&&(_0x371f51[_0x2eb86c(0xa7)]=_0x5da805,_0x371f51[_0x2eb86c(0x97)]=_0x5da805,_0x371f51['skillMdPath']=resolve(_0x5da805,SKILL_FILE),_0x371f51['metadataPath']=_0x3b0f21);for(const _0x375628 of _0x2177bc){!_0x371f51[_0x2eb86c(0xb8)][_0x2eb86c(0xbf)](_0x375628)&&_0x371f51[_0x2eb86c(0xb8)][_0x2eb86c(0xb4)](_0x375628);}_0x371f51[_0x2eb86c(0xb8)]['sort']();return;}_0x3c2fc9[_0x2eb86c(0xa1)](_0x59dbd9,{..._0x3394d1,'tags':Array[_0x2eb86c(0xb9)](_0x3394d1['tags'])?_0x3394d1[_0x2eb86c(0x90)]:[],'scope':_0x3394d1['scope'],'source':'local','dir':_0x5da805,'cacheDir':_0x2fd770[_0x2eb86c(0xb1)]==='cache'?_0x5da805:undefined,'skillMdPath':resolve(_0x5da805,SKILL_FILE),'metadataPath':_0x3b0f21,'linkedPaths':_0x2177bc});}function compareLocalRuntimeSkills(_0x31440a,_0x4fbf23){const _0x5a7aa4=a136_0x5266,_0x7e1d95={'personal':0x0,'company':0x1,'builtin':0x2};return _0x7e1d95[_0x31440a[_0x5a7aa4(0xa2)]]-_0x7e1d95[_0x4fbf23[_0x5a7aa4(0xa2)]]||_0x31440a['skillCode'][_0x5a7aa4(0xae)](_0x4fbf23[_0x5a7aa4(0xb0)])||_0x31440a[_0x5a7aa4(0xa7)]['localeCompare'](_0x4fbf23[_0x5a7aa4(0xa7)]);}
1
+ (function(_0x5257cb,_0x21633e){const _0xca5154=a136_0x3f1c,_0x5d5474=_0x5257cb();while(!![]){try{const _0x3a7188=-parseInt(_0xca5154(0x1b3))/0x1*(-parseInt(_0xca5154(0x1b5))/0x2)+parseInt(_0xca5154(0x1ac))/0x3*(parseInt(_0xca5154(0x1b8))/0x4)+-parseInt(_0xca5154(0x1a3))/0x5+-parseInt(_0xca5154(0x1ba))/0x6+parseInt(_0xca5154(0x1a4))/0x7+parseInt(_0xca5154(0x1b0))/0x8*(-parseInt(_0xca5154(0x1b2))/0x9)+-parseInt(_0xca5154(0x1a7))/0xa*(parseInt(_0xca5154(0x1a9))/0xb);if(_0x3a7188===_0x21633e)break;else _0x5d5474['push'](_0x5d5474['shift']());}catch(_0x43e701){_0x5d5474['push'](_0x5d5474['shift']());}}}(a136_0x5827,0x9591e));function a136_0x5827(){const _0x54db1b=['tags','set','env','has','isDirectory','metadataPath','cache','sort','map','localeCompare','source','70210ohPdfg','8491665YiyuGf','cacheDir','filter','67370dboxPJ','isArray','11QRnCMQ','\x20!=\x20','isSymbolicLink','2949UXPuCV','trim','push','skillCode','4616tMHekb','project','11592zZnDOa','739109taTVKu','code','2eOhWsi','get','validation','2188HlgrlJ','appCode','6679872ptBVjt','linkedPaths','accessKey','skillMdPath','name','values','Runtime\x20Skill\x20install\x20target\x20app\x20mismatch:\x20','scope','linkedPath','from','scopes','link','dir'];a136_0x5827=function(){return _0x54db1b;};return a136_0x5827();}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(_0x31a653,_0x1d3055,_0x556766={}){const _0x57980c=a136_0x3f1c,_0x3270a3=safePathSegment(_0x31a653['appCode'],_0x57980c(0x1b9));if(_0x1d3055['appCode']!==_0x3270a3)throw CliErrors[_0x57980c(0x1b7)](_0x57980c(0x1c0)+_0x1d3055[_0x57980c(0x1b9)]+_0x57980c(0x1aa)+_0x3270a3);const _0x590bc4=normalizeRuntimeSkillScopes(_0x31a653['scopes']),_0x301a6a=new Set(_0x590bc4),_0x4d8339=_0x31a653['code']?.[_0x57980c(0x1ad)](),_0x25d922=new Map(),_0x1df482=resolve(getRuntimeSkillCacheRoot(_0x31a653[_0x57980c(0x1c9)],_0x31a653[_0x57980c(0x1bc)],_0x556766),_0x3270a3);for(const _0x13f374 of _0x590bc4){for(const _0x94e13c of localSkillEntryDirs(resolve(_0x1df482,_0x13f374))){collectLocalRuntimeSkill(_0x25d922,_0x94e13c,{'appCode':_0x3270a3,'scopes':_0x301a6a,'code':_0x4d8339,'source':'cache'});}}for(const _0x5664aa of _0x1d3055['skillRoots']){for(const _0x1cf9a2 of localSkillLinkCandidates(_0x5664aa,_0x1d3055,_0x301a6a)){collectLocalRuntimeSkill(_0x25d922,_0x1cf9a2,{'appCode':_0x3270a3,'scopes':_0x301a6a,'code':_0x4d8339,'source':_0x57980c(0x1c5),'linkedPath':_0x1cf9a2});}}return Array[_0x57980c(0x1c3)](_0x25d922[_0x57980c(0x1bf)]())[_0x57980c(0x19f)](compareLocalRuntimeSkills);}function localSkillEntryDirs(_0x40c3c3){const _0x9cb3e5=a136_0x3f1c;if(!existsSync(_0x40c3c3))return[];return readdirSync(_0x40c3c3,{'withFileTypes':!![]})[_0x9cb3e5(0x1a6)](_0x4c3978=>_0x4c3978[_0x9cb3e5(0x1cb)]()||_0x4c3978['isSymbolicLink']())[_0x9cb3e5(0x1a0)](_0xac9afa=>resolve(_0x40c3c3,_0xac9afa[_0x9cb3e5(0x1be)]));}function localSkillLinkCandidates(_0x2ae662,_0x3a67d2,_0x5b20f7){const _0x328c17=a136_0x3f1c;if(!existsSync(_0x2ae662))return[];const _0x57489b=_0x3a67d2['appCode']+'--';return readdirSync(_0x2ae662,{'withFileTypes':!![]})[_0x328c17(0x1a6)](_0x353eb0=>_0x353eb0[_0x328c17(0x1cb)]()||_0x353eb0[_0x328c17(0x1ab)]())[_0x328c17(0x1a6)](_0x2e1ba1=>_0x3a67d2[_0x328c17(0x1c1)]===_0x328c17(0x1b1)||_0x2e1ba1[_0x328c17(0x1be)]['startsWith'](_0x57489b)||_0x5b20f7[_0x328c17(0x1ca)]('builtin'))[_0x328c17(0x1a0)](_0xf9dbe=>resolve(_0x2ae662,_0xf9dbe[_0x328c17(0x1be)]));}function a136_0x3f1c(_0x46ea53,_0x2f48fa){_0x46ea53=_0x46ea53-0x19d;const _0x58271b=a136_0x5827();let _0x3f1c0a=_0x58271b[_0x46ea53];return _0x3f1c0a;}function collectLocalRuntimeSkill(_0x1e10c5,_0x288990,_0x19306f){const _0x36b797=a136_0x3f1c,_0x277fb3=resolve(_0x288990,METADATA_FILE),_0x3f24f9=readMetadataIfPresent(_0x277fb3);if(!_0x3f24f9)return;if(_0x3f24f9[_0x36b797(0x1b9)]!==_0x19306f[_0x36b797(0x1b9)])return;if(!isRuntimeSkillScope(_0x3f24f9[_0x36b797(0x1c1)])||!_0x19306f[_0x36b797(0x1c4)]['has'](_0x3f24f9[_0x36b797(0x1c1)]))return;const _0x3538d5=_0x3f24f9[_0x36b797(0x1af)]?.['trim']();if(!_0x3538d5)return;if(_0x19306f[_0x36b797(0x1b4)]&&_0x3538d5!==_0x19306f[_0x36b797(0x1b4)])return;const _0x58b502=_0x3f24f9['scope']+':'+_0x3538d5,_0x2fc2f8=_0x19306f[_0x36b797(0x1c2)]?[_0x19306f[_0x36b797(0x1c2)]]:[],_0x507c11=_0x1e10c5[_0x36b797(0x1b6)](_0x58b502);if(_0x507c11){_0x19306f[_0x36b797(0x1a2)]===_0x36b797(0x19e)&&(_0x507c11[_0x36b797(0x1c6)]=_0x288990,_0x507c11[_0x36b797(0x1a5)]=_0x288990,_0x507c11[_0x36b797(0x1bd)]=resolve(_0x288990,SKILL_FILE),_0x507c11[_0x36b797(0x19d)]=_0x277fb3);for(const _0x74831a of _0x2fc2f8){!_0x507c11[_0x36b797(0x1bb)]['includes'](_0x74831a)&&_0x507c11[_0x36b797(0x1bb)][_0x36b797(0x1ae)](_0x74831a);}_0x507c11['linkedPaths'][_0x36b797(0x19f)]();return;}_0x1e10c5[_0x36b797(0x1c8)](_0x58b502,{..._0x3f24f9,'tags':Array[_0x36b797(0x1a8)](_0x3f24f9[_0x36b797(0x1c7)])?_0x3f24f9[_0x36b797(0x1c7)]:[],'scope':_0x3f24f9[_0x36b797(0x1c1)],'source':'local','dir':_0x288990,'cacheDir':_0x19306f[_0x36b797(0x1a2)]===_0x36b797(0x19e)?_0x288990:undefined,'skillMdPath':resolve(_0x288990,SKILL_FILE),'metadataPath':_0x277fb3,'linkedPaths':_0x2fc2f8});}function compareLocalRuntimeSkills(_0x4747fa,_0x13b78d){const _0x5334ca=a136_0x3f1c,_0x59bfcd={'personal':0x0,'company':0x1,'builtin':0x2};return _0x59bfcd[_0x4747fa[_0x5334ca(0x1c1)]]-_0x59bfcd[_0x13b78d[_0x5334ca(0x1c1)]]||_0x4747fa[_0x5334ca(0x1af)][_0x5334ca(0x1a1)](_0x13b78d[_0x5334ca(0x1af)])||_0x4747fa[_0x5334ca(0x1c6)][_0x5334ca(0x1a1)](_0x13b78d[_0x5334ca(0x1c6)]);}
@@ -1 +1 @@
1
- (function(_0x25efcb,_0x586fdc){const _0x4399a0=a137_0x1343,_0x343d65=_0x25efcb();while(!![]){try{const _0x53e7bc=-parseInt(_0x4399a0(0xa2))/0x1+parseInt(_0x4399a0(0xa7))/0x2+-parseInt(_0x4399a0(0x93))/0x3*(parseInt(_0x4399a0(0x9e))/0x4)+-parseInt(_0x4399a0(0x88))/0x5*(parseInt(_0x4399a0(0x85))/0x6)+parseInt(_0x4399a0(0xa0))/0x7+parseInt(_0x4399a0(0x8b))/0x8*(-parseInt(_0x4399a0(0x8d))/0x9)+parseInt(_0x4399a0(0xa5))/0xa;if(_0x53e7bc===_0x586fdc)break;else _0x343d65['push'](_0x343d65['shift']());}catch(_0xaf832b){_0x343d65['push'](_0x343d65['shift']());}}}(a137_0x128c,0xdba8b));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(_0x19f815){const _0x25c4fd=a137_0x1343;return _0x19f815[_0x25c4fd(0xa6)]??Buffer[_0x25c4fd(0x9b)](_0x19f815['content']??'',_0x25c4fd(0x95));}export function fileText(_0x1a8f72){const _0x28ea52=a137_0x1343;return fileContent(_0x1a8f72)[_0x28ea52(0xa4)](_0x28ea52(0x95));}export function normalizeLocalFiles(_0x5170d3){const _0x5adb1d=a137_0x1343;if(!Array[_0x5adb1d(0x9d)](_0x5170d3)||_0x5170d3['length']===0x0)return[];const _0x1e3cd2=new Map();for(const _0x3ed8f2 of _0x5170d3){if(!_0x3ed8f2||typeof _0x3ed8f2!==_0x5adb1d(0x98)||typeof _0x3ed8f2['path']!=='string')throw CliErrors[_0x5adb1d(0x97)](_0x5adb1d(0x94));const _0x4b768f=normalizeSkillRelativePath(_0x3ed8f2[_0x5adb1d(0x7c)]);if(_0x1e3cd2[_0x5adb1d(0x80)](_0x4b768f))throw CliErrors[_0x5adb1d(0x97)](_0x5adb1d(0x7e)+_0x4b768f);if(_0x3ed8f2[_0x5adb1d(0xa6)]!==undefined&&!Buffer[_0x5adb1d(0x8e)](_0x3ed8f2[_0x5adb1d(0xa6)]))throw CliErrors[_0x5adb1d(0x97)]('Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20'+_0x4b768f);if(_0x3ed8f2['bytes']===undefined&&typeof _0x3ed8f2[_0x5adb1d(0xa9)]!==_0x5adb1d(0x8a))throw CliErrors[_0x5adb1d(0x97)]('Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20'+_0x4b768f);const _0x658858=fileContent(_0x3ed8f2);_0x1e3cd2[_0x5adb1d(0x92)](_0x4b768f,{'path':_0x4b768f,'bytes':_0x658858});}return Array[_0x5adb1d(0x9b)](_0x1e3cd2[_0x5adb1d(0x9c)]())[_0x5adb1d(0x8f)](compareSkillFiles);}export function normalizeManifestFiles(_0x1956aa){const _0x5977d8=a137_0x1343;if(!Array[_0x5977d8(0x9d)](_0x1956aa)||_0x1956aa[_0x5977d8(0x7d)]===0x0)return[];const _0x51e230=new Map();for(const _0x16790c of _0x1956aa){if(!_0x16790c||typeof _0x16790c!==_0x5977d8(0x98)||typeof _0x16790c[_0x5977d8(0x7c)]!==_0x5977d8(0x8a))throw CliErrors[_0x5977d8(0x97)]('Skill\x20file\x20path\x20must\x20be\x20text.');const _0x53ce36=normalizeSkillRelativePath(_0x16790c[_0x5977d8(0x7c)]);if(_0x51e230[_0x5977d8(0x80)](_0x53ce36))throw CliErrors[_0x5977d8(0x97)](_0x5977d8(0x7e)+_0x53ce36);if(!isSha256Hex(_0x16790c[_0x5977d8(0xa1)]))throw CliErrors[_0x5977d8(0x97)](_0x5977d8(0xa8)+_0x53ce36);if(!Number[_0x5977d8(0xa3)](_0x16790c[_0x5977d8(0x8c)])||_0x16790c['size']<0x0)throw CliErrors[_0x5977d8(0x97)](_0x5977d8(0x89)+_0x53ce36);_0x51e230['set'](_0x53ce36,{'path':_0x53ce36,'sha256':_0x16790c[_0x5977d8(0xa1)][_0x5977d8(0x87)](),'size':_0x16790c[_0x5977d8(0x8c)]});}return Array['from'](_0x51e230[_0x5977d8(0x9c)]())[_0x5977d8(0x8f)](compareSkillFiles);}export function scanSkillDirectory(_0x45db7d,_0x19fd6a={}){const _0x54749b=a137_0x1343,_0x8b5772=realpathSync(_0x45db7d),_0x31e9ad=canonicalExcludedFilePaths(_0x19fd6a[_0x54749b(0x84)]),_0x595a4a=[];function _0x3b040d(_0x4e4cb0){const _0xe1b38b=_0x54749b,_0x5daeb5=readdirSync(_0x4e4cb0,{'withFileTypes':!![]})[_0xe1b38b(0x8f)]((_0x877a69,_0x71f191)=>_0x877a69[_0xe1b38b(0x86)]['localeCompare'](_0x71f191[_0xe1b38b(0x86)]));for(const _0x2e6130 of _0x5daeb5){if(_0x2e6130[_0xe1b38b(0x7f)]()&&IGNORED_DIR_NAMES[_0xe1b38b(0x80)](_0x2e6130[_0xe1b38b(0x86)]))continue;if(IGNORED_FILE_NAMES[_0xe1b38b(0x80)](_0x2e6130[_0xe1b38b(0x86)]))continue;const _0x302463=resolve(_0x4e4cb0,_0x2e6130['name']);if(isExcludedFilePath(_0x302463,_0x31e9ad))continue;if(_0x2e6130['isSymbolicLink']())throw CliErrors[_0xe1b38b(0x97)](_0xe1b38b(0x9a)+_0x302463);const _0x1498d4=toPosixPath(relative(_0x8b5772,_0x302463));if(_0x2e6130['isDirectory']()){_0x3b040d(_0x302463);continue;}if(!_0x2e6130[_0xe1b38b(0x96)]())continue;validateSkillRelativePath(_0x1498d4);const _0x3717eb=readFileSync(_0x302463);_0x595a4a[_0xe1b38b(0x90)]({'path':_0x1498d4,'bytes':_0x3717eb});}}return _0x3b040d(_0x8b5772),normalizeLocalFiles(_0x595a4a);}function canonicalExcludedFilePaths(_0x2614c0){const _0x478958=a137_0x1343,_0x3d7c92=new Set();for(const _0x2648d3 of _0x2614c0??[]){const _0x45cc04=resolve(_0x2648d3);_0x3d7c92[_0x478958(0x82)](_0x45cc04);try{_0x3d7c92[_0x478958(0x82)](realpathSync(_0x45cc04));}catch{}}return _0x3d7c92;}function a137_0x1343(_0x109053,_0x996349){_0x109053=_0x109053-0x7b;const _0x128c80=a137_0x128c();let _0x13438f=_0x128c80[_0x109053];return _0x13438f;}function isExcludedFilePath(_0x2cbb80,_0x9db0d9){const _0xcff0a3=a137_0x1343;if(_0x9db0d9[_0xcff0a3(0x80)](_0x2cbb80))return!![];if(_0x9db0d9[_0xcff0a3(0x8c)]===0x0)return![];try{return _0x9db0d9[_0xcff0a3(0x80)](realpathSync(_0x2cbb80));}catch{return![];}}export function compareSkillFiles(_0x5a9afc,_0x124ead){const _0x1f07be=a137_0x1343;if(_0x5a9afc['path']===SKILL_FILE)return _0x124ead[_0x1f07be(0x7c)]===SKILL_FILE?0x0:-0x1;if(_0x124ead[_0x1f07be(0x7c)]===SKILL_FILE)return 0x1;return Buffer[_0x1f07be(0x99)](Buffer['from'](_0x5a9afc['path'],'utf8'),Buffer[_0x1f07be(0x9b)](_0x124ead['path'],_0x1f07be(0x95)));}function a137_0x128c(){const _0x514428=['string','1683496UMyOvv','size','9bjilhz','isBuffer','sort','push','Unsafe\x20Skill\x20file\x20path:\x20','set','368931himmJX','Skill\x20file\x20path\x20must\x20be\x20text.','utf8','isFile','validation','object','compare','Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20','from','values','isArray','24SScpgK','startsWith','3838198kelyWX','sha256','1659449ZxbOlw','isSafeInteger','toString','28149720FXpsNe','bytes','2321422ZaKpRc','Skill\x20file\x20sha256\x20is\x20invalid:\x20','content','replace','path','length','Duplicate\x20Skill\x20file\x20path:\x20','isDirectory','has','includes','add','split','excludedFilePaths','126pbCPLg','name','toLowerCase','242030eakeUH','Skill\x20file\x20size\x20is\x20invalid:\x20'];a137_0x128c=function(){return _0x514428;};return a137_0x128c();}export function normalizeSkillRelativePath(_0x430fec){const _0x31bd02=toPosixPath(_0x430fec['trim']());return validateSkillRelativePath(_0x31bd02),_0x31bd02;}export function validateSkillRelativePath(_0x26eff6){const _0x180502=a137_0x1343;if(!_0x26eff6||_0x26eff6[_0x180502(0x9f)]('/')||_0x26eff6[_0x180502(0x81)]('//'))throw CliErrors[_0x180502(0x97)](_0x180502(0x91)+_0x26eff6);for(const _0x540211 of _0x26eff6[_0x180502(0x83)]('/')){if(!_0x540211||_0x540211==='.'||_0x540211==='..')throw CliErrors[_0x180502(0x97)](_0x180502(0x91)+_0x26eff6);}}export function toPosixPath(_0x3841b7){const _0x56a30c=a137_0x1343;return _0x3841b7[_0x56a30c(0x7b)](/\\/g,'/');}export function isSha256Hex(_0x54b8f0){const _0x4ec534=a137_0x1343;return typeof _0x54b8f0===_0x4ec534(0x8a)&&/^[a-fA-F0-9]{64}$/['test'](_0x54b8f0);}
1
+ (function(_0x3dd1a8,_0x3d9610){const _0x3db67e=a137_0xa3a0,_0x4d05f6=_0x3dd1a8();while(!![]){try{const _0x386d9f=-parseInt(_0x3db67e(0x1a0))/0x1*(parseInt(_0x3db67e(0x1b5))/0x2)+-parseInt(_0x3db67e(0x197))/0x3+parseInt(_0x3db67e(0x1ab))/0x4+parseInt(_0x3db67e(0x1b2))/0x5*(parseInt(_0x3db67e(0x1b3))/0x6)+parseInt(_0x3db67e(0x1b1))/0x7*(parseInt(_0x3db67e(0x194))/0x8)+-parseInt(_0x3db67e(0x1b4))/0x9+-parseInt(_0x3db67e(0x1aa))/0xa;if(_0x386d9f===_0x3d9610)break;else _0x4d05f6['push'](_0x4d05f6['shift']());}catch(_0x256783){_0x4d05f6['push'](_0x4d05f6['shift']());}}}(a137_0x533e,0x6379c));function a137_0xa3a0(_0x1b29c9,_0x1c82ec){_0x1b29c9=_0x1b29c9-0x191;const _0x533ef8=a137_0x533e();let _0xa3a0ac=_0x533ef8[_0x1b29c9];return _0xa3a0ac;}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(_0x36634d){const _0xd5153b=a137_0xa3a0;return _0x36634d[_0xd5153b(0x1ac)]??Buffer[_0xd5153b(0x19f)](_0x36634d[_0xd5153b(0x1b9)]??'',_0xd5153b(0x1ae));}export function fileText(_0x28aa56){const _0xc972ae=a137_0xa3a0;return fileContent(_0x28aa56)['toString'](_0xc972ae(0x1ae));}export function normalizeLocalFiles(_0x361d18){const _0x280f25=a137_0xa3a0;if(!Array['isArray'](_0x361d18)||_0x361d18['length']===0x0)return[];const _0x18c237=new Map();for(const _0x1f927c of _0x361d18){if(!_0x1f927c||typeof _0x1f927c!=='object'||typeof _0x1f927c[_0x280f25(0x19c)]!=='string')throw CliErrors[_0x280f25(0x198)]('Skill\x20file\x20path\x20must\x20be\x20text.');const _0x5e894a=normalizeSkillRelativePath(_0x1f927c[_0x280f25(0x19c)]);if(_0x18c237[_0x280f25(0x19a)](_0x5e894a))throw CliErrors[_0x280f25(0x198)](_0x280f25(0x196)+_0x5e894a);if(_0x1f927c[_0x280f25(0x1ac)]!==undefined&&!Buffer[_0x280f25(0x1b0)](_0x1f927c[_0x280f25(0x1ac)]))throw CliErrors[_0x280f25(0x198)]('Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20'+_0x5e894a);if(_0x1f927c['bytes']===undefined&&typeof _0x1f927c['content']!==_0x280f25(0x193))throw CliErrors[_0x280f25(0x198)](_0x280f25(0x195)+_0x5e894a);const _0x7066aa=fileContent(_0x1f927c);_0x18c237[_0x280f25(0x19d)](_0x5e894a,{'path':_0x5e894a,'bytes':_0x7066aa});}return Array['from'](_0x18c237[_0x280f25(0x1ad)]())[_0x280f25(0x1a8)](compareSkillFiles);}export function normalizeManifestFiles(_0x1f075b){const _0x1e8dcf=a137_0xa3a0;if(!Array[_0x1e8dcf(0x192)](_0x1f075b)||_0x1f075b[_0x1e8dcf(0x1a9)]===0x0)return[];const _0xb6abe7=new Map();for(const _0x262e0c of _0x1f075b){if(!_0x262e0c||typeof _0x262e0c!=='object'||typeof _0x262e0c[_0x1e8dcf(0x19c)]!==_0x1e8dcf(0x193))throw CliErrors[_0x1e8dcf(0x198)](_0x1e8dcf(0x19e));const _0x27cb6b=normalizeSkillRelativePath(_0x262e0c[_0x1e8dcf(0x19c)]);if(_0xb6abe7[_0x1e8dcf(0x19a)](_0x27cb6b))throw CliErrors[_0x1e8dcf(0x198)](_0x1e8dcf(0x196)+_0x27cb6b);if(!isSha256Hex(_0x262e0c[_0x1e8dcf(0x1a5)]))throw CliErrors[_0x1e8dcf(0x198)](_0x1e8dcf(0x191)+_0x27cb6b);if(!Number['isSafeInteger'](_0x262e0c['size'])||_0x262e0c[_0x1e8dcf(0x199)]<0x0)throw CliErrors[_0x1e8dcf(0x198)](_0x1e8dcf(0x1b6)+_0x27cb6b);_0xb6abe7[_0x1e8dcf(0x19d)](_0x27cb6b,{'path':_0x27cb6b,'sha256':_0x262e0c[_0x1e8dcf(0x1a5)]['toLowerCase'](),'size':_0x262e0c[_0x1e8dcf(0x199)]});}return Array[_0x1e8dcf(0x19f)](_0xb6abe7[_0x1e8dcf(0x1ad)]())['sort'](compareSkillFiles);}export function scanSkillDirectory(_0x2ea809,_0x58f55d={}){const _0x299dc2=a137_0xa3a0,_0x5949c3=realpathSync(_0x2ea809),_0x2ded90=canonicalExcludedFilePaths(_0x58f55d[_0x299dc2(0x1a4)]),_0x1974ac=[];function _0xc6256(_0x8812b6){const _0x6c485e=_0x299dc2,_0x31df28=readdirSync(_0x8812b6,{'withFileTypes':!![]})[_0x6c485e(0x1a8)]((_0x105ad2,_0x50844b)=>_0x105ad2[_0x6c485e(0x19b)][_0x6c485e(0x1b7)](_0x50844b[_0x6c485e(0x19b)]));for(const _0x1ed2de of _0x31df28){if(_0x1ed2de['isDirectory']()&&IGNORED_DIR_NAMES[_0x6c485e(0x19a)](_0x1ed2de[_0x6c485e(0x19b)]))continue;if(IGNORED_FILE_NAMES[_0x6c485e(0x19a)](_0x1ed2de[_0x6c485e(0x19b)]))continue;const _0x14fea2=resolve(_0x8812b6,_0x1ed2de[_0x6c485e(0x19b)]);if(isExcludedFilePath(_0x14fea2,_0x2ded90))continue;if(_0x1ed2de['isSymbolicLink']())throw CliErrors[_0x6c485e(0x198)]('Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20'+_0x14fea2);const _0x432950=toPosixPath(relative(_0x5949c3,_0x14fea2));if(_0x1ed2de[_0x6c485e(0x1a6)]()){_0xc6256(_0x14fea2);continue;}if(!_0x1ed2de[_0x6c485e(0x1a7)]())continue;validateSkillRelativePath(_0x432950);const _0x2f537a=readFileSync(_0x14fea2);_0x1974ac[_0x6c485e(0x1a1)]({'path':_0x432950,'bytes':_0x2f537a});}}return _0xc6256(_0x5949c3),normalizeLocalFiles(_0x1974ac);}function canonicalExcludedFilePaths(_0x281a63){const _0x1bdc2b=a137_0xa3a0,_0x1c6a8f=new Set();for(const _0x386999 of _0x281a63??[]){const _0x2a0b7c=resolve(_0x386999);_0x1c6a8f[_0x1bdc2b(0x1af)](_0x2a0b7c);try{_0x1c6a8f[_0x1bdc2b(0x1af)](realpathSync(_0x2a0b7c));}catch{}}return _0x1c6a8f;}function isExcludedFilePath(_0x27422c,_0x4d76b3){const _0x1bbdeb=a137_0xa3a0;if(_0x4d76b3[_0x1bbdeb(0x19a)](_0x27422c))return!![];if(_0x4d76b3[_0x1bbdeb(0x199)]===0x0)return![];try{return _0x4d76b3[_0x1bbdeb(0x19a)](realpathSync(_0x27422c));}catch{return![];}}export function compareSkillFiles(_0x50eb18,_0x4fdc28){const _0x3c843a=a137_0xa3a0;if(_0x50eb18[_0x3c843a(0x19c)]===SKILL_FILE)return _0x4fdc28[_0x3c843a(0x19c)]===SKILL_FILE?0x0:-0x1;if(_0x4fdc28[_0x3c843a(0x19c)]===SKILL_FILE)return 0x1;return Buffer['compare'](Buffer['from'](_0x50eb18[_0x3c843a(0x19c)],_0x3c843a(0x1ae)),Buffer['from'](_0x4fdc28[_0x3c843a(0x19c)],_0x3c843a(0x1ae)));}export function normalizeSkillRelativePath(_0x194ba1){const _0x276fcd=a137_0xa3a0,_0x235837=toPosixPath(_0x194ba1[_0x276fcd(0x1a3)]());return validateSkillRelativePath(_0x235837),_0x235837;}function a137_0x533e(){const _0x2cde64=['length','7649520aLXIgV','3062140nWWKii','bytes','values','utf8','add','isBuffer','259ZJSply','6040AbEKEj','3366CTYLjo','2268045zNCFjJ','8aMTtli','Skill\x20file\x20size\x20is\x20invalid:\x20','localeCompare','split','content','Skill\x20file\x20sha256\x20is\x20invalid:\x20','isArray','string','117920mdCFzV','Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20','Duplicate\x20Skill\x20file\x20path:\x20','1255374esoDxF','validation','size','has','name','path','set','Skill\x20file\x20path\x20must\x20be\x20text.','from','36434lqhQkp','push','includes','trim','excludedFilePaths','sha256','isDirectory','isFile','sort'];a137_0x533e=function(){return _0x2cde64;};return a137_0x533e();}export function validateSkillRelativePath(_0x1ee837){const _0x1ff26d=a137_0xa3a0;if(!_0x1ee837||_0x1ee837['startsWith']('/')||_0x1ee837[_0x1ff26d(0x1a2)]('//'))throw CliErrors['validation']('Unsafe\x20Skill\x20file\x20path:\x20'+_0x1ee837);for(const _0x184543 of _0x1ee837[_0x1ff26d(0x1b8)]('/')){if(!_0x184543||_0x184543==='.'||_0x184543==='..')throw CliErrors[_0x1ff26d(0x198)]('Unsafe\x20Skill\x20file\x20path:\x20'+_0x1ee837);}}export function toPosixPath(_0x1436f1){return _0x1436f1['replace'](/\\/g,'/');}export function isSha256Hex(_0x59c656){const _0x4c1fdd=a137_0xa3a0;return typeof _0x59c656===_0x4c1fdd(0x193)&&/^[a-fA-F0-9]{64}$/['test'](_0x59c656);}
@@ -1 +1 @@
1
- (function(_0x36f089,_0x2b523c){const _0x26cb93=a138_0xa0f9,_0x25f06f=_0x36f089();while(!![]){try{const _0x4dda50=parseInt(_0x26cb93(0x9f))/0x1*(-parseInt(_0x26cb93(0x84))/0x2)+parseInt(_0x26cb93(0x8b))/0x3+-parseInt(_0x26cb93(0x8f))/0x4*(parseInt(_0x26cb93(0xb5))/0x5)+parseInt(_0x26cb93(0x7e))/0x6*(parseInt(_0x26cb93(0x8e))/0x7)+parseInt(_0x26cb93(0x9e))/0x8+-parseInt(_0x26cb93(0x82))/0x9*(-parseInt(_0x26cb93(0xb3))/0xa)+-parseInt(_0x26cb93(0x8c))/0xb;if(_0x4dda50===_0x2b523c)break;else _0x25f06f['push'](_0x25f06f['shift']());}catch(_0x470dd6){_0x25f06f['push'](_0x25f06f['shift']());}}}(a138_0x44cb,0x812db));import{existsSync,lstatSync,mkdirSync,readFileSync,rmSync}from'node:fs';import{dirname,resolve}from'node:path';function a138_0x44cb(){const _0x1c84c2=['---\x0a','length','name','2436048IyPFNc','3hXFYfU','---','pulledAt','test','path','displayName','stringify','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','name:\x20','validation','find','utf8','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','\x0a---\x0a\x0a','.\x20Changed\x20file:\x20','example','skillName','map','fileHashes','packageBytes','640DiYPxl','delete','117295wCGTWz','replace','trim','version','scope','6PyHPxW','Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20','description','Runtime\x20Skill\x20package\x20is\x20missing\x20','100413yeqKXd','appCode','51406fkrAlY','slice','Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20','Managed\x20file\x20was\x20removed\x20locally:\x20','flow','skillCode','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','2705763IYqOpG','22654885PxQEBH','status','6038053pJUOQC','20tFacjW','isFile','has','displayName:\x20','contentHash','env','filter','keys','entries','join','errors','contents'];a138_0x44cb=function(){return _0x1c84c2;};return a138_0x44cb();}import{isCollection,isMap,isNode,parseDocument,visit}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{resolveManagedFilePath,writeBytesAtomic,writeJsonAtomic}from'./fs-utils.js';import{bufferSha256,contentHash,fileHash}from'./hashing.js';import{fileContent,fileText,normalizeLocalFiles}from'./local-files.js';import{buildMetadata,readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillDir}from'./paths.js';import{extractDownloadedPackage,requirePackageBytes}from'./zip-package.js';export function materializeRuntimeSkill(_0x433778,_0x430bf6,_0x3e7ef9){const _0x53b913=a138_0xa0f9,_0x33ef28=requireSkillCode(_0x433778),_0x51e11d=requirePackageBytes(_0x33ef28,_0x3e7ef9[_0x53b913(0xb2)]),_0x2bd6f6=extractDownloadedPackage(_0x51e11d),_0xd7c580=_0x2bd6f6[_0x53b913(0xa9)](_0x129a5=>_0x129a5[_0x53b913(0xa3)]===SKILL_FILE);if(!_0xd7c580)throw CliErrors['validation'](_0x53b913(0x81)+SKILL_FILE+':\x20'+_0x33ef28);const _0x229387=withMaterializedSkillFrontmatter(_0x2bd6f6,_0x433778,_0x33ef28),_0x14c972=_0x229387[_0x53b913(0xa9)](_0x53dabf=>_0x53dabf[_0x53b913(0xa3)]===SKILL_FILE),_0x39c824=fileText(_0x14c972),_0x34be8e=getRuntimeSkillDir(_0x3e7ef9[_0x53b913(0x94)],_0x3e7ef9['accessKey'],_0x3e7ef9[_0x53b913(0x83)],_0x430bf6,_0x33ef28,_0x3e7ef9['paths']),_0x50ff5f=resolve(_0x34be8e,SKILL_FILE),_0x144a6c=resolve(_0x34be8e,METADATA_FILE),_0x56c3a0=contentHash(_0x39c824),_0x867032=readMetadataIfPresent(_0x144a6c)?.[_0x53b913(0xb1)];ensurePulledFilesCanBeOverwritten(_0x34be8e,_0x144a6c,_0x229387,_0x3e7ef9['force']===!![]),mkdirSync(_0x34be8e,{'recursive':!![],'mode':0x1c0});const _0x3113cf=existsSync(_0x50ff5f)?readFileSync(_0x50ff5f,'utf8'):undefined;return materializeFiles(_0x34be8e,_0x229387),removeStaleManagedFiles(_0x34be8e,_0x867032,_0x229387),writeJsonAtomic(_0x144a6c,buildMetadata(_0x433778,_0x430bf6,_0x3e7ef9[_0x53b913(0x83)],_0x56c3a0,_0x3e7ef9[_0x53b913(0xa1)],_0x229387,_0x51e11d)),{'skill':_0x433778,'scope':_0x430bf6,'dir':_0x34be8e,'skillMdPath':_0x50ff5f,'metadataPath':_0x144a6c,'contentHash':_0x56c3a0,'changed':_0x3113cf!==_0x39c824};}export function reuseMaterializedRuntimeSkill(_0x257427,_0x349a49,_0x543b6b){const _0xe07244=a138_0xa0f9,_0x470d14=_0x257427[_0xe07244(0x7c)]?.[_0xe07244(0xb7)]();if(!_0x470d14)return undefined;const _0x3f6205=requireSkillCode(_0x257427),_0x5255f4=getRuntimeSkillDir(_0x543b6b['env'],_0x543b6b['accessKey'],_0x543b6b[_0xe07244(0x83)],_0x349a49,_0x3f6205,_0x543b6b['paths']),_0x450985=resolve(_0x5255f4,SKILL_FILE),_0x222bfd=resolve(_0x5255f4,METADATA_FILE),_0x3872f7=readMetadataIfPresent(_0x222bfd);if(!_0x3872f7||_0x3872f7['schemaVersion']!==0x2||_0x3872f7[_0xe07244(0x83)]!==_0x543b6b['appCode']||_0x3872f7[_0xe07244(0x7d)]!==_0x349a49||_0x3872f7[_0xe07244(0x89)]!==_0x3f6205||_0x3872f7['version']!==_0x470d14||_0x3872f7['id']!==_0x257427['id']||_0x3872f7[_0xe07244(0xaf)]!==_0x257427[_0xe07244(0xaf)]||_0x3872f7[_0xe07244(0x80)]!==_0x257427[_0xe07244(0x80)]||_0x3872f7[_0xe07244(0xae)]!==_0x257427['example']||_0x3872f7[_0xe07244(0x8d)]!==_0x257427[_0xe07244(0x8d)]||!_0x3872f7['contentHash']||!_0x3872f7[_0xe07244(0xb1)]||!Object['hasOwn'](_0x3872f7[_0xe07244(0xb1)],SKILL_FILE))return undefined;for(const [_0x1e142d,_0x11e144]of Object['entries'](_0x3872f7[_0xe07244(0xb1)])){if(!/^[a-f0-9]{64}$/[_0xe07244(0xa2)](_0x11e144))return undefined;const _0x3d9d05=resolveManagedFilePath(_0x5255f4,_0x1e142d);if(!existsSync(_0x3d9d05)||!lstatSync(_0x3d9d05)['isFile']())return undefined;if(bufferSha256(readFileSync(_0x3d9d05))!==_0x11e144)return undefined;}return{'skill':_0x257427,'scope':_0x349a49,'dir':_0x5255f4,'skillMdPath':_0x450985,'metadataPath':_0x222bfd,'contentHash':_0x3872f7[_0xe07244(0x93)],'changed':![]};}function withMaterializedSkillFrontmatter(_0x16add1,_0x17dd0b,_0x4d4aa0){const _0x4d3d78=a138_0xa0f9,_0x5c0958=skillDisplayName(_0x17dd0b,_0x4d4aa0),_0x4e253c=_0x17dd0b['description']?.['trim']()||_0x5c0958||_0x4d4aa0;return normalizeLocalFiles(_0x16add1)[_0x4d3d78(0xb0)](_0x5a83dc=>{const _0x2d0459=_0x4d3d78,_0x38cc81=fileText(_0x5a83dc);if(_0x5a83dc[_0x2d0459(0xa3)]!==SKILL_FILE)return _0x5a83dc;if(hasYamlFrontmatter(_0x38cc81))return{'path':_0x5a83dc['path'],'content':withSyncedDisplayName(_0x38cc81,_0x5c0958)};return{'path':_0x5a83dc[_0x2d0459(0xa3)],'content':prependSkillFrontmatter(_0x38cc81,{'name':_0x4d4aa0,'displayName':_0x5c0958,'description':_0x4e253c})};});}function hasYamlFrontmatter(_0x264ddd){const _0x302f51=a138_0xa0f9;return/^\uFEFF?---\s*\r?\n/[_0x302f51(0xa2)](_0x264ddd);}function prependSkillFrontmatter(_0x140fd6,_0x24902d){const _0x11c2f9=a138_0xa0f9,_0x19a154=_0x140fd6[_0x11c2f9(0xb6)](/^\uFEFF/,'');return[_0x11c2f9(0xa0),_0x11c2f9(0xa7)+yamlString(_0x24902d[_0x11c2f9(0x9d)]),_0x24902d[_0x11c2f9(0xa4)]?_0x11c2f9(0x92)+yamlString(_0x24902d['displayName']):undefined,'description:\x20'+yamlString(_0x24902d[_0x11c2f9(0x80)]),'---','',_0x19a154][_0x11c2f9(0x95)](_0x54d0ee=>_0x54d0ee!==undefined)[_0x11c2f9(0x98)]('\x0a');}function yamlString(_0x695202){const _0x2665c4=a138_0xa0f9;return JSON[_0x2665c4(0xa5)](_0x695202[_0x2665c4(0xb6)](/\r/g,'')[_0x2665c4(0xb7)]());}function a138_0xa0f9(_0x21c318,_0x50e49f){_0x21c318=_0x21c318-0x7c;const _0x44cb84=a138_0x44cb();let _0xa0f94b=_0x44cb84[_0x21c318];return _0xa0f94b;}function skillDisplayName(_0xbc1db3,_0x40a6c5){const _0x3b993e=a138_0xa0f9,_0x43f1d1=_0xbc1db3[_0x3b993e(0xaf)]?.[_0x3b993e(0xb7)]();return _0x43f1d1||_0x40a6c5;}function withSyncedDisplayName(_0x4c5021,_0x5cfe7c){const _0x1a13b0=a138_0xa0f9,_0x651f20=_0x4c5021['match'](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x651f20)return _0x4c5021;const _0x4bd9c3=_0x651f20[0x1]??'',_0x2cf9fc=_0x651f20[0x2]??'',_0x3d32a7=parseDocument(_0x2cf9fc);if(_0x3d32a7[_0x1a13b0(0x99)][_0x1a13b0(0x9c)]>0x0||!isMap(_0x3d32a7['contents']))return _0x4c5021;if(_0x5cfe7c)_0x3d32a7['set'](_0x1a13b0(0xa4),_0x5cfe7c);else{if(_0x3d32a7['has'](_0x1a13b0(0xa4)))_0x3d32a7[_0x1a13b0(0xb4)](_0x1a13b0(0xa4));else return _0x4c5021;}forceBlockCollections(_0x3d32a7[_0x1a13b0(0x9a)]);const _0x2f156e=_0x3d32a7['toString']({'lineWidth':0x0})['trimEnd'](),_0x1f3f58=_0x4c5021[_0x1a13b0(0x85)](_0x651f20[0x0][_0x1a13b0(0x9c)])['replace'](/^\r?\n/,'');return _0x4bd9c3+_0x1a13b0(0x9b)+_0x2f156e+_0x1a13b0(0xac)+_0x1f3f58;}function forceBlockCollections(_0xce7e3d){if(!isNode(_0xce7e3d))return;visit(_0xce7e3d,(_0x23e153,_0x5d5a39)=>{const _0x4bcf15=a138_0xa0f9;isCollection(_0x5d5a39)&&(_0x5d5a39[_0x4bcf15(0x88)]=![]);});}function ensurePulledFilesCanBeOverwritten(_0x2fd1ac,_0x139512,_0x143289,_0x5dc10a){const _0x16fc4b=a138_0xa0f9;if(_0x5dc10a||!existsSync(_0x139512))return;const _0x34577e=readMetadataIfPresent(_0x139512);if(!_0x34577e)return;const _0x3c515a=_0x34577e[_0x16fc4b(0xb1)]&&Object[_0x16fc4b(0x96)](_0x34577e[_0x16fc4b(0xb1)])[_0x16fc4b(0x9c)]>0x0?_0x34577e['fileHashes']:undefined;if(_0x3c515a)for(const [_0x72e35f,_0x360702]of Object[_0x16fc4b(0x97)](_0x3c515a)){const _0x45e840=resolveManagedFilePath(_0x2fd1ac,_0x72e35f);if(!existsSync(_0x45e840))throw CliErrors[_0x16fc4b(0xa8)](_0x16fc4b(0xab)+_0x2fd1ac,_0x16fc4b(0x87)+_0x72e35f);const _0x236e54=lstatSync(_0x45e840);if(!_0x236e54[_0x16fc4b(0x90)]())throw CliErrors['validation'](_0x16fc4b(0xab)+_0x2fd1ac,_0x16fc4b(0x7f)+_0x72e35f);const _0x23417f=bufferSha256(readFileSync(_0x45e840));if(_0x23417f!==_0x360702)throw CliErrors[_0x16fc4b(0xa8)](_0x16fc4b(0xab)+_0x2fd1ac+_0x16fc4b(0xad)+_0x72e35f,'Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20'+_0x72e35f);}else{const _0x7c6d77=resolve(_0x2fd1ac,SKILL_FILE);if(existsSync(_0x7c6d77)&&_0x34577e[_0x16fc4b(0x93)]){const _0x35edc3=contentHash(readFileSync(_0x7c6d77,_0x16fc4b(0xaa)));if(_0x35edc3!==_0x34577e[_0x16fc4b(0x93)])throw CliErrors[_0x16fc4b(0xa8)](_0x16fc4b(0x8a)+_0x7c6d77,'Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.');}}for(const _0x46f351 of normalizeLocalFiles(_0x143289)){if(_0x3c515a?.[_0x46f351[_0x16fc4b(0xa3)]])continue;if(!_0x3c515a&&_0x46f351[_0x16fc4b(0xa3)]===SKILL_FILE)continue;const _0x3bacf1=resolveManagedFilePath(_0x2fd1ac,_0x46f351[_0x16fc4b(0xa3)]);if(!existsSync(_0x3bacf1))continue;const _0x1d262d=lstatSync(_0x3bacf1);if(!_0x1d262d['isFile']())throw CliErrors[_0x16fc4b(0xa8)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x2fd1ac,_0x16fc4b(0xa6)+_0x46f351[_0x16fc4b(0xa3)]);const _0x31582e=bufferSha256(readFileSync(_0x3bacf1));if(_0x31582e!==fileHash(_0x46f351))throw CliErrors[_0x16fc4b(0xa8)](_0x16fc4b(0xab)+_0x2fd1ac,_0x16fc4b(0x86)+_0x46f351[_0x16fc4b(0xa3)]);}}function materializeFiles(_0xb73f0d,_0x455c98){const _0x5b6bb0=a138_0xa0f9;for(const _0x3caa20 of normalizeLocalFiles(_0x455c98)){const _0x171685=resolveManagedFilePath(_0xb73f0d,_0x3caa20[_0x5b6bb0(0xa3)]);mkdirSync(dirname(_0x171685),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x171685,fileContent(_0x3caa20),0x180);}}function removeStaleManagedFiles(_0x4472f2,_0x6b8354,_0x454305){const _0x59fe41=a138_0xa0f9;if(!_0x6b8354)return;const _0x5e70aa=new Set(normalizeLocalFiles(_0x454305)['map'](_0x3abc86=>_0x3abc86[_0x59fe41(0xa3)]));for(const _0x255f9c of Object['keys'](_0x6b8354)){if(_0x5e70aa[_0x59fe41(0x91)](_0x255f9c))continue;const _0x12003d=resolveManagedFilePath(_0x4472f2,_0x255f9c);existsSync(_0x12003d)&&lstatSync(_0x12003d)[_0x59fe41(0x90)]()&&rmSync(_0x12003d,{'force':!![]});}}
1
+ (function(_0xee12c4,_0x53e348){const _0x46ee8b=a138_0x17d0,_0x2aaf5b=_0xee12c4();while(!![]){try{const _0x3ffad7=-parseInt(_0x46ee8b(0x218))/0x1+parseInt(_0x46ee8b(0x20d))/0x2*(-parseInt(_0x46ee8b(0x1fe))/0x3)+parseInt(_0x46ee8b(0x208))/0x4*(-parseInt(_0x46ee8b(0x1f4))/0x5)+parseInt(_0x46ee8b(0x20e))/0x6*(parseInt(_0x46ee8b(0x1ec))/0x7)+parseInt(_0x46ee8b(0x1eb))/0x8+-parseInt(_0x46ee8b(0x210))/0x9+-parseInt(_0x46ee8b(0x201))/0xa*(-parseInt(_0x46ee8b(0x1ed))/0xb);if(_0x3ffad7===_0x53e348)break;else _0x2aaf5b['push'](_0x2aaf5b['shift']());}catch(_0x3aa7e4){_0x2aaf5b['push'](_0x2aaf5b['shift']());}}}(a138_0x26ec,0x1d53f));import{existsSync,lstatSync,mkdirSync,readFileSync,rmSync}from'node:fs';function a138_0x17d0(_0x36c0b1,_0x5d051e){_0x36c0b1=_0x36c0b1-0x1e3;const _0x26ec3c=a138_0x26ec();let _0x17d096=_0x26ec3c[_0x36c0b1];return _0x17d096;}import{dirname,resolve}from'node:path';function a138_0x26ec(){const _0x2daf78=['915WvIEcg','match','test','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20','description:\x20','length','flow','scope','keys','3LSzwNW','skillName','appCode','422780zFjVdb','contents','description','Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20','env','---\x0a','name','980GEQUCI','displayName','Runtime\x20Skill\x20package\x20is\x20missing\x20','entries','accessKey','201846CjpJmt','557958JZjSdV','version','1308024lFkXIK','name:\x20','stringify','---','displayName:\x20','delete','map','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.','39589OBPrqJ','validation','Managed\x20file\x20was\x20removed\x20locally:\x20','example','pulledAt','isFile','fileHashes','trim','packageBytes','hasOwn','status','force','765696VMnpQI','14bGJikk','44QeFnKm','replace','paths','path','contentHash','has','utf8'];a138_0x26ec=function(){return _0x2daf78;};return a138_0x26ec();}import{isCollection,isMap,isNode,parseDocument,visit}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{resolveManagedFilePath,writeBytesAtomic,writeJsonAtomic}from'./fs-utils.js';import{bufferSha256,contentHash,fileHash}from'./hashing.js';import{fileContent,fileText,normalizeLocalFiles}from'./local-files.js';import{buildMetadata,readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillDir}from'./paths.js';import{extractDownloadedPackage,requirePackageBytes}from'./zip-package.js';export function materializeRuntimeSkill(_0x24038d,_0x3ddff0,_0x236fe8){const _0x4651a7=a138_0x17d0,_0x836d68=requireSkillCode(_0x24038d),_0x24df3d=requirePackageBytes(_0x836d68,_0x236fe8[_0x4651a7(0x1e7)]),_0x4ad2f6=extractDownloadedPackage(_0x24df3d),_0x5df29b=_0x4ad2f6['find'](_0x10b3c8=>_0x10b3c8['path']===SKILL_FILE);if(!_0x5df29b)throw CliErrors['validation'](_0x4651a7(0x20a)+SKILL_FILE+':\x20'+_0x836d68);const _0x145d5c=withMaterializedSkillFrontmatter(_0x4ad2f6,_0x24038d,_0x836d68),_0x426ebe=_0x145d5c['find'](_0x135117=>_0x135117[_0x4651a7(0x1f0)]===SKILL_FILE),_0x56abe4=fileText(_0x426ebe),_0x362355=getRuntimeSkillDir(_0x236fe8['env'],_0x236fe8[_0x4651a7(0x20c)],_0x236fe8[_0x4651a7(0x200)],_0x3ddff0,_0x836d68,_0x236fe8['paths']),_0x148132=resolve(_0x362355,SKILL_FILE),_0x2a1bce=resolve(_0x362355,METADATA_FILE),_0x468a07=contentHash(_0x56abe4),_0x48830e=readMetadataIfPresent(_0x2a1bce)?.[_0x4651a7(0x1e5)];ensurePulledFilesCanBeOverwritten(_0x362355,_0x2a1bce,_0x145d5c,_0x236fe8[_0x4651a7(0x1ea)]===!![]),mkdirSync(_0x362355,{'recursive':!![],'mode':0x1c0});const _0x3f1c7d=existsSync(_0x148132)?readFileSync(_0x148132,_0x4651a7(0x1f3)):undefined;return materializeFiles(_0x362355,_0x145d5c),removeStaleManagedFiles(_0x362355,_0x48830e,_0x145d5c),writeJsonAtomic(_0x2a1bce,buildMetadata(_0x24038d,_0x3ddff0,_0x236fe8['appCode'],_0x468a07,_0x236fe8[_0x4651a7(0x1e3)],_0x145d5c,_0x24df3d)),{'skill':_0x24038d,'scope':_0x3ddff0,'dir':_0x362355,'skillMdPath':_0x148132,'metadataPath':_0x2a1bce,'contentHash':_0x468a07,'changed':_0x3f1c7d!==_0x56abe4};}export function reuseMaterializedRuntimeSkill(_0x36df8c,_0x1d9cfa,_0x3912a5){const _0xc3c801=a138_0x17d0,_0x5db37f=_0x36df8c[_0xc3c801(0x20f)]?.[_0xc3c801(0x1e6)]();if(!_0x5db37f)return undefined;const _0x366ae5=requireSkillCode(_0x36df8c),_0x5f0b89=getRuntimeSkillDir(_0x3912a5[_0xc3c801(0x205)],_0x3912a5['accessKey'],_0x3912a5[_0xc3c801(0x200)],_0x1d9cfa,_0x366ae5,_0x3912a5[_0xc3c801(0x1ef)]),_0x4e6cc0=resolve(_0x5f0b89,SKILL_FILE),_0x4696e5=resolve(_0x5f0b89,METADATA_FILE),_0x4ef220=readMetadataIfPresent(_0x4696e5);if(!_0x4ef220||_0x4ef220['schemaVersion']!==0x2||_0x4ef220[_0xc3c801(0x200)]!==_0x3912a5['appCode']||_0x4ef220[_0xc3c801(0x1fc)]!==_0x1d9cfa||_0x4ef220['skillCode']!==_0x366ae5||_0x4ef220[_0xc3c801(0x20f)]!==_0x5db37f||_0x4ef220['id']!==_0x36df8c['id']||_0x4ef220[_0xc3c801(0x1ff)]!==_0x36df8c[_0xc3c801(0x1ff)]||_0x4ef220[_0xc3c801(0x203)]!==_0x36df8c[_0xc3c801(0x203)]||_0x4ef220[_0xc3c801(0x21b)]!==_0x36df8c[_0xc3c801(0x21b)]||_0x4ef220[_0xc3c801(0x1e9)]!==_0x36df8c['status']||!_0x4ef220[_0xc3c801(0x1f1)]||!_0x4ef220[_0xc3c801(0x1e5)]||!Object[_0xc3c801(0x1e8)](_0x4ef220[_0xc3c801(0x1e5)],SKILL_FILE))return undefined;for(const [_0x55be89,_0x214d8b]of Object[_0xc3c801(0x20b)](_0x4ef220[_0xc3c801(0x1e5)])){if(!/^[a-f0-9]{64}$/[_0xc3c801(0x1f6)](_0x214d8b))return undefined;const _0x3b61eb=resolveManagedFilePath(_0x5f0b89,_0x55be89);if(!existsSync(_0x3b61eb)||!lstatSync(_0x3b61eb)[_0xc3c801(0x1e4)]())return undefined;if(bufferSha256(readFileSync(_0x3b61eb))!==_0x214d8b)return undefined;}return{'skill':_0x36df8c,'scope':_0x1d9cfa,'dir':_0x5f0b89,'skillMdPath':_0x4e6cc0,'metadataPath':_0x4696e5,'contentHash':_0x4ef220['contentHash'],'changed':![]};}function withMaterializedSkillFrontmatter(_0x30992c,_0x123f9c,_0x10022a){const _0x31b76f=a138_0x17d0,_0xc65d86=skillDisplayName(_0x123f9c,_0x10022a),_0x320513=_0x123f9c['description']?.[_0x31b76f(0x1e6)]()||_0xc65d86||_0x10022a;return normalizeLocalFiles(_0x30992c)[_0x31b76f(0x216)](_0x961888=>{const _0x383976=_0x31b76f,_0xa874ae=fileText(_0x961888);if(_0x961888[_0x383976(0x1f0)]!==SKILL_FILE)return _0x961888;if(hasYamlFrontmatter(_0xa874ae))return{'path':_0x961888[_0x383976(0x1f0)],'content':withSyncedDisplayName(_0xa874ae,_0xc65d86)};return{'path':_0x961888[_0x383976(0x1f0)],'content':prependSkillFrontmatter(_0xa874ae,{'name':_0x10022a,'displayName':_0xc65d86,'description':_0x320513})};});}function hasYamlFrontmatter(_0x174561){const _0x583821=a138_0x17d0;return/^\uFEFF?---\s*\r?\n/[_0x583821(0x1f6)](_0x174561);}function prependSkillFrontmatter(_0x5b571a,_0x52a93a){const _0x209fce=a138_0x17d0,_0x1236ce=_0x5b571a['replace'](/^\uFEFF/,'');return[_0x209fce(0x213),_0x209fce(0x211)+yamlString(_0x52a93a[_0x209fce(0x207)]),_0x52a93a[_0x209fce(0x209)]?_0x209fce(0x214)+yamlString(_0x52a93a[_0x209fce(0x209)]):undefined,_0x209fce(0x1f9)+yamlString(_0x52a93a['description']),_0x209fce(0x213),'',_0x1236ce]['filter'](_0x16059f=>_0x16059f!==undefined)['join']('\x0a');}function yamlString(_0x420f39){const _0x1c9098=a138_0x17d0;return JSON[_0x1c9098(0x212)](_0x420f39[_0x1c9098(0x1ee)](/\r/g,'')[_0x1c9098(0x1e6)]());}function skillDisplayName(_0x520287,_0x4648bc){const _0xcb1315=a138_0x17d0,_0x59f33f=_0x520287[_0xcb1315(0x1ff)]?.[_0xcb1315(0x1e6)]();return _0x59f33f||_0x4648bc;}function withSyncedDisplayName(_0x1033ef,_0xea8cad){const _0x21ee3a=a138_0x17d0,_0x352f7f=_0x1033ef[_0x21ee3a(0x1f5)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x352f7f)return _0x1033ef;const _0x3dcea3=_0x352f7f[0x1]??'',_0x219f80=_0x352f7f[0x2]??'',_0x141b01=parseDocument(_0x219f80);if(_0x141b01['errors'][_0x21ee3a(0x1fa)]>0x0||!isMap(_0x141b01[_0x21ee3a(0x202)]))return _0x1033ef;if(_0xea8cad)_0x141b01['set']('displayName',_0xea8cad);else{if(_0x141b01[_0x21ee3a(0x1f2)](_0x21ee3a(0x209)))_0x141b01[_0x21ee3a(0x215)]('displayName');else return _0x1033ef;}forceBlockCollections(_0x141b01[_0x21ee3a(0x202)]);const _0x352add=_0x141b01['toString']({'lineWidth':0x0})['trimEnd'](),_0x4042a1=_0x1033ef['slice'](_0x352f7f[0x0]['length'])[_0x21ee3a(0x1ee)](/^\r?\n/,'');return _0x3dcea3+_0x21ee3a(0x206)+_0x352add+'\x0a---\x0a\x0a'+_0x4042a1;}function forceBlockCollections(_0x384d4a){if(!isNode(_0x384d4a))return;visit(_0x384d4a,(_0x24020d,_0x5e0cdf)=>{const _0x1b8f03=a138_0x17d0;isCollection(_0x5e0cdf)&&(_0x5e0cdf[_0x1b8f03(0x1fb)]=![]);});}function ensurePulledFilesCanBeOverwritten(_0x22a05f,_0x37a123,_0x395be8,_0x229332){const _0x3a0f40=a138_0x17d0;if(_0x229332||!existsSync(_0x37a123))return;const _0xb41989=readMetadataIfPresent(_0x37a123);if(!_0xb41989)return;const _0x17cc58=_0xb41989['fileHashes']&&Object[_0x3a0f40(0x1fd)](_0xb41989[_0x3a0f40(0x1e5)])['length']>0x0?_0xb41989['fileHashes']:undefined;if(_0x17cc58)for(const [_0x3ab654,_0x3a9a5d]of Object[_0x3a0f40(0x20b)](_0x17cc58)){const _0x277a29=resolveManagedFilePath(_0x22a05f,_0x3ab654);if(!existsSync(_0x277a29))throw CliErrors['validation']('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x22a05f,_0x3a0f40(0x21a)+_0x3ab654);const _0x4c6bbc=lstatSync(_0x277a29);if(!_0x4c6bbc[_0x3a0f40(0x1e4)]())throw CliErrors[_0x3a0f40(0x219)](_0x3a0f40(0x1f7)+_0x22a05f,_0x3a0f40(0x204)+_0x3ab654);const _0x4ecbf8=bufferSha256(readFileSync(_0x277a29));if(_0x4ecbf8!==_0x3a9a5d)throw CliErrors[_0x3a0f40(0x219)](_0x3a0f40(0x1f7)+_0x22a05f+'.\x20Changed\x20file:\x20'+_0x3ab654,'Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20'+_0x3ab654);}else{const _0x3210d3=resolve(_0x22a05f,SKILL_FILE);if(existsSync(_0x3210d3)&&_0xb41989[_0x3a0f40(0x1f1)]){const _0x15ef2f=contentHash(readFileSync(_0x3210d3,_0x3a0f40(0x1f3)));if(_0x15ef2f!==_0xb41989['contentHash'])throw CliErrors[_0x3a0f40(0x219)]('Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20'+_0x3210d3,_0x3a0f40(0x217));}}for(const _0x32be87 of normalizeLocalFiles(_0x395be8)){if(_0x17cc58?.[_0x32be87[_0x3a0f40(0x1f0)]])continue;if(!_0x17cc58&&_0x32be87[_0x3a0f40(0x1f0)]===SKILL_FILE)continue;const _0x178f21=resolveManagedFilePath(_0x22a05f,_0x32be87[_0x3a0f40(0x1f0)]);if(!existsSync(_0x178f21))continue;const _0x4042f4=lstatSync(_0x178f21);if(!_0x4042f4[_0x3a0f40(0x1e4)]())throw CliErrors[_0x3a0f40(0x219)](_0x3a0f40(0x1f7)+_0x22a05f,'Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20'+_0x32be87[_0x3a0f40(0x1f0)]);const _0x19fbd6=bufferSha256(readFileSync(_0x178f21));if(_0x19fbd6!==fileHash(_0x32be87))throw CliErrors['validation']('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x22a05f,_0x3a0f40(0x1f8)+_0x32be87[_0x3a0f40(0x1f0)]);}}function materializeFiles(_0x2a8c64,_0x28b291){const _0x42be37=a138_0x17d0;for(const _0x55d599 of normalizeLocalFiles(_0x28b291)){const _0xf19e24=resolveManagedFilePath(_0x2a8c64,_0x55d599[_0x42be37(0x1f0)]);mkdirSync(dirname(_0xf19e24),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0xf19e24,fileContent(_0x55d599),0x180);}}function removeStaleManagedFiles(_0x42ad88,_0x50185f,_0x51a120){const _0x1a2767=a138_0x17d0;if(!_0x50185f)return;const _0x5b2d09=new Set(normalizeLocalFiles(_0x51a120)[_0x1a2767(0x216)](_0x423403=>_0x423403[_0x1a2767(0x1f0)]));for(const _0x47fee4 of Object[_0x1a2767(0x1fd)](_0x50185f)){if(_0x5b2d09[_0x1a2767(0x1f2)](_0x47fee4))continue;const _0x4fa37c=resolveManagedFilePath(_0x42ad88,_0x47fee4);existsSync(_0x4fa37c)&&lstatSync(_0x4fa37c)[_0x1a2767(0x1e4)]()&&rmSync(_0x4fa37c,{'force':!![]});}}
@@ -1 +1 @@
1
- (function(_0x42ee0e,_0x558851){const _0x51630a=a139_0x5d96,_0x2b732a=_0x42ee0e();while(!![]){try{const _0x5e043f=parseInt(_0x51630a(0x14b))/0x1*(parseInt(_0x51630a(0x167))/0x2)+-parseInt(_0x51630a(0x166))/0x3+-parseInt(_0x51630a(0x15a))/0x4+parseInt(_0x51630a(0x140))/0x5*(parseInt(_0x51630a(0x161))/0x6)+parseInt(_0x51630a(0x14a))/0x7*(-parseInt(_0x51630a(0x15e))/0x8)+-parseInt(_0x51630a(0x146))/0x9*(parseInt(_0x51630a(0x15c))/0xa)+parseInt(_0x51630a(0x149))/0xb*(parseInt(_0x51630a(0x163))/0xc);if(_0x5e043f===_0x558851)break;else _0x2b732a['push'](_0x2b732a['shift']());}catch(_0x39d30a){_0x2b732a['push'](_0x2b732a['shift']());}}}(a139_0x4df9,0xb5aac));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(_0x35f3e2,_0x1f91bc,_0x3e76b9,_0x1838e2,_0x46af67,_0x482d3d,_0x1d7371){const _0xd3b0ac=a139_0x5d96,_0xae5264=_0x482d3d?normalizeLocalFiles(_0x482d3d):[],_0x429901=!_0x1d7371&&_0xae5264['length']>0x0?buildSkillPackage(_0xae5264):undefined,_0x3ba8ab=_0x1d7371?bufferSha256(_0x1d7371):_0x429901?.[_0xd3b0ac(0x141)][_0xd3b0ac(0x154)],_0xcf5ed1=_0x1d7371?.[_0xd3b0ac(0x165)]??_0x429901?.[_0xd3b0ac(0x141)][_0xd3b0ac(0x152)],_0x53a43b=_0xae5264[_0xd3b0ac(0x165)]>0x0?Object[_0xd3b0ac(0x151)](_0xae5264[_0xd3b0ac(0x142)](_0x270a02=>[_0x270a02[_0xd3b0ac(0x144)],fileHash(_0x270a02)])):undefined;return{'schemaVersion':_0xae5264[_0xd3b0ac(0x165)]>0x0?0x2:0x1,'id':_0x35f3e2['id'],'appCode':_0x3e76b9,'skillCode':requireSkillCode(_0x35f3e2),'skillName':_0x35f3e2[_0xd3b0ac(0x159)],'description':_0x35f3e2[_0xd3b0ac(0x168)],'example':_0x35f3e2[_0xd3b0ac(0x158)],'scope':_0x1f91bc,'readonly':_0x1f91bc!==_0xd3b0ac(0x14d)||_0x35f3e2[_0xd3b0ac(0x148)]===!![],'tenantCode':_0x35f3e2[_0xd3b0ac(0x153)],'userId':_0x35f3e2[_0xd3b0ac(0x145)],'version':_0x35f3e2[_0xd3b0ac(0x15d)],'status':_0x35f3e2[_0xd3b0ac(0x14c)],'tags':Array[_0xd3b0ac(0x143)](_0x35f3e2[_0xd3b0ac(0x15b)])?_0x35f3e2[_0xd3b0ac(0x15b)]:[],'hasUpstreamUpdate':_0x35f3e2['hasUpstreamUpdate'],'forkedFromSkillId':_0x35f3e2[_0xd3b0ac(0x14f)],'forkedFromVersion':_0x35f3e2['forkedFromVersion'],'sourceSessionId':_0x35f3e2[_0xd3b0ac(0x169)],'contentHash':_0x1838e2,'fileHashes':_0x53a43b,'treeHash':_0xae5264[_0xd3b0ac(0x165)]>0x0?fileTreeHash(localFilesToManifestFiles(_0xae5264)):undefined,'ossPath':remoteManifestOssPath(_0x35f3e2[_0xd3b0ac(0x16a)]),'zipSha256':_0x3ba8ab,'zipSize':_0xcf5ed1,'files':_0xae5264[_0xd3b0ac(0x165)]>0x0?_0xae5264['map'](_0x15c2d4=>({'path':_0x15c2d4['path'],'hash':fileHash(_0x15c2d4),'size':fileContent(_0x15c2d4)[_0xd3b0ac(0x165)]})):undefined,'pulledAt':_0x46af67??new Date()['toISOString']()};}export function requireSkillCode(_0x4e5a4a){const _0x59c44c=a139_0x5d96,_0x491614=_0x4e5a4a[_0x59c44c(0x15f)]?.[_0x59c44c(0x156)]();if(!_0x491614)throw CliErrors[_0x59c44c(0x157)](_0x59c44c(0x160));return _0x491614;}function a139_0x4df9(){const _0x425e87=['files','10jyJhNa','manifest','map','isArray','path','userId','9944298cDlcKS','ossPath','readonly','213037olllBZ','52633OfKLTP','2nndVih','status','personal','object','forkedFromSkillId','parse','fromEntries','zipSize','tenantCode','zipSha256','Invalid\x20','trim','validation','example','skillName','2495288QZXuwm','tags','10SlBdPk','version','952QpSVDH','skillCode','Runtime\x20Skill\x20is\x20missing\x20skillCode.','521544kwSXcG','utf8','1788PeuDPD','string','length','2552892tupfTH','1159046VZPzUY','description','sourceSessionId'];a139_0x4df9=function(){return _0x425e87;};return a139_0x4df9();}function a139_0x5d96(_0x52ab79,_0x720b29){_0x52ab79=_0x52ab79-0x140;const _0x4df9af=a139_0x4df9();let _0x5d96b9=_0x4df9af[_0x52ab79];return _0x5d96b9;}export function readMetadataIfPresent(_0x5e235d){const _0xa07f0e=a139_0x5d96;if(!existsSync(_0x5e235d))return undefined;try{const _0x5509f6=JSON[_0xa07f0e(0x150)](readFileSync(_0x5e235d,_0xa07f0e(0x162)));return _0x5509f6;}catch{throw CliErrors[_0xa07f0e(0x157)](_0xa07f0e(0x155)+METADATA_FILE+':\x20'+_0x5e235d);}}function remoteManifestOssPath(_0x50b952){const _0x375e74=a139_0x5d96;if(!_0x50b952||typeof _0x50b952!==_0x375e74(0x14e)||Array[_0x375e74(0x143)](_0x50b952))return undefined;const _0x35420c=_0x50b952[_0x375e74(0x147)];return typeof _0x35420c===_0x375e74(0x164)&&_0x35420c[_0x375e74(0x156)]()?_0x35420c[_0x375e74(0x156)]():undefined;}
1
+ (function(_0x4ba630,_0x8c7eb9){const _0x26bee0=a139_0x31d6,_0x4b10a1=_0x4ba630();while(!![]){try{const _0x3d2096=parseInt(_0x26bee0(0x15f))/0x1+parseInt(_0x26bee0(0x17a))/0x2+-parseInt(_0x26bee0(0x155))/0x3+parseInt(_0x26bee0(0x168))/0x4*(parseInt(_0x26bee0(0x15e))/0x5)+parseInt(_0x26bee0(0x15d))/0x6*(-parseInt(_0x26bee0(0x179))/0x7)+parseInt(_0x26bee0(0x15a))/0x8*(parseInt(_0x26bee0(0x16e))/0x9)+parseInt(_0x26bee0(0x175))/0xa*(-parseInt(_0x26bee0(0x16f))/0xb);if(_0x3d2096===_0x8c7eb9)break;else _0x4b10a1['push'](_0x4b10a1['shift']());}catch(_0x1102ad){_0x4b10a1['push'](_0x4b10a1['shift']());}}}(a139_0x41a5,0x6748b));import{existsSync,readFileSync}from'node:fs';import{CliErrors}from'../../errors.js';function a139_0x31d6(_0x170722,_0xdb1f75){_0x170722=_0x170722-0x155;const _0x41a5cc=a139_0x41a5();let _0x31d63e=_0x41a5cc[_0x170722];return _0x31d63e;}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(_0x5cca6f,_0x5f3b06,_0x5aaf72,_0x4f86c5,_0x4dcae3,_0x17e231,_0x2c792b){const _0x377d9c=a139_0x31d6,_0x54924b=_0x17e231?normalizeLocalFiles(_0x17e231):[],_0x28a523=!_0x2c792b&&_0x54924b[_0x377d9c(0x174)]>0x0?buildSkillPackage(_0x54924b):undefined,_0x109eff=_0x2c792b?bufferSha256(_0x2c792b):_0x28a523?.[_0x377d9c(0x166)]['zipSha256'],_0x375d33=_0x2c792b?.[_0x377d9c(0x174)]??_0x28a523?.[_0x377d9c(0x166)][_0x377d9c(0x177)],_0x283b04=_0x54924b[_0x377d9c(0x174)]>0x0?Object['fromEntries'](_0x54924b['map'](_0x3580ab=>[_0x3580ab['path'],fileHash(_0x3580ab)])):undefined;return{'schemaVersion':_0x54924b[_0x377d9c(0x174)]>0x0?0x2:0x1,'id':_0x5cca6f['id'],'appCode':_0x5aaf72,'skillCode':requireSkillCode(_0x5cca6f),'skillName':_0x5cca6f[_0x377d9c(0x16b)],'description':_0x5cca6f['description'],'example':_0x5cca6f[_0x377d9c(0x178)],'scope':_0x5f3b06,'readonly':_0x5f3b06!=='personal'||_0x5cca6f[_0x377d9c(0x162)]===!![],'tenantCode':_0x5cca6f[_0x377d9c(0x176)],'userId':_0x5cca6f[_0x377d9c(0x157)],'version':_0x5cca6f['version'],'status':_0x5cca6f[_0x377d9c(0x172)],'tags':Array[_0x377d9c(0x160)](_0x5cca6f[_0x377d9c(0x165)])?_0x5cca6f[_0x377d9c(0x165)]:[],'hasUpstreamUpdate':_0x5cca6f[_0x377d9c(0x163)],'forkedFromSkillId':_0x5cca6f[_0x377d9c(0x164)],'forkedFromVersion':_0x5cca6f[_0x377d9c(0x167)],'sourceSessionId':_0x5cca6f['sourceSessionId'],'contentHash':_0x4f86c5,'fileHashes':_0x283b04,'treeHash':_0x54924b['length']>0x0?fileTreeHash(localFilesToManifestFiles(_0x54924b)):undefined,'ossPath':remoteManifestOssPath(_0x5cca6f[_0x377d9c(0x171)]),'zipSha256':_0x109eff,'zipSize':_0x375d33,'files':_0x54924b[_0x377d9c(0x174)]>0x0?_0x54924b[_0x377d9c(0x169)](_0x440fe5=>({'path':_0x440fe5[_0x377d9c(0x15c)],'hash':fileHash(_0x440fe5),'size':fileContent(_0x440fe5)[_0x377d9c(0x174)]})):undefined,'pulledAt':_0x4dcae3??new Date()[_0x377d9c(0x16d)]()};}export function requireSkillCode(_0x397e54){const _0x296dce=a139_0x31d6,_0x153740=_0x397e54[_0x296dce(0x16c)]?.[_0x296dce(0x156)]();if(!_0x153740)throw CliErrors[_0x296dce(0x170)](_0x296dce(0x173));return _0x153740;}export function readMetadataIfPresent(_0x5a96e7){const _0x2e73d7=a139_0x31d6;if(!existsSync(_0x5a96e7))return undefined;try{const _0x1dc014=JSON[_0x2e73d7(0x15b)](readFileSync(_0x5a96e7,_0x2e73d7(0x159)));return _0x1dc014;}catch{throw CliErrors[_0x2e73d7(0x170)]('Invalid\x20'+METADATA_FILE+':\x20'+_0x5a96e7);}}function a139_0x41a5(){const _0x27350b=['Runtime\x20Skill\x20is\x20missing\x20skillCode.','length','630GnxmGg','tenantCode','zipSize','example','5577810zACyXy','585750YBvPox','884067RqXEPS','trim','userId','ossPath','utf8','8GxAkrH','parse','path','6xwlGtM','10UnMCvi','397970LkKEpN','isArray','string','readonly','hasUpstreamUpdate','forkedFromSkillId','tags','manifest','forkedFromVersion','1085608DZNLrJ','map','object','skillName','skillCode','toISOString','4109652NJKxMh','30679VUzpdH','validation','files','status'];a139_0x41a5=function(){return _0x27350b;};return a139_0x41a5();}function remoteManifestOssPath(_0x977291){const _0x531d3b=a139_0x31d6;if(!_0x977291||typeof _0x977291!==_0x531d3b(0x16a)||Array[_0x531d3b(0x160)](_0x977291))return undefined;const _0x47ab4b=_0x977291[_0x531d3b(0x158)];return typeof _0x47ab4b===_0x531d3b(0x161)&&_0x47ab4b[_0x531d3b(0x156)]()?_0x47ab4b[_0x531d3b(0x156)]():undefined;}
@@ -1 +1 @@
1
- const a140_0x438480=a140_0x599f;(function(_0x8ec66,_0x3b9bf1){const _0x46da64=a140_0x599f,_0x16a877=_0x8ec66();while(!![]){try{const _0x1762a2=-parseInt(_0x46da64(0x1ad))/0x1+-parseInt(_0x46da64(0x1a5))/0x2*(-parseInt(_0x46da64(0x1b6))/0x3)+-parseInt(_0x46da64(0x1ab))/0x4+parseInt(_0x46da64(0x1a7))/0x5*(parseInt(_0x46da64(0x19e))/0x6)+parseInt(_0x46da64(0x1b2))/0x7*(parseInt(_0x46da64(0x1a6))/0x8)+-parseInt(_0x46da64(0x1a1))/0x9*(-parseInt(_0x46da64(0x1a3))/0xa)+-parseInt(_0x46da64(0x1ae))/0xb;if(_0x1762a2===_0x3b9bf1)break;else _0x16a877['push'](_0x16a877['shift']());}catch(_0x492353){_0x16a877['push'](_0x16a877['shift']());}}}(a140_0x1643,0x53ced));import{existsSync}from'node:fs';import{homedir}from'node:os';import{resolve}from'node:path';import{fingerprintAccessKey}from'../../commands/app/cache.js';import{PRODUCT_CONFIG,productEnv}from'../../constant/product.js';import{CliErrors}from'../../errors.js';export function resolveSkillSyncPaths(_0x59ccf8={}){const _0x461f3a=a140_0x599f,_0x30c0be=_0x59ccf8[_0x461f3a(0x19b)]??homedir(),_0x4fbad9=resolve(_0x30c0be,PRODUCT_CONFIG[_0x461f3a(0x1ac)],_0x461f3a(0x1b9)),_0x82a3e7=trimmedEnv(_0x461f3a(0x1a9)),_0x28a7b4=trimmedEnv(_0x461f3a(0x1b1)),_0x16ee2d=resolve(_0x30c0be,_0x461f3a(0x1b5)),_0x494e2c=_0x59ccf8['workbuddySkillsDir']??(existsSync(_0x16ee2d)?resolve(_0x16ee2d,_0x461f3a(0x19c)):undefined);return{'homeDir':_0x30c0be,'cacheRoot':_0x4fbad9,'managedRoot':resolve(_0x30c0be,PRODUCT_CONFIG[_0x461f3a(0x1ac)]),'agentsSkillsDir':_0x59ccf8[_0x461f3a(0x1b3)]??_0x82a3e7??resolve(_0x30c0be,'.agents',_0x461f3a(0x19c)),'claudeSkillsDir':_0x59ccf8[_0x461f3a(0x19f)]??_0x28a7b4??resolve(_0x30c0be,_0x461f3a(0x1a0),_0x461f3a(0x19c)),'workbuddySkillsDir':_0x494e2c};}export function runtimeAgentSkillRoots(_0x579802){const _0x1cc8ec=a140_0x599f;return[_0x579802['agentsSkillsDir'],_0x579802[_0x1cc8ec(0x19f)],_0x579802[_0x1cc8ec(0x1b4)]][_0x1cc8ec(0x1b7)](_0x348c41=>Boolean(_0x348c41));}export function getRuntimeSkillCacheRoot(_0x3feb00,_0x2f93e2,_0x4e3832={}){const _0x1e1208=a140_0x599f,_0x541ca8=resolveSkillSyncPaths(_0x4e3832);return resolve(_0x541ca8[_0x1e1208(0x1af)],_0x3feb00,fingerprintAccessKey(_0x2f93e2),_0x1e1208(0x19c));}export function getRuntimeSkillDir(_0x3cf054,_0x515883,_0x2d630f,_0x556995,_0x550e78,_0x4dccb9={}){const _0xe572b3=a140_0x599f;return resolve(getRuntimeSkillCacheRoot(_0x3cf054,_0x515883,_0x4dccb9),safePathSegment(_0x2d630f,_0xe572b3(0x1aa)),_0x556995,safePathSegment(_0x550e78,_0xe572b3(0x19d)));}export function safePathSegment(_0x50398b,_0x1d003e=a140_0x438480(0x19a)){const _0x26a6e1=a140_0x438480;if(!_0x50398b||_0x50398b[_0x26a6e1(0x1a2)]('/')||_0x50398b[_0x26a6e1(0x1a2)]('\x5c')||_0x50398b[_0x26a6e1(0x1a2)]('..'))throw CliErrors[_0x26a6e1(0x1a8)](_0x26a6e1(0x1b0)+_0x1d003e+_0x26a6e1(0x1a4)+_0x50398b);return _0x50398b;}function a140_0x599f(_0x5df4b8,_0x35095e){_0x5df4b8=_0x5df4b8-0x19a;const _0x164339=a140_0x1643();let _0x599fc3=_0x164339[_0x5df4b8];return _0x599fc3;}function a140_0x1643(){const _0x27c43d=['homeDirName','610931iIsKBs','6810727ANHsug','cacheRoot','Unsafe\x20','CLAUDE_SKILL_ROOT','3577UxPbAh','agentsSkillsDir','workbuddySkillsDir','.workbuddy','66TxboJu','filter','trim','cache','path\x20segment','homeDir','skills','skillCode','6HJIoej','claudeSkillsDir','.claude','12501HmzBAJ','includes','4030vuFGkg','\x20for\x20local\x20path:\x20','28218ikckVi','9584JaXdeg','1578545lDBbhP','validation','SKILL_ROOT','appCode','898748SAkxAE'];a140_0x1643=function(){return _0x27c43d;};return a140_0x1643();}function trimmedEnv(_0x35a319){const _0x14f52=a140_0x438480,_0x3aeb05=productEnv(_0x35a319)?.[_0x14f52(0x1b8)]();return _0x3aeb05?_0x3aeb05:undefined;}
1
+ (function(_0x196022,_0x19b4d5){const _0x1056ab=a140_0x12ca,_0x1b5790=_0x196022();while(!![]){try{const _0x488724=parseInt(_0x1056ab(0xe0))/0x1+-parseInt(_0x1056ab(0xe1))/0x2*(parseInt(_0x1056ab(0xd8))/0x3)+-parseInt(_0x1056ab(0xce))/0x4*(parseInt(_0x1056ab(0xd4))/0x5)+parseInt(_0x1056ab(0xcf))/0x6*(-parseInt(_0x1056ab(0xe9))/0x7)+-parseInt(_0x1056ab(0xda))/0x8+-parseInt(_0x1056ab(0xd0))/0x9*(-parseInt(_0x1056ab(0xd3))/0xa)+parseInt(_0x1056ab(0xdc))/0xb;if(_0x488724===_0x19b4d5)break;else _0x1b5790['push'](_0x1b5790['shift']());}catch(_0x35b698){_0x1b5790['push'](_0x1b5790['shift']());}}}(a140_0x347d,0x416b8));function a140_0x347d(){const _0x2d9d5e=['.agents','1420290TAYPcD','65fTcwXh','skillCode','SKILL_ROOT','homeDirName','6uzKWzZ','CLAUDE_SKILL_ROOT','2848008CUrgem','.workbuddy','11924308sjaFsu','claudeSkillsDir','agentsSkillsDir','includes','87318wpjiRc','217102enJGxH','validation','Unsafe\x20','cache','skills','homeDir','workbuddySkillsDir','cacheRoot','7hlQVzS','71356QmfeXY','3146778PjRnFm','27iwLGCY','appCode'];a140_0x347d=function(){return _0x2d9d5e;};return a140_0x347d();}import{existsSync}from'node:fs';import{homedir}from'node:os';import{resolve}from'node:path';import{fingerprintAccessKey}from'../../commands/app/cache.js';import{PRODUCT_CONFIG,productEnv}from'../../constant/product.js';import{CliErrors}from'../../errors.js';export function resolveSkillSyncPaths(_0x399f44={}){const _0x517978=a140_0x12ca,_0x17e10d=_0x399f44[_0x517978(0xe6)]??homedir(),_0x531e99=resolve(_0x17e10d,PRODUCT_CONFIG[_0x517978(0xd7)],_0x517978(0xe4)),_0xdbcefa=trimmedEnv(_0x517978(0xd6)),_0x55e15f=trimmedEnv(_0x517978(0xd9)),_0x5a91fc=resolve(_0x17e10d,_0x517978(0xdb)),_0x55a411=_0x399f44[_0x517978(0xe7)]??(existsSync(_0x5a91fc)?resolve(_0x5a91fc,_0x517978(0xe5)):undefined);return{'homeDir':_0x17e10d,'cacheRoot':_0x531e99,'managedRoot':resolve(_0x17e10d,PRODUCT_CONFIG['homeDirName']),'agentsSkillsDir':_0x399f44[_0x517978(0xde)]??_0xdbcefa??resolve(_0x17e10d,_0x517978(0xd2),'skills'),'claudeSkillsDir':_0x399f44[_0x517978(0xdd)]??_0x55e15f??resolve(_0x17e10d,'.claude','skills'),'workbuddySkillsDir':_0x55a411};}export function runtimeAgentSkillRoots(_0x1e0bc0){const _0x3bd9a7=a140_0x12ca;return[_0x1e0bc0[_0x3bd9a7(0xde)],_0x1e0bc0[_0x3bd9a7(0xdd)],_0x1e0bc0[_0x3bd9a7(0xe7)]]['filter'](_0x3bda15=>Boolean(_0x3bda15));}export function getRuntimeSkillCacheRoot(_0x2d00f5,_0x109764,_0x1fc72e={}){const _0x1004b0=a140_0x12ca,_0x336703=resolveSkillSyncPaths(_0x1fc72e);return resolve(_0x336703[_0x1004b0(0xe8)],_0x2d00f5,fingerprintAccessKey(_0x109764),'skills');}function a140_0x12ca(_0x1fb05a,_0x6bd572){_0x1fb05a=_0x1fb05a-0xce;const _0x347d14=a140_0x347d();let _0x12ca69=_0x347d14[_0x1fb05a];return _0x12ca69;}export function getRuntimeSkillDir(_0x58e9fc,_0x56105c,_0x77a4e6,_0x3e7cea,_0x8f8abb,_0x5818e6={}){const _0x43ebd9=a140_0x12ca;return resolve(getRuntimeSkillCacheRoot(_0x58e9fc,_0x56105c,_0x5818e6),safePathSegment(_0x77a4e6,_0x43ebd9(0xd1)),_0x3e7cea,safePathSegment(_0x8f8abb,_0x43ebd9(0xd5)));}export function safePathSegment(_0x3975c1,_0x1bd0b4='path\x20segment'){const _0x240c6b=a140_0x12ca;if(!_0x3975c1||_0x3975c1[_0x240c6b(0xdf)]('/')||_0x3975c1['includes']('\x5c')||_0x3975c1[_0x240c6b(0xdf)]('..'))throw CliErrors[_0x240c6b(0xe2)](_0x240c6b(0xe3)+_0x1bd0b4+'\x20for\x20local\x20path:\x20'+_0x3975c1);return _0x3975c1;}function trimmedEnv(_0x321ffd){const _0x2b2b06=productEnv(_0x321ffd)?.['trim']();return _0x2b2b06?_0x2b2b06:undefined;}
@@ -1 +1 @@
1
- (function(_0x4a716c,_0x9ab9cf){const _0x39e47a=a141_0x37e7,_0x134051=_0x4a716c();while(!![]){try{const _0x219ff1=-parseInt(_0x39e47a(0x17f))/0x1*(parseInt(_0x39e47a(0x155))/0x2)+-parseInt(_0x39e47a(0x142))/0x3+parseInt(_0x39e47a(0x169))/0x4*(parseInt(_0x39e47a(0x151))/0x5)+parseInt(_0x39e47a(0x167))/0x6*(-parseInt(_0x39e47a(0x172))/0x7)+parseInt(_0x39e47a(0x183))/0x8*(parseInt(_0x39e47a(0x178))/0x9)+-parseInt(_0x39e47a(0x154))/0xa*(-parseInt(_0x39e47a(0x15b))/0xb)+parseInt(_0x39e47a(0x14b))/0xc;if(_0x219ff1===_0x9ab9cf)break;else _0x134051['push'](_0x134051['shift']());}catch(_0x22f5ec){_0x134051['push'](_0x134051['shift']());}}}(a141_0xcd98,0x4f328));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a141_0x35be4c}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{writeJsonAtomic}from'./fs-utils.js';import{contentHash}from'./hashing.js';import{fileText,normalizeLocalFiles,scanSkillDirectory}from'./local-files.js';import{buildMetadata,readMetadataIfPresent}from'./metadata.js';import{buildSkillPackage,tryNormalizePackageManifest}from'./zip-package.js';export function resolvePushDirectoryIdentity(_0x28ff47,_0x50f1fa,_0x38ee66={}){const _0x1a2038=a141_0x37e7,_0x225db1=resolvePushDirectoryRoot(_0x28ff47),_0x29c18e=readPushMetadataIfPresent(resolve(_0x225db1,METADATA_FILE),{'ignoreInvalidMetadata':_0x38ee66[_0x1a2038(0x145)]});if(_0x29c18e?.['appCode']&&_0x29c18e[_0x1a2038(0x14f)]!==_0x50f1fa&&!_0x38ee66[_0x1a2038(0x141)]&&!_0x38ee66[_0x1a2038(0x143)])throw CliErrors[_0x1a2038(0x16c)](_0x1a2038(0x15f)+_0x29c18e['appCode']+'\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22'+_0x50f1fa+'\x22.');const _0x55ca11=resolvePushSkillCode(_0x225db1,_0x50f1fa,_0x29c18e,_0x38ee66);if(!_0x55ca11)throw CliErrors[_0x1a2038(0x16c)](_0x1a2038(0x165)+SKILL_FILE+',\x20'+METADATA_FILE+_0x1a2038(0x171));return{'dir':_0x225db1,'skillCode':_0x55ca11,'metadata':_0x29c18e};}export function readPushDirectory(_0x1994f9,_0x7fc433,_0x11e770={}){const _0x4c2b05=a141_0x37e7,_0x5178d5=resolvePushDirectoryIdentity(_0x1994f9,_0x7fc433,_0x11e770),_0x1e17f7=_0x5178d5[_0x4c2b05(0x166)],_0x3a89b7=resolve(_0x1e17f7,SKILL_FILE);if(!existsSync(_0x3a89b7)||!lstatSync(_0x3a89b7)[_0x4c2b05(0x14d)]())throw CliErrors[_0x4c2b05(0x16c)](_0x4c2b05(0x149)+SKILL_FILE+':\x20'+_0x3a89b7);const _0x45307b=_0x5178d5[_0x4c2b05(0x17d)],_0x11bfe8=_0x11e770[_0x4c2b05(0x13d)]??_0x4c2b05(0x17e);if(!_0x11e770['ignoreMetadataScope']&&_0x45307b?.[_0x4c2b05(0x181)]===_0x4c2b05(0x174))throw CliErrors[_0x4c2b05(0x16c)](_0x4c2b05(0x159)+METADATA_FILE+_0x4c2b05(0x17c)+_0x45307b[_0x4c2b05(0x181)]+'\x22.');if(!_0x11e770[_0x4c2b05(0x152)]&&_0x11bfe8==='personal'&&_0x45307b?.['scope']&&_0x45307b[_0x4c2b05(0x181)]!=='personal')throw CliErrors[_0x4c2b05(0x16c)](_0x4c2b05(0x176)+METADATA_FILE+_0x4c2b05(0x17c)+_0x45307b[_0x4c2b05(0x181)]+'\x22.',_0x4c2b05(0x160)+_0x1e17f7+_0x4c2b05(0x156));const _0x16faa6=scanSkillDirectory(_0x1e17f7,{'excludedFilePaths':_0x11e770[_0x4c2b05(0x16a)]}),_0x2879d0=buildSkillPackage(_0x16faa6),_0x540b2d=readFileSync(_0x3a89b7,_0x4c2b05(0x13e)),_0x3fe839=_0x5178d5[_0x4c2b05(0x182)],_0x324bf1=_0x11e770[_0x4c2b05(0x153)]?undefined:_0x45307b,_0x23ac48=readSkillDisplayName(_0x540b2d);return{'skillCode':_0x3fe839,'metadata':_0x45307b,'frontmatterDisplayName':_0x23ac48,'input':{'skillCode':_0x3fe839,'skillName':_0x23ac48??_0x324bf1?.[_0x4c2b05(0x16d)],'description':_0x324bf1?.[_0x4c2b05(0x15e)],'content':_0x540b2d,'files':_0x2879d0[_0x4c2b05(0x16e)],'packageBase64':_0x2879d0['packageBase64'],'tags':_0x324bf1?.[_0x4c2b05(0x179)],'version':_0x324bf1?.[_0x4c2b05(0x175)],'sourceSessionId':_0x324bf1?.[_0x4c2b05(0x147)]}};}export function refreshPushDirectoryMetadataFromRemote(_0x1d0542,_0x273001,_0x43408b,_0x31c720={}){const _0x10f753=a141_0x37e7,_0x4fc1c8=resolvePushDirectoryRoot(_0x1d0542),_0x5355a9=readPushMetadataIfPresent(resolve(_0x4fc1c8,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x5ab6a6=requireRemoteScope(_0x273001),_0x49a6c3=readLocalSkillContent(_0x4fc1c8),_0x5efafd={..._0x273001,'appCode':_0x273001['appCode']??_0x43408b,'skillName':_0x273001['skillName']??_0x5355a9?.[_0x10f753(0x16d)],'description':_0x273001[_0x10f753(0x15e)]??_0x5355a9?.['description'],'example':_0x273001[_0x10f753(0x148)]??_0x5355a9?.[_0x10f753(0x148)],'tags':Array[_0x10f753(0x14e)](_0x273001[_0x10f753(0x179)])?_0x273001[_0x10f753(0x179)]:_0x5355a9?.[_0x10f753(0x179)],'sourceSessionId':_0x273001[_0x10f753(0x147)]??_0x5355a9?.[_0x10f753(0x147)],'content':_0x273001[_0x10f753(0x177)]??_0x49a6c3},_0x32cfe5=buildMetadata(_0x5efafd,_0x5ab6a6,_0x43408b,contentHash(_0x49a6c3),_0x31c720[_0x10f753(0x15d)]);writeJsonAtomic(resolve(_0x4fc1c8,METADATA_FILE),_0x32cfe5);}export function recordPushedRuntimeSkill(_0x273270,_0x1205b2,_0x3e7546,_0xb7a059={}){const _0x9ef5a4=a141_0x37e7,_0x4983e3=resolvePushDirectoryRoot(_0x273270),_0x3e5773=scanSkillDirectory(_0x4983e3),_0x5726b3=_0x3e5773[_0x9ef5a4(0x14c)](_0x172b70=>_0x172b70[_0x9ef5a4(0x157)]===SKILL_FILE),_0x492bc7=_0x5726b3?fileText(_0x5726b3):'',_0x64ac5a=tryNormalizePackageManifest(_0x1205b2[_0x9ef5a4(0x17b)]),_0x3b7676={..._0x1205b2,'content':_0x1205b2[_0x9ef5a4(0x177)]??_0x492bc7,'files':_0x64ac5a},_0x3cfb2e=_0x64ac5a?normalizeLocalFiles(_0x3e5773)[_0x9ef5a4(0x158)](_0x5eda69=>_0x64ac5a[_0x9ef5a4(0x17b)][_0x9ef5a4(0x163)](_0x2b4ee0=>_0x2b4ee0[_0x9ef5a4(0x157)]===_0x5eda69[_0x9ef5a4(0x157)])):undefined,_0x37af5a=buildMetadata(_0x3b7676,_0xb7a059[_0x9ef5a4(0x181)]??_0x9ef5a4(0x17e),_0x3e7546,contentHash(_0x3b7676[_0x9ef5a4(0x177)]??''),_0xb7a059[_0x9ef5a4(0x14a)],_0x3cfb2e);writeJsonAtomic(resolve(_0x4983e3,METADATA_FILE),_0x37af5a);}export function deriveSkillCodeFromDirectory(_0xa6e6bd,_0x8391a1){const _0x260f14=a141_0x37e7,_0x9af089=basename(resolve(_0xa6e6bd)),_0x27bd4f=_0x8391a1+'--';return _0x9af089[_0x260f14(0x140)](_0x27bd4f)?_0x9af089['slice'](_0x27bd4f[_0x260f14(0x13f)]):_0x9af089;}function a141_0x37e7(_0x4b5525,_0x580a61){_0x4b5525=_0x4b5525-0x13c;const _0xcd9834=a141_0xcd98();let _0x37e708=_0xcd9834[_0x4b5525];return _0x37e708;}function resolvePushSkillCode(_0x35c82f,_0x436593,_0x3b4258,_0x2d01ce){const _0x54ede2=a141_0x37e7,_0x1ee439=deriveSkillCodeFromSkillFile(_0x35c82f)||deriveSkillCodeFromDirectory(_0x35c82f,_0x436593);if(_0x2d01ce[_0x54ede2(0x16f)])return _0x1ee439;return _0x3b4258?.[_0x54ede2(0x182)]?.[_0x54ede2(0x173)]()||_0x1ee439;}function deriveSkillCodeFromSkillFile(_0xac5e58){const _0x2318d6=a141_0x37e7,_0x3c7441=resolve(_0xac5e58,SKILL_FILE);if(!existsSync(_0x3c7441)||!lstatSync(_0x3c7441)[_0x2318d6(0x14d)]())return undefined;const _0x39e157=readFileSync(_0x3c7441,_0x2318d6(0x13e)),_0x474b9f=_0x39e157['match'](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x474b9f)return undefined;const _0x1d1c3f=parseFrontmatterObject(_0x474b9f[0x1]??''),_0x42e8ca=scalarToString(_0x1d1c3f?.[_0x2318d6(0x164)]);return _0x42e8ca?slugifySkillName(_0x42e8ca):undefined;}function readSkillDisplayName(_0x106d67){const _0x427549=a141_0x37e7,_0x292566=_0x106d67[_0x427549(0x15a)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x292566)return undefined;const _0x3f153b=parseFrontmatterObject(_0x292566[0x1]??'');return scalarToString(_0x3f153b?.[_0x427549(0x13c)]);}function slugifySkillName(_0x26919e){const _0x519c80=a141_0x37e7,_0x55bb42=_0x26919e['trim']()[_0x519c80(0x168)]()[_0x519c80(0x144)](/[^\p{L}\p{N}\p{So}]+/gu,'-')['replace'](/^-+/,'')['replace'](/-+$/,'')[_0x519c80(0x144)](/-{2,}/g,'-');if(!_0x55bb42)throw CliErrors[_0x519c80(0x16c)](_0x519c80(0x161)+SKILL_FILE+_0x519c80(0x180));return _0x55bb42;}function parseFrontmatterObject(_0x42bcc5){const _0x306a1d=a141_0x37e7;try{const _0x456f41=a141_0x35be4c(_0x42bcc5);return _0x456f41&&typeof _0x456f41==='object'&&!Array[_0x306a1d(0x14e)](_0x456f41)?_0x456f41:undefined;}catch{return undefined;}}function scalarToString(_0x429fa9){const _0x46e0d6=a141_0x37e7;if(typeof _0x429fa9===_0x46e0d6(0x15c))return _0x429fa9[_0x46e0d6(0x173)]();if(typeof _0x429fa9===_0x46e0d6(0x16b)||typeof _0x429fa9==='boolean')return String(_0x429fa9);return undefined;}function resolvePushDirectoryRoot(_0x12e3e2){const _0x2e8c85=a141_0x37e7,_0xcd6727=resolve(_0x12e3e2);if(!existsSync(_0xcd6727))throw CliErrors[_0x2e8c85(0x16c)](_0x2e8c85(0x170)+_0x12e3e2);const _0x5e7f8b=lstatSync(_0xcd6727);if(_0x5e7f8b[_0x2e8c85(0x17a)]())return _0xcd6727;if(_0x5e7f8b[_0x2e8c85(0x146)]()){const _0x360696=realpathSync(_0xcd6727);if(lstatSync(_0x360696)[_0x2e8c85(0x17a)]())return _0x360696;}throw CliErrors['validation'](_0x2e8c85(0x170)+_0x12e3e2);}function a141_0xcd98(){const _0x4b96ef=['ignoreMetadataAppCodeMismatch','replace','ignoreInvalidMetadata','isSymbolicLink','sourceSessionId','example','Missing\x20','pushedAt','4117308XutFSJ','find','isFile','isArray','appCode','(unknown)','37815PldNmt','ignoreMetadataScope','ignoreMetadataForPayload','1510100ndJdei','454mGjUmi','\x20to\x20submit\x20company\x20Skills\x20for\x20review.','path','filter','Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20','match','22rEEADW','string','refreshedAt','description','Skill\x20metadata\x20appCode\x20\x22','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20','Invalid\x20','company','some','name','Unable\x20to\x20resolve\x20skillCode\x20from\x20','dir','19176byrwyf','toLowerCase','12CUqegm','excludedFilePaths','number','validation','skillName','manifest','ignoreMetadataSkillCode','Skill\x20directory\x20not\x20found:\x20',',\x20or\x20directory\x20name.','819Pwgwiw','trim','builtin','version','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20','content','1746gGHKEa','tags','isDirectory','files','\x20has\x20scope=\x22','metadata','personal','569yaOKyH','\x20name\x20for\x20SkillHub\x20slug\x20generation.','scope','skillCode','13816KKviAZ','displayName','targetScope','utf8','length','startsWith','allowAppCodeRetarget','526107MXMYCs'];a141_0xcd98=function(){return _0x4b96ef;};return a141_0xcd98();}function requireRemoteScope(_0x78c8bd){const _0x4b0cae=a141_0x37e7;if(_0x78c8bd[_0x4b0cae(0x181)]===_0x4b0cae(0x17e)||_0x78c8bd[_0x4b0cae(0x181)]===_0x4b0cae(0x162)||_0x78c8bd[_0x4b0cae(0x181)]===_0x4b0cae(0x174))return _0x78c8bd[_0x4b0cae(0x181)];throw CliErrors[_0x4b0cae(0x16c)]('Remote\x20Skill\x20'+(_0x78c8bd[_0x4b0cae(0x182)]||_0x4b0cae(0x150))+'\x20has\x20unsupported\x20scope\x20\x22'+(_0x78c8bd[_0x4b0cae(0x181)]??'unknown')+'\x22.');}function readLocalSkillContent(_0x17c4cd){const _0x13f061=resolve(_0x17c4cd,SKILL_FILE);return existsSync(_0x13f061)&&lstatSync(_0x13f061)['isFile']()?readFileSync(_0x13f061,'utf8'):'';}function readPushMetadataIfPresent(_0x504382,_0x4894a6={}){const _0x20011b=a141_0x37e7;try{return readMetadataIfPresent(_0x504382);}catch(_0x2715b3){if(_0x4894a6[_0x20011b(0x145)])return undefined;throw _0x2715b3;}}
1
+ (function(_0x3d5de8,_0x5a2a66){const _0x2191f5=a141_0x1619,_0x56bce9=_0x3d5de8();while(!![]){try{const _0x581919=-parseInt(_0x2191f5(0xc1))/0x1+parseInt(_0x2191f5(0xbf))/0x2*(parseInt(_0x2191f5(0x93))/0x3)+parseInt(_0x2191f5(0x94))/0x4+-parseInt(_0x2191f5(0xa5))/0x5*(-parseInt(_0x2191f5(0x9f))/0x6)+parseInt(_0x2191f5(0x91))/0x7+parseInt(_0x2191f5(0x98))/0x8*(-parseInt(_0x2191f5(0xb2))/0x9)+-parseInt(_0x2191f5(0xca))/0xa;if(_0x581919===_0x5a2a66)break;else _0x56bce9['push'](_0x56bce9['shift']());}catch(_0x578526){_0x56bce9['push'](_0x56bce9['shift']());}}}(a141_0x14eb,0xb6f8c));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a141_0x4a2ac6}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';function a141_0x14eb(){const _0xfc5b57=['8pmATKa','name','description','files','toLowerCase','company','Skill\x20directory\x20not\x20found:\x20','202086GdQIKd','Skill\x20metadata\x20appCode\x20\x22','utf8','scope','targetScope','displayName','215GVATTv','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20','\x20has\x20unsupported\x20scope\x20\x22','startsWith','tags','string','skillName','find','metadata','sourceSessionId','number','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20','version','3268089FLqhpV','object','dir',',\x20or\x20directory\x20name.','\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22','example','match','ignoreMetadataForPayload','builtin','manifest','unknown','ignoreMetadataAppCodeMismatch','replace','409924AWZBih','\x20name\x20for\x20SkillHub\x20slug\x20generation.','1021467lrHatP','trim','some','refreshedAt','isDirectory','Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20','validation','Remote\x20Skill\x20','isFile','3813870AmiTsc','ignoreInvalidMetadata','appCode','path','filter','packageBase64','\x20to\x20submit\x20company\x20Skills\x20for\x20review.','personal','Invalid\x20','pushedAt','238483DqkWgj','excludedFilePaths','6ZbcByv','2492604tTNQeF','skillCode','\x20has\x20scope=\x22','content'];a141_0x14eb=function(){return _0xfc5b57;};return a141_0x14eb();}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 a141_0x1619(_0x58423b,_0x588f89){_0x58423b=_0x58423b-0x8b;const _0x14eb59=a141_0x14eb();let _0x1619f4=_0x14eb59[_0x58423b];return _0x1619f4;}import{buildSkillPackage,tryNormalizePackageManifest}from'./zip-package.js';export function resolvePushDirectoryIdentity(_0x50fb5a,_0x553cb4,_0x3b34ac={}){const _0xd9d34a=a141_0x1619,_0x845956=resolvePushDirectoryRoot(_0x50fb5a),_0x56d3de=readPushMetadataIfPresent(resolve(_0x845956,METADATA_FILE),{'ignoreInvalidMetadata':_0x3b34ac[_0xd9d34a(0xcb)]});if(_0x56d3de?.[_0xd9d34a(0xcc)]&&_0x56d3de[_0xd9d34a(0xcc)]!==_0x553cb4&&!_0x3b34ac['allowAppCodeRetarget']&&!_0x3b34ac[_0xd9d34a(0xbd)])throw CliErrors['validation'](_0xd9d34a(0xa0)+_0x56d3de[_0xd9d34a(0xcc)]+_0xd9d34a(0xb6)+_0x553cb4+'\x22.');const _0x1b4f30=resolvePushSkillCode(_0x845956,_0x553cb4,_0x56d3de,_0x3b34ac);if(!_0x1b4f30)throw CliErrors[_0xd9d34a(0xc7)]('Unable\x20to\x20resolve\x20skillCode\x20from\x20'+SKILL_FILE+',\x20'+METADATA_FILE+_0xd9d34a(0xb5));return{'dir':_0x845956,'skillCode':_0x1b4f30,'metadata':_0x56d3de};}export function readPushDirectory(_0x2c9471,_0x5b9048,_0x4f010e={}){const _0x18cb76=a141_0x1619,_0x1a6b73=resolvePushDirectoryIdentity(_0x2c9471,_0x5b9048,_0x4f010e),_0x1cb903=_0x1a6b73[_0x18cb76(0xb4)],_0x30ea3d=resolve(_0x1cb903,SKILL_FILE);if(!existsSync(_0x30ea3d)||!lstatSync(_0x30ea3d)['isFile']())throw CliErrors[_0x18cb76(0xc7)]('Missing\x20'+SKILL_FILE+':\x20'+_0x30ea3d);const _0x588561=_0x1a6b73[_0x18cb76(0xad)],_0x37af1d=_0x4f010e[_0x18cb76(0xa3)]??_0x18cb76(0x8e);if(!_0x4f010e['ignoreMetadataScope']&&_0x588561?.[_0x18cb76(0xa2)]===_0x18cb76(0xba))throw CliErrors[_0x18cb76(0xc7)](_0x18cb76(0xc6)+METADATA_FILE+_0x18cb76(0x96)+_0x588561[_0x18cb76(0xa2)]+'\x22.');if(!_0x4f010e['ignoreMetadataScope']&&_0x37af1d===_0x18cb76(0x8e)&&_0x588561?.[_0x18cb76(0xa2)]&&_0x588561['scope']!==_0x18cb76(0x8e))throw CliErrors['validation'](_0x18cb76(0xb0)+METADATA_FILE+_0x18cb76(0x96)+_0x588561[_0x18cb76(0xa2)]+'\x22.',_0x18cb76(0xa6)+_0x1cb903+_0x18cb76(0x8d));const _0x141cd4=scanSkillDirectory(_0x1cb903,{'excludedFilePaths':_0x4f010e[_0x18cb76(0x92)]}),_0x32e3ee=buildSkillPackage(_0x141cd4),_0x4a39d2=readFileSync(_0x30ea3d,_0x18cb76(0xa1)),_0x2d4c2f=_0x1a6b73[_0x18cb76(0x95)],_0x253fef=_0x4f010e[_0x18cb76(0xb9)]?undefined:_0x588561,_0x186d0e=readSkillDisplayName(_0x4a39d2);return{'skillCode':_0x2d4c2f,'metadata':_0x588561,'frontmatterDisplayName':_0x186d0e,'input':{'skillCode':_0x2d4c2f,'skillName':_0x186d0e??_0x253fef?.[_0x18cb76(0xab)],'description':_0x253fef?.[_0x18cb76(0x9a)],'content':_0x4a39d2,'files':_0x32e3ee[_0x18cb76(0xbb)],'packageBase64':_0x32e3ee[_0x18cb76(0x8c)],'tags':_0x253fef?.['tags'],'version':_0x253fef?.[_0x18cb76(0xb1)],'sourceSessionId':_0x253fef?.[_0x18cb76(0xae)]}};}export function refreshPushDirectoryMetadataFromRemote(_0x30b4f4,_0x34e4ce,_0x438ad9,_0x369c3c={}){const _0x451c47=a141_0x1619,_0x126f26=resolvePushDirectoryRoot(_0x30b4f4),_0x41a71c=readPushMetadataIfPresent(resolve(_0x126f26,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x49c4b2=requireRemoteScope(_0x34e4ce),_0x52763c=readLocalSkillContent(_0x126f26),_0x14c31c={..._0x34e4ce,'appCode':_0x34e4ce[_0x451c47(0xcc)]??_0x438ad9,'skillName':_0x34e4ce['skillName']??_0x41a71c?.[_0x451c47(0xab)],'description':_0x34e4ce[_0x451c47(0x9a)]??_0x41a71c?.['description'],'example':_0x34e4ce['example']??_0x41a71c?.[_0x451c47(0xb7)],'tags':Array['isArray'](_0x34e4ce[_0x451c47(0xa9)])?_0x34e4ce['tags']:_0x41a71c?.[_0x451c47(0xa9)],'sourceSessionId':_0x34e4ce[_0x451c47(0xae)]??_0x41a71c?.[_0x451c47(0xae)],'content':_0x34e4ce['content']??_0x52763c},_0x74e1a8=buildMetadata(_0x14c31c,_0x49c4b2,_0x438ad9,contentHash(_0x52763c),_0x369c3c[_0x451c47(0xc4)]);writeJsonAtomic(resolve(_0x126f26,METADATA_FILE),_0x74e1a8);}export function recordPushedRuntimeSkill(_0x28e5ee,_0x58d2e6,_0x4bdc3b,_0x2b74d0={}){const _0xe15ef9=a141_0x1619,_0xdd793d=resolvePushDirectoryRoot(_0x28e5ee),_0x57861b=scanSkillDirectory(_0xdd793d),_0x11a93e=_0x57861b[_0xe15ef9(0xac)](_0x5731ab=>_0x5731ab[_0xe15ef9(0xcd)]===SKILL_FILE),_0x20c96e=_0x11a93e?fileText(_0x11a93e):'',_0x301b9a=tryNormalizePackageManifest(_0x58d2e6['files']),_0x5ee25f={..._0x58d2e6,'content':_0x58d2e6[_0xe15ef9(0x97)]??_0x20c96e,'files':_0x301b9a},_0x3f3e7b=_0x301b9a?normalizeLocalFiles(_0x57861b)[_0xe15ef9(0x8b)](_0x305bae=>_0x301b9a[_0xe15ef9(0x9b)][_0xe15ef9(0xc3)](_0x12e174=>_0x12e174[_0xe15ef9(0xcd)]===_0x305bae[_0xe15ef9(0xcd)])):undefined,_0x3a5341=buildMetadata(_0x5ee25f,_0x2b74d0[_0xe15ef9(0xa2)]??'personal',_0x4bdc3b,contentHash(_0x5ee25f['content']??''),_0x2b74d0[_0xe15ef9(0x90)],_0x3f3e7b);writeJsonAtomic(resolve(_0xdd793d,METADATA_FILE),_0x3a5341);}export function deriveSkillCodeFromDirectory(_0x29a90c,_0x4784e5){const _0x1ee239=a141_0x1619,_0x55a8e5=basename(resolve(_0x29a90c)),_0x261c66=_0x4784e5+'--';return _0x55a8e5[_0x1ee239(0xa8)](_0x261c66)?_0x55a8e5['slice'](_0x261c66['length']):_0x55a8e5;}function resolvePushSkillCode(_0x331d36,_0x812402,_0x239207,_0x57e7a6){const _0x2ee7a9=a141_0x1619,_0x478b19=deriveSkillCodeFromSkillFile(_0x331d36)||deriveSkillCodeFromDirectory(_0x331d36,_0x812402);if(_0x57e7a6['ignoreMetadataSkillCode'])return _0x478b19;return _0x239207?.[_0x2ee7a9(0x95)]?.[_0x2ee7a9(0xc2)]()||_0x478b19;}function deriveSkillCodeFromSkillFile(_0x3d48bd){const _0xb8cd97=a141_0x1619,_0x367510=resolve(_0x3d48bd,SKILL_FILE);if(!existsSync(_0x367510)||!lstatSync(_0x367510)[_0xb8cd97(0xc9)]())return undefined;const _0x2ef97f=readFileSync(_0x367510,_0xb8cd97(0xa1)),_0x4f688a=_0x2ef97f['match'](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x4f688a)return undefined;const _0x516550=parseFrontmatterObject(_0x4f688a[0x1]??''),_0x523f47=scalarToString(_0x516550?.[_0xb8cd97(0x99)]);return _0x523f47?slugifySkillName(_0x523f47):undefined;}function readSkillDisplayName(_0x5c5748){const _0x5a98ad=a141_0x1619,_0x2e8260=_0x5c5748[_0x5a98ad(0xb8)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x2e8260)return undefined;const _0x79a6c3=parseFrontmatterObject(_0x2e8260[0x1]??'');return scalarToString(_0x79a6c3?.[_0x5a98ad(0xa4)]);}function slugifySkillName(_0x188347){const _0x23c79a=a141_0x1619,_0x498771=_0x188347['trim']()[_0x23c79a(0x9c)]()[_0x23c79a(0xbe)](/[^\p{L}\p{N}\p{So}]+/gu,'-')['replace'](/^-+/,'')[_0x23c79a(0xbe)](/-+$/,'')['replace'](/-{2,}/g,'-');if(!_0x498771)throw CliErrors['validation'](_0x23c79a(0x8f)+SKILL_FILE+_0x23c79a(0xc0));return _0x498771;}function parseFrontmatterObject(_0x58a2a9){const _0x1130d7=a141_0x1619;try{const _0x20c998=a141_0x4a2ac6(_0x58a2a9);return _0x20c998&&typeof _0x20c998===_0x1130d7(0xb3)&&!Array['isArray'](_0x20c998)?_0x20c998:undefined;}catch{return undefined;}}function scalarToString(_0x463345){const _0x2d0ce6=a141_0x1619;if(typeof _0x463345===_0x2d0ce6(0xaa))return _0x463345[_0x2d0ce6(0xc2)]();if(typeof _0x463345===_0x2d0ce6(0xaf)||typeof _0x463345==='boolean')return String(_0x463345);return undefined;}function resolvePushDirectoryRoot(_0x3a908b){const _0x4d6e36=a141_0x1619,_0x3aff8e=resolve(_0x3a908b);if(!existsSync(_0x3aff8e))throw CliErrors[_0x4d6e36(0xc7)]('Skill\x20directory\x20not\x20found:\x20'+_0x3a908b);const _0x47bf23=lstatSync(_0x3aff8e);if(_0x47bf23[_0x4d6e36(0xc5)]())return _0x3aff8e;if(_0x47bf23['isSymbolicLink']()){const _0x20a1a8=realpathSync(_0x3aff8e);if(lstatSync(_0x20a1a8)[_0x4d6e36(0xc5)]())return _0x20a1a8;}throw CliErrors['validation'](_0x4d6e36(0x9e)+_0x3a908b);}function requireRemoteScope(_0x48b507){const _0x1b3a40=a141_0x1619;if(_0x48b507[_0x1b3a40(0xa2)]===_0x1b3a40(0x8e)||_0x48b507['scope']===_0x1b3a40(0x9d)||_0x48b507[_0x1b3a40(0xa2)]===_0x1b3a40(0xba))return _0x48b507['scope'];throw CliErrors['validation'](_0x1b3a40(0xc8)+(_0x48b507[_0x1b3a40(0x95)]||'(unknown)')+_0x1b3a40(0xa7)+(_0x48b507['scope']??_0x1b3a40(0xbc))+'\x22.');}function readLocalSkillContent(_0x281de2){const _0x596de7=a141_0x1619,_0xcaa994=resolve(_0x281de2,SKILL_FILE);return existsSync(_0xcaa994)&&lstatSync(_0xcaa994)[_0x596de7(0xc9)]()?readFileSync(_0xcaa994,_0x596de7(0xa1)):'';}function readPushMetadataIfPresent(_0x377287,_0xa9e825={}){try{return readMetadataIfPresent(_0x377287);}catch(_0x33fcd7){if(_0xa9e825['ignoreInvalidMetadata'])return undefined;throw _0x33fcd7;}}
@@ -1 +1 @@
1
- (function(_0x9cd136,_0x192a87){const _0x5d490=a142_0x2102,_0x3af058=_0x9cd136();while(!![]){try{const _0x200035=parseInt(_0x5d490(0x8f))/0x1*(-parseInt(_0x5d490(0x8a))/0x2)+-parseInt(_0x5d490(0x8c))/0x3*(parseInt(_0x5d490(0x8b))/0x4)+-parseInt(_0x5d490(0x86))/0x5*(parseInt(_0x5d490(0x88))/0x6)+-parseInt(_0x5d490(0x8e))/0x7+-parseInt(_0x5d490(0x92))/0x8*(-parseInt(_0x5d490(0x84))/0x9)+parseInt(_0x5d490(0x89))/0xa+parseInt(_0x5d490(0x90))/0xb;if(_0x200035===_0x192a87)break;else _0x3af058['push'](_0x3af058['shift']());}catch(_0x49ff51){_0x3af058['push'](_0x3af058['shift']());}}}(a142_0xe448,0x840f3));import{CliErrors}from'../../errors.js';export function normalizeRuntimeSkillScopes(_0x1d1d16){const _0x2dd543=a142_0x2102,_0x21a0b9=_0x1d1d16&&_0x1d1d16[_0x2dd543(0x85)]>0x0?_0x1d1d16:['personal',_0x2dd543(0x91),_0x2dd543(0x83)],_0xe9d8c8=[];for(const _0x584903 of _0x21a0b9){if(!isRuntimeSkillScope(_0x584903))throw CliErrors[_0x2dd543(0x8d)]('Unsupported\x20runtime\x20Skill\x20scope:\x20'+_0x584903);!_0xe9d8c8[_0x2dd543(0x93)](_0x584903)&&_0xe9d8c8['push'](_0x584903);}return _0xe9d8c8;}function a142_0x2102(_0x3738e6,_0x41a7f1){_0x3738e6=_0x3738e6-0x83;const _0xe44864=a142_0xe448();let _0x210207=_0xe44864[_0x3738e6];return _0x210207;}function a142_0xe448(){const _0x4a4869=['validation','6364001OuNTQm','16EmbzYY','9111751bKOAjY','company','8nKvDZw','includes','builtin','6882669yoJGym','length','5YHeGEG','personal','36606MsHygk','8218890nwfAwe','26330gBCfGd','2992688KSwhjH','3vxagtc'];a142_0xe448=function(){return _0x4a4869;};return a142_0xe448();}export function isRuntimeSkillScope(_0x3c388b){const _0x19edad=a142_0x2102;return _0x3c388b===_0x19edad(0x87)||_0x3c388b===_0x19edad(0x91)||_0x3c388b===_0x19edad(0x83);}
1
+ function a142_0xc27b(){const _0x511a38=['7833kbgBIY','388288hQpOVI','10GqxKsx','384xDImCa','includes','company','15705XECBLN','88383hhCoPB','1inoSJz','637162MgrQvD','validation','1456WTPIlG','5237111iMmUMC','personal','length','1428905FRpnqY','push'];a142_0xc27b=function(){return _0x511a38;};return a142_0xc27b();}(function(_0x4ed96,_0x13071e){const _0x594681=a142_0x1ed4,_0x3dc10f=_0x4ed96();while(!![]){try{const _0x37108e=parseInt(_0x594681(0x188))/0x1*(-parseInt(_0x594681(0x189))/0x2)+parseInt(_0x594681(0x187))/0x3+parseInt(_0x594681(0x181))/0x4+-parseInt(_0x594681(0x17e))/0x5+parseInt(_0x594681(0x183))/0x6*(-parseInt(_0x594681(0x180))/0x7)+parseInt(_0x594681(0x18b))/0x8*(parseInt(_0x594681(0x186))/0x9)+-parseInt(_0x594681(0x182))/0xa*(-parseInt(_0x594681(0x18c))/0xb);if(_0x37108e===_0x13071e)break;else _0x3dc10f['push'](_0x3dc10f['shift']());}catch(_0x4e648f){_0x3dc10f['push'](_0x3dc10f['shift']());}}}(a142_0xc27b,0x3ba16));import{CliErrors}from'../../errors.js';function a142_0x1ed4(_0xc6b89a,_0x81d09f){_0xc6b89a=_0xc6b89a-0x17d;const _0xc27b03=a142_0xc27b();let _0x1ed4c4=_0xc27b03[_0xc6b89a];return _0x1ed4c4;}export function normalizeRuntimeSkillScopes(_0x572518){const _0x169666=a142_0x1ed4,_0x2531f3=_0x572518&&_0x572518[_0x169666(0x17d)]>0x0?_0x572518:[_0x169666(0x18d),'company','builtin'],_0x4f3f60=[];for(const _0x300310 of _0x2531f3){if(!isRuntimeSkillScope(_0x300310))throw CliErrors[_0x169666(0x18a)]('Unsupported\x20runtime\x20Skill\x20scope:\x20'+_0x300310);!_0x4f3f60[_0x169666(0x184)](_0x300310)&&_0x4f3f60[_0x169666(0x17f)](_0x300310);}return _0x4f3f60;}export function isRuntimeSkillScope(_0x5eb1f2){const _0xb86228=a142_0x1ed4;return _0x5eb1f2===_0xb86228(0x18d)||_0x5eb1f2===_0xb86228(0x185)||_0x5eb1f2==='builtin';}
@@ -1 +1 @@
1
- const a144_0x3b9c39=a144_0x2d9e;(function(_0x3f37cf,_0x422d66){const _0x343afc=a144_0x2d9e,_0x1e4e27=_0x3f37cf();while(!![]){try{const _0x4245f5=parseInt(_0x343afc(0x146))/0x1*(-parseInt(_0x343afc(0x145))/0x2)+parseInt(_0x343afc(0x147))/0x3+-parseInt(_0x343afc(0x14b))/0x4+parseInt(_0x343afc(0x13c))/0x5+-parseInt(_0x343afc(0x149))/0x6+parseInt(_0x343afc(0x13a))/0x7+parseInt(_0x343afc(0x13b))/0x8*(-parseInt(_0x343afc(0x14c))/0x9);if(_0x4245f5===_0x422d66)break;else _0x1e4e27['push'](_0x1e4e27['shift']());}catch(_0x8c867d){_0x1e4e27['push'](_0x1e4e27['shift']());}}}(a144_0x1fbf,0x47e62));import{unzipSync,zipSync}from'fflate';import{CliErrors}from'../../errors.js';import{compareSkillFiles,fileContent,normalizeLocalFiles,normalizeSkillRelativePath}from'./local-files.js';const ZIP_MTIME=new Date(a144_0x3b9c39(0x144));function a144_0x1fbf(){const _0x4ccee1=['validation','code','path','validation_error','entries','1980-01-01T00:00:00.000Z','762VyprOK','503dxoXIn','1699851WzauTX','endsWith','1199220RvHliG','Runtime\x20Skill\x20package\x20contains\x20directory\x20entry:\x20','764136UtuJRC','147006Vzwhda','Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.','length','971159CUAWpb','8HXJYVT','940125OqUzRa','name','map'];a144_0x1fbf=function(){return _0x4ccee1;};return a144_0x1fbf();}function a144_0x2d9e(_0x3ce646,_0x5c578a){_0x3ce646=_0x3ce646-0x138;const _0x1fbfa1=a144_0x1fbf();let _0x2d9e95=_0x1fbfa1[_0x3ce646];return _0x2d9e95;}export function createDeterministicZipPackage(_0x3dffb2){const _0x2f0c6a=a144_0x3b9c39,_0x29dadf={};for(const _0x1d7b1d of normalizeLocalFiles(_0x3dffb2)){_0x29dadf[_0x1d7b1d[_0x2f0c6a(0x141)]]=fileContent(_0x1d7b1d);}return Buffer['from'](zipSync(_0x29dadf,{'level':0x0,'mtime':ZIP_MTIME}));}export function parseZipPackage(_0x15a33d){const _0x47f3b9=a144_0x3b9c39;if(_0x15a33d[_0x47f3b9(0x139)]<0x16)throw CliErrors[_0x47f3b9(0x13f)](_0x47f3b9(0x138));let _0xe02065;try{_0xe02065=unzipSync(_0x15a33d,{'filter'(_0x2b147f){const _0x196a89=_0x47f3b9,_0x7f8e6f=normalizeSkillRelativePath(_0x2b147f[_0x196a89(0x13d)]);if(_0x7f8e6f[_0x196a89(0x148)]('/'))throw CliErrors[_0x196a89(0x13f)](_0x196a89(0x14a)+_0x7f8e6f);return!![];}});}catch(_0x1c22fb){if(isRuntimeSkillValidationError(_0x1c22fb))throw _0x1c22fb;throw CliErrors[_0x47f3b9(0x13f)](_0x47f3b9(0x138));}return Object[_0x47f3b9(0x143)](_0xe02065)[_0x47f3b9(0x13e)](([_0xf467d1,_0x4d42d8])=>({'path':normalizeSkillRelativePath(_0xf467d1),'bytes':Buffer['from'](_0x4d42d8)}))['sort'](compareSkillFiles);}function isRuntimeSkillValidationError(_0x3f812a){const _0x54cc18=a144_0x3b9c39;return typeof _0x3f812a==='object'&&_0x3f812a!==null&&'code'in _0x3f812a&&_0x3f812a[_0x54cc18(0x140)]===_0x54cc18(0x142);}
1
+ const a144_0x5b00ff=a144_0x300f;(function(_0xd09fed,_0x6c73e0){const _0x3176d7=a144_0x300f,_0x6b82d=_0xd09fed();while(!![]){try{const _0x22b629=parseInt(_0x3176d7(0xd2))/0x1*(parseInt(_0x3176d7(0xd6))/0x2)+parseInt(_0x3176d7(0xd3))/0x3*(-parseInt(_0x3176d7(0xc4))/0x4)+-parseInt(_0x3176d7(0xcb))/0x5+parseInt(_0x3176d7(0xc8))/0x6+-parseInt(_0x3176d7(0xc6))/0x7*(parseInt(_0x3176d7(0xc5))/0x8)+-parseInt(_0x3176d7(0xca))/0x9+-parseInt(_0x3176d7(0xc1))/0xa*(-parseInt(_0x3176d7(0xcd))/0xb);if(_0x22b629===_0x6c73e0)break;else _0x6b82d['push'](_0x6b82d['shift']());}catch(_0x82035){_0x6b82d['push'](_0x6b82d['shift']());}}}(a144_0x3aeb,0x91fc5));function a144_0x300f(_0x3320c4,_0x5c3bc9){_0x3320c4=_0x3320c4-0xc1;const _0x3aeb9b=a144_0x3aeb();let _0x300ff7=_0x3aeb9b[_0x3320c4];return _0x300ff7;}import{unzipSync,zipSync}from'fflate';import{CliErrors}from'../../errors.js';import{compareSkillFiles,fileContent,normalizeLocalFiles,normalizeSkillRelativePath}from'./local-files.js';function a144_0x3aeb(){const _0x3b53af=['validation','5108013gdPWFD','4931905wnMoch','Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.','40249srtPoX','map','1980-01-01T00:00:00.000Z','Runtime\x20Skill\x20package\x20contains\x20directory\x20entry:\x20','entries','2098sfyfgs','394131MLZLmE','validation_error','name','276TxSJAS','length','path','9470nYZMMt','code','from','32UnAepb','6774584jkSYdG','7BSTIut','object','1770822sbWfEi'];a144_0x3aeb=function(){return _0x3b53af;};return a144_0x3aeb();}const ZIP_MTIME=new Date(a144_0x5b00ff(0xcf));export function createDeterministicZipPackage(_0x24bb1f){const _0x467682=a144_0x5b00ff,_0x663fcf={};for(const _0x33d037 of normalizeLocalFiles(_0x24bb1f)){_0x663fcf[_0x33d037[_0x467682(0xd8)]]=fileContent(_0x33d037);}return Buffer[_0x467682(0xc3)](zipSync(_0x663fcf,{'level':0x0,'mtime':ZIP_MTIME}));}export function parseZipPackage(_0x34decf){const _0x275a51=a144_0x5b00ff;if(_0x34decf[_0x275a51(0xd7)]<0x16)throw CliErrors[_0x275a51(0xc9)](_0x275a51(0xcc));let _0x251e25;try{_0x251e25=unzipSync(_0x34decf,{'filter'(_0x800771){const _0x4f1e59=_0x275a51,_0x58596e=normalizeSkillRelativePath(_0x800771[_0x4f1e59(0xd5)]);if(_0x58596e['endsWith']('/'))throw CliErrors['validation'](_0x4f1e59(0xd0)+_0x58596e);return!![];}});}catch(_0x4225c6){if(isRuntimeSkillValidationError(_0x4225c6))throw _0x4225c6;throw CliErrors[_0x275a51(0xc9)]('Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.');}return Object[_0x275a51(0xd1)](_0x251e25)[_0x275a51(0xce)](([_0x35e9be,_0x36df2a])=>({'path':normalizeSkillRelativePath(_0x35e9be),'bytes':Buffer[_0x275a51(0xc3)](_0x36df2a)}))['sort'](compareSkillFiles);}function isRuntimeSkillValidationError(_0xcd6636){const _0x2bd2c3=a144_0x5b00ff;return typeof _0xcd6636===_0x2bd2c3(0xc7)&&_0xcd6636!==null&&_0x2bd2c3(0xc2)in _0xcd6636&&_0xcd6636['code']===_0x2bd2c3(0xd4);}
@@ -1 +1 @@
1
- (function(_0x96461,_0x1cd938){const _0x1e1255=a145_0x49ae,_0xaca62=_0x96461();while(!![]){try{const _0x5cd4a7=parseInt(_0x1e1255(0xc0))/0x1+parseInt(_0x1e1255(0xc3))/0x2+-parseInt(_0x1e1255(0xbe))/0x3*(-parseInt(_0x1e1255(0xe5))/0x4)+parseInt(_0x1e1255(0xd4))/0x5+parseInt(_0x1e1255(0xd0))/0x6*(parseInt(_0x1e1255(0xe1))/0x7)+-parseInt(_0x1e1255(0xdb))/0x8*(parseInt(_0x1e1255(0xc5))/0x9)+-parseInt(_0x1e1255(0xc1))/0xa*(parseInt(_0x1e1255(0xd5))/0xb);if(_0x5cd4a7===_0x1cd938)break;else _0xaca62['push'](_0xaca62['shift']());}catch(_0x11cf17){_0xaca62['push'](_0xaca62['shift']());}}}(a145_0x3c9f,0x5e560));function a145_0x3c9f(){const _0x8ae8f=['228774ZKvYkb','80740XrOcte','toString','440970nToxWI','Duplicate\x20Skill\x20package\x20entry:\x20','576SNVaZD','Runtime\x20Skill\x20package\x20size\x20is\x20invalid.','files','Runtime\x20Skill\x20package\x20is\x20required\x20for\x20Skill\x20install:\x20','Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.','trim','Runtime\x20Skill\x20package\x20sha256\x20is\x20invalid.','base64','ossPath','validation','Runtime\x20Skill\x20package\x20size\x20mismatch.','8286mrCnvS','treeSha256','set','get','93250ReqcwO','913RmJlpq','zipSize','sha256','Runtime\x20Skill\x20package\x20entry\x20list\x20mismatch.','path','object','71512yfYHaJ','string','\x20in\x20Skill\x20file\x20package.','bytes','toLowerCase','some','3437UuktLH','Runtime\x20Skill\x20package\x20is\x20missing\x20entry:\x20','isArray','Runtime\x20Skill\x20file\x20tree\x20sha256\x20is\x20invalid.','18744xElARf','map','isSafeInteger','Runtime\x20Skill\x20manifest\x20is\x20missing\x20','Runtime\x20Skill\x20package\x20file\x20sha256\x20mismatch:\x20','size','length','309egIWop','zipSha256'];a145_0x3c9f=function(){return _0x8ae8f;};return a145_0x3c9f();}import{CliErrors}from'../../errors.js';import{SKILL_FILE}from'./constants.js';import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';function a145_0x49ae(_0x8e1756,_0x3f703c){_0x8e1756=_0x8e1756-0xbd;const _0x3c9fc8=a145_0x3c9f();let _0x49ae77=_0x3c9fc8[_0x8e1756];return _0x49ae77;}import{fileContent,isSha256Hex,normalizeLocalFiles,normalizeManifestFiles}from'./local-files.js';import{createDeterministicZipPackage,parseZipPackage}from'./zip-codec.js';export function buildSkillPackage(_0x357cb7){const _0x5b2423=a145_0x49ae,_0x5701b8=normalizeLocalFiles(_0x357cb7);if(!_0x5701b8[_0x5b2423(0xe0)](_0x2ce01a=>_0x2ce01a[_0x5b2423(0xd9)]===SKILL_FILE))throw CliErrors[_0x5b2423(0xce)]('Missing\x20'+SKILL_FILE+_0x5b2423(0xdd));const _0x2cc091=localFilesToManifestFiles(_0x5701b8),_0x3d05e5=createDeterministicZipPackage(_0x5701b8);return{'manifest':{'schemaVersion':0x2,'treeSha256':fileTreeHash(_0x2cc091),'zipSha256':bufferSha256(_0x3d05e5),'zipSize':_0x3d05e5[_0x5b2423(0xbd)],'files':_0x2cc091},'packageBytes':_0x3d05e5,'packageBase64':_0x3d05e5[_0x5b2423(0xc2)](_0x5b2423(0xcc))};}export function verifyRuntimeSkillPackage(_0x459b93,_0x272fab){const _0x416fc0=a145_0x49ae,_0x55fbed=normalizePackageManifest(_0x459b93,{'requireOssPath':![]});if(!_0x55fbed)throw CliErrors[_0x416fc0(0xce)](_0x416fc0(0xc9));return extractAndVerifyPackage(_0x55fbed,_0x272fab);}export function verifyRuntimeSkillBundle(_0x454921,_0x4c8178){const _0x174808=a145_0x49ae,_0x2ae55f=normalizePackageManifest(_0x454921,{'requireOssPath':![]});if(!_0x2ae55f)throw CliErrors[_0x174808(0xce)](_0x174808(0xc9));return extractAndVerifyPackageFiles(_0x2ae55f,_0x4c8178);}export function tryNormalizePackageManifest(_0x4ea602){return normalizePackageManifest(_0x4ea602,{'requireOssPath':![]});}export function requirePackageBytes(_0x9f5b83,_0x2d7bb9){const _0x17087e=a145_0x49ae;if(!_0x2d7bb9||_0x2d7bb9['length']===0x0)throw CliErrors[_0x17087e(0xce)](_0x17087e(0xc8)+_0x9f5b83);return _0x2d7bb9;}export function extractDownloadedPackage(_0x232685){const _0x2d8d0a=a145_0x49ae,_0x682e35=parseZipPackage(_0x232685)[_0x2d8d0a(0xe6)](_0x560088=>({'path':_0x560088[_0x2d8d0a(0xd9)],'bytes':_0x560088[_0x2d8d0a(0xde)]}));if(!_0x682e35[_0x2d8d0a(0xe0)](_0x5dab63=>_0x5dab63['path']===SKILL_FILE))throw CliErrors['validation']('Runtime\x20Skill\x20package\x20is\x20missing\x20'+SKILL_FILE+'.');return normalizeLocalFiles(_0x682e35);}export function localFilesToManifestFiles(_0xde2166){const _0x4dfb7c=a145_0x49ae;return normalizeLocalFiles(_0xde2166)[_0x4dfb7c(0xe6)](_0x16ef4e=>({'path':_0x16ef4e[_0x4dfb7c(0xd9)],'sha256':fileHash(_0x16ef4e),'size':fileContent(_0x16ef4e)[_0x4dfb7c(0xbd)]}));}function normalizePackageManifest(_0x157227,_0x5456d9){const _0x16bdbd=a145_0x49ae;if(!_0x157227||typeof _0x157227!==_0x16bdbd(0xda)||Array[_0x16bdbd(0xe3)](_0x157227))return undefined;const _0x48285a=_0x157227,_0x23cb5b=typeof _0x48285a[_0x16bdbd(0xcd)]===_0x16bdbd(0xdc)?_0x48285a[_0x16bdbd(0xcd)][_0x16bdbd(0xca)]():undefined;if(_0x5456d9['requireOssPath']&&!_0x23cb5b)return undefined;if(!Array[_0x16bdbd(0xe3)](_0x48285a[_0x16bdbd(0xc7)])||_0x48285a[_0x16bdbd(0xc7)][_0x16bdbd(0xbd)]===0x0)return undefined;if(!isSha256Hex(_0x48285a['treeSha256']))throw CliErrors[_0x16bdbd(0xce)](_0x16bdbd(0xe4));if(!isSha256Hex(_0x48285a['zipSha256']))throw CliErrors[_0x16bdbd(0xce)](_0x16bdbd(0xcb));if(!Number['isSafeInteger'](_0x48285a['zipSize'])||_0x48285a['zipSize']<0x0)throw CliErrors[_0x16bdbd(0xce)](_0x16bdbd(0xc6));const _0x51c72a=normalizeManifestFiles(_0x48285a[_0x16bdbd(0xc7)]);if(!_0x51c72a['some'](_0x28a862=>_0x28a862['path']===SKILL_FILE))throw CliErrors[_0x16bdbd(0xce)](_0x16bdbd(0xe8)+SKILL_FILE+'.');const _0x2d900a=fileTreeHash(_0x51c72a);if(_0x2d900a!==_0x48285a[_0x16bdbd(0xd1)][_0x16bdbd(0xdf)]())throw CliErrors[_0x16bdbd(0xce)]('Runtime\x20Skill\x20file\x20tree\x20sha256\x20mismatch.');return{'schemaVersion':Number[_0x16bdbd(0xe7)](_0x48285a['schemaVersion'])?_0x48285a['schemaVersion']:0x2,'ossPath':_0x23cb5b,'treeSha256':_0x2d900a,'zipSha256':_0x48285a[_0x16bdbd(0xbf)][_0x16bdbd(0xdf)](),'zipSize':_0x48285a[_0x16bdbd(0xd6)],'files':_0x51c72a};}function extractAndVerifyPackage(_0x114033,_0x162148){const _0x6b8293=a145_0x49ae,_0x292cb1=normalizePackageManifest(_0x114033,{'requireOssPath':![]});if(!_0x292cb1)throw CliErrors[_0x6b8293(0xce)]('Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.');if(_0x162148['length']!==_0x292cb1[_0x6b8293(0xd6)])throw CliErrors[_0x6b8293(0xce)](_0x6b8293(0xcf));const _0x284552=bufferSha256(_0x162148);if(_0x284552!==_0x292cb1[_0x6b8293(0xbf)])throw CliErrors[_0x6b8293(0xce)]('Runtime\x20Skill\x20package\x20sha256\x20mismatch.');return extractAndVerifyPackageFiles(_0x292cb1,_0x162148);}function extractAndVerifyPackageFiles(_0x280bac,_0x37ece3){const _0x1cca68=a145_0x49ae,_0x24b0ec=parseZipPackage(_0x37ece3);if(_0x24b0ec[_0x1cca68(0xbd)]!==_0x280bac[_0x1cca68(0xc7)][_0x1cca68(0xbd)])throw CliErrors[_0x1cca68(0xce)](_0x1cca68(0xd8));const _0xdd61a6=new Map();for(const _0x8e5df2 of _0x24b0ec){if(_0xdd61a6['has'](_0x8e5df2[_0x1cca68(0xd9)]))throw CliErrors[_0x1cca68(0xce)](_0x1cca68(0xc4)+_0x8e5df2[_0x1cca68(0xd9)]);_0xdd61a6[_0x1cca68(0xd2)](_0x8e5df2[_0x1cca68(0xd9)],_0x8e5df2);}const _0x418d27=[];for(const _0x58be33 of _0x280bac[_0x1cca68(0xc7)]){const _0x428161=_0xdd61a6[_0x1cca68(0xd3)](_0x58be33[_0x1cca68(0xd9)]);if(!_0x428161)throw CliErrors[_0x1cca68(0xce)](_0x1cca68(0xe2)+_0x58be33[_0x1cca68(0xd9)]);if(_0x428161[_0x1cca68(0xde)][_0x1cca68(0xbd)]!==_0x58be33[_0x1cca68(0xea)])throw CliErrors[_0x1cca68(0xce)]('Runtime\x20Skill\x20package\x20file\x20size\x20mismatch:\x20'+_0x58be33[_0x1cca68(0xd9)]);const _0x18f441=bufferSha256(_0x428161[_0x1cca68(0xde)]);if(_0x18f441!==_0x58be33[_0x1cca68(0xd7)])throw CliErrors['validation'](_0x1cca68(0xe9)+_0x58be33['path']);_0x418d27['push']({'path':_0x58be33[_0x1cca68(0xd9)],'bytes':_0x428161[_0x1cca68(0xde)]});}return normalizeLocalFiles(_0x418d27);}
1
+ (function(_0x4afd10,_0x515d30){const _0x5355a0=a145_0x3f2a,_0x700822=_0x4afd10();while(!![]){try{const _0x15cca7=parseInt(_0x5355a0(0xd3))/0x1+-parseInt(_0x5355a0(0xc6))/0x2+parseInt(_0x5355a0(0xd6))/0x3*(parseInt(_0x5355a0(0xe8))/0x4)+parseInt(_0x5355a0(0xe5))/0x5*(-parseInt(_0x5355a0(0xcb))/0x6)+-parseInt(_0x5355a0(0xbd))/0x7*(parseInt(_0x5355a0(0xd0))/0x8)+parseInt(_0x5355a0(0xdd))/0x9*(parseInt(_0x5355a0(0xbb))/0xa)+parseInt(_0x5355a0(0xd2))/0xb*(parseInt(_0x5355a0(0xea))/0xc);if(_0x15cca7===_0x515d30)break;else _0x700822['push'](_0x700822['shift']());}catch(_0x755e6e){_0x700822['push'](_0x700822['shift']());}}}(a145_0x12f5,0x826e1));import{CliErrors}from'../../errors.js';function a145_0x3f2a(_0x27eb61,_0x4a9304){_0x27eb61=_0x27eb61-0xb8;const _0x12f56d=a145_0x12f5();let _0x3f2a42=_0x12f56d[_0x27eb61];return _0x3f2a42;}import{SKILL_FILE}from'./constants.js';import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';import{fileContent,isSha256Hex,normalizeLocalFiles,normalizeManifestFiles}from'./local-files.js';import{createDeterministicZipPackage,parseZipPackage}from'./zip-codec.js';export function buildSkillPackage(_0x52f3b3){const _0x2f61ae=a145_0x3f2a,_0xea7ac4=normalizeLocalFiles(_0x52f3b3);if(!_0xea7ac4[_0x2f61ae(0xe4)](_0x5c8266=>_0x5c8266[_0x2f61ae(0xe7)]===SKILL_FILE))throw CliErrors[_0x2f61ae(0xce)](_0x2f61ae(0xc1)+SKILL_FILE+_0x2f61ae(0xcd));const _0x3423d0=localFilesToManifestFiles(_0xea7ac4),_0x18c78d=createDeterministicZipPackage(_0xea7ac4);return{'manifest':{'schemaVersion':0x2,'treeSha256':fileTreeHash(_0x3423d0),'zipSha256':bufferSha256(_0x18c78d),'zipSize':_0x18c78d['length'],'files':_0x3423d0},'packageBytes':_0x18c78d,'packageBase64':_0x18c78d['toString'](_0x2f61ae(0xbc))};}export function verifyRuntimeSkillPackage(_0x1c3551,_0x4ce036){const _0x5acd9d=a145_0x3f2a,_0x34ceb1=normalizePackageManifest(_0x1c3551,{'requireOssPath':![]});if(!_0x34ceb1)throw CliErrors['validation'](_0x5acd9d(0xc9));return extractAndVerifyPackage(_0x34ceb1,_0x4ce036);}export function verifyRuntimeSkillBundle(_0x246560,_0x3b5b7a){const _0xb62e56=a145_0x3f2a,_0x38b5ca=normalizePackageManifest(_0x246560,{'requireOssPath':![]});if(!_0x38b5ca)throw CliErrors[_0xb62e56(0xce)](_0xb62e56(0xc9));return extractAndVerifyPackageFiles(_0x38b5ca,_0x3b5b7a);}export function tryNormalizePackageManifest(_0x43ef3f){return normalizePackageManifest(_0x43ef3f,{'requireOssPath':![]});}export function requirePackageBytes(_0x2540bf,_0x1d7f11){const _0x42cfeb=a145_0x3f2a;if(!_0x1d7f11||_0x1d7f11['length']===0x0)throw CliErrors['validation'](_0x42cfeb(0xb8)+_0x2540bf);return _0x1d7f11;}export function extractDownloadedPackage(_0x1b0777){const _0x33937f=a145_0x3f2a,_0x597f11=parseZipPackage(_0x1b0777)['map'](_0x53573c=>({'path':_0x53573c[_0x33937f(0xe7)],'bytes':_0x53573c[_0x33937f(0xba)]}));if(!_0x597f11[_0x33937f(0xe4)](_0x55f4fa=>_0x55f4fa[_0x33937f(0xe7)]===SKILL_FILE))throw CliErrors[_0x33937f(0xce)]('Runtime\x20Skill\x20package\x20is\x20missing\x20'+SKILL_FILE+'.');return normalizeLocalFiles(_0x597f11);}export function localFilesToManifestFiles(_0x46aef3){const _0x3c966d=a145_0x3f2a;return normalizeLocalFiles(_0x46aef3)[_0x3c966d(0xc3)](_0x24925b=>({'path':_0x24925b[_0x3c966d(0xe7)],'sha256':fileHash(_0x24925b),'size':fileContent(_0x24925b)[_0x3c966d(0xe3)]}));}function a145_0x12f5(){const _0x5e4eae=['base64','492457NfpoNp','isSafeInteger','sha256','files','Missing\x20','schemaVersion','map','Runtime\x20Skill\x20package\x20sha256\x20mismatch.','push','1550146DnrPgt','Runtime\x20Skill\x20file\x20tree\x20sha256\x20is\x20invalid.','treeSha256','Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.','zipSha256','6xfTsCW','Runtime\x20Skill\x20package\x20entry\x20list\x20mismatch.','\x20in\x20Skill\x20file\x20package.','validation','size','88GaGIyp','Runtime\x20Skill\x20package\x20size\x20mismatch.','1000549uAcnFm','559665HNtzau','Runtime\x20Skill\x20file\x20tree\x20sha256\x20mismatch.','has','1071IjrIhE','Runtime\x20Skill\x20package\x20is\x20missing\x20entry:\x20','requireOssPath','toLowerCase','set','get','ossPath','9CQKuel','Runtime\x20Skill\x20package\x20sha256\x20is\x20invalid.','Runtime\x20Skill\x20package\x20file\x20size\x20mismatch:\x20','trim','Duplicate\x20Skill\x20package\x20entry:\x20','isArray','length','some','1452665WuhnZz','object','path','9160urWgPP','Runtime\x20Skill\x20package\x20size\x20is\x20invalid.','60EgBhyo','Runtime\x20Skill\x20package\x20is\x20required\x20for\x20Skill\x20install:\x20','zipSize','bytes','5417180ZbaSsq'];a145_0x12f5=function(){return _0x5e4eae;};return a145_0x12f5();}function normalizePackageManifest(_0x4c5fc1,_0x142af0){const _0x5b50c9=a145_0x3f2a;if(!_0x4c5fc1||typeof _0x4c5fc1!==_0x5b50c9(0xe6)||Array[_0x5b50c9(0xe2)](_0x4c5fc1))return undefined;const _0x5c770a=_0x4c5fc1,_0x334a2c=typeof _0x5c770a[_0x5b50c9(0xdc)]==='string'?_0x5c770a[_0x5b50c9(0xdc)][_0x5b50c9(0xe0)]():undefined;if(_0x142af0[_0x5b50c9(0xd8)]&&!_0x334a2c)return undefined;if(!Array[_0x5b50c9(0xe2)](_0x5c770a[_0x5b50c9(0xc0)])||_0x5c770a[_0x5b50c9(0xc0)][_0x5b50c9(0xe3)]===0x0)return undefined;if(!isSha256Hex(_0x5c770a['treeSha256']))throw CliErrors['validation'](_0x5b50c9(0xc7));if(!isSha256Hex(_0x5c770a[_0x5b50c9(0xca)]))throw CliErrors[_0x5b50c9(0xce)](_0x5b50c9(0xde));if(!Number['isSafeInteger'](_0x5c770a['zipSize'])||_0x5c770a['zipSize']<0x0)throw CliErrors[_0x5b50c9(0xce)](_0x5b50c9(0xe9));const _0x180959=normalizeManifestFiles(_0x5c770a[_0x5b50c9(0xc0)]);if(!_0x180959['some'](_0x451495=>_0x451495['path']===SKILL_FILE))throw CliErrors[_0x5b50c9(0xce)]('Runtime\x20Skill\x20manifest\x20is\x20missing\x20'+SKILL_FILE+'.');const _0x1f9b70=fileTreeHash(_0x180959);if(_0x1f9b70!==_0x5c770a[_0x5b50c9(0xc8)][_0x5b50c9(0xd9)]())throw CliErrors[_0x5b50c9(0xce)](_0x5b50c9(0xd4));return{'schemaVersion':Number[_0x5b50c9(0xbe)](_0x5c770a['schemaVersion'])?_0x5c770a[_0x5b50c9(0xc2)]:0x2,'ossPath':_0x334a2c,'treeSha256':_0x1f9b70,'zipSha256':_0x5c770a['zipSha256'][_0x5b50c9(0xd9)](),'zipSize':_0x5c770a['zipSize'],'files':_0x180959};}function extractAndVerifyPackage(_0x3ad60e,_0x4c1943){const _0x323653=a145_0x3f2a,_0x1dfaaf=normalizePackageManifest(_0x3ad60e,{'requireOssPath':![]});if(!_0x1dfaaf)throw CliErrors[_0x323653(0xce)]('Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.');if(_0x4c1943[_0x323653(0xe3)]!==_0x1dfaaf[_0x323653(0xb9)])throw CliErrors['validation'](_0x323653(0xd1));const _0x536609=bufferSha256(_0x4c1943);if(_0x536609!==_0x1dfaaf[_0x323653(0xca)])throw CliErrors[_0x323653(0xce)](_0x323653(0xc4));return extractAndVerifyPackageFiles(_0x1dfaaf,_0x4c1943);}function extractAndVerifyPackageFiles(_0x565b7b,_0x30dfa1){const _0x39df85=a145_0x3f2a,_0x2d3c72=parseZipPackage(_0x30dfa1);if(_0x2d3c72[_0x39df85(0xe3)]!==_0x565b7b[_0x39df85(0xc0)][_0x39df85(0xe3)])throw CliErrors[_0x39df85(0xce)](_0x39df85(0xcc));const _0x456efa=new Map();for(const _0xcd9fe4 of _0x2d3c72){if(_0x456efa[_0x39df85(0xd5)](_0xcd9fe4[_0x39df85(0xe7)]))throw CliErrors[_0x39df85(0xce)](_0x39df85(0xe1)+_0xcd9fe4[_0x39df85(0xe7)]);_0x456efa[_0x39df85(0xda)](_0xcd9fe4[_0x39df85(0xe7)],_0xcd9fe4);}const _0x4ea624=[];for(const _0x3ee7c8 of _0x565b7b[_0x39df85(0xc0)]){const _0x13d945=_0x456efa[_0x39df85(0xdb)](_0x3ee7c8[_0x39df85(0xe7)]);if(!_0x13d945)throw CliErrors[_0x39df85(0xce)](_0x39df85(0xd7)+_0x3ee7c8[_0x39df85(0xe7)]);if(_0x13d945[_0x39df85(0xba)]['length']!==_0x3ee7c8[_0x39df85(0xcf)])throw CliErrors[_0x39df85(0xce)](_0x39df85(0xdf)+_0x3ee7c8[_0x39df85(0xe7)]);const _0x6baac3=bufferSha256(_0x13d945[_0x39df85(0xba)]);if(_0x6baac3!==_0x3ee7c8[_0x39df85(0xbf)])throw CliErrors[_0x39df85(0xce)]('Runtime\x20Skill\x20package\x20file\x20sha256\x20mismatch:\x20'+_0x3ee7c8['path']);_0x4ea624[_0x39df85(0xc5)]({'path':_0x3ee7c8[_0x39df85(0xe7)],'bytes':_0x13d945[_0x39df85(0xba)]});}return normalizeLocalFiles(_0x4ea624);}
@@ -1 +1 @@
1
- (function(_0x1d7d9d,_0xa8bca4){var _0x44899c=a146_0x261a,_0x2520c9=_0x1d7d9d();while(!![]){try{var _0x57cfa1=-parseInt(_0x44899c(0x1dd))/0x1*(parseInt(_0x44899c(0x1e1))/0x2)+parseInt(_0x44899c(0x1de))/0x3+parseInt(_0x44899c(0x1df))/0x4+-parseInt(_0x44899c(0x1e3))/0x5*(parseInt(_0x44899c(0x1e6))/0x6)+-parseInt(_0x44899c(0x1e5))/0x7+-parseInt(_0x44899c(0x1e2))/0x8*(parseInt(_0x44899c(0x1e0))/0x9)+parseInt(_0x44899c(0x1e4))/0xa;if(_0x57cfa1===_0xa8bca4)break;else _0x2520c9['push'](_0x2520c9['shift']());}catch(_0x4148da){_0x2520c9['push'](_0x2520c9['shift']());}}}(a146_0x2d1b,0xa38ea));export{contentHash,fileTreeHash}from'./runtime-skill-sync/hashing.js';export{linkEffectiveRuntimeSkills,linkGlobalRuntimeSkills,pruneStaleRuntimeSkillCache,pruneStaleRuntimeSkillLinks}from'./runtime-skill-sync/links.js';function a146_0x261a(_0x28ff2b,_0x5104){_0x28ff2b=_0x28ff2b-0x1dd;var _0x2d1bc4=a146_0x2d1b();var _0x261a46=_0x2d1bc4[_0x28ff2b];return _0x261a46;}export{resolveRuntimeSkillInstallTarget}from'./runtime-skill-sync/install-target.js';export{listLocalRuntimeSkills}from'./runtime-skill-sync/list-local.js';function a146_0x2d1b(){var _0x429238=['200439sWmJsP','2877207BEMADs','1375600gYNPQH','45oDzujF','12LeVPZi','1457992loNfxO','711885XqbEOY','30779330zPZzyw','6196456yPYVvb','30aVJiME'];a146_0x2d1b=function(){return _0x429238;};return a146_0x2d1b();}export{materializeRuntimeSkill,reuseMaterializedRuntimeSkill}from'./runtime-skill-sync/materialize.js';export{readMetadataIfPresent}from'./runtime-skill-sync/metadata.js';export{getRuntimeSkillCacheRoot,getRuntimeSkillDir,resolveSkillSyncPaths,runtimeAgentSkillRoots}from'./runtime-skill-sync/paths.js';export{deriveSkillCodeFromDirectory,readPushDirectory,refreshPushDirectoryMetadataFromRemote,recordPushedRuntimeSkill,resolvePushDirectoryIdentity}from'./runtime-skill-sync/push.js';export{buildSkillPackage,verifyRuntimeSkillBundle,verifyRuntimeSkillPackage}from'./runtime-skill-sync/zip-package.js';
1
+ (function(_0x531bb6,_0x2242b1){var _0x42a3b7=a146_0x3af0,_0x59296d=_0x531bb6();while(!![]){try{var _0x254e29=parseInt(_0x42a3b7(0x10f))/0x1*(parseInt(_0x42a3b7(0x113))/0x2)+parseInt(_0x42a3b7(0x110))/0x3*(-parseInt(_0x42a3b7(0x116))/0x4)+-parseInt(_0x42a3b7(0x115))/0x5+parseInt(_0x42a3b7(0x111))/0x6*(parseInt(_0x42a3b7(0x114))/0x7)+parseInt(_0x42a3b7(0x10e))/0x8+parseInt(_0x42a3b7(0x117))/0x9*(parseInt(_0x42a3b7(0x10d))/0xa)+parseInt(_0x42a3b7(0x112))/0xb;if(_0x254e29===_0x2242b1)break;else _0x59296d['push'](_0x59296d['shift']());}catch(_0xaad20b){_0x59296d['push'](_0x59296d['shift']());}}}(a146_0x3268,0xbc37f));export{contentHash,fileTreeHash}from'./runtime-skill-sync/hashing.js';export{linkEffectiveRuntimeSkills,linkGlobalRuntimeSkills,pruneStaleRuntimeSkillCache,pruneStaleRuntimeSkillLinks}from'./runtime-skill-sync/links.js';function a146_0x3af0(_0x320c26,_0x269ffd){_0x320c26=_0x320c26-0x10d;var _0x3268f7=a146_0x3268();var _0x3af01b=_0x3268f7[_0x320c26];return _0x3af01b;}export{resolveRuntimeSkillInstallTarget}from'./runtime-skill-sync/install-target.js';export{listLocalRuntimeSkills}from'./runtime-skill-sync/list-local.js';export{materializeRuntimeSkill,reuseMaterializedRuntimeSkill}from'./runtime-skill-sync/materialize.js';export{readMetadataIfPresent}from'./runtime-skill-sync/metadata.js';export{getRuntimeSkillCacheRoot,getRuntimeSkillDir,resolveSkillSyncPaths,runtimeAgentSkillRoots}from'./runtime-skill-sync/paths.js';export{deriveSkillCodeFromDirectory,readPushDirectory,refreshPushDirectoryMetadataFromRemote,recordPushedRuntimeSkill,resolvePushDirectoryIdentity}from'./runtime-skill-sync/push.js';export{buildSkillPackage,verifyRuntimeSkillBundle,verifyRuntimeSkillPackage}from'./runtime-skill-sync/zip-package.js';function a146_0x3268(){var _0x47e6ec=['488024CTJKel','1155984DUQlYZ','36LVetbi','6687654LWDNlQ','3839660WyWKSt','2BRfcGm','7ZHDUpI','6087670EbbzSk','431492zneNFz','5420673vYxTxh','10JFQSCo'];a146_0x3268=function(){return _0x47e6ec;};return a146_0x3268();}
@@ -1 +1 @@
1
- const a147_0x4f3210=a147_0x5395;(function(_0xf46760,_0x93aab0){const _0x4de9a2=a147_0x5395,_0x5c0304=_0xf46760();while(!![]){try{const _0x2efb2c=parseInt(_0x4de9a2(0x1e5))/0x1+-parseInt(_0x4de9a2(0x1ea))/0x2+-parseInt(_0x4de9a2(0x1e0))/0x3*(parseInt(_0x4de9a2(0x1e4))/0x4)+parseInt(_0x4de9a2(0x1e9))/0x5*(-parseInt(_0x4de9a2(0x1d8))/0x6)+parseInt(_0x4de9a2(0x1e6))/0x7+parseInt(_0x4de9a2(0x1d6))/0x8*(-parseInt(_0x4de9a2(0x1e2))/0x9)+parseInt(_0x4de9a2(0x1db))/0xa;if(_0x2efb2c===_0x93aab0)break;else _0x5c0304['push'](_0x5c0304['shift']());}catch(_0xe5def4){_0x5c0304['push'](_0x5c0304['shift']());}}}(a147_0x31f7,0x22c65));import{existsSync,readFileSync}from'node:fs';function a147_0x5395(_0x4a3b32,_0x420204){_0x4a3b32=_0x4a3b32-0x1d6;const _0x31f7cc=a147_0x31f7();let _0x539586=_0x31f7cc[_0x4a3b32];return _0x539586;}import{homedir}from'node:os';function a147_0x31f7(){const _0x39c758=['785526qGpTOC','skills','kind','115XNoSDD','217878iEeyzP','unverifiable','recorded','.agents','includes','unusable','utf8','object','join','map','number','\x20is\x20unreadable:\x20','version','\x20uses\x20unsupported\x20version\x20','280792HKzNPf','\x20records\x20\x22','1494cljQhY','.skill-lock.json','home','3413290fiwNLC','\x22\x20but\x20no\x20SKILL.md\x20was\x20found\x20in\x20known\x20layouts\x20','globalSkillsDirs','not-recorded','parse','735hWuoed','lockFile','36vSVsIe','absent','4408SpfJmG','213942DcRXCN'];a147_0x31f7=function(){return _0x39c758;};return a147_0x31f7();}import{join}from'node:path';export const SKILL_LOCK_RELATIVE_PATH=join(a147_0x4f3210(0x1ed),a147_0x4f3210(0x1d9));export const GLOBAL_SKILLS_DIR_RELATIVE_PATHS=[join(a147_0x4f3210(0x1ed),a147_0x4f3210(0x1e7)),join('.claude',a147_0x4f3210(0x1e7))];const SUPPORTED_LOCK_VERSIONS=[0x3];function readLockLookup(_0x129038,_0x1a1c4d){const _0x1a3f3a=a147_0x4f3210;if(!existsSync(_0x129038))return{'kind':_0x1a3f3a(0x1de)};let _0x1508a2;try{_0x1508a2=JSON[_0x1a3f3a(0x1df)](readFileSync(_0x129038,_0x1a3f3a(0x1f0)));}catch(_0x165360){return{'kind':_0x1a3f3a(0x1ef),'reason':_0x129038+_0x1a3f3a(0x1f5)+_0x165360['message']};}const _0xe4e8d7=_0x1508a2;if(typeof _0xe4e8d7?.[_0x1a3f3a(0x1f6)]!==_0x1a3f3a(0x1f4)||!SUPPORTED_LOCK_VERSIONS[_0x1a3f3a(0x1ee)](_0xe4e8d7[_0x1a3f3a(0x1f6)]))return{'kind':_0x1a3f3a(0x1ef),'reason':_0x129038+_0x1a3f3a(0x1f7)+String(_0xe4e8d7?.[_0x1a3f3a(0x1f6)])};if(!_0xe4e8d7[_0x1a3f3a(0x1e7)]||typeof _0xe4e8d7['skills']!==_0x1a3f3a(0x1f1))return{'kind':_0x1a3f3a(0x1ef),'reason':_0x129038+'\x20has\x20no\x20skills\x20map'};return _0xe4e8d7[_0x1a3f3a(0x1e7)][_0x1a1c4d]?{'kind':_0x1a3f3a(0x1ec)}:{'kind':_0x1a3f3a(0x1de)};}export function resolveInstalledSkill(_0x4a1bc3,_0x3783c3){const _0x52e48d=a147_0x4f3210,_0x318e92=_0x3783c3?.[_0x52e48d(0x1da)]??homedir(),_0x56e167=_0x3783c3?.[_0x52e48d(0x1dd)]??GLOBAL_SKILLS_DIR_RELATIVE_PATHS[_0x52e48d(0x1f3)](_0x55d82a=>join(_0x318e92,_0x55d82a)),_0x56c7df=_0x3783c3?.[_0x52e48d(0x1e1)]??join(_0x318e92,SKILL_LOCK_RELATIVE_PATH),_0x4fbeeb=_0x56e167[_0x52e48d(0x1f3)](_0x4068ce=>join(_0x4068ce,_0x4a1bc3,'SKILL.md')),_0xca2b6=_0x4fbeeb['find'](_0x44ec83=>existsSync(_0x44ec83));if(_0xca2b6)return{'state':'present','path':_0xca2b6};const _0xe220f=readLockLookup(_0x56c7df,_0x4a1bc3);if(_0xe220f[_0x52e48d(0x1e8)]==='unusable')return{'state':'unverifiable','reason':_0xe220f['reason']};if(_0xe220f[_0x52e48d(0x1e8)]===_0x52e48d(0x1ec))return{'state':_0x52e48d(0x1eb),'reason':_0x56c7df+_0x52e48d(0x1d7)+_0x4a1bc3+_0x52e48d(0x1dc)+('('+_0x4fbeeb[_0x52e48d(0x1f2)](',\x20')+')')};return{'state':_0x52e48d(0x1e3),'checked':_0x4fbeeb};}
1
+ const a147_0x35ba93=a147_0x364c;(function(_0x2c3440,_0x477cda){const _0x54c1eb=a147_0x364c,_0x3b9783=_0x2c3440();while(!![]){try{const _0xef4fe2=parseInt(_0x54c1eb(0xa2))/0x1*(-parseInt(_0x54c1eb(0xc3))/0x2)+-parseInt(_0x54c1eb(0xa5))/0x3*(parseInt(_0x54c1eb(0x9e))/0x4)+parseInt(_0x54c1eb(0xb0))/0x5*(parseInt(_0x54c1eb(0x9f))/0x6)+parseInt(_0x54c1eb(0xb6))/0x7*(-parseInt(_0x54c1eb(0xb9))/0x8)+-parseInt(_0x54c1eb(0xa9))/0x9+-parseInt(_0x54c1eb(0xa0))/0xa*(-parseInt(_0x54c1eb(0xb1))/0xb)+parseInt(_0x54c1eb(0xac))/0xc;if(_0xef4fe2===_0x477cda)break;else _0x3b9783['push'](_0x3b9783['shift']());}catch(_0x1cd71a){_0x3b9783['push'](_0x3b9783['shift']());}}}(a147_0x30f9,0x4c7cb));import{existsSync,readFileSync}from'node:fs';import{homedir}from'node:os';import{join}from'node:path';export const SKILL_LOCK_RELATIVE_PATH=join('.agents',a147_0x35ba93(0xc1));function a147_0x30f9(){const _0x28beea=['.agents','2659uJnqWI','not-recorded','\x20is\x20unreadable:\x20','168519SaftWZ','globalSkillsDirs','\x22\x20but\x20no\x20SKILL.md\x20was\x20found\x20in\x20known\x20layouts\x20','\x20records\x20\x22','1428867ODqoVJ','present','message','5103480KTiqMT','\x20has\x20no\x20skills\x20map','unusable','includes','10HBcMxe','1925143tUOCfv','lockFile','.claude','find','version','7kYeoMh','join','skills','2982264IvevuR','SKILL.md','kind','home','object','unverifiable','map','absent','.skill-lock.json','recorded','194eiQcxE','4ekksFo','625812dRFpJk','30fipqVq'];a147_0x30f9=function(){return _0x28beea;};return a147_0x30f9();}export const GLOBAL_SKILLS_DIR_RELATIVE_PATHS=[join(a147_0x35ba93(0xa1),'skills'),join(a147_0x35ba93(0xb3),'skills')];function a147_0x364c(_0x3d9889,_0x5cf69b){_0x3d9889=_0x3d9889-0x9e;const _0x30f926=a147_0x30f9();let _0x364cb3=_0x30f926[_0x3d9889];return _0x364cb3;}const SUPPORTED_LOCK_VERSIONS=[0x3];function readLockLookup(_0x479a80,_0xae0153){const _0x37dea2=a147_0x35ba93;if(!existsSync(_0x479a80))return{'kind':_0x37dea2(0xa3)};let _0x2e6508;try{_0x2e6508=JSON['parse'](readFileSync(_0x479a80,'utf8'));}catch(_0x40a596){return{'kind':_0x37dea2(0xae),'reason':_0x479a80+_0x37dea2(0xa4)+_0x40a596[_0x37dea2(0xab)]};}const _0x27f2b5=_0x2e6508;if(typeof _0x27f2b5?.['version']!=='number'||!SUPPORTED_LOCK_VERSIONS[_0x37dea2(0xaf)](_0x27f2b5['version']))return{'kind':'unusable','reason':_0x479a80+'\x20uses\x20unsupported\x20version\x20'+String(_0x27f2b5?.[_0x37dea2(0xb5)])};if(!_0x27f2b5[_0x37dea2(0xb8)]||typeof _0x27f2b5['skills']!==_0x37dea2(0xbd))return{'kind':_0x37dea2(0xae),'reason':_0x479a80+_0x37dea2(0xad)};return _0x27f2b5['skills'][_0xae0153]?{'kind':_0x37dea2(0xc2)}:{'kind':_0x37dea2(0xa3)};}export function resolveInstalledSkill(_0x73486e,_0x2775ec){const _0x3b67ff=a147_0x35ba93,_0x3baa64=_0x2775ec?.[_0x3b67ff(0xbc)]??homedir(),_0x3e8cec=_0x2775ec?.[_0x3b67ff(0xa6)]??GLOBAL_SKILLS_DIR_RELATIVE_PATHS[_0x3b67ff(0xbf)](_0x222c1d=>join(_0x3baa64,_0x222c1d)),_0x48c4f5=_0x2775ec?.[_0x3b67ff(0xb2)]??join(_0x3baa64,SKILL_LOCK_RELATIVE_PATH),_0x2b51e2=_0x3e8cec[_0x3b67ff(0xbf)](_0x6658e2=>join(_0x6658e2,_0x73486e,_0x3b67ff(0xba))),_0x4ec77e=_0x2b51e2[_0x3b67ff(0xb4)](_0x1abf0c=>existsSync(_0x1abf0c));if(_0x4ec77e)return{'state':_0x3b67ff(0xaa),'path':_0x4ec77e};const _0x58668f=readLockLookup(_0x48c4f5,_0x73486e);if(_0x58668f[_0x3b67ff(0xbb)]===_0x3b67ff(0xae))return{'state':_0x3b67ff(0xbe),'reason':_0x58668f['reason']};if(_0x58668f[_0x3b67ff(0xbb)]===_0x3b67ff(0xc2))return{'state':_0x3b67ff(0xbe),'reason':_0x48c4f5+_0x3b67ff(0xa8)+_0x73486e+_0x3b67ff(0xa7)+('('+_0x2b51e2[_0x3b67ff(0xb7)](',\x20')+')')};return{'state':_0x3b67ff(0xc0),'checked':_0x2b51e2};}
@@ -1 +1 @@
1
- (function(_0x71df3c,_0x242a0a){const _0x304e22=a148_0x2395,_0x283ff1=_0x71df3c();while(!![]){try{const _0x4aef63=-parseInt(_0x304e22(0xdf))/0x1*(-parseInt(_0x304e22(0xe3))/0x2)+parseInt(_0x304e22(0xdc))/0x3+-parseInt(_0x304e22(0xde))/0x4+-parseInt(_0x304e22(0xe1))/0x5*(-parseInt(_0x304e22(0xe2))/0x6)+-parseInt(_0x304e22(0xe4))/0x7+-parseInt(_0x304e22(0xdd))/0x8+parseInt(_0x304e22(0xe0))/0x9;if(_0x4aef63===_0x242a0a)break;else _0x283ff1['push'](_0x283ff1['shift']());}catch(_0x273fa8){_0x283ff1['push'](_0x283ff1['shift']());}}}(a148_0x1804,0xf359a));import{createJqFilter,resolveBundledJqPaths}from'@lovrabet/cli-framework';import{CliErrors}from'../errors.js';function a148_0x2395(_0x3688f4,_0x2beb30){_0x3688f4=_0x3688f4-0xdc;const _0x18040e=a148_0x1804();let _0x239501=_0x18040e[_0x3688f4];return _0x239501;}function a148_0x1804(){const _0x3b2ebf=['7931456lahgqq','5741xcCucb','20104506keeTHE','5RzylgK','8042442suhtoK','506UJjusP','3454493PQFYoM','759780waVTMI','14454792SckuGi'];a148_0x1804=function(){return _0x3b2ebf;};return a148_0x1804();}export const applyJqFilter=createJqFilter(CliErrors,{'bundledJqPaths':resolveBundledJqPaths()});
1
+ (function(_0x26f7a7,_0x6e5252){const _0x3c2c81=a148_0x4984,_0x3931e9=_0x26f7a7();while(!![]){try{const _0x3250d9=-parseInt(_0x3c2c81(0x10c))/0x1+parseInt(_0x3c2c81(0x109))/0x2+parseInt(_0x3c2c81(0x10e))/0x3+parseInt(_0x3c2c81(0x10f))/0x4*(-parseInt(_0x3c2c81(0x10d))/0x5)+parseInt(_0x3c2c81(0x10b))/0x6+parseInt(_0x3c2c81(0x108))/0x7+parseInt(_0x3c2c81(0x10a))/0x8;if(_0x3250d9===_0x6e5252)break;else _0x3931e9['push'](_0x3931e9['shift']());}catch(_0x54d5f5){_0x3931e9['push'](_0x3931e9['shift']());}}}(a148_0x5d2b,0xaeaf1));import{createJqFilter,resolveBundledJqPaths}from'@lovrabet/cli-framework';function a148_0x4984(_0x5af5a1,_0x3fc4a2){_0x5af5a1=_0x5af5a1-0x108;const _0x5d2b21=a148_0x5d2b();let _0x498461=_0x5d2b21[_0x5af5a1];return _0x498461;}function a148_0x5d2b(){const _0x54d5ec=['896270NfGQBk','25GjjNHr','372609lCSvKT','382628KlBnen','646135QMeOiZ','1626510KDumGS','5655112sGAjJB','2120448kFJDRu'];a148_0x5d2b=function(){return _0x54d5ec;};return a148_0x5d2b();}import{CliErrors}from'../errors.js';export const applyJqFilter=createJqFilter(CliErrors,{'bundledJqPaths':resolveBundledJqPaths()});