@lovrabet/lovrabet-cli 2.3.0-beta.1 → 2.3.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (164) hide show
  1. package/lib/cli.js +1 -1
  2. package/lib/commands/api-doc/index.js +1 -1
  3. package/lib/commands/app/cache.js +1 -1
  4. package/lib/commands/app/definitions.js +1 -1
  5. package/lib/commands/app/eligibility.js +1 -1
  6. package/lib/commands/app/mock-loader.js +1 -1
  7. package/lib/commands/app/remote-source.js +1 -1
  8. package/lib/commands/app/shared.js +1 -1
  9. package/lib/commands/app-config/get.js +1 -1
  10. package/lib/commands/app-config/index.js +1 -1
  11. package/lib/commands/artifact/index.js +1 -1
  12. package/lib/commands/auth/device.js +1 -1
  13. package/lib/commands/auth/index.js +1 -1
  14. package/lib/commands/auth/prompt.js +1 -1
  15. package/lib/commands/bff/detail.js +1 -1
  16. package/lib/commands/bff/exec.js +1 -1
  17. package/lib/commands/bff/index.js +1 -1
  18. package/lib/commands/cli-skill/index.js +1 -1
  19. package/lib/commands/common/config-policy.js +1 -1
  20. package/lib/commands/common/constraints.js +1 -1
  21. package/lib/commands/common/flags.js +1 -1
  22. package/lib/commands/common/local-file.js +1 -1
  23. package/lib/commands/config/definitions.js +1 -1
  24. package/lib/commands/config/init.js +1 -1
  25. package/lib/commands/config/shared.js +1 -1
  26. package/lib/commands/data/index.js +1 -1
  27. package/lib/commands/dataset/detail.js +1 -1
  28. package/lib/commands/dataset/index.js +1 -1
  29. package/lib/commands/dataset/list.js +1 -1
  30. package/lib/commands/dataset/sdk-doc.js +1 -1
  31. package/lib/commands/doctor.js +1 -1
  32. package/lib/commands/file/index.js +1 -1
  33. package/lib/commands/init.js +1 -1
  34. package/lib/commands/kb/index.js +1 -1
  35. package/lib/commands/logs/index.js +1 -1
  36. package/lib/commands/notification/config-list.js +1 -1
  37. package/lib/commands/notification/index.js +1 -1
  38. package/lib/commands/notification/shared.js +1 -1
  39. package/lib/commands/ocr/index.js +1 -1
  40. package/lib/commands/permit/dataset-get.js +1 -1
  41. package/lib/commands/permit/dataset-set.js +1 -1
  42. package/lib/commands/permit/index.js +1 -1
  43. package/lib/commands/permit/page-get.js +1 -1
  44. package/lib/commands/permit/page-set.js +1 -1
  45. package/lib/commands/permit/role-menus-set.js +1 -1
  46. package/lib/commands/permit/role-menus.js +1 -1
  47. package/lib/commands/permit/shared.js +1 -1
  48. package/lib/commands/personal-bff/index.js +1 -1
  49. package/lib/commands/registry.js +1 -1
  50. package/lib/commands/role/create.js +1 -1
  51. package/lib/commands/role/delete.js +1 -1
  52. package/lib/commands/role/detail.js +1 -1
  53. package/lib/commands/role/index.js +1 -1
  54. package/lib/commands/role/list.js +1 -1
  55. package/lib/commands/role/shared.js +1 -1
  56. package/lib/commands/role/update.js +1 -1
  57. package/lib/commands/role/user-add.js +1 -1
  58. package/lib/commands/role/user-remove.js +1 -1
  59. package/lib/commands/schedule/index.js +1 -1
  60. package/lib/commands/schema.js +1 -1
  61. package/lib/commands/service/dynamic.js +1 -1
  62. package/lib/commands/service/function-name-adapter.js +1 -1
  63. package/lib/commands/service/index.js +1 -1
  64. package/lib/commands/service/registry.js +1 -1
  65. package/lib/commands/skill/commands/create.js +1 -1
  66. package/lib/commands/skill/commands/diagram.js +1 -1
  67. package/lib/commands/skill/commands/install.js +1 -1
  68. package/lib/commands/skill/commands/list.js +1 -1
  69. package/lib/commands/skill/commands/push.js +1 -1
  70. package/lib/commands/skill/commands/validate.js +1 -1
  71. package/lib/commands/skill/diagram.js +1 -1
  72. package/lib/commands/skill/flags.js +1 -1
  73. package/lib/commands/skill/index.js +1 -1
  74. package/lib/commands/skill/manifest-helpers.js +1 -1
  75. package/lib/commands/skill/push-execute.js +1 -1
  76. package/lib/commands/skill/push-flow-helpers.js +1 -1
  77. package/lib/commands/skill/push-retarget.js +1 -1
  78. package/lib/commands/skill/scopes.js +1 -1
  79. package/lib/commands/skill/summary.js +1 -1
  80. package/lib/commands/skill/templates.js +1 -1
  81. package/lib/commands/skill/validate.js +1 -1
  82. package/lib/commands/sql/detail.js +1 -1
  83. package/lib/commands/sql/exec.js +1 -1
  84. package/lib/commands/sql/index.js +1 -1
  85. package/lib/commands/update.js +1 -1
  86. package/lib/commands/user-account/bind.js +1 -1
  87. package/lib/commands/user-account/index.js +1 -1
  88. package/lib/commands/workspace/index.js +1 -1
  89. package/lib/config/domain-config.js +1 -1
  90. package/lib/config/schema.js +1 -1
  91. package/lib/constant/app.js +1 -1
  92. package/lib/constant/auth-mode.js +1 -1
  93. package/lib/constant/cli.js +1 -1
  94. package/lib/constant/defaults.js +1 -1
  95. package/lib/constant/distribution.js +1 -1
  96. package/lib/constant/domain.js +1 -1
  97. package/lib/constant/env.js +1 -1
  98. package/lib/constant/output.js +1 -1
  99. package/lib/constant/product.js +1 -1
  100. package/lib/constant/region.js +1 -1
  101. package/lib/constant/risk.js +1 -1
  102. package/lib/constant/url.js +1 -1
  103. package/lib/context.js +1 -1
  104. package/lib/core/api-client.js +1 -1
  105. package/lib/core/db-resolver.js +1 -1
  106. package/lib/core/sdk-client.js +1 -1
  107. package/lib/errors.js +1 -1
  108. package/lib/framework/build-all-flags.js +1 -1
  109. package/lib/framework/dryrun.js +1 -1
  110. package/lib/framework/flags.js +1 -1
  111. package/lib/framework/help.js +1 -1
  112. package/lib/framework/index.js +1 -1
  113. package/lib/framework/output.js +1 -1
  114. package/lib/framework/preparse.js +1 -1
  115. package/lib/framework/rate-limit.js +1 -1
  116. package/lib/framework/raw-flags.js +1 -1
  117. package/lib/framework/response.js +1 -1
  118. package/lib/framework/runner-confirmation.js +1 -1
  119. package/lib/framework/runner-error.js +1 -1
  120. package/lib/framework/runner.js +1 -1
  121. package/lib/framework/schema-export.js +1 -1
  122. package/lib/framework/service-order.js +1 -1
  123. package/lib/framework/types.js +1 -1
  124. package/lib/generated/build-info.d.ts +4 -4
  125. package/lib/generated/build-info.js +1 -1
  126. package/lib/help.js +1 -1
  127. package/lib/postinstall.js +1 -1
  128. package/lib/runtime/confirmation.js +1 -1
  129. package/lib/runtime/event.js +1 -1
  130. package/lib/runtime/index.js +1 -1
  131. package/lib/runtime/queue.js +1 -1
  132. package/lib/runtime/resolve.js +1 -1
  133. package/lib/skills/builtin-skill.js +1 -1
  134. package/lib/skills/npx-skills-add.js +1 -1
  135. package/lib/skills/runtime-skill-sync/constants.js +1 -1
  136. package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
  137. package/lib/skills/runtime-skill-sync/hashing.js +1 -1
  138. package/lib/skills/runtime-skill-sync/install-target.js +1 -1
  139. package/lib/skills/runtime-skill-sync/links.js +1 -1
  140. package/lib/skills/runtime-skill-sync/list-local.js +1 -1
  141. package/lib/skills/runtime-skill-sync/local-files.js +1 -1
  142. package/lib/skills/runtime-skill-sync/materialize.js +1 -1
  143. package/lib/skills/runtime-skill-sync/metadata.js +1 -1
  144. package/lib/skills/runtime-skill-sync/paths.js +1 -1
  145. package/lib/skills/runtime-skill-sync/push.js +1 -1
  146. package/lib/skills/runtime-skill-sync/scopes.js +1 -1
  147. package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
  148. package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
  149. package/lib/skills/runtime-skill-sync.js +1 -1
  150. package/lib/skills/skill-presence.js +1 -1
  151. package/lib/utils/access-key-redaction.js +1 -1
  152. package/lib/utils/apply-jq-filter.js +1 -1
  153. package/lib/utils/cli-version-check.js +1 -1
  154. package/lib/utils/cli-version-policy.js +1 -1
  155. package/lib/utils/logger.js +1 -1
  156. package/lib/utils/lossless-json.js +1 -1
  157. package/lib/utils/params.js +1 -1
  158. package/lib/utils/platform.js +1 -1
  159. package/lib/utils/update-notice.js +1 -1
  160. package/lib/utils/version.js +1 -1
  161. package/lib/utils/write-cli-side-channel.js +1 -1
  162. package/package.json +1 -1
  163. package/skills/lovrabet/SKILL.md +1 -1
  164. package/skills/lovrabet.manifest.json +3 -3
@@ -1 +1 @@
1
- const a134_0xe5e6c=a134_0x1874;(function(_0x4c8367,_0x4b23aa){const _0x10ae67=a134_0x1874,_0x599f2c=_0x4c8367();while(!![]){try{const _0x43ab4c=-parseInt(_0x10ae67(0x14d))/0x1+parseInt(_0x10ae67(0x14c))/0x2*(parseInt(_0x10ae67(0x152))/0x3)+parseInt(_0x10ae67(0x14a))/0x4*(parseInt(_0x10ae67(0x148))/0x5)+parseInt(_0x10ae67(0x151))/0x6+parseInt(_0x10ae67(0x147))/0x7*(-parseInt(_0x10ae67(0x158))/0x8)+parseInt(_0x10ae67(0x143))/0x9+-parseInt(_0x10ae67(0x157))/0xa;if(_0x43ab4c===_0x4b23aa)break;else _0x599f2c['push'](_0x599f2c['shift']());}catch(_0x1bb264){_0x599f2c['push'](_0x599f2c['shift']());}}}(a134_0x1b55,0xefda5));export const METADATA_FILE=a134_0xe5e6c(0x153);export const SKILL_FILE=a134_0xe5e6c(0x14f);export const IGNORED_FILE_NAMES=new Set([METADATA_FILE,a134_0xe5e6c(0x14b)]);function a134_0x1874(_0x3fa878,_0x3fcddd){_0x3fa878=_0x3fa878-0x143;const _0x1b554d=a134_0x1b55();let _0x1874a5=_0x1b554d[_0x3fa878];return _0x1874a5;}export const IGNORED_DIR_NAMES=new Set([a134_0xe5e6c(0x14e),a134_0xe5e6c(0x146),a134_0xe5e6c(0x144),a134_0xe5e6c(0x150),a134_0xe5e6c(0x145),a134_0xe5e6c(0x156),a134_0xe5e6c(0x154),'coverage',a134_0xe5e6c(0x155),a134_0xe5e6c(0x149)]);function a134_0x1b55(){const _0x6d4c74=['node_modules','3746094lZmIVL','2514hJtSTM','lovrabet.skill.json','build','.turbo','dist','7500890cjhcbw','3807768yIzuim','6645870iBdfPb','.svn','.next','.hg','7ZXndkD','250GUCBgO','.cache','116132VnHNqH','.DS_Store','2180esarNd','1519352TpvIYn','.git','SKILL.md'];a134_0x1b55=function(){return _0x6d4c74;};return a134_0x1b55();}
1
+ function a134_0x4371(){const _0x47b61d=['.git','.next','12654830LkCiHy','4132SfSBMZ','168228GwNbdn','.svn','6820080UinuJW','344433rrbBzw','15534dqobWI','SKILL.md','node_modules','lovrabet.skill.json','dist','1834syfZof','9bKXusq','175744ecPDSq','.cache','.turbo','2992tNopmH','75tSiozV','build','398SBHxsG','coverage'];a134_0x4371=function(){return _0x47b61d;};return a134_0x4371();}const a134_0x3efbf1=a134_0x4352;(function(_0x3f34a2,_0x149c5a){const _0x50e76f=a134_0x4352,_0x4a3945=_0x3f34a2();while(!![]){try{const _0x3e5495=-parseInt(_0x50e76f(0x171))/0x1*(parseInt(_0x50e76f(0x176))/0x2)+-parseInt(_0x50e76f(0x17a))/0x3+-parseInt(_0x50e76f(0x16b))/0x4*(parseInt(_0x50e76f(0x16f))/0x5)+parseInt(_0x50e76f(0x17b))/0x6*(parseInt(_0x50e76f(0x180))/0x7)+-parseInt(_0x50e76f(0x179))/0x8+-parseInt(_0x50e76f(0x16a))/0x9*(parseInt(_0x50e76f(0x175))/0xa)+-parseInt(_0x50e76f(0x16e))/0xb*(-parseInt(_0x50e76f(0x177))/0xc);if(_0x3e5495===_0x149c5a)break;else _0x4a3945['push'](_0x4a3945['shift']());}catch(_0x4a03e7){_0x4a3945['push'](_0x4a3945['shift']());}}}(a134_0x4371,0xbdc9e));export const METADATA_FILE=a134_0x3efbf1(0x17e);export const SKILL_FILE=a134_0x3efbf1(0x17c);export const IGNORED_FILE_NAMES=new Set([METADATA_FILE,'.DS_Store']);function a134_0x4352(_0x43f248,_0x43b137){_0x43f248=_0x43f248-0x16a;const _0x437159=a134_0x4371();let _0x43524d=_0x437159[_0x43f248];return _0x43524d;}export const IGNORED_DIR_NAMES=new Set([a134_0x3efbf1(0x173),'.hg',a134_0x3efbf1(0x178),a134_0x3efbf1(0x17d),a134_0x3efbf1(0x174),a134_0x3efbf1(0x17f),a134_0x3efbf1(0x170),a134_0x3efbf1(0x172),a134_0x3efbf1(0x16d),a134_0x3efbf1(0x16c)]);
@@ -1 +1 @@
1
- (function(_0x18ef6d,_0x3a0608){const _0xf84e8e=a135_0x40a7,_0x11f645=_0x18ef6d();while(!![]){try{const _0x36a6b5=-parseInt(_0xf84e8e(0x87))/0x1*(-parseInt(_0xf84e8e(0x84))/0x2)+-parseInt(_0xf84e8e(0x90))/0x3+parseInt(_0xf84e8e(0x8b))/0x4+-parseInt(_0xf84e8e(0x8f))/0x5+parseInt(_0xf84e8e(0x82))/0x6*(parseInt(_0xf84e8e(0x91))/0x7)+-parseInt(_0xf84e8e(0x89))/0x8+parseInt(_0xf84e8e(0x8e))/0x9;if(_0x36a6b5===_0x3a0608)break;else _0x11f645['push'](_0x11f645['shift']());}catch(_0x556082){_0x11f645['push'](_0x11f645['shift']());}}}(a135_0x1656,0xeccf6));import{lstatSync,readlinkSync,realpathSync,renameSync,rmSync,writeFileSync}from'node:fs';function a135_0x40a7(_0x57f9c1,_0x55eec1){_0x57f9c1=_0x57f9c1-0x80;const _0x1656bb=a135_0x1656();let _0x40a7b7=_0x1656bb[_0x57f9c1];return _0x40a7b7;}import{dirname,isAbsolute,resolve,sep}from'node:path';import{CliErrors}from'../../errors.js';import{normalizeSkillRelativePath}from'./local-files.js';export function resolveManagedFilePath(_0x23fe99,_0x313d12){const _0x5d6bf1=a135_0x40a7,_0x94fd01=normalizeSkillRelativePath(_0x313d12),_0x851354=realOrResolved(_0x23fe99),_0x111d77=resolve(_0x851354,..._0x94fd01[_0x5d6bf1(0x8c)]('/'));if(!isPathInside(_0x111d77,_0x851354))throw CliErrors[_0x5d6bf1(0x81)](_0x5d6bf1(0x85)+_0x313d12);return ensureNoSymlinkInManagedPath(_0x851354,_0x94fd01),_0x111d77;}export function ensureNoSymlinkInManagedPath(_0x509487,_0xbf21be){const _0x185bdd=a135_0x40a7;let _0x28f17e=_0x509487;for(const _0x530742 of _0xbf21be[_0x185bdd(0x8c)]('/')){_0x28f17e=resolve(_0x28f17e,_0x530742);const _0x37cd0f=lstatIfPresent(_0x28f17e);if(_0x37cd0f?.['isSymbolicLink']())throw CliErrors['validation'](_0x185bdd(0x83)+_0xbf21be);}}export function isDanglingSymlink(_0x46f1e9){try{return lstatSync(_0x46f1e9)['isSymbolicLink']();}catch{return![];}}export function resolveSymlinkTarget(_0x321503){const _0x1c2022=readlinkSync(_0x321503);return isAbsolute(_0x1c2022)?_0x1c2022:resolve(dirname(_0x321503),_0x1c2022);}export function isPathInside(_0x4d5b0a,_0x81f387){const _0x1b339f=a135_0x40a7,_0x2faa6d=_0x4d5b0a[_0x1b339f(0x80)](sep)?_0x4d5b0a:''+_0x4d5b0a+sep,_0x4284a7=_0x81f387[_0x1b339f(0x80)](sep)?_0x81f387:''+_0x81f387+sep;return _0x4d5b0a===_0x81f387||_0x2faa6d[_0x1b339f(0x86)](_0x4284a7);}export function realOrResolved(_0x3cfbb8){try{return realpathSync(_0x3cfbb8);}catch{return resolve(_0x3cfbb8);}}function a135_0x1656(){const _0x5106a7=['endsWith','validation','6XOviHF','Refusing\x20to\x20write\x20through\x20Skill\x20symlink\x20path:\x20','8eSDhbR','Unsafe\x20Skill\x20file\x20path:\x20','startsWith','368681eFvloJ','utf8','5386320reZgiu','stringify','7734056OEylQP','split','.tmp','1414521EyfBBT','7743450fHxoTR','2509941AmaRwK','3242358YreFnI'];a135_0x1656=function(){return _0x5106a7;};return a135_0x1656();}export function lstatIfPresent(_0xef872b){try{return lstatSync(_0xef872b);}catch{return undefined;}}export function writeTextAtomic(_0x4f0b56,_0x2016b3,_0xe811d8){const _0x2327bf=a135_0x40a7;writeBytesAtomic(_0x4f0b56,Buffer['from'](_0x2016b3,_0x2327bf(0x88)),_0xe811d8);}export function writeBytesAtomic(_0x502ca9,_0x2718b0,_0x136928){const _0x50a6b8=a135_0x40a7,_0x3088ef=_0x502ca9+_0x50a6b8(0x8d);try{writeFileSync(_0x3088ef,_0x2718b0,{'mode':_0x136928}),renameSync(_0x3088ef,_0x502ca9);}catch(_0x21f1ae){try{rmSync(_0x3088ef,{'force':!![]});}catch{}throw _0x21f1ae;}}export function writeJsonAtomic(_0x568c34,_0x28501f){const _0xc4f502=a135_0x40a7;writeTextAtomic(_0x568c34,JSON[_0xc4f502(0x8a)](_0x28501f,null,0x2)+'\x0a',0x180);}
1
+ (function(_0xf21adc,_0x9ad749){const _0x36e015=a135_0x5f19,_0x5c71d7=_0xf21adc();while(!![]){try{const _0x10087f=-parseInt(_0x36e015(0x1d1))/0x1*(-parseInt(_0x36e015(0x1c7))/0x2)+-parseInt(_0x36e015(0x1c6))/0x3+-parseInt(_0x36e015(0x1ce))/0x4*(-parseInt(_0x36e015(0x1cb))/0x5)+parseInt(_0x36e015(0x1c5))/0x6+parseInt(_0x36e015(0x1bf))/0x7*(-parseInt(_0x36e015(0x1c9))/0x8)+-parseInt(_0x36e015(0x1c2))/0x9+-parseInt(_0x36e015(0x1c8))/0xa*(parseInt(_0x36e015(0x1cf))/0xb);if(_0x10087f===_0x9ad749)break;else _0x5c71d7['push'](_0x5c71d7['shift']());}catch(_0xadb7f0){_0x5c71d7['push'](_0x5c71d7['shift']());}}}(a135_0x3bd6,0x306b6));function a135_0x3bd6(){const _0x37d92b=['77178zGeHBq','from','startsWith','7lQKDiW','Refusing\x20to\x20write\x20through\x20Skill\x20symlink\x20path:\x20','.tmp','27747CQNhaI','validation','endsWith','84918neWINk','30507pQfjzg','2xcRFeI','198590CNEyzD','1811080lXljHX','utf8','5CEECUB','Unsafe\x20Skill\x20file\x20path:\x20','stringify','1465964VBwfwe','11aYceKH','isSymbolicLink'];a135_0x3bd6=function(){return _0x37d92b;};return a135_0x3bd6();}function a135_0x5f19(_0x2a15df,_0x1b58b7){_0x2a15df=_0x2a15df-0x1bf;const _0x3bd666=a135_0x3bd6();let _0x5f1943=_0x3bd666[_0x2a15df];return _0x5f1943;}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(_0x151450,_0x2ec5c7){const _0x592aa6=a135_0x5f19,_0x23ef41=normalizeSkillRelativePath(_0x2ec5c7),_0x5bdbdf=realOrResolved(_0x151450),_0x119ec8=resolve(_0x5bdbdf,..._0x23ef41['split']('/'));if(!isPathInside(_0x119ec8,_0x5bdbdf))throw CliErrors[_0x592aa6(0x1c3)](_0x592aa6(0x1cc)+_0x2ec5c7);return ensureNoSymlinkInManagedPath(_0x5bdbdf,_0x23ef41),_0x119ec8;}export function ensureNoSymlinkInManagedPath(_0x19a25a,_0x56854f){const _0x2cd090=a135_0x5f19;let _0x520771=_0x19a25a;for(const _0x36a9df of _0x56854f['split']('/')){_0x520771=resolve(_0x520771,_0x36a9df);const _0x12f6df=lstatIfPresent(_0x520771);if(_0x12f6df?.[_0x2cd090(0x1d0)]())throw CliErrors['validation'](_0x2cd090(0x1c0)+_0x56854f);}}export function isDanglingSymlink(_0x518458){const _0x56b298=a135_0x5f19;try{return lstatSync(_0x518458)[_0x56b298(0x1d0)]();}catch{return![];}}export function resolveSymlinkTarget(_0x49fd4d){const _0xac70bf=readlinkSync(_0x49fd4d);return isAbsolute(_0xac70bf)?_0xac70bf:resolve(dirname(_0x49fd4d),_0xac70bf);}export function isPathInside(_0x2300fe,_0x28c13b){const _0xe304fd=a135_0x5f19,_0x3dedb8=_0x2300fe[_0xe304fd(0x1c4)](sep)?_0x2300fe:''+_0x2300fe+sep,_0x51a74a=_0x28c13b[_0xe304fd(0x1c4)](sep)?_0x28c13b:''+_0x28c13b+sep;return _0x2300fe===_0x28c13b||_0x3dedb8[_0xe304fd(0x1d3)](_0x51a74a);}export function realOrResolved(_0x571393){try{return realpathSync(_0x571393);}catch{return resolve(_0x571393);}}export function lstatIfPresent(_0x2a175c){try{return lstatSync(_0x2a175c);}catch{return undefined;}}export function writeTextAtomic(_0x1bc23c,_0x4bdb25,_0x204270){const _0x44f129=a135_0x5f19;writeBytesAtomic(_0x1bc23c,Buffer[_0x44f129(0x1d2)](_0x4bdb25,_0x44f129(0x1ca)),_0x204270);}export function writeBytesAtomic(_0x2d3e00,_0x120344,_0x23e5d1){const _0xc7fb57=a135_0x5f19,_0x25f7c5=_0x2d3e00+_0xc7fb57(0x1c1);try{writeFileSync(_0x25f7c5,_0x120344,{'mode':_0x23e5d1}),renameSync(_0x25f7c5,_0x2d3e00);}catch(_0x4bb724){try{rmSync(_0x25f7c5,{'force':!![]});}catch{}throw _0x4bb724;}}export function writeJsonAtomic(_0x2f007a,_0x2d1292){const _0x4d461f=a135_0x5f19;writeTextAtomic(_0x2f007a,JSON[_0x4d461f(0x1cd)](_0x2d1292,null,0x2)+'\x0a',0x180);}
@@ -1 +1 @@
1
- (function(_0x29785d,_0x219c67){const _0x2cf371=a136_0x1562,_0x2cef70=_0x29785d();while(!![]){try{const _0x2fe16d=-parseInt(_0x2cf371(0x194))/0x1*(-parseInt(_0x2cf371(0x1a0))/0x2)+-parseInt(_0x2cf371(0x197))/0x3*(-parseInt(_0x2cf371(0x19c))/0x4)+parseInt(_0x2cf371(0x1a2))/0x5+parseInt(_0x2cf371(0x19d))/0x6+-parseInt(_0x2cf371(0x199))/0x7*(parseInt(_0x2cf371(0x195))/0x8)+parseInt(_0x2cf371(0x19b))/0x9*(parseInt(_0x2cf371(0x1a4))/0xa)+-parseInt(_0x2cf371(0x19e))/0xb*(parseInt(_0x2cf371(0x19f))/0xc);if(_0x2fe16d===_0x219c67)break;else _0x2cef70['push'](_0x2cef70['shift']());}catch(_0x569e23){_0x2cef70['push'](_0x2cef70['shift']());}}}(a136_0x4710,0x85276));import{createHash}from'node:crypto';function a136_0x1562(_0x59a139,_0x2741ac){_0x59a139=_0x59a139-0x194;const _0x4710bb=a136_0x4710();let _0x15620b=_0x4710bb[_0x59a139];return _0x15620b;}function a136_0x4710(){const _0x796d44=['5304732NOvukT','44YRDsGA','5684940DcFXsr','146348luBOoG','path','1916840VACsQm','size','10mXuBJx','digest','11gEwYDN','13424QhmYQk','sha256','3ijvkHM','hex','574ZYyFdb','update','4064481Ajtqgq','215844tNkQWb'];a136_0x4710=function(){return _0x796d44;};return a136_0x4710();}import{fileContent,normalizeManifestFiles}from'./local-files.js';export function contentHash(_0x7a0bb6){const _0x2ba3fe=a136_0x1562;return createHash(_0x2ba3fe(0x196))[_0x2ba3fe(0x19a)](_0x7a0bb6)[_0x2ba3fe(0x1a5)](_0x2ba3fe(0x198));}export function fileHash(_0x41425a){return bufferSha256(fileContent(_0x41425a));}export function bufferSha256(_0xbbc85e){const _0x3c27bf=a136_0x1562;return createHash(_0x3c27bf(0x196))[_0x3c27bf(0x19a)](_0xbbc85e)[_0x3c27bf(0x1a5)](_0x3c27bf(0x198));}export function fileTreeHash(_0x562329){const _0x3f52ae=a136_0x1562,_0x1c068e=createHash('sha256');for(const _0x5d11ae of normalizeManifestFiles(_0x562329)){_0x1c068e['update'](_0x5d11ae[_0x3f52ae(0x1a1)]),_0x1c068e[_0x3f52ae(0x19a)]('\x00'),_0x1c068e['update'](_0x5d11ae[_0x3f52ae(0x196)]),_0x1c068e[_0x3f52ae(0x19a)]('\x00'),_0x1c068e[_0x3f52ae(0x19a)](String(_0x5d11ae[_0x3f52ae(0x1a3)])),_0x1c068e[_0x3f52ae(0x19a)]('\x00');}return _0x1c068e[_0x3f52ae(0x1a5)](_0x3f52ae(0x198));}
1
+ (function(_0x1d8461,_0x3521fb){const _0x5c314e=a136_0x274e,_0x271d9d=_0x1d8461();while(!![]){try{const _0x19ce72=parseInt(_0x5c314e(0x128))/0x1*(parseInt(_0x5c314e(0x132))/0x2)+parseInt(_0x5c314e(0x135))/0x3+parseInt(_0x5c314e(0x130))/0x4+-parseInt(_0x5c314e(0x12a))/0x5*(parseInt(_0x5c314e(0x134))/0x6)+parseInt(_0x5c314e(0x129))/0x7+parseInt(_0x5c314e(0x12d))/0x8+-parseInt(_0x5c314e(0x12c))/0x9;if(_0x19ce72===_0x3521fb)break;else _0x271d9d['push'](_0x271d9d['shift']());}catch(_0x1b9041){_0x271d9d['push'](_0x271d9d['shift']());}}}(a136_0x5b09,0xa6ea4));import{createHash}from'node:crypto';function a136_0x5b09(){const _0x38c1c5=['path','5598eJwksc','size','6468888CbRMHC','767340vinCtc','digest','37wRJKff','9537843lXTFrp','5HBZGzp','hex','15656481ppSFgR','6144304JigcBa','sha256','update','4046044fdRpqf'];a136_0x5b09=function(){return _0x38c1c5;};return a136_0x5b09();}function a136_0x274e(_0x7ae04c,_0x2d6cea){_0x7ae04c=_0x7ae04c-0x127;const _0x5b09c6=a136_0x5b09();let _0x274ee2=_0x5b09c6[_0x7ae04c];return _0x274ee2;}import{fileContent,normalizeManifestFiles}from'./local-files.js';export function contentHash(_0x2185e3){const _0x4c56ad=a136_0x274e;return createHash(_0x4c56ad(0x12e))[_0x4c56ad(0x12f)](_0x2185e3)[_0x4c56ad(0x127)](_0x4c56ad(0x12b));}export function fileHash(_0x576416){return bufferSha256(fileContent(_0x576416));}export function bufferSha256(_0x1a1772){const _0x25810c=a136_0x274e;return createHash(_0x25810c(0x12e))[_0x25810c(0x12f)](_0x1a1772)[_0x25810c(0x127)](_0x25810c(0x12b));}export function fileTreeHash(_0x37fed0){const _0x4448ed=a136_0x274e,_0x5ace9=createHash(_0x4448ed(0x12e));for(const _0x5a49cf of normalizeManifestFiles(_0x37fed0)){_0x5ace9[_0x4448ed(0x12f)](_0x5a49cf[_0x4448ed(0x131)]),_0x5ace9['update']('\x00'),_0x5ace9[_0x4448ed(0x12f)](_0x5a49cf['sha256']),_0x5ace9['update']('\x00'),_0x5ace9[_0x4448ed(0x12f)](String(_0x5a49cf[_0x4448ed(0x133)])),_0x5ace9[_0x4448ed(0x12f)]('\x00');}return _0x5ace9[_0x4448ed(0x127)]('hex');}
@@ -1 +1 @@
1
- const a137_0x5d56e5=a137_0x2c74;function a137_0x2c74(_0x57e8e0,_0x5e397e){_0x57e8e0=_0x57e8e0-0x148;const _0x2f7583=a137_0x2f75();let _0x2c746c=_0x2f7583[_0x57e8e0];return _0x2c746c;}function a137_0x2f75(){const _0x3a0e19=['project','cwd','493778gZVJwH','2517755tRNWcf','skills','1080612PXSEJv','50687SVDDqf','898605XTUczJ','638908tChYFe','210bClBwU','freeze','global','managedRoot','appCode','.agents','12954448FaSLeB'];a137_0x2f75=function(){return _0x3a0e19;};return a137_0x2f75();}(function(_0x2e4bb5,_0x4e03f){const _0x3aba10=a137_0x2c74,_0x1aecc4=_0x2e4bb5();while(!![]){try{const _0x14d87b=-parseInt(_0x3aba10(0x150))/0x1+-parseInt(_0x3aba10(0x153))/0x2+parseInt(_0x3aba10(0x155))/0x3+parseInt(_0x3aba10(0x156))/0x4+-parseInt(_0x3aba10(0x151))/0x5+parseInt(_0x3aba10(0x157))/0x6*(-parseInt(_0x3aba10(0x154))/0x7)+parseInt(_0x3aba10(0x14d))/0x8;if(_0x14d87b===_0x4e03f)break;else _0x1aecc4['push'](_0x1aecc4['shift']());}catch(_0x57e506){_0x1aecc4['push'](_0x1aecc4['shift']());}}}(a137_0x2f75,0x4630a));import{resolve}from'node:path';import{resolveSkillSyncPaths,runtimeAgentSkillRoots,safePathSegment}from'./paths.js';export function resolveRuntimeSkillInstallTarget(_0x483d15,_0x2ef334=a137_0x5d56e5(0x149),_0x6ac7ed={}){const _0x5694e9=a137_0x5d56e5,_0x2ee7af=resolveSkillSyncPaths(_0x6ac7ed),_0x252099=safePathSegment(_0x483d15,_0x5694e9(0x14b)),_0x390d81=_0x2ef334===_0x5694e9(0x14e)?[resolve(_0x6ac7ed[_0x5694e9(0x14f)]??process[_0x5694e9(0x14f)](),_0x5694e9(0x14c),_0x5694e9(0x152))]:runtimeAgentSkillRoots(_0x2ee7af);return Object['freeze']({'scope':_0x2ef334,'appCode':_0x252099,'skillRoots':Object[_0x5694e9(0x148)](_0x390d81),'managedRoot':_0x2ee7af[_0x5694e9(0x14a)]});}
1
+ function a137_0x87cf(){const _0x215dbd=['global','skills','8ooDnFm','5952pcdnai','20QgGzlt','4318104qbJova','cwd','286104bsqLri','57OBtbux','project','41782DNwbpm','freeze','189TooEbH','3345397ZXcuMQ','20695TEQBtw','.agents','16060soxVGR','80ronmZx','65288hXtwGl','appCode'];a137_0x87cf=function(){return _0x215dbd;};return a137_0x87cf();}const a137_0x4f6542=a137_0x5284;(function(_0x5113f0,_0x5ba561){const _0x4e18ea=a137_0x5284,_0x3738f4=_0x5113f0();while(!![]){try{const _0x3c2c54=parseInt(_0x4e18ea(0x95))/0x1*(-parseInt(_0x4e18ea(0x9d))/0x2)+-parseInt(_0x4e18ea(0x8f))/0x3*(parseInt(_0x4e18ea(0x97))/0x4)+-parseInt(_0x4e18ea(0x98))/0x5*(parseInt(_0x4e18ea(0xa2))/0x6)+-parseInt(_0x4e18ea(0xa0))/0x7+parseInt(_0x4e18ea(0x99))/0x8*(-parseInt(_0x4e18ea(0x93))/0x9)+-parseInt(_0x4e18ea(0x9f))/0xa*(-parseInt(_0x4e18ea(0x94))/0xb)+-parseInt(_0x4e18ea(0x9e))/0xc*(-parseInt(_0x4e18ea(0x91))/0xd);if(_0x3c2c54===_0x5ba561)break;else _0x3738f4['push'](_0x3738f4['shift']());}catch(_0x166e5a){_0x3738f4['push'](_0x3738f4['shift']());}}}(a137_0x87cf,0x78268));import{resolve}from'node:path';function a137_0x5284(_0x1b9524,_0x5d5bcb){_0x1b9524=_0x1b9524-0x8f;const _0x87cfbc=a137_0x87cf();let _0x528423=_0x87cfbc[_0x1b9524];return _0x528423;}import{resolveSkillSyncPaths,runtimeAgentSkillRoots,safePathSegment}from'./paths.js';export function resolveRuntimeSkillInstallTarget(_0x4eab1b,_0x24ed33=a137_0x4f6542(0x9b),_0x3a2734={}){const _0x159de5=a137_0x4f6542,_0x181aa9=resolveSkillSyncPaths(_0x3a2734),_0x2cbc29=safePathSegment(_0x4eab1b,_0x159de5(0x9a)),_0x36725c=_0x24ed33===_0x159de5(0x90)?[resolve(_0x3a2734[_0x159de5(0xa1)]??process[_0x159de5(0xa1)](),_0x159de5(0x96),_0x159de5(0x9c))]:runtimeAgentSkillRoots(_0x181aa9);return Object[_0x159de5(0x92)]({'scope':_0x24ed33,'appCode':_0x2cbc29,'skillRoots':Object['freeze'](_0x36725c),'managedRoot':_0x181aa9['managedRoot']});}
@@ -1 +1 @@
1
- const a138_0x511b19=a138_0x9bdd;(function(_0x160cb0,_0x5713bc){const _0x437185=a138_0x9bdd,_0x221776=_0x160cb0();while(!![]){try{const _0x52bc0d=-parseInt(_0x437185(0x18b))/0x1+parseInt(_0x437185(0x19b))/0x2+parseInt(_0x437185(0x1b1))/0x3*(parseInt(_0x437185(0x192))/0x4)+-parseInt(_0x437185(0x190))/0x5*(-parseInt(_0x437185(0x199))/0x6)+-parseInt(_0x437185(0x19f))/0x7+-parseInt(_0x437185(0x18d))/0x8+parseInt(_0x437185(0x1a0))/0x9;if(_0x52bc0d===_0x5713bc)break;else _0x221776['push'](_0x221776['shift']());}catch(_0x430647){_0x221776['push'](_0x221776['shift']());}}}(a138_0x373f,0x8a7f4));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import a138_0x593f9c from'fs-extra';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';import{isDanglingSymlink,isPathInside,lstatIfPresent,realOrResolved,resolveSymlinkTarget}from'./fs-utils.js';function a138_0x9bdd(_0x38d945,_0x4dd6f1){_0x38d945=_0x38d945-0x178;const _0x373fa4=a138_0x373f();let _0x9bdd2=_0x373fa4[_0x38d945];return _0x9bdd2;}import{readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillCacheRoot,resolveSkillSyncPaths,safePathSegment}from'./paths.js';const {copySync,ensureDirSync,removeSync}=a138_0x593f9c,RESERVED_PROJECT_SKILL_CODES=new Set(['lovrabet',a138_0x511b19(0x1aa),a138_0x511b19(0x193)]);export function linkEffectiveRuntimeSkills(_0xfeb5d3,_0x522111){const _0x5efdf5=a138_0x511b19,_0x1b5969=new Map();for(const _0xe83719 of _0xfeb5d3){const _0x2e7345=_0xe83719[_0x5efdf5(0x17b)][_0x5efdf5(0x197)];if(!_0x2e7345)continue;const _0x115ebf=_0x1b5969[_0x5efdf5(0x183)](_0x2e7345);(!_0x115ebf||_0xe83719[_0x5efdf5(0x196)]===_0x5efdf5(0x19d))&&_0x1b5969[_0x5efdf5(0x194)](_0x2e7345,_0xe83719);}const _0x169d7e=[];for(const _0x5ace15 of _0x1b5969[_0x5efdf5(0x1b4)]()){const _0x336236=requireSkillCode(_0x5ace15[_0x5efdf5(0x17b)]),_0x4f9874=readMetadataIfPresent(_0x5ace15['metadataPath']);if(_0x4f9874?.[_0x5efdf5(0x17e)]!==_0x522111[_0x5efdf5(0x17e)]||_0x4f9874[_0x5efdf5(0x197)]!==_0x336236)throw CliErrors['validation']('Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20'+_0x522111[_0x5efdf5(0x17e)]+':\x20'+_0x5ace15[_0x5efdf5(0x1a6)]);const _0x606f5=runtimeSkillLinkName(_0x522111,_0x336236);for(const _0xf003a9 of _0x522111[_0x5efdf5(0x185)]){_0x169d7e[_0x5efdf5(0x1ac)](ensureManagedSymlink(resolve(_0xf003a9,_0x606f5),_0x5ace15[_0x5efdf5(0x187)],_0x522111,_0x336236));}}return _0x169d7e;}export function pruneStaleRuntimeSkillLinks(_0x5ec076,_0x1d0cc6,_0x34e22e){const _0x29b7a3=a138_0x511b19,_0x781f4b=new Set([..._0x1d0cc6]['map'](_0x5de684=>_0x5de684[_0x29b7a3(0x1a3)]())[_0x29b7a3(0x1af)](Boolean)),_0x201d8d=_0x34e22e?new Set([..._0x34e22e]['map'](_0xaa639a=>_0xaa639a[_0x29b7a3(0x1a3)]())[_0x29b7a3(0x1af)](Boolean)):undefined,_0x29a19a=[];for(const _0x4a8167 of _0x5ec076[_0x29b7a3(0x185)]){for(const _0x46353d of managedTargetSkillLinkPaths(_0x4a8167,_0x5ec076)){const _0x5cccf2=runtimeSkillCodeFromLink(_0x5ec076,_0x46353d);if(_0x201d8d&&!_0x201d8d[_0x29b7a3(0x1a7)](_0x5cccf2))continue;if(_0x781f4b['has'](_0x5cccf2))continue;_0x29a19a[_0x29b7a3(0x1ac)](removeManagedSkillLink(_0x46353d,_0x5ec076,_0x5cccf2));}}return _0x29a19a;}export function pruneStaleRuntimeSkillCache(_0x1e3ea5,_0x4a315a={}){const _0x38e30d=a138_0x511b19,_0x167c4c=new Set([..._0x1e3ea5[_0x38e30d(0x1a5)]][_0x38e30d(0x1ab)](_0x2306d9=>_0x2306d9[_0x38e30d(0x1a3)]())[_0x38e30d(0x1af)](Boolean)),_0x27c26c=_0x1e3ea5[_0x38e30d(0x181)]?new Set([..._0x1e3ea5['pruneSkillCodes']][_0x38e30d(0x1ab)](_0x1c2283=>_0x1c2283[_0x38e30d(0x1a3)]())[_0x38e30d(0x1af)](Boolean)):undefined,_0x385481=_0x1e3ea5[_0x38e30d(0x17f)]??['personal',_0x38e30d(0x189)],_0x5656b6=resolve(getRuntimeSkillCacheRoot(_0x1e3ea5[_0x38e30d(0x1a1)],_0x1e3ea5[_0x38e30d(0x19a)],_0x4a315a),safePathSegment(_0x1e3ea5[_0x38e30d(0x17e)],_0x38e30d(0x17e))),_0x5d3e84=[];for(const _0x4ff01f of _0x385481){const _0x118c6a=resolve(_0x5656b6,_0x4ff01f);if(!existsSync(_0x118c6a))continue;for(const _0x241eea of readdirSync(_0x118c6a,{'withFileTypes':!![]})){if(!_0x241eea[_0x38e30d(0x186)]())continue;const _0x3f9352=_0x241eea[_0x38e30d(0x184)];if(_0x27c26c&&!_0x27c26c[_0x38e30d(0x1a7)](_0x3f9352))continue;if(_0x167c4c['has'](_0x3f9352))continue;const _0x38e4d6=resolve(_0x118c6a,_0x3f9352),_0x8bc380=readMetadataIfPresent(resolve(_0x38e4d6,METADATA_FILE));if(_0x8bc380?.['appCode']!==_0x1e3ea5[_0x38e30d(0x17e)]||_0x8bc380['scope']!==_0x4ff01f||_0x8bc380[_0x38e30d(0x197)]!==_0x3f9352){_0x5d3e84[_0x38e30d(0x1ac)]({'path':_0x38e4d6,'action':_0x38e30d(0x18e),'reason':'metadata-mismatch'});continue;}if(isLinkedFromAnyRoot(_0x38e4d6,_0x1e3ea5[_0x38e30d(0x19c)]??[])){_0x5d3e84['push']({'path':_0x38e4d6,'action':'skipped','reason':'linked-from-protected-root'});continue;}removeSync(_0x38e4d6),_0x5d3e84[_0x38e30d(0x1ac)]({'path':_0x38e4d6,'action':_0x38e30d(0x1b2)});}}return _0x5d3e84;}export function linkGlobalRuntimeSkills(_0x8d88b4,_0x4f7f71={}){const _0x145761=a138_0x511b19,_0x441a6b=resolveSkillSyncPaths(_0x4f7f71),_0x1d4e58=[];for(const _0x21f088 of _0x8d88b4){if(_0x21f088['scope']!==_0x145761(0x198))throw CliErrors['validation'](_0x145761(0x18c)+_0x21f088[_0x145761(0x196)]);const _0x2abe6d=requireSkillCode(_0x21f088[_0x145761(0x17b)]),_0x59da23=copyManagedSkillDirectory(_0x21f088[_0x145761(0x187)],resolve(_0x441a6b[_0x145761(0x1a9)],_0x2abe6d));_0x1d4e58['push']({..._0x59da23,'contentHash':_0x21f088[_0x145761(0x17d)]});}return _0x1d4e58;}function ensureManagedSymlink(_0x2d22d5,_0x343ea7,_0x3c136a,_0x2ddf83){const _0x5c927b=a138_0x511b19;mkdirSync(dirname(_0x2d22d5),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x2d22d5)||isDanglingSymlink(_0x2d22d5)){const _0x9e3362=lstatSync(_0x2d22d5);if(!_0x9e3362[_0x5c927b(0x178)]())throw CliErrors['validation'](_0x5c927b(0x195)+_0x2d22d5);const _0x3f5244=resolveSymlinkTarget(_0x2d22d5);if(!isPathInside(realOrResolved(_0x3f5244),realOrResolved(_0x3c136a['managedRoot'])))throw CliErrors[_0x5c927b(0x17c)](_0x5c927b(0x1b3)+_0x2d22d5);if(realOrResolved(_0x3f5244)===realOrResolved(_0x343ea7))return{'path':_0x2d22d5,'target':_0x343ea7,'action':'unchanged'};const _0x4d3811=readMetadataIfPresent(resolve(_0x3f5244,METADATA_FILE));if(_0x3c136a[_0x5c927b(0x196)]===_0x5c927b(0x1ad)&&(_0x4d3811?.[_0x5c927b(0x17e)]!==_0x3c136a[_0x5c927b(0x17e)]||_0x4d3811[_0x5c927b(0x197)]!==_0x2ddf83))throw CliErrors['validation']('Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20'+_0x2d22d5);return unlinkSync(_0x2d22d5),symlinkSync(_0x343ea7,_0x2d22d5,_0x5c927b(0x187)),{'path':_0x2d22d5,'target':_0x343ea7,'action':_0x5c927b(0x1b0)};}return symlinkSync(_0x343ea7,_0x2d22d5,_0x5c927b(0x187)),{'path':_0x2d22d5,'target':_0x343ea7,'action':_0x5c927b(0x18f)};}function a138_0x373f(){const _0x28f145=['pruneSkillCodes','unchanged','get','name','skillRoots','isDirectory','dir','Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20','company','Refusing\x20to\x20copy\x20Skill\x20symlink:\x20','352845CTMGyj','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','2951096FfNlbh','skipped','created','413055scEpRi','length','44MhjfYr','secret-retriever','set','Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20','scope','skillCode','builtin','36gKdkjY','accessKey','124720BvroYo','protectedLinkRoots','personal','managedRoot','7459571HwmPWx','11099304tCtlpJ','env','Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20','trim','slice','activeSkillCodes','metadataPath','has','Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20','agentsSkillsDir','runtime-observe','map','push','project','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20','filter','updated','153651gNfFrb','removed','Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20','values','isSymbolicLink','startsWith','external-symlink','skill','validation','contentHash','appCode','scopes','metadata-mismatch'];a138_0x373f=function(){return _0x28f145;};return a138_0x373f();}function managedTargetSkillLinkPaths(_0x22b9a0,_0x2810e2){const _0x26ada2=a138_0x511b19;if(!existsSync(_0x22b9a0))return[];const _0x2f58d0=_0x2810e2[_0x26ada2(0x17e)]+'--';return readdirSync(_0x22b9a0,{'withFileTypes':!![]})[_0x26ada2(0x1af)](_0xc95b24=>_0x2810e2['scope']==='project'||_0xc95b24[_0x26ada2(0x184)][_0x26ada2(0x179)](_0x2f58d0))[_0x26ada2(0x1ab)](_0x4a8abe=>resolve(_0x22b9a0,_0x4a8abe[_0x26ada2(0x184)]));}function removeManagedSkillLink(_0x1fff98,_0x4581c2,_0x5d0d7b){const _0x14693a=a138_0x511b19,_0x3a67a5=lstatIfPresent(_0x1fff98);if(!_0x3a67a5?.[_0x14693a(0x178)]())return{'path':_0x1fff98,'action':'skipped','reason':'not-managed-symlink'};const _0x3ff45c=resolveSymlinkTarget(_0x1fff98);if(!isPathInside(realOrResolved(_0x3ff45c),realOrResolved(_0x4581c2[_0x14693a(0x19e)])))return{'path':_0x1fff98,'action':'skipped','reason':_0x14693a(0x17a)};const _0xe6f0b3=readMetadataIfPresent(resolve(_0x3ff45c,METADATA_FILE));if(_0x4581c2[_0x14693a(0x196)]===_0x14693a(0x1ad)&&(_0xe6f0b3?.[_0x14693a(0x17e)]!==_0x4581c2[_0x14693a(0x17e)]||_0xe6f0b3[_0x14693a(0x197)]!==_0x5d0d7b))return{'path':_0x1fff98,'action':_0x14693a(0x18e),'reason':_0x14693a(0x180)};return unlinkSync(_0x1fff98),{'path':_0x1fff98,'action':'removed'};}function isLinkedFromAnyRoot(_0x4d2321,_0x66aa5e){const _0x5f29f8=a138_0x511b19,_0x38e9e5=realOrResolved(_0x4d2321);for(const _0x598f06 of _0x66aa5e){if(!existsSync(_0x598f06))continue;for(const _0x3d0048 of readdirSync(_0x598f06,{'withFileTypes':!![]})){if(!_0x3d0048[_0x5f29f8(0x178)]())continue;const _0x294d0a=resolve(_0x598f06,_0x3d0048[_0x5f29f8(0x184)]);if(realOrResolved(resolveSymlinkTarget(_0x294d0a))===_0x38e9e5)return!![];}}return![];}function runtimeSkillLinkName(_0x423438,_0x17c054){const _0x4fab78=a138_0x511b19,_0x2d329a=safePathSegment(_0x17c054,_0x4fab78(0x197));if(_0x423438['scope']===_0x4fab78(0x1ad)&&RESERVED_PROJECT_SKILL_CODES[_0x4fab78(0x1a7)](_0x2d329a))throw CliErrors[_0x4fab78(0x17c)](_0x4fab78(0x1a2)+_0x2d329a);return _0x423438[_0x4fab78(0x196)]===_0x4fab78(0x1ad)?_0x2d329a:_0x423438['appCode']+'--'+_0x2d329a;}function runtimeSkillCodeFromLink(_0x1f8801,_0x48775a){const _0x10bc71=a138_0x511b19,_0x4abc8c=basename(_0x48775a);return _0x1f8801[_0x10bc71(0x196)]===_0x10bc71(0x1ad)?_0x4abc8c:_0x4abc8c[_0x10bc71(0x1a4)]((_0x1f8801[_0x10bc71(0x17e)]+'--')[_0x10bc71(0x191)]);}export function copyManagedSkillDirectory(_0x4c9352,_0x1d5cf9){const _0x3ff0f5=a138_0x511b19,_0x5a8869=resolve(_0x1d5cf9,METADATA_FILE),_0x381e5c=existsSync(_0x1d5cf9);if(_0x381e5c){const _0x22ac47=lstatSync(_0x1d5cf9);if(_0x22ac47['isSymbolicLink']())throw CliErrors['validation'](_0x3ff0f5(0x1a8)+_0x1d5cf9);if(!_0x22ac47[_0x3ff0f5(0x186)]())throw CliErrors[_0x3ff0f5(0x17c)](_0x3ff0f5(0x188)+_0x1d5cf9);const _0x2770f9=readMetadataIfPresent(_0x5a8869);if(_0x2770f9?.['scope']!==_0x3ff0f5(0x198))throw CliErrors['validation'](_0x3ff0f5(0x1ae)+_0x1d5cf9);}ensureDirSync(dirname(_0x1d5cf9));const _0x32d925=_0x381e5c?readMetadataIfPresent(_0x5a8869)?.[_0x3ff0f5(0x17d)]:undefined,_0x5abda6=readMetadataIfPresent(resolve(_0x4c9352,METADATA_FILE))?.[_0x3ff0f5(0x17d)];return _0x381e5c&&removeSync(_0x1d5cf9),copySkillDirectory(_0x4c9352,_0x1d5cf9),{'path':_0x1d5cf9,'target':_0x4c9352,'action':!_0x381e5c?_0x3ff0f5(0x18f):_0x32d925===_0x5abda6?_0x3ff0f5(0x182):'updated'};}function copySkillDirectory(_0x33b9e8,_0x19b410){copySync(_0x33b9e8,_0x19b410,{'dereference':![],'overwrite':!![],'filter'(_0xd4b4fa){const _0x59b151=a138_0x9bdd;if(lstatSync(_0xd4b4fa)[_0x59b151(0x178)]())throw CliErrors['validation'](_0x59b151(0x18a)+_0xd4b4fa);return!![];}});}
1
+ const a138_0x50ac1a=a138_0x294d;(function(_0x534d63,_0x379e4b){const _0x555187=a138_0x294d,_0x3324c5=_0x534d63();while(!![]){try{const _0x39eed3=-parseInt(_0x555187(0xc1))/0x1+-parseInt(_0x555187(0xa4))/0x2*(parseInt(_0x555187(0xaa))/0x3)+-parseInt(_0x555187(0xb0))/0x4+-parseInt(_0x555187(0xcd))/0x5*(parseInt(_0x555187(0xad))/0x6)+parseInt(_0x555187(0xcc))/0x7*(-parseInt(_0x555187(0xd2))/0x8)+-parseInt(_0x555187(0xd3))/0x9+parseInt(_0x555187(0xb9))/0xa;if(_0x39eed3===_0x379e4b)break;else _0x3324c5['push'](_0x3324c5['shift']());}catch(_0x5c037f){_0x3324c5['push'](_0x3324c5['shift']());}}}(a138_0x5644,0x1c6f6));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import a138_0x4600b6 from'fs-extra';import{CliErrors}from'../../errors.js';function a138_0x5644(){const _0x5896bf=['company','set','Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20','trim','name','filter','startsWith','7QvQkuy','5FdyyGC','linked-from-protected-root','get','pruneSkillCodes','Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20','433208ehaVUW','1963062Okomfs','removed','metadata-mismatch','accessKey','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','validation','metadataPath','length','Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20','env','skill','skillRoots','unchanged','Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20','8kACmpY','appCode','push','isSymbolicLink','has','Refusing\x20to\x20copy\x20Skill\x20symlink:\x20','43863pyjglu','not-managed-symlink','agentsSkillsDir','586128QqMWeu','created','lovrabet','143936uuXbCP','scope','values','builtin','skipped','contentHash','personal','protectedLinkRoots','isDirectory','6863920TgsnJe','skillCode','dir','project','scopes','map','updated','Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20','105497fTcyhe','Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20','managedRoot','activeSkillCodes'];a138_0x5644=function(){return _0x5896bf;};return a138_0x5644();}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_0x4600b6,RESERVED_PROJECT_SKILL_CODES=new Set([a138_0x50ac1a(0xaf),'runtime-observe','secret-retriever']);export function linkEffectiveRuntimeSkills(_0x1d9e29,_0x3619c3){const _0x7722b3=a138_0x50ac1a,_0x3e5488=new Map();for(const _0x1fd6b7 of _0x1d9e29){const _0x6a844d=_0x1fd6b7[_0x7722b3(0xa0)][_0x7722b3(0xba)];if(!_0x6a844d)continue;const _0x558530=_0x3e5488[_0x7722b3(0xcf)](_0x6a844d);(!_0x558530||_0x1fd6b7['scope']===_0x7722b3(0xb6))&&_0x3e5488[_0x7722b3(0xc6)](_0x6a844d,_0x1fd6b7);}const _0x1ac133=[];for(const _0x3e3e96 of _0x3e5488[_0x7722b3(0xb2)]()){const _0x1cefaa=requireSkillCode(_0x3e3e96['skill']),_0x4105cf=readMetadataIfPresent(_0x3e3e96[_0x7722b3(0x9c)]);if(_0x4105cf?.[_0x7722b3(0xa5)]!==_0x3619c3[_0x7722b3(0xa5)]||_0x4105cf['skillCode']!==_0x1cefaa)throw CliErrors[_0x7722b3(0x9b)](_0x7722b3(0xc7)+_0x3619c3[_0x7722b3(0xa5)]+':\x20'+_0x3e3e96[_0x7722b3(0x9c)]);const _0x3422c5=runtimeSkillLinkName(_0x3619c3,_0x1cefaa);for(const _0x3f6c6f of _0x3619c3[_0x7722b3(0xa1)]){_0x1ac133[_0x7722b3(0xa6)](ensureManagedSymlink(resolve(_0x3f6c6f,_0x3422c5),_0x3e3e96[_0x7722b3(0xbb)],_0x3619c3,_0x1cefaa));}}return _0x1ac133;}export function pruneStaleRuntimeSkillLinks(_0x2fcac8,_0x54b047,_0x4a0164){const _0xa697e2=a138_0x50ac1a,_0x3092ec=new Set([..._0x54b047][_0xa697e2(0xbe)](_0x28b291=>_0x28b291[_0xa697e2(0xc8)]())['filter'](Boolean)),_0x34d1bf=_0x4a0164?new Set([..._0x4a0164][_0xa697e2(0xbe)](_0x3750f7=>_0x3750f7[_0xa697e2(0xc8)]())[_0xa697e2(0xca)](Boolean)):undefined,_0x556aeb=[];for(const _0x6deb0b of _0x2fcac8[_0xa697e2(0xa1)]){for(const _0x21f87a of managedTargetSkillLinkPaths(_0x6deb0b,_0x2fcac8)){const _0x18f28a=runtimeSkillCodeFromLink(_0x2fcac8,_0x21f87a);if(_0x34d1bf&&!_0x34d1bf[_0xa697e2(0xa8)](_0x18f28a))continue;if(_0x3092ec[_0xa697e2(0xa8)](_0x18f28a))continue;_0x556aeb[_0xa697e2(0xa6)](removeManagedSkillLink(_0x21f87a,_0x2fcac8,_0x18f28a));}}return _0x556aeb;}export function pruneStaleRuntimeSkillCache(_0x4cd209,_0x38e1cb={}){const _0x30871e=a138_0x50ac1a,_0x1624b9=new Set([..._0x4cd209[_0x30871e(0xc4)]]['map'](_0x16a5e4=>_0x16a5e4[_0x30871e(0xc8)]())[_0x30871e(0xca)](Boolean)),_0x546a75=_0x4cd209[_0x30871e(0xd0)]?new Set([..._0x4cd209['pruneSkillCodes']][_0x30871e(0xbe)](_0x277300=>_0x277300[_0x30871e(0xc8)]())['filter'](Boolean)):undefined,_0x2bceed=_0x4cd209[_0x30871e(0xbd)]??[_0x30871e(0xb6),_0x30871e(0xc5)],_0x408887=resolve(getRuntimeSkillCacheRoot(_0x4cd209[_0x30871e(0x9f)],_0x4cd209[_0x30871e(0xd6)],_0x38e1cb),safePathSegment(_0x4cd209[_0x30871e(0xa5)],_0x30871e(0xa5))),_0x30ba90=[];for(const _0x2d3fb3 of _0x2bceed){const _0x43f99d=resolve(_0x408887,_0x2d3fb3);if(!existsSync(_0x43f99d))continue;for(const _0x5b5380 of readdirSync(_0x43f99d,{'withFileTypes':!![]})){if(!_0x5b5380[_0x30871e(0xb8)]())continue;const _0x20251a=_0x5b5380[_0x30871e(0xc9)];if(_0x546a75&&!_0x546a75[_0x30871e(0xa8)](_0x20251a))continue;if(_0x1624b9[_0x30871e(0xa8)](_0x20251a))continue;const _0x3a0ae4=resolve(_0x43f99d,_0x20251a),_0x384b7f=readMetadataIfPresent(resolve(_0x3a0ae4,METADATA_FILE));if(_0x384b7f?.[_0x30871e(0xa5)]!==_0x4cd209['appCode']||_0x384b7f[_0x30871e(0xb1)]!==_0x2d3fb3||_0x384b7f[_0x30871e(0xba)]!==_0x20251a){_0x30ba90[_0x30871e(0xa6)]({'path':_0x3a0ae4,'action':'skipped','reason':_0x30871e(0xd5)});continue;}if(isLinkedFromAnyRoot(_0x3a0ae4,_0x4cd209[_0x30871e(0xb7)]??[])){_0x30ba90['push']({'path':_0x3a0ae4,'action':_0x30871e(0xb4),'reason':_0x30871e(0xce)});continue;}removeSync(_0x3a0ae4),_0x30ba90[_0x30871e(0xa6)]({'path':_0x3a0ae4,'action':'removed'});}}return _0x30ba90;}function a138_0x294d(_0xefca70,_0x1dd19c){_0xefca70=_0xefca70-0x9a;const _0x5644f0=a138_0x5644();let _0x294db7=_0x5644f0[_0xefca70];return _0x294db7;}export function linkGlobalRuntimeSkills(_0x4780b5,_0x32b8d8={}){const _0x905436=a138_0x50ac1a,_0x2eebaf=resolveSkillSyncPaths(_0x32b8d8),_0x4311d6=[];for(const _0x271799 of _0x4780b5){if(_0x271799[_0x905436(0xb1)]!==_0x905436(0xb3))throw CliErrors[_0x905436(0x9b)](_0x905436(0x9a)+_0x271799[_0x905436(0xb1)]);const _0x3b6a2b=requireSkillCode(_0x271799[_0x905436(0xa0)]),_0x40b49d=copyManagedSkillDirectory(_0x271799['dir'],resolve(_0x2eebaf[_0x905436(0xac)],_0x3b6a2b));_0x4311d6[_0x905436(0xa6)]({..._0x40b49d,'contentHash':_0x271799['contentHash']});}return _0x4311d6;}function ensureManagedSymlink(_0x1c1951,_0x5c88a4,_0x4777a7,_0x428dd9){const _0x28f89f=a138_0x50ac1a;mkdirSync(dirname(_0x1c1951),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x1c1951)||isDanglingSymlink(_0x1c1951)){const _0x187eb7=lstatSync(_0x1c1951);if(!_0x187eb7['isSymbolicLink']())throw CliErrors[_0x28f89f(0x9b)](_0x28f89f(0xd1)+_0x1c1951);const _0x231565=resolveSymlinkTarget(_0x1c1951);if(!isPathInside(realOrResolved(_0x231565),realOrResolved(_0x4777a7[_0x28f89f(0xc3)])))throw CliErrors[_0x28f89f(0x9b)](_0x28f89f(0xc2)+_0x1c1951);if(realOrResolved(_0x231565)===realOrResolved(_0x5c88a4))return{'path':_0x1c1951,'target':_0x5c88a4,'action':_0x28f89f(0xa2)};const _0x172b68=readMetadataIfPresent(resolve(_0x231565,METADATA_FILE));if(_0x4777a7['scope']===_0x28f89f(0xbc)&&(_0x172b68?.[_0x28f89f(0xa5)]!==_0x4777a7[_0x28f89f(0xa5)]||_0x172b68[_0x28f89f(0xba)]!==_0x428dd9))throw CliErrors[_0x28f89f(0x9b)](_0x28f89f(0xa3)+_0x1c1951);return unlinkSync(_0x1c1951),symlinkSync(_0x5c88a4,_0x1c1951,_0x28f89f(0xbb)),{'path':_0x1c1951,'target':_0x5c88a4,'action':_0x28f89f(0xbf)};}return symlinkSync(_0x5c88a4,_0x1c1951,'dir'),{'path':_0x1c1951,'target':_0x5c88a4,'action':_0x28f89f(0xae)};}function managedTargetSkillLinkPaths(_0x128acd,_0x114f8c){const _0x18e85e=a138_0x50ac1a;if(!existsSync(_0x128acd))return[];const _0x2f12a9=_0x114f8c[_0x18e85e(0xa5)]+'--';return readdirSync(_0x128acd,{'withFileTypes':!![]})[_0x18e85e(0xca)](_0x159c71=>_0x114f8c['scope']==='project'||_0x159c71[_0x18e85e(0xc9)][_0x18e85e(0xcb)](_0x2f12a9))[_0x18e85e(0xbe)](_0x2ef18b=>resolve(_0x128acd,_0x2ef18b[_0x18e85e(0xc9)]));}function removeManagedSkillLink(_0x2bfd4f,_0x2a4d0d,_0x282582){const _0x548b83=a138_0x50ac1a,_0x18f665=lstatIfPresent(_0x2bfd4f);if(!_0x18f665?.[_0x548b83(0xa7)]())return{'path':_0x2bfd4f,'action':_0x548b83(0xb4),'reason':_0x548b83(0xab)};const _0x350218=resolveSymlinkTarget(_0x2bfd4f);if(!isPathInside(realOrResolved(_0x350218),realOrResolved(_0x2a4d0d['managedRoot'])))return{'path':_0x2bfd4f,'action':_0x548b83(0xb4),'reason':'external-symlink'};const _0x1e6d56=readMetadataIfPresent(resolve(_0x350218,METADATA_FILE));if(_0x2a4d0d[_0x548b83(0xb1)]===_0x548b83(0xbc)&&(_0x1e6d56?.[_0x548b83(0xa5)]!==_0x2a4d0d[_0x548b83(0xa5)]||_0x1e6d56[_0x548b83(0xba)]!==_0x282582))return{'path':_0x2bfd4f,'action':'skipped','reason':_0x548b83(0xd5)};return unlinkSync(_0x2bfd4f),{'path':_0x2bfd4f,'action':_0x548b83(0xd4)};}function isLinkedFromAnyRoot(_0x32f68f,_0x60c0e4){const _0x222262=realOrResolved(_0x32f68f);for(const _0x1aa0b9 of _0x60c0e4){if(!existsSync(_0x1aa0b9))continue;for(const _0x189b6f of readdirSync(_0x1aa0b9,{'withFileTypes':!![]})){if(!_0x189b6f['isSymbolicLink']())continue;const _0x488124=resolve(_0x1aa0b9,_0x189b6f['name']);if(realOrResolved(resolveSymlinkTarget(_0x488124))===_0x222262)return!![];}}return![];}function runtimeSkillLinkName(_0xada033,_0x10b831){const _0x4bd7c5=a138_0x50ac1a,_0x5760b8=safePathSegment(_0x10b831,'skillCode');if(_0xada033['scope']===_0x4bd7c5(0xbc)&&RESERVED_PROJECT_SKILL_CODES[_0x4bd7c5(0xa8)](_0x5760b8))throw CliErrors['validation'](_0x4bd7c5(0x9e)+_0x5760b8);return _0xada033[_0x4bd7c5(0xb1)]===_0x4bd7c5(0xbc)?_0x5760b8:_0xada033['appCode']+'--'+_0x5760b8;}function runtimeSkillCodeFromLink(_0x1072a0,_0x56301e){const _0x160bc5=a138_0x50ac1a,_0x330a5c=basename(_0x56301e);return _0x1072a0[_0x160bc5(0xb1)]==='project'?_0x330a5c:_0x330a5c['slice']((_0x1072a0['appCode']+'--')[_0x160bc5(0x9d)]);}export function copyManagedSkillDirectory(_0x40d284,_0x2f4159){const _0x22520b=a138_0x50ac1a,_0x29b758=resolve(_0x2f4159,METADATA_FILE),_0xf99c7e=existsSync(_0x2f4159);if(_0xf99c7e){const _0x236a91=lstatSync(_0x2f4159);if(_0x236a91['isSymbolicLink']())throw CliErrors['validation'](_0x22520b(0xc0)+_0x2f4159);if(!_0x236a91[_0x22520b(0xb8)]())throw CliErrors[_0x22520b(0x9b)]('Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20'+_0x2f4159);const _0xb29f8=readMetadataIfPresent(_0x29b758);if(_0xb29f8?.[_0x22520b(0xb1)]!=='builtin')throw CliErrors['validation']('Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20'+_0x2f4159);}ensureDirSync(dirname(_0x2f4159));const _0x5f5b0a=_0xf99c7e?readMetadataIfPresent(_0x29b758)?.[_0x22520b(0xb5)]:undefined,_0x558169=readMetadataIfPresent(resolve(_0x40d284,METADATA_FILE))?.[_0x22520b(0xb5)];return _0xf99c7e&&removeSync(_0x2f4159),copySkillDirectory(_0x40d284,_0x2f4159),{'path':_0x2f4159,'target':_0x40d284,'action':!_0xf99c7e?'created':_0x5f5b0a===_0x558169?'unchanged':'updated'};}function copySkillDirectory(_0x1e8218,_0x123ff9){copySync(_0x1e8218,_0x123ff9,{'dereference':![],'overwrite':!![],'filter'(_0x5a24f2){const _0x45e83f=a138_0x294d;if(lstatSync(_0x5a24f2)['isSymbolicLink']())throw CliErrors[_0x45e83f(0x9b)](_0x45e83f(0xa9)+_0x5a24f2);return!![];}});}
@@ -1 +1 @@
1
- (function(_0x252991,_0x45022c){const _0xad0110=a139_0x2b45,_0x1e4de3=_0x252991();while(!![]){try{const _0x58c913=-parseInt(_0xad0110(0xb1))/0x1*(parseInt(_0xad0110(0xc2))/0x2)+-parseInt(_0xad0110(0x9e))/0x3*(parseInt(_0xad0110(0xc1))/0x4)+parseInt(_0xad0110(0xb4))/0x5+-parseInt(_0xad0110(0xa7))/0x6+parseInt(_0xad0110(0xb7))/0x7*(parseInt(_0xad0110(0xb0))/0x8)+parseInt(_0xad0110(0xc7))/0x9+-parseInt(_0xad0110(0xb6))/0xa*(-parseInt(_0xad0110(0xb9))/0xb);if(_0x58c913===_0x45022c)break;else _0x1e4de3['push'](_0x1e4de3['shift']());}catch(_0x56919b){_0x1e4de3['push'](_0x1e4de3['shift']());}}}(a139_0x35fc,0x2c6dc));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_0x35fc(){const _0x15896d=['651180hCatTm','validation','map','startsWith','cacheDir','tags','dir','localeCompare','from','5576qevJNE','5552JhLjle','isSymbolicLink','scope','314590vfLBfr','values','42970HCefKC','3234ArXINH','builtin','385qJsioe','code','sort','Runtime\x20Skill\x20install\x20target\x20app\x20mismatch:\x20','source','appCode','cache','scopes','4UWsHkK','118xOGIXP','skillRoots','linkedPath','local','skillMdPath','2842452YGkIaJ','trim','skillCode','linkedPaths','filter','project','get','name','isDirectory','699231ZKrvah','push','env','\x20!=\x20','includes','link','metadataPath','isArray','has'];a139_0x35fc=function(){return _0x15896d;};return a139_0x35fc();}import{readMetadataIfPresent}from'./metadata.js';import{getRuntimeSkillCacheRoot,safePathSegment}from'./paths.js';import{isRuntimeSkillScope,normalizeRuntimeSkillScopes}from'./scopes.js';function a139_0x2b45(_0x3f2870,_0x34cd49){_0x3f2870=_0x3f2870-0x9e;const _0x35fcc6=a139_0x35fc();let _0x2b45df=_0x35fcc6[_0x3f2870];return _0x2b45df;}export function listLocalRuntimeSkills(_0x423dd2,_0x120cae,_0x3983f7={}){const _0x3c2861=a139_0x2b45,_0x2f00ec=safePathSegment(_0x423dd2[_0x3c2861(0xbe)],_0x3c2861(0xbe));if(_0x120cae[_0x3c2861(0xbe)]!==_0x2f00ec)throw CliErrors[_0x3c2861(0xa8)](_0x3c2861(0xbc)+_0x120cae[_0x3c2861(0xbe)]+_0x3c2861(0xa1)+_0x2f00ec);const _0x4c77bd=normalizeRuntimeSkillScopes(_0x423dd2[_0x3c2861(0xc0)]),_0x2617f7=new Set(_0x4c77bd),_0x4cde2e=_0x423dd2['code']?.[_0x3c2861(0xc8)](),_0x1943f3=new Map(),_0xa8ee64=resolve(getRuntimeSkillCacheRoot(_0x423dd2[_0x3c2861(0xa0)],_0x423dd2['accessKey'],_0x3983f7),_0x2f00ec);for(const _0x5c19e5 of _0x4c77bd){for(const _0x26c393 of localSkillEntryDirs(resolve(_0xa8ee64,_0x5c19e5))){collectLocalRuntimeSkill(_0x1943f3,_0x26c393,{'appCode':_0x2f00ec,'scopes':_0x2617f7,'code':_0x4cde2e,'source':_0x3c2861(0xbf)});}}for(const _0x256adf of _0x120cae[_0x3c2861(0xc3)]){for(const _0x28f722 of localSkillLinkCandidates(_0x256adf,_0x120cae,_0x2617f7)){collectLocalRuntimeSkill(_0x1943f3,_0x28f722,{'appCode':_0x2f00ec,'scopes':_0x2617f7,'code':_0x4cde2e,'source':_0x3c2861(0xa3),'linkedPath':_0x28f722});}}return Array[_0x3c2861(0xaf)](_0x1943f3[_0x3c2861(0xb5)]())[_0x3c2861(0xbb)](compareLocalRuntimeSkills);}function localSkillEntryDirs(_0x15091d){const _0x38f158=a139_0x2b45;if(!existsSync(_0x15091d))return[];return readdirSync(_0x15091d,{'withFileTypes':!![]})[_0x38f158(0xcb)](_0x3366aa=>_0x3366aa['isDirectory']()||_0x3366aa[_0x38f158(0xb2)]())[_0x38f158(0xa9)](_0x4c9e0a=>resolve(_0x15091d,_0x4c9e0a['name']));}function localSkillLinkCandidates(_0x32ae14,_0x87a03a,_0xcfa8a1){const _0x36efe6=a139_0x2b45;if(!existsSync(_0x32ae14))return[];const _0x3406e1=_0x87a03a['appCode']+'--';return readdirSync(_0x32ae14,{'withFileTypes':!![]})[_0x36efe6(0xcb)](_0x571a8b=>_0x571a8b[_0x36efe6(0xcf)]()||_0x571a8b['isSymbolicLink']())[_0x36efe6(0xcb)](_0x3bea3f=>_0x87a03a[_0x36efe6(0xb3)]===_0x36efe6(0xcc)||_0x3bea3f[_0x36efe6(0xce)][_0x36efe6(0xaa)](_0x3406e1)||_0xcfa8a1[_0x36efe6(0xa6)](_0x36efe6(0xb8)))[_0x36efe6(0xa9)](_0xdc0e51=>resolve(_0x32ae14,_0xdc0e51[_0x36efe6(0xce)]));}function collectLocalRuntimeSkill(_0x5048a9,_0x1c2833,_0x7c101d){const _0x48aedb=a139_0x2b45,_0x5aedce=resolve(_0x1c2833,METADATA_FILE),_0x50c458=readMetadataIfPresent(_0x5aedce);if(!_0x50c458)return;if(_0x50c458[_0x48aedb(0xbe)]!==_0x7c101d[_0x48aedb(0xbe)])return;if(!isRuntimeSkillScope(_0x50c458[_0x48aedb(0xb3)])||!_0x7c101d[_0x48aedb(0xc0)]['has'](_0x50c458[_0x48aedb(0xb3)]))return;const _0x4b0e35=_0x50c458[_0x48aedb(0xc9)]?.[_0x48aedb(0xc8)]();if(!_0x4b0e35)return;if(_0x7c101d[_0x48aedb(0xba)]&&_0x4b0e35!==_0x7c101d[_0x48aedb(0xba)])return;const _0x35dc40=_0x50c458['scope']+':'+_0x4b0e35,_0xd30a7d=_0x7c101d['linkedPath']?[_0x7c101d[_0x48aedb(0xc4)]]:[],_0xd9c7ef=_0x5048a9[_0x48aedb(0xcd)](_0x35dc40);if(_0xd9c7ef){_0x7c101d[_0x48aedb(0xbd)]==='cache'&&(_0xd9c7ef[_0x48aedb(0xad)]=_0x1c2833,_0xd9c7ef[_0x48aedb(0xab)]=_0x1c2833,_0xd9c7ef[_0x48aedb(0xc6)]=resolve(_0x1c2833,SKILL_FILE),_0xd9c7ef[_0x48aedb(0xa4)]=_0x5aedce);for(const _0x198a60 of _0xd30a7d){!_0xd9c7ef['linkedPaths'][_0x48aedb(0xa2)](_0x198a60)&&_0xd9c7ef[_0x48aedb(0xca)][_0x48aedb(0x9f)](_0x198a60);}_0xd9c7ef['linkedPaths']['sort']();return;}_0x5048a9['set'](_0x35dc40,{..._0x50c458,'tags':Array[_0x48aedb(0xa5)](_0x50c458[_0x48aedb(0xac)])?_0x50c458['tags']:[],'scope':_0x50c458[_0x48aedb(0xb3)],'source':_0x48aedb(0xc5),'dir':_0x1c2833,'cacheDir':_0x7c101d[_0x48aedb(0xbd)]===_0x48aedb(0xbf)?_0x1c2833:undefined,'skillMdPath':resolve(_0x1c2833,SKILL_FILE),'metadataPath':_0x5aedce,'linkedPaths':_0xd30a7d});}function compareLocalRuntimeSkills(_0xe93de0,_0x2e88a6){const _0x2fe73b=a139_0x2b45,_0x1dccd3={'personal':0x0,'company':0x1,'builtin':0x2};return _0x1dccd3[_0xe93de0[_0x2fe73b(0xb3)]]-_0x1dccd3[_0x2e88a6[_0x2fe73b(0xb3)]]||_0xe93de0['skillCode'][_0x2fe73b(0xae)](_0x2e88a6[_0x2fe73b(0xc9)])||_0xe93de0[_0x2fe73b(0xad)][_0x2fe73b(0xae)](_0x2e88a6['dir']);}
1
+ (function(_0x21c68b,_0x169f6b){const _0x60ead4=a139_0x3e8b,_0x369e44=_0x21c68b();while(!![]){try{const _0x299982=parseInt(_0x60ead4(0xd8))/0x1*(parseInt(_0x60ead4(0xe1))/0x2)+-parseInt(_0x60ead4(0xe6))/0x3*(parseInt(_0x60ead4(0xec))/0x4)+parseInt(_0x60ead4(0xf0))/0x5*(parseInt(_0x60ead4(0xf6))/0x6)+-parseInt(_0x60ead4(0xe5))/0x7*(parseInt(_0x60ead4(0x100))/0x8)+-parseInt(_0x60ead4(0x105))/0x9*(parseInt(_0x60ead4(0xdd))/0xa)+-parseInt(_0x60ead4(0xe9))/0xb+parseInt(_0x60ead4(0xe3))/0xc*(parseInt(_0x60ead4(0xf4))/0xd);if(_0x299982===_0x169f6b)break;else _0x369e44['push'](_0x369e44['shift']());}catch(_0x303402){_0x369e44['push'](_0x369e44['shift']());}}}(a139_0x3202,0x89d3a));import{existsSync,readdirSync}from'node:fs';import{resolve}from'node:path';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{readMetadataIfPresent}from'./metadata.js';function a139_0x3202(){const _0x16d84f=['metadataPath','startsWith','1ianEee','values','name','isDirectory','\x20!=\x20','10nyHAYu','source','link','includes','424094lRHemC','local','324fkIeeO','validation','7kJShaf','72sBEbnM','cacheDir','isArray','12321969gezPOQ','map','appCode','106588nNQoUP','linkedPath','linkedPaths','filter','3732995gfAoaU','scopes','isSymbolicLink','cache','1501942LaBQtp','scope','6wKYeGc','skillCode','set','trim','builtin','has','project','skillMdPath','localeCompare','dir','6765384zDxjNh','sort','code','tags','skillRoots','8173314OmdRxf'];a139_0x3202=function(){return _0x16d84f;};return a139_0x3202();}import{getRuntimeSkillCacheRoot,safePathSegment}from'./paths.js';function a139_0x3e8b(_0x14ad41,_0x3996ca){_0x14ad41=_0x14ad41-0xd7;const _0x32026b=a139_0x3202();let _0x3e8b4b=_0x32026b[_0x14ad41];return _0x3e8b4b;}import{isRuntimeSkillScope,normalizeRuntimeSkillScopes}from'./scopes.js';export function listLocalRuntimeSkills(_0x4b98c1,_0x1468ec,_0x46be2d={}){const _0xe2290c=a139_0x3e8b,_0x86b830=safePathSegment(_0x4b98c1[_0xe2290c(0xeb)],'appCode');if(_0x1468ec[_0xe2290c(0xeb)]!==_0x86b830)throw CliErrors[_0xe2290c(0xe4)]('Runtime\x20Skill\x20install\x20target\x20app\x20mismatch:\x20'+_0x1468ec[_0xe2290c(0xeb)]+_0xe2290c(0xdc)+_0x86b830);const _0x26fe90=normalizeRuntimeSkillScopes(_0x4b98c1['scopes']),_0x21de2f=new Set(_0x26fe90),_0x7cbb39=_0x4b98c1[_0xe2290c(0x102)]?.['trim'](),_0x329a34=new Map(),_0x2085ef=resolve(getRuntimeSkillCacheRoot(_0x4b98c1['env'],_0x4b98c1['accessKey'],_0x46be2d),_0x86b830);for(const _0x2100ad of _0x26fe90){for(const _0x51a2a6 of localSkillEntryDirs(resolve(_0x2085ef,_0x2100ad))){collectLocalRuntimeSkill(_0x329a34,_0x51a2a6,{'appCode':_0x86b830,'scopes':_0x21de2f,'code':_0x7cbb39,'source':_0xe2290c(0xf3)});}}for(const _0x1ab8b2 of _0x1468ec[_0xe2290c(0x104)]){for(const _0x543ec9 of localSkillLinkCandidates(_0x1ab8b2,_0x1468ec,_0x21de2f)){collectLocalRuntimeSkill(_0x329a34,_0x543ec9,{'appCode':_0x86b830,'scopes':_0x21de2f,'code':_0x7cbb39,'source':_0xe2290c(0xdf),'linkedPath':_0x543ec9});}}return Array['from'](_0x329a34[_0xe2290c(0xd9)]())[_0xe2290c(0x101)](compareLocalRuntimeSkills);}function localSkillEntryDirs(_0x46d7a2){const _0x1f623a=a139_0x3e8b;if(!existsSync(_0x46d7a2))return[];return readdirSync(_0x46d7a2,{'withFileTypes':!![]})[_0x1f623a(0xef)](_0x17a9f7=>_0x17a9f7[_0x1f623a(0xdb)]()||_0x17a9f7[_0x1f623a(0xf2)]())[_0x1f623a(0xea)](_0x17e254=>resolve(_0x46d7a2,_0x17e254['name']));}function localSkillLinkCandidates(_0x39107a,_0x438bc9,_0x2dea8c){const _0x567b70=a139_0x3e8b;if(!existsSync(_0x39107a))return[];const _0x440238=_0x438bc9[_0x567b70(0xeb)]+'--';return readdirSync(_0x39107a,{'withFileTypes':!![]})['filter'](_0x2db41d=>_0x2db41d[_0x567b70(0xdb)]()||_0x2db41d[_0x567b70(0xf2)]())[_0x567b70(0xef)](_0x7c18e9=>_0x438bc9[_0x567b70(0xf5)]===_0x567b70(0xfc)||_0x7c18e9[_0x567b70(0xda)][_0x567b70(0xd7)](_0x440238)||_0x2dea8c[_0x567b70(0xfb)](_0x567b70(0xfa)))[_0x567b70(0xea)](_0x7b66de=>resolve(_0x39107a,_0x7b66de[_0x567b70(0xda)]));}function collectLocalRuntimeSkill(_0x178575,_0x546b9e,_0x3a21f1){const _0x782a68=a139_0x3e8b,_0x524b23=resolve(_0x546b9e,METADATA_FILE),_0x3530c3=readMetadataIfPresent(_0x524b23);if(!_0x3530c3)return;if(_0x3530c3[_0x782a68(0xeb)]!==_0x3a21f1[_0x782a68(0xeb)])return;if(!isRuntimeSkillScope(_0x3530c3[_0x782a68(0xf5)])||!_0x3a21f1[_0x782a68(0xf1)][_0x782a68(0xfb)](_0x3530c3['scope']))return;const _0x2e187a=_0x3530c3[_0x782a68(0xf7)]?.[_0x782a68(0xf9)]();if(!_0x2e187a)return;if(_0x3a21f1['code']&&_0x2e187a!==_0x3a21f1['code'])return;const _0x34b700=_0x3530c3[_0x782a68(0xf5)]+':'+_0x2e187a,_0x429d11=_0x3a21f1[_0x782a68(0xed)]?[_0x3a21f1[_0x782a68(0xed)]]:[],_0x4b4339=_0x178575['get'](_0x34b700);if(_0x4b4339){_0x3a21f1['source']===_0x782a68(0xf3)&&(_0x4b4339[_0x782a68(0xff)]=_0x546b9e,_0x4b4339[_0x782a68(0xe7)]=_0x546b9e,_0x4b4339[_0x782a68(0xfd)]=resolve(_0x546b9e,SKILL_FILE),_0x4b4339[_0x782a68(0x106)]=_0x524b23);for(const _0x1204dd of _0x429d11){!_0x4b4339[_0x782a68(0xee)][_0x782a68(0xe0)](_0x1204dd)&&_0x4b4339[_0x782a68(0xee)]['push'](_0x1204dd);}_0x4b4339['linkedPaths'][_0x782a68(0x101)]();return;}_0x178575[_0x782a68(0xf8)](_0x34b700,{..._0x3530c3,'tags':Array[_0x782a68(0xe8)](_0x3530c3[_0x782a68(0x103)])?_0x3530c3['tags']:[],'scope':_0x3530c3['scope'],'source':_0x782a68(0xe2),'dir':_0x546b9e,'cacheDir':_0x3a21f1[_0x782a68(0xde)]===_0x782a68(0xf3)?_0x546b9e:undefined,'skillMdPath':resolve(_0x546b9e,SKILL_FILE),'metadataPath':_0x524b23,'linkedPaths':_0x429d11});}function compareLocalRuntimeSkills(_0x34ae99,_0x5dd316){const _0x27b45d=a139_0x3e8b,_0xf25975={'personal':0x0,'company':0x1,'builtin':0x2};return _0xf25975[_0x34ae99[_0x27b45d(0xf5)]]-_0xf25975[_0x5dd316[_0x27b45d(0xf5)]]||_0x34ae99[_0x27b45d(0xf7)][_0x27b45d(0xfe)](_0x5dd316[_0x27b45d(0xf7)])||_0x34ae99[_0x27b45d(0xff)]['localeCompare'](_0x5dd316[_0x27b45d(0xff)]);}
@@ -1 +1 @@
1
- function a140_0x2514(){const _0x22b4c5=['Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20','9062270SVFvro','bytes','length','replace','set','startsWith','Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20','isBuffer','1096308jOYmSr','5zTwYfH','object','content','2445586ZRrEJK','2659172bgBPRc','size','isSafeInteger','values','isDirectory','string','3740379VAoeRS','isSymbolicLink','796059JJdpKS','from','test','27fmEqHf','has','utf8','path','isArray','includes','add','21fpSgYp','name','Duplicate\x20Skill\x20file\x20path:\x20','Unsafe\x20Skill\x20file\x20path:\x20','validation','Skill\x20file\x20path\x20must\x20be\x20text.','localeCompare','toString','sha256','1280320kIFnYr'];a140_0x2514=function(){return _0x22b4c5;};return a140_0x2514();}(function(_0x3ac3a8,_0x579f61){const _0x10b384=a140_0x3150,_0x2bf44e=_0x3ac3a8();while(!![]){try{const _0x396e5d=-parseInt(_0x10b384(0xe7))/0x1+-parseInt(_0x10b384(0xde))/0x2+-parseInt(_0x10b384(0xe5))/0x3+-parseInt(_0x10b384(0xdf))/0x4*(-parseInt(_0x10b384(0xdb))/0x5)+-parseInt(_0x10b384(0xda))/0x6*(-parseInt(_0x10b384(0xc7))/0x7)+parseInt(_0x10b384(0xd0))/0x8+parseInt(_0x10b384(0xc0))/0x9*(parseInt(_0x10b384(0xd2))/0xa);if(_0x396e5d===_0x579f61)break;else _0x2bf44e['push'](_0x2bf44e['shift']());}catch(_0x317256){_0x2bf44e['push'](_0x2bf44e['shift']());}}}(a140_0x2514,0xc9aa7));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(_0x7c8a60){const _0x22c88b=a140_0x3150;return _0x7c8a60[_0x22c88b(0xd3)]??Buffer['from'](_0x7c8a60[_0x22c88b(0xdd)]??'',_0x22c88b(0xc2));}export function fileText(_0x4dede5){const _0x561721=a140_0x3150;return fileContent(_0x4dede5)[_0x561721(0xce)](_0x561721(0xc2));}export function normalizeLocalFiles(_0x3f79e9){const _0x4a7112=a140_0x3150;if(!Array[_0x4a7112(0xc4)](_0x3f79e9)||_0x3f79e9[_0x4a7112(0xd4)]===0x0)return[];const _0x553930=new Map();for(const _0x11ed92 of _0x3f79e9){if(!_0x11ed92||typeof _0x11ed92!=='object'||typeof _0x11ed92[_0x4a7112(0xc3)]!=='string')throw CliErrors['validation']('Skill\x20file\x20path\x20must\x20be\x20text.');const _0x17947a=normalizeSkillRelativePath(_0x11ed92[_0x4a7112(0xc3)]);if(_0x553930[_0x4a7112(0xc1)](_0x17947a))throw CliErrors['validation'](_0x4a7112(0xc9)+_0x17947a);if(_0x11ed92[_0x4a7112(0xd3)]!==undefined&&!Buffer[_0x4a7112(0xd9)](_0x11ed92[_0x4a7112(0xd3)]))throw CliErrors[_0x4a7112(0xcb)](_0x4a7112(0xd8)+_0x17947a);if(_0x11ed92['bytes']===undefined&&typeof _0x11ed92[_0x4a7112(0xdd)]!=='string')throw CliErrors[_0x4a7112(0xcb)](_0x4a7112(0xd1)+_0x17947a);const _0x46371a=fileContent(_0x11ed92);_0x553930[_0x4a7112(0xd6)](_0x17947a,{'path':_0x17947a,'bytes':_0x46371a});}return Array['from'](_0x553930[_0x4a7112(0xe2)]())['sort'](compareSkillFiles);}export function normalizeManifestFiles(_0x517a7c){const _0x40263c=a140_0x3150;if(!Array[_0x40263c(0xc4)](_0x517a7c)||_0x517a7c['length']===0x0)return[];const _0x5849ee=new Map();for(const _0x1bda02 of _0x517a7c){if(!_0x1bda02||typeof _0x1bda02!==_0x40263c(0xdc)||typeof _0x1bda02['path']!=='string')throw CliErrors[_0x40263c(0xcb)](_0x40263c(0xcc));const _0x35b1ec=normalizeSkillRelativePath(_0x1bda02[_0x40263c(0xc3)]);if(_0x5849ee[_0x40263c(0xc1)](_0x35b1ec))throw CliErrors[_0x40263c(0xcb)]('Duplicate\x20Skill\x20file\x20path:\x20'+_0x35b1ec);if(!isSha256Hex(_0x1bda02['sha256']))throw CliErrors['validation']('Skill\x20file\x20sha256\x20is\x20invalid:\x20'+_0x35b1ec);if(!Number[_0x40263c(0xe1)](_0x1bda02[_0x40263c(0xe0)])||_0x1bda02['size']<0x0)throw CliErrors[_0x40263c(0xcb)]('Skill\x20file\x20size\x20is\x20invalid:\x20'+_0x35b1ec);_0x5849ee[_0x40263c(0xd6)](_0x35b1ec,{'path':_0x35b1ec,'sha256':_0x1bda02[_0x40263c(0xcf)]['toLowerCase'](),'size':_0x1bda02[_0x40263c(0xe0)]});}return Array[_0x40263c(0xbe)](_0x5849ee[_0x40263c(0xe2)]())['sort'](compareSkillFiles);}export function scanSkillDirectory(_0x96c85a,_0x5d9b29={}){const _0x705a63=realpathSync(_0x96c85a),_0x178489=canonicalExcludedFilePaths(_0x5d9b29['excludedFilePaths']),_0x3c77a7=[];function _0x16fe26(_0x3d75cb){const _0x3d6787=a140_0x3150,_0x4c1570=readdirSync(_0x3d75cb,{'withFileTypes':!![]})['sort']((_0x2abbe8,_0x39da63)=>_0x2abbe8[_0x3d6787(0xc8)][_0x3d6787(0xcd)](_0x39da63[_0x3d6787(0xc8)]));for(const _0x352bbc of _0x4c1570){if(_0x352bbc[_0x3d6787(0xe3)]()&&IGNORED_DIR_NAMES[_0x3d6787(0xc1)](_0x352bbc[_0x3d6787(0xc8)]))continue;if(IGNORED_FILE_NAMES[_0x3d6787(0xc1)](_0x352bbc['name']))continue;const _0x8c757=resolve(_0x3d75cb,_0x352bbc[_0x3d6787(0xc8)]);if(isExcludedFilePath(_0x8c757,_0x178489))continue;if(_0x352bbc[_0x3d6787(0xe6)]())throw CliErrors[_0x3d6787(0xcb)]('Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20'+_0x8c757);const _0x3b7715=toPosixPath(relative(_0x705a63,_0x8c757));if(_0x352bbc[_0x3d6787(0xe3)]()){_0x16fe26(_0x8c757);continue;}if(!_0x352bbc['isFile']())continue;validateSkillRelativePath(_0x3b7715);const _0x21884f=readFileSync(_0x8c757);_0x3c77a7['push']({'path':_0x3b7715,'bytes':_0x21884f});}}return _0x16fe26(_0x705a63),normalizeLocalFiles(_0x3c77a7);}function canonicalExcludedFilePaths(_0x526cbc){const _0x2c2f83=a140_0x3150,_0x41b801=new Set();for(const _0x3b2387 of _0x526cbc??[]){const _0x4da409=resolve(_0x3b2387);_0x41b801[_0x2c2f83(0xc6)](_0x4da409);try{_0x41b801[_0x2c2f83(0xc6)](realpathSync(_0x4da409));}catch{}}return _0x41b801;}function a140_0x3150(_0x1d55aa,_0x1e6026){_0x1d55aa=_0x1d55aa-0xbe;const _0x2514aa=a140_0x2514();let _0x315030=_0x2514aa[_0x1d55aa];return _0x315030;}function isExcludedFilePath(_0x4a6753,_0x255ca5){if(_0x255ca5['has'](_0x4a6753))return!![];if(_0x255ca5['size']===0x0)return![];try{return _0x255ca5['has'](realpathSync(_0x4a6753));}catch{return![];}}export function compareSkillFiles(_0x487053,_0x5c3cbc){const _0x176a45=a140_0x3150;if(_0x487053[_0x176a45(0xc3)]===SKILL_FILE)return _0x5c3cbc[_0x176a45(0xc3)]===SKILL_FILE?0x0:-0x1;if(_0x5c3cbc[_0x176a45(0xc3)]===SKILL_FILE)return 0x1;return Buffer['compare'](Buffer['from'](_0x487053['path'],_0x176a45(0xc2)),Buffer['from'](_0x5c3cbc[_0x176a45(0xc3)],_0x176a45(0xc2)));}export function normalizeSkillRelativePath(_0x55372e){const _0x1c826b=toPosixPath(_0x55372e['trim']());return validateSkillRelativePath(_0x1c826b),_0x1c826b;}export function validateSkillRelativePath(_0x44e2d3){const _0xcd4218=a140_0x3150;if(!_0x44e2d3||_0x44e2d3[_0xcd4218(0xd7)]('/')||_0x44e2d3[_0xcd4218(0xc5)]('//'))throw CliErrors[_0xcd4218(0xcb)]('Unsafe\x20Skill\x20file\x20path:\x20'+_0x44e2d3);for(const _0x3cd095 of _0x44e2d3['split']('/')){if(!_0x3cd095||_0x3cd095==='.'||_0x3cd095==='..')throw CliErrors[_0xcd4218(0xcb)](_0xcd4218(0xca)+_0x44e2d3);}}export function toPosixPath(_0x5aa048){const _0x425a85=a140_0x3150;return _0x5aa048[_0x425a85(0xd5)](/\\/g,'/');}export function isSha256Hex(_0x563673){const _0xb14eda=a140_0x3150;return typeof _0x563673===_0xb14eda(0xe4)&&/^[a-fA-F0-9]{64}$/[_0xb14eda(0xbf)](_0x563673);}
1
+ (function(_0x521489,_0x89995e){const _0x36ccef=a140_0x376a,_0x50549f=_0x521489();while(!![]){try{const _0x1ea150=parseInt(_0x36ccef(0xc0))/0x1+-parseInt(_0x36ccef(0xd5))/0x2+parseInt(_0x36ccef(0xea))/0x3*(-parseInt(_0x36ccef(0xd6))/0x4)+-parseInt(_0x36ccef(0xd2))/0x5*(parseInt(_0x36ccef(0xd3))/0x6)+-parseInt(_0x36ccef(0xe0))/0x7*(parseInt(_0x36ccef(0xc9))/0x8)+-parseInt(_0x36ccef(0xd8))/0x9+parseInt(_0x36ccef(0xc1))/0xa;if(_0x1ea150===_0x89995e)break;else _0x50549f['push'](_0x50549f['shift']());}catch(_0x2d25c3){_0x50549f['push'](_0x50549f['shift']());}}}(a140_0x579b,0xc93b1));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';function a140_0x376a(_0x52908a,_0x1c5727){_0x52908a=_0x52908a-0xbd;const _0x579b7e=a140_0x579b();let _0x376a89=_0x579b7e[_0x52908a];return _0x376a89;}export function fileContent(_0x2d3293){const _0x2221f1=a140_0x376a;return _0x2d3293[_0x2221f1(0xe7)]??Buffer[_0x2221f1(0xe1)](_0x2d3293[_0x2221f1(0xbf)]??'','utf8');}export function fileText(_0x1bf141){return fileContent(_0x1bf141)['toString']('utf8');}export function normalizeLocalFiles(_0x8e0807){const _0x223cb1=a140_0x376a;if(!Array[_0x223cb1(0xde)](_0x8e0807)||_0x8e0807[_0x223cb1(0xdd)]===0x0)return[];const _0x163c8d=new Map();for(const _0x298dc9 of _0x8e0807){if(!_0x298dc9||typeof _0x298dc9!==_0x223cb1(0xc2)||typeof _0x298dc9[_0x223cb1(0xeb)]!==_0x223cb1(0xd7))throw CliErrors[_0x223cb1(0xcd)](_0x223cb1(0xe2));const _0x451064=normalizeSkillRelativePath(_0x298dc9[_0x223cb1(0xeb)]);if(_0x163c8d[_0x223cb1(0xdb)](_0x451064))throw CliErrors[_0x223cb1(0xcd)](_0x223cb1(0xc4)+_0x451064);if(_0x298dc9[_0x223cb1(0xe7)]!==undefined&&!Buffer[_0x223cb1(0xd0)](_0x298dc9['bytes']))throw CliErrors[_0x223cb1(0xcd)](_0x223cb1(0xbd)+_0x451064);if(_0x298dc9[_0x223cb1(0xe7)]===undefined&&typeof _0x298dc9['content']!==_0x223cb1(0xd7))throw CliErrors[_0x223cb1(0xcd)]('Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20'+_0x451064);const _0x30a5e=fileContent(_0x298dc9);_0x163c8d[_0x223cb1(0xc7)](_0x451064,{'path':_0x451064,'bytes':_0x30a5e});}return Array[_0x223cb1(0xe1)](_0x163c8d[_0x223cb1(0xe6)]())['sort'](compareSkillFiles);}function a140_0x579b(){const _0xac9a4=['validation','isSafeInteger','size','isBuffer','isFile','2256775mtscWN','12Yggkah','name','591282KghWMa','4UQYbWN','string','8170578icqEMo','isSymbolicLink','Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20','has','replace','length','isArray','push','2195606qkIDVU','from','Skill\x20file\x20path\x20must\x20be\x20text.','Unsafe\x20Skill\x20file\x20path:\x20','utf8','compare','values','bytes','Skill\x20file\x20sha256\x20is\x20invalid:\x20','sha256','126363IcfPvr','path','Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20','test','content','1491820CGlxGB','27353670LTTlnf','object','isDirectory','Duplicate\x20Skill\x20file\x20path:\x20','toLowerCase','split','set','Skill\x20file\x20size\x20is\x20invalid:\x20','32yMfDXE','sort','add','startsWith'];a140_0x579b=function(){return _0xac9a4;};return a140_0x579b();}export function normalizeManifestFiles(_0x14af5c){const _0x45c6b5=a140_0x376a;if(!Array[_0x45c6b5(0xde)](_0x14af5c)||_0x14af5c[_0x45c6b5(0xdd)]===0x0)return[];const _0x9e7947=new Map();for(const _0x31556b of _0x14af5c){if(!_0x31556b||typeof _0x31556b!==_0x45c6b5(0xc2)||typeof _0x31556b[_0x45c6b5(0xeb)]!==_0x45c6b5(0xd7))throw CliErrors[_0x45c6b5(0xcd)](_0x45c6b5(0xe2));const _0x2067a2=normalizeSkillRelativePath(_0x31556b[_0x45c6b5(0xeb)]);if(_0x9e7947[_0x45c6b5(0xdb)](_0x2067a2))throw CliErrors['validation'](_0x45c6b5(0xc4)+_0x2067a2);if(!isSha256Hex(_0x31556b[_0x45c6b5(0xe9)]))throw CliErrors[_0x45c6b5(0xcd)](_0x45c6b5(0xe8)+_0x2067a2);if(!Number[_0x45c6b5(0xce)](_0x31556b[_0x45c6b5(0xcf)])||_0x31556b[_0x45c6b5(0xcf)]<0x0)throw CliErrors['validation'](_0x45c6b5(0xc8)+_0x2067a2);_0x9e7947[_0x45c6b5(0xc7)](_0x2067a2,{'path':_0x2067a2,'sha256':_0x31556b[_0x45c6b5(0xe9)][_0x45c6b5(0xc5)](),'size':_0x31556b[_0x45c6b5(0xcf)]});}return Array[_0x45c6b5(0xe1)](_0x9e7947[_0x45c6b5(0xe6)]())[_0x45c6b5(0xca)](compareSkillFiles);}export function scanSkillDirectory(_0x5c1736,_0x17f24b={}){const _0x407380=realpathSync(_0x5c1736),_0x46f99e=canonicalExcludedFilePaths(_0x17f24b['excludedFilePaths']),_0x56269f=[];function _0x1dd5b5(_0x42dc0d){const _0x3be7ee=a140_0x376a,_0x41ab7f=readdirSync(_0x42dc0d,{'withFileTypes':!![]})[_0x3be7ee(0xca)]((_0x5cd767,_0x237a9e)=>_0x5cd767[_0x3be7ee(0xd4)]['localeCompare'](_0x237a9e[_0x3be7ee(0xd4)]));for(const _0x30f40d of _0x41ab7f){if(_0x30f40d[_0x3be7ee(0xc3)]()&&IGNORED_DIR_NAMES[_0x3be7ee(0xdb)](_0x30f40d['name']))continue;if(IGNORED_FILE_NAMES[_0x3be7ee(0xdb)](_0x30f40d[_0x3be7ee(0xd4)]))continue;const _0x3366c5=resolve(_0x42dc0d,_0x30f40d[_0x3be7ee(0xd4)]);if(isExcludedFilePath(_0x3366c5,_0x46f99e))continue;if(_0x30f40d[_0x3be7ee(0xd9)]())throw CliErrors[_0x3be7ee(0xcd)](_0x3be7ee(0xda)+_0x3366c5);const _0x4e6e2c=toPosixPath(relative(_0x407380,_0x3366c5));if(_0x30f40d[_0x3be7ee(0xc3)]()){_0x1dd5b5(_0x3366c5);continue;}if(!_0x30f40d[_0x3be7ee(0xd1)]())continue;validateSkillRelativePath(_0x4e6e2c);const _0x1cc930=readFileSync(_0x3366c5);_0x56269f[_0x3be7ee(0xdf)]({'path':_0x4e6e2c,'bytes':_0x1cc930});}}return _0x1dd5b5(_0x407380),normalizeLocalFiles(_0x56269f);}function canonicalExcludedFilePaths(_0x396ad8){const _0x1a51b9=a140_0x376a,_0x2c65e8=new Set();for(const _0x431d4e of _0x396ad8??[]){const _0x4836aa=resolve(_0x431d4e);_0x2c65e8[_0x1a51b9(0xcb)](_0x4836aa);try{_0x2c65e8[_0x1a51b9(0xcb)](realpathSync(_0x4836aa));}catch{}}return _0x2c65e8;}function isExcludedFilePath(_0x5ce9a5,_0x95151){const _0x186bdf=a140_0x376a;if(_0x95151[_0x186bdf(0xdb)](_0x5ce9a5))return!![];if(_0x95151['size']===0x0)return![];try{return _0x95151['has'](realpathSync(_0x5ce9a5));}catch{return![];}}export function compareSkillFiles(_0x296494,_0x2dfd04){const _0x3ce51c=a140_0x376a;if(_0x296494[_0x3ce51c(0xeb)]===SKILL_FILE)return _0x2dfd04['path']===SKILL_FILE?0x0:-0x1;if(_0x2dfd04['path']===SKILL_FILE)return 0x1;return Buffer[_0x3ce51c(0xe5)](Buffer[_0x3ce51c(0xe1)](_0x296494['path'],_0x3ce51c(0xe4)),Buffer['from'](_0x2dfd04['path'],_0x3ce51c(0xe4)));}export function normalizeSkillRelativePath(_0x2c99ab){const _0x113e57=toPosixPath(_0x2c99ab['trim']());return validateSkillRelativePath(_0x113e57),_0x113e57;}export function validateSkillRelativePath(_0x4d1dfd){const _0x26cc33=a140_0x376a;if(!_0x4d1dfd||_0x4d1dfd[_0x26cc33(0xcc)]('/')||_0x4d1dfd['includes']('//'))throw CliErrors[_0x26cc33(0xcd)](_0x26cc33(0xe3)+_0x4d1dfd);for(const _0x30dd33 of _0x4d1dfd[_0x26cc33(0xc6)]('/')){if(!_0x30dd33||_0x30dd33==='.'||_0x30dd33==='..')throw CliErrors['validation'](_0x26cc33(0xe3)+_0x4d1dfd);}}export function toPosixPath(_0xee05c){const _0xd32c09=a140_0x376a;return _0xee05c[_0xd32c09(0xdc)](/\\/g,'/');}export function isSha256Hex(_0x28c995){const _0x1687b2=a140_0x376a;return typeof _0x28c995===_0x1687b2(0xd7)&&/^[a-fA-F0-9]{64}$/[_0x1687b2(0xbe)](_0x28c995);}
@@ -1 +1 @@
1
- (function(_0x29c749,_0x450819){const _0x536f79=a141_0x531d,_0x5e83b1=_0x29c749();while(!![]){try{const _0x43f912=parseInt(_0x536f79(0x1bd))/0x1*(-parseInt(_0x536f79(0x1c9))/0x2)+-parseInt(_0x536f79(0x1ba))/0x3+parseInt(_0x536f79(0x1d8))/0x4+parseInt(_0x536f79(0x1de))/0x5+parseInt(_0x536f79(0x1db))/0x6+parseInt(_0x536f79(0x1f3))/0x7+-parseInt(_0x536f79(0x1dd))/0x8;if(_0x43f912===_0x450819)break;else _0x5e83b1['push'](_0x5e83b1['shift']());}catch(_0x109c97){_0x5e83b1['push'](_0x5e83b1['shift']());}}}(a141_0x44b8,0x8b144));import{existsSync,lstatSync,mkdirSync,readFileSync,rmSync}from'node:fs';function a141_0x531d(_0x3be6dc,_0x217015){_0x3be6dc=_0x3be6dc-0x1b7;const _0x44b86a=a141_0x44b8();let _0x531d00=_0x44b86a[_0x3be6dc];return _0x531d00;}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';function a141_0x44b8(){const _0x3286e3=['57743slviwJ','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','status','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','Managed\x20file\x20was\x20removed\x20locally:\x20','2876775WaobDw','flow','paths','159353rnQUoc','description','join','filter','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.','path','displayName','stringify','contents','name','schemaVersion','toString','2VlwojC','utf8','slice','trim','---','skillName','match','contentHash','isFile','force','appCode','version','\x0a---\x0a\x0a','replace','errors','2558440hSypXG','.\x20Changed\x20file:\x20','keys','4042362GTOEEI','hasOwn','1094056SyLXdT','2515585pkTSdI','Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20','test','Runtime\x20Skill\x20package\x20is\x20missing\x20','---\x0a','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','example','scope','accessKey','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','env','entries','length','pulledAt','validation','Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20','delete','map','fileHashes','has','find'];a141_0x44b8=function(){return _0x3286e3;};return a141_0x44b8();}import{extractDownloadedPackage,requirePackageBytes}from'./zip-package.js';export function materializeRuntimeSkill(_0x231997,_0x1fd2af,_0x336ad7){const _0x59f205=a141_0x531d,_0x1fb06f=requireSkillCode(_0x231997),_0x461b83=requirePackageBytes(_0x1fb06f,_0x336ad7['packageBytes']),_0xba0709=extractDownloadedPackage(_0x461b83),_0x2adc13=_0xba0709[_0x59f205(0x1f2)](_0x32dd86=>_0x32dd86[_0x59f205(0x1c2)]===SKILL_FILE);if(!_0x2adc13)throw CliErrors[_0x59f205(0x1ec)](_0x59f205(0x1e1)+SKILL_FILE+':\x20'+_0x1fb06f);const _0x279eca=withMaterializedSkillFrontmatter(_0xba0709,_0x231997,_0x1fb06f),_0x10a254=_0x279eca[_0x59f205(0x1f2)](_0xad63e3=>_0xad63e3[_0x59f205(0x1c2)]===SKILL_FILE),_0x411147=fileText(_0x10a254),_0x579bd8=getRuntimeSkillDir(_0x336ad7[_0x59f205(0x1e8)],_0x336ad7[_0x59f205(0x1e6)],_0x336ad7[_0x59f205(0x1d3)],_0x1fd2af,_0x1fb06f,_0x336ad7[_0x59f205(0x1bc)]),_0x3b36a4=resolve(_0x579bd8,SKILL_FILE),_0xd3b199=resolve(_0x579bd8,METADATA_FILE),_0xa22ae5=contentHash(_0x411147),_0x13e583=readMetadataIfPresent(_0xd3b199)?.[_0x59f205(0x1f0)];ensurePulledFilesCanBeOverwritten(_0x579bd8,_0xd3b199,_0x279eca,_0x336ad7[_0x59f205(0x1d2)]===!![]),mkdirSync(_0x579bd8,{'recursive':!![],'mode':0x1c0});const _0x53483e=existsSync(_0x3b36a4)?readFileSync(_0x3b36a4,_0x59f205(0x1ca)):undefined;return materializeFiles(_0x579bd8,_0x279eca),removeStaleManagedFiles(_0x579bd8,_0x13e583,_0x279eca),writeJsonAtomic(_0xd3b199,buildMetadata(_0x231997,_0x1fd2af,_0x336ad7['appCode'],_0xa22ae5,_0x336ad7[_0x59f205(0x1eb)],_0x279eca,_0x461b83)),{'skill':_0x231997,'scope':_0x1fd2af,'dir':_0x579bd8,'skillMdPath':_0x3b36a4,'metadataPath':_0xd3b199,'contentHash':_0xa22ae5,'changed':_0x53483e!==_0x411147};}export function reuseMaterializedRuntimeSkill(_0x9d7256,_0x2777d9,_0x55f2e5){const _0x351e2f=a141_0x531d,_0x2d8672=_0x9d7256[_0x351e2f(0x1d4)]?.[_0x351e2f(0x1cc)]();if(!_0x2d8672)return undefined;const _0x39586e=requireSkillCode(_0x9d7256),_0x11442c=getRuntimeSkillDir(_0x55f2e5['env'],_0x55f2e5['accessKey'],_0x55f2e5[_0x351e2f(0x1d3)],_0x2777d9,_0x39586e,_0x55f2e5['paths']),_0x4d8726=resolve(_0x11442c,SKILL_FILE),_0x4c79cd=resolve(_0x11442c,METADATA_FILE),_0x4fd165=readMetadataIfPresent(_0x4c79cd);if(!_0x4fd165||_0x4fd165[_0x351e2f(0x1c7)]!==0x2||_0x4fd165[_0x351e2f(0x1d3)]!==_0x55f2e5[_0x351e2f(0x1d3)]||_0x4fd165[_0x351e2f(0x1e5)]!==_0x2777d9||_0x4fd165['skillCode']!==_0x39586e||_0x4fd165[_0x351e2f(0x1d4)]!==_0x2d8672||_0x4fd165['id']!==_0x9d7256['id']||_0x4fd165['skillName']!==_0x9d7256[_0x351e2f(0x1ce)]||_0x4fd165['description']!==_0x9d7256[_0x351e2f(0x1be)]||_0x4fd165[_0x351e2f(0x1e4)]!==_0x9d7256[_0x351e2f(0x1e4)]||_0x4fd165[_0x351e2f(0x1b7)]!==_0x9d7256[_0x351e2f(0x1b7)]||!_0x4fd165[_0x351e2f(0x1d0)]||!_0x4fd165['fileHashes']||!Object[_0x351e2f(0x1dc)](_0x4fd165[_0x351e2f(0x1f0)],SKILL_FILE))return undefined;for(const [_0x5acca6,_0x11b107]of Object[_0x351e2f(0x1e9)](_0x4fd165['fileHashes'])){if(!/^[a-f0-9]{64}$/['test'](_0x11b107))return undefined;const _0x4e1455=resolveManagedFilePath(_0x11442c,_0x5acca6);if(!existsSync(_0x4e1455)||!lstatSync(_0x4e1455)[_0x351e2f(0x1d1)]())return undefined;if(bufferSha256(readFileSync(_0x4e1455))!==_0x11b107)return undefined;}return{'skill':_0x9d7256,'scope':_0x2777d9,'dir':_0x11442c,'skillMdPath':_0x4d8726,'metadataPath':_0x4c79cd,'contentHash':_0x4fd165[_0x351e2f(0x1d0)],'changed':![]};}function withMaterializedSkillFrontmatter(_0x5a66db,_0xd3634e,_0x3ee2b3){const _0x1933b=a141_0x531d,_0x58ea66=skillDisplayName(_0xd3634e,_0x3ee2b3),_0x24ff05=_0xd3634e['description']?.[_0x1933b(0x1cc)]()||_0x58ea66||_0x3ee2b3;return normalizeLocalFiles(_0x5a66db)[_0x1933b(0x1ef)](_0x4f302b=>{const _0x44aa72=_0x1933b,_0x1875a7=fileText(_0x4f302b);if(_0x4f302b[_0x44aa72(0x1c2)]!==SKILL_FILE)return _0x4f302b;if(hasYamlFrontmatter(_0x1875a7))return{'path':_0x4f302b['path'],'content':withSyncedDisplayName(_0x1875a7,_0x58ea66)};return{'path':_0x4f302b[_0x44aa72(0x1c2)],'content':prependSkillFrontmatter(_0x1875a7,{'name':_0x3ee2b3,'displayName':_0x58ea66,'description':_0x24ff05})};});}function hasYamlFrontmatter(_0x56dbba){const _0x5d1ce9=a141_0x531d;return/^\uFEFF?---\s*\r?\n/[_0x5d1ce9(0x1e0)](_0x56dbba);}function prependSkillFrontmatter(_0xddab23,_0x311a16){const _0x3e3a9d=a141_0x531d,_0x5276a4=_0xddab23[_0x3e3a9d(0x1d6)](/^\uFEFF/,'');return[_0x3e3a9d(0x1cd),'name:\x20'+yamlString(_0x311a16[_0x3e3a9d(0x1c6)]),_0x311a16[_0x3e3a9d(0x1c3)]?'displayName:\x20'+yamlString(_0x311a16[_0x3e3a9d(0x1c3)]):undefined,'description:\x20'+yamlString(_0x311a16['description']),_0x3e3a9d(0x1cd),'',_0x5276a4][_0x3e3a9d(0x1c0)](_0x454737=>_0x454737!==undefined)[_0x3e3a9d(0x1bf)]('\x0a');}function yamlString(_0x4bd52f){const _0x4fe505=a141_0x531d;return JSON[_0x4fe505(0x1c4)](_0x4bd52f[_0x4fe505(0x1d6)](/\r/g,'')['trim']());}function skillDisplayName(_0x39c686,_0x34522c){const _0x3172c5=a141_0x531d,_0x2be58d=_0x39c686[_0x3172c5(0x1ce)]?.[_0x3172c5(0x1cc)]();return _0x2be58d||_0x34522c;}function withSyncedDisplayName(_0x557359,_0x1fe1f9){const _0x15442d=a141_0x531d,_0x2e389a=_0x557359[_0x15442d(0x1cf)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x2e389a)return _0x557359;const _0x5763ed=_0x2e389a[0x1]??'',_0xb5cc84=_0x2e389a[0x2]??'',_0x3ec11e=parseDocument(_0xb5cc84);if(_0x3ec11e[_0x15442d(0x1d7)][_0x15442d(0x1ea)]>0x0||!isMap(_0x3ec11e['contents']))return _0x557359;if(_0x1fe1f9)_0x3ec11e['set'](_0x15442d(0x1c3),_0x1fe1f9);else{if(_0x3ec11e[_0x15442d(0x1f1)]('displayName'))_0x3ec11e[_0x15442d(0x1ee)]('displayName');else return _0x557359;}forceBlockCollections(_0x3ec11e[_0x15442d(0x1c5)]);const _0x57c2a3=_0x3ec11e[_0x15442d(0x1c8)]({'lineWidth':0x0})['trimEnd'](),_0x52dde3=_0x557359[_0x15442d(0x1cb)](_0x2e389a[0x0][_0x15442d(0x1ea)])['replace'](/^\r?\n/,'');return _0x5763ed+_0x15442d(0x1e2)+_0x57c2a3+_0x15442d(0x1d5)+_0x52dde3;}function forceBlockCollections(_0x5ba530){if(!isNode(_0x5ba530))return;visit(_0x5ba530,(_0x1dd3e5,_0x567279)=>{const _0x4441d4=a141_0x531d;isCollection(_0x567279)&&(_0x567279[_0x4441d4(0x1bb)]=![]);});}function ensurePulledFilesCanBeOverwritten(_0x156d87,_0x21ca33,_0x6d19d6,_0x274adf){const _0x4fc3d0=a141_0x531d;if(_0x274adf||!existsSync(_0x21ca33))return;const _0x46fbbd=readMetadataIfPresent(_0x21ca33);if(!_0x46fbbd)return;const _0x10b54d=_0x46fbbd[_0x4fc3d0(0x1f0)]&&Object[_0x4fc3d0(0x1da)](_0x46fbbd[_0x4fc3d0(0x1f0)])['length']>0x0?_0x46fbbd[_0x4fc3d0(0x1f0)]:undefined;if(_0x10b54d)for(const [_0x598fc2,_0x504c34]of Object[_0x4fc3d0(0x1e9)](_0x10b54d)){const _0x527fe1=resolveManagedFilePath(_0x156d87,_0x598fc2);if(!existsSync(_0x527fe1))throw CliErrors['validation'](_0x4fc3d0(0x1b8)+_0x156d87,_0x4fc3d0(0x1b9)+_0x598fc2);const _0x1fb9d5=lstatSync(_0x527fe1);if(!_0x1fb9d5['isFile']())throw CliErrors[_0x4fc3d0(0x1ec)](_0x4fc3d0(0x1b8)+_0x156d87,_0x4fc3d0(0x1df)+_0x598fc2);const _0x1f9115=bufferSha256(readFileSync(_0x527fe1));if(_0x1f9115!==_0x504c34)throw CliErrors['validation'](_0x4fc3d0(0x1b8)+_0x156d87+_0x4fc3d0(0x1d9)+_0x598fc2,_0x4fc3d0(0x1e3)+_0x598fc2);}else{const _0x225e4e=resolve(_0x156d87,SKILL_FILE);if(existsSync(_0x225e4e)&&_0x46fbbd['contentHash']){const _0x3f31e0=contentHash(readFileSync(_0x225e4e,_0x4fc3d0(0x1ca)));if(_0x3f31e0!==_0x46fbbd[_0x4fc3d0(0x1d0)])throw CliErrors[_0x4fc3d0(0x1ec)](_0x4fc3d0(0x1e7)+_0x225e4e,_0x4fc3d0(0x1c1));}}for(const _0xe5d2c5 of normalizeLocalFiles(_0x6d19d6)){if(_0x10b54d?.[_0xe5d2c5[_0x4fc3d0(0x1c2)]])continue;if(!_0x10b54d&&_0xe5d2c5['path']===SKILL_FILE)continue;const _0x48c553=resolveManagedFilePath(_0x156d87,_0xe5d2c5[_0x4fc3d0(0x1c2)]);if(!existsSync(_0x48c553))continue;const _0x572c5f=lstatSync(_0x48c553);if(!_0x572c5f[_0x4fc3d0(0x1d1)]())throw CliErrors['validation'](_0x4fc3d0(0x1b8)+_0x156d87,_0x4fc3d0(0x1f4)+_0xe5d2c5['path']);const _0x3124a2=bufferSha256(readFileSync(_0x48c553));if(_0x3124a2!==fileHash(_0xe5d2c5))throw CliErrors['validation'](_0x4fc3d0(0x1b8)+_0x156d87,_0x4fc3d0(0x1ed)+_0xe5d2c5[_0x4fc3d0(0x1c2)]);}}function materializeFiles(_0x33f782,_0x42dad2){const _0x247b1b=a141_0x531d;for(const _0x554809 of normalizeLocalFiles(_0x42dad2)){const _0xe7f4c4=resolveManagedFilePath(_0x33f782,_0x554809[_0x247b1b(0x1c2)]);mkdirSync(dirname(_0xe7f4c4),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0xe7f4c4,fileContent(_0x554809),0x180);}}function removeStaleManagedFiles(_0x1d46a7,_0x380829,_0x794816){const _0x788adc=a141_0x531d;if(!_0x380829)return;const _0xc49eb6=new Set(normalizeLocalFiles(_0x794816)['map'](_0x5f3b71=>_0x5f3b71[_0x788adc(0x1c2)]));for(const _0x4f9505 of Object['keys'](_0x380829)){if(_0xc49eb6[_0x788adc(0x1f1)](_0x4f9505))continue;const _0x575ca8=resolveManagedFilePath(_0x1d46a7,_0x4f9505);existsSync(_0x575ca8)&&lstatSync(_0x575ca8)[_0x788adc(0x1d1)]()&&rmSync(_0x575ca8,{'force':!![]});}}
1
+ (function(_0x23c458,_0x1d0bfa){const _0x17d2c8=a141_0x570a,_0x29c9db=_0x23c458();while(!![]){try{const _0x557b0f=parseInt(_0x17d2c8(0x147))/0x1*(parseInt(_0x17d2c8(0x178))/0x2)+parseInt(_0x17d2c8(0x174))/0x3+parseInt(_0x17d2c8(0x156))/0x4+-parseInt(_0x17d2c8(0x158))/0x5*(parseInt(_0x17d2c8(0x176))/0x6)+-parseInt(_0x17d2c8(0x15e))/0x7*(-parseInt(_0x17d2c8(0x14d))/0x8)+parseInt(_0x17d2c8(0x164))/0x9+-parseInt(_0x17d2c8(0x15b))/0xa;if(_0x557b0f===_0x1d0bfa)break;else _0x29c9db['push'](_0x29c9db['shift']());}catch(_0x4594cf){_0x29c9db['push'](_0x29c9db['shift']());}}}(a141_0x5acd,0x54aac));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';function a141_0x570a(_0x1b8ebe,_0x51ff2a){_0x1b8ebe=_0x1b8ebe-0x141;const _0x5acd9d=a141_0x5acd();let _0x570a65=_0x5acd9d[_0x1b8ebe];return _0x570a65;}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';function a141_0x5acd(){const _0x1817b9=['---\x0a','force','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','has','1WyKaJB','pulledAt','find','contents','set','name:\x20','2640eIKpXi','skillName','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.','match','version','status','map','filter','path','67892uOZBxi','keys','5sKkCHY','isFile','entries','15587630XmEMgl','join','displayName:\x20','12635gWwSdw','validation','packageBytes','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','trim','Managed\x20file\x20was\x20removed\x20locally:\x20','4239396kQqIPs','---','\x0a---\x0a\x0a','test','scope','displayName','length','description','slice','fileHashes','skillCode','Runtime\x20Skill\x20package\x20is\x20missing\x20','Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20','delete','errors','stringify','1894557DCNboh','accessKey','2265204GjyjgV','env','1135814asfepg','toString','contentHash','Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20','appCode','replace','example','paths','description:\x20','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20'];a141_0x5acd=function(){return _0x1817b9;};return a141_0x5acd();}import{getRuntimeSkillDir}from'./paths.js';import{extractDownloadedPackage,requirePackageBytes}from'./zip-package.js';export function materializeRuntimeSkill(_0x2297bf,_0x59df55,_0x3df78e){const _0x3e92fc=a141_0x570a,_0x56c08e=requireSkillCode(_0x2297bf),_0x3d32a6=requirePackageBytes(_0x56c08e,_0x3df78e[_0x3e92fc(0x160)]),_0x39f8bb=extractDownloadedPackage(_0x3d32a6),_0x49fba9=_0x39f8bb['find'](_0x10800c=>_0x10800c[_0x3e92fc(0x155)]===SKILL_FILE);if(!_0x49fba9)throw CliErrors[_0x3e92fc(0x15f)](_0x3e92fc(0x16f)+SKILL_FILE+':\x20'+_0x56c08e);const _0x1700ea=withMaterializedSkillFrontmatter(_0x39f8bb,_0x2297bf,_0x56c08e),_0x404205=_0x1700ea[_0x3e92fc(0x149)](_0x4d47ff=>_0x4d47ff[_0x3e92fc(0x155)]===SKILL_FILE),_0x50199f=fileText(_0x404205),_0x39668b=getRuntimeSkillDir(_0x3df78e[_0x3e92fc(0x177)],_0x3df78e[_0x3e92fc(0x175)],_0x3df78e[_0x3e92fc(0x17c)],_0x59df55,_0x56c08e,_0x3df78e[_0x3e92fc(0x17f)]),_0x1cbab7=resolve(_0x39668b,SKILL_FILE),_0x32404b=resolve(_0x39668b,METADATA_FILE),_0x195d69=contentHash(_0x50199f),_0x5182c2=readMetadataIfPresent(_0x32404b)?.[_0x3e92fc(0x16d)];ensurePulledFilesCanBeOverwritten(_0x39668b,_0x32404b,_0x1700ea,_0x3df78e[_0x3e92fc(0x144)]===!![]),mkdirSync(_0x39668b,{'recursive':!![],'mode':0x1c0});const _0x5588a8=existsSync(_0x1cbab7)?readFileSync(_0x1cbab7,'utf8'):undefined;return materializeFiles(_0x39668b,_0x1700ea),removeStaleManagedFiles(_0x39668b,_0x5182c2,_0x1700ea),writeJsonAtomic(_0x32404b,buildMetadata(_0x2297bf,_0x59df55,_0x3df78e[_0x3e92fc(0x17c)],_0x195d69,_0x3df78e[_0x3e92fc(0x148)],_0x1700ea,_0x3d32a6)),{'skill':_0x2297bf,'scope':_0x59df55,'dir':_0x39668b,'skillMdPath':_0x1cbab7,'metadataPath':_0x32404b,'contentHash':_0x195d69,'changed':_0x5588a8!==_0x50199f};}export function reuseMaterializedRuntimeSkill(_0x56c9fd,_0x30def2,_0x98c87){const _0x86a0cd=a141_0x570a,_0x475a17=_0x56c9fd[_0x86a0cd(0x151)]?.[_0x86a0cd(0x162)]();if(!_0x475a17)return undefined;const _0x532e48=requireSkillCode(_0x56c9fd),_0x513af4=getRuntimeSkillDir(_0x98c87[_0x86a0cd(0x177)],_0x98c87[_0x86a0cd(0x175)],_0x98c87['appCode'],_0x30def2,_0x532e48,_0x98c87[_0x86a0cd(0x17f)]),_0x4bc365=resolve(_0x513af4,SKILL_FILE),_0x318c6f=resolve(_0x513af4,METADATA_FILE),_0x4efabf=readMetadataIfPresent(_0x318c6f);if(!_0x4efabf||_0x4efabf['schemaVersion']!==0x2||_0x4efabf[_0x86a0cd(0x17c)]!==_0x98c87[_0x86a0cd(0x17c)]||_0x4efabf[_0x86a0cd(0x168)]!==_0x30def2||_0x4efabf[_0x86a0cd(0x16e)]!==_0x532e48||_0x4efabf[_0x86a0cd(0x151)]!==_0x475a17||_0x4efabf['id']!==_0x56c9fd['id']||_0x4efabf[_0x86a0cd(0x14e)]!==_0x56c9fd['skillName']||_0x4efabf[_0x86a0cd(0x16b)]!==_0x56c9fd[_0x86a0cd(0x16b)]||_0x4efabf[_0x86a0cd(0x17e)]!==_0x56c9fd[_0x86a0cd(0x17e)]||_0x4efabf[_0x86a0cd(0x152)]!==_0x56c9fd['status']||!_0x4efabf[_0x86a0cd(0x17a)]||!_0x4efabf['fileHashes']||!Object['hasOwn'](_0x4efabf['fileHashes'],SKILL_FILE))return undefined;for(const [_0xf3bb45,_0x5cac72]of Object[_0x86a0cd(0x15a)](_0x4efabf[_0x86a0cd(0x16d)])){if(!/^[a-f0-9]{64}$/[_0x86a0cd(0x167)](_0x5cac72))return undefined;const _0x926ac9=resolveManagedFilePath(_0x513af4,_0xf3bb45);if(!existsSync(_0x926ac9)||!lstatSync(_0x926ac9)[_0x86a0cd(0x159)]())return undefined;if(bufferSha256(readFileSync(_0x926ac9))!==_0x5cac72)return undefined;}return{'skill':_0x56c9fd,'scope':_0x30def2,'dir':_0x513af4,'skillMdPath':_0x4bc365,'metadataPath':_0x318c6f,'contentHash':_0x4efabf['contentHash'],'changed':![]};}function withMaterializedSkillFrontmatter(_0xc563a5,_0x17f7e0,_0x58caba){const _0x598a9e=skillDisplayName(_0x17f7e0,_0x58caba),_0xa3f7b2=_0x17f7e0['description']?.['trim']()||_0x598a9e||_0x58caba;return normalizeLocalFiles(_0xc563a5)['map'](_0x99003a=>{const _0x915570=a141_0x570a,_0x251099=fileText(_0x99003a);if(_0x99003a['path']!==SKILL_FILE)return _0x99003a;if(hasYamlFrontmatter(_0x251099))return{'path':_0x99003a[_0x915570(0x155)],'content':withSyncedDisplayName(_0x251099,_0x598a9e)};return{'path':_0x99003a[_0x915570(0x155)],'content':prependSkillFrontmatter(_0x251099,{'name':_0x58caba,'displayName':_0x598a9e,'description':_0xa3f7b2})};});}function hasYamlFrontmatter(_0x1056a3){const _0xdc4b02=a141_0x570a;return/^\uFEFF?---\s*\r?\n/[_0xdc4b02(0x167)](_0x1056a3);}function prependSkillFrontmatter(_0x24fe96,_0x203d66){const _0x30f481=a141_0x570a,_0x1555f9=_0x24fe96['replace'](/^\uFEFF/,'');return[_0x30f481(0x165),_0x30f481(0x14c)+yamlString(_0x203d66['name']),_0x203d66[_0x30f481(0x169)]?_0x30f481(0x15d)+yamlString(_0x203d66['displayName']):undefined,_0x30f481(0x141)+yamlString(_0x203d66['description']),'---','',_0x1555f9][_0x30f481(0x154)](_0x4929a2=>_0x4929a2!==undefined)[_0x30f481(0x15c)]('\x0a');}function yamlString(_0xc7b080){const _0x140b2e=a141_0x570a;return JSON[_0x140b2e(0x173)](_0xc7b080['replace'](/\r/g,'')[_0x140b2e(0x162)]());}function skillDisplayName(_0x9d8fdb,_0x22e8a2){const _0x4fd79e=a141_0x570a,_0x57b039=_0x9d8fdb[_0x4fd79e(0x14e)]?.[_0x4fd79e(0x162)]();return _0x57b039||_0x22e8a2;}function withSyncedDisplayName(_0x1b4e25,_0xd664be){const _0x3d08a6=a141_0x570a,_0x2c9707=_0x1b4e25[_0x3d08a6(0x150)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x2c9707)return _0x1b4e25;const _0x2d772f=_0x2c9707[0x1]??'',_0x47784e=_0x2c9707[0x2]??'',_0x4d67b2=parseDocument(_0x47784e);if(_0x4d67b2[_0x3d08a6(0x172)]['length']>0x0||!isMap(_0x4d67b2[_0x3d08a6(0x14a)]))return _0x1b4e25;if(_0xd664be)_0x4d67b2[_0x3d08a6(0x14b)](_0x3d08a6(0x169),_0xd664be);else{if(_0x4d67b2[_0x3d08a6(0x146)](_0x3d08a6(0x169)))_0x4d67b2[_0x3d08a6(0x171)](_0x3d08a6(0x169));else return _0x1b4e25;}forceBlockCollections(_0x4d67b2['contents']);const _0x15e322=_0x4d67b2[_0x3d08a6(0x179)]({'lineWidth':0x0})['trimEnd'](),_0xfc0a30=_0x1b4e25[_0x3d08a6(0x16c)](_0x2c9707[0x0][_0x3d08a6(0x16a)])[_0x3d08a6(0x17d)](/^\r?\n/,'');return _0x2d772f+_0x3d08a6(0x143)+_0x15e322+_0x3d08a6(0x166)+_0xfc0a30;}function forceBlockCollections(_0x1483b5){if(!isNode(_0x1483b5))return;visit(_0x1483b5,(_0x4ae37c,_0x26e9ba)=>{isCollection(_0x26e9ba)&&(_0x26e9ba['flow']=![]);});}function ensurePulledFilesCanBeOverwritten(_0x28e211,_0x39e99f,_0x2bc6c3,_0x2deb60){const _0x21bcbf=a141_0x570a;if(_0x2deb60||!existsSync(_0x39e99f))return;const _0x80a5ae=readMetadataIfPresent(_0x39e99f);if(!_0x80a5ae)return;const _0x460baa=_0x80a5ae[_0x21bcbf(0x16d)]&&Object[_0x21bcbf(0x157)](_0x80a5ae[_0x21bcbf(0x16d)])['length']>0x0?_0x80a5ae['fileHashes']:undefined;if(_0x460baa)for(const [_0x5023fa,_0x392403]of Object[_0x21bcbf(0x15a)](_0x460baa)){const _0x3eb133=resolveManagedFilePath(_0x28e211,_0x5023fa);if(!existsSync(_0x3eb133))throw CliErrors[_0x21bcbf(0x15f)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x28e211,_0x21bcbf(0x163)+_0x5023fa);const _0x39f0d8=lstatSync(_0x3eb133);if(!_0x39f0d8[_0x21bcbf(0x159)]())throw CliErrors[_0x21bcbf(0x15f)](_0x21bcbf(0x161)+_0x28e211,_0x21bcbf(0x17b)+_0x5023fa);const _0x45366e=bufferSha256(readFileSync(_0x3eb133));if(_0x45366e!==_0x392403)throw CliErrors['validation']('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x28e211+'.\x20Changed\x20file:\x20'+_0x5023fa,'Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20'+_0x5023fa);}else{const _0x404bf0=resolve(_0x28e211,SKILL_FILE);if(existsSync(_0x404bf0)&&_0x80a5ae[_0x21bcbf(0x17a)]){const _0x49287b=contentHash(readFileSync(_0x404bf0,'utf8'));if(_0x49287b!==_0x80a5ae[_0x21bcbf(0x17a)])throw CliErrors['validation'](_0x21bcbf(0x145)+_0x404bf0,_0x21bcbf(0x14f));}}for(const _0x129dd9 of normalizeLocalFiles(_0x2bc6c3)){if(_0x460baa?.[_0x129dd9[_0x21bcbf(0x155)]])continue;if(!_0x460baa&&_0x129dd9[_0x21bcbf(0x155)]===SKILL_FILE)continue;const _0x1fcd90=resolveManagedFilePath(_0x28e211,_0x129dd9[_0x21bcbf(0x155)]);if(!existsSync(_0x1fcd90))continue;const _0x2c8fb9=lstatSync(_0x1fcd90);if(!_0x2c8fb9[_0x21bcbf(0x159)]())throw CliErrors[_0x21bcbf(0x15f)](_0x21bcbf(0x161)+_0x28e211,_0x21bcbf(0x142)+_0x129dd9[_0x21bcbf(0x155)]);const _0x193355=bufferSha256(readFileSync(_0x1fcd90));if(_0x193355!==fileHash(_0x129dd9))throw CliErrors[_0x21bcbf(0x15f)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x28e211,_0x21bcbf(0x170)+_0x129dd9['path']);}}function materializeFiles(_0x96d980,_0x15e6f1){const _0x2f0aec=a141_0x570a;for(const _0x5007c8 of normalizeLocalFiles(_0x15e6f1)){const _0x3bf03a=resolveManagedFilePath(_0x96d980,_0x5007c8[_0x2f0aec(0x155)]);mkdirSync(dirname(_0x3bf03a),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x3bf03a,fileContent(_0x5007c8),0x180);}}function removeStaleManagedFiles(_0x3924cc,_0x670ea6,_0x174bdf){const _0x58f372=a141_0x570a;if(!_0x670ea6)return;const _0x59b9d7=new Set(normalizeLocalFiles(_0x174bdf)[_0x58f372(0x153)](_0xf61e1b=>_0xf61e1b['path']));for(const _0x283cf1 of Object[_0x58f372(0x157)](_0x670ea6)){if(_0x59b9d7[_0x58f372(0x146)](_0x283cf1))continue;const _0xe2ed49=resolveManagedFilePath(_0x3924cc,_0x283cf1);existsSync(_0xe2ed49)&&lstatSync(_0xe2ed49)[_0x58f372(0x159)]()&&rmSync(_0xe2ed49,{'force':!![]});}}
@@ -1 +1 @@
1
- (function(_0x277666,_0x188314){const _0x293ec1=a142_0x2eca,_0x535736=_0x277666();while(!![]){try{const _0x3409da=-parseInt(_0x293ec1(0x111))/0x1+parseInt(_0x293ec1(0x102))/0x2+parseInt(_0x293ec1(0x11a))/0x3+parseInt(_0x293ec1(0x104))/0x4+parseInt(_0x293ec1(0x11e))/0x5+-parseInt(_0x293ec1(0x10e))/0x6*(-parseInt(_0x293ec1(0xfa))/0x7)+-parseInt(_0x293ec1(0x113))/0x8*(parseInt(_0x293ec1(0x100))/0x9);if(_0x3409da===_0x188314)break;else _0x535736['push'](_0x535736['shift']());}catch(_0x264216){_0x535736['push'](_0x535736['shift']());}}}(a142_0x10f3,0x31f12));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_0x2eca(_0x1bbd38,_0x5aa013){_0x1bbd38=_0x1bbd38-0xfa;const _0x10f303=a142_0x10f3();let _0x2eca0e=_0x10f303[_0x1bbd38];return _0x2eca0e;}import{buildSkillPackage,localFilesToManifestFiles}from'./zip-package.js';export function buildMetadata(_0x154d2e,_0x671b3b,_0x5546f6,_0xb0c21,_0x534259,_0x2097c2,_0x559434){const _0x2ae40c=a142_0x2eca,_0x465ac3=_0x2097c2?normalizeLocalFiles(_0x2097c2):[],_0x235643=!_0x559434&&_0x465ac3[_0x2ae40c(0x10f)]>0x0?buildSkillPackage(_0x465ac3):undefined,_0x21427d=_0x559434?bufferSha256(_0x559434):_0x235643?.[_0x2ae40c(0x10d)][_0x2ae40c(0x110)],_0xd3a225=_0x559434?.['length']??_0x235643?.[_0x2ae40c(0x10d)][_0x2ae40c(0xfe)],_0x37ac00=_0x465ac3[_0x2ae40c(0x10f)]>0x0?Object[_0x2ae40c(0x11c)](_0x465ac3[_0x2ae40c(0xff)](_0x34e97d=>[_0x34e97d['path'],fileHash(_0x34e97d)])):undefined;return{'schemaVersion':_0x465ac3[_0x2ae40c(0x10f)]>0x0?0x2:0x1,'id':_0x154d2e['id'],'appCode':_0x5546f6,'skillCode':requireSkillCode(_0x154d2e),'skillName':_0x154d2e[_0x2ae40c(0x101)],'description':_0x154d2e[_0x2ae40c(0x10b)],'example':_0x154d2e['example'],'scope':_0x671b3b,'readonly':_0x671b3b!=='personal'||_0x154d2e[_0x2ae40c(0x112)]===!![],'tenantCode':_0x154d2e['tenantCode'],'userId':_0x154d2e[_0x2ae40c(0x114)],'version':_0x154d2e[_0x2ae40c(0x11d)],'status':_0x154d2e[_0x2ae40c(0x118)],'tags':Array[_0x2ae40c(0x115)](_0x154d2e['tags'])?_0x154d2e[_0x2ae40c(0x109)]:[],'hasUpstreamUpdate':_0x154d2e[_0x2ae40c(0xfd)],'forkedFromSkillId':_0x154d2e[_0x2ae40c(0x106)],'forkedFromVersion':_0x154d2e[_0x2ae40c(0x10a)],'sourceSessionId':_0x154d2e[_0x2ae40c(0x119)],'contentHash':_0xb0c21,'fileHashes':_0x37ac00,'treeHash':_0x465ac3[_0x2ae40c(0x10f)]>0x0?fileTreeHash(localFilesToManifestFiles(_0x465ac3)):undefined,'ossPath':remoteManifestOssPath(_0x154d2e[_0x2ae40c(0x116)]),'zipSha256':_0x21427d,'zipSize':_0xd3a225,'files':_0x465ac3['length']>0x0?_0x465ac3[_0x2ae40c(0xff)](_0xe709d8=>({'path':_0xe709d8[_0x2ae40c(0xfb)],'hash':fileHash(_0xe709d8),'size':fileContent(_0xe709d8)[_0x2ae40c(0x10f)]})):undefined,'pulledAt':_0x534259??new Date()[_0x2ae40c(0x11b)]()};}export function requireSkillCode(_0x426006){const _0x2690bc=a142_0x2eca,_0x19db64=_0x426006['skillCode']?.[_0x2690bc(0x10c)]();if(!_0x19db64)throw CliErrors[_0x2690bc(0x103)]('Runtime\x20Skill\x20is\x20missing\x20skillCode.');return _0x19db64;}export function readMetadataIfPresent(_0x1898f1){const _0x3f0b8e=a142_0x2eca;if(!existsSync(_0x1898f1))return undefined;try{const _0x1e829f=JSON[_0x3f0b8e(0x105)](readFileSync(_0x1898f1,_0x3f0b8e(0x108)));return _0x1e829f;}catch{throw CliErrors['validation']('Invalid\x20'+METADATA_FILE+':\x20'+_0x1898f1);}}function a142_0x10f3(){const _0x70b98=['803313nIXYLJ','toISOString','fromEntries','version','20095fjrSSV','5747wRKmTI','path','object','hasUpstreamUpdate','zipSize','map','27yDxSeq','skillName','299386PgLHTy','validation','1505324QOeuqP','parse','forkedFromSkillId','ossPath','utf8','tags','forkedFromVersion','description','trim','manifest','1314pmdQkG','length','zipSha256','282362GXGOkr','readonly','1308504whNnmp','userId','isArray','files','string','status','sourceSessionId'];a142_0x10f3=function(){return _0x70b98;};return a142_0x10f3();}function remoteManifestOssPath(_0x379b98){const _0x1164b1=a142_0x2eca;if(!_0x379b98||typeof _0x379b98!==_0x1164b1(0xfc)||Array[_0x1164b1(0x115)](_0x379b98))return undefined;const _0x3320d5=_0x379b98[_0x1164b1(0x107)];return typeof _0x3320d5===_0x1164b1(0x117)&&_0x3320d5[_0x1164b1(0x10c)]()?_0x3320d5[_0x1164b1(0x10c)]():undefined;}
1
+ (function(_0x3dd455,_0x12180d){const _0x3807b3=a142_0x2015,_0x160060=_0x3dd455();while(!![]){try{const _0x12044f=parseInt(_0x3807b3(0xfd))/0x1+parseInt(_0x3807b3(0xd8))/0x2*(parseInt(_0x3807b3(0xf2))/0x3)+-parseInt(_0x3807b3(0xe7))/0x4*(-parseInt(_0x3807b3(0xea))/0x5)+parseInt(_0x3807b3(0xf5))/0x6*(parseInt(_0x3807b3(0xff))/0x7)+-parseInt(_0x3807b3(0xd7))/0x8*(-parseInt(_0x3807b3(0xf4))/0x9)+-parseInt(_0x3807b3(0xeb))/0xa+parseInt(_0x3807b3(0xe1))/0xb*(-parseInt(_0x3807b3(0xe5))/0xc);if(_0x12044f===_0x12180d)break;else _0x160060['push'](_0x160060['shift']());}catch(_0x3d94ff){_0x160060['push'](_0x160060['shift']());}}}(a142_0x2df4,0x8061f));import{existsSync,readFileSync}from'node:fs';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';import{fileContent,normalizeLocalFiles}from'./local-files.js';import{buildSkillPackage,localFilesToManifestFiles}from'./zip-package.js';function a142_0x2df4(){const _0x1d07ec=['zipSize','24921RWWaEs','toISOString','21834HgRxhq','892716LSDapq','object','isArray','status','Invalid\x20','personal','ossPath','string','761728qyzIww','userId','14KBzwZZ','validation','hasUpstreamUpdate','2192QMbyGc','174SGjekZ','parse','fromEntries','files','Runtime\x20Skill\x20is\x20missing\x20skillCode.','forkedFromSkillId','version','readonly','tenantCode','242pJYfeN','manifest','forkedFromVersion','skillName','970404ROFMKs','path','1406924kkbJPo','length','utf8','10yeHeev','8452660iWhqVc','sourceSessionId','trim','skillCode','map','tags'];a142_0x2df4=function(){return _0x1d07ec;};return a142_0x2df4();}function a142_0x2015(_0x26cb7d,_0x3358b4){_0x26cb7d=_0x26cb7d-0xd7;const _0x2df460=a142_0x2df4();let _0x2015ee=_0x2df460[_0x26cb7d];return _0x2015ee;}export function buildMetadata(_0x3126e8,_0x35785e,_0x305604,_0x1ef716,_0x2a4d5a,_0x19891e,_0x24526a){const _0x3d6e6d=a142_0x2015,_0x535cf0=_0x19891e?normalizeLocalFiles(_0x19891e):[],_0xece199=!_0x24526a&&_0x535cf0['length']>0x0?buildSkillPackage(_0x535cf0):undefined,_0x595d68=_0x24526a?bufferSha256(_0x24526a):_0xece199?.[_0x3d6e6d(0xe2)]['zipSha256'],_0x48a435=_0x24526a?.[_0x3d6e6d(0xe8)]??_0xece199?.[_0x3d6e6d(0xe2)][_0x3d6e6d(0xf1)],_0x8d76d7=_0x535cf0[_0x3d6e6d(0xe8)]>0x0?Object[_0x3d6e6d(0xda)](_0x535cf0[_0x3d6e6d(0xef)](_0x4d1f6e=>[_0x4d1f6e['path'],fileHash(_0x4d1f6e)])):undefined;return{'schemaVersion':_0x535cf0[_0x3d6e6d(0xe8)]>0x0?0x2:0x1,'id':_0x3126e8['id'],'appCode':_0x305604,'skillCode':requireSkillCode(_0x3126e8),'skillName':_0x3126e8[_0x3d6e6d(0xe4)],'description':_0x3126e8['description'],'example':_0x3126e8['example'],'scope':_0x35785e,'readonly':_0x35785e!==_0x3d6e6d(0xfa)||_0x3126e8[_0x3d6e6d(0xdf)]===!![],'tenantCode':_0x3126e8[_0x3d6e6d(0xe0)],'userId':_0x3126e8[_0x3d6e6d(0xfe)],'version':_0x3126e8[_0x3d6e6d(0xde)],'status':_0x3126e8[_0x3d6e6d(0xf8)],'tags':Array[_0x3d6e6d(0xf7)](_0x3126e8[_0x3d6e6d(0xf0)])?_0x3126e8[_0x3d6e6d(0xf0)]:[],'hasUpstreamUpdate':_0x3126e8[_0x3d6e6d(0x101)],'forkedFromSkillId':_0x3126e8[_0x3d6e6d(0xdd)],'forkedFromVersion':_0x3126e8[_0x3d6e6d(0xe3)],'sourceSessionId':_0x3126e8[_0x3d6e6d(0xec)],'contentHash':_0x1ef716,'fileHashes':_0x8d76d7,'treeHash':_0x535cf0['length']>0x0?fileTreeHash(localFilesToManifestFiles(_0x535cf0)):undefined,'ossPath':remoteManifestOssPath(_0x3126e8[_0x3d6e6d(0xdb)]),'zipSha256':_0x595d68,'zipSize':_0x48a435,'files':_0x535cf0[_0x3d6e6d(0xe8)]>0x0?_0x535cf0['map'](_0x5e3b9b=>({'path':_0x5e3b9b[_0x3d6e6d(0xe6)],'hash':fileHash(_0x5e3b9b),'size':fileContent(_0x5e3b9b)[_0x3d6e6d(0xe8)]})):undefined,'pulledAt':_0x2a4d5a??new Date()[_0x3d6e6d(0xf3)]()};}export function requireSkillCode(_0x44ecc3){const _0x35219f=a142_0x2015,_0x841293=_0x44ecc3[_0x35219f(0xee)]?.[_0x35219f(0xed)]();if(!_0x841293)throw CliErrors[_0x35219f(0x100)](_0x35219f(0xdc));return _0x841293;}export function readMetadataIfPresent(_0x487b70){const _0x3390e6=a142_0x2015;if(!existsSync(_0x487b70))return undefined;try{const _0x41a13c=JSON[_0x3390e6(0xd9)](readFileSync(_0x487b70,_0x3390e6(0xe9)));return _0x41a13c;}catch{throw CliErrors[_0x3390e6(0x100)](_0x3390e6(0xf9)+METADATA_FILE+':\x20'+_0x487b70);}}function remoteManifestOssPath(_0x3ad300){const _0x1d96d8=a142_0x2015;if(!_0x3ad300||typeof _0x3ad300!==_0x1d96d8(0xf6)||Array[_0x1d96d8(0xf7)](_0x3ad300))return undefined;const _0x339856=_0x3ad300[_0x1d96d8(0xfb)];return typeof _0x339856===_0x1d96d8(0xfc)&&_0x339856[_0x1d96d8(0xed)]()?_0x339856[_0x1d96d8(0xed)]():undefined;}
@@ -1 +1 @@
1
- const a143_0xfbacd7=a143_0x31b9;(function(_0xc703ef,_0xca9d27){const _0x2b2741=a143_0x31b9,_0x1d176e=_0xc703ef();while(!![]){try{const _0x19d5ab=parseInt(_0x2b2741(0x16c))/0x1*(parseInt(_0x2b2741(0x164))/0x2)+-parseInt(_0x2b2741(0x15a))/0x3+-parseInt(_0x2b2741(0x167))/0x4+parseInt(_0x2b2741(0x16f))/0x5*(-parseInt(_0x2b2741(0x16e))/0x6)+parseInt(_0x2b2741(0x163))/0x7+-parseInt(_0x2b2741(0x165))/0x8+parseInt(_0x2b2741(0x15e))/0x9*(parseInt(_0x2b2741(0x159))/0xa);if(_0x19d5ab===_0xca9d27)break;else _0x1d176e['push'](_0x1d176e['shift']());}catch(_0x15fd13){_0x1d176e['push'](_0x1d176e['shift']());}}}(a143_0x460e,0x749d9));import{existsSync}from'node:fs';import{homedir}from'node:os';import{resolve}from'node:path';import{fingerprintAccessKey}from'../../commands/app/cache.js';import{PRODUCT_CONFIG,productEnv}from'../../constant/product.js';import{CliErrors}from'../../errors.js';export function resolveSkillSyncPaths(_0x192d14={}){const _0x473b8b=a143_0x31b9,_0xb88e37=_0x192d14['homeDir']??homedir(),_0x37b808=resolve(_0xb88e37,PRODUCT_CONFIG[_0x473b8b(0x155)],_0x473b8b(0x168)),_0x57a378=trimmedEnv('SKILL_ROOT'),_0x1e548a=trimmedEnv('CLAUDE_SKILL_ROOT'),_0x59ee29=resolve(_0xb88e37,_0x473b8b(0x16d)),_0x51e0e5=_0x192d14[_0x473b8b(0x162)]??(existsSync(_0x59ee29)?resolve(_0x59ee29,_0x473b8b(0x170)):undefined);return{'homeDir':_0xb88e37,'cacheRoot':_0x37b808,'managedRoot':resolve(_0xb88e37,PRODUCT_CONFIG['homeDirName']),'agentsSkillsDir':_0x192d14[_0x473b8b(0x15d)]??_0x57a378??resolve(_0xb88e37,_0x473b8b(0x158),'skills'),'claudeSkillsDir':_0x192d14[_0x473b8b(0x16b)]??_0x1e548a??resolve(_0xb88e37,_0x473b8b(0x156),_0x473b8b(0x170)),'workbuddySkillsDir':_0x51e0e5};}export function runtimeAgentSkillRoots(_0xa6fd34){const _0x4c97fc=a143_0x31b9;return[_0xa6fd34['agentsSkillsDir'],_0xa6fd34[_0x4c97fc(0x16b)],_0xa6fd34[_0x4c97fc(0x162)]][_0x4c97fc(0x15f)](_0x3adb1c=>Boolean(_0x3adb1c));}export function getRuntimeSkillCacheRoot(_0x523dff,_0x3da433,_0x1c5dea={}){const _0x431d80=a143_0x31b9,_0x19033b=resolveSkillSyncPaths(_0x1c5dea);return resolve(_0x19033b[_0x431d80(0x160)],_0x523dff,fingerprintAccessKey(_0x3da433),'skills');}function a143_0x31b9(_0x4029df,_0x113aec){_0x4029df=_0x4029df-0x155;const _0x460e17=a143_0x460e();let _0x31b979=_0x460e17[_0x4029df];return _0x31b979;}export function getRuntimeSkillDir(_0x3a3f63,_0x424ea7,_0x525778,_0x216b8e,_0x436f04,_0x187c43={}){const _0x1b1c08=a143_0x31b9;return resolve(getRuntimeSkillCacheRoot(_0x3a3f63,_0x424ea7,_0x187c43),safePathSegment(_0x525778,_0x1b1c08(0x169)),_0x216b8e,safePathSegment(_0x436f04,_0x1b1c08(0x166)));}export function safePathSegment(_0x189d5b,_0x465a3c=a143_0xfbacd7(0x15b)){const _0x2194c0=a143_0xfbacd7;if(!_0x189d5b||_0x189d5b[_0x2194c0(0x15c)]('/')||_0x189d5b[_0x2194c0(0x15c)]('\x5c')||_0x189d5b[_0x2194c0(0x15c)]('..'))throw CliErrors['validation'](_0x2194c0(0x161)+_0x465a3c+_0x2194c0(0x157)+_0x189d5b);return _0x189d5b;}function a143_0x460e(){const _0x15a9b8=['30042TWhKDz','filter','cacheRoot','Unsafe\x20','workbuddySkillsDir','193914qLooCR','87378eaqfVH','3812088clBwZx','skillCode','2553328JiKUSG','cache','appCode','trim','claudeSkillsDir','11iPttvv','.workbuddy','156tsZXUW','32465eJkPkj','skills','homeDirName','.claude','\x20for\x20local\x20path:\x20','.agents','6410aoSadn','2659863FZNZhH','path\x20segment','includes','agentsSkillsDir'];a143_0x460e=function(){return _0x15a9b8;};return a143_0x460e();}function trimmedEnv(_0xdd2f35){const _0x3504a4=a143_0xfbacd7,_0x9e5ac8=productEnv(_0xdd2f35)?.[_0x3504a4(0x16a)]();return _0x9e5ac8?_0x9e5ac8:undefined;}
1
+ const a143_0x19c077=a143_0x415d;(function(_0x478c1f,_0x194241){const _0x28d27a=a143_0x415d,_0x4c332c=_0x478c1f();while(!![]){try{const _0x347446=-parseInt(_0x28d27a(0xb7))/0x1*(parseInt(_0x28d27a(0xb6))/0x2)+parseInt(_0x28d27a(0xc8))/0x3+parseInt(_0x28d27a(0xc1))/0x4*(parseInt(_0x28d27a(0xc2))/0x5)+parseInt(_0x28d27a(0xc7))/0x6*(parseInt(_0x28d27a(0xc0))/0x7)+-parseInt(_0x28d27a(0xce))/0x8*(parseInt(_0x28d27a(0xbb))/0x9)+parseInt(_0x28d27a(0xbc))/0xa*(-parseInt(_0x28d27a(0xba))/0xb)+parseInt(_0x28d27a(0xbe))/0xc;if(_0x347446===_0x194241)break;else _0x4c332c['push'](_0x4c332c['shift']());}catch(_0x56f40b){_0x4c332c['push'](_0x4c332c['shift']());}}}(a143_0x4620,0xec327));import{existsSync}from'node:fs';import{homedir}from'node:os';function a143_0x4620(){const _0xf7e9b3=['633248nWUjwf','9DVqcsi','110aSEBbh','\x20for\x20local\x20path:\x20','13441668SvdvKm','includes','3395iZMXMg','4941988vXcyKG','5rFogii','agentsSkillsDir','homeDir','skillCode','appCode','14562VyGugK','2075988DrFmka','cache','trim','Unsafe\x20','skills','claudeSkillsDir','12523208TVLUsI','homeDirName','.workbuddy','workbuddySkillsDir','path\x20segment','423446mmADfm','5sYFpBK','.claude','CLAUDE_SKILL_ROOT'];a143_0x4620=function(){return _0xf7e9b3;};return a143_0x4620();}import{resolve}from'node:path';import{fingerprintAccessKey}from'../../commands/app/cache.js';function a143_0x415d(_0x4db206,_0x3da071){_0x4db206=_0x4db206-0xb3;const _0x4620c2=a143_0x4620();let _0x415d90=_0x4620c2[_0x4db206];return _0x415d90;}import{PRODUCT_CONFIG,productEnv}from'../../constant/product.js';import{CliErrors}from'../../errors.js';export function resolveSkillSyncPaths(_0x1b24db={}){const _0x459e6d=a143_0x415d,_0x469fbb=_0x1b24db[_0x459e6d(0xc4)]??homedir(),_0x52e027=resolve(_0x469fbb,PRODUCT_CONFIG['homeDirName'],_0x459e6d(0xc9)),_0x170ccd=trimmedEnv('SKILL_ROOT'),_0x23855d=trimmedEnv(_0x459e6d(0xb9)),_0x2d1ac8=resolve(_0x469fbb,_0x459e6d(0xb3)),_0x1a5a23=_0x1b24db[_0x459e6d(0xb4)]??(existsSync(_0x2d1ac8)?resolve(_0x2d1ac8,_0x459e6d(0xcc)):undefined);return{'homeDir':_0x469fbb,'cacheRoot':_0x52e027,'managedRoot':resolve(_0x469fbb,PRODUCT_CONFIG[_0x459e6d(0xcf)]),'agentsSkillsDir':_0x1b24db['agentsSkillsDir']??_0x170ccd??resolve(_0x469fbb,'.agents',_0x459e6d(0xcc)),'claudeSkillsDir':_0x1b24db[_0x459e6d(0xcd)]??_0x23855d??resolve(_0x469fbb,_0x459e6d(0xb8),_0x459e6d(0xcc)),'workbuddySkillsDir':_0x1a5a23};}export function runtimeAgentSkillRoots(_0x4d36b4){const _0x4901d5=a143_0x415d;return[_0x4d36b4[_0x4901d5(0xc3)],_0x4d36b4[_0x4901d5(0xcd)],_0x4d36b4[_0x4901d5(0xb4)]]['filter'](_0x2f2ecb=>Boolean(_0x2f2ecb));}export function getRuntimeSkillCacheRoot(_0x1018f7,_0x35158d,_0x5913e0={}){const _0x4cc1b7=resolveSkillSyncPaths(_0x5913e0);return resolve(_0x4cc1b7['cacheRoot'],_0x1018f7,fingerprintAccessKey(_0x35158d),'skills');}export function getRuntimeSkillDir(_0xfd5375,_0x272a07,_0x1f5ec4,_0x50902e,_0x203725,_0x34dd92={}){const _0x42dccb=a143_0x415d;return resolve(getRuntimeSkillCacheRoot(_0xfd5375,_0x272a07,_0x34dd92),safePathSegment(_0x1f5ec4,_0x42dccb(0xc6)),_0x50902e,safePathSegment(_0x203725,_0x42dccb(0xc5)));}export function safePathSegment(_0x510981,_0x4dddc5=a143_0x19c077(0xb5)){const _0x4d0800=a143_0x19c077;if(!_0x510981||_0x510981[_0x4d0800(0xbf)]('/')||_0x510981['includes']('\x5c')||_0x510981[_0x4d0800(0xbf)]('..'))throw CliErrors['validation'](_0x4d0800(0xcb)+_0x4dddc5+_0x4d0800(0xbd)+_0x510981);return _0x510981;}function trimmedEnv(_0x596ba1){const _0x1fec06=a143_0x19c077,_0x395c2c=productEnv(_0x596ba1)?.[_0x1fec06(0xca)]();return _0x395c2c?_0x395c2c:undefined;}
@@ -1 +1 @@
1
- (function(_0x18955f,_0x20cb51){const _0x169c3b=a144_0x9a42,_0x3ef25b=_0x18955f();while(!![]){try{const _0x2bce2c=-parseInt(_0x169c3b(0x164))/0x1*(-parseInt(_0x169c3b(0x173))/0x2)+-parseInt(_0x169c3b(0x1a4))/0x3+-parseInt(_0x169c3b(0x1a5))/0x4+-parseInt(_0x169c3b(0x17f))/0x5*(parseInt(_0x169c3b(0x1a3))/0x6)+-parseInt(_0x169c3b(0x16b))/0x7+parseInt(_0x169c3b(0x168))/0x8+parseInt(_0x169c3b(0x16e))/0x9*(parseInt(_0x169c3b(0x198))/0xa);if(_0x2bce2c===_0x20cb51)break;else _0x3ef25b['push'](_0x3ef25b['shift']());}catch(_0x581a4c){_0x3ef25b['push'](_0x3ef25b['shift']());}}}(a144_0x1ee6,0x78a6c));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a144_0x5cf3d0}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(_0x2ff145,_0x41b155,_0x4c116d={}){const _0x121d6d=a144_0x9a42,_0x2b2182=resolvePushDirectoryRoot(_0x2ff145),_0xf08570=readPushMetadataIfPresent(resolve(_0x2b2182,METADATA_FILE),{'ignoreInvalidMetadata':_0x4c116d['ignoreInvalidMetadata']});if(_0xf08570?.['appCode']&&_0xf08570['appCode']!==_0x41b155&&!_0x4c116d[_0x121d6d(0x19c)]&&!_0x4c116d[_0x121d6d(0x162)])throw CliErrors[_0x121d6d(0x167)](_0x121d6d(0x180)+_0xf08570[_0x121d6d(0x1a2)]+_0x121d6d(0x1a0)+_0x41b155+'\x22.');const _0x31c392=resolvePushSkillCode(_0x2b2182,_0x41b155,_0xf08570,_0x4c116d);if(!_0x31c392)throw CliErrors['validation'](_0x121d6d(0x16c)+SKILL_FILE+',\x20'+METADATA_FILE+_0x121d6d(0x18d));return{'dir':_0x2b2182,'skillCode':_0x31c392,'metadata':_0xf08570};}export function readPushDirectory(_0x21aa71,_0x69f6c2,_0x5b30b8={}){const _0x3df8a1=a144_0x9a42,_0x1df8fe=resolvePushDirectoryIdentity(_0x21aa71,_0x69f6c2,_0x5b30b8),_0x4a4a15=_0x1df8fe[_0x3df8a1(0x192)],_0x458b11=resolve(_0x4a4a15,SKILL_FILE);if(!existsSync(_0x458b11)||!lstatSync(_0x458b11)[_0x3df8a1(0x17a)]())throw CliErrors['validation'](_0x3df8a1(0x189)+SKILL_FILE+':\x20'+_0x458b11);const _0x32bf52=_0x1df8fe[_0x3df8a1(0x181)],_0x39f5b9=_0x5b30b8[_0x3df8a1(0x16f)]??_0x3df8a1(0x186);if(!_0x5b30b8['ignoreMetadataScope']&&_0x32bf52?.['scope']===_0x3df8a1(0x19e))throw CliErrors['validation'](_0x3df8a1(0x178)+METADATA_FILE+_0x3df8a1(0x197)+_0x32bf52[_0x3df8a1(0x17b)]+'\x22.');if(!_0x5b30b8[_0x3df8a1(0x199)]&&_0x39f5b9===_0x3df8a1(0x186)&&_0x32bf52?.['scope']&&_0x32bf52[_0x3df8a1(0x17b)]!==_0x3df8a1(0x186))throw CliErrors[_0x3df8a1(0x167)]('Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20'+METADATA_FILE+_0x3df8a1(0x197)+_0x32bf52[_0x3df8a1(0x17b)]+'\x22.',_0x3df8a1(0x191)+_0x4a4a15+'\x20to\x20submit\x20company\x20Skills\x20for\x20review.');const _0x4cf60b=scanSkillDirectory(_0x4a4a15,{'excludedFilePaths':_0x5b30b8[_0x3df8a1(0x177)]}),_0x5290ea=buildSkillPackage(_0x4cf60b),_0x1febec=readFileSync(_0x458b11,_0x3df8a1(0x170)),_0x322269=_0x1df8fe[_0x3df8a1(0x19f)],_0x1255ba=_0x5b30b8['ignoreMetadataForPayload']?undefined:_0x32bf52,_0xb04aab=readSkillDisplayName(_0x1febec);return{'skillCode':_0x322269,'metadata':_0x32bf52,'frontmatterDisplayName':_0xb04aab,'input':{'skillCode':_0x322269,'skillName':_0xb04aab??_0x1255ba?.[_0x3df8a1(0x18a)],'description':_0x1255ba?.[_0x3df8a1(0x182)],'content':_0x1febec,'files':_0x5290ea[_0x3df8a1(0x19b)],'packageBase64':_0x5290ea[_0x3df8a1(0x1a1)],'tags':_0x1255ba?.[_0x3df8a1(0x17d)],'version':_0x1255ba?.['version'],'sourceSessionId':_0x1255ba?.['sourceSessionId']}};}export function refreshPushDirectoryMetadataFromRemote(_0x42c209,_0x2a1072,_0x1a1853,_0x2b85fd={}){const _0x2ad410=a144_0x9a42,_0x3e7852=resolvePushDirectoryRoot(_0x42c209),_0x6bc5a2=readPushMetadataIfPresent(resolve(_0x3e7852,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x5449b8=requireRemoteScope(_0x2a1072),_0x3b70b2=readLocalSkillContent(_0x3e7852),_0x3cfc6c={..._0x2a1072,'appCode':_0x2a1072['appCode']??_0x1a1853,'skillName':_0x2a1072[_0x2ad410(0x18a)]??_0x6bc5a2?.[_0x2ad410(0x18a)],'description':_0x2a1072[_0x2ad410(0x182)]??_0x6bc5a2?.[_0x2ad410(0x182)],'example':_0x2a1072[_0x2ad410(0x171)]??_0x6bc5a2?.['example'],'tags':Array[_0x2ad410(0x19a)](_0x2a1072[_0x2ad410(0x17d)])?_0x2a1072[_0x2ad410(0x17d)]:_0x6bc5a2?.['tags'],'sourceSessionId':_0x2a1072[_0x2ad410(0x184)]??_0x6bc5a2?.[_0x2ad410(0x184)],'content':_0x2a1072[_0x2ad410(0x172)]??_0x3b70b2},_0x3bb1da=buildMetadata(_0x3cfc6c,_0x5449b8,_0x1a1853,contentHash(_0x3b70b2),_0x2b85fd[_0x2ad410(0x18e)]);writeJsonAtomic(resolve(_0x3e7852,METADATA_FILE),_0x3bb1da);}export function recordPushedRuntimeSkill(_0x34c767,_0x338114,_0x167052,_0xb56e15={}){const _0x150818=a144_0x9a42,_0x2e2bde=resolvePushDirectoryRoot(_0x34c767),_0x5474ee=scanSkillDirectory(_0x2e2bde),_0x3d8ace=_0x5474ee[_0x150818(0x169)](_0xc943c8=>_0xc943c8[_0x150818(0x17c)]===SKILL_FILE),_0xe7e1c7=_0x3d8ace?fileText(_0x3d8ace):'',_0xc5eb01=tryNormalizePackageManifest(_0x338114[_0x150818(0x17e)]),_0x81f58d={..._0x338114,'content':_0x338114[_0x150818(0x172)]??_0xe7e1c7,'files':_0xc5eb01},_0x31483b=_0xc5eb01?normalizeLocalFiles(_0x5474ee)['filter'](_0x497290=>_0xc5eb01['files']['some'](_0x5a1a5c=>_0x5a1a5c[_0x150818(0x17c)]===_0x497290[_0x150818(0x17c)])):undefined,_0x1e0563=buildMetadata(_0x81f58d,_0xb56e15[_0x150818(0x17b)]??_0x150818(0x186),_0x167052,contentHash(_0x81f58d['content']??''),_0xb56e15[_0x150818(0x175)],_0x31483b);writeJsonAtomic(resolve(_0x2e2bde,METADATA_FILE),_0x1e0563);}function a144_0x1ee6(){const _0x20a751=['excludedFilePaths','Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20','(unknown)','isFile','scope','path','tags','files','3187165KEeFAH','Skill\x20metadata\x20appCode\x20\x22','metadata','description','Skill\x20directory\x20not\x20found:\x20','sourceSessionId','boolean','personal','trim','isSymbolicLink','Missing\x20','skillName','match','Remote\x20Skill\x20',',\x20or\x20directory\x20name.','refreshedAt','length','Invalid\x20','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20','dir','toLowerCase','ignoreMetadataSkillCode','number','displayName','\x20has\x20scope=\x22','70aWWFiZ','ignoreMetadataScope','isArray','manifest','allowAppCodeRetarget','startsWith','builtin','skillCode','\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22','packageBase64','appCode','6andyDe','1292307vElNmO','674492dGRzBx','ignoreMetadataAppCodeMismatch','slice','81cpFtlm','object','name','validation','2235504WShUcI','find','replace','409822ZAoVnI','Unable\x20to\x20resolve\x20skillCode\x20from\x20','isDirectory','1242369XHbSjm','targetScope','utf8','example','content','13428jfZNWx','ignoreInvalidMetadata','pushedAt','\x20has\x20unsupported\x20scope\x20\x22'];a144_0x1ee6=function(){return _0x20a751;};return a144_0x1ee6();}export function deriveSkillCodeFromDirectory(_0x1a9dde,_0x38a3b1){const _0x27de5c=a144_0x9a42,_0x816683=basename(resolve(_0x1a9dde)),_0x1e9851=_0x38a3b1+'--';return _0x816683[_0x27de5c(0x19d)](_0x1e9851)?_0x816683[_0x27de5c(0x163)](_0x1e9851[_0x27de5c(0x18f)]):_0x816683;}function resolvePushSkillCode(_0x4e8596,_0x55b3c8,_0x1f02b9,_0x259876){const _0x4e2fd7=a144_0x9a42,_0x2cb8d0=deriveSkillCodeFromSkillFile(_0x4e8596)||deriveSkillCodeFromDirectory(_0x4e8596,_0x55b3c8);if(_0x259876[_0x4e2fd7(0x194)])return _0x2cb8d0;return _0x1f02b9?.[_0x4e2fd7(0x19f)]?.['trim']()||_0x2cb8d0;}function deriveSkillCodeFromSkillFile(_0xd9e17f){const _0x129f7a=a144_0x9a42,_0x48b527=resolve(_0xd9e17f,SKILL_FILE);if(!existsSync(_0x48b527)||!lstatSync(_0x48b527)[_0x129f7a(0x17a)]())return undefined;const _0x59ff81=readFileSync(_0x48b527,'utf8'),_0x210b88=_0x59ff81[_0x129f7a(0x18b)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x210b88)return undefined;const _0x2d1c5a=parseFrontmatterObject(_0x210b88[0x1]??''),_0x26fba2=scalarToString(_0x2d1c5a?.[_0x129f7a(0x166)]);return _0x26fba2?slugifySkillName(_0x26fba2):undefined;}function readSkillDisplayName(_0x5aec5e){const _0x2da282=a144_0x9a42,_0x5d957f=_0x5aec5e[_0x2da282(0x18b)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x5d957f)return undefined;const _0x176abd=parseFrontmatterObject(_0x5d957f[0x1]??'');return scalarToString(_0x176abd?.[_0x2da282(0x196)]);}function slugifySkillName(_0x1fa643){const _0x29d79c=a144_0x9a42,_0x2f1a6a=_0x1fa643[_0x29d79c(0x187)]()[_0x29d79c(0x193)]()[_0x29d79c(0x16a)](/[^\p{L}\p{N}\p{So}]+/gu,'-')[_0x29d79c(0x16a)](/^-+/,'')[_0x29d79c(0x16a)](/-+$/,'')[_0x29d79c(0x16a)](/-{2,}/g,'-');if(!_0x2f1a6a)throw CliErrors[_0x29d79c(0x167)](_0x29d79c(0x190)+SKILL_FILE+'\x20name\x20for\x20SkillHub\x20slug\x20generation.');return _0x2f1a6a;}function parseFrontmatterObject(_0xa935f1){const _0x2ca856=a144_0x9a42;try{const _0x3f040b=a144_0x5cf3d0(_0xa935f1);return _0x3f040b&&typeof _0x3f040b===_0x2ca856(0x165)&&!Array[_0x2ca856(0x19a)](_0x3f040b)?_0x3f040b:undefined;}catch{return undefined;}}function scalarToString(_0x4ce8f4){const _0x4ef7ea=a144_0x9a42;if(typeof _0x4ce8f4==='string')return _0x4ce8f4[_0x4ef7ea(0x187)]();if(typeof _0x4ce8f4===_0x4ef7ea(0x195)||typeof _0x4ce8f4===_0x4ef7ea(0x185))return String(_0x4ce8f4);return undefined;}function resolvePushDirectoryRoot(_0x5cf562){const _0x4319d4=a144_0x9a42,_0x1a33c9=resolve(_0x5cf562);if(!existsSync(_0x1a33c9))throw CliErrors['validation']('Skill\x20directory\x20not\x20found:\x20'+_0x5cf562);const _0x404a3c=lstatSync(_0x1a33c9);if(_0x404a3c[_0x4319d4(0x16d)]())return _0x1a33c9;if(_0x404a3c[_0x4319d4(0x188)]()){const _0x31e7db=realpathSync(_0x1a33c9);if(lstatSync(_0x31e7db)[_0x4319d4(0x16d)]())return _0x31e7db;}throw CliErrors[_0x4319d4(0x167)](_0x4319d4(0x183)+_0x5cf562);}function a144_0x9a42(_0x1f45f7,_0xd35843){_0x1f45f7=_0x1f45f7-0x162;const _0x1ee62b=a144_0x1ee6();let _0x9a429e=_0x1ee62b[_0x1f45f7];return _0x9a429e;}function requireRemoteScope(_0x3f3877){const _0x23a17d=a144_0x9a42;if(_0x3f3877[_0x23a17d(0x17b)]===_0x23a17d(0x186)||_0x3f3877['scope']==='company'||_0x3f3877['scope']==='builtin')return _0x3f3877[_0x23a17d(0x17b)];throw CliErrors[_0x23a17d(0x167)](_0x23a17d(0x18c)+(_0x3f3877[_0x23a17d(0x19f)]||_0x23a17d(0x179))+_0x23a17d(0x176)+(_0x3f3877[_0x23a17d(0x17b)]??'unknown')+'\x22.');}function readLocalSkillContent(_0x31a703){const _0x44deda=a144_0x9a42,_0x27d685=resolve(_0x31a703,SKILL_FILE);return existsSync(_0x27d685)&&lstatSync(_0x27d685)[_0x44deda(0x17a)]()?readFileSync(_0x27d685,_0x44deda(0x170)):'';}function readPushMetadataIfPresent(_0x5e3c44,_0x41f413={}){const _0x207cc2=a144_0x9a42;try{return readMetadataIfPresent(_0x5e3c44);}catch(_0x3e1ebd){if(_0x41f413[_0x207cc2(0x174)])return undefined;throw _0x3e1ebd;}}
1
+ (function(_0x565d3a,_0x55c86b){const _0x55aea3=a144_0x3e79,_0x1432f9=_0x565d3a();while(!![]){try{const _0x4db65f=-parseInt(_0x55aea3(0x8f))/0x1*(parseInt(_0x55aea3(0x85))/0x2)+parseInt(_0x55aea3(0xac))/0x3+-parseInt(_0x55aea3(0xa2))/0x4+parseInt(_0x55aea3(0x99))/0x5*(parseInt(_0x55aea3(0x8d))/0x6)+parseInt(_0x55aea3(0x81))/0x7*(parseInt(_0x55aea3(0x8e))/0x8)+-parseInt(_0x55aea3(0x7b))/0x9*(-parseInt(_0x55aea3(0xb2))/0xa)+parseInt(_0x55aea3(0xa9))/0xb*(-parseInt(_0x55aea3(0xa7))/0xc);if(_0x4db65f===_0x55c86b)break;else _0x1432f9['push'](_0x1432f9['shift']());}catch(_0x10d7dd){_0x1432f9['push'](_0x1432f9['shift']());}}}(a144_0x4050,0xba503));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';function a144_0x3e79(_0x4237da,_0x53f212){_0x4237da=_0x4237da-0x72;const _0x405053=a144_0x4050();let _0x3e7915=_0x405053[_0x4237da];return _0x3e7915;}import{basename,resolve}from'node:path';import{parse as a144_0x1c94f0}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(_0x21e6ba,_0x51f10c,_0x3a9768={}){const _0x473299=a144_0x3e79,_0x21d805=resolvePushDirectoryRoot(_0x21e6ba),_0x35ca34=readPushMetadataIfPresent(resolve(_0x21d805,METADATA_FILE),{'ignoreInvalidMetadata':_0x3a9768[_0x473299(0x79)]});if(_0x35ca34?.[_0x473299(0x7f)]&&_0x35ca34[_0x473299(0x7f)]!==_0x51f10c&&!_0x3a9768['allowAppCodeRetarget']&&!_0x3a9768[_0x473299(0x98)])throw CliErrors['validation'](_0x473299(0xb4)+_0x35ca34[_0x473299(0x7f)]+_0x473299(0x78)+_0x51f10c+'\x22.');const _0x1b5afd=resolvePushSkillCode(_0x21d805,_0x51f10c,_0x35ca34,_0x3a9768);if(!_0x1b5afd)throw CliErrors[_0x473299(0x8b)]('Unable\x20to\x20resolve\x20skillCode\x20from\x20'+SKILL_FILE+',\x20'+METADATA_FILE+_0x473299(0x72));return{'dir':_0x21d805,'skillCode':_0x1b5afd,'metadata':_0x35ca34};}export function readPushDirectory(_0xe3c8a,_0x4d66e6,_0x410316={}){const _0x16722a=a144_0x3e79,_0x50efa6=resolvePushDirectoryIdentity(_0xe3c8a,_0x4d66e6,_0x410316),_0x21f1e4=_0x50efa6[_0x16722a(0x96)],_0x383436=resolve(_0x21f1e4,SKILL_FILE);if(!existsSync(_0x383436)||!lstatSync(_0x383436)[_0x16722a(0xae)]())throw CliErrors[_0x16722a(0x8b)](_0x16722a(0xa4)+SKILL_FILE+':\x20'+_0x383436);const _0x265812=_0x50efa6['metadata'],_0x3f4f12=_0x410316[_0x16722a(0xa6)]??'personal';if(!_0x410316[_0x16722a(0x97)]&&_0x265812?.[_0x16722a(0x86)]===_0x16722a(0xaa))throw CliErrors[_0x16722a(0x8b)](_0x16722a(0x93)+METADATA_FILE+_0x16722a(0xb5)+_0x265812[_0x16722a(0x86)]+'\x22.');if(!_0x410316[_0x16722a(0x97)]&&_0x3f4f12===_0x16722a(0xa8)&&_0x265812?.[_0x16722a(0x86)]&&_0x265812['scope']!=='personal')throw CliErrors[_0x16722a(0x8b)](_0x16722a(0x7d)+METADATA_FILE+'\x20has\x20scope=\x22'+_0x265812[_0x16722a(0x86)]+'\x22.',_0x16722a(0x75)+_0x21f1e4+'\x20to\x20submit\x20company\x20Skills\x20for\x20review.');const _0x215884=scanSkillDirectory(_0x21f1e4,{'excludedFilePaths':_0x410316[_0x16722a(0x9e)]}),_0x5270ad=buildSkillPackage(_0x215884),_0x105819=readFileSync(_0x383436,_0x16722a(0x9f)),_0x2e982b=_0x50efa6[_0x16722a(0xad)],_0xb4846f=_0x410316[_0x16722a(0x9b)]?undefined:_0x265812,_0x70e42b=readSkillDisplayName(_0x105819);return{'skillCode':_0x2e982b,'metadata':_0x265812,'frontmatterDisplayName':_0x70e42b,'input':{'skillCode':_0x2e982b,'skillName':_0x70e42b??_0xb4846f?.[_0x16722a(0x74)],'description':_0xb4846f?.[_0x16722a(0x89)],'content':_0x105819,'files':_0x5270ad[_0x16722a(0x8c)],'packageBase64':_0x5270ad[_0x16722a(0xb1)],'tags':_0xb4846f?.[_0x16722a(0x9d)],'version':_0xb4846f?.[_0x16722a(0x92)],'sourceSessionId':_0xb4846f?.[_0x16722a(0x95)]}};}export function refreshPushDirectoryMetadataFromRemote(_0x50a2d9,_0xa4a71e,_0xc1a654,_0x13d600={}){const _0x1a02b0=a144_0x3e79,_0x16cab6=resolvePushDirectoryRoot(_0x50a2d9),_0x38e915=readPushMetadataIfPresent(resolve(_0x16cab6,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x5141c1=requireRemoteScope(_0xa4a71e),_0x4f9fa4=readLocalSkillContent(_0x16cab6),_0x2f923e={..._0xa4a71e,'appCode':_0xa4a71e[_0x1a02b0(0x7f)]??_0xc1a654,'skillName':_0xa4a71e[_0x1a02b0(0x74)]??_0x38e915?.[_0x1a02b0(0x74)],'description':_0xa4a71e[_0x1a02b0(0x89)]??_0x38e915?.[_0x1a02b0(0x89)],'example':_0xa4a71e[_0x1a02b0(0x91)]??_0x38e915?.[_0x1a02b0(0x91)],'tags':Array[_0x1a02b0(0x73)](_0xa4a71e[_0x1a02b0(0x9d)])?_0xa4a71e['tags']:_0x38e915?.['tags'],'sourceSessionId':_0xa4a71e[_0x1a02b0(0x95)]??_0x38e915?.['sourceSessionId'],'content':_0xa4a71e[_0x1a02b0(0xb0)]??_0x4f9fa4},_0x4d31d1=buildMetadata(_0x2f923e,_0x5141c1,_0xc1a654,contentHash(_0x4f9fa4),_0x13d600[_0x1a02b0(0x84)]);writeJsonAtomic(resolve(_0x16cab6,METADATA_FILE),_0x4d31d1);}export function recordPushedRuntimeSkill(_0x301647,_0x1882e5,_0x516509,_0x43c5dc={}){const _0x47f1d9=a144_0x3e79,_0x39e7af=resolvePushDirectoryRoot(_0x301647),_0x54508d=scanSkillDirectory(_0x39e7af),_0x419bdf=_0x54508d[_0x47f1d9(0x7c)](_0x28f414=>_0x28f414['path']===SKILL_FILE),_0x34b187=_0x419bdf?fileText(_0x419bdf):'',_0x39e418=tryNormalizePackageManifest(_0x1882e5[_0x47f1d9(0xaf)]),_0x21289b={..._0x1882e5,'content':_0x1882e5[_0x47f1d9(0xb0)]??_0x34b187,'files':_0x39e418},_0x52a811=_0x39e418?normalizeLocalFiles(_0x54508d)['filter'](_0x1cf6e6=>_0x39e418[_0x47f1d9(0xaf)][_0x47f1d9(0x90)](_0x350ae6=>_0x350ae6[_0x47f1d9(0xb6)]===_0x1cf6e6[_0x47f1d9(0xb6)])):undefined,_0x57869b=buildMetadata(_0x21289b,_0x43c5dc[_0x47f1d9(0x86)]??'personal',_0x516509,contentHash(_0x21289b['content']??''),_0x43c5dc[_0x47f1d9(0x76)],_0x52a811);writeJsonAtomic(resolve(_0x39e7af,METADATA_FILE),_0x57869b);}export function deriveSkillCodeFromDirectory(_0x222ad7,_0x5968e2){const _0xe4b9af=a144_0x3e79,_0x3612b0=basename(resolve(_0x222ad7)),_0x464ed3=_0x5968e2+'--';return _0x3612b0[_0xe4b9af(0x82)](_0x464ed3)?_0x3612b0[_0xe4b9af(0x7e)](_0x464ed3[_0xe4b9af(0xab)]):_0x3612b0;}function resolvePushSkillCode(_0x226bb0,_0x192725,_0x2671b0,_0x1a2a5a){const _0x137d32=a144_0x3e79,_0x335097=deriveSkillCodeFromSkillFile(_0x226bb0)||deriveSkillCodeFromDirectory(_0x226bb0,_0x192725);if(_0x1a2a5a['ignoreMetadataSkillCode'])return _0x335097;return _0x2671b0?.[_0x137d32(0xad)]?.['trim']()||_0x335097;}function deriveSkillCodeFromSkillFile(_0x1e6adf){const _0x1433a7=a144_0x3e79,_0x6be3ea=resolve(_0x1e6adf,SKILL_FILE);if(!existsSync(_0x6be3ea)||!lstatSync(_0x6be3ea)[_0x1433a7(0xae)]())return undefined;const _0x26e676=readFileSync(_0x6be3ea,_0x1433a7(0x9f)),_0x33327e=_0x26e676[_0x1433a7(0x8a)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x33327e)return undefined;const _0x2bb764=parseFrontmatterObject(_0x33327e[0x1]??''),_0x300c99=scalarToString(_0x2bb764?.[_0x1433a7(0x7a)]);return _0x300c99?slugifySkillName(_0x300c99):undefined;}function readSkillDisplayName(_0x345e2c){const _0x4a1485=a144_0x3e79,_0x25d5d3=_0x345e2c['match'](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x25d5d3)return undefined;const _0x1da45c=parseFrontmatterObject(_0x25d5d3[0x1]??'');return scalarToString(_0x1da45c?.[_0x4a1485(0x94)]);}function slugifySkillName(_0x53a27b){const _0x4aa12a=a144_0x3e79,_0x21314f=_0x53a27b[_0x4aa12a(0x9c)]()[_0x4aa12a(0x9a)]()[_0x4aa12a(0xa1)](/[^\p{L}\p{N}\p{So}]+/gu,'-')[_0x4aa12a(0xa1)](/^-+/,'')[_0x4aa12a(0xa1)](/-+$/,'')[_0x4aa12a(0xa1)](/-{2,}/g,'-');if(!_0x21314f)throw CliErrors['validation']('Invalid\x20'+SKILL_FILE+'\x20name\x20for\x20SkillHub\x20slug\x20generation.');return _0x21314f;}function parseFrontmatterObject(_0x6ed8f9){try{const _0x5365d0=a144_0x1c94f0(_0x6ed8f9);return _0x5365d0&&typeof _0x5365d0==='object'&&!Array['isArray'](_0x5365d0)?_0x5365d0:undefined;}catch{return undefined;}}function a144_0x4050(){const _0x3a505b=['Skill\x20directory\x20not\x20found:\x20','replace','230560WlcjKc','(unknown)','Missing\x20','isDirectory','targetScope','1881276uPnVSr','personal','209vrTayh','builtin','length','1885338KcNBWW','skillCode','isFile','files','content','packageBase64','263830hXHsQH','isSymbolicLink','Skill\x20metadata\x20appCode\x20\x22','\x20has\x20scope=\x22','path',',\x20or\x20directory\x20name.','isArray','skillName','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20','pushedAt','string','\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22','ignoreInvalidMetadata','name','315XmgAYz','find','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20','slice','appCode','unknown','28aXRFts','startsWith','\x20has\x20unsupported\x20scope\x20\x22','refreshedAt','41068qXKHvc','scope','Remote\x20Skill\x20','number','description','match','validation','manifest','259878UeTtqP','2056232FkJfof','6aadzFR','some','example','version','Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20','displayName','sourceSessionId','dir','ignoreMetadataScope','ignoreMetadataAppCodeMismatch','155TlAZrA','toLowerCase','ignoreMetadataForPayload','trim','tags','excludedFilePaths','utf8'];a144_0x4050=function(){return _0x3a505b;};return a144_0x4050();}function scalarToString(_0x192d52){const _0x18e96f=a144_0x3e79;if(typeof _0x192d52===_0x18e96f(0x77))return _0x192d52[_0x18e96f(0x9c)]();if(typeof _0x192d52===_0x18e96f(0x88)||typeof _0x192d52==='boolean')return String(_0x192d52);return undefined;}function resolvePushDirectoryRoot(_0x3031f4){const _0x5840b5=a144_0x3e79,_0x5a80d8=resolve(_0x3031f4);if(!existsSync(_0x5a80d8))throw CliErrors[_0x5840b5(0x8b)](_0x5840b5(0xa0)+_0x3031f4);const _0x2b5cdd=lstatSync(_0x5a80d8);if(_0x2b5cdd['isDirectory']())return _0x5a80d8;if(_0x2b5cdd[_0x5840b5(0xb3)]()){const _0x45195c=realpathSync(_0x5a80d8);if(lstatSync(_0x45195c)[_0x5840b5(0xa5)]())return _0x45195c;}throw CliErrors[_0x5840b5(0x8b)](_0x5840b5(0xa0)+_0x3031f4);}function requireRemoteScope(_0x54a376){const _0x464db6=a144_0x3e79;if(_0x54a376[_0x464db6(0x86)]===_0x464db6(0xa8)||_0x54a376['scope']==='company'||_0x54a376['scope']===_0x464db6(0xaa))return _0x54a376['scope'];throw CliErrors[_0x464db6(0x8b)](_0x464db6(0x87)+(_0x54a376['skillCode']||_0x464db6(0xa3))+_0x464db6(0x83)+(_0x54a376['scope']??_0x464db6(0x80))+'\x22.');}function readLocalSkillContent(_0x42b85a){const _0x5ef608=a144_0x3e79,_0x2a948f=resolve(_0x42b85a,SKILL_FILE);return existsSync(_0x2a948f)&&lstatSync(_0x2a948f)[_0x5ef608(0xae)]()?readFileSync(_0x2a948f,_0x5ef608(0x9f)):'';}function readPushMetadataIfPresent(_0x35367f,_0x57266f={}){try{return readMetadataIfPresent(_0x35367f);}catch(_0x227c1d){if(_0x57266f['ignoreInvalidMetadata'])return undefined;throw _0x227c1d;}}
@@ -1 +1 @@
1
- function a145_0x2f8f(){const _0x5513e4=['210GjiGCM','6LNWfRI','3LDgnSy','validation','push','172iXmECj','11255712bjmFiN','Unsupported\x20runtime\x20Skill\x20scope:\x20','17272pJssdb','210309GcidfV','3734822iUiCnW','9huwrzh','company','includes','2210740yHTQZn','172428wnzTCG','164RRbHUc','length','personal','builtin'];a145_0x2f8f=function(){return _0x5513e4;};return a145_0x2f8f();}(function(_0x5b2529,_0x29f824){const _0x47067b=a145_0x3510,_0x3cab64=_0x5b2529();while(!![]){try{const _0x22af02=parseInt(_0x47067b(0x146))/0x1*(parseInt(_0x47067b(0x151))/0x2)+parseInt(_0x47067b(0x143))/0x3*(-parseInt(_0x47067b(0x150))/0x4)+-parseInt(_0x47067b(0x14f))/0x5*(-parseInt(_0x47067b(0x142))/0x6)+-parseInt(_0x47067b(0x14b))/0x7+parseInt(_0x47067b(0x149))/0x8*(parseInt(_0x47067b(0x14c))/0x9)+-parseInt(_0x47067b(0x155))/0xa*(parseInt(_0x47067b(0x14a))/0xb)+parseInt(_0x47067b(0x147))/0xc;if(_0x22af02===_0x29f824)break;else _0x3cab64['push'](_0x3cab64['shift']());}catch(_0x2cbd1c){_0x3cab64['push'](_0x3cab64['shift']());}}}(a145_0x2f8f,0x661bb));import{CliErrors}from'../../errors.js';export function normalizeRuntimeSkillScopes(_0x490ebe){const _0x101494=a145_0x3510,_0x3643ac=_0x490ebe&&_0x490ebe[_0x101494(0x152)]>0x0?_0x490ebe:['personal',_0x101494(0x14d),_0x101494(0x154)],_0x15035f=[];for(const _0x4551a6 of _0x3643ac){if(!isRuntimeSkillScope(_0x4551a6))throw CliErrors[_0x101494(0x144)](_0x101494(0x148)+_0x4551a6);!_0x15035f[_0x101494(0x14e)](_0x4551a6)&&_0x15035f[_0x101494(0x145)](_0x4551a6);}return _0x15035f;}function a145_0x3510(_0x39594f,_0x4dc4f2){_0x39594f=_0x39594f-0x142;const _0x2f8f96=a145_0x2f8f();let _0x351019=_0x2f8f96[_0x39594f];return _0x351019;}export function isRuntimeSkillScope(_0x3a80db){const _0x45eaaf=a145_0x3510;return _0x3a80db===_0x45eaaf(0x153)||_0x3a80db===_0x45eaaf(0x14d)||_0x3a80db===_0x45eaaf(0x154);}
1
+ (function(_0x456e8c,_0x213185){const _0x39412c=a145_0x3981,_0xd47dc=_0x456e8c();while(!![]){try{const _0x107687=-parseInt(_0x39412c(0x160))/0x1+parseInt(_0x39412c(0x15d))/0x2*(parseInt(_0x39412c(0x166))/0x3)+-parseInt(_0x39412c(0x162))/0x4+-parseInt(_0x39412c(0x161))/0x5+-parseInt(_0x39412c(0x15e))/0x6+parseInt(_0x39412c(0x164))/0x7+parseInt(_0x39412c(0x15b))/0x8;if(_0x107687===_0x213185)break;else _0xd47dc['push'](_0xd47dc['shift']());}catch(_0x40cd2a){_0xd47dc['push'](_0xd47dc['shift']());}}}(a145_0x37a8,0xdc7df));function a145_0x37a8(){const _0x57da5b=['5307595OioGJn','2718536swpPAi','validation','12256041PLWAYF','personal','163794owtqFl','length','builtin','company','9697272AOwtdC','Unsupported\x20runtime\x20Skill\x20scope:\x20','52LWmDSE','2768346DofuvH','includes','1276891nPNcJN'];a145_0x37a8=function(){return _0x57da5b;};return a145_0x37a8();}import{CliErrors}from'../../errors.js';export function normalizeRuntimeSkillScopes(_0x3ac260){const _0x10a70e=a145_0x3981,_0x2e4bdd=_0x3ac260&&_0x3ac260[_0x10a70e(0x167)]>0x0?_0x3ac260:[_0x10a70e(0x165),_0x10a70e(0x15a),_0x10a70e(0x168)],_0x48f863=[];for(const _0x162ee2 of _0x2e4bdd){if(!isRuntimeSkillScope(_0x162ee2))throw CliErrors[_0x10a70e(0x163)](_0x10a70e(0x15c)+_0x162ee2);!_0x48f863[_0x10a70e(0x15f)](_0x162ee2)&&_0x48f863['push'](_0x162ee2);}return _0x48f863;}function a145_0x3981(_0x17c4c6,_0x4499bf){_0x17c4c6=_0x17c4c6-0x15a;const _0x37a872=a145_0x37a8();let _0x3981bc=_0x37a872[_0x17c4c6];return _0x3981bc;}export function isRuntimeSkillScope(_0x57a2a1){const _0x5adefc=a145_0x3981;return _0x57a2a1==='personal'||_0x57a2a1==='company'||_0x57a2a1===_0x5adefc(0x168);}
@@ -1 +1 @@
1
- function a147_0x6dc9(_0x5ab981,_0x219085){_0x5ab981=_0x5ab981-0xb1;const _0x343c34=a147_0x343c();let _0x6dc942=_0x343c34[_0x5ab981];return _0x6dc942;}const a147_0x440cc0=a147_0x6dc9;(function(_0x3bea1c,_0x2cb9c8){const _0x58cd34=a147_0x6dc9,_0x2a78c0=_0x3bea1c();while(!![]){try{const _0xf04dde=-parseInt(_0x58cd34(0xbe))/0x1+parseInt(_0x58cd34(0xc0))/0x2+-parseInt(_0x58cd34(0xb5))/0x3*(-parseInt(_0x58cd34(0xb8))/0x4)+parseInt(_0x58cd34(0xb1))/0x5+parseInt(_0x58cd34(0xc5))/0x6+parseInt(_0x58cd34(0xb3))/0x7*(-parseInt(_0x58cd34(0xc6))/0x8)+parseInt(_0x58cd34(0xc4))/0x9*(-parseInt(_0x58cd34(0xbb))/0xa);if(_0xf04dde===_0x2cb9c8)break;else _0x2a78c0['push'](_0x2a78c0['shift']());}catch(_0x33e967){_0x2a78c0['push'](_0x2a78c0['shift']());}}}(a147_0x343c,0x3d1a8));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_0x440cc0(0xbd));export function createDeterministicZipPackage(_0x21223c){const _0x167a73=a147_0x440cc0,_0x1263d4={};for(const _0x2d870c of normalizeLocalFiles(_0x21223c)){_0x1263d4[_0x2d870c[_0x167a73(0xba)]]=fileContent(_0x2d870c);}return Buffer[_0x167a73(0xc3)](zipSync(_0x1263d4,{'level':0x0,'mtime':ZIP_MTIME}));}export function parseZipPackage(_0x10b191){const _0x22e873=a147_0x440cc0;if(_0x10b191['length']<0x16)throw CliErrors[_0x22e873(0xc2)](_0x22e873(0xc1));let _0xb5b8bf;try{_0xb5b8bf=unzipSync(_0x10b191,{'filter'(_0x5606d4){const _0x2008b0=_0x22e873,_0x543afa=normalizeSkillRelativePath(_0x5606d4[_0x2008b0(0xb9)]);if(_0x543afa[_0x2008b0(0xb6)]('/'))throw CliErrors[_0x2008b0(0xc2)]('Runtime\x20Skill\x20package\x20contains\x20directory\x20entry:\x20'+_0x543afa);return!![];}});}catch(_0x2b145b){if(isRuntimeSkillValidationError(_0x2b145b))throw _0x2b145b;throw CliErrors[_0x22e873(0xc2)](_0x22e873(0xc1));}return Object[_0x22e873(0xbc)](_0xb5b8bf)[_0x22e873(0xb4)](([_0x12b222,_0x89b302])=>({'path':normalizeSkillRelativePath(_0x12b222),'bytes':Buffer[_0x22e873(0xc3)](_0x89b302)}))[_0x22e873(0xb7)](compareSkillFiles);}function isRuntimeSkillValidationError(_0x359b4c){const _0x453584=a147_0x440cc0;return typeof _0x359b4c===_0x453584(0xb2)&&_0x359b4c!==null&&_0x453584(0xbf)in _0x359b4c&&_0x359b4c[_0x453584(0xbf)]==='validation_error';}function a147_0x343c(){const _0x3ee22a=['map','9UOrcTM','endsWith','sort','422792oZgprg','name','path','721220OHjzXP','entries','1980-01-01T00:00:00.000Z','27162jLkFef','code','247894mPwTKA','Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.','validation','from','63aVFaXk','592002yVbrOM','7456BDyCbI','1250220IGjSJV','object','56fDnUSO'];a147_0x343c=function(){return _0x3ee22a;};return a147_0x343c();}
1
+ function a147_0x2cc8(_0x308296,_0x42f8eb){_0x308296=_0x308296-0x1cc;const _0x422cdc=a147_0x422c();let _0x2cc802=_0x422cdc[_0x308296];return _0x2cc802;}const a147_0xa3da6c=a147_0x2cc8;(function(_0x425390,_0x22a18d){const _0x46cae6=a147_0x2cc8,_0x4ac309=_0x425390();while(!![]){try{const _0x110eb5=parseInt(_0x46cae6(0x1dc))/0x1*(-parseInt(_0x46cae6(0x1cf))/0x2)+-parseInt(_0x46cae6(0x1e0))/0x3+-parseInt(_0x46cae6(0x1d7))/0x4*(-parseInt(_0x46cae6(0x1db))/0x5)+parseInt(_0x46cae6(0x1d2))/0x6+-parseInt(_0x46cae6(0x1ce))/0x7+parseInt(_0x46cae6(0x1de))/0x8+-parseInt(_0x46cae6(0x1d0))/0x9*(-parseInt(_0x46cae6(0x1d3))/0xa);if(_0x110eb5===_0x22a18d)break;else _0x4ac309['push'](_0x4ac309['shift']());}catch(_0x1b33b5){_0x4ac309['push'](_0x4ac309['shift']());}}}(a147_0x422c,0xc9984));import{unzipSync,zipSync}from'fflate';import{CliErrors}from'../../errors.js';import{compareSkillFiles,fileContent,normalizeLocalFiles,normalizeSkillRelativePath}from'./local-files.js';function a147_0x422c(){const _0x272180=['1739dXmtnk','entries','9059520gsgwsL','Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.','4315959mdGWna','object','from','1980-01-01T00:00:00.000Z','code','11055877ociDLx','754UtLclM','86085bAFEgo','validation_error','7355862BFQEQw','1910DaGXDq','map','sort','Runtime\x20Skill\x20package\x20contains\x20directory\x20entry:\x20','4mXlIgn','validation','name','endsWith','1570335cERFyK'];a147_0x422c=function(){return _0x272180;};return a147_0x422c();}const ZIP_MTIME=new Date(a147_0xa3da6c(0x1cc));export function createDeterministicZipPackage(_0x3ba9db){const _0x3f859b={};for(const _0xaa64ae of normalizeLocalFiles(_0x3ba9db)){_0x3f859b[_0xaa64ae['path']]=fileContent(_0xaa64ae);}return Buffer['from'](zipSync(_0x3f859b,{'level':0x0,'mtime':ZIP_MTIME}));}export function parseZipPackage(_0x39b296){const _0x18b9eb=a147_0xa3da6c;if(_0x39b296['length']<0x16)throw CliErrors[_0x18b9eb(0x1d8)]('Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.');let _0x2507fa;try{_0x2507fa=unzipSync(_0x39b296,{'filter'(_0x496d6e){const _0x374e06=_0x18b9eb,_0x2a0fdd=normalizeSkillRelativePath(_0x496d6e[_0x374e06(0x1d9)]);if(_0x2a0fdd[_0x374e06(0x1da)]('/'))throw CliErrors[_0x374e06(0x1d8)](_0x374e06(0x1d6)+_0x2a0fdd);return!![];}});}catch(_0x34d760){if(isRuntimeSkillValidationError(_0x34d760))throw _0x34d760;throw CliErrors[_0x18b9eb(0x1d8)](_0x18b9eb(0x1df));}return Object[_0x18b9eb(0x1dd)](_0x2507fa)[_0x18b9eb(0x1d4)](([_0x395a27,_0x484443])=>({'path':normalizeSkillRelativePath(_0x395a27),'bytes':Buffer[_0x18b9eb(0x1e2)](_0x484443)}))[_0x18b9eb(0x1d5)](compareSkillFiles);}function isRuntimeSkillValidationError(_0x3464d8){const _0x5501a8=a147_0xa3da6c;return typeof _0x3464d8===_0x5501a8(0x1e1)&&_0x3464d8!==null&&_0x5501a8(0x1cd)in _0x3464d8&&_0x3464d8[_0x5501a8(0x1cd)]===_0x5501a8(0x1d1);}
@@ -1 +1 @@
1
- (function(_0x443e1d,_0x15f332){const _0x5aacf3=a148_0xb748,_0x44688a=_0x443e1d();while(!![]){try{const _0x30a58b=-parseInt(_0x5aacf3(0x12e))/0x1*(parseInt(_0x5aacf3(0x11c))/0x2)+-parseInt(_0x5aacf3(0x134))/0x3*(-parseInt(_0x5aacf3(0x113))/0x4)+parseInt(_0x5aacf3(0x12a))/0x5+parseInt(_0x5aacf3(0x109))/0x6+-parseInt(_0x5aacf3(0x132))/0x7*(parseInt(_0x5aacf3(0x11e))/0x8)+-parseInt(_0x5aacf3(0x127))/0x9*(-parseInt(_0x5aacf3(0x116))/0xa)+-parseInt(_0x5aacf3(0x117))/0xb*(parseInt(_0x5aacf3(0x10b))/0xc);if(_0x30a58b===_0x15f332)break;else _0x44688a['push'](_0x44688a['shift']());}catch(_0x4e2241){_0x44688a['push'](_0x44688a['shift']());}}}(a148_0x8607,0x18cb2));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_0x8607(){const _0x1caaf1=['string','files','263421TIJLFd','size','get','397555Gqzmnk','zipSize','Missing\x20','Runtime\x20Skill\x20package\x20file\x20size\x20mismatch:\x20','3533ZqIHdI','push','trim','Runtime\x20Skill\x20package\x20is\x20missing\x20entry:\x20','521787fyTLBA','path','306354SrUiyn','isArray','Duplicate\x20Skill\x20package\x20entry:\x20','sha256','has','821196QmJsjq','toString','36EPLxpf','zipSha256','validation','treeSha256','Runtime\x20Skill\x20package\x20is\x20required\x20for\x20Skill\x20install:\x20','Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.','Runtime\x20Skill\x20file\x20tree\x20sha256\x20mismatch.','Runtime\x20Skill\x20package\x20sha256\x20mismatch.','4mQJRwT','map','some','50iqIneM','254287llUmjq','Runtime\x20Skill\x20file\x20tree\x20sha256\x20is\x20invalid.','toLowerCase','\x20in\x20Skill\x20file\x20package.','Runtime\x20Skill\x20package\x20size\x20is\x20invalid.','82gmgSTM','isSafeInteger','16uiHfaR','length','bytes','Runtime\x20Skill\x20package\x20entry\x20list\x20mismatch.','base64','Runtime\x20Skill\x20package\x20sha256\x20is\x20invalid.','Runtime\x20Skill\x20manifest\x20is\x20missing\x20'];a148_0x8607=function(){return _0x1caaf1;};return a148_0x8607();}export function buildSkillPackage(_0x42b7e2){const _0x18d945=a148_0xb748,_0x3137ef=normalizeLocalFiles(_0x42b7e2);if(!_0x3137ef[_0x18d945(0x115)](_0x4f334a=>_0x4f334a[_0x18d945(0x133)]===SKILL_FILE))throw CliErrors['validation'](_0x18d945(0x12c)+SKILL_FILE+_0x18d945(0x11a));const _0x239394=localFilesToManifestFiles(_0x3137ef),_0xfc59a2=createDeterministicZipPackage(_0x3137ef);return{'manifest':{'schemaVersion':0x2,'treeSha256':fileTreeHash(_0x239394),'zipSha256':bufferSha256(_0xfc59a2),'zipSize':_0xfc59a2['length'],'files':_0x239394},'packageBytes':_0xfc59a2,'packageBase64':_0xfc59a2[_0x18d945(0x10a)](_0x18d945(0x122))};}export function verifyRuntimeSkillPackage(_0x5dba62,_0x3a476b){const _0x54c64d=normalizePackageManifest(_0x5dba62,{'requireOssPath':![]});if(!_0x54c64d)throw CliErrors['validation']('Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.');return extractAndVerifyPackage(_0x54c64d,_0x3a476b);}export function verifyRuntimeSkillBundle(_0x3f0bf1,_0x2a79c0){const _0x345841=a148_0xb748,_0x465b96=normalizePackageManifest(_0x3f0bf1,{'requireOssPath':![]});if(!_0x465b96)throw CliErrors[_0x345841(0x10d)](_0x345841(0x110));return extractAndVerifyPackageFiles(_0x465b96,_0x2a79c0);}function a148_0xb748(_0x17ffe7,_0x561b03){_0x17ffe7=_0x17ffe7-0x106;const _0x8607b8=a148_0x8607();let _0xb7480f=_0x8607b8[_0x17ffe7];return _0xb7480f;}export function tryNormalizePackageManifest(_0x123485){return normalizePackageManifest(_0x123485,{'requireOssPath':![]});}export function requirePackageBytes(_0x3845ec,_0x994979){const _0x5833fe=a148_0xb748;if(!_0x994979||_0x994979['length']===0x0)throw CliErrors[_0x5833fe(0x10d)](_0x5833fe(0x10f)+_0x3845ec);return _0x994979;}export function extractDownloadedPackage(_0x27450e){const _0x47bc35=a148_0xb748,_0x3c177e=parseZipPackage(_0x27450e)[_0x47bc35(0x114)](_0x401b39=>({'path':_0x401b39['path'],'bytes':_0x401b39['bytes']}));if(!_0x3c177e[_0x47bc35(0x115)](_0x158d3c=>_0x158d3c[_0x47bc35(0x133)]===SKILL_FILE))throw CliErrors[_0x47bc35(0x10d)]('Runtime\x20Skill\x20package\x20is\x20missing\x20'+SKILL_FILE+'.');return normalizeLocalFiles(_0x3c177e);}export function localFilesToManifestFiles(_0x31ca5c){const _0xb3c2d1=a148_0xb748;return normalizeLocalFiles(_0x31ca5c)[_0xb3c2d1(0x114)](_0x5d8422=>({'path':_0x5d8422['path'],'sha256':fileHash(_0x5d8422),'size':fileContent(_0x5d8422)[_0xb3c2d1(0x11f)]}));}function normalizePackageManifest(_0x5980a9,_0x242b8b){const _0x1603f3=a148_0xb748;if(!_0x5980a9||typeof _0x5980a9!=='object'||Array[_0x1603f3(0x135)](_0x5980a9))return undefined;const _0x4a9320=_0x5980a9,_0x47a3c8=typeof _0x4a9320['ossPath']===_0x1603f3(0x125)?_0x4a9320['ossPath'][_0x1603f3(0x130)]():undefined;if(_0x242b8b['requireOssPath']&&!_0x47a3c8)return undefined;if(!Array[_0x1603f3(0x135)](_0x4a9320[_0x1603f3(0x126)])||_0x4a9320[_0x1603f3(0x126)][_0x1603f3(0x11f)]===0x0)return undefined;if(!isSha256Hex(_0x4a9320['treeSha256']))throw CliErrors[_0x1603f3(0x10d)](_0x1603f3(0x118));if(!isSha256Hex(_0x4a9320[_0x1603f3(0x10c)]))throw CliErrors[_0x1603f3(0x10d)](_0x1603f3(0x123));if(!Number[_0x1603f3(0x11d)](_0x4a9320[_0x1603f3(0x12b)])||_0x4a9320[_0x1603f3(0x12b)]<0x0)throw CliErrors[_0x1603f3(0x10d)](_0x1603f3(0x11b));const _0x5e1f36=normalizeManifestFiles(_0x4a9320[_0x1603f3(0x126)]);if(!_0x5e1f36[_0x1603f3(0x115)](_0xa8de07=>_0xa8de07[_0x1603f3(0x133)]===SKILL_FILE))throw CliErrors[_0x1603f3(0x10d)](_0x1603f3(0x124)+SKILL_FILE+'.');const _0x4702f0=fileTreeHash(_0x5e1f36);if(_0x4702f0!==_0x4a9320[_0x1603f3(0x10e)]['toLowerCase']())throw CliErrors['validation'](_0x1603f3(0x111));return{'schemaVersion':Number[_0x1603f3(0x11d)](_0x4a9320['schemaVersion'])?_0x4a9320['schemaVersion']:0x2,'ossPath':_0x47a3c8,'treeSha256':_0x4702f0,'zipSha256':_0x4a9320[_0x1603f3(0x10c)][_0x1603f3(0x119)](),'zipSize':_0x4a9320['zipSize'],'files':_0x5e1f36};}function extractAndVerifyPackage(_0x36860c,_0x1a4277){const _0x182a21=a148_0xb748,_0x372ecc=normalizePackageManifest(_0x36860c,{'requireOssPath':![]});if(!_0x372ecc)throw CliErrors[_0x182a21(0x10d)](_0x182a21(0x110));if(_0x1a4277[_0x182a21(0x11f)]!==_0x372ecc[_0x182a21(0x12b)])throw CliErrors[_0x182a21(0x10d)]('Runtime\x20Skill\x20package\x20size\x20mismatch.');const _0x37fd07=bufferSha256(_0x1a4277);if(_0x37fd07!==_0x372ecc[_0x182a21(0x10c)])throw CliErrors['validation'](_0x182a21(0x112));return extractAndVerifyPackageFiles(_0x372ecc,_0x1a4277);}function extractAndVerifyPackageFiles(_0xfb8529,_0x3014d8){const _0x42f3d2=a148_0xb748,_0x4d6740=parseZipPackage(_0x3014d8);if(_0x4d6740[_0x42f3d2(0x11f)]!==_0xfb8529[_0x42f3d2(0x126)][_0x42f3d2(0x11f)])throw CliErrors[_0x42f3d2(0x10d)](_0x42f3d2(0x121));const _0x2d6697=new Map();for(const _0x34699d of _0x4d6740){if(_0x2d6697[_0x42f3d2(0x108)](_0x34699d[_0x42f3d2(0x133)]))throw CliErrors[_0x42f3d2(0x10d)](_0x42f3d2(0x106)+_0x34699d[_0x42f3d2(0x133)]);_0x2d6697['set'](_0x34699d[_0x42f3d2(0x133)],_0x34699d);}const _0x589735=[];for(const _0x28add5 of _0xfb8529[_0x42f3d2(0x126)]){const _0x17eca1=_0x2d6697[_0x42f3d2(0x129)](_0x28add5[_0x42f3d2(0x133)]);if(!_0x17eca1)throw CliErrors['validation'](_0x42f3d2(0x131)+_0x28add5['path']);if(_0x17eca1[_0x42f3d2(0x120)][_0x42f3d2(0x11f)]!==_0x28add5[_0x42f3d2(0x128)])throw CliErrors[_0x42f3d2(0x10d)](_0x42f3d2(0x12d)+_0x28add5[_0x42f3d2(0x133)]);const _0x38aa6d=bufferSha256(_0x17eca1[_0x42f3d2(0x120)]);if(_0x38aa6d!==_0x28add5[_0x42f3d2(0x107)])throw CliErrors[_0x42f3d2(0x10d)]('Runtime\x20Skill\x20package\x20file\x20sha256\x20mismatch:\x20'+_0x28add5[_0x42f3d2(0x133)]);_0x589735[_0x42f3d2(0x12f)]({'path':_0x28add5['path'],'bytes':_0x17eca1[_0x42f3d2(0x120)]});}return normalizeLocalFiles(_0x589735);}
1
+ (function(_0x1b21ec,_0x501463){const _0x505156=a148_0x186e,_0xa44d80=_0x1b21ec();while(!![]){try{const _0x4c58a4=-parseInt(_0x505156(0x1bd))/0x1+parseInt(_0x505156(0x1b4))/0x2+parseInt(_0x505156(0x194))/0x3*(-parseInt(_0x505156(0x1ab))/0x4)+parseInt(_0x505156(0x1a2))/0x5+-parseInt(_0x505156(0x1b6))/0x6*(-parseInt(_0x505156(0x198))/0x7)+parseInt(_0x505156(0x1ad))/0x8+-parseInt(_0x505156(0x19e))/0x9;if(_0x4c58a4===_0x501463)break;else _0xa44d80['push'](_0xa44d80['shift']());}catch(_0x5b4f38){_0xa44d80['push'](_0xa44d80['shift']());}}}(a148_0x47e9,0x943b0));function a148_0x47e9(){const _0x4c33c3=['zipSize','285rjsXwr','map','zipSha256','Runtime\x20Skill\x20package\x20file\x20sha256\x20mismatch:\x20','6620971bNzXzo','Runtime\x20Skill\x20package\x20is\x20missing\x20','string','toString','requireOssPath','Runtime\x20Skill\x20package\x20size\x20mismatch.','2827890TsfUdE','get','Runtime\x20Skill\x20package\x20file\x20size\x20mismatch:\x20','ossPath','4068390ucbIYn','Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.','has','Runtime\x20Skill\x20package\x20is\x20missing\x20entry:\x20','length','schemaVersion','Runtime\x20Skill\x20package\x20sha256\x20mismatch.','Runtime\x20Skill\x20package\x20size\x20is\x20invalid.','push','7856OcnFqI','toLowerCase','931496QZTpBO','some','isArray','base64','treeSha256','Runtime\x20Skill\x20package\x20sha256\x20is\x20invalid.','files','160410oZOTzz','Runtime\x20Skill\x20manifest\x20is\x20missing\x20','6lNCIGI','Runtime\x20Skill\x20file\x20tree\x20sha256\x20is\x20invalid.','bytes','size','validation','isSafeInteger','Runtime\x20Skill\x20package\x20entry\x20list\x20mismatch.','848231tNMuxb','path','Missing\x20','sha256'];a148_0x47e9=function(){return _0x4c33c3;};return a148_0x47e9();}import{CliErrors}from'../../errors.js';import{SKILL_FILE}from'./constants.js';import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';import{fileContent,isSha256Hex,normalizeLocalFiles,normalizeManifestFiles}from'./local-files.js';import{createDeterministicZipPackage,parseZipPackage}from'./zip-codec.js';export function buildSkillPackage(_0x5d0641){const _0x3676b5=a148_0x186e,_0x49023c=normalizeLocalFiles(_0x5d0641);if(!_0x49023c[_0x3676b5(0x1ae)](_0x5d818c=>_0x5d818c[_0x3676b5(0x1be)]===SKILL_FILE))throw CliErrors[_0x3676b5(0x1ba)](_0x3676b5(0x1bf)+SKILL_FILE+'\x20in\x20Skill\x20file\x20package.');const _0x5dbab7=localFilesToManifestFiles(_0x49023c),_0x5e8cbc=createDeterministicZipPackage(_0x49023c);return{'manifest':{'schemaVersion':0x2,'treeSha256':fileTreeHash(_0x5dbab7),'zipSha256':bufferSha256(_0x5e8cbc),'zipSize':_0x5e8cbc[_0x3676b5(0x1a6)],'files':_0x5dbab7},'packageBytes':_0x5e8cbc,'packageBase64':_0x5e8cbc[_0x3676b5(0x19b)](_0x3676b5(0x1b0))};}export function verifyRuntimeSkillPackage(_0x50f1d9,_0x1f593d){const _0x113c17=a148_0x186e,_0x240259=normalizePackageManifest(_0x50f1d9,{'requireOssPath':![]});if(!_0x240259)throw CliErrors[_0x113c17(0x1ba)](_0x113c17(0x1a3));return extractAndVerifyPackage(_0x240259,_0x1f593d);}export function verifyRuntimeSkillBundle(_0x2dabc7,_0x4b68e4){const _0x2fa706=a148_0x186e,_0x99bfaa=normalizePackageManifest(_0x2dabc7,{'requireOssPath':![]});if(!_0x99bfaa)throw CliErrors[_0x2fa706(0x1ba)]('Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.');return extractAndVerifyPackageFiles(_0x99bfaa,_0x4b68e4);}export function tryNormalizePackageManifest(_0x468db8){return normalizePackageManifest(_0x468db8,{'requireOssPath':![]});}function a148_0x186e(_0x10b502,_0x3b0e53){_0x10b502=_0x10b502-0x194;const _0x47e963=a148_0x47e9();let _0x186e4d=_0x47e963[_0x10b502];return _0x186e4d;}export function requirePackageBytes(_0x12f0b9,_0x443108){const _0x3269a8=a148_0x186e;if(!_0x443108||_0x443108['length']===0x0)throw CliErrors[_0x3269a8(0x1ba)]('Runtime\x20Skill\x20package\x20is\x20required\x20for\x20Skill\x20install:\x20'+_0x12f0b9);return _0x443108;}export function extractDownloadedPackage(_0x565f07){const _0x23fa03=a148_0x186e,_0xe2d36b=parseZipPackage(_0x565f07)[_0x23fa03(0x195)](_0x3bf279=>({'path':_0x3bf279[_0x23fa03(0x1be)],'bytes':_0x3bf279[_0x23fa03(0x1b8)]}));if(!_0xe2d36b[_0x23fa03(0x1ae)](_0x42a75c=>_0x42a75c[_0x23fa03(0x1be)]===SKILL_FILE))throw CliErrors[_0x23fa03(0x1ba)](_0x23fa03(0x199)+SKILL_FILE+'.');return normalizeLocalFiles(_0xe2d36b);}export function localFilesToManifestFiles(_0x503633){const _0x1117e7=a148_0x186e;return normalizeLocalFiles(_0x503633)[_0x1117e7(0x195)](_0x1615be=>({'path':_0x1615be['path'],'sha256':fileHash(_0x1615be),'size':fileContent(_0x1615be)[_0x1117e7(0x1a6)]}));}function normalizePackageManifest(_0x3cc310,_0x3e4edf){const _0x20eb5a=a148_0x186e;if(!_0x3cc310||typeof _0x3cc310!=='object'||Array['isArray'](_0x3cc310))return undefined;const _0x5d4057=_0x3cc310,_0x162af3=typeof _0x5d4057[_0x20eb5a(0x1a1)]===_0x20eb5a(0x19a)?_0x5d4057[_0x20eb5a(0x1a1)]['trim']():undefined;if(_0x3e4edf[_0x20eb5a(0x19c)]&&!_0x162af3)return undefined;if(!Array[_0x20eb5a(0x1af)](_0x5d4057[_0x20eb5a(0x1b3)])||_0x5d4057[_0x20eb5a(0x1b3)][_0x20eb5a(0x1a6)]===0x0)return undefined;if(!isSha256Hex(_0x5d4057[_0x20eb5a(0x1b1)]))throw CliErrors[_0x20eb5a(0x1ba)](_0x20eb5a(0x1b7));if(!isSha256Hex(_0x5d4057['zipSha256']))throw CliErrors[_0x20eb5a(0x1ba)](_0x20eb5a(0x1b2));if(!Number[_0x20eb5a(0x1bb)](_0x5d4057[_0x20eb5a(0x1c1)])||_0x5d4057[_0x20eb5a(0x1c1)]<0x0)throw CliErrors['validation'](_0x20eb5a(0x1a9));const _0x271118=normalizeManifestFiles(_0x5d4057[_0x20eb5a(0x1b3)]);if(!_0x271118[_0x20eb5a(0x1ae)](_0x32dff1=>_0x32dff1[_0x20eb5a(0x1be)]===SKILL_FILE))throw CliErrors['validation'](_0x20eb5a(0x1b5)+SKILL_FILE+'.');const _0x575193=fileTreeHash(_0x271118);if(_0x575193!==_0x5d4057[_0x20eb5a(0x1b1)]['toLowerCase']())throw CliErrors[_0x20eb5a(0x1ba)]('Runtime\x20Skill\x20file\x20tree\x20sha256\x20mismatch.');return{'schemaVersion':Number['isSafeInteger'](_0x5d4057['schemaVersion'])?_0x5d4057[_0x20eb5a(0x1a7)]:0x2,'ossPath':_0x162af3,'treeSha256':_0x575193,'zipSha256':_0x5d4057[_0x20eb5a(0x196)][_0x20eb5a(0x1ac)](),'zipSize':_0x5d4057[_0x20eb5a(0x1c1)],'files':_0x271118};}function extractAndVerifyPackage(_0x2f3f1b,_0x29bd55){const _0x14377f=a148_0x186e,_0x166a33=normalizePackageManifest(_0x2f3f1b,{'requireOssPath':![]});if(!_0x166a33)throw CliErrors[_0x14377f(0x1ba)](_0x14377f(0x1a3));if(_0x29bd55[_0x14377f(0x1a6)]!==_0x166a33[_0x14377f(0x1c1)])throw CliErrors[_0x14377f(0x1ba)](_0x14377f(0x19d));const _0x48b258=bufferSha256(_0x29bd55);if(_0x48b258!==_0x166a33['zipSha256'])throw CliErrors[_0x14377f(0x1ba)](_0x14377f(0x1a8));return extractAndVerifyPackageFiles(_0x166a33,_0x29bd55);}function extractAndVerifyPackageFiles(_0x15a730,_0x3e6bf0){const _0xfd19c=a148_0x186e,_0x2fe36d=parseZipPackage(_0x3e6bf0);if(_0x2fe36d['length']!==_0x15a730[_0xfd19c(0x1b3)]['length'])throw CliErrors[_0xfd19c(0x1ba)](_0xfd19c(0x1bc));const _0x19bd9e=new Map();for(const _0x30da2b of _0x2fe36d){if(_0x19bd9e[_0xfd19c(0x1a4)](_0x30da2b[_0xfd19c(0x1be)]))throw CliErrors[_0xfd19c(0x1ba)]('Duplicate\x20Skill\x20package\x20entry:\x20'+_0x30da2b['path']);_0x19bd9e['set'](_0x30da2b[_0xfd19c(0x1be)],_0x30da2b);}const _0x3fcae5=[];for(const _0x79ceb9 of _0x15a730[_0xfd19c(0x1b3)]){const _0x4d1070=_0x19bd9e[_0xfd19c(0x19f)](_0x79ceb9[_0xfd19c(0x1be)]);if(!_0x4d1070)throw CliErrors[_0xfd19c(0x1ba)](_0xfd19c(0x1a5)+_0x79ceb9[_0xfd19c(0x1be)]);if(_0x4d1070[_0xfd19c(0x1b8)][_0xfd19c(0x1a6)]!==_0x79ceb9[_0xfd19c(0x1b9)])throw CliErrors[_0xfd19c(0x1ba)](_0xfd19c(0x1a0)+_0x79ceb9[_0xfd19c(0x1be)]);const _0x3a2657=bufferSha256(_0x4d1070[_0xfd19c(0x1b8)]);if(_0x3a2657!==_0x79ceb9[_0xfd19c(0x1c0)])throw CliErrors[_0xfd19c(0x1ba)](_0xfd19c(0x197)+_0x79ceb9['path']);_0x3fcae5[_0xfd19c(0x1aa)]({'path':_0x79ceb9['path'],'bytes':_0x4d1070[_0xfd19c(0x1b8)]});}return normalizeLocalFiles(_0x3fcae5);}
@@ -1 +1 @@
1
- (function(_0x5ec96b,_0xb2c6bf){var _0x46e2c8=a149_0x2614,_0x1a15fd=_0x5ec96b();while(!![]){try{var _0x399145=parseInt(_0x46e2c8(0xde))/0x1*(parseInt(_0x46e2c8(0xdc))/0x2)+-parseInt(_0x46e2c8(0xe0))/0x3+-parseInt(_0x46e2c8(0xdb))/0x4*(-parseInt(_0x46e2c8(0xe2))/0x5)+parseInt(_0x46e2c8(0xe3))/0x6+-parseInt(_0x46e2c8(0xe1))/0x7*(parseInt(_0x46e2c8(0xe4))/0x8)+parseInt(_0x46e2c8(0xe5))/0x9+-parseInt(_0x46e2c8(0xdf))/0xa*(-parseInt(_0x46e2c8(0xdd))/0xb);if(_0x399145===_0xb2c6bf)break;else _0x1a15fd['push'](_0x1a15fd['shift']());}catch(_0x22f38d){_0x1a15fd['push'](_0x1a15fd['shift']());}}}(a149_0x3a3d,0xd34a5));export{contentHash,fileTreeHash}from'./runtime-skill-sync/hashing.js';export{linkEffectiveRuntimeSkills,linkGlobalRuntimeSkills,pruneStaleRuntimeSkillCache,pruneStaleRuntimeSkillLinks}from'./runtime-skill-sync/links.js';export{resolveRuntimeSkillInstallTarget}from'./runtime-skill-sync/install-target.js';export{listLocalRuntimeSkills}from'./runtime-skill-sync/list-local.js';function a149_0x3a3d(){var _0x4aee5=['49zfTDBt','1795NdAyWC','666318NPLtFb','277432JhioFa','4597722ouAeeB','9056GRNcew','4682QWiRLg','11PRAFLr','111IvhPZx','492280tzewDb','1906704wQxZrG'];a149_0x3a3d=function(){return _0x4aee5;};return a149_0x3a3d();}export{materializeRuntimeSkill,reuseMaterializedRuntimeSkill}from'./runtime-skill-sync/materialize.js';function a149_0x2614(_0x26d38f,_0x20366d){_0x26d38f=_0x26d38f-0xdb;var _0x3a3d63=a149_0x3a3d();var _0x2614f8=_0x3a3d63[_0x26d38f];return _0x2614f8;}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(_0x4e9406,_0x43f692){var _0x2ae2f3=a149_0x2a9b,_0x2260c1=_0x4e9406();while(!![]){try{var _0x2fd836=parseInt(_0x2ae2f3(0xc5))/0x1+-parseInt(_0x2ae2f3(0xc1))/0x2+-parseInt(_0x2ae2f3(0xc7))/0x3+parseInt(_0x2ae2f3(0xc6))/0x4*(parseInt(_0x2ae2f3(0xc4))/0x5)+parseInt(_0x2ae2f3(0xc3))/0x6*(parseInt(_0x2ae2f3(0xc2))/0x7)+-parseInt(_0x2ae2f3(0xc0))/0x8+parseInt(_0x2ae2f3(0xc8))/0x9;if(_0x2fd836===_0x43f692)break;else _0x2260c1['push'](_0x2260c1['shift']());}catch(_0x4c96ba){_0x2260c1['push'](_0x2260c1['shift']());}}}(a149_0x3544,0x85443));export{contentHash,fileTreeHash}from'./runtime-skill-sync/hashing.js';export{linkEffectiveRuntimeSkills,linkGlobalRuntimeSkills,pruneStaleRuntimeSkillCache,pruneStaleRuntimeSkillLinks}from'./runtime-skill-sync/links.js';function a149_0x2a9b(_0xaffa4b,_0x438d31){_0xaffa4b=_0xaffa4b-0xc0;var _0x354468=a149_0x3544();var _0x2a9b3c=_0x354468[_0xaffa4b];return _0x2a9b3c;}export{resolveRuntimeSkillInstallTarget}from'./runtime-skill-sync/install-target.js';export{listLocalRuntimeSkills}from'./runtime-skill-sync/list-local.js';function a149_0x3544(){var _0x1582d8=['648jREaSQ','1652415NQdwvH','898172uVCvVX','4CvucpE','1900656AXCrVB','6691338UwiioV','2072064QLcYjO','1665108TmxnuQ','19369zPzEXV'];a149_0x3544=function(){return _0x1582d8;};return a149_0x3544();}export{materializeRuntimeSkill,reuseMaterializedRuntimeSkill}from'./runtime-skill-sync/materialize.js';export{readMetadataIfPresent}from'./runtime-skill-sync/metadata.js';export{getRuntimeSkillCacheRoot,getRuntimeSkillDir,resolveSkillSyncPaths,runtimeAgentSkillRoots}from'./runtime-skill-sync/paths.js';export{deriveSkillCodeFromDirectory,readPushDirectory,refreshPushDirectoryMetadataFromRemote,recordPushedRuntimeSkill,resolvePushDirectoryIdentity}from'./runtime-skill-sync/push.js';export{buildSkillPackage,verifyRuntimeSkillBundle,verifyRuntimeSkillPackage}from'./runtime-skill-sync/zip-package.js';