@lovrabet/lovrabet-cli 2.1.19 → 2.1.20-beta.1

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 (130) hide show
  1. package/lib/cli.js +1 -1
  2. package/lib/commands/api-doc/index.js +1 -1
  3. package/lib/commands/app/cache.js +1 -1
  4. package/lib/commands/app/definitions.js +1 -1
  5. package/lib/commands/app/eligibility.js +1 -1
  6. package/lib/commands/app/mock-loader.js +1 -1
  7. package/lib/commands/app/remote-source.js +1 -1
  8. package/lib/commands/app/shared.js +1 -1
  9. package/lib/commands/app-config/get.js +1 -1
  10. package/lib/commands/app-config/index.js +1 -1
  11. package/lib/commands/artifact/index.js +1 -1
  12. package/lib/commands/auth/device.js +1 -1
  13. package/lib/commands/auth/index.js +1 -1
  14. package/lib/commands/auth/prompt.js +1 -1
  15. package/lib/commands/bff/detail.js +1 -1
  16. package/lib/commands/bff/exec.js +1 -1
  17. package/lib/commands/bff/index.js +1 -1
  18. package/lib/commands/cli-skill/index.js +1 -1
  19. package/lib/commands/common/config-policy.js +1 -1
  20. package/lib/commands/common/constraints.js +1 -1
  21. package/lib/commands/common/flags.js +1 -1
  22. package/lib/commands/common/local-file.js +1 -1
  23. package/lib/commands/config/definitions.js +1 -1
  24. package/lib/commands/config/shared.js +1 -1
  25. package/lib/commands/data/index.js +1 -1
  26. package/lib/commands/dataset/detail.js +1 -1
  27. package/lib/commands/dataset/index.js +1 -1
  28. package/lib/commands/dataset/list.js +1 -1
  29. package/lib/commands/dataset/sdk-doc.js +1 -1
  30. package/lib/commands/doctor.js +1 -1
  31. package/lib/commands/file/index.js +1 -1
  32. package/lib/commands/init.js +1 -1
  33. package/lib/commands/kb/index.js +1 -1
  34. package/lib/commands/logs/index.js +1 -1
  35. package/lib/commands/ocr/index.js +1 -1
  36. package/lib/commands/personal-bff/index.js +1 -1
  37. package/lib/commands/registry.js +1 -1
  38. package/lib/commands/schedule/index.js +1 -1
  39. package/lib/commands/schema.js +1 -1
  40. package/lib/commands/service/dynamic.js +1 -1
  41. package/lib/commands/service/function-name-adapter.js +1 -1
  42. package/lib/commands/service/index.js +1 -1
  43. package/lib/commands/service/registry.js +1 -1
  44. package/lib/commands/skill/commands/create.js +1 -1
  45. package/lib/commands/skill/commands/install.js +1 -1
  46. package/lib/commands/skill/commands/list.js +1 -1
  47. package/lib/commands/skill/commands/push.js +1 -1
  48. package/lib/commands/skill/commands/validate.js +1 -1
  49. package/lib/commands/skill/flags.js +1 -1
  50. package/lib/commands/skill/index.js +1 -1
  51. package/lib/commands/skill/manifest-helpers.js +1 -1
  52. package/lib/commands/skill/push-execute.js +1 -1
  53. package/lib/commands/skill/push-flow-helpers.js +1 -1
  54. package/lib/commands/skill/push-retarget.js +1 -1
  55. package/lib/commands/skill/scopes.js +1 -1
  56. package/lib/commands/skill/summary.js +1 -1
  57. package/lib/commands/skill/templates.js +1 -1
  58. package/lib/commands/skill/validate.js +1 -1
  59. package/lib/commands/sql/detail.js +1 -1
  60. package/lib/commands/sql/exec.js +1 -1
  61. package/lib/commands/sql/index.js +1 -1
  62. package/lib/commands/update.js +1 -1
  63. package/lib/commands/workspace/index.js +1 -1
  64. package/lib/config/schema.js +1 -1
  65. package/lib/constant/app.js +1 -1
  66. package/lib/constant/auth-mode.js +1 -1
  67. package/lib/constant/cli.js +1 -1
  68. package/lib/constant/defaults.js +1 -1
  69. package/lib/constant/distribution.js +1 -1
  70. package/lib/constant/domain.js +1 -1
  71. package/lib/constant/env.js +1 -1
  72. package/lib/constant/output.js +1 -1
  73. package/lib/constant/product.js +1 -1
  74. package/lib/constant/risk.js +1 -1
  75. package/lib/constant/url.js +1 -1
  76. package/lib/context.js +1 -1
  77. package/lib/core/api-client.js +1 -1
  78. package/lib/core/db-resolver.js +1 -1
  79. package/lib/core/sdk-client.js +1 -1
  80. package/lib/errors.js +1 -1
  81. package/lib/framework/build-all-flags.js +1 -1
  82. package/lib/framework/dryrun.js +1 -1
  83. package/lib/framework/flags.js +1 -1
  84. package/lib/framework/help.js +1 -1
  85. package/lib/framework/index.js +1 -1
  86. package/lib/framework/output.js +1 -1
  87. package/lib/framework/preparse.d.ts +12 -0
  88. package/lib/framework/preparse.js +1 -1
  89. package/lib/framework/rate-limit.js +1 -1
  90. package/lib/framework/raw-flags.d.ts +12 -0
  91. package/lib/framework/raw-flags.js +1 -0
  92. package/lib/framework/response.js +1 -1
  93. package/lib/framework/runner-confirmation.js +1 -1
  94. package/lib/framework/runner-error.js +1 -1
  95. package/lib/framework/runner.js +1 -1
  96. package/lib/framework/schema-export.js +1 -1
  97. package/lib/framework/service-order.js +1 -1
  98. package/lib/framework/types.js +1 -1
  99. package/lib/generated/build-info.d.ts +4 -4
  100. package/lib/generated/build-info.js +1 -1
  101. package/lib/help.js +1 -1
  102. package/lib/runtime/event.js +1 -1
  103. package/lib/runtime/index.js +1 -1
  104. package/lib/runtime/queue.js +1 -1
  105. package/lib/runtime/resolve.js +1 -1
  106. package/lib/skills/npx-skills-add.js +1 -1
  107. package/lib/skills/runtime-skill-sync/constants.js +1 -1
  108. package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
  109. package/lib/skills/runtime-skill-sync/hashing.js +1 -1
  110. package/lib/skills/runtime-skill-sync/install-target.js +1 -1
  111. package/lib/skills/runtime-skill-sync/links.js +1 -1
  112. package/lib/skills/runtime-skill-sync/list-local.js +1 -1
  113. package/lib/skills/runtime-skill-sync/local-files.js +1 -1
  114. package/lib/skills/runtime-skill-sync/materialize.js +1 -1
  115. package/lib/skills/runtime-skill-sync/metadata.js +1 -1
  116. package/lib/skills/runtime-skill-sync/paths.js +1 -1
  117. package/lib/skills/runtime-skill-sync/push.js +1 -1
  118. package/lib/skills/runtime-skill-sync/scopes.js +1 -1
  119. package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
  120. package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
  121. package/lib/skills/runtime-skill-sync.js +1 -1
  122. package/lib/utils/apply-jq-filter.js +1 -1
  123. package/lib/utils/logger.js +1 -1
  124. package/lib/utils/lossless-json.js +1 -1
  125. package/lib/utils/params.js +1 -1
  126. package/lib/utils/platform.js +1 -1
  127. package/lib/utils/update-notice.js +1 -1
  128. package/lib/utils/version.js +1 -1
  129. package/lib/utils/write-cli-side-channel.js +1 -1
  130. package/package.json +1 -1
@@ -1 +1 @@
1
- const a102_0x319fbf=a102_0x18c1;(function(_0x1905b1,_0x45286){const _0x2ef90f=a102_0x18c1,_0x1f05d5=_0x1905b1();while(!![]){try{const _0x11b9ca=parseInt(_0x2ef90f(0x96))/0x1+parseInt(_0x2ef90f(0xa2))/0x2+-parseInt(_0x2ef90f(0x9b))/0x3+parseInt(_0x2ef90f(0x9d))/0x4*(-parseInt(_0x2ef90f(0x90))/0x5)+-parseInt(_0x2ef90f(0xa1))/0x6+-parseInt(_0x2ef90f(0x92))/0x7+parseInt(_0x2ef90f(0x9f))/0x8*(parseInt(_0x2ef90f(0x94))/0x9);if(_0x11b9ca===_0x45286)break;else _0x1f05d5['push'](_0x1f05d5['shift']());}catch(_0x580575){_0x1f05d5['push'](_0x1f05d5['shift']());}}}(a102_0x22a5,0xe1473));import{spawnSync}from'node:child_process';import{resolveNpmBin}from'../utils/platform.js';import{LOVRABET_SKILL_SOURCE as a102_0x15b679}from'../constant/distribution.js';function a102_0x22a5(){const _0x4edbb0=['422106erXiiw','3234050dJvSeI','status','skills','inherit','15SGNBPf','exit\x20','1240694ueZxHm','trim','36hDBwyh','skipNpxSkillsEnvSuffix','575804EwVOTg','pipe','stdout','stderr','stdio','4383564kdwziR','add','2220364BpGNGW','toString','4207928lGYVKp','unknown'];a102_0x22a5=function(){return _0x4edbb0;};return a102_0x22a5();}import{PRODUCT_CONFIG,productEnvName}from'../constant/product.js';function a102_0x18c1(_0x2646e8,_0xebc72e){_0x2646e8=_0x2646e8-0x8e;const _0x22a5a1=a102_0x22a5();let _0x18c1d6=_0x22a5a1[_0x2646e8];return _0x18c1d6;}export const LOVRABET_SKILL_SOURCE=a102_0x15b679;export const LOVRABET_SKIP_NPX_SKILLS_ENV=productEnvName(PRODUCT_CONFIG[a102_0x319fbf(0x95)]);export function shouldSkipNpxSkillsAdd(){return process.env[LOVRABET_SKIP_NPX_SKILLS_ENV]==='1';}export function runNpxSkillsAddGlobal(_0x38ea16,_0x31558a=LOVRABET_SKILL_SOURCE,_0x4611e9){const _0x1177cb=a102_0x319fbf;if(shouldSkipNpxSkillsAdd())return{'ok':!![],'status':0x0,'skipped':!![]};const _0x38b640=_0x4611e9?.[_0x1177cb(0x9a)]??_0x1177cb(0x8f),_0x234999=resolveNpmBin('npx'),_0x386c4d=[_0x1177cb(0x8e),_0x1177cb(0x9c),_0x31558a,'-g','-y'],_0x18b634=[_0x234999,..._0x386c4d]['join']('\x20');console['log']('*\x20'+_0x18b634);const _0x536251=spawnSync(_0x234999,_0x386c4d,{'cwd':_0x38ea16,'stdio':_0x38b640,'env':process.env,'shell':![]});if(_0x536251[_0x1177cb(0xa3)]===0x0)return{'ok':!![],'status':0x0};let _0x4f7161=_0x1177cb(0x91)+(_0x536251[_0x1177cb(0xa3)]??_0x1177cb(0xa0));if(_0x38b640===_0x1177cb(0x97)){const _0x53e186=_0x536251[_0x1177cb(0x99)]?_0x536251[_0x1177cb(0x99)]['toString']()[_0x1177cb(0x93)]():'',_0x5afb22=_0x536251[_0x1177cb(0x98)]?_0x536251[_0x1177cb(0x98)][_0x1177cb(0x9e)]()['trim']():'';if(_0x53e186)_0x4f7161=_0x53e186;else{if(_0x5afb22)_0x4f7161=_0x5afb22;}}return{'ok':![],'status':_0x536251[_0x1177cb(0xa3)]??null,'error':_0x4f7161};}
1
+ function a103_0x18cc(){const _0x58fce8=['4368696WpkNkv','toString','stderr','stdout','skills','add','status','npx','log','448pKYFtQ','3370840mxVxiW','565075ODhXqq','257535cYJVfO','1803594xbBoKg','3579296GFSZfp','11326mlfaDp','33XkDtMY','inherit','stdio','join','exit\x20','trim','skipNpxSkillsEnvSuffix','pipe'];a103_0x18cc=function(){return _0x58fce8;};return a103_0x18cc();}const a103_0x18850f=a103_0xb5c6;(function(_0x5c0c55,_0x192246){const _0x4aed5e=a103_0xb5c6,_0x8fbdbf=_0x5c0c55();while(!![]){try{const _0x186286=parseInt(_0x4aed5e(0x104))/0x1*(-parseInt(_0x4aed5e(0x103))/0x2)+-parseInt(_0x4aed5e(0x101))/0x3+parseInt(_0x4aed5e(0x116))/0x4+parseInt(_0x4aed5e(0xff))/0x5+-parseInt(_0x4aed5e(0x10c))/0x6+-parseInt(_0x4aed5e(0x102))/0x7+parseInt(_0x4aed5e(0x115))/0x8*(parseInt(_0x4aed5e(0x100))/0x9);if(_0x186286===_0x192246)break;else _0x8fbdbf['push'](_0x8fbdbf['shift']());}catch(_0x1b3efb){_0x8fbdbf['push'](_0x8fbdbf['shift']());}}}(a103_0x18cc,0x818d4));import{spawnSync}from'node:child_process';function a103_0xb5c6(_0x42d8e5,_0x176394){_0x42d8e5=_0x42d8e5-0xff;const _0x18cc18=a103_0x18cc();let _0xb5c6c1=_0x18cc18[_0x42d8e5];return _0xb5c6c1;}import{resolveNpmBin}from'../utils/platform.js';import{LOVRABET_SKILL_SOURCE as a103_0x12ed8f}from'../constant/distribution.js';import{PRODUCT_CONFIG,productEnvName}from'../constant/product.js';export const LOVRABET_SKILL_SOURCE=a103_0x12ed8f;export const LOVRABET_SKIP_NPX_SKILLS_ENV=productEnvName(PRODUCT_CONFIG[a103_0x18850f(0x10a)]);export function shouldSkipNpxSkillsAdd(){return process.env[LOVRABET_SKIP_NPX_SKILLS_ENV]==='1';}export function runNpxSkillsAddGlobal(_0x30da84,_0x27a1db=LOVRABET_SKILL_SOURCE,_0x43be5c){const _0x2a4ecb=a103_0x18850f;if(shouldSkipNpxSkillsAdd())return{'ok':!![],'status':0x0,'skipped':!![]};const _0x51523e=_0x43be5c?.[_0x2a4ecb(0x106)]??_0x2a4ecb(0x105),_0x1ac6a3=resolveNpmBin(_0x2a4ecb(0x113)),_0x432ac8=[_0x2a4ecb(0x110),_0x2a4ecb(0x111),_0x27a1db,'-g','-y'],_0x5ea8dd=[_0x1ac6a3,..._0x432ac8][_0x2a4ecb(0x107)]('\x20');console[_0x2a4ecb(0x114)]('*\x20'+_0x5ea8dd);const _0x5110b6=spawnSync(_0x1ac6a3,_0x432ac8,{'cwd':_0x30da84,'stdio':_0x51523e,'env':process.env,'shell':![]});if(_0x5110b6[_0x2a4ecb(0x112)]===0x0)return{'ok':!![],'status':0x0};let _0x2101f2=_0x2a4ecb(0x108)+(_0x5110b6['status']??'unknown');if(_0x51523e===_0x2a4ecb(0x10b)){const _0x34f909=_0x5110b6['stderr']?_0x5110b6[_0x2a4ecb(0x10e)]['toString']()[_0x2a4ecb(0x109)]():'',_0x27d283=_0x5110b6['stdout']?_0x5110b6[_0x2a4ecb(0x10f)][_0x2a4ecb(0x10d)]()[_0x2a4ecb(0x109)]():'';if(_0x34f909)_0x2101f2=_0x34f909;else{if(_0x27d283)_0x2101f2=_0x27d283;}}return{'ok':![],'status':_0x5110b6[_0x2a4ecb(0x112)]??null,'error':_0x2101f2};}
@@ -1 +1 @@
1
- const a103_0x5aa039=a103_0x31c9;(function(_0x34253d,_0x59404c){const _0xf7b168=a103_0x31c9,_0x4503dd=_0x34253d();while(!![]){try{const _0x3092d1=parseInt(_0xf7b168(0x205))/0x1+parseInt(_0xf7b168(0x1f3))/0x2*(-parseInt(_0xf7b168(0x1f4))/0x3)+-parseInt(_0xf7b168(0x1f8))/0x4+-parseInt(_0xf7b168(0x200))/0x5*(-parseInt(_0xf7b168(0x1fd))/0x6)+parseInt(_0xf7b168(0x1f7))/0x7*(parseInt(_0xf7b168(0x208))/0x8)+-parseInt(_0xf7b168(0x1f9))/0x9*(-parseInt(_0xf7b168(0x206))/0xa)+-parseInt(_0xf7b168(0x202))/0xb*(parseInt(_0xf7b168(0x1fb))/0xc);if(_0x3092d1===_0x59404c)break;else _0x4503dd['push'](_0x4503dd['shift']());}catch(_0x302b29){_0x4503dd['push'](_0x4503dd['shift']());}}}(a103_0xa2d3,0x95442));export const METADATA_FILE=a103_0x5aa039(0x1ff);function a103_0x31c9(_0xc85b6a,_0x508859){_0xc85b6a=_0xc85b6a-0x1f2;const _0xa2d3c8=a103_0xa2d3();let _0x31c97f=_0xa2d3c8[_0xc85b6a];return _0x31c97f;}export const SKILL_FILE=a103_0x5aa039(0x1f2);function a103_0xa2d3(){const _0x2c997b=['.cache','17412CwLClY','.DS_Store','lovrabet.skill.json','1090JkvyHo','coverage','143bOkmST','.turbo','dist','1109503yHQKGX','436120Ldbnci','.svn','1220088EkjBgg','SKILL.md','2ldccjp','986571kLqMGX','.hg','.git','35JgrjHy','4723240ubQgJC','126pEafBX','node_modules','917724vWVSVy'];a103_0xa2d3=function(){return _0x2c997b;};return a103_0xa2d3();}export const IGNORED_FILE_NAMES=new Set([METADATA_FILE,a103_0x5aa039(0x1fe)]);export const IGNORED_DIR_NAMES=new Set([a103_0x5aa039(0x1f6),a103_0x5aa039(0x1f5),a103_0x5aa039(0x207),a103_0x5aa039(0x1fa),'.next',a103_0x5aa039(0x204),'build',a103_0x5aa039(0x201),a103_0x5aa039(0x203),a103_0x5aa039(0x1fc)]);
1
+ const a104_0x510528=a104_0x4776;function a104_0x4776(_0x3e13c1,_0x4fda1c){_0x3e13c1=_0x3e13c1-0x122;const _0x8cc52a=a104_0x8cc5();let _0x477617=_0x8cc52a[_0x3e13c1];return _0x477617;}(function(_0x56ddfc,_0x5a4724){const _0x24e2d6=a104_0x4776,_0x4f7388=_0x56ddfc();while(!![]){try{const _0x4afd56=-parseInt(_0x24e2d6(0x124))/0x1+parseInt(_0x24e2d6(0x12c))/0x2*(-parseInt(_0x24e2d6(0x122))/0x3)+-parseInt(_0x24e2d6(0x127))/0x4+parseInt(_0x24e2d6(0x12f))/0x5+-parseInt(_0x24e2d6(0x125))/0x6*(parseInt(_0x24e2d6(0x135))/0x7)+-parseInt(_0x24e2d6(0x130))/0x8*(parseInt(_0x24e2d6(0x131))/0x9)+parseInt(_0x24e2d6(0x12d))/0xa;if(_0x4afd56===_0x5a4724)break;else _0x4f7388['push'](_0x4f7388['shift']());}catch(_0x53b0a8){_0x4f7388['push'](_0x4f7388['shift']());}}}(a104_0x8cc5,0x2d960));function a104_0x8cc5(){const _0x32f405=['.svn','23438uttMpy','9573080oWktlL','SKILL.md','1240215kaaXXp','578352BUbckj','36DoxVei','coverage','.turbo','.cache','91hitiZZ','93BKzNbM','.next','3811rpKSwC','73842PALXLM','lovrabet.skill.json','809456iKlafD','dist','.git','build'];a104_0x8cc5=function(){return _0x32f405;};return a104_0x8cc5();}export const METADATA_FILE=a104_0x510528(0x126);export const SKILL_FILE=a104_0x510528(0x12e);export const IGNORED_FILE_NAMES=new Set([METADATA_FILE,'.DS_Store']);export const IGNORED_DIR_NAMES=new Set([a104_0x510528(0x129),'.hg',a104_0x510528(0x12b),'node_modules',a104_0x510528(0x123),a104_0x510528(0x128),a104_0x510528(0x12a),a104_0x510528(0x132),a104_0x510528(0x133),a104_0x510528(0x134)]);
@@ -1 +1 @@
1
- function a104_0x5565(){const _0x2fb6d6=['159920ibpStk','utf8','31713nssWvw','startsWith','247499FjJtaO','122125bPUtpL','isSymbolicLink','validation','Refusing\x20to\x20write\x20through\x20Skill\x20symlink\x20path:\x20','99gehwwh','20pNSpEU','208epMsFg','split','254835pqvcBV','13fBGgWT','41184HqioYJ','.tmp','2ROwLgE','1134204SDadYf','30GQToFO','endsWith','Unsafe\x20Skill\x20file\x20path:\x20'];a104_0x5565=function(){return _0x2fb6d6;};return a104_0x5565();}(function(_0x35ab3a,_0x52b29d){const _0x2b0814=a104_0x5290,_0x3a021f=_0x35ab3a();while(!![]){try{const _0x196b9c=parseInt(_0x2b0814(0x84))/0x1*(parseInt(_0x2b0814(0x7d))/0x2)+-parseInt(_0x2b0814(0x79))/0x3+parseInt(_0x2b0814(0x8c))/0x4*(parseInt(_0x2b0814(0x87))/0x5)+-parseInt(_0x2b0814(0x7f))/0x6*(-parseInt(_0x2b0814(0x86))/0x7)+-parseInt(_0x2b0814(0x8d))/0x8*(-parseInt(_0x2b0814(0x7b))/0x9)+-parseInt(_0x2b0814(0x82))/0xa*(parseInt(_0x2b0814(0x8b))/0xb)+parseInt(_0x2b0814(0x7e))/0xc*(-parseInt(_0x2b0814(0x7a))/0xd);if(_0x196b9c===_0x52b29d)break;else _0x3a021f['push'](_0x3a021f['shift']());}catch(_0x1c1dcd){_0x3a021f['push'](_0x3a021f['shift']());}}}(a104_0x5565,0x1ed01));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';function a104_0x5290(_0x41c458,_0x5d71b0){_0x41c458=_0x41c458-0x79;const _0x556595=a104_0x5565();let _0x5290dc=_0x556595[_0x41c458];return _0x5290dc;}export function resolveManagedFilePath(_0x17548e,_0x1c99f6){const _0x4b9d4b=a104_0x5290,_0x39d5e8=normalizeSkillRelativePath(_0x1c99f6),_0x15bf0a=realOrResolved(_0x17548e),_0x2e646c=resolve(_0x15bf0a,..._0x39d5e8[_0x4b9d4b(0x8e)]('/'));if(!isPathInside(_0x2e646c,_0x15bf0a))throw CliErrors['validation'](_0x4b9d4b(0x81)+_0x1c99f6);return ensureNoSymlinkInManagedPath(_0x15bf0a,_0x39d5e8),_0x2e646c;}export function ensureNoSymlinkInManagedPath(_0x32b707,_0x37cf82){const _0x206a85=a104_0x5290;let _0x2fbbd3=_0x32b707;for(const _0x33b4b9 of _0x37cf82['split']('/')){_0x2fbbd3=resolve(_0x2fbbd3,_0x33b4b9);const _0x4e1dfe=lstatIfPresent(_0x2fbbd3);if(_0x4e1dfe?.[_0x206a85(0x88)]())throw CliErrors[_0x206a85(0x89)](_0x206a85(0x8a)+_0x37cf82);}}export function isDanglingSymlink(_0x2e0252){try{return lstatSync(_0x2e0252)['isSymbolicLink']();}catch{return![];}}export function resolveSymlinkTarget(_0x15e372){const _0x1ebbda=readlinkSync(_0x15e372);return isAbsolute(_0x1ebbda)?_0x1ebbda:resolve(dirname(_0x15e372),_0x1ebbda);}export function isPathInside(_0x47d987,_0x16fd40){const _0x5e408c=a104_0x5290,_0x25f7d9=_0x47d987[_0x5e408c(0x80)](sep)?_0x47d987:''+_0x47d987+sep,_0x2efdf8=_0x16fd40['endsWith'](sep)?_0x16fd40:''+_0x16fd40+sep;return _0x47d987===_0x16fd40||_0x25f7d9[_0x5e408c(0x85)](_0x2efdf8);}export function realOrResolved(_0x4fa507){try{return realpathSync(_0x4fa507);}catch{return resolve(_0x4fa507);}}export function lstatIfPresent(_0x989f5f){try{return lstatSync(_0x989f5f);}catch{return undefined;}}export function writeTextAtomic(_0x4949d7,_0x4181f1,_0x28f7fa){const _0xfd2d92=a104_0x5290;writeBytesAtomic(_0x4949d7,Buffer['from'](_0x4181f1,_0xfd2d92(0x83)),_0x28f7fa);}export function writeBytesAtomic(_0x100451,_0x1844fa,_0x4c2777){const _0x16d2f2=a104_0x5290,_0x5334c3=_0x100451+_0x16d2f2(0x7c);try{writeFileSync(_0x5334c3,_0x1844fa,{'mode':_0x4c2777}),renameSync(_0x5334c3,_0x100451);}catch(_0x225379){try{rmSync(_0x5334c3,{'force':!![]});}catch{}throw _0x225379;}}export function writeJsonAtomic(_0x5f3bac,_0x140f7d){writeTextAtomic(_0x5f3bac,JSON['stringify'](_0x140f7d,null,0x2)+'\x0a',0x180);}
1
+ (function(_0x1f37a6,_0x1b5316){const _0x2f90ad=a105_0x5d51,_0x2bdd51=_0x1f37a6();while(!![]){try{const _0x3a3d56=parseInt(_0x2f90ad(0x71))/0x1*(-parseInt(_0x2f90ad(0x72))/0x2)+-parseInt(_0x2f90ad(0x79))/0x3*(parseInt(_0x2f90ad(0x6b))/0x4)+-parseInt(_0x2f90ad(0x6e))/0x5+parseInt(_0x2f90ad(0x74))/0x6*(parseInt(_0x2f90ad(0x7c))/0x7)+-parseInt(_0x2f90ad(0x6c))/0x8+parseInt(_0x2f90ad(0x78))/0x9*(parseInt(_0x2f90ad(0x77))/0xa)+parseInt(_0x2f90ad(0x6d))/0xb;if(_0x3a3d56===_0x1b5316)break;else _0x2bdd51['push'](_0x2bdd51['shift']());}catch(_0x1c167e){_0x2bdd51['push'](_0x2bdd51['shift']());}}}(a105_0x4b24,0xb508d));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(_0x45a355,_0x5510e1){const _0x2e127b=a105_0x5d51,_0x21319d=normalizeSkillRelativePath(_0x5510e1),_0x3cf74e=realOrResolved(_0x45a355),_0x2a0556=resolve(_0x3cf74e,..._0x21319d[_0x2e127b(0x7b)]('/'));if(!isPathInside(_0x2a0556,_0x3cf74e))throw CliErrors['validation'](_0x2e127b(0x73)+_0x5510e1);return ensureNoSymlinkInManagedPath(_0x3cf74e,_0x21319d),_0x2a0556;}export function ensureNoSymlinkInManagedPath(_0x13b671,_0x5e1afb){const _0x219926=a105_0x5d51;let _0x441ce6=_0x13b671;for(const _0x1d5de6 of _0x5e1afb['split']('/')){_0x441ce6=resolve(_0x441ce6,_0x1d5de6);const _0x32c385=lstatIfPresent(_0x441ce6);if(_0x32c385?.[_0x219926(0x76)]())throw CliErrors[_0x219926(0x70)](_0x219926(0x69)+_0x5e1afb);}}function a105_0x4b24(){const _0x40f230=['from','validation','156sykrqb','14476KClHuB','Unsafe\x20Skill\x20file\x20path:\x20','103680YqZwKg','stringify','isSymbolicLink','160xLmZGP','42219efXtkH','3292449NJuWHE','utf8','split','336RtgqqJ','startsWith','.tmp','Refusing\x20to\x20write\x20through\x20Skill\x20symlink\x20path:\x20','endsWith','4ktKBvj','3573536zqchag','30525088yRAcIq','1323420KSKfUM'];a105_0x4b24=function(){return _0x40f230;};return a105_0x4b24();}export function isDanglingSymlink(_0x1edf3e){const _0xb10fd=a105_0x5d51;try{return lstatSync(_0x1edf3e)[_0xb10fd(0x76)]();}catch{return![];}}export function resolveSymlinkTarget(_0x524ad4){const _0x184ccb=readlinkSync(_0x524ad4);return isAbsolute(_0x184ccb)?_0x184ccb:resolve(dirname(_0x524ad4),_0x184ccb);}export function isPathInside(_0x2ce528,_0x248a9d){const _0x3da7b1=a105_0x5d51,_0xb1d376=_0x2ce528[_0x3da7b1(0x6a)](sep)?_0x2ce528:''+_0x2ce528+sep,_0x26cf26=_0x248a9d[_0x3da7b1(0x6a)](sep)?_0x248a9d:''+_0x248a9d+sep;return _0x2ce528===_0x248a9d||_0xb1d376[_0x3da7b1(0x7d)](_0x26cf26);}export function realOrResolved(_0x4b290d){try{return realpathSync(_0x4b290d);}catch{return resolve(_0x4b290d);}}export function lstatIfPresent(_0x3d8555){try{return lstatSync(_0x3d8555);}catch{return undefined;}}export function writeTextAtomic(_0xd41de,_0x4a22f0,_0x37dea2){const _0x12f057=a105_0x5d51;writeBytesAtomic(_0xd41de,Buffer[_0x12f057(0x6f)](_0x4a22f0,_0x12f057(0x7a)),_0x37dea2);}function a105_0x5d51(_0x20e03d,_0x468f3a){_0x20e03d=_0x20e03d-0x68;const _0x4b24cc=a105_0x4b24();let _0x5d5184=_0x4b24cc[_0x20e03d];return _0x5d5184;}export function writeBytesAtomic(_0xd92684,_0x360a71,_0x47370a){const _0x3b6773=a105_0x5d51,_0x45a59f=_0xd92684+_0x3b6773(0x68);try{writeFileSync(_0x45a59f,_0x360a71,{'mode':_0x47370a}),renameSync(_0x45a59f,_0xd92684);}catch(_0x4870a3){try{rmSync(_0x45a59f,{'force':!![]});}catch{}throw _0x4870a3;}}export function writeJsonAtomic(_0x391e72,_0x48329c){const _0xbdaafc=a105_0x5d51;writeTextAtomic(_0x391e72,JSON[_0xbdaafc(0x75)](_0x48329c,null,0x2)+'\x0a',0x180);}
@@ -1 +1 @@
1
- (function(_0xe06416,_0x463130){const _0x3aab31=a105_0x1428,_0x41da74=_0xe06416();while(!![]){try{const _0x49c476=-parseInt(_0x3aab31(0x1ec))/0x1*(parseInt(_0x3aab31(0x1e6))/0x2)+parseInt(_0x3aab31(0x1f1))/0x3+parseInt(_0x3aab31(0x1ea))/0x4+-parseInt(_0x3aab31(0x1e8))/0x5+-parseInt(_0x3aab31(0x1ee))/0x6+parseInt(_0x3aab31(0x1e9))/0x7+parseInt(_0x3aab31(0x1f0))/0x8*(-parseInt(_0x3aab31(0x1f2))/0x9);if(_0x49c476===_0x463130)break;else _0x41da74['push'](_0x41da74['shift']());}catch(_0x461f07){_0x41da74['push'](_0x41da74['shift']());}}}(a105_0x5a14,0x4db80));function a105_0x5a14(){const _0xf1415e=['digest','2cWKubU','path','66318cevvEy','update','8qMQXKx','717963WsdUAl','4071735DKBCiQ','hex','sha256','82778blzkdU','size','2394520zdtlDp','4384002ADfbLf','1911516jnImKB'];a105_0x5a14=function(){return _0xf1415e;};return a105_0x5a14();}function a105_0x1428(_0x160845,_0x34dd6a){_0x160845=_0x160845-0x1e5;const _0x5a1404=a105_0x5a14();let _0x1428dc=_0x5a1404[_0x160845];return _0x1428dc;}import{createHash}from'node:crypto';import{fileContent,normalizeManifestFiles}from'./local-files.js';export function contentHash(_0x230989){const _0x33cfca=a105_0x1428;return createHash('sha256')[_0x33cfca(0x1ef)](_0x230989)[_0x33cfca(0x1eb)](_0x33cfca(0x1f3));}export function fileHash(_0x5dfbff){return bufferSha256(fileContent(_0x5dfbff));}export function bufferSha256(_0x3c874c){const _0x1a5b5=a105_0x1428;return createHash(_0x1a5b5(0x1e5))[_0x1a5b5(0x1ef)](_0x3c874c)['digest']('hex');}export function fileTreeHash(_0x599674){const _0x5a0912=a105_0x1428,_0x501c52=createHash(_0x5a0912(0x1e5));for(const _0x86185d of normalizeManifestFiles(_0x599674)){_0x501c52[_0x5a0912(0x1ef)](_0x86185d[_0x5a0912(0x1ed)]),_0x501c52[_0x5a0912(0x1ef)]('\x00'),_0x501c52[_0x5a0912(0x1ef)](_0x86185d[_0x5a0912(0x1e5)]),_0x501c52['update']('\x00'),_0x501c52[_0x5a0912(0x1ef)](String(_0x86185d[_0x5a0912(0x1e7)])),_0x501c52[_0x5a0912(0x1ef)]('\x00');}return _0x501c52[_0x5a0912(0x1eb)](_0x5a0912(0x1f3));}
1
+ (function(_0x3a0958,_0x224df7){const _0x5d8b7a=a106_0x4bcd,_0x520ef7=_0x3a0958();while(!![]){try{const _0x47b8bf=parseInt(_0x5d8b7a(0x1cb))/0x1+parseInt(_0x5d8b7a(0x1ca))/0x2+parseInt(_0x5d8b7a(0x1ce))/0x3+-parseInt(_0x5d8b7a(0x1cd))/0x4+parseInt(_0x5d8b7a(0x1c9))/0x5*(-parseInt(_0x5d8b7a(0x1d0))/0x6)+-parseInt(_0x5d8b7a(0x1d3))/0x7*(parseInt(_0x5d8b7a(0x1cf))/0x8)+parseInt(_0x5d8b7a(0x1d1))/0x9;if(_0x47b8bf===_0x224df7)break;else _0x520ef7['push'](_0x520ef7['shift']());}catch(_0x44dd49){_0x520ef7['push'](_0x520ef7['shift']());}}}(a106_0x56fd,0x53683));import{createHash}from'node:crypto';import{fileContent,normalizeManifestFiles}from'./local-files.js';export function contentHash(_0x7d16be){const _0x1c6764=a106_0x4bcd;return createHash('sha256')[_0x1c6764(0x1d4)](_0x7d16be)['digest'](_0x1c6764(0x1d6));}export function fileHash(_0x2b68b6){return bufferSha256(fileContent(_0x2b68b6));}function a106_0x56fd(){const _0x139af5=['2465020IRDcGi','1586079EQzZYY','8FaBhZx','1810326OJgWfF','7560396rvJjQF','digest','128863LicWjP','update','size','hex','path','10dpIxHr','195622erCAXy','113193kIEiNx','sha256'];a106_0x56fd=function(){return _0x139af5;};return a106_0x56fd();}export function bufferSha256(_0xf9d07b){const _0x15bb8e=a106_0x4bcd;return createHash(_0x15bb8e(0x1cc))['update'](_0xf9d07b)['digest']('hex');}function a106_0x4bcd(_0x18ddd2,_0x5a561a){_0x18ddd2=_0x18ddd2-0x1c9;const _0x56fdf0=a106_0x56fd();let _0x4bcd60=_0x56fdf0[_0x18ddd2];return _0x4bcd60;}export function fileTreeHash(_0x2fc50f){const _0x5af922=a106_0x4bcd,_0x5b7c54=createHash(_0x5af922(0x1cc));for(const _0x23fd8e of normalizeManifestFiles(_0x2fc50f)){_0x5b7c54[_0x5af922(0x1d4)](_0x23fd8e[_0x5af922(0x1d7)]),_0x5b7c54[_0x5af922(0x1d4)]('\x00'),_0x5b7c54[_0x5af922(0x1d4)](_0x23fd8e[_0x5af922(0x1cc)]),_0x5b7c54[_0x5af922(0x1d4)]('\x00'),_0x5b7c54[_0x5af922(0x1d4)](String(_0x23fd8e[_0x5af922(0x1d5)])),_0x5b7c54[_0x5af922(0x1d4)]('\x00');}return _0x5b7c54[_0x5af922(0x1d2)](_0x5af922(0x1d6));}
@@ -1 +1 @@
1
- const a106_0x5b9259=a106_0x15c8;function a106_0x3a23(){const _0x4be16c=['409299JMuvGd','project','1417752AukEtC','.agents','514325fnaHrB','468612HRAAFI','freeze','39243gzMTfl','cwd','managedRoot','appCode','global','1235740dZTkGh','192626gGLguz'];a106_0x3a23=function(){return _0x4be16c;};return a106_0x3a23();}function a106_0x15c8(_0x440641,_0x28cae2){_0x440641=_0x440641-0x1da;const _0x3a232f=a106_0x3a23();let _0x15c8f2=_0x3a232f[_0x440641];return _0x15c8f2;}(function(_0x1c5c9c,_0x11ec30){const _0x4e1727=a106_0x15c8,_0x57d3af=_0x1c5c9c();while(!![]){try{const _0x225b72=-parseInt(_0x4e1727(0x1e6))/0x1+parseInt(_0x4e1727(0x1e5))/0x2+parseInt(_0x4e1727(0x1df))/0x3+parseInt(_0x4e1727(0x1dd))/0x4+parseInt(_0x4e1727(0x1e4))/0x5+parseInt(_0x4e1727(0x1da))/0x6+-parseInt(_0x4e1727(0x1dc))/0x7;if(_0x225b72===_0x11ec30)break;else _0x57d3af['push'](_0x57d3af['shift']());}catch(_0x59c1d5){_0x57d3af['push'](_0x57d3af['shift']());}}}(a106_0x3a23,0x3778d));import{resolve}from'node:path';import{resolveSkillSyncPaths,runtimeAgentSkillRoots,safePathSegment}from'./paths.js';export function resolveRuntimeSkillInstallTarget(_0x50c97b,_0x4b2db0=a106_0x5b9259(0x1e3),_0x23d834={}){const _0x139e74=a106_0x5b9259,_0x712609=resolveSkillSyncPaths(_0x23d834),_0x27aff7=safePathSegment(_0x50c97b,_0x139e74(0x1e2)),_0x51e173=_0x4b2db0===_0x139e74(0x1e7)?[resolve(_0x23d834[_0x139e74(0x1e0)]??process[_0x139e74(0x1e0)](),_0x139e74(0x1db),'skills')]:runtimeAgentSkillRoots(_0x712609);return Object['freeze']({'scope':_0x4b2db0,'appCode':_0x27aff7,'skillRoots':Object[_0x139e74(0x1de)](_0x51e173),'managedRoot':_0x712609[_0x139e74(0x1e1)]});}
1
+ function a107_0xc6f0(){const _0x296fac=['203uClqZr','5JmNMbD','71144UfyGAS','.agents','21918348faBDuw','919222nUYfwO','managedRoot','2778196YLKkeQ','10FJvDpv','skills','1529568UnPdmk','1714074qenUmt','5897718UtNdCp','cwd','freeze'];a107_0xc6f0=function(){return _0x296fac;};return a107_0xc6f0();}(function(_0x450601,_0x1a1a78){const _0xfccb2c=a107_0x52b2,_0x4c3625=_0x450601();while(!![]){try{const _0x1590fb=parseInt(_0xfccb2c(0x1e5))/0x1+-parseInt(_0xfccb2c(0x1dc))/0x2+-parseInt(_0xfccb2c(0x1db))/0x3+-parseInt(_0xfccb2c(0x1e7))/0x4*(parseInt(_0xfccb2c(0x1e1))/0x5)+-parseInt(_0xfccb2c(0x1dd))/0x6+-parseInt(_0xfccb2c(0x1e0))/0x7*(-parseInt(_0xfccb2c(0x1e2))/0x8)+parseInt(_0xfccb2c(0x1e4))/0x9*(parseInt(_0xfccb2c(0x1d9))/0xa);if(_0x1590fb===_0x1a1a78)break;else _0x4c3625['push'](_0x4c3625['shift']());}catch(_0x2a8648){_0x4c3625['push'](_0x4c3625['shift']());}}}(a107_0xc6f0,0x8ab20));import{resolve}from'node:path';function a107_0x52b2(_0x1fd6f9,_0x3301dd){_0x1fd6f9=_0x1fd6f9-0x1d9;const _0xc6f0b1=a107_0xc6f0();let _0x52b209=_0xc6f0b1[_0x1fd6f9];return _0x52b209;}import{resolveSkillSyncPaths,runtimeAgentSkillRoots,safePathSegment}from'./paths.js';export function resolveRuntimeSkillInstallTarget(_0x5c0993,_0x5507f7='global',_0x3f2ab2={}){const _0xfb69ae=a107_0x52b2,_0x2dbdfd=resolveSkillSyncPaths(_0x3f2ab2),_0x10a826=safePathSegment(_0x5c0993,'appCode'),_0x32c1bd=_0x5507f7==='project'?[resolve(_0x3f2ab2['cwd']??process[_0xfb69ae(0x1de)](),_0xfb69ae(0x1e3),_0xfb69ae(0x1da))]:runtimeAgentSkillRoots(_0x2dbdfd);return Object['freeze']({'scope':_0x5507f7,'appCode':_0x10a826,'skillRoots':Object[_0xfb69ae(0x1df)](_0x32c1bd),'managedRoot':_0x2dbdfd[_0xfb69ae(0x1e6)]});}
@@ -1 +1 @@
1
- function a107_0x51e5(){const _0x164494=['1287552yxZsGB','scope','created','Refusing\x20to\x20copy\x20Skill\x20symlink:\x20','push','metadataPath','personal','7037120SiWTLt','isSymbolicLink','filter','removed','protectedLinkRoots','Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20','external-symlink','dir','managedRoot','1467131UztNeq','Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20','validation','runtime-observe','pruneSkillCodes','9485848kVIMTd','skillCode','linked-from-protected-root','values','1481586zppgBh','set','skillRoots','length','unchanged','map','project','skipped','accessKey','company','169443LnsnmI','name','12gsMmUL','isDirectory','Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20','contentHash','secret-retriever','updated','1470904dkIOiJ','skill','not-managed-symlink','appCode','trim','activeSkillCodes','scopes','Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20','10nJXTXh','has','agentsSkillsDir','get','Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20','7ZWqrKz','metadata-mismatch'];a107_0x51e5=function(){return _0x164494;};return a107_0x51e5();}const a107_0x1d0440=a107_0xb6b3;(function(_0x26efaf,_0x1e22a6){const _0x59476f=a107_0xb6b3,_0x3097ba=_0x26efaf();while(!![]){try{const _0x34a6f7=-parseInt(_0x59476f(0xdd))/0x1+parseInt(_0x59476f(0xbd))/0x2+parseInt(_0x59476f(0xe6))/0x3*(parseInt(_0x59476f(0xf2))/0x4)+-parseInt(_0x59476f(0xd4))/0x5+parseInt(_0x59476f(0xcd))/0x6+parseInt(_0x59476f(0xcb))/0x7*(parseInt(_0x59476f(0xe2))/0x8)+parseInt(_0x59476f(0xf0))/0x9*(parseInt(_0x59476f(0xc6))/0xa);if(_0x34a6f7===_0x1e22a6)break;else _0x3097ba['push'](_0x3097ba['shift']());}catch(_0x574c8f){_0x3097ba['push'](_0x3097ba['shift']());}}}(a107_0x51e5,0xb9f21));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import a107_0x11ae38 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}=a107_0x11ae38,RESERVED_PROJECT_SKILL_CODES=new Set(['lovrabet',a107_0x1d0440(0xe0),a107_0x1d0440(0xbb)]);function a107_0xb6b3(_0x197015,_0x61266c){_0x197015=_0x197015-0xb8;const _0x51e50d=a107_0x51e5();let _0xb6b3c1=_0x51e50d[_0x197015];return _0xb6b3c1;}export function linkEffectiveRuntimeSkills(_0x54e2f6,_0x4decfe){const _0x3787c4=a107_0x1d0440,_0x309e2f=new Map();for(const _0xfb0103 of _0x54e2f6){const _0x4727b6=_0xfb0103['skill'][_0x3787c4(0xe3)];if(!_0x4727b6)continue;const _0x611f82=_0x309e2f[_0x3787c4(0xc9)](_0x4727b6);(!_0x611f82||_0xfb0103[_0x3787c4(0xce)]==='personal')&&_0x309e2f[_0x3787c4(0xe7)](_0x4727b6,_0xfb0103);}const _0x4dfe0d=[];for(const _0x427aaf of _0x309e2f[_0x3787c4(0xe5)]()){const _0x19b151=requireSkillCode(_0x427aaf['skill']),_0x2c018b=readMetadataIfPresent(_0x427aaf[_0x3787c4(0xd2)]);if(_0x2c018b?.[_0x3787c4(0xc0)]!==_0x4decfe[_0x3787c4(0xc0)]||_0x2c018b[_0x3787c4(0xe3)]!==_0x19b151)throw CliErrors['validation']('Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20'+_0x4decfe[_0x3787c4(0xc0)]+':\x20'+_0x427aaf[_0x3787c4(0xd2)]);const _0x2ae942=runtimeSkillLinkName(_0x4decfe,_0x19b151);for(const _0x432dd1 of _0x4decfe[_0x3787c4(0xe8)]){_0x4dfe0d['push'](ensureManagedSymlink(resolve(_0x432dd1,_0x2ae942),_0x427aaf[_0x3787c4(0xdb)],_0x4decfe,_0x19b151));}}return _0x4dfe0d;}export function pruneStaleRuntimeSkillLinks(_0x111eca,_0x1c2d38,_0x3c0bf7){const _0x3e91cb=a107_0x1d0440,_0x301dbd=new Set([..._0x1c2d38][_0x3e91cb(0xeb)](_0x9391d7=>_0x9391d7[_0x3e91cb(0xc1)]())[_0x3e91cb(0xd6)](Boolean)),_0x562996=_0x3c0bf7?new Set([..._0x3c0bf7][_0x3e91cb(0xeb)](_0x331f6b=>_0x331f6b[_0x3e91cb(0xc1)]())[_0x3e91cb(0xd6)](Boolean)):undefined,_0x44bf54=[];for(const _0x3dd796 of _0x111eca[_0x3e91cb(0xe8)]){for(const _0x24d397 of managedTargetSkillLinkPaths(_0x3dd796,_0x111eca)){const _0x2abb8d=runtimeSkillCodeFromLink(_0x111eca,_0x24d397);if(_0x562996&&!_0x562996['has'](_0x2abb8d))continue;if(_0x301dbd[_0x3e91cb(0xc7)](_0x2abb8d))continue;_0x44bf54[_0x3e91cb(0xd1)](removeManagedSkillLink(_0x24d397,_0x111eca,_0x2abb8d));}}return _0x44bf54;}export function pruneStaleRuntimeSkillCache(_0x23225d,_0x17164d={}){const _0x3c3735=a107_0x1d0440,_0xa96b2f=new Set([..._0x23225d[_0x3c3735(0xc2)]][_0x3c3735(0xeb)](_0x4e04cc=>_0x4e04cc[_0x3c3735(0xc1)]())[_0x3c3735(0xd6)](Boolean)),_0x37e46e=_0x23225d[_0x3c3735(0xe1)]?new Set([..._0x23225d[_0x3c3735(0xe1)]][_0x3c3735(0xeb)](_0x8ad4bc=>_0x8ad4bc[_0x3c3735(0xc1)]())[_0x3c3735(0xd6)](Boolean)):undefined,_0x41348c=_0x23225d[_0x3c3735(0xc3)]??[_0x3c3735(0xd3),_0x3c3735(0xef)],_0x2b087e=resolve(getRuntimeSkillCacheRoot(_0x23225d['env'],_0x23225d[_0x3c3735(0xee)],_0x17164d),safePathSegment(_0x23225d[_0x3c3735(0xc0)],_0x3c3735(0xc0))),_0x253acd=[];for(const _0x2f9204 of _0x41348c){const _0xc15d97=resolve(_0x2b087e,_0x2f9204);if(!existsSync(_0xc15d97))continue;for(const _0x556216 of readdirSync(_0xc15d97,{'withFileTypes':!![]})){if(!_0x556216[_0x3c3735(0xb8)]())continue;const _0x98b29b=_0x556216[_0x3c3735(0xf1)];if(_0x37e46e&&!_0x37e46e['has'](_0x98b29b))continue;if(_0xa96b2f['has'](_0x98b29b))continue;const _0x5686ea=resolve(_0xc15d97,_0x98b29b),_0x521d7d=readMetadataIfPresent(resolve(_0x5686ea,METADATA_FILE));if(_0x521d7d?.[_0x3c3735(0xc0)]!==_0x23225d[_0x3c3735(0xc0)]||_0x521d7d[_0x3c3735(0xce)]!==_0x2f9204||_0x521d7d[_0x3c3735(0xe3)]!==_0x98b29b){_0x253acd[_0x3c3735(0xd1)]({'path':_0x5686ea,'action':_0x3c3735(0xed),'reason':_0x3c3735(0xcc)});continue;}if(isLinkedFromAnyRoot(_0x5686ea,_0x23225d[_0x3c3735(0xd8)]??[])){_0x253acd['push']({'path':_0x5686ea,'action':_0x3c3735(0xed),'reason':_0x3c3735(0xe4)});continue;}removeSync(_0x5686ea),_0x253acd['push']({'path':_0x5686ea,'action':_0x3c3735(0xd7)});}}return _0x253acd;}export function linkGlobalRuntimeSkills(_0xa688b7,_0x48b02e={}){const _0x40ea4d=a107_0x1d0440,_0x3f7ce0=resolveSkillSyncPaths(_0x48b02e),_0x5c45c5=[];for(const _0x2ac56d of _0xa688b7){if(_0x2ac56d['scope']!=='builtin')throw CliErrors['validation']('Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20'+_0x2ac56d[_0x40ea4d(0xce)]);const _0x2efb94=requireSkillCode(_0x2ac56d[_0x40ea4d(0xbe)]),_0x150cbc=copyManagedSkillDirectory(_0x2ac56d[_0x40ea4d(0xdb)],resolve(_0x3f7ce0[_0x40ea4d(0xc8)],_0x2efb94));_0x5c45c5[_0x40ea4d(0xd1)]({..._0x150cbc,'contentHash':_0x2ac56d[_0x40ea4d(0xba)]});}return _0x5c45c5;}function ensureManagedSymlink(_0x3dfca6,_0xb3fed6,_0x323e05,_0x7fd6d9){const _0x38b842=a107_0x1d0440;mkdirSync(dirname(_0x3dfca6),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x3dfca6)||isDanglingSymlink(_0x3dfca6)){const _0x1e6a68=lstatSync(_0x3dfca6);if(!_0x1e6a68[_0x38b842(0xd5)]())throw CliErrors[_0x38b842(0xdf)](_0x38b842(0xb9)+_0x3dfca6);const _0x51bcf3=resolveSymlinkTarget(_0x3dfca6);if(!isPathInside(realOrResolved(_0x51bcf3),realOrResolved(_0x323e05[_0x38b842(0xdc)])))throw CliErrors[_0x38b842(0xdf)](_0x38b842(0xc4)+_0x3dfca6);if(realOrResolved(_0x51bcf3)===realOrResolved(_0xb3fed6))return{'path':_0x3dfca6,'target':_0xb3fed6,'action':_0x38b842(0xea)};const _0x1cb6e9=readMetadataIfPresent(resolve(_0x51bcf3,METADATA_FILE));if(_0x323e05[_0x38b842(0xce)]==='project'&&(_0x1cb6e9?.['appCode']!==_0x323e05[_0x38b842(0xc0)]||_0x1cb6e9[_0x38b842(0xe3)]!==_0x7fd6d9))throw CliErrors[_0x38b842(0xdf)](_0x38b842(0xca)+_0x3dfca6);return unlinkSync(_0x3dfca6),symlinkSync(_0xb3fed6,_0x3dfca6,_0x38b842(0xdb)),{'path':_0x3dfca6,'target':_0xb3fed6,'action':_0x38b842(0xbc)};}return symlinkSync(_0xb3fed6,_0x3dfca6,'dir'),{'path':_0x3dfca6,'target':_0xb3fed6,'action':_0x38b842(0xcf)};}function managedTargetSkillLinkPaths(_0x363975,_0x56176f){const _0x6584e6=a107_0x1d0440;if(!existsSync(_0x363975))return[];const _0x5b9140=_0x56176f[_0x6584e6(0xc0)]+'--';return readdirSync(_0x363975,{'withFileTypes':!![]})[_0x6584e6(0xd6)](_0x48f46e=>_0x56176f[_0x6584e6(0xce)]==='project'||_0x48f46e['name']['startsWith'](_0x5b9140))[_0x6584e6(0xeb)](_0x28e5a6=>resolve(_0x363975,_0x28e5a6[_0x6584e6(0xf1)]));}function removeManagedSkillLink(_0x43be73,_0x46acb0,_0x588715){const _0x225ff7=a107_0x1d0440,_0x4f0757=lstatIfPresent(_0x43be73);if(!_0x4f0757?.['isSymbolicLink']())return{'path':_0x43be73,'action':_0x225ff7(0xed),'reason':_0x225ff7(0xbf)};const _0x3c6a9f=resolveSymlinkTarget(_0x43be73);if(!isPathInside(realOrResolved(_0x3c6a9f),realOrResolved(_0x46acb0['managedRoot'])))return{'path':_0x43be73,'action':_0x225ff7(0xed),'reason':_0x225ff7(0xda)};const _0x51f5fc=readMetadataIfPresent(resolve(_0x3c6a9f,METADATA_FILE));if(_0x46acb0[_0x225ff7(0xce)]===_0x225ff7(0xec)&&(_0x51f5fc?.[_0x225ff7(0xc0)]!==_0x46acb0[_0x225ff7(0xc0)]||_0x51f5fc[_0x225ff7(0xe3)]!==_0x588715))return{'path':_0x43be73,'action':'skipped','reason':_0x225ff7(0xcc)};return unlinkSync(_0x43be73),{'path':_0x43be73,'action':_0x225ff7(0xd7)};}function isLinkedFromAnyRoot(_0x2ff753,_0x3c6af1){const _0xcf13dd=a107_0x1d0440,_0xd16d2=realOrResolved(_0x2ff753);for(const _0x25688d of _0x3c6af1){if(!existsSync(_0x25688d))continue;for(const _0x310712 of readdirSync(_0x25688d,{'withFileTypes':!![]})){if(!_0x310712[_0xcf13dd(0xd5)]())continue;const _0x373596=resolve(_0x25688d,_0x310712[_0xcf13dd(0xf1)]);if(realOrResolved(resolveSymlinkTarget(_0x373596))===_0xd16d2)return!![];}}return![];}function runtimeSkillLinkName(_0x53f45d,_0x92b2f1){const _0x3d4ed3=a107_0x1d0440,_0x22f928=safePathSegment(_0x92b2f1,_0x3d4ed3(0xe3));if(_0x53f45d['scope']===_0x3d4ed3(0xec)&&RESERVED_PROJECT_SKILL_CODES[_0x3d4ed3(0xc7)](_0x22f928))throw CliErrors[_0x3d4ed3(0xdf)](_0x3d4ed3(0xd9)+_0x22f928);return _0x53f45d[_0x3d4ed3(0xce)]===_0x3d4ed3(0xec)?_0x22f928:_0x53f45d[_0x3d4ed3(0xc0)]+'--'+_0x22f928;}function runtimeSkillCodeFromLink(_0x41f99b,_0x7841f8){const _0x5f12d3=a107_0x1d0440,_0x2ae934=basename(_0x7841f8);return _0x41f99b[_0x5f12d3(0xce)]===_0x5f12d3(0xec)?_0x2ae934:_0x2ae934['slice']((_0x41f99b[_0x5f12d3(0xc0)]+'--')[_0x5f12d3(0xe9)]);}export function copyManagedSkillDirectory(_0xa30071,_0x5c02c3){const _0x5889e5=a107_0x1d0440,_0x5623ed=resolve(_0x5c02c3,METADATA_FILE),_0x25d989=existsSync(_0x5c02c3);if(_0x25d989){const _0x4b8c5e=lstatSync(_0x5c02c3);if(_0x4b8c5e['isSymbolicLink']())throw CliErrors[_0x5889e5(0xdf)]('Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20'+_0x5c02c3);if(!_0x4b8c5e[_0x5889e5(0xb8)]())throw CliErrors[_0x5889e5(0xdf)](_0x5889e5(0xde)+_0x5c02c3);const _0x2bf6a4=readMetadataIfPresent(_0x5623ed);if(_0x2bf6a4?.[_0x5889e5(0xce)]!=='builtin')throw CliErrors[_0x5889e5(0xdf)](_0x5889e5(0xc5)+_0x5c02c3);}ensureDirSync(dirname(_0x5c02c3));const _0x1b7dde=_0x25d989?readMetadataIfPresent(_0x5623ed)?.[_0x5889e5(0xba)]:undefined,_0x25cab3=readMetadataIfPresent(resolve(_0xa30071,METADATA_FILE))?.[_0x5889e5(0xba)];return _0x25d989&&removeSync(_0x5c02c3),copySkillDirectory(_0xa30071,_0x5c02c3),{'path':_0x5c02c3,'target':_0xa30071,'action':!_0x25d989?_0x5889e5(0xcf):_0x1b7dde===_0x25cab3?'unchanged':_0x5889e5(0xbc)};}function copySkillDirectory(_0x100cc3,_0x577bf1){copySync(_0x100cc3,_0x577bf1,{'dereference':![],'overwrite':!![],'filter'(_0x2adfbe){const _0x3f7ec1=a107_0xb6b3;if(lstatSync(_0x2adfbe)['isSymbolicLink']())throw CliErrors[_0x3f7ec1(0xdf)](_0x3f7ec1(0xd0)+_0x2adfbe);return!![];}});}
1
+ const a108_0x53edfb=a108_0x5f0b;(function(_0x8eea2f,_0x35b689){const _0x27906e=a108_0x5f0b,_0xf98850=_0x8eea2f();while(!![]){try{const _0x43dde9=parseInt(_0x27906e(0x1f9))/0x1*(parseInt(_0x27906e(0x205))/0x2)+-parseInt(_0x27906e(0x215))/0x3+-parseInt(_0x27906e(0x1ef))/0x4*(-parseInt(_0x27906e(0x210))/0x5)+-parseInt(_0x27906e(0x20a))/0x6*(parseInt(_0x27906e(0x1ec))/0x7)+parseInt(_0x27906e(0x1f1))/0x8*(parseInt(_0x27906e(0x20c))/0x9)+parseInt(_0x27906e(0x1ee))/0xa*(parseInt(_0x27906e(0x208))/0xb)+parseInt(_0x27906e(0x211))/0xc*(-parseInt(_0x27906e(0x204))/0xd);if(_0x43dde9===_0x35b689)break;else _0xf98850['push'](_0xf98850['shift']());}catch(_0x225201){_0xf98850['push'](_0xf98850['shift']());}}}(a108_0x4ec9,0xbb82d));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import a108_0x2f4b08 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}=a108_0x2f4b08,RESERVED_PROJECT_SKILL_CODES=new Set([a108_0x53edfb(0x1e7),'runtime-observe',a108_0x53edfb(0x1f4)]);export function linkEffectiveRuntimeSkills(_0x3aeff7,_0x76f2a5){const _0x519786=a108_0x53edfb,_0xab9e19=new Map();for(const _0x4c0b0d of _0x3aeff7){const _0x5cc369=_0x4c0b0d[_0x519786(0x200)][_0x519786(0x1ea)];if(!_0x5cc369)continue;const _0x3d9ccf=_0xab9e19[_0x519786(0x212)](_0x5cc369);(!_0x3d9ccf||_0x4c0b0d[_0x519786(0x21c)]==='personal')&&_0xab9e19['set'](_0x5cc369,_0x4c0b0d);}const _0x2ea4ae=[];for(const _0x2fa38f of _0xab9e19[_0x519786(0x220)]()){const _0x4bfb6a=requireSkillCode(_0x2fa38f[_0x519786(0x200)]),_0x1b7c12=readMetadataIfPresent(_0x2fa38f['metadataPath']);if(_0x1b7c12?.[_0x519786(0x1ed)]!==_0x76f2a5[_0x519786(0x1ed)]||_0x1b7c12['skillCode']!==_0x4bfb6a)throw CliErrors[_0x519786(0x1f3)](_0x519786(0x21b)+_0x76f2a5[_0x519786(0x1ed)]+':\x20'+_0x2fa38f[_0x519786(0x1f8)]);const _0x269c6b=runtimeSkillLinkName(_0x76f2a5,_0x4bfb6a);for(const _0x1574da of _0x76f2a5[_0x519786(0x221)]){_0x2ea4ae[_0x519786(0x1fa)](ensureManagedSymlink(resolve(_0x1574da,_0x269c6b),_0x2fa38f['dir'],_0x76f2a5,_0x4bfb6a));}}return _0x2ea4ae;}export function pruneStaleRuntimeSkillLinks(_0x3125f3,_0x3d2357,_0x3dbb1b){const _0x2707e6=a108_0x53edfb,_0x134153=new Set([..._0x3d2357][_0x2707e6(0x218)](_0x44f953=>_0x44f953['trim']())['filter'](Boolean)),_0x473174=_0x3dbb1b?new Set([..._0x3dbb1b][_0x2707e6(0x218)](_0xdfedf0=>_0xdfedf0[_0x2707e6(0x1e9)]())['filter'](Boolean)):undefined,_0x18dd11=[];for(const _0x23339b of _0x3125f3[_0x2707e6(0x221)]){for(const _0x5f2f2b of managedTargetSkillLinkPaths(_0x23339b,_0x3125f3)){const _0xda0ffa=runtimeSkillCodeFromLink(_0x3125f3,_0x5f2f2b);if(_0x473174&&!_0x473174[_0x2707e6(0x209)](_0xda0ffa))continue;if(_0x134153[_0x2707e6(0x209)](_0xda0ffa))continue;_0x18dd11['push'](removeManagedSkillLink(_0x5f2f2b,_0x3125f3,_0xda0ffa));}}return _0x18dd11;}export function pruneStaleRuntimeSkillCache(_0xb8e8e2,_0x58279f={}){const _0x417c3d=a108_0x53edfb,_0x27675c=new Set([..._0xb8e8e2['activeSkillCodes']][_0x417c3d(0x218)](_0x277118=>_0x277118[_0x417c3d(0x1e9)]())[_0x417c3d(0x1ff)](Boolean)),_0x119647=_0xb8e8e2[_0x417c3d(0x207)]?new Set([..._0xb8e8e2[_0x417c3d(0x207)]][_0x417c3d(0x218)](_0x1e2ba1=>_0x1e2ba1[_0x417c3d(0x1e9)]())[_0x417c3d(0x1ff)](Boolean)):undefined,_0x40f30e=_0xb8e8e2[_0x417c3d(0x203)]??[_0x417c3d(0x214),_0x417c3d(0x20f)],_0x44df50=resolve(getRuntimeSkillCacheRoot(_0xb8e8e2[_0x417c3d(0x1fe)],_0xb8e8e2[_0x417c3d(0x1f6)],_0x58279f),safePathSegment(_0xb8e8e2[_0x417c3d(0x1ed)],_0x417c3d(0x1ed))),_0x2fc305=[];for(const _0x46d031 of _0x40f30e){const _0x383a12=resolve(_0x44df50,_0x46d031);if(!existsSync(_0x383a12))continue;for(const _0x43eb3c of readdirSync(_0x383a12,{'withFileTypes':!![]})){if(!_0x43eb3c[_0x417c3d(0x20e)]())continue;const _0x2fc266=_0x43eb3c['name'];if(_0x119647&&!_0x119647['has'](_0x2fc266))continue;if(_0x27675c[_0x417c3d(0x209)](_0x2fc266))continue;const _0x238d30=resolve(_0x383a12,_0x2fc266),_0x57469d=readMetadataIfPresent(resolve(_0x238d30,METADATA_FILE));if(_0x57469d?.[_0x417c3d(0x1ed)]!==_0xb8e8e2[_0x417c3d(0x1ed)]||_0x57469d[_0x417c3d(0x21c)]!==_0x46d031||_0x57469d['skillCode']!==_0x2fc266){_0x2fc305['push']({'path':_0x238d30,'action':_0x417c3d(0x1fc),'reason':_0x417c3d(0x1f5)});continue;}if(isLinkedFromAnyRoot(_0x238d30,_0xb8e8e2[_0x417c3d(0x1f2)]??[])){_0x2fc305[_0x417c3d(0x1fa)]({'path':_0x238d30,'action':_0x417c3d(0x1fc),'reason':'linked-from-protected-root'});continue;}removeSync(_0x238d30),_0x2fc305[_0x417c3d(0x1fa)]({'path':_0x238d30,'action':_0x417c3d(0x20d)});}}return _0x2fc305;}function a108_0x4ec9(){const _0x4f0fcc=['56IiXPhL','builtin','4896448IXKhyO','protectedLinkRoots','validation','secret-retriever','metadata-mismatch','accessKey','project','metadataPath','1uIDIWj','push','updated','skipped','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20','env','filter','skill','length','Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20','scopes','3447834EtJYBZ','2782966HPDRpy','agentsSkillsDir','pruneSkillCodes','611105woiyat','has','132IuuXOx','Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20','9vKHlXg','removed','isDirectory','company','265405Qebwka','84dvdIRt','get','external-symlink','personal','369879DYXoDc','managedRoot','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','map','contentHash','created','Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20','scope','name','startsWith','isSymbolicLink','values','skillRoots','slice','dir','Refusing\x20to\x20copy\x20Skill\x20symlink:\x20','lovrabet','Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20','trim','skillCode','unchanged','88004KyDjjY','appCode','50DSMfoh'];a108_0x4ec9=function(){return _0x4f0fcc;};return a108_0x4ec9();}export function linkGlobalRuntimeSkills(_0x3508ba,_0x48ab60={}){const _0x355ba6=a108_0x53edfb,_0x5c176b=resolveSkillSyncPaths(_0x48ab60),_0x11111e=[];for(const _0x2eeb8c of _0x3508ba){if(_0x2eeb8c[_0x355ba6(0x21c)]!==_0x355ba6(0x1f0))throw CliErrors['validation'](_0x355ba6(0x217)+_0x2eeb8c[_0x355ba6(0x21c)]);const _0x535e78=requireSkillCode(_0x2eeb8c[_0x355ba6(0x200)]),_0x568bc0=copyManagedSkillDirectory(_0x2eeb8c[_0x355ba6(0x1e5)],resolve(_0x5c176b[_0x355ba6(0x206)],_0x535e78));_0x11111e['push']({..._0x568bc0,'contentHash':_0x2eeb8c[_0x355ba6(0x219)]});}return _0x11111e;}function ensureManagedSymlink(_0x4f5fc8,_0x36b0ee,_0x234ea9,_0x1a690a){const _0x3b99e2=a108_0x53edfb;mkdirSync(dirname(_0x4f5fc8),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x4f5fc8)||isDanglingSymlink(_0x4f5fc8)){const _0x12dfcf=lstatSync(_0x4f5fc8);if(!_0x12dfcf[_0x3b99e2(0x21f)]())throw CliErrors[_0x3b99e2(0x1f3)]('Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20'+_0x4f5fc8);const _0x100024=resolveSymlinkTarget(_0x4f5fc8);if(!isPathInside(realOrResolved(_0x100024),realOrResolved(_0x234ea9[_0x3b99e2(0x216)])))throw CliErrors['validation']('Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20'+_0x4f5fc8);if(realOrResolved(_0x100024)===realOrResolved(_0x36b0ee))return{'path':_0x4f5fc8,'target':_0x36b0ee,'action':_0x3b99e2(0x1eb)};const _0x323a4d=readMetadataIfPresent(resolve(_0x100024,METADATA_FILE));if(_0x234ea9['scope']==='project'&&(_0x323a4d?.[_0x3b99e2(0x1ed)]!==_0x234ea9[_0x3b99e2(0x1ed)]||_0x323a4d[_0x3b99e2(0x1ea)]!==_0x1a690a))throw CliErrors[_0x3b99e2(0x1f3)](_0x3b99e2(0x202)+_0x4f5fc8);return unlinkSync(_0x4f5fc8),symlinkSync(_0x36b0ee,_0x4f5fc8,_0x3b99e2(0x1e5)),{'path':_0x4f5fc8,'target':_0x36b0ee,'action':_0x3b99e2(0x1fb)};}return symlinkSync(_0x36b0ee,_0x4f5fc8,_0x3b99e2(0x1e5)),{'path':_0x4f5fc8,'target':_0x36b0ee,'action':_0x3b99e2(0x21a)};}function a108_0x5f0b(_0x1fa422,_0x138b4b){_0x1fa422=_0x1fa422-0x1e4;const _0x4ec9d9=a108_0x4ec9();let _0x5f0b8a=_0x4ec9d9[_0x1fa422];return _0x5f0b8a;}function managedTargetSkillLinkPaths(_0x3d18a9,_0x5e080f){const _0x561862=a108_0x53edfb;if(!existsSync(_0x3d18a9))return[];const _0x43ce34=_0x5e080f[_0x561862(0x1ed)]+'--';return readdirSync(_0x3d18a9,{'withFileTypes':!![]})[_0x561862(0x1ff)](_0x398c67=>_0x5e080f['scope']==='project'||_0x398c67['name'][_0x561862(0x21e)](_0x43ce34))[_0x561862(0x218)](_0x12a946=>resolve(_0x3d18a9,_0x12a946['name']));}function removeManagedSkillLink(_0x47e4f7,_0x4bfdd6,_0x2831ca){const _0x369059=a108_0x53edfb,_0x161e75=lstatIfPresent(_0x47e4f7);if(!_0x161e75?.[_0x369059(0x21f)]())return{'path':_0x47e4f7,'action':_0x369059(0x1fc),'reason':'not-managed-symlink'};const _0x522a48=resolveSymlinkTarget(_0x47e4f7);if(!isPathInside(realOrResolved(_0x522a48),realOrResolved(_0x4bfdd6[_0x369059(0x216)])))return{'path':_0x47e4f7,'action':'skipped','reason':_0x369059(0x213)};const _0x3d3b7c=readMetadataIfPresent(resolve(_0x522a48,METADATA_FILE));if(_0x4bfdd6[_0x369059(0x21c)]==='project'&&(_0x3d3b7c?.[_0x369059(0x1ed)]!==_0x4bfdd6[_0x369059(0x1ed)]||_0x3d3b7c['skillCode']!==_0x2831ca))return{'path':_0x47e4f7,'action':'skipped','reason':_0x369059(0x1f5)};return unlinkSync(_0x47e4f7),{'path':_0x47e4f7,'action':_0x369059(0x20d)};}function isLinkedFromAnyRoot(_0x17bbb4,_0x34045b){const _0x3790f6=a108_0x53edfb,_0x9f296f=realOrResolved(_0x17bbb4);for(const _0x5676f9 of _0x34045b){if(!existsSync(_0x5676f9))continue;for(const _0x47a83e of readdirSync(_0x5676f9,{'withFileTypes':!![]})){if(!_0x47a83e[_0x3790f6(0x21f)]())continue;const _0x1f5b43=resolve(_0x5676f9,_0x47a83e[_0x3790f6(0x21d)]);if(realOrResolved(resolveSymlinkTarget(_0x1f5b43))===_0x9f296f)return!![];}}return![];}function runtimeSkillLinkName(_0x22d072,_0x12a034){const _0xe2728d=a108_0x53edfb,_0x126567=safePathSegment(_0x12a034,_0xe2728d(0x1ea));if(_0x22d072[_0xe2728d(0x21c)]===_0xe2728d(0x1f7)&&RESERVED_PROJECT_SKILL_CODES[_0xe2728d(0x209)](_0x126567))throw CliErrors[_0xe2728d(0x1f3)](_0xe2728d(0x1e8)+_0x126567);return _0x22d072[_0xe2728d(0x21c)]==='project'?_0x126567:_0x22d072['appCode']+'--'+_0x126567;}function runtimeSkillCodeFromLink(_0x2a9097,_0x46b742){const _0x43f9b8=a108_0x53edfb,_0xed26ac=basename(_0x46b742);return _0x2a9097[_0x43f9b8(0x21c)]===_0x43f9b8(0x1f7)?_0xed26ac:_0xed26ac[_0x43f9b8(0x1e4)]((_0x2a9097[_0x43f9b8(0x1ed)]+'--')[_0x43f9b8(0x201)]);}export function copyManagedSkillDirectory(_0x3b6a8b,_0x7a84bd){const _0x53b236=a108_0x53edfb,_0x51baea=resolve(_0x7a84bd,METADATA_FILE),_0x1c2501=existsSync(_0x7a84bd);if(_0x1c2501){const _0x21961c=lstatSync(_0x7a84bd);if(_0x21961c[_0x53b236(0x21f)]())throw CliErrors[_0x53b236(0x1f3)](_0x53b236(0x20b)+_0x7a84bd);if(!_0x21961c[_0x53b236(0x20e)]())throw CliErrors[_0x53b236(0x1f3)]('Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20'+_0x7a84bd);const _0xd8d488=readMetadataIfPresent(_0x51baea);if(_0xd8d488?.[_0x53b236(0x21c)]!=='builtin')throw CliErrors[_0x53b236(0x1f3)](_0x53b236(0x1fd)+_0x7a84bd);}ensureDirSync(dirname(_0x7a84bd));const _0x2a8ec4=_0x1c2501?readMetadataIfPresent(_0x51baea)?.[_0x53b236(0x219)]:undefined,_0x4e74c2=readMetadataIfPresent(resolve(_0x3b6a8b,METADATA_FILE))?.[_0x53b236(0x219)];return _0x1c2501&&removeSync(_0x7a84bd),copySkillDirectory(_0x3b6a8b,_0x7a84bd),{'path':_0x7a84bd,'target':_0x3b6a8b,'action':!_0x1c2501?_0x53b236(0x21a):_0x2a8ec4===_0x4e74c2?_0x53b236(0x1eb):'updated'};}function copySkillDirectory(_0x311316,_0x36340d){copySync(_0x311316,_0x36340d,{'dereference':![],'overwrite':!![],'filter'(_0x35d0f5){const _0x843f38=a108_0x5f0b;if(lstatSync(_0x35d0f5)[_0x843f38(0x21f)]())throw CliErrors[_0x843f38(0x1f3)](_0x843f38(0x1e6)+_0x35d0f5);return!![];}});}
@@ -1 +1 @@
1
- (function(_0x5da98f,_0x5445aa){const _0x15a9af=a108_0x945b,_0xa088f6=_0x5da98f();while(!![]){try{const _0x30a91b=parseInt(_0x15a9af(0x1a8))/0x1+-parseInt(_0x15a9af(0x184))/0x2*(-parseInt(_0x15a9af(0x187))/0x3)+parseInt(_0x15a9af(0x19f))/0x4+-parseInt(_0x15a9af(0x18d))/0x5+parseInt(_0x15a9af(0x193))/0x6*(-parseInt(_0x15a9af(0x1aa))/0x7)+parseInt(_0x15a9af(0x19d))/0x8*(parseInt(_0x15a9af(0x1ac))/0x9)+-parseInt(_0x15a9af(0x1a5))/0xa*(parseInt(_0x15a9af(0x19e))/0xb);if(_0x30a91b===_0x5445aa)break;else _0xa088f6['push'](_0xa088f6['shift']());}catch(_0x28ec01){_0xa088f6['push'](_0xa088f6['shift']());}}}(a108_0x5c6d,0xb3828));function a108_0x945b(_0x528368,_0x46b164){_0x528368=_0x528368-0x183;const _0x5c6d04=a108_0x5c6d();let _0x945bad=_0x5c6d04[_0x528368];return _0x945bad;}import{existsSync,readdirSync}from'node:fs';import{resolve}from'node:path';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{readMetadataIfPresent}from'./metadata.js';import{getRuntimeSkillCacheRoot,safePathSegment}from'./paths.js';import{isRuntimeSkillScope,normalizeRuntimeSkillScopes}from'./scopes.js';export function listLocalRuntimeSkills(_0x467a4b,_0x9b7a80,_0x3c0624={}){const _0x4dbaaa=a108_0x945b,_0x55230e=safePathSegment(_0x467a4b[_0x4dbaaa(0x18e)],_0x4dbaaa(0x18e));if(_0x9b7a80[_0x4dbaaa(0x18e)]!==_0x55230e)throw CliErrors[_0x4dbaaa(0x1a0)](_0x4dbaaa(0x1ae)+_0x9b7a80['appCode']+_0x4dbaaa(0x194)+_0x55230e);const _0x12f54c=normalizeRuntimeSkillScopes(_0x467a4b[_0x4dbaaa(0x18b)]),_0x3aef11=new Set(_0x12f54c),_0x50ee60=_0x467a4b[_0x4dbaaa(0x199)]?.[_0x4dbaaa(0x1af)](),_0x140c6c=new Map(),_0x438b11=resolve(getRuntimeSkillCacheRoot(_0x467a4b[_0x4dbaaa(0x186)],_0x467a4b['accessKey'],_0x3c0624),_0x55230e);for(const _0x3b5e9d of _0x12f54c){for(const _0x5baedf of localSkillEntryDirs(resolve(_0x438b11,_0x3b5e9d))){collectLocalRuntimeSkill(_0x140c6c,_0x5baedf,{'appCode':_0x55230e,'scopes':_0x3aef11,'code':_0x50ee60,'source':_0x4dbaaa(0x18f)});}}for(const _0x543d44 of _0x9b7a80['skillRoots']){for(const _0x28f918 of localSkillLinkCandidates(_0x543d44,_0x9b7a80,_0x3aef11)){collectLocalRuntimeSkill(_0x140c6c,_0x28f918,{'appCode':_0x55230e,'scopes':_0x3aef11,'code':_0x50ee60,'source':'link','linkedPath':_0x28f918});}}return Array[_0x4dbaaa(0x1a4)](_0x140c6c[_0x4dbaaa(0x1a1)]())[_0x4dbaaa(0x18c)](compareLocalRuntimeSkills);}function localSkillEntryDirs(_0x8c334a){const _0x5f140c=a108_0x945b;if(!existsSync(_0x8c334a))return[];return readdirSync(_0x8c334a,{'withFileTypes':!![]})['filter'](_0x26a487=>_0x26a487[_0x5f140c(0x190)]()||_0x26a487['isSymbolicLink']())[_0x5f140c(0x1a7)](_0x12f07a=>resolve(_0x8c334a,_0x12f07a[_0x5f140c(0x19b)]));}function localSkillLinkCandidates(_0x4557a4,_0x384ae5,_0x476fb7){const _0x170cac=a108_0x945b;if(!existsSync(_0x4557a4))return[];const _0x1df8e3=_0x384ae5[_0x170cac(0x18e)]+'--';return readdirSync(_0x4557a4,{'withFileTypes':!![]})['filter'](_0xbc73fb=>_0xbc73fb['isDirectory']()||_0xbc73fb[_0x170cac(0x191)]())[_0x170cac(0x183)](_0x2a4e80=>_0x384ae5[_0x170cac(0x188)]==='project'||_0x2a4e80[_0x170cac(0x19b)][_0x170cac(0x1ad)](_0x1df8e3)||_0x476fb7[_0x170cac(0x1a9)]('builtin'))[_0x170cac(0x1a7)](_0x129126=>resolve(_0x4557a4,_0x129126[_0x170cac(0x19b)]));}function a108_0x5c6d(){const _0x4d1358=['linkedPaths','localeCompare','linkedPath','code','includes','name','cacheDir','904NPSYEX','2851167STdwyI','3009844xxMUOY','validation','values','dir','metadataPath','from','50YjujtT','get','map','1093687HFdopL','has','14oiUBec','tags','65295nRzEkP','startsWith','Runtime\x20Skill\x20install\x20target\x20app\x20mismatch:\x20','trim','filter','649160uaPtYP','skillCode','env','6kwuSaX','scope','isArray','source','scopes','sort','2658710ThJuwR','appCode','cache','isDirectory','isSymbolicLink','local','2256372lkNdXi','\x20!=\x20','set'];a108_0x5c6d=function(){return _0x4d1358;};return a108_0x5c6d();}function collectLocalRuntimeSkill(_0x384f14,_0x3f4e06,_0x2dd8ea){const _0x52cbf8=a108_0x945b,_0x19a280=resolve(_0x3f4e06,METADATA_FILE),_0x2d733d=readMetadataIfPresent(_0x19a280);if(!_0x2d733d)return;if(_0x2d733d[_0x52cbf8(0x18e)]!==_0x2dd8ea[_0x52cbf8(0x18e)])return;if(!isRuntimeSkillScope(_0x2d733d[_0x52cbf8(0x188)])||!_0x2dd8ea['scopes'][_0x52cbf8(0x1a9)](_0x2d733d[_0x52cbf8(0x188)]))return;const _0x25538f=_0x2d733d[_0x52cbf8(0x185)]?.[_0x52cbf8(0x1af)]();if(!_0x25538f)return;if(_0x2dd8ea[_0x52cbf8(0x199)]&&_0x25538f!==_0x2dd8ea[_0x52cbf8(0x199)])return;const _0x38f03d=_0x2d733d[_0x52cbf8(0x188)]+':'+_0x25538f,_0x1b26f1=_0x2dd8ea[_0x52cbf8(0x198)]?[_0x2dd8ea[_0x52cbf8(0x198)]]:[],_0x4307ea=_0x384f14[_0x52cbf8(0x1a6)](_0x38f03d);if(_0x4307ea){_0x2dd8ea[_0x52cbf8(0x18a)]===_0x52cbf8(0x18f)&&(_0x4307ea[_0x52cbf8(0x1a2)]=_0x3f4e06,_0x4307ea[_0x52cbf8(0x19c)]=_0x3f4e06,_0x4307ea['skillMdPath']=resolve(_0x3f4e06,SKILL_FILE),_0x4307ea[_0x52cbf8(0x1a3)]=_0x19a280);for(const _0x35061d of _0x1b26f1){!_0x4307ea[_0x52cbf8(0x196)][_0x52cbf8(0x19a)](_0x35061d)&&_0x4307ea[_0x52cbf8(0x196)]['push'](_0x35061d);}_0x4307ea[_0x52cbf8(0x196)][_0x52cbf8(0x18c)]();return;}_0x384f14[_0x52cbf8(0x195)](_0x38f03d,{..._0x2d733d,'tags':Array[_0x52cbf8(0x189)](_0x2d733d[_0x52cbf8(0x1ab)])?_0x2d733d[_0x52cbf8(0x1ab)]:[],'scope':_0x2d733d[_0x52cbf8(0x188)],'source':_0x52cbf8(0x192),'dir':_0x3f4e06,'cacheDir':_0x2dd8ea[_0x52cbf8(0x18a)]===_0x52cbf8(0x18f)?_0x3f4e06:undefined,'skillMdPath':resolve(_0x3f4e06,SKILL_FILE),'metadataPath':_0x19a280,'linkedPaths':_0x1b26f1});}function compareLocalRuntimeSkills(_0x4b414a,_0x113869){const _0xf583ab=a108_0x945b,_0xc343aa={'personal':0x0,'company':0x1,'builtin':0x2};return _0xc343aa[_0x4b414a['scope']]-_0xc343aa[_0x113869[_0xf583ab(0x188)]]||_0x4b414a[_0xf583ab(0x185)][_0xf583ab(0x197)](_0x113869['skillCode'])||_0x4b414a[_0xf583ab(0x1a2)][_0xf583ab(0x197)](_0x113869['dir']);}
1
+ (function(_0x201f5f,_0xdb3d0e){const _0x46667e=a109_0x21b8,_0x561e36=_0x201f5f();while(!![]){try{const _0x5b411e=parseInt(_0x46667e(0xfd))/0x1+parseInt(_0x46667e(0x114))/0x2*(-parseInt(_0x46667e(0xfb))/0x3)+-parseInt(_0x46667e(0xfa))/0x4*(parseInt(_0x46667e(0x100))/0x5)+parseInt(_0x46667e(0x11f))/0x6+-parseInt(_0x46667e(0x11a))/0x7+-parseInt(_0x46667e(0x10b))/0x8+parseInt(_0x46667e(0x115))/0x9*(parseInt(_0x46667e(0x10d))/0xa);if(_0x5b411e===_0xdb3d0e)break;else _0x561e36['push'](_0x561e36['shift']());}catch(_0x329f00){_0x561e36['push'](_0x561e36['shift']());}}}(a109_0x1e71,0x8f012));import{existsSync,readdirSync}from'node:fs';import{resolve}from'node:path';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{readMetadataIfPresent}from'./metadata.js';function a109_0x1e71(){const _0x313672=['metadataPath','accessKey','map','7968884rCAzwE','from','sort','isArray','push','1747092UyAQuI','scopes','skillRoots','skillCode','cache','isSymbolicLink','15236OWVLHx','18XwbgLO','has','100133YQYXXW','Runtime\x20Skill\x20install\x20target\x20app\x20mismatch:\x20','local','1405KqduUR','appCode','scope','filter','isDirectory','env','localeCompare','skillMdPath','tags','trim','linkedPaths','9127736UOFmGp','dir','10YkaQGn','startsWith','includes','name','linkedPath','values','source','327308BMqwsW','40734567IBJjvZ','code'];a109_0x1e71=function(){return _0x313672;};return a109_0x1e71();}import{getRuntimeSkillCacheRoot,safePathSegment}from'./paths.js';import{isRuntimeSkillScope,normalizeRuntimeSkillScopes}from'./scopes.js';export function listLocalRuntimeSkills(_0x5ae1da,_0x544c32,_0x2eaa42={}){const _0x1fb88f=a109_0x21b8,_0x42f8bf=safePathSegment(_0x5ae1da[_0x1fb88f(0x101)],_0x1fb88f(0x101));if(_0x544c32[_0x1fb88f(0x101)]!==_0x42f8bf)throw CliErrors['validation'](_0x1fb88f(0xfe)+_0x544c32['appCode']+'\x20!=\x20'+_0x42f8bf);const _0x5d5eb1=normalizeRuntimeSkillScopes(_0x5ae1da[_0x1fb88f(0x120)]),_0x4d76c1=new Set(_0x5d5eb1),_0x46e733=_0x5ae1da[_0x1fb88f(0x116)]?.[_0x1fb88f(0x109)](),_0xba918a=new Map(),_0x205d2f=resolve(getRuntimeSkillCacheRoot(_0x5ae1da[_0x1fb88f(0x105)],_0x5ae1da[_0x1fb88f(0x118)],_0x2eaa42),_0x42f8bf);for(const _0x29b3f2 of _0x5d5eb1){for(const _0x133542 of localSkillEntryDirs(resolve(_0x205d2f,_0x29b3f2))){collectLocalRuntimeSkill(_0xba918a,_0x133542,{'appCode':_0x42f8bf,'scopes':_0x4d76c1,'code':_0x46e733,'source':_0x1fb88f(0xf8)});}}for(const _0x1745f4 of _0x544c32[_0x1fb88f(0xf6)]){for(const _0x4bf634 of localSkillLinkCandidates(_0x1745f4,_0x544c32,_0x4d76c1)){collectLocalRuntimeSkill(_0xba918a,_0x4bf634,{'appCode':_0x42f8bf,'scopes':_0x4d76c1,'code':_0x46e733,'source':'link','linkedPath':_0x4bf634});}}return Array[_0x1fb88f(0x11b)](_0xba918a[_0x1fb88f(0x112)]())[_0x1fb88f(0x11c)](compareLocalRuntimeSkills);}function localSkillEntryDirs(_0x1608cb){const _0x150458=a109_0x21b8;if(!existsSync(_0x1608cb))return[];return readdirSync(_0x1608cb,{'withFileTypes':!![]})[_0x150458(0x103)](_0x26b1c0=>_0x26b1c0[_0x150458(0x104)]()||_0x26b1c0[_0x150458(0xf9)]())['map'](_0x24b5d2=>resolve(_0x1608cb,_0x24b5d2[_0x150458(0x110)]));}function a109_0x21b8(_0x3bf6d3,_0x548636){_0x3bf6d3=_0x3bf6d3-0xf6;const _0x1e716e=a109_0x1e71();let _0x21b8b1=_0x1e716e[_0x3bf6d3];return _0x21b8b1;}function localSkillLinkCandidates(_0x34af24,_0x4b69b2,_0x2f74cf){const _0x7a3893=a109_0x21b8;if(!existsSync(_0x34af24))return[];const _0x2ba91a=_0x4b69b2['appCode']+'--';return readdirSync(_0x34af24,{'withFileTypes':!![]})[_0x7a3893(0x103)](_0x4ba858=>_0x4ba858['isDirectory']()||_0x4ba858[_0x7a3893(0xf9)]())[_0x7a3893(0x103)](_0x7f2102=>_0x4b69b2['scope']==='project'||_0x7f2102['name'][_0x7a3893(0x10e)](_0x2ba91a)||_0x2f74cf[_0x7a3893(0xfc)]('builtin'))[_0x7a3893(0x119)](_0xf92c0f=>resolve(_0x34af24,_0xf92c0f[_0x7a3893(0x110)]));}function collectLocalRuntimeSkill(_0x44f07,_0x292d38,_0x13891a){const _0xfc2609=a109_0x21b8,_0x1cf351=resolve(_0x292d38,METADATA_FILE),_0x1c6717=readMetadataIfPresent(_0x1cf351);if(!_0x1c6717)return;if(_0x1c6717['appCode']!==_0x13891a[_0xfc2609(0x101)])return;if(!isRuntimeSkillScope(_0x1c6717[_0xfc2609(0x102)])||!_0x13891a[_0xfc2609(0x120)]['has'](_0x1c6717[_0xfc2609(0x102)]))return;const _0x403f66=_0x1c6717[_0xfc2609(0xf7)]?.[_0xfc2609(0x109)]();if(!_0x403f66)return;if(_0x13891a['code']&&_0x403f66!==_0x13891a[_0xfc2609(0x116)])return;const _0x30f1b8=_0x1c6717[_0xfc2609(0x102)]+':'+_0x403f66,_0x1258db=_0x13891a[_0xfc2609(0x111)]?[_0x13891a['linkedPath']]:[],_0x2960b3=_0x44f07['get'](_0x30f1b8);if(_0x2960b3){_0x13891a[_0xfc2609(0x113)]===_0xfc2609(0xf8)&&(_0x2960b3[_0xfc2609(0x10c)]=_0x292d38,_0x2960b3['cacheDir']=_0x292d38,_0x2960b3[_0xfc2609(0x107)]=resolve(_0x292d38,SKILL_FILE),_0x2960b3[_0xfc2609(0x117)]=_0x1cf351);for(const _0x248f05 of _0x1258db){!_0x2960b3['linkedPaths'][_0xfc2609(0x10f)](_0x248f05)&&_0x2960b3[_0xfc2609(0x10a)][_0xfc2609(0x11e)](_0x248f05);}_0x2960b3[_0xfc2609(0x10a)][_0xfc2609(0x11c)]();return;}_0x44f07['set'](_0x30f1b8,{..._0x1c6717,'tags':Array[_0xfc2609(0x11d)](_0x1c6717[_0xfc2609(0x108)])?_0x1c6717[_0xfc2609(0x108)]:[],'scope':_0x1c6717[_0xfc2609(0x102)],'source':_0xfc2609(0xff),'dir':_0x292d38,'cacheDir':_0x13891a['source']==='cache'?_0x292d38:undefined,'skillMdPath':resolve(_0x292d38,SKILL_FILE),'metadataPath':_0x1cf351,'linkedPaths':_0x1258db});}function compareLocalRuntimeSkills(_0x58bb0f,_0x39f027){const _0x2df1fe=a109_0x21b8,_0x1541fd={'personal':0x0,'company':0x1,'builtin':0x2};return _0x1541fd[_0x58bb0f[_0x2df1fe(0x102)]]-_0x1541fd[_0x39f027[_0x2df1fe(0x102)]]||_0x58bb0f[_0x2df1fe(0xf7)]['localeCompare'](_0x39f027[_0x2df1fe(0xf7)])||_0x58bb0f['dir'][_0x2df1fe(0x106)](_0x39f027[_0x2df1fe(0x10c)]);}
@@ -1 +1 @@
1
- (function(_0x382964,_0x21904c){const _0x4cf9f1=a109_0x3a09,_0x16f9b7=_0x382964();while(!![]){try{const _0x34d53e=-parseInt(_0x4cf9f1(0xe1))/0x1*(-parseInt(_0x4cf9f1(0xfc))/0x2)+parseInt(_0x4cf9f1(0xe3))/0x3+-parseInt(_0x4cf9f1(0xea))/0x4+-parseInt(_0x4cf9f1(0x106))/0x5*(-parseInt(_0x4cf9f1(0xef))/0x6)+-parseInt(_0x4cf9f1(0xeb))/0x7+-parseInt(_0x4cf9f1(0xf4))/0x8*(parseInt(_0x4cf9f1(0xf0))/0x9)+parseInt(_0x4cf9f1(0xe4))/0xa*(-parseInt(_0x4cf9f1(0x105))/0xb);if(_0x34d53e===_0x21904c)break;else _0x16f9b7['push'](_0x16f9b7['shift']());}catch(_0x54f3d8){_0x16f9b7['push'](_0x16f9b7['shift']());}}}(a109_0x5553,0xb98a7));import{readFileSync,readdirSync,realpathSync}from'node:fs';function a109_0x5553(){const _0x3d4c29=['isDirectory','string','Duplicate\x20Skill\x20file\x20path:\x20','replace','includes','315720fkBfpH','370377yLphsX','content','Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20','isSafeInteger','1874310MEVngt','23121xGFHnK','from','test','sort','1752BhEoZW','has','trim','name','toString','path','validation','size','1969268hcXDQX','split','Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20','isSymbolicLink','bytes','sha256','object','Skill\x20file\x20path\x20must\x20be\x20text.','isFile','19547zRbqUv','15DZFEcN','utf8','toLowerCase','isBuffer','values','isArray','set','1Nztfnh','compare','1887141zqoLkt','6170YbSGzO'];a109_0x5553=function(){return _0x3d4c29;};return a109_0x5553();}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(_0x3d5234){const _0x24ae58=a109_0x3a09;return _0x3d5234['bytes']??Buffer[_0x24ae58(0xf1)](_0x3d5234[_0x24ae58(0xec)]??'',_0x24ae58(0xdb));}export function fileText(_0x4fc483){const _0x5e3a64=a109_0x3a09;return fileContent(_0x4fc483)[_0x5e3a64(0xf8)](_0x5e3a64(0xdb));}function a109_0x3a09(_0x5496f4,_0x2c2858){_0x5496f4=_0x5496f4-0xdb;const _0x555346=a109_0x5553();let _0x3a09b5=_0x555346[_0x5496f4];return _0x3a09b5;}export function normalizeLocalFiles(_0x48d725){const _0x1b4ef7=a109_0x3a09;if(!Array[_0x1b4ef7(0xdf)](_0x48d725)||_0x48d725['length']===0x0)return[];const _0xd73647=new Map();for(const _0x3c2676 of _0x48d725){if(!_0x3c2676||typeof _0x3c2676!==_0x1b4ef7(0x102)||typeof _0x3c2676[_0x1b4ef7(0xf9)]!==_0x1b4ef7(0xe6))throw CliErrors[_0x1b4ef7(0xfa)](_0x1b4ef7(0x103));const _0x4f8fce=normalizeSkillRelativePath(_0x3c2676[_0x1b4ef7(0xf9)]);if(_0xd73647['has'](_0x4f8fce))throw CliErrors[_0x1b4ef7(0xfa)](_0x1b4ef7(0xe7)+_0x4f8fce);if(_0x3c2676[_0x1b4ef7(0x100)]!==undefined&&!Buffer[_0x1b4ef7(0xdd)](_0x3c2676[_0x1b4ef7(0x100)]))throw CliErrors[_0x1b4ef7(0xfa)]('Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20'+_0x4f8fce);if(_0x3c2676[_0x1b4ef7(0x100)]===undefined&&typeof _0x3c2676[_0x1b4ef7(0xec)]!==_0x1b4ef7(0xe6))throw CliErrors['validation'](_0x1b4ef7(0xed)+_0x4f8fce);const _0x33dde9=fileContent(_0x3c2676);_0xd73647[_0x1b4ef7(0xe0)](_0x4f8fce,{'path':_0x4f8fce,'bytes':_0x33dde9});}return Array[_0x1b4ef7(0xf1)](_0xd73647[_0x1b4ef7(0xde)]())[_0x1b4ef7(0xf3)](compareSkillFiles);}export function normalizeManifestFiles(_0x3a4d61){const _0xa0752c=a109_0x3a09;if(!Array[_0xa0752c(0xdf)](_0x3a4d61)||_0x3a4d61['length']===0x0)return[];const _0x3c6ae5=new Map();for(const _0x13067b of _0x3a4d61){if(!_0x13067b||typeof _0x13067b!==_0xa0752c(0x102)||typeof _0x13067b[_0xa0752c(0xf9)]!==_0xa0752c(0xe6))throw CliErrors[_0xa0752c(0xfa)](_0xa0752c(0x103));const _0x320379=normalizeSkillRelativePath(_0x13067b['path']);if(_0x3c6ae5[_0xa0752c(0xf5)](_0x320379))throw CliErrors[_0xa0752c(0xfa)](_0xa0752c(0xe7)+_0x320379);if(!isSha256Hex(_0x13067b[_0xa0752c(0x101)]))throw CliErrors[_0xa0752c(0xfa)]('Skill\x20file\x20sha256\x20is\x20invalid:\x20'+_0x320379);if(!Number[_0xa0752c(0xee)](_0x13067b[_0xa0752c(0xfb)])||_0x13067b['size']<0x0)throw CliErrors[_0xa0752c(0xfa)]('Skill\x20file\x20size\x20is\x20invalid:\x20'+_0x320379);_0x3c6ae5[_0xa0752c(0xe0)](_0x320379,{'path':_0x320379,'sha256':_0x13067b['sha256'][_0xa0752c(0xdc)](),'size':_0x13067b[_0xa0752c(0xfb)]});}return Array[_0xa0752c(0xf1)](_0x3c6ae5[_0xa0752c(0xde)]())[_0xa0752c(0xf3)](compareSkillFiles);}export function scanSkillDirectory(_0x1ba166){const _0x3d9935=realpathSync(_0x1ba166),_0x59d4a3=[];function _0x6129cc(_0x2543dd){const _0xfb88d6=a109_0x3a09,_0x3a22bc=readdirSync(_0x2543dd,{'withFileTypes':!![]})['sort']((_0x24b523,_0x5c0438)=>_0x24b523['name']['localeCompare'](_0x5c0438[_0xfb88d6(0xf7)]));for(const _0x51a988 of _0x3a22bc){if(_0x51a988['isDirectory']()&&IGNORED_DIR_NAMES[_0xfb88d6(0xf5)](_0x51a988[_0xfb88d6(0xf7)]))continue;if(IGNORED_FILE_NAMES[_0xfb88d6(0xf5)](_0x51a988[_0xfb88d6(0xf7)]))continue;const _0x2bf282=resolve(_0x2543dd,_0x51a988[_0xfb88d6(0xf7)]);if(_0x51a988[_0xfb88d6(0xff)]())throw CliErrors[_0xfb88d6(0xfa)](_0xfb88d6(0xfe)+_0x2bf282);const _0x3031c2=toPosixPath(relative(_0x3d9935,_0x2bf282));if(_0x51a988[_0xfb88d6(0xe5)]()){_0x6129cc(_0x2bf282);continue;}if(!_0x51a988[_0xfb88d6(0x104)]())continue;validateSkillRelativePath(_0x3031c2);const _0x2a146a=readFileSync(_0x2bf282);_0x59d4a3['push']({'path':_0x3031c2,'bytes':_0x2a146a});}}return _0x6129cc(_0x3d9935),normalizeLocalFiles(_0x59d4a3);}export function compareSkillFiles(_0x5d27f2,_0x30859e){const _0x326ea7=a109_0x3a09;if(_0x5d27f2[_0x326ea7(0xf9)]===SKILL_FILE)return _0x30859e['path']===SKILL_FILE?0x0:-0x1;if(_0x30859e[_0x326ea7(0xf9)]===SKILL_FILE)return 0x1;return Buffer[_0x326ea7(0xe2)](Buffer[_0x326ea7(0xf1)](_0x5d27f2['path'],_0x326ea7(0xdb)),Buffer[_0x326ea7(0xf1)](_0x30859e[_0x326ea7(0xf9)],_0x326ea7(0xdb)));}export function normalizeSkillRelativePath(_0x185d20){const _0x280df3=a109_0x3a09,_0x54b863=toPosixPath(_0x185d20[_0x280df3(0xf6)]());return validateSkillRelativePath(_0x54b863),_0x54b863;}export function validateSkillRelativePath(_0x31f3b5){const _0x25ca6a=a109_0x3a09;if(!_0x31f3b5||_0x31f3b5['startsWith']('/')||_0x31f3b5[_0x25ca6a(0xe9)]('//'))throw CliErrors[_0x25ca6a(0xfa)]('Unsafe\x20Skill\x20file\x20path:\x20'+_0x31f3b5);for(const _0x279232 of _0x31f3b5[_0x25ca6a(0xfd)]('/')){if(!_0x279232||_0x279232==='.'||_0x279232==='..')throw CliErrors[_0x25ca6a(0xfa)]('Unsafe\x20Skill\x20file\x20path:\x20'+_0x31f3b5);}}export function toPosixPath(_0x23b282){const _0x37df6d=a109_0x3a09;return _0x23b282[_0x37df6d(0xe8)](/\\/g,'/');}export function isSha256Hex(_0x5ba983){const _0x6dc0ab=a109_0x3a09;return typeof _0x5ba983===_0x6dc0ab(0xe6)&&/^[a-fA-F0-9]{64}$/[_0x6dc0ab(0xf2)](_0x5ba983);}
1
+ function a110_0x55a9(_0x5f02bb,_0x4abd2b){_0x5f02bb=_0x5f02bb-0x154;const _0x4d1c2d=a110_0x4d1c();let _0x55a95f=_0x4d1c2d[_0x5f02bb];return _0x55a95f;}(function(_0x2834ac,_0x12fdc1){const _0x3670e5=a110_0x55a9,_0x5317ca=_0x2834ac();while(!![]){try{const _0x299a42=-parseInt(_0x3670e5(0x16c))/0x1*(-parseInt(_0x3670e5(0x166))/0x2)+parseInt(_0x3670e5(0x171))/0x3+-parseInt(_0x3670e5(0x16a))/0x4*(-parseInt(_0x3670e5(0x186))/0x5)+-parseInt(_0x3670e5(0x179))/0x6*(-parseInt(_0x3670e5(0x15b))/0x7)+parseInt(_0x3670e5(0x178))/0x8+parseInt(_0x3670e5(0x167))/0x9*(parseInt(_0x3670e5(0x162))/0xa)+parseInt(_0x3670e5(0x176))/0xb*(-parseInt(_0x3670e5(0x15e))/0xc);if(_0x299a42===_0x12fdc1)break;else _0x5317ca['push'](_0x5317ca['shift']());}catch(_0x2ceee1){_0x5317ca['push'](_0x5317ca['shift']());}}}(a110_0x4d1c,0x82858));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(_0x161af3){const _0x8b6bd2=a110_0x55a9;return _0x161af3['bytes']??Buffer[_0x8b6bd2(0x185)](_0x161af3[_0x8b6bd2(0x159)]??'',_0x8b6bd2(0x15c));}export function fileText(_0x5d6925){const _0x5bc4d1=a110_0x55a9;return fileContent(_0x5d6925)[_0x5bc4d1(0x168)](_0x5bc4d1(0x15c));}export function normalizeLocalFiles(_0x4d38d6){const _0x133e74=a110_0x55a9;if(!Array[_0x133e74(0x17c)](_0x4d38d6)||_0x4d38d6['length']===0x0)return[];const _0x726dac=new Map();for(const _0x52ee60 of _0x4d38d6){if(!_0x52ee60||typeof _0x52ee60!==_0x133e74(0x170)||typeof _0x52ee60[_0x133e74(0x15f)]!==_0x133e74(0x187))throw CliErrors[_0x133e74(0x177)](_0x133e74(0x16b));const _0x27e769=normalizeSkillRelativePath(_0x52ee60[_0x133e74(0x15f)]);if(_0x726dac['has'](_0x27e769))throw CliErrors[_0x133e74(0x177)](_0x133e74(0x175)+_0x27e769);if(_0x52ee60[_0x133e74(0x172)]!==undefined&&!Buffer[_0x133e74(0x165)](_0x52ee60[_0x133e74(0x172)]))throw CliErrors[_0x133e74(0x177)](_0x133e74(0x17b)+_0x27e769);if(_0x52ee60[_0x133e74(0x172)]===undefined&&typeof _0x52ee60[_0x133e74(0x159)]!==_0x133e74(0x187))throw CliErrors['validation'](_0x133e74(0x157)+_0x27e769);const _0x17a990=fileContent(_0x52ee60);_0x726dac['set'](_0x27e769,{'path':_0x27e769,'bytes':_0x17a990});}return Array[_0x133e74(0x185)](_0x726dac[_0x133e74(0x15a)]())[_0x133e74(0x161)](compareSkillFiles);}export function normalizeManifestFiles(_0x4453e){const _0x458362=a110_0x55a9;if(!Array['isArray'](_0x4453e)||_0x4453e[_0x458362(0x169)]===0x0)return[];const _0x4f4f11=new Map();for(const _0x184567 of _0x4453e){if(!_0x184567||typeof _0x184567!==_0x458362(0x170)||typeof _0x184567[_0x458362(0x15f)]!==_0x458362(0x187))throw CliErrors[_0x458362(0x177)]('Skill\x20file\x20path\x20must\x20be\x20text.');const _0xbb7d01=normalizeSkillRelativePath(_0x184567[_0x458362(0x15f)]);if(_0x4f4f11['has'](_0xbb7d01))throw CliErrors[_0x458362(0x177)](_0x458362(0x175)+_0xbb7d01);if(!isSha256Hex(_0x184567[_0x458362(0x155)]))throw CliErrors[_0x458362(0x177)](_0x458362(0x184)+_0xbb7d01);if(!Number['isSafeInteger'](_0x184567[_0x458362(0x17f)])||_0x184567[_0x458362(0x17f)]<0x0)throw CliErrors[_0x458362(0x177)](_0x458362(0x173)+_0xbb7d01);_0x4f4f11[_0x458362(0x16d)](_0xbb7d01,{'path':_0xbb7d01,'sha256':_0x184567[_0x458362(0x155)][_0x458362(0x15d)](),'size':_0x184567[_0x458362(0x17f)]});}return Array[_0x458362(0x185)](_0x4f4f11[_0x458362(0x15a)]())[_0x458362(0x161)](compareSkillFiles);}export function scanSkillDirectory(_0x2f7c71){const _0x526f0c=realpathSync(_0x2f7c71),_0x258814=[];function _0x5755e3(_0x1264b0){const _0x3bb0a0=a110_0x55a9,_0x21f20e=readdirSync(_0x1264b0,{'withFileTypes':!![]})['sort']((_0x57443c,_0x3c7ef2)=>_0x57443c[_0x3bb0a0(0x158)][_0x3bb0a0(0x17a)](_0x3c7ef2['name']));for(const _0x1bfff4 of _0x21f20e){if(_0x1bfff4['isDirectory']()&&IGNORED_DIR_NAMES[_0x3bb0a0(0x174)](_0x1bfff4['name']))continue;if(IGNORED_FILE_NAMES[_0x3bb0a0(0x174)](_0x1bfff4['name']))continue;const _0x2db1bf=resolve(_0x1264b0,_0x1bfff4['name']);if(_0x1bfff4[_0x3bb0a0(0x16e)]())throw CliErrors[_0x3bb0a0(0x177)](_0x3bb0a0(0x16f)+_0x2db1bf);const _0x59e7a4=toPosixPath(relative(_0x526f0c,_0x2db1bf));if(_0x1bfff4[_0x3bb0a0(0x154)]()){_0x5755e3(_0x2db1bf);continue;}if(!_0x1bfff4[_0x3bb0a0(0x181)]())continue;validateSkillRelativePath(_0x59e7a4);const _0x2ead91=readFileSync(_0x2db1bf);_0x258814[_0x3bb0a0(0x183)]({'path':_0x59e7a4,'bytes':_0x2ead91});}}return _0x5755e3(_0x526f0c),normalizeLocalFiles(_0x258814);}function a110_0x4d1c(){const _0x4a44d9=['validation','5456496SFBXPL','52986dKgRWH','localeCompare','Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20','isArray','trim','split','size','includes','isFile','compare','push','Skill\x20file\x20sha256\x20is\x20invalid:\x20','from','10370ZNjcqB','string','isDirectory','sha256','replace','Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20','name','content','values','91hnyYSU','utf8','toLowerCase','741612HJSlky','path','startsWith','sort','660ZJlAwO','test','Unsafe\x20Skill\x20file\x20path:\x20','isBuffer','94002HxGJaX','142227JJbKPr','toString','length','1932WRwITQ','Skill\x20file\x20path\x20must\x20be\x20text.','22RjOTrq','set','isSymbolicLink','Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20','object','915744AGjAfQ','bytes','Skill\x20file\x20size\x20is\x20invalid:\x20','has','Duplicate\x20Skill\x20file\x20path:\x20','649WTjIgT'];a110_0x4d1c=function(){return _0x4a44d9;};return a110_0x4d1c();}export function compareSkillFiles(_0x3ed522,_0x522b76){const _0x3348fd=a110_0x55a9;if(_0x3ed522[_0x3348fd(0x15f)]===SKILL_FILE)return _0x522b76[_0x3348fd(0x15f)]===SKILL_FILE?0x0:-0x1;if(_0x522b76['path']===SKILL_FILE)return 0x1;return Buffer[_0x3348fd(0x182)](Buffer[_0x3348fd(0x185)](_0x3ed522[_0x3348fd(0x15f)],_0x3348fd(0x15c)),Buffer[_0x3348fd(0x185)](_0x522b76['path'],'utf8'));}export function normalizeSkillRelativePath(_0x9e805c){const _0x5f08b7=a110_0x55a9,_0x1562e2=toPosixPath(_0x9e805c[_0x5f08b7(0x17d)]());return validateSkillRelativePath(_0x1562e2),_0x1562e2;}export function validateSkillRelativePath(_0x3070a1){const _0x23cb53=a110_0x55a9;if(!_0x3070a1||_0x3070a1[_0x23cb53(0x160)]('/')||_0x3070a1[_0x23cb53(0x180)]('//'))throw CliErrors['validation'](_0x23cb53(0x164)+_0x3070a1);for(const _0x1318a8 of _0x3070a1[_0x23cb53(0x17e)]('/')){if(!_0x1318a8||_0x1318a8==='.'||_0x1318a8==='..')throw CliErrors[_0x23cb53(0x177)](_0x23cb53(0x164)+_0x3070a1);}}export function toPosixPath(_0x5dd0a9){const _0x5908f5=a110_0x55a9;return _0x5dd0a9[_0x5908f5(0x156)](/\\/g,'/');}export function isSha256Hex(_0x358174){const _0x557ba2=a110_0x55a9;return typeof _0x358174===_0x557ba2(0x187)&&/^[a-fA-F0-9]{64}$/[_0x557ba2(0x163)](_0x358174);}
@@ -1 +1 @@
1
- (function(_0x38633d,_0x2b8c27){const _0x4f9d36=a110_0x5eba,_0xb640dd=_0x38633d();while(!![]){try{const _0x476025=-parseInt(_0x4f9d36(0x82))/0x1+parseInt(_0x4f9d36(0x8b))/0x2+parseInt(_0x4f9d36(0x83))/0x3+parseInt(_0x4f9d36(0x77))/0x4+-parseInt(_0x4f9d36(0x9b))/0x5+parseInt(_0x4f9d36(0x8a))/0x6*(parseInt(_0x4f9d36(0xa5))/0x7)+-parseInt(_0x4f9d36(0x96))/0x8;if(_0x476025===_0x2b8c27)break;else _0xb640dd['push'](_0xb640dd['shift']());}catch(_0x362ae7){_0xb640dd['push'](_0xb640dd['shift']());}}}(a110_0x53f4,0xbb5c1));import{existsSync,lstatSync,mkdirSync,readFileSync,rmSync}from'node:fs';import{dirname,resolve}from'node:path';import{isCollection,isMap,isNode,parseDocument,visit}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{resolveManagedFilePath,writeBytesAtomic,writeJsonAtomic}from'./fs-utils.js';function a110_0x53f4(){const _0x22eb35=['keys','---','match','name','\x0a---\x0a\x0a','5703808qglcNV','utf8','set','isFile','test','---\x0a','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','validation','displayName:\x20','has','604604ENIGYe','3381957kzIpBz','displayName','fileHashes','paths','contents','flow','path','2655780vpgBGk','2129306yAOCxf','Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20','name:\x20','pulledAt','delete','appCode','trimEnd','replace','entries','Managed\x20file\x20was\x20removed\x20locally:\x20','.\x20Changed\x20file:\x20','21471928TigQlr','skillName','Runtime\x20Skill\x20package\x20is\x20missing\x20','map','accessKey','2235820gaqjAH','length','env','force','filter','description','slice','Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20','find','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.','14OxEJXP','join'];a110_0x53f4=function(){return _0x22eb35;};return a110_0x53f4();}import{bufferSha256,contentHash,fileHash}from'./hashing.js';import{fileContent,fileText,normalizeLocalFiles}from'./local-files.js';import{buildMetadata,readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillDir}from'./paths.js';import{extractDownloadedPackage,requirePackageBytes}from'./zip-package.js';export function materializeRuntimeSkill(_0x4b938b,_0xa43e9b,_0x1cc837){const _0x5ef433=a110_0x5eba,_0x3a5504=requireSkillCode(_0x4b938b),_0x21c8a6=requirePackageBytes(_0x3a5504,_0x1cc837['packageBytes']),_0x23494c=extractDownloadedPackage(_0x21c8a6),_0xbb9c8f=_0x23494c[_0x5ef433(0xa3)](_0xf59fd4=>_0xf59fd4['path']===SKILL_FILE);if(!_0xbb9c8f)throw CliErrors[_0x5ef433(0x7f)](_0x5ef433(0x98)+SKILL_FILE+':\x20'+_0x3a5504);const _0x1b1d30=withMaterializedSkillFrontmatter(_0x23494c,_0x4b938b,_0x3a5504),_0x162de4=_0x1b1d30[_0x5ef433(0xa3)](_0x22d34d=>_0x22d34d['path']===SKILL_FILE),_0x168288=fileText(_0x162de4),_0x3592cc=getRuntimeSkillDir(_0x1cc837[_0x5ef433(0x9d)],_0x1cc837[_0x5ef433(0x9a)],_0x1cc837[_0x5ef433(0x90)],_0xa43e9b,_0x3a5504,_0x1cc837[_0x5ef433(0x86)]),_0x18f659=resolve(_0x3592cc,SKILL_FILE),_0x9a1ead=resolve(_0x3592cc,METADATA_FILE),_0x326824=contentHash(_0x168288),_0x24a1d6=readMetadataIfPresent(_0x9a1ead)?.[_0x5ef433(0x85)];ensurePulledFilesCanBeOverwritten(_0x3592cc,_0x9a1ead,_0x1b1d30,_0x1cc837[_0x5ef433(0x9e)]===!![]),mkdirSync(_0x3592cc,{'recursive':!![],'mode':0x1c0});const _0x2c090d=existsSync(_0x18f659)?readFileSync(_0x18f659,_0x5ef433(0x78)):undefined;return materializeFiles(_0x3592cc,_0x1b1d30),removeStaleManagedFiles(_0x3592cc,_0x24a1d6,_0x1b1d30),writeJsonAtomic(_0x9a1ead,buildMetadata(_0x4b938b,_0xa43e9b,_0x1cc837[_0x5ef433(0x90)],_0x326824,_0x1cc837[_0x5ef433(0x8e)],_0x1b1d30,_0x21c8a6)),{'skill':_0x4b938b,'scope':_0xa43e9b,'dir':_0x3592cc,'skillMdPath':_0x18f659,'metadataPath':_0x9a1ead,'contentHash':_0x326824,'changed':_0x2c090d!==_0x168288};}function a110_0x5eba(_0x1722f0,_0x33c913){_0x1722f0=_0x1722f0-0x73;const _0x53f49f=a110_0x53f4();let _0x5eba54=_0x53f49f[_0x1722f0];return _0x5eba54;}function withMaterializedSkillFrontmatter(_0x18b4b1,_0x31c223,_0x337b09){const _0x18966f=a110_0x5eba,_0x4edaf1=skillDisplayName(_0x31c223,_0x337b09),_0x5c13b6=_0x31c223['description']?.['trim']()||_0x4edaf1||_0x337b09;return normalizeLocalFiles(_0x18b4b1)[_0x18966f(0x99)](_0x308590=>{const _0x1165c2=_0x18966f,_0x2de6e1=fileText(_0x308590);if(_0x308590[_0x1165c2(0x89)]!==SKILL_FILE)return _0x308590;if(hasYamlFrontmatter(_0x2de6e1))return{'path':_0x308590[_0x1165c2(0x89)],'content':withSyncedDisplayName(_0x2de6e1,_0x4edaf1)};return{'path':_0x308590[_0x1165c2(0x89)],'content':prependSkillFrontmatter(_0x2de6e1,{'name':_0x337b09,'displayName':_0x4edaf1,'description':_0x5c13b6})};});}function hasYamlFrontmatter(_0x58199a){const _0x21f287=a110_0x5eba;return/^\uFEFF?---\s*\r?\n/[_0x21f287(0x7b)](_0x58199a);}function prependSkillFrontmatter(_0xd10a3f,_0x58af64){const _0x33a9e0=a110_0x5eba,_0x2f18c3=_0xd10a3f[_0x33a9e0(0x92)](/^\uFEFF/,'');return['---',_0x33a9e0(0x8d)+yamlString(_0x58af64[_0x33a9e0(0x75)]),_0x58af64[_0x33a9e0(0x84)]?_0x33a9e0(0x80)+yamlString(_0x58af64['displayName']):undefined,'description:\x20'+yamlString(_0x58af64[_0x33a9e0(0xa0)]),_0x33a9e0(0x73),'',_0x2f18c3][_0x33a9e0(0x9f)](_0x19291d=>_0x19291d!==undefined)[_0x33a9e0(0xa6)]('\x0a');}function yamlString(_0x3c95ea){const _0x1d12cf=a110_0x5eba;return JSON['stringify'](_0x3c95ea[_0x1d12cf(0x92)](/\r/g,'')['trim']());}function skillDisplayName(_0xab0b93,_0xd5ce64){const _0x5ccf0f=a110_0x5eba,_0x52e8dc=_0xab0b93[_0x5ccf0f(0x97)]?.['trim']();return _0x52e8dc||_0xd5ce64;}function withSyncedDisplayName(_0x2918f1,_0x1f8db9){const _0x522fe8=a110_0x5eba,_0x429dbd=_0x2918f1[_0x522fe8(0x74)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x429dbd)return _0x2918f1;const _0x3e46fb=_0x429dbd[0x1]??'',_0x3df0e9=_0x429dbd[0x2]??'',_0x55f02e=parseDocument(_0x3df0e9);if(_0x55f02e['errors']['length']>0x0||!isMap(_0x55f02e[_0x522fe8(0x87)]))return _0x2918f1;if(_0x1f8db9)_0x55f02e[_0x522fe8(0x79)](_0x522fe8(0x84),_0x1f8db9);else{if(_0x55f02e[_0x522fe8(0x81)](_0x522fe8(0x84)))_0x55f02e[_0x522fe8(0x8f)](_0x522fe8(0x84));else return _0x2918f1;}forceBlockCollections(_0x55f02e[_0x522fe8(0x87)]);const _0x4ac1fd=_0x55f02e['toString']({'lineWidth':0x0})[_0x522fe8(0x91)](),_0xb2e414=_0x2918f1[_0x522fe8(0xa1)](_0x429dbd[0x0]['length'])['replace'](/^\r?\n/,'');return _0x3e46fb+_0x522fe8(0x7c)+_0x4ac1fd+_0x522fe8(0x76)+_0xb2e414;}function forceBlockCollections(_0x33163c){if(!isNode(_0x33163c))return;visit(_0x33163c,(_0x4c35ae,_0x305157)=>{const _0x1241f0=a110_0x5eba;isCollection(_0x305157)&&(_0x305157[_0x1241f0(0x88)]=![]);});}function ensurePulledFilesCanBeOverwritten(_0x23b772,_0x34f1c2,_0x129f00,_0x5e705b){const _0x5057e1=a110_0x5eba;if(_0x5e705b||!existsSync(_0x34f1c2))return;const _0x167f76=readMetadataIfPresent(_0x34f1c2);if(!_0x167f76)return;const _0x5e9fa7=_0x167f76[_0x5057e1(0x85)]&&Object[_0x5057e1(0xa7)](_0x167f76[_0x5057e1(0x85)])[_0x5057e1(0x9c)]>0x0?_0x167f76[_0x5057e1(0x85)]:undefined;if(_0x5e9fa7)for(const [_0x51f13e,_0x2d2629]of Object[_0x5057e1(0x93)](_0x5e9fa7)){const _0x3a58f6=resolveManagedFilePath(_0x23b772,_0x51f13e);if(!existsSync(_0x3a58f6))throw CliErrors[_0x5057e1(0x7f)](_0x5057e1(0x7e)+_0x23b772,_0x5057e1(0x94)+_0x51f13e);const _0x518f97=lstatSync(_0x3a58f6);if(!_0x518f97[_0x5057e1(0x7a)]())throw CliErrors['validation'](_0x5057e1(0x7e)+_0x23b772,_0x5057e1(0xa2)+_0x51f13e);const _0x15f102=bufferSha256(readFileSync(_0x3a58f6));if(_0x15f102!==_0x2d2629)throw CliErrors[_0x5057e1(0x7f)](_0x5057e1(0x7e)+_0x23b772+_0x5057e1(0x95)+_0x51f13e,'Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20'+_0x51f13e);}else{const _0x5693a5=resolve(_0x23b772,SKILL_FILE);if(existsSync(_0x5693a5)&&_0x167f76['contentHash']){const _0x20bda3=contentHash(readFileSync(_0x5693a5,'utf8'));if(_0x20bda3!==_0x167f76['contentHash'])throw CliErrors[_0x5057e1(0x7f)](_0x5057e1(0x7d)+_0x5693a5,_0x5057e1(0xa4));}}for(const _0x44de5b of normalizeLocalFiles(_0x129f00)){if(_0x5e9fa7?.[_0x44de5b['path']])continue;if(!_0x5e9fa7&&_0x44de5b[_0x5057e1(0x89)]===SKILL_FILE)continue;const _0x518734=resolveManagedFilePath(_0x23b772,_0x44de5b['path']);if(!existsSync(_0x518734))continue;const _0xaac74c=lstatSync(_0x518734);if(!_0xaac74c[_0x5057e1(0x7a)]())throw CliErrors[_0x5057e1(0x7f)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x23b772,'Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20'+_0x44de5b[_0x5057e1(0x89)]);const _0x1c60d4=bufferSha256(readFileSync(_0x518734));if(_0x1c60d4!==fileHash(_0x44de5b))throw CliErrors[_0x5057e1(0x7f)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x23b772,_0x5057e1(0x8c)+_0x44de5b[_0x5057e1(0x89)]);}}function materializeFiles(_0x3e64a4,_0x59c929){const _0x1c4e18=a110_0x5eba;for(const _0x3e675c of normalizeLocalFiles(_0x59c929)){const _0x13642d=resolveManagedFilePath(_0x3e64a4,_0x3e675c[_0x1c4e18(0x89)]);mkdirSync(dirname(_0x13642d),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x13642d,fileContent(_0x3e675c),0x180);}}function removeStaleManagedFiles(_0xe51b3c,_0x4b094b,_0x2a8cb1){const _0x513d19=a110_0x5eba;if(!_0x4b094b)return;const _0x55c5b9=new Set(normalizeLocalFiles(_0x2a8cb1)[_0x513d19(0x99)](_0x7813df=>_0x7813df['path']));for(const _0x3ceccc of Object[_0x513d19(0xa7)](_0x4b094b)){if(_0x55c5b9[_0x513d19(0x81)](_0x3ceccc))continue;const _0x2a0c79=resolveManagedFilePath(_0xe51b3c,_0x3ceccc);existsSync(_0x2a0c79)&&lstatSync(_0x2a0c79)[_0x513d19(0x7a)]()&&rmSync(_0x2a0c79,{'force':!![]});}}
1
+ (function(_0x5077f0,_0x248ee2){const _0x139ae1=a111_0x7c8b,_0x4fc93e=_0x5077f0();while(!![]){try{const _0x59df04=parseInt(_0x139ae1(0x11a))/0x1+parseInt(_0x139ae1(0x107))/0x2+-parseInt(_0x139ae1(0x120))/0x3+parseInt(_0x139ae1(0x118))/0x4*(-parseInt(_0x139ae1(0xee))/0x5)+-parseInt(_0x139ae1(0x11c))/0x6*(-parseInt(_0x139ae1(0xf6))/0x7)+-parseInt(_0x139ae1(0xf8))/0x8*(-parseInt(_0x139ae1(0x114))/0x9)+-parseInt(_0x139ae1(0x11f))/0xa*(parseInt(_0x139ae1(0x10a))/0xb);if(_0x59df04===_0x248ee2)break;else _0x4fc93e['push'](_0x4fc93e['shift']());}catch(_0x20fbf7){_0x4fc93e['push'](_0x4fc93e['shift']());}}}(a111_0x5a2c,0xd648e));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 a111_0x7c8b(_0x59ffc6,_0x8a6981){_0x59ffc6=_0x59ffc6-0xed;const _0x5a2ccd=a111_0x5a2c();let _0x7c8b04=_0x5a2ccd[_0x59ffc6];return _0x7c8b04;}import{resolveManagedFilePath,writeBytesAtomic,writeJsonAtomic}from'./fs-utils.js';function a111_0x5a2c(){const _0x5868b2=['description','7002PApARi','isFile','filter','120nKritp','1465197iNeWSg','skillName','replace','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','name:\x20','trim','35rLvWRZ','has','test','Managed\x20file\x20was\x20removed\x20locally:\x20','.\x20Changed\x20file:\x20','match','contentHash','appCode','9289ftRctQ','length','24waFgaw','flow','find','displayName','errors','validation','Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20','join','path','force','pulledAt','delete','name','fileHashes','toString','1043696LDcUtF','Runtime\x20Skill\x20package\x20is\x20missing\x20','accessKey','1338667zQwIOl','Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20','stringify','utf8','map','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','keys','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','---','description:\x20','3120399LUZGJJ','slice','displayName:\x20','paths','259220azJUVD','contents','169518IpWnmU'];a111_0x5a2c=function(){return _0x5868b2;};return a111_0x5a2c();}import{bufferSha256,contentHash,fileHash}from'./hashing.js';import{fileContent,fileText,normalizeLocalFiles}from'./local-files.js';import{buildMetadata,readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillDir}from'./paths.js';import{extractDownloadedPackage,requirePackageBytes}from'./zip-package.js';export function materializeRuntimeSkill(_0xe7d352,_0x4e9fe7,_0x50bc48){const _0x19c3e7=a111_0x7c8b,_0x2bd1e7=requireSkillCode(_0xe7d352),_0x6c7281=requirePackageBytes(_0x2bd1e7,_0x50bc48['packageBytes']),_0x4841f5=extractDownloadedPackage(_0x6c7281),_0x93eba7=_0x4841f5[_0x19c3e7(0xfa)](_0xae02f2=>_0xae02f2[_0x19c3e7(0x100)]===SKILL_FILE);if(!_0x93eba7)throw CliErrors[_0x19c3e7(0xfd)](_0x19c3e7(0x108)+SKILL_FILE+':\x20'+_0x2bd1e7);const _0x2eb6f7=withMaterializedSkillFrontmatter(_0x4841f5,_0xe7d352,_0x2bd1e7),_0x3427c1=_0x2eb6f7[_0x19c3e7(0xfa)](_0x393bbc=>_0x393bbc['path']===SKILL_FILE),_0x352d4e=fileText(_0x3427c1),_0x5951ba=getRuntimeSkillDir(_0x50bc48['env'],_0x50bc48[_0x19c3e7(0x109)],_0x50bc48[_0x19c3e7(0xf5)],_0x4e9fe7,_0x2bd1e7,_0x50bc48[_0x19c3e7(0x117)]),_0x44fb8d=resolve(_0x5951ba,SKILL_FILE),_0x400964=resolve(_0x5951ba,METADATA_FILE),_0x442a26=contentHash(_0x352d4e),_0x366884=readMetadataIfPresent(_0x400964)?.['fileHashes'];ensurePulledFilesCanBeOverwritten(_0x5951ba,_0x400964,_0x2eb6f7,_0x50bc48[_0x19c3e7(0x101)]===!![]),mkdirSync(_0x5951ba,{'recursive':!![],'mode':0x1c0});const _0xeb8a59=existsSync(_0x44fb8d)?readFileSync(_0x44fb8d,_0x19c3e7(0x10d)):undefined;return materializeFiles(_0x5951ba,_0x2eb6f7),removeStaleManagedFiles(_0x5951ba,_0x366884,_0x2eb6f7),writeJsonAtomic(_0x400964,buildMetadata(_0xe7d352,_0x4e9fe7,_0x50bc48[_0x19c3e7(0xf5)],_0x442a26,_0x50bc48[_0x19c3e7(0x102)],_0x2eb6f7,_0x6c7281)),{'skill':_0xe7d352,'scope':_0x4e9fe7,'dir':_0x5951ba,'skillMdPath':_0x44fb8d,'metadataPath':_0x400964,'contentHash':_0x442a26,'changed':_0xeb8a59!==_0x352d4e};}function withMaterializedSkillFrontmatter(_0x528cc1,_0x46b80c,_0x31ea14){const _0x51d9da=a111_0x7c8b,_0x20bbd6=skillDisplayName(_0x46b80c,_0x31ea14),_0x1c34e1=_0x46b80c[_0x51d9da(0x11b)]?.[_0x51d9da(0xed)]()||_0x20bbd6||_0x31ea14;return normalizeLocalFiles(_0x528cc1)['map'](_0x52e634=>{const _0x29a42b=_0x51d9da,_0x2f0ca1=fileText(_0x52e634);if(_0x52e634['path']!==SKILL_FILE)return _0x52e634;if(hasYamlFrontmatter(_0x2f0ca1))return{'path':_0x52e634['path'],'content':withSyncedDisplayName(_0x2f0ca1,_0x20bbd6)};return{'path':_0x52e634[_0x29a42b(0x100)],'content':prependSkillFrontmatter(_0x2f0ca1,{'name':_0x31ea14,'displayName':_0x20bbd6,'description':_0x1c34e1})};});}function hasYamlFrontmatter(_0x4c6c00){const _0x54be8f=a111_0x7c8b;return/^\uFEFF?---\s*\r?\n/[_0x54be8f(0xf0)](_0x4c6c00);}function prependSkillFrontmatter(_0x526260,_0x5df9e4){const _0x382ea5=a111_0x7c8b,_0x579d91=_0x526260[_0x382ea5(0x122)](/^\uFEFF/,'');return[_0x382ea5(0x112),_0x382ea5(0x124)+yamlString(_0x5df9e4[_0x382ea5(0x104)]),_0x5df9e4['displayName']?_0x382ea5(0x116)+yamlString(_0x5df9e4['displayName']):undefined,_0x382ea5(0x113)+yamlString(_0x5df9e4[_0x382ea5(0x11b)]),_0x382ea5(0x112),'',_0x579d91][_0x382ea5(0x11e)](_0x1d54d7=>_0x1d54d7!==undefined)[_0x382ea5(0xff)]('\x0a');}function yamlString(_0x1bdb22){const _0x3c3c2a=a111_0x7c8b;return JSON[_0x3c3c2a(0x10c)](_0x1bdb22[_0x3c3c2a(0x122)](/\r/g,'')[_0x3c3c2a(0xed)]());}function skillDisplayName(_0x1d7446,_0x5ca4a9){const _0x4cd44b=a111_0x7c8b,_0x18e21d=_0x1d7446[_0x4cd44b(0x121)]?.[_0x4cd44b(0xed)]();return _0x18e21d||_0x5ca4a9;}function withSyncedDisplayName(_0x272264,_0x21d61a){const _0x14d711=a111_0x7c8b,_0xedc33=_0x272264[_0x14d711(0xf3)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0xedc33)return _0x272264;const _0x3c27d9=_0xedc33[0x1]??'',_0x203151=_0xedc33[0x2]??'',_0x3d3dbc=parseDocument(_0x203151);if(_0x3d3dbc[_0x14d711(0xfc)][_0x14d711(0xf7)]>0x0||!isMap(_0x3d3dbc['contents']))return _0x272264;if(_0x21d61a)_0x3d3dbc['set']('displayName',_0x21d61a);else{if(_0x3d3dbc['has']('displayName'))_0x3d3dbc[_0x14d711(0x103)](_0x14d711(0xfb));else return _0x272264;}forceBlockCollections(_0x3d3dbc[_0x14d711(0x119)]);const _0x1e3953=_0x3d3dbc[_0x14d711(0x106)]({'lineWidth':0x0})['trimEnd'](),_0x453aa6=_0x272264[_0x14d711(0x115)](_0xedc33[0x0]['length'])[_0x14d711(0x122)](/^\r?\n/,'');return _0x3c27d9+'---\x0a'+_0x1e3953+'\x0a---\x0a\x0a'+_0x453aa6;}function forceBlockCollections(_0x2b687f){if(!isNode(_0x2b687f))return;visit(_0x2b687f,(_0x174fea,_0x5ab8ab)=>{const _0x5aa6e2=a111_0x7c8b;isCollection(_0x5ab8ab)&&(_0x5ab8ab[_0x5aa6e2(0xf9)]=![]);});}function ensurePulledFilesCanBeOverwritten(_0x4c16cf,_0x29c0be,_0x1a534b,_0xd10189){const _0x8c5e2d=a111_0x7c8b;if(_0xd10189||!existsSync(_0x29c0be))return;const _0x2c7ae5=readMetadataIfPresent(_0x29c0be);if(!_0x2c7ae5)return;const _0x15ce96=_0x2c7ae5[_0x8c5e2d(0x105)]&&Object[_0x8c5e2d(0x110)](_0x2c7ae5['fileHashes'])['length']>0x0?_0x2c7ae5[_0x8c5e2d(0x105)]:undefined;if(_0x15ce96)for(const [_0x1c7d20,_0x4a79b6]of Object['entries'](_0x15ce96)){const _0x281e4a=resolveManagedFilePath(_0x4c16cf,_0x1c7d20);if(!existsSync(_0x281e4a))throw CliErrors[_0x8c5e2d(0xfd)](_0x8c5e2d(0x10f)+_0x4c16cf,_0x8c5e2d(0xf1)+_0x1c7d20);const _0x4994bb=lstatSync(_0x281e4a);if(!_0x4994bb['isFile']())throw CliErrors[_0x8c5e2d(0xfd)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x4c16cf,_0x8c5e2d(0xfe)+_0x1c7d20);const _0x1028cf=bufferSha256(readFileSync(_0x281e4a));if(_0x1028cf!==_0x4a79b6)throw CliErrors[_0x8c5e2d(0xfd)](_0x8c5e2d(0x10f)+_0x4c16cf+_0x8c5e2d(0xf2)+_0x1c7d20,_0x8c5e2d(0x111)+_0x1c7d20);}else{const _0x5dfd2b=resolve(_0x4c16cf,SKILL_FILE);if(existsSync(_0x5dfd2b)&&_0x2c7ae5[_0x8c5e2d(0xf4)]){const _0x476f6c=contentHash(readFileSync(_0x5dfd2b,_0x8c5e2d(0x10d)));if(_0x476f6c!==_0x2c7ae5[_0x8c5e2d(0xf4)])throw CliErrors[_0x8c5e2d(0xfd)](_0x8c5e2d(0x123)+_0x5dfd2b,'Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.');}}for(const _0x2260ec of normalizeLocalFiles(_0x1a534b)){if(_0x15ce96?.[_0x2260ec['path']])continue;if(!_0x15ce96&&_0x2260ec[_0x8c5e2d(0x100)]===SKILL_FILE)continue;const _0x3f18a6=resolveManagedFilePath(_0x4c16cf,_0x2260ec[_0x8c5e2d(0x100)]);if(!existsSync(_0x3f18a6))continue;const _0xe7e054=lstatSync(_0x3f18a6);if(!_0xe7e054[_0x8c5e2d(0x11d)]())throw CliErrors[_0x8c5e2d(0xfd)](_0x8c5e2d(0x10f)+_0x4c16cf,'Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20'+_0x2260ec[_0x8c5e2d(0x100)]);const _0x3729d3=bufferSha256(readFileSync(_0x3f18a6));if(_0x3729d3!==fileHash(_0x2260ec))throw CliErrors['validation'](_0x8c5e2d(0x10f)+_0x4c16cf,_0x8c5e2d(0x10b)+_0x2260ec[_0x8c5e2d(0x100)]);}}function materializeFiles(_0x514763,_0x1c04cc){for(const _0x42e0a3 of normalizeLocalFiles(_0x1c04cc)){const _0x265376=resolveManagedFilePath(_0x514763,_0x42e0a3['path']);mkdirSync(dirname(_0x265376),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x265376,fileContent(_0x42e0a3),0x180);}}function removeStaleManagedFiles(_0x372a3b,_0xf37c7a,_0x2a4cc7){const _0x4b6b98=a111_0x7c8b;if(!_0xf37c7a)return;const _0x4c6c1e=new Set(normalizeLocalFiles(_0x2a4cc7)[_0x4b6b98(0x10e)](_0x403a33=>_0x403a33['path']));for(const _0x2a2606 of Object['keys'](_0xf37c7a)){if(_0x4c6c1e[_0x4b6b98(0xef)](_0x2a2606))continue;const _0x32c999=resolveManagedFilePath(_0x372a3b,_0x2a2606);existsSync(_0x32c999)&&lstatSync(_0x32c999)['isFile']()&&rmSync(_0x32c999,{'force':!![]});}}
@@ -1 +1 @@
1
- (function(_0x2246c5,_0xb57086){const _0x218187=a111_0x303f,_0x346a5a=_0x2246c5();while(!![]){try{const _0x40d4a4=-parseInt(_0x218187(0x18b))/0x1+-parseInt(_0x218187(0x1aa))/0x2*(parseInt(_0x218187(0x1a0))/0x3)+parseInt(_0x218187(0x18f))/0x4*(-parseInt(_0x218187(0x18e))/0x5)+-parseInt(_0x218187(0x190))/0x6*(-parseInt(_0x218187(0x189))/0x7)+-parseInt(_0x218187(0x19f))/0x8+parseInt(_0x218187(0x195))/0x9*(-parseInt(_0x218187(0x197))/0xa)+parseInt(_0x218187(0x198))/0xb;if(_0x40d4a4===_0xb57086)break;else _0x346a5a['push'](_0x346a5a['shift']());}catch(_0x564199){_0x346a5a['push'](_0x346a5a['shift']());}}}(a111_0x5013,0x56868));import{existsSync,readFileSync}from'node:fs';import{CliErrors}from'../../errors.js';function a111_0x303f(_0x49a3d9,_0x46a498){_0x49a3d9=_0x49a3d9-0x184;const _0x5013f7=a111_0x5013();let _0x303f40=_0x5013f7[_0x49a3d9];return _0x303f40;}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(_0x31d650,_0xa9cf07,_0x5efbce,_0x2f6bce,_0x109684,_0x291f6d,_0x2bf14c){const _0x3f0086=a111_0x303f,_0x10d31c=_0x291f6d?normalizeLocalFiles(_0x291f6d):[],_0x12c5b2=!_0x2bf14c&&_0x10d31c[_0x3f0086(0x1a2)]>0x0?buildSkillPackage(_0x10d31c):undefined,_0x44bb09=_0x2bf14c?bufferSha256(_0x2bf14c):_0x12c5b2?.[_0x3f0086(0x1a6)][_0x3f0086(0x18c)],_0x27751d=_0x2bf14c?.[_0x3f0086(0x1a2)]??_0x12c5b2?.[_0x3f0086(0x1a6)][_0x3f0086(0x19a)],_0x57221e=_0x10d31c['length']>0x0?Object[_0x3f0086(0x188)](_0x10d31c['map'](_0x2d0731=>[_0x2d0731[_0x3f0086(0x199)],fileHash(_0x2d0731)])):undefined;return{'schemaVersion':_0x10d31c['length']>0x0?0x2:0x1,'id':_0x31d650['id'],'appCode':_0x5efbce,'skillCode':requireSkillCode(_0x31d650),'skillName':_0x31d650[_0x3f0086(0x1a3)],'description':_0x31d650[_0x3f0086(0x193)],'scope':_0xa9cf07,'readonly':_0xa9cf07!==_0x3f0086(0x194)||_0x31d650[_0x3f0086(0x1a1)]===!![],'tenantCode':_0x31d650[_0x3f0086(0x1a4)],'userId':_0x31d650[_0x3f0086(0x186)],'version':_0x31d650['version'],'status':_0x31d650[_0x3f0086(0x19e)],'tags':Array['isArray'](_0x31d650[_0x3f0086(0x19c)])?_0x31d650[_0x3f0086(0x19c)]:[],'hasUpstreamUpdate':_0x31d650[_0x3f0086(0x184)],'forkedFromSkillId':_0x31d650['forkedFromSkillId'],'forkedFromVersion':_0x31d650[_0x3f0086(0x19d)],'sourceSessionId':_0x31d650['sourceSessionId'],'contentHash':_0x2f6bce,'fileHashes':_0x57221e,'treeHash':_0x10d31c[_0x3f0086(0x1a2)]>0x0?fileTreeHash(localFilesToManifestFiles(_0x10d31c)):undefined,'ossPath':remoteManifestOssPath(_0x31d650[_0x3f0086(0x1a7)]),'zipSha256':_0x44bb09,'zipSize':_0x27751d,'files':_0x10d31c['length']>0x0?_0x10d31c[_0x3f0086(0x191)](_0x2510a4=>({'path':_0x2510a4['path'],'hash':fileHash(_0x2510a4),'size':fileContent(_0x2510a4)[_0x3f0086(0x1a2)]})):undefined,'pulledAt':_0x109684??new Date()[_0x3f0086(0x1a9)]()};}function a111_0x5013(){const _0x2c33a6=['tenantCode','string','manifest','files','skillCode','toISOString','1121674vpiaAv','Runtime\x20Skill\x20is\x20missing\x20skillCode.','hasUpstreamUpdate','ossPath','userId','isArray','fromEntries','49xhEEUI','Invalid\x20','137508xlSbOM','zipSha256','trim','1645YDuvZN','6472YGvRjr','4506IzSXXL','map','validation','description','personal','128574AJPJhi','parse','300DsNWax','23866458JdGyWL','path','zipSize','object','tags','forkedFromVersion','status','1290240kQntuW','3TdRcey','readonly','length','skillName'];a111_0x5013=function(){return _0x2c33a6;};return a111_0x5013();}export function requireSkillCode(_0x314df3){const _0x5591e1=a111_0x303f,_0xf5c028=_0x314df3[_0x5591e1(0x1a8)]?.[_0x5591e1(0x18d)]();if(!_0xf5c028)throw CliErrors[_0x5591e1(0x192)](_0x5591e1(0x1ab));return _0xf5c028;}export function readMetadataIfPresent(_0x5c532d){const _0x217270=a111_0x303f;if(!existsSync(_0x5c532d))return undefined;try{const _0x397445=JSON[_0x217270(0x196)](readFileSync(_0x5c532d,'utf8'));return _0x397445;}catch{throw CliErrors[_0x217270(0x192)](_0x217270(0x18a)+METADATA_FILE+':\x20'+_0x5c532d);}}function remoteManifestOssPath(_0xfe6c71){const _0x4385e9=a111_0x303f;if(!_0xfe6c71||typeof _0xfe6c71!==_0x4385e9(0x19b)||Array[_0x4385e9(0x187)](_0xfe6c71))return undefined;const _0x35a1ac=_0xfe6c71[_0x4385e9(0x185)];return typeof _0x35a1ac===_0x4385e9(0x1a5)&&_0x35a1ac['trim']()?_0x35a1ac[_0x4385e9(0x18d)]():undefined;}
1
+ (function(_0x3780c2,_0x4b9f17){const _0x5d9cb1=a112_0x1d76,_0x4ef32c=_0x3780c2();while(!![]){try{const _0x4ddb75=-parseInt(_0x5d9cb1(0x1f5))/0x1*(-parseInt(_0x5d9cb1(0x1f4))/0x2)+parseInt(_0x5d9cb1(0x203))/0x3+-parseInt(_0x5d9cb1(0x1ed))/0x4*(-parseInt(_0x5d9cb1(0x1f8))/0x5)+-parseInt(_0x5d9cb1(0x1ec))/0x6+-parseInt(_0x5d9cb1(0x1fb))/0x7+parseInt(_0x5d9cb1(0x1ef))/0x8*(-parseInt(_0x5d9cb1(0x20a))/0x9)+parseInt(_0x5d9cb1(0x1f3))/0xa;if(_0x4ddb75===_0x4b9f17)break;else _0x4ef32c['push'](_0x4ef32c['shift']());}catch(_0x51ceaa){_0x4ef32c['push'](_0x4ef32c['shift']());}}}(a112_0x3aca,0x7d14c));import{existsSync,readFileSync}from'node:fs';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';function a112_0x3aca(){const _0x36352f=['2400960OSjMWD','tags','sourceSessionId','forkedFromSkillId','trim','isArray','path','20322uGiaZb','zipSha256','skillCode','string','manifest','length','2948706dSYHoK','1132bIqUJy','tenantCode','376iXDLCU','toISOString','Runtime\x20Skill\x20is\x20missing\x20skillCode.','status','1980670DqUYWQ','15502wgkyDm','57afAtpb','forkedFromVersion','readonly','8405KBhApm','hasUpstreamUpdate','fromEntries','5642056IkdXQy','personal','version','utf8','description','parse','validation','skillName'];a112_0x3aca=function(){return _0x36352f;};return a112_0x3aca();}import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';import{fileContent,normalizeLocalFiles}from'./local-files.js';import{buildSkillPackage,localFilesToManifestFiles}from'./zip-package.js';function a112_0x1d76(_0x3f15ec,_0x3fb911){_0x3f15ec=_0x3f15ec-0x1eb;const _0x3aca55=a112_0x3aca();let _0x1d766c=_0x3aca55[_0x3f15ec];return _0x1d766c;}export function buildMetadata(_0x2bbfcb,_0xad9a01,_0x14c76c,_0x4764cb,_0x350d28,_0x15d70b,_0x4f3d30){const _0x53bc23=a112_0x1d76,_0x27abd3=_0x15d70b?normalizeLocalFiles(_0x15d70b):[],_0x5c36b9=!_0x4f3d30&&_0x27abd3['length']>0x0?buildSkillPackage(_0x27abd3):undefined,_0x55e66e=_0x4f3d30?bufferSha256(_0x4f3d30):_0x5c36b9?.[_0x53bc23(0x20e)][_0x53bc23(0x20b)],_0x484318=_0x4f3d30?.[_0x53bc23(0x1eb)]??_0x5c36b9?.[_0x53bc23(0x20e)]['zipSize'],_0xe7942=_0x27abd3[_0x53bc23(0x1eb)]>0x0?Object[_0x53bc23(0x1fa)](_0x27abd3['map'](_0x298ebd=>[_0x298ebd[_0x53bc23(0x209)],fileHash(_0x298ebd)])):undefined;return{'schemaVersion':_0x27abd3[_0x53bc23(0x1eb)]>0x0?0x2:0x1,'id':_0x2bbfcb['id'],'appCode':_0x14c76c,'skillCode':requireSkillCode(_0x2bbfcb),'skillName':_0x2bbfcb[_0x53bc23(0x202)],'description':_0x2bbfcb[_0x53bc23(0x1ff)],'scope':_0xad9a01,'readonly':_0xad9a01!==_0x53bc23(0x1fc)||_0x2bbfcb[_0x53bc23(0x1f7)]===!![],'tenantCode':_0x2bbfcb[_0x53bc23(0x1ee)],'userId':_0x2bbfcb['userId'],'version':_0x2bbfcb[_0x53bc23(0x1fd)],'status':_0x2bbfcb[_0x53bc23(0x1f2)],'tags':Array[_0x53bc23(0x208)](_0x2bbfcb['tags'])?_0x2bbfcb[_0x53bc23(0x204)]:[],'hasUpstreamUpdate':_0x2bbfcb[_0x53bc23(0x1f9)],'forkedFromSkillId':_0x2bbfcb[_0x53bc23(0x206)],'forkedFromVersion':_0x2bbfcb[_0x53bc23(0x1f6)],'sourceSessionId':_0x2bbfcb[_0x53bc23(0x205)],'contentHash':_0x4764cb,'fileHashes':_0xe7942,'treeHash':_0x27abd3[_0x53bc23(0x1eb)]>0x0?fileTreeHash(localFilesToManifestFiles(_0x27abd3)):undefined,'ossPath':remoteManifestOssPath(_0x2bbfcb['files']),'zipSha256':_0x55e66e,'zipSize':_0x484318,'files':_0x27abd3[_0x53bc23(0x1eb)]>0x0?_0x27abd3['map'](_0x555b13=>({'path':_0x555b13['path'],'hash':fileHash(_0x555b13),'size':fileContent(_0x555b13)[_0x53bc23(0x1eb)]})):undefined,'pulledAt':_0x350d28??new Date()[_0x53bc23(0x1f0)]()};}export function requireSkillCode(_0x1bedbb){const _0x4c7754=a112_0x1d76,_0x39a0d8=_0x1bedbb[_0x4c7754(0x20c)]?.[_0x4c7754(0x207)]();if(!_0x39a0d8)throw CliErrors[_0x4c7754(0x201)](_0x4c7754(0x1f1));return _0x39a0d8;}export function readMetadataIfPresent(_0x1752b9){const _0x40cc04=a112_0x1d76;if(!existsSync(_0x1752b9))return undefined;try{const _0x18314d=JSON[_0x40cc04(0x200)](readFileSync(_0x1752b9,_0x40cc04(0x1fe)));return _0x18314d;}catch{throw CliErrors[_0x40cc04(0x201)]('Invalid\x20'+METADATA_FILE+':\x20'+_0x1752b9);}}function remoteManifestOssPath(_0x5102be){const _0x2c5031=a112_0x1d76;if(!_0x5102be||typeof _0x5102be!=='object'||Array[_0x2c5031(0x208)](_0x5102be))return undefined;const _0x1ae363=_0x5102be['ossPath'];return typeof _0x1ae363===_0x2c5031(0x20d)&&_0x1ae363['trim']()?_0x1ae363[_0x2c5031(0x207)]():undefined;}
@@ -1 +1 @@
1
- const a112_0x3a9dc5=a112_0x473d;(function(_0x311dcb,_0x58edec){const _0x52e76c=a112_0x473d,_0xfca7aa=_0x311dcb();while(!![]){try{const _0x38f884=parseInt(_0x52e76c(0x1bc))/0x1+-parseInt(_0x52e76c(0x1b8))/0x2+parseInt(_0x52e76c(0x1b3))/0x3+-parseInt(_0x52e76c(0x1c7))/0x4*(-parseInt(_0x52e76c(0x1b6))/0x5)+parseInt(_0x52e76c(0x1bf))/0x6+parseInt(_0x52e76c(0x1be))/0x7+-parseInt(_0x52e76c(0x1c5))/0x8;if(_0x38f884===_0x58edec)break;else _0xfca7aa['push'](_0xfca7aa['shift']());}catch(_0x1c1de2){_0xfca7aa['push'](_0xfca7aa['shift']());}}}(a112_0x415b,0x9f972));import{existsSync}from'node:fs';import{homedir}from'node:os';import{resolve}from'node:path';import{fingerprintAccessKey}from'../../commands/app/cache.js';import{PRODUCT_CONFIG,productEnv}from'../../constant/product.js';import{CliErrors}from'../../errors.js';function a112_0x415b(){const _0xe2549f=['claudeSkillsDir','892ooqTeD','includes','CLAUDE_SKILL_ROOT','validation','cache','Unsafe\x20','2691555pwHZuy','.workbuddy','SKILL_ROOT','22005IOoRWX','\x20for\x20local\x20path:\x20','1697318wTTZRF','trim','skills','.agents','829985Josslu','path\x20segment','1680546pIsBGp','3375402ufOsHX','workbuddySkillsDir','homeDirName','skillCode','agentsSkillsDir','appCode','16071176YNfdSP'];a112_0x415b=function(){return _0xe2549f;};return a112_0x415b();}export function resolveSkillSyncPaths(_0x6dd51b={}){const _0x4ba973=a112_0x473d,_0x11d91d=_0x6dd51b['homeDir']??homedir(),_0x27ac21=resolve(_0x11d91d,PRODUCT_CONFIG['homeDirName'],_0x4ba973(0x1b1)),_0x4f449c=trimmedEnv(_0x4ba973(0x1b5)),_0x5cf0c9=trimmedEnv(_0x4ba973(0x1af)),_0x422906=resolve(_0x11d91d,_0x4ba973(0x1b4)),_0xc6a9c2=_0x6dd51b[_0x4ba973(0x1c0)]??(existsSync(_0x422906)?resolve(_0x422906,'skills'):undefined);return{'homeDir':_0x11d91d,'cacheRoot':_0x27ac21,'managedRoot':resolve(_0x11d91d,PRODUCT_CONFIG[_0x4ba973(0x1c1)]),'agentsSkillsDir':_0x6dd51b[_0x4ba973(0x1c3)]??_0x4f449c??resolve(_0x11d91d,_0x4ba973(0x1bb),_0x4ba973(0x1ba)),'claudeSkillsDir':_0x6dd51b[_0x4ba973(0x1c6)]??_0x5cf0c9??resolve(_0x11d91d,'.claude',_0x4ba973(0x1ba)),'workbuddySkillsDir':_0xc6a9c2};}export function runtimeAgentSkillRoots(_0x4f1541){const _0x1b001f=a112_0x473d;return[_0x4f1541[_0x1b001f(0x1c3)],_0x4f1541[_0x1b001f(0x1c6)],_0x4f1541['workbuddySkillsDir']]['filter'](_0x59a9fa=>Boolean(_0x59a9fa));}export function getRuntimeSkillCacheRoot(_0x3bbcc6,_0x4ee6d1,_0x2939f3={}){const _0x2b2e14=a112_0x473d,_0x3b8b77=resolveSkillSyncPaths(_0x2939f3);return resolve(_0x3b8b77['cacheRoot'],_0x3bbcc6,fingerprintAccessKey(_0x4ee6d1),_0x2b2e14(0x1ba));}export function getRuntimeSkillDir(_0x5cd703,_0x53b814,_0xd54123,_0x12e945,_0x5ee102,_0x2501c4={}){const _0x269a2f=a112_0x473d;return resolve(getRuntimeSkillCacheRoot(_0x5cd703,_0x53b814,_0x2501c4),safePathSegment(_0xd54123,_0x269a2f(0x1c4)),_0x12e945,safePathSegment(_0x5ee102,_0x269a2f(0x1c2)));}function a112_0x473d(_0x1f98ff,_0x56baee){_0x1f98ff=_0x1f98ff-0x1ae;const _0x415ba6=a112_0x415b();let _0x473d43=_0x415ba6[_0x1f98ff];return _0x473d43;}export function safePathSegment(_0x23aea7,_0x7321c3=a112_0x3a9dc5(0x1bd)){const _0x1600b9=a112_0x3a9dc5;if(!_0x23aea7||_0x23aea7[_0x1600b9(0x1ae)]('/')||_0x23aea7[_0x1600b9(0x1ae)]('\x5c')||_0x23aea7[_0x1600b9(0x1ae)]('..'))throw CliErrors[_0x1600b9(0x1b0)](_0x1600b9(0x1b2)+_0x7321c3+_0x1600b9(0x1b7)+_0x23aea7);return _0x23aea7;}function trimmedEnv(_0x1a3bd3){const _0x30af9b=a112_0x3a9dc5,_0x108438=productEnv(_0x1a3bd3)?.[_0x30af9b(0x1b9)]();return _0x108438?_0x108438:undefined;}
1
+ const a113_0x1f71fa=a113_0x39f3;(function(_0x5cc67c,_0x1afec8){const _0x3bc904=a113_0x39f3,_0x425937=_0x5cc67c();while(!![]){try{const _0x3d20f0=parseInt(_0x3bc904(0x119))/0x1+-parseInt(_0x3bc904(0x12e))/0x2*(parseInt(_0x3bc904(0x130))/0x3)+-parseInt(_0x3bc904(0x11d))/0x4+parseInt(_0x3bc904(0x128))/0x5+parseInt(_0x3bc904(0x12f))/0x6+-parseInt(_0x3bc904(0x126))/0x7*(-parseInt(_0x3bc904(0x116))/0x8)+-parseInt(_0x3bc904(0x122))/0x9*(parseInt(_0x3bc904(0x11c))/0xa);if(_0x3d20f0===_0x1afec8)break;else _0x425937['push'](_0x425937['shift']());}catch(_0x10472c){_0x425937['push'](_0x425937['shift']());}}}(a113_0x4348,0xd8a95));import{existsSync}from'node:fs';function a113_0x39f3(_0x4921cc,_0x2abd36){_0x4921cc=_0x4921cc-0x116;const _0x4348e7=a113_0x4348();let _0x39f38f=_0x4348e7[_0x4921cc];return _0x39f38f;}import{homedir}from'node:os';import{resolve}from'node:path';import{fingerprintAccessKey}from'../../commands/app/cache.js';import{PRODUCT_CONFIG,productEnv}from'../../constant/product.js';import{CliErrors}from'../../errors.js';export function resolveSkillSyncPaths(_0x21978c={}){const _0xcdf171=a113_0x39f3,_0x43c906=_0x21978c[_0xcdf171(0x12a)]??homedir(),_0x42219a=resolve(_0x43c906,PRODUCT_CONFIG[_0xcdf171(0x12c)],_0xcdf171(0x118)),_0x17391a=trimmedEnv(_0xcdf171(0x125)),_0x2fd9d3=trimmedEnv(_0xcdf171(0x11b)),_0x39e496=resolve(_0x43c906,'.workbuddy'),_0x4407f7=_0x21978c[_0xcdf171(0x121)]??(existsSync(_0x39e496)?resolve(_0x39e496,_0xcdf171(0x12d)):undefined);return{'homeDir':_0x43c906,'cacheRoot':_0x42219a,'managedRoot':resolve(_0x43c906,PRODUCT_CONFIG[_0xcdf171(0x12c)]),'agentsSkillsDir':_0x21978c[_0xcdf171(0x127)]??_0x17391a??resolve(_0x43c906,_0xcdf171(0x12b),_0xcdf171(0x12d)),'claudeSkillsDir':_0x21978c['claudeSkillsDir']??_0x2fd9d3??resolve(_0x43c906,_0xcdf171(0x11f),_0xcdf171(0x12d)),'workbuddySkillsDir':_0x4407f7};}export function runtimeAgentSkillRoots(_0x26def2){const _0xf2ac1d=a113_0x39f3;return[_0x26def2[_0xf2ac1d(0x127)],_0x26def2[_0xf2ac1d(0x117)],_0x26def2['workbuddySkillsDir']][_0xf2ac1d(0x124)](_0x3db36f=>Boolean(_0x3db36f));}export function getRuntimeSkillCacheRoot(_0x1bbc44,_0x4682f1,_0x54f87f={}){const _0x4032f0=resolveSkillSyncPaths(_0x54f87f);return resolve(_0x4032f0['cacheRoot'],_0x1bbc44,fingerprintAccessKey(_0x4682f1),'skills');}export function getRuntimeSkillDir(_0x43bac0,_0x2b92be,_0x57cec7,_0x3a496f,_0x535541,_0x15a45b={}){return resolve(getRuntimeSkillCacheRoot(_0x43bac0,_0x2b92be,_0x15a45b),safePathSegment(_0x57cec7,'appCode'),_0x3a496f,safePathSegment(_0x535541,'skillCode'));}export function safePathSegment(_0x8c38c3,_0x1b4cdb=a113_0x1f71fa(0x11a)){const _0xe9683c=a113_0x1f71fa;if(!_0x8c38c3||_0x8c38c3[_0xe9683c(0x123)]('/')||_0x8c38c3[_0xe9683c(0x123)]('\x5c')||_0x8c38c3[_0xe9683c(0x123)]('..'))throw CliErrors[_0xe9683c(0x120)]('Unsafe\x20'+_0x1b4cdb+_0xe9683c(0x11e)+_0x8c38c3);return _0x8c38c3;}function trimmedEnv(_0x511e53){const _0x2a03e7=a113_0x1f71fa,_0xcb1ec9=productEnv(_0x511e53)?.[_0x2a03e7(0x129)]();return _0xcb1ec9?_0xcb1ec9:undefined;}function a113_0x4348(){const _0x3d1194=['skills','2VtvAmM','8478360ggZlRf','1658241IaCwhB','680uzSopF','claudeSkillsDir','cache','776746lwohnM','path\x20segment','CLAUDE_SKILL_ROOT','7291100eaoDWB','1492924hBvVuW','\x20for\x20local\x20path:\x20','.claude','validation','workbuddySkillsDir','36aGbYRc','includes','filter','SKILL_ROOT','78827VJskPi','agentsSkillsDir','7914360NsuyjS','trim','homeDir','.agents','homeDirName'];a113_0x4348=function(){return _0x3d1194;};return a113_0x4348();}
@@ -1 +1 @@
1
- (function(_0x1a4cd8,_0x5c3977){const _0x47bdbe=a113_0x3a6b,_0x93c4bf=_0x1a4cd8();while(!![]){try{const _0x1564f9=parseInt(_0x47bdbe(0xfd))/0x1+parseInt(_0x47bdbe(0xc8))/0x2+-parseInt(_0x47bdbe(0xd6))/0x3*(-parseInt(_0x47bdbe(0xe3))/0x4)+parseInt(_0x47bdbe(0xca))/0x5+-parseInt(_0x47bdbe(0xcb))/0x6*(parseInt(_0x47bdbe(0xf9))/0x7)+parseInt(_0x47bdbe(0xed))/0x8+-parseInt(_0x47bdbe(0x100))/0x9;if(_0x1564f9===_0x5c3977)break;else _0x93c4bf['push'](_0x93c4bf['shift']());}catch(_0x2190b3){_0x93c4bf['push'](_0x93c4bf['shift']());}}}(a113_0x4bcb,0x527e0));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';function a113_0x4bcb(){const _0x3fcb69=['filter','find','skillCode','74412IDsoGS','sourceSessionId','1040505luScHB','1614UgkZQc','\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22','metadata','tags','skillName','ignoreInvalidMetadata','isFile','isDirectory','unknown','content','validation','508443xCqbZp','\x20has\x20scope=\x22','ignoreMetadataSkillCode','replace','ignoreMetadataScope','description','\x20has\x20unsupported\x20scope\x20\x22','personal','dir','\x20to\x20submit\x20company\x20Skills\x20for\x20review.','trim','scope','allowAppCodeRetarget','4TmtQoE','ignoreMetadataAppCodeMismatch','toLowerCase','isArray','boolean','number','Remote\x20Skill\x20','company','pushedAt','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20','2093144GcmToT','length','utf8','displayName','name','Invalid\x20','match','manifest','ignoreMetadataForPayload','appCode','path','Skill\x20directory\x20not\x20found:\x20','5866cNUrbV','object','builtin','Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20','55327ZEOEOt','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20','Missing\x20','1516032WysoXC','startsWith'];a113_0x4bcb=function(){return _0x3fcb69;};return a113_0x4bcb();}import{basename,resolve}from'node:path';import{parse as a113_0x297e0f}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(_0x1b2154,_0x226f58,_0x1befa4={}){const _0x15a2ce=a113_0x3a6b,_0x59be05=resolvePushDirectoryRoot(_0x1b2154),_0x5caefb=readPushMetadataIfPresent(resolve(_0x59be05,METADATA_FILE),{'ignoreInvalidMetadata':_0x1befa4[_0x15a2ce(0xd0)]});if(_0x5caefb?.[_0x15a2ce(0xf6)]&&_0x5caefb[_0x15a2ce(0xf6)]!==_0x226f58&&!_0x1befa4[_0x15a2ce(0xe2)]&&!_0x1befa4[_0x15a2ce(0xe4)])throw CliErrors[_0x15a2ce(0xd5)]('Skill\x20metadata\x20appCode\x20\x22'+_0x5caefb['appCode']+_0x15a2ce(0xcc)+_0x226f58+'\x22.');const _0x12a3a2=resolvePushSkillCode(_0x59be05,_0x226f58,_0x5caefb,_0x1befa4);if(!_0x12a3a2)throw CliErrors[_0x15a2ce(0xd5)]('Unable\x20to\x20resolve\x20skillCode\x20from\x20'+SKILL_FILE+',\x20'+METADATA_FILE+',\x20or\x20directory\x20name.');return{'dir':_0x59be05,'skillCode':_0x12a3a2,'metadata':_0x5caefb};}export function readPushDirectory(_0x3ce7fe,_0xfec15,_0x4557e4={}){const _0x426893=a113_0x3a6b,_0x247831=resolvePushDirectoryIdentity(_0x3ce7fe,_0xfec15,_0x4557e4),_0x9cd239=_0x247831[_0x426893(0xde)],_0x51d600=resolve(_0x9cd239,SKILL_FILE);if(!existsSync(_0x51d600)||!lstatSync(_0x51d600)[_0x426893(0xd1)]())throw CliErrors[_0x426893(0xd5)](_0x426893(0xff)+SKILL_FILE+':\x20'+_0x51d600);const _0x2f4d65=_0x247831[_0x426893(0xcd)],_0x1b4efc=_0x4557e4['targetScope']??_0x426893(0xdd);if(!_0x4557e4[_0x426893(0xda)]&&_0x2f4d65?.[_0x426893(0xe1)]===_0x426893(0xfb))throw CliErrors[_0x426893(0xd5)](_0x426893(0xfc)+METADATA_FILE+_0x426893(0xd7)+_0x2f4d65[_0x426893(0xe1)]+'\x22.');if(!_0x4557e4[_0x426893(0xda)]&&_0x1b4efc==='personal'&&_0x2f4d65?.['scope']&&_0x2f4d65[_0x426893(0xe1)]!==_0x426893(0xdd))throw CliErrors['validation'](_0x426893(0xec)+METADATA_FILE+_0x426893(0xd7)+_0x2f4d65[_0x426893(0xe1)]+'\x22.',_0x426893(0xfe)+_0x9cd239+_0x426893(0xdf));const _0x533d05=scanSkillDirectory(_0x9cd239),_0x19a507=buildSkillPackage(_0x533d05),_0x4ede5f=readFileSync(_0x51d600,_0x426893(0xef)),_0x292e5b=_0x247831[_0x426893(0xc7)],_0x171a1e=_0x4557e4[_0x426893(0xf5)]?undefined:_0x2f4d65,_0x49dc0c=readSkillDisplayName(_0x4ede5f);return{'skillCode':_0x292e5b,'metadata':_0x2f4d65,'frontmatterDisplayName':_0x49dc0c,'input':{'skillCode':_0x292e5b,'skillName':_0x49dc0c??_0x171a1e?.['skillName'],'description':_0x171a1e?.[_0x426893(0xdb)],'content':_0x4ede5f,'files':_0x19a507[_0x426893(0xf4)],'packageBase64':_0x19a507['packageBase64'],'tags':_0x171a1e?.[_0x426893(0xce)],'version':_0x171a1e?.['version'],'sourceSessionId':_0x171a1e?.['sourceSessionId']}};}export function refreshPushDirectoryMetadataFromRemote(_0x3c6402,_0x378599,_0x427049,_0x3d98e4={}){const _0x4342b5=a113_0x3a6b,_0xe38e39=resolvePushDirectoryRoot(_0x3c6402),_0x3b36f2=readPushMetadataIfPresent(resolve(_0xe38e39,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x58e38a=requireRemoteScope(_0x378599),_0x28ecfd=readLocalSkillContent(_0xe38e39),_0x208ff1={..._0x378599,'appCode':_0x378599[_0x4342b5(0xf6)]??_0x427049,'skillName':_0x378599[_0x4342b5(0xcf)]??_0x3b36f2?.[_0x4342b5(0xcf)],'description':_0x378599[_0x4342b5(0xdb)]??_0x3b36f2?.['description'],'tags':Array[_0x4342b5(0xe6)](_0x378599[_0x4342b5(0xce)])?_0x378599[_0x4342b5(0xce)]:_0x3b36f2?.[_0x4342b5(0xce)],'sourceSessionId':_0x378599[_0x4342b5(0xc9)]??_0x3b36f2?.[_0x4342b5(0xc9)],'content':_0x378599[_0x4342b5(0xd4)]??_0x28ecfd},_0x50134f=buildMetadata(_0x208ff1,_0x58e38a,_0x427049,contentHash(_0x28ecfd),_0x3d98e4['refreshedAt']);writeJsonAtomic(resolve(_0xe38e39,METADATA_FILE),_0x50134f);}export function recordPushedRuntimeSkill(_0xea2506,_0x4cfde2,_0x4361da,_0x3637bf={}){const _0x1c1c84=a113_0x3a6b,_0x1da145=resolvePushDirectoryRoot(_0xea2506),_0x3a8bff=scanSkillDirectory(_0x1da145),_0x3cdd20=_0x3a8bff[_0x1c1c84(0xc6)](_0x20acc5=>_0x20acc5[_0x1c1c84(0xf7)]===SKILL_FILE),_0x9d8f24=_0x3cdd20?fileText(_0x3cdd20):'',_0x503bef=tryNormalizePackageManifest(_0x4cfde2['files']),_0x40c352={..._0x4cfde2,'content':_0x4cfde2[_0x1c1c84(0xd4)]??_0x9d8f24,'files':_0x503bef},_0x5ec78a=_0x503bef?normalizeLocalFiles(_0x3a8bff)[_0x1c1c84(0xc5)](_0x1b8a2f=>_0x503bef['files']['some'](_0x596cbd=>_0x596cbd['path']===_0x1b8a2f[_0x1c1c84(0xf7)])):undefined,_0x33e272=buildMetadata(_0x40c352,_0x3637bf[_0x1c1c84(0xe1)]??'personal',_0x4361da,contentHash(_0x40c352[_0x1c1c84(0xd4)]??''),_0x3637bf[_0x1c1c84(0xeb)],_0x5ec78a);writeJsonAtomic(resolve(_0x1da145,METADATA_FILE),_0x33e272);}export function deriveSkillCodeFromDirectory(_0x4ffe15,_0x3d6d13){const _0x1f80ed=a113_0x3a6b,_0x3daa4c=basename(resolve(_0x4ffe15)),_0x5bb0a5=_0x3d6d13+'--';return _0x3daa4c[_0x1f80ed(0xc4)](_0x5bb0a5)?_0x3daa4c['slice'](_0x5bb0a5[_0x1f80ed(0xee)]):_0x3daa4c;}function resolvePushSkillCode(_0x37e069,_0xe9e033,_0x45af13,_0x22242c){const _0x565f00=a113_0x3a6b,_0x540f79=deriveSkillCodeFromSkillFile(_0x37e069)||deriveSkillCodeFromDirectory(_0x37e069,_0xe9e033);if(_0x22242c[_0x565f00(0xd8)])return _0x540f79;return _0x45af13?.['skillCode']?.[_0x565f00(0xe0)]()||_0x540f79;}function deriveSkillCodeFromSkillFile(_0x5d9e9b){const _0x5160fc=a113_0x3a6b,_0x5de0aa=resolve(_0x5d9e9b,SKILL_FILE);if(!existsSync(_0x5de0aa)||!lstatSync(_0x5de0aa)[_0x5160fc(0xd1)]())return undefined;const _0xe09433=readFileSync(_0x5de0aa,'utf8'),_0x56b8d3=_0xe09433[_0x5160fc(0xf3)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x56b8d3)return undefined;const _0x2dd36b=parseFrontmatterObject(_0x56b8d3[0x1]??''),_0x32bdb9=scalarToString(_0x2dd36b?.[_0x5160fc(0xf1)]);return _0x32bdb9?slugifySkillName(_0x32bdb9):undefined;}function readSkillDisplayName(_0xae6b6a){const _0x30c493=a113_0x3a6b,_0x4fca5c=_0xae6b6a['match'](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x4fca5c)return undefined;const _0x5f4434=parseFrontmatterObject(_0x4fca5c[0x1]??'');return scalarToString(_0x5f4434?.[_0x30c493(0xf0)]);}function slugifySkillName(_0x1e0a81){const _0x17fb56=a113_0x3a6b,_0x2fd1fb=_0x1e0a81[_0x17fb56(0xe0)]()[_0x17fb56(0xe5)]()['replace'](/[^\p{L}\p{N}\p{So}]+/gu,'-')[_0x17fb56(0xd9)](/^-+/,'')['replace'](/-+$/,'')['replace'](/-{2,}/g,'-');if(!_0x2fd1fb)throw CliErrors[_0x17fb56(0xd5)](_0x17fb56(0xf2)+SKILL_FILE+'\x20name\x20for\x20SkillHub\x20slug\x20generation.');return _0x2fd1fb;}function parseFrontmatterObject(_0x1207f1){const _0x38954c=a113_0x3a6b;try{const _0x1d899d=a113_0x297e0f(_0x1207f1);return _0x1d899d&&typeof _0x1d899d===_0x38954c(0xfa)&&!Array['isArray'](_0x1d899d)?_0x1d899d:undefined;}catch{return undefined;}}function a113_0x3a6b(_0xf55fab,_0x3738cd){_0xf55fab=_0xf55fab-0xc4;const _0x4bcb33=a113_0x4bcb();let _0x3a6b9b=_0x4bcb33[_0xf55fab];return _0x3a6b9b;}function scalarToString(_0x59a3d1){const _0x271965=a113_0x3a6b;if(typeof _0x59a3d1==='string')return _0x59a3d1[_0x271965(0xe0)]();if(typeof _0x59a3d1===_0x271965(0xe8)||typeof _0x59a3d1===_0x271965(0xe7))return String(_0x59a3d1);return undefined;}function resolvePushDirectoryRoot(_0x5d58db){const _0x623660=a113_0x3a6b,_0xb612f=resolve(_0x5d58db);if(!existsSync(_0xb612f))throw CliErrors[_0x623660(0xd5)](_0x623660(0xf8)+_0x5d58db);const _0xe4e4fa=lstatSync(_0xb612f);if(_0xe4e4fa[_0x623660(0xd2)]())return _0xb612f;if(_0xe4e4fa['isSymbolicLink']()){const _0x2b392a=realpathSync(_0xb612f);if(lstatSync(_0x2b392a)[_0x623660(0xd2)]())return _0x2b392a;}throw CliErrors[_0x623660(0xd5)](_0x623660(0xf8)+_0x5d58db);}function requireRemoteScope(_0x28a343){const _0x509041=a113_0x3a6b;if(_0x28a343['scope']===_0x509041(0xdd)||_0x28a343[_0x509041(0xe1)]===_0x509041(0xea)||_0x28a343[_0x509041(0xe1)]==='builtin')return _0x28a343[_0x509041(0xe1)];throw CliErrors[_0x509041(0xd5)](_0x509041(0xe9)+(_0x28a343[_0x509041(0xc7)]||'(unknown)')+_0x509041(0xdc)+(_0x28a343[_0x509041(0xe1)]??_0x509041(0xd3))+'\x22.');}function readLocalSkillContent(_0x5aa302){const _0x5e04fa=a113_0x3a6b,_0x1470ff=resolve(_0x5aa302,SKILL_FILE);return existsSync(_0x1470ff)&&lstatSync(_0x1470ff)['isFile']()?readFileSync(_0x1470ff,_0x5e04fa(0xef)):'';}function readPushMetadataIfPresent(_0x1a4e06,_0x384563={}){try{return readMetadataIfPresent(_0x1a4e06);}catch(_0x3dd7f3){if(_0x384563['ignoreInvalidMetadata'])return undefined;throw _0x3dd7f3;}}
1
+ function a114_0x4d45(_0x46ba71,_0xb3fddb){_0x46ba71=_0x46ba71-0x108;const _0x12a995=a114_0x12a9();let _0x4d4563=_0x12a995[_0x46ba71];return _0x4d4563;}(function(_0x4bb533,_0x1111d7){const _0x3af7d3=a114_0x4d45,_0x347718=_0x4bb533();while(!![]){try{const _0x22624e=-parseInt(_0x3af7d3(0x119))/0x1+-parseInt(_0x3af7d3(0x12f))/0x2*(parseInt(_0x3af7d3(0x11d))/0x3)+-parseInt(_0x3af7d3(0x12b))/0x4+-parseInt(_0x3af7d3(0x13e))/0x5+parseInt(_0x3af7d3(0x139))/0x6+parseInt(_0x3af7d3(0x114))/0x7+parseInt(_0x3af7d3(0x118))/0x8*(parseInt(_0x3af7d3(0x113))/0x9);if(_0x22624e===_0x1111d7)break;else _0x347718['push'](_0x347718['shift']());}catch(_0x33c4a4){_0x347718['push'](_0x347718['shift']());}}}(a114_0x12a9,0x2ad9b));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a114_0x3e5aae}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(_0x4cbeff,_0x12234f,_0x1335c5={}){const _0x5ab105=a114_0x4d45,_0x3fc762=resolvePushDirectoryRoot(_0x4cbeff),_0x376803=readPushMetadataIfPresent(resolve(_0x3fc762,METADATA_FILE),{'ignoreInvalidMetadata':_0x1335c5[_0x5ab105(0x13b)]});if(_0x376803?.['appCode']&&_0x376803['appCode']!==_0x12234f&&!_0x1335c5[_0x5ab105(0x132)]&&!_0x1335c5[_0x5ab105(0x11b)])throw CliErrors[_0x5ab105(0x129)](_0x5ab105(0x13d)+_0x376803[_0x5ab105(0x120)]+'\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22'+_0x12234f+'\x22.');const _0x54eb4a=resolvePushSkillCode(_0x3fc762,_0x12234f,_0x376803,_0x1335c5);if(!_0x54eb4a)throw CliErrors['validation']('Unable\x20to\x20resolve\x20skillCode\x20from\x20'+SKILL_FILE+',\x20'+METADATA_FILE+_0x5ab105(0x125));return{'dir':_0x3fc762,'skillCode':_0x54eb4a,'metadata':_0x376803};}export function readPushDirectory(_0x319740,_0x32d265,_0x2419ff={}){const _0x245f83=a114_0x4d45,_0xe00dfd=resolvePushDirectoryIdentity(_0x319740,_0x32d265,_0x2419ff),_0x378643=_0xe00dfd['dir'],_0xf0521b=resolve(_0x378643,SKILL_FILE);if(!existsSync(_0xf0521b)||!lstatSync(_0xf0521b)[_0x245f83(0x11f)]())throw CliErrors[_0x245f83(0x129)](_0x245f83(0x115)+SKILL_FILE+':\x20'+_0xf0521b);const _0x339c3c=_0xe00dfd[_0x245f83(0x131)],_0x933df9=_0x2419ff['targetScope']??'personal';if(!_0x2419ff['ignoreMetadataScope']&&_0x339c3c?.[_0x245f83(0x13a)]==='builtin')throw CliErrors[_0x245f83(0x129)](_0x245f83(0x108)+METADATA_FILE+'\x20has\x20scope=\x22'+_0x339c3c[_0x245f83(0x13a)]+'\x22.');if(!_0x2419ff[_0x245f83(0x13c)]&&_0x933df9===_0x245f83(0x124)&&_0x339c3c?.['scope']&&_0x339c3c[_0x245f83(0x13a)]!==_0x245f83(0x124))throw CliErrors[_0x245f83(0x129)](_0x245f83(0x128)+METADATA_FILE+_0x245f83(0x109)+_0x339c3c[_0x245f83(0x13a)]+'\x22.',_0x245f83(0x145)+_0x378643+_0x245f83(0x10f));const _0x4725b5=scanSkillDirectory(_0x378643),_0x282cb7=buildSkillPackage(_0x4725b5),_0x176077=readFileSync(_0xf0521b,_0x245f83(0x10d)),_0x3a3000=_0xe00dfd[_0x245f83(0x117)],_0x139436=_0x2419ff[_0x245f83(0x142)]?undefined:_0x339c3c,_0x106389=readSkillDisplayName(_0x176077);return{'skillCode':_0x3a3000,'metadata':_0x339c3c,'frontmatterDisplayName':_0x106389,'input':{'skillCode':_0x3a3000,'skillName':_0x106389??_0x139436?.['skillName'],'description':_0x139436?.[_0x245f83(0x112)],'content':_0x176077,'files':_0x282cb7[_0x245f83(0x137)],'packageBase64':_0x282cb7[_0x245f83(0x10c)],'tags':_0x139436?.[_0x245f83(0x140)],'version':_0x139436?.[_0x245f83(0x121)],'sourceSessionId':_0x139436?.[_0x245f83(0x110)]}};}function a114_0x12a9(){const _0x13acd2=['pushedAt','filter','718ReCfbu','find','metadata','allowAppCodeRetarget','builtin','displayName','isSymbolicLink','path','manifest','startsWith','1290918znszQZ','scope','ignoreInvalidMetadata','ignoreMetadataScope','Skill\x20metadata\x20appCode\x20\x22','1402050WZaXqC','number','tags','skillName','ignoreMetadataForPayload','isArray','isDirectory','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20','Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20','\x20has\x20scope=\x22','replace','Skill\x20directory\x20not\x20found:\x20','packageBase64','utf8','slice','\x20to\x20submit\x20company\x20Skills\x20for\x20review.','sourceSessionId','files','description','297NFiuaH','2159094ZgZmsj','Missing\x20','(unknown)','skillCode','73920vUdMnG','10362nzLBwn','ignoreMetadataSkillCode','ignoreMetadataAppCodeMismatch','name','2235wuKiSf','trim','isFile','appCode','version','Remote\x20Skill\x20','content','personal',',\x20or\x20directory\x20name.','\x20name\x20for\x20SkillHub\x20slug\x20generation.','company','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20','validation','object','379092fIaxIZ','\x20has\x20unsupported\x20scope\x20\x22'];a114_0x12a9=function(){return _0x13acd2;};return a114_0x12a9();}export function refreshPushDirectoryMetadataFromRemote(_0x170476,_0xfda6e4,_0x54c62f,_0x422c7c={}){const _0x1fdeed=a114_0x4d45,_0x521e12=resolvePushDirectoryRoot(_0x170476),_0x55dc8b=readPushMetadataIfPresent(resolve(_0x521e12,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x3cb55b=requireRemoteScope(_0xfda6e4),_0x1b48f0=readLocalSkillContent(_0x521e12),_0x504fcd={..._0xfda6e4,'appCode':_0xfda6e4[_0x1fdeed(0x120)]??_0x54c62f,'skillName':_0xfda6e4[_0x1fdeed(0x141)]??_0x55dc8b?.[_0x1fdeed(0x141)],'description':_0xfda6e4[_0x1fdeed(0x112)]??_0x55dc8b?.['description'],'tags':Array[_0x1fdeed(0x143)](_0xfda6e4[_0x1fdeed(0x140)])?_0xfda6e4[_0x1fdeed(0x140)]:_0x55dc8b?.[_0x1fdeed(0x140)],'sourceSessionId':_0xfda6e4[_0x1fdeed(0x110)]??_0x55dc8b?.[_0x1fdeed(0x110)],'content':_0xfda6e4['content']??_0x1b48f0},_0x50d04c=buildMetadata(_0x504fcd,_0x3cb55b,_0x54c62f,contentHash(_0x1b48f0),_0x422c7c['refreshedAt']);writeJsonAtomic(resolve(_0x521e12,METADATA_FILE),_0x50d04c);}export function recordPushedRuntimeSkill(_0x14ca02,_0x2790da,_0xa5eacb,_0x5148e6={}){const _0x44ff2c=a114_0x4d45,_0x268807=resolvePushDirectoryRoot(_0x14ca02),_0x5c54b2=scanSkillDirectory(_0x268807),_0x35f0b9=_0x5c54b2[_0x44ff2c(0x130)](_0xdb9cd2=>_0xdb9cd2[_0x44ff2c(0x136)]===SKILL_FILE),_0x46391b=_0x35f0b9?fileText(_0x35f0b9):'',_0x5ad184=tryNormalizePackageManifest(_0x2790da['files']),_0xb027fc={..._0x2790da,'content':_0x2790da[_0x44ff2c(0x123)]??_0x46391b,'files':_0x5ad184},_0x5da141=_0x5ad184?normalizeLocalFiles(_0x5c54b2)[_0x44ff2c(0x12e)](_0x450ed7=>_0x5ad184[_0x44ff2c(0x111)]['some'](_0xeb6b97=>_0xeb6b97[_0x44ff2c(0x136)]===_0x450ed7[_0x44ff2c(0x136)])):undefined,_0x2d1981=buildMetadata(_0xb027fc,_0x5148e6[_0x44ff2c(0x13a)]??'personal',_0xa5eacb,contentHash(_0xb027fc[_0x44ff2c(0x123)]??''),_0x5148e6[_0x44ff2c(0x12d)],_0x5da141);writeJsonAtomic(resolve(_0x268807,METADATA_FILE),_0x2d1981);}export function deriveSkillCodeFromDirectory(_0x44c210,_0x31d8d4){const _0x213175=a114_0x4d45,_0x2626f8=basename(resolve(_0x44c210)),_0xad369c=_0x31d8d4+'--';return _0x2626f8[_0x213175(0x138)](_0xad369c)?_0x2626f8[_0x213175(0x10e)](_0xad369c['length']):_0x2626f8;}function resolvePushSkillCode(_0x79bd02,_0x297fd5,_0x26ba21,_0x13ee25){const _0x1e3025=a114_0x4d45,_0x2cec76=deriveSkillCodeFromSkillFile(_0x79bd02)||deriveSkillCodeFromDirectory(_0x79bd02,_0x297fd5);if(_0x13ee25[_0x1e3025(0x11a)])return _0x2cec76;return _0x26ba21?.[_0x1e3025(0x117)]?.['trim']()||_0x2cec76;}function deriveSkillCodeFromSkillFile(_0x87d3b6){const _0x17eba6=a114_0x4d45,_0x36fe7f=resolve(_0x87d3b6,SKILL_FILE);if(!existsSync(_0x36fe7f)||!lstatSync(_0x36fe7f)['isFile']())return undefined;const _0x2965a8=readFileSync(_0x36fe7f,'utf8'),_0x34a340=_0x2965a8['match'](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x34a340)return undefined;const _0x354402=parseFrontmatterObject(_0x34a340[0x1]??''),_0x32de53=scalarToString(_0x354402?.[_0x17eba6(0x11c)]);return _0x32de53?slugifySkillName(_0x32de53):undefined;}function readSkillDisplayName(_0x310522){const _0x57221a=a114_0x4d45,_0x354038=_0x310522['match'](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x354038)return undefined;const _0x4ac04b=parseFrontmatterObject(_0x354038[0x1]??'');return scalarToString(_0x4ac04b?.[_0x57221a(0x134)]);}function slugifySkillName(_0x2c133f){const _0x474ae6=a114_0x4d45,_0x3b356f=_0x2c133f[_0x474ae6(0x11e)]()['toLowerCase']()[_0x474ae6(0x10a)](/[^\p{L}\p{N}\p{So}]+/gu,'-')[_0x474ae6(0x10a)](/^-+/,'')[_0x474ae6(0x10a)](/-+$/,'')[_0x474ae6(0x10a)](/-{2,}/g,'-');if(!_0x3b356f)throw CliErrors['validation']('Invalid\x20'+SKILL_FILE+_0x474ae6(0x126));return _0x3b356f;}function parseFrontmatterObject(_0x206209){const _0x5b594a=a114_0x4d45;try{const _0x172978=a114_0x3e5aae(_0x206209);return _0x172978&&typeof _0x172978===_0x5b594a(0x12a)&&!Array[_0x5b594a(0x143)](_0x172978)?_0x172978:undefined;}catch{return undefined;}}function scalarToString(_0x55bd38){const _0x56933b=a114_0x4d45;if(typeof _0x55bd38==='string')return _0x55bd38[_0x56933b(0x11e)]();if(typeof _0x55bd38===_0x56933b(0x13f)||typeof _0x55bd38==='boolean')return String(_0x55bd38);return undefined;}function resolvePushDirectoryRoot(_0xc2d204){const _0x52c0cc=a114_0x4d45,_0x2dc1f3=resolve(_0xc2d204);if(!existsSync(_0x2dc1f3))throw CliErrors['validation']('Skill\x20directory\x20not\x20found:\x20'+_0xc2d204);const _0x1e2464=lstatSync(_0x2dc1f3);if(_0x1e2464['isDirectory']())return _0x2dc1f3;if(_0x1e2464[_0x52c0cc(0x135)]()){const _0x17ea44=realpathSync(_0x2dc1f3);if(lstatSync(_0x17ea44)[_0x52c0cc(0x144)]())return _0x17ea44;}throw CliErrors[_0x52c0cc(0x129)](_0x52c0cc(0x10b)+_0xc2d204);}function requireRemoteScope(_0x5d6fde){const _0xda969=a114_0x4d45;if(_0x5d6fde[_0xda969(0x13a)]===_0xda969(0x124)||_0x5d6fde[_0xda969(0x13a)]===_0xda969(0x127)||_0x5d6fde[_0xda969(0x13a)]===_0xda969(0x133))return _0x5d6fde[_0xda969(0x13a)];throw CliErrors[_0xda969(0x129)](_0xda969(0x122)+(_0x5d6fde[_0xda969(0x117)]||_0xda969(0x116))+_0xda969(0x12c)+(_0x5d6fde[_0xda969(0x13a)]??'unknown')+'\x22.');}function readLocalSkillContent(_0x45b993){const _0xe5c957=a114_0x4d45,_0x488b24=resolve(_0x45b993,SKILL_FILE);return existsSync(_0x488b24)&&lstatSync(_0x488b24)[_0xe5c957(0x11f)]()?readFileSync(_0x488b24,_0xe5c957(0x10d)):'';}function readPushMetadataIfPresent(_0x53a420,_0x33116b={}){try{return readMetadataIfPresent(_0x53a420);}catch(_0x57fdd1){if(_0x33116b['ignoreInvalidMetadata'])return undefined;throw _0x57fdd1;}}
@@ -1 +1 @@
1
- (function(_0x5cf307,_0x2314d9){const _0x31cd48=a114_0x4549,_0x590fc7=_0x5cf307();while(!![]){try{const _0x2e2c86=-parseInt(_0x31cd48(0x153))/0x1+-parseInt(_0x31cd48(0x156))/0x2+-parseInt(_0x31cd48(0x150))/0x3+parseInt(_0x31cd48(0x15a))/0x4*(parseInt(_0x31cd48(0x159))/0x5)+parseInt(_0x31cd48(0x151))/0x6*(parseInt(_0x31cd48(0x15c))/0x7)+parseInt(_0x31cd48(0x15e))/0x8*(-parseInt(_0x31cd48(0x157))/0x9)+-parseInt(_0x31cd48(0x15d))/0xa*(-parseInt(_0x31cd48(0x154))/0xb);if(_0x2e2c86===_0x2314d9)break;else _0x590fc7['push'](_0x590fc7['shift']());}catch(_0x3d7969){_0x590fc7['push'](_0x590fc7['shift']());}}}(a114_0x3f1c,0xc3146));function a114_0x3f1c(){const _0x25c9fa=['builtin','345425KCTUrZ','20QhljPe','includes','28bJJPFG','8868030HpFpqr','392JZTAkG','personal','1213701eraJcU','1816272zKsIdt','validation','1102762KYGwFw','33ydgZxJ','company','2364824NCHTVc','133695WmwRPL'];a114_0x3f1c=function(){return _0x25c9fa;};return a114_0x3f1c();}function a114_0x4549(_0x2ae84d,_0xb09c42){_0x2ae84d=_0x2ae84d-0x150;const _0x3f1ca9=a114_0x3f1c();let _0x454961=_0x3f1ca9[_0x2ae84d];return _0x454961;}import{CliErrors}from'../../errors.js';export function normalizeRuntimeSkillScopes(_0x324b32){const _0x237f12=a114_0x4549,_0x180ea2=_0x324b32&&_0x324b32['length']>0x0?_0x324b32:[_0x237f12(0x15f),_0x237f12(0x155),_0x237f12(0x158)],_0x462eef=[];for(const _0x1806a5 of _0x180ea2){if(!isRuntimeSkillScope(_0x1806a5))throw CliErrors[_0x237f12(0x152)]('Unsupported\x20runtime\x20Skill\x20scope:\x20'+_0x1806a5);!_0x462eef[_0x237f12(0x15b)](_0x1806a5)&&_0x462eef['push'](_0x1806a5);}return _0x462eef;}export function isRuntimeSkillScope(_0x4ffe21){const _0x5cd691=a114_0x4549;return _0x4ffe21==='personal'||_0x4ffe21===_0x5cd691(0x155)||_0x4ffe21===_0x5cd691(0x158);}
1
+ function a115_0x26fb(_0x503db7,_0x5ca837){_0x503db7=_0x503db7-0x1cc;const _0x558527=a115_0x5585();let _0x26fb32=_0x558527[_0x503db7];return _0x26fb32;}(function(_0x1c7ff7,_0x203f4c){const _0xb91cc6=a115_0x26fb,_0xac7686=_0x1c7ff7();while(!![]){try{const _0xaac5cd=-parseInt(_0xb91cc6(0x1db))/0x1+-parseInt(_0xb91cc6(0x1da))/0x2*(parseInt(_0xb91cc6(0x1d0))/0x3)+parseInt(_0xb91cc6(0x1cc))/0x4*(parseInt(_0xb91cc6(0x1d8))/0x5)+parseInt(_0xb91cc6(0x1d1))/0x6+-parseInt(_0xb91cc6(0x1d9))/0x7+parseInt(_0xb91cc6(0x1d3))/0x8+parseInt(_0xb91cc6(0x1cd))/0x9;if(_0xaac5cd===_0x203f4c)break;else _0xac7686['push'](_0xac7686['shift']());}catch(_0x55ea8b){_0xac7686['push'](_0xac7686['shift']());}}}(a115_0x5585,0xb7532));import{CliErrors}from'../../errors.js';export function normalizeRuntimeSkillScopes(_0x5ee2ab){const _0x150f6c=a115_0x26fb,_0x52f53b=_0x5ee2ab&&_0x5ee2ab[_0x150f6c(0x1d6)]>0x0?_0x5ee2ab:[_0x150f6c(0x1d7),_0x150f6c(0x1d4),_0x150f6c(0x1ce)],_0x433efa=[];for(const _0x37623e of _0x52f53b){if(!isRuntimeSkillScope(_0x37623e))throw CliErrors[_0x150f6c(0x1d5)](_0x150f6c(0x1d2)+_0x37623e);!_0x433efa[_0x150f6c(0x1cf)](_0x37623e)&&_0x433efa['push'](_0x37623e);}return _0x433efa;}function a115_0x5585(){const _0x54bac0=['Unsupported\x20runtime\x20Skill\x20scope:\x20','138960uZKvRo','company','validation','length','personal','784645jzQPIB','4663232xDxHHE','39038qDeIyV','443869uIzzuy','12zgVYWi','9444879mOisfa','builtin','includes','18LBmXzI','2642814ThzxvK'];a115_0x5585=function(){return _0x54bac0;};return a115_0x5585();}export function isRuntimeSkillScope(_0x5e8f04){const _0x15d856=a115_0x26fb;return _0x5e8f04===_0x15d856(0x1d7)||_0x5e8f04===_0x15d856(0x1d4)||_0x5e8f04===_0x15d856(0x1ce);}
@@ -1 +1 @@
1
- function a116_0x242c(){const _0x3de003=['path','4vUiiAX','sort','map','291055ucJQdG','12639304rzCJsL','object','95109xWuKBj','2630425XUVAaD','816156GafOTm','1980-01-01T00:00:00.000Z','validation_error','endsWith','Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.','234065MYGwXV','code','Runtime\x20Skill\x20package\x20contains\x20directory\x20entry:\x20','924406AdDfKW','name','validation','from'];a116_0x242c=function(){return _0x3de003;};return a116_0x242c();}const a116_0x2cb1b6=a116_0x52a1;(function(_0x662319,_0x293858){const _0x475df5=a116_0x52a1,_0x537e93=_0x662319();while(!![]){try{const _0x4b8d88=-parseInt(_0x475df5(0xd9))/0x1+-parseInt(_0x475df5(0xdc))/0x2+-parseInt(_0x475df5(0xd2))/0x3+parseInt(_0x475df5(0xe1))/0x4*(-parseInt(_0x475df5(0xe4))/0x5)+-parseInt(_0x475df5(0xd4))/0x6+-parseInt(_0x475df5(0xd3))/0x7+parseInt(_0x475df5(0xd0))/0x8;if(_0x4b8d88===_0x293858)break;else _0x537e93['push'](_0x537e93['shift']());}catch(_0x58c30b){_0x537e93['push'](_0x537e93['shift']());}}}(a116_0x242c,0x44d4a));import{unzipSync,zipSync}from'fflate';import{CliErrors}from'../../errors.js';import{compareSkillFiles,fileContent,normalizeLocalFiles,normalizeSkillRelativePath}from'./local-files.js';const ZIP_MTIME=new Date(a116_0x2cb1b6(0xd5));export function createDeterministicZipPackage(_0x270c80){const _0x2e0fa1=a116_0x2cb1b6,_0x5bf1dc={};for(const _0x1a5b92 of normalizeLocalFiles(_0x270c80)){_0x5bf1dc[_0x1a5b92[_0x2e0fa1(0xe0)]]=fileContent(_0x1a5b92);}return Buffer[_0x2e0fa1(0xdf)](zipSync(_0x5bf1dc,{'level':0x0,'mtime':ZIP_MTIME}));}function a116_0x52a1(_0x6ab97,_0x236c32){_0x6ab97=_0x6ab97-0xd0;const _0x242c68=a116_0x242c();let _0x52a134=_0x242c68[_0x6ab97];return _0x52a134;}export function parseZipPackage(_0x499a0b){const _0x4249d2=a116_0x2cb1b6;if(_0x499a0b['length']<0x16)throw CliErrors[_0x4249d2(0xde)](_0x4249d2(0xd8));let _0x357ec4;try{_0x357ec4=unzipSync(_0x499a0b,{'filter'(_0xa03181){const _0x36fbc1=_0x4249d2,_0x118ba5=normalizeSkillRelativePath(_0xa03181[_0x36fbc1(0xdd)]);if(_0x118ba5[_0x36fbc1(0xd7)]('/'))throw CliErrors[_0x36fbc1(0xde)](_0x36fbc1(0xdb)+_0x118ba5);return!![];}});}catch(_0x629add){if(isRuntimeSkillValidationError(_0x629add))throw _0x629add;throw CliErrors[_0x4249d2(0xde)]('Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.');}return Object['entries'](_0x357ec4)[_0x4249d2(0xe3)](([_0x218d9f,_0x10afb8])=>({'path':normalizeSkillRelativePath(_0x218d9f),'bytes':Buffer['from'](_0x10afb8)}))[_0x4249d2(0xe2)](compareSkillFiles);}function isRuntimeSkillValidationError(_0x525ffd){const _0xc50fa7=a116_0x2cb1b6;return typeof _0x525ffd===_0xc50fa7(0xd1)&&_0x525ffd!==null&&'code'in _0x525ffd&&_0x525ffd[_0xc50fa7(0xda)]===_0xc50fa7(0xd6);}
1
+ const a117_0x596c61=a117_0x4d56;(function(_0x17ba56,_0x6b1d59){const _0x499b57=a117_0x4d56,_0x282a3e=_0x17ba56();while(!![]){try{const _0x51b6f3=parseInt(_0x499b57(0x9b))/0x1+-parseInt(_0x499b57(0xa6))/0x2+parseInt(_0x499b57(0xa2))/0x3+-parseInt(_0x499b57(0xa1))/0x4*(parseInt(_0x499b57(0x9c))/0x5)+-parseInt(_0x499b57(0xa0))/0x6*(-parseInt(_0x499b57(0xa4))/0x7)+parseInt(_0x499b57(0x9f))/0x8+-parseInt(_0x499b57(0xaa))/0x9;if(_0x51b6f3===_0x6b1d59)break;else _0x282a3e['push'](_0x282a3e['shift']());}catch(_0x40a8c9){_0x282a3e['push'](_0x282a3e['shift']());}}}(a117_0x1ed3,0xc9942));function a117_0x4d56(_0x1e0469,_0x2e0773){_0x1e0469=_0x1e0469-0x9b;const _0x1ed38e=a117_0x1ed3();let _0x4d56eb=_0x1ed38e[_0x1e0469];return _0x4d56eb;}import{unzipSync,zipSync}from'fflate';import{CliErrors}from'../../errors.js';import{compareSkillFiles,fileContent,normalizeLocalFiles,normalizeSkillRelativePath}from'./local-files.js';const ZIP_MTIME=new Date(a117_0x596c61(0xa7));export function createDeterministicZipPackage(_0x5b3443){const _0x44bd5a=a117_0x596c61,_0x459d97={};for(const _0x25bdf0 of normalizeLocalFiles(_0x5b3443)){_0x459d97[_0x25bdf0[_0x44bd5a(0xa3)]]=fileContent(_0x25bdf0);}return Buffer[_0x44bd5a(0xab)](zipSync(_0x459d97,{'level':0x0,'mtime':ZIP_MTIME}));}function a117_0x1ed3(){const _0x568e2b=['28931naMpSi','Runtime\x20Skill\x20package\x20contains\x20directory\x20entry:\x20','1328798vbFXdC','1980-01-01T00:00:00.000Z','code','object','15870069Rlzncs','from','Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.','length','1408012xWHOaf','50MjLUny','validation','entries','12942656uRqdMH','852RpFugf','369268ATUJkG','1691538ahxxdX','path'];a117_0x1ed3=function(){return _0x568e2b;};return a117_0x1ed3();}export function parseZipPackage(_0x29470b){const _0x325a00=a117_0x596c61;if(_0x29470b[_0x325a00(0xad)]<0x16)throw CliErrors[_0x325a00(0x9d)](_0x325a00(0xac));let _0x140fe9;try{_0x140fe9=unzipSync(_0x29470b,{'filter'(_0x1bdf47){const _0x5049cb=_0x325a00,_0x4740fb=normalizeSkillRelativePath(_0x1bdf47['name']);if(_0x4740fb['endsWith']('/'))throw CliErrors[_0x5049cb(0x9d)](_0x5049cb(0xa5)+_0x4740fb);return!![];}});}catch(_0x88dec3){if(isRuntimeSkillValidationError(_0x88dec3))throw _0x88dec3;throw CliErrors[_0x325a00(0x9d)](_0x325a00(0xac));}return Object[_0x325a00(0x9e)](_0x140fe9)['map'](([_0x598532,_0x7f0b28])=>({'path':normalizeSkillRelativePath(_0x598532),'bytes':Buffer[_0x325a00(0xab)](_0x7f0b28)}))['sort'](compareSkillFiles);}function isRuntimeSkillValidationError(_0x22e883){const _0x4ea54e=a117_0x596c61;return typeof _0x22e883===_0x4ea54e(0xa9)&&_0x22e883!==null&&_0x4ea54e(0xa8)in _0x22e883&&_0x22e883[_0x4ea54e(0xa8)]==='validation_error';}