@lovrabet/lovrabet-cli 2.3.4-beta.2 → 2.3.5-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 (200) hide show
  1. package/README.md +44 -1
  2. package/lib/cli.js +1 -1
  3. package/lib/commands/api-doc/index.js +1 -1
  4. package/lib/commands/app/cache.js +1 -1
  5. package/lib/commands/app/definitions.js +1 -1
  6. package/lib/commands/app/eligibility.js +1 -1
  7. package/lib/commands/app/mock-loader.js +1 -1
  8. package/lib/commands/app/remote-source.js +1 -1
  9. package/lib/commands/app/shared.js +1 -1
  10. package/lib/commands/app-config/get.js +1 -1
  11. package/lib/commands/app-config/index.js +1 -1
  12. package/lib/commands/approval/index.js +1 -1
  13. package/lib/commands/artifact/index.js +1 -1
  14. package/lib/commands/auth/device.js +1 -1
  15. package/lib/commands/auth/index.js +1 -1
  16. package/lib/commands/auth/prompt.js +1 -1
  17. package/lib/commands/bff/detail.js +1 -1
  18. package/lib/commands/bff/exec.js +1 -1
  19. package/lib/commands/bff/index.js +1 -1
  20. package/lib/commands/cli-skill/index.js +1 -1
  21. package/lib/commands/common/config-policy.js +1 -1
  22. package/lib/commands/common/constraints.js +1 -1
  23. package/lib/commands/common/flags.js +1 -1
  24. package/lib/commands/common/local-file.js +1 -1
  25. package/lib/commands/config/definitions.js +1 -1
  26. package/lib/commands/config/init.js +1 -1
  27. package/lib/commands/config/shared.js +1 -1
  28. package/lib/commands/data/import-excel.d.ts +2 -0
  29. package/lib/commands/data/import-excel.js +1 -0
  30. package/lib/commands/data/index.js +1 -1
  31. package/lib/commands/dataset/detail.js +1 -1
  32. package/lib/commands/dataset/index.js +1 -1
  33. package/lib/commands/dataset/list.js +1 -1
  34. package/lib/commands/dataset/sdk-doc.js +1 -1
  35. package/lib/commands/doctor.js +1 -1
  36. package/lib/commands/file/index.js +1 -1
  37. package/lib/commands/init.js +1 -1
  38. package/lib/commands/kb/index.js +1 -1
  39. package/lib/commands/logs/index.js +1 -1
  40. package/lib/commands/notification/config-list.js +1 -1
  41. package/lib/commands/notification/index.js +1 -1
  42. package/lib/commands/notification/shared.js +1 -1
  43. package/lib/commands/ocr/index.js +1 -1
  44. package/lib/commands/permit/dataset-get.js +1 -1
  45. package/lib/commands/permit/dataset-set.js +1 -1
  46. package/lib/commands/permit/index.js +1 -1
  47. package/lib/commands/permit/page-get.js +1 -1
  48. package/lib/commands/permit/page-set.js +1 -1
  49. package/lib/commands/permit/role-menus-set.js +1 -1
  50. package/lib/commands/permit/role-menus.js +1 -1
  51. package/lib/commands/permit/shared.js +1 -1
  52. package/lib/commands/personal-bff/index.js +1 -1
  53. package/lib/commands/registry.js +1 -1
  54. package/lib/commands/role/create.js +1 -1
  55. package/lib/commands/role/delete.js +1 -1
  56. package/lib/commands/role/detail.js +1 -1
  57. package/lib/commands/role/index.js +1 -1
  58. package/lib/commands/role/list.js +1 -1
  59. package/lib/commands/role/shared.js +1 -1
  60. package/lib/commands/role/update.js +1 -1
  61. package/lib/commands/role/user-add.js +1 -1
  62. package/lib/commands/role/user-remove.js +1 -1
  63. package/lib/commands/schedule/index.js +1 -1
  64. package/lib/commands/schema.js +1 -1
  65. package/lib/commands/service/dynamic.js +1 -1
  66. package/lib/commands/service/function-name-adapter.js +1 -1
  67. package/lib/commands/service/index.js +1 -1
  68. package/lib/commands/service/registry.js +1 -1
  69. package/lib/commands/skill/commands/create.js +1 -1
  70. package/lib/commands/skill/commands/diagram.js +1 -1
  71. package/lib/commands/skill/commands/install.js +1 -1
  72. package/lib/commands/skill/commands/list.js +1 -1
  73. package/lib/commands/skill/commands/push.js +1 -1
  74. package/lib/commands/skill/commands/validate.js +1 -1
  75. package/lib/commands/skill/diagram.js +1 -1
  76. package/lib/commands/skill/flags.js +1 -1
  77. package/lib/commands/skill/index.js +1 -1
  78. package/lib/commands/skill/manifest-helpers.js +1 -1
  79. package/lib/commands/skill/push-execute.js +1 -1
  80. package/lib/commands/skill/push-flow-helpers.js +1 -1
  81. package/lib/commands/skill/push-retarget.js +1 -1
  82. package/lib/commands/skill/scopes.js +1 -1
  83. package/lib/commands/skill/summary.js +1 -1
  84. package/lib/commands/skill/templates.js +1 -1
  85. package/lib/commands/skill/validate.js +1 -1
  86. package/lib/commands/sql/detail.js +1 -1
  87. package/lib/commands/sql/exec.js +1 -1
  88. package/lib/commands/sql/index.js +1 -1
  89. package/lib/commands/update.js +1 -1
  90. package/lib/commands/user-account/bind.js +1 -1
  91. package/lib/commands/user-account/index.js +1 -1
  92. package/lib/commands/workspace/index.js +1 -1
  93. package/lib/config/domain-config.js +1 -1
  94. package/lib/config/schema.js +1 -1
  95. package/lib/constant/app.js +1 -1
  96. package/lib/constant/auth-mode.js +1 -1
  97. package/lib/constant/cli.js +1 -1
  98. package/lib/constant/defaults.js +1 -1
  99. package/lib/constant/distribution.js +1 -1
  100. package/lib/constant/domain.js +1 -1
  101. package/lib/constant/env.js +1 -1
  102. package/lib/constant/output.js +1 -1
  103. package/lib/constant/product.js +1 -1
  104. package/lib/constant/region.js +1 -1
  105. package/lib/constant/risk.js +1 -1
  106. package/lib/constant/url.js +1 -1
  107. package/lib/context.js +1 -1
  108. package/lib/core/api-client.d.ts +19 -5
  109. package/lib/core/api-client.js +1 -1
  110. package/lib/core/db-resolver.js +1 -1
  111. package/lib/core/kb-search-client.js +1 -1
  112. package/lib/core/sdk-client.js +1 -1
  113. package/lib/errors.d.ts +1 -0
  114. package/lib/errors.js +1 -1
  115. package/lib/framework/access-error.d.ts +5 -0
  116. package/lib/framework/access-error.js +1 -0
  117. package/lib/framework/build-all-flags.js +1 -1
  118. package/lib/framework/dryrun.js +1 -1
  119. package/lib/framework/flags.js +1 -1
  120. package/lib/framework/help.js +1 -1
  121. package/lib/framework/index.js +1 -1
  122. package/lib/framework/output.js +1 -1
  123. package/lib/framework/preparse.js +1 -1
  124. package/lib/framework/rate-limit.js +1 -1
  125. package/lib/framework/raw-flags.js +1 -1
  126. package/lib/framework/response.js +1 -1
  127. package/lib/framework/runner-confirmation.js +1 -1
  128. package/lib/framework/runner-error.d.ts +2 -17
  129. package/lib/framework/runner-error.js +1 -1
  130. package/lib/framework/runner.js +1 -1
  131. package/lib/framework/schema-export.js +1 -1
  132. package/lib/framework/service-order.js +1 -1
  133. package/lib/framework/types.js +1 -1
  134. package/lib/generated/build-info.d.ts +4 -4
  135. package/lib/generated/build-info.js +1 -1
  136. package/lib/generated/official-routing.js +1 -1
  137. package/lib/generated/routing-contract.js +1 -1
  138. package/lib/help.js +1 -1
  139. package/lib/postinstall.js +1 -1
  140. package/lib/runtime/confirmation.js +1 -1
  141. package/lib/runtime/event.js +1 -1
  142. package/lib/runtime/index.js +1 -1
  143. package/lib/runtime/queue.js +1 -1
  144. package/lib/runtime/resolve.js +1 -1
  145. package/lib/services/dataset-import/auto-id-runner.d.ts +25 -0
  146. package/lib/services/dataset-import/auto-id-runner.js +1 -0
  147. package/lib/services/dataset-import/excel-reader.d.ts +3 -0
  148. package/lib/services/dataset-import/excel-reader.js +1 -0
  149. package/lib/services/dataset-import/metadata.d.ts +2 -0
  150. package/lib/services/dataset-import/metadata.js +1 -0
  151. package/lib/services/dataset-import/preview.d.ts +4 -0
  152. package/lib/services/dataset-import/preview.js +1 -0
  153. package/lib/services/dataset-import/runner.d.ts +63 -0
  154. package/lib/services/dataset-import/runner.js +1 -0
  155. package/lib/services/dataset-import/types.d.ts +33 -0
  156. package/lib/services/dataset-import/types.js +1 -0
  157. package/lib/skills/builtin-skill.js +1 -1
  158. package/lib/skills/npx-skills-add.js +1 -1
  159. package/lib/skills/runtime-skill-sync/constants.js +1 -1
  160. package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
  161. package/lib/skills/runtime-skill-sync/hashing.js +1 -1
  162. package/lib/skills/runtime-skill-sync/install-target.js +1 -1
  163. package/lib/skills/runtime-skill-sync/links.js +1 -1
  164. package/lib/skills/runtime-skill-sync/list-local.js +1 -1
  165. package/lib/skills/runtime-skill-sync/local-files.js +1 -1
  166. package/lib/skills/runtime-skill-sync/materialize.js +1 -1
  167. package/lib/skills/runtime-skill-sync/metadata.js +1 -1
  168. package/lib/skills/runtime-skill-sync/paths.js +1 -1
  169. package/lib/skills/runtime-skill-sync/push.js +1 -1
  170. package/lib/skills/runtime-skill-sync/scopes.js +1 -1
  171. package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
  172. package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
  173. package/lib/skills/runtime-skill-sync.js +1 -1
  174. package/lib/skills/skill-presence.js +1 -1
  175. package/lib/utils/access-key-redaction.js +1 -1
  176. package/lib/utils/apply-jq-filter.js +1 -1
  177. package/lib/utils/cli-version-check.js +1 -1
  178. package/lib/utils/cli-version-policy.js +1 -1
  179. package/lib/utils/logger.js +1 -1
  180. package/lib/utils/lossless-json.js +1 -1
  181. package/lib/utils/params.js +1 -1
  182. package/lib/utils/positive-safe-integer.js +1 -1
  183. package/lib/utils/redaction.js +1 -1
  184. package/lib/utils/update-notice.js +1 -1
  185. package/lib/utils/version.js +1 -1
  186. package/lib/utils/write-cli-side-channel.js +1 -1
  187. package/package.json +8 -3
  188. package/skills/lovrabet/SKILL.md +10 -5
  189. package/skills/lovrabet/guides/dataset-and-data-workflow.md +4 -2
  190. package/skills/lovrabet/guides/role-and-permission-workflow.md +14 -0
  191. package/skills/lovrabet/guides/sql-and-bff-workflow.md +1 -1
  192. package/skills/lovrabet/guides/troubleshooting.md +7 -1
  193. package/skills/lovrabet/references/instant-api-workflow.md +6 -2
  194. package/skills/lovrabet/references/lovrabet-approval-workflow.md +16 -2
  195. package/skills/lovrabet/references/lovrabet-bff-workflow.md +9 -0
  196. package/skills/lovrabet/references/lovrabet-db-table-excel-import.md +113 -0
  197. package/skills/lovrabet/references/lovrabet-excel-import.md +31 -0
  198. package/skills/lovrabet/references/lovrabet-kb-workflow.md +1 -1
  199. package/skills/lovrabet/references/lovrabet-personal-bff-workflow.md +2 -0
  200. package/skills/lovrabet.manifest.json +5 -3
@@ -1 +1 @@
1
- const a137_0x3812ac=a137_0x5a6e;(function(_0x4ad1cd,_0x530c3d){const _0x1010f1=a137_0x5a6e,_0x5077f7=_0x4ad1cd();while(!![]){try{const _0x39b1da=-parseInt(_0x1010f1(0x16f))/0x1+parseInt(_0x1010f1(0x181))/0x2*(-parseInt(_0x1010f1(0x18d))/0x3)+parseInt(_0x1010f1(0x188))/0x4+parseInt(_0x1010f1(0x16d))/0x5+-parseInt(_0x1010f1(0x18e))/0x6+parseInt(_0x1010f1(0x187))/0x7*(parseInt(_0x1010f1(0x18c))/0x8)+parseInt(_0x1010f1(0x182))/0x9*(-parseInt(_0x1010f1(0x159))/0xa);if(_0x39b1da===_0x530c3d)break;else _0x5077f7['push'](_0x5077f7['shift']());}catch(_0x12f02b){_0x5077f7['push'](_0x5077f7['shift']());}}}(a137_0x1a9d,0xc5c8b));import{execaSync}from'execa';function a137_0x5a6e(_0x57f2bf,_0x515ce6){_0x57f2bf=_0x57f2bf-0x158;const _0x1a9ddc=a137_0x1a9d();let _0x5a6eed=_0x1a9ddc[_0x57f2bf];return _0x5a6eed;}import{LOVRABET_SKILL_SOURCE as a137_0x1786ce}from'../constant/distribution.js';import{PRODUCT_CONFIG,productEnvName}from'../constant/product.js';function a137_0x1a9d(){const _0x41d936=['expectedSkillName','CHILD_EXIT_NONZERO','unknown','present','Installer\x20reported\x20','EPERM','\x22\x20not\x20found\x20after\x20install\x20(checked\x20','log','pipe','6803725DVzPmR','npx','638308XhszQm','PERMISSION_DENIED','checked','npx\x20terminated\x20by\x20signal\x20','stdio','presence','signal','NPX_NOT_FOUND','CHILD_TERMINATED','shortMessage','trim','Skill\x20\x22','stdout','match','ENOENT','message','unverifiable','\x22\x20install\x20state:\x20','2RxlXyQ','5741127SwfSuU','reason','SKILL_NOT_INSTALLED','join','npx\x20failed\x20to\x20start','821275nppfhS','4913416iVajJK','exit\x20','code','!\x20Could\x20not\x20verify\x20\x22','40hdDXfX','1922313APJlXc','2691714cZyhXJ','partialFailure','stderr','NPM_CONFIG_GLOBAL','10VjRGzF','skipNpxSkillsEnvSuffix','globalSkillName','warn','exitCode','state','SPAWN_FAILED','\x20failed\x20target(s)','skills@latest','npm_config_global','absent'];a137_0x1a9d=function(){return _0x41d936;};return a137_0x1a9d();}import{resolveInstalledSkill}from'../skills/skill-presence.js';export const LOVRABET_SKILL_SOURCE=a137_0x1786ce;export const LOVRABET_SKILL_GIT_SOURCE=PRODUCT_CONFIG['internalSkillSource'];export const LOVRABET_GLOBAL_SKILL_NAME=PRODUCT_CONFIG[a137_0x3812ac(0x15b)];export function resolveGlobalSkillName(_0x343f42){const _0x30eb3f=a137_0x3812ac;switch(_0x343f42[_0x30eb3f(0x179)]()){case LOVRABET_SKILL_SOURCE:case LOVRABET_SKILL_GIT_SOURCE:return LOVRABET_GLOBAL_SKILL_NAME;default:return undefined;}}export const LOVRABET_SKIP_NPX_SKILLS_ENV=productEnvName(PRODUCT_CONFIG[a137_0x3812ac(0x15a)]);const CHILD_OUTPUT_MAX_BUFFER=0x10*0x400*0x400;function failure(_0x19f61a,_0x379676,_0x1b287d){return{'ok':![],'status':_0x379676,'code':_0x19f61a,'error':'['+_0x19f61a+']\x20'+_0x1b287d};}export function shouldSkipNpxSkillsAdd(){return process.env[LOVRABET_SKIP_NPX_SKILLS_ENV]==='1';}export function runNpxSkillsAddGlobal(_0x27ea17,_0x53b4dc=LOVRABET_SKILL_SOURCE,_0x23134b){const _0x2e6d76=a137_0x3812ac;if(shouldSkipNpxSkillsAdd())return{'ok':!![],'status':0x0,'skipped':!![]};const _0x284b9d=['-y',_0x2e6d76(0x161),'add',_0x53b4dc,'-g','-y'],_0x48875c=[_0x2e6d76(0x16e),..._0x284b9d][_0x2e6d76(0x185)]('\x20');console['log']('*\x20'+_0x48875c);const _0x5cfa64={...process.env};delete _0x5cfa64[_0x2e6d76(0x162)],delete _0x5cfa64[_0x2e6d76(0x158)];const _0x19835e=execaSync('npx',_0x284b9d,{'cwd':_0x27ea17,'stdio':_0x2e6d76(0x16c),'env':_0x5cfa64,'extendEnv':![],'shell':![],'reject':![],'maxBuffer':CHILD_OUTPUT_MAX_BUFFER}),_0x2ada2c=[_0x19835e[_0x2e6d76(0x17b)]?String(_0x19835e[_0x2e6d76(0x17b)]):'',_0x19835e[_0x2e6d76(0x190)]?String(_0x19835e[_0x2e6d76(0x190)]):'']['filter'](Boolean)[_0x2e6d76(0x185)]('\x0a')['trim'](),_0x4de4f5=_0x19835e[_0x2e6d76(0x15d)]??null,_0x1b6915=_0x4f70fc=>{const _0x3281c1=_0x2e6d76;return _0x23134b?.[_0x3281c1(0x173)]!==_0x3281c1(0x16c)&&!_0x4f70fc[_0x3281c1(0x18f)]&&_0x2ada2c&&console[_0x3281c1(0x16b)](_0x2ada2c),_0x4f70fc;};if(_0x19835e['code']){const _0x54109e=_0x19835e['code']===_0x2e6d76(0x17d)?_0x2e6d76(0x176):_0x19835e[_0x2e6d76(0x18a)]===_0x2e6d76(0x169)||_0x19835e[_0x2e6d76(0x18a)]==='EACCES'?_0x2e6d76(0x170):_0x2e6d76(0x15f);return _0x1b6915(failure(_0x54109e,_0x4de4f5,_0x19835e[_0x2e6d76(0x178)]??_0x19835e[_0x2e6d76(0x17e)]??_0x19835e['code']));}if(_0x19835e[_0x2e6d76(0x175)])return _0x1b6915(failure(_0x2e6d76(0x177),_0x4de4f5,_0x2e6d76(0x172)+_0x19835e[_0x2e6d76(0x175)]));if(_0x19835e['failed']&&_0x4de4f5===null)return _0x1b6915(failure(_0x2e6d76(0x15f),_0x4de4f5,_0x19835e[_0x2e6d76(0x178)]??_0x19835e[_0x2e6d76(0x17e)]??_0x2e6d76(0x186)));if(_0x4de4f5!==0x0)return _0x1b6915(failure(_0x2e6d76(0x165),_0x4de4f5,_0x2ada2c||_0x19835e[_0x2e6d76(0x178)]||_0x2e6d76(0x189)+(_0x4de4f5??_0x2e6d76(0x166))));const _0xd3140f=_0x23134b?.[_0x2e6d76(0x164)]??resolveGlobalSkillName(_0x53b4dc),_0x1337dc=_0xd3140f?resolveInstalledSkill(_0xd3140f,_0x23134b?.[_0x2e6d76(0x174)]):undefined,_0x4499b3=_0x2ada2c[_0x2e6d76(0x17c)](/Failed to install\s+(\d+)/i);if(_0x4499b3&&Number(_0x4499b3[0x1])>0x0){const _0x4679fa=_0x2e6d76(0x168)+_0x4499b3[0x1]+_0x2e6d76(0x160)+(_0x2ada2c?':\x0a'+_0x2ada2c:'');if(_0x1337dc?.[_0x2e6d76(0x15e)]===_0x2e6d76(0x167))return{'ok':!![],'status':0x0,'partialFailure':{'count':Number(_0x4499b3[0x1]),'output':_0x2ada2c}};return _0x1b6915(failure('INSTALL_PARTIAL',0x0,_0x4679fa));}if(_0xd3140f&&_0x1337dc){if(_0x1337dc[_0x2e6d76(0x15e)]===_0x2e6d76(0x163))return _0x1b6915(failure(_0x2e6d76(0x184),0x0,_0x2e6d76(0x17a)+_0xd3140f+_0x2e6d76(0x16a)+_0x1337dc[_0x2e6d76(0x171)][_0x2e6d76(0x185)](',\x20')+')'));_0x1337dc[_0x2e6d76(0x15e)]===_0x2e6d76(0x17f)&&console[_0x2e6d76(0x15c)](_0x2e6d76(0x18b)+_0xd3140f+_0x2e6d76(0x180)+_0x1337dc[_0x2e6d76(0x183)]);}return _0x1b6915({'ok':!![],'status':0x0});}
1
+ const a145_0x1917e8=a145_0x44d6;(function(_0x5cb023,_0x1f34e3){const _0x29714c=a145_0x44d6,_0x11da58=_0x5cb023();while(!![]){try{const _0x4f44c7=-parseInt(_0x29714c(0x118))/0x1+-parseInt(_0x29714c(0x105))/0x2+-parseInt(_0x29714c(0xfd))/0x3*(-parseInt(_0x29714c(0x12a))/0x4)+-parseInt(_0x29714c(0x128))/0x5*(-parseInt(_0x29714c(0x10e))/0x6)+-parseInt(_0x29714c(0x120))/0x7+-parseInt(_0x29714c(0x12b))/0x8*(-parseInt(_0x29714c(0xfe))/0x9)+parseInt(_0x29714c(0x107))/0xa;if(_0x4f44c7===_0x1f34e3)break;else _0x11da58['push'](_0x11da58['shift']());}catch(_0x3df3a8){_0x11da58['push'](_0x11da58['shift']());}}}(a145_0x4c59,0xe82f4));import{execaSync}from'execa';import{LOVRABET_SKILL_SOURCE as a145_0x2eeebd}from'../constant/distribution.js';import{PRODUCT_CONFIG,productEnvName}from'../constant/product.js';import{resolveInstalledSkill}from'../skills/skill-presence.js';function a145_0x44d6(_0x33861d,_0x5c1b4c){_0x33861d=_0x33861d-0xf8;const _0x4c590a=a145_0x4c59();let _0x44d681=_0x4c590a[_0x33861d];return _0x44d681;}export const LOVRABET_SKILL_SOURCE=a145_0x2eeebd;export const LOVRABET_SKILL_GIT_SOURCE=PRODUCT_CONFIG[a145_0x1917e8(0x11e)];export const LOVRABET_GLOBAL_SKILL_NAME=PRODUCT_CONFIG['globalSkillName'];export function resolveGlobalSkillName(_0x4bd1ee){const _0x6c6dd7=a145_0x1917e8;switch(_0x4bd1ee[_0x6c6dd7(0x104)]()){case LOVRABET_SKILL_SOURCE:case LOVRABET_SKILL_GIT_SOURCE:return LOVRABET_GLOBAL_SKILL_NAME;default:return undefined;}}export const LOVRABET_SKIP_NPX_SKILLS_ENV=productEnvName(PRODUCT_CONFIG[a145_0x1917e8(0x10d)]);const CHILD_OUTPUT_MAX_BUFFER=0x10*0x400*0x400;function failure(_0x4ae118,_0x272982,_0x24ee43){return{'ok':![],'status':_0x272982,'code':_0x4ae118,'error':'['+_0x4ae118+']\x20'+_0x24ee43};}export function shouldSkipNpxSkillsAdd(){return process.env[LOVRABET_SKIP_NPX_SKILLS_ENV]==='1';}function a145_0x4c59(){const _0x5a3a99=['2261259Njikse','NPM_CONFIG_GLOBAL','signal','npm_config_global','Installer\x20reported\x20','message','shortMessage','\x22\x20not\x20found\x20after\x20install\x20(checked\x20','1201160ufEcns','add','4UbPpKF','2922032miHxeL','SKILL_NOT_INSTALLED','pipe','filter','failed','!\x20Could\x20not\x20verify\x20\x22','EPERM','Skill\x20\x22','2175561mPmqfr','9dISztH','CHILD_EXIT_NONZERO','npx\x20failed\x20to\x20start','warn','exit\x20','absent','trim','2749816maFdyW','expectedSkillName','6178930vIjDbz','NPX_NOT_FOUND','state','checked','PERMISSION_DENIED','EACCES','skipNpxSkillsEnvSuffix','30biFepD','stderr','code','exitCode','presence','log','stdout','\x20failed\x20target(s)','skills@latest','match','260521KsveOz','join','unverifiable','npx','stdio','CHILD_TERMINATED','internalSkillSource','SPAWN_FAILED'];a145_0x4c59=function(){return _0x5a3a99;};return a145_0x4c59();}export function runNpxSkillsAddGlobal(_0x577342,_0x1b8559=LOVRABET_SKILL_SOURCE,_0x44ae1e){const _0x2721d5=a145_0x1917e8;if(shouldSkipNpxSkillsAdd())return{'ok':!![],'status':0x0,'skipped':!![]};const _0xdafda9=['-y',_0x2721d5(0x116),_0x2721d5(0x129),_0x1b8559,'-g','-y'],_0x2f78b1=['npx',..._0xdafda9][_0x2721d5(0x119)]('\x20');console[_0x2721d5(0x113)]('*\x20'+_0x2f78b1);const _0x48abc7={...process.env};delete _0x48abc7[_0x2721d5(0x123)],delete _0x48abc7[_0x2721d5(0x121)];const _0x252be2=execaSync(_0x2721d5(0x11b),_0xdafda9,{'cwd':_0x577342,'stdio':_0x2721d5(0x12d),'env':_0x48abc7,'extendEnv':![],'shell':![],'reject':![],'maxBuffer':CHILD_OUTPUT_MAX_BUFFER}),_0x3a5276=[_0x252be2[_0x2721d5(0x114)]?String(_0x252be2[_0x2721d5(0x114)]):'',_0x252be2[_0x2721d5(0x10f)]?String(_0x252be2[_0x2721d5(0x10f)]):''][_0x2721d5(0xf8)](Boolean)[_0x2721d5(0x119)]('\x0a')['trim'](),_0x2ceeed=_0x252be2[_0x2721d5(0x111)]??null,_0x4196b7=_0x1585fb=>{const _0x556463=_0x2721d5;return _0x44ae1e?.[_0x556463(0x11c)]!==_0x556463(0x12d)&&!_0x1585fb['partialFailure']&&_0x3a5276&&console['log'](_0x3a5276),_0x1585fb;};if(_0x252be2[_0x2721d5(0x110)]){const _0x3ae2ad=_0x252be2['code']==='ENOENT'?_0x2721d5(0x108):_0x252be2[_0x2721d5(0x110)]===_0x2721d5(0xfb)||_0x252be2[_0x2721d5(0x110)]===_0x2721d5(0x10c)?_0x2721d5(0x10b):'SPAWN_FAILED';return _0x4196b7(failure(_0x3ae2ad,_0x2ceeed,_0x252be2[_0x2721d5(0x126)]??_0x252be2[_0x2721d5(0x125)]??_0x252be2[_0x2721d5(0x110)]));}if(_0x252be2[_0x2721d5(0x122)])return _0x4196b7(failure(_0x2721d5(0x11d),_0x2ceeed,'npx\x20terminated\x20by\x20signal\x20'+_0x252be2['signal']));if(_0x252be2[_0x2721d5(0xf9)]&&_0x2ceeed===null)return _0x4196b7(failure(_0x2721d5(0x11f),_0x2ceeed,_0x252be2[_0x2721d5(0x126)]??_0x252be2[_0x2721d5(0x125)]??_0x2721d5(0x100)));if(_0x2ceeed!==0x0)return _0x4196b7(failure(_0x2721d5(0xff),_0x2ceeed,_0x3a5276||_0x252be2[_0x2721d5(0x126)]||_0x2721d5(0x102)+(_0x2ceeed??'unknown')));const _0x5062d6=_0x44ae1e?.[_0x2721d5(0x106)]??resolveGlobalSkillName(_0x1b8559),_0x57b301=_0x5062d6?resolveInstalledSkill(_0x5062d6,_0x44ae1e?.[_0x2721d5(0x112)]):undefined,_0x10870f=_0x3a5276[_0x2721d5(0x117)](/Failed to install\s+(\d+)/i);if(_0x10870f&&Number(_0x10870f[0x1])>0x0){const _0x1c9716=_0x2721d5(0x124)+_0x10870f[0x1]+_0x2721d5(0x115)+(_0x3a5276?':\x0a'+_0x3a5276:'');if(_0x57b301?.[_0x2721d5(0x109)]==='present')return{'ok':!![],'status':0x0,'partialFailure':{'count':Number(_0x10870f[0x1]),'output':_0x3a5276}};return _0x4196b7(failure('INSTALL_PARTIAL',0x0,_0x1c9716));}if(_0x5062d6&&_0x57b301){if(_0x57b301[_0x2721d5(0x109)]===_0x2721d5(0x103))return _0x4196b7(failure(_0x2721d5(0x12c),0x0,_0x2721d5(0xfc)+_0x5062d6+_0x2721d5(0x127)+_0x57b301[_0x2721d5(0x10a)][_0x2721d5(0x119)](',\x20')+')'));_0x57b301[_0x2721d5(0x109)]===_0x2721d5(0x11a)&&console[_0x2721d5(0x101)](_0x2721d5(0xfa)+_0x5062d6+'\x22\x20install\x20state:\x20'+_0x57b301['reason']);}return _0x4196b7({'ok':!![],'status':0x0});}
@@ -1 +1 @@
1
- function a138_0x2e7e(_0x1ae74a,_0x1efb73){_0x1ae74a=_0x1ae74a-0x1e8;const _0x57812b=a138_0x5781();let _0x2e7e45=_0x57812b[_0x1ae74a];return _0x2e7e45;}function a138_0x5781(){const _0x5b453d=['901285HKMGtp','coverage','82428jMtTRh','474728aTGTgW','656916fRhzfF','2PqAoAD','.turbo','SKILL.md','build','422226KiKMrq','.git','1173102PFgzra','241664OOKtQp','.hg','lovrabet.skill.json','135gsZOOB','.DS_Store'];a138_0x5781=function(){return _0x5b453d;};return a138_0x5781();}const a138_0x113ea2=a138_0x2e7e;(function(_0x362276,_0x3a7850){const _0x58ac0a=a138_0x2e7e,_0x58e797=_0x362276();while(!![]){try{const _0x428362=parseInt(_0x58ac0a(0x1e9))/0x1+-parseInt(_0x58ac0a(0x1ec))/0x2*(-parseInt(_0x58ac0a(0x1f0))/0x3)+parseInt(_0x58ac0a(0x1ea))/0x4+parseInt(_0x58ac0a(0x1f8))/0x5+-parseInt(_0x58ac0a(0x1eb))/0x6+parseInt(_0x58ac0a(0x1f2))/0x7+parseInt(_0x58ac0a(0x1f3))/0x8*(-parseInt(_0x58ac0a(0x1f6))/0x9);if(_0x428362===_0x3a7850)break;else _0x58e797['push'](_0x58e797['shift']());}catch(_0x1a7a9a){_0x58e797['push'](_0x58e797['shift']());}}}(a138_0x5781,0x1f071));export const METADATA_FILE=a138_0x113ea2(0x1f5);export const SKILL_FILE=a138_0x113ea2(0x1ee);export const IGNORED_FILE_NAMES=new Set([METADATA_FILE,a138_0x113ea2(0x1f7)]);export const IGNORED_DIR_NAMES=new Set([a138_0x113ea2(0x1f1),a138_0x113ea2(0x1f4),'.svn','node_modules','.next','dist',a138_0x113ea2(0x1ef),a138_0x113ea2(0x1e8),a138_0x113ea2(0x1ed),'.cache']);
1
+ const a146_0x56fa21=a146_0x2fca;(function(_0x4dc21b,_0x4b9ca8){const _0x1e1127=a146_0x2fca,_0x2ebf29=_0x4dc21b();while(!![]){try{const _0x2bc7a4=-parseInt(_0x1e1127(0x1a2))/0x1*(-parseInt(_0x1e1127(0x1ab))/0x2)+-parseInt(_0x1e1127(0x1a7))/0x3*(parseInt(_0x1e1127(0x19c))/0x4)+-parseInt(_0x1e1127(0x1ac))/0x5+-parseInt(_0x1e1127(0x19d))/0x6+-parseInt(_0x1e1127(0x1a6))/0x7*(-parseInt(_0x1e1127(0x1a3))/0x8)+parseInt(_0x1e1127(0x19b))/0x9+parseInt(_0x1e1127(0x1aa))/0xa;if(_0x2bc7a4===_0x4b9ca8)break;else _0x2ebf29['push'](_0x2ebf29['shift']());}catch(_0x3292f5){_0x2ebf29['push'](_0x2ebf29['shift']());}}}(a146_0x3783,0xeb32a));function a146_0x3783(){const _0x12192d=['.svn','coverage','.turbo','16381539znQlGC','4PWXeYm','9587118lnXMyl','lovrabet.skill.json','build','.DS_Store','dist','11445xBPzrY','7302048gdaRhb','node_modules','SKILL.md','14EmMkrM','5069091EzTzSA','.next','.git','13521680ArloBP','86trphFm','6195330gPVkIA'];a146_0x3783=function(){return _0x12192d;};return a146_0x3783();}function a146_0x2fca(_0xa9c1c0,_0x5416e4){_0xa9c1c0=_0xa9c1c0-0x19a;const _0x378313=a146_0x3783();let _0x2fca3f=_0x378313[_0xa9c1c0];return _0x2fca3f;}export const METADATA_FILE=a146_0x56fa21(0x19e);export const SKILL_FILE=a146_0x56fa21(0x1a5);export const IGNORED_FILE_NAMES=new Set([METADATA_FILE,a146_0x56fa21(0x1a0)]);export const IGNORED_DIR_NAMES=new Set([a146_0x56fa21(0x1a9),'.hg',a146_0x56fa21(0x1ad),a146_0x56fa21(0x1a4),a146_0x56fa21(0x1a8),a146_0x56fa21(0x1a1),a146_0x56fa21(0x19f),a146_0x56fa21(0x1ae),a146_0x56fa21(0x19a),'.cache']);
@@ -1 +1 @@
1
- (function(_0x459d85,_0x303d43){const _0x4b7f7a=a139_0x52d2,_0x41fec0=_0x459d85();while(!![]){try{const _0xb1623a=-parseInt(_0x4b7f7a(0x114))/0x1+parseInt(_0x4b7f7a(0x10e))/0x2+parseInt(_0x4b7f7a(0x119))/0x3*(-parseInt(_0x4b7f7a(0x117))/0x4)+-parseInt(_0x4b7f7a(0x11c))/0x5+parseInt(_0x4b7f7a(0x11b))/0x6*(parseInt(_0x4b7f7a(0x10f))/0x7)+parseInt(_0x4b7f7a(0x112))/0x8+-parseInt(_0x4b7f7a(0x116))/0x9;if(_0xb1623a===_0x303d43)break;else _0x41fec0['push'](_0x41fec0['shift']());}catch(_0x2342a){_0x41fec0['push'](_0x41fec0['shift']());}}}(a139_0x218b,0xecc2c));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(_0x55b88e,_0x94fb98){const _0x14b249=a139_0x52d2,_0x1e2c44=normalizeSkillRelativePath(_0x94fb98),_0x4f68fc=realOrResolved(_0x55b88e),_0x2fe7c0=resolve(_0x4f68fc,..._0x1e2c44['split']('/'));if(!isPathInside(_0x2fe7c0,_0x4f68fc))throw CliErrors[_0x14b249(0x11a)](_0x14b249(0x10c)+_0x94fb98);return ensureNoSymlinkInManagedPath(_0x4f68fc,_0x1e2c44),_0x2fe7c0;}export function ensureNoSymlinkInManagedPath(_0xd9fd83,_0x1f72de){const _0x24fd53=a139_0x52d2;let _0x102372=_0xd9fd83;for(const _0x26d651 of _0x1f72de[_0x24fd53(0x118)]('/')){_0x102372=resolve(_0x102372,_0x26d651);const _0x4fe76b=lstatIfPresent(_0x102372);if(_0x4fe76b?.[_0x24fd53(0x113)]())throw CliErrors[_0x24fd53(0x11a)](_0x24fd53(0x111)+_0x1f72de);}}export function isDanglingSymlink(_0x144750){const _0x322d65=a139_0x52d2;try{return lstatSync(_0x144750)[_0x322d65(0x113)]();}catch{return![];}}function a139_0x218b(){const _0x5ebd95=['10945056CquSBA','isSymbolicLink','21935MasVuk','endsWith','9502236gzEAzn','4KGUBcq','split','4207803TgaVyu','validation','6DbNDIk','4507980luFRzQ','utf8','startsWith','Unsafe\x20Skill\x20file\x20path:\x20','stringify','3761426EQFpZq','7720041FKUTny','from','Refusing\x20to\x20write\x20through\x20Skill\x20symlink\x20path:\x20'];a139_0x218b=function(){return _0x5ebd95;};return a139_0x218b();}export function resolveSymlinkTarget(_0x3954be){const _0x40d976=readlinkSync(_0x3954be);return isAbsolute(_0x40d976)?_0x40d976:resolve(dirname(_0x3954be),_0x40d976);}export function isPathInside(_0x3569c0,_0x33235a){const _0x48f2d8=a139_0x52d2,_0x496592=_0x3569c0[_0x48f2d8(0x115)](sep)?_0x3569c0:''+_0x3569c0+sep,_0x1a7b88=_0x33235a['endsWith'](sep)?_0x33235a:''+_0x33235a+sep;return _0x3569c0===_0x33235a||_0x496592[_0x48f2d8(0x10b)](_0x1a7b88);}export function realOrResolved(_0x3b7710){try{return realpathSync(_0x3b7710);}catch{return resolve(_0x3b7710);}}export function lstatIfPresent(_0x4a1d97){try{return lstatSync(_0x4a1d97);}catch{return undefined;}}function a139_0x52d2(_0x1c46fa,_0x94f621){_0x1c46fa=_0x1c46fa-0x10a;const _0x218b06=a139_0x218b();let _0x52d216=_0x218b06[_0x1c46fa];return _0x52d216;}export function writeTextAtomic(_0x5f3b52,_0x20d9ac,_0x2d3e21){const _0x100807=a139_0x52d2;writeBytesAtomic(_0x5f3b52,Buffer[_0x100807(0x110)](_0x20d9ac,_0x100807(0x10a)),_0x2d3e21);}export function writeBytesAtomic(_0x130c8f,_0x30c8c9,_0x32bb39){const _0x4d5c8d=_0x130c8f+'.tmp';try{writeFileSync(_0x4d5c8d,_0x30c8c9,{'mode':_0x32bb39}),renameSync(_0x4d5c8d,_0x130c8f);}catch(_0x5909bf){try{rmSync(_0x4d5c8d,{'force':!![]});}catch{}throw _0x5909bf;}}export function writeJsonAtomic(_0x3f7d91,_0x120388){const _0x22f048=a139_0x52d2;writeTextAtomic(_0x3f7d91,JSON[_0x22f048(0x10d)](_0x120388,null,0x2)+'\x0a',0x180);}
1
+ function a147_0x1994(_0x1a3582,_0x148ca6){_0x1a3582=_0x1a3582-0x17b;const _0xac03a4=a147_0xac03();let _0x1994c5=_0xac03a4[_0x1a3582];return _0x1994c5;}(function(_0x1339ec,_0x5e2b8b){const _0x530081=a147_0x1994,_0xb24a86=_0x1339ec();while(!![]){try{const _0x1482bb=-parseInt(_0x530081(0x183))/0x1*(parseInt(_0x530081(0x187))/0x2)+-parseInt(_0x530081(0x181))/0x3*(-parseInt(_0x530081(0x186))/0x4)+parseInt(_0x530081(0x18c))/0x5*(parseInt(_0x530081(0x17e))/0x6)+parseInt(_0x530081(0x17d))/0x7+parseInt(_0x530081(0x185))/0x8+-parseInt(_0x530081(0x18a))/0x9+parseInt(_0x530081(0x180))/0xa*(-parseInt(_0x530081(0x18d))/0xb);if(_0x1482bb===_0x5e2b8b)break;else _0xb24a86['push'](_0xb24a86['shift']());}catch(_0x45b1b8){_0xb24a86['push'](_0xb24a86['shift']());}}}(a147_0xac03,0x5412f));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(_0x53d8b9,_0x3295a6){const _0x5cc3db=a147_0x1994,_0x32d876=normalizeSkillRelativePath(_0x3295a6),_0x3a0f70=realOrResolved(_0x53d8b9),_0x13a17d=resolve(_0x3a0f70,..._0x32d876[_0x5cc3db(0x184)]('/'));if(!isPathInside(_0x13a17d,_0x3a0f70))throw CliErrors['validation']('Unsafe\x20Skill\x20file\x20path:\x20'+_0x3295a6);return ensureNoSymlinkInManagedPath(_0x3a0f70,_0x32d876),_0x13a17d;}export function ensureNoSymlinkInManagedPath(_0x134e2d,_0x336844){const _0x55c0c5=a147_0x1994;let _0x712910=_0x134e2d;for(const _0x2ab148 of _0x336844[_0x55c0c5(0x184)]('/')){_0x712910=resolve(_0x712910,_0x2ab148);const _0x900b49=lstatIfPresent(_0x712910);if(_0x900b49?.['isSymbolicLink']())throw CliErrors[_0x55c0c5(0x188)](_0x55c0c5(0x182)+_0x336844);}}export function isDanglingSymlink(_0x9585c9){const _0x35ba4d=a147_0x1994;try{return lstatSync(_0x9585c9)[_0x35ba4d(0x189)]();}catch{return![];}}export function resolveSymlinkTarget(_0x440561){const _0x214071=readlinkSync(_0x440561);return isAbsolute(_0x214071)?_0x214071:resolve(dirname(_0x440561),_0x214071);}export function isPathInside(_0x18eaf8,_0x2ead10){const _0x553228=a147_0x1994,_0x44bb4=_0x18eaf8[_0x553228(0x17f)](sep)?_0x18eaf8:''+_0x18eaf8+sep,_0x41c028=_0x2ead10[_0x553228(0x17f)](sep)?_0x2ead10:''+_0x2ead10+sep;return _0x18eaf8===_0x2ead10||_0x44bb4['startsWith'](_0x41c028);}export function realOrResolved(_0x15b319){try{return realpathSync(_0x15b319);}catch{return resolve(_0x15b319);}}export function lstatIfPresent(_0x2b47d8){try{return lstatSync(_0x2b47d8);}catch{return undefined;}}export function writeTextAtomic(_0x363f53,_0x4c7ed1,_0x5b4223){const _0x1857dc=a147_0x1994;writeBytesAtomic(_0x363f53,Buffer[_0x1857dc(0x18b)](_0x4c7ed1,_0x1857dc(0x17c)),_0x5b4223);}function a147_0xac03(){const _0x1980fc=['40818hNgmTG','endsWith','20lqbrNV','117kPQVGL','Refusing\x20to\x20write\x20through\x20Skill\x20symlink\x20path:\x20','1907CBbbDn','split','4820648DWVFlY','52128xrtNgJ','166QDRWEJ','validation','isSymbolicLink','2011311XXQPkB','from','30yPyutr','3433892xEeGpQ','.tmp','stringify','utf8','1391768vOJaVf'];a147_0xac03=function(){return _0x1980fc;};return a147_0xac03();}export function writeBytesAtomic(_0x5f4a9f,_0x368e4d,_0x15c1ea){const _0x39e274=a147_0x1994,_0x2a9ba7=_0x5f4a9f+_0x39e274(0x18e);try{writeFileSync(_0x2a9ba7,_0x368e4d,{'mode':_0x15c1ea}),renameSync(_0x2a9ba7,_0x5f4a9f);}catch(_0x1ed788){try{rmSync(_0x2a9ba7,{'force':!![]});}catch{}throw _0x1ed788;}}export function writeJsonAtomic(_0x29d984,_0x3162ca){const _0x4b3ad2=a147_0x1994;writeTextAtomic(_0x29d984,JSON[_0x4b3ad2(0x17b)](_0x3162ca,null,0x2)+'\x0a',0x180);}
@@ -1 +1 @@
1
- function a140_0x443b(){const _0x442ad2=['10528299FWleiH','sha256','update','244892kcgHkS','44jCbdVp','hex','size','21RCeMQX','2473863CxvvfO','6IfqwaM','digest','3365905AwFtTQ','32DcSYVx','1792320iZHpyv','1IaxfrY','7727604lxZyEo','1287502LAoDFI'];a140_0x443b=function(){return _0x442ad2;};return a140_0x443b();}(function(_0xba4deb,_0x5a9786){const _0xc9b645=a140_0x4f8c,_0x4ab23c=_0xba4deb();while(!![]){try{const _0x22072b=parseInt(_0xc9b645(0x1c0))/0x1*(-parseInt(_0xc9b645(0x1c2))/0x2)+-parseInt(_0xc9b645(0x1b9))/0x3*(parseInt(_0xc9b645(0x1c6))/0x4)+parseInt(_0xc9b645(0x1bd))/0x5*(parseInt(_0xc9b645(0x1bb))/0x6)+-parseInt(_0xc9b645(0x1ba))/0x7*(parseInt(_0xc9b645(0x1be))/0x8)+parseInt(_0xc9b645(0x1c3))/0x9+parseInt(_0xc9b645(0x1bf))/0xa*(parseInt(_0xc9b645(0x1b6))/0xb)+parseInt(_0xc9b645(0x1c1))/0xc;if(_0x22072b===_0x5a9786)break;else _0x4ab23c['push'](_0x4ab23c['shift']());}catch(_0x561461){_0x4ab23c['push'](_0x4ab23c['shift']());}}}(a140_0x443b,0xaf473));function a140_0x4f8c(_0x44e35b,_0x2130b8){_0x44e35b=_0x44e35b-0x1b6;const _0x443b00=a140_0x443b();let _0x4f8c57=_0x443b00[_0x44e35b];return _0x4f8c57;}import{createHash}from'node:crypto';import{fileContent,normalizeManifestFiles}from'./local-files.js';export function contentHash(_0x32674d){const _0x4831a7=a140_0x4f8c;return createHash(_0x4831a7(0x1c4))[_0x4831a7(0x1c5)](_0x32674d)[_0x4831a7(0x1bc)](_0x4831a7(0x1b7));}export function fileHash(_0x530139){return bufferSha256(fileContent(_0x530139));}export function bufferSha256(_0xd67b45){const _0x4da699=a140_0x4f8c;return createHash(_0x4da699(0x1c4))[_0x4da699(0x1c5)](_0xd67b45)[_0x4da699(0x1bc)](_0x4da699(0x1b7));}export function fileTreeHash(_0x2fb4ff){const _0x2d8dea=a140_0x4f8c,_0x27c63e=createHash('sha256');for(const _0x399020 of normalizeManifestFiles(_0x2fb4ff)){_0x27c63e[_0x2d8dea(0x1c5)](_0x399020['path']),_0x27c63e['update']('\x00'),_0x27c63e[_0x2d8dea(0x1c5)](_0x399020[_0x2d8dea(0x1c4)]),_0x27c63e[_0x2d8dea(0x1c5)]('\x00'),_0x27c63e[_0x2d8dea(0x1c5)](String(_0x399020[_0x2d8dea(0x1b8)])),_0x27c63e['update']('\x00');}return _0x27c63e[_0x2d8dea(0x1bc)]('hex');}
1
+ (function(_0x233b42,_0x188ca0){const _0x5a8871=a148_0x5f34,_0x4314b6=_0x233b42();while(!![]){try{const _0x31d454=-parseInt(_0x5a8871(0xab))/0x1+parseInt(_0x5a8871(0xb5))/0x2*(parseInt(_0x5a8871(0xaf))/0x3)+-parseInt(_0x5a8871(0xb0))/0x4*(parseInt(_0x5a8871(0xaa))/0x5)+parseInt(_0x5a8871(0xb7))/0x6*(-parseInt(_0x5a8871(0xac))/0x7)+parseInt(_0x5a8871(0xb3))/0x8+-parseInt(_0x5a8871(0xb2))/0x9+parseInt(_0x5a8871(0xb9))/0xa*(parseInt(_0x5a8871(0xad))/0xb);if(_0x31d454===_0x188ca0)break;else _0x4314b6['push'](_0x4314b6['shift']());}catch(_0x266114){_0x4314b6['push'](_0x4314b6['shift']());}}}(a148_0x387f,0xa3216));import{createHash}from'node:crypto';import{fileContent,normalizeManifestFiles}from'./local-files.js';function a148_0x5f34(_0x3ea7fe,_0x34addb){_0x3ea7fe=_0x3ea7fe-0xaa;const _0x387fac=a148_0x387f();let _0x5f3474=_0x387fac[_0x3ea7fe];return _0x5f3474;}export function contentHash(_0x4b4b5f){const _0x58137d=a148_0x5f34;return createHash(_0x58137d(0xb4))['update'](_0x4b4b5f)[_0x58137d(0xb1)](_0x58137d(0xb6));}export function fileHash(_0x112837){return bufferSha256(fileContent(_0x112837));}function a148_0x387f(){const _0x415389=['223134pMOhFP','4hiLmxg','digest','11800620ObFUAO','6383144XPNMVA','sha256','28lxQJur','hex','1567476DwYfFM','size','70buqaNx','3777290keKbWW','513293LLYMXX','21DdrpqY','3445618LQAwsV','update'];a148_0x387f=function(){return _0x415389;};return a148_0x387f();}export function bufferSha256(_0x4b4884){const _0xd15e1a=a148_0x5f34;return createHash(_0xd15e1a(0xb4))[_0xd15e1a(0xae)](_0x4b4884)[_0xd15e1a(0xb1)]('hex');}export function fileTreeHash(_0x1f01bd){const _0x4c9765=a148_0x5f34,_0x4c6bd1=createHash(_0x4c9765(0xb4));for(const _0x41803c of normalizeManifestFiles(_0x1f01bd)){_0x4c6bd1[_0x4c9765(0xae)](_0x41803c['path']),_0x4c6bd1[_0x4c9765(0xae)]('\x00'),_0x4c6bd1[_0x4c9765(0xae)](_0x41803c['sha256']),_0x4c6bd1['update']('\x00'),_0x4c6bd1['update'](String(_0x41803c[_0x4c9765(0xb8)])),_0x4c6bd1[_0x4c9765(0xae)]('\x00');}return _0x4c6bd1[_0x4c9765(0xb1)](_0x4c9765(0xb6));}
@@ -1 +1 @@
1
- const a141_0x5cfe47=a141_0x2e56;(function(_0x12dd4c,_0x24bad5){const _0x3501c2=a141_0x2e56,_0x66639=_0x12dd4c();while(!![]){try{const _0xb5b5db=parseInt(_0x3501c2(0x17e))/0x1+-parseInt(_0x3501c2(0x180))/0x2*(-parseInt(_0x3501c2(0x175))/0x3)+-parseInt(_0x3501c2(0x177))/0x4*(parseInt(_0x3501c2(0x181))/0x5)+parseInt(_0x3501c2(0x174))/0x6+parseInt(_0x3501c2(0x178))/0x7*(-parseInt(_0x3501c2(0x172))/0x8)+parseInt(_0x3501c2(0x176))/0x9*(parseInt(_0x3501c2(0x170))/0xa)+-parseInt(_0x3501c2(0x17a))/0xb;if(_0xb5b5db===_0x24bad5)break;else _0x66639['push'](_0x66639['shift']());}catch(_0x5a588b){_0x66639['push'](_0x66639['shift']());}}}(a141_0x11c3,0x90322));import{resolve}from'node:path';function a141_0x2e56(_0x26793b,_0x5142b7){_0x26793b=_0x26793b-0x170;const _0x11c315=a141_0x11c3();let _0x2e560c=_0x11c315[_0x26793b];return _0x2e560c;}import{resolveSkillSyncPaths,runtimeAgentSkillRoots,safePathSegment}from'./paths.js';export function resolveRuntimeSkillInstallTarget(_0x56af57,_0x3b921a=a141_0x5cfe47(0x179),_0x3de4b3={}){const _0x3b9440=a141_0x5cfe47,_0x4727a0=resolveSkillSyncPaths(_0x3de4b3),_0x7cf5e1=safePathSegment(_0x56af57,_0x3b9440(0x17f)),_0x47b956=_0x3b921a===_0x3b9440(0x17b)?[resolve(_0x3de4b3['cwd']??process['cwd'](),_0x3b9440(0x17c),_0x3b9440(0x17d))]:runtimeAgentSkillRoots(_0x4727a0);return Object[_0x3b9440(0x173)]({'scope':_0x3b921a,'appCode':_0x7cf5e1,'skillRoots':Object[_0x3b9440(0x173)](_0x47b956),'managedRoot':_0x4727a0[_0x3b9440(0x171)]});}function a141_0x11c3(){const _0xc473e2=['7BnMlID','global','20024719BhCTMb','project','.agents','skills','1086704MbdwWC','appCode','364WSfqGE','2095OFmFlW','11307770kXiwzr','managedRoot','685048vUJGiz','freeze','6407670CNDjhN','3768dBxDtW','9TNlKPO','9712VaFvsl'];a141_0x11c3=function(){return _0xc473e2;};return a141_0x11c3();}
1
+ (function(_0x45cbce,_0x4c3807){const _0x58cc1e=a149_0x5a3c,_0x1eb5c9=_0x45cbce();while(!![]){try{const _0x439f55=parseInt(_0x58cc1e(0xdb))/0x1+-parseInt(_0x58cc1e(0xd8))/0x2*(parseInt(_0x58cc1e(0xdd))/0x3)+parseInt(_0x58cc1e(0xd3))/0x4+-parseInt(_0x58cc1e(0xd4))/0x5*(parseInt(_0x58cc1e(0xd6))/0x6)+parseInt(_0x58cc1e(0xe0))/0x7+-parseInt(_0x58cc1e(0xd2))/0x8*(-parseInt(_0x58cc1e(0xde))/0x9)+parseInt(_0x58cc1e(0xd9))/0xa;if(_0x439f55===_0x4c3807)break;else _0x1eb5c9['push'](_0x1eb5c9['shift']());}catch(_0x17416c){_0x1eb5c9['push'](_0x1eb5c9['shift']());}}}(a149_0x1724,0x8df66));import{resolve}from'node:path';function a149_0x5a3c(_0x1a4e7c,_0x29f025){_0x1a4e7c=_0x1a4e7c-0xd2;const _0x172476=a149_0x1724();let _0x5a3c59=_0x172476[_0x1a4e7c];return _0x5a3c59;}function a149_0x1724(){const _0x3fd40e=['freeze','4036896tAhLgl','cwd','990680fmUhcF','8261500KSSwdS','skills','151929HfRRjt','managedRoot','6ZssFor','18XekpPl','project','762895LWJIEU','appCode','3226616kLAhir','1405024fMUVkt','5ZgRrTQ'];a149_0x1724=function(){return _0x3fd40e;};return a149_0x1724();}import{resolveSkillSyncPaths,runtimeAgentSkillRoots,safePathSegment}from'./paths.js';export function resolveRuntimeSkillInstallTarget(_0xc73e5c,_0x2c670f='global',_0x5d64a2={}){const _0x47826f=a149_0x5a3c,_0x1d7988=resolveSkillSyncPaths(_0x5d64a2),_0x3cea24=safePathSegment(_0xc73e5c,_0x47826f(0xe1)),_0x26dd98=_0x2c670f===_0x47826f(0xdf)?[resolve(_0x5d64a2[_0x47826f(0xd7)]??process[_0x47826f(0xd7)](),'.agents',_0x47826f(0xda))]:runtimeAgentSkillRoots(_0x1d7988);return Object[_0x47826f(0xd5)]({'scope':_0x2c670f,'appCode':_0x3cea24,'skillRoots':Object[_0x47826f(0xd5)](_0x26dd98),'managedRoot':_0x1d7988[_0x47826f(0xdc)]});}
@@ -1 +1 @@
1
- const a142_0x1635b4=a142_0x244c;(function(_0x1c0963,_0x1f3c7b){const _0x709521=a142_0x244c,_0xef4a71=_0x1c0963();while(!![]){try{const _0x1d321d=-parseInt(_0x709521(0x1c4))/0x1+-parseInt(_0x709521(0x1c8))/0x2*(parseInt(_0x709521(0x1c9))/0x3)+-parseInt(_0x709521(0x1bb))/0x4*(-parseInt(_0x709521(0x1c2))/0x5)+parseInt(_0x709521(0x1b6))/0x6+-parseInt(_0x709521(0x1ea))/0x7+-parseInt(_0x709521(0x1d1))/0x8*(-parseInt(_0x709521(0x1f1))/0x9)+-parseInt(_0x709521(0x1d6))/0xa*(parseInt(_0x709521(0x1e0))/0xb);if(_0x1d321d===_0x1f3c7b)break;else _0xef4a71['push'](_0xef4a71['shift']());}catch(_0x49b223){_0xef4a71['push'](_0xef4a71['shift']());}}}(a142_0x53b1,0xa4ee8));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import a142_0x4be12c 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}=a142_0x4be12c,RESERVED_PROJECT_SKILL_CODES=new Set([a142_0x1635b4(0x1ee),a142_0x1635b4(0x1e6),a142_0x1635b4(0x1eb)]);export function linkEffectiveRuntimeSkills(_0xac8b53,_0x3ecc43){const _0x1688d9=a142_0x1635b4,_0x38e03c=new Map();for(const _0x144ce6 of _0xac8b53){const _0x585f69=_0x144ce6[_0x1688d9(0x1bd)][_0x1688d9(0x1bf)];if(!_0x585f69)continue;const _0x4f136d=_0x38e03c[_0x1688d9(0x1d9)](_0x585f69);(!_0x4f136d||_0x144ce6[_0x1688d9(0x1e5)]==='personal')&&_0x38e03c[_0x1688d9(0x1d7)](_0x585f69,_0x144ce6);}const _0x2d12e0=[];for(const _0x141377 of _0x38e03c[_0x1688d9(0x1be)]()){const _0x773345=requireSkillCode(_0x141377['skill']),_0x36e391=readMetadataIfPresent(_0x141377[_0x1688d9(0x1d4)]);if(_0x36e391?.[_0x1688d9(0x1e2)]!==_0x3ecc43['appCode']||_0x36e391[_0x1688d9(0x1bf)]!==_0x773345)throw CliErrors[_0x1688d9(0x1e1)](_0x1688d9(0x1dd)+_0x3ecc43[_0x1688d9(0x1e2)]+':\x20'+_0x141377[_0x1688d9(0x1d4)]);const _0x58d92a=runtimeSkillLinkName(_0x3ecc43,_0x773345);for(const _0x322b97 of _0x3ecc43['skillRoots']){_0x2d12e0[_0x1688d9(0x1dc)](ensureManagedSymlink(resolve(_0x322b97,_0x58d92a),_0x141377[_0x1688d9(0x1c1)],_0x3ecc43,_0x773345));}}return _0x2d12e0;}export function pruneStaleRuntimeSkillLinks(_0x18b48c,_0x1e107d,_0x568ffd){const _0x465939=a142_0x1635b4,_0x368118=new Set([..._0x1e107d][_0x465939(0x1ed)](_0x83cca0=>_0x83cca0['trim']())[_0x465939(0x1b4)](Boolean)),_0x1d468b=_0x568ffd?new Set([..._0x568ffd][_0x465939(0x1ed)](_0x20914e=>_0x20914e[_0x465939(0x1c7)]())['filter'](Boolean)):undefined,_0x173ca6=[];for(const _0x218b8a of _0x18b48c[_0x465939(0x1cd)]){for(const _0x23c0ca of managedTargetSkillLinkPaths(_0x218b8a,_0x18b48c)){const _0x278dde=runtimeSkillCodeFromLink(_0x18b48c,_0x23c0ca);if(_0x1d468b&&!_0x1d468b['has'](_0x278dde))continue;if(_0x368118[_0x465939(0x1f2)](_0x278dde))continue;_0x173ca6['push'](removeManagedSkillLink(_0x23c0ca,_0x18b48c,_0x278dde));}}return _0x173ca6;}export function pruneStaleRuntimeSkillCache(_0xa7125a,_0x555991={}){const _0x513d8f=a142_0x1635b4,_0x222af7=new Set([..._0xa7125a[_0x513d8f(0x1d5)]][_0x513d8f(0x1ed)](_0x5e06e9=>_0x5e06e9[_0x513d8f(0x1c7)]())[_0x513d8f(0x1b4)](Boolean)),_0x23d65e=_0xa7125a[_0x513d8f(0x1ba)]?new Set([..._0xa7125a[_0x513d8f(0x1ba)]]['map'](_0x6e47d5=>_0x6e47d5[_0x513d8f(0x1c7)]())[_0x513d8f(0x1b4)](Boolean)):undefined,_0x153eb1=_0xa7125a[_0x513d8f(0x1c5)]??[_0x513d8f(0x1c0),_0x513d8f(0x1da)],_0x25c469=resolve(getRuntimeSkillCacheRoot(_0xa7125a[_0x513d8f(0x1c3)],_0xa7125a[_0x513d8f(0x1c6)],_0x555991),safePathSegment(_0xa7125a[_0x513d8f(0x1e2)],_0x513d8f(0x1e2))),_0x6cc1fe=[];for(const _0x4d67a2 of _0x153eb1){const _0x29e9d8=resolve(_0x25c469,_0x4d67a2);if(!existsSync(_0x29e9d8))continue;for(const _0x855b38 of readdirSync(_0x29e9d8,{'withFileTypes':!![]})){if(!_0x855b38['isDirectory']())continue;const _0xa7516=_0x855b38[_0x513d8f(0x1ce)];if(_0x23d65e&&!_0x23d65e[_0x513d8f(0x1f2)](_0xa7516))continue;if(_0x222af7[_0x513d8f(0x1f2)](_0xa7516))continue;const _0x1b55c5=resolve(_0x29e9d8,_0xa7516),_0x5ee1e1=readMetadataIfPresent(resolve(_0x1b55c5,METADATA_FILE));if(_0x5ee1e1?.[_0x513d8f(0x1e2)]!==_0xa7125a['appCode']||_0x5ee1e1[_0x513d8f(0x1e5)]!==_0x4d67a2||_0x5ee1e1[_0x513d8f(0x1bf)]!==_0xa7516){_0x6cc1fe[_0x513d8f(0x1dc)]({'path':_0x1b55c5,'action':_0x513d8f(0x1cb),'reason':_0x513d8f(0x1e7)});continue;}if(isLinkedFromAnyRoot(_0x1b55c5,_0xa7125a[_0x513d8f(0x1ef)]??[])){_0x6cc1fe[_0x513d8f(0x1dc)]({'path':_0x1b55c5,'action':_0x513d8f(0x1cb),'reason':_0x513d8f(0x1b7)});continue;}removeSync(_0x1b55c5),_0x6cc1fe[_0x513d8f(0x1dc)]({'path':_0x1b55c5,'action':_0x513d8f(0x1ec)});}}return _0x6cc1fe;}export function linkGlobalRuntimeSkills(_0x392e85,_0x2bf7eb={}){const _0x1671d5=a142_0x1635b4,_0x5c7fc7=resolveSkillSyncPaths(_0x2bf7eb),_0x4cd1f8=[];for(const _0x30a189 of _0x392e85){if(_0x30a189[_0x1671d5(0x1e5)]!==_0x1671d5(0x1d3))throw CliErrors[_0x1671d5(0x1e1)](_0x1671d5(0x1e9)+_0x30a189[_0x1671d5(0x1e5)]);const _0x3f7b23=requireSkillCode(_0x30a189[_0x1671d5(0x1bd)]),_0x29303f=copyManagedSkillDirectory(_0x30a189[_0x1671d5(0x1c1)],resolve(_0x5c7fc7[_0x1671d5(0x1de)],_0x3f7b23));_0x4cd1f8['push']({..._0x29303f,'contentHash':_0x30a189[_0x1671d5(0x1cc)]});}return _0x4cd1f8;}function ensureManagedSymlink(_0xd6b231,_0x18f420,_0x123d32,_0x5cf4b5){const _0x27610c=a142_0x1635b4;mkdirSync(dirname(_0xd6b231),{'recursive':!![],'mode':0x1c0});if(existsSync(_0xd6b231)||isDanglingSymlink(_0xd6b231)){const _0x5a8766=lstatSync(_0xd6b231);if(!_0x5a8766[_0x27610c(0x1e4)]())throw CliErrors[_0x27610c(0x1e1)](_0x27610c(0x1bc)+_0xd6b231);const _0xc45789=resolveSymlinkTarget(_0xd6b231);if(!isPathInside(realOrResolved(_0xc45789),realOrResolved(_0x123d32[_0x27610c(0x1f0)])))throw CliErrors[_0x27610c(0x1e1)]('Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20'+_0xd6b231);if(realOrResolved(_0xc45789)===realOrResolved(_0x18f420))return{'path':_0xd6b231,'target':_0x18f420,'action':_0x27610c(0x1e3)};const _0x25c0d8=readMetadataIfPresent(resolve(_0xc45789,METADATA_FILE));if(_0x123d32[_0x27610c(0x1e5)]==='project'&&(_0x25c0d8?.[_0x27610c(0x1e2)]!==_0x123d32[_0x27610c(0x1e2)]||_0x25c0d8[_0x27610c(0x1bf)]!==_0x5cf4b5))throw CliErrors['validation'](_0x27610c(0x1df)+_0xd6b231);return unlinkSync(_0xd6b231),symlinkSync(_0x18f420,_0xd6b231,_0x27610c(0x1c1)),{'path':_0xd6b231,'target':_0x18f420,'action':'updated'};}return symlinkSync(_0x18f420,_0xd6b231,_0x27610c(0x1c1)),{'path':_0xd6b231,'target':_0x18f420,'action':_0x27610c(0x1b5)};}function managedTargetSkillLinkPaths(_0x2f8d42,_0x2a9c02){const _0x12707e=a142_0x1635b4;if(!existsSync(_0x2f8d42))return[];const _0x43c9c2=_0x2a9c02[_0x12707e(0x1e2)]+'--';return readdirSync(_0x2f8d42,{'withFileTypes':!![]})['filter'](_0xbe8e17=>_0x2a9c02[_0x12707e(0x1e5)]===_0x12707e(0x1e8)||_0xbe8e17[_0x12707e(0x1ce)][_0x12707e(0x1d2)](_0x43c9c2))[_0x12707e(0x1ed)](_0x4914f0=>resolve(_0x2f8d42,_0x4914f0[_0x12707e(0x1ce)]));}function removeManagedSkillLink(_0x27970f,_0x3080af,_0x223fb1){const _0x1436de=a142_0x1635b4,_0x234559=lstatIfPresent(_0x27970f);if(!_0x234559?.[_0x1436de(0x1e4)]())return{'path':_0x27970f,'action':'skipped','reason':'not-managed-symlink'};const _0x40ee16=resolveSymlinkTarget(_0x27970f);if(!isPathInside(realOrResolved(_0x40ee16),realOrResolved(_0x3080af[_0x1436de(0x1f0)])))return{'path':_0x27970f,'action':_0x1436de(0x1cb),'reason':'external-symlink'};const _0x4e47c2=readMetadataIfPresent(resolve(_0x40ee16,METADATA_FILE));if(_0x3080af[_0x1436de(0x1e5)]===_0x1436de(0x1e8)&&(_0x4e47c2?.[_0x1436de(0x1e2)]!==_0x3080af['appCode']||_0x4e47c2[_0x1436de(0x1bf)]!==_0x223fb1))return{'path':_0x27970f,'action':_0x1436de(0x1cb),'reason':'metadata-mismatch'};return unlinkSync(_0x27970f),{'path':_0x27970f,'action':_0x1436de(0x1ec)};}function isLinkedFromAnyRoot(_0x30cc4c,_0x33c9ef){const _0xa975e1=a142_0x1635b4,_0x42d5e5=realOrResolved(_0x30cc4c);for(const _0xb55839 of _0x33c9ef){if(!existsSync(_0xb55839))continue;for(const _0x123c32 of readdirSync(_0xb55839,{'withFileTypes':!![]})){if(!_0x123c32[_0xa975e1(0x1e4)]())continue;const _0x23e9f6=resolve(_0xb55839,_0x123c32[_0xa975e1(0x1ce)]);if(realOrResolved(resolveSymlinkTarget(_0x23e9f6))===_0x42d5e5)return!![];}}return![];}function runtimeSkillLinkName(_0x2ea6fc,_0x32fa42){const _0x2041d8=a142_0x1635b4,_0x1efb8a=safePathSegment(_0x32fa42,_0x2041d8(0x1bf));if(_0x2ea6fc[_0x2041d8(0x1e5)]===_0x2041d8(0x1e8)&&RESERVED_PROJECT_SKILL_CODES[_0x2041d8(0x1f2)](_0x1efb8a))throw CliErrors[_0x2041d8(0x1e1)](_0x2041d8(0x1b8)+_0x1efb8a);return _0x2ea6fc[_0x2041d8(0x1e5)]===_0x2041d8(0x1e8)?_0x1efb8a:_0x2ea6fc[_0x2041d8(0x1e2)]+'--'+_0x1efb8a;}function a142_0x53b1(){const _0x444abf=['builtin','metadataPath','activeSkillCodes','850530fBWNCX','set','Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20','get','company','updated','push','Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20','agentsSkillsDir','Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20','33eWELgE','validation','appCode','unchanged','isSymbolicLink','scope','runtime-observe','metadata-mismatch','project','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','3159618iLCRUX','secret-retriever','removed','map','lovrabet','protectedLinkRoots','managedRoot','12105630XwHXAi','has','length','filter','created','1624812fntMHO','linked-from-protected-root','Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20','Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20','pruneSkillCodes','1781908QdyytH','Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20','skill','values','skillCode','personal','dir','10BZWxcn','env','432213WbRXGb','scopes','accessKey','trim','120Usqice','34626HQvJSv','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20','skipped','contentHash','skillRoots','name','slice','Refusing\x20to\x20copy\x20Skill\x20symlink:\x20','8ImJuqn','startsWith'];a142_0x53b1=function(){return _0x444abf;};return a142_0x53b1();}function a142_0x244c(_0xf22f1a,_0x5eebb0){_0xf22f1a=_0xf22f1a-0x1b4;const _0x53b1c2=a142_0x53b1();let _0x244c38=_0x53b1c2[_0xf22f1a];return _0x244c38;}function runtimeSkillCodeFromLink(_0x1ce9e6,_0x54b371){const _0x5320e4=a142_0x1635b4,_0x4aa568=basename(_0x54b371);return _0x1ce9e6['scope']===_0x5320e4(0x1e8)?_0x4aa568:_0x4aa568[_0x5320e4(0x1cf)]((_0x1ce9e6['appCode']+'--')[_0x5320e4(0x1f3)]);}export function copyManagedSkillDirectory(_0x2d1a52,_0x49fe5b){const _0x559def=a142_0x1635b4,_0x584bd=resolve(_0x49fe5b,METADATA_FILE),_0x2994ad=existsSync(_0x49fe5b);if(_0x2994ad){const _0x5e5baa=lstatSync(_0x49fe5b);if(_0x5e5baa[_0x559def(0x1e4)]())throw CliErrors[_0x559def(0x1e1)](_0x559def(0x1b9)+_0x49fe5b);if(!_0x5e5baa['isDirectory']())throw CliErrors[_0x559def(0x1e1)](_0x559def(0x1d8)+_0x49fe5b);const _0x32aafa=readMetadataIfPresent(_0x584bd);if(_0x32aafa?.[_0x559def(0x1e5)]!==_0x559def(0x1d3))throw CliErrors[_0x559def(0x1e1)](_0x559def(0x1ca)+_0x49fe5b);}ensureDirSync(dirname(_0x49fe5b));const _0x4ff9f7=_0x2994ad?readMetadataIfPresent(_0x584bd)?.[_0x559def(0x1cc)]:undefined,_0x384997=readMetadataIfPresent(resolve(_0x2d1a52,METADATA_FILE))?.['contentHash'];return _0x2994ad&&removeSync(_0x49fe5b),copySkillDirectory(_0x2d1a52,_0x49fe5b),{'path':_0x49fe5b,'target':_0x2d1a52,'action':!_0x2994ad?_0x559def(0x1b5):_0x4ff9f7===_0x384997?'unchanged':_0x559def(0x1db)};}function copySkillDirectory(_0x3a223b,_0x2b3048){copySync(_0x3a223b,_0x2b3048,{'dereference':![],'overwrite':!![],'filter'(_0x4ddc88){const _0x2fe5c0=a142_0x244c;if(lstatSync(_0x4ddc88)['isSymbolicLink']())throw CliErrors[_0x2fe5c0(0x1e1)](_0x2fe5c0(0x1d0)+_0x4ddc88);return!![];}});}
1
+ const a150_0x2e9264=a150_0x29fb;(function(_0x5e1feb,_0xd4f0e7){const _0x418787=a150_0x29fb,_0x52108b=_0x5e1feb();while(!![]){try{const _0x18e4b0=parseInt(_0x418787(0x1f5))/0x1*(-parseInt(_0x418787(0x1d3))/0x2)+parseInt(_0x418787(0x1d7))/0x3+parseInt(_0x418787(0x1cf))/0x4+parseInt(_0x418787(0x1e7))/0x5+-parseInt(_0x418787(0x1d1))/0x6*(parseInt(_0x418787(0x1ed))/0x7)+-parseInt(_0x418787(0x1d8))/0x8+-parseInt(_0x418787(0x1e6))/0x9*(-parseInt(_0x418787(0x1ce))/0xa);if(_0x18e4b0===_0xd4f0e7)break;else _0x52108b['push'](_0x52108b['shift']());}catch(_0x43aba3){_0x52108b['push'](_0x52108b['shift']());}}}(a150_0x3ade,0xc9874));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import a150_0x5889c4 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}=a150_0x5889c4,RESERVED_PROJECT_SKILL_CODES=new Set(['lovrabet',a150_0x2e9264(0x1de),a150_0x2e9264(0x1e2)]);export function linkEffectiveRuntimeSkills(_0x22a5cd,_0x556bee){const _0x1a2189=a150_0x2e9264,_0x504efe=new Map();for(const _0x5bfabb of _0x22a5cd){const _0xd90e5c=_0x5bfabb['skill'][_0x1a2189(0x1db)];if(!_0xd90e5c)continue;const _0x17171a=_0x504efe[_0x1a2189(0x1cd)](_0xd90e5c);(!_0x17171a||_0x5bfabb[_0x1a2189(0x1f1)]==='personal')&&_0x504efe['set'](_0xd90e5c,_0x5bfabb);}const _0x2f271c=[];for(const _0x3a543c of _0x504efe[_0x1a2189(0x1f9)]()){const _0x535a3e=requireSkillCode(_0x3a543c[_0x1a2189(0x1d6)]),_0x29e0c3=readMetadataIfPresent(_0x3a543c['metadataPath']);if(_0x29e0c3?.[_0x1a2189(0x1fe)]!==_0x556bee[_0x1a2189(0x1fe)]||_0x29e0c3[_0x1a2189(0x1db)]!==_0x535a3e)throw CliErrors[_0x1a2189(0x1da)](_0x1a2189(0x1ca)+_0x556bee[_0x1a2189(0x1fe)]+':\x20'+_0x3a543c[_0x1a2189(0x1f4)]);const _0x49ab68=runtimeSkillLinkName(_0x556bee,_0x535a3e);for(const _0x2b4942 of _0x556bee[_0x1a2189(0x1fb)]){_0x2f271c[_0x1a2189(0x1fc)](ensureManagedSymlink(resolve(_0x2b4942,_0x49ab68),_0x3a543c[_0x1a2189(0x1c8)],_0x556bee,_0x535a3e));}}return _0x2f271c;}function a150_0x29fb(_0x1de2c4,_0x40863f){_0x1de2c4=_0x1de2c4-0x1c8;const _0x3adefe=a150_0x3ade();let _0x29fb82=_0x3adefe[_0x1de2c4];return _0x29fb82;}export function pruneStaleRuntimeSkillLinks(_0xa1f1a6,_0x11f277,_0x3ea669){const _0x177c0e=a150_0x2e9264,_0x596351=new Set([..._0x11f277][_0x177c0e(0x1f2)](_0xddae22=>_0xddae22['trim']())[_0x177c0e(0x1ea)](Boolean)),_0x4f4acf=_0x3ea669?new Set([..._0x3ea669]['map'](_0x11ca12=>_0x11ca12[_0x177c0e(0x1f8)]())[_0x177c0e(0x1ea)](Boolean)):undefined,_0xb66f5e=[];for(const _0x3b2f62 of _0xa1f1a6[_0x177c0e(0x1fb)]){for(const _0x5d6ea5 of managedTargetSkillLinkPaths(_0x3b2f62,_0xa1f1a6)){const _0x310a2a=runtimeSkillCodeFromLink(_0xa1f1a6,_0x5d6ea5);if(_0x4f4acf&&!_0x4f4acf[_0x177c0e(0x1eb)](_0x310a2a))continue;if(_0x596351['has'](_0x310a2a))continue;_0xb66f5e[_0x177c0e(0x1fc)](removeManagedSkillLink(_0x5d6ea5,_0xa1f1a6,_0x310a2a));}}return _0xb66f5e;}export function pruneStaleRuntimeSkillCache(_0x149e8f,_0x1fd500={}){const _0x431402=a150_0x2e9264,_0x436a68=new Set([..._0x149e8f[_0x431402(0x1ff)]]['map'](_0x504eb7=>_0x504eb7[_0x431402(0x1f8)]())[_0x431402(0x1ea)](Boolean)),_0x1888ec=_0x149e8f['pruneSkillCodes']?new Set([..._0x149e8f[_0x431402(0x1f3)]][_0x431402(0x1f2)](_0x280ed0=>_0x280ed0['trim']())[_0x431402(0x1ea)](Boolean)):undefined,_0x30f67f=_0x149e8f[_0x431402(0x1d5)]??[_0x431402(0x1d2),_0x431402(0x203)],_0x28754f=resolve(getRuntimeSkillCacheRoot(_0x149e8f[_0x431402(0x1ee)],_0x149e8f['accessKey'],_0x1fd500),safePathSegment(_0x149e8f[_0x431402(0x1fe)],_0x431402(0x1fe))),_0x4c0bd5=[];for(const _0x1ac19c of _0x30f67f){const _0x41b99d=resolve(_0x28754f,_0x1ac19c);if(!existsSync(_0x41b99d))continue;for(const _0x21c68b of readdirSync(_0x41b99d,{'withFileTypes':!![]})){if(!_0x21c68b[_0x431402(0x1e3)]())continue;const _0xeae2f9=_0x21c68b['name'];if(_0x1888ec&&!_0x1888ec['has'](_0xeae2f9))continue;if(_0x436a68[_0x431402(0x1eb)](_0xeae2f9))continue;const _0x446ca9=resolve(_0x41b99d,_0xeae2f9),_0x17d00a=readMetadataIfPresent(resolve(_0x446ca9,METADATA_FILE));if(_0x17d00a?.[_0x431402(0x1fe)]!==_0x149e8f[_0x431402(0x1fe)]||_0x17d00a['scope']!==_0x1ac19c||_0x17d00a[_0x431402(0x1db)]!==_0xeae2f9){_0x4c0bd5['push']({'path':_0x446ca9,'action':'skipped','reason':'metadata-mismatch'});continue;}if(isLinkedFromAnyRoot(_0x446ca9,_0x149e8f[_0x431402(0x1e0)]??[])){_0x4c0bd5[_0x431402(0x1fc)]({'path':_0x446ca9,'action':_0x431402(0x1e5),'reason':'linked-from-protected-root'});continue;}removeSync(_0x446ca9),_0x4c0bd5[_0x431402(0x1fc)]({'path':_0x446ca9,'action':_0x431402(0x1cc)});}}return _0x4c0bd5;}export function linkGlobalRuntimeSkills(_0x3d2f3d,_0x336649={}){const _0x13defe=a150_0x2e9264,_0x35384f=resolveSkillSyncPaths(_0x336649),_0x6fe247=[];for(const _0xacbbe6 of _0x3d2f3d){if(_0xacbbe6[_0x13defe(0x1f1)]!==_0x13defe(0x200))throw CliErrors[_0x13defe(0x1da)](_0x13defe(0x1d0)+_0xacbbe6['scope']);const _0x16019b=requireSkillCode(_0xacbbe6[_0x13defe(0x1d6)]),_0x5345fe=copyManagedSkillDirectory(_0xacbbe6[_0x13defe(0x1c8)],resolve(_0x35384f[_0x13defe(0x1f7)],_0x16019b));_0x6fe247[_0x13defe(0x1fc)]({..._0x5345fe,'contentHash':_0xacbbe6[_0x13defe(0x1e9)]});}return _0x6fe247;}function ensureManagedSymlink(_0x46ad2e,_0x2a3a8f,_0x32deb8,_0x41534d){const _0x158d01=a150_0x2e9264;mkdirSync(dirname(_0x46ad2e),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x46ad2e)||isDanglingSymlink(_0x46ad2e)){const _0x5ac2c3=lstatSync(_0x46ad2e);if(!_0x5ac2c3[_0x158d01(0x1e4)]())throw CliErrors[_0x158d01(0x1da)](_0x158d01(0x1dd)+_0x46ad2e);const _0x26b81f=resolveSymlinkTarget(_0x46ad2e);if(!isPathInside(realOrResolved(_0x26b81f),realOrResolved(_0x32deb8[_0x158d01(0x1df)])))throw CliErrors[_0x158d01(0x1da)](_0x158d01(0x202)+_0x46ad2e);if(realOrResolved(_0x26b81f)===realOrResolved(_0x2a3a8f))return{'path':_0x46ad2e,'target':_0x2a3a8f,'action':'unchanged'};const _0x44e8ca=readMetadataIfPresent(resolve(_0x26b81f,METADATA_FILE));if(_0x32deb8['scope']===_0x158d01(0x1ef)&&(_0x44e8ca?.[_0x158d01(0x1fe)]!==_0x32deb8['appCode']||_0x44e8ca[_0x158d01(0x1db)]!==_0x41534d))throw CliErrors[_0x158d01(0x1da)](_0x158d01(0x1d4)+_0x46ad2e);return unlinkSync(_0x46ad2e),symlinkSync(_0x2a3a8f,_0x46ad2e,_0x158d01(0x1c8)),{'path':_0x46ad2e,'target':_0x2a3a8f,'action':_0x158d01(0x1dc)};}return symlinkSync(_0x2a3a8f,_0x46ad2e,_0x158d01(0x1c8)),{'path':_0x46ad2e,'target':_0x2a3a8f,'action':'created'};}function managedTargetSkillLinkPaths(_0x39bcaf,_0x1206a8){const _0x22570f=a150_0x2e9264;if(!existsSync(_0x39bcaf))return[];const _0x39d821=_0x1206a8[_0x22570f(0x1fe)]+'--';return readdirSync(_0x39bcaf,{'withFileTypes':!![]})[_0x22570f(0x1ea)](_0xb00555=>_0x1206a8[_0x22570f(0x1f1)]==='project'||_0xb00555[_0x22570f(0x1cb)][_0x22570f(0x1fd)](_0x39d821))['map'](_0x233147=>resolve(_0x39bcaf,_0x233147['name']));}function removeManagedSkillLink(_0xff8eb4,_0x421500,_0x5ae907){const _0x2734e6=a150_0x2e9264,_0x47a3f0=lstatIfPresent(_0xff8eb4);if(!_0x47a3f0?.['isSymbolicLink']())return{'path':_0xff8eb4,'action':_0x2734e6(0x1e5),'reason':'not-managed-symlink'};const _0x554b04=resolveSymlinkTarget(_0xff8eb4);if(!isPathInside(realOrResolved(_0x554b04),realOrResolved(_0x421500['managedRoot'])))return{'path':_0xff8eb4,'action':_0x2734e6(0x1e5),'reason':'external-symlink'};const _0x5b8e29=readMetadataIfPresent(resolve(_0x554b04,METADATA_FILE));if(_0x421500[_0x2734e6(0x1f1)]===_0x2734e6(0x1ef)&&(_0x5b8e29?.['appCode']!==_0x421500[_0x2734e6(0x1fe)]||_0x5b8e29[_0x2734e6(0x1db)]!==_0x5ae907))return{'path':_0xff8eb4,'action':_0x2734e6(0x1e5),'reason':_0x2734e6(0x1f0)};return unlinkSync(_0xff8eb4),{'path':_0xff8eb4,'action':_0x2734e6(0x1cc)};}function isLinkedFromAnyRoot(_0x4d3c22,_0x1e4c5f){const _0x495551=a150_0x2e9264,_0x5ac9ab=realOrResolved(_0x4d3c22);for(const _0x554ab8 of _0x1e4c5f){if(!existsSync(_0x554ab8))continue;for(const _0x346406 of readdirSync(_0x554ab8,{'withFileTypes':!![]})){if(!_0x346406['isSymbolicLink']())continue;const _0x5600c3=resolve(_0x554ab8,_0x346406[_0x495551(0x1cb)]);if(realOrResolved(resolveSymlinkTarget(_0x5600c3))===_0x5ac9ab)return!![];}}return![];}function a150_0x3ade(){const _0x8d7cb3=['Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20','runtime-observe','managedRoot','protectedLinkRoots','length','secret-retriever','isDirectory','isSymbolicLink','skipped','14103HQXOgi','1203450UPfqLy','Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20','contentHash','filter','has','Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20','117005yqKqbk','env','project','metadata-mismatch','scope','map','pruneSkillCodes','metadataPath','9265znrKmc','slice','agentsSkillsDir','trim','values','Refusing\x20to\x20copy\x20Skill\x20symlink:\x20','skillRoots','push','startsWith','appCode','activeSkillCodes','builtin','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20','Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20','company','dir','Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20','Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20','name','removed','get','10510wwbCSy','5077168tDKRHa','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','426xoVNCM','personal','122xIlmVP','Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20','scopes','skill','1183698XBTPxM','7792600qmRLMa','created','validation','skillCode','updated'];a150_0x3ade=function(){return _0x8d7cb3;};return a150_0x3ade();}function runtimeSkillLinkName(_0x400310,_0x13208){const _0xd125ac=a150_0x2e9264,_0x2e7fac=safePathSegment(_0x13208,'skillCode');if(_0x400310['scope']===_0xd125ac(0x1ef)&&RESERVED_PROJECT_SKILL_CODES[_0xd125ac(0x1eb)](_0x2e7fac))throw CliErrors['validation'](_0xd125ac(0x1ec)+_0x2e7fac);return _0x400310['scope']===_0xd125ac(0x1ef)?_0x2e7fac:_0x400310['appCode']+'--'+_0x2e7fac;}function runtimeSkillCodeFromLink(_0x5e32b7,_0x244292){const _0x2a1ffc=a150_0x2e9264,_0x3169a3=basename(_0x244292);return _0x5e32b7['scope']===_0x2a1ffc(0x1ef)?_0x3169a3:_0x3169a3[_0x2a1ffc(0x1f6)]((_0x5e32b7[_0x2a1ffc(0x1fe)]+'--')[_0x2a1ffc(0x1e1)]);}export function copyManagedSkillDirectory(_0x4453ad,_0x5249ef){const _0x2c640d=a150_0x2e9264,_0x1f6516=resolve(_0x5249ef,METADATA_FILE),_0x59705e=existsSync(_0x5249ef);if(_0x59705e){const _0x452359=lstatSync(_0x5249ef);if(_0x452359[_0x2c640d(0x1e4)]())throw CliErrors[_0x2c640d(0x1da)](_0x2c640d(0x1c9)+_0x5249ef);if(!_0x452359[_0x2c640d(0x1e3)]())throw CliErrors[_0x2c640d(0x1da)](_0x2c640d(0x1e8)+_0x5249ef);const _0x5ab618=readMetadataIfPresent(_0x1f6516);if(_0x5ab618?.[_0x2c640d(0x1f1)]!==_0x2c640d(0x200))throw CliErrors['validation'](_0x2c640d(0x201)+_0x5249ef);}ensureDirSync(dirname(_0x5249ef));const _0x495cf4=_0x59705e?readMetadataIfPresent(_0x1f6516)?.[_0x2c640d(0x1e9)]:undefined,_0x232622=readMetadataIfPresent(resolve(_0x4453ad,METADATA_FILE))?.['contentHash'];return _0x59705e&&removeSync(_0x5249ef),copySkillDirectory(_0x4453ad,_0x5249ef),{'path':_0x5249ef,'target':_0x4453ad,'action':!_0x59705e?_0x2c640d(0x1d9):_0x495cf4===_0x232622?'unchanged':_0x2c640d(0x1dc)};}function copySkillDirectory(_0xc8073b,_0x93ae97){copySync(_0xc8073b,_0x93ae97,{'dereference':![],'overwrite':!![],'filter'(_0x3ddf4b){const _0x47cd21=a150_0x29fb;if(lstatSync(_0x3ddf4b)[_0x47cd21(0x1e4)]())throw CliErrors[_0x47cd21(0x1da)](_0x47cd21(0x1fa)+_0x3ddf4b);return!![];}});}
@@ -1 +1 @@
1
- (function(_0x293377,_0x4c3678){const _0x11e593=a143_0x53e7,_0xfd5cb6=_0x293377();while(!![]){try{const _0xdd5029=-parseInt(_0x11e593(0x168))/0x1+parseInt(_0x11e593(0x177))/0x2+parseInt(_0x11e593(0x192))/0x3*(parseInt(_0x11e593(0x167))/0x4)+parseInt(_0x11e593(0x193))/0x5*(-parseInt(_0x11e593(0x17e))/0x6)+-parseInt(_0x11e593(0x179))/0x7+-parseInt(_0x11e593(0x187))/0x8+-parseInt(_0x11e593(0x183))/0x9*(-parseInt(_0x11e593(0x18f))/0xa);if(_0xdd5029===_0x4c3678)break;else _0xfd5cb6['push'](_0xfd5cb6['shift']());}catch(_0x2bc6e3){_0xfd5cb6['push'](_0xfd5cb6['shift']());}}}(a143_0x1d74,0x6644f));import{existsSync,readdirSync}from'node:fs';import{resolve}from'node:path';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';function a143_0x53e7(_0x3c82a0,_0x6f2a54){_0x3c82a0=_0x3c82a0-0x166;const _0x1d74bc=a143_0x1d74();let _0x53e7f4=_0x1d74bc[_0x3c82a0];return _0x53e7f4;}import{readMetadataIfPresent}from'./metadata.js';import{getRuntimeSkillCacheRoot,safePathSegment}from'./paths.js';import{isRuntimeSkillScope,normalizeRuntimeSkillScopes}from'./scopes.js';export function listLocalRuntimeSkills(_0xbc6329,_0x34e833,_0x4ffac8={}){const _0x71b5e8=a143_0x53e7,_0x174f01=safePathSegment(_0xbc6329[_0x71b5e8(0x16c)],_0x71b5e8(0x16c));if(_0x34e833[_0x71b5e8(0x16c)]!==_0x174f01)throw CliErrors[_0x71b5e8(0x16e)]('Runtime\x20Skill\x20install\x20target\x20app\x20mismatch:\x20'+_0x34e833['appCode']+_0x71b5e8(0x18e)+_0x174f01);const _0x554648=normalizeRuntimeSkillScopes(_0xbc6329[_0x71b5e8(0x180)]),_0x2b5bb1=new Set(_0x554648),_0x79484=_0xbc6329['code']?.[_0x71b5e8(0x185)](),_0x2e4d5c=new Map(),_0x3fa83c=resolve(getRuntimeSkillCacheRoot(_0xbc6329[_0x71b5e8(0x17d)],_0xbc6329[_0x71b5e8(0x170)],_0x4ffac8),_0x174f01);for(const _0x3b799f of _0x554648){for(const _0x535b67 of localSkillEntryDirs(resolve(_0x3fa83c,_0x3b799f))){collectLocalRuntimeSkill(_0x2e4d5c,_0x535b67,{'appCode':_0x174f01,'scopes':_0x2b5bb1,'code':_0x79484,'source':'cache'});}}for(const _0x47bf5a of _0x34e833[_0x71b5e8(0x18a)]){for(const _0x209104 of localSkillLinkCandidates(_0x47bf5a,_0x34e833,_0x2b5bb1)){collectLocalRuntimeSkill(_0x2e4d5c,_0x209104,{'appCode':_0x174f01,'scopes':_0x2b5bb1,'code':_0x79484,'source':_0x71b5e8(0x16b),'linkedPath':_0x209104});}}return Array[_0x71b5e8(0x190)](_0x2e4d5c['values']())[_0x71b5e8(0x188)](compareLocalRuntimeSkills);}function localSkillEntryDirs(_0x4df0ab){const _0x262c36=a143_0x53e7;if(!existsSync(_0x4df0ab))return[];return readdirSync(_0x4df0ab,{'withFileTypes':!![]})[_0x262c36(0x173)](_0x3aa690=>_0x3aa690['isDirectory']()||_0x3aa690[_0x262c36(0x182)]())[_0x262c36(0x18c)](_0x4e0308=>resolve(_0x4df0ab,_0x4e0308[_0x262c36(0x176)]));}function localSkillLinkCandidates(_0x145d17,_0x50ab79,_0x24c31e){const _0x17d7b6=a143_0x53e7;if(!existsSync(_0x145d17))return[];const _0x3e0d61=_0x50ab79['appCode']+'--';return readdirSync(_0x145d17,{'withFileTypes':!![]})[_0x17d7b6(0x173)](_0x1cbb5b=>_0x1cbb5b[_0x17d7b6(0x16d)]()||_0x1cbb5b[_0x17d7b6(0x182)]())[_0x17d7b6(0x173)](_0x5229bf=>_0x50ab79[_0x17d7b6(0x186)]===_0x17d7b6(0x184)||_0x5229bf[_0x17d7b6(0x176)]['startsWith'](_0x3e0d61)||_0x24c31e['has'](_0x17d7b6(0x17c)))[_0x17d7b6(0x18c)](_0x20a924=>resolve(_0x145d17,_0x20a924['name']));}function collectLocalRuntimeSkill(_0x42df6e,_0x228106,_0x329291){const _0x3e231f=a143_0x53e7,_0x25298a=resolve(_0x228106,METADATA_FILE),_0xd826a4=readMetadataIfPresent(_0x25298a);if(!_0xd826a4)return;if(_0xd826a4[_0x3e231f(0x16c)]!==_0x329291[_0x3e231f(0x16c)])return;if(!isRuntimeSkillScope(_0xd826a4[_0x3e231f(0x186)])||!_0x329291[_0x3e231f(0x180)][_0x3e231f(0x16a)](_0xd826a4[_0x3e231f(0x186)]))return;const _0x3fc067=_0xd826a4[_0x3e231f(0x189)]?.[_0x3e231f(0x185)]();if(!_0x3fc067)return;if(_0x329291[_0x3e231f(0x17a)]&&_0x3fc067!==_0x329291[_0x3e231f(0x17a)])return;const _0x343c6f=_0xd826a4[_0x3e231f(0x186)]+':'+_0x3fc067,_0x4bb65f=_0x329291['linkedPath']?[_0x329291[_0x3e231f(0x174)]]:[],_0x3114d7=_0x42df6e[_0x3e231f(0x17b)](_0x343c6f);if(_0x3114d7){_0x329291[_0x3e231f(0x18d)]==='cache'&&(_0x3114d7[_0x3e231f(0x191)]=_0x228106,_0x3114d7[_0x3e231f(0x194)]=_0x228106,_0x3114d7[_0x3e231f(0x17f)]=resolve(_0x228106,SKILL_FILE),_0x3114d7[_0x3e231f(0x166)]=_0x25298a);for(const _0x10c9db of _0x4bb65f){!_0x3114d7[_0x3e231f(0x175)][_0x3e231f(0x181)](_0x10c9db)&&_0x3114d7[_0x3e231f(0x175)]['push'](_0x10c9db);}_0x3114d7[_0x3e231f(0x175)][_0x3e231f(0x188)]();return;}_0x42df6e[_0x3e231f(0x16f)](_0x343c6f,{..._0xd826a4,'tags':Array[_0x3e231f(0x18b)](_0xd826a4[_0x3e231f(0x172)])?_0xd826a4['tags']:[],'scope':_0xd826a4['scope'],'source':_0x3e231f(0x169),'dir':_0x228106,'cacheDir':_0x329291[_0x3e231f(0x18d)]===_0x3e231f(0x178)?_0x228106:undefined,'skillMdPath':resolve(_0x228106,SKILL_FILE),'metadataPath':_0x25298a,'linkedPaths':_0x4bb65f});}function compareLocalRuntimeSkills(_0x196cba,_0x24df15){const _0xc42090=a143_0x53e7,_0x33b982={'personal':0x0,'company':0x1,'builtin':0x2};return _0x33b982[_0x196cba[_0xc42090(0x186)]]-_0x33b982[_0x24df15[_0xc42090(0x186)]]||_0x196cba[_0xc42090(0x189)][_0xc42090(0x171)](_0x24df15[_0xc42090(0x189)])||_0x196cba[_0xc42090(0x191)][_0xc42090(0x171)](_0x24df15[_0xc42090(0x191)]);}function a143_0x1d74(){const _0x505f76=['appCode','isDirectory','validation','set','accessKey','localeCompare','tags','filter','linkedPath','linkedPaths','name','1435330JwbIfU','cache','3880128gIOaVv','code','get','builtin','env','30CxAGfO','skillMdPath','scopes','includes','isSymbolicLink','10343007HopoWH','project','trim','scope','4059568mEQIAX','sort','skillCode','skillRoots','isArray','map','source','\x20!=\x20','10bOzyNr','from','dir','119904FgfWWm','596110gTAqtu','cacheDir','metadataPath','64vaKwuB','429621PnzVIE','local','has','link'];a143_0x1d74=function(){return _0x505f76;};return a143_0x1d74();}
1
+ (function(_0x53154f,_0xefa137){const _0x386c84=a151_0x49df,_0x4ea4f9=_0x53154f();while(!![]){try{const _0xd4611d=parseInt(_0x386c84(0x17c))/0x1*(parseInt(_0x386c84(0x165))/0x2)+-parseInt(_0x386c84(0x176))/0x3+parseInt(_0x386c84(0x15f))/0x4+parseInt(_0x386c84(0x185))/0x5*(-parseInt(_0x386c84(0x186))/0x6)+parseInt(_0x386c84(0x175))/0x7+parseInt(_0x386c84(0x17e))/0x8+parseInt(_0x386c84(0x174))/0x9*(-parseInt(_0x386c84(0x17d))/0xa);if(_0xd4611d===_0xefa137)break;else _0x4ea4f9['push'](_0x4ea4f9['shift']());}catch(_0x1d5b1e){_0x4ea4f9['push'](_0x4ea4f9['shift']());}}}(a151_0x1737,0xaace7));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';function a151_0x1737(){const _0x3dbb54=['filter','get','name','set','project','370715aDTbSm','66LEEBRu','scopes','source','appCode','isDirectory','map','3032228EzDdpE','scope','linkedPaths','trim','tags','accessKey','2QwxtFD','cacheDir','has','metadataPath','skillCode','push','Runtime\x20Skill\x20install\x20target\x20app\x20mismatch:\x20','includes','code','values','dir','isArray','isSymbolicLink','linkedPath','from','509931LhcFhY','7637224VulzdT','3220533hucExp','local','cache','\x20!=\x20','sort','localeCompare','988221ZQyqbo','180HsWkKH','6170072nsEOel','link'];a151_0x1737=function(){return _0x3dbb54;};return a151_0x1737();}import{isRuntimeSkillScope,normalizeRuntimeSkillScopes}from'./scopes.js';export function listLocalRuntimeSkills(_0x11d17a,_0x5acb17,_0x4e092f={}){const _0xdafd27=a151_0x49df,_0x3dc7d8=safePathSegment(_0x11d17a[_0xdafd27(0x189)],_0xdafd27(0x189));if(_0x5acb17[_0xdafd27(0x189)]!==_0x3dc7d8)throw CliErrors['validation'](_0xdafd27(0x16b)+_0x5acb17[_0xdafd27(0x189)]+_0xdafd27(0x179)+_0x3dc7d8);const _0x24abb6=normalizeRuntimeSkillScopes(_0x11d17a['scopes']),_0x2b1be1=new Set(_0x24abb6),_0x355afa=_0x11d17a['code']?.[_0xdafd27(0x162)](),_0x23155d=new Map(),_0x14dc37=resolve(getRuntimeSkillCacheRoot(_0x11d17a['env'],_0x11d17a[_0xdafd27(0x164)],_0x4e092f),_0x3dc7d8);for(const _0x39f637 of _0x24abb6){for(const _0x30f152 of localSkillEntryDirs(resolve(_0x14dc37,_0x39f637))){collectLocalRuntimeSkill(_0x23155d,_0x30f152,{'appCode':_0x3dc7d8,'scopes':_0x2b1be1,'code':_0x355afa,'source':'cache'});}}for(const _0x2025d6 of _0x5acb17['skillRoots']){for(const _0x5ee767 of localSkillLinkCandidates(_0x2025d6,_0x5acb17,_0x2b1be1)){collectLocalRuntimeSkill(_0x23155d,_0x5ee767,{'appCode':_0x3dc7d8,'scopes':_0x2b1be1,'code':_0x355afa,'source':_0xdafd27(0x17f),'linkedPath':_0x5ee767});}}return Array[_0xdafd27(0x173)](_0x23155d[_0xdafd27(0x16e)]())[_0xdafd27(0x17a)](compareLocalRuntimeSkills);}function localSkillEntryDirs(_0x4e38db){const _0x2e81db=a151_0x49df;if(!existsSync(_0x4e38db))return[];return readdirSync(_0x4e38db,{'withFileTypes':!![]})[_0x2e81db(0x180)](_0x1097e1=>_0x1097e1[_0x2e81db(0x18a)]()||_0x1097e1[_0x2e81db(0x171)]())[_0x2e81db(0x18b)](_0x3fcd74=>resolve(_0x4e38db,_0x3fcd74[_0x2e81db(0x182)]));}function a151_0x49df(_0x2d8337,_0x177c40){_0x2d8337=_0x2d8337-0x15f;const _0x1737a7=a151_0x1737();let _0x49df97=_0x1737a7[_0x2d8337];return _0x49df97;}function localSkillLinkCandidates(_0x51ddde,_0x4f3b6e,_0x40cfd8){const _0x5c28b7=a151_0x49df;if(!existsSync(_0x51ddde))return[];const _0x10c60e=_0x4f3b6e[_0x5c28b7(0x189)]+'--';return readdirSync(_0x51ddde,{'withFileTypes':!![]})[_0x5c28b7(0x180)](_0x307891=>_0x307891[_0x5c28b7(0x18a)]()||_0x307891['isSymbolicLink']())[_0x5c28b7(0x180)](_0xae4e93=>_0x4f3b6e[_0x5c28b7(0x160)]===_0x5c28b7(0x184)||_0xae4e93[_0x5c28b7(0x182)]['startsWith'](_0x10c60e)||_0x40cfd8[_0x5c28b7(0x167)]('builtin'))[_0x5c28b7(0x18b)](_0x12f3b4=>resolve(_0x51ddde,_0x12f3b4[_0x5c28b7(0x182)]));}function collectLocalRuntimeSkill(_0x13760d,_0x3c62a7,_0x36278a){const _0x18332b=a151_0x49df,_0x64b6fd=resolve(_0x3c62a7,METADATA_FILE),_0x2ec8be=readMetadataIfPresent(_0x64b6fd);if(!_0x2ec8be)return;if(_0x2ec8be[_0x18332b(0x189)]!==_0x36278a['appCode'])return;if(!isRuntimeSkillScope(_0x2ec8be[_0x18332b(0x160)])||!_0x36278a[_0x18332b(0x187)][_0x18332b(0x167)](_0x2ec8be[_0x18332b(0x160)]))return;const _0x4951cd=_0x2ec8be['skillCode']?.[_0x18332b(0x162)]();if(!_0x4951cd)return;if(_0x36278a[_0x18332b(0x16d)]&&_0x4951cd!==_0x36278a[_0x18332b(0x16d)])return;const _0x3bbcb8=_0x2ec8be[_0x18332b(0x160)]+':'+_0x4951cd,_0x673df3=_0x36278a[_0x18332b(0x172)]?[_0x36278a['linkedPath']]:[],_0x10cdc6=_0x13760d[_0x18332b(0x181)](_0x3bbcb8);if(_0x10cdc6){_0x36278a[_0x18332b(0x188)]==='cache'&&(_0x10cdc6[_0x18332b(0x16f)]=_0x3c62a7,_0x10cdc6[_0x18332b(0x166)]=_0x3c62a7,_0x10cdc6['skillMdPath']=resolve(_0x3c62a7,SKILL_FILE),_0x10cdc6[_0x18332b(0x168)]=_0x64b6fd);for(const _0x18e9aa of _0x673df3){!_0x10cdc6['linkedPaths'][_0x18332b(0x16c)](_0x18e9aa)&&_0x10cdc6[_0x18332b(0x161)][_0x18332b(0x16a)](_0x18e9aa);}_0x10cdc6[_0x18332b(0x161)][_0x18332b(0x17a)]();return;}_0x13760d[_0x18332b(0x183)](_0x3bbcb8,{..._0x2ec8be,'tags':Array[_0x18332b(0x170)](_0x2ec8be[_0x18332b(0x163)])?_0x2ec8be['tags']:[],'scope':_0x2ec8be['scope'],'source':_0x18332b(0x177),'dir':_0x3c62a7,'cacheDir':_0x36278a[_0x18332b(0x188)]===_0x18332b(0x178)?_0x3c62a7:undefined,'skillMdPath':resolve(_0x3c62a7,SKILL_FILE),'metadataPath':_0x64b6fd,'linkedPaths':_0x673df3});}function compareLocalRuntimeSkills(_0x287ea7,_0x54e3c4){const _0x4ed96a=a151_0x49df,_0x5a3aae={'personal':0x0,'company':0x1,'builtin':0x2};return _0x5a3aae[_0x287ea7[_0x4ed96a(0x160)]]-_0x5a3aae[_0x54e3c4[_0x4ed96a(0x160)]]||_0x287ea7[_0x4ed96a(0x169)][_0x4ed96a(0x17b)](_0x54e3c4['skillCode'])||_0x287ea7[_0x4ed96a(0x16f)][_0x4ed96a(0x17b)](_0x54e3c4[_0x4ed96a(0x16f)]);}
@@ -1 +1 @@
1
- (function(_0x41f3f7,_0x173e6f){const _0x233e9a=a144_0x486a,_0x56ee5b=_0x41f3f7();while(!![]){try{const _0x58bd21=-parseInt(_0x233e9a(0x197))/0x1+parseInt(_0x233e9a(0x1a5))/0x2+parseInt(_0x233e9a(0x194))/0x3+parseInt(_0x233e9a(0x1ac))/0x4*(-parseInt(_0x233e9a(0x1a2))/0x5)+parseInt(_0x233e9a(0x190))/0x6*(parseInt(_0x233e9a(0x196))/0x7)+parseInt(_0x233e9a(0x19e))/0x8*(-parseInt(_0x233e9a(0x1b4))/0x9)+parseInt(_0x233e9a(0x1b5))/0xa;if(_0x58bd21===_0x173e6f)break;else _0x56ee5b['push'](_0x56ee5b['shift']());}catch(_0x57b91e){_0x56ee5b['push'](_0x56ee5b['shift']());}}}(a144_0x167c,0x89741));import{readFileSync,readdirSync,realpathSync}from'node:fs';import{relative,resolve}from'node:path';function a144_0x486a(_0x3ba00b,_0x3cf7bf){_0x3ba00b=_0x3ba00b-0x18a;const _0x167c25=a144_0x167c();let _0x486a3c=_0x167c25[_0x3ba00b];return _0x486a3c;}import{CliErrors}from'../../errors.js';import{IGNORED_DIR_NAMES,IGNORED_FILE_NAMES,SKILL_FILE}from'./constants.js';export function fileContent(_0x9bee79){const _0xc57a2c=a144_0x486a;return _0x9bee79[_0xc57a2c(0x1a0)]??Buffer['from'](_0x9bee79['content']??'',_0xc57a2c(0x18a));}export function fileText(_0x1f0a9c){const _0x479711=a144_0x486a;return fileContent(_0x1f0a9c)['toString'](_0x479711(0x18a));}export function normalizeLocalFiles(_0x3b480a){const _0x15ad34=a144_0x486a;if(!Array[_0x15ad34(0x191)](_0x3b480a)||_0x3b480a[_0x15ad34(0x19b)]===0x0)return[];const _0x16a004=new Map();for(const _0x2625f9 of _0x3b480a){if(!_0x2625f9||typeof _0x2625f9!==_0x15ad34(0x18b)||typeof _0x2625f9['path']!=='string')throw CliErrors[_0x15ad34(0x19c)]('Skill\x20file\x20path\x20must\x20be\x20text.');const _0x50f1eb=normalizeSkillRelativePath(_0x2625f9[_0x15ad34(0x1ad)]);if(_0x16a004[_0x15ad34(0x199)](_0x50f1eb))throw CliErrors[_0x15ad34(0x19c)](_0x15ad34(0x1ae)+_0x50f1eb);if(_0x2625f9[_0x15ad34(0x1a0)]!==undefined&&!Buffer[_0x15ad34(0x1a6)](_0x2625f9[_0x15ad34(0x1a0)]))throw CliErrors[_0x15ad34(0x19c)](_0x15ad34(0x1a7)+_0x50f1eb);if(_0x2625f9['bytes']===undefined&&typeof _0x2625f9[_0x15ad34(0x1b2)]!==_0x15ad34(0x1b8))throw CliErrors[_0x15ad34(0x19c)](_0x15ad34(0x1ab)+_0x50f1eb);const _0x543686=fileContent(_0x2625f9);_0x16a004[_0x15ad34(0x1b6)](_0x50f1eb,{'path':_0x50f1eb,'bytes':_0x543686});}return Array['from'](_0x16a004[_0x15ad34(0x18e)]())[_0x15ad34(0x1a1)](compareSkillFiles);}export function normalizeManifestFiles(_0xa9bbb6){const _0x355688=a144_0x486a;if(!Array[_0x355688(0x191)](_0xa9bbb6)||_0xa9bbb6[_0x355688(0x19b)]===0x0)return[];const _0x259c0b=new Map();for(const _0x4fe7fc of _0xa9bbb6){if(!_0x4fe7fc||typeof _0x4fe7fc!==_0x355688(0x18b)||typeof _0x4fe7fc[_0x355688(0x1ad)]!==_0x355688(0x1b8))throw CliErrors[_0x355688(0x19c)](_0x355688(0x1b0));const _0x3061b2=normalizeSkillRelativePath(_0x4fe7fc[_0x355688(0x1ad)]);if(_0x259c0b[_0x355688(0x199)](_0x3061b2))throw CliErrors[_0x355688(0x19c)]('Duplicate\x20Skill\x20file\x20path:\x20'+_0x3061b2);if(!isSha256Hex(_0x4fe7fc[_0x355688(0x1b1)]))throw CliErrors[_0x355688(0x19c)](_0x355688(0x193)+_0x3061b2);if(!Number[_0x355688(0x195)](_0x4fe7fc[_0x355688(0x18d)])||_0x4fe7fc[_0x355688(0x18d)]<0x0)throw CliErrors[_0x355688(0x19c)]('Skill\x20file\x20size\x20is\x20invalid:\x20'+_0x3061b2);_0x259c0b[_0x355688(0x1b6)](_0x3061b2,{'path':_0x3061b2,'sha256':_0x4fe7fc[_0x355688(0x1b1)]['toLowerCase'](),'size':_0x4fe7fc[_0x355688(0x18d)]});}return Array['from'](_0x259c0b[_0x355688(0x18e)]())[_0x355688(0x1a1)](compareSkillFiles);}function a144_0x167c(){const _0x521477=['Duplicate\x20Skill\x20file\x20path:\x20','split','Skill\x20file\x20path\x20must\x20be\x20text.','sha256','content','name','207XqLouZ','19819330zkSGPc','set','Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20','string','utf8','object','test','size','values','excludedFilePaths','12MXXVUh','isArray','isDirectory','Skill\x20file\x20sha256\x20is\x20invalid:\x20','1600788TsCaHU','isSafeInteger','814114GcTfIC','881962HLNlDP','compare','has','from','length','validation','isFile','390088lqqLlZ','isSymbolicLink','bytes','sort','1892810hXGzsZ','Unsafe\x20Skill\x20file\x20path:\x20','localeCompare','1150930sjSzux','isBuffer','Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20','add','replace','startsWith','Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20','8ARpmep','path'];a144_0x167c=function(){return _0x521477;};return a144_0x167c();}export function scanSkillDirectory(_0x25f63a,_0x11de37={}){const _0x4bea2a=a144_0x486a,_0x28fbb5=realpathSync(_0x25f63a),_0x15dd71=canonicalExcludedFilePaths(_0x11de37[_0x4bea2a(0x18f)]),_0x52afc5=[];function _0x53fc5c(_0x5e8232){const _0x32d5d6=_0x4bea2a,_0x398e4d=readdirSync(_0x5e8232,{'withFileTypes':!![]})[_0x32d5d6(0x1a1)]((_0xa31336,_0x4aff97)=>_0xa31336[_0x32d5d6(0x1b3)][_0x32d5d6(0x1a4)](_0x4aff97[_0x32d5d6(0x1b3)]));for(const _0x322aaa of _0x398e4d){if(_0x322aaa[_0x32d5d6(0x192)]()&&IGNORED_DIR_NAMES['has'](_0x322aaa[_0x32d5d6(0x1b3)]))continue;if(IGNORED_FILE_NAMES[_0x32d5d6(0x199)](_0x322aaa[_0x32d5d6(0x1b3)]))continue;const _0x4b3de2=resolve(_0x5e8232,_0x322aaa[_0x32d5d6(0x1b3)]);if(isExcludedFilePath(_0x4b3de2,_0x15dd71))continue;if(_0x322aaa[_0x32d5d6(0x19f)]())throw CliErrors[_0x32d5d6(0x19c)](_0x32d5d6(0x1b7)+_0x4b3de2);const _0x11f6fd=toPosixPath(relative(_0x28fbb5,_0x4b3de2));if(_0x322aaa[_0x32d5d6(0x192)]()){_0x53fc5c(_0x4b3de2);continue;}if(!_0x322aaa[_0x32d5d6(0x19d)]())continue;validateSkillRelativePath(_0x11f6fd);const _0x9e7366=readFileSync(_0x4b3de2);_0x52afc5['push']({'path':_0x11f6fd,'bytes':_0x9e7366});}}return _0x53fc5c(_0x28fbb5),normalizeLocalFiles(_0x52afc5);}function canonicalExcludedFilePaths(_0x591db7){const _0x5a7af7=a144_0x486a,_0x581323=new Set();for(const _0x3a47ff of _0x591db7??[]){const _0x129ea4=resolve(_0x3a47ff);_0x581323[_0x5a7af7(0x1a8)](_0x129ea4);try{_0x581323[_0x5a7af7(0x1a8)](realpathSync(_0x129ea4));}catch{}}return _0x581323;}function isExcludedFilePath(_0x160653,_0x56950c){const _0x13077a=a144_0x486a;if(_0x56950c[_0x13077a(0x199)](_0x160653))return!![];if(_0x56950c[_0x13077a(0x18d)]===0x0)return![];try{return _0x56950c[_0x13077a(0x199)](realpathSync(_0x160653));}catch{return![];}}export function compareSkillFiles(_0x4bd500,_0x41a1d8){const _0x39330a=a144_0x486a;if(_0x4bd500[_0x39330a(0x1ad)]===SKILL_FILE)return _0x41a1d8['path']===SKILL_FILE?0x0:-0x1;if(_0x41a1d8['path']===SKILL_FILE)return 0x1;return Buffer[_0x39330a(0x198)](Buffer['from'](_0x4bd500[_0x39330a(0x1ad)],'utf8'),Buffer[_0x39330a(0x19a)](_0x41a1d8[_0x39330a(0x1ad)],_0x39330a(0x18a)));}export function normalizeSkillRelativePath(_0x2b13a6){const _0x4c1a86=toPosixPath(_0x2b13a6['trim']());return validateSkillRelativePath(_0x4c1a86),_0x4c1a86;}export function validateSkillRelativePath(_0x5e3522){const _0x45203c=a144_0x486a;if(!_0x5e3522||_0x5e3522[_0x45203c(0x1aa)]('/')||_0x5e3522['includes']('//'))throw CliErrors[_0x45203c(0x19c)]('Unsafe\x20Skill\x20file\x20path:\x20'+_0x5e3522);for(const _0x22fee0 of _0x5e3522[_0x45203c(0x1af)]('/')){if(!_0x22fee0||_0x22fee0==='.'||_0x22fee0==='..')throw CliErrors[_0x45203c(0x19c)](_0x45203c(0x1a3)+_0x5e3522);}}export function toPosixPath(_0x23cfb6){const _0x431b90=a144_0x486a;return _0x23cfb6[_0x431b90(0x1a9)](/\\/g,'/');}export function isSha256Hex(_0x3eafa1){const _0x6df33e=a144_0x486a;return typeof _0x3eafa1==='string'&&/^[a-fA-F0-9]{64}$/[_0x6df33e(0x18c)](_0x3eafa1);}
1
+ (function(_0x1b354e,_0x87009b){const _0x4d806a=a152_0x4f5d,_0x3bc3f2=_0x1b354e();while(!![]){try{const _0x13ce99=parseInt(_0x4d806a(0xbe))/0x1*(parseInt(_0x4d806a(0xd6))/0x2)+parseInt(_0x4d806a(0xd8))/0x3+parseInt(_0x4d806a(0xb1))/0x4+-parseInt(_0x4d806a(0xce))/0x5*(-parseInt(_0x4d806a(0xd0))/0x6)+parseInt(_0x4d806a(0xcc))/0x7*(-parseInt(_0x4d806a(0xb7))/0x8)+-parseInt(_0x4d806a(0xc8))/0x9*(parseInt(_0x4d806a(0xb8))/0xa)+parseInt(_0x4d806a(0xb3))/0xb*(-parseInt(_0x4d806a(0xc9))/0xc);if(_0x13ce99===_0x87009b)break;else _0x3bc3f2['push'](_0x3bc3f2['shift']());}catch(_0x13f35e){_0x3bc3f2['push'](_0x3bc3f2['shift']());}}}(a152_0x2eda,0x6c925));import{readFileSync,readdirSync,realpathSync}from'node:fs';import{relative,resolve}from'node:path';import{CliErrors}from'../../errors.js';import{IGNORED_DIR_NAMES,IGNORED_FILE_NAMES,SKILL_FILE}from'./constants.js';function a152_0x4f5d(_0x315b9a,_0x36add0){_0x315b9a=_0x315b9a-0xae;const _0x2eda84=a152_0x2eda();let _0x4f5dae=_0x2eda84[_0x315b9a];return _0x4f5dae;}export function fileContent(_0x443962){const _0x215379=a152_0x4f5d;return _0x443962[_0x215379(0xd1)]??Buffer[_0x215379(0xcf)](_0x443962[_0x215379(0xd7)]??'',_0x215379(0xba));}export function fileText(_0x4ee274){const _0xd685cc=a152_0x4f5d;return fileContent(_0x4ee274)[_0xd685cc(0xca)](_0xd685cc(0xba));}function a152_0x2eda(){const _0x5a085f=['from','939096KGdtck','bytes','test','isSafeInteger','toLowerCase','push','851718ufhdsc','content','917358OUwZEd','isDirectory','length','add','Duplicate\x20Skill\x20file\x20path:\x20','set','compare','Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20','sha256','path','size','1079596pwhSnq','isSymbolicLink','781EFmCKa','Skill\x20file\x20size\x20is\x20invalid:\x20','string','object','2190984unjFlN','10fCxxfM','excludedFilePaths','utf8','Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20','validation','split','1XqnoqL','name','isFile','values','startsWith','has','includes','Unsafe\x20Skill\x20file\x20path:\x20','trim','sort','2407869FoLtDF','108420SGGXnQ','toString','isArray','7hXNNzw','Skill\x20file\x20path\x20must\x20be\x20text.','20bOcEnA'];a152_0x2eda=function(){return _0x5a085f;};return a152_0x2eda();}export function normalizeLocalFiles(_0x354cfb){const _0x5e7b8b=a152_0x4f5d;if(!Array[_0x5e7b8b(0xcb)](_0x354cfb)||_0x354cfb['length']===0x0)return[];const _0x482f26=new Map();for(const _0x3d3f43 of _0x354cfb){if(!_0x3d3f43||typeof _0x3d3f43!==_0x5e7b8b(0xb6)||typeof _0x3d3f43[_0x5e7b8b(0xaf)]!==_0x5e7b8b(0xb5))throw CliErrors[_0x5e7b8b(0xbc)]('Skill\x20file\x20path\x20must\x20be\x20text.');const _0x296202=normalizeSkillRelativePath(_0x3d3f43[_0x5e7b8b(0xaf)]);if(_0x482f26[_0x5e7b8b(0xc3)](_0x296202))throw CliErrors[_0x5e7b8b(0xbc)](_0x5e7b8b(0xdc)+_0x296202);if(_0x3d3f43[_0x5e7b8b(0xd1)]!==undefined&&!Buffer['isBuffer'](_0x3d3f43['bytes']))throw CliErrors[_0x5e7b8b(0xbc)](_0x5e7b8b(0xbb)+_0x296202);if(_0x3d3f43[_0x5e7b8b(0xd1)]===undefined&&typeof _0x3d3f43['content']!==_0x5e7b8b(0xb5))throw CliErrors['validation'](_0x5e7b8b(0xdf)+_0x296202);const _0x9f44ad=fileContent(_0x3d3f43);_0x482f26[_0x5e7b8b(0xdd)](_0x296202,{'path':_0x296202,'bytes':_0x9f44ad});}return Array['from'](_0x482f26[_0x5e7b8b(0xc1)]())[_0x5e7b8b(0xc7)](compareSkillFiles);}export function normalizeManifestFiles(_0x101368){const _0x37ee5d=a152_0x4f5d;if(!Array[_0x37ee5d(0xcb)](_0x101368)||_0x101368[_0x37ee5d(0xda)]===0x0)return[];const _0x10325a=new Map();for(const _0x51dfe5 of _0x101368){if(!_0x51dfe5||typeof _0x51dfe5!=='object'||typeof _0x51dfe5[_0x37ee5d(0xaf)]!==_0x37ee5d(0xb5))throw CliErrors[_0x37ee5d(0xbc)](_0x37ee5d(0xcd));const _0x259753=normalizeSkillRelativePath(_0x51dfe5[_0x37ee5d(0xaf)]);if(_0x10325a[_0x37ee5d(0xc3)](_0x259753))throw CliErrors[_0x37ee5d(0xbc)](_0x37ee5d(0xdc)+_0x259753);if(!isSha256Hex(_0x51dfe5[_0x37ee5d(0xae)]))throw CliErrors[_0x37ee5d(0xbc)]('Skill\x20file\x20sha256\x20is\x20invalid:\x20'+_0x259753);if(!Number[_0x37ee5d(0xd3)](_0x51dfe5[_0x37ee5d(0xb0)])||_0x51dfe5[_0x37ee5d(0xb0)]<0x0)throw CliErrors[_0x37ee5d(0xbc)](_0x37ee5d(0xb4)+_0x259753);_0x10325a[_0x37ee5d(0xdd)](_0x259753,{'path':_0x259753,'sha256':_0x51dfe5[_0x37ee5d(0xae)][_0x37ee5d(0xd4)](),'size':_0x51dfe5[_0x37ee5d(0xb0)]});}return Array['from'](_0x10325a[_0x37ee5d(0xc1)]())[_0x37ee5d(0xc7)](compareSkillFiles);}export function scanSkillDirectory(_0x385e43,_0x377555={}){const _0x4881b9=a152_0x4f5d,_0x31d722=realpathSync(_0x385e43),_0x3a1570=canonicalExcludedFilePaths(_0x377555[_0x4881b9(0xb9)]),_0x2a41f6=[];function _0x541a10(_0x55fcee){const _0x5c89ec=_0x4881b9,_0x3b39d5=readdirSync(_0x55fcee,{'withFileTypes':!![]})[_0x5c89ec(0xc7)]((_0x17a48c,_0x5e6520)=>_0x17a48c[_0x5c89ec(0xbf)]['localeCompare'](_0x5e6520[_0x5c89ec(0xbf)]));for(const _0x5d505a of _0x3b39d5){if(_0x5d505a[_0x5c89ec(0xd9)]()&&IGNORED_DIR_NAMES[_0x5c89ec(0xc3)](_0x5d505a['name']))continue;if(IGNORED_FILE_NAMES[_0x5c89ec(0xc3)](_0x5d505a[_0x5c89ec(0xbf)]))continue;const _0x351d20=resolve(_0x55fcee,_0x5d505a['name']);if(isExcludedFilePath(_0x351d20,_0x3a1570))continue;if(_0x5d505a[_0x5c89ec(0xb2)]())throw CliErrors[_0x5c89ec(0xbc)]('Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20'+_0x351d20);const _0x4756e5=toPosixPath(relative(_0x31d722,_0x351d20));if(_0x5d505a['isDirectory']()){_0x541a10(_0x351d20);continue;}if(!_0x5d505a[_0x5c89ec(0xc0)]())continue;validateSkillRelativePath(_0x4756e5);const _0x1d85a8=readFileSync(_0x351d20);_0x2a41f6[_0x5c89ec(0xd5)]({'path':_0x4756e5,'bytes':_0x1d85a8});}}return _0x541a10(_0x31d722),normalizeLocalFiles(_0x2a41f6);}function canonicalExcludedFilePaths(_0x24c85b){const _0x17eb32=a152_0x4f5d,_0x511048=new Set();for(const _0xd922d5 of _0x24c85b??[]){const _0x1baffb=resolve(_0xd922d5);_0x511048[_0x17eb32(0xdb)](_0x1baffb);try{_0x511048['add'](realpathSync(_0x1baffb));}catch{}}return _0x511048;}function isExcludedFilePath(_0x456d90,_0x3e6d8e){const _0x1076bf=a152_0x4f5d;if(_0x3e6d8e[_0x1076bf(0xc3)](_0x456d90))return!![];if(_0x3e6d8e['size']===0x0)return![];try{return _0x3e6d8e['has'](realpathSync(_0x456d90));}catch{return![];}}export function compareSkillFiles(_0x5397b5,_0x5d0df5){const _0x427360=a152_0x4f5d;if(_0x5397b5[_0x427360(0xaf)]===SKILL_FILE)return _0x5d0df5[_0x427360(0xaf)]===SKILL_FILE?0x0:-0x1;if(_0x5d0df5[_0x427360(0xaf)]===SKILL_FILE)return 0x1;return Buffer[_0x427360(0xde)](Buffer[_0x427360(0xcf)](_0x5397b5[_0x427360(0xaf)],_0x427360(0xba)),Buffer['from'](_0x5d0df5[_0x427360(0xaf)],_0x427360(0xba)));}export function normalizeSkillRelativePath(_0x2d173f){const _0x400486=a152_0x4f5d,_0x349cbf=toPosixPath(_0x2d173f[_0x400486(0xc6)]());return validateSkillRelativePath(_0x349cbf),_0x349cbf;}export function validateSkillRelativePath(_0x1516eb){const _0x13d2e6=a152_0x4f5d;if(!_0x1516eb||_0x1516eb[_0x13d2e6(0xc2)]('/')||_0x1516eb[_0x13d2e6(0xc4)]('//'))throw CliErrors[_0x13d2e6(0xbc)](_0x13d2e6(0xc5)+_0x1516eb);for(const _0x4a19ef of _0x1516eb[_0x13d2e6(0xbd)]('/')){if(!_0x4a19ef||_0x4a19ef==='.'||_0x4a19ef==='..')throw CliErrors['validation']('Unsafe\x20Skill\x20file\x20path:\x20'+_0x1516eb);}}export function toPosixPath(_0x49b61e){return _0x49b61e['replace'](/\\/g,'/');}export function isSha256Hex(_0x1b959f){const _0x5008ee=a152_0x4f5d;return typeof _0x1b959f===_0x5008ee(0xb5)&&/^[a-fA-F0-9]{64}$/[_0x5008ee(0xd2)](_0x1b959f);}
@@ -1 +1 @@
1
- (function(_0x395b1c,_0x583abe){const _0x3f2b6f=a145_0x329c,_0x1acf97=_0x395b1c();while(!![]){try{const _0x384c35=parseInt(_0x3f2b6f(0xad))/0x1*(parseInt(_0x3f2b6f(0xac))/0x2)+-parseInt(_0x3f2b6f(0xd2))/0x3*(-parseInt(_0x3f2b6f(0xc2))/0x4)+parseInt(_0x3f2b6f(0xd0))/0x5+parseInt(_0x3f2b6f(0xb1))/0x6*(-parseInt(_0x3f2b6f(0xa7))/0x7)+-parseInt(_0x3f2b6f(0x97))/0x8+parseInt(_0x3f2b6f(0xa2))/0x9+parseInt(_0x3f2b6f(0xd5))/0xa*(-parseInt(_0x3f2b6f(0xbe))/0xb);if(_0x384c35===_0x583abe)break;else _0x1acf97['push'](_0x1acf97['shift']());}catch(_0x32c778){_0x1acf97['push'](_0x1acf97['shift']());}}}(a145_0x8cd5,0x9f601));import{existsSync,lstatSync,mkdirSync,readFileSync,rmSync}from'node:fs';import{dirname,resolve}from'node:path';import{isCollection,isMap,isNode,parseDocument,visit}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{resolveManagedFilePath,writeBytesAtomic,writeJsonAtomic}from'./fs-utils.js';import{bufferSha256,contentHash,fileHash}from'./hashing.js';import{fileContent,fileText,normalizeLocalFiles}from'./local-files.js';import{buildMetadata,readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillDir}from'./paths.js';import{extractDownloadedPackage,requirePackageBytes}from'./zip-package.js';export function materializeRuntimeSkill(_0x3e7c3d,_0x78eaf1,_0x32394a){const _0x40f572=a145_0x329c,_0x8f7697=requireSkillCode(_0x3e7c3d),_0x1ecd6a=requirePackageBytes(_0x8f7697,_0x32394a[_0x40f572(0xbf)]),_0x524dc7=extractDownloadedPackage(_0x1ecd6a),_0x12f730=_0x524dc7['find'](_0x3bacdf=>_0x3bacdf[_0x40f572(0xca)]===SKILL_FILE);if(!_0x12f730)throw CliErrors['validation'](_0x40f572(0x9c)+SKILL_FILE+':\x20'+_0x8f7697);const _0x2e9e4e=withMaterializedSkillFrontmatter(_0x524dc7,_0x3e7c3d,_0x8f7697),_0x4cfd3c=_0x2e9e4e[_0x40f572(0xbc)](_0x3666ed=>_0x3666ed[_0x40f572(0xca)]===SKILL_FILE),_0x48751a=fileText(_0x4cfd3c),_0x30a98b=getRuntimeSkillDir(_0x32394a[_0x40f572(0xa6)],_0x32394a['accessKey'],_0x32394a[_0x40f572(0xc1)],_0x78eaf1,_0x8f7697,_0x32394a[_0x40f572(0x9e)]),_0xadf274=resolve(_0x30a98b,SKILL_FILE),_0x653f04=resolve(_0x30a98b,METADATA_FILE),_0x338a7c=contentHash(_0x48751a),_0x420658=readMetadataIfPresent(_0x653f04)?.[_0x40f572(0xc4)];ensurePulledFilesCanBeOverwritten(_0x30a98b,_0x653f04,_0x2e9e4e,_0x32394a[_0x40f572(0xb6)]===!![]),mkdirSync(_0x30a98b,{'recursive':!![],'mode':0x1c0});const _0x24eb6c=existsSync(_0xadf274)?readFileSync(_0xadf274,_0x40f572(0xb5)):undefined;return materializeFiles(_0x30a98b,_0x2e9e4e),removeStaleManagedFiles(_0x30a98b,_0x420658,_0x2e9e4e),writeJsonAtomic(_0x653f04,buildMetadata(_0x3e7c3d,_0x78eaf1,_0x32394a[_0x40f572(0xc1)],_0x338a7c,_0x32394a[_0x40f572(0xb8)],_0x2e9e4e,_0x1ecd6a)),{'skill':_0x3e7c3d,'scope':_0x78eaf1,'dir':_0x30a98b,'skillMdPath':_0xadf274,'metadataPath':_0x653f04,'contentHash':_0x338a7c,'changed':_0x24eb6c!==_0x48751a};}export function reuseMaterializedRuntimeSkill(_0x478ea7,_0x3cadd5,_0x164369){const _0x4b26f6=a145_0x329c,_0x2aad80=_0x478ea7[_0x4b26f6(0xd6)]?.[_0x4b26f6(0x99)]();if(!_0x2aad80)return undefined;const _0x5d0b52=requireSkillCode(_0x478ea7),_0x1743f8=getRuntimeSkillDir(_0x164369[_0x4b26f6(0xa6)],_0x164369[_0x4b26f6(0xcf)],_0x164369[_0x4b26f6(0xc1)],_0x3cadd5,_0x5d0b52,_0x164369['paths']),_0x1a78f5=resolve(_0x1743f8,SKILL_FILE),_0x442003=resolve(_0x1743f8,METADATA_FILE),_0xe371d2=readMetadataIfPresent(_0x442003);if(!_0xe371d2||_0xe371d2[_0x4b26f6(0xc8)]!==0x2||_0xe371d2['appCode']!==_0x164369[_0x4b26f6(0xc1)]||_0xe371d2[_0x4b26f6(0xcb)]!==_0x3cadd5||_0xe371d2[_0x4b26f6(0xb2)]!==_0x5d0b52||_0xe371d2[_0x4b26f6(0xd6)]!==_0x2aad80||_0xe371d2['id']!==_0x478ea7['id']||_0xe371d2[_0x4b26f6(0xbb)]!==_0x478ea7[_0x4b26f6(0xbb)]||_0xe371d2['description']!==_0x478ea7[_0x4b26f6(0xc5)]||_0xe371d2[_0x4b26f6(0xb7)]!==_0x478ea7[_0x4b26f6(0xb7)]||_0xe371d2[_0x4b26f6(0xa8)]!==_0x478ea7[_0x4b26f6(0xa8)]||!_0xe371d2[_0x4b26f6(0xb0)]||!_0xe371d2[_0x4b26f6(0xc4)]||!Object[_0x4b26f6(0xba)](_0xe371d2['fileHashes'],SKILL_FILE))return undefined;for(const [_0x47d3d2,_0x4ed0c8]of Object[_0x4b26f6(0xd3)](_0xe371d2[_0x4b26f6(0xc4)])){if(!/^[a-f0-9]{64}$/[_0x4b26f6(0xc6)](_0x4ed0c8))return undefined;const _0x12b32c=resolveManagedFilePath(_0x1743f8,_0x47d3d2);if(!existsSync(_0x12b32c)||!lstatSync(_0x12b32c)[_0x4b26f6(0xb3)]())return undefined;if(bufferSha256(readFileSync(_0x12b32c))!==_0x4ed0c8)return undefined;}return{'skill':_0x478ea7,'scope':_0x3cadd5,'dir':_0x1743f8,'skillMdPath':_0x1a78f5,'metadataPath':_0x442003,'contentHash':_0xe371d2[_0x4b26f6(0xb0)],'changed':![]};}function withMaterializedSkillFrontmatter(_0x4f2994,_0x52f0c2,_0x43408c){const _0xd78397=a145_0x329c,_0xc6eca5=skillDisplayName(_0x52f0c2,_0x43408c),_0x5d134e=_0x52f0c2[_0xd78397(0xc5)]?.[_0xd78397(0x99)]()||_0xc6eca5||_0x43408c;return normalizeLocalFiles(_0x4f2994)[_0xd78397(0xbd)](_0xc11a74=>{const _0x4217e0=_0xd78397,_0x4fe0a2=fileText(_0xc11a74);if(_0xc11a74[_0x4217e0(0xca)]!==SKILL_FILE)return _0xc11a74;if(hasYamlFrontmatter(_0x4fe0a2))return{'path':_0xc11a74['path'],'content':withSyncedDisplayName(_0x4fe0a2,_0xc6eca5)};return{'path':_0xc11a74[_0x4217e0(0xca)],'content':prependSkillFrontmatter(_0x4fe0a2,{'name':_0x43408c,'displayName':_0xc6eca5,'description':_0x5d134e})};});}function hasYamlFrontmatter(_0x4be184){const _0x311c10=a145_0x329c;return/^\uFEFF?---\s*\r?\n/[_0x311c10(0xc6)](_0x4be184);}function prependSkillFrontmatter(_0x522c3d,_0x17106a){const _0x1bd0ee=a145_0x329c,_0x4e3df8=_0x522c3d[_0x1bd0ee(0xb9)](/^\uFEFF/,'');return[_0x1bd0ee(0xcc),_0x1bd0ee(0xa3)+yamlString(_0x17106a['name']),_0x17106a['displayName']?_0x1bd0ee(0xa5)+yamlString(_0x17106a['displayName']):undefined,_0x1bd0ee(0xaf)+yamlString(_0x17106a[_0x1bd0ee(0xc5)]),_0x1bd0ee(0xcc),'',_0x4e3df8][_0x1bd0ee(0xc7)](_0x217a02=>_0x217a02!==undefined)[_0x1bd0ee(0xcd)]('\x0a');}function yamlString(_0x20f2a0){const _0x3196c9=a145_0x329c;return JSON[_0x3196c9(0xc3)](_0x20f2a0[_0x3196c9(0xb9)](/\r/g,'')['trim']());}function skillDisplayName(_0x38f0cd,_0x4a4ab3){const _0xf2076=a145_0x329c,_0x13bb9e=_0x38f0cd[_0xf2076(0xbb)]?.[_0xf2076(0x99)]();return _0x13bb9e||_0x4a4ab3;}function withSyncedDisplayName(_0x3889b0,_0x16ee81){const _0x120959=a145_0x329c,_0x3a190c=_0x3889b0[_0x120959(0x9f)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x3a190c)return _0x3889b0;const _0x21120b=_0x3a190c[0x1]??'',_0x584fdc=_0x3a190c[0x2]??'',_0x303c0b=parseDocument(_0x584fdc);if(_0x303c0b[_0x120959(0xc0)][_0x120959(0x9b)]>0x0||!isMap(_0x303c0b[_0x120959(0xc9)]))return _0x3889b0;if(_0x16ee81)_0x303c0b[_0x120959(0xaa)]('displayName',_0x16ee81);else{if(_0x303c0b[_0x120959(0xae)](_0x120959(0xa4)))_0x303c0b[_0x120959(0x98)]('displayName');else return _0x3889b0;}forceBlockCollections(_0x303c0b[_0x120959(0xc9)]);const _0x37abbd=_0x303c0b[_0x120959(0x9a)]({'lineWidth':0x0})[_0x120959(0x9d)](),_0x2a5857=_0x3889b0[_0x120959(0xb4)](_0x3a190c[0x0][_0x120959(0x9b)])[_0x120959(0xb9)](/^\r?\n/,'');return _0x21120b+'---\x0a'+_0x37abbd+_0x120959(0xd1)+_0x2a5857;}function a145_0x329c(_0x1aaea7,_0x2790f2){_0x1aaea7=_0x1aaea7-0x97;const _0x8cd57a=a145_0x8cd5();let _0x329c07=_0x8cd57a[_0x1aaea7];return _0x329c07;}function forceBlockCollections(_0x40b272){if(!isNode(_0x40b272))return;visit(_0x40b272,(_0x15f693,_0x4db59d)=>{isCollection(_0x4db59d)&&(_0x4db59d['flow']=![]);});}function ensurePulledFilesCanBeOverwritten(_0x317d22,_0xa6acd2,_0x91628a,_0x72db43){const _0x2ba62a=a145_0x329c;if(_0x72db43||!existsSync(_0xa6acd2))return;const _0x3d08a0=readMetadataIfPresent(_0xa6acd2);if(!_0x3d08a0)return;const _0x3bbfda=_0x3d08a0[_0x2ba62a(0xc4)]&&Object[_0x2ba62a(0xa1)](_0x3d08a0['fileHashes'])[_0x2ba62a(0x9b)]>0x0?_0x3d08a0[_0x2ba62a(0xc4)]:undefined;if(_0x3bbfda)for(const [_0x38b9a6,_0x10f22e]of Object[_0x2ba62a(0xd3)](_0x3bbfda)){const _0xbaadb=resolveManagedFilePath(_0x317d22,_0x38b9a6);if(!existsSync(_0xbaadb))throw CliErrors['validation']('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x317d22,'Managed\x20file\x20was\x20removed\x20locally:\x20'+_0x38b9a6);const _0x5c23b6=lstatSync(_0xbaadb);if(!_0x5c23b6['isFile']())throw CliErrors['validation'](_0x2ba62a(0xd4)+_0x317d22,_0x2ba62a(0xce)+_0x38b9a6);const _0x3b2ae2=bufferSha256(readFileSync(_0xbaadb));if(_0x3b2ae2!==_0x10f22e)throw CliErrors[_0x2ba62a(0xa0)](_0x2ba62a(0xd4)+_0x317d22+'.\x20Changed\x20file:\x20'+_0x38b9a6,_0x2ba62a(0xa9)+_0x38b9a6);}else{const _0x24d62a=resolve(_0x317d22,SKILL_FILE);if(existsSync(_0x24d62a)&&_0x3d08a0[_0x2ba62a(0xb0)]){const _0x1189af=contentHash(readFileSync(_0x24d62a,_0x2ba62a(0xb5)));if(_0x1189af!==_0x3d08a0[_0x2ba62a(0xb0)])throw CliErrors[_0x2ba62a(0xa0)]('Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20'+_0x24d62a,_0x2ba62a(0xab));}}for(const _0x151dd3 of normalizeLocalFiles(_0x91628a)){if(_0x3bbfda?.[_0x151dd3[_0x2ba62a(0xca)]])continue;if(!_0x3bbfda&&_0x151dd3[_0x2ba62a(0xca)]===SKILL_FILE)continue;const _0x40cc97=resolveManagedFilePath(_0x317d22,_0x151dd3[_0x2ba62a(0xca)]);if(!existsSync(_0x40cc97))continue;const _0x3f0af1=lstatSync(_0x40cc97);if(!_0x3f0af1['isFile']())throw CliErrors[_0x2ba62a(0xa0)](_0x2ba62a(0xd4)+_0x317d22,'Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20'+_0x151dd3['path']);const _0x3d7369=bufferSha256(readFileSync(_0x40cc97));if(_0x3d7369!==fileHash(_0x151dd3))throw CliErrors[_0x2ba62a(0xa0)](_0x2ba62a(0xd4)+_0x317d22,'Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20'+_0x151dd3[_0x2ba62a(0xca)]);}}function materializeFiles(_0x2d20be,_0x5e5f89){const _0x142fbb=a145_0x329c;for(const _0x1bdc73 of normalizeLocalFiles(_0x5e5f89)){const _0x347088=resolveManagedFilePath(_0x2d20be,_0x1bdc73[_0x142fbb(0xca)]);mkdirSync(dirname(_0x347088),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x347088,fileContent(_0x1bdc73),0x180);}}function a145_0x8cd5(){const _0x7e008e=['Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','1058950zsHkXs','version','2310248MPTNna','delete','trim','toString','length','Runtime\x20Skill\x20package\x20is\x20missing\x20','trimEnd','paths','match','validation','keys','6399261jKQPJs','name:\x20','displayName','displayName:\x20','env','1102395RrZLPe','status','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','set','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.','6044dfZSGS','267SLbFjn','has','description:\x20','contentHash','6qvTWYb','skillCode','isFile','slice','utf8','force','example','pulledAt','replace','hasOwn','skillName','find','map','187oRohTF','packageBytes','errors','appCode','646084gctTab','stringify','fileHashes','description','test','filter','schemaVersion','contents','path','scope','---','join','Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20','accessKey','2868870KFdhGn','\x0a---\x0a\x0a','15mvpYZn','entries'];a145_0x8cd5=function(){return _0x7e008e;};return a145_0x8cd5();}function removeStaleManagedFiles(_0x289a44,_0x17189e,_0x1ca1a7){const _0x443460=a145_0x329c;if(!_0x17189e)return;const _0x4d082d=new Set(normalizeLocalFiles(_0x1ca1a7)[_0x443460(0xbd)](_0x1dcb12=>_0x1dcb12[_0x443460(0xca)]));for(const _0x576c8a of Object['keys'](_0x17189e)){if(_0x4d082d[_0x443460(0xae)](_0x576c8a))continue;const _0x595834=resolveManagedFilePath(_0x289a44,_0x576c8a);existsSync(_0x595834)&&lstatSync(_0x595834)['isFile']()&&rmSync(_0x595834,{'force':!![]});}}
1
+ (function(_0x43907b,_0x37921f){const _0x9896d6=a153_0x2865,_0x30bcd8=_0x43907b();while(!![]){try{const _0x574f53=parseInt(_0x9896d6(0x15e))/0x1*(-parseInt(_0x9896d6(0x131))/0x2)+parseInt(_0x9896d6(0x13a))/0x3*(-parseInt(_0x9896d6(0x151))/0x4)+-parseInt(_0x9896d6(0x15b))/0x5+-parseInt(_0x9896d6(0x132))/0x6*(parseInt(_0x9896d6(0x14a))/0x7)+parseInt(_0x9896d6(0x12d))/0x8+-parseInt(_0x9896d6(0x15f))/0x9*(-parseInt(_0x9896d6(0x153))/0xa)+parseInt(_0x9896d6(0x145))/0xb;if(_0x574f53===_0x37921f)break;else _0x30bcd8['push'](_0x30bcd8['shift']());}catch(_0x32b291){_0x30bcd8['push'](_0x30bcd8['shift']());}}}(a153_0x4eeb,0xb2c44));import{existsSync,lstatSync,mkdirSync,readFileSync,rmSync}from'node:fs';import{dirname,resolve}from'node:path';import{isCollection,isMap,isNode,parseDocument,visit}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{resolveManagedFilePath,writeBytesAtomic,writeJsonAtomic}from'./fs-utils.js';import{bufferSha256,contentHash,fileHash}from'./hashing.js';function a153_0x4eeb(){const _0x2de4c3=['143016ojTYbR','set','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','slice','displayName:\x20','accessKey','skillName','.\x20Changed\x20file:\x20','3czXLRh','validation','replace','example','fileHashes','description:\x20','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','packageBytes','env','status','name:\x20','20968156xrithr','has','errors','hasOwn','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.','28cNLWuR','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','---','Runtime\x20Skill\x20package\x20is\x20missing\x20','version','path','entries','2842624ZEABVh','force','638930eFXbJv','pulledAt','find','test','toString','displayName','utf8','map','6934820HbUSNA','contents','contentHash','15109CbXxJU','189PpRFIS','description','length','skillCode','trim','delete','keys','1527592CvIRDK','appCode','schemaVersion','isFile','68LTHZRa'];a153_0x4eeb=function(){return _0x2de4c3;};return a153_0x4eeb();}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(_0x52e198,_0x25b3de,_0x441180){const _0x372dfc=a153_0x2865,_0x1745f0=requireSkillCode(_0x52e198),_0x251daa=requirePackageBytes(_0x1745f0,_0x441180[_0x372dfc(0x141)]),_0x3a2372=extractDownloadedPackage(_0x251daa),_0x2eb4c3=_0x3a2372[_0x372dfc(0x155)](_0x38128e=>_0x38128e[_0x372dfc(0x14f)]===SKILL_FILE);if(!_0x2eb4c3)throw CliErrors['validation'](_0x372dfc(0x14d)+SKILL_FILE+':\x20'+_0x1745f0);const _0x57fbcc=withMaterializedSkillFrontmatter(_0x3a2372,_0x52e198,_0x1745f0),_0x581e99=_0x57fbcc['find'](_0x2f6007=>_0x2f6007[_0x372dfc(0x14f)]===SKILL_FILE),_0x4de0b2=fileText(_0x581e99),_0x2bcd33=getRuntimeSkillDir(_0x441180[_0x372dfc(0x142)],_0x441180[_0x372dfc(0x137)],_0x441180[_0x372dfc(0x12e)],_0x25b3de,_0x1745f0,_0x441180['paths']),_0x4dc011=resolve(_0x2bcd33,SKILL_FILE),_0x3a833e=resolve(_0x2bcd33,METADATA_FILE),_0x58022b=contentHash(_0x4de0b2),_0x45dc49=readMetadataIfPresent(_0x3a833e)?.['fileHashes'];ensurePulledFilesCanBeOverwritten(_0x2bcd33,_0x3a833e,_0x57fbcc,_0x441180[_0x372dfc(0x152)]===!![]),mkdirSync(_0x2bcd33,{'recursive':!![],'mode':0x1c0});const _0x2c417c=existsSync(_0x4dc011)?readFileSync(_0x4dc011,_0x372dfc(0x159)):undefined;return materializeFiles(_0x2bcd33,_0x57fbcc),removeStaleManagedFiles(_0x2bcd33,_0x45dc49,_0x57fbcc),writeJsonAtomic(_0x3a833e,buildMetadata(_0x52e198,_0x25b3de,_0x441180[_0x372dfc(0x12e)],_0x58022b,_0x441180[_0x372dfc(0x154)],_0x57fbcc,_0x251daa)),{'skill':_0x52e198,'scope':_0x25b3de,'dir':_0x2bcd33,'skillMdPath':_0x4dc011,'metadataPath':_0x3a833e,'contentHash':_0x58022b,'changed':_0x2c417c!==_0x4de0b2};}export function reuseMaterializedRuntimeSkill(_0x48d32c,_0x527bf9,_0x1c2131){const _0x33e1c1=a153_0x2865,_0x1bbe83=_0x48d32c[_0x33e1c1(0x14e)]?.[_0x33e1c1(0x12a)]();if(!_0x1bbe83)return undefined;const _0x33f42e=requireSkillCode(_0x48d32c),_0x525e7c=getRuntimeSkillDir(_0x1c2131[_0x33e1c1(0x142)],_0x1c2131[_0x33e1c1(0x137)],_0x1c2131[_0x33e1c1(0x12e)],_0x527bf9,_0x33f42e,_0x1c2131['paths']),_0x48a320=resolve(_0x525e7c,SKILL_FILE),_0x4a4d69=resolve(_0x525e7c,METADATA_FILE),_0x217fdc=readMetadataIfPresent(_0x4a4d69);if(!_0x217fdc||_0x217fdc[_0x33e1c1(0x12f)]!==0x2||_0x217fdc[_0x33e1c1(0x12e)]!==_0x1c2131['appCode']||_0x217fdc['scope']!==_0x527bf9||_0x217fdc[_0x33e1c1(0x129)]!==_0x33f42e||_0x217fdc['version']!==_0x1bbe83||_0x217fdc['id']!==_0x48d32c['id']||_0x217fdc[_0x33e1c1(0x138)]!==_0x48d32c[_0x33e1c1(0x138)]||_0x217fdc[_0x33e1c1(0x160)]!==_0x48d32c[_0x33e1c1(0x160)]||_0x217fdc['example']!==_0x48d32c[_0x33e1c1(0x13d)]||_0x217fdc[_0x33e1c1(0x143)]!==_0x48d32c['status']||!_0x217fdc[_0x33e1c1(0x15d)]||!_0x217fdc['fileHashes']||!Object[_0x33e1c1(0x148)](_0x217fdc[_0x33e1c1(0x13e)],SKILL_FILE))return undefined;for(const [_0x4da206,_0x547920]of Object[_0x33e1c1(0x150)](_0x217fdc[_0x33e1c1(0x13e)])){if(!/^[a-f0-9]{64}$/[_0x33e1c1(0x156)](_0x547920))return undefined;const _0x19e101=resolveManagedFilePath(_0x525e7c,_0x4da206);if(!existsSync(_0x19e101)||!lstatSync(_0x19e101)['isFile']())return undefined;if(bufferSha256(readFileSync(_0x19e101))!==_0x547920)return undefined;}return{'skill':_0x48d32c,'scope':_0x527bf9,'dir':_0x525e7c,'skillMdPath':_0x48a320,'metadataPath':_0x4a4d69,'contentHash':_0x217fdc[_0x33e1c1(0x15d)],'changed':![]};}function withMaterializedSkillFrontmatter(_0x188f33,_0x223d22,_0x25f350){const _0x5d1abb=a153_0x2865,_0x39c3d9=skillDisplayName(_0x223d22,_0x25f350),_0x1470c8=_0x223d22[_0x5d1abb(0x160)]?.['trim']()||_0x39c3d9||_0x25f350;return normalizeLocalFiles(_0x188f33)[_0x5d1abb(0x15a)](_0x4ba999=>{const _0x1d4814=_0x5d1abb,_0x78e206=fileText(_0x4ba999);if(_0x4ba999[_0x1d4814(0x14f)]!==SKILL_FILE)return _0x4ba999;if(hasYamlFrontmatter(_0x78e206))return{'path':_0x4ba999[_0x1d4814(0x14f)],'content':withSyncedDisplayName(_0x78e206,_0x39c3d9)};return{'path':_0x4ba999[_0x1d4814(0x14f)],'content':prependSkillFrontmatter(_0x78e206,{'name':_0x25f350,'displayName':_0x39c3d9,'description':_0x1470c8})};});}function hasYamlFrontmatter(_0x2ce856){const _0x3ffb17=a153_0x2865;return/^\uFEFF?---\s*\r?\n/[_0x3ffb17(0x156)](_0x2ce856);}function prependSkillFrontmatter(_0x971a82,_0x27490d){const _0x31329e=a153_0x2865,_0x59788d=_0x971a82['replace'](/^\uFEFF/,'');return[_0x31329e(0x14c),_0x31329e(0x144)+yamlString(_0x27490d['name']),_0x27490d['displayName']?_0x31329e(0x136)+yamlString(_0x27490d[_0x31329e(0x158)]):undefined,_0x31329e(0x13f)+yamlString(_0x27490d[_0x31329e(0x160)]),_0x31329e(0x14c),'',_0x59788d]['filter'](_0x2e4f21=>_0x2e4f21!==undefined)['join']('\x0a');}function yamlString(_0x4e9466){const _0x2842b7=a153_0x2865;return JSON['stringify'](_0x4e9466[_0x2842b7(0x13c)](/\r/g,'')[_0x2842b7(0x12a)]());}function skillDisplayName(_0x36d813,_0x248539){const _0x4685bd=a153_0x2865,_0x58db07=_0x36d813[_0x4685bd(0x138)]?.[_0x4685bd(0x12a)]();return _0x58db07||_0x248539;}function withSyncedDisplayName(_0x1b5568,_0x27ec85){const _0x136867=a153_0x2865,_0x3e266a=_0x1b5568['match'](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x3e266a)return _0x1b5568;const _0xaf18a1=_0x3e266a[0x1]??'',_0x474a16=_0x3e266a[0x2]??'',_0xe87300=parseDocument(_0x474a16);if(_0xe87300[_0x136867(0x147)][_0x136867(0x128)]>0x0||!isMap(_0xe87300['contents']))return _0x1b5568;if(_0x27ec85)_0xe87300[_0x136867(0x133)](_0x136867(0x158),_0x27ec85);else{if(_0xe87300[_0x136867(0x146)](_0x136867(0x158)))_0xe87300[_0x136867(0x12b)]('displayName');else return _0x1b5568;}forceBlockCollections(_0xe87300[_0x136867(0x15c)]);const _0x38dd2b=_0xe87300[_0x136867(0x157)]({'lineWidth':0x0})['trimEnd'](),_0x46005d=_0x1b5568[_0x136867(0x135)](_0x3e266a[0x0][_0x136867(0x128)])[_0x136867(0x13c)](/^\r?\n/,'');return _0xaf18a1+'---\x0a'+_0x38dd2b+'\x0a---\x0a\x0a'+_0x46005d;}function forceBlockCollections(_0x59c567){if(!isNode(_0x59c567))return;visit(_0x59c567,(_0x3e4b6a,_0x318451)=>{isCollection(_0x318451)&&(_0x318451['flow']=![]);});}function a153_0x2865(_0x38fa5e,_0x24861c){_0x38fa5e=_0x38fa5e-0x128;const _0x4eeb8f=a153_0x4eeb();let _0x2865bb=_0x4eeb8f[_0x38fa5e];return _0x2865bb;}function ensurePulledFilesCanBeOverwritten(_0x43be21,_0x51ea92,_0x401e5d,_0x14279c){const _0xcac183=a153_0x2865;if(_0x14279c||!existsSync(_0x51ea92))return;const _0x5e7e41=readMetadataIfPresent(_0x51ea92);if(!_0x5e7e41)return;const _0x5b6c9c=_0x5e7e41['fileHashes']&&Object[_0xcac183(0x12c)](_0x5e7e41['fileHashes'])['length']>0x0?_0x5e7e41[_0xcac183(0x13e)]:undefined;if(_0x5b6c9c)for(const [_0x1171ce,_0x315f2c]of Object['entries'](_0x5b6c9c)){const _0x5679a3=resolveManagedFilePath(_0x43be21,_0x1171ce);if(!existsSync(_0x5679a3))throw CliErrors[_0xcac183(0x13b)](_0xcac183(0x14b)+_0x43be21,'Managed\x20file\x20was\x20removed\x20locally:\x20'+_0x1171ce);const _0x432fc6=lstatSync(_0x5679a3);if(!_0x432fc6[_0xcac183(0x130)]())throw CliErrors[_0xcac183(0x13b)](_0xcac183(0x14b)+_0x43be21,'Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20'+_0x1171ce);const _0x412f8f=bufferSha256(readFileSync(_0x5679a3));if(_0x412f8f!==_0x315f2c)throw CliErrors[_0xcac183(0x13b)](_0xcac183(0x14b)+_0x43be21+_0xcac183(0x139)+_0x1171ce,_0xcac183(0x140)+_0x1171ce);}else{const _0x52140a=resolve(_0x43be21,SKILL_FILE);if(existsSync(_0x52140a)&&_0x5e7e41[_0xcac183(0x15d)]){const _0x503cf1=contentHash(readFileSync(_0x52140a,'utf8'));if(_0x503cf1!==_0x5e7e41[_0xcac183(0x15d)])throw CliErrors[_0xcac183(0x13b)]('Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20'+_0x52140a,_0xcac183(0x149));}}for(const _0x138faa of normalizeLocalFiles(_0x401e5d)){if(_0x5b6c9c?.[_0x138faa['path']])continue;if(!_0x5b6c9c&&_0x138faa[_0xcac183(0x14f)]===SKILL_FILE)continue;const _0x44c868=resolveManagedFilePath(_0x43be21,_0x138faa[_0xcac183(0x14f)]);if(!existsSync(_0x44c868))continue;const _0x354680=lstatSync(_0x44c868);if(!_0x354680['isFile']())throw CliErrors['validation']('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x43be21,_0xcac183(0x134)+_0x138faa[_0xcac183(0x14f)]);const _0x3315a7=bufferSha256(readFileSync(_0x44c868));if(_0x3315a7!==fileHash(_0x138faa))throw CliErrors[_0xcac183(0x13b)](_0xcac183(0x14b)+_0x43be21,'Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20'+_0x138faa[_0xcac183(0x14f)]);}}function materializeFiles(_0x55f468,_0x8c91bf){const _0x5505b9=a153_0x2865;for(const _0x495342 of normalizeLocalFiles(_0x8c91bf)){const _0x35970a=resolveManagedFilePath(_0x55f468,_0x495342[_0x5505b9(0x14f)]);mkdirSync(dirname(_0x35970a),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x35970a,fileContent(_0x495342),0x180);}}function removeStaleManagedFiles(_0x20b064,_0x1f1340,_0x54cf3d){const _0x388d8a=a153_0x2865;if(!_0x1f1340)return;const _0xa70a56=new Set(normalizeLocalFiles(_0x54cf3d)[_0x388d8a(0x15a)](_0x38a705=>_0x38a705[_0x388d8a(0x14f)]));for(const _0xa8f0e of Object[_0x388d8a(0x12c)](_0x1f1340)){if(_0xa70a56[_0x388d8a(0x146)](_0xa8f0e))continue;const _0x3545b2=resolveManagedFilePath(_0x20b064,_0xa8f0e);existsSync(_0x3545b2)&&lstatSync(_0x3545b2)[_0x388d8a(0x130)]()&&rmSync(_0x3545b2,{'force':!![]});}}
@@ -1 +1 @@
1
- (function(_0x1bd3cc,_0x2f091f){const _0xdbe5dd=a146_0xb133,_0x1a95db=_0x1bd3cc();while(!![]){try{const _0x2cd685=parseInt(_0xdbe5dd(0x19a))/0x1*(-parseInt(_0xdbe5dd(0x193))/0x2)+-parseInt(_0xdbe5dd(0x184))/0x3*(-parseInt(_0xdbe5dd(0x175))/0x4)+-parseInt(_0xdbe5dd(0x17c))/0x5+parseInt(_0xdbe5dd(0x183))/0x6+-parseInt(_0xdbe5dd(0x192))/0x7+-parseInt(_0xdbe5dd(0x181))/0x8*(parseInt(_0xdbe5dd(0x18d))/0x9)+parseInt(_0xdbe5dd(0x185))/0xa*(parseInt(_0xdbe5dd(0x180))/0xb);if(_0x2cd685===_0x2f091f)break;else _0x1a95db['push'](_0x1a95db['shift']());}catch(_0x2de256){_0x1a95db['push'](_0x1a95db['shift']());}}}(a146_0x1a99,0xb9352));import{existsSync,readFileSync}from'node:fs';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';import{bufferSha256,fileHash,fileTreeHash}from'./hashing.js';function a146_0xb133(_0x5cded3,_0x33734e){_0x5cded3=_0x5cded3-0x174;const _0x1a998f=a146_0x1a99();let _0xb13395=_0x1a998f[_0x5cded3];return _0xb13395;}function a146_0x1a99(){const _0x374d6d=['string','length','description','3133805aHHLeP','skillCode','zipSha256','zipSize','11BHQnuN','2706680gGtSMe','tags','1723728tOOqwr','624465XQVkya','28109570CgKAJL','isArray','userId','example','trim','fromEntries','Invalid\x20','Runtime\x20Skill\x20is\x20missing\x20skillCode.','9iIUnvi','sourceSessionId','readonly','personal','skillName','2501562LVcoWc','82zeCUSC','hasUpstreamUpdate','toISOString','status','validation','utf8','map','34963QNIBNE','object','tenantCode','8UbwUnq','files','path','ossPath'];a146_0x1a99=function(){return _0x374d6d;};return a146_0x1a99();}import{fileContent,normalizeLocalFiles}from'./local-files.js';import{buildSkillPackage,localFilesToManifestFiles}from'./zip-package.js';export function buildMetadata(_0x504469,_0x3e00d4,_0x43d258,_0x31ad59,_0x3b4867,_0x836c2c,_0x4aa603){const _0x512c9b=a146_0xb133,_0x1f1718=_0x836c2c?normalizeLocalFiles(_0x836c2c):[],_0x54aee4=!_0x4aa603&&_0x1f1718[_0x512c9b(0x17a)]>0x0?buildSkillPackage(_0x1f1718):undefined,_0x4ac61b=_0x4aa603?bufferSha256(_0x4aa603):_0x54aee4?.['manifest'][_0x512c9b(0x17e)],_0x5988a9=_0x4aa603?.[_0x512c9b(0x17a)]??_0x54aee4?.['manifest'][_0x512c9b(0x17f)],_0x2eb669=_0x1f1718[_0x512c9b(0x17a)]>0x0?Object[_0x512c9b(0x18a)](_0x1f1718[_0x512c9b(0x199)](_0xaae737=>[_0xaae737['path'],fileHash(_0xaae737)])):undefined;return{'schemaVersion':_0x1f1718[_0x512c9b(0x17a)]>0x0?0x2:0x1,'id':_0x504469['id'],'appCode':_0x43d258,'skillCode':requireSkillCode(_0x504469),'skillName':_0x504469[_0x512c9b(0x191)],'description':_0x504469[_0x512c9b(0x17b)],'example':_0x504469[_0x512c9b(0x188)],'scope':_0x3e00d4,'readonly':_0x3e00d4!==_0x512c9b(0x190)||_0x504469[_0x512c9b(0x18f)]===!![],'tenantCode':_0x504469[_0x512c9b(0x174)],'userId':_0x504469[_0x512c9b(0x187)],'version':_0x504469['version'],'status':_0x504469[_0x512c9b(0x196)],'tags':Array[_0x512c9b(0x186)](_0x504469['tags'])?_0x504469[_0x512c9b(0x182)]:[],'hasUpstreamUpdate':_0x504469[_0x512c9b(0x194)],'forkedFromSkillId':_0x504469['forkedFromSkillId'],'forkedFromVersion':_0x504469['forkedFromVersion'],'sourceSessionId':_0x504469[_0x512c9b(0x18e)],'contentHash':_0x31ad59,'fileHashes':_0x2eb669,'treeHash':_0x1f1718[_0x512c9b(0x17a)]>0x0?fileTreeHash(localFilesToManifestFiles(_0x1f1718)):undefined,'ossPath':remoteManifestOssPath(_0x504469[_0x512c9b(0x176)]),'zipSha256':_0x4ac61b,'zipSize':_0x5988a9,'files':_0x1f1718[_0x512c9b(0x17a)]>0x0?_0x1f1718[_0x512c9b(0x199)](_0x4a7102=>({'path':_0x4a7102[_0x512c9b(0x177)],'hash':fileHash(_0x4a7102),'size':fileContent(_0x4a7102)[_0x512c9b(0x17a)]})):undefined,'pulledAt':_0x3b4867??new Date()[_0x512c9b(0x195)]()};}export function requireSkillCode(_0x7c6f7){const _0x24df32=a146_0xb133,_0x43134d=_0x7c6f7[_0x24df32(0x17d)]?.['trim']();if(!_0x43134d)throw CliErrors[_0x24df32(0x197)](_0x24df32(0x18c));return _0x43134d;}export function readMetadataIfPresent(_0x34011e){const _0x1a956e=a146_0xb133;if(!existsSync(_0x34011e))return undefined;try{const _0x1b7c0c=JSON['parse'](readFileSync(_0x34011e,_0x1a956e(0x198)));return _0x1b7c0c;}catch{throw CliErrors['validation'](_0x1a956e(0x18b)+METADATA_FILE+':\x20'+_0x34011e);}}function remoteManifestOssPath(_0x7a9ac1){const _0x554bcc=a146_0xb133;if(!_0x7a9ac1||typeof _0x7a9ac1!==_0x554bcc(0x19b)||Array['isArray'](_0x7a9ac1))return undefined;const _0x1b75ab=_0x7a9ac1[_0x554bcc(0x178)];return typeof _0x1b75ab===_0x554bcc(0x179)&&_0x1b75ab[_0x554bcc(0x189)]()?_0x1b75ab[_0x554bcc(0x189)]():undefined;}
1
+ (function(_0x5f3ee8,_0x5976e2){const _0x4950ef=a154_0x77cc,_0x522de8=_0x5f3ee8();while(!![]){try{const _0x3abfd8=parseInt(_0x4950ef(0x17c))/0x1*(parseInt(_0x4950ef(0x185))/0x2)+parseInt(_0x4950ef(0x195))/0x3+parseInt(_0x4950ef(0x173))/0x4*(-parseInt(_0x4950ef(0x174))/0x5)+parseInt(_0x4950ef(0x17d))/0x6*(parseInt(_0x4950ef(0x17a))/0x7)+-parseInt(_0x4950ef(0x188))/0x8*(-parseInt(_0x4950ef(0x191))/0x9)+-parseInt(_0x4950ef(0x178))/0xa*(parseInt(_0x4950ef(0x186))/0xb)+-parseInt(_0x4950ef(0x192))/0xc;if(_0x3abfd8===_0x5976e2)break;else _0x522de8['push'](_0x522de8['shift']());}catch(_0x2096fd){_0x522de8['push'](_0x522de8['shift']());}}}(a154_0x2d74,0x1e2e9));import{existsSync,readFileSync}from'node:fs';import{CliErrors}from'../../errors.js';function a154_0x2d74(){const _0x20c9ea=['manifest','trim','91143OUlrrJ','526248QpTzzq','sourceSessionId','readonly','687732okPjIN','files','forkedFromSkillId','string','tenantCode','908CnesXN','3495CQCyyf','isArray','skillCode','status','80vJFAvM','validation','84kfbywQ','fromEntries','55AJaocB','31722bEbMPB','map','forkedFromVersion','Runtime\x20Skill\x20is\x20missing\x20skillCode.','utf8','zipSize','skillName','path','3902dvDIXQ','115456LSMlHc','hasUpstreamUpdate','8iNBHgP','version','description','length','parse','tags','personal'];a154_0x2d74=function(){return _0x20c9ea;};return a154_0x2d74();}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(_0x4aefa4,_0x51f3d8,_0x4db51a,_0x4938bd,_0x37b99f,_0x17e97b,_0x4dc276){const _0xf2238a=a154_0x77cc,_0x14f1c3=_0x17e97b?normalizeLocalFiles(_0x17e97b):[],_0x447fc6=!_0x4dc276&&_0x14f1c3['length']>0x0?buildSkillPackage(_0x14f1c3):undefined,_0x3c4577=_0x4dc276?bufferSha256(_0x4dc276):_0x447fc6?.[_0xf2238a(0x18f)]['zipSha256'],_0x38dde2=_0x4dc276?.['length']??_0x447fc6?.['manifest'][_0xf2238a(0x182)],_0x52240a=_0x14f1c3[_0xf2238a(0x18b)]>0x0?Object[_0xf2238a(0x17b)](_0x14f1c3[_0xf2238a(0x17e)](_0x5b8387=>[_0x5b8387[_0xf2238a(0x184)],fileHash(_0x5b8387)])):undefined;return{'schemaVersion':_0x14f1c3[_0xf2238a(0x18b)]>0x0?0x2:0x1,'id':_0x4aefa4['id'],'appCode':_0x4db51a,'skillCode':requireSkillCode(_0x4aefa4),'skillName':_0x4aefa4[_0xf2238a(0x183)],'description':_0x4aefa4[_0xf2238a(0x18a)],'example':_0x4aefa4['example'],'scope':_0x51f3d8,'readonly':_0x51f3d8!==_0xf2238a(0x18e)||_0x4aefa4[_0xf2238a(0x194)]===!![],'tenantCode':_0x4aefa4[_0xf2238a(0x172)],'userId':_0x4aefa4['userId'],'version':_0x4aefa4[_0xf2238a(0x189)],'status':_0x4aefa4[_0xf2238a(0x177)],'tags':Array[_0xf2238a(0x175)](_0x4aefa4[_0xf2238a(0x18d)])?_0x4aefa4[_0xf2238a(0x18d)]:[],'hasUpstreamUpdate':_0x4aefa4[_0xf2238a(0x187)],'forkedFromSkillId':_0x4aefa4[_0xf2238a(0x170)],'forkedFromVersion':_0x4aefa4[_0xf2238a(0x17f)],'sourceSessionId':_0x4aefa4[_0xf2238a(0x193)],'contentHash':_0x4938bd,'fileHashes':_0x52240a,'treeHash':_0x14f1c3[_0xf2238a(0x18b)]>0x0?fileTreeHash(localFilesToManifestFiles(_0x14f1c3)):undefined,'ossPath':remoteManifestOssPath(_0x4aefa4[_0xf2238a(0x196)]),'zipSha256':_0x3c4577,'zipSize':_0x38dde2,'files':_0x14f1c3[_0xf2238a(0x18b)]>0x0?_0x14f1c3['map'](_0x2c8750=>({'path':_0x2c8750[_0xf2238a(0x184)],'hash':fileHash(_0x2c8750),'size':fileContent(_0x2c8750)[_0xf2238a(0x18b)]})):undefined,'pulledAt':_0x37b99f??new Date()['toISOString']()};}export function requireSkillCode(_0x3454ed){const _0x532cba=a154_0x77cc,_0x1c66a2=_0x3454ed[_0x532cba(0x176)]?.[_0x532cba(0x190)]();if(!_0x1c66a2)throw CliErrors[_0x532cba(0x179)](_0x532cba(0x180));return _0x1c66a2;}function a154_0x77cc(_0x1b8c19,_0x24f2fa){_0x1b8c19=_0x1b8c19-0x170;const _0x2d74f1=a154_0x2d74();let _0x77cc67=_0x2d74f1[_0x1b8c19];return _0x77cc67;}export function readMetadataIfPresent(_0x30baf0){const _0x30e7a1=a154_0x77cc;if(!existsSync(_0x30baf0))return undefined;try{const _0x530bb5=JSON[_0x30e7a1(0x18c)](readFileSync(_0x30baf0,_0x30e7a1(0x181)));return _0x530bb5;}catch{throw CliErrors[_0x30e7a1(0x179)]('Invalid\x20'+METADATA_FILE+':\x20'+_0x30baf0);}}function remoteManifestOssPath(_0x2b6449){const _0x507644=a154_0x77cc;if(!_0x2b6449||typeof _0x2b6449!=='object'||Array[_0x507644(0x175)](_0x2b6449))return undefined;const _0x142d93=_0x2b6449['ossPath'];return typeof _0x142d93===_0x507644(0x171)&&_0x142d93[_0x507644(0x190)]()?_0x142d93[_0x507644(0x190)]():undefined;}
@@ -1 +1 @@
1
- const a147_0x4c360c=a147_0x1988;(function(_0x1d5489,_0x130faa){const _0x5a1029=a147_0x1988,_0x239e37=_0x1d5489();while(!![]){try{const _0x4a83d9=parseInt(_0x5a1029(0x122))/0x1+-parseInt(_0x5a1029(0x117))/0x2+parseInt(_0x5a1029(0x119))/0x3*(-parseInt(_0x5a1029(0x108))/0x4)+-parseInt(_0x5a1029(0x114))/0x5+parseInt(_0x5a1029(0x10d))/0x6*(-parseInt(_0x5a1029(0x107))/0x7)+-parseInt(_0x5a1029(0x11d))/0x8+-parseInt(_0x5a1029(0x11e))/0x9*(-parseInt(_0x5a1029(0x109))/0xa);if(_0x4a83d9===_0x130faa)break;else _0x239e37['push'](_0x239e37['shift']());}catch(_0x3cae80){_0x239e37['push'](_0x239e37['shift']());}}}(a147_0x5d89,0x6efa5));function a147_0x5d89(){const _0x83d680=['.workbuddy','1601715wAJIpq','skills','homeDirName','512172cDaBDp','path\x20segment','3PrRwgK','includes','filter','.claude','1670680ZzOdnF','1056105rApdiL','homeDir','.agents','cacheRoot','877211ZgicGs','validation','333361tLouKG','1175316MGTZrI','60TKsnow','workbuddySkillsDir','skillCode','CLAUDE_SKILL_ROOT','6VpomQO','claudeSkillsDir','cache','agentsSkillsDir','Unsafe\x20','appCode'];a147_0x5d89=function(){return _0x83d680;};return a147_0x5d89();}import{existsSync}from'node:fs';import{homedir}from'node:os';import{resolve}from'node:path';import{fingerprintAccessKey}from'../../commands/app/cache.js';import{PRODUCT_CONFIG,productEnv}from'../../constant/product.js';import{CliErrors}from'../../errors.js';export function resolveSkillSyncPaths(_0x193e07={}){const _0x3fe8c0=a147_0x1988,_0x2a4c92=_0x193e07[_0x3fe8c0(0x11f)]??homedir(),_0x2a2325=resolve(_0x2a4c92,PRODUCT_CONFIG['homeDirName'],_0x3fe8c0(0x10f)),_0x5c3388=trimmedEnv('SKILL_ROOT'),_0xe19b40=trimmedEnv(_0x3fe8c0(0x10c)),_0x29797a=resolve(_0x2a4c92,_0x3fe8c0(0x113)),_0x19762c=_0x193e07[_0x3fe8c0(0x10a)]??(existsSync(_0x29797a)?resolve(_0x29797a,_0x3fe8c0(0x115)):undefined);return{'homeDir':_0x2a4c92,'cacheRoot':_0x2a2325,'managedRoot':resolve(_0x2a4c92,PRODUCT_CONFIG[_0x3fe8c0(0x116)]),'agentsSkillsDir':_0x193e07[_0x3fe8c0(0x110)]??_0x5c3388??resolve(_0x2a4c92,_0x3fe8c0(0x120),'skills'),'claudeSkillsDir':_0x193e07['claudeSkillsDir']??_0xe19b40??resolve(_0x2a4c92,_0x3fe8c0(0x11c),_0x3fe8c0(0x115)),'workbuddySkillsDir':_0x19762c};}function a147_0x1988(_0x517af2,_0x332708){_0x517af2=_0x517af2-0x106;const _0x5d89f2=a147_0x5d89();let _0x198889=_0x5d89f2[_0x517af2];return _0x198889;}export function runtimeAgentSkillRoots(_0x236349){const _0x25b672=a147_0x1988;return[_0x236349[_0x25b672(0x110)],_0x236349[_0x25b672(0x10e)],_0x236349[_0x25b672(0x10a)]][_0x25b672(0x11b)](_0xf3130f=>Boolean(_0xf3130f));}export function getRuntimeSkillCacheRoot(_0x222baf,_0x15ca1e,_0x16cef5={}){const _0xedc8fd=a147_0x1988,_0x416b47=resolveSkillSyncPaths(_0x16cef5);return resolve(_0x416b47[_0xedc8fd(0x121)],_0x222baf,fingerprintAccessKey(_0x15ca1e),_0xedc8fd(0x115));}export function getRuntimeSkillDir(_0xfc1eee,_0x498be4,_0x39fd58,_0x2e1ed9,_0x15ab0a,_0x192301={}){const _0x1a1785=a147_0x1988;return resolve(getRuntimeSkillCacheRoot(_0xfc1eee,_0x498be4,_0x192301),safePathSegment(_0x39fd58,_0x1a1785(0x112)),_0x2e1ed9,safePathSegment(_0x15ab0a,_0x1a1785(0x10b)));}export function safePathSegment(_0x972ec4,_0x1e6329=a147_0x4c360c(0x118)){const _0x90164=a147_0x4c360c;if(!_0x972ec4||_0x972ec4[_0x90164(0x11a)]('/')||_0x972ec4[_0x90164(0x11a)]('\x5c')||_0x972ec4[_0x90164(0x11a)]('..'))throw CliErrors[_0x90164(0x106)](_0x90164(0x111)+_0x1e6329+'\x20for\x20local\x20path:\x20'+_0x972ec4);return _0x972ec4;}function trimmedEnv(_0x4064f1){const _0x4b2e5e=productEnv(_0x4064f1)?.['trim']();return _0x4b2e5e?_0x4b2e5e:undefined;}
1
+ const a155_0xc790ee=a155_0xfbbc;(function(_0x4d7645,_0xc57337){const _0xaba418=a155_0xfbbc,_0x2bba73=_0x4d7645();while(!![]){try{const _0xcb2383=-parseInt(_0xaba418(0xe3))/0x1*(parseInt(_0xaba418(0xd0))/0x2)+parseInt(_0xaba418(0xd3))/0x3+-parseInt(_0xaba418(0xd2))/0x4+parseInt(_0xaba418(0xe1))/0x5*(-parseInt(_0xaba418(0xec))/0x6)+parseInt(_0xaba418(0xe7))/0x7*(parseInt(_0xaba418(0xeb))/0x8)+-parseInt(_0xaba418(0xe5))/0x9*(parseInt(_0xaba418(0xdf))/0xa)+-parseInt(_0xaba418(0xd8))/0xb*(-parseInt(_0xaba418(0xd5))/0xc);if(_0xcb2383===_0xc57337)break;else _0x2bba73['push'](_0x2bba73['shift']());}catch(_0x8b41d6){_0x2bba73['push'](_0x2bba73['shift']());}}}(a155_0x1bf2,0xd8d46));import{existsSync}from'node:fs';import{homedir}from'node:os';import{resolve}from'node:path';function a155_0x1bf2(){const _0x9921d3=['180014wvOuTF','includes','5043468Uqfhyj','5252664hlKFku','path\x20segment','12QyhHbd','filter','SKILL_ROOT','17872019sLXLOg','cacheRoot','skills','.claude','.workbuddy','workbuddySkillsDir','homeDirName','2683180LlnsTX','.agents','10nDVWcP','validation','4YnbTvk','CLAUDE_SKILL_ROOT','9kxlFtA','cache','42IQrQVD','agentsSkillsDir','skillCode','claudeSkillsDir','529792wJcHqh','2986842rHfUof','\x20for\x20local\x20path:\x20'];a155_0x1bf2=function(){return _0x9921d3;};return a155_0x1bf2();}import{fingerprintAccessKey}from'../../commands/app/cache.js';import{PRODUCT_CONFIG,productEnv}from'../../constant/product.js';import{CliErrors}from'../../errors.js';export function resolveSkillSyncPaths(_0x9e9e1f={}){const _0x5254d5=a155_0xfbbc,_0x1c536f=_0x9e9e1f['homeDir']??homedir(),_0x42b0a9=resolve(_0x1c536f,PRODUCT_CONFIG[_0x5254d5(0xde)],_0x5254d5(0xe6)),_0x54e3b6=trimmedEnv(_0x5254d5(0xd7)),_0xa62438=trimmedEnv(_0x5254d5(0xe4)),_0x44e152=resolve(_0x1c536f,_0x5254d5(0xdc)),_0x32cdc3=_0x9e9e1f[_0x5254d5(0xdd)]??(existsSync(_0x44e152)?resolve(_0x44e152,_0x5254d5(0xda)):undefined);return{'homeDir':_0x1c536f,'cacheRoot':_0x42b0a9,'managedRoot':resolve(_0x1c536f,PRODUCT_CONFIG['homeDirName']),'agentsSkillsDir':_0x9e9e1f[_0x5254d5(0xe8)]??_0x54e3b6??resolve(_0x1c536f,_0x5254d5(0xe0),_0x5254d5(0xda)),'claudeSkillsDir':_0x9e9e1f[_0x5254d5(0xea)]??_0xa62438??resolve(_0x1c536f,_0x5254d5(0xdb),'skills'),'workbuddySkillsDir':_0x32cdc3};}export function runtimeAgentSkillRoots(_0x575b84){const _0x7516b9=a155_0xfbbc;return[_0x575b84['agentsSkillsDir'],_0x575b84['claudeSkillsDir'],_0x575b84[_0x7516b9(0xdd)]][_0x7516b9(0xd6)](_0x38c07f=>Boolean(_0x38c07f));}export function getRuntimeSkillCacheRoot(_0xc8eb0e,_0x3ed247,_0x43ef0c={}){const _0x6e16c=a155_0xfbbc,_0x3fb1b7=resolveSkillSyncPaths(_0x43ef0c);return resolve(_0x3fb1b7[_0x6e16c(0xd9)],_0xc8eb0e,fingerprintAccessKey(_0x3ed247),_0x6e16c(0xda));}export function getRuntimeSkillDir(_0x112550,_0x1101bd,_0x88828b,_0x2af814,_0xa49afd,_0x59f6de={}){const _0x52fa09=a155_0xfbbc;return resolve(getRuntimeSkillCacheRoot(_0x112550,_0x1101bd,_0x59f6de),safePathSegment(_0x88828b,'appCode'),_0x2af814,safePathSegment(_0xa49afd,_0x52fa09(0xe9)));}export function safePathSegment(_0x4054f8,_0x4bac32=a155_0xc790ee(0xd4)){const _0x24f052=a155_0xc790ee;if(!_0x4054f8||_0x4054f8[_0x24f052(0xd1)]('/')||_0x4054f8[_0x24f052(0xd1)]('\x5c')||_0x4054f8[_0x24f052(0xd1)]('..'))throw CliErrors[_0x24f052(0xe2)]('Unsafe\x20'+_0x4bac32+_0x24f052(0xed)+_0x4054f8);return _0x4054f8;}function a155_0xfbbc(_0x378be8,_0x39ade3){_0x378be8=_0x378be8-0xd0;const _0x1bf290=a155_0x1bf2();let _0xfbbcfe=_0x1bf290[_0x378be8];return _0xfbbcfe;}function trimmedEnv(_0x58c039){const _0x3d05ef=productEnv(_0x58c039)?.['trim']();return _0x3d05ef?_0x3d05ef:undefined;}
@@ -1 +1 @@
1
- (function(_0x3f2c6f,_0x28eef6){const _0x37a080=a148_0x1ebb,_0x25e738=_0x3f2c6f();while(!![]){try{const _0x292265=-parseInt(_0x37a080(0x1b3))/0x1*(-parseInt(_0x37a080(0x1c3))/0x2)+parseInt(_0x37a080(0x1be))/0x3*(parseInt(_0x37a080(0x1ab))/0x4)+-parseInt(_0x37a080(0x1e2))/0x5*(parseInt(_0x37a080(0x1e4))/0x6)+parseInt(_0x37a080(0x1cf))/0x7+-parseInt(_0x37a080(0x1e6))/0x8+-parseInt(_0x37a080(0x1bd))/0x9*(parseInt(_0x37a080(0x1de))/0xa)+-parseInt(_0x37a080(0x1e0))/0xb;if(_0x292265===_0x28eef6)break;else _0x25e738['push'](_0x25e738['shift']());}catch(_0x270f5f){_0x25e738['push'](_0x25e738['shift']());}}}(a148_0x4302,0xa91ef));function a148_0x4302(){const _0x1304d7=['ignoreMetadataAppCodeMismatch','1434CbXPMV','appCode','ignoreMetadataScope','dir','ignoreInvalidMetadata','path','displayName','toLowerCase','unknown','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20','tags','targetScope','9633421JwttTr','object','\x20has\x20unsupported\x20scope\x20\x22','utf8','content','files','scope','length','personal','description','\x20name\x20for\x20SkillHub\x20slug\x20generation.','excludedFilePaths','refreshedAt','pushedAt','Invalid\x20','310ZMUBJb','packageBase64','9549914HlHLAS','validation','1755QaSszN','boolean','3858UXfgvX','slice','3211872nTXmuv','\x20to\x20submit\x20company\x20Skills\x20for\x20review.',',\x20or\x20directory\x20name.','company','isSymbolicLink','version','manifest','startsWith','skillCode','replace','sourceSessionId','allowAppCodeRetarget','Unable\x20to\x20resolve\x20skillCode\x20from\x20','filter','match','71968kiTwns','isDirectory','ignoreMetadataSkillCode','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20','isFile','isArray','string','trim','1089YNENvU','skillName','ignoreMetadataForPayload','example','builtin','number','Skill\x20metadata\x20appCode\x20\x22','find','Skill\x20directory\x20not\x20found:\x20','\x20has\x20scope=\x22','95454MlbLgb','60AWQpBA','Remote\x20Skill\x20','Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20','\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22'];a148_0x4302=function(){return _0x1304d7;};return a148_0x4302();}import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a148_0x4e6977}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(_0x5eccb7,_0x3fffc5,_0x3cc9e4={}){const _0x1eedb6=a148_0x1ebb,_0x11b3a0=resolvePushDirectoryRoot(_0x5eccb7),_0x549ec5=readPushMetadataIfPresent(resolve(_0x11b3a0,METADATA_FILE),{'ignoreInvalidMetadata':_0x3cc9e4[_0x1eedb6(0x1c7)]});if(_0x549ec5?.['appCode']&&_0x549ec5[_0x1eedb6(0x1c4)]!==_0x3fffc5&&!_0x3cc9e4[_0x1eedb6(0x1f1)]&&!_0x3cc9e4[_0x1eedb6(0x1c2)])throw CliErrors['validation'](_0x1eedb6(0x1b9)+_0x549ec5['appCode']+_0x1eedb6(0x1c1)+_0x3fffc5+'\x22.');const _0x1e10eb=resolvePushSkillCode(_0x11b3a0,_0x3fffc5,_0x549ec5,_0x3cc9e4);if(!_0x1e10eb)throw CliErrors[_0x1eedb6(0x1e1)](_0x1eedb6(0x1f2)+SKILL_FILE+',\x20'+METADATA_FILE+_0x1eedb6(0x1e8));return{'dir':_0x11b3a0,'skillCode':_0x1e10eb,'metadata':_0x549ec5};}export function readPushDirectory(_0x18ea8e,_0x2b8344,_0x19849e={}){const _0x2b7378=a148_0x1ebb,_0x592f80=resolvePushDirectoryIdentity(_0x18ea8e,_0x2b8344,_0x19849e),_0x52afdc=_0x592f80[_0x2b7378(0x1c6)],_0x4c40b3=resolve(_0x52afdc,SKILL_FILE);if(!existsSync(_0x4c40b3)||!lstatSync(_0x4c40b3)[_0x2b7378(0x1af)]())throw CliErrors[_0x2b7378(0x1e1)]('Missing\x20'+SKILL_FILE+':\x20'+_0x4c40b3);const _0x37d02c=_0x592f80['metadata'],_0x1ee8ef=_0x19849e[_0x2b7378(0x1ce)]??_0x2b7378(0x1d7);if(!_0x19849e[_0x2b7378(0x1c5)]&&_0x37d02c?.[_0x2b7378(0x1d5)]===_0x2b7378(0x1b7))throw CliErrors[_0x2b7378(0x1e1)](_0x2b7378(0x1c0)+METADATA_FILE+_0x2b7378(0x1bc)+_0x37d02c[_0x2b7378(0x1d5)]+'\x22.');if(!_0x19849e[_0x2b7378(0x1c5)]&&_0x1ee8ef==='personal'&&_0x37d02c?.['scope']&&_0x37d02c[_0x2b7378(0x1d5)]!==_0x2b7378(0x1d7))throw CliErrors[_0x2b7378(0x1e1)](_0x2b7378(0x1ae)+METADATA_FILE+'\x20has\x20scope=\x22'+_0x37d02c[_0x2b7378(0x1d5)]+'\x22.',_0x2b7378(0x1cc)+_0x52afdc+_0x2b7378(0x1e7));const _0x1ccdcd=scanSkillDirectory(_0x52afdc,{'excludedFilePaths':_0x19849e[_0x2b7378(0x1da)]}),_0xd68205=buildSkillPackage(_0x1ccdcd),_0x3af38a=readFileSync(_0x4c40b3,_0x2b7378(0x1d2)),_0x29bc3d=_0x592f80['skillCode'],_0x4e593e=_0x19849e[_0x2b7378(0x1b5)]?undefined:_0x37d02c,_0x237b5d=readSkillDisplayName(_0x3af38a);return{'skillCode':_0x29bc3d,'metadata':_0x37d02c,'frontmatterDisplayName':_0x237b5d,'input':{'skillCode':_0x29bc3d,'skillName':_0x237b5d??_0x4e593e?.['skillName'],'description':_0x4e593e?.[_0x2b7378(0x1d8)],'content':_0x3af38a,'files':_0xd68205[_0x2b7378(0x1ec)],'packageBase64':_0xd68205[_0x2b7378(0x1df)],'tags':_0x4e593e?.[_0x2b7378(0x1cd)],'version':_0x4e593e?.[_0x2b7378(0x1eb)],'sourceSessionId':_0x4e593e?.['sourceSessionId']}};}export function refreshPushDirectoryMetadataFromRemote(_0x1fb32e,_0x18e53b,_0x5c191d,_0x449660={}){const _0x57f682=a148_0x1ebb,_0x48c9f3=resolvePushDirectoryRoot(_0x1fb32e),_0x5cc1fd=readPushMetadataIfPresent(resolve(_0x48c9f3,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x564f63=requireRemoteScope(_0x18e53b),_0x4e3d6a=readLocalSkillContent(_0x48c9f3),_0x49766d={..._0x18e53b,'appCode':_0x18e53b[_0x57f682(0x1c4)]??_0x5c191d,'skillName':_0x18e53b[_0x57f682(0x1b4)]??_0x5cc1fd?.['skillName'],'description':_0x18e53b['description']??_0x5cc1fd?.[_0x57f682(0x1d8)],'example':_0x18e53b[_0x57f682(0x1b6)]??_0x5cc1fd?.[_0x57f682(0x1b6)],'tags':Array['isArray'](_0x18e53b[_0x57f682(0x1cd)])?_0x18e53b[_0x57f682(0x1cd)]:_0x5cc1fd?.['tags'],'sourceSessionId':_0x18e53b['sourceSessionId']??_0x5cc1fd?.[_0x57f682(0x1f0)],'content':_0x18e53b[_0x57f682(0x1d3)]??_0x4e3d6a},_0x2b9330=buildMetadata(_0x49766d,_0x564f63,_0x5c191d,contentHash(_0x4e3d6a),_0x449660[_0x57f682(0x1db)]);writeJsonAtomic(resolve(_0x48c9f3,METADATA_FILE),_0x2b9330);}export function recordPushedRuntimeSkill(_0x30703e,_0x340931,_0xfd255b,_0x436ff8={}){const _0x56f882=a148_0x1ebb,_0x4d8fda=resolvePushDirectoryRoot(_0x30703e),_0x570278=scanSkillDirectory(_0x4d8fda),_0x3ed228=_0x570278[_0x56f882(0x1ba)](_0x49a3d2=>_0x49a3d2['path']===SKILL_FILE),_0x339f9e=_0x3ed228?fileText(_0x3ed228):'',_0x5eab97=tryNormalizePackageManifest(_0x340931[_0x56f882(0x1d4)]),_0x1d2f67={..._0x340931,'content':_0x340931[_0x56f882(0x1d3)]??_0x339f9e,'files':_0x5eab97},_0x1f83b5=_0x5eab97?normalizeLocalFiles(_0x570278)[_0x56f882(0x1a9)](_0x5dd6b8=>_0x5eab97[_0x56f882(0x1d4)]['some'](_0x50e844=>_0x50e844[_0x56f882(0x1c8)]===_0x5dd6b8[_0x56f882(0x1c8)])):undefined,_0x513f2c=buildMetadata(_0x1d2f67,_0x436ff8[_0x56f882(0x1d5)]??_0x56f882(0x1d7),_0xfd255b,contentHash(_0x1d2f67[_0x56f882(0x1d3)]??''),_0x436ff8[_0x56f882(0x1dc)],_0x1f83b5);writeJsonAtomic(resolve(_0x4d8fda,METADATA_FILE),_0x513f2c);}export function deriveSkillCodeFromDirectory(_0x32d915,_0x37777e){const _0x59d797=a148_0x1ebb,_0x563f92=basename(resolve(_0x32d915)),_0xc3585f=_0x37777e+'--';return _0x563f92[_0x59d797(0x1ed)](_0xc3585f)?_0x563f92[_0x59d797(0x1e5)](_0xc3585f[_0x59d797(0x1d6)]):_0x563f92;}function resolvePushSkillCode(_0x1f3ac6,_0x4057c9,_0x2e2228,_0x2481f3){const _0x2a356b=a148_0x1ebb,_0x146a0e=deriveSkillCodeFromSkillFile(_0x1f3ac6)||deriveSkillCodeFromDirectory(_0x1f3ac6,_0x4057c9);if(_0x2481f3[_0x2a356b(0x1ad)])return _0x146a0e;return _0x2e2228?.[_0x2a356b(0x1ee)]?.[_0x2a356b(0x1b2)]()||_0x146a0e;}function a148_0x1ebb(_0x290e7b,_0x46ca58){_0x290e7b=_0x290e7b-0x1a9;const _0x4302c5=a148_0x4302();let _0x1ebbf3=_0x4302c5[_0x290e7b];return _0x1ebbf3;}function deriveSkillCodeFromSkillFile(_0x580570){const _0x5ed5bc=a148_0x1ebb,_0x178d44=resolve(_0x580570,SKILL_FILE);if(!existsSync(_0x178d44)||!lstatSync(_0x178d44)['isFile']())return undefined;const _0x23f54=readFileSync(_0x178d44,_0x5ed5bc(0x1d2)),_0x13f108=_0x23f54[_0x5ed5bc(0x1aa)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x13f108)return undefined;const _0x39e555=parseFrontmatterObject(_0x13f108[0x1]??''),_0x4e1db0=scalarToString(_0x39e555?.['name']);return _0x4e1db0?slugifySkillName(_0x4e1db0):undefined;}function readSkillDisplayName(_0x4224fe){const _0x5155c7=a148_0x1ebb,_0x56abd3=_0x4224fe[_0x5155c7(0x1aa)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x56abd3)return undefined;const _0x331005=parseFrontmatterObject(_0x56abd3[0x1]??'');return scalarToString(_0x331005?.[_0x5155c7(0x1c9)]);}function slugifySkillName(_0x52d51f){const _0x1ddea9=a148_0x1ebb,_0x3363e5=_0x52d51f[_0x1ddea9(0x1b2)]()[_0x1ddea9(0x1ca)]()['replace'](/[^\p{L}\p{N}\p{So}]+/gu,'-')[_0x1ddea9(0x1ef)](/^-+/,'')[_0x1ddea9(0x1ef)](/-+$/,'')[_0x1ddea9(0x1ef)](/-{2,}/g,'-');if(!_0x3363e5)throw CliErrors[_0x1ddea9(0x1e1)](_0x1ddea9(0x1dd)+SKILL_FILE+_0x1ddea9(0x1d9));return _0x3363e5;}function parseFrontmatterObject(_0x194b99){const _0x386342=a148_0x1ebb;try{const _0xadf802=a148_0x4e6977(_0x194b99);return _0xadf802&&typeof _0xadf802===_0x386342(0x1d0)&&!Array[_0x386342(0x1b0)](_0xadf802)?_0xadf802:undefined;}catch{return undefined;}}function scalarToString(_0x8f0954){const _0x47abea=a148_0x1ebb;if(typeof _0x8f0954===_0x47abea(0x1b1))return _0x8f0954['trim']();if(typeof _0x8f0954===_0x47abea(0x1b8)||typeof _0x8f0954===_0x47abea(0x1e3))return String(_0x8f0954);return undefined;}function resolvePushDirectoryRoot(_0x581bb3){const _0x2d4543=a148_0x1ebb,_0x241008=resolve(_0x581bb3);if(!existsSync(_0x241008))throw CliErrors[_0x2d4543(0x1e1)](_0x2d4543(0x1bb)+_0x581bb3);const _0x3555d7=lstatSync(_0x241008);if(_0x3555d7[_0x2d4543(0x1ac)]())return _0x241008;if(_0x3555d7[_0x2d4543(0x1ea)]()){const _0x42e653=realpathSync(_0x241008);if(lstatSync(_0x42e653)['isDirectory']())return _0x42e653;}throw CliErrors['validation']('Skill\x20directory\x20not\x20found:\x20'+_0x581bb3);}function requireRemoteScope(_0x46a73c){const _0x2c26c3=a148_0x1ebb;if(_0x46a73c[_0x2c26c3(0x1d5)]===_0x2c26c3(0x1d7)||_0x46a73c[_0x2c26c3(0x1d5)]===_0x2c26c3(0x1e9)||_0x46a73c[_0x2c26c3(0x1d5)]===_0x2c26c3(0x1b7))return _0x46a73c[_0x2c26c3(0x1d5)];throw CliErrors[_0x2c26c3(0x1e1)](_0x2c26c3(0x1bf)+(_0x46a73c[_0x2c26c3(0x1ee)]||'(unknown)')+_0x2c26c3(0x1d1)+(_0x46a73c[_0x2c26c3(0x1d5)]??_0x2c26c3(0x1cb))+'\x22.');}function readLocalSkillContent(_0x258098){const _0x153663=a148_0x1ebb,_0x2f795d=resolve(_0x258098,SKILL_FILE);return existsSync(_0x2f795d)&&lstatSync(_0x2f795d)['isFile']()?readFileSync(_0x2f795d,_0x153663(0x1d2)):'';}function readPushMetadataIfPresent(_0x2ca4ee,_0x16ea96={}){const _0x42e5f3=a148_0x1ebb;try{return readMetadataIfPresent(_0x2ca4ee);}catch(_0x404076){if(_0x16ea96[_0x42e5f3(0x1c7)])return undefined;throw _0x404076;}}
1
+ (function(_0x1d55cf,_0x5e39d5){const _0x2b7f5f=a156_0x3b2c,_0x410121=_0x1d55cf();while(!![]){try{const _0x1e4dff=-parseInt(_0x2b7f5f(0xff))/0x1+-parseInt(_0x2b7f5f(0x106))/0x2+parseInt(_0x2b7f5f(0x132))/0x3+parseInt(_0x2b7f5f(0x10a))/0x4*(parseInt(_0x2b7f5f(0x129))/0x5)+parseInt(_0x2b7f5f(0x130))/0x6+-parseInt(_0x2b7f5f(0x12f))/0x7*(parseInt(_0x2b7f5f(0x135))/0x8)+parseInt(_0x2b7f5f(0x113))/0x9;if(_0x1e4dff===_0x5e39d5)break;else _0x410121['push'](_0x410121['shift']());}catch(_0xdcb4ed){_0x410121['push'](_0x410121['shift']());}}}(a156_0x5a4a,0x4896a));import{existsSync,lstatSync,readFileSync,realpathSync}from'node:fs';import{basename,resolve}from'node:path';import{parse as a156_0x2ec424}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(_0x22edc7,_0x10e514,_0x368ff3={}){const _0x40c3ac=a156_0x3b2c,_0x52889b=resolvePushDirectoryRoot(_0x22edc7),_0x1adb99=readPushMetadataIfPresent(resolve(_0x52889b,METADATA_FILE),{'ignoreInvalidMetadata':_0x368ff3[_0x40c3ac(0x12e)]});if(_0x1adb99?.[_0x40c3ac(0x117)]&&_0x1adb99[_0x40c3ac(0x117)]!==_0x10e514&&!_0x368ff3[_0x40c3ac(0x10e)]&&!_0x368ff3[_0x40c3ac(0x118)])throw CliErrors[_0x40c3ac(0x11e)](_0x40c3ac(0x110)+_0x1adb99['appCode']+'\x22\x20does\x20not\x20match\x20current\x20appCode\x20\x22'+_0x10e514+'\x22.');const _0x2e4a4f=resolvePushSkillCode(_0x52889b,_0x10e514,_0x1adb99,_0x368ff3);if(!_0x2e4a4f)throw CliErrors['validation']('Unable\x20to\x20resolve\x20skillCode\x20from\x20'+SKILL_FILE+',\x20'+METADATA_FILE+_0x40c3ac(0x133));return{'dir':_0x52889b,'skillCode':_0x2e4a4f,'metadata':_0x1adb99};}export function readPushDirectory(_0x129f79,_0x53c9b5,_0x5508b7={}){const _0x3b4238=a156_0x3b2c,_0x5c2547=resolvePushDirectoryIdentity(_0x129f79,_0x53c9b5,_0x5508b7),_0x33d45b=_0x5c2547[_0x3b4238(0x12d)],_0x13330f=resolve(_0x33d45b,SKILL_FILE);if(!existsSync(_0x13330f)||!lstatSync(_0x13330f)[_0x3b4238(0x11b)]())throw CliErrors['validation'](_0x3b4238(0x12c)+SKILL_FILE+':\x20'+_0x13330f);const _0x3f257c=_0x5c2547['metadata'],_0x1c6567=_0x5508b7[_0x3b4238(0x134)]??_0x3b4238(0x11f);if(!_0x5508b7['ignoreMetadataScope']&&_0x3f257c?.['scope']===_0x3b4238(0x123))throw CliErrors[_0x3b4238(0x11e)](_0x3b4238(0xfe)+METADATA_FILE+_0x3b4238(0x120)+_0x3f257c['scope']+'\x22.');if(!_0x5508b7[_0x3b4238(0x122)]&&_0x1c6567===_0x3b4238(0x11f)&&_0x3f257c?.[_0x3b4238(0x11d)]&&_0x3f257c['scope']!==_0x3b4238(0x11f))throw CliErrors[_0x3b4238(0x11e)](_0x3b4238(0x126)+METADATA_FILE+_0x3b4238(0x120)+_0x3f257c[_0x3b4238(0x11d)]+'\x22.',_0x3b4238(0x10b)+_0x33d45b+'\x20to\x20submit\x20company\x20Skills\x20for\x20review.');const _0x2d9159=scanSkillDirectory(_0x33d45b,{'excludedFilePaths':_0x5508b7[_0x3b4238(0x119)]}),_0x5b9220=buildSkillPackage(_0x2d9159),_0x368aa7=readFileSync(_0x13330f,'utf8'),_0x570f4c=_0x5c2547['skillCode'],_0x123568=_0x5508b7[_0x3b4238(0x128)]?undefined:_0x3f257c,_0x49712f=readSkillDisplayName(_0x368aa7);return{'skillCode':_0x570f4c,'metadata':_0x3f257c,'frontmatterDisplayName':_0x49712f,'input':{'skillCode':_0x570f4c,'skillName':_0x49712f??_0x123568?.[_0x3b4238(0x12a)],'description':_0x123568?.[_0x3b4238(0x10f)],'content':_0x368aa7,'files':_0x5b9220['manifest'],'packageBase64':_0x5b9220[_0x3b4238(0x104)],'tags':_0x123568?.[_0x3b4238(0x115)],'version':_0x123568?.[_0x3b4238(0x111)],'sourceSessionId':_0x123568?.[_0x3b4238(0x112)]}};}export function refreshPushDirectoryMetadataFromRemote(_0xa232c2,_0x31b330,_0x445d47,_0x77a2e5={}){const _0x3e3c15=a156_0x3b2c,_0x2e10d6=resolvePushDirectoryRoot(_0xa232c2),_0x3a1778=readPushMetadataIfPresent(resolve(_0x2e10d6,METADATA_FILE),{'ignoreInvalidMetadata':!![]}),_0x235ff8=requireRemoteScope(_0x31b330),_0x2009e7=readLocalSkillContent(_0x2e10d6),_0x3d0f5f={..._0x31b330,'appCode':_0x31b330[_0x3e3c15(0x117)]??_0x445d47,'skillName':_0x31b330[_0x3e3c15(0x12a)]??_0x3a1778?.[_0x3e3c15(0x12a)],'description':_0x31b330['description']??_0x3a1778?.[_0x3e3c15(0x10f)],'example':_0x31b330[_0x3e3c15(0x114)]??_0x3a1778?.[_0x3e3c15(0x114)],'tags':Array[_0x3e3c15(0x107)](_0x31b330[_0x3e3c15(0x115)])?_0x31b330[_0x3e3c15(0x115)]:_0x3a1778?.[_0x3e3c15(0x115)],'sourceSessionId':_0x31b330[_0x3e3c15(0x112)]??_0x3a1778?.[_0x3e3c15(0x112)],'content':_0x31b330['content']??_0x2009e7},_0xbfc267=buildMetadata(_0x3d0f5f,_0x235ff8,_0x445d47,contentHash(_0x2009e7),_0x77a2e5['refreshedAt']);writeJsonAtomic(resolve(_0x2e10d6,METADATA_FILE),_0xbfc267);}export function recordPushedRuntimeSkill(_0x59ddac,_0x529833,_0x1a1393,_0xbe42de={}){const _0x1acb3b=a156_0x3b2c,_0x23164d=resolvePushDirectoryRoot(_0x59ddac),_0x4f98aa=scanSkillDirectory(_0x23164d),_0x3ef49a=_0x4f98aa[_0x1acb3b(0x105)](_0x2f6433=>_0x2f6433[_0x1acb3b(0x100)]===SKILL_FILE),_0x2f58a5=_0x3ef49a?fileText(_0x3ef49a):'',_0x57c6b1=tryNormalizePackageManifest(_0x529833[_0x1acb3b(0x108)]),_0x4f572b={..._0x529833,'content':_0x529833[_0x1acb3b(0x102)]??_0x2f58a5,'files':_0x57c6b1},_0x9e446e=_0x57c6b1?normalizeLocalFiles(_0x4f98aa)[_0x1acb3b(0xfb)](_0x3f8b08=>_0x57c6b1[_0x1acb3b(0x108)][_0x1acb3b(0x131)](_0x122756=>_0x122756['path']===_0x3f8b08[_0x1acb3b(0x100)])):undefined,_0x1f68ee=buildMetadata(_0x4f572b,_0xbe42de[_0x1acb3b(0x11d)]??'personal',_0x1a1393,contentHash(_0x4f572b[_0x1acb3b(0x102)]??''),_0xbe42de[_0x1acb3b(0x11a)],_0x9e446e);writeJsonAtomic(resolve(_0x23164d,METADATA_FILE),_0x1f68ee);}function a156_0x3b2c(_0x59c621,_0x43e49a){_0x59c621=_0x59c621-0xf9;const _0x5a4ada=a156_0x5a4a();let _0x3b2c37=_0x5a4ada[_0x59c621];return _0x3b2c37;}export function deriveSkillCodeFromDirectory(_0x43c01d,_0x101632){const _0x13864a=a156_0x3b2c,_0x160616=basename(resolve(_0x43c01d)),_0x469d17=_0x101632+'--';return _0x160616[_0x13864a(0x101)](_0x469d17)?_0x160616[_0x13864a(0xf9)](_0x469d17[_0x13864a(0x121)]):_0x160616;}function a156_0x5a4a(){const _0x3e74e1=['version','sourceSessionId','4901553AdiQCj','example','tags','Remote\x20Skill\x20','appCode','ignoreMetadataAppCodeMismatch','excludedFilePaths','pushedAt','isFile','replace','scope','validation','personal','\x20has\x20scope=\x22','length','ignoreMetadataScope','builtin','trim','toLowerCase','Only\x20personal\x20Skills\x20can\x20be\x20pushed;\x20','match','ignoreMetadataForPayload','802310tHhQhq','skillName','Invalid\x20','Missing\x20','dir','ignoreInvalidMetadata','14wENqph','1098234ATdyXD','some','985737zpJaMo',',\x20or\x20directory\x20name.','targetScope','1197928EKKJPC','slice','isDirectory','filter','skillCode','string','Builtin\x20Skills\x20cannot\x20be\x20pushed;\x20','379361dDujLv','path','startsWith','content','ignoreMetadataSkillCode','packageBase64','find','481064OTiFBx','isArray','files','\x20name\x20for\x20SkillHub\x20slug\x20generation.','4LJWIuj','Use\x20lovrabet\x20skill\x20push\x20--scope\x20company\x20--dir\x20','Skill\x20directory\x20not\x20found:\x20','isSymbolicLink','allowAppCodeRetarget','description','Skill\x20metadata\x20appCode\x20\x22'];a156_0x5a4a=function(){return _0x3e74e1;};return a156_0x5a4a();}function resolvePushSkillCode(_0x32318c,_0x428ad2,_0x4a9ab5,_0x324bf3){const _0x47022c=a156_0x3b2c,_0x2090a1=deriveSkillCodeFromSkillFile(_0x32318c)||deriveSkillCodeFromDirectory(_0x32318c,_0x428ad2);if(_0x324bf3[_0x47022c(0x103)])return _0x2090a1;return _0x4a9ab5?.['skillCode']?.[_0x47022c(0x124)]()||_0x2090a1;}function deriveSkillCodeFromSkillFile(_0xebf16e){const _0x1edf78=a156_0x3b2c,_0xd59831=resolve(_0xebf16e,SKILL_FILE);if(!existsSync(_0xd59831)||!lstatSync(_0xd59831)['isFile']())return undefined;const _0xa3c69c=readFileSync(_0xd59831,'utf8'),_0x15c16f=_0xa3c69c[_0x1edf78(0x127)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x15c16f)return undefined;const _0x2bd81c=parseFrontmatterObject(_0x15c16f[0x1]??''),_0x3a1a2b=scalarToString(_0x2bd81c?.['name']);return _0x3a1a2b?slugifySkillName(_0x3a1a2b):undefined;}function readSkillDisplayName(_0x56050b){const _0x2d2c2c=a156_0x3b2c,_0x54a8e0=_0x56050b[_0x2d2c2c(0x127)](/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x54a8e0)return undefined;const _0x335e6f=parseFrontmatterObject(_0x54a8e0[0x1]??'');return scalarToString(_0x335e6f?.['displayName']);}function slugifySkillName(_0x2469e5){const _0x39261a=a156_0x3b2c,_0x328a59=_0x2469e5[_0x39261a(0x124)]()[_0x39261a(0x125)]()[_0x39261a(0x11c)](/[^\p{L}\p{N}\p{So}]+/gu,'-')[_0x39261a(0x11c)](/^-+/,'')[_0x39261a(0x11c)](/-+$/,'')[_0x39261a(0x11c)](/-{2,}/g,'-');if(!_0x328a59)throw CliErrors[_0x39261a(0x11e)](_0x39261a(0x12b)+SKILL_FILE+_0x39261a(0x109));return _0x328a59;}function parseFrontmatterObject(_0xa43fd){const _0x2e7d9a=a156_0x3b2c;try{const _0x3b29be=a156_0x2ec424(_0xa43fd);return _0x3b29be&&typeof _0x3b29be==='object'&&!Array[_0x2e7d9a(0x107)](_0x3b29be)?_0x3b29be:undefined;}catch{return undefined;}}function scalarToString(_0x4702c6){const _0x558238=a156_0x3b2c;if(typeof _0x4702c6===_0x558238(0xfd))return _0x4702c6[_0x558238(0x124)]();if(typeof _0x4702c6==='number'||typeof _0x4702c6==='boolean')return String(_0x4702c6);return undefined;}function resolvePushDirectoryRoot(_0x1ae2cf){const _0x5ad8cc=a156_0x3b2c,_0x373770=resolve(_0x1ae2cf);if(!existsSync(_0x373770))throw CliErrors['validation'](_0x5ad8cc(0x10c)+_0x1ae2cf);const _0x2df1ad=lstatSync(_0x373770);if(_0x2df1ad[_0x5ad8cc(0xfa)]())return _0x373770;if(_0x2df1ad[_0x5ad8cc(0x10d)]()){const _0x110419=realpathSync(_0x373770);if(lstatSync(_0x110419)[_0x5ad8cc(0xfa)]())return _0x110419;}throw CliErrors['validation']('Skill\x20directory\x20not\x20found:\x20'+_0x1ae2cf);}function requireRemoteScope(_0x2f2639){const _0x4e748f=a156_0x3b2c;if(_0x2f2639['scope']==='personal'||_0x2f2639[_0x4e748f(0x11d)]==='company'||_0x2f2639['scope']===_0x4e748f(0x123))return _0x2f2639[_0x4e748f(0x11d)];throw CliErrors[_0x4e748f(0x11e)](_0x4e748f(0x116)+(_0x2f2639[_0x4e748f(0xfc)]||'(unknown)')+'\x20has\x20unsupported\x20scope\x20\x22'+(_0x2f2639[_0x4e748f(0x11d)]??'unknown')+'\x22.');}function readLocalSkillContent(_0x294cc5){const _0x5bc7ed=resolve(_0x294cc5,SKILL_FILE);return existsSync(_0x5bc7ed)&&lstatSync(_0x5bc7ed)['isFile']()?readFileSync(_0x5bc7ed,'utf8'):'';}function readPushMetadataIfPresent(_0x1e215b,_0x54aab9={}){const _0xaf450a=a156_0x3b2c;try{return readMetadataIfPresent(_0x1e215b);}catch(_0x42acb2){if(_0x54aab9[_0xaf450a(0x12e)])return undefined;throw _0x42acb2;}}
@@ -1 +1 @@
1
- function a149_0xbf05(){const _0x1bccc4=['personal','6999240mrfROh','builtin','547059nMWmyW','validation','company','push','1341764oFJMrl','length','5665751nOfgAP','6184764BpDXzY','1695sMdFyj','13104oKvVAr','1610310dlBPKU','includes'];a149_0xbf05=function(){return _0x1bccc4;};return a149_0xbf05();}(function(_0x4d81df,_0x3c1841){const _0x539035=a149_0x36f0,_0x14a3dd=_0x4d81df();while(!![]){try{const _0x16b3b1=parseInt(_0x539035(0xf3))/0x1+-parseInt(_0x539035(0xf7))/0x2+parseInt(_0x539035(0xee))/0x3+-parseInt(_0x539035(0xfc))/0x4*(-parseInt(_0x539035(0xfb))/0x5)+-parseInt(_0x539035(0xfa))/0x6+-parseInt(_0x539035(0xf9))/0x7+parseInt(_0x539035(0xf1))/0x8;if(_0x16b3b1===_0x3c1841)break;else _0x14a3dd['push'](_0x14a3dd['shift']());}catch(_0x28c8a6){_0x14a3dd['push'](_0x14a3dd['shift']());}}}(a149_0xbf05,0x88495));import{CliErrors}from'../../errors.js';export function normalizeRuntimeSkillScopes(_0x14e06b){const _0x4464a7=a149_0x36f0,_0x5cbe4f=_0x14e06b&&_0x14e06b[_0x4464a7(0xf8)]>0x0?_0x14e06b:[_0x4464a7(0xf0),_0x4464a7(0xf5),_0x4464a7(0xf2)],_0x5ef49d=[];for(const _0xb1a64d of _0x5cbe4f){if(!isRuntimeSkillScope(_0xb1a64d))throw CliErrors[_0x4464a7(0xf4)]('Unsupported\x20runtime\x20Skill\x20scope:\x20'+_0xb1a64d);!_0x5ef49d[_0x4464a7(0xef)](_0xb1a64d)&&_0x5ef49d[_0x4464a7(0xf6)](_0xb1a64d);}return _0x5ef49d;}function a149_0x36f0(_0x5c7f9b,_0x574086){_0x5c7f9b=_0x5c7f9b-0xee;const _0xbf0508=a149_0xbf05();let _0x36f039=_0xbf0508[_0x5c7f9b];return _0x36f039;}export function isRuntimeSkillScope(_0x19ab48){const _0x1c76ed=a149_0x36f0;return _0x19ab48===_0x1c76ed(0xf0)||_0x19ab48===_0x1c76ed(0xf5)||_0x19ab48===_0x1c76ed(0xf2);}
1
+ (function(_0x210f57,_0xeff0d4){const _0x117482=a157_0x279c,_0x310844=_0x210f57();while(!![]){try{const _0x2bfce0=-parseInt(_0x117482(0x1e9))/0x1*(-parseInt(_0x117482(0x1ea))/0x2)+parseInt(_0x117482(0x1e4))/0x3+parseInt(_0x117482(0x1e0))/0x4*(parseInt(_0x117482(0x1eb))/0x5)+-parseInt(_0x117482(0x1ee))/0x6+-parseInt(_0x117482(0x1e3))/0x7+parseInt(_0x117482(0x1f0))/0x8*(parseInt(_0x117482(0x1e8))/0x9)+-parseInt(_0x117482(0x1e5))/0xa*(parseInt(_0x117482(0x1ed))/0xb);if(_0x2bfce0===_0xeff0d4)break;else _0x310844['push'](_0x310844['shift']());}catch(_0x15b729){_0x310844['push'](_0x310844['shift']());}}}(a157_0x5f22,0x37a6c));import{CliErrors}from'../../errors.js';export function normalizeRuntimeSkillScopes(_0x1d442){const _0x44eef0=a157_0x279c,_0x1da550=_0x1d442&&_0x1d442[_0x44eef0(0x1f1)]>0x0?_0x1d442:['personal',_0x44eef0(0x1e7),'builtin'],_0x31c304=[];for(const _0x1a317b of _0x1da550){if(!isRuntimeSkillScope(_0x1a317b))throw CliErrors[_0x44eef0(0x1e1)](_0x44eef0(0x1ec)+_0x1a317b);!_0x31c304['includes'](_0x1a317b)&&_0x31c304[_0x44eef0(0x1e2)](_0x1a317b);}return _0x31c304;}function a157_0x279c(_0x105b19,_0x509d78){_0x105b19=_0x105b19-0x1e0;const _0x5f22dc=a157_0x5f22();let _0x279c44=_0x5f22dc[_0x105b19];return _0x279c44;}export function isRuntimeSkillScope(_0x415c32){const _0xb37440=a157_0x279c;return _0x415c32===_0xb37440(0x1e6)||_0x415c32===_0xb37440(0x1e7)||_0x415c32===_0xb37440(0x1ef);}function a157_0x5f22(){const _0x5d427c=['23298MVzQls','645972RzkyXt','builtin','16nEYrff','length','88nHmqhA','validation','push','667093JtXDWx','693447agOANy','3310bXwGsd','personal','company','1957239hTqWaO','2irBNJu','127274ZQMMls','76955TkkWPk','Unsupported\x20runtime\x20Skill\x20scope:\x20'];a157_0x5f22=function(){return _0x5d427c;};return a157_0x5f22();}
@@ -1 +1 @@
1
- function a151_0x3ddb(_0x10ab98,_0x5a6bf6){_0x10ab98=_0x10ab98-0xce;const _0x5b2882=a151_0x5b28();let _0x3ddb91=_0x5b2882[_0x10ab98];return _0x3ddb91;}function a151_0x5b28(){const _0x347fd0=['length','9gpKOXF','path','3270378ykLcpy','endsWith','map','code','validation_error','5762608LPVfeR','69HVULLn','70005AExHPA','Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.','1318930kAYCJo','766889JtqwNG','39314hznlDK','validation','1065183xEQVHv','152dJfear','from','1980-01-01T00:00:00.000Z','name'];a151_0x5b28=function(){return _0x347fd0;};return a151_0x5b28();}const a151_0x177646=a151_0x3ddb;(function(_0x4135bb,_0x590d1e){const _0x1145b4=a151_0x3ddb,_0x23d091=_0x4135bb();while(!![]){try{const _0x3b180e=parseInt(_0x1145b4(0xdb))/0x1+-parseInt(_0x1145b4(0xdc))/0x2*(-parseInt(_0x1145b4(0xd7))/0x3)+-parseInt(_0x1145b4(0xdf))/0x4*(-parseInt(_0x1145b4(0xd8))/0x5)+-parseInt(_0x1145b4(0xd1))/0x6+-parseInt(_0x1145b4(0xde))/0x7+-parseInt(_0x1145b4(0xd6))/0x8+-parseInt(_0x1145b4(0xcf))/0x9*(-parseInt(_0x1145b4(0xda))/0xa);if(_0x3b180e===_0x590d1e)break;else _0x23d091['push'](_0x23d091['shift']());}catch(_0x1c9271){_0x23d091['push'](_0x23d091['shift']());}}}(a151_0x5b28,0x719dd));import{unzipSync,zipSync}from'fflate';import{CliErrors}from'../../errors.js';import{compareSkillFiles,fileContent,normalizeLocalFiles,normalizeSkillRelativePath}from'./local-files.js';const ZIP_MTIME=new Date(a151_0x177646(0xe1));export function createDeterministicZipPackage(_0x42bfa0){const _0x290368=a151_0x177646,_0xee25d7={};for(const _0x528ad8 of normalizeLocalFiles(_0x42bfa0)){_0xee25d7[_0x528ad8[_0x290368(0xd0)]]=fileContent(_0x528ad8);}return Buffer[_0x290368(0xe0)](zipSync(_0xee25d7,{'level':0x0,'mtime':ZIP_MTIME}));}export function parseZipPackage(_0x4c4703){const _0x380e46=a151_0x177646;if(_0x4c4703[_0x380e46(0xce)]<0x16)throw CliErrors[_0x380e46(0xdd)](_0x380e46(0xd9));let _0x37bfcd;try{_0x37bfcd=unzipSync(_0x4c4703,{'filter'(_0x42e0e1){const _0x2c6b27=_0x380e46,_0x25aaa3=normalizeSkillRelativePath(_0x42e0e1[_0x2c6b27(0xe2)]);if(_0x25aaa3[_0x2c6b27(0xd2)]('/'))throw CliErrors['validation']('Runtime\x20Skill\x20package\x20contains\x20directory\x20entry:\x20'+_0x25aaa3);return!![];}});}catch(_0x2febad){if(isRuntimeSkillValidationError(_0x2febad))throw _0x2febad;throw CliErrors[_0x380e46(0xdd)](_0x380e46(0xd9));}return Object['entries'](_0x37bfcd)[_0x380e46(0xd3)](([_0x7ff53d,_0x2645e0])=>({'path':normalizeSkillRelativePath(_0x7ff53d),'bytes':Buffer[_0x380e46(0xe0)](_0x2645e0)}))['sort'](compareSkillFiles);}function isRuntimeSkillValidationError(_0x567433){const _0x5ea5fe=a151_0x177646;return typeof _0x567433==='object'&&_0x567433!==null&&'code'in _0x567433&&_0x567433[_0x5ea5fe(0xd4)]===_0x5ea5fe(0xd5);}
1
+ (function(_0x55b709,_0x14ba70){const _0x5d98cb=a159_0x535b,_0x500d63=_0x55b709();while(!![]){try{const _0x49d5b8=parseInt(_0x5d98cb(0xfe))/0x1*(parseInt(_0x5d98cb(0x10b))/0x2)+-parseInt(_0x5d98cb(0x10a))/0x3+-parseInt(_0x5d98cb(0x10e))/0x4*(parseInt(_0x5d98cb(0x107))/0x5)+parseInt(_0x5d98cb(0x10f))/0x6*(-parseInt(_0x5d98cb(0x109))/0x7)+parseInt(_0x5d98cb(0x110))/0x8+-parseInt(_0x5d98cb(0xfc))/0x9*(parseInt(_0x5d98cb(0x100))/0xa)+parseInt(_0x5d98cb(0x106))/0xb*(parseInt(_0x5d98cb(0xfb))/0xc);if(_0x49d5b8===_0x14ba70)break;else _0x500d63['push'](_0x500d63['shift']());}catch(_0x1ef58d){_0x500d63['push'](_0x500d63['shift']());}}}(a159_0x4592,0xc9eaf));function a159_0x4592(){const _0x3ec578=['19558eMSGYg','4321170bfeiCL','34lDlSxx','length','map','20xpcbfm','2322mDkGnI','11184800vEHBWL','29916IXmubp','585DUgaTl','validation','59915GbvwwR','path','120050nnXlhu','Runtime\x20Skill\x20package\x20contains\x20directory\x20entry:\x20','entries','Runtime\x20Skill\x20package\x20is\x20not\x20a\x20valid\x20zip\x20file.','name','from','7711UpskvS','35200cmtGWz','code'];a159_0x4592=function(){return _0x3ec578;};return a159_0x4592();}import{unzipSync,zipSync}from'fflate';import{CliErrors}from'../../errors.js';import{compareSkillFiles,fileContent,normalizeLocalFiles,normalizeSkillRelativePath}from'./local-files.js';const ZIP_MTIME=new Date('1980-01-01T00:00:00.000Z');export function createDeterministicZipPackage(_0x3a5b9f){const _0x1be5c9=a159_0x535b,_0x2a6165={};for(const _0x581019 of normalizeLocalFiles(_0x3a5b9f)){_0x2a6165[_0x581019[_0x1be5c9(0xff)]]=fileContent(_0x581019);}return Buffer[_0x1be5c9(0x105)](zipSync(_0x2a6165,{'level':0x0,'mtime':ZIP_MTIME}));}export function parseZipPackage(_0x2c1f0b){const _0x1b6f72=a159_0x535b;if(_0x2c1f0b[_0x1b6f72(0x10c)]<0x16)throw CliErrors[_0x1b6f72(0xfd)](_0x1b6f72(0x103));let _0x1c573d;try{_0x1c573d=unzipSync(_0x2c1f0b,{'filter'(_0x4ef90b){const _0x30c7be=_0x1b6f72,_0x2f8016=normalizeSkillRelativePath(_0x4ef90b[_0x30c7be(0x104)]);if(_0x2f8016['endsWith']('/'))throw CliErrors[_0x30c7be(0xfd)](_0x30c7be(0x101)+_0x2f8016);return!![];}});}catch(_0x3d294c){if(isRuntimeSkillValidationError(_0x3d294c))throw _0x3d294c;throw CliErrors[_0x1b6f72(0xfd)](_0x1b6f72(0x103));}return Object[_0x1b6f72(0x102)](_0x1c573d)[_0x1b6f72(0x10d)](([_0x5a1363,_0x8c3713])=>({'path':normalizeSkillRelativePath(_0x5a1363),'bytes':Buffer[_0x1b6f72(0x105)](_0x8c3713)}))['sort'](compareSkillFiles);}function a159_0x535b(_0x551074,_0x4b50cb){_0x551074=_0x551074-0xfb;const _0x4592bc=a159_0x4592();let _0x535b0b=_0x4592bc[_0x551074];return _0x535b0b;}function isRuntimeSkillValidationError(_0x4bb5d9){const _0x4fafb6=a159_0x535b;return typeof _0x4bb5d9==='object'&&_0x4bb5d9!==null&&_0x4fafb6(0x108)in _0x4bb5d9&&_0x4bb5d9[_0x4fafb6(0x108)]==='validation_error';}