@lovrabet/lovrabet-cli 2.3.0-beta.4 → 2.3.0-beta.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 (164) hide show
  1. package/lib/cli.js +1 -1
  2. package/lib/commands/api-doc/index.js +1 -1
  3. package/lib/commands/app/cache.js +1 -1
  4. package/lib/commands/app/definitions.js +1 -1
  5. package/lib/commands/app/eligibility.js +1 -1
  6. package/lib/commands/app/mock-loader.js +1 -1
  7. package/lib/commands/app/remote-source.js +1 -1
  8. package/lib/commands/app/shared.js +1 -1
  9. package/lib/commands/app-config/get.js +1 -1
  10. package/lib/commands/app-config/index.js +1 -1
  11. package/lib/commands/artifact/index.js +1 -1
  12. package/lib/commands/auth/device.js +1 -1
  13. package/lib/commands/auth/index.js +1 -1
  14. package/lib/commands/auth/prompt.js +1 -1
  15. package/lib/commands/bff/detail.js +1 -1
  16. package/lib/commands/bff/exec.js +1 -1
  17. package/lib/commands/bff/index.js +1 -1
  18. package/lib/commands/cli-skill/index.js +1 -1
  19. package/lib/commands/common/config-policy.js +1 -1
  20. package/lib/commands/common/constraints.js +1 -1
  21. package/lib/commands/common/flags.js +1 -1
  22. package/lib/commands/common/local-file.js +1 -1
  23. package/lib/commands/config/definitions.js +1 -1
  24. package/lib/commands/config/init.js +1 -1
  25. package/lib/commands/config/shared.js +1 -1
  26. package/lib/commands/data/index.js +1 -1
  27. package/lib/commands/dataset/detail.js +1 -1
  28. package/lib/commands/dataset/index.js +1 -1
  29. package/lib/commands/dataset/list.js +1 -1
  30. package/lib/commands/dataset/sdk-doc.js +1 -1
  31. package/lib/commands/doctor.js +1 -1
  32. package/lib/commands/file/index.js +1 -1
  33. package/lib/commands/init.js +1 -1
  34. package/lib/commands/kb/index.js +1 -1
  35. package/lib/commands/logs/index.js +1 -1
  36. package/lib/commands/notification/config-list.js +1 -1
  37. package/lib/commands/notification/index.js +1 -1
  38. package/lib/commands/notification/shared.js +1 -1
  39. package/lib/commands/ocr/index.js +1 -1
  40. package/lib/commands/permit/dataset-get.js +1 -1
  41. package/lib/commands/permit/dataset-set.js +1 -1
  42. package/lib/commands/permit/index.js +1 -1
  43. package/lib/commands/permit/page-get.js +1 -1
  44. package/lib/commands/permit/page-set.js +1 -1
  45. package/lib/commands/permit/role-menus-set.js +1 -1
  46. package/lib/commands/permit/role-menus.js +1 -1
  47. package/lib/commands/permit/shared.js +1 -1
  48. package/lib/commands/personal-bff/index.js +1 -1
  49. package/lib/commands/registry.js +1 -1
  50. package/lib/commands/role/create.js +1 -1
  51. package/lib/commands/role/delete.js +1 -1
  52. package/lib/commands/role/detail.js +1 -1
  53. package/lib/commands/role/index.js +1 -1
  54. package/lib/commands/role/list.js +1 -1
  55. package/lib/commands/role/shared.js +1 -1
  56. package/lib/commands/role/update.js +1 -1
  57. package/lib/commands/role/user-add.js +1 -1
  58. package/lib/commands/role/user-remove.js +1 -1
  59. package/lib/commands/schedule/index.js +1 -1
  60. package/lib/commands/schema.js +1 -1
  61. package/lib/commands/service/dynamic.js +1 -1
  62. package/lib/commands/service/function-name-adapter.js +1 -1
  63. package/lib/commands/service/index.js +1 -1
  64. package/lib/commands/service/registry.js +1 -1
  65. package/lib/commands/skill/commands/create.js +1 -1
  66. package/lib/commands/skill/commands/diagram.js +1 -1
  67. package/lib/commands/skill/commands/install.js +1 -1
  68. package/lib/commands/skill/commands/list.js +1 -1
  69. package/lib/commands/skill/commands/push.js +1 -1
  70. package/lib/commands/skill/commands/validate.js +1 -1
  71. package/lib/commands/skill/diagram.js +1 -1
  72. package/lib/commands/skill/flags.js +1 -1
  73. package/lib/commands/skill/index.js +1 -1
  74. package/lib/commands/skill/manifest-helpers.js +1 -1
  75. package/lib/commands/skill/push-execute.js +1 -1
  76. package/lib/commands/skill/push-flow-helpers.js +1 -1
  77. package/lib/commands/skill/push-retarget.js +1 -1
  78. package/lib/commands/skill/scopes.js +1 -1
  79. package/lib/commands/skill/summary.js +1 -1
  80. package/lib/commands/skill/templates.js +1 -1
  81. package/lib/commands/skill/validate.js +1 -1
  82. package/lib/commands/sql/detail.js +1 -1
  83. package/lib/commands/sql/exec.js +1 -1
  84. package/lib/commands/sql/index.js +1 -1
  85. package/lib/commands/update.js +1 -1
  86. package/lib/commands/user-account/bind.js +1 -1
  87. package/lib/commands/user-account/index.js +1 -1
  88. package/lib/commands/workspace/index.js +1 -1
  89. package/lib/config/domain-config.js +1 -1
  90. package/lib/config/schema.js +1 -1
  91. package/lib/constant/app.js +1 -1
  92. package/lib/constant/auth-mode.js +1 -1
  93. package/lib/constant/cli.js +1 -1
  94. package/lib/constant/defaults.js +1 -1
  95. package/lib/constant/distribution.js +1 -1
  96. package/lib/constant/domain.js +1 -1
  97. package/lib/constant/env.js +1 -1
  98. package/lib/constant/output.js +1 -1
  99. package/lib/constant/product.js +1 -1
  100. package/lib/constant/region.js +1 -1
  101. package/lib/constant/risk.js +1 -1
  102. package/lib/constant/url.js +1 -1
  103. package/lib/context.js +1 -1
  104. package/lib/core/api-client.js +1 -1
  105. package/lib/core/db-resolver.js +1 -1
  106. package/lib/core/sdk-client.js +1 -1
  107. package/lib/errors.js +1 -1
  108. package/lib/framework/build-all-flags.js +1 -1
  109. package/lib/framework/dryrun.js +1 -1
  110. package/lib/framework/flags.js +1 -1
  111. package/lib/framework/help.js +1 -1
  112. package/lib/framework/index.js +1 -1
  113. package/lib/framework/output.js +1 -1
  114. package/lib/framework/preparse.js +1 -1
  115. package/lib/framework/rate-limit.js +1 -1
  116. package/lib/framework/raw-flags.js +1 -1
  117. package/lib/framework/response.js +1 -1
  118. package/lib/framework/runner-confirmation.js +1 -1
  119. package/lib/framework/runner-error.js +1 -1
  120. package/lib/framework/runner.js +1 -1
  121. package/lib/framework/schema-export.js +1 -1
  122. package/lib/framework/service-order.js +1 -1
  123. package/lib/framework/types.js +1 -1
  124. package/lib/generated/build-info.d.ts +4 -4
  125. package/lib/generated/build-info.js +1 -1
  126. package/lib/help.js +1 -1
  127. package/lib/postinstall.js +1 -1
  128. package/lib/runtime/confirmation.js +1 -1
  129. package/lib/runtime/event.js +1 -1
  130. package/lib/runtime/index.js +1 -1
  131. package/lib/runtime/queue.js +1 -1
  132. package/lib/runtime/resolve.js +1 -1
  133. package/lib/skills/builtin-skill.js +1 -1
  134. package/lib/skills/npx-skills-add.js +1 -1
  135. package/lib/skills/runtime-skill-sync/constants.js +1 -1
  136. package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
  137. package/lib/skills/runtime-skill-sync/hashing.js +1 -1
  138. package/lib/skills/runtime-skill-sync/install-target.js +1 -1
  139. package/lib/skills/runtime-skill-sync/links.js +1 -1
  140. package/lib/skills/runtime-skill-sync/list-local.js +1 -1
  141. package/lib/skills/runtime-skill-sync/local-files.js +1 -1
  142. package/lib/skills/runtime-skill-sync/materialize.js +1 -1
  143. package/lib/skills/runtime-skill-sync/metadata.js +1 -1
  144. package/lib/skills/runtime-skill-sync/paths.js +1 -1
  145. package/lib/skills/runtime-skill-sync/push.js +1 -1
  146. package/lib/skills/runtime-skill-sync/scopes.js +1 -1
  147. package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
  148. package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
  149. package/lib/skills/runtime-skill-sync.js +1 -1
  150. package/lib/skills/skill-presence.js +1 -1
  151. package/lib/utils/access-key-redaction.js +1 -1
  152. package/lib/utils/apply-jq-filter.js +1 -1
  153. package/lib/utils/cli-version-check.js +1 -1
  154. package/lib/utils/cli-version-policy.js +1 -1
  155. package/lib/utils/logger.js +1 -1
  156. package/lib/utils/lossless-json.js +1 -1
  157. package/lib/utils/params.js +1 -1
  158. package/lib/utils/platform.js +1 -1
  159. package/lib/utils/update-notice.js +1 -1
  160. package/lib/utils/version.js +1 -1
  161. package/lib/utils/write-cli-side-channel.js +1 -1
  162. package/package.json +1 -1
  163. package/skills/lovrabet/SKILL.md +1 -1
  164. package/skills/lovrabet.manifest.json +3 -3
@@ -1 +1 @@
1
- (function(_0x36fbbf,_0x568271){const _0x1054d2=a135_0x100f,_0xfd5a69=_0x36fbbf();while(!![]){try{const _0x249e4b=-parseInt(_0x1054d2(0x1d8))/0x1+-parseInt(_0x1054d2(0x1d6))/0x2*(-parseInt(_0x1054d2(0x1dc))/0x3)+-parseInt(_0x1054d2(0x1cf))/0x4+-parseInt(_0x1054d2(0x1d1))/0x5*(parseInt(_0x1054d2(0x1cc))/0x6)+-parseInt(_0x1054d2(0x1ca))/0x7+-parseInt(_0x1054d2(0x1c9))/0x8+parseInt(_0x1054d2(0x1d9))/0x9*(parseInt(_0x1054d2(0x1cb))/0xa);if(_0x249e4b===_0x568271)break;else _0xfd5a69['push'](_0xfd5a69['shift']());}catch(_0x330deb){_0xfd5a69['push'](_0xfd5a69['shift']());}}}(a135_0x3976,0xb9457));import{lstatSync,readlinkSync,realpathSync,renameSync,rmSync,writeFileSync}from'node:fs';import{dirname,isAbsolute,resolve,sep}from'node:path';import{CliErrors}from'../../errors.js';import{normalizeSkillRelativePath}from'./local-files.js';export function resolveManagedFilePath(_0x13e8fe,_0x50ea1e){const _0x249f41=a135_0x100f,_0x28fd28=normalizeSkillRelativePath(_0x50ea1e),_0x54bf75=realOrResolved(_0x13e8fe),_0x18c537=resolve(_0x54bf75,..._0x28fd28[_0x249f41(0x1ce)]('/'));if(!isPathInside(_0x18c537,_0x54bf75))throw CliErrors['validation'](_0x249f41(0x1d5)+_0x50ea1e);return ensureNoSymlinkInManagedPath(_0x54bf75,_0x28fd28),_0x18c537;}export function ensureNoSymlinkInManagedPath(_0xe7e57b,_0x4255a9){const _0x332f11=a135_0x100f;let _0x530a28=_0xe7e57b;for(const _0x43ea54 of _0x4255a9[_0x332f11(0x1ce)]('/')){_0x530a28=resolve(_0x530a28,_0x43ea54);const _0x4854fc=lstatIfPresent(_0x530a28);if(_0x4854fc?.[_0x332f11(0x1d0)]())throw CliErrors[_0x332f11(0x1d2)](_0x332f11(0x1da)+_0x4255a9);}}function a135_0x100f(_0x24fcc1,_0x1a22f6){_0x24fcc1=_0x24fcc1-0x1c9;const _0x39760e=a135_0x3976();let _0x100fc2=_0x39760e[_0x24fcc1];return _0x100fc2;}export function isDanglingSymlink(_0x46d164){const _0x5dbf11=a135_0x100f;try{return lstatSync(_0x46d164)[_0x5dbf11(0x1d0)]();}catch{return![];}}export function resolveSymlinkTarget(_0x248ffc){const _0x371a4f=readlinkSync(_0x248ffc);return isAbsolute(_0x371a4f)?_0x371a4f:resolve(dirname(_0x248ffc),_0x371a4f);}export function isPathInside(_0x4fcd8f,_0x567246){const _0x14ad35=a135_0x100f,_0x4372d0=_0x4fcd8f[_0x14ad35(0x1d7)](sep)?_0x4fcd8f:''+_0x4fcd8f+sep,_0x634526=_0x567246[_0x14ad35(0x1d7)](sep)?_0x567246:''+_0x567246+sep;return _0x4fcd8f===_0x567246||_0x4372d0[_0x14ad35(0x1d4)](_0x634526);}export function realOrResolved(_0x2a3131){try{return realpathSync(_0x2a3131);}catch{return resolve(_0x2a3131);}}export function lstatIfPresent(_0x5e6187){try{return lstatSync(_0x5e6187);}catch{return undefined;}}export function writeTextAtomic(_0x2dffc0,_0x4d0fe1,_0x4894d4){const _0x2d6541=a135_0x100f;writeBytesAtomic(_0x2dffc0,Buffer[_0x2d6541(0x1d3)](_0x4d0fe1,'utf8'),_0x4894d4);}function a135_0x3976(){const _0x464564=['970hxxWmF','validation','from','startsWith','Unsafe\x20Skill\x20file\x20path:\x20','1045284rwVGuE','endsWith','574771PICzbC','6964038rjSUjb','Refusing\x20to\x20write\x20through\x20Skill\x20symlink\x20path:\x20','stringify','3FGnoZy','5726920rGtxiQ','9026402KMuLPa','50WyZeMp','8046qBFXxM','.tmp','split','3169620CREClh','isSymbolicLink'];a135_0x3976=function(){return _0x464564;};return a135_0x3976();}export function writeBytesAtomic(_0x342c54,_0x32dd1d,_0x5488dc){const _0x1fa295=a135_0x100f,_0x13e6aa=_0x342c54+_0x1fa295(0x1cd);try{writeFileSync(_0x13e6aa,_0x32dd1d,{'mode':_0x5488dc}),renameSync(_0x13e6aa,_0x342c54);}catch(_0x3399f7){try{rmSync(_0x13e6aa,{'force':!![]});}catch{}throw _0x3399f7;}}export function writeJsonAtomic(_0x413dac,_0x4e696e){const _0x3679e3=a135_0x100f;writeTextAtomic(_0x413dac,JSON[_0x3679e3(0x1db)](_0x4e696e,null,0x2)+'\x0a',0x180);}
1
+ (function(_0xb62d3b,_0x448c4c){const _0x3d18e5=a135_0x6f73,_0x28d102=_0xb62d3b();while(!![]){try{const _0x193458=-parseInt(_0x3d18e5(0x6b))/0x1*(-parseInt(_0x3d18e5(0x73))/0x2)+parseInt(_0x3d18e5(0x71))/0x3*(-parseInt(_0x3d18e5(0x76))/0x4)+parseInt(_0x3d18e5(0x74))/0x5+parseInt(_0x3d18e5(0x7b))/0x6*(-parseInt(_0x3d18e5(0x77))/0x7)+-parseInt(_0x3d18e5(0x7e))/0x8*(parseInt(_0x3d18e5(0x6c))/0x9)+-parseInt(_0x3d18e5(0x6e))/0xa+parseInt(_0x3d18e5(0x70))/0xb*(parseInt(_0x3d18e5(0x78))/0xc);if(_0x193458===_0x448c4c)break;else _0x28d102['push'](_0x28d102['shift']());}catch(_0x1553b2){_0x28d102['push'](_0x28d102['shift']());}}}(a135_0x27a2,0x6aa49));function a135_0x27a2(){const _0xf3bbf3=['.tmp','validation','11712evGttc','isSymbolicLink','utf8','16QLUiTI','Unsafe\x20Skill\x20file\x20path:\x20','672chwiMe','226863fcsaAu','split','8472430DlRwSt','stringify','8089356rHugYx','5214igDHaD','endsWith','592Eegxrg','2965800vMAxDT','Refusing\x20to\x20write\x20through\x20Skill\x20symlink\x20path:\x20','260HTtCuK','287Rlrxqc','12kicVeI'];a135_0x27a2=function(){return _0xf3bbf3;};return a135_0x27a2();}import{lstatSync,readlinkSync,realpathSync,renameSync,rmSync,writeFileSync}from'node:fs';import{dirname,isAbsolute,resolve,sep}from'node:path';import{CliErrors}from'../../errors.js';import{normalizeSkillRelativePath}from'./local-files.js';export function resolveManagedFilePath(_0x2d4134,_0xd8fb85){const _0x43be28=a135_0x6f73,_0x4f1f80=normalizeSkillRelativePath(_0xd8fb85),_0x2110f0=realOrResolved(_0x2d4134),_0x594052=resolve(_0x2110f0,..._0x4f1f80[_0x43be28(0x6d)]('/'));if(!isPathInside(_0x594052,_0x2110f0))throw CliErrors[_0x43be28(0x7a)](_0x43be28(0x7f)+_0xd8fb85);return ensureNoSymlinkInManagedPath(_0x2110f0,_0x4f1f80),_0x594052;}export function ensureNoSymlinkInManagedPath(_0x43a383,_0x4490c0){const _0x5619f9=a135_0x6f73;let _0x1facb3=_0x43a383;for(const _0x2ecfa7 of _0x4490c0['split']('/')){_0x1facb3=resolve(_0x1facb3,_0x2ecfa7);const _0x3a8f8f=lstatIfPresent(_0x1facb3);if(_0x3a8f8f?.[_0x5619f9(0x7c)]())throw CliErrors[_0x5619f9(0x7a)](_0x5619f9(0x75)+_0x4490c0);}}function a135_0x6f73(_0x6c4b1,_0x2bd6f7){_0x6c4b1=_0x6c4b1-0x6b;const _0x27a248=a135_0x27a2();let _0x6f7395=_0x27a248[_0x6c4b1];return _0x6f7395;}export function isDanglingSymlink(_0x5fda1d){const _0x78d0af=a135_0x6f73;try{return lstatSync(_0x5fda1d)[_0x78d0af(0x7c)]();}catch{return![];}}export function resolveSymlinkTarget(_0x1d8010){const _0x58ae41=readlinkSync(_0x1d8010);return isAbsolute(_0x58ae41)?_0x58ae41:resolve(dirname(_0x1d8010),_0x58ae41);}export function isPathInside(_0x13d25a,_0x38bb00){const _0x1855a4=a135_0x6f73,_0xd285ab=_0x13d25a[_0x1855a4(0x72)](sep)?_0x13d25a:''+_0x13d25a+sep,_0x277b8e=_0x38bb00[_0x1855a4(0x72)](sep)?_0x38bb00:''+_0x38bb00+sep;return _0x13d25a===_0x38bb00||_0xd285ab['startsWith'](_0x277b8e);}export function realOrResolved(_0x323f5d){try{return realpathSync(_0x323f5d);}catch{return resolve(_0x323f5d);}}export function lstatIfPresent(_0xc25288){try{return lstatSync(_0xc25288);}catch{return undefined;}}export function writeTextAtomic(_0x41de7e,_0x134963,_0x1cf1f0){const _0x47efb3=a135_0x6f73;writeBytesAtomic(_0x41de7e,Buffer['from'](_0x134963,_0x47efb3(0x7d)),_0x1cf1f0);}export function writeBytesAtomic(_0xbe56ef,_0xb4d9f3,_0x55fd25){const _0x45240a=a135_0x6f73,_0x5a1254=_0xbe56ef+_0x45240a(0x79);try{writeFileSync(_0x5a1254,_0xb4d9f3,{'mode':_0x55fd25}),renameSync(_0x5a1254,_0xbe56ef);}catch(_0xfcdf75){try{rmSync(_0x5a1254,{'force':!![]});}catch{}throw _0xfcdf75;}}export function writeJsonAtomic(_0xa069a2,_0x54c9c8){const _0x4ce9da=a135_0x6f73;writeTextAtomic(_0xa069a2,JSON[_0x4ce9da(0x6f)](_0x54c9c8,null,0x2)+'\x0a',0x180);}
@@ -1 +1 @@
1
- (function(_0x18aed9,_0x44b179){const _0x4b2dd2=a136_0x2712,_0x41278b=_0x18aed9();while(!![]){try{const _0x1c65ac=-parseInt(_0x4b2dd2(0x9b))/0x1+parseInt(_0x4b2dd2(0x93))/0x2+-parseInt(_0x4b2dd2(0x96))/0x3+-parseInt(_0x4b2dd2(0x92))/0x4+-parseInt(_0x4b2dd2(0x9d))/0x5+-parseInt(_0x4b2dd2(0x9e))/0x6*(parseInt(_0x4b2dd2(0x95))/0x7)+parseInt(_0x4b2dd2(0x97))/0x8;if(_0x1c65ac===_0x44b179)break;else _0x41278b['push'](_0x41278b['shift']());}catch(_0x443eab){_0x41278b['push'](_0x41278b['shift']());}}}(a136_0x58c5,0xcc84f));import{createHash}from'node:crypto';function a136_0x2712(_0x36af4c,_0x1256c3){_0x36af4c=_0x36af4c-0x92;const _0x58c50c=a136_0x58c5();let _0x271209=_0x58c50c[_0x36af4c];return _0x271209;}import{fileContent,normalizeManifestFiles}from'./local-files.js';export function contentHash(_0x2f3f5d){const _0x4f6592=a136_0x2712;return createHash(_0x4f6592(0x94))[_0x4f6592(0x98)](_0x2f3f5d)[_0x4f6592(0x9a)](_0x4f6592(0x99));}function a136_0x58c5(){const _0x4601be=['29043216VBmtJB','update','hex','digest','1621051PcKKue','size','1416530pkdWwf','5401902VlHlnw','620860bxTYXO','1462110hFdvyZ','sha256','7tKvRUs','1691571owIqZs'];a136_0x58c5=function(){return _0x4601be;};return a136_0x58c5();}export function fileHash(_0x5bedae){return bufferSha256(fileContent(_0x5bedae));}export function bufferSha256(_0x37c750){const _0x946504=a136_0x2712;return createHash(_0x946504(0x94))[_0x946504(0x98)](_0x37c750)[_0x946504(0x9a)]('hex');}export function fileTreeHash(_0x4080af){const _0xd1a703=a136_0x2712,_0x109b82=createHash(_0xd1a703(0x94));for(const _0x50f0d7 of normalizeManifestFiles(_0x4080af)){_0x109b82[_0xd1a703(0x98)](_0x50f0d7['path']),_0x109b82[_0xd1a703(0x98)]('\x00'),_0x109b82[_0xd1a703(0x98)](_0x50f0d7[_0xd1a703(0x94)]),_0x109b82['update']('\x00'),_0x109b82[_0xd1a703(0x98)](String(_0x50f0d7[_0xd1a703(0x9c)])),_0x109b82[_0xd1a703(0x98)]('\x00');}return _0x109b82['digest'](_0xd1a703(0x99));}
1
+ (function(_0xd956c4,_0x513089){const _0x112338=a136_0x408c,_0xecfd63=_0xd956c4();while(!![]){try{const _0x376654=parseInt(_0x112338(0x1f0))/0x1*(parseInt(_0x112338(0x1ec))/0x2)+-parseInt(_0x112338(0x1f3))/0x3*(parseInt(_0x112338(0x1eb))/0x4)+parseInt(_0x112338(0x1f8))/0x5*(parseInt(_0x112338(0x1ee))/0x6)+parseInt(_0x112338(0x1fa))/0x7+parseInt(_0x112338(0x1f1))/0x8+-parseInt(_0x112338(0x1f4))/0x9+parseInt(_0x112338(0x1ef))/0xa*(-parseInt(_0x112338(0x1ed))/0xb);if(_0x376654===_0x513089)break;else _0xecfd63['push'](_0xecfd63['shift']());}catch(_0x1c0b05){_0xecfd63['push'](_0xecfd63['shift']());}}}(a136_0x12f3,0x4a55b));import{createHash}from'node:crypto';function a136_0x12f3(){const _0x252dee=['2381352DqfJDv','hex','182787aKmewM','81900HmaFQp','size','digest','sha256','82535NMFOFS','update','2300991Gjwnvp','4XUKoqS','6TertLT','3619XftuWB','54JZDaHn','18470EOEltQ','69074nAWgxb'];a136_0x12f3=function(){return _0x252dee;};return a136_0x12f3();}import{fileContent,normalizeManifestFiles}from'./local-files.js';export function contentHash(_0x179669){const _0x3b22f1=a136_0x408c;return createHash(_0x3b22f1(0x1f7))[_0x3b22f1(0x1f9)](_0x179669)[_0x3b22f1(0x1f6)](_0x3b22f1(0x1f2));}export function fileHash(_0x179b6c){return bufferSha256(fileContent(_0x179b6c));}export function bufferSha256(_0x396edd){const _0x11c6ff=a136_0x408c;return createHash(_0x11c6ff(0x1f7))['update'](_0x396edd)[_0x11c6ff(0x1f6)](_0x11c6ff(0x1f2));}function a136_0x408c(_0x52f6a7,_0x4fb33e){_0x52f6a7=_0x52f6a7-0x1eb;const _0x12f3d0=a136_0x12f3();let _0x408c48=_0x12f3d0[_0x52f6a7];return _0x408c48;}export function fileTreeHash(_0x3dfebc){const _0x5de42f=a136_0x408c,_0x196796=createHash(_0x5de42f(0x1f7));for(const _0x169d17 of normalizeManifestFiles(_0x3dfebc)){_0x196796['update'](_0x169d17['path']),_0x196796[_0x5de42f(0x1f9)]('\x00'),_0x196796[_0x5de42f(0x1f9)](_0x169d17[_0x5de42f(0x1f7)]),_0x196796['update']('\x00'),_0x196796[_0x5de42f(0x1f9)](String(_0x169d17[_0x5de42f(0x1f5)])),_0x196796[_0x5de42f(0x1f9)]('\x00');}return _0x196796['digest'](_0x5de42f(0x1f2));}
@@ -1 +1 @@
1
- function a137_0xf74f(_0x3829a9,_0x3caad0){_0x3829a9=_0x3829a9-0x66;const _0x25b069=a137_0x25b0();let _0xf74fe1=_0x25b069[_0x3829a9];return _0xf74fe1;}const a137_0x2ec9c9=a137_0xf74f;(function(_0x52614e,_0x438888){const _0x2894e8=a137_0xf74f,_0x189aea=_0x52614e();while(!![]){try{const _0x288067=-parseInt(_0x2894e8(0x70))/0x1+-parseInt(_0x2894e8(0x68))/0x2*(parseInt(_0x2894e8(0x69))/0x3)+parseInt(_0x2894e8(0x67))/0x4*(parseInt(_0x2894e8(0x76))/0x5)+parseInt(_0x2894e8(0x66))/0x6+-parseInt(_0x2894e8(0x72))/0x7+parseInt(_0x2894e8(0x6a))/0x8+parseInt(_0x2894e8(0x6f))/0x9;if(_0x288067===_0x438888)break;else _0x189aea['push'](_0x189aea['shift']());}catch(_0x57d192){_0x189aea['push'](_0x189aea['shift']());}}}(a137_0x25b0,0x1a049));function a137_0x25b0(){const _0x486d39=['freeze','35LgLsNn','671346kUomYk','13376Txzrbw','2sZMQlq','569982VRKfMp','18168LXzYMQ','cwd','appCode','project','.agents','3382902EjvVpR','193957oKSzQe','skills','160496ycCYGS','managedRoot','global'];a137_0x25b0=function(){return _0x486d39;};return a137_0x25b0();}import{resolve}from'node:path';import{resolveSkillSyncPaths,runtimeAgentSkillRoots,safePathSegment}from'./paths.js';export function resolveRuntimeSkillInstallTarget(_0x1ee4e5,_0x4bdbd8=a137_0x2ec9c9(0x74),_0x3ef172={}){const _0x1154a4=a137_0x2ec9c9,_0x409aa2=resolveSkillSyncPaths(_0x3ef172),_0x11b5ff=safePathSegment(_0x1ee4e5,_0x1154a4(0x6c)),_0x5afb8e=_0x4bdbd8===_0x1154a4(0x6d)?[resolve(_0x3ef172['cwd']??process[_0x1154a4(0x6b)](),_0x1154a4(0x6e),_0x1154a4(0x71))]:runtimeAgentSkillRoots(_0x409aa2);return Object[_0x1154a4(0x75)]({'scope':_0x4bdbd8,'appCode':_0x11b5ff,'skillRoots':Object[_0x1154a4(0x75)](_0x5afb8e),'managedRoot':_0x409aa2[_0x1154a4(0x73)]});}
1
+ const a137_0x4b9e7d=a137_0x396f;(function(_0x7a03ff,_0x4b30cb){const _0x5b237e=a137_0x396f,_0x172410=_0x7a03ff();while(!![]){try{const _0xecc2f7=parseInt(_0x5b237e(0x1cd))/0x1+-parseInt(_0x5b237e(0x1d9))/0x2*(parseInt(_0x5b237e(0x1cc))/0x3)+-parseInt(_0x5b237e(0x1d1))/0x4*(parseInt(_0x5b237e(0x1db))/0x5)+-parseInt(_0x5b237e(0x1d4))/0x6+-parseInt(_0x5b237e(0x1d2))/0x7*(-parseInt(_0x5b237e(0x1cb))/0x8)+parseInt(_0x5b237e(0x1d8))/0x9*(parseInt(_0x5b237e(0x1d5))/0xa)+parseInt(_0x5b237e(0x1d3))/0xb*(-parseInt(_0x5b237e(0x1d7))/0xc);if(_0xecc2f7===_0x4b30cb)break;else _0x172410['push'](_0x172410['shift']());}catch(_0x3f93d0){_0x172410['push'](_0x172410['shift']());}}}(a137_0x9140,0x3c54a));function a137_0x9140(){const _0x17efeb=['project','global','107552HmCmQx','53259ibRwye','402258htJuyv','.agents','cwd','skills','733508KOxzVa','21kZAWsj','132YkzsUf','1752366WPIskJ','4165370iqCWVN','freeze','83316AXdQGs','9NlvVzA','6gfbAMJ','appCode','5fpgKwk'];a137_0x9140=function(){return _0x17efeb;};return a137_0x9140();}import{resolve}from'node:path';import{resolveSkillSyncPaths,runtimeAgentSkillRoots,safePathSegment}from'./paths.js';function a137_0x396f(_0x2bd6c4,_0x775fcf){_0x2bd6c4=_0x2bd6c4-0x1c9;const _0x9140f3=a137_0x9140();let _0x396f7e=_0x9140f3[_0x2bd6c4];return _0x396f7e;}export function resolveRuntimeSkillInstallTarget(_0x3b4b17,_0x1ee6e3=a137_0x4b9e7d(0x1ca),_0xa31441={}){const _0x5dbb02=a137_0x4b9e7d,_0x59e1dd=resolveSkillSyncPaths(_0xa31441),_0x52e6e6=safePathSegment(_0x3b4b17,_0x5dbb02(0x1da)),_0x3b2125=_0x1ee6e3===_0x5dbb02(0x1c9)?[resolve(_0xa31441['cwd']??process[_0x5dbb02(0x1cf)](),_0x5dbb02(0x1ce),_0x5dbb02(0x1d0))]:runtimeAgentSkillRoots(_0x59e1dd);return Object[_0x5dbb02(0x1d6)]({'scope':_0x1ee6e3,'appCode':_0x52e6e6,'skillRoots':Object[_0x5dbb02(0x1d6)](_0x3b2125),'managedRoot':_0x59e1dd['managedRoot']});}
@@ -1 +1 @@
1
- const a138_0x2c9d85=a138_0x41db;(function(_0x10dc5b,_0x28589a){const _0x4a4d81=a138_0x41db,_0x5a7c7c=_0x10dc5b();while(!![]){try{const _0x15345e=parseInt(_0x4a4d81(0xc5))/0x1*(-parseInt(_0x4a4d81(0xe2))/0x2)+parseInt(_0x4a4d81(0xdb))/0x3*(parseInt(_0x4a4d81(0xc6))/0x4)+parseInt(_0x4a4d81(0xb2))/0x5+parseInt(_0x4a4d81(0xb1))/0x6+parseInt(_0x4a4d81(0xb0))/0x7+-parseInt(_0x4a4d81(0xd8))/0x8+-parseInt(_0x4a4d81(0xbf))/0x9;if(_0x15345e===_0x28589a)break;else _0x5a7c7c['push'](_0x5a7c7c['shift']());}catch(_0x5edea7){_0x5a7c7c['push'](_0x5a7c7c['shift']());}}}(a138_0x37df,0x247bb));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';function a138_0x41db(_0x3fd8eb,_0x26ff95){_0x3fd8eb=_0x3fd8eb-0xae;const _0x37df63=a138_0x37df();let _0x41db56=_0x37df63[_0x3fd8eb];return _0x41db56;}import{basename,dirname,resolve}from'node:path';import a138_0x4340d7 from'fs-extra';function a138_0x37df(){const _0xd99389=['map','agentsSkillsDir','set','project','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20','name','removed','skipped','102543iitLTI','1343778Nhghtz','1241015eIRKvK','managedRoot','updated','protectedLinkRoots','contentHash','company','secret-retriever','lovrabet','Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20','length','skillCode','unchanged','filter','1944450xlhORk','validation','metadata-mismatch','pruneSkillCodes','skill','activeSkillCodes','28229DLQvqa','48548ThibSu','Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20','dir','Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20','Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20','startsWith','get','Refusing\x20to\x20copy\x20Skill\x20symlink:\x20','env','push','trim','created','scopes','appCode','has','accessKey','metadataPath','Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20','1137544QSUdTs','builtin','linked-from-protected-root','54LUoDwz','scope','skillRoots','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20','not-managed-symlink','runtime-observe','isDirectory','14zOjvMQ','isSymbolicLink'];a138_0x37df=function(){return _0xd99389;};return a138_0x37df();}import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';import{isDanglingSymlink,isPathInside,lstatIfPresent,realOrResolved,resolveSymlinkTarget}from'./fs-utils.js';import{readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillCacheRoot,resolveSkillSyncPaths,safePathSegment}from'./paths.js';const {copySync,ensureDirSync,removeSync}=a138_0x4340d7,RESERVED_PROJECT_SKILL_CODES=new Set([a138_0x2c9d85(0xb9),a138_0x2c9d85(0xe0),a138_0x2c9d85(0xb8)]);export function linkEffectiveRuntimeSkills(_0x4b4d3d,_0x5309bd){const _0x26913d=a138_0x2c9d85,_0x5bec09=new Map();for(const _0x57ab13 of _0x4b4d3d){const _0x4cb143=_0x57ab13[_0x26913d(0xc3)][_0x26913d(0xbc)];if(!_0x4cb143)continue;const _0x15c107=_0x5bec09[_0x26913d(0xcc)](_0x4cb143);(!_0x15c107||_0x57ab13[_0x26913d(0xdc)]==='personal')&&_0x5bec09[_0x26913d(0xe6)](_0x4cb143,_0x57ab13);}const _0x3c099e=[];for(const _0x5d90f4 of _0x5bec09['values']()){const _0x5502d4=requireSkillCode(_0x5d90f4[_0x26913d(0xc3)]),_0x29a638=readMetadataIfPresent(_0x5d90f4[_0x26913d(0xd6)]);if(_0x29a638?.[_0x26913d(0xd3)]!==_0x5309bd[_0x26913d(0xd3)]||_0x29a638[_0x26913d(0xbc)]!==_0x5502d4)throw CliErrors[_0x26913d(0xc0)](_0x26913d(0xba)+_0x5309bd[_0x26913d(0xd3)]+':\x20'+_0x5d90f4[_0x26913d(0xd6)]);const _0x5cb583=runtimeSkillLinkName(_0x5309bd,_0x5502d4);for(const _0x5daa6c of _0x5309bd[_0x26913d(0xdd)]){_0x3c099e[_0x26913d(0xcf)](ensureManagedSymlink(resolve(_0x5daa6c,_0x5cb583),_0x5d90f4['dir'],_0x5309bd,_0x5502d4));}}return _0x3c099e;}export function pruneStaleRuntimeSkillLinks(_0x5e8e3b,_0x501560,_0x204f64){const _0x192118=a138_0x2c9d85,_0x12b56a=new Set([..._0x501560]['map'](_0x1b7582=>_0x1b7582[_0x192118(0xd0)]())[_0x192118(0xbe)](Boolean)),_0x4efac6=_0x204f64?new Set([..._0x204f64]['map'](_0x14242e=>_0x14242e['trim']())['filter'](Boolean)):undefined,_0x5e4f75=[];for(const _0x288cf8 of _0x5e8e3b[_0x192118(0xdd)]){for(const _0x2b826f of managedTargetSkillLinkPaths(_0x288cf8,_0x5e8e3b)){const _0x3ea09b=runtimeSkillCodeFromLink(_0x5e8e3b,_0x2b826f);if(_0x4efac6&&!_0x4efac6[_0x192118(0xd4)](_0x3ea09b))continue;if(_0x12b56a[_0x192118(0xd4)](_0x3ea09b))continue;_0x5e4f75[_0x192118(0xcf)](removeManagedSkillLink(_0x2b826f,_0x5e8e3b,_0x3ea09b));}}return _0x5e4f75;}export function pruneStaleRuntimeSkillCache(_0x650e53,_0x203720={}){const _0x57db13=a138_0x2c9d85,_0x492b46=new Set([..._0x650e53[_0x57db13(0xc4)]][_0x57db13(0xe4)](_0x554bd5=>_0x554bd5['trim']())['filter'](Boolean)),_0x209c4b=_0x650e53[_0x57db13(0xc2)]?new Set([..._0x650e53[_0x57db13(0xc2)]][_0x57db13(0xe4)](_0x4254a3=>_0x4254a3[_0x57db13(0xd0)]())[_0x57db13(0xbe)](Boolean)):undefined,_0x571a25=_0x650e53[_0x57db13(0xd2)]??['personal',_0x57db13(0xb7)],_0x15b721=resolve(getRuntimeSkillCacheRoot(_0x650e53[_0x57db13(0xce)],_0x650e53[_0x57db13(0xd5)],_0x203720),safePathSegment(_0x650e53[_0x57db13(0xd3)],_0x57db13(0xd3))),_0x6434ba=[];for(const _0xda2162 of _0x571a25){const _0x45c8ab=resolve(_0x15b721,_0xda2162);if(!existsSync(_0x45c8ab))continue;for(const _0x135848 of readdirSync(_0x45c8ab,{'withFileTypes':!![]})){if(!_0x135848['isDirectory']())continue;const _0x23c706=_0x135848[_0x57db13(0xea)];if(_0x209c4b&&!_0x209c4b[_0x57db13(0xd4)](_0x23c706))continue;if(_0x492b46[_0x57db13(0xd4)](_0x23c706))continue;const _0x5e6be2=resolve(_0x45c8ab,_0x23c706),_0xae8d63=readMetadataIfPresent(resolve(_0x5e6be2,METADATA_FILE));if(_0xae8d63?.[_0x57db13(0xd3)]!==_0x650e53[_0x57db13(0xd3)]||_0xae8d63[_0x57db13(0xdc)]!==_0xda2162||_0xae8d63['skillCode']!==_0x23c706){_0x6434ba[_0x57db13(0xcf)]({'path':_0x5e6be2,'action':_0x57db13(0xaf),'reason':'metadata-mismatch'});continue;}if(isLinkedFromAnyRoot(_0x5e6be2,_0x650e53[_0x57db13(0xb5)]??[])){_0x6434ba['push']({'path':_0x5e6be2,'action':'skipped','reason':_0x57db13(0xda)});continue;}removeSync(_0x5e6be2),_0x6434ba[_0x57db13(0xcf)]({'path':_0x5e6be2,'action':_0x57db13(0xae)});}}return _0x6434ba;}export function linkGlobalRuntimeSkills(_0x1618fb,_0x43b98d={}){const _0xbd3c98=a138_0x2c9d85,_0x4adb0c=resolveSkillSyncPaths(_0x43b98d),_0x4b24c2=[];for(const _0x278df2 of _0x1618fb){if(_0x278df2['scope']!==_0xbd3c98(0xd9))throw CliErrors[_0xbd3c98(0xc0)](_0xbd3c98(0xe8)+_0x278df2[_0xbd3c98(0xdc)]);const _0x2d99a8=requireSkillCode(_0x278df2[_0xbd3c98(0xc3)]),_0x2f2fd1=copyManagedSkillDirectory(_0x278df2['dir'],resolve(_0x4adb0c[_0xbd3c98(0xe5)],_0x2d99a8));_0x4b24c2[_0xbd3c98(0xcf)]({..._0x2f2fd1,'contentHash':_0x278df2[_0xbd3c98(0xb6)]});}return _0x4b24c2;}function ensureManagedSymlink(_0x28f051,_0x48971d,_0x2cdcc0,_0x4f84e2){const _0x1754b4=a138_0x2c9d85;mkdirSync(dirname(_0x28f051),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x28f051)||isDanglingSymlink(_0x28f051)){const _0x3fe0a7=lstatSync(_0x28f051);if(!_0x3fe0a7[_0x1754b4(0xe3)]())throw CliErrors[_0x1754b4(0xc0)](_0x1754b4(0xd7)+_0x28f051);const _0x3d1e45=resolveSymlinkTarget(_0x28f051);if(!isPathInside(realOrResolved(_0x3d1e45),realOrResolved(_0x2cdcc0[_0x1754b4(0xb3)])))throw CliErrors[_0x1754b4(0xc0)](_0x1754b4(0xc9)+_0x28f051);if(realOrResolved(_0x3d1e45)===realOrResolved(_0x48971d))return{'path':_0x28f051,'target':_0x48971d,'action':'unchanged'};const _0x11bbdb=readMetadataIfPresent(resolve(_0x3d1e45,METADATA_FILE));if(_0x2cdcc0[_0x1754b4(0xdc)]===_0x1754b4(0xe7)&&(_0x11bbdb?.['appCode']!==_0x2cdcc0[_0x1754b4(0xd3)]||_0x11bbdb['skillCode']!==_0x4f84e2))throw CliErrors[_0x1754b4(0xc0)](_0x1754b4(0xc7)+_0x28f051);return unlinkSync(_0x28f051),symlinkSync(_0x48971d,_0x28f051,_0x1754b4(0xc8)),{'path':_0x28f051,'target':_0x48971d,'action':_0x1754b4(0xb4)};}return symlinkSync(_0x48971d,_0x28f051,_0x1754b4(0xc8)),{'path':_0x28f051,'target':_0x48971d,'action':_0x1754b4(0xd1)};}function managedTargetSkillLinkPaths(_0x4bdaf4,_0x4227eb){const _0x3bf48b=a138_0x2c9d85;if(!existsSync(_0x4bdaf4))return[];const _0x367d4d=_0x4227eb[_0x3bf48b(0xd3)]+'--';return readdirSync(_0x4bdaf4,{'withFileTypes':!![]})[_0x3bf48b(0xbe)](_0x1331e4=>_0x4227eb[_0x3bf48b(0xdc)]===_0x3bf48b(0xe7)||_0x1331e4[_0x3bf48b(0xea)][_0x3bf48b(0xcb)](_0x367d4d))['map'](_0x1f5d3c=>resolve(_0x4bdaf4,_0x1f5d3c[_0x3bf48b(0xea)]));}function removeManagedSkillLink(_0x11f6f6,_0x521651,_0x47d0d4){const _0x544335=a138_0x2c9d85,_0x105681=lstatIfPresent(_0x11f6f6);if(!_0x105681?.[_0x544335(0xe3)]())return{'path':_0x11f6f6,'action':'skipped','reason':_0x544335(0xdf)};const _0x539eee=resolveSymlinkTarget(_0x11f6f6);if(!isPathInside(realOrResolved(_0x539eee),realOrResolved(_0x521651[_0x544335(0xb3)])))return{'path':_0x11f6f6,'action':_0x544335(0xaf),'reason':'external-symlink'};const _0xf03d90=readMetadataIfPresent(resolve(_0x539eee,METADATA_FILE));if(_0x521651[_0x544335(0xdc)]===_0x544335(0xe7)&&(_0xf03d90?.[_0x544335(0xd3)]!==_0x521651[_0x544335(0xd3)]||_0xf03d90['skillCode']!==_0x47d0d4))return{'path':_0x11f6f6,'action':_0x544335(0xaf),'reason':_0x544335(0xc1)};return unlinkSync(_0x11f6f6),{'path':_0x11f6f6,'action':'removed'};}function isLinkedFromAnyRoot(_0x48f916,_0x371fe6){const _0x56deaf=a138_0x2c9d85,_0x1cf923=realOrResolved(_0x48f916);for(const _0x297c8d of _0x371fe6){if(!existsSync(_0x297c8d))continue;for(const _0x1d523c of readdirSync(_0x297c8d,{'withFileTypes':!![]})){if(!_0x1d523c[_0x56deaf(0xe3)]())continue;const _0x3f0049=resolve(_0x297c8d,_0x1d523c[_0x56deaf(0xea)]);if(realOrResolved(resolveSymlinkTarget(_0x3f0049))===_0x1cf923)return!![];}}return![];}function runtimeSkillLinkName(_0x44433d,_0x287763){const _0x2c7032=a138_0x2c9d85,_0x4249f7=safePathSegment(_0x287763,'skillCode');if(_0x44433d[_0x2c7032(0xdc)]==='project'&&RESERVED_PROJECT_SKILL_CODES[_0x2c7032(0xd4)](_0x4249f7))throw CliErrors[_0x2c7032(0xc0)](_0x2c7032(0xe9)+_0x4249f7);return _0x44433d['scope']==='project'?_0x4249f7:_0x44433d['appCode']+'--'+_0x4249f7;}function runtimeSkillCodeFromLink(_0x5f2ee9,_0x193b33){const _0x4cffd4=a138_0x2c9d85,_0xd13829=basename(_0x193b33);return _0x5f2ee9[_0x4cffd4(0xdc)]===_0x4cffd4(0xe7)?_0xd13829:_0xd13829['slice']((_0x5f2ee9[_0x4cffd4(0xd3)]+'--')[_0x4cffd4(0xbb)]);}export function copyManagedSkillDirectory(_0x3fb176,_0x470e6e){const _0x5a8a09=a138_0x2c9d85,_0xe6ed8=resolve(_0x470e6e,METADATA_FILE),_0x3a25bb=existsSync(_0x470e6e);if(_0x3a25bb){const _0x3fe681=lstatSync(_0x470e6e);if(_0x3fe681[_0x5a8a09(0xe3)]())throw CliErrors[_0x5a8a09(0xc0)]('Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20'+_0x470e6e);if(!_0x3fe681[_0x5a8a09(0xe1)]())throw CliErrors[_0x5a8a09(0xc0)](_0x5a8a09(0xca)+_0x470e6e);const _0xc8a8a=readMetadataIfPresent(_0xe6ed8);if(_0xc8a8a?.[_0x5a8a09(0xdc)]!=='builtin')throw CliErrors[_0x5a8a09(0xc0)](_0x5a8a09(0xde)+_0x470e6e);}ensureDirSync(dirname(_0x470e6e));const _0x3ac991=_0x3a25bb?readMetadataIfPresent(_0xe6ed8)?.[_0x5a8a09(0xb6)]:undefined,_0x27acd3=readMetadataIfPresent(resolve(_0x3fb176,METADATA_FILE))?.[_0x5a8a09(0xb6)];return _0x3a25bb&&removeSync(_0x470e6e),copySkillDirectory(_0x3fb176,_0x470e6e),{'path':_0x470e6e,'target':_0x3fb176,'action':!_0x3a25bb?_0x5a8a09(0xd1):_0x3ac991===_0x27acd3?_0x5a8a09(0xbd):_0x5a8a09(0xb4)};}function copySkillDirectory(_0x45709f,_0x55c376){copySync(_0x45709f,_0x55c376,{'dereference':![],'overwrite':!![],'filter'(_0x164390){const _0x5f492e=a138_0x41db;if(lstatSync(_0x164390)[_0x5f492e(0xe3)]())throw CliErrors[_0x5f492e(0xc0)](_0x5f492e(0xcd)+_0x164390);return!![];}});}
1
+ const a138_0x107c34=a138_0x5ac8;(function(_0x1a2693,_0x27982c){const _0x19cf36=a138_0x5ac8,_0x16a317=_0x1a2693();while(!![]){try{const _0x42e864=parseInt(_0x19cf36(0x16b))/0x1*(parseInt(_0x19cf36(0x169))/0x2)+parseInt(_0x19cf36(0x16d))/0x3*(parseInt(_0x19cf36(0x192))/0x4)+parseInt(_0x19cf36(0x17b))/0x5+parseInt(_0x19cf36(0x18d))/0x6+parseInt(_0x19cf36(0x172))/0x7*(-parseInt(_0x19cf36(0x183))/0x8)+parseInt(_0x19cf36(0x185))/0x9+-parseInt(_0x19cf36(0x189))/0xa;if(_0x42e864===_0x27982c)break;else _0x16a317['push'](_0x16a317['shift']());}catch(_0x1158b6){_0x16a317['push'](_0x16a317['shift']());}}}(a138_0x10cb,0x2f79b));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';function a138_0x10cb(){const _0x235c27=['skillCode','personal','contentHash','external-symlink','skipped','1136795oBTups','filter','removed','push','runtime-observe','not-managed-symlink','Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20','dir','1032SebeWT','get','3151827PRcmic','accessKey','pruneSkillCodes','scope','8143530peaIOg','trim','validation','appCode','267534oNxFCZ','set','created','slice','name','1367948EZnWaG','unchanged','updated','metadata-mismatch','Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20','map','builtin','has','7934RwKivr','project','31hTkLce','isSymbolicLink','3AbidRD','isDirectory','company','Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20','skill','4249JyhfiL','managedRoot','Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20','metadataPath'];a138_0x10cb=function(){return _0x235c27;};return a138_0x10cb();}function a138_0x5ac8(_0x3d564c,_0x430e42){_0x3d564c=_0x3d564c-0x162;const _0x10cb01=a138_0x10cb();let _0x5ac898=_0x10cb01[_0x3d564c];return _0x5ac898;}import{basename,dirname,resolve}from'node:path';import a138_0x1ef180 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}=a138_0x1ef180,RESERVED_PROJECT_SKILL_CODES=new Set(['lovrabet',a138_0x107c34(0x17f),'secret-retriever']);export function linkEffectiveRuntimeSkills(_0x2ca1b7,_0x48def2){const _0x4e8662=a138_0x107c34,_0x16863a=new Map();for(const _0x9b9297 of _0x2ca1b7){const _0x39af52=_0x9b9297[_0x4e8662(0x171)]['skillCode'];if(!_0x39af52)continue;const _0x58c1a9=_0x16863a[_0x4e8662(0x184)](_0x39af52);(!_0x58c1a9||_0x9b9297['scope']===_0x4e8662(0x177))&&_0x16863a[_0x4e8662(0x18e)](_0x39af52,_0x9b9297);}const _0x21c0c1=[];for(const _0x48d72e of _0x16863a['values']()){const _0x109501=requireSkillCode(_0x48d72e[_0x4e8662(0x171)]),_0x224295=readMetadataIfPresent(_0x48d72e['metadataPath']);if(_0x224295?.[_0x4e8662(0x18c)]!==_0x48def2[_0x4e8662(0x18c)]||_0x224295[_0x4e8662(0x176)]!==_0x109501)throw CliErrors[_0x4e8662(0x18b)]('Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20'+_0x48def2[_0x4e8662(0x18c)]+':\x20'+_0x48d72e[_0x4e8662(0x175)]);const _0x4fa0a6=runtimeSkillLinkName(_0x48def2,_0x109501);for(const _0x1c2250 of _0x48def2['skillRoots']){_0x21c0c1[_0x4e8662(0x17e)](ensureManagedSymlink(resolve(_0x1c2250,_0x4fa0a6),_0x48d72e[_0x4e8662(0x182)],_0x48def2,_0x109501));}}return _0x21c0c1;}export function pruneStaleRuntimeSkillLinks(_0x39e0b7,_0x2ed007,_0x59b89f){const _0x363b9a=a138_0x107c34,_0x284860=new Set([..._0x2ed007][_0x363b9a(0x166)](_0x4107ad=>_0x4107ad[_0x363b9a(0x18a)]())[_0x363b9a(0x17c)](Boolean)),_0x1da40a=_0x59b89f?new Set([..._0x59b89f][_0x363b9a(0x166)](_0x433ec5=>_0x433ec5[_0x363b9a(0x18a)]())[_0x363b9a(0x17c)](Boolean)):undefined,_0x391c4f=[];for(const _0x34d844 of _0x39e0b7['skillRoots']){for(const _0x20e54d of managedTargetSkillLinkPaths(_0x34d844,_0x39e0b7)){const _0x1872b9=runtimeSkillCodeFromLink(_0x39e0b7,_0x20e54d);if(_0x1da40a&&!_0x1da40a['has'](_0x1872b9))continue;if(_0x284860[_0x363b9a(0x168)](_0x1872b9))continue;_0x391c4f[_0x363b9a(0x17e)](removeManagedSkillLink(_0x20e54d,_0x39e0b7,_0x1872b9));}}return _0x391c4f;}export function pruneStaleRuntimeSkillCache(_0x34dc8e,_0x44126b={}){const _0x25f615=a138_0x107c34,_0x5ed94c=new Set([..._0x34dc8e['activeSkillCodes']][_0x25f615(0x166)](_0x3c1f4f=>_0x3c1f4f[_0x25f615(0x18a)]())[_0x25f615(0x17c)](Boolean)),_0x5ed836=_0x34dc8e['pruneSkillCodes']?new Set([..._0x34dc8e[_0x25f615(0x187)]][_0x25f615(0x166)](_0x530588=>_0x530588[_0x25f615(0x18a)]())[_0x25f615(0x17c)](Boolean)):undefined,_0x3f4b06=_0x34dc8e['scopes']??['personal',_0x25f615(0x16f)],_0x55b6ab=resolve(getRuntimeSkillCacheRoot(_0x34dc8e['env'],_0x34dc8e[_0x25f615(0x186)],_0x44126b),safePathSegment(_0x34dc8e['appCode'],_0x25f615(0x18c))),_0x4f0d24=[];for(const _0x3e1266 of _0x3f4b06){const _0x1c1ebd=resolve(_0x55b6ab,_0x3e1266);if(!existsSync(_0x1c1ebd))continue;for(const _0x4610b2 of readdirSync(_0x1c1ebd,{'withFileTypes':!![]})){if(!_0x4610b2[_0x25f615(0x16e)]())continue;const _0x172912=_0x4610b2[_0x25f615(0x191)];if(_0x5ed836&&!_0x5ed836['has'](_0x172912))continue;if(_0x5ed94c[_0x25f615(0x168)](_0x172912))continue;const _0x39ea0a=resolve(_0x1c1ebd,_0x172912),_0x140f5f=readMetadataIfPresent(resolve(_0x39ea0a,METADATA_FILE));if(_0x140f5f?.[_0x25f615(0x18c)]!==_0x34dc8e[_0x25f615(0x18c)]||_0x140f5f[_0x25f615(0x188)]!==_0x3e1266||_0x140f5f[_0x25f615(0x176)]!==_0x172912){_0x4f0d24[_0x25f615(0x17e)]({'path':_0x39ea0a,'action':'skipped','reason':_0x25f615(0x164)});continue;}if(isLinkedFromAnyRoot(_0x39ea0a,_0x34dc8e['protectedLinkRoots']??[])){_0x4f0d24['push']({'path':_0x39ea0a,'action':_0x25f615(0x17a),'reason':'linked-from-protected-root'});continue;}removeSync(_0x39ea0a),_0x4f0d24[_0x25f615(0x17e)]({'path':_0x39ea0a,'action':_0x25f615(0x17d)});}}return _0x4f0d24;}export function linkGlobalRuntimeSkills(_0x4c53c5,_0x507a2e={}){const _0x108659=a138_0x107c34,_0x56454d=resolveSkillSyncPaths(_0x507a2e),_0xd5b4=[];for(const _0x32905a of _0x4c53c5){if(_0x32905a[_0x108659(0x188)]!==_0x108659(0x167))throw CliErrors[_0x108659(0x18b)]('Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20'+_0x32905a[_0x108659(0x188)]);const _0x2f8426=requireSkillCode(_0x32905a[_0x108659(0x171)]),_0x361bd3=copyManagedSkillDirectory(_0x32905a['dir'],resolve(_0x56454d['agentsSkillsDir'],_0x2f8426));_0xd5b4['push']({..._0x361bd3,'contentHash':_0x32905a[_0x108659(0x178)]});}return _0xd5b4;}function ensureManagedSymlink(_0x3528a1,_0x50221d,_0x18ccdf,_0x2dd8f9){const _0x309fc3=a138_0x107c34;mkdirSync(dirname(_0x3528a1),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x3528a1)||isDanglingSymlink(_0x3528a1)){const _0x2634f7=lstatSync(_0x3528a1);if(!_0x2634f7[_0x309fc3(0x16c)]())throw CliErrors['validation']('Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20'+_0x3528a1);const _0x41c430=resolveSymlinkTarget(_0x3528a1);if(!isPathInside(realOrResolved(_0x41c430),realOrResolved(_0x18ccdf[_0x309fc3(0x173)])))throw CliErrors['validation'](_0x309fc3(0x165)+_0x3528a1);if(realOrResolved(_0x41c430)===realOrResolved(_0x50221d))return{'path':_0x3528a1,'target':_0x50221d,'action':_0x309fc3(0x162)};const _0x329e82=readMetadataIfPresent(resolve(_0x41c430,METADATA_FILE));if(_0x18ccdf[_0x309fc3(0x188)]==='project'&&(_0x329e82?.[_0x309fc3(0x18c)]!==_0x18ccdf[_0x309fc3(0x18c)]||_0x329e82['skillCode']!==_0x2dd8f9))throw CliErrors['validation'](_0x309fc3(0x170)+_0x3528a1);return unlinkSync(_0x3528a1),symlinkSync(_0x50221d,_0x3528a1,'dir'),{'path':_0x3528a1,'target':_0x50221d,'action':_0x309fc3(0x163)};}return symlinkSync(_0x50221d,_0x3528a1,'dir'),{'path':_0x3528a1,'target':_0x50221d,'action':_0x309fc3(0x18f)};}function managedTargetSkillLinkPaths(_0x1b7e7e,_0x797ec0){const _0x2cf637=a138_0x107c34;if(!existsSync(_0x1b7e7e))return[];const _0xed430c=_0x797ec0[_0x2cf637(0x18c)]+'--';return readdirSync(_0x1b7e7e,{'withFileTypes':!![]})['filter'](_0x24860d=>_0x797ec0['scope']===_0x2cf637(0x16a)||_0x24860d[_0x2cf637(0x191)]['startsWith'](_0xed430c))[_0x2cf637(0x166)](_0x40ffec=>resolve(_0x1b7e7e,_0x40ffec[_0x2cf637(0x191)]));}function removeManagedSkillLink(_0x5510db,_0x24fac2,_0x3e6ba9){const _0x1cd3be=a138_0x107c34,_0x3d914c=lstatIfPresent(_0x5510db);if(!_0x3d914c?.[_0x1cd3be(0x16c)]())return{'path':_0x5510db,'action':'skipped','reason':_0x1cd3be(0x180)};const _0x30ae53=resolveSymlinkTarget(_0x5510db);if(!isPathInside(realOrResolved(_0x30ae53),realOrResolved(_0x24fac2[_0x1cd3be(0x173)])))return{'path':_0x5510db,'action':_0x1cd3be(0x17a),'reason':_0x1cd3be(0x179)};const _0x3702f5=readMetadataIfPresent(resolve(_0x30ae53,METADATA_FILE));if(_0x24fac2[_0x1cd3be(0x188)]===_0x1cd3be(0x16a)&&(_0x3702f5?.['appCode']!==_0x24fac2[_0x1cd3be(0x18c)]||_0x3702f5[_0x1cd3be(0x176)]!==_0x3e6ba9))return{'path':_0x5510db,'action':_0x1cd3be(0x17a),'reason':'metadata-mismatch'};return unlinkSync(_0x5510db),{'path':_0x5510db,'action':_0x1cd3be(0x17d)};}function isLinkedFromAnyRoot(_0x1193c1,_0x130afc){const _0x108393=realOrResolved(_0x1193c1);for(const _0x33965e of _0x130afc){if(!existsSync(_0x33965e))continue;for(const _0x5de992 of readdirSync(_0x33965e,{'withFileTypes':!![]})){if(!_0x5de992['isSymbolicLink']())continue;const _0x86df22=resolve(_0x33965e,_0x5de992['name']);if(realOrResolved(resolveSymlinkTarget(_0x86df22))===_0x108393)return!![];}}return![];}function runtimeSkillLinkName(_0x1bb97b,_0x308ecc){const _0x33b204=a138_0x107c34,_0x24f0fa=safePathSegment(_0x308ecc,_0x33b204(0x176));if(_0x1bb97b['scope']==='project'&&RESERVED_PROJECT_SKILL_CODES[_0x33b204(0x168)](_0x24f0fa))throw CliErrors[_0x33b204(0x18b)]('Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20'+_0x24f0fa);return _0x1bb97b[_0x33b204(0x188)]==='project'?_0x24f0fa:_0x1bb97b['appCode']+'--'+_0x24f0fa;}function runtimeSkillCodeFromLink(_0x4069c0,_0xee2ee5){const _0x2af268=a138_0x107c34,_0x46772f=basename(_0xee2ee5);return _0x4069c0[_0x2af268(0x188)]===_0x2af268(0x16a)?_0x46772f:_0x46772f[_0x2af268(0x190)]((_0x4069c0['appCode']+'--')['length']);}export function copyManagedSkillDirectory(_0x31dcb4,_0x3fcf8a){const _0x3d0ada=a138_0x107c34,_0x2e3f8f=resolve(_0x3fcf8a,METADATA_FILE),_0x2453f9=existsSync(_0x3fcf8a);if(_0x2453f9){const _0x35792d=lstatSync(_0x3fcf8a);if(_0x35792d['isSymbolicLink']())throw CliErrors[_0x3d0ada(0x18b)](_0x3d0ada(0x181)+_0x3fcf8a);if(!_0x35792d[_0x3d0ada(0x16e)]())throw CliErrors[_0x3d0ada(0x18b)](_0x3d0ada(0x174)+_0x3fcf8a);const _0x5dd55c=readMetadataIfPresent(_0x2e3f8f);if(_0x5dd55c?.[_0x3d0ada(0x188)]!==_0x3d0ada(0x167))throw CliErrors['validation']('Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20'+_0x3fcf8a);}ensureDirSync(dirname(_0x3fcf8a));const _0x22f0c8=_0x2453f9?readMetadataIfPresent(_0x2e3f8f)?.['contentHash']:undefined,_0x2a94d3=readMetadataIfPresent(resolve(_0x31dcb4,METADATA_FILE))?.['contentHash'];return _0x2453f9&&removeSync(_0x3fcf8a),copySkillDirectory(_0x31dcb4,_0x3fcf8a),{'path':_0x3fcf8a,'target':_0x31dcb4,'action':!_0x2453f9?'created':_0x22f0c8===_0x2a94d3?_0x3d0ada(0x162):'updated'};}function copySkillDirectory(_0x2ca665,_0x423976){copySync(_0x2ca665,_0x423976,{'dereference':![],'overwrite':!![],'filter'(_0x4c623e){const _0x17f118=a138_0x5ac8;if(lstatSync(_0x4c623e)[_0x17f118(0x16c)]())throw CliErrors[_0x17f118(0x18b)]('Refusing\x20to\x20copy\x20Skill\x20symlink:\x20'+_0x4c623e);return!![];}});}
@@ -1 +1 @@
1
- (function(_0x545e3,_0x2baa85){const _0x46927=a139_0x2e06,_0x1f179d=_0x545e3();while(!![]){try{const _0x2adb68=parseInt(_0x46927(0x1b9))/0x1+-parseInt(_0x46927(0x1bf))/0x2*(parseInt(_0x46927(0x1bd))/0x3)+parseInt(_0x46927(0x1a1))/0x4+parseInt(_0x46927(0x1b8))/0x5+-parseInt(_0x46927(0x1a0))/0x6+-parseInt(_0x46927(0x198))/0x7*(-parseInt(_0x46927(0x1b4))/0x8)+parseInt(_0x46927(0x1ad))/0x9*(-parseInt(_0x46927(0x1a3))/0xa);if(_0x2adb68===_0x2baa85)break;else _0x1f179d['push'](_0x1f179d['shift']());}catch(_0x4afe59){_0x1f179d['push'](_0x1f179d['shift']());}}}(a139_0x2af6,0x59a49));import{existsSync,readdirSync}from'node:fs';import{resolve}from'node:path';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';function a139_0x2e06(_0xd64196,_0x497214){_0xd64196=_0xd64196-0x198;const _0x2af61a=a139_0x2af6();let _0x2e06e0=_0x2af61a[_0xd64196];return _0x2e06e0;}import{readMetadataIfPresent}from'./metadata.js';import{getRuntimeSkillCacheRoot,safePathSegment}from'./paths.js';import{isRuntimeSkillScope,normalizeRuntimeSkillScopes}from'./scopes.js';export function listLocalRuntimeSkills(_0x1f045e,_0x1ec466,_0x35cd5c={}){const _0x4246bd=a139_0x2e06,_0x838aa8=safePathSegment(_0x1f045e['appCode'],_0x4246bd(0x1a5));if(_0x1ec466[_0x4246bd(0x1a5)]!==_0x838aa8)throw CliErrors['validation'](_0x4246bd(0x19c)+_0x1ec466[_0x4246bd(0x1a5)]+_0x4246bd(0x19b)+_0x838aa8);const _0x59cd1c=normalizeRuntimeSkillScopes(_0x1f045e[_0x4246bd(0x1c2)]),_0x5a3581=new Set(_0x59cd1c),_0x1c097f=_0x1f045e[_0x4246bd(0x19a)]?.[_0x4246bd(0x1ae)](),_0x2950e5=new Map(),_0x1ef15b=resolve(getRuntimeSkillCacheRoot(_0x1f045e[_0x4246bd(0x1a2)],_0x1f045e['accessKey'],_0x35cd5c),_0x838aa8);for(const _0x2fcac9 of _0x59cd1c){for(const _0x8fe04a of localSkillEntryDirs(resolve(_0x1ef15b,_0x2fcac9))){collectLocalRuntimeSkill(_0x2950e5,_0x8fe04a,{'appCode':_0x838aa8,'scopes':_0x5a3581,'code':_0x1c097f,'source':_0x4246bd(0x1b0)});}}for(const _0x4eb4f7 of _0x1ec466[_0x4246bd(0x1af)]){for(const _0x4960ac of localSkillLinkCandidates(_0x4eb4f7,_0x1ec466,_0x5a3581)){collectLocalRuntimeSkill(_0x2950e5,_0x4960ac,{'appCode':_0x838aa8,'scopes':_0x5a3581,'code':_0x1c097f,'source':'link','linkedPath':_0x4960ac});}}return Array[_0x4246bd(0x1a7)](_0x2950e5[_0x4246bd(0x199)]())[_0x4246bd(0x1a4)](compareLocalRuntimeSkills);}function localSkillEntryDirs(_0x26f9e5){const _0x4b60ff=a139_0x2e06;if(!existsSync(_0x26f9e5))return[];return readdirSync(_0x26f9e5,{'withFileTypes':!![]})[_0x4b60ff(0x1ac)](_0x1128d7=>_0x1128d7[_0x4b60ff(0x1ba)]()||_0x1128d7['isSymbolicLink']())[_0x4b60ff(0x1c3)](_0x3c79bf=>resolve(_0x26f9e5,_0x3c79bf['name']));}function localSkillLinkCandidates(_0x270205,_0x78ad99,_0x85cabe){const _0x15e51d=a139_0x2e06;if(!existsSync(_0x270205))return[];const _0x2742c5=_0x78ad99['appCode']+'--';return readdirSync(_0x270205,{'withFileTypes':!![]})[_0x15e51d(0x1ac)](_0x49bd3e=>_0x49bd3e[_0x15e51d(0x1ba)]()||_0x49bd3e[_0x15e51d(0x1a6)]())[_0x15e51d(0x1ac)](_0x158ad6=>_0x78ad99['scope']===_0x15e51d(0x19f)||_0x158ad6[_0x15e51d(0x1a8)][_0x15e51d(0x1a9)](_0x2742c5)||_0x85cabe[_0x15e51d(0x1aa)](_0x15e51d(0x1b3)))['map'](_0x460553=>resolve(_0x270205,_0x460553[_0x15e51d(0x1a8)]));}function collectLocalRuntimeSkill(_0x10c3ac,_0xb743a3,_0x53906c){const _0x456c20=a139_0x2e06,_0x31e54c=resolve(_0xb743a3,METADATA_FILE),_0x5bc80d=readMetadataIfPresent(_0x31e54c);if(!_0x5bc80d)return;if(_0x5bc80d[_0x456c20(0x1a5)]!==_0x53906c[_0x456c20(0x1a5)])return;if(!isRuntimeSkillScope(_0x5bc80d['scope'])||!_0x53906c[_0x456c20(0x1c2)]['has'](_0x5bc80d['scope']))return;const _0x22f027=_0x5bc80d['skillCode']?.[_0x456c20(0x1ae)]();if(!_0x22f027)return;if(_0x53906c[_0x456c20(0x19a)]&&_0x22f027!==_0x53906c[_0x456c20(0x19a)])return;const _0x22d9cb=_0x5bc80d[_0x456c20(0x1bb)]+':'+_0x22f027,_0x5a23ff=_0x53906c[_0x456c20(0x1b5)]?[_0x53906c[_0x456c20(0x1b5)]]:[],_0x5f2021=_0x10c3ac['get'](_0x22d9cb);if(_0x5f2021){_0x53906c[_0x456c20(0x1b7)]==='cache'&&(_0x5f2021[_0x456c20(0x1ab)]=_0xb743a3,_0x5f2021['cacheDir']=_0xb743a3,_0x5f2021[_0x456c20(0x1be)]=resolve(_0xb743a3,SKILL_FILE),_0x5f2021[_0x456c20(0x1b6)]=_0x31e54c);for(const _0x297793 of _0x5a23ff){!_0x5f2021[_0x456c20(0x1b1)][_0x456c20(0x1c0)](_0x297793)&&_0x5f2021[_0x456c20(0x1b1)]['push'](_0x297793);}_0x5f2021[_0x456c20(0x1b1)]['sort']();return;}_0x10c3ac[_0x456c20(0x1c1)](_0x22d9cb,{..._0x5bc80d,'tags':Array[_0x456c20(0x19d)](_0x5bc80d[_0x456c20(0x1b2)])?_0x5bc80d[_0x456c20(0x1b2)]:[],'scope':_0x5bc80d[_0x456c20(0x1bb)],'source':'local','dir':_0xb743a3,'cacheDir':_0x53906c[_0x456c20(0x1b7)]==='cache'?_0xb743a3:undefined,'skillMdPath':resolve(_0xb743a3,SKILL_FILE),'metadataPath':_0x31e54c,'linkedPaths':_0x5a23ff});}function compareLocalRuntimeSkills(_0x10bd7d,_0x12d7f1){const _0x4ce6c3=a139_0x2e06,_0x398d95={'personal':0x0,'company':0x1,'builtin':0x2};return _0x398d95[_0x10bd7d[_0x4ce6c3(0x1bb)]]-_0x398d95[_0x12d7f1[_0x4ce6c3(0x1bb)]]||_0x10bd7d[_0x4ce6c3(0x19e)][_0x4ce6c3(0x1bc)](_0x12d7f1[_0x4ce6c3(0x19e)])||_0x10bd7d['dir'][_0x4ce6c3(0x1bc)](_0x12d7f1[_0x4ce6c3(0x1ab)]);}function a139_0x2af6(){const _0x3d450a=['isDirectory','scope','localeCompare','3MksHUJ','skillMdPath','49804IcScZg','includes','set','scopes','map','2871659RFOiJt','values','code','\x20!=\x20','Runtime\x20Skill\x20install\x20target\x20app\x20mismatch:\x20','isArray','skillCode','project','3280632mBhmvW','941164cMYNde','env','150zYgLSS','sort','appCode','isSymbolicLink','from','name','startsWith','has','dir','filter','41427mQTuOe','trim','skillRoots','cache','linkedPaths','tags','builtin','8zOUrlq','linkedPath','metadataPath','source','450430wNZVQL','272282GyQsIp'];a139_0x2af6=function(){return _0x3d450a;};return a139_0x2af6();}
1
+ (function(_0x3fb989,_0x373114){const _0x3388ab=a139_0x21f1,_0x10df5e=_0x3fb989();while(!![]){try{const _0x3ba938=parseInt(_0x3388ab(0x98))/0x1+parseInt(_0x3388ab(0x79))/0x2+parseInt(_0x3388ab(0xa8))/0x3*(-parseInt(_0x3388ab(0xa0))/0x4)+-parseInt(_0x3388ab(0xa9))/0x5*(-parseInt(_0x3388ab(0x80))/0x6)+-parseInt(_0x3388ab(0xa5))/0x7*(parseInt(_0x3388ab(0x8f))/0x8)+-parseInt(_0x3388ab(0x97))/0x9*(parseInt(_0x3388ab(0xa4))/0xa)+parseInt(_0x3388ab(0x86))/0xb*(parseInt(_0x3388ab(0x93))/0xc);if(_0x3ba938===_0x373114)break;else _0x10df5e['push'](_0x10df5e['shift']());}catch(_0xd25b13){_0x10df5e['push'](_0x10df5e['shift']());}}}(a139_0x3fee,0x34755));function a139_0x21f1(_0x1d7bbe,_0x507ec3){_0x1d7bbe=_0x1d7bbe-0x79;const _0x3fee89=a139_0x3fee();let _0x21f144=_0x3fee89[_0x1d7bbe];return _0x21f144;}import{existsSync,readdirSync}from'node:fs';function a139_0x3fee(){const _0x400457=['get','9mmZNnZ','182285lkygEs','validation','scopes','env','push','name','link','linkedPaths','26252oGBhXi','has','filter','set','1666750JMHusl','1414tbSqJt','builtin','isArray','93lAVdWS','5zIsdbP','829612vGfAvo','sort','dir','metadataPath','trim','skillMdPath','appCode','931338TvnvKU','values','accessKey','startsWith','skillCode','scope','163119eggXyi','cacheDir','map','code','tags','from','linkedPath','isSymbolicLink','local','11912yHmlqk','localeCompare','source','isDirectory','108RjpEOC','\x20!=\x20','cache'];a139_0x3fee=function(){return _0x400457;};return a139_0x3fee();}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(_0x4e3367,_0x1354c9,_0x3af7bb={}){const _0x46641b=a139_0x21f1,_0x2827c8=safePathSegment(_0x4e3367[_0x46641b(0x7f)],_0x46641b(0x7f));if(_0x1354c9[_0x46641b(0x7f)]!==_0x2827c8)throw CliErrors[_0x46641b(0x99)]('Runtime\x20Skill\x20install\x20target\x20app\x20mismatch:\x20'+_0x1354c9[_0x46641b(0x7f)]+_0x46641b(0x94)+_0x2827c8);const _0x1fab06=normalizeRuntimeSkillScopes(_0x4e3367[_0x46641b(0x9a)]),_0x5e236d=new Set(_0x1fab06),_0x84621=_0x4e3367[_0x46641b(0x89)]?.[_0x46641b(0x7d)](),_0x48aa03=new Map(),_0x393926=resolve(getRuntimeSkillCacheRoot(_0x4e3367[_0x46641b(0x9b)],_0x4e3367[_0x46641b(0x82)],_0x3af7bb),_0x2827c8);for(const _0x54e6d1 of _0x1fab06){for(const _0x1def19 of localSkillEntryDirs(resolve(_0x393926,_0x54e6d1))){collectLocalRuntimeSkill(_0x48aa03,_0x1def19,{'appCode':_0x2827c8,'scopes':_0x5e236d,'code':_0x84621,'source':'cache'});}}for(const _0x2ecf13 of _0x1354c9['skillRoots']){for(const _0x132dd2 of localSkillLinkCandidates(_0x2ecf13,_0x1354c9,_0x5e236d)){collectLocalRuntimeSkill(_0x48aa03,_0x132dd2,{'appCode':_0x2827c8,'scopes':_0x5e236d,'code':_0x84621,'source':_0x46641b(0x9e),'linkedPath':_0x132dd2});}}return Array[_0x46641b(0x8b)](_0x48aa03[_0x46641b(0x81)]())[_0x46641b(0x7a)](compareLocalRuntimeSkills);}function localSkillEntryDirs(_0x309170){const _0x3a932d=a139_0x21f1;if(!existsSync(_0x309170))return[];return readdirSync(_0x309170,{'withFileTypes':!![]})[_0x3a932d(0xa2)](_0x115296=>_0x115296[_0x3a932d(0x92)]()||_0x115296['isSymbolicLink']())[_0x3a932d(0x88)](_0x127704=>resolve(_0x309170,_0x127704[_0x3a932d(0x9d)]));}function localSkillLinkCandidates(_0x1cd2a0,_0x4102bb,_0x41d2c2){const _0x19310b=a139_0x21f1;if(!existsSync(_0x1cd2a0))return[];const _0x5eb011=_0x4102bb['appCode']+'--';return readdirSync(_0x1cd2a0,{'withFileTypes':!![]})[_0x19310b(0xa2)](_0xfbced=>_0xfbced['isDirectory']()||_0xfbced[_0x19310b(0x8d)]())[_0x19310b(0xa2)](_0x1d62e8=>_0x4102bb[_0x19310b(0x85)]==='project'||_0x1d62e8[_0x19310b(0x9d)][_0x19310b(0x83)](_0x5eb011)||_0x41d2c2[_0x19310b(0xa1)](_0x19310b(0xa6)))[_0x19310b(0x88)](_0x702823=>resolve(_0x1cd2a0,_0x702823[_0x19310b(0x9d)]));}function collectLocalRuntimeSkill(_0x67bad0,_0xf40f46,_0x3a5dba){const _0x3d19fd=a139_0x21f1,_0x2e948f=resolve(_0xf40f46,METADATA_FILE),_0x11d949=readMetadataIfPresent(_0x2e948f);if(!_0x11d949)return;if(_0x11d949[_0x3d19fd(0x7f)]!==_0x3a5dba[_0x3d19fd(0x7f)])return;if(!isRuntimeSkillScope(_0x11d949[_0x3d19fd(0x85)])||!_0x3a5dba[_0x3d19fd(0x9a)]['has'](_0x11d949['scope']))return;const _0x5a8d4b=_0x11d949[_0x3d19fd(0x84)]?.[_0x3d19fd(0x7d)]();if(!_0x5a8d4b)return;if(_0x3a5dba[_0x3d19fd(0x89)]&&_0x5a8d4b!==_0x3a5dba[_0x3d19fd(0x89)])return;const _0x527ff6=_0x11d949['scope']+':'+_0x5a8d4b,_0x3e854d=_0x3a5dba[_0x3d19fd(0x8c)]?[_0x3a5dba[_0x3d19fd(0x8c)]]:[],_0x94164e=_0x67bad0[_0x3d19fd(0x96)](_0x527ff6);if(_0x94164e){_0x3a5dba[_0x3d19fd(0x91)]===_0x3d19fd(0x95)&&(_0x94164e[_0x3d19fd(0x7b)]=_0xf40f46,_0x94164e[_0x3d19fd(0x87)]=_0xf40f46,_0x94164e[_0x3d19fd(0x7e)]=resolve(_0xf40f46,SKILL_FILE),_0x94164e[_0x3d19fd(0x7c)]=_0x2e948f);for(const _0x453c26 of _0x3e854d){!_0x94164e[_0x3d19fd(0x9f)]['includes'](_0x453c26)&&_0x94164e[_0x3d19fd(0x9f)][_0x3d19fd(0x9c)](_0x453c26);}_0x94164e['linkedPaths'][_0x3d19fd(0x7a)]();return;}_0x67bad0[_0x3d19fd(0xa3)](_0x527ff6,{..._0x11d949,'tags':Array[_0x3d19fd(0xa7)](_0x11d949[_0x3d19fd(0x8a)])?_0x11d949[_0x3d19fd(0x8a)]:[],'scope':_0x11d949[_0x3d19fd(0x85)],'source':_0x3d19fd(0x8e),'dir':_0xf40f46,'cacheDir':_0x3a5dba[_0x3d19fd(0x91)]===_0x3d19fd(0x95)?_0xf40f46:undefined,'skillMdPath':resolve(_0xf40f46,SKILL_FILE),'metadataPath':_0x2e948f,'linkedPaths':_0x3e854d});}function compareLocalRuntimeSkills(_0x1ca079,_0x37bcaf){const _0x3fdb0b=a139_0x21f1,_0xbeb40={'personal':0x0,'company':0x1,'builtin':0x2};return _0xbeb40[_0x1ca079[_0x3fdb0b(0x85)]]-_0xbeb40[_0x37bcaf['scope']]||_0x1ca079['skillCode'][_0x3fdb0b(0x90)](_0x37bcaf['skillCode'])||_0x1ca079[_0x3fdb0b(0x7b)][_0x3fdb0b(0x90)](_0x37bcaf['dir']);}
@@ -1 +1 @@
1
- (function(_0x5e8572,_0x1455b9){const _0x3a0bbe=a140_0x8bd0,_0x3b2ee7=_0x5e8572();while(!![]){try{const _0x519292=-parseInt(_0x3a0bbe(0x1e4))/0x1*(-parseInt(_0x3a0bbe(0x1d8))/0x2)+-parseInt(_0x3a0bbe(0x1eb))/0x3+parseInt(_0x3a0bbe(0x1c2))/0x4+-parseInt(_0x3a0bbe(0x1e7))/0x5+parseInt(_0x3a0bbe(0x1d4))/0x6+parseInt(_0x3a0bbe(0x1cd))/0x7+parseInt(_0x3a0bbe(0x1ed))/0x8;if(_0x519292===_0x1455b9)break;else _0x3b2ee7['push'](_0x3b2ee7['shift']());}catch(_0xabb155){_0x3b2ee7['push'](_0x3b2ee7['shift']());}}}(a140_0x547e,0x8e471));import{readFileSync,readdirSync,realpathSync}from'node:fs';import{relative,resolve}from'node:path';import{CliErrors}from'../../errors.js';import{IGNORED_DIR_NAMES,IGNORED_FILE_NAMES,SKILL_FILE}from'./constants.js';export function fileContent(_0x49e45f){const _0x1ca3f5=a140_0x8bd0;return _0x49e45f[_0x1ca3f5(0x1d1)]??Buffer[_0x1ca3f5(0x1ea)](_0x49e45f['content']??'',_0x1ca3f5(0x1e0));}export function fileText(_0x5ba5df){const _0x11399c=a140_0x8bd0;return fileContent(_0x5ba5df)[_0x11399c(0x1dc)](_0x11399c(0x1e0));}export function normalizeLocalFiles(_0x4d1205){const _0x41e5a8=a140_0x8bd0;if(!Array[_0x41e5a8(0x1db)](_0x4d1205)||_0x4d1205['length']===0x0)return[];const _0x582241=new Map();for(const _0x5022c2 of _0x4d1205){if(!_0x5022c2||typeof _0x5022c2!==_0x41e5a8(0x1c1)||typeof _0x5022c2[_0x41e5a8(0x1df)]!==_0x41e5a8(0x1da))throw CliErrors['validation'](_0x41e5a8(0x1c5));const _0x1f6c62=normalizeSkillRelativePath(_0x5022c2['path']);if(_0x582241['has'](_0x1f6c62))throw CliErrors['validation']('Duplicate\x20Skill\x20file\x20path:\x20'+_0x1f6c62);if(_0x5022c2[_0x41e5a8(0x1d1)]!==undefined&&!Buffer['isBuffer'](_0x5022c2['bytes']))throw CliErrors['validation'](_0x41e5a8(0x1d5)+_0x1f6c62);if(_0x5022c2[_0x41e5a8(0x1d1)]===undefined&&typeof _0x5022c2['content']!==_0x41e5a8(0x1da))throw CliErrors['validation'](_0x41e5a8(0x1d0)+_0x1f6c62);const _0x785399=fileContent(_0x5022c2);_0x582241[_0x41e5a8(0x1ca)](_0x1f6c62,{'path':_0x1f6c62,'bytes':_0x785399});}return Array[_0x41e5a8(0x1ea)](_0x582241[_0x41e5a8(0x1c0)]())['sort'](compareSkillFiles);}export function normalizeManifestFiles(_0x185a39){const _0x32bbdc=a140_0x8bd0;if(!Array[_0x32bbdc(0x1db)](_0x185a39)||_0x185a39[_0x32bbdc(0x1de)]===0x0)return[];const _0x116c52=new Map();for(const _0x1afd77 of _0x185a39){if(!_0x1afd77||typeof _0x1afd77!==_0x32bbdc(0x1c1)||typeof _0x1afd77[_0x32bbdc(0x1df)]!==_0x32bbdc(0x1da))throw CliErrors[_0x32bbdc(0x1c4)](_0x32bbdc(0x1c5));const _0x14cfc8=normalizeSkillRelativePath(_0x1afd77[_0x32bbdc(0x1df)]);if(_0x116c52[_0x32bbdc(0x1ce)](_0x14cfc8))throw CliErrors[_0x32bbdc(0x1c4)](_0x32bbdc(0x1e6)+_0x14cfc8);if(!isSha256Hex(_0x1afd77[_0x32bbdc(0x1e5)]))throw CliErrors[_0x32bbdc(0x1c4)](_0x32bbdc(0x1d9)+_0x14cfc8);if(!Number[_0x32bbdc(0x1ec)](_0x1afd77['size'])||_0x1afd77['size']<0x0)throw CliErrors[_0x32bbdc(0x1c4)](_0x32bbdc(0x1c6)+_0x14cfc8);_0x116c52[_0x32bbdc(0x1ca)](_0x14cfc8,{'path':_0x14cfc8,'sha256':_0x1afd77[_0x32bbdc(0x1e5)]['toLowerCase'](),'size':_0x1afd77[_0x32bbdc(0x1c9)]});}return Array[_0x32bbdc(0x1ea)](_0x116c52[_0x32bbdc(0x1c0)]())['sort'](compareSkillFiles);}export function scanSkillDirectory(_0x372a0f,_0x26db3f={}){const _0x492144=a140_0x8bd0,_0x4261ba=realpathSync(_0x372a0f),_0x39db59=canonicalExcludedFilePaths(_0x26db3f[_0x492144(0x1e9)]),_0x12daf9=[];function _0x2bc786(_0x4233de){const _0x135804=_0x492144,_0x21162e=readdirSync(_0x4233de,{'withFileTypes':!![]})[_0x135804(0x1c7)]((_0x578461,_0x190da3)=>_0x578461[_0x135804(0x1e8)]['localeCompare'](_0x190da3['name']));for(const _0x2c7c25 of _0x21162e){if(_0x2c7c25['isDirectory']()&&IGNORED_DIR_NAMES[_0x135804(0x1ce)](_0x2c7c25[_0x135804(0x1e8)]))continue;if(IGNORED_FILE_NAMES[_0x135804(0x1ce)](_0x2c7c25['name']))continue;const _0x3695eb=resolve(_0x4233de,_0x2c7c25['name']);if(isExcludedFilePath(_0x3695eb,_0x39db59))continue;if(_0x2c7c25['isSymbolicLink']())throw CliErrors[_0x135804(0x1c4)](_0x135804(0x1d6)+_0x3695eb);const _0x5a6b95=toPosixPath(relative(_0x4261ba,_0x3695eb));if(_0x2c7c25[_0x135804(0x1dd)]()){_0x2bc786(_0x3695eb);continue;}if(!_0x2c7c25[_0x135804(0x1d2)]())continue;validateSkillRelativePath(_0x5a6b95);const _0x3d59e5=readFileSync(_0x3695eb);_0x12daf9[_0x135804(0x1d7)]({'path':_0x5a6b95,'bytes':_0x3d59e5});}}return _0x2bc786(_0x4261ba),normalizeLocalFiles(_0x12daf9);}function a140_0x547e(){const _0x4672ec=['test','validation','Skill\x20file\x20path\x20must\x20be\x20text.','Skill\x20file\x20size\x20is\x20invalid:\x20','sort','compare','size','set','replace','split','595378bgNWBq','has','add','Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20','bytes','isFile','includes','296994VADdgq','Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20','Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20','push','561926GnymkH','Skill\x20file\x20sha256\x20is\x20invalid:\x20','string','isArray','toString','isDirectory','length','path','utf8','Unsafe\x20Skill\x20file\x20path:\x20','startsWith','trim','1FZRJtq','sha256','Duplicate\x20Skill\x20file\x20path:\x20','4872235oCTdNs','name','excludedFilePaths','from','1445613VXUYYF','isSafeInteger','6486360SDDevt','values','object','3251104bXTdtz'];a140_0x547e=function(){return _0x4672ec;};return a140_0x547e();}function canonicalExcludedFilePaths(_0x37fcad){const _0x4ad1eb=a140_0x8bd0,_0x1d611e=new Set();for(const _0x46d939 of _0x37fcad??[]){const _0x454212=resolve(_0x46d939);_0x1d611e[_0x4ad1eb(0x1cf)](_0x454212);try{_0x1d611e[_0x4ad1eb(0x1cf)](realpathSync(_0x454212));}catch{}}return _0x1d611e;}function isExcludedFilePath(_0xa9dd0b,_0x410655){const _0x3100f1=a140_0x8bd0;if(_0x410655['has'](_0xa9dd0b))return!![];if(_0x410655[_0x3100f1(0x1c9)]===0x0)return![];try{return _0x410655[_0x3100f1(0x1ce)](realpathSync(_0xa9dd0b));}catch{return![];}}export function compareSkillFiles(_0x62f558,_0x5dac2f){const _0x1dc808=a140_0x8bd0;if(_0x62f558[_0x1dc808(0x1df)]===SKILL_FILE)return _0x5dac2f[_0x1dc808(0x1df)]===SKILL_FILE?0x0:-0x1;if(_0x5dac2f['path']===SKILL_FILE)return 0x1;return Buffer[_0x1dc808(0x1c8)](Buffer[_0x1dc808(0x1ea)](_0x62f558[_0x1dc808(0x1df)],_0x1dc808(0x1e0)),Buffer['from'](_0x5dac2f[_0x1dc808(0x1df)],_0x1dc808(0x1e0)));}export function normalizeSkillRelativePath(_0x5e2648){const _0x25512a=a140_0x8bd0,_0x4d3b14=toPosixPath(_0x5e2648[_0x25512a(0x1e3)]());return validateSkillRelativePath(_0x4d3b14),_0x4d3b14;}function a140_0x8bd0(_0x587ec6,_0x173ab0){_0x587ec6=_0x587ec6-0x1c0;const _0x547e9a=a140_0x547e();let _0x8bd0bc=_0x547e9a[_0x587ec6];return _0x8bd0bc;}export function validateSkillRelativePath(_0x1558a6){const _0x205da5=a140_0x8bd0;if(!_0x1558a6||_0x1558a6[_0x205da5(0x1e2)]('/')||_0x1558a6[_0x205da5(0x1d3)]('//'))throw CliErrors[_0x205da5(0x1c4)](_0x205da5(0x1e1)+_0x1558a6);for(const _0x13b428 of _0x1558a6[_0x205da5(0x1cc)]('/')){if(!_0x13b428||_0x13b428==='.'||_0x13b428==='..')throw CliErrors[_0x205da5(0x1c4)](_0x205da5(0x1e1)+_0x1558a6);}}export function toPosixPath(_0x87b045){const _0x21752a=a140_0x8bd0;return _0x87b045[_0x21752a(0x1cb)](/\\/g,'/');}export function isSha256Hex(_0x598425){const _0xae5056=a140_0x8bd0;return typeof _0x598425===_0xae5056(0x1da)&&/^[a-fA-F0-9]{64}$/[_0xae5056(0x1c3)](_0x598425);}
1
+ (function(_0x882620,_0x3d1154){const _0x376fac=a140_0x2a7f,_0x5a5ac8=_0x882620();while(!![]){try{const _0x5d1dc9=parseInt(_0x376fac(0xf7))/0x1*(-parseInt(_0x376fac(0xd9))/0x2)+-parseInt(_0x376fac(0xe8))/0x3*(parseInt(_0x376fac(0xd8))/0x4)+-parseInt(_0x376fac(0xe2))/0x5+-parseInt(_0x376fac(0x103))/0x6*(parseInt(_0x376fac(0xd6))/0x7)+-parseInt(_0x376fac(0xee))/0x8*(parseInt(_0x376fac(0xf8))/0x9)+-parseInt(_0x376fac(0x102))/0xa*(parseInt(_0x376fac(0xf9))/0xb)+parseInt(_0x376fac(0x100))/0xc;if(_0x5d1dc9===_0x3d1154)break;else _0x5a5ac8['push'](_0x5a5ac8['shift']());}catch(_0x12400c){_0x5a5ac8['push'](_0x5a5ac8['shift']());}}}(a140_0x530a,0x20c6d));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(_0x1252ab){const _0x520e98=a140_0x2a7f;return _0x1252ab[_0x520e98(0xe1)]??Buffer[_0x520e98(0xd7)](_0x1252ab[_0x520e98(0xeb)]??'',_0x520e98(0x105));}function a140_0x530a(){const _0x1504f4=['111666aGhdJS','isBuffer','values','Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20','isSymbolicLink','add','isSafeInteger','name','bytes','39495xaBgRl','localeCompare','Unsafe\x20Skill\x20file\x20path:\x20','replace','isArray','excludedFilePaths','1929TzEcfP','size','Duplicate\x20Skill\x20file\x20path:\x20','content','length','sha256','8Jaqjvk','path','startsWith','isDirectory','Skill\x20file\x20size\x20is\x20invalid:\x20','split','object','isFile','Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20','1dGcEKW','2384937TqbJel','33oNSSOy','string','toLowerCase','Skill\x20file\x20path\x20must\x20be\x20text.','set','has','push','10638384Ekudeo','includes','526860zglxIo','6WdJeCV','sort','utf8','validation','467663MpbgdE','from','1236xAfQyO'];a140_0x530a=function(){return _0x1504f4;};return a140_0x530a();}export function fileText(_0x1de50c){const _0x7ce9d7=a140_0x2a7f;return fileContent(_0x1de50c)['toString'](_0x7ce9d7(0x105));}export function normalizeLocalFiles(_0x37dc80){const _0x47bf56=a140_0x2a7f;if(!Array['isArray'](_0x37dc80)||_0x37dc80[_0x47bf56(0xec)]===0x0)return[];const _0x25f695=new Map();for(const _0x3f16e4 of _0x37dc80){if(!_0x3f16e4||typeof _0x3f16e4!==_0x47bf56(0xf4)||typeof _0x3f16e4[_0x47bf56(0xef)]!==_0x47bf56(0xfa))throw CliErrors[_0x47bf56(0x106)](_0x47bf56(0xfc));const _0x32fc3a=normalizeSkillRelativePath(_0x3f16e4[_0x47bf56(0xef)]);if(_0x25f695[_0x47bf56(0xfe)](_0x32fc3a))throw CliErrors[_0x47bf56(0x106)](_0x47bf56(0xea)+_0x32fc3a);if(_0x3f16e4[_0x47bf56(0xe1)]!==undefined&&!Buffer[_0x47bf56(0xda)](_0x3f16e4[_0x47bf56(0xe1)]))throw CliErrors['validation'](_0x47bf56(0xdc)+_0x32fc3a);if(_0x3f16e4[_0x47bf56(0xe1)]===undefined&&typeof _0x3f16e4[_0x47bf56(0xeb)]!==_0x47bf56(0xfa))throw CliErrors[_0x47bf56(0x106)]('Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20'+_0x32fc3a);const _0x21ab7b=fileContent(_0x3f16e4);_0x25f695[_0x47bf56(0xfd)](_0x32fc3a,{'path':_0x32fc3a,'bytes':_0x21ab7b});}return Array['from'](_0x25f695[_0x47bf56(0xdb)]())['sort'](compareSkillFiles);}export function normalizeManifestFiles(_0xb0083c){const _0x144125=a140_0x2a7f;if(!Array[_0x144125(0xe6)](_0xb0083c)||_0xb0083c[_0x144125(0xec)]===0x0)return[];const _0x506d4e=new Map();for(const _0x42da23 of _0xb0083c){if(!_0x42da23||typeof _0x42da23!==_0x144125(0xf4)||typeof _0x42da23[_0x144125(0xef)]!==_0x144125(0xfa))throw CliErrors[_0x144125(0x106)](_0x144125(0xfc));const _0x12d1d8=normalizeSkillRelativePath(_0x42da23[_0x144125(0xef)]);if(_0x506d4e[_0x144125(0xfe)](_0x12d1d8))throw CliErrors[_0x144125(0x106)](_0x144125(0xea)+_0x12d1d8);if(!isSha256Hex(_0x42da23['sha256']))throw CliErrors[_0x144125(0x106)]('Skill\x20file\x20sha256\x20is\x20invalid:\x20'+_0x12d1d8);if(!Number[_0x144125(0xdf)](_0x42da23[_0x144125(0xe9)])||_0x42da23['size']<0x0)throw CliErrors[_0x144125(0x106)](_0x144125(0xf2)+_0x12d1d8);_0x506d4e[_0x144125(0xfd)](_0x12d1d8,{'path':_0x12d1d8,'sha256':_0x42da23[_0x144125(0xed)][_0x144125(0xfb)](),'size':_0x42da23['size']});}return Array['from'](_0x506d4e['values']())[_0x144125(0x104)](compareSkillFiles);}export function scanSkillDirectory(_0x12dbdd,_0x11a35c={}){const _0x2b9e87=a140_0x2a7f,_0x54a859=realpathSync(_0x12dbdd),_0x5e68c5=canonicalExcludedFilePaths(_0x11a35c[_0x2b9e87(0xe7)]),_0x300eb7=[];function _0x2aa594(_0x64eb83){const _0x294ce4=_0x2b9e87,_0x4ed1fd=readdirSync(_0x64eb83,{'withFileTypes':!![]})[_0x294ce4(0x104)]((_0x4f9e4d,_0xabc827)=>_0x4f9e4d[_0x294ce4(0xe0)][_0x294ce4(0xe3)](_0xabc827[_0x294ce4(0xe0)]));for(const _0x44839a of _0x4ed1fd){if(_0x44839a['isDirectory']()&&IGNORED_DIR_NAMES[_0x294ce4(0xfe)](_0x44839a[_0x294ce4(0xe0)]))continue;if(IGNORED_FILE_NAMES[_0x294ce4(0xfe)](_0x44839a['name']))continue;const _0x8047ad=resolve(_0x64eb83,_0x44839a[_0x294ce4(0xe0)]);if(isExcludedFilePath(_0x8047ad,_0x5e68c5))continue;if(_0x44839a[_0x294ce4(0xdd)]())throw CliErrors[_0x294ce4(0x106)](_0x294ce4(0xf6)+_0x8047ad);const _0x1b9780=toPosixPath(relative(_0x54a859,_0x8047ad));if(_0x44839a[_0x294ce4(0xf1)]()){_0x2aa594(_0x8047ad);continue;}if(!_0x44839a[_0x294ce4(0xf5)]())continue;validateSkillRelativePath(_0x1b9780);const _0xe38e76=readFileSync(_0x8047ad);_0x300eb7[_0x294ce4(0xff)]({'path':_0x1b9780,'bytes':_0xe38e76});}}return _0x2aa594(_0x54a859),normalizeLocalFiles(_0x300eb7);}function canonicalExcludedFilePaths(_0x18a317){const _0x3764af=a140_0x2a7f,_0x229f84=new Set();for(const _0x322e85 of _0x18a317??[]){const _0x22e74c=resolve(_0x322e85);_0x229f84[_0x3764af(0xde)](_0x22e74c);try{_0x229f84['add'](realpathSync(_0x22e74c));}catch{}}return _0x229f84;}function isExcludedFilePath(_0x2b1b69,_0xef6684){const _0x44402c=a140_0x2a7f;if(_0xef6684[_0x44402c(0xfe)](_0x2b1b69))return!![];if(_0xef6684[_0x44402c(0xe9)]===0x0)return![];try{return _0xef6684['has'](realpathSync(_0x2b1b69));}catch{return![];}}function a140_0x2a7f(_0xc7d750,_0x30b978){_0xc7d750=_0xc7d750-0xd6;const _0x530aa2=a140_0x530a();let _0x2a7f2c=_0x530aa2[_0xc7d750];return _0x2a7f2c;}export function compareSkillFiles(_0x157e41,_0x3606bd){const _0x2f86a3=a140_0x2a7f;if(_0x157e41[_0x2f86a3(0xef)]===SKILL_FILE)return _0x3606bd[_0x2f86a3(0xef)]===SKILL_FILE?0x0:-0x1;if(_0x3606bd[_0x2f86a3(0xef)]===SKILL_FILE)return 0x1;return Buffer['compare'](Buffer[_0x2f86a3(0xd7)](_0x157e41[_0x2f86a3(0xef)],'utf8'),Buffer[_0x2f86a3(0xd7)](_0x3606bd[_0x2f86a3(0xef)],_0x2f86a3(0x105)));}export function normalizeSkillRelativePath(_0x1cb6d4){const _0x4396e6=toPosixPath(_0x1cb6d4['trim']());return validateSkillRelativePath(_0x4396e6),_0x4396e6;}export function validateSkillRelativePath(_0x5037b0){const _0x3d46ae=a140_0x2a7f;if(!_0x5037b0||_0x5037b0[_0x3d46ae(0xf0)]('/')||_0x5037b0[_0x3d46ae(0x101)]('//'))throw CliErrors[_0x3d46ae(0x106)](_0x3d46ae(0xe4)+_0x5037b0);for(const _0x7bea4d of _0x5037b0[_0x3d46ae(0xf3)]('/')){if(!_0x7bea4d||_0x7bea4d==='.'||_0x7bea4d==='..')throw CliErrors['validation'](_0x3d46ae(0xe4)+_0x5037b0);}}export function toPosixPath(_0x5b58ff){const _0x3f0ecd=a140_0x2a7f;return _0x5b58ff[_0x3f0ecd(0xe5)](/\\/g,'/');}export function isSha256Hex(_0x48b0d0){const _0x5336c3=a140_0x2a7f;return typeof _0x48b0d0===_0x5336c3(0xfa)&&/^[a-fA-F0-9]{64}$/['test'](_0x48b0d0);}
@@ -1 +1 @@
1
- (function(_0x4c6d87,_0x52bb5a){const _0x5ca07d=a141_0x48c7,_0x4e8212=_0x4c6d87();while(!![]){try{const _0x3f2c57=parseInt(_0x5ca07d(0x1f5))/0x1+parseInt(_0x5ca07d(0x1dd))/0x2+-parseInt(_0x5ca07d(0x1fd))/0x3*(parseInt(_0x5ca07d(0x1ec))/0x4)+-parseInt(_0x5ca07d(0x1e8))/0x5*(parseInt(_0x5ca07d(0x1e3))/0x6)+-parseInt(_0x5ca07d(0x1ea))/0x7+parseInt(_0x5ca07d(0x1e9))/0x8*(parseInt(_0x5ca07d(0x20b))/0x9)+-parseInt(_0x5ca07d(0x201))/0xa*(-parseInt(_0x5ca07d(0x1d3))/0xb);if(_0x3f2c57===_0x52bb5a)break;else _0x4e8212['push'](_0x4e8212['shift']());}catch(_0x1d7ddf){_0x4e8212['push'](_0x4e8212['shift']());}}}(a141_0x4c02,0xb88d5));import{existsSync,lstatSync,mkdirSync,readFileSync,rmSync}from'node:fs';import{dirname,resolve}from'node:path';import{isCollection,isMap,isNode,parseDocument,visit}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{resolveManagedFilePath,writeBytesAtomic,writeJsonAtomic}from'./fs-utils.js';import{bufferSha256,contentHash,fileHash}from'./hashing.js';import{fileContent,fileText,normalizeLocalFiles}from'./local-files.js';import{buildMetadata,readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillDir}from'./paths.js';import{extractDownloadedPackage,requirePackageBytes}from'./zip-package.js';function a141_0x4c02(){const _0x183965=['packageBytes','contents','\x0a---\x0a\x0a','example','stringify','585MstOrv','242piksfu','slice','path','paths','fileHashes','displayName','name:\x20','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','.\x20Changed\x20file:\x20','Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20','2972954cjnBKY','pulledAt','entries','keys','displayName:\x20','toString','4374XCayId','delete','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','scope','7315ScNsky','130600zjpnHV','4239942wXoZvm','description','14468YXVPmp','set','test','find','validation','---','appCode','has','accessKey','620863nRnbWY','env','match','length','name','isFile','schemaVersion','utf8','699mwACYm','skillName','map','trim','46570prbpGJ','contentHash','version','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','replace'];a141_0x4c02=function(){return _0x183965;};return a141_0x4c02();}export function materializeRuntimeSkill(_0x538793,_0x57b591,_0x593db9){const _0xd93695=a141_0x48c7,_0x5bbf7d=requireSkillCode(_0x538793),_0x28c2cf=requirePackageBytes(_0x5bbf7d,_0x593db9[_0xd93695(0x206)]),_0x526c40=extractDownloadedPackage(_0x28c2cf),_0x157f5e=_0x526c40[_0xd93695(0x1ef)](_0x2323a1=>_0x2323a1['path']===SKILL_FILE);if(!_0x157f5e)throw CliErrors[_0xd93695(0x1f0)]('Runtime\x20Skill\x20package\x20is\x20missing\x20'+SKILL_FILE+':\x20'+_0x5bbf7d);const _0x55bec6=withMaterializedSkillFrontmatter(_0x526c40,_0x538793,_0x5bbf7d),_0x5744f7=_0x55bec6['find'](_0x33f00c=>_0x33f00c[_0xd93695(0x1d5)]===SKILL_FILE),_0x279f7b=fileText(_0x5744f7),_0x14e70e=getRuntimeSkillDir(_0x593db9[_0xd93695(0x1f6)],_0x593db9[_0xd93695(0x1f4)],_0x593db9[_0xd93695(0x1f2)],_0x57b591,_0x5bbf7d,_0x593db9['paths']),_0x11e729=resolve(_0x14e70e,SKILL_FILE),_0x4de224=resolve(_0x14e70e,METADATA_FILE),_0xb5989b=contentHash(_0x279f7b),_0x52d645=readMetadataIfPresent(_0x4de224)?.[_0xd93695(0x1d7)];ensurePulledFilesCanBeOverwritten(_0x14e70e,_0x4de224,_0x55bec6,_0x593db9['force']===!![]),mkdirSync(_0x14e70e,{'recursive':!![],'mode':0x1c0});const _0x49700f=existsSync(_0x11e729)?readFileSync(_0x11e729,_0xd93695(0x1fc)):undefined;return materializeFiles(_0x14e70e,_0x55bec6),removeStaleManagedFiles(_0x14e70e,_0x52d645,_0x55bec6),writeJsonAtomic(_0x4de224,buildMetadata(_0x538793,_0x57b591,_0x593db9[_0xd93695(0x1f2)],_0xb5989b,_0x593db9[_0xd93695(0x1de)],_0x55bec6,_0x28c2cf)),{'skill':_0x538793,'scope':_0x57b591,'dir':_0x14e70e,'skillMdPath':_0x11e729,'metadataPath':_0x4de224,'contentHash':_0xb5989b,'changed':_0x49700f!==_0x279f7b};}export function reuseMaterializedRuntimeSkill(_0x130946,_0x53de5f,_0x551dba){const _0x39a489=a141_0x48c7,_0x410652=_0x130946[_0x39a489(0x203)]?.[_0x39a489(0x200)]();if(!_0x410652)return undefined;const _0x83ae3e=requireSkillCode(_0x130946),_0x4b4443=getRuntimeSkillDir(_0x551dba['env'],_0x551dba[_0x39a489(0x1f4)],_0x551dba[_0x39a489(0x1f2)],_0x53de5f,_0x83ae3e,_0x551dba[_0x39a489(0x1d6)]),_0x2e18f7=resolve(_0x4b4443,SKILL_FILE),_0x1f8800=resolve(_0x4b4443,METADATA_FILE),_0x80344f=readMetadataIfPresent(_0x1f8800);if(!_0x80344f||_0x80344f[_0x39a489(0x1fb)]!==0x2||_0x80344f[_0x39a489(0x1f2)]!==_0x551dba[_0x39a489(0x1f2)]||_0x80344f[_0x39a489(0x1e7)]!==_0x53de5f||_0x80344f['skillCode']!==_0x83ae3e||_0x80344f[_0x39a489(0x203)]!==_0x410652||_0x80344f['id']!==_0x130946['id']||_0x80344f[_0x39a489(0x1fe)]!==_0x130946[_0x39a489(0x1fe)]||_0x80344f[_0x39a489(0x1eb)]!==_0x130946[_0x39a489(0x1eb)]||_0x80344f[_0x39a489(0x209)]!==_0x130946[_0x39a489(0x209)]||_0x80344f['status']!==_0x130946['status']||!_0x80344f['contentHash']||!_0x80344f[_0x39a489(0x1d7)]||!Object['hasOwn'](_0x80344f[_0x39a489(0x1d7)],SKILL_FILE))return undefined;for(const [_0x4482ac,_0x5ac75f]of Object[_0x39a489(0x1df)](_0x80344f['fileHashes'])){if(!/^[a-f0-9]{64}$/['test'](_0x5ac75f))return undefined;const _0x2141ae=resolveManagedFilePath(_0x4b4443,_0x4482ac);if(!existsSync(_0x2141ae)||!lstatSync(_0x2141ae)[_0x39a489(0x1fa)]())return undefined;if(bufferSha256(readFileSync(_0x2141ae))!==_0x5ac75f)return undefined;}return{'skill':_0x130946,'scope':_0x53de5f,'dir':_0x4b4443,'skillMdPath':_0x2e18f7,'metadataPath':_0x1f8800,'contentHash':_0x80344f[_0x39a489(0x202)],'changed':![]};}function withMaterializedSkillFrontmatter(_0x3d577f,_0x3d6dce,_0x569090){const _0x16beae=skillDisplayName(_0x3d6dce,_0x569090),_0x5178d1=_0x3d6dce['description']?.['trim']()||_0x16beae||_0x569090;return normalizeLocalFiles(_0x3d577f)['map'](_0x87c7ba=>{const _0x350f39=a141_0x48c7,_0x4960e7=fileText(_0x87c7ba);if(_0x87c7ba[_0x350f39(0x1d5)]!==SKILL_FILE)return _0x87c7ba;if(hasYamlFrontmatter(_0x4960e7))return{'path':_0x87c7ba[_0x350f39(0x1d5)],'content':withSyncedDisplayName(_0x4960e7,_0x16beae)};return{'path':_0x87c7ba[_0x350f39(0x1d5)],'content':prependSkillFrontmatter(_0x4960e7,{'name':_0x569090,'displayName':_0x16beae,'description':_0x5178d1})};});}function hasYamlFrontmatter(_0x3a89e4){const _0x269ea7=a141_0x48c7;return/^\uFEFF?---\s*\r?\n/[_0x269ea7(0x1ee)](_0x3a89e4);}function prependSkillFrontmatter(_0x17e50b,_0x59bcd9){const _0x36b7d4=a141_0x48c7,_0x12ee56=_0x17e50b['replace'](/^\uFEFF/,'');return[_0x36b7d4(0x1f1),_0x36b7d4(0x1d9)+yamlString(_0x59bcd9[_0x36b7d4(0x1f9)]),_0x59bcd9[_0x36b7d4(0x1d8)]?_0x36b7d4(0x1e1)+yamlString(_0x59bcd9[_0x36b7d4(0x1d8)]):undefined,'description:\x20'+yamlString(_0x59bcd9[_0x36b7d4(0x1eb)]),_0x36b7d4(0x1f1),'',_0x12ee56]['filter'](_0x167c66=>_0x167c66!==undefined)['join']('\x0a');}function yamlString(_0xe8f610){const _0x5bc439=a141_0x48c7;return JSON[_0x5bc439(0x20a)](_0xe8f610[_0x5bc439(0x205)](/\r/g,'')[_0x5bc439(0x200)]());}function skillDisplayName(_0x2195dd,_0x1f5413){const _0x1aa6f8=a141_0x48c7,_0x4e5492=_0x2195dd['skillName']?.[_0x1aa6f8(0x200)]();return _0x4e5492||_0x1f5413;}function withSyncedDisplayName(_0x18adbb,_0x280298){const _0x1b0055=a141_0x48c7,_0x18c10c=_0x18adbb[_0x1b0055(0x1f7)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x18c10c)return _0x18adbb;const _0x490956=_0x18c10c[0x1]??'',_0x497cfc=_0x18c10c[0x2]??'',_0x2b5241=parseDocument(_0x497cfc);if(_0x2b5241['errors'][_0x1b0055(0x1f8)]>0x0||!isMap(_0x2b5241[_0x1b0055(0x207)]))return _0x18adbb;if(_0x280298)_0x2b5241[_0x1b0055(0x1ed)](_0x1b0055(0x1d8),_0x280298);else{if(_0x2b5241[_0x1b0055(0x1f3)](_0x1b0055(0x1d8)))_0x2b5241[_0x1b0055(0x1e4)](_0x1b0055(0x1d8));else return _0x18adbb;}forceBlockCollections(_0x2b5241[_0x1b0055(0x207)]);const _0x212941=_0x2b5241[_0x1b0055(0x1e2)]({'lineWidth':0x0})['trimEnd'](),_0x3dc3de=_0x18adbb[_0x1b0055(0x1d4)](_0x18c10c[0x0][_0x1b0055(0x1f8)])[_0x1b0055(0x205)](/^\r?\n/,'');return _0x490956+'---\x0a'+_0x212941+_0x1b0055(0x208)+_0x3dc3de;}function forceBlockCollections(_0x1c1474){if(!isNode(_0x1c1474))return;visit(_0x1c1474,(_0x53d3ee,_0x411d1f)=>{isCollection(_0x411d1f)&&(_0x411d1f['flow']=![]);});}function ensurePulledFilesCanBeOverwritten(_0x5f377b,_0x3b5006,_0x18a22d,_0x25eb3d){const _0x5be2c3=a141_0x48c7;if(_0x25eb3d||!existsSync(_0x3b5006))return;const _0x583d6d=readMetadataIfPresent(_0x3b5006);if(!_0x583d6d)return;const _0x15131e=_0x583d6d[_0x5be2c3(0x1d7)]&&Object[_0x5be2c3(0x1e0)](_0x583d6d[_0x5be2c3(0x1d7)])[_0x5be2c3(0x1f8)]>0x0?_0x583d6d[_0x5be2c3(0x1d7)]:undefined;if(_0x15131e)for(const [_0x324f2c,_0x48abc2]of Object['entries'](_0x15131e)){const _0x3ac77b=resolveManagedFilePath(_0x5f377b,_0x324f2c);if(!existsSync(_0x3ac77b))throw CliErrors[_0x5be2c3(0x1f0)](_0x5be2c3(0x1da)+_0x5f377b,'Managed\x20file\x20was\x20removed\x20locally:\x20'+_0x324f2c);const _0x22c696=lstatSync(_0x3ac77b);if(!_0x22c696[_0x5be2c3(0x1fa)]())throw CliErrors[_0x5be2c3(0x1f0)](_0x5be2c3(0x1da)+_0x5f377b,'Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20'+_0x324f2c);const _0x5df6cf=bufferSha256(readFileSync(_0x3ac77b));if(_0x5df6cf!==_0x48abc2)throw CliErrors[_0x5be2c3(0x1f0)](_0x5be2c3(0x1da)+_0x5f377b+_0x5be2c3(0x1db)+_0x324f2c,_0x5be2c3(0x204)+_0x324f2c);}else{const _0x51276f=resolve(_0x5f377b,SKILL_FILE);if(existsSync(_0x51276f)&&_0x583d6d[_0x5be2c3(0x202)]){const _0x19650f=contentHash(readFileSync(_0x51276f,_0x5be2c3(0x1fc)));if(_0x19650f!==_0x583d6d[_0x5be2c3(0x202)])throw CliErrors[_0x5be2c3(0x1f0)](_0x5be2c3(0x1e6)+_0x51276f,'Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.');}}for(const _0x28bdec of normalizeLocalFiles(_0x18a22d)){if(_0x15131e?.[_0x28bdec[_0x5be2c3(0x1d5)]])continue;if(!_0x15131e&&_0x28bdec['path']===SKILL_FILE)continue;const _0x22ca9a=resolveManagedFilePath(_0x5f377b,_0x28bdec['path']);if(!existsSync(_0x22ca9a))continue;const _0x150d78=lstatSync(_0x22ca9a);if(!_0x150d78[_0x5be2c3(0x1fa)]())throw CliErrors['validation']('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x5f377b,_0x5be2c3(0x1e5)+_0x28bdec['path']);const _0x4f14e1=bufferSha256(readFileSync(_0x22ca9a));if(_0x4f14e1!==fileHash(_0x28bdec))throw CliErrors['validation']('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x5f377b,_0x5be2c3(0x1dc)+_0x28bdec[_0x5be2c3(0x1d5)]);}}function materializeFiles(_0x5ce2f1,_0x3e446b){for(const _0x23540d of normalizeLocalFiles(_0x3e446b)){const _0x507164=resolveManagedFilePath(_0x5ce2f1,_0x23540d['path']);mkdirSync(dirname(_0x507164),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x507164,fileContent(_0x23540d),0x180);}}function a141_0x48c7(_0x2db9b0,_0x376350){_0x2db9b0=_0x2db9b0-0x1d3;const _0x4c024c=a141_0x4c02();let _0x48c7cc=_0x4c024c[_0x2db9b0];return _0x48c7cc;}function removeStaleManagedFiles(_0x586899,_0x482100,_0x1302ac){const _0x2f3b50=a141_0x48c7;if(!_0x482100)return;const _0x5300fa=new Set(normalizeLocalFiles(_0x1302ac)[_0x2f3b50(0x1ff)](_0x59e5ee=>_0x59e5ee[_0x2f3b50(0x1d5)]));for(const _0x319127 of Object[_0x2f3b50(0x1e0)](_0x482100)){if(_0x5300fa[_0x2f3b50(0x1f3)](_0x319127))continue;const _0x181bc9=resolveManagedFilePath(_0x586899,_0x319127);existsSync(_0x181bc9)&&lstatSync(_0x181bc9)[_0x2f3b50(0x1fa)]()&&rmSync(_0x181bc9,{'force':!![]});}}
1
+ (function(_0x289a5e,_0x4d5551){const _0x285979=a141_0x52de,_0x5355a2=_0x289a5e();while(!![]){try{const _0x5d16ef=parseInt(_0x285979(0xc6))/0x1+-parseInt(_0x285979(0xbc))/0x2+parseInt(_0x285979(0xb5))/0x3*(-parseInt(_0x285979(0x9e))/0x4)+-parseInt(_0x285979(0xac))/0x5*(parseInt(_0x285979(0x90))/0x6)+-parseInt(_0x285979(0xb0))/0x7+-parseInt(_0x285979(0x91))/0x8+parseInt(_0x285979(0x9a))/0x9;if(_0x5d16ef===_0x4d5551)break;else _0x5355a2['push'](_0x5355a2['shift']());}catch(_0x4d4392){_0x5355a2['push'](_0x5355a2['shift']());}}}(a141_0x1360,0x6280d));import{existsSync,lstatSync,mkdirSync,readFileSync,rmSync}from'node:fs';import{dirname,resolve}from'node:path';function a141_0x52de(_0x35536b,_0x2e57ed){_0x35536b=_0x35536b-0x90;const _0x136055=a141_0x1360();let _0x52def1=_0x136055[_0x35536b];return _0x52def1;}import{isCollection,isMap,isNode,parseDocument,visit}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{resolveManagedFilePath,writeBytesAtomic,writeJsonAtomic}from'./fs-utils.js';import{bufferSha256,contentHash,fileHash}from'./hashing.js';function a141_0x1360(){const _0x2118b0=['filter','has','entries','Runtime\x20Skill\x20package\x20is\x20missing\x20','17292996nADlqF','utf8','fileHashes','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','76fiaFgY','name:\x20','pulledAt','status','stringify','replace','skillCode','join','name','find','errors','version','schemaVersion','match','1944955ZfKPuh','displayName','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','isFile','2079518xYibjl','length','delete','appCode','validation','118197PXoicT','---','trimEnd','paths','force','skillName','env','490870YQghnb','keys','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','trim','\x0a---\x0a\x0a','contents','map','displayName:\x20','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','accessKey','786188nrYYWl','Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20','description:\x20','slice','path','12ICKVyv','1880728oxnJHB','---\x0a','contentHash','description','toString'];a141_0x1360=function(){return _0x2118b0;};return a141_0x1360();}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(_0x2f9dae,_0x691b0,_0x5ed164){const _0x9112dc=a141_0x52de,_0x2740c4=requireSkillCode(_0x2f9dae),_0x29051e=requirePackageBytes(_0x2740c4,_0x5ed164['packageBytes']),_0x2b2fa8=extractDownloadedPackage(_0x29051e),_0x5db09f=_0x2b2fa8[_0x9112dc(0xa7)](_0x3951ca=>_0x3951ca[_0x9112dc(0xca)]===SKILL_FILE);if(!_0x5db09f)throw CliErrors[_0x9112dc(0xb4)](_0x9112dc(0x99)+SKILL_FILE+':\x20'+_0x2740c4);const _0x228e30=withMaterializedSkillFrontmatter(_0x2b2fa8,_0x2f9dae,_0x2740c4),_0x26d503=_0x228e30[_0x9112dc(0xa7)](_0x142ac6=>_0x142ac6[_0x9112dc(0xca)]===SKILL_FILE),_0x45214a=fileText(_0x26d503),_0x588b88=getRuntimeSkillDir(_0x5ed164[_0x9112dc(0xbb)],_0x5ed164[_0x9112dc(0xc5)],_0x5ed164[_0x9112dc(0xb3)],_0x691b0,_0x2740c4,_0x5ed164[_0x9112dc(0xb8)]),_0xe17655=resolve(_0x588b88,SKILL_FILE),_0x168b4e=resolve(_0x588b88,METADATA_FILE),_0x31bb29=contentHash(_0x45214a),_0x49d876=readMetadataIfPresent(_0x168b4e)?.[_0x9112dc(0x9c)];ensurePulledFilesCanBeOverwritten(_0x588b88,_0x168b4e,_0x228e30,_0x5ed164[_0x9112dc(0xb9)]===!![]),mkdirSync(_0x588b88,{'recursive':!![],'mode':0x1c0});const _0xe14c28=existsSync(_0xe17655)?readFileSync(_0xe17655,'utf8'):undefined;return materializeFiles(_0x588b88,_0x228e30),removeStaleManagedFiles(_0x588b88,_0x49d876,_0x228e30),writeJsonAtomic(_0x168b4e,buildMetadata(_0x2f9dae,_0x691b0,_0x5ed164[_0x9112dc(0xb3)],_0x31bb29,_0x5ed164[_0x9112dc(0xa0)],_0x228e30,_0x29051e)),{'skill':_0x2f9dae,'scope':_0x691b0,'dir':_0x588b88,'skillMdPath':_0xe17655,'metadataPath':_0x168b4e,'contentHash':_0x31bb29,'changed':_0xe14c28!==_0x45214a};}export function reuseMaterializedRuntimeSkill(_0x3d0eca,_0x224fea,_0x3177ba){const _0x47f5f1=a141_0x52de,_0x27e4f0=_0x3d0eca[_0x47f5f1(0xa9)]?.[_0x47f5f1(0xbf)]();if(!_0x27e4f0)return undefined;const _0x183514=requireSkillCode(_0x3d0eca),_0x4b6d21=getRuntimeSkillDir(_0x3177ba['env'],_0x3177ba[_0x47f5f1(0xc5)],_0x3177ba['appCode'],_0x224fea,_0x183514,_0x3177ba[_0x47f5f1(0xb8)]),_0x58368f=resolve(_0x4b6d21,SKILL_FILE),_0x130104=resolve(_0x4b6d21,METADATA_FILE),_0x3b8bbb=readMetadataIfPresent(_0x130104);if(!_0x3b8bbb||_0x3b8bbb[_0x47f5f1(0xaa)]!==0x2||_0x3b8bbb[_0x47f5f1(0xb3)]!==_0x3177ba[_0x47f5f1(0xb3)]||_0x3b8bbb['scope']!==_0x224fea||_0x3b8bbb[_0x47f5f1(0xa4)]!==_0x183514||_0x3b8bbb[_0x47f5f1(0xa9)]!==_0x27e4f0||_0x3b8bbb['id']!==_0x3d0eca['id']||_0x3b8bbb[_0x47f5f1(0xba)]!==_0x3d0eca[_0x47f5f1(0xba)]||_0x3b8bbb[_0x47f5f1(0x94)]!==_0x3d0eca['description']||_0x3b8bbb['example']!==_0x3d0eca['example']||_0x3b8bbb[_0x47f5f1(0xa1)]!==_0x3d0eca[_0x47f5f1(0xa1)]||!_0x3b8bbb[_0x47f5f1(0x93)]||!_0x3b8bbb['fileHashes']||!Object['hasOwn'](_0x3b8bbb[_0x47f5f1(0x9c)],SKILL_FILE))return undefined;for(const [_0xa6ff81,_0x5d9f9d]of Object[_0x47f5f1(0x98)](_0x3b8bbb[_0x47f5f1(0x9c)])){if(!/^[a-f0-9]{64}$/['test'](_0x5d9f9d))return undefined;const _0x1e4113=resolveManagedFilePath(_0x4b6d21,_0xa6ff81);if(!existsSync(_0x1e4113)||!lstatSync(_0x1e4113)['isFile']())return undefined;if(bufferSha256(readFileSync(_0x1e4113))!==_0x5d9f9d)return undefined;}return{'skill':_0x3d0eca,'scope':_0x224fea,'dir':_0x4b6d21,'skillMdPath':_0x58368f,'metadataPath':_0x130104,'contentHash':_0x3b8bbb[_0x47f5f1(0x93)],'changed':![]};}function withMaterializedSkillFrontmatter(_0x769f50,_0x3021b3,_0x55e95f){const _0x4b20bb=a141_0x52de,_0x5b7977=skillDisplayName(_0x3021b3,_0x55e95f),_0x119320=_0x3021b3[_0x4b20bb(0x94)]?.['trim']()||_0x5b7977||_0x55e95f;return normalizeLocalFiles(_0x769f50)[_0x4b20bb(0xc2)](_0x4dc1f1=>{const _0x5db655=_0x4b20bb,_0x1bd2a4=fileText(_0x4dc1f1);if(_0x4dc1f1['path']!==SKILL_FILE)return _0x4dc1f1;if(hasYamlFrontmatter(_0x1bd2a4))return{'path':_0x4dc1f1['path'],'content':withSyncedDisplayName(_0x1bd2a4,_0x5b7977)};return{'path':_0x4dc1f1[_0x5db655(0xca)],'content':prependSkillFrontmatter(_0x1bd2a4,{'name':_0x55e95f,'displayName':_0x5b7977,'description':_0x119320})};});}function hasYamlFrontmatter(_0x356875){return/^\uFEFF?---\s*\r?\n/['test'](_0x356875);}function prependSkillFrontmatter(_0x46761b,_0x33e4f3){const _0x46f378=a141_0x52de,_0x594e42=_0x46761b['replace'](/^\uFEFF/,'');return['---',_0x46f378(0x9f)+yamlString(_0x33e4f3[_0x46f378(0xa6)]),_0x33e4f3[_0x46f378(0xad)]?_0x46f378(0xc3)+yamlString(_0x33e4f3[_0x46f378(0xad)]):undefined,_0x46f378(0xc8)+yamlString(_0x33e4f3[_0x46f378(0x94)]),_0x46f378(0xb6),'',_0x594e42][_0x46f378(0x96)](_0x5c90c3=>_0x5c90c3!==undefined)[_0x46f378(0xa5)]('\x0a');}function yamlString(_0x3a6de7){const _0x1f7ccc=a141_0x52de;return JSON[_0x1f7ccc(0xa2)](_0x3a6de7[_0x1f7ccc(0xa3)](/\r/g,'')[_0x1f7ccc(0xbf)]());}function skillDisplayName(_0x3f5eba,_0x585019){const _0x4035fb=a141_0x52de,_0x5c41ff=_0x3f5eba[_0x4035fb(0xba)]?.[_0x4035fb(0xbf)]();return _0x5c41ff||_0x585019;}function withSyncedDisplayName(_0x5e99f1,_0x2f584b){const _0x3a992b=a141_0x52de,_0x34c04d=_0x5e99f1[_0x3a992b(0xab)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x34c04d)return _0x5e99f1;const _0x1b24c0=_0x34c04d[0x1]??'',_0x20eb6d=_0x34c04d[0x2]??'',_0x421bdf=parseDocument(_0x20eb6d);if(_0x421bdf[_0x3a992b(0xa8)][_0x3a992b(0xb1)]>0x0||!isMap(_0x421bdf[_0x3a992b(0xc1)]))return _0x5e99f1;if(_0x2f584b)_0x421bdf['set']('displayName',_0x2f584b);else{if(_0x421bdf[_0x3a992b(0x97)](_0x3a992b(0xad)))_0x421bdf[_0x3a992b(0xb2)](_0x3a992b(0xad));else return _0x5e99f1;}forceBlockCollections(_0x421bdf['contents']);const _0x3350aa=_0x421bdf[_0x3a992b(0x95)]({'lineWidth':0x0})[_0x3a992b(0xb7)](),_0x5149eb=_0x5e99f1[_0x3a992b(0xc9)](_0x34c04d[0x0]['length'])['replace'](/^\r?\n/,'');return _0x1b24c0+_0x3a992b(0x92)+_0x3350aa+_0x3a992b(0xc0)+_0x5149eb;}function forceBlockCollections(_0x5551e4){if(!isNode(_0x5551e4))return;visit(_0x5551e4,(_0x22756a,_0x58139e)=>{isCollection(_0x58139e)&&(_0x58139e['flow']=![]);});}function ensurePulledFilesCanBeOverwritten(_0x24707e,_0x34597d,_0x137c31,_0x288441){const _0xded2e5=a141_0x52de;if(_0x288441||!existsSync(_0x34597d))return;const _0x5f39f5=readMetadataIfPresent(_0x34597d);if(!_0x5f39f5)return;const _0x2b86f3=_0x5f39f5[_0xded2e5(0x9c)]&&Object['keys'](_0x5f39f5[_0xded2e5(0x9c)])[_0xded2e5(0xb1)]>0x0?_0x5f39f5['fileHashes']:undefined;if(_0x2b86f3)for(const [_0x1816ec,_0x1dfc01]of Object[_0xded2e5(0x98)](_0x2b86f3)){const _0x429266=resolveManagedFilePath(_0x24707e,_0x1816ec);if(!existsSync(_0x429266))throw CliErrors['validation'](_0xded2e5(0x9d)+_0x24707e,'Managed\x20file\x20was\x20removed\x20locally:\x20'+_0x1816ec);const _0x32082b=lstatSync(_0x429266);if(!_0x32082b[_0xded2e5(0xaf)]())throw CliErrors[_0xded2e5(0xb4)](_0xded2e5(0x9d)+_0x24707e,'Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20'+_0x1816ec);const _0x234485=bufferSha256(readFileSync(_0x429266));if(_0x234485!==_0x1dfc01)throw CliErrors['validation'](_0xded2e5(0x9d)+_0x24707e+'.\x20Changed\x20file:\x20'+_0x1816ec,_0xded2e5(0xae)+_0x1816ec);}else{const _0x32f4a5=resolve(_0x24707e,SKILL_FILE);if(existsSync(_0x32f4a5)&&_0x5f39f5[_0xded2e5(0x93)]){const _0x165553=contentHash(readFileSync(_0x32f4a5,_0xded2e5(0x9b)));if(_0x165553!==_0x5f39f5['contentHash'])throw CliErrors[_0xded2e5(0xb4)](_0xded2e5(0xbe)+_0x32f4a5,'Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.');}}for(const _0x62b17c of normalizeLocalFiles(_0x137c31)){if(_0x2b86f3?.[_0x62b17c['path']])continue;if(!_0x2b86f3&&_0x62b17c['path']===SKILL_FILE)continue;const _0x533442=resolveManagedFilePath(_0x24707e,_0x62b17c['path']);if(!existsSync(_0x533442))continue;const _0x2aa022=lstatSync(_0x533442);if(!_0x2aa022[_0xded2e5(0xaf)]())throw CliErrors[_0xded2e5(0xb4)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x24707e,_0xded2e5(0xc4)+_0x62b17c[_0xded2e5(0xca)]);const _0x1ddd1d=bufferSha256(readFileSync(_0x533442));if(_0x1ddd1d!==fileHash(_0x62b17c))throw CliErrors[_0xded2e5(0xb4)](_0xded2e5(0x9d)+_0x24707e,_0xded2e5(0xc7)+_0x62b17c['path']);}}function materializeFiles(_0x549315,_0x1682a8){const _0x19f7ea=a141_0x52de;for(const _0x451dbb of normalizeLocalFiles(_0x1682a8)){const _0x51ce6f=resolveManagedFilePath(_0x549315,_0x451dbb[_0x19f7ea(0xca)]);mkdirSync(dirname(_0x51ce6f),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x51ce6f,fileContent(_0x451dbb),0x180);}}function removeStaleManagedFiles(_0xbf8c6a,_0x1df292,_0x580ec0){const _0x17b9db=a141_0x52de;if(!_0x1df292)return;const _0x25a04e=new Set(normalizeLocalFiles(_0x580ec0)[_0x17b9db(0xc2)](_0x3046b4=>_0x3046b4[_0x17b9db(0xca)]));for(const _0x514f5f of Object[_0x17b9db(0xbd)](_0x1df292)){if(_0x25a04e[_0x17b9db(0x97)](_0x514f5f))continue;const _0x41ce01=resolveManagedFilePath(_0xbf8c6a,_0x514f5f);existsSync(_0x41ce01)&&lstatSync(_0x41ce01)[_0x17b9db(0xaf)]()&&rmSync(_0x41ce01,{'force':!![]});}}
@@ -1 +1 @@
1
- (function(_0x59b027,_0x3d2d67){const _0x20b07e=a142_0x5829,_0x2c639d=_0x59b027();while(!![]){try{const _0x229a17=parseInt(_0x20b07e(0x156))/0x1+parseInt(_0x20b07e(0x145))/0x2*(parseInt(_0x20b07e(0x15f))/0x3)+parseInt(_0x20b07e(0x141))/0x4*(-parseInt(_0x20b07e(0x15c))/0x5)+parseInt(_0x20b07e(0x154))/0x6+-parseInt(_0x20b07e(0x144))/0x7*(-parseInt(_0x20b07e(0x148))/0x8)+parseInt(_0x20b07e(0x164))/0x9+-parseInt(_0x20b07e(0x165))/0xa;if(_0x229a17===_0x3d2d67)break;else _0x2c639d['push'](_0x2c639d['shift']());}catch(_0x13d4a7){_0x2c639d['push'](_0x2c639d['shift']());}}}(a142_0x3948,0x8cda4));import{existsSync,readFileSync}from'node:fs';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';function a142_0x5829(_0x25c6ca,_0x119c4c){_0x25c6ca=_0x25c6ca-0x140;const _0x394829=a142_0x3948();let _0x58294e=_0x394829[_0x25c6ca];return _0x58294e;}import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';function a142_0x3948(){const _0x2d215e=['description','389747VuvrEy','isArray','personal','string','utf8','parse','97585MRbTrT','fromEntries','tenantCode','1158oWJfwD','skillCode','example','userId','zipSize','2872512zBtTIA','19565840wmBKXf','path','40jKyriX','sourceSessionId','forkedFromVersion','7287ThoGwC','5638XQSwEE','Invalid\x20','ossPath','4968FlkCuX','length','forkedFromSkillId','map','version','status','trim','toISOString','manifest','validation','Runtime\x20Skill\x20is\x20missing\x20skillCode.','readonly','1711056WVwPmy'];a142_0x3948=function(){return _0x2d215e;};return a142_0x3948();}import{fileContent,normalizeLocalFiles}from'./local-files.js';import{buildSkillPackage,localFilesToManifestFiles}from'./zip-package.js';export function buildMetadata(_0x11e999,_0x4cd9fe,_0x4ff493,_0x6663ee,_0x151279,_0x8a15ec,_0xe5c6b1){const _0x4c9a20=a142_0x5829,_0x2aa5c4=_0x8a15ec?normalizeLocalFiles(_0x8a15ec):[],_0x2fd780=!_0xe5c6b1&&_0x2aa5c4[_0x4c9a20(0x149)]>0x0?buildSkillPackage(_0x2aa5c4):undefined,_0x149520=_0xe5c6b1?bufferSha256(_0xe5c6b1):_0x2fd780?.[_0x4c9a20(0x150)]['zipSha256'],_0x2f8671=_0xe5c6b1?.['length']??_0x2fd780?.[_0x4c9a20(0x150)][_0x4c9a20(0x163)],_0x2ced30=_0x2aa5c4['length']>0x0?Object[_0x4c9a20(0x15d)](_0x2aa5c4['map'](_0x31aa47=>[_0x31aa47[_0x4c9a20(0x140)],fileHash(_0x31aa47)])):undefined;return{'schemaVersion':_0x2aa5c4['length']>0x0?0x2:0x1,'id':_0x11e999['id'],'appCode':_0x4ff493,'skillCode':requireSkillCode(_0x11e999),'skillName':_0x11e999['skillName'],'description':_0x11e999[_0x4c9a20(0x155)],'example':_0x11e999[_0x4c9a20(0x161)],'scope':_0x4cd9fe,'readonly':_0x4cd9fe!==_0x4c9a20(0x158)||_0x11e999[_0x4c9a20(0x153)]===!![],'tenantCode':_0x11e999[_0x4c9a20(0x15e)],'userId':_0x11e999[_0x4c9a20(0x162)],'version':_0x11e999[_0x4c9a20(0x14c)],'status':_0x11e999[_0x4c9a20(0x14d)],'tags':Array['isArray'](_0x11e999['tags'])?_0x11e999['tags']:[],'hasUpstreamUpdate':_0x11e999['hasUpstreamUpdate'],'forkedFromSkillId':_0x11e999[_0x4c9a20(0x14a)],'forkedFromVersion':_0x11e999[_0x4c9a20(0x143)],'sourceSessionId':_0x11e999[_0x4c9a20(0x142)],'contentHash':_0x6663ee,'fileHashes':_0x2ced30,'treeHash':_0x2aa5c4[_0x4c9a20(0x149)]>0x0?fileTreeHash(localFilesToManifestFiles(_0x2aa5c4)):undefined,'ossPath':remoteManifestOssPath(_0x11e999['files']),'zipSha256':_0x149520,'zipSize':_0x2f8671,'files':_0x2aa5c4[_0x4c9a20(0x149)]>0x0?_0x2aa5c4[_0x4c9a20(0x14b)](_0x5ff54c=>({'path':_0x5ff54c[_0x4c9a20(0x140)],'hash':fileHash(_0x5ff54c),'size':fileContent(_0x5ff54c)[_0x4c9a20(0x149)]})):undefined,'pulledAt':_0x151279??new Date()[_0x4c9a20(0x14f)]()};}export function requireSkillCode(_0x194d97){const _0x535ab3=a142_0x5829,_0x104547=_0x194d97[_0x535ab3(0x160)]?.[_0x535ab3(0x14e)]();if(!_0x104547)throw CliErrors[_0x535ab3(0x151)](_0x535ab3(0x152));return _0x104547;}export function readMetadataIfPresent(_0x5f0664){const _0x5e0328=a142_0x5829;if(!existsSync(_0x5f0664))return undefined;try{const _0x18a5de=JSON[_0x5e0328(0x15b)](readFileSync(_0x5f0664,_0x5e0328(0x15a)));return _0x18a5de;}catch{throw CliErrors[_0x5e0328(0x151)](_0x5e0328(0x146)+METADATA_FILE+':\x20'+_0x5f0664);}}function remoteManifestOssPath(_0x3e9421){const _0x2e970a=a142_0x5829;if(!_0x3e9421||typeof _0x3e9421!=='object'||Array[_0x2e970a(0x157)](_0x3e9421))return undefined;const _0x5ac383=_0x3e9421[_0x2e970a(0x147)];return typeof _0x5ac383===_0x2e970a(0x159)&&_0x5ac383[_0x2e970a(0x14e)]()?_0x5ac383[_0x2e970a(0x14e)]():undefined;}
1
+ (function(_0x3ddf1f,_0x104ab1){const _0x52f18d=a142_0x2ef2,_0x456803=_0x3ddf1f();while(!![]){try{const _0x2a03d1=-parseInt(_0x52f18d(0x198))/0x1+-parseInt(_0x52f18d(0x196))/0x2+-parseInt(_0x52f18d(0x183))/0x3+-parseInt(_0x52f18d(0x184))/0x4*(parseInt(_0x52f18d(0x19a))/0x5)+-parseInt(_0x52f18d(0x1a2))/0x6*(parseInt(_0x52f18d(0x186))/0x7)+-parseInt(_0x52f18d(0x197))/0x8+parseInt(_0x52f18d(0x182))/0x9*(parseInt(_0x52f18d(0x19b))/0xa);if(_0x2a03d1===_0x104ab1)break;else _0x456803['push'](_0x456803['shift']());}catch(_0x4c7996){_0x456803['push'](_0x456803['shift']());}}}(a142_0x5dcb,0x83e24));import{existsSync,readFileSync}from'node:fs';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';import{fileContent,normalizeLocalFiles}from'./local-files.js';function a142_0x2ef2(_0x248c29,_0x3b9f58){_0x248c29=_0x248c29-0x181;const _0x5dcb61=a142_0x5dcb();let _0x2ef2e1=_0x5dcb61[_0x248c29];return _0x2ef2e1;}import{buildSkillPackage,localFilesToManifestFiles}from'./zip-package.js';function a142_0x5dcb(){const _0x2d3fcd=['manifest','parse','path','678DpHndp','Runtime\x20Skill\x20is\x20missing\x20skillCode.','personal','724833dgBsFh','1485558tBmoQH','160936ShQCjl','isArray','287ZVJiXC','trim','tags','ossPath','files','map','skillCode','object','description','status','fromEntries','zipSha256','Invalid\x20','forkedFromVersion','validation','readonly','414296RFPYtq','4519680GVCFjo','443189PxbCJa','length','40EVVQXn','320nxGNQQ','skillName','userId','hasUpstreamUpdate'];a142_0x5dcb=function(){return _0x2d3fcd;};return a142_0x5dcb();}export function buildMetadata(_0x561e15,_0x446318,_0x2c49e7,_0x4db8e7,_0x589467,_0x84ad62,_0x40f3a6){const _0x54ca93=a142_0x2ef2,_0x4326d8=_0x84ad62?normalizeLocalFiles(_0x84ad62):[],_0x4abeca=!_0x40f3a6&&_0x4326d8[_0x54ca93(0x199)]>0x0?buildSkillPackage(_0x4326d8):undefined,_0x41eb80=_0x40f3a6?bufferSha256(_0x40f3a6):_0x4abeca?.[_0x54ca93(0x19f)][_0x54ca93(0x191)],_0x312ba1=_0x40f3a6?.[_0x54ca93(0x199)]??_0x4abeca?.[_0x54ca93(0x19f)]['zipSize'],_0x23173b=_0x4326d8[_0x54ca93(0x199)]>0x0?Object[_0x54ca93(0x190)](_0x4326d8[_0x54ca93(0x18b)](_0x494bea=>[_0x494bea[_0x54ca93(0x1a1)],fileHash(_0x494bea)])):undefined;return{'schemaVersion':_0x4326d8['length']>0x0?0x2:0x1,'id':_0x561e15['id'],'appCode':_0x2c49e7,'skillCode':requireSkillCode(_0x561e15),'skillName':_0x561e15[_0x54ca93(0x19c)],'description':_0x561e15[_0x54ca93(0x18e)],'example':_0x561e15['example'],'scope':_0x446318,'readonly':_0x446318!==_0x54ca93(0x181)||_0x561e15[_0x54ca93(0x195)]===!![],'tenantCode':_0x561e15['tenantCode'],'userId':_0x561e15[_0x54ca93(0x19d)],'version':_0x561e15['version'],'status':_0x561e15[_0x54ca93(0x18f)],'tags':Array[_0x54ca93(0x185)](_0x561e15[_0x54ca93(0x188)])?_0x561e15[_0x54ca93(0x188)]:[],'hasUpstreamUpdate':_0x561e15[_0x54ca93(0x19e)],'forkedFromSkillId':_0x561e15['forkedFromSkillId'],'forkedFromVersion':_0x561e15[_0x54ca93(0x193)],'sourceSessionId':_0x561e15['sourceSessionId'],'contentHash':_0x4db8e7,'fileHashes':_0x23173b,'treeHash':_0x4326d8[_0x54ca93(0x199)]>0x0?fileTreeHash(localFilesToManifestFiles(_0x4326d8)):undefined,'ossPath':remoteManifestOssPath(_0x561e15[_0x54ca93(0x18a)]),'zipSha256':_0x41eb80,'zipSize':_0x312ba1,'files':_0x4326d8['length']>0x0?_0x4326d8[_0x54ca93(0x18b)](_0x2b2243=>({'path':_0x2b2243[_0x54ca93(0x1a1)],'hash':fileHash(_0x2b2243),'size':fileContent(_0x2b2243)[_0x54ca93(0x199)]})):undefined,'pulledAt':_0x589467??new Date()['toISOString']()};}export function requireSkillCode(_0x23cafe){const _0x3534a8=a142_0x2ef2,_0x4d7b0c=_0x23cafe[_0x3534a8(0x18c)]?.['trim']();if(!_0x4d7b0c)throw CliErrors['validation'](_0x3534a8(0x1a3));return _0x4d7b0c;}export function readMetadataIfPresent(_0x1d032f){const _0x92a641=a142_0x2ef2;if(!existsSync(_0x1d032f))return undefined;try{const _0x45fc45=JSON[_0x92a641(0x1a0)](readFileSync(_0x1d032f,'utf8'));return _0x45fc45;}catch{throw CliErrors[_0x92a641(0x194)](_0x92a641(0x192)+METADATA_FILE+':\x20'+_0x1d032f);}}function remoteManifestOssPath(_0x2e0eac){const _0xf68888=a142_0x2ef2;if(!_0x2e0eac||typeof _0x2e0eac!==_0xf68888(0x18d)||Array[_0xf68888(0x185)](_0x2e0eac))return undefined;const _0x3f7a48=_0x2e0eac[_0xf68888(0x189)];return typeof _0x3f7a48==='string'&&_0x3f7a48[_0xf68888(0x187)]()?_0x3f7a48[_0xf68888(0x187)]():undefined;}
@@ -1 +1 @@
1
- function a143_0xd4c2(_0x459597,_0x31545f){_0x459597=_0x459597-0x69;const _0x35ad9b=a143_0x35ad();let _0xd4c29b=_0x35ad9b[_0x459597];return _0xd4c29b;}(function(_0x305eb8,_0x598642){const _0x45f331=a143_0xd4c2,_0x177d9e=_0x305eb8();while(!![]){try{const _0x57151e=-parseInt(_0x45f331(0x6c))/0x1+-parseInt(_0x45f331(0x75))/0x2*(parseInt(_0x45f331(0x6b))/0x3)+parseInt(_0x45f331(0x6a))/0x4*(parseInt(_0x45f331(0x70))/0x5)+-parseInt(_0x45f331(0x7d))/0x6+-parseInt(_0x45f331(0x7a))/0x7+-parseInt(_0x45f331(0x81))/0x8*(parseInt(_0x45f331(0x72))/0x9)+parseInt(_0x45f331(0x79))/0xa;if(_0x57151e===_0x598642)break;else _0x177d9e['push'](_0x177d9e['shift']());}catch(_0x4fef27){_0x177d9e['push'](_0x177d9e['shift']());}}}(a143_0x35ad,0xa1a05));import{existsSync}from'node:fs';import{homedir}from'node:os';function a143_0x35ad(){const _0x238841=['4689153rvHuME','includes','.agents','4857528knvWKt','cache','skillCode','claudeSkillsDir','8vUTBIM','.workbuddy','workbuddySkillsDir','homeDirName','SKILL_ROOT','validation','100DJNBWc','3AyLKOj','196506sPOPQf','trim','cacheRoot','homeDir','230515BTDIGx','filter','8716977gzBwJe','skills','.claude','1435438QEDjVl','CLAUDE_SKILL_ROOT','Unsafe\x20','agentsSkillsDir','28716910Jjjdzc'];a143_0x35ad=function(){return _0x238841;};return a143_0x35ad();}import{resolve}from'node:path';import{fingerprintAccessKey}from'../../commands/app/cache.js';import{PRODUCT_CONFIG,productEnv}from'../../constant/product.js';import{CliErrors}from'../../errors.js';export function resolveSkillSyncPaths(_0x4c3b7c={}){const _0x51eb2f=a143_0xd4c2,_0x3deac4=_0x4c3b7c[_0x51eb2f(0x6f)]??homedir(),_0x54db29=resolve(_0x3deac4,PRODUCT_CONFIG[_0x51eb2f(0x84)],_0x51eb2f(0x7e)),_0x4cd508=trimmedEnv(_0x51eb2f(0x85)),_0x10eedf=trimmedEnv(_0x51eb2f(0x76)),_0x3f4aed=resolve(_0x3deac4,_0x51eb2f(0x82)),_0x11d565=_0x4c3b7c[_0x51eb2f(0x83)]??(existsSync(_0x3f4aed)?resolve(_0x3f4aed,_0x51eb2f(0x73)):undefined);return{'homeDir':_0x3deac4,'cacheRoot':_0x54db29,'managedRoot':resolve(_0x3deac4,PRODUCT_CONFIG['homeDirName']),'agentsSkillsDir':_0x4c3b7c[_0x51eb2f(0x78)]??_0x4cd508??resolve(_0x3deac4,_0x51eb2f(0x7c),'skills'),'claudeSkillsDir':_0x4c3b7c[_0x51eb2f(0x80)]??_0x10eedf??resolve(_0x3deac4,_0x51eb2f(0x74),'skills'),'workbuddySkillsDir':_0x11d565};}export function runtimeAgentSkillRoots(_0x2365ad){const _0x2cfaff=a143_0xd4c2;return[_0x2365ad[_0x2cfaff(0x78)],_0x2365ad[_0x2cfaff(0x80)],_0x2365ad[_0x2cfaff(0x83)]][_0x2cfaff(0x71)](_0x42ba5c=>Boolean(_0x42ba5c));}export function getRuntimeSkillCacheRoot(_0x46eebf,_0x12e31f,_0x704d1d={}){const _0x1e13f1=a143_0xd4c2,_0xe59670=resolveSkillSyncPaths(_0x704d1d);return resolve(_0xe59670[_0x1e13f1(0x6e)],_0x46eebf,fingerprintAccessKey(_0x12e31f),'skills');}export function getRuntimeSkillDir(_0x10e486,_0x227e5d,_0x191a7b,_0x2bbbea,_0x15ae54,_0x3328fc={}){const _0x55a98b=a143_0xd4c2;return resolve(getRuntimeSkillCacheRoot(_0x10e486,_0x227e5d,_0x3328fc),safePathSegment(_0x191a7b,'appCode'),_0x2bbbea,safePathSegment(_0x15ae54,_0x55a98b(0x7f)));}export function safePathSegment(_0x51c3e9,_0x18719b='path\x20segment'){const _0x59fbaa=a143_0xd4c2;if(!_0x51c3e9||_0x51c3e9[_0x59fbaa(0x7b)]('/')||_0x51c3e9[_0x59fbaa(0x7b)]('\x5c')||_0x51c3e9[_0x59fbaa(0x7b)]('..'))throw CliErrors[_0x59fbaa(0x69)](_0x59fbaa(0x77)+_0x18719b+'\x20for\x20local\x20path:\x20'+_0x51c3e9);return _0x51c3e9;}function trimmedEnv(_0x22e596){const _0x16f338=a143_0xd4c2,_0x25333c=productEnv(_0x22e596)?.[_0x16f338(0x6d)]();return _0x25333c?_0x25333c:undefined;}
1
+ function a143_0xf705(){const _0x496332=['cache','skills','workbuddySkillsDir','6owpQec','89992YeNByo','trim','CLAUDE_SKILL_ROOT','4274SUMYfa','335847RAxwJR','SKILL_ROOT','3291760rGHjHB','.claude','975212GqbIUS','skillCode','72nfjTOu','.agents','homeDirName','.workbuddy','1385349tJqiSB','1YTbVtY','1124825gaYzyB','Unsafe\x20','cacheRoot','validation','claudeSkillsDir'];a143_0xf705=function(){return _0x496332;};return a143_0xf705();}(function(_0x4bbb53,_0x5383b4){const _0x338c68=a143_0x358e,_0xe3969a=_0x4bbb53();while(!![]){try{const _0x5a12f7=-parseInt(_0x338c68(0x81))/0x1*(parseInt(_0x338c68(0x75))/0x2)+-parseInt(_0x338c68(0x76))/0x3+parseInt(_0x338c68(0x7a))/0x4+-parseInt(_0x338c68(0x69))/0x5*(-parseInt(_0x338c68(0x71))/0x6)+parseInt(_0x338c68(0x80))/0x7+parseInt(_0x338c68(0x72))/0x8*(-parseInt(_0x338c68(0x7c))/0x9)+-parseInt(_0x338c68(0x78))/0xa;if(_0x5a12f7===_0x5383b4)break;else _0xe3969a['push'](_0xe3969a['shift']());}catch(_0x36883f){_0xe3969a['push'](_0xe3969a['shift']());}}}(a143_0xf705,0x2092d));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';function a143_0x358e(_0x547b35,_0x30842a){_0x547b35=_0x547b35-0x69;const _0xf705d0=a143_0xf705();let _0x358e6b=_0xf705d0[_0x547b35];return _0x358e6b;}import{CliErrors}from'../../errors.js';export function resolveSkillSyncPaths(_0x3b1181={}){const _0x1823a2=a143_0x358e,_0x108460=_0x3b1181['homeDir']??homedir(),_0x519384=resolve(_0x108460,PRODUCT_CONFIG[_0x1823a2(0x7e)],_0x1823a2(0x6e)),_0x4ef338=trimmedEnv(_0x1823a2(0x77)),_0x5ce6e1=trimmedEnv(_0x1823a2(0x74)),_0x2eb290=resolve(_0x108460,_0x1823a2(0x7f)),_0x291a02=_0x3b1181['workbuddySkillsDir']??(existsSync(_0x2eb290)?resolve(_0x2eb290,'skills'):undefined);return{'homeDir':_0x108460,'cacheRoot':_0x519384,'managedRoot':resolve(_0x108460,PRODUCT_CONFIG['homeDirName']),'agentsSkillsDir':_0x3b1181['agentsSkillsDir']??_0x4ef338??resolve(_0x108460,_0x1823a2(0x7d),_0x1823a2(0x6f)),'claudeSkillsDir':_0x3b1181[_0x1823a2(0x6d)]??_0x5ce6e1??resolve(_0x108460,_0x1823a2(0x79),_0x1823a2(0x6f)),'workbuddySkillsDir':_0x291a02};}export function runtimeAgentSkillRoots(_0x2e89f5){const _0x23cf0a=a143_0x358e;return[_0x2e89f5['agentsSkillsDir'],_0x2e89f5[_0x23cf0a(0x6d)],_0x2e89f5[_0x23cf0a(0x70)]]['filter'](_0x4d90b2=>Boolean(_0x4d90b2));}export function getRuntimeSkillCacheRoot(_0x6ed942,_0x1950b5,_0x4eeedc={}){const _0x589adc=a143_0x358e,_0x42897c=resolveSkillSyncPaths(_0x4eeedc);return resolve(_0x42897c[_0x589adc(0x6b)],_0x6ed942,fingerprintAccessKey(_0x1950b5),'skills');}export function getRuntimeSkillDir(_0x587b4d,_0x11dc68,_0x277de9,_0x148332,_0x4ead3d,_0xd7c0ab={}){const _0x3c2ba8=a143_0x358e;return resolve(getRuntimeSkillCacheRoot(_0x587b4d,_0x11dc68,_0xd7c0ab),safePathSegment(_0x277de9,'appCode'),_0x148332,safePathSegment(_0x4ead3d,_0x3c2ba8(0x7b)));}export function safePathSegment(_0x22c355,_0x1086a3='path\x20segment'){const _0x4233e7=a143_0x358e;if(!_0x22c355||_0x22c355['includes']('/')||_0x22c355['includes']('\x5c')||_0x22c355['includes']('..'))throw CliErrors[_0x4233e7(0x6c)](_0x4233e7(0x6a)+_0x1086a3+'\x20for\x20local\x20path:\x20'+_0x22c355);return _0x22c355;}function trimmedEnv(_0x14a35e){const _0x6f838e=a143_0x358e,_0x515c50=productEnv(_0x14a35e)?.[_0x6f838e(0x73)]();return _0x515c50?_0x515c50:undefined;}
@@ -1 +1 @@
1
- (function(_0x3a7a24,_0x3cc9f2){const _0x1a7b5f=a144_0x24f2,_0x5041bc=_0x3a7a24();while(!![]){try{const _0x124740=parseInt(_0x1a7b5f(0xec))/0x1*(parseInt(_0x1a7b5f(0xf3))/0x2)+parseInt(_0x1a7b5f(0xfb))/0x3+-parseInt(_0x1a7b5f(0x121))/0x4*(-parseInt(_0x1a7b5f(0x104))/0x5)+parseInt(_0x1a7b5f(0x11c))/0x6+-parseInt(_0x1a7b5f(0x109))/0x7*(-parseInt(_0x1a7b5f(0xf0))/0x8)+parseInt(_0x1a7b5f(0x100))/0x9+parseInt(_0x1a7b5f(0xff))/0xa*(-parseInt(_0x1a7b5f(0x113))/0xb);if(_0x124740===_0x3cc9f2)break;else _0x5041bc['push'](_0x5041bc['shift']());}catch(_0x5f318b){_0x5041bc['push'](_0x5041bc['shift']());}}}(a144_0x5ca8,0xbc375));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a144_0xc7253d}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{writeJsonAtomic}from'./fs-utils.js';import{contentHash}from'./hashing.js';import{fileText,normalizeLocalFiles,scanSkillDirectory}from'./local-files.js';import{buildMetadata,readMetadataIfPresent}from'./metadata.js';import{buildSkillPackage,tryNormalizePackageManifest}from'./zip-package.js';export function resolvePushDirectoryIdentity(_0x1b6231,_0x4f4af7,_0x31851d={}){const _0x39363f=a144_0x24f2,_0x40f496=resolvePushDirectoryRoot(_0x1b6231),_0x18758e=readPushMetadataIfPresent(resolve(_0x40f496,METADATA_FILE),{'ignoreInvalidMetadata':_0x31851d['ignoreInvalidMetadata']});if(_0x18758e?.[_0x39363f(0xf7)]&&_0x18758e[_0x39363f(0xf7)]!==_0x4f4af7&&!_0x31851d['allowAppCodeRetarget']&&!_0x31851d[_0x39363f(0x120)])throw CliErrors[_0x39363f(0x114)](_0x39363f(0x116)+_0x18758e[_0x39363f(0xf7)]+'\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22'+_0x4f4af7+'\x22.');const _0x174c48=resolvePushSkillCode(_0x40f496,_0x4f4af7,_0x18758e,_0x31851d);if(!_0x174c48)throw CliErrors[_0x39363f(0x114)](_0x39363f(0xef)+SKILL_FILE+',\x20'+METADATA_FILE+_0x39363f(0x126));return{'dir':_0x40f496,'skillCode':_0x174c48,'metadata':_0x18758e};}export function readPushDirectory(_0x47ddc4,_0x157d21,_0x4daa6c={}){const _0x1582cf=a144_0x24f2,_0x18ef50=resolvePushDirectoryIdentity(_0x47ddc4,_0x157d21,_0x4daa6c),_0x5f2ea2=_0x18ef50['dir'],_0x4019fd=resolve(_0x5f2ea2,SKILL_FILE);if(!existsSync(_0x4019fd)||!lstatSync(_0x4019fd)[_0x1582cf(0x111)]())throw CliErrors['validation']('Missing\x20'+SKILL_FILE+':\x20'+_0x4019fd);const _0x46b496=_0x18ef50[_0x1582cf(0xf2)],_0x548067=_0x4daa6c[_0x1582cf(0xf5)]??_0x1582cf(0x110);if(!_0x4daa6c[_0x1582cf(0x102)]&&_0x46b496?.[_0x1582cf(0x127)]===_0x1582cf(0xed))throw CliErrors[_0x1582cf(0x114)]('Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20'+METADATA_FILE+'\x20has\x20scope=\x22'+_0x46b496['scope']+'\x22.');if(!_0x4daa6c[_0x1582cf(0x102)]&&_0x548067===_0x1582cf(0x110)&&_0x46b496?.['scope']&&_0x46b496[_0x1582cf(0x127)]!=='personal')throw CliErrors[_0x1582cf(0x114)]('Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20'+METADATA_FILE+_0x1582cf(0xf8)+_0x46b496[_0x1582cf(0x127)]+'\x22.','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20'+_0x5f2ea2+_0x1582cf(0x108));const _0x76b668=scanSkillDirectory(_0x5f2ea2,{'excludedFilePaths':_0x4daa6c['excludedFilePaths']}),_0x188789=buildSkillPackage(_0x76b668),_0x2ea4fd=readFileSync(_0x4019fd,'utf8'),_0x28b960=_0x18ef50[_0x1582cf(0x10f)],_0x3cbe3c=_0x4daa6c[_0x1582cf(0xf1)]?undefined:_0x46b496,_0x2862e4=readSkillDisplayName(_0x2ea4fd);return{'skillCode':_0x28b960,'metadata':_0x46b496,'frontmatterDisplayName':_0x2862e4,'input':{'skillCode':_0x28b960,'skillName':_0x2862e4??_0x3cbe3c?.[_0x1582cf(0x10c)],'description':_0x3cbe3c?.['description'],'content':_0x2ea4fd,'files':_0x188789[_0x1582cf(0x105)],'packageBase64':_0x188789[_0x1582cf(0x12a)],'tags':_0x3cbe3c?.[_0x1582cf(0x119)],'version':_0x3cbe3c?.['version'],'sourceSessionId':_0x3cbe3c?.[_0x1582cf(0x10d)]}};}function a144_0x24f2(_0x5e663b,_0x4c4cd9){_0x5e663b=_0x5e663b-0xec;const _0x5ca8ec=a144_0x5ca8();let _0x24f252=_0x5ca8ec[_0x5e663b];return _0x24f252;}export function refreshPushDirectoryMetadataFromRemote(_0x3892c5,_0x47cb13,_0x4a6fae,_0x2c14e6={}){const _0x4add75=a144_0x24f2,_0x1fd16c=resolvePushDirectoryRoot(_0x3892c5),_0x4b97f1=readPushMetadataIfPresent(resolve(_0x1fd16c,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x329b59=requireRemoteScope(_0x47cb13),_0x181834=readLocalSkillContent(_0x1fd16c),_0x4e3531={..._0x47cb13,'appCode':_0x47cb13[_0x4add75(0xf7)]??_0x4a6fae,'skillName':_0x47cb13[_0x4add75(0x10c)]??_0x4b97f1?.[_0x4add75(0x10c)],'description':_0x47cb13[_0x4add75(0x11d)]??_0x4b97f1?.['description'],'example':_0x47cb13[_0x4add75(0xfa)]??_0x4b97f1?.['example'],'tags':Array[_0x4add75(0x10e)](_0x47cb13[_0x4add75(0x119)])?_0x47cb13['tags']:_0x4b97f1?.[_0x4add75(0x119)],'sourceSessionId':_0x47cb13['sourceSessionId']??_0x4b97f1?.['sourceSessionId'],'content':_0x47cb13['content']??_0x181834},_0x213a33=buildMetadata(_0x4e3531,_0x329b59,_0x4a6fae,contentHash(_0x181834),_0x2c14e6[_0x4add75(0x118)]);writeJsonAtomic(resolve(_0x1fd16c,METADATA_FILE),_0x213a33);}export function recordPushedRuntimeSkill(_0x201934,_0x8ef0fd,_0x5570c2,_0x1169f9={}){const _0x2f8785=a144_0x24f2,_0x5e661b=resolvePushDirectoryRoot(_0x201934),_0x13649d=scanSkillDirectory(_0x5e661b),_0x5e9048=_0x13649d[_0x2f8785(0xf4)](_0x3654c0=>_0x3654c0[_0x2f8785(0x101)]===SKILL_FILE),_0x1140a5=_0x5e9048?fileText(_0x5e9048):'',_0x2a5693=tryNormalizePackageManifest(_0x8ef0fd[_0x2f8785(0x107)]),_0x22569d={..._0x8ef0fd,'content':_0x8ef0fd[_0x2f8785(0x11b)]??_0x1140a5,'files':_0x2a5693},_0x226463=_0x2a5693?normalizeLocalFiles(_0x13649d)[_0x2f8785(0x124)](_0x3fcc59=>_0x2a5693[_0x2f8785(0x107)][_0x2f8785(0x11e)](_0x22163b=>_0x22163b['path']===_0x3fcc59[_0x2f8785(0x101)])):undefined,_0x3ffc0c=buildMetadata(_0x22569d,_0x1169f9[_0x2f8785(0x127)]??_0x2f8785(0x110),_0x5570c2,contentHash(_0x22569d[_0x2f8785(0x11b)]??''),_0x1169f9['pushedAt'],_0x226463);writeJsonAtomic(resolve(_0x5e661b,METADATA_FILE),_0x3ffc0c);}export function deriveSkillCodeFromDirectory(_0x5c3286,_0x40f600){const _0xb9ac2c=a144_0x24f2,_0x369b31=basename(resolve(_0x5c3286)),_0x4cb5d3=_0x40f600+'--';return _0x369b31['startsWith'](_0x4cb5d3)?_0x369b31[_0xb9ac2c(0x11f)](_0x4cb5d3['length']):_0x369b31;}function resolvePushSkillCode(_0x245857,_0x1e184a,_0x298d4c,_0x4b4519){const _0x90e980=a144_0x24f2,_0x408ad8=deriveSkillCodeFromSkillFile(_0x245857)||deriveSkillCodeFromDirectory(_0x245857,_0x1e184a);if(_0x4b4519[_0x90e980(0xf6)])return _0x408ad8;return _0x298d4c?.[_0x90e980(0x10f)]?.[_0x90e980(0x115)]()||_0x408ad8;}function deriveSkillCodeFromSkillFile(_0x3d6d0e){const _0xc6c305=a144_0x24f2,_0x464d9c=resolve(_0x3d6d0e,SKILL_FILE);if(!existsSync(_0x464d9c)||!lstatSync(_0x464d9c)['isFile']())return undefined;const _0x3b8437=readFileSync(_0x464d9c,_0xc6c305(0x10a)),_0xf806eb=_0x3b8437[_0xc6c305(0xf9)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0xf806eb)return undefined;const _0x3294f3=parseFrontmatterObject(_0xf806eb[0x1]??''),_0x1d238c=scalarToString(_0x3294f3?.[_0xc6c305(0x125)]);return _0x1d238c?slugifySkillName(_0x1d238c):undefined;}function readSkillDisplayName(_0x2ec07d){const _0x59302e=a144_0x24f2,_0x189a58=_0x2ec07d[_0x59302e(0xf9)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x189a58)return undefined;const _0x187a5e=parseFrontmatterObject(_0x189a58[0x1]??'');return scalarToString(_0x187a5e?.['displayName']);}function slugifySkillName(_0x2df6d4){const _0x3518d8=a144_0x24f2,_0x2dbf78=_0x2df6d4[_0x3518d8(0x115)]()['toLowerCase']()['replace'](/[^\p{L}\p{N}\p{So}]+/gu,'-')[_0x3518d8(0x10b)](/^-+/,'')[_0x3518d8(0x10b)](/-+$/,'')['replace'](/-{2,}/g,'-');if(!_0x2dbf78)throw CliErrors[_0x3518d8(0x114)]('Invalid\x20'+SKILL_FILE+_0x3518d8(0x106));return _0x2dbf78;}function parseFrontmatterObject(_0x204b33){const _0x3cc426=a144_0x24f2;try{const _0x3d6314=a144_0xc7253d(_0x204b33);return _0x3d6314&&typeof _0x3d6314===_0x3cc426(0x123)&&!Array[_0x3cc426(0x10e)](_0x3d6314)?_0x3d6314:undefined;}catch{return undefined;}}function a144_0x5ca8(){const _0x349115=['example','1148994WeGeAR','isDirectory','company','number','1004250nXBUjt','2585952PmALwx','path','ignoreMetadataScope','ignoreInvalidMetadata','5ULkXOK','manifest','\x20name\x20for\x20SkillHub\x20slug\x20generation.','files','\x20to\x20submit\x20company\x20Skills\x20for\x20review.','49oafMGl','utf8','replace','skillName','sourceSessionId','isArray','skillCode','personal','isFile','boolean','330wkfnBN','validation','trim','Skill\x20metadata\x20appCode\x20\x22','\x20has\x20unsupported\x20scope\x20\x22','refreshedAt','tags','isSymbolicLink','content','3358542roJjrn','description','some','slice','ignoreMetadataAppCodeMismatch','962860ItEWwg','Skill\x20directory\x20not\x20found:\x20','object','filter','name',',\x20or\x20directory\x20name.','scope','Remote\x20Skill\x20','unknown','packageBase64','string','31JhvncC','builtin','(unknown)','Unable\x20to\x20resolve\x20skillCode\x20from\x20','1374848FREVtk','ignoreMetadataForPayload','metadata','71606pBbVtX','find','targetScope','ignoreMetadataSkillCode','appCode','\x20has\x20scope=\x22','match'];a144_0x5ca8=function(){return _0x349115;};return a144_0x5ca8();}function scalarToString(_0x478cab){const _0x8a23d4=a144_0x24f2;if(typeof _0x478cab===_0x8a23d4(0x12b))return _0x478cab[_0x8a23d4(0x115)]();if(typeof _0x478cab===_0x8a23d4(0xfe)||typeof _0x478cab===_0x8a23d4(0x112))return String(_0x478cab);return undefined;}function resolvePushDirectoryRoot(_0x280b8f){const _0x268b70=a144_0x24f2,_0x36d941=resolve(_0x280b8f);if(!existsSync(_0x36d941))throw CliErrors['validation'](_0x268b70(0x122)+_0x280b8f);const _0xd9a4d2=lstatSync(_0x36d941);if(_0xd9a4d2['isDirectory']())return _0x36d941;if(_0xd9a4d2[_0x268b70(0x11a)]()){const _0x523b66=realpathSync(_0x36d941);if(lstatSync(_0x523b66)[_0x268b70(0xfc)]())return _0x523b66;}throw CliErrors[_0x268b70(0x114)]('Skill\x20directory\x20not\x20found:\x20'+_0x280b8f);}function requireRemoteScope(_0x8bdf50){const _0x9f221a=a144_0x24f2;if(_0x8bdf50[_0x9f221a(0x127)]===_0x9f221a(0x110)||_0x8bdf50[_0x9f221a(0x127)]===_0x9f221a(0xfd)||_0x8bdf50['scope']===_0x9f221a(0xed))return _0x8bdf50[_0x9f221a(0x127)];throw CliErrors[_0x9f221a(0x114)](_0x9f221a(0x128)+(_0x8bdf50['skillCode']||_0x9f221a(0xee))+_0x9f221a(0x117)+(_0x8bdf50[_0x9f221a(0x127)]??_0x9f221a(0x129))+'\x22.');}function readLocalSkillContent(_0x270de3){const _0x554d38=a144_0x24f2,_0x1d9cce=resolve(_0x270de3,SKILL_FILE);return existsSync(_0x1d9cce)&&lstatSync(_0x1d9cce)['isFile']()?readFileSync(_0x1d9cce,_0x554d38(0x10a)):'';}function readPushMetadataIfPresent(_0x8d8047,_0x2f7447={}){const _0x44dfcc=a144_0x24f2;try{return readMetadataIfPresent(_0x8d8047);}catch(_0x66c5a1){if(_0x2f7447[_0x44dfcc(0x103)])return undefined;throw _0x66c5a1;}}
1
+ (function(_0x485cee,_0x5e3cb0){const _0x50ad89=a144_0x2efd,_0x310104=_0x485cee();while(!![]){try{const _0xc173ab=-parseInt(_0x50ad89(0xa5))/0x1+-parseInt(_0x50ad89(0xce))/0x2+parseInt(_0x50ad89(0xb2))/0x3+parseInt(_0x50ad89(0xab))/0x4*(-parseInt(_0x50ad89(0xb8))/0x5)+parseInt(_0x50ad89(0xc9))/0x6+-parseInt(_0x50ad89(0xad))/0x7*(parseInt(_0x50ad89(0xc3))/0x8)+parseInt(_0x50ad89(0x9f))/0x9;if(_0xc173ab===_0x5e3cb0)break;else _0x310104['push'](_0x310104['shift']());}catch(_0xb3a52a){_0x310104['push'](_0x310104['shift']());}}}(a144_0x3352,0x4b3b1));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a144_0x16b433}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(_0x283968,_0x21b9a3,_0x330455={}){const _0x8d0a89=a144_0x2efd,_0x534223=resolvePushDirectoryRoot(_0x283968),_0x27ace8=readPushMetadataIfPresent(resolve(_0x534223,METADATA_FILE),{'ignoreInvalidMetadata':_0x330455['ignoreInvalidMetadata']});if(_0x27ace8?.['appCode']&&_0x27ace8[_0x8d0a89(0xa6)]!==_0x21b9a3&&!_0x330455[_0x8d0a89(0xb9)]&&!_0x330455[_0x8d0a89(0x93)])throw CliErrors[_0x8d0a89(0x9c)](_0x8d0a89(0xb7)+_0x27ace8[_0x8d0a89(0xa6)]+'\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22'+_0x21b9a3+'\x22.');const _0x28e7f3=resolvePushSkillCode(_0x534223,_0x21b9a3,_0x27ace8,_0x330455);if(!_0x28e7f3)throw CliErrors['validation'](_0x8d0a89(0xaf)+SKILL_FILE+',\x20'+METADATA_FILE+_0x8d0a89(0xcc));return{'dir':_0x534223,'skillCode':_0x28e7f3,'metadata':_0x27ace8};}export function readPushDirectory(_0x229c57,_0x562ce2,_0x113c3e={}){const _0x338180=a144_0x2efd,_0x1ce42c=resolvePushDirectoryIdentity(_0x229c57,_0x562ce2,_0x113c3e),_0x4ee103=_0x1ce42c[_0x338180(0x96)],_0x16b7bc=resolve(_0x4ee103,SKILL_FILE);if(!existsSync(_0x16b7bc)||!lstatSync(_0x16b7bc)[_0x338180(0xac)]())throw CliErrors[_0x338180(0x9c)](_0x338180(0x91)+SKILL_FILE+':\x20'+_0x16b7bc);const _0x5424c7=_0x1ce42c['metadata'],_0x3b7aac=_0x113c3e[_0x338180(0xbf)]??_0x338180(0xc6);if(!_0x113c3e['ignoreMetadataScope']&&_0x5424c7?.[_0x338180(0xc2)]===_0x338180(0xc1))throw CliErrors[_0x338180(0x9c)](_0x338180(0xbb)+METADATA_FILE+'\x20has\x20scope=\x22'+_0x5424c7[_0x338180(0xc2)]+'\x22.');if(!_0x113c3e[_0x338180(0xca)]&&_0x3b7aac===_0x338180(0xc6)&&_0x5424c7?.[_0x338180(0xc2)]&&_0x5424c7[_0x338180(0xc2)]!=='personal')throw CliErrors[_0x338180(0x9c)](_0x338180(0xc7)+METADATA_FILE+_0x338180(0xa4)+_0x5424c7[_0x338180(0xc2)]+'\x22.','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20'+_0x4ee103+'\x20to\x20submit\x20company\x20Skills\x20for\x20review.');const _0x56d97a=scanSkillDirectory(_0x4ee103,{'excludedFilePaths':_0x113c3e['excludedFilePaths']}),_0x105584=buildSkillPackage(_0x56d97a),_0x59405e=readFileSync(_0x16b7bc,_0x338180(0xbc)),_0x58f920=_0x1ce42c[_0x338180(0xb6)],_0x940823=_0x113c3e['ignoreMetadataForPayload']?undefined:_0x5424c7,_0xf37d99=readSkillDisplayName(_0x59405e);return{'skillCode':_0x58f920,'metadata':_0x5424c7,'frontmatterDisplayName':_0xf37d99,'input':{'skillCode':_0x58f920,'skillName':_0xf37d99??_0x940823?.[_0x338180(0xbe)],'description':_0x940823?.['description'],'content':_0x59405e,'files':_0x105584[_0x338180(0xa0)],'packageBase64':_0x105584['packageBase64'],'tags':_0x940823?.['tags'],'version':_0x940823?.[_0x338180(0xa9)],'sourceSessionId':_0x940823?.[_0x338180(0xbd)]}};}export function refreshPushDirectoryMetadataFromRemote(_0x129cb9,_0x3eca3c,_0x28dced,_0x19b402={}){const _0x5549bf=a144_0x2efd,_0x2cf734=resolvePushDirectoryRoot(_0x129cb9),_0x4894a3=readPushMetadataIfPresent(resolve(_0x2cf734,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x31b43e=requireRemoteScope(_0x3eca3c),_0x5394f3=readLocalSkillContent(_0x2cf734),_0x595812={..._0x3eca3c,'appCode':_0x3eca3c[_0x5549bf(0xa6)]??_0x28dced,'skillName':_0x3eca3c['skillName']??_0x4894a3?.['skillName'],'description':_0x3eca3c[_0x5549bf(0x98)]??_0x4894a3?.[_0x5549bf(0x98)],'example':_0x3eca3c[_0x5549bf(0xcb)]??_0x4894a3?.[_0x5549bf(0xcb)],'tags':Array['isArray'](_0x3eca3c[_0x5549bf(0xa8)])?_0x3eca3c[_0x5549bf(0xa8)]:_0x4894a3?.[_0x5549bf(0xa8)],'sourceSessionId':_0x3eca3c[_0x5549bf(0xbd)]??_0x4894a3?.[_0x5549bf(0xbd)],'content':_0x3eca3c[_0x5549bf(0xc4)]??_0x5394f3},_0x1a6eda=buildMetadata(_0x595812,_0x31b43e,_0x28dced,contentHash(_0x5394f3),_0x19b402[_0x5549bf(0xaa)]);writeJsonAtomic(resolve(_0x2cf734,METADATA_FILE),_0x1a6eda);}export function recordPushedRuntimeSkill(_0x116602,_0xd83c17,_0xbb210e,_0x4f3152={}){const _0x341dcf=a144_0x2efd,_0x2c31c8=resolvePushDirectoryRoot(_0x116602),_0x97eba2=scanSkillDirectory(_0x2c31c8),_0x4580d2=_0x97eba2[_0x341dcf(0x9e)](_0x3261d7=>_0x3261d7[_0x341dcf(0x9b)]===SKILL_FILE),_0x5e0643=_0x4580d2?fileText(_0x4580d2):'',_0x33566a=tryNormalizePackageManifest(_0xd83c17[_0x341dcf(0xa1)]),_0x2858cc={..._0xd83c17,'content':_0xd83c17[_0x341dcf(0xc4)]??_0x5e0643,'files':_0x33566a},_0x10bd28=_0x33566a?normalizeLocalFiles(_0x97eba2)[_0x341dcf(0xb4)](_0xd60194=>_0x33566a[_0x341dcf(0xa1)]['some'](_0x4dc52c=>_0x4dc52c[_0x341dcf(0x9b)]===_0xd60194[_0x341dcf(0x9b)])):undefined,_0x44d26c=buildMetadata(_0x2858cc,_0x4f3152[_0x341dcf(0xc2)]??_0x341dcf(0xc6),_0xbb210e,contentHash(_0x2858cc[_0x341dcf(0xc4)]??''),_0x4f3152[_0x341dcf(0xae)],_0x10bd28);writeJsonAtomic(resolve(_0x2c31c8,METADATA_FILE),_0x44d26c);}export function deriveSkillCodeFromDirectory(_0x186138,_0x2f0de4){const _0x3d977f=a144_0x2efd,_0x3229b6=basename(resolve(_0x186138)),_0x68fd9b=_0x2f0de4+'--';return _0x3229b6[_0x3d977f(0xa7)](_0x68fd9b)?_0x3229b6[_0x3d977f(0xc8)](_0x68fd9b['length']):_0x3229b6;}function a144_0x3352(){const _0x3ff562=['isArray','67212PeUmXF','\x20has\x20unsupported\x20scope\x20\x22','filter','replace','skillCode','Skill\x20metadata\x20appCode\x20\x22','215uozFMz','allowAppCodeRetarget','toLowerCase','Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20','utf8','sourceSessionId','skillName','targetScope','string','builtin','scope','128056kYQAyA','content','boolean','personal','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20','slice','3691074iIxeUI','ignoreMetadataScope','example',',\x20or\x20directory\x20name.','trim','406652GKUgsb','ignoreMetadataSkillCode','company','Skill\x20directory\x20not\x20found:\x20','\x20name\x20for\x20SkillHub\x20slug\x20generation.','Missing\x20','object','ignoreMetadataAppCodeMismatch','isDirectory','number','dir','displayName','description','isSymbolicLink','(unknown)','path','validation','Remote\x20Skill\x20','find','5572431CGJdEO','manifest','files','match','ignoreInvalidMetadata','\x20has\x20scope=\x22','148868bRctIy','appCode','startsWith','tags','version','refreshedAt','33144IMHwCY','isFile','105wDHiYY','pushedAt','Unable\x20to\x20resolve\x20skillCode\x20from\x20','unknown'];a144_0x3352=function(){return _0x3ff562;};return a144_0x3352();}function a144_0x2efd(_0x4b89d9,_0x23fdbe){_0x4b89d9=_0x4b89d9-0x90;const _0x335292=a144_0x3352();let _0x2efd45=_0x335292[_0x4b89d9];return _0x2efd45;}function resolvePushSkillCode(_0x17d143,_0x250861,_0x349e37,_0x28b275){const _0x393e11=a144_0x2efd,_0xab18fc=deriveSkillCodeFromSkillFile(_0x17d143)||deriveSkillCodeFromDirectory(_0x17d143,_0x250861);if(_0x28b275[_0x393e11(0xcf)])return _0xab18fc;return _0x349e37?.[_0x393e11(0xb6)]?.['trim']()||_0xab18fc;}function deriveSkillCodeFromSkillFile(_0x2b8186){const _0x1d31cf=a144_0x2efd,_0x275c88=resolve(_0x2b8186,SKILL_FILE);if(!existsSync(_0x275c88)||!lstatSync(_0x275c88)[_0x1d31cf(0xac)]())return undefined;const _0x36e923=readFileSync(_0x275c88,_0x1d31cf(0xbc)),_0x37e722=_0x36e923[_0x1d31cf(0xa2)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x37e722)return undefined;const _0x84809a=parseFrontmatterObject(_0x37e722[0x1]??''),_0xa71226=scalarToString(_0x84809a?.['name']);return _0xa71226?slugifySkillName(_0xa71226):undefined;}function readSkillDisplayName(_0x30c73e){const _0x2e0f6a=a144_0x2efd,_0x5c85e2=_0x30c73e[_0x2e0f6a(0xa2)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x5c85e2)return undefined;const _0x3f3bc8=parseFrontmatterObject(_0x5c85e2[0x1]??'');return scalarToString(_0x3f3bc8?.[_0x2e0f6a(0x97)]);}function slugifySkillName(_0x34ee86){const _0x2a7f56=a144_0x2efd,_0x550b10=_0x34ee86[_0x2a7f56(0xcd)]()[_0x2a7f56(0xba)]()[_0x2a7f56(0xb5)](/[^\p{L}\p{N}\p{So}]+/gu,'-')[_0x2a7f56(0xb5)](/^-+/,'')[_0x2a7f56(0xb5)](/-+$/,'')[_0x2a7f56(0xb5)](/-{2,}/g,'-');if(!_0x550b10)throw CliErrors[_0x2a7f56(0x9c)]('Invalid\x20'+SKILL_FILE+_0x2a7f56(0x90));return _0x550b10;}function parseFrontmatterObject(_0x264ccd){const _0x58b229=a144_0x2efd;try{const _0x39ce89=a144_0x16b433(_0x264ccd);return _0x39ce89&&typeof _0x39ce89===_0x58b229(0x92)&&!Array[_0x58b229(0xb1)](_0x39ce89)?_0x39ce89:undefined;}catch{return undefined;}}function scalarToString(_0xe65c3c){const _0x2c67a3=a144_0x2efd;if(typeof _0xe65c3c===_0x2c67a3(0xc0))return _0xe65c3c[_0x2c67a3(0xcd)]();if(typeof _0xe65c3c===_0x2c67a3(0x95)||typeof _0xe65c3c===_0x2c67a3(0xc5))return String(_0xe65c3c);return undefined;}function resolvePushDirectoryRoot(_0x1cb14c){const _0x3b7beb=a144_0x2efd,_0x3498a7=resolve(_0x1cb14c);if(!existsSync(_0x3498a7))throw CliErrors[_0x3b7beb(0x9c)](_0x3b7beb(0xd1)+_0x1cb14c);const _0xa60b7e=lstatSync(_0x3498a7);if(_0xa60b7e[_0x3b7beb(0x94)]())return _0x3498a7;if(_0xa60b7e[_0x3b7beb(0x99)]()){const _0x345d16=realpathSync(_0x3498a7);if(lstatSync(_0x345d16)[_0x3b7beb(0x94)]())return _0x345d16;}throw CliErrors[_0x3b7beb(0x9c)]('Skill\x20directory\x20not\x20found:\x20'+_0x1cb14c);}function requireRemoteScope(_0x55d1ee){const _0x5ddf83=a144_0x2efd;if(_0x55d1ee['scope']===_0x5ddf83(0xc6)||_0x55d1ee['scope']===_0x5ddf83(0xd0)||_0x55d1ee['scope']==='builtin')return _0x55d1ee['scope'];throw CliErrors[_0x5ddf83(0x9c)](_0x5ddf83(0x9d)+(_0x55d1ee[_0x5ddf83(0xb6)]||_0x5ddf83(0x9a))+_0x5ddf83(0xb3)+(_0x55d1ee[_0x5ddf83(0xc2)]??_0x5ddf83(0xb0))+'\x22.');}function readLocalSkillContent(_0x55fd86){const _0x5386a5=a144_0x2efd,_0x4469f6=resolve(_0x55fd86,SKILL_FILE);return existsSync(_0x4469f6)&&lstatSync(_0x4469f6)[_0x5386a5(0xac)]()?readFileSync(_0x4469f6,'utf8'):'';}function readPushMetadataIfPresent(_0x10e433,_0x4222ab={}){const _0x27e5a8=a144_0x2efd;try{return readMetadataIfPresent(_0x10e433);}catch(_0x5d1f3e){if(_0x4222ab[_0x27e5a8(0xa3)])return undefined;throw _0x5d1f3e;}}
@@ -1 +1 @@
1
- (function(_0x22ffcb,_0x169a26){const _0x56e99d=a145_0x2b8b,_0x4e354e=_0x22ffcb();while(!![]){try{const _0x1a3cab=-parseInt(_0x56e99d(0x1ef))/0x1+parseInt(_0x56e99d(0x1e9))/0x2+parseInt(_0x56e99d(0x1f2))/0x3+-parseInt(_0x56e99d(0x1e8))/0x4*(-parseInt(_0x56e99d(0x1e6))/0x5)+-parseInt(_0x56e99d(0x1e7))/0x6*(-parseInt(_0x56e99d(0x1f1))/0x7)+parseInt(_0x56e99d(0x1ea))/0x8+parseInt(_0x56e99d(0x1f0))/0x9*(-parseInt(_0x56e99d(0x1f3))/0xa);if(_0x1a3cab===_0x169a26)break;else _0x4e354e['push'](_0x4e354e['shift']());}catch(_0x4486e8){_0x4e354e['push'](_0x4e354e['shift']());}}}(a145_0x21f3,0xeecf6));import{CliErrors}from'../../errors.js';export function normalizeRuntimeSkillScopes(_0x4eaf5f){const _0x7477a3=a145_0x2b8b,_0x45ec8c=_0x4eaf5f&&_0x4eaf5f['length']>0x0?_0x4eaf5f:[_0x7477a3(0x1ee),'company','builtin'],_0x50b382=[];for(const _0x3c2776 of _0x45ec8c){if(!isRuntimeSkillScope(_0x3c2776))throw CliErrors['validation'](_0x7477a3(0x1eb)+_0x3c2776);!_0x50b382['includes'](_0x3c2776)&&_0x50b382[_0x7477a3(0x1ec)](_0x3c2776);}return _0x50b382;}export function isRuntimeSkillScope(_0x17257f){const _0x5b84cc=a145_0x2b8b;return _0x17257f===_0x5b84cc(0x1ee)||_0x17257f===_0x5b84cc(0x1ed)||_0x17257f==='builtin';}function a145_0x2b8b(_0x59a6c0,_0x526635){_0x59a6c0=_0x59a6c0-0x1e6;const _0x21f334=a145_0x21f3();let _0x2b8bab=_0x21f334[_0x59a6c0];return _0x2b8bab;}function a145_0x21f3(){const _0x138a79=['282298XxGHib','1359jxciDf','35jVysbj','4708866LEaEnT','268690BVvLDI','5ALbxMd','855534qvzKVu','188616tcumjh','2354762Muasmi','14484648dmpcBC','Unsupported\x20runtime\x20Skill\x20scope:\x20','push','company','personal'];a145_0x21f3=function(){return _0x138a79;};return a145_0x21f3();}
1
+ (function(_0x369c0d,_0x3e0b94){const _0x5e679c=a145_0x4d09,_0x4dfa27=_0x369c0d();while(!![]){try{const _0x159ce3=parseInt(_0x5e679c(0x1ea))/0x1*(-parseInt(_0x5e679c(0x1ef))/0x2)+parseInt(_0x5e679c(0x1e9))/0x3+-parseInt(_0x5e679c(0x1e2))/0x4*(-parseInt(_0x5e679c(0x1df))/0x5)+parseInt(_0x5e679c(0x1e3))/0x6+parseInt(_0x5e679c(0x1e0))/0x7+parseInt(_0x5e679c(0x1ed))/0x8+-parseInt(_0x5e679c(0x1e8))/0x9*(parseInt(_0x5e679c(0x1e5))/0xa);if(_0x159ce3===_0x3e0b94)break;else _0x4dfa27['push'](_0x4dfa27['shift']());}catch(_0x17ae3f){_0x4dfa27['push'](_0x4dfa27['shift']());}}}(a145_0x5c52,0x27b7d));function a145_0x4d09(_0x14af3b,_0x153e9d){_0x14af3b=_0x14af3b-0x1df;const _0x5c52a2=a145_0x5c52();let _0x4d09d0=_0x5c52a2[_0x14af3b];return _0x4d09d0;}import{CliErrors}from'../../errors.js';export function normalizeRuntimeSkillScopes(_0x2130d7){const _0xdeaa99=a145_0x4d09,_0x12b6db=_0x2130d7&&_0x2130d7[_0xdeaa99(0x1ec)]>0x0?_0x2130d7:[_0xdeaa99(0x1e1),_0xdeaa99(0x1ee),_0xdeaa99(0x1e7)],_0x448722=[];for(const _0x3122ea of _0x12b6db){if(!isRuntimeSkillScope(_0x3122ea))throw CliErrors['validation'](_0xdeaa99(0x1e4)+_0x3122ea);!_0x448722[_0xdeaa99(0x1eb)](_0x3122ea)&&_0x448722[_0xdeaa99(0x1e6)](_0x3122ea);}return _0x448722;}function a145_0x5c52(){const _0x39e641=['company','46pAYEYv','10Ivfody','662319dUDkKk','personal','606720EDFNPc','764070DNKpQI','Unsupported\x20runtime\x20Skill\x20scope:\x20','55790oXbguZ','push','builtin','981uQAgVK','706977oUFgIr','818TnoHgs','includes','length','229032mUZQRl'];a145_0x5c52=function(){return _0x39e641;};return a145_0x5c52();}export function isRuntimeSkillScope(_0x4872aa){const _0x691e69=a145_0x4d09;return _0x4872aa===_0x691e69(0x1e1)||_0x4872aa===_0x691e69(0x1ee)||_0x4872aa===_0x691e69(0x1e7);}
@@ -1 +1 @@
1
- (function(_0x8c80e4,_0x1f8642){const _0x22b435=a147_0x73b1,_0x364294=_0x8c80e4();while(!![]){try{const _0x33ff45=-parseInt(_0x22b435(0x96))/0x1*(parseInt(_0x22b435(0x94))/0x2)+parseInt(_0x22b435(0x89))/0x3*(-parseInt(_0x22b435(0x9b))/0x4)+parseInt(_0x22b435(0x91))/0x5*(-parseInt(_0x22b435(0x8f))/0x6)+-parseInt(_0x22b435(0x8e))/0x7*(-parseInt(_0x22b435(0x8c))/0x8)+-parseInt(_0x22b435(0x97))/0x9+parseInt(_0x22b435(0x93))/0xa+parseInt(_0x22b435(0x90))/0xb;if(_0x33ff45===_0x1f8642)break;else _0x364294['push'](_0x364294['shift']());}catch(_0x51c307){_0x364294['push'](_0x364294['shift']());}}}(a147_0x792a,0xc5160));import{unzipSync,zipSync}from'fflate';import{CliErrors}from'../../errors.js';function a147_0x792a(){const _0x19524b=['23888QcjiOs','Runtime\x20Skill\x20package\x20contains\x20directory\x20entry:\x20','581KLUgVE','245910yKAAOr','56504580XWegSI','170KLkLLF','object','617810UKKgGQ','615034AuEcuO','sort','5ANYOqS','4878360UZPZKq','name','validation','code','26960NuIotL','Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.','length','519WSRQGi','validation_error','path'];a147_0x792a=function(){return _0x19524b;};return a147_0x792a();}import{compareSkillFiles,fileContent,normalizeLocalFiles,normalizeSkillRelativePath}from'./local-files.js';function a147_0x73b1(_0x361ce9,_0x3e5dce){_0x361ce9=_0x361ce9-0x88;const _0x792a07=a147_0x792a();let _0x73b1c0=_0x792a07[_0x361ce9];return _0x73b1c0;}const ZIP_MTIME=new Date('1980-01-01T00:00:00.000Z');export function createDeterministicZipPackage(_0xf2e185){const _0x192281=a147_0x73b1,_0x6c9ee1={};for(const _0xa3c5e1 of normalizeLocalFiles(_0xf2e185)){_0x6c9ee1[_0xa3c5e1[_0x192281(0x8b)]]=fileContent(_0xa3c5e1);}return Buffer['from'](zipSync(_0x6c9ee1,{'level':0x0,'mtime':ZIP_MTIME}));}export function parseZipPackage(_0x57724f){const _0x55e66d=a147_0x73b1;if(_0x57724f[_0x55e66d(0x88)]<0x16)throw CliErrors[_0x55e66d(0x99)](_0x55e66d(0x9c));let _0x36a1e1;try{_0x36a1e1=unzipSync(_0x57724f,{'filter'(_0x18fad7){const _0x21164c=_0x55e66d,_0x4a4efd=normalizeSkillRelativePath(_0x18fad7[_0x21164c(0x98)]);if(_0x4a4efd['endsWith']('/'))throw CliErrors[_0x21164c(0x99)](_0x21164c(0x8d)+_0x4a4efd);return!![];}});}catch(_0x25c0cf){if(isRuntimeSkillValidationError(_0x25c0cf))throw _0x25c0cf;throw CliErrors[_0x55e66d(0x99)]('Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.');}return Object['entries'](_0x36a1e1)['map'](([_0x3dbd13,_0x22eefc])=>({'path':normalizeSkillRelativePath(_0x3dbd13),'bytes':Buffer['from'](_0x22eefc)}))[_0x55e66d(0x95)](compareSkillFiles);}function isRuntimeSkillValidationError(_0x5bc2b0){const _0x57a8e0=a147_0x73b1;return typeof _0x5bc2b0===_0x57a8e0(0x92)&&_0x5bc2b0!==null&&_0x57a8e0(0x9a)in _0x5bc2b0&&_0x5bc2b0['code']===_0x57a8e0(0x8a);}
1
+ const a147_0xf95187=a147_0x3a88;(function(_0x16a9e9,_0x3e8387){const _0x215dfa=a147_0x3a88,_0x585f46=_0x16a9e9();while(!![]){try{const _0x343310=parseInt(_0x215dfa(0x9f))/0x1*(-parseInt(_0x215dfa(0x9c))/0x2)+-parseInt(_0x215dfa(0xab))/0x3*(-parseInt(_0x215dfa(0xa4))/0x4)+parseInt(_0x215dfa(0x99))/0x5*(parseInt(_0x215dfa(0xad))/0x6)+parseInt(_0x215dfa(0xac))/0x7+-parseInt(_0x215dfa(0xa3))/0x8+parseInt(_0x215dfa(0xa7))/0x9+parseInt(_0x215dfa(0xa9))/0xa;if(_0x343310===_0x3e8387)break;else _0x585f46['push'](_0x585f46['shift']());}catch(_0x197a96){_0x585f46['push'](_0x585f46['shift']());}}}(a147_0x5718,0x9141e));function a147_0x3a88(_0x58695c,_0x2b69ba){_0x58695c=_0x58695c-0x97;const _0x57181f=a147_0x5718();let _0x3a88a4=_0x57181f[_0x58695c];return _0x3a88a4;}import{unzipSync,zipSync}from'fflate';import{CliErrors}from'../../errors.js';import{compareSkillFiles,fileContent,normalizeLocalFiles,normalizeSkillRelativePath}from'./local-files.js';const ZIP_MTIME=new Date(a147_0xf95187(0xa2));export function createDeterministicZipPackage(_0x18ee8f){const _0x1d31b1=a147_0xf95187,_0x11b74c={};for(const _0x4e1957 of normalizeLocalFiles(_0x18ee8f)){_0x11b74c[_0x4e1957[_0x1d31b1(0xa6)]]=fileContent(_0x4e1957);}return Buffer['from'](zipSync(_0x11b74c,{'level':0x0,'mtime':ZIP_MTIME}));}export function parseZipPackage(_0x3e0474){const _0x1b419c=a147_0xf95187;if(_0x3e0474[_0x1b419c(0x9a)]<0x16)throw CliErrors[_0x1b419c(0xa1)](_0x1b419c(0xa5));let _0x225c92;try{_0x225c92=unzipSync(_0x3e0474,{'filter'(_0xe367ce){const _0x2069a8=_0x1b419c,_0x13cba3=normalizeSkillRelativePath(_0xe367ce[_0x2069a8(0x9e)]);if(_0x13cba3['endsWith']('/'))throw CliErrors[_0x2069a8(0xa1)](_0x2069a8(0x97)+_0x13cba3);return!![];}});}catch(_0x3863ed){if(isRuntimeSkillValidationError(_0x3863ed))throw _0x3863ed;throw CliErrors[_0x1b419c(0xa1)](_0x1b419c(0xa5));}return Object[_0x1b419c(0xa0)](_0x225c92)[_0x1b419c(0x9d)](([_0x294792,_0x18156e])=>({'path':normalizeSkillRelativePath(_0x294792),'bytes':Buffer[_0x1b419c(0xa8)](_0x18156e)}))[_0x1b419c(0x98)](compareSkillFiles);}function isRuntimeSkillValidationError(_0x192d68){const _0xf5b205=a147_0xf95187;return typeof _0x192d68===_0xf5b205(0x9b)&&_0x192d68!==null&&_0xf5b205(0xae)in _0x192d68&&_0x192d68[_0xf5b205(0xae)]===_0xf5b205(0xaa);}function a147_0x5718(){const _0x214aab=['Runtime\x20Skill\x20package\x20contains\x20directory\x20entry:\x20','sort','5jWADvi','length','object','2RehAzI','map','name','655831syTDxT','entries','validation','1980-01-01T00:00:00.000Z','7882512PvULvI','381688dVEJRq','Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.','path','3709170mYMwDH','from','435600fIGlDq','validation_error','6BWAawo','4528986IKvlvh','5655522AkzBnV','code'];a147_0x5718=function(){return _0x214aab;};return a147_0x5718();}
@@ -1 +1 @@
1
- (function(_0xbb95e6,_0x3b902b){const _0x5d77ef=a148_0x24e7,_0x21a741=_0xbb95e6();while(!![]){try{const _0xdc4128=parseInt(_0x5d77ef(0x1ab))/0x1+parseInt(_0x5d77ef(0x1ac))/0x2*(-parseInt(_0x5d77ef(0x1ae))/0x3)+parseInt(_0x5d77ef(0x1cf))/0x4*(parseInt(_0x5d77ef(0x1c0))/0x5)+parseInt(_0x5d77ef(0x1d0))/0x6*(-parseInt(_0x5d77ef(0x1b7))/0x7)+-parseInt(_0x5d77ef(0x1b0))/0x8*(parseInt(_0x5d77ef(0x1ca))/0x9)+-parseInt(_0x5d77ef(0x1be))/0xa*(parseInt(_0x5d77ef(0x1b9))/0xb)+parseInt(_0x5d77ef(0x1b1))/0xc;if(_0xdc4128===_0x3b902b)break;else _0x21a741['push'](_0x21a741['shift']());}catch(_0x5aefaa){_0x21a741['push'](_0x21a741['shift']());}}}(a148_0x39b7,0xc4eba));import{CliErrors}from'../../errors.js';import{SKILL_FILE}from'./constants.js';import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';import{fileContent,isSha256Hex,normalizeLocalFiles,normalizeManifestFiles}from'./local-files.js';import{createDeterministicZipPackage,parseZipPackage}from'./zip-codec.js';function a148_0x24e7(_0x2dbbb0,_0x10aaf6){_0x2dbbb0=_0x2dbbb0-0x1aa;const _0x39b730=a148_0x39b7();let _0x24e7a3=_0x39b730[_0x2dbbb0];return _0x24e7a3;}export function buildSkillPackage(_0x36934a){const _0x48f0ff=a148_0x24e7,_0x78efd3=normalizeLocalFiles(_0x36934a);if(!_0x78efd3[_0x48f0ff(0x1c3)](_0x201e9f=>_0x201e9f[_0x48f0ff(0x1b5)]===SKILL_FILE))throw CliErrors['validation']('Missing\x20'+SKILL_FILE+'\x20in\x20Skill\x20file\x20package.');const _0x578994=localFilesToManifestFiles(_0x78efd3),_0x1225a3=createDeterministicZipPackage(_0x78efd3);return{'manifest':{'schemaVersion':0x2,'treeSha256':fileTreeHash(_0x578994),'zipSha256':bufferSha256(_0x1225a3),'zipSize':_0x1225a3[_0x48f0ff(0x1b8)],'files':_0x578994},'packageBytes':_0x1225a3,'packageBase64':_0x1225a3[_0x48f0ff(0x1c9)](_0x48f0ff(0x1d2))};}export function verifyRuntimeSkillPackage(_0x2c8458,_0x4bc1b9){const _0x129d6b=a148_0x24e7,_0x558f66=normalizePackageManifest(_0x2c8458,{'requireOssPath':![]});if(!_0x558f66)throw CliErrors[_0x129d6b(0x1aa)](_0x129d6b(0x1d4));return extractAndVerifyPackage(_0x558f66,_0x4bc1b9);}export function verifyRuntimeSkillBundle(_0x2c820c,_0x500a4f){const _0x19b4a5=a148_0x24e7,_0x923aea=normalizePackageManifest(_0x2c820c,{'requireOssPath':![]});if(!_0x923aea)throw CliErrors[_0x19b4a5(0x1aa)](_0x19b4a5(0x1d4));return extractAndVerifyPackageFiles(_0x923aea,_0x500a4f);}export function tryNormalizePackageManifest(_0xb963ee){return normalizePackageManifest(_0xb963ee,{'requireOssPath':![]});}export function requirePackageBytes(_0x2b4e85,_0x1c08d4){const _0x1477d4=a148_0x24e7;if(!_0x1c08d4||_0x1c08d4['length']===0x0)throw CliErrors[_0x1477d4(0x1aa)]('Runtime\x20Skill\x20package\x20is\x20required\x20for\x20Skill\x20install:\x20'+_0x2b4e85);return _0x1c08d4;}export function extractDownloadedPackage(_0xd5d2d8){const _0x4f4821=a148_0x24e7,_0x247fd4=parseZipPackage(_0xd5d2d8)[_0x4f4821(0x1c6)](_0x410540=>({'path':_0x410540[_0x4f4821(0x1b5)],'bytes':_0x410540[_0x4f4821(0x1cc)]}));if(!_0x247fd4[_0x4f4821(0x1c3)](_0x508629=>_0x508629[_0x4f4821(0x1b5)]===SKILL_FILE))throw CliErrors['validation']('Runtime\x20Skill\x20package\x20is\x20missing\x20'+SKILL_FILE+'.');return normalizeLocalFiles(_0x247fd4);}function a148_0x39b7(){const _0x35dda3=['1289580QMZNAC','10UEJAjC','has','913431LqRDbT','schemaVersion','84408SefimL','40921920pYVrqj','zipSha256','files','Runtime\x20Skill\x20package\x20file\x20size\x20mismatch:\x20','path','object','3913623MJeohF','length','22OpIsjT','Runtime\x20Skill\x20file\x20tree\x20sha256\x20is\x20invalid.','requireOssPath','Duplicate\x20Skill\x20package\x20entry:\x20','Runtime\x20Skill\x20package\x20sha256\x20is\x20invalid.','3601970TScKRU','isSafeInteger','1465QGWQpa','treeSha256','toLowerCase','some','trim','Runtime\x20Skill\x20package\x20size\x20is\x20invalid.','map','Runtime\x20Skill\x20package\x20size\x20mismatch.','zipSize','toString','1341HliZbe','get','bytes','ossPath','string','6564kfMZCT','6kKEhec','Runtime\x20Skill\x20package\x20file\x20sha256\x20mismatch:\x20','base64','set','Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.','validation'];a148_0x39b7=function(){return _0x35dda3;};return a148_0x39b7();}export function localFilesToManifestFiles(_0x145738){const _0x324bb3=a148_0x24e7;return normalizeLocalFiles(_0x145738)[_0x324bb3(0x1c6)](_0x190694=>({'path':_0x190694['path'],'sha256':fileHash(_0x190694),'size':fileContent(_0x190694)[_0x324bb3(0x1b8)]}));}function normalizePackageManifest(_0x388ee4,_0x19f1bc){const _0x50f2f9=a148_0x24e7;if(!_0x388ee4||typeof _0x388ee4!==_0x50f2f9(0x1b6)||Array['isArray'](_0x388ee4))return undefined;const _0x5a4c5e=_0x388ee4,_0x2cd181=typeof _0x5a4c5e[_0x50f2f9(0x1cd)]===_0x50f2f9(0x1ce)?_0x5a4c5e[_0x50f2f9(0x1cd)][_0x50f2f9(0x1c4)]():undefined;if(_0x19f1bc[_0x50f2f9(0x1bb)]&&!_0x2cd181)return undefined;if(!Array['isArray'](_0x5a4c5e[_0x50f2f9(0x1b3)])||_0x5a4c5e[_0x50f2f9(0x1b3)]['length']===0x0)return undefined;if(!isSha256Hex(_0x5a4c5e['treeSha256']))throw CliErrors['validation'](_0x50f2f9(0x1ba));if(!isSha256Hex(_0x5a4c5e[_0x50f2f9(0x1b2)]))throw CliErrors['validation'](_0x50f2f9(0x1bd));if(!Number[_0x50f2f9(0x1bf)](_0x5a4c5e[_0x50f2f9(0x1c8)])||_0x5a4c5e['zipSize']<0x0)throw CliErrors['validation'](_0x50f2f9(0x1c5));const _0x477ba9=normalizeManifestFiles(_0x5a4c5e[_0x50f2f9(0x1b3)]);if(!_0x477ba9[_0x50f2f9(0x1c3)](_0x25699a=>_0x25699a[_0x50f2f9(0x1b5)]===SKILL_FILE))throw CliErrors[_0x50f2f9(0x1aa)]('Runtime\x20Skill\x20manifest\x20is\x20missing\x20'+SKILL_FILE+'.');const _0x341117=fileTreeHash(_0x477ba9);if(_0x341117!==_0x5a4c5e[_0x50f2f9(0x1c1)][_0x50f2f9(0x1c2)]())throw CliErrors['validation']('Runtime\x20Skill\x20file\x20tree\x20sha256\x20mismatch.');return{'schemaVersion':Number[_0x50f2f9(0x1bf)](_0x5a4c5e[_0x50f2f9(0x1af)])?_0x5a4c5e[_0x50f2f9(0x1af)]:0x2,'ossPath':_0x2cd181,'treeSha256':_0x341117,'zipSha256':_0x5a4c5e[_0x50f2f9(0x1b2)][_0x50f2f9(0x1c2)](),'zipSize':_0x5a4c5e['zipSize'],'files':_0x477ba9};}function extractAndVerifyPackage(_0x2f9012,_0x4f21ee){const _0x22f9e8=a148_0x24e7,_0x990d0d=normalizePackageManifest(_0x2f9012,{'requireOssPath':![]});if(!_0x990d0d)throw CliErrors[_0x22f9e8(0x1aa)]('Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.');if(_0x4f21ee[_0x22f9e8(0x1b8)]!==_0x990d0d['zipSize'])throw CliErrors[_0x22f9e8(0x1aa)](_0x22f9e8(0x1c7));const _0x38976d=bufferSha256(_0x4f21ee);if(_0x38976d!==_0x990d0d['zipSha256'])throw CliErrors[_0x22f9e8(0x1aa)]('Runtime\x20Skill\x20package\x20sha256\x20mismatch.');return extractAndVerifyPackageFiles(_0x990d0d,_0x4f21ee);}function extractAndVerifyPackageFiles(_0x3aee29,_0x34c875){const _0x48bc89=a148_0x24e7,_0x3151de=parseZipPackage(_0x34c875);if(_0x3151de[_0x48bc89(0x1b8)]!==_0x3aee29[_0x48bc89(0x1b3)]['length'])throw CliErrors[_0x48bc89(0x1aa)]('Runtime\x20Skill\x20package\x20entry\x20list\x20mismatch.');const _0x351837=new Map();for(const _0x5dff24 of _0x3151de){if(_0x351837[_0x48bc89(0x1ad)](_0x5dff24[_0x48bc89(0x1b5)]))throw CliErrors[_0x48bc89(0x1aa)](_0x48bc89(0x1bc)+_0x5dff24[_0x48bc89(0x1b5)]);_0x351837[_0x48bc89(0x1d3)](_0x5dff24[_0x48bc89(0x1b5)],_0x5dff24);}const _0xef56f1=[];for(const _0x42f3f5 of _0x3aee29[_0x48bc89(0x1b3)]){const _0x5bff27=_0x351837[_0x48bc89(0x1cb)](_0x42f3f5[_0x48bc89(0x1b5)]);if(!_0x5bff27)throw CliErrors[_0x48bc89(0x1aa)]('Runtime\x20Skill\x20package\x20is\x20missing\x20entry:\x20'+_0x42f3f5[_0x48bc89(0x1b5)]);if(_0x5bff27[_0x48bc89(0x1cc)][_0x48bc89(0x1b8)]!==_0x42f3f5['size'])throw CliErrors[_0x48bc89(0x1aa)](_0x48bc89(0x1b4)+_0x42f3f5['path']);const _0xd4361=bufferSha256(_0x5bff27[_0x48bc89(0x1cc)]);if(_0xd4361!==_0x42f3f5['sha256'])throw CliErrors[_0x48bc89(0x1aa)](_0x48bc89(0x1d1)+_0x42f3f5['path']);_0xef56f1['push']({'path':_0x42f3f5[_0x48bc89(0x1b5)],'bytes':_0x5bff27[_0x48bc89(0x1cc)]});}return normalizeLocalFiles(_0xef56f1);}
1
+ (function(_0x3bf6b6,_0x15a9b2){const _0x3c2e9d=a148_0x8991,_0x347b34=_0x3bf6b6();while(!![]){try{const _0x263826=parseInt(_0x3c2e9d(0xf8))/0x1+-parseInt(_0x3c2e9d(0xe7))/0x2+parseInt(_0x3c2e9d(0x111))/0x3+-parseInt(_0x3c2e9d(0x102))/0x4*(-parseInt(_0x3c2e9d(0x106))/0x5)+-parseInt(_0x3c2e9d(0xe5))/0x6+-parseInt(_0x3c2e9d(0xf5))/0x7*(parseInt(_0x3c2e9d(0xe9))/0x8)+parseInt(_0x3c2e9d(0xfa))/0x9;if(_0x263826===_0x15a9b2)break;else _0x347b34['push'](_0x347b34['shift']());}catch(_0x3b4760){_0x347b34['push'](_0x347b34['shift']());}}}(a148_0x484f,0x23fea));import{CliErrors}from'../../errors.js';import{SKILL_FILE}from'./constants.js';function a148_0x484f(){const _0xf102cc=['84604LMSnZl','isArray','196614UBzSuS','sha256','Runtime\x20Skill\x20package\x20size\x20is\x20invalid.','push','Runtime\x20Skill\x20package\x20sha256\x20is\x20invalid.','toLowerCase','Runtime\x20Skill\x20package\x20file\x20size\x20mismatch:\x20','bytes','4bejSYc','ossPath','base64','schemaVersion','1413235QVAAzS','requireOssPath','get','Runtime\x20Skill\x20manifest\x20is\x20missing\x20','trim','Runtime\x20Skill\x20package\x20entry\x20list\x20mismatch.','path','zipSha256','Runtime\x20Skill\x20package\x20size\x20mismatch.','string','Runtime\x20Skill\x20package\x20file\x20sha256\x20mismatch:\x20','165324ujkITs','351582EbffDn','Runtime\x20Skill\x20package\x20is\x20required\x20for\x20Skill\x20install:\x20','313638fOkSyU','some','650840HwAORq','files','Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.','isSafeInteger','length','validation','Runtime\x20Skill\x20file\x20tree\x20sha256\x20is\x20invalid.','\x20in\x20Skill\x20file\x20package.','zipSize','map','Runtime\x20Skill\x20package\x20is\x20missing\x20','set','7TxkhmQ','Runtime\x20Skill\x20file\x20tree\x20sha256\x20mismatch.','treeSha256'];a148_0x484f=function(){return _0xf102cc;};return a148_0x484f();}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(_0xa92a2c){const _0x884d83=a148_0x8991,_0x4f5c2d=normalizeLocalFiles(_0xa92a2c);if(!_0x4f5c2d[_0x884d83(0xe8)](_0x45fe38=>_0x45fe38[_0x884d83(0x10c)]===SKILL_FILE))throw CliErrors[_0x884d83(0xee)]('Missing\x20'+SKILL_FILE+_0x884d83(0xf0));const _0x491ae8=localFilesToManifestFiles(_0x4f5c2d),_0x578e42=createDeterministicZipPackage(_0x4f5c2d);return{'manifest':{'schemaVersion':0x2,'treeSha256':fileTreeHash(_0x491ae8),'zipSha256':bufferSha256(_0x578e42),'zipSize':_0x578e42[_0x884d83(0xed)],'files':_0x491ae8},'packageBytes':_0x578e42,'packageBase64':_0x578e42['toString'](_0x884d83(0x104))};}export function verifyRuntimeSkillPackage(_0x2dfaeb,_0x39d102){const _0x241486=a148_0x8991,_0x22cc59=normalizePackageManifest(_0x2dfaeb,{'requireOssPath':![]});if(!_0x22cc59)throw CliErrors[_0x241486(0xee)]('Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.');return extractAndVerifyPackage(_0x22cc59,_0x39d102);}export function verifyRuntimeSkillBundle(_0x467f1c,_0x297cea){const _0x23f481=a148_0x8991,_0x1298cf=normalizePackageManifest(_0x467f1c,{'requireOssPath':![]});if(!_0x1298cf)throw CliErrors[_0x23f481(0xee)](_0x23f481(0xeb));return extractAndVerifyPackageFiles(_0x1298cf,_0x297cea);}export function tryNormalizePackageManifest(_0x16a946){return normalizePackageManifest(_0x16a946,{'requireOssPath':![]});}export function requirePackageBytes(_0x3e1405,_0x16f8c8){const _0x444587=a148_0x8991;if(!_0x16f8c8||_0x16f8c8[_0x444587(0xed)]===0x0)throw CliErrors[_0x444587(0xee)](_0x444587(0xe6)+_0x3e1405);return _0x16f8c8;}export function extractDownloadedPackage(_0x195d63){const _0x120808=a148_0x8991,_0x2621ad=parseZipPackage(_0x195d63)[_0x120808(0xf2)](_0x258211=>({'path':_0x258211['path'],'bytes':_0x258211[_0x120808(0x101)]}));if(!_0x2621ad[_0x120808(0xe8)](_0x331a02=>_0x331a02[_0x120808(0x10c)]===SKILL_FILE))throw CliErrors[_0x120808(0xee)](_0x120808(0xf3)+SKILL_FILE+'.');return normalizeLocalFiles(_0x2621ad);}export function localFilesToManifestFiles(_0x2c6fca){const _0x3f215b=a148_0x8991;return normalizeLocalFiles(_0x2c6fca)[_0x3f215b(0xf2)](_0x2752bc=>({'path':_0x2752bc[_0x3f215b(0x10c)],'sha256':fileHash(_0x2752bc),'size':fileContent(_0x2752bc)['length']}));}function normalizePackageManifest(_0x35f1ab,_0x421f07){const _0x2d60c2=a148_0x8991;if(!_0x35f1ab||typeof _0x35f1ab!=='object'||Array[_0x2d60c2(0xf9)](_0x35f1ab))return undefined;const _0x5d4be3=_0x35f1ab,_0x26cdca=typeof _0x5d4be3[_0x2d60c2(0x103)]===_0x2d60c2(0x10f)?_0x5d4be3[_0x2d60c2(0x103)][_0x2d60c2(0x10a)]():undefined;if(_0x421f07[_0x2d60c2(0x107)]&&!_0x26cdca)return undefined;if(!Array[_0x2d60c2(0xf9)](_0x5d4be3[_0x2d60c2(0xea)])||_0x5d4be3[_0x2d60c2(0xea)]['length']===0x0)return undefined;if(!isSha256Hex(_0x5d4be3[_0x2d60c2(0xf7)]))throw CliErrors[_0x2d60c2(0xee)](_0x2d60c2(0xef));if(!isSha256Hex(_0x5d4be3[_0x2d60c2(0x10d)]))throw CliErrors[_0x2d60c2(0xee)](_0x2d60c2(0xfe));if(!Number['isSafeInteger'](_0x5d4be3[_0x2d60c2(0xf1)])||_0x5d4be3[_0x2d60c2(0xf1)]<0x0)throw CliErrors[_0x2d60c2(0xee)](_0x2d60c2(0xfc));const _0x4e42c3=normalizeManifestFiles(_0x5d4be3[_0x2d60c2(0xea)]);if(!_0x4e42c3['some'](_0x142b14=>_0x142b14[_0x2d60c2(0x10c)]===SKILL_FILE))throw CliErrors[_0x2d60c2(0xee)](_0x2d60c2(0x109)+SKILL_FILE+'.');const _0x4e1b48=fileTreeHash(_0x4e42c3);if(_0x4e1b48!==_0x5d4be3[_0x2d60c2(0xf7)][_0x2d60c2(0xff)]())throw CliErrors['validation'](_0x2d60c2(0xf6));return{'schemaVersion':Number[_0x2d60c2(0xec)](_0x5d4be3[_0x2d60c2(0x105)])?_0x5d4be3[_0x2d60c2(0x105)]:0x2,'ossPath':_0x26cdca,'treeSha256':_0x4e1b48,'zipSha256':_0x5d4be3[_0x2d60c2(0x10d)][_0x2d60c2(0xff)](),'zipSize':_0x5d4be3['zipSize'],'files':_0x4e42c3};}function extractAndVerifyPackage(_0xeb2b20,_0x2b6e1d){const _0x42db7e=a148_0x8991,_0x2f08fc=normalizePackageManifest(_0xeb2b20,{'requireOssPath':![]});if(!_0x2f08fc)throw CliErrors[_0x42db7e(0xee)](_0x42db7e(0xeb));if(_0x2b6e1d[_0x42db7e(0xed)]!==_0x2f08fc['zipSize'])throw CliErrors[_0x42db7e(0xee)](_0x42db7e(0x10e));const _0x25a1d8=bufferSha256(_0x2b6e1d);if(_0x25a1d8!==_0x2f08fc[_0x42db7e(0x10d)])throw CliErrors[_0x42db7e(0xee)]('Runtime\x20Skill\x20package\x20sha256\x20mismatch.');return extractAndVerifyPackageFiles(_0x2f08fc,_0x2b6e1d);}function a148_0x8991(_0x4dbcca,_0x5ad7d0){_0x4dbcca=_0x4dbcca-0xe5;const _0x484f1c=a148_0x484f();let _0x8991bb=_0x484f1c[_0x4dbcca];return _0x8991bb;}function extractAndVerifyPackageFiles(_0x50b67f,_0x29f0ee){const _0x3ff99f=a148_0x8991,_0x542e52=parseZipPackage(_0x29f0ee);if(_0x542e52[_0x3ff99f(0xed)]!==_0x50b67f[_0x3ff99f(0xea)][_0x3ff99f(0xed)])throw CliErrors['validation'](_0x3ff99f(0x10b));const _0x4494b1=new Map();for(const _0x369198 of _0x542e52){if(_0x4494b1['has'](_0x369198['path']))throw CliErrors[_0x3ff99f(0xee)]('Duplicate\x20Skill\x20package\x20entry:\x20'+_0x369198['path']);_0x4494b1[_0x3ff99f(0xf4)](_0x369198['path'],_0x369198);}const _0x2e2f21=[];for(const _0x141230 of _0x50b67f[_0x3ff99f(0xea)]){const _0x12d45b=_0x4494b1[_0x3ff99f(0x108)](_0x141230[_0x3ff99f(0x10c)]);if(!_0x12d45b)throw CliErrors[_0x3ff99f(0xee)]('Runtime\x20Skill\x20package\x20is\x20missing\x20entry:\x20'+_0x141230['path']);if(_0x12d45b[_0x3ff99f(0x101)][_0x3ff99f(0xed)]!==_0x141230['size'])throw CliErrors[_0x3ff99f(0xee)](_0x3ff99f(0x100)+_0x141230[_0x3ff99f(0x10c)]);const _0x1e260a=bufferSha256(_0x12d45b['bytes']);if(_0x1e260a!==_0x141230[_0x3ff99f(0xfb)])throw CliErrors[_0x3ff99f(0xee)](_0x3ff99f(0x110)+_0x141230[_0x3ff99f(0x10c)]);_0x2e2f21[_0x3ff99f(0xfd)]({'path':_0x141230[_0x3ff99f(0x10c)],'bytes':_0x12d45b[_0x3ff99f(0x101)]});}return normalizeLocalFiles(_0x2e2f21);}
@@ -1 +1 @@
1
- (function(_0x153acf,_0x2fa787){var _0x12673a=a149_0x42a3,_0x364a59=_0x153acf();while(!![]){try{var _0x2a193d=-parseInt(_0x12673a(0x14b))/0x1+parseInt(_0x12673a(0x14a))/0x2*(parseInt(_0x12673a(0x144))/0x3)+parseInt(_0x12673a(0x147))/0x4+parseInt(_0x12673a(0x149))/0x5*(-parseInt(_0x12673a(0x148))/0x6)+-parseInt(_0x12673a(0x146))/0x7+-parseInt(_0x12673a(0x145))/0x8*(parseInt(_0x12673a(0x14d))/0x9)+-parseInt(_0x12673a(0x14e))/0xa*(-parseInt(_0x12673a(0x14c))/0xb);if(_0x2a193d===_0x2fa787)break;else _0x364a59['push'](_0x364a59['shift']());}catch(_0x98f938){_0x364a59['push'](_0x364a59['shift']());}}}(a149_0x25bc,0x1903e));export{contentHash,fileTreeHash}from'./runtime-skill-sync/hashing.js';export{linkEffectiveRuntimeSkills,linkGlobalRuntimeSkills,pruneStaleRuntimeSkillCache,pruneStaleRuntimeSkillLinks}from'./runtime-skill-sync/links.js';function a149_0x25bc(){var _0x5ebdd8=['36sRcHjU','23570teVhVr','142011DXjfvj','151264hDNSrJ','461797buTXQc','806200hJAQgX','90QUTlyM','9505jdEZDr','4jSIlsy','30715HnZGrT','33OrtJgo'];a149_0x25bc=function(){return _0x5ebdd8;};return a149_0x25bc();}export{resolveRuntimeSkillInstallTarget}from'./runtime-skill-sync/install-target.js';export{listLocalRuntimeSkills}from'./runtime-skill-sync/list-local.js';export{materializeRuntimeSkill,reuseMaterializedRuntimeSkill}from'./runtime-skill-sync/materialize.js';function a149_0x42a3(_0x5dc5e3,_0x3dcc20){_0x5dc5e3=_0x5dc5e3-0x144;var _0x25bcce=a149_0x25bc();var _0x42a358=_0x25bcce[_0x5dc5e3];return _0x42a358;}export{readMetadataIfPresent}from'./runtime-skill-sync/metadata.js';export{getRuntimeSkillCacheRoot,getRuntimeSkillDir,resolveSkillSyncPaths,runtimeAgentSkillRoots}from'./runtime-skill-sync/paths.js';export{deriveSkillCodeFromDirectory,readPushDirectory,refreshPushDirectoryMetadataFromRemote,recordPushedRuntimeSkill,resolvePushDirectoryIdentity}from'./runtime-skill-sync/push.js';export{buildSkillPackage,verifyRuntimeSkillBundle,verifyRuntimeSkillPackage}from'./runtime-skill-sync/zip-package.js';
1
+ (function(_0x43f887,_0x2ff5d5){var _0x1f4625=a149_0x418f,_0x42e790=_0x43f887();while(!![]){try{var _0x3994ce=parseInt(_0x1f4625(0x1e4))/0x1*(-parseInt(_0x1f4625(0x1e1))/0x2)+-parseInt(_0x1f4625(0x1da))/0x3*(parseInt(_0x1f4625(0x1dd))/0x4)+parseInt(_0x1f4625(0x1dc))/0x5*(-parseInt(_0x1f4625(0x1e3))/0x6)+parseInt(_0x1f4625(0x1e2))/0x7*(-parseInt(_0x1f4625(0x1d9))/0x8)+-parseInt(_0x1f4625(0x1df))/0x9*(parseInt(_0x1f4625(0x1db))/0xa)+-parseInt(_0x1f4625(0x1de))/0xb+parseInt(_0x1f4625(0x1e0))/0xc;if(_0x3994ce===_0x2ff5d5)break;else _0x42e790['push'](_0x42e790['shift']());}catch(_0x4dfb91){_0x42e790['push'](_0x42e790['shift']());}}}(a149_0x29d0,0x52d3a));function a149_0x29d0(){var _0x1aad24=['35873316rRAkvI','922PmACJo','63bedbQx','6EIWsAE','712DIWaXC','587864iOnofz','83958pJoYpj','2727100jebgaT','2278025mGODlr','40YNPqee','7176741DJDJoX','9GGPoRa'];a149_0x29d0=function(){return _0x1aad24;};return a149_0x29d0();}export{contentHash,fileTreeHash}from'./runtime-skill-sync/hashing.js';export{linkEffectiveRuntimeSkills,linkGlobalRuntimeSkills,pruneStaleRuntimeSkillCache,pruneStaleRuntimeSkillLinks}from'./runtime-skill-sync/links.js';export{resolveRuntimeSkillInstallTarget}from'./runtime-skill-sync/install-target.js';export{listLocalRuntimeSkills}from'./runtime-skill-sync/list-local.js';export{materializeRuntimeSkill,reuseMaterializedRuntimeSkill}from'./runtime-skill-sync/materialize.js';function a149_0x418f(_0x3af997,_0x52891c){_0x3af997=_0x3af997-0x1d9;var _0x29d071=a149_0x29d0();var _0x418f78=_0x29d071[_0x3af997];return _0x418f78;}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';