@namzu/cli 34.1.1 → 36.0.0

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 (1306) hide show
  1. package/CHANGELOG.md +800 -0
  2. package/README.md +160 -394
  3. package/assets/pal-blender-mcp.py +123 -0
  4. package/assets/pal-godot-mcp-pin.json +135 -0
  5. package/assets/pal-godot-mcp.cjs +418 -0
  6. package/dist/bin-main.d.ts +3 -0
  7. package/dist/bin-main.d.ts.map +1 -0
  8. package/dist/bin.d.ts +2 -1
  9. package/dist/bin.d.ts.map +1 -1
  10. package/dist/bin.js +85 -23
  11. package/dist/bin.js.map +6 -1
  12. package/dist/boot-narrative.d.ts +16 -0
  13. package/dist/boot-narrative.d.ts.map +1 -0
  14. package/dist/checkpoints/manifest.d.ts +107 -0
  15. package/dist/checkpoints/manifest.d.ts.map +1 -0
  16. package/dist/checkpoints/store.d.ts +280 -40
  17. package/dist/checkpoints/store.d.ts.map +1 -1
  18. package/dist/checkpoints/undo-plan.d.ts +83 -0
  19. package/dist/checkpoints/undo-plan.d.ts.map +1 -0
  20. package/dist/checkpoints/wrap.d.ts +4 -0
  21. package/dist/checkpoints/wrap.d.ts.map +1 -1
  22. package/dist/chunks/acp-BOSEA4R3.js +13448 -0
  23. package/dist/chunks/acp-BOSEA4R3.js.map +6 -0
  24. package/dist/chunks/activity-command-ACS7KL3C.js +262 -0
  25. package/dist/chunks/activity-command-ACS7KL3C.js.map +6 -0
  26. package/dist/chunks/add-DLS54YKS.js +712 -0
  27. package/dist/chunks/add-DLS54YKS.js.map +6 -0
  28. package/dist/chunks/agent-GV3DWYQC.js +87 -0
  29. package/dist/chunks/agent-GV3DWYQC.js.map +6 -0
  30. package/dist/chunks/agent-session-7VE6GJJH.js +46 -0
  31. package/dist/chunks/agent-session-7VE6GJJH.js.map +6 -0
  32. package/dist/chunks/archive-6ZENIEBP.js +84 -0
  33. package/dist/chunks/archive-6ZENIEBP.js.map +6 -0
  34. package/dist/chunks/bin-main-NFFT5ZIU.js +126 -0
  35. package/dist/chunks/bin-main-NFFT5ZIU.js.map +6 -0
  36. package/dist/chunks/browser-VT2U6NG2.js +31 -0
  37. package/dist/chunks/browser-VT2U6NG2.js.map +6 -0
  38. package/dist/chunks/chat-UNYVLDFL.js +101 -0
  39. package/dist/chunks/chat-UNYVLDFL.js.map +6 -0
  40. package/dist/chunks/chunk-2IL6OG3X.js +311 -0
  41. package/dist/chunks/chunk-2IL6OG3X.js.map +6 -0
  42. package/dist/chunks/chunk-2RBYHHLM.js +319 -0
  43. package/dist/chunks/chunk-2RBYHHLM.js.map +6 -0
  44. package/dist/chunks/chunk-42ZK2AH4.js +71 -0
  45. package/dist/chunks/chunk-42ZK2AH4.js.map +6 -0
  46. package/dist/chunks/chunk-5PQVJBIO.js +168 -0
  47. package/dist/chunks/chunk-5PQVJBIO.js.map +6 -0
  48. package/dist/chunks/chunk-6CPT2ZBS.js +75 -0
  49. package/dist/chunks/chunk-6CPT2ZBS.js.map +6 -0
  50. package/dist/chunks/chunk-6LLJQ3KY.js +225 -0
  51. package/dist/chunks/chunk-6LLJQ3KY.js.map +6 -0
  52. package/dist/chunks/chunk-6YFJDVGA.js +161 -0
  53. package/dist/chunks/chunk-6YFJDVGA.js.map +6 -0
  54. package/dist/chunks/chunk-6YG7D7U4.js +159 -0
  55. package/dist/chunks/chunk-6YG7D7U4.js.map +6 -0
  56. package/dist/chunks/chunk-6ZPODOJN.js +828 -0
  57. package/dist/chunks/chunk-6ZPODOJN.js.map +6 -0
  58. package/dist/chunks/chunk-76FLAFCG.js +51 -0
  59. package/dist/chunks/chunk-76FLAFCG.js.map +6 -0
  60. package/dist/chunks/chunk-7HCPD673.js +25326 -0
  61. package/dist/chunks/chunk-7HCPD673.js.map +6 -0
  62. package/dist/chunks/chunk-7KWGR2YA.js +257 -0
  63. package/dist/chunks/chunk-7KWGR2YA.js.map +6 -0
  64. package/dist/chunks/chunk-A22MBIYU.js +42 -0
  65. package/dist/chunks/chunk-A22MBIYU.js.map +6 -0
  66. package/dist/chunks/chunk-AHIDYIRB.js +329 -0
  67. package/dist/chunks/chunk-AHIDYIRB.js.map +6 -0
  68. package/dist/chunks/chunk-AK2U3N2A.js +31 -0
  69. package/dist/chunks/chunk-AK2U3N2A.js.map +6 -0
  70. package/dist/chunks/chunk-AKKRZTPB.js +283 -0
  71. package/dist/chunks/chunk-AKKRZTPB.js.map +6 -0
  72. package/dist/chunks/chunk-BCZR2B3Y.js +97 -0
  73. package/dist/chunks/chunk-BCZR2B3Y.js.map +6 -0
  74. package/dist/chunks/chunk-CHIEVVQ2.js +32 -0
  75. package/dist/chunks/chunk-CHIEVVQ2.js.map +6 -0
  76. package/dist/chunks/chunk-D67YBUO3.js +110 -0
  77. package/dist/chunks/chunk-D67YBUO3.js.map +6 -0
  78. package/dist/chunks/chunk-DIHEHK7K.js +765 -0
  79. package/dist/chunks/chunk-DIHEHK7K.js.map +6 -0
  80. package/dist/chunks/chunk-E5VLANCO.js +101 -0
  81. package/dist/chunks/chunk-E5VLANCO.js.map +6 -0
  82. package/dist/chunks/chunk-EEDZOGV4.js +47 -0
  83. package/dist/chunks/chunk-EEDZOGV4.js.map +6 -0
  84. package/dist/chunks/chunk-ENGNEELC.js +271 -0
  85. package/dist/chunks/chunk-ENGNEELC.js.map +6 -0
  86. package/dist/chunks/chunk-EVY4MVRE.js +74 -0
  87. package/dist/chunks/chunk-EVY4MVRE.js.map +6 -0
  88. package/dist/chunks/chunk-FJNDNNNQ.js +115 -0
  89. package/dist/chunks/chunk-FJNDNNNQ.js.map +6 -0
  90. package/dist/chunks/chunk-FOFGMP7O.js +20 -0
  91. package/dist/chunks/chunk-FOFGMP7O.js.map +6 -0
  92. package/dist/chunks/chunk-FTMTO72X.js +95 -0
  93. package/dist/chunks/chunk-FTMTO72X.js.map +6 -0
  94. package/dist/chunks/chunk-GIXSS6KW.js +2228 -0
  95. package/dist/chunks/chunk-GIXSS6KW.js.map +6 -0
  96. package/dist/chunks/chunk-GNBMKISG.js +19 -0
  97. package/dist/chunks/chunk-GNBMKISG.js.map +6 -0
  98. package/dist/chunks/chunk-GWQEMJFS.js +28 -0
  99. package/dist/chunks/chunk-GWQEMJFS.js.map +6 -0
  100. package/dist/chunks/chunk-H6B6AROX.js +151 -0
  101. package/dist/chunks/chunk-H6B6AROX.js.map +6 -0
  102. package/dist/chunks/chunk-HE7WUOX2.js +26 -0
  103. package/dist/chunks/chunk-HE7WUOX2.js.map +6 -0
  104. package/dist/chunks/chunk-HZBKWL42.js +303 -0
  105. package/dist/chunks/chunk-HZBKWL42.js.map +6 -0
  106. package/dist/chunks/chunk-I7HQR6ET.js +75 -0
  107. package/dist/chunks/chunk-I7HQR6ET.js.map +6 -0
  108. package/dist/chunks/chunk-IJEB77SH.js +648 -0
  109. package/dist/chunks/chunk-IJEB77SH.js.map +6 -0
  110. package/dist/chunks/chunk-JNPDWME5.js +675 -0
  111. package/dist/chunks/chunk-JNPDWME5.js.map +6 -0
  112. package/dist/chunks/chunk-JORONMD3.js +18 -0
  113. package/dist/chunks/chunk-JORONMD3.js.map +6 -0
  114. package/dist/chunks/chunk-JV3LONAU.js +76 -0
  115. package/dist/chunks/chunk-JV3LONAU.js.map +6 -0
  116. package/dist/chunks/chunk-K5HARZ7G.js +82516 -0
  117. package/dist/chunks/chunk-K5HARZ7G.js.map +6 -0
  118. package/dist/chunks/chunk-KONYGNG6.js +7661 -0
  119. package/dist/chunks/chunk-KONYGNG6.js.map +6 -0
  120. package/dist/chunks/chunk-LXB3S4IC.js +19 -0
  121. package/dist/chunks/chunk-LXB3S4IC.js.map +6 -0
  122. package/dist/chunks/chunk-M3IAMIBJ.js +661 -0
  123. package/dist/chunks/chunk-M3IAMIBJ.js.map +6 -0
  124. package/dist/chunks/chunk-MH6KUKVV.js +1142 -0
  125. package/dist/chunks/chunk-MH6KUKVV.js.map +6 -0
  126. package/dist/chunks/chunk-MS3IYQ72.js +1479 -0
  127. package/dist/chunks/chunk-MS3IYQ72.js.map +6 -0
  128. package/dist/chunks/chunk-MZP6SH3M.js +3497 -0
  129. package/dist/chunks/chunk-MZP6SH3M.js.map +6 -0
  130. package/dist/chunks/chunk-N3ZEXVSS.js +76 -0
  131. package/dist/chunks/chunk-N3ZEXVSS.js.map +6 -0
  132. package/dist/chunks/chunk-N6SR54VC.js +207 -0
  133. package/dist/chunks/chunk-N6SR54VC.js.map +6 -0
  134. package/dist/chunks/chunk-NADQQMMG.js +46 -0
  135. package/dist/chunks/chunk-NADQQMMG.js.map +6 -0
  136. package/dist/chunks/chunk-NBH52WHS.js +247 -0
  137. package/dist/chunks/chunk-NBH52WHS.js.map +6 -0
  138. package/dist/chunks/chunk-NICLKFBG.js +109 -0
  139. package/dist/chunks/chunk-NICLKFBG.js.map +6 -0
  140. package/dist/chunks/chunk-NIPHHZ5G.js +283 -0
  141. package/dist/chunks/chunk-NIPHHZ5G.js.map +6 -0
  142. package/dist/chunks/chunk-NQT244I2.js +517 -0
  143. package/dist/chunks/chunk-NQT244I2.js.map +6 -0
  144. package/dist/chunks/chunk-NUGPLXVK.js +228 -0
  145. package/dist/chunks/chunk-NUGPLXVK.js.map +6 -0
  146. package/dist/chunks/chunk-OEW7CJKK.js +140 -0
  147. package/dist/chunks/chunk-OEW7CJKK.js.map +6 -0
  148. package/dist/chunks/chunk-OH6TB27S.js +111 -0
  149. package/dist/chunks/chunk-OH6TB27S.js.map +6 -0
  150. package/dist/chunks/chunk-OWH6QQY2.js +1858 -0
  151. package/dist/chunks/chunk-OWH6QQY2.js.map +6 -0
  152. package/dist/chunks/chunk-OWXJOD4H.js +773 -0
  153. package/dist/chunks/chunk-OWXJOD4H.js.map +6 -0
  154. package/dist/chunks/chunk-PT537V7B.js +787 -0
  155. package/dist/chunks/chunk-PT537V7B.js.map +6 -0
  156. package/dist/chunks/chunk-QEQZFG2X.js +106 -0
  157. package/dist/chunks/chunk-QEQZFG2X.js.map +6 -0
  158. package/dist/chunks/chunk-QL4O4UGZ.js +245 -0
  159. package/dist/chunks/chunk-QL4O4UGZ.js.map +6 -0
  160. package/dist/chunks/chunk-QL54XCF4.js +73 -0
  161. package/dist/chunks/chunk-QL54XCF4.js.map +6 -0
  162. package/dist/chunks/chunk-SB6UD3ED.js +1355 -0
  163. package/dist/chunks/chunk-SB6UD3ED.js.map +6 -0
  164. package/dist/chunks/chunk-SGGRGKGV.js +34 -0
  165. package/dist/chunks/chunk-SGGRGKGV.js.map +6 -0
  166. package/dist/chunks/chunk-SKKWMMFP.js +474 -0
  167. package/dist/chunks/chunk-SKKWMMFP.js.map +6 -0
  168. package/dist/chunks/chunk-SMIDV4KH.js +171 -0
  169. package/dist/chunks/chunk-SMIDV4KH.js.map +6 -0
  170. package/dist/chunks/chunk-T2VUTAHB.js +46 -0
  171. package/dist/chunks/chunk-T2VUTAHB.js.map +6 -0
  172. package/dist/chunks/chunk-T4SB6AAF.js +134 -0
  173. package/dist/chunks/chunk-T4SB6AAF.js.map +6 -0
  174. package/dist/chunks/chunk-TBIX6JRE.js +24 -0
  175. package/dist/chunks/chunk-TBIX6JRE.js.map +6 -0
  176. package/dist/chunks/chunk-THNCQJ33.js +11265 -0
  177. package/dist/chunks/chunk-THNCQJ33.js.map +6 -0
  178. package/dist/chunks/chunk-U56QFYGA.js +818 -0
  179. package/dist/chunks/chunk-U56QFYGA.js.map +6 -0
  180. package/dist/chunks/chunk-U6GZ7EW4.js +106 -0
  181. package/dist/chunks/chunk-U6GZ7EW4.js.map +6 -0
  182. package/dist/chunks/chunk-UDDSFIMB.js +1373 -0
  183. package/dist/chunks/chunk-UDDSFIMB.js.map +6 -0
  184. package/dist/chunks/chunk-UFHNXZL2.js +399 -0
  185. package/dist/chunks/chunk-UFHNXZL2.js.map +6 -0
  186. package/dist/chunks/chunk-US5ZFPAU.js +400 -0
  187. package/dist/chunks/chunk-US5ZFPAU.js.map +6 -0
  188. package/dist/chunks/chunk-VRL2WNQN.js +7534 -0
  189. package/dist/chunks/chunk-VRL2WNQN.js.map +6 -0
  190. package/dist/chunks/chunk-W3UQMRYA.js +380 -0
  191. package/dist/chunks/chunk-W3UQMRYA.js.map +6 -0
  192. package/dist/chunks/chunk-W5KGCUP3.js +11111 -0
  193. package/dist/chunks/chunk-W5KGCUP3.js.map +6 -0
  194. package/dist/chunks/chunk-WHODOMXA.js +132 -0
  195. package/dist/chunks/chunk-WHODOMXA.js.map +6 -0
  196. package/dist/chunks/chunk-WT6TFCPV.js +154 -0
  197. package/dist/chunks/chunk-WT6TFCPV.js.map +6 -0
  198. package/dist/chunks/chunk-WY2WUTFR.js +164 -0
  199. package/dist/chunks/chunk-WY2WUTFR.js.map +6 -0
  200. package/dist/chunks/chunk-XEUQN4JC.js +54 -0
  201. package/dist/chunks/chunk-XEUQN4JC.js.map +6 -0
  202. package/dist/chunks/chunk-Y7B67G22.js +26 -0
  203. package/dist/chunks/chunk-Y7B67G22.js.map +6 -0
  204. package/dist/chunks/chunk-YEMJX2DS.js +69 -0
  205. package/dist/chunks/chunk-YEMJX2DS.js.map +6 -0
  206. package/dist/chunks/chunk-YKLKHDZU.js +2953 -0
  207. package/dist/chunks/chunk-YKLKHDZU.js.map +6 -0
  208. package/dist/chunks/chunk-YQEWD2EN.js +127 -0
  209. package/dist/chunks/chunk-YQEWD2EN.js.map +6 -0
  210. package/dist/chunks/chunk-YYQJIECC.js +1439 -0
  211. package/dist/chunks/chunk-YYQJIECC.js.map +6 -0
  212. package/dist/chunks/chunk-ZKVZNOUS.js +106 -0
  213. package/dist/chunks/chunk-ZKVZNOUS.js.map +6 -0
  214. package/dist/chunks/chunk-ZPR4IMRT.js +36 -0
  215. package/dist/chunks/chunk-ZPR4IMRT.js.map +6 -0
  216. package/dist/chunks/chunk-ZWA2JRJV.js +45 -0
  217. package/dist/chunks/chunk-ZWA2JRJV.js.map +6 -0
  218. package/dist/chunks/cli-runtime-F4MBZ2UQ.js +129 -0
  219. package/dist/chunks/cli-runtime-F4MBZ2UQ.js.map +6 -0
  220. package/dist/chunks/commands-GMQGFTIY.js +21 -0
  221. package/dist/chunks/commands-GMQGFTIY.js.map +6 -0
  222. package/dist/chunks/computer-GXDY4H35.js +493 -0
  223. package/dist/chunks/computer-GXDY4H35.js.map +6 -0
  224. package/dist/chunks/crash-report-STOHSORG.js +21 -0
  225. package/dist/chunks/crash-report-STOHSORG.js.map +6 -0
  226. package/dist/chunks/devtools-LBE4PAQN.js +3851 -0
  227. package/dist/chunks/devtools-LBE4PAQN.js.map +6 -0
  228. package/dist/chunks/dist-3AF2X4S5.js +1339 -0
  229. package/dist/chunks/dist-3AF2X4S5.js.map +6 -0
  230. package/dist/chunks/dist-AZIMHV2B.js +514 -0
  231. package/dist/chunks/dist-AZIMHV2B.js.map +6 -0
  232. package/dist/chunks/dist-BGYRQ5BC.js +555 -0
  233. package/dist/chunks/dist-BGYRQ5BC.js.map +6 -0
  234. package/dist/chunks/dist-OTTZ7WVD.js +1415 -0
  235. package/dist/chunks/dist-OTTZ7WVD.js.map +6 -0
  236. package/dist/chunks/dist-R3I3ATSG.js +1018 -0
  237. package/dist/chunks/dist-R3I3ATSG.js.map +6 -0
  238. package/dist/chunks/dist-TXEKDBQO.js +40642 -0
  239. package/dist/chunks/dist-TXEKDBQO.js.map +6 -0
  240. package/dist/chunks/dist-XTWYQHHN.js +520 -0
  241. package/dist/chunks/dist-XTWYQHHN.js.map +6 -0
  242. package/dist/chunks/doctor-VXSB4Y4P.js +28 -0
  243. package/dist/chunks/doctor-VXSB4Y4P.js.map +6 -0
  244. package/dist/chunks/drain-DXVICQBR.js +471 -0
  245. package/dist/chunks/drain-DXVICQBR.js.map +6 -0
  246. package/dist/chunks/endpoint-M2DDENPP.js +15 -0
  247. package/dist/chunks/endpoint-M2DDENPP.js.map +6 -0
  248. package/dist/chunks/eval-BMJQXDKA.js +187 -0
  249. package/dist/chunks/eval-BMJQXDKA.js.map +6 -0
  250. package/dist/chunks/exec-3T5ESZPH.js +1284 -0
  251. package/dist/chunks/exec-3T5ESZPH.js.map +6 -0
  252. package/dist/chunks/home-ILHA7B6Z.js +16 -0
  253. package/dist/chunks/home-ILHA7B6Z.js.map +6 -0
  254. package/dist/chunks/host-queries-QCMWDZGS.js +152 -0
  255. package/dist/chunks/host-queries-QCMWDZGS.js.map +6 -0
  256. package/dist/chunks/lib-KXZZJJG2.js +2657 -0
  257. package/dist/chunks/lib-KXZZJJG2.js.map +6 -0
  258. package/dist/chunks/lifecycle-CB23VJI7.js +63 -0
  259. package/dist/chunks/lifecycle-CB23VJI7.js.map +6 -0
  260. package/dist/chunks/list-N6WXZBMD.js +293 -0
  261. package/dist/chunks/list-N6WXZBMD.js.map +6 -0
  262. package/dist/chunks/login-26NCG6EQ.js +29 -0
  263. package/dist/chunks/login-26NCG6EQ.js.map +6 -0
  264. package/dist/chunks/logs-V7SNM7LA.js +116 -0
  265. package/dist/chunks/logs-V7SNM7LA.js.map +6 -0
  266. package/dist/chunks/mcp-BTHCU5ZC.js +763 -0
  267. package/dist/chunks/mcp-BTHCU5ZC.js.map +6 -0
  268. package/dist/chunks/message-command-HMIOR52C.js +170 -0
  269. package/dist/chunks/message-command-HMIOR52C.js.map +6 -0
  270. package/dist/chunks/node-QB2FA2ZB.js +916 -0
  271. package/dist/chunks/node-QB2FA2ZB.js.map +6 -0
  272. package/dist/chunks/operator-tools-7LMWOHSN.js +115 -0
  273. package/dist/chunks/operator-tools-7LMWOHSN.js.map +6 -0
  274. package/dist/chunks/output-schema-XCONYVZ7.js +11 -0
  275. package/dist/chunks/output-schema-XCONYVZ7.js.map +6 -0
  276. package/dist/chunks/pal-YEUKHA6F.js +200 -0
  277. package/dist/chunks/pal-YEUKHA6F.js.map +6 -0
  278. package/dist/chunks/paths-DXYFKIJU.js +10 -0
  279. package/dist/chunks/paths-DXYFKIJU.js.map +6 -0
  280. package/dist/chunks/pica-WNHDDIFX.js +1736 -0
  281. package/dist/chunks/pica-WNHDDIFX.js.map +6 -0
  282. package/dist/chunks/providers-EI3FAKYB.js +160 -0
  283. package/dist/chunks/providers-EI3FAKYB.js.map +6 -0
  284. package/dist/chunks/resident-5ZY6OG6B.js +1314 -0
  285. package/dist/chunks/resident-5ZY6OG6B.js.map +6 -0
  286. package/dist/chunks/resume-command-ONYRZIIA.js +22 -0
  287. package/dist/chunks/resume-command-ONYRZIIA.js.map +6 -0
  288. package/dist/chunks/schedule-6JPEO4NR.js +143 -0
  289. package/dist/chunks/schedule-6JPEO4NR.js.map +6 -0
  290. package/dist/chunks/serve-S7UWNIR3.js +21 -0
  291. package/dist/chunks/serve-S7UWNIR3.js.map +6 -0
  292. package/dist/chunks/service-WSW3M6K5.js +1633 -0
  293. package/dist/chunks/service-WSW3M6K5.js.map +6 -0
  294. package/dist/chunks/session-step-2VZM3CCA.js +26 -0
  295. package/dist/chunks/session-step-2VZM3CCA.js.map +6 -0
  296. package/dist/chunks/skills-KAZJYGX5.js +282 -0
  297. package/dist/chunks/skills-KAZJYGX5.js.map +6 -0
  298. package/dist/chunks/state-263OUKQA.js +717 -0
  299. package/dist/chunks/state-263OUKQA.js.map +6 -0
  300. package/dist/chunks/store-3XLCJ7EL.js +42 -0
  301. package/dist/chunks/store-3XLCJ7EL.js.map +6 -0
  302. package/dist/chunks/store-KN65QI2M.js +82 -0
  303. package/dist/chunks/store-KN65QI2M.js.map +6 -0
  304. package/dist/chunks/store-X3TESBIN.js +34 -0
  305. package/dist/chunks/store-X3TESBIN.js.map +6 -0
  306. package/dist/chunks/tui-5MU7JBXX.js +56703 -0
  307. package/dist/chunks/tui-5MU7JBXX.js.map +6 -0
  308. package/dist/chunks/upgrade-BYM4MWBC.js +315 -0
  309. package/dist/chunks/upgrade-BYM4MWBC.js.map +6 -0
  310. package/dist/chunks/webapi-6HUHZUAH.js +2715 -0
  311. package/dist/chunks/webapi-6HUHZUAH.js.map +6 -0
  312. package/dist/chunks/worktree-K3ZIPXRM.js +116 -0
  313. package/dist/chunks/worktree-K3ZIPXRM.js.map +6 -0
  314. package/dist/cli-runtime.d.ts +19 -0
  315. package/dist/cli-runtime.d.ts.map +1 -0
  316. package/dist/cli.d.ts +0 -15
  317. package/dist/cli.d.ts.map +1 -1
  318. package/dist/commands/acp-harness.d.ts +64 -0
  319. package/dist/commands/acp-harness.d.ts.map +1 -0
  320. package/dist/commands/acp-provider-retry.d.ts +27 -0
  321. package/dist/commands/acp-provider-retry.d.ts.map +1 -0
  322. package/dist/commands/acp.d.ts +134 -3
  323. package/dist/commands/acp.d.ts.map +1 -1
  324. package/dist/commands/computer.d.ts +3 -0
  325. package/dist/commands/computer.d.ts.map +1 -0
  326. package/dist/commands/desktop-host-changes.d.ts +65 -0
  327. package/dist/commands/desktop-host-changes.d.ts.map +1 -0
  328. package/dist/commands/desktop-host-header.d.ts +30 -0
  329. package/dist/commands/desktop-host-header.d.ts.map +1 -0
  330. package/dist/commands/desktop-host.d.ts +354 -0
  331. package/dist/commands/desktop-host.d.ts.map +1 -0
  332. package/dist/commands/desktop-model-catalogue.d.ts +25 -0
  333. package/dist/commands/desktop-model-catalogue.d.ts.map +1 -0
  334. package/dist/commands/effort-levels.d.ts +3 -0
  335. package/dist/commands/effort-levels.d.ts.map +1 -0
  336. package/dist/commands/exec-flags.d.ts +4 -0
  337. package/dist/commands/exec-flags.d.ts.map +1 -1
  338. package/dist/commands/exec.d.ts.map +1 -1
  339. package/dist/commands/lazy.d.ts +20 -0
  340. package/dist/commands/lazy.d.ts.map +1 -0
  341. package/dist/commands/manifest.d.ts +33 -0
  342. package/dist/commands/manifest.d.ts.map +1 -0
  343. package/dist/commands/mcp.d.ts +3 -0
  344. package/dist/commands/mcp.d.ts.map +1 -1
  345. package/dist/commands/pal.d.ts +5 -0
  346. package/dist/commands/pal.d.ts.map +1 -0
  347. package/dist/commands/permission-preview.d.ts +38 -0
  348. package/dist/commands/permission-preview.d.ts.map +1 -0
  349. package/dist/commands/registry.d.ts +10 -0
  350. package/dist/commands/registry.d.ts.map +1 -1
  351. package/dist/commands/serve.d.ts +1 -12
  352. package/dist/commands/serve.d.ts.map +1 -1
  353. package/dist/commands/stdin.d.ts.map +1 -1
  354. package/dist/commands/upgrade.d.ts +14 -0
  355. package/dist/commands/upgrade.d.ts.map +1 -1
  356. package/dist/compile-cache-enable.d.ts +2 -0
  357. package/dist/compile-cache-enable.d.ts.map +1 -0
  358. package/dist/compile-cache.d.ts +53 -0
  359. package/dist/compile-cache.d.ts.map +1 -0
  360. package/dist/computer/bundle.d.ts +18 -0
  361. package/dist/computer/bundle.d.ts.map +1 -0
  362. package/dist/computer/run.d.ts +26 -0
  363. package/dist/computer/run.d.ts.map +1 -0
  364. package/dist/computer/sentences.d.ts +30 -0
  365. package/dist/computer/sentences.d.ts.map +1 -0
  366. package/dist/config/load.d.ts +10 -1
  367. package/dist/config/load.d.ts.map +1 -1
  368. package/dist/context/capabilities.d.ts +25 -2
  369. package/dist/context/capabilities.d.ts.map +1 -1
  370. package/dist/context/runtime-message.d.ts.map +1 -1
  371. package/dist/crash-report.d.ts +22 -0
  372. package/dist/crash-report.d.ts.map +1 -0
  373. package/dist/debug-requested.d.ts +7 -0
  374. package/dist/debug-requested.d.ts.map +1 -0
  375. package/dist/doctor/checks/credentials.d.ts.map +1 -1
  376. package/dist/exit-codes.d.ts +9 -1
  377. package/dist/exit-codes.d.ts.map +1 -1
  378. package/dist/index.js +105 -17
  379. package/dist/index.js.map +6 -1
  380. package/dist/integrations/harness/claude-adapter.d.ts +20 -0
  381. package/dist/integrations/harness/claude-adapter.d.ts.map +1 -0
  382. package/dist/integrations/harness/claude-protocol.d.ts +67 -0
  383. package/dist/integrations/harness/claude-protocol.d.ts.map +1 -0
  384. package/dist/integrations/harness/codex-adapter.d.ts +80 -0
  385. package/dist/integrations/harness/codex-adapter.d.ts.map +1 -0
  386. package/dist/integrations/harness/codex-protocol.d.ts +22 -0
  387. package/dist/integrations/harness/codex-protocol.d.ts.map +1 -0
  388. package/dist/integrations/harness/model-cache.d.ts +16 -0
  389. package/dist/integrations/harness/model-cache.d.ts.map +1 -0
  390. package/dist/integrations/harness/native-executable.d.ts +8 -0
  391. package/dist/integrations/harness/native-executable.d.ts.map +1 -0
  392. package/dist/integrations/harness/process.d.ts +25 -0
  393. package/dist/integrations/harness/process.d.ts.map +1 -0
  394. package/dist/integrations/mcp/servers.d.ts.map +1 -1
  395. package/dist/integrations/peers/runtime.d.ts +64 -0
  396. package/dist/integrations/peers/runtime.d.ts.map +1 -0
  397. package/dist/integrations/plugins/inventory.d.ts +27 -0
  398. package/dist/integrations/plugins/inventory.d.ts.map +1 -0
  399. package/dist/integrations/providers/composer-settings.d.ts +33 -0
  400. package/dist/integrations/providers/composer-settings.d.ts.map +1 -0
  401. package/dist/integrations/providers/connections.d.ts +37 -0
  402. package/dist/integrations/providers/connections.d.ts.map +1 -0
  403. package/dist/integrations/providers/credential-store.d.ts +35 -0
  404. package/dist/integrations/providers/credential-store.d.ts.map +1 -1
  405. package/dist/integrations/providers/discover.d.ts +27 -1
  406. package/dist/integrations/providers/discover.d.ts.map +1 -1
  407. package/dist/integrations/providers/index.d.ts +2 -2
  408. package/dist/integrations/providers/index.d.ts.map +1 -1
  409. package/dist/integrations/providers/picker-operation.d.ts +6 -0
  410. package/dist/integrations/providers/picker-operation.d.ts.map +1 -0
  411. package/dist/integrations/providers/setup.d.ts +16 -1
  412. package/dist/integrations/providers/setup.d.ts.map +1 -1
  413. package/dist/integrations/resident/runner-worker.js +190 -161
  414. package/dist/integrations/resident/runner-worker.js.map +6 -1
  415. package/dist/integrations/resident/session-step.d.ts.map +1 -1
  416. package/dist/integrations/sessions/display-title.d.ts +8 -0
  417. package/dist/integrations/sessions/display-title.d.ts.map +1 -1
  418. package/dist/integrations/sessions/store.d.ts +23 -9
  419. package/dist/integrations/sessions/store.d.ts.map +1 -1
  420. package/dist/integrations/sessions/task-context.d.ts +1 -1
  421. package/dist/integrations/sessions/task-context.d.ts.map +1 -1
  422. package/dist/integrations/sessions/transcript-export.d.ts.map +1 -1
  423. package/dist/integrations/subagents/activity.d.ts +9 -6
  424. package/dist/integrations/subagents/activity.d.ts.map +1 -1
  425. package/dist/integrations/subagents/operator-journal.d.ts +20 -0
  426. package/dist/integrations/subagents/operator-journal.d.ts.map +1 -0
  427. package/dist/integrations/subagents/runtime.d.ts +11 -0
  428. package/dist/integrations/subagents/runtime.d.ts.map +1 -1
  429. package/dist/integrations/trust/store.d.ts +14 -0
  430. package/dist/integrations/trust/store.d.ts.map +1 -1
  431. package/dist/integrations/web/search.d.ts +1 -1
  432. package/dist/pals/actions.d.ts +57 -0
  433. package/dist/pals/actions.d.ts.map +1 -0
  434. package/dist/pals/activity-command.d.ts +3 -0
  435. package/dist/pals/activity-command.d.ts.map +1 -0
  436. package/dist/pals/activity.d.ts +18 -0
  437. package/dist/pals/activity.d.ts.map +1 -0
  438. package/dist/pals/agent-session.d.ts +19 -0
  439. package/dist/pals/agent-session.d.ts.map +1 -0
  440. package/dist/pals/channel-actions.d.ts +5 -0
  441. package/dist/pals/channel-actions.d.ts.map +1 -0
  442. package/dist/pals/channel-local.d.ts +7 -0
  443. package/dist/pals/channel-local.d.ts.map +1 -0
  444. package/dist/pals/channel.d.ts +20 -0
  445. package/dist/pals/channel.d.ts.map +1 -0
  446. package/dist/pals/chat.d.ts +6 -0
  447. package/dist/pals/chat.d.ts.map +1 -0
  448. package/dist/pals/communication.d.ts +47 -0
  449. package/dist/pals/communication.d.ts.map +1 -0
  450. package/dist/pals/conversations.d.ts +26 -0
  451. package/dist/pals/conversations.d.ts.map +1 -0
  452. package/dist/pals/desktop-communication.d.ts +111 -0
  453. package/dist/pals/desktop-communication.d.ts.map +1 -0
  454. package/dist/pals/dispatch.d.ts +13 -0
  455. package/dist/pals/dispatch.d.ts.map +1 -0
  456. package/dist/pals/environment.d.ts +103 -0
  457. package/dist/pals/environment.d.ts.map +1 -0
  458. package/dist/pals/guest-mcp-transport.d.ts +28 -0
  459. package/dist/pals/guest-mcp-transport.d.ts.map +1 -0
  460. package/dist/pals/guest-mcp.d.ts +22 -0
  461. package/dist/pals/guest-mcp.d.ts.map +1 -0
  462. package/dist/pals/inbox-start.d.ts +35 -0
  463. package/dist/pals/inbox-start.d.ts.map +1 -0
  464. package/dist/pals/message-command.d.ts +3 -0
  465. package/dist/pals/message-command.d.ts.map +1 -0
  466. package/dist/pals/operator-tools.d.ts +23 -0
  467. package/dist/pals/operator-tools.d.ts.map +1 -0
  468. package/dist/pals/public-transcript.d.ts +4 -0
  469. package/dist/pals/public-transcript.d.ts.map +1 -0
  470. package/dist/pals/review.d.ts +16 -0
  471. package/dist/pals/review.d.ts.map +1 -0
  472. package/dist/pals/store.d.ts +16 -0
  473. package/dist/pals/store.d.ts.map +1 -0
  474. package/dist/pals/tui-session.d.ts +11 -0
  475. package/dist/pals/tui-session.d.ts.map +1 -0
  476. package/dist/permissions/mode-names.d.ts +2 -0
  477. package/dist/permissions/mode-names.d.ts.map +1 -0
  478. package/dist/resume-invocation.d.ts +1 -1
  479. package/dist/resume-invocation.d.ts.map +1 -1
  480. package/dist/resume-shell.d.ts +8 -0
  481. package/dist/resume-shell.d.ts.map +1 -0
  482. package/dist/schedule/build.d.ts +12 -3
  483. package/dist/schedule/build.d.ts.map +1 -1
  484. package/dist/schedule/commands/add.d.ts +1 -1
  485. package/dist/schedule/commands/add.d.ts.map +1 -1
  486. package/dist/schedule/commands/lifecycle.d.ts.map +1 -1
  487. package/dist/schedule/commands/list.d.ts +3 -1
  488. package/dist/schedule/commands/list.d.ts.map +1 -1
  489. package/dist/schedule/daemon/daemon.d.ts +2 -0
  490. package/dist/schedule/daemon/daemon.d.ts.map +1 -1
  491. package/dist/schedule/delivery.d.ts +66 -0
  492. package/dist/schedule/delivery.d.ts.map +1 -0
  493. package/dist/schedule/fire/fire.d.ts +1 -1
  494. package/dist/schedule/fire/fire.d.ts.map +1 -1
  495. package/dist/schedule/fire/run-script.d.ts +2 -2
  496. package/dist/schedule/fire/run-script.d.ts.map +1 -1
  497. package/dist/schedule/fire/script-report.d.ts +31 -0
  498. package/dist/schedule/fire/script-report.d.ts.map +1 -0
  499. package/dist/schedule/floor.d.ts +1 -1
  500. package/dist/schedule/floor.d.ts.map +1 -1
  501. package/dist/schedule/folder.d.ts +6 -0
  502. package/dist/schedule/folder.d.ts.map +1 -1
  503. package/dist/schedule/resume-command.d.ts +3 -3
  504. package/dist/schedule/resume-command.d.ts.map +1 -1
  505. package/dist/schedule/store/history.d.ts.map +1 -1
  506. package/dist/schedule/store/jobs.d.ts +6 -6
  507. package/dist/schedule/store/jobs.d.ts.map +1 -1
  508. package/dist/schedule/store/script-state.d.ts +31 -0
  509. package/dist/schedule/store/script-state.d.ts.map +1 -0
  510. package/dist/schedule/store/state.d.ts +4 -2
  511. package/dist/schedule/store/state.d.ts.map +1 -1
  512. package/dist/schedule/types.d.ts +61 -16
  513. package/dist/schedule/types.d.ts.map +1 -1
  514. package/dist/skills/store.d.ts.map +1 -1
  515. package/dist/terminal/host.d.ts +22 -0
  516. package/dist/terminal/host.d.ts.map +1 -0
  517. package/dist/terminal/manager.d.ts +124 -0
  518. package/dist/terminal/manager.d.ts.map +1 -0
  519. package/dist/terminal/protocol.d.ts +162 -0
  520. package/dist/terminal/protocol.d.ts.map +1 -0
  521. package/dist/terminal/pty.d.ts +85 -0
  522. package/dist/terminal/pty.d.ts.map +1 -0
  523. package/dist/terminal/ring.d.ts +23 -0
  524. package/dist/terminal/ring.d.ts.map +1 -0
  525. package/dist/terminal/screen.d.ts +31 -0
  526. package/dist/terminal/screen.d.ts.map +1 -0
  527. package/dist/termination-state.d.ts +19 -0
  528. package/dist/termination-state.d.ts.map +1 -0
  529. package/dist/termination.d.ts +2 -9
  530. package/dist/termination.d.ts.map +1 -1
  531. package/dist/tui/AgentExplorer.d.ts +4 -1
  532. package/dist/tui/AgentExplorer.d.ts.map +1 -1
  533. package/dist/tui/App.d.ts.map +1 -1
  534. package/dist/tui/BackgroundJobsPanel.d.ts +26 -0
  535. package/dist/tui/BackgroundJobsPanel.d.ts.map +1 -0
  536. package/dist/tui/BrandHeader.d.ts.map +1 -1
  537. package/dist/tui/ChildComposer.d.ts +22 -0
  538. package/dist/tui/ChildComposer.d.ts.map +1 -0
  539. package/dist/tui/ChoicePicker.d.ts.map +1 -1
  540. package/dist/tui/Composer.d.ts +25 -4
  541. package/dist/tui/Composer.d.ts.map +1 -1
  542. package/dist/tui/ComposerFrame.d.ts.map +1 -1
  543. package/dist/tui/CopyPicker.d.ts.map +1 -1
  544. package/dist/tui/EditPromptPicker.d.ts.map +1 -1
  545. package/dist/tui/EffortSlider.d.ts.map +1 -1
  546. package/dist/tui/LiveActivity.d.ts +7 -1
  547. package/dist/tui/LiveActivity.d.ts.map +1 -1
  548. package/dist/tui/Markdown.d.ts.map +1 -1
  549. package/dist/tui/PendingInputPanel.d.ts +34 -0
  550. package/dist/tui/PendingInputPanel.d.ts.map +1 -0
  551. package/dist/tui/PermissionOverlay.d.ts.map +1 -1
  552. package/dist/tui/Picker.d.ts.map +1 -1
  553. package/dist/tui/ProviderSetup.d.ts.map +1 -1
  554. package/dist/tui/ResumePicker.d.ts.map +1 -1
  555. package/dist/tui/SaveSkillOverlay.d.ts.map +1 -1
  556. package/dist/tui/ScheduleReviewOverlay.d.ts +1 -1
  557. package/dist/tui/ScheduleReviewOverlay.d.ts.map +1 -1
  558. package/dist/tui/StatusBar.d.ts +7 -1
  559. package/dist/tui/StatusBar.d.ts.map +1 -1
  560. package/dist/tui/StatusPanel.d.ts.map +1 -1
  561. package/dist/tui/TextPrompt.d.ts.map +1 -1
  562. package/dist/tui/ToolOutputViewer.d.ts.map +1 -1
  563. package/dist/tui/Transcript.d.ts.map +1 -1
  564. package/dist/tui/TrustPrompt.d.ts +8 -0
  565. package/dist/tui/TrustPrompt.d.ts.map +1 -1
  566. package/dist/tui/agent.d.ts +135 -6
  567. package/dist/tui/agent.d.ts.map +1 -1
  568. package/dist/tui/browser-notices.d.ts.map +1 -1
  569. package/dist/tui/capability-notice.d.ts +38 -0
  570. package/dist/tui/capability-notice.d.ts.map +1 -0
  571. package/dist/tui/console-input.d.ts +31 -0
  572. package/dist/tui/console-input.d.ts.map +1 -0
  573. package/dist/tui/conversation-evidence-view.d.ts.map +1 -1
  574. package/dist/tui/credential-entry.d.ts.map +1 -1
  575. package/dist/tui/exit-summary.d.ts +9 -1
  576. package/dist/tui/exit-summary.d.ts.map +1 -1
  577. package/dist/tui/external-editor.d.ts.map +1 -1
  578. package/dist/tui/index.d.ts.map +1 -1
  579. package/dist/tui/key-hints.d.ts +51 -0
  580. package/dist/tui/key-hints.d.ts.map +1 -0
  581. package/dist/tui/launch-settings.d.ts +34 -0
  582. package/dist/tui/launch-settings.d.ts.map +1 -0
  583. package/dist/tui/log-pane.d.ts.map +1 -1
  584. package/dist/tui/model-choices.d.ts +39 -1
  585. package/dist/tui/model-choices.d.ts.map +1 -1
  586. package/dist/tui/model-search.d.ts +4 -1
  587. package/dist/tui/model-search.d.ts.map +1 -1
  588. package/dist/tui/output-size-watch.d.ts +32 -0
  589. package/dist/tui/output-size-watch.d.ts.map +1 -0
  590. package/dist/tui/permission-review.d.ts.map +1 -1
  591. package/dist/tui/person-terms.d.ts +58 -0
  592. package/dist/tui/person-terms.d.ts.map +1 -0
  593. package/dist/tui/plain-failure.d.ts +27 -0
  594. package/dist/tui/plain-failure.d.ts.map +1 -0
  595. package/dist/tui/plain-interruption.d.ts +46 -0
  596. package/dist/tui/plain-interruption.d.ts.map +1 -0
  597. package/dist/tui/provider-list.d.ts.map +1 -1
  598. package/dist/tui/render-mode.d.ts +19 -0
  599. package/dist/tui/render-mode.d.ts.map +1 -0
  600. package/dist/tui/schedule/host-commands.d.ts +2 -9
  601. package/dist/tui/schedule/host-commands.d.ts.map +1 -1
  602. package/dist/tui/schedule/integration.d.ts +8 -0
  603. package/dist/tui/schedule/integration.d.ts.map +1 -1
  604. package/dist/tui/schedule/source-deliveries.d.ts +37 -0
  605. package/dist/tui/schedule/source-deliveries.d.ts.map +1 -0
  606. package/dist/tui/schedule/startup.d.ts.map +1 -1
  607. package/dist/tui/schedule/tool-host.d.ts +3 -1
  608. package/dist/tui/schedule/tool-host.d.ts.map +1 -1
  609. package/dist/tui/setup-text.d.ts +14 -0
  610. package/dist/tui/setup-text.d.ts.map +1 -0
  611. package/dist/tui/shell-escape.d.ts.map +1 -1
  612. package/dist/tui/skills/suggest-setting.d.ts.map +1 -1
  613. package/dist/tui/slashCommands.d.ts +9 -2
  614. package/dist/tui/slashCommands.d.ts.map +1 -1
  615. package/dist/tui/terminal-choice-text.d.ts +7 -0
  616. package/dist/tui/terminal-choice-text.d.ts.map +1 -1
  617. package/dist/tui/tidy-tool-output.d.ts +83 -0
  618. package/dist/tui/tidy-tool-output.d.ts.map +1 -0
  619. package/dist/tui/tool-presentation.d.ts +6 -0
  620. package/dist/tui/tool-presentation.d.ts.map +1 -0
  621. package/dist/tui/triggers/copy.d.ts.map +1 -1
  622. package/dist/tui/triggers/setting.d.ts.map +1 -1
  623. package/dist/tui/turn-interruption.d.ts +1 -1
  624. package/dist/tui/turn-interruption.d.ts.map +1 -1
  625. package/dist/tui/turn-limits-settings.d.ts +4 -4
  626. package/dist/tui/turn-limits-settings.d.ts.map +1 -1
  627. package/dist/tui/types.d.ts +10 -0
  628. package/dist/tui/types.d.ts.map +1 -1
  629. package/dist/tui/web-activity.d.ts +3 -2
  630. package/dist/tui/web-activity.d.ts.map +1 -1
  631. package/dist/tui/zen-free-refusal.d.ts +17 -0
  632. package/dist/tui/zen-free-refusal.d.ts.map +1 -0
  633. package/dist/usage-error.d.ts +15 -0
  634. package/dist/usage-error.d.ts.map +1 -0
  635. package/dist/warning-filter.d.ts +30 -0
  636. package/dist/warning-filter.d.ts.map +1 -0
  637. package/package.json +22 -11
  638. package/skills/schedule-task/SKILL.md +74 -20
  639. package/dist/browser/commands.js +0 -365
  640. package/dist/browser/commands.js.map +0 -1
  641. package/dist/browser/control.js +0 -140
  642. package/dist/browser/control.js.map +0 -1
  643. package/dist/browser/describe.js +0 -27
  644. package/dist/browser/describe.js.map +0 -1
  645. package/dist/checkpoints/store.js +0 -192
  646. package/dist/checkpoints/store.js.map +0 -1
  647. package/dist/checkpoints/wrap.js +0 -37
  648. package/dist/checkpoints/wrap.js.map +0 -1
  649. package/dist/cli.js +0 -602
  650. package/dist/cli.js.map +0 -1
  651. package/dist/commands/acp.js +0 -388
  652. package/dist/commands/acp.js.map +0 -1
  653. package/dist/commands/archive.js +0 -65
  654. package/dist/commands/archive.js.map +0 -1
  655. package/dist/commands/browser.js +0 -16
  656. package/dist/commands/browser.js.map +0 -1
  657. package/dist/commands/doctor.js +0 -267
  658. package/dist/commands/doctor.js.map +0 -1
  659. package/dist/commands/drain.js +0 -498
  660. package/dist/commands/drain.js.map +0 -1
  661. package/dist/commands/eval.js +0 -237
  662. package/dist/commands/eval.js.map +0 -1
  663. package/dist/commands/exec-flags.js +0 -334
  664. package/dist/commands/exec-flags.js.map +0 -1
  665. package/dist/commands/exec-json.js +0 -497
  666. package/dist/commands/exec-json.js.map +0 -1
  667. package/dist/commands/exec.js +0 -688
  668. package/dist/commands/exec.js.map +0 -1
  669. package/dist/commands/host-queries.js +0 -156
  670. package/dist/commands/host-queries.js.map +0 -1
  671. package/dist/commands/login.js +0 -315
  672. package/dist/commands/login.js.map +0 -1
  673. package/dist/commands/mcp-oauth-login.js +0 -213
  674. package/dist/commands/mcp-oauth-login.js.map +0 -1
  675. package/dist/commands/mcp.js +0 -288
  676. package/dist/commands/mcp.js.map +0 -1
  677. package/dist/commands/prior-messages.js +0 -329
  678. package/dist/commands/prior-messages.js.map +0 -1
  679. package/dist/commands/provider-wait.js +0 -65
  680. package/dist/commands/provider-wait.js.map +0 -1
  681. package/dist/commands/registry.js +0 -40
  682. package/dist/commands/registry.js.map +0 -1
  683. package/dist/commands/resident-flags.js +0 -193
  684. package/dist/commands/resident-flags.js.map +0 -1
  685. package/dist/commands/resident-learning.js +0 -293
  686. package/dist/commands/resident-learning.js.map +0 -1
  687. package/dist/commands/resident.js +0 -419
  688. package/dist/commands/resident.js.map +0 -1
  689. package/dist/commands/resume.js +0 -109
  690. package/dist/commands/resume.js.map +0 -1
  691. package/dist/commands/schedule.js +0 -131
  692. package/dist/commands/schedule.js.map +0 -1
  693. package/dist/commands/serve.js +0 -21
  694. package/dist/commands/serve.js.map +0 -1
  695. package/dist/commands/skills.js +0 -178
  696. package/dist/commands/skills.js.map +0 -1
  697. package/dist/commands/state.js +0 -110
  698. package/dist/commands/state.js.map +0 -1
  699. package/dist/commands/stdin.js +0 -69
  700. package/dist/commands/stdin.js.map +0 -1
  701. package/dist/commands/types.js +0 -2
  702. package/dist/commands/types.js.map +0 -1
  703. package/dist/commands/upgrade-progress.js +0 -54
  704. package/dist/commands/upgrade-progress.js.map +0 -1
  705. package/dist/commands/upgrade.js +0 -232
  706. package/dist/commands/upgrade.js.map +0 -1
  707. package/dist/commands/worktree.js +0 -86
  708. package/dist/commands/worktree.js.map +0 -1
  709. package/dist/config/composer-triggers.js +0 -80
  710. package/dist/config/composer-triggers.js.map +0 -1
  711. package/dist/config/debug.js +0 -126
  712. package/dist/config/debug.js.map +0 -1
  713. package/dist/config/load.js +0 -1208
  714. package/dist/config/load.js.map +0 -1
  715. package/dist/config/schema.js +0 -13
  716. package/dist/config/schema.js.map +0 -1
  717. package/dist/config/tool-result-screens.js +0 -104
  718. package/dist/config/tool-result-screens.js.map +0 -1
  719. package/dist/config/trusted-project-context.js +0 -28
  720. package/dist/config/trusted-project-context.js.map +0 -1
  721. package/dist/config/turn-guards.js +0 -46
  722. package/dist/config/turn-guards.js.map +0 -1
  723. package/dist/config/user-config.js +0 -118
  724. package/dist/config/user-config.js.map +0 -1
  725. package/dist/context/capabilities.js +0 -164
  726. package/dist/context/capabilities.js.map +0 -1
  727. package/dist/context/directories.js +0 -69
  728. package/dist/context/directories.js.map +0 -1
  729. package/dist/context/doctrine.js +0 -24
  730. package/dist/context/doctrine.js.map +0 -1
  731. package/dist/context/environment.js +0 -255
  732. package/dist/context/environment.js.map +0 -1
  733. package/dist/context/project-path.js +0 -16
  734. package/dist/context/project-path.js.map +0 -1
  735. package/dist/context/project-tracker.js +0 -217
  736. package/dist/context/project-tracker.js.map +0 -1
  737. package/dist/context/project.js +0 -256
  738. package/dist/context/project.js.map +0 -1
  739. package/dist/context/runtime-message.js +0 -30
  740. package/dist/context/runtime-message.js.map +0 -1
  741. package/dist/context/sandbox.js +0 -114
  742. package/dist/context/sandbox.js.map +0 -1
  743. package/dist/context/turn-snapshot.js +0 -122
  744. package/dist/context/turn-snapshot.js.map +0 -1
  745. package/dist/doctor/checks/browser.js +0 -63
  746. package/dist/doctor/checks/browser.js.map +0 -1
  747. package/dist/doctor/checks/chain.js +0 -211
  748. package/dist/doctor/checks/chain.js.map +0 -1
  749. package/dist/doctor/checks/credentials.js +0 -98
  750. package/dist/doctor/checks/credentials.js.map +0 -1
  751. package/dist/doctor/checks/index.js +0 -72
  752. package/dist/doctor/checks/index.js.map +0 -1
  753. package/dist/doctor/checks/invariants.js +0 -79
  754. package/dist/doctor/checks/invariants.js.map +0 -1
  755. package/dist/doctor/checks/logging.js +0 -69
  756. package/dist/doctor/checks/logging.js.map +0 -1
  757. package/dist/doctor/checks/providers.js +0 -30
  758. package/dist/doctor/checks/providers.js.map +0 -1
  759. package/dist/doctor/checks/runtime.js +0 -40
  760. package/dist/doctor/checks/runtime.js.map +0 -1
  761. package/dist/doctor/checks/sandbox.js +0 -76
  762. package/dist/doctor/checks/sandbox.js.map +0 -1
  763. package/dist/doctor/checks/scheduler.js +0 -74
  764. package/dist/doctor/checks/scheduler.js.map +0 -1
  765. package/dist/doctor/checks/session-export.js +0 -62
  766. package/dist/doctor/checks/session-export.js.map +0 -1
  767. package/dist/doctor/checks/telemetry.js +0 -58
  768. package/dist/doctor/checks/telemetry.js.map +0 -1
  769. package/dist/doctor/checks/vault.js +0 -67
  770. package/dist/doctor/checks/vault.js.map +0 -1
  771. package/dist/doctor/index.js +0 -3
  772. package/dist/doctor/index.js.map +0 -1
  773. package/dist/doctor/registry.js +0 -230
  774. package/dist/doctor/registry.js.map +0 -1
  775. package/dist/exit-codes.js +0 -62
  776. package/dist/exit-codes.js.map +0 -1
  777. package/dist/installation.js +0 -48
  778. package/dist/installation.js.map +0 -1
  779. package/dist/integrations/clipboard/image.js +0 -119
  780. package/dist/integrations/clipboard/image.js.map +0 -1
  781. package/dist/integrations/clipboard/text.js +0 -43
  782. package/dist/integrations/clipboard/text.js.map +0 -1
  783. package/dist/integrations/files/attachment-store.js +0 -86
  784. package/dist/integrations/files/attachment-store.js.map +0 -1
  785. package/dist/integrations/mcp/oauth-store.js +0 -549
  786. package/dist/integrations/mcp/oauth-store.js.map +0 -1
  787. package/dist/integrations/mcp/servers.js +0 -519
  788. package/dist/integrations/mcp/servers.js.map +0 -1
  789. package/dist/integrations/mcp/user-config.js +0 -92
  790. package/dist/integrations/mcp/user-config.js.map +0 -1
  791. package/dist/integrations/notifications/desktop/freedesktop.js +0 -33
  792. package/dist/integrations/notifications/desktop/freedesktop.js.map +0 -1
  793. package/dist/integrations/notifications/desktop/macos.js +0 -17
  794. package/dist/integrations/notifications/desktop/macos.js.map +0 -1
  795. package/dist/integrations/notifications/desktop/sanitize.js +0 -49
  796. package/dist/integrations/notifications/desktop/sanitize.js.map +0 -1
  797. package/dist/integrations/notifications/desktop/throttle.js +0 -39
  798. package/dist/integrations/notifications/desktop/throttle.js.map +0 -1
  799. package/dist/integrations/notifications/desktop/windows-toast.js +0 -56
  800. package/dist/integrations/notifications/desktop/windows-toast.js.map +0 -1
  801. package/dist/integrations/notifications/desktop.js +0 -199
  802. package/dist/integrations/notifications/desktop.js.map +0 -1
  803. package/dist/integrations/notifications/terminal.js +0 -46
  804. package/dist/integrations/notifications/terminal.js.map +0 -1
  805. package/dist/integrations/npm-invocation.js +0 -23
  806. package/dist/integrations/npm-invocation.js.map +0 -1
  807. package/dist/integrations/plugins/runtime.js +0 -189
  808. package/dist/integrations/plugins/runtime.js.map +0 -1
  809. package/dist/integrations/plugins/settings.js +0 -106
  810. package/dist/integrations/plugins/settings.js.map +0 -1
  811. package/dist/integrations/providers/access.js +0 -23
  812. package/dist/integrations/providers/access.js.map +0 -1
  813. package/dist/integrations/providers/chain-capabilities.js +0 -211
  814. package/dist/integrations/providers/chain-capabilities.js.map +0 -1
  815. package/dist/integrations/providers/codex-device-login.js +0 -195
  816. package/dist/integrations/providers/codex-device-login.js.map +0 -1
  817. package/dist/integrations/providers/codex-oauth.js +0 -95
  818. package/dist/integrations/providers/codex-oauth.js.map +0 -1
  819. package/dist/integrations/providers/credential-provider.js +0 -74
  820. package/dist/integrations/providers/credential-provider.js.map +0 -1
  821. package/dist/integrations/providers/credential-store.js +0 -657
  822. package/dist/integrations/providers/credential-store.js.map +0 -1
  823. package/dist/integrations/providers/current-credential.js +0 -45
  824. package/dist/integrations/providers/current-credential.js.map +0 -1
  825. package/dist/integrations/providers/discover.js +0 -313
  826. package/dist/integrations/providers/discover.js.map +0 -1
  827. package/dist/integrations/providers/gemini-credentials.js +0 -148
  828. package/dist/integrations/providers/gemini-credentials.js.map +0 -1
  829. package/dist/integrations/providers/harness-credentials.js +0 -344
  830. package/dist/integrations/providers/harness-credentials.js.map +0 -1
  831. package/dist/integrations/providers/identity.js +0 -64
  832. package/dist/integrations/providers/identity.js.map +0 -1
  833. package/dist/integrations/providers/index.js +0 -14
  834. package/dist/integrations/providers/index.js.map +0 -1
  835. package/dist/integrations/providers/keychain.js +0 -78
  836. package/dist/integrations/providers/keychain.js.map +0 -1
  837. package/dist/integrations/providers/model-reasoning.js +0 -51
  838. package/dist/integrations/providers/model-reasoning.js.map +0 -1
  839. package/dist/integrations/providers/oauth.js +0 -302
  840. package/dist/integrations/providers/oauth.js.map +0 -1
  841. package/dist/integrations/providers/preferences.js +0 -287
  842. package/dist/integrations/providers/preferences.js.map +0 -1
  843. package/dist/integrations/providers/register.js +0 -154
  844. package/dist/integrations/providers/register.js.map +0 -1
  845. package/dist/integrations/providers/registry.js +0 -289
  846. package/dist/integrations/providers/registry.js.map +0 -1
  847. package/dist/integrations/providers/setup.js +0 -158
  848. package/dist/integrations/providers/setup.js.map +0 -1
  849. package/dist/integrations/providers/subscription-login.js +0 -328
  850. package/dist/integrations/providers/subscription-login.js.map +0 -1
  851. package/dist/integrations/providers/zen-catalogue.js +0 -196
  852. package/dist/integrations/providers/zen-catalogue.js.map +0 -1
  853. package/dist/integrations/resident/foreground.js +0 -95
  854. package/dist/integrations/resident/foreground.js.map +0 -1
  855. package/dist/integrations/resident/inspection.js +0 -282
  856. package/dist/integrations/resident/inspection.js.map +0 -1
  857. package/dist/integrations/resident/learning-sources.js +0 -79
  858. package/dist/integrations/resident/learning-sources.js.map +0 -1
  859. package/dist/integrations/resident/learning-storage.js +0 -55
  860. package/dist/integrations/resident/learning-storage.js.map +0 -1
  861. package/dist/integrations/resident/lifecycle-errors.js +0 -15
  862. package/dist/integrations/resident/lifecycle-errors.js.map +0 -1
  863. package/dist/integrations/resident/owned-runner.js +0 -91
  864. package/dist/integrations/resident/owned-runner.js.map +0 -1
  865. package/dist/integrations/resident/runner-control.js +0 -238
  866. package/dist/integrations/resident/runner-control.js.map +0 -1
  867. package/dist/integrations/resident/runner-launch.js +0 -142
  868. package/dist/integrations/resident/runner-launch.js.map +0 -1
  869. package/dist/integrations/resident/runner-store.js +0 -284
  870. package/dist/integrations/resident/runner-store.js.map +0 -1
  871. package/dist/integrations/resident/session-log-reads.js +0 -125
  872. package/dist/integrations/resident/session-log-reads.js.map +0 -1
  873. package/dist/integrations/resident/session-step.js +0 -471
  874. package/dist/integrations/resident/session-step.js.map +0 -1
  875. package/dist/integrations/resident/storage.js +0 -183
  876. package/dist/integrations/resident/storage.js.map +0 -1
  877. package/dist/integrations/resident/tool-evidence.js +0 -123
  878. package/dist/integrations/resident/tool-evidence.js.map +0 -1
  879. package/dist/integrations/resident/verification.js +0 -109
  880. package/dist/integrations/resident/verification.js.map +0 -1
  881. package/dist/integrations/sessions/checkpoint-view.js +0 -48
  882. package/dist/integrations/sessions/checkpoint-view.js.map +0 -1
  883. package/dist/integrations/sessions/context-inventory.js +0 -44
  884. package/dist/integrations/sessions/context-inventory.js.map +0 -1
  885. package/dist/integrations/sessions/conversation-search.js +0 -572
  886. package/dist/integrations/sessions/conversation-search.js.map +0 -1
  887. package/dist/integrations/sessions/display-title.js +0 -5
  888. package/dist/integrations/sessions/display-title.js.map +0 -1
  889. package/dist/integrations/sessions/evidence-page-validation.js +0 -74
  890. package/dist/integrations/sessions/evidence-page-validation.js.map +0 -1
  891. package/dist/integrations/sessions/evidence-recall.js +0 -117
  892. package/dist/integrations/sessions/evidence-recall.js.map +0 -1
  893. package/dist/integrations/sessions/store.js +0 -780
  894. package/dist/integrations/sessions/store.js.map +0 -1
  895. package/dist/integrations/sessions/task-context.js +0 -96
  896. package/dist/integrations/sessions/task-context.js.map +0 -1
  897. package/dist/integrations/sessions/transcript-export.js +0 -342
  898. package/dist/integrations/sessions/transcript-export.js.map +0 -1
  899. package/dist/integrations/state/home.js +0 -17
  900. package/dist/integrations/state/home.js.map +0 -1
  901. package/dist/integrations/state/identity.js +0 -49
  902. package/dist/integrations/state/identity.js.map +0 -1
  903. package/dist/integrations/state/immutable-json.js +0 -38
  904. package/dist/integrations/state/immutable-json.js.map +0 -1
  905. package/dist/integrations/state/private-directory.js +0 -43
  906. package/dist/integrations/state/private-directory.js.map +0 -1
  907. package/dist/integrations/state/project.js +0 -13
  908. package/dist/integrations/state/project.js.map +0 -1
  909. package/dist/integrations/state/report.js +0 -626
  910. package/dist/integrations/state/report.js.map +0 -1
  911. package/dist/integrations/state/retention.js +0 -18
  912. package/dist/integrations/state/retention.js.map +0 -1
  913. package/dist/integrations/subagents/NamzuCliAgent.js +0 -9
  914. package/dist/integrations/subagents/NamzuCliAgent.js.map +0 -1
  915. package/dist/integrations/subagents/activity.js +0 -759
  916. package/dist/integrations/subagents/activity.js.map +0 -1
  917. package/dist/integrations/subagents/batches.js +0 -172
  918. package/dist/integrations/subagents/batches.js.map +0 -1
  919. package/dist/integrations/subagents/definitions.js +0 -26
  920. package/dist/integrations/subagents/definitions.js.map +0 -1
  921. package/dist/integrations/subagents/model-effort.js +0 -12
  922. package/dist/integrations/subagents/model-effort.js.map +0 -1
  923. package/dist/integrations/subagents/parent.js +0 -47
  924. package/dist/integrations/subagents/parent.js.map +0 -1
  925. package/dist/integrations/subagents/policy.js +0 -3
  926. package/dist/integrations/subagents/policy.js.map +0 -1
  927. package/dist/integrations/subagents/replay.js +0 -295
  928. package/dist/integrations/subagents/replay.js.map +0 -1
  929. package/dist/integrations/subagents/runtime.js +0 -1317
  930. package/dist/integrations/subagents/runtime.js.map +0 -1
  931. package/dist/integrations/subagents/saved-agents.js +0 -102
  932. package/dist/integrations/subagents/saved-agents.js.map +0 -1
  933. package/dist/integrations/subagents/slash.js +0 -45
  934. package/dist/integrations/subagents/slash.js.map +0 -1
  935. package/dist/integrations/subagents/worktree-driver.js +0 -72
  936. package/dist/integrations/subagents/worktree-driver.js.map +0 -1
  937. package/dist/integrations/telemetry/session-export.js +0 -119
  938. package/dist/integrations/telemetry/session-export.js.map +0 -1
  939. package/dist/integrations/trust/store.js +0 -73
  940. package/dist/integrations/trust/store.js.map +0 -1
  941. package/dist/integrations/updates.js +0 -115
  942. package/dist/integrations/updates.js.map +0 -1
  943. package/dist/integrations/web/exa-search.js +0 -154
  944. package/dist/integrations/web/exa-search.js.map +0 -1
  945. package/dist/integrations/web/open-url.js +0 -73
  946. package/dist/integrations/web/open-url.js.map +0 -1
  947. package/dist/integrations/web/search.js +0 -68
  948. package/dist/integrations/web/search.js.map +0 -1
  949. package/dist/integrations/worktrees/managed.js +0 -231
  950. package/dist/integrations/worktrees/managed.js.map +0 -1
  951. package/dist/logging.js +0 -115
  952. package/dist/logging.js.map +0 -1
  953. package/dist/memory/io.js +0 -177
  954. package/dist/memory/io.js.map +0 -1
  955. package/dist/memory/presentation.js +0 -76
  956. package/dist/memory/presentation.js.map +0 -1
  957. package/dist/memory/store.js +0 -180
  958. package/dist/memory/store.js.map +0 -1
  959. package/dist/memory/typed.js +0 -336
  960. package/dist/memory/typed.js.map +0 -1
  961. package/dist/output/formatter.js +0 -16
  962. package/dist/output/formatter.js.map +0 -1
  963. package/dist/output/index.js +0 -22
  964. package/dist/output/index.js.map +0 -1
  965. package/dist/output/json.js +0 -51
  966. package/dist/output/json.js.map +0 -1
  967. package/dist/output/text.js +0 -50
  968. package/dist/output/text.js.map +0 -1
  969. package/dist/output/yaml.js +0 -26
  970. package/dist/output/yaml.js.map +0 -1
  971. package/dist/output-schema.js +0 -18
  972. package/dist/output-schema.js.map +0 -1
  973. package/dist/permissions/browser-sites.js +0 -270
  974. package/dist/permissions/browser-sites.js.map +0 -1
  975. package/dist/permissions/canonical-project.js +0 -13
  976. package/dist/permissions/canonical-project.js.map +0 -1
  977. package/dist/permissions/checks.js +0 -128
  978. package/dist/permissions/checks.js.map +0 -1
  979. package/dist/permissions/headless-trust.js +0 -86
  980. package/dist/permissions/headless-trust.js.map +0 -1
  981. package/dist/permissions/live-mode.js +0 -62
  982. package/dist/permissions/live-mode.js.map +0 -1
  983. package/dist/permissions/mode.js +0 -65
  984. package/dist/permissions/mode.js.map +0 -1
  985. package/dist/permissions/rules.js +0 -358
  986. package/dist/permissions/rules.js.map +0 -1
  987. package/dist/release-notes.js +0 -64
  988. package/dist/release-notes.js.map +0 -1
  989. package/dist/resume-invocation.js +0 -24
  990. package/dist/resume-invocation.js.map +0 -1
  991. package/dist/schedule/build.js +0 -374
  992. package/dist/schedule/build.js.map +0 -1
  993. package/dist/schedule/changes.js +0 -78
  994. package/dist/schedule/changes.js.map +0 -1
  995. package/dist/schedule/commands/add.js +0 -603
  996. package/dist/schedule/commands/add.js.map +0 -1
  997. package/dist/schedule/commands/args.js +0 -80
  998. package/dist/schedule/commands/args.js.map +0 -1
  999. package/dist/schedule/commands/confirm-prompt.js +0 -21
  1000. package/dist/schedule/commands/confirm-prompt.js.map +0 -1
  1001. package/dist/schedule/commands/lifecycle.js +0 -586
  1002. package/dist/schedule/commands/lifecycle.js.map +0 -1
  1003. package/dist/schedule/commands/list.js +0 -260
  1004. package/dist/schedule/commands/list.js.map +0 -1
  1005. package/dist/schedule/commands/logs.js +0 -106
  1006. package/dist/schedule/commands/logs.js.map +0 -1
  1007. package/dist/schedule/commands/service.js +0 -458
  1008. package/dist/schedule/commands/service.js.map +0 -1
  1009. package/dist/schedule/daemon/daemon.js +0 -1265
  1010. package/dist/schedule/daemon/daemon.js.map +0 -1
  1011. package/dist/schedule/daemon/endpoint.js +0 -158
  1012. package/dist/schedule/daemon/endpoint.js.map +0 -1
  1013. package/dist/schedule/daemon/exit.js +0 -8
  1014. package/dist/schedule/daemon/exit.js.map +0 -1
  1015. package/dist/schedule/daemon/log.js +0 -53
  1016. package/dist/schedule/daemon/log.js.map +0 -1
  1017. package/dist/schedule/daemon/notify.js +0 -158
  1018. package/dist/schedule/daemon/notify.js.map +0 -1
  1019. package/dist/schedule/daemon/retention.js +0 -46
  1020. package/dist/schedule/daemon/retention.js.map +0 -1
  1021. package/dist/schedule/daemon/sessions.js +0 -52
  1022. package/dist/schedule/daemon/sessions.js.map +0 -1
  1023. package/dist/schedule/env.js +0 -106
  1024. package/dist/schedule/env.js.map +0 -1
  1025. package/dist/schedule/fire/browser-preflight.js +0 -73
  1026. package/dist/schedule/fire/browser-preflight.js.map +0 -1
  1027. package/dist/schedule/fire/calls.js +0 -114
  1028. package/dist/schedule/fire/calls.js.map +0 -1
  1029. package/dist/schedule/fire/fire.js +0 -681
  1030. package/dist/schedule/fire/fire.js.map +0 -1
  1031. package/dist/schedule/fire/result.js +0 -19
  1032. package/dist/schedule/fire/result.js.map +0 -1
  1033. package/dist/schedule/fire/run-script.js +0 -81
  1034. package/dist/schedule/fire/run-script.js.map +0 -1
  1035. package/dist/schedule/fire/unattended-note.js +0 -51
  1036. package/dist/schedule/fire/unattended-note.js.map +0 -1
  1037. package/dist/schedule/fire/wake-gate.js +0 -90
  1038. package/dist/schedule/fire/wake-gate.js.map +0 -1
  1039. package/dist/schedule/floor.js +0 -1561
  1040. package/dist/schedule/floor.js.map +0 -1
  1041. package/dist/schedule/folder.js +0 -84
  1042. package/dist/schedule/folder.js.map +0 -1
  1043. package/dist/schedule/paths.js +0 -53
  1044. package/dist/schedule/paths.js.map +0 -1
  1045. package/dist/schedule/policy.js +0 -414
  1046. package/dist/schedule/policy.js.map +0 -1
  1047. package/dist/schedule/resume-command.js +0 -72
  1048. package/dist/schedule/resume-command.js.map +0 -1
  1049. package/dist/schedule/script-check.js +0 -146
  1050. package/dist/schedule/script-check.js.map +0 -1
  1051. package/dist/schedule/script-shell.js +0 -5
  1052. package/dist/schedule/script-shell.js.map +0 -1
  1053. package/dist/schedule/service/detect.js +0 -29
  1054. package/dist/schedule/service/detect.js.map +0 -1
  1055. package/dist/schedule/service/index.js +0 -361
  1056. package/dist/schedule/service/index.js.map +0 -1
  1057. package/dist/schedule/service/launchd.js +0 -84
  1058. package/dist/schedule/service/launchd.js.map +0 -1
  1059. package/dist/schedule/service/manifest.js +0 -16
  1060. package/dist/schedule/service/manifest.js.map +0 -1
  1061. package/dist/schedule/service/names.js +0 -22
  1062. package/dist/schedule/service/names.js.map +0 -1
  1063. package/dist/schedule/service/quote.js +0 -64
  1064. package/dist/schedule/service/quote.js.map +0 -1
  1065. package/dist/schedule/service/runner.js +0 -31
  1066. package/dist/schedule/service/runner.js.map +0 -1
  1067. package/dist/schedule/service/systemd.js +0 -96
  1068. package/dist/schedule/service/systemd.js.map +0 -1
  1069. package/dist/schedule/service/windows-task.js +0 -199
  1070. package/dist/schedule/service/windows-task.js.map +0 -1
  1071. package/dist/schedule/service/wsl.js +0 -121
  1072. package/dist/schedule/service/wsl.js.map +0 -1
  1073. package/dist/schedule/store/atomic.js +0 -138
  1074. package/dist/schedule/store/atomic.js.map +0 -1
  1075. package/dist/schedule/store/claims.js +0 -57
  1076. package/dist/schedule/store/claims.js.map +0 -1
  1077. package/dist/schedule/store/digest.js +0 -139
  1078. package/dist/schedule/store/digest.js.map +0 -1
  1079. package/dist/schedule/store/history.js +0 -117
  1080. package/dist/schedule/store/history.js.map +0 -1
  1081. package/dist/schedule/store/jobs.js +0 -277
  1082. package/dist/schedule/store/jobs.js.map +0 -1
  1083. package/dist/schedule/store/state.js +0 -38
  1084. package/dist/schedule/store/state.js.map +0 -1
  1085. package/dist/schedule/types.js +0 -33
  1086. package/dist/schedule/types.js.map +0 -1
  1087. package/dist/schedule/visible-source.js +0 -59
  1088. package/dist/schedule/visible-source.js.map +0 -1
  1089. package/dist/skills/audit.js +0 -75
  1090. package/dist/skills/audit.js.map +0 -1
  1091. package/dist/skills/catalog.js +0 -226
  1092. package/dist/skills/catalog.js.map +0 -1
  1093. package/dist/skills/directory.js +0 -51
  1094. package/dist/skills/directory.js.map +0 -1
  1095. package/dist/skills/save.js +0 -344
  1096. package/dist/skills/save.js.map +0 -1
  1097. package/dist/skills/store.js +0 -351
  1098. package/dist/skills/store.js.map +0 -1
  1099. package/dist/termination.js +0 -143
  1100. package/dist/termination.js.map +0 -1
  1101. package/dist/test-support/toolset.js +0 -27
  1102. package/dist/test-support/toolset.js.map +0 -1
  1103. package/dist/tui/AgentExplorer.js +0 -789
  1104. package/dist/tui/AgentExplorer.js.map +0 -1
  1105. package/dist/tui/App.js +0 -8209
  1106. package/dist/tui/App.js.map +0 -1
  1107. package/dist/tui/BrandHeader.js +0 -14
  1108. package/dist/tui/BrandHeader.js.map +0 -1
  1109. package/dist/tui/Checklist.js +0 -90
  1110. package/dist/tui/Checklist.js.map +0 -1
  1111. package/dist/tui/ChoicePicker.js +0 -64
  1112. package/dist/tui/ChoicePicker.js.map +0 -1
  1113. package/dist/tui/Composer.js +0 -908
  1114. package/dist/tui/Composer.js.map +0 -1
  1115. package/dist/tui/ComposerFrame.js +0 -79
  1116. package/dist/tui/ComposerFrame.js.map +0 -1
  1117. package/dist/tui/CopyPicker.js +0 -19
  1118. package/dist/tui/CopyPicker.js.map +0 -1
  1119. package/dist/tui/EditPromptPicker.js +0 -17
  1120. package/dist/tui/EditPromptPicker.js.map +0 -1
  1121. package/dist/tui/EffortSlider.js +0 -134
  1122. package/dist/tui/EffortSlider.js.map +0 -1
  1123. package/dist/tui/LiveActivity.js +0 -89
  1124. package/dist/tui/LiveActivity.js.map +0 -1
  1125. package/dist/tui/Markdown.js +0 -137
  1126. package/dist/tui/Markdown.js.map +0 -1
  1127. package/dist/tui/PermissionOverlay.js +0 -278
  1128. package/dist/tui/PermissionOverlay.js.map +0 -1
  1129. package/dist/tui/Picker.js +0 -1310
  1130. package/dist/tui/Picker.js.map +0 -1
  1131. package/dist/tui/ProviderSetup.js +0 -125
  1132. package/dist/tui/ProviderSetup.js.map +0 -1
  1133. package/dist/tui/ResumePicker.js +0 -34
  1134. package/dist/tui/ResumePicker.js.map +0 -1
  1135. package/dist/tui/SaveSkillOverlay.js +0 -118
  1136. package/dist/tui/SaveSkillOverlay.js.map +0 -1
  1137. package/dist/tui/ScheduleReviewOverlay.js +0 -166
  1138. package/dist/tui/ScheduleReviewOverlay.js.map +0 -1
  1139. package/dist/tui/StatusBar.js +0 -182
  1140. package/dist/tui/StatusBar.js.map +0 -1
  1141. package/dist/tui/StatusPanel.js +0 -11
  1142. package/dist/tui/StatusPanel.js.map +0 -1
  1143. package/dist/tui/TaskList.js +0 -43
  1144. package/dist/tui/TaskList.js.map +0 -1
  1145. package/dist/tui/TextPrompt.js +0 -185
  1146. package/dist/tui/TextPrompt.js.map +0 -1
  1147. package/dist/tui/ToolOutputViewer.js +0 -39
  1148. package/dist/tui/ToolOutputViewer.js.map +0 -1
  1149. package/dist/tui/Transcript.js +0 -235
  1150. package/dist/tui/Transcript.js.map +0 -1
  1151. package/dist/tui/TrustPrompt.js +0 -13
  1152. package/dist/tui/TrustPrompt.js.map +0 -1
  1153. package/dist/tui/ViewportBound.js +0 -55
  1154. package/dist/tui/ViewportBound.js.map +0 -1
  1155. package/dist/tui/agent-transcript-rows.js +0 -115
  1156. package/dist/tui/agent-transcript-rows.js.map +0 -1
  1157. package/dist/tui/agent.js +0 -4235
  1158. package/dist/tui/agent.js.map +0 -1
  1159. package/dist/tui/browser-notices.js +0 -107
  1160. package/dist/tui/browser-notices.js.map +0 -1
  1161. package/dist/tui/choice-selection.js +0 -38
  1162. package/dist/tui/choice-selection.js.map +0 -1
  1163. package/dist/tui/compact-transcript.js +0 -46
  1164. package/dist/tui/compact-transcript.js.map +0 -1
  1165. package/dist/tui/consent-timing.js +0 -48
  1166. package/dist/tui/consent-timing.js.map +0 -1
  1167. package/dist/tui/conversation-evidence-view.js +0 -96
  1168. package/dist/tui/conversation-evidence-view.js.map +0 -1
  1169. package/dist/tui/conversation-history.js +0 -33
  1170. package/dist/tui/conversation-history.js.map +0 -1
  1171. package/dist/tui/copy-targets.js +0 -189
  1172. package/dist/tui/copy-targets.js.map +0 -1
  1173. package/dist/tui/credential-entry.js +0 -134
  1174. package/dist/tui/credential-entry.js.map +0 -1
  1175. package/dist/tui/edit-prompts.js +0 -35
  1176. package/dist/tui/edit-prompts.js.map +0 -1
  1177. package/dist/tui/exit-summary.js +0 -30
  1178. package/dist/tui/exit-summary.js.map +0 -1
  1179. package/dist/tui/external-editor.js +0 -169
  1180. package/dist/tui/external-editor.js.map +0 -1
  1181. package/dist/tui/hypermode.js +0 -58
  1182. package/dist/tui/hypermode.js.map +0 -1
  1183. package/dist/tui/index.js +0 -81
  1184. package/dist/tui/index.js.map +0 -1
  1185. package/dist/tui/live-window.js +0 -281
  1186. package/dist/tui/live-window.js.map +0 -1
  1187. package/dist/tui/log-pane.js +0 -100
  1188. package/dist/tui/log-pane.js.map +0 -1
  1189. package/dist/tui/login-prompt.js +0 -105
  1190. package/dist/tui/login-prompt.js.map +0 -1
  1191. package/dist/tui/logo.js +0 -9
  1192. package/dist/tui/logo.js.map +0 -1
  1193. package/dist/tui/markdown-block-cache.js +0 -76
  1194. package/dist/tui/markdown-block-cache.js.map +0 -1
  1195. package/dist/tui/markdown-table.js +0 -175
  1196. package/dist/tui/markdown-table.js.map +0 -1
  1197. package/dist/tui/markdown-wrap.js +0 -189
  1198. package/dist/tui/markdown-wrap.js.map +0 -1
  1199. package/dist/tui/markdownParser.js +0 -237
  1200. package/dist/tui/markdownParser.js.map +0 -1
  1201. package/dist/tui/mentions.js +0 -150
  1202. package/dist/tui/mentions.js.map +0 -1
  1203. package/dist/tui/model-catalogue-view.js +0 -75
  1204. package/dist/tui/model-catalogue-view.js.map +0 -1
  1205. package/dist/tui/model-choices.js +0 -157
  1206. package/dist/tui/model-choices.js.map +0 -1
  1207. package/dist/tui/model-search.js +0 -28
  1208. package/dist/tui/model-search.js.map +0 -1
  1209. package/dist/tui/model-selection-intent.js +0 -96
  1210. package/dist/tui/model-selection-intent.js.map +0 -1
  1211. package/dist/tui/model-switch-tool.js +0 -74
  1212. package/dist/tui/model-switch-tool.js.map +0 -1
  1213. package/dist/tui/model-switch.js +0 -106
  1214. package/dist/tui/model-switch.js.map +0 -1
  1215. package/dist/tui/notices.js +0 -27
  1216. package/dist/tui/notices.js.map +0 -1
  1217. package/dist/tui/open-browser.js +0 -147
  1218. package/dist/tui/open-browser.js.map +0 -1
  1219. package/dist/tui/permission-review.js +0 -858
  1220. package/dist/tui/permission-review.js.map +0 -1
  1221. package/dist/tui/plugin-view.js +0 -59
  1222. package/dist/tui/plugin-view.js.map +0 -1
  1223. package/dist/tui/provider-list.js +0 -327
  1224. package/dist/tui/provider-list.js.map +0 -1
  1225. package/dist/tui/provider-selection.js +0 -16
  1226. package/dist/tui/provider-selection.js.map +0 -1
  1227. package/dist/tui/schedule/host-commands.js +0 -428
  1228. package/dist/tui/schedule/host-commands.js.map +0 -1
  1229. package/dist/tui/schedule/integration.js +0 -150
  1230. package/dist/tui/schedule/integration.js.map +0 -1
  1231. package/dist/tui/schedule/loop-host.js +0 -153
  1232. package/dist/tui/schedule/loop-host.js.map +0 -1
  1233. package/dist/tui/schedule/resume.js +0 -333
  1234. package/dist/tui/schedule/resume.js.map +0 -1
  1235. package/dist/tui/schedule/startup.js +0 -121
  1236. package/dist/tui/schedule/startup.js.map +0 -1
  1237. package/dist/tui/schedule/tool-host.js +0 -619
  1238. package/dist/tui/schedule/tool-host.js.map +0 -1
  1239. package/dist/tui/selection-window.js +0 -37
  1240. package/dist/tui/selection-window.js.map +0 -1
  1241. package/dist/tui/shell-escape.js +0 -110
  1242. package/dist/tui/shell-escape.js.map +0 -1
  1243. package/dist/tui/skills/learning.js +0 -131
  1244. package/dist/tui/skills/learning.js.map +0 -1
  1245. package/dist/tui/skills/suggest-setting.js +0 -55
  1246. package/dist/tui/skills/suggest-setting.js.map +0 -1
  1247. package/dist/tui/skills/suggestion-ledger.js +0 -52
  1248. package/dist/tui/skills/suggestion-ledger.js.map +0 -1
  1249. package/dist/tui/slashCommands.js +0 -1587
  1250. package/dist/tui/slashCommands.js.map +0 -1
  1251. package/dist/tui/status-card.js +0 -30
  1252. package/dist/tui/status-card.js.map +0 -1
  1253. package/dist/tui/status-panel-layout.js +0 -42
  1254. package/dist/tui/status-panel-layout.js.map +0 -1
  1255. package/dist/tui/stream-blocks.js +0 -187
  1256. package/dist/tui/stream-blocks.js.map +0 -1
  1257. package/dist/tui/task-activity.js +0 -157
  1258. package/dist/tui/task-activity.js.map +0 -1
  1259. package/dist/tui/terminal-choice-text.js +0 -118
  1260. package/dist/tui/terminal-choice-text.js.map +0 -1
  1261. package/dist/tui/terminal-display.js +0 -65
  1262. package/dist/tui/terminal-display.js.map +0 -1
  1263. package/dist/tui/terminal-hyperlinks.js +0 -70
  1264. package/dist/tui/terminal-hyperlinks.js.map +0 -1
  1265. package/dist/tui/theme.js +0 -34
  1266. package/dist/tui/theme.js.map +0 -1
  1267. package/dist/tui/triggers/analyze.js +0 -221
  1268. package/dist/tui/triggers/analyze.js.map +0 -1
  1269. package/dist/tui/triggers/context-text.js +0 -44
  1270. package/dist/tui/triggers/context-text.js.map +0 -1
  1271. package/dist/tui/triggers/copy.js +0 -163
  1272. package/dist/tui/triggers/copy.js.map +0 -1
  1273. package/dist/tui/triggers/detect.js +0 -295
  1274. package/dist/tui/triggers/detect.js.map +0 -1
  1275. package/dist/tui/triggers/fold.js +0 -44
  1276. package/dist/tui/triggers/fold.js.map +0 -1
  1277. package/dist/tui/triggers/pattern.js +0 -243
  1278. package/dist/tui/triggers/pattern.js.map +0 -1
  1279. package/dist/tui/triggers/provenance.js +0 -98
  1280. package/dist/tui/triggers/provenance.js.map +0 -1
  1281. package/dist/tui/triggers/registry.js +0 -164
  1282. package/dist/tui/triggers/registry.js.map +0 -1
  1283. package/dist/tui/triggers/setting.js +0 -61
  1284. package/dist/tui/triggers/setting.js.map +0 -1
  1285. package/dist/tui/triggers/verbs.js +0 -140
  1286. package/dist/tui/triggers/verbs.js.map +0 -1
  1287. package/dist/tui/turn-interruption.js +0 -160
  1288. package/dist/tui/turn-interruption.js.map +0 -1
  1289. package/dist/tui/turn-limits-settings.js +0 -88
  1290. package/dist/tui/turn-limits-settings.js.map +0 -1
  1291. package/dist/tui/types.js +0 -7
  1292. package/dist/tui/types.js.map +0 -1
  1293. package/dist/tui/units.js +0 -20
  1294. package/dist/tui/units.js.map +0 -1
  1295. package/dist/tui/use-selection-index.js +0 -13
  1296. package/dist/tui/use-selection-index.js.map +0 -1
  1297. package/dist/tui/web-activity.js +0 -105
  1298. package/dist/tui/web-activity.js.map +0 -1
  1299. package/dist/tui/workspace-diff.js +0 -101
  1300. package/dist/tui/workspace-diff.js.map +0 -1
  1301. package/dist/tui/workspace-review.js +0 -67
  1302. package/dist/tui/workspace-review.js.map +0 -1
  1303. package/dist/user-commands/store.js +0 -235
  1304. package/dist/user-commands/store.js.map +0 -1
  1305. package/dist/version.js +0 -23
  1306. package/dist/version.js.map +0 -1
@@ -0,0 +1,2657 @@
1
+ import { createRequire as __namzuCreateRequire } from 'node:module';
2
+ const require = __namzuCreateRequire(import.meta.url);
3
+ import {
4
+ __name
5
+ } from "./chunk-76FLAFCG.js";
6
+
7
+ // ../../node_modules/.pnpm/fflate@0.8.3/node_modules/fflate/esm/index.mjs
8
+ import { createRequire } from "module";
9
+ var require2 = createRequire("/");
10
+ var _a;
11
+ var Worker;
12
+ var isMarkedAsUntransferable;
13
+ try {
14
+ _a = require2("worker_threads"), Worker = _a.Worker, isMarkedAsUntransferable = _a.isMarkedAsUntransferable;
15
+ } catch (e) {
16
+ }
17
+ var u8 = Uint8Array;
18
+ var u16 = Uint16Array;
19
+ var i32 = Int32Array;
20
+ var fleb = new u8([
21
+ 0,
22
+ 0,
23
+ 0,
24
+ 0,
25
+ 0,
26
+ 0,
27
+ 0,
28
+ 0,
29
+ 1,
30
+ 1,
31
+ 1,
32
+ 1,
33
+ 2,
34
+ 2,
35
+ 2,
36
+ 2,
37
+ 3,
38
+ 3,
39
+ 3,
40
+ 3,
41
+ 4,
42
+ 4,
43
+ 4,
44
+ 4,
45
+ 5,
46
+ 5,
47
+ 5,
48
+ 5,
49
+ 0,
50
+ /* unused */
51
+ 0,
52
+ 0,
53
+ /* impossible */
54
+ 0
55
+ ]);
56
+ var fdeb = new u8([
57
+ 0,
58
+ 0,
59
+ 0,
60
+ 0,
61
+ 1,
62
+ 1,
63
+ 2,
64
+ 2,
65
+ 3,
66
+ 3,
67
+ 4,
68
+ 4,
69
+ 5,
70
+ 5,
71
+ 6,
72
+ 6,
73
+ 7,
74
+ 7,
75
+ 8,
76
+ 8,
77
+ 9,
78
+ 9,
79
+ 10,
80
+ 10,
81
+ 11,
82
+ 11,
83
+ 12,
84
+ 12,
85
+ 13,
86
+ 13,
87
+ /* unused */
88
+ 0,
89
+ 0
90
+ ]);
91
+ var clim = new u8([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]);
92
+ var freb = /* @__PURE__ */ __name(function(eb, start) {
93
+ var b = new u16(31);
94
+ for (var i2 = 0; i2 < 31; ++i2) {
95
+ b[i2] = start += 1 << eb[i2 - 1];
96
+ }
97
+ var r = new i32(b[30]);
98
+ for (var i2 = 1; i2 < 30; ++i2) {
99
+ for (var j = b[i2]; j < b[i2 + 1]; ++j) {
100
+ r[j] = j - b[i2] << 5 | i2;
101
+ }
102
+ }
103
+ return { b, r };
104
+ }, "freb");
105
+ var _a = freb(fleb, 2);
106
+ var fl = _a.b;
107
+ var revfl = _a.r;
108
+ fl[28] = 258, revfl[258] = 28;
109
+ var _b = freb(fdeb, 0);
110
+ var fd = _b.b;
111
+ var revfd = _b.r;
112
+ var rev = new u16(32768);
113
+ for (i = 0; i < 32768; ++i) {
114
+ x = (i & 43690) >> 1 | (i & 21845) << 1;
115
+ x = (x & 52428) >> 2 | (x & 13107) << 2;
116
+ x = (x & 61680) >> 4 | (x & 3855) << 4;
117
+ rev[i] = ((x & 65280) >> 8 | (x & 255) << 8) >> 1;
118
+ }
119
+ var x;
120
+ var i;
121
+ var hMap = /* @__PURE__ */ __name((function(cd, mb, r) {
122
+ var s = cd.length;
123
+ var i2 = 0;
124
+ var l = new u16(mb);
125
+ for (; i2 < s; ++i2) {
126
+ if (cd[i2])
127
+ ++l[cd[i2] - 1];
128
+ }
129
+ var le = new u16(mb);
130
+ for (i2 = 1; i2 < mb; ++i2) {
131
+ le[i2] = le[i2 - 1] + l[i2 - 1] << 1;
132
+ }
133
+ var co;
134
+ if (r) {
135
+ co = new u16(1 << mb);
136
+ var rvb = 15 - mb;
137
+ for (i2 = 0; i2 < s; ++i2) {
138
+ if (cd[i2]) {
139
+ var sv = i2 << 4 | cd[i2];
140
+ var r_1 = mb - cd[i2];
141
+ var v = le[cd[i2] - 1]++ << r_1;
142
+ for (var m = v | (1 << r_1) - 1; v <= m; ++v) {
143
+ co[rev[v] >> rvb] = sv;
144
+ }
145
+ }
146
+ }
147
+ } else {
148
+ co = new u16(s);
149
+ for (i2 = 0; i2 < s; ++i2) {
150
+ if (cd[i2]) {
151
+ co[i2] = rev[le[cd[i2] - 1]++] >> 15 - cd[i2];
152
+ }
153
+ }
154
+ }
155
+ return co;
156
+ }), "hMap");
157
+ var flt = new u8(288);
158
+ for (i = 0; i < 144; ++i)
159
+ flt[i] = 8;
160
+ var i;
161
+ for (i = 144; i < 256; ++i)
162
+ flt[i] = 9;
163
+ var i;
164
+ for (i = 256; i < 280; ++i)
165
+ flt[i] = 7;
166
+ var i;
167
+ for (i = 280; i < 288; ++i)
168
+ flt[i] = 8;
169
+ var i;
170
+ var fdt = new u8(32);
171
+ for (i = 0; i < 32; ++i)
172
+ fdt[i] = 5;
173
+ var i;
174
+ var flm = /* @__PURE__ */ hMap(flt, 9, 0);
175
+ var flrm = /* @__PURE__ */ hMap(flt, 9, 1);
176
+ var fdm = /* @__PURE__ */ hMap(fdt, 5, 0);
177
+ var fdrm = /* @__PURE__ */ hMap(fdt, 5, 1);
178
+ var max = /* @__PURE__ */ __name(function(a) {
179
+ var m = a[0];
180
+ for (var i2 = 1; i2 < a.length; ++i2) {
181
+ if (a[i2] > m)
182
+ m = a[i2];
183
+ }
184
+ return m;
185
+ }, "max");
186
+ var bits = /* @__PURE__ */ __name(function(d, p, m) {
187
+ var o = p / 8 | 0;
188
+ return (d[o] | d[o + 1] << 8) >> (p & 7) & m;
189
+ }, "bits");
190
+ var bits16 = /* @__PURE__ */ __name(function(d, p) {
191
+ var o = p / 8 | 0;
192
+ return (d[o] | d[o + 1] << 8 | d[o + 2] << 16) >> (p & 7);
193
+ }, "bits16");
194
+ var shft = /* @__PURE__ */ __name(function(p) {
195
+ return (p + 7) / 8 | 0;
196
+ }, "shft");
197
+ var slc = /* @__PURE__ */ __name(function(v, s, e) {
198
+ if (s == null || s < 0)
199
+ s = 0;
200
+ if (e == null || e > v.length)
201
+ e = v.length;
202
+ return new u8(v.subarray(s, e));
203
+ }, "slc");
204
+ var ec = [
205
+ "unexpected EOF",
206
+ "invalid block type",
207
+ "invalid length/literal",
208
+ "invalid distance",
209
+ "stream finished",
210
+ "no stream handler",
211
+ ,
212
+ // determined by compression function
213
+ "no callback",
214
+ "invalid UTF-8 data",
215
+ "extra field too long",
216
+ "date not in range 1980-2099",
217
+ "filename too long",
218
+ "stream finishing",
219
+ "invalid zip data"
220
+ // determined by unknown compression method
221
+ ];
222
+ var err = /* @__PURE__ */ __name(function(ind, msg, nt) {
223
+ var e = new Error(msg || ec[ind]);
224
+ e.code = ind;
225
+ if (Error.captureStackTrace)
226
+ Error.captureStackTrace(e, err);
227
+ if (!nt)
228
+ throw e;
229
+ return e;
230
+ }, "err");
231
+ var inflt = /* @__PURE__ */ __name(function(dat, st, buf, dict) {
232
+ var sl = dat.length, dl = dict ? dict.length : 0;
233
+ if (!sl || st.f && !st.l)
234
+ return buf || new u8(0);
235
+ var noBuf = !buf;
236
+ var resize = noBuf || st.i != 2;
237
+ var noSt = st.i;
238
+ if (noBuf)
239
+ buf = new u8(sl * 3);
240
+ var cbuf = /* @__PURE__ */ __name(function(l2) {
241
+ var bl = buf.length;
242
+ if (l2 > bl) {
243
+ var nbuf = new u8(Math.max(bl * 2, l2));
244
+ nbuf.set(buf);
245
+ buf = nbuf;
246
+ }
247
+ }, "cbuf");
248
+ var final = st.f || 0, pos = st.p || 0, bt = st.b || 0, lm = st.l, dm = st.d, lbt = st.m, dbt = st.n;
249
+ var tbts = sl * 8;
250
+ do {
251
+ if (!lm) {
252
+ final = bits(dat, pos, 1);
253
+ var type = bits(dat, pos + 1, 3);
254
+ pos += 3;
255
+ if (!type) {
256
+ var s = shft(pos) + 4, l = dat[s - 4] | dat[s - 3] << 8, t = s + l;
257
+ if (t > sl) {
258
+ if (noSt)
259
+ err(0);
260
+ break;
261
+ }
262
+ if (resize)
263
+ cbuf(bt + l);
264
+ buf.set(dat.subarray(s, t), bt);
265
+ st.b = bt += l, st.p = pos = t * 8, st.f = final;
266
+ continue;
267
+ } else if (type == 1)
268
+ lm = flrm, dm = fdrm, lbt = 9, dbt = 5;
269
+ else if (type == 2) {
270
+ var hLit = bits(dat, pos, 31) + 257, hcLen = bits(dat, pos + 10, 15) + 4;
271
+ var tl = hLit + bits(dat, pos + 5, 31) + 1;
272
+ pos += 14;
273
+ var ldt = new u8(tl);
274
+ var clt = new u8(19);
275
+ for (var i2 = 0; i2 < hcLen; ++i2) {
276
+ clt[clim[i2]] = bits(dat, pos + i2 * 3, 7);
277
+ }
278
+ pos += hcLen * 3;
279
+ var clb = max(clt), clbmsk = (1 << clb) - 1;
280
+ var clm = hMap(clt, clb, 1);
281
+ for (var i2 = 0; i2 < tl; ) {
282
+ var r = clm[bits(dat, pos, clbmsk)];
283
+ pos += r & 15;
284
+ var s = r >> 4;
285
+ if (s < 16) {
286
+ ldt[i2++] = s;
287
+ } else {
288
+ var c = 0, n = 0;
289
+ if (s == 16)
290
+ n = 3 + bits(dat, pos, 3), pos += 2, c = ldt[i2 - 1];
291
+ else if (s == 17)
292
+ n = 3 + bits(dat, pos, 7), pos += 3;
293
+ else if (s == 18)
294
+ n = 11 + bits(dat, pos, 127), pos += 7;
295
+ while (n--)
296
+ ldt[i2++] = c;
297
+ }
298
+ }
299
+ var lt = ldt.subarray(0, hLit), dt = ldt.subarray(hLit);
300
+ lbt = max(lt);
301
+ dbt = max(dt);
302
+ lm = hMap(lt, lbt, 1);
303
+ dm = hMap(dt, dbt, 1);
304
+ } else
305
+ err(1);
306
+ if (pos > tbts) {
307
+ if (noSt)
308
+ err(0);
309
+ break;
310
+ }
311
+ }
312
+ if (resize)
313
+ cbuf(bt + 131072);
314
+ var lms = (1 << lbt) - 1, dms = (1 << dbt) - 1;
315
+ var lpos = pos;
316
+ for (; ; lpos = pos) {
317
+ var c = lm[bits16(dat, pos) & lms], sym = c >> 4;
318
+ pos += c & 15;
319
+ if (pos > tbts) {
320
+ if (noSt)
321
+ err(0);
322
+ break;
323
+ }
324
+ if (!c)
325
+ err(2);
326
+ if (sym < 256)
327
+ buf[bt++] = sym;
328
+ else if (sym == 256) {
329
+ lpos = pos, lm = null;
330
+ break;
331
+ } else {
332
+ var add = sym - 254;
333
+ if (sym > 264) {
334
+ var i2 = sym - 257, b = fleb[i2];
335
+ add = bits(dat, pos, (1 << b) - 1) + fl[i2];
336
+ pos += b;
337
+ }
338
+ var d = dm[bits16(dat, pos) & dms], dsym = d >> 4;
339
+ if (!d)
340
+ err(3);
341
+ pos += d & 15;
342
+ var dt = fd[dsym];
343
+ if (dsym > 3) {
344
+ var b = fdeb[dsym];
345
+ dt += bits16(dat, pos) & (1 << b) - 1, pos += b;
346
+ }
347
+ if (pos > tbts) {
348
+ if (noSt)
349
+ err(0);
350
+ break;
351
+ }
352
+ if (resize)
353
+ cbuf(bt + 131072);
354
+ var end = bt + add;
355
+ if (bt < dt) {
356
+ var shift = dl - dt, dend = Math.min(dt, end);
357
+ if (shift + bt < 0)
358
+ err(3);
359
+ for (; bt < dend; ++bt)
360
+ buf[bt] = dict[shift + bt];
361
+ }
362
+ for (; bt < end; ++bt)
363
+ buf[bt] = buf[bt - dt];
364
+ }
365
+ }
366
+ st.l = lm, st.p = lpos, st.b = bt, st.f = final;
367
+ if (lm)
368
+ final = 1, st.m = lbt, st.d = dm, st.n = dbt;
369
+ } while (!final);
370
+ return bt != buf.length && noBuf ? slc(buf, 0, bt) : buf.subarray(0, bt);
371
+ }, "inflt");
372
+ var wbits = /* @__PURE__ */ __name(function(d, p, v) {
373
+ v <<= p & 7;
374
+ var o = p / 8 | 0;
375
+ d[o] |= v;
376
+ d[o + 1] |= v >> 8;
377
+ }, "wbits");
378
+ var wbits16 = /* @__PURE__ */ __name(function(d, p, v) {
379
+ v <<= p & 7;
380
+ var o = p / 8 | 0;
381
+ d[o] |= v;
382
+ d[o + 1] |= v >> 8;
383
+ d[o + 2] |= v >> 16;
384
+ }, "wbits16");
385
+ var hTree = /* @__PURE__ */ __name(function(d, mb) {
386
+ var t = [];
387
+ for (var i2 = 0; i2 < d.length; ++i2) {
388
+ if (d[i2])
389
+ t.push({ s: i2, f: d[i2] });
390
+ }
391
+ var s = t.length;
392
+ var t2 = t.slice();
393
+ if (!s)
394
+ return { t: et, l: 0 };
395
+ if (s == 1) {
396
+ var v = new u8(t[0].s + 1);
397
+ v[t[0].s] = 1;
398
+ return { t: v, l: 1 };
399
+ }
400
+ t.sort(function(a, b) {
401
+ return a.f - b.f;
402
+ });
403
+ t.push({ s: -1, f: 25001 });
404
+ var l = t[0], r = t[1], i0 = 0, i1 = 1, i22 = 2;
405
+ t[0] = { s: -1, f: l.f + r.f, l, r };
406
+ while (i1 != s - 1) {
407
+ l = t[t[i0].f < t[i22].f ? i0++ : i22++];
408
+ r = t[i0 != i1 && t[i0].f < t[i22].f ? i0++ : i22++];
409
+ t[i1++] = { s: -1, f: l.f + r.f, l, r };
410
+ }
411
+ var maxSym = t2[0].s;
412
+ for (var i2 = 1; i2 < s; ++i2) {
413
+ if (t2[i2].s > maxSym)
414
+ maxSym = t2[i2].s;
415
+ }
416
+ var tr = new u16(maxSym + 1);
417
+ var mbt = ln(t[i1 - 1], tr, 0);
418
+ if (mbt > mb) {
419
+ var i2 = 0, dt = 0;
420
+ var lft = mbt - mb, cst = 1 << lft;
421
+ t2.sort(function(a, b) {
422
+ return tr[b.s] - tr[a.s] || a.f - b.f;
423
+ });
424
+ for (; i2 < s; ++i2) {
425
+ var i2_1 = t2[i2].s;
426
+ if (tr[i2_1] > mb) {
427
+ dt += cst - (1 << mbt - tr[i2_1]);
428
+ tr[i2_1] = mb;
429
+ } else
430
+ break;
431
+ }
432
+ dt >>= lft;
433
+ while (dt > 0) {
434
+ var i2_2 = t2[i2].s;
435
+ if (tr[i2_2] < mb)
436
+ dt -= 1 << mb - tr[i2_2]++ - 1;
437
+ else
438
+ ++i2;
439
+ }
440
+ for (; i2 >= 0 && dt; --i2) {
441
+ var i2_3 = t2[i2].s;
442
+ if (tr[i2_3] == mb) {
443
+ --tr[i2_3];
444
+ ++dt;
445
+ }
446
+ }
447
+ mbt = mb;
448
+ }
449
+ return { t: new u8(tr), l: mbt };
450
+ }, "hTree");
451
+ var ln = /* @__PURE__ */ __name(function(n, l, d) {
452
+ return n.s == -1 ? Math.max(ln(n.l, l, d + 1), ln(n.r, l, d + 1)) : l[n.s] = d;
453
+ }, "ln");
454
+ var lc = /* @__PURE__ */ __name(function(c) {
455
+ var s = c.length;
456
+ while (s && !c[--s])
457
+ ;
458
+ var cl = new u16(++s);
459
+ var cli = 0, cln = c[0], cls = 1;
460
+ var w = /* @__PURE__ */ __name(function(v) {
461
+ cl[cli++] = v;
462
+ }, "w");
463
+ for (var i2 = 1; i2 <= s; ++i2) {
464
+ if (c[i2] == cln && i2 != s)
465
+ ++cls;
466
+ else {
467
+ if (!cln && cls > 2) {
468
+ for (; cls > 138; cls -= 138)
469
+ w(32754);
470
+ if (cls > 2) {
471
+ w(cls > 10 ? cls - 11 << 5 | 28690 : cls - 3 << 5 | 12305);
472
+ cls = 0;
473
+ }
474
+ } else if (cls > 3) {
475
+ w(cln), --cls;
476
+ for (; cls > 6; cls -= 6)
477
+ w(8304);
478
+ if (cls > 2)
479
+ w(cls - 3 << 5 | 8208), cls = 0;
480
+ }
481
+ while (cls--)
482
+ w(cln);
483
+ cls = 1;
484
+ cln = c[i2];
485
+ }
486
+ }
487
+ return { c: cl.subarray(0, cli), n: s };
488
+ }, "lc");
489
+ var clen = /* @__PURE__ */ __name(function(cf, cl) {
490
+ var l = 0;
491
+ for (var i2 = 0; i2 < cl.length; ++i2)
492
+ l += cf[i2] * cl[i2];
493
+ return l;
494
+ }, "clen");
495
+ var wfblk = /* @__PURE__ */ __name(function(out, pos, dat) {
496
+ var s = dat.length;
497
+ var o = shft(pos + 2);
498
+ out[o] = s & 255;
499
+ out[o + 1] = s >> 8;
500
+ out[o + 2] = out[o] ^ 255;
501
+ out[o + 3] = out[o + 1] ^ 255;
502
+ for (var i2 = 0; i2 < s; ++i2)
503
+ out[o + i2 + 4] = dat[i2];
504
+ return (o + 4 + s) * 8;
505
+ }, "wfblk");
506
+ var wblk = /* @__PURE__ */ __name(function(dat, out, final, syms, lf, df, eb, li, bs, bl, p) {
507
+ wbits(out, p++, final);
508
+ ++lf[256];
509
+ var _a2 = hTree(lf, 15), dlt = _a2.t, mlb = _a2.l;
510
+ var _b2 = hTree(df, 15), ddt = _b2.t, mdb = _b2.l;
511
+ var _c = lc(dlt), lclt = _c.c, nlc = _c.n;
512
+ var _d = lc(ddt), lcdt = _d.c, ndc = _d.n;
513
+ var lcfreq = new u16(19);
514
+ for (var i2 = 0; i2 < lclt.length; ++i2)
515
+ ++lcfreq[lclt[i2] & 31];
516
+ for (var i2 = 0; i2 < lcdt.length; ++i2)
517
+ ++lcfreq[lcdt[i2] & 31];
518
+ var _e = hTree(lcfreq, 7), lct = _e.t, mlcb = _e.l;
519
+ var nlcc = 19;
520
+ for (; nlcc > 4 && !lct[clim[nlcc - 1]]; --nlcc)
521
+ ;
522
+ var flen = bl + 5 << 3;
523
+ var ftlen = clen(lf, flt) + clen(df, fdt) + eb;
524
+ var dtlen = clen(lf, dlt) + clen(df, ddt) + eb + 14 + 3 * nlcc + clen(lcfreq, lct) + 2 * lcfreq[16] + 3 * lcfreq[17] + 7 * lcfreq[18];
525
+ if (bs >= 0 && flen <= ftlen && flen <= dtlen)
526
+ return wfblk(out, p, dat.subarray(bs, bs + bl));
527
+ var lm, ll, dm, dl;
528
+ wbits(out, p, 1 + (dtlen < ftlen)), p += 2;
529
+ if (dtlen < ftlen) {
530
+ lm = hMap(dlt, mlb, 0), ll = dlt, dm = hMap(ddt, mdb, 0), dl = ddt;
531
+ var llm = hMap(lct, mlcb, 0);
532
+ wbits(out, p, nlc - 257);
533
+ wbits(out, p + 5, ndc - 1);
534
+ wbits(out, p + 10, nlcc - 4);
535
+ p += 14;
536
+ for (var i2 = 0; i2 < nlcc; ++i2)
537
+ wbits(out, p + 3 * i2, lct[clim[i2]]);
538
+ p += 3 * nlcc;
539
+ var lcts = [lclt, lcdt];
540
+ for (var it = 0; it < 2; ++it) {
541
+ var clct = lcts[it];
542
+ for (var i2 = 0; i2 < clct.length; ++i2) {
543
+ var len = clct[i2] & 31;
544
+ wbits(out, p, llm[len]), p += lct[len];
545
+ if (len > 15)
546
+ wbits(out, p, clct[i2] >> 5 & 127), p += clct[i2] >> 12;
547
+ }
548
+ }
549
+ } else {
550
+ lm = flm, ll = flt, dm = fdm, dl = fdt;
551
+ }
552
+ for (var i2 = 0; i2 < li; ++i2) {
553
+ var sym = syms[i2];
554
+ if (sym > 255) {
555
+ var len = sym >> 18 & 31;
556
+ wbits16(out, p, lm[len + 257]), p += ll[len + 257];
557
+ if (len > 7)
558
+ wbits(out, p, sym >> 23 & 31), p += fleb[len];
559
+ var dst = sym & 31;
560
+ wbits16(out, p, dm[dst]), p += dl[dst];
561
+ if (dst > 3)
562
+ wbits16(out, p, sym >> 5 & 8191), p += fdeb[dst];
563
+ } else {
564
+ wbits16(out, p, lm[sym]), p += ll[sym];
565
+ }
566
+ }
567
+ wbits16(out, p, lm[256]);
568
+ return p + ll[256];
569
+ }, "wblk");
570
+ var deo = /* @__PURE__ */ new i32([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]);
571
+ var et = /* @__PURE__ */ new u8(0);
572
+ var dflt = /* @__PURE__ */ __name(function(dat, lvl, plvl, pre, post, st) {
573
+ var s = st.z || dat.length;
574
+ var o = new u8(pre + s + 5 * (1 + Math.ceil(s / 7e3)) + post);
575
+ var w = o.subarray(pre, o.length - post);
576
+ var lst = st.l;
577
+ var pos = (st.r || 0) & 7;
578
+ if (lvl) {
579
+ if (pos)
580
+ w[0] = st.r >> 3;
581
+ var opt = deo[lvl - 1];
582
+ var n = opt >> 13, c = opt & 8191;
583
+ var msk_1 = (1 << plvl) - 1;
584
+ var prev = st.p || new u16(32768), head = st.h || new u16(msk_1 + 1);
585
+ var bs1_1 = Math.ceil(plvl / 3), bs2_1 = 2 * bs1_1;
586
+ var hsh = /* @__PURE__ */ __name(function(i3) {
587
+ return (dat[i3] ^ dat[i3 + 1] << bs1_1 ^ dat[i3 + 2] << bs2_1) & msk_1;
588
+ }, "hsh");
589
+ var syms = new i32(25e3);
590
+ var lf = new u16(288), df = new u16(32);
591
+ var lc_1 = 0, eb = 0, i2 = st.i || 0, li = 0, wi = st.w || 0, bs = 0;
592
+ for (; i2 + 2 < s; ++i2) {
593
+ var hv = hsh(i2);
594
+ var imod = i2 & 32767, pimod = head[hv];
595
+ prev[imod] = pimod;
596
+ head[hv] = imod;
597
+ if (wi <= i2) {
598
+ var rem = s - i2;
599
+ if ((lc_1 > 7e3 || li > 24576) && (rem > 423 || !lst)) {
600
+ pos = wblk(dat, w, 0, syms, lf, df, eb, li, bs, i2 - bs, pos);
601
+ li = lc_1 = eb = 0, bs = i2;
602
+ for (var j = 0; j < 286; ++j)
603
+ lf[j] = 0;
604
+ for (var j = 0; j < 30; ++j)
605
+ df[j] = 0;
606
+ }
607
+ var l = 2, d = 0, ch_1 = c, dif = imod - pimod & 32767;
608
+ if (rem > 2 && hv == hsh(i2 - dif)) {
609
+ var maxn = Math.min(n, rem) - 1;
610
+ var maxd = Math.min(32767, i2);
611
+ var ml = Math.min(258, rem);
612
+ while (dif <= maxd && --ch_1 && imod != pimod) {
613
+ if (dat[i2 + l] == dat[i2 + l - dif]) {
614
+ var nl = 0;
615
+ for (; nl < ml && dat[i2 + nl] == dat[i2 + nl - dif]; ++nl)
616
+ ;
617
+ if (nl > l) {
618
+ l = nl, d = dif;
619
+ if (nl > maxn)
620
+ break;
621
+ var mmd = Math.min(dif, nl - 2);
622
+ var md = 0;
623
+ for (var j = 0; j < mmd; ++j) {
624
+ var ti = i2 - dif + j & 32767;
625
+ var pti = prev[ti];
626
+ var cd = ti - pti & 32767;
627
+ if (cd > md)
628
+ md = cd, pimod = ti;
629
+ }
630
+ }
631
+ }
632
+ imod = pimod, pimod = prev[imod];
633
+ dif += imod - pimod & 32767;
634
+ }
635
+ }
636
+ if (d) {
637
+ syms[li++] = 268435456 | revfl[l] << 18 | revfd[d];
638
+ var lin = revfl[l] & 31, din = revfd[d] & 31;
639
+ eb += fleb[lin] + fdeb[din];
640
+ ++lf[257 + lin];
641
+ ++df[din];
642
+ wi = i2 + l;
643
+ ++lc_1;
644
+ } else {
645
+ syms[li++] = dat[i2];
646
+ ++lf[dat[i2]];
647
+ }
648
+ }
649
+ }
650
+ for (i2 = Math.max(i2, wi); i2 < s; ++i2) {
651
+ syms[li++] = dat[i2];
652
+ ++lf[dat[i2]];
653
+ }
654
+ pos = wblk(dat, w, lst, syms, lf, df, eb, li, bs, i2 - bs, pos);
655
+ if (!lst) {
656
+ st.r = pos & 7 | w[pos / 8 | 0] << 3;
657
+ pos -= 7;
658
+ st.h = head, st.p = prev, st.i = i2, st.w = wi;
659
+ }
660
+ } else {
661
+ for (var i2 = st.w || 0; i2 < s + lst; i2 += 65535) {
662
+ var e = i2 + 65535;
663
+ if (e >= s) {
664
+ w[pos / 8 | 0] = lst;
665
+ e = s;
666
+ }
667
+ pos = wfblk(w, pos + 1, dat.subarray(i2, e));
668
+ }
669
+ st.i = s;
670
+ }
671
+ return slc(o, 0, pre + shft(pos) + post);
672
+ }, "dflt");
673
+ var adler = /* @__PURE__ */ __name(function() {
674
+ var a = 1, b = 0;
675
+ return {
676
+ p: /* @__PURE__ */ __name(function(d) {
677
+ var n = a, m = b;
678
+ var l = d.length | 0;
679
+ for (var i2 = 0; i2 != l; ) {
680
+ var e = Math.min(i2 + 2655, l);
681
+ for (; i2 < e; ++i2)
682
+ m += n += d[i2];
683
+ n = (n & 65535) + 15 * (n >> 16), m = (m & 65535) + 15 * (m >> 16);
684
+ }
685
+ a = n, b = m;
686
+ }, "p"),
687
+ d: /* @__PURE__ */ __name(function() {
688
+ a %= 65521, b %= 65521;
689
+ return (a & 255) << 24 | (a & 65280) << 8 | (b & 255) << 8 | b >> 8;
690
+ }, "d")
691
+ };
692
+ }, "adler");
693
+ var dopt = /* @__PURE__ */ __name(function(dat, opt, pre, post, st) {
694
+ if (!st) {
695
+ st = { l: 1 };
696
+ if (opt.dictionary) {
697
+ var dict = opt.dictionary.subarray(-32768);
698
+ var newDat = new u8(dict.length + dat.length);
699
+ newDat.set(dict);
700
+ newDat.set(dat, dict.length);
701
+ dat = newDat;
702
+ st.w = dict.length;
703
+ }
704
+ }
705
+ return dflt(dat, opt.level == null ? 6 : opt.level, opt.mem == null ? st.l ? Math.ceil(Math.max(8, Math.min(13, Math.log(dat.length))) * 1.5) : 20 : 12 + opt.mem, pre, post, st);
706
+ }, "dopt");
707
+ var wbytes = /* @__PURE__ */ __name(function(d, b, v) {
708
+ for (; v; ++b)
709
+ d[b] = v, v >>>= 8;
710
+ }, "wbytes");
711
+ var zlh = /* @__PURE__ */ __name(function(c, o) {
712
+ var lv = o.level, fl2 = lv == 0 ? 0 : lv < 6 ? 1 : lv == 9 ? 3 : 2;
713
+ c[0] = 120, c[1] = fl2 << 6 | (o.dictionary && 32);
714
+ c[1] |= 31 - (c[0] << 8 | c[1]) % 31;
715
+ if (o.dictionary) {
716
+ var h = adler();
717
+ h.p(o.dictionary);
718
+ wbytes(c, 2, h.d());
719
+ }
720
+ }, "zlh");
721
+ var zls = /* @__PURE__ */ __name(function(d, dict) {
722
+ if ((d[0] & 15) != 8 || d[0] >> 4 > 7 || (d[0] << 8 | d[1]) % 31)
723
+ err(6, "invalid zlib data");
724
+ if ((d[1] >> 5 & 1) == +!dict)
725
+ err(6, "invalid zlib data: " + (d[1] & 32 ? "need" : "unexpected") + " dictionary");
726
+ return (d[1] >> 3 & 4) + 2;
727
+ }, "zls");
728
+ var Inflate = /* @__PURE__ */ (function() {
729
+ function Inflate2(opts, cb) {
730
+ if (typeof opts == "function")
731
+ cb = opts, opts = {};
732
+ this.ondata = cb;
733
+ var dict = opts && opts.dictionary && opts.dictionary.subarray(-32768);
734
+ this.s = { i: 0, b: dict ? dict.length : 0 };
735
+ this.o = new u8(32768);
736
+ this.p = new u8(0);
737
+ if (dict)
738
+ this.o.set(dict);
739
+ }
740
+ __name(Inflate2, "Inflate");
741
+ Inflate2.prototype.e = function(c) {
742
+ if (!this.ondata)
743
+ err(5);
744
+ if (this.d)
745
+ err(4);
746
+ if (!this.p.length)
747
+ this.p = c;
748
+ else if (c.length) {
749
+ var n = new u8(this.p.length + c.length);
750
+ n.set(this.p), n.set(c, this.p.length), this.p = n;
751
+ }
752
+ };
753
+ Inflate2.prototype.c = function(final) {
754
+ this.s.i = +(this.d = final || false);
755
+ var bts = this.s.b;
756
+ var dt = inflt(this.p, this.s, this.o);
757
+ this.ondata(slc(dt, bts, this.s.b), this.d);
758
+ this.o = slc(dt, this.s.b - 32768), this.s.b = this.o.length;
759
+ this.p = slc(this.p, this.s.p / 8 | 0), this.s.p &= 7;
760
+ };
761
+ Inflate2.prototype.push = function(chunk, final) {
762
+ this.e(chunk), this.c(final);
763
+ };
764
+ return Inflate2;
765
+ })();
766
+ function zlibSync(data, opts) {
767
+ if (!opts)
768
+ opts = {};
769
+ var a = adler();
770
+ a.p(data);
771
+ var d = dopt(data, opts, opts.dictionary ? 6 : 2, 4);
772
+ return zlh(d, opts), wbytes(d, d.length - 4, a.d()), d;
773
+ }
774
+ __name(zlibSync, "zlibSync");
775
+ var Unzlib = /* @__PURE__ */ (function() {
776
+ function Unzlib2(opts, cb) {
777
+ Inflate.call(this, opts, cb);
778
+ this.v = opts && opts.dictionary ? 2 : 1;
779
+ }
780
+ __name(Unzlib2, "Unzlib");
781
+ Unzlib2.prototype.push = function(chunk, final) {
782
+ Inflate.prototype.e.call(this, chunk);
783
+ if (this.v) {
784
+ if (this.p.length < 6 && !final)
785
+ return;
786
+ this.p = this.p.subarray(zls(this.p, this.v - 1)), this.v = 0;
787
+ }
788
+ if (final) {
789
+ if (this.p.length < 4)
790
+ err(6, "invalid zlib data");
791
+ this.p = this.p.subarray(0, -4);
792
+ }
793
+ Inflate.prototype.c.call(this, final);
794
+ };
795
+ return Unzlib2;
796
+ })();
797
+ function unzlibSync(data, opts) {
798
+ return inflt(data.subarray(zls(data, opts && opts.dictionary), -4), { i: 2 }, opts && opts.out, opts && opts.dictionary);
799
+ }
800
+ __name(unzlibSync, "unzlibSync");
801
+ var td = typeof TextDecoder != "undefined" && /* @__PURE__ */ new TextDecoder();
802
+ var tds = 0;
803
+ try {
804
+ td.decode(et, { stream: true });
805
+ tds = 1;
806
+ } catch (e) {
807
+ }
808
+
809
+ // ../../node_modules/.pnpm/iobuffer@6.0.1/node_modules/iobuffer/lib/text.js
810
+ function decode(bytes, encoding = "utf8") {
811
+ const decoder = new TextDecoder(encoding);
812
+ return decoder.decode(bytes);
813
+ }
814
+ __name(decode, "decode");
815
+ var encoder = new TextEncoder();
816
+ function encode(str) {
817
+ return encoder.encode(str);
818
+ }
819
+ __name(encode, "encode");
820
+
821
+ // ../../node_modules/.pnpm/iobuffer@6.0.1/node_modules/iobuffer/lib/iobuffer.js
822
+ var defaultByteLength = 1024 * 8;
823
+ var hostBigEndian = (() => {
824
+ const array = new Uint8Array(4);
825
+ const view = new Uint32Array(array.buffer);
826
+ return !((view[0] = 1) & array[0]);
827
+ })();
828
+ var typedArrays = {
829
+ int8: globalThis.Int8Array,
830
+ uint8: globalThis.Uint8Array,
831
+ int16: globalThis.Int16Array,
832
+ uint16: globalThis.Uint16Array,
833
+ int32: globalThis.Int32Array,
834
+ uint32: globalThis.Uint32Array,
835
+ uint64: globalThis.BigUint64Array,
836
+ int64: globalThis.BigInt64Array,
837
+ float32: globalThis.Float32Array,
838
+ float64: globalThis.Float64Array
839
+ };
840
+ var IOBuffer = class _IOBuffer {
841
+ static {
842
+ __name(this, "IOBuffer");
843
+ }
844
+ /**
845
+ * Reference to the internal ArrayBuffer object.
846
+ */
847
+ buffer;
848
+ /**
849
+ * Byte length of the internal ArrayBuffer.
850
+ */
851
+ byteLength;
852
+ /**
853
+ * Byte offset of the internal ArrayBuffer.
854
+ */
855
+ byteOffset;
856
+ /**
857
+ * Byte length of the internal ArrayBuffer.
858
+ */
859
+ length;
860
+ /**
861
+ * The current offset of the buffer's pointer.
862
+ */
863
+ offset;
864
+ lastWrittenByte;
865
+ littleEndian;
866
+ _data;
867
+ _mark;
868
+ _marks;
869
+ /**
870
+ * Create a new IOBuffer.
871
+ * @param data - The data to construct the IOBuffer with.
872
+ * If data is a number, it will be the new buffer's length<br>
873
+ * If data is `undefined`, the buffer will be initialized with a default length of 8Kb<br>
874
+ * If data is an ArrayBuffer, SharedArrayBuffer, an ArrayBufferView (Typed Array), an IOBuffer instance,
875
+ * or a Node.js Buffer, a view will be created over the underlying ArrayBuffer.
876
+ * @param options - An object for the options.
877
+ * @returns A new IOBuffer instance.
878
+ */
879
+ constructor(data = defaultByteLength, options = {}) {
880
+ let dataIsGiven = false;
881
+ if (typeof data === "number") {
882
+ data = new ArrayBuffer(data);
883
+ } else {
884
+ dataIsGiven = true;
885
+ this.lastWrittenByte = data.byteLength;
886
+ }
887
+ const offset = options.offset ? options.offset >>> 0 : 0;
888
+ const byteLength = data.byteLength - offset;
889
+ let dvOffset = offset;
890
+ if (ArrayBuffer.isView(data) || data instanceof _IOBuffer) {
891
+ if (data.byteLength !== data.buffer.byteLength) {
892
+ dvOffset = data.byteOffset + offset;
893
+ }
894
+ data = data.buffer;
895
+ }
896
+ if (dataIsGiven) {
897
+ this.lastWrittenByte = byteLength;
898
+ } else {
899
+ this.lastWrittenByte = 0;
900
+ }
901
+ this.buffer = data;
902
+ this.length = byteLength;
903
+ this.byteLength = byteLength;
904
+ this.byteOffset = dvOffset;
905
+ this.offset = 0;
906
+ this.littleEndian = true;
907
+ this._data = new DataView(this.buffer, dvOffset, byteLength);
908
+ this._mark = 0;
909
+ this._marks = [];
910
+ }
911
+ /**
912
+ * Checks if the memory allocated to the buffer is sufficient to store more
913
+ * bytes after the offset.
914
+ * @param byteLength - The needed memory in bytes.
915
+ * @returns `true` if there is sufficient space and `false` otherwise.
916
+ */
917
+ available(byteLength = 1) {
918
+ return this.offset + byteLength <= this.length;
919
+ }
920
+ /**
921
+ * Check if little-endian mode is used for reading and writing multi-byte
922
+ * values.
923
+ * @returns `true` if little-endian mode is used, `false` otherwise.
924
+ */
925
+ isLittleEndian() {
926
+ return this.littleEndian;
927
+ }
928
+ /**
929
+ * Set little-endian mode for reading and writing multi-byte values.
930
+ * @returns This.
931
+ */
932
+ setLittleEndian() {
933
+ this.littleEndian = true;
934
+ return this;
935
+ }
936
+ /**
937
+ * Check if big-endian mode is used for reading and writing multi-byte values.
938
+ * @returns `true` if big-endian mode is used, `false` otherwise.
939
+ */
940
+ isBigEndian() {
941
+ return !this.littleEndian;
942
+ }
943
+ /**
944
+ * Switches to big-endian mode for reading and writing multi-byte values.
945
+ * @returns This.
946
+ */
947
+ setBigEndian() {
948
+ this.littleEndian = false;
949
+ return this;
950
+ }
951
+ /**
952
+ * Move the pointer n bytes forward.
953
+ * @param n - Number of bytes to skip.
954
+ * @returns This.
955
+ */
956
+ skip(n = 1) {
957
+ this.offset += n;
958
+ return this;
959
+ }
960
+ /**
961
+ * Move the pointer n bytes backward.
962
+ * @param n - Number of bytes to move back.
963
+ * @returns This.
964
+ */
965
+ back(n = 1) {
966
+ this.offset -= n;
967
+ return this;
968
+ }
969
+ /**
970
+ * Move the pointer to the given offset.
971
+ * @param offset - The offset to move to.
972
+ * @returns This.
973
+ */
974
+ seek(offset) {
975
+ this.offset = offset;
976
+ return this;
977
+ }
978
+ /**
979
+ * Store the current pointer offset.
980
+ * @see {@link IOBuffer#reset}
981
+ * @returns This.
982
+ */
983
+ mark() {
984
+ this._mark = this.offset;
985
+ return this;
986
+ }
987
+ /**
988
+ * Move the pointer back to the last pointer offset set by mark.
989
+ * @see {@link IOBuffer#mark}
990
+ * @returns This.
991
+ */
992
+ reset() {
993
+ this.offset = this._mark;
994
+ return this;
995
+ }
996
+ /**
997
+ * Push the current pointer offset to the mark stack.
998
+ * @see {@link IOBuffer#popMark}
999
+ * @returns This.
1000
+ */
1001
+ pushMark() {
1002
+ this._marks.push(this.offset);
1003
+ return this;
1004
+ }
1005
+ /**
1006
+ * Pop the last pointer offset from the mark stack, and set the current
1007
+ * pointer offset to the popped value.
1008
+ * @see {@link IOBuffer#pushMark}
1009
+ * @returns This.
1010
+ */
1011
+ popMark() {
1012
+ const offset = this._marks.pop();
1013
+ if (offset === void 0) {
1014
+ throw new Error("Mark stack empty");
1015
+ }
1016
+ this.seek(offset);
1017
+ return this;
1018
+ }
1019
+ /**
1020
+ * Move the pointer offset back to 0.
1021
+ * @returns This.
1022
+ */
1023
+ rewind() {
1024
+ this.offset = 0;
1025
+ return this;
1026
+ }
1027
+ /**
1028
+ * Make sure the buffer has sufficient memory to write a given byteLength at
1029
+ * the current pointer offset.
1030
+ * If the buffer's memory is insufficient, this method will create a new
1031
+ * buffer (a copy) with a length that is twice (byteLength + current offset).
1032
+ * @param byteLength - The needed memory in bytes.
1033
+ * @returns This.
1034
+ */
1035
+ ensureAvailable(byteLength = 1) {
1036
+ if (!this.available(byteLength)) {
1037
+ const lengthNeeded = this.offset + byteLength;
1038
+ const newLength = lengthNeeded * 2;
1039
+ const newArray = new Uint8Array(newLength);
1040
+ newArray.set(new Uint8Array(this.buffer));
1041
+ this.buffer = newArray.buffer;
1042
+ this.length = newLength;
1043
+ this.byteLength = newLength;
1044
+ this._data = new DataView(this.buffer);
1045
+ }
1046
+ return this;
1047
+ }
1048
+ /**
1049
+ * Read a byte and return false if the byte's value is 0, or true otherwise.
1050
+ * Moves pointer forward by one byte.
1051
+ * @returns The read boolean.
1052
+ */
1053
+ readBoolean() {
1054
+ return this.readUint8() !== 0;
1055
+ }
1056
+ /**
1057
+ * Read a signed 8-bit integer and move pointer forward by 1 byte.
1058
+ * @returns The read byte.
1059
+ */
1060
+ readInt8() {
1061
+ return this._data.getInt8(this.offset++);
1062
+ }
1063
+ /**
1064
+ * Read an unsigned 8-bit integer and move pointer forward by 1 byte.
1065
+ * @returns The read byte.
1066
+ */
1067
+ readUint8() {
1068
+ return this._data.getUint8(this.offset++);
1069
+ }
1070
+ /**
1071
+ * Alias for {@link IOBuffer#readUint8}.
1072
+ * @returns The read byte.
1073
+ */
1074
+ readByte() {
1075
+ return this.readUint8();
1076
+ }
1077
+ /**
1078
+ * Read `n` bytes and move pointer forward by `n` bytes.
1079
+ * @param n - Number of bytes to read.
1080
+ * @returns The read bytes.
1081
+ */
1082
+ readBytes(n = 1) {
1083
+ return this.readArray(n, "uint8");
1084
+ }
1085
+ /**
1086
+ * Creates an array of corresponding to the type `type` and size `size`.
1087
+ * For example, type `uint8` will create a `Uint8Array`.
1088
+ * @param size - size of the resulting array
1089
+ * @param type - number type of elements to read
1090
+ * @returns The read array.
1091
+ */
1092
+ readArray(size, type) {
1093
+ const bytes = typedArrays[type].BYTES_PER_ELEMENT * size;
1094
+ const offset = this.byteOffset + this.offset;
1095
+ const slice = this.buffer.slice(offset, offset + bytes);
1096
+ if (this.littleEndian === hostBigEndian && type !== "uint8" && type !== "int8") {
1097
+ const slice2 = new Uint8Array(this.buffer.slice(offset, offset + bytes));
1098
+ slice2.reverse();
1099
+ const returnArray2 = new typedArrays[type](slice2.buffer);
1100
+ this.offset += bytes;
1101
+ returnArray2.reverse();
1102
+ return returnArray2;
1103
+ }
1104
+ const returnArray = new typedArrays[type](slice);
1105
+ this.offset += bytes;
1106
+ return returnArray;
1107
+ }
1108
+ /**
1109
+ * Read a 16-bit signed integer and move pointer forward by 2 bytes.
1110
+ * @returns The read value.
1111
+ */
1112
+ readInt16() {
1113
+ const value = this._data.getInt16(this.offset, this.littleEndian);
1114
+ this.offset += 2;
1115
+ return value;
1116
+ }
1117
+ /**
1118
+ * Read a 16-bit unsigned integer and move pointer forward by 2 bytes.
1119
+ * @returns The read value.
1120
+ */
1121
+ readUint16() {
1122
+ const value = this._data.getUint16(this.offset, this.littleEndian);
1123
+ this.offset += 2;
1124
+ return value;
1125
+ }
1126
+ /**
1127
+ * Read a 32-bit signed integer and move pointer forward by 4 bytes.
1128
+ * @returns The read value.
1129
+ */
1130
+ readInt32() {
1131
+ const value = this._data.getInt32(this.offset, this.littleEndian);
1132
+ this.offset += 4;
1133
+ return value;
1134
+ }
1135
+ /**
1136
+ * Read a 32-bit unsigned integer and move pointer forward by 4 bytes.
1137
+ * @returns The read value.
1138
+ */
1139
+ readUint32() {
1140
+ const value = this._data.getUint32(this.offset, this.littleEndian);
1141
+ this.offset += 4;
1142
+ return value;
1143
+ }
1144
+ /**
1145
+ * Read a 32-bit floating number and move pointer forward by 4 bytes.
1146
+ * @returns The read value.
1147
+ */
1148
+ readFloat32() {
1149
+ const value = this._data.getFloat32(this.offset, this.littleEndian);
1150
+ this.offset += 4;
1151
+ return value;
1152
+ }
1153
+ /**
1154
+ * Read a 64-bit floating number and move pointer forward by 8 bytes.
1155
+ * @returns The read value.
1156
+ */
1157
+ readFloat64() {
1158
+ const value = this._data.getFloat64(this.offset, this.littleEndian);
1159
+ this.offset += 8;
1160
+ return value;
1161
+ }
1162
+ /**
1163
+ * Read a 64-bit signed integer number and move pointer forward by 8 bytes.
1164
+ * @returns The read value.
1165
+ */
1166
+ readBigInt64() {
1167
+ const value = this._data.getBigInt64(this.offset, this.littleEndian);
1168
+ this.offset += 8;
1169
+ return value;
1170
+ }
1171
+ /**
1172
+ * Read a 64-bit unsigned integer number and move pointer forward by 8 bytes.
1173
+ * @returns The read value.
1174
+ */
1175
+ readBigUint64() {
1176
+ const value = this._data.getBigUint64(this.offset, this.littleEndian);
1177
+ this.offset += 8;
1178
+ return value;
1179
+ }
1180
+ /**
1181
+ * Read a 1-byte ASCII character and move pointer forward by 1 byte.
1182
+ * @returns The read character.
1183
+ */
1184
+ readChar() {
1185
+ return String.fromCharCode(this.readInt8());
1186
+ }
1187
+ /**
1188
+ * Read `n` 1-byte ASCII characters and move pointer forward by `n` bytes.
1189
+ * @param n - Number of characters to read.
1190
+ * @returns The read characters.
1191
+ */
1192
+ readChars(n = 1) {
1193
+ let result = "";
1194
+ for (let i2 = 0; i2 < n; i2++) {
1195
+ result += this.readChar();
1196
+ }
1197
+ return result;
1198
+ }
1199
+ /**
1200
+ * Read the next `n` bytes, return a UTF-8 decoded string and move pointer
1201
+ * forward by `n` bytes.
1202
+ * @param n - Number of bytes to read.
1203
+ * @returns The decoded string.
1204
+ */
1205
+ readUtf8(n = 1) {
1206
+ return decode(this.readBytes(n));
1207
+ }
1208
+ /**
1209
+ * Read the next `n` bytes, return a string decoded with `encoding` and move pointer
1210
+ * forward by `n` bytes.
1211
+ * If no encoding is passed, the function is equivalent to @see {@link IOBuffer#readUtf8}
1212
+ * @param n - Number of bytes to read.
1213
+ * @param encoding - The encoding to use. Default is 'utf8'.
1214
+ * @returns The decoded string.
1215
+ */
1216
+ decodeText(n = 1, encoding = "utf8") {
1217
+ return decode(this.readBytes(n), encoding);
1218
+ }
1219
+ /**
1220
+ * Write 0xff if the passed value is truthy, 0x00 otherwise and move pointer
1221
+ * forward by 1 byte.
1222
+ * @param value - The value to write.
1223
+ * @returns This.
1224
+ */
1225
+ writeBoolean(value) {
1226
+ this.writeUint8(value ? 255 : 0);
1227
+ return this;
1228
+ }
1229
+ /**
1230
+ * Write `value` as an 8-bit signed integer and move pointer forward by 1 byte.
1231
+ * @param value - The value to write.
1232
+ * @returns This.
1233
+ */
1234
+ writeInt8(value) {
1235
+ this.ensureAvailable(1);
1236
+ this._data.setInt8(this.offset++, value);
1237
+ this._updateLastWrittenByte();
1238
+ return this;
1239
+ }
1240
+ /**
1241
+ * Write `value` as an 8-bit unsigned integer and move pointer forward by 1
1242
+ * byte.
1243
+ * @param value - The value to write.
1244
+ * @returns This.
1245
+ */
1246
+ writeUint8(value) {
1247
+ this.ensureAvailable(1);
1248
+ this._data.setUint8(this.offset++, value);
1249
+ this._updateLastWrittenByte();
1250
+ return this;
1251
+ }
1252
+ /**
1253
+ * An alias for {@link IOBuffer#writeUint8}.
1254
+ * @param value - The value to write.
1255
+ * @returns This.
1256
+ */
1257
+ writeByte(value) {
1258
+ return this.writeUint8(value);
1259
+ }
1260
+ /**
1261
+ * Write all elements of `bytes` as uint8 values and move pointer forward by
1262
+ * `bytes.length` bytes.
1263
+ * @param bytes - The array of bytes to write.
1264
+ * @returns This.
1265
+ */
1266
+ writeBytes(bytes) {
1267
+ this.ensureAvailable(bytes.length);
1268
+ for (let i2 = 0; i2 < bytes.length; i2++) {
1269
+ this._data.setUint8(this.offset++, bytes[i2]);
1270
+ }
1271
+ this._updateLastWrittenByte();
1272
+ return this;
1273
+ }
1274
+ /**
1275
+ * Write `value` as a 16-bit signed integer and move pointer forward by 2
1276
+ * bytes.
1277
+ * @param value - The value to write.
1278
+ * @returns This.
1279
+ */
1280
+ writeInt16(value) {
1281
+ this.ensureAvailable(2);
1282
+ this._data.setInt16(this.offset, value, this.littleEndian);
1283
+ this.offset += 2;
1284
+ this._updateLastWrittenByte();
1285
+ return this;
1286
+ }
1287
+ /**
1288
+ * Write `value` as a 16-bit unsigned integer and move pointer forward by 2
1289
+ * bytes.
1290
+ * @param value - The value to write.
1291
+ * @returns This.
1292
+ */
1293
+ writeUint16(value) {
1294
+ this.ensureAvailable(2);
1295
+ this._data.setUint16(this.offset, value, this.littleEndian);
1296
+ this.offset += 2;
1297
+ this._updateLastWrittenByte();
1298
+ return this;
1299
+ }
1300
+ /**
1301
+ * Write `value` as a 32-bit signed integer and move pointer forward by 4
1302
+ * bytes.
1303
+ * @param value - The value to write.
1304
+ * @returns This.
1305
+ */
1306
+ writeInt32(value) {
1307
+ this.ensureAvailable(4);
1308
+ this._data.setInt32(this.offset, value, this.littleEndian);
1309
+ this.offset += 4;
1310
+ this._updateLastWrittenByte();
1311
+ return this;
1312
+ }
1313
+ /**
1314
+ * Write `value` as a 32-bit unsigned integer and move pointer forward by 4
1315
+ * bytes.
1316
+ * @param value - The value to write.
1317
+ * @returns This.
1318
+ */
1319
+ writeUint32(value) {
1320
+ this.ensureAvailable(4);
1321
+ this._data.setUint32(this.offset, value, this.littleEndian);
1322
+ this.offset += 4;
1323
+ this._updateLastWrittenByte();
1324
+ return this;
1325
+ }
1326
+ /**
1327
+ * Write `value` as a 32-bit floating number and move pointer forward by 4
1328
+ * bytes.
1329
+ * @param value - The value to write.
1330
+ * @returns This.
1331
+ */
1332
+ writeFloat32(value) {
1333
+ this.ensureAvailable(4);
1334
+ this._data.setFloat32(this.offset, value, this.littleEndian);
1335
+ this.offset += 4;
1336
+ this._updateLastWrittenByte();
1337
+ return this;
1338
+ }
1339
+ /**
1340
+ * Write `value` as a 64-bit floating number and move pointer forward by 8
1341
+ * bytes.
1342
+ * @param value - The value to write.
1343
+ * @returns This.
1344
+ */
1345
+ writeFloat64(value) {
1346
+ this.ensureAvailable(8);
1347
+ this._data.setFloat64(this.offset, value, this.littleEndian);
1348
+ this.offset += 8;
1349
+ this._updateLastWrittenByte();
1350
+ return this;
1351
+ }
1352
+ /**
1353
+ * Write `value` as a 64-bit signed bigint and move pointer forward by 8
1354
+ * bytes.
1355
+ * @param value - The value to write.
1356
+ * @returns This.
1357
+ */
1358
+ writeBigInt64(value) {
1359
+ this.ensureAvailable(8);
1360
+ this._data.setBigInt64(this.offset, value, this.littleEndian);
1361
+ this.offset += 8;
1362
+ this._updateLastWrittenByte();
1363
+ return this;
1364
+ }
1365
+ /**
1366
+ * Write `value` as a 64-bit unsigned bigint and move pointer forward by 8
1367
+ * bytes.
1368
+ * @param value - The value to write.
1369
+ * @returns This.
1370
+ */
1371
+ writeBigUint64(value) {
1372
+ this.ensureAvailable(8);
1373
+ this._data.setBigUint64(this.offset, value, this.littleEndian);
1374
+ this.offset += 8;
1375
+ this._updateLastWrittenByte();
1376
+ return this;
1377
+ }
1378
+ /**
1379
+ * Write the charCode of `str`'s first character as an 8-bit unsigned integer
1380
+ * and move pointer forward by 1 byte.
1381
+ * @param str - The character to write.
1382
+ * @returns This.
1383
+ */
1384
+ writeChar(str) {
1385
+ return this.writeUint8(str.charCodeAt(0));
1386
+ }
1387
+ /**
1388
+ * Write the charCodes of all `str`'s characters as 8-bit unsigned integers
1389
+ * and move pointer forward by `str.length` bytes.
1390
+ * @param str - The characters to write.
1391
+ * @returns This.
1392
+ */
1393
+ writeChars(str) {
1394
+ for (let i2 = 0; i2 < str.length; i2++) {
1395
+ this.writeUint8(str.charCodeAt(i2));
1396
+ }
1397
+ return this;
1398
+ }
1399
+ /**
1400
+ * UTF-8 encode and write `str` to the current pointer offset and move pointer
1401
+ * forward according to the encoded length.
1402
+ * @param str - The string to write.
1403
+ * @returns This.
1404
+ */
1405
+ writeUtf8(str) {
1406
+ return this.writeBytes(encode(str));
1407
+ }
1408
+ /**
1409
+ * Export a Uint8Array view of the internal buffer.
1410
+ * The view starts at the byte offset and its length
1411
+ * is calculated to stop at the last written byte or the original length.
1412
+ * @returns A new Uint8Array view.
1413
+ */
1414
+ toArray() {
1415
+ return new Uint8Array(this.buffer, this.byteOffset, this.lastWrittenByte);
1416
+ }
1417
+ /**
1418
+ * Get the total number of bytes written so far, regardless of the current offset.
1419
+ * @returns - Total number of bytes.
1420
+ */
1421
+ getWrittenByteLength() {
1422
+ return this.lastWrittenByte - this.byteOffset;
1423
+ }
1424
+ /**
1425
+ * Update the last written byte offset
1426
+ * @private
1427
+ */
1428
+ _updateLastWrittenByte() {
1429
+ if (this.offset > this.lastWrittenByte) {
1430
+ this.lastWrittenByte = this.offset;
1431
+ }
1432
+ }
1433
+ };
1434
+
1435
+ // ../../node_modules/.pnpm/fast-png@8.0.0/node_modules/fast-png/lib/helpers/crc.js
1436
+ var crcTable = [];
1437
+ for (let n = 0; n < 256; n++) {
1438
+ let c = n;
1439
+ for (let k = 0; k < 8; k++) {
1440
+ if (c & 1) {
1441
+ c = 3988292384 ^ c >>> 1;
1442
+ } else {
1443
+ c = c >>> 1;
1444
+ }
1445
+ }
1446
+ crcTable[n] = c;
1447
+ }
1448
+ var initialCrc = 4294967295;
1449
+ function updateCrc(currentCrc, data, length) {
1450
+ let c = currentCrc;
1451
+ for (let n = 0; n < length; n++) {
1452
+ c = crcTable[(c ^ data[n]) & 255] ^ c >>> 8;
1453
+ }
1454
+ return c;
1455
+ }
1456
+ __name(updateCrc, "updateCrc");
1457
+ function crc(data, length) {
1458
+ return (updateCrc(initialCrc, data, length) ^ initialCrc) >>> 0;
1459
+ }
1460
+ __name(crc, "crc");
1461
+ function checkCrc(buffer, crcLength, chunkName) {
1462
+ const expectedCrc = buffer.readUint32();
1463
+ const actualCrc = crc(new Uint8Array(buffer.buffer, buffer.byteOffset + buffer.offset - crcLength - 4, crcLength), crcLength);
1464
+ if (actualCrc !== expectedCrc) {
1465
+ throw new Error(`CRC mismatch for chunk ${chunkName}. Expected ${expectedCrc}, found ${actualCrc}`);
1466
+ }
1467
+ }
1468
+ __name(checkCrc, "checkCrc");
1469
+ function writeCrc(buffer, length) {
1470
+ buffer.writeUint32(crc(new Uint8Array(buffer.buffer, buffer.byteOffset + buffer.offset - length, length), length));
1471
+ }
1472
+ __name(writeCrc, "writeCrc");
1473
+
1474
+ // ../../node_modules/.pnpm/fast-png@8.0.0/node_modules/fast-png/lib/helpers/unfilter.js
1475
+ function unfilterNone(currentLine, newLine, bytesPerLine) {
1476
+ for (let i2 = 0; i2 < bytesPerLine; i2++) {
1477
+ newLine[i2] = currentLine[i2];
1478
+ }
1479
+ }
1480
+ __name(unfilterNone, "unfilterNone");
1481
+ function unfilterSub(currentLine, newLine, bytesPerLine, bytesPerPixel) {
1482
+ let i2 = 0;
1483
+ for (; i2 < bytesPerPixel; i2++) {
1484
+ newLine[i2] = currentLine[i2];
1485
+ }
1486
+ for (; i2 < bytesPerLine; i2++) {
1487
+ newLine[i2] = currentLine[i2] + newLine[i2 - bytesPerPixel] & 255;
1488
+ }
1489
+ }
1490
+ __name(unfilterSub, "unfilterSub");
1491
+ function unfilterUp(currentLine, newLine, prevLine, bytesPerLine) {
1492
+ let i2 = 0;
1493
+ if (prevLine.length === 0) {
1494
+ for (; i2 < bytesPerLine; i2++) {
1495
+ newLine[i2] = currentLine[i2];
1496
+ }
1497
+ } else {
1498
+ for (; i2 < bytesPerLine; i2++) {
1499
+ newLine[i2] = currentLine[i2] + prevLine[i2] & 255;
1500
+ }
1501
+ }
1502
+ }
1503
+ __name(unfilterUp, "unfilterUp");
1504
+ function unfilterAverage(currentLine, newLine, prevLine, bytesPerLine, bytesPerPixel) {
1505
+ let i2 = 0;
1506
+ if (prevLine.length === 0) {
1507
+ for (; i2 < bytesPerPixel; i2++) {
1508
+ newLine[i2] = currentLine[i2];
1509
+ }
1510
+ for (; i2 < bytesPerLine; i2++) {
1511
+ newLine[i2] = currentLine[i2] + (newLine[i2 - bytesPerPixel] >> 1) & 255;
1512
+ }
1513
+ } else {
1514
+ for (; i2 < bytesPerPixel; i2++) {
1515
+ newLine[i2] = currentLine[i2] + (prevLine[i2] >> 1) & 255;
1516
+ }
1517
+ for (; i2 < bytesPerLine; i2++) {
1518
+ newLine[i2] = currentLine[i2] + (newLine[i2 - bytesPerPixel] + prevLine[i2] >> 1) & 255;
1519
+ }
1520
+ }
1521
+ }
1522
+ __name(unfilterAverage, "unfilterAverage");
1523
+ function unfilterPaeth(currentLine, newLine, prevLine, bytesPerLine, bytesPerPixel) {
1524
+ let i2 = 0;
1525
+ if (prevLine.length === 0) {
1526
+ for (; i2 < bytesPerPixel; i2++) {
1527
+ newLine[i2] = currentLine[i2];
1528
+ }
1529
+ for (; i2 < bytesPerLine; i2++) {
1530
+ newLine[i2] = currentLine[i2] + newLine[i2 - bytesPerPixel] & 255;
1531
+ }
1532
+ } else {
1533
+ for (; i2 < bytesPerPixel; i2++) {
1534
+ newLine[i2] = currentLine[i2] + prevLine[i2] & 255;
1535
+ }
1536
+ for (; i2 < bytesPerLine; i2++) {
1537
+ newLine[i2] = currentLine[i2] + paethPredictor(newLine[i2 - bytesPerPixel], prevLine[i2], prevLine[i2 - bytesPerPixel]) & 255;
1538
+ }
1539
+ }
1540
+ }
1541
+ __name(unfilterPaeth, "unfilterPaeth");
1542
+ function paethPredictor(a, b, c) {
1543
+ const p = a + b - c;
1544
+ const pa = Math.abs(p - a);
1545
+ const pb = Math.abs(p - b);
1546
+ const pc = Math.abs(p - c);
1547
+ if (pa <= pb && pa <= pc)
1548
+ return a;
1549
+ else if (pb <= pc)
1550
+ return b;
1551
+ else
1552
+ return c;
1553
+ }
1554
+ __name(paethPredictor, "paethPredictor");
1555
+
1556
+ // ../../node_modules/.pnpm/fast-png@8.0.0/node_modules/fast-png/lib/helpers/apply_unfilter.js
1557
+ function applyUnfilter(filterType, currentLine, newLine, prevLine, passLineBytes, bytesPerPixel) {
1558
+ switch (filterType) {
1559
+ case 0:
1560
+ unfilterNone(currentLine, newLine, passLineBytes);
1561
+ break;
1562
+ case 1:
1563
+ unfilterSub(currentLine, newLine, passLineBytes, bytesPerPixel);
1564
+ break;
1565
+ case 2:
1566
+ unfilterUp(currentLine, newLine, prevLine, passLineBytes);
1567
+ break;
1568
+ case 3:
1569
+ unfilterAverage(currentLine, newLine, prevLine, passLineBytes, bytesPerPixel);
1570
+ break;
1571
+ case 4:
1572
+ unfilterPaeth(currentLine, newLine, prevLine, passLineBytes, bytesPerPixel);
1573
+ break;
1574
+ default:
1575
+ throw new Error(`Unsupported filter: ${filterType}`);
1576
+ }
1577
+ }
1578
+ __name(applyUnfilter, "applyUnfilter");
1579
+
1580
+ // ../../node_modules/.pnpm/fast-png@8.0.0/node_modules/fast-png/lib/helpers/decode_interlace_adam7.js
1581
+ var uint16 = new Uint16Array([255]);
1582
+ var uint8 = new Uint8Array(uint16.buffer);
1583
+ var osIsLittleEndian = uint8[0] === 255;
1584
+ function decodeInterlaceAdam7(params) {
1585
+ const { data, width, height, channels, depth } = params;
1586
+ const passes = [
1587
+ { x: 0, y: 0, xStep: 8, yStep: 8 },
1588
+ // Pass 1
1589
+ { x: 4, y: 0, xStep: 8, yStep: 8 },
1590
+ // Pass 2
1591
+ { x: 0, y: 4, xStep: 4, yStep: 8 },
1592
+ // Pass 3
1593
+ { x: 2, y: 0, xStep: 4, yStep: 4 },
1594
+ // Pass 4
1595
+ { x: 0, y: 2, xStep: 2, yStep: 4 },
1596
+ // Pass 5
1597
+ { x: 1, y: 0, xStep: 2, yStep: 2 },
1598
+ // Pass 6
1599
+ { x: 0, y: 1, xStep: 1, yStep: 2 }
1600
+ // Pass 7
1601
+ ];
1602
+ const bytesPerPixel = Math.ceil(depth / 8) * channels;
1603
+ const resultData = new Uint8Array(height * width * bytesPerPixel);
1604
+ let offset = 0;
1605
+ for (let passIndex = 0; passIndex < 7; passIndex++) {
1606
+ const pass = passes[passIndex];
1607
+ const passWidth = Math.ceil((width - pass.x) / pass.xStep);
1608
+ const passHeight = Math.ceil((height - pass.y) / pass.yStep);
1609
+ if (passWidth <= 0 || passHeight <= 0)
1610
+ continue;
1611
+ const passLineBytes = passWidth * bytesPerPixel;
1612
+ const prevLine = new Uint8Array(passLineBytes);
1613
+ for (let y = 0; y < passHeight; y++) {
1614
+ const filterType = data[offset++];
1615
+ const currentLine = data.subarray(offset, offset + passLineBytes);
1616
+ offset += passLineBytes;
1617
+ const newLine = new Uint8Array(passLineBytes);
1618
+ applyUnfilter(filterType, currentLine, newLine, prevLine, passLineBytes, bytesPerPixel);
1619
+ prevLine.set(newLine);
1620
+ for (let x2 = 0; x2 < passWidth; x2++) {
1621
+ const outputX = pass.x + x2 * pass.xStep;
1622
+ const outputY = pass.y + y * pass.yStep;
1623
+ if (outputX >= width || outputY >= height)
1624
+ continue;
1625
+ for (let i2 = 0; i2 < bytesPerPixel; i2++) {
1626
+ resultData[(outputY * width + outputX) * bytesPerPixel + i2] = newLine[x2 * bytesPerPixel + i2];
1627
+ }
1628
+ }
1629
+ }
1630
+ }
1631
+ if (depth === 16) {
1632
+ const uint16Data = new Uint16Array(resultData.buffer);
1633
+ if (osIsLittleEndian) {
1634
+ for (let k = 0; k < uint16Data.length; k++) {
1635
+ uint16Data[k] = swap16(uint16Data[k]);
1636
+ }
1637
+ }
1638
+ return uint16Data;
1639
+ } else {
1640
+ return resultData;
1641
+ }
1642
+ }
1643
+ __name(decodeInterlaceAdam7, "decodeInterlaceAdam7");
1644
+ function swap16(val) {
1645
+ return (val & 255) << 8 | val >> 8 & 255;
1646
+ }
1647
+ __name(swap16, "swap16");
1648
+
1649
+ // ../../node_modules/.pnpm/fast-png@8.0.0/node_modules/fast-png/lib/helpers/decode_interlace_null.js
1650
+ var uint162 = new Uint16Array([255]);
1651
+ var uint82 = new Uint8Array(uint162.buffer);
1652
+ var osIsLittleEndian2 = uint82[0] === 255;
1653
+ var empty = new Uint8Array(0);
1654
+ function decodeInterlaceNull(params) {
1655
+ const { data, width, height, channels, depth } = params;
1656
+ const bytesPerPixel = Math.ceil(depth / 8) * channels;
1657
+ const bytesPerLine = Math.ceil(depth / 8 * channels * width);
1658
+ const newData = new Uint8Array(height * bytesPerLine);
1659
+ let prevLine = empty;
1660
+ let offset = 0;
1661
+ let currentLine;
1662
+ let newLine;
1663
+ for (let i2 = 0; i2 < height; i2++) {
1664
+ currentLine = data.subarray(offset + 1, offset + 1 + bytesPerLine);
1665
+ newLine = newData.subarray(i2 * bytesPerLine, (i2 + 1) * bytesPerLine);
1666
+ switch (data[offset]) {
1667
+ case 0:
1668
+ unfilterNone(currentLine, newLine, bytesPerLine);
1669
+ break;
1670
+ case 1:
1671
+ unfilterSub(currentLine, newLine, bytesPerLine, bytesPerPixel);
1672
+ break;
1673
+ case 2:
1674
+ unfilterUp(currentLine, newLine, prevLine, bytesPerLine);
1675
+ break;
1676
+ case 3:
1677
+ unfilterAverage(currentLine, newLine, prevLine, bytesPerLine, bytesPerPixel);
1678
+ break;
1679
+ case 4:
1680
+ unfilterPaeth(currentLine, newLine, prevLine, bytesPerLine, bytesPerPixel);
1681
+ break;
1682
+ default:
1683
+ throw new Error(`Unsupported filter: ${data[offset]}`);
1684
+ }
1685
+ prevLine = newLine;
1686
+ offset += bytesPerLine + 1;
1687
+ }
1688
+ if (depth === 16) {
1689
+ const uint16Data = new Uint16Array(newData.buffer);
1690
+ if (osIsLittleEndian2) {
1691
+ for (let k = 0; k < uint16Data.length; k++) {
1692
+ uint16Data[k] = swap162(uint16Data[k]);
1693
+ }
1694
+ }
1695
+ return uint16Data;
1696
+ } else {
1697
+ return newData;
1698
+ }
1699
+ }
1700
+ __name(decodeInterlaceNull, "decodeInterlaceNull");
1701
+ function swap162(val) {
1702
+ return (val & 255) << 8 | val >> 8 & 255;
1703
+ }
1704
+ __name(swap162, "swap16");
1705
+
1706
+ // ../../node_modules/.pnpm/fast-png@8.0.0/node_modules/fast-png/lib/helpers/signature.js
1707
+ var pngSignature = Uint8Array.of(137, 80, 78, 71, 13, 10, 26, 10);
1708
+ function writeSignature(buffer) {
1709
+ buffer.writeBytes(pngSignature);
1710
+ }
1711
+ __name(writeSignature, "writeSignature");
1712
+ function checkSignature(buffer) {
1713
+ if (!hasPngSignature(buffer.readBytes(pngSignature.length))) {
1714
+ throw new Error("wrong PNG signature");
1715
+ }
1716
+ }
1717
+ __name(checkSignature, "checkSignature");
1718
+ function hasPngSignature(array) {
1719
+ if (array.length < pngSignature.length) {
1720
+ return false;
1721
+ }
1722
+ for (let i2 = 0; i2 < pngSignature.length; i2++) {
1723
+ if (array[i2] !== pngSignature[i2]) {
1724
+ return false;
1725
+ }
1726
+ }
1727
+ return true;
1728
+ }
1729
+ __name(hasPngSignature, "hasPngSignature");
1730
+
1731
+ // ../../node_modules/.pnpm/fast-png@8.0.0/node_modules/fast-png/lib/helpers/text.js
1732
+ var textChunkName = "tEXt";
1733
+ var NULL = 0;
1734
+ var latin1Decoder = new TextDecoder("latin1");
1735
+ function validateKeyword(keyword) {
1736
+ validateLatin1(keyword);
1737
+ if (keyword.length === 0 || keyword.length > 79) {
1738
+ throw new Error("keyword length must be between 1 and 79");
1739
+ }
1740
+ }
1741
+ __name(validateKeyword, "validateKeyword");
1742
+ var latin1Regex = /^[\u0000-\u00FF]*$/;
1743
+ function validateLatin1(text) {
1744
+ if (!latin1Regex.test(text)) {
1745
+ throw new Error("invalid latin1 text");
1746
+ }
1747
+ }
1748
+ __name(validateLatin1, "validateLatin1");
1749
+ function decodetEXt(text, buffer, length) {
1750
+ const keyword = readKeyword(buffer);
1751
+ text[keyword] = readLatin1(buffer, length - keyword.length - 1);
1752
+ }
1753
+ __name(decodetEXt, "decodetEXt");
1754
+ function encodetEXt(buffer, keyword, text) {
1755
+ validateKeyword(keyword);
1756
+ validateLatin1(text);
1757
+ const length = keyword.length + 1 + text.length;
1758
+ buffer.writeUint32(length);
1759
+ buffer.writeChars(textChunkName);
1760
+ buffer.writeChars(keyword);
1761
+ buffer.writeByte(NULL);
1762
+ buffer.writeChars(text);
1763
+ writeCrc(buffer, length + 4);
1764
+ }
1765
+ __name(encodetEXt, "encodetEXt");
1766
+ function readKeyword(buffer) {
1767
+ buffer.mark();
1768
+ while (buffer.readByte() !== NULL) {
1769
+ }
1770
+ const end = buffer.offset;
1771
+ buffer.reset();
1772
+ const keyword = latin1Decoder.decode(buffer.readBytes(end - buffer.offset - 1));
1773
+ buffer.skip(1);
1774
+ validateKeyword(keyword);
1775
+ return keyword;
1776
+ }
1777
+ __name(readKeyword, "readKeyword");
1778
+ function readLatin1(buffer, length) {
1779
+ return latin1Decoder.decode(buffer.readBytes(length));
1780
+ }
1781
+ __name(readLatin1, "readLatin1");
1782
+
1783
+ // ../../node_modules/.pnpm/fast-png@8.0.0/node_modules/fast-png/lib/internal_types.js
1784
+ var ColorType = {
1785
+ UNKNOWN: -1,
1786
+ GREYSCALE: 0,
1787
+ TRUECOLOUR: 2,
1788
+ INDEXED_COLOUR: 3,
1789
+ GREYSCALE_ALPHA: 4,
1790
+ TRUECOLOUR_ALPHA: 6
1791
+ };
1792
+ var CompressionMethod = {
1793
+ UNKNOWN: -1,
1794
+ DEFLATE: 0
1795
+ };
1796
+ var FilterMethod = {
1797
+ UNKNOWN: -1,
1798
+ ADAPTIVE: 0
1799
+ };
1800
+ var InterlaceMethod = {
1801
+ UNKNOWN: -1,
1802
+ NO_INTERLACE: 0,
1803
+ ADAM7: 1
1804
+ };
1805
+ var DisposeOpType = {
1806
+ NONE: 0,
1807
+ BACKGROUND: 1,
1808
+ PREVIOUS: 2
1809
+ };
1810
+ var BlendOpType = {
1811
+ SOURCE: 0,
1812
+ OVER: 1
1813
+ };
1814
+
1815
+ // ../../node_modules/.pnpm/fast-png@8.0.0/node_modules/fast-png/lib/png_decoder.js
1816
+ var PngDecoder = class extends IOBuffer {
1817
+ static {
1818
+ __name(this, "PngDecoder");
1819
+ }
1820
+ _checkCrc;
1821
+ _inflator;
1822
+ _png;
1823
+ _apng;
1824
+ _end;
1825
+ _hasPalette;
1826
+ _palette;
1827
+ _hasTransparency;
1828
+ _transparency;
1829
+ _compressionMethod;
1830
+ _filterMethod;
1831
+ _interlaceMethod;
1832
+ _colorType;
1833
+ _isAnimated;
1834
+ _numberOfFrames;
1835
+ _numberOfPlays;
1836
+ _frames;
1837
+ _writingDataChunks;
1838
+ _chunks;
1839
+ _inflatorResult;
1840
+ constructor(data, options = {}) {
1841
+ super(data);
1842
+ const { checkCrc: checkCrc2 = false } = options;
1843
+ this._checkCrc = checkCrc2;
1844
+ this._inflator = new Unzlib((chunk, final) => {
1845
+ this._chunks.push(chunk);
1846
+ if (final) {
1847
+ const totalLength = this._chunks.reduce((sum, c) => sum + c.length, 0);
1848
+ this._inflatorResult = new Uint8Array(totalLength);
1849
+ let offset = 0;
1850
+ for (const chunk2 of this._chunks) {
1851
+ this._inflatorResult.set(chunk2, offset);
1852
+ offset += chunk2.length;
1853
+ }
1854
+ this._chunks = [];
1855
+ }
1856
+ });
1857
+ this._chunks = [];
1858
+ this._png = {
1859
+ width: -1,
1860
+ height: -1,
1861
+ channels: -1,
1862
+ data: new Uint8Array(0),
1863
+ depth: 1,
1864
+ text: {}
1865
+ };
1866
+ this._apng = {
1867
+ width: -1,
1868
+ height: -1,
1869
+ channels: -1,
1870
+ depth: 1,
1871
+ numberOfFrames: 1,
1872
+ numberOfPlays: 0,
1873
+ text: {},
1874
+ frames: []
1875
+ };
1876
+ this._end = false;
1877
+ this._hasPalette = false;
1878
+ this._palette = [];
1879
+ this._hasTransparency = false;
1880
+ this._transparency = new Uint16Array(0);
1881
+ this._compressionMethod = CompressionMethod.UNKNOWN;
1882
+ this._filterMethod = FilterMethod.UNKNOWN;
1883
+ this._interlaceMethod = InterlaceMethod.UNKNOWN;
1884
+ this._colorType = ColorType.UNKNOWN;
1885
+ this._isAnimated = false;
1886
+ this._numberOfFrames = 1;
1887
+ this._numberOfPlays = 0;
1888
+ this._frames = [];
1889
+ this._writingDataChunks = false;
1890
+ this._inflatorResult = new Uint8Array(0);
1891
+ this.setBigEndian();
1892
+ }
1893
+ decode() {
1894
+ checkSignature(this);
1895
+ while (!this._end) {
1896
+ const length = this.readUint32();
1897
+ const type = this.readChars(4);
1898
+ this.decodeChunk(length, type);
1899
+ }
1900
+ this._inflator.push(new Uint8Array(0), true);
1901
+ this.decodeImage();
1902
+ return this._png;
1903
+ }
1904
+ decodeApng() {
1905
+ checkSignature(this);
1906
+ while (!this._end) {
1907
+ const length = this.readUint32();
1908
+ const type = this.readChars(4);
1909
+ this.decodeApngChunk(length, type);
1910
+ }
1911
+ this.decodeApngImage();
1912
+ return this._apng;
1913
+ }
1914
+ // https://www.w3.org/TR/PNG/#5Chunk-layout
1915
+ decodeChunk(length, type) {
1916
+ const offset = this.offset;
1917
+ switch (type) {
1918
+ // 11.2 Critical chunks
1919
+ case "IHDR":
1920
+ this.decodeIHDR();
1921
+ break;
1922
+ case "PLTE":
1923
+ this.decodePLTE(length);
1924
+ break;
1925
+ case "IDAT":
1926
+ this.decodeIDAT(length);
1927
+ break;
1928
+ case "IEND":
1929
+ this._end = true;
1930
+ break;
1931
+ // 11.3 Ancillary chunks
1932
+ case "tRNS":
1933
+ this.decodetRNS(length);
1934
+ break;
1935
+ case "iCCP":
1936
+ this.decodeiCCP(length);
1937
+ break;
1938
+ case textChunkName:
1939
+ decodetEXt(this._png.text, this, length);
1940
+ break;
1941
+ case "pHYs":
1942
+ this.decodepHYs();
1943
+ break;
1944
+ default:
1945
+ this.skip(length);
1946
+ break;
1947
+ }
1948
+ if (this.offset - offset !== length) {
1949
+ throw new Error(`Length mismatch while decoding chunk ${type}`);
1950
+ }
1951
+ if (this._checkCrc) {
1952
+ checkCrc(this, length + 4, type);
1953
+ } else {
1954
+ this.skip(4);
1955
+ }
1956
+ }
1957
+ decodeApngChunk(length, type) {
1958
+ const offset = this.offset;
1959
+ if (type !== "fdAT" && type !== "IDAT" && this._writingDataChunks) {
1960
+ this.pushDataToFrame();
1961
+ }
1962
+ switch (type) {
1963
+ case "acTL":
1964
+ this.decodeACTL();
1965
+ break;
1966
+ case "fcTL":
1967
+ this.decodeFCTL();
1968
+ break;
1969
+ case "fdAT":
1970
+ this.decodeFDAT(length);
1971
+ break;
1972
+ default:
1973
+ this.decodeChunk(length, type);
1974
+ this.offset = offset + length;
1975
+ break;
1976
+ }
1977
+ if (this.offset - offset !== length) {
1978
+ throw new Error(`Length mismatch while decoding chunk ${type}`);
1979
+ }
1980
+ if (this._checkCrc) {
1981
+ checkCrc(this, length + 4, type);
1982
+ } else {
1983
+ this.skip(4);
1984
+ }
1985
+ }
1986
+ // https://www.w3.org/TR/PNG/#11IHDR
1987
+ decodeIHDR() {
1988
+ const image = this._png;
1989
+ image.width = this.readUint32();
1990
+ image.height = this.readUint32();
1991
+ image.depth = checkBitDepth(this.readUint8());
1992
+ const colorType = this.readUint8();
1993
+ this._colorType = colorType;
1994
+ let channels;
1995
+ switch (colorType) {
1996
+ case ColorType.GREYSCALE:
1997
+ channels = 1;
1998
+ break;
1999
+ case ColorType.TRUECOLOUR:
2000
+ channels = 3;
2001
+ break;
2002
+ case ColorType.INDEXED_COLOUR:
2003
+ channels = 1;
2004
+ break;
2005
+ case ColorType.GREYSCALE_ALPHA:
2006
+ channels = 2;
2007
+ break;
2008
+ case ColorType.TRUECOLOUR_ALPHA:
2009
+ channels = 4;
2010
+ break;
2011
+ // Kept for exhaustiveness.
2012
+ // eslint-disable-next-line unicorn/no-useless-switch-case
2013
+ case ColorType.UNKNOWN:
2014
+ default:
2015
+ throw new Error(`Unknown color type: ${colorType}`);
2016
+ }
2017
+ this._png.channels = channels;
2018
+ this._compressionMethod = this.readUint8();
2019
+ if (this._compressionMethod !== CompressionMethod.DEFLATE) {
2020
+ throw new Error(`Unsupported compression method: ${this._compressionMethod}`);
2021
+ }
2022
+ this._filterMethod = this.readUint8();
2023
+ this._interlaceMethod = this.readUint8();
2024
+ }
2025
+ decodeACTL() {
2026
+ this._numberOfFrames = this.readUint32();
2027
+ this._numberOfPlays = this.readUint32();
2028
+ this._isAnimated = true;
2029
+ }
2030
+ decodeFCTL() {
2031
+ const image = {
2032
+ sequenceNumber: this.readUint32(),
2033
+ width: this.readUint32(),
2034
+ height: this.readUint32(),
2035
+ xOffset: this.readUint32(),
2036
+ yOffset: this.readUint32(),
2037
+ delayNumber: this.readUint16(),
2038
+ delayDenominator: this.readUint16(),
2039
+ disposeOp: this.readUint8(),
2040
+ blendOp: this.readUint8(),
2041
+ data: new Uint8Array(0)
2042
+ };
2043
+ this._frames.push(image);
2044
+ }
2045
+ // https://www.w3.org/TR/PNG/#11PLTE
2046
+ decodePLTE(length) {
2047
+ if (length % 3 !== 0) {
2048
+ throw new RangeError(`PLTE field length must be a multiple of 3. Got ${length}`);
2049
+ }
2050
+ const l = length / 3;
2051
+ this._hasPalette = true;
2052
+ const palette = [];
2053
+ this._palette = palette;
2054
+ for (let i2 = 0; i2 < l; i2++) {
2055
+ palette.push([this.readUint8(), this.readUint8(), this.readUint8()]);
2056
+ }
2057
+ }
2058
+ // https://www.w3.org/TR/PNG/#11IDAT
2059
+ decodeIDAT(length) {
2060
+ this._writingDataChunks = true;
2061
+ const dataLength = length;
2062
+ const dataOffset = this.offset + this.byteOffset;
2063
+ try {
2064
+ this._inflator.push(new Uint8Array(this.buffer, dataOffset, dataLength), false);
2065
+ } catch (error) {
2066
+ throw new Error("Error while decompressing the data:", { cause: error });
2067
+ }
2068
+ this.skip(length);
2069
+ }
2070
+ decodeFDAT(length) {
2071
+ this._writingDataChunks = true;
2072
+ let dataLength = length;
2073
+ let dataOffset = this.offset + this.byteOffset;
2074
+ dataOffset += 4;
2075
+ dataLength -= 4;
2076
+ try {
2077
+ this._inflator.push(new Uint8Array(this.buffer, dataOffset, dataLength), false);
2078
+ } catch (error) {
2079
+ throw new Error("Error while decompressing the data:", { cause: error });
2080
+ }
2081
+ this.skip(length);
2082
+ }
2083
+ // https://www.w3.org/TR/PNG/#11tRNS
2084
+ decodetRNS(length) {
2085
+ switch (this._colorType) {
2086
+ case ColorType.GREYSCALE:
2087
+ case ColorType.TRUECOLOUR: {
2088
+ if (length % 2 !== 0) {
2089
+ throw new RangeError(`tRNS chunk length must be a multiple of 2. Got ${length}`);
2090
+ }
2091
+ if (length / 2 > this._png.width * this._png.height) {
2092
+ throw new Error(`tRNS chunk contains more alpha values than there are pixels (${length / 2} vs ${this._png.width * this._png.height})`);
2093
+ }
2094
+ this._hasTransparency = true;
2095
+ this._transparency = new Uint16Array(length / 2);
2096
+ for (let i2 = 0; i2 < length / 2; i2++) {
2097
+ this._transparency[i2] = this.readUint16();
2098
+ }
2099
+ break;
2100
+ }
2101
+ case ColorType.INDEXED_COLOUR: {
2102
+ if (length > this._palette.length) {
2103
+ throw new Error(`tRNS chunk contains more alpha values than there are palette colors (${length} vs ${this._palette.length})`);
2104
+ }
2105
+ let i2 = 0;
2106
+ for (; i2 < length; i2++) {
2107
+ const alpha = this.readByte();
2108
+ this._palette[i2].push(alpha);
2109
+ }
2110
+ for (; i2 < this._palette.length; i2++) {
2111
+ this._palette[i2].push(255);
2112
+ }
2113
+ break;
2114
+ }
2115
+ // Kept for exhaustiveness.
2116
+ /* eslint-disable unicorn/no-useless-switch-case */
2117
+ case ColorType.UNKNOWN:
2118
+ case ColorType.GREYSCALE_ALPHA:
2119
+ case ColorType.TRUECOLOUR_ALPHA:
2120
+ default: {
2121
+ throw new Error(`tRNS chunk is not supported for color type ${this._colorType}`);
2122
+ }
2123
+ }
2124
+ }
2125
+ // https://www.w3.org/TR/PNG/#11iCCP
2126
+ decodeiCCP(length) {
2127
+ const name = readKeyword(this);
2128
+ const compressionMethod = this.readUint8();
2129
+ if (compressionMethod !== CompressionMethod.DEFLATE) {
2130
+ throw new Error(`Unsupported iCCP compression method: ${compressionMethod}`);
2131
+ }
2132
+ const compressedProfile = this.readBytes(length - name.length - 2);
2133
+ this._png.iccEmbeddedProfile = {
2134
+ name,
2135
+ profile: unzlibSync(compressedProfile)
2136
+ };
2137
+ }
2138
+ // https://www.w3.org/TR/PNG/#11pHYs
2139
+ decodepHYs() {
2140
+ const ppuX = this.readUint32();
2141
+ const ppuY = this.readUint32();
2142
+ const unitSpecifier = this.readByte();
2143
+ this._png.resolution = {
2144
+ x: ppuX,
2145
+ y: ppuY,
2146
+ unit: unitSpecifier
2147
+ };
2148
+ }
2149
+ decodeApngImage() {
2150
+ this._apng.width = this._png.width;
2151
+ this._apng.height = this._png.height;
2152
+ this._apng.channels = this._png.channels;
2153
+ this._apng.depth = this._png.depth;
2154
+ this._apng.numberOfFrames = this._numberOfFrames;
2155
+ this._apng.numberOfPlays = this._numberOfPlays;
2156
+ this._apng.text = this._png.text;
2157
+ this._apng.resolution = this._png.resolution;
2158
+ for (let i2 = 0; i2 < this._numberOfFrames; i2++) {
2159
+ const newFrame = {
2160
+ sequenceNumber: this._frames[i2].sequenceNumber,
2161
+ delayNumber: this._frames[i2].delayNumber,
2162
+ delayDenominator: this._frames[i2].delayDenominator,
2163
+ data: this._apng.depth === 8 ? new Uint8Array(this._apng.width * this._apng.height * this._apng.channels) : new Uint16Array(this._apng.width * this._apng.height * this._apng.channels)
2164
+ };
2165
+ const frame = this._frames.at(i2);
2166
+ if (frame) {
2167
+ frame.data = decodeInterlaceNull({
2168
+ data: frame.data,
2169
+ width: frame.width,
2170
+ height: frame.height,
2171
+ channels: this._apng.channels,
2172
+ depth: this._apng.depth
2173
+ });
2174
+ if (this._hasPalette) {
2175
+ this._apng.palette = this._palette;
2176
+ }
2177
+ if (this._hasTransparency) {
2178
+ this._apng.transparency = this._transparency;
2179
+ }
2180
+ if (i2 === 0 || frame.xOffset === 0 && frame.yOffset === 0 && frame.width === this._png.width && frame.height === this._png.height) {
2181
+ newFrame.data = frame.data;
2182
+ } else {
2183
+ const prevFrame = this._apng.frames.at(i2 - 1);
2184
+ this.disposeFrame(frame, prevFrame, newFrame);
2185
+ this.addFrameDataToCanvas(newFrame, frame);
2186
+ }
2187
+ this._apng.frames.push(newFrame);
2188
+ }
2189
+ }
2190
+ return this._apng;
2191
+ }
2192
+ disposeFrame(frame, prevFrame, imageFrame) {
2193
+ switch (frame.disposeOp) {
2194
+ case DisposeOpType.NONE:
2195
+ break;
2196
+ case DisposeOpType.BACKGROUND:
2197
+ for (let row = 0; row < this._png.height; row++) {
2198
+ for (let col = 0; col < this._png.width; col++) {
2199
+ const index = (row * frame.width + col) * this._png.channels;
2200
+ for (let channel = 0; channel < this._png.channels; channel++) {
2201
+ imageFrame.data[index + channel] = 0;
2202
+ }
2203
+ }
2204
+ }
2205
+ break;
2206
+ case DisposeOpType.PREVIOUS:
2207
+ imageFrame.data.set(prevFrame.data);
2208
+ break;
2209
+ default:
2210
+ throw new Error("Unknown disposeOp");
2211
+ }
2212
+ }
2213
+ addFrameDataToCanvas(imageFrame, frame) {
2214
+ const maxValue = 1 << this._png.depth;
2215
+ const calculatePixelIndices = /* @__PURE__ */ __name((row, col) => {
2216
+ const index = ((row + frame.yOffset) * this._png.width + frame.xOffset + col) * this._png.channels;
2217
+ const frameIndex = (row * frame.width + col) * this._png.channels;
2218
+ return { index, frameIndex };
2219
+ }, "calculatePixelIndices");
2220
+ switch (frame.blendOp) {
2221
+ case BlendOpType.SOURCE:
2222
+ for (let row = 0; row < frame.height; row++) {
2223
+ for (let col = 0; col < frame.width; col++) {
2224
+ const { index, frameIndex } = calculatePixelIndices(row, col);
2225
+ for (let channel = 0; channel < this._png.channels; channel++) {
2226
+ imageFrame.data[index + channel] = frame.data[frameIndex + channel];
2227
+ }
2228
+ }
2229
+ }
2230
+ break;
2231
+ // https://www.w3.org/TR/png-3/#13Alpha-channel-processing
2232
+ case BlendOpType.OVER:
2233
+ for (let row = 0; row < frame.height; row++) {
2234
+ for (let col = 0; col < frame.width; col++) {
2235
+ const { index, frameIndex } = calculatePixelIndices(row, col);
2236
+ for (let channel = 0; channel < this._png.channels; channel++) {
2237
+ const sourceAlpha = frame.data[frameIndex + this._png.channels - 1] / maxValue;
2238
+ const foregroundValue = channel % (this._png.channels - 1) === 0 ? 1 : frame.data[frameIndex + channel];
2239
+ const value = Math.floor(sourceAlpha * foregroundValue + (1 - sourceAlpha) * imageFrame.data[index + channel]);
2240
+ imageFrame.data[index + channel] += value;
2241
+ }
2242
+ }
2243
+ }
2244
+ break;
2245
+ default:
2246
+ throw new Error("Unknown blendOp");
2247
+ }
2248
+ }
2249
+ decodeImage() {
2250
+ const data = this._inflatorResult;
2251
+ if (this._filterMethod !== FilterMethod.ADAPTIVE) {
2252
+ throw new Error(`Filter method ${this._filterMethod} not supported`);
2253
+ }
2254
+ if (this._interlaceMethod === InterlaceMethod.NO_INTERLACE) {
2255
+ this._png.data = decodeInterlaceNull({
2256
+ data,
2257
+ width: this._png.width,
2258
+ height: this._png.height,
2259
+ channels: this._png.channels,
2260
+ depth: this._png.depth
2261
+ });
2262
+ } else if (this._interlaceMethod === InterlaceMethod.ADAM7) {
2263
+ this._png.data = decodeInterlaceAdam7({
2264
+ data,
2265
+ width: this._png.width,
2266
+ height: this._png.height,
2267
+ channels: this._png.channels,
2268
+ depth: this._png.depth
2269
+ });
2270
+ } else {
2271
+ throw new Error(`Interlace method ${this._interlaceMethod} not supported`);
2272
+ }
2273
+ if (this._hasPalette) {
2274
+ this._png.palette = this._palette;
2275
+ }
2276
+ if (this._hasTransparency) {
2277
+ this._png.transparency = this._transparency;
2278
+ }
2279
+ }
2280
+ pushDataToFrame() {
2281
+ this._inflator.push(new Uint8Array(0), true);
2282
+ const result = this._inflatorResult;
2283
+ const lastFrame = this._frames.at(-1);
2284
+ if (lastFrame) {
2285
+ lastFrame.data = result;
2286
+ } else {
2287
+ this._frames.push({
2288
+ sequenceNumber: 0,
2289
+ width: this._png.width,
2290
+ height: this._png.height,
2291
+ xOffset: 0,
2292
+ yOffset: 0,
2293
+ delayNumber: 0,
2294
+ delayDenominator: 0,
2295
+ disposeOp: DisposeOpType.NONE,
2296
+ blendOp: BlendOpType.SOURCE,
2297
+ data: result
2298
+ });
2299
+ }
2300
+ this._inflator = new Unzlib((chunk, final) => {
2301
+ this._chunks.push(chunk);
2302
+ if (final) {
2303
+ const totalLength = this._chunks.reduce((sum, c) => sum + c.length, 0);
2304
+ this._inflatorResult = new Uint8Array(totalLength);
2305
+ let offset = 0;
2306
+ for (const chunk2 of this._chunks) {
2307
+ this._inflatorResult.set(chunk2, offset);
2308
+ offset += chunk2.length;
2309
+ }
2310
+ this._chunks = [];
2311
+ }
2312
+ });
2313
+ this._chunks = [];
2314
+ this._writingDataChunks = false;
2315
+ }
2316
+ };
2317
+ function checkBitDepth(value) {
2318
+ if (value !== 1 && value !== 2 && value !== 4 && value !== 8 && value !== 16) {
2319
+ throw new Error(`invalid bit depth: ${value}`);
2320
+ }
2321
+ return value;
2322
+ }
2323
+ __name(checkBitDepth, "checkBitDepth");
2324
+
2325
+ // ../../node_modules/.pnpm/fast-png@8.0.0/node_modules/fast-png/lib/png_encoder.js
2326
+ var defaultZlibOptions = {
2327
+ level: 3
2328
+ };
2329
+ var PngEncoder = class extends IOBuffer {
2330
+ static {
2331
+ __name(this, "PngEncoder");
2332
+ }
2333
+ _png;
2334
+ _zlibOptions;
2335
+ _colorType;
2336
+ _interlaceMethod;
2337
+ constructor(data, options = {}) {
2338
+ super();
2339
+ this._colorType = ColorType.UNKNOWN;
2340
+ this._zlibOptions = { ...defaultZlibOptions, ...options.zlib };
2341
+ this._png = this._checkData(data);
2342
+ this._interlaceMethod = (options.interlace === "Adam7" ? InterlaceMethod.ADAM7 : InterlaceMethod.NO_INTERLACE) ?? InterlaceMethod.NO_INTERLACE;
2343
+ this.setBigEndian();
2344
+ }
2345
+ encode() {
2346
+ writeSignature(this);
2347
+ this.encodeIHDR();
2348
+ if (this._png.palette) {
2349
+ this.encodePLTE();
2350
+ if (this._png.palette[0].length === 4) {
2351
+ this.encodeTRNS();
2352
+ }
2353
+ }
2354
+ this.encodeData();
2355
+ if (this._png.text) {
2356
+ for (const [keyword, text] of Object.entries(this._png.text)) {
2357
+ encodetEXt(this, keyword, text);
2358
+ }
2359
+ }
2360
+ this.encodeIEND();
2361
+ return this.toArray();
2362
+ }
2363
+ // https://www.w3.org/TR/PNG/#11IHDR
2364
+ encodeIHDR() {
2365
+ this.writeUint32(13);
2366
+ this.writeChars("IHDR");
2367
+ this.writeUint32(this._png.width);
2368
+ this.writeUint32(this._png.height);
2369
+ this.writeByte(this._png.depth);
2370
+ this.writeByte(this._colorType);
2371
+ this.writeByte(CompressionMethod.DEFLATE);
2372
+ this.writeByte(FilterMethod.ADAPTIVE);
2373
+ this.writeByte(this._interlaceMethod);
2374
+ writeCrc(this, 17);
2375
+ }
2376
+ // https://www.w3.org/TR/PNG/#11IEND
2377
+ encodeIEND() {
2378
+ this.writeUint32(0);
2379
+ this.writeChars("IEND");
2380
+ writeCrc(this, 4);
2381
+ }
2382
+ encodePLTE() {
2383
+ const paletteLength = this._png.palette?.length * 3;
2384
+ this.writeUint32(paletteLength);
2385
+ this.writeChars("PLTE");
2386
+ for (const color of this._png.palette) {
2387
+ this.writeByte(color[0]);
2388
+ this.writeByte(color[1]);
2389
+ this.writeByte(color[2]);
2390
+ }
2391
+ writeCrc(this, 4 + paletteLength);
2392
+ }
2393
+ encodeTRNS() {
2394
+ const alpha = this._png.palette.filter((color) => {
2395
+ return color.at(-1) !== 255;
2396
+ });
2397
+ this.writeUint32(alpha.length);
2398
+ this.writeChars("tRNS");
2399
+ for (const el of alpha) {
2400
+ this.writeByte(el.at(-1));
2401
+ }
2402
+ writeCrc(this, 4 + alpha.length);
2403
+ }
2404
+ // https://www.w3.org/TR/PNG/#11IDAT
2405
+ encodeIDAT(data) {
2406
+ this.writeUint32(data.length);
2407
+ this.writeChars("IDAT");
2408
+ this.writeBytes(data);
2409
+ writeCrc(this, data.length + 4);
2410
+ }
2411
+ encodeData() {
2412
+ const { width, height, channels, depth, data } = this._png;
2413
+ const slotsPerLine = depth <= 8 ? Math.ceil(width * depth / 8) * channels : Math.ceil(width * depth / 8 * channels / 2);
2414
+ const newData = new IOBuffer().setBigEndian();
2415
+ let offset = 0;
2416
+ if (this._interlaceMethod === InterlaceMethod.NO_INTERLACE) {
2417
+ for (let i2 = 0; i2 < height; i2++) {
2418
+ newData.writeByte(0);
2419
+ if (depth === 16) {
2420
+ offset = writeDataUint16(data, newData, slotsPerLine, offset);
2421
+ } else {
2422
+ offset = writeDataBytes(data, newData, slotsPerLine, offset);
2423
+ }
2424
+ }
2425
+ } else if (this._interlaceMethod === InterlaceMethod.ADAM7) {
2426
+ offset = writeDataInterlaced(this._png, data, newData, offset);
2427
+ }
2428
+ const buffer = newData.toArray();
2429
+ const compressed = zlibSync(buffer, this._zlibOptions);
2430
+ this.encodeIDAT(compressed);
2431
+ }
2432
+ _checkData(data) {
2433
+ const { colorType, channels, depth } = getColorType(data, data.palette);
2434
+ const png = {
2435
+ width: checkInteger(data.width, "width"),
2436
+ height: checkInteger(data.height, "height"),
2437
+ channels,
2438
+ data: data.data,
2439
+ depth,
2440
+ text: data.text,
2441
+ palette: data.palette
2442
+ };
2443
+ this._colorType = colorType;
2444
+ const expectedSize = depth < 8 ? Math.ceil(png.width * depth / 8) * png.height * channels : png.width * png.height * channels;
2445
+ if (png.data.length !== expectedSize) {
2446
+ throw new RangeError(`wrong data size. Found ${png.data.length}, expected ${expectedSize}`);
2447
+ }
2448
+ return png;
2449
+ }
2450
+ };
2451
+ function checkInteger(value, name) {
2452
+ if (Number.isInteger(value) && value > 0) {
2453
+ return value;
2454
+ }
2455
+ throw new TypeError(`${name} must be a positive integer`);
2456
+ }
2457
+ __name(checkInteger, "checkInteger");
2458
+ function getColorType(data, palette) {
2459
+ const { channels = 4, depth = 8 } = data;
2460
+ if (channels !== 4 && channels !== 3 && channels !== 2 && channels !== 1) {
2461
+ throw new RangeError(`unsupported number of channels: ${channels}`);
2462
+ }
2463
+ const returnValue = {
2464
+ channels,
2465
+ depth,
2466
+ colorType: ColorType.UNKNOWN
2467
+ };
2468
+ switch (channels) {
2469
+ case 4:
2470
+ returnValue.colorType = ColorType.TRUECOLOUR_ALPHA;
2471
+ break;
2472
+ case 3:
2473
+ returnValue.colorType = ColorType.TRUECOLOUR;
2474
+ break;
2475
+ case 1:
2476
+ if (palette) {
2477
+ returnValue.colorType = ColorType.INDEXED_COLOUR;
2478
+ } else {
2479
+ returnValue.colorType = ColorType.GREYSCALE;
2480
+ }
2481
+ break;
2482
+ case 2:
2483
+ returnValue.colorType = ColorType.GREYSCALE_ALPHA;
2484
+ break;
2485
+ default:
2486
+ throw new Error("unsupported number of channels");
2487
+ }
2488
+ return returnValue;
2489
+ }
2490
+ __name(getColorType, "getColorType");
2491
+ function writeDataBytes(data, newData, slotsPerLine, offset) {
2492
+ for (let j = 0; j < slotsPerLine; j++) {
2493
+ newData.writeByte(data[offset++]);
2494
+ }
2495
+ return offset;
2496
+ }
2497
+ __name(writeDataBytes, "writeDataBytes");
2498
+ function writeDataInterlaced(imageData, data, newData, offset) {
2499
+ const passes = [
2500
+ { x: 0, y: 0, xStep: 8, yStep: 8 },
2501
+ { x: 4, y: 0, xStep: 8, yStep: 8 },
2502
+ { x: 0, y: 4, xStep: 4, yStep: 8 },
2503
+ { x: 2, y: 0, xStep: 4, yStep: 4 },
2504
+ { x: 0, y: 2, xStep: 2, yStep: 4 },
2505
+ { x: 1, y: 0, xStep: 2, yStep: 2 },
2506
+ { x: 0, y: 1, xStep: 1, yStep: 2 }
2507
+ ];
2508
+ const { width, height, channels, depth } = imageData;
2509
+ let pixelSize;
2510
+ if (depth === 16) {
2511
+ pixelSize = channels * depth / 8 / 2;
2512
+ } else {
2513
+ pixelSize = channels * depth / 8;
2514
+ }
2515
+ for (let passIndex = 0; passIndex < 7; passIndex++) {
2516
+ const pass = passes[passIndex];
2517
+ const passWidth = Math.floor((width - pass.x + pass.xStep - 1) / pass.xStep);
2518
+ const passHeight = Math.floor((height - pass.y + pass.yStep - 1) / pass.yStep);
2519
+ if (passWidth <= 0 || passHeight <= 0)
2520
+ continue;
2521
+ const passLineBytes = passWidth * pixelSize;
2522
+ for (let y = 0; y < passHeight; y++) {
2523
+ const imageY = pass.y + y * pass.yStep;
2524
+ const rawScanline = depth <= 8 ? new Uint8Array(passLineBytes) : new Uint16Array(passLineBytes);
2525
+ let rawOffset = 0;
2526
+ for (let x2 = 0; x2 < passWidth; x2++) {
2527
+ const imageX = pass.x + x2 * pass.xStep;
2528
+ if (imageX < width && imageY < height) {
2529
+ const srcPos = (imageY * width + imageX) * pixelSize;
2530
+ for (let i2 = 0; i2 < pixelSize; i2++) {
2531
+ rawScanline[rawOffset++] = data[srcPos + i2];
2532
+ }
2533
+ }
2534
+ }
2535
+ newData.writeByte(0);
2536
+ if (depth === 8) {
2537
+ newData.writeBytes(rawScanline);
2538
+ } else if (depth === 16) {
2539
+ for (const value of rawScanline) {
2540
+ newData.writeByte(value >> 8 & 255);
2541
+ newData.writeByte(value & 255);
2542
+ }
2543
+ }
2544
+ }
2545
+ }
2546
+ return offset;
2547
+ }
2548
+ __name(writeDataInterlaced, "writeDataInterlaced");
2549
+ function writeDataUint16(data, newData, slotsPerLine, offset) {
2550
+ for (let j = 0; j < slotsPerLine; j++) {
2551
+ newData.writeUint16(data[offset++]);
2552
+ }
2553
+ return offset;
2554
+ }
2555
+ __name(writeDataUint16, "writeDataUint16");
2556
+
2557
+ // ../../node_modules/.pnpm/fast-png@8.0.0/node_modules/fast-png/lib/types.js
2558
+ var ResolutionUnitSpecifier = {
2559
+ /**
2560
+ * Unit is unknown.
2561
+ */
2562
+ UNKNOWN: 0,
2563
+ /**
2564
+ * Unit is the metre.
2565
+ */
2566
+ METRE: 1
2567
+ };
2568
+
2569
+ // ../../node_modules/.pnpm/fast-png@8.0.0/node_modules/fast-png/lib/convert_indexed_to_rgb.js
2570
+ function convertIndexedToRgb(decodedImage) {
2571
+ const palette = decodedImage.palette;
2572
+ const depth = decodedImage.depth;
2573
+ if (!palette) {
2574
+ throw new Error("Color palette is undefined.");
2575
+ }
2576
+ checkDataSize(decodedImage);
2577
+ const indexSize = decodedImage.width * decodedImage.height;
2578
+ const resSize = indexSize * palette[0].length;
2579
+ const res = new Uint8Array(resSize);
2580
+ let indexPos = 0;
2581
+ let offset = 0;
2582
+ const indexes = new Uint8Array(indexSize);
2583
+ let bit = 255;
2584
+ switch (depth) {
2585
+ case 1:
2586
+ bit = 128;
2587
+ break;
2588
+ case 2:
2589
+ bit = 192;
2590
+ break;
2591
+ case 4:
2592
+ bit = 240;
2593
+ break;
2594
+ case 8:
2595
+ bit = 255;
2596
+ break;
2597
+ default:
2598
+ throw new Error("Incorrect depth value");
2599
+ }
2600
+ for (const byte of decodedImage.data) {
2601
+ let bit2 = bit;
2602
+ let shift = 8;
2603
+ while (bit2) {
2604
+ shift -= depth;
2605
+ indexes[indexPos++] = (byte & bit2) >> shift;
2606
+ bit2 = bit2 >> depth;
2607
+ if (indexPos % decodedImage.width === 0) {
2608
+ break;
2609
+ }
2610
+ }
2611
+ }
2612
+ if (decodedImage.palette) {
2613
+ for (const index of indexes) {
2614
+ const color = decodedImage.palette.at(index);
2615
+ if (!color) {
2616
+ throw new Error("Incorrect index of palette color");
2617
+ }
2618
+ res.set(color, offset);
2619
+ offset += color.length;
2620
+ }
2621
+ }
2622
+ return res;
2623
+ }
2624
+ __name(convertIndexedToRgb, "convertIndexedToRgb");
2625
+ function checkDataSize(image) {
2626
+ const expectedSize = image.depth < 8 ? Math.ceil(image.width * image.depth / 8) * image.height * image.channels : image.width * image.height * image.channels;
2627
+ if (image.data.length !== expectedSize) {
2628
+ throw new RangeError(`wrong data size. Found ${image.data.length}, expected ${expectedSize}`);
2629
+ }
2630
+ }
2631
+ __name(checkDataSize, "checkDataSize");
2632
+
2633
+ // ../../node_modules/.pnpm/fast-png@8.0.0/node_modules/fast-png/lib/index.js
2634
+ function decodePng(data, options) {
2635
+ const decoder = new PngDecoder(data, options);
2636
+ return decoder.decode();
2637
+ }
2638
+ __name(decodePng, "decodePng");
2639
+ function encodePng(png, options) {
2640
+ const encoder2 = new PngEncoder(png, options);
2641
+ return encoder2.encode();
2642
+ }
2643
+ __name(encodePng, "encodePng");
2644
+ function decodeApng(data, options) {
2645
+ const decoder = new PngDecoder(data, options);
2646
+ return decoder.decodeApng();
2647
+ }
2648
+ __name(decodeApng, "decodeApng");
2649
+ export {
2650
+ ResolutionUnitSpecifier,
2651
+ convertIndexedToRgb,
2652
+ decodePng as decode,
2653
+ decodeApng,
2654
+ encodePng as encode,
2655
+ hasPngSignature
2656
+ };
2657
+ //# sourceMappingURL=lib-KXZZJJG2.js.map