@lovrabet/lovrabet-cli 2.3.0-beta.3 → 2.3.0-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (164) hide show
  1. package/lib/cli.js +1 -1
  2. package/lib/commands/api-doc/index.js +1 -1
  3. package/lib/commands/app/cache.js +1 -1
  4. package/lib/commands/app/definitions.js +1 -1
  5. package/lib/commands/app/eligibility.js +1 -1
  6. package/lib/commands/app/mock-loader.js +1 -1
  7. package/lib/commands/app/remote-source.js +1 -1
  8. package/lib/commands/app/shared.js +1 -1
  9. package/lib/commands/app-config/get.js +1 -1
  10. package/lib/commands/app-config/index.js +1 -1
  11. package/lib/commands/artifact/index.js +1 -1
  12. package/lib/commands/auth/device.js +1 -1
  13. package/lib/commands/auth/index.js +1 -1
  14. package/lib/commands/auth/prompt.js +1 -1
  15. package/lib/commands/bff/detail.js +1 -1
  16. package/lib/commands/bff/exec.js +1 -1
  17. package/lib/commands/bff/index.js +1 -1
  18. package/lib/commands/cli-skill/index.js +1 -1
  19. package/lib/commands/common/config-policy.js +1 -1
  20. package/lib/commands/common/constraints.js +1 -1
  21. package/lib/commands/common/flags.js +1 -1
  22. package/lib/commands/common/local-file.js +1 -1
  23. package/lib/commands/config/definitions.js +1 -1
  24. package/lib/commands/config/init.js +1 -1
  25. package/lib/commands/config/shared.js +1 -1
  26. package/lib/commands/data/index.js +1 -1
  27. package/lib/commands/dataset/detail.js +1 -1
  28. package/lib/commands/dataset/index.js +1 -1
  29. package/lib/commands/dataset/list.js +1 -1
  30. package/lib/commands/dataset/sdk-doc.js +1 -1
  31. package/lib/commands/doctor.js +1 -1
  32. package/lib/commands/file/index.js +1 -1
  33. package/lib/commands/init.js +1 -1
  34. package/lib/commands/kb/index.js +1 -1
  35. package/lib/commands/logs/index.js +1 -1
  36. package/lib/commands/notification/config-list.js +1 -1
  37. package/lib/commands/notification/index.js +1 -1
  38. package/lib/commands/notification/shared.js +1 -1
  39. package/lib/commands/ocr/index.js +1 -1
  40. package/lib/commands/permit/dataset-get.js +1 -1
  41. package/lib/commands/permit/dataset-set.js +1 -1
  42. package/lib/commands/permit/index.js +1 -1
  43. package/lib/commands/permit/page-get.js +1 -1
  44. package/lib/commands/permit/page-set.js +1 -1
  45. package/lib/commands/permit/role-menus-set.js +1 -1
  46. package/lib/commands/permit/role-menus.js +1 -1
  47. package/lib/commands/permit/shared.js +1 -1
  48. package/lib/commands/personal-bff/index.js +1 -1
  49. package/lib/commands/registry.js +1 -1
  50. package/lib/commands/role/create.js +1 -1
  51. package/lib/commands/role/delete.js +1 -1
  52. package/lib/commands/role/detail.js +1 -1
  53. package/lib/commands/role/index.js +1 -1
  54. package/lib/commands/role/list.js +1 -1
  55. package/lib/commands/role/shared.js +1 -1
  56. package/lib/commands/role/update.js +1 -1
  57. package/lib/commands/role/user-add.js +1 -1
  58. package/lib/commands/role/user-remove.js +1 -1
  59. package/lib/commands/schedule/index.js +1 -1
  60. package/lib/commands/schema.js +1 -1
  61. package/lib/commands/service/dynamic.js +1 -1
  62. package/lib/commands/service/function-name-adapter.js +1 -1
  63. package/lib/commands/service/index.js +1 -1
  64. package/lib/commands/service/registry.js +1 -1
  65. package/lib/commands/skill/commands/create.js +1 -1
  66. package/lib/commands/skill/commands/diagram.js +1 -1
  67. package/lib/commands/skill/commands/install.js +1 -1
  68. package/lib/commands/skill/commands/list.js +1 -1
  69. package/lib/commands/skill/commands/push.js +1 -1
  70. package/lib/commands/skill/commands/validate.js +1 -1
  71. package/lib/commands/skill/diagram.js +1 -1
  72. package/lib/commands/skill/flags.js +1 -1
  73. package/lib/commands/skill/index.js +1 -1
  74. package/lib/commands/skill/manifest-helpers.js +1 -1
  75. package/lib/commands/skill/push-execute.js +1 -1
  76. package/lib/commands/skill/push-flow-helpers.js +1 -1
  77. package/lib/commands/skill/push-retarget.js +1 -1
  78. package/lib/commands/skill/scopes.js +1 -1
  79. package/lib/commands/skill/summary.js +1 -1
  80. package/lib/commands/skill/templates.js +1 -1
  81. package/lib/commands/skill/validate.js +1 -1
  82. package/lib/commands/sql/detail.js +1 -1
  83. package/lib/commands/sql/exec.js +1 -1
  84. package/lib/commands/sql/index.js +1 -1
  85. package/lib/commands/update.js +1 -1
  86. package/lib/commands/user-account/bind.js +1 -1
  87. package/lib/commands/user-account/index.js +1 -1
  88. package/lib/commands/workspace/index.js +1 -1
  89. package/lib/config/domain-config.js +1 -1
  90. package/lib/config/schema.js +1 -1
  91. package/lib/constant/app.js +1 -1
  92. package/lib/constant/auth-mode.js +1 -1
  93. package/lib/constant/cli.js +1 -1
  94. package/lib/constant/defaults.js +1 -1
  95. package/lib/constant/distribution.js +1 -1
  96. package/lib/constant/domain.js +1 -1
  97. package/lib/constant/env.js +1 -1
  98. package/lib/constant/output.js +1 -1
  99. package/lib/constant/product.js +1 -1
  100. package/lib/constant/region.js +1 -1
  101. package/lib/constant/risk.js +1 -1
  102. package/lib/constant/url.js +1 -1
  103. package/lib/context.js +1 -1
  104. package/lib/core/api-client.js +1 -1
  105. package/lib/core/db-resolver.js +1 -1
  106. package/lib/core/sdk-client.js +1 -1
  107. package/lib/errors.js +1 -1
  108. package/lib/framework/build-all-flags.js +1 -1
  109. package/lib/framework/dryrun.js +1 -1
  110. package/lib/framework/flags.js +1 -1
  111. package/lib/framework/help.js +1 -1
  112. package/lib/framework/index.js +1 -1
  113. package/lib/framework/output.js +1 -1
  114. package/lib/framework/preparse.js +1 -1
  115. package/lib/framework/rate-limit.js +1 -1
  116. package/lib/framework/raw-flags.js +1 -1
  117. package/lib/framework/response.js +1 -1
  118. package/lib/framework/runner-confirmation.js +1 -1
  119. package/lib/framework/runner-error.js +1 -1
  120. package/lib/framework/runner.js +1 -1
  121. package/lib/framework/schema-export.js +1 -1
  122. package/lib/framework/service-order.js +1 -1
  123. package/lib/framework/types.js +1 -1
  124. package/lib/generated/build-info.d.ts +4 -4
  125. package/lib/generated/build-info.js +1 -1
  126. package/lib/help.js +1 -1
  127. package/lib/postinstall.js +1 -1
  128. package/lib/runtime/confirmation.js +1 -1
  129. package/lib/runtime/event.js +1 -1
  130. package/lib/runtime/index.js +1 -1
  131. package/lib/runtime/queue.js +1 -1
  132. package/lib/runtime/resolve.js +1 -1
  133. package/lib/skills/builtin-skill.js +1 -1
  134. package/lib/skills/npx-skills-add.js +1 -1
  135. package/lib/skills/runtime-skill-sync/constants.js +1 -1
  136. package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
  137. package/lib/skills/runtime-skill-sync/hashing.js +1 -1
  138. package/lib/skills/runtime-skill-sync/install-target.js +1 -1
  139. package/lib/skills/runtime-skill-sync/links.js +1 -1
  140. package/lib/skills/runtime-skill-sync/list-local.js +1 -1
  141. package/lib/skills/runtime-skill-sync/local-files.js +1 -1
  142. package/lib/skills/runtime-skill-sync/materialize.js +1 -1
  143. package/lib/skills/runtime-skill-sync/metadata.js +1 -1
  144. package/lib/skills/runtime-skill-sync/paths.js +1 -1
  145. package/lib/skills/runtime-skill-sync/push.js +1 -1
  146. package/lib/skills/runtime-skill-sync/scopes.js +1 -1
  147. package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
  148. package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
  149. package/lib/skills/runtime-skill-sync.js +1 -1
  150. package/lib/skills/skill-presence.js +1 -1
  151. package/lib/utils/access-key-redaction.js +1 -1
  152. package/lib/utils/apply-jq-filter.js +1 -1
  153. package/lib/utils/cli-version-check.js +1 -1
  154. package/lib/utils/cli-version-policy.js +1 -1
  155. package/lib/utils/logger.js +1 -1
  156. package/lib/utils/lossless-json.js +1 -1
  157. package/lib/utils/params.js +1 -1
  158. package/lib/utils/platform.js +1 -1
  159. package/lib/utils/update-notice.js +1 -1
  160. package/lib/utils/version.js +1 -1
  161. package/lib/utils/write-cli-side-channel.js +1 -1
  162. package/package.json +1 -1
  163. package/skills/lovrabet/SKILL.md +1 -1
  164. package/skills/lovrabet.manifest.json +3 -3
@@ -1 +1 @@
1
- function a134_0x3d07(){const _0xcf3628=['lovrabet.skill.json','.svn','3347541AfjWwC','node_modules','SKILL.md','.hg','dist','coverage','.turbo','4521zwTVMk','.git','7VlnxgI','5390560GVnRaq','10wtvoMG','.next','1582322OIXhzP','1263237tXheti','402816ZSFdYj','4wGOZsa','32Aewdyg','5528592QnssHE','build','.DS_Store','.cache'];a134_0x3d07=function(){return _0xcf3628;};return a134_0x3d07();}function a134_0x27e9(_0x5b04a4,_0x401958){_0x5b04a4=_0x5b04a4-0x1d7;const _0x3d0732=a134_0x3d07();let _0x27e9a1=_0x3d0732[_0x5b04a4];return _0x27e9a1;}const a134_0x4662c6=a134_0x27e9;(function(_0x27bbef,_0x25091f){const _0x5d3f0c=a134_0x27e9,_0x8b7314=_0x27bbef();while(!![]){try{const _0x542376=parseInt(_0x5d3f0c(0x1e6))/0x1+-parseInt(_0x5d3f0c(0x1e4))/0x2+-parseInt(_0x5d3f0c(0x1e5))/0x3*(parseInt(_0x5d3f0c(0x1e7))/0x4)+parseInt(_0x5d3f0c(0x1e1))/0x5+parseInt(_0x5d3f0c(0x1e9))/0x6*(-parseInt(_0x5d3f0c(0x1e0))/0x7)+parseInt(_0x5d3f0c(0x1e8))/0x8*(parseInt(_0x5d3f0c(0x1d7))/0x9)+parseInt(_0x5d3f0c(0x1e2))/0xa*(parseInt(_0x5d3f0c(0x1de))/0xb);if(_0x542376===_0x25091f)break;else _0x8b7314['push'](_0x8b7314['shift']());}catch(_0x30ae9a){_0x8b7314['push'](_0x8b7314['shift']());}}}(a134_0x3d07,0xcbf87));export const METADATA_FILE=a134_0x4662c6(0x1ed);export const SKILL_FILE=a134_0x4662c6(0x1d9);export const IGNORED_FILE_NAMES=new Set([METADATA_FILE,a134_0x4662c6(0x1eb)]);export const IGNORED_DIR_NAMES=new Set([a134_0x4662c6(0x1df),a134_0x4662c6(0x1da),a134_0x4662c6(0x1ee),a134_0x4662c6(0x1d8),a134_0x4662c6(0x1e3),a134_0x4662c6(0x1db),a134_0x4662c6(0x1ea),a134_0x4662c6(0x1dc),a134_0x4662c6(0x1dd),a134_0x4662c6(0x1ec)]);
1
+ const a134_0x333826=a134_0x1c9a;(function(_0x3186e5,_0x3e4518){const _0x290b72=a134_0x1c9a,_0x3500ba=_0x3186e5();while(!![]){try{const _0x12fb63=-parseInt(_0x290b72(0x169))/0x1+-parseInt(_0x290b72(0x16e))/0x2*(-parseInt(_0x290b72(0x163))/0x3)+-parseInt(_0x290b72(0x167))/0x4+-parseInt(_0x290b72(0x165))/0x5*(parseInt(_0x290b72(0x176))/0x6)+parseInt(_0x290b72(0x16b))/0x7*(-parseInt(_0x290b72(0x173))/0x8)+-parseInt(_0x290b72(0x174))/0x9*(parseInt(_0x290b72(0x177))/0xa)+-parseInt(_0x290b72(0x16f))/0xb*(-parseInt(_0x290b72(0x162))/0xc);if(_0x12fb63===_0x3e4518)break;else _0x3500ba['push'](_0x3500ba['shift']());}catch(_0x273f5e){_0x3500ba['push'](_0x3500ba['shift']());}}}(a134_0x3317,0x96f95));function a134_0x3317(){const _0x56e6e2=['.turbo','build','136raRuHJ','3546aVdtlL','.hg','6XRREBb','27330rPaVKr','684wfLFrh','3qSNZyE','node_modules','2539885FIvBmL','lovrabet.skill.json','87676IpXpEN','SKILL.md','668008rEQLaC','dist','255514jjHrJn','coverage','.cache','398386DuYpWC','639628ZPJVCZ','.svn'];a134_0x3317=function(){return _0x56e6e2;};return a134_0x3317();}export const METADATA_FILE=a134_0x333826(0x166);export const SKILL_FILE=a134_0x333826(0x168);export const IGNORED_FILE_NAMES=new Set([METADATA_FILE,'.DS_Store']);function a134_0x1c9a(_0x2cf82e,_0x4e14e7){_0x2cf82e=_0x2cf82e-0x162;const _0x331719=a134_0x3317();let _0x1c9a90=_0x331719[_0x2cf82e];return _0x1c9a90;}export const IGNORED_DIR_NAMES=new Set(['.git',a134_0x333826(0x175),a134_0x333826(0x170),a134_0x333826(0x164),'.next',a134_0x333826(0x16a),a134_0x333826(0x172),a134_0x333826(0x16c),a134_0x333826(0x171),a134_0x333826(0x16d)]);
@@ -1 +1 @@
1
- (function(_0x139931,_0x356071){const _0x595782=a135_0x5459,_0x258c69=_0x139931();while(!![]){try{const _0x575b30=-parseInt(_0x595782(0x1fa))/0x1+-parseInt(_0x595782(0x1ff))/0x2*(parseInt(_0x595782(0x1fb))/0x3)+-parseInt(_0x595782(0x1f2))/0x4*(-parseInt(_0x595782(0x1f1))/0x5)+-parseInt(_0x595782(0x1fc))/0x6+-parseInt(_0x595782(0x1f3))/0x7*(parseInt(_0x595782(0x1f8))/0x8)+parseInt(_0x595782(0x1fd))/0x9*(-parseInt(_0x595782(0x203))/0xa)+parseInt(_0x595782(0x1f0))/0xb;if(_0x575b30===_0x356071)break;else _0x258c69['push'](_0x258c69['shift']());}catch(_0x3df783){_0x258c69['push'](_0x258c69['shift']());}}}(a135_0x1a3c,0x6f6f0));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(_0x4d0f20,_0x50fcd6){const _0x434c71=a135_0x5459,_0x2efb7e=normalizeSkillRelativePath(_0x50fcd6),_0x2193fa=realOrResolved(_0x4d0f20),_0x414570=resolve(_0x2193fa,..._0x2efb7e[_0x434c71(0x1f6)]('/'));if(!isPathInside(_0x414570,_0x2193fa))throw CliErrors[_0x434c71(0x1fe)](_0x434c71(0x1f4)+_0x50fcd6);return ensureNoSymlinkInManagedPath(_0x2193fa,_0x2efb7e),_0x414570;}function a135_0x1a3c(){const _0x3e73f5=['190YzUZDg','46792XMPVmP','2961308UhQoDc','Unsafe\x20Skill\x20file\x20path:\x20','from','split','isSymbolicLink','8RLBSvH','Refusing\x20to\x20write\x20through\x20Skill\x20symlink\x20path:\x20','656440nmbVJF','3JyhdPZ','3935286ZGRkXL','5758218HVoHZf','validation','1303314YKUaAE','stringify','endsWith','startsWith','10pZVnOV','33426052NrbftG'];a135_0x1a3c=function(){return _0x3e73f5;};return a135_0x1a3c();}export function ensureNoSymlinkInManagedPath(_0x2a9a14,_0x49b1e2){const _0x57c8ef=a135_0x5459;let _0x560850=_0x2a9a14;for(const _0x5911a3 of _0x49b1e2['split']('/')){_0x560850=resolve(_0x560850,_0x5911a3);const _0x25384e=lstatIfPresent(_0x560850);if(_0x25384e?.[_0x57c8ef(0x1f7)]())throw CliErrors[_0x57c8ef(0x1fe)](_0x57c8ef(0x1f9)+_0x49b1e2);}}export function isDanglingSymlink(_0x271e1e){const _0x3a6778=a135_0x5459;try{return lstatSync(_0x271e1e)[_0x3a6778(0x1f7)]();}catch{return![];}}function a135_0x5459(_0x1eaa4e,_0x2992ea){_0x1eaa4e=_0x1eaa4e-0x1f0;const _0x1a3c45=a135_0x1a3c();let _0x545952=_0x1a3c45[_0x1eaa4e];return _0x545952;}export function resolveSymlinkTarget(_0x163efe){const _0x35e4ef=readlinkSync(_0x163efe);return isAbsolute(_0x35e4ef)?_0x35e4ef:resolve(dirname(_0x163efe),_0x35e4ef);}export function isPathInside(_0x23e70d,_0x47a29d){const _0x5dd82e=a135_0x5459,_0x5909a8=_0x23e70d[_0x5dd82e(0x201)](sep)?_0x23e70d:''+_0x23e70d+sep,_0x3db53d=_0x47a29d[_0x5dd82e(0x201)](sep)?_0x47a29d:''+_0x47a29d+sep;return _0x23e70d===_0x47a29d||_0x5909a8[_0x5dd82e(0x202)](_0x3db53d);}export function realOrResolved(_0xd5921b){try{return realpathSync(_0xd5921b);}catch{return resolve(_0xd5921b);}}export function lstatIfPresent(_0x5a90a8){try{return lstatSync(_0x5a90a8);}catch{return undefined;}}export function writeTextAtomic(_0x1042a0,_0x355335,_0x34fbbc){const _0x408dec=a135_0x5459;writeBytesAtomic(_0x1042a0,Buffer[_0x408dec(0x1f5)](_0x355335,'utf8'),_0x34fbbc);}export function writeBytesAtomic(_0x321f0a,_0x260cce,_0x362260){const _0x4976e9=_0x321f0a+'.tmp';try{writeFileSync(_0x4976e9,_0x260cce,{'mode':_0x362260}),renameSync(_0x4976e9,_0x321f0a);}catch(_0x18b1f5){try{rmSync(_0x4976e9,{'force':!![]});}catch{}throw _0x18b1f5;}}export function writeJsonAtomic(_0x5c50b8,_0x12a354){const _0x5d3cdf=a135_0x5459;writeTextAtomic(_0x5c50b8,JSON[_0x5d3cdf(0x200)](_0x12a354,null,0x2)+'\x0a',0x180);}
1
+ (function(_0xb62d3b,_0x448c4c){const _0x3d18e5=a135_0x6f73,_0x28d102=_0xb62d3b();while(!![]){try{const _0x193458=-parseInt(_0x3d18e5(0x6b))/0x1*(-parseInt(_0x3d18e5(0x73))/0x2)+parseInt(_0x3d18e5(0x71))/0x3*(-parseInt(_0x3d18e5(0x76))/0x4)+parseInt(_0x3d18e5(0x74))/0x5+parseInt(_0x3d18e5(0x7b))/0x6*(-parseInt(_0x3d18e5(0x77))/0x7)+-parseInt(_0x3d18e5(0x7e))/0x8*(parseInt(_0x3d18e5(0x6c))/0x9)+-parseInt(_0x3d18e5(0x6e))/0xa+parseInt(_0x3d18e5(0x70))/0xb*(parseInt(_0x3d18e5(0x78))/0xc);if(_0x193458===_0x448c4c)break;else _0x28d102['push'](_0x28d102['shift']());}catch(_0x1553b2){_0x28d102['push'](_0x28d102['shift']());}}}(a135_0x27a2,0x6aa49));function a135_0x27a2(){const _0xf3bbf3=['.tmp','validation','11712evGttc','isSymbolicLink','utf8','16QLUiTI','Unsafe\x20Skill\x20file\x20path:\x20','672chwiMe','226863fcsaAu','split','8472430DlRwSt','stringify','8089356rHugYx','5214igDHaD','endsWith','592Eegxrg','2965800vMAxDT','Refusing\x20to\x20write\x20through\x20Skill\x20symlink\x20path:\x20','260HTtCuK','287Rlrxqc','12kicVeI'];a135_0x27a2=function(){return _0xf3bbf3;};return a135_0x27a2();}import{lstatSync,readlinkSync,realpathSync,renameSync,rmSync,writeFileSync}from'node:fs';import{dirname,isAbsolute,resolve,sep}from'node:path';import{CliErrors}from'../../errors.js';import{normalizeSkillRelativePath}from'./local-files.js';export function resolveManagedFilePath(_0x2d4134,_0xd8fb85){const _0x43be28=a135_0x6f73,_0x4f1f80=normalizeSkillRelativePath(_0xd8fb85),_0x2110f0=realOrResolved(_0x2d4134),_0x594052=resolve(_0x2110f0,..._0x4f1f80[_0x43be28(0x6d)]('/'));if(!isPathInside(_0x594052,_0x2110f0))throw CliErrors[_0x43be28(0x7a)](_0x43be28(0x7f)+_0xd8fb85);return ensureNoSymlinkInManagedPath(_0x2110f0,_0x4f1f80),_0x594052;}export function ensureNoSymlinkInManagedPath(_0x43a383,_0x4490c0){const _0x5619f9=a135_0x6f73;let _0x1facb3=_0x43a383;for(const _0x2ecfa7 of _0x4490c0['split']('/')){_0x1facb3=resolve(_0x1facb3,_0x2ecfa7);const _0x3a8f8f=lstatIfPresent(_0x1facb3);if(_0x3a8f8f?.[_0x5619f9(0x7c)]())throw CliErrors[_0x5619f9(0x7a)](_0x5619f9(0x75)+_0x4490c0);}}function a135_0x6f73(_0x6c4b1,_0x2bd6f7){_0x6c4b1=_0x6c4b1-0x6b;const _0x27a248=a135_0x27a2();let _0x6f7395=_0x27a248[_0x6c4b1];return _0x6f7395;}export function isDanglingSymlink(_0x5fda1d){const _0x78d0af=a135_0x6f73;try{return lstatSync(_0x5fda1d)[_0x78d0af(0x7c)]();}catch{return![];}}export function resolveSymlinkTarget(_0x1d8010){const _0x58ae41=readlinkSync(_0x1d8010);return isAbsolute(_0x58ae41)?_0x58ae41:resolve(dirname(_0x1d8010),_0x58ae41);}export function isPathInside(_0x13d25a,_0x38bb00){const _0x1855a4=a135_0x6f73,_0xd285ab=_0x13d25a[_0x1855a4(0x72)](sep)?_0x13d25a:''+_0x13d25a+sep,_0x277b8e=_0x38bb00[_0x1855a4(0x72)](sep)?_0x38bb00:''+_0x38bb00+sep;return _0x13d25a===_0x38bb00||_0xd285ab['startsWith'](_0x277b8e);}export function realOrResolved(_0x323f5d){try{return realpathSync(_0x323f5d);}catch{return resolve(_0x323f5d);}}export function lstatIfPresent(_0xc25288){try{return lstatSync(_0xc25288);}catch{return undefined;}}export function writeTextAtomic(_0x41de7e,_0x134963,_0x1cf1f0){const _0x47efb3=a135_0x6f73;writeBytesAtomic(_0x41de7e,Buffer['from'](_0x134963,_0x47efb3(0x7d)),_0x1cf1f0);}export function writeBytesAtomic(_0xbe56ef,_0xb4d9f3,_0x55fd25){const _0x45240a=a135_0x6f73,_0x5a1254=_0xbe56ef+_0x45240a(0x79);try{writeFileSync(_0x5a1254,_0xb4d9f3,{'mode':_0x55fd25}),renameSync(_0x5a1254,_0xbe56ef);}catch(_0xfcdf75){try{rmSync(_0x5a1254,{'force':!![]});}catch{}throw _0xfcdf75;}}export function writeJsonAtomic(_0xa069a2,_0x54c9c8){const _0x4ce9da=a135_0x6f73;writeTextAtomic(_0xa069a2,JSON[_0x4ce9da(0x6f)](_0x54c9c8,null,0x2)+'\x0a',0x180);}
@@ -1 +1 @@
1
- (function(_0x5aab52,_0x2937e2){const _0x3fb5e3=a136_0x2a7d,_0x106bce=_0x5aab52();while(!![]){try{const _0x4bfbc3=parseInt(_0x3fb5e3(0x161))/0x1+-parseInt(_0x3fb5e3(0x15e))/0x2*(parseInt(_0x3fb5e3(0x159))/0x3)+-parseInt(_0x3fb5e3(0x15b))/0x4+parseInt(_0x3fb5e3(0x15d))/0x5+parseInt(_0x3fb5e3(0x165))/0x6*(-parseInt(_0x3fb5e3(0x157))/0x7)+parseInt(_0x3fb5e3(0x160))/0x8+-parseInt(_0x3fb5e3(0x15a))/0x9*(-parseInt(_0x3fb5e3(0x156))/0xa);if(_0x4bfbc3===_0x2937e2)break;else _0x106bce['push'](_0x106bce['shift']());}catch(_0x269330){_0x106bce['push'](_0x106bce['shift']());}}}(a136_0x4167,0x58632));function a136_0x2a7d(_0xdfb767,_0x1e25d1){_0xdfb767=_0xdfb767-0x156;const _0x41676b=a136_0x4167();let _0x2a7dab=_0x41676b[_0xdfb767];return _0x2a7dab;}import{createHash}from'node:crypto';import{fileContent,normalizeManifestFiles}from'./local-files.js';export function contentHash(_0x1260e5){const _0x218408=a136_0x2a7d;return createHash(_0x218408(0x163))['update'](_0x1260e5)[_0x218408(0x15c)](_0x218408(0x15f));}export function fileHash(_0x5c75a9){return bufferSha256(fileContent(_0x5c75a9));}export function bufferSha256(_0x210cfc){const _0x4fac7a=a136_0x2a7d;return createHash(_0x4fac7a(0x163))[_0x4fac7a(0x164)](_0x210cfc)[_0x4fac7a(0x15c)](_0x4fac7a(0x15f));}function a136_0x4167(){const _0x54e8fe=['path','sha256','update','4276542XYRHXR','149770xNjvMH','7CZQiAH','size','70878jbQScy','261LQVsSj','76796cRGMvv','digest','1176350VGokoL','16OlCknL','hex','4431112fDOlUG','59506DkdabL'];a136_0x4167=function(){return _0x54e8fe;};return a136_0x4167();}export function fileTreeHash(_0xb60a26){const _0x4058ee=a136_0x2a7d,_0x597961=createHash(_0x4058ee(0x163));for(const _0x3c3f5d of normalizeManifestFiles(_0xb60a26)){_0x597961['update'](_0x3c3f5d[_0x4058ee(0x162)]),_0x597961['update']('\x00'),_0x597961['update'](_0x3c3f5d[_0x4058ee(0x163)]),_0x597961[_0x4058ee(0x164)]('\x00'),_0x597961[_0x4058ee(0x164)](String(_0x3c3f5d[_0x4058ee(0x158)])),_0x597961[_0x4058ee(0x164)]('\x00');}return _0x597961[_0x4058ee(0x15c)](_0x4058ee(0x15f));}
1
+ (function(_0xd956c4,_0x513089){const _0x112338=a136_0x408c,_0xecfd63=_0xd956c4();while(!![]){try{const _0x376654=parseInt(_0x112338(0x1f0))/0x1*(parseInt(_0x112338(0x1ec))/0x2)+-parseInt(_0x112338(0x1f3))/0x3*(parseInt(_0x112338(0x1eb))/0x4)+parseInt(_0x112338(0x1f8))/0x5*(parseInt(_0x112338(0x1ee))/0x6)+parseInt(_0x112338(0x1fa))/0x7+parseInt(_0x112338(0x1f1))/0x8+-parseInt(_0x112338(0x1f4))/0x9+parseInt(_0x112338(0x1ef))/0xa*(-parseInt(_0x112338(0x1ed))/0xb);if(_0x376654===_0x513089)break;else _0xecfd63['push'](_0xecfd63['shift']());}catch(_0x1c0b05){_0xecfd63['push'](_0xecfd63['shift']());}}}(a136_0x12f3,0x4a55b));import{createHash}from'node:crypto';function a136_0x12f3(){const _0x252dee=['2381352DqfJDv','hex','182787aKmewM','81900HmaFQp','size','digest','sha256','82535NMFOFS','update','2300991Gjwnvp','4XUKoqS','6TertLT','3619XftuWB','54JZDaHn','18470EOEltQ','69074nAWgxb'];a136_0x12f3=function(){return _0x252dee;};return a136_0x12f3();}import{fileContent,normalizeManifestFiles}from'./local-files.js';export function contentHash(_0x179669){const _0x3b22f1=a136_0x408c;return createHash(_0x3b22f1(0x1f7))[_0x3b22f1(0x1f9)](_0x179669)[_0x3b22f1(0x1f6)](_0x3b22f1(0x1f2));}export function fileHash(_0x179b6c){return bufferSha256(fileContent(_0x179b6c));}export function bufferSha256(_0x396edd){const _0x11c6ff=a136_0x408c;return createHash(_0x11c6ff(0x1f7))['update'](_0x396edd)[_0x11c6ff(0x1f6)](_0x11c6ff(0x1f2));}function a136_0x408c(_0x52f6a7,_0x4fb33e){_0x52f6a7=_0x52f6a7-0x1eb;const _0x12f3d0=a136_0x12f3();let _0x408c48=_0x12f3d0[_0x52f6a7];return _0x408c48;}export function fileTreeHash(_0x3dfebc){const _0x5de42f=a136_0x408c,_0x196796=createHash(_0x5de42f(0x1f7));for(const _0x169d17 of normalizeManifestFiles(_0x3dfebc)){_0x196796['update'](_0x169d17['path']),_0x196796[_0x5de42f(0x1f9)]('\x00'),_0x196796[_0x5de42f(0x1f9)](_0x169d17[_0x5de42f(0x1f7)]),_0x196796['update']('\x00'),_0x196796[_0x5de42f(0x1f9)](String(_0x169d17[_0x5de42f(0x1f5)])),_0x196796[_0x5de42f(0x1f9)]('\x00');}return _0x196796['digest'](_0x5de42f(0x1f2));}
@@ -1 +1 @@
1
- const a137_0x35e6d9=a137_0x4ae1;(function(_0x108db3,_0x43e5a7){const _0x569feb=a137_0x4ae1,_0x2c042a=_0x108db3();while(!![]){try{const _0xb7a3d5=-parseInt(_0x569feb(0x75))/0x1*(-parseInt(_0x569feb(0x70))/0x2)+-parseInt(_0x569feb(0x6b))/0x3+parseInt(_0x569feb(0x6a))/0x4+parseInt(_0x569feb(0x69))/0x5*(parseInt(_0x569feb(0x68))/0x6)+-parseInt(_0x569feb(0x73))/0x7*(parseInt(_0x569feb(0x76))/0x8)+-parseInt(_0x569feb(0x77))/0x9+parseInt(_0x569feb(0x74))/0xa;if(_0xb7a3d5===_0x43e5a7)break;else _0x2c042a['push'](_0x2c042a['shift']());}catch(_0x1db904){_0x2c042a['push'](_0x2c042a['shift']());}}}(a137_0x69e9,0xe8590));import{resolve}from'node:path';function a137_0x69e9(){const _0x13695c=['44nymxDj','4471608KKYTMC','7677450lKODQc','469578pIcXGU','30mszEqI','207432NXWgii','4857921IOLoSP','skills','cwd','appCode','freeze','40854spDnon','global','.agents','14SSFGUB','31217310mrlUpv'];a137_0x69e9=function(){return _0x13695c;};return a137_0x69e9();}function a137_0x4ae1(_0x992105,_0x15df70){_0x992105=_0x992105-0x68;const _0x69e9e8=a137_0x69e9();let _0x4ae12f=_0x69e9e8[_0x992105];return _0x4ae12f;}import{resolveSkillSyncPaths,runtimeAgentSkillRoots,safePathSegment}from'./paths.js';export function resolveRuntimeSkillInstallTarget(_0x2f8d78,_0x42c66f=a137_0x35e6d9(0x71),_0x481b99={}){const _0x34d6cb=a137_0x35e6d9,_0x58909e=resolveSkillSyncPaths(_0x481b99),_0x31b7ce=safePathSegment(_0x2f8d78,_0x34d6cb(0x6e)),_0x16de4a=_0x42c66f==='project'?[resolve(_0x481b99[_0x34d6cb(0x6d)]??process[_0x34d6cb(0x6d)](),_0x34d6cb(0x72),_0x34d6cb(0x6c))]:runtimeAgentSkillRoots(_0x58909e);return Object[_0x34d6cb(0x6f)]({'scope':_0x42c66f,'appCode':_0x31b7ce,'skillRoots':Object[_0x34d6cb(0x6f)](_0x16de4a),'managedRoot':_0x58909e['managedRoot']});}
1
+ const a137_0x4b9e7d=a137_0x396f;(function(_0x7a03ff,_0x4b30cb){const _0x5b237e=a137_0x396f,_0x172410=_0x7a03ff();while(!![]){try{const _0xecc2f7=parseInt(_0x5b237e(0x1cd))/0x1+-parseInt(_0x5b237e(0x1d9))/0x2*(parseInt(_0x5b237e(0x1cc))/0x3)+-parseInt(_0x5b237e(0x1d1))/0x4*(parseInt(_0x5b237e(0x1db))/0x5)+-parseInt(_0x5b237e(0x1d4))/0x6+-parseInt(_0x5b237e(0x1d2))/0x7*(-parseInt(_0x5b237e(0x1cb))/0x8)+parseInt(_0x5b237e(0x1d8))/0x9*(parseInt(_0x5b237e(0x1d5))/0xa)+parseInt(_0x5b237e(0x1d3))/0xb*(-parseInt(_0x5b237e(0x1d7))/0xc);if(_0xecc2f7===_0x4b30cb)break;else _0x172410['push'](_0x172410['shift']());}catch(_0x3f93d0){_0x172410['push'](_0x172410['shift']());}}}(a137_0x9140,0x3c54a));function a137_0x9140(){const _0x17efeb=['project','global','107552HmCmQx','53259ibRwye','402258htJuyv','.agents','cwd','skills','733508KOxzVa','21kZAWsj','132YkzsUf','1752366WPIskJ','4165370iqCWVN','freeze','83316AXdQGs','9NlvVzA','6gfbAMJ','appCode','5fpgKwk'];a137_0x9140=function(){return _0x17efeb;};return a137_0x9140();}import{resolve}from'node:path';import{resolveSkillSyncPaths,runtimeAgentSkillRoots,safePathSegment}from'./paths.js';function a137_0x396f(_0x2bd6c4,_0x775fcf){_0x2bd6c4=_0x2bd6c4-0x1c9;const _0x9140f3=a137_0x9140();let _0x396f7e=_0x9140f3[_0x2bd6c4];return _0x396f7e;}export function resolveRuntimeSkillInstallTarget(_0x3b4b17,_0x1ee6e3=a137_0x4b9e7d(0x1ca),_0xa31441={}){const _0x5dbb02=a137_0x4b9e7d,_0x59e1dd=resolveSkillSyncPaths(_0xa31441),_0x52e6e6=safePathSegment(_0x3b4b17,_0x5dbb02(0x1da)),_0x3b2125=_0x1ee6e3===_0x5dbb02(0x1c9)?[resolve(_0xa31441['cwd']??process[_0x5dbb02(0x1cf)](),_0x5dbb02(0x1ce),_0x5dbb02(0x1d0))]:runtimeAgentSkillRoots(_0x59e1dd);return Object[_0x5dbb02(0x1d6)]({'scope':_0x1ee6e3,'appCode':_0x52e6e6,'skillRoots':Object[_0x5dbb02(0x1d6)](_0x3b2125),'managedRoot':_0x59e1dd['managedRoot']});}
@@ -1 +1 @@
1
- const a138_0xc8a214=a138_0x5096;(function(_0x24d554,_0x583fe5){const _0x38d394=a138_0x5096,_0x4225d5=_0x24d554();while(!![]){try{const _0x3fad32=-parseInt(_0x38d394(0x116))/0x1*(-parseInt(_0x38d394(0x11b))/0x2)+parseInt(_0x38d394(0xf5))/0x3*(parseInt(_0x38d394(0x11d))/0x4)+-parseInt(_0x38d394(0x103))/0x5*(parseInt(_0x38d394(0xe7))/0x6)+parseInt(_0x38d394(0x108))/0x7+-parseInt(_0x38d394(0x109))/0x8+parseInt(_0x38d394(0xe9))/0x9+-parseInt(_0x38d394(0xfd))/0xa;if(_0x3fad32===_0x583fe5)break;else _0x4225d5['push'](_0x4225d5['shift']());}catch(_0x563e93){_0x4225d5['push'](_0x4225d5['shift']());}}}(a138_0x412b,0xe977d));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import a138_0x4eac83 from'fs-extra';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';function a138_0x5096(_0x2f0f85,_0xa0a79c){_0x2f0f85=_0x2f0f85-0xe2;const _0x412bc7=a138_0x412b();let _0x5096a9=_0x412bc7[_0x2f0f85];return _0x5096a9;}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_0x4eac83,RESERVED_PROJECT_SKILL_CODES=new Set([a138_0xc8a214(0x115),'runtime-observe',a138_0xc8a214(0x100)]);export function linkEffectiveRuntimeSkills(_0x547f94,_0x2c1462){const _0x399dd=a138_0xc8a214,_0xfbbd8f=new Map();for(const _0x23289a of _0x547f94){const _0x7c35b0=_0x23289a[_0x399dd(0x118)][_0x399dd(0x11c)];if(!_0x7c35b0)continue;const _0x5ef2b5=_0xfbbd8f[_0x399dd(0x10c)](_0x7c35b0);(!_0x5ef2b5||_0x23289a[_0x399dd(0xee)]===_0x399dd(0xed))&&_0xfbbd8f[_0x399dd(0x114)](_0x7c35b0,_0x23289a);}const _0x3f0b8d=[];for(const _0x562237 of _0xfbbd8f['values']()){const _0x24075c=requireSkillCode(_0x562237[_0x399dd(0x118)]),_0x3778b0=readMetadataIfPresent(_0x562237[_0x399dd(0xe5)]);if(_0x3778b0?.['appCode']!==_0x2c1462[_0x399dd(0x10b)]||_0x3778b0[_0x399dd(0x11c)]!==_0x24075c)throw CliErrors[_0x399dd(0x10a)](_0x399dd(0x11a)+_0x2c1462[_0x399dd(0x10b)]+':\x20'+_0x562237[_0x399dd(0xe5)]);const _0x2de865=runtimeSkillLinkName(_0x2c1462,_0x24075c);for(const _0x2f286b of _0x2c1462[_0x399dd(0xe8)]){_0x3f0b8d[_0x399dd(0xf9)](ensureManagedSymlink(resolve(_0x2f286b,_0x2de865),_0x562237[_0x399dd(0xfa)],_0x2c1462,_0x24075c));}}return _0x3f0b8d;}export function pruneStaleRuntimeSkillLinks(_0x3468b7,_0x532c9e,_0x479dee){const _0x9c26a8=a138_0xc8a214,_0x4d6f66=new Set([..._0x532c9e][_0x9c26a8(0xf7)](_0x4987cf=>_0x4987cf[_0x9c26a8(0x10d)]())[_0x9c26a8(0xe2)](Boolean)),_0x12236b=_0x479dee?new Set([..._0x479dee][_0x9c26a8(0xf7)](_0x4305e8=>_0x4305e8[_0x9c26a8(0x10d)]())[_0x9c26a8(0xe2)](Boolean)):undefined,_0x491121=[];for(const _0xa3fa5a of _0x3468b7[_0x9c26a8(0xe8)]){for(const _0x1ea8ad of managedTargetSkillLinkPaths(_0xa3fa5a,_0x3468b7)){const _0x3aee52=runtimeSkillCodeFromLink(_0x3468b7,_0x1ea8ad);if(_0x12236b&&!_0x12236b[_0x9c26a8(0x102)](_0x3aee52))continue;if(_0x4d6f66[_0x9c26a8(0x102)](_0x3aee52))continue;_0x491121[_0x9c26a8(0xf9)](removeManagedSkillLink(_0x1ea8ad,_0x3468b7,_0x3aee52));}}return _0x491121;}export function pruneStaleRuntimeSkillCache(_0x577dbd,_0x46baba={}){const _0x1459fa=a138_0xc8a214,_0x502215=new Set([..._0x577dbd[_0x1459fa(0x10f)]][_0x1459fa(0xf7)](_0x4ac90d=>_0x4ac90d['trim']())[_0x1459fa(0xe2)](Boolean)),_0xd9dd14=_0x577dbd[_0x1459fa(0x111)]?new Set([..._0x577dbd['pruneSkillCodes']][_0x1459fa(0xf7)](_0x2a1181=>_0x2a1181['trim']())[_0x1459fa(0xe2)](Boolean)):undefined,_0x370b25=_0x577dbd[_0x1459fa(0x113)]??[_0x1459fa(0xed),'company'],_0x4249f5=resolve(getRuntimeSkillCacheRoot(_0x577dbd[_0x1459fa(0x110)],_0x577dbd[_0x1459fa(0xf2)],_0x46baba),safePathSegment(_0x577dbd[_0x1459fa(0x10b)],'appCode')),_0x5c05be=[];for(const _0x5102d5 of _0x370b25){const _0xd6c095=resolve(_0x4249f5,_0x5102d5);if(!existsSync(_0xd6c095))continue;for(const _0xca104d of readdirSync(_0xd6c095,{'withFileTypes':!![]})){if(!_0xca104d['isDirectory']())continue;const _0x3d468b=_0xca104d[_0x1459fa(0xf4)];if(_0xd9dd14&&!_0xd9dd14[_0x1459fa(0x102)](_0x3d468b))continue;if(_0x502215[_0x1459fa(0x102)](_0x3d468b))continue;const _0x9ade0d=resolve(_0xd6c095,_0x3d468b),_0x5e164a=readMetadataIfPresent(resolve(_0x9ade0d,METADATA_FILE));if(_0x5e164a?.[_0x1459fa(0x10b)]!==_0x577dbd[_0x1459fa(0x10b)]||_0x5e164a[_0x1459fa(0xee)]!==_0x5102d5||_0x5e164a['skillCode']!==_0x3d468b){_0x5c05be['push']({'path':_0x9ade0d,'action':'skipped','reason':'metadata-mismatch'});continue;}if(isLinkedFromAnyRoot(_0x9ade0d,_0x577dbd[_0x1459fa(0x106)]??[])){_0x5c05be[_0x1459fa(0xf9)]({'path':_0x9ade0d,'action':_0x1459fa(0xe4),'reason':_0x1459fa(0x117)});continue;}removeSync(_0x9ade0d),_0x5c05be[_0x1459fa(0xf9)]({'path':_0x9ade0d,'action':_0x1459fa(0xeb)});}}return _0x5c05be;}function a138_0x412b(){const _0x328ccb=['1670345eGHptT','linked-from-protected-root','skill','slice','Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20','2aIeugq','skillCode','3851824RSawAu','builtin','filter','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','skipped','metadataPath','isDirectory','1866drHhHD','skillRoots','11747061EmgLiE','Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20','removed','isSymbolicLink','personal','scope','updated','Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20','Refusing\x20to\x20copy\x20Skill\x20symlink:\x20','accessKey','managedRoot','name','3WwNaZI','contentHash','map','project','push','dir','Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20','15986700ioAJAK','agentsSkillsDir','created','secret-retriever','unchanged','has','9795UfRniX','Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20','length','protectedLinkRoots','external-symlink','5558014jUHjOr','12546624nakclS','validation','appCode','get','trim','not-managed-symlink','activeSkillCodes','env','pruneSkillCodes','Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20','scopes','set','lovrabet'];a138_0x412b=function(){return _0x328ccb;};return a138_0x412b();}export function linkGlobalRuntimeSkills(_0x486f41,_0x9be5d={}){const _0x4dabd7=a138_0xc8a214,_0x5cd9e1=resolveSkillSyncPaths(_0x9be5d),_0x3a3008=[];for(const _0x1a63b6 of _0x486f41){if(_0x1a63b6[_0x4dabd7(0xee)]!=='builtin')throw CliErrors[_0x4dabd7(0x10a)](_0x4dabd7(0xe3)+_0x1a63b6[_0x4dabd7(0xee)]);const _0x4dce44=requireSkillCode(_0x1a63b6[_0x4dabd7(0x118)]),_0x4dd9a8=copyManagedSkillDirectory(_0x1a63b6[_0x4dabd7(0xfa)],resolve(_0x5cd9e1[_0x4dabd7(0xfe)],_0x4dce44));_0x3a3008[_0x4dabd7(0xf9)]({..._0x4dd9a8,'contentHash':_0x1a63b6[_0x4dabd7(0xf6)]});}return _0x3a3008;}function ensureManagedSymlink(_0x4b1129,_0x2ead86,_0x2dece6,_0xb136bd){const _0x5b21c1=a138_0xc8a214;mkdirSync(dirname(_0x4b1129),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x4b1129)||isDanglingSymlink(_0x4b1129)){const _0x5dc0b8=lstatSync(_0x4b1129);if(!_0x5dc0b8['isSymbolicLink']())throw CliErrors[_0x5b21c1(0x10a)]('Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20'+_0x4b1129);const _0x5a848a=resolveSymlinkTarget(_0x4b1129);if(!isPathInside(realOrResolved(_0x5a848a),realOrResolved(_0x2dece6[_0x5b21c1(0xf3)])))throw CliErrors[_0x5b21c1(0x10a)](_0x5b21c1(0xea)+_0x4b1129);if(realOrResolved(_0x5a848a)===realOrResolved(_0x2ead86))return{'path':_0x4b1129,'target':_0x2ead86,'action':_0x5b21c1(0x101)};const _0x57b0ac=readMetadataIfPresent(resolve(_0x5a848a,METADATA_FILE));if(_0x2dece6[_0x5b21c1(0xee)]==='project'&&(_0x57b0ac?.[_0x5b21c1(0x10b)]!==_0x2dece6[_0x5b21c1(0x10b)]||_0x57b0ac[_0x5b21c1(0x11c)]!==_0xb136bd))throw CliErrors['validation'](_0x5b21c1(0xf0)+_0x4b1129);return unlinkSync(_0x4b1129),symlinkSync(_0x2ead86,_0x4b1129,_0x5b21c1(0xfa)),{'path':_0x4b1129,'target':_0x2ead86,'action':_0x5b21c1(0xef)};}return symlinkSync(_0x2ead86,_0x4b1129,_0x5b21c1(0xfa)),{'path':_0x4b1129,'target':_0x2ead86,'action':_0x5b21c1(0xff)};}function managedTargetSkillLinkPaths(_0x4dcee7,_0x2ccbde){const _0x43326e=a138_0xc8a214;if(!existsSync(_0x4dcee7))return[];const _0x5750f2=_0x2ccbde[_0x43326e(0x10b)]+'--';return readdirSync(_0x4dcee7,{'withFileTypes':!![]})[_0x43326e(0xe2)](_0x44af9b=>_0x2ccbde[_0x43326e(0xee)]===_0x43326e(0xf8)||_0x44af9b[_0x43326e(0xf4)]['startsWith'](_0x5750f2))[_0x43326e(0xf7)](_0x5750a1=>resolve(_0x4dcee7,_0x5750a1[_0x43326e(0xf4)]));}function removeManagedSkillLink(_0x296a7d,_0x164524,_0x1ead4e){const _0x368055=a138_0xc8a214,_0x5ef060=lstatIfPresent(_0x296a7d);if(!_0x5ef060?.['isSymbolicLink']())return{'path':_0x296a7d,'action':'skipped','reason':_0x368055(0x10e)};const _0x1fffb6=resolveSymlinkTarget(_0x296a7d);if(!isPathInside(realOrResolved(_0x1fffb6),realOrResolved(_0x164524[_0x368055(0xf3)])))return{'path':_0x296a7d,'action':_0x368055(0xe4),'reason':_0x368055(0x107)};const _0x1cf4e6=readMetadataIfPresent(resolve(_0x1fffb6,METADATA_FILE));if(_0x164524[_0x368055(0xee)]===_0x368055(0xf8)&&(_0x1cf4e6?.[_0x368055(0x10b)]!==_0x164524[_0x368055(0x10b)]||_0x1cf4e6[_0x368055(0x11c)]!==_0x1ead4e))return{'path':_0x296a7d,'action':_0x368055(0xe4),'reason':'metadata-mismatch'};return unlinkSync(_0x296a7d),{'path':_0x296a7d,'action':_0x368055(0xeb)};}function isLinkedFromAnyRoot(_0x48f116,_0x4fc461){const _0x2820a3=a138_0xc8a214,_0x241a0f=realOrResolved(_0x48f116);for(const _0x24de0a of _0x4fc461){if(!existsSync(_0x24de0a))continue;for(const _0x5ae044 of readdirSync(_0x24de0a,{'withFileTypes':!![]})){if(!_0x5ae044[_0x2820a3(0xec)]())continue;const _0x4fdf97=resolve(_0x24de0a,_0x5ae044['name']);if(realOrResolved(resolveSymlinkTarget(_0x4fdf97))===_0x241a0f)return!![];}}return![];}function runtimeSkillLinkName(_0xb9114,_0x29a8bf){const _0x1e2f5c=a138_0xc8a214,_0x50d5be=safePathSegment(_0x29a8bf,_0x1e2f5c(0x11c));if(_0xb9114[_0x1e2f5c(0xee)]==='project'&&RESERVED_PROJECT_SKILL_CODES['has'](_0x50d5be))throw CliErrors[_0x1e2f5c(0x10a)](_0x1e2f5c(0x112)+_0x50d5be);return _0xb9114[_0x1e2f5c(0xee)]===_0x1e2f5c(0xf8)?_0x50d5be:_0xb9114[_0x1e2f5c(0x10b)]+'--'+_0x50d5be;}function runtimeSkillCodeFromLink(_0x45a976,_0x144667){const _0x2d85c0=a138_0xc8a214,_0x33c1a0=basename(_0x144667);return _0x45a976[_0x2d85c0(0xee)]==='project'?_0x33c1a0:_0x33c1a0[_0x2d85c0(0x119)]((_0x45a976[_0x2d85c0(0x10b)]+'--')[_0x2d85c0(0x105)]);}export function copyManagedSkillDirectory(_0x507772,_0x19acfd){const _0x5945d1=a138_0xc8a214,_0x666a5f=resolve(_0x19acfd,METADATA_FILE),_0x442367=existsSync(_0x19acfd);if(_0x442367){const _0x42aaae=lstatSync(_0x19acfd);if(_0x42aaae[_0x5945d1(0xec)]())throw CliErrors[_0x5945d1(0x10a)](_0x5945d1(0xfb)+_0x19acfd);if(!_0x42aaae[_0x5945d1(0xe6)]())throw CliErrors['validation'](_0x5945d1(0x104)+_0x19acfd);const _0x19232f=readMetadataIfPresent(_0x666a5f);if(_0x19232f?.[_0x5945d1(0xee)]!==_0x5945d1(0x11e))throw CliErrors[_0x5945d1(0x10a)](_0x5945d1(0xfc)+_0x19acfd);}ensureDirSync(dirname(_0x19acfd));const _0x443e4a=_0x442367?readMetadataIfPresent(_0x666a5f)?.[_0x5945d1(0xf6)]:undefined,_0x1c79d0=readMetadataIfPresent(resolve(_0x507772,METADATA_FILE))?.[_0x5945d1(0xf6)];return _0x442367&&removeSync(_0x19acfd),copySkillDirectory(_0x507772,_0x19acfd),{'path':_0x19acfd,'target':_0x507772,'action':!_0x442367?'created':_0x443e4a===_0x1c79d0?_0x5945d1(0x101):_0x5945d1(0xef)};}function copySkillDirectory(_0x509649,_0x203d5a){copySync(_0x509649,_0x203d5a,{'dereference':![],'overwrite':!![],'filter'(_0x29088e){const _0x691dac=a138_0x5096;if(lstatSync(_0x29088e)[_0x691dac(0xec)]())throw CliErrors[_0x691dac(0x10a)](_0x691dac(0xf1)+_0x29088e);return!![];}});}
1
+ const a138_0x107c34=a138_0x5ac8;(function(_0x1a2693,_0x27982c){const _0x19cf36=a138_0x5ac8,_0x16a317=_0x1a2693();while(!![]){try{const _0x42e864=parseInt(_0x19cf36(0x16b))/0x1*(parseInt(_0x19cf36(0x169))/0x2)+parseInt(_0x19cf36(0x16d))/0x3*(parseInt(_0x19cf36(0x192))/0x4)+parseInt(_0x19cf36(0x17b))/0x5+parseInt(_0x19cf36(0x18d))/0x6+parseInt(_0x19cf36(0x172))/0x7*(-parseInt(_0x19cf36(0x183))/0x8)+parseInt(_0x19cf36(0x185))/0x9+-parseInt(_0x19cf36(0x189))/0xa;if(_0x42e864===_0x27982c)break;else _0x16a317['push'](_0x16a317['shift']());}catch(_0x1158b6){_0x16a317['push'](_0x16a317['shift']());}}}(a138_0x10cb,0x2f79b));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';function a138_0x10cb(){const _0x235c27=['skillCode','personal','contentHash','external-symlink','skipped','1136795oBTups','filter','removed','push','runtime-observe','not-managed-symlink','Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20','dir','1032SebeWT','get','3151827PRcmic','accessKey','pruneSkillCodes','scope','8143530peaIOg','trim','validation','appCode','267534oNxFCZ','set','created','slice','name','1367948EZnWaG','unchanged','updated','metadata-mismatch','Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20','map','builtin','has','7934RwKivr','project','31hTkLce','isSymbolicLink','3AbidRD','isDirectory','company','Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20','skill','4249JyhfiL','managedRoot','Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20','metadataPath'];a138_0x10cb=function(){return _0x235c27;};return a138_0x10cb();}function a138_0x5ac8(_0x3d564c,_0x430e42){_0x3d564c=_0x3d564c-0x162;const _0x10cb01=a138_0x10cb();let _0x5ac898=_0x10cb01[_0x3d564c];return _0x5ac898;}import{basename,dirname,resolve}from'node:path';import a138_0x1ef180 from'fs-extra';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';import{isDanglingSymlink,isPathInside,lstatIfPresent,realOrResolved,resolveSymlinkTarget}from'./fs-utils.js';import{readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillCacheRoot,resolveSkillSyncPaths,safePathSegment}from'./paths.js';const {copySync,ensureDirSync,removeSync}=a138_0x1ef180,RESERVED_PROJECT_SKILL_CODES=new Set(['lovrabet',a138_0x107c34(0x17f),'secret-retriever']);export function linkEffectiveRuntimeSkills(_0x2ca1b7,_0x48def2){const _0x4e8662=a138_0x107c34,_0x16863a=new Map();for(const _0x9b9297 of _0x2ca1b7){const _0x39af52=_0x9b9297[_0x4e8662(0x171)]['skillCode'];if(!_0x39af52)continue;const _0x58c1a9=_0x16863a[_0x4e8662(0x184)](_0x39af52);(!_0x58c1a9||_0x9b9297['scope']===_0x4e8662(0x177))&&_0x16863a[_0x4e8662(0x18e)](_0x39af52,_0x9b9297);}const _0x21c0c1=[];for(const _0x48d72e of _0x16863a['values']()){const _0x109501=requireSkillCode(_0x48d72e[_0x4e8662(0x171)]),_0x224295=readMetadataIfPresent(_0x48d72e['metadataPath']);if(_0x224295?.[_0x4e8662(0x18c)]!==_0x48def2[_0x4e8662(0x18c)]||_0x224295[_0x4e8662(0x176)]!==_0x109501)throw CliErrors[_0x4e8662(0x18b)]('Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20'+_0x48def2[_0x4e8662(0x18c)]+':\x20'+_0x48d72e[_0x4e8662(0x175)]);const _0x4fa0a6=runtimeSkillLinkName(_0x48def2,_0x109501);for(const _0x1c2250 of _0x48def2['skillRoots']){_0x21c0c1[_0x4e8662(0x17e)](ensureManagedSymlink(resolve(_0x1c2250,_0x4fa0a6),_0x48d72e[_0x4e8662(0x182)],_0x48def2,_0x109501));}}return _0x21c0c1;}export function pruneStaleRuntimeSkillLinks(_0x39e0b7,_0x2ed007,_0x59b89f){const _0x363b9a=a138_0x107c34,_0x284860=new Set([..._0x2ed007][_0x363b9a(0x166)](_0x4107ad=>_0x4107ad[_0x363b9a(0x18a)]())[_0x363b9a(0x17c)](Boolean)),_0x1da40a=_0x59b89f?new Set([..._0x59b89f][_0x363b9a(0x166)](_0x433ec5=>_0x433ec5[_0x363b9a(0x18a)]())[_0x363b9a(0x17c)](Boolean)):undefined,_0x391c4f=[];for(const _0x34d844 of _0x39e0b7['skillRoots']){for(const _0x20e54d of managedTargetSkillLinkPaths(_0x34d844,_0x39e0b7)){const _0x1872b9=runtimeSkillCodeFromLink(_0x39e0b7,_0x20e54d);if(_0x1da40a&&!_0x1da40a['has'](_0x1872b9))continue;if(_0x284860[_0x363b9a(0x168)](_0x1872b9))continue;_0x391c4f[_0x363b9a(0x17e)](removeManagedSkillLink(_0x20e54d,_0x39e0b7,_0x1872b9));}}return _0x391c4f;}export function pruneStaleRuntimeSkillCache(_0x34dc8e,_0x44126b={}){const _0x25f615=a138_0x107c34,_0x5ed94c=new Set([..._0x34dc8e['activeSkillCodes']][_0x25f615(0x166)](_0x3c1f4f=>_0x3c1f4f[_0x25f615(0x18a)]())[_0x25f615(0x17c)](Boolean)),_0x5ed836=_0x34dc8e['pruneSkillCodes']?new Set([..._0x34dc8e[_0x25f615(0x187)]][_0x25f615(0x166)](_0x530588=>_0x530588[_0x25f615(0x18a)]())[_0x25f615(0x17c)](Boolean)):undefined,_0x3f4b06=_0x34dc8e['scopes']??['personal',_0x25f615(0x16f)],_0x55b6ab=resolve(getRuntimeSkillCacheRoot(_0x34dc8e['env'],_0x34dc8e[_0x25f615(0x186)],_0x44126b),safePathSegment(_0x34dc8e['appCode'],_0x25f615(0x18c))),_0x4f0d24=[];for(const _0x3e1266 of _0x3f4b06){const _0x1c1ebd=resolve(_0x55b6ab,_0x3e1266);if(!existsSync(_0x1c1ebd))continue;for(const _0x4610b2 of readdirSync(_0x1c1ebd,{'withFileTypes':!![]})){if(!_0x4610b2[_0x25f615(0x16e)]())continue;const _0x172912=_0x4610b2[_0x25f615(0x191)];if(_0x5ed836&&!_0x5ed836['has'](_0x172912))continue;if(_0x5ed94c[_0x25f615(0x168)](_0x172912))continue;const _0x39ea0a=resolve(_0x1c1ebd,_0x172912),_0x140f5f=readMetadataIfPresent(resolve(_0x39ea0a,METADATA_FILE));if(_0x140f5f?.[_0x25f615(0x18c)]!==_0x34dc8e[_0x25f615(0x18c)]||_0x140f5f[_0x25f615(0x188)]!==_0x3e1266||_0x140f5f[_0x25f615(0x176)]!==_0x172912){_0x4f0d24[_0x25f615(0x17e)]({'path':_0x39ea0a,'action':'skipped','reason':_0x25f615(0x164)});continue;}if(isLinkedFromAnyRoot(_0x39ea0a,_0x34dc8e['protectedLinkRoots']??[])){_0x4f0d24['push']({'path':_0x39ea0a,'action':_0x25f615(0x17a),'reason':'linked-from-protected-root'});continue;}removeSync(_0x39ea0a),_0x4f0d24[_0x25f615(0x17e)]({'path':_0x39ea0a,'action':_0x25f615(0x17d)});}}return _0x4f0d24;}export function linkGlobalRuntimeSkills(_0x4c53c5,_0x507a2e={}){const _0x108659=a138_0x107c34,_0x56454d=resolveSkillSyncPaths(_0x507a2e),_0xd5b4=[];for(const _0x32905a of _0x4c53c5){if(_0x32905a[_0x108659(0x188)]!==_0x108659(0x167))throw CliErrors[_0x108659(0x18b)]('Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20'+_0x32905a[_0x108659(0x188)]);const _0x2f8426=requireSkillCode(_0x32905a[_0x108659(0x171)]),_0x361bd3=copyManagedSkillDirectory(_0x32905a['dir'],resolve(_0x56454d['agentsSkillsDir'],_0x2f8426));_0xd5b4['push']({..._0x361bd3,'contentHash':_0x32905a[_0x108659(0x178)]});}return _0xd5b4;}function ensureManagedSymlink(_0x3528a1,_0x50221d,_0x18ccdf,_0x2dd8f9){const _0x309fc3=a138_0x107c34;mkdirSync(dirname(_0x3528a1),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x3528a1)||isDanglingSymlink(_0x3528a1)){const _0x2634f7=lstatSync(_0x3528a1);if(!_0x2634f7[_0x309fc3(0x16c)]())throw CliErrors['validation']('Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20'+_0x3528a1);const _0x41c430=resolveSymlinkTarget(_0x3528a1);if(!isPathInside(realOrResolved(_0x41c430),realOrResolved(_0x18ccdf[_0x309fc3(0x173)])))throw CliErrors['validation'](_0x309fc3(0x165)+_0x3528a1);if(realOrResolved(_0x41c430)===realOrResolved(_0x50221d))return{'path':_0x3528a1,'target':_0x50221d,'action':_0x309fc3(0x162)};const _0x329e82=readMetadataIfPresent(resolve(_0x41c430,METADATA_FILE));if(_0x18ccdf[_0x309fc3(0x188)]==='project'&&(_0x329e82?.[_0x309fc3(0x18c)]!==_0x18ccdf[_0x309fc3(0x18c)]||_0x329e82['skillCode']!==_0x2dd8f9))throw CliErrors['validation'](_0x309fc3(0x170)+_0x3528a1);return unlinkSync(_0x3528a1),symlinkSync(_0x50221d,_0x3528a1,'dir'),{'path':_0x3528a1,'target':_0x50221d,'action':_0x309fc3(0x163)};}return symlinkSync(_0x50221d,_0x3528a1,'dir'),{'path':_0x3528a1,'target':_0x50221d,'action':_0x309fc3(0x18f)};}function managedTargetSkillLinkPaths(_0x1b7e7e,_0x797ec0){const _0x2cf637=a138_0x107c34;if(!existsSync(_0x1b7e7e))return[];const _0xed430c=_0x797ec0[_0x2cf637(0x18c)]+'--';return readdirSync(_0x1b7e7e,{'withFileTypes':!![]})['filter'](_0x24860d=>_0x797ec0['scope']===_0x2cf637(0x16a)||_0x24860d[_0x2cf637(0x191)]['startsWith'](_0xed430c))[_0x2cf637(0x166)](_0x40ffec=>resolve(_0x1b7e7e,_0x40ffec[_0x2cf637(0x191)]));}function removeManagedSkillLink(_0x5510db,_0x24fac2,_0x3e6ba9){const _0x1cd3be=a138_0x107c34,_0x3d914c=lstatIfPresent(_0x5510db);if(!_0x3d914c?.[_0x1cd3be(0x16c)]())return{'path':_0x5510db,'action':'skipped','reason':_0x1cd3be(0x180)};const _0x30ae53=resolveSymlinkTarget(_0x5510db);if(!isPathInside(realOrResolved(_0x30ae53),realOrResolved(_0x24fac2[_0x1cd3be(0x173)])))return{'path':_0x5510db,'action':_0x1cd3be(0x17a),'reason':_0x1cd3be(0x179)};const _0x3702f5=readMetadataIfPresent(resolve(_0x30ae53,METADATA_FILE));if(_0x24fac2[_0x1cd3be(0x188)]===_0x1cd3be(0x16a)&&(_0x3702f5?.['appCode']!==_0x24fac2[_0x1cd3be(0x18c)]||_0x3702f5[_0x1cd3be(0x176)]!==_0x3e6ba9))return{'path':_0x5510db,'action':_0x1cd3be(0x17a),'reason':'metadata-mismatch'};return unlinkSync(_0x5510db),{'path':_0x5510db,'action':_0x1cd3be(0x17d)};}function isLinkedFromAnyRoot(_0x1193c1,_0x130afc){const _0x108393=realOrResolved(_0x1193c1);for(const _0x33965e of _0x130afc){if(!existsSync(_0x33965e))continue;for(const _0x5de992 of readdirSync(_0x33965e,{'withFileTypes':!![]})){if(!_0x5de992['isSymbolicLink']())continue;const _0x86df22=resolve(_0x33965e,_0x5de992['name']);if(realOrResolved(resolveSymlinkTarget(_0x86df22))===_0x108393)return!![];}}return![];}function runtimeSkillLinkName(_0x1bb97b,_0x308ecc){const _0x33b204=a138_0x107c34,_0x24f0fa=safePathSegment(_0x308ecc,_0x33b204(0x176));if(_0x1bb97b['scope']==='project'&&RESERVED_PROJECT_SKILL_CODES[_0x33b204(0x168)](_0x24f0fa))throw CliErrors[_0x33b204(0x18b)]('Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20'+_0x24f0fa);return _0x1bb97b[_0x33b204(0x188)]==='project'?_0x24f0fa:_0x1bb97b['appCode']+'--'+_0x24f0fa;}function runtimeSkillCodeFromLink(_0x4069c0,_0xee2ee5){const _0x2af268=a138_0x107c34,_0x46772f=basename(_0xee2ee5);return _0x4069c0[_0x2af268(0x188)]===_0x2af268(0x16a)?_0x46772f:_0x46772f[_0x2af268(0x190)]((_0x4069c0['appCode']+'--')['length']);}export function copyManagedSkillDirectory(_0x31dcb4,_0x3fcf8a){const _0x3d0ada=a138_0x107c34,_0x2e3f8f=resolve(_0x3fcf8a,METADATA_FILE),_0x2453f9=existsSync(_0x3fcf8a);if(_0x2453f9){const _0x35792d=lstatSync(_0x3fcf8a);if(_0x35792d['isSymbolicLink']())throw CliErrors[_0x3d0ada(0x18b)](_0x3d0ada(0x181)+_0x3fcf8a);if(!_0x35792d[_0x3d0ada(0x16e)]())throw CliErrors[_0x3d0ada(0x18b)](_0x3d0ada(0x174)+_0x3fcf8a);const _0x5dd55c=readMetadataIfPresent(_0x2e3f8f);if(_0x5dd55c?.[_0x3d0ada(0x188)]!==_0x3d0ada(0x167))throw CliErrors['validation']('Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20'+_0x3fcf8a);}ensureDirSync(dirname(_0x3fcf8a));const _0x22f0c8=_0x2453f9?readMetadataIfPresent(_0x2e3f8f)?.['contentHash']:undefined,_0x2a94d3=readMetadataIfPresent(resolve(_0x31dcb4,METADATA_FILE))?.['contentHash'];return _0x2453f9&&removeSync(_0x3fcf8a),copySkillDirectory(_0x31dcb4,_0x3fcf8a),{'path':_0x3fcf8a,'target':_0x31dcb4,'action':!_0x2453f9?'created':_0x22f0c8===_0x2a94d3?_0x3d0ada(0x162):'updated'};}function copySkillDirectory(_0x2ca665,_0x423976){copySync(_0x2ca665,_0x423976,{'dereference':![],'overwrite':!![],'filter'(_0x4c623e){const _0x17f118=a138_0x5ac8;if(lstatSync(_0x4c623e)[_0x17f118(0x16c)]())throw CliErrors[_0x17f118(0x18b)]('Refusing\x20to\x20copy\x20Skill\x20symlink:\x20'+_0x4c623e);return!![];}});}
@@ -1 +1 @@
1
- (function(_0x30a921,_0x289ff4){const _0x1e3d62=a139_0x3c17,_0x1d5c9c=_0x30a921();while(!![]){try{const _0x472a69=-parseInt(_0x1e3d62(0xcd))/0x1+parseInt(_0x1e3d62(0xdb))/0x2*(-parseInt(_0x1e3d62(0xd8))/0x3)+-parseInt(_0x1e3d62(0xce))/0x4+parseInt(_0x1e3d62(0xb6))/0x5*(-parseInt(_0x1e3d62(0xd6))/0x6)+-parseInt(_0x1e3d62(0xc2))/0x7*(-parseInt(_0x1e3d62(0xd7))/0x8)+parseInt(_0x1e3d62(0xc4))/0x9*(-parseInt(_0x1e3d62(0xbb))/0xa)+-parseInt(_0x1e3d62(0xd4))/0xb*(-parseInt(_0x1e3d62(0xbc))/0xc);if(_0x472a69===_0x289ff4)break;else _0x1d5c9c['push'](_0x1d5c9c['shift']());}catch(_0x391ab6){_0x1d5c9c['push'](_0x1d5c9c['shift']());}}}(a139_0xfede,0x26e29));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_0xfede(){const _0x5477d0=['set','sort','code','includes','skillRoots','builtin','map','241600CrNFni','60848phlcPv','trim','isDirectory','appCode','env','skillMdPath','8951921INXlws','linkedPaths','6iKhUno','82744lKbihC','597WxkyeC','project','cache','2038UvelCH','name','accessKey','isArray','dir','tags','isSymbolicLink','metadataPath','117205OYdlLE','scope','localeCompare','source','link','2232190jxkhRn','12cdcDhy','scopes','skillCode','has','local','validation','35kkZIRh','filter','9HkNudB','values'];a139_0xfede=function(){return _0x5477d0;};return a139_0xfede();}import{readMetadataIfPresent}from'./metadata.js';import{getRuntimeSkillCacheRoot,safePathSegment}from'./paths.js';import{isRuntimeSkillScope,normalizeRuntimeSkillScopes}from'./scopes.js';export function listLocalRuntimeSkills(_0x68f2be,_0x4b2187,_0x2e67d3={}){const _0x189908=a139_0x3c17,_0x1b04e3=safePathSegment(_0x68f2be['appCode'],_0x189908(0xd1));if(_0x4b2187['appCode']!==_0x1b04e3)throw CliErrors[_0x189908(0xc1)]('Runtime\x20Skill\x20install\x20target\x20app\x20mismatch:\x20'+_0x4b2187[_0x189908(0xd1)]+'\x20!=\x20'+_0x1b04e3);const _0x53d2a1=normalizeRuntimeSkillScopes(_0x68f2be['scopes']),_0xc88bed=new Set(_0x53d2a1),_0x53fc28=_0x68f2be[_0x189908(0xc8)]?.[_0x189908(0xcf)](),_0x5ccd4f=new Map(),_0x3c47c1=resolve(getRuntimeSkillCacheRoot(_0x68f2be[_0x189908(0xd2)],_0x68f2be[_0x189908(0xb0)],_0x2e67d3),_0x1b04e3);for(const _0x58745c of _0x53d2a1){for(const _0x21aff0 of localSkillEntryDirs(resolve(_0x3c47c1,_0x58745c))){collectLocalRuntimeSkill(_0x5ccd4f,_0x21aff0,{'appCode':_0x1b04e3,'scopes':_0xc88bed,'code':_0x53fc28,'source':_0x189908(0xda)});}}for(const _0x37486a of _0x4b2187[_0x189908(0xca)]){for(const _0x4ed703 of localSkillLinkCandidates(_0x37486a,_0x4b2187,_0xc88bed)){collectLocalRuntimeSkill(_0x5ccd4f,_0x4ed703,{'appCode':_0x1b04e3,'scopes':_0xc88bed,'code':_0x53fc28,'source':_0x189908(0xba),'linkedPath':_0x4ed703});}}return Array['from'](_0x5ccd4f[_0x189908(0xc5)]())[_0x189908(0xc7)](compareLocalRuntimeSkills);}function a139_0x3c17(_0x4fee90,_0x3b4002){_0x4fee90=_0x4fee90-0xaf;const _0xfede0b=a139_0xfede();let _0x3c17c1=_0xfede0b[_0x4fee90];return _0x3c17c1;}function localSkillEntryDirs(_0x2a8d7d){const _0x37352d=a139_0x3c17;if(!existsSync(_0x2a8d7d))return[];return readdirSync(_0x2a8d7d,{'withFileTypes':!![]})['filter'](_0x424677=>_0x424677[_0x37352d(0xd0)]()||_0x424677['isSymbolicLink']())[_0x37352d(0xcc)](_0x5397a8=>resolve(_0x2a8d7d,_0x5397a8[_0x37352d(0xaf)]));}function localSkillLinkCandidates(_0x3fd58d,_0x361a7d,_0x27ab9d){const _0x5b525c=a139_0x3c17;if(!existsSync(_0x3fd58d))return[];const _0x203dbe=_0x361a7d['appCode']+'--';return readdirSync(_0x3fd58d,{'withFileTypes':!![]})['filter'](_0x23155f=>_0x23155f['isDirectory']()||_0x23155f[_0x5b525c(0xb4)]())[_0x5b525c(0xc3)](_0x4f1468=>_0x361a7d['scope']===_0x5b525c(0xd9)||_0x4f1468[_0x5b525c(0xaf)]['startsWith'](_0x203dbe)||_0x27ab9d[_0x5b525c(0xbf)](_0x5b525c(0xcb)))[_0x5b525c(0xcc)](_0xbd2335=>resolve(_0x3fd58d,_0xbd2335['name']));}function collectLocalRuntimeSkill(_0x1f94d4,_0xff9de5,_0x3497da){const _0xc12744=a139_0x3c17,_0x3cd4ab=resolve(_0xff9de5,METADATA_FILE),_0x267baa=readMetadataIfPresent(_0x3cd4ab);if(!_0x267baa)return;if(_0x267baa[_0xc12744(0xd1)]!==_0x3497da[_0xc12744(0xd1)])return;if(!isRuntimeSkillScope(_0x267baa[_0xc12744(0xb7)])||!_0x3497da[_0xc12744(0xbd)][_0xc12744(0xbf)](_0x267baa[_0xc12744(0xb7)]))return;const _0x5521c0=_0x267baa['skillCode']?.[_0xc12744(0xcf)]();if(!_0x5521c0)return;if(_0x3497da[_0xc12744(0xc8)]&&_0x5521c0!==_0x3497da[_0xc12744(0xc8)])return;const _0x2fc38b=_0x267baa[_0xc12744(0xb7)]+':'+_0x5521c0,_0x1bdc31=_0x3497da['linkedPath']?[_0x3497da['linkedPath']]:[],_0x3f5c44=_0x1f94d4['get'](_0x2fc38b);if(_0x3f5c44){_0x3497da[_0xc12744(0xb9)]==='cache'&&(_0x3f5c44[_0xc12744(0xb2)]=_0xff9de5,_0x3f5c44['cacheDir']=_0xff9de5,_0x3f5c44[_0xc12744(0xd3)]=resolve(_0xff9de5,SKILL_FILE),_0x3f5c44[_0xc12744(0xb5)]=_0x3cd4ab);for(const _0xcde212 of _0x1bdc31){!_0x3f5c44['linkedPaths'][_0xc12744(0xc9)](_0xcde212)&&_0x3f5c44[_0xc12744(0xd5)]['push'](_0xcde212);}_0x3f5c44[_0xc12744(0xd5)][_0xc12744(0xc7)]();return;}_0x1f94d4[_0xc12744(0xc6)](_0x2fc38b,{..._0x267baa,'tags':Array[_0xc12744(0xb1)](_0x267baa['tags'])?_0x267baa[_0xc12744(0xb3)]:[],'scope':_0x267baa['scope'],'source':_0xc12744(0xc0),'dir':_0xff9de5,'cacheDir':_0x3497da[_0xc12744(0xb9)]===_0xc12744(0xda)?_0xff9de5:undefined,'skillMdPath':resolve(_0xff9de5,SKILL_FILE),'metadataPath':_0x3cd4ab,'linkedPaths':_0x1bdc31});}function compareLocalRuntimeSkills(_0x58b412,_0x26a37b){const _0x5b3d87=a139_0x3c17,_0x2b510a={'personal':0x0,'company':0x1,'builtin':0x2};return _0x2b510a[_0x58b412['scope']]-_0x2b510a[_0x26a37b[_0x5b3d87(0xb7)]]||_0x58b412['skillCode'][_0x5b3d87(0xb8)](_0x26a37b[_0x5b3d87(0xbe)])||_0x58b412[_0x5b3d87(0xb2)][_0x5b3d87(0xb8)](_0x26a37b[_0x5b3d87(0xb2)]);}
1
+ (function(_0x3fb989,_0x373114){const _0x3388ab=a139_0x21f1,_0x10df5e=_0x3fb989();while(!![]){try{const _0x3ba938=parseInt(_0x3388ab(0x98))/0x1+parseInt(_0x3388ab(0x79))/0x2+parseInt(_0x3388ab(0xa8))/0x3*(-parseInt(_0x3388ab(0xa0))/0x4)+-parseInt(_0x3388ab(0xa9))/0x5*(-parseInt(_0x3388ab(0x80))/0x6)+-parseInt(_0x3388ab(0xa5))/0x7*(parseInt(_0x3388ab(0x8f))/0x8)+-parseInt(_0x3388ab(0x97))/0x9*(parseInt(_0x3388ab(0xa4))/0xa)+parseInt(_0x3388ab(0x86))/0xb*(parseInt(_0x3388ab(0x93))/0xc);if(_0x3ba938===_0x373114)break;else _0x10df5e['push'](_0x10df5e['shift']());}catch(_0xd25b13){_0x10df5e['push'](_0x10df5e['shift']());}}}(a139_0x3fee,0x34755));function a139_0x21f1(_0x1d7bbe,_0x507ec3){_0x1d7bbe=_0x1d7bbe-0x79;const _0x3fee89=a139_0x3fee();let _0x21f144=_0x3fee89[_0x1d7bbe];return _0x21f144;}import{existsSync,readdirSync}from'node:fs';function a139_0x3fee(){const _0x400457=['get','9mmZNnZ','182285lkygEs','validation','scopes','env','push','name','link','linkedPaths','26252oGBhXi','has','filter','set','1666750JMHusl','1414tbSqJt','builtin','isArray','93lAVdWS','5zIsdbP','829612vGfAvo','sort','dir','metadataPath','trim','skillMdPath','appCode','931338TvnvKU','values','accessKey','startsWith','skillCode','scope','163119eggXyi','cacheDir','map','code','tags','from','linkedPath','isSymbolicLink','local','11912yHmlqk','localeCompare','source','isDirectory','108RjpEOC','\x20!=\x20','cache'];a139_0x3fee=function(){return _0x400457;};return a139_0x3fee();}import{resolve}from'node:path';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{readMetadataIfPresent}from'./metadata.js';import{getRuntimeSkillCacheRoot,safePathSegment}from'./paths.js';import{isRuntimeSkillScope,normalizeRuntimeSkillScopes}from'./scopes.js';export function listLocalRuntimeSkills(_0x4e3367,_0x1354c9,_0x3af7bb={}){const _0x46641b=a139_0x21f1,_0x2827c8=safePathSegment(_0x4e3367[_0x46641b(0x7f)],_0x46641b(0x7f));if(_0x1354c9[_0x46641b(0x7f)]!==_0x2827c8)throw CliErrors[_0x46641b(0x99)]('Runtime\x20Skill\x20install\x20target\x20app\x20mismatch:\x20'+_0x1354c9[_0x46641b(0x7f)]+_0x46641b(0x94)+_0x2827c8);const _0x1fab06=normalizeRuntimeSkillScopes(_0x4e3367[_0x46641b(0x9a)]),_0x5e236d=new Set(_0x1fab06),_0x84621=_0x4e3367[_0x46641b(0x89)]?.[_0x46641b(0x7d)](),_0x48aa03=new Map(),_0x393926=resolve(getRuntimeSkillCacheRoot(_0x4e3367[_0x46641b(0x9b)],_0x4e3367[_0x46641b(0x82)],_0x3af7bb),_0x2827c8);for(const _0x54e6d1 of _0x1fab06){for(const _0x1def19 of localSkillEntryDirs(resolve(_0x393926,_0x54e6d1))){collectLocalRuntimeSkill(_0x48aa03,_0x1def19,{'appCode':_0x2827c8,'scopes':_0x5e236d,'code':_0x84621,'source':'cache'});}}for(const _0x2ecf13 of _0x1354c9['skillRoots']){for(const _0x132dd2 of localSkillLinkCandidates(_0x2ecf13,_0x1354c9,_0x5e236d)){collectLocalRuntimeSkill(_0x48aa03,_0x132dd2,{'appCode':_0x2827c8,'scopes':_0x5e236d,'code':_0x84621,'source':_0x46641b(0x9e),'linkedPath':_0x132dd2});}}return Array[_0x46641b(0x8b)](_0x48aa03[_0x46641b(0x81)]())[_0x46641b(0x7a)](compareLocalRuntimeSkills);}function localSkillEntryDirs(_0x309170){const _0x3a932d=a139_0x21f1;if(!existsSync(_0x309170))return[];return readdirSync(_0x309170,{'withFileTypes':!![]})[_0x3a932d(0xa2)](_0x115296=>_0x115296[_0x3a932d(0x92)]()||_0x115296['isSymbolicLink']())[_0x3a932d(0x88)](_0x127704=>resolve(_0x309170,_0x127704[_0x3a932d(0x9d)]));}function localSkillLinkCandidates(_0x1cd2a0,_0x4102bb,_0x41d2c2){const _0x19310b=a139_0x21f1;if(!existsSync(_0x1cd2a0))return[];const _0x5eb011=_0x4102bb['appCode']+'--';return readdirSync(_0x1cd2a0,{'withFileTypes':!![]})[_0x19310b(0xa2)](_0xfbced=>_0xfbced['isDirectory']()||_0xfbced[_0x19310b(0x8d)]())[_0x19310b(0xa2)](_0x1d62e8=>_0x4102bb[_0x19310b(0x85)]==='project'||_0x1d62e8[_0x19310b(0x9d)][_0x19310b(0x83)](_0x5eb011)||_0x41d2c2[_0x19310b(0xa1)](_0x19310b(0xa6)))[_0x19310b(0x88)](_0x702823=>resolve(_0x1cd2a0,_0x702823[_0x19310b(0x9d)]));}function collectLocalRuntimeSkill(_0x67bad0,_0xf40f46,_0x3a5dba){const _0x3d19fd=a139_0x21f1,_0x2e948f=resolve(_0xf40f46,METADATA_FILE),_0x11d949=readMetadataIfPresent(_0x2e948f);if(!_0x11d949)return;if(_0x11d949[_0x3d19fd(0x7f)]!==_0x3a5dba[_0x3d19fd(0x7f)])return;if(!isRuntimeSkillScope(_0x11d949[_0x3d19fd(0x85)])||!_0x3a5dba[_0x3d19fd(0x9a)]['has'](_0x11d949['scope']))return;const _0x5a8d4b=_0x11d949[_0x3d19fd(0x84)]?.[_0x3d19fd(0x7d)]();if(!_0x5a8d4b)return;if(_0x3a5dba[_0x3d19fd(0x89)]&&_0x5a8d4b!==_0x3a5dba[_0x3d19fd(0x89)])return;const _0x527ff6=_0x11d949['scope']+':'+_0x5a8d4b,_0x3e854d=_0x3a5dba[_0x3d19fd(0x8c)]?[_0x3a5dba[_0x3d19fd(0x8c)]]:[],_0x94164e=_0x67bad0[_0x3d19fd(0x96)](_0x527ff6);if(_0x94164e){_0x3a5dba[_0x3d19fd(0x91)]===_0x3d19fd(0x95)&&(_0x94164e[_0x3d19fd(0x7b)]=_0xf40f46,_0x94164e[_0x3d19fd(0x87)]=_0xf40f46,_0x94164e[_0x3d19fd(0x7e)]=resolve(_0xf40f46,SKILL_FILE),_0x94164e[_0x3d19fd(0x7c)]=_0x2e948f);for(const _0x453c26 of _0x3e854d){!_0x94164e[_0x3d19fd(0x9f)]['includes'](_0x453c26)&&_0x94164e[_0x3d19fd(0x9f)][_0x3d19fd(0x9c)](_0x453c26);}_0x94164e['linkedPaths'][_0x3d19fd(0x7a)]();return;}_0x67bad0[_0x3d19fd(0xa3)](_0x527ff6,{..._0x11d949,'tags':Array[_0x3d19fd(0xa7)](_0x11d949[_0x3d19fd(0x8a)])?_0x11d949[_0x3d19fd(0x8a)]:[],'scope':_0x11d949[_0x3d19fd(0x85)],'source':_0x3d19fd(0x8e),'dir':_0xf40f46,'cacheDir':_0x3a5dba[_0x3d19fd(0x91)]===_0x3d19fd(0x95)?_0xf40f46:undefined,'skillMdPath':resolve(_0xf40f46,SKILL_FILE),'metadataPath':_0x2e948f,'linkedPaths':_0x3e854d});}function compareLocalRuntimeSkills(_0x1ca079,_0x37bcaf){const _0x3fdb0b=a139_0x21f1,_0xbeb40={'personal':0x0,'company':0x1,'builtin':0x2};return _0xbeb40[_0x1ca079[_0x3fdb0b(0x85)]]-_0xbeb40[_0x37bcaf['scope']]||_0x1ca079['skillCode'][_0x3fdb0b(0x90)](_0x37bcaf['skillCode'])||_0x1ca079[_0x3fdb0b(0x7b)][_0x3fdb0b(0x90)](_0x37bcaf['dir']);}
@@ -1 +1 @@
1
- (function(_0x9469c3,_0x20a61c){const _0x4fdd8f=a140_0x1d7a,_0x356b6b=_0x9469c3();while(!![]){try{const _0x499960=parseInt(_0x4fdd8f(0x12a))/0x1*(-parseInt(_0x4fdd8f(0x12e))/0x2)+-parseInt(_0x4fdd8f(0x129))/0x3*(-parseInt(_0x4fdd8f(0x148))/0x4)+-parseInt(_0x4fdd8f(0x136))/0x5*(parseInt(_0x4fdd8f(0x150))/0x6)+parseInt(_0x4fdd8f(0x126))/0x7+-parseInt(_0x4fdd8f(0x149))/0x8+-parseInt(_0x4fdd8f(0x14e))/0x9+parseInt(_0x4fdd8f(0x137))/0xa;if(_0x499960===_0x20a61c)break;else _0x356b6b['push'](_0x356b6b['shift']());}catch(_0x553859){_0x356b6b['push'](_0x356b6b['shift']());}}}(a140_0x230a,0x63d5f));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(_0x43c5e3){const _0x2ff170=a140_0x1d7a;return _0x43c5e3[_0x2ff170(0x12c)]??Buffer[_0x2ff170(0x13b)](_0x43c5e3[_0x2ff170(0x13c)]??'','utf8');}export function fileText(_0x21e3d2){const _0x310f4f=a140_0x1d7a;return fileContent(_0x21e3d2)[_0x310f4f(0x133)](_0x310f4f(0x12d));}export function normalizeLocalFiles(_0x5e11cd){const _0x34f171=a140_0x1d7a;if(!Array[_0x34f171(0x127)](_0x5e11cd)||_0x5e11cd[_0x34f171(0x14a)]===0x0)return[];const _0x5be3af=new Map();for(const _0x21b35f of _0x5e11cd){if(!_0x21b35f||typeof _0x21b35f!=='object'||typeof _0x21b35f['path']!==_0x34f171(0x145))throw CliErrors['validation'](_0x34f171(0x139));const _0x39962f=normalizeSkillRelativePath(_0x21b35f[_0x34f171(0x144)]);if(_0x5be3af[_0x34f171(0x131)](_0x39962f))throw CliErrors[_0x34f171(0x135)](_0x34f171(0x13f)+_0x39962f);if(_0x21b35f[_0x34f171(0x12c)]!==undefined&&!Buffer['isBuffer'](_0x21b35f[_0x34f171(0x12c)]))throw CliErrors['validation']('Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20'+_0x39962f);if(_0x21b35f[_0x34f171(0x12c)]===undefined&&typeof _0x21b35f[_0x34f171(0x13c)]!==_0x34f171(0x145))throw CliErrors[_0x34f171(0x135)](_0x34f171(0x140)+_0x39962f);const _0x1dffb5=fileContent(_0x21b35f);_0x5be3af['set'](_0x39962f,{'path':_0x39962f,'bytes':_0x1dffb5});}return Array['from'](_0x5be3af[_0x34f171(0x14c)]())['sort'](compareSkillFiles);}function a140_0x230a(){const _0x18e33=['isSymbolicLink','includes','trim','path','string','startsWith','size','16JpSRNQ','5115192jiSEhd','length','add','values','replace','5294610smrNke','isFile','96QprLlh','test','object','Skill\x20file\x20sha256\x20is\x20invalid:\x20','3603733tjvdYd','isArray','Skill\x20file\x20size\x20is\x20invalid:\x20','74097nccezc','1oOyZqB','name','bytes','utf8','1337566DTnhCS','Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20','split','has','isDirectory','toString','localeCompare','validation','32880mddphS','17970000HvuoxB','excludedFilePaths','Skill\x20file\x20path\x20must\x20be\x20text.','compare','from','content','sort','sha256','Duplicate\x20Skill\x20file\x20path:\x20','Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20'];a140_0x230a=function(){return _0x18e33;};return a140_0x230a();}export function normalizeManifestFiles(_0xaab96f){const _0x1c35c8=a140_0x1d7a;if(!Array['isArray'](_0xaab96f)||_0xaab96f[_0x1c35c8(0x14a)]===0x0)return[];const _0x4e77a8=new Map();for(const _0x11a4dd of _0xaab96f){if(!_0x11a4dd||typeof _0x11a4dd!==_0x1c35c8(0x152)||typeof _0x11a4dd[_0x1c35c8(0x144)]!==_0x1c35c8(0x145))throw CliErrors[_0x1c35c8(0x135)](_0x1c35c8(0x139));const _0x46fc53=normalizeSkillRelativePath(_0x11a4dd[_0x1c35c8(0x144)]);if(_0x4e77a8[_0x1c35c8(0x131)](_0x46fc53))throw CliErrors['validation'](_0x1c35c8(0x13f)+_0x46fc53);if(!isSha256Hex(_0x11a4dd[_0x1c35c8(0x13e)]))throw CliErrors[_0x1c35c8(0x135)](_0x1c35c8(0x153)+_0x46fc53);if(!Number['isSafeInteger'](_0x11a4dd[_0x1c35c8(0x147)])||_0x11a4dd[_0x1c35c8(0x147)]<0x0)throw CliErrors[_0x1c35c8(0x135)](_0x1c35c8(0x128)+_0x46fc53);_0x4e77a8['set'](_0x46fc53,{'path':_0x46fc53,'sha256':_0x11a4dd[_0x1c35c8(0x13e)]['toLowerCase'](),'size':_0x11a4dd['size']});}return Array[_0x1c35c8(0x13b)](_0x4e77a8[_0x1c35c8(0x14c)]())['sort'](compareSkillFiles);}export function scanSkillDirectory(_0xd02dac,_0xff0f93={}){const _0xc5d87d=a140_0x1d7a,_0x3fa838=realpathSync(_0xd02dac),_0x56c712=canonicalExcludedFilePaths(_0xff0f93[_0xc5d87d(0x138)]),_0x291e40=[];function _0x30442d(_0x1360e4){const _0x5b6979=_0xc5d87d,_0x3b2b63=readdirSync(_0x1360e4,{'withFileTypes':!![]})[_0x5b6979(0x13d)]((_0x5f63f6,_0x51f7e2)=>_0x5f63f6['name'][_0x5b6979(0x134)](_0x51f7e2[_0x5b6979(0x12b)]));for(const _0x40a4da of _0x3b2b63){if(_0x40a4da[_0x5b6979(0x132)]()&&IGNORED_DIR_NAMES[_0x5b6979(0x131)](_0x40a4da[_0x5b6979(0x12b)]))continue;if(IGNORED_FILE_NAMES[_0x5b6979(0x131)](_0x40a4da[_0x5b6979(0x12b)]))continue;const _0x40f479=resolve(_0x1360e4,_0x40a4da['name']);if(isExcludedFilePath(_0x40f479,_0x56c712))continue;if(_0x40a4da[_0x5b6979(0x141)]())throw CliErrors[_0x5b6979(0x135)](_0x5b6979(0x12f)+_0x40f479);const _0x22595c=toPosixPath(relative(_0x3fa838,_0x40f479));if(_0x40a4da[_0x5b6979(0x132)]()){_0x30442d(_0x40f479);continue;}if(!_0x40a4da[_0x5b6979(0x14f)]())continue;validateSkillRelativePath(_0x22595c);const _0x3f7fd3=readFileSync(_0x40f479);_0x291e40['push']({'path':_0x22595c,'bytes':_0x3f7fd3});}}return _0x30442d(_0x3fa838),normalizeLocalFiles(_0x291e40);}function canonicalExcludedFilePaths(_0x43f3fa){const _0x4ae26a=a140_0x1d7a,_0x45b850=new Set();for(const _0x41a948 of _0x43f3fa??[]){const _0x511049=resolve(_0x41a948);_0x45b850[_0x4ae26a(0x14b)](_0x511049);try{_0x45b850[_0x4ae26a(0x14b)](realpathSync(_0x511049));}catch{}}return _0x45b850;}function isExcludedFilePath(_0x3584f8,_0x5a20b2){const _0xff0b60=a140_0x1d7a;if(_0x5a20b2[_0xff0b60(0x131)](_0x3584f8))return!![];if(_0x5a20b2[_0xff0b60(0x147)]===0x0)return![];try{return _0x5a20b2[_0xff0b60(0x131)](realpathSync(_0x3584f8));}catch{return![];}}export function compareSkillFiles(_0x44f9e2,_0x53c129){const _0x336e68=a140_0x1d7a;if(_0x44f9e2[_0x336e68(0x144)]===SKILL_FILE)return _0x53c129['path']===SKILL_FILE?0x0:-0x1;if(_0x53c129[_0x336e68(0x144)]===SKILL_FILE)return 0x1;return Buffer[_0x336e68(0x13a)](Buffer[_0x336e68(0x13b)](_0x44f9e2[_0x336e68(0x144)],_0x336e68(0x12d)),Buffer['from'](_0x53c129[_0x336e68(0x144)],_0x336e68(0x12d)));}export function normalizeSkillRelativePath(_0x112da4){const _0x3315a6=a140_0x1d7a,_0x4335cb=toPosixPath(_0x112da4[_0x3315a6(0x143)]());return validateSkillRelativePath(_0x4335cb),_0x4335cb;}function a140_0x1d7a(_0xba82aa,_0x5e3dd5){_0xba82aa=_0xba82aa-0x126;const _0x230a24=a140_0x230a();let _0x1d7a66=_0x230a24[_0xba82aa];return _0x1d7a66;}export function validateSkillRelativePath(_0x441097){const _0x2df739=a140_0x1d7a;if(!_0x441097||_0x441097[_0x2df739(0x146)]('/')||_0x441097[_0x2df739(0x142)]('//'))throw CliErrors[_0x2df739(0x135)]('Unsafe\x20Skill\x20file\x20path:\x20'+_0x441097);for(const _0xedcbe8 of _0x441097[_0x2df739(0x130)]('/')){if(!_0xedcbe8||_0xedcbe8==='.'||_0xedcbe8==='..')throw CliErrors[_0x2df739(0x135)]('Unsafe\x20Skill\x20file\x20path:\x20'+_0x441097);}}export function toPosixPath(_0x5db5ec){const _0x1c952=a140_0x1d7a;return _0x5db5ec[_0x1c952(0x14d)](/\\/g,'/');}export function isSha256Hex(_0x1d0d7b){const _0x53da48=a140_0x1d7a;return typeof _0x1d0d7b==='string'&&/^[a-fA-F0-9]{64}$/[_0x53da48(0x151)](_0x1d0d7b);}
1
+ (function(_0x882620,_0x3d1154){const _0x376fac=a140_0x2a7f,_0x5a5ac8=_0x882620();while(!![]){try{const _0x5d1dc9=parseInt(_0x376fac(0xf7))/0x1*(-parseInt(_0x376fac(0xd9))/0x2)+-parseInt(_0x376fac(0xe8))/0x3*(parseInt(_0x376fac(0xd8))/0x4)+-parseInt(_0x376fac(0xe2))/0x5+-parseInt(_0x376fac(0x103))/0x6*(parseInt(_0x376fac(0xd6))/0x7)+-parseInt(_0x376fac(0xee))/0x8*(parseInt(_0x376fac(0xf8))/0x9)+-parseInt(_0x376fac(0x102))/0xa*(parseInt(_0x376fac(0xf9))/0xb)+parseInt(_0x376fac(0x100))/0xc;if(_0x5d1dc9===_0x3d1154)break;else _0x5a5ac8['push'](_0x5a5ac8['shift']());}catch(_0x12400c){_0x5a5ac8['push'](_0x5a5ac8['shift']());}}}(a140_0x530a,0x20c6d));import{readFileSync,readdirSync,realpathSync}from'node:fs';import{relative,resolve}from'node:path';import{CliErrors}from'../../errors.js';import{IGNORED_DIR_NAMES,IGNORED_FILE_NAMES,SKILL_FILE}from'./constants.js';export function fileContent(_0x1252ab){const _0x520e98=a140_0x2a7f;return _0x1252ab[_0x520e98(0xe1)]??Buffer[_0x520e98(0xd7)](_0x1252ab[_0x520e98(0xeb)]??'',_0x520e98(0x105));}function a140_0x530a(){const _0x1504f4=['111666aGhdJS','isBuffer','values','Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20','isSymbolicLink','add','isSafeInteger','name','bytes','39495xaBgRl','localeCompare','Unsafe\x20Skill\x20file\x20path:\x20','replace','isArray','excludedFilePaths','1929TzEcfP','size','Duplicate\x20Skill\x20file\x20path:\x20','content','length','sha256','8Jaqjvk','path','startsWith','isDirectory','Skill\x20file\x20size\x20is\x20invalid:\x20','split','object','isFile','Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20','1dGcEKW','2384937TqbJel','33oNSSOy','string','toLowerCase','Skill\x20file\x20path\x20must\x20be\x20text.','set','has','push','10638384Ekudeo','includes','526860zglxIo','6WdJeCV','sort','utf8','validation','467663MpbgdE','from','1236xAfQyO'];a140_0x530a=function(){return _0x1504f4;};return a140_0x530a();}export function fileText(_0x1de50c){const _0x7ce9d7=a140_0x2a7f;return fileContent(_0x1de50c)['toString'](_0x7ce9d7(0x105));}export function normalizeLocalFiles(_0x37dc80){const _0x47bf56=a140_0x2a7f;if(!Array['isArray'](_0x37dc80)||_0x37dc80[_0x47bf56(0xec)]===0x0)return[];const _0x25f695=new Map();for(const _0x3f16e4 of _0x37dc80){if(!_0x3f16e4||typeof _0x3f16e4!==_0x47bf56(0xf4)||typeof _0x3f16e4[_0x47bf56(0xef)]!==_0x47bf56(0xfa))throw CliErrors[_0x47bf56(0x106)](_0x47bf56(0xfc));const _0x32fc3a=normalizeSkillRelativePath(_0x3f16e4[_0x47bf56(0xef)]);if(_0x25f695[_0x47bf56(0xfe)](_0x32fc3a))throw CliErrors[_0x47bf56(0x106)](_0x47bf56(0xea)+_0x32fc3a);if(_0x3f16e4[_0x47bf56(0xe1)]!==undefined&&!Buffer[_0x47bf56(0xda)](_0x3f16e4[_0x47bf56(0xe1)]))throw CliErrors['validation'](_0x47bf56(0xdc)+_0x32fc3a);if(_0x3f16e4[_0x47bf56(0xe1)]===undefined&&typeof _0x3f16e4[_0x47bf56(0xeb)]!==_0x47bf56(0xfa))throw CliErrors[_0x47bf56(0x106)]('Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20'+_0x32fc3a);const _0x21ab7b=fileContent(_0x3f16e4);_0x25f695[_0x47bf56(0xfd)](_0x32fc3a,{'path':_0x32fc3a,'bytes':_0x21ab7b});}return Array['from'](_0x25f695[_0x47bf56(0xdb)]())['sort'](compareSkillFiles);}export function normalizeManifestFiles(_0xb0083c){const _0x144125=a140_0x2a7f;if(!Array[_0x144125(0xe6)](_0xb0083c)||_0xb0083c[_0x144125(0xec)]===0x0)return[];const _0x506d4e=new Map();for(const _0x42da23 of _0xb0083c){if(!_0x42da23||typeof _0x42da23!==_0x144125(0xf4)||typeof _0x42da23[_0x144125(0xef)]!==_0x144125(0xfa))throw CliErrors[_0x144125(0x106)](_0x144125(0xfc));const _0x12d1d8=normalizeSkillRelativePath(_0x42da23[_0x144125(0xef)]);if(_0x506d4e[_0x144125(0xfe)](_0x12d1d8))throw CliErrors[_0x144125(0x106)](_0x144125(0xea)+_0x12d1d8);if(!isSha256Hex(_0x42da23['sha256']))throw CliErrors[_0x144125(0x106)]('Skill\x20file\x20sha256\x20is\x20invalid:\x20'+_0x12d1d8);if(!Number[_0x144125(0xdf)](_0x42da23[_0x144125(0xe9)])||_0x42da23['size']<0x0)throw CliErrors[_0x144125(0x106)](_0x144125(0xf2)+_0x12d1d8);_0x506d4e[_0x144125(0xfd)](_0x12d1d8,{'path':_0x12d1d8,'sha256':_0x42da23[_0x144125(0xed)][_0x144125(0xfb)](),'size':_0x42da23['size']});}return Array['from'](_0x506d4e['values']())[_0x144125(0x104)](compareSkillFiles);}export function scanSkillDirectory(_0x12dbdd,_0x11a35c={}){const _0x2b9e87=a140_0x2a7f,_0x54a859=realpathSync(_0x12dbdd),_0x5e68c5=canonicalExcludedFilePaths(_0x11a35c[_0x2b9e87(0xe7)]),_0x300eb7=[];function _0x2aa594(_0x64eb83){const _0x294ce4=_0x2b9e87,_0x4ed1fd=readdirSync(_0x64eb83,{'withFileTypes':!![]})[_0x294ce4(0x104)]((_0x4f9e4d,_0xabc827)=>_0x4f9e4d[_0x294ce4(0xe0)][_0x294ce4(0xe3)](_0xabc827[_0x294ce4(0xe0)]));for(const _0x44839a of _0x4ed1fd){if(_0x44839a['isDirectory']()&&IGNORED_DIR_NAMES[_0x294ce4(0xfe)](_0x44839a[_0x294ce4(0xe0)]))continue;if(IGNORED_FILE_NAMES[_0x294ce4(0xfe)](_0x44839a['name']))continue;const _0x8047ad=resolve(_0x64eb83,_0x44839a[_0x294ce4(0xe0)]);if(isExcludedFilePath(_0x8047ad,_0x5e68c5))continue;if(_0x44839a[_0x294ce4(0xdd)]())throw CliErrors[_0x294ce4(0x106)](_0x294ce4(0xf6)+_0x8047ad);const _0x1b9780=toPosixPath(relative(_0x54a859,_0x8047ad));if(_0x44839a[_0x294ce4(0xf1)]()){_0x2aa594(_0x8047ad);continue;}if(!_0x44839a[_0x294ce4(0xf5)]())continue;validateSkillRelativePath(_0x1b9780);const _0xe38e76=readFileSync(_0x8047ad);_0x300eb7[_0x294ce4(0xff)]({'path':_0x1b9780,'bytes':_0xe38e76});}}return _0x2aa594(_0x54a859),normalizeLocalFiles(_0x300eb7);}function canonicalExcludedFilePaths(_0x18a317){const _0x3764af=a140_0x2a7f,_0x229f84=new Set();for(const _0x322e85 of _0x18a317??[]){const _0x22e74c=resolve(_0x322e85);_0x229f84[_0x3764af(0xde)](_0x22e74c);try{_0x229f84['add'](realpathSync(_0x22e74c));}catch{}}return _0x229f84;}function isExcludedFilePath(_0x2b1b69,_0xef6684){const _0x44402c=a140_0x2a7f;if(_0xef6684[_0x44402c(0xfe)](_0x2b1b69))return!![];if(_0xef6684[_0x44402c(0xe9)]===0x0)return![];try{return _0xef6684['has'](realpathSync(_0x2b1b69));}catch{return![];}}function a140_0x2a7f(_0xc7d750,_0x30b978){_0xc7d750=_0xc7d750-0xd6;const _0x530aa2=a140_0x530a();let _0x2a7f2c=_0x530aa2[_0xc7d750];return _0x2a7f2c;}export function compareSkillFiles(_0x157e41,_0x3606bd){const _0x2f86a3=a140_0x2a7f;if(_0x157e41[_0x2f86a3(0xef)]===SKILL_FILE)return _0x3606bd[_0x2f86a3(0xef)]===SKILL_FILE?0x0:-0x1;if(_0x3606bd[_0x2f86a3(0xef)]===SKILL_FILE)return 0x1;return Buffer['compare'](Buffer[_0x2f86a3(0xd7)](_0x157e41[_0x2f86a3(0xef)],'utf8'),Buffer[_0x2f86a3(0xd7)](_0x3606bd[_0x2f86a3(0xef)],_0x2f86a3(0x105)));}export function normalizeSkillRelativePath(_0x1cb6d4){const _0x4396e6=toPosixPath(_0x1cb6d4['trim']());return validateSkillRelativePath(_0x4396e6),_0x4396e6;}export function validateSkillRelativePath(_0x5037b0){const _0x3d46ae=a140_0x2a7f;if(!_0x5037b0||_0x5037b0[_0x3d46ae(0xf0)]('/')||_0x5037b0[_0x3d46ae(0x101)]('//'))throw CliErrors[_0x3d46ae(0x106)](_0x3d46ae(0xe4)+_0x5037b0);for(const _0x7bea4d of _0x5037b0[_0x3d46ae(0xf3)]('/')){if(!_0x7bea4d||_0x7bea4d==='.'||_0x7bea4d==='..')throw CliErrors['validation'](_0x3d46ae(0xe4)+_0x5037b0);}}export function toPosixPath(_0x5b58ff){const _0x3f0ecd=a140_0x2a7f;return _0x5b58ff[_0x3f0ecd(0xe5)](/\\/g,'/');}export function isSha256Hex(_0x48b0d0){const _0x5336c3=a140_0x2a7f;return typeof _0x48b0d0===_0x5336c3(0xfa)&&/^[a-fA-F0-9]{64}$/['test'](_0x48b0d0);}
@@ -1 +1 @@
1
- (function(_0x35bc33,_0x54d69c){const _0x1707d4=a141_0x2c1b,_0x58aa26=_0x35bc33();while(!![]){try{const _0x94a828=-parseInt(_0x1707d4(0x147))/0x1+parseInt(_0x1707d4(0x124))/0x2+parseInt(_0x1707d4(0x136))/0x3*(parseInt(_0x1707d4(0x114))/0x4)+-parseInt(_0x1707d4(0x130))/0x5+parseInt(_0x1707d4(0x122))/0x6*(parseInt(_0x1707d4(0x113))/0x7)+-parseInt(_0x1707d4(0x125))/0x8+-parseInt(_0x1707d4(0x135))/0x9*(-parseInt(_0x1707d4(0x11d))/0xa);if(_0x94a828===_0x54d69c)break;else _0x58aa26['push'](_0x58aa26['shift']());}catch(_0x3f47fd){_0x58aa26['push'](_0x58aa26['shift']());}}}(a141_0x23b1,0x3b6b3));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_0x23b1(){const _0x3d9c92=['Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20','displayName','10KPHhuB','Runtime\x20Skill\x20package\x20is\x20missing\x20','displayName:\x20','has','contents','162984FdrsSq','toString','922178PToKUB','2799088BYnrHo','isFile','force','packageBytes','name:\x20','Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20','---\x0a','---','accessKey','Managed\x20file\x20was\x20removed\x20locally:\x20','replace','1534850ERMRRm','version','entries','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','stringify','2899035AgvZbH','6261fxxBpm','test','description:\x20','env','validation','length','.\x20Changed\x20file:\x20','errors','trim','example','description','contentHash','scope','keys','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.','find','delete','52148pvjgFj','path','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','pulledAt','appCode','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','match','paths','\x0a---\x0a\x0a','name','utf8','28glXOnZ','116tchIUw','map','flow','skillName','status','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','fileHashes'];a141_0x23b1=function(){return _0x3d9c92;};return a141_0x23b1();}import{resolveManagedFilePath,writeBytesAtomic,writeJsonAtomic}from'./fs-utils.js';import{bufferSha256,contentHash,fileHash}from'./hashing.js';import{fileContent,fileText,normalizeLocalFiles}from'./local-files.js';function a141_0x2c1b(_0x1ac275,_0x193c16){_0x1ac275=_0x1ac275-0x10c;const _0x23b19c=a141_0x23b1();let _0x2c1ba2=_0x23b19c[_0x1ac275];return _0x2c1ba2;}import{buildMetadata,readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillDir}from'./paths.js';import{extractDownloadedPackage,requirePackageBytes}from'./zip-package.js';export function materializeRuntimeSkill(_0x5125a4,_0x2c0144,_0x30a13d){const _0x4415c4=a141_0x2c1b,_0x5bc14f=requireSkillCode(_0x5125a4),_0x43128b=requirePackageBytes(_0x5bc14f,_0x30a13d[_0x4415c4(0x128)]),_0x43a014=extractDownloadedPackage(_0x43128b),_0x304bf5=_0x43a014[_0x4415c4(0x145)](_0x4ff8b2=>_0x4ff8b2[_0x4415c4(0x148)]===SKILL_FILE);if(!_0x304bf5)throw CliErrors[_0x4415c4(0x13a)](_0x4415c4(0x11e)+SKILL_FILE+':\x20'+_0x5bc14f);const _0x18c4ae=withMaterializedSkillFrontmatter(_0x43a014,_0x5125a4,_0x5bc14f),_0x5bff73=_0x18c4ae[_0x4415c4(0x145)](_0x1b37a1=>_0x1b37a1['path']===SKILL_FILE),_0x28bb0f=fileText(_0x5bff73),_0x107c0b=getRuntimeSkillDir(_0x30a13d[_0x4415c4(0x139)],_0x30a13d[_0x4415c4(0x12d)],_0x30a13d[_0x4415c4(0x10c)],_0x2c0144,_0x5bc14f,_0x30a13d[_0x4415c4(0x10f)]),_0x4548de=resolve(_0x107c0b,SKILL_FILE),_0x3977bc=resolve(_0x107c0b,METADATA_FILE),_0x56e6c9=contentHash(_0x28bb0f),_0x5e34be=readMetadataIfPresent(_0x3977bc)?.[_0x4415c4(0x11a)];ensurePulledFilesCanBeOverwritten(_0x107c0b,_0x3977bc,_0x18c4ae,_0x30a13d[_0x4415c4(0x127)]===!![]),mkdirSync(_0x107c0b,{'recursive':!![],'mode':0x1c0});const _0x12f00b=existsSync(_0x4548de)?readFileSync(_0x4548de,_0x4415c4(0x112)):undefined;return materializeFiles(_0x107c0b,_0x18c4ae),removeStaleManagedFiles(_0x107c0b,_0x5e34be,_0x18c4ae),writeJsonAtomic(_0x3977bc,buildMetadata(_0x5125a4,_0x2c0144,_0x30a13d['appCode'],_0x56e6c9,_0x30a13d[_0x4415c4(0x14a)],_0x18c4ae,_0x43128b)),{'skill':_0x5125a4,'scope':_0x2c0144,'dir':_0x107c0b,'skillMdPath':_0x4548de,'metadataPath':_0x3977bc,'contentHash':_0x56e6c9,'changed':_0x12f00b!==_0x28bb0f};}export function reuseMaterializedRuntimeSkill(_0x4eb881,_0x508e82,_0x5475f7){const _0x53f10a=a141_0x2c1b,_0x28da0e=_0x4eb881['version']?.[_0x53f10a(0x13e)]();if(!_0x28da0e)return undefined;const _0xe63793=requireSkillCode(_0x4eb881),_0x242379=getRuntimeSkillDir(_0x5475f7[_0x53f10a(0x139)],_0x5475f7[_0x53f10a(0x12d)],_0x5475f7[_0x53f10a(0x10c)],_0x508e82,_0xe63793,_0x5475f7['paths']),_0x1eb9c9=resolve(_0x242379,SKILL_FILE),_0x46b06c=resolve(_0x242379,METADATA_FILE),_0x5f04aa=readMetadataIfPresent(_0x46b06c);if(!_0x5f04aa||_0x5f04aa['schemaVersion']!==0x2||_0x5f04aa[_0x53f10a(0x10c)]!==_0x5475f7['appCode']||_0x5f04aa[_0x53f10a(0x142)]!==_0x508e82||_0x5f04aa['skillCode']!==_0xe63793||_0x5f04aa[_0x53f10a(0x131)]!==_0x28da0e||_0x5f04aa['id']!==_0x4eb881['id']||_0x5f04aa['skillName']!==_0x4eb881[_0x53f10a(0x117)]||_0x5f04aa[_0x53f10a(0x140)]!==_0x4eb881[_0x53f10a(0x140)]||_0x5f04aa[_0x53f10a(0x13f)]!==_0x4eb881['example']||_0x5f04aa[_0x53f10a(0x118)]!==_0x4eb881['status']||!_0x5f04aa[_0x53f10a(0x141)]||!_0x5f04aa[_0x53f10a(0x11a)]||!Object['hasOwn'](_0x5f04aa[_0x53f10a(0x11a)],SKILL_FILE))return undefined;for(const [_0xd51f15,_0x6c3994]of Object[_0x53f10a(0x132)](_0x5f04aa[_0x53f10a(0x11a)])){if(!/^[a-f0-9]{64}$/[_0x53f10a(0x137)](_0x6c3994))return undefined;const _0x3fda4d=resolveManagedFilePath(_0x242379,_0xd51f15);if(!existsSync(_0x3fda4d)||!lstatSync(_0x3fda4d)['isFile']())return undefined;if(bufferSha256(readFileSync(_0x3fda4d))!==_0x6c3994)return undefined;}return{'skill':_0x4eb881,'scope':_0x508e82,'dir':_0x242379,'skillMdPath':_0x1eb9c9,'metadataPath':_0x46b06c,'contentHash':_0x5f04aa[_0x53f10a(0x141)],'changed':![]};}function withMaterializedSkillFrontmatter(_0x182f35,_0x4f6534,_0xc0c57){const _0x3f5688=a141_0x2c1b,_0x57b792=skillDisplayName(_0x4f6534,_0xc0c57),_0x2b67cd=_0x4f6534[_0x3f5688(0x140)]?.[_0x3f5688(0x13e)]()||_0x57b792||_0xc0c57;return normalizeLocalFiles(_0x182f35)[_0x3f5688(0x115)](_0x379383=>{const _0x2d033f=_0x3f5688,_0x1e5a2c=fileText(_0x379383);if(_0x379383['path']!==SKILL_FILE)return _0x379383;if(hasYamlFrontmatter(_0x1e5a2c))return{'path':_0x379383[_0x2d033f(0x148)],'content':withSyncedDisplayName(_0x1e5a2c,_0x57b792)};return{'path':_0x379383['path'],'content':prependSkillFrontmatter(_0x1e5a2c,{'name':_0xc0c57,'displayName':_0x57b792,'description':_0x2b67cd})};});}function hasYamlFrontmatter(_0x54e5a1){const _0x5a71f9=a141_0x2c1b;return/^\uFEFF?---\s*\r?\n/[_0x5a71f9(0x137)](_0x54e5a1);}function prependSkillFrontmatter(_0xf0b81f,_0x480c7e){const _0xf4e8ef=a141_0x2c1b,_0x24bfba=_0xf0b81f[_0xf4e8ef(0x12f)](/^\uFEFF/,'');return[_0xf4e8ef(0x12c),_0xf4e8ef(0x129)+yamlString(_0x480c7e[_0xf4e8ef(0x111)]),_0x480c7e['displayName']?_0xf4e8ef(0x11f)+yamlString(_0x480c7e['displayName']):undefined,_0xf4e8ef(0x138)+yamlString(_0x480c7e[_0xf4e8ef(0x140)]),_0xf4e8ef(0x12c),'',_0x24bfba]['filter'](_0x4f7a6b=>_0x4f7a6b!==undefined)['join']('\x0a');}function yamlString(_0x1cd487){const _0x48316e=a141_0x2c1b;return JSON[_0x48316e(0x134)](_0x1cd487['replace'](/\r/g,'')[_0x48316e(0x13e)]());}function skillDisplayName(_0x9c46cc,_0xbcdc2b){const _0x4f9094=a141_0x2c1b,_0x127b6c=_0x9c46cc['skillName']?.[_0x4f9094(0x13e)]();return _0x127b6c||_0xbcdc2b;}function withSyncedDisplayName(_0x373528,_0x3afc2f){const _0x3efa20=a141_0x2c1b,_0x2644d9=_0x373528[_0x3efa20(0x10e)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x2644d9)return _0x373528;const _0x2e1266=_0x2644d9[0x1]??'',_0x1f9977=_0x2644d9[0x2]??'',_0x3d626a=parseDocument(_0x1f9977);if(_0x3d626a[_0x3efa20(0x13d)][_0x3efa20(0x13b)]>0x0||!isMap(_0x3d626a[_0x3efa20(0x121)]))return _0x373528;if(_0x3afc2f)_0x3d626a['set'](_0x3efa20(0x11c),_0x3afc2f);else{if(_0x3d626a[_0x3efa20(0x120)](_0x3efa20(0x11c)))_0x3d626a[_0x3efa20(0x146)](_0x3efa20(0x11c));else return _0x373528;}forceBlockCollections(_0x3d626a['contents']);const _0x2fc56a=_0x3d626a[_0x3efa20(0x123)]({'lineWidth':0x0})['trimEnd'](),_0x1d73f7=_0x373528['slice'](_0x2644d9[0x0]['length'])[_0x3efa20(0x12f)](/^\r?\n/,'');return _0x2e1266+_0x3efa20(0x12b)+_0x2fc56a+_0x3efa20(0x110)+_0x1d73f7;}function forceBlockCollections(_0x544e84){if(!isNode(_0x544e84))return;visit(_0x544e84,(_0x2e9cf8,_0x4c5cdd)=>{const _0x54d298=a141_0x2c1b;isCollection(_0x4c5cdd)&&(_0x4c5cdd[_0x54d298(0x116)]=![]);});}function ensurePulledFilesCanBeOverwritten(_0x472d27,_0x38d9ea,_0x19761b,_0x2c1a3b){const _0x5ef6e7=a141_0x2c1b;if(_0x2c1a3b||!existsSync(_0x38d9ea))return;const _0x24e51e=readMetadataIfPresent(_0x38d9ea);if(!_0x24e51e)return;const _0x18b7aa=_0x24e51e[_0x5ef6e7(0x11a)]&&Object[_0x5ef6e7(0x143)](_0x24e51e[_0x5ef6e7(0x11a)])[_0x5ef6e7(0x13b)]>0x0?_0x24e51e[_0x5ef6e7(0x11a)]:undefined;if(_0x18b7aa)for(const [_0x543163,_0x561085]of Object[_0x5ef6e7(0x132)](_0x18b7aa)){const _0x44f3c5=resolveManagedFilePath(_0x472d27,_0x543163);if(!existsSync(_0x44f3c5))throw CliErrors[_0x5ef6e7(0x13a)](_0x5ef6e7(0x149)+_0x472d27,_0x5ef6e7(0x12e)+_0x543163);const _0x10035d=lstatSync(_0x44f3c5);if(!_0x10035d['isFile']())throw CliErrors[_0x5ef6e7(0x13a)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x472d27,_0x5ef6e7(0x12a)+_0x543163);const _0x591e63=bufferSha256(readFileSync(_0x44f3c5));if(_0x591e63!==_0x561085)throw CliErrors['validation'](_0x5ef6e7(0x149)+_0x472d27+_0x5ef6e7(0x13c)+_0x543163,_0x5ef6e7(0x119)+_0x543163);}else{const _0x399959=resolve(_0x472d27,SKILL_FILE);if(existsSync(_0x399959)&&_0x24e51e[_0x5ef6e7(0x141)]){const _0x53daaa=contentHash(readFileSync(_0x399959,'utf8'));if(_0x53daaa!==_0x24e51e[_0x5ef6e7(0x141)])throw CliErrors[_0x5ef6e7(0x13a)](_0x5ef6e7(0x133)+_0x399959,_0x5ef6e7(0x144));}}for(const _0x543125 of normalizeLocalFiles(_0x19761b)){if(_0x18b7aa?.[_0x543125[_0x5ef6e7(0x148)]])continue;if(!_0x18b7aa&&_0x543125[_0x5ef6e7(0x148)]===SKILL_FILE)continue;const _0x59205b=resolveManagedFilePath(_0x472d27,_0x543125['path']);if(!existsSync(_0x59205b))continue;const _0x374060=lstatSync(_0x59205b);if(!_0x374060[_0x5ef6e7(0x126)]())throw CliErrors[_0x5ef6e7(0x13a)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x472d27,_0x5ef6e7(0x10d)+_0x543125[_0x5ef6e7(0x148)]);const _0x3c7cbf=bufferSha256(readFileSync(_0x59205b));if(_0x3c7cbf!==fileHash(_0x543125))throw CliErrors['validation'](_0x5ef6e7(0x149)+_0x472d27,_0x5ef6e7(0x11b)+_0x543125[_0x5ef6e7(0x148)]);}}function materializeFiles(_0x584390,_0xe09beb){for(const _0x5637e9 of normalizeLocalFiles(_0xe09beb)){const _0x2adc64=resolveManagedFilePath(_0x584390,_0x5637e9['path']);mkdirSync(dirname(_0x2adc64),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x2adc64,fileContent(_0x5637e9),0x180);}}function removeStaleManagedFiles(_0x2abe97,_0x2ace9a,_0x198aba){const _0x2f22de=a141_0x2c1b;if(!_0x2ace9a)return;const _0x510128=new Set(normalizeLocalFiles(_0x198aba)[_0x2f22de(0x115)](_0x296c29=>_0x296c29[_0x2f22de(0x148)]));for(const _0x43b5b9 of Object[_0x2f22de(0x143)](_0x2ace9a)){if(_0x510128[_0x2f22de(0x120)](_0x43b5b9))continue;const _0xd18401=resolveManagedFilePath(_0x2abe97,_0x43b5b9);existsSync(_0xd18401)&&lstatSync(_0xd18401)['isFile']()&&rmSync(_0xd18401,{'force':!![]});}}
1
+ (function(_0x289a5e,_0x4d5551){const _0x285979=a141_0x52de,_0x5355a2=_0x289a5e();while(!![]){try{const _0x5d16ef=parseInt(_0x285979(0xc6))/0x1+-parseInt(_0x285979(0xbc))/0x2+parseInt(_0x285979(0xb5))/0x3*(-parseInt(_0x285979(0x9e))/0x4)+-parseInt(_0x285979(0xac))/0x5*(parseInt(_0x285979(0x90))/0x6)+-parseInt(_0x285979(0xb0))/0x7+-parseInt(_0x285979(0x91))/0x8+parseInt(_0x285979(0x9a))/0x9;if(_0x5d16ef===_0x4d5551)break;else _0x5355a2['push'](_0x5355a2['shift']());}catch(_0x4d4392){_0x5355a2['push'](_0x5355a2['shift']());}}}(a141_0x1360,0x6280d));import{existsSync,lstatSync,mkdirSync,readFileSync,rmSync}from'node:fs';import{dirname,resolve}from'node:path';function a141_0x52de(_0x35536b,_0x2e57ed){_0x35536b=_0x35536b-0x90;const _0x136055=a141_0x1360();let _0x52def1=_0x136055[_0x35536b];return _0x52def1;}import{isCollection,isMap,isNode,parseDocument,visit}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{resolveManagedFilePath,writeBytesAtomic,writeJsonAtomic}from'./fs-utils.js';import{bufferSha256,contentHash,fileHash}from'./hashing.js';function a141_0x1360(){const _0x2118b0=['filter','has','entries','Runtime\x20Skill\x20package\x20is\x20missing\x20','17292996nADlqF','utf8','fileHashes','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','76fiaFgY','name:\x20','pulledAt','status','stringify','replace','skillCode','join','name','find','errors','version','schemaVersion','match','1944955ZfKPuh','displayName','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','isFile','2079518xYibjl','length','delete','appCode','validation','118197PXoicT','---','trimEnd','paths','force','skillName','env','490870YQghnb','keys','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','trim','\x0a---\x0a\x0a','contents','map','displayName:\x20','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','accessKey','786188nrYYWl','Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20','description:\x20','slice','path','12ICKVyv','1880728oxnJHB','---\x0a','contentHash','description','toString'];a141_0x1360=function(){return _0x2118b0;};return a141_0x1360();}import{fileContent,fileText,normalizeLocalFiles}from'./local-files.js';import{buildMetadata,readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillDir}from'./paths.js';import{extractDownloadedPackage,requirePackageBytes}from'./zip-package.js';export function materializeRuntimeSkill(_0x2f9dae,_0x691b0,_0x5ed164){const _0x9112dc=a141_0x52de,_0x2740c4=requireSkillCode(_0x2f9dae),_0x29051e=requirePackageBytes(_0x2740c4,_0x5ed164['packageBytes']),_0x2b2fa8=extractDownloadedPackage(_0x29051e),_0x5db09f=_0x2b2fa8[_0x9112dc(0xa7)](_0x3951ca=>_0x3951ca[_0x9112dc(0xca)]===SKILL_FILE);if(!_0x5db09f)throw CliErrors[_0x9112dc(0xb4)](_0x9112dc(0x99)+SKILL_FILE+':\x20'+_0x2740c4);const _0x228e30=withMaterializedSkillFrontmatter(_0x2b2fa8,_0x2f9dae,_0x2740c4),_0x26d503=_0x228e30[_0x9112dc(0xa7)](_0x142ac6=>_0x142ac6[_0x9112dc(0xca)]===SKILL_FILE),_0x45214a=fileText(_0x26d503),_0x588b88=getRuntimeSkillDir(_0x5ed164[_0x9112dc(0xbb)],_0x5ed164[_0x9112dc(0xc5)],_0x5ed164[_0x9112dc(0xb3)],_0x691b0,_0x2740c4,_0x5ed164[_0x9112dc(0xb8)]),_0xe17655=resolve(_0x588b88,SKILL_FILE),_0x168b4e=resolve(_0x588b88,METADATA_FILE),_0x31bb29=contentHash(_0x45214a),_0x49d876=readMetadataIfPresent(_0x168b4e)?.[_0x9112dc(0x9c)];ensurePulledFilesCanBeOverwritten(_0x588b88,_0x168b4e,_0x228e30,_0x5ed164[_0x9112dc(0xb9)]===!![]),mkdirSync(_0x588b88,{'recursive':!![],'mode':0x1c0});const _0xe14c28=existsSync(_0xe17655)?readFileSync(_0xe17655,'utf8'):undefined;return materializeFiles(_0x588b88,_0x228e30),removeStaleManagedFiles(_0x588b88,_0x49d876,_0x228e30),writeJsonAtomic(_0x168b4e,buildMetadata(_0x2f9dae,_0x691b0,_0x5ed164[_0x9112dc(0xb3)],_0x31bb29,_0x5ed164[_0x9112dc(0xa0)],_0x228e30,_0x29051e)),{'skill':_0x2f9dae,'scope':_0x691b0,'dir':_0x588b88,'skillMdPath':_0xe17655,'metadataPath':_0x168b4e,'contentHash':_0x31bb29,'changed':_0xe14c28!==_0x45214a};}export function reuseMaterializedRuntimeSkill(_0x3d0eca,_0x224fea,_0x3177ba){const _0x47f5f1=a141_0x52de,_0x27e4f0=_0x3d0eca[_0x47f5f1(0xa9)]?.[_0x47f5f1(0xbf)]();if(!_0x27e4f0)return undefined;const _0x183514=requireSkillCode(_0x3d0eca),_0x4b6d21=getRuntimeSkillDir(_0x3177ba['env'],_0x3177ba[_0x47f5f1(0xc5)],_0x3177ba['appCode'],_0x224fea,_0x183514,_0x3177ba[_0x47f5f1(0xb8)]),_0x58368f=resolve(_0x4b6d21,SKILL_FILE),_0x130104=resolve(_0x4b6d21,METADATA_FILE),_0x3b8bbb=readMetadataIfPresent(_0x130104);if(!_0x3b8bbb||_0x3b8bbb[_0x47f5f1(0xaa)]!==0x2||_0x3b8bbb[_0x47f5f1(0xb3)]!==_0x3177ba[_0x47f5f1(0xb3)]||_0x3b8bbb['scope']!==_0x224fea||_0x3b8bbb[_0x47f5f1(0xa4)]!==_0x183514||_0x3b8bbb[_0x47f5f1(0xa9)]!==_0x27e4f0||_0x3b8bbb['id']!==_0x3d0eca['id']||_0x3b8bbb[_0x47f5f1(0xba)]!==_0x3d0eca[_0x47f5f1(0xba)]||_0x3b8bbb[_0x47f5f1(0x94)]!==_0x3d0eca['description']||_0x3b8bbb['example']!==_0x3d0eca['example']||_0x3b8bbb[_0x47f5f1(0xa1)]!==_0x3d0eca[_0x47f5f1(0xa1)]||!_0x3b8bbb[_0x47f5f1(0x93)]||!_0x3b8bbb['fileHashes']||!Object['hasOwn'](_0x3b8bbb[_0x47f5f1(0x9c)],SKILL_FILE))return undefined;for(const [_0xa6ff81,_0x5d9f9d]of Object[_0x47f5f1(0x98)](_0x3b8bbb[_0x47f5f1(0x9c)])){if(!/^[a-f0-9]{64}$/['test'](_0x5d9f9d))return undefined;const _0x1e4113=resolveManagedFilePath(_0x4b6d21,_0xa6ff81);if(!existsSync(_0x1e4113)||!lstatSync(_0x1e4113)['isFile']())return undefined;if(bufferSha256(readFileSync(_0x1e4113))!==_0x5d9f9d)return undefined;}return{'skill':_0x3d0eca,'scope':_0x224fea,'dir':_0x4b6d21,'skillMdPath':_0x58368f,'metadataPath':_0x130104,'contentHash':_0x3b8bbb[_0x47f5f1(0x93)],'changed':![]};}function withMaterializedSkillFrontmatter(_0x769f50,_0x3021b3,_0x55e95f){const _0x4b20bb=a141_0x52de,_0x5b7977=skillDisplayName(_0x3021b3,_0x55e95f),_0x119320=_0x3021b3[_0x4b20bb(0x94)]?.['trim']()||_0x5b7977||_0x55e95f;return normalizeLocalFiles(_0x769f50)[_0x4b20bb(0xc2)](_0x4dc1f1=>{const _0x5db655=_0x4b20bb,_0x1bd2a4=fileText(_0x4dc1f1);if(_0x4dc1f1['path']!==SKILL_FILE)return _0x4dc1f1;if(hasYamlFrontmatter(_0x1bd2a4))return{'path':_0x4dc1f1['path'],'content':withSyncedDisplayName(_0x1bd2a4,_0x5b7977)};return{'path':_0x4dc1f1[_0x5db655(0xca)],'content':prependSkillFrontmatter(_0x1bd2a4,{'name':_0x55e95f,'displayName':_0x5b7977,'description':_0x119320})};});}function hasYamlFrontmatter(_0x356875){return/^\uFEFF?---\s*\r?\n/['test'](_0x356875);}function prependSkillFrontmatter(_0x46761b,_0x33e4f3){const _0x46f378=a141_0x52de,_0x594e42=_0x46761b['replace'](/^\uFEFF/,'');return['---',_0x46f378(0x9f)+yamlString(_0x33e4f3[_0x46f378(0xa6)]),_0x33e4f3[_0x46f378(0xad)]?_0x46f378(0xc3)+yamlString(_0x33e4f3[_0x46f378(0xad)]):undefined,_0x46f378(0xc8)+yamlString(_0x33e4f3[_0x46f378(0x94)]),_0x46f378(0xb6),'',_0x594e42][_0x46f378(0x96)](_0x5c90c3=>_0x5c90c3!==undefined)[_0x46f378(0xa5)]('\x0a');}function yamlString(_0x3a6de7){const _0x1f7ccc=a141_0x52de;return JSON[_0x1f7ccc(0xa2)](_0x3a6de7[_0x1f7ccc(0xa3)](/\r/g,'')[_0x1f7ccc(0xbf)]());}function skillDisplayName(_0x3f5eba,_0x585019){const _0x4035fb=a141_0x52de,_0x5c41ff=_0x3f5eba[_0x4035fb(0xba)]?.[_0x4035fb(0xbf)]();return _0x5c41ff||_0x585019;}function withSyncedDisplayName(_0x5e99f1,_0x2f584b){const _0x3a992b=a141_0x52de,_0x34c04d=_0x5e99f1[_0x3a992b(0xab)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x34c04d)return _0x5e99f1;const _0x1b24c0=_0x34c04d[0x1]??'',_0x20eb6d=_0x34c04d[0x2]??'',_0x421bdf=parseDocument(_0x20eb6d);if(_0x421bdf[_0x3a992b(0xa8)][_0x3a992b(0xb1)]>0x0||!isMap(_0x421bdf[_0x3a992b(0xc1)]))return _0x5e99f1;if(_0x2f584b)_0x421bdf['set']('displayName',_0x2f584b);else{if(_0x421bdf[_0x3a992b(0x97)](_0x3a992b(0xad)))_0x421bdf[_0x3a992b(0xb2)](_0x3a992b(0xad));else return _0x5e99f1;}forceBlockCollections(_0x421bdf['contents']);const _0x3350aa=_0x421bdf[_0x3a992b(0x95)]({'lineWidth':0x0})[_0x3a992b(0xb7)](),_0x5149eb=_0x5e99f1[_0x3a992b(0xc9)](_0x34c04d[0x0]['length'])['replace'](/^\r?\n/,'');return _0x1b24c0+_0x3a992b(0x92)+_0x3350aa+_0x3a992b(0xc0)+_0x5149eb;}function forceBlockCollections(_0x5551e4){if(!isNode(_0x5551e4))return;visit(_0x5551e4,(_0x22756a,_0x58139e)=>{isCollection(_0x58139e)&&(_0x58139e['flow']=![]);});}function ensurePulledFilesCanBeOverwritten(_0x24707e,_0x34597d,_0x137c31,_0x288441){const _0xded2e5=a141_0x52de;if(_0x288441||!existsSync(_0x34597d))return;const _0x5f39f5=readMetadataIfPresent(_0x34597d);if(!_0x5f39f5)return;const _0x2b86f3=_0x5f39f5[_0xded2e5(0x9c)]&&Object['keys'](_0x5f39f5[_0xded2e5(0x9c)])[_0xded2e5(0xb1)]>0x0?_0x5f39f5['fileHashes']:undefined;if(_0x2b86f3)for(const [_0x1816ec,_0x1dfc01]of Object[_0xded2e5(0x98)](_0x2b86f3)){const _0x429266=resolveManagedFilePath(_0x24707e,_0x1816ec);if(!existsSync(_0x429266))throw CliErrors['validation'](_0xded2e5(0x9d)+_0x24707e,'Managed\x20file\x20was\x20removed\x20locally:\x20'+_0x1816ec);const _0x32082b=lstatSync(_0x429266);if(!_0x32082b[_0xded2e5(0xaf)]())throw CliErrors[_0xded2e5(0xb4)](_0xded2e5(0x9d)+_0x24707e,'Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20'+_0x1816ec);const _0x234485=bufferSha256(readFileSync(_0x429266));if(_0x234485!==_0x1dfc01)throw CliErrors['validation'](_0xded2e5(0x9d)+_0x24707e+'.\x20Changed\x20file:\x20'+_0x1816ec,_0xded2e5(0xae)+_0x1816ec);}else{const _0x32f4a5=resolve(_0x24707e,SKILL_FILE);if(existsSync(_0x32f4a5)&&_0x5f39f5[_0xded2e5(0x93)]){const _0x165553=contentHash(readFileSync(_0x32f4a5,_0xded2e5(0x9b)));if(_0x165553!==_0x5f39f5['contentHash'])throw CliErrors[_0xded2e5(0xb4)](_0xded2e5(0xbe)+_0x32f4a5,'Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.');}}for(const _0x62b17c of normalizeLocalFiles(_0x137c31)){if(_0x2b86f3?.[_0x62b17c['path']])continue;if(!_0x2b86f3&&_0x62b17c['path']===SKILL_FILE)continue;const _0x533442=resolveManagedFilePath(_0x24707e,_0x62b17c['path']);if(!existsSync(_0x533442))continue;const _0x2aa022=lstatSync(_0x533442);if(!_0x2aa022[_0xded2e5(0xaf)]())throw CliErrors[_0xded2e5(0xb4)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x24707e,_0xded2e5(0xc4)+_0x62b17c[_0xded2e5(0xca)]);const _0x1ddd1d=bufferSha256(readFileSync(_0x533442));if(_0x1ddd1d!==fileHash(_0x62b17c))throw CliErrors[_0xded2e5(0xb4)](_0xded2e5(0x9d)+_0x24707e,_0xded2e5(0xc7)+_0x62b17c['path']);}}function materializeFiles(_0x549315,_0x1682a8){const _0x19f7ea=a141_0x52de;for(const _0x451dbb of normalizeLocalFiles(_0x1682a8)){const _0x51ce6f=resolveManagedFilePath(_0x549315,_0x451dbb[_0x19f7ea(0xca)]);mkdirSync(dirname(_0x51ce6f),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x51ce6f,fileContent(_0x451dbb),0x180);}}function removeStaleManagedFiles(_0xbf8c6a,_0x1df292,_0x580ec0){const _0x17b9db=a141_0x52de;if(!_0x1df292)return;const _0x25a04e=new Set(normalizeLocalFiles(_0x580ec0)[_0x17b9db(0xc2)](_0x3046b4=>_0x3046b4[_0x17b9db(0xca)]));for(const _0x514f5f of Object[_0x17b9db(0xbd)](_0x1df292)){if(_0x25a04e[_0x17b9db(0x97)](_0x514f5f))continue;const _0x41ce01=resolveManagedFilePath(_0xbf8c6a,_0x514f5f);existsSync(_0x41ce01)&&lstatSync(_0x41ce01)[_0x17b9db(0xaf)]()&&rmSync(_0x41ce01,{'force':!![]});}}
@@ -1 +1 @@
1
- function a142_0x8f66(_0x51202f,_0x4982e8){_0x51202f=_0x51202f-0x184;const _0xc4f873=a142_0xc4f8();let _0x8f66ed=_0xc4f873[_0x51202f];return _0x8f66ed;}(function(_0x558717,_0x386a7f){const _0x1b64fb=a142_0x8f66,_0x4acf7d=_0x558717();while(!![]){try{const _0xb60644=parseInt(_0x1b64fb(0x187))/0x1*(-parseInt(_0x1b64fb(0x1a2))/0x2)+-parseInt(_0x1b64fb(0x1a8))/0x3+parseInt(_0x1b64fb(0x193))/0x4*(-parseInt(_0x1b64fb(0x196))/0x5)+-parseInt(_0x1b64fb(0x189))/0x6+-parseInt(_0x1b64fb(0x198))/0x7+-parseInt(_0x1b64fb(0x18f))/0x8+parseInt(_0x1b64fb(0x19d))/0x9;if(_0xb60644===_0x386a7f)break;else _0x4acf7d['push'](_0x4acf7d['shift']());}catch(_0x572a4f){_0x4acf7d['push'](_0x4acf7d['shift']());}}}(a142_0xc4f8,0x50837));import{existsSync,readFileSync}from'node:fs';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';import{fileContent,normalizeLocalFiles}from'./local-files.js';import{buildSkillPackage,localFilesToManifestFiles}from'./zip-package.js';export function buildMetadata(_0x220c5b,_0x31f3ce,_0x3b0e96,_0x583ce5,_0x407d9a,_0x24e1be,_0x4e1dee){const _0x41f44=a142_0x8f66,_0x40f4d1=_0x24e1be?normalizeLocalFiles(_0x24e1be):[],_0x4cb735=!_0x4e1dee&&_0x40f4d1['length']>0x0?buildSkillPackage(_0x40f4d1):undefined,_0xbf2735=_0x4e1dee?bufferSha256(_0x4e1dee):_0x4cb735?.[_0x41f44(0x1a4)][_0x41f44(0x184)],_0x14a9e7=_0x4e1dee?.[_0x41f44(0x195)]??_0x4cb735?.[_0x41f44(0x1a4)]['zipSize'],_0x258726=_0x40f4d1[_0x41f44(0x195)]>0x0?Object[_0x41f44(0x1a1)](_0x40f4d1[_0x41f44(0x19f)](_0x1d312e=>[_0x1d312e['path'],fileHash(_0x1d312e)])):undefined;return{'schemaVersion':_0x40f4d1['length']>0x0?0x2:0x1,'id':_0x220c5b['id'],'appCode':_0x3b0e96,'skillCode':requireSkillCode(_0x220c5b),'skillName':_0x220c5b[_0x41f44(0x1a0)],'description':_0x220c5b[_0x41f44(0x1a9)],'example':_0x220c5b[_0x41f44(0x197)],'scope':_0x31f3ce,'readonly':_0x31f3ce!==_0x41f44(0x18d)||_0x220c5b['readonly']===!![],'tenantCode':_0x220c5b[_0x41f44(0x191)],'userId':_0x220c5b['userId'],'version':_0x220c5b[_0x41f44(0x18a)],'status':_0x220c5b['status'],'tags':Array[_0x41f44(0x192)](_0x220c5b[_0x41f44(0x18c)])?_0x220c5b[_0x41f44(0x18c)]:[],'hasUpstreamUpdate':_0x220c5b[_0x41f44(0x18e)],'forkedFromSkillId':_0x220c5b[_0x41f44(0x18b)],'forkedFromVersion':_0x220c5b[_0x41f44(0x1aa)],'sourceSessionId':_0x220c5b[_0x41f44(0x1a7)],'contentHash':_0x583ce5,'fileHashes':_0x258726,'treeHash':_0x40f4d1[_0x41f44(0x195)]>0x0?fileTreeHash(localFilesToManifestFiles(_0x40f4d1)):undefined,'ossPath':remoteManifestOssPath(_0x220c5b[_0x41f44(0x185)]),'zipSha256':_0xbf2735,'zipSize':_0x14a9e7,'files':_0x40f4d1[_0x41f44(0x195)]>0x0?_0x40f4d1['map'](_0x3a5de7=>({'path':_0x3a5de7[_0x41f44(0x19c)],'hash':fileHash(_0x3a5de7),'size':fileContent(_0x3a5de7)['length']})):undefined,'pulledAt':_0x407d9a??new Date()[_0x41f44(0x194)]()};}export function requireSkillCode(_0x55ebe9){const _0x3220d3=a142_0x8f66,_0x47e3bd=_0x55ebe9[_0x3220d3(0x186)]?.[_0x3220d3(0x188)]();if(!_0x47e3bd)throw CliErrors[_0x3220d3(0x1a3)](_0x3220d3(0x1a5));return _0x47e3bd;}export function readMetadataIfPresent(_0x587a0c){const _0xa6de93=a142_0x8f66;if(!existsSync(_0x587a0c))return undefined;try{const _0x31b10f=JSON[_0xa6de93(0x19b)](readFileSync(_0x587a0c,_0xa6de93(0x190)));return _0x31b10f;}catch{throw CliErrors[_0xa6de93(0x1a3)](_0xa6de93(0x1a6)+METADATA_FILE+':\x20'+_0x587a0c);}}function remoteManifestOssPath(_0x4985cf){const _0x57608a=a142_0x8f66;if(!_0x4985cf||typeof _0x4985cf!==_0x57608a(0x19a)||Array[_0x57608a(0x192)](_0x4985cf))return undefined;const _0x43d4b3=_0x4985cf[_0x57608a(0x19e)];return typeof _0x43d4b3===_0x57608a(0x199)&&_0x43d4b3[_0x57608a(0x188)]()?_0x43d4b3[_0x57608a(0x188)]():undefined;}function a142_0xc4f8(){const _0xa03914=['tenantCode','isArray','8116MXNnDV','toISOString','length','1105Pqzpcf','example','4316347Usrkgr','string','object','parse','path','22763547XknRlP','ossPath','map','skillName','fromEntries','2oVWkAR','validation','manifest','Runtime\x20Skill\x20is\x20missing\x20skillCode.','Invalid\x20','sourceSessionId','1039917lmELUU','description','forkedFromVersion','zipSha256','files','skillCode','25601cEcxvl','trim','2993022PbogzL','version','forkedFromSkillId','tags','personal','hasUpstreamUpdate','2107144idpXjf','utf8'];a142_0xc4f8=function(){return _0xa03914;};return a142_0xc4f8();}
1
+ (function(_0x3ddf1f,_0x104ab1){const _0x52f18d=a142_0x2ef2,_0x456803=_0x3ddf1f();while(!![]){try{const _0x2a03d1=-parseInt(_0x52f18d(0x198))/0x1+-parseInt(_0x52f18d(0x196))/0x2+-parseInt(_0x52f18d(0x183))/0x3+-parseInt(_0x52f18d(0x184))/0x4*(parseInt(_0x52f18d(0x19a))/0x5)+-parseInt(_0x52f18d(0x1a2))/0x6*(parseInt(_0x52f18d(0x186))/0x7)+-parseInt(_0x52f18d(0x197))/0x8+parseInt(_0x52f18d(0x182))/0x9*(parseInt(_0x52f18d(0x19b))/0xa);if(_0x2a03d1===_0x104ab1)break;else _0x456803['push'](_0x456803['shift']());}catch(_0x4c7996){_0x456803['push'](_0x456803['shift']());}}}(a142_0x5dcb,0x83e24));import{existsSync,readFileSync}from'node:fs';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';import{fileContent,normalizeLocalFiles}from'./local-files.js';function a142_0x2ef2(_0x248c29,_0x3b9f58){_0x248c29=_0x248c29-0x181;const _0x5dcb61=a142_0x5dcb();let _0x2ef2e1=_0x5dcb61[_0x248c29];return _0x2ef2e1;}import{buildSkillPackage,localFilesToManifestFiles}from'./zip-package.js';function a142_0x5dcb(){const _0x2d3fcd=['manifest','parse','path','678DpHndp','Runtime\x20Skill\x20is\x20missing\x20skillCode.','personal','724833dgBsFh','1485558tBmoQH','160936ShQCjl','isArray','287ZVJiXC','trim','tags','ossPath','files','map','skillCode','object','description','status','fromEntries','zipSha256','Invalid\x20','forkedFromVersion','validation','readonly','414296RFPYtq','4519680GVCFjo','443189PxbCJa','length','40EVVQXn','320nxGNQQ','skillName','userId','hasUpstreamUpdate'];a142_0x5dcb=function(){return _0x2d3fcd;};return a142_0x5dcb();}export function buildMetadata(_0x561e15,_0x446318,_0x2c49e7,_0x4db8e7,_0x589467,_0x84ad62,_0x40f3a6){const _0x54ca93=a142_0x2ef2,_0x4326d8=_0x84ad62?normalizeLocalFiles(_0x84ad62):[],_0x4abeca=!_0x40f3a6&&_0x4326d8[_0x54ca93(0x199)]>0x0?buildSkillPackage(_0x4326d8):undefined,_0x41eb80=_0x40f3a6?bufferSha256(_0x40f3a6):_0x4abeca?.[_0x54ca93(0x19f)][_0x54ca93(0x191)],_0x312ba1=_0x40f3a6?.[_0x54ca93(0x199)]??_0x4abeca?.[_0x54ca93(0x19f)]['zipSize'],_0x23173b=_0x4326d8[_0x54ca93(0x199)]>0x0?Object[_0x54ca93(0x190)](_0x4326d8[_0x54ca93(0x18b)](_0x494bea=>[_0x494bea[_0x54ca93(0x1a1)],fileHash(_0x494bea)])):undefined;return{'schemaVersion':_0x4326d8['length']>0x0?0x2:0x1,'id':_0x561e15['id'],'appCode':_0x2c49e7,'skillCode':requireSkillCode(_0x561e15),'skillName':_0x561e15[_0x54ca93(0x19c)],'description':_0x561e15[_0x54ca93(0x18e)],'example':_0x561e15['example'],'scope':_0x446318,'readonly':_0x446318!==_0x54ca93(0x181)||_0x561e15[_0x54ca93(0x195)]===!![],'tenantCode':_0x561e15['tenantCode'],'userId':_0x561e15[_0x54ca93(0x19d)],'version':_0x561e15['version'],'status':_0x561e15[_0x54ca93(0x18f)],'tags':Array[_0x54ca93(0x185)](_0x561e15[_0x54ca93(0x188)])?_0x561e15[_0x54ca93(0x188)]:[],'hasUpstreamUpdate':_0x561e15[_0x54ca93(0x19e)],'forkedFromSkillId':_0x561e15['forkedFromSkillId'],'forkedFromVersion':_0x561e15[_0x54ca93(0x193)],'sourceSessionId':_0x561e15['sourceSessionId'],'contentHash':_0x4db8e7,'fileHashes':_0x23173b,'treeHash':_0x4326d8[_0x54ca93(0x199)]>0x0?fileTreeHash(localFilesToManifestFiles(_0x4326d8)):undefined,'ossPath':remoteManifestOssPath(_0x561e15[_0x54ca93(0x18a)]),'zipSha256':_0x41eb80,'zipSize':_0x312ba1,'files':_0x4326d8['length']>0x0?_0x4326d8[_0x54ca93(0x18b)](_0x2b2243=>({'path':_0x2b2243[_0x54ca93(0x1a1)],'hash':fileHash(_0x2b2243),'size':fileContent(_0x2b2243)[_0x54ca93(0x199)]})):undefined,'pulledAt':_0x589467??new Date()['toISOString']()};}export function requireSkillCode(_0x23cafe){const _0x3534a8=a142_0x2ef2,_0x4d7b0c=_0x23cafe[_0x3534a8(0x18c)]?.['trim']();if(!_0x4d7b0c)throw CliErrors['validation'](_0x3534a8(0x1a3));return _0x4d7b0c;}export function readMetadataIfPresent(_0x1d032f){const _0x92a641=a142_0x2ef2;if(!existsSync(_0x1d032f))return undefined;try{const _0x45fc45=JSON[_0x92a641(0x1a0)](readFileSync(_0x1d032f,'utf8'));return _0x45fc45;}catch{throw CliErrors[_0x92a641(0x194)](_0x92a641(0x192)+METADATA_FILE+':\x20'+_0x1d032f);}}function remoteManifestOssPath(_0x2e0eac){const _0xf68888=a142_0x2ef2;if(!_0x2e0eac||typeof _0x2e0eac!==_0xf68888(0x18d)||Array[_0xf68888(0x185)](_0x2e0eac))return undefined;const _0x3f7a48=_0x2e0eac[_0xf68888(0x189)];return typeof _0x3f7a48==='string'&&_0x3f7a48[_0xf68888(0x187)]()?_0x3f7a48[_0xf68888(0x187)]():undefined;}
@@ -1 +1 @@
1
- const a143_0x379824=a143_0x32f8;(function(_0x12d51e,_0x4b10a8){const _0x3ff80b=a143_0x32f8,_0x103e44=_0x12d51e();while(!![]){try{const _0x23cc76=parseInt(_0x3ff80b(0x1dd))/0x1*(-parseInt(_0x3ff80b(0x1ec))/0x2)+parseInt(_0x3ff80b(0x1e4))/0x3+parseInt(_0x3ff80b(0x1f3))/0x4*(parseInt(_0x3ff80b(0x1ef))/0x5)+-parseInt(_0x3ff80b(0x1e8))/0x6+parseInt(_0x3ff80b(0x1de))/0x7+-parseInt(_0x3ff80b(0x1f4))/0x8*(parseInt(_0x3ff80b(0x1e3))/0x9)+-parseInt(_0x3ff80b(0x1f5))/0xa;if(_0x23cc76===_0x4b10a8)break;else _0x103e44['push'](_0x103e44['shift']());}catch(_0x55f6fc){_0x103e44['push'](_0x103e44['shift']());}}}(a143_0x4103,0x7dbb8));import{existsSync}from'node:fs';import{homedir}from'node:os';import{resolve}from'node:path';function a143_0x32f8(_0x584951,_0xa1638c){_0x584951=_0x584951-0x1dd;const _0x41032a=a143_0x4103();let _0x32f80b=_0x41032a[_0x584951];return _0x32f80b;}import{fingerprintAccessKey}from'../../commands/app/cache.js';function a143_0x4103(){const _0x55d57d=['SKILL_ROOT','2358fBdBay','2310987DLgYzb','validation','skillCode','\x20for\x20local\x20path:\x20','1960920NdCgkp','.claude','path\x20segment','cacheRoot','4GjkEFT','cache','Unsafe\x20','3257995JDyjvk','includes','claudeSkillsDir','workbuddySkillsDir','4pSjexA','8072gPRAQs','10675980cuQLel','homeDir','124421gkuCiJ','7004830sKKkKQ','homeDirName','appCode','skills'];a143_0x4103=function(){return _0x55d57d;};return a143_0x4103();}import{PRODUCT_CONFIG,productEnv}from'../../constant/product.js';import{CliErrors}from'../../errors.js';export function resolveSkillSyncPaths(_0x2f308d={}){const _0x126eeb=a143_0x32f8,_0x905f0f=_0x2f308d[_0x126eeb(0x1f6)]??homedir(),_0x380db0=resolve(_0x905f0f,PRODUCT_CONFIG[_0x126eeb(0x1df)],_0x126eeb(0x1ed)),_0x45cbff=trimmedEnv(_0x126eeb(0x1e2)),_0x38a478=trimmedEnv('CLAUDE_SKILL_ROOT'),_0x1a2ee6=resolve(_0x905f0f,'.workbuddy'),_0x16f69e=_0x2f308d[_0x126eeb(0x1f2)]??(existsSync(_0x1a2ee6)?resolve(_0x1a2ee6,'skills'):undefined);return{'homeDir':_0x905f0f,'cacheRoot':_0x380db0,'managedRoot':resolve(_0x905f0f,PRODUCT_CONFIG[_0x126eeb(0x1df)]),'agentsSkillsDir':_0x2f308d['agentsSkillsDir']??_0x45cbff??resolve(_0x905f0f,'.agents',_0x126eeb(0x1e1)),'claudeSkillsDir':_0x2f308d[_0x126eeb(0x1f1)]??_0x38a478??resolve(_0x905f0f,_0x126eeb(0x1e9),_0x126eeb(0x1e1)),'workbuddySkillsDir':_0x16f69e};}export function runtimeAgentSkillRoots(_0xc29955){const _0x5d6919=a143_0x32f8;return[_0xc29955['agentsSkillsDir'],_0xc29955[_0x5d6919(0x1f1)],_0xc29955['workbuddySkillsDir']]['filter'](_0x17f665=>Boolean(_0x17f665));}export function getRuntimeSkillCacheRoot(_0x2dee62,_0x121b7b,_0x4b7acf={}){const _0x20ede9=a143_0x32f8,_0xecdb28=resolveSkillSyncPaths(_0x4b7acf);return resolve(_0xecdb28[_0x20ede9(0x1eb)],_0x2dee62,fingerprintAccessKey(_0x121b7b),_0x20ede9(0x1e1));}export function getRuntimeSkillDir(_0x5f248d,_0x495e5c,_0x273a4b,_0x3983bb,_0x3f4899,_0x5acd6b={}){const _0x28e8d1=a143_0x32f8;return resolve(getRuntimeSkillCacheRoot(_0x5f248d,_0x495e5c,_0x5acd6b),safePathSegment(_0x273a4b,_0x28e8d1(0x1e0)),_0x3983bb,safePathSegment(_0x3f4899,_0x28e8d1(0x1e6)));}export function safePathSegment(_0x4160df,_0x53d6b3=a143_0x379824(0x1ea)){const _0x3f3883=a143_0x379824;if(!_0x4160df||_0x4160df[_0x3f3883(0x1f0)]('/')||_0x4160df[_0x3f3883(0x1f0)]('\x5c')||_0x4160df[_0x3f3883(0x1f0)]('..'))throw CliErrors[_0x3f3883(0x1e5)](_0x3f3883(0x1ee)+_0x53d6b3+_0x3f3883(0x1e7)+_0x4160df);return _0x4160df;}function trimmedEnv(_0x121fac){const _0x3aa02a=productEnv(_0x121fac)?.['trim']();return _0x3aa02a?_0x3aa02a:undefined;}
1
+ function a143_0xf705(){const _0x496332=['cache','skills','workbuddySkillsDir','6owpQec','89992YeNByo','trim','CLAUDE_SKILL_ROOT','4274SUMYfa','335847RAxwJR','SKILL_ROOT','3291760rGHjHB','.claude','975212GqbIUS','skillCode','72nfjTOu','.agents','homeDirName','.workbuddy','1385349tJqiSB','1YTbVtY','1124825gaYzyB','Unsafe\x20','cacheRoot','validation','claudeSkillsDir'];a143_0xf705=function(){return _0x496332;};return a143_0xf705();}(function(_0x4bbb53,_0x5383b4){const _0x338c68=a143_0x358e,_0xe3969a=_0x4bbb53();while(!![]){try{const _0x5a12f7=-parseInt(_0x338c68(0x81))/0x1*(parseInt(_0x338c68(0x75))/0x2)+-parseInt(_0x338c68(0x76))/0x3+parseInt(_0x338c68(0x7a))/0x4+-parseInt(_0x338c68(0x69))/0x5*(-parseInt(_0x338c68(0x71))/0x6)+parseInt(_0x338c68(0x80))/0x7+parseInt(_0x338c68(0x72))/0x8*(-parseInt(_0x338c68(0x7c))/0x9)+-parseInt(_0x338c68(0x78))/0xa;if(_0x5a12f7===_0x5383b4)break;else _0xe3969a['push'](_0xe3969a['shift']());}catch(_0x36883f){_0xe3969a['push'](_0xe3969a['shift']());}}}(a143_0xf705,0x2092d));import{existsSync}from'node:fs';import{homedir}from'node:os';import{resolve}from'node:path';import{fingerprintAccessKey}from'../../commands/app/cache.js';import{PRODUCT_CONFIG,productEnv}from'../../constant/product.js';function a143_0x358e(_0x547b35,_0x30842a){_0x547b35=_0x547b35-0x69;const _0xf705d0=a143_0xf705();let _0x358e6b=_0xf705d0[_0x547b35];return _0x358e6b;}import{CliErrors}from'../../errors.js';export function resolveSkillSyncPaths(_0x3b1181={}){const _0x1823a2=a143_0x358e,_0x108460=_0x3b1181['homeDir']??homedir(),_0x519384=resolve(_0x108460,PRODUCT_CONFIG[_0x1823a2(0x7e)],_0x1823a2(0x6e)),_0x4ef338=trimmedEnv(_0x1823a2(0x77)),_0x5ce6e1=trimmedEnv(_0x1823a2(0x74)),_0x2eb290=resolve(_0x108460,_0x1823a2(0x7f)),_0x291a02=_0x3b1181['workbuddySkillsDir']??(existsSync(_0x2eb290)?resolve(_0x2eb290,'skills'):undefined);return{'homeDir':_0x108460,'cacheRoot':_0x519384,'managedRoot':resolve(_0x108460,PRODUCT_CONFIG['homeDirName']),'agentsSkillsDir':_0x3b1181['agentsSkillsDir']??_0x4ef338??resolve(_0x108460,_0x1823a2(0x7d),_0x1823a2(0x6f)),'claudeSkillsDir':_0x3b1181[_0x1823a2(0x6d)]??_0x5ce6e1??resolve(_0x108460,_0x1823a2(0x79),_0x1823a2(0x6f)),'workbuddySkillsDir':_0x291a02};}export function runtimeAgentSkillRoots(_0x2e89f5){const _0x23cf0a=a143_0x358e;return[_0x2e89f5['agentsSkillsDir'],_0x2e89f5[_0x23cf0a(0x6d)],_0x2e89f5[_0x23cf0a(0x70)]]['filter'](_0x4d90b2=>Boolean(_0x4d90b2));}export function getRuntimeSkillCacheRoot(_0x6ed942,_0x1950b5,_0x4eeedc={}){const _0x589adc=a143_0x358e,_0x42897c=resolveSkillSyncPaths(_0x4eeedc);return resolve(_0x42897c[_0x589adc(0x6b)],_0x6ed942,fingerprintAccessKey(_0x1950b5),'skills');}export function getRuntimeSkillDir(_0x587b4d,_0x11dc68,_0x277de9,_0x148332,_0x4ead3d,_0xd7c0ab={}){const _0x3c2ba8=a143_0x358e;return resolve(getRuntimeSkillCacheRoot(_0x587b4d,_0x11dc68,_0xd7c0ab),safePathSegment(_0x277de9,'appCode'),_0x148332,safePathSegment(_0x4ead3d,_0x3c2ba8(0x7b)));}export function safePathSegment(_0x22c355,_0x1086a3='path\x20segment'){const _0x4233e7=a143_0x358e;if(!_0x22c355||_0x22c355['includes']('/')||_0x22c355['includes']('\x5c')||_0x22c355['includes']('..'))throw CliErrors[_0x4233e7(0x6c)](_0x4233e7(0x6a)+_0x1086a3+'\x20for\x20local\x20path:\x20'+_0x22c355);return _0x22c355;}function trimmedEnv(_0x14a35e){const _0x6f838e=a143_0x358e,_0x515c50=productEnv(_0x14a35e)?.[_0x6f838e(0x73)]();return _0x515c50?_0x515c50:undefined;}
@@ -1 +1 @@
1
- (function(_0xf6fd02,_0x7d6c3d){const _0x265b7c=a144_0x4845,_0x41ebe0=_0xf6fd02();while(!![]){try{const _0x64d3a2=-parseInt(_0x265b7c(0x188))/0x1+-parseInt(_0x265b7c(0x199))/0x2*(-parseInt(_0x265b7c(0x1a9))/0x3)+parseInt(_0x265b7c(0x17d))/0x4+-parseInt(_0x265b7c(0x181))/0x5*(-parseInt(_0x265b7c(0x19b))/0x6)+parseInt(_0x265b7c(0x185))/0x7+parseInt(_0x265b7c(0x1a0))/0x8*(parseInt(_0x265b7c(0x178))/0x9)+-parseInt(_0x265b7c(0x195))/0xa;if(_0x64d3a2===_0x7d6c3d)break;else _0x41ebe0['push'](_0x41ebe0['shift']());}catch(_0xf3e3e3){_0x41ebe0['push'](_0x41ebe0['shift']());}}}(a144_0x3525,0x9debb));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a144_0x534908}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(_0x22b975,_0x3b92e2,_0x2655a0={}){const _0x37fd24=a144_0x4845,_0x5312e9=resolvePushDirectoryRoot(_0x22b975),_0x1423b1=readPushMetadataIfPresent(resolve(_0x5312e9,METADATA_FILE),{'ignoreInvalidMetadata':_0x2655a0[_0x37fd24(0x19c)]});if(_0x1423b1?.[_0x37fd24(0x19d)]&&_0x1423b1[_0x37fd24(0x19d)]!==_0x3b92e2&&!_0x2655a0['allowAppCodeRetarget']&&!_0x2655a0[_0x37fd24(0x1a4)])throw CliErrors[_0x37fd24(0x191)](_0x37fd24(0x17c)+_0x1423b1[_0x37fd24(0x19d)]+_0x37fd24(0x1b7)+_0x3b92e2+'\x22.');const _0x2d0866=resolvePushSkillCode(_0x5312e9,_0x3b92e2,_0x1423b1,_0x2655a0);if(!_0x2d0866)throw CliErrors['validation'](_0x37fd24(0x18e)+SKILL_FILE+',\x20'+METADATA_FILE+_0x37fd24(0x1a7));return{'dir':_0x5312e9,'skillCode':_0x2d0866,'metadata':_0x1423b1};}export function readPushDirectory(_0x39fe90,_0x11e077,_0x22f880={}){const _0x1b0bfd=a144_0x4845,_0x163bf6=resolvePushDirectoryIdentity(_0x39fe90,_0x11e077,_0x22f880),_0x7d774f=_0x163bf6[_0x1b0bfd(0x1a1)],_0x1c182f=resolve(_0x7d774f,SKILL_FILE);if(!existsSync(_0x1c182f)||!lstatSync(_0x1c182f)[_0x1b0bfd(0x194)]())throw CliErrors[_0x1b0bfd(0x191)](_0x1b0bfd(0x1b8)+SKILL_FILE+':\x20'+_0x1c182f);const _0xda2663=_0x163bf6[_0x1b0bfd(0x1aa)],_0x1b6cfb=_0x22f880[_0x1b0bfd(0x19a)]??_0x1b0bfd(0x1b3);if(!_0x22f880['ignoreMetadataScope']&&_0xda2663?.[_0x1b0bfd(0x1ac)]===_0x1b0bfd(0x1af))throw CliErrors['validation']('Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20'+METADATA_FILE+_0x1b0bfd(0x17f)+_0xda2663[_0x1b0bfd(0x1ac)]+'\x22.');if(!_0x22f880['ignoreMetadataScope']&&_0x1b6cfb===_0x1b0bfd(0x1b3)&&_0xda2663?.[_0x1b0bfd(0x1ac)]&&_0xda2663[_0x1b0bfd(0x1ac)]!==_0x1b0bfd(0x1b3))throw CliErrors['validation']('Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20'+METADATA_FILE+_0x1b0bfd(0x17f)+_0xda2663[_0x1b0bfd(0x1ac)]+'\x22.',_0x1b0bfd(0x18f)+_0x7d774f+'\x20to\x20submit\x20company\x20Skills\x20for\x20review.');const _0x1f4d94=scanSkillDirectory(_0x7d774f,{'excludedFilePaths':_0x22f880[_0x1b0bfd(0x19e)]}),_0x2f94b8=buildSkillPackage(_0x1f4d94),_0x3bed6e=readFileSync(_0x1c182f,_0x1b0bfd(0x192)),_0x4e6d7e=_0x163bf6[_0x1b0bfd(0x189)],_0x3bbb66=_0x22f880[_0x1b0bfd(0x1ab)]?undefined:_0xda2663,_0x3fb1bd=readSkillDisplayName(_0x3bed6e);return{'skillCode':_0x4e6d7e,'metadata':_0xda2663,'frontmatterDisplayName':_0x3fb1bd,'input':{'skillCode':_0x4e6d7e,'skillName':_0x3fb1bd??_0x3bbb66?.[_0x1b0bfd(0x17a)],'description':_0x3bbb66?.[_0x1b0bfd(0x177)],'content':_0x3bed6e,'files':_0x2f94b8[_0x1b0bfd(0x184)],'packageBase64':_0x2f94b8[_0x1b0bfd(0x18a)],'tags':_0x3bbb66?.[_0x1b0bfd(0x1a8)],'version':_0x3bbb66?.[_0x1b0bfd(0x183)],'sourceSessionId':_0x3bbb66?.[_0x1b0bfd(0x179)]}};}export function refreshPushDirectoryMetadataFromRemote(_0x42c548,_0x26569d,_0x4e1ec0,_0x294b8b={}){const _0x5911d9=a144_0x4845,_0x5cd48c=resolvePushDirectoryRoot(_0x42c548),_0x407fa4=readPushMetadataIfPresent(resolve(_0x5cd48c,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x541969=requireRemoteScope(_0x26569d),_0x2f5570=readLocalSkillContent(_0x5cd48c),_0x5357b8={..._0x26569d,'appCode':_0x26569d[_0x5911d9(0x19d)]??_0x4e1ec0,'skillName':_0x26569d[_0x5911d9(0x17a)]??_0x407fa4?.['skillName'],'description':_0x26569d[_0x5911d9(0x177)]??_0x407fa4?.[_0x5911d9(0x177)],'example':_0x26569d['example']??_0x407fa4?.['example'],'tags':Array[_0x5911d9(0x180)](_0x26569d[_0x5911d9(0x1a8)])?_0x26569d[_0x5911d9(0x1a8)]:_0x407fa4?.[_0x5911d9(0x1a8)],'sourceSessionId':_0x26569d[_0x5911d9(0x179)]??_0x407fa4?.['sourceSessionId'],'content':_0x26569d[_0x5911d9(0x1a2)]??_0x2f5570},_0x418649=buildMetadata(_0x5357b8,_0x541969,_0x4e1ec0,contentHash(_0x2f5570),_0x294b8b[_0x5911d9(0x182)]);writeJsonAtomic(resolve(_0x5cd48c,METADATA_FILE),_0x418649);}export function recordPushedRuntimeSkill(_0x12c009,_0x2de73e,_0x5be39d,_0x111d13={}){const _0x9cf9c=a144_0x4845,_0x549c6e=resolvePushDirectoryRoot(_0x12c009),_0x1e1bc4=scanSkillDirectory(_0x549c6e),_0x1fecb6=_0x1e1bc4['find'](_0x2cd2d7=>_0x2cd2d7[_0x9cf9c(0x17b)]===SKILL_FILE),_0x4b389a=_0x1fecb6?fileText(_0x1fecb6):'',_0x438259=tryNormalizePackageManifest(_0x2de73e[_0x9cf9c(0x1a3)]),_0x71ec98={..._0x2de73e,'content':_0x2de73e[_0x9cf9c(0x1a2)]??_0x4b389a,'files':_0x438259},_0x5349e4=_0x438259?normalizeLocalFiles(_0x1e1bc4)[_0x9cf9c(0x1b0)](_0x22fa91=>_0x438259[_0x9cf9c(0x1a3)]['some'](_0x53ee66=>_0x53ee66['path']===_0x22fa91[_0x9cf9c(0x17b)])):undefined,_0x2aef11=buildMetadata(_0x71ec98,_0x111d13[_0x9cf9c(0x1ac)]??_0x9cf9c(0x1b3),_0x5be39d,contentHash(_0x71ec98[_0x9cf9c(0x1a2)]??''),_0x111d13['pushedAt'],_0x5349e4);writeJsonAtomic(resolve(_0x549c6e,METADATA_FILE),_0x2aef11);}export function deriveSkillCodeFromDirectory(_0x4bcc80,_0x1b2691){const _0x4f072b=a144_0x4845,_0xd29458=basename(resolve(_0x4bcc80)),_0x2cbe43=_0x1b2691+'--';return _0xd29458[_0x4f072b(0x18b)](_0x2cbe43)?_0xd29458[_0x4f072b(0x1b1)](_0x2cbe43[_0x4f072b(0x1b4)]):_0xd29458;}function resolvePushSkillCode(_0x297dcf,_0x205c20,_0x34e0da,_0x28da5b){const _0x5bd36a=a144_0x4845,_0x5ed5a7=deriveSkillCodeFromSkillFile(_0x297dcf)||deriveSkillCodeFromDirectory(_0x297dcf,_0x205c20);if(_0x28da5b['ignoreMetadataSkillCode'])return _0x5ed5a7;return _0x34e0da?.[_0x5bd36a(0x189)]?.['trim']()||_0x5ed5a7;}function deriveSkillCodeFromSkillFile(_0x49992){const _0x2433de=a144_0x4845,_0x21a32c=resolve(_0x49992,SKILL_FILE);if(!existsSync(_0x21a32c)||!lstatSync(_0x21a32c)['isFile']())return undefined;const _0x39ef71=readFileSync(_0x21a32c,_0x2433de(0x192)),_0x40c4cf=_0x39ef71['match'](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x40c4cf)return undefined;const _0xdf8a90=parseFrontmatterObject(_0x40c4cf[0x1]??''),_0x358bdb=scalarToString(_0xdf8a90?.[_0x2433de(0x1b2)]);return _0x358bdb?slugifySkillName(_0x358bdb):undefined;}function readSkillDisplayName(_0x5c2045){const _0x562dc0=a144_0x4845,_0x503c86=_0x5c2045[_0x562dc0(0x1b6)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x503c86)return undefined;const _0x2751eb=parseFrontmatterObject(_0x503c86[0x1]??'');return scalarToString(_0x2751eb?.[_0x562dc0(0x18c)]);}function slugifySkillName(_0x129419){const _0x2e3126=a144_0x4845,_0x419689=_0x129419[_0x2e3126(0x1b5)]()[_0x2e3126(0x186)]()[_0x2e3126(0x17e)](/[^\p{L}\p{N}\p{So}]+/gu,'-')['replace'](/^-+/,'')[_0x2e3126(0x17e)](/-+$/,'')[_0x2e3126(0x17e)](/-{2,}/g,'-');if(!_0x419689)throw CliErrors['validation'](_0x2e3126(0x196)+SKILL_FILE+'\x20name\x20for\x20SkillHub\x20slug\x20generation.');return _0x419689;}function parseFrontmatterObject(_0x386a05){const _0x1d9b70=a144_0x4845;try{const _0x3c12b8=a144_0x534908(_0x386a05);return _0x3c12b8&&typeof _0x3c12b8===_0x1d9b70(0x193)&&!Array[_0x1d9b70(0x180)](_0x3c12b8)?_0x3c12b8:undefined;}catch{return undefined;}}function a144_0x4845(_0x34696a,_0x563d73){_0x34696a=_0x34696a-0x177;const _0x35255d=a144_0x3525();let _0x48456a=_0x35255d[_0x34696a];return _0x48456a;}function scalarToString(_0x58c713){const _0x14aa86=a144_0x4845;if(typeof _0x58c713===_0x14aa86(0x187))return _0x58c713[_0x14aa86(0x1b5)]();if(typeof _0x58c713==='number'||typeof _0x58c713===_0x14aa86(0x1a5))return String(_0x58c713);return undefined;}function resolvePushDirectoryRoot(_0x31870){const _0x312cf3=a144_0x4845,_0x5b47c4=resolve(_0x31870);if(!existsSync(_0x5b47c4))throw CliErrors[_0x312cf3(0x191)](_0x312cf3(0x197)+_0x31870);const _0x39fd4a=lstatSync(_0x5b47c4);if(_0x39fd4a['isDirectory']())return _0x5b47c4;if(_0x39fd4a[_0x312cf3(0x1ae)]()){const _0x286086=realpathSync(_0x5b47c4);if(lstatSync(_0x286086)[_0x312cf3(0x1ad)]())return _0x286086;}throw CliErrors[_0x312cf3(0x191)]('Skill\x20directory\x20not\x20found:\x20'+_0x31870);}function requireRemoteScope(_0x1f7779){const _0x240ffa=a144_0x4845;if(_0x1f7779[_0x240ffa(0x1ac)]===_0x240ffa(0x1b3)||_0x1f7779[_0x240ffa(0x1ac)]===_0x240ffa(0x190)||_0x1f7779[_0x240ffa(0x1ac)]===_0x240ffa(0x1af))return _0x1f7779[_0x240ffa(0x1ac)];throw CliErrors[_0x240ffa(0x191)](_0x240ffa(0x1a6)+(_0x1f7779[_0x240ffa(0x189)]||_0x240ffa(0x198))+_0x240ffa(0x19f)+(_0x1f7779[_0x240ffa(0x1ac)]??_0x240ffa(0x18d))+'\x22.');}function readLocalSkillContent(_0x588ec3){const _0xacedb4=resolve(_0x588ec3,SKILL_FILE);return existsSync(_0xacedb4)&&lstatSync(_0xacedb4)['isFile']()?readFileSync(_0xacedb4,'utf8'):'';}function readPushMetadataIfPresent(_0x1ecbcb,_0x2dbf13={}){const _0x3abd=a144_0x4845;try{return readMetadataIfPresent(_0x1ecbcb);}catch(_0x2c9a0e){if(_0x2dbf13[_0x3abd(0x19c)])return undefined;throw _0x2c9a0e;}}function a144_0x3525(){const _0x516278=['97704GxvDdK','replace','\x20has\x20scope=\x22','isArray','2110jQGDeb','refreshedAt','version','manifest','1120049uJrxKD','toLowerCase','string','968703OEHJrD','skillCode','packageBase64','startsWith','displayName','unknown','Unable\x20to\x20resolve\x20skillCode\x20from\x20','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20','company','validation','utf8','object','isFile','10623150wtmloj','Invalid\x20','Skill\x20directory\x20not\x20found:\x20','(unknown)','579416czXmif','targetScope','15492oFWpWG','ignoreInvalidMetadata','appCode','excludedFilePaths','\x20has\x20unsupported\x20scope\x20\x22','416ExrAik','dir','content','files','ignoreMetadataAppCodeMismatch','boolean','Remote\x20Skill\x20',',\x20or\x20directory\x20name.','tags','6GQHJYt','metadata','ignoreMetadataForPayload','scope','isDirectory','isSymbolicLink','builtin','filter','slice','name','personal','length','trim','match','\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22','Missing\x20','description','142686hDglzz','sourceSessionId','skillName','path','Skill\x20metadata\x20appCode\x20\x22'];a144_0x3525=function(){return _0x516278;};return a144_0x3525();}
1
+ (function(_0x485cee,_0x5e3cb0){const _0x50ad89=a144_0x2efd,_0x310104=_0x485cee();while(!![]){try{const _0xc173ab=-parseInt(_0x50ad89(0xa5))/0x1+-parseInt(_0x50ad89(0xce))/0x2+parseInt(_0x50ad89(0xb2))/0x3+parseInt(_0x50ad89(0xab))/0x4*(-parseInt(_0x50ad89(0xb8))/0x5)+parseInt(_0x50ad89(0xc9))/0x6+-parseInt(_0x50ad89(0xad))/0x7*(parseInt(_0x50ad89(0xc3))/0x8)+parseInt(_0x50ad89(0x9f))/0x9;if(_0xc173ab===_0x5e3cb0)break;else _0x310104['push'](_0x310104['shift']());}catch(_0xb3a52a){_0x310104['push'](_0x310104['shift']());}}}(a144_0x3352,0x4b3b1));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a144_0x16b433}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{writeJsonAtomic}from'./fs-utils.js';import{contentHash}from'./hashing.js';import{fileText,normalizeLocalFiles,scanSkillDirectory}from'./local-files.js';import{buildMetadata,readMetadataIfPresent}from'./metadata.js';import{buildSkillPackage,tryNormalizePackageManifest}from'./zip-package.js';export function resolvePushDirectoryIdentity(_0x283968,_0x21b9a3,_0x330455={}){const _0x8d0a89=a144_0x2efd,_0x534223=resolvePushDirectoryRoot(_0x283968),_0x27ace8=readPushMetadataIfPresent(resolve(_0x534223,METADATA_FILE),{'ignoreInvalidMetadata':_0x330455['ignoreInvalidMetadata']});if(_0x27ace8?.['appCode']&&_0x27ace8[_0x8d0a89(0xa6)]!==_0x21b9a3&&!_0x330455[_0x8d0a89(0xb9)]&&!_0x330455[_0x8d0a89(0x93)])throw CliErrors[_0x8d0a89(0x9c)](_0x8d0a89(0xb7)+_0x27ace8[_0x8d0a89(0xa6)]+'\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22'+_0x21b9a3+'\x22.');const _0x28e7f3=resolvePushSkillCode(_0x534223,_0x21b9a3,_0x27ace8,_0x330455);if(!_0x28e7f3)throw CliErrors['validation'](_0x8d0a89(0xaf)+SKILL_FILE+',\x20'+METADATA_FILE+_0x8d0a89(0xcc));return{'dir':_0x534223,'skillCode':_0x28e7f3,'metadata':_0x27ace8};}export function readPushDirectory(_0x229c57,_0x562ce2,_0x113c3e={}){const _0x338180=a144_0x2efd,_0x1ce42c=resolvePushDirectoryIdentity(_0x229c57,_0x562ce2,_0x113c3e),_0x4ee103=_0x1ce42c[_0x338180(0x96)],_0x16b7bc=resolve(_0x4ee103,SKILL_FILE);if(!existsSync(_0x16b7bc)||!lstatSync(_0x16b7bc)[_0x338180(0xac)]())throw CliErrors[_0x338180(0x9c)](_0x338180(0x91)+SKILL_FILE+':\x20'+_0x16b7bc);const _0x5424c7=_0x1ce42c['metadata'],_0x3b7aac=_0x113c3e[_0x338180(0xbf)]??_0x338180(0xc6);if(!_0x113c3e['ignoreMetadataScope']&&_0x5424c7?.[_0x338180(0xc2)]===_0x338180(0xc1))throw CliErrors[_0x338180(0x9c)](_0x338180(0xbb)+METADATA_FILE+'\x20has\x20scope=\x22'+_0x5424c7[_0x338180(0xc2)]+'\x22.');if(!_0x113c3e[_0x338180(0xca)]&&_0x3b7aac===_0x338180(0xc6)&&_0x5424c7?.[_0x338180(0xc2)]&&_0x5424c7[_0x338180(0xc2)]!=='personal')throw CliErrors[_0x338180(0x9c)](_0x338180(0xc7)+METADATA_FILE+_0x338180(0xa4)+_0x5424c7[_0x338180(0xc2)]+'\x22.','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20'+_0x4ee103+'\x20to\x20submit\x20company\x20Skills\x20for\x20review.');const _0x56d97a=scanSkillDirectory(_0x4ee103,{'excludedFilePaths':_0x113c3e['excludedFilePaths']}),_0x105584=buildSkillPackage(_0x56d97a),_0x59405e=readFileSync(_0x16b7bc,_0x338180(0xbc)),_0x58f920=_0x1ce42c[_0x338180(0xb6)],_0x940823=_0x113c3e['ignoreMetadataForPayload']?undefined:_0x5424c7,_0xf37d99=readSkillDisplayName(_0x59405e);return{'skillCode':_0x58f920,'metadata':_0x5424c7,'frontmatterDisplayName':_0xf37d99,'input':{'skillCode':_0x58f920,'skillName':_0xf37d99??_0x940823?.[_0x338180(0xbe)],'description':_0x940823?.['description'],'content':_0x59405e,'files':_0x105584[_0x338180(0xa0)],'packageBase64':_0x105584['packageBase64'],'tags':_0x940823?.['tags'],'version':_0x940823?.[_0x338180(0xa9)],'sourceSessionId':_0x940823?.[_0x338180(0xbd)]}};}export function refreshPushDirectoryMetadataFromRemote(_0x129cb9,_0x3eca3c,_0x28dced,_0x19b402={}){const _0x5549bf=a144_0x2efd,_0x2cf734=resolvePushDirectoryRoot(_0x129cb9),_0x4894a3=readPushMetadataIfPresent(resolve(_0x2cf734,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x31b43e=requireRemoteScope(_0x3eca3c),_0x5394f3=readLocalSkillContent(_0x2cf734),_0x595812={..._0x3eca3c,'appCode':_0x3eca3c[_0x5549bf(0xa6)]??_0x28dced,'skillName':_0x3eca3c['skillName']??_0x4894a3?.['skillName'],'description':_0x3eca3c[_0x5549bf(0x98)]??_0x4894a3?.[_0x5549bf(0x98)],'example':_0x3eca3c[_0x5549bf(0xcb)]??_0x4894a3?.[_0x5549bf(0xcb)],'tags':Array['isArray'](_0x3eca3c[_0x5549bf(0xa8)])?_0x3eca3c[_0x5549bf(0xa8)]:_0x4894a3?.[_0x5549bf(0xa8)],'sourceSessionId':_0x3eca3c[_0x5549bf(0xbd)]??_0x4894a3?.[_0x5549bf(0xbd)],'content':_0x3eca3c[_0x5549bf(0xc4)]??_0x5394f3},_0x1a6eda=buildMetadata(_0x595812,_0x31b43e,_0x28dced,contentHash(_0x5394f3),_0x19b402[_0x5549bf(0xaa)]);writeJsonAtomic(resolve(_0x2cf734,METADATA_FILE),_0x1a6eda);}export function recordPushedRuntimeSkill(_0x116602,_0xd83c17,_0xbb210e,_0x4f3152={}){const _0x341dcf=a144_0x2efd,_0x2c31c8=resolvePushDirectoryRoot(_0x116602),_0x97eba2=scanSkillDirectory(_0x2c31c8),_0x4580d2=_0x97eba2[_0x341dcf(0x9e)](_0x3261d7=>_0x3261d7[_0x341dcf(0x9b)]===SKILL_FILE),_0x5e0643=_0x4580d2?fileText(_0x4580d2):'',_0x33566a=tryNormalizePackageManifest(_0xd83c17[_0x341dcf(0xa1)]),_0x2858cc={..._0xd83c17,'content':_0xd83c17[_0x341dcf(0xc4)]??_0x5e0643,'files':_0x33566a},_0x10bd28=_0x33566a?normalizeLocalFiles(_0x97eba2)[_0x341dcf(0xb4)](_0xd60194=>_0x33566a[_0x341dcf(0xa1)]['some'](_0x4dc52c=>_0x4dc52c[_0x341dcf(0x9b)]===_0xd60194[_0x341dcf(0x9b)])):undefined,_0x44d26c=buildMetadata(_0x2858cc,_0x4f3152[_0x341dcf(0xc2)]??_0x341dcf(0xc6),_0xbb210e,contentHash(_0x2858cc[_0x341dcf(0xc4)]??''),_0x4f3152[_0x341dcf(0xae)],_0x10bd28);writeJsonAtomic(resolve(_0x2c31c8,METADATA_FILE),_0x44d26c);}export function deriveSkillCodeFromDirectory(_0x186138,_0x2f0de4){const _0x3d977f=a144_0x2efd,_0x3229b6=basename(resolve(_0x186138)),_0x68fd9b=_0x2f0de4+'--';return _0x3229b6[_0x3d977f(0xa7)](_0x68fd9b)?_0x3229b6[_0x3d977f(0xc8)](_0x68fd9b['length']):_0x3229b6;}function a144_0x3352(){const _0x3ff562=['isArray','67212PeUmXF','\x20has\x20unsupported\x20scope\x20\x22','filter','replace','skillCode','Skill\x20metadata\x20appCode\x20\x22','215uozFMz','allowAppCodeRetarget','toLowerCase','Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20','utf8','sourceSessionId','skillName','targetScope','string','builtin','scope','128056kYQAyA','content','boolean','personal','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20','slice','3691074iIxeUI','ignoreMetadataScope','example',',\x20or\x20directory\x20name.','trim','406652GKUgsb','ignoreMetadataSkillCode','company','Skill\x20directory\x20not\x20found:\x20','\x20name\x20for\x20SkillHub\x20slug\x20generation.','Missing\x20','object','ignoreMetadataAppCodeMismatch','isDirectory','number','dir','displayName','description','isSymbolicLink','(unknown)','path','validation','Remote\x20Skill\x20','find','5572431CGJdEO','manifest','files','match','ignoreInvalidMetadata','\x20has\x20scope=\x22','148868bRctIy','appCode','startsWith','tags','version','refreshedAt','33144IMHwCY','isFile','105wDHiYY','pushedAt','Unable\x20to\x20resolve\x20skillCode\x20from\x20','unknown'];a144_0x3352=function(){return _0x3ff562;};return a144_0x3352();}function a144_0x2efd(_0x4b89d9,_0x23fdbe){_0x4b89d9=_0x4b89d9-0x90;const _0x335292=a144_0x3352();let _0x2efd45=_0x335292[_0x4b89d9];return _0x2efd45;}function resolvePushSkillCode(_0x17d143,_0x250861,_0x349e37,_0x28b275){const _0x393e11=a144_0x2efd,_0xab18fc=deriveSkillCodeFromSkillFile(_0x17d143)||deriveSkillCodeFromDirectory(_0x17d143,_0x250861);if(_0x28b275[_0x393e11(0xcf)])return _0xab18fc;return _0x349e37?.[_0x393e11(0xb6)]?.['trim']()||_0xab18fc;}function deriveSkillCodeFromSkillFile(_0x2b8186){const _0x1d31cf=a144_0x2efd,_0x275c88=resolve(_0x2b8186,SKILL_FILE);if(!existsSync(_0x275c88)||!lstatSync(_0x275c88)[_0x1d31cf(0xac)]())return undefined;const _0x36e923=readFileSync(_0x275c88,_0x1d31cf(0xbc)),_0x37e722=_0x36e923[_0x1d31cf(0xa2)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x37e722)return undefined;const _0x84809a=parseFrontmatterObject(_0x37e722[0x1]??''),_0xa71226=scalarToString(_0x84809a?.['name']);return _0xa71226?slugifySkillName(_0xa71226):undefined;}function readSkillDisplayName(_0x30c73e){const _0x2e0f6a=a144_0x2efd,_0x5c85e2=_0x30c73e[_0x2e0f6a(0xa2)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x5c85e2)return undefined;const _0x3f3bc8=parseFrontmatterObject(_0x5c85e2[0x1]??'');return scalarToString(_0x3f3bc8?.[_0x2e0f6a(0x97)]);}function slugifySkillName(_0x34ee86){const _0x2a7f56=a144_0x2efd,_0x550b10=_0x34ee86[_0x2a7f56(0xcd)]()[_0x2a7f56(0xba)]()[_0x2a7f56(0xb5)](/[^\p{L}\p{N}\p{So}]+/gu,'-')[_0x2a7f56(0xb5)](/^-+/,'')[_0x2a7f56(0xb5)](/-+$/,'')[_0x2a7f56(0xb5)](/-{2,}/g,'-');if(!_0x550b10)throw CliErrors[_0x2a7f56(0x9c)]('Invalid\x20'+SKILL_FILE+_0x2a7f56(0x90));return _0x550b10;}function parseFrontmatterObject(_0x264ccd){const _0x58b229=a144_0x2efd;try{const _0x39ce89=a144_0x16b433(_0x264ccd);return _0x39ce89&&typeof _0x39ce89===_0x58b229(0x92)&&!Array[_0x58b229(0xb1)](_0x39ce89)?_0x39ce89:undefined;}catch{return undefined;}}function scalarToString(_0xe65c3c){const _0x2c67a3=a144_0x2efd;if(typeof _0xe65c3c===_0x2c67a3(0xc0))return _0xe65c3c[_0x2c67a3(0xcd)]();if(typeof _0xe65c3c===_0x2c67a3(0x95)||typeof _0xe65c3c===_0x2c67a3(0xc5))return String(_0xe65c3c);return undefined;}function resolvePushDirectoryRoot(_0x1cb14c){const _0x3b7beb=a144_0x2efd,_0x3498a7=resolve(_0x1cb14c);if(!existsSync(_0x3498a7))throw CliErrors[_0x3b7beb(0x9c)](_0x3b7beb(0xd1)+_0x1cb14c);const _0xa60b7e=lstatSync(_0x3498a7);if(_0xa60b7e[_0x3b7beb(0x94)]())return _0x3498a7;if(_0xa60b7e[_0x3b7beb(0x99)]()){const _0x345d16=realpathSync(_0x3498a7);if(lstatSync(_0x345d16)[_0x3b7beb(0x94)]())return _0x345d16;}throw CliErrors[_0x3b7beb(0x9c)]('Skill\x20directory\x20not\x20found:\x20'+_0x1cb14c);}function requireRemoteScope(_0x55d1ee){const _0x5ddf83=a144_0x2efd;if(_0x55d1ee['scope']===_0x5ddf83(0xc6)||_0x55d1ee['scope']===_0x5ddf83(0xd0)||_0x55d1ee['scope']==='builtin')return _0x55d1ee['scope'];throw CliErrors[_0x5ddf83(0x9c)](_0x5ddf83(0x9d)+(_0x55d1ee[_0x5ddf83(0xb6)]||_0x5ddf83(0x9a))+_0x5ddf83(0xb3)+(_0x55d1ee[_0x5ddf83(0xc2)]??_0x5ddf83(0xb0))+'\x22.');}function readLocalSkillContent(_0x55fd86){const _0x5386a5=a144_0x2efd,_0x4469f6=resolve(_0x55fd86,SKILL_FILE);return existsSync(_0x4469f6)&&lstatSync(_0x4469f6)[_0x5386a5(0xac)]()?readFileSync(_0x4469f6,'utf8'):'';}function readPushMetadataIfPresent(_0x10e433,_0x4222ab={}){const _0x27e5a8=a144_0x2efd;try{return readMetadataIfPresent(_0x10e433);}catch(_0x5d1f3e){if(_0x4222ab[_0x27e5a8(0xa3)])return undefined;throw _0x5d1f3e;}}
@@ -1 +1 @@
1
- function a145_0x4e46(){const _0x3cb0e8=['length','746928aBsfGb','117294HEBZtc','Unsupported\x20runtime\x20Skill\x20scope:\x20','8UmiDkY','company','personal','validation','956578TDjyfu','builtin','push','36027gXckWE','91gQzRcu','32ZmUXfZ','154850qOpdcS','4103694YhcrLo','518780FbacsF'];a145_0x4e46=function(){return _0x3cb0e8;};return a145_0x4e46();}(function(_0x558690,_0x1669d5){const _0x120010=a145_0x39b5,_0x105c80=_0x558690();while(!![]){try{const _0x26dce7=parseInt(_0x120010(0x1ec))/0x1+parseInt(_0x120010(0x1e9))/0x2+parseInt(_0x120010(0x1e2))/0x3+parseInt(_0x120010(0x1ee))/0x4*(-parseInt(_0x120010(0x1ef))/0x5)+parseInt(_0x120010(0x1e3))/0x6*(parseInt(_0x120010(0x1ed))/0x7)+-parseInt(_0x120010(0x1e5))/0x8*(parseInt(_0x120010(0x1f0))/0x9)+-parseInt(_0x120010(0x1f1))/0xa;if(_0x26dce7===_0x1669d5)break;else _0x105c80['push'](_0x105c80['shift']());}catch(_0x55ccbb){_0x105c80['push'](_0x105c80['shift']());}}}(a145_0x4e46,0x3fec1));import{CliErrors}from'../../errors.js';function a145_0x39b5(_0xf5ac82,_0x503b2b){_0xf5ac82=_0xf5ac82-0x1e2;const _0x4e46ef=a145_0x4e46();let _0x39b593=_0x4e46ef[_0xf5ac82];return _0x39b593;}export function normalizeRuntimeSkillScopes(_0x4837e9){const _0x37716f=a145_0x39b5,_0xc49b78=_0x4837e9&&_0x4837e9[_0x37716f(0x1f2)]>0x0?_0x4837e9:[_0x37716f(0x1e7),_0x37716f(0x1e6),'builtin'],_0x1fc02c=[];for(const _0x5e915e of _0xc49b78){if(!isRuntimeSkillScope(_0x5e915e))throw CliErrors[_0x37716f(0x1e8)](_0x37716f(0x1e4)+_0x5e915e);!_0x1fc02c['includes'](_0x5e915e)&&_0x1fc02c[_0x37716f(0x1eb)](_0x5e915e);}return _0x1fc02c;}export function isRuntimeSkillScope(_0x5b2047){const _0x989d8b=a145_0x39b5;return _0x5b2047==='personal'||_0x5b2047===_0x989d8b(0x1e6)||_0x5b2047===_0x989d8b(0x1ea);}
1
+ (function(_0x369c0d,_0x3e0b94){const _0x5e679c=a145_0x4d09,_0x4dfa27=_0x369c0d();while(!![]){try{const _0x159ce3=parseInt(_0x5e679c(0x1ea))/0x1*(-parseInt(_0x5e679c(0x1ef))/0x2)+parseInt(_0x5e679c(0x1e9))/0x3+-parseInt(_0x5e679c(0x1e2))/0x4*(-parseInt(_0x5e679c(0x1df))/0x5)+parseInt(_0x5e679c(0x1e3))/0x6+parseInt(_0x5e679c(0x1e0))/0x7+parseInt(_0x5e679c(0x1ed))/0x8+-parseInt(_0x5e679c(0x1e8))/0x9*(parseInt(_0x5e679c(0x1e5))/0xa);if(_0x159ce3===_0x3e0b94)break;else _0x4dfa27['push'](_0x4dfa27['shift']());}catch(_0x17ae3f){_0x4dfa27['push'](_0x4dfa27['shift']());}}}(a145_0x5c52,0x27b7d));function a145_0x4d09(_0x14af3b,_0x153e9d){_0x14af3b=_0x14af3b-0x1df;const _0x5c52a2=a145_0x5c52();let _0x4d09d0=_0x5c52a2[_0x14af3b];return _0x4d09d0;}import{CliErrors}from'../../errors.js';export function normalizeRuntimeSkillScopes(_0x2130d7){const _0xdeaa99=a145_0x4d09,_0x12b6db=_0x2130d7&&_0x2130d7[_0xdeaa99(0x1ec)]>0x0?_0x2130d7:[_0xdeaa99(0x1e1),_0xdeaa99(0x1ee),_0xdeaa99(0x1e7)],_0x448722=[];for(const _0x3122ea of _0x12b6db){if(!isRuntimeSkillScope(_0x3122ea))throw CliErrors['validation'](_0xdeaa99(0x1e4)+_0x3122ea);!_0x448722[_0xdeaa99(0x1eb)](_0x3122ea)&&_0x448722[_0xdeaa99(0x1e6)](_0x3122ea);}return _0x448722;}function a145_0x5c52(){const _0x39e641=['company','46pAYEYv','10Ivfody','662319dUDkKk','personal','606720EDFNPc','764070DNKpQI','Unsupported\x20runtime\x20Skill\x20scope:\x20','55790oXbguZ','push','builtin','981uQAgVK','706977oUFgIr','818TnoHgs','includes','length','229032mUZQRl'];a145_0x5c52=function(){return _0x39e641;};return a145_0x5c52();}export function isRuntimeSkillScope(_0x4872aa){const _0x691e69=a145_0x4d09;return _0x4872aa===_0x691e69(0x1e1)||_0x4872aa===_0x691e69(0x1ee)||_0x4872aa===_0x691e69(0x1e7);}
@@ -1 +1 @@
1
- function a147_0x232e(){const _0x2777c3=['sort','24GIBeZv','endsWith','2718576EaKKvl','2296400fZiddj','code','140140CohrIV','from','195088kUcSUt','65vuMphC','1221toNEmM','validation_error','4744rcMmRP','1980-01-01T00:00:00.000Z','Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.','1393bnuLPu','validation','entries','name','97386rnbIak','map','path','Runtime\x20Skill\x20package\x20contains\x20directory\x20entry:\x20'];a147_0x232e=function(){return _0x2777c3;};return a147_0x232e();}const a147_0xc23e46=a147_0x2137;(function(_0x36767f,_0x1312f4){const _0x4652b9=a147_0x2137,_0x1ea6ac=_0x36767f();while(!![]){try{const _0x54bef5=-parseInt(_0x4652b9(0x1e3))/0x1+parseInt(_0x4652b9(0x1de))/0x2*(-parseInt(_0x4652b9(0x1e7))/0x3)+-parseInt(_0x4652b9(0x1e5))/0x4+-parseInt(_0x4652b9(0x1e6))/0x5*(parseInt(_0x4652b9(0x1d9))/0x6)+-parseInt(_0x4652b9(0x1d5))/0x7*(-parseInt(_0x4652b9(0x1e9))/0x8)+parseInt(_0x4652b9(0x1e0))/0x9+parseInt(_0x4652b9(0x1e1))/0xa;if(_0x54bef5===_0x1312f4)break;else _0x1ea6ac['push'](_0x1ea6ac['shift']());}catch(_0x3ea7c0){_0x1ea6ac['push'](_0x1ea6ac['shift']());}}}(a147_0x232e,0x3bcb0));function a147_0x2137(_0x1b3280,_0xccfd82){_0x1b3280=_0x1b3280-0x1d3;const _0x232e64=a147_0x232e();let _0x2137e8=_0x232e64[_0x1b3280];return _0x2137e8;}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_0xc23e46(0x1d3));export function createDeterministicZipPackage(_0x34e45a){const _0x424d4d=a147_0xc23e46,_0xefab2c={};for(const _0x419838 of normalizeLocalFiles(_0x34e45a)){_0xefab2c[_0x419838[_0x424d4d(0x1db)]]=fileContent(_0x419838);}return Buffer[_0x424d4d(0x1e4)](zipSync(_0xefab2c,{'level':0x0,'mtime':ZIP_MTIME}));}export function parseZipPackage(_0x44a135){const _0x203e83=a147_0xc23e46;if(_0x44a135['length']<0x16)throw CliErrors[_0x203e83(0x1d6)](_0x203e83(0x1d4));let _0xd1fa4e;try{_0xd1fa4e=unzipSync(_0x44a135,{'filter'(_0x138352){const _0x1c54bf=_0x203e83,_0x54f129=normalizeSkillRelativePath(_0x138352[_0x1c54bf(0x1d8)]);if(_0x54f129[_0x1c54bf(0x1df)]('/'))throw CliErrors['validation'](_0x1c54bf(0x1dc)+_0x54f129);return!![];}});}catch(_0x492dbe){if(isRuntimeSkillValidationError(_0x492dbe))throw _0x492dbe;throw CliErrors['validation'](_0x203e83(0x1d4));}return Object[_0x203e83(0x1d7)](_0xd1fa4e)[_0x203e83(0x1da)](([_0x1c4bd6,_0x186979])=>({'path':normalizeSkillRelativePath(_0x1c4bd6),'bytes':Buffer[_0x203e83(0x1e4)](_0x186979)}))[_0x203e83(0x1dd)](compareSkillFiles);}function isRuntimeSkillValidationError(_0x8afc65){const _0x527da6=a147_0xc23e46;return typeof _0x8afc65==='object'&&_0x8afc65!==null&&'code'in _0x8afc65&&_0x8afc65[_0x527da6(0x1e2)]===_0x527da6(0x1e8);}
1
+ const a147_0xf95187=a147_0x3a88;(function(_0x16a9e9,_0x3e8387){const _0x215dfa=a147_0x3a88,_0x585f46=_0x16a9e9();while(!![]){try{const _0x343310=parseInt(_0x215dfa(0x9f))/0x1*(-parseInt(_0x215dfa(0x9c))/0x2)+-parseInt(_0x215dfa(0xab))/0x3*(-parseInt(_0x215dfa(0xa4))/0x4)+parseInt(_0x215dfa(0x99))/0x5*(parseInt(_0x215dfa(0xad))/0x6)+parseInt(_0x215dfa(0xac))/0x7+-parseInt(_0x215dfa(0xa3))/0x8+parseInt(_0x215dfa(0xa7))/0x9+parseInt(_0x215dfa(0xa9))/0xa;if(_0x343310===_0x3e8387)break;else _0x585f46['push'](_0x585f46['shift']());}catch(_0x197a96){_0x585f46['push'](_0x585f46['shift']());}}}(a147_0x5718,0x9141e));function a147_0x3a88(_0x58695c,_0x2b69ba){_0x58695c=_0x58695c-0x97;const _0x57181f=a147_0x5718();let _0x3a88a4=_0x57181f[_0x58695c];return _0x3a88a4;}import{unzipSync,zipSync}from'fflate';import{CliErrors}from'../../errors.js';import{compareSkillFiles,fileContent,normalizeLocalFiles,normalizeSkillRelativePath}from'./local-files.js';const ZIP_MTIME=new Date(a147_0xf95187(0xa2));export function createDeterministicZipPackage(_0x18ee8f){const _0x1d31b1=a147_0xf95187,_0x11b74c={};for(const _0x4e1957 of normalizeLocalFiles(_0x18ee8f)){_0x11b74c[_0x4e1957[_0x1d31b1(0xa6)]]=fileContent(_0x4e1957);}return Buffer['from'](zipSync(_0x11b74c,{'level':0x0,'mtime':ZIP_MTIME}));}export function parseZipPackage(_0x3e0474){const _0x1b419c=a147_0xf95187;if(_0x3e0474[_0x1b419c(0x9a)]<0x16)throw CliErrors[_0x1b419c(0xa1)](_0x1b419c(0xa5));let _0x225c92;try{_0x225c92=unzipSync(_0x3e0474,{'filter'(_0xe367ce){const _0x2069a8=_0x1b419c,_0x13cba3=normalizeSkillRelativePath(_0xe367ce[_0x2069a8(0x9e)]);if(_0x13cba3['endsWith']('/'))throw CliErrors[_0x2069a8(0xa1)](_0x2069a8(0x97)+_0x13cba3);return!![];}});}catch(_0x3863ed){if(isRuntimeSkillValidationError(_0x3863ed))throw _0x3863ed;throw CliErrors[_0x1b419c(0xa1)](_0x1b419c(0xa5));}return Object[_0x1b419c(0xa0)](_0x225c92)[_0x1b419c(0x9d)](([_0x294792,_0x18156e])=>({'path':normalizeSkillRelativePath(_0x294792),'bytes':Buffer[_0x1b419c(0xa8)](_0x18156e)}))[_0x1b419c(0x98)](compareSkillFiles);}function isRuntimeSkillValidationError(_0x192d68){const _0xf5b205=a147_0xf95187;return typeof _0x192d68===_0xf5b205(0x9b)&&_0x192d68!==null&&_0xf5b205(0xae)in _0x192d68&&_0x192d68[_0xf5b205(0xae)]===_0xf5b205(0xaa);}function a147_0x5718(){const _0x214aab=['Runtime\x20Skill\x20package\x20contains\x20directory\x20entry:\x20','sort','5jWADvi','length','object','2RehAzI','map','name','655831syTDxT','entries','validation','1980-01-01T00:00:00.000Z','7882512PvULvI','381688dVEJRq','Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.','path','3709170mYMwDH','from','435600fIGlDq','validation_error','6BWAawo','4528986IKvlvh','5655522AkzBnV','code'];a147_0x5718=function(){return _0x214aab;};return a147_0x5718();}
@@ -1 +1 @@
1
- (function(_0x43421c,_0x1684a8){const _0x1c4170=a148_0x2faa,_0x455025=_0x43421c();while(!![]){try{const _0x193d80=-parseInt(_0x1c4170(0xc7))/0x1*(-parseInt(_0x1c4170(0xc6))/0x2)+-parseInt(_0x1c4170(0xc3))/0x3*(-parseInt(_0x1c4170(0xdb))/0x4)+-parseInt(_0x1c4170(0xcb))/0x5+-parseInt(_0x1c4170(0xd4))/0x6+parseInt(_0x1c4170(0xc8))/0x7*(parseInt(_0x1c4170(0xdc))/0x8)+-parseInt(_0x1c4170(0xe6))/0x9+parseInt(_0x1c4170(0xc1))/0xa*(-parseInt(_0x1c4170(0xbe))/0xb);if(_0x193d80===_0x1684a8)break;else _0x455025['push'](_0x455025['shift']());}catch(_0x4ee757){_0x455025['push'](_0x455025['shift']());}}}(a148_0x3afa,0xc80cd));import{CliErrors}from'../../errors.js';function a148_0x3afa(){const _0x566f80=['schemaVersion','map','path','isSafeInteger','Duplicate\x20Skill\x20package\x20entry:\x20','2494452Dbulwj','Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.','files','Runtime\x20Skill\x20package\x20sha256\x20is\x20invalid.','Runtime\x20Skill\x20package\x20is\x20missing\x20entry:\x20','Runtime\x20Skill\x20package\x20sha256\x20mismatch.','Runtime\x20Skill\x20package\x20is\x20required\x20for\x20Skill\x20install:\x20','3053340VTfxtN','8kItcaf','string','\x20in\x20Skill\x20file\x20package.','Runtime\x20Skill\x20package\x20size\x20is\x20invalid.','Runtime\x20Skill\x20package\x20size\x20mismatch.','Runtime\x20Skill\x20package\x20file\x20sha256\x20mismatch:\x20','object','Runtime\x20Skill\x20file\x20tree\x20sha256\x20is\x20invalid.','some','toLowerCase','9104085cGJHTR','base64','ossPath','set','isArray','10747guXIgI','length','Missing\x20','10430fXmvDo','validation','6uhKQgX','bytes','sha256','2ENyrlu','1378763zFIwqL','10959263LRwQqa','Runtime\x20Skill\x20package\x20is\x20missing\x20','zipSha256','6026595yNPdGE','toString','zipSize','treeSha256'];a148_0x3afa=function(){return _0x566f80;};return a148_0x3afa();}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(_0x5ec2bf){const _0x4dec00=a148_0x2faa,_0x41a534=normalizeLocalFiles(_0x5ec2bf);if(!_0x41a534[_0x4dec00(0xe4)](_0xfea4e8=>_0xfea4e8[_0x4dec00(0xd1)]===SKILL_FILE))throw CliErrors['validation'](_0x4dec00(0xc0)+SKILL_FILE+_0x4dec00(0xde));const _0x167e60=localFilesToManifestFiles(_0x41a534),_0x558634=createDeterministicZipPackage(_0x41a534);return{'manifest':{'schemaVersion':0x2,'treeSha256':fileTreeHash(_0x167e60),'zipSha256':bufferSha256(_0x558634),'zipSize':_0x558634[_0x4dec00(0xbf)],'files':_0x167e60},'packageBytes':_0x558634,'packageBase64':_0x558634[_0x4dec00(0xcc)](_0x4dec00(0xe7))};}function a148_0x2faa(_0x1d97a,_0x3e7e4f){_0x1d97a=_0x1d97a-0xbb;const _0x3afacb=a148_0x3afa();let _0x2faa96=_0x3afacb[_0x1d97a];return _0x2faa96;}export function verifyRuntimeSkillPackage(_0x1d0cd2,_0x4c022c){const _0x624485=a148_0x2faa,_0x1ce496=normalizePackageManifest(_0x1d0cd2,{'requireOssPath':![]});if(!_0x1ce496)throw CliErrors[_0x624485(0xc2)]('Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.');return extractAndVerifyPackage(_0x1ce496,_0x4c022c);}export function verifyRuntimeSkillBundle(_0x1bb2a6,_0x2d3208){const _0x413f6a=a148_0x2faa,_0x581a9d=normalizePackageManifest(_0x1bb2a6,{'requireOssPath':![]});if(!_0x581a9d)throw CliErrors[_0x413f6a(0xc2)](_0x413f6a(0xd5));return extractAndVerifyPackageFiles(_0x581a9d,_0x2d3208);}export function tryNormalizePackageManifest(_0x114138){return normalizePackageManifest(_0x114138,{'requireOssPath':![]});}export function requirePackageBytes(_0x59dca8,_0x499004){const _0x2753c5=a148_0x2faa;if(!_0x499004||_0x499004[_0x2753c5(0xbf)]===0x0)throw CliErrors['validation'](_0x2753c5(0xda)+_0x59dca8);return _0x499004;}export function extractDownloadedPackage(_0x529dd1){const _0x15a425=a148_0x2faa,_0x3318a0=parseZipPackage(_0x529dd1)[_0x15a425(0xd0)](_0x269fe8=>({'path':_0x269fe8['path'],'bytes':_0x269fe8[_0x15a425(0xc4)]}));if(!_0x3318a0[_0x15a425(0xe4)](_0x313f4a=>_0x313f4a[_0x15a425(0xd1)]===SKILL_FILE))throw CliErrors['validation'](_0x15a425(0xc9)+SKILL_FILE+'.');return normalizeLocalFiles(_0x3318a0);}export function localFilesToManifestFiles(_0x923ed3){const _0x44de45=a148_0x2faa;return normalizeLocalFiles(_0x923ed3)[_0x44de45(0xd0)](_0x1769d8=>({'path':_0x1769d8[_0x44de45(0xd1)],'sha256':fileHash(_0x1769d8),'size':fileContent(_0x1769d8)[_0x44de45(0xbf)]}));}function normalizePackageManifest(_0x5b96f6,_0x3159d3){const _0x3627ed=a148_0x2faa;if(!_0x5b96f6||typeof _0x5b96f6!==_0x3627ed(0xe2)||Array[_0x3627ed(0xbd)](_0x5b96f6))return undefined;const _0x2948fe=_0x5b96f6,_0x485842=typeof _0x2948fe[_0x3627ed(0xbb)]===_0x3627ed(0xdd)?_0x2948fe[_0x3627ed(0xbb)]['trim']():undefined;if(_0x3159d3['requireOssPath']&&!_0x485842)return undefined;if(!Array[_0x3627ed(0xbd)](_0x2948fe['files'])||_0x2948fe[_0x3627ed(0xd6)]['length']===0x0)return undefined;if(!isSha256Hex(_0x2948fe[_0x3627ed(0xce)]))throw CliErrors[_0x3627ed(0xc2)](_0x3627ed(0xe3));if(!isSha256Hex(_0x2948fe[_0x3627ed(0xca)]))throw CliErrors[_0x3627ed(0xc2)](_0x3627ed(0xd7));if(!Number[_0x3627ed(0xd2)](_0x2948fe[_0x3627ed(0xcd)])||_0x2948fe['zipSize']<0x0)throw CliErrors[_0x3627ed(0xc2)](_0x3627ed(0xdf));const _0x3ce288=normalizeManifestFiles(_0x2948fe['files']);if(!_0x3ce288[_0x3627ed(0xe4)](_0x29cc9c=>_0x29cc9c[_0x3627ed(0xd1)]===SKILL_FILE))throw CliErrors['validation']('Runtime\x20Skill\x20manifest\x20is\x20missing\x20'+SKILL_FILE+'.');const _0x334ca8=fileTreeHash(_0x3ce288);if(_0x334ca8!==_0x2948fe[_0x3627ed(0xce)]['toLowerCase']())throw CliErrors[_0x3627ed(0xc2)]('Runtime\x20Skill\x20file\x20tree\x20sha256\x20mismatch.');return{'schemaVersion':Number['isSafeInteger'](_0x2948fe[_0x3627ed(0xcf)])?_0x2948fe['schemaVersion']:0x2,'ossPath':_0x485842,'treeSha256':_0x334ca8,'zipSha256':_0x2948fe[_0x3627ed(0xca)][_0x3627ed(0xe5)](),'zipSize':_0x2948fe['zipSize'],'files':_0x3ce288};}function extractAndVerifyPackage(_0x1ca2c1,_0x4acade){const _0x5a1289=a148_0x2faa,_0x17f6db=normalizePackageManifest(_0x1ca2c1,{'requireOssPath':![]});if(!_0x17f6db)throw CliErrors[_0x5a1289(0xc2)]('Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.');if(_0x4acade[_0x5a1289(0xbf)]!==_0x17f6db[_0x5a1289(0xcd)])throw CliErrors['validation'](_0x5a1289(0xe0));const _0x222108=bufferSha256(_0x4acade);if(_0x222108!==_0x17f6db[_0x5a1289(0xca)])throw CliErrors['validation'](_0x5a1289(0xd9));return extractAndVerifyPackageFiles(_0x17f6db,_0x4acade);}function extractAndVerifyPackageFiles(_0x4b06fe,_0x506f20){const _0x1aa65e=a148_0x2faa,_0x25a626=parseZipPackage(_0x506f20);if(_0x25a626[_0x1aa65e(0xbf)]!==_0x4b06fe[_0x1aa65e(0xd6)][_0x1aa65e(0xbf)])throw CliErrors['validation']('Runtime\x20Skill\x20package\x20entry\x20list\x20mismatch.');const _0x40e931=new Map();for(const _0x1304f7 of _0x25a626){if(_0x40e931['has'](_0x1304f7[_0x1aa65e(0xd1)]))throw CliErrors[_0x1aa65e(0xc2)](_0x1aa65e(0xd3)+_0x1304f7['path']);_0x40e931[_0x1aa65e(0xbc)](_0x1304f7[_0x1aa65e(0xd1)],_0x1304f7);}const _0x5025ea=[];for(const _0x165515 of _0x4b06fe[_0x1aa65e(0xd6)]){const _0x5c31fb=_0x40e931['get'](_0x165515[_0x1aa65e(0xd1)]);if(!_0x5c31fb)throw CliErrors[_0x1aa65e(0xc2)](_0x1aa65e(0xd8)+_0x165515['path']);if(_0x5c31fb[_0x1aa65e(0xc4)][_0x1aa65e(0xbf)]!==_0x165515['size'])throw CliErrors[_0x1aa65e(0xc2)]('Runtime\x20Skill\x20package\x20file\x20size\x20mismatch:\x20'+_0x165515[_0x1aa65e(0xd1)]);const _0x42273d=bufferSha256(_0x5c31fb['bytes']);if(_0x42273d!==_0x165515[_0x1aa65e(0xc5)])throw CliErrors['validation'](_0x1aa65e(0xe1)+_0x165515[_0x1aa65e(0xd1)]);_0x5025ea['push']({'path':_0x165515['path'],'bytes':_0x5c31fb[_0x1aa65e(0xc4)]});}return normalizeLocalFiles(_0x5025ea);}
1
+ (function(_0x3bf6b6,_0x15a9b2){const _0x3c2e9d=a148_0x8991,_0x347b34=_0x3bf6b6();while(!![]){try{const _0x263826=parseInt(_0x3c2e9d(0xf8))/0x1+-parseInt(_0x3c2e9d(0xe7))/0x2+parseInt(_0x3c2e9d(0x111))/0x3+-parseInt(_0x3c2e9d(0x102))/0x4*(-parseInt(_0x3c2e9d(0x106))/0x5)+-parseInt(_0x3c2e9d(0xe5))/0x6+-parseInt(_0x3c2e9d(0xf5))/0x7*(parseInt(_0x3c2e9d(0xe9))/0x8)+parseInt(_0x3c2e9d(0xfa))/0x9;if(_0x263826===_0x15a9b2)break;else _0x347b34['push'](_0x347b34['shift']());}catch(_0x3b4760){_0x347b34['push'](_0x347b34['shift']());}}}(a148_0x484f,0x23fea));import{CliErrors}from'../../errors.js';import{SKILL_FILE}from'./constants.js';function a148_0x484f(){const _0xf102cc=['84604LMSnZl','isArray','196614UBzSuS','sha256','Runtime\x20Skill\x20package\x20size\x20is\x20invalid.','push','Runtime\x20Skill\x20package\x20sha256\x20is\x20invalid.','toLowerCase','Runtime\x20Skill\x20package\x20file\x20size\x20mismatch:\x20','bytes','4bejSYc','ossPath','base64','schemaVersion','1413235QVAAzS','requireOssPath','get','Runtime\x20Skill\x20manifest\x20is\x20missing\x20','trim','Runtime\x20Skill\x20package\x20entry\x20list\x20mismatch.','path','zipSha256','Runtime\x20Skill\x20package\x20size\x20mismatch.','string','Runtime\x20Skill\x20package\x20file\x20sha256\x20mismatch:\x20','165324ujkITs','351582EbffDn','Runtime\x20Skill\x20package\x20is\x20required\x20for\x20Skill\x20install:\x20','313638fOkSyU','some','650840HwAORq','files','Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.','isSafeInteger','length','validation','Runtime\x20Skill\x20file\x20tree\x20sha256\x20is\x20invalid.','\x20in\x20Skill\x20file\x20package.','zipSize','map','Runtime\x20Skill\x20package\x20is\x20missing\x20','set','7TxkhmQ','Runtime\x20Skill\x20file\x20tree\x20sha256\x20mismatch.','treeSha256'];a148_0x484f=function(){return _0xf102cc;};return a148_0x484f();}import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';import{fileContent,isSha256Hex,normalizeLocalFiles,normalizeManifestFiles}from'./local-files.js';import{createDeterministicZipPackage,parseZipPackage}from'./zip-codec.js';export function buildSkillPackage(_0xa92a2c){const _0x884d83=a148_0x8991,_0x4f5c2d=normalizeLocalFiles(_0xa92a2c);if(!_0x4f5c2d[_0x884d83(0xe8)](_0x45fe38=>_0x45fe38[_0x884d83(0x10c)]===SKILL_FILE))throw CliErrors[_0x884d83(0xee)]('Missing\x20'+SKILL_FILE+_0x884d83(0xf0));const _0x491ae8=localFilesToManifestFiles(_0x4f5c2d),_0x578e42=createDeterministicZipPackage(_0x4f5c2d);return{'manifest':{'schemaVersion':0x2,'treeSha256':fileTreeHash(_0x491ae8),'zipSha256':bufferSha256(_0x578e42),'zipSize':_0x578e42[_0x884d83(0xed)],'files':_0x491ae8},'packageBytes':_0x578e42,'packageBase64':_0x578e42['toString'](_0x884d83(0x104))};}export function verifyRuntimeSkillPackage(_0x2dfaeb,_0x39d102){const _0x241486=a148_0x8991,_0x22cc59=normalizePackageManifest(_0x2dfaeb,{'requireOssPath':![]});if(!_0x22cc59)throw CliErrors[_0x241486(0xee)]('Runtime\x20Skill\x20package\x20manifest\x20is\x20missing.');return extractAndVerifyPackage(_0x22cc59,_0x39d102);}export function verifyRuntimeSkillBundle(_0x467f1c,_0x297cea){const _0x23f481=a148_0x8991,_0x1298cf=normalizePackageManifest(_0x467f1c,{'requireOssPath':![]});if(!_0x1298cf)throw CliErrors[_0x23f481(0xee)](_0x23f481(0xeb));return extractAndVerifyPackageFiles(_0x1298cf,_0x297cea);}export function tryNormalizePackageManifest(_0x16a946){return normalizePackageManifest(_0x16a946,{'requireOssPath':![]});}export function requirePackageBytes(_0x3e1405,_0x16f8c8){const _0x444587=a148_0x8991;if(!_0x16f8c8||_0x16f8c8[_0x444587(0xed)]===0x0)throw CliErrors[_0x444587(0xee)](_0x444587(0xe6)+_0x3e1405);return _0x16f8c8;}export function extractDownloadedPackage(_0x195d63){const _0x120808=a148_0x8991,_0x2621ad=parseZipPackage(_0x195d63)[_0x120808(0xf2)](_0x258211=>({'path':_0x258211['path'],'bytes':_0x258211[_0x120808(0x101)]}));if(!_0x2621ad[_0x120808(0xe8)](_0x331a02=>_0x331a02[_0x120808(0x10c)]===SKILL_FILE))throw CliErrors[_0x120808(0xee)](_0x120808(0xf3)+SKILL_FILE+'.');return normalizeLocalFiles(_0x2621ad);}export function localFilesToManifestFiles(_0x2c6fca){const _0x3f215b=a148_0x8991;return normalizeLocalFiles(_0x2c6fca)[_0x3f215b(0xf2)](_0x2752bc=>({'path':_0x2752bc[_0x3f215b(0x10c)],'sha256':fileHash(_0x2752bc),'size':fileContent(_0x2752bc)['length']}));}function normalizePackageManifest(_0x35f1ab,_0x421f07){const _0x2d60c2=a148_0x8991;if(!_0x35f1ab||typeof _0x35f1ab!=='object'||Array[_0x2d60c2(0xf9)](_0x35f1ab))return undefined;const _0x5d4be3=_0x35f1ab,_0x26cdca=typeof _0x5d4be3[_0x2d60c2(0x103)]===_0x2d60c2(0x10f)?_0x5d4be3[_0x2d60c2(0x103)][_0x2d60c2(0x10a)]():undefined;if(_0x421f07[_0x2d60c2(0x107)]&&!_0x26cdca)return undefined;if(!Array[_0x2d60c2(0xf9)](_0x5d4be3[_0x2d60c2(0xea)])||_0x5d4be3[_0x2d60c2(0xea)]['length']===0x0)return undefined;if(!isSha256Hex(_0x5d4be3[_0x2d60c2(0xf7)]))throw CliErrors[_0x2d60c2(0xee)](_0x2d60c2(0xef));if(!isSha256Hex(_0x5d4be3[_0x2d60c2(0x10d)]))throw CliErrors[_0x2d60c2(0xee)](_0x2d60c2(0xfe));if(!Number['isSafeInteger'](_0x5d4be3[_0x2d60c2(0xf1)])||_0x5d4be3[_0x2d60c2(0xf1)]<0x0)throw CliErrors[_0x2d60c2(0xee)](_0x2d60c2(0xfc));const _0x4e42c3=normalizeManifestFiles(_0x5d4be3[_0x2d60c2(0xea)]);if(!_0x4e42c3['some'](_0x142b14=>_0x142b14[_0x2d60c2(0x10c)]===SKILL_FILE))throw CliErrors[_0x2d60c2(0xee)](_0x2d60c2(0x109)+SKILL_FILE+'.');const _0x4e1b48=fileTreeHash(_0x4e42c3);if(_0x4e1b48!==_0x5d4be3[_0x2d60c2(0xf7)][_0x2d60c2(0xff)]())throw CliErrors['validation'](_0x2d60c2(0xf6));return{'schemaVersion':Number[_0x2d60c2(0xec)](_0x5d4be3[_0x2d60c2(0x105)])?_0x5d4be3[_0x2d60c2(0x105)]:0x2,'ossPath':_0x26cdca,'treeSha256':_0x4e1b48,'zipSha256':_0x5d4be3[_0x2d60c2(0x10d)][_0x2d60c2(0xff)](),'zipSize':_0x5d4be3['zipSize'],'files':_0x4e42c3};}function extractAndVerifyPackage(_0xeb2b20,_0x2b6e1d){const _0x42db7e=a148_0x8991,_0x2f08fc=normalizePackageManifest(_0xeb2b20,{'requireOssPath':![]});if(!_0x2f08fc)throw CliErrors[_0x42db7e(0xee)](_0x42db7e(0xeb));if(_0x2b6e1d[_0x42db7e(0xed)]!==_0x2f08fc['zipSize'])throw CliErrors[_0x42db7e(0xee)](_0x42db7e(0x10e));const _0x25a1d8=bufferSha256(_0x2b6e1d);if(_0x25a1d8!==_0x2f08fc[_0x42db7e(0x10d)])throw CliErrors[_0x42db7e(0xee)]('Runtime\x20Skill\x20package\x20sha256\x20mismatch.');return extractAndVerifyPackageFiles(_0x2f08fc,_0x2b6e1d);}function a148_0x8991(_0x4dbcca,_0x5ad7d0){_0x4dbcca=_0x4dbcca-0xe5;const _0x484f1c=a148_0x484f();let _0x8991bb=_0x484f1c[_0x4dbcca];return _0x8991bb;}function extractAndVerifyPackageFiles(_0x50b67f,_0x29f0ee){const _0x3ff99f=a148_0x8991,_0x542e52=parseZipPackage(_0x29f0ee);if(_0x542e52[_0x3ff99f(0xed)]!==_0x50b67f[_0x3ff99f(0xea)][_0x3ff99f(0xed)])throw CliErrors['validation'](_0x3ff99f(0x10b));const _0x4494b1=new Map();for(const _0x369198 of _0x542e52){if(_0x4494b1['has'](_0x369198['path']))throw CliErrors[_0x3ff99f(0xee)]('Duplicate\x20Skill\x20package\x20entry:\x20'+_0x369198['path']);_0x4494b1[_0x3ff99f(0xf4)](_0x369198['path'],_0x369198);}const _0x2e2f21=[];for(const _0x141230 of _0x50b67f[_0x3ff99f(0xea)]){const _0x12d45b=_0x4494b1[_0x3ff99f(0x108)](_0x141230[_0x3ff99f(0x10c)]);if(!_0x12d45b)throw CliErrors[_0x3ff99f(0xee)]('Runtime\x20Skill\x20package\x20is\x20missing\x20entry:\x20'+_0x141230['path']);if(_0x12d45b[_0x3ff99f(0x101)][_0x3ff99f(0xed)]!==_0x141230['size'])throw CliErrors[_0x3ff99f(0xee)](_0x3ff99f(0x100)+_0x141230[_0x3ff99f(0x10c)]);const _0x1e260a=bufferSha256(_0x12d45b['bytes']);if(_0x1e260a!==_0x141230[_0x3ff99f(0xfb)])throw CliErrors[_0x3ff99f(0xee)](_0x3ff99f(0x110)+_0x141230[_0x3ff99f(0x10c)]);_0x2e2f21[_0x3ff99f(0xfd)]({'path':_0x141230[_0x3ff99f(0x10c)],'bytes':_0x12d45b[_0x3ff99f(0x101)]});}return normalizeLocalFiles(_0x2e2f21);}
@@ -1 +1 @@
1
- (function(_0x4c9a7e,_0xa2462b){var _0x231ee4=a149_0x4268,_0x118cf4=_0x4c9a7e();while(!![]){try{var _0x428910=-parseInt(_0x231ee4(0xdf))/0x1+parseInt(_0x231ee4(0xe6))/0x2*(parseInt(_0x231ee4(0xe2))/0x3)+parseInt(_0x231ee4(0xe4))/0x4+parseInt(_0x231ee4(0xe3))/0x5*(-parseInt(_0x231ee4(0xe9))/0x6)+-parseInt(_0x231ee4(0xe7))/0x7+parseInt(_0x231ee4(0xe0))/0x8*(parseInt(_0x231ee4(0xe5))/0x9)+-parseInt(_0x231ee4(0xe1))/0xa*(-parseInt(_0x231ee4(0xe8))/0xb);if(_0x428910===_0xa2462b)break;else _0x118cf4['push'](_0x118cf4['shift']());}catch(_0x55d645){_0x118cf4['push'](_0x118cf4['shift']());}}}(a149_0x1f60,0x2ee87));export{contentHash,fileTreeHash}from'./runtime-skill-sync/hashing.js';export{linkEffectiveRuntimeSkills,linkGlobalRuntimeSkills,pruneStaleRuntimeSkillCache,pruneStaleRuntimeSkillLinks}from'./runtime-skill-sync/links.js';function a149_0x4268(_0x184e2c,_0x71fa64){_0x184e2c=_0x184e2c-0xdf;var _0x1f60fb=a149_0x1f60();var _0x4268c5=_0x1f60fb[_0x184e2c];return _0x4268c5;}export{resolveRuntimeSkillInstallTarget}from'./runtime-skill-sync/install-target.js';export{listLocalRuntimeSkills}from'./runtime-skill-sync/list-local.js';export{materializeRuntimeSkill,reuseMaterializedRuntimeSkill}from'./runtime-skill-sync/materialize.js';export{readMetadataIfPresent}from'./runtime-skill-sync/metadata.js';export{getRuntimeSkillCacheRoot,getRuntimeSkillDir,resolveSkillSyncPaths,runtimeAgentSkillRoots}from'./runtime-skill-sync/paths.js';export{deriveSkillCodeFromDirectory,readPushDirectory,refreshPushDirectoryMetadataFromRemote,recordPushedRuntimeSkill,resolvePushDirectoryIdentity}from'./runtime-skill-sync/push.js';export{buildSkillPackage,verifyRuntimeSkillBundle,verifyRuntimeSkillPackage}from'./runtime-skill-sync/zip-package.js';function a149_0x1f60(){var _0x2041f5=['4149oOuwHx','16hFWxpn','2016042MRxAOm','33fqQHjU','12imxlDk','86947ntSYuy','1528jkiFLX','752470kWepCo','109854BiQeBN','339695QqvpaI','384920KSIaBR'];a149_0x1f60=function(){return _0x2041f5;};return a149_0x1f60();}
1
+ (function(_0x43f887,_0x2ff5d5){var _0x1f4625=a149_0x418f,_0x42e790=_0x43f887();while(!![]){try{var _0x3994ce=parseInt(_0x1f4625(0x1e4))/0x1*(-parseInt(_0x1f4625(0x1e1))/0x2)+-parseInt(_0x1f4625(0x1da))/0x3*(parseInt(_0x1f4625(0x1dd))/0x4)+parseInt(_0x1f4625(0x1dc))/0x5*(-parseInt(_0x1f4625(0x1e3))/0x6)+parseInt(_0x1f4625(0x1e2))/0x7*(-parseInt(_0x1f4625(0x1d9))/0x8)+-parseInt(_0x1f4625(0x1df))/0x9*(parseInt(_0x1f4625(0x1db))/0xa)+-parseInt(_0x1f4625(0x1de))/0xb+parseInt(_0x1f4625(0x1e0))/0xc;if(_0x3994ce===_0x2ff5d5)break;else _0x42e790['push'](_0x42e790['shift']());}catch(_0x4dfb91){_0x42e790['push'](_0x42e790['shift']());}}}(a149_0x29d0,0x52d3a));function a149_0x29d0(){var _0x1aad24=['35873316rRAkvI','922PmACJo','63bedbQx','6EIWsAE','712DIWaXC','587864iOnofz','83958pJoYpj','2727100jebgaT','2278025mGODlr','40YNPqee','7176741DJDJoX','9GGPoRa'];a149_0x29d0=function(){return _0x1aad24;};return a149_0x29d0();}export{contentHash,fileTreeHash}from'./runtime-skill-sync/hashing.js';export{linkEffectiveRuntimeSkills,linkGlobalRuntimeSkills,pruneStaleRuntimeSkillCache,pruneStaleRuntimeSkillLinks}from'./runtime-skill-sync/links.js';export{resolveRuntimeSkillInstallTarget}from'./runtime-skill-sync/install-target.js';export{listLocalRuntimeSkills}from'./runtime-skill-sync/list-local.js';export{materializeRuntimeSkill,reuseMaterializedRuntimeSkill}from'./runtime-skill-sync/materialize.js';function a149_0x418f(_0x3af997,_0x52891c){_0x3af997=_0x3af997-0x1d9;var _0x29d071=a149_0x29d0();var _0x418f78=_0x29d071[_0x3af997];return _0x418f78;}export{readMetadataIfPresent}from'./runtime-skill-sync/metadata.js';export{getRuntimeSkillCacheRoot,getRuntimeSkillDir,resolveSkillSyncPaths,runtimeAgentSkillRoots}from'./runtime-skill-sync/paths.js';export{deriveSkillCodeFromDirectory,readPushDirectory,refreshPushDirectoryMetadataFromRemote,recordPushedRuntimeSkill,resolvePushDirectoryIdentity}from'./runtime-skill-sync/push.js';export{buildSkillPackage,verifyRuntimeSkillBundle,verifyRuntimeSkillPackage}from'./runtime-skill-sync/zip-package.js';