@lovrabet/lovrabet-cli 2.3.6-beta.1 → 2.3.6-beta.3

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 (190) hide show
  1. package/README.md +33 -2
  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.d.ts +3 -3
  33. package/lib/commands/dataset/list.js +1 -1
  34. package/lib/commands/dataset/sdk-doc.js +1 -1
  35. package/lib/commands/doctor.js +1 -1
  36. package/lib/commands/file/index.js +1 -1
  37. package/lib/commands/init.js +1 -1
  38. package/lib/commands/kb/index.js +1 -1
  39. package/lib/commands/logs/index.js +1 -1
  40. package/lib/commands/notification/config-list.js +1 -1
  41. package/lib/commands/notification/index.js +1 -1
  42. package/lib/commands/notification/shared.js +1 -1
  43. package/lib/commands/ocr/index.js +1 -1
  44. package/lib/commands/permit/dataset-get.js +1 -1
  45. package/lib/commands/permit/dataset-set.js +1 -1
  46. package/lib/commands/permit/index.js +1 -1
  47. package/lib/commands/permit/page-get.js +1 -1
  48. package/lib/commands/permit/page-set.js +1 -1
  49. package/lib/commands/permit/role-menus-set.js +1 -1
  50. package/lib/commands/permit/role-menus.js +1 -1
  51. package/lib/commands/permit/shared.js +1 -1
  52. package/lib/commands/personal-bff/index.js +1 -1
  53. package/lib/commands/registry.js +1 -1
  54. package/lib/commands/role/create.js +1 -1
  55. package/lib/commands/role/delete.js +1 -1
  56. package/lib/commands/role/detail.js +1 -1
  57. package/lib/commands/role/index.js +1 -1
  58. package/lib/commands/role/list.js +1 -1
  59. package/lib/commands/role/shared.js +1 -1
  60. package/lib/commands/role/update.js +1 -1
  61. package/lib/commands/role/user-add.js +1 -1
  62. package/lib/commands/role/user-remove.js +1 -1
  63. package/lib/commands/schedule/index.js +1 -1
  64. package/lib/commands/schema.js +1 -1
  65. package/lib/commands/service/dynamic.js +1 -1
  66. package/lib/commands/service/function-name-adapter.js +1 -1
  67. package/lib/commands/service/index.js +1 -1
  68. package/lib/commands/service/registry.js +1 -1
  69. package/lib/commands/skill/commands/create.js +1 -1
  70. package/lib/commands/skill/commands/diagram.js +1 -1
  71. package/lib/commands/skill/commands/install.js +1 -1
  72. package/lib/commands/skill/commands/list.js +1 -1
  73. package/lib/commands/skill/commands/push.js +1 -1
  74. package/lib/commands/skill/commands/validate.js +1 -1
  75. package/lib/commands/skill/diagram.js +1 -1
  76. package/lib/commands/skill/flags.js +1 -1
  77. package/lib/commands/skill/index.js +1 -1
  78. package/lib/commands/skill/manifest-helpers.js +1 -1
  79. package/lib/commands/skill/push-execute.js +1 -1
  80. package/lib/commands/skill/push-flow-helpers.js +1 -1
  81. package/lib/commands/skill/push-retarget.js +1 -1
  82. package/lib/commands/skill/scopes.js +1 -1
  83. package/lib/commands/skill/summary.js +1 -1
  84. package/lib/commands/skill/templates.js +1 -1
  85. package/lib/commands/skill/validate.js +1 -1
  86. package/lib/commands/sql/detail.js +1 -1
  87. package/lib/commands/sql/exec.js +1 -1
  88. package/lib/commands/sql/index.js +1 -1
  89. package/lib/commands/update.js +1 -1
  90. package/lib/commands/user-account/bind.js +1 -1
  91. package/lib/commands/user-account/index.js +1 -1
  92. package/lib/commands/workspace/index.js +1 -1
  93. package/lib/config/domain-config.js +1 -1
  94. package/lib/config/schema.js +1 -1
  95. package/lib/constant/app.js +1 -1
  96. package/lib/constant/auth-mode.js +1 -1
  97. package/lib/constant/cli.js +1 -1
  98. package/lib/constant/defaults.js +1 -1
  99. package/lib/constant/distribution.js +1 -1
  100. package/lib/constant/domain.js +1 -1
  101. package/lib/constant/env.js +1 -1
  102. package/lib/constant/output.js +1 -1
  103. package/lib/constant/product.js +1 -1
  104. package/lib/constant/region.js +1 -1
  105. package/lib/constant/risk.js +1 -1
  106. package/lib/constant/url.js +1 -1
  107. package/lib/context.js +1 -1
  108. package/lib/core/api-client.d.ts +7 -6
  109. package/lib/core/api-client.js +1 -1
  110. package/lib/core/db-resolver.js +1 -1
  111. package/lib/core/kb-management-client.d.ts +17 -0
  112. package/lib/core/kb-management-client.js +1 -0
  113. package/lib/core/kb-search-client.js +1 -1
  114. package/lib/core/sdk-client.js +1 -1
  115. package/lib/errors.js +1 -1
  116. package/lib/framework/access-error.js +1 -1
  117. package/lib/framework/build-all-flags.js +1 -1
  118. package/lib/framework/dryrun.js +1 -1
  119. package/lib/framework/flags.js +1 -1
  120. package/lib/framework/help.js +1 -1
  121. package/lib/framework/index.js +1 -1
  122. package/lib/framework/output.js +1 -1
  123. package/lib/framework/preparse.js +1 -1
  124. package/lib/framework/rate-limit.js +1 -1
  125. package/lib/framework/raw-flags.js +1 -1
  126. package/lib/framework/response.js +1 -1
  127. package/lib/framework/runner-confirmation.js +1 -1
  128. package/lib/framework/runner-error.js +1 -1
  129. package/lib/framework/runner.js +1 -1
  130. package/lib/framework/schema-export.js +1 -1
  131. package/lib/framework/service-order.js +1 -1
  132. package/lib/framework/types.js +1 -1
  133. package/lib/generated/build-info.d.ts +4 -4
  134. package/lib/generated/build-info.js +1 -1
  135. package/lib/generated/official-routing.js +1 -1
  136. package/lib/generated/routing-contract.js +1 -1
  137. package/lib/help.js +1 -1
  138. package/lib/postinstall.js +1 -1
  139. package/lib/runtime/confirmation.js +1 -1
  140. package/lib/runtime/event.js +1 -1
  141. package/lib/runtime/index.js +1 -1
  142. package/lib/runtime/queue.js +1 -1
  143. package/lib/runtime/resolve.js +1 -1
  144. package/lib/services/dataset-import/auto-id-runner.js +1 -1
  145. package/lib/services/dataset-import/excel-reader.js +1 -1
  146. package/lib/services/dataset-import/image-bytes.js +1 -1
  147. package/lib/services/dataset-import/image-ooxml.js +1 -1
  148. package/lib/services/dataset-import/image-runner.js +1 -1
  149. package/lib/services/dataset-import/metadata.js +1 -1
  150. package/lib/services/dataset-import/preview.js +1 -1
  151. package/lib/services/dataset-import/runner.js +1 -1
  152. package/lib/skills/builtin-skill.js +1 -1
  153. package/lib/skills/npx-skills-add.js +1 -1
  154. package/lib/skills/runtime-skill-sync/constants.js +1 -1
  155. package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
  156. package/lib/skills/runtime-skill-sync/hashing.js +1 -1
  157. package/lib/skills/runtime-skill-sync/install-target.js +1 -1
  158. package/lib/skills/runtime-skill-sync/links.js +1 -1
  159. package/lib/skills/runtime-skill-sync/list-local.js +1 -1
  160. package/lib/skills/runtime-skill-sync/local-files.js +1 -1
  161. package/lib/skills/runtime-skill-sync/materialize.js +1 -1
  162. package/lib/skills/runtime-skill-sync/metadata.js +1 -1
  163. package/lib/skills/runtime-skill-sync/paths.js +1 -1
  164. package/lib/skills/runtime-skill-sync/push.js +1 -1
  165. package/lib/skills/runtime-skill-sync/scopes.js +1 -1
  166. package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
  167. package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
  168. package/lib/skills/runtime-skill-sync.js +1 -1
  169. package/lib/skills/skill-presence.js +1 -1
  170. package/lib/utils/access-key-redaction.js +1 -1
  171. package/lib/utils/apply-jq-filter.js +1 -1
  172. package/lib/utils/cli-version-check.js +1 -1
  173. package/lib/utils/cli-version-policy.js +1 -1
  174. package/lib/utils/logger.js +1 -1
  175. package/lib/utils/lossless-json.js +1 -1
  176. package/lib/utils/params.js +1 -1
  177. package/lib/utils/positive-safe-integer.js +1 -1
  178. package/lib/utils/redaction.js +1 -1
  179. package/lib/utils/update-notice.js +1 -1
  180. package/lib/utils/version.js +1 -1
  181. package/lib/utils/write-cli-side-channel.js +1 -1
  182. package/package.json +1 -1
  183. package/skills/lovrabet/SKILL.md +5 -3
  184. package/skills/lovrabet/guides/app-resolution.md +2 -0
  185. package/skills/lovrabet/guides/dataset-and-data-workflow.md +10 -1
  186. package/skills/lovrabet/references/dataset-discovery-workflow.md +14 -1
  187. package/skills/lovrabet/references/instant-api-workflow.md +2 -0
  188. package/skills/lovrabet/references/lovrabet-app.md +2 -0
  189. package/skills/lovrabet/references/lovrabet-kb-workflow.md +7 -3
  190. package/skills/lovrabet.manifest.json +3 -3
@@ -1 +1 @@
1
- (function(_0xbecf1d,_0x4b5f59){const _0xcbcce4=a143_0x17ac,_0x3533e7=_0xbecf1d();while(!![]){try{const _0x11d869=parseInt(_0xcbcce4(0x150))/0x1*(parseInt(_0xcbcce4(0x13d))/0x2)+-parseInt(_0xcbcce4(0x14c))/0x3*(-parseInt(_0xcbcce4(0x145))/0x4)+-parseInt(_0xcbcce4(0x142))/0x5+-parseInt(_0xcbcce4(0x141))/0x6+-parseInt(_0xcbcce4(0x13a))/0x7*(parseInt(_0xcbcce4(0x13c))/0x8)+parseInt(_0xcbcce4(0x149))/0x9+-parseInt(_0xcbcce4(0x14b))/0xa*(-parseInt(_0xcbcce4(0x147))/0xb);if(_0x11d869===_0x4b5f59)break;else _0x3533e7['push'](_0x3533e7['shift']());}catch(_0x9d248f){_0x3533e7['push'](_0x3533e7['shift']());}}}(a143_0x1a16,0xaeb8d));function a143_0x17ac(_0x3d93b9,_0x5b4a2d){_0x3d93b9=_0x3d93b9-0x139;const _0x1a1643=a143_0x1a16();let _0x17ac93=_0x1a1643[_0x3d93b9];return _0x17ac93;}function a143_0x1a16(){const _0x4c68fa=['15iFteWc','isArray','source','351001vQXXjb','object','136JgWTSB','130862pYFyyQ','datasetCode','appCode','sourceType','7990926nYwbRc','6824765SJzVOK','modelCode','Dataset\x20metadata\x20is\x20missing.','632ediAAM','dataset','82412gKKglZ','code','12791367acNnYw','string','950ObnSix','21843NASmCv','length','some','filter'];a143_0x1a16=function(){return _0x4c68fa;};return a143_0x1a16();}export function assertDatasetImportTarget(_0x5479a4,_0x2990da,_0x58391a){const _0x2039cf=a143_0x17ac;if(!_0x5479a4||typeof _0x5479a4!==_0x2039cf(0x13b)||Array[_0x2039cf(0x151)](_0x5479a4))throw Error(_0x2039cf(0x144));const _0x2b5b26=[_0x5479a4[_0x2039cf(0x148)],_0x5479a4[_0x2039cf(0x143)],_0x5479a4[_0x2039cf(0x146)]?.[_0x2039cf(0x13e)]]['filter'](_0x51d191=>_0x51d191!=null);if(!_0x2b5b26[_0x2039cf(0x14d)]||_0x2b5b26[_0x2039cf(0x14e)](_0x4e6647=>_0x4e6647!==_0x58391a)||_0x5479a4[_0x2039cf(0x13f)]!=null&&_0x5479a4[_0x2039cf(0x13f)]!==_0x2990da||_0x5479a4[_0x2039cf(0x146)]?.['appCode']!=null&&_0x5479a4[_0x2039cf(0x146)][_0x2039cf(0x13f)]!==_0x2990da)throw Error('Dataset\x20metadata\x20does\x20not\x20match\x20the\x20requested\x20target.');const _0x25bf6b=[_0x5479a4[_0x2039cf(0x139)],_0x5479a4[_0x2039cf(0x146)]?.[_0x2039cf(0x140)]][_0x2039cf(0x14f)](_0x395d4c=>_0x395d4c!=null);if(_0x25bf6b[_0x2039cf(0x14e)](_0x2a20f3=>typeof _0x2a20f3!==_0x2039cf(0x14a)||_0x2a20f3!==_0x25bf6b[0x0]))throw Error('Dataset\x20source\x20metadata\x20is\x20inconsistent.');return _0x25bf6b[0x0];}
1
+ function a144_0x29c0(_0x39e308,_0x27b4a4){_0x39e308=_0x39e308-0xd9;const _0x46c590=a144_0x46c5();let _0x29c0f5=_0x46c590[_0x39e308];return _0x29c0f5;}(function(_0xbc9c1f,_0x3fcf51){const _0x2473be=a144_0x29c0,_0x7dd5dd=_0xbc9c1f();while(!![]){try{const _0x4f5c75=-parseInt(_0x2473be(0xe7))/0x1+-parseInt(_0x2473be(0xdf))/0x2*(-parseInt(_0x2473be(0xda))/0x3)+-parseInt(_0x2473be(0xe8))/0x4*(-parseInt(_0x2473be(0xd9))/0x5)+parseInt(_0x2473be(0xdb))/0x6+parseInt(_0x2473be(0xed))/0x7*(-parseInt(_0x2473be(0xdd))/0x8)+-parseInt(_0x2473be(0xef))/0x9+parseInt(_0x2473be(0xdc))/0xa;if(_0x4f5c75===_0x3fcf51)break;else _0x7dd5dd['push'](_0x7dd5dd['shift']());}catch(_0xd660a9){_0x7dd5dd['push'](_0x7dd5dd['shift']());}}}(a144_0x46c5,0x4091e));function a144_0x46c5(){const _0x2bf5ee=['object','datasetCode','code','215981OsgDXB','860YAHTDY','dataset','string','length','Dataset\x20source\x20metadata\x20is\x20inconsistent.','266qRAiXv','Dataset\x20metadata\x20is\x20missing.','1338021ywDqkg','1720gVSret','3QNvTBj','2339874VKdAMF','5538800StVVka','98288EtTKsb','filter','156354eRSole','appCode','source','some','modelCode'];a144_0x46c5=function(){return _0x2bf5ee;};return a144_0x46c5();}export function assertDatasetImportTarget(_0x3793a0,_0x2804fc,_0x4e7be0){const _0x5c7bec=a144_0x29c0;if(!_0x3793a0||typeof _0x3793a0!==_0x5c7bec(0xe4)||Array['isArray'](_0x3793a0))throw Error(_0x5c7bec(0xee));const _0x44aeb1=[_0x3793a0[_0x5c7bec(0xe6)],_0x3793a0[_0x5c7bec(0xe3)],_0x3793a0[_0x5c7bec(0xe9)]?.[_0x5c7bec(0xe5)]][_0x5c7bec(0xde)](_0x3189ed=>_0x3189ed!=null);if(!_0x44aeb1[_0x5c7bec(0xeb)]||_0x44aeb1[_0x5c7bec(0xe2)](_0x34587f=>_0x34587f!==_0x4e7be0)||_0x3793a0[_0x5c7bec(0xe0)]!=null&&_0x3793a0['appCode']!==_0x2804fc||_0x3793a0[_0x5c7bec(0xe9)]?.['appCode']!=null&&_0x3793a0[_0x5c7bec(0xe9)][_0x5c7bec(0xe0)]!==_0x2804fc)throw Error('Dataset\x20metadata\x20does\x20not\x20match\x20the\x20requested\x20target.');const _0x282ce6=[_0x3793a0[_0x5c7bec(0xe1)],_0x3793a0['dataset']?.['sourceType']][_0x5c7bec(0xde)](_0x393623=>_0x393623!=null);if(_0x282ce6[_0x5c7bec(0xe2)](_0x186c7a=>typeof _0x186c7a!==_0x5c7bec(0xea)||_0x186c7a!==_0x282ce6[0x0]))throw Error(_0x5c7bec(0xec));return _0x282ce6[0x0];}
@@ -1 +1 @@
1
- function a144_0x187f(_0x365c7c,_0x6faec2){_0x365c7c=_0x365c7c-0x107;const _0x55afb9=a144_0x55af();let _0x187f0b=_0x55afb9[_0x365c7c];return _0x187f0b;}(function(_0x401a5b,_0x52046f){const _0x41a3bb=a144_0x187f,_0x4315f7=_0x401a5b();while(!![]){try{const _0x36c0b4=parseInt(_0x41a3bb(0x117))/0x1*(parseInt(_0x41a3bb(0x112))/0x2)+parseInt(_0x41a3bb(0x110))/0x3+parseInt(_0x41a3bb(0x119))/0x4*(parseInt(_0x41a3bb(0x10f))/0x5)+-parseInt(_0x41a3bb(0x118))/0x6+-parseInt(_0x41a3bb(0x109))/0x7+-parseInt(_0x41a3bb(0x10b))/0x8*(parseInt(_0x41a3bb(0x113))/0x9)+parseInt(_0x41a3bb(0x10c))/0xa;if(_0x36c0b4===_0x52046f)break;else _0x4315f7['push'](_0x4315f7['shift']());}catch(_0x3883aa){_0x4315f7['push'](_0x4315f7['shift']());}}}(a144_0x55af,0x72357));function a144_0x55af(){const _0x2b2ae0=['values','rows','3908254SnYRYs','length','7318136JOcDqG','7466430WAVhyh','maxBatchBytes','stringify','55chrVou','8232PQDHEd','push','10lVkNke','9tGOxvf','schemaVersion','byteLength','map','110310ZLijdy','1765146xwXvOw','339688JOpNqt','\x20exceeds\x20the\x20import\x20request\x20size\x20limit.'];a144_0x55af=function(){return _0x2b2ae0;};return a144_0x55af();}export function previewImportBatchCount(_0x5cad43,_0x166b81,_0x5c6432){const _0xc96051=a144_0x187f,_0x3ddeb3=_0x7dfd6a=>_0x7dfd6a[_0xc96051(0x116)](_0x4569cf=>_0x166b81[_0xc96051(0x114)]===0x1?{..._0x5cad43[_0xc96051(0x108)][_0x4569cf][_0xc96051(0x107)],'id':-0x1fffffffffffff}:_0x5cad43[_0xc96051(0x108)][_0x4569cf][_0xc96051(0x107)]),_0x5d1481=_0x19ecde=>Buffer[_0xc96051(0x115)](JSON[_0xc96051(0x10e)]({'schemaFingerprint':_0x166b81['schemaFingerprint'],..._0x166b81[_0xc96051(0x114)]===0x2?{'taskId':0x2**0x34}:{},'items':_0x3ddeb3(_0x19ecde)}),'utf8');let _0x41defe=0x0,_0x4a745f=[];for(let _0x1331e2=0x0;_0x1331e2<_0x5cad43[_0xc96051(0x108)]['length'];_0x1331e2++){if(_0x5d1481([_0x1331e2])>_0x166b81[_0xc96051(0x10d)])throw Error('Excel\x20row\x20'+_0x5cad43[_0xc96051(0x108)][_0x1331e2]['rowNumber']+_0xc96051(0x11a));_0x4a745f[_0xc96051(0x10a)]&&(_0x4a745f[_0xc96051(0x10a)]===_0x5c6432||_0x5d1481([..._0x4a745f,_0x1331e2])>_0x166b81['maxBatchBytes'])&&(_0x41defe++,_0x4a745f=[]),_0x4a745f[_0xc96051(0x111)](_0x1331e2);}return _0x41defe+Number(_0x4a745f[_0xc96051(0x10a)]>0x0);}
1
+ (function(_0x5bfe44,_0x1abf8e){const _0x1cce9d=a145_0x1297,_0x1a3160=_0x5bfe44();while(!![]){try{const _0x3b4cfb=-parseInt(_0x1cce9d(0x132))/0x1*(-parseInt(_0x1cce9d(0x12e))/0x2)+-parseInt(_0x1cce9d(0x128))/0x3*(-parseInt(_0x1cce9d(0x120))/0x4)+parseInt(_0x1cce9d(0x11d))/0x5*(-parseInt(_0x1cce9d(0x130))/0x6)+parseInt(_0x1cce9d(0x131))/0x7+parseInt(_0x1cce9d(0x11c))/0x8*(parseInt(_0x1cce9d(0x124))/0x9)+-parseInt(_0x1cce9d(0x11e))/0xa+-parseInt(_0x1cce9d(0x11f))/0xb;if(_0x3b4cfb===_0x1abf8e)break;else _0x1a3160['push'](_0x1a3160['shift']());}catch(_0x72fa4e){_0x1a3160['push'](_0x1a3160['shift']());}}}(a145_0x29a5,0xc64cd));function a145_0x1297(_0x411c7b,_0x16daf7){_0x411c7b=_0x411c7b-0x11c;const _0x29a57e=a145_0x29a5();let _0x1297d3=_0x29a57e[_0x411c7b];return _0x1297d3;}function a145_0x29a5(){const _0x15200d=['push','rows','3EmvlRA','stringify','maxBatchBytes','schemaVersion','Excel\x20row\x20','\x20exceeds\x20the\x20import\x20request\x20size\x20limit.','7494gBZoeJ','length','6NWLMBl','1197959HztAfd','433PPlosW','43944QqVNLk','386445SKowSJ','8839100ZoeWLE','8372210voqVcj','1337904MkRlgU','utf8','rowNumber','values','666dWDVbO','map'];a145_0x29a5=function(){return _0x15200d;};return a145_0x29a5();}export function previewImportBatchCount(_0x5eed83,_0x4af627,_0x4140d1){const _0x591689=a145_0x1297,_0x134efe=_0x4f0cf2=>_0x4f0cf2[_0x591689(0x125)](_0x1a80cf=>_0x4af627[_0x591689(0x12b)]===0x1?{..._0x5eed83[_0x591689(0x127)][_0x1a80cf][_0x591689(0x123)],'id':-0x1fffffffffffff}:_0x5eed83[_0x591689(0x127)][_0x1a80cf][_0x591689(0x123)]),_0x3cedf2=_0x4d1773=>Buffer['byteLength'](JSON[_0x591689(0x129)]({'schemaFingerprint':_0x4af627['schemaFingerprint'],..._0x4af627[_0x591689(0x12b)]===0x2?{'taskId':0x2**0x34}:{},'items':_0x134efe(_0x4d1773)}),_0x591689(0x121));let _0x31a069=0x0,_0x570d8f=[];for(let _0x149561=0x0;_0x149561<_0x5eed83[_0x591689(0x127)][_0x591689(0x12f)];_0x149561++){if(_0x3cedf2([_0x149561])>_0x4af627[_0x591689(0x12a)])throw Error(_0x591689(0x12c)+_0x5eed83[_0x591689(0x127)][_0x149561][_0x591689(0x122)]+_0x591689(0x12d));_0x570d8f[_0x591689(0x12f)]&&(_0x570d8f[_0x591689(0x12f)]===_0x4140d1||_0x3cedf2([..._0x570d8f,_0x149561])>_0x4af627[_0x591689(0x12a)])&&(_0x31a069++,_0x570d8f=[]),_0x570d8f[_0x591689(0x126)](_0x149561);}return _0x31a069+Number(_0x570d8f[_0x591689(0x12f)]>0x0);}
@@ -1 +1 @@
1
- const a145_0x34202c=a145_0x48c5;(function(_0xddb386,_0x34f81c){const _0x3d0edb=a145_0x48c5,_0x5dcf14=_0xddb386();while(!![]){try{const _0x25da29=-parseInt(_0x3d0edb(0x18c))/0x1+parseInt(_0x3d0edb(0x1e3))/0x2+-parseInt(_0x3d0edb(0x1f1))/0x3*(-parseInt(_0x3d0edb(0x1f0))/0x4)+-parseInt(_0x3d0edb(0x1fc))/0x5+parseInt(_0x3d0edb(0x1ae))/0x6+-parseInt(_0x3d0edb(0x1a7))/0x7*(parseInt(_0x3d0edb(0x19e))/0x8)+-parseInt(_0x3d0edb(0x1aa))/0x9*(-parseInt(_0x3d0edb(0x186))/0xa);if(_0x25da29===_0x34f81c)break;else _0x5dcf14['push'](_0x5dcf14['shift']());}catch(_0x5efbbb){_0x5dcf14['push'](_0x5dcf14['shift']());}}}(a145_0x46aa,0x85d97));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(_0x74f9a0){const _0x478909=a145_0x48c5;if(Array[_0x478909(0x1ab)](_0x74f9a0))return'['+_0x74f9a0['map'](canonical)[_0x478909(0x1ef)](',')+']';if(_0x74f9a0&&typeof _0x74f9a0==='object')return'{'+Object[_0x478909(0x1ed)](_0x74f9a0)[_0x478909(0x1ad)]()[_0x478909(0x1a5)](_0x485bca=>JSON[_0x478909(0x1c3)](_0x485bca)+':'+canonical(_0x74f9a0[_0x485bca]))['join'](',')+'}';return JSON[_0x478909(0x1c3)](_0x74f9a0)??'undefined';}function a145_0x48c5(_0x2ca02b,_0x4a4b2c){_0x2ca02b=_0x2ca02b-0x181;const _0x46aa22=a145_0x46aa();let _0x48c509=_0x46aa22[_0x2ca02b];return _0x48c509;}const EMPTY_IMAGE_LOCATION_FIELDS=new Set([a145_0x34202c(0x1da),a145_0x34202c(0x184),'districtAdcode','district',a145_0x34202c(0x1b7),'road',a145_0x34202c(0x1c5),a145_0x34202c(0x1bc),'province','latitude',a145_0x34202c(0x189),a145_0x34202c(0x1d6),a145_0x34202c(0x19d),'streetNumber',a145_0x34202c(0x191),a145_0x34202c(0x197),a145_0x34202c(0x187),a145_0x34202c(0x183),'address','lbswuaCacheId']);export function sameImportValue(_0x171ff0,_0x7e2f24,_0x24fc19=![]){if(_0x24fc19){const _0x257455=_0x1bbdc2=>Array['isArray'](_0x1bbdc2)?_0x1bbdc2['map'](_0x3f7db8=>{const _0x446e82=a145_0x48c5;if(!_0x3f7db8||typeof _0x3f7db8!==_0x446e82(0x1cc)||Array['isArray'](_0x3f7db8))return _0x3f7db8;const _0x504d7e={..._0x3f7db8};delete _0x504d7e['url'],delete _0x504d7e[_0x446e82(0x1c7)];if(_0x504d7e[_0x446e82(0x1e7)]==='')delete _0x504d7e[_0x446e82(0x1e7)];if(_0x504d7e[_0x446e82(0x1d7)]==null)delete _0x504d7e[_0x446e82(0x1d7)];if(_0x504d7e[_0x446e82(0x1ba)]==null)delete _0x504d7e[_0x446e82(0x1ba)];if(_0x504d7e[_0x446e82(0x1cb)]==null||typeof _0x504d7e[_0x446e82(0x1cb)]===_0x446e82(0x1cc)&&!Array[_0x446e82(0x1ab)](_0x504d7e[_0x446e82(0x1cb)])&&Object[_0x446e82(0x1c9)](_0x504d7e['geolocation'])[_0x446e82(0x1b0)](([_0x360215,_0x563393])=>EMPTY_IMAGE_LOCATION_FIELDS[_0x446e82(0x1a6)](_0x360215)&&_0x563393===null))delete _0x504d7e[_0x446e82(0x1cb)];for(const _0x39d0fc of[_0x446e82(0x1ec),_0x446e82(0x1bb),_0x446e82(0x19c)])if(!(_0x39d0fc in _0x504d7e))_0x504d7e[_0x39d0fc]='';if(_0x504d7e[_0x446e82(0x1a9)]==null)_0x504d7e[_0x446e82(0x1a9)]=0x0;return _0x504d7e;}):_0x1bbdc2;return canonical(_0x257455(_0x171ff0))===canonical(_0x257455(_0x7e2f24));}return _0x171ff0===null?_0x7e2f24===null||_0x7e2f24===undefined:canonical(_0x7e2f24)===canonical(_0x171ff0);}async function rejectSymlink(_0x5d9e2a){const _0x32187f=a145_0x34202c;try{if((await lstat(_0x5d9e2a))[_0x32187f(0x18d)]())throw Error(_0x32187f(0x1fe));}catch(_0x39e73d){if(_0x39e73d[_0x32187f(0x1e2)]!==_0x32187f(0x1e4))throw _0x39e73d;}}export async function resolveImportOutputPath(_0x4bf68b){return await rejectSymlink(_0x4bf68b),resolve(await realpath(dirname(resolve(_0x4bf68b))),basename(_0x4bf68b));}export function assertImportPaths(_0x33600b,_0x16bd44,_0x5c72f2=[]){const _0x4511ba=a145_0x34202c,_0x5bfb0=[..._0x5c72f2,_0x33600b,_0x16bd44,_0x33600b+'.lock',_0x33600b+'.lock.recovery'][_0x4511ba(0x1a5)](_0xab1fd=>resolve(_0xab1fd));if(new Set(_0x5bfb0)[_0x4511ba(0x1a9)]!==_0x5bfb0['length'])throw Error('Import\x20input,\x20output\x20and\x20lock\x20paths\x20must\x20be\x20different\x20files.');}function a145_0x46aa(){const _0x50346a=['Import\x20checkpoint\x20contains\x20a\x20content\x20conflict.','The\x20import\x20checkpoint\x20is\x20locked\x20by\x20a\x20running\x20process.','version','close','netType','createUserId','kill','values','time','pid','Invalid\x20import\x20readback\x20response.','isSafeInteger','Import\x20lock\x20recovery\x20is\x20active\x20or\x20interrupted;\x20inspect\x20the\x20recovery\x20guard\x20before\x20retrying.','warnings','Previously\x20imported\x20records\x20are\x20no\x20longer\x20visible;\x20recovery\x20stopped.','Invalid\x20write\x20result.','code','1907558jnRmyT','ENOENT','writeFile','Invalid\x20import\x20lock;\x20inspect\x20it\x20before\x20recovery.','dingTalkUrl','actorId','unsent','Invalid\x20import\x20batch\x20size.','datasetCode','name','keys','The\x20server\x20import\x20contract\x20is\x20unsupported\x20or\x20incomplete.','join','8yppGoh','82107FamNDK','rowNumber','pending','schemaVersion','EEXIST','ids','utf8','mappingHash','get','byteLength','appCode','800940Jlrrdu','\x20exceeds\x20the\x20import\x20request\x20size\x20limit.','Import\x20output\x20must\x20not\x20be\x20a\x20symbolic\x20link.','add','rows','ESRCH','set','errorMessage','operatorType','.recovery','915440iAjbps','cityAdcode','string','city','succeeded','source','680162WQpWWI','isSymbolicLink','batchSize','Invalid\x20import\x20lock\x20owner.','length','accuracy','forEach','some','write','message','report','longitude','push','sync','uploadFields','now','key','resultCode','8CSuehs','includes','readback','schemaHash','Import\x20checkpoint\x20does\x20not\x20match\x20the\x20input,\x20target\x20or\x20identity.','Cannot\x20read\x20the\x20import\x20checkpoint.','parse','map','has','3604993VPHbUC','toString','size','54YqBQdD','isArray','count','sort','2074890IGAEVc','checkpoint','every','emptyRows','completed','The\x20fixed-ID\x20runner\x20requires\x20the\x20v1\x20import\x20contract.','fileHash','The\x20import\x20write\x20outcome\x20is\x20unknown.\x20Resume\x20to\x20reconcile\x20the\x20fixed\x20IDs\x20before\x20continuing.','binding','pois','importId','incomplete','createUserName','type','countryCode','token','conflict','status','schemaFingerprint','filter','hex','stringify','Excel\x20contains\x20no\x20valid\x20data\x20rows.','country','maxBatchBytes','previewUrl','maxBatchSize','entries','resume','geolocation','object','Import\x20lock\x20changed;\x20retry\x20recovery.','Import\x20primary\x20key\x20collision;\x20stop\x20without\x20replacing\x20the\x20fixed\x20IDs.','sheet','Excel\x20contains\x20invalid\x20rows;\x20no\x20data\x20was\x20written.','Excel\x20row\x20'];a145_0x46aa=function(){return _0x50346a;};return a145_0x46aa();}export async function saveImportJson(_0x4589df,_0x345e12){const _0x431702=a145_0x34202c;await rejectSymlink(_0x4589df);const _0x4ddd3a=_0x4589df+'.tmp-'+randomUUID(),_0x245094=await open(_0x4ddd3a,'wx',0x180);try{await _0x245094[_0x431702(0x1e5)](JSON['stringify'](_0x345e12,null,0x2)),await _0x245094['sync']();}finally{await _0x245094['close']();}try{await rename(_0x4ddd3a,_0x4589df);}catch(_0x18362c){await unlink(_0x4ddd3a)['catch'](()=>{});throw _0x18362c;}}export async function acquireLock(_0x5c89e8){const _0x3361ec=a145_0x34202c,_0x21cdb4=_0x5c89e8+'.lock',_0x26c297=randomUUID();await rejectSymlink(_0x21cdb4);const _0x40bf70=_0x21cdb4+_0x3361ec(0x185);let _0x426338,_0x489037;try{try{_0x426338=await open(_0x21cdb4,'wx',0x180);}catch(_0x3d111f){if(_0x3d111f[_0x3361ec(0x1e2)]!==_0x3361ec(0x1f5))throw _0x3d111f;try{_0x489037=await open(_0x40bf70,'wx',0x180);}catch(_0x2be616){if(_0x2be616[_0x3361ec(0x1e2)]===_0x3361ec(0x1f5))throw Error(_0x3361ec(0x1de));throw _0x2be616;}await _0x489037['writeFile'](JSON['stringify']({'pid':process[_0x3361ec(0x1db)],'token':_0x26c297})),await _0x489037[_0x3361ec(0x199)](),await rejectSymlink(_0x21cdb4);let _0x196654;try{_0x196654=await readFile(_0x21cdb4,_0x3361ec(0x1f7));}catch(_0x36a8e8){if(_0x36a8e8[_0x3361ec(0x1e2)]!==_0x3361ec(0x1e4))throw _0x36a8e8;}if(_0x196654!==undefined){let _0xfd89ff;try{_0xfd89ff=JSON[_0x3361ec(0x1a4)](_0x196654);}catch{throw Error(_0x3361ec(0x1e6));}if(!_0xfd89ff||!Number[_0x3361ec(0x1dd)](_0xfd89ff[_0x3361ec(0x1db)])||_0xfd89ff[_0x3361ec(0x1db)]<=0x0)throw Error(_0x3361ec(0x18f));try{process[_0x3361ec(0x1d8)](_0xfd89ff[_0x3361ec(0x1db)],0x0);throw Error(_0x3361ec(0x1d3));}catch(_0x47e667){if(_0x47e667[_0x3361ec(0x1e2)]!==_0x3361ec(0x181))throw _0x47e667;}if(await readFile(_0x21cdb4,_0x3361ec(0x1f7))!==_0x196654)throw Error(_0x3361ec(0x1cd));await unlink(_0x21cdb4);}_0x426338=await open(_0x21cdb4,'wx',0x180);}await _0x426338['writeFile'](JSON[_0x3361ec(0x1c3)]({'pid':process[_0x3361ec(0x1db)],'token':_0x26c297})),await _0x426338[_0x3361ec(0x199)]();}finally{try{await _0x426338?.[_0x3361ec(0x1d5)]();}finally{if(_0x489037)try{await _0x489037[_0x3361ec(0x1d5)]();}finally{await unlink(_0x40bf70);}}}return async()=>{const _0x553287=_0x3361ec;if(JSON[_0x553287(0x1a4)](await readFile(_0x21cdb4,_0x553287(0x1f7)))[_0x553287(0x1bd)]===_0x26c297)await unlink(_0x21cdb4);};}export function assertImportContract(_0x4b3eb5,_0x574759,_0x2714be){const _0x52a95a=a145_0x34202c;if(!_0x4b3eb5||!(_0x4b3eb5[_0x52a95a(0x1f4)]===0x1&&_0x4b3eb5['strategy']==='fixed-negative-id'||_0x4b3eb5[_0x52a95a(0x1f4)]===0x2&&_0x4b3eb5['strategy']==='auto-id-task-marker')||_0x4b3eb5[_0x52a95a(0x18b)]!=='METADATA'||_0x4b3eb5['appCode']!==_0x574759||_0x4b3eb5['datasetCode']!==_0x2714be||typeof _0x4b3eb5['actorId']!==_0x52a95a(0x188)||!_0x4b3eb5[_0x52a95a(0x1e8)]||typeof _0x4b3eb5[_0x52a95a(0x1c0)]!==_0x52a95a(0x188)||!_0x4b3eb5[_0x52a95a(0x1c0)]||!Number[_0x52a95a(0x1dd)](_0x4b3eb5[_0x52a95a(0x1c8)])||_0x4b3eb5[_0x52a95a(0x1c8)]<0x1||_0x4b3eb5[_0x52a95a(0x1c8)]>0x3e8||!Number[_0x52a95a(0x1dd)](_0x4b3eb5[_0x52a95a(0x1c6)])||_0x4b3eb5[_0x52a95a(0x1c6)]<0x1||_0x4b3eb5['maxBatchBytes']>0x14*0x400*0x400)throw Error(_0x52a95a(0x1ee));}export async function runExcelImport(_0x3d9364){const _0x3f7b9c=a145_0x34202c;_0x3d9364={..._0x3d9364,'checkpoint':await resolveImportOutputPath(_0x3d9364['checkpoint']),'report':await resolveImportOutputPath(_0x3d9364[_0x3f7b9c(0x196)])};const {manifest:_0x4a1180,contract:_0x51903d,api:_0x5bf7e0}=_0x3d9364;assertImportContract(_0x51903d,_0x3d9364[_0x3f7b9c(0x1fb)],_0x3d9364[_0x3f7b9c(0x1eb)]);if(_0x51903d[_0x3f7b9c(0x1f4)]!==0x1)throw Error(_0x3f7b9c(0x1b3));if(_0x4a1180['errors'][_0x3f7b9c(0x190)])throw Error(_0x3f7b9c(0x1d0));if(!_0x4a1180[_0x3f7b9c(0x200)]['length'])throw Error(_0x3f7b9c(0x1c4));if(!Number['isInteger'](_0x3d9364[_0x3f7b9c(0x18e)])||_0x3d9364[_0x3f7b9c(0x18e)]<0x1||_0x3d9364[_0x3f7b9c(0x18e)]>_0x51903d[_0x3f7b9c(0x1c8)])throw Error(_0x3f7b9c(0x1ea));for(const _0x4b9178 of _0x4a1180[_0x3f7b9c(0x200)]){if(Buffer[_0x3f7b9c(0x1fa)](JSON['stringify']({'schemaFingerprint':_0x51903d[_0x3f7b9c(0x1c0)],'items':[{..._0x4b9178['values'],'id':-0x1fffffffffffff}]}),'utf8')>_0x51903d[_0x3f7b9c(0x1c6)])throw Error(_0x3f7b9c(0x1d1)+_0x4b9178[_0x3f7b9c(0x1f2)]+_0x3f7b9c(0x1fd));}assertImportPaths(_0x3d9364[_0x3f7b9c(0x1af)],_0x3d9364[_0x3f7b9c(0x196)]);const _0x3eddc1={'appCode':_0x3d9364[_0x3f7b9c(0x1fb)],'datasetCode':_0x3d9364[_0x3f7b9c(0x1eb)],'runtimeDomain':_0x3d9364['runtimeDomain'],'actorId':_0x51903d[_0x3f7b9c(0x1e8)],'fileHash':_0x4a1180[_0x3f7b9c(0x1b4)],'mappingHash':_0x4a1180[_0x3f7b9c(0x1f8)],'schemaHash':_0x4a1180[_0x3f7b9c(0x1a1)],'remoteSchemaHash':_0x51903d['schemaFingerprint'],'batchSize':_0x3d9364[_0x3f7b9c(0x18e)],'sheet':_0x4a1180[_0x3f7b9c(0x1cf)]},_0x185c56=await acquireLock(_0x3d9364[_0x3f7b9c(0x1af)]);let _0x20e392;const _0x5300f2=Date[_0x3f7b9c(0x19b)]();let _0x302acd=0x0;const _0x1bf354=[],_0x69e92b=()=>({'importId':_0x20e392?.[_0x3f7b9c(0x1b8)],'sourceRows':_0x4a1180['rows']['length'],'emptyRows':_0x4a1180[_0x3f7b9c(0x1b1)][_0x3f7b9c(0x190)],'succeeded':_0x20e392?.[_0x3f7b9c(0x200)][_0x3f7b9c(0x1c1)](_0x4e4fd4=>_0x4e4fd4[_0x3f7b9c(0x1bf)]===_0x3f7b9c(0x18a))[_0x3f7b9c(0x190)]??0x0,'unknown':_0x20e392?.[_0x3f7b9c(0x200)][_0x3f7b9c(0x1c1)](_0x8a156b=>_0x8a156b[_0x3f7b9c(0x1bf)]===_0x3f7b9c(0x1f3))[_0x3f7b9c(0x190)]??0x0,'conflicts':_0x20e392?.['rows'][_0x3f7b9c(0x1c1)](_0x48a0ad=>_0x48a0ad[_0x3f7b9c(0x1bf)]==='conflict')['length']??0x0,'notAttempted':_0x20e392?.[_0x3f7b9c(0x200)][_0x3f7b9c(0x1c1)](_0x12a783=>_0x12a783[_0x3f7b9c(0x1bf)]==='unsent')[_0x3f7b9c(0x190)]??_0x4a1180[_0x3f7b9c(0x200)]['length'],'batches':_0x302acd,'batchResults':_0x1bf354,'elapsedMs':Date[_0x3f7b9c(0x19b)]()-_0x5300f2,'checkpoint':resolve(_0x3d9364[_0x3f7b9c(0x1af)]),'report':resolve(_0x3d9364[_0x3f7b9c(0x196)]),'warnings':_0x4a1180[_0x3f7b9c(0x1df)]});try{await rejectSymlink(_0x3d9364[_0x3f7b9c(0x1af)]);if(_0x3d9364['resume']){try{_0x20e392=JSON[_0x3f7b9c(0x1a4)](await readFile(_0x3d9364[_0x3f7b9c(0x1af)],'utf8'));}catch{throw Error(_0x3f7b9c(0x1a3));}if(!_0x20e392||_0x20e392[_0x3f7b9c(0x1d4)]!==0x1||typeof _0x20e392['importId']!==_0x3f7b9c(0x188)||canonical(_0x20e392[_0x3f7b9c(0x1b6)])!==canonical(_0x3eddc1)||!Array[_0x3f7b9c(0x1ab)](_0x20e392[_0x3f7b9c(0x200)])||_0x20e392[_0x3f7b9c(0x200)][_0x3f7b9c(0x190)]!==_0x4a1180[_0x3f7b9c(0x200)]['length']||new Set(_0x20e392['rows'][_0x3f7b9c(0x1a5)](_0x50ffcb=>_0x50ffcb['id']))[_0x3f7b9c(0x1a9)]!==_0x20e392[_0x3f7b9c(0x200)]['length']||_0x20e392[_0x3f7b9c(0x200)]['some']((_0x4020bc,_0x38d138)=>!Number['isSafeInteger'](_0x4020bc['id'])||_0x4020bc['id']>=0x0||_0x4020bc[_0x3f7b9c(0x1f2)]!==_0x4a1180[_0x3f7b9c(0x200)][_0x38d138][_0x3f7b9c(0x1f2)]||!['unsent','pending',_0x3f7b9c(0x18a),_0x3f7b9c(0x1be)][_0x3f7b9c(0x19f)](_0x4020bc[_0x3f7b9c(0x1bf)])))throw Error(_0x3f7b9c(0x1a2));}else{try{await lstat(_0x3d9364['checkpoint']);throw Error('Import\x20checkpoint\x20already\x20exists;\x20use\x20--resume.');}catch(_0x5c7f83){if(_0x5c7f83[_0x3f7b9c(0x1e2)]!==_0x3f7b9c(0x1e4))throw _0x5c7f83;}const _0x403c06=new Set();_0x20e392={'version':0x1,'importId':randomUUID(),'binding':_0x3eddc1,'rows':_0x4a1180[_0x3f7b9c(0x200)]['map'](_0x5cf589=>{const _0x42c84e=_0x3f7b9c;let _0x30ff14;do{_0x30ff14=-(Number(BigInt('0x'+randomBytes(0x7)[_0x42c84e(0x1a8)](_0x42c84e(0x1c2)))&(0x1n<<0x34n)-0x1n)+0x1);}while(_0x403c06[_0x42c84e(0x1a6)](_0x30ff14));return _0x403c06[_0x42c84e(0x1ff)](_0x30ff14),{'id':_0x30ff14,'rowNumber':_0x5cf589[_0x42c84e(0x1f2)],'status':_0x42c84e(0x1e9)};})},await saveImportJson(_0x3d9364[_0x3f7b9c(0x1af)],_0x20e392);}await _0x3d9364['onCheckpointReady']?.();const _0x23e198=_0x20e392;if(_0x23e198[_0x3f7b9c(0x200)][_0x3f7b9c(0x193)](_0x4001ac=>_0x4001ac[_0x3f7b9c(0x1bf)]===_0x3f7b9c(0x1be)))throw Error(_0x3f7b9c(0x1d2));const _0x509815=async _0x58be9b=>{const _0x10472e=_0x3f7b9c,_0x33bb32=await _0x5bf7e0[_0x10472e(0x1a0)](_0x58be9b[_0x10472e(0x1a5)](_0x15a927=>_0x23e198['rows'][_0x15a927]['id']));if(!Array[_0x10472e(0x1ab)](_0x33bb32))throw Error(_0x10472e(0x1dc));const _0x41c913=new Set(_0x58be9b[_0x10472e(0x1a5)](_0x1b396f=>_0x23e198[_0x10472e(0x200)][_0x1b396f]['id'])),_0x59e907=new Map();for(const _0x40a9e3 of _0x33bb32){const _0x537260=Number(_0x40a9e3?.['id']);if(!_0x41c913[_0x10472e(0x1a6)](_0x537260)||_0x59e907[_0x10472e(0x1a6)](_0x537260))throw Error('Invalid\x20or\x20duplicate\x20import\x20readback\x20ID.');_0x59e907[_0x10472e(0x182)](_0x537260,_0x40a9e3);}for(const _0x40ff2d of _0x58be9b){const _0x374aae=_0x59e907[_0x10472e(0x1f9)](_0x23e198['rows'][_0x40ff2d]['id']);if(!_0x374aae)continue;if(_0x23e198[_0x10472e(0x200)][_0x40ff2d][_0x10472e(0x1bf)]===_0x10472e(0x1e9)){_0x23e198[_0x10472e(0x200)][_0x40ff2d][_0x10472e(0x1bf)]='conflict',await saveImportJson(_0x3d9364['checkpoint'],_0x23e198);throw Error(_0x10472e(0x1ce));}const _0x101f6a=_0x4a1180[_0x10472e(0x200)][_0x40ff2d][_0x10472e(0x1d9)];if(Object[_0x10472e(0x1ed)](_0x101f6a)[_0x10472e(0x193)](_0x508068=>!sameImportValue(_0x101f6a[_0x508068],_0x374aae[_0x508068],_0x4a1180['imageFields']?.[_0x10472e(0x19f)](_0x508068)&&!_0x4a1180[_0x10472e(0x19a)]?.[_0x10472e(0x19f)](_0x508068)))){_0x23e198['rows'][_0x40ff2d]['status']=_0x10472e(0x1be),await saveImportJson(_0x3d9364['checkpoint'],_0x23e198);throw Error('Import\x20content\x20conflict\x20at\x20Excel\x20row\x20'+_0x23e198[_0x10472e(0x200)][_0x40ff2d][_0x10472e(0x1f2)]+'.');}_0x23e198[_0x10472e(0x200)][_0x40ff2d]['status']=_0x10472e(0x18a);}return await saveImportJson(_0x3d9364[_0x10472e(0x1af)],_0x23e198),_0x59e907;};if(_0x3d9364[_0x3f7b9c(0x1ca)])for(let _0xcde895=0x0;_0xcde895<_0x23e198[_0x3f7b9c(0x200)]['length'];_0xcde895+=_0x3d9364[_0x3f7b9c(0x18e)]){const _0x1b3664=_0x23e198['rows']['slice'](_0xcde895,_0xcde895+_0x3d9364[_0x3f7b9c(0x18e)])['map']((_0x2dcfa9,_0x3335eb)=>_0xcde895+_0x3335eb),_0x1035ec=_0x1b3664[_0x3f7b9c(0x1c1)](_0x1d3aff=>_0x23e198[_0x3f7b9c(0x200)][_0x1d3aff][_0x3f7b9c(0x1bf)]===_0x3f7b9c(0x18a)),_0x365166=await _0x509815(_0x1b3664),_0x1dd1cf=_0x1035ec[_0x3f7b9c(0x1c1)](_0x3971eb=>!_0x365166[_0x3f7b9c(0x1a6)](_0x23e198['rows'][_0x3971eb]['id']));if(_0x1dd1cf[_0x3f7b9c(0x190)]){_0x1dd1cf[_0x3f7b9c(0x192)](_0x403732=>{const _0x4d3514=_0x3f7b9c;_0x23e198['rows'][_0x403732][_0x4d3514(0x1bf)]='conflict';}),await saveImportJson(_0x3d9364['checkpoint'],_0x23e198);throw Error(_0x3f7b9c(0x1e0));}}for(let _0x5a2b44=0x0;_0x5a2b44<_0x23e198[_0x3f7b9c(0x200)][_0x3f7b9c(0x190)];){const _0x25c6b9=[],_0xfc0809=[];while(_0x5a2b44<_0x23e198['rows'][_0x3f7b9c(0x190)]&&_0xfc0809[_0x3f7b9c(0x190)]<_0x3d9364['batchSize']){const _0x3b6499=_0x5a2b44++;if(_0x23e198['rows'][_0x3b6499]['status']===_0x3f7b9c(0x18a))continue;const _0x2a2c69={..._0x4a1180['rows'][_0x3b6499][_0x3f7b9c(0x1d9)],'id':_0x23e198[_0x3f7b9c(0x200)][_0x3b6499]['id']};if(Buffer[_0x3f7b9c(0x1fa)](JSON['stringify']({'schemaFingerprint':_0x51903d[_0x3f7b9c(0x1c0)],'items':[..._0xfc0809,_0x2a2c69]}),'utf8')>_0x51903d[_0x3f7b9c(0x1c6)]){if(!_0xfc0809['length'])throw Error(_0x3f7b9c(0x1d1)+_0x23e198[_0x3f7b9c(0x200)][_0x3b6499][_0x3f7b9c(0x1f2)]+_0x3f7b9c(0x1fd));_0x5a2b44--;break;}_0x25c6b9[_0x3f7b9c(0x198)](_0x3b6499),_0xfc0809['push'](_0x2a2c69);}if(!_0xfc0809[_0x3f7b9c(0x190)])continue;const _0xde6176=_0x25c6b9['filter'](_0x53003b=>_0x23e198[_0x3f7b9c(0x200)][_0x53003b][_0x3f7b9c(0x1bf)]===_0x3f7b9c(0x1e9));if(_0xde6176['length']){const _0x46a43e=await _0x5bf7e0[_0x3f7b9c(0x1a0)](_0xde6176[_0x3f7b9c(0x1a5)](_0x52a8b1=>_0x23e198[_0x3f7b9c(0x200)][_0x52a8b1]['id']));if(!Array[_0x3f7b9c(0x1ab)](_0x46a43e))throw Error(_0x3f7b9c(0x1dc));if(_0x46a43e[_0x3f7b9c(0x190)])throw Error('Import\x20primary\x20key\x20collision;\x20stop\x20without\x20replacing\x20the\x20fixed\x20IDs.');}_0x25c6b9[_0x3f7b9c(0x192)](_0x5b5be9=>{const _0x4b768f=_0x3f7b9c;_0x23e198[_0x4b768f(0x200)][_0x5b5be9]['status']=_0x4b768f(0x1f3);}),await saveImportJson(_0x3d9364[_0x3f7b9c(0x1af)],_0x23e198),_0x302acd++;const _0x91bf76=Date['now'](),_0x284b4c={'batch':_0x302acd,'rowStart':_0x23e198[_0x3f7b9c(0x200)][_0x25c6b9[0x0]][_0x3f7b9c(0x1f2)],'rowEnd':_0x23e198[_0x3f7b9c(0x200)][_0x25c6b9[_0x25c6b9[_0x3f7b9c(0x190)]-0x1]][_0x3f7b9c(0x1f2)],'count':_0xfc0809[_0x3f7b9c(0x190)],'bytes':Buffer[_0x3f7b9c(0x1fa)](JSON['stringify']({'schemaFingerprint':_0x51903d[_0x3f7b9c(0x1c0)],'items':_0xfc0809}),_0x3f7b9c(0x1f7)),'elapsedMs':0x0,'status':'unknown'};_0x1bf354[_0x3f7b9c(0x198)](_0x284b4c);try{const _0x4332d6=await _0x5bf7e0[_0x3f7b9c(0x194)](_0xfc0809);if(!_0x4332d6||_0x4332d6[_0x3f7b9c(0x1ac)]!==_0xfc0809[_0x3f7b9c(0x190)]||!Array[_0x3f7b9c(0x1ab)](_0x4332d6[_0x3f7b9c(0x1f6)])||_0x4332d6[_0x3f7b9c(0x1f6)][_0x3f7b9c(0x190)]!==_0xfc0809[_0x3f7b9c(0x190)]||_0x4332d6[_0x3f7b9c(0x1f6)]['some']((_0xa93ae0,_0x12e110)=>Number(_0xa93ae0)!==_0x23e198[_0x3f7b9c(0x200)][_0x25c6b9[_0x12e110]]['id']))throw Error(_0x3f7b9c(0x1e1));await _0x509815(_0x25c6b9);if(_0x25c6b9[_0x3f7b9c(0x193)](_0x1ffd66=>_0x23e198[_0x3f7b9c(0x200)][_0x1ffd66]['status']!==_0x3f7b9c(0x18a)))throw Error('Incomplete\x20readback.');}catch(_0x3836b0){if(_0x23e198[_0x3f7b9c(0x200)][_0x3f7b9c(0x193)](_0x303405=>_0x303405[_0x3f7b9c(0x1bf)]===_0x3f7b9c(0x1be)))throw _0x3836b0;try{await _0x509815(_0x25c6b9);}catch(_0x70bfdf){if(_0x23e198['rows'][_0x3f7b9c(0x193)](_0x3a155c=>_0x3a155c['status']===_0x3f7b9c(0x1be)))throw _0x70bfdf;}if(_0x25c6b9['some'](_0x5d36b3=>_0x23e198[_0x3f7b9c(0x200)][_0x5d36b3][_0x3f7b9c(0x1bf)]!==_0x3f7b9c(0x18a)))throw Error(_0x3f7b9c(0x1b5));}finally{_0x284b4c['elapsedMs']=Date[_0x3f7b9c(0x19b)]()-_0x91bf76;if(_0x25c6b9['every'](_0x668fab=>_0x23e198['rows'][_0x668fab]['status']===_0x3f7b9c(0x18a)))_0x284b4c[_0x3f7b9c(0x1bf)]=_0x3f7b9c(0x18a);else{if(_0x25c6b9['some'](_0x21b8b8=>_0x23e198[_0x3f7b9c(0x200)][_0x21b8b8]['status']==='conflict'))_0x284b4c[_0x3f7b9c(0x1bf)]=_0x3f7b9c(0x1be);}}}const _0x25f053={'status':_0x3f7b9c(0x1b2),..._0x69e92b()};return await saveImportJson(_0x3d9364[_0x3f7b9c(0x196)],_0x25f053),_0x25f053;}catch(_0x550654){if(_0x20e392)await saveImportJson(_0x3d9364[_0x3f7b9c(0x196)],{'status':_0x3f7b9c(0x1b9),..._0x69e92b(),'message':_0x550654[_0x3f7b9c(0x195)]});throw _0x550654;}finally{await _0x185c56();}}
1
+ const a146_0x3beb1d=a146_0x550c;(function(_0x246b5c,_0x2c14d7){const _0x12979d=a146_0x550c,_0x563acc=_0x246b5c();while(!![]){try{const _0x1ba35e=-parseInt(_0x12979d(0x1f6))/0x1*(parseInt(_0x12979d(0x1d5))/0x2)+parseInt(_0x12979d(0x1b9))/0x3+-parseInt(_0x12979d(0x213))/0x4+-parseInt(_0x12979d(0x1df))/0x5*(-parseInt(_0x12979d(0x1a7))/0x6)+parseInt(_0x12979d(0x1d7))/0x7+-parseInt(_0x12979d(0x216))/0x8+parseInt(_0x12979d(0x214))/0x9*(parseInt(_0x12979d(0x1ab))/0xa);if(_0x1ba35e===_0x2c14d7)break;else _0x563acc['push'](_0x563acc['shift']());}catch(_0x33d81e){_0x563acc['push'](_0x563acc['shift']());}}}(a146_0x30b2,0xb6e90));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(_0x46527f){const _0x305782=a146_0x550c;if(Array['isArray'](_0x46527f))return'['+_0x46527f[_0x305782(0x1d3)](canonical)[_0x305782(0x201)](',')+']';if(_0x46527f&&typeof _0x46527f==='object')return'{'+Object[_0x305782(0x209)](_0x46527f)['sort']()[_0x305782(0x1d3)](_0xfb32ec=>JSON['stringify'](_0xfb32ec)+':'+canonical(_0x46527f[_0xfb32ec]))[_0x305782(0x201)](',')+'}';return JSON[_0x305782(0x1d1)](_0x46527f)??_0x305782(0x205);}const EMPTY_IMAGE_LOCATION_FIELDS=new Set(['time',a146_0x3beb1d(0x211),a146_0x3beb1d(0x221),a146_0x3beb1d(0x20c),a146_0x3beb1d(0x1eb),a146_0x3beb1d(0x1cb),a146_0x3beb1d(0x1a4),a146_0x3beb1d(0x1a0),a146_0x3beb1d(0x1a9),'latitude','city',a146_0x3beb1d(0x1a8),a146_0x3beb1d(0x206),'streetNumber',a146_0x3beb1d(0x215),'longitude',a146_0x3beb1d(0x1e4),a146_0x3beb1d(0x1e3),'address',a146_0x3beb1d(0x1fb)]);export function sameImportValue(_0x3910ab,_0x4fd75b,_0x51ba86=![]){const _0x19fc68=a146_0x3beb1d;if(_0x51ba86){const _0x2ac391=_0x58c14c=>Array[_0x19fc68(0x208)](_0x58c14c)?_0x58c14c['map'](_0x256bca=>{const _0x2fedfa=_0x19fc68;if(!_0x256bca||typeof _0x256bca!=='object'||Array[_0x2fedfa(0x208)](_0x256bca))return _0x256bca;const _0xdb8862={..._0x256bca};delete _0xdb8862['url'],delete _0xdb8862[_0x2fedfa(0x19f)];if(_0xdb8862[_0x2fedfa(0x1ae)]==='')delete _0xdb8862[_0x2fedfa(0x1ae)];if(_0xdb8862[_0x2fedfa(0x1c9)]==null)delete _0xdb8862[_0x2fedfa(0x1c9)];if(_0xdb8862[_0x2fedfa(0x210)]==null)delete _0xdb8862['createUserName'];if(_0xdb8862[_0x2fedfa(0x1bd)]==null||typeof _0xdb8862[_0x2fedfa(0x1bd)]===_0x2fedfa(0x1a5)&&!Array[_0x2fedfa(0x208)](_0xdb8862['geolocation'])&&Object[_0x2fedfa(0x1e7)](_0xdb8862[_0x2fedfa(0x1bd)])[_0x2fedfa(0x1ed)](([_0xe1fc04,_0x3721d1])=>EMPTY_IMAGE_LOCATION_FIELDS[_0x2fedfa(0x1ea)](_0xe1fc04)&&_0x3721d1===null))delete _0xdb8862[_0x2fedfa(0x1bd)];for(const _0x712f4 of[_0x2fedfa(0x1d0),_0x2fedfa(0x1fa),_0x2fedfa(0x1ca)])if(!(_0x712f4 in _0xdb8862))_0xdb8862[_0x712f4]='';if(_0xdb8862[_0x2fedfa(0x1f2)]==null)_0xdb8862['size']=0x0;return _0xdb8862;}):_0x58c14c;return canonical(_0x2ac391(_0x3910ab))===canonical(_0x2ac391(_0x4fd75b));}return _0x3910ab===null?_0x4fd75b===null||_0x4fd75b===undefined:canonical(_0x4fd75b)===canonical(_0x3910ab);}async function rejectSymlink(_0x18d4b4){const _0x4de913=a146_0x3beb1d;try{if((await lstat(_0x18d4b4))[_0x4de913(0x1ef)]())throw Error('Import\x20output\x20must\x20not\x20be\x20a\x20symbolic\x20link.');}catch(_0x4ba446){if(_0x4ba446[_0x4de913(0x219)]!=='ENOENT')throw _0x4ba446;}}export async function resolveImportOutputPath(_0x572cee){return await rejectSymlink(_0x572cee),resolve(await realpath(dirname(resolve(_0x572cee))),basename(_0x572cee));}export function assertImportPaths(_0x4a7185,_0x56b3de,_0x111e12=[]){const _0x17db95=a146_0x3beb1d,_0x18a42f=[..._0x111e12,_0x4a7185,_0x56b3de,_0x4a7185+_0x17db95(0x1b2),_0x4a7185+_0x17db95(0x1cc)][_0x17db95(0x1d3)](_0x35afaa=>resolve(_0x35afaa));if(new Set(_0x18a42f)[_0x17db95(0x1f2)]!==_0x18a42f['length'])throw Error(_0x17db95(0x1ec));}export async function saveImportJson(_0x4b6039,_0x2dc5a3){const _0x530353=a146_0x3beb1d;await rejectSymlink(_0x4b6039);const _0xdba0a0=_0x4b6039+'.tmp-'+randomUUID(),_0x17868f=await open(_0xdba0a0,'wx',0x180);try{await _0x17868f[_0x530353(0x1c0)](JSON[_0x530353(0x1d1)](_0x2dc5a3,null,0x2)),await _0x17868f[_0x530353(0x1f7)]();}finally{await _0x17868f[_0x530353(0x1e0)]();}try{await rename(_0xdba0a0,_0x4b6039);}catch(_0x1e95bb){await unlink(_0xdba0a0)['catch'](()=>{});throw _0x1e95bb;}}function a146_0x550c(_0x2c3ca3,_0x5616c5){_0x2c3ca3=_0x2c3ca3-0x19e;const _0x30b201=a146_0x30b2();let _0x550c19=_0x30b201[_0x2c3ca3];return _0x550c19;}export async function acquireLock(_0x4d733a){const _0x22c982=a146_0x3beb1d,_0x25407c=_0x4d733a+_0x22c982(0x1b2),_0x3f3c59=randomUUID();await rejectSymlink(_0x25407c);const _0x131609=_0x25407c+'.recovery';let _0x4a2493,_0x3e0687;try{try{_0x4a2493=await open(_0x25407c,'wx',0x180);}catch(_0x3137b4){if(_0x3137b4[_0x22c982(0x219)]!==_0x22c982(0x1e6))throw _0x3137b4;try{_0x3e0687=await open(_0x131609,'wx',0x180);}catch(_0x1937be){if(_0x1937be[_0x22c982(0x219)]===_0x22c982(0x1e6))throw Error('Import\x20lock\x20recovery\x20is\x20active\x20or\x20interrupted;\x20inspect\x20the\x20recovery\x20guard\x20before\x20retrying.');throw _0x1937be;}await _0x3e0687[_0x22c982(0x1c0)](JSON['stringify']({'pid':process[_0x22c982(0x1cd)],'token':_0x3f3c59})),await _0x3e0687['sync'](),await rejectSymlink(_0x25407c);let _0x2ad565;try{_0x2ad565=await readFile(_0x25407c,_0x22c982(0x1c8));}catch(_0x301eee){if(_0x301eee['code']!=='ENOENT')throw _0x301eee;}if(_0x2ad565!==undefined){let _0x5bb235;try{_0x5bb235=JSON[_0x22c982(0x212)](_0x2ad565);}catch{throw Error(_0x22c982(0x1e9));}if(!_0x5bb235||!Number['isSafeInteger'](_0x5bb235[_0x22c982(0x1cd)])||_0x5bb235[_0x22c982(0x1cd)]<=0x0)throw Error(_0x22c982(0x1aa));try{process[_0x22c982(0x207)](_0x5bb235[_0x22c982(0x1cd)],0x0);throw Error(_0x22c982(0x20e));}catch(_0x398365){if(_0x398365[_0x22c982(0x219)]!=='ESRCH')throw _0x398365;}if(await readFile(_0x25407c,_0x22c982(0x1c8))!==_0x2ad565)throw Error(_0x22c982(0x1fe));await unlink(_0x25407c);}_0x4a2493=await open(_0x25407c,'wx',0x180);}await _0x4a2493['writeFile'](JSON['stringify']({'pid':process['pid'],'token':_0x3f3c59})),await _0x4a2493[_0x22c982(0x1f7)]();}finally{try{await _0x4a2493?.[_0x22c982(0x1e0)]();}finally{if(_0x3e0687)try{await _0x3e0687[_0x22c982(0x1e0)]();}finally{await unlink(_0x131609);}}}return async()=>{const _0x231aaf=_0x22c982;if(JSON[_0x231aaf(0x212)](await readFile(_0x25407c,_0x231aaf(0x1c8)))[_0x231aaf(0x1c4)]===_0x3f3c59)await unlink(_0x25407c);};}export function assertImportContract(_0x29fa0e,_0x37536e,_0x134dbb){const _0x3f7ba1=a146_0x3beb1d;if(!_0x29fa0e||!(_0x29fa0e[_0x3f7ba1(0x1de)]===0x1&&_0x29fa0e[_0x3f7ba1(0x1dd)]===_0x3f7ba1(0x1bc)||_0x29fa0e[_0x3f7ba1(0x1de)]===0x2&&_0x29fa0e[_0x3f7ba1(0x1dd)]===_0x3f7ba1(0x20f))||_0x29fa0e[_0x3f7ba1(0x1f8)]!=='METADATA'||_0x29fa0e[_0x3f7ba1(0x1b1)]!==_0x37536e||_0x29fa0e['datasetCode']!==_0x134dbb||typeof _0x29fa0e[_0x3f7ba1(0x1f1)]!==_0x3f7ba1(0x20d)||!_0x29fa0e[_0x3f7ba1(0x1f1)]||typeof _0x29fa0e[_0x3f7ba1(0x1d9)]!==_0x3f7ba1(0x20d)||!_0x29fa0e[_0x3f7ba1(0x1d9)]||!Number[_0x3f7ba1(0x1af)](_0x29fa0e[_0x3f7ba1(0x1be)])||_0x29fa0e[_0x3f7ba1(0x1be)]<0x1||_0x29fa0e['maxBatchSize']>0x3e8||!Number[_0x3f7ba1(0x1af)](_0x29fa0e['maxBatchBytes'])||_0x29fa0e[_0x3f7ba1(0x20b)]<0x1||_0x29fa0e['maxBatchBytes']>0x14*0x400*0x400)throw Error(_0x3f7ba1(0x1ba));}function a146_0x30b2(){const _0x4a4eca=['source','now','type','lbswuaCacheId','rowNumber','Previously\x20imported\x20records\x20are\x20no\x20longer\x20visible;\x20recovery\x20stopped.','Import\x20lock\x20changed;\x20retry\x20recovery.','filter','Cannot\x20read\x20the\x20import\x20checkpoint.','join','status','Invalid\x20write\x20result.','version','undefined','resultCode','kill','isArray','keys','Import\x20content\x20conflict\x20at\x20Excel\x20row\x20','maxBatchBytes','district','string','The\x20import\x20checkpoint\x20is\x20locked\x20by\x20a\x20running\x20process.','auto-id-task-marker','createUserName','operatorType','parse','4618056mlRWit','297qYPWwx','accuracy','5384024BRZemX','some','Incomplete\x20readback.','code','get','rows','Import\x20checkpoint\x20contains\x20a\x20content\x20conflict.','\x20exceeds\x20the\x20import\x20request\x20size\x20limit.','fileHash','forEach','values','districtAdcode','slice','previewUrl','countryCode','message','mappingHash','toString','country','object','onCheckpointReady','108aqOzUe','netType','province','Invalid\x20import\x20lock\x20owner.','184910ucQlkU','Import\x20primary\x20key\x20collision;\x20stop\x20without\x20replacing\x20the\x20fixed\x20IDs.','Invalid\x20import\x20batch\x20size.','dingTalkUrl','isSafeInteger','set','appCode','.lock','runtimeDomain','Import\x20checkpoint\x20does\x20not\x20match\x20the\x20input,\x20target\x20or\x20identity.','importId','checkpoint','includes','push','972825AOiouH','The\x20server\x20import\x20contract\x20is\x20unsupported\x20or\x20incomplete.','uploadFields','fixed-negative-id','geolocation','maxBatchSize','isInteger','writeFile','schemaHash','write','datasetCode','token','readback','count','binding','utf8','createUserId','key','road','.lock.recovery','pid','conflict','resume','name','stringify','The\x20import\x20write\x20outcome\x20is\x20unknown.\x20Resume\x20to\x20reconcile\x20the\x20fixed\x20IDs\x20before\x20continuing.','map','report','2TNWHOE','Excel\x20row\x20','7532350Adorzw','unsent','schemaFingerprint','completed','length','elapsedMs','strategy','schemaVersion','230410ubvVAI','close','imageFields','succeeded','errorMessage','cityAdcode','Import\x20checkpoint\x20already\x20exists;\x20use\x20--resume.','EEXIST','entries','byteLength','Invalid\x20import\x20lock;\x20inspect\x20it\x20before\x20recovery.','has','pois','Import\x20input,\x20output\x20and\x20lock\x20paths\x20must\x20be\x20different\x20files.','every','Excel\x20contains\x20invalid\x20rows;\x20no\x20data\x20was\x20written.','isSymbolicLink','pending','actorId','size','ids','ENOENT','batchSize','263287jbRRRT','sync'];a146_0x30b2=function(){return _0x4a4eca;};return a146_0x30b2();}export async function runExcelImport(_0x332138){const _0x46ce75=a146_0x3beb1d;_0x332138={..._0x332138,'checkpoint':await resolveImportOutputPath(_0x332138[_0x46ce75(0x1b6)]),'report':await resolveImportOutputPath(_0x332138[_0x46ce75(0x1d4)])};const {manifest:_0x85885e,contract:_0x806bfb,api:_0x4143de}=_0x332138;assertImportContract(_0x806bfb,_0x332138[_0x46ce75(0x1b1)],_0x332138[_0x46ce75(0x1c3)]);if(_0x806bfb[_0x46ce75(0x1de)]!==0x1)throw Error('The\x20fixed-ID\x20runner\x20requires\x20the\x20v1\x20import\x20contract.');if(_0x85885e['errors'][_0x46ce75(0x1db)])throw Error(_0x46ce75(0x1ee));if(!_0x85885e[_0x46ce75(0x21b)]['length'])throw Error('Excel\x20contains\x20no\x20valid\x20data\x20rows.');if(!Number[_0x46ce75(0x1bf)](_0x332138[_0x46ce75(0x1f5)])||_0x332138[_0x46ce75(0x1f5)]<0x1||_0x332138[_0x46ce75(0x1f5)]>_0x806bfb[_0x46ce75(0x1be)])throw Error(_0x46ce75(0x1ad));for(const _0x50be0b of _0x85885e['rows']){if(Buffer[_0x46ce75(0x1e8)](JSON[_0x46ce75(0x1d1)]({'schemaFingerprint':_0x806bfb[_0x46ce75(0x1d9)],'items':[{..._0x50be0b[_0x46ce75(0x220)],'id':-0x1fffffffffffff}]}),'utf8')>_0x806bfb[_0x46ce75(0x20b)])throw Error(_0x46ce75(0x1d6)+_0x50be0b[_0x46ce75(0x1fc)]+_0x46ce75(0x21d));}assertImportPaths(_0x332138[_0x46ce75(0x1b6)],_0x332138[_0x46ce75(0x1d4)]);const _0x3dbe91={'appCode':_0x332138[_0x46ce75(0x1b1)],'datasetCode':_0x332138[_0x46ce75(0x1c3)],'runtimeDomain':_0x332138[_0x46ce75(0x1b3)],'actorId':_0x806bfb['actorId'],'fileHash':_0x85885e[_0x46ce75(0x21e)],'mappingHash':_0x85885e[_0x46ce75(0x1a2)],'schemaHash':_0x85885e[_0x46ce75(0x1c1)],'remoteSchemaHash':_0x806bfb[_0x46ce75(0x1d9)],'batchSize':_0x332138['batchSize'],'sheet':_0x85885e['sheet']},_0x159c17=await acquireLock(_0x332138[_0x46ce75(0x1b6)]);let _0x6e7a9;const _0x5d6270=Date[_0x46ce75(0x1f9)]();let _0x4ec7c4=0x0;const _0x3c7d77=[],_0x93d091=()=>({'importId':_0x6e7a9?.['importId'],'sourceRows':_0x85885e[_0x46ce75(0x21b)][_0x46ce75(0x1db)],'emptyRows':_0x85885e['emptyRows'][_0x46ce75(0x1db)],'succeeded':_0x6e7a9?.[_0x46ce75(0x21b)][_0x46ce75(0x1ff)](_0x2aef39=>_0x2aef39['status']===_0x46ce75(0x1e2))[_0x46ce75(0x1db)]??0x0,'unknown':_0x6e7a9?.[_0x46ce75(0x21b)][_0x46ce75(0x1ff)](_0x333fd0=>_0x333fd0[_0x46ce75(0x202)]===_0x46ce75(0x1f0))[_0x46ce75(0x1db)]??0x0,'conflicts':_0x6e7a9?.['rows'][_0x46ce75(0x1ff)](_0xa963aa=>_0xa963aa[_0x46ce75(0x202)]===_0x46ce75(0x1ce))[_0x46ce75(0x1db)]??0x0,'notAttempted':_0x6e7a9?.['rows'][_0x46ce75(0x1ff)](_0x44fa9d=>_0x44fa9d[_0x46ce75(0x202)]===_0x46ce75(0x1d8))['length']??_0x85885e[_0x46ce75(0x21b)][_0x46ce75(0x1db)],'batches':_0x4ec7c4,'batchResults':_0x3c7d77,'elapsedMs':Date[_0x46ce75(0x1f9)]()-_0x5d6270,'checkpoint':resolve(_0x332138[_0x46ce75(0x1b6)]),'report':resolve(_0x332138[_0x46ce75(0x1d4)]),'warnings':_0x85885e['warnings']});try{await rejectSymlink(_0x332138[_0x46ce75(0x1b6)]);if(_0x332138[_0x46ce75(0x1cf)]){try{_0x6e7a9=JSON[_0x46ce75(0x212)](await readFile(_0x332138[_0x46ce75(0x1b6)],_0x46ce75(0x1c8)));}catch{throw Error(_0x46ce75(0x200));}if(!_0x6e7a9||_0x6e7a9[_0x46ce75(0x204)]!==0x1||typeof _0x6e7a9[_0x46ce75(0x1b5)]!==_0x46ce75(0x20d)||canonical(_0x6e7a9[_0x46ce75(0x1c7)])!==canonical(_0x3dbe91)||!Array['isArray'](_0x6e7a9['rows'])||_0x6e7a9[_0x46ce75(0x21b)][_0x46ce75(0x1db)]!==_0x85885e[_0x46ce75(0x21b)][_0x46ce75(0x1db)]||new Set(_0x6e7a9[_0x46ce75(0x21b)]['map'](_0x5a2716=>_0x5a2716['id']))[_0x46ce75(0x1f2)]!==_0x6e7a9['rows'][_0x46ce75(0x1db)]||_0x6e7a9[_0x46ce75(0x21b)][_0x46ce75(0x217)]((_0x58ffaf,_0x3f9cf6)=>!Number[_0x46ce75(0x1af)](_0x58ffaf['id'])||_0x58ffaf['id']>=0x0||_0x58ffaf[_0x46ce75(0x1fc)]!==_0x85885e[_0x46ce75(0x21b)][_0x3f9cf6][_0x46ce75(0x1fc)]||![_0x46ce75(0x1d8),_0x46ce75(0x1f0),_0x46ce75(0x1e2),_0x46ce75(0x1ce)][_0x46ce75(0x1b7)](_0x58ffaf['status'])))throw Error(_0x46ce75(0x1b4));}else{try{await lstat(_0x332138[_0x46ce75(0x1b6)]);throw Error(_0x46ce75(0x1e5));}catch(_0x2e71ee){if(_0x2e71ee[_0x46ce75(0x219)]!==_0x46ce75(0x1f4))throw _0x2e71ee;}const _0x18144f=new Set();_0x6e7a9={'version':0x1,'importId':randomUUID(),'binding':_0x3dbe91,'rows':_0x85885e[_0x46ce75(0x21b)][_0x46ce75(0x1d3)](_0x5ecc87=>{const _0x2d04f1=_0x46ce75;let _0x4bee8c;do{_0x4bee8c=-(Number(BigInt('0x'+randomBytes(0x7)[_0x2d04f1(0x1a3)]('hex'))&(0x1n<<0x34n)-0x1n)+0x1);}while(_0x18144f['has'](_0x4bee8c));return _0x18144f['add'](_0x4bee8c),{'id':_0x4bee8c,'rowNumber':_0x5ecc87[_0x2d04f1(0x1fc)],'status':_0x2d04f1(0x1d8)};})},await saveImportJson(_0x332138[_0x46ce75(0x1b6)],_0x6e7a9);}await _0x332138[_0x46ce75(0x1a6)]?.();const _0x1de2f1=_0x6e7a9;if(_0x1de2f1[_0x46ce75(0x21b)]['some'](_0xb77d82=>_0xb77d82[_0x46ce75(0x202)]==='conflict'))throw Error(_0x46ce75(0x21c));const _0x423ff1=async _0x292fae=>{const _0x19018d=_0x46ce75,_0x4a3c02=await _0x4143de[_0x19018d(0x1c5)](_0x292fae[_0x19018d(0x1d3)](_0x1e7607=>_0x1de2f1[_0x19018d(0x21b)][_0x1e7607]['id']));if(!Array['isArray'](_0x4a3c02))throw Error('Invalid\x20import\x20readback\x20response.');const _0x517b14=new Set(_0x292fae[_0x19018d(0x1d3)](_0x29de46=>_0x1de2f1[_0x19018d(0x21b)][_0x29de46]['id'])),_0x3ba94c=new Map();for(const _0x1c832d of _0x4a3c02){const _0x1e037c=Number(_0x1c832d?.['id']);if(!_0x517b14['has'](_0x1e037c)||_0x3ba94c[_0x19018d(0x1ea)](_0x1e037c))throw Error('Invalid\x20or\x20duplicate\x20import\x20readback\x20ID.');_0x3ba94c[_0x19018d(0x1b0)](_0x1e037c,_0x1c832d);}for(const _0x46c0ab of _0x292fae){const _0x19e1ad=_0x3ba94c[_0x19018d(0x21a)](_0x1de2f1[_0x19018d(0x21b)][_0x46c0ab]['id']);if(!_0x19e1ad)continue;if(_0x1de2f1[_0x19018d(0x21b)][_0x46c0ab][_0x19018d(0x202)]===_0x19018d(0x1d8)){_0x1de2f1[_0x19018d(0x21b)][_0x46c0ab]['status']=_0x19018d(0x1ce),await saveImportJson(_0x332138[_0x19018d(0x1b6)],_0x1de2f1);throw Error(_0x19018d(0x1ac));}const _0x338e9f=_0x85885e[_0x19018d(0x21b)][_0x46c0ab][_0x19018d(0x220)];if(Object[_0x19018d(0x209)](_0x338e9f)[_0x19018d(0x217)](_0x13f7b5=>!sameImportValue(_0x338e9f[_0x13f7b5],_0x19e1ad[_0x13f7b5],_0x85885e[_0x19018d(0x1e1)]?.[_0x19018d(0x1b7)](_0x13f7b5)&&!_0x85885e[_0x19018d(0x1bb)]?.[_0x19018d(0x1b7)](_0x13f7b5)))){_0x1de2f1['rows'][_0x46c0ab][_0x19018d(0x202)]=_0x19018d(0x1ce),await saveImportJson(_0x332138[_0x19018d(0x1b6)],_0x1de2f1);throw Error(_0x19018d(0x20a)+_0x1de2f1[_0x19018d(0x21b)][_0x46c0ab][_0x19018d(0x1fc)]+'.');}_0x1de2f1[_0x19018d(0x21b)][_0x46c0ab][_0x19018d(0x202)]=_0x19018d(0x1e2);}return await saveImportJson(_0x332138[_0x19018d(0x1b6)],_0x1de2f1),_0x3ba94c;};if(_0x332138[_0x46ce75(0x1cf)])for(let _0x54d927=0x0;_0x54d927<_0x1de2f1[_0x46ce75(0x21b)][_0x46ce75(0x1db)];_0x54d927+=_0x332138[_0x46ce75(0x1f5)]){const _0x163231=_0x1de2f1[_0x46ce75(0x21b)][_0x46ce75(0x19e)](_0x54d927,_0x54d927+_0x332138[_0x46ce75(0x1f5)])[_0x46ce75(0x1d3)]((_0x2e1983,_0x1d4a52)=>_0x54d927+_0x1d4a52),_0x4d826e=_0x163231[_0x46ce75(0x1ff)](_0x382001=>_0x1de2f1[_0x46ce75(0x21b)][_0x382001][_0x46ce75(0x202)]===_0x46ce75(0x1e2)),_0x20bd0a=await _0x423ff1(_0x163231),_0x22f8cd=_0x4d826e['filter'](_0x93c8c1=>!_0x20bd0a[_0x46ce75(0x1ea)](_0x1de2f1[_0x46ce75(0x21b)][_0x93c8c1]['id']));if(_0x22f8cd['length']){_0x22f8cd[_0x46ce75(0x21f)](_0x29c56a=>{const _0x238302=_0x46ce75;_0x1de2f1[_0x238302(0x21b)][_0x29c56a][_0x238302(0x202)]=_0x238302(0x1ce);}),await saveImportJson(_0x332138[_0x46ce75(0x1b6)],_0x1de2f1);throw Error(_0x46ce75(0x1fd));}}for(let _0x15333b=0x0;_0x15333b<_0x1de2f1['rows'][_0x46ce75(0x1db)];){const _0x3d0160=[],_0x45ae16=[];while(_0x15333b<_0x1de2f1['rows']['length']&&_0x45ae16[_0x46ce75(0x1db)]<_0x332138[_0x46ce75(0x1f5)]){const _0x4695b5=_0x15333b++;if(_0x1de2f1['rows'][_0x4695b5][_0x46ce75(0x202)]==='succeeded')continue;const _0x3111fc={..._0x85885e[_0x46ce75(0x21b)][_0x4695b5][_0x46ce75(0x220)],'id':_0x1de2f1[_0x46ce75(0x21b)][_0x4695b5]['id']};if(Buffer['byteLength'](JSON['stringify']({'schemaFingerprint':_0x806bfb[_0x46ce75(0x1d9)],'items':[..._0x45ae16,_0x3111fc]}),'utf8')>_0x806bfb[_0x46ce75(0x20b)]){if(!_0x45ae16[_0x46ce75(0x1db)])throw Error(_0x46ce75(0x1d6)+_0x1de2f1['rows'][_0x4695b5][_0x46ce75(0x1fc)]+_0x46ce75(0x21d));_0x15333b--;break;}_0x3d0160[_0x46ce75(0x1b8)](_0x4695b5),_0x45ae16[_0x46ce75(0x1b8)](_0x3111fc);}if(!_0x45ae16['length'])continue;const _0x1d9c08=_0x3d0160[_0x46ce75(0x1ff)](_0xf62950=>_0x1de2f1[_0x46ce75(0x21b)][_0xf62950][_0x46ce75(0x202)]===_0x46ce75(0x1d8));if(_0x1d9c08[_0x46ce75(0x1db)]){const _0xaf15e8=await _0x4143de[_0x46ce75(0x1c5)](_0x1d9c08[_0x46ce75(0x1d3)](_0x29ee82=>_0x1de2f1['rows'][_0x29ee82]['id']));if(!Array[_0x46ce75(0x208)](_0xaf15e8))throw Error('Invalid\x20import\x20readback\x20response.');if(_0xaf15e8[_0x46ce75(0x1db)])throw Error('Import\x20primary\x20key\x20collision;\x20stop\x20without\x20replacing\x20the\x20fixed\x20IDs.');}_0x3d0160[_0x46ce75(0x21f)](_0x5af2a0=>{const _0x2e54e8=_0x46ce75;_0x1de2f1[_0x2e54e8(0x21b)][_0x5af2a0][_0x2e54e8(0x202)]=_0x2e54e8(0x1f0);}),await saveImportJson(_0x332138['checkpoint'],_0x1de2f1),_0x4ec7c4++;const _0x3792d7=Date[_0x46ce75(0x1f9)](),_0x15d98c={'batch':_0x4ec7c4,'rowStart':_0x1de2f1['rows'][_0x3d0160[0x0]][_0x46ce75(0x1fc)],'rowEnd':_0x1de2f1[_0x46ce75(0x21b)][_0x3d0160[_0x3d0160[_0x46ce75(0x1db)]-0x1]]['rowNumber'],'count':_0x45ae16['length'],'bytes':Buffer[_0x46ce75(0x1e8)](JSON[_0x46ce75(0x1d1)]({'schemaFingerprint':_0x806bfb['schemaFingerprint'],'items':_0x45ae16}),_0x46ce75(0x1c8)),'elapsedMs':0x0,'status':'unknown'};_0x3c7d77['push'](_0x15d98c);try{const _0x1d6e48=await _0x4143de[_0x46ce75(0x1c2)](_0x45ae16);if(!_0x1d6e48||_0x1d6e48[_0x46ce75(0x1c6)]!==_0x45ae16['length']||!Array[_0x46ce75(0x208)](_0x1d6e48[_0x46ce75(0x1f3)])||_0x1d6e48[_0x46ce75(0x1f3)]['length']!==_0x45ae16[_0x46ce75(0x1db)]||_0x1d6e48[_0x46ce75(0x1f3)][_0x46ce75(0x217)]((_0x35af13,_0x3daf0a)=>Number(_0x35af13)!==_0x1de2f1[_0x46ce75(0x21b)][_0x3d0160[_0x3daf0a]]['id']))throw Error(_0x46ce75(0x203));await _0x423ff1(_0x3d0160);if(_0x3d0160[_0x46ce75(0x217)](_0x15fa83=>_0x1de2f1[_0x46ce75(0x21b)][_0x15fa83][_0x46ce75(0x202)]!==_0x46ce75(0x1e2)))throw Error(_0x46ce75(0x218));}catch(_0x4e33e6){if(_0x1de2f1[_0x46ce75(0x21b)][_0x46ce75(0x217)](_0x3f8b90=>_0x3f8b90[_0x46ce75(0x202)]==='conflict'))throw _0x4e33e6;try{await _0x423ff1(_0x3d0160);}catch(_0x2384be){if(_0x1de2f1[_0x46ce75(0x21b)][_0x46ce75(0x217)](_0x5b73f5=>_0x5b73f5[_0x46ce75(0x202)]==='conflict'))throw _0x2384be;}if(_0x3d0160[_0x46ce75(0x217)](_0x2d7e5f=>_0x1de2f1[_0x46ce75(0x21b)][_0x2d7e5f][_0x46ce75(0x202)]!==_0x46ce75(0x1e2)))throw Error(_0x46ce75(0x1d2));}finally{_0x15d98c[_0x46ce75(0x1dc)]=Date[_0x46ce75(0x1f9)]()-_0x3792d7;if(_0x3d0160[_0x46ce75(0x1ed)](_0x151269=>_0x1de2f1[_0x46ce75(0x21b)][_0x151269][_0x46ce75(0x202)]===_0x46ce75(0x1e2)))_0x15d98c['status']='succeeded';else{if(_0x3d0160[_0x46ce75(0x217)](_0x425e85=>_0x1de2f1['rows'][_0x425e85][_0x46ce75(0x202)]==='conflict'))_0x15d98c[_0x46ce75(0x202)]=_0x46ce75(0x1ce);}}}const _0x2dda11={'status':_0x46ce75(0x1da),..._0x93d091()};return await saveImportJson(_0x332138[_0x46ce75(0x1d4)],_0x2dda11),_0x2dda11;}catch(_0x59d7ea){if(_0x6e7a9)await saveImportJson(_0x332138[_0x46ce75(0x1d4)],{'status':'incomplete',..._0x93d091(),'message':_0x59d7ea[_0x46ce75(0x1a1)]});throw _0x59d7ea;}finally{await _0x159c17();}}
@@ -1 +1 @@
1
- const a147_0x1d61b2=a147_0x2ef8;(function(_0x17dbee,_0x2eacee){const _0x9da1ab=a147_0x2ef8,_0x12b38a=_0x17dbee();while(!![]){try{const _0x510518=parseInt(_0x9da1ab(0x93))/0x1*(-parseInt(_0x9da1ab(0xa5))/0x2)+-parseInt(_0x9da1ab(0xa7))/0x3+parseInt(_0x9da1ab(0x7a))/0x4*(parseInt(_0x9da1ab(0xb3))/0x5)+parseInt(_0x9da1ab(0x9b))/0x6+parseInt(_0x9da1ab(0x81))/0x7*(parseInt(_0x9da1ab(0x6e))/0x8)+parseInt(_0x9da1ab(0xb1))/0x9+-parseInt(_0x9da1ab(0x86))/0xa*(parseInt(_0x9da1ab(0x92))/0xb);if(_0x510518===_0x2eacee)break;else _0x12b38a['push'](_0x12b38a['shift']());}catch(_0x542489){_0x12b38a['push'](_0x12b38a['shift']());}}}(a147_0x2dca,0x8ae11));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=a147_0x1d61b2(0x87),SKILL_NAME=a147_0x1d61b2(0x77),debug=debuglog(a147_0x1d61b2(0x84));function frontmatterValue(_0x34332c,_0x46cff3){const _0x1cc96b=a147_0x1d61b2;return _0x34332c[_0x1cc96b(0x8a)](new RegExp('^'+_0x46cff3+_0x1cc96b(0x78),'m'))?.[0x1]?.[_0x1cc96b(0xb4)]()??'';}function listFiles(_0x4413b5,_0x4723d6=_0x4413b5){const _0x87e554=a147_0x1d61b2;return readdirSync(_0x4723d6,{'withFileTypes':!![]})[_0x87e554(0xa8)](_0x2704c0=>{const _0x5b4344=_0x87e554,_0x45aa9e=join(_0x4723d6,_0x2704c0[_0x5b4344(0x94)]),_0x4eb8bc=lstatSync(_0x45aa9e);if(_0x4eb8bc['isSymbolicLink']())throw new Error(_0x5b4344(0xa9)+_0x45aa9e);if(_0x4eb8bc['isDirectory']())return listFiles(_0x4413b5,_0x45aa9e);if(!_0x4eb8bc[_0x5b4344(0x85)]())throw new Error(_0x5b4344(0x7f)+_0x45aa9e);return[relative(_0x4413b5,_0x45aa9e)[_0x5b4344(0xa6)](sep)[_0x5b4344(0x8f)]('/')];})[_0x87e554(0x97)]((_0x32a7a1,_0x5c6ce6)=>_0x32a7a1<_0x5c6ce6?-0x1:_0x32a7a1>_0x5c6ce6?0x1:0x0);}function digestFiles(_0x3d6a6b,_0x5a072b){const _0x41980b=a147_0x1d61b2,_0x7baafb=createHash('sha256');for(const _0x1ff60e of _0x5a072b){if(_0x1ff60e[_0x41980b(0x91)]('/')||_0x1ff60e[_0x41980b(0xa6)]('/')[_0x41980b(0x95)]('..')||_0x1ff60e['includes']('\x5c'))throw new Error(_0x41980b(0x80)+_0x1ff60e);_0x7baafb[_0x41980b(0xaa)](_0x1ff60e),_0x7baafb[_0x41980b(0xaa)]('\x00'),_0x7baafb[_0x41980b(0xaa)](readFileSync(join(_0x3d6a6b,..._0x1ff60e[_0x41980b(0xa6)]('/')))),_0x7baafb[_0x41980b(0xaa)]('\x00');}return _0x7baafb['digest'](_0x41980b(0x82));}function sameFiles(_0x142db1,_0x3c4043){const _0x20013c=a147_0x1d61b2;return _0x142db1[_0x20013c(0x7c)]===_0x3c4043['length']&&_0x142db1[_0x20013c(0xad)]((_0x4680f0,_0x2a34c4)=>_0x4680f0===_0x3c4043[_0x2a34c4]);}function readSource(_0x449de6){const _0x5c731c=a147_0x1d61b2,_0x282bc7=JSON[_0x5c731c(0x88)](readFileSync(join(_0x449de6,_0x5c731c(0xab)),'utf8')),_0x1f1a0a=JSON[_0x5c731c(0x88)](readFileSync(join(_0x449de6,'skills',_0x5c731c(0x89)),_0x5c731c(0x96))),_0xb0a426=join(_0x449de6,_0x5c731c(0x8e),SKILL_NAME),_0x2cfe7f=frontmatterValue(readFileSync(join(_0xb0a426,_0x5c731c(0x79)),'utf8'),_0x5c731c(0xaf)),_0x59f6d3=listFiles(_0xb0a426);if(_0x1f1a0a[_0x5c731c(0xb0)]!==0x1||_0x1f1a0a[_0x5c731c(0x94)]!==SKILL_NAME||!_0x282bc7[_0x5c731c(0xaf)]||_0x1f1a0a[_0x5c731c(0x9f)]!==_0x282bc7[_0x5c731c(0xaf)]||_0x1f1a0a[_0x5c731c(0x7b)]!==_0x282bc7[_0x5c731c(0xaf)]||_0x2cfe7f!==_0x282bc7[_0x5c731c(0xaf)]||!sameFiles(_0x59f6d3,_0x1f1a0a[_0x5c731c(0x70)])||digestFiles(_0xb0a426,_0x59f6d3)!==_0x1f1a0a[_0x5c731c(0xa0)])throw new Error('Built-in\x20Skill\x20source\x20does\x20not\x20match\x20its\x20package\x20manifest');return{'packageVersion':_0x282bc7['version'],'skillVersion':_0x2cfe7f,'root':_0xb0a426,'manifest':_0x1f1a0a};}function installedSkillPath(_0x161d30){const _0xd42b8e=a147_0x1d61b2,_0x1585d0=resolveInstalledSkill(SKILL_NAME,{'home':_0x161d30});if(_0x1585d0['state']===_0xd42b8e(0xb2))return{'state':_0xd42b8e(0xb2),'path':dirname(_0x1585d0[_0xd42b8e(0xa1)])};if(_0x1585d0[_0xd42b8e(0x83)]==='absent')return{'state':_0xd42b8e(0x7d)};return{'state':'unverifiable','reason':_0x1585d0['reason']};}function a147_0x2dca(){const _0xf8ce07=['name','includes','utf8','sort','installedPath','\x20verified;\x20','CLI\x20Built-in\x20Skill\x20','2454180WqzGLE','packageRoot','stdio','current','packageVersion','digest','path','home','root','version_mismatch','14yvhhEn','split','346614ZqlVzm','flatMap','Symbolic\x20link\x20is\x20not\x20allowed:\x20','update','package.json','content_mismatch','every','status','version','schemaVersion','8431443NvPTiE','present','2263950FAJCMC','trim','Installer\x20reported\x20partial\x20target\x20failures:\x0a%s','72056pzvGdC','unverifiable','files','\x20automatically\x20selected\x20installation\x20target(s)\x20could\x20not\x20be\x20installed.','error','VERIFY_FAILED','skills@latest\x20exited\x20','partialFailure','unknown','lovrabet',':\x5cs*(.+)$','SKILL.md','8zWeYbB','skillVersion','length','missing','output','Unsupported\x20Skill\x20entry:\x20','Unsafe\x20manifest\x20path:\x20','91DDutpC','hex','state','lovrabet-skills','isFile','3365610mdbvyM','lovrabet\x20cli-skill\x20install','parse','lovrabet.manifest.json','match','Installed\x20Skill\x20state\x20is\x20','reason','message','skills','join','INSTALL_FAILED','startsWith','44reZGRP','48271HZBFJu'];a147_0x2dca=function(){return _0xf8ce07;};return a147_0x2dca();}export function inspectInstalledBuiltinSkillVersion(_0x4bd91b,_0x424e64={}){const _0x44880b=a147_0x1d61b2,_0x1b4a87=installedSkillPath(_0x424e64[_0x44880b(0xa2)]??homedir());if(_0x1b4a87[_0x44880b(0x83)]===_0x44880b(0x7d))return{'state':'missing','expectedVersion':_0x4bd91b,'repairCommand':REPAIR_COMMAND};if(_0x1b4a87[_0x44880b(0x83)]===_0x44880b(0x6f))return{'state':_0x44880b(0x6f),'expectedVersion':_0x4bd91b,'reason':_0x1b4a87[_0x44880b(0x8c)],'repairCommand':REPAIR_COMMAND};try{const _0x35c251=frontmatterValue(readFileSync(join(_0x1b4a87['path'],_0x44880b(0x79)),_0x44880b(0x96)),'version');return{'state':_0x35c251===_0x4bd91b?'current':_0x44880b(0xa4),'expectedVersion':_0x4bd91b,'skillVersion':_0x35c251,'installedPath':_0x1b4a87[_0x44880b(0xa1)],'repairCommand':REPAIR_COMMAND};}catch(_0x104cbe){return{'state':_0x44880b(0x6f),'expectedVersion':_0x4bd91b,'installedPath':_0x1b4a87[_0x44880b(0xa1)],'reason':_0x104cbe instanceof Error?_0x104cbe['message']:String(_0x104cbe),'repairCommand':REPAIR_COMMAND};}}export function inspectBuiltinSkill(_0x44e119={}){const _0x5857ff=a147_0x1d61b2,_0x10d3c5=_0x44e119[_0x5857ff(0x9c)]??DEFAULT_PACKAGE_ROOT;let _0x54eec4;try{_0x54eec4=readSource(_0x10d3c5);}catch(_0x2ebc40){return{'state':'unverifiable','packageVersion':_0x5857ff(0x76),'reason':_0x2ebc40 instanceof Error?_0x2ebc40['message']:String(_0x2ebc40),'repairCommand':REPAIR_COMMAND};}const _0x315968=installedSkillPath(_0x44e119[_0x5857ff(0xa2)]??homedir());if(_0x315968[_0x5857ff(0x83)]==='missing')return{'state':_0x5857ff(0x7d),'packageVersion':_0x54eec4[_0x5857ff(0x9f)],'repairCommand':REPAIR_COMMAND};if(_0x315968['state']===_0x5857ff(0x6f))return{'state':_0x5857ff(0x6f),'packageVersion':_0x54eec4[_0x5857ff(0x9f)],'reason':_0x315968[_0x5857ff(0x8c)],'repairCommand':REPAIR_COMMAND};try{const _0x10bd17=frontmatterValue(readFileSync(join(_0x315968['path'],_0x5857ff(0x79)),_0x5857ff(0x96)),'version');if(_0x10bd17!==_0x54eec4[_0x5857ff(0x7b)])return{'state':_0x5857ff(0xa4),'packageVersion':_0x54eec4[_0x5857ff(0x9f)],'skillVersion':_0x10bd17,'installedPath':_0x315968[_0x5857ff(0xa1)],'repairCommand':REPAIR_COMMAND};const _0x282a83=listFiles(_0x315968[_0x5857ff(0xa1)]),_0x39829c=digestFiles(_0x315968[_0x5857ff(0xa1)],_0x282a83);return{'state':sameFiles(_0x282a83,_0x54eec4['manifest'][_0x5857ff(0x70)])&&_0x39829c===_0x54eec4['manifest'][_0x5857ff(0xa0)]?'current':_0x5857ff(0xac),'packageVersion':_0x54eec4[_0x5857ff(0x9f)],'skillVersion':_0x10bd17,'installedPath':_0x315968[_0x5857ff(0xa1)],'digest':_0x39829c,'repairCommand':REPAIR_COMMAND};}catch(_0x58bfe0){return{'state':_0x5857ff(0x6f),'packageVersion':_0x54eec4[_0x5857ff(0x9f)],'installedPath':_0x315968[_0x5857ff(0xa1)],'reason':_0x58bfe0 instanceof Error?_0x58bfe0[_0x5857ff(0x8d)]:String(_0x58bfe0),'repairCommand':REPAIR_COMMAND};}}function failure(_0x35a8db,_0x489d7e,_0x4b1df2,_0x42ac4b){const _0xc85b96=a147_0x1d61b2;return{'ok':![],'code':_0x35a8db,'packageVersion':_0x489d7e['packageVersion'],'skillVersion':_0x489d7e[_0xc85b96(0x7b)],'installedPath':_0x42ac4b,'changed':![],'repairCommand':REPAIR_COMMAND,'error':_0x4b1df2 instanceof Error?_0x4b1df2[_0xc85b96(0x8d)]:String(_0x4b1df2)};}function a147_0x2ef8(_0x54b7b0,_0x4b88e1){_0x54b7b0=_0x54b7b0-0x6e;const _0x2dca61=a147_0x2dca();let _0x2ef889=_0x2dca61[_0x54b7b0];return _0x2ef889;}export function installBuiltinSkill(_0x137eb8={}){const _0x34202f=a147_0x1d61b2,_0x1781ff=_0x137eb8['packageRoot']??DEFAULT_PACKAGE_ROOT,_0xc71b4b=_0x137eb8['home']??homedir();let _0x5d302f;try{_0x5d302f=readSource(_0x1781ff);}catch(_0x826695){return failure('SOURCE_INVALID',{'packageVersion':'unknown','skillVersion':'unknown'},_0x826695);}const _0x336663=inspectBuiltinSkill({'packageRoot':_0x1781ff,'home':_0xc71b4b}),_0xfb3ec=runNpxSkillsAddGlobal(_0x1781ff,_0x5d302f[_0x34202f(0xa3)],{'stdio':_0x137eb8[_0x34202f(0x9d)]??'pipe','expectedSkillName':SKILL_NAME,'presence':{'home':_0xc71b4b}});if(_0xfb3ec['skipped'])return{'ok':!![],'packageVersion':_0x5d302f['packageVersion'],'skillVersion':_0x5d302f[_0x34202f(0x7b)],'installedPath':_0x336663[_0x34202f(0x98)],'changed':![],'repairCommand':REPAIR_COMMAND};if(!_0xfb3ec['ok'])return failure(_0x34202f(0x90),_0x5d302f,_0xfb3ec[_0x34202f(0x72)]??_0x34202f(0x74)+_0xfb3ec[_0x34202f(0xae)]);const _0x50b84a=inspectBuiltinSkill({'packageRoot':_0x1781ff,'home':_0xc71b4b});if(_0x50b84a[_0x34202f(0x83)]!==_0x34202f(0x9e)){const _0x2fe24d=_0x50b84a['reason']??_0x34202f(0x8b)+_0x50b84a['state'];return failure(_0x34202f(0x73),_0x5d302f,_0xfb3ec[_0x34202f(0x75)]?_0x2fe24d+'\x0a'+_0xfb3ec['partialFailure']['output']:_0x2fe24d,_0x50b84a[_0x34202f(0x98)]);}return _0xfb3ec[_0x34202f(0x75)]&&(debug(_0x34202f(0xb5),_0xfb3ec[_0x34202f(0x75)][_0x34202f(0x7e)]),console['log'](_0x34202f(0x9a)+_0x5d302f['skillVersion']+_0x34202f(0x99)+_0xfb3ec['partialFailure']['count']+_0x34202f(0x71))),{'ok':!![],'packageVersion':_0x5d302f[_0x34202f(0x9f)],'skillVersion':_0x5d302f[_0x34202f(0x7b)],'installedPath':_0x50b84a[_0x34202f(0x98)],'changed':_0x336663[_0x34202f(0x83)]!==_0x34202f(0x9e),'repairCommand':REPAIR_COMMAND};}
1
+ const a148_0x119fdc=a148_0x4b2b;(function(_0x4cd3f3,_0x55085d){const _0x562d5e=a148_0x4b2b,_0x3a8edf=_0x4cd3f3();while(!![]){try{const _0x463822=-parseInt(_0x562d5e(0x1df))/0x1*(-parseInt(_0x562d5e(0x1e7))/0x2)+parseInt(_0x562d5e(0x1f7))/0x3+-parseInt(_0x562d5e(0x1ef))/0x4+-parseInt(_0x562d5e(0x1fb))/0x5*(parseInt(_0x562d5e(0x1f9))/0x6)+-parseInt(_0x562d5e(0x1cb))/0x7+parseInt(_0x562d5e(0x20b))/0x8*(parseInt(_0x562d5e(0x204))/0x9)+parseInt(_0x562d5e(0x1dc))/0xa*(parseInt(_0x562d5e(0x1ce))/0xb);if(_0x463822===_0x55085d)break;else _0x3a8edf['push'](_0x3a8edf['shift']());}catch(_0x9dc046){_0x3a8edf['push'](_0x3a8edf['shift']());}}}(a148_0x1ffe,0xdceb8));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';function a148_0x1ffe(){const _0xeb0bf4=['missing','home','\x20verified;\x20','present','length','20ALaQSd','SKILL.md','status','22878BJwvMg','unverifiable','reason','startsWith','lovrabet.manifest.json','packageRoot','isDirectory','sort','110fzvxlQ','Installer\x20reported\x20partial\x20target\x20failures:\x0a%s','partialFailure','every','isFile','match','installedPath','absent','3354428aKbHLh','pipe','INSTALL_FAILED','message','lovrabet','path','skills','lovrabet\x20cli-skill\x20install','2411517ZwkfOC','lovrabet-skills','534ruOZRe','version_mismatch','26155DmBBws','VERIFY_FAILED','skillVersion','root','state','package.json','name','hex','Unsupported\x20Skill\x20entry:\x20','81ZlJEnO','output','log','sha256','update','count','Built-in\x20Skill\x20source\x20does\x20not\x20match\x20its\x20package\x20manifest','989208cwGlUO','packageVersion','manifest','current','content_mismatch','join','skipped','schemaVersion','Installed\x20Skill\x20state\x20is\x20','7143472hVNURJ','version','files','300091bgOHAk','unknown','digest','includes','parse','Symbolic\x20link\x20is\x20not\x20allowed:\x20','skills@latest\x20exited\x20','split','utf8'];a148_0x1ffe=function(){return _0xeb0bf4;};return a148_0x1ffe();}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=a148_0x119fdc(0x1f6),SKILL_NAME=a148_0x119fdc(0x1f3),debug=debuglog(a148_0x119fdc(0x1f8));function frontmatterValue(_0x3089ff,_0xfc3719){const _0x4f965b=a148_0x119fdc;return _0x3089ff[_0x4f965b(0x1ec)](new RegExp('^'+_0xfc3719+':\x5cs*(.+)$','m'))?.[0x1]?.['trim']()??'';}function a148_0x4b2b(_0x239686,_0x3cb9be){_0x239686=_0x239686-0x1c4;const _0x1ffee8=a148_0x1ffe();let _0x4b2b18=_0x1ffee8[_0x239686];return _0x4b2b18;}function listFiles(_0x4e899d,_0x1f6053=_0x4e899d){const _0x3be9f5=a148_0x119fdc;return readdirSync(_0x1f6053,{'withFileTypes':!![]})['flatMap'](_0x419655=>{const _0x3a626b=a148_0x4b2b,_0x3ca538=join(_0x1f6053,_0x419655[_0x3a626b(0x201)]),_0x14f003=lstatSync(_0x3ca538);if(_0x14f003['isSymbolicLink']())throw new Error(_0x3a626b(0x1d3)+_0x3ca538);if(_0x14f003[_0x3a626b(0x1e5)]())return listFiles(_0x4e899d,_0x3ca538);if(!_0x14f003[_0x3a626b(0x1eb)]())throw new Error(_0x3a626b(0x203)+_0x3ca538);return[relative(_0x4e899d,_0x3ca538)[_0x3a626b(0x1d5)](sep)[_0x3a626b(0x1c7)]('/')];})[_0x3be9f5(0x1e6)]((_0x3e2ecc,_0x1519f5)=>_0x3e2ecc<_0x1519f5?-0x1:_0x3e2ecc>_0x1519f5?0x1:0x0);}function digestFiles(_0x2e6b53,_0x312e40){const _0xf13264=a148_0x119fdc,_0x5b27fa=createHash(_0xf13264(0x207));for(const _0x23eef of _0x312e40){if(_0x23eef[_0xf13264(0x1e2)]('/')||_0x23eef['split']('/')[_0xf13264(0x1d1)]('..')||_0x23eef['includes']('\x5c'))throw new Error('Unsafe\x20manifest\x20path:\x20'+_0x23eef);_0x5b27fa[_0xf13264(0x208)](_0x23eef),_0x5b27fa['update']('\x00'),_0x5b27fa[_0xf13264(0x208)](readFileSync(join(_0x2e6b53,..._0x23eef[_0xf13264(0x1d5)]('/')))),_0x5b27fa['update']('\x00');}return _0x5b27fa[_0xf13264(0x1d0)](_0xf13264(0x202));}function sameFiles(_0x9f9c5f,_0x512d2a){const _0x3cf681=a148_0x119fdc;return _0x9f9c5f[_0x3cf681(0x1db)]===_0x512d2a[_0x3cf681(0x1db)]&&_0x9f9c5f[_0x3cf681(0x1ea)]((_0x4412b8,_0x4ed57e)=>_0x4412b8===_0x512d2a[_0x4ed57e]);}function readSource(_0x582d88){const _0xf2a769=a148_0x119fdc,_0x24f517=JSON[_0xf2a769(0x1d2)](readFileSync(join(_0x582d88,_0xf2a769(0x200)),_0xf2a769(0x1d6))),_0x3da240=JSON['parse'](readFileSync(join(_0x582d88,_0xf2a769(0x1f5),_0xf2a769(0x1e3)),_0xf2a769(0x1d6))),_0x5d58a2=join(_0x582d88,_0xf2a769(0x1f5),SKILL_NAME),_0x227795=frontmatterValue(readFileSync(join(_0x5d58a2,_0xf2a769(0x1dd)),_0xf2a769(0x1d6)),_0xf2a769(0x1cc)),_0x35d0d1=listFiles(_0x5d58a2);if(_0x3da240[_0xf2a769(0x1c9)]!==0x1||_0x3da240[_0xf2a769(0x201)]!==SKILL_NAME||!_0x24f517[_0xf2a769(0x1cc)]||_0x3da240[_0xf2a769(0x20c)]!==_0x24f517[_0xf2a769(0x1cc)]||_0x3da240[_0xf2a769(0x1fd)]!==_0x24f517[_0xf2a769(0x1cc)]||_0x227795!==_0x24f517[_0xf2a769(0x1cc)]||!sameFiles(_0x35d0d1,_0x3da240[_0xf2a769(0x1cd)])||digestFiles(_0x5d58a2,_0x35d0d1)!==_0x3da240[_0xf2a769(0x1d0)])throw new Error(_0xf2a769(0x20a));return{'packageVersion':_0x24f517[_0xf2a769(0x1cc)],'skillVersion':_0x227795,'root':_0x5d58a2,'manifest':_0x3da240};}function installedSkillPath(_0x5242ec){const _0xb22b65=a148_0x119fdc,_0x4ff354=resolveInstalledSkill(SKILL_NAME,{'home':_0x5242ec});if(_0x4ff354[_0xb22b65(0x1ff)]===_0xb22b65(0x1da))return{'state':_0xb22b65(0x1da),'path':dirname(_0x4ff354[_0xb22b65(0x1f4)])};if(_0x4ff354[_0xb22b65(0x1ff)]===_0xb22b65(0x1ee))return{'state':_0xb22b65(0x1d7)};return{'state':_0xb22b65(0x1e0),'reason':_0x4ff354['reason']};}export function inspectInstalledBuiltinSkillVersion(_0x2d8ef3,_0x2ee935={}){const _0x3793ab=a148_0x119fdc,_0x91110e=installedSkillPath(_0x2ee935[_0x3793ab(0x1d8)]??homedir());if(_0x91110e[_0x3793ab(0x1ff)]===_0x3793ab(0x1d7))return{'state':_0x3793ab(0x1d7),'expectedVersion':_0x2d8ef3,'repairCommand':REPAIR_COMMAND};if(_0x91110e[_0x3793ab(0x1ff)]==='unverifiable')return{'state':_0x3793ab(0x1e0),'expectedVersion':_0x2d8ef3,'reason':_0x91110e['reason'],'repairCommand':REPAIR_COMMAND};try{const _0x3b7353=frontmatterValue(readFileSync(join(_0x91110e['path'],_0x3793ab(0x1dd)),'utf8'),_0x3793ab(0x1cc));return{'state':_0x3b7353===_0x2d8ef3?_0x3793ab(0x1c5):_0x3793ab(0x1fa),'expectedVersion':_0x2d8ef3,'skillVersion':_0x3b7353,'installedPath':_0x91110e[_0x3793ab(0x1f4)],'repairCommand':REPAIR_COMMAND};}catch(_0x18cda7){return{'state':_0x3793ab(0x1e0),'expectedVersion':_0x2d8ef3,'installedPath':_0x91110e['path'],'reason':_0x18cda7 instanceof Error?_0x18cda7['message']:String(_0x18cda7),'repairCommand':REPAIR_COMMAND};}}export function inspectBuiltinSkill(_0x20bd16={}){const _0x3af81b=a148_0x119fdc,_0x54eabb=_0x20bd16[_0x3af81b(0x1e4)]??DEFAULT_PACKAGE_ROOT;let _0x900d7f;try{_0x900d7f=readSource(_0x54eabb);}catch(_0x3792d9){return{'state':_0x3af81b(0x1e0),'packageVersion':'unknown','reason':_0x3792d9 instanceof Error?_0x3792d9[_0x3af81b(0x1f2)]:String(_0x3792d9),'repairCommand':REPAIR_COMMAND};}const _0x1772f8=installedSkillPath(_0x20bd16[_0x3af81b(0x1d8)]??homedir());if(_0x1772f8[_0x3af81b(0x1ff)]===_0x3af81b(0x1d7))return{'state':_0x3af81b(0x1d7),'packageVersion':_0x900d7f['packageVersion'],'repairCommand':REPAIR_COMMAND};if(_0x1772f8[_0x3af81b(0x1ff)]===_0x3af81b(0x1e0))return{'state':_0x3af81b(0x1e0),'packageVersion':_0x900d7f['packageVersion'],'reason':_0x1772f8[_0x3af81b(0x1e1)],'repairCommand':REPAIR_COMMAND};try{const _0x41c853=frontmatterValue(readFileSync(join(_0x1772f8[_0x3af81b(0x1f4)],_0x3af81b(0x1dd)),'utf8'),_0x3af81b(0x1cc));if(_0x41c853!==_0x900d7f[_0x3af81b(0x1fd)])return{'state':'version_mismatch','packageVersion':_0x900d7f[_0x3af81b(0x20c)],'skillVersion':_0x41c853,'installedPath':_0x1772f8[_0x3af81b(0x1f4)],'repairCommand':REPAIR_COMMAND};const _0x17db0a=listFiles(_0x1772f8[_0x3af81b(0x1f4)]),_0x3b5ffb=digestFiles(_0x1772f8[_0x3af81b(0x1f4)],_0x17db0a);return{'state':sameFiles(_0x17db0a,_0x900d7f[_0x3af81b(0x1c4)][_0x3af81b(0x1cd)])&&_0x3b5ffb===_0x900d7f[_0x3af81b(0x1c4)][_0x3af81b(0x1d0)]?_0x3af81b(0x1c5):_0x3af81b(0x1c6),'packageVersion':_0x900d7f[_0x3af81b(0x20c)],'skillVersion':_0x41c853,'installedPath':_0x1772f8[_0x3af81b(0x1f4)],'digest':_0x3b5ffb,'repairCommand':REPAIR_COMMAND};}catch(_0x34cc5f){return{'state':_0x3af81b(0x1e0),'packageVersion':_0x900d7f['packageVersion'],'installedPath':_0x1772f8[_0x3af81b(0x1f4)],'reason':_0x34cc5f instanceof Error?_0x34cc5f[_0x3af81b(0x1f2)]:String(_0x34cc5f),'repairCommand':REPAIR_COMMAND};}}function failure(_0xcd93be,_0x2d2ee4,_0xe93d27,_0x19afee){const _0x13e3de=a148_0x119fdc;return{'ok':![],'code':_0xcd93be,'packageVersion':_0x2d2ee4[_0x13e3de(0x20c)],'skillVersion':_0x2d2ee4[_0x13e3de(0x1fd)],'installedPath':_0x19afee,'changed':![],'repairCommand':REPAIR_COMMAND,'error':_0xe93d27 instanceof Error?_0xe93d27['message']:String(_0xe93d27)};}export function installBuiltinSkill(_0x51230a={}){const _0x278348=a148_0x119fdc,_0x45e88d=_0x51230a[_0x278348(0x1e4)]??DEFAULT_PACKAGE_ROOT,_0xad5aec=_0x51230a[_0x278348(0x1d8)]??homedir();let _0x2bbc15;try{_0x2bbc15=readSource(_0x45e88d);}catch(_0x52763d){return failure('SOURCE_INVALID',{'packageVersion':_0x278348(0x1cf),'skillVersion':_0x278348(0x1cf)},_0x52763d);}const _0x2f9ec3=inspectBuiltinSkill({'packageRoot':_0x45e88d,'home':_0xad5aec}),_0x3968f0=runNpxSkillsAddGlobal(_0x45e88d,_0x2bbc15[_0x278348(0x1fe)],{'stdio':_0x51230a['stdio']??_0x278348(0x1f0),'expectedSkillName':SKILL_NAME,'presence':{'home':_0xad5aec}});if(_0x3968f0[_0x278348(0x1c8)])return{'ok':!![],'packageVersion':_0x2bbc15['packageVersion'],'skillVersion':_0x2bbc15['skillVersion'],'installedPath':_0x2f9ec3['installedPath'],'changed':![],'repairCommand':REPAIR_COMMAND};if(!_0x3968f0['ok'])return failure(_0x278348(0x1f1),_0x2bbc15,_0x3968f0['error']??_0x278348(0x1d4)+_0x3968f0[_0x278348(0x1de)]);const _0xcd5e72=inspectBuiltinSkill({'packageRoot':_0x45e88d,'home':_0xad5aec});if(_0xcd5e72['state']!==_0x278348(0x1c5)){const _0x3b96d9=_0xcd5e72[_0x278348(0x1e1)]??_0x278348(0x1ca)+_0xcd5e72[_0x278348(0x1ff)];return failure(_0x278348(0x1fc),_0x2bbc15,_0x3968f0[_0x278348(0x1e9)]?_0x3b96d9+'\x0a'+_0x3968f0[_0x278348(0x1e9)][_0x278348(0x205)]:_0x3b96d9,_0xcd5e72[_0x278348(0x1ed)]);}return _0x3968f0['partialFailure']&&(debug(_0x278348(0x1e8),_0x3968f0[_0x278348(0x1e9)][_0x278348(0x205)]),console[_0x278348(0x206)]('CLI\x20Built-in\x20Skill\x20'+_0x2bbc15[_0x278348(0x1fd)]+_0x278348(0x1d9)+_0x3968f0[_0x278348(0x1e9)][_0x278348(0x209)]+'\x20automatically\x20selected\x20installation\x20target(s)\x20could\x20not\x20be\x20installed.')),{'ok':!![],'packageVersion':_0x2bbc15[_0x278348(0x20c)],'skillVersion':_0x2bbc15[_0x278348(0x1fd)],'installedPath':_0xcd5e72['installedPath'],'changed':_0x2f9ec3[_0x278348(0x1ff)]!==_0x278348(0x1c5),'repairCommand':REPAIR_COMMAND};}
@@ -1 +1 @@
1
- const a148_0x44f727=a148_0x3a86;function a148_0x3a86(_0x17f982,_0x4916cd){_0x17f982=_0x17f982-0x10b;const _0x3b58cc=a148_0x3b58();let _0x3a86c6=_0x3b58cc[_0x17f982];return _0x3a86c6;}(function(_0xc80974,_0x345a9a){const _0x4f3a89=a148_0x3a86,_0x1b4e9f=_0xc80974();while(!![]){try{const _0x50fb50=parseInt(_0x4f3a89(0x130))/0x1+-parseInt(_0x4f3a89(0x10e))/0x2+parseInt(_0x4f3a89(0x133))/0x3*(-parseInt(_0x4f3a89(0x119))/0x4)+parseInt(_0x4f3a89(0x10b))/0x5+parseInt(_0x4f3a89(0x12c))/0x6*(parseInt(_0x4f3a89(0x138))/0x7)+-parseInt(_0x4f3a89(0x128))/0x8*(-parseInt(_0x4f3a89(0x117))/0x9)+parseInt(_0x4f3a89(0x134))/0xa*(-parseInt(_0x4f3a89(0x111))/0xb);if(_0x50fb50===_0x345a9a)break;else _0x1b4e9f['push'](_0x1b4e9f['shift']());}catch(_0x560cde){_0x1b4e9f['push'](_0x1b4e9f['shift']());}}}(a148_0x3b58,0xd2082));import{execaSync}from'execa';import{LOVRABET_SKILL_SOURCE as a148_0x24993}from'../constant/distribution.js';import{PRODUCT_CONFIG,productEnvName}from'../constant/product.js';import{resolveInstalledSkill}from'../skills/skill-presence.js';export const LOVRABET_SKILL_SOURCE=a148_0x24993;export const LOVRABET_SKILL_GIT_SOURCE=PRODUCT_CONFIG[a148_0x44f727(0x12e)];export const LOVRABET_GLOBAL_SKILL_NAME=PRODUCT_CONFIG[a148_0x44f727(0x120)];export function resolveGlobalSkillName(_0x2344af){const _0x3f570b=a148_0x44f727;switch(_0x2344af[_0x3f570b(0x11e)]()){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[a148_0x44f727(0x10c)]);const CHILD_OUTPUT_MAX_BUFFER=0x10*0x400*0x400;function failure(_0x48970b,_0x22fd1f,_0x3d7401){return{'ok':![],'status':_0x22fd1f,'code':_0x48970b,'error':'['+_0x48970b+']\x20'+_0x3d7401};}export function shouldSkipNpxSkillsAdd(){return process.env[LOVRABET_SKIP_NPX_SKILLS_ENV]==='1';}function a148_0x3b58(){const _0x33a069=['partialFailure','stdout','present','message','pipe','112005oRPGZM','log','1355244BGghXh','absent','\x22\x20install\x20state:\x20','warn','presence','trim','exitCode','globalSkillName','NPM_CONFIG_GLOBAL','CHILD_EXIT_NONZERO','npx\x20failed\x20to\x20start','npx\x20terminated\x20by\x20signal\x20','code','unverifiable','Installer\x20reported\x20','96xOCTrc','filter','SKILL_NOT_INSTALLED','\x22\x20not\x20found\x20after\x20install\x20(checked\x20','707466buFQUg','expectedSkillName','internalSkillSource','signal','533481eSoYip','\x20failed\x20target(s)','join','3cSoHlv','810FUCVMA','shortMessage','failed','match','77DlbuYP','exit\x20','stdio','5332560gtPyBE','skipNpxSkillsEnvSuffix','stderr','1847868VHubBi','PERMISSION_DENIED','state','125389jxpSgK'];a148_0x3b58=function(){return _0x33a069;};return a148_0x3b58();}export function runNpxSkillsAddGlobal(_0x1d4848,_0x31c368=LOVRABET_SKILL_SOURCE,_0x4b31cf){const _0x11a2cd=a148_0x44f727;if(shouldSkipNpxSkillsAdd())return{'ok':!![],'status':0x0,'skipped':!![]};const _0x5082aa=['-y','skills@latest','add',_0x31c368,'-g','-y'],_0x270f83=['npx',..._0x5082aa][_0x11a2cd(0x132)]('\x20');console[_0x11a2cd(0x118)]('*\x20'+_0x270f83);const _0x193c28={...process.env};delete _0x193c28['npm_config_global'],delete _0x193c28[_0x11a2cd(0x121)];const _0x1a34bd=execaSync('npx',_0x5082aa,{'cwd':_0x1d4848,'stdio':_0x11a2cd(0x116),'env':_0x193c28,'extendEnv':![],'shell':![],'reject':![],'maxBuffer':CHILD_OUTPUT_MAX_BUFFER}),_0x458c3c=[_0x1a34bd[_0x11a2cd(0x113)]?String(_0x1a34bd['stdout']):'',_0x1a34bd[_0x11a2cd(0x10d)]?String(_0x1a34bd['stderr']):''][_0x11a2cd(0x129)](Boolean)[_0x11a2cd(0x132)]('\x0a')[_0x11a2cd(0x11e)](),_0x21bd27=_0x1a34bd[_0x11a2cd(0x11f)]??null,_0x28e134=_0x18e787=>{const _0x5c1ac7=_0x11a2cd;return _0x4b31cf?.[_0x5c1ac7(0x13a)]!==_0x5c1ac7(0x116)&&!_0x18e787[_0x5c1ac7(0x112)]&&_0x458c3c&&console['log'](_0x458c3c),_0x18e787;};if(_0x1a34bd[_0x11a2cd(0x125)]){const _0x4ceeda=_0x1a34bd[_0x11a2cd(0x125)]==='ENOENT'?'NPX_NOT_FOUND':_0x1a34bd[_0x11a2cd(0x125)]==='EPERM'||_0x1a34bd[_0x11a2cd(0x125)]==='EACCES'?_0x11a2cd(0x10f):'SPAWN_FAILED';return _0x28e134(failure(_0x4ceeda,_0x21bd27,_0x1a34bd['shortMessage']??_0x1a34bd[_0x11a2cd(0x115)]??_0x1a34bd[_0x11a2cd(0x125)]));}if(_0x1a34bd[_0x11a2cd(0x12f)])return _0x28e134(failure('CHILD_TERMINATED',_0x21bd27,_0x11a2cd(0x124)+_0x1a34bd['signal']));if(_0x1a34bd[_0x11a2cd(0x136)]&&_0x21bd27===null)return _0x28e134(failure('SPAWN_FAILED',_0x21bd27,_0x1a34bd[_0x11a2cd(0x135)]??_0x1a34bd[_0x11a2cd(0x115)]??_0x11a2cd(0x123)));if(_0x21bd27!==0x0)return _0x28e134(failure(_0x11a2cd(0x122),_0x21bd27,_0x458c3c||_0x1a34bd[_0x11a2cd(0x135)]||_0x11a2cd(0x139)+(_0x21bd27??'unknown')));const _0x2a686a=_0x4b31cf?.[_0x11a2cd(0x12d)]??resolveGlobalSkillName(_0x31c368),_0x20e442=_0x2a686a?resolveInstalledSkill(_0x2a686a,_0x4b31cf?.[_0x11a2cd(0x11d)]):undefined,_0xe9b3cc=_0x458c3c[_0x11a2cd(0x137)](/Failed to install\s+(\d+)/i);if(_0xe9b3cc&&Number(_0xe9b3cc[0x1])>0x0){const _0x29db8e=_0x11a2cd(0x127)+_0xe9b3cc[0x1]+_0x11a2cd(0x131)+(_0x458c3c?':\x0a'+_0x458c3c:'');if(_0x20e442?.[_0x11a2cd(0x110)]===_0x11a2cd(0x114))return{'ok':!![],'status':0x0,'partialFailure':{'count':Number(_0xe9b3cc[0x1]),'output':_0x458c3c}};return _0x28e134(failure('INSTALL_PARTIAL',0x0,_0x29db8e));}if(_0x2a686a&&_0x20e442){if(_0x20e442['state']===_0x11a2cd(0x11a))return _0x28e134(failure(_0x11a2cd(0x12a),0x0,'Skill\x20\x22'+_0x2a686a+_0x11a2cd(0x12b)+_0x20e442['checked'][_0x11a2cd(0x132)](',\x20')+')'));_0x20e442[_0x11a2cd(0x110)]===_0x11a2cd(0x126)&&console[_0x11a2cd(0x11c)]('!\x20Could\x20not\x20verify\x20\x22'+_0x2a686a+_0x11a2cd(0x11b)+_0x20e442['reason']);}return _0x28e134({'ok':!![],'status':0x0});}
1
+ const a149_0x3c9449=a149_0x4603;(function(_0x4029f3,_0x46dcd1){const _0x487f32=a149_0x4603,_0x3947d6=_0x4029f3();while(!![]){try{const _0x48fee9=parseInt(_0x487f32(0x10c))/0x1+-parseInt(_0x487f32(0x122))/0x2+-parseInt(_0x487f32(0x12b))/0x3*(-parseInt(_0x487f32(0x139))/0x4)+-parseInt(_0x487f32(0x132))/0x5+-parseInt(_0x487f32(0x115))/0x6+-parseInt(_0x487f32(0x137))/0x7+parseInt(_0x487f32(0x113))/0x8*(parseInt(_0x487f32(0x11f))/0x9);if(_0x48fee9===_0x46dcd1)break;else _0x3947d6['push'](_0x3947d6['shift']());}catch(_0x269808){_0x3947d6['push'](_0x3947d6['shift']());}}}(a149_0x3a60,0xb628b));import{execaSync}from'execa';import{LOVRABET_SKILL_SOURCE as a149_0x348f5f}from'../constant/distribution.js';import{PRODUCT_CONFIG,productEnvName}from'../constant/product.js';import{resolveInstalledSkill}from'../skills/skill-presence.js';function a149_0x4603(_0x2b69ea,_0x170dff){_0x2b69ea=_0x2b69ea-0x10a;const _0x3a6065=a149_0x3a60();let _0x460302=_0x3a6065[_0x2b69ea];return _0x460302;}export const LOVRABET_SKILL_SOURCE=a149_0x348f5f;export const LOVRABET_SKILL_GIT_SOURCE=PRODUCT_CONFIG[a149_0x3c9449(0x11a)];export const LOVRABET_GLOBAL_SKILL_NAME=PRODUCT_CONFIG[a149_0x3c9449(0x119)];export function resolveGlobalSkillName(_0x51398f){const _0x590e6a=a149_0x3c9449;switch(_0x51398f[_0x590e6a(0x116)]()){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[a149_0x3c9449(0x128)]);const CHILD_OUTPUT_MAX_BUFFER=0x10*0x400*0x400;function failure(_0xf41f03,_0x7bf1b2,_0x392967){return{'ok':![],'status':_0x7bf1b2,'code':_0xf41f03,'error':'['+_0xf41f03+']\x20'+_0x392967};}export function shouldSkipNpxSkillsAdd(){return process.env[LOVRABET_SKIP_NPX_SKILLS_ENV]==='1';}function a149_0x3a60(){const _0x52e15a=['globalSkillName','internalSkillSource','code','EPERM','SKILL_NOT_INSTALLED','npm_config_global','369eHeojo','exit\x20','Skill\x20\x22','495790BXeBYK','failed','Installer\x20reported\x20','stdout','shortMessage','filter','skipNpxSkillsEnvSuffix','npx\x20terminated\x20by\x20signal\x20','pipe','366AQNZjH','absent','unknown','expectedSkillName','npx','SPAWN_FAILED','log','99540urDHRR','warn','message','NPM_CONFIG_GLOBAL','PERMISSION_DENIED','6030787oRkpOe','add','9900gKGCZn','exitCode','ENOENT','stderr','EACCES','present','partialFailure','state','signal','\x22\x20not\x20found\x20after\x20install\x20(checked\x20','\x22\x20install\x20state:\x20','CHILD_EXIT_NONZERO','unverifiable','374198fAybXS','presence','join','CHILD_TERMINATED','checked','INSTALL_PARTIAL','match','257064KzHuAv','skills@latest','708804FWGRGi','trim','reason','stdio'];a149_0x3a60=function(){return _0x52e15a;};return a149_0x3a60();}export function runNpxSkillsAddGlobal(_0x354ff1,_0x45e900=LOVRABET_SKILL_SOURCE,_0x5a725c){const _0x37e2f9=a149_0x3c9449;if(shouldSkipNpxSkillsAdd())return{'ok':!![],'status':0x0,'skipped':!![]};const _0x1c044b=['-y',_0x37e2f9(0x114),_0x37e2f9(0x138),_0x45e900,'-g','-y'],_0x253fc6=[_0x37e2f9(0x12f),..._0x1c044b][_0x37e2f9(0x10e)]('\x20');console['log']('*\x20'+_0x253fc6);const _0x5b28fb={...process.env};delete _0x5b28fb[_0x37e2f9(0x11e)],delete _0x5b28fb[_0x37e2f9(0x135)];const _0x58ae91=execaSync(_0x37e2f9(0x12f),_0x1c044b,{'cwd':_0x354ff1,'stdio':_0x37e2f9(0x12a),'env':_0x5b28fb,'extendEnv':![],'shell':![],'reject':![],'maxBuffer':CHILD_OUTPUT_MAX_BUFFER}),_0x38d82c=[_0x58ae91[_0x37e2f9(0x125)]?String(_0x58ae91[_0x37e2f9(0x125)]):'',_0x58ae91[_0x37e2f9(0x13c)]?String(_0x58ae91[_0x37e2f9(0x13c)]):''][_0x37e2f9(0x127)](Boolean)[_0x37e2f9(0x10e)]('\x0a')[_0x37e2f9(0x116)](),_0x5d7b09=_0x58ae91[_0x37e2f9(0x13a)]??null,_0x2905fd=_0x1725e4=>{const _0x2e2125=_0x37e2f9;return _0x5a725c?.[_0x2e2125(0x118)]!==_0x2e2125(0x12a)&&!_0x1725e4[_0x2e2125(0x13f)]&&_0x38d82c&&console[_0x2e2125(0x131)](_0x38d82c),_0x1725e4;};if(_0x58ae91[_0x37e2f9(0x11b)]){const _0x590233=_0x58ae91['code']===_0x37e2f9(0x13b)?'NPX_NOT_FOUND':_0x58ae91[_0x37e2f9(0x11b)]===_0x37e2f9(0x11c)||_0x58ae91[_0x37e2f9(0x11b)]===_0x37e2f9(0x13d)?_0x37e2f9(0x136):_0x37e2f9(0x130);return _0x2905fd(failure(_0x590233,_0x5d7b09,_0x58ae91['shortMessage']??_0x58ae91[_0x37e2f9(0x134)]??_0x58ae91[_0x37e2f9(0x11b)]));}if(_0x58ae91[_0x37e2f9(0x141)])return _0x2905fd(failure(_0x37e2f9(0x10f),_0x5d7b09,_0x37e2f9(0x129)+_0x58ae91[_0x37e2f9(0x141)]));if(_0x58ae91[_0x37e2f9(0x123)]&&_0x5d7b09===null)return _0x2905fd(failure(_0x37e2f9(0x130),_0x5d7b09,_0x58ae91[_0x37e2f9(0x126)]??_0x58ae91[_0x37e2f9(0x134)]??'npx\x20failed\x20to\x20start'));if(_0x5d7b09!==0x0)return _0x2905fd(failure(_0x37e2f9(0x10a),_0x5d7b09,_0x38d82c||_0x58ae91[_0x37e2f9(0x126)]||_0x37e2f9(0x120)+(_0x5d7b09??_0x37e2f9(0x12d))));const _0x4843a7=_0x5a725c?.[_0x37e2f9(0x12e)]??resolveGlobalSkillName(_0x45e900),_0x36bb73=_0x4843a7?resolveInstalledSkill(_0x4843a7,_0x5a725c?.[_0x37e2f9(0x10d)]):undefined,_0x36bba2=_0x38d82c[_0x37e2f9(0x112)](/Failed to install\s+(\d+)/i);if(_0x36bba2&&Number(_0x36bba2[0x1])>0x0){const _0x289e3f=_0x37e2f9(0x124)+_0x36bba2[0x1]+'\x20failed\x20target(s)'+(_0x38d82c?':\x0a'+_0x38d82c:'');if(_0x36bb73?.[_0x37e2f9(0x140)]===_0x37e2f9(0x13e))return{'ok':!![],'status':0x0,'partialFailure':{'count':Number(_0x36bba2[0x1]),'output':_0x38d82c}};return _0x2905fd(failure(_0x37e2f9(0x111),0x0,_0x289e3f));}if(_0x4843a7&&_0x36bb73){if(_0x36bb73['state']===_0x37e2f9(0x12c))return _0x2905fd(failure(_0x37e2f9(0x11d),0x0,_0x37e2f9(0x121)+_0x4843a7+_0x37e2f9(0x142)+_0x36bb73[_0x37e2f9(0x110)][_0x37e2f9(0x10e)](',\x20')+')'));_0x36bb73['state']===_0x37e2f9(0x10b)&&console[_0x37e2f9(0x133)]('!\x20Could\x20not\x20verify\x20\x22'+_0x4843a7+_0x37e2f9(0x143)+_0x36bb73[_0x37e2f9(0x117)]);}return _0x2905fd({'ok':!![],'status':0x0});}
@@ -1 +1 @@
1
- const a149_0x5d8c65=a149_0x116a;function a149_0x116a(_0x2a8fdb,_0x34f75c){_0x2a8fdb=_0x2a8fdb-0x149;const _0x175896=a149_0x1758();let _0x116a48=_0x175896[_0x2a8fdb];return _0x116a48;}(function(_0x47705c,_0x2e678a){const _0x837297=a149_0x116a,_0x5e9c81=_0x47705c();while(!![]){try{const _0x2d009d=-parseInt(_0x837297(0x15e))/0x1+-parseInt(_0x837297(0x155))/0x2*(-parseInt(_0x837297(0x14e))/0x3)+-parseInt(_0x837297(0x15b))/0x4+-parseInt(_0x837297(0x14a))/0x5*(parseInt(_0x837297(0x15a))/0x6)+parseInt(_0x837297(0x14c))/0x7*(parseInt(_0x837297(0x150))/0x8)+-parseInt(_0x837297(0x157))/0x9+parseInt(_0x837297(0x15f))/0xa*(parseInt(_0x837297(0x14d))/0xb);if(_0x2d009d===_0x2e678a)break;else _0x5e9c81['push'](_0x5e9c81['shift']());}catch(_0x597e27){_0x5e9c81['push'](_0x5e9c81['shift']());}}}(a149_0x1758,0x99fb4));export const METADATA_FILE=a149_0x5d8c65(0x14b);export const SKILL_FILE=a149_0x5d8c65(0x153);export const IGNORED_FILE_NAMES=new Set([METADATA_FILE,'.DS_Store']);function a149_0x1758(){const _0x3a6aa7=['8KMMiiB','.turbo','.hg','SKILL.md','.next','882MwgkHL','.git','10754298OfJSze','.cache','.svn','150tUrMcE','1228992mOIofY','coverage','build','152265PbwURe','116750bnqGjN','dist','81885DsSIBC','lovrabet.skill.json','9219UPvdBq','1837qiMsTA','5058lwmJcO','node_modules'];a149_0x1758=function(){return _0x3a6aa7;};return a149_0x1758();}export const IGNORED_DIR_NAMES=new Set([a149_0x5d8c65(0x156),a149_0x5d8c65(0x152),a149_0x5d8c65(0x159),a149_0x5d8c65(0x14f),a149_0x5d8c65(0x154),a149_0x5d8c65(0x149),a149_0x5d8c65(0x15d),a149_0x5d8c65(0x15c),a149_0x5d8c65(0x151),a149_0x5d8c65(0x158)]);
1
+ const a150_0x3e948c=a150_0x2963;(function(_0x375af6,_0x2b58e0){const _0xa7302b=a150_0x2963,_0x185144=_0x375af6();while(!![]){try{const _0xfb4028=-parseInt(_0xa7302b(0xd8))/0x1+-parseInt(_0xa7302b(0xd3))/0x2*(-parseInt(_0xa7302b(0xca))/0x3)+parseInt(_0xa7302b(0xd6))/0x4+-parseInt(_0xa7302b(0xd9))/0x5*(parseInt(_0xa7302b(0xce))/0x6)+parseInt(_0xa7302b(0xda))/0x7*(-parseInt(_0xa7302b(0xc9))/0x8)+-parseInt(_0xa7302b(0xc7))/0x9+parseInt(_0xa7302b(0xd7))/0xa*(parseInt(_0xa7302b(0xd4))/0xb);if(_0xfb4028===_0x2b58e0)break;else _0x185144['push'](_0x185144['shift']());}catch(_0x4e14b3){_0x185144['push'](_0x185144['shift']());}}}(a150_0xc916,0x7d184));export const METADATA_FILE=a150_0x3e948c(0xcc);export const SKILL_FILE=a150_0x3e948c(0xd1);export const IGNORED_FILE_NAMES=new Set([METADATA_FILE,'.DS_Store']);function a150_0x2963(_0xbf50d7,_0x4215bf){_0xbf50d7=_0xbf50d7-0xc7;const _0xc916f7=a150_0xc916();let _0x296348=_0xc916f7[_0xbf50d7];return _0x296348;}function a150_0xc916(){const _0xbb0f6d=['6gcofcb','.next','.turbo','SKILL.md','node_modules','18158VuvFBp','360019FJWvLi','.cache','3934928vleVSp','230GVTpvE','463668UQwqoK','3806290JKxcmb','3325VdMJjc','200511jbFXia','.git','16584gWtOFt','333CHMQvy','.hg','lovrabet.skill.json','build'];a150_0xc916=function(){return _0xbb0f6d;};return a150_0xc916();}export const IGNORED_DIR_NAMES=new Set([a150_0x3e948c(0xc8),a150_0x3e948c(0xcb),'.svn',a150_0x3e948c(0xd2),a150_0x3e948c(0xcf),'dist',a150_0x3e948c(0xcd),'coverage',a150_0x3e948c(0xd0),a150_0x3e948c(0xd5)]);
@@ -1 +1 @@
1
- function a150_0x28da(){const _0x50407c=['Refusing\x20to\x20write\x20through\x20Skill\x20symlink\x20path:\x20','3YvSVMH','3106985QqgHvy','782772iKoWzr','27qteDHo','7430lGzOft','validation','10tLkTPR','425502nqbCzg','isSymbolicLink','from','17088bHayuS','utf8','endsWith','721384RXPeYS','402483igRCXb','startsWith','split','.tmp'];a150_0x28da=function(){return _0x50407c;};return a150_0x28da();}(function(_0xe9219,_0x1b499d){const _0x4910e2=a150_0x4a5b,_0xdae1c2=_0xe9219();while(!![]){try{const _0x41dfb9=parseInt(_0x4910e2(0x12d))/0x1+parseInt(_0x4910e2(0x126))/0x2+parseInt(_0x4910e2(0x132))/0x3*(-parseInt(_0x4910e2(0x121))/0x4)+parseInt(_0x4910e2(0x125))/0x5*(-parseInt(_0x4910e2(0x129))/0x6)+-parseInt(_0x4910e2(0x120))/0x7+parseInt(_0x4910e2(0x12c))/0x8*(parseInt(_0x4910e2(0x122))/0x9)+parseInt(_0x4910e2(0x123))/0xa;if(_0x41dfb9===_0x1b499d)break;else _0xdae1c2['push'](_0xdae1c2['shift']());}catch(_0x49f250){_0xdae1c2['push'](_0xdae1c2['shift']());}}}(a150_0x28da,0x3ae64));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(_0x19a09e,_0x8ae57){const _0x5095f0=a150_0x4a5b,_0x2dc2d6=normalizeSkillRelativePath(_0x8ae57),_0x153750=realOrResolved(_0x19a09e),_0xcbb7ce=resolve(_0x153750,..._0x2dc2d6[_0x5095f0(0x12f)]('/'));if(!isPathInside(_0xcbb7ce,_0x153750))throw CliErrors[_0x5095f0(0x124)]('Unsafe\x20Skill\x20file\x20path:\x20'+_0x8ae57);return ensureNoSymlinkInManagedPath(_0x153750,_0x2dc2d6),_0xcbb7ce;}export function ensureNoSymlinkInManagedPath(_0x42838c,_0x59df85){const _0x1317e8=a150_0x4a5b;let _0x488988=_0x42838c;for(const _0x177502 of _0x59df85['split']('/')){_0x488988=resolve(_0x488988,_0x177502);const _0x1c156d=lstatIfPresent(_0x488988);if(_0x1c156d?.[_0x1317e8(0x127)]())throw CliErrors['validation'](_0x1317e8(0x131)+_0x59df85);}}export function isDanglingSymlink(_0x27ae45){try{return lstatSync(_0x27ae45)['isSymbolicLink']();}catch{return![];}}export function resolveSymlinkTarget(_0x4f931b){const _0xbc3362=readlinkSync(_0x4f931b);return isAbsolute(_0xbc3362)?_0xbc3362:resolve(dirname(_0x4f931b),_0xbc3362);}export function isPathInside(_0x236aa9,_0x9b7648){const _0x4c115a=a150_0x4a5b,_0x335f75=_0x236aa9[_0x4c115a(0x12b)](sep)?_0x236aa9:''+_0x236aa9+sep,_0x43bd17=_0x9b7648[_0x4c115a(0x12b)](sep)?_0x9b7648:''+_0x9b7648+sep;return _0x236aa9===_0x9b7648||_0x335f75[_0x4c115a(0x12e)](_0x43bd17);}export function realOrResolved(_0x5c6bdd){try{return realpathSync(_0x5c6bdd);}catch{return resolve(_0x5c6bdd);}}export function lstatIfPresent(_0x4204d6){try{return lstatSync(_0x4204d6);}catch{return undefined;}}export function writeTextAtomic(_0x149eb5,_0x426fb9,_0x486554){const _0x28682e=a150_0x4a5b;writeBytesAtomic(_0x149eb5,Buffer[_0x28682e(0x128)](_0x426fb9,_0x28682e(0x12a)),_0x486554);}export function writeBytesAtomic(_0x5945c2,_0x4da095,_0x40f5cd){const _0x4ecb10=a150_0x4a5b,_0x5d2ff9=_0x5945c2+_0x4ecb10(0x130);try{writeFileSync(_0x5d2ff9,_0x4da095,{'mode':_0x40f5cd}),renameSync(_0x5d2ff9,_0x5945c2);}catch(_0x36b567){try{rmSync(_0x5d2ff9,{'force':!![]});}catch{}throw _0x36b567;}}function a150_0x4a5b(_0x3314f8,_0x109c87){_0x3314f8=_0x3314f8-0x120;const _0x28da51=a150_0x28da();let _0x4a5bfa=_0x28da51[_0x3314f8];return _0x4a5bfa;}export function writeJsonAtomic(_0x5d8fee,_0x3214ee){writeTextAtomic(_0x5d8fee,JSON['stringify'](_0x3214ee,null,0x2)+'\x0a',0x180);}
1
+ (function(_0x2c4c3f,_0x451a84){const _0x4bbdcd=a151_0x3aac,_0x10800c=_0x2c4c3f();while(!![]){try{const _0x100dff=parseInt(_0x4bbdcd(0x14a))/0x1+-parseInt(_0x4bbdcd(0x13d))/0x2+parseInt(_0x4bbdcd(0x14d))/0x3*(parseInt(_0x4bbdcd(0x147))/0x4)+-parseInt(_0x4bbdcd(0x140))/0x5*(-parseInt(_0x4bbdcd(0x14c))/0x6)+-parseInt(_0x4bbdcd(0x142))/0x7+parseInt(_0x4bbdcd(0x148))/0x8*(-parseInt(_0x4bbdcd(0x143))/0x9)+parseInt(_0x4bbdcd(0x14b))/0xa*(parseInt(_0x4bbdcd(0x146))/0xb);if(_0x100dff===_0x451a84)break;else _0x10800c['push'](_0x10800c['shift']());}catch(_0xe58772){_0x10800c['push'](_0x10800c['shift']());}}}(a151_0x2c8e,0xe9c02));function a151_0x3aac(_0x4e9009,_0x46992d){_0x4e9009=_0x4e9009-0x13d;const _0x2c8e82=a151_0x2c8e();let _0x3aac70=_0x2c8e82[_0x4e9009];return _0x3aac70;}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(_0x42d9f4,_0x4904bc){const _0x353e92=a151_0x3aac,_0x5694eb=normalizeSkillRelativePath(_0x4904bc),_0x3a2d8e=realOrResolved(_0x42d9f4),_0x454a99=resolve(_0x3a2d8e,..._0x5694eb['split']('/'));if(!isPathInside(_0x454a99,_0x3a2d8e))throw CliErrors[_0x353e92(0x13f)]('Unsafe\x20Skill\x20file\x20path:\x20'+_0x4904bc);return ensureNoSymlinkInManagedPath(_0x3a2d8e,_0x5694eb),_0x454a99;}function a151_0x2c8e(){const _0x5a9a1b=['isSymbolicLink','validation','5342050CUnHOl','startsWith','3486714Golvzm','207jlNRpU','.tmp','endsWith','11FkHATD','33736oyodcm','153592nntfjs','utf8','557254UcuITL','4902620DnoisN','6GFCSFe','402KMMFOB','stringify','Refusing\x20to\x20write\x20through\x20Skill\x20symlink\x20path:\x20','2697922ATDpvj'];a151_0x2c8e=function(){return _0x5a9a1b;};return a151_0x2c8e();}export function ensureNoSymlinkInManagedPath(_0x2690a3,_0x42080c){const _0xac24bb=a151_0x3aac;let _0x5686d4=_0x2690a3;for(const _0x2d0c67 of _0x42080c['split']('/')){_0x5686d4=resolve(_0x5686d4,_0x2d0c67);const _0x30d48d=lstatIfPresent(_0x5686d4);if(_0x30d48d?.[_0xac24bb(0x13e)]())throw CliErrors[_0xac24bb(0x13f)](_0xac24bb(0x14f)+_0x42080c);}}export function isDanglingSymlink(_0x23e8c5){const _0x2bac70=a151_0x3aac;try{return lstatSync(_0x23e8c5)[_0x2bac70(0x13e)]();}catch{return![];}}export function resolveSymlinkTarget(_0x384590){const _0x199086=readlinkSync(_0x384590);return isAbsolute(_0x199086)?_0x199086:resolve(dirname(_0x384590),_0x199086);}export function isPathInside(_0x8f6266,_0x4030c8){const _0x6040fc=a151_0x3aac,_0x2296e4=_0x8f6266['endsWith'](sep)?_0x8f6266:''+_0x8f6266+sep,_0x5963cd=_0x4030c8[_0x6040fc(0x145)](sep)?_0x4030c8:''+_0x4030c8+sep;return _0x8f6266===_0x4030c8||_0x2296e4[_0x6040fc(0x141)](_0x5963cd);}export function realOrResolved(_0x17cf30){try{return realpathSync(_0x17cf30);}catch{return resolve(_0x17cf30);}}export function lstatIfPresent(_0x6f1019){try{return lstatSync(_0x6f1019);}catch{return undefined;}}export function writeTextAtomic(_0x45b2ab,_0x483b85,_0x42bd46){const _0x1735a4=a151_0x3aac;writeBytesAtomic(_0x45b2ab,Buffer['from'](_0x483b85,_0x1735a4(0x149)),_0x42bd46);}export function writeBytesAtomic(_0x5b87c8,_0xacf93c,_0x7047f3){const _0x62caf4=a151_0x3aac,_0x456bc8=_0x5b87c8+_0x62caf4(0x144);try{writeFileSync(_0x456bc8,_0xacf93c,{'mode':_0x7047f3}),renameSync(_0x456bc8,_0x5b87c8);}catch(_0x2bf3e3){try{rmSync(_0x456bc8,{'force':!![]});}catch{}throw _0x2bf3e3;}}export function writeJsonAtomic(_0xb8133e,_0x3e49c4){const _0x3e8330=a151_0x3aac;writeTextAtomic(_0xb8133e,JSON[_0x3e8330(0x14e)](_0x3e49c4,null,0x2)+'\x0a',0x180);}
@@ -1 +1 @@
1
- (function(_0x3315f9,_0x3a346e){const _0x5a4523=a151_0x1091,_0x5cadeb=_0x3315f9();while(!![]){try{const _0x2d4d67=parseInt(_0x5a4523(0x17e))/0x1*(parseInt(_0x5a4523(0x17c))/0x2)+parseInt(_0x5a4523(0x17d))/0x3*(parseInt(_0x5a4523(0x17a))/0x4)+parseInt(_0x5a4523(0x180))/0x5+-parseInt(_0x5a4523(0x177))/0x6+parseInt(_0x5a4523(0x182))/0x7+parseInt(_0x5a4523(0x17f))/0x8*(parseInt(_0x5a4523(0x184))/0x9)+parseInt(_0x5a4523(0x181))/0xa*(-parseInt(_0x5a4523(0x178))/0xb);if(_0x2d4d67===_0x3a346e)break;else _0x5cadeb['push'](_0x5cadeb['shift']());}catch(_0x16f524){_0x5cadeb['push'](_0x5cadeb['shift']());}}}(a151_0x20bd,0xc558d));import{createHash}from'node:crypto';import{fileContent,normalizeManifestFiles}from'./local-files.js';export function contentHash(_0x2e7134){const _0x19b337=a151_0x1091;return createHash(_0x19b337(0x186))[_0x19b337(0x17b)](_0x2e7134)[_0x19b337(0x187)]('hex');}export function fileHash(_0x395b36){return bufferSha256(fileContent(_0x395b36));}function a151_0x20bd(){const _0x2dca1f=['update','46zwVetb','3ODBzDF','41091onHRbS','188608qSnMGS','1725505IjDZdp','10XbZekF','1707328SskOsz','size','27COFhIx','hex','sha256','digest','440886muapHq','8593145lLkqdh','path','232732hyRRWM'];a151_0x20bd=function(){return _0x2dca1f;};return a151_0x20bd();}export function bufferSha256(_0x2ff7d9){return createHash('sha256')['update'](_0x2ff7d9)['digest']('hex');}function a151_0x1091(_0x38d93f,_0x583e48){_0x38d93f=_0x38d93f-0x177;const _0x20bd5b=a151_0x20bd();let _0x109130=_0x20bd5b[_0x38d93f];return _0x109130;}export function fileTreeHash(_0x5286f4){const _0x3c954e=a151_0x1091,_0x19fe98=createHash(_0x3c954e(0x186));for(const _0x5a7dad of normalizeManifestFiles(_0x5286f4)){_0x19fe98[_0x3c954e(0x17b)](_0x5a7dad[_0x3c954e(0x179)]),_0x19fe98[_0x3c954e(0x17b)]('\x00'),_0x19fe98[_0x3c954e(0x17b)](_0x5a7dad['sha256']),_0x19fe98[_0x3c954e(0x17b)]('\x00'),_0x19fe98[_0x3c954e(0x17b)](String(_0x5a7dad[_0x3c954e(0x183)])),_0x19fe98[_0x3c954e(0x17b)]('\x00');}return _0x19fe98[_0x3c954e(0x187)](_0x3c954e(0x185));}
1
+ function a152_0x2f67(_0x4bddb,_0x2164e2){_0x4bddb=_0x4bddb-0xba;const _0x403bf2=a152_0x403b();let _0x2f6762=_0x403bf2[_0x4bddb];return _0x2f6762;}(function(_0x4d7413,_0x431d00){const _0x126102=a152_0x2f67,_0x781295=_0x4d7413();while(!![]){try{const _0x959602=parseInt(_0x126102(0xc6))/0x1*(parseInt(_0x126102(0xc9))/0x2)+parseInt(_0x126102(0xc2))/0x3*(-parseInt(_0x126102(0xc4))/0x4)+parseInt(_0x126102(0xba))/0x5+-parseInt(_0x126102(0xbd))/0x6+-parseInt(_0x126102(0xc3))/0x7*(parseInt(_0x126102(0xc8))/0x8)+-parseInt(_0x126102(0xca))/0x9*(-parseInt(_0x126102(0xbb))/0xa)+-parseInt(_0x126102(0xbc))/0xb*(-parseInt(_0x126102(0xbf))/0xc);if(_0x959602===_0x431d00)break;else _0x781295['push'](_0x781295['shift']());}catch(_0x3703e9){_0x781295['push'](_0x781295['shift']());}}}(a152_0x403b,0xcfa4c));function a152_0x403b(){const _0x46c73a=['3340WOEpcq','11Gorlbp','8652120aSrqFV','path','27775116HvQRwS','hex','digest','3ZDQXIr','4893tUknEQ','3057308ugFQeW','update','2ARWlor','sha256','18632oqCjIP','485104uskUbN','17676VZluca','6145765bMUrVU'];a152_0x403b=function(){return _0x46c73a;};return a152_0x403b();}import{createHash}from'node:crypto';import{fileContent,normalizeManifestFiles}from'./local-files.js';export function contentHash(_0x1cda67){const _0x43dfd1=a152_0x2f67;return createHash(_0x43dfd1(0xc7))[_0x43dfd1(0xc5)](_0x1cda67)[_0x43dfd1(0xc1)](_0x43dfd1(0xc0));}export function fileHash(_0x4cdda3){return bufferSha256(fileContent(_0x4cdda3));}export function bufferSha256(_0x232f5c){const _0x5d7cb5=a152_0x2f67;return createHash(_0x5d7cb5(0xc7))[_0x5d7cb5(0xc5)](_0x232f5c)['digest'](_0x5d7cb5(0xc0));}export function fileTreeHash(_0x8c6df1){const _0x4397dd=a152_0x2f67,_0x5bf957=createHash(_0x4397dd(0xc7));for(const _0x572aa5 of normalizeManifestFiles(_0x8c6df1)){_0x5bf957['update'](_0x572aa5[_0x4397dd(0xbe)]),_0x5bf957[_0x4397dd(0xc5)]('\x00'),_0x5bf957['update'](_0x572aa5[_0x4397dd(0xc7)]),_0x5bf957[_0x4397dd(0xc5)]('\x00'),_0x5bf957[_0x4397dd(0xc5)](String(_0x572aa5['size'])),_0x5bf957[_0x4397dd(0xc5)]('\x00');}return _0x5bf957[_0x4397dd(0xc1)](_0x4397dd(0xc0));}
@@ -1 +1 @@
1
- const a152_0x405c6d=a152_0x582c;function a152_0x582c(_0x1a87ec,_0x1a1534){_0x1a87ec=_0x1a87ec-0x1b7;const _0x5ebe75=a152_0x5ebe();let _0x582c4f=_0x5ebe75[_0x1a87ec];return _0x582c4f;}function a152_0x5ebe(){const _0x3f411b=['6342720KvelcC','cwd','651QiWetv','21LHxvnF','project','6262cucYSd','146008volvgQ','286uKbDvM','9459024GGVhFY','7130598imBAhp','freeze','736DOURta','appCode','skills','.agents','global','10107lzBjrB','6360ALvxTh','44yWigmI'];a152_0x5ebe=function(){return _0x3f411b;};return a152_0x5ebe();}(function(_0x128484,_0x404953){const _0x2a10e0=a152_0x582c,_0x4690cd=_0x128484();while(!![]){try{const _0x3d999b=parseInt(_0x2a10e0(0x1c4))/0x1*(parseInt(_0x2a10e0(0x1c6))/0x2)+-parseInt(_0x2a10e0(0x1c2))/0x3*(parseInt(_0x2a10e0(0x1c5))/0x4)+parseInt(_0x2a10e0(0x1bf))/0x5+parseInt(_0x2a10e0(0x1c8))/0x6+parseInt(_0x2a10e0(0x1c1))/0x7*(-parseInt(_0x2a10e0(0x1b7))/0x8)+parseInt(_0x2a10e0(0x1bc))/0x9*(parseInt(_0x2a10e0(0x1bd))/0xa)+-parseInt(_0x2a10e0(0x1be))/0xb*(parseInt(_0x2a10e0(0x1c7))/0xc);if(_0x3d999b===_0x404953)break;else _0x4690cd['push'](_0x4690cd['shift']());}catch(_0x2f2828){_0x4690cd['push'](_0x4690cd['shift']());}}}(a152_0x5ebe,0x9e979));import{resolve}from'node:path';import{resolveSkillSyncPaths,runtimeAgentSkillRoots,safePathSegment}from'./paths.js';export function resolveRuntimeSkillInstallTarget(_0x5a68d0,_0x1c587c=a152_0x405c6d(0x1bb),_0x358e97={}){const _0x17ac15=a152_0x405c6d,_0x193126=resolveSkillSyncPaths(_0x358e97),_0x28d1bd=safePathSegment(_0x5a68d0,_0x17ac15(0x1b8)),_0x91eaf1=_0x1c587c===_0x17ac15(0x1c3)?[resolve(_0x358e97[_0x17ac15(0x1c0)]??process[_0x17ac15(0x1c0)](),_0x17ac15(0x1ba),_0x17ac15(0x1b9))]:runtimeAgentSkillRoots(_0x193126);return Object[_0x17ac15(0x1c9)]({'scope':_0x1c587c,'appCode':_0x28d1bd,'skillRoots':Object['freeze'](_0x91eaf1),'managedRoot':_0x193126['managedRoot']});}
1
+ function a153_0x3b8a(){const _0x22d8fb=['159gNIjZt','3877699FGSQVA','appCode','project','1wHyMYh','5282220xayNhw','10OOWHHZ','4005036VDuALu','cwd','skills','9754407JwwoEc','.agents','5208880towHTF','freeze','24956idKknV','2275036ggyNwO'];a153_0x3b8a=function(){return _0x22d8fb;};return a153_0x3b8a();}(function(_0x40d457,_0x36cad3){const _0x1ab71b=a153_0x4a5d,_0x3c034c=_0x40d457();while(!![]){try{const _0x5dde30=-parseInt(_0x1ab71b(0x1fc))/0x1*(-parseInt(_0x1ab71b(0x1f7))/0x2)+parseInt(_0x1ab71b(0x1f8))/0x3*(parseInt(_0x1ab71b(0x1f6))/0x4)+parseInt(_0x1ab71b(0x1fd))/0x5+-parseInt(_0x1ab71b(0x1ef))/0x6+-parseInt(_0x1ab71b(0x1f9))/0x7+parseInt(_0x1ab71b(0x1f4))/0x8+parseInt(_0x1ab71b(0x1f2))/0x9*(-parseInt(_0x1ab71b(0x1ee))/0xa);if(_0x5dde30===_0x36cad3)break;else _0x3c034c['push'](_0x3c034c['shift']());}catch(_0x429944){_0x3c034c['push'](_0x3c034c['shift']());}}}(a153_0x3b8a,0xd4835));import{resolve}from'node:path';import{resolveSkillSyncPaths,runtimeAgentSkillRoots,safePathSegment}from'./paths.js';function a153_0x4a5d(_0x25f7b5,_0x524e51){_0x25f7b5=_0x25f7b5-0x1ee;const _0x3b8a5b=a153_0x3b8a();let _0x4a5d99=_0x3b8a5b[_0x25f7b5];return _0x4a5d99;}export function resolveRuntimeSkillInstallTarget(_0x1aa414,_0x12c7c6='global',_0x5e1750={}){const _0x3ab7e5=a153_0x4a5d,_0x4d9ffb=resolveSkillSyncPaths(_0x5e1750),_0x3115b9=safePathSegment(_0x1aa414,_0x3ab7e5(0x1fa)),_0x55a073=_0x12c7c6===_0x3ab7e5(0x1fb)?[resolve(_0x5e1750['cwd']??process[_0x3ab7e5(0x1f0)](),_0x3ab7e5(0x1f3),_0x3ab7e5(0x1f1))]:runtimeAgentSkillRoots(_0x4d9ffb);return Object[_0x3ab7e5(0x1f5)]({'scope':_0x12c7c6,'appCode':_0x3115b9,'skillRoots':Object[_0x3ab7e5(0x1f5)](_0x55a073),'managedRoot':_0x4d9ffb['managedRoot']});}
@@ -1 +1 @@
1
- function a153_0x51f9(_0x4752fc,_0x33dbaf){_0x4752fc=_0x4752fc-0x138;const _0x26ad3b=a153_0x26ad();let _0x51f94c=_0x26ad3b[_0x4752fc];return _0x51f94c;}(function(_0x4af788,_0x51fade){const _0x438772=a153_0x51f9,_0x3b5797=_0x4af788();while(!![]){try{const _0x5900b5=-parseInt(_0x438772(0x141))/0x1+parseInt(_0x438772(0x15c))/0x2*(parseInt(_0x438772(0x14d))/0x3)+parseInt(_0x438772(0x151))/0x4*(-parseInt(_0x438772(0x146))/0x5)+parseInt(_0x438772(0x148))/0x6*(-parseInt(_0x438772(0x16a))/0x7)+-parseInt(_0x438772(0x166))/0x8+parseInt(_0x438772(0x13f))/0x9+parseInt(_0x438772(0x14f))/0xa;if(_0x5900b5===_0x51fade)break;else _0x3b5797['push'](_0x3b5797['shift']());}catch(_0x32e5cd){_0x3b5797['push'](_0x3b5797['shift']());}}}(a153_0x26ad,0x63ff9));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';function a153_0x26ad(){const _0x224f64=['isSymbolicLink','push','validation','name','isDirectory','managedRoot','values','personal','skill','2XAouio','updated','metadata-mismatch','scope','external-symlink','Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20','dir','not-managed-symlink','metadataPath','has','3081592uqHhtN','set','project','env','7ufiTct','scopes','Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20','appCode','startsWith','skipped','Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20','accessKey','Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20','company','Refusing\x20to\x20copy\x20Skill\x20symlink:\x20','activeSkillCodes','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','map','skillRoots','2904291EjJJVr','builtin','83502ClYKuH','length','Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20','filter','unchanged','3415GTImVp','pruneSkillCodes','2268924iwqHYg','contentHash','Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20','get','trim','152157pVIcjw','created','11213970rlQJcZ','protectedLinkRoots','1396iEnTtw','skillCode'];a153_0x26ad=function(){return _0x224f64;};return a153_0x26ad();}import{basename,dirname,resolve}from'node:path';import a153_0x609949 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}=a153_0x609949,RESERVED_PROJECT_SKILL_CODES=new Set(['lovrabet','runtime-observe','secret-retriever']);export function linkEffectiveRuntimeSkills(_0x255057,_0x2370ef){const _0x3a497d=a153_0x51f9,_0x1ad881=new Map();for(const _0x438609 of _0x255057){const _0x7d0b14=_0x438609[_0x3a497d(0x15b)][_0x3a497d(0x152)];if(!_0x7d0b14)continue;const _0x4c90e3=_0x1ad881[_0x3a497d(0x14b)](_0x7d0b14);(!_0x4c90e3||_0x438609['scope']===_0x3a497d(0x15a))&&_0x1ad881[_0x3a497d(0x167)](_0x7d0b14,_0x438609);}const _0x1e471b=[];for(const _0x800dc4 of _0x1ad881[_0x3a497d(0x159)]()){const _0x529931=requireSkillCode(_0x800dc4[_0x3a497d(0x15b)]),_0x36eb07=readMetadataIfPresent(_0x800dc4['metadataPath']);if(_0x36eb07?.[_0x3a497d(0x16d)]!==_0x2370ef[_0x3a497d(0x16d)]||_0x36eb07[_0x3a497d(0x152)]!==_0x529931)throw CliErrors['validation'](_0x3a497d(0x16c)+_0x2370ef[_0x3a497d(0x16d)]+':\x20'+_0x800dc4[_0x3a497d(0x164)]);const _0x325c10=runtimeSkillLinkName(_0x2370ef,_0x529931);for(const _0x1f5ae8 of _0x2370ef[_0x3a497d(0x13e)]){_0x1e471b['push'](ensureManagedSymlink(resolve(_0x1f5ae8,_0x325c10),_0x800dc4[_0x3a497d(0x162)],_0x2370ef,_0x529931));}}return _0x1e471b;}export function pruneStaleRuntimeSkillLinks(_0x2878b1,_0x30172a,_0x51be02){const _0x2600ff=a153_0x51f9,_0x1dcacd=new Set([..._0x30172a][_0x2600ff(0x13d)](_0x241302=>_0x241302[_0x2600ff(0x14c)]())[_0x2600ff(0x144)](Boolean)),_0x194384=_0x51be02?new Set([..._0x51be02][_0x2600ff(0x13d)](_0x2197de=>_0x2197de[_0x2600ff(0x14c)]())[_0x2600ff(0x144)](Boolean)):undefined,_0x332939=[];for(const _0x413520 of _0x2878b1[_0x2600ff(0x13e)]){for(const _0x517a94 of managedTargetSkillLinkPaths(_0x413520,_0x2878b1)){const _0x1b2522=runtimeSkillCodeFromLink(_0x2878b1,_0x517a94);if(_0x194384&&!_0x194384[_0x2600ff(0x165)](_0x1b2522))continue;if(_0x1dcacd[_0x2600ff(0x165)](_0x1b2522))continue;_0x332939[_0x2600ff(0x154)](removeManagedSkillLink(_0x517a94,_0x2878b1,_0x1b2522));}}return _0x332939;}export function pruneStaleRuntimeSkillCache(_0xc235ec,_0x1afbf0={}){const _0x6047bf=a153_0x51f9,_0x3a2a44=new Set([..._0xc235ec[_0x6047bf(0x13b)]]['map'](_0x5f566c=>_0x5f566c[_0x6047bf(0x14c)]())[_0x6047bf(0x144)](Boolean)),_0x1d2375=_0xc235ec[_0x6047bf(0x147)]?new Set([..._0xc235ec[_0x6047bf(0x147)]][_0x6047bf(0x13d)](_0x3991eb=>_0x3991eb[_0x6047bf(0x14c)]())['filter'](Boolean)):undefined,_0x4ad6bd=_0xc235ec[_0x6047bf(0x16b)]??[_0x6047bf(0x15a),_0x6047bf(0x139)],_0x8870b2=resolve(getRuntimeSkillCacheRoot(_0xc235ec[_0x6047bf(0x169)],_0xc235ec[_0x6047bf(0x171)],_0x1afbf0),safePathSegment(_0xc235ec[_0x6047bf(0x16d)],_0x6047bf(0x16d))),_0x4226fe=[];for(const _0x1ea0c8 of _0x4ad6bd){const _0x328e0c=resolve(_0x8870b2,_0x1ea0c8);if(!existsSync(_0x328e0c))continue;for(const _0x2b1e8f of readdirSync(_0x328e0c,{'withFileTypes':!![]})){if(!_0x2b1e8f[_0x6047bf(0x157)]())continue;const _0x5a5e96=_0x2b1e8f[_0x6047bf(0x156)];if(_0x1d2375&&!_0x1d2375[_0x6047bf(0x165)](_0x5a5e96))continue;if(_0x3a2a44['has'](_0x5a5e96))continue;const _0x39cd4f=resolve(_0x328e0c,_0x5a5e96),_0x1daea7=readMetadataIfPresent(resolve(_0x39cd4f,METADATA_FILE));if(_0x1daea7?.['appCode']!==_0xc235ec[_0x6047bf(0x16d)]||_0x1daea7[_0x6047bf(0x15f)]!==_0x1ea0c8||_0x1daea7[_0x6047bf(0x152)]!==_0x5a5e96){_0x4226fe['push']({'path':_0x39cd4f,'action':_0x6047bf(0x16f),'reason':_0x6047bf(0x15e)});continue;}if(isLinkedFromAnyRoot(_0x39cd4f,_0xc235ec[_0x6047bf(0x150)]??[])){_0x4226fe['push']({'path':_0x39cd4f,'action':'skipped','reason':'linked-from-protected-root'});continue;}removeSync(_0x39cd4f),_0x4226fe['push']({'path':_0x39cd4f,'action':'removed'});}}return _0x4226fe;}export function linkGlobalRuntimeSkills(_0x277ce0,_0x3135d9={}){const _0x3dbef9=a153_0x51f9,_0x2c86ad=resolveSkillSyncPaths(_0x3135d9),_0xd4371b=[];for(const _0x4bed66 of _0x277ce0){if(_0x4bed66[_0x3dbef9(0x15f)]!=='builtin')throw CliErrors[_0x3dbef9(0x155)](_0x3dbef9(0x13c)+_0x4bed66[_0x3dbef9(0x15f)]);const _0x5f05ef=requireSkillCode(_0x4bed66[_0x3dbef9(0x15b)]),_0x3988c2=copyManagedSkillDirectory(_0x4bed66[_0x3dbef9(0x162)],resolve(_0x2c86ad['agentsSkillsDir'],_0x5f05ef));_0xd4371b[_0x3dbef9(0x154)]({..._0x3988c2,'contentHash':_0x4bed66[_0x3dbef9(0x149)]});}return _0xd4371b;}function ensureManagedSymlink(_0x65f586,_0x3a4d37,_0x314b21,_0xaf4571){const _0x2f9f5b=a153_0x51f9;mkdirSync(dirname(_0x65f586),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x65f586)||isDanglingSymlink(_0x65f586)){const _0x50d761=lstatSync(_0x65f586);if(!_0x50d761[_0x2f9f5b(0x153)]())throw CliErrors[_0x2f9f5b(0x155)](_0x2f9f5b(0x14a)+_0x65f586);const _0x6cd575=resolveSymlinkTarget(_0x65f586);if(!isPathInside(realOrResolved(_0x6cd575),realOrResolved(_0x314b21[_0x2f9f5b(0x158)])))throw CliErrors[_0x2f9f5b(0x155)](_0x2f9f5b(0x170)+_0x65f586);if(realOrResolved(_0x6cd575)===realOrResolved(_0x3a4d37))return{'path':_0x65f586,'target':_0x3a4d37,'action':_0x2f9f5b(0x145)};const _0x27c59c=readMetadataIfPresent(resolve(_0x6cd575,METADATA_FILE));if(_0x314b21[_0x2f9f5b(0x15f)]===_0x2f9f5b(0x168)&&(_0x27c59c?.[_0x2f9f5b(0x16d)]!==_0x314b21[_0x2f9f5b(0x16d)]||_0x27c59c[_0x2f9f5b(0x152)]!==_0xaf4571))throw CliErrors[_0x2f9f5b(0x155)]('Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20'+_0x65f586);return unlinkSync(_0x65f586),symlinkSync(_0x3a4d37,_0x65f586,_0x2f9f5b(0x162)),{'path':_0x65f586,'target':_0x3a4d37,'action':_0x2f9f5b(0x15d)};}return symlinkSync(_0x3a4d37,_0x65f586,_0x2f9f5b(0x162)),{'path':_0x65f586,'target':_0x3a4d37,'action':_0x2f9f5b(0x14e)};}function managedTargetSkillLinkPaths(_0x3b6a29,_0x4fd073){const _0x525f57=a153_0x51f9;if(!existsSync(_0x3b6a29))return[];const _0xc279dc=_0x4fd073[_0x525f57(0x16d)]+'--';return readdirSync(_0x3b6a29,{'withFileTypes':!![]})['filter'](_0x1158f2=>_0x4fd073[_0x525f57(0x15f)]===_0x525f57(0x168)||_0x1158f2[_0x525f57(0x156)][_0x525f57(0x16e)](_0xc279dc))[_0x525f57(0x13d)](_0x33f590=>resolve(_0x3b6a29,_0x33f590['name']));}function removeManagedSkillLink(_0x407149,_0x1be8f3,_0x8e2b67){const _0x15ab48=a153_0x51f9,_0x2123e1=lstatIfPresent(_0x407149);if(!_0x2123e1?.[_0x15ab48(0x153)]())return{'path':_0x407149,'action':_0x15ab48(0x16f),'reason':_0x15ab48(0x163)};const _0xa9dbd5=resolveSymlinkTarget(_0x407149);if(!isPathInside(realOrResolved(_0xa9dbd5),realOrResolved(_0x1be8f3[_0x15ab48(0x158)])))return{'path':_0x407149,'action':_0x15ab48(0x16f),'reason':_0x15ab48(0x160)};const _0x583495=readMetadataIfPresent(resolve(_0xa9dbd5,METADATA_FILE));if(_0x1be8f3[_0x15ab48(0x15f)]===_0x15ab48(0x168)&&(_0x583495?.[_0x15ab48(0x16d)]!==_0x1be8f3[_0x15ab48(0x16d)]||_0x583495[_0x15ab48(0x152)]!==_0x8e2b67))return{'path':_0x407149,'action':_0x15ab48(0x16f),'reason':_0x15ab48(0x15e)};return unlinkSync(_0x407149),{'path':_0x407149,'action':'removed'};}function isLinkedFromAnyRoot(_0x4c8d46,_0x16afe9){const _0x3b1b4c=a153_0x51f9,_0x2b941c=realOrResolved(_0x4c8d46);for(const _0x35987d of _0x16afe9){if(!existsSync(_0x35987d))continue;for(const _0xd0ab06 of readdirSync(_0x35987d,{'withFileTypes':!![]})){if(!_0xd0ab06[_0x3b1b4c(0x153)]())continue;const _0x4bc0ff=resolve(_0x35987d,_0xd0ab06[_0x3b1b4c(0x156)]);if(realOrResolved(resolveSymlinkTarget(_0x4bc0ff))===_0x2b941c)return!![];}}return![];}function runtimeSkillLinkName(_0x4961d8,_0x1d30d9){const _0x4d80fe=a153_0x51f9,_0x5c8651=safePathSegment(_0x1d30d9,_0x4d80fe(0x152));if(_0x4961d8[_0x4d80fe(0x15f)]===_0x4d80fe(0x168)&&RESERVED_PROJECT_SKILL_CODES['has'](_0x5c8651))throw CliErrors[_0x4d80fe(0x155)](_0x4d80fe(0x161)+_0x5c8651);return _0x4961d8['scope']===_0x4d80fe(0x168)?_0x5c8651:_0x4961d8[_0x4d80fe(0x16d)]+'--'+_0x5c8651;}function runtimeSkillCodeFromLink(_0x5b1450,_0x53e875){const _0x34e42d=a153_0x51f9,_0x15a2ef=basename(_0x53e875);return _0x5b1450['scope']===_0x34e42d(0x168)?_0x15a2ef:_0x15a2ef['slice']((_0x5b1450[_0x34e42d(0x16d)]+'--')[_0x34e42d(0x142)]);}export function copyManagedSkillDirectory(_0x27a8fb,_0xda3db7){const _0x189e11=a153_0x51f9,_0x3d52a0=resolve(_0xda3db7,METADATA_FILE),_0x4adb64=existsSync(_0xda3db7);if(_0x4adb64){const _0x291ac2=lstatSync(_0xda3db7);if(_0x291ac2[_0x189e11(0x153)]())throw CliErrors[_0x189e11(0x155)](_0x189e11(0x143)+_0xda3db7);if(!_0x291ac2[_0x189e11(0x157)]())throw CliErrors[_0x189e11(0x155)](_0x189e11(0x138)+_0xda3db7);const _0xaa82bf=readMetadataIfPresent(_0x3d52a0);if(_0xaa82bf?.[_0x189e11(0x15f)]!==_0x189e11(0x140))throw CliErrors[_0x189e11(0x155)]('Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20'+_0xda3db7);}ensureDirSync(dirname(_0xda3db7));const _0x174c22=_0x4adb64?readMetadataIfPresent(_0x3d52a0)?.['contentHash']:undefined,_0x4dcf85=readMetadataIfPresent(resolve(_0x27a8fb,METADATA_FILE))?.['contentHash'];return _0x4adb64&&removeSync(_0xda3db7),copySkillDirectory(_0x27a8fb,_0xda3db7),{'path':_0xda3db7,'target':_0x27a8fb,'action':!_0x4adb64?'created':_0x174c22===_0x4dcf85?_0x189e11(0x145):_0x189e11(0x15d)};}function copySkillDirectory(_0x28c7e4,_0x1d3eeb){copySync(_0x28c7e4,_0x1d3eeb,{'dereference':![],'overwrite':!![],'filter'(_0x2157bd){const _0x4f30e3=a153_0x51f9;if(lstatSync(_0x2157bd)[_0x4f30e3(0x153)]())throw CliErrors['validation'](_0x4f30e3(0x13a)+_0x2157bd);return!![];}});}
1
+ const a154_0x4f48b2=a154_0x2537;(function(_0x294322,_0x37f4b7){const _0x383e1a=a154_0x2537,_0x831736=_0x294322();while(!![]){try{const _0x5d9bb4=parseInt(_0x383e1a(0x139))/0x1+-parseInt(_0x383e1a(0x122))/0x2+-parseInt(_0x383e1a(0x141))/0x3*(-parseInt(_0x383e1a(0x129))/0x4)+-parseInt(_0x383e1a(0x137))/0x5+parseInt(_0x383e1a(0x13c))/0x6+-parseInt(_0x383e1a(0x145))/0x7+-parseInt(_0x383e1a(0x142))/0x8*(-parseInt(_0x383e1a(0x14d))/0x9);if(_0x5d9bb4===_0x37f4b7)break;else _0x831736['push'](_0x831736['shift']());}catch(_0x328d2e){_0x831736['push'](_0x831736['shift']());}}}(a154_0x1e8c,0x7ff24));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';function a154_0x1e8c(){const _0x2f2ace=['length','2169040ujymnG','isDirectory','970379ZmNtUt','validation','builtin','1537692XZDKoG','pruneSkillCodes','removed','created','personal','3OtzDDf','3694072NsUCIY','has','activeSkillCodes','1475264BNWGrv','env','filter','linked-from-protected-root','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20','metadataPath','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','managedRoot','9moUsPb','appCode','unchanged','runtime-observe','accessKey','name','updated','startsWith','skillCode','protectedLinkRoots','scope','get','metadata-mismatch','agentsSkillsDir','dir','1774738aEzPRz','trim','skipped','push','Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20','Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20','project','1470308dilFbG','Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20','set','contentHash','skill','Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20','map','skillRoots','values','not-managed-symlink','scopes','lovrabet','isSymbolicLink'];a154_0x1e8c=function(){return _0x2f2ace;};return a154_0x1e8c();}import a154_0x4074fc from'fs-extra';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';function a154_0x2537(_0x41392d,_0x138511){_0x41392d=_0x41392d-0x122;const _0x1e8c59=a154_0x1e8c();let _0x25372a=_0x1e8c59[_0x41392d];return _0x25372a;}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}=a154_0x4074fc,RESERVED_PROJECT_SKILL_CODES=new Set([a154_0x4f48b2(0x134),a154_0x4f48b2(0x150),'secret-retriever']);export function linkEffectiveRuntimeSkills(_0x3c429b,_0x1d1b0a){const _0x564e4e=a154_0x4f48b2,_0x323cd4=new Map();for(const _0x30b8a9 of _0x3c429b){const _0x580931=_0x30b8a9[_0x564e4e(0x12d)]['skillCode'];if(!_0x580931)continue;const _0x4dafb6=_0x323cd4[_0x564e4e(0x158)](_0x580931);(!_0x4dafb6||_0x30b8a9[_0x564e4e(0x157)]===_0x564e4e(0x140))&&_0x323cd4[_0x564e4e(0x12b)](_0x580931,_0x30b8a9);}const _0x1af2cf=[];for(const _0x3ad5b4 of _0x323cd4[_0x564e4e(0x131)]()){const _0x384034=requireSkillCode(_0x3ad5b4[_0x564e4e(0x12d)]),_0x42e09a=readMetadataIfPresent(_0x3ad5b4[_0x564e4e(0x14a)]);if(_0x42e09a?.[_0x564e4e(0x14e)]!==_0x1d1b0a[_0x564e4e(0x14e)]||_0x42e09a[_0x564e4e(0x155)]!==_0x384034)throw CliErrors[_0x564e4e(0x13a)](_0x564e4e(0x126)+_0x1d1b0a['appCode']+':\x20'+_0x3ad5b4[_0x564e4e(0x14a)]);const _0x2968a0=runtimeSkillLinkName(_0x1d1b0a,_0x384034);for(const _0x3f03f0 of _0x1d1b0a[_0x564e4e(0x130)]){_0x1af2cf[_0x564e4e(0x125)](ensureManagedSymlink(resolve(_0x3f03f0,_0x2968a0),_0x3ad5b4[_0x564e4e(0x15b)],_0x1d1b0a,_0x384034));}}return _0x1af2cf;}export function pruneStaleRuntimeSkillLinks(_0x3bb2bb,_0x8792ae,_0x17708b){const _0x585c18=a154_0x4f48b2,_0x44f0c2=new Set([..._0x8792ae][_0x585c18(0x12f)](_0x296b8c=>_0x296b8c[_0x585c18(0x123)]())[_0x585c18(0x147)](Boolean)),_0x38b333=_0x17708b?new Set([..._0x17708b][_0x585c18(0x12f)](_0x20d19a=>_0x20d19a[_0x585c18(0x123)]())[_0x585c18(0x147)](Boolean)):undefined,_0x5dff34=[];for(const _0x553cf6 of _0x3bb2bb['skillRoots']){for(const _0x10b27a of managedTargetSkillLinkPaths(_0x553cf6,_0x3bb2bb)){const _0x4d45a1=runtimeSkillCodeFromLink(_0x3bb2bb,_0x10b27a);if(_0x38b333&&!_0x38b333['has'](_0x4d45a1))continue;if(_0x44f0c2[_0x585c18(0x143)](_0x4d45a1))continue;_0x5dff34[_0x585c18(0x125)](removeManagedSkillLink(_0x10b27a,_0x3bb2bb,_0x4d45a1));}}return _0x5dff34;}export function pruneStaleRuntimeSkillCache(_0x54c9ef,_0x2adaac={}){const _0x462dc5=a154_0x4f48b2,_0x1a149e=new Set([..._0x54c9ef[_0x462dc5(0x144)]][_0x462dc5(0x12f)](_0x960c26=>_0x960c26[_0x462dc5(0x123)]())[_0x462dc5(0x147)](Boolean)),_0x993b78=_0x54c9ef[_0x462dc5(0x13d)]?new Set([..._0x54c9ef[_0x462dc5(0x13d)]][_0x462dc5(0x12f)](_0x23d701=>_0x23d701['trim']())[_0x462dc5(0x147)](Boolean)):undefined,_0x5c8d3e=_0x54c9ef[_0x462dc5(0x133)]??['personal','company'],_0x2642f2=resolve(getRuntimeSkillCacheRoot(_0x54c9ef[_0x462dc5(0x146)],_0x54c9ef[_0x462dc5(0x151)],_0x2adaac),safePathSegment(_0x54c9ef[_0x462dc5(0x14e)],_0x462dc5(0x14e))),_0x375534=[];for(const _0x535567 of _0x5c8d3e){const _0x3e53d5=resolve(_0x2642f2,_0x535567);if(!existsSync(_0x3e53d5))continue;for(const _0x520055 of readdirSync(_0x3e53d5,{'withFileTypes':!![]})){if(!_0x520055[_0x462dc5(0x138)]())continue;const _0x43687a=_0x520055[_0x462dc5(0x152)];if(_0x993b78&&!_0x993b78['has'](_0x43687a))continue;if(_0x1a149e[_0x462dc5(0x143)](_0x43687a))continue;const _0x56cc65=resolve(_0x3e53d5,_0x43687a),_0x5d8ca0=readMetadataIfPresent(resolve(_0x56cc65,METADATA_FILE));if(_0x5d8ca0?.[_0x462dc5(0x14e)]!==_0x54c9ef['appCode']||_0x5d8ca0[_0x462dc5(0x157)]!==_0x535567||_0x5d8ca0[_0x462dc5(0x155)]!==_0x43687a){_0x375534[_0x462dc5(0x125)]({'path':_0x56cc65,'action':_0x462dc5(0x124),'reason':_0x462dc5(0x159)});continue;}if(isLinkedFromAnyRoot(_0x56cc65,_0x54c9ef[_0x462dc5(0x156)]??[])){_0x375534[_0x462dc5(0x125)]({'path':_0x56cc65,'action':_0x462dc5(0x124),'reason':_0x462dc5(0x148)});continue;}removeSync(_0x56cc65),_0x375534['push']({'path':_0x56cc65,'action':_0x462dc5(0x13e)});}}return _0x375534;}export function linkGlobalRuntimeSkills(_0xb14023,_0x17b8f0={}){const _0x521f26=a154_0x4f48b2,_0x3c3ed5=resolveSkillSyncPaths(_0x17b8f0),_0x26b180=[];for(const _0x412460 of _0xb14023){if(_0x412460[_0x521f26(0x157)]!==_0x521f26(0x13b))throw CliErrors['validation'](_0x521f26(0x14b)+_0x412460[_0x521f26(0x157)]);const _0x3ea320=requireSkillCode(_0x412460['skill']),_0x4537d1=copyManagedSkillDirectory(_0x412460['dir'],resolve(_0x3c3ed5[_0x521f26(0x15a)],_0x3ea320));_0x26b180[_0x521f26(0x125)]({..._0x4537d1,'contentHash':_0x412460['contentHash']});}return _0x26b180;}function ensureManagedSymlink(_0x29be1a,_0x1cc73e,_0x2cf0d1,_0xbd05b7){const _0x1b6ab9=a154_0x4f48b2;mkdirSync(dirname(_0x29be1a),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x29be1a)||isDanglingSymlink(_0x29be1a)){const _0x15c654=lstatSync(_0x29be1a);if(!_0x15c654['isSymbolicLink']())throw CliErrors[_0x1b6ab9(0x13a)]('Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20'+_0x29be1a);const _0xdc1632=resolveSymlinkTarget(_0x29be1a);if(!isPathInside(realOrResolved(_0xdc1632),realOrResolved(_0x2cf0d1[_0x1b6ab9(0x14c)])))throw CliErrors[_0x1b6ab9(0x13a)](_0x1b6ab9(0x127)+_0x29be1a);if(realOrResolved(_0xdc1632)===realOrResolved(_0x1cc73e))return{'path':_0x29be1a,'target':_0x1cc73e,'action':_0x1b6ab9(0x14f)};const _0x2f9fd9=readMetadataIfPresent(resolve(_0xdc1632,METADATA_FILE));if(_0x2cf0d1[_0x1b6ab9(0x157)]===_0x1b6ab9(0x128)&&(_0x2f9fd9?.[_0x1b6ab9(0x14e)]!==_0x2cf0d1[_0x1b6ab9(0x14e)]||_0x2f9fd9[_0x1b6ab9(0x155)]!==_0xbd05b7))throw CliErrors['validation']('Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20'+_0x29be1a);return unlinkSync(_0x29be1a),symlinkSync(_0x1cc73e,_0x29be1a,_0x1b6ab9(0x15b)),{'path':_0x29be1a,'target':_0x1cc73e,'action':_0x1b6ab9(0x153)};}return symlinkSync(_0x1cc73e,_0x29be1a,_0x1b6ab9(0x15b)),{'path':_0x29be1a,'target':_0x1cc73e,'action':_0x1b6ab9(0x13f)};}function managedTargetSkillLinkPaths(_0x45e084,_0x3f4ca8){const _0xf3b102=a154_0x4f48b2;if(!existsSync(_0x45e084))return[];const _0x19abd1=_0x3f4ca8[_0xf3b102(0x14e)]+'--';return readdirSync(_0x45e084,{'withFileTypes':!![]})[_0xf3b102(0x147)](_0x40b1c8=>_0x3f4ca8['scope']==='project'||_0x40b1c8[_0xf3b102(0x152)][_0xf3b102(0x154)](_0x19abd1))[_0xf3b102(0x12f)](_0x393272=>resolve(_0x45e084,_0x393272[_0xf3b102(0x152)]));}function removeManagedSkillLink(_0x128796,_0x1ab515,_0x87549c){const _0x160981=a154_0x4f48b2,_0x14f7a8=lstatIfPresent(_0x128796);if(!_0x14f7a8?.[_0x160981(0x135)]())return{'path':_0x128796,'action':_0x160981(0x124),'reason':_0x160981(0x132)};const _0x3a651c=resolveSymlinkTarget(_0x128796);if(!isPathInside(realOrResolved(_0x3a651c),realOrResolved(_0x1ab515[_0x160981(0x14c)])))return{'path':_0x128796,'action':_0x160981(0x124),'reason':'external-symlink'};const _0x5f02fa=readMetadataIfPresent(resolve(_0x3a651c,METADATA_FILE));if(_0x1ab515[_0x160981(0x157)]===_0x160981(0x128)&&(_0x5f02fa?.['appCode']!==_0x1ab515[_0x160981(0x14e)]||_0x5f02fa[_0x160981(0x155)]!==_0x87549c))return{'path':_0x128796,'action':'skipped','reason':_0x160981(0x159)};return unlinkSync(_0x128796),{'path':_0x128796,'action':_0x160981(0x13e)};}function isLinkedFromAnyRoot(_0x560a22,_0x45b0d1){const _0xa90981=a154_0x4f48b2,_0x3203e3=realOrResolved(_0x560a22);for(const _0x2c2758 of _0x45b0d1){if(!existsSync(_0x2c2758))continue;for(const _0x41db32 of readdirSync(_0x2c2758,{'withFileTypes':!![]})){if(!_0x41db32[_0xa90981(0x135)]())continue;const _0x4e441f=resolve(_0x2c2758,_0x41db32['name']);if(realOrResolved(resolveSymlinkTarget(_0x4e441f))===_0x3203e3)return!![];}}return![];}function runtimeSkillLinkName(_0x6697ed,_0x4b4bda){const _0x2f507d=a154_0x4f48b2,_0x5f53fa=safePathSegment(_0x4b4bda,_0x2f507d(0x155));if(_0x6697ed['scope']===_0x2f507d(0x128)&&RESERVED_PROJECT_SKILL_CODES[_0x2f507d(0x143)](_0x5f53fa))throw CliErrors[_0x2f507d(0x13a)]('Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20'+_0x5f53fa);return _0x6697ed[_0x2f507d(0x157)]===_0x2f507d(0x128)?_0x5f53fa:_0x6697ed['appCode']+'--'+_0x5f53fa;}function runtimeSkillCodeFromLink(_0x4ec1a0,_0x2b8f01){const _0x5ca20c=a154_0x4f48b2,_0x174761=basename(_0x2b8f01);return _0x4ec1a0[_0x5ca20c(0x157)]===_0x5ca20c(0x128)?_0x174761:_0x174761['slice']((_0x4ec1a0['appCode']+'--')[_0x5ca20c(0x136)]);}export function copyManagedSkillDirectory(_0x27b0d,_0x218e26){const _0x44f47a=a154_0x4f48b2,_0xd7cb5c=resolve(_0x218e26,METADATA_FILE),_0x1b5618=existsSync(_0x218e26);if(_0x1b5618){const _0x4d6bcc=lstatSync(_0x218e26);if(_0x4d6bcc[_0x44f47a(0x135)]())throw CliErrors[_0x44f47a(0x13a)](_0x44f47a(0x12e)+_0x218e26);if(!_0x4d6bcc['isDirectory']())throw CliErrors[_0x44f47a(0x13a)](_0x44f47a(0x12a)+_0x218e26);const _0x5f00e1=readMetadataIfPresent(_0xd7cb5c);if(_0x5f00e1?.[_0x44f47a(0x157)]!=='builtin')throw CliErrors[_0x44f47a(0x13a)](_0x44f47a(0x149)+_0x218e26);}ensureDirSync(dirname(_0x218e26));const _0x388c9b=_0x1b5618?readMetadataIfPresent(_0xd7cb5c)?.[_0x44f47a(0x12c)]:undefined,_0x29f13d=readMetadataIfPresent(resolve(_0x27b0d,METADATA_FILE))?.['contentHash'];return _0x1b5618&&removeSync(_0x218e26),copySkillDirectory(_0x27b0d,_0x218e26),{'path':_0x218e26,'target':_0x27b0d,'action':!_0x1b5618?_0x44f47a(0x13f):_0x388c9b===_0x29f13d?'unchanged':'updated'};}function copySkillDirectory(_0x1f3774,_0x42dfb4){copySync(_0x1f3774,_0x42dfb4,{'dereference':![],'overwrite':!![],'filter'(_0xfe6ec8){const _0x145cad=a154_0x2537;if(lstatSync(_0xfe6ec8)[_0x145cad(0x135)]())throw CliErrors[_0x145cad(0x13a)]('Refusing\x20to\x20copy\x20Skill\x20symlink:\x20'+_0xfe6ec8);return!![];}});}
@@ -1 +1 @@
1
- (function(_0x2364c,_0x29819d){const _0x9b8d4d=a154_0x238d,_0x49205b=_0x2364c();while(!![]){try{const _0x3b86ed=parseInt(_0x9b8d4d(0x1cc))/0x1+-parseInt(_0x9b8d4d(0x1ce))/0x2*(-parseInt(_0x9b8d4d(0x1b3))/0x3)+parseInt(_0x9b8d4d(0x1a4))/0x4*(parseInt(_0x9b8d4d(0x1bb))/0x5)+-parseInt(_0x9b8d4d(0x1a9))/0x6*(-parseInt(_0x9b8d4d(0x1b9))/0x7)+-parseInt(_0x9b8d4d(0x1a5))/0x8+parseInt(_0x9b8d4d(0x1a1))/0x9+-parseInt(_0x9b8d4d(0x1b6))/0xa*(-parseInt(_0x9b8d4d(0x1a8))/0xb);if(_0x3b86ed===_0x29819d)break;else _0x49205b['push'](_0x49205b['shift']());}catch(_0x3deedf){_0x49205b['push'](_0x49205b['shift']());}}}(a154_0x4b32,0x8d110));import{existsSync,readdirSync}from'node:fs';function a154_0x4b32(){const _0x1dd5c6=['from','38300XUPQmU','6734624Ruhzrk','isArray','isSymbolicLink','3018169fbMOvN','1146WvTZIl','env','get','scope','builtin','scopes','link','skillRoots','dir','map','8241axhETJ','appCode','skillCode','10lnyBFL','isDirectory','set','1687jEapRl','Runtime\x20Skill\x20install\x20target\x20app\x20mismatch:\x20','235fleDqH','skillMdPath','trim','name','startsWith','code','tags','sort','source','cache','push','localeCompare','values','filter','includes','linkedPath','\x20!=\x20','17768uVxSOc','has','328wSinsa','1628325uUpEpQ','linkedPaths'];a154_0x4b32=function(){return _0x1dd5c6;};return a154_0x4b32();}import{resolve}from'node:path';function a154_0x238d(_0x297e19,_0xa86be2){_0x297e19=_0x297e19-0x1a1;const _0x4b3279=a154_0x4b32();let _0x238d71=_0x4b3279[_0x297e19];return _0x238d71;}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(_0x2bfe5c,_0x179ce7,_0x37d4c1={}){const _0x238ae0=a154_0x238d,_0x44e12f=safePathSegment(_0x2bfe5c[_0x238ae0(0x1b4)],_0x238ae0(0x1b4));if(_0x179ce7[_0x238ae0(0x1b4)]!==_0x44e12f)throw CliErrors['validation'](_0x238ae0(0x1ba)+_0x179ce7['appCode']+_0x238ae0(0x1cb)+_0x44e12f);const _0x371c46=normalizeRuntimeSkillScopes(_0x2bfe5c[_0x238ae0(0x1ae)]),_0x14c2a5=new Set(_0x371c46),_0x5ba057=_0x2bfe5c['code']?.[_0x238ae0(0x1bd)](),_0x37bbfa=new Map(),_0x528cfc=resolve(getRuntimeSkillCacheRoot(_0x2bfe5c[_0x238ae0(0x1aa)],_0x2bfe5c['accessKey'],_0x37d4c1),_0x44e12f);for(const _0x550520 of _0x371c46){for(const _0x3d865b of localSkillEntryDirs(resolve(_0x528cfc,_0x550520))){collectLocalRuntimeSkill(_0x37bbfa,_0x3d865b,{'appCode':_0x44e12f,'scopes':_0x14c2a5,'code':_0x5ba057,'source':_0x238ae0(0x1c4)});}}for(const _0x274f2f of _0x179ce7[_0x238ae0(0x1b0)]){for(const _0x4f5d7b of localSkillLinkCandidates(_0x274f2f,_0x179ce7,_0x14c2a5)){collectLocalRuntimeSkill(_0x37bbfa,_0x4f5d7b,{'appCode':_0x44e12f,'scopes':_0x14c2a5,'code':_0x5ba057,'source':_0x238ae0(0x1af),'linkedPath':_0x4f5d7b});}}return Array[_0x238ae0(0x1a3)](_0x37bbfa[_0x238ae0(0x1c7)]())[_0x238ae0(0x1c2)](compareLocalRuntimeSkills);}function localSkillEntryDirs(_0x13b92b){const _0x624e93=a154_0x238d;if(!existsSync(_0x13b92b))return[];return readdirSync(_0x13b92b,{'withFileTypes':!![]})[_0x624e93(0x1c8)](_0x3e860c=>_0x3e860c[_0x624e93(0x1b7)]()||_0x3e860c[_0x624e93(0x1a7)]())[_0x624e93(0x1b2)](_0x2a2159=>resolve(_0x13b92b,_0x2a2159[_0x624e93(0x1be)]));}function localSkillLinkCandidates(_0x364ab9,_0x53a760,_0xc16e74){const _0x5737d8=a154_0x238d;if(!existsSync(_0x364ab9))return[];const _0x2750cf=_0x53a760[_0x5737d8(0x1b4)]+'--';return readdirSync(_0x364ab9,{'withFileTypes':!![]})[_0x5737d8(0x1c8)](_0x47969b=>_0x47969b[_0x5737d8(0x1b7)]()||_0x47969b['isSymbolicLink']())[_0x5737d8(0x1c8)](_0x1a572d=>_0x53a760[_0x5737d8(0x1ac)]==='project'||_0x1a572d[_0x5737d8(0x1be)][_0x5737d8(0x1bf)](_0x2750cf)||_0xc16e74['has'](_0x5737d8(0x1ad)))[_0x5737d8(0x1b2)](_0x3341c1=>resolve(_0x364ab9,_0x3341c1[_0x5737d8(0x1be)]));}function collectLocalRuntimeSkill(_0x510fa9,_0x351ebc,_0x485fc4){const _0x5521b8=a154_0x238d,_0x518300=resolve(_0x351ebc,METADATA_FILE),_0x2a9853=readMetadataIfPresent(_0x518300);if(!_0x2a9853)return;if(_0x2a9853[_0x5521b8(0x1b4)]!==_0x485fc4[_0x5521b8(0x1b4)])return;if(!isRuntimeSkillScope(_0x2a9853['scope'])||!_0x485fc4['scopes'][_0x5521b8(0x1cd)](_0x2a9853[_0x5521b8(0x1ac)]))return;const _0x368e97=_0x2a9853[_0x5521b8(0x1b5)]?.[_0x5521b8(0x1bd)]();if(!_0x368e97)return;if(_0x485fc4[_0x5521b8(0x1c0)]&&_0x368e97!==_0x485fc4['code'])return;const _0x432e41=_0x2a9853[_0x5521b8(0x1ac)]+':'+_0x368e97,_0x391265=_0x485fc4[_0x5521b8(0x1ca)]?[_0x485fc4[_0x5521b8(0x1ca)]]:[],_0x325b06=_0x510fa9[_0x5521b8(0x1ab)](_0x432e41);if(_0x325b06){_0x485fc4['source']===_0x5521b8(0x1c4)&&(_0x325b06['dir']=_0x351ebc,_0x325b06['cacheDir']=_0x351ebc,_0x325b06[_0x5521b8(0x1bc)]=resolve(_0x351ebc,SKILL_FILE),_0x325b06['metadataPath']=_0x518300);for(const _0x23ee10 of _0x391265){!_0x325b06['linkedPaths'][_0x5521b8(0x1c9)](_0x23ee10)&&_0x325b06[_0x5521b8(0x1a2)][_0x5521b8(0x1c5)](_0x23ee10);}_0x325b06[_0x5521b8(0x1a2)]['sort']();return;}_0x510fa9[_0x5521b8(0x1b8)](_0x432e41,{..._0x2a9853,'tags':Array[_0x5521b8(0x1a6)](_0x2a9853[_0x5521b8(0x1c1)])?_0x2a9853[_0x5521b8(0x1c1)]:[],'scope':_0x2a9853['scope'],'source':'local','dir':_0x351ebc,'cacheDir':_0x485fc4[_0x5521b8(0x1c3)]===_0x5521b8(0x1c4)?_0x351ebc:undefined,'skillMdPath':resolve(_0x351ebc,SKILL_FILE),'metadataPath':_0x518300,'linkedPaths':_0x391265});}function compareLocalRuntimeSkills(_0x5d31dd,_0x510c66){const _0x29e1f8=a154_0x238d,_0xe6c169={'personal':0x0,'company':0x1,'builtin':0x2};return _0xe6c169[_0x5d31dd[_0x29e1f8(0x1ac)]]-_0xe6c169[_0x510c66[_0x29e1f8(0x1ac)]]||_0x5d31dd['skillCode'][_0x29e1f8(0x1c6)](_0x510c66[_0x29e1f8(0x1b5)])||_0x5d31dd[_0x29e1f8(0x1b1)][_0x29e1f8(0x1c6)](_0x510c66[_0x29e1f8(0x1b1)]);}
1
+ (function(_0x8f5cce,_0x39fc75){const _0x297e1b=a155_0x546d,_0x11aafe=_0x8f5cce();while(!![]){try{const _0x330618=parseInt(_0x297e1b(0x14e))/0x1+-parseInt(_0x297e1b(0x150))/0x2*(parseInt(_0x297e1b(0x165))/0x3)+-parseInt(_0x297e1b(0x160))/0x4+-parseInt(_0x297e1b(0x157))/0x5*(-parseInt(_0x297e1b(0x146))/0x6)+parseInt(_0x297e1b(0x154))/0x7*(parseInt(_0x297e1b(0x14a))/0x8)+parseInt(_0x297e1b(0x142))/0x9*(-parseInt(_0x297e1b(0x13c))/0xa)+parseInt(_0x297e1b(0x15f))/0xb*(parseInt(_0x297e1b(0x164))/0xc);if(_0x330618===_0x39fc75)break;else _0x11aafe['push'](_0x11aafe['shift']());}catch(_0x4e57a9){_0x11aafe['push'](_0x11aafe['shift']());}}}(a155_0x3921,0x5755b));import{existsSync,readdirSync}from'node:fs';import{resolve}from'node:path';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{readMetadataIfPresent}from'./metadata.js';import{getRuntimeSkillCacheRoot,safePathSegment}from'./paths.js';function a155_0x546d(_0x105289,_0x3a74e2){_0x105289=_0x105289-0x13a;const _0x392188=a155_0x3921();let _0x546dd3=_0x392188[_0x105289];return _0x546dd3;}import{isRuntimeSkillScope,normalizeRuntimeSkillScopes}from'./scopes.js';export function listLocalRuntimeSkills(_0x4f3329,_0x19eba0,_0x25ad8a={}){const _0x50bf2e=a155_0x546d,_0x432e1a=safePathSegment(_0x4f3329['appCode'],_0x50bf2e(0x153));if(_0x19eba0[_0x50bf2e(0x153)]!==_0x432e1a)throw CliErrors[_0x50bf2e(0x14c)](_0x50bf2e(0x15d)+_0x19eba0[_0x50bf2e(0x153)]+'\x20!=\x20'+_0x432e1a);const _0x1cafc3=normalizeRuntimeSkillScopes(_0x4f3329[_0x50bf2e(0x152)]),_0x34cc68=new Set(_0x1cafc3),_0xe650f9=_0x4f3329[_0x50bf2e(0x156)]?.['trim'](),_0x184787=new Map(),_0x5b83be=resolve(getRuntimeSkillCacheRoot(_0x4f3329[_0x50bf2e(0x162)],_0x4f3329[_0x50bf2e(0x13a)],_0x25ad8a),_0x432e1a);for(const _0x1dbec3 of _0x1cafc3){for(const _0x1cdbd3 of localSkillEntryDirs(resolve(_0x5b83be,_0x1dbec3))){collectLocalRuntimeSkill(_0x184787,_0x1cdbd3,{'appCode':_0x432e1a,'scopes':_0x34cc68,'code':_0xe650f9,'source':'cache'});}}for(const _0x429bfd of _0x19eba0['skillRoots']){for(const _0x4fe50c of localSkillLinkCandidates(_0x429bfd,_0x19eba0,_0x34cc68)){collectLocalRuntimeSkill(_0x184787,_0x4fe50c,{'appCode':_0x432e1a,'scopes':_0x34cc68,'code':_0xe650f9,'source':'link','linkedPath':_0x4fe50c});}}return Array[_0x50bf2e(0x148)](_0x184787['values']())[_0x50bf2e(0x15b)](compareLocalRuntimeSkills);}function localSkillEntryDirs(_0x247b24){const _0x650f30=a155_0x546d;if(!existsSync(_0x247b24))return[];return readdirSync(_0x247b24,{'withFileTypes':!![]})[_0x650f30(0x13d)](_0x439c66=>_0x439c66[_0x650f30(0x13f)]()||_0x439c66[_0x650f30(0x159)]())[_0x650f30(0x15e)](_0x54f19a=>resolve(_0x247b24,_0x54f19a[_0x650f30(0x151)]));}function localSkillLinkCandidates(_0x394913,_0x557b2b,_0x1f0c6f){const _0x3ff691=a155_0x546d;if(!existsSync(_0x394913))return[];const _0x5f1bf9=_0x557b2b[_0x3ff691(0x153)]+'--';return readdirSync(_0x394913,{'withFileTypes':!![]})['filter'](_0x258a8f=>_0x258a8f[_0x3ff691(0x13f)]()||_0x258a8f[_0x3ff691(0x159)]())[_0x3ff691(0x13d)](_0x164725=>_0x557b2b[_0x3ff691(0x149)]===_0x3ff691(0x140)||_0x164725[_0x3ff691(0x151)]['startsWith'](_0x5f1bf9)||_0x1f0c6f['has'](_0x3ff691(0x141)))[_0x3ff691(0x15e)](_0x513d7d=>resolve(_0x394913,_0x513d7d[_0x3ff691(0x151)]));}function a155_0x3921(){const _0xdb4777=['trim','2938HAihbp','name','scopes','appCode','913157xOuyBR','has','code','605gKdLgz','cache','isSymbolicLink','tags','sort','metadataPath','Runtime\x20Skill\x20install\x20target\x20app\x20mismatch:\x20','map','11SDtcMI','1556668nArLwd','skillCode','env','get','6594096EMuTUp','201DGlRxp','source','accessKey','localeCompare','60UDtMdj','filter','linkedPaths','isDirectory','project','builtin','507933HCqxYt','linkedPath','set','skillMdPath','2478CQkmEV','isArray','from','scope','8duZSnC','dir','validation','push','454003qssKMz'];a155_0x3921=function(){return _0xdb4777;};return a155_0x3921();}function collectLocalRuntimeSkill(_0x47827a,_0x10c619,_0x481075){const _0x262a6d=a155_0x546d,_0x5246b6=resolve(_0x10c619,METADATA_FILE),_0x318909=readMetadataIfPresent(_0x5246b6);if(!_0x318909)return;if(_0x318909['appCode']!==_0x481075[_0x262a6d(0x153)])return;if(!isRuntimeSkillScope(_0x318909[_0x262a6d(0x149)])||!_0x481075[_0x262a6d(0x152)][_0x262a6d(0x155)](_0x318909[_0x262a6d(0x149)]))return;const _0x1823f3=_0x318909[_0x262a6d(0x161)]?.[_0x262a6d(0x14f)]();if(!_0x1823f3)return;if(_0x481075[_0x262a6d(0x156)]&&_0x1823f3!==_0x481075[_0x262a6d(0x156)])return;const _0x200367=_0x318909[_0x262a6d(0x149)]+':'+_0x1823f3,_0xb30287=_0x481075[_0x262a6d(0x143)]?[_0x481075[_0x262a6d(0x143)]]:[],_0x1509c4=_0x47827a[_0x262a6d(0x163)](_0x200367);if(_0x1509c4){_0x481075[_0x262a6d(0x166)]===_0x262a6d(0x158)&&(_0x1509c4[_0x262a6d(0x14b)]=_0x10c619,_0x1509c4['cacheDir']=_0x10c619,_0x1509c4[_0x262a6d(0x145)]=resolve(_0x10c619,SKILL_FILE),_0x1509c4[_0x262a6d(0x15c)]=_0x5246b6);for(const _0x389481 of _0xb30287){!_0x1509c4['linkedPaths']['includes'](_0x389481)&&_0x1509c4[_0x262a6d(0x13e)][_0x262a6d(0x14d)](_0x389481);}_0x1509c4[_0x262a6d(0x13e)][_0x262a6d(0x15b)]();return;}_0x47827a[_0x262a6d(0x144)](_0x200367,{..._0x318909,'tags':Array[_0x262a6d(0x147)](_0x318909[_0x262a6d(0x15a)])?_0x318909[_0x262a6d(0x15a)]:[],'scope':_0x318909[_0x262a6d(0x149)],'source':'local','dir':_0x10c619,'cacheDir':_0x481075[_0x262a6d(0x166)]===_0x262a6d(0x158)?_0x10c619:undefined,'skillMdPath':resolve(_0x10c619,SKILL_FILE),'metadataPath':_0x5246b6,'linkedPaths':_0xb30287});}function compareLocalRuntimeSkills(_0x1ca03f,_0x3e5bcd){const _0x1a0d1b=a155_0x546d,_0x102afa={'personal':0x0,'company':0x1,'builtin':0x2};return _0x102afa[_0x1ca03f[_0x1a0d1b(0x149)]]-_0x102afa[_0x3e5bcd[_0x1a0d1b(0x149)]]||_0x1ca03f[_0x1a0d1b(0x161)][_0x1a0d1b(0x13b)](_0x3e5bcd['skillCode'])||_0x1ca03f[_0x1a0d1b(0x14b)][_0x1a0d1b(0x13b)](_0x3e5bcd['dir']);}
@@ -1 +1 @@
1
- (function(_0xf0da54,_0xb9f9c9){const _0x4e4953=a155_0x4cc9,_0xf7efb5=_0xf0da54();while(!![]){try{const _0x500338=-parseInt(_0x4e4953(0x80))/0x1*(-parseInt(_0x4e4953(0x95))/0x2)+-parseInt(_0x4e4953(0x7b))/0x3*(-parseInt(_0x4e4953(0x8b))/0x4)+-parseInt(_0x4e4953(0x7e))/0x5+parseInt(_0x4e4953(0x81))/0x6*(parseInt(_0x4e4953(0x91))/0x7)+parseInt(_0x4e4953(0x83))/0x8*(parseInt(_0x4e4953(0x98))/0x9)+parseInt(_0x4e4953(0x8a))/0xa*(-parseInt(_0x4e4953(0x74))/0xb)+parseInt(_0x4e4953(0x77))/0xc*(parseInt(_0x4e4953(0x85))/0xd);if(_0x500338===_0xb9f9c9)break;else _0xf7efb5['push'](_0xf7efb5['shift']());}catch(_0x2d8e5b){_0xf7efb5['push'](_0xf7efb5['shift']());}}}(a155_0x4fd6,0x53916));import{readFileSync,readdirSync,realpathSync}from'node:fs';import{relative,resolve}from'node:path';import{CliErrors}from'../../errors.js';import{IGNORED_DIR_NAMES,IGNORED_FILE_NAMES,SKILL_FILE}from'./constants.js';export function fileContent(_0x3bccad){const _0x2287bd=a155_0x4cc9;return _0x3bccad[_0x2287bd(0x93)]??Buffer['from'](_0x3bccad[_0x2287bd(0x87)]??'','utf8');}function a155_0x4cc9(_0x2547cd,_0x54ff84){_0x2547cd=_0x2547cd-0x74;const _0x4fd625=a155_0x4fd6();let _0x4cc905=_0x4fd625[_0x2547cd];return _0x4cc905;}export function fileText(_0x571301){const _0x10e122=a155_0x4cc9;return fileContent(_0x571301)['toString'](_0x10e122(0xa0));}export function normalizeLocalFiles(_0x5b7067){const _0x1906c0=a155_0x4cc9;if(!Array['isArray'](_0x5b7067)||_0x5b7067['length']===0x0)return[];const _0x59bd4f=new Map();for(const _0x144605 of _0x5b7067){if(!_0x144605||typeof _0x144605!==_0x1906c0(0x8e)||typeof _0x144605[_0x1906c0(0x96)]!=='string')throw CliErrors[_0x1906c0(0x97)]('Skill\x20file\x20path\x20must\x20be\x20text.');const _0x1be04a=normalizeSkillRelativePath(_0x144605[_0x1906c0(0x96)]);if(_0x59bd4f[_0x1906c0(0x7c)](_0x1be04a))throw CliErrors[_0x1906c0(0x97)](_0x1906c0(0x9c)+_0x1be04a);if(_0x144605['bytes']!==undefined&&!Buffer[_0x1906c0(0x9d)](_0x144605[_0x1906c0(0x93)]))throw CliErrors[_0x1906c0(0x97)](_0x1906c0(0x99)+_0x1be04a);if(_0x144605[_0x1906c0(0x93)]===undefined&&typeof _0x144605[_0x1906c0(0x87)]!==_0x1906c0(0x75))throw CliErrors[_0x1906c0(0x97)](_0x1906c0(0x90)+_0x1be04a);const _0x5ec9e7=fileContent(_0x144605);_0x59bd4f['set'](_0x1be04a,{'path':_0x1be04a,'bytes':_0x5ec9e7});}return Array[_0x1906c0(0x8d)](_0x59bd4f[_0x1906c0(0x7d)]())['sort'](compareSkillFiles);}export function normalizeManifestFiles(_0x5d2128){const _0x4f58a4=a155_0x4cc9;if(!Array['isArray'](_0x5d2128)||_0x5d2128[_0x4f58a4(0x8f)]===0x0)return[];const _0xec047b=new Map();for(const _0x5efbe1 of _0x5d2128){if(!_0x5efbe1||typeof _0x5efbe1!==_0x4f58a4(0x8e)||typeof _0x5efbe1[_0x4f58a4(0x96)]!==_0x4f58a4(0x75))throw CliErrors[_0x4f58a4(0x97)]('Skill\x20file\x20path\x20must\x20be\x20text.');const _0x30a363=normalizeSkillRelativePath(_0x5efbe1[_0x4f58a4(0x96)]);if(_0xec047b['has'](_0x30a363))throw CliErrors[_0x4f58a4(0x97)](_0x4f58a4(0x9c)+_0x30a363);if(!isSha256Hex(_0x5efbe1[_0x4f58a4(0xa1)]))throw CliErrors[_0x4f58a4(0x97)](_0x4f58a4(0x7f)+_0x30a363);if(!Number[_0x4f58a4(0x7a)](_0x5efbe1['size'])||_0x5efbe1['size']<0x0)throw CliErrors[_0x4f58a4(0x97)]('Skill\x20file\x20size\x20is\x20invalid:\x20'+_0x30a363);_0xec047b[_0x4f58a4(0x86)](_0x30a363,{'path':_0x30a363,'sha256':_0x5efbe1['sha256']['toLowerCase'](),'size':_0x5efbe1[_0x4f58a4(0x92)]});}return Array[_0x4f58a4(0x8d)](_0xec047b['values']())[_0x4f58a4(0x79)](compareSkillFiles);}export function scanSkillDirectory(_0xab2310,_0x5c58d7={}){const _0x5e2a37=a155_0x4cc9,_0x575601=realpathSync(_0xab2310),_0xc7eb97=canonicalExcludedFilePaths(_0x5c58d7[_0x5e2a37(0x9f)]),_0x956c82=[];function _0x4cb614(_0x2a3e37){const _0x4ed3d9=_0x5e2a37,_0x132843=readdirSync(_0x2a3e37,{'withFileTypes':!![]})['sort']((_0xd84e88,_0x15bc37)=>_0xd84e88[_0x4ed3d9(0x82)]['localeCompare'](_0x15bc37[_0x4ed3d9(0x82)]));for(const _0x1cee63 of _0x132843){if(_0x1cee63['isDirectory']()&&IGNORED_DIR_NAMES[_0x4ed3d9(0x7c)](_0x1cee63[_0x4ed3d9(0x82)]))continue;if(IGNORED_FILE_NAMES[_0x4ed3d9(0x7c)](_0x1cee63[_0x4ed3d9(0x82)]))continue;const _0x169a87=resolve(_0x2a3e37,_0x1cee63[_0x4ed3d9(0x82)]);if(isExcludedFilePath(_0x169a87,_0xc7eb97))continue;if(_0x1cee63[_0x4ed3d9(0x9e)]())throw CliErrors['validation'](_0x4ed3d9(0x94)+_0x169a87);const _0x22db87=toPosixPath(relative(_0x575601,_0x169a87));if(_0x1cee63[_0x4ed3d9(0x84)]()){_0x4cb614(_0x169a87);continue;}if(!_0x1cee63[_0x4ed3d9(0x76)]())continue;validateSkillRelativePath(_0x22db87);const _0x5b02fc=readFileSync(_0x169a87);_0x956c82[_0x4ed3d9(0x9a)]({'path':_0x22db87,'bytes':_0x5b02fc});}}return _0x4cb614(_0x575601),normalizeLocalFiles(_0x956c82);}function canonicalExcludedFilePaths(_0x15adc2){const _0x4314b6=a155_0x4cc9,_0x31ec14=new Set();for(const _0x8fc049 of _0x15adc2??[]){const _0x43fef9=resolve(_0x8fc049);_0x31ec14['add'](_0x43fef9);try{_0x31ec14[_0x4314b6(0x78)](realpathSync(_0x43fef9));}catch{}}return _0x31ec14;}function isExcludedFilePath(_0x1b35c7,_0xe68571){const _0xdf6ec9=a155_0x4cc9;if(_0xe68571[_0xdf6ec9(0x7c)](_0x1b35c7))return!![];if(_0xe68571[_0xdf6ec9(0x92)]===0x0)return![];try{return _0xe68571['has'](realpathSync(_0x1b35c7));}catch{return![];}}export function compareSkillFiles(_0x49dd4a,_0x1a5ebb){const _0x773f76=a155_0x4cc9;if(_0x49dd4a[_0x773f76(0x96)]===SKILL_FILE)return _0x1a5ebb[_0x773f76(0x96)]===SKILL_FILE?0x0:-0x1;if(_0x1a5ebb[_0x773f76(0x96)]===SKILL_FILE)return 0x1;return Buffer['compare'](Buffer[_0x773f76(0x8d)](_0x49dd4a[_0x773f76(0x96)],'utf8'),Buffer[_0x773f76(0x8d)](_0x1a5ebb[_0x773f76(0x96)],_0x773f76(0xa0)));}export function normalizeSkillRelativePath(_0x284ee8){const _0x30b8ba=toPosixPath(_0x284ee8['trim']());return validateSkillRelativePath(_0x30b8ba),_0x30b8ba;}export function validateSkillRelativePath(_0x209e48){const _0x26c40a=a155_0x4cc9;if(!_0x209e48||_0x209e48[_0x26c40a(0x9b)]('/')||_0x209e48[_0x26c40a(0x88)]('//'))throw CliErrors[_0x26c40a(0x97)](_0x26c40a(0xa2)+_0x209e48);for(const _0x46c1f3 of _0x209e48[_0x26c40a(0x8c)]('/')){if(!_0x46c1f3||_0x46c1f3==='.'||_0x46c1f3==='..')throw CliErrors['validation'](_0x26c40a(0xa2)+_0x209e48);}}function a155_0x4fd6(){const _0xa2ea3a=['isFile','298092kzSxMf','add','sort','isSafeInteger','68271xImEfQ','has','values','2055075vQFewr','Skill\x20file\x20sha256\x20is\x20invalid:\x20','682XgyQMN','30wiqVUU','name','809808mPMgQn','isDirectory','221DuVUPB','set','content','includes','replace','1040EXSBEp','4SylGxw','split','from','object','length','Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20','320341VtlBjW','size','bytes','Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20','388lURcsJ','path','validation','18gDkMEC','Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20','push','startsWith','Duplicate\x20Skill\x20file\x20path:\x20','isBuffer','isSymbolicLink','excludedFilePaths','utf8','sha256','Unsafe\x20Skill\x20file\x20path:\x20','27005LzbxpW','string'];a155_0x4fd6=function(){return _0xa2ea3a;};return a155_0x4fd6();}export function toPosixPath(_0x2f89bd){const _0x537082=a155_0x4cc9;return _0x2f89bd[_0x537082(0x89)](/\\/g,'/');}export function isSha256Hex(_0x159049){const _0x126fd8=a155_0x4cc9;return typeof _0x159049===_0x126fd8(0x75)&&/^[a-fA-F0-9]{64}$/['test'](_0x159049);}
1
+ function a156_0x5b04(){const _0x3881e1=['add','92thOjOe','Duplicate\x20Skill\x20file\x20path:\x20','44355yEEKta','values','has','Skill\x20file\x20path\x20must\x20be\x20text.','Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20','path','Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20','utf8','Skill\x20file\x20size\x20is\x20invalid:\x20','91666IvInxT','string','21790PREVUB','validation','startsWith','isDirectory','isFile','test','Unsafe\x20Skill\x20file\x20path:\x20','split','content','size','toLowerCase','22QCHNJv','4525002bxwQEW','trim','bytes','6602776vrurZe','localeCompare','4107510RhArCP','compare','isSafeInteger','replace','push','set','Skill\x20file\x20sha256\x20is\x20invalid:\x20','isSymbolicLink','sha256','length','12JMwRxG','20284kdsdaI','isArray','from','2156315klerAM','object','sort','name'];a156_0x5b04=function(){return _0x3881e1;};return a156_0x5b04();}(function(_0x15208c,_0xacaef){const _0x3b1bc6=a156_0x2e26,_0x3a84e0=_0x15208c();while(!![]){try{const _0x22ca14=parseInt(_0x3b1bc6(0x1b9))/0x1*(-parseInt(_0x3b1bc6(0x1ac))/0x2)+-parseInt(_0x3b1bc6(0x1d4))/0x3*(-parseInt(_0x3b1bc6(0x1d2))/0x4)+-parseInt(_0x3b1bc6(0x1bf))/0x5+parseInt(_0x3b1bc6(0x1c9))/0x6*(-parseInt(_0x3b1bc6(0x1cd))/0x7)+-parseInt(_0x3b1bc6(0x1bd))/0x8+-parseInt(_0x3b1bc6(0x1ba))/0x9+-parseInt(_0x3b1bc6(0x1ae))/0xa*(-parseInt(_0x3b1bc6(0x1ca))/0xb);if(_0x22ca14===_0xacaef)break;else _0x3a84e0['push'](_0x3a84e0['shift']());}catch(_0x500e3c){_0x3a84e0['push'](_0x3a84e0['shift']());}}}(a156_0x5b04,0x8e998));import{readFileSync,readdirSync,realpathSync}from'node:fs';import{relative,resolve}from'node:path';import{CliErrors}from'../../errors.js';import{IGNORED_DIR_NAMES,IGNORED_FILE_NAMES,SKILL_FILE}from'./constants.js';export function fileContent(_0x23b4d6){const _0x42de7a=a156_0x2e26;return _0x23b4d6[_0x42de7a(0x1bc)]??Buffer[_0x42de7a(0x1cc)](_0x23b4d6[_0x42de7a(0x1b6)]??'',_0x42de7a(0x1aa));}export function fileText(_0x2d9561){const _0x421549=a156_0x2e26;return fileContent(_0x2d9561)['toString'](_0x421549(0x1aa));}export function normalizeLocalFiles(_0x3f0903){const _0x465f01=a156_0x2e26;if(!Array[_0x465f01(0x1cb)](_0x3f0903)||_0x3f0903['length']===0x0)return[];const _0x5c566c=new Map();for(const _0x3072b7 of _0x3f0903){if(!_0x3072b7||typeof _0x3072b7!==_0x465f01(0x1ce)||typeof _0x3072b7[_0x465f01(0x1a8)]!==_0x465f01(0x1ad))throw CliErrors['validation']('Skill\x20file\x20path\x20must\x20be\x20text.');const _0x3600ab=normalizeSkillRelativePath(_0x3072b7[_0x465f01(0x1a8)]);if(_0x5c566c[_0x465f01(0x1a5)](_0x3600ab))throw CliErrors['validation'](_0x465f01(0x1d3)+_0x3600ab);if(_0x3072b7[_0x465f01(0x1bc)]!==undefined&&!Buffer['isBuffer'](_0x3072b7[_0x465f01(0x1bc)]))throw CliErrors[_0x465f01(0x1af)]('Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20'+_0x3600ab);if(_0x3072b7[_0x465f01(0x1bc)]===undefined&&typeof _0x3072b7[_0x465f01(0x1b6)]!==_0x465f01(0x1ad))throw CliErrors['validation'](_0x465f01(0x1a9)+_0x3600ab);const _0x31d17a=fileContent(_0x3072b7);_0x5c566c[_0x465f01(0x1c4)](_0x3600ab,{'path':_0x3600ab,'bytes':_0x31d17a});}return Array[_0x465f01(0x1cc)](_0x5c566c[_0x465f01(0x1d5)]())[_0x465f01(0x1cf)](compareSkillFiles);}export function normalizeManifestFiles(_0x11d0fa){const _0x1d4c97=a156_0x2e26;if(!Array[_0x1d4c97(0x1cb)](_0x11d0fa)||_0x11d0fa[_0x1d4c97(0x1c8)]===0x0)return[];const _0x392c13=new Map();for(const _0xec5c89 of _0x11d0fa){if(!_0xec5c89||typeof _0xec5c89!==_0x1d4c97(0x1ce)||typeof _0xec5c89['path']!==_0x1d4c97(0x1ad))throw CliErrors['validation'](_0x1d4c97(0x1a6));const _0x11eba1=normalizeSkillRelativePath(_0xec5c89[_0x1d4c97(0x1a8)]);if(_0x392c13[_0x1d4c97(0x1a5)](_0x11eba1))throw CliErrors['validation'](_0x1d4c97(0x1d3)+_0x11eba1);if(!isSha256Hex(_0xec5c89[_0x1d4c97(0x1c7)]))throw CliErrors[_0x1d4c97(0x1af)](_0x1d4c97(0x1c5)+_0x11eba1);if(!Number[_0x1d4c97(0x1c1)](_0xec5c89[_0x1d4c97(0x1b7)])||_0xec5c89[_0x1d4c97(0x1b7)]<0x0)throw CliErrors['validation'](_0x1d4c97(0x1ab)+_0x11eba1);_0x392c13[_0x1d4c97(0x1c4)](_0x11eba1,{'path':_0x11eba1,'sha256':_0xec5c89['sha256'][_0x1d4c97(0x1b8)](),'size':_0xec5c89[_0x1d4c97(0x1b7)]});}return Array[_0x1d4c97(0x1cc)](_0x392c13[_0x1d4c97(0x1d5)]())[_0x1d4c97(0x1cf)](compareSkillFiles);}export function scanSkillDirectory(_0x166bd2,_0x1b0a8b={}){const _0x5c9a09=realpathSync(_0x166bd2),_0x24ce19=canonicalExcludedFilePaths(_0x1b0a8b['excludedFilePaths']),_0x3903ca=[];function _0x47e955(_0x194967){const _0x1376e8=a156_0x2e26,_0x3bce59=readdirSync(_0x194967,{'withFileTypes':!![]})[_0x1376e8(0x1cf)]((_0x56eec6,_0x51b64b)=>_0x56eec6[_0x1376e8(0x1d0)][_0x1376e8(0x1be)](_0x51b64b[_0x1376e8(0x1d0)]));for(const _0x958a96 of _0x3bce59){if(_0x958a96[_0x1376e8(0x1b1)]()&&IGNORED_DIR_NAMES[_0x1376e8(0x1a5)](_0x958a96[_0x1376e8(0x1d0)]))continue;if(IGNORED_FILE_NAMES['has'](_0x958a96[_0x1376e8(0x1d0)]))continue;const _0x5ea343=resolve(_0x194967,_0x958a96[_0x1376e8(0x1d0)]);if(isExcludedFilePath(_0x5ea343,_0x24ce19))continue;if(_0x958a96[_0x1376e8(0x1c6)]())throw CliErrors[_0x1376e8(0x1af)](_0x1376e8(0x1a7)+_0x5ea343);const _0x562d27=toPosixPath(relative(_0x5c9a09,_0x5ea343));if(_0x958a96[_0x1376e8(0x1b1)]()){_0x47e955(_0x5ea343);continue;}if(!_0x958a96[_0x1376e8(0x1b2)]())continue;validateSkillRelativePath(_0x562d27);const _0xa4b735=readFileSync(_0x5ea343);_0x3903ca[_0x1376e8(0x1c3)]({'path':_0x562d27,'bytes':_0xa4b735});}}return _0x47e955(_0x5c9a09),normalizeLocalFiles(_0x3903ca);}function canonicalExcludedFilePaths(_0x9f7057){const _0x52b9d4=a156_0x2e26,_0x4820f5=new Set();for(const _0x4fae0c of _0x9f7057??[]){const _0x5e934b=resolve(_0x4fae0c);_0x4820f5[_0x52b9d4(0x1d1)](_0x5e934b);try{_0x4820f5['add'](realpathSync(_0x5e934b));}catch{}}return _0x4820f5;}function isExcludedFilePath(_0x187417,_0x1aedf5){const _0x567122=a156_0x2e26;if(_0x1aedf5[_0x567122(0x1a5)](_0x187417))return!![];if(_0x1aedf5[_0x567122(0x1b7)]===0x0)return![];try{return _0x1aedf5[_0x567122(0x1a5)](realpathSync(_0x187417));}catch{return![];}}function a156_0x2e26(_0x5e495d,_0x2cd941){_0x5e495d=_0x5e495d-0x1a5;const _0x5b041f=a156_0x5b04();let _0x2e2683=_0x5b041f[_0x5e495d];return _0x2e2683;}export function compareSkillFiles(_0x3eda97,_0x3d5008){const _0x48f2be=a156_0x2e26;if(_0x3eda97[_0x48f2be(0x1a8)]===SKILL_FILE)return _0x3d5008['path']===SKILL_FILE?0x0:-0x1;if(_0x3d5008[_0x48f2be(0x1a8)]===SKILL_FILE)return 0x1;return Buffer[_0x48f2be(0x1c0)](Buffer['from'](_0x3eda97[_0x48f2be(0x1a8)],_0x48f2be(0x1aa)),Buffer[_0x48f2be(0x1cc)](_0x3d5008['path'],'utf8'));}export function normalizeSkillRelativePath(_0x11af39){const _0xbd7ee4=a156_0x2e26,_0x42054b=toPosixPath(_0x11af39[_0xbd7ee4(0x1bb)]());return validateSkillRelativePath(_0x42054b),_0x42054b;}export function validateSkillRelativePath(_0x2de128){const _0x1577cc=a156_0x2e26;if(!_0x2de128||_0x2de128[_0x1577cc(0x1b0)]('/')||_0x2de128['includes']('//'))throw CliErrors[_0x1577cc(0x1af)](_0x1577cc(0x1b4)+_0x2de128);for(const _0x57edb0 of _0x2de128[_0x1577cc(0x1b5)]('/')){if(!_0x57edb0||_0x57edb0==='.'||_0x57edb0==='..')throw CliErrors['validation'](_0x1577cc(0x1b4)+_0x2de128);}}export function toPosixPath(_0x2e7966){const _0x1e55d1=a156_0x2e26;return _0x2e7966[_0x1e55d1(0x1c2)](/\\/g,'/');}export function isSha256Hex(_0x731ff3){const _0x1a9ce3=a156_0x2e26;return typeof _0x731ff3===_0x1a9ce3(0x1ad)&&/^[a-fA-F0-9]{64}$/[_0x1a9ce3(0x1b3)](_0x731ff3);}