@lovrabet/lovrabet-cli 2.3.8 → 2.3.9-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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_0x11e1bd=a150_0x212c;(function(_0x4e02fc,_0x11c41f){const _0x463664=a150_0x212c,_0x14c620=_0x4e02fc();while(!![]){try{const _0xda2454=parseInt(_0x463664(0x10a))/0x1+parseInt(_0x463664(0xf9))/0x2+-parseInt(_0x463664(0xd7))/0x3+parseInt(_0x463664(0xe5))/0x4+parseInt(_0x463664(0xb0))/0x5*(parseInt(_0x463664(0xa1))/0x6)+-parseInt(_0x463664(0xde))/0x7+-parseInt(_0x463664(0x9c))/0x8;if(_0xda2454===_0x11c41f)break;else _0x14c620['push'](_0x14c620['shift']());}catch(_0x3554a6){_0x14c620['push'](_0x14c620['shift']());}}}(a150_0x579f,0x4d5c1));import{randomBytes,randomUUID}from'node:crypto';function a150_0x579f(){const _0x4e0a24=['Import\x20checkpoint\x20already\x20exists;\x20use\x20--resume.','sheet','code','lbswuaCacheId','unknown','1475856wOpOHN','country','ESRCH','catch','join','726zdxlYX','size','ids','onCheckpointReady','cityAdcode','.lock','The\x20fixed-ID\x20runner\x20requires\x20the\x20v1\x20import\x20contract.','isSymbolicLink','ENOENT','batchSize','fileHash','fixed-negative-id','appCode','Import\x20checkpoint\x20contains\x20a\x20content\x20conflict.','length','7805dVcyRU','district','close','kill','parse','pid','Import\x20checkpoint\x20does\x20not\x20match\x20the\x20input,\x20target\x20or\x20identity.','push','Invalid\x20or\x20duplicate\x20import\x20readback\x20ID.','accuracy','slice','importId','geolocation','.tmp-','previewUrl','city','undefined','EEXIST','sync','maxBatchSize','key','string','count','includes','checkpoint','byteLength','pending','schemaVersion','.lock.recovery','districtAdcode','Cannot\x20read\x20the\x20import\x20checkpoint.','road','datasetCode','Import\x20primary\x20key\x20collision;\x20stop\x20without\x20replacing\x20the\x20fixed\x20IDs.','map','strategy','source','type','isArray','1452375zmTTKX','values','longitude','maxBatchBytes','warnings','mappingHash','status','2468767tHMuhz','has','filter','countryCode','Invalid\x20import\x20readback\x20response.','The\x20import\x20write\x20outcome\x20is\x20unknown.\x20Resume\x20to\x20reconcile\x20the\x20fixed\x20IDs\x20before\x20continuing.','schemaFingerprint','2026756bfChwf','every','The\x20import\x20checkpoint\x20is\x20locked\x20by\x20a\x20running\x20process.','latitude','toString','object','rowNumber','.recovery','isSafeInteger','schemaHash','succeeded','Excel\x20row\x20','report','stringify','unsent','message','url','rows','conflict','Incomplete\x20readback.','473690zivIAU','resultCode','entries','errorMessage','uploadFields','Excel\x20contains\x20no\x20valid\x20data\x20rows.','completed','now','readback','streetNumber','Excel\x20contains\x20invalid\x20rows;\x20no\x20data\x20was\x20written.','Import\x20lock\x20changed;\x20retry\x20recovery.','writeFile','actorId','\x20exceeds\x20the\x20import\x20request\x20size\x20limit.','some','Import\x20content\x20conflict\x20at\x20Excel\x20row\x20','405738LOEeOI','utf8','keys','Invalid\x20write\x20result.','Previously\x20imported\x20records\x20are\x20no\x20longer\x20visible;\x20recovery\x20stopped.','createUserName','runtimeDomain','dingTalkUrl','Invalid\x20import\x20batch\x20size.'];a150_0x579f=function(){return _0x4e0a24;};return a150_0x579f();}import{lstat,open,readFile,realpath,rename,unlink}from'node:fs/promises';import{resolve,dirname,basename}from'node:path';export function canonical(_0x1bf6d7){const _0x2bcd50=a150_0x212c;if(Array['isArray'](_0x1bf6d7))return'['+_0x1bf6d7[_0x2bcd50(0xd2)](canonical)[_0x2bcd50(0xa0)](',')+']';if(_0x1bf6d7&&typeof _0x1bf6d7==='object')return'{'+Object[_0x2bcd50(0x10c)](_0x1bf6d7)['sort']()['map'](_0x15dc13=>JSON[_0x2bcd50(0xf2)](_0x15dc13)+':'+canonical(_0x1bf6d7[_0x15dc13]))[_0x2bcd50(0xa0)](',')+'}';return JSON[_0x2bcd50(0xf2)](_0x1bf6d7)??_0x2bcd50(0xc0);}function a150_0x212c(_0x3e7bf8,_0x106061){_0x3e7bf8=_0x3e7bf8-0x91;const _0x579f8c=a150_0x579f();let _0x212cd1=_0x579f8c[_0x3e7bf8];return _0x212cd1;}const EMPTY_IMAGE_LOCATION_FIELDS=new Set(['time','operatorType',a150_0x11e1bd(0xcd),a150_0x11e1bd(0xb1),'pois',a150_0x11e1bd(0xcf),a150_0x11e1bd(0x9d),a150_0x11e1bd(0xe1),'province',a150_0x11e1bd(0xe8),a150_0x11e1bd(0xbf),'netType',a150_0x11e1bd(0xfa),a150_0x11e1bd(0x102),a150_0x11e1bd(0xb9),a150_0x11e1bd(0xd9),a150_0x11e1bd(0xa5),a150_0x11e1bd(0xfc),'address',a150_0x11e1bd(0x9a)]);export function sameImportValue(_0x1973fd,_0x422bac,_0x3b050d=![]){const _0x336a25=a150_0x11e1bd;if(_0x3b050d){const _0x2c9545=_0x40cdb6=>Array[_0x336a25(0xd6)](_0x40cdb6)?_0x40cdb6['map'](_0x4db2a2=>{const _0x160006=_0x336a25;if(!_0x4db2a2||typeof _0x4db2a2!==_0x160006(0xea)||Array['isArray'](_0x4db2a2))return _0x4db2a2;const _0x54b4d0={..._0x4db2a2};delete _0x54b4d0[_0x160006(0xf5)],delete _0x54b4d0[_0x160006(0xbe)];if(_0x54b4d0[_0x160006(0x95)]==='')delete _0x54b4d0['dingTalkUrl'];if(_0x54b4d0['createUserId']==null)delete _0x54b4d0['createUserId'];if(_0x54b4d0[_0x160006(0x93)]==null)delete _0x54b4d0[_0x160006(0x93)];if(_0x54b4d0[_0x160006(0xbc)]==null||typeof _0x54b4d0[_0x160006(0xbc)]===_0x160006(0xea)&&!Array['isArray'](_0x54b4d0[_0x160006(0xbc)])&&Object[_0x160006(0xfb)](_0x54b4d0[_0x160006(0xbc)])[_0x160006(0xe6)](([_0x230cd6,_0x34a2bd])=>EMPTY_IMAGE_LOCATION_FIELDS[_0x160006(0xdf)](_0x230cd6)&&_0x34a2bd===null))delete _0x54b4d0['geolocation'];for(const _0x53cd56 of['name',_0x160006(0xd5),_0x160006(0xc4)])if(!(_0x53cd56 in _0x54b4d0))_0x54b4d0[_0x53cd56]='';if(_0x54b4d0[_0x160006(0xa2)]==null)_0x54b4d0[_0x160006(0xa2)]=0x0;return _0x54b4d0;}):_0x40cdb6;return canonical(_0x2c9545(_0x1973fd))===canonical(_0x2c9545(_0x422bac));}return _0x1973fd===null?_0x422bac===null||_0x422bac===undefined:canonical(_0x422bac)===canonical(_0x1973fd);}async function rejectSymlink(_0x14fbb3){const _0x426d4b=a150_0x11e1bd;try{if((await lstat(_0x14fbb3))[_0x426d4b(0xa8)]())throw Error('Import\x20output\x20must\x20not\x20be\x20a\x20symbolic\x20link.');}catch(_0x2ec1a1){if(_0x2ec1a1[_0x426d4b(0x99)]!==_0x426d4b(0xa9))throw _0x2ec1a1;}}export async function resolveImportOutputPath(_0x2b79ea){return await rejectSymlink(_0x2b79ea),resolve(await realpath(dirname(resolve(_0x2b79ea))),basename(_0x2b79ea));}export function assertImportPaths(_0x2bc0f0,_0x5b9269,_0x20a2d0=[]){const _0x24fa00=a150_0x11e1bd,_0x1196cb=[..._0x20a2d0,_0x2bc0f0,_0x5b9269,_0x2bc0f0+_0x24fa00(0xa6),_0x2bc0f0+_0x24fa00(0xcc)]['map'](_0x5196af=>resolve(_0x5196af));if(new Set(_0x1196cb)[_0x24fa00(0xa2)]!==_0x1196cb[_0x24fa00(0xaf)])throw Error('Import\x20input,\x20output\x20and\x20lock\x20paths\x20must\x20be\x20different\x20files.');}export async function saveImportJson(_0x36def5,_0x3b6578){const _0x16b868=a150_0x11e1bd;await rejectSymlink(_0x36def5);const _0x1fc2cf=_0x36def5+_0x16b868(0xbd)+randomUUID(),_0x30f684=await open(_0x1fc2cf,'wx',0x180);try{await _0x30f684['writeFile'](JSON[_0x16b868(0xf2)](_0x3b6578,null,0x2)),await _0x30f684[_0x16b868(0xc2)]();}finally{await _0x30f684[_0x16b868(0xb2)]();}try{await rename(_0x1fc2cf,_0x36def5);}catch(_0x11f4c7){await unlink(_0x1fc2cf)[_0x16b868(0x9f)](()=>{});throw _0x11f4c7;}}export async function acquireLock(_0x51ed44){const _0x45fe06=a150_0x11e1bd,_0x59ce51=_0x51ed44+'.lock',_0x3e9998=randomUUID();await rejectSymlink(_0x59ce51);const _0x186403=_0x59ce51+_0x45fe06(0xec);let _0xa3174,_0x15e79c;try{try{_0xa3174=await open(_0x59ce51,'wx',0x180);}catch(_0x194bde){if(_0x194bde[_0x45fe06(0x99)]!==_0x45fe06(0xc1))throw _0x194bde;try{_0x15e79c=await open(_0x186403,'wx',0x180);}catch(_0x22b3d4){if(_0x22b3d4[_0x45fe06(0x99)]===_0x45fe06(0xc1))throw Error('Import\x20lock\x20recovery\x20is\x20active\x20or\x20interrupted;\x20inspect\x20the\x20recovery\x20guard\x20before\x20retrying.');throw _0x22b3d4;}await _0x15e79c[_0x45fe06(0x105)](JSON[_0x45fe06(0xf2)]({'pid':process[_0x45fe06(0xb5)],'token':_0x3e9998})),await _0x15e79c['sync'](),await rejectSymlink(_0x59ce51);let _0x1392e6;try{_0x1392e6=await readFile(_0x59ce51,_0x45fe06(0x10b));}catch(_0x337c77){if(_0x337c77[_0x45fe06(0x99)]!==_0x45fe06(0xa9))throw _0x337c77;}if(_0x1392e6!==undefined){let _0x250ad6;try{_0x250ad6=JSON['parse'](_0x1392e6);}catch{throw Error('Invalid\x20import\x20lock;\x20inspect\x20it\x20before\x20recovery.');}if(!_0x250ad6||!Number['isSafeInteger'](_0x250ad6['pid'])||_0x250ad6[_0x45fe06(0xb5)]<=0x0)throw Error('Invalid\x20import\x20lock\x20owner.');try{process[_0x45fe06(0xb3)](_0x250ad6[_0x45fe06(0xb5)],0x0);throw Error(_0x45fe06(0xe7));}catch(_0x2dd8b9){if(_0x2dd8b9[_0x45fe06(0x99)]!==_0x45fe06(0x9e))throw _0x2dd8b9;}if(await readFile(_0x59ce51,_0x45fe06(0x10b))!==_0x1392e6)throw Error(_0x45fe06(0x104));await unlink(_0x59ce51);}_0xa3174=await open(_0x59ce51,'wx',0x180);}await _0xa3174['writeFile'](JSON[_0x45fe06(0xf2)]({'pid':process[_0x45fe06(0xb5)],'token':_0x3e9998})),await _0xa3174[_0x45fe06(0xc2)]();}finally{try{await _0xa3174?.[_0x45fe06(0xb2)]();}finally{if(_0x15e79c)try{await _0x15e79c[_0x45fe06(0xb2)]();}finally{await unlink(_0x186403);}}}return async()=>{const _0xfb0a49=_0x45fe06;if(JSON[_0xfb0a49(0xb4)](await readFile(_0x59ce51,_0xfb0a49(0x10b)))['token']===_0x3e9998)await unlink(_0x59ce51);};}export function assertImportContract(_0x229add,_0x13cd69,_0x5b2049){const _0x702b8e=a150_0x11e1bd;if(!_0x229add||!(_0x229add[_0x702b8e(0xcb)]===0x1&&_0x229add[_0x702b8e(0xd3)]===_0x702b8e(0xac)||_0x229add['schemaVersion']===0x2&&_0x229add[_0x702b8e(0xd3)]==='auto-id-task-marker')||_0x229add[_0x702b8e(0xd4)]!=='METADATA'||_0x229add[_0x702b8e(0xad)]!==_0x13cd69||_0x229add[_0x702b8e(0xd0)]!==_0x5b2049||typeof _0x229add[_0x702b8e(0x106)]!==_0x702b8e(0xc5)||!_0x229add[_0x702b8e(0x106)]||typeof _0x229add['schemaFingerprint']!==_0x702b8e(0xc5)||!_0x229add[_0x702b8e(0xe4)]||!Number[_0x702b8e(0xed)](_0x229add[_0x702b8e(0xc3)])||_0x229add[_0x702b8e(0xc3)]<0x1||_0x229add[_0x702b8e(0xc3)]>0x3e8||!Number[_0x702b8e(0xed)](_0x229add[_0x702b8e(0xda)])||_0x229add[_0x702b8e(0xda)]<0x1||_0x229add['maxBatchBytes']>0x14*0x400*0x400)throw Error('The\x20server\x20import\x20contract\x20is\x20unsupported\x20or\x20incomplete.');}export async function runExcelImport(_0x396e3c){const _0x39fd76=a150_0x11e1bd;_0x396e3c={..._0x396e3c,'checkpoint':await resolveImportOutputPath(_0x396e3c['checkpoint']),'report':await resolveImportOutputPath(_0x396e3c[_0x39fd76(0xf1)])};const {manifest:_0x5ab86a,contract:_0x480c61,api:_0x3a62c3}=_0x396e3c;assertImportContract(_0x480c61,_0x396e3c['appCode'],_0x396e3c[_0x39fd76(0xd0)]);if(_0x480c61[_0x39fd76(0xcb)]!==0x1)throw Error(_0x39fd76(0xa7));if(_0x5ab86a['errors'][_0x39fd76(0xaf)])throw Error(_0x39fd76(0x103));if(!_0x5ab86a[_0x39fd76(0xf6)][_0x39fd76(0xaf)])throw Error(_0x39fd76(0xfe));if(!Number['isInteger'](_0x396e3c[_0x39fd76(0xaa)])||_0x396e3c[_0x39fd76(0xaa)]<0x1||_0x396e3c[_0x39fd76(0xaa)]>_0x480c61[_0x39fd76(0xc3)])throw Error(_0x39fd76(0x96));for(const _0x5187b7 of _0x5ab86a[_0x39fd76(0xf6)]){if(Buffer[_0x39fd76(0xc9)](JSON[_0x39fd76(0xf2)]({'schemaFingerprint':_0x480c61[_0x39fd76(0xe4)],'items':[{..._0x5187b7[_0x39fd76(0xd8)],'id':-0x1fffffffffffff}]}),'utf8')>_0x480c61[_0x39fd76(0xda)])throw Error(_0x39fd76(0xf0)+_0x5187b7[_0x39fd76(0xeb)]+'\x20exceeds\x20the\x20import\x20request\x20size\x20limit.');}assertImportPaths(_0x396e3c[_0x39fd76(0xc8)],_0x396e3c[_0x39fd76(0xf1)]);const _0x18e89a={'appCode':_0x396e3c[_0x39fd76(0xad)],'datasetCode':_0x396e3c['datasetCode'],'runtimeDomain':_0x396e3c[_0x39fd76(0x94)],'actorId':_0x480c61[_0x39fd76(0x106)],'fileHash':_0x5ab86a[_0x39fd76(0xab)],'mappingHash':_0x5ab86a[_0x39fd76(0xdc)],'schemaHash':_0x5ab86a[_0x39fd76(0xee)],'remoteSchemaHash':_0x480c61[_0x39fd76(0xe4)],'batchSize':_0x396e3c[_0x39fd76(0xaa)],'sheet':_0x5ab86a[_0x39fd76(0x98)]},_0x52ddc1=await acquireLock(_0x396e3c[_0x39fd76(0xc8)]);let _0x324752;const _0x2f4ee6=Date[_0x39fd76(0x100)]();let _0x248720=0x0;const _0x1f8097=[],_0x5d6afd=()=>({'importId':_0x324752?.[_0x39fd76(0xbb)],'sourceRows':_0x5ab86a[_0x39fd76(0xf6)][_0x39fd76(0xaf)],'emptyRows':_0x5ab86a['emptyRows'][_0x39fd76(0xaf)],'succeeded':_0x324752?.[_0x39fd76(0xf6)][_0x39fd76(0xe0)](_0x4c1409=>_0x4c1409[_0x39fd76(0xdd)]===_0x39fd76(0xef))[_0x39fd76(0xaf)]??0x0,'unknown':_0x324752?.[_0x39fd76(0xf6)][_0x39fd76(0xe0)](_0x14f5b2=>_0x14f5b2['status']===_0x39fd76(0xca))[_0x39fd76(0xaf)]??0x0,'conflicts':_0x324752?.[_0x39fd76(0xf6)][_0x39fd76(0xe0)](_0x2b7aee=>_0x2b7aee[_0x39fd76(0xdd)]===_0x39fd76(0xf7))['length']??0x0,'notAttempted':_0x324752?.['rows'][_0x39fd76(0xe0)](_0x54c68e=>_0x54c68e[_0x39fd76(0xdd)]===_0x39fd76(0xf3))[_0x39fd76(0xaf)]??_0x5ab86a[_0x39fd76(0xf6)][_0x39fd76(0xaf)],'batches':_0x248720,'batchResults':_0x1f8097,'elapsedMs':Date[_0x39fd76(0x100)]()-_0x2f4ee6,'checkpoint':resolve(_0x396e3c[_0x39fd76(0xc8)]),'report':resolve(_0x396e3c[_0x39fd76(0xf1)]),'warnings':_0x5ab86a[_0x39fd76(0xdb)]});try{await rejectSymlink(_0x396e3c[_0x39fd76(0xc8)]);if(_0x396e3c['resume']){try{_0x324752=JSON[_0x39fd76(0xb4)](await readFile(_0x396e3c[_0x39fd76(0xc8)],_0x39fd76(0x10b)));}catch{throw Error(_0x39fd76(0xce));}if(!_0x324752||_0x324752['version']!==0x1||typeof _0x324752['importId']!==_0x39fd76(0xc5)||canonical(_0x324752['binding'])!==canonical(_0x18e89a)||!Array[_0x39fd76(0xd6)](_0x324752[_0x39fd76(0xf6)])||_0x324752['rows'][_0x39fd76(0xaf)]!==_0x5ab86a[_0x39fd76(0xf6)][_0x39fd76(0xaf)]||new Set(_0x324752['rows'][_0x39fd76(0xd2)](_0x18094c=>_0x18094c['id']))['size']!==_0x324752[_0x39fd76(0xf6)][_0x39fd76(0xaf)]||_0x324752[_0x39fd76(0xf6)]['some']((_0x1181a0,_0x1da5e8)=>!Number[_0x39fd76(0xed)](_0x1181a0['id'])||_0x1181a0['id']>=0x0||_0x1181a0[_0x39fd76(0xeb)]!==_0x5ab86a['rows'][_0x1da5e8][_0x39fd76(0xeb)]||![_0x39fd76(0xf3),_0x39fd76(0xca),_0x39fd76(0xef),_0x39fd76(0xf7)][_0x39fd76(0xc7)](_0x1181a0[_0x39fd76(0xdd)])))throw Error(_0x39fd76(0xb6));}else{try{await lstat(_0x396e3c[_0x39fd76(0xc8)]);throw Error(_0x39fd76(0x97));}catch(_0x3e0090){if(_0x3e0090[_0x39fd76(0x99)]!==_0x39fd76(0xa9))throw _0x3e0090;}const _0x2756bb=new Set();_0x324752={'version':0x1,'importId':randomUUID(),'binding':_0x18e89a,'rows':_0x5ab86a[_0x39fd76(0xf6)][_0x39fd76(0xd2)](_0x279d73=>{const _0x727f59=_0x39fd76;let _0x5c2410;do{_0x5c2410=-(Number(BigInt('0x'+randomBytes(0x7)[_0x727f59(0xe9)]('hex'))&(0x1n<<0x34n)-0x1n)+0x1);}while(_0x2756bb[_0x727f59(0xdf)](_0x5c2410));return _0x2756bb['add'](_0x5c2410),{'id':_0x5c2410,'rowNumber':_0x279d73[_0x727f59(0xeb)],'status':_0x727f59(0xf3)};})},await saveImportJson(_0x396e3c[_0x39fd76(0xc8)],_0x324752);}await _0x396e3c[_0x39fd76(0xa4)]?.();const _0x2b69dc=_0x324752;if(_0x2b69dc[_0x39fd76(0xf6)]['some'](_0x4441b3=>_0x4441b3[_0x39fd76(0xdd)]===_0x39fd76(0xf7)))throw Error(_0x39fd76(0xae));const _0x1904de=async _0x1f4be1=>{const _0x5f0263=_0x39fd76,_0x436f50=await _0x3a62c3[_0x5f0263(0x101)](_0x1f4be1[_0x5f0263(0xd2)](_0x2194bb=>_0x2b69dc[_0x5f0263(0xf6)][_0x2194bb]['id']));if(!Array[_0x5f0263(0xd6)](_0x436f50))throw Error(_0x5f0263(0xe2));const _0x287a11=new Set(_0x1f4be1[_0x5f0263(0xd2)](_0x2c23a3=>_0x2b69dc[_0x5f0263(0xf6)][_0x2c23a3]['id'])),_0x3c8b01=new Map();for(const _0x41c903 of _0x436f50){const _0x4ff0e5=Number(_0x41c903?.['id']);if(!_0x287a11['has'](_0x4ff0e5)||_0x3c8b01['has'](_0x4ff0e5))throw Error(_0x5f0263(0xb8));_0x3c8b01['set'](_0x4ff0e5,_0x41c903);}for(const _0x23a773 of _0x1f4be1){const _0x5d0dfb=_0x3c8b01['get'](_0x2b69dc['rows'][_0x23a773]['id']);if(!_0x5d0dfb)continue;if(_0x2b69dc[_0x5f0263(0xf6)][_0x23a773][_0x5f0263(0xdd)]===_0x5f0263(0xf3)){_0x2b69dc[_0x5f0263(0xf6)][_0x23a773][_0x5f0263(0xdd)]=_0x5f0263(0xf7),await saveImportJson(_0x396e3c['checkpoint'],_0x2b69dc);throw Error(_0x5f0263(0xd1));}const _0x2b1679=_0x5ab86a['rows'][_0x23a773]['values'];if(Object['keys'](_0x2b1679)[_0x5f0263(0x108)](_0x2c79ea=>!sameImportValue(_0x2b1679[_0x2c79ea],_0x5d0dfb[_0x2c79ea],_0x5ab86a['imageFields']?.[_0x5f0263(0xc7)](_0x2c79ea)&&!_0x5ab86a[_0x5f0263(0xfd)]?.[_0x5f0263(0xc7)](_0x2c79ea)))){_0x2b69dc[_0x5f0263(0xf6)][_0x23a773]['status']=_0x5f0263(0xf7),await saveImportJson(_0x396e3c[_0x5f0263(0xc8)],_0x2b69dc);throw Error(_0x5f0263(0x109)+_0x2b69dc[_0x5f0263(0xf6)][_0x23a773][_0x5f0263(0xeb)]+'.');}_0x2b69dc[_0x5f0263(0xf6)][_0x23a773][_0x5f0263(0xdd)]=_0x5f0263(0xef);}return await saveImportJson(_0x396e3c['checkpoint'],_0x2b69dc),_0x3c8b01;};if(_0x396e3c['resume'])for(let _0x10ff85=0x0;_0x10ff85<_0x2b69dc[_0x39fd76(0xf6)][_0x39fd76(0xaf)];_0x10ff85+=_0x396e3c[_0x39fd76(0xaa)]){const _0x440999=_0x2b69dc[_0x39fd76(0xf6)][_0x39fd76(0xba)](_0x10ff85,_0x10ff85+_0x396e3c[_0x39fd76(0xaa)])[_0x39fd76(0xd2)]((_0xd10319,_0x16308a)=>_0x10ff85+_0x16308a),_0x2b7e29=_0x440999[_0x39fd76(0xe0)](_0x1b3422=>_0x2b69dc[_0x39fd76(0xf6)][_0x1b3422][_0x39fd76(0xdd)]===_0x39fd76(0xef)),_0x33f754=await _0x1904de(_0x440999),_0x27a105=_0x2b7e29[_0x39fd76(0xe0)](_0x26af7d=>!_0x33f754['has'](_0x2b69dc[_0x39fd76(0xf6)][_0x26af7d]['id']));if(_0x27a105[_0x39fd76(0xaf)]){_0x27a105['forEach'](_0x33f4f5=>{const _0x514bb9=_0x39fd76;_0x2b69dc[_0x514bb9(0xf6)][_0x33f4f5][_0x514bb9(0xdd)]=_0x514bb9(0xf7);}),await saveImportJson(_0x396e3c['checkpoint'],_0x2b69dc);throw Error(_0x39fd76(0x92));}}for(let _0x1dd7a5=0x0;_0x1dd7a5<_0x2b69dc[_0x39fd76(0xf6)][_0x39fd76(0xaf)];){const _0x5a8fc3=[],_0xa1c7f=[];while(_0x1dd7a5<_0x2b69dc[_0x39fd76(0xf6)][_0x39fd76(0xaf)]&&_0xa1c7f[_0x39fd76(0xaf)]<_0x396e3c[_0x39fd76(0xaa)]){const _0x56fd37=_0x1dd7a5++;if(_0x2b69dc[_0x39fd76(0xf6)][_0x56fd37][_0x39fd76(0xdd)]===_0x39fd76(0xef))continue;const _0x403c5e={..._0x5ab86a[_0x39fd76(0xf6)][_0x56fd37][_0x39fd76(0xd8)],'id':_0x2b69dc[_0x39fd76(0xf6)][_0x56fd37]['id']};if(Buffer[_0x39fd76(0xc9)](JSON['stringify']({'schemaFingerprint':_0x480c61[_0x39fd76(0xe4)],'items':[..._0xa1c7f,_0x403c5e]}),_0x39fd76(0x10b))>_0x480c61[_0x39fd76(0xda)]){if(!_0xa1c7f[_0x39fd76(0xaf)])throw Error(_0x39fd76(0xf0)+_0x2b69dc[_0x39fd76(0xf6)][_0x56fd37][_0x39fd76(0xeb)]+_0x39fd76(0x107));_0x1dd7a5--;break;}_0x5a8fc3[_0x39fd76(0xb7)](_0x56fd37),_0xa1c7f[_0x39fd76(0xb7)](_0x403c5e);}if(!_0xa1c7f[_0x39fd76(0xaf)])continue;const _0x390a9c=_0x5a8fc3[_0x39fd76(0xe0)](_0x1ac282=>_0x2b69dc[_0x39fd76(0xf6)][_0x1ac282][_0x39fd76(0xdd)]===_0x39fd76(0xf3));if(_0x390a9c[_0x39fd76(0xaf)]){const _0x49d48c=await _0x3a62c3[_0x39fd76(0x101)](_0x390a9c[_0x39fd76(0xd2)](_0x673be0=>_0x2b69dc[_0x39fd76(0xf6)][_0x673be0]['id']));if(!Array[_0x39fd76(0xd6)](_0x49d48c))throw Error(_0x39fd76(0xe2));if(_0x49d48c[_0x39fd76(0xaf)])throw Error(_0x39fd76(0xd1));}_0x5a8fc3['forEach'](_0x11229d=>{const _0x4c7f86=_0x39fd76;_0x2b69dc[_0x4c7f86(0xf6)][_0x11229d][_0x4c7f86(0xdd)]=_0x4c7f86(0xca);}),await saveImportJson(_0x396e3c['checkpoint'],_0x2b69dc),_0x248720++;const _0x388d9d=Date[_0x39fd76(0x100)](),_0x4e4214={'batch':_0x248720,'rowStart':_0x2b69dc[_0x39fd76(0xf6)][_0x5a8fc3[0x0]][_0x39fd76(0xeb)],'rowEnd':_0x2b69dc[_0x39fd76(0xf6)][_0x5a8fc3[_0x5a8fc3[_0x39fd76(0xaf)]-0x1]]['rowNumber'],'count':_0xa1c7f[_0x39fd76(0xaf)],'bytes':Buffer[_0x39fd76(0xc9)](JSON['stringify']({'schemaFingerprint':_0x480c61[_0x39fd76(0xe4)],'items':_0xa1c7f}),'utf8'),'elapsedMs':0x0,'status':_0x39fd76(0x9b)};_0x1f8097[_0x39fd76(0xb7)](_0x4e4214);try{const _0x2c1c53=await _0x3a62c3['write'](_0xa1c7f);if(!_0x2c1c53||_0x2c1c53[_0x39fd76(0xc6)]!==_0xa1c7f['length']||!Array[_0x39fd76(0xd6)](_0x2c1c53[_0x39fd76(0xa3)])||_0x2c1c53[_0x39fd76(0xa3)][_0x39fd76(0xaf)]!==_0xa1c7f[_0x39fd76(0xaf)]||_0x2c1c53[_0x39fd76(0xa3)][_0x39fd76(0x108)]((_0x5c3719,_0x175586)=>Number(_0x5c3719)!==_0x2b69dc[_0x39fd76(0xf6)][_0x5a8fc3[_0x175586]]['id']))throw Error(_0x39fd76(0x91));await _0x1904de(_0x5a8fc3);if(_0x5a8fc3[_0x39fd76(0x108)](_0x209069=>_0x2b69dc[_0x39fd76(0xf6)][_0x209069][_0x39fd76(0xdd)]!=='succeeded'))throw Error(_0x39fd76(0xf8));}catch(_0xdd3339){if(_0x2b69dc[_0x39fd76(0xf6)][_0x39fd76(0x108)](_0x383506=>_0x383506[_0x39fd76(0xdd)]===_0x39fd76(0xf7)))throw _0xdd3339;try{await _0x1904de(_0x5a8fc3);}catch(_0x463b52){if(_0x2b69dc[_0x39fd76(0xf6)][_0x39fd76(0x108)](_0x4d2d5f=>_0x4d2d5f['status']===_0x39fd76(0xf7)))throw _0x463b52;}if(_0x5a8fc3['some'](_0xd74a47=>_0x2b69dc['rows'][_0xd74a47][_0x39fd76(0xdd)]!==_0x39fd76(0xef)))throw Error(_0x39fd76(0xe3));}finally{_0x4e4214['elapsedMs']=Date[_0x39fd76(0x100)]()-_0x388d9d;if(_0x5a8fc3['every'](_0x1a7727=>_0x2b69dc['rows'][_0x1a7727][_0x39fd76(0xdd)]==='succeeded'))_0x4e4214[_0x39fd76(0xdd)]=_0x39fd76(0xef);else{if(_0x5a8fc3[_0x39fd76(0x108)](_0x19f674=>_0x2b69dc[_0x39fd76(0xf6)][_0x19f674]['status']===_0x39fd76(0xf7)))_0x4e4214[_0x39fd76(0xdd)]='conflict';}}}const _0x5b25f0={'status':_0x39fd76(0xff),..._0x5d6afd()};return await saveImportJson(_0x396e3c[_0x39fd76(0xf1)],_0x5b25f0),_0x5b25f0;}catch(_0x2ecf0d){if(_0x324752)await saveImportJson(_0x396e3c[_0x39fd76(0xf1)],{'status':'incomplete',..._0x5d6afd(),'message':_0x2ecf0d[_0x39fd76(0xf4)]});throw _0x2ecf0d;}finally{await _0x52ddc1();}}
1
+ const a150_0x4f7467=a150_0x5db7;function a150_0x5db7(_0x354495,_0x1fe5b4){_0x354495=_0x354495-0x92;const _0x59da59=a150_0x59da();let _0x5db701=_0x59da59[_0x354495];return _0x5db701;}(function(_0x178fdd,_0x4f5323){const _0x16dfed=a150_0x5db7,_0x4530f1=_0x178fdd();while(!![]){try{const _0x560f8f=-parseInt(_0x16dfed(0xc5))/0x1+-parseInt(_0x16dfed(0xf3))/0x2*(parseInt(_0x16dfed(0xf5))/0x3)+parseInt(_0x16dfed(0x107))/0x4*(-parseInt(_0x16dfed(0x9e))/0x5)+parseInt(_0x16dfed(0x11a))/0x6+parseInt(_0x16dfed(0xc3))/0x7*(parseInt(_0x16dfed(0xfc))/0x8)+parseInt(_0x16dfed(0xc9))/0x9+-parseInt(_0x16dfed(0xcd))/0xa;if(_0x560f8f===_0x4f5323)break;else _0x4530f1['push'](_0x4530f1['shift']());}catch(_0x4c7698){_0x4530f1['push'](_0x4530f1['shift']());}}}(a150_0x59da,0x81bb2));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(_0x549801){const _0x4a7353=a150_0x5db7;if(Array['isArray'](_0x549801))return'['+_0x549801[_0x4a7353(0x9a)](canonical)[_0x4a7353(0xce)](',')+']';if(_0x549801&&typeof _0x549801===_0x4a7353(0x109))return'{'+Object[_0x4a7353(0xd4)](_0x549801)[_0x4a7353(0x112)]()[_0x4a7353(0x9a)](_0x994cf8=>JSON[_0x4a7353(0x10d)](_0x994cf8)+':'+canonical(_0x549801[_0x994cf8]))[_0x4a7353(0xce)](',')+'}';return JSON[_0x4a7353(0x10d)](_0x549801)??'undefined';}function a150_0x59da(){const _0x26ab11=['map','Incomplete\x20readback.','road','entries','5dAiJIz','elapsedMs','push','warnings','source','slice','rows','.lock','code','Invalid\x20import\x20lock;\x20inspect\x20it\x20before\x20recovery.','schemaVersion','.tmp-','Import\x20checkpoint\x20already\x20exists;\x20use\x20--resume.','kill','unknown','Excel\x20contains\x20no\x20valid\x20data\x20rows.','importId','get','name','The\x20fixed-ID\x20runner\x20requires\x20the\x20v1\x20import\x20contract.','Import\x20output\x20must\x20not\x20be\x20a\x20symbolic\x20link.','The\x20server\x20import\x20contract\x20is\x20unsupported\x20or\x20incomplete.','report','url','Import\x20input,\x20output\x20and\x20lock\x20paths\x20must\x20be\x20different\x20files.','ESRCH','incomplete','now','hex','length','time','Invalid\x20import\x20lock\x20owner.','message','createUserId','appCode','forEach','datasetCode','49mbYKAD','byteLength','358228ZCLAdx','Invalid\x20import\x20readback\x20response.','maxBatchBytes','version','9009558PLIvjp','sync','filter','parse','13923610CbPeEC','join','resultCode','maxBatchSize','The\x20import\x20write\x20outcome\x20is\x20unknown.\x20Resume\x20to\x20reconcile\x20the\x20fixed\x20IDs\x20before\x20continuing.','schemaFingerprint','province','keys','add','Import\x20lock\x20changed;\x20retry\x20recovery.','accuracy','utf8','writeFile','Import\x20checkpoint\x20contains\x20a\x20content\x20conflict.','errors','set','values','Excel\x20contains\x20invalid\x20rows;\x20no\x20data\x20was\x20written.','address','Excel\x20row\x20','isArray','Previously\x20imported\x20records\x20are\x20no\x20longer\x20visible;\x20recovery\x20stopped.','succeeded','cityAdcode','write','isInteger','lbswuaCacheId','conflict','Cannot\x20read\x20the\x20import\x20checkpoint.','dingTalkUrl','string','geolocation','METADATA','errorMessage','Import\x20content\x20conflict\x20at\x20Excel\x20row\x20','city','pid','ENOENT','240094pofcOl','The\x20import\x20checkpoint\x20is\x20locked\x20by\x20a\x20running\x20process.','6nrzHhA','toString','\x20exceeds\x20the\x20import\x20request\x20size\x20limit.','binding','previewUrl','resume','district','1146232viVFUn','count','mappingHash','actorId','districtAdcode','fixed-negative-id','auto-id-task-marker','isSafeInteger','catch','has','unsent','1640324IxzEMy','emptyRows','object','every','pending','readback','stringify','close','size','Invalid\x20import\x20batch\x20size.','countryCode','sort','EEXIST','uploadFields','pois','sheet','checkpoint','ids','streetNumber','5568762NggwLJ','rowNumber','Import\x20lock\x20recovery\x20is\x20active\x20or\x20interrupted;\x20inspect\x20the\x20recovery\x20guard\x20before\x20retrying.','type','includes','Import\x20checkpoint\x20does\x20not\x20match\x20the\x20input,\x20target\x20or\x20identity.','some','status','latitude','batchSize','token','createUserName','Invalid\x20write\x20result.','Import\x20primary\x20key\x20collision;\x20stop\x20without\x20replacing\x20the\x20fixed\x20IDs.','schemaHash','isSymbolicLink'];a150_0x59da=function(){return _0x26ab11;};return a150_0x59da();}const EMPTY_IMAGE_LOCATION_FIELDS=new Set([a150_0x4f7467(0xbc),'operatorType',a150_0x4f7467(0x100),a150_0x4f7467(0xfb),a150_0x4f7467(0x115),a150_0x4f7467(0x9c),'country',a150_0x4f7467(0x111),a150_0x4f7467(0xd3),a150_0x4f7467(0x92),a150_0x4f7467(0xf0),'netType',a150_0x4f7467(0xcf),a150_0x4f7467(0x119),a150_0x4f7467(0xd7),'longitude',a150_0x4f7467(0xe4),a150_0x4f7467(0xee),a150_0x4f7467(0xdf),a150_0x4f7467(0xe7)]);export function sameImportValue(_0x4273d3,_0x20eec1,_0x4c7ea7=![]){const _0x4f51ff=a150_0x4f7467;if(_0x4c7ea7){const _0x32d0e7=_0x28371d=>Array[_0x4f51ff(0xe1)](_0x28371d)?_0x28371d[_0x4f51ff(0x9a)](_0x367324=>{const _0x380be2=_0x4f51ff;if(!_0x367324||typeof _0x367324!=='object'||Array['isArray'](_0x367324))return _0x367324;const _0x718cf8={..._0x367324};delete _0x718cf8[_0x380be2(0xb5)],delete _0x718cf8[_0x380be2(0xf9)];if(_0x718cf8[_0x380be2(0xea)]==='')delete _0x718cf8[_0x380be2(0xea)];if(_0x718cf8[_0x380be2(0xbf)]==null)delete _0x718cf8[_0x380be2(0xbf)];if(_0x718cf8['createUserName']==null)delete _0x718cf8[_0x380be2(0x95)];if(_0x718cf8[_0x380be2(0xec)]==null||typeof _0x718cf8[_0x380be2(0xec)]===_0x380be2(0x109)&&!Array['isArray'](_0x718cf8[_0x380be2(0xec)])&&Object[_0x380be2(0x9d)](_0x718cf8['geolocation'])[_0x380be2(0x10a)](([_0x495027,_0x2fab15])=>EMPTY_IMAGE_LOCATION_FIELDS[_0x380be2(0x105)](_0x495027)&&_0x2fab15===null))delete _0x718cf8[_0x380be2(0xec)];for(const _0x1b56df of[_0x380be2(0xb0),_0x380be2(0x11d),'key'])if(!(_0x1b56df in _0x718cf8))_0x718cf8[_0x1b56df]='';if(_0x718cf8[_0x380be2(0x10f)]==null)_0x718cf8[_0x380be2(0x10f)]=0x0;return _0x718cf8;}):_0x28371d;return canonical(_0x32d0e7(_0x4273d3))===canonical(_0x32d0e7(_0x20eec1));}return _0x4273d3===null?_0x20eec1===null||_0x20eec1===undefined:canonical(_0x20eec1)===canonical(_0x4273d3);}async function rejectSymlink(_0x4c5ffa){const _0x5bc64b=a150_0x4f7467;try{if((await lstat(_0x4c5ffa))[_0x5bc64b(0x99)]())throw Error(_0x5bc64b(0xb2));}catch(_0x2ff60f){if(_0x2ff60f['code']!==_0x5bc64b(0xf2))throw _0x2ff60f;}}export async function resolveImportOutputPath(_0x309df7){return await rejectSymlink(_0x309df7),resolve(await realpath(dirname(resolve(_0x309df7))),basename(_0x309df7));}export function assertImportPaths(_0x1e424e,_0x53c00b,_0x4a30c9=[]){const _0x56004e=a150_0x4f7467,_0x15a5d4=[..._0x4a30c9,_0x1e424e,_0x53c00b,_0x1e424e+_0x56004e(0xa5),_0x1e424e+'.lock.recovery'][_0x56004e(0x9a)](_0x2df3cf=>resolve(_0x2df3cf));if(new Set(_0x15a5d4)[_0x56004e(0x10f)]!==_0x15a5d4['length'])throw Error(_0x56004e(0xb6));}export async function saveImportJson(_0x39689d,_0x41deec){const _0x298b40=a150_0x4f7467;await rejectSymlink(_0x39689d);const _0x81b309=_0x39689d+_0x298b40(0xa9)+randomUUID(),_0x2338f5=await open(_0x81b309,'wx',0x180);try{await _0x2338f5[_0x298b40(0xd9)](JSON[_0x298b40(0x10d)](_0x41deec,null,0x2)),await _0x2338f5[_0x298b40(0xca)]();}finally{await _0x2338f5[_0x298b40(0x10e)]();}try{await rename(_0x81b309,_0x39689d);}catch(_0x540b6b){await unlink(_0x81b309)[_0x298b40(0x104)](()=>{});throw _0x540b6b;}}export async function acquireLock(_0x20c88d){const _0x11691e=a150_0x4f7467,_0x17e9ce=_0x20c88d+_0x11691e(0xa5),_0x263988=randomUUID();await rejectSymlink(_0x17e9ce);const _0xa34d25=_0x17e9ce+'.recovery';let _0x314ee7,_0x4e095f;try{try{_0x314ee7=await open(_0x17e9ce,'wx',0x180);}catch(_0x28b789){if(_0x28b789['code']!==_0x11691e(0x113))throw _0x28b789;try{_0x4e095f=await open(_0xa34d25,'wx',0x180);}catch(_0x52d455){if(_0x52d455[_0x11691e(0xa6)]===_0x11691e(0x113))throw Error(_0x11691e(0x11c));throw _0x52d455;}await _0x4e095f[_0x11691e(0xd9)](JSON['stringify']({'pid':process['pid'],'token':_0x263988})),await _0x4e095f[_0x11691e(0xca)](),await rejectSymlink(_0x17e9ce);let _0x5a6d4e;try{_0x5a6d4e=await readFile(_0x17e9ce,_0x11691e(0xd8));}catch(_0x3cbbf5){if(_0x3cbbf5[_0x11691e(0xa6)]!==_0x11691e(0xf2))throw _0x3cbbf5;}if(_0x5a6d4e!==undefined){let _0x183c35;try{_0x183c35=JSON[_0x11691e(0xcc)](_0x5a6d4e);}catch{throw Error(_0x11691e(0xa7));}if(!_0x183c35||!Number['isSafeInteger'](_0x183c35['pid'])||_0x183c35['pid']<=0x0)throw Error(_0x11691e(0xbd));try{process[_0x11691e(0xab)](_0x183c35[_0x11691e(0xf1)],0x0);throw Error(_0x11691e(0xf4));}catch(_0x4b7bfb){if(_0x4b7bfb[_0x11691e(0xa6)]!==_0x11691e(0xb7))throw _0x4b7bfb;}if(await readFile(_0x17e9ce,_0x11691e(0xd8))!==_0x5a6d4e)throw Error(_0x11691e(0xd6));await unlink(_0x17e9ce);}_0x314ee7=await open(_0x17e9ce,'wx',0x180);}await _0x314ee7[_0x11691e(0xd9)](JSON[_0x11691e(0x10d)]({'pid':process[_0x11691e(0xf1)],'token':_0x263988})),await _0x314ee7[_0x11691e(0xca)]();}finally{try{await _0x314ee7?.[_0x11691e(0x10e)]();}finally{if(_0x4e095f)try{await _0x4e095f[_0x11691e(0x10e)]();}finally{await unlink(_0xa34d25);}}}return async()=>{const _0x2daf41=_0x11691e;if(JSON[_0x2daf41(0xcc)](await readFile(_0x17e9ce,_0x2daf41(0xd8)))[_0x2daf41(0x94)]===_0x263988)await unlink(_0x17e9ce);};}export function assertImportContract(_0x4d6c74,_0xf21b5b,_0x24ee7e){const _0x2e86d2=a150_0x4f7467;if(!_0x4d6c74||!(_0x4d6c74[_0x2e86d2(0xa8)]===0x1&&_0x4d6c74['strategy']===_0x2e86d2(0x101)||_0x4d6c74['schemaVersion']===0x2&&_0x4d6c74['strategy']===_0x2e86d2(0x102))||_0x4d6c74[_0x2e86d2(0xa2)]!==_0x2e86d2(0xed)||_0x4d6c74['appCode']!==_0xf21b5b||_0x4d6c74[_0x2e86d2(0xc2)]!==_0x24ee7e||typeof _0x4d6c74[_0x2e86d2(0xff)]!=='string'||!_0x4d6c74['actorId']||typeof _0x4d6c74[_0x2e86d2(0xd2)]!==_0x2e86d2(0xeb)||!_0x4d6c74[_0x2e86d2(0xd2)]||!Number[_0x2e86d2(0x103)](_0x4d6c74[_0x2e86d2(0xd0)])||_0x4d6c74['maxBatchSize']<0x1||_0x4d6c74[_0x2e86d2(0xd0)]>0x3e8||!Number[_0x2e86d2(0x103)](_0x4d6c74[_0x2e86d2(0xc7)])||_0x4d6c74[_0x2e86d2(0xc7)]<0x1||_0x4d6c74[_0x2e86d2(0xc7)]>0x14*0x400*0x400)throw Error(_0x2e86d2(0xb3));}export async function runExcelImport(_0x5807af){const _0x5926d7=a150_0x4f7467;_0x5807af={..._0x5807af,'checkpoint':await resolveImportOutputPath(_0x5807af[_0x5926d7(0x117)]),'report':await resolveImportOutputPath(_0x5807af[_0x5926d7(0xb4)])};const {manifest:_0x3e819f,contract:_0x19b43f,api:_0x1f82ed}=_0x5807af;assertImportContract(_0x19b43f,_0x5807af[_0x5926d7(0xc0)],_0x5807af[_0x5926d7(0xc2)]);if(_0x19b43f['schemaVersion']!==0x1)throw Error(_0x5926d7(0xb1));if(_0x3e819f[_0x5926d7(0xdb)][_0x5926d7(0xbb)])throw Error(_0x5926d7(0xde));if(!_0x3e819f[_0x5926d7(0xa4)]['length'])throw Error(_0x5926d7(0xad));if(!Number[_0x5926d7(0xe6)](_0x5807af[_0x5926d7(0x93)])||_0x5807af['batchSize']<0x1||_0x5807af['batchSize']>_0x19b43f[_0x5926d7(0xd0)])throw Error(_0x5926d7(0x110));for(const _0x5d3439 of _0x3e819f['rows']){if(Buffer[_0x5926d7(0xc4)](JSON['stringify']({'schemaFingerprint':_0x19b43f[_0x5926d7(0xd2)],'items':[{..._0x5d3439[_0x5926d7(0xdd)],'id':-0x1fffffffffffff}]}),'utf8')>_0x19b43f[_0x5926d7(0xc7)])throw Error('Excel\x20row\x20'+_0x5d3439[_0x5926d7(0x11b)]+'\x20exceeds\x20the\x20import\x20request\x20size\x20limit.');}assertImportPaths(_0x5807af[_0x5926d7(0x117)],_0x5807af[_0x5926d7(0xb4)]);const _0x2a205e={'appCode':_0x5807af[_0x5926d7(0xc0)],'datasetCode':_0x5807af[_0x5926d7(0xc2)],'runtimeDomain':_0x5807af['runtimeDomain'],'actorId':_0x19b43f[_0x5926d7(0xff)],'fileHash':_0x3e819f['fileHash'],'mappingHash':_0x3e819f[_0x5926d7(0xfe)],'schemaHash':_0x3e819f[_0x5926d7(0x98)],'remoteSchemaHash':_0x19b43f[_0x5926d7(0xd2)],'batchSize':_0x5807af[_0x5926d7(0x93)],'sheet':_0x3e819f[_0x5926d7(0x116)]},_0x20283f=await acquireLock(_0x5807af[_0x5926d7(0x117)]);let _0x5e11f9;const _0x1d2549=Date[_0x5926d7(0xb9)]();let _0x46ed02=0x0;const _0x54a226=[],_0x1ea4ed=()=>({'importId':_0x5e11f9?.[_0x5926d7(0xae)],'sourceRows':_0x3e819f[_0x5926d7(0xa4)]['length'],'emptyRows':_0x3e819f[_0x5926d7(0x108)]['length'],'succeeded':_0x5e11f9?.[_0x5926d7(0xa4)][_0x5926d7(0xcb)](_0x23f89e=>_0x23f89e['status']===_0x5926d7(0xe3))[_0x5926d7(0xbb)]??0x0,'unknown':_0x5e11f9?.[_0x5926d7(0xa4)][_0x5926d7(0xcb)](_0x17c04e=>_0x17c04e[_0x5926d7(0x121)]==='pending')[_0x5926d7(0xbb)]??0x0,'conflicts':_0x5e11f9?.['rows'][_0x5926d7(0xcb)](_0x4538c7=>_0x4538c7['status']===_0x5926d7(0xe8))[_0x5926d7(0xbb)]??0x0,'notAttempted':_0x5e11f9?.['rows'][_0x5926d7(0xcb)](_0x155e25=>_0x155e25[_0x5926d7(0x121)]==='unsent')['length']??_0x3e819f[_0x5926d7(0xa4)][_0x5926d7(0xbb)],'batches':_0x46ed02,'batchResults':_0x54a226,'elapsedMs':Date[_0x5926d7(0xb9)]()-_0x1d2549,'checkpoint':resolve(_0x5807af[_0x5926d7(0x117)]),'report':resolve(_0x5807af['report']),'warnings':_0x3e819f[_0x5926d7(0xa1)]});try{await rejectSymlink(_0x5807af[_0x5926d7(0x117)]);if(_0x5807af[_0x5926d7(0xfa)]){try{_0x5e11f9=JSON[_0x5926d7(0xcc)](await readFile(_0x5807af['checkpoint'],_0x5926d7(0xd8)));}catch{throw Error(_0x5926d7(0xe9));}if(!_0x5e11f9||_0x5e11f9[_0x5926d7(0xc8)]!==0x1||typeof _0x5e11f9[_0x5926d7(0xae)]!==_0x5926d7(0xeb)||canonical(_0x5e11f9[_0x5926d7(0xf8)])!==canonical(_0x2a205e)||!Array[_0x5926d7(0xe1)](_0x5e11f9[_0x5926d7(0xa4)])||_0x5e11f9[_0x5926d7(0xa4)][_0x5926d7(0xbb)]!==_0x3e819f[_0x5926d7(0xa4)][_0x5926d7(0xbb)]||new Set(_0x5e11f9[_0x5926d7(0xa4)][_0x5926d7(0x9a)](_0x420328=>_0x420328['id']))[_0x5926d7(0x10f)]!==_0x5e11f9[_0x5926d7(0xa4)][_0x5926d7(0xbb)]||_0x5e11f9['rows'][_0x5926d7(0x120)]((_0x3792b7,_0x3bd878)=>!Number[_0x5926d7(0x103)](_0x3792b7['id'])||_0x3792b7['id']>=0x0||_0x3792b7['rowNumber']!==_0x3e819f['rows'][_0x3bd878][_0x5926d7(0x11b)]||!['unsent',_0x5926d7(0x10b),'succeeded',_0x5926d7(0xe8)][_0x5926d7(0x11e)](_0x3792b7[_0x5926d7(0x121)])))throw Error(_0x5926d7(0x11f));}else{try{await lstat(_0x5807af[_0x5926d7(0x117)]);throw Error(_0x5926d7(0xaa));}catch(_0x1d92aa){if(_0x1d92aa[_0x5926d7(0xa6)]!=='ENOENT')throw _0x1d92aa;}const _0x1a5888=new Set();_0x5e11f9={'version':0x1,'importId':randomUUID(),'binding':_0x2a205e,'rows':_0x3e819f[_0x5926d7(0xa4)][_0x5926d7(0x9a)](_0x590d2b=>{const _0x54f09e=_0x5926d7;let _0x30d85f;do{_0x30d85f=-(Number(BigInt('0x'+randomBytes(0x7)[_0x54f09e(0xf6)](_0x54f09e(0xba)))&(0x1n<<0x34n)-0x1n)+0x1);}while(_0x1a5888['has'](_0x30d85f));return _0x1a5888[_0x54f09e(0xd5)](_0x30d85f),{'id':_0x30d85f,'rowNumber':_0x590d2b[_0x54f09e(0x11b)],'status':_0x54f09e(0x106)};})},await saveImportJson(_0x5807af['checkpoint'],_0x5e11f9);}await _0x5807af['onCheckpointReady']?.();const _0x331f7a=_0x5e11f9;if(_0x331f7a[_0x5926d7(0xa4)][_0x5926d7(0x120)](_0x84a66a=>_0x84a66a[_0x5926d7(0x121)]===_0x5926d7(0xe8)))throw Error(_0x5926d7(0xda));const _0x4033e2=async _0x331d00=>{const _0x4b5052=_0x5926d7,_0x300fb5=await _0x1f82ed[_0x4b5052(0x10c)](_0x331d00[_0x4b5052(0x9a)](_0x3daed2=>_0x331f7a[_0x4b5052(0xa4)][_0x3daed2]['id']));if(!Array[_0x4b5052(0xe1)](_0x300fb5))throw Error('Invalid\x20import\x20readback\x20response.');const _0x1e10ee=new Set(_0x331d00[_0x4b5052(0x9a)](_0x224fac=>_0x331f7a[_0x4b5052(0xa4)][_0x224fac]['id'])),_0x540a10=new Map();for(const _0x3c93e1 of _0x300fb5){const _0x52c2a6=Number(_0x3c93e1?.['id']);if(!_0x1e10ee[_0x4b5052(0x105)](_0x52c2a6)||_0x540a10[_0x4b5052(0x105)](_0x52c2a6))throw Error('Invalid\x20or\x20duplicate\x20import\x20readback\x20ID.');_0x540a10[_0x4b5052(0xdc)](_0x52c2a6,_0x3c93e1);}for(const _0x2746fd of _0x331d00){const _0x1dad94=_0x540a10[_0x4b5052(0xaf)](_0x331f7a[_0x4b5052(0xa4)][_0x2746fd]['id']);if(!_0x1dad94)continue;if(_0x331f7a[_0x4b5052(0xa4)][_0x2746fd][_0x4b5052(0x121)]===_0x4b5052(0x106)){_0x331f7a[_0x4b5052(0xa4)][_0x2746fd][_0x4b5052(0x121)]=_0x4b5052(0xe8),await saveImportJson(_0x5807af[_0x4b5052(0x117)],_0x331f7a);throw Error(_0x4b5052(0x97));}const _0x1b3a5d=_0x3e819f[_0x4b5052(0xa4)][_0x2746fd][_0x4b5052(0xdd)];if(Object['keys'](_0x1b3a5d)[_0x4b5052(0x120)](_0xfa7ec6=>!sameImportValue(_0x1b3a5d[_0xfa7ec6],_0x1dad94[_0xfa7ec6],_0x3e819f['imageFields']?.['includes'](_0xfa7ec6)&&!_0x3e819f[_0x4b5052(0x114)]?.[_0x4b5052(0x11e)](_0xfa7ec6)))){_0x331f7a[_0x4b5052(0xa4)][_0x2746fd][_0x4b5052(0x121)]=_0x4b5052(0xe8),await saveImportJson(_0x5807af[_0x4b5052(0x117)],_0x331f7a);throw Error(_0x4b5052(0xef)+_0x331f7a[_0x4b5052(0xa4)][_0x2746fd][_0x4b5052(0x11b)]+'.');}_0x331f7a[_0x4b5052(0xa4)][_0x2746fd]['status']=_0x4b5052(0xe3);}return await saveImportJson(_0x5807af['checkpoint'],_0x331f7a),_0x540a10;};if(_0x5807af['resume'])for(let _0x463de3=0x0;_0x463de3<_0x331f7a['rows'][_0x5926d7(0xbb)];_0x463de3+=_0x5807af[_0x5926d7(0x93)]){const _0x196b11=_0x331f7a[_0x5926d7(0xa4)][_0x5926d7(0xa3)](_0x463de3,_0x463de3+_0x5807af[_0x5926d7(0x93)])[_0x5926d7(0x9a)]((_0x3c213f,_0x2142a8)=>_0x463de3+_0x2142a8),_0x2822ca=_0x196b11[_0x5926d7(0xcb)](_0xb42f8d=>_0x331f7a[_0x5926d7(0xa4)][_0xb42f8d]['status']===_0x5926d7(0xe3)),_0x16d702=await _0x4033e2(_0x196b11),_0x2d91ce=_0x2822ca[_0x5926d7(0xcb)](_0xcf964d=>!_0x16d702['has'](_0x331f7a[_0x5926d7(0xa4)][_0xcf964d]['id']));if(_0x2d91ce[_0x5926d7(0xbb)]){_0x2d91ce[_0x5926d7(0xc1)](_0x1a38bd=>{const _0x34f55a=_0x5926d7;_0x331f7a[_0x34f55a(0xa4)][_0x1a38bd][_0x34f55a(0x121)]=_0x34f55a(0xe8);}),await saveImportJson(_0x5807af[_0x5926d7(0x117)],_0x331f7a);throw Error(_0x5926d7(0xe2));}}for(let _0x3d8f71=0x0;_0x3d8f71<_0x331f7a[_0x5926d7(0xa4)][_0x5926d7(0xbb)];){const _0x3935a0=[],_0x279269=[];while(_0x3d8f71<_0x331f7a[_0x5926d7(0xa4)][_0x5926d7(0xbb)]&&_0x279269[_0x5926d7(0xbb)]<_0x5807af[_0x5926d7(0x93)]){const _0x3e22b0=_0x3d8f71++;if(_0x331f7a[_0x5926d7(0xa4)][_0x3e22b0]['status']===_0x5926d7(0xe3))continue;const _0x364bc3={..._0x3e819f[_0x5926d7(0xa4)][_0x3e22b0][_0x5926d7(0xdd)],'id':_0x331f7a[_0x5926d7(0xa4)][_0x3e22b0]['id']};if(Buffer[_0x5926d7(0xc4)](JSON[_0x5926d7(0x10d)]({'schemaFingerprint':_0x19b43f[_0x5926d7(0xd2)],'items':[..._0x279269,_0x364bc3]}),_0x5926d7(0xd8))>_0x19b43f['maxBatchBytes']){if(!_0x279269['length'])throw Error(_0x5926d7(0xe0)+_0x331f7a[_0x5926d7(0xa4)][_0x3e22b0][_0x5926d7(0x11b)]+_0x5926d7(0xf7));_0x3d8f71--;break;}_0x3935a0[_0x5926d7(0xa0)](_0x3e22b0),_0x279269[_0x5926d7(0xa0)](_0x364bc3);}if(!_0x279269['length'])continue;const _0x31d476=_0x3935a0['filter'](_0x3498fa=>_0x331f7a[_0x5926d7(0xa4)][_0x3498fa][_0x5926d7(0x121)]===_0x5926d7(0x106));if(_0x31d476[_0x5926d7(0xbb)]){const _0x4d6789=await _0x1f82ed[_0x5926d7(0x10c)](_0x31d476[_0x5926d7(0x9a)](_0x4170c0=>_0x331f7a['rows'][_0x4170c0]['id']));if(!Array[_0x5926d7(0xe1)](_0x4d6789))throw Error(_0x5926d7(0xc6));if(_0x4d6789[_0x5926d7(0xbb)])throw Error(_0x5926d7(0x97));}_0x3935a0[_0x5926d7(0xc1)](_0xfe96dd=>{const _0x4298a1=_0x5926d7;_0x331f7a[_0x4298a1(0xa4)][_0xfe96dd][_0x4298a1(0x121)]=_0x4298a1(0x10b);}),await saveImportJson(_0x5807af[_0x5926d7(0x117)],_0x331f7a),_0x46ed02++;const _0xce4108=Date[_0x5926d7(0xb9)](),_0x5d5e29={'batch':_0x46ed02,'rowStart':_0x331f7a[_0x5926d7(0xa4)][_0x3935a0[0x0]]['rowNumber'],'rowEnd':_0x331f7a[_0x5926d7(0xa4)][_0x3935a0[_0x3935a0[_0x5926d7(0xbb)]-0x1]][_0x5926d7(0x11b)],'count':_0x279269[_0x5926d7(0xbb)],'bytes':Buffer[_0x5926d7(0xc4)](JSON['stringify']({'schemaFingerprint':_0x19b43f[_0x5926d7(0xd2)],'items':_0x279269}),_0x5926d7(0xd8)),'elapsedMs':0x0,'status':_0x5926d7(0xac)};_0x54a226[_0x5926d7(0xa0)](_0x5d5e29);try{const _0x1de25f=await _0x1f82ed[_0x5926d7(0xe5)](_0x279269);if(!_0x1de25f||_0x1de25f[_0x5926d7(0xfd)]!==_0x279269[_0x5926d7(0xbb)]||!Array[_0x5926d7(0xe1)](_0x1de25f['ids'])||_0x1de25f['ids'][_0x5926d7(0xbb)]!==_0x279269[_0x5926d7(0xbb)]||_0x1de25f[_0x5926d7(0x118)]['some']((_0x1067b1,_0x453fdf)=>Number(_0x1067b1)!==_0x331f7a['rows'][_0x3935a0[_0x453fdf]]['id']))throw Error(_0x5926d7(0x96));await _0x4033e2(_0x3935a0);if(_0x3935a0['some'](_0x485a5f=>_0x331f7a[_0x5926d7(0xa4)][_0x485a5f][_0x5926d7(0x121)]!==_0x5926d7(0xe3)))throw Error(_0x5926d7(0x9b));}catch(_0x54f177){if(_0x331f7a['rows'][_0x5926d7(0x120)](_0x44ec9b=>_0x44ec9b['status']===_0x5926d7(0xe8)))throw _0x54f177;try{await _0x4033e2(_0x3935a0);}catch(_0x594710){if(_0x331f7a['rows'][_0x5926d7(0x120)](_0x3771aa=>_0x3771aa[_0x5926d7(0x121)]==='conflict'))throw _0x594710;}if(_0x3935a0[_0x5926d7(0x120)](_0x515614=>_0x331f7a['rows'][_0x515614]['status']!==_0x5926d7(0xe3)))throw Error(_0x5926d7(0xd1));}finally{_0x5d5e29[_0x5926d7(0x9f)]=Date[_0x5926d7(0xb9)]()-_0xce4108;if(_0x3935a0[_0x5926d7(0x10a)](_0x1f79f0=>_0x331f7a[_0x5926d7(0xa4)][_0x1f79f0][_0x5926d7(0x121)]===_0x5926d7(0xe3)))_0x5d5e29[_0x5926d7(0x121)]=_0x5926d7(0xe3);else{if(_0x3935a0['some'](_0x1528fb=>_0x331f7a[_0x5926d7(0xa4)][_0x1528fb][_0x5926d7(0x121)]===_0x5926d7(0xe8)))_0x5d5e29['status']='conflict';}}}const _0x509385={'status':'completed',..._0x1ea4ed()};return await saveImportJson(_0x5807af[_0x5926d7(0xb4)],_0x509385),_0x509385;}catch(_0x2ad766){if(_0x5e11f9)await saveImportJson(_0x5807af[_0x5926d7(0xb4)],{'status':_0x5926d7(0xb8),..._0x1ea4ed(),'message':_0x2ad766[_0x5926d7(0xbe)]});throw _0x2ad766;}finally{await _0x20283f();}}
@@ -1 +1 @@
1
- const a152_0x3fd909=a152_0x4b09;(function(_0x3936d9,_0x3391cb){const _0xa7edf=a152_0x4b09,_0x4a1c72=_0x3936d9();while(!![]){try{const _0x4471c4=-parseInt(_0xa7edf(0x21a))/0x1+-parseInt(_0xa7edf(0x1ef))/0x2*(parseInt(_0xa7edf(0x220))/0x3)+-parseInt(_0xa7edf(0x1e1))/0x4+parseInt(_0xa7edf(0x1ee))/0x5*(parseInt(_0xa7edf(0x1e6))/0x6)+parseInt(_0xa7edf(0x214))/0x7+parseInt(_0xa7edf(0x1e4))/0x8*(-parseInt(_0xa7edf(0x1da))/0x9)+parseInt(_0xa7edf(0x206))/0xa;if(_0x4471c4===_0x3391cb)break;else _0x4a1c72['push'](_0x4a1c72['shift']());}catch(_0x5de591){_0x4a1c72['push'](_0x4a1c72['shift']());}}}(a152_0x5a02,0xaa129));import{createHash}from'node:crypto';function a152_0x4b09(_0x5c6562,_0x48e6f8){_0x5c6562=_0x5c6562-0x1da;const _0x5a02ce=a152_0x5a02();let _0x4b0989=_0x5a02ce[_0x5c6562];return _0x4b0989;}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';function a152_0x5a02(){const _0x23a6ff=['sha256','parse','unverifiable','split','lovrabet','join',':\x5cs*(.+)$','isDirectory','Unsupported\x20Skill\x20entry:\x20','length','SKILL.md','unknown','every','includes','installedPath','packageRoot','Installer\x20reported\x20partial\x20target\x20failures:\x0a%s','11526450gEdKeB','version','isSymbolicLink','trim','startsWith','status','state','digest','absent','match','skills','message','skillVersion','INSTALL_FAILED','697214vlKnwB','count','\x20verified;\x20','update','home','isFile','150730hnEPCY','missing','path','version_mismatch','CLI\x20Built-in\x20Skill\x20','package.json','7617YjPDQT','Symbolic\x20link\x20is\x20not\x20allowed:\x20','99pfjVYX','content_mismatch','skills@latest\x20exited\x20','stdio','hex','packageVersion','lovrabet\x20cli-skill\x20install','3022428kqkjwW','lovrabet-skills','error','125608YeIDlU','name','1965954Hxnpnr','SOURCE_INVALID','skipped','\x20automatically\x20selected\x20installation\x20target(s)\x20could\x20not\x20be\x20installed.','Installed\x20Skill\x20state\x20is\x20','output','Built-in\x20Skill\x20source\x20does\x20not\x20match\x20its\x20package\x20manifest','root','15DkADZT','362jFOwog','current','reason','flatMap','utf8','partialFailure'];a152_0x5a02=function(){return _0x23a6ff;};return a152_0x5a02();}import{runNpxSkillsAddGlobal}from'../skills/npx-skills-add.js';import{resolveInstalledSkill}from'../skills/skill-presence.js';const DEFAULT_PACKAGE_ROOT=resolve(dirname(fileURLToPath(import.meta.url)),'..','..'),REPAIR_COMMAND=a152_0x3fd909(0x1e0),SKILL_NAME=a152_0x3fd909(0x1f9),debug=debuglog(a152_0x3fd909(0x1e2));function frontmatterValue(_0x54507b,_0x35e59a){const _0xe7f92d=a152_0x3fd909;return _0x54507b[_0xe7f92d(0x20f)](new RegExp('^'+_0x35e59a+_0xe7f92d(0x1fb),'m'))?.[0x1]?.[_0xe7f92d(0x209)]()??'';}function listFiles(_0x2e762f,_0x2c9749=_0x2e762f){const _0x1e3c16=a152_0x3fd909;return readdirSync(_0x2c9749,{'withFileTypes':!![]})[_0x1e3c16(0x1f2)](_0x244971=>{const _0x3e6c84=_0x1e3c16,_0x21819e=join(_0x2c9749,_0x244971[_0x3e6c84(0x1e5)]),_0x3f8eb0=lstatSync(_0x21819e);if(_0x3f8eb0[_0x3e6c84(0x208)]())throw new Error(_0x3e6c84(0x221)+_0x21819e);if(_0x3f8eb0[_0x3e6c84(0x1fc)]())return listFiles(_0x2e762f,_0x21819e);if(!_0x3f8eb0[_0x3e6c84(0x219)]())throw new Error(_0x3e6c84(0x1fd)+_0x21819e);return[relative(_0x2e762f,_0x21819e)[_0x3e6c84(0x1f8)](sep)[_0x3e6c84(0x1fa)]('/')];})['sort']((_0x130eef,_0x25e323)=>_0x130eef<_0x25e323?-0x1:_0x130eef>_0x25e323?0x1:0x0);}function digestFiles(_0x46c89e,_0x4a6051){const _0x116b6c=a152_0x3fd909,_0x25d0bd=createHash(_0x116b6c(0x1f5));for(const _0x586d8e of _0x4a6051){if(_0x586d8e[_0x116b6c(0x20a)]('/')||_0x586d8e[_0x116b6c(0x1f8)]('/')[_0x116b6c(0x202)]('..')||_0x586d8e[_0x116b6c(0x202)]('\x5c'))throw new Error('Unsafe\x20manifest\x20path:\x20'+_0x586d8e);_0x25d0bd[_0x116b6c(0x217)](_0x586d8e),_0x25d0bd[_0x116b6c(0x217)]('\x00'),_0x25d0bd['update'](readFileSync(join(_0x46c89e,..._0x586d8e['split']('/')))),_0x25d0bd['update']('\x00');}return _0x25d0bd[_0x116b6c(0x20d)](_0x116b6c(0x1de));}function sameFiles(_0x28079c,_0x4d2566){const _0x5377ab=a152_0x3fd909;return _0x28079c['length']===_0x4d2566[_0x5377ab(0x1fe)]&&_0x28079c[_0x5377ab(0x201)]((_0xfbed61,_0x926a2e)=>_0xfbed61===_0x4d2566[_0x926a2e]);}function readSource(_0x48db57){const _0x1b5d90=a152_0x3fd909,_0x1d9a2d=JSON[_0x1b5d90(0x1f6)](readFileSync(join(_0x48db57,_0x1b5d90(0x21f)),_0x1b5d90(0x1f3))),_0x3a08b1=JSON['parse'](readFileSync(join(_0x48db57,_0x1b5d90(0x210),'lovrabet.manifest.json'),'utf8')),_0x57167c=join(_0x48db57,_0x1b5d90(0x210),SKILL_NAME),_0x2c1aa1=frontmatterValue(readFileSync(join(_0x57167c,_0x1b5d90(0x1ff)),_0x1b5d90(0x1f3)),_0x1b5d90(0x207)),_0x265333=listFiles(_0x57167c);if(_0x3a08b1['schemaVersion']!==0x1||_0x3a08b1[_0x1b5d90(0x1e5)]!==SKILL_NAME||!_0x1d9a2d[_0x1b5d90(0x207)]||_0x3a08b1['packageVersion']!==_0x1d9a2d['version']||_0x3a08b1[_0x1b5d90(0x212)]!==_0x1d9a2d['version']||_0x2c1aa1!==_0x1d9a2d[_0x1b5d90(0x207)]||!sameFiles(_0x265333,_0x3a08b1['files'])||digestFiles(_0x57167c,_0x265333)!==_0x3a08b1['digest'])throw new Error(_0x1b5d90(0x1ec));return{'packageVersion':_0x1d9a2d[_0x1b5d90(0x207)],'skillVersion':_0x2c1aa1,'root':_0x57167c,'manifest':_0x3a08b1};}function installedSkillPath(_0x12e2ed){const _0x29ee7d=a152_0x3fd909,_0x429158=resolveInstalledSkill(SKILL_NAME,{'home':_0x12e2ed});if(_0x429158[_0x29ee7d(0x20c)]==='present')return{'state':'present','path':dirname(_0x429158[_0x29ee7d(0x21c)])};if(_0x429158[_0x29ee7d(0x20c)]===_0x29ee7d(0x20e))return{'state':_0x29ee7d(0x21b)};return{'state':_0x29ee7d(0x1f7),'reason':_0x429158[_0x29ee7d(0x1f1)]};}export function inspectInstalledBuiltinSkillVersion(_0x42a646,_0x410ffa={}){const _0x5718c3=a152_0x3fd909,_0x1c8908=installedSkillPath(_0x410ffa[_0x5718c3(0x218)]??homedir());if(_0x1c8908[_0x5718c3(0x20c)]==='missing')return{'state':_0x5718c3(0x21b),'expectedVersion':_0x42a646,'repairCommand':REPAIR_COMMAND};if(_0x1c8908[_0x5718c3(0x20c)]==='unverifiable')return{'state':_0x5718c3(0x1f7),'expectedVersion':_0x42a646,'reason':_0x1c8908['reason'],'repairCommand':REPAIR_COMMAND};try{const _0x306e3d=frontmatterValue(readFileSync(join(_0x1c8908[_0x5718c3(0x21c)],'SKILL.md'),_0x5718c3(0x1f3)),_0x5718c3(0x207));return{'state':_0x306e3d===_0x42a646?_0x5718c3(0x1f0):_0x5718c3(0x21d),'expectedVersion':_0x42a646,'skillVersion':_0x306e3d,'installedPath':_0x1c8908['path'],'repairCommand':REPAIR_COMMAND};}catch(_0x4cd3c0){return{'state':_0x5718c3(0x1f7),'expectedVersion':_0x42a646,'installedPath':_0x1c8908[_0x5718c3(0x21c)],'reason':_0x4cd3c0 instanceof Error?_0x4cd3c0[_0x5718c3(0x211)]:String(_0x4cd3c0),'repairCommand':REPAIR_COMMAND};}}export function inspectBuiltinSkill(_0x2797f2={}){const _0x26643b=a152_0x3fd909,_0x4e238b=_0x2797f2[_0x26643b(0x204)]??DEFAULT_PACKAGE_ROOT;let _0x2f40b3;try{_0x2f40b3=readSource(_0x4e238b);}catch(_0x44b6d1){return{'state':'unverifiable','packageVersion':'unknown','reason':_0x44b6d1 instanceof Error?_0x44b6d1[_0x26643b(0x211)]:String(_0x44b6d1),'repairCommand':REPAIR_COMMAND};}const _0x181d51=installedSkillPath(_0x2797f2[_0x26643b(0x218)]??homedir());if(_0x181d51['state']===_0x26643b(0x21b))return{'state':_0x26643b(0x21b),'packageVersion':_0x2f40b3[_0x26643b(0x1df)],'repairCommand':REPAIR_COMMAND};if(_0x181d51[_0x26643b(0x20c)]===_0x26643b(0x1f7))return{'state':_0x26643b(0x1f7),'packageVersion':_0x2f40b3['packageVersion'],'reason':_0x181d51[_0x26643b(0x1f1)],'repairCommand':REPAIR_COMMAND};try{const _0x585d5f=frontmatterValue(readFileSync(join(_0x181d51[_0x26643b(0x21c)],_0x26643b(0x1ff)),_0x26643b(0x1f3)),_0x26643b(0x207));if(_0x585d5f!==_0x2f40b3[_0x26643b(0x212)])return{'state':_0x26643b(0x21d),'packageVersion':_0x2f40b3[_0x26643b(0x1df)],'skillVersion':_0x585d5f,'installedPath':_0x181d51[_0x26643b(0x21c)],'repairCommand':REPAIR_COMMAND};const _0x18b4d3=listFiles(_0x181d51[_0x26643b(0x21c)]),_0x5ac088=digestFiles(_0x181d51[_0x26643b(0x21c)],_0x18b4d3);return{'state':sameFiles(_0x18b4d3,_0x2f40b3['manifest']['files'])&&_0x5ac088===_0x2f40b3['manifest']['digest']?_0x26643b(0x1f0):_0x26643b(0x1db),'packageVersion':_0x2f40b3[_0x26643b(0x1df)],'skillVersion':_0x585d5f,'installedPath':_0x181d51[_0x26643b(0x21c)],'digest':_0x5ac088,'repairCommand':REPAIR_COMMAND};}catch(_0x4ac4da){return{'state':_0x26643b(0x1f7),'packageVersion':_0x2f40b3[_0x26643b(0x1df)],'installedPath':_0x181d51[_0x26643b(0x21c)],'reason':_0x4ac4da instanceof Error?_0x4ac4da[_0x26643b(0x211)]:String(_0x4ac4da),'repairCommand':REPAIR_COMMAND};}}function failure(_0x414c44,_0x3b2175,_0x2a4fb6,_0x1e78b8){const _0x5e2f08=a152_0x3fd909;return{'ok':![],'code':_0x414c44,'packageVersion':_0x3b2175[_0x5e2f08(0x1df)],'skillVersion':_0x3b2175[_0x5e2f08(0x212)],'installedPath':_0x1e78b8,'changed':![],'repairCommand':REPAIR_COMMAND,'error':_0x2a4fb6 instanceof Error?_0x2a4fb6['message']:String(_0x2a4fb6)};}export function installBuiltinSkill(_0x2d2bee={}){const _0x5bde25=a152_0x3fd909,_0x3426c2=_0x2d2bee[_0x5bde25(0x204)]??DEFAULT_PACKAGE_ROOT,_0x4ee4af=_0x2d2bee['home']??homedir();let _0x5517db;try{_0x5517db=readSource(_0x3426c2);}catch(_0x17e8d1){return failure(_0x5bde25(0x1e7),{'packageVersion':_0x5bde25(0x200),'skillVersion':_0x5bde25(0x200)},_0x17e8d1);}const _0x47a6b6=inspectBuiltinSkill({'packageRoot':_0x3426c2,'home':_0x4ee4af}),_0x2d902b=runNpxSkillsAddGlobal(_0x3426c2,_0x5517db[_0x5bde25(0x1ed)],{'stdio':_0x2d2bee[_0x5bde25(0x1dd)]??'pipe','expectedSkillName':SKILL_NAME,'presence':{'home':_0x4ee4af}});if(_0x2d902b[_0x5bde25(0x1e8)])return{'ok':!![],'packageVersion':_0x5517db[_0x5bde25(0x1df)],'skillVersion':_0x5517db['skillVersion'],'installedPath':_0x47a6b6[_0x5bde25(0x203)],'changed':![],'repairCommand':REPAIR_COMMAND};if(!_0x2d902b['ok'])return failure(_0x5bde25(0x213),_0x5517db,_0x2d902b[_0x5bde25(0x1e3)]??_0x5bde25(0x1dc)+_0x2d902b[_0x5bde25(0x20b)]);const _0x380a84=inspectBuiltinSkill({'packageRoot':_0x3426c2,'home':_0x4ee4af});if(_0x380a84[_0x5bde25(0x20c)]!==_0x5bde25(0x1f0)){const _0x48f99a=_0x380a84[_0x5bde25(0x1f1)]??_0x5bde25(0x1ea)+_0x380a84[_0x5bde25(0x20c)];return failure('VERIFY_FAILED',_0x5517db,_0x2d902b['partialFailure']?_0x48f99a+'\x0a'+_0x2d902b['partialFailure'][_0x5bde25(0x1eb)]:_0x48f99a,_0x380a84[_0x5bde25(0x203)]);}return _0x2d902b['partialFailure']&&(debug(_0x5bde25(0x205),_0x2d902b['partialFailure'][_0x5bde25(0x1eb)]),console['log'](_0x5bde25(0x21e)+_0x5517db['skillVersion']+_0x5bde25(0x216)+_0x2d902b[_0x5bde25(0x1f4)][_0x5bde25(0x215)]+_0x5bde25(0x1e9))),{'ok':!![],'packageVersion':_0x5517db[_0x5bde25(0x1df)],'skillVersion':_0x5517db[_0x5bde25(0x212)],'installedPath':_0x380a84[_0x5bde25(0x203)],'changed':_0x47a6b6[_0x5bde25(0x20c)]!==_0x5bde25(0x1f0),'repairCommand':REPAIR_COMMAND};}
1
+ const a152_0x5c4156=a152_0x15b1;(function(_0x2cb38d,_0x2c7215){const _0x1bdcb6=a152_0x15b1,_0x235a39=_0x2cb38d();while(!![]){try{const _0x42e232=-parseInt(_0x1bdcb6(0x16b))/0x1*(parseInt(_0x1bdcb6(0x166))/0x2)+-parseInt(_0x1bdcb6(0x149))/0x3*(parseInt(_0x1bdcb6(0x14e))/0x4)+-parseInt(_0x1bdcb6(0x142))/0x5*(parseInt(_0x1bdcb6(0x160))/0x6)+-parseInt(_0x1bdcb6(0x163))/0x7+parseInt(_0x1bdcb6(0x154))/0x8+parseInt(_0x1bdcb6(0x13f))/0x9+parseInt(_0x1bdcb6(0x135))/0xa*(-parseInt(_0x1bdcb6(0x13b))/0xb);if(_0x42e232===_0x2c7215)break;else _0x235a39['push'](_0x235a39['shift']());}catch(_0x58455e){_0x235a39['push'](_0x235a39['shift']());}}}(a152_0xce68,0xa7a7d));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';function a152_0xce68(){const _0x2cb9f6=['lovrabet.manifest.json','84295qRgpDL','Built-in\x20Skill\x20source\x20does\x20not\x20match\x20its\x20package\x20manifest','\x20automatically\x20selected\x20installation\x20target(s)\x20could\x20not\x20be\x20installed.','output','installedPath','reason','manifest','2153568Cmahtn','includes','parse','name','every','4iqwuOM','packageRoot','digest','unknown','content_mismatch','flatMap','10465776VbXYsW','current','skills@latest\x20exited\x20','partialFailure','path','schemaVersion','Symbolic\x20link\x20is\x20not\x20allowed:\x20','sha256','message','\x20verified;\x20','lovrabet\x20cli-skill\x20install','Unsafe\x20manifest\x20path:\x20','42woRDrX','sort','status','932358WbpnwH','skipped','count','2PoXVGN','present',':\x5cs*(.+)$','state','package.json','551283oFYnFo','files','hex','error','utf8','match','home','VERIFY_FAILED','SOURCE_INVALID','isSymbolicLink','split','CLI\x20Built-in\x20Skill\x20','lovrabet','version','missing','pipe','update','join','SKILL.md','40vKDpua','absent','skills','unverifiable','INSTALL_FAILED','version_mismatch','1253802cZjIth','skillVersion','lovrabet-skills','stdio','12192921rcTrRI','packageVersion'];a152_0xce68=function(){return _0x2cb9f6;};return a152_0xce68();}function a152_0x15b1(_0x5dd7d2,_0x52a937){_0x5dd7d2=_0x5dd7d2-0x131;const _0xce685d=a152_0xce68();let _0x15b1dc=_0xce685d[_0x5dd7d2];return _0x15b1dc;}import{resolveInstalledSkill}from'../skills/skill-presence.js';const DEFAULT_PACKAGE_ROOT=resolve(dirname(fileURLToPath(import.meta.url)),'..','..'),REPAIR_COMMAND=a152_0x5c4156(0x15e),SKILL_NAME=a152_0x5c4156(0x177),debug=debuglog(a152_0x5c4156(0x13d));function frontmatterValue(_0x50f9e7,_0x48b76f){const _0x504e0c=a152_0x5c4156;return _0x50f9e7[_0x504e0c(0x170)](new RegExp('^'+_0x48b76f+_0x504e0c(0x168),'m'))?.[0x1]?.['trim']()??'';}function listFiles(_0x50ad9c,_0x41e22e=_0x50ad9c){const _0x5f4c6d=a152_0x5c4156;return readdirSync(_0x41e22e,{'withFileTypes':!![]})[_0x5f4c6d(0x153)](_0x50d894=>{const _0x4d99c9=_0x5f4c6d,_0x1de602=join(_0x41e22e,_0x50d894[_0x4d99c9(0x14c)]),_0x5754a9=lstatSync(_0x1de602);if(_0x5754a9[_0x4d99c9(0x174)]())throw new Error(_0x4d99c9(0x15a)+_0x1de602);if(_0x5754a9['isDirectory']())return listFiles(_0x50ad9c,_0x1de602);if(!_0x5754a9['isFile']())throw new Error('Unsupported\x20Skill\x20entry:\x20'+_0x1de602);return[relative(_0x50ad9c,_0x1de602)[_0x4d99c9(0x175)](sep)[_0x4d99c9(0x133)]('/')];})[_0x5f4c6d(0x161)]((_0x1b915d,_0x40acd2)=>_0x1b915d<_0x40acd2?-0x1:_0x1b915d>_0x40acd2?0x1:0x0);}function digestFiles(_0x5a818f,_0x414be4){const _0x44615f=a152_0x5c4156,_0x9a89f2=createHash(_0x44615f(0x15b));for(const _0x5afcc2 of _0x414be4){if(_0x5afcc2['startsWith']('/')||_0x5afcc2['split']('/')[_0x44615f(0x14a)]('..')||_0x5afcc2[_0x44615f(0x14a)]('\x5c'))throw new Error(_0x44615f(0x15f)+_0x5afcc2);_0x9a89f2['update'](_0x5afcc2),_0x9a89f2[_0x44615f(0x132)]('\x00'),_0x9a89f2[_0x44615f(0x132)](readFileSync(join(_0x5a818f,..._0x5afcc2[_0x44615f(0x175)]('/')))),_0x9a89f2[_0x44615f(0x132)]('\x00');}return _0x9a89f2[_0x44615f(0x150)](_0x44615f(0x16d));}function sameFiles(_0x135b0d,_0x5b32f3){const _0x319e62=a152_0x5c4156;return _0x135b0d['length']===_0x5b32f3['length']&&_0x135b0d[_0x319e62(0x14d)]((_0x5a6194,_0xb66b81)=>_0x5a6194===_0x5b32f3[_0xb66b81]);}function readSource(_0x2039bd){const _0x42d3f5=a152_0x5c4156,_0x4b9c6a=JSON[_0x42d3f5(0x14b)](readFileSync(join(_0x2039bd,_0x42d3f5(0x16a)),_0x42d3f5(0x16f))),_0x170d6e=JSON['parse'](readFileSync(join(_0x2039bd,_0x42d3f5(0x137),_0x42d3f5(0x141)),'utf8')),_0x5dcca5=join(_0x2039bd,_0x42d3f5(0x137),SKILL_NAME),_0x42f603=frontmatterValue(readFileSync(join(_0x5dcca5,_0x42d3f5(0x134)),'utf8'),_0x42d3f5(0x178)),_0xe8b911=listFiles(_0x5dcca5);if(_0x170d6e[_0x42d3f5(0x159)]!==0x1||_0x170d6e[_0x42d3f5(0x14c)]!==SKILL_NAME||!_0x4b9c6a[_0x42d3f5(0x178)]||_0x170d6e['packageVersion']!==_0x4b9c6a[_0x42d3f5(0x178)]||_0x170d6e[_0x42d3f5(0x13c)]!==_0x4b9c6a[_0x42d3f5(0x178)]||_0x42f603!==_0x4b9c6a['version']||!sameFiles(_0xe8b911,_0x170d6e[_0x42d3f5(0x16c)])||digestFiles(_0x5dcca5,_0xe8b911)!==_0x170d6e[_0x42d3f5(0x150)])throw new Error(_0x42d3f5(0x143));return{'packageVersion':_0x4b9c6a[_0x42d3f5(0x178)],'skillVersion':_0x42f603,'root':_0x5dcca5,'manifest':_0x170d6e};}function installedSkillPath(_0x1d2b86){const _0x56a6a4=a152_0x5c4156,_0x4eea59=resolveInstalledSkill(SKILL_NAME,{'home':_0x1d2b86});if(_0x4eea59[_0x56a6a4(0x169)]===_0x56a6a4(0x167))return{'state':'present','path':dirname(_0x4eea59[_0x56a6a4(0x158)])};if(_0x4eea59[_0x56a6a4(0x169)]===_0x56a6a4(0x136))return{'state':_0x56a6a4(0x179)};return{'state':_0x56a6a4(0x138),'reason':_0x4eea59['reason']};}export function inspectInstalledBuiltinSkillVersion(_0x1cc1f4,_0xfe5ef1={}){const _0x19ee48=a152_0x5c4156,_0xdb790a=installedSkillPath(_0xfe5ef1[_0x19ee48(0x171)]??homedir());if(_0xdb790a[_0x19ee48(0x169)]===_0x19ee48(0x179))return{'state':_0x19ee48(0x179),'expectedVersion':_0x1cc1f4,'repairCommand':REPAIR_COMMAND};if(_0xdb790a[_0x19ee48(0x169)]===_0x19ee48(0x138))return{'state':_0x19ee48(0x138),'expectedVersion':_0x1cc1f4,'reason':_0xdb790a['reason'],'repairCommand':REPAIR_COMMAND};try{const _0x36be2b=frontmatterValue(readFileSync(join(_0xdb790a[_0x19ee48(0x158)],_0x19ee48(0x134)),_0x19ee48(0x16f)),_0x19ee48(0x178));return{'state':_0x36be2b===_0x1cc1f4?_0x19ee48(0x155):_0x19ee48(0x13a),'expectedVersion':_0x1cc1f4,'skillVersion':_0x36be2b,'installedPath':_0xdb790a[_0x19ee48(0x158)],'repairCommand':REPAIR_COMMAND};}catch(_0x3b075b){return{'state':_0x19ee48(0x138),'expectedVersion':_0x1cc1f4,'installedPath':_0xdb790a['path'],'reason':_0x3b075b instanceof Error?_0x3b075b[_0x19ee48(0x15c)]:String(_0x3b075b),'repairCommand':REPAIR_COMMAND};}}export function inspectBuiltinSkill(_0x3c456d={}){const _0x5805cd=a152_0x5c4156,_0x3ad5e7=_0x3c456d[_0x5805cd(0x14f)]??DEFAULT_PACKAGE_ROOT;let _0x45ef9a;try{_0x45ef9a=readSource(_0x3ad5e7);}catch(_0x18463e){return{'state':_0x5805cd(0x138),'packageVersion':_0x5805cd(0x151),'reason':_0x18463e instanceof Error?_0x18463e[_0x5805cd(0x15c)]:String(_0x18463e),'repairCommand':REPAIR_COMMAND};}const _0x1cb752=installedSkillPath(_0x3c456d['home']??homedir());if(_0x1cb752['state']===_0x5805cd(0x179))return{'state':_0x5805cd(0x179),'packageVersion':_0x45ef9a['packageVersion'],'repairCommand':REPAIR_COMMAND};if(_0x1cb752[_0x5805cd(0x169)]==='unverifiable')return{'state':_0x5805cd(0x138),'packageVersion':_0x45ef9a[_0x5805cd(0x140)],'reason':_0x1cb752[_0x5805cd(0x147)],'repairCommand':REPAIR_COMMAND};try{const _0x4b16ba=frontmatterValue(readFileSync(join(_0x1cb752[_0x5805cd(0x158)],_0x5805cd(0x134)),_0x5805cd(0x16f)),_0x5805cd(0x178));if(_0x4b16ba!==_0x45ef9a[_0x5805cd(0x13c)])return{'state':_0x5805cd(0x13a),'packageVersion':_0x45ef9a[_0x5805cd(0x140)],'skillVersion':_0x4b16ba,'installedPath':_0x1cb752[_0x5805cd(0x158)],'repairCommand':REPAIR_COMMAND};const _0xb419e3=listFiles(_0x1cb752[_0x5805cd(0x158)]),_0x237f44=digestFiles(_0x1cb752[_0x5805cd(0x158)],_0xb419e3);return{'state':sameFiles(_0xb419e3,_0x45ef9a[_0x5805cd(0x148)]['files'])&&_0x237f44===_0x45ef9a[_0x5805cd(0x148)][_0x5805cd(0x150)]?_0x5805cd(0x155):_0x5805cd(0x152),'packageVersion':_0x45ef9a[_0x5805cd(0x140)],'skillVersion':_0x4b16ba,'installedPath':_0x1cb752[_0x5805cd(0x158)],'digest':_0x237f44,'repairCommand':REPAIR_COMMAND};}catch(_0x15faaa){return{'state':'unverifiable','packageVersion':_0x45ef9a[_0x5805cd(0x140)],'installedPath':_0x1cb752[_0x5805cd(0x158)],'reason':_0x15faaa instanceof Error?_0x15faaa['message']:String(_0x15faaa),'repairCommand':REPAIR_COMMAND};}}function failure(_0x5abb1b,_0x267643,_0x44634b,_0x3c9d9d){return{'ok':![],'code':_0x5abb1b,'packageVersion':_0x267643['packageVersion'],'skillVersion':_0x267643['skillVersion'],'installedPath':_0x3c9d9d,'changed':![],'repairCommand':REPAIR_COMMAND,'error':_0x44634b instanceof Error?_0x44634b['message']:String(_0x44634b)};}export function installBuiltinSkill(_0x202706={}){const _0x5984bb=a152_0x5c4156,_0x334325=_0x202706[_0x5984bb(0x14f)]??DEFAULT_PACKAGE_ROOT,_0xfaaa8=_0x202706['home']??homedir();let _0x2de6cb;try{_0x2de6cb=readSource(_0x334325);}catch(_0x4f407e){return failure(_0x5984bb(0x173),{'packageVersion':'unknown','skillVersion':_0x5984bb(0x151)},_0x4f407e);}const _0x2846a0=inspectBuiltinSkill({'packageRoot':_0x334325,'home':_0xfaaa8}),_0x5b9285=runNpxSkillsAddGlobal(_0x334325,_0x2de6cb['root'],{'stdio':_0x202706[_0x5984bb(0x13e)]??_0x5984bb(0x131),'expectedSkillName':SKILL_NAME,'presence':{'home':_0xfaaa8}});if(_0x5b9285[_0x5984bb(0x164)])return{'ok':!![],'packageVersion':_0x2de6cb[_0x5984bb(0x140)],'skillVersion':_0x2de6cb['skillVersion'],'installedPath':_0x2846a0['installedPath'],'changed':![],'repairCommand':REPAIR_COMMAND};if(!_0x5b9285['ok'])return failure(_0x5984bb(0x139),_0x2de6cb,_0x5b9285[_0x5984bb(0x16e)]??_0x5984bb(0x156)+_0x5b9285[_0x5984bb(0x162)]);const _0x2c35f0=inspectBuiltinSkill({'packageRoot':_0x334325,'home':_0xfaaa8});if(_0x2c35f0[_0x5984bb(0x169)]!=='current'){const _0x4f5041=_0x2c35f0['reason']??'Installed\x20Skill\x20state\x20is\x20'+_0x2c35f0[_0x5984bb(0x169)];return failure(_0x5984bb(0x172),_0x2de6cb,_0x5b9285[_0x5984bb(0x157)]?_0x4f5041+'\x0a'+_0x5b9285[_0x5984bb(0x157)][_0x5984bb(0x145)]:_0x4f5041,_0x2c35f0[_0x5984bb(0x146)]);}return _0x5b9285[_0x5984bb(0x157)]&&(debug('Installer\x20reported\x20partial\x20target\x20failures:\x0a%s',_0x5b9285[_0x5984bb(0x157)][_0x5984bb(0x145)]),console['log'](_0x5984bb(0x176)+_0x2de6cb[_0x5984bb(0x13c)]+_0x5984bb(0x15d)+_0x5b9285['partialFailure'][_0x5984bb(0x165)]+_0x5984bb(0x144))),{'ok':!![],'packageVersion':_0x2de6cb[_0x5984bb(0x140)],'skillVersion':_0x2de6cb[_0x5984bb(0x13c)],'installedPath':_0x2c35f0[_0x5984bb(0x146)],'changed':_0x2846a0[_0x5984bb(0x169)]!==_0x5984bb(0x155),'repairCommand':REPAIR_COMMAND};}
@@ -1 +1 @@
1
- const a153_0x1d7a40=a153_0x49aa;(function(_0x15fefc,_0x1afc5c){const _0x3f3c58=a153_0x49aa,_0x789e24=_0x15fefc();while(!![]){try{const _0x186c17=parseInt(_0x3f3c58(0x1a5))/0x1*(-parseInt(_0x3f3c58(0x18b))/0x2)+parseInt(_0x3f3c58(0x192))/0x3*(-parseInt(_0x3f3c58(0x1a8))/0x4)+parseInt(_0x3f3c58(0x1a7))/0x5+parseInt(_0x3f3c58(0x176))/0x6*(-parseInt(_0x3f3c58(0x179))/0x7)+-parseInt(_0x3f3c58(0x193))/0x8+-parseInt(_0x3f3c58(0x1aa))/0x9+parseInt(_0x3f3c58(0x18a))/0xa;if(_0x186c17===_0x1afc5c)break;else _0x789e24['push'](_0x789e24['shift']());}catch(_0x233afc){_0x789e24['push'](_0x789e24['shift']());}}}(a153_0x3617,0xe2646));import{execaSync}from'execa';import{LOVRABET_SKILL_SOURCE as a153_0x436033}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_0x436033;export const LOVRABET_SKILL_GIT_SOURCE=PRODUCT_CONFIG[a153_0x1d7a40(0x19f)];function a153_0x49aa(_0x2340ba,_0x58f7c7){_0x2340ba=_0x2340ba-0x176;const _0x361763=a153_0x3617();let _0x49aa44=_0x361763[_0x2340ba];return _0x49aa44;}export const LOVRABET_GLOBAL_SKILL_NAME=PRODUCT_CONFIG[a153_0x1d7a40(0x1a2)];export function resolveGlobalSkillName(_0x3ff54c){const _0x38181f=a153_0x1d7a40;switch(_0x3ff54c[_0x38181f(0x1a6)]()){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(_0x3a50b5,_0x2f8137,_0x504946){return{'ok':![],'status':_0x2f8137,'code':_0x3a50b5,'error':'['+_0x3a50b5+']\x20'+_0x504946};}export function shouldSkipNpxSkillsAdd(){return process.env[LOVRABET_SKIP_NPX_SKILLS_ENV]==='1';}export function runNpxSkillsAddGlobal(_0x4c4d67,_0x3e69d5=LOVRABET_SKILL_SOURCE,_0x1139e0){const _0x402286=a153_0x1d7a40;if(shouldSkipNpxSkillsAdd())return{'ok':!![],'status':0x0,'skipped':!![]};const _0xe361bd=['-y','skills@latest','add',_0x3e69d5,'-g','-y'],_0xf6a159=[_0x402286(0x189),..._0xe361bd]['join']('\x20');console[_0x402286(0x181)]('*\x20'+_0xf6a159);const _0x16dc53={...process.env};delete _0x16dc53[_0x402286(0x1a9)],delete _0x16dc53[_0x402286(0x195)];const _0x35d4e5=execaSync('npx',_0xe361bd,{'cwd':_0x4c4d67,'stdio':_0x402286(0x18f),'env':_0x16dc53,'extendEnv':![],'shell':![],'reject':![],'maxBuffer':CHILD_OUTPUT_MAX_BUFFER}),_0x1c8835=[_0x35d4e5[_0x402286(0x17e)]?String(_0x35d4e5[_0x402286(0x17e)]):'',_0x35d4e5[_0x402286(0x1a1)]?String(_0x35d4e5[_0x402286(0x1a1)]):'']['filter'](Boolean)['join']('\x0a')[_0x402286(0x1a6)](),_0x2c9cd7=_0x35d4e5[_0x402286(0x19b)]??null,_0x5cfcd7=_0x50952d=>{const _0xdac14e=_0x402286;return _0x1139e0?.[_0xdac14e(0x198)]!=='pipe'&&!_0x50952d[_0xdac14e(0x180)]&&_0x1c8835&&console[_0xdac14e(0x181)](_0x1c8835),_0x50952d;};if(_0x35d4e5[_0x402286(0x178)]){const _0x98a6dc=_0x35d4e5[_0x402286(0x178)]===_0x402286(0x183)?_0x402286(0x17d):_0x35d4e5[_0x402286(0x178)]===_0x402286(0x186)||_0x35d4e5[_0x402286(0x178)]==='EACCES'?'PERMISSION_DENIED':'SPAWN_FAILED';return _0x5cfcd7(failure(_0x98a6dc,_0x2c9cd7,_0x35d4e5[_0x402286(0x17a)]??_0x35d4e5[_0x402286(0x1a4)]??_0x35d4e5[_0x402286(0x178)]));}if(_0x35d4e5[_0x402286(0x196)])return _0x5cfcd7(failure(_0x402286(0x1a3),_0x2c9cd7,_0x402286(0x191)+_0x35d4e5['signal']));if(_0x35d4e5[_0x402286(0x18e)]&&_0x2c9cd7===null)return _0x5cfcd7(failure(_0x402286(0x17f),_0x2c9cd7,_0x35d4e5[_0x402286(0x17a)]??_0x35d4e5['message']??_0x402286(0x190)));if(_0x2c9cd7!==0x0)return _0x5cfcd7(failure(_0x402286(0x194),_0x2c9cd7,_0x1c8835||_0x35d4e5[_0x402286(0x17a)]||_0x402286(0x19a)+(_0x2c9cd7??_0x402286(0x18d))));const _0x9bbfa3=_0x1139e0?.[_0x402286(0x1a0)]??resolveGlobalSkillName(_0x3e69d5),_0x3aea53=_0x9bbfa3?resolveInstalledSkill(_0x9bbfa3,_0x1139e0?.[_0x402286(0x177)]):undefined,_0x395ed9=_0x1c8835['match'](/Failed to install\s+(\d+)/i);if(_0x395ed9&&Number(_0x395ed9[0x1])>0x0){const _0x109159=_0x402286(0x197)+_0x395ed9[0x1]+_0x402286(0x187)+(_0x1c8835?':\x0a'+_0x1c8835:'');if(_0x3aea53?.[_0x402286(0x185)]===_0x402286(0x184))return{'ok':!![],'status':0x0,'partialFailure':{'count':Number(_0x395ed9[0x1]),'output':_0x1c8835}};return _0x5cfcd7(failure('INSTALL_PARTIAL',0x0,_0x109159));}if(_0x9bbfa3&&_0x3aea53){if(_0x3aea53[_0x402286(0x185)]===_0x402286(0x199))return _0x5cfcd7(failure(_0x402286(0x18c),0x0,_0x402286(0x188)+_0x9bbfa3+_0x402286(0x19d)+_0x3aea53['checked']['join'](',\x20')+')'));_0x3aea53[_0x402286(0x185)]===_0x402286(0x17b)&&console[_0x402286(0x17c)](_0x402286(0x182)+_0x9bbfa3+_0x402286(0x19c)+_0x3aea53[_0x402286(0x19e)]);}return _0x5cfcd7({'ok':!![],'status':0x0});}function a153_0x3617(){const _0x106dc6=['59076570FTUVkv','54RgJMtf','SKILL_NOT_INSTALLED','unknown','failed','pipe','npx\x20failed\x20to\x20start','npx\x20terminated\x20by\x20signal\x20','3UGnCeR','11671424GIQNmw','CHILD_EXIT_NONZERO','NPM_CONFIG_GLOBAL','signal','Installer\x20reported\x20','stdio','absent','exit\x20','exitCode','\x22\x20install\x20state:\x20','\x22\x20not\x20found\x20after\x20install\x20(checked\x20','reason','internalSkillSource','expectedSkillName','stderr','globalSkillName','CHILD_TERMINATED','message','64687VxqtUh','trim','7757205nNOfDT','4372172dtZjiC','npm_config_global','7869681bBYAEt','6zFhPaj','presence','code','9512069RKOrCt','shortMessage','unverifiable','warn','NPX_NOT_FOUND','stdout','SPAWN_FAILED','partialFailure','log','!\x20Could\x20not\x20verify\x20\x22','ENOENT','present','state','EPERM','\x20failed\x20target(s)','Skill\x20\x22','npx'];a153_0x3617=function(){return _0x106dc6;};return a153_0x3617();}
1
+ function a153_0x12c0(){const _0x3a174f=['2764050aovNXk','message','\x22\x20install\x20state:\x20','CHILD_TERMINATED','INSTALL_PARTIAL','Installer\x20reported\x20','partialFailure','11419264FlWsjt','join','stdout','present','code','warn','checked','\x22\x20not\x20found\x20after\x20install\x20(checked\x20','trim','shortMessage','SPAWN_FAILED','EACCES','npx\x20failed\x20to\x20start','\x20failed\x20target(s)','failed','CHILD_EXIT_NONZERO','stdio','npm_config_global','stderr','1272576GnXZSg','Skill\x20\x22','714050kqvvhf','internalSkillSource','npx\x20terminated\x20by\x20signal\x20','pipe','NPM_CONFIG_GLOBAL','skills@latest','expectedSkillName','exit\x20','state','add','reason','signal','SKILL_NOT_INSTALLED','9BLPfYk','skipNpxSkillsEnvSuffix','filter','1421588MMjWGR','5NgtVby','unverifiable','PERMISSION_DENIED','npx','7345989aQBMmt','exitCode','EPERM','log','6174138yOjALx'];a153_0x12c0=function(){return _0x3a174f;};return a153_0x12c0();}const a153_0x2a0ef5=a153_0x1fea;(function(_0x4911be,_0x2eb726){const _0x504927=a153_0x1fea,_0x3eac08=_0x4911be();while(!![]){try{const _0x4765e2=-parseInt(_0x504927(0x17e))/0x1+parseInt(_0x504927(0x17c))/0x2+parseInt(_0x504927(0x162))/0x3+parseInt(_0x504927(0x158))/0x4+parseInt(_0x504927(0x159))/0x5*(-parseInt(_0x504927(0x161))/0x6)+-parseInt(_0x504927(0x15d))/0x7+-parseInt(_0x504927(0x169))/0x8*(-parseInt(_0x504927(0x155))/0x9);if(_0x4765e2===_0x2eb726)break;else _0x3eac08['push'](_0x3eac08['shift']());}catch(_0x4bd556){_0x3eac08['push'](_0x3eac08['shift']());}}}(a153_0x12c0,0x85c67));import{execaSync}from'execa';import{LOVRABET_SKILL_SOURCE as a153_0x4344b7}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_0x4344b7;export const LOVRABET_SKILL_GIT_SOURCE=PRODUCT_CONFIG[a153_0x2a0ef5(0x17f)];export const LOVRABET_GLOBAL_SKILL_NAME=PRODUCT_CONFIG['globalSkillName'];function a153_0x1fea(_0x569dc5,_0xb03ad5){_0x569dc5=_0x569dc5-0x154;const _0x12c08b=a153_0x12c0();let _0x1fea0f=_0x12c08b[_0x569dc5];return _0x1fea0f;}export function resolveGlobalSkillName(_0x2a630b){const _0x37f147=a153_0x2a0ef5;switch(_0x2a630b[_0x37f147(0x171)]()){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_0x2a0ef5(0x156)]);const CHILD_OUTPUT_MAX_BUFFER=0x10*0x400*0x400;function failure(_0x452414,_0x1681e8,_0x1e7fe2){return{'ok':![],'status':_0x1681e8,'code':_0x452414,'error':'['+_0x452414+']\x20'+_0x1e7fe2};}export function shouldSkipNpxSkillsAdd(){return process.env[LOVRABET_SKIP_NPX_SKILLS_ENV]==='1';}export function runNpxSkillsAddGlobal(_0x245853,_0x139e5e=LOVRABET_SKILL_SOURCE,_0x11de87){const _0x360f81=a153_0x2a0ef5;if(shouldSkipNpxSkillsAdd())return{'ok':!![],'status':0x0,'skipped':!![]};const _0xc3384a=['-y',_0x360f81(0x183),_0x360f81(0x187),_0x139e5e,'-g','-y'],_0x198a57=[_0x360f81(0x15c),..._0xc3384a]['join']('\x20');console['log']('*\x20'+_0x198a57);const _0x19b946={...process.env};delete _0x19b946[_0x360f81(0x17a)],delete _0x19b946[_0x360f81(0x182)];const _0x40d21e=execaSync(_0x360f81(0x15c),_0xc3384a,{'cwd':_0x245853,'stdio':_0x360f81(0x181),'env':_0x19b946,'extendEnv':![],'shell':![],'reject':![],'maxBuffer':CHILD_OUTPUT_MAX_BUFFER}),_0xcc5724=[_0x40d21e[_0x360f81(0x16b)]?String(_0x40d21e[_0x360f81(0x16b)]):'',_0x40d21e[_0x360f81(0x17b)]?String(_0x40d21e[_0x360f81(0x17b)]):''][_0x360f81(0x157)](Boolean)['join']('\x0a')[_0x360f81(0x171)](),_0x249c96=_0x40d21e[_0x360f81(0x15e)]??null,_0x5632fe=_0x5313e2=>{const _0x3c3a2a=_0x360f81;return _0x11de87?.[_0x3c3a2a(0x179)]!==_0x3c3a2a(0x181)&&!_0x5313e2[_0x3c3a2a(0x168)]&&_0xcc5724&&console[_0x3c3a2a(0x160)](_0xcc5724),_0x5313e2;};if(_0x40d21e['code']){const _0x59f5b3=_0x40d21e[_0x360f81(0x16d)]==='ENOENT'?'NPX_NOT_FOUND':_0x40d21e[_0x360f81(0x16d)]===_0x360f81(0x15f)||_0x40d21e[_0x360f81(0x16d)]===_0x360f81(0x174)?_0x360f81(0x15b):_0x360f81(0x173);return _0x5632fe(failure(_0x59f5b3,_0x249c96,_0x40d21e[_0x360f81(0x172)]??_0x40d21e[_0x360f81(0x163)]??_0x40d21e[_0x360f81(0x16d)]));}if(_0x40d21e[_0x360f81(0x189)])return _0x5632fe(failure(_0x360f81(0x165),_0x249c96,_0x360f81(0x180)+_0x40d21e[_0x360f81(0x189)]));if(_0x40d21e[_0x360f81(0x177)]&&_0x249c96===null)return _0x5632fe(failure(_0x360f81(0x173),_0x249c96,_0x40d21e[_0x360f81(0x172)]??_0x40d21e['message']??_0x360f81(0x175)));if(_0x249c96!==0x0)return _0x5632fe(failure(_0x360f81(0x178),_0x249c96,_0xcc5724||_0x40d21e[_0x360f81(0x172)]||_0x360f81(0x185)+(_0x249c96??'unknown')));const _0x4c9a37=_0x11de87?.[_0x360f81(0x184)]??resolveGlobalSkillName(_0x139e5e),_0x52d666=_0x4c9a37?resolveInstalledSkill(_0x4c9a37,_0x11de87?.['presence']):undefined,_0x2a52ba=_0xcc5724['match'](/Failed to install\s+(\d+)/i);if(_0x2a52ba&&Number(_0x2a52ba[0x1])>0x0){const _0x41d112=_0x360f81(0x167)+_0x2a52ba[0x1]+_0x360f81(0x176)+(_0xcc5724?':\x0a'+_0xcc5724:'');if(_0x52d666?.[_0x360f81(0x186)]===_0x360f81(0x16c))return{'ok':!![],'status':0x0,'partialFailure':{'count':Number(_0x2a52ba[0x1]),'output':_0xcc5724}};return _0x5632fe(failure(_0x360f81(0x166),0x0,_0x41d112));}if(_0x4c9a37&&_0x52d666){if(_0x52d666[_0x360f81(0x186)]==='absent')return _0x5632fe(failure(_0x360f81(0x154),0x0,_0x360f81(0x17d)+_0x4c9a37+_0x360f81(0x170)+_0x52d666[_0x360f81(0x16f)][_0x360f81(0x16a)](',\x20')+')'));_0x52d666[_0x360f81(0x186)]===_0x360f81(0x15a)&&console[_0x360f81(0x16e)]('!\x20Could\x20not\x20verify\x20\x22'+_0x4c9a37+_0x360f81(0x164)+_0x52d666[_0x360f81(0x188)]);}return _0x5632fe({'ok':!![],'status':0x0});}
@@ -1 +1 @@
1
- const a154_0x1f648c=a154_0x4917;(function(_0x47e3d5,_0x442f57){const _0x1cf83b=a154_0x4917,_0x5ca74a=_0x47e3d5();while(!![]){try{const _0x311fcc=parseInt(_0x1cf83b(0x19a))/0x1*(parseInt(_0x1cf83b(0x1a4))/0x2)+-parseInt(_0x1cf83b(0x1a2))/0x3*(parseInt(_0x1cf83b(0x193))/0x4)+parseInt(_0x1cf83b(0x1a3))/0x5+parseInt(_0x1cf83b(0x1a6))/0x6*(parseInt(_0x1cf83b(0x195))/0x7)+parseInt(_0x1cf83b(0x192))/0x8*(-parseInt(_0x1cf83b(0x1a1))/0x9)+parseInt(_0x1cf83b(0x1a5))/0xa+-parseInt(_0x1cf83b(0x19e))/0xb*(parseInt(_0x1cf83b(0x198))/0xc);if(_0x311fcc===_0x442f57)break;else _0x5ca74a['push'](_0x5ca74a['shift']());}catch(_0x5b73ba){_0x5ca74a['push'](_0x5ca74a['shift']());}}}(a154_0x2da7,0x7c212));export const METADATA_FILE=a154_0x1f648c(0x1a0);export const SKILL_FILE=a154_0x1f648c(0x19c);function a154_0x4917(_0x490dbf,_0x43a9a9){_0x490dbf=_0x490dbf-0x192;const _0x2da7ca=a154_0x2da7();let _0x49172b=_0x2da7ca[_0x490dbf];return _0x49172b;}function a154_0x2da7(){const _0x4bfaba=['.svn','1nATwQG','build','SKILL.md','node_modules','22KqpubZ','coverage','lovrabet.skill.json','1411353BzWGtO','156eoLpXS','3830935iBQcPp','1617406RSNKep','1256360laxJAd','206154jBTzOE','.hg','24JUmvfg','45264SoyuOi','.cache','77sHqXeH','.next','.DS_Store','3066948mRkQIc'];a154_0x2da7=function(){return _0x4bfaba;};return a154_0x2da7();}export const IGNORED_FILE_NAMES=new Set([METADATA_FILE,a154_0x1f648c(0x197)]);export const IGNORED_DIR_NAMES=new Set(['.git',a154_0x1f648c(0x1a7),a154_0x1f648c(0x199),a154_0x1f648c(0x19d),a154_0x1f648c(0x196),'dist',a154_0x1f648c(0x19b),a154_0x1f648c(0x19f),'.turbo',a154_0x1f648c(0x194)]);
1
+ const a154_0xa643a8=a154_0x5e6f;function a154_0x48a3(){const _0x29a64a=['dist','927526xuZXLN','.hg','.cache','.git','12501qPCpOQ','736NCmRca','SKILL.md','node_modules','.DS_Store','3GfLAgh','build','3345FaEgmu','lovrabet.skill.json','584981AZTwPn','.svn','.turbo','.next','3381651MJXNyE','15398590GRpGbP','962552vkJxhV','8220XRYRdf','coverage'];a154_0x48a3=function(){return _0x29a64a;};return a154_0x48a3();}(function(_0x172716,_0x159d81){const _0x42124d=a154_0x5e6f,_0x398455=_0x172716();while(!![]){try{const _0xb21a8f=parseInt(_0x42124d(0x7c))/0x1+-parseInt(_0x42124d(0x86))/0x2*(parseInt(_0x42124d(0x78))/0x3)+parseInt(_0x42124d(0x82))/0x4+-parseInt(_0x42124d(0x7a))/0x5*(parseInt(_0x42124d(0x83))/0x6)+-parseInt(_0x42124d(0x80))/0x7+-parseInt(_0x42124d(0x8b))/0x8*(-parseInt(_0x42124d(0x8a))/0x9)+parseInt(_0x42124d(0x81))/0xa;if(_0xb21a8f===_0x159d81)break;else _0x398455['push'](_0x398455['shift']());}catch(_0x32f1d9){_0x398455['push'](_0x398455['shift']());}}}(a154_0x48a3,0x99c78));export const METADATA_FILE=a154_0xa643a8(0x7b);export const SKILL_FILE=a154_0xa643a8(0x8c);function a154_0x5e6f(_0x1eb1c4,_0x47267f){_0x1eb1c4=_0x1eb1c4-0x77;const _0x48a35b=a154_0x48a3();let _0x5e6f2b=_0x48a35b[_0x1eb1c4];return _0x5e6f2b;}export const IGNORED_FILE_NAMES=new Set([METADATA_FILE,a154_0xa643a8(0x77)]);export const IGNORED_DIR_NAMES=new Set([a154_0xa643a8(0x89),a154_0xa643a8(0x87),a154_0xa643a8(0x7d),a154_0xa643a8(0x8d),a154_0xa643a8(0x7f),a154_0xa643a8(0x85),a154_0xa643a8(0x79),a154_0xa643a8(0x84),a154_0xa643a8(0x7e),a154_0xa643a8(0x88)]);
@@ -1 +1 @@
1
- (function(_0x47c3af,_0x2cec70){const _0x4b8647=a155_0x9b26,_0x52b50a=_0x47c3af();while(!![]){try{const _0x5b8816=parseInt(_0x4b8647(0xbd))/0x1*(-parseInt(_0x4b8647(0xb3))/0x2)+-parseInt(_0x4b8647(0xaa))/0x3*(parseInt(_0x4b8647(0xb1))/0x4)+-parseInt(_0x4b8647(0xb5))/0x5*(parseInt(_0x4b8647(0xba))/0x6)+-parseInt(_0x4b8647(0xb0))/0x7*(parseInt(_0x4b8647(0xbb))/0x8)+parseInt(_0x4b8647(0xaf))/0x9+parseInt(_0x4b8647(0xb7))/0xa+parseInt(_0x4b8647(0xb6))/0xb;if(_0x5b8816===_0x2cec70)break;else _0x52b50a['push'](_0x52b50a['shift']());}catch(_0xe3a14e){_0x52b50a['push'](_0x52b50a['shift']());}}}(a155_0x330f,0x4ec6c));import{lstatSync,readlinkSync,realpathSync,renameSync,rmSync,writeFileSync}from'node:fs';import{dirname,isAbsolute,resolve,sep}from'node:path';function a155_0x9b26(_0x7577ee,_0x435778){_0x7577ee=_0x7577ee-0xaa;const _0x330f80=a155_0x330f();let _0x9b2650=_0x330f80[_0x7577ee];return _0x9b2650;}import{CliErrors}from'../../errors.js';function a155_0x330f(){const _0x39378a=['split','23568ZukJhA','322120kqrTXW','utf8','1huYhSM','9vGOQWs','startsWith','Unsafe\x20Skill\x20file\x20path:\x20','from','validation','4096584nbFpdW','35nBhoIL','268132IaAGXD','endsWith','1196282vafQVN','stringify','185aDoagO','11086295knQWYB','55480LzwxDr','.tmp'];a155_0x330f=function(){return _0x39378a;};return a155_0x330f();}import{normalizeSkillRelativePath}from'./local-files.js';export function resolveManagedFilePath(_0x593e8d,_0x4e2e20){const _0xdd37b8=a155_0x9b26,_0x2030de=normalizeSkillRelativePath(_0x4e2e20),_0x214934=realOrResolved(_0x593e8d),_0x103488=resolve(_0x214934,..._0x2030de[_0xdd37b8(0xb9)]('/'));if(!isPathInside(_0x103488,_0x214934))throw CliErrors['validation'](_0xdd37b8(0xac)+_0x4e2e20);return ensureNoSymlinkInManagedPath(_0x214934,_0x2030de),_0x103488;}export function ensureNoSymlinkInManagedPath(_0x4cdaeb,_0x1bcecf){const _0x3059b6=a155_0x9b26;let _0x2e25c6=_0x4cdaeb;for(const _0x2fc022 of _0x1bcecf[_0x3059b6(0xb9)]('/')){_0x2e25c6=resolve(_0x2e25c6,_0x2fc022);const _0x468af2=lstatIfPresent(_0x2e25c6);if(_0x468af2?.['isSymbolicLink']())throw CliErrors[_0x3059b6(0xae)]('Refusing\x20to\x20write\x20through\x20Skill\x20symlink\x20path:\x20'+_0x1bcecf);}}export function isDanglingSymlink(_0x27d55a){try{return lstatSync(_0x27d55a)['isSymbolicLink']();}catch{return![];}}export function resolveSymlinkTarget(_0x539b10){const _0x456c2d=readlinkSync(_0x539b10);return isAbsolute(_0x456c2d)?_0x456c2d:resolve(dirname(_0x539b10),_0x456c2d);}export function isPathInside(_0x54171c,_0x2f6ca4){const _0x503c19=a155_0x9b26,_0x2b6028=_0x54171c[_0x503c19(0xb2)](sep)?_0x54171c:''+_0x54171c+sep,_0x142a9f=_0x2f6ca4[_0x503c19(0xb2)](sep)?_0x2f6ca4:''+_0x2f6ca4+sep;return _0x54171c===_0x2f6ca4||_0x2b6028[_0x503c19(0xab)](_0x142a9f);}export function realOrResolved(_0x3fde84){try{return realpathSync(_0x3fde84);}catch{return resolve(_0x3fde84);}}export function lstatIfPresent(_0x4536e5){try{return lstatSync(_0x4536e5);}catch{return undefined;}}export function writeTextAtomic(_0x4f6bf8,_0x1f03c8,_0x20b176){const _0x26f63d=a155_0x9b26;writeBytesAtomic(_0x4f6bf8,Buffer[_0x26f63d(0xad)](_0x1f03c8,_0x26f63d(0xbc)),_0x20b176);}export function writeBytesAtomic(_0xcdeb59,_0x62a67e,_0x20806f){const _0x26df06=a155_0x9b26,_0x16ec80=_0xcdeb59+_0x26df06(0xb8);try{writeFileSync(_0x16ec80,_0x62a67e,{'mode':_0x20806f}),renameSync(_0x16ec80,_0xcdeb59);}catch(_0x14f04e){try{rmSync(_0x16ec80,{'force':!![]});}catch{}throw _0x14f04e;}}export function writeJsonAtomic(_0x249d0a,_0x2e8f00){const _0xc10005=a155_0x9b26;writeTextAtomic(_0x249d0a,JSON[_0xc10005(0xb4)](_0x2e8f00,null,0x2)+'\x0a',0x180);}
1
+ (function(_0x873243,_0x354341){const _0x392764=a155_0x4795,_0x358380=_0x873243();while(!![]){try{const _0x29bf73=-parseInt(_0x392764(0x134))/0x1+parseInt(_0x392764(0x138))/0x2*(parseInt(_0x392764(0x13a))/0x3)+parseInt(_0x392764(0x133))/0x4+parseInt(_0x392764(0x136))/0x5+-parseInt(_0x392764(0x132))/0x6+parseInt(_0x392764(0x131))/0x7+parseInt(_0x392764(0x12c))/0x8*(-parseInt(_0x392764(0x13d))/0x9);if(_0x29bf73===_0x354341)break;else _0x358380['push'](_0x358380['shift']());}catch(_0x14301d){_0x358380['push'](_0x358380['shift']());}}}(a155_0x1eb5,0x4dd15));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(_0x5aa54c,_0x250b63){const _0x4cc7bc=normalizeSkillRelativePath(_0x250b63),_0x243e00=realOrResolved(_0x5aa54c),_0x2ef6c5=resolve(_0x243e00,..._0x4cc7bc['split']('/'));if(!isPathInside(_0x2ef6c5,_0x243e00))throw CliErrors['validation']('Unsafe\x20Skill\x20file\x20path:\x20'+_0x250b63);return ensureNoSymlinkInManagedPath(_0x243e00,_0x4cc7bc),_0x2ef6c5;}export function ensureNoSymlinkInManagedPath(_0x579ca3,_0x3bd166){const _0x2577de=a155_0x4795;let _0x4fa745=_0x579ca3;for(const _0x14ba5e of _0x3bd166[_0x2577de(0x13b)]('/')){_0x4fa745=resolve(_0x4fa745,_0x14ba5e);const _0x2a0c59=lstatIfPresent(_0x4fa745);if(_0x2a0c59?.[_0x2577de(0x12b)]())throw CliErrors[_0x2577de(0x130)](_0x2577de(0x139)+_0x3bd166);}}export function isDanglingSymlink(_0x35cd4e){try{return lstatSync(_0x35cd4e)['isSymbolicLink']();}catch{return![];}}export function resolveSymlinkTarget(_0x130b97){const _0x5437a5=readlinkSync(_0x130b97);return isAbsolute(_0x5437a5)?_0x5437a5:resolve(dirname(_0x130b97),_0x5437a5);}export function isPathInside(_0x3634ab,_0x21d019){const _0xf8d14b=a155_0x4795,_0x28bf20=_0x3634ab[_0xf8d14b(0x12d)](sep)?_0x3634ab:''+_0x3634ab+sep,_0x73ce98=_0x21d019[_0xf8d14b(0x12d)](sep)?_0x21d019:''+_0x21d019+sep;return _0x3634ab===_0x21d019||_0x28bf20[_0xf8d14b(0x13c)](_0x73ce98);}export function realOrResolved(_0x471fea){try{return realpathSync(_0x471fea);}catch{return resolve(_0x471fea);}}function a155_0x1eb5(){const _0x271695=['Refusing\x20to\x20write\x20through\x20Skill\x20symlink\x20path:\x20','249pJQlCE','split','startsWith','5373pGRWMF','isSymbolicLink','5872sEejyg','endsWith','from','stringify','validation','1980734BXdopb','1843488XOUuWY','1624056dxMFFd','283705ZGstmA','utf8','530265OnrBjA','.tmp','13322gfzldC'];a155_0x1eb5=function(){return _0x271695;};return a155_0x1eb5();}export function lstatIfPresent(_0x648719){try{return lstatSync(_0x648719);}catch{return undefined;}}function a155_0x4795(_0x59d140,_0xdf40b6){_0x59d140=_0x59d140-0x12b;const _0x1eb50f=a155_0x1eb5();let _0x47952d=_0x1eb50f[_0x59d140];return _0x47952d;}export function writeTextAtomic(_0x49c4ea,_0x30039f,_0x58b4c9){const _0x300f14=a155_0x4795;writeBytesAtomic(_0x49c4ea,Buffer[_0x300f14(0x12e)](_0x30039f,_0x300f14(0x135)),_0x58b4c9);}export function writeBytesAtomic(_0x184046,_0x9de9d7,_0x22215c){const _0x5e47e1=a155_0x4795,_0x2887a7=_0x184046+_0x5e47e1(0x137);try{writeFileSync(_0x2887a7,_0x9de9d7,{'mode':_0x22215c}),renameSync(_0x2887a7,_0x184046);}catch(_0x3411a4){try{rmSync(_0x2887a7,{'force':!![]});}catch{}throw _0x3411a4;}}export function writeJsonAtomic(_0x5a7685,_0x3d219c){const _0x56fb20=a155_0x4795;writeTextAtomic(_0x5a7685,JSON[_0x56fb20(0x12f)](_0x3d219c,null,0x2)+'\x0a',0x180);}
@@ -1 +1 @@
1
- (function(_0x20723e,_0x1d2749){const _0x4f0de1=a156_0x284d,_0x3ed48b=_0x20723e();while(!![]){try{const _0x7703dc=parseInt(_0x4f0de1(0x1e0))/0x1+parseInt(_0x4f0de1(0x1e4))/0x2*(parseInt(_0x4f0de1(0x1e2))/0x3)+-parseInt(_0x4f0de1(0x1d8))/0x4+-parseInt(_0x4f0de1(0x1e1))/0x5+-parseInt(_0x4f0de1(0x1dd))/0x6*(-parseInt(_0x4f0de1(0x1da))/0x7)+-parseInt(_0x4f0de1(0x1df))/0x8+parseInt(_0x4f0de1(0x1e3))/0x9;if(_0x7703dc===_0x1d2749)break;else _0x3ed48b['push'](_0x3ed48b['shift']());}catch(_0x3e12f2){_0x3ed48b['push'](_0x3ed48b['shift']());}}}(a156_0x2d9f,0x1f7b3));import{createHash}from'node:crypto';import{fileContent,normalizeManifestFiles}from'./local-files.js';export function contentHash(_0x1ca187){const _0x4eb819=a156_0x284d;return createHash(_0x4eb819(0x1e5))[_0x4eb819(0x1de)](_0x1ca187)['digest']('hex');}function a156_0x2d9f(){const _0x39047e=['digest','546WSpxlr','size','hex','2466HGciQi','update','1354232LGtwRh','103951tlxYDM','1057785odAZAy','235890ViANHx','2332827yOXtNt','6YhIVjL','sha256','485276iyfHuX'];a156_0x2d9f=function(){return _0x39047e;};return a156_0x2d9f();}export function fileHash(_0x17b4d6){return bufferSha256(fileContent(_0x17b4d6));}export function bufferSha256(_0xed351){const _0x477a35=a156_0x284d;return createHash('sha256')[_0x477a35(0x1de)](_0xed351)[_0x477a35(0x1d9)](_0x477a35(0x1dc));}function a156_0x284d(_0x428979,_0x5b8e41){_0x428979=_0x428979-0x1d8;const _0x2d9ff4=a156_0x2d9f();let _0x284d33=_0x2d9ff4[_0x428979];return _0x284d33;}export function fileTreeHash(_0x5ebc68){const _0x2affcb=a156_0x284d,_0x17a9f9=createHash(_0x2affcb(0x1e5));for(const _0x1f09b7 of normalizeManifestFiles(_0x5ebc68)){_0x17a9f9[_0x2affcb(0x1de)](_0x1f09b7['path']),_0x17a9f9[_0x2affcb(0x1de)]('\x00'),_0x17a9f9[_0x2affcb(0x1de)](_0x1f09b7[_0x2affcb(0x1e5)]),_0x17a9f9[_0x2affcb(0x1de)]('\x00'),_0x17a9f9[_0x2affcb(0x1de)](String(_0x1f09b7[_0x2affcb(0x1db)])),_0x17a9f9[_0x2affcb(0x1de)]('\x00');}return _0x17a9f9[_0x2affcb(0x1d9)]('hex');}
1
+ (function(_0x5cfb16,_0x8e32dd){const _0x17cd01=a156_0x225e,_0x38cdb3=_0x5cfb16();while(!![]){try{const _0x323112=-parseInt(_0x17cd01(0x194))/0x1+-parseInt(_0x17cd01(0x18d))/0x2*(parseInt(_0x17cd01(0x193))/0x3)+parseInt(_0x17cd01(0x198))/0x4+-parseInt(_0x17cd01(0x18f))/0x5*(parseInt(_0x17cd01(0x18c))/0x6)+parseInt(_0x17cd01(0x199))/0x7+-parseInt(_0x17cd01(0x18e))/0x8+-parseInt(_0x17cd01(0x18b))/0x9*(-parseInt(_0x17cd01(0x191))/0xa);if(_0x323112===_0x8e32dd)break;else _0x38cdb3['push'](_0x38cdb3['shift']());}catch(_0xae56b4){_0x38cdb3['push'](_0x38cdb3['shift']());}}}(a156_0x27db,0xb9ce5));import{createHash}from'node:crypto';import{fileContent,normalizeManifestFiles}from'./local-files.js';function a156_0x27db(){const _0x5da03a=['10433952kGfcvM','127510UuScEk','digest','27805980bMkOmU','update','237DnXfXx','670128bOCDsr','size','hex','sha256','5211864TYcBBj','1136338pWFYVI','path','9Qiyjrg','6smiakq','37594gdujVC'];a156_0x27db=function(){return _0x5da03a;};return a156_0x27db();}export function contentHash(_0x1c2966){const _0x333982=a156_0x225e;return createHash(_0x333982(0x197))['update'](_0x1c2966)[_0x333982(0x190)](_0x333982(0x196));}export function fileHash(_0x14b3d9){return bufferSha256(fileContent(_0x14b3d9));}export function bufferSha256(_0x26b2e5){const _0x38e72a=a156_0x225e;return createHash('sha256')[_0x38e72a(0x192)](_0x26b2e5)[_0x38e72a(0x190)](_0x38e72a(0x196));}function a156_0x225e(_0x305dc2,_0x394fb1){_0x305dc2=_0x305dc2-0x18a;const _0x27db9d=a156_0x27db();let _0x225ee1=_0x27db9d[_0x305dc2];return _0x225ee1;}export function fileTreeHash(_0x11a8b3){const _0x19e21d=a156_0x225e,_0x40bc55=createHash(_0x19e21d(0x197));for(const _0x41bda6 of normalizeManifestFiles(_0x11a8b3)){_0x40bc55[_0x19e21d(0x192)](_0x41bda6[_0x19e21d(0x18a)]),_0x40bc55[_0x19e21d(0x192)]('\x00'),_0x40bc55[_0x19e21d(0x192)](_0x41bda6[_0x19e21d(0x197)]),_0x40bc55[_0x19e21d(0x192)]('\x00'),_0x40bc55[_0x19e21d(0x192)](String(_0x41bda6[_0x19e21d(0x195)])),_0x40bc55['update']('\x00');}return _0x40bc55['digest'](_0x19e21d(0x196));}
@@ -1 +1 @@
1
- const a157_0x1c0f60=a157_0x26d7;(function(_0x54605e,_0x243e41){const _0x4b5b98=a157_0x26d7,_0x472d81=_0x54605e();while(!![]){try{const _0x370d24=parseInt(_0x4b5b98(0x1d8))/0x1*(parseInt(_0x4b5b98(0x1d4))/0x2)+parseInt(_0x4b5b98(0x1d1))/0x3*(parseInt(_0x4b5b98(0x1cc))/0x4)+-parseInt(_0x4b5b98(0x1d6))/0x5+-parseInt(_0x4b5b98(0x1d2))/0x6+parseInt(_0x4b5b98(0x1d7))/0x7+-parseInt(_0x4b5b98(0x1dd))/0x8*(parseInt(_0x4b5b98(0x1db))/0x9)+-parseInt(_0x4b5b98(0x1cf))/0xa*(-parseInt(_0x4b5b98(0x1d0))/0xb);if(_0x370d24===_0x243e41)break;else _0x472d81['push'](_0x472d81['shift']());}catch(_0x5b8f4f){_0x472d81['push'](_0x472d81['shift']());}}}(a157_0xcf85,0x6d235));import{resolve}from'node:path';import{resolveSkillSyncPaths,runtimeAgentSkillRoots,safePathSegment}from'./paths.js';function a157_0xcf85(){const _0x3a1846=['2553639mTtOzC','3XIHlAd','4841322GzBkrh','appCode','162264HpmySw','managedRoot','1204150YhmwcB','4770780brWLfD','1XIlOqL','.agents','cwd','522gXzIsx','freeze','46696QjqKNP','1496692lWpDeP','global','project','30beVwCA'];a157_0xcf85=function(){return _0x3a1846;};return a157_0xcf85();}function a157_0x26d7(_0xd0e3c1,_0x67ca55){_0xd0e3c1=_0xd0e3c1-0x1cc;const _0xcf8559=a157_0xcf85();let _0x26d7b1=_0xcf8559[_0xd0e3c1];return _0x26d7b1;}export function resolveRuntimeSkillInstallTarget(_0x2ec5a3,_0x1a148b=a157_0x1c0f60(0x1cd),_0x11e3c7={}){const _0x496537=a157_0x1c0f60,_0x386d14=resolveSkillSyncPaths(_0x11e3c7),_0x41fa0c=safePathSegment(_0x2ec5a3,_0x496537(0x1d3)),_0x4a723a=_0x1a148b===_0x496537(0x1ce)?[resolve(_0x11e3c7[_0x496537(0x1da)]??process[_0x496537(0x1da)](),_0x496537(0x1d9),'skills')]:runtimeAgentSkillRoots(_0x386d14);return Object[_0x496537(0x1dc)]({'scope':_0x1a148b,'appCode':_0x41fa0c,'skillRoots':Object[_0x496537(0x1dc)](_0x4a723a),'managedRoot':_0x386d14[_0x496537(0x1d5)]});}
1
+ const a157_0x190441=a157_0x316f;(function(_0x1ab964,_0x44dda9){const _0x4d88fa=a157_0x316f,_0x184dc8=_0x1ab964();while(!![]){try{const _0x3f260a=parseInt(_0x4d88fa(0x180))/0x1+parseInt(_0x4d88fa(0x182))/0x2*(parseInt(_0x4d88fa(0x18c))/0x3)+parseInt(_0x4d88fa(0x185))/0x4*(parseInt(_0x4d88fa(0x17c))/0x5)+parseInt(_0x4d88fa(0x183))/0x6*(parseInt(_0x4d88fa(0x17a))/0x7)+-parseInt(_0x4d88fa(0x188))/0x8*(parseInt(_0x4d88fa(0x184))/0x9)+-parseInt(_0x4d88fa(0x186))/0xa*(parseInt(_0x4d88fa(0x18d))/0xb)+parseInt(_0x4d88fa(0x18a))/0xc*(-parseInt(_0x4d88fa(0x187))/0xd);if(_0x3f260a===_0x44dda9)break;else _0x184dc8['push'](_0x184dc8['shift']());}catch(_0x567e7a){_0x184dc8['push'](_0x184dc8['shift']());}}}(a157_0x126d,0x45882));function a157_0x316f(_0x238f04,_0x40d3fa){_0x238f04=_0x238f04-0x17a;const _0x126d49=a157_0x126d();let _0x316ff1=_0x126d49[_0x238f04];return _0x316ff1;}import{resolve}from'node:path';import{resolveSkillSyncPaths,runtimeAgentSkillRoots,safePathSegment}from'./paths.js';function a157_0x126d(){const _0x5cfc37=['4cpalCS','14010GoGNVn','13977HpkjTB','12MByGbx','50RDolpI','13GeMyzH','1464GBkdvz','skills','190524rzJFqE','global','113313SJJCjq','69245eFGgEh','287oIbevV','managedRoot','505185gcKuEj','cwd','freeze','appCode','141965amcfrB','.agents'];a157_0x126d=function(){return _0x5cfc37;};return a157_0x126d();}export function resolveRuntimeSkillInstallTarget(_0x204e64,_0xe72c12=a157_0x190441(0x18b),_0x490956={}){const _0x27d492=a157_0x190441,_0xe473b4=resolveSkillSyncPaths(_0x490956),_0x1332d2=safePathSegment(_0x204e64,_0x27d492(0x17f)),_0x216e86=_0xe72c12==='project'?[resolve(_0x490956[_0x27d492(0x17d)]??process[_0x27d492(0x17d)](),_0x27d492(0x181),_0x27d492(0x189))]:runtimeAgentSkillRoots(_0xe473b4);return Object[_0x27d492(0x17e)]({'scope':_0xe72c12,'appCode':_0x1332d2,'skillRoots':Object['freeze'](_0x216e86),'managedRoot':_0xe473b4[_0x27d492(0x17b)]});}
@@ -1 +1 @@
1
- const a158_0x596c45=a158_0x1bbd;(function(_0x5ae4da,_0x4a2b7f){const _0x9a41bc=a158_0x1bbd,_0x47c94e=_0x5ae4da();while(!![]){try{const _0x55f737=parseInt(_0x9a41bc(0xd1))/0x1+-parseInt(_0x9a41bc(0xfb))/0x2*(parseInt(_0x9a41bc(0xce))/0x3)+parseInt(_0x9a41bc(0xcf))/0x4*(-parseInt(_0x9a41bc(0xfe))/0x5)+-parseInt(_0x9a41bc(0xd0))/0x6*(parseInt(_0x9a41bc(0xdb))/0x7)+parseInt(_0x9a41bc(0xf8))/0x8*(parseInt(_0x9a41bc(0xfa))/0x9)+parseInt(_0x9a41bc(0xf0))/0xa+parseInt(_0x9a41bc(0xc7))/0xb;if(_0x55f737===_0x4a2b7f)break;else _0x47c94e['push'](_0x47c94e['shift']());}catch(_0x41e1b3){_0x47c94e['push'](_0x47c94e['shift']());}}}(a158_0x2ff2,0xecee8));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';function a158_0x1bbd(_0x48af9e,_0x388a86){_0x48af9e=_0x48af9e-0xc6;const _0x2ff2f5=a158_0x2ff2();let _0x1bbd00=_0x2ff2f5[_0x48af9e];return _0x1bbd00;}import{basename,dirname,resolve}from'node:path';import a158_0x53c717 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_0x53c717,RESERVED_PROJECT_SKILL_CODES=new Set([a158_0x596c45(0xe5),a158_0x596c45(0xe8),a158_0x596c45(0xe0)]);export function linkEffectiveRuntimeSkills(_0x4be642,_0x50a72b){const _0x1bb9d1=a158_0x596c45,_0x39dcb9=new Map();for(const _0x205e3b of _0x4be642){const _0x34f907=_0x205e3b[_0x1bb9d1(0xdc)][_0x1bb9d1(0xf6)];if(!_0x34f907)continue;const _0x52e35a=_0x39dcb9['get'](_0x34f907);(!_0x52e35a||_0x205e3b[_0x1bb9d1(0xf7)]===_0x1bb9d1(0xfc))&&_0x39dcb9[_0x1bb9d1(0xd8)](_0x34f907,_0x205e3b);}const _0x419388=[];for(const _0x5deae9 of _0x39dcb9[_0x1bb9d1(0xcd)]()){const _0x3fcebc=requireSkillCode(_0x5deae9[_0x1bb9d1(0xdc)]),_0x18f5eb=readMetadataIfPresent(_0x5deae9[_0x1bb9d1(0xf5)]);if(_0x18f5eb?.[_0x1bb9d1(0xef)]!==_0x50a72b[_0x1bb9d1(0xef)]||_0x18f5eb[_0x1bb9d1(0xf6)]!==_0x3fcebc)throw CliErrors[_0x1bb9d1(0xdf)](_0x1bb9d1(0xde)+_0x50a72b[_0x1bb9d1(0xef)]+':\x20'+_0x5deae9[_0x1bb9d1(0xf5)]);const _0x366499=runtimeSkillLinkName(_0x50a72b,_0x3fcebc);for(const _0xad685d of _0x50a72b[_0x1bb9d1(0xc8)]){_0x419388[_0x1bb9d1(0xcc)](ensureManagedSymlink(resolve(_0xad685d,_0x366499),_0x5deae9[_0x1bb9d1(0xd2)],_0x50a72b,_0x3fcebc));}}return _0x419388;}export function pruneStaleRuntimeSkillLinks(_0x11bcd5,_0x2042e2,_0x3e64d9){const _0x17768f=a158_0x596c45,_0x456079=new Set([..._0x2042e2][_0x17768f(0xff)](_0x36ec83=>_0x36ec83['trim']())[_0x17768f(0xf4)](Boolean)),_0x4d38c1=_0x3e64d9?new Set([..._0x3e64d9][_0x17768f(0xff)](_0x19cfbb=>_0x19cfbb[_0x17768f(0xc9)]())['filter'](Boolean)):undefined,_0x2bc073=[];for(const _0x7d96f of _0x11bcd5[_0x17768f(0xc8)]){for(const _0x5c5f02 of managedTargetSkillLinkPaths(_0x7d96f,_0x11bcd5)){const _0x19d919=runtimeSkillCodeFromLink(_0x11bcd5,_0x5c5f02);if(_0x4d38c1&&!_0x4d38c1[_0x17768f(0xe7)](_0x19d919))continue;if(_0x456079[_0x17768f(0xe7)](_0x19d919))continue;_0x2bc073['push'](removeManagedSkillLink(_0x5c5f02,_0x11bcd5,_0x19d919));}}return _0x2bc073;}export function pruneStaleRuntimeSkillCache(_0x9c49a7,_0x51c791={}){const _0x149c76=a158_0x596c45,_0x5edec5=new Set([..._0x9c49a7['activeSkillCodes']][_0x149c76(0xff)](_0x21520b=>_0x21520b['trim']())[_0x149c76(0xf4)](Boolean)),_0x10e016=_0x9c49a7[_0x149c76(0xcb)]?new Set([..._0x9c49a7['pruneSkillCodes']]['map'](_0x4371dc=>_0x4371dc['trim']())[_0x149c76(0xf4)](Boolean)):undefined,_0x5a8a16=_0x9c49a7[_0x149c76(0xe4)]??[_0x149c76(0xfc),_0x149c76(0xd3)],_0x414f20=resolve(getRuntimeSkillCacheRoot(_0x9c49a7[_0x149c76(0xea)],_0x9c49a7[_0x149c76(0xf9)],_0x51c791),safePathSegment(_0x9c49a7[_0x149c76(0xef)],_0x149c76(0xef))),_0x4a097f=[];for(const _0x5b6932 of _0x5a8a16){const _0x4d1259=resolve(_0x414f20,_0x5b6932);if(!existsSync(_0x4d1259))continue;for(const _0x3a76b2 of readdirSync(_0x4d1259,{'withFileTypes':!![]})){if(!_0x3a76b2[_0x149c76(0xe6)]())continue;const _0x328e55=_0x3a76b2['name'];if(_0x10e016&&!_0x10e016[_0x149c76(0xe7)](_0x328e55))continue;if(_0x5edec5['has'](_0x328e55))continue;const _0x1cf4b6=resolve(_0x4d1259,_0x328e55),_0x5e3ca6=readMetadataIfPresent(resolve(_0x1cf4b6,METADATA_FILE));if(_0x5e3ca6?.[_0x149c76(0xef)]!==_0x9c49a7[_0x149c76(0xef)]||_0x5e3ca6['scope']!==_0x5b6932||_0x5e3ca6[_0x149c76(0xf6)]!==_0x328e55){_0x4a097f['push']({'path':_0x1cf4b6,'action':_0x149c76(0xe3),'reason':'metadata-mismatch'});continue;}if(isLinkedFromAnyRoot(_0x1cf4b6,_0x9c49a7[_0x149c76(0xeb)]??[])){_0x4a097f[_0x149c76(0xcc)]({'path':_0x1cf4b6,'action':_0x149c76(0xe3),'reason':_0x149c76(0xd9)});continue;}removeSync(_0x1cf4b6),_0x4a097f['push']({'path':_0x1cf4b6,'action':'removed'});}}return _0x4a097f;}export function linkGlobalRuntimeSkills(_0x2f0ca8,_0x252755={}){const _0x6fd9b1=a158_0x596c45,_0x3d05f1=resolveSkillSyncPaths(_0x252755),_0x3104d9=[];for(const _0x45a1e0 of _0x2f0ca8){if(_0x45a1e0[_0x6fd9b1(0xf7)]!==_0x6fd9b1(0xe1))throw CliErrors[_0x6fd9b1(0xdf)]('Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20'+_0x45a1e0[_0x6fd9b1(0xf7)]);const _0xd70764=requireSkillCode(_0x45a1e0[_0x6fd9b1(0xdc)]),_0x29aef7=copyManagedSkillDirectory(_0x45a1e0[_0x6fd9b1(0xd2)],resolve(_0x3d05f1['agentsSkillsDir'],_0xd70764));_0x3104d9[_0x6fd9b1(0xcc)]({..._0x29aef7,'contentHash':_0x45a1e0[_0x6fd9b1(0xda)]});}return _0x3104d9;}function ensureManagedSymlink(_0x12eca5,_0x4d2c3b,_0x5633b8,_0x1f025c){const _0x382724=a158_0x596c45;mkdirSync(dirname(_0x12eca5),{'recursive':!![],'mode':0x1c0});if(existsSync(_0x12eca5)||isDanglingSymlink(_0x12eca5)){const _0x2232e3=lstatSync(_0x12eca5);if(!_0x2232e3['isSymbolicLink']())throw CliErrors[_0x382724(0xdf)](_0x382724(0xd4)+_0x12eca5);const _0x4f68fc=resolveSymlinkTarget(_0x12eca5);if(!isPathInside(realOrResolved(_0x4f68fc),realOrResolved(_0x5633b8['managedRoot'])))throw CliErrors[_0x382724(0xdf)](_0x382724(0xd7)+_0x12eca5);if(realOrResolved(_0x4f68fc)===realOrResolved(_0x4d2c3b))return{'path':_0x12eca5,'target':_0x4d2c3b,'action':_0x382724(0xe2)};const _0x221702=readMetadataIfPresent(resolve(_0x4f68fc,METADATA_FILE));if(_0x5633b8['scope']===_0x382724(0xf1)&&(_0x221702?.['appCode']!==_0x5633b8[_0x382724(0xef)]||_0x221702[_0x382724(0xf6)]!==_0x1f025c))throw CliErrors['validation']('Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20'+_0x12eca5);return unlinkSync(_0x12eca5),symlinkSync(_0x4d2c3b,_0x12eca5,_0x382724(0xd2)),{'path':_0x12eca5,'target':_0x4d2c3b,'action':'updated'};}return symlinkSync(_0x4d2c3b,_0x12eca5,_0x382724(0xd2)),{'path':_0x12eca5,'target':_0x4d2c3b,'action':'created'};}function managedTargetSkillLinkPaths(_0x29fe53,_0x1e2c18){const _0x4e7853=a158_0x596c45;if(!existsSync(_0x29fe53))return[];const _0x58f868=_0x1e2c18[_0x4e7853(0xef)]+'--';return readdirSync(_0x29fe53,{'withFileTypes':!![]})[_0x4e7853(0xf4)](_0x5bc851=>_0x1e2c18[_0x4e7853(0xf7)]==='project'||_0x5bc851[_0x4e7853(0xe9)][_0x4e7853(0xca)](_0x58f868))[_0x4e7853(0xff)](_0x478080=>resolve(_0x29fe53,_0x478080[_0x4e7853(0xe9)]));}function removeManagedSkillLink(_0x54e387,_0x37e75e,_0x4e302a){const _0x19da8a=a158_0x596c45,_0x422094=lstatIfPresent(_0x54e387);if(!_0x422094?.['isSymbolicLink']())return{'path':_0x54e387,'action':_0x19da8a(0xe3),'reason':_0x19da8a(0xec)};const _0x3813cc=resolveSymlinkTarget(_0x54e387);if(!isPathInside(realOrResolved(_0x3813cc),realOrResolved(_0x37e75e[_0x19da8a(0xed)])))return{'path':_0x54e387,'action':'skipped','reason':'external-symlink'};const _0x30c0cf=readMetadataIfPresent(resolve(_0x3813cc,METADATA_FILE));if(_0x37e75e['scope']==='project'&&(_0x30c0cf?.[_0x19da8a(0xef)]!==_0x37e75e[_0x19da8a(0xef)]||_0x30c0cf[_0x19da8a(0xf6)]!==_0x4e302a))return{'path':_0x54e387,'action':'skipped','reason':_0x19da8a(0xf3)};return unlinkSync(_0x54e387),{'path':_0x54e387,'action':_0x19da8a(0xee)};}function isLinkedFromAnyRoot(_0x2eaea4,_0x4fb41b){const _0x1587c3=a158_0x596c45,_0x5555df=realOrResolved(_0x2eaea4);for(const _0x58f59b of _0x4fb41b){if(!existsSync(_0x58f59b))continue;for(const _0x4c8fe4 of readdirSync(_0x58f59b,{'withFileTypes':!![]})){if(!_0x4c8fe4[_0x1587c3(0xd5)]())continue;const _0x17ed90=resolve(_0x58f59b,_0x4c8fe4[_0x1587c3(0xe9)]);if(realOrResolved(resolveSymlinkTarget(_0x17ed90))===_0x5555df)return!![];}}return![];}function runtimeSkillLinkName(_0x537e99,_0xad1589){const _0x42d8b3=a158_0x596c45,_0x3a81db=safePathSegment(_0xad1589,_0x42d8b3(0xf6));if(_0x537e99[_0x42d8b3(0xf7)]===_0x42d8b3(0xf1)&&RESERVED_PROJECT_SKILL_CODES['has'](_0x3a81db))throw CliErrors[_0x42d8b3(0xdf)]('Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20'+_0x3a81db);return _0x537e99[_0x42d8b3(0xf7)]==='project'?_0x3a81db:_0x537e99[_0x42d8b3(0xef)]+'--'+_0x3a81db;}function runtimeSkillCodeFromLink(_0x4554cd,_0x3ca9b0){const _0xc11e63=a158_0x596c45,_0x4d55ae=basename(_0x3ca9b0);return _0x4554cd[_0xc11e63(0xf7)]===_0xc11e63(0xf1)?_0x4d55ae:_0x4d55ae[_0xc11e63(0xfd)]((_0x4554cd[_0xc11e63(0xef)]+'--')[_0xc11e63(0xdd)]);}export function copyManagedSkillDirectory(_0x562447,_0x2b660e){const _0x1f8346=a158_0x596c45,_0x7d2e5e=resolve(_0x2b660e,METADATA_FILE),_0x5dcdef=existsSync(_0x2b660e);if(_0x5dcdef){const _0x5a5c00=lstatSync(_0x2b660e);if(_0x5a5c00[_0x1f8346(0xd5)]())throw CliErrors[_0x1f8346(0xdf)](_0x1f8346(0xf2)+_0x2b660e);if(!_0x5a5c00[_0x1f8346(0xe6)]())throw CliErrors['validation']('Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20'+_0x2b660e);const _0x3d76c1=readMetadataIfPresent(_0x7d2e5e);if(_0x3d76c1?.[_0x1f8346(0xf7)]!==_0x1f8346(0xe1))throw CliErrors[_0x1f8346(0xdf)]('Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20'+_0x2b660e);}ensureDirSync(dirname(_0x2b660e));const _0x58c83a=_0x5dcdef?readMetadataIfPresent(_0x7d2e5e)?.['contentHash']:undefined,_0x528b54=readMetadataIfPresent(resolve(_0x562447,METADATA_FILE))?.[_0x1f8346(0xda)];return _0x5dcdef&&removeSync(_0x2b660e),copySkillDirectory(_0x562447,_0x2b660e),{'path':_0x2b660e,'target':_0x562447,'action':!_0x5dcdef?'created':_0x58c83a===_0x528b54?_0x1f8346(0xe2):_0x1f8346(0xc6)};}function a158_0x2ff2(){const _0x30b905=['validation','secret-retriever','builtin','unchanged','skipped','scopes','lovrabet','isDirectory','has','runtime-observe','name','env','protectedLinkRoots','not-managed-symlink','managedRoot','removed','appCode','8854930ctishe','project','Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20','metadata-mismatch','filter','metadataPath','skillCode','scope','507664fraxUt','accessKey','36BFAnRB','1563794kpMGBd','personal','slice','2605tWWNIp','map','updated','29606940ciBFZo','skillRoots','trim','startsWith','pruneSkillCodes','push','values','3UStlOi','9968ToCZjE','6CMvfNU','854194eNRuEJ','dir','company','Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20','isSymbolicLink','Refusing\x20to\x20copy\x20Skill\x20symlink:\x20','Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20','set','linked-from-protected-root','contentHash','11440506TFaqBI','skill','length','Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20'];a158_0x2ff2=function(){return _0x30b905;};return a158_0x2ff2();}function copySkillDirectory(_0x3635cc,_0x22c0be){copySync(_0x3635cc,_0x22c0be,{'dereference':![],'overwrite':!![],'filter'(_0x4f4771){const _0x1d107d=a158_0x1bbd;if(lstatSync(_0x4f4771)[_0x1d107d(0xd5)]())throw CliErrors[_0x1d107d(0xdf)](_0x1d107d(0xd6)+_0x4f4771);return!![];}});}
1
+ (function(_0x453a1c,_0x2ffe32){const _0x1faf51=a158_0x4124,_0x53eb45=_0x453a1c();while(!![]){try{const _0x1898c3=parseInt(_0x1faf51(0xea))/0x1*(parseInt(_0x1faf51(0xf3))/0x2)+-parseInt(_0x1faf51(0x11e))/0x3*(parseInt(_0x1faf51(0xf6))/0x4)+-parseInt(_0x1faf51(0x119))/0x5*(-parseInt(_0x1faf51(0x105))/0x6)+-parseInt(_0x1faf51(0x101))/0x7+-parseInt(_0x1faf51(0x11b))/0x8*(parseInt(_0x1faf51(0xec))/0x9)+-parseInt(_0x1faf51(0xee))/0xa+parseInt(_0x1faf51(0xfe))/0xb;if(_0x1898c3===_0x2ffe32)break;else _0x53eb45['push'](_0x53eb45['shift']());}catch(_0x976ef4){_0x53eb45['push'](_0x53eb45['shift']());}}}(a158_0x57a5,0x9ae6e));import{existsSync,lstatSync,mkdirSync,readdirSync,symlinkSync,unlinkSync}from'node:fs';import{basename,dirname,resolve}from'node:path';import a158_0x4dad68 from'fs-extra';import{CliErrors}from'../../errors.js';import{METADATA_FILE}from'./constants.js';function a158_0x57a5(){const _0x3e8540=['env','Refusing\x20to\x20overwrite\x20global\x20Skill\x20symlink:\x20','197686kbACwY','Refusing\x20to\x20overwrite\x20unmanaged\x20path:\x20','trim','2452UopBzw','validation','Refusing\x20to\x20overwrite\x20unmanaged\x20symlink:\x20','values','removed','appCode','not-managed-symlink','Refusing\x20to\x20shadow\x20reserved\x20Agent\x20Skill\x20in\x20project\x20scope:\x20','23716066SgRWUu','project','skipped','8489453QxwLgj','dir','skillCode','get','54YrRWFU','Refusing\x20to\x20overwrite\x20managed\x20Skill\x20link\x20owned\x20by\x20another\x20app\x20or\x20code:\x20','unchanged','has','map','metadata-mismatch','pruneSkillCodes','name','isDirectory','isSymbolicLink','startsWith','managedRoot','company','Refusing\x20to\x20copy\x20Skill\x20symlink:\x20','scope','linked-from-protected-root','Only\x20builtin\x20Skills\x20can\x20be\x20linked\x20into\x20the\x20global\x20Skill\x20root:\x20','Refusing\x20to\x20overwrite\x20global\x20Skill\x20path:\x20','skill','external-symlink','487070qPsmHR','metadataPath','304bIdQWw','contentHash','builtin','366qTisch','created','Refusing\x20to\x20link\x20Skill\x20metadata\x20outside\x20target\x20','activeSkillCodes','Refusing\x20to\x20overwrite\x20unmanaged\x20global\x20Skill\x20directory:\x20','scopes','personal','updated','slice','7qfIjjO','push','191817lykueK','accessKey','9926960ZDSWyF','length','filter'];a158_0x57a5=function(){return _0x3e8540;};return a158_0x57a5();}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_0x4dad68,RESERVED_PROJECT_SKILL_CODES=new Set(['lovrabet','runtime-observe','secret-retriever']);export function linkEffectiveRuntimeSkills(_0x315612,_0x3715d6){const _0x216609=a158_0x4124,_0x45dab4=new Map();for(const _0x7a9930 of _0x315612){const _0x3d85ae=_0x7a9930[_0x216609(0x117)]['skillCode'];if(!_0x3d85ae)continue;const _0x1db78f=_0x45dab4[_0x216609(0x104)](_0x3d85ae);(!_0x1db78f||_0x7a9930[_0x216609(0x113)]===_0x216609(0xe7))&&_0x45dab4['set'](_0x3d85ae,_0x7a9930);}const _0x1922bb=[];for(const _0x364b83 of _0x45dab4[_0x216609(0xf9)]()){const _0x4fe9b2=requireSkillCode(_0x364b83[_0x216609(0x117)]),_0x462ad7=readMetadataIfPresent(_0x364b83[_0x216609(0x11a)]);if(_0x462ad7?.[_0x216609(0xfb)]!==_0x3715d6['appCode']||_0x462ad7[_0x216609(0x103)]!==_0x4fe9b2)throw CliErrors[_0x216609(0xf7)](_0x216609(0x120)+_0x3715d6['appCode']+':\x20'+_0x364b83[_0x216609(0x11a)]);const _0x1b95be=runtimeSkillLinkName(_0x3715d6,_0x4fe9b2);for(const _0x24b96e of _0x3715d6['skillRoots']){_0x1922bb[_0x216609(0xeb)](ensureManagedSymlink(resolve(_0x24b96e,_0x1b95be),_0x364b83['dir'],_0x3715d6,_0x4fe9b2));}}return _0x1922bb;}export function pruneStaleRuntimeSkillLinks(_0x265109,_0x48b22f,_0x4178b7){const _0x14b781=a158_0x4124,_0xda7694=new Set([..._0x48b22f][_0x14b781(0x109)](_0x579f58=>_0x579f58[_0x14b781(0xf5)]())[_0x14b781(0xf0)](Boolean)),_0x3400e1=_0x4178b7?new Set([..._0x4178b7]['map'](_0xa5e2c8=>_0xa5e2c8['trim']())[_0x14b781(0xf0)](Boolean)):undefined,_0x1eb8cd=[];for(const _0x1b47cf of _0x265109['skillRoots']){for(const _0x15906b of managedTargetSkillLinkPaths(_0x1b47cf,_0x265109)){const _0x3d0db2=runtimeSkillCodeFromLink(_0x265109,_0x15906b);if(_0x3400e1&&!_0x3400e1[_0x14b781(0x108)](_0x3d0db2))continue;if(_0xda7694[_0x14b781(0x108)](_0x3d0db2))continue;_0x1eb8cd[_0x14b781(0xeb)](removeManagedSkillLink(_0x15906b,_0x265109,_0x3d0db2));}}return _0x1eb8cd;}export function pruneStaleRuntimeSkillCache(_0x56430e,_0x28f16b={}){const _0x2e1efc=a158_0x4124,_0x5d603b=new Set([..._0x56430e[_0x2e1efc(0x121)]][_0x2e1efc(0x109)](_0x10affe=>_0x10affe[_0x2e1efc(0xf5)]())[_0x2e1efc(0xf0)](Boolean)),_0x48e556=_0x56430e[_0x2e1efc(0x10b)]?new Set([..._0x56430e[_0x2e1efc(0x10b)]][_0x2e1efc(0x109)](_0x812620=>_0x812620[_0x2e1efc(0xf5)]())['filter'](Boolean)):undefined,_0x7d24=_0x56430e[_0x2e1efc(0xe6)]??[_0x2e1efc(0xe7),_0x2e1efc(0x111)],_0x1c4770=resolve(getRuntimeSkillCacheRoot(_0x56430e[_0x2e1efc(0xf1)],_0x56430e[_0x2e1efc(0xed)],_0x28f16b),safePathSegment(_0x56430e[_0x2e1efc(0xfb)],_0x2e1efc(0xfb))),_0x4442d6=[];for(const _0x139175 of _0x7d24){const _0x35ed82=resolve(_0x1c4770,_0x139175);if(!existsSync(_0x35ed82))continue;for(const _0x37ae65 of readdirSync(_0x35ed82,{'withFileTypes':!![]})){if(!_0x37ae65[_0x2e1efc(0x10d)]())continue;const _0x12b42a=_0x37ae65[_0x2e1efc(0x10c)];if(_0x48e556&&!_0x48e556[_0x2e1efc(0x108)](_0x12b42a))continue;if(_0x5d603b[_0x2e1efc(0x108)](_0x12b42a))continue;const _0x5d306f=resolve(_0x35ed82,_0x12b42a),_0xf0c815=readMetadataIfPresent(resolve(_0x5d306f,METADATA_FILE));if(_0xf0c815?.[_0x2e1efc(0xfb)]!==_0x56430e[_0x2e1efc(0xfb)]||_0xf0c815[_0x2e1efc(0x113)]!==_0x139175||_0xf0c815['skillCode']!==_0x12b42a){_0x4442d6[_0x2e1efc(0xeb)]({'path':_0x5d306f,'action':'skipped','reason':_0x2e1efc(0x10a)});continue;}if(isLinkedFromAnyRoot(_0x5d306f,_0x56430e['protectedLinkRoots']??[])){_0x4442d6[_0x2e1efc(0xeb)]({'path':_0x5d306f,'action':'skipped','reason':_0x2e1efc(0x114)});continue;}removeSync(_0x5d306f),_0x4442d6[_0x2e1efc(0xeb)]({'path':_0x5d306f,'action':_0x2e1efc(0xfa)});}}return _0x4442d6;}function a158_0x4124(_0x5a3f26,_0x4cb1e1){_0x5a3f26=_0x5a3f26-0xe5;const _0x57a517=a158_0x57a5();let _0x412422=_0x57a517[_0x5a3f26];return _0x412422;}export function linkGlobalRuntimeSkills(_0x14bd93,_0x104c02={}){const _0xbdf4b5=a158_0x4124,_0x1f33db=resolveSkillSyncPaths(_0x104c02),_0x54e353=[];for(const _0x2c917b of _0x14bd93){if(_0x2c917b['scope']!==_0xbdf4b5(0x11d))throw CliErrors[_0xbdf4b5(0xf7)](_0xbdf4b5(0x115)+_0x2c917b[_0xbdf4b5(0x113)]);const _0x4acc40=requireSkillCode(_0x2c917b[_0xbdf4b5(0x117)]),_0x617477=copyManagedSkillDirectory(_0x2c917b[_0xbdf4b5(0x102)],resolve(_0x1f33db['agentsSkillsDir'],_0x4acc40));_0x54e353[_0xbdf4b5(0xeb)]({..._0x617477,'contentHash':_0x2c917b[_0xbdf4b5(0x11c)]});}return _0x54e353;}function ensureManagedSymlink(_0xb12867,_0x9e2d29,_0x5eb8b4,_0x4748b8){const _0x2e319f=a158_0x4124;mkdirSync(dirname(_0xb12867),{'recursive':!![],'mode':0x1c0});if(existsSync(_0xb12867)||isDanglingSymlink(_0xb12867)){const _0xfaaf49=lstatSync(_0xb12867);if(!_0xfaaf49[_0x2e319f(0x10e)]())throw CliErrors[_0x2e319f(0xf7)](_0x2e319f(0xf4)+_0xb12867);const _0x165bf0=resolveSymlinkTarget(_0xb12867);if(!isPathInside(realOrResolved(_0x165bf0),realOrResolved(_0x5eb8b4[_0x2e319f(0x110)])))throw CliErrors['validation'](_0x2e319f(0xf8)+_0xb12867);if(realOrResolved(_0x165bf0)===realOrResolved(_0x9e2d29))return{'path':_0xb12867,'target':_0x9e2d29,'action':'unchanged'};const _0x3f0d64=readMetadataIfPresent(resolve(_0x165bf0,METADATA_FILE));if(_0x5eb8b4[_0x2e319f(0x113)]==='project'&&(_0x3f0d64?.[_0x2e319f(0xfb)]!==_0x5eb8b4['appCode']||_0x3f0d64[_0x2e319f(0x103)]!==_0x4748b8))throw CliErrors['validation'](_0x2e319f(0x106)+_0xb12867);return unlinkSync(_0xb12867),symlinkSync(_0x9e2d29,_0xb12867,_0x2e319f(0x102)),{'path':_0xb12867,'target':_0x9e2d29,'action':_0x2e319f(0xe8)};}return symlinkSync(_0x9e2d29,_0xb12867,_0x2e319f(0x102)),{'path':_0xb12867,'target':_0x9e2d29,'action':_0x2e319f(0x11f)};}function managedTargetSkillLinkPaths(_0x2eed09,_0x32b6e3){const _0x13117d=a158_0x4124;if(!existsSync(_0x2eed09))return[];const _0x317a0f=_0x32b6e3[_0x13117d(0xfb)]+'--';return readdirSync(_0x2eed09,{'withFileTypes':!![]})[_0x13117d(0xf0)](_0x37e98b=>_0x32b6e3['scope']===_0x13117d(0xff)||_0x37e98b[_0x13117d(0x10c)][_0x13117d(0x10f)](_0x317a0f))[_0x13117d(0x109)](_0x341d75=>resolve(_0x2eed09,_0x341d75['name']));}function removeManagedSkillLink(_0x5cc2ca,_0x4b587a,_0x4deae5){const _0xa6072a=a158_0x4124,_0x484763=lstatIfPresent(_0x5cc2ca);if(!_0x484763?.[_0xa6072a(0x10e)]())return{'path':_0x5cc2ca,'action':_0xa6072a(0x100),'reason':_0xa6072a(0xfc)};const _0x5cab0e=resolveSymlinkTarget(_0x5cc2ca);if(!isPathInside(realOrResolved(_0x5cab0e),realOrResolved(_0x4b587a['managedRoot'])))return{'path':_0x5cc2ca,'action':'skipped','reason':_0xa6072a(0x118)};const _0x65963a=readMetadataIfPresent(resolve(_0x5cab0e,METADATA_FILE));if(_0x4b587a['scope']===_0xa6072a(0xff)&&(_0x65963a?.[_0xa6072a(0xfb)]!==_0x4b587a['appCode']||_0x65963a[_0xa6072a(0x103)]!==_0x4deae5))return{'path':_0x5cc2ca,'action':_0xa6072a(0x100),'reason':_0xa6072a(0x10a)};return unlinkSync(_0x5cc2ca),{'path':_0x5cc2ca,'action':_0xa6072a(0xfa)};}function isLinkedFromAnyRoot(_0x3c6d83,_0x408446){const _0x2fadc9=a158_0x4124,_0x32518d=realOrResolved(_0x3c6d83);for(const _0x145401 of _0x408446){if(!existsSync(_0x145401))continue;for(const _0x53c50e of readdirSync(_0x145401,{'withFileTypes':!![]})){if(!_0x53c50e[_0x2fadc9(0x10e)]())continue;const _0x240a74=resolve(_0x145401,_0x53c50e[_0x2fadc9(0x10c)]);if(realOrResolved(resolveSymlinkTarget(_0x240a74))===_0x32518d)return!![];}}return![];}function runtimeSkillLinkName(_0x51f74f,_0x220017){const _0x2ccca6=a158_0x4124,_0x23bf25=safePathSegment(_0x220017,_0x2ccca6(0x103));if(_0x51f74f[_0x2ccca6(0x113)]===_0x2ccca6(0xff)&&RESERVED_PROJECT_SKILL_CODES[_0x2ccca6(0x108)](_0x23bf25))throw CliErrors[_0x2ccca6(0xf7)](_0x2ccca6(0xfd)+_0x23bf25);return _0x51f74f['scope']===_0x2ccca6(0xff)?_0x23bf25:_0x51f74f['appCode']+'--'+_0x23bf25;}function runtimeSkillCodeFromLink(_0x18e659,_0x3e3324){const _0x1555c=a158_0x4124,_0x456589=basename(_0x3e3324);return _0x18e659[_0x1555c(0x113)]==='project'?_0x456589:_0x456589[_0x1555c(0xe9)]((_0x18e659['appCode']+'--')[_0x1555c(0xef)]);}export function copyManagedSkillDirectory(_0x4f38dd,_0x49b105){const _0x2d928c=a158_0x4124,_0x4074a8=resolve(_0x49b105,METADATA_FILE),_0x4dc84a=existsSync(_0x49b105);if(_0x4dc84a){const _0x22c0ef=lstatSync(_0x49b105);if(_0x22c0ef[_0x2d928c(0x10e)]())throw CliErrors['validation'](_0x2d928c(0xf2)+_0x49b105);if(!_0x22c0ef[_0x2d928c(0x10d)]())throw CliErrors[_0x2d928c(0xf7)](_0x2d928c(0x116)+_0x49b105);const _0x1c6b2a=readMetadataIfPresent(_0x4074a8);if(_0x1c6b2a?.[_0x2d928c(0x113)]!==_0x2d928c(0x11d))throw CliErrors[_0x2d928c(0xf7)](_0x2d928c(0xe5)+_0x49b105);}ensureDirSync(dirname(_0x49b105));const _0x56487e=_0x4dc84a?readMetadataIfPresent(_0x4074a8)?.[_0x2d928c(0x11c)]:undefined,_0x2720fb=readMetadataIfPresent(resolve(_0x4f38dd,METADATA_FILE))?.['contentHash'];return _0x4dc84a&&removeSync(_0x49b105),copySkillDirectory(_0x4f38dd,_0x49b105),{'path':_0x49b105,'target':_0x4f38dd,'action':!_0x4dc84a?'created':_0x56487e===_0x2720fb?_0x2d928c(0x107):_0x2d928c(0xe8)};}function copySkillDirectory(_0x316b60,_0x35c64f){copySync(_0x316b60,_0x35c64f,{'dereference':![],'overwrite':!![],'filter'(_0x134407){const _0x53c005=a158_0x4124;if(lstatSync(_0x134407)[_0x53c005(0x10e)]())throw CliErrors[_0x53c005(0xf7)](_0x53c005(0x112)+_0x134407);return!![];}});}
@@ -1 +1 @@
1
- (function(_0x3e08f9,_0x284717){const _0x5d6a9e=a159_0x2b58,_0x7ab5b1=_0x3e08f9();while(!![]){try{const _0xed3a59=-parseInt(_0x5d6a9e(0x110))/0x1+parseInt(_0x5d6a9e(0xfe))/0x2+parseInt(_0x5d6a9e(0xfa))/0x3*(parseInt(_0x5d6a9e(0x113))/0x4)+parseInt(_0x5d6a9e(0x114))/0x5*(parseInt(_0x5d6a9e(0x100))/0x6)+-parseInt(_0x5d6a9e(0xff))/0x7+-parseInt(_0x5d6a9e(0x109))/0x8*(parseInt(_0x5d6a9e(0x117))/0x9)+parseInt(_0x5d6a9e(0x10c))/0xa*(parseInt(_0x5d6a9e(0x103))/0xb);if(_0xed3a59===_0x284717)break;else _0x7ab5b1['push'](_0x7ab5b1['shift']());}catch(_0x462a64){_0x7ab5b1['push'](_0x7ab5b1['shift']());}}}(a159_0x76e5,0x54ebb));import{existsSync,readdirSync}from'node:fs';import{resolve}from'node:path';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{readMetadataIfPresent}from'./metadata.js';function a159_0x76e5(){const _0x8a234d=['source','sort','cacheDir','has','builtin','map','dir','trim','4416kFnNyo','localeCompare','linkedPath','scopes','356430pxRBTK','4192580cfMWKy','2842764fSwnCZ','project','skillRoots','176xeGtvK','appCode','filter','skillCode','from','values','8uaRfUb','includes','validation','107530wzbHPO','isSymbolicLink','link','scope','231807vixekn','linkedPaths','isArray','1652RMsjYB','5NtXCfX','name','isDirectory','2280699vAuEzv','env','metadataPath','cache','set','code','Runtime\x20Skill\x20install\x20target\x20app\x20mismatch:\x20'];a159_0x76e5=function(){return _0x8a234d;};return a159_0x76e5();}import{getRuntimeSkillCacheRoot,safePathSegment}from'./paths.js';import{isRuntimeSkillScope,normalizeRuntimeSkillScopes}from'./scopes.js';function a159_0x2b58(_0x46a548,_0x51ba30){_0x46a548=_0x46a548-0xef;const _0x76e527=a159_0x76e5();let _0x2b5855=_0x76e527[_0x46a548];return _0x2b5855;}export function listLocalRuntimeSkills(_0x264ea5,_0x32df5b,_0x3290c3={}){const _0x3728ba=a159_0x2b58,_0x5c5289=safePathSegment(_0x264ea5['appCode'],_0x3728ba(0x104));if(_0x32df5b['appCode']!==_0x5c5289)throw CliErrors[_0x3728ba(0x10b)](_0x3728ba(0xf1)+_0x32df5b[_0x3728ba(0x104)]+'\x20!=\x20'+_0x5c5289);const _0x367b54=normalizeRuntimeSkillScopes(_0x264ea5[_0x3728ba(0xfd)]),_0x1019ed=new Set(_0x367b54),_0x536393=_0x264ea5[_0x3728ba(0xf0)]?.[_0x3728ba(0xf9)](),_0x433e3c=new Map(),_0x4a6e16=resolve(getRuntimeSkillCacheRoot(_0x264ea5[_0x3728ba(0x118)],_0x264ea5['accessKey'],_0x3290c3),_0x5c5289);for(const _0x2d472d of _0x367b54){for(const _0x603348 of localSkillEntryDirs(resolve(_0x4a6e16,_0x2d472d))){collectLocalRuntimeSkill(_0x433e3c,_0x603348,{'appCode':_0x5c5289,'scopes':_0x1019ed,'code':_0x536393,'source':'cache'});}}for(const _0x663241 of _0x32df5b[_0x3728ba(0x102)]){for(const _0x24bc3b of localSkillLinkCandidates(_0x663241,_0x32df5b,_0x1019ed)){collectLocalRuntimeSkill(_0x433e3c,_0x24bc3b,{'appCode':_0x5c5289,'scopes':_0x1019ed,'code':_0x536393,'source':_0x3728ba(0x10e),'linkedPath':_0x24bc3b});}}return Array[_0x3728ba(0x107)](_0x433e3c[_0x3728ba(0x108)]())[_0x3728ba(0xf3)](compareLocalRuntimeSkills);}function localSkillEntryDirs(_0x2b85ec){const _0x14569c=a159_0x2b58;if(!existsSync(_0x2b85ec))return[];return readdirSync(_0x2b85ec,{'withFileTypes':!![]})[_0x14569c(0x105)](_0x4a4153=>_0x4a4153[_0x14569c(0x116)]()||_0x4a4153['isSymbolicLink']())[_0x14569c(0xf7)](_0x20f6ab=>resolve(_0x2b85ec,_0x20f6ab[_0x14569c(0x115)]));}function localSkillLinkCandidates(_0x12f07f,_0x4a8c91,_0x340bb7){const _0x2a7c31=a159_0x2b58;if(!existsSync(_0x12f07f))return[];const _0x2aba63=_0x4a8c91[_0x2a7c31(0x104)]+'--';return readdirSync(_0x12f07f,{'withFileTypes':!![]})[_0x2a7c31(0x105)](_0x1f1a2b=>_0x1f1a2b[_0x2a7c31(0x116)]()||_0x1f1a2b[_0x2a7c31(0x10d)]())[_0x2a7c31(0x105)](_0x2bfbe4=>_0x4a8c91[_0x2a7c31(0x10f)]===_0x2a7c31(0x101)||_0x2bfbe4[_0x2a7c31(0x115)]['startsWith'](_0x2aba63)||_0x340bb7[_0x2a7c31(0xf5)](_0x2a7c31(0xf6)))[_0x2a7c31(0xf7)](_0x2f8fd9=>resolve(_0x12f07f,_0x2f8fd9['name']));}function collectLocalRuntimeSkill(_0x3560fe,_0x335fbc,_0x2a3504){const _0x4d0dae=a159_0x2b58,_0x55ada7=resolve(_0x335fbc,METADATA_FILE),_0x3a1e9e=readMetadataIfPresent(_0x55ada7);if(!_0x3a1e9e)return;if(_0x3a1e9e[_0x4d0dae(0x104)]!==_0x2a3504['appCode'])return;if(!isRuntimeSkillScope(_0x3a1e9e[_0x4d0dae(0x10f)])||!_0x2a3504[_0x4d0dae(0xfd)][_0x4d0dae(0xf5)](_0x3a1e9e[_0x4d0dae(0x10f)]))return;const _0x966cdd=_0x3a1e9e[_0x4d0dae(0x106)]?.[_0x4d0dae(0xf9)]();if(!_0x966cdd)return;if(_0x2a3504[_0x4d0dae(0xf0)]&&_0x966cdd!==_0x2a3504['code'])return;const _0x5201cc=_0x3a1e9e[_0x4d0dae(0x10f)]+':'+_0x966cdd,_0x4369d8=_0x2a3504[_0x4d0dae(0xfc)]?[_0x2a3504[_0x4d0dae(0xfc)]]:[],_0x55c424=_0x3560fe['get'](_0x5201cc);if(_0x55c424){_0x2a3504['source']===_0x4d0dae(0x11a)&&(_0x55c424[_0x4d0dae(0xf8)]=_0x335fbc,_0x55c424[_0x4d0dae(0xf4)]=_0x335fbc,_0x55c424['skillMdPath']=resolve(_0x335fbc,SKILL_FILE),_0x55c424[_0x4d0dae(0x119)]=_0x55ada7);for(const _0x2b4966 of _0x4369d8){!_0x55c424[_0x4d0dae(0x111)][_0x4d0dae(0x10a)](_0x2b4966)&&_0x55c424[_0x4d0dae(0x111)]['push'](_0x2b4966);}_0x55c424[_0x4d0dae(0x111)]['sort']();return;}_0x3560fe[_0x4d0dae(0xef)](_0x5201cc,{..._0x3a1e9e,'tags':Array[_0x4d0dae(0x112)](_0x3a1e9e['tags'])?_0x3a1e9e['tags']:[],'scope':_0x3a1e9e[_0x4d0dae(0x10f)],'source':'local','dir':_0x335fbc,'cacheDir':_0x2a3504[_0x4d0dae(0xf2)]===_0x4d0dae(0x11a)?_0x335fbc:undefined,'skillMdPath':resolve(_0x335fbc,SKILL_FILE),'metadataPath':_0x55ada7,'linkedPaths':_0x4369d8});}function compareLocalRuntimeSkills(_0x1af958,_0x56128c){const _0x14b967=a159_0x2b58,_0x32429a={'personal':0x0,'company':0x1,'builtin':0x2};return _0x32429a[_0x1af958[_0x14b967(0x10f)]]-_0x32429a[_0x56128c[_0x14b967(0x10f)]]||_0x1af958[_0x14b967(0x106)][_0x14b967(0xfb)](_0x56128c['skillCode'])||_0x1af958[_0x14b967(0xf8)][_0x14b967(0xfb)](_0x56128c['dir']);}
1
+ (function(_0x13ba1f,_0x23980f){const _0x7eade2=a159_0x55e5,_0x55df56=_0x13ba1f();while(!![]){try{const _0x5e5fb5=-parseInt(_0x7eade2(0x144))/0x1+-parseInt(_0x7eade2(0x142))/0x2+-parseInt(_0x7eade2(0x13f))/0x3*(-parseInt(_0x7eade2(0x13e))/0x4)+parseInt(_0x7eade2(0x128))/0x5+-parseInt(_0x7eade2(0x143))/0x6*(parseInt(_0x7eade2(0x14e))/0x7)+-parseInt(_0x7eade2(0x148))/0x8*(parseInt(_0x7eade2(0x124))/0x9)+parseInt(_0x7eade2(0x145))/0xa;if(_0x5e5fb5===_0x23980f)break;else _0x55df56['push'](_0x55df56['shift']());}catch(_0x5a9ec9){_0x55df56['push'](_0x55df56['shift']());}}}(a159_0x3ad5,0x4d323));import{existsSync,readdirSync}from'node:fs';import{resolve}from'node:path';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{readMetadataIfPresent}from'./metadata.js';import{getRuntimeSkillCacheRoot,safePathSegment}from'./paths.js';function a159_0x3ad5(){const _0x428945=['cache','push','builtin','link','values','skillRoots','dir','scope','Runtime\x20Skill\x20install\x20target\x20app\x20mismatch:\x20','appCode','localeCompare','validation','map','sort','isSymbolicLink','isDirectory','has','name','filter','isArray','215672BcuAaS','30PjtzNv','get','project','377938wPVzgt','56460bIDDMg','345621FsmSzk','7875490ouVAkM','startsWith','source','602440VuLtBr','includes','scopes','metadataPath','trim','env','105tiEDuH','skillCode','code','63mJClxB','tags','set','local','961705IEhdis','linkedPaths'];a159_0x3ad5=function(){return _0x428945;};return a159_0x3ad5();}import{isRuntimeSkillScope,normalizeRuntimeSkillScopes}from'./scopes.js';export function listLocalRuntimeSkills(_0xb152c9,_0x3d1abd,_0xcad692={}){const _0x2139ad=a159_0x55e5,_0x876540=safePathSegment(_0xb152c9[_0x2139ad(0x133)],_0x2139ad(0x133));if(_0x3d1abd[_0x2139ad(0x133)]!==_0x876540)throw CliErrors[_0x2139ad(0x135)](_0x2139ad(0x132)+_0x3d1abd['appCode']+'\x20!=\x20'+_0x876540);const _0x459707=normalizeRuntimeSkillScopes(_0xb152c9[_0x2139ad(0x14a)]),_0x2d4010=new Set(_0x459707),_0x531962=_0xb152c9[_0x2139ad(0x123)]?.[_0x2139ad(0x14c)](),_0x221bd3=new Map(),_0x20eb06=resolve(getRuntimeSkillCacheRoot(_0xb152c9[_0x2139ad(0x14d)],_0xb152c9['accessKey'],_0xcad692),_0x876540);for(const _0x4a9f48 of _0x459707){for(const _0x14eff0 of localSkillEntryDirs(resolve(_0x20eb06,_0x4a9f48))){collectLocalRuntimeSkill(_0x221bd3,_0x14eff0,{'appCode':_0x876540,'scopes':_0x2d4010,'code':_0x531962,'source':_0x2139ad(0x12a)});}}for(const _0x427971 of _0x3d1abd[_0x2139ad(0x12f)]){for(const _0x37d3ec of localSkillLinkCandidates(_0x427971,_0x3d1abd,_0x2d4010)){collectLocalRuntimeSkill(_0x221bd3,_0x37d3ec,{'appCode':_0x876540,'scopes':_0x2d4010,'code':_0x531962,'source':_0x2139ad(0x12d),'linkedPath':_0x37d3ec});}}return Array['from'](_0x221bd3[_0x2139ad(0x12e)]())['sort'](compareLocalRuntimeSkills);}function localSkillEntryDirs(_0x505b3c){const _0x44e930=a159_0x55e5;if(!existsSync(_0x505b3c))return[];return readdirSync(_0x505b3c,{'withFileTypes':!![]})[_0x44e930(0x13c)](_0x452e30=>_0x452e30['isDirectory']()||_0x452e30[_0x44e930(0x138)]())[_0x44e930(0x136)](_0x6137a4=>resolve(_0x505b3c,_0x6137a4[_0x44e930(0x13b)]));}function localSkillLinkCandidates(_0x1ac054,_0x105717,_0x2ddf9b){const _0x2bdadb=a159_0x55e5;if(!existsSync(_0x1ac054))return[];const _0x2ad47e=_0x105717[_0x2bdadb(0x133)]+'--';return readdirSync(_0x1ac054,{'withFileTypes':!![]})['filter'](_0x12834c=>_0x12834c[_0x2bdadb(0x139)]()||_0x12834c[_0x2bdadb(0x138)]())[_0x2bdadb(0x13c)](_0x2d2a65=>_0x105717['scope']===_0x2bdadb(0x141)||_0x2d2a65['name'][_0x2bdadb(0x146)](_0x2ad47e)||_0x2ddf9b[_0x2bdadb(0x13a)](_0x2bdadb(0x12c)))[_0x2bdadb(0x136)](_0x504829=>resolve(_0x1ac054,_0x504829[_0x2bdadb(0x13b)]));}function collectLocalRuntimeSkill(_0x1769b8,_0x2a1cc0,_0x5712c9){const _0x1754ef=a159_0x55e5,_0x16487d=resolve(_0x2a1cc0,METADATA_FILE),_0x187873=readMetadataIfPresent(_0x16487d);if(!_0x187873)return;if(_0x187873[_0x1754ef(0x133)]!==_0x5712c9[_0x1754ef(0x133)])return;if(!isRuntimeSkillScope(_0x187873[_0x1754ef(0x131)])||!_0x5712c9[_0x1754ef(0x14a)]['has'](_0x187873['scope']))return;const _0x52adab=_0x187873[_0x1754ef(0x14f)]?.[_0x1754ef(0x14c)]();if(!_0x52adab)return;if(_0x5712c9[_0x1754ef(0x123)]&&_0x52adab!==_0x5712c9[_0x1754ef(0x123)])return;const _0x33b808=_0x187873['scope']+':'+_0x52adab,_0x119789=_0x5712c9['linkedPath']?[_0x5712c9['linkedPath']]:[],_0xd93445=_0x1769b8[_0x1754ef(0x140)](_0x33b808);if(_0xd93445){_0x5712c9[_0x1754ef(0x147)]===_0x1754ef(0x12a)&&(_0xd93445[_0x1754ef(0x130)]=_0x2a1cc0,_0xd93445['cacheDir']=_0x2a1cc0,_0xd93445['skillMdPath']=resolve(_0x2a1cc0,SKILL_FILE),_0xd93445[_0x1754ef(0x14b)]=_0x16487d);for(const _0xcef955 of _0x119789){!_0xd93445['linkedPaths'][_0x1754ef(0x149)](_0xcef955)&&_0xd93445[_0x1754ef(0x129)][_0x1754ef(0x12b)](_0xcef955);}_0xd93445[_0x1754ef(0x129)][_0x1754ef(0x137)]();return;}_0x1769b8[_0x1754ef(0x126)](_0x33b808,{..._0x187873,'tags':Array[_0x1754ef(0x13d)](_0x187873[_0x1754ef(0x125)])?_0x187873['tags']:[],'scope':_0x187873[_0x1754ef(0x131)],'source':_0x1754ef(0x127),'dir':_0x2a1cc0,'cacheDir':_0x5712c9[_0x1754ef(0x147)]===_0x1754ef(0x12a)?_0x2a1cc0:undefined,'skillMdPath':resolve(_0x2a1cc0,SKILL_FILE),'metadataPath':_0x16487d,'linkedPaths':_0x119789});}function a159_0x55e5(_0x470518,_0x5832ce){_0x470518=_0x470518-0x123;const _0x3ad5fe=a159_0x3ad5();let _0x55e5d6=_0x3ad5fe[_0x470518];return _0x55e5d6;}function compareLocalRuntimeSkills(_0xfeafa0,_0x10b297){const _0x5875af=a159_0x55e5,_0x417ad0={'personal':0x0,'company':0x1,'builtin':0x2};return _0x417ad0[_0xfeafa0[_0x5875af(0x131)]]-_0x417ad0[_0x10b297[_0x5875af(0x131)]]||_0xfeafa0[_0x5875af(0x14f)][_0x5875af(0x134)](_0x10b297['skillCode'])||_0xfeafa0[_0x5875af(0x130)]['localeCompare'](_0x10b297['dir']);}
@@ -1 +1 @@
1
- (function(_0x55fbca,_0x447274){const _0x38f69f=a160_0x548c,_0x24efe9=_0x55fbca();while(!![]){try{const _0x436b67=-parseInt(_0x38f69f(0x159))/0x1*(parseInt(_0x38f69f(0x14e))/0x2)+-parseInt(_0x38f69f(0x16c))/0x3*(-parseInt(_0x38f69f(0x15f))/0x4)+-parseInt(_0x38f69f(0x15d))/0x5*(-parseInt(_0x38f69f(0x15b))/0x6)+parseInt(_0x38f69f(0x149))/0x7+parseInt(_0x38f69f(0x162))/0x8*(parseInt(_0x38f69f(0x14b))/0x9)+parseInt(_0x38f69f(0x13e))/0xa+-parseInt(_0x38f69f(0x140))/0xb;if(_0x436b67===_0x447274)break;else _0x24efe9['push'](_0x24efe9['shift']());}catch(_0x2531b8){_0x24efe9['push'](_0x24efe9['shift']());}}}(a160_0x200c,0xc164b));import{readFileSync,readdirSync,realpathSync}from'node:fs';function a160_0x200c(){const _0x115cdd=['132Skrjji','add','localeCompare','48bOLBas','replace','string','utf8','content','size','set','object','name','bytes','30237vkpAMu','trim','14818930PACUXa','Unsafe\x20Skill\x20file\x20path:\x20','4899631DWqynn','validation','from','compare','path','isDirectory','Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20','toLowerCase','Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20','708582AnXLlU','has','7083EFPsiJ','length','excludedFilePaths','2pWwCOJ','isFile','Duplicate\x20Skill\x20file\x20path:\x20','sort','values','isBuffer','Skill\x20file\x20path\x20must\x20be\x20text.','sha256','isArray','toString','Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20','791244mAAJnz','includes','618atNKKx','Skill\x20file\x20sha256\x20is\x20invalid:\x20','5260JWCPyZ','push'];a160_0x200c=function(){return _0x115cdd;};return a160_0x200c();}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(_0x4989c2){const _0x2184c3=a160_0x548c;return _0x4989c2['bytes']??Buffer['from'](_0x4989c2[_0x2184c3(0x166)]??'',_0x2184c3(0x165));}export function fileText(_0x365f1a){const _0x41520f=a160_0x548c;return fileContent(_0x365f1a)[_0x41520f(0x157)](_0x41520f(0x165));}export function normalizeLocalFiles(_0x2b27c1){const _0x49bf46=a160_0x548c;if(!Array[_0x49bf46(0x156)](_0x2b27c1)||_0x2b27c1[_0x49bf46(0x14c)]===0x0)return[];const _0x3cf398=new Map();for(const _0x26ae07 of _0x2b27c1){if(!_0x26ae07||typeof _0x26ae07!==_0x49bf46(0x169)||typeof _0x26ae07[_0x49bf46(0x144)]!==_0x49bf46(0x164))throw CliErrors[_0x49bf46(0x141)]('Skill\x20file\x20path\x20must\x20be\x20text.');const _0x387a67=normalizeSkillRelativePath(_0x26ae07[_0x49bf46(0x144)]);if(_0x3cf398[_0x49bf46(0x14a)](_0x387a67))throw CliErrors[_0x49bf46(0x141)](_0x49bf46(0x150)+_0x387a67);if(_0x26ae07[_0x49bf46(0x16b)]!==undefined&&!Buffer[_0x49bf46(0x153)](_0x26ae07[_0x49bf46(0x16b)]))throw CliErrors[_0x49bf46(0x141)](_0x49bf46(0x146)+_0x387a67);if(_0x26ae07[_0x49bf46(0x16b)]===undefined&&typeof _0x26ae07[_0x49bf46(0x166)]!==_0x49bf46(0x164))throw CliErrors['validation'](_0x49bf46(0x158)+_0x387a67);const _0x303970=fileContent(_0x26ae07);_0x3cf398['set'](_0x387a67,{'path':_0x387a67,'bytes':_0x303970});}return Array[_0x49bf46(0x142)](_0x3cf398[_0x49bf46(0x152)]())[_0x49bf46(0x151)](compareSkillFiles);}export function normalizeManifestFiles(_0x25ff38){const _0x12d148=a160_0x548c;if(!Array[_0x12d148(0x156)](_0x25ff38)||_0x25ff38[_0x12d148(0x14c)]===0x0)return[];const _0x1a7333=new Map();for(const _0x2c523a of _0x25ff38){if(!_0x2c523a||typeof _0x2c523a!==_0x12d148(0x169)||typeof _0x2c523a['path']!=='string')throw CliErrors[_0x12d148(0x141)](_0x12d148(0x154));const _0x5f18c9=normalizeSkillRelativePath(_0x2c523a[_0x12d148(0x144)]);if(_0x1a7333[_0x12d148(0x14a)](_0x5f18c9))throw CliErrors[_0x12d148(0x141)]('Duplicate\x20Skill\x20file\x20path:\x20'+_0x5f18c9);if(!isSha256Hex(_0x2c523a[_0x12d148(0x155)]))throw CliErrors[_0x12d148(0x141)](_0x12d148(0x15c)+_0x5f18c9);if(!Number['isSafeInteger'](_0x2c523a[_0x12d148(0x167)])||_0x2c523a[_0x12d148(0x167)]<0x0)throw CliErrors[_0x12d148(0x141)]('Skill\x20file\x20size\x20is\x20invalid:\x20'+_0x5f18c9);_0x1a7333[_0x12d148(0x168)](_0x5f18c9,{'path':_0x5f18c9,'sha256':_0x2c523a[_0x12d148(0x155)][_0x12d148(0x147)](),'size':_0x2c523a[_0x12d148(0x167)]});}return Array[_0x12d148(0x142)](_0x1a7333[_0x12d148(0x152)]())[_0x12d148(0x151)](compareSkillFiles);}export function scanSkillDirectory(_0x4c4c49,_0x249872={}){const _0x13363a=a160_0x548c,_0x3bf9b2=realpathSync(_0x4c4c49),_0x117932=canonicalExcludedFilePaths(_0x249872[_0x13363a(0x14d)]),_0x23c77c=[];function _0x108018(_0x390802){const _0x1931eb=_0x13363a,_0x30d2a7=readdirSync(_0x390802,{'withFileTypes':!![]})['sort']((_0x2aff33,_0x6c2c55)=>_0x2aff33[_0x1931eb(0x16a)][_0x1931eb(0x161)](_0x6c2c55[_0x1931eb(0x16a)]));for(const _0x486690 of _0x30d2a7){if(_0x486690['isDirectory']()&&IGNORED_DIR_NAMES['has'](_0x486690['name']))continue;if(IGNORED_FILE_NAMES[_0x1931eb(0x14a)](_0x486690['name']))continue;const _0x1f11af=resolve(_0x390802,_0x486690['name']);if(isExcludedFilePath(_0x1f11af,_0x117932))continue;if(_0x486690['isSymbolicLink']())throw CliErrors[_0x1931eb(0x141)](_0x1931eb(0x148)+_0x1f11af);const _0x3590aa=toPosixPath(relative(_0x3bf9b2,_0x1f11af));if(_0x486690[_0x1931eb(0x145)]()){_0x108018(_0x1f11af);continue;}if(!_0x486690[_0x1931eb(0x14f)]())continue;validateSkillRelativePath(_0x3590aa);const _0x44d21c=readFileSync(_0x1f11af);_0x23c77c[_0x1931eb(0x15e)]({'path':_0x3590aa,'bytes':_0x44d21c});}}return _0x108018(_0x3bf9b2),normalizeLocalFiles(_0x23c77c);}function canonicalExcludedFilePaths(_0x15b137){const _0x51b436=a160_0x548c,_0x36215e=new Set();for(const _0x216c83 of _0x15b137??[]){const _0x5830f9=resolve(_0x216c83);_0x36215e['add'](_0x5830f9);try{_0x36215e[_0x51b436(0x160)](realpathSync(_0x5830f9));}catch{}}return _0x36215e;}function isExcludedFilePath(_0x559597,_0x18d966){const _0x49b4f8=a160_0x548c;if(_0x18d966[_0x49b4f8(0x14a)](_0x559597))return!![];if(_0x18d966[_0x49b4f8(0x167)]===0x0)return![];try{return _0x18d966[_0x49b4f8(0x14a)](realpathSync(_0x559597));}catch{return![];}}export function compareSkillFiles(_0x3a8d86,_0x398a78){const _0x390014=a160_0x548c;if(_0x3a8d86[_0x390014(0x144)]===SKILL_FILE)return _0x398a78[_0x390014(0x144)]===SKILL_FILE?0x0:-0x1;if(_0x398a78['path']===SKILL_FILE)return 0x1;return Buffer[_0x390014(0x143)](Buffer[_0x390014(0x142)](_0x3a8d86[_0x390014(0x144)],_0x390014(0x165)),Buffer[_0x390014(0x142)](_0x398a78[_0x390014(0x144)],_0x390014(0x165)));}export function normalizeSkillRelativePath(_0x2b0f20){const _0x33b090=a160_0x548c,_0x210524=toPosixPath(_0x2b0f20[_0x33b090(0x13d)]());return validateSkillRelativePath(_0x210524),_0x210524;}export function validateSkillRelativePath(_0x56bcb7){const _0x515029=a160_0x548c;if(!_0x56bcb7||_0x56bcb7['startsWith']('/')||_0x56bcb7[_0x515029(0x15a)]('//'))throw CliErrors[_0x515029(0x141)](_0x515029(0x13f)+_0x56bcb7);for(const _0xdb4ebb of _0x56bcb7['split']('/')){if(!_0xdb4ebb||_0xdb4ebb==='.'||_0xdb4ebb==='..')throw CliErrors[_0x515029(0x141)]('Unsafe\x20Skill\x20file\x20path:\x20'+_0x56bcb7);}}function a160_0x548c(_0x4f62bb,_0xfa64ae){_0x4f62bb=_0x4f62bb-0x13d;const _0x200ca5=a160_0x200c();let _0x548c73=_0x200ca5[_0x4f62bb];return _0x548c73;}export function toPosixPath(_0x56fce6){const _0x1de4a6=a160_0x548c;return _0x56fce6[_0x1de4a6(0x163)](/\\/g,'/');}export function isSha256Hex(_0x5d0ca1){const _0x52986d=a160_0x548c;return typeof _0x5d0ca1===_0x52986d(0x164)&&/^[a-fA-F0-9]{64}$/['test'](_0x5d0ca1);}
1
+ (function(_0x3b347e,_0x2aa11c){const _0x1234d0=a160_0x3eb0,_0x3cf2db=_0x3b347e();while(!![]){try{const _0x13b605=parseInt(_0x1234d0(0x15b))/0x1*(parseInt(_0x1234d0(0x15c))/0x2)+parseInt(_0x1234d0(0x166))/0x3+-parseInt(_0x1234d0(0x170))/0x4*(-parseInt(_0x1234d0(0x15a))/0x5)+-parseInt(_0x1234d0(0x151))/0x6*(parseInt(_0x1234d0(0x157))/0x7)+parseInt(_0x1234d0(0x164))/0x8*(parseInt(_0x1234d0(0x150))/0x9)+parseInt(_0x1234d0(0x174))/0xa*(-parseInt(_0x1234d0(0x16e))/0xb)+-parseInt(_0x1234d0(0x17f))/0xc;if(_0x13b605===_0x2aa11c)break;else _0x3cf2db['push'](_0x3cf2db['shift']());}catch(_0x4f6dd7){_0x3cf2db['push'](_0x3cf2db['shift']());}}}(a160_0x3029,0xcedac));import{readFileSync,readdirSync,realpathSync}from'node:fs';import{relative,resolve}from'node:path';function a160_0x3eb0(_0x49213f,_0xbeda3){_0x49213f=_0x49213f-0x14f;const _0x3029e1=a160_0x3029();let _0x3eb087=_0x3029e1[_0x49213f];return _0x3eb087;}import{CliErrors}from'../../errors.js';import{IGNORED_DIR_NAMES,IGNORED_FILE_NAMES,SKILL_FILE}from'./constants.js';export function fileContent(_0x10e662){const _0x5259c7=a160_0x3eb0;return _0x10e662[_0x5259c7(0x16b)]??Buffer[_0x5259c7(0x165)](_0x10e662[_0x5259c7(0x175)]??'',_0x5259c7(0x180));}export function fileText(_0x567bc0){const _0x4d634e=a160_0x3eb0;return fileContent(_0x567bc0)[_0x4d634e(0x152)](_0x4d634e(0x180));}export function normalizeLocalFiles(_0x15e9b6){const _0x31eb48=a160_0x3eb0;if(!Array[_0x31eb48(0x160)](_0x15e9b6)||_0x15e9b6[_0x31eb48(0x154)]===0x0)return[];const _0x5eedcc=new Map();for(const _0x4e64b1 of _0x15e9b6){if(!_0x4e64b1||typeof _0x4e64b1!=='object'||typeof _0x4e64b1[_0x31eb48(0x161)]!=='string')throw CliErrors['validation'](_0x31eb48(0x16d));const _0x4e0730=normalizeSkillRelativePath(_0x4e64b1[_0x31eb48(0x161)]);if(_0x5eedcc[_0x31eb48(0x169)](_0x4e0730))throw CliErrors[_0x31eb48(0x17a)](_0x31eb48(0x173)+_0x4e0730);if(_0x4e64b1[_0x31eb48(0x16b)]!==undefined&&!Buffer[_0x31eb48(0x15f)](_0x4e64b1[_0x31eb48(0x16b)]))throw CliErrors['validation'](_0x31eb48(0x178)+_0x4e0730);if(_0x4e64b1['bytes']===undefined&&typeof _0x4e64b1[_0x31eb48(0x175)]!==_0x31eb48(0x171))throw CliErrors[_0x31eb48(0x17a)](_0x31eb48(0x17e)+_0x4e0730);const _0x1532cf=fileContent(_0x4e64b1);_0x5eedcc['set'](_0x4e0730,{'path':_0x4e0730,'bytes':_0x1532cf});}return Array[_0x31eb48(0x165)](_0x5eedcc[_0x31eb48(0x179)]())[_0x31eb48(0x168)](compareSkillFiles);}export function normalizeManifestFiles(_0x1c6047){const _0x386465=a160_0x3eb0;if(!Array[_0x386465(0x160)](_0x1c6047)||_0x1c6047[_0x386465(0x154)]===0x0)return[];const _0x394836=new Map();for(const _0x507b9d of _0x1c6047){if(!_0x507b9d||typeof _0x507b9d!==_0x386465(0x16c)||typeof _0x507b9d[_0x386465(0x161)]!==_0x386465(0x171))throw CliErrors['validation']('Skill\x20file\x20path\x20must\x20be\x20text.');const _0x56a1f6=normalizeSkillRelativePath(_0x507b9d[_0x386465(0x161)]);if(_0x394836[_0x386465(0x169)](_0x56a1f6))throw CliErrors['validation']('Duplicate\x20Skill\x20file\x20path:\x20'+_0x56a1f6);if(!isSha256Hex(_0x507b9d[_0x386465(0x16a)]))throw CliErrors[_0x386465(0x17a)](_0x386465(0x172)+_0x56a1f6);if(!Number[_0x386465(0x156)](_0x507b9d['size'])||_0x507b9d[_0x386465(0x155)]<0x0)throw CliErrors[_0x386465(0x17a)](_0x386465(0x153)+_0x56a1f6);_0x394836[_0x386465(0x159)](_0x56a1f6,{'path':_0x56a1f6,'sha256':_0x507b9d[_0x386465(0x16a)][_0x386465(0x162)](),'size':_0x507b9d[_0x386465(0x155)]});}return Array['from'](_0x394836['values']())[_0x386465(0x168)](compareSkillFiles);}export function scanSkillDirectory(_0xf90b12,_0xd41b6e={}){const _0x442c02=a160_0x3eb0,_0x186fba=realpathSync(_0xf90b12),_0x41c274=canonicalExcludedFilePaths(_0xd41b6e[_0x442c02(0x177)]),_0x273f04=[];function _0x2ad263(_0x568e68){const _0x1d3dc1=_0x442c02,_0x2f949f=readdirSync(_0x568e68,{'withFileTypes':!![]})[_0x1d3dc1(0x168)]((_0x156c5a,_0x7a966d)=>_0x156c5a[_0x1d3dc1(0x163)][_0x1d3dc1(0x176)](_0x7a966d[_0x1d3dc1(0x163)]));for(const _0x10d8c9 of _0x2f949f){if(_0x10d8c9[_0x1d3dc1(0x14f)]()&&IGNORED_DIR_NAMES[_0x1d3dc1(0x169)](_0x10d8c9[_0x1d3dc1(0x163)]))continue;if(IGNORED_FILE_NAMES['has'](_0x10d8c9[_0x1d3dc1(0x163)]))continue;const _0x4ed17c=resolve(_0x568e68,_0x10d8c9[_0x1d3dc1(0x163)]);if(isExcludedFilePath(_0x4ed17c,_0x41c274))continue;if(_0x10d8c9['isSymbolicLink']())throw CliErrors[_0x1d3dc1(0x17a)](_0x1d3dc1(0x17d)+_0x4ed17c);const _0x32b8d6=toPosixPath(relative(_0x186fba,_0x4ed17c));if(_0x10d8c9[_0x1d3dc1(0x14f)]()){_0x2ad263(_0x4ed17c);continue;}if(!_0x10d8c9[_0x1d3dc1(0x15d)]())continue;validateSkillRelativePath(_0x32b8d6);const _0x4eb038=readFileSync(_0x4ed17c);_0x273f04['push']({'path':_0x32b8d6,'bytes':_0x4eb038});}}return _0x2ad263(_0x186fba),normalizeLocalFiles(_0x273f04);}function canonicalExcludedFilePaths(_0x2c94c8){const _0x4766a7=a160_0x3eb0,_0x175258=new Set();for(const _0x14532e of _0x2c94c8??[]){const _0x32aff8=resolve(_0x14532e);_0x175258[_0x4766a7(0x15e)](_0x32aff8);try{_0x175258[_0x4766a7(0x15e)](realpathSync(_0x32aff8));}catch{}}return _0x175258;}function isExcludedFilePath(_0x1c5640,_0x5500d8){const _0x53bba1=a160_0x3eb0;if(_0x5500d8[_0x53bba1(0x169)](_0x1c5640))return!![];if(_0x5500d8[_0x53bba1(0x155)]===0x0)return![];try{return _0x5500d8['has'](realpathSync(_0x1c5640));}catch{return![];}}export function compareSkillFiles(_0xcf5859,_0x285667){const _0x35f8f8=a160_0x3eb0;if(_0xcf5859[_0x35f8f8(0x161)]===SKILL_FILE)return _0x285667[_0x35f8f8(0x161)]===SKILL_FILE?0x0:-0x1;if(_0x285667[_0x35f8f8(0x161)]===SKILL_FILE)return 0x1;return Buffer[_0x35f8f8(0x167)](Buffer[_0x35f8f8(0x165)](_0xcf5859[_0x35f8f8(0x161)],_0x35f8f8(0x180)),Buffer[_0x35f8f8(0x165)](_0x285667['path'],_0x35f8f8(0x180)));}function a160_0x3029(){const _0x2a9b1e=['Skill\x20file\x20content\x20must\x20be\x20text\x20or\x20bytes:\x20','16486188UMTeEM','utf8','isDirectory','4551894FQfXAL','6WlkHit','toString','Skill\x20file\x20size\x20is\x20invalid:\x20','length','size','isSafeInteger','3215947TplVmo','Unsafe\x20Skill\x20file\x20path:\x20','set','30CjtDmh','75846EaTMmq','6sgXBHc','isFile','add','isBuffer','isArray','path','toLowerCase','name','8DsxjGF','from','3836310BcTskB','compare','sort','has','sha256','bytes','object','Skill\x20file\x20path\x20must\x20be\x20text.','44FKJnSZ','startsWith','944992Eaexaq','string','Skill\x20file\x20sha256\x20is\x20invalid:\x20','Duplicate\x20Skill\x20file\x20path:\x20','1872540xbrxXB','content','localeCompare','excludedFilePaths','Skill\x20file\x20bytes\x20must\x20be\x20a\x20Buffer:\x20','values','validation','trim','test','Skill\x20directory\x20contains\x20unsupported\x20symlink:\x20'];a160_0x3029=function(){return _0x2a9b1e;};return a160_0x3029();}export function normalizeSkillRelativePath(_0x354b40){const _0x57a45d=a160_0x3eb0,_0x5c3307=toPosixPath(_0x354b40[_0x57a45d(0x17b)]());return validateSkillRelativePath(_0x5c3307),_0x5c3307;}export function validateSkillRelativePath(_0x56c188){const _0x161f28=a160_0x3eb0;if(!_0x56c188||_0x56c188[_0x161f28(0x16f)]('/')||_0x56c188['includes']('//'))throw CliErrors[_0x161f28(0x17a)]('Unsafe\x20Skill\x20file\x20path:\x20'+_0x56c188);for(const _0x175e65 of _0x56c188['split']('/')){if(!_0x175e65||_0x175e65==='.'||_0x175e65==='..')throw CliErrors[_0x161f28(0x17a)](_0x161f28(0x158)+_0x56c188);}}export function toPosixPath(_0x4f91ff){return _0x4f91ff['replace'](/\\/g,'/');}export function isSha256Hex(_0xae3362){const _0x4db1b3=a160_0x3eb0;return typeof _0xae3362==='string'&&/^[a-fA-F0-9]{64}$/[_0x4db1b3(0x17c)](_0xae3362);}
@@ -1 +1 @@
1
- function a161_0x4f3e(_0x184066,_0x5a54fa){_0x184066=_0x184066-0xba;const _0x4afa58=a161_0x4afa();let _0x4f3e0c=_0x4afa58[_0x184066];return _0x4f3e0c;}(function(_0x37c303,_0x5919be){const _0x347d9c=a161_0x4f3e,_0x11486a=_0x37c303();while(!![]){try{const _0x3d7951=-parseInt(_0x347d9c(0xea))/0x1*(parseInt(_0x347d9c(0xdc))/0x2)+parseInt(_0x347d9c(0xe6))/0x3*(parseInt(_0x347d9c(0xf1))/0x4)+parseInt(_0x347d9c(0xe4))/0x5+-parseInt(_0x347d9c(0xf5))/0x6+parseInt(_0x347d9c(0xc6))/0x7*(parseInt(_0x347d9c(0xbf))/0x8)+-parseInt(_0x347d9c(0xbe))/0x9*(-parseInt(_0x347d9c(0xd9))/0xa)+parseInt(_0x347d9c(0xed))/0xb*(-parseInt(_0x347d9c(0xe8))/0xc);if(_0x3d7951===_0x5919be)break;else _0x11486a['push'](_0x11486a['shift']());}catch(_0x361252){_0x11486a['push'](_0x11486a['shift']());}}}(a161_0x4afa,0xd1b3b));import{existsSync,lstatSync,mkdirSync,readFileSync,rmSync}from'node:fs';import{dirname,resolve}from'node:path';import{isCollection,isMap,isNode,parseDocument,visit}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';import{resolveManagedFilePath,writeBytesAtomic,writeJsonAtomic}from'./fs-utils.js';import{bufferSha256,contentHash,fileHash}from'./hashing.js';import{fileContent,fileText,normalizeLocalFiles}from'./local-files.js';import{buildMetadata,readMetadataIfPresent,requireSkillCode}from'./metadata.js';import{getRuntimeSkillDir}from'./paths.js';import{extractDownloadedPackage,requirePackageBytes}from'./zip-package.js';export function materializeRuntimeSkill(_0x3297fd,_0x128de1,_0x1bf145){const _0x94ca9b=a161_0x4f3e,_0xd4ca4e=requireSkillCode(_0x3297fd),_0x412cca=requirePackageBytes(_0xd4ca4e,_0x1bf145['packageBytes']),_0x268cea=extractDownloadedPackage(_0x412cca),_0x34eb8b=_0x268cea[_0x94ca9b(0xd3)](_0x15cb1d=>_0x15cb1d[_0x94ca9b(0xd5)]===SKILL_FILE);if(!_0x34eb8b)throw CliErrors[_0x94ca9b(0xdf)](_0x94ca9b(0xe9)+SKILL_FILE+':\x20'+_0xd4ca4e);const _0x2999cf=withMaterializedSkillFrontmatter(_0x268cea,_0x3297fd,_0xd4ca4e),_0xf8b27a=_0x2999cf[_0x94ca9b(0xd3)](_0x4818d3=>_0x4818d3[_0x94ca9b(0xd5)]===SKILL_FILE),_0x5eaa36=fileText(_0xf8b27a),_0x377451=getRuntimeSkillDir(_0x1bf145[_0x94ca9b(0xeb)],_0x1bf145[_0x94ca9b(0xf6)],_0x1bf145[_0x94ca9b(0xd7)],_0x128de1,_0xd4ca4e,_0x1bf145[_0x94ca9b(0xd0)]),_0x51a485=resolve(_0x377451,SKILL_FILE),_0x1be419=resolve(_0x377451,METADATA_FILE),_0x19c99f=contentHash(_0x5eaa36),_0x462650=readMetadataIfPresent(_0x1be419)?.[_0x94ca9b(0xce)];ensurePulledFilesCanBeOverwritten(_0x377451,_0x1be419,_0x2999cf,_0x1bf145[_0x94ca9b(0xe7)]===!![]),mkdirSync(_0x377451,{'recursive':!![],'mode':0x1c0});const _0x469af5=existsSync(_0x51a485)?readFileSync(_0x51a485,_0x94ca9b(0xf0)):undefined;return materializeFiles(_0x377451,_0x2999cf),removeStaleManagedFiles(_0x377451,_0x462650,_0x2999cf),writeJsonAtomic(_0x1be419,buildMetadata(_0x3297fd,_0x128de1,_0x1bf145['appCode'],_0x19c99f,_0x1bf145[_0x94ca9b(0xe3)],_0x2999cf,_0x412cca)),{'skill':_0x3297fd,'scope':_0x128de1,'dir':_0x377451,'skillMdPath':_0x51a485,'metadataPath':_0x1be419,'contentHash':_0x19c99f,'changed':_0x469af5!==_0x5eaa36};}function a161_0x4afa(){const _0x35fd65=['utf8','68124zyzdvn','.\x20Changed\x20file:\x20','displayName','example','3655002daODiv','accessKey','flow','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','---\x0a','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','contents','filter','1990539ItAOWa','1992pAbKhe','has','\x0a---\x0a\x0a','contentHash','description','status','set','23289FDodTU','Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20','version','entries','match','---','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.','delete','fileHashes','skillName','paths','toString','description:\x20','find','replace','path','displayName:\x20','appCode','map','50ztRDVd','keys','length','2cBEwcb','Managed\x20file\x20was\x20removed\x20locally:\x20','Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20','validation','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','name:\x20','name','pulledAt','2710970PHUUqK','isFile','279xuCLUC','force','79656aMlQyU','Runtime\x20Skill\x20package\x20is\x20missing\x20','653953KToWtX','env','join','3212inEmFO','slice','trim'];a161_0x4afa=function(){return _0x35fd65;};return a161_0x4afa();}export function reuseMaterializedRuntimeSkill(_0x1ee6d6,_0x5da8b1,_0x48e075){const _0x4d076b=a161_0x4f3e,_0x32166a=_0x1ee6d6['version']?.[_0x4d076b(0xef)]();if(!_0x32166a)return undefined;const _0x5a3aab=requireSkillCode(_0x1ee6d6),_0x389c64=getRuntimeSkillDir(_0x48e075['env'],_0x48e075[_0x4d076b(0xf6)],_0x48e075[_0x4d076b(0xd7)],_0x5da8b1,_0x5a3aab,_0x48e075[_0x4d076b(0xd0)]),_0x29004=resolve(_0x389c64,SKILL_FILE),_0x48eec2=resolve(_0x389c64,METADATA_FILE),_0x240f66=readMetadataIfPresent(_0x48eec2);if(!_0x240f66||_0x240f66['schemaVersion']!==0x2||_0x240f66['appCode']!==_0x48e075[_0x4d076b(0xd7)]||_0x240f66['scope']!==_0x5da8b1||_0x240f66['skillCode']!==_0x5a3aab||_0x240f66[_0x4d076b(0xc8)]!==_0x32166a||_0x240f66['id']!==_0x1ee6d6['id']||_0x240f66['skillName']!==_0x1ee6d6[_0x4d076b(0xcf)]||_0x240f66['description']!==_0x1ee6d6[_0x4d076b(0xc3)]||_0x240f66[_0x4d076b(0xf4)]!==_0x1ee6d6[_0x4d076b(0xf4)]||_0x240f66['status']!==_0x1ee6d6[_0x4d076b(0xc4)]||!_0x240f66[_0x4d076b(0xc2)]||!_0x240f66[_0x4d076b(0xce)]||!Object['hasOwn'](_0x240f66['fileHashes'],SKILL_FILE))return undefined;for(const [_0x371cfd,_0x261e9a]of Object['entries'](_0x240f66['fileHashes'])){if(!/^[a-f0-9]{64}$/['test'](_0x261e9a))return undefined;const _0x18d77e=resolveManagedFilePath(_0x389c64,_0x371cfd);if(!existsSync(_0x18d77e)||!lstatSync(_0x18d77e)[_0x4d076b(0xe5)]())return undefined;if(bufferSha256(readFileSync(_0x18d77e))!==_0x261e9a)return undefined;}return{'skill':_0x1ee6d6,'scope':_0x5da8b1,'dir':_0x389c64,'skillMdPath':_0x29004,'metadataPath':_0x48eec2,'contentHash':_0x240f66[_0x4d076b(0xc2)],'changed':![]};}function withMaterializedSkillFrontmatter(_0x261b4d,_0x52c3b3,_0x149cc9){const _0x50f06e=a161_0x4f3e,_0x2ca660=skillDisplayName(_0x52c3b3,_0x149cc9),_0x23300a=_0x52c3b3[_0x50f06e(0xc3)]?.[_0x50f06e(0xef)]()||_0x2ca660||_0x149cc9;return normalizeLocalFiles(_0x261b4d)['map'](_0x278c94=>{const _0x5f0f23=_0x50f06e,_0x4bad51=fileText(_0x278c94);if(_0x278c94[_0x5f0f23(0xd5)]!==SKILL_FILE)return _0x278c94;if(hasYamlFrontmatter(_0x4bad51))return{'path':_0x278c94[_0x5f0f23(0xd5)],'content':withSyncedDisplayName(_0x4bad51,_0x2ca660)};return{'path':_0x278c94['path'],'content':prependSkillFrontmatter(_0x4bad51,{'name':_0x149cc9,'displayName':_0x2ca660,'description':_0x23300a})};});}function hasYamlFrontmatter(_0x22c5b8){return/^\uFEFF?---\s*\r?\n/['test'](_0x22c5b8);}function prependSkillFrontmatter(_0x3d88d2,_0x33c352){const _0x344b9e=a161_0x4f3e,_0x4f4971=_0x3d88d2[_0x344b9e(0xd4)](/^\uFEFF/,'');return[_0x344b9e(0xcb),_0x344b9e(0xe1)+yamlString(_0x33c352[_0x344b9e(0xe2)]),_0x33c352[_0x344b9e(0xf3)]?_0x344b9e(0xd6)+yamlString(_0x33c352[_0x344b9e(0xf3)]):undefined,_0x344b9e(0xd2)+yamlString(_0x33c352[_0x344b9e(0xc3)]),_0x344b9e(0xcb),'',_0x4f4971][_0x344b9e(0xbd)](_0x4039c9=>_0x4039c9!==undefined)[_0x344b9e(0xec)]('\x0a');}function yamlString(_0x141fe2){const _0x26c499=a161_0x4f3e;return JSON['stringify'](_0x141fe2[_0x26c499(0xd4)](/\r/g,'')['trim']());}function skillDisplayName(_0x18012f,_0x23b419){const _0x284297=a161_0x4f3e,_0x53149d=_0x18012f[_0x284297(0xcf)]?.['trim']();return _0x53149d||_0x23b419;}function withSyncedDisplayName(_0x4d5aa8,_0x55a70b){const _0x5ad51e=a161_0x4f3e,_0x36b68c=_0x4d5aa8[_0x5ad51e(0xca)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x36b68c)return _0x4d5aa8;const _0x45c914=_0x36b68c[0x1]??'',_0x2e764b=_0x36b68c[0x2]??'',_0x4118ab=parseDocument(_0x2e764b);if(_0x4118ab['errors']['length']>0x0||!isMap(_0x4118ab[_0x5ad51e(0xbc)]))return _0x4d5aa8;if(_0x55a70b)_0x4118ab[_0x5ad51e(0xc5)](_0x5ad51e(0xf3),_0x55a70b);else{if(_0x4118ab[_0x5ad51e(0xc0)](_0x5ad51e(0xf3)))_0x4118ab[_0x5ad51e(0xcd)](_0x5ad51e(0xf3));else return _0x4d5aa8;}forceBlockCollections(_0x4118ab[_0x5ad51e(0xbc)]);const _0x296cfa=_0x4118ab[_0x5ad51e(0xd1)]({'lineWidth':0x0})['trimEnd'](),_0x413a4f=_0x4d5aa8[_0x5ad51e(0xee)](_0x36b68c[0x0][_0x5ad51e(0xdb)])['replace'](/^\r?\n/,'');return _0x45c914+_0x5ad51e(0xba)+_0x296cfa+_0x5ad51e(0xc1)+_0x413a4f;}function forceBlockCollections(_0x11863d){if(!isNode(_0x11863d))return;visit(_0x11863d,(_0x5690f3,_0xc93209)=>{const _0x5633a9=a161_0x4f3e;isCollection(_0xc93209)&&(_0xc93209[_0x5633a9(0xf7)]=![]);});}function ensurePulledFilesCanBeOverwritten(_0x4cf7d8,_0x108b31,_0x567a4a,_0x225ceb){const _0x3f5b03=a161_0x4f3e;if(_0x225ceb||!existsSync(_0x108b31))return;const _0x4c6b6b=readMetadataIfPresent(_0x108b31);if(!_0x4c6b6b)return;const _0x597ef9=_0x4c6b6b['fileHashes']&&Object[_0x3f5b03(0xda)](_0x4c6b6b[_0x3f5b03(0xce)])[_0x3f5b03(0xdb)]>0x0?_0x4c6b6b[_0x3f5b03(0xce)]:undefined;if(_0x597ef9)for(const [_0x272044,_0x37c2f1]of Object[_0x3f5b03(0xc9)](_0x597ef9)){const _0x1a4387=resolveManagedFilePath(_0x4cf7d8,_0x272044);if(!existsSync(_0x1a4387))throw CliErrors['validation'](_0x3f5b03(0xe0)+_0x4cf7d8,_0x3f5b03(0xdd)+_0x272044);const _0x26aea9=lstatSync(_0x1a4387);if(!_0x26aea9[_0x3f5b03(0xe5)]())throw CliErrors[_0x3f5b03(0xdf)](_0x3f5b03(0xe0)+_0x4cf7d8,_0x3f5b03(0xde)+_0x272044);const _0x42e35d=bufferSha256(readFileSync(_0x1a4387));if(_0x42e35d!==_0x37c2f1)throw CliErrors[_0x3f5b03(0xdf)]('Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20'+_0x4cf7d8+_0x3f5b03(0xf2)+_0x272044,_0x3f5b03(0xbb)+_0x272044);}else{const _0x57288e=resolve(_0x4cf7d8,SKILL_FILE);if(existsSync(_0x57288e)&&_0x4c6b6b[_0x3f5b03(0xc2)]){const _0x57f4e6=contentHash(readFileSync(_0x57288e,_0x3f5b03(0xf0)));if(_0x57f4e6!==_0x4c6b6b['contentHash'])throw CliErrors[_0x3f5b03(0xdf)](_0x3f5b03(0xf8)+_0x57288e,_0x3f5b03(0xcc));}}for(const _0x2f2781 of normalizeLocalFiles(_0x567a4a)){if(_0x597ef9?.[_0x2f2781['path']])continue;if(!_0x597ef9&&_0x2f2781[_0x3f5b03(0xd5)]===SKILL_FILE)continue;const _0xf0b9a=resolveManagedFilePath(_0x4cf7d8,_0x2f2781[_0x3f5b03(0xd5)]);if(!existsSync(_0xf0b9a))continue;const _0x53add7=lstatSync(_0xf0b9a);if(!_0x53add7[_0x3f5b03(0xe5)]())throw CliErrors[_0x3f5b03(0xdf)](_0x3f5b03(0xe0)+_0x4cf7d8,'Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20'+_0x2f2781[_0x3f5b03(0xd5)]);const _0x5f4f8d=bufferSha256(readFileSync(_0xf0b9a));if(_0x5f4f8d!==fileHash(_0x2f2781))throw CliErrors[_0x3f5b03(0xdf)](_0x3f5b03(0xe0)+_0x4cf7d8,_0x3f5b03(0xc7)+_0x2f2781[_0x3f5b03(0xd5)]);}}function materializeFiles(_0x36cd51,_0x54dcd5){const _0x2c0c75=a161_0x4f3e;for(const _0x2b987f of normalizeLocalFiles(_0x54dcd5)){const _0x268f42=resolveManagedFilePath(_0x36cd51,_0x2b987f[_0x2c0c75(0xd5)]);mkdirSync(dirname(_0x268f42),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x268f42,fileContent(_0x2b987f),0x180);}}function removeStaleManagedFiles(_0x850265,_0xea92a,_0x3d6a6){const _0x5dc779=a161_0x4f3e;if(!_0xea92a)return;const _0x35c6c5=new Set(normalizeLocalFiles(_0x3d6a6)[_0x5dc779(0xd8)](_0x5c951a=>_0x5c951a[_0x5dc779(0xd5)]));for(const _0x3cbd14 of Object['keys'](_0xea92a)){if(_0x35c6c5['has'](_0x3cbd14))continue;const _0x1c1cbc=resolveManagedFilePath(_0x850265,_0x3cbd14);existsSync(_0x1c1cbc)&&lstatSync(_0x1c1cbc)[_0x5dc779(0xe5)]()&&rmSync(_0x1c1cbc,{'force':!![]});}}
1
+ (function(_0x18083b,_0x55be47){const _0x8f84ba=a161_0xb29a,_0x4bae15=_0x18083b();while(!![]){try{const _0x860d6b=parseInt(_0x8f84ba(0x85))/0x1*(parseInt(_0x8f84ba(0xb2))/0x2)+-parseInt(_0x8f84ba(0x86))/0x3+parseInt(_0x8f84ba(0xaf))/0x4*(parseInt(_0x8f84ba(0x9b))/0x5)+parseInt(_0x8f84ba(0x96))/0x6+-parseInt(_0x8f84ba(0x7d))/0x7*(parseInt(_0x8f84ba(0xa4))/0x8)+parseInt(_0x8f84ba(0xa9))/0x9+-parseInt(_0x8f84ba(0x80))/0xa;if(_0x860d6b===_0x55be47)break;else _0x4bae15['push'](_0x4bae15['shift']());}catch(_0x3a0708){_0x4bae15['push'](_0x4bae15['shift']());}}}(a161_0x2ecf,0x418c5));import{existsSync,lstatSync,mkdirSync,readFileSync,rmSync}from'node:fs';import{dirname,resolve}from'node:path';import{isCollection,isMap,isNode,parseDocument,visit}from'yaml';import{CliErrors}from'../../errors.js';import{METADATA_FILE,SKILL_FILE}from'./constants.js';function a161_0xb29a(_0x29ca92,_0x273cda){_0x29ca92=_0x29ca92-0x79;const _0x2ecf19=a161_0x2ecf();let _0xb29a44=_0x2ecf19[_0x29ca92];return _0xb29a44;}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';function a161_0x2ecf(){const _0x36b337=['skillName','Local\x20SKILL.md\x20has\x20unpushed\x20edits:\x20','has','contentHash','trimEnd','stringify','example','contents','description:\x20','entries','---','2401440KaCFMi','validation','test','appCode','\x0a---\x0a\x0a','567565ImtoQR','find','Runtime\x20Skill\x20package\x20is\x20missing\x20','packageBytes','utf8','Local\x20Skill\x20files\x20have\x20unpushed\x20edits:\x20','flow','description','filter','66672NciCWH','match','schemaVersion','displayName','hasOwn','3094713QmdiAY','length','skillCode','toString','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.\x20Changed\x20file:\x20','fileHashes','16llaaci','pulledAt','map','2ulUQcm','path','Remote\x20Skill\x20would\x20overwrite\x20a\x20local\x20non-file\x20path:\x20','Push\x20the\x20directory\x20first,\x20then\x20rerun\x20skill\x20install.','trim','join','set','displayName:\x20','version','name','.\x20Changed\x20file:\x20','paths','delete','420LMGylL','Managed\x20file\x20is\x20no\x20longer\x20a\x20regular\x20file:\x20','Remote\x20Skill\x20would\x20overwrite\x20an\x20unmanaged\x20local\x20file:\x20','7346140nWRcFP','isFile','scope','---\x0a','accessKey','350717gWOAEe','137181gDTPYQ','env','keys','name:\x20','replace'];a161_0x2ecf=function(){return _0x36b337;};return a161_0x2ecf();}import{getRuntimeSkillDir}from'./paths.js';import{extractDownloadedPackage,requirePackageBytes}from'./zip-package.js';export function materializeRuntimeSkill(_0x5ebc20,_0x4c7d4e,_0x2de511){const _0x3c8339=a161_0xb29a,_0x613376=requireSkillCode(_0x5ebc20),_0x1e01ad=requirePackageBytes(_0x613376,_0x2de511[_0x3c8339(0x9e)]),_0xa6297f=extractDownloadedPackage(_0x1e01ad),_0x24d7f8=_0xa6297f['find'](_0x5d23bf=>_0x5d23bf[_0x3c8339(0xb3)]===SKILL_FILE);if(!_0x24d7f8)throw CliErrors[_0x3c8339(0x97)](_0x3c8339(0x9d)+SKILL_FILE+':\x20'+_0x613376);const _0x2387ee=withMaterializedSkillFrontmatter(_0xa6297f,_0x5ebc20,_0x613376),_0xf6b443=_0x2387ee[_0x3c8339(0x9c)](_0x33f4da=>_0x33f4da[_0x3c8339(0xb3)]===SKILL_FILE),_0x24a5cd=fileText(_0xf6b443),_0x461acf=getRuntimeSkillDir(_0x2de511['env'],_0x2de511[_0x3c8339(0x84)],_0x2de511[_0x3c8339(0x99)],_0x4c7d4e,_0x613376,_0x2de511[_0x3c8339(0x7b)]),_0x3fcc4c=resolve(_0x461acf,SKILL_FILE),_0x2104ec=resolve(_0x461acf,METADATA_FILE),_0x4a4cf8=contentHash(_0x24a5cd),_0xbc3050=readMetadataIfPresent(_0x2104ec)?.[_0x3c8339(0xae)];ensurePulledFilesCanBeOverwritten(_0x461acf,_0x2104ec,_0x2387ee,_0x2de511['force']===!![]),mkdirSync(_0x461acf,{'recursive':!![],'mode':0x1c0});const _0x7823c6=existsSync(_0x3fcc4c)?readFileSync(_0x3fcc4c,'utf8'):undefined;return materializeFiles(_0x461acf,_0x2387ee),removeStaleManagedFiles(_0x461acf,_0xbc3050,_0x2387ee),writeJsonAtomic(_0x2104ec,buildMetadata(_0x5ebc20,_0x4c7d4e,_0x2de511[_0x3c8339(0x99)],_0x4a4cf8,_0x2de511[_0x3c8339(0xb0)],_0x2387ee,_0x1e01ad)),{'skill':_0x5ebc20,'scope':_0x4c7d4e,'dir':_0x461acf,'skillMdPath':_0x3fcc4c,'metadataPath':_0x2104ec,'contentHash':_0x4a4cf8,'changed':_0x7823c6!==_0x24a5cd};}export function reuseMaterializedRuntimeSkill(_0x6d670c,_0x3db7e9,_0x5206d3){const _0x48474f=a161_0xb29a,_0x32fe34=_0x6d670c[_0x48474f(0xba)]?.[_0x48474f(0xb6)]();if(!_0x32fe34)return undefined;const _0x546d23=requireSkillCode(_0x6d670c),_0x32542b=getRuntimeSkillDir(_0x5206d3[_0x48474f(0x87)],_0x5206d3[_0x48474f(0x84)],_0x5206d3[_0x48474f(0x99)],_0x3db7e9,_0x546d23,_0x5206d3[_0x48474f(0x7b)]),_0x5ab154=resolve(_0x32542b,SKILL_FILE),_0x2f4ffd=resolve(_0x32542b,METADATA_FILE),_0x160f6e=readMetadataIfPresent(_0x2f4ffd);if(!_0x160f6e||_0x160f6e[_0x48474f(0xa6)]!==0x2||_0x160f6e['appCode']!==_0x5206d3[_0x48474f(0x99)]||_0x160f6e[_0x48474f(0x82)]!==_0x3db7e9||_0x160f6e[_0x48474f(0xab)]!==_0x546d23||_0x160f6e['version']!==_0x32fe34||_0x160f6e['id']!==_0x6d670c['id']||_0x160f6e['skillName']!==_0x6d670c[_0x48474f(0x8b)]||_0x160f6e['description']!==_0x6d670c[_0x48474f(0xa2)]||_0x160f6e[_0x48474f(0x91)]!==_0x6d670c[_0x48474f(0x91)]||_0x160f6e['status']!==_0x6d670c['status']||!_0x160f6e[_0x48474f(0x8e)]||!_0x160f6e[_0x48474f(0xae)]||!Object[_0x48474f(0xa8)](_0x160f6e['fileHashes'],SKILL_FILE))return undefined;for(const [_0x3a9914,_0x370041]of Object[_0x48474f(0x94)](_0x160f6e[_0x48474f(0xae)])){if(!/^[a-f0-9]{64}$/[_0x48474f(0x98)](_0x370041))return undefined;const _0x402fda=resolveManagedFilePath(_0x32542b,_0x3a9914);if(!existsSync(_0x402fda)||!lstatSync(_0x402fda)['isFile']())return undefined;if(bufferSha256(readFileSync(_0x402fda))!==_0x370041)return undefined;}return{'skill':_0x6d670c,'scope':_0x3db7e9,'dir':_0x32542b,'skillMdPath':_0x5ab154,'metadataPath':_0x2f4ffd,'contentHash':_0x160f6e[_0x48474f(0x8e)],'changed':![]};}function withMaterializedSkillFrontmatter(_0x10c495,_0x46f61b,_0x3ed9fe){const _0x486322=a161_0xb29a,_0x10d7c3=skillDisplayName(_0x46f61b,_0x3ed9fe),_0x43a0a4=_0x46f61b['description']?.[_0x486322(0xb6)]()||_0x10d7c3||_0x3ed9fe;return normalizeLocalFiles(_0x10c495)[_0x486322(0xb1)](_0x5cb338=>{const _0x520bb8=_0x486322,_0x54a795=fileText(_0x5cb338);if(_0x5cb338[_0x520bb8(0xb3)]!==SKILL_FILE)return _0x5cb338;if(hasYamlFrontmatter(_0x54a795))return{'path':_0x5cb338['path'],'content':withSyncedDisplayName(_0x54a795,_0x10d7c3)};return{'path':_0x5cb338[_0x520bb8(0xb3)],'content':prependSkillFrontmatter(_0x54a795,{'name':_0x3ed9fe,'displayName':_0x10d7c3,'description':_0x43a0a4})};});}function hasYamlFrontmatter(_0x31b313){return/^\uFEFF?---\s*\r?\n/['test'](_0x31b313);}function prependSkillFrontmatter(_0x49558c,_0x48b732){const _0xb55de3=a161_0xb29a,_0x2eed37=_0x49558c[_0xb55de3(0x8a)](/^\uFEFF/,'');return[_0xb55de3(0x95),_0xb55de3(0x89)+yamlString(_0x48b732[_0xb55de3(0x79)]),_0x48b732[_0xb55de3(0xa7)]?_0xb55de3(0xb9)+yamlString(_0x48b732['displayName']):undefined,_0xb55de3(0x93)+yamlString(_0x48b732[_0xb55de3(0xa2)]),_0xb55de3(0x95),'',_0x2eed37][_0xb55de3(0xa3)](_0x4bc7f0=>_0x4bc7f0!==undefined)[_0xb55de3(0xb7)]('\x0a');}function yamlString(_0x55c828){const _0x366f78=a161_0xb29a;return JSON[_0x366f78(0x90)](_0x55c828['replace'](/\r/g,'')[_0x366f78(0xb6)]());}function skillDisplayName(_0x230dfc,_0x52f2e5){const _0x31504e=a161_0xb29a,_0x1ce366=_0x230dfc[_0x31504e(0x8b)]?.[_0x31504e(0xb6)]();return _0x1ce366||_0x52f2e5;}function withSyncedDisplayName(_0x4fa477,_0x2d5e5b){const _0xdafddf=a161_0xb29a,_0x1ebeed=_0x4fa477[_0xdafddf(0xa5)](/^(\uFEFF?)---\s*\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);if(!_0x1ebeed)return _0x4fa477;const _0x4341ba=_0x1ebeed[0x1]??'',_0x1eda1a=_0x1ebeed[0x2]??'',_0x3b68b3=parseDocument(_0x1eda1a);if(_0x3b68b3['errors'][_0xdafddf(0xaa)]>0x0||!isMap(_0x3b68b3[_0xdafddf(0x92)]))return _0x4fa477;if(_0x2d5e5b)_0x3b68b3[_0xdafddf(0xb8)](_0xdafddf(0xa7),_0x2d5e5b);else{if(_0x3b68b3['has'](_0xdafddf(0xa7)))_0x3b68b3[_0xdafddf(0x7c)](_0xdafddf(0xa7));else return _0x4fa477;}forceBlockCollections(_0x3b68b3[_0xdafddf(0x92)]);const _0x287b64=_0x3b68b3[_0xdafddf(0xac)]({'lineWidth':0x0})[_0xdafddf(0x8f)](),_0x882aa3=_0x4fa477['slice'](_0x1ebeed[0x0][_0xdafddf(0xaa)])[_0xdafddf(0x8a)](/^\r?\n/,'');return _0x4341ba+_0xdafddf(0x83)+_0x287b64+_0xdafddf(0x9a)+_0x882aa3;}function forceBlockCollections(_0x122343){if(!isNode(_0x122343))return;visit(_0x122343,(_0x11f36c,_0x28494b)=>{const _0x2d0dec=a161_0xb29a;isCollection(_0x28494b)&&(_0x28494b[_0x2d0dec(0xa1)]=![]);});}function ensurePulledFilesCanBeOverwritten(_0xa8dccd,_0x439757,_0x4baa15,_0x1723c7){const _0x351a80=a161_0xb29a;if(_0x1723c7||!existsSync(_0x439757))return;const _0x325780=readMetadataIfPresent(_0x439757);if(!_0x325780)return;const _0x2bf12d=_0x325780['fileHashes']&&Object[_0x351a80(0x88)](_0x325780[_0x351a80(0xae)])[_0x351a80(0xaa)]>0x0?_0x325780[_0x351a80(0xae)]:undefined;if(_0x2bf12d)for(const [_0x1c3fbb,_0x353f97]of Object['entries'](_0x2bf12d)){const _0x2ae668=resolveManagedFilePath(_0xa8dccd,_0x1c3fbb);if(!existsSync(_0x2ae668))throw CliErrors['validation'](_0x351a80(0xa0)+_0xa8dccd,'Managed\x20file\x20was\x20removed\x20locally:\x20'+_0x1c3fbb);const _0x27fbf7=lstatSync(_0x2ae668);if(!_0x27fbf7[_0x351a80(0x81)]())throw CliErrors[_0x351a80(0x97)](_0x351a80(0xa0)+_0xa8dccd,_0x351a80(0x7e)+_0x1c3fbb);const _0x18fb10=bufferSha256(readFileSync(_0x2ae668));if(_0x18fb10!==_0x353f97)throw CliErrors[_0x351a80(0x97)](_0x351a80(0xa0)+_0xa8dccd+_0x351a80(0x7a)+_0x1c3fbb,_0x351a80(0xad)+_0x1c3fbb);}else{const _0x5f2322=resolve(_0xa8dccd,SKILL_FILE);if(existsSync(_0x5f2322)&&_0x325780[_0x351a80(0x8e)]){const _0x5b77c5=contentHash(readFileSync(_0x5f2322,_0x351a80(0x9f)));if(_0x5b77c5!==_0x325780['contentHash'])throw CliErrors[_0x351a80(0x97)](_0x351a80(0x8c)+_0x5f2322,_0x351a80(0xb5));}}for(const _0x2a7b12 of normalizeLocalFiles(_0x4baa15)){if(_0x2bf12d?.[_0x2a7b12[_0x351a80(0xb3)]])continue;if(!_0x2bf12d&&_0x2a7b12[_0x351a80(0xb3)]===SKILL_FILE)continue;const _0xae403c=resolveManagedFilePath(_0xa8dccd,_0x2a7b12[_0x351a80(0xb3)]);if(!existsSync(_0xae403c))continue;const _0x3095fe=lstatSync(_0xae403c);if(!_0x3095fe['isFile']())throw CliErrors['validation'](_0x351a80(0xa0)+_0xa8dccd,_0x351a80(0xb4)+_0x2a7b12[_0x351a80(0xb3)]);const _0x2ee698=bufferSha256(readFileSync(_0xae403c));if(_0x2ee698!==fileHash(_0x2a7b12))throw CliErrors[_0x351a80(0x97)](_0x351a80(0xa0)+_0xa8dccd,_0x351a80(0x7f)+_0x2a7b12[_0x351a80(0xb3)]);}}function materializeFiles(_0x57e371,_0x2055ce){for(const _0x308793 of normalizeLocalFiles(_0x2055ce)){const _0x59c526=resolveManagedFilePath(_0x57e371,_0x308793['path']);mkdirSync(dirname(_0x59c526),{'recursive':!![],'mode':0x1c0}),writeBytesAtomic(_0x59c526,fileContent(_0x308793),0x180);}}function removeStaleManagedFiles(_0x12e8fb,_0x12aa67,_0x8c35ba){const _0x205448=a161_0xb29a;if(!_0x12aa67)return;const _0x58d350=new Set(normalizeLocalFiles(_0x8c35ba)['map'](_0x3b33ba=>_0x3b33ba['path']));for(const _0x54f919 of Object[_0x205448(0x88)](_0x12aa67)){if(_0x58d350[_0x205448(0x8d)](_0x54f919))continue;const _0x59fe8f=resolveManagedFilePath(_0x12e8fb,_0x54f919);existsSync(_0x59fe8f)&&lstatSync(_0x59fe8f)[_0x205448(0x81)]()&&rmSync(_0x59fe8f,{'force':!![]});}}