@lovrabet/lovrabet-cli 2.3.8-beta.4 → 2.3.8-beta.6

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 (191) hide show
  1. package/README.md +12 -0
  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.js +1 -1
  29. package/lib/commands/data/index.js +1 -1
  30. package/lib/commands/dataset/detail.js +1 -1
  31. package/lib/commands/dataset/index.js +1 -1
  32. package/lib/commands/dataset/list.js +1 -1
  33. package/lib/commands/dataset/sdk-doc.js +1 -1
  34. package/lib/commands/doctor.js +1 -1
  35. package/lib/commands/file/index.js +1 -1
  36. package/lib/commands/init.js +1 -1
  37. package/lib/commands/issue/context.d.ts +3 -0
  38. package/lib/commands/issue/context.js +1 -0
  39. package/lib/commands/issue/index.d.ts +2 -0
  40. package/lib/commands/issue/index.js +1 -0
  41. package/lib/commands/issue/report.d.ts +2 -0
  42. package/lib/commands/issue/report.js +1 -0
  43. package/lib/commands/kb/index.js +1 -1
  44. package/lib/commands/logs/index.js +1 -1
  45. package/lib/commands/notification/config-list.js +1 -1
  46. package/lib/commands/notification/index.js +1 -1
  47. package/lib/commands/notification/shared.js +1 -1
  48. package/lib/commands/ocr/index.js +1 -1
  49. package/lib/commands/permit/dataset-get.js +1 -1
  50. package/lib/commands/permit/dataset-set.js +1 -1
  51. package/lib/commands/permit/index.js +1 -1
  52. package/lib/commands/permit/page-get.js +1 -1
  53. package/lib/commands/permit/page-set.js +1 -1
  54. package/lib/commands/permit/role-menus-set.js +1 -1
  55. package/lib/commands/permit/role-menus.js +1 -1
  56. package/lib/commands/permit/shared.js +1 -1
  57. package/lib/commands/personal-bff/index.js +1 -1
  58. package/lib/commands/registry.js +1 -1
  59. package/lib/commands/role/create.js +1 -1
  60. package/lib/commands/role/delete.js +1 -1
  61. package/lib/commands/role/detail.js +1 -1
  62. package/lib/commands/role/index.js +1 -1
  63. package/lib/commands/role/list.js +1 -1
  64. package/lib/commands/role/shared.js +1 -1
  65. package/lib/commands/role/update.js +1 -1
  66. package/lib/commands/role/user-add.js +1 -1
  67. package/lib/commands/role/user-remove.js +1 -1
  68. package/lib/commands/schedule/index.js +1 -1
  69. package/lib/commands/schema.js +1 -1
  70. package/lib/commands/service/dynamic.js +1 -1
  71. package/lib/commands/service/function-name-adapter.js +1 -1
  72. package/lib/commands/service/index.js +1 -1
  73. package/lib/commands/service/registry.js +1 -1
  74. package/lib/commands/skill/commands/create.js +1 -1
  75. package/lib/commands/skill/commands/diagram.js +1 -1
  76. package/lib/commands/skill/commands/install.js +1 -1
  77. package/lib/commands/skill/commands/list.js +1 -1
  78. package/lib/commands/skill/commands/push.js +1 -1
  79. package/lib/commands/skill/commands/validate.js +1 -1
  80. package/lib/commands/skill/diagram.js +1 -1
  81. package/lib/commands/skill/flags.js +1 -1
  82. package/lib/commands/skill/index.js +1 -1
  83. package/lib/commands/skill/manifest-helpers.js +1 -1
  84. package/lib/commands/skill/push-execute.js +1 -1
  85. package/lib/commands/skill/push-flow-helpers.js +1 -1
  86. package/lib/commands/skill/push-retarget.js +1 -1
  87. package/lib/commands/skill/scopes.js +1 -1
  88. package/lib/commands/skill/summary.js +1 -1
  89. package/lib/commands/skill/templates.js +1 -1
  90. package/lib/commands/skill/validate.js +1 -1
  91. package/lib/commands/sql/detail.js +1 -1
  92. package/lib/commands/sql/exec.js +1 -1
  93. package/lib/commands/sql/index.js +1 -1
  94. package/lib/commands/update.js +1 -1
  95. package/lib/commands/user-account/bind.js +1 -1
  96. package/lib/commands/user-account/index.js +1 -1
  97. package/lib/commands/workspace/index.js +1 -1
  98. package/lib/config/domain-config.js +1 -1
  99. package/lib/config/schema.js +1 -1
  100. package/lib/constant/app.js +1 -1
  101. package/lib/constant/auth-mode.js +1 -1
  102. package/lib/constant/cli.js +1 -1
  103. package/lib/constant/defaults.js +1 -1
  104. package/lib/constant/distribution.js +1 -1
  105. package/lib/constant/domain.js +1 -1
  106. package/lib/constant/env.js +1 -1
  107. package/lib/constant/output.js +1 -1
  108. package/lib/constant/product.js +1 -1
  109. package/lib/constant/region.js +1 -1
  110. package/lib/constant/risk.js +1 -1
  111. package/lib/constant/url.js +1 -1
  112. package/lib/context.js +1 -1
  113. package/lib/core/api-client.js +1 -1
  114. package/lib/core/db-resolver.js +1 -1
  115. package/lib/core/kb-management-client.js +1 -1
  116. package/lib/core/kb-sdk-errors.js +1 -1
  117. package/lib/core/kb-search-client.js +1 -1
  118. package/lib/core/sdk-client.js +1 -1
  119. package/lib/errors.js +1 -1
  120. package/lib/framework/access-error.js +1 -1
  121. package/lib/framework/build-all-flags.js +1 -1
  122. package/lib/framework/dryrun.js +1 -1
  123. package/lib/framework/flags.js +1 -1
  124. package/lib/framework/help.js +1 -1
  125. package/lib/framework/index.js +1 -1
  126. package/lib/framework/output.js +1 -1
  127. package/lib/framework/preparse.js +1 -1
  128. package/lib/framework/rate-limit.js +1 -1
  129. package/lib/framework/raw-flags.js +1 -1
  130. package/lib/framework/response.js +1 -1
  131. package/lib/framework/runner-confirmation.js +1 -1
  132. package/lib/framework/runner-error.js +1 -1
  133. package/lib/framework/runner.js +1 -1
  134. package/lib/framework/schema-export.js +1 -1
  135. package/lib/framework/service-order.js +1 -1
  136. package/lib/framework/types.js +1 -1
  137. package/lib/generated/build-info.d.ts +4 -4
  138. package/lib/generated/build-info.js +1 -1
  139. package/lib/generated/official-routing.js +1 -1
  140. package/lib/generated/routing-contract.js +1 -1
  141. package/lib/help.js +1 -1
  142. package/lib/postinstall.js +1 -1
  143. package/lib/runtime/confirmation.js +1 -1
  144. package/lib/runtime/event.js +1 -1
  145. package/lib/runtime/index.js +1 -1
  146. package/lib/runtime/queue.js +1 -1
  147. package/lib/runtime/resolve.js +1 -1
  148. package/lib/services/dataset-import/auto-id-runner.js +1 -1
  149. package/lib/services/dataset-import/excel-reader.js +1 -1
  150. package/lib/services/dataset-import/image-bytes.js +1 -1
  151. package/lib/services/dataset-import/image-ooxml.js +1 -1
  152. package/lib/services/dataset-import/image-runner.js +1 -1
  153. package/lib/services/dataset-import/metadata.js +1 -1
  154. package/lib/services/dataset-import/preview.js +1 -1
  155. package/lib/services/dataset-import/runner.js +1 -1
  156. package/lib/skills/builtin-skill.js +1 -1
  157. package/lib/skills/npx-skills-add.js +1 -1
  158. package/lib/skills/runtime-skill-sync/constants.js +1 -1
  159. package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
  160. package/lib/skills/runtime-skill-sync/hashing.js +1 -1
  161. package/lib/skills/runtime-skill-sync/install-target.js +1 -1
  162. package/lib/skills/runtime-skill-sync/links.js +1 -1
  163. package/lib/skills/runtime-skill-sync/list-local.js +1 -1
  164. package/lib/skills/runtime-skill-sync/local-files.js +1 -1
  165. package/lib/skills/runtime-skill-sync/materialize.js +1 -1
  166. package/lib/skills/runtime-skill-sync/metadata.js +1 -1
  167. package/lib/skills/runtime-skill-sync/paths.js +1 -1
  168. package/lib/skills/runtime-skill-sync/push.js +1 -1
  169. package/lib/skills/runtime-skill-sync/scopes.js +1 -1
  170. package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
  171. package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
  172. package/lib/skills/runtime-skill-sync.js +1 -1
  173. package/lib/skills/skill-presence.js +1 -1
  174. package/lib/utils/access-key-redaction.js +1 -1
  175. package/lib/utils/apply-jq-filter.js +1 -1
  176. package/lib/utils/cli-version-check.js +1 -1
  177. package/lib/utils/cli-version-policy.js +1 -1
  178. package/lib/utils/logger.js +1 -1
  179. package/lib/utils/lossless-json.js +1 -1
  180. package/lib/utils/params.js +1 -1
  181. package/lib/utils/positive-safe-integer.js +1 -1
  182. package/lib/utils/redaction.js +1 -1
  183. package/lib/utils/runtime-user-id.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 +2 -2
  188. package/skills/lovrabet/SKILL.md +12 -2
  189. package/skills/lovrabet/guides/development-intent-handoff.md +58 -0
  190. package/skills/lovrabet/references/lovrabet-issue-report.md +24 -0
  191. package/skills/lovrabet.manifest.json +5 -3
@@ -1 +1 @@
1
- (function(_0x12c43c,_0x3b8b20){const _0xec5060=a145_0x197f,_0x5e70f0=_0x12c43c();while(!![]){try{const _0x8cee02=parseInt(_0xec5060(0x1b7))/0x1*(parseInt(_0xec5060(0x1be))/0x2)+-parseInt(_0xec5060(0x1ba))/0x3+-parseInt(_0xec5060(0x1ac))/0x4+-parseInt(_0xec5060(0x1b0))/0x5+parseInt(_0xec5060(0x1bc))/0x6*(parseInt(_0xec5060(0x1ab))/0x7)+-parseInt(_0xec5060(0x1ae))/0x8+parseInt(_0xec5060(0x1aa))/0x9;if(_0x8cee02===_0x3b8b20)break;else _0x5e70f0['push'](_0x5e70f0['shift']());}catch(_0x4d27cb){_0x5e70f0['push'](_0x5e70f0['shift']());}}}(a145_0x22d5,0xc7675));export function assertDatasetImportTarget(_0x5ab76d,_0x221acf,_0x5cec4a){const _0x4b8294=a145_0x197f;if(!_0x5ab76d||typeof _0x5ab76d!==_0x4b8294(0x1b6)||Array['isArray'](_0x5ab76d))throw Error(_0x4b8294(0x1b3));const _0x2c5e51=[_0x5ab76d['code'],_0x5ab76d['modelCode'],_0x5ab76d[_0x4b8294(0x1bd)]?.[_0x4b8294(0x1b4)]][_0x4b8294(0x1b8)](_0x4c579c=>_0x4c579c!=null);if(!_0x2c5e51[_0x4b8294(0x1b9)]||_0x2c5e51[_0x4b8294(0x1b1)](_0x1a9e16=>_0x1a9e16!==_0x5cec4a)||_0x5ab76d[_0x4b8294(0x1b5)]!=null&&_0x5ab76d['appCode']!==_0x221acf||_0x5ab76d[_0x4b8294(0x1bd)]?.['appCode']!=null&&_0x5ab76d[_0x4b8294(0x1bd)][_0x4b8294(0x1b5)]!==_0x221acf)throw Error(_0x4b8294(0x1bb));const _0x218d53=[_0x5ab76d[_0x4b8294(0x1ad)],_0x5ab76d[_0x4b8294(0x1bd)]?.[_0x4b8294(0x1af)]][_0x4b8294(0x1b8)](_0x449a6c=>_0x449a6c!=null);if(_0x218d53['some'](_0x27532f=>typeof _0x27532f!==_0x4b8294(0x1b2)||_0x27532f!==_0x218d53[0x0]))throw Error('Dataset\x20source\x20metadata\x20is\x20inconsistent.');return _0x218d53[0x0];}function a145_0x197f(_0x505865,_0x26024d){_0x505865=_0x505865-0x1aa;const _0x22d5bd=a145_0x22d5();let _0x197fd3=_0x22d5bd[_0x505865];return _0x197fd3;}function a145_0x22d5(){const _0x2eaa96=['some','string','Dataset\x20metadata\x20is\x20missing.','datasetCode','appCode','object','352axYFnE','filter','length','899235ZyfgxE','Dataset\x20metadata\x20does\x20not\x20match\x20the\x20requested\x20target.','129306hqKrYq','dataset','2536RvPhKR','38536470iTGacm','161bNrgBo','5943880UITyLe','source','12798160nVVBfa','sourceType','5107985dNsphM'];a145_0x22d5=function(){return _0x2eaa96;};return a145_0x22d5();}
1
+ function a148_0x3e03(){const _0xf362de=['50WhnROb','398kMahVU','dataset','some','375NIpkEr','2702700NwHmmD','datasetCode','465553FDKOdo','isArray','3671aovtKh','1629088iXpmhl','6FWFjUW','appCode','Dataset\x20source\x20metadata\x20is\x20inconsistent.','4108rTikbf','1216135yPTmlv','654227KskqCr','object','code','sourceType','modelCode','filter'];a148_0x3e03=function(){return _0xf362de;};return a148_0x3e03();}function a148_0x584b(_0x3ab2d8,_0x29aa65){_0x3ab2d8=_0x3ab2d8-0x1ab;const _0x3e03a5=a148_0x3e03();let _0x584b35=_0x3e03a5[_0x3ab2d8];return _0x584b35;}(function(_0x3078d9,_0x4c8c57){const _0x2e0d1e=a148_0x584b,_0x56a3ec=_0x3078d9();while(!![]){try{const _0x530884=parseInt(_0x2e0d1e(0x1ac))/0x1*(parseInt(_0x2e0d1e(0x1ba))/0x2)+-parseInt(_0x2e0d1e(0x1bd))/0x3*(-parseInt(_0x2e0d1e(0x1b1))/0x4)+-parseInt(_0x2e0d1e(0x1b2))/0x5*(parseInt(_0x2e0d1e(0x1ae))/0x6)+parseInt(_0x2e0d1e(0x1b3))/0x7+-parseInt(_0x2e0d1e(0x1ad))/0x8+-parseInt(_0x2e0d1e(0x1be))/0x9+-parseInt(_0x2e0d1e(0x1b9))/0xa*(-parseInt(_0x2e0d1e(0x1c0))/0xb);if(_0x530884===_0x4c8c57)break;else _0x56a3ec['push'](_0x56a3ec['shift']());}catch(_0x1c6dee){_0x56a3ec['push'](_0x56a3ec['shift']());}}}(a148_0x3e03,0x65c31));export function assertDatasetImportTarget(_0xa35c5c,_0x545420,_0x5bb289){const _0x1e7390=a148_0x584b;if(!_0xa35c5c||typeof _0xa35c5c!==_0x1e7390(0x1b4)||Array[_0x1e7390(0x1ab)](_0xa35c5c))throw Error('Dataset\x20metadata\x20is\x20missing.');const _0x5f2e9d=[_0xa35c5c[_0x1e7390(0x1b5)],_0xa35c5c[_0x1e7390(0x1b7)],_0xa35c5c['dataset']?.[_0x1e7390(0x1bf)]][_0x1e7390(0x1b8)](_0x1106a2=>_0x1106a2!=null);if(!_0x5f2e9d['length']||_0x5f2e9d[_0x1e7390(0x1bc)](_0xa3cb9a=>_0xa3cb9a!==_0x5bb289)||_0xa35c5c['appCode']!=null&&_0xa35c5c[_0x1e7390(0x1af)]!==_0x545420||_0xa35c5c[_0x1e7390(0x1bb)]?.[_0x1e7390(0x1af)]!=null&&_0xa35c5c[_0x1e7390(0x1bb)][_0x1e7390(0x1af)]!==_0x545420)throw Error('Dataset\x20metadata\x20does\x20not\x20match\x20the\x20requested\x20target.');const _0x7ebca7=[_0xa35c5c['source'],_0xa35c5c['dataset']?.[_0x1e7390(0x1b6)]]['filter'](_0xa5d72b=>_0xa5d72b!=null);if(_0x7ebca7[_0x1e7390(0x1bc)](_0x3abaf2=>typeof _0x3abaf2!=='string'||_0x3abaf2!==_0x7ebca7[0x0]))throw Error(_0x1e7390(0x1b0));return _0x7ebca7[0x0];}
@@ -1 +1 @@
1
- function a146_0x168d(){const _0x586a59=['rows','368700zElyXD','schemaFingerprint','utf8','Excel\x20row\x20','maxBatchBytes','byteLength','length','rowNumber','1657EYTZdV','2271681HbgVbT','schemaVersion','6vJZkJE','values','823804sOmaCh','8jRVDsH','stringify','1014530pZHrbh','58HRMIkW','1484875tvcnQf','63477foPLvq','\x20exceeds\x20the\x20import\x20request\x20size\x20limit.'];a146_0x168d=function(){return _0x586a59;};return a146_0x168d();}function a146_0x1811(_0x22d96a,_0x52e815){_0x22d96a=_0x22d96a-0x1a3;const _0x168d83=a146_0x168d();let _0x1811e2=_0x168d83[_0x22d96a];return _0x1811e2;}(function(_0x4dd1b4,_0x36d139){const _0x1ae8d5=a146_0x1811,_0x39d0fd=_0x4dd1b4();while(!![]){try{const _0x3d39c0=parseInt(_0x1ae8d5(0x1ae))/0x1*(parseInt(_0x1ae8d5(0x1b7))/0x2)+parseInt(_0x1ae8d5(0x1a3))/0x3+-parseInt(_0x1ae8d5(0x1b3))/0x4+-parseInt(_0x1ae8d5(0x1b6))/0x5+-parseInt(_0x1ae8d5(0x1b1))/0x6*(-parseInt(_0x1ae8d5(0x1b8))/0x7)+-parseInt(_0x1ae8d5(0x1b4))/0x8*(-parseInt(_0x1ae8d5(0x1af))/0x9)+parseInt(_0x1ae8d5(0x1a6))/0xa;if(_0x3d39c0===_0x36d139)break;else _0x39d0fd['push'](_0x39d0fd['shift']());}catch(_0x4fdaa3){_0x39d0fd['push'](_0x39d0fd['shift']());}}}(a146_0x168d,0x277df));export function previewImportBatchCount(_0x1b37a0,_0x3601ef,_0x46f48f){const _0x199377=a146_0x1811,_0x5c0148=_0x4d01a4=>_0x4d01a4['map'](_0x448b04=>_0x3601ef[_0x199377(0x1b0)]===0x1?{..._0x1b37a0[_0x199377(0x1a5)][_0x448b04][_0x199377(0x1b2)],'id':-0x1fffffffffffff}:_0x1b37a0[_0x199377(0x1a5)][_0x448b04][_0x199377(0x1b2)]),_0x46c3f6=_0x3cf186=>Buffer[_0x199377(0x1ab)](JSON[_0x199377(0x1b5)]({'schemaFingerprint':_0x3601ef[_0x199377(0x1a7)],..._0x3601ef[_0x199377(0x1b0)]===0x2?{'taskId':0x2**0x34}:{},'items':_0x5c0148(_0x3cf186)}),_0x199377(0x1a8));let _0x2b488f=0x0,_0x1c5f47=[];for(let _0x53de12=0x0;_0x53de12<_0x1b37a0[_0x199377(0x1a5)][_0x199377(0x1ac)];_0x53de12++){if(_0x46c3f6([_0x53de12])>_0x3601ef[_0x199377(0x1aa)])throw Error(_0x199377(0x1a9)+_0x1b37a0[_0x199377(0x1a5)][_0x53de12][_0x199377(0x1ad)]+_0x199377(0x1a4));_0x1c5f47[_0x199377(0x1ac)]&&(_0x1c5f47[_0x199377(0x1ac)]===_0x46f48f||_0x46c3f6([..._0x1c5f47,_0x53de12])>_0x3601ef[_0x199377(0x1aa)])&&(_0x2b488f++,_0x1c5f47=[]),_0x1c5f47['push'](_0x53de12);}return _0x2b488f+Number(_0x1c5f47[_0x199377(0x1ac)]>0x0);}
1
+ function a149_0x33f2(){const _0x3cc614=['915447QxxiZK','\x20exceeds\x20the\x20import\x20request\x20size\x20limit.','414DHHNjZ','schemaFingerprint','push','rows','1015846rzcSkA','values','5783784Tpaunx','4aLOgaF','2185055etWSzV','length','404394JEUWJj','byteLength','stringify','76027ofaAaO','schemaVersion','17445699ApkVwX','Excel\x20row\x20','utf8'];a149_0x33f2=function(){return _0x3cc614;};return a149_0x33f2();}(function(_0x48944a,_0x3583e0){const _0x5c10d8=a149_0x4109,_0x411f3f=_0x48944a();while(!![]){try{const _0x61ad8=parseInt(_0x5c10d8(0xf4))/0x1+-parseInt(_0x5c10d8(0xee))/0x2+parseInt(_0x5c10d8(0xe8))/0x3*(-parseInt(_0x5c10d8(0xf1))/0x4)+parseInt(_0x5c10d8(0xf2))/0x5+-parseInt(_0x5c10d8(0xea))/0x6*(parseInt(_0x5c10d8(0xf7))/0x7)+-parseInt(_0x5c10d8(0xf0))/0x8+parseInt(_0x5c10d8(0xe5))/0x9;if(_0x61ad8===_0x3583e0)break;else _0x411f3f['push'](_0x411f3f['shift']());}catch(_0x400805){_0x411f3f['push'](_0x411f3f['shift']());}}}(a149_0x33f2,0x78b1a));function a149_0x4109(_0x891de4,_0x36970d){_0x891de4=_0x891de4-0xe4;const _0x33f2d7=a149_0x33f2();let _0x410917=_0x33f2d7[_0x891de4];return _0x410917;}export function previewImportBatchCount(_0xf37f43,_0x3b576b,_0x321090){const _0x59ef6a=a149_0x4109,_0x551885=_0x3c0802=>_0x3c0802['map'](_0xb066fc=>_0x3b576b[_0x59ef6a(0xe4)]===0x1?{..._0xf37f43[_0x59ef6a(0xed)][_0xb066fc]['values'],'id':-0x1fffffffffffff}:_0xf37f43['rows'][_0xb066fc][_0x59ef6a(0xef)]),_0x3ce541=_0x2c42c1=>Buffer[_0x59ef6a(0xf5)](JSON[_0x59ef6a(0xf6)]({'schemaFingerprint':_0x3b576b[_0x59ef6a(0xeb)],..._0x3b576b[_0x59ef6a(0xe4)]===0x2?{'taskId':0x2**0x34}:{},'items':_0x551885(_0x2c42c1)}),_0x59ef6a(0xe7));let _0x4e3389=0x0,_0x48a755=[];for(let _0xc2bc78=0x0;_0xc2bc78<_0xf37f43[_0x59ef6a(0xed)][_0x59ef6a(0xf3)];_0xc2bc78++){if(_0x3ce541([_0xc2bc78])>_0x3b576b['maxBatchBytes'])throw Error(_0x59ef6a(0xe6)+_0xf37f43[_0x59ef6a(0xed)][_0xc2bc78]['rowNumber']+_0x59ef6a(0xe9));_0x48a755[_0x59ef6a(0xf3)]&&(_0x48a755['length']===_0x321090||_0x3ce541([..._0x48a755,_0xc2bc78])>_0x3b576b['maxBatchBytes'])&&(_0x4e3389++,_0x48a755=[]),_0x48a755[_0x59ef6a(0xec)](_0xc2bc78);}return _0x4e3389+Number(_0x48a755[_0x59ef6a(0xf3)]>0x0);}
@@ -1 +1 @@
1
- function a147_0x5c82(){const _0x446d6c=['fixed-negative-id','every','readback','18ZzdZai','join','size','sort','maxBatchSize','The\x20server\x20import\x20contract\x20is\x20unsupported\x20or\x20incomplete.','Invalid\x20import\x20lock\x20owner.','status','dingTalkUrl','accuracy','longitude','cityAdcode','road','stringify','type','pending','isArray','keys','completed','key','createUserName','districtAdcode','province','actorId','filter','623885oXkqbT','\x20exceeds\x20the\x20import\x20request\x20size\x20limit.','auto-id-task-marker','values','batchSize','binding','ENOENT','elapsedMs','572122zADyvu','The\x20fixed-ID\x20runner\x20requires\x20the\x20v1\x20import\x20contract.','operatorType','conflict','byteLength','isSafeInteger','unsent','countryCode','pid','succeeded','Import\x20checkpoint\x20does\x20not\x20match\x20the\x20input,\x20target\x20or\x20identity.','latitude','toString','importId','emptyRows','slice','includes','lbswuaCacheId','sync','Excel\x20contains\x20no\x20valid\x20data\x20rows.','EEXIST','isInteger','isSymbolicLink','schemaVersion','message','map','.tmp-','maxBatchBytes','Excel\x20contains\x20invalid\x20rows;\x20no\x20data\x20was\x20written.','string','source','imageFields','checkpoint','resultCode','Previously\x20imported\x20records\x20are\x20no\x20longer\x20visible;\x20recovery\x20stopped.','push','report','The\x20import\x20checkpoint\x20is\x20locked\x20by\x20a\x20running\x20process.','some','code','kill','hex','close','writeFile','has','2278213NQTCNU','datasetCode','ids','strategy','now','Excel\x20row\x20','token','11878632pzOujW','Invalid\x20import\x20batch\x20size.','Invalid\x20or\x20duplicate\x20import\x20readback\x20ID.','schemaFingerprint','1ZpVQdr','set','rows','district','parse','get','write','createUserId','Import\x20output\x20must\x20not\x20be\x20a\x20symbolic\x20link.','ESRCH','utf8','runtimeDomain','geolocation','forEach','country','rowNumber','resume','onCheckpointReady','warnings','Import\x20content\x20conflict\x20at\x20Excel\x20row\x20','appCode','length','incomplete','4200453DzlPeo','previewUrl','31851909fpAVpr','unknown','2246092UAqCdk','version','Invalid\x20import\x20readback\x20response.','catch','object'];a147_0x5c82=function(){return _0x446d6c;};return a147_0x5c82();}const a147_0x552a97=a147_0x3704;function a147_0x3704(_0x4fc4cb,_0xe0f6cc){_0x4fc4cb=_0x4fc4cb-0x184;const _0x5c82db=a147_0x5c82();let _0x37045b=_0x5c82db[_0x4fc4cb];return _0x37045b;}(function(_0x5e93f3,_0x3c4de4){const _0x2c1cab=a147_0x3704,_0x32d10f=_0x5e93f3();while(!![]){try{const _0x1fe1d6=parseInt(_0x2c1cab(0x1ed))/0x1*(-parseInt(_0x2c1cab(0x1b5))/0x2)+-parseInt(_0x2c1cab(0x188))/0x3+parseInt(_0x2c1cab(0x18c))/0x4+-parseInt(_0x2c1cab(0x1ad))/0x5*(-parseInt(_0x2c1cab(0x194))/0x6)+-parseInt(_0x2c1cab(0x1e2))/0x7+-parseInt(_0x2c1cab(0x1e9))/0x8+parseInt(_0x2c1cab(0x18a))/0x9;if(_0x1fe1d6===_0x3c4de4)break;else _0x32d10f['push'](_0x32d10f['shift']());}catch(_0xb679c0){_0x32d10f['push'](_0x32d10f['shift']());}}}(a147_0x5c82,0xeee17));import{randomBytes,randomUUID}from'node:crypto';import{lstat,open,readFile,realpath,rename,unlink}from'node:fs/promises';import{resolve,dirname,basename}from'node:path';export function canonical(_0x2db6f5){const _0x5dbd78=a147_0x3704;if(Array['isArray'](_0x2db6f5))return'['+_0x2db6f5[_0x5dbd78(0x1ce)](canonical)[_0x5dbd78(0x195)](',')+']';if(_0x2db6f5&&typeof _0x2db6f5===_0x5dbd78(0x190))return'{'+Object['keys'](_0x2db6f5)[_0x5dbd78(0x197)]()[_0x5dbd78(0x1ce)](_0x32f1ab=>JSON[_0x5dbd78(0x1a1)](_0x32f1ab)+':'+canonical(_0x2db6f5[_0x32f1ab]))[_0x5dbd78(0x195)](',')+'}';return JSON[_0x5dbd78(0x1a1)](_0x2db6f5)??'undefined';}const EMPTY_IMAGE_LOCATION_FIELDS=new Set(['time',a147_0x552a97(0x1b7),a147_0x552a97(0x1a9),a147_0x552a97(0x1f0),'pois',a147_0x552a97(0x1a0),a147_0x552a97(0x1fb),a147_0x552a97(0x1bc),a147_0x552a97(0x1aa),a147_0x552a97(0x1c0),'city','netType',a147_0x552a97(0x1d6),'streetNumber',a147_0x552a97(0x19d),a147_0x552a97(0x19e),a147_0x552a97(0x19f),'errorMessage','address',a147_0x552a97(0x1c6)]);export function sameImportValue(_0x155036,_0x393b46,_0x310898=![]){const _0x9b8bc9=a147_0x552a97;if(_0x310898){const _0x31f095=_0x578003=>Array['isArray'](_0x578003)?_0x578003[_0x9b8bc9(0x1ce)](_0x3dc1c6=>{const _0x5955e2=_0x9b8bc9;if(!_0x3dc1c6||typeof _0x3dc1c6!==_0x5955e2(0x190)||Array[_0x5955e2(0x1a4)](_0x3dc1c6))return _0x3dc1c6;const _0x199067={..._0x3dc1c6};delete _0x199067['url'],delete _0x199067[_0x5955e2(0x189)];if(_0x199067['dingTalkUrl']==='')delete _0x199067[_0x5955e2(0x19c)];if(_0x199067[_0x5955e2(0x1f4)]==null)delete _0x199067[_0x5955e2(0x1f4)];if(_0x199067[_0x5955e2(0x1a8)]==null)delete _0x199067[_0x5955e2(0x1a8)];if(_0x199067[_0x5955e2(0x1f9)]==null||typeof _0x199067['geolocation']===_0x5955e2(0x190)&&!Array[_0x5955e2(0x1a4)](_0x199067[_0x5955e2(0x1f9)])&&Object['entries'](_0x199067[_0x5955e2(0x1f9)])['every'](([_0xe24f6f,_0x30de59])=>EMPTY_IMAGE_LOCATION_FIELDS['has'](_0xe24f6f)&&_0x30de59===null))delete _0x199067[_0x5955e2(0x1f9)];for(const _0xce7aa6 of['name',_0x5955e2(0x1a2),_0x5955e2(0x1a7)])if(!(_0xce7aa6 in _0x199067))_0x199067[_0xce7aa6]='';if(_0x199067[_0x5955e2(0x196)]==null)_0x199067['size']=0x0;return _0x199067;}):_0x578003;return canonical(_0x31f095(_0x155036))===canonical(_0x31f095(_0x393b46));}return _0x155036===null?_0x393b46===null||_0x393b46===undefined:canonical(_0x393b46)===canonical(_0x155036);}async function rejectSymlink(_0xfde599){const _0x5af0c0=a147_0x552a97;try{if((await lstat(_0xfde599))[_0x5af0c0(0x1cb)]())throw Error(_0x5af0c0(0x1f5));}catch(_0x3b5281){if(_0x3b5281['code']!==_0x5af0c0(0x1b3))throw _0x3b5281;}}export async function resolveImportOutputPath(_0x38dbc9){return await rejectSymlink(_0x38dbc9),resolve(await realpath(dirname(resolve(_0x38dbc9))),basename(_0x38dbc9));}export function assertImportPaths(_0x46a501,_0x8c68ab,_0xd98871=[]){const _0x1a2226=a147_0x552a97,_0x303cf1=[..._0xd98871,_0x46a501,_0x8c68ab,_0x46a501+'.lock',_0x46a501+'.lock.recovery'][_0x1a2226(0x1ce)](_0x3c842a=>resolve(_0x3c842a));if(new Set(_0x303cf1)[_0x1a2226(0x196)]!==_0x303cf1[_0x1a2226(0x186)])throw Error('Import\x20input,\x20output\x20and\x20lock\x20paths\x20must\x20be\x20different\x20files.');}export async function saveImportJson(_0x59d231,_0x597b9e){const _0x365a0c=a147_0x552a97;await rejectSymlink(_0x59d231);const _0x3caeb4=_0x59d231+_0x365a0c(0x1cf)+randomUUID(),_0x308e91=await open(_0x3caeb4,'wx',0x180);try{await _0x308e91[_0x365a0c(0x1e0)](JSON[_0x365a0c(0x1a1)](_0x597b9e,null,0x2)),await _0x308e91[_0x365a0c(0x1c7)]();}finally{await _0x308e91['close']();}try{await rename(_0x3caeb4,_0x59d231);}catch(_0x2d1775){await unlink(_0x3caeb4)[_0x365a0c(0x18f)](()=>{});throw _0x2d1775;}}export async function acquireLock(_0x4b26b2){const _0x1ef8be=a147_0x552a97,_0x2802a5=_0x4b26b2+'.lock',_0x562667=randomUUID();await rejectSymlink(_0x2802a5);const _0x3897d6=_0x2802a5+'.recovery';let _0x2cc090,_0x3f5942;try{try{_0x2cc090=await open(_0x2802a5,'wx',0x180);}catch(_0x3b7a87){if(_0x3b7a87[_0x1ef8be(0x1dc)]!==_0x1ef8be(0x1c9))throw _0x3b7a87;try{_0x3f5942=await open(_0x3897d6,'wx',0x180);}catch(_0x22bb09){if(_0x22bb09['code']===_0x1ef8be(0x1c9))throw Error('Import\x20lock\x20recovery\x20is\x20active\x20or\x20interrupted;\x20inspect\x20the\x20recovery\x20guard\x20before\x20retrying.');throw _0x22bb09;}await _0x3f5942['writeFile'](JSON[_0x1ef8be(0x1a1)]({'pid':process['pid'],'token':_0x562667})),await _0x3f5942[_0x1ef8be(0x1c7)](),await rejectSymlink(_0x2802a5);let _0x3f0947;try{_0x3f0947=await readFile(_0x2802a5,_0x1ef8be(0x1f7));}catch(_0x1ecb85){if(_0x1ecb85[_0x1ef8be(0x1dc)]!==_0x1ef8be(0x1b3))throw _0x1ecb85;}if(_0x3f0947!==undefined){let _0x2a1317;try{_0x2a1317=JSON[_0x1ef8be(0x1f1)](_0x3f0947);}catch{throw Error('Invalid\x20import\x20lock;\x20inspect\x20it\x20before\x20recovery.');}if(!_0x2a1317||!Number[_0x1ef8be(0x1ba)](_0x2a1317[_0x1ef8be(0x1bd)])||_0x2a1317[_0x1ef8be(0x1bd)]<=0x0)throw Error(_0x1ef8be(0x19a));try{process[_0x1ef8be(0x1dd)](_0x2a1317[_0x1ef8be(0x1bd)],0x0);throw Error(_0x1ef8be(0x1da));}catch(_0x5541da){if(_0x5541da[_0x1ef8be(0x1dc)]!==_0x1ef8be(0x1f6))throw _0x5541da;}if(await readFile(_0x2802a5,'utf8')!==_0x3f0947)throw Error('Import\x20lock\x20changed;\x20retry\x20recovery.');await unlink(_0x2802a5);}_0x2cc090=await open(_0x2802a5,'wx',0x180);}await _0x2cc090[_0x1ef8be(0x1e0)](JSON[_0x1ef8be(0x1a1)]({'pid':process['pid'],'token':_0x562667})),await _0x2cc090[_0x1ef8be(0x1c7)]();}finally{try{await _0x2cc090?.['close']();}finally{if(_0x3f5942)try{await _0x3f5942[_0x1ef8be(0x1df)]();}finally{await unlink(_0x3897d6);}}}return async()=>{const _0x313ce1=_0x1ef8be;if(JSON[_0x313ce1(0x1f1)](await readFile(_0x2802a5,_0x313ce1(0x1f7)))[_0x313ce1(0x1e8)]===_0x562667)await unlink(_0x2802a5);};}export function assertImportContract(_0x1090da,_0x255ca9,_0x2e3dda){const _0x1155b=a147_0x552a97;if(!_0x1090da||!(_0x1090da[_0x1155b(0x1cc)]===0x1&&_0x1090da['strategy']===_0x1155b(0x191)||_0x1090da['schemaVersion']===0x2&&_0x1090da[_0x1155b(0x1e5)]===_0x1155b(0x1af))||_0x1090da[_0x1155b(0x1d3)]!=='METADATA'||_0x1090da['appCode']!==_0x255ca9||_0x1090da['datasetCode']!==_0x2e3dda||typeof _0x1090da['actorId']!=='string'||!_0x1090da[_0x1155b(0x1ab)]||typeof _0x1090da[_0x1155b(0x1ec)]!==_0x1155b(0x1d2)||!_0x1090da[_0x1155b(0x1ec)]||!Number[_0x1155b(0x1ba)](_0x1090da['maxBatchSize'])||_0x1090da[_0x1155b(0x198)]<0x1||_0x1090da['maxBatchSize']>0x3e8||!Number[_0x1155b(0x1ba)](_0x1090da['maxBatchBytes'])||_0x1090da['maxBatchBytes']<0x1||_0x1090da[_0x1155b(0x1d0)]>0x14*0x400*0x400)throw Error(_0x1155b(0x199));}export async function runExcelImport(_0x5371ff){const _0x21d1af=a147_0x552a97;_0x5371ff={..._0x5371ff,'checkpoint':await resolveImportOutputPath(_0x5371ff[_0x21d1af(0x1d5)]),'report':await resolveImportOutputPath(_0x5371ff[_0x21d1af(0x1d9)])};const {manifest:_0x403729,contract:_0x4cf1bb,api:_0x4ff785}=_0x5371ff;assertImportContract(_0x4cf1bb,_0x5371ff['appCode'],_0x5371ff[_0x21d1af(0x1e3)]);if(_0x4cf1bb[_0x21d1af(0x1cc)]!==0x1)throw Error(_0x21d1af(0x1b6));if(_0x403729['errors'][_0x21d1af(0x186)])throw Error(_0x21d1af(0x1d1));if(!_0x403729[_0x21d1af(0x1ef)][_0x21d1af(0x186)])throw Error(_0x21d1af(0x1c8));if(!Number[_0x21d1af(0x1ca)](_0x5371ff[_0x21d1af(0x1b1)])||_0x5371ff[_0x21d1af(0x1b1)]<0x1||_0x5371ff['batchSize']>_0x4cf1bb[_0x21d1af(0x198)])throw Error(_0x21d1af(0x1ea));for(const _0x4edcd5 of _0x403729[_0x21d1af(0x1ef)]){if(Buffer[_0x21d1af(0x1b9)](JSON[_0x21d1af(0x1a1)]({'schemaFingerprint':_0x4cf1bb[_0x21d1af(0x1ec)],'items':[{..._0x4edcd5[_0x21d1af(0x1b0)],'id':-0x1fffffffffffff}]}),_0x21d1af(0x1f7))>_0x4cf1bb[_0x21d1af(0x1d0)])throw Error(_0x21d1af(0x1e7)+_0x4edcd5[_0x21d1af(0x1fc)]+_0x21d1af(0x1ae));}assertImportPaths(_0x5371ff['checkpoint'],_0x5371ff['report']);const _0x81a745={'appCode':_0x5371ff[_0x21d1af(0x185)],'datasetCode':_0x5371ff[_0x21d1af(0x1e3)],'runtimeDomain':_0x5371ff[_0x21d1af(0x1f8)],'actorId':_0x4cf1bb[_0x21d1af(0x1ab)],'fileHash':_0x403729['fileHash'],'mappingHash':_0x403729['mappingHash'],'schemaHash':_0x403729['schemaHash'],'remoteSchemaHash':_0x4cf1bb[_0x21d1af(0x1ec)],'batchSize':_0x5371ff[_0x21d1af(0x1b1)],'sheet':_0x403729['sheet']},_0x33d077=await acquireLock(_0x5371ff[_0x21d1af(0x1d5)]);let _0x5e5d38;const _0x379598=Date[_0x21d1af(0x1e6)]();let _0x59404e=0x0;const _0x1eb141=[],_0x2da9ca=()=>({'importId':_0x5e5d38?.[_0x21d1af(0x1c2)],'sourceRows':_0x403729[_0x21d1af(0x1ef)][_0x21d1af(0x186)],'emptyRows':_0x403729[_0x21d1af(0x1c3)][_0x21d1af(0x186)],'succeeded':_0x5e5d38?.['rows'][_0x21d1af(0x1ac)](_0x44b689=>_0x44b689['status']==='succeeded')[_0x21d1af(0x186)]??0x0,'unknown':_0x5e5d38?.['rows']['filter'](_0x2edead=>_0x2edead[_0x21d1af(0x19b)]===_0x21d1af(0x1a3))['length']??0x0,'conflicts':_0x5e5d38?.['rows'][_0x21d1af(0x1ac)](_0x2605d1=>_0x2605d1[_0x21d1af(0x19b)]===_0x21d1af(0x1b8))[_0x21d1af(0x186)]??0x0,'notAttempted':_0x5e5d38?.['rows'][_0x21d1af(0x1ac)](_0x14b4a2=>_0x14b4a2[_0x21d1af(0x19b)]==='unsent')['length']??_0x403729[_0x21d1af(0x1ef)]['length'],'batches':_0x59404e,'batchResults':_0x1eb141,'elapsedMs':Date[_0x21d1af(0x1e6)]()-_0x379598,'checkpoint':resolve(_0x5371ff[_0x21d1af(0x1d5)]),'report':resolve(_0x5371ff[_0x21d1af(0x1d9)]),'warnings':_0x403729[_0x21d1af(0x1ff)]});try{await rejectSymlink(_0x5371ff[_0x21d1af(0x1d5)]);if(_0x5371ff[_0x21d1af(0x1fd)]){try{_0x5e5d38=JSON[_0x21d1af(0x1f1)](await readFile(_0x5371ff[_0x21d1af(0x1d5)],'utf8'));}catch{throw Error('Cannot\x20read\x20the\x20import\x20checkpoint.');}if(!_0x5e5d38||_0x5e5d38[_0x21d1af(0x18d)]!==0x1||typeof _0x5e5d38['importId']!==_0x21d1af(0x1d2)||canonical(_0x5e5d38[_0x21d1af(0x1b2)])!==canonical(_0x81a745)||!Array[_0x21d1af(0x1a4)](_0x5e5d38[_0x21d1af(0x1ef)])||_0x5e5d38[_0x21d1af(0x1ef)]['length']!==_0x403729[_0x21d1af(0x1ef)][_0x21d1af(0x186)]||new Set(_0x5e5d38[_0x21d1af(0x1ef)]['map'](_0x21a5de=>_0x21a5de['id']))[_0x21d1af(0x196)]!==_0x5e5d38['rows'][_0x21d1af(0x186)]||_0x5e5d38[_0x21d1af(0x1ef)]['some']((_0x55ec1f,_0x3aa64a)=>!Number[_0x21d1af(0x1ba)](_0x55ec1f['id'])||_0x55ec1f['id']>=0x0||_0x55ec1f[_0x21d1af(0x1fc)]!==_0x403729['rows'][_0x3aa64a][_0x21d1af(0x1fc)]||![_0x21d1af(0x1bb),_0x21d1af(0x1a3),_0x21d1af(0x1be),_0x21d1af(0x1b8)][_0x21d1af(0x1c5)](_0x55ec1f[_0x21d1af(0x19b)])))throw Error(_0x21d1af(0x1bf));}else{try{await lstat(_0x5371ff[_0x21d1af(0x1d5)]);throw Error('Import\x20checkpoint\x20already\x20exists;\x20use\x20--resume.');}catch(_0x5d43a0){if(_0x5d43a0[_0x21d1af(0x1dc)]!==_0x21d1af(0x1b3))throw _0x5d43a0;}const _0x1b48e2=new Set();_0x5e5d38={'version':0x1,'importId':randomUUID(),'binding':_0x81a745,'rows':_0x403729[_0x21d1af(0x1ef)]['map'](_0x521de5=>{const _0x44f613=_0x21d1af;let _0x59d03d;do{_0x59d03d=-(Number(BigInt('0x'+randomBytes(0x7)[_0x44f613(0x1c1)](_0x44f613(0x1de)))&(0x1n<<0x34n)-0x1n)+0x1);}while(_0x1b48e2[_0x44f613(0x1e1)](_0x59d03d));return _0x1b48e2['add'](_0x59d03d),{'id':_0x59d03d,'rowNumber':_0x521de5[_0x44f613(0x1fc)],'status':'unsent'};})},await saveImportJson(_0x5371ff['checkpoint'],_0x5e5d38);}await _0x5371ff[_0x21d1af(0x1fe)]?.();const _0x34f64f=_0x5e5d38;if(_0x34f64f[_0x21d1af(0x1ef)]['some'](_0xc27c95=>_0xc27c95[_0x21d1af(0x19b)]===_0x21d1af(0x1b8)))throw Error('Import\x20checkpoint\x20contains\x20a\x20content\x20conflict.');const _0x234360=async _0xb42a9f=>{const _0x26024b=_0x21d1af,_0x2e7c9b=await _0x4ff785['readback'](_0xb42a9f['map'](_0x883faf=>_0x34f64f[_0x26024b(0x1ef)][_0x883faf]['id']));if(!Array[_0x26024b(0x1a4)](_0x2e7c9b))throw Error(_0x26024b(0x18e));const _0x3ac849=new Set(_0xb42a9f['map'](_0x1b60a8=>_0x34f64f[_0x26024b(0x1ef)][_0x1b60a8]['id'])),_0x56db52=new Map();for(const _0x537658 of _0x2e7c9b){const _0x380f98=Number(_0x537658?.['id']);if(!_0x3ac849['has'](_0x380f98)||_0x56db52[_0x26024b(0x1e1)](_0x380f98))throw Error(_0x26024b(0x1eb));_0x56db52[_0x26024b(0x1ee)](_0x380f98,_0x537658);}for(const _0x45033e of _0xb42a9f){const _0x49d4ec=_0x56db52[_0x26024b(0x1f2)](_0x34f64f[_0x26024b(0x1ef)][_0x45033e]['id']);if(!_0x49d4ec)continue;if(_0x34f64f[_0x26024b(0x1ef)][_0x45033e]['status']===_0x26024b(0x1bb)){_0x34f64f['rows'][_0x45033e]['status']=_0x26024b(0x1b8),await saveImportJson(_0x5371ff['checkpoint'],_0x34f64f);throw Error('Import\x20primary\x20key\x20collision;\x20stop\x20without\x20replacing\x20the\x20fixed\x20IDs.');}const _0x1dcc3f=_0x403729[_0x26024b(0x1ef)][_0x45033e][_0x26024b(0x1b0)];if(Object[_0x26024b(0x1a5)](_0x1dcc3f)[_0x26024b(0x1db)](_0x379b14=>!sameImportValue(_0x1dcc3f[_0x379b14],_0x49d4ec[_0x379b14],_0x403729[_0x26024b(0x1d4)]?.[_0x26024b(0x1c5)](_0x379b14)&&!_0x403729['uploadFields']?.[_0x26024b(0x1c5)](_0x379b14)))){_0x34f64f[_0x26024b(0x1ef)][_0x45033e]['status']=_0x26024b(0x1b8),await saveImportJson(_0x5371ff[_0x26024b(0x1d5)],_0x34f64f);throw Error(_0x26024b(0x184)+_0x34f64f[_0x26024b(0x1ef)][_0x45033e][_0x26024b(0x1fc)]+'.');}_0x34f64f[_0x26024b(0x1ef)][_0x45033e]['status']='succeeded';}return await saveImportJson(_0x5371ff['checkpoint'],_0x34f64f),_0x56db52;};if(_0x5371ff['resume'])for(let _0x27cb75=0x0;_0x27cb75<_0x34f64f['rows'][_0x21d1af(0x186)];_0x27cb75+=_0x5371ff['batchSize']){const _0x59701d=_0x34f64f[_0x21d1af(0x1ef)][_0x21d1af(0x1c4)](_0x27cb75,_0x27cb75+_0x5371ff[_0x21d1af(0x1b1)])['map']((_0x5bbb4c,_0x36b6de)=>_0x27cb75+_0x36b6de),_0x5d3076=_0x59701d[_0x21d1af(0x1ac)](_0x2f582f=>_0x34f64f[_0x21d1af(0x1ef)][_0x2f582f][_0x21d1af(0x19b)]===_0x21d1af(0x1be)),_0x5e2f0e=await _0x234360(_0x59701d),_0x455dd4=_0x5d3076[_0x21d1af(0x1ac)](_0x20fc37=>!_0x5e2f0e[_0x21d1af(0x1e1)](_0x34f64f['rows'][_0x20fc37]['id']));if(_0x455dd4[_0x21d1af(0x186)]){_0x455dd4[_0x21d1af(0x1fa)](_0x191ad6=>{const _0x2ad374=_0x21d1af;_0x34f64f[_0x2ad374(0x1ef)][_0x191ad6][_0x2ad374(0x19b)]=_0x2ad374(0x1b8);}),await saveImportJson(_0x5371ff[_0x21d1af(0x1d5)],_0x34f64f);throw Error(_0x21d1af(0x1d7));}}for(let _0x454974=0x0;_0x454974<_0x34f64f[_0x21d1af(0x1ef)][_0x21d1af(0x186)];){const _0x549476=[],_0x1dd243=[];while(_0x454974<_0x34f64f[_0x21d1af(0x1ef)][_0x21d1af(0x186)]&&_0x1dd243['length']<_0x5371ff[_0x21d1af(0x1b1)]){const _0x162fd8=_0x454974++;if(_0x34f64f[_0x21d1af(0x1ef)][_0x162fd8][_0x21d1af(0x19b)]===_0x21d1af(0x1be))continue;const _0x3ecaf7={..._0x403729[_0x21d1af(0x1ef)][_0x162fd8][_0x21d1af(0x1b0)],'id':_0x34f64f['rows'][_0x162fd8]['id']};if(Buffer[_0x21d1af(0x1b9)](JSON[_0x21d1af(0x1a1)]({'schemaFingerprint':_0x4cf1bb[_0x21d1af(0x1ec)],'items':[..._0x1dd243,_0x3ecaf7]}),_0x21d1af(0x1f7))>_0x4cf1bb[_0x21d1af(0x1d0)]){if(!_0x1dd243[_0x21d1af(0x186)])throw Error(_0x21d1af(0x1e7)+_0x34f64f[_0x21d1af(0x1ef)][_0x162fd8][_0x21d1af(0x1fc)]+_0x21d1af(0x1ae));_0x454974--;break;}_0x549476[_0x21d1af(0x1d8)](_0x162fd8),_0x1dd243[_0x21d1af(0x1d8)](_0x3ecaf7);}if(!_0x1dd243[_0x21d1af(0x186)])continue;const _0x3047f8=_0x549476[_0x21d1af(0x1ac)](_0x248544=>_0x34f64f[_0x21d1af(0x1ef)][_0x248544]['status']==='unsent');if(_0x3047f8[_0x21d1af(0x186)]){const _0xa5fe33=await _0x4ff785[_0x21d1af(0x193)](_0x3047f8['map'](_0x525b82=>_0x34f64f[_0x21d1af(0x1ef)][_0x525b82]['id']));if(!Array['isArray'](_0xa5fe33))throw Error(_0x21d1af(0x18e));if(_0xa5fe33[_0x21d1af(0x186)])throw Error('Import\x20primary\x20key\x20collision;\x20stop\x20without\x20replacing\x20the\x20fixed\x20IDs.');}_0x549476[_0x21d1af(0x1fa)](_0xcc25aa=>{const _0x16c1d1=_0x21d1af;_0x34f64f[_0x16c1d1(0x1ef)][_0xcc25aa][_0x16c1d1(0x19b)]=_0x16c1d1(0x1a3);}),await saveImportJson(_0x5371ff[_0x21d1af(0x1d5)],_0x34f64f),_0x59404e++;const _0x5b7d31=Date[_0x21d1af(0x1e6)](),_0x595090={'batch':_0x59404e,'rowStart':_0x34f64f['rows'][_0x549476[0x0]][_0x21d1af(0x1fc)],'rowEnd':_0x34f64f['rows'][_0x549476[_0x549476[_0x21d1af(0x186)]-0x1]][_0x21d1af(0x1fc)],'count':_0x1dd243[_0x21d1af(0x186)],'bytes':Buffer[_0x21d1af(0x1b9)](JSON[_0x21d1af(0x1a1)]({'schemaFingerprint':_0x4cf1bb[_0x21d1af(0x1ec)],'items':_0x1dd243}),_0x21d1af(0x1f7)),'elapsedMs':0x0,'status':_0x21d1af(0x18b)};_0x1eb141[_0x21d1af(0x1d8)](_0x595090);try{const _0x161b26=await _0x4ff785[_0x21d1af(0x1f3)](_0x1dd243);if(!_0x161b26||_0x161b26['count']!==_0x1dd243['length']||!Array['isArray'](_0x161b26['ids'])||_0x161b26[_0x21d1af(0x1e4)][_0x21d1af(0x186)]!==_0x1dd243[_0x21d1af(0x186)]||_0x161b26['ids'][_0x21d1af(0x1db)]((_0x25e93a,_0xcd4b2b)=>Number(_0x25e93a)!==_0x34f64f[_0x21d1af(0x1ef)][_0x549476[_0xcd4b2b]]['id']))throw Error('Invalid\x20write\x20result.');await _0x234360(_0x549476);if(_0x549476[_0x21d1af(0x1db)](_0x5c4acf=>_0x34f64f[_0x21d1af(0x1ef)][_0x5c4acf][_0x21d1af(0x19b)]!=='succeeded'))throw Error('Incomplete\x20readback.');}catch(_0x294578){if(_0x34f64f[_0x21d1af(0x1ef)]['some'](_0x5d0fad=>_0x5d0fad[_0x21d1af(0x19b)]===_0x21d1af(0x1b8)))throw _0x294578;try{await _0x234360(_0x549476);}catch(_0x49b1a7){if(_0x34f64f['rows'][_0x21d1af(0x1db)](_0x8b79f5=>_0x8b79f5[_0x21d1af(0x19b)]===_0x21d1af(0x1b8)))throw _0x49b1a7;}if(_0x549476['some'](_0x5538b2=>_0x34f64f[_0x21d1af(0x1ef)][_0x5538b2][_0x21d1af(0x19b)]!=='succeeded'))throw Error('The\x20import\x20write\x20outcome\x20is\x20unknown.\x20Resume\x20to\x20reconcile\x20the\x20fixed\x20IDs\x20before\x20continuing.');}finally{_0x595090[_0x21d1af(0x1b4)]=Date['now']()-_0x5b7d31;if(_0x549476[_0x21d1af(0x192)](_0x5ad59d=>_0x34f64f[_0x21d1af(0x1ef)][_0x5ad59d]['status']===_0x21d1af(0x1be)))_0x595090[_0x21d1af(0x19b)]=_0x21d1af(0x1be);else{if(_0x549476['some'](_0x993ba=>_0x34f64f['rows'][_0x993ba][_0x21d1af(0x19b)]==='conflict'))_0x595090[_0x21d1af(0x19b)]=_0x21d1af(0x1b8);}}}const _0x3161f6={'status':_0x21d1af(0x1a6),..._0x2da9ca()};return await saveImportJson(_0x5371ff['report'],_0x3161f6),_0x3161f6;}catch(_0x461024){if(_0x5e5d38)await saveImportJson(_0x5371ff[_0x21d1af(0x1d9)],{'status':_0x21d1af(0x187),..._0x2da9ca(),'message':_0x461024[_0x21d1af(0x1cd)]});throw _0x461024;}finally{await _0x33d077();}}
1
+ function a150_0x4d3f(){const _0x42f6f1=['.recovery','Excel\x20row\x20','isSafeInteger','runtimeDomain','checkpoint','.lock.recovery','schemaVersion','\x20exceeds\x20the\x20import\x20request\x20size\x20limit.','appCode','Import\x20primary\x20key\x20collision;\x20stop\x20without\x20replacing\x20the\x20fixed\x20IDs.','completed','auto-id-task-marker','imageFields','5XSRXOd','resume','size','undefined','METADATA','361350qUZqBO','Invalid\x20or\x20duplicate\x20import\x20readback\x20ID.','Incomplete\x20readback.','maxBatchBytes','countryCode','2545250JAomqY','geolocation','batchSize','8517249hJZZjU','schemaFingerprint','ids','keys','Invalid\x20import\x20readback\x20response.','9QOCefe','entries','The\x20server\x20import\x20contract\x20is\x20unsupported\x20or\x20incomplete.','rowNumber','code','The\x20fixed-ID\x20runner\x20requires\x20the\x20v1\x20import\x20contract.','2995512uDIfnn','fileHash','longitude','EEXIST','2518096PZlESJ','has','add','some','isSymbolicLink','stringify','unsent','province','type','forEach','pending','.lock','country','sync','Invalid\x20import\x20batch\x20size.','districtAdcode','8UkmYHE','join','warnings','version','parse','resultCode','filter','Invalid\x20import\x20lock;\x20inspect\x20it\x20before\x20recovery.','datasetCode','Previously\x20imported\x20records\x20are\x20no\x20longer\x20visible;\x20recovery\x20stopped.','strategy','object','ENOENT','source','209176bgEaMf','map','writeFile','now','rows','Import\x20checkpoint\x20does\x20not\x20match\x20the\x20input,\x20target\x20or\x20identity.','Import\x20lock\x20changed;\x20retry\x20recovery.','set','uploadFields','push','Cannot\x20read\x20the\x20import\x20checkpoint.','elapsedMs','Import\x20output\x20must\x20not\x20be\x20a\x20symbolic\x20link.','emptyRows','errors','dingTalkUrl','byteLength','city','netType','values','Import\x20content\x20conflict\x20at\x20Excel\x20row\x20','fixed-negative-id','pois','status','binding','slice','get','utf8','latitude','report','every','Import\x20checkpoint\x20already\x20exists;\x20use\x20--resume.','pid','key','district','hex','name','string','The\x20import\x20checkpoint\x20is\x20locked\x20by\x20a\x20running\x20process.','actorId','message','Import\x20input,\x20output\x20and\x20lock\x20paths\x20must\x20be\x20different\x20files.','streetNumber','importId','succeeded','length','Invalid\x20import\x20lock\x20owner.','catch','address','maxBatchSize','token','.tmp-','isArray','accuracy','Excel\x20contains\x20invalid\x20rows;\x20no\x20data\x20was\x20written.','kill','write','close','createUserId','The\x20import\x20write\x20outcome\x20is\x20unknown.\x20Resume\x20to\x20reconcile\x20the\x20fixed\x20IDs\x20before\x20continuing.','road','createUserName','isInteger','schemaHash','6522411zkhSKH','readback','conflict','ESRCH','onCheckpointReady','includes'];a150_0x4d3f=function(){return _0x42f6f1;};return a150_0x4d3f();}const a150_0x4e0608=a150_0x4cfc;(function(_0x39bf98,_0x20a0f8){const _0x44c900=a150_0x4cfc,_0x712d55=_0x39bf98();while(!![]){try{const _0x180f46=parseInt(_0x44c900(0x1b2))/0x1+-parseInt(_0x44c900(0x1e7))/0x2*(-parseInt(_0x44c900(0x1bf))/0x3)+-parseInt(_0x44c900(0x1c9))/0x4*(-parseInt(_0x44c900(0x1ad))/0x5)+-parseInt(_0x44c900(0x1c5))/0x6+-parseInt(_0x44c900(0x19a))/0x7*(-parseInt(_0x44c900(0x1d9))/0x8)+-parseInt(_0x44c900(0x1ba))/0x9+-parseInt(_0x44c900(0x1b7))/0xa;if(_0x180f46===_0x20a0f8)break;else _0x712d55['push'](_0x712d55['shift']());}catch(_0x51efdf){_0x712d55['push'](_0x712d55['shift']());}}}(a150_0x4d3f,0x82ed1));import{randomBytes,randomUUID}from'node:crypto';import{lstat,open,readFile,realpath,rename,unlink}from'node:fs/promises';import{resolve,dirname,basename}from'node:path';export function canonical(_0x394c3f){const _0x295dac=a150_0x4cfc;if(Array[_0x295dac(0x18e)](_0x394c3f))return'['+_0x394c3f[_0x295dac(0x1e8)](canonical)[_0x295dac(0x1da)](',')+']';if(_0x394c3f&&typeof _0x394c3f==='object')return'{'+Object[_0x295dac(0x1bd)](_0x394c3f)['sort']()[_0x295dac(0x1e8)](_0x22eae4=>JSON['stringify'](_0x22eae4)+':'+canonical(_0x394c3f[_0x22eae4]))[_0x295dac(0x1da)](',')+'}';return JSON[_0x295dac(0x1ce)](_0x394c3f)??_0x295dac(0x1b0);}function a150_0x4cfc(_0x53eeda,_0x31b038){_0x53eeda=_0x53eeda-0x16a;const _0x4d3f36=a150_0x4d3f();let _0x4cfcf9=_0x4d3f36[_0x53eeda];return _0x4cfcf9;}const EMPTY_IMAGE_LOCATION_FIELDS=new Set(['time','operatorType',a150_0x4e0608(0x1d8),a150_0x4e0608(0x17c),a150_0x4e0608(0x170),a150_0x4e0608(0x196),a150_0x4e0608(0x1d5),a150_0x4e0608(0x1b6),a150_0x4e0608(0x1d0),a150_0x4e0608(0x176),a150_0x4e0608(0x16b),a150_0x4e0608(0x16c),a150_0x4e0608(0x1de),a150_0x4e0608(0x184),a150_0x4e0608(0x18f),a150_0x4e0608(0x1c7),'cityAdcode','errorMessage',a150_0x4e0608(0x18a),'lbswuaCacheId']);export function sameImportValue(_0xca2b7f,_0x828510,_0x385083=![]){const _0x2f00c3=a150_0x4e0608;if(_0x385083){const _0x3b4d60=_0x3a2dd0=>Array[_0x2f00c3(0x18e)](_0x3a2dd0)?_0x3a2dd0[_0x2f00c3(0x1e8)](_0x4dd48c=>{const _0x2f20c1=_0x2f00c3;if(!_0x4dd48c||typeof _0x4dd48c!==_0x2f20c1(0x1e4)||Array[_0x2f20c1(0x18e)](_0x4dd48c))return _0x4dd48c;const _0x37c652={..._0x4dd48c};delete _0x37c652['url'],delete _0x37c652['previewUrl'];if(_0x37c652[_0x2f20c1(0x1f6)]==='')delete _0x37c652[_0x2f20c1(0x1f6)];if(_0x37c652[_0x2f20c1(0x194)]==null)delete _0x37c652[_0x2f20c1(0x194)];if(_0x37c652[_0x2f20c1(0x197)]==null)delete _0x37c652[_0x2f20c1(0x197)];if(_0x37c652[_0x2f20c1(0x1b8)]==null||typeof _0x37c652[_0x2f20c1(0x1b8)]===_0x2f20c1(0x1e4)&&!Array[_0x2f20c1(0x18e)](_0x37c652['geolocation'])&&Object[_0x2f20c1(0x1c0)](_0x37c652[_0x2f20c1(0x1b8)])['every'](([_0x4033e8,_0x3adfd2])=>EMPTY_IMAGE_LOCATION_FIELDS[_0x2f20c1(0x1ca)](_0x4033e8)&&_0x3adfd2===null))delete _0x37c652[_0x2f20c1(0x1b8)];for(const _0xc36131 of[_0x2f20c1(0x17e),_0x2f20c1(0x1d1),_0x2f20c1(0x17b)])if(!(_0xc36131 in _0x37c652))_0x37c652[_0xc36131]='';if(_0x37c652[_0x2f20c1(0x1af)]==null)_0x37c652[_0x2f20c1(0x1af)]=0x0;return _0x37c652;}):_0x3a2dd0;return canonical(_0x3b4d60(_0xca2b7f))===canonical(_0x3b4d60(_0x828510));}return _0xca2b7f===null?_0x828510===null||_0x828510===undefined:canonical(_0x828510)===canonical(_0xca2b7f);}async function rejectSymlink(_0x5516b6){const _0x38887c=a150_0x4e0608;try{if((await lstat(_0x5516b6))[_0x38887c(0x1cd)]())throw Error(_0x38887c(0x1f3));}catch(_0x48290f){if(_0x48290f['code']!==_0x38887c(0x1e5))throw _0x48290f;}}export async function resolveImportOutputPath(_0x425b12){return await rejectSymlink(_0x425b12),resolve(await realpath(dirname(resolve(_0x425b12))),basename(_0x425b12));}export function assertImportPaths(_0x149a40,_0xfd0edc,_0x5e1b6d=[]){const _0x4d2697=a150_0x4e0608,_0x30dc7a=[..._0x5e1b6d,_0x149a40,_0xfd0edc,_0x149a40+_0x4d2697(0x1d4),_0x149a40+_0x4d2697(0x1a5)][_0x4d2697(0x1e8)](_0x4c99df=>resolve(_0x4c99df));if(new Set(_0x30dc7a)[_0x4d2697(0x1af)]!==_0x30dc7a[_0x4d2697(0x187)])throw Error(_0x4d2697(0x183));}export async function saveImportJson(_0x49fce0,_0x9d37e0){const _0x4f9ca8=a150_0x4e0608;await rejectSymlink(_0x49fce0);const _0x199d0d=_0x49fce0+_0x4f9ca8(0x18d)+randomUUID(),_0x5426ae=await open(_0x199d0d,'wx',0x180);try{await _0x5426ae['writeFile'](JSON[_0x4f9ca8(0x1ce)](_0x9d37e0,null,0x2)),await _0x5426ae[_0x4f9ca8(0x1d6)]();}finally{await _0x5426ae[_0x4f9ca8(0x193)]();}try{await rename(_0x199d0d,_0x49fce0);}catch(_0x31977d){await unlink(_0x199d0d)[_0x4f9ca8(0x189)](()=>{});throw _0x31977d;}}export async function acquireLock(_0x116ba9){const _0x468831=a150_0x4e0608,_0x423b86=_0x116ba9+'.lock',_0xfac4ec=randomUUID();await rejectSymlink(_0x423b86);const _0x44cad5=_0x423b86+_0x468831(0x1a0);let _0x1eeb30,_0x407943;try{try{_0x1eeb30=await open(_0x423b86,'wx',0x180);}catch(_0x18da2b){if(_0x18da2b[_0x468831(0x1c3)]!==_0x468831(0x1c8))throw _0x18da2b;try{_0x407943=await open(_0x44cad5,'wx',0x180);}catch(_0x4d2424){if(_0x4d2424[_0x468831(0x1c3)]==='EEXIST')throw Error('Import\x20lock\x20recovery\x20is\x20active\x20or\x20interrupted;\x20inspect\x20the\x20recovery\x20guard\x20before\x20retrying.');throw _0x4d2424;}await _0x407943['writeFile'](JSON[_0x468831(0x1ce)]({'pid':process[_0x468831(0x17a)],'token':_0xfac4ec})),await _0x407943['sync'](),await rejectSymlink(_0x423b86);let _0xc8888e;try{_0xc8888e=await readFile(_0x423b86,_0x468831(0x175));}catch(_0x369f69){if(_0x369f69['code']!==_0x468831(0x1e5))throw _0x369f69;}if(_0xc8888e!==undefined){let _0x1ef145;try{_0x1ef145=JSON['parse'](_0xc8888e);}catch{throw Error(_0x468831(0x1e0));}if(!_0x1ef145||!Number['isSafeInteger'](_0x1ef145['pid'])||_0x1ef145[_0x468831(0x17a)]<=0x0)throw Error(_0x468831(0x188));try{process[_0x468831(0x191)](_0x1ef145[_0x468831(0x17a)],0x0);throw Error(_0x468831(0x180));}catch(_0x14dfed){if(_0x14dfed['code']!==_0x468831(0x19d))throw _0x14dfed;}if(await readFile(_0x423b86,_0x468831(0x175))!==_0xc8888e)throw Error(_0x468831(0x1ed));await unlink(_0x423b86);}_0x1eeb30=await open(_0x423b86,'wx',0x180);}await _0x1eeb30[_0x468831(0x1e9)](JSON[_0x468831(0x1ce)]({'pid':process[_0x468831(0x17a)],'token':_0xfac4ec})),await _0x1eeb30[_0x468831(0x1d6)]();}finally{try{await _0x1eeb30?.[_0x468831(0x193)]();}finally{if(_0x407943)try{await _0x407943[_0x468831(0x193)]();}finally{await unlink(_0x44cad5);}}}return async()=>{const _0x53ce66=_0x468831;if(JSON[_0x53ce66(0x1dd)](await readFile(_0x423b86,_0x53ce66(0x175)))[_0x53ce66(0x18c)]===_0xfac4ec)await unlink(_0x423b86);};}export function assertImportContract(_0x4847cc,_0x4cccbb,_0x5a074a){const _0x3a74d5=a150_0x4e0608;if(!_0x4847cc||!(_0x4847cc[_0x3a74d5(0x1a6)]===0x1&&_0x4847cc[_0x3a74d5(0x1e3)]===_0x3a74d5(0x16f)||_0x4847cc['schemaVersion']===0x2&&_0x4847cc['strategy']===_0x3a74d5(0x1ab))||_0x4847cc[_0x3a74d5(0x1e6)]!==_0x3a74d5(0x1b1)||_0x4847cc[_0x3a74d5(0x1a8)]!==_0x4cccbb||_0x4847cc[_0x3a74d5(0x1e1)]!==_0x5a074a||typeof _0x4847cc[_0x3a74d5(0x181)]!==_0x3a74d5(0x17f)||!_0x4847cc['actorId']||typeof _0x4847cc[_0x3a74d5(0x1bb)]!==_0x3a74d5(0x17f)||!_0x4847cc['schemaFingerprint']||!Number[_0x3a74d5(0x1a2)](_0x4847cc[_0x3a74d5(0x18b)])||_0x4847cc[_0x3a74d5(0x18b)]<0x1||_0x4847cc[_0x3a74d5(0x18b)]>0x3e8||!Number[_0x3a74d5(0x1a2)](_0x4847cc['maxBatchBytes'])||_0x4847cc[_0x3a74d5(0x1b5)]<0x1||_0x4847cc[_0x3a74d5(0x1b5)]>0x14*0x400*0x400)throw Error(_0x3a74d5(0x1c1));}export async function runExcelImport(_0x28021f){const _0x422d51=a150_0x4e0608;_0x28021f={..._0x28021f,'checkpoint':await resolveImportOutputPath(_0x28021f[_0x422d51(0x1a4)]),'report':await resolveImportOutputPath(_0x28021f[_0x422d51(0x177)])};const {manifest:_0xc3c33c,contract:_0x5b644d,api:_0x35f8b2}=_0x28021f;assertImportContract(_0x5b644d,_0x28021f['appCode'],_0x28021f[_0x422d51(0x1e1)]);if(_0x5b644d[_0x422d51(0x1a6)]!==0x1)throw Error(_0x422d51(0x1c4));if(_0xc3c33c[_0x422d51(0x1f5)][_0x422d51(0x187)])throw Error(_0x422d51(0x190));if(!_0xc3c33c[_0x422d51(0x1eb)]['length'])throw Error('Excel\x20contains\x20no\x20valid\x20data\x20rows.');if(!Number[_0x422d51(0x198)](_0x28021f[_0x422d51(0x1b9)])||_0x28021f[_0x422d51(0x1b9)]<0x1||_0x28021f['batchSize']>_0x5b644d['maxBatchSize'])throw Error(_0x422d51(0x1d7));for(const _0x291d95 of _0xc3c33c[_0x422d51(0x1eb)]){if(Buffer[_0x422d51(0x16a)](JSON[_0x422d51(0x1ce)]({'schemaFingerprint':_0x5b644d[_0x422d51(0x1bb)],'items':[{..._0x291d95['values'],'id':-0x1fffffffffffff}]}),'utf8')>_0x5b644d[_0x422d51(0x1b5)])throw Error(_0x422d51(0x1a1)+_0x291d95['rowNumber']+_0x422d51(0x1a7));}assertImportPaths(_0x28021f[_0x422d51(0x1a4)],_0x28021f[_0x422d51(0x177)]);const _0x30602e={'appCode':_0x28021f[_0x422d51(0x1a8)],'datasetCode':_0x28021f[_0x422d51(0x1e1)],'runtimeDomain':_0x28021f[_0x422d51(0x1a3)],'actorId':_0x5b644d[_0x422d51(0x181)],'fileHash':_0xc3c33c[_0x422d51(0x1c6)],'mappingHash':_0xc3c33c['mappingHash'],'schemaHash':_0xc3c33c[_0x422d51(0x199)],'remoteSchemaHash':_0x5b644d[_0x422d51(0x1bb)],'batchSize':_0x28021f[_0x422d51(0x1b9)],'sheet':_0xc3c33c['sheet']},_0x1a2321=await acquireLock(_0x28021f['checkpoint']);let _0x513449;const _0x3e1a7a=Date[_0x422d51(0x1ea)]();let _0x2a312e=0x0;const _0x2cca81=[],_0x15d110=()=>({'importId':_0x513449?.[_0x422d51(0x185)],'sourceRows':_0xc3c33c['rows']['length'],'emptyRows':_0xc3c33c[_0x422d51(0x1f4)][_0x422d51(0x187)],'succeeded':_0x513449?.[_0x422d51(0x1eb)][_0x422d51(0x1df)](_0x308316=>_0x308316['status']===_0x422d51(0x186))['length']??0x0,'unknown':_0x513449?.[_0x422d51(0x1eb)][_0x422d51(0x1df)](_0x185e35=>_0x185e35['status']===_0x422d51(0x1d3))['length']??0x0,'conflicts':_0x513449?.[_0x422d51(0x1eb)][_0x422d51(0x1df)](_0x7a4b22=>_0x7a4b22[_0x422d51(0x171)]===_0x422d51(0x19c))['length']??0x0,'notAttempted':_0x513449?.[_0x422d51(0x1eb)][_0x422d51(0x1df)](_0x5ccd9e=>_0x5ccd9e['status']===_0x422d51(0x1cf))[_0x422d51(0x187)]??_0xc3c33c[_0x422d51(0x1eb)][_0x422d51(0x187)],'batches':_0x2a312e,'batchResults':_0x2cca81,'elapsedMs':Date[_0x422d51(0x1ea)]()-_0x3e1a7a,'checkpoint':resolve(_0x28021f[_0x422d51(0x1a4)]),'report':resolve(_0x28021f[_0x422d51(0x177)]),'warnings':_0xc3c33c[_0x422d51(0x1db)]});try{await rejectSymlink(_0x28021f[_0x422d51(0x1a4)]);if(_0x28021f[_0x422d51(0x1ae)]){try{_0x513449=JSON['parse'](await readFile(_0x28021f['checkpoint'],_0x422d51(0x175)));}catch{throw Error(_0x422d51(0x1f1));}if(!_0x513449||_0x513449[_0x422d51(0x1dc)]!==0x1||typeof _0x513449[_0x422d51(0x185)]!==_0x422d51(0x17f)||canonical(_0x513449[_0x422d51(0x172)])!==canonical(_0x30602e)||!Array['isArray'](_0x513449[_0x422d51(0x1eb)])||_0x513449[_0x422d51(0x1eb)]['length']!==_0xc3c33c[_0x422d51(0x1eb)]['length']||new Set(_0x513449[_0x422d51(0x1eb)]['map'](_0x145dcd=>_0x145dcd['id']))['size']!==_0x513449[_0x422d51(0x1eb)][_0x422d51(0x187)]||_0x513449[_0x422d51(0x1eb)][_0x422d51(0x1cc)]((_0x463558,_0xe13a82)=>!Number[_0x422d51(0x1a2)](_0x463558['id'])||_0x463558['id']>=0x0||_0x463558[_0x422d51(0x1c2)]!==_0xc3c33c['rows'][_0xe13a82][_0x422d51(0x1c2)]||![_0x422d51(0x1cf),'pending',_0x422d51(0x186),'conflict'][_0x422d51(0x19f)](_0x463558[_0x422d51(0x171)])))throw Error(_0x422d51(0x1ec));}else{try{await lstat(_0x28021f[_0x422d51(0x1a4)]);throw Error(_0x422d51(0x179));}catch(_0x1cb3fe){if(_0x1cb3fe[_0x422d51(0x1c3)]!=='ENOENT')throw _0x1cb3fe;}const _0x77473f=new Set();_0x513449={'version':0x1,'importId':randomUUID(),'binding':_0x30602e,'rows':_0xc3c33c[_0x422d51(0x1eb)][_0x422d51(0x1e8)](_0x33df61=>{const _0x5a71be=_0x422d51;let _0x5d8bd0;do{_0x5d8bd0=-(Number(BigInt('0x'+randomBytes(0x7)['toString'](_0x5a71be(0x17d)))&(0x1n<<0x34n)-0x1n)+0x1);}while(_0x77473f[_0x5a71be(0x1ca)](_0x5d8bd0));return _0x77473f[_0x5a71be(0x1cb)](_0x5d8bd0),{'id':_0x5d8bd0,'rowNumber':_0x33df61[_0x5a71be(0x1c2)],'status':'unsent'};})},await saveImportJson(_0x28021f[_0x422d51(0x1a4)],_0x513449);}await _0x28021f[_0x422d51(0x19e)]?.();const _0x1e078e=_0x513449;if(_0x1e078e[_0x422d51(0x1eb)][_0x422d51(0x1cc)](_0x32b80a=>_0x32b80a[_0x422d51(0x171)]==='conflict'))throw Error('Import\x20checkpoint\x20contains\x20a\x20content\x20conflict.');const _0x2af641=async _0x5b7e75=>{const _0x1466b3=_0x422d51,_0x33121a=await _0x35f8b2['readback'](_0x5b7e75[_0x1466b3(0x1e8)](_0xe94cf5=>_0x1e078e[_0x1466b3(0x1eb)][_0xe94cf5]['id']));if(!Array[_0x1466b3(0x18e)](_0x33121a))throw Error('Invalid\x20import\x20readback\x20response.');const _0x105b4d=new Set(_0x5b7e75[_0x1466b3(0x1e8)](_0x4d41fb=>_0x1e078e[_0x1466b3(0x1eb)][_0x4d41fb]['id'])),_0x1743ac=new Map();for(const _0x80fa47 of _0x33121a){const _0x281eff=Number(_0x80fa47?.['id']);if(!_0x105b4d[_0x1466b3(0x1ca)](_0x281eff)||_0x1743ac[_0x1466b3(0x1ca)](_0x281eff))throw Error(_0x1466b3(0x1b3));_0x1743ac[_0x1466b3(0x1ee)](_0x281eff,_0x80fa47);}for(const _0x4a076d of _0x5b7e75){const _0x142aa7=_0x1743ac[_0x1466b3(0x174)](_0x1e078e['rows'][_0x4a076d]['id']);if(!_0x142aa7)continue;if(_0x1e078e['rows'][_0x4a076d]['status']===_0x1466b3(0x1cf)){_0x1e078e[_0x1466b3(0x1eb)][_0x4a076d][_0x1466b3(0x171)]=_0x1466b3(0x19c),await saveImportJson(_0x28021f[_0x1466b3(0x1a4)],_0x1e078e);throw Error('Import\x20primary\x20key\x20collision;\x20stop\x20without\x20replacing\x20the\x20fixed\x20IDs.');}const _0x40497b=_0xc3c33c['rows'][_0x4a076d][_0x1466b3(0x16d)];if(Object['keys'](_0x40497b)[_0x1466b3(0x1cc)](_0x5c2467=>!sameImportValue(_0x40497b[_0x5c2467],_0x142aa7[_0x5c2467],_0xc3c33c[_0x1466b3(0x1ac)]?.[_0x1466b3(0x19f)](_0x5c2467)&&!_0xc3c33c[_0x1466b3(0x1ef)]?.[_0x1466b3(0x19f)](_0x5c2467)))){_0x1e078e[_0x1466b3(0x1eb)][_0x4a076d]['status']=_0x1466b3(0x19c),await saveImportJson(_0x28021f[_0x1466b3(0x1a4)],_0x1e078e);throw Error(_0x1466b3(0x16e)+_0x1e078e[_0x1466b3(0x1eb)][_0x4a076d][_0x1466b3(0x1c2)]+'.');}_0x1e078e[_0x1466b3(0x1eb)][_0x4a076d][_0x1466b3(0x171)]=_0x1466b3(0x186);}return await saveImportJson(_0x28021f['checkpoint'],_0x1e078e),_0x1743ac;};if(_0x28021f[_0x422d51(0x1ae)])for(let _0x46a20d=0x0;_0x46a20d<_0x1e078e[_0x422d51(0x1eb)][_0x422d51(0x187)];_0x46a20d+=_0x28021f[_0x422d51(0x1b9)]){const _0x5cdaf9=_0x1e078e['rows'][_0x422d51(0x173)](_0x46a20d,_0x46a20d+_0x28021f['batchSize'])['map']((_0x46dc15,_0x3f715c)=>_0x46a20d+_0x3f715c),_0x3d5bed=_0x5cdaf9[_0x422d51(0x1df)](_0xd54192=>_0x1e078e[_0x422d51(0x1eb)][_0xd54192]['status']===_0x422d51(0x186)),_0xde72d6=await _0x2af641(_0x5cdaf9),_0x3accbd=_0x3d5bed[_0x422d51(0x1df)](_0x503259=>!_0xde72d6['has'](_0x1e078e[_0x422d51(0x1eb)][_0x503259]['id']));if(_0x3accbd[_0x422d51(0x187)]){_0x3accbd['forEach'](_0x14d939=>{const _0x35c8f2=_0x422d51;_0x1e078e['rows'][_0x14d939][_0x35c8f2(0x171)]=_0x35c8f2(0x19c);}),await saveImportJson(_0x28021f['checkpoint'],_0x1e078e);throw Error(_0x422d51(0x1e2));}}for(let _0x56327a=0x0;_0x56327a<_0x1e078e['rows'][_0x422d51(0x187)];){const _0x5f3eb4=[],_0x250749=[];while(_0x56327a<_0x1e078e[_0x422d51(0x1eb)]['length']&&_0x250749[_0x422d51(0x187)]<_0x28021f[_0x422d51(0x1b9)]){const _0x56cedb=_0x56327a++;if(_0x1e078e['rows'][_0x56cedb]['status']===_0x422d51(0x186))continue;const _0x473864={..._0xc3c33c[_0x422d51(0x1eb)][_0x56cedb]['values'],'id':_0x1e078e[_0x422d51(0x1eb)][_0x56cedb]['id']};if(Buffer[_0x422d51(0x16a)](JSON[_0x422d51(0x1ce)]({'schemaFingerprint':_0x5b644d[_0x422d51(0x1bb)],'items':[..._0x250749,_0x473864]}),_0x422d51(0x175))>_0x5b644d[_0x422d51(0x1b5)]){if(!_0x250749['length'])throw Error('Excel\x20row\x20'+_0x1e078e['rows'][_0x56cedb][_0x422d51(0x1c2)]+_0x422d51(0x1a7));_0x56327a--;break;}_0x5f3eb4[_0x422d51(0x1f0)](_0x56cedb),_0x250749[_0x422d51(0x1f0)](_0x473864);}if(!_0x250749[_0x422d51(0x187)])continue;const _0x8cb9b8=_0x5f3eb4[_0x422d51(0x1df)](_0x557b06=>_0x1e078e['rows'][_0x557b06][_0x422d51(0x171)]===_0x422d51(0x1cf));if(_0x8cb9b8[_0x422d51(0x187)]){const _0x4d8ff1=await _0x35f8b2[_0x422d51(0x19b)](_0x8cb9b8[_0x422d51(0x1e8)](_0x3626ff=>_0x1e078e[_0x422d51(0x1eb)][_0x3626ff]['id']));if(!Array[_0x422d51(0x18e)](_0x4d8ff1))throw Error(_0x422d51(0x1be));if(_0x4d8ff1[_0x422d51(0x187)])throw Error(_0x422d51(0x1a9));}_0x5f3eb4[_0x422d51(0x1d2)](_0x428ceb=>{const _0x1991d3=_0x422d51;_0x1e078e[_0x1991d3(0x1eb)][_0x428ceb][_0x1991d3(0x171)]=_0x1991d3(0x1d3);}),await saveImportJson(_0x28021f[_0x422d51(0x1a4)],_0x1e078e),_0x2a312e++;const _0x42b8a8=Date[_0x422d51(0x1ea)](),_0x3411d6={'batch':_0x2a312e,'rowStart':_0x1e078e[_0x422d51(0x1eb)][_0x5f3eb4[0x0]]['rowNumber'],'rowEnd':_0x1e078e[_0x422d51(0x1eb)][_0x5f3eb4[_0x5f3eb4[_0x422d51(0x187)]-0x1]][_0x422d51(0x1c2)],'count':_0x250749[_0x422d51(0x187)],'bytes':Buffer['byteLength'](JSON[_0x422d51(0x1ce)]({'schemaFingerprint':_0x5b644d[_0x422d51(0x1bb)],'items':_0x250749}),_0x422d51(0x175)),'elapsedMs':0x0,'status':'unknown'};_0x2cca81['push'](_0x3411d6);try{const _0x525d1d=await _0x35f8b2[_0x422d51(0x192)](_0x250749);if(!_0x525d1d||_0x525d1d['count']!==_0x250749[_0x422d51(0x187)]||!Array[_0x422d51(0x18e)](_0x525d1d[_0x422d51(0x1bc)])||_0x525d1d[_0x422d51(0x1bc)][_0x422d51(0x187)]!==_0x250749[_0x422d51(0x187)]||_0x525d1d['ids'][_0x422d51(0x1cc)]((_0x2835c7,_0x107806)=>Number(_0x2835c7)!==_0x1e078e[_0x422d51(0x1eb)][_0x5f3eb4[_0x107806]]['id']))throw Error('Invalid\x20write\x20result.');await _0x2af641(_0x5f3eb4);if(_0x5f3eb4[_0x422d51(0x1cc)](_0x525ef1=>_0x1e078e['rows'][_0x525ef1]['status']!==_0x422d51(0x186)))throw Error(_0x422d51(0x1b4));}catch(_0x7a7d7d){if(_0x1e078e[_0x422d51(0x1eb)]['some'](_0x4824e7=>_0x4824e7['status']==='conflict'))throw _0x7a7d7d;try{await _0x2af641(_0x5f3eb4);}catch(_0x129769){if(_0x1e078e[_0x422d51(0x1eb)]['some'](_0x5332d6=>_0x5332d6[_0x422d51(0x171)]===_0x422d51(0x19c)))throw _0x129769;}if(_0x5f3eb4[_0x422d51(0x1cc)](_0x13a397=>_0x1e078e['rows'][_0x13a397][_0x422d51(0x171)]!==_0x422d51(0x186)))throw Error(_0x422d51(0x195));}finally{_0x3411d6[_0x422d51(0x1f2)]=Date[_0x422d51(0x1ea)]()-_0x42b8a8;if(_0x5f3eb4[_0x422d51(0x178)](_0x8542f3=>_0x1e078e['rows'][_0x8542f3][_0x422d51(0x171)]===_0x422d51(0x186)))_0x3411d6[_0x422d51(0x171)]=_0x422d51(0x186);else{if(_0x5f3eb4['some'](_0x4f912b=>_0x1e078e[_0x422d51(0x1eb)][_0x4f912b][_0x422d51(0x171)]==='conflict'))_0x3411d6[_0x422d51(0x171)]=_0x422d51(0x19c);}}}const _0x206e93={'status':_0x422d51(0x1aa),..._0x15d110()};return await saveImportJson(_0x28021f['report'],_0x206e93),_0x206e93;}catch(_0x78f6b4){if(_0x513449)await saveImportJson(_0x28021f['report'],{'status':'incomplete',..._0x15d110(),'message':_0x78f6b4[_0x422d51(0x182)]});throw _0x78f6b4;}finally{await _0x1a2321();}}
@@ -1 +1 @@
1
- const a149_0x589656=a149_0x136f;(function(_0xae6d10,_0x2d67b1){const _0x492646=a149_0x136f,_0xf3986f=_0xae6d10();while(!![]){try{const _0x599fbf=-parseInt(_0x492646(0xea))/0x1*(parseInt(_0x492646(0xf6))/0x2)+parseInt(_0x492646(0xe7))/0x3+parseInt(_0x492646(0xf9))/0x4+-parseInt(_0x492646(0xf8))/0x5+-parseInt(_0x492646(0x114))/0x6+-parseInt(_0x492646(0x100))/0x7+-parseInt(_0x492646(0x10a))/0x8*(-parseInt(_0x492646(0xee))/0x9);if(_0x599fbf===_0x2d67b1)break;else _0xf3986f['push'](_0xf3986f['shift']());}catch(_0x2821db){_0xf3986f['push'](_0xf3986f['shift']());}}}(a149_0x10bb,0x24afe));import{createHash}from'node:crypto';import{lstatSync,readFileSync,readdirSync}from'node:fs';import{homedir}from'node:os';import{dirname,join,relative,resolve,sep}from'node:path';import{fileURLToPath}from'node:url';import{debuglog}from'node:util';import{runNpxSkillsAddGlobal}from'../skills/npx-skills-add.js';import{resolveInstalledSkill}from'../skills/skill-presence.js';function a149_0x136f(_0x2ec78e,_0x32906b){_0x2ec78e=_0x2ec78e-0xe4;const _0x10bb3c=a149_0x10bb();let _0x136fe1=_0x10bb3c[_0x2ec78e];return _0x136fe1;}const DEFAULT_PACKAGE_ROOT=resolve(dirname(fileURLToPath(import.meta.url)),'..','..'),REPAIR_COMMAND=a149_0x589656(0x106),SKILL_NAME=a149_0x589656(0x11f),debug=debuglog(a149_0x589656(0xfc));function frontmatterValue(_0x50fc22,_0x157f6a){const _0x270e4e=a149_0x589656;return _0x50fc22[_0x270e4e(0x123)](new RegExp('^'+_0x157f6a+_0x270e4e(0xf3),'m'))?.[0x1]?.[_0x270e4e(0x11d)]()??'';}function listFiles(_0x2ee3b9,_0x2d8089=_0x2ee3b9){const _0x19cfc6=a149_0x589656;return readdirSync(_0x2d8089,{'withFileTypes':!![]})[_0x19cfc6(0xe6)](_0x51342e=>{const _0x3984b6=_0x19cfc6,_0x17300a=join(_0x2d8089,_0x51342e[_0x3984b6(0x10e)]),_0x456452=lstatSync(_0x17300a);if(_0x456452['isSymbolicLink']())throw new Error(_0x3984b6(0xf4)+_0x17300a);if(_0x456452[_0x3984b6(0xfb)]())return listFiles(_0x2ee3b9,_0x17300a);if(!_0x456452[_0x3984b6(0xff)]())throw new Error('Unsupported\x20Skill\x20entry:\x20'+_0x17300a);return[relative(_0x2ee3b9,_0x17300a)[_0x3984b6(0x11c)](sep)[_0x3984b6(0x113)]('/')];})[_0x19cfc6(0xe8)]((_0x3efc88,_0x5bcfd9)=>_0x3efc88<_0x5bcfd9?-0x1:_0x3efc88>_0x5bcfd9?0x1:0x0);}function digestFiles(_0x310cfc,_0x2edab9){const _0x2a2efb=a149_0x589656,_0x3e0420=createHash(_0x2a2efb(0x102));for(const _0x120cb2 of _0x2edab9){if(_0x120cb2[_0x2a2efb(0xf2)]('/')||_0x120cb2[_0x2a2efb(0x11c)]('/')[_0x2a2efb(0x121)]('..')||_0x120cb2['includes']('\x5c'))throw new Error('Unsafe\x20manifest\x20path:\x20'+_0x120cb2);_0x3e0420['update'](_0x120cb2),_0x3e0420[_0x2a2efb(0xf5)]('\x00'),_0x3e0420['update'](readFileSync(join(_0x310cfc,..._0x120cb2[_0x2a2efb(0x11c)]('/')))),_0x3e0420[_0x2a2efb(0xf5)]('\x00');}return _0x3e0420[_0x2a2efb(0x117)]('hex');}function sameFiles(_0x4fc992,_0x534a45){const _0x464d5c=a149_0x589656;return _0x4fc992[_0x464d5c(0xed)]===_0x534a45[_0x464d5c(0xed)]&&_0x4fc992['every']((_0x5aac2c,_0x53fdb6)=>_0x5aac2c===_0x534a45[_0x53fdb6]);}function readSource(_0x4cc67a){const _0x2fc445=a149_0x589656,_0x579eae=JSON['parse'](readFileSync(join(_0x4cc67a,'package.json'),_0x2fc445(0xfe))),_0x219bed=JSON[_0x2fc445(0x10b)](readFileSync(join(_0x4cc67a,'skills',_0x2fc445(0xfd)),_0x2fc445(0xfe))),_0x1b0d57=join(_0x4cc67a,_0x2fc445(0x104),SKILL_NAME),_0x2119cf=frontmatterValue(readFileSync(join(_0x1b0d57,_0x2fc445(0x122)),_0x2fc445(0xfe)),_0x2fc445(0x111)),_0x25f729=listFiles(_0x1b0d57);if(_0x219bed[_0x2fc445(0xef)]!==0x1||_0x219bed[_0x2fc445(0x10e)]!==SKILL_NAME||!_0x579eae['version']||_0x219bed[_0x2fc445(0x125)]!==_0x579eae[_0x2fc445(0x111)]||_0x219bed['skillVersion']!==_0x579eae[_0x2fc445(0x111)]||_0x2119cf!==_0x579eae[_0x2fc445(0x111)]||!sameFiles(_0x25f729,_0x219bed[_0x2fc445(0x107)])||digestFiles(_0x1b0d57,_0x25f729)!==_0x219bed[_0x2fc445(0x117)])throw new Error('Built-in\x20Skill\x20source\x20does\x20not\x20match\x20its\x20package\x20manifest');return{'packageVersion':_0x579eae[_0x2fc445(0x111)],'skillVersion':_0x2119cf,'root':_0x1b0d57,'manifest':_0x219bed};}function installedSkillPath(_0x290234){const _0x245363=a149_0x589656,_0x4ca35c=resolveInstalledSkill(SKILL_NAME,{'home':_0x290234});if(_0x4ca35c[_0x245363(0x118)]===_0x245363(0xfa))return{'state':_0x245363(0xfa),'path':dirname(_0x4ca35c[_0x245363(0x10c)])};if(_0x4ca35c[_0x245363(0x118)]===_0x245363(0x126))return{'state':'missing'};return{'state':_0x245363(0x119),'reason':_0x4ca35c[_0x245363(0x105)]};}function a149_0x10bb(){const _0x385e2b=['25391cLToxb','pipe','home','length','4432851uranYc','schemaVersion','SOURCE_INVALID','missing','startsWith',':\x5cs*(.+)$','Symbolic\x20link\x20is\x20not\x20allowed:\x20','update','4FoaANu','log','1105735KmiQfr','550992UgyiqB','present','isDirectory','lovrabet-skills','lovrabet.manifest.json','utf8','isFile','1447145mhhYIN','manifest','sha256','unknown','skills','reason','lovrabet\x20cli-skill\x20install','files','CLI\x20Built-in\x20Skill\x20','installedPath','8yrpPWm','parse','path','version_mismatch','name','Installed\x20Skill\x20state\x20is\x20','count','version','partialFailure','join','679344xDbGfl','root','current','digest','state','unverifiable','message','VERIFY_FAILED','split','trim','skipped','lovrabet','skillVersion','includes','SKILL.md','match','packageRoot','packageVersion','absent','skills@latest\x20exited\x20','\x20automatically\x20selected\x20installation\x20target(s)\x20could\x20not\x20be\x20installed.','output','flatMap','335613RvNTzj','sort','INSTALL_FAILED'];a149_0x10bb=function(){return _0x385e2b;};return a149_0x10bb();}export function inspectInstalledBuiltinSkillVersion(_0x56c49d,_0x2e31bf={}){const _0x4e7e2e=a149_0x589656,_0x1242dd=installedSkillPath(_0x2e31bf[_0x4e7e2e(0xec)]??homedir());if(_0x1242dd[_0x4e7e2e(0x118)]==='missing')return{'state':_0x4e7e2e(0xf1),'expectedVersion':_0x56c49d,'repairCommand':REPAIR_COMMAND};if(_0x1242dd[_0x4e7e2e(0x118)]===_0x4e7e2e(0x119))return{'state':_0x4e7e2e(0x119),'expectedVersion':_0x56c49d,'reason':_0x1242dd[_0x4e7e2e(0x105)],'repairCommand':REPAIR_COMMAND};try{const _0x20fc0f=frontmatterValue(readFileSync(join(_0x1242dd['path'],'SKILL.md'),_0x4e7e2e(0xfe)),_0x4e7e2e(0x111));return{'state':_0x20fc0f===_0x56c49d?'current':_0x4e7e2e(0x10d),'expectedVersion':_0x56c49d,'skillVersion':_0x20fc0f,'installedPath':_0x1242dd[_0x4e7e2e(0x10c)],'repairCommand':REPAIR_COMMAND};}catch(_0x5588ba){return{'state':_0x4e7e2e(0x119),'expectedVersion':_0x56c49d,'installedPath':_0x1242dd[_0x4e7e2e(0x10c)],'reason':_0x5588ba instanceof Error?_0x5588ba[_0x4e7e2e(0x11a)]:String(_0x5588ba),'repairCommand':REPAIR_COMMAND};}}export function inspectBuiltinSkill(_0x3875cf={}){const _0xede56d=a149_0x589656,_0xd70842=_0x3875cf[_0xede56d(0x124)]??DEFAULT_PACKAGE_ROOT;let _0x1d559c;try{_0x1d559c=readSource(_0xd70842);}catch(_0x1595b6){return{'state':_0xede56d(0x119),'packageVersion':_0xede56d(0x103),'reason':_0x1595b6 instanceof Error?_0x1595b6[_0xede56d(0x11a)]:String(_0x1595b6),'repairCommand':REPAIR_COMMAND};}const _0x1f9b4a=installedSkillPath(_0x3875cf['home']??homedir());if(_0x1f9b4a['state']===_0xede56d(0xf1))return{'state':_0xede56d(0xf1),'packageVersion':_0x1d559c[_0xede56d(0x125)],'repairCommand':REPAIR_COMMAND};if(_0x1f9b4a['state']===_0xede56d(0x119))return{'state':'unverifiable','packageVersion':_0x1d559c[_0xede56d(0x125)],'reason':_0x1f9b4a[_0xede56d(0x105)],'repairCommand':REPAIR_COMMAND};try{const _0x148354=frontmatterValue(readFileSync(join(_0x1f9b4a['path'],'SKILL.md'),_0xede56d(0xfe)),_0xede56d(0x111));if(_0x148354!==_0x1d559c['skillVersion'])return{'state':_0xede56d(0x10d),'packageVersion':_0x1d559c[_0xede56d(0x125)],'skillVersion':_0x148354,'installedPath':_0x1f9b4a[_0xede56d(0x10c)],'repairCommand':REPAIR_COMMAND};const _0x1e0ebf=listFiles(_0x1f9b4a['path']),_0x40cc4c=digestFiles(_0x1f9b4a[_0xede56d(0x10c)],_0x1e0ebf);return{'state':sameFiles(_0x1e0ebf,_0x1d559c[_0xede56d(0x101)][_0xede56d(0x107)])&&_0x40cc4c===_0x1d559c[_0xede56d(0x101)]['digest']?'current':'content_mismatch','packageVersion':_0x1d559c['packageVersion'],'skillVersion':_0x148354,'installedPath':_0x1f9b4a['path'],'digest':_0x40cc4c,'repairCommand':REPAIR_COMMAND};}catch(_0x39dcca){return{'state':_0xede56d(0x119),'packageVersion':_0x1d559c[_0xede56d(0x125)],'installedPath':_0x1f9b4a[_0xede56d(0x10c)],'reason':_0x39dcca instanceof Error?_0x39dcca[_0xede56d(0x11a)]:String(_0x39dcca),'repairCommand':REPAIR_COMMAND};}}function failure(_0x494e09,_0x206a02,_0x4fc23e,_0xbe8c62){const _0xa96389=a149_0x589656;return{'ok':![],'code':_0x494e09,'packageVersion':_0x206a02[_0xa96389(0x125)],'skillVersion':_0x206a02['skillVersion'],'installedPath':_0xbe8c62,'changed':![],'repairCommand':REPAIR_COMMAND,'error':_0x4fc23e instanceof Error?_0x4fc23e['message']:String(_0x4fc23e)};}export function installBuiltinSkill(_0x1d2ddb={}){const _0x18d85b=a149_0x589656,_0x40d02f=_0x1d2ddb[_0x18d85b(0x124)]??DEFAULT_PACKAGE_ROOT,_0xd04560=_0x1d2ddb[_0x18d85b(0xec)]??homedir();let _0x3299cb;try{_0x3299cb=readSource(_0x40d02f);}catch(_0x192100){return failure(_0x18d85b(0xf0),{'packageVersion':_0x18d85b(0x103),'skillVersion':'unknown'},_0x192100);}const _0x1735b8=inspectBuiltinSkill({'packageRoot':_0x40d02f,'home':_0xd04560}),_0x48a9eb=runNpxSkillsAddGlobal(_0x40d02f,_0x3299cb[_0x18d85b(0x115)],{'stdio':_0x1d2ddb['stdio']??_0x18d85b(0xeb),'expectedSkillName':SKILL_NAME,'presence':{'home':_0xd04560}});if(_0x48a9eb[_0x18d85b(0x11e)])return{'ok':!![],'packageVersion':_0x3299cb[_0x18d85b(0x125)],'skillVersion':_0x3299cb['skillVersion'],'installedPath':_0x1735b8[_0x18d85b(0x109)],'changed':![],'repairCommand':REPAIR_COMMAND};if(!_0x48a9eb['ok'])return failure(_0x18d85b(0xe9),_0x3299cb,_0x48a9eb['error']??_0x18d85b(0x127)+_0x48a9eb['status']);const _0xd1b6c=inspectBuiltinSkill({'packageRoot':_0x40d02f,'home':_0xd04560});if(_0xd1b6c[_0x18d85b(0x118)]!==_0x18d85b(0x116)){const _0x21dc4a=_0xd1b6c[_0x18d85b(0x105)]??_0x18d85b(0x10f)+_0xd1b6c[_0x18d85b(0x118)];return failure(_0x18d85b(0x11b),_0x3299cb,_0x48a9eb[_0x18d85b(0x112)]?_0x21dc4a+'\x0a'+_0x48a9eb[_0x18d85b(0x112)][_0x18d85b(0xe5)]:_0x21dc4a,_0xd1b6c[_0x18d85b(0x109)]);}return _0x48a9eb['partialFailure']&&(debug('Installer\x20reported\x20partial\x20target\x20failures:\x0a%s',_0x48a9eb['partialFailure']['output']),console[_0x18d85b(0xf7)](_0x18d85b(0x108)+_0x3299cb[_0x18d85b(0x120)]+'\x20verified;\x20'+_0x48a9eb['partialFailure'][_0x18d85b(0x110)]+_0x18d85b(0xe4))),{'ok':!![],'packageVersion':_0x3299cb[_0x18d85b(0x125)],'skillVersion':_0x3299cb[_0x18d85b(0x120)],'installedPath':_0xd1b6c[_0x18d85b(0x109)],'changed':_0x1735b8['state']!==_0x18d85b(0x116),'repairCommand':REPAIR_COMMAND};}
1
+ const a152_0xafdf57=a152_0x3c08;(function(_0x25db33,_0x2970a0){const _0x286b2c=a152_0x3c08,_0x53ec9a=_0x25db33();while(!![]){try{const _0x4e6132=parseInt(_0x286b2c(0x164))/0x1*(parseInt(_0x286b2c(0x138))/0x2)+-parseInt(_0x286b2c(0x135))/0x3+parseInt(_0x286b2c(0x149))/0x4+-parseInt(_0x286b2c(0x12f))/0x5*(-parseInt(_0x286b2c(0x167))/0x6)+-parseInt(_0x286b2c(0x140))/0x7*(-parseInt(_0x286b2c(0x14d))/0x8)+-parseInt(_0x286b2c(0x146))/0x9+parseInt(_0x286b2c(0x16d))/0xa;if(_0x4e6132===_0x2970a0)break;else _0x53ec9a['push'](_0x53ec9a['shift']());}catch(_0x473f9b){_0x53ec9a['push'](_0x53ec9a['shift']());}}}(a152_0x56b8,0x67b92));import{createHash}from'node:crypto';import{lstatSync,readFileSync,readdirSync}from'node:fs';import{homedir}from'node:os';import{dirname,join,relative,resolve,sep}from'node:path';import{fileURLToPath}from'node:url';import{debuglog}from'node:util';import{runNpxSkillsAddGlobal}from'../skills/npx-skills-add.js';import{resolveInstalledSkill}from'../skills/skill-presence.js';const DEFAULT_PACKAGE_ROOT=resolve(dirname(fileURLToPath(import.meta.url)),'..','..'),REPAIR_COMMAND=a152_0xafdf57(0x16a),SKILL_NAME=a152_0xafdf57(0x153),debug=debuglog(a152_0xafdf57(0x15b));function frontmatterValue(_0x4dd79b,_0xa23350){const _0x4d1c82=a152_0xafdf57;return _0x4dd79b[_0x4d1c82(0x152)](new RegExp('^'+_0xa23350+_0x4d1c82(0x12e),'m'))?.[0x1]?.['trim']()??'';}function listFiles(_0x5c2255,_0x35e083=_0x5c2255){const _0x4a08c7=a152_0xafdf57;return readdirSync(_0x35e083,{'withFileTypes':!![]})[_0x4a08c7(0x14b)](_0x16f69e=>{const _0x64689e=_0x4a08c7,_0x285791=join(_0x35e083,_0x16f69e[_0x64689e(0x132)]),_0x1edee8=lstatSync(_0x285791);if(_0x1edee8['isSymbolicLink']())throw new Error('Symbolic\x20link\x20is\x20not\x20allowed:\x20'+_0x285791);if(_0x1edee8[_0x64689e(0x144)]())return listFiles(_0x5c2255,_0x285791);if(!_0x1edee8['isFile']())throw new Error(_0x64689e(0x150)+_0x285791);return[relative(_0x5c2255,_0x285791)['split'](sep)[_0x64689e(0x159)]('/')];})[_0x4a08c7(0x163)]((_0x2cfdc4,_0x400e41)=>_0x2cfdc4<_0x400e41?-0x1:_0x2cfdc4>_0x400e41?0x1:0x0);}function a152_0x3c08(_0x14b232,_0x4c5ac3){_0x14b232=_0x14b232-0x12e;const _0x56b8c7=a152_0x56b8();let _0x3c08f6=_0x56b8c7[_0x14b232];return _0x3c08f6;}function digestFiles(_0x54c2d0,_0x3aae5a){const _0x13c728=a152_0xafdf57,_0x44a5e6=createHash(_0x13c728(0x168));for(const _0x486036 of _0x3aae5a){if(_0x486036['startsWith']('/')||_0x486036[_0x13c728(0x148)]('/')['includes']('..')||_0x486036[_0x13c728(0x151)]('\x5c'))throw new Error(_0x13c728(0x13f)+_0x486036);_0x44a5e6[_0x13c728(0x15c)](_0x486036),_0x44a5e6[_0x13c728(0x15c)]('\x00'),_0x44a5e6[_0x13c728(0x15c)](readFileSync(join(_0x54c2d0,..._0x486036[_0x13c728(0x148)]('/')))),_0x44a5e6[_0x13c728(0x15c)]('\x00');}return _0x44a5e6[_0x13c728(0x166)](_0x13c728(0x13a));}function sameFiles(_0xd36044,_0x58309b){const _0x410d95=a152_0xafdf57;return _0xd36044[_0x410d95(0x16f)]===_0x58309b[_0x410d95(0x16f)]&&_0xd36044[_0x410d95(0x170)]((_0x454052,_0x3b58ee)=>_0x454052===_0x58309b[_0x3b58ee]);}function readSource(_0x5b47f5){const _0x5c4ab0=a152_0xafdf57,_0xe74ca2=JSON[_0x5c4ab0(0x13e)](readFileSync(join(_0x5b47f5,_0x5c4ab0(0x154)),_0x5c4ab0(0x130))),_0x512c6e=JSON[_0x5c4ab0(0x13e)](readFileSync(join(_0x5b47f5,'skills',_0x5c4ab0(0x160)),_0x5c4ab0(0x130))),_0x3a6109=join(_0x5b47f5,_0x5c4ab0(0x141),SKILL_NAME),_0x5cc3c0=frontmatterValue(readFileSync(join(_0x3a6109,_0x5c4ab0(0x143)),_0x5c4ab0(0x130)),'version'),_0x4fb956=listFiles(_0x3a6109);if(_0x512c6e[_0x5c4ab0(0x169)]!==0x1||_0x512c6e[_0x5c4ab0(0x132)]!==SKILL_NAME||!_0xe74ca2['version']||_0x512c6e[_0x5c4ab0(0x155)]!==_0xe74ca2['version']||_0x512c6e[_0x5c4ab0(0x15f)]!==_0xe74ca2[_0x5c4ab0(0x131)]||_0x5cc3c0!==_0xe74ca2['version']||!sameFiles(_0x4fb956,_0x512c6e[_0x5c4ab0(0x175)])||digestFiles(_0x3a6109,_0x4fb956)!==_0x512c6e[_0x5c4ab0(0x166)])throw new Error(_0x5c4ab0(0x171));return{'packageVersion':_0xe74ca2[_0x5c4ab0(0x131)],'skillVersion':_0x5cc3c0,'root':_0x3a6109,'manifest':_0x512c6e};}function a152_0x56b8(){const _0x50ccf4=['current','skillVersion','lovrabet.manifest.json','home','content_mismatch','sort','161765TyxSBv','VERIFY_FAILED','digest','6mvWJIZ','sha256','schemaVersion','lovrabet\x20cli-skill\x20install','count','stdio','2094960oGMbKs','skipped','length','every','Built-in\x20Skill\x20source\x20does\x20not\x20match\x20its\x20package\x20manifest','INSTALL_FAILED','packageRoot','skills@latest\x20exited\x20','files',':\x5cs*(.+)$','1542440MiUcKj','utf8','version','name','error','partialFailure','2136435FdPXzL','\x20automatically\x20selected\x20installation\x20target(s)\x20could\x20not\x20be\x20installed.','missing','4mbBBhm','Installed\x20Skill\x20state\x20is\x20','hex','path','Installer\x20reported\x20partial\x20target\x20failures:\x0a%s','message','parse','Unsafe\x20manifest\x20path:\x20','3129371GNhEBg','skills','unknown','SKILL.md','isDirectory','CLI\x20Built-in\x20Skill\x20','4197969WIFQVI','manifest','split','1259476bumDGJ','log','flatMap','installedPath','8atyiVc','version_mismatch','reason','Unsupported\x20Skill\x20entry:\x20','includes','match','lovrabet','package.json','packageVersion','present','\x20verified;\x20','root','join','state','lovrabet-skills','update','unverifiable'];a152_0x56b8=function(){return _0x50ccf4;};return a152_0x56b8();}function installedSkillPath(_0x374057){const _0x4ca96f=a152_0xafdf57,_0x1c34fc=resolveInstalledSkill(SKILL_NAME,{'home':_0x374057});if(_0x1c34fc['state']===_0x4ca96f(0x156))return{'state':_0x4ca96f(0x156),'path':dirname(_0x1c34fc[_0x4ca96f(0x13b)])};if(_0x1c34fc[_0x4ca96f(0x15a)]==='absent')return{'state':'missing'};return{'state':_0x4ca96f(0x15d),'reason':_0x1c34fc[_0x4ca96f(0x14f)]};}export function inspectInstalledBuiltinSkillVersion(_0x229446,_0x11806a={}){const _0x38db2e=a152_0xafdf57,_0x44ec2b=installedSkillPath(_0x11806a[_0x38db2e(0x161)]??homedir());if(_0x44ec2b[_0x38db2e(0x15a)]==='missing')return{'state':_0x38db2e(0x137),'expectedVersion':_0x229446,'repairCommand':REPAIR_COMMAND};if(_0x44ec2b['state']===_0x38db2e(0x15d))return{'state':'unverifiable','expectedVersion':_0x229446,'reason':_0x44ec2b[_0x38db2e(0x14f)],'repairCommand':REPAIR_COMMAND};try{const _0x35ef5e=frontmatterValue(readFileSync(join(_0x44ec2b['path'],_0x38db2e(0x143)),_0x38db2e(0x130)),_0x38db2e(0x131));return{'state':_0x35ef5e===_0x229446?_0x38db2e(0x15e):_0x38db2e(0x14e),'expectedVersion':_0x229446,'skillVersion':_0x35ef5e,'installedPath':_0x44ec2b[_0x38db2e(0x13b)],'repairCommand':REPAIR_COMMAND};}catch(_0x3e3a4f){return{'state':'unverifiable','expectedVersion':_0x229446,'installedPath':_0x44ec2b['path'],'reason':_0x3e3a4f instanceof Error?_0x3e3a4f[_0x38db2e(0x13d)]:String(_0x3e3a4f),'repairCommand':REPAIR_COMMAND};}}export function inspectBuiltinSkill(_0x3da974={}){const _0x48d1bf=a152_0xafdf57,_0x441afe=_0x3da974[_0x48d1bf(0x173)]??DEFAULT_PACKAGE_ROOT;let _0x560e75;try{_0x560e75=readSource(_0x441afe);}catch(_0x172465){return{'state':_0x48d1bf(0x15d),'packageVersion':_0x48d1bf(0x142),'reason':_0x172465 instanceof Error?_0x172465[_0x48d1bf(0x13d)]:String(_0x172465),'repairCommand':REPAIR_COMMAND};}const _0xbe9009=installedSkillPath(_0x3da974[_0x48d1bf(0x161)]??homedir());if(_0xbe9009[_0x48d1bf(0x15a)]===_0x48d1bf(0x137))return{'state':_0x48d1bf(0x137),'packageVersion':_0x560e75[_0x48d1bf(0x155)],'repairCommand':REPAIR_COMMAND};if(_0xbe9009[_0x48d1bf(0x15a)]===_0x48d1bf(0x15d))return{'state':_0x48d1bf(0x15d),'packageVersion':_0x560e75[_0x48d1bf(0x155)],'reason':_0xbe9009[_0x48d1bf(0x14f)],'repairCommand':REPAIR_COMMAND};try{const _0xc4806c=frontmatterValue(readFileSync(join(_0xbe9009[_0x48d1bf(0x13b)],_0x48d1bf(0x143)),_0x48d1bf(0x130)),_0x48d1bf(0x131));if(_0xc4806c!==_0x560e75[_0x48d1bf(0x15f)])return{'state':_0x48d1bf(0x14e),'packageVersion':_0x560e75[_0x48d1bf(0x155)],'skillVersion':_0xc4806c,'installedPath':_0xbe9009[_0x48d1bf(0x13b)],'repairCommand':REPAIR_COMMAND};const _0xf4a495=listFiles(_0xbe9009[_0x48d1bf(0x13b)]),_0x4ccf56=digestFiles(_0xbe9009[_0x48d1bf(0x13b)],_0xf4a495);return{'state':sameFiles(_0xf4a495,_0x560e75[_0x48d1bf(0x147)][_0x48d1bf(0x175)])&&_0x4ccf56===_0x560e75[_0x48d1bf(0x147)][_0x48d1bf(0x166)]?_0x48d1bf(0x15e):_0x48d1bf(0x162),'packageVersion':_0x560e75[_0x48d1bf(0x155)],'skillVersion':_0xc4806c,'installedPath':_0xbe9009[_0x48d1bf(0x13b)],'digest':_0x4ccf56,'repairCommand':REPAIR_COMMAND};}catch(_0x57257f){return{'state':'unverifiable','packageVersion':_0x560e75[_0x48d1bf(0x155)],'installedPath':_0xbe9009[_0x48d1bf(0x13b)],'reason':_0x57257f instanceof Error?_0x57257f[_0x48d1bf(0x13d)]:String(_0x57257f),'repairCommand':REPAIR_COMMAND};}}function failure(_0x167caf,_0x4f695f,_0x5a4a18,_0x13b52f){const _0x55e6c8=a152_0xafdf57;return{'ok':![],'code':_0x167caf,'packageVersion':_0x4f695f[_0x55e6c8(0x155)],'skillVersion':_0x4f695f[_0x55e6c8(0x15f)],'installedPath':_0x13b52f,'changed':![],'repairCommand':REPAIR_COMMAND,'error':_0x5a4a18 instanceof Error?_0x5a4a18[_0x55e6c8(0x13d)]:String(_0x5a4a18)};}export function installBuiltinSkill(_0x270099={}){const _0x261ca1=a152_0xafdf57,_0x352a64=_0x270099[_0x261ca1(0x173)]??DEFAULT_PACKAGE_ROOT,_0x5b1d8f=_0x270099[_0x261ca1(0x161)]??homedir();let _0x2186ee;try{_0x2186ee=readSource(_0x352a64);}catch(_0x6b48b3){return failure('SOURCE_INVALID',{'packageVersion':_0x261ca1(0x142),'skillVersion':_0x261ca1(0x142)},_0x6b48b3);}const _0x23dcd7=inspectBuiltinSkill({'packageRoot':_0x352a64,'home':_0x5b1d8f}),_0x19332f=runNpxSkillsAddGlobal(_0x352a64,_0x2186ee[_0x261ca1(0x158)],{'stdio':_0x270099[_0x261ca1(0x16c)]??'pipe','expectedSkillName':SKILL_NAME,'presence':{'home':_0x5b1d8f}});if(_0x19332f[_0x261ca1(0x16e)])return{'ok':!![],'packageVersion':_0x2186ee[_0x261ca1(0x155)],'skillVersion':_0x2186ee[_0x261ca1(0x15f)],'installedPath':_0x23dcd7[_0x261ca1(0x14c)],'changed':![],'repairCommand':REPAIR_COMMAND};if(!_0x19332f['ok'])return failure(_0x261ca1(0x172),_0x2186ee,_0x19332f[_0x261ca1(0x133)]??_0x261ca1(0x174)+_0x19332f['status']);const _0x50b8fc=inspectBuiltinSkill({'packageRoot':_0x352a64,'home':_0x5b1d8f});if(_0x50b8fc[_0x261ca1(0x15a)]!==_0x261ca1(0x15e)){const _0x176825=_0x50b8fc[_0x261ca1(0x14f)]??_0x261ca1(0x139)+_0x50b8fc[_0x261ca1(0x15a)];return failure(_0x261ca1(0x165),_0x2186ee,_0x19332f[_0x261ca1(0x134)]?_0x176825+'\x0a'+_0x19332f['partialFailure']['output']:_0x176825,_0x50b8fc['installedPath']);}return _0x19332f[_0x261ca1(0x134)]&&(debug(_0x261ca1(0x13c),_0x19332f[_0x261ca1(0x134)]['output']),console[_0x261ca1(0x14a)](_0x261ca1(0x145)+_0x2186ee['skillVersion']+_0x261ca1(0x157)+_0x19332f[_0x261ca1(0x134)][_0x261ca1(0x16b)]+_0x261ca1(0x136))),{'ok':!![],'packageVersion':_0x2186ee[_0x261ca1(0x155)],'skillVersion':_0x2186ee[_0x261ca1(0x15f)],'installedPath':_0x50b8fc[_0x261ca1(0x14c)],'changed':_0x23dcd7[_0x261ca1(0x15a)]!==_0x261ca1(0x15e),'repairCommand':REPAIR_COMMAND};}
@@ -1 +1 @@
1
- const a150_0x3e1709=a150_0x1ad2;(function(_0x50d9de,_0xc8b4e0){const _0x3ea217=a150_0x1ad2,_0x3db91c=_0x50d9de();while(!![]){try{const _0x134f36=-parseInt(_0x3ea217(0x193))/0x1*(parseInt(_0x3ea217(0x16a))/0x2)+parseInt(_0x3ea217(0x171))/0x3*(parseInt(_0x3ea217(0x18e))/0x4)+-parseInt(_0x3ea217(0x184))/0x5*(-parseInt(_0x3ea217(0x18d))/0x6)+-parseInt(_0x3ea217(0x16c))/0x7+parseInt(_0x3ea217(0x190))/0x8+-parseInt(_0x3ea217(0x194))/0x9*(-parseInt(_0x3ea217(0x170))/0xa)+-parseInt(_0x3ea217(0x199))/0xb;if(_0x134f36===_0xc8b4e0)break;else _0x3db91c['push'](_0x3db91c['shift']());}catch(_0x15f3bd){_0x3db91c['push'](_0x3db91c['shift']());}}}(a150_0x2554,0x6b255));function a150_0x2554(){const _0x336cf9=['\x20failed\x20target(s)','1191396TGcPQP','2264PcMtSN','NPM_CONFIG_GLOBAL','748824nBreSU','unknown','npx\x20failed\x20to\x20start','305601SlPhoo','256518yoPQLs','signal','join','npx\x20terminated\x20by\x20signal\x20','stdio','8921sBqhos','globalSkillName','internalSkillSource','SKILL_NOT_INSTALLED','4SEbNLg','shortMessage','711515ukpyHV','Installer\x20reported\x20','stderr','npm_config_global','170yCVxkd','1992NDdLLX','match','partialFailure','CHILD_TERMINATED','!\x20Could\x20not\x20verify\x20\x22','stdout','log','expectedSkillName','skipNpxSkillsEnvSuffix','npx','Skill\x20\x22','absent','EACCES','code','pipe','message','trim','INSTALL_PARTIAL','add','5rdwFWW','ENOENT','SPAWN_FAILED','present','failed','checked','state','PERMISSION_DENIED'];a150_0x2554=function(){return _0x336cf9;};return a150_0x2554();}import{execaSync}from'execa';function a150_0x1ad2(_0x4088f5,_0x445577){_0x4088f5=_0x4088f5-0x168;const _0x255491=a150_0x2554();let _0x1ad23c=_0x255491[_0x4088f5];return _0x1ad23c;}import{LOVRABET_SKILL_SOURCE as a150_0x3a7705}from'../constant/distribution.js';import{PRODUCT_CONFIG,productEnvName}from'../constant/product.js';import{resolveInstalledSkill}from'../skills/skill-presence.js';export const LOVRABET_SKILL_SOURCE=a150_0x3a7705;export const LOVRABET_SKILL_GIT_SOURCE=PRODUCT_CONFIG[a150_0x3e1709(0x168)];export const LOVRABET_GLOBAL_SKILL_NAME=PRODUCT_CONFIG[a150_0x3e1709(0x19a)];export function resolveGlobalSkillName(_0x500524){const _0x333158=a150_0x3e1709;switch(_0x500524[_0x333158(0x181)]()){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[a150_0x3e1709(0x179)]);const CHILD_OUTPUT_MAX_BUFFER=0x10*0x400*0x400;function failure(_0x569a09,_0xb316f1,_0x499a4c){return{'ok':![],'status':_0xb316f1,'code':_0x569a09,'error':'['+_0x569a09+']\x20'+_0x499a4c};}export function shouldSkipNpxSkillsAdd(){return process.env[LOVRABET_SKIP_NPX_SKILLS_ENV]==='1';}export function runNpxSkillsAddGlobal(_0x57ed75,_0x383c94=LOVRABET_SKILL_SOURCE,_0x2113d5){const _0x8fce8b=a150_0x3e1709;if(shouldSkipNpxSkillsAdd())return{'ok':!![],'status':0x0,'skipped':!![]};const _0x3fef98=['-y','skills@latest',_0x8fce8b(0x183),_0x383c94,'-g','-y'],_0x29ec72=['npx',..._0x3fef98]['join']('\x20');console[_0x8fce8b(0x177)]('*\x20'+_0x29ec72);const _0x73bd4d={...process.env};delete _0x73bd4d[_0x8fce8b(0x16f)],delete _0x73bd4d[_0x8fce8b(0x18f)];const _0x17faf0=execaSync(_0x8fce8b(0x17a),_0x3fef98,{'cwd':_0x57ed75,'stdio':_0x8fce8b(0x17f),'env':_0x73bd4d,'extendEnv':![],'shell':![],'reject':![],'maxBuffer':CHILD_OUTPUT_MAX_BUFFER}),_0x2f1fac=[_0x17faf0[_0x8fce8b(0x176)]?String(_0x17faf0['stdout']):'',_0x17faf0[_0x8fce8b(0x16e)]?String(_0x17faf0[_0x8fce8b(0x16e)]):'']['filter'](Boolean)[_0x8fce8b(0x196)]('\x0a')[_0x8fce8b(0x181)](),_0x2bc540=_0x17faf0['exitCode']??null,_0x22ae5f=_0x2c74b6=>{const _0x4dbcc7=_0x8fce8b;return _0x2113d5?.[_0x4dbcc7(0x198)]!==_0x4dbcc7(0x17f)&&!_0x2c74b6[_0x4dbcc7(0x173)]&&_0x2f1fac&&console[_0x4dbcc7(0x177)](_0x2f1fac),_0x2c74b6;};if(_0x17faf0[_0x8fce8b(0x17e)]){const _0x12acc9=_0x17faf0[_0x8fce8b(0x17e)]===_0x8fce8b(0x185)?'NPX_NOT_FOUND':_0x17faf0[_0x8fce8b(0x17e)]==='EPERM'||_0x17faf0[_0x8fce8b(0x17e)]===_0x8fce8b(0x17d)?_0x8fce8b(0x18b):'SPAWN_FAILED';return _0x22ae5f(failure(_0x12acc9,_0x2bc540,_0x17faf0[_0x8fce8b(0x16b)]??_0x17faf0[_0x8fce8b(0x180)]??_0x17faf0[_0x8fce8b(0x17e)]));}if(_0x17faf0[_0x8fce8b(0x195)])return _0x22ae5f(failure(_0x8fce8b(0x174),_0x2bc540,_0x8fce8b(0x197)+_0x17faf0[_0x8fce8b(0x195)]));if(_0x17faf0[_0x8fce8b(0x188)]&&_0x2bc540===null)return _0x22ae5f(failure(_0x8fce8b(0x186),_0x2bc540,_0x17faf0[_0x8fce8b(0x16b)]??_0x17faf0['message']??_0x8fce8b(0x192)));if(_0x2bc540!==0x0)return _0x22ae5f(failure('CHILD_EXIT_NONZERO',_0x2bc540,_0x2f1fac||_0x17faf0[_0x8fce8b(0x16b)]||'exit\x20'+(_0x2bc540??_0x8fce8b(0x191))));const _0x17eb83=_0x2113d5?.[_0x8fce8b(0x178)]??resolveGlobalSkillName(_0x383c94),_0x53b8dd=_0x17eb83?resolveInstalledSkill(_0x17eb83,_0x2113d5?.['presence']):undefined,_0x4eabc8=_0x2f1fac[_0x8fce8b(0x172)](/Failed to install\s+(\d+)/i);if(_0x4eabc8&&Number(_0x4eabc8[0x1])>0x0){const _0x1f1990=_0x8fce8b(0x16d)+_0x4eabc8[0x1]+_0x8fce8b(0x18c)+(_0x2f1fac?':\x0a'+_0x2f1fac:'');if(_0x53b8dd?.[_0x8fce8b(0x18a)]===_0x8fce8b(0x187))return{'ok':!![],'status':0x0,'partialFailure':{'count':Number(_0x4eabc8[0x1]),'output':_0x2f1fac}};return _0x22ae5f(failure(_0x8fce8b(0x182),0x0,_0x1f1990));}if(_0x17eb83&&_0x53b8dd){if(_0x53b8dd[_0x8fce8b(0x18a)]===_0x8fce8b(0x17c))return _0x22ae5f(failure(_0x8fce8b(0x169),0x0,_0x8fce8b(0x17b)+_0x17eb83+'\x22\x20not\x20found\x20after\x20install\x20(checked\x20'+_0x53b8dd[_0x8fce8b(0x189)][_0x8fce8b(0x196)](',\x20')+')'));_0x53b8dd[_0x8fce8b(0x18a)]==='unverifiable'&&console['warn'](_0x8fce8b(0x175)+_0x17eb83+'\x22\x20install\x20state:\x20'+_0x53b8dd['reason']);}return _0x22ae5f({'ok':!![],'status':0x0});}
1
+ const a153_0xb69aaa=a153_0x5979;(function(_0x485429,_0x3de666){const _0x400667=a153_0x5979,_0x3844c3=_0x485429();while(!![]){try{const _0x5360b6=parseInt(_0x400667(0x84))/0x1*(parseInt(_0x400667(0x83))/0x2)+parseInt(_0x400667(0x85))/0x3*(parseInt(_0x400667(0x98))/0x4)+parseInt(_0x400667(0x97))/0x5*(parseInt(_0x400667(0x8a))/0x6)+-parseInt(_0x400667(0x7e))/0x7*(-parseInt(_0x400667(0x89))/0x8)+-parseInt(_0x400667(0x7b))/0x9*(-parseInt(_0x400667(0x82))/0xa)+parseInt(_0x400667(0x81))/0xb*(parseInt(_0x400667(0xac))/0xc)+-parseInt(_0x400667(0x73))/0xd;if(_0x5360b6===_0x3de666)break;else _0x3844c3['push'](_0x3844c3['shift']());}catch(_0x51bb77){_0x3844c3['push'](_0x3844c3['shift']());}}}(a153_0x90d7,0xc8b45));import{execaSync}from'execa';function a153_0x90d7(){const _0x3e6ca9=['message','55HhLscc','1660HLBlDD','46662AnvjCT','39tILwmU','2382kwwKxi','code','\x22\x20install\x20state:\x20','partialFailure','8iSgNmu','782958zAWbyj','npm_config_global','npx','SPAWN_FAILED','\x22\x20not\x20found\x20after\x20install\x20(checked\x20','ENOENT','unverifiable','exitCode','Installer\x20reported\x20','stdout','match','state','trim','25IYpnPZ','4236LEWLJy','npx\x20failed\x20to\x20start','SKILL_NOT_INSTALLED','stderr','NPX_NOT_FOUND','signal','reason','internalSkillSource','filter','npx\x20terminated\x20by\x20signal\x20','skills@latest','log','globalSkillName','presence','NPM_CONFIG_GLOBAL','absent','add','pipe','CHILD_TERMINATED','PERMISSION_DENIED','3612228kCJmtv','unknown','58035562yisrhI','shortMessage','skipNpxSkillsEnvSuffix','Skill\x20\x22','checked','warn','join','stdio','69399iAnctl','CHILD_EXIT_NONZERO','INSTALL_PARTIAL','686126zEduUu','!\x20Could\x20not\x20verify\x20\x22'];a153_0x90d7=function(){return _0x3e6ca9;};return a153_0x90d7();}import{LOVRABET_SKILL_SOURCE as a153_0x321897}from'../constant/distribution.js';import{PRODUCT_CONFIG,productEnvName}from'../constant/product.js';import{resolveInstalledSkill}from'../skills/skill-presence.js';export const LOVRABET_SKILL_SOURCE=a153_0x321897;export const LOVRABET_SKILL_GIT_SOURCE=PRODUCT_CONFIG[a153_0xb69aaa(0x9f)];export const LOVRABET_GLOBAL_SKILL_NAME=PRODUCT_CONFIG[a153_0xb69aaa(0xa4)];export function resolveGlobalSkillName(_0x41e5ea){const _0x32acc5=a153_0xb69aaa;switch(_0x41e5ea[_0x32acc5(0x96)]()){case LOVRABET_SKILL_SOURCE:case LOVRABET_SKILL_GIT_SOURCE:return LOVRABET_GLOBAL_SKILL_NAME;default:return undefined;}}function a153_0x5979(_0x32652b,_0xd7010){_0x32652b=_0x32652b-0x73;const _0x90d78f=a153_0x90d7();let _0x597919=_0x90d78f[_0x32652b];return _0x597919;}export const LOVRABET_SKIP_NPX_SKILLS_ENV=productEnvName(PRODUCT_CONFIG[a153_0xb69aaa(0x75)]);const CHILD_OUTPUT_MAX_BUFFER=0x10*0x400*0x400;function failure(_0x527292,_0x4f0258,_0x5cc2b4){return{'ok':![],'status':_0x4f0258,'code':_0x527292,'error':'['+_0x527292+']\x20'+_0x5cc2b4};}export function shouldSkipNpxSkillsAdd(){return process.env[LOVRABET_SKIP_NPX_SKILLS_ENV]==='1';}export function runNpxSkillsAddGlobal(_0x205256,_0x3bd705=LOVRABET_SKILL_SOURCE,_0x3749a5){const _0x634da6=a153_0xb69aaa;if(shouldSkipNpxSkillsAdd())return{'ok':!![],'status':0x0,'skipped':!![]};const _0x5cb25f=['-y',_0x634da6(0xa2),_0x634da6(0xa8),_0x3bd705,'-g','-y'],_0xbfacfc=['npx',..._0x5cb25f][_0x634da6(0x79)]('\x20');console['log']('*\x20'+_0xbfacfc);const _0x51a7aa={...process.env};delete _0x51a7aa[_0x634da6(0x8b)],delete _0x51a7aa[_0x634da6(0xa6)];const _0x31c30c=execaSync(_0x634da6(0x8c),_0x5cb25f,{'cwd':_0x205256,'stdio':'pipe','env':_0x51a7aa,'extendEnv':![],'shell':![],'reject':![],'maxBuffer':CHILD_OUTPUT_MAX_BUFFER}),_0x2c4440=[_0x31c30c[_0x634da6(0x93)]?String(_0x31c30c[_0x634da6(0x93)]):'',_0x31c30c['stderr']?String(_0x31c30c[_0x634da6(0x9b)]):''][_0x634da6(0xa0)](Boolean)[_0x634da6(0x79)]('\x0a')['trim'](),_0xdf627d=_0x31c30c[_0x634da6(0x91)]??null,_0x6b6e74=_0x31d582=>{const _0x493833=_0x634da6;return _0x3749a5?.[_0x493833(0x7a)]!==_0x493833(0xa9)&&!_0x31d582[_0x493833(0x88)]&&_0x2c4440&&console[_0x493833(0xa3)](_0x2c4440),_0x31d582;};if(_0x31c30c[_0x634da6(0x86)]){const _0xff4828=_0x31c30c[_0x634da6(0x86)]===_0x634da6(0x8f)?_0x634da6(0x9c):_0x31c30c[_0x634da6(0x86)]==='EPERM'||_0x31c30c[_0x634da6(0x86)]==='EACCES'?_0x634da6(0xab):_0x634da6(0x8d);return _0x6b6e74(failure(_0xff4828,_0xdf627d,_0x31c30c[_0x634da6(0x74)]??_0x31c30c[_0x634da6(0x80)]??_0x31c30c[_0x634da6(0x86)]));}if(_0x31c30c[_0x634da6(0x9d)])return _0x6b6e74(failure(_0x634da6(0xaa),_0xdf627d,_0x634da6(0xa1)+_0x31c30c['signal']));if(_0x31c30c['failed']&&_0xdf627d===null)return _0x6b6e74(failure('SPAWN_FAILED',_0xdf627d,_0x31c30c[_0x634da6(0x74)]??_0x31c30c[_0x634da6(0x80)]??_0x634da6(0x99)));if(_0xdf627d!==0x0)return _0x6b6e74(failure(_0x634da6(0x7c),_0xdf627d,_0x2c4440||_0x31c30c[_0x634da6(0x74)]||'exit\x20'+(_0xdf627d??_0x634da6(0xad))));const _0x2bcf37=_0x3749a5?.['expectedSkillName']??resolveGlobalSkillName(_0x3bd705),_0x3432b7=_0x2bcf37?resolveInstalledSkill(_0x2bcf37,_0x3749a5?.[_0x634da6(0xa5)]):undefined,_0x31cafd=_0x2c4440[_0x634da6(0x94)](/Failed to install\s+(\d+)/i);if(_0x31cafd&&Number(_0x31cafd[0x1])>0x0){const _0x52ec1f=_0x634da6(0x92)+_0x31cafd[0x1]+'\x20failed\x20target(s)'+(_0x2c4440?':\x0a'+_0x2c4440:'');if(_0x3432b7?.[_0x634da6(0x95)]==='present')return{'ok':!![],'status':0x0,'partialFailure':{'count':Number(_0x31cafd[0x1]),'output':_0x2c4440}};return _0x6b6e74(failure(_0x634da6(0x7d),0x0,_0x52ec1f));}if(_0x2bcf37&&_0x3432b7){if(_0x3432b7[_0x634da6(0x95)]===_0x634da6(0xa7))return _0x6b6e74(failure(_0x634da6(0x9a),0x0,_0x634da6(0x76)+_0x2bcf37+_0x634da6(0x8e)+_0x3432b7[_0x634da6(0x77)]['join'](',\x20')+')'));_0x3432b7['state']===_0x634da6(0x90)&&console[_0x634da6(0x78)](_0x634da6(0x7f)+_0x2bcf37+_0x634da6(0x87)+_0x3432b7[_0x634da6(0x9e)]);}return _0x6b6e74({'ok':!![],'status':0x0});}
@@ -1 +1 @@
1
- const a151_0x10de9d=a151_0x4759;function a151_0x53e2(){const _0xb9dd29=['dist','60aWJgCg','build','2492202dslDiq','.hg','.next','134xltQIr','7123816kTEHMr','node_modules','7468544eFZRFs','15773awccRW','16539402AmiFAV','lovrabet.skill.json','321834daeqBE','30QCwAHx','.cache','.svn','4aOlClz','6792867ylFpvE','.git'];a151_0x53e2=function(){return _0xb9dd29;};return a151_0x53e2();}(function(_0x35064a,_0x57c86b){const _0x1264a0=a151_0x4759,_0x39a6dd=_0x35064a();while(!![]){try{const _0xd4c766=parseInt(_0x1264a0(0x198))/0x1*(-parseInt(_0x1264a0(0x1a8))/0x2)+-parseInt(_0x1264a0(0x1a5))/0x3*(parseInt(_0x1264a0(0x19f))/0x4)+parseInt(_0x1264a0(0x1a3))/0x5*(parseInt(_0x1264a0(0x19b))/0x6)+-parseInt(_0x1264a0(0x195))/0x7+-parseInt(_0x1264a0(0x197))/0x8+-parseInt(_0x1264a0(0x1a0))/0x9+parseInt(_0x1264a0(0x19c))/0xa*(parseInt(_0x1264a0(0x199))/0xb);if(_0xd4c766===_0x57c86b)break;else _0x39a6dd['push'](_0x39a6dd['shift']());}catch(_0x291f92){_0x39a6dd['push'](_0x39a6dd['shift']());}}}(a151_0x53e2,0x88ee6));export const METADATA_FILE=a151_0x10de9d(0x19a);function a151_0x4759(_0x20140c,_0x56abc7){_0x20140c=_0x20140c-0x195;const _0x53e230=a151_0x53e2();let _0x47591d=_0x53e230[_0x20140c];return _0x47591d;}export const SKILL_FILE='SKILL.md';export const IGNORED_FILE_NAMES=new Set([METADATA_FILE,'.DS_Store']);export const IGNORED_DIR_NAMES=new Set([a151_0x10de9d(0x1a1),a151_0x10de9d(0x1a6),a151_0x10de9d(0x19e),a151_0x10de9d(0x196),a151_0x10de9d(0x1a7),a151_0x10de9d(0x1a2),a151_0x10de9d(0x1a4),'coverage','.turbo',a151_0x10de9d(0x19d)]);
1
+ const a154_0x116fc4=a154_0x5c3e;function a154_0x3073(){const _0xa252df=['8RDaxpY','105573JVJxon','SKILL.md','lovrabet.skill.json','.git','882595UUglzy','36JGAXOa','coverage','build','312supVkS','4127080ERUHgV','30AWPiLT','8MmYZcb','.hg','201755oTYmBF','1887275zKXoTJ','672463FohjXX','.cache','.turbo','2976633gMybkM','.DS_Store'];a154_0x3073=function(){return _0xa252df;};return a154_0x3073();}(function(_0x22f0cb,_0x335515){const _0x1774f2=a154_0x5c3e,_0x5145cc=_0x22f0cb();while(!![]){try{const _0x904ebe=-parseInt(_0x1774f2(0x188))/0x1*(-parseInt(_0x1774f2(0x186))/0x2)+parseInt(_0x1774f2(0x190))/0x3*(parseInt(_0x1774f2(0x180))/0x4)+-parseInt(_0x1774f2(0x189))/0x5+-parseInt(_0x1774f2(0x185))/0x6*(-parseInt(_0x1774f2(0x17f))/0x7)+parseInt(_0x1774f2(0x18f))/0x8*(parseInt(_0x1774f2(0x18d))/0x9)+parseInt(_0x1774f2(0x184))/0xa+parseInt(_0x1774f2(0x18a))/0xb*(-parseInt(_0x1774f2(0x183))/0xc);if(_0x904ebe===_0x335515)break;else _0x5145cc['push'](_0x5145cc['shift']());}catch(_0x138969){_0x5145cc['push'](_0x5145cc['shift']());}}}(a154_0x3073,0x81908));export const METADATA_FILE=a154_0x116fc4(0x17d);export const SKILL_FILE=a154_0x116fc4(0x17c);export const IGNORED_FILE_NAMES=new Set([METADATA_FILE,a154_0x116fc4(0x18e)]);function a154_0x5c3e(_0x2fd147,_0x121650){_0x2fd147=_0x2fd147-0x17c;const _0x307347=a154_0x3073();let _0x5c3e4e=_0x307347[_0x2fd147];return _0x5c3e4e;}export const IGNORED_DIR_NAMES=new Set([a154_0x116fc4(0x17e),a154_0x116fc4(0x187),'.svn','node_modules','.next','dist',a154_0x116fc4(0x182),a154_0x116fc4(0x181),a154_0x116fc4(0x18c),a154_0x116fc4(0x18b)]);
@@ -1 +1 @@
1
- (function(_0x1c3601,_0x15c604){const _0x51fd3a=a152_0x141b,_0x2fe546=_0x1c3601();while(!![]){try{const _0x2363cd=-parseInt(_0x51fd3a(0xa2))/0x1*(parseInt(_0x51fd3a(0xa1))/0x2)+-parseInt(_0x51fd3a(0xad))/0x3+-parseInt(_0x51fd3a(0xa4))/0x4+parseInt(_0x51fd3a(0x9e))/0x5+-parseInt(_0x51fd3a(0xb0))/0x6*(parseInt(_0x51fd3a(0xaa))/0x7)+parseInt(_0x51fd3a(0xaf))/0x8+parseInt(_0x51fd3a(0xab))/0x9;if(_0x2363cd===_0x15c604)break;else _0x2fe546['push'](_0x2fe546['shift']());}catch(_0x3cc8e2){_0x2fe546['push'](_0x2fe546['shift']());}}}(a152_0x1533,0x6cac4));import{lstatSync,readlinkSync,realpathSync,renameSync,rmSync,writeFileSync}from'node:fs';import{dirname,isAbsolute,resolve,sep}from'node:path';import{CliErrors}from'../../errors.js';import{normalizeSkillRelativePath}from'./local-files.js';function a152_0x141b(_0x53bbd2,_0xd96915){_0x53bbd2=_0x53bbd2-0x9e;const _0x153364=a152_0x1533();let _0x141b5d=_0x153364[_0x53bbd2];return _0x141b5d;}export function resolveManagedFilePath(_0x401280,_0x3da992){const _0x16f55a=a152_0x141b,_0x274a31=normalizeSkillRelativePath(_0x3da992),_0x505206=realOrResolved(_0x401280),_0x40be23=resolve(_0x505206,..._0x274a31[_0x16f55a(0xae)]('/'));if(!isPathInside(_0x40be23,_0x505206))throw CliErrors[_0x16f55a(0x9f)](_0x16f55a(0xa5)+_0x3da992);return ensureNoSymlinkInManagedPath(_0x505206,_0x274a31),_0x40be23;}export function ensureNoSymlinkInManagedPath(_0x436840,_0x3ca048){const _0x354ea1=a152_0x141b;let _0x495efc=_0x436840;for(const _0x455e7b of _0x3ca048[_0x354ea1(0xae)]('/')){_0x495efc=resolve(_0x495efc,_0x455e7b);const _0x3adc69=lstatIfPresent(_0x495efc);if(_0x3adc69?.[_0x354ea1(0xa3)]())throw CliErrors[_0x354ea1(0x9f)](_0x354ea1(0xa7)+_0x3ca048);}}function a152_0x1533(){const _0x15cecd=['2935350zXmeKG','utf8','2644599LiUTDg','split','5510408YAYbGD','6BTZVve','4240910NeCdWQ','validation','endsWith','184XyfYUw','1562tHqFJV','isSymbolicLink','437476HSgXbv','Unsafe\x20Skill\x20file\x20path:\x20','.tmp','Refusing\x20to\x20write\x20through\x20Skill\x20symlink\x20path:\x20','from','startsWith','1983821gBTRJi'];a152_0x1533=function(){return _0x15cecd;};return a152_0x1533();}export function isDanglingSymlink(_0x7ba1d3){const _0x109db5=a152_0x141b;try{return lstatSync(_0x7ba1d3)[_0x109db5(0xa3)]();}catch{return![];}}export function resolveSymlinkTarget(_0x2f0271){const _0x597d95=readlinkSync(_0x2f0271);return isAbsolute(_0x597d95)?_0x597d95:resolve(dirname(_0x2f0271),_0x597d95);}export function isPathInside(_0x1df8ca,_0x32d896){const _0x410d44=a152_0x141b,_0x20f3bb=_0x1df8ca['endsWith'](sep)?_0x1df8ca:''+_0x1df8ca+sep,_0x533406=_0x32d896[_0x410d44(0xa0)](sep)?_0x32d896:''+_0x32d896+sep;return _0x1df8ca===_0x32d896||_0x20f3bb[_0x410d44(0xa9)](_0x533406);}export function realOrResolved(_0x279630){try{return realpathSync(_0x279630);}catch{return resolve(_0x279630);}}export function lstatIfPresent(_0xc9e3b0){try{return lstatSync(_0xc9e3b0);}catch{return undefined;}}export function writeTextAtomic(_0x715690,_0x3ac818,_0x93a765){const _0x19d5e0=a152_0x141b;writeBytesAtomic(_0x715690,Buffer[_0x19d5e0(0xa8)](_0x3ac818,_0x19d5e0(0xac)),_0x93a765);}export function writeBytesAtomic(_0x1df4f6,_0x2fbf0c,_0x9022b0){const _0x4e80e8=a152_0x141b,_0x28b86d=_0x1df4f6+_0x4e80e8(0xa6);try{writeFileSync(_0x28b86d,_0x2fbf0c,{'mode':_0x9022b0}),renameSync(_0x28b86d,_0x1df4f6);}catch(_0x1cac37){try{rmSync(_0x28b86d,{'force':!![]});}catch{}throw _0x1cac37;}}export function writeJsonAtomic(_0x4d07ba,_0x1a396c){writeTextAtomic(_0x4d07ba,JSON['stringify'](_0x1a396c,null,0x2)+'\x0a',0x180);}
1
+ (function(_0x1de8a7,_0x403f60){const _0x4168e8=a155_0x3ded,_0x185a0f=_0x1de8a7();while(!![]){try{const _0x122c9e=parseInt(_0x4168e8(0x1bd))/0x1*(parseInt(_0x4168e8(0x1c5))/0x2)+parseInt(_0x4168e8(0x1be))/0x3+-parseInt(_0x4168e8(0x1c1))/0x4+-parseInt(_0x4168e8(0x1b5))/0x5+parseInt(_0x4168e8(0x1b7))/0x6+parseInt(_0x4168e8(0x1bb))/0x7+-parseInt(_0x4168e8(0x1b6))/0x8*(parseInt(_0x4168e8(0x1b9))/0x9);if(_0x122c9e===_0x403f60)break;else _0x185a0f['push'](_0x185a0f['shift']());}catch(_0x567dfb){_0x185a0f['push'](_0x185a0f['shift']());}}}(a155_0x245b,0x9034d));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(_0x31e89d,_0x1a7302){const _0x3edbfd=a155_0x3ded,_0x163f41=normalizeSkillRelativePath(_0x1a7302),_0x2011b2=realOrResolved(_0x31e89d),_0x1ae13c=resolve(_0x2011b2,..._0x163f41[_0x3edbfd(0x1b8)]('/'));if(!isPathInside(_0x1ae13c,_0x2011b2))throw CliErrors[_0x3edbfd(0x1c6)](_0x3edbfd(0x1c0)+_0x1a7302);return ensureNoSymlinkInManagedPath(_0x2011b2,_0x163f41),_0x1ae13c;}export function ensureNoSymlinkInManagedPath(_0x24d95c,_0x53fb7b){const _0x54bc9a=a155_0x3ded;let _0x551515=_0x24d95c;for(const _0x24d5ea of _0x53fb7b[_0x54bc9a(0x1b8)]('/')){_0x551515=resolve(_0x551515,_0x24d5ea);const _0x2bd75a=lstatIfPresent(_0x551515);if(_0x2bd75a?.[_0x54bc9a(0x1b4)]())throw CliErrors[_0x54bc9a(0x1c6)](_0x54bc9a(0x1bc)+_0x53fb7b);}}export function isDanglingSymlink(_0x4ac362){const _0x3f9717=a155_0x3ded;try{return lstatSync(_0x4ac362)[_0x3f9717(0x1b4)]();}catch{return![];}}export function resolveSymlinkTarget(_0x1bebc2){const _0x374e5f=readlinkSync(_0x1bebc2);return isAbsolute(_0x374e5f)?_0x374e5f:resolve(dirname(_0x1bebc2),_0x374e5f);}export function isPathInside(_0x4b976e,_0x1d08ce){const _0x344b19=a155_0x3ded,_0x28884e=_0x4b976e['endsWith'](sep)?_0x4b976e:''+_0x4b976e+sep,_0x48cadf=_0x1d08ce['endsWith'](sep)?_0x1d08ce:''+_0x1d08ce+sep;return _0x4b976e===_0x1d08ce||_0x28884e[_0x344b19(0x1ba)](_0x48cadf);}function a155_0x3ded(_0x4ee5e5,_0x3abc0f){_0x4ee5e5=_0x4ee5e5-0x1b4;const _0x245bc3=a155_0x245b();let _0x3dedd5=_0x245bc3[_0x4ee5e5];return _0x3dedd5;}export function realOrResolved(_0x256a60){try{return realpathSync(_0x256a60);}catch{return resolve(_0x256a60);}}export function lstatIfPresent(_0x299671){try{return lstatSync(_0x299671);}catch{return undefined;}}export function writeTextAtomic(_0x1dd3b7,_0x3c9213,_0x404ddb){const _0x49af55=a155_0x3ded;writeBytesAtomic(_0x1dd3b7,Buffer[_0x49af55(0x1c3)](_0x3c9213,_0x49af55(0x1c4)),_0x404ddb);}function a155_0x245b(){const _0x3e75b0=['4269924TqsiFy','startsWith','6860252ZICFwE','Refusing\x20to\x20write\x20through\x20Skill\x20symlink\x20path:\x20','10vmvggp','1583790wWQtEF','stringify','Unsafe\x20Skill\x20file\x20path:\x20','1099360USxSmF','.tmp','from','utf8','203492lKFSJD','validation','isSymbolicLink','2120860NZOhjT','32lszaxs','3971994uKrbOh','split'];a155_0x245b=function(){return _0x3e75b0;};return a155_0x245b();}export function writeBytesAtomic(_0x1cc63c,_0x248c8a,_0x46f82f){const _0x113f51=a155_0x3ded,_0x135d30=_0x1cc63c+_0x113f51(0x1c2);try{writeFileSync(_0x135d30,_0x248c8a,{'mode':_0x46f82f}),renameSync(_0x135d30,_0x1cc63c);}catch(_0x5d95e4){try{rmSync(_0x135d30,{'force':!![]});}catch{}throw _0x5d95e4;}}export function writeJsonAtomic(_0x2939e4,_0x988c44){const _0x530cc5=a155_0x3ded;writeTextAtomic(_0x2939e4,JSON[_0x530cc5(0x1bf)](_0x988c44,null,0x2)+'\x0a',0x180);}
@@ -1 +1 @@
1
- (function(_0x5a7d3f,_0x5223e2){const _0x17cd68=a153_0x2d2c,_0x3e9cdc=_0x5a7d3f();while(!![]){try{const _0x1cc7d5=-parseInt(_0x17cd68(0x198))/0x1*(-parseInt(_0x17cd68(0x199))/0x2)+-parseInt(_0x17cd68(0x19a))/0x3+parseInt(_0x17cd68(0x194))/0x4*(parseInt(_0x17cd68(0x18e))/0x5)+-parseInt(_0x17cd68(0x193))/0x6*(parseInt(_0x17cd68(0x19c))/0x7)+parseInt(_0x17cd68(0x191))/0x8+parseInt(_0x17cd68(0x18f))/0x9*(-parseInt(_0x17cd68(0x19b))/0xa)+parseInt(_0x17cd68(0x197))/0xb;if(_0x1cc7d5===_0x5223e2)break;else _0x3e9cdc['push'](_0x3e9cdc['shift']());}catch(_0x3ab927){_0x3e9cdc['push'](_0x3e9cdc['shift']());}}}(a153_0x19fe,0x4e090));import{createHash}from'node:crypto';import{fileContent,normalizeManifestFiles}from'./local-files.js';function a153_0x19fe(){const _0x451cac=['path','sha256','7991786GyYTuG','12997zomqPI','82RwCPEU','1743816zhLKtD','2886760sxnmvN','3900701AkLneH','digest','86935LokhcG','9POwWGK','update','1812920KwYDLK','hex','6mKovus','60airPWf'];a153_0x19fe=function(){return _0x451cac;};return a153_0x19fe();}function a153_0x2d2c(_0x504f67,_0x26ff9b){_0x504f67=_0x504f67-0x18d;const _0x19fe0c=a153_0x19fe();let _0x2d2c06=_0x19fe0c[_0x504f67];return _0x2d2c06;}export function contentHash(_0x3c309e){const _0xcef15=a153_0x2d2c;return createHash(_0xcef15(0x196))[_0xcef15(0x190)](_0x3c309e)[_0xcef15(0x18d)](_0xcef15(0x192));}export function fileHash(_0x5a2b3b){return bufferSha256(fileContent(_0x5a2b3b));}export function bufferSha256(_0x30e378){const _0x2a1b6a=a153_0x2d2c;return createHash(_0x2a1b6a(0x196))[_0x2a1b6a(0x190)](_0x30e378)[_0x2a1b6a(0x18d)](_0x2a1b6a(0x192));}export function fileTreeHash(_0x2dc4d7){const _0x1171ae=a153_0x2d2c,_0x2c2ae3=createHash(_0x1171ae(0x196));for(const _0x4ebf4d of normalizeManifestFiles(_0x2dc4d7)){_0x2c2ae3[_0x1171ae(0x190)](_0x4ebf4d[_0x1171ae(0x195)]),_0x2c2ae3[_0x1171ae(0x190)]('\x00'),_0x2c2ae3['update'](_0x4ebf4d[_0x1171ae(0x196)]),_0x2c2ae3['update']('\x00'),_0x2c2ae3['update'](String(_0x4ebf4d['size'])),_0x2c2ae3[_0x1171ae(0x190)]('\x00');}return _0x2c2ae3[_0x1171ae(0x18d)](_0x1171ae(0x192));}
1
+ (function(_0x1ad615,_0x50548b){const _0x329752=a156_0x312e,_0x26cbb6=_0x1ad615();while(!![]){try{const _0x4825bd=-parseInt(_0x329752(0x1ed))/0x1*(parseInt(_0x329752(0x1e0))/0x2)+-parseInt(_0x329752(0x1e8))/0x3*(-parseInt(_0x329752(0x1e5))/0x4)+parseInt(_0x329752(0x1df))/0x5+-parseInt(_0x329752(0x1eb))/0x6*(-parseInt(_0x329752(0x1e7))/0x7)+parseInt(_0x329752(0x1ec))/0x8*(parseInt(_0x329752(0x1ea))/0x9)+parseInt(_0x329752(0x1e9))/0xa+-parseInt(_0x329752(0x1e6))/0xb;if(_0x4825bd===_0x50548b)break;else _0x26cbb6['push'](_0x26cbb6['shift']());}catch(_0x237fec){_0x26cbb6['push'](_0x26cbb6['shift']());}}}(a156_0x1cdc,0x6c9f8));import{createHash}from'node:crypto';import{fileContent,normalizeManifestFiles}from'./local-files.js';export function contentHash(_0x3d5504){const _0x3a8f1f=a156_0x312e;return createHash(_0x3a8f1f(0x1e4))['update'](_0x3d5504)[_0x3a8f1f(0x1e1)](_0x3a8f1f(0x1e3));}export function fileHash(_0x4fd127){return bufferSha256(fileContent(_0x4fd127));}function a156_0x1cdc(){const _0x46e9dd=['328DQUXJL','10011133ekGiMb','13048cxFxIQ','20763OVNeqJ','1866030FnrptD','1611QkWihS','1686ZHkEOc','22840rwAqYA','13KalQrx','size','348900TaShFs','77494WeznKX','digest','update','hex','sha256'];a156_0x1cdc=function(){return _0x46e9dd;};return a156_0x1cdc();}function a156_0x312e(_0x982ef0,_0x4e3076){_0x982ef0=_0x982ef0-0x1df;const _0x1cdc7d=a156_0x1cdc();let _0x312e5b=_0x1cdc7d[_0x982ef0];return _0x312e5b;}export function bufferSha256(_0x2296cd){const _0x40cbd4=a156_0x312e;return createHash(_0x40cbd4(0x1e4))['update'](_0x2296cd)['digest']('hex');}export function fileTreeHash(_0x1a17fc){const _0xa82d29=a156_0x312e,_0xbad2e5=createHash('sha256');for(const _0x35c1bb of normalizeManifestFiles(_0x1a17fc)){_0xbad2e5[_0xa82d29(0x1e2)](_0x35c1bb['path']),_0xbad2e5['update']('\x00'),_0xbad2e5[_0xa82d29(0x1e2)](_0x35c1bb['sha256']),_0xbad2e5[_0xa82d29(0x1e2)]('\x00'),_0xbad2e5[_0xa82d29(0x1e2)](String(_0x35c1bb[_0xa82d29(0x1ee)])),_0xbad2e5[_0xa82d29(0x1e2)]('\x00');}return _0xbad2e5[_0xa82d29(0x1e1)](_0xa82d29(0x1e3));}
@@ -1 +1 @@
1
- (function(_0x24dc3e,_0x55336c){const _0x3142c7=a154_0x2652,_0x47eb5f=_0x24dc3e();while(!![]){try{const _0x855041=parseInt(_0x3142c7(0x1c7))/0x1+-parseInt(_0x3142c7(0x1bf))/0x2+parseInt(_0x3142c7(0x1c3))/0x3*(-parseInt(_0x3142c7(0x1c5))/0x4)+-parseInt(_0x3142c7(0x1cb))/0x5*(-parseInt(_0x3142c7(0x1cc))/0x6)+parseInt(_0x3142c7(0x1c0))/0x7*(-parseInt(_0x3142c7(0x1c8))/0x8)+parseInt(_0x3142c7(0x1c6))/0x9*(-parseInt(_0x3142c7(0x1c2))/0xa)+parseInt(_0x3142c7(0x1c1))/0xb;if(_0x855041===_0x55336c)break;else _0x47eb5f['push'](_0x47eb5f['shift']());}catch(_0x3ca800){_0x47eb5f['push'](_0x47eb5f['shift']());}}}(a154_0x2385,0x262db));import{resolve}from'node:path';import{resolveSkillSyncPaths,runtimeAgentSkillRoots,safePathSegment}from'./paths.js';function a154_0x2385(){const _0x25a4d8=['270QhsLMc','3204ncdXcC','managedRoot','145050ObKhMQ','32914oosmWA','8294352wuEvvf','141130WpfBJP','72jvLExH','cwd','28056hkZlmw','198JdhEnv','141150XqWmQj','368tpimKw','freeze','project'];a154_0x2385=function(){return _0x25a4d8;};return a154_0x2385();}function a154_0x2652(_0x39855f,_0x37bdd1){_0x39855f=_0x39855f-0x1bf;const _0x23857b=a154_0x2385();let _0x2652e5=_0x23857b[_0x39855f];return _0x2652e5;}export function resolveRuntimeSkillInstallTarget(_0x26964d,_0x33d7a6='global',_0x11a9a7={}){const _0x4e7c55=a154_0x2652,_0xfb500d=resolveSkillSyncPaths(_0x11a9a7),_0x41cff2=safePathSegment(_0x26964d,'appCode'),_0x4574b7=_0x33d7a6===_0x4e7c55(0x1ca)?[resolve(_0x11a9a7[_0x4e7c55(0x1c4)]??process['cwd'](),'.agents','skills')]:runtimeAgentSkillRoots(_0xfb500d);return Object[_0x4e7c55(0x1c9)]({'scope':_0x33d7a6,'appCode':_0x41cff2,'skillRoots':Object[_0x4e7c55(0x1c9)](_0x4574b7),'managedRoot':_0xfb500d[_0x4e7c55(0x1cd)]});}
1
+ const a157_0x3ab6c7=a157_0x5bb4;function a157_0x564e(){const _0x1e2afd=['5hGWJUC','.agents','3486dadYmP','3lfjfwn','managedRoot','appCode','5354382ZvaFzX','project','213477knxRHs','1949120UBuPXu','2869902JeyXJO','freeze','174jyZaDe','65566RfyaTM','10RNIcLn','815348LilwhC','global'];a157_0x564e=function(){return _0x1e2afd;};return a157_0x564e();}(function(_0x2f6197,_0x199fd7){const _0x43c2a1=a157_0x5bb4,_0x10bdac=_0x2f6197();while(!![]){try{const _0x5dffc9=-parseInt(_0x43c2a1(0x128))/0x1*(-parseInt(_0x43c2a1(0x132))/0x2)+-parseInt(_0x43c2a1(0x12d))/0x3+parseInt(_0x43c2a1(0x134))/0x4*(parseInt(_0x43c2a1(0x136))/0x5)+parseInt(_0x43c2a1(0x131))/0x6*(parseInt(_0x43c2a1(0x127))/0x7)+-parseInt(_0x43c2a1(0x12e))/0x8+-parseInt(_0x43c2a1(0x12f))/0x9*(parseInt(_0x43c2a1(0x133))/0xa)+parseInt(_0x43c2a1(0x12b))/0xb;if(_0x5dffc9===_0x199fd7)break;else _0x10bdac['push'](_0x10bdac['shift']());}catch(_0x441f2f){_0x10bdac['push'](_0x10bdac['shift']());}}}(a157_0x564e,0x296f1));import{resolve}from'node:path';function a157_0x5bb4(_0x2a70db,_0x2d3b73){_0x2a70db=_0x2a70db-0x127;const _0x564ed4=a157_0x564e();let _0x5bb4b3=_0x564ed4[_0x2a70db];return _0x5bb4b3;}import{resolveSkillSyncPaths,runtimeAgentSkillRoots,safePathSegment}from'./paths.js';export function resolveRuntimeSkillInstallTarget(_0x72d159,_0x11d16a=a157_0x3ab6c7(0x135),_0xb52334={}){const _0x1b6bf3=a157_0x3ab6c7,_0xb74356=resolveSkillSyncPaths(_0xb52334),_0x53a5e4=safePathSegment(_0x72d159,_0x1b6bf3(0x12a)),_0x4b5cf9=_0x11d16a===_0x1b6bf3(0x12c)?[resolve(_0xb52334['cwd']??process['cwd'](),_0x1b6bf3(0x137),'skills')]:runtimeAgentSkillRoots(_0xb74356);return Object[_0x1b6bf3(0x130)]({'scope':_0x11d16a,'appCode':_0x53a5e4,'skillRoots':Object['freeze'](_0x4b5cf9),'managedRoot':_0xb74356[_0x1b6bf3(0x129)]});}
@@ -1 +1 @@
1
- const a155_0x18f945=a155_0x760f;(function(_0xd009a,_0x34b39c){const _0x2d4d33=a155_0x760f,_0x1d8b4c=_0xd009a();while(!![]){try{const _0x5c6526=parseInt(_0x2d4d33(0x1e9))/0x1+-parseInt(_0x2d4d33(0x1e2))/0x2*(parseInt(_0x2d4d33(0x1ef))/0x3)+parseInt(_0x2d4d33(0x1ec))/0x4*(-parseInt(_0x2d4d33(0x208))/0x5)+-parseInt(_0x2d4d33(0x1f7))/0x6*(parseInt(_0x2d4d33(0x1f9))/0x7)+parseInt(_0x2d4d33(0x1e0))/0x8+-parseInt(_0x2d4d33(0x204))/0x9*(-parseInt(_0x2d4d33(0x1ff))/0xa)+parseInt(_0x2d4d33(0x1fc))/0xb;if(_0x5c6526===_0x34b39c)break;else _0x1d8b4c['push'](_0x1d8b4c['shift']());}catch(_0x147d7e){_0x1d8b4c['push'](_0x1d8b4c['shift']());}}}(a155_0x524a,0x7c1d5));function a155_0x524a(){const _0x46a865=['scope','1552190sMcrrS','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20','has','removed','runtime-observe','45LtFhaw','Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20','env','values','445HtsYvA','filter','metadataPath','unchanged','builtin','contentHash','skillRoots','skillCode','Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20','slice','trim','external-symlink','created','managedRoot','get','map','Refusing\x20to\x20copy\x20Skill\x20symlink:\x20','metadata-mismatch','updated','548856JzSBjL','dir','762IfzQms','pruneSkillCodes','linked-from-protected-root','personal','activeSkillCodes','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','not-managed-symlink','401389JkJKNJ','skill','secret-retriever','27088dNDXdA','name','appCode','276soMJCV','Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20','validation','isSymbolicLink','skipped','Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20','Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20','project','3252MkZnqS','push','5817guXQRF','company','scopes','3854884StEjvH','agentsSkillsDir'];a155_0x524a=function(){return _0x46a865;};return a155_0x524a();}import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';function a155_0x760f(_0x4d3737,_0x294bf3){_0x4d3737=_0x4d3737-0x1d3;const _0x524af0=a155_0x524a();let _0x760f35=_0x524af0[_0x4d3737];return _0x760f35;}import a155_0x1ef1ab 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}=a155_0x1ef1ab,RESERVED_PROJECT_SKILL_CODES=new Set(['lovrabet',a155_0x18f945(0x203),a155_0x18f945(0x1eb)]);export function linkEffectiveRuntimeSkills(_0x72ca99,_0x34180f){const _0x3e4c31=a155_0x18f945,_0xe307f1=new Map();for(const _0x27d74a of _0x72ca99){const _0x59d09c=_0x27d74a[_0x3e4c31(0x1ea)][_0x3e4c31(0x1d4)];if(!_0x59d09c)continue;const _0x59a7e8=_0xe307f1[_0x3e4c31(0x1db)](_0x59d09c);(!_0x59a7e8||_0x27d74a[_0x3e4c31(0x1fe)]===_0x3e4c31(0x1e5))&&_0xe307f1['set'](_0x59d09c,_0x27d74a);}const _0x36fd6f=[];for(const _0x5603fe of _0xe307f1[_0x3e4c31(0x207)]()){const _0x3d07b2=requireSkillCode(_0x5603fe[_0x3e4c31(0x1ea)]),_0x17a04e=readMetadataIfPresent(_0x5603fe[_0x3e4c31(0x20a)]);if(_0x17a04e?.[_0x3e4c31(0x1ee)]!==_0x34180f[_0x3e4c31(0x1ee)]||_0x17a04e[_0x3e4c31(0x1d4)]!==_0x3d07b2)throw CliErrors[_0x3e4c31(0x1f1)](_0x3e4c31(0x1d5)+_0x34180f[_0x3e4c31(0x1ee)]+':\x20'+_0x5603fe[_0x3e4c31(0x20a)]);const _0x1ff646=runtimeSkillLinkName(_0x34180f,_0x3d07b2);for(const _0x44ebd9 of _0x34180f[_0x3e4c31(0x1d3)]){_0x36fd6f[_0x3e4c31(0x1f8)](ensureManagedSymlink(resolve(_0x44ebd9,_0x1ff646),_0x5603fe[_0x3e4c31(0x1e1)],_0x34180f,_0x3d07b2));}}return _0x36fd6f;}export function pruneStaleRuntimeSkillLinks(_0x4cba53,_0x5d0e5c,_0x44c9a1){const _0x2609a0=a155_0x18f945,_0x35dc9=new Set([..._0x5d0e5c][_0x2609a0(0x1dc)](_0x469f8b=>_0x469f8b[_0x2609a0(0x1d7)]())[_0x2609a0(0x209)](Boolean)),_0x1bcce6=_0x44c9a1?new Set([..._0x44c9a1]['map'](_0x3709f2=>_0x3709f2[_0x2609a0(0x1d7)]())['filter'](Boolean)):undefined,_0x5ea9f1=[];for(const _0x22a9b9 of _0x4cba53[_0x2609a0(0x1d3)]){for(const _0x4a2780 of managedTargetSkillLinkPaths(_0x22a9b9,_0x4cba53)){const _0x38d121=runtimeSkillCodeFromLink(_0x4cba53,_0x4a2780);if(_0x1bcce6&&!_0x1bcce6['has'](_0x38d121))continue;if(_0x35dc9[_0x2609a0(0x201)](_0x38d121))continue;_0x5ea9f1[_0x2609a0(0x1f8)](removeManagedSkillLink(_0x4a2780,_0x4cba53,_0x38d121));}}return _0x5ea9f1;}export function pruneStaleRuntimeSkillCache(_0x9b65d6,_0x408381={}){const _0x4a002c=a155_0x18f945,_0x3c7024=new Set([..._0x9b65d6[_0x4a002c(0x1e6)]]['map'](_0x5e6240=>_0x5e6240['trim']())[_0x4a002c(0x209)](Boolean)),_0x2f2c7a=_0x9b65d6[_0x4a002c(0x1e3)]?new Set([..._0x9b65d6['pruneSkillCodes']][_0x4a002c(0x1dc)](_0x1893e0=>_0x1893e0['trim']())[_0x4a002c(0x209)](Boolean)):undefined,_0x1aa664=_0x9b65d6[_0x4a002c(0x1fb)]??['personal',_0x4a002c(0x1fa)],_0x566b45=resolve(getRuntimeSkillCacheRoot(_0x9b65d6[_0x4a002c(0x206)],_0x9b65d6['accessKey'],_0x408381),safePathSegment(_0x9b65d6[_0x4a002c(0x1ee)],_0x4a002c(0x1ee))),_0xd90c72=[];for(const _0x5a3fcf of _0x1aa664){const _0x51231f=resolve(_0x566b45,_0x5a3fcf);if(!existsSync(_0x51231f))continue;for(const _0x25ff1e of readdirSync(_0x51231f,{'withFileTypes':!![]})){if(!_0x25ff1e['isDirectory']())continue;const _0x2aee89=_0x25ff1e[_0x4a002c(0x1ed)];if(_0x2f2c7a&&!_0x2f2c7a['has'](_0x2aee89))continue;if(_0x3c7024[_0x4a002c(0x201)](_0x2aee89))continue;const _0x1e25a0=resolve(_0x51231f,_0x2aee89),_0x10bc90=readMetadataIfPresent(resolve(_0x1e25a0,METADATA_FILE));if(_0x10bc90?.[_0x4a002c(0x1ee)]!==_0x9b65d6[_0x4a002c(0x1ee)]||_0x10bc90['scope']!==_0x5a3fcf||_0x10bc90[_0x4a002c(0x1d4)]!==_0x2aee89){_0xd90c72[_0x4a002c(0x1f8)]({'path':_0x1e25a0,'action':_0x4a002c(0x1f3),'reason':_0x4a002c(0x1de)});continue;}if(isLinkedFromAnyRoot(_0x1e25a0,_0x9b65d6['protectedLinkRoots']??[])){_0xd90c72[_0x4a002c(0x1f8)]({'path':_0x1e25a0,'action':_0x4a002c(0x1f3),'reason':_0x4a002c(0x1e4)});continue;}removeSync(_0x1e25a0),_0xd90c72[_0x4a002c(0x1f8)]({'path':_0x1e25a0,'action':_0x4a002c(0x202)});}}return _0xd90c72;}export function linkGlobalRuntimeSkills(_0x2272a9,_0x29e19d={}){const _0x457940=a155_0x18f945,_0x4b121e=resolveSkillSyncPaths(_0x29e19d),_0x59ccf6=[];for(const _0x2d085e of _0x2272a9){if(_0x2d085e[_0x457940(0x1fe)]!=='builtin')throw CliErrors[_0x457940(0x1f1)](_0x457940(0x1e7)+_0x2d085e[_0x457940(0x1fe)]);const _0x3483bb=requireSkillCode(_0x2d085e[_0x457940(0x1ea)]),_0x26d876=copyManagedSkillDirectory(_0x2d085e['dir'],resolve(_0x4b121e[_0x457940(0x1fd)],_0x3483bb));_0x59ccf6['push']({..._0x26d876,'contentHash':_0x2d085e[_0x457940(0x20d)]});}return _0x59ccf6;}function ensureManagedSymlink(_0x3c4de9,_0x3be348,_0x44b073,_0x133e37){const _0x5dcc77=a155_0x18f945;mkdirSync(dirname(_0x3c4de9),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x3c4de9)||isDanglingSymlink(_0x3c4de9)){const _0x6f8dec=lstatSync(_0x3c4de9);if(!_0x6f8dec[_0x5dcc77(0x1f2)]())throw CliErrors[_0x5dcc77(0x1f1)]('Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20'+_0x3c4de9);const _0x94218d=resolveSymlinkTarget(_0x3c4de9);if(!isPathInside(realOrResolved(_0x94218d),realOrResolved(_0x44b073['managedRoot'])))throw CliErrors['validation'](_0x5dcc77(0x1f0)+_0x3c4de9);if(realOrResolved(_0x94218d)===realOrResolved(_0x3be348))return{'path':_0x3c4de9,'target':_0x3be348,'action':_0x5dcc77(0x20b)};const _0xa0388d=readMetadataIfPresent(resolve(_0x94218d,METADATA_FILE));if(_0x44b073[_0x5dcc77(0x1fe)]===_0x5dcc77(0x1f6)&&(_0xa0388d?.['appCode']!==_0x44b073[_0x5dcc77(0x1ee)]||_0xa0388d['skillCode']!==_0x133e37))throw CliErrors['validation'](_0x5dcc77(0x205)+_0x3c4de9);return unlinkSync(_0x3c4de9),symlinkSync(_0x3be348,_0x3c4de9,_0x5dcc77(0x1e1)),{'path':_0x3c4de9,'target':_0x3be348,'action':_0x5dcc77(0x1df)};}return symlinkSync(_0x3be348,_0x3c4de9,_0x5dcc77(0x1e1)),{'path':_0x3c4de9,'target':_0x3be348,'action':_0x5dcc77(0x1d9)};}function managedTargetSkillLinkPaths(_0x405cbf,_0x319844){const _0x5f5b8f=a155_0x18f945;if(!existsSync(_0x405cbf))return[];const _0x80c395=_0x319844[_0x5f5b8f(0x1ee)]+'--';return readdirSync(_0x405cbf,{'withFileTypes':!![]})[_0x5f5b8f(0x209)](_0x177c99=>_0x319844[_0x5f5b8f(0x1fe)]===_0x5f5b8f(0x1f6)||_0x177c99[_0x5f5b8f(0x1ed)]['startsWith'](_0x80c395))[_0x5f5b8f(0x1dc)](_0x16107b=>resolve(_0x405cbf,_0x16107b['name']));}function removeManagedSkillLink(_0x580a5e,_0x5aabb,_0x211d5d){const _0x354bd5=a155_0x18f945,_0x38ed5a=lstatIfPresent(_0x580a5e);if(!_0x38ed5a?.['isSymbolicLink']())return{'path':_0x580a5e,'action':_0x354bd5(0x1f3),'reason':_0x354bd5(0x1e8)};const _0x3ee49f=resolveSymlinkTarget(_0x580a5e);if(!isPathInside(realOrResolved(_0x3ee49f),realOrResolved(_0x5aabb[_0x354bd5(0x1da)])))return{'path':_0x580a5e,'action':_0x354bd5(0x1f3),'reason':_0x354bd5(0x1d8)};const _0x4a133f=readMetadataIfPresent(resolve(_0x3ee49f,METADATA_FILE));if(_0x5aabb['scope']===_0x354bd5(0x1f6)&&(_0x4a133f?.[_0x354bd5(0x1ee)]!==_0x5aabb[_0x354bd5(0x1ee)]||_0x4a133f[_0x354bd5(0x1d4)]!==_0x211d5d))return{'path':_0x580a5e,'action':_0x354bd5(0x1f3),'reason':_0x354bd5(0x1de)};return unlinkSync(_0x580a5e),{'path':_0x580a5e,'action':_0x354bd5(0x202)};}function isLinkedFromAnyRoot(_0x1bfab1,_0x304f03){const _0x3c3e57=realOrResolved(_0x1bfab1);for(const _0x5bcb43 of _0x304f03){if(!existsSync(_0x5bcb43))continue;for(const _0x1138a7 of readdirSync(_0x5bcb43,{'withFileTypes':!![]})){if(!_0x1138a7['isSymbolicLink']())continue;const _0x4ab7f0=resolve(_0x5bcb43,_0x1138a7['name']);if(realOrResolved(resolveSymlinkTarget(_0x4ab7f0))===_0x3c3e57)return!![];}}return![];}function runtimeSkillLinkName(_0x27aa2b,_0x4b90de){const _0x5dec5c=a155_0x18f945,_0x25b39a=safePathSegment(_0x4b90de,_0x5dec5c(0x1d4));if(_0x27aa2b[_0x5dec5c(0x1fe)]===_0x5dec5c(0x1f6)&&RESERVED_PROJECT_SKILL_CODES[_0x5dec5c(0x201)](_0x25b39a))throw CliErrors[_0x5dec5c(0x1f1)](_0x5dec5c(0x1f5)+_0x25b39a);return _0x27aa2b[_0x5dec5c(0x1fe)]===_0x5dec5c(0x1f6)?_0x25b39a:_0x27aa2b[_0x5dec5c(0x1ee)]+'--'+_0x25b39a;}function runtimeSkillCodeFromLink(_0x57053a,_0x21358e){const _0x4e881d=a155_0x18f945,_0x906aae=basename(_0x21358e);return _0x57053a[_0x4e881d(0x1fe)]==='project'?_0x906aae:_0x906aae[_0x4e881d(0x1d6)]((_0x57053a[_0x4e881d(0x1ee)]+'--')['length']);}export function copyManagedSkillDirectory(_0x5d2cab,_0x3c0f83){const _0x32415a=a155_0x18f945,_0x110d18=resolve(_0x3c0f83,METADATA_FILE),_0x3aded7=existsSync(_0x3c0f83);if(_0x3aded7){const _0x518d8b=lstatSync(_0x3c0f83);if(_0x518d8b[_0x32415a(0x1f2)]())throw CliErrors['validation'](_0x32415a(0x1f4)+_0x3c0f83);if(!_0x518d8b['isDirectory']())throw CliErrors[_0x32415a(0x1f1)]('Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20'+_0x3c0f83);const _0x246bb0=readMetadataIfPresent(_0x110d18);if(_0x246bb0?.[_0x32415a(0x1fe)]!==_0x32415a(0x20c))throw CliErrors[_0x32415a(0x1f1)](_0x32415a(0x200)+_0x3c0f83);}ensureDirSync(dirname(_0x3c0f83));const _0x8e16cc=_0x3aded7?readMetadataIfPresent(_0x110d18)?.[_0x32415a(0x20d)]:undefined,_0x1de5fe=readMetadataIfPresent(resolve(_0x5d2cab,METADATA_FILE))?.[_0x32415a(0x20d)];return _0x3aded7&&removeSync(_0x3c0f83),copySkillDirectory(_0x5d2cab,_0x3c0f83),{'path':_0x3c0f83,'target':_0x5d2cab,'action':!_0x3aded7?'created':_0x8e16cc===_0x1de5fe?_0x32415a(0x20b):'updated'};}function copySkillDirectory(_0x54adf9,_0x52568f){copySync(_0x54adf9,_0x52568f,{'dereference':![],'overwrite':!![],'filter'(_0x28715f){const _0x5b1267=a155_0x760f;if(lstatSync(_0x28715f)[_0x5b1267(0x1f2)]())throw CliErrors[_0x5b1267(0x1f1)](_0x5b1267(0x1dd)+_0x28715f);return!![];}});}
1
+ const a158_0x3369ab=a158_0x5f88;(function(_0x1a6bc9,_0x4aad0d){const _0x24f462=a158_0x5f88,_0x161775=_0x1a6bc9();while(!![]){try{const _0x4c1940=parseInt(_0x24f462(0xe5))/0x1+parseInt(_0x24f462(0xd1))/0x2+parseInt(_0x24f462(0xe7))/0x3*(-parseInt(_0x24f462(0xdc))/0x4)+-parseInt(_0x24f462(0xe3))/0x5+-parseInt(_0x24f462(0xdd))/0x6*(parseInt(_0x24f462(0xb6))/0x7)+-parseInt(_0x24f462(0xca))/0x8*(-parseInt(_0x24f462(0xb4))/0x9)+parseInt(_0x24f462(0xd3))/0xa;if(_0x4c1940===_0x4aad0d)break;else _0x161775['push'](_0x161775['shift']());}catch(_0x2ea4c8){_0x161775['push'](_0x161775['shift']());}}}(a158_0x5b03,0xdd872));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import a158_0x1fd0ef from'fs-extra';import{CliErrors}from'../../errors.js';function a158_0x5f88(_0x5c3d2b,_0x5e23c2){_0x5c3d2b=_0x5c3d2b-0xb3;const _0x5b0320=a158_0x5b03();let _0x5f8811=_0x5b0320[_0x5c3d2b];return _0x5f8811;}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}=a158_0x1fd0ef,RESERVED_PROJECT_SKILL_CODES=new Set([a158_0x3369ab(0xed),a158_0x3369ab(0xcd),a158_0x3369ab(0xd4)]);export function linkEffectiveRuntimeSkills(_0x43d090,_0x1bfe88){const _0x2b9256=a158_0x3369ab,_0x3ae4bd=new Map();for(const _0x63760d of _0x43d090){const _0x17d793=_0x63760d[_0x2b9256(0xbf)][_0x2b9256(0xb9)];if(!_0x17d793)continue;const _0x32f70c=_0x3ae4bd[_0x2b9256(0xc8)](_0x17d793);(!_0x32f70c||_0x63760d[_0x2b9256(0xb8)]===_0x2b9256(0xc3))&&_0x3ae4bd['set'](_0x17d793,_0x63760d);}const _0x1fa843=[];for(const _0x55bdab of _0x3ae4bd['values']()){const _0x4e1e60=requireSkillCode(_0x55bdab[_0x2b9256(0xbf)]),_0x26dbc2=readMetadataIfPresent(_0x55bdab[_0x2b9256(0xd0)]);if(_0x26dbc2?.[_0x2b9256(0xee)]!==_0x1bfe88[_0x2b9256(0xee)]||_0x26dbc2[_0x2b9256(0xb9)]!==_0x4e1e60)throw CliErrors[_0x2b9256(0xc2)](_0x2b9256(0xc7)+_0x1bfe88['appCode']+':\x20'+_0x55bdab['metadataPath']);const _0x3b1592=runtimeSkillLinkName(_0x1bfe88,_0x4e1e60);for(const _0x23f6f6 of _0x1bfe88[_0x2b9256(0xd6)]){_0x1fa843[_0x2b9256(0xbb)](ensureManagedSymlink(resolve(_0x23f6f6,_0x3b1592),_0x55bdab[_0x2b9256(0xc0)],_0x1bfe88,_0x4e1e60));}}return _0x1fa843;}export function pruneStaleRuntimeSkillLinks(_0xd68956,_0xf03222,_0x536121){const _0x4eb8bf=a158_0x3369ab,_0x53d6f6=new Set([..._0xf03222]['map'](_0x26bc8e=>_0x26bc8e[_0x4eb8bf(0xec)]())[_0x4eb8bf(0xde)](Boolean)),_0x2c7f20=_0x536121?new Set([..._0x536121][_0x4eb8bf(0xb3)](_0x551c96=>_0x551c96[_0x4eb8bf(0xec)]())[_0x4eb8bf(0xde)](Boolean)):undefined,_0x39ba14=[];for(const _0x1b207b of _0xd68956['skillRoots']){for(const _0x5dfe7f of managedTargetSkillLinkPaths(_0x1b207b,_0xd68956)){const _0x50b9d5=runtimeSkillCodeFromLink(_0xd68956,_0x5dfe7f);if(_0x2c7f20&&!_0x2c7f20[_0x4eb8bf(0xd5)](_0x50b9d5))continue;if(_0x53d6f6[_0x4eb8bf(0xd5)](_0x50b9d5))continue;_0x39ba14['push'](removeManagedSkillLink(_0x5dfe7f,_0xd68956,_0x50b9d5));}}return _0x39ba14;}export function pruneStaleRuntimeSkillCache(_0x4e63d3,_0x52f7b8={}){const _0x4fa04a=a158_0x3369ab,_0x26d708=new Set([..._0x4e63d3[_0x4fa04a(0xcc)]][_0x4fa04a(0xb3)](_0x4f7c47=>_0x4f7c47[_0x4fa04a(0xec)]())[_0x4fa04a(0xde)](Boolean)),_0x4cff04=_0x4e63d3[_0x4fa04a(0xe2)]?new Set([..._0x4e63d3[_0x4fa04a(0xe2)]][_0x4fa04a(0xb3)](_0x12e2bd=>_0x12e2bd[_0x4fa04a(0xec)]())[_0x4fa04a(0xde)](Boolean)):undefined,_0x50800f=_0x4e63d3[_0x4fa04a(0xe0)]??[_0x4fa04a(0xc3),_0x4fa04a(0xcb)],_0x4e6f2f=resolve(getRuntimeSkillCacheRoot(_0x4e63d3[_0x4fa04a(0xcf)],_0x4e63d3[_0x4fa04a(0xe4)],_0x52f7b8),safePathSegment(_0x4e63d3[_0x4fa04a(0xee)],'appCode')),_0x4ecbfc=[];for(const _0x2a9c09 of _0x50800f){const _0xec4c64=resolve(_0x4e6f2f,_0x2a9c09);if(!existsSync(_0xec4c64))continue;for(const _0x31893f of readdirSync(_0xec4c64,{'withFileTypes':!![]})){if(!_0x31893f[_0x4fa04a(0xc1)]())continue;const _0x10b285=_0x31893f['name'];if(_0x4cff04&&!_0x4cff04[_0x4fa04a(0xd5)](_0x10b285))continue;if(_0x26d708[_0x4fa04a(0xd5)](_0x10b285))continue;const _0x4e9ea7=resolve(_0xec4c64,_0x10b285),_0x4a1e3c=readMetadataIfPresent(resolve(_0x4e9ea7,METADATA_FILE));if(_0x4a1e3c?.[_0x4fa04a(0xee)]!==_0x4e63d3[_0x4fa04a(0xee)]||_0x4a1e3c[_0x4fa04a(0xb8)]!==_0x2a9c09||_0x4a1e3c[_0x4fa04a(0xb9)]!==_0x10b285){_0x4ecbfc[_0x4fa04a(0xbb)]({'path':_0x4e9ea7,'action':_0x4fa04a(0xe9),'reason':_0x4fa04a(0xb7)});continue;}if(isLinkedFromAnyRoot(_0x4e9ea7,_0x4e63d3['protectedLinkRoots']??[])){_0x4ecbfc['push']({'path':_0x4e9ea7,'action':_0x4fa04a(0xe9),'reason':_0x4fa04a(0xeb)});continue;}removeSync(_0x4e9ea7),_0x4ecbfc[_0x4fa04a(0xbb)]({'path':_0x4e9ea7,'action':'removed'});}}return _0x4ecbfc;}export function linkGlobalRuntimeSkills(_0x3fda71,_0x581434={}){const _0x31c127=a158_0x3369ab,_0x29a227=resolveSkillSyncPaths(_0x581434),_0x2a07c0=[];for(const _0x37d48a of _0x3fda71){if(_0x37d48a[_0x31c127(0xb8)]!=='builtin')throw CliErrors[_0x31c127(0xc2)]('Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20'+_0x37d48a[_0x31c127(0xb8)]);const _0x43f025=requireSkillCode(_0x37d48a[_0x31c127(0xbf)]),_0x234e13=copyManagedSkillDirectory(_0x37d48a['dir'],resolve(_0x29a227[_0x31c127(0xc4)],_0x43f025));_0x2a07c0[_0x31c127(0xbb)]({..._0x234e13,'contentHash':_0x37d48a[_0x31c127(0xce)]});}return _0x2a07c0;}function ensureManagedSymlink(_0x576b62,_0x1fa5d1,_0xd8fb4d,_0x4d7856){const _0xadc71c=a158_0x3369ab;mkdirSync(dirname(_0x576b62),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x576b62)||isDanglingSymlink(_0x576b62)){const _0x22282b=lstatSync(_0x576b62);if(!_0x22282b[_0xadc71c(0xc9)]())throw CliErrors[_0xadc71c(0xc2)](_0xadc71c(0xe1)+_0x576b62);const _0x4fcb11=resolveSymlinkTarget(_0x576b62);if(!isPathInside(realOrResolved(_0x4fcb11),realOrResolved(_0xd8fb4d['managedRoot'])))throw CliErrors[_0xadc71c(0xc2)](_0xadc71c(0xd8)+_0x576b62);if(realOrResolved(_0x4fcb11)===realOrResolved(_0x1fa5d1))return{'path':_0x576b62,'target':_0x1fa5d1,'action':'unchanged'};const _0x46085f=readMetadataIfPresent(resolve(_0x4fcb11,METADATA_FILE));if(_0xd8fb4d[_0xadc71c(0xb8)]===_0xadc71c(0xc6)&&(_0x46085f?.[_0xadc71c(0xee)]!==_0xd8fb4d[_0xadc71c(0xee)]||_0x46085f[_0xadc71c(0xb9)]!==_0x4d7856))throw CliErrors['validation'](_0xadc71c(0xbe)+_0x576b62);return unlinkSync(_0x576b62),symlinkSync(_0x1fa5d1,_0x576b62,_0xadc71c(0xc0)),{'path':_0x576b62,'target':_0x1fa5d1,'action':_0xadc71c(0xbd)};}return symlinkSync(_0x1fa5d1,_0x576b62,_0xadc71c(0xc0)),{'path':_0x576b62,'target':_0x1fa5d1,'action':_0xadc71c(0xef)};}function managedTargetSkillLinkPaths(_0x3cd6b2,_0x1d73b2){const _0x136736=a158_0x3369ab;if(!existsSync(_0x3cd6b2))return[];const _0x5bfb9a=_0x1d73b2['appCode']+'--';return readdirSync(_0x3cd6b2,{'withFileTypes':!![]})['filter'](_0x4b1612=>_0x1d73b2[_0x136736(0xb8)]===_0x136736(0xc6)||_0x4b1612[_0x136736(0xd7)][_0x136736(0xdf)](_0x5bfb9a))[_0x136736(0xb3)](_0x14c1ba=>resolve(_0x3cd6b2,_0x14c1ba[_0x136736(0xd7)]));}function removeManagedSkillLink(_0x1665dd,_0x4de1a3,_0x21b37e){const _0x52f05e=a158_0x3369ab,_0x2d293c=lstatIfPresent(_0x1665dd);if(!_0x2d293c?.[_0x52f05e(0xc9)]())return{'path':_0x1665dd,'action':_0x52f05e(0xe9),'reason':_0x52f05e(0xd2)};const _0x39e1d1=resolveSymlinkTarget(_0x1665dd);if(!isPathInside(realOrResolved(_0x39e1d1),realOrResolved(_0x4de1a3[_0x52f05e(0xb5)])))return{'path':_0x1665dd,'action':_0x52f05e(0xe9),'reason':_0x52f05e(0xe6)};const _0x6f43d4=readMetadataIfPresent(resolve(_0x39e1d1,METADATA_FILE));if(_0x4de1a3[_0x52f05e(0xb8)]==='project'&&(_0x6f43d4?.['appCode']!==_0x4de1a3['appCode']||_0x6f43d4[_0x52f05e(0xb9)]!==_0x21b37e))return{'path':_0x1665dd,'action':_0x52f05e(0xe9),'reason':_0x52f05e(0xb7)};return unlinkSync(_0x1665dd),{'path':_0x1665dd,'action':_0x52f05e(0xba)};}function isLinkedFromAnyRoot(_0x24ae27,_0x240678){const _0xe9a21b=realOrResolved(_0x24ae27);for(const _0x122131 of _0x240678){if(!existsSync(_0x122131))continue;for(const _0x324610 of readdirSync(_0x122131,{'withFileTypes':!![]})){if(!_0x324610['isSymbolicLink']())continue;const _0xa72ac3=resolve(_0x122131,_0x324610['name']);if(realOrResolved(resolveSymlinkTarget(_0xa72ac3))===_0xe9a21b)return!![];}}return![];}function runtimeSkillLinkName(_0x3202d7,_0x2310b7){const _0x1d3379=a158_0x3369ab,_0x1e25f0=safePathSegment(_0x2310b7,_0x1d3379(0xb9));if(_0x3202d7[_0x1d3379(0xb8)]===_0x1d3379(0xc6)&&RESERVED_PROJECT_SKILL_CODES[_0x1d3379(0xd5)](_0x1e25f0))throw CliErrors[_0x1d3379(0xc2)](_0x1d3379(0xdb)+_0x1e25f0);return _0x3202d7['scope']===_0x1d3379(0xc6)?_0x1e25f0:_0x3202d7[_0x1d3379(0xee)]+'--'+_0x1e25f0;}function runtimeSkillCodeFromLink(_0x4c4a41,_0x254662){const _0xa92c9e=a158_0x3369ab,_0x4b60ab=basename(_0x254662);return _0x4c4a41[_0xa92c9e(0xb8)]===_0xa92c9e(0xc6)?_0x4b60ab:_0x4b60ab[_0xa92c9e(0xea)]((_0x4c4a41[_0xa92c9e(0xee)]+'--')['length']);}export function copyManagedSkillDirectory(_0x151b9e,_0x585dbf){const _0x29d50e=a158_0x3369ab,_0x41b083=resolve(_0x585dbf,METADATA_FILE),_0x5bc066=existsSync(_0x585dbf);if(_0x5bc066){const _0x4e4582=lstatSync(_0x585dbf);if(_0x4e4582[_0x29d50e(0xc9)]())throw CliErrors[_0x29d50e(0xc2)]('Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20'+_0x585dbf);if(!_0x4e4582[_0x29d50e(0xc1)]())throw CliErrors[_0x29d50e(0xc2)](_0x29d50e(0xbc)+_0x585dbf);const _0xb85799=readMetadataIfPresent(_0x41b083);if(_0xb85799?.[_0x29d50e(0xb8)]!==_0x29d50e(0xc5))throw CliErrors[_0x29d50e(0xc2)](_0x29d50e(0xe8)+_0x585dbf);}ensureDirSync(dirname(_0x585dbf));const _0x3c4aa0=_0x5bc066?readMetadataIfPresent(_0x41b083)?.[_0x29d50e(0xce)]:undefined,_0x550f13=readMetadataIfPresent(resolve(_0x151b9e,METADATA_FILE))?.[_0x29d50e(0xce)];return _0x5bc066&&removeSync(_0x585dbf),copySkillDirectory(_0x151b9e,_0x585dbf),{'path':_0x585dbf,'target':_0x151b9e,'action':!_0x5bc066?_0x29d50e(0xef):_0x3c4aa0===_0x550f13?_0x29d50e(0xd9):_0x29d50e(0xbd)};}function copySkillDirectory(_0x1a7a7b,_0x4defaf){copySync(_0x1a7a7b,_0x4defaf,{'dereference':![],'overwrite':!![],'filter'(_0x39a814){const _0x3ba595=a158_0x5f88;if(lstatSync(_0x39a814)[_0x3ba595(0xc9)]())throw CliErrors['validation'](_0x3ba595(0xda)+_0x39a814);return!![];}});}function a158_0x5b03(){const _0x135375=['Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20','skill','dir','isDirectory','validation','personal','agentsSkillsDir','builtin','project','Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20','get','isSymbolicLink','19760lMrvrv','company','activeSkillCodes','runtime-observe','contentHash','env','metadataPath','2331942EAHOEV','not-managed-symlink','175130mnaFoS','secret-retriever','has','skillRoots','name','Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20','unchanged','Refusing\x20to\x20copy\x20Skill\x20symlink:\x20','Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20','143788DkalOY','4202070zqUeVn','filter','startsWith','scopes','Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20','pruneSkillCodes','7116650zpvNaW','accessKey','1131533OpGyfZ','external-symlink','6TeOFyZ','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20','skipped','slice','linked-from-protected-root','trim','lovrabet','appCode','created','map','2871yAMpXx','managedRoot','7IekXJY','metadata-mismatch','scope','skillCode','removed','push','Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20','updated'];a158_0x5b03=function(){return _0x135375;};return a158_0x5b03();}
@@ -1 +1 @@
1
- function a156_0x5d8b(){const _0x9e157c=['Runtime\x20Skill\x20install\x20target\x20app\x20mismatch:\x20','isDirectory','includes','cacheDir','set','271838bdGbKf','1057577vXqfKb','2KheEdM','isArray','values','push','sort','source','5863670oXBuTS','has','9xEDGRl','localeCompare','from','18QIxtLA','skillRoots','trim','metadataPath','link','dir','22195620EoAlKY','map','skillCode','4774888IHyKvO','appCode','scopes','\x20!=\x20','filter','get','name','accessKey','env','startsWith','skillMdPath','linkedPaths','scope','validation','3709662xdJohE','project','linkedPath','isSymbolicLink','cache','builtin','1554528TYwfvg'];a156_0x5d8b=function(){return _0x9e157c;};return a156_0x5d8b();}(function(_0x579418,_0x10b7be){const _0x3cbd97=a156_0x2e55,_0x44aa32=_0x579418();while(!![]){try{const _0x32efe7=-parseInt(_0x3cbd97(0x1da))/0x1*(parseInt(_0x3cbd97(0x1db))/0x2)+-parseInt(_0x3cbd97(0x1cd))/0x3+parseInt(_0x3cbd97(0x1d3))/0x4+parseInt(_0x3cbd97(0x1e1))/0x5+-parseInt(_0x3cbd97(0x1b6))/0x6*(parseInt(_0x3cbd97(0x1d9))/0x7)+-parseInt(_0x3cbd97(0x1bf))/0x8*(parseInt(_0x3cbd97(0x1e3))/0x9)+parseInt(_0x3cbd97(0x1bc))/0xa;if(_0x32efe7===_0x10b7be)break;else _0x44aa32['push'](_0x44aa32['shift']());}catch(_0x4c7dcd){_0x44aa32['push'](_0x44aa32['shift']());}}}(a156_0x5d8b,0xbcd3a));import{existsSync,readdirSync}from'node:fs';import{resolve}from'node:path';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{readMetadataIfPresent}from'./metadata.js';import{getRuntimeSkillCacheRoot,safePathSegment}from'./paths.js';import{isRuntimeSkillScope,normalizeRuntimeSkillScopes}from'./scopes.js';export function listLocalRuntimeSkills(_0x55c288,_0x4e2833,_0x2f7529={}){const _0x58e4b2=a156_0x2e55,_0x1f76fe=safePathSegment(_0x55c288[_0x58e4b2(0x1c0)],_0x58e4b2(0x1c0));if(_0x4e2833['appCode']!==_0x1f76fe)throw CliErrors[_0x58e4b2(0x1cc)](_0x58e4b2(0x1d4)+_0x4e2833[_0x58e4b2(0x1c0)]+_0x58e4b2(0x1c2)+_0x1f76fe);const _0x347e30=normalizeRuntimeSkillScopes(_0x55c288['scopes']),_0x37b9c9=new Set(_0x347e30),_0x484723=_0x55c288['code']?.[_0x58e4b2(0x1b8)](),_0x43abcd=new Map(),_0x232a7a=resolve(getRuntimeSkillCacheRoot(_0x55c288[_0x58e4b2(0x1c7)],_0x55c288[_0x58e4b2(0x1c6)],_0x2f7529),_0x1f76fe);for(const _0x4464e8 of _0x347e30){for(const _0x2eab51 of localSkillEntryDirs(resolve(_0x232a7a,_0x4464e8))){collectLocalRuntimeSkill(_0x43abcd,_0x2eab51,{'appCode':_0x1f76fe,'scopes':_0x37b9c9,'code':_0x484723,'source':'cache'});}}for(const _0x27f36f of _0x4e2833[_0x58e4b2(0x1b7)]){for(const _0xf7b797 of localSkillLinkCandidates(_0x27f36f,_0x4e2833,_0x37b9c9)){collectLocalRuntimeSkill(_0x43abcd,_0xf7b797,{'appCode':_0x1f76fe,'scopes':_0x37b9c9,'code':_0x484723,'source':_0x58e4b2(0x1ba),'linkedPath':_0xf7b797});}}return Array[_0x58e4b2(0x1e5)](_0x43abcd[_0x58e4b2(0x1dd)]())[_0x58e4b2(0x1df)](compareLocalRuntimeSkills);}function localSkillEntryDirs(_0x29c501){const _0x35a666=a156_0x2e55;if(!existsSync(_0x29c501))return[];return readdirSync(_0x29c501,{'withFileTypes':!![]})['filter'](_0x2deaa7=>_0x2deaa7[_0x35a666(0x1d5)]()||_0x2deaa7[_0x35a666(0x1d0)]())[_0x35a666(0x1bd)](_0x15c75c=>resolve(_0x29c501,_0x15c75c[_0x35a666(0x1c5)]));}function a156_0x2e55(_0x16702c,_0x180c5d){_0x16702c=_0x16702c-0x1b6;const _0x5d8bd1=a156_0x5d8b();let _0x2e5537=_0x5d8bd1[_0x16702c];return _0x2e5537;}function localSkillLinkCandidates(_0x1365ea,_0x574f82,_0x281159){const _0x3a7c26=a156_0x2e55;if(!existsSync(_0x1365ea))return[];const _0x523e69=_0x574f82[_0x3a7c26(0x1c0)]+'--';return readdirSync(_0x1365ea,{'withFileTypes':!![]})['filter'](_0x56df93=>_0x56df93[_0x3a7c26(0x1d5)]()||_0x56df93[_0x3a7c26(0x1d0)]())[_0x3a7c26(0x1c3)](_0x3f3117=>_0x574f82[_0x3a7c26(0x1cb)]===_0x3a7c26(0x1ce)||_0x3f3117['name'][_0x3a7c26(0x1c8)](_0x523e69)||_0x281159[_0x3a7c26(0x1e2)](_0x3a7c26(0x1d2)))[_0x3a7c26(0x1bd)](_0x212eeb=>resolve(_0x1365ea,_0x212eeb[_0x3a7c26(0x1c5)]));}function collectLocalRuntimeSkill(_0x22b5d1,_0x53e48a,_0x39584b){const _0x304811=a156_0x2e55,_0x16765e=resolve(_0x53e48a,METADATA_FILE),_0x49be51=readMetadataIfPresent(_0x16765e);if(!_0x49be51)return;if(_0x49be51[_0x304811(0x1c0)]!==_0x39584b[_0x304811(0x1c0)])return;if(!isRuntimeSkillScope(_0x49be51['scope'])||!_0x39584b[_0x304811(0x1c1)][_0x304811(0x1e2)](_0x49be51['scope']))return;const _0x825234=_0x49be51[_0x304811(0x1be)]?.[_0x304811(0x1b8)]();if(!_0x825234)return;if(_0x39584b['code']&&_0x825234!==_0x39584b['code'])return;const _0x1c54b6=_0x49be51[_0x304811(0x1cb)]+':'+_0x825234,_0x3c10af=_0x39584b[_0x304811(0x1cf)]?[_0x39584b[_0x304811(0x1cf)]]:[],_0x1a8c2f=_0x22b5d1[_0x304811(0x1c4)](_0x1c54b6);if(_0x1a8c2f){_0x39584b[_0x304811(0x1e0)]===_0x304811(0x1d1)&&(_0x1a8c2f['dir']=_0x53e48a,_0x1a8c2f[_0x304811(0x1d7)]=_0x53e48a,_0x1a8c2f[_0x304811(0x1c9)]=resolve(_0x53e48a,SKILL_FILE),_0x1a8c2f[_0x304811(0x1b9)]=_0x16765e);for(const _0x1e7105 of _0x3c10af){!_0x1a8c2f[_0x304811(0x1ca)][_0x304811(0x1d6)](_0x1e7105)&&_0x1a8c2f['linkedPaths'][_0x304811(0x1de)](_0x1e7105);}_0x1a8c2f[_0x304811(0x1ca)]['sort']();return;}_0x22b5d1[_0x304811(0x1d8)](_0x1c54b6,{..._0x49be51,'tags':Array[_0x304811(0x1dc)](_0x49be51['tags'])?_0x49be51['tags']:[],'scope':_0x49be51[_0x304811(0x1cb)],'source':'local','dir':_0x53e48a,'cacheDir':_0x39584b[_0x304811(0x1e0)]===_0x304811(0x1d1)?_0x53e48a:undefined,'skillMdPath':resolve(_0x53e48a,SKILL_FILE),'metadataPath':_0x16765e,'linkedPaths':_0x3c10af});}function compareLocalRuntimeSkills(_0x2c4b33,_0x176ca1){const _0x5c2f79=a156_0x2e55,_0x30d5df={'personal':0x0,'company':0x1,'builtin':0x2};return _0x30d5df[_0x2c4b33[_0x5c2f79(0x1cb)]]-_0x30d5df[_0x176ca1[_0x5c2f79(0x1cb)]]||_0x2c4b33[_0x5c2f79(0x1be)][_0x5c2f79(0x1e4)](_0x176ca1[_0x5c2f79(0x1be)])||_0x2c4b33[_0x5c2f79(0x1bb)][_0x5c2f79(0x1e4)](_0x176ca1['dir']);}
1
+ (function(_0x28e9f1,_0x569acf){const _0x1b7616=a159_0x1b16,_0x1a89ba=_0x28e9f1();while(!![]){try{const _0x255288=-parseInt(_0x1b7616(0x155))/0x1*(parseInt(_0x1b7616(0x149))/0x2)+parseInt(_0x1b7616(0x14f))/0x3+-parseInt(_0x1b7616(0x163))/0x4+parseInt(_0x1b7616(0x14d))/0x5*(parseInt(_0x1b7616(0x14e))/0x6)+parseInt(_0x1b7616(0x14c))/0x7+parseInt(_0x1b7616(0x15a))/0x8*(-parseInt(_0x1b7616(0x13f))/0x9)+parseInt(_0x1b7616(0x13e))/0xa;if(_0x255288===_0x569acf)break;else _0x1a89ba['push'](_0x1a89ba['shift']());}catch(_0x4ab759){_0x1a89ba['push'](_0x1a89ba['shift']());}}}(a159_0x11b2,0x7bb55));import{existsSync,readdirSync}from'node:fs';import{resolve}from'node:path';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{readMetadataIfPresent}from'./metadata.js';function a159_0x1b16(_0x4f7e4a,_0x737119){_0x4f7e4a=_0x4f7e4a-0x13c;const _0x11b240=a159_0x11b2();let _0x1b169c=_0x11b240[_0x4f7e4a];return _0x1b169c;}import{getRuntimeSkillCacheRoot,safePathSegment}from'./paths.js';import{isRuntimeSkillScope,normalizeRuntimeSkillScopes}from'./scopes.js';export function listLocalRuntimeSkills(_0x294c47,_0x529115,_0x1a2910={}){const _0x42d84b=a159_0x1b16,_0xf6604f=safePathSegment(_0x294c47['appCode'],'appCode');if(_0x529115[_0x42d84b(0x145)]!==_0xf6604f)throw CliErrors[_0x42d84b(0x15f)]('Runtime\x20Skill\x20install\x20target\x20app\x20mismatch:\x20'+_0x529115['appCode']+'\x20!=\x20'+_0xf6604f);const _0x3ffdce=normalizeRuntimeSkillScopes(_0x294c47[_0x42d84b(0x165)]),_0x4534d8=new Set(_0x3ffdce),_0x3061a0=_0x294c47[_0x42d84b(0x167)]?.[_0x42d84b(0x143)](),_0x2bedd8=new Map(),_0x4815fc=resolve(getRuntimeSkillCacheRoot(_0x294c47['env'],_0x294c47[_0x42d84b(0x164)],_0x1a2910),_0xf6604f);for(const _0x1209b0 of _0x3ffdce){for(const _0x2c44e2 of localSkillEntryDirs(resolve(_0x4815fc,_0x1209b0))){collectLocalRuntimeSkill(_0x2bedd8,_0x2c44e2,{'appCode':_0xf6604f,'scopes':_0x4534d8,'code':_0x3061a0,'source':'cache'});}}for(const _0x253304 of _0x529115[_0x42d84b(0x14b)]){for(const _0x175756 of localSkillLinkCandidates(_0x253304,_0x529115,_0x4534d8)){collectLocalRuntimeSkill(_0x2bedd8,_0x175756,{'appCode':_0xf6604f,'scopes':_0x4534d8,'code':_0x3061a0,'source':_0x42d84b(0x154),'linkedPath':_0x175756});}}return Array[_0x42d84b(0x158)](_0x2bedd8[_0x42d84b(0x166)]())[_0x42d84b(0x15c)](compareLocalRuntimeSkills);}function localSkillEntryDirs(_0x454616){const _0x31becf=a159_0x1b16;if(!existsSync(_0x454616))return[];return readdirSync(_0x454616,{'withFileTypes':!![]})[_0x31becf(0x159)](_0x207533=>_0x207533['isDirectory']()||_0x207533[_0x31becf(0x15b)]())[_0x31becf(0x157)](_0x25aaf1=>resolve(_0x454616,_0x25aaf1[_0x31becf(0x142)]));}function a159_0x11b2(){const _0x3b1e78=['406600RKTcvo','accessKey','scopes','values','code','builtin','dir','12620400zhxlGb','10026MJJuwT','scope','startsWith','name','trim','tags','appCode','linkedPaths','set','isDirectory','1724CbFQfg','includes','skillRoots','1615845gVbrYE','773685wQZuzQ','6PLHrnK','378705BXGbtQ','has','isArray','cache','metadataPath','link','892yXAFub','localeCompare','map','from','filter','2848pFDJUl','isSymbolicLink','sort','skillCode','local','validation','skillMdPath','source','linkedPath'];a159_0x11b2=function(){return _0x3b1e78;};return a159_0x11b2();}function localSkillLinkCandidates(_0x2e4155,_0x5a56fe,_0x28f0a2){const _0x3fc672=a159_0x1b16;if(!existsSync(_0x2e4155))return[];const _0x2a7b4b=_0x5a56fe[_0x3fc672(0x145)]+'--';return readdirSync(_0x2e4155,{'withFileTypes':!![]})[_0x3fc672(0x159)](_0xf553b8=>_0xf553b8[_0x3fc672(0x148)]()||_0xf553b8['isSymbolicLink']())[_0x3fc672(0x159)](_0x5c1a3b=>_0x5a56fe[_0x3fc672(0x140)]==='project'||_0x5c1a3b[_0x3fc672(0x142)][_0x3fc672(0x141)](_0x2a7b4b)||_0x28f0a2[_0x3fc672(0x150)](_0x3fc672(0x13c)))[_0x3fc672(0x157)](_0x380ff7=>resolve(_0x2e4155,_0x380ff7[_0x3fc672(0x142)]));}function collectLocalRuntimeSkill(_0x4dda39,_0x104610,_0x1d6ce8){const _0x274cac=a159_0x1b16,_0x3d627b=resolve(_0x104610,METADATA_FILE),_0x14eedd=readMetadataIfPresent(_0x3d627b);if(!_0x14eedd)return;if(_0x14eedd['appCode']!==_0x1d6ce8['appCode'])return;if(!isRuntimeSkillScope(_0x14eedd[_0x274cac(0x140)])||!_0x1d6ce8['scopes']['has'](_0x14eedd[_0x274cac(0x140)]))return;const _0x2513c6=_0x14eedd[_0x274cac(0x15d)]?.[_0x274cac(0x143)]();if(!_0x2513c6)return;if(_0x1d6ce8['code']&&_0x2513c6!==_0x1d6ce8[_0x274cac(0x167)])return;const _0x483c63=_0x14eedd[_0x274cac(0x140)]+':'+_0x2513c6,_0xcb0f1e=_0x1d6ce8[_0x274cac(0x162)]?[_0x1d6ce8['linkedPath']]:[],_0x10f38c=_0x4dda39['get'](_0x483c63);if(_0x10f38c){_0x1d6ce8[_0x274cac(0x161)]===_0x274cac(0x152)&&(_0x10f38c[_0x274cac(0x13d)]=_0x104610,_0x10f38c['cacheDir']=_0x104610,_0x10f38c[_0x274cac(0x160)]=resolve(_0x104610,SKILL_FILE),_0x10f38c[_0x274cac(0x153)]=_0x3d627b);for(const _0x5c697e of _0xcb0f1e){!_0x10f38c[_0x274cac(0x146)][_0x274cac(0x14a)](_0x5c697e)&&_0x10f38c[_0x274cac(0x146)]['push'](_0x5c697e);}_0x10f38c[_0x274cac(0x146)][_0x274cac(0x15c)]();return;}_0x4dda39[_0x274cac(0x147)](_0x483c63,{..._0x14eedd,'tags':Array[_0x274cac(0x151)](_0x14eedd[_0x274cac(0x144)])?_0x14eedd[_0x274cac(0x144)]:[],'scope':_0x14eedd[_0x274cac(0x140)],'source':_0x274cac(0x15e),'dir':_0x104610,'cacheDir':_0x1d6ce8[_0x274cac(0x161)]==='cache'?_0x104610:undefined,'skillMdPath':resolve(_0x104610,SKILL_FILE),'metadataPath':_0x3d627b,'linkedPaths':_0xcb0f1e});}function compareLocalRuntimeSkills(_0x11734f,_0x2b7818){const _0x2fa778=a159_0x1b16,_0x23f07f={'personal':0x0,'company':0x1,'builtin':0x2};return _0x23f07f[_0x11734f[_0x2fa778(0x140)]]-_0x23f07f[_0x2b7818[_0x2fa778(0x140)]]||_0x11734f['skillCode']['localeCompare'](_0x2b7818[_0x2fa778(0x15d)])||_0x11734f[_0x2fa778(0x13d)][_0x2fa778(0x156)](_0x2b7818[_0x2fa778(0x13d)]);}
@@ -1 +1 @@
1
- (function(_0x51365a,_0x2ca31e){const _0x401dd3=a157_0x59e0,_0x25e11b=_0x51365a();while(!![]){try{const _0x57f82d=-parseInt(_0x401dd3(0x1ab))/0x1+-parseInt(_0x401dd3(0x1ad))/0x2+-parseInt(_0x401dd3(0x1ba))/0x3+parseInt(_0x401dd3(0x199))/0x4+-parseInt(_0x401dd3(0x1b9))/0x5+-parseInt(_0x401dd3(0x1c4))/0x6*(-parseInt(_0x401dd3(0x1b1))/0x7)+parseInt(_0x401dd3(0x19a))/0x8;if(_0x57f82d===_0x2ca31e)break;else _0x25e11b['push'](_0x25e11b['shift']());}catch(_0x248f47){_0x25e11b['push'](_0x25e11b['shift']());}}}(a157_0x569d,0x4d0a7));import{readFileSync,readdirSync,realpathSync}from'node:fs';import{relative,resolve}from'node:path';function a157_0x59e0(_0x1902b8,_0x20db67){_0x1902b8=_0x1902b8-0x196;const _0x569d1c=a157_0x569d();let _0x59e0df=_0x569d1c[_0x1902b8];return _0x59e0df;}import{CliErrors}from'../../errors.js';import{IGNORED_DIR_NAMES,IGNORED_FILE_NAMES,SKILL_FILE}from'./constants.js';function a157_0x569d(){const _0x2a5761=['compare','1437805yXtdsH','837555mvsAzc','values','sha256','Skill\x20file\x20path\x20must\x20be\x20text.','excludedFilePaths','toString','sort','has','path','from','516576JTehdQ','bytes','Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20','trim','171332OmTJrj','12806144VpFocp','size','validation','string','utf8','push','isArray','isDirectory','isSafeInteger','toLowerCase','replace','Duplicate\x20Skill\x20file\x20path:\x20','startsWith','name','localeCompare','isSymbolicLink','add','526991LfFODV','set','812994vYqkCo','length','content','Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20','14GjANLV','split','Unsafe\x20Skill\x20file\x20path:\x20','isBuffer','object','includes','isFile'];a157_0x569d=function(){return _0x2a5761;};return a157_0x569d();}export function fileContent(_0x5f303c){const _0x386dbf=a157_0x59e0;return _0x5f303c[_0x386dbf(0x196)]??Buffer[_0x386dbf(0x1c3)](_0x5f303c[_0x386dbf(0x1af)]??'',_0x386dbf(0x19e));}export function fileText(_0x5641e4){const _0x5ba653=a157_0x59e0;return fileContent(_0x5641e4)[_0x5ba653(0x1bf)](_0x5ba653(0x19e));}export function normalizeLocalFiles(_0x1627c6){const _0x1f5d52=a157_0x59e0;if(!Array[_0x1f5d52(0x1a0)](_0x1627c6)||_0x1627c6[_0x1f5d52(0x1ae)]===0x0)return[];const _0x1dbef9=new Map();for(const _0x5159b0 of _0x1627c6){if(!_0x5159b0||typeof _0x5159b0!==_0x1f5d52(0x1b5)||typeof _0x5159b0['path']!==_0x1f5d52(0x19d))throw CliErrors[_0x1f5d52(0x19c)](_0x1f5d52(0x1bd));const _0x4e2a7c=normalizeSkillRelativePath(_0x5159b0[_0x1f5d52(0x1c2)]);if(_0x1dbef9[_0x1f5d52(0x1c1)](_0x4e2a7c))throw CliErrors[_0x1f5d52(0x19c)](_0x1f5d52(0x1a5)+_0x4e2a7c);if(_0x5159b0[_0x1f5d52(0x196)]!==undefined&&!Buffer[_0x1f5d52(0x1b4)](_0x5159b0[_0x1f5d52(0x196)]))throw CliErrors[_0x1f5d52(0x19c)]('Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20'+_0x4e2a7c);if(_0x5159b0[_0x1f5d52(0x196)]===undefined&&typeof _0x5159b0[_0x1f5d52(0x1af)]!==_0x1f5d52(0x19d))throw CliErrors[_0x1f5d52(0x19c)](_0x1f5d52(0x197)+_0x4e2a7c);const _0x4ef87f=fileContent(_0x5159b0);_0x1dbef9[_0x1f5d52(0x1ac)](_0x4e2a7c,{'path':_0x4e2a7c,'bytes':_0x4ef87f});}return Array[_0x1f5d52(0x1c3)](_0x1dbef9[_0x1f5d52(0x1bb)]())[_0x1f5d52(0x1c0)](compareSkillFiles);}export function normalizeManifestFiles(_0xe90f2c){const _0x590acd=a157_0x59e0;if(!Array[_0x590acd(0x1a0)](_0xe90f2c)||_0xe90f2c[_0x590acd(0x1ae)]===0x0)return[];const _0x6148c0=new Map();for(const _0x1b781f of _0xe90f2c){if(!_0x1b781f||typeof _0x1b781f!==_0x590acd(0x1b5)||typeof _0x1b781f[_0x590acd(0x1c2)]!=='string')throw CliErrors[_0x590acd(0x19c)]('Skill\x20file\x20path\x20must\x20be\x20text.');const _0x4fabae=normalizeSkillRelativePath(_0x1b781f[_0x590acd(0x1c2)]);if(_0x6148c0[_0x590acd(0x1c1)](_0x4fabae))throw CliErrors[_0x590acd(0x19c)](_0x590acd(0x1a5)+_0x4fabae);if(!isSha256Hex(_0x1b781f['sha256']))throw CliErrors[_0x590acd(0x19c)]('Skill\x20file\x20sha256\x20is\x20invalid:\x20'+_0x4fabae);if(!Number[_0x590acd(0x1a2)](_0x1b781f[_0x590acd(0x19b)])||_0x1b781f[_0x590acd(0x19b)]<0x0)throw CliErrors['validation']('Skill\x20file\x20size\x20is\x20invalid:\x20'+_0x4fabae);_0x6148c0[_0x590acd(0x1ac)](_0x4fabae,{'path':_0x4fabae,'sha256':_0x1b781f[_0x590acd(0x1bc)][_0x590acd(0x1a3)](),'size':_0x1b781f['size']});}return Array[_0x590acd(0x1c3)](_0x6148c0[_0x590acd(0x1bb)]())[_0x590acd(0x1c0)](compareSkillFiles);}export function scanSkillDirectory(_0x2b3922,_0x129e76={}){const _0x155426=a157_0x59e0,_0x1cbe0d=realpathSync(_0x2b3922),_0x5e6f8c=canonicalExcludedFilePaths(_0x129e76[_0x155426(0x1be)]),_0x40f8d0=[];function _0x279782(_0x167a19){const _0x58f8ea=_0x155426,_0x50a82b=readdirSync(_0x167a19,{'withFileTypes':!![]})['sort']((_0x2a19f8,_0x28ea3b)=>_0x2a19f8[_0x58f8ea(0x1a7)][_0x58f8ea(0x1a8)](_0x28ea3b['name']));for(const _0x3af74b of _0x50a82b){if(_0x3af74b['isDirectory']()&&IGNORED_DIR_NAMES[_0x58f8ea(0x1c1)](_0x3af74b[_0x58f8ea(0x1a7)]))continue;if(IGNORED_FILE_NAMES[_0x58f8ea(0x1c1)](_0x3af74b[_0x58f8ea(0x1a7)]))continue;const _0x30fe6d=resolve(_0x167a19,_0x3af74b['name']);if(isExcludedFilePath(_0x30fe6d,_0x5e6f8c))continue;if(_0x3af74b[_0x58f8ea(0x1a9)]())throw CliErrors[_0x58f8ea(0x19c)](_0x58f8ea(0x1b0)+_0x30fe6d);const _0x4c20b1=toPosixPath(relative(_0x1cbe0d,_0x30fe6d));if(_0x3af74b[_0x58f8ea(0x1a1)]()){_0x279782(_0x30fe6d);continue;}if(!_0x3af74b[_0x58f8ea(0x1b7)]())continue;validateSkillRelativePath(_0x4c20b1);const _0x181aae=readFileSync(_0x30fe6d);_0x40f8d0[_0x58f8ea(0x19f)]({'path':_0x4c20b1,'bytes':_0x181aae});}}return _0x279782(_0x1cbe0d),normalizeLocalFiles(_0x40f8d0);}function canonicalExcludedFilePaths(_0x4f05d0){const _0x192971=a157_0x59e0,_0x378b5e=new Set();for(const _0x2c7d0a of _0x4f05d0??[]){const _0x18ab6a=resolve(_0x2c7d0a);_0x378b5e[_0x192971(0x1aa)](_0x18ab6a);try{_0x378b5e[_0x192971(0x1aa)](realpathSync(_0x18ab6a));}catch{}}return _0x378b5e;}function isExcludedFilePath(_0x310e0e,_0x5844ac){const _0x569111=a157_0x59e0;if(_0x5844ac[_0x569111(0x1c1)](_0x310e0e))return!![];if(_0x5844ac[_0x569111(0x19b)]===0x0)return![];try{return _0x5844ac[_0x569111(0x1c1)](realpathSync(_0x310e0e));}catch{return![];}}export function compareSkillFiles(_0x593579,_0x33f472){const _0xed4cd0=a157_0x59e0;if(_0x593579[_0xed4cd0(0x1c2)]===SKILL_FILE)return _0x33f472[_0xed4cd0(0x1c2)]===SKILL_FILE?0x0:-0x1;if(_0x33f472[_0xed4cd0(0x1c2)]===SKILL_FILE)return 0x1;return Buffer[_0xed4cd0(0x1b8)](Buffer[_0xed4cd0(0x1c3)](_0x593579['path'],_0xed4cd0(0x19e)),Buffer[_0xed4cd0(0x1c3)](_0x33f472[_0xed4cd0(0x1c2)],_0xed4cd0(0x19e)));}export function normalizeSkillRelativePath(_0x1dcf8e){const _0x4ac83d=a157_0x59e0,_0x5bc3e6=toPosixPath(_0x1dcf8e[_0x4ac83d(0x198)]());return validateSkillRelativePath(_0x5bc3e6),_0x5bc3e6;}export function validateSkillRelativePath(_0x2a6107){const _0x4639a1=a157_0x59e0;if(!_0x2a6107||_0x2a6107[_0x4639a1(0x1a6)]('/')||_0x2a6107[_0x4639a1(0x1b6)]('//'))throw CliErrors[_0x4639a1(0x19c)]('Unsafe\x20Skill\x20file\x20path:\x20'+_0x2a6107);for(const _0x31e7c0 of _0x2a6107[_0x4639a1(0x1b2)]('/')){if(!_0x31e7c0||_0x31e7c0==='.'||_0x31e7c0==='..')throw CliErrors[_0x4639a1(0x19c)](_0x4639a1(0x1b3)+_0x2a6107);}}export function toPosixPath(_0x3bd2bb){const _0x57bc38=a157_0x59e0;return _0x3bd2bb[_0x57bc38(0x1a4)](/\\/g,'/');}export function isSha256Hex(_0x360f43){const _0x1928f5=a157_0x59e0;return typeof _0x360f43===_0x1928f5(0x19d)&&/^[a-fA-F0-9]{64}$/['test'](_0x360f43);}
1
+ (function(_0x209f88,_0x5a6f09){const _0x2c6120=a160_0x4437,_0x593456=_0x209f88();while(!![]){try{const _0x8d0f3a=-parseInt(_0x2c6120(0x180))/0x1+-parseInt(_0x2c6120(0x178))/0x2+parseInt(_0x2c6120(0x18e))/0x3*(-parseInt(_0x2c6120(0x191))/0x4)+-parseInt(_0x2c6120(0x17a))/0x5+-parseInt(_0x2c6120(0x18f))/0x6+parseInt(_0x2c6120(0x194))/0x7*(-parseInt(_0x2c6120(0x18b))/0x8)+parseInt(_0x2c6120(0x184))/0x9;if(_0x8d0f3a===_0x5a6f09)break;else _0x593456['push'](_0x593456['shift']());}catch(_0x1ab30a){_0x593456['push'](_0x593456['shift']());}}}(a160_0x3b3d,0x39ce5));function a160_0x4437(_0x4e0ad6,_0x2875df){_0x4e0ad6=_0x4e0ad6-0x173;const _0x3b3d00=a160_0x3b3d();let _0x4437d9=_0x3b3d00[_0x4e0ad6];return _0x4437d9;}import{readFileSync,readdirSync,realpathSync}from'node:fs';import{relative,resolve}from'node:path';import{CliErrors}from'../../errors.js';function a160_0x3b3d(){const _0x36c22d=['startsWith','trim','push','content','values','728414nTuLRs','validation','769535PvTcMK','replace','set','test','bytes','Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20','300089KmSrPL','object','add','utf8','14850927sdgaCP','name','Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20','from','compare','length','localeCompare','37208IjoBWN','isSafeInteger','isArray','126957dFJrRH','598926VnvgzQ','isDirectory','20RCZkXC','Duplicate\x20Skill\x20file\x20path:\x20','split','427HAfGnQ','toLowerCase','sort','string','has','excludedFilePaths','size','Unsafe\x20Skill\x20file\x20path:\x20','isBuffer','isFile','Skill\x20file\x20path\x20must\x20be\x20text.','path','isSymbolicLink','sha256'];a160_0x3b3d=function(){return _0x36c22d;};return a160_0x3b3d();}import{IGNORED_DIR_NAMES,IGNORED_FILE_NAMES,SKILL_FILE}from'./constants.js';export function fileContent(_0x3d1e2c){const _0x206c43=a160_0x4437;return _0x3d1e2c[_0x206c43(0x17e)]??Buffer[_0x206c43(0x187)](_0x3d1e2c[_0x206c43(0x176)]??'','utf8');}export function fileText(_0x16f67f){const _0x440241=a160_0x4437;return fileContent(_0x16f67f)['toString'](_0x440241(0x183));}export function normalizeLocalFiles(_0x1491c6){const _0x574ae8=a160_0x4437;if(!Array[_0x574ae8(0x18d)](_0x1491c6)||_0x1491c6[_0x574ae8(0x189)]===0x0)return[];const _0x38408f=new Map();for(const _0x5bfc42 of _0x1491c6){if(!_0x5bfc42||typeof _0x5bfc42!=='object'||typeof _0x5bfc42[_0x574ae8(0x19f)]!==_0x574ae8(0x197))throw CliErrors[_0x574ae8(0x179)](_0x574ae8(0x19e));const _0x2d1849=normalizeSkillRelativePath(_0x5bfc42['path']);if(_0x38408f[_0x574ae8(0x198)](_0x2d1849))throw CliErrors['validation']('Duplicate\x20Skill\x20file\x20path:\x20'+_0x2d1849);if(_0x5bfc42[_0x574ae8(0x17e)]!==undefined&&!Buffer[_0x574ae8(0x19c)](_0x5bfc42['bytes']))throw CliErrors[_0x574ae8(0x179)](_0x574ae8(0x186)+_0x2d1849);if(_0x5bfc42[_0x574ae8(0x17e)]===undefined&&typeof _0x5bfc42['content']!=='string')throw CliErrors[_0x574ae8(0x179)]('Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20'+_0x2d1849);const _0x48a39e=fileContent(_0x5bfc42);_0x38408f[_0x574ae8(0x17c)](_0x2d1849,{'path':_0x2d1849,'bytes':_0x48a39e});}return Array[_0x574ae8(0x187)](_0x38408f['values']())[_0x574ae8(0x196)](compareSkillFiles);}export function normalizeManifestFiles(_0xe3e5fa){const _0x3278fa=a160_0x4437;if(!Array[_0x3278fa(0x18d)](_0xe3e5fa)||_0xe3e5fa[_0x3278fa(0x189)]===0x0)return[];const _0x34ca63=new Map();for(const _0x719396 of _0xe3e5fa){if(!_0x719396||typeof _0x719396!==_0x3278fa(0x181)||typeof _0x719396[_0x3278fa(0x19f)]!==_0x3278fa(0x197))throw CliErrors[_0x3278fa(0x179)]('Skill\x20file\x20path\x20must\x20be\x20text.');const _0x4f2cd4=normalizeSkillRelativePath(_0x719396[_0x3278fa(0x19f)]);if(_0x34ca63[_0x3278fa(0x198)](_0x4f2cd4))throw CliErrors[_0x3278fa(0x179)](_0x3278fa(0x192)+_0x4f2cd4);if(!isSha256Hex(_0x719396['sha256']))throw CliErrors[_0x3278fa(0x179)]('Skill\x20file\x20sha256\x20is\x20invalid:\x20'+_0x4f2cd4);if(!Number[_0x3278fa(0x18c)](_0x719396[_0x3278fa(0x19a)])||_0x719396[_0x3278fa(0x19a)]<0x0)throw CliErrors[_0x3278fa(0x179)]('Skill\x20file\x20size\x20is\x20invalid:\x20'+_0x4f2cd4);_0x34ca63['set'](_0x4f2cd4,{'path':_0x4f2cd4,'sha256':_0x719396[_0x3278fa(0x1a1)][_0x3278fa(0x195)](),'size':_0x719396['size']});}return Array[_0x3278fa(0x187)](_0x34ca63[_0x3278fa(0x177)]())['sort'](compareSkillFiles);}export function scanSkillDirectory(_0x1f8eb9,_0xc29389={}){const _0x3edfb5=a160_0x4437,_0x4a9b83=realpathSync(_0x1f8eb9),_0x44879a=canonicalExcludedFilePaths(_0xc29389[_0x3edfb5(0x199)]),_0x2f06ed=[];function _0x4f81e5(_0xd6a9de){const _0x36213c=_0x3edfb5,_0x5da983=readdirSync(_0xd6a9de,{'withFileTypes':!![]})['sort']((_0x34d4b7,_0x4e6576)=>_0x34d4b7['name'][_0x36213c(0x18a)](_0x4e6576[_0x36213c(0x185)]));for(const _0x19932b of _0x5da983){if(_0x19932b['isDirectory']()&&IGNORED_DIR_NAMES[_0x36213c(0x198)](_0x19932b[_0x36213c(0x185)]))continue;if(IGNORED_FILE_NAMES['has'](_0x19932b[_0x36213c(0x185)]))continue;const _0x56ac22=resolve(_0xd6a9de,_0x19932b['name']);if(isExcludedFilePath(_0x56ac22,_0x44879a))continue;if(_0x19932b[_0x36213c(0x1a0)]())throw CliErrors[_0x36213c(0x179)](_0x36213c(0x17f)+_0x56ac22);const _0xc0744b=toPosixPath(relative(_0x4a9b83,_0x56ac22));if(_0x19932b[_0x36213c(0x190)]()){_0x4f81e5(_0x56ac22);continue;}if(!_0x19932b[_0x36213c(0x19d)]())continue;validateSkillRelativePath(_0xc0744b);const _0x1e616d=readFileSync(_0x56ac22);_0x2f06ed[_0x36213c(0x175)]({'path':_0xc0744b,'bytes':_0x1e616d});}}return _0x4f81e5(_0x4a9b83),normalizeLocalFiles(_0x2f06ed);}function canonicalExcludedFilePaths(_0x2c8912){const _0x49e9a5=a160_0x4437,_0x25eaec=new Set();for(const _0x2ad8d3 of _0x2c8912??[]){const _0xea8048=resolve(_0x2ad8d3);_0x25eaec[_0x49e9a5(0x182)](_0xea8048);try{_0x25eaec[_0x49e9a5(0x182)](realpathSync(_0xea8048));}catch{}}return _0x25eaec;}function isExcludedFilePath(_0x5b445d,_0x381261){const _0x2f691b=a160_0x4437;if(_0x381261[_0x2f691b(0x198)](_0x5b445d))return!![];if(_0x381261[_0x2f691b(0x19a)]===0x0)return![];try{return _0x381261[_0x2f691b(0x198)](realpathSync(_0x5b445d));}catch{return![];}}export function compareSkillFiles(_0x225afb,_0x5aa95e){const _0x2e570d=a160_0x4437;if(_0x225afb[_0x2e570d(0x19f)]===SKILL_FILE)return _0x5aa95e[_0x2e570d(0x19f)]===SKILL_FILE?0x0:-0x1;if(_0x5aa95e['path']===SKILL_FILE)return 0x1;return Buffer[_0x2e570d(0x188)](Buffer[_0x2e570d(0x187)](_0x225afb[_0x2e570d(0x19f)],_0x2e570d(0x183)),Buffer[_0x2e570d(0x187)](_0x5aa95e[_0x2e570d(0x19f)],_0x2e570d(0x183)));}export function normalizeSkillRelativePath(_0x14c0ea){const _0x438b7c=a160_0x4437,_0x2ba26f=toPosixPath(_0x14c0ea[_0x438b7c(0x174)]());return validateSkillRelativePath(_0x2ba26f),_0x2ba26f;}export function validateSkillRelativePath(_0x359029){const _0x7ca602=a160_0x4437;if(!_0x359029||_0x359029[_0x7ca602(0x173)]('/')||_0x359029['includes']('//'))throw CliErrors['validation'](_0x7ca602(0x19b)+_0x359029);for(const _0x4fa18a of _0x359029[_0x7ca602(0x193)]('/')){if(!_0x4fa18a||_0x4fa18a==='.'||_0x4fa18a==='..')throw CliErrors['validation']('Unsafe\x20Skill\x20file\x20path:\x20'+_0x359029);}}export function toPosixPath(_0x376721){const _0x2c709e=a160_0x4437;return _0x376721[_0x2c709e(0x17b)](/\\/g,'/');}export function isSha256Hex(_0x256443){const _0x9a37f3=a160_0x4437;return typeof _0x256443===_0x9a37f3(0x197)&&/^[a-fA-F0-9]{64}$/[_0x9a37f3(0x17d)](_0x256443);}