@lovrabet/lovrabet-cli 2.3.12-beta.1 → 2.3.12

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 (185) hide show
  1. package/lib/cli.js +1 -1
  2. package/lib/commands/api-doc/index.js +1 -1
  3. package/lib/commands/app/cache.js +1 -1
  4. package/lib/commands/app/definitions.js +1 -1
  5. package/lib/commands/app/eligibility.js +1 -1
  6. package/lib/commands/app/mock-loader.js +1 -1
  7. package/lib/commands/app/remote-source.js +1 -1
  8. package/lib/commands/app/shared.js +1 -1
  9. package/lib/commands/app-config/get.js +1 -1
  10. package/lib/commands/app-config/index.js +1 -1
  11. package/lib/commands/approval/index.js +1 -1
  12. package/lib/commands/artifact/index.js +1 -1
  13. package/lib/commands/auth/device.js +1 -1
  14. package/lib/commands/auth/index.js +1 -1
  15. package/lib/commands/auth/prompt.js +1 -1
  16. package/lib/commands/bff/detail.js +1 -1
  17. package/lib/commands/bff/exec.js +1 -1
  18. package/lib/commands/bff/index.js +1 -1
  19. package/lib/commands/cli-skill/index.js +1 -1
  20. package/lib/commands/common/config-policy.js +1 -1
  21. package/lib/commands/common/constraints.js +1 -1
  22. package/lib/commands/common/flags.js +1 -1
  23. package/lib/commands/common/local-file.js +1 -1
  24. package/lib/commands/config/definitions.js +1 -1
  25. package/lib/commands/config/init.js +1 -1
  26. package/lib/commands/config/shared.js +1 -1
  27. package/lib/commands/data/import-excel.js +1 -1
  28. package/lib/commands/data/index.js +1 -1
  29. package/lib/commands/dataset/detail.js +1 -1
  30. package/lib/commands/dataset/index.js +1 -1
  31. package/lib/commands/dataset/list.js +1 -1
  32. package/lib/commands/dataset/sdk-doc.js +1 -1
  33. package/lib/commands/doctor.js +1 -1
  34. package/lib/commands/file/index.js +1 -1
  35. package/lib/commands/init.js +1 -1
  36. package/lib/commands/issue/context.js +1 -1
  37. package/lib/commands/issue/index.js +1 -1
  38. package/lib/commands/issue/report.js +1 -1
  39. package/lib/commands/kb/index.js +1 -1
  40. package/lib/commands/logs/index.js +1 -1
  41. package/lib/commands/notification/config-list.js +1 -1
  42. package/lib/commands/notification/index.js +1 -1
  43. package/lib/commands/notification/shared.js +1 -1
  44. package/lib/commands/ocr/index.js +1 -1
  45. package/lib/commands/permit/dataset-get.js +1 -1
  46. package/lib/commands/permit/dataset-set.js +1 -1
  47. package/lib/commands/permit/index.js +1 -1
  48. package/lib/commands/permit/page-get.js +1 -1
  49. package/lib/commands/permit/page-set.js +1 -1
  50. package/lib/commands/permit/role-menus-set.js +1 -1
  51. package/lib/commands/permit/role-menus.js +1 -1
  52. package/lib/commands/permit/shared.js +1 -1
  53. package/lib/commands/personal-bff/index.js +1 -1
  54. package/lib/commands/registry.js +1 -1
  55. package/lib/commands/role/create.js +1 -1
  56. package/lib/commands/role/delete.js +1 -1
  57. package/lib/commands/role/detail.js +1 -1
  58. package/lib/commands/role/index.js +1 -1
  59. package/lib/commands/role/list.js +1 -1
  60. package/lib/commands/role/shared.js +1 -1
  61. package/lib/commands/role/update.js +1 -1
  62. package/lib/commands/role/user-add.js +1 -1
  63. package/lib/commands/role/user-remove.js +1 -1
  64. package/lib/commands/schedule/index.js +1 -1
  65. package/lib/commands/schema.js +1 -1
  66. package/lib/commands/service/dynamic.js +1 -1
  67. package/lib/commands/service/function-name-adapter.js +1 -1
  68. package/lib/commands/service/index.js +1 -1
  69. package/lib/commands/service/registry.js +1 -1
  70. package/lib/commands/skill/commands/create.js +1 -1
  71. package/lib/commands/skill/commands/diagram.js +1 -1
  72. package/lib/commands/skill/commands/install.js +1 -1
  73. package/lib/commands/skill/commands/list.js +1 -1
  74. package/lib/commands/skill/commands/push.js +1 -1
  75. package/lib/commands/skill/commands/validate.js +1 -1
  76. package/lib/commands/skill/diagram.js +1 -1
  77. package/lib/commands/skill/flags.js +1 -1
  78. package/lib/commands/skill/index.js +1 -1
  79. package/lib/commands/skill/manifest-helpers.js +1 -1
  80. package/lib/commands/skill/push-execute.js +1 -1
  81. package/lib/commands/skill/push-flow-helpers.js +1 -1
  82. package/lib/commands/skill/push-retarget.js +1 -1
  83. package/lib/commands/skill/scopes.js +1 -1
  84. package/lib/commands/skill/summary.js +1 -1
  85. package/lib/commands/skill/templates.js +1 -1
  86. package/lib/commands/skill/validate.js +1 -1
  87. package/lib/commands/sql/detail.js +1 -1
  88. package/lib/commands/sql/exec.js +1 -1
  89. package/lib/commands/sql/index.js +1 -1
  90. package/lib/commands/update.js +1 -1
  91. package/lib/commands/user-account/bind.js +1 -1
  92. package/lib/commands/user-account/index.js +1 -1
  93. package/lib/commands/workspace/index.js +1 -1
  94. package/lib/config/domain-config.js +1 -1
  95. package/lib/config/schema.js +1 -1
  96. package/lib/constant/app.js +1 -1
  97. package/lib/constant/auth-mode.js +1 -1
  98. package/lib/constant/cli.js +1 -1
  99. package/lib/constant/defaults.js +1 -1
  100. package/lib/constant/distribution.js +1 -1
  101. package/lib/constant/domain.js +1 -1
  102. package/lib/constant/env.js +1 -1
  103. package/lib/constant/output.js +1 -1
  104. package/lib/constant/product.js +1 -1
  105. package/lib/constant/region.js +1 -1
  106. package/lib/constant/risk.js +1 -1
  107. package/lib/constant/url.js +1 -1
  108. package/lib/context.js +1 -1
  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.js +1 -1
  112. package/lib/core/kb-sdk-errors.js +1 -1
  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/runtime-user-id.js +1 -1
  180. package/lib/utils/update-notice.js +1 -1
  181. package/lib/utils/version.js +1 -1
  182. package/lib/utils/write-cli-side-channel.js +1 -1
  183. package/package.json +1 -1
  184. package/skills/lovrabet/SKILL.md +1 -1
  185. package/skills/lovrabet.manifest.json +3 -3
@@ -1 +1 @@
1
- const a150_0x35049a=a150_0x6764;(function(_0x374a0d,_0x3aa12d){const _0x1be77a=a150_0x6764,_0x514f1a=_0x374a0d();while(!![]){try{const _0x9d1763=parseInt(_0x1be77a(0x1b1))/0x1*(parseInt(_0x1be77a(0x196))/0x2)+parseInt(_0x1be77a(0x1a0))/0x3*(-parseInt(_0x1be77a(0x1cf))/0x4)+-parseInt(_0x1be77a(0x1b8))/0x5*(parseInt(_0x1be77a(0x1c0))/0x6)+parseInt(_0x1be77a(0x173))/0x7*(-parseInt(_0x1be77a(0x158))/0x8)+parseInt(_0x1be77a(0x19e))/0x9+-parseInt(_0x1be77a(0x151))/0xa+parseInt(_0x1be77a(0x1db))/0xb;if(_0x9d1763===_0x3aa12d)break;else _0x514f1a['push'](_0x514f1a['shift']());}catch(_0x48fd1c){_0x514f1a['push'](_0x514f1a['shift']());}}}(a150_0x5e23,0x6cb6a));import{randomBytes,randomUUID}from'node:crypto';import{lstat,open,readFile,realpath,rename,unlink}from'node:fs/promises';function a150_0x6764(_0x5ee8e5,_0x29c672){_0x5ee8e5=_0x5ee8e5-0x151;const _0x5e233f=a150_0x5e23();let _0x676431=_0x5e233f[_0x5ee8e5];return _0x676431;}import{resolve,dirname,basename}from'node:path';export function canonical(_0x44787a){const _0xfa4dff=a150_0x6764;if(Array['isArray'](_0x44787a))return'['+_0x44787a[_0xfa4dff(0x159)](canonical)[_0xfa4dff(0x17a)](',')+']';if(_0x44787a&&typeof _0x44787a===_0xfa4dff(0x1d9))return'{'+Object['keys'](_0x44787a)[_0xfa4dff(0x1b4)]()[_0xfa4dff(0x159)](_0x7c67de=>JSON[_0xfa4dff(0x157)](_0x7c67de)+':'+canonical(_0x44787a[_0x7c67de]))[_0xfa4dff(0x17a)](',')+'}';return JSON['stringify'](_0x44787a)??'undefined';}const EMPTY_IMAGE_LOCATION_FIELDS=new Set([a150_0x35049a(0x1c6),a150_0x35049a(0x1b6),a150_0x35049a(0x1ca),'district',a150_0x35049a(0x1a2),'road',a150_0x35049a(0x16d),a150_0x35049a(0x1a6),a150_0x35049a(0x1a4),a150_0x35049a(0x183),a150_0x35049a(0x171),a150_0x35049a(0x1b5),a150_0x35049a(0x1b0),a150_0x35049a(0x155),a150_0x35049a(0x199),a150_0x35049a(0x1a8),a150_0x35049a(0x15e),a150_0x35049a(0x156),a150_0x35049a(0x1ab),a150_0x35049a(0x1a3)]);export function sameImportValue(_0x13cccc,_0x293e79,_0x4ba870=![]){const _0x3f008b=a150_0x35049a;if(_0x4ba870){const _0x120cf5=_0x127e52=>Array[_0x3f008b(0x15d)](_0x127e52)?_0x127e52[_0x3f008b(0x159)](_0x201d8f=>{const _0x2fc544=_0x3f008b;if(!_0x201d8f||typeof _0x201d8f!=='object'||Array[_0x2fc544(0x15d)](_0x201d8f))return _0x201d8f;const _0x1c500e={..._0x201d8f};delete _0x1c500e[_0x2fc544(0x1cc)],delete _0x1c500e['previewUrl'];if(_0x1c500e[_0x2fc544(0x194)]==='')delete _0x1c500e[_0x2fc544(0x194)];if(_0x1c500e['createUserId']==null)delete _0x1c500e[_0x2fc544(0x1d7)];if(_0x1c500e[_0x2fc544(0x193)]==null)delete _0x1c500e[_0x2fc544(0x193)];if(_0x1c500e[_0x2fc544(0x195)]==null||typeof _0x1c500e[_0x2fc544(0x195)]===_0x2fc544(0x1d9)&&!Array[_0x2fc544(0x15d)](_0x1c500e['geolocation'])&&Object[_0x2fc544(0x180)](_0x1c500e[_0x2fc544(0x195)])['every'](([_0x19e7f8,_0x1cea91])=>EMPTY_IMAGE_LOCATION_FIELDS[_0x2fc544(0x164)](_0x19e7f8)&&_0x1cea91===null))delete _0x1c500e[_0x2fc544(0x195)];for(const _0x141f1c of[_0x2fc544(0x190),_0x2fc544(0x15c),'key'])if(!(_0x141f1c in _0x1c500e))_0x1c500e[_0x141f1c]='';if(_0x1c500e[_0x2fc544(0x1d2)]==null)_0x1c500e[_0x2fc544(0x1d2)]=0x0;return _0x1c500e;}):_0x127e52;return canonical(_0x120cf5(_0x13cccc))===canonical(_0x120cf5(_0x293e79));}return _0x13cccc===null?_0x293e79===null||_0x293e79===undefined:canonical(_0x293e79)===canonical(_0x13cccc);}async function rejectSymlink(_0x3e84fa){const _0x403e6e=a150_0x35049a;try{if((await lstat(_0x3e84fa))[_0x403e6e(0x198)]())throw Error(_0x403e6e(0x1ae));}catch(_0x359ffb){if(_0x359ffb[_0x403e6e(0x187)]!==_0x403e6e(0x1d5))throw _0x359ffb;}}export async function resolveImportOutputPath(_0x14ff05){return await rejectSymlink(_0x14ff05),resolve(await realpath(dirname(resolve(_0x14ff05))),basename(_0x14ff05));}export function assertImportPaths(_0x2d3a2c,_0xa5fd3f,_0x475e83=[]){const _0x17b95a=a150_0x35049a,_0x30bb72=[..._0x475e83,_0x2d3a2c,_0xa5fd3f,_0x2d3a2c+'.lock',_0x2d3a2c+'.lock.recovery'][_0x17b95a(0x159)](_0x1d3bf8=>resolve(_0x1d3bf8));if(new Set(_0x30bb72)[_0x17b95a(0x1d2)]!==_0x30bb72[_0x17b95a(0x1d3)])throw Error('Import\x20input,\x20output\x20and\x20lock\x20paths\x20must\x20be\x20different\x20files.');}export async function saveImportJson(_0xdc9c33,_0x402918){const _0x145605=a150_0x35049a;await rejectSymlink(_0xdc9c33);const _0x35e3a9=_0xdc9c33+_0x145605(0x17e)+randomUUID(),_0x44a06f=await open(_0x35e3a9,'wx',0x180);try{await _0x44a06f[_0x145605(0x1d0)](JSON[_0x145605(0x157)](_0x402918,null,0x2)),await _0x44a06f[_0x145605(0x188)]();}finally{await _0x44a06f[_0x145605(0x1d1)]();}try{await rename(_0x35e3a9,_0xdc9c33);}catch(_0x3bccab){await unlink(_0x35e3a9)[_0x145605(0x1aa)](()=>{});throw _0x3bccab;}}export async function acquireLock(_0x114b41){const _0xb6f21b=a150_0x35049a,_0x291b2a=_0x114b41+_0xb6f21b(0x1ba),_0x556dd8=randomUUID();await rejectSymlink(_0x291b2a);const _0x1ed538=_0x291b2a+_0xb6f21b(0x18e);let _0x159c13,_0x1c62a6;try{try{_0x159c13=await open(_0x291b2a,'wx',0x180);}catch(_0xa65266){if(_0xa65266['code']!==_0xb6f21b(0x1dd))throw _0xa65266;try{_0x1c62a6=await open(_0x1ed538,'wx',0x180);}catch(_0xc85e06){if(_0xc85e06['code']===_0xb6f21b(0x1dd))throw Error(_0xb6f21b(0x19c));throw _0xc85e06;}await _0x1c62a6[_0xb6f21b(0x1d0)](JSON['stringify']({'pid':process[_0xb6f21b(0x160)],'token':_0x556dd8})),await _0x1c62a6['sync'](),await rejectSymlink(_0x291b2a);let _0x7b8d8c;try{_0x7b8d8c=await readFile(_0x291b2a,_0xb6f21b(0x177));}catch(_0x40a9a9){if(_0x40a9a9[_0xb6f21b(0x187)]!==_0xb6f21b(0x1d5))throw _0x40a9a9;}if(_0x7b8d8c!==undefined){let _0x5724bf;try{_0x5724bf=JSON[_0xb6f21b(0x170)](_0x7b8d8c);}catch{throw Error(_0xb6f21b(0x1c8));}if(!_0x5724bf||!Number[_0xb6f21b(0x1dc)](_0x5724bf['pid'])||_0x5724bf[_0xb6f21b(0x160)]<=0x0)throw Error(_0xb6f21b(0x1ce));try{process[_0xb6f21b(0x169)](_0x5724bf[_0xb6f21b(0x160)],0x0);throw Error(_0xb6f21b(0x1c2));}catch(_0x5ec6c5){if(_0x5ec6c5[_0xb6f21b(0x187)]!==_0xb6f21b(0x174))throw _0x5ec6c5;}if(await readFile(_0x291b2a,'utf8')!==_0x7b8d8c)throw Error('Import\x20lock\x20changed;\x20retry\x20recovery.');await unlink(_0x291b2a);}_0x159c13=await open(_0x291b2a,'wx',0x180);}await _0x159c13[_0xb6f21b(0x1d0)](JSON['stringify']({'pid':process[_0xb6f21b(0x160)],'token':_0x556dd8})),await _0x159c13[_0xb6f21b(0x188)]();}finally{try{await _0x159c13?.[_0xb6f21b(0x1d1)]();}finally{if(_0x1c62a6)try{await _0x1c62a6[_0xb6f21b(0x1d1)]();}finally{await unlink(_0x1ed538);}}}return async()=>{const _0x183f9e=_0xb6f21b;if(JSON[_0x183f9e(0x170)](await readFile(_0x291b2a,'utf8'))[_0x183f9e(0x1bc)]===_0x556dd8)await unlink(_0x291b2a);};}function a150_0x5e23(){const _0x1edbe1=['sheet','The\x20import\x20write\x20outcome\x20is\x20unknown.\x20Resume\x20to\x20reconcile\x20the\x20fixed\x20IDs\x20before\x20continuing.','kill','Import\x20content\x20conflict\x20at\x20Excel\x20row\x20','batchSize','forEach','country','METADATA','appCode','parse','city','auto-id-task-marker','26404uMhaKb','ESRCH','Incomplete\x20readback.','version','utf8','Invalid\x20or\x20duplicate\x20import\x20readback\x20ID.','ids','join','completed','Invalid\x20import\x20readback\x20response.','Invalid\x20write\x20result.','.tmp-','Excel\x20row\x20','entries','values','onCheckpointReady','latitude','unsent','report','push','code','sync','warnings','\x20exceeds\x20the\x20import\x20request\x20size\x20limit.','importId','unknown','string','.recovery','Cannot\x20read\x20the\x20import\x20checkpoint.','name','The\x20server\x20import\x20contract\x20is\x20unsupported\x20or\x20incomplete.','mappingHash','createUserName','dingTalkUrl','geolocation','2thJEyj','filter','isSymbolicLink','accuracy','status','byteLength','Import\x20lock\x20recovery\x20is\x20active\x20or\x20interrupted;\x20inspect\x20the\x20recovery\x20guard\x20before\x20retrying.','readback','4637133psycZs','resume','2662629IKNaaC','checkpoint','pois','lbswuaCacheId','province','slice','countryCode','get','longitude','pending','catch','address','elapsedMs','toString','Import\x20output\x20must\x20not\x20be\x20a\x20symbolic\x20link.','now','resultCode','611142GsBepg','write','Excel\x20contains\x20invalid\x20rows;\x20no\x20data\x20was\x20written.','sort','netType','operatorType','uploadFields','49465YnnJgC','Import\x20primary\x20key\x20collision;\x20stop\x20without\x20replacing\x20the\x20fixed\x20IDs.','.lock','Import\x20checkpoint\x20already\x20exists;\x20use\x20--resume.','token','The\x20fixed-ID\x20runner\x20requires\x20the\x20v1\x20import\x20contract.','Import\x20checkpoint\x20contains\x20a\x20content\x20conflict.','maxBatchSize','12PGFQFY','Excel\x20contains\x20no\x20valid\x20data\x20rows.','The\x20import\x20checkpoint\x20is\x20locked\x20by\x20a\x20running\x20process.','imageFields','isInteger','strategy','time','actorId','Invalid\x20import\x20lock;\x20inspect\x20it\x20before\x20recovery.','includes','districtAdcode','succeeded','url','conflict','Invalid\x20import\x20lock\x20owner.','4vASAiI','writeFile','close','size','length','maxBatchBytes','ENOENT','every','createUserId','schemaHash','object','binding','16423099mVMboZ','isSafeInteger','EEXIST','set','5953530zaqUXy','Invalid\x20import\x20batch\x20size.','schemaVersion','datasetCode','streetNumber','errorMessage','stringify','1424mULLso','map','source','incomplete','type','isArray','cityAdcode','rows','pid','add','message','schemaFingerprint','has','rowNumber','some'];a150_0x5e23=function(){return _0x1edbe1;};return a150_0x5e23();}export function assertImportContract(_0x2dbaac,_0x51f030,_0x5ee27b){const _0x334351=a150_0x35049a;if(!_0x2dbaac||!(_0x2dbaac[_0x334351(0x153)]===0x1&&_0x2dbaac[_0x334351(0x1c5)]==='fixed-negative-id'||_0x2dbaac[_0x334351(0x153)]===0x2&&_0x2dbaac[_0x334351(0x1c5)]===_0x334351(0x172))||_0x2dbaac[_0x334351(0x15a)]!==_0x334351(0x16e)||_0x2dbaac['appCode']!==_0x51f030||_0x2dbaac['datasetCode']!==_0x5ee27b||typeof _0x2dbaac[_0x334351(0x1c7)]!==_0x334351(0x18d)||!_0x2dbaac[_0x334351(0x1c7)]||typeof _0x2dbaac['schemaFingerprint']!==_0x334351(0x18d)||!_0x2dbaac['schemaFingerprint']||!Number['isSafeInteger'](_0x2dbaac[_0x334351(0x1bf)])||_0x2dbaac[_0x334351(0x1bf)]<0x1||_0x2dbaac['maxBatchSize']>0x3e8||!Number[_0x334351(0x1dc)](_0x2dbaac[_0x334351(0x1d4)])||_0x2dbaac[_0x334351(0x1d4)]<0x1||_0x2dbaac[_0x334351(0x1d4)]>0x14*0x400*0x400)throw Error(_0x334351(0x191));}export async function runExcelImport(_0x284a80){const _0xfd26bf=a150_0x35049a;_0x284a80={..._0x284a80,'checkpoint':await resolveImportOutputPath(_0x284a80[_0xfd26bf(0x1a1)]),'report':await resolveImportOutputPath(_0x284a80[_0xfd26bf(0x185)])};const {manifest:_0x30d064,contract:_0x2d499c,api:_0x18b2ba}=_0x284a80;assertImportContract(_0x2d499c,_0x284a80['appCode'],_0x284a80[_0xfd26bf(0x154)]);if(_0x2d499c[_0xfd26bf(0x153)]!==0x1)throw Error(_0xfd26bf(0x1bd));if(_0x30d064['errors'][_0xfd26bf(0x1d3)])throw Error(_0xfd26bf(0x1b3));if(!_0x30d064[_0xfd26bf(0x15f)][_0xfd26bf(0x1d3)])throw Error(_0xfd26bf(0x1c1));if(!Number[_0xfd26bf(0x1c4)](_0x284a80[_0xfd26bf(0x16b)])||_0x284a80[_0xfd26bf(0x16b)]<0x1||_0x284a80['batchSize']>_0x2d499c[_0xfd26bf(0x1bf)])throw Error(_0xfd26bf(0x152));for(const _0x4de67f of _0x30d064['rows']){if(Buffer['byteLength'](JSON[_0xfd26bf(0x157)]({'schemaFingerprint':_0x2d499c[_0xfd26bf(0x163)],'items':[{..._0x4de67f['values'],'id':-0x1fffffffffffff}]}),_0xfd26bf(0x177))>_0x2d499c[_0xfd26bf(0x1d4)])throw Error('Excel\x20row\x20'+_0x4de67f[_0xfd26bf(0x165)]+'\x20exceeds\x20the\x20import\x20request\x20size\x20limit.');}assertImportPaths(_0x284a80['checkpoint'],_0x284a80[_0xfd26bf(0x185)]);const _0x128f1e={'appCode':_0x284a80[_0xfd26bf(0x16f)],'datasetCode':_0x284a80['datasetCode'],'runtimeDomain':_0x284a80['runtimeDomain'],'actorId':_0x2d499c[_0xfd26bf(0x1c7)],'fileHash':_0x30d064['fileHash'],'mappingHash':_0x30d064[_0xfd26bf(0x192)],'schemaHash':_0x30d064[_0xfd26bf(0x1d8)],'remoteSchemaHash':_0x2d499c['schemaFingerprint'],'batchSize':_0x284a80[_0xfd26bf(0x16b)],'sheet':_0x30d064[_0xfd26bf(0x167)]},_0x54fd3c=await acquireLock(_0x284a80[_0xfd26bf(0x1a1)]);let _0x47f246;const _0x3e8928=Date[_0xfd26bf(0x1af)]();let _0x4e99e6=0x0;const _0x1322ee=[],_0xb5fa31=()=>({'importId':_0x47f246?.['importId'],'sourceRows':_0x30d064[_0xfd26bf(0x15f)]['length'],'emptyRows':_0x30d064['emptyRows'][_0xfd26bf(0x1d3)],'succeeded':_0x47f246?.[_0xfd26bf(0x15f)][_0xfd26bf(0x197)](_0x1fb149=>_0x1fb149[_0xfd26bf(0x19a)]===_0xfd26bf(0x1cb))['length']??0x0,'unknown':_0x47f246?.['rows'][_0xfd26bf(0x197)](_0x5eb088=>_0x5eb088[_0xfd26bf(0x19a)]===_0xfd26bf(0x1a9))[_0xfd26bf(0x1d3)]??0x0,'conflicts':_0x47f246?.[_0xfd26bf(0x15f)][_0xfd26bf(0x197)](_0xb80e7e=>_0xb80e7e[_0xfd26bf(0x19a)]==='conflict')[_0xfd26bf(0x1d3)]??0x0,'notAttempted':_0x47f246?.[_0xfd26bf(0x15f)][_0xfd26bf(0x197)](_0x3319df=>_0x3319df[_0xfd26bf(0x19a)]===_0xfd26bf(0x184))[_0xfd26bf(0x1d3)]??_0x30d064['rows'][_0xfd26bf(0x1d3)],'batches':_0x4e99e6,'batchResults':_0x1322ee,'elapsedMs':Date[_0xfd26bf(0x1af)]()-_0x3e8928,'checkpoint':resolve(_0x284a80[_0xfd26bf(0x1a1)]),'report':resolve(_0x284a80['report']),'warnings':_0x30d064[_0xfd26bf(0x189)]});try{await rejectSymlink(_0x284a80['checkpoint']);if(_0x284a80[_0xfd26bf(0x19f)]){try{_0x47f246=JSON['parse'](await readFile(_0x284a80[_0xfd26bf(0x1a1)],_0xfd26bf(0x177)));}catch{throw Error(_0xfd26bf(0x18f));}if(!_0x47f246||_0x47f246[_0xfd26bf(0x176)]!==0x1||typeof _0x47f246[_0xfd26bf(0x18b)]!==_0xfd26bf(0x18d)||canonical(_0x47f246[_0xfd26bf(0x1da)])!==canonical(_0x128f1e)||!Array[_0xfd26bf(0x15d)](_0x47f246[_0xfd26bf(0x15f)])||_0x47f246[_0xfd26bf(0x15f)]['length']!==_0x30d064[_0xfd26bf(0x15f)][_0xfd26bf(0x1d3)]||new Set(_0x47f246[_0xfd26bf(0x15f)]['map'](_0x2241cc=>_0x2241cc['id']))[_0xfd26bf(0x1d2)]!==_0x47f246[_0xfd26bf(0x15f)][_0xfd26bf(0x1d3)]||_0x47f246[_0xfd26bf(0x15f)][_0xfd26bf(0x166)]((_0x17bf2d,_0x391eaa)=>!Number[_0xfd26bf(0x1dc)](_0x17bf2d['id'])||_0x17bf2d['id']>=0x0||_0x17bf2d[_0xfd26bf(0x165)]!==_0x30d064[_0xfd26bf(0x15f)][_0x391eaa][_0xfd26bf(0x165)]||!['unsent',_0xfd26bf(0x1a9),_0xfd26bf(0x1cb),'conflict'][_0xfd26bf(0x1c9)](_0x17bf2d[_0xfd26bf(0x19a)])))throw Error('Import\x20checkpoint\x20does\x20not\x20match\x20the\x20input,\x20target\x20or\x20identity.');}else{try{await lstat(_0x284a80[_0xfd26bf(0x1a1)]);throw Error(_0xfd26bf(0x1bb));}catch(_0xf09600){if(_0xf09600[_0xfd26bf(0x187)]!==_0xfd26bf(0x1d5))throw _0xf09600;}const _0x4caa08=new Set();_0x47f246={'version':0x1,'importId':randomUUID(),'binding':_0x128f1e,'rows':_0x30d064[_0xfd26bf(0x15f)][_0xfd26bf(0x159)](_0x585b5e=>{const _0x6353ab=_0xfd26bf;let _0x4c73d9;do{_0x4c73d9=-(Number(BigInt('0x'+randomBytes(0x7)[_0x6353ab(0x1ad)]('hex'))&(0x1n<<0x34n)-0x1n)+0x1);}while(_0x4caa08[_0x6353ab(0x164)](_0x4c73d9));return _0x4caa08[_0x6353ab(0x161)](_0x4c73d9),{'id':_0x4c73d9,'rowNumber':_0x585b5e[_0x6353ab(0x165)],'status':_0x6353ab(0x184)};})},await saveImportJson(_0x284a80[_0xfd26bf(0x1a1)],_0x47f246);}await _0x284a80[_0xfd26bf(0x182)]?.();const _0x15c613=_0x47f246;if(_0x15c613['rows'][_0xfd26bf(0x166)](_0x3bf9ca=>_0x3bf9ca[_0xfd26bf(0x19a)]===_0xfd26bf(0x1cd)))throw Error(_0xfd26bf(0x1be));const _0x254e27=async _0x239b9c=>{const _0x37d0b2=_0xfd26bf,_0x2b5428=await _0x18b2ba[_0x37d0b2(0x19d)](_0x239b9c['map'](_0x1a3111=>_0x15c613[_0x37d0b2(0x15f)][_0x1a3111]['id']));if(!Array[_0x37d0b2(0x15d)](_0x2b5428))throw Error(_0x37d0b2(0x17c));const _0x237122=new Set(_0x239b9c['map'](_0x27f83b=>_0x15c613[_0x37d0b2(0x15f)][_0x27f83b]['id'])),_0x142e6f=new Map();for(const _0x35d765 of _0x2b5428){const _0x1a51d5=Number(_0x35d765?.['id']);if(!_0x237122[_0x37d0b2(0x164)](_0x1a51d5)||_0x142e6f[_0x37d0b2(0x164)](_0x1a51d5))throw Error(_0x37d0b2(0x178));_0x142e6f[_0x37d0b2(0x1de)](_0x1a51d5,_0x35d765);}for(const _0x1b964b of _0x239b9c){const _0x113fca=_0x142e6f[_0x37d0b2(0x1a7)](_0x15c613[_0x37d0b2(0x15f)][_0x1b964b]['id']);if(!_0x113fca)continue;if(_0x15c613['rows'][_0x1b964b][_0x37d0b2(0x19a)]===_0x37d0b2(0x184)){_0x15c613[_0x37d0b2(0x15f)][_0x1b964b][_0x37d0b2(0x19a)]=_0x37d0b2(0x1cd),await saveImportJson(_0x284a80[_0x37d0b2(0x1a1)],_0x15c613);throw Error(_0x37d0b2(0x1b9));}const _0x8e5226=_0x30d064[_0x37d0b2(0x15f)][_0x1b964b][_0x37d0b2(0x181)];if(Object['keys'](_0x8e5226)[_0x37d0b2(0x166)](_0x4f6cd3=>!sameImportValue(_0x8e5226[_0x4f6cd3],_0x113fca[_0x4f6cd3],_0x30d064[_0x37d0b2(0x1c3)]?.['includes'](_0x4f6cd3)&&!_0x30d064[_0x37d0b2(0x1b7)]?.['includes'](_0x4f6cd3)))){_0x15c613[_0x37d0b2(0x15f)][_0x1b964b][_0x37d0b2(0x19a)]=_0x37d0b2(0x1cd),await saveImportJson(_0x284a80[_0x37d0b2(0x1a1)],_0x15c613);throw Error(_0x37d0b2(0x16a)+_0x15c613[_0x37d0b2(0x15f)][_0x1b964b][_0x37d0b2(0x165)]+'.');}_0x15c613['rows'][_0x1b964b][_0x37d0b2(0x19a)]=_0x37d0b2(0x1cb);}return await saveImportJson(_0x284a80[_0x37d0b2(0x1a1)],_0x15c613),_0x142e6f;};if(_0x284a80[_0xfd26bf(0x19f)])for(let _0x332f7a=0x0;_0x332f7a<_0x15c613[_0xfd26bf(0x15f)]['length'];_0x332f7a+=_0x284a80[_0xfd26bf(0x16b)]){const _0x3345a1=_0x15c613[_0xfd26bf(0x15f)][_0xfd26bf(0x1a5)](_0x332f7a,_0x332f7a+_0x284a80['batchSize'])[_0xfd26bf(0x159)]((_0x579c24,_0x4e5a37)=>_0x332f7a+_0x4e5a37),_0x12c22b=_0x3345a1['filter'](_0xd0309a=>_0x15c613[_0xfd26bf(0x15f)][_0xd0309a][_0xfd26bf(0x19a)]===_0xfd26bf(0x1cb)),_0x1d4a9b=await _0x254e27(_0x3345a1),_0x37b214=_0x12c22b[_0xfd26bf(0x197)](_0x4a37a0=>!_0x1d4a9b[_0xfd26bf(0x164)](_0x15c613[_0xfd26bf(0x15f)][_0x4a37a0]['id']));if(_0x37b214[_0xfd26bf(0x1d3)]){_0x37b214[_0xfd26bf(0x16c)](_0x3bc2e8=>{const _0x137209=_0xfd26bf;_0x15c613[_0x137209(0x15f)][_0x3bc2e8]['status']=_0x137209(0x1cd);}),await saveImportJson(_0x284a80['checkpoint'],_0x15c613);throw Error('Previously\x20imported\x20records\x20are\x20no\x20longer\x20visible;\x20recovery\x20stopped.');}}for(let _0x398db4=0x0;_0x398db4<_0x15c613['rows']['length'];){const _0x53c37d=[],_0x2966b4=[];while(_0x398db4<_0x15c613[_0xfd26bf(0x15f)][_0xfd26bf(0x1d3)]&&_0x2966b4[_0xfd26bf(0x1d3)]<_0x284a80[_0xfd26bf(0x16b)]){const _0x55907d=_0x398db4++;if(_0x15c613['rows'][_0x55907d][_0xfd26bf(0x19a)]===_0xfd26bf(0x1cb))continue;const _0x2a0520={..._0x30d064[_0xfd26bf(0x15f)][_0x55907d]['values'],'id':_0x15c613['rows'][_0x55907d]['id']};if(Buffer[_0xfd26bf(0x19b)](JSON[_0xfd26bf(0x157)]({'schemaFingerprint':_0x2d499c[_0xfd26bf(0x163)],'items':[..._0x2966b4,_0x2a0520]}),_0xfd26bf(0x177))>_0x2d499c[_0xfd26bf(0x1d4)]){if(!_0x2966b4[_0xfd26bf(0x1d3)])throw Error(_0xfd26bf(0x17f)+_0x15c613['rows'][_0x55907d][_0xfd26bf(0x165)]+_0xfd26bf(0x18a));_0x398db4--;break;}_0x53c37d[_0xfd26bf(0x186)](_0x55907d),_0x2966b4[_0xfd26bf(0x186)](_0x2a0520);}if(!_0x2966b4[_0xfd26bf(0x1d3)])continue;const _0x32047d=_0x53c37d[_0xfd26bf(0x197)](_0x163d36=>_0x15c613['rows'][_0x163d36]['status']==='unsent');if(_0x32047d['length']){const _0x4c9419=await _0x18b2ba[_0xfd26bf(0x19d)](_0x32047d['map'](_0x554df4=>_0x15c613['rows'][_0x554df4]['id']));if(!Array[_0xfd26bf(0x15d)](_0x4c9419))throw Error('Invalid\x20import\x20readback\x20response.');if(_0x4c9419[_0xfd26bf(0x1d3)])throw Error(_0xfd26bf(0x1b9));}_0x53c37d['forEach'](_0x2e6252=>{const _0x2fae0d=_0xfd26bf;_0x15c613['rows'][_0x2e6252][_0x2fae0d(0x19a)]=_0x2fae0d(0x1a9);}),await saveImportJson(_0x284a80[_0xfd26bf(0x1a1)],_0x15c613),_0x4e99e6++;const _0x548e36=Date[_0xfd26bf(0x1af)](),_0x50f403={'batch':_0x4e99e6,'rowStart':_0x15c613['rows'][_0x53c37d[0x0]][_0xfd26bf(0x165)],'rowEnd':_0x15c613[_0xfd26bf(0x15f)][_0x53c37d[_0x53c37d['length']-0x1]][_0xfd26bf(0x165)],'count':_0x2966b4[_0xfd26bf(0x1d3)],'bytes':Buffer['byteLength'](JSON['stringify']({'schemaFingerprint':_0x2d499c[_0xfd26bf(0x163)],'items':_0x2966b4}),'utf8'),'elapsedMs':0x0,'status':_0xfd26bf(0x18c)};_0x1322ee[_0xfd26bf(0x186)](_0x50f403);try{const _0x3e92b9=await _0x18b2ba[_0xfd26bf(0x1b2)](_0x2966b4);if(!_0x3e92b9||_0x3e92b9['count']!==_0x2966b4[_0xfd26bf(0x1d3)]||!Array[_0xfd26bf(0x15d)](_0x3e92b9[_0xfd26bf(0x179)])||_0x3e92b9[_0xfd26bf(0x179)][_0xfd26bf(0x1d3)]!==_0x2966b4['length']||_0x3e92b9['ids'][_0xfd26bf(0x166)]((_0xae224a,_0x1e6680)=>Number(_0xae224a)!==_0x15c613[_0xfd26bf(0x15f)][_0x53c37d[_0x1e6680]]['id']))throw Error(_0xfd26bf(0x17d));await _0x254e27(_0x53c37d);if(_0x53c37d[_0xfd26bf(0x166)](_0x508129=>_0x15c613[_0xfd26bf(0x15f)][_0x508129][_0xfd26bf(0x19a)]!==_0xfd26bf(0x1cb)))throw Error(_0xfd26bf(0x175));}catch(_0x59c23d){if(_0x15c613['rows'][_0xfd26bf(0x166)](_0x1a79a9=>_0x1a79a9['status']===_0xfd26bf(0x1cd)))throw _0x59c23d;try{await _0x254e27(_0x53c37d);}catch(_0x52a05d){if(_0x15c613[_0xfd26bf(0x15f)][_0xfd26bf(0x166)](_0x234c27=>_0x234c27[_0xfd26bf(0x19a)]===_0xfd26bf(0x1cd)))throw _0x52a05d;}if(_0x53c37d[_0xfd26bf(0x166)](_0x13e861=>_0x15c613['rows'][_0x13e861][_0xfd26bf(0x19a)]!=='succeeded'))throw Error(_0xfd26bf(0x168));}finally{_0x50f403[_0xfd26bf(0x1ac)]=Date[_0xfd26bf(0x1af)]()-_0x548e36;if(_0x53c37d[_0xfd26bf(0x1d6)](_0x399340=>_0x15c613[_0xfd26bf(0x15f)][_0x399340][_0xfd26bf(0x19a)]==='succeeded'))_0x50f403[_0xfd26bf(0x19a)]=_0xfd26bf(0x1cb);else{if(_0x53c37d[_0xfd26bf(0x166)](_0x4cd710=>_0x15c613[_0xfd26bf(0x15f)][_0x4cd710][_0xfd26bf(0x19a)]===_0xfd26bf(0x1cd)))_0x50f403[_0xfd26bf(0x19a)]=_0xfd26bf(0x1cd);}}}const _0x17967f={'status':_0xfd26bf(0x17b),..._0xb5fa31()};return await saveImportJson(_0x284a80[_0xfd26bf(0x185)],_0x17967f),_0x17967f;}catch(_0x401f9d){if(_0x47f246)await saveImportJson(_0x284a80[_0xfd26bf(0x185)],{'status':_0xfd26bf(0x15b),..._0xb5fa31(),'message':_0x401f9d[_0xfd26bf(0x162)]});throw _0x401f9d;}finally{await _0x54fd3c();}}
1
+ const a150_0x1d7ece=a150_0x1e18;function a150_0x1e18(_0x4cf78c,_0x57e87b){_0x4cf78c=_0x4cf78c-0x18e;const _0x562dfb=a150_0x562d();let _0x1e1883=_0x562dfb[_0x4cf78c];return _0x1e1883;}(function(_0xab5812,_0x9affd5){const _0x2d2551=a150_0x1e18,_0x5d8595=_0xab5812();while(!![]){try{const _0x382d24=parseInt(_0x2d2551(0x1c1))/0x1*(parseInt(_0x2d2551(0x195))/0x2)+-parseInt(_0x2d2551(0x1ef))/0x3+-parseInt(_0x2d2551(0x208))/0x4+-parseInt(_0x2d2551(0x1bb))/0x5*(parseInt(_0x2d2551(0x1f8))/0x6)+parseInt(_0x2d2551(0x1cc))/0x7+parseInt(_0x2d2551(0x1a9))/0x8+parseInt(_0x2d2551(0x18f))/0x9*(-parseInt(_0x2d2551(0x1d4))/0xa);if(_0x382d24===_0x9affd5)break;else _0x5d8595['push'](_0x5d8595['shift']());}catch(_0x4f53f6){_0x5d8595['push'](_0x5d8595['shift']());}}}(a150_0x562d,0x7f653));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(_0x413cc5){const _0x294ea8=a150_0x1e18;if(Array['isArray'](_0x413cc5))return'['+_0x413cc5[_0x294ea8(0x1c0)](canonical)['join'](',')+']';if(_0x413cc5&&typeof _0x413cc5===_0x294ea8(0x209))return'{'+Object[_0x294ea8(0x1c4)](_0x413cc5)[_0x294ea8(0x196)]()[_0x294ea8(0x1c0)](_0x5176f7=>JSON[_0x294ea8(0x198)](_0x5176f7)+':'+canonical(_0x413cc5[_0x5176f7]))['join'](',')+'}';return JSON['stringify'](_0x413cc5)??'undefined';}const EMPTY_IMAGE_LOCATION_FIELDS=new Set(['time',a150_0x1d7ece(0x19c),a150_0x1d7ece(0x1fe),a150_0x1d7ece(0x1ad),a150_0x1d7ece(0x1b8),a150_0x1d7ece(0x1bf),a150_0x1d7ece(0x1f6),a150_0x1d7ece(0x19b),a150_0x1d7ece(0x1db),a150_0x1d7ece(0x1a3),'city',a150_0x1d7ece(0x205),a150_0x1d7ece(0x20f),a150_0x1d7ece(0x1b3),'accuracy',a150_0x1d7ece(0x19e),a150_0x1d7ece(0x1cf),a150_0x1d7ece(0x1d1),a150_0x1d7ece(0x18e),a150_0x1d7ece(0x20a)]);export function sameImportValue(_0x3ca73,_0x259685,_0x310baa=![]){const _0x49f0bc=a150_0x1d7ece;if(_0x310baa){const _0xfcd17b=_0x49f4e6=>Array[_0x49f0bc(0x20c)](_0x49f4e6)?_0x49f4e6[_0x49f0bc(0x1c0)](_0x1535c5=>{const _0x12e6bf=_0x49f0bc;if(!_0x1535c5||typeof _0x1535c5!==_0x12e6bf(0x209)||Array[_0x12e6bf(0x20c)](_0x1535c5))return _0x1535c5;const _0x9dd633={..._0x1535c5};delete _0x9dd633[_0x12e6bf(0x192)],delete _0x9dd633[_0x12e6bf(0x1d8)];if(_0x9dd633[_0x12e6bf(0x1a0)]==='')delete _0x9dd633[_0x12e6bf(0x1a0)];if(_0x9dd633[_0x12e6bf(0x202)]==null)delete _0x9dd633[_0x12e6bf(0x202)];if(_0x9dd633[_0x12e6bf(0x1e7)]==null)delete _0x9dd633['createUserName'];if(_0x9dd633[_0x12e6bf(0x1e6)]==null||typeof _0x9dd633[_0x12e6bf(0x1e6)]===_0x12e6bf(0x209)&&!Array[_0x12e6bf(0x20c)](_0x9dd633[_0x12e6bf(0x1e6)])&&Object['entries'](_0x9dd633[_0x12e6bf(0x1e6)])['every'](([_0x570955,_0x5d11be])=>EMPTY_IMAGE_LOCATION_FIELDS[_0x12e6bf(0x1c5)](_0x570955)&&_0x5d11be===null))delete _0x9dd633[_0x12e6bf(0x1e6)];for(const _0xe38e38 of[_0x12e6bf(0x1e3),_0x12e6bf(0x1e4),_0x12e6bf(0x19d)])if(!(_0xe38e38 in _0x9dd633))_0x9dd633[_0xe38e38]='';if(_0x9dd633[_0x12e6bf(0x1f2)]==null)_0x9dd633[_0x12e6bf(0x1f2)]=0x0;return _0x9dd633;}):_0x49f4e6;return canonical(_0xfcd17b(_0x3ca73))===canonical(_0xfcd17b(_0x259685));}return _0x3ca73===null?_0x259685===null||_0x259685===undefined:canonical(_0x259685)===canonical(_0x3ca73);}async function rejectSymlink(_0x36486d){const _0x487f84=a150_0x1d7ece;try{if((await lstat(_0x36486d))[_0x487f84(0x1f9)]())throw Error('Import\x20output\x20must\x20not\x20be\x20a\x20symbolic\x20link.');}catch(_0x2020fc){if(_0x2020fc[_0x487f84(0x1ce)]!==_0x487f84(0x1de))throw _0x2020fc;}}export async function resolveImportOutputPath(_0x2bf75b){return await rejectSymlink(_0x2bf75b),resolve(await realpath(dirname(resolve(_0x2bf75b))),basename(_0x2bf75b));}export function assertImportPaths(_0x337d6b,_0xc05314,_0x424a1b=[]){const _0x34aa95=a150_0x1d7ece,_0x38c63b=[..._0x424a1b,_0x337d6b,_0xc05314,_0x337d6b+_0x34aa95(0x1df),_0x337d6b+_0x34aa95(0x1aa)]['map'](_0x226ce9=>resolve(_0x226ce9));if(new Set(_0x38c63b)[_0x34aa95(0x1f2)]!==_0x38c63b[_0x34aa95(0x1c7)])throw Error(_0x34aa95(0x1ab));}export async function saveImportJson(_0x17c862,_0xdcf6aa){const _0x17a6e8=a150_0x1d7ece;await rejectSymlink(_0x17c862);const _0x30671d=_0x17c862+'.tmp-'+randomUUID(),_0x126a1c=await open(_0x30671d,'wx',0x180);try{await _0x126a1c[_0x17a6e8(0x1e1)](JSON['stringify'](_0xdcf6aa,null,0x2)),await _0x126a1c[_0x17a6e8(0x1a4)]();}finally{await _0x126a1c[_0x17a6e8(0x1c3)]();}try{await rename(_0x30671d,_0x17c862);}catch(_0x4884be){await unlink(_0x30671d)[_0x17a6e8(0x1a5)](()=>{});throw _0x4884be;}}export async function acquireLock(_0x29bfbc){const _0x200e09=a150_0x1d7ece,_0xfadd42=_0x29bfbc+_0x200e09(0x1df),_0x2e07fc=randomUUID();await rejectSymlink(_0xfadd42);const _0x36e7bf=_0xfadd42+_0x200e09(0x1ca);let _0x1eab89,_0x5e745c;try{try{_0x1eab89=await open(_0xfadd42,'wx',0x180);}catch(_0x3f2227){if(_0x3f2227['code']!=='EEXIST')throw _0x3f2227;try{_0x5e745c=await open(_0x36e7bf,'wx',0x180);}catch(_0x29e6ca){if(_0x29e6ca[_0x200e09(0x1ce)]===_0x200e09(0x1e2))throw Error(_0x200e09(0x1d2));throw _0x29e6ca;}await _0x5e745c[_0x200e09(0x1e1)](JSON['stringify']({'pid':process[_0x200e09(0x211)],'token':_0x2e07fc})),await _0x5e745c[_0x200e09(0x1a4)](),await rejectSymlink(_0xfadd42);let _0x393959;try{_0x393959=await readFile(_0xfadd42,_0x200e09(0x1b9));}catch(_0x4dd280){if(_0x4dd280[_0x200e09(0x1ce)]!==_0x200e09(0x1de))throw _0x4dd280;}if(_0x393959!==undefined){let _0x19c9a0;try{_0x19c9a0=JSON[_0x200e09(0x1dc)](_0x393959);}catch{throw Error(_0x200e09(0x1f7));}if(!_0x19c9a0||!Number[_0x200e09(0x1f5)](_0x19c9a0['pid'])||_0x19c9a0[_0x200e09(0x211)]<=0x0)throw Error(_0x200e09(0x190));try{process[_0x200e09(0x207)](_0x19c9a0[_0x200e09(0x211)],0x0);throw Error('The\x20import\x20checkpoint\x20is\x20locked\x20by\x20a\x20running\x20process.');}catch(_0xa3262d){if(_0xa3262d[_0x200e09(0x1ce)]!==_0x200e09(0x1ba))throw _0xa3262d;}if(await readFile(_0xfadd42,_0x200e09(0x1b9))!==_0x393959)throw Error(_0x200e09(0x1e9));await unlink(_0xfadd42);}_0x1eab89=await open(_0xfadd42,'wx',0x180);}await _0x1eab89[_0x200e09(0x1e1)](JSON[_0x200e09(0x198)]({'pid':process[_0x200e09(0x211)],'token':_0x2e07fc})),await _0x1eab89[_0x200e09(0x1a4)]();}finally{try{await _0x1eab89?.['close']();}finally{if(_0x5e745c)try{await _0x5e745c[_0x200e09(0x1c3)]();}finally{await unlink(_0x36e7bf);}}}return async()=>{const _0x4dffa8=_0x200e09;if(JSON[_0x4dffa8(0x1dc)](await readFile(_0xfadd42,_0x4dffa8(0x1b9)))[_0x4dffa8(0x1c6)]===_0x2e07fc)await unlink(_0xfadd42);};}export function assertImportContract(_0x1038fe,_0x142449,_0x36f33c){const _0x148288=a150_0x1d7ece;if(!_0x1038fe||!(_0x1038fe[_0x148288(0x1da)]===0x1&&_0x1038fe[_0x148288(0x1d7)]===_0x148288(0x1af)||_0x1038fe['schemaVersion']===0x2&&_0x1038fe[_0x148288(0x1d7)]===_0x148288(0x1ae))||_0x1038fe[_0x148288(0x201)]!==_0x148288(0x194)||_0x1038fe[_0x148288(0x200)]!==_0x142449||_0x1038fe['datasetCode']!==_0x36f33c||typeof _0x1038fe[_0x148288(0x1ee)]!==_0x148288(0x1d9)||!_0x1038fe[_0x148288(0x1ee)]||typeof _0x1038fe['schemaFingerprint']!==_0x148288(0x1d9)||!_0x1038fe['schemaFingerprint']||!Number[_0x148288(0x1f5)](_0x1038fe[_0x148288(0x19f)])||_0x1038fe[_0x148288(0x19f)]<0x1||_0x1038fe[_0x148288(0x19f)]>0x3e8||!Number[_0x148288(0x1f5)](_0x1038fe['maxBatchBytes'])||_0x1038fe['maxBatchBytes']<0x1||_0x1038fe[_0x148288(0x1eb)]>0x14*0x400*0x400)throw Error('The\x20server\x20import\x20contract\x20is\x20unsupported\x20or\x20incomplete.');}export async function runExcelImport(_0x57c523){const _0x448134=a150_0x1d7ece;_0x57c523={..._0x57c523,'checkpoint':await resolveImportOutputPath(_0x57c523[_0x448134(0x1cb)]),'report':await resolveImportOutputPath(_0x57c523[_0x448134(0x193)])};const {manifest:_0x350baf,contract:_0x5aea09,api:_0x2417fa}=_0x57c523;assertImportContract(_0x5aea09,_0x57c523[_0x448134(0x200)],_0x57c523['datasetCode']);if(_0x5aea09[_0x448134(0x1da)]!==0x1)throw Error(_0x448134(0x1d6));if(_0x350baf[_0x448134(0x191)][_0x448134(0x1c7)])throw Error(_0x448134(0x1ff));if(!_0x350baf[_0x448134(0x199)]['length'])throw Error('Excel\x20contains\x20no\x20valid\x20data\x20rows.');if(!Number[_0x448134(0x20e)](_0x57c523[_0x448134(0x1e0)])||_0x57c523[_0x448134(0x1e0)]<0x1||_0x57c523['batchSize']>_0x5aea09[_0x448134(0x19f)])throw Error(_0x448134(0x1b0));for(const _0x5e456c of _0x350baf[_0x448134(0x199)]){if(Buffer[_0x448134(0x1a7)](JSON[_0x448134(0x198)]({'schemaFingerprint':_0x5aea09['schemaFingerprint'],'items':[{..._0x5e456c[_0x448134(0x20b)],'id':-0x1fffffffffffff}]}),_0x448134(0x1b9))>_0x5aea09[_0x448134(0x1eb)])throw Error('Excel\x20row\x20'+_0x5e456c[_0x448134(0x1f4)]+_0x448134(0x1ac));}assertImportPaths(_0x57c523[_0x448134(0x1cb)],_0x57c523[_0x448134(0x193)]);const _0x399188={'appCode':_0x57c523['appCode'],'datasetCode':_0x57c523[_0x448134(0x1b7)],'runtimeDomain':_0x57c523['runtimeDomain'],'actorId':_0x5aea09['actorId'],'fileHash':_0x350baf['fileHash'],'mappingHash':_0x350baf[_0x448134(0x206)],'schemaHash':_0x350baf[_0x448134(0x1a6)],'remoteSchemaHash':_0x5aea09[_0x448134(0x1fc)],'batchSize':_0x57c523[_0x448134(0x1e0)],'sheet':_0x350baf['sheet']},_0x5c1a2d=await acquireLock(_0x57c523[_0x448134(0x1cb)]);let _0x4d2ee6;const _0x27a59e=Date[_0x448134(0x1c8)]();let _0x3f96a7=0x0;const _0x408ee0=[],_0x403fbc=()=>({'importId':_0x4d2ee6?.[_0x448134(0x203)],'sourceRows':_0x350baf[_0x448134(0x199)][_0x448134(0x1c7)],'emptyRows':_0x350baf[_0x448134(0x1fa)][_0x448134(0x1c7)],'succeeded':_0x4d2ee6?.[_0x448134(0x199)][_0x448134(0x1ec)](_0x142ff1=>_0x142ff1[_0x448134(0x1f0)]==='succeeded')[_0x448134(0x1c7)]??0x0,'unknown':_0x4d2ee6?.[_0x448134(0x199)][_0x448134(0x1ec)](_0x546e64=>_0x546e64[_0x448134(0x1f0)]===_0x448134(0x1a1))[_0x448134(0x1c7)]??0x0,'conflicts':_0x4d2ee6?.[_0x448134(0x199)]['filter'](_0xa15a86=>_0xa15a86['status']===_0x448134(0x1bc))[_0x448134(0x1c7)]??0x0,'notAttempted':_0x4d2ee6?.[_0x448134(0x199)][_0x448134(0x1ec)](_0x174423=>_0x174423[_0x448134(0x1f0)]==='unsent')[_0x448134(0x1c7)]??_0x350baf[_0x448134(0x199)]['length'],'batches':_0x3f96a7,'batchResults':_0x408ee0,'elapsedMs':Date['now']()-_0x27a59e,'checkpoint':resolve(_0x57c523[_0x448134(0x1cb)]),'report':resolve(_0x57c523[_0x448134(0x193)]),'warnings':_0x350baf['warnings']});try{await rejectSymlink(_0x57c523[_0x448134(0x1cb)]);if(_0x57c523[_0x448134(0x1e5)]){try{_0x4d2ee6=JSON[_0x448134(0x1dc)](await readFile(_0x57c523[_0x448134(0x1cb)],'utf8'));}catch{throw Error(_0x448134(0x1ea));}if(!_0x4d2ee6||_0x4d2ee6['version']!==0x1||typeof _0x4d2ee6['importId']!=='string'||canonical(_0x4d2ee6['binding'])!==canonical(_0x399188)||!Array['isArray'](_0x4d2ee6['rows'])||_0x4d2ee6['rows'][_0x448134(0x1c7)]!==_0x350baf[_0x448134(0x199)][_0x448134(0x1c7)]||new Set(_0x4d2ee6[_0x448134(0x199)][_0x448134(0x1c0)](_0x34e1ca=>_0x34e1ca['id']))[_0x448134(0x1f2)]!==_0x4d2ee6[_0x448134(0x199)][_0x448134(0x1c7)]||_0x4d2ee6[_0x448134(0x199)][_0x448134(0x1cd)]((_0x470a6d,_0x196869)=>!Number[_0x448134(0x1f5)](_0x470a6d['id'])||_0x470a6d['id']>=0x0||_0x470a6d[_0x448134(0x1f4)]!==_0x350baf['rows'][_0x196869][_0x448134(0x1f4)]||!['unsent',_0x448134(0x1a1),'succeeded',_0x448134(0x1bc)][_0x448134(0x1fd)](_0x470a6d[_0x448134(0x1f0)])))throw Error(_0x448134(0x1f1));}else{try{await lstat(_0x57c523[_0x448134(0x1cb)]);throw Error(_0x448134(0x1e8));}catch(_0xdb3eb1){if(_0xdb3eb1['code']!=='ENOENT')throw _0xdb3eb1;}const _0x2514b6=new Set();_0x4d2ee6={'version':0x1,'importId':randomUUID(),'binding':_0x399188,'rows':_0x350baf[_0x448134(0x199)][_0x448134(0x1c0)](_0x545110=>{const _0x28bb58=_0x448134;let _0x3c8ff2;do{_0x3c8ff2=-(Number(BigInt('0x'+randomBytes(0x7)[_0x28bb58(0x1f3)](_0x28bb58(0x1ed)))&(0x1n<<0x34n)-0x1n)+0x1);}while(_0x2514b6[_0x28bb58(0x1c5)](_0x3c8ff2));return _0x2514b6['add'](_0x3c8ff2),{'id':_0x3c8ff2,'rowNumber':_0x545110[_0x28bb58(0x1f4)],'status':_0x28bb58(0x1b5)};})},await saveImportJson(_0x57c523[_0x448134(0x1cb)],_0x4d2ee6);}await _0x57c523['onCheckpointReady']?.();const _0x37b969=_0x4d2ee6;if(_0x37b969[_0x448134(0x199)][_0x448134(0x1cd)](_0x24000f=>_0x24000f[_0x448134(0x1f0)]===_0x448134(0x1bc)))throw Error('Import\x20checkpoint\x20contains\x20a\x20content\x20conflict.');const _0x665a43=async _0x15446e=>{const _0x315781=_0x448134,_0x70dd57=await _0x2417fa[_0x315781(0x1fb)](_0x15446e[_0x315781(0x1c0)](_0x345b03=>_0x37b969[_0x315781(0x199)][_0x345b03]['id']));if(!Array['isArray'](_0x70dd57))throw Error('Invalid\x20import\x20readback\x20response.');const _0x5d5df2=new Set(_0x15446e[_0x315781(0x1c0)](_0x6a0191=>_0x37b969[_0x315781(0x199)][_0x6a0191]['id'])),_0x587326=new Map();for(const _0x4d674e of _0x70dd57){const _0x4f2ee0=Number(_0x4d674e?.['id']);if(!_0x5d5df2[_0x315781(0x1c5)](_0x4f2ee0)||_0x587326['has'](_0x4f2ee0))throw Error(_0x315781(0x1c2));_0x587326[_0x315781(0x1d0)](_0x4f2ee0,_0x4d674e);}for(const _0x48d065 of _0x15446e){const _0xdc8549=_0x587326[_0x315781(0x1a8)](_0x37b969[_0x315781(0x199)][_0x48d065]['id']);if(!_0xdc8549)continue;if(_0x37b969[_0x315781(0x199)][_0x48d065][_0x315781(0x1f0)]===_0x315781(0x1b5)){_0x37b969['rows'][_0x48d065][_0x315781(0x1f0)]='conflict',await saveImportJson(_0x57c523[_0x315781(0x1cb)],_0x37b969);throw Error('Import\x20primary\x20key\x20collision;\x20stop\x20without\x20replacing\x20the\x20fixed\x20IDs.');}const _0xeac704=_0x350baf[_0x315781(0x199)][_0x48d065][_0x315781(0x20b)];if(Object['keys'](_0xeac704)[_0x315781(0x1cd)](_0x3c0358=>!sameImportValue(_0xeac704[_0x3c0358],_0xdc8549[_0x3c0358],_0x350baf['imageFields']?.[_0x315781(0x1fd)](_0x3c0358)&&!_0x350baf[_0x315781(0x20d)]?.['includes'](_0x3c0358)))){_0x37b969['rows'][_0x48d065][_0x315781(0x1f0)]='conflict',await saveImportJson(_0x57c523[_0x315781(0x1cb)],_0x37b969);throw Error(_0x315781(0x1b1)+_0x37b969[_0x315781(0x199)][_0x48d065]['rowNumber']+'.');}_0x37b969[_0x315781(0x199)][_0x48d065]['status']=_0x315781(0x1d5);}return await saveImportJson(_0x57c523[_0x315781(0x1cb)],_0x37b969),_0x587326;};if(_0x57c523['resume'])for(let _0x5c8092=0x0;_0x5c8092<_0x37b969['rows'][_0x448134(0x1c7)];_0x5c8092+=_0x57c523[_0x448134(0x1e0)]){const _0x1bc6d2=_0x37b969[_0x448134(0x199)][_0x448134(0x1bd)](_0x5c8092,_0x5c8092+_0x57c523['batchSize'])[_0x448134(0x1c0)]((_0x54fd9a,_0x394a41)=>_0x5c8092+_0x394a41),_0x3ecc38=_0x1bc6d2['filter'](_0x3b4a60=>_0x37b969[_0x448134(0x199)][_0x3b4a60][_0x448134(0x1f0)]==='succeeded'),_0x4a3de4=await _0x665a43(_0x1bc6d2),_0x24f17e=_0x3ecc38[_0x448134(0x1ec)](_0x1b104f=>!_0x4a3de4['has'](_0x37b969[_0x448134(0x199)][_0x1b104f]['id']));if(_0x24f17e[_0x448134(0x1c7)]){_0x24f17e[_0x448134(0x1b6)](_0x3af205=>{const _0xca914f=_0x448134;_0x37b969[_0xca914f(0x199)][_0x3af205][_0xca914f(0x1f0)]=_0xca914f(0x1bc);}),await saveImportJson(_0x57c523['checkpoint'],_0x37b969);throw Error(_0x448134(0x1c9));}}for(let _0x2e053f=0x0;_0x2e053f<_0x37b969[_0x448134(0x199)][_0x448134(0x1c7)];){const _0x2cda51=[],_0x1139fe=[];while(_0x2e053f<_0x37b969['rows']['length']&&_0x1139fe[_0x448134(0x1c7)]<_0x57c523[_0x448134(0x1e0)]){const _0x4ff71e=_0x2e053f++;if(_0x37b969[_0x448134(0x199)][_0x4ff71e][_0x448134(0x1f0)]===_0x448134(0x1d5))continue;const _0x5113dc={..._0x350baf[_0x448134(0x199)][_0x4ff71e][_0x448134(0x20b)],'id':_0x37b969[_0x448134(0x199)][_0x4ff71e]['id']};if(Buffer[_0x448134(0x1a7)](JSON['stringify']({'schemaFingerprint':_0x5aea09[_0x448134(0x1fc)],'items':[..._0x1139fe,_0x5113dc]}),'utf8')>_0x5aea09['maxBatchBytes']){if(!_0x1139fe[_0x448134(0x1c7)])throw Error(_0x448134(0x197)+_0x37b969['rows'][_0x4ff71e][_0x448134(0x1f4)]+'\x20exceeds\x20the\x20import\x20request\x20size\x20limit.');_0x2e053f--;break;}_0x2cda51[_0x448134(0x1b4)](_0x4ff71e),_0x1139fe['push'](_0x5113dc);}if(!_0x1139fe['length'])continue;const _0x50848d=_0x2cda51['filter'](_0x28e20f=>_0x37b969['rows'][_0x28e20f][_0x448134(0x1f0)]===_0x448134(0x1b5));if(_0x50848d[_0x448134(0x1c7)]){const _0x38066f=await _0x2417fa[_0x448134(0x1fb)](_0x50848d[_0x448134(0x1c0)](_0x3e6733=>_0x37b969[_0x448134(0x199)][_0x3e6733]['id']));if(!Array['isArray'](_0x38066f))throw Error('Invalid\x20import\x20readback\x20response.');if(_0x38066f[_0x448134(0x1c7)])throw Error('Import\x20primary\x20key\x20collision;\x20stop\x20without\x20replacing\x20the\x20fixed\x20IDs.');}_0x2cda51[_0x448134(0x1b6)](_0xbcc402=>{const _0xe37458=_0x448134;_0x37b969[_0xe37458(0x199)][_0xbcc402][_0xe37458(0x1f0)]=_0xe37458(0x1a1);}),await saveImportJson(_0x57c523[_0x448134(0x1cb)],_0x37b969),_0x3f96a7++;const _0x2dc8c5=Date[_0x448134(0x1c8)](),_0x58371={'batch':_0x3f96a7,'rowStart':_0x37b969[_0x448134(0x199)][_0x2cda51[0x0]]['rowNumber'],'rowEnd':_0x37b969[_0x448134(0x199)][_0x2cda51[_0x2cda51[_0x448134(0x1c7)]-0x1]][_0x448134(0x1f4)],'count':_0x1139fe[_0x448134(0x1c7)],'bytes':Buffer[_0x448134(0x1a7)](JSON[_0x448134(0x198)]({'schemaFingerprint':_0x5aea09[_0x448134(0x1fc)],'items':_0x1139fe}),_0x448134(0x1b9)),'elapsedMs':0x0,'status':_0x448134(0x1d3)};_0x408ee0[_0x448134(0x1b4)](_0x58371);try{const _0x572bcc=await _0x2417fa['write'](_0x1139fe);if(!_0x572bcc||_0x572bcc[_0x448134(0x1be)]!==_0x1139fe[_0x448134(0x1c7)]||!Array[_0x448134(0x20c)](_0x572bcc[_0x448134(0x19a)])||_0x572bcc[_0x448134(0x19a)][_0x448134(0x1c7)]!==_0x1139fe[_0x448134(0x1c7)]||_0x572bcc[_0x448134(0x19a)][_0x448134(0x1cd)]((_0x4309e1,_0x51bf34)=>Number(_0x4309e1)!==_0x37b969['rows'][_0x2cda51[_0x51bf34]]['id']))throw Error(_0x448134(0x1dd));await _0x665a43(_0x2cda51);if(_0x2cda51['some'](_0x37a277=>_0x37b969['rows'][_0x37a277][_0x448134(0x1f0)]!=='succeeded'))throw Error(_0x448134(0x204));}catch(_0x4deff4){if(_0x37b969[_0x448134(0x199)]['some'](_0x5adc27=>_0x5adc27[_0x448134(0x1f0)]===_0x448134(0x1bc)))throw _0x4deff4;try{await _0x665a43(_0x2cda51);}catch(_0xfb8f29){if(_0x37b969[_0x448134(0x199)][_0x448134(0x1cd)](_0x2ede72=>_0x2ede72[_0x448134(0x1f0)]==='conflict'))throw _0xfb8f29;}if(_0x2cda51[_0x448134(0x1cd)](_0x228f37=>_0x37b969['rows'][_0x228f37][_0x448134(0x1f0)]!==_0x448134(0x1d5)))throw Error(_0x448134(0x1a2));}finally{_0x58371[_0x448134(0x210)]=Date[_0x448134(0x1c8)]()-_0x2dc8c5;if(_0x2cda51[_0x448134(0x1b2)](_0x24ab9=>_0x37b969[_0x448134(0x199)][_0x24ab9][_0x448134(0x1f0)]===_0x448134(0x1d5)))_0x58371[_0x448134(0x1f0)]='succeeded';else{if(_0x2cda51[_0x448134(0x1cd)](_0x1eed12=>_0x37b969[_0x448134(0x199)][_0x1eed12][_0x448134(0x1f0)]==='conflict'))_0x58371[_0x448134(0x1f0)]=_0x448134(0x1bc);}}}const _0x34e665={'status':'completed',..._0x403fbc()};return await saveImportJson(_0x57c523[_0x448134(0x193)],_0x34e665),_0x34e665;}catch(_0x3991c0){if(_0x4d2ee6)await saveImportJson(_0x57c523['report'],{'status':'incomplete',..._0x403fbc(),'message':_0x3991c0['message']});throw _0x3991c0;}finally{await _0x5c1a2d();}}function a150_0x562d(){const _0xf8bda1=['parse','Invalid\x20write\x20result.','ENOENT','.lock','batchSize','writeFile','EEXIST','name','type','resume','geolocation','createUserName','Import\x20checkpoint\x20already\x20exists;\x20use\x20--resume.','Import\x20lock\x20changed;\x20retry\x20recovery.','Cannot\x20read\x20the\x20import\x20checkpoint.','maxBatchBytes','filter','hex','actorId','1028628JIZGav','status','Import\x20checkpoint\x20does\x20not\x20match\x20the\x20input,\x20target\x20or\x20identity.','size','toString','rowNumber','isSafeInteger','country','Invalid\x20import\x20lock;\x20inspect\x20it\x20before\x20recovery.','1654284AlVgUc','isSymbolicLink','emptyRows','readback','schemaFingerprint','includes','districtAdcode','Excel\x20contains\x20invalid\x20rows;\x20no\x20data\x20was\x20written.','appCode','source','createUserId','importId','Incomplete\x20readback.','netType','mappingHash','kill','506212EGGNne','object','lbswuaCacheId','values','isArray','uploadFields','isInteger','resultCode','elapsedMs','pid','address','10254996KUIVoe','Invalid\x20import\x20lock\x20owner.','errors','url','report','METADATA','876wpSicP','sort','Excel\x20row\x20','stringify','rows','ids','countryCode','operatorType','key','longitude','maxBatchSize','dingTalkUrl','pending','The\x20import\x20write\x20outcome\x20is\x20unknown.\x20Resume\x20to\x20reconcile\x20the\x20fixed\x20IDs\x20before\x20continuing.','latitude','sync','catch','schemaHash','byteLength','get','8174344ijZutB','.lock.recovery','Import\x20input,\x20output\x20and\x20lock\x20paths\x20must\x20be\x20different\x20files.','\x20exceeds\x20the\x20import\x20request\x20size\x20limit.','district','auto-id-task-marker','fixed-negative-id','Invalid\x20import\x20batch\x20size.','Import\x20content\x20conflict\x20at\x20Excel\x20row\x20','every','streetNumber','push','unsent','forEach','datasetCode','pois','utf8','ESRCH','5qpPYVN','conflict','slice','count','road','map','818SEqwWF','Invalid\x20or\x20duplicate\x20import\x20readback\x20ID.','close','keys','has','token','length','now','Previously\x20imported\x20records\x20are\x20no\x20longer\x20visible;\x20recovery\x20stopped.','.recovery','checkpoint','7184247JsJwqy','some','code','cityAdcode','set','errorMessage','Import\x20lock\x20recovery\x20is\x20active\x20or\x20interrupted;\x20inspect\x20the\x20recovery\x20guard\x20before\x20retrying.','unknown','10wEBGPS','succeeded','The\x20fixed-ID\x20runner\x20requires\x20the\x20v1\x20import\x20contract.','strategy','previewUrl','string','schemaVersion','province'];a150_0x562d=function(){return _0xf8bda1;};return a150_0x562d();}
@@ -1 +1 @@
1
- const a152_0x211dbd=a152_0x974d;(function(_0xd94a95,_0x5bf0f1){const _0x22da9f=a152_0x974d,_0x52fe1e=_0xd94a95();while(!![]){try{const _0x386878=-parseInt(_0x22da9f(0x1c0))/0x1*(-parseInt(_0x22da9f(0x199))/0x2)+-parseInt(_0x22da9f(0x197))/0x3+-parseInt(_0x22da9f(0x1b1))/0x4+-parseInt(_0x22da9f(0x1bc))/0x5*(parseInt(_0x22da9f(0x1ab))/0x6)+parseInt(_0x22da9f(0x1b9))/0x7*(-parseInt(_0x22da9f(0x1bd))/0x8)+-parseInt(_0x22da9f(0x1a2))/0x9*(-parseInt(_0x22da9f(0x18b))/0xa)+-parseInt(_0x22da9f(0x18d))/0xb*(-parseInt(_0x22da9f(0x191))/0xc);if(_0x386878===_0x5bf0f1)break;else _0x52fe1e['push'](_0x52fe1e['shift']());}catch(_0x5488f4){_0x52fe1e['push'](_0x52fe1e['shift']());}}}(a152_0x2f72,0x31236));import{createHash}from'node:crypto';import{lstatSync,readFileSync,readdirSync}from'node:fs';import{homedir}from'node:os';import{dirname,join,relative,resolve,sep}from'node:path';import{fileURLToPath}from'node:url';import{debuglog}from'node:util';import{runNpxSkillsAddGlobal}from'../skills/npx-skills-add.js';import{resolveInstalledSkill}from'../skills/skill-presence.js';function a152_0x974d(_0x125eef,_0x4bbe86){_0x125eef=_0x125eef-0x186;const _0x2f72b7=a152_0x2f72();let _0x974da7=_0x2f72b7[_0x125eef];return _0x974da7;}const DEFAULT_PACKAGE_ROOT=resolve(dirname(fileURLToPath(import.meta.url)),'..','..'),REPAIR_COMMAND='lovrabet\x20cli-skill\x20install',SKILL_NAME=a152_0x211dbd(0x19f),debug=debuglog(a152_0x211dbd(0x1c5));function frontmatterValue(_0x1e4e17,_0x2dbc43){return _0x1e4e17['match'](new RegExp('^'+_0x2dbc43+':\x5cs*(.+)$','m'))?.[0x1]?.['trim']()??'';}function listFiles(_0x35a835,_0x1eb581=_0x35a835){const _0x550f96=a152_0x211dbd;return readdirSync(_0x1eb581,{'withFileTypes':!![]})[_0x550f96(0x1a5)](_0x20ff44=>{const _0x17b2d7=_0x550f96,_0x150f18=join(_0x1eb581,_0x20ff44[_0x17b2d7(0x1ac)]),_0x1f7636=lstatSync(_0x150f18);if(_0x1f7636[_0x17b2d7(0x1cb)]())throw new Error(_0x17b2d7(0x19e)+_0x150f18);if(_0x1f7636[_0x17b2d7(0x1af)]())return listFiles(_0x35a835,_0x150f18);if(!_0x1f7636[_0x17b2d7(0x19a)]())throw new Error(_0x17b2d7(0x18f)+_0x150f18);return[relative(_0x35a835,_0x150f18)[_0x17b2d7(0x196)](sep)[_0x17b2d7(0x19d)]('/')];})[_0x550f96(0x1ca)]((_0x33cb6b,_0x597382)=>_0x33cb6b<_0x597382?-0x1:_0x33cb6b>_0x597382?0x1:0x0);}function digestFiles(_0x84a2a4,_0x5eaf38){const _0x255592=a152_0x211dbd,_0x41da5a=createHash('sha256');for(const _0x485105 of _0x5eaf38){if(_0x485105[_0x255592(0x1ba)]('/')||_0x485105[_0x255592(0x196)]('/')[_0x255592(0x186)]('..')||_0x485105[_0x255592(0x186)]('\x5c'))throw new Error(_0x255592(0x1c4)+_0x485105);_0x41da5a['update'](_0x485105),_0x41da5a['update']('\x00'),_0x41da5a[_0x255592(0x1a8)](readFileSync(join(_0x84a2a4,..._0x485105['split']('/')))),_0x41da5a[_0x255592(0x1a8)]('\x00');}return _0x41da5a[_0x255592(0x1ce)](_0x255592(0x1c7));}function sameFiles(_0x43ee38,_0x13f999){const _0x512891=a152_0x211dbd;return _0x43ee38[_0x512891(0x1a0)]===_0x13f999['length']&&_0x43ee38[_0x512891(0x1bf)]((_0x1cc4d8,_0x2e8fac)=>_0x1cc4d8===_0x13f999[_0x2e8fac]);}function readSource(_0x242ac1){const _0xe1ca13=a152_0x211dbd,_0xfc90f1=JSON[_0xe1ca13(0x192)](readFileSync(join(_0x242ac1,'package.json'),_0xe1ca13(0x1b8))),_0x23030f=JSON['parse'](readFileSync(join(_0x242ac1,'skills',_0xe1ca13(0x1c3)),_0xe1ca13(0x1b8))),_0xdf48f6=join(_0x242ac1,_0xe1ca13(0x1ad),SKILL_NAME),_0x4aa148=frontmatterValue(readFileSync(join(_0xdf48f6,_0xe1ca13(0x18a)),_0xe1ca13(0x1b8)),_0xe1ca13(0x1a6)),_0x50c7a5=listFiles(_0xdf48f6);if(_0x23030f['schemaVersion']!==0x1||_0x23030f[_0xe1ca13(0x1ac)]!==SKILL_NAME||!_0xfc90f1['version']||_0x23030f['packageVersion']!==_0xfc90f1[_0xe1ca13(0x1a6)]||_0x23030f[_0xe1ca13(0x19b)]!==_0xfc90f1[_0xe1ca13(0x1a6)]||_0x4aa148!==_0xfc90f1[_0xe1ca13(0x1a6)]||!sameFiles(_0x50c7a5,_0x23030f[_0xe1ca13(0x1b3)])||digestFiles(_0xdf48f6,_0x50c7a5)!==_0x23030f['digest'])throw new Error(_0xe1ca13(0x189));return{'packageVersion':_0xfc90f1[_0xe1ca13(0x1a6)],'skillVersion':_0x4aa148,'root':_0xdf48f6,'manifest':_0x23030f};}function installedSkillPath(_0x2b9143){const _0x248c66=a152_0x211dbd,_0x108810=resolveInstalledSkill(SKILL_NAME,{'home':_0x2b9143});if(_0x108810[_0x248c66(0x1cd)]===_0x248c66(0x194))return{'state':_0x248c66(0x194),'path':dirname(_0x108810[_0x248c66(0x1c2)])};if(_0x108810[_0x248c66(0x1cd)]===_0x248c66(0x1c6))return{'state':_0x248c66(0x1a4)};return{'state':_0x248c66(0x195),'reason':_0x108810[_0x248c66(0x1c9)]};}function a152_0x2f72(){const _0x2ea889=['INSTALL_FAILED','Unsupported\x20Skill\x20entry:\x20','packageRoot','1644pQdkSj','parse','SOURCE_INVALID','present','unverifiable','split','756573TzPZBi','count','1694cGfXGy','isFile','skillVersion','Installed\x20Skill\x20state\x20is\x20','join','Symbolic\x20link\x20is\x20not\x20allowed:\x20','lovrabet','length','log','36niwQUx','message','missing','flatMap','version','installedPath','update','root','output','12yxajGq','name','skills','packageVersion','isDirectory','content_mismatch','935324sDQIMU','unknown','files','manifest','stdio','\x20verified;\x20','CLI\x20Built-in\x20Skill\x20','utf8','7fdBLhM','startsWith','version_mismatch','561740DFjcfH','2919016EhieUn','partialFailure','every','171uyjttI','Installer\x20reported\x20partial\x20target\x20failures:\x0a%s','path','lovrabet.manifest.json','Unsafe\x20manifest\x20path:\x20','lovrabet-skills','absent','hex','\x20automatically\x20selected\x20installation\x20target(s)\x20could\x20not\x20be\x20installed.','reason','sort','isSymbolicLink','VERIFY_FAILED','state','digest','includes','current','home','Built-in\x20Skill\x20source\x20does\x20not\x20match\x20its\x20package\x20manifest','SKILL.md','984680FykKjR','skipped','59268ffdevP'];a152_0x2f72=function(){return _0x2ea889;};return a152_0x2f72();}export function inspectInstalledBuiltinSkillVersion(_0xd9535a,_0x4579a6={}){const _0x9a606c=a152_0x211dbd,_0x13e7c1=installedSkillPath(_0x4579a6[_0x9a606c(0x188)]??homedir());if(_0x13e7c1[_0x9a606c(0x1cd)]===_0x9a606c(0x1a4))return{'state':_0x9a606c(0x1a4),'expectedVersion':_0xd9535a,'repairCommand':REPAIR_COMMAND};if(_0x13e7c1[_0x9a606c(0x1cd)]==='unverifiable')return{'state':_0x9a606c(0x195),'expectedVersion':_0xd9535a,'reason':_0x13e7c1[_0x9a606c(0x1c9)],'repairCommand':REPAIR_COMMAND};try{const _0x37d8c2=frontmatterValue(readFileSync(join(_0x13e7c1[_0x9a606c(0x1c2)],_0x9a606c(0x18a)),_0x9a606c(0x1b8)),_0x9a606c(0x1a6));return{'state':_0x37d8c2===_0xd9535a?_0x9a606c(0x187):_0x9a606c(0x1bb),'expectedVersion':_0xd9535a,'skillVersion':_0x37d8c2,'installedPath':_0x13e7c1['path'],'repairCommand':REPAIR_COMMAND};}catch(_0x3c71b4){return{'state':'unverifiable','expectedVersion':_0xd9535a,'installedPath':_0x13e7c1[_0x9a606c(0x1c2)],'reason':_0x3c71b4 instanceof Error?_0x3c71b4[_0x9a606c(0x1a3)]:String(_0x3c71b4),'repairCommand':REPAIR_COMMAND};}}export function inspectBuiltinSkill(_0x310fa7={}){const _0x196fe5=a152_0x211dbd,_0x5e7a1c=_0x310fa7['packageRoot']??DEFAULT_PACKAGE_ROOT;let _0x32c0aa;try{_0x32c0aa=readSource(_0x5e7a1c);}catch(_0x5734fb){return{'state':_0x196fe5(0x195),'packageVersion':_0x196fe5(0x1b2),'reason':_0x5734fb instanceof Error?_0x5734fb['message']:String(_0x5734fb),'repairCommand':REPAIR_COMMAND};}const _0x36ecf3=installedSkillPath(_0x310fa7[_0x196fe5(0x188)]??homedir());if(_0x36ecf3[_0x196fe5(0x1cd)]===_0x196fe5(0x1a4))return{'state':'missing','packageVersion':_0x32c0aa[_0x196fe5(0x1ae)],'repairCommand':REPAIR_COMMAND};if(_0x36ecf3[_0x196fe5(0x1cd)]===_0x196fe5(0x195))return{'state':_0x196fe5(0x195),'packageVersion':_0x32c0aa['packageVersion'],'reason':_0x36ecf3[_0x196fe5(0x1c9)],'repairCommand':REPAIR_COMMAND};try{const _0x2a585c=frontmatterValue(readFileSync(join(_0x36ecf3[_0x196fe5(0x1c2)],_0x196fe5(0x18a)),_0x196fe5(0x1b8)),'version');if(_0x2a585c!==_0x32c0aa[_0x196fe5(0x19b)])return{'state':_0x196fe5(0x1bb),'packageVersion':_0x32c0aa[_0x196fe5(0x1ae)],'skillVersion':_0x2a585c,'installedPath':_0x36ecf3[_0x196fe5(0x1c2)],'repairCommand':REPAIR_COMMAND};const _0x2f16c7=listFiles(_0x36ecf3[_0x196fe5(0x1c2)]),_0xc24efb=digestFiles(_0x36ecf3[_0x196fe5(0x1c2)],_0x2f16c7);return{'state':sameFiles(_0x2f16c7,_0x32c0aa[_0x196fe5(0x1b4)][_0x196fe5(0x1b3)])&&_0xc24efb===_0x32c0aa[_0x196fe5(0x1b4)][_0x196fe5(0x1ce)]?_0x196fe5(0x187):_0x196fe5(0x1b0),'packageVersion':_0x32c0aa[_0x196fe5(0x1ae)],'skillVersion':_0x2a585c,'installedPath':_0x36ecf3[_0x196fe5(0x1c2)],'digest':_0xc24efb,'repairCommand':REPAIR_COMMAND};}catch(_0x4e063c){return{'state':_0x196fe5(0x195),'packageVersion':_0x32c0aa[_0x196fe5(0x1ae)],'installedPath':_0x36ecf3['path'],'reason':_0x4e063c instanceof Error?_0x4e063c['message']:String(_0x4e063c),'repairCommand':REPAIR_COMMAND};}}function failure(_0x205146,_0x314123,_0x4e8b85,_0x186c57){return{'ok':![],'code':_0x205146,'packageVersion':_0x314123['packageVersion'],'skillVersion':_0x314123['skillVersion'],'installedPath':_0x186c57,'changed':![],'repairCommand':REPAIR_COMMAND,'error':_0x4e8b85 instanceof Error?_0x4e8b85['message']:String(_0x4e8b85)};}export function installBuiltinSkill(_0xb50599={}){const _0x4fe777=a152_0x211dbd,_0xcd9ae7=_0xb50599[_0x4fe777(0x190)]??DEFAULT_PACKAGE_ROOT,_0x25c4cf=_0xb50599[_0x4fe777(0x188)]??homedir();let _0x239eb4;try{_0x239eb4=readSource(_0xcd9ae7);}catch(_0x35deb7){return failure(_0x4fe777(0x193),{'packageVersion':'unknown','skillVersion':_0x4fe777(0x1b2)},_0x35deb7);}const _0x446f55=inspectBuiltinSkill({'packageRoot':_0xcd9ae7,'home':_0x25c4cf}),_0x1ec157=runNpxSkillsAddGlobal(_0xcd9ae7,_0x239eb4[_0x4fe777(0x1a9)],{'stdio':_0xb50599[_0x4fe777(0x1b5)]??'pipe','expectedSkillName':SKILL_NAME,'presence':{'home':_0x25c4cf}});if(_0x1ec157[_0x4fe777(0x18c)])return{'ok':!![],'packageVersion':_0x239eb4[_0x4fe777(0x1ae)],'skillVersion':_0x239eb4['skillVersion'],'installedPath':_0x446f55[_0x4fe777(0x1a7)],'changed':![],'repairCommand':REPAIR_COMMAND};if(!_0x1ec157['ok'])return failure(_0x4fe777(0x18e),_0x239eb4,_0x1ec157['error']??'skills@latest\x20exited\x20'+_0x1ec157['status']);const _0x3362d0=inspectBuiltinSkill({'packageRoot':_0xcd9ae7,'home':_0x25c4cf});if(_0x3362d0[_0x4fe777(0x1cd)]!==_0x4fe777(0x187)){const _0x52ac4e=_0x3362d0[_0x4fe777(0x1c9)]??_0x4fe777(0x19c)+_0x3362d0[_0x4fe777(0x1cd)];return failure(_0x4fe777(0x1cc),_0x239eb4,_0x1ec157['partialFailure']?_0x52ac4e+'\x0a'+_0x1ec157[_0x4fe777(0x1be)][_0x4fe777(0x1aa)]:_0x52ac4e,_0x3362d0[_0x4fe777(0x1a7)]);}return _0x1ec157[_0x4fe777(0x1be)]&&(debug(_0x4fe777(0x1c1),_0x1ec157['partialFailure'][_0x4fe777(0x1aa)]),console[_0x4fe777(0x1a1)](_0x4fe777(0x1b7)+_0x239eb4['skillVersion']+_0x4fe777(0x1b6)+_0x1ec157[_0x4fe777(0x1be)][_0x4fe777(0x198)]+_0x4fe777(0x1c8))),{'ok':!![],'packageVersion':_0x239eb4['packageVersion'],'skillVersion':_0x239eb4[_0x4fe777(0x19b)],'installedPath':_0x3362d0[_0x4fe777(0x1a7)],'changed':_0x446f55[_0x4fe777(0x1cd)]!==_0x4fe777(0x187),'repairCommand':REPAIR_COMMAND};}
1
+ const a152_0xb79467=a152_0x4c42;(function(_0x55ff5b,_0x3a7572){const _0x240ebb=a152_0x4c42,_0x5c1099=_0x55ff5b();while(!![]){try{const _0xea0f73=parseInt(_0x240ebb(0x89))/0x1+parseInt(_0x240ebb(0xa6))/0x2+parseInt(_0x240ebb(0x97))/0x3*(parseInt(_0x240ebb(0xb0))/0x4)+parseInt(_0x240ebb(0xb1))/0x5+parseInt(_0x240ebb(0xaa))/0x6*(parseInt(_0x240ebb(0xa5))/0x7)+-parseInt(_0x240ebb(0xbb))/0x8*(parseInt(_0x240ebb(0x9c))/0x9)+-parseInt(_0x240ebb(0xb3))/0xa;if(_0xea0f73===_0x3a7572)break;else _0x5c1099['push'](_0x5c1099['shift']());}catch(_0x39e19d){_0x5c1099['push'](_0x5c1099['shift']());}}}(a152_0x5d70,0x6fd38));import{createHash}from'node:crypto';import{lstatSync,readFileSync,readdirSync}from'node:fs';import{homedir}from'node:os';function a152_0x4c42(_0x3d6124,_0x46bb1e){_0x3d6124=_0x3d6124-0x7e;const _0x5d70ce=a152_0x5d70();let _0x4c42fb=_0x5d70ce[_0x3d6124];return _0x4c42fb;}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='lovrabet\x20cli-skill\x20install',SKILL_NAME=a152_0xb79467(0xa1),debug=debuglog('lovrabet-skills');function frontmatterValue(_0x2ff0a7,_0x3c0acf){const _0x586bf8=a152_0xb79467;return _0x2ff0a7[_0x586bf8(0x87)](new RegExp('^'+_0x3c0acf+_0x586bf8(0xb4),'m'))?.[0x1]?.[_0x586bf8(0xa0)]()??'';}function listFiles(_0x180d51,_0x6252f2=_0x180d51){const _0x3915d5=a152_0xb79467;return readdirSync(_0x6252f2,{'withFileTypes':!![]})[_0x3915d5(0xa7)](_0x116a27=>{const _0x2f0232=_0x3915d5,_0x57be1c=join(_0x6252f2,_0x116a27['name']),_0x548f86=lstatSync(_0x57be1c);if(_0x548f86[_0x2f0232(0x86)]())throw new Error(_0x2f0232(0x8c)+_0x57be1c);if(_0x548f86[_0x2f0232(0x94)]())return listFiles(_0x180d51,_0x57be1c);if(!_0x548f86[_0x2f0232(0x83)]())throw new Error(_0x2f0232(0x8f)+_0x57be1c);return[relative(_0x180d51,_0x57be1c)[_0x2f0232(0xc1)](sep)[_0x2f0232(0x9e)]('/')];})[_0x3915d5(0x8d)]((_0x5b6a19,_0x1002f7)=>_0x5b6a19<_0x1002f7?-0x1:_0x5b6a19>_0x1002f7?0x1:0x0);}function digestFiles(_0x2c6c40,_0x132a35){const _0x2d5c06=a152_0xb79467,_0x16fc2d=createHash(_0x2d5c06(0xae));for(const _0xca6059 of _0x132a35){if(_0xca6059[_0x2d5c06(0xb9)]('/')||_0xca6059[_0x2d5c06(0xc1)]('/')[_0x2d5c06(0x9f)]('..')||_0xca6059[_0x2d5c06(0x9f)]('\x5c'))throw new Error(_0x2d5c06(0xa9)+_0xca6059);_0x16fc2d[_0x2d5c06(0x7e)](_0xca6059),_0x16fc2d[_0x2d5c06(0x7e)]('\x00'),_0x16fc2d[_0x2d5c06(0x7e)](readFileSync(join(_0x2c6c40,..._0xca6059[_0x2d5c06(0xc1)]('/')))),_0x16fc2d['update']('\x00');}return _0x16fc2d[_0x2d5c06(0x9d)](_0x2d5c06(0x92));}function sameFiles(_0x31921d,_0x1dfca4){const _0xe5a542=a152_0xb79467;return _0x31921d[_0xe5a542(0x9a)]===_0x1dfca4[_0xe5a542(0x9a)]&&_0x31921d[_0xe5a542(0x91)]((_0x55d690,_0x4e03db)=>_0x55d690===_0x1dfca4[_0x4e03db]);}function readSource(_0x3a46ea){const _0x315021=a152_0xb79467,_0x3e7b98=JSON[_0x315021(0x88)](readFileSync(join(_0x3a46ea,_0x315021(0xc2)),_0x315021(0x82))),_0x2571c0=JSON[_0x315021(0x88)](readFileSync(join(_0x3a46ea,'skills',_0x315021(0x8a)),_0x315021(0x82))),_0xe46e11=join(_0x3a46ea,_0x315021(0xbd),SKILL_NAME),_0x14793e=frontmatterValue(readFileSync(join(_0xe46e11,_0x315021(0xa2)),_0x315021(0x82)),_0x315021(0x9b)),_0x32bebc=listFiles(_0xe46e11);if(_0x2571c0[_0x315021(0x7f)]!==0x1||_0x2571c0['name']!==SKILL_NAME||!_0x3e7b98[_0x315021(0x9b)]||_0x2571c0['packageVersion']!==_0x3e7b98[_0x315021(0x9b)]||_0x2571c0[_0x315021(0xac)]!==_0x3e7b98['version']||_0x14793e!==_0x3e7b98[_0x315021(0x9b)]||!sameFiles(_0x32bebc,_0x2571c0['files'])||digestFiles(_0xe46e11,_0x32bebc)!==_0x2571c0[_0x315021(0x9d)])throw new Error(_0x315021(0xa4));return{'packageVersion':_0x3e7b98['version'],'skillVersion':_0x14793e,'root':_0xe46e11,'manifest':_0x2571c0};}function installedSkillPath(_0x433693){const _0x1ea4ed=a152_0xb79467,_0x1c13ba=resolveInstalledSkill(SKILL_NAME,{'home':_0x433693});if(_0x1c13ba[_0x1ea4ed(0x98)]==='present')return{'state':'present','path':dirname(_0x1c13ba[_0x1ea4ed(0xad)])};if(_0x1c13ba['state']===_0x1ea4ed(0xb8))return{'state':_0x1ea4ed(0xbc)};return{'state':_0x1ea4ed(0xbf),'reason':_0x1c13ba[_0x1ea4ed(0xb7)]};}export function inspectInstalledBuiltinSkillVersion(_0x5b7f5d,_0x29c3bd={}){const _0x116a94=a152_0xb79467,_0x30b153=installedSkillPath(_0x29c3bd[_0x116a94(0xc0)]??homedir());if(_0x30b153['state']===_0x116a94(0xbc))return{'state':'missing','expectedVersion':_0x5b7f5d,'repairCommand':REPAIR_COMMAND};if(_0x30b153[_0x116a94(0x98)]===_0x116a94(0xbf))return{'state':'unverifiable','expectedVersion':_0x5b7f5d,'reason':_0x30b153[_0x116a94(0xb7)],'repairCommand':REPAIR_COMMAND};try{const _0x295320=frontmatterValue(readFileSync(join(_0x30b153[_0x116a94(0xad)],_0x116a94(0xa2)),_0x116a94(0x82)),_0x116a94(0x9b));return{'state':_0x295320===_0x5b7f5d?_0x116a94(0x93):'version_mismatch','expectedVersion':_0x5b7f5d,'skillVersion':_0x295320,'installedPath':_0x30b153[_0x116a94(0xad)],'repairCommand':REPAIR_COMMAND};}catch(_0x4bca64){return{'state':_0x116a94(0xbf),'expectedVersion':_0x5b7f5d,'installedPath':_0x30b153[_0x116a94(0xad)],'reason':_0x4bca64 instanceof Error?_0x4bca64['message']:String(_0x4bca64),'repairCommand':REPAIR_COMMAND};}}function a152_0x5d70(){const _0x25edf9=['length','version','50859EgaoTp','digest','join','includes','trim','lovrabet','SKILL.md','log','Built-in\x20Skill\x20source\x20does\x20not\x20match\x20its\x20package\x20manifest','28zJHbAH','424168HcDASY','flatMap','status','Unsafe\x20manifest\x20path:\x20','738810xDVnlp','CLI\x20Built-in\x20Skill\x20','skillVersion','path','sha256','message','4MfwhAB','4420315xJZVCo','pipe','21956920oGljfm',':\x5cs*(.+)$','packageVersion','\x20verified;\x20','reason','absent','startsWith','output','56FrwEHB','missing','skills','files','unverifiable','home','split','package.json','partialFailure','Installer\x20reported\x20partial\x20target\x20failures:\x0a%s','manifest','update','schemaVersion','content_mismatch','skipped','utf8','isFile','packageRoot','count','isSymbolicLink','match','parse','824798rjqAuF','lovrabet.manifest.json','installedPath','Symbolic\x20link\x20is\x20not\x20allowed:\x20','sort','VERIFY_FAILED','Unsupported\x20Skill\x20entry:\x20','unknown','every','hex','current','isDirectory','skills@latest\x20exited\x20','version_mismatch','839412NqROcK','state','Installed\x20Skill\x20state\x20is\x20'];a152_0x5d70=function(){return _0x25edf9;};return a152_0x5d70();}export function inspectBuiltinSkill(_0x3c8e20={}){const _0x1bd34b=a152_0xb79467,_0x2a4aa2=_0x3c8e20[_0x1bd34b(0x84)]??DEFAULT_PACKAGE_ROOT;let _0x4f83dc;try{_0x4f83dc=readSource(_0x2a4aa2);}catch(_0x3c2484){return{'state':_0x1bd34b(0xbf),'packageVersion':_0x1bd34b(0x90),'reason':_0x3c2484 instanceof Error?_0x3c2484[_0x1bd34b(0xaf)]:String(_0x3c2484),'repairCommand':REPAIR_COMMAND};}const _0x5ddf54=installedSkillPath(_0x3c8e20[_0x1bd34b(0xc0)]??homedir());if(_0x5ddf54['state']===_0x1bd34b(0xbc))return{'state':_0x1bd34b(0xbc),'packageVersion':_0x4f83dc['packageVersion'],'repairCommand':REPAIR_COMMAND};if(_0x5ddf54[_0x1bd34b(0x98)]===_0x1bd34b(0xbf))return{'state':'unverifiable','packageVersion':_0x4f83dc['packageVersion'],'reason':_0x5ddf54[_0x1bd34b(0xb7)],'repairCommand':REPAIR_COMMAND};try{const _0x28d2f7=frontmatterValue(readFileSync(join(_0x5ddf54['path'],_0x1bd34b(0xa2)),_0x1bd34b(0x82)),'version');if(_0x28d2f7!==_0x4f83dc[_0x1bd34b(0xac)])return{'state':_0x1bd34b(0x96),'packageVersion':_0x4f83dc['packageVersion'],'skillVersion':_0x28d2f7,'installedPath':_0x5ddf54['path'],'repairCommand':REPAIR_COMMAND};const _0x166f79=listFiles(_0x5ddf54[_0x1bd34b(0xad)]),_0x39fed7=digestFiles(_0x5ddf54[_0x1bd34b(0xad)],_0x166f79);return{'state':sameFiles(_0x166f79,_0x4f83dc[_0x1bd34b(0xc5)][_0x1bd34b(0xbe)])&&_0x39fed7===_0x4f83dc[_0x1bd34b(0xc5)][_0x1bd34b(0x9d)]?_0x1bd34b(0x93):_0x1bd34b(0x80),'packageVersion':_0x4f83dc[_0x1bd34b(0xb5)],'skillVersion':_0x28d2f7,'installedPath':_0x5ddf54[_0x1bd34b(0xad)],'digest':_0x39fed7,'repairCommand':REPAIR_COMMAND};}catch(_0xbcb031){return{'state':'unverifiable','packageVersion':_0x4f83dc['packageVersion'],'installedPath':_0x5ddf54['path'],'reason':_0xbcb031 instanceof Error?_0xbcb031[_0x1bd34b(0xaf)]:String(_0xbcb031),'repairCommand':REPAIR_COMMAND};}}function failure(_0x11816f,_0x505399,_0x2ccc76,_0x25e2cb){const _0x599664=a152_0xb79467;return{'ok':![],'code':_0x11816f,'packageVersion':_0x505399[_0x599664(0xb5)],'skillVersion':_0x505399[_0x599664(0xac)],'installedPath':_0x25e2cb,'changed':![],'repairCommand':REPAIR_COMMAND,'error':_0x2ccc76 instanceof Error?_0x2ccc76[_0x599664(0xaf)]:String(_0x2ccc76)};}export function installBuiltinSkill(_0x34b480={}){const _0x1b23bd=a152_0xb79467,_0x3ccf95=_0x34b480[_0x1b23bd(0x84)]??DEFAULT_PACKAGE_ROOT,_0x24a289=_0x34b480[_0x1b23bd(0xc0)]??homedir();let _0x26eeb6;try{_0x26eeb6=readSource(_0x3ccf95);}catch(_0x383a65){return failure('SOURCE_INVALID',{'packageVersion':_0x1b23bd(0x90),'skillVersion':'unknown'},_0x383a65);}const _0x3d71e3=inspectBuiltinSkill({'packageRoot':_0x3ccf95,'home':_0x24a289}),_0x31ec75=runNpxSkillsAddGlobal(_0x3ccf95,_0x26eeb6['root'],{'stdio':_0x34b480['stdio']??_0x1b23bd(0xb2),'expectedSkillName':SKILL_NAME,'presence':{'home':_0x24a289}});if(_0x31ec75[_0x1b23bd(0x81)])return{'ok':!![],'packageVersion':_0x26eeb6[_0x1b23bd(0xb5)],'skillVersion':_0x26eeb6['skillVersion'],'installedPath':_0x3d71e3[_0x1b23bd(0x8b)],'changed':![],'repairCommand':REPAIR_COMMAND};if(!_0x31ec75['ok'])return failure('INSTALL_FAILED',_0x26eeb6,_0x31ec75['error']??_0x1b23bd(0x95)+_0x31ec75[_0x1b23bd(0xa8)]);const _0x466db4=inspectBuiltinSkill({'packageRoot':_0x3ccf95,'home':_0x24a289});if(_0x466db4[_0x1b23bd(0x98)]!=='current'){const _0x329d28=_0x466db4['reason']??_0x1b23bd(0x99)+_0x466db4[_0x1b23bd(0x98)];return failure(_0x1b23bd(0x8e),_0x26eeb6,_0x31ec75['partialFailure']?_0x329d28+'\x0a'+_0x31ec75[_0x1b23bd(0xc3)]['output']:_0x329d28,_0x466db4[_0x1b23bd(0x8b)]);}return _0x31ec75[_0x1b23bd(0xc3)]&&(debug(_0x1b23bd(0xc4),_0x31ec75[_0x1b23bd(0xc3)][_0x1b23bd(0xba)]),console[_0x1b23bd(0xa3)](_0x1b23bd(0xab)+_0x26eeb6[_0x1b23bd(0xac)]+_0x1b23bd(0xb6)+_0x31ec75['partialFailure'][_0x1b23bd(0x85)]+'\x20automatically\x20selected\x20installation\x20target(s)\x20could\x20not\x20be\x20installed.')),{'ok':!![],'packageVersion':_0x26eeb6[_0x1b23bd(0xb5)],'skillVersion':_0x26eeb6[_0x1b23bd(0xac)],'installedPath':_0x466db4[_0x1b23bd(0x8b)],'changed':_0x3d71e3[_0x1b23bd(0x98)]!==_0x1b23bd(0x93),'repairCommand':REPAIR_COMMAND};}
@@ -1 +1 @@
1
- const a153_0x78fc9c=a153_0x3679;(function(_0xbd632e,_0x1a5235){const _0xdd9625=a153_0x3679,_0xc5d90=_0xbd632e();while(!![]){try{const _0xb7a02f=parseInt(_0xdd9625(0x90))/0x1*(-parseInt(_0xdd9625(0x9a))/0x2)+-parseInt(_0xdd9625(0x86))/0x3+parseInt(_0xdd9625(0xad))/0x4*(-parseInt(_0xdd9625(0xa1))/0x5)+-parseInt(_0xdd9625(0x8a))/0x6+parseInt(_0xdd9625(0x9b))/0x7+-parseInt(_0xdd9625(0xab))/0x8+parseInt(_0xdd9625(0xb1))/0x9*(parseInt(_0xdd9625(0xa7))/0xa);if(_0xb7a02f===_0x1a5235)break;else _0xc5d90['push'](_0xc5d90['shift']());}catch(_0x3effb6){_0xc5d90['push'](_0xc5d90['shift']());}}}(a153_0x16fd,0xbfa7a));import{execaSync}from'execa';import{LOVRABET_SKILL_SOURCE as a153_0x40e272}from'../constant/distribution.js';import{PRODUCT_CONFIG,productEnvName}from'../constant/product.js';function a153_0x16fd(){const _0x5e552c=['npx','npm_config_global','ENOENT','present','pipe','\x22\x20install\x20state:\x20','shortMessage','absent','skipNpxSkillsEnvSuffix','374133TeSKKm','\x20failed\x20target(s)','state','reason','6445020EPKUgr','CHILD_TERMINATED','stdio','exitCode','unverifiable','Skill\x20\x22','1387lYhrLH','EACCES','Installer\x20reported\x20','stderr','filter','expectedSkillName','\x22\x20not\x20found\x20after\x20install\x20(checked\x20','SKILL_NOT_INSTALLED','failed','stdout','502hWUNqX','7886312pQYuVk','warn','signal','presence','internalSkillSource','CHILD_EXIT_NONZERO','5gXjcdw','message','partialFailure','checked','globalSkillName','SPAWN_FAILED','4420ogrXtb','add','trim','!\x20Could\x20not\x20verify\x20\x22','8845776ryLIRg','skills@latest','2738936hJuWQD','INSTALL_PARTIAL','npx\x20terminated\x20by\x20signal\x20','code','61002fYQrsp'];a153_0x16fd=function(){return _0x5e552c;};return a153_0x16fd();}import{resolveInstalledSkill}from'../skills/skill-presence.js';export const LOVRABET_SKILL_SOURCE=a153_0x40e272;export const LOVRABET_SKILL_GIT_SOURCE=PRODUCT_CONFIG[a153_0x78fc9c(0x9f)];function a153_0x3679(_0x27d04f,_0x4a4cf8){_0x27d04f=_0x27d04f-0x80;const _0x16fdcf=a153_0x16fd();let _0x3679fb=_0x16fdcf[_0x27d04f];return _0x3679fb;}export const LOVRABET_GLOBAL_SKILL_NAME=PRODUCT_CONFIG[a153_0x78fc9c(0xa5)];export function resolveGlobalSkillName(_0x191259){const _0x55a643=a153_0x78fc9c;switch(_0x191259[_0x55a643(0xa9)]()){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[a153_0x78fc9c(0x85)]);const CHILD_OUTPUT_MAX_BUFFER=0x10*0x400*0x400;function failure(_0x26a695,_0x2aee7a,_0x309558){return{'ok':![],'status':_0x2aee7a,'code':_0x26a695,'error':'['+_0x26a695+']\x20'+_0x309558};}export function shouldSkipNpxSkillsAdd(){return process.env[LOVRABET_SKIP_NPX_SKILLS_ENV]==='1';}export function runNpxSkillsAddGlobal(_0x1f2782,_0x5b2980=LOVRABET_SKILL_SOURCE,_0x22121f){const _0x3d6373=a153_0x78fc9c;if(shouldSkipNpxSkillsAdd())return{'ok':!![],'status':0x0,'skipped':!![]};const _0x4b43c5=['-y',_0x3d6373(0xac),_0x3d6373(0xa8),_0x5b2980,'-g','-y'],_0x4c76c8=['npx',..._0x4b43c5]['join']('\x20');console['log']('*\x20'+_0x4c76c8);const _0x213707={...process.env};delete _0x213707[_0x3d6373(0xb3)],delete _0x213707['NPM_CONFIG_GLOBAL'];const _0x26c3d7=execaSync(_0x3d6373(0xb2),_0x4b43c5,{'cwd':_0x1f2782,'stdio':_0x3d6373(0x81),'env':_0x213707,'extendEnv':![],'shell':![],'reject':![],'maxBuffer':CHILD_OUTPUT_MAX_BUFFER}),_0x959b1f=[_0x26c3d7[_0x3d6373(0x99)]?String(_0x26c3d7[_0x3d6373(0x99)]):'',_0x26c3d7[_0x3d6373(0x93)]?String(_0x26c3d7['stderr']):''][_0x3d6373(0x94)](Boolean)['join']('\x0a')[_0x3d6373(0xa9)](),_0x4a1313=_0x26c3d7[_0x3d6373(0x8d)]??null,_0x494f10=_0x5a8390=>{const _0x3d5c5a=_0x3d6373;return _0x22121f?.[_0x3d5c5a(0x8c)]!=='pipe'&&!_0x5a8390[_0x3d5c5a(0xa3)]&&_0x959b1f&&console['log'](_0x959b1f),_0x5a8390;};if(_0x26c3d7[_0x3d6373(0xb0)]){const _0x55ec75=_0x26c3d7[_0x3d6373(0xb0)]===_0x3d6373(0xb4)?'NPX_NOT_FOUND':_0x26c3d7[_0x3d6373(0xb0)]==='EPERM'||_0x26c3d7[_0x3d6373(0xb0)]===_0x3d6373(0x91)?'PERMISSION_DENIED':'SPAWN_FAILED';return _0x494f10(failure(_0x55ec75,_0x4a1313,_0x26c3d7[_0x3d6373(0x83)]??_0x26c3d7['message']??_0x26c3d7['code']));}if(_0x26c3d7[_0x3d6373(0x9d)])return _0x494f10(failure(_0x3d6373(0x8b),_0x4a1313,_0x3d6373(0xaf)+_0x26c3d7[_0x3d6373(0x9d)]));if(_0x26c3d7[_0x3d6373(0x98)]&&_0x4a1313===null)return _0x494f10(failure(_0x3d6373(0xa6),_0x4a1313,_0x26c3d7[_0x3d6373(0x83)]??_0x26c3d7[_0x3d6373(0xa2)]??'npx\x20failed\x20to\x20start'));if(_0x4a1313!==0x0)return _0x494f10(failure(_0x3d6373(0xa0),_0x4a1313,_0x959b1f||_0x26c3d7['shortMessage']||'exit\x20'+(_0x4a1313??'unknown')));const _0x46accd=_0x22121f?.[_0x3d6373(0x95)]??resolveGlobalSkillName(_0x5b2980),_0x48eea6=_0x46accd?resolveInstalledSkill(_0x46accd,_0x22121f?.[_0x3d6373(0x9e)]):undefined,_0x4bed6e=_0x959b1f['match'](/Failed to install\s+(\d+)/i);if(_0x4bed6e&&Number(_0x4bed6e[0x1])>0x0){const _0x5051b9=_0x3d6373(0x92)+_0x4bed6e[0x1]+_0x3d6373(0x87)+(_0x959b1f?':\x0a'+_0x959b1f:'');if(_0x48eea6?.['state']===_0x3d6373(0x80))return{'ok':!![],'status':0x0,'partialFailure':{'count':Number(_0x4bed6e[0x1]),'output':_0x959b1f}};return _0x494f10(failure(_0x3d6373(0xae),0x0,_0x5051b9));}if(_0x46accd&&_0x48eea6){if(_0x48eea6['state']===_0x3d6373(0x84))return _0x494f10(failure(_0x3d6373(0x97),0x0,_0x3d6373(0x8f)+_0x46accd+_0x3d6373(0x96)+_0x48eea6[_0x3d6373(0xa4)]['join'](',\x20')+')'));_0x48eea6[_0x3d6373(0x88)]===_0x3d6373(0x8e)&&console[_0x3d6373(0x9c)](_0x3d6373(0xaa)+_0x46accd+_0x3d6373(0x82)+_0x48eea6[_0x3d6373(0x89)]);}return _0x494f10({'ok':!![],'status':0x0});}
1
+ const a153_0x2c9c39=a153_0x23d6;(function(_0x513ed7,_0x37cd61){const _0x32e515=a153_0x23d6,_0x373b55=_0x513ed7();while(!![]){try{const _0x46499f=parseInt(_0x32e515(0x101))/0x1+-parseInt(_0x32e515(0xe4))/0x2+-parseInt(_0x32e515(0xdd))/0x3*(parseInt(_0x32e515(0xfa))/0x4)+parseInt(_0x32e515(0xdb))/0x5*(-parseInt(_0x32e515(0xd5))/0x6)+parseInt(_0x32e515(0xd1))/0x7+-parseInt(_0x32e515(0xdc))/0x8+parseInt(_0x32e515(0xe5))/0x9;if(_0x46499f===_0x37cd61)break;else _0x373b55['push'](_0x373b55['shift']());}catch(_0x1c1aca){_0x373b55['push'](_0x373b55['shift']());}}}(a153_0x5d18,0x796c8));import{execaSync}from'execa';function a153_0x23d6(_0x52538f,_0x27325f){_0x52538f=_0x52538f-0xce;const _0x5d1847=a153_0x5d18();let _0x23d6ee=_0x5d1847[_0x52538f];return _0x23d6ee;}import{LOVRABET_SKILL_SOURCE as a153_0x459203}from'../constant/distribution.js';import{PRODUCT_CONFIG,productEnvName}from'../constant/product.js';import{resolveInstalledSkill}from'../skills/skill-presence.js';export const LOVRABET_SKILL_SOURCE=a153_0x459203;export const LOVRABET_SKILL_GIT_SOURCE=PRODUCT_CONFIG[a153_0x2c9c39(0xfd)];export const LOVRABET_GLOBAL_SKILL_NAME=PRODUCT_CONFIG[a153_0x2c9c39(0xe3)];export function resolveGlobalSkillName(_0x1109ff){const _0x4a5b06=a153_0x2c9c39;switch(_0x1109ff[_0x4a5b06(0xea)]()){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['skipNpxSkillsEnvSuffix']);const CHILD_OUTPUT_MAX_BUFFER=0x10*0x400*0x400;function failure(_0xc3bde6,_0x4fc10d,_0xcd3232){return{'ok':![],'status':_0x4fc10d,'code':_0xc3bde6,'error':'['+_0xc3bde6+']\x20'+_0xcd3232};}export function shouldSkipNpxSkillsAdd(){return process.env[LOVRABET_SKIP_NPX_SKILLS_ENV]==='1';}function a153_0x5d18(){const _0x263eb6=['code','unverifiable','EPERM','stderr','Skill\x20\x22','SKILL_NOT_INSTALLED','pipe','npx\x20terminated\x20by\x20signal\x20','PERMISSION_DENIED','reason','Installer\x20reported\x20','stdio','4pkBGVH','npx','CHILD_TERMINATED','internalSkillSource','SPAWN_FAILED','partialFailure','unknown','123657HpgZLl','skills@latest','exitCode','npm_config_global','warn','4960578BXOFxQ','log','!\x20Could\x20not\x20verify\x20\x22','message','87798qSxYBP','absent','match','checked','stdout','EACCES','215cSxegP','3884256zNyfqV','2913261wohjFE','shortMessage','\x20failed\x20target(s)','signal','INSTALL_PARTIAL','join','globalSkillName','1544688fjfXnw','22709007rsprzr','presence','expectedSkillName','state','ENOENT','trim','failed','NPX_NOT_FOUND','\x22\x20not\x20found\x20after\x20install\x20(checked\x20'];a153_0x5d18=function(){return _0x263eb6;};return a153_0x5d18();}export function runNpxSkillsAddGlobal(_0x2e2e3e,_0x15d379=LOVRABET_SKILL_SOURCE,_0x2e1b53){const _0x1f2d47=a153_0x2c9c39;if(shouldSkipNpxSkillsAdd())return{'ok':!![],'status':0x0,'skipped':!![]};const _0x1bc226=['-y',_0x1f2d47(0x102),'add',_0x15d379,'-g','-y'],_0x172fa9=['npx',..._0x1bc226]['join']('\x20');console[_0x1f2d47(0xd2)]('*\x20'+_0x172fa9);const _0x35d94d={...process.env};delete _0x35d94d[_0x1f2d47(0xcf)],delete _0x35d94d['NPM_CONFIG_GLOBAL'];const _0x152f2a=execaSync(_0x1f2d47(0xfb),_0x1bc226,{'cwd':_0x2e2e3e,'stdio':_0x1f2d47(0xf4),'env':_0x35d94d,'extendEnv':![],'shell':![],'reject':![],'maxBuffer':CHILD_OUTPUT_MAX_BUFFER}),_0x18f5fd=[_0x152f2a[_0x1f2d47(0xd9)]?String(_0x152f2a[_0x1f2d47(0xd9)]):'',_0x152f2a[_0x1f2d47(0xf1)]?String(_0x152f2a[_0x1f2d47(0xf1)]):'']['filter'](Boolean)[_0x1f2d47(0xe2)]('\x0a')[_0x1f2d47(0xea)](),_0xe0f11c=_0x152f2a[_0x1f2d47(0xce)]??null,_0x49b33a=_0x51d396=>{const _0x45aa9d=_0x1f2d47;return _0x2e1b53?.[_0x45aa9d(0xf9)]!==_0x45aa9d(0xf4)&&!_0x51d396[_0x45aa9d(0xff)]&&_0x18f5fd&&console['log'](_0x18f5fd),_0x51d396;};if(_0x152f2a['code']){const _0x2003ea=_0x152f2a[_0x1f2d47(0xee)]===_0x1f2d47(0xe9)?_0x1f2d47(0xec):_0x152f2a['code']===_0x1f2d47(0xf0)||_0x152f2a[_0x1f2d47(0xee)]===_0x1f2d47(0xda)?_0x1f2d47(0xf6):_0x1f2d47(0xfe);return _0x49b33a(failure(_0x2003ea,_0xe0f11c,_0x152f2a[_0x1f2d47(0xde)]??_0x152f2a[_0x1f2d47(0xd4)]??_0x152f2a['code']));}if(_0x152f2a[_0x1f2d47(0xe0)])return _0x49b33a(failure(_0x1f2d47(0xfc),_0xe0f11c,_0x1f2d47(0xf5)+_0x152f2a['signal']));if(_0x152f2a[_0x1f2d47(0xeb)]&&_0xe0f11c===null)return _0x49b33a(failure(_0x1f2d47(0xfe),_0xe0f11c,_0x152f2a[_0x1f2d47(0xde)]??_0x152f2a[_0x1f2d47(0xd4)]??'npx\x20failed\x20to\x20start'));if(_0xe0f11c!==0x0)return _0x49b33a(failure('CHILD_EXIT_NONZERO',_0xe0f11c,_0x18f5fd||_0x152f2a[_0x1f2d47(0xde)]||'exit\x20'+(_0xe0f11c??_0x1f2d47(0x100))));const _0x476008=_0x2e1b53?.[_0x1f2d47(0xe7)]??resolveGlobalSkillName(_0x15d379),_0x5c1551=_0x476008?resolveInstalledSkill(_0x476008,_0x2e1b53?.[_0x1f2d47(0xe6)]):undefined,_0x55e3ad=_0x18f5fd[_0x1f2d47(0xd7)](/Failed to install\s+(\d+)/i);if(_0x55e3ad&&Number(_0x55e3ad[0x1])>0x0){const _0x4319f2=_0x1f2d47(0xf8)+_0x55e3ad[0x1]+_0x1f2d47(0xdf)+(_0x18f5fd?':\x0a'+_0x18f5fd:'');if(_0x5c1551?.[_0x1f2d47(0xe8)]==='present')return{'ok':!![],'status':0x0,'partialFailure':{'count':Number(_0x55e3ad[0x1]),'output':_0x18f5fd}};return _0x49b33a(failure(_0x1f2d47(0xe1),0x0,_0x4319f2));}if(_0x476008&&_0x5c1551){if(_0x5c1551[_0x1f2d47(0xe8)]===_0x1f2d47(0xd6))return _0x49b33a(failure(_0x1f2d47(0xf3),0x0,_0x1f2d47(0xf2)+_0x476008+_0x1f2d47(0xed)+_0x5c1551[_0x1f2d47(0xd8)]['join'](',\x20')+')'));_0x5c1551[_0x1f2d47(0xe8)]===_0x1f2d47(0xef)&&console[_0x1f2d47(0xd0)](_0x1f2d47(0xd3)+_0x476008+'\x22\x20install\x20state:\x20'+_0x5c1551[_0x1f2d47(0xf7)]);}return _0x49b33a({'ok':!![],'status':0x0});}
@@ -1 +1 @@
1
- const a154_0xf4cfad=a154_0x368c;function a154_0x368c(_0x226d10,_0x692bfa){_0x226d10=_0x226d10-0x18f;const _0x568a05=a154_0x568a();let _0x368c99=_0x568a05[_0x226d10];return _0x368c99;}function a154_0x568a(){const _0x3d3502=['build','2534auWYsH','1784emropp','55668EhkJUU','3827560bofcDQ','.hg','126547RNOAtc','3312bBsStq','6gsEYcH','.git','471951bnphdc','.turbo','2045mNIFOt','lovrabet.skill.json','.svn','2030215JtHkAz','8DWaqYW','.cache','SKILL.md','coverage','12COfIqQ'];a154_0x568a=function(){return _0x3d3502;};return a154_0x568a();}(function(_0x1fb6fc,_0x2c707a){const _0x4cce6e=a154_0x368c,_0xc6bedf=_0x1fb6fc();while(!![]){try{const _0x576cf8=parseInt(_0x4cce6e(0x19c))/0x1*(parseInt(_0x4cce6e(0x19e))/0x2)+-parseInt(_0x4cce6e(0x199))/0x3+parseInt(_0x4cce6e(0x198))/0x4*(-parseInt(_0x4cce6e(0x1a2))/0x5)+-parseInt(_0x4cce6e(0x19d))/0x6*(parseInt(_0x4cce6e(0x197))/0x7)+parseInt(_0x4cce6e(0x191))/0x8*(parseInt(_0x4cce6e(0x1a0))/0x9)+parseInt(_0x4cce6e(0x19a))/0xa+-parseInt(_0x4cce6e(0x190))/0xb*(parseInt(_0x4cce6e(0x195))/0xc);if(_0x576cf8===_0x2c707a)break;else _0xc6bedf['push'](_0xc6bedf['shift']());}catch(_0x203584){_0xc6bedf['push'](_0xc6bedf['shift']());}}}(a154_0x568a,0x38065));export const METADATA_FILE=a154_0xf4cfad(0x1a3);export const SKILL_FILE=a154_0xf4cfad(0x193);export const IGNORED_FILE_NAMES=new Set([METADATA_FILE,'.DS_Store']);export const IGNORED_DIR_NAMES=new Set([a154_0xf4cfad(0x19f),a154_0xf4cfad(0x19b),a154_0xf4cfad(0x18f),'node_modules','.next','dist',a154_0xf4cfad(0x196),a154_0xf4cfad(0x194),a154_0xf4cfad(0x1a1),a154_0xf4cfad(0x192)]);
1
+ const a154_0x3c4ab2=a154_0x3e36;(function(_0x29543f,_0x340bf3){const _0x55bc23=a154_0x3e36,_0x2beafe=_0x29543f();while(!![]){try{const _0x2068f8=parseInt(_0x55bc23(0x1c9))/0x1+parseInt(_0x55bc23(0x1cc))/0x2+-parseInt(_0x55bc23(0x1c2))/0x3+-parseInt(_0x55bc23(0x1c1))/0x4+parseInt(_0x55bc23(0x1c0))/0x5+parseInt(_0x55bc23(0x1ca))/0x6*(parseInt(_0x55bc23(0x1c6))/0x7)+-parseInt(_0x55bc23(0x1cd))/0x8;if(_0x2068f8===_0x340bf3)break;else _0x2beafe['push'](_0x2beafe['shift']());}catch(_0x44305f){_0x2beafe['push'](_0x2beafe['shift']());}}}(a154_0x2fd5,0x711a9));function a154_0x3e36(_0x597e34,_0x39c5e0){_0x597e34=_0x597e34-0x1c0;const _0x2fd5cb=a154_0x2fd5();let _0x3e361a=_0x2fd5cb[_0x597e34];return _0x3e361a;}function a154_0x2fd5(){const _0x45b543=['1516848AtDoaI','2980032fWbRuz','dist','.svn','SKILL.md','11565XWbHyp','1134592oLWejW','2075934TImjvr','.next','.DS_Store','.turbo','56bMHOtA','.git','node_modules','621194ZdaxXp','322104muSMXs','.hg'];a154_0x2fd5=function(){return _0x45b543;};return a154_0x2fd5();}export const METADATA_FILE='lovrabet.skill.json';export const SKILL_FILE=a154_0x3c4ab2(0x1d0);export const IGNORED_FILE_NAMES=new Set([METADATA_FILE,a154_0x3c4ab2(0x1c4)]);export const IGNORED_DIR_NAMES=new Set([a154_0x3c4ab2(0x1c7),a154_0x3c4ab2(0x1cb),a154_0x3c4ab2(0x1cf),a154_0x3c4ab2(0x1c8),a154_0x3c4ab2(0x1c3),a154_0x3c4ab2(0x1ce),'build','coverage',a154_0x3c4ab2(0x1c5),'.cache']);
@@ -1 +1 @@
1
- (function(_0x3d6b09,_0x4186bc){const _0x380db0=a155_0x5d7c,_0x32a4e7=_0x3d6b09();while(!![]){try{const _0x122fe2=-parseInt(_0x380db0(0x7d))/0x1*(parseInt(_0x380db0(0x7c))/0x2)+parseInt(_0x380db0(0x78))/0x3*(-parseInt(_0x380db0(0x6d))/0x4)+-parseInt(_0x380db0(0x77))/0x5*(-parseInt(_0x380db0(0x71))/0x6)+parseInt(_0x380db0(0x79))/0x7+-parseInt(_0x380db0(0x7a))/0x8+parseInt(_0x380db0(0x72))/0x9*(parseInt(_0x380db0(0x76))/0xa)+-parseInt(_0x380db0(0x7b))/0xb*(-parseInt(_0x380db0(0x73))/0xc);if(_0x122fe2===_0x4186bc)break;else _0x32a4e7['push'](_0x32a4e7['shift']());}catch(_0x2e1c82){_0x32a4e7['push'](_0x32a4e7['shift']());}}}(a155_0x58e3,0xa0a40));import{lstatSync,readlinkSync,realpathSync,renameSync,rmSync,writeFileSync}from'node:fs';import{dirname,isAbsolute,resolve,sep}from'node:path';function a155_0x5d7c(_0x4c533a,_0x25a5a3){_0x4c533a=_0x4c533a-0x6d;const _0x58e337=a155_0x58e3();let _0x5d7c1c=_0x58e337[_0x4c533a];return _0x5d7c1c;}import{CliErrors}from'../../errors.js';import{normalizeSkillRelativePath}from'./local-files.js';export function resolveManagedFilePath(_0x21e413,_0x2fa14c){const _0x3bc316=a155_0x5d7c,_0x38c2a7=normalizeSkillRelativePath(_0x2fa14c),_0x122293=realOrResolved(_0x21e413),_0x263edd=resolve(_0x122293,..._0x38c2a7[_0x3bc316(0x80)]('/'));if(!isPathInside(_0x263edd,_0x122293))throw CliErrors[_0x3bc316(0x6e)]('Unsafe\x20Skill\x20file\x20path:\x20'+_0x2fa14c);return ensureNoSymlinkInManagedPath(_0x122293,_0x38c2a7),_0x263edd;}export function ensureNoSymlinkInManagedPath(_0x17d661,_0x115e5c){const _0x15986c=a155_0x5d7c;let _0x4ebae6=_0x17d661;for(const _0x4d256c of _0x115e5c[_0x15986c(0x80)]('/')){_0x4ebae6=resolve(_0x4ebae6,_0x4d256c);const _0x8399f2=lstatIfPresent(_0x4ebae6);if(_0x8399f2?.['isSymbolicLink']())throw CliErrors[_0x15986c(0x6e)](_0x15986c(0x75)+_0x115e5c);}}export function isDanglingSymlink(_0x2c0bd7){const _0x132814=a155_0x5d7c;try{return lstatSync(_0x2c0bd7)[_0x132814(0x70)]();}catch{return![];}}export function resolveSymlinkTarget(_0x487b4c){const _0x2a7933=readlinkSync(_0x487b4c);return isAbsolute(_0x2a7933)?_0x2a7933:resolve(dirname(_0x487b4c),_0x2a7933);}export function isPathInside(_0x545561,_0x472187){const _0x58db5b=a155_0x5d7c,_0x2be1ee=_0x545561[_0x58db5b(0x7f)](sep)?_0x545561:''+_0x545561+sep,_0x1bc16c=_0x472187['endsWith'](sep)?_0x472187:''+_0x472187+sep;return _0x545561===_0x472187||_0x2be1ee[_0x58db5b(0x74)](_0x1bc16c);}export function realOrResolved(_0x4631dd){try{return realpathSync(_0x4631dd);}catch{return resolve(_0x4631dd);}}export function lstatIfPresent(_0x2813cb){try{return lstatSync(_0x2813cb);}catch{return undefined;}}export function writeTextAtomic(_0x306d89,_0x45f772,_0x3c8260){const _0x2450fe=a155_0x5d7c;writeBytesAtomic(_0x306d89,Buffer['from'](_0x45f772,_0x2450fe(0x6f)),_0x3c8260);}function a155_0x58e3(){const _0x4f2a16=['269988OvWhjb','startsWith','Refusing\x20to\x20write\x20through\x20Skill\x20symlink\x20path:\x20','260ELIWEa','5suJKxD','18822Tpweek','71120cIzFye','5278696HXDTui','1034UTsMIV','30rKQBCs','34452WmWuyE','.tmp','endsWith','split','564uXpWye','validation','utf8','isSymbolicLink','215850wYUuxE','193221vzEBXM'];a155_0x58e3=function(){return _0x4f2a16;};return a155_0x58e3();}export function writeBytesAtomic(_0x1bf446,_0x220235,_0x5e5279){const _0x5b2227=a155_0x5d7c,_0x2cfb29=_0x1bf446+_0x5b2227(0x7e);try{writeFileSync(_0x2cfb29,_0x220235,{'mode':_0x5e5279}),renameSync(_0x2cfb29,_0x1bf446);}catch(_0x1f1ea2){try{rmSync(_0x2cfb29,{'force':!![]});}catch{}throw _0x1f1ea2;}}export function writeJsonAtomic(_0x165ccf,_0xb7bb45){writeTextAtomic(_0x165ccf,JSON['stringify'](_0xb7bb45,null,0x2)+'\x0a',0x180);}
1
+ (function(_0x5a53fc,_0x3782bd){const _0x1b1ec1=a155_0x4776,_0x5e7630=_0x5a53fc();while(!![]){try{const _0x155383=parseInt(_0x1b1ec1(0xfb))/0x1+parseInt(_0x1b1ec1(0x101))/0x2+parseInt(_0x1b1ec1(0xf5))/0x3*(parseInt(_0x1b1ec1(0xf6))/0x4)+-parseInt(_0x1b1ec1(0xfa))/0x5+parseInt(_0x1b1ec1(0xf1))/0x6+parseInt(_0x1b1ec1(0xf9))/0x7*(parseInt(_0x1b1ec1(0xfd))/0x8)+-parseInt(_0x1b1ec1(0x100))/0x9;if(_0x155383===_0x3782bd)break;else _0x5e7630['push'](_0x5e7630['shift']());}catch(_0x18ded5){_0x5e7630['push'](_0x5e7630['shift']());}}}(a155_0x3970,0xc4bd6));function a155_0x4776(_0x59eba6,_0x3bbcb7){_0x59eba6=_0x59eba6-0xf1;const _0x397080=a155_0x3970();let _0x4776a9=_0x397080[_0x59eba6];return _0x4776a9;}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(_0x15e445,_0x103b1e){const _0x3b8d52=a155_0x4776,_0x694dc5=normalizeSkillRelativePath(_0x103b1e),_0x793fe0=realOrResolved(_0x15e445),_0x3851d9=resolve(_0x793fe0,..._0x694dc5['split']('/'));if(!isPathInside(_0x3851d9,_0x793fe0))throw CliErrors[_0x3b8d52(0xf2)](_0x3b8d52(0xff)+_0x103b1e);return ensureNoSymlinkInManagedPath(_0x793fe0,_0x694dc5),_0x3851d9;}export function ensureNoSymlinkInManagedPath(_0x2bd90a,_0x2581f5){const _0x28abe5=a155_0x4776;let _0x3cc68c=_0x2bd90a;for(const _0x18c762 of _0x2581f5[_0x28abe5(0xfe)]('/')){_0x3cc68c=resolve(_0x3cc68c,_0x18c762);const _0x5568d8=lstatIfPresent(_0x3cc68c);if(_0x5568d8?.[_0x28abe5(0xf3)]())throw CliErrors[_0x28abe5(0xf2)](_0x28abe5(0xf4)+_0x2581f5);}}export function isDanglingSymlink(_0x488031){const _0x246c2f=a155_0x4776;try{return lstatSync(_0x488031)[_0x246c2f(0xf3)]();}catch{return![];}}export function resolveSymlinkTarget(_0x374413){const _0x4ef9b2=readlinkSync(_0x374413);return isAbsolute(_0x4ef9b2)?_0x4ef9b2:resolve(dirname(_0x374413),_0x4ef9b2);}export function isPathInside(_0x560ad8,_0x3b528d){const _0xd103d5=a155_0x4776,_0x19eeb8=_0x560ad8[_0xd103d5(0x104)](sep)?_0x560ad8:''+_0x560ad8+sep,_0x19874e=_0x3b528d['endsWith'](sep)?_0x3b528d:''+_0x3b528d+sep;return _0x560ad8===_0x3b528d||_0x19eeb8[_0xd103d5(0x102)](_0x19874e);}export function realOrResolved(_0x2b08ca){try{return realpathSync(_0x2b08ca);}catch{return resolve(_0x2b08ca);}}export function lstatIfPresent(_0x39c157){try{return lstatSync(_0x39c157);}catch{return undefined;}}export function writeTextAtomic(_0xc32abf,_0x3f5b05,_0x27214e){const _0x55dea6=a155_0x4776;writeBytesAtomic(_0xc32abf,Buffer[_0x55dea6(0xfc)](_0x3f5b05,_0x55dea6(0x103)),_0x27214e);}export function writeBytesAtomic(_0x440e11,_0x1c148a,_0x2f24bb){const _0x2fca1d=a155_0x4776,_0x59f468=_0x440e11+_0x2fca1d(0xf8);try{writeFileSync(_0x59f468,_0x1c148a,{'mode':_0x2f24bb}),renameSync(_0x59f468,_0x440e11);}catch(_0x3d7940){try{rmSync(_0x59f468,{'force':!![]});}catch{}throw _0x3d7940;}}export function writeJsonAtomic(_0x419ef5,_0x47321e){const _0x413eb0=a155_0x4776;writeTextAtomic(_0x419ef5,JSON[_0x413eb0(0xf7)](_0x47321e,null,0x2)+'\x0a',0x180);}function a155_0x3970(){const _0x2740a4=['from','520424ggKEXl','split','Unsafe\x20Skill\x20file\x20path:\x20','15325389jEryvl','2887890lUWmHD','startsWith','utf8','endsWith','1222662gUqLBB','validation','isSymbolicLink','Refusing\x20to\x20write\x20through\x20Skill\x20symlink\x20path:\x20','10485JVVWmG','388SGQmRh','stringify','.tmp','91SaoGPw','7452730yeOEHX','1166787EjurpH'];a155_0x3970=function(){return _0x2740a4;};return a155_0x3970();}
@@ -1 +1 @@
1
- (function(_0x350ecf,_0x82e2ea){const _0x40ad12=a156_0x26e4,_0x1db443=_0x350ecf();while(!![]){try{const _0x2e38a7=parseInt(_0x40ad12(0x123))/0x1*(-parseInt(_0x40ad12(0x127))/0x2)+parseInt(_0x40ad12(0x125))/0x3*(parseInt(_0x40ad12(0x121))/0x4)+-parseInt(_0x40ad12(0x11a))/0x5+parseInt(_0x40ad12(0x11d))/0x6*(parseInt(_0x40ad12(0x126))/0x7)+-parseInt(_0x40ad12(0x129))/0x8*(-parseInt(_0x40ad12(0x122))/0x9)+parseInt(_0x40ad12(0x11e))/0xa+-parseInt(_0x40ad12(0x11c))/0xb;if(_0x2e38a7===_0x82e2ea)break;else _0x1db443['push'](_0x1db443['shift']());}catch(_0x31f27e){_0x1db443['push'](_0x1db443['shift']());}}}(a156_0x4afa,0x4cd8a));import{createHash}from'node:crypto';function a156_0x4afa(){const _0x1ece8c=['sha256','127395qWJgJA','245KkxXMF','13078GTfmhf','digest','1224240DPJISw','hex','105680uPFPnJ','update','13963543utAcFn','93348uELSuI','5092570eaExbq','path','size','40wlQGMV','9naUAJM','4XXJHaM'];a156_0x4afa=function(){return _0x1ece8c;};return a156_0x4afa();}import{fileContent,normalizeManifestFiles}from'./local-files.js';export function contentHash(_0x4d6328){const _0x429372=a156_0x26e4;return createHash(_0x429372(0x124))[_0x429372(0x11b)](_0x4d6328)[_0x429372(0x128)](_0x429372(0x12a));}export function fileHash(_0x1a6b35){return bufferSha256(fileContent(_0x1a6b35));}function a156_0x26e4(_0x367d18,_0x42f474){_0x367d18=_0x367d18-0x11a;const _0x4afaa0=a156_0x4afa();let _0x26e493=_0x4afaa0[_0x367d18];return _0x26e493;}export function bufferSha256(_0x3b3937){const _0x334cac=a156_0x26e4;return createHash(_0x334cac(0x124))['update'](_0x3b3937)[_0x334cac(0x128)](_0x334cac(0x12a));}export function fileTreeHash(_0x295d2b){const _0x23b060=a156_0x26e4,_0x505a7a=createHash(_0x23b060(0x124));for(const _0x12915e of normalizeManifestFiles(_0x295d2b)){_0x505a7a[_0x23b060(0x11b)](_0x12915e[_0x23b060(0x11f)]),_0x505a7a[_0x23b060(0x11b)]('\x00'),_0x505a7a[_0x23b060(0x11b)](_0x12915e['sha256']),_0x505a7a[_0x23b060(0x11b)]('\x00'),_0x505a7a[_0x23b060(0x11b)](String(_0x12915e[_0x23b060(0x120)])),_0x505a7a[_0x23b060(0x11b)]('\x00');}return _0x505a7a['digest'](_0x23b060(0x12a));}
1
+ (function(_0x5271be,_0x8c5f30){const _0x448b00=a156_0x14f3,_0x3da25f=_0x5271be();while(!![]){try{const _0x535b11=-parseInt(_0x448b00(0x9c))/0x1+-parseInt(_0x448b00(0x9d))/0x2+parseInt(_0x448b00(0x97))/0x3+-parseInt(_0x448b00(0x9f))/0x4*(-parseInt(_0x448b00(0xa0))/0x5)+-parseInt(_0x448b00(0x98))/0x6*(parseInt(_0x448b00(0x9a))/0x7)+parseInt(_0x448b00(0x93))/0x8+-parseInt(_0x448b00(0x96))/0x9*(parseInt(_0x448b00(0xa1))/0xa);if(_0x535b11===_0x8c5f30)break;else _0x3da25f['push'](_0x3da25f['shift']());}catch(_0x3dbc6a){_0x3da25f['push'](_0x3da25f['shift']());}}}(a156_0x4889,0x6f4e4));import{createHash}from'node:crypto';function a156_0x4889(){const _0x14ec1b=['sha256','2177IVKYwa','hex','412905nnxCiO','1367216XyPNiO','size','76ySOAQE','234190gquoaE','20FmkqUO','digest','7080176ZoGAPF','update','path','2165058samqAV','2471064MhiUgy','10902aGjhTs'];a156_0x4889=function(){return _0x14ec1b;};return a156_0x4889();}function a156_0x14f3(_0x108f3b,_0x4ea214){_0x108f3b=_0x108f3b-0x92;const _0x4889e6=a156_0x4889();let _0x14f3b8=_0x4889e6[_0x108f3b];return _0x14f3b8;}import{fileContent,normalizeManifestFiles}from'./local-files.js';export function contentHash(_0x3c4c33){const _0x12daec=a156_0x14f3;return createHash('sha256')['update'](_0x3c4c33)[_0x12daec(0x92)]('hex');}export function fileHash(_0xbf53e){return bufferSha256(fileContent(_0xbf53e));}export function bufferSha256(_0x367f68){const _0x38e509=a156_0x14f3;return createHash('sha256')[_0x38e509(0x94)](_0x367f68)['digest']('hex');}export function fileTreeHash(_0x2d401d){const _0x30c04e=a156_0x14f3,_0x2a8bfb=createHash('sha256');for(const _0x4b878a of normalizeManifestFiles(_0x2d401d)){_0x2a8bfb['update'](_0x4b878a[_0x30c04e(0x95)]),_0x2a8bfb['update']('\x00'),_0x2a8bfb[_0x30c04e(0x94)](_0x4b878a[_0x30c04e(0x99)]),_0x2a8bfb[_0x30c04e(0x94)]('\x00'),_0x2a8bfb[_0x30c04e(0x94)](String(_0x4b878a[_0x30c04e(0x9e)])),_0x2a8bfb['update']('\x00');}return _0x2a8bfb[_0x30c04e(0x92)](_0x30c04e(0x9b));}
@@ -1 +1 @@
1
- const a157_0x3c7b55=a157_0x52f5;(function(_0x48b8c3,_0x4f1618){const _0x49b660=a157_0x52f5,_0x585cb7=_0x48b8c3();while(!![]){try{const _0x8293fc=parseInt(_0x49b660(0x141))/0x1*(parseInt(_0x49b660(0x155))/0x2)+parseInt(_0x49b660(0x151))/0x3*(parseInt(_0x49b660(0x146))/0x4)+-parseInt(_0x49b660(0x152))/0x5*(-parseInt(_0x49b660(0x14b))/0x6)+parseInt(_0x49b660(0x144))/0x7*(parseInt(_0x49b660(0x14a))/0x8)+parseInt(_0x49b660(0x148))/0x9*(parseInt(_0x49b660(0x147))/0xa)+-parseInt(_0x49b660(0x145))/0xb*(-parseInt(_0x49b660(0x143))/0xc)+parseInt(_0x49b660(0x140))/0xd*(-parseInt(_0x49b660(0x154))/0xe);if(_0x8293fc===_0x4f1618)break;else _0x585cb7['push'](_0x585cb7['shift']());}catch(_0x4b61bb){_0x585cb7['push'](_0x585cb7['shift']());}}}(a157_0x4c40,0x9f3df));function a157_0x52f5(_0xa19f15,_0x1d9bf5){_0xa19f15=_0xa19f15-0x140;const _0x4c4042=a157_0x4c40();let _0x52f588=_0x4c4042[_0xa19f15];return _0x52f588;}import{resolve}from'node:path';import{resolveSkillSyncPaths,runtimeAgentSkillRoots,safePathSegment}from'./paths.js';export function resolveRuntimeSkillInstallTarget(_0x1cd4a9,_0x19ef0e=a157_0x3c7b55(0x14c),_0x4cbad6={}){const _0x81a277=a157_0x3c7b55,_0x1f0717=resolveSkillSyncPaths(_0x4cbad6),_0x48813e=safePathSegment(_0x1cd4a9,_0x81a277(0x14f)),_0x46070a=_0x19ef0e===_0x81a277(0x14d)?[resolve(_0x4cbad6[_0x81a277(0x14e)]??process[_0x81a277(0x14e)](),_0x81a277(0x150),_0x81a277(0x153))]:runtimeAgentSkillRoots(_0x1f0717);return Object[_0x81a277(0x149)]({'scope':_0x19ef0e,'appCode':_0x48813e,'skillRoots':Object[_0x81a277(0x149)](_0x46070a),'managedRoot':_0x1f0717[_0x81a277(0x142)]});}function a157_0x4c40(){const _0x2c0931=['project','cwd','appCode','.agents','325509xkruKF','5560YQZOJy','skills','1506540YScLDk','1120GwaOAM','416FylHkR','22pghCOX','managedRoot','9312vkqPpQ','61411VkWRdO','15092VVTDqd','4gwwHiI','30VFbkLN','3477213fDJESP','freeze','808iMyBTP','4668TTfheQ','global'];a157_0x4c40=function(){return _0x2c0931;};return a157_0x4c40();}
1
+ const a157_0xf854bb=a157_0xccab;(function(_0x23bbec,_0x129262){const _0x45ba09=a157_0xccab,_0x3cb1ed=_0x23bbec();while(!![]){try{const _0x1fe576=parseInt(_0x45ba09(0x182))/0x1*(parseInt(_0x45ba09(0x18d))/0x2)+parseInt(_0x45ba09(0x188))/0x3*(parseInt(_0x45ba09(0x184))/0x4)+-parseInt(_0x45ba09(0x181))/0x5+parseInt(_0x45ba09(0x187))/0x6+parseInt(_0x45ba09(0x192))/0x7*(-parseInt(_0x45ba09(0x186))/0x8)+-parseInt(_0x45ba09(0x191))/0x9*(-parseInt(_0x45ba09(0x18a))/0xa)+-parseInt(_0x45ba09(0x18e))/0xb*(-parseInt(_0x45ba09(0x190))/0xc);if(_0x1fe576===_0x129262)break;else _0x3cb1ed['push'](_0x3cb1ed['shift']());}catch(_0x3dcca6){_0x3cb1ed['push'](_0x3cb1ed['shift']());}}}(a157_0x2d64,0x62dba));function a157_0xccab(_0x6e015a,_0x13d6bb){_0x6e015a=_0x6e015a-0x181;const _0x2d6489=a157_0x2d64();let _0xccabb3=_0x2d6489[_0x6e015a];return _0xccabb3;}function a157_0x2d64(){const _0x518232=['managedRoot','165492WigPqV','cwd','472YWqHWj','2311752tjgQSl','51IDvMUk','project','4510jKQfgB','freeze','global','476452GvRaXl','11gspQNs','.agents','5907588PtMmCL','63yMdHMY','80612EmDLZM','3689745CFkbdl','1FXqPWh'];a157_0x2d64=function(){return _0x518232;};return a157_0x2d64();}import{resolve}from'node:path';import{resolveSkillSyncPaths,runtimeAgentSkillRoots,safePathSegment}from'./paths.js';export function resolveRuntimeSkillInstallTarget(_0x194e2b,_0x213e94=a157_0xf854bb(0x18c),_0x4c8934={}){const _0x1df7ce=a157_0xf854bb,_0x445e93=resolveSkillSyncPaths(_0x4c8934),_0x33e4f0=safePathSegment(_0x194e2b,'appCode'),_0x291d21=_0x213e94===_0x1df7ce(0x189)?[resolve(_0x4c8934[_0x1df7ce(0x185)]??process['cwd'](),_0x1df7ce(0x18f),'skills')]:runtimeAgentSkillRoots(_0x445e93);return Object[_0x1df7ce(0x18b)]({'scope':_0x213e94,'appCode':_0x33e4f0,'skillRoots':Object[_0x1df7ce(0x18b)](_0x291d21),'managedRoot':_0x445e93[_0x1df7ce(0x183)]});}
@@ -1 +1 @@
1
- const a158_0x165bc1=a158_0x5f47;(function(_0xe987fb,_0x179421){const _0x266935=a158_0x5f47,_0x5f4221=_0xe987fb();while(!![]){try{const _0x105bb0=parseInt(_0x266935(0x18d))/0x1*(-parseInt(_0x266935(0x19c))/0x2)+parseInt(_0x266935(0x19a))/0x3*(parseInt(_0x266935(0x1a5))/0x4)+parseInt(_0x266935(0x17d))/0x5*(-parseInt(_0x266935(0x178))/0x6)+parseInt(_0x266935(0x198))/0x7*(-parseInt(_0x266935(0x1a2))/0x8)+parseInt(_0x266935(0x193))/0x9+parseInt(_0x266935(0x18e))/0xa*(-parseInt(_0x266935(0x184))/0xb)+parseInt(_0x266935(0x195))/0xc;if(_0x105bb0===_0x179421)break;else _0x5f4221['push'](_0x5f4221['shift']());}catch(_0xab6562){_0x5f4221['push'](_0x5f4221['shift']());}}}(a158_0x14fa,0x6e6a5));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import a158_0x46e25e 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}=a158_0x46e25e,RESERVED_PROJECT_SKILL_CODES=new Set([a158_0x165bc1(0x196),'runtime-observe',a158_0x165bc1(0x176)]);export function linkEffectiveRuntimeSkills(_0x3eb87c,_0x41ce90){const _0x4f82ff=a158_0x165bc1,_0x46cfb2=new Map();for(const _0x844976 of _0x3eb87c){const _0x41e6ec=_0x844976[_0x4f82ff(0x17c)]['skillCode'];if(!_0x41e6ec)continue;const _0x396a9a=_0x46cfb2[_0x4f82ff(0x197)](_0x41e6ec);(!_0x396a9a||_0x844976['scope']===_0x4f82ff(0x171))&&_0x46cfb2[_0x4f82ff(0x17e)](_0x41e6ec,_0x844976);}const _0x20d342=[];for(const _0x1e968c of _0x46cfb2[_0x4f82ff(0x16c)]()){const _0x75ee5d=requireSkillCode(_0x1e968c[_0x4f82ff(0x17c)]),_0x51783b=readMetadataIfPresent(_0x1e968c[_0x4f82ff(0x18f)]);if(_0x51783b?.[_0x4f82ff(0x16e)]!==_0x41ce90[_0x4f82ff(0x16e)]||_0x51783b[_0x4f82ff(0x1a3)]!==_0x75ee5d)throw CliErrors[_0x4f82ff(0x19f)]('Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20'+_0x41ce90['appCode']+':\x20'+_0x1e968c[_0x4f82ff(0x18f)]);const _0x56d5c5=runtimeSkillLinkName(_0x41ce90,_0x75ee5d);for(const _0x27293e of _0x41ce90[_0x4f82ff(0x1a1)]){_0x20d342[_0x4f82ff(0x16a)](ensureManagedSymlink(resolve(_0x27293e,_0x56d5c5),_0x1e968c[_0x4f82ff(0x182)],_0x41ce90,_0x75ee5d));}}return _0x20d342;}export function pruneStaleRuntimeSkillLinks(_0x2d38e4,_0xcd7b47,_0x29bbe6){const _0x34db47=a158_0x165bc1,_0x51ea77=new Set([..._0xcd7b47][_0x34db47(0x18c)](_0x987165=>_0x987165[_0x34db47(0x172)]())['filter'](Boolean)),_0x221fa9=_0x29bbe6?new Set([..._0x29bbe6][_0x34db47(0x18c)](_0x1c6786=>_0x1c6786[_0x34db47(0x172)]())[_0x34db47(0x1a0)](Boolean)):undefined,_0x4e0dae=[];for(const _0x306fc5 of _0x2d38e4['skillRoots']){for(const _0x51e7e3 of managedTargetSkillLinkPaths(_0x306fc5,_0x2d38e4)){const _0x4fb5d6=runtimeSkillCodeFromLink(_0x2d38e4,_0x51e7e3);if(_0x221fa9&&!_0x221fa9[_0x34db47(0x180)](_0x4fb5d6))continue;if(_0x51ea77[_0x34db47(0x180)](_0x4fb5d6))continue;_0x4e0dae[_0x34db47(0x16a)](removeManagedSkillLink(_0x51e7e3,_0x2d38e4,_0x4fb5d6));}}return _0x4e0dae;}export function pruneStaleRuntimeSkillCache(_0x3f6510,_0x1f3f33={}){const _0x23fc70=a158_0x165bc1,_0x40df8d=new Set([..._0x3f6510[_0x23fc70(0x16d)]][_0x23fc70(0x18c)](_0xc9b878=>_0xc9b878[_0x23fc70(0x172)]())[_0x23fc70(0x1a0)](Boolean)),_0x38fb9e=_0x3f6510[_0x23fc70(0x170)]?new Set([..._0x3f6510['pruneSkillCodes']][_0x23fc70(0x18c)](_0x555854=>_0x555854[_0x23fc70(0x172)]())[_0x23fc70(0x1a0)](Boolean)):undefined,_0x41777d=_0x3f6510[_0x23fc70(0x181)]??[_0x23fc70(0x171),_0x23fc70(0x183)],_0xdd5e2=resolve(getRuntimeSkillCacheRoot(_0x3f6510[_0x23fc70(0x179)],_0x3f6510[_0x23fc70(0x18a)],_0x1f3f33),safePathSegment(_0x3f6510[_0x23fc70(0x16e)],_0x23fc70(0x16e))),_0x319171=[];for(const _0x22c067 of _0x41777d){const _0x178efb=resolve(_0xdd5e2,_0x22c067);if(!existsSync(_0x178efb))continue;for(const _0x379f33 of readdirSync(_0x178efb,{'withFileTypes':!![]})){if(!_0x379f33['isDirectory']())continue;const _0x480e73=_0x379f33[_0x23fc70(0x175)];if(_0x38fb9e&&!_0x38fb9e[_0x23fc70(0x180)](_0x480e73))continue;if(_0x40df8d[_0x23fc70(0x180)](_0x480e73))continue;const _0x5a630b=resolve(_0x178efb,_0x480e73),_0x2f352c=readMetadataIfPresent(resolve(_0x5a630b,METADATA_FILE));if(_0x2f352c?.[_0x23fc70(0x16e)]!==_0x3f6510[_0x23fc70(0x16e)]||_0x2f352c[_0x23fc70(0x19d)]!==_0x22c067||_0x2f352c['skillCode']!==_0x480e73){_0x319171[_0x23fc70(0x16a)]({'path':_0x5a630b,'action':_0x23fc70(0x17a),'reason':_0x23fc70(0x189)});continue;}if(isLinkedFromAnyRoot(_0x5a630b,_0x3f6510[_0x23fc70(0x169)]??[])){_0x319171[_0x23fc70(0x16a)]({'path':_0x5a630b,'action':_0x23fc70(0x17a),'reason':_0x23fc70(0x173)});continue;}removeSync(_0x5a630b),_0x319171[_0x23fc70(0x16a)]({'path':_0x5a630b,'action':'removed'});}}return _0x319171;}export function linkGlobalRuntimeSkills(_0x3d3f50,_0x51b174={}){const _0x491cf3=a158_0x165bc1,_0x57eb11=resolveSkillSyncPaths(_0x51b174),_0x49e907=[];for(const _0x272bb4 of _0x3d3f50){if(_0x272bb4[_0x491cf3(0x19d)]!==_0x491cf3(0x16f))throw CliErrors['validation'](_0x491cf3(0x18b)+_0x272bb4[_0x491cf3(0x19d)]);const _0x480837=requireSkillCode(_0x272bb4[_0x491cf3(0x17c)]),_0x272a02=copyManagedSkillDirectory(_0x272bb4[_0x491cf3(0x182)],resolve(_0x57eb11['agentsSkillsDir'],_0x480837));_0x49e907[_0x491cf3(0x16a)]({..._0x272a02,'contentHash':_0x272bb4[_0x491cf3(0x199)]});}return _0x49e907;}function ensureManagedSymlink(_0x4a1a7a,_0x36b97a,_0x34dcbb,_0x4cb185){const _0x4d2e2a=a158_0x165bc1;mkdirSync(dirname(_0x4a1a7a),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x4a1a7a)||isDanglingSymlink(_0x4a1a7a)){const _0x5c8f7c=lstatSync(_0x4a1a7a);if(!_0x5c8f7c[_0x4d2e2a(0x177)]())throw CliErrors[_0x4d2e2a(0x19f)](_0x4d2e2a(0x194)+_0x4a1a7a);const _0x50cb4e=resolveSymlinkTarget(_0x4a1a7a);if(!isPathInside(realOrResolved(_0x50cb4e),realOrResolved(_0x34dcbb[_0x4d2e2a(0x19e)])))throw CliErrors[_0x4d2e2a(0x19f)](_0x4d2e2a(0x186)+_0x4a1a7a);if(realOrResolved(_0x50cb4e)===realOrResolved(_0x36b97a))return{'path':_0x4a1a7a,'target':_0x36b97a,'action':'unchanged'};const _0x4a32f9=readMetadataIfPresent(resolve(_0x50cb4e,METADATA_FILE));if(_0x34dcbb['scope']===_0x4d2e2a(0x190)&&(_0x4a32f9?.[_0x4d2e2a(0x16e)]!==_0x34dcbb['appCode']||_0x4a32f9[_0x4d2e2a(0x1a3)]!==_0x4cb185))throw CliErrors[_0x4d2e2a(0x19f)]('Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20'+_0x4a1a7a);return unlinkSync(_0x4a1a7a),symlinkSync(_0x36b97a,_0x4a1a7a,'dir'),{'path':_0x4a1a7a,'target':_0x36b97a,'action':'updated'};}return symlinkSync(_0x36b97a,_0x4a1a7a,'dir'),{'path':_0x4a1a7a,'target':_0x36b97a,'action':_0x4d2e2a(0x16b)};}function managedTargetSkillLinkPaths(_0x2eaa3c,_0x17fc4a){const _0x46b552=a158_0x165bc1;if(!existsSync(_0x2eaa3c))return[];const _0xdf6e6b=_0x17fc4a[_0x46b552(0x16e)]+'--';return readdirSync(_0x2eaa3c,{'withFileTypes':!![]})[_0x46b552(0x1a0)](_0x9f6dc5=>_0x17fc4a[_0x46b552(0x19d)]===_0x46b552(0x190)||_0x9f6dc5[_0x46b552(0x175)][_0x46b552(0x174)](_0xdf6e6b))['map'](_0x394253=>resolve(_0x2eaa3c,_0x394253[_0x46b552(0x175)]));}function removeManagedSkillLink(_0x6e754d,_0x4ee00b,_0x2e7046){const _0x3b317c=a158_0x165bc1,_0x119d19=lstatIfPresent(_0x6e754d);if(!_0x119d19?.[_0x3b317c(0x177)]())return{'path':_0x6e754d,'action':_0x3b317c(0x17a),'reason':_0x3b317c(0x1a4)};const _0x3d4489=resolveSymlinkTarget(_0x6e754d);if(!isPathInside(realOrResolved(_0x3d4489),realOrResolved(_0x4ee00b[_0x3b317c(0x19e)])))return{'path':_0x6e754d,'action':_0x3b317c(0x17a),'reason':'external-symlink'};const _0x4e05b4=readMetadataIfPresent(resolve(_0x3d4489,METADATA_FILE));if(_0x4ee00b[_0x3b317c(0x19d)]===_0x3b317c(0x190)&&(_0x4e05b4?.[_0x3b317c(0x16e)]!==_0x4ee00b[_0x3b317c(0x16e)]||_0x4e05b4[_0x3b317c(0x1a3)]!==_0x2e7046))return{'path':_0x6e754d,'action':_0x3b317c(0x17a),'reason':_0x3b317c(0x189)};return unlinkSync(_0x6e754d),{'path':_0x6e754d,'action':_0x3b317c(0x168)};}function a158_0x14fa(){const _0x1cccc3=['15015600zZhYBT','lovrabet','get','25739rAxSer','contentHash','9LBNiRt','updated','2JsAhmr','scope','managedRoot','validation','filter','skillRoots','688oKpvlO','skillCode','not-managed-symlink','841660VwCrja','removed','protectedLinkRoots','push','created','values','activeSkillCodes','appCode','builtin','pruneSkillCodes','personal','trim','linked-from-protected-root','startsWith','name','secret-retriever','isSymbolicLink','30UBGsLi','env','skipped','Refusing\x20to\x20copy\x20Skill\x20symlink:\x20','skill','198130jflblQ','set','length','has','scopes','dir','company','311883xLmbky','slice','Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20','Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20','metadata-mismatch','accessKey','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','map','775274zRWWiH','140BtKZRU','metadataPath','project','unchanged','Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20','2306556eqCweB','Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20'];a158_0x14fa=function(){return _0x1cccc3;};return a158_0x14fa();}function isLinkedFromAnyRoot(_0xeee44a,_0x516f93){const _0x29d832=a158_0x165bc1,_0x590560=realOrResolved(_0xeee44a);for(const _0x4febaf of _0x516f93){if(!existsSync(_0x4febaf))continue;for(const _0x4b3caf of readdirSync(_0x4febaf,{'withFileTypes':!![]})){if(!_0x4b3caf['isSymbolicLink']())continue;const _0x19187b=resolve(_0x4febaf,_0x4b3caf[_0x29d832(0x175)]);if(realOrResolved(resolveSymlinkTarget(_0x19187b))===_0x590560)return!![];}}return![];}function runtimeSkillLinkName(_0x2fd6d3,_0xd57143){const _0x20cfa7=a158_0x165bc1,_0x27d267=safePathSegment(_0xd57143,_0x20cfa7(0x1a3));if(_0x2fd6d3[_0x20cfa7(0x19d)]===_0x20cfa7(0x190)&&RESERVED_PROJECT_SKILL_CODES[_0x20cfa7(0x180)](_0x27d267))throw CliErrors[_0x20cfa7(0x19f)](_0x20cfa7(0x192)+_0x27d267);return _0x2fd6d3[_0x20cfa7(0x19d)]===_0x20cfa7(0x190)?_0x27d267:_0x2fd6d3[_0x20cfa7(0x16e)]+'--'+_0x27d267;}function runtimeSkillCodeFromLink(_0x475150,_0x49c649){const _0x4a233b=a158_0x165bc1,_0x31e6bb=basename(_0x49c649);return _0x475150['scope']===_0x4a233b(0x190)?_0x31e6bb:_0x31e6bb[_0x4a233b(0x185)]((_0x475150[_0x4a233b(0x16e)]+'--')[_0x4a233b(0x17f)]);}function a158_0x5f47(_0x185999,_0x27e337){_0x185999=_0x185999-0x168;const _0x14fa4d=a158_0x14fa();let _0x5f4718=_0x14fa4d[_0x185999];return _0x5f4718;}export function copyManagedSkillDirectory(_0x3d39a9,_0x24144b){const _0x3e1333=a158_0x165bc1,_0x3be3c8=resolve(_0x24144b,METADATA_FILE),_0x32cc78=existsSync(_0x24144b);if(_0x32cc78){const _0x43d421=lstatSync(_0x24144b);if(_0x43d421[_0x3e1333(0x177)]())throw CliErrors[_0x3e1333(0x19f)]('Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20'+_0x24144b);if(!_0x43d421['isDirectory']())throw CliErrors[_0x3e1333(0x19f)](_0x3e1333(0x187)+_0x24144b);const _0x3d4c42=readMetadataIfPresent(_0x3be3c8);if(_0x3d4c42?.[_0x3e1333(0x19d)]!==_0x3e1333(0x16f))throw CliErrors[_0x3e1333(0x19f)](_0x3e1333(0x188)+_0x24144b);}ensureDirSync(dirname(_0x24144b));const _0x5b1939=_0x32cc78?readMetadataIfPresent(_0x3be3c8)?.[_0x3e1333(0x199)]:undefined,_0x5519ee=readMetadataIfPresent(resolve(_0x3d39a9,METADATA_FILE))?.[_0x3e1333(0x199)];return _0x32cc78&&removeSync(_0x24144b),copySkillDirectory(_0x3d39a9,_0x24144b),{'path':_0x24144b,'target':_0x3d39a9,'action':!_0x32cc78?'created':_0x5b1939===_0x5519ee?_0x3e1333(0x191):_0x3e1333(0x19b)};}function copySkillDirectory(_0x10c989,_0x2fd74d){copySync(_0x10c989,_0x2fd74d,{'dereference':![],'overwrite':!![],'filter'(_0x3ca233){const _0x1c7a05=a158_0x5f47;if(lstatSync(_0x3ca233)[_0x1c7a05(0x177)]())throw CliErrors[_0x1c7a05(0x19f)](_0x1c7a05(0x17b)+_0x3ca233);return!![];}});}
1
+ const a158_0x5b06f6=a158_0x389e;(function(_0x1759c9,_0x55e11b){const _0x35bb74=a158_0x389e,_0x34fa6c=_0x1759c9();while(!![]){try{const _0x847707=-parseInt(_0x35bb74(0x179))/0x1*(parseInt(_0x35bb74(0x193))/0x2)+parseInt(_0x35bb74(0x187))/0x3+-parseInt(_0x35bb74(0x185))/0x4+-parseInt(_0x35bb74(0x18d))/0x5*(parseInt(_0x35bb74(0x186))/0x6)+parseInt(_0x35bb74(0x17f))/0x7+parseInt(_0x35bb74(0x17e))/0x8*(parseInt(_0x35bb74(0x195))/0x9)+-parseInt(_0x35bb74(0x18a))/0xa;if(_0x847707===_0x55e11b)break;else _0x34fa6c['push'](_0x34fa6c['shift']());}catch(_0x324d92){_0x34fa6c['push'](_0x34fa6c['shift']());}}}(a158_0x200a,0xd6148));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import a158_0xc0b92c 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';function a158_0x389e(_0x2dfa3c,_0x5831cb){_0x2dfa3c=_0x2dfa3c-0x164;const _0x200a5d=a158_0x200a();let _0x389ea3=_0x200a5d[_0x2dfa3c];return _0x389ea3;}const {copySync,ensureDirSync,removeSync}=a158_0xc0b92c,RESERVED_PROJECT_SKILL_CODES=new Set([a158_0x5b06f6(0x199),a158_0x5b06f6(0x177),a158_0x5b06f6(0x165)]);export function linkEffectiveRuntimeSkills(_0x2cf057,_0x3590ad){const _0x4a04fe=a158_0x5b06f6,_0x52ce6a=new Map();for(const _0x3ab827 of _0x2cf057){const _0x444905=_0x3ab827['skill'][_0x4a04fe(0x169)];if(!_0x444905)continue;const _0x5efb79=_0x52ce6a[_0x4a04fe(0x197)](_0x444905);(!_0x5efb79||_0x3ab827[_0x4a04fe(0x18c)]==='personal')&&_0x52ce6a['set'](_0x444905,_0x3ab827);}const _0x31c72b=[];for(const _0x27bd3b of _0x52ce6a['values']()){const _0x54610f=requireSkillCode(_0x27bd3b[_0x4a04fe(0x16d)]),_0x1fec6b=readMetadataIfPresent(_0x27bd3b[_0x4a04fe(0x18e)]);if(_0x1fec6b?.['appCode']!==_0x3590ad[_0x4a04fe(0x17c)]||_0x1fec6b[_0x4a04fe(0x169)]!==_0x54610f)throw CliErrors[_0x4a04fe(0x181)]('Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20'+_0x3590ad[_0x4a04fe(0x17c)]+':\x20'+_0x27bd3b[_0x4a04fe(0x18e)]);const _0xa1728f=runtimeSkillLinkName(_0x3590ad,_0x54610f);for(const _0x149f95 of _0x3590ad[_0x4a04fe(0x17a)]){_0x31c72b[_0x4a04fe(0x17b)](ensureManagedSymlink(resolve(_0x149f95,_0xa1728f),_0x27bd3b['dir'],_0x3590ad,_0x54610f));}}return _0x31c72b;}export function pruneStaleRuntimeSkillLinks(_0x5e0de3,_0x2c502f,_0x3d55cb){const _0x390ab2=a158_0x5b06f6,_0x180e7f=new Set([..._0x2c502f][_0x390ab2(0x18b)](_0x4ef42b=>_0x4ef42b[_0x390ab2(0x184)]())[_0x390ab2(0x167)](Boolean)),_0x5b2f04=_0x3d55cb?new Set([..._0x3d55cb]['map'](_0x20ffa9=>_0x20ffa9['trim']())['filter'](Boolean)):undefined,_0x1486af=[];for(const _0xc1ef3c of _0x5e0de3['skillRoots']){for(const _0x2ab468 of managedTargetSkillLinkPaths(_0xc1ef3c,_0x5e0de3)){const _0x5e158c=runtimeSkillCodeFromLink(_0x5e0de3,_0x2ab468);if(_0x5b2f04&&!_0x5b2f04[_0x390ab2(0x166)](_0x5e158c))continue;if(_0x180e7f[_0x390ab2(0x166)](_0x5e158c))continue;_0x1486af[_0x390ab2(0x17b)](removeManagedSkillLink(_0x2ab468,_0x5e0de3,_0x5e158c));}}return _0x1486af;}export function pruneStaleRuntimeSkillCache(_0x243266,_0x559589={}){const _0x1df652=a158_0x5b06f6,_0x32e8d2=new Set([..._0x243266[_0x1df652(0x183)]][_0x1df652(0x18b)](_0x3e8e35=>_0x3e8e35[_0x1df652(0x184)]())[_0x1df652(0x167)](Boolean)),_0x234e9d=_0x243266[_0x1df652(0x190)]?new Set([..._0x243266[_0x1df652(0x190)]]['map'](_0x584f72=>_0x584f72[_0x1df652(0x184)]())[_0x1df652(0x167)](Boolean)):undefined,_0x47a16b=_0x243266[_0x1df652(0x16b)]??[_0x1df652(0x173),_0x1df652(0x188)],_0x271836=resolve(getRuntimeSkillCacheRoot(_0x243266[_0x1df652(0x170)],_0x243266[_0x1df652(0x168)],_0x559589),safePathSegment(_0x243266[_0x1df652(0x17c)],'appCode')),_0x367c67=[];for(const _0x1fdb83 of _0x47a16b){const _0x2bbef4=resolve(_0x271836,_0x1fdb83);if(!existsSync(_0x2bbef4))continue;for(const _0x3d7a3c of readdirSync(_0x2bbef4,{'withFileTypes':!![]})){if(!_0x3d7a3c[_0x1df652(0x196)]())continue;const _0x52da42=_0x3d7a3c[_0x1df652(0x16e)];if(_0x234e9d&&!_0x234e9d['has'](_0x52da42))continue;if(_0x32e8d2[_0x1df652(0x166)](_0x52da42))continue;const _0x1b1ce7=resolve(_0x2bbef4,_0x52da42),_0xc77977=readMetadataIfPresent(resolve(_0x1b1ce7,METADATA_FILE));if(_0xc77977?.['appCode']!==_0x243266[_0x1df652(0x17c)]||_0xc77977[_0x1df652(0x18c)]!==_0x1fdb83||_0xc77977[_0x1df652(0x169)]!==_0x52da42){_0x367c67[_0x1df652(0x17b)]({'path':_0x1b1ce7,'action':'skipped','reason':_0x1df652(0x192)});continue;}if(isLinkedFromAnyRoot(_0x1b1ce7,_0x243266[_0x1df652(0x19a)]??[])){_0x367c67[_0x1df652(0x17b)]({'path':_0x1b1ce7,'action':_0x1df652(0x174),'reason':'linked-from-protected-root'});continue;}removeSync(_0x1b1ce7),_0x367c67['push']({'path':_0x1b1ce7,'action':_0x1df652(0x16a)});}}return _0x367c67;}export function linkGlobalRuntimeSkills(_0x4f68a9,_0x44d7ba={}){const _0x141c9f=a158_0x5b06f6,_0x3275a5=resolveSkillSyncPaths(_0x44d7ba),_0x30263c=[];for(const _0x4726fd of _0x4f68a9){if(_0x4726fd[_0x141c9f(0x18c)]!=='builtin')throw CliErrors['validation']('Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20'+_0x4726fd[_0x141c9f(0x18c)]);const _0x416e6b=requireSkillCode(_0x4726fd['skill']),_0xc02a8d=copyManagedSkillDirectory(_0x4726fd[_0x141c9f(0x16f)],resolve(_0x3275a5[_0x141c9f(0x194)],_0x416e6b));_0x30263c[_0x141c9f(0x17b)]({..._0xc02a8d,'contentHash':_0x4726fd[_0x141c9f(0x18f)]});}return _0x30263c;}function ensureManagedSymlink(_0x97ec02,_0x21f769,_0x92ac2a,_0x3a3d6d){const _0x58bb7e=a158_0x5b06f6;mkdirSync(dirname(_0x97ec02),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x97ec02)||isDanglingSymlink(_0x97ec02)){const _0x4d2e73=lstatSync(_0x97ec02);if(!_0x4d2e73[_0x58bb7e(0x172)]())throw CliErrors[_0x58bb7e(0x181)](_0x58bb7e(0x164)+_0x97ec02);const _0x43ded0=resolveSymlinkTarget(_0x97ec02);if(!isPathInside(realOrResolved(_0x43ded0),realOrResolved(_0x92ac2a[_0x58bb7e(0x19b)])))throw CliErrors[_0x58bb7e(0x181)]('Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20'+_0x97ec02);if(realOrResolved(_0x43ded0)===realOrResolved(_0x21f769))return{'path':_0x97ec02,'target':_0x21f769,'action':_0x58bb7e(0x198)};const _0x1f3821=readMetadataIfPresent(resolve(_0x43ded0,METADATA_FILE));if(_0x92ac2a[_0x58bb7e(0x18c)]===_0x58bb7e(0x180)&&(_0x1f3821?.['appCode']!==_0x92ac2a[_0x58bb7e(0x17c)]||_0x1f3821['skillCode']!==_0x3a3d6d))throw CliErrors[_0x58bb7e(0x181)]('Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20'+_0x97ec02);return unlinkSync(_0x97ec02),symlinkSync(_0x21f769,_0x97ec02,_0x58bb7e(0x16f)),{'path':_0x97ec02,'target':_0x21f769,'action':_0x58bb7e(0x178)};}return symlinkSync(_0x21f769,_0x97ec02,_0x58bb7e(0x16f)),{'path':_0x97ec02,'target':_0x21f769,'action':_0x58bb7e(0x182)};}function managedTargetSkillLinkPaths(_0x502f9d,_0xf3eda){const _0x31ce9b=a158_0x5b06f6;if(!existsSync(_0x502f9d))return[];const _0x5e7143=_0xf3eda[_0x31ce9b(0x17c)]+'--';return readdirSync(_0x502f9d,{'withFileTypes':!![]})[_0x31ce9b(0x167)](_0x3a950c=>_0xf3eda[_0x31ce9b(0x18c)]===_0x31ce9b(0x180)||_0x3a950c['name'][_0x31ce9b(0x189)](_0x5e7143))[_0x31ce9b(0x18b)](_0x4bda3e=>resolve(_0x502f9d,_0x4bda3e[_0x31ce9b(0x16e)]));}function removeManagedSkillLink(_0x5aaefd,_0x2eea9f,_0x4343cb){const _0x4d5039=a158_0x5b06f6,_0x344722=lstatIfPresent(_0x5aaefd);if(!_0x344722?.[_0x4d5039(0x172)]())return{'path':_0x5aaefd,'action':_0x4d5039(0x174),'reason':_0x4d5039(0x175)};const _0x1fbbbd=resolveSymlinkTarget(_0x5aaefd);if(!isPathInside(realOrResolved(_0x1fbbbd),realOrResolved(_0x2eea9f[_0x4d5039(0x19b)])))return{'path':_0x5aaefd,'action':_0x4d5039(0x174),'reason':'external-symlink'};const _0x25c8d0=readMetadataIfPresent(resolve(_0x1fbbbd,METADATA_FILE));if(_0x2eea9f['scope']===_0x4d5039(0x180)&&(_0x25c8d0?.[_0x4d5039(0x17c)]!==_0x2eea9f[_0x4d5039(0x17c)]||_0x25c8d0['skillCode']!==_0x4343cb))return{'path':_0x5aaefd,'action':_0x4d5039(0x174),'reason':_0x4d5039(0x192)};return unlinkSync(_0x5aaefd),{'path':_0x5aaefd,'action':_0x4d5039(0x16a)};}function isLinkedFromAnyRoot(_0x146cf9,_0x327494){const _0x4d1409=a158_0x5b06f6,_0x4902ce=realOrResolved(_0x146cf9);for(const _0x5bad59 of _0x327494){if(!existsSync(_0x5bad59))continue;for(const _0x534f1c of readdirSync(_0x5bad59,{'withFileTypes':!![]})){if(!_0x534f1c[_0x4d1409(0x172)]())continue;const _0x310bf1=resolve(_0x5bad59,_0x534f1c[_0x4d1409(0x16e)]);if(realOrResolved(resolveSymlinkTarget(_0x310bf1))===_0x4902ce)return!![];}}return![];}function runtimeSkillLinkName(_0x542565,_0x2f6425){const _0x1090ab=a158_0x5b06f6,_0x4c7cb2=safePathSegment(_0x2f6425,_0x1090ab(0x169));if(_0x542565[_0x1090ab(0x18c)]===_0x1090ab(0x180)&&RESERVED_PROJECT_SKILL_CODES[_0x1090ab(0x166)](_0x4c7cb2))throw CliErrors['validation']('Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20'+_0x4c7cb2);return _0x542565[_0x1090ab(0x18c)]===_0x1090ab(0x180)?_0x4c7cb2:_0x542565[_0x1090ab(0x17c)]+'--'+_0x4c7cb2;}function runtimeSkillCodeFromLink(_0x4c4f2c,_0x1688d1){const _0x3dc92f=a158_0x5b06f6,_0x3052ee=basename(_0x1688d1);return _0x4c4f2c[_0x3dc92f(0x18c)]==='project'?_0x3052ee:_0x3052ee['slice']((_0x4c4f2c[_0x3dc92f(0x17c)]+'--')[_0x3dc92f(0x17d)]);}function a158_0x200a(){const _0x36935e=['9885780QUhrVf','map','scope','5bLNbNO','metadataPath','contentHash','pruneSkillCodes','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20','metadata-mismatch','1790AWHPhk','agentsSkillsDir','32229PwxuIz','isDirectory','get','unchanged','lovrabet','protectedLinkRoots','managedRoot','Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20','secret-retriever','has','filter','accessKey','skillCode','removed','scopes','Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20','skill','name','dir','env','builtin','isSymbolicLink','personal','skipped','not-managed-symlink','Refusing\x20to\x20copy\x20Skill\x20symlink:\x20','runtime-observe','updated','491QgXyOj','skillRoots','push','appCode','length','2920YcZUun','8116563oxvQHB','project','validation','created','activeSkillCodes','trim','2980700bCmQfo','6744834dysbAI','5122905gausmq','company','startsWith'];a158_0x200a=function(){return _0x36935e;};return a158_0x200a();}export function copyManagedSkillDirectory(_0x1370b4,_0x317411){const _0x2c913c=a158_0x5b06f6,_0x59a393=resolve(_0x317411,METADATA_FILE),_0x38b8d2=existsSync(_0x317411);if(_0x38b8d2){const _0x232561=lstatSync(_0x317411);if(_0x232561[_0x2c913c(0x172)]())throw CliErrors[_0x2c913c(0x181)](_0x2c913c(0x16c)+_0x317411);if(!_0x232561[_0x2c913c(0x196)]())throw CliErrors[_0x2c913c(0x181)]('Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20'+_0x317411);const _0x376578=readMetadataIfPresent(_0x59a393);if(_0x376578?.['scope']!==_0x2c913c(0x171))throw CliErrors[_0x2c913c(0x181)](_0x2c913c(0x191)+_0x317411);}ensureDirSync(dirname(_0x317411));const _0x4dc323=_0x38b8d2?readMetadataIfPresent(_0x59a393)?.[_0x2c913c(0x18f)]:undefined,_0x5bb9b3=readMetadataIfPresent(resolve(_0x1370b4,METADATA_FILE))?.['contentHash'];return _0x38b8d2&&removeSync(_0x317411),copySkillDirectory(_0x1370b4,_0x317411),{'path':_0x317411,'target':_0x1370b4,'action':!_0x38b8d2?'created':_0x4dc323===_0x5bb9b3?_0x2c913c(0x198):_0x2c913c(0x178)};}function copySkillDirectory(_0x15dae5,_0x15d00c){copySync(_0x15dae5,_0x15d00c,{'dereference':![],'overwrite':!![],'filter'(_0x3c8b41){const _0x3dad75=a158_0x389e;if(lstatSync(_0x3c8b41)[_0x3dad75(0x172)]())throw CliErrors['validation'](_0x3dad75(0x176)+_0x3c8b41);return!![];}});}
@@ -1 +1 @@
1
- (function(_0xa687e8,_0x21ea73){const _0x24c8d7=a159_0xfced,_0x50a593=_0xa687e8();while(!![]){try{const _0x14ba08=parseInt(_0x24c8d7(0x1a7))/0x1*(parseInt(_0x24c8d7(0x189))/0x2)+-parseInt(_0x24c8d7(0x1a5))/0x3+-parseInt(_0x24c8d7(0x181))/0x4*(parseInt(_0x24c8d7(0x19c))/0x5)+parseInt(_0x24c8d7(0x187))/0x6+-parseInt(_0x24c8d7(0x191))/0x7*(parseInt(_0x24c8d7(0x193))/0x8)+-parseInt(_0x24c8d7(0x185))/0x9+parseInt(_0x24c8d7(0x194))/0xa;if(_0x14ba08===_0x21ea73)break;else _0x50a593['push'](_0x50a593['shift']());}catch(_0x4294d5){_0x50a593['push'](_0x50a593['shift']());}}}(a159_0x29a3,0x59fc5));import{existsSync,readdirSync}from'node:fs';import{resolve}from'node:path';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{readMetadataIfPresent}from'./metadata.js';import{getRuntimeSkillCacheRoot,safePathSegment}from'./paths.js';import{isRuntimeSkillScope,normalizeRuntimeSkillScopes}from'./scopes.js';function a159_0xfced(_0x4e9e1e,_0x2175fd){_0x4e9e1e=_0x4e9e1e-0x181;const _0x29a3df=a159_0x29a3();let _0xfced1c=_0x29a3df[_0x4e9e1e];return _0xfced1c;}function a159_0x29a3(){const _0x53600b=['get','1731990WgoRzh','skillRoots','13590mRlSXP','localeCompare','accessKey','dir','filter','tags','appCode','builtin','1402583MGITCm','name','8nMoukw','18525400okdALb','skillCode','isSymbolicLink','code','cache','push','validation','isDirectory','937295AaNXzK','sort','set','source','\x20!=\x20','env','linkedPaths','map','cacheDir','2063427gIpWfu','local','26GlHrCR','trim','Runtime\x20Skill\x20install\x20target\x20app\x20mismatch:\x20','linkedPath','scope','isArray','skillMdPath','12ttVqBn','link','values','has','4488651ZZQJsW'];a159_0x29a3=function(){return _0x53600b;};return a159_0x29a3();}export function listLocalRuntimeSkills(_0x1a93c8,_0xf921d1,_0x2b2137={}){const _0x2731aa=a159_0xfced,_0xa84b5b=safePathSegment(_0x1a93c8['appCode'],'appCode');if(_0xf921d1[_0x2731aa(0x18f)]!==_0xa84b5b)throw CliErrors[_0x2731aa(0x19a)](_0x2731aa(0x1a9)+_0xf921d1[_0x2731aa(0x18f)]+_0x2731aa(0x1a0)+_0xa84b5b);const _0x66e532=normalizeRuntimeSkillScopes(_0x1a93c8['scopes']),_0x3c9cc7=new Set(_0x66e532),_0x50ed22=_0x1a93c8['code']?.[_0x2731aa(0x1a8)](),_0x194bdd=new Map(),_0x214b9e=resolve(getRuntimeSkillCacheRoot(_0x1a93c8[_0x2731aa(0x1a1)],_0x1a93c8[_0x2731aa(0x18b)],_0x2b2137),_0xa84b5b);for(const _0x59134a of _0x66e532){for(const _0xc362d1 of localSkillEntryDirs(resolve(_0x214b9e,_0x59134a))){collectLocalRuntimeSkill(_0x194bdd,_0xc362d1,{'appCode':_0xa84b5b,'scopes':_0x3c9cc7,'code':_0x50ed22,'source':_0x2731aa(0x198)});}}for(const _0x4fad90 of _0xf921d1[_0x2731aa(0x188)]){for(const _0x3c27d8 of localSkillLinkCandidates(_0x4fad90,_0xf921d1,_0x3c9cc7)){collectLocalRuntimeSkill(_0x194bdd,_0x3c27d8,{'appCode':_0xa84b5b,'scopes':_0x3c9cc7,'code':_0x50ed22,'source':_0x2731aa(0x182),'linkedPath':_0x3c27d8});}}return Array['from'](_0x194bdd[_0x2731aa(0x183)]())[_0x2731aa(0x19d)](compareLocalRuntimeSkills);}function localSkillEntryDirs(_0x35521c){const _0x5514fb=a159_0xfced;if(!existsSync(_0x35521c))return[];return readdirSync(_0x35521c,{'withFileTypes':!![]})[_0x5514fb(0x18d)](_0x5e7d38=>_0x5e7d38['isDirectory']()||_0x5e7d38[_0x5514fb(0x196)]())[_0x5514fb(0x1a3)](_0x1f1d27=>resolve(_0x35521c,_0x1f1d27[_0x5514fb(0x192)]));}function localSkillLinkCandidates(_0x574965,_0x43b07f,_0xafa960){const _0x54178e=a159_0xfced;if(!existsSync(_0x574965))return[];const _0x52d56b=_0x43b07f[_0x54178e(0x18f)]+'--';return readdirSync(_0x574965,{'withFileTypes':!![]})[_0x54178e(0x18d)](_0x2b92e9=>_0x2b92e9[_0x54178e(0x19b)]()||_0x2b92e9[_0x54178e(0x196)]())[_0x54178e(0x18d)](_0xf238a1=>_0x43b07f[_0x54178e(0x1ab)]==='project'||_0xf238a1[_0x54178e(0x192)]['startsWith'](_0x52d56b)||_0xafa960[_0x54178e(0x184)](_0x54178e(0x190)))['map'](_0x2572ce=>resolve(_0x574965,_0x2572ce[_0x54178e(0x192)]));}function collectLocalRuntimeSkill(_0x5a9e9c,_0x4baf39,_0x414105){const _0x224a12=a159_0xfced,_0x3a8a35=resolve(_0x4baf39,METADATA_FILE),_0x1f12fd=readMetadataIfPresent(_0x3a8a35);if(!_0x1f12fd)return;if(_0x1f12fd[_0x224a12(0x18f)]!==_0x414105[_0x224a12(0x18f)])return;if(!isRuntimeSkillScope(_0x1f12fd[_0x224a12(0x1ab)])||!_0x414105['scopes'][_0x224a12(0x184)](_0x1f12fd[_0x224a12(0x1ab)]))return;const _0x4f6642=_0x1f12fd[_0x224a12(0x195)]?.[_0x224a12(0x1a8)]();if(!_0x4f6642)return;if(_0x414105[_0x224a12(0x197)]&&_0x4f6642!==_0x414105[_0x224a12(0x197)])return;const _0x67ea14=_0x1f12fd[_0x224a12(0x1ab)]+':'+_0x4f6642,_0x3535f2=_0x414105['linkedPath']?[_0x414105[_0x224a12(0x1aa)]]:[],_0x4b8d12=_0x5a9e9c[_0x224a12(0x186)](_0x67ea14);if(_0x4b8d12){_0x414105['source']===_0x224a12(0x198)&&(_0x4b8d12['dir']=_0x4baf39,_0x4b8d12[_0x224a12(0x1a4)]=_0x4baf39,_0x4b8d12[_0x224a12(0x1ad)]=resolve(_0x4baf39,SKILL_FILE),_0x4b8d12['metadataPath']=_0x3a8a35);for(const _0xc20eaa of _0x3535f2){!_0x4b8d12[_0x224a12(0x1a2)]['includes'](_0xc20eaa)&&_0x4b8d12[_0x224a12(0x1a2)][_0x224a12(0x199)](_0xc20eaa);}_0x4b8d12[_0x224a12(0x1a2)][_0x224a12(0x19d)]();return;}_0x5a9e9c[_0x224a12(0x19e)](_0x67ea14,{..._0x1f12fd,'tags':Array[_0x224a12(0x1ac)](_0x1f12fd[_0x224a12(0x18e)])?_0x1f12fd[_0x224a12(0x18e)]:[],'scope':_0x1f12fd[_0x224a12(0x1ab)],'source':_0x224a12(0x1a6),'dir':_0x4baf39,'cacheDir':_0x414105[_0x224a12(0x19f)]===_0x224a12(0x198)?_0x4baf39:undefined,'skillMdPath':resolve(_0x4baf39,SKILL_FILE),'metadataPath':_0x3a8a35,'linkedPaths':_0x3535f2});}function compareLocalRuntimeSkills(_0x25dc44,_0x501e85){const _0x4d1259=a159_0xfced,_0x53e9cb={'personal':0x0,'company':0x1,'builtin':0x2};return _0x53e9cb[_0x25dc44[_0x4d1259(0x1ab)]]-_0x53e9cb[_0x501e85[_0x4d1259(0x1ab)]]||_0x25dc44['skillCode'][_0x4d1259(0x18a)](_0x501e85[_0x4d1259(0x195)])||_0x25dc44['dir'][_0x4d1259(0x18a)](_0x501e85[_0x4d1259(0x18c)]);}
1
+ (function(_0x53564c,_0x1afb79){const _0x3ad749=a159_0x10f2,_0x332948=_0x53564c();while(!![]){try{const _0x50e4a0=parseInt(_0x3ad749(0x1bd))/0x1*(-parseInt(_0x3ad749(0x1bb))/0x2)+-parseInt(_0x3ad749(0x1be))/0x3+parseInt(_0x3ad749(0x1aa))/0x4*(parseInt(_0x3ad749(0x1cb))/0x5)+parseInt(_0x3ad749(0x1c7))/0x6*(parseInt(_0x3ad749(0x1b5))/0x7)+-parseInt(_0x3ad749(0x1d5))/0x8*(parseInt(_0x3ad749(0x1a9))/0x9)+parseInt(_0x3ad749(0x1d8))/0xa+-parseInt(_0x3ad749(0x1d7))/0xb*(-parseInt(_0x3ad749(0x1b9))/0xc);if(_0x50e4a0===_0x1afb79)break;else _0x332948['push'](_0x332948['shift']());}catch(_0x12b148){_0x332948['push'](_0x332948['shift']());}}}(a159_0x2366,0xb413f));function a159_0x10f2(_0x3cac13,_0x2e9173){_0x3cac13=_0x3cac13-0x1a9;const _0x236681=a159_0x2366();let _0x10f2b4=_0x236681[_0x3cac13];return _0x10f2b4;}import{existsSync,readdirSync}from'node:fs';import{resolve}from'node:path';function a159_0x2366(){const _0xdb8d32=['local','\x20!=\x20','filter','code','tags','startsWith','7464xbiZLK','sort','118514qesMbx','10554160izILmK','9063cJvssr','20HGOkfQ','skillMdPath','values','localeCompare','linkedPath','set','push','includes','map','trim','scope','1579291pPbPfF','isDirectory','has','get','1476uslxQf','accessKey','112vbFvaW','linkedPaths','8606sbSflW','1862160sYUoyI','skillRoots','metadataPath','builtin','scopes','skillCode','validation','name','isSymbolicLink','6fJYsoo','appCode','isArray','dir','173555zjJbEX','cache','env','source'];a159_0x2366=function(){return _0xdb8d32;};return a159_0x2366();}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(_0x575ebc,_0x3c26b2,_0x233ddc={}){const _0x207667=a159_0x10f2,_0x2dd496=safePathSegment(_0x575ebc[_0x207667(0x1c8)],_0x207667(0x1c8));if(_0x3c26b2[_0x207667(0x1c8)]!==_0x2dd496)throw CliErrors[_0x207667(0x1c4)]('Runtime\x20Skill\x20install\x20target\x20app\x20mismatch:\x20'+_0x3c26b2[_0x207667(0x1c8)]+_0x207667(0x1d0)+_0x2dd496);const _0x3201b1=normalizeRuntimeSkillScopes(_0x575ebc[_0x207667(0x1c2)]),_0x4c411e=new Set(_0x3201b1),_0x341bcc=_0x575ebc[_0x207667(0x1d2)]?.[_0x207667(0x1b3)](),_0x1c6bf2=new Map(),_0x51aa54=resolve(getRuntimeSkillCacheRoot(_0x575ebc[_0x207667(0x1cd)],_0x575ebc[_0x207667(0x1ba)],_0x233ddc),_0x2dd496);for(const _0x510426 of _0x3201b1){for(const _0x3e547d of localSkillEntryDirs(resolve(_0x51aa54,_0x510426))){collectLocalRuntimeSkill(_0x1c6bf2,_0x3e547d,{'appCode':_0x2dd496,'scopes':_0x4c411e,'code':_0x341bcc,'source':'cache'});}}for(const _0x29c148 of _0x3c26b2[_0x207667(0x1bf)]){for(const _0x13bec9 of localSkillLinkCandidates(_0x29c148,_0x3c26b2,_0x4c411e)){collectLocalRuntimeSkill(_0x1c6bf2,_0x13bec9,{'appCode':_0x2dd496,'scopes':_0x4c411e,'code':_0x341bcc,'source':'link','linkedPath':_0x13bec9});}}return Array['from'](_0x1c6bf2[_0x207667(0x1ac)]())[_0x207667(0x1d6)](compareLocalRuntimeSkills);}function localSkillEntryDirs(_0x2b7e52){const _0x43e5f6=a159_0x10f2;if(!existsSync(_0x2b7e52))return[];return readdirSync(_0x2b7e52,{'withFileTypes':!![]})[_0x43e5f6(0x1d1)](_0x4deb28=>_0x4deb28[_0x43e5f6(0x1b6)]()||_0x4deb28[_0x43e5f6(0x1c6)]())[_0x43e5f6(0x1b2)](_0x5dbf97=>resolve(_0x2b7e52,_0x5dbf97[_0x43e5f6(0x1c5)]));}function localSkillLinkCandidates(_0x18138f,_0x38e034,_0x468ef1){const _0x37bf9a=a159_0x10f2;if(!existsSync(_0x18138f))return[];const _0x575f0d=_0x38e034[_0x37bf9a(0x1c8)]+'--';return readdirSync(_0x18138f,{'withFileTypes':!![]})['filter'](_0x519578=>_0x519578[_0x37bf9a(0x1b6)]()||_0x519578['isSymbolicLink']())[_0x37bf9a(0x1d1)](_0x538e44=>_0x38e034['scope']==='project'||_0x538e44[_0x37bf9a(0x1c5)][_0x37bf9a(0x1d4)](_0x575f0d)||_0x468ef1[_0x37bf9a(0x1b7)](_0x37bf9a(0x1c1)))[_0x37bf9a(0x1b2)](_0x553757=>resolve(_0x18138f,_0x553757[_0x37bf9a(0x1c5)]));}function collectLocalRuntimeSkill(_0x3788d1,_0x56a44b,_0x5e0c83){const _0xf1ea1a=a159_0x10f2,_0x4c6c0a=resolve(_0x56a44b,METADATA_FILE),_0x5a0590=readMetadataIfPresent(_0x4c6c0a);if(!_0x5a0590)return;if(_0x5a0590['appCode']!==_0x5e0c83[_0xf1ea1a(0x1c8)])return;if(!isRuntimeSkillScope(_0x5a0590['scope'])||!_0x5e0c83[_0xf1ea1a(0x1c2)][_0xf1ea1a(0x1b7)](_0x5a0590[_0xf1ea1a(0x1b4)]))return;const _0x15595f=_0x5a0590[_0xf1ea1a(0x1c3)]?.[_0xf1ea1a(0x1b3)]();if(!_0x15595f)return;if(_0x5e0c83[_0xf1ea1a(0x1d2)]&&_0x15595f!==_0x5e0c83[_0xf1ea1a(0x1d2)])return;const _0x220154=_0x5a0590[_0xf1ea1a(0x1b4)]+':'+_0x15595f,_0x3b9e6b=_0x5e0c83['linkedPath']?[_0x5e0c83[_0xf1ea1a(0x1ae)]]:[],_0x51595c=_0x3788d1[_0xf1ea1a(0x1b8)](_0x220154);if(_0x51595c){_0x5e0c83[_0xf1ea1a(0x1ce)]===_0xf1ea1a(0x1cc)&&(_0x51595c[_0xf1ea1a(0x1ca)]=_0x56a44b,_0x51595c['cacheDir']=_0x56a44b,_0x51595c[_0xf1ea1a(0x1ab)]=resolve(_0x56a44b,SKILL_FILE),_0x51595c[_0xf1ea1a(0x1c0)]=_0x4c6c0a);for(const _0x10ac19 of _0x3b9e6b){!_0x51595c[_0xf1ea1a(0x1bc)][_0xf1ea1a(0x1b1)](_0x10ac19)&&_0x51595c['linkedPaths'][_0xf1ea1a(0x1b0)](_0x10ac19);}_0x51595c['linkedPaths'][_0xf1ea1a(0x1d6)]();return;}_0x3788d1[_0xf1ea1a(0x1af)](_0x220154,{..._0x5a0590,'tags':Array[_0xf1ea1a(0x1c9)](_0x5a0590['tags'])?_0x5a0590[_0xf1ea1a(0x1d3)]:[],'scope':_0x5a0590['scope'],'source':_0xf1ea1a(0x1cf),'dir':_0x56a44b,'cacheDir':_0x5e0c83[_0xf1ea1a(0x1ce)]==='cache'?_0x56a44b:undefined,'skillMdPath':resolve(_0x56a44b,SKILL_FILE),'metadataPath':_0x4c6c0a,'linkedPaths':_0x3b9e6b});}function compareLocalRuntimeSkills(_0xa8139c,_0x354f72){const _0x51f67d=a159_0x10f2,_0x2dcd70={'personal':0x0,'company':0x1,'builtin':0x2};return _0x2dcd70[_0xa8139c[_0x51f67d(0x1b4)]]-_0x2dcd70[_0x354f72[_0x51f67d(0x1b4)]]||_0xa8139c['skillCode'][_0x51f67d(0x1ad)](_0x354f72['skillCode'])||_0xa8139c[_0x51f67d(0x1ca)][_0x51f67d(0x1ad)](_0x354f72[_0x51f67d(0x1ca)]);}
@@ -1 +1 @@
1
- (function(_0x5ed91e,_0x1e51ea){const _0x155fa4=a160_0x4d19,_0x3632ec=_0x5ed91e();while(!![]){try{const _0x2aeac1=parseInt(_0x155fa4(0xf1))/0x1*(-parseInt(_0x155fa4(0xf7))/0x2)+parseInt(_0x155fa4(0x104))/0x3*(parseInt(_0x155fa4(0x101))/0x4)+-parseInt(_0x155fa4(0x11a))/0x5+parseInt(_0x155fa4(0x119))/0x6*(-parseInt(_0x155fa4(0x115))/0x7)+-parseInt(_0x155fa4(0x11b))/0x8+-parseInt(_0x155fa4(0xf9))/0x9*(parseInt(_0x155fa4(0xf4))/0xa)+parseInt(_0x155fa4(0x10b))/0xb*(parseInt(_0x155fa4(0xee))/0xc);if(_0x2aeac1===_0x1e51ea)break;else _0x3632ec['push'](_0x3632ec['shift']());}catch(_0x4f0d08){_0x3632ec['push'](_0x3632ec['shift']());}}}(a160_0x6ca6,0xf2df2));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(_0x229319){const _0x502c1f=a160_0x4d19;return _0x229319[_0x502c1f(0x109)]??Buffer['from'](_0x229319['content']??'',_0x502c1f(0x110));}export function fileText(_0x25384b){const _0x49eec4=a160_0x4d19;return fileContent(_0x25384b)[_0x49eec4(0x11d)](_0x49eec4(0x110));}function a160_0x6ca6(){const _0x31563b=['trim','compare','Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20','string','isDirectory','8BrnxdL','replace','values','120216avbfwU','object','set','split','name','bytes','Skill\x20file\x20path\x20must\x20be\x20text.','2355254GfHOjb','size','validation','content','has','utf8','isArray','localeCompare','includes','sha256','10043733wrCzZZ','Unsafe\x20Skill\x20file\x20path:\x20','from','isSymbolicLink','6sKbIcv','3952440yCFyBV','6520256Pixjsf','push','toString','startsWith','372ZcqOqM','add','path','302NaOjQp','sort','test','15473190JCAkSB','length','Duplicate\x20Skill\x20file\x20path:\x20','7518lIJxkT','isFile','9WNtEJr','Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20','isBuffer'];a160_0x6ca6=function(){return _0x31563b;};return a160_0x6ca6();}function a160_0x4d19(_0x3c2f82,_0x1a15f6){_0x3c2f82=_0x3c2f82-0xee;const _0x6ca6ce=a160_0x6ca6();let _0x4d19e9=_0x6ca6ce[_0x3c2f82];return _0x4d19e9;}export function normalizeLocalFiles(_0x348d50){const _0x2532d0=a160_0x4d19;if(!Array[_0x2532d0(0x111)](_0x348d50)||_0x348d50[_0x2532d0(0xf5)]===0x0)return[];const _0x430c5c=new Map();for(const _0x1787f4 of _0x348d50){if(!_0x1787f4||typeof _0x1787f4!==_0x2532d0(0x105)||typeof _0x1787f4[_0x2532d0(0xf0)]!==_0x2532d0(0xff))throw CliErrors[_0x2532d0(0x10d)](_0x2532d0(0x10a));const _0x56bd55=normalizeSkillRelativePath(_0x1787f4[_0x2532d0(0xf0)]);if(_0x430c5c[_0x2532d0(0x10f)](_0x56bd55))throw CliErrors[_0x2532d0(0x10d)](_0x2532d0(0xf6)+_0x56bd55);if(_0x1787f4[_0x2532d0(0x109)]!==undefined&&!Buffer[_0x2532d0(0xfb)](_0x1787f4[_0x2532d0(0x109)]))throw CliErrors[_0x2532d0(0x10d)]('Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20'+_0x56bd55);if(_0x1787f4['bytes']===undefined&&typeof _0x1787f4[_0x2532d0(0x10e)]!==_0x2532d0(0xff))throw CliErrors[_0x2532d0(0x10d)](_0x2532d0(0xfe)+_0x56bd55);const _0x3bffe2=fileContent(_0x1787f4);_0x430c5c[_0x2532d0(0x106)](_0x56bd55,{'path':_0x56bd55,'bytes':_0x3bffe2});}return Array[_0x2532d0(0x117)](_0x430c5c[_0x2532d0(0x103)]())[_0x2532d0(0xf2)](compareSkillFiles);}export function normalizeManifestFiles(_0x15a157){const _0x1b707a=a160_0x4d19;if(!Array[_0x1b707a(0x111)](_0x15a157)||_0x15a157[_0x1b707a(0xf5)]===0x0)return[];const _0x4799ef=new Map();for(const _0x40b543 of _0x15a157){if(!_0x40b543||typeof _0x40b543!==_0x1b707a(0x105)||typeof _0x40b543[_0x1b707a(0xf0)]!==_0x1b707a(0xff))throw CliErrors['validation'](_0x1b707a(0x10a));const _0x43a8c2=normalizeSkillRelativePath(_0x40b543[_0x1b707a(0xf0)]);if(_0x4799ef[_0x1b707a(0x10f)](_0x43a8c2))throw CliErrors[_0x1b707a(0x10d)](_0x1b707a(0xf6)+_0x43a8c2);if(!isSha256Hex(_0x40b543[_0x1b707a(0x114)]))throw CliErrors[_0x1b707a(0x10d)]('Skill\x20file\x20sha256\x20is\x20invalid:\x20'+_0x43a8c2);if(!Number['isSafeInteger'](_0x40b543[_0x1b707a(0x10c)])||_0x40b543[_0x1b707a(0x10c)]<0x0)throw CliErrors[_0x1b707a(0x10d)]('Skill\x20file\x20size\x20is\x20invalid:\x20'+_0x43a8c2);_0x4799ef['set'](_0x43a8c2,{'path':_0x43a8c2,'sha256':_0x40b543[_0x1b707a(0x114)]['toLowerCase'](),'size':_0x40b543[_0x1b707a(0x10c)]});}return Array[_0x1b707a(0x117)](_0x4799ef['values']())[_0x1b707a(0xf2)](compareSkillFiles);}export function scanSkillDirectory(_0x8622ca,_0x463e94={}){const _0x2de93f=realpathSync(_0x8622ca),_0x3f8b65=canonicalExcludedFilePaths(_0x463e94['excludedFilePaths']),_0x5c81de=[];function _0x322f32(_0x5de9b3){const _0x46e74b=a160_0x4d19,_0x338d98=readdirSync(_0x5de9b3,{'withFileTypes':!![]})[_0x46e74b(0xf2)]((_0x4efd9e,_0x3288c5)=>_0x4efd9e[_0x46e74b(0x108)][_0x46e74b(0x112)](_0x3288c5['name']));for(const _0x34d2c1 of _0x338d98){if(_0x34d2c1[_0x46e74b(0x100)]()&&IGNORED_DIR_NAMES[_0x46e74b(0x10f)](_0x34d2c1[_0x46e74b(0x108)]))continue;if(IGNORED_FILE_NAMES[_0x46e74b(0x10f)](_0x34d2c1[_0x46e74b(0x108)]))continue;const _0xb5415e=resolve(_0x5de9b3,_0x34d2c1[_0x46e74b(0x108)]);if(isExcludedFilePath(_0xb5415e,_0x3f8b65))continue;if(_0x34d2c1[_0x46e74b(0x118)]())throw CliErrors[_0x46e74b(0x10d)](_0x46e74b(0xfa)+_0xb5415e);const _0x15d3f8=toPosixPath(relative(_0x2de93f,_0xb5415e));if(_0x34d2c1[_0x46e74b(0x100)]()){_0x322f32(_0xb5415e);continue;}if(!_0x34d2c1[_0x46e74b(0xf8)]())continue;validateSkillRelativePath(_0x15d3f8);const _0x1ae36d=readFileSync(_0xb5415e);_0x5c81de[_0x46e74b(0x11c)]({'path':_0x15d3f8,'bytes':_0x1ae36d});}}return _0x322f32(_0x2de93f),normalizeLocalFiles(_0x5c81de);}function canonicalExcludedFilePaths(_0x11d31a){const _0xf33313=a160_0x4d19,_0x509400=new Set();for(const _0x1891b8 of _0x11d31a??[]){const _0x2b8c0e=resolve(_0x1891b8);_0x509400['add'](_0x2b8c0e);try{_0x509400[_0xf33313(0xef)](realpathSync(_0x2b8c0e));}catch{}}return _0x509400;}function isExcludedFilePath(_0x21a4fb,_0x3fa696){const _0x5ee869=a160_0x4d19;if(_0x3fa696['has'](_0x21a4fb))return!![];if(_0x3fa696['size']===0x0)return![];try{return _0x3fa696[_0x5ee869(0x10f)](realpathSync(_0x21a4fb));}catch{return![];}}export function compareSkillFiles(_0x1ac918,_0x140891){const _0x56e15c=a160_0x4d19;if(_0x1ac918['path']===SKILL_FILE)return _0x140891[_0x56e15c(0xf0)]===SKILL_FILE?0x0:-0x1;if(_0x140891[_0x56e15c(0xf0)]===SKILL_FILE)return 0x1;return Buffer[_0x56e15c(0xfd)](Buffer[_0x56e15c(0x117)](_0x1ac918[_0x56e15c(0xf0)],_0x56e15c(0x110)),Buffer['from'](_0x140891['path'],_0x56e15c(0x110)));}export function normalizeSkillRelativePath(_0x19bf08){const _0x44b3f6=a160_0x4d19,_0x3999be=toPosixPath(_0x19bf08[_0x44b3f6(0xfc)]());return validateSkillRelativePath(_0x3999be),_0x3999be;}export function validateSkillRelativePath(_0x3bfafa){const _0x41a78a=a160_0x4d19;if(!_0x3bfafa||_0x3bfafa[_0x41a78a(0x11e)]('/')||_0x3bfafa[_0x41a78a(0x113)]('//'))throw CliErrors[_0x41a78a(0x10d)](_0x41a78a(0x116)+_0x3bfafa);for(const _0x2d0e3b of _0x3bfafa[_0x41a78a(0x107)]('/')){if(!_0x2d0e3b||_0x2d0e3b==='.'||_0x2d0e3b==='..')throw CliErrors[_0x41a78a(0x10d)](_0x41a78a(0x116)+_0x3bfafa);}}export function toPosixPath(_0x3a58b2){const _0x206a46=a160_0x4d19;return _0x3a58b2[_0x206a46(0x102)](/\\/g,'/');}export function isSha256Hex(_0x35fb83){const _0x5e450a=a160_0x4d19;return typeof _0x35fb83===_0x5e450a(0xff)&&/^[a-fA-F0-9]{64}$/[_0x5e450a(0xf3)](_0x35fb83);}
1
+ (function(_0x1b24fc,_0x314068){const _0x203d57=a160_0x1dd9,_0x5b1deb=_0x1b24fc();while(!![]){try{const _0x1d8d77=parseInt(_0x203d57(0x1e3))/0x1*(-parseInt(_0x203d57(0x1fc))/0x2)+parseInt(_0x203d57(0x203))/0x3*(-parseInt(_0x203d57(0x1db))/0x4)+-parseInt(_0x203d57(0x1f3))/0x5*(parseInt(_0x203d57(0x1dd))/0x6)+-parseInt(_0x203d57(0x1ea))/0x7+parseInt(_0x203d57(0x1e9))/0x8*(parseInt(_0x203d57(0x1f4))/0x9)+-parseInt(_0x203d57(0x1d1))/0xa*(parseInt(_0x203d57(0x1d9))/0xb)+-parseInt(_0x203d57(0x1e0))/0xc*(-parseInt(_0x203d57(0x1f0))/0xd);if(_0x1d8d77===_0x314068)break;else _0x5b1deb['push'](_0x5b1deb['shift']());}catch(_0x3aa176){_0x5b1deb['push'](_0x5b1deb['shift']());}}}(a160_0x16ff,0x6228d));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(_0x11d0fb){const _0x271f02=a160_0x1dd9;return _0x11d0fb[_0x271f02(0x1d6)]??Buffer[_0x271f02(0x1f9)](_0x11d0fb[_0x271f02(0x1ee)]??'',_0x271f02(0x1fe));}export function fileText(_0xc2084){const _0x41c2d=a160_0x1dd9;return fileContent(_0xc2084)[_0x41c2d(0x1e2)](_0x41c2d(0x1fe));}export function normalizeLocalFiles(_0x5cb337){const _0x2df0ea=a160_0x1dd9;if(!Array[_0x2df0ea(0x202)](_0x5cb337)||_0x5cb337[_0x2df0ea(0x1d5)]===0x0)return[];const _0x396f5a=new Map();for(const _0x31780e of _0x5cb337){if(!_0x31780e||typeof _0x31780e!==_0x2df0ea(0x1e8)||typeof _0x31780e['path']!==_0x2df0ea(0x1e5))throw CliErrors[_0x2df0ea(0x1e1)](_0x2df0ea(0x1f1));const _0x258ed4=normalizeSkillRelativePath(_0x31780e[_0x2df0ea(0x201)]);if(_0x396f5a[_0x2df0ea(0x1f2)](_0x258ed4))throw CliErrors[_0x2df0ea(0x1e1)](_0x2df0ea(0x1ef)+_0x258ed4);if(_0x31780e['bytes']!==undefined&&!Buffer[_0x2df0ea(0x1de)](_0x31780e[_0x2df0ea(0x1d6)]))throw CliErrors['validation'](_0x2df0ea(0x1e4)+_0x258ed4);if(_0x31780e['bytes']===undefined&&typeof _0x31780e[_0x2df0ea(0x1ee)]!==_0x2df0ea(0x1e5))throw CliErrors['validation']('Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20'+_0x258ed4);const _0x4a429c=fileContent(_0x31780e);_0x396f5a[_0x2df0ea(0x1d3)](_0x258ed4,{'path':_0x258ed4,'bytes':_0x4a429c});}return Array['from'](_0x396f5a[_0x2df0ea(0x1d4)]())[_0x2df0ea(0x1dc)](compareSkillFiles);}export function normalizeManifestFiles(_0x1bfb54){const _0x1b1326=a160_0x1dd9;if(!Array[_0x1b1326(0x202)](_0x1bfb54)||_0x1bfb54[_0x1b1326(0x1d5)]===0x0)return[];const _0x5dc2bc=new Map();for(const _0x3b5a3a of _0x1bfb54){if(!_0x3b5a3a||typeof _0x3b5a3a!=='object'||typeof _0x3b5a3a[_0x1b1326(0x201)]!==_0x1b1326(0x1e5))throw CliErrors[_0x1b1326(0x1e1)](_0x1b1326(0x1f1));const _0x42ed91=normalizeSkillRelativePath(_0x3b5a3a['path']);if(_0x5dc2bc[_0x1b1326(0x1f2)](_0x42ed91))throw CliErrors[_0x1b1326(0x1e1)](_0x1b1326(0x1ef)+_0x42ed91);if(!isSha256Hex(_0x3b5a3a[_0x1b1326(0x1f5)]))throw CliErrors[_0x1b1326(0x1e1)](_0x1b1326(0x200)+_0x42ed91);if(!Number[_0x1b1326(0x1f6)](_0x3b5a3a[_0x1b1326(0x1eb)])||_0x3b5a3a[_0x1b1326(0x1eb)]<0x0)throw CliErrors['validation']('Skill\x20file\x20size\x20is\x20invalid:\x20'+_0x42ed91);_0x5dc2bc[_0x1b1326(0x1d3)](_0x42ed91,{'path':_0x42ed91,'sha256':_0x3b5a3a[_0x1b1326(0x1f5)][_0x1b1326(0x1da)](),'size':_0x3b5a3a[_0x1b1326(0x1eb)]});}return Array[_0x1b1326(0x1f9)](_0x5dc2bc[_0x1b1326(0x1d4)]())[_0x1b1326(0x1dc)](compareSkillFiles);}function a160_0x16ff(){const _0xcf53ae=['22PlqDfH','Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20','string','push','compare','object','11296fvrKMW','345548txKhEE','size','add','startsWith','content','Duplicate\x20Skill\x20file\x20path:\x20','13520741ZWgkvC','Skill\x20file\x20path\x20must\x20be\x20text.','has','1494700JZRMLD','585mGRCJK','sha256','isSafeInteger','localeCompare','Unsafe\x20Skill\x20file\x20path:\x20','from','replace','isDirectory','42634YxSHtP','includes','utf8','isSymbolicLink','Skill\x20file\x20sha256\x20is\x20invalid:\x20','path','isArray','622527vHlzYn','trim','name','7450460XAEHaq','test','set','values','length','bytes','split','isFile','11iztmnk','toLowerCase','4iagSkl','sort','6jaOdyN','isBuffer','Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20','24kRhCPu','validation','toString'];a160_0x16ff=function(){return _0xcf53ae;};return a160_0x16ff();}export function scanSkillDirectory(_0x162eff,_0x196c12={}){const _0x524096=realpathSync(_0x162eff),_0x2e65be=canonicalExcludedFilePaths(_0x196c12['excludedFilePaths']),_0x202f93=[];function _0x2d2714(_0x51241f){const _0xe0cfe2=a160_0x1dd9,_0x154a73=readdirSync(_0x51241f,{'withFileTypes':!![]})[_0xe0cfe2(0x1dc)]((_0x199cf9,_0x42bccf)=>_0x199cf9['name'][_0xe0cfe2(0x1f7)](_0x42bccf[_0xe0cfe2(0x1d0)]));for(const _0x3d84dc of _0x154a73){if(_0x3d84dc[_0xe0cfe2(0x1fb)]()&&IGNORED_DIR_NAMES[_0xe0cfe2(0x1f2)](_0x3d84dc[_0xe0cfe2(0x1d0)]))continue;if(IGNORED_FILE_NAMES[_0xe0cfe2(0x1f2)](_0x3d84dc['name']))continue;const _0x1d7802=resolve(_0x51241f,_0x3d84dc[_0xe0cfe2(0x1d0)]);if(isExcludedFilePath(_0x1d7802,_0x2e65be))continue;if(_0x3d84dc[_0xe0cfe2(0x1ff)]())throw CliErrors['validation'](_0xe0cfe2(0x1df)+_0x1d7802);const _0x8ddf07=toPosixPath(relative(_0x524096,_0x1d7802));if(_0x3d84dc[_0xe0cfe2(0x1fb)]()){_0x2d2714(_0x1d7802);continue;}if(!_0x3d84dc[_0xe0cfe2(0x1d8)]())continue;validateSkillRelativePath(_0x8ddf07);const _0x35b94a=readFileSync(_0x1d7802);_0x202f93[_0xe0cfe2(0x1e6)]({'path':_0x8ddf07,'bytes':_0x35b94a});}}return _0x2d2714(_0x524096),normalizeLocalFiles(_0x202f93);}function canonicalExcludedFilePaths(_0x3f912d){const _0x2f82fa=a160_0x1dd9,_0x3ce4b8=new Set();for(const _0x55cc44 of _0x3f912d??[]){const _0x5f3c20=resolve(_0x55cc44);_0x3ce4b8['add'](_0x5f3c20);try{_0x3ce4b8[_0x2f82fa(0x1ec)](realpathSync(_0x5f3c20));}catch{}}return _0x3ce4b8;}function isExcludedFilePath(_0x40e5c4,_0x2a2d88){const _0x2cce9f=a160_0x1dd9;if(_0x2a2d88[_0x2cce9f(0x1f2)](_0x40e5c4))return!![];if(_0x2a2d88[_0x2cce9f(0x1eb)]===0x0)return![];try{return _0x2a2d88[_0x2cce9f(0x1f2)](realpathSync(_0x40e5c4));}catch{return![];}}export function compareSkillFiles(_0x3afc9e,_0x1043e0){const _0x5da745=a160_0x1dd9;if(_0x3afc9e['path']===SKILL_FILE)return _0x1043e0['path']===SKILL_FILE?0x0:-0x1;if(_0x1043e0['path']===SKILL_FILE)return 0x1;return Buffer[_0x5da745(0x1e7)](Buffer['from'](_0x3afc9e['path'],_0x5da745(0x1fe)),Buffer[_0x5da745(0x1f9)](_0x1043e0[_0x5da745(0x201)],'utf8'));}export function normalizeSkillRelativePath(_0x1ca168){const _0x1d408e=a160_0x1dd9,_0x4e586a=toPosixPath(_0x1ca168[_0x1d408e(0x204)]());return validateSkillRelativePath(_0x4e586a),_0x4e586a;}function a160_0x1dd9(_0x1265be,_0x33b1cc){_0x1265be=_0x1265be-0x1d0;const _0x16ff97=a160_0x16ff();let _0x1dd9fe=_0x16ff97[_0x1265be];return _0x1dd9fe;}export function validateSkillRelativePath(_0x5b7fce){const _0x26ff93=a160_0x1dd9;if(!_0x5b7fce||_0x5b7fce[_0x26ff93(0x1ed)]('/')||_0x5b7fce[_0x26ff93(0x1fd)]('//'))throw CliErrors[_0x26ff93(0x1e1)](_0x26ff93(0x1f8)+_0x5b7fce);for(const _0xd1fee7 of _0x5b7fce[_0x26ff93(0x1d7)]('/')){if(!_0xd1fee7||_0xd1fee7==='.'||_0xd1fee7==='..')throw CliErrors[_0x26ff93(0x1e1)](_0x26ff93(0x1f8)+_0x5b7fce);}}export function toPosixPath(_0x151c39){const _0x5763b9=a160_0x1dd9;return _0x151c39[_0x5763b9(0x1fa)](/\\/g,'/');}export function isSha256Hex(_0xfc6c7c){const _0x4a6b69=a160_0x1dd9;return typeof _0xfc6c7c===_0x4a6b69(0x1e5)&&/^[a-fA-F0-9]{64}$/[_0x4a6b69(0x1d2)](_0xfc6c7c);}
@@ -1 +1 @@
1
- (function(_0x1a8259,_0xb4baed){const _0xa6e242=a161_0x2104,_0x3c7892=_0x1a8259();while(!![]){try{const _0x114887=parseInt(_0xa6e242(0x1c6))/0x1*(-parseInt(_0xa6e242(0x1ac))/0x2)+-parseInt(_0xa6e242(0x1b7))/0x3*(parseInt(_0xa6e242(0x1a6))/0x4)+-parseInt(_0xa6e242(0x1bf))/0x5+parseInt(_0xa6e242(0x1d5))/0x6+-parseInt(_0xa6e242(0x1cb))/0x7*(parseInt(_0xa6e242(0x1d7))/0x8)+parseInt(_0xa6e242(0x1b3))/0x9+parseInt(_0xa6e242(0x1b2))/0xa;if(_0x114887===_0xb4baed)break;else _0x3c7892['push'](_0x3c7892['shift']());}catch(_0x420a7f){_0x3c7892['push'](_0x3c7892['shift']());}}}(a161_0x672c,0x3b11e));import{existsSync,lstatSync,mkdirSync,readFileSync,rmSync}from'node:fs';function a161_0x2104(_0x48be69,_0x7c01fb){_0x48be69=_0x48be69-0x1a0;const _0x672ce=a161_0x672c();let _0x21043c=_0x672ce[_0x48be69];return _0x21043c;}import{dirname,resolve}from'node:path';import{isCollection,isMap,isNode,parseDocument,visit}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{resolveManagedFilePath,writeBytesAtomic,writeJsonAtomic}from'./fs-utils.js';import{bufferSha256,contentHash,fileHash}from'./hashing.js';function a161_0x672c(){const _0x3a2e03=['join','utf8','contentHash','slice','find','has','1185495xHObdQ','appCode','\x0a---\x0a\x0a','description','skillCode','set','skillName','1VpLKyc','Managed\x20file\x20was\x20removed\x20locally:\x20','version','name','---','1141zWwqeM','validation','filter','contents','flow','status','packageBytes','entries','.\x20Changed\x20file:\x20','errors','1538970hBcQLX','accessKey','11560jUHruW','length','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','force','match','pulledAt','map','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','fileHashes','replace','example','schemaVersion','keys','env','hasOwn','20IJECrN','Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20','path','displayName:\x20','name:\x20','stringify','89646hEEkLL','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','trim','test','Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20','isFile','6433430OYRrCO','331866IFsQzC','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','paths','displayName','106383zDdRwT','Runtime\x20Skill\x20package\x20is\x20missing\x20'];a161_0x672c=function(){return _0x3a2e03;};return a161_0x672c();}import{fileContent,fileText,normalizeLocalFiles}from'./local-files.js';import{buildMetadata,readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillDir}from'./paths.js';import{extractDownloadedPackage,requirePackageBytes}from'./zip-package.js';export function materializeRuntimeSkill(_0x338d20,_0x5b6df8,_0x1ec6f8){const _0x314325=a161_0x2104,_0x3b6400=requireSkillCode(_0x338d20),_0x3b2211=requirePackageBytes(_0x3b6400,_0x1ec6f8[_0x314325(0x1d1)]),_0x17e731=extractDownloadedPackage(_0x3b2211),_0xd89e3c=_0x17e731[_0x314325(0x1bd)](_0x1c648e=>_0x1c648e['path']===SKILL_FILE);if(!_0xd89e3c)throw CliErrors[_0x314325(0x1cc)](_0x314325(0x1b8)+SKILL_FILE+':\x20'+_0x3b6400);const _0x4e27af=withMaterializedSkillFrontmatter(_0x17e731,_0x338d20,_0x3b6400),_0x2e61c8=_0x4e27af[_0x314325(0x1bd)](_0x17c16e=>_0x17c16e[_0x314325(0x1a8)]===SKILL_FILE),_0x577bc8=fileText(_0x2e61c8),_0x369769=getRuntimeSkillDir(_0x1ec6f8[_0x314325(0x1a4)],_0x1ec6f8['accessKey'],_0x1ec6f8[_0x314325(0x1c0)],_0x5b6df8,_0x3b6400,_0x1ec6f8[_0x314325(0x1b5)]),_0xeb18e5=resolve(_0x369769,SKILL_FILE),_0x190b66=resolve(_0x369769,METADATA_FILE),_0x131b5=contentHash(_0x577bc8),_0x5318e4=readMetadataIfPresent(_0x190b66)?.[_0x314325(0x1df)];ensurePulledFilesCanBeOverwritten(_0x369769,_0x190b66,_0x4e27af,_0x1ec6f8[_0x314325(0x1da)]===!![]),mkdirSync(_0x369769,{'recursive':!![],'mode':0x1c0});const _0x2b5be6=existsSync(_0xeb18e5)?readFileSync(_0xeb18e5,_0x314325(0x1ba)):undefined;return materializeFiles(_0x369769,_0x4e27af),removeStaleManagedFiles(_0x369769,_0x5318e4,_0x4e27af),writeJsonAtomic(_0x190b66,buildMetadata(_0x338d20,_0x5b6df8,_0x1ec6f8['appCode'],_0x131b5,_0x1ec6f8[_0x314325(0x1dc)],_0x4e27af,_0x3b2211)),{'skill':_0x338d20,'scope':_0x5b6df8,'dir':_0x369769,'skillMdPath':_0xeb18e5,'metadataPath':_0x190b66,'contentHash':_0x131b5,'changed':_0x2b5be6!==_0x577bc8};}export function reuseMaterializedRuntimeSkill(_0x39d2a4,_0x3fbdc2,_0x41ee51){const _0x2ee854=a161_0x2104,_0x3c1b65=_0x39d2a4[_0x2ee854(0x1c8)]?.[_0x2ee854(0x1ae)]();if(!_0x3c1b65)return undefined;const _0x5370d1=requireSkillCode(_0x39d2a4),_0x50bcdf=getRuntimeSkillDir(_0x41ee51['env'],_0x41ee51[_0x2ee854(0x1d6)],_0x41ee51[_0x2ee854(0x1c0)],_0x3fbdc2,_0x5370d1,_0x41ee51[_0x2ee854(0x1b5)]),_0x1ce15f=resolve(_0x50bcdf,SKILL_FILE),_0x531554=resolve(_0x50bcdf,METADATA_FILE),_0xd345e6=readMetadataIfPresent(_0x531554);if(!_0xd345e6||_0xd345e6[_0x2ee854(0x1a2)]!==0x2||_0xd345e6[_0x2ee854(0x1c0)]!==_0x41ee51['appCode']||_0xd345e6['scope']!==_0x3fbdc2||_0xd345e6[_0x2ee854(0x1c3)]!==_0x5370d1||_0xd345e6[_0x2ee854(0x1c8)]!==_0x3c1b65||_0xd345e6['id']!==_0x39d2a4['id']||_0xd345e6[_0x2ee854(0x1c5)]!==_0x39d2a4['skillName']||_0xd345e6[_0x2ee854(0x1c2)]!==_0x39d2a4[_0x2ee854(0x1c2)]||_0xd345e6[_0x2ee854(0x1a1)]!==_0x39d2a4[_0x2ee854(0x1a1)]||_0xd345e6[_0x2ee854(0x1d0)]!==_0x39d2a4[_0x2ee854(0x1d0)]||!_0xd345e6[_0x2ee854(0x1bb)]||!_0xd345e6[_0x2ee854(0x1df)]||!Object[_0x2ee854(0x1a5)](_0xd345e6['fileHashes'],SKILL_FILE))return undefined;for(const [_0x2c1352,_0x35933a]of Object['entries'](_0xd345e6['fileHashes'])){if(!/^[a-f0-9]{64}$/[_0x2ee854(0x1af)](_0x35933a))return undefined;const _0xf67abe=resolveManagedFilePath(_0x50bcdf,_0x2c1352);if(!existsSync(_0xf67abe)||!lstatSync(_0xf67abe)[_0x2ee854(0x1b1)]())return undefined;if(bufferSha256(readFileSync(_0xf67abe))!==_0x35933a)return undefined;}return{'skill':_0x39d2a4,'scope':_0x3fbdc2,'dir':_0x50bcdf,'skillMdPath':_0x1ce15f,'metadataPath':_0x531554,'contentHash':_0xd345e6['contentHash'],'changed':![]};}function withMaterializedSkillFrontmatter(_0x57f948,_0x287f01,_0x2bf364){const _0x243673=a161_0x2104,_0x503909=skillDisplayName(_0x287f01,_0x2bf364),_0x461504=_0x287f01['description']?.[_0x243673(0x1ae)]()||_0x503909||_0x2bf364;return normalizeLocalFiles(_0x57f948)[_0x243673(0x1dd)](_0x2120de=>{const _0x187bf2=_0x243673,_0x12e3cd=fileText(_0x2120de);if(_0x2120de[_0x187bf2(0x1a8)]!==SKILL_FILE)return _0x2120de;if(hasYamlFrontmatter(_0x12e3cd))return{'path':_0x2120de[_0x187bf2(0x1a8)],'content':withSyncedDisplayName(_0x12e3cd,_0x503909)};return{'path':_0x2120de[_0x187bf2(0x1a8)],'content':prependSkillFrontmatter(_0x12e3cd,{'name':_0x2bf364,'displayName':_0x503909,'description':_0x461504})};});}function hasYamlFrontmatter(_0x1e4402){return/^\uFEFF?---\s*\r?\n/['test'](_0x1e4402);}function prependSkillFrontmatter(_0x6f33e2,_0x1996a6){const _0x5a0641=a161_0x2104,_0x1de5c5=_0x6f33e2[_0x5a0641(0x1a0)](/^\uFEFF/,'');return[_0x5a0641(0x1ca),_0x5a0641(0x1aa)+yamlString(_0x1996a6[_0x5a0641(0x1c9)]),_0x1996a6[_0x5a0641(0x1b6)]?_0x5a0641(0x1a9)+yamlString(_0x1996a6['displayName']):undefined,'description:\x20'+yamlString(_0x1996a6[_0x5a0641(0x1c2)]),_0x5a0641(0x1ca),'',_0x1de5c5][_0x5a0641(0x1cd)](_0x3e000b=>_0x3e000b!==undefined)[_0x5a0641(0x1b9)]('\x0a');}function yamlString(_0x45fc07){const _0x5a4dbd=a161_0x2104;return JSON[_0x5a4dbd(0x1ab)](_0x45fc07[_0x5a4dbd(0x1a0)](/\r/g,'')[_0x5a4dbd(0x1ae)]());}function skillDisplayName(_0xe6a625,_0x35bac5){const _0x5b4494=_0xe6a625['skillName']?.['trim']();return _0x5b4494||_0x35bac5;}function withSyncedDisplayName(_0x4de9d9,_0x5a8c95){const _0x5449d7=a161_0x2104,_0x1bce20=_0x4de9d9[_0x5449d7(0x1db)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x1bce20)return _0x4de9d9;const _0x9fc81c=_0x1bce20[0x1]??'',_0x2d7100=_0x1bce20[0x2]??'',_0x33bde4=parseDocument(_0x2d7100);if(_0x33bde4[_0x5449d7(0x1d4)][_0x5449d7(0x1d8)]>0x0||!isMap(_0x33bde4[_0x5449d7(0x1ce)]))return _0x4de9d9;if(_0x5a8c95)_0x33bde4[_0x5449d7(0x1c4)](_0x5449d7(0x1b6),_0x5a8c95);else{if(_0x33bde4[_0x5449d7(0x1be)](_0x5449d7(0x1b6)))_0x33bde4['delete'](_0x5449d7(0x1b6));else return _0x4de9d9;}forceBlockCollections(_0x33bde4[_0x5449d7(0x1ce)]);const _0x4cab0e=_0x33bde4['toString']({'lineWidth':0x0})['trimEnd'](),_0x5f3a2f=_0x4de9d9[_0x5449d7(0x1bc)](_0x1bce20[0x0][_0x5449d7(0x1d8)])[_0x5449d7(0x1a0)](/^\r?\n/,'');return _0x9fc81c+'---\x0a'+_0x4cab0e+_0x5449d7(0x1c1)+_0x5f3a2f;}function forceBlockCollections(_0x2470f2){if(!isNode(_0x2470f2))return;visit(_0x2470f2,(_0x29ff69,_0x17e126)=>{const _0x4e5ada=a161_0x2104;isCollection(_0x17e126)&&(_0x17e126[_0x4e5ada(0x1cf)]=![]);});}function ensurePulledFilesCanBeOverwritten(_0x23c121,_0x20a4ee,_0x5743e0,_0x252982){const _0x126fb1=a161_0x2104;if(_0x252982||!existsSync(_0x20a4ee))return;const _0x136e3a=readMetadataIfPresent(_0x20a4ee);if(!_0x136e3a)return;const _0xd7e108=_0x136e3a['fileHashes']&&Object['keys'](_0x136e3a[_0x126fb1(0x1df)])['length']>0x0?_0x136e3a['fileHashes']:undefined;if(_0xd7e108)for(const [_0x482a8d,_0x14aed6]of Object[_0x126fb1(0x1d2)](_0xd7e108)){const _0x5dc8f2=resolveManagedFilePath(_0x23c121,_0x482a8d);if(!existsSync(_0x5dc8f2))throw CliErrors[_0x126fb1(0x1cc)](_0x126fb1(0x1de)+_0x23c121,_0x126fb1(0x1c7)+_0x482a8d);const _0x37cd4d=lstatSync(_0x5dc8f2);if(!_0x37cd4d[_0x126fb1(0x1b1)]())throw CliErrors[_0x126fb1(0x1cc)](_0x126fb1(0x1de)+_0x23c121,_0x126fb1(0x1a7)+_0x482a8d);const _0x461e4b=bufferSha256(readFileSync(_0x5dc8f2));if(_0x461e4b!==_0x14aed6)throw CliErrors[_0x126fb1(0x1cc)](_0x126fb1(0x1de)+_0x23c121+_0x126fb1(0x1d3)+_0x482a8d,_0x126fb1(0x1b4)+_0x482a8d);}else{const _0x2e5ce9=resolve(_0x23c121,SKILL_FILE);if(existsSync(_0x2e5ce9)&&_0x136e3a[_0x126fb1(0x1bb)]){const _0x4d5c90=contentHash(readFileSync(_0x2e5ce9,_0x126fb1(0x1ba)));if(_0x4d5c90!==_0x136e3a[_0x126fb1(0x1bb)])throw CliErrors[_0x126fb1(0x1cc)](_0x126fb1(0x1ad)+_0x2e5ce9,'Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.');}}for(const _0x2f0077 of normalizeLocalFiles(_0x5743e0)){if(_0xd7e108?.[_0x2f0077[_0x126fb1(0x1a8)]])continue;if(!_0xd7e108&&_0x2f0077[_0x126fb1(0x1a8)]===SKILL_FILE)continue;const _0x4ca7c2=resolveManagedFilePath(_0x23c121,_0x2f0077['path']);if(!existsSync(_0x4ca7c2))continue;const _0x201061=lstatSync(_0x4ca7c2);if(!_0x201061[_0x126fb1(0x1b1)]())throw CliErrors[_0x126fb1(0x1cc)](_0x126fb1(0x1de)+_0x23c121,_0x126fb1(0x1d9)+_0x2f0077[_0x126fb1(0x1a8)]);const _0x3d2ea0=bufferSha256(readFileSync(_0x4ca7c2));if(_0x3d2ea0!==fileHash(_0x2f0077))throw CliErrors[_0x126fb1(0x1cc)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x23c121,_0x126fb1(0x1b0)+_0x2f0077[_0x126fb1(0x1a8)]);}}function materializeFiles(_0x357a4a,_0x5925d4){const _0x13a4e7=a161_0x2104;for(const _0x2e6515 of normalizeLocalFiles(_0x5925d4)){const _0x1c6e3e=resolveManagedFilePath(_0x357a4a,_0x2e6515[_0x13a4e7(0x1a8)]);mkdirSync(dirname(_0x1c6e3e),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x1c6e3e,fileContent(_0x2e6515),0x180);}}function removeStaleManagedFiles(_0x211073,_0x4b20b7,_0x3ef664){const _0x51a590=a161_0x2104;if(!_0x4b20b7)return;const _0x3d5968=new Set(normalizeLocalFiles(_0x3ef664)[_0x51a590(0x1dd)](_0x3b7927=>_0x3b7927['path']));for(const _0x1cea98 of Object[_0x51a590(0x1a3)](_0x4b20b7)){if(_0x3d5968[_0x51a590(0x1be)](_0x1cea98))continue;const _0x4881a5=resolveManagedFilePath(_0x211073,_0x1cea98);existsSync(_0x4881a5)&&lstatSync(_0x4881a5)[_0x51a590(0x1b1)]()&&rmSync(_0x4881a5,{'force':!![]});}}
1
+ function a161_0x2a6b(){const _0xed498e=['.\x20Changed\x20file:\x20','version','delete','1479198GgfVbT','displayName','name:\x20','hasOwn','---','map','22896648JGsIFF','path','status','Runtime\x20Skill\x20package\x20is\x20missing\x20','displayName:\x20','trimEnd','paths','schemaVersion','isFile','stringify','replace','---\x0a','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.','pulledAt','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','match','trim','accessKey','scope','30fVPdHp','entries','env','flow','contents','force','keys','errors','set','example','name','appCode','has','760218VDVFJy','description:\x20','find','utf8','\x0a---\x0a\x0a','fileHashes','6996972ugdAuL','13432643LwdJey','contentHash','test','1078000YPsBdz','length','description','join','1286589HBlPyb','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','2IjlDpR','skillName','validation','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'];a161_0x2a6b=function(){return _0xed498e;};return a161_0x2a6b();}(function(_0x3a56fa,_0x5631f8){const _0x53c5c0=a161_0x3498,_0x1f6ffc=_0x3a56fa();while(!![]){try{const _0x37078d=-parseInt(_0x53c5c0(0xa2))/0x1*(parseInt(_0x53c5c0(0xa9))/0x2)+parseInt(_0x53c5c0(0xa0))/0x3+parseInt(_0x53c5c0(0x98))/0x4+parseInt(_0x53c5c0(0x85))/0x5*(parseInt(_0x53c5c0(0x92))/0x6)+parseInt(_0x53c5c0(0x99))/0x7+parseInt(_0x53c5c0(0x9c))/0x8+-parseInt(_0x53c5c0(0xaf))/0x9;if(_0x37078d===_0x5631f8)break;else _0x1f6ffc['push'](_0x1f6ffc['shift']());}catch(_0xc1126e){_0x1f6ffc['push'](_0x1f6ffc['shift']());}}}(a161_0x2a6b,0xec831));import{existsSync,lstatSync,mkdirSync,readFileSync,rmSync}from'node:fs';import{dirname,resolve}from'node:path';import{isCollection,isMap,isNode,parseDocument,visit}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{resolveManagedFilePath,writeBytesAtomic,writeJsonAtomic}from'./fs-utils.js';import{bufferSha256,contentHash,fileHash}from'./hashing.js';import{fileContent,fileText,normalizeLocalFiles}from'./local-files.js';import{buildMetadata,readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillDir}from'./paths.js';import{extractDownloadedPackage,requirePackageBytes}from'./zip-package.js';function a161_0x3498(_0x253867,_0x6a0306){_0x253867=_0x253867-0x81;const _0x2a6b72=a161_0x2a6b();let _0x34981d=_0x2a6b72[_0x253867];return _0x34981d;}export function materializeRuntimeSkill(_0x1c0e52,_0x19a75f,_0x2901fb){const _0x36abd1=a161_0x3498,_0x158c2b=requireSkillCode(_0x1c0e52),_0x547136=requirePackageBytes(_0x158c2b,_0x2901fb['packageBytes']),_0x4fcf66=extractDownloadedPackage(_0x547136),_0x5d150e=_0x4fcf66[_0x36abd1(0x94)](_0x15db7a=>_0x15db7a[_0x36abd1(0xb0)]===SKILL_FILE);if(!_0x5d150e)throw CliErrors[_0x36abd1(0xa4)](_0x36abd1(0xb2)+SKILL_FILE+':\x20'+_0x158c2b);const _0x404196=withMaterializedSkillFrontmatter(_0x4fcf66,_0x1c0e52,_0x158c2b),_0x1cbf4d=_0x404196['find'](_0x5461fa=>_0x5461fa[_0x36abd1(0xb0)]===SKILL_FILE),_0x5e6f7c=fileText(_0x1cbf4d),_0xca915a=getRuntimeSkillDir(_0x2901fb[_0x36abd1(0x87)],_0x2901fb['accessKey'],_0x2901fb['appCode'],_0x19a75f,_0x158c2b,_0x2901fb['paths']),_0x39d5a0=resolve(_0xca915a,SKILL_FILE),_0x3d6837=resolve(_0xca915a,METADATA_FILE),_0x4fe6d0=contentHash(_0x5e6f7c),_0x268735=readMetadataIfPresent(_0x3d6837)?.[_0x36abd1(0x97)];ensurePulledFilesCanBeOverwritten(_0xca915a,_0x3d6837,_0x404196,_0x2901fb[_0x36abd1(0x8a)]===!![]),mkdirSync(_0xca915a,{'recursive':!![],'mode':0x1c0});const _0x426614=existsSync(_0x39d5a0)?readFileSync(_0x39d5a0,_0x36abd1(0x95)):undefined;return materializeFiles(_0xca915a,_0x404196),removeStaleManagedFiles(_0xca915a,_0x268735,_0x404196),writeJsonAtomic(_0x3d6837,buildMetadata(_0x1c0e52,_0x19a75f,_0x2901fb[_0x36abd1(0x90)],_0x4fe6d0,_0x2901fb[_0x36abd1(0xbc)],_0x404196,_0x547136)),{'skill':_0x1c0e52,'scope':_0x19a75f,'dir':_0xca915a,'skillMdPath':_0x39d5a0,'metadataPath':_0x3d6837,'contentHash':_0x4fe6d0,'changed':_0x426614!==_0x5e6f7c};}export function reuseMaterializedRuntimeSkill(_0x13e224,_0x14ab6,_0x1f8ca2){const _0x2a9896=a161_0x3498,_0xbf8dc8=_0x13e224[_0x2a9896(0xa7)]?.['trim']();if(!_0xbf8dc8)return undefined;const _0xd9db4e=requireSkillCode(_0x13e224),_0x153541=getRuntimeSkillDir(_0x1f8ca2[_0x2a9896(0x87)],_0x1f8ca2[_0x2a9896(0x83)],_0x1f8ca2['appCode'],_0x14ab6,_0xd9db4e,_0x1f8ca2[_0x2a9896(0xb5)]),_0x275e5e=resolve(_0x153541,SKILL_FILE),_0x5046ee=resolve(_0x153541,METADATA_FILE),_0x345c77=readMetadataIfPresent(_0x5046ee);if(!_0x345c77||_0x345c77[_0x2a9896(0xb6)]!==0x2||_0x345c77[_0x2a9896(0x90)]!==_0x1f8ca2[_0x2a9896(0x90)]||_0x345c77[_0x2a9896(0x84)]!==_0x14ab6||_0x345c77['skillCode']!==_0xd9db4e||_0x345c77['version']!==_0xbf8dc8||_0x345c77['id']!==_0x13e224['id']||_0x345c77[_0x2a9896(0xa3)]!==_0x13e224['skillName']||_0x345c77['description']!==_0x13e224[_0x2a9896(0x9e)]||_0x345c77[_0x2a9896(0x8e)]!==_0x13e224[_0x2a9896(0x8e)]||_0x345c77[_0x2a9896(0xb1)]!==_0x13e224['status']||!_0x345c77[_0x2a9896(0x9a)]||!_0x345c77[_0x2a9896(0x97)]||!Object[_0x2a9896(0xac)](_0x345c77['fileHashes'],SKILL_FILE))return undefined;for(const [_0x428390,_0x3ec660]of Object['entries'](_0x345c77[_0x2a9896(0x97)])){if(!/^[a-f0-9]{64}$/[_0x2a9896(0x9b)](_0x3ec660))return undefined;const _0x39cb9c=resolveManagedFilePath(_0x153541,_0x428390);if(!existsSync(_0x39cb9c)||!lstatSync(_0x39cb9c)[_0x2a9896(0xb7)]())return undefined;if(bufferSha256(readFileSync(_0x39cb9c))!==_0x3ec660)return undefined;}return{'skill':_0x13e224,'scope':_0x14ab6,'dir':_0x153541,'skillMdPath':_0x275e5e,'metadataPath':_0x5046ee,'contentHash':_0x345c77['contentHash'],'changed':![]};}function withMaterializedSkillFrontmatter(_0x3895ed,_0x43584f,_0x2ba11a){const _0x109fc5=a161_0x3498,_0x41e723=skillDisplayName(_0x43584f,_0x2ba11a),_0x4938fd=_0x43584f['description']?.[_0x109fc5(0x82)]()||_0x41e723||_0x2ba11a;return normalizeLocalFiles(_0x3895ed)['map'](_0x1527f7=>{const _0xe8ad75=_0x109fc5,_0x340827=fileText(_0x1527f7);if(_0x1527f7[_0xe8ad75(0xb0)]!==SKILL_FILE)return _0x1527f7;if(hasYamlFrontmatter(_0x340827))return{'path':_0x1527f7['path'],'content':withSyncedDisplayName(_0x340827,_0x41e723)};return{'path':_0x1527f7[_0xe8ad75(0xb0)],'content':prependSkillFrontmatter(_0x340827,{'name':_0x2ba11a,'displayName':_0x41e723,'description':_0x4938fd})};});}function hasYamlFrontmatter(_0x514ae6){const _0x52d96b=a161_0x3498;return/^\uFEFF?---\s*\r?\n/[_0x52d96b(0x9b)](_0x514ae6);}function prependSkillFrontmatter(_0x3ec3de,_0x1fc2cc){const _0x4faaee=a161_0x3498,_0x2d50c1=_0x3ec3de[_0x4faaee(0xb9)](/^\uFEFF/,'');return[_0x4faaee(0xad),_0x4faaee(0xab)+yamlString(_0x1fc2cc[_0x4faaee(0x8f)]),_0x1fc2cc['displayName']?_0x4faaee(0xb3)+yamlString(_0x1fc2cc[_0x4faaee(0xaa)]):undefined,_0x4faaee(0x93)+yamlString(_0x1fc2cc[_0x4faaee(0x9e)]),'---','',_0x2d50c1]['filter'](_0x5be7c5=>_0x5be7c5!==undefined)[_0x4faaee(0x9f)]('\x0a');}function yamlString(_0x2fea14){const _0x4471f1=a161_0x3498;return JSON[_0x4471f1(0xb8)](_0x2fea14[_0x4471f1(0xb9)](/\r/g,'')[_0x4471f1(0x82)]());}function skillDisplayName(_0x53ef19,_0x25eaa7){const _0x5abcd1=a161_0x3498,_0x2a3c79=_0x53ef19[_0x5abcd1(0xa3)]?.[_0x5abcd1(0x82)]();return _0x2a3c79||_0x25eaa7;}function withSyncedDisplayName(_0xc45704,_0x54287e){const _0xb1a439=a161_0x3498,_0x192d45=_0xc45704[_0xb1a439(0x81)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x192d45)return _0xc45704;const _0x439cd6=_0x192d45[0x1]??'',_0x33a302=_0x192d45[0x2]??'',_0x267dc3=parseDocument(_0x33a302);if(_0x267dc3[_0xb1a439(0x8c)][_0xb1a439(0x9d)]>0x0||!isMap(_0x267dc3['contents']))return _0xc45704;if(_0x54287e)_0x267dc3[_0xb1a439(0x8d)](_0xb1a439(0xaa),_0x54287e);else{if(_0x267dc3['has'](_0xb1a439(0xaa)))_0x267dc3[_0xb1a439(0xa8)](_0xb1a439(0xaa));else return _0xc45704;}forceBlockCollections(_0x267dc3[_0xb1a439(0x89)]);const _0x4c36a9=_0x267dc3['toString']({'lineWidth':0x0})[_0xb1a439(0xb4)](),_0x1d54bb=_0xc45704['slice'](_0x192d45[0x0][_0xb1a439(0x9d)])[_0xb1a439(0xb9)](/^\r?\n/,'');return _0x439cd6+_0xb1a439(0xba)+_0x4c36a9+_0xb1a439(0x96)+_0x1d54bb;}function forceBlockCollections(_0x6f0829){if(!isNode(_0x6f0829))return;visit(_0x6f0829,(_0x13a282,_0x2c967d)=>{const _0x2f7113=a161_0x3498;isCollection(_0x2c967d)&&(_0x2c967d[_0x2f7113(0x88)]=![]);});}function ensurePulledFilesCanBeOverwritten(_0x2b4993,_0x16323c,_0x572192,_0x4cd455){const _0x28053e=a161_0x3498;if(_0x4cd455||!existsSync(_0x16323c))return;const _0x6ba330=readMetadataIfPresent(_0x16323c);if(!_0x6ba330)return;const _0x34fed0=_0x6ba330[_0x28053e(0x97)]&&Object[_0x28053e(0x8b)](_0x6ba330[_0x28053e(0x97)])[_0x28053e(0x9d)]>0x0?_0x6ba330[_0x28053e(0x97)]:undefined;if(_0x34fed0)for(const [_0x5ea872,_0x4285c5]of Object[_0x28053e(0x86)](_0x34fed0)){const _0x33243a=resolveManagedFilePath(_0x2b4993,_0x5ea872);if(!existsSync(_0x33243a))throw CliErrors['validation'](_0x28053e(0xa5)+_0x2b4993,'Managed\x20file\x20was\x20removed\x20locally:\x20'+_0x5ea872);const _0x558a59=lstatSync(_0x33243a);if(!_0x558a59[_0x28053e(0xb7)]())throw CliErrors['validation']('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x2b4993,'Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20'+_0x5ea872);const _0x5d15a7=bufferSha256(readFileSync(_0x33243a));if(_0x5d15a7!==_0x4285c5)throw CliErrors['validation'](_0x28053e(0xa5)+_0x2b4993+_0x28053e(0xa6)+_0x5ea872,_0x28053e(0xa1)+_0x5ea872);}else{const _0x1393fd=resolve(_0x2b4993,SKILL_FILE);if(existsSync(_0x1393fd)&&_0x6ba330[_0x28053e(0x9a)]){const _0x210255=contentHash(readFileSync(_0x1393fd,_0x28053e(0x95)));if(_0x210255!==_0x6ba330[_0x28053e(0x9a)])throw CliErrors['validation'](_0x28053e(0xbd)+_0x1393fd,_0x28053e(0xbb));}}for(const _0x2c13e0 of normalizeLocalFiles(_0x572192)){if(_0x34fed0?.[_0x2c13e0[_0x28053e(0xb0)]])continue;if(!_0x34fed0&&_0x2c13e0[_0x28053e(0xb0)]===SKILL_FILE)continue;const _0x910002=resolveManagedFilePath(_0x2b4993,_0x2c13e0['path']);if(!existsSync(_0x910002))continue;const _0x2eae8e=lstatSync(_0x910002);if(!_0x2eae8e[_0x28053e(0xb7)]())throw CliErrors[_0x28053e(0xa4)](_0x28053e(0xa5)+_0x2b4993,_0x28053e(0xbe)+_0x2c13e0[_0x28053e(0xb0)]);const _0x1acd89=bufferSha256(readFileSync(_0x910002));if(_0x1acd89!==fileHash(_0x2c13e0))throw CliErrors['validation'](_0x28053e(0xa5)+_0x2b4993,'Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20'+_0x2c13e0[_0x28053e(0xb0)]);}}function materializeFiles(_0x4f78ec,_0xad69e0){const _0x49edcb=a161_0x3498;for(const _0x220c99 of normalizeLocalFiles(_0xad69e0)){const _0x2bd87f=resolveManagedFilePath(_0x4f78ec,_0x220c99[_0x49edcb(0xb0)]);mkdirSync(dirname(_0x2bd87f),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x2bd87f,fileContent(_0x220c99),0x180);}}function removeStaleManagedFiles(_0x5c81c1,_0x244e1d,_0x10acbe){const _0x1031dd=a161_0x3498;if(!_0x244e1d)return;const _0x4717b7=new Set(normalizeLocalFiles(_0x10acbe)[_0x1031dd(0xae)](_0x18d846=>_0x18d846[_0x1031dd(0xb0)]));for(const _0x5f11dc of Object[_0x1031dd(0x8b)](_0x244e1d)){if(_0x4717b7[_0x1031dd(0x91)](_0x5f11dc))continue;const _0x19fbce=resolveManagedFilePath(_0x5c81c1,_0x5f11dc);existsSync(_0x19fbce)&&lstatSync(_0x19fbce)[_0x1031dd(0xb7)]()&&rmSync(_0x19fbce,{'force':!![]});}}