@mx-space/cli 0.15.1 → 0.15.2

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 (611) hide show
  1. package/dist/{Lexical.dev-BSvx45_E.mjs → Lexical.dev-Df5TNMgP.mjs} +2 -2
  2. package/dist/{Lexical.node-kAh5GM2n.mjs → Lexical.node-B064E4Hy.mjs} +1 -1
  3. package/dist/{Lexical.prod-Bqwgb3ez.mjs → Lexical.prod-DRFSwoE7.mjs} +2 -2
  4. package/dist/{LexicalClipboard.dev-BWU3KXIa.mjs → LexicalClipboard.dev-ClOWeg5v.mjs} +5 -5
  5. package/dist/{LexicalClipboard.node-BygAdNdF.mjs → LexicalClipboard.node-BJBLWpEi.mjs} +1 -1
  6. package/dist/{LexicalClipboard.prod-BtMuKNyT.mjs → LexicalClipboard.prod-Ytt65eQo.mjs} +5 -5
  7. package/dist/{LexicalCodeCore.dev-CD2xgvDs.mjs → LexicalCodeCore.dev-CzEPINOT.mjs} +4 -4
  8. package/dist/{LexicalCodeCore.prod-Bl6FFMc7.mjs → LexicalCodeCore.prod-DOVk7lL_.mjs} +4 -4
  9. package/dist/{LexicalDragon.dev-BwdYhm4K.mjs → LexicalDragon.dev-DxePN9fP.mjs} +2 -2
  10. package/dist/{LexicalDragon.node-CpJhkCVV.mjs → LexicalDragon.node-DBwaqStp.mjs} +1 -1
  11. package/dist/{LexicalDragon.prod-CvXmWwo1.mjs → LexicalDragon.prod-Bji84-Hq.mjs} +2 -2
  12. package/dist/{LexicalExtension.dev-LcRLXI5Z.mjs → LexicalExtension.dev-DtSRyjbf.mjs} +2 -2
  13. package/dist/{LexicalExtension.node-BwJt2LXV.mjs → LexicalExtension.node-3nsS5NjU.mjs} +1 -1
  14. package/dist/{LexicalExtension.prod-lg8_33-H.mjs → LexicalExtension.prod-Ddk0ja_6.mjs} +2 -2
  15. package/dist/{LexicalHeadless.dev-BeUbKBes.mjs → LexicalHeadless.dev-DdWJsPoH.mjs} +1 -1
  16. package/dist/{LexicalHeadless.prod-4gbIA8HM.mjs → LexicalHeadless.prod-CH74ZDMt.mjs} +1 -1
  17. package/dist/{LexicalHtml.dev-BLdZWTCJ.mjs → LexicalHtml.dev-DN7QIb_7.mjs} +4 -4
  18. package/dist/{LexicalHtml.node-BeuJMvvt.mjs → LexicalHtml.node-DAwuaPeI.mjs} +1 -1
  19. package/dist/{LexicalHtml.prod-CHUyCocN.mjs → LexicalHtml.prod-X4eTHEfI.mjs} +4 -4
  20. package/dist/{LexicalLink.dev-DgsFRqw0.mjs → LexicalLink.dev-owitIl6I.mjs} +4 -4
  21. package/dist/{LexicalLink.prod-CkXkeKY2.mjs → LexicalLink.prod-BZ7ZZkVD.mjs} +4 -4
  22. package/dist/{LexicalList.dev-OOms3kQi.mjs → LexicalList.dev-CUbi09Yo.mjs} +4 -4
  23. package/dist/{LexicalList.prod-DzMBeqHn.mjs → LexicalList.prod-pUsUZa0r.mjs} +4 -4
  24. package/dist/{LexicalMarkdown.dev-DJLKbZtD.mjs → LexicalMarkdown.dev-S2yWckH9.mjs} +3 -3
  25. package/dist/{LexicalMarkdown.prod-Cp21kDCU.mjs → LexicalMarkdown.prod-TRkMWfmC.mjs} +3 -3
  26. package/dist/{LexicalRichText.dev-0rkAGjUf.mjs → LexicalRichText.dev-Y3ybFF2S.mjs} +7 -7
  27. package/dist/{LexicalRichText.node-Cd-BySPE.mjs → LexicalRichText.node-wNAi2Z4i.mjs} +4 -4
  28. package/dist/{LexicalRichText.prod-DTQiEr8C.mjs → LexicalRichText.prod-HLxqZ6hQ.mjs} +7 -7
  29. package/dist/{LexicalSelection.dev-Bi0VlUEv.mjs → LexicalSelection.dev-CyhKOKbs.mjs} +1 -1
  30. package/dist/{LexicalSelection.node-t2U46EF_.mjs → LexicalSelection.node-BCuHMbzl.mjs} +1 -1
  31. package/dist/{LexicalSelection.prod-CrFG111g.mjs → LexicalSelection.prod-RebDJliC.mjs} +1 -1
  32. package/dist/{LexicalTable.dev-D-sFhO-o.mjs → LexicalTable.dev-DN3ezVey.mjs} +5 -5
  33. package/dist/{LexicalTable.prod-DwYaa_dN.mjs → LexicalTable.prod-B0MioVyq.mjs} +5 -5
  34. package/dist/{LexicalUtils.dev-Q2q3-UDM.mjs → LexicalUtils.dev-Bw6LFRlt.mjs} +2 -2
  35. package/dist/{LexicalUtils.node-Dl7OvqJV.mjs → LexicalUtils.node-BPKMFN80.mjs} +1 -1
  36. package/dist/{LexicalUtils.prod-CBnq_iEV.mjs → LexicalUtils.prod-CJYQVQJO.mjs} +2 -2
  37. package/dist/bin/mxs.mjs +1 -1
  38. package/dist/{esm-ZXjJmLEC.mjs → esm-7vSMGlFz.mjs} +171 -245
  39. package/dist/esm-ZrfYH2y2.mjs +2 -0
  40. package/dist/index.mjs +1 -1
  41. package/dist/{mxs-DC9zR3f2.mjs → mxs-DKv-4ZTg.mjs} +362 -297
  42. package/dist/vendor/litexml/cli.mjs +94 -38
  43. package/dist/vendor/litexml/litexml-html-preview-client.css +329 -836
  44. package/dist/vendor/litexml/litexml-html-preview-client.js +6048 -5832
  45. package/dist/vendor/litexml/style.css +5 -1
  46. package/package.json +10 -10
  47. package/dist/esm-CNZ7kdTg.mjs +0 -2
  48. package/dist/src/bin/mxs.d.ts +0 -2
  49. package/dist/src/bin/mxs.js +0 -310
  50. package/dist/src/cli/ai/_poll.d.ts +0 -12
  51. package/dist/src/cli/ai/_poll.js +0 -38
  52. package/dist/src/cli/ai/_resolve.d.ts +0 -8
  53. package/dist/src/cli/ai/_resolve.js +0 -27
  54. package/dist/src/cli/ai/index.d.ts +0 -127
  55. package/dist/src/cli/ai/index.js +0 -46
  56. package/dist/src/cli/ai/insights/by-article.d.ts +0 -10
  57. package/dist/src/cli/ai/insights/by-article.js +0 -21
  58. package/dist/src/cli/ai/insights/delete.d.ts +0 -7
  59. package/dist/src/cli/ai/insights/delete.js +0 -18
  60. package/dist/src/cli/ai/insights/edit.d.ts +0 -8
  61. package/dist/src/cli/ai/insights/edit.js +0 -54
  62. package/dist/src/cli/ai/insights/get.d.ts +0 -6
  63. package/dist/src/cli/ai/insights/get.js +0 -11
  64. package/dist/src/cli/ai/insights/index.d.ts +0 -30
  65. package/dist/src/cli/ai/insights/index.js +0 -17
  66. package/dist/src/cli/ai/insights/list.d.ts +0 -10
  67. package/dist/src/cli/ai/insights/list.js +0 -20
  68. package/dist/src/cli/ai/insights/refresh.d.ts +0 -10
  69. package/dist/src/cli/ai/insights/refresh.js +0 -25
  70. package/dist/src/cli/ai/insights/translate.d.ts +0 -10
  71. package/dist/src/cli/ai/insights/translate.js +0 -25
  72. package/dist/src/cli/ai/overview/by-article.d.ts +0 -7
  73. package/dist/src/cli/ai/overview/by-article.js +0 -15
  74. package/dist/src/cli/ai/overview/index.d.ts +0 -11
  75. package/dist/src/cli/ai/overview/index.js +0 -4
  76. package/dist/src/cli/ai/overview/list.d.ts +0 -10
  77. package/dist/src/cli/ai/overview/list.js +0 -20
  78. package/dist/src/cli/ai/summary/by-article.d.ts +0 -10
  79. package/dist/src/cli/ai/summary/by-article.js +0 -21
  80. package/dist/src/cli/ai/summary/delete.d.ts +0 -7
  81. package/dist/src/cli/ai/summary/delete.js +0 -18
  82. package/dist/src/cli/ai/summary/edit.d.ts +0 -8
  83. package/dist/src/cli/ai/summary/edit.js +0 -54
  84. package/dist/src/cli/ai/summary/get.d.ts +0 -6
  85. package/dist/src/cli/ai/summary/get.js +0 -11
  86. package/dist/src/cli/ai/summary/index.d.ts +0 -30
  87. package/dist/src/cli/ai/summary/index.js +0 -9
  88. package/dist/src/cli/ai/summary/list.d.ts +0 -10
  89. package/dist/src/cli/ai/summary/list.js +0 -20
  90. package/dist/src/cli/ai/summary/regen.d.ts +0 -10
  91. package/dist/src/cli/ai/summary/regen.js +0 -25
  92. package/dist/src/cli/ai/summary/translate.d.ts +0 -10
  93. package/dist/src/cli/ai/summary/translate.js +0 -25
  94. package/dist/src/cli/ai/translate/by-article.d.ts +0 -9
  95. package/dist/src/cli/ai/translate/by-article.js +0 -19
  96. package/dist/src/cli/ai/translate/delete.d.ts +0 -7
  97. package/dist/src/cli/ai/translate/delete.js +0 -18
  98. package/dist/src/cli/ai/translate/edit.d.ts +0 -8
  99. package/dist/src/cli/ai/translate/edit.js +0 -97
  100. package/dist/src/cli/ai/translate/entries/delete.d.ts +0 -7
  101. package/dist/src/cli/ai/translate/entries/delete.js +0 -18
  102. package/dist/src/cli/ai/translate/entries/edit.d.ts +0 -8
  103. package/dist/src/cli/ai/translate/entries/edit.js +0 -73
  104. package/dist/src/cli/ai/translate/entries/generate.d.ts +0 -7
  105. package/dist/src/cli/ai/translate/entries/generate.js +0 -15
  106. package/dist/src/cli/ai/translate/entries/index.d.ts +0 -17
  107. package/dist/src/cli/ai/translate/entries/index.js +0 -6
  108. package/dist/src/cli/ai/translate/entries/list.d.ts +0 -10
  109. package/dist/src/cli/ai/translate/entries/list.js +0 -20
  110. package/dist/src/cli/ai/translate/get.d.ts +0 -6
  111. package/dist/src/cli/ai/translate/get.js +0 -11
  112. package/dist/src/cli/ai/translate/index.d.ts +0 -40
  113. package/dist/src/cli/ai/translate/index.js +0 -19
  114. package/dist/src/cli/ai/translate/languages.d.ts +0 -7
  115. package/dist/src/cli/ai/translate/languages.js +0 -15
  116. package/dist/src/cli/ai/translate/list.d.ts +0 -9
  117. package/dist/src/cli/ai/translate/list.js +0 -19
  118. package/dist/src/cli/ai/translate/run.d.ts +0 -10
  119. package/dist/src/cli/ai/translate/run.js +0 -31
  120. package/dist/src/cli/ai/tts/by-article.d.ts +0 -7
  121. package/dist/src/cli/ai/tts/by-article.js +0 -15
  122. package/dist/src/cli/ai/tts/delete.d.ts +0 -7
  123. package/dist/src/cli/ai/tts/delete.js +0 -18
  124. package/dist/src/cli/ai/tts/index.d.ts +0 -22
  125. package/dist/src/cli/ai/tts/index.js +0 -7
  126. package/dist/src/cli/ai/tts/list.d.ts +0 -10
  127. package/dist/src/cli/ai/tts/list.js +0 -20
  128. package/dist/src/cli/ai/tts/run.d.ts +0 -10
  129. package/dist/src/cli/ai/tts/run.js +0 -25
  130. package/dist/src/cli/ai/tts/voices.d.ts +0 -7
  131. package/dist/src/cli/ai/tts/voices.js +0 -12
  132. package/dist/src/cli/ai/views.d.ts +0 -3
  133. package/dist/src/cli/ai/views.js +0 -45
  134. package/dist/src/cli/auth/index.d.ts +0 -6
  135. package/dist/src/cli/auth/index.js +0 -22
  136. package/dist/src/cli/auth/login.d.ts +0 -11
  137. package/dist/src/cli/auth/login.js +0 -168
  138. package/dist/src/cli/auth/logout.d.ts +0 -6
  139. package/dist/src/cli/auth/logout.js +0 -21
  140. package/dist/src/cli/auth/status.d.ts +0 -4
  141. package/dist/src/cli/auth/status.js +0 -31
  142. package/dist/src/cli/auth/view.d.ts +0 -25
  143. package/dist/src/cli/auth/view.js +0 -46
  144. package/dist/src/cli/auth/whoami.d.ts +0 -7
  145. package/dist/src/cli/auth/whoami.js +0 -44
  146. package/dist/src/cli/category/create.d.ts +0 -10
  147. package/dist/src/cli/category/create.js +0 -24
  148. package/dist/src/cli/category/delete.d.ts +0 -8
  149. package/dist/src/cli/category/delete.js +0 -21
  150. package/dist/src/cli/category/get.d.ts +0 -6
  151. package/dist/src/cli/category/get.js +0 -11
  152. package/dist/src/cli/category/index.d.ts +0 -20
  153. package/dist/src/cli/category/index.js +0 -41
  154. package/dist/src/cli/category/list.d.ts +0 -4
  155. package/dist/src/cli/category/list.js +0 -10
  156. package/dist/src/cli/category/update.d.ts +0 -12
  157. package/dist/src/cli/category/update.js +0 -34
  158. package/dist/src/cli/comment/_flags.d.ts +0 -28
  159. package/dist/src/cli/comment/_flags.js +0 -48
  160. package/dist/src/cli/comment/approve.d.ts +0 -9
  161. package/dist/src/cli/comment/approve.js +0 -23
  162. package/dist/src/cli/comment/delete.d.ts +0 -9
  163. package/dist/src/cli/comment/delete.js +0 -24
  164. package/dist/src/cli/comment/get.d.ts +0 -6
  165. package/dist/src/cli/comment/get.js +0 -12
  166. package/dist/src/cli/comment/index.d.ts +0 -34
  167. package/dist/src/cli/comment/index.js +0 -53
  168. package/dist/src/cli/comment/list.d.ts +0 -9
  169. package/dist/src/cli/comment/list.js +0 -20
  170. package/dist/src/cli/comment/reject.d.ts +0 -9
  171. package/dist/src/cli/comment/reject.js +0 -23
  172. package/dist/src/cli/comment/reply.d.ts +0 -9
  173. package/dist/src/cli/comment/reply.js +0 -31
  174. package/dist/src/cli/comment/unread.d.ts +0 -7
  175. package/dist/src/cli/comment/unread.js +0 -21
  176. package/dist/src/cli/comment/view.d.ts +0 -3
  177. package/dist/src/cli/comment/view.js +0 -197
  178. package/dist/src/cli/config/edit.d.ts +0 -5
  179. package/dist/src/cli/config/edit.js +0 -36
  180. package/dist/src/cli/config/get.d.ts +0 -6
  181. package/dist/src/cli/config/get.js +0 -11
  182. package/dist/src/cli/config/index.d.ts +0 -10
  183. package/dist/src/cli/config/index.js +0 -22
  184. package/dist/src/cli/config/list.d.ts +0 -4
  185. package/dist/src/cli/config/list.js +0 -10
  186. package/dist/src/cli/config/set.d.ts +0 -9
  187. package/dist/src/cli/config/set.js +0 -48
  188. package/dist/src/cli/draft/_shared.d.ts +0 -27
  189. package/dist/src/cli/draft/_shared.js +0 -85
  190. package/dist/src/cli/draft/create.d.ts +0 -21
  191. package/dist/src/cli/draft/create.js +0 -34
  192. package/dist/src/cli/draft/delete.d.ts +0 -7
  193. package/dist/src/cli/draft/delete.js +0 -20
  194. package/dist/src/cli/draft/get.d.ts +0 -6
  195. package/dist/src/cli/draft/get.js +0 -11
  196. package/dist/src/cli/draft/index.d.ts +0 -54
  197. package/dist/src/cli/draft/index.js +0 -42
  198. package/dist/src/cli/draft/list.d.ts +0 -11
  199. package/dist/src/cli/draft/list.js +0 -23
  200. package/dist/src/cli/draft/publish.d.ts +0 -8
  201. package/dist/src/cli/draft/publish.js +0 -64
  202. package/dist/src/cli/draft/update.d.ts +0 -22
  203. package/dist/src/cli/draft/update.js +0 -29
  204. package/dist/src/cli/file/_shared.d.ts +0 -6
  205. package/dist/src/cli/file/_shared.js +0 -5
  206. package/dist/src/cli/file/delete.d.ts +0 -8
  207. package/dist/src/cli/file/delete.js +0 -21
  208. package/dist/src/cli/file/index.d.ts +0 -19
  209. package/dist/src/cli/file/index.js +0 -33
  210. package/dist/src/cli/file/list.d.ts +0 -6
  211. package/dist/src/cli/file/list.js +0 -11
  212. package/dist/src/cli/file/rename.d.ts +0 -8
  213. package/dist/src/cli/file/rename.js +0 -16
  214. package/dist/src/cli/file/upload.d.ts +0 -9
  215. package/dist/src/cli/file/upload.js +0 -32
  216. package/dist/src/cli/help/index.d.ts +0 -62
  217. package/dist/src/cli/help/index.js +0 -276
  218. package/dist/src/cli/help/registry.d.ts +0 -28
  219. package/dist/src/cli/help/registry.js +0 -29
  220. package/dist/src/cli/note/_flags.d.ts +0 -66
  221. package/dist/src/cli/note/_flags.js +0 -73
  222. package/dist/src/cli/note/create.d.ts +0 -23
  223. package/dist/src/cli/note/create.js +0 -25
  224. package/dist/src/cli/note/delete.d.ts +0 -8
  225. package/dist/src/cli/note/delete.js +0 -21
  226. package/dist/src/cli/note/edit.d.ts +0 -28
  227. package/dist/src/cli/note/edit.js +0 -114
  228. package/dist/src/cli/note/get.d.ts +0 -6
  229. package/dist/src/cli/note/get.js +0 -29
  230. package/dist/src/cli/note/index.d.ts +0 -77
  231. package/dist/src/cli/note/index.js +0 -63
  232. package/dist/src/cli/note/list.d.ts +0 -10
  233. package/dist/src/cli/note/list.js +0 -22
  234. package/dist/src/cli/note/publish.d.ts +0 -7
  235. package/dist/src/cli/note/publish.js +0 -17
  236. package/dist/src/cli/note/unpublish.d.ts +0 -7
  237. package/dist/src/cli/note/unpublish.js +0 -17
  238. package/dist/src/cli/note/update.d.ts +0 -25
  239. package/dist/src/cli/note/update.js +0 -36
  240. package/dist/src/cli/note/view.d.ts +0 -3
  241. package/dist/src/cli/note/view.js +0 -162
  242. package/dist/src/cli/page/create.d.ts +0 -41
  243. package/dist/src/cli/page/create.js +0 -56
  244. package/dist/src/cli/page/delete.d.ts +0 -7
  245. package/dist/src/cli/page/delete.js +0 -37
  246. package/dist/src/cli/page/edit.d.ts +0 -19
  247. package/dist/src/cli/page/edit.js +0 -117
  248. package/dist/src/cli/page/get.d.ts +0 -6
  249. package/dist/src/cli/page/get.js +0 -16
  250. package/dist/src/cli/page/index.d.ts +0 -44
  251. package/dist/src/cli/page/index.js +0 -38
  252. package/dist/src/cli/page/list.d.ts +0 -4
  253. package/dist/src/cli/page/list.js +0 -10
  254. package/dist/src/cli/page/update.d.ts +0 -16
  255. package/dist/src/cli/page/update.js +0 -48
  256. package/dist/src/cli/page/view.d.ts +0 -2
  257. package/dist/src/cli/page/view.js +0 -79
  258. package/dist/src/cli/post/_flags.d.ts +0 -66
  259. package/dist/src/cli/post/_flags.js +0 -96
  260. package/dist/src/cli/post/apply.d.ts +0 -7
  261. package/dist/src/cli/post/apply.js +0 -70
  262. package/dist/src/cli/post/create.d.ts +0 -21
  263. package/dist/src/cli/post/create.js +0 -24
  264. package/dist/src/cli/post/delete.d.ts +0 -8
  265. package/dist/src/cli/post/delete.js +0 -21
  266. package/dist/src/cli/post/edit.d.ts +0 -26
  267. package/dist/src/cli/post/edit.js +0 -115
  268. package/dist/src/cli/post/get.d.ts +0 -7
  269. package/dist/src/cli/post/get.js +0 -15
  270. package/dist/src/cli/post/index.d.ts +0 -91
  271. package/dist/src/cli/post/index.js +0 -73
  272. package/dist/src/cli/post/list.d.ts +0 -10
  273. package/dist/src/cli/post/list.js +0 -23
  274. package/dist/src/cli/post/publish.d.ts +0 -7
  275. package/dist/src/cli/post/publish.js +0 -17
  276. package/dist/src/cli/post/stage.d.ts +0 -23
  277. package/dist/src/cli/post/stage.js +0 -55
  278. package/dist/src/cli/post/unpublish.d.ts +0 -7
  279. package/dist/src/cli/post/unpublish.js +0 -17
  280. package/dist/src/cli/post/update.d.ts +0 -23
  281. package/dist/src/cli/post/update.js +0 -38
  282. package/dist/src/cli/post/view.d.ts +0 -3
  283. package/dist/src/cli/post/view.js +0 -150
  284. package/dist/src/cli/preview/index.d.ts +0 -13
  285. package/dist/src/cli/preview/index.js +0 -226
  286. package/dist/src/cli/profile/index.d.ts +0 -14
  287. package/dist/src/cli/profile/index.js +0 -36
  288. package/dist/src/cli/profile/ls.d.ts +0 -5
  289. package/dist/src/cli/profile/ls.js +0 -26
  290. package/dist/src/cli/profile/mark.d.ts +0 -9
  291. package/dist/src/cli/profile/mark.js +0 -23
  292. package/dist/src/cli/profile/rm.d.ts +0 -12
  293. package/dist/src/cli/profile/rm.js +0 -50
  294. package/dist/src/cli/profile/show.d.ts +0 -9
  295. package/dist/src/cli/profile/show.js +0 -40
  296. package/dist/src/cli/profile/use.d.ts +0 -6
  297. package/dist/src/cli/profile/use.js +0 -11
  298. package/dist/src/cli/profile/view.d.ts +0 -8
  299. package/dist/src/cli/profile/view.js +0 -21
  300. package/dist/src/cli/project/_flags.d.ts +0 -56
  301. package/dist/src/cli/project/_flags.js +0 -130
  302. package/dist/src/cli/project/create.d.ts +0 -17
  303. package/dist/src/cli/project/create.js +0 -25
  304. package/dist/src/cli/project/delete.d.ts +0 -8
  305. package/dist/src/cli/project/delete.js +0 -22
  306. package/dist/src/cli/project/edit.d.ts +0 -11
  307. package/dist/src/cli/project/edit.js +0 -61
  308. package/dist/src/cli/project/get.d.ts +0 -7
  309. package/dist/src/cli/project/get.js +0 -14
  310. package/dist/src/cli/project/index.d.ts +0 -43
  311. package/dist/src/cli/project/index.js +0 -52
  312. package/dist/src/cli/project/list.d.ts +0 -8
  313. package/dist/src/cli/project/list.js +0 -19
  314. package/dist/src/cli/project/update.d.ts +0 -18
  315. package/dist/src/cli/project/update.js +0 -24
  316. package/dist/src/cli/project/view-cmd.d.ts +0 -7
  317. package/dist/src/cli/project/view-cmd.js +0 -15
  318. package/dist/src/cli/project/view.d.ts +0 -3
  319. package/dist/src/cli/project/view.js +0 -102
  320. package/dist/src/cli/render/codehighlight.d.ts +0 -8
  321. package/dist/src/cli/render/codehighlight.js +0 -264
  322. package/dist/src/cli/render/envelope.d.ts +0 -7
  323. package/dist/src/cli/render/envelope.js +0 -23
  324. package/dist/src/cli/render/frontmatter.d.ts +0 -8
  325. package/dist/src/cli/render/frontmatter.js +0 -50
  326. package/dist/src/cli/render/helpers.d.ts +0 -2
  327. package/dist/src/cli/render/helpers.js +0 -11
  328. package/dist/src/cli/render/index.d.ts +0 -7
  329. package/dist/src/cli/render/index.js +0 -10
  330. package/dist/src/cli/render/lexical/blocks.d.ts +0 -19
  331. package/dist/src/cli/render/lexical/blocks.js +0 -208
  332. package/dist/src/cli/render/lexical/code.d.ts +0 -2
  333. package/dist/src/cli/render/lexical/code.js +0 -22
  334. package/dist/src/cli/render/lexical/embeds.d.ts +0 -6
  335. package/dist/src/cli/render/lexical/embeds.js +0 -51
  336. package/dist/src/cli/render/lexical/index.d.ts +0 -9
  337. package/dist/src/cli/render/lexical/index.js +0 -25
  338. package/dist/src/cli/render/lexical/inlines.d.ts +0 -17
  339. package/dist/src/cli/render/lexical/inlines.js +0 -76
  340. package/dist/src/cli/render/lexical/parser.d.ts +0 -10
  341. package/dist/src/cli/render/lexical/parser.js +0 -64
  342. package/dist/src/cli/render/lexical/walker.d.ts +0 -21
  343. package/dist/src/cli/render/lexical/walker.js +0 -51
  344. package/dist/src/cli/render/markdown.d.ts +0 -18
  345. package/dist/src/cli/render/markdown.js +0 -196
  346. package/dist/src/cli/render/metadata-block.d.ts +0 -14
  347. package/dist/src/cli/render/metadata-block.js +0 -50
  348. package/dist/src/cli/skill/all.d.ts +0 -4
  349. package/dist/src/cli/skill/all.js +0 -11
  350. package/dist/src/cli/skill/get.d.ts +0 -6
  351. package/dist/src/cli/skill/get.js +0 -12
  352. package/dist/src/cli/skill/index.d.ts +0 -10
  353. package/dist/src/cli/skill/index.js +0 -34
  354. package/dist/src/cli/skill/list.d.ts +0 -4
  355. package/dist/src/cli/skill/list.js +0 -11
  356. package/dist/src/cli/skill/search.d.ts +0 -6
  357. package/dist/src/cli/skill/search.js +0 -12
  358. package/dist/src/cli/skill/views.d.ts +0 -6
  359. package/dist/src/cli/skill/views.js +0 -90
  360. package/dist/src/cli/snippet/_flags.d.ts +0 -57
  361. package/dist/src/cli/snippet/_flags.js +0 -123
  362. package/dist/src/cli/snippet/_resolve.d.ts +0 -4
  363. package/dist/src/cli/snippet/_resolve.js +0 -32
  364. package/dist/src/cli/snippet/_sync.d.ts +0 -5
  365. package/dist/src/cli/snippet/_sync.js +0 -54
  366. package/dist/src/cli/snippet/create.d.ts +0 -19
  367. package/dist/src/cli/snippet/create.js +0 -35
  368. package/dist/src/cli/snippet/delete.d.ts +0 -8
  369. package/dist/src/cli/snippet/delete.js +0 -28
  370. package/dist/src/cli/snippet/edit.d.ts +0 -7
  371. package/dist/src/cli/snippet/edit.js +0 -29
  372. package/dist/src/cli/snippet/get.d.ts +0 -6
  373. package/dist/src/cli/snippet/get.js +0 -12
  374. package/dist/src/cli/snippet/index.d.ts +0 -43
  375. package/dist/src/cli/snippet/index.js +0 -58
  376. package/dist/src/cli/snippet/list.d.ts +0 -9
  377. package/dist/src/cli/snippet/list.js +0 -20
  378. package/dist/src/cli/snippet/pull.d.ts +0 -8
  379. package/dist/src/cli/snippet/pull.js +0 -33
  380. package/dist/src/cli/snippet/push.d.ts +0 -10
  381. package/dist/src/cli/snippet/push.js +0 -31
  382. package/dist/src/cli/snippet/update.d.ts +0 -8
  383. package/dist/src/cli/snippet/update.js +0 -16
  384. package/dist/src/cli/topic/create.d.ts +0 -10
  385. package/dist/src/cli/topic/create.js +0 -24
  386. package/dist/src/cli/topic/delete.d.ts +0 -7
  387. package/dist/src/cli/topic/delete.js +0 -37
  388. package/dist/src/cli/topic/get.d.ts +0 -6
  389. package/dist/src/cli/topic/get.js +0 -15
  390. package/dist/src/cli/topic/index.d.ts +0 -20
  391. package/dist/src/cli/topic/index.js +0 -32
  392. package/dist/src/cli/topic/list.d.ts +0 -4
  393. package/dist/src/cli/topic/list.js +0 -10
  394. package/dist/src/cli/topic/update.d.ts +0 -11
  395. package/dist/src/cli/topic/update.js +0 -51
  396. package/dist/src/cli/ui/index.d.ts +0 -24
  397. package/dist/src/cli/ui/index.js +0 -83
  398. package/dist/src/cli/update/index.d.ts +0 -10
  399. package/dist/src/cli/update/index.js +0 -142
  400. package/dist/src/domain/admin-link.d.ts +0 -12
  401. package/dist/src/domain/admin-link.js +0 -45
  402. package/dist/src/domain/content-spec.d.ts +0 -20
  403. package/dist/src/domain/content-spec.js +0 -78
  404. package/dist/src/domain/envelope-compat.d.ts +0 -68
  405. package/dist/src/domain/envelope-compat.js +0 -121
  406. package/dist/src/domain/envelope.d.ts +0 -34
  407. package/dist/src/domain/envelope.js +0 -355
  408. package/dist/src/domain/errors.d.ts +0 -336
  409. package/dist/src/domain/errors.js +0 -239
  410. package/dist/src/domain/gate.d.ts +0 -14
  411. package/dist/src/domain/gate.js +0 -18
  412. package/dist/src/domain/payload.d.ts +0 -64
  413. package/dist/src/domain/payload.js +0 -237
  414. package/dist/src/domain/preflight-guards.d.ts +0 -54
  415. package/dist/src/domain/preflight-guards.js +0 -130
  416. package/dist/src/domain/runtime-flags.d.ts +0 -33
  417. package/dist/src/domain/runtime-flags.js +0 -166
  418. package/dist/src/domain/schema/api-envelope.d.ts +0 -67
  419. package/dist/src/domain/schema/api-envelope.js +0 -65
  420. package/dist/src/domain/schema/category.d.ts +0 -23
  421. package/dist/src/domain/schema/category.js +0 -19
  422. package/dist/src/domain/schema/config.d.ts +0 -13
  423. package/dist/src/domain/schema/config.js +0 -18
  424. package/dist/src/domain/schema/note.d.ts +0 -76
  425. package/dist/src/domain/schema/note.js +0 -35
  426. package/dist/src/domain/schema/page.d.ts +0 -40
  427. package/dist/src/domain/schema/page.js +0 -22
  428. package/dist/src/domain/schema/post.d.ts +0 -68
  429. package/dist/src/domain/schema/post.js +0 -35
  430. package/dist/src/domain/schema/profile.d.ts +0 -14
  431. package/dist/src/domain/schema/profile.js +0 -22
  432. package/dist/src/domain/schema/topic.d.ts +0 -24
  433. package/dist/src/domain/schema/topic.js +0 -16
  434. package/dist/src/domain/version.d.ts +0 -15
  435. package/dist/src/domain/version.js +0 -43
  436. package/dist/src/index.d.ts +0 -4
  437. package/dist/src/index.js +0 -8
  438. package/dist/src/layers/App.d.ts +0 -30
  439. package/dist/src/layers/App.js +0 -39
  440. package/dist/src/services/Ai/index.d.ts +0 -13
  441. package/dist/src/services/Ai/index.js +0 -127
  442. package/dist/src/services/Ai/overview.d.ts +0 -7
  443. package/dist/src/services/Ai/overview.js +0 -11
  444. package/dist/src/services/Ai/resources.d.ts +0 -7
  445. package/dist/src/services/Ai/resources.js +0 -59
  446. package/dist/src/services/Ai/shared.d.ts +0 -2
  447. package/dist/src/services/Ai/shared.js +0 -11
  448. package/dist/src/services/Ai/tasks.d.ts +0 -8
  449. package/dist/src/services/Ai/tasks.js +0 -144
  450. package/dist/src/services/Ai/types.d.ts +0 -130
  451. package/dist/src/services/Ai/types.js +0 -1
  452. package/dist/src/services/Api.d.ts +0 -67
  453. package/dist/src/services/Api.js +0 -348
  454. package/dist/src/services/Auth.d.ts +0 -101
  455. package/dist/src/services/Auth.js +0 -402
  456. package/dist/src/services/Backup.d.ts +0 -8
  457. package/dist/src/services/Backup.js +0 -4
  458. package/dist/src/services/Cache.d.ts +0 -8
  459. package/dist/src/services/Cache.js +0 -4
  460. package/dist/src/services/Comment.d.ts +0 -48
  461. package/dist/src/services/Comment.js +0 -102
  462. package/dist/src/services/Config.d.ts +0 -95
  463. package/dist/src/services/Config.js +0 -359
  464. package/dist/src/services/Editor.d.ts +0 -28
  465. package/dist/src/services/Editor.js +0 -95
  466. package/dist/src/services/Lexical.d.ts +0 -27
  467. package/dist/src/services/Lexical.js +0 -56
  468. package/dist/src/services/Migration.d.ts +0 -31
  469. package/dist/src/services/Migration.js +0 -177
  470. package/dist/src/services/Profile.d.ts +0 -29
  471. package/dist/src/services/Profile.js +0 -115
  472. package/dist/src/services/Renderer/content.d.ts +0 -16
  473. package/dist/src/services/Renderer/content.js +0 -110
  474. package/dist/src/services/Renderer/datetime.d.ts +0 -38
  475. package/dist/src/services/Renderer/datetime.js +0 -147
  476. package/dist/src/services/Renderer/errors.d.ts +0 -3
  477. package/dist/src/services/Renderer/errors.js +0 -59
  478. package/dist/src/services/Renderer/index.d.ts +0 -13
  479. package/dist/src/services/Renderer/index.js +0 -11
  480. package/dist/src/services/Renderer/lists.d.ts +0 -1
  481. package/dist/src/services/Renderer/lists.js +0 -101
  482. package/dist/src/services/Renderer/options.d.ts +0 -10
  483. package/dist/src/services/Renderer/options.js +0 -13
  484. package/dist/src/services/Renderer/primitives.d.ts +0 -4
  485. package/dist/src/services/Renderer/primitives.js +0 -12
  486. package/dist/src/services/Renderer/service.d.ts +0 -35
  487. package/dist/src/services/Renderer/service.js +0 -123
  488. package/dist/src/services/Renderer/view.d.ts +0 -16
  489. package/dist/src/services/Renderer/view.js +0 -1
  490. package/dist/src/services/Resolver.d.ts +0 -47
  491. package/dist/src/services/Resolver.js +0 -269
  492. package/dist/src/services/Skill.d.ts +0 -29
  493. package/dist/src/services/Skill.js +0 -421
  494. package/dist/src/services/UpdateNotifier.d.ts +0 -162
  495. package/dist/src/services/UpdateNotifier.js +0 -572
  496. package/dist/test/cli/ai/ai.test.d.ts +0 -1
  497. package/dist/test/cli/ai/ai.test.js +0 -507
  498. package/dist/test/cli/ai/verbs.test.d.ts +0 -1
  499. package/dist/test/cli/ai/verbs.test.js +0 -235
  500. package/dist/test/cli/auth/login.test.d.ts +0 -1
  501. package/dist/test/cli/auth/login.test.js +0 -236
  502. package/dist/test/cli/auth/logout-whoami.test.d.ts +0 -1
  503. package/dist/test/cli/auth/logout-whoami.test.js +0 -124
  504. package/dist/test/cli/auth/status.test.d.ts +0 -1
  505. package/dist/test/cli/auth/status.test.js +0 -90
  506. package/dist/test/cli/category/category.test.d.ts +0 -1
  507. package/dist/test/cli/category/category.test.js +0 -175
  508. package/dist/test/cli/comment/comment.test.d.ts +0 -1
  509. package/dist/test/cli/comment/comment.test.js +0 -445
  510. package/dist/test/cli/config/config.test.d.ts +0 -1
  511. package/dist/test/cli/config/config.test.js +0 -281
  512. package/dist/test/cli/edit-roundtrip.test.d.ts +0 -1
  513. package/dist/test/cli/edit-roundtrip.test.js +0 -259
  514. package/dist/test/cli/file/file.test.d.ts +0 -1
  515. package/dist/test/cli/file/file.test.js +0 -185
  516. package/dist/test/cli/help.test.d.ts +0 -1
  517. package/dist/test/cli/help.test.js +0 -289
  518. package/dist/test/cli/note/create.test.d.ts +0 -1
  519. package/dist/test/cli/note/create.test.js +0 -155
  520. package/dist/test/cli/note/list.test.d.ts +0 -1
  521. package/dist/test/cli/note/list.test.js +0 -115
  522. package/dist/test/cli/note/publish.test.d.ts +0 -1
  523. package/dist/test/cli/note/publish.test.js +0 -123
  524. package/dist/test/cli/page/page.test.d.ts +0 -1
  525. package/dist/test/cli/page/page.test.js +0 -185
  526. package/dist/test/cli/post/create.test.d.ts +0 -1
  527. package/dist/test/cli/post/create.test.js +0 -172
  528. package/dist/test/cli/post/list.test.d.ts +0 -1
  529. package/dist/test/cli/post/list.test.js +0 -133
  530. package/dist/test/cli/post/publish.test.d.ts +0 -1
  531. package/dist/test/cli/post/publish.test.js +0 -139
  532. package/dist/test/cli/post/stage-apply.test.d.ts +0 -1
  533. package/dist/test/cli/post/stage-apply.test.js +0 -215
  534. package/dist/test/cli/post/update.test.d.ts +0 -1
  535. package/dist/test/cli/post/update.test.js +0 -160
  536. package/dist/test/cli/post-note-crud.test.d.ts +0 -1
  537. package/dist/test/cli/post-note-crud.test.js +0 -362
  538. package/dist/test/cli/profile/ls.test.d.ts +0 -1
  539. package/dist/test/cli/profile/ls.test.js +0 -93
  540. package/dist/test/cli/profile/mark-use.test.d.ts +0 -1
  541. package/dist/test/cli/profile/mark-use.test.js +0 -216
  542. package/dist/test/cli/project-crud.test.d.ts +0 -1
  543. package/dist/test/cli/project-crud.test.js +0 -315
  544. package/dist/test/cli/render/lexical.test.d.ts +0 -1
  545. package/dist/test/cli/render/lexical.test.js +0 -216
  546. package/dist/test/cli/render/markdown.test.d.ts +0 -1
  547. package/dist/test/cli/render/markdown.test.js +0 -39
  548. package/dist/test/cli/snippet-crud.test.d.ts +0 -1
  549. package/dist/test/cli/snippet-crud.test.js +0 -293
  550. package/dist/test/cli/topic/topic.test.d.ts +0 -1
  551. package/dist/test/cli/topic/topic.test.js +0 -181
  552. package/dist/test/cli/update.test.d.ts +0 -1
  553. package/dist/test/cli/update.test.js +0 -395
  554. package/dist/test/domain/content-spec.test.d.ts +0 -1
  555. package/dist/test/domain/content-spec.test.js +0 -126
  556. package/dist/test/domain/envelope-compat.test.d.ts +0 -1
  557. package/dist/test/domain/envelope-compat.test.js +0 -126
  558. package/dist/test/domain/envelope.test.d.ts +0 -1
  559. package/dist/test/domain/envelope.test.js +0 -149
  560. package/dist/test/domain/errors.test.d.ts +0 -1
  561. package/dist/test/domain/errors.test.js +0 -127
  562. package/dist/test/domain/gate.test.d.ts +0 -1
  563. package/dist/test/domain/gate.test.js +0 -128
  564. package/dist/test/domain/payload.test.d.ts +0 -1
  565. package/dist/test/domain/payload.test.js +0 -259
  566. package/dist/test/helper/test-fs.d.ts +0 -24
  567. package/dist/test/helper/test-fs.js +0 -161
  568. package/dist/test/helper/test-http.d.ts +0 -31
  569. package/dist/test/helper/test-http.js +0 -66
  570. package/dist/test/integration/_helpers.d.ts +0 -5
  571. package/dist/test/integration/_helpers.js +0 -24
  572. package/dist/test/integration/cli-error-envelope.test.d.ts +0 -1
  573. package/dist/test/integration/cli-error-envelope.test.js +0 -137
  574. package/dist/test/integration/cli-help-render.test.d.ts +0 -1
  575. package/dist/test/integration/cli-help-render.test.js +0 -149
  576. package/dist/test/integration/cli-help.test.d.ts +0 -1
  577. package/dist/test/integration/cli-help.test.js +0 -67
  578. package/dist/test/integration/cli-post-list.test.d.ts +0 -1
  579. package/dist/test/integration/cli-post-list.test.js +0 -140
  580. package/dist/test/integration/cli-skill.test.d.ts +0 -1
  581. package/dist/test/integration/cli-skill.test.js +0 -74
  582. package/dist/test/integration/cli-version.test.d.ts +0 -1
  583. package/dist/test/integration/cli-version.test.js +0 -37
  584. package/dist/test/services/Api.test.d.ts +0 -1
  585. package/dist/test/services/Api.test.js +0 -553
  586. package/dist/test/services/Auth.test.d.ts +0 -1
  587. package/dist/test/services/Auth.test.js +0 -650
  588. package/dist/test/services/Config.test.d.ts +0 -1
  589. package/dist/test/services/Config.test.js +0 -510
  590. package/dist/test/services/Datetime.test.d.ts +0 -1
  591. package/dist/test/services/Datetime.test.js +0 -113
  592. package/dist/test/services/Editor.test.d.ts +0 -1
  593. package/dist/test/services/Editor.test.js +0 -205
  594. package/dist/test/services/Lexical.errors.test.d.ts +0 -1
  595. package/dist/test/services/Lexical.errors.test.js +0 -60
  596. package/dist/test/services/Lexical.test.d.ts +0 -1
  597. package/dist/test/services/Lexical.test.js +0 -68
  598. package/dist/test/services/Migration.test.d.ts +0 -1
  599. package/dist/test/services/Migration.test.js +0 -376
  600. package/dist/test/services/Profile.test.d.ts +0 -1
  601. package/dist/test/services/Profile.test.js +0 -277
  602. package/dist/test/services/Renderer.test.d.ts +0 -1
  603. package/dist/test/services/Renderer.test.js +0 -538
  604. package/dist/test/services/Resolver.test.d.ts +0 -1
  605. package/dist/test/services/Resolver.test.js +0 -320
  606. package/dist/test/services/Skill.test.d.ts +0 -1
  607. package/dist/test/services/Skill.test.js +0 -261
  608. package/dist/test/services/UpdateNotifier.spawn.test.d.ts +0 -1
  609. package/dist/test/services/UpdateNotifier.spawn.test.js +0 -73
  610. package/dist/test/services/UpdateNotifier.test.d.ts +0 -1
  611. package/dist/test/services/UpdateNotifier.test.js +0 -912
@@ -1,8 +1,8 @@
1
1
  import { i as __toESM, n as __exportAll, r as __require, t as __commonJSMin } from "./rolldown-runtime-B4iAMlE-.mjs";
2
- import { $ as fiberIdWith, $a as findFirst, $i as combine$3, $n as isDieType, $o as NodeInspectSymbol, $r as catchAll, $t as sync$2, A as all$6, Aa as toArray, Ai as onInterrupt, An as scoped$3, Ao as fromNullable, Ar as bindTo, At as orDie, B as catchSome, Ba as merge$3, Bi as withFiberRuntime, Bn as addFinalizer, Bo as orElse$3, Br as allLevels, Bt as retry, C as decodeSync, Ca as map$12, Ci as fiberRefUnsafeMake, Cn as TaggedError$1, Co as splitAt, Cr as mapBoth, Ct as match$5, D as acquireRelease, Da as reverse, Di as interruptFiber, Dn as mergeAll$2, Do as empty$17, Dr as zip$2, Dt as negate, E as _void, Ea as reduce$1, Ei as interruptAsFiber, En as fromEffect$5, Eo as unsafeGet$1, Er as void_$3, Et as matchEffect, F as cached$1, Fa as Reference, Fi as tap$1, Fn as updateContext$1, Fo as isOption, Fr as set$3, Ft as provideService, G as die$2, Ga as append$5, Gi as of$3, Gn as make$36, Go as isEither, Gr as CommitPrototype, Gt as scopeWith, H as catchTags, Ha as isConfigError, Hi as DeferredTypeId$1, Hn as close, Ho as boolean$3, Hr as updateAs, Ht as runSync, I as catchAll$1, Ia as Tag$3, Ii as uninterruptible, In as forkIn$1, Io as isSome, Ir as update$9, It as race, J as ensuring$4, Ja as drop$1, Ji as get$23, Jn as fail$6, Jo as merge$2, Jr as consoleTag, Jt as serviceFunctions, K as dieMessage, Ka as appendAll$1, Ki as empty$16, Kn as NoSuchElementException, Ko as left, Kr as currentServices, Kt as scoped$4, L as catchAllCause$1, La as add$1, Li as uninterruptibleMask$1, Ln as makeSynchronized, Lo as map$14, Lr as updateAndGet, Lt as raceWith, M as as, Ma as unsafeGet, Mi as succeed$5, Mn as updateEffect$1, Mo as getOrThrow, Mr as get$22, Mt as orElseFail, N as asVoid$1, Na as unsafeHead, Ni as suspend$5, Nn as unsafeFork, No as getOrUndefined, Nr as make$35, O as acquireUseRelease$2, Oa as take$2, Oi as interruptible$1, On as provide$1, Oo as filter$5, Or as zipRight$2, Ot as onError, P as async, Pa as GenericTag, Pi as sync$1, Pn as unsafeRunPromiseExit, Po as isNone, Pr as modify$1, Pt as provide$2, Q as failSync, Qa as filterMap, Qi as set$4, Qn as interruptors, Qo as Class$1, Qr as asyncInterrupt, Qt as suspend$6, R as catchAllDefect, Ra as get$20, Ri as void_$2, Rn as unsafeMakeSemaphore, Ro as match$4, Rr as get$24, Rt as repeat, S as redactedRegistry, Sa as isEmpty$7, Si as fiberRefLocally, Sn as Error$1, So as span, Sr as map$10, Ss as pipe, St as mapInputContext, T as is$2, Ta as prepend$2, Ti as interrupt$2, Tn as taggedEnum, To as take$3, Tr as succeed$6, Tt as matchCauseEffect, U as context, Ua as isMissingDataOnly, Ui as cons$1, Un as extend, Uo as mapInput, Ur as sequential, Ut as runtime, V as catchTag, Va as omit, Vi as zipRight$1, Vn as addFinalizerExit, Vo as some, Vr as getOrDefault, Vt as runFork$1, W as contextWithEffect, Wa as allocate, Wi as isNil, Wn as fork, Wo as string$1, Wr as Class, Wt as scope, X as fail$8, Xa as every, Xi as isEmpty$8, Xn as flipCauseOption, Xo as pipeArguments, Xr as as$1, Xt as sleep$2, Y as exit, Ya as empty$15, Yi as has$1, Yn as failureOrCause, Yo as right, Yr as round, Yt as serviceOption, Z as failCause$4, Za as filter$4, Zi as make$39, Zn as interrupt$3, Zo as BaseProto, Zr as asVoid, Zt as succeed$7, _ as optional$9, _a as drop, _i as exitVoid, _n as zipLeft, _o as prepend$3, _r as all$5, _s as constTrue, _t as logWarning, a as Literal, aa as make$34, ai as deferredFailCause, an as tryPromise, ao as head$2, ar as currentLoggers$1, as as equals, at as forEach$2, b as isConfig, ba as fromIterable$2, bi as fiberRefGet, bn as spaced$1, bo as some$1, br as failCause$3, bs as dual, bt as mapBoth$1, ca as fromIterable$4, ci as deferredIsDone, cn as uninterruptibleMask, co as isEmptyReadonlyArray, cr as ensuring$5, cs as combine$2, ct as forkScoped, d as TaggedError, da as size$15, di as deferredUnsafeDone, dn as unsafeMakeSemaphore$1, do as make$38, dr as scopeTag, ds as symbol$1, dt as interrupt$4, ea as combineAll, ei as currentContext$1, en as tap, eo as findFirstIndex, er as isInterrupted, es as format$3, et as filter$3, f as Union, fa as decode, fi as deferredUnsafeMake, fn as useSpan, fo as map$13, fr as prettyLoggerDefault$1, fs as hasProperty, ft as interruptible, g as int, ga as appendAll, gi as exitSucceed, gn as zip$1, go as of$2, gr as join$3, gs as constFalse, gt as logError, h as decodeUnknown, ha as append$4, hi as exitFailCause, hn as withParentSpan, ho as matchRight, hr as interruptAllAs$1, hs as globalValue, ht as locally, i as Int, ia as get$21, ii as deferredFail, in as tryMap, io as getSomes, ir as squash, is as toStringUnknown, it as fnUntraced, j as annotateLogs, ja as unsafeFromArray, ji as scopeClose, jn as succeed$4, jo as getOrElse, jr as sleep$1, jt as orElse$4, k as addFinalizer$1, ka as takeRight, ki as map$8, kn as provideMerge$1, ko as flatMap$6, kr as bind, kt as onInterrupt$1, la as has$2, li as deferredMake, ln as unlessEffect, lo as isNonEmptyReadonlyArray, lr as forEachConcurrentDiscard, ls as hash, lt as gen, ma as seconds, mi as exitFail, mn as withFiberRuntime$1, mo as matchLeft, mr as inheritAll$1, ms as isTagged, mt as isEffect, n as Date$, na as make$40, ni as deferredAwait, nn as tapErrorCause, no as flatMap$7, nr as map$11, ns as symbolRedactable, nt as flatMap$5, o as Number$, oa as set$2, oi as deferredInterrupt, on as try_, oo as headNonEmpty, or as currentMinimumLogLevel, os as symbol$2, ot as forkDaemon, p as compose, pa as isFinite$1, pi as exitAs, pn as when$2, po as match$6, pr as _await$2, ps as isObject, pt as intoDeferred, q as either$1, qa as contains, qi as fromIterable$3, qn as die$1, qo as match$2, qr as spanTag, qt as scopedWith$1, r as Defect, ra as none$4, ri as deferredComplete, rn as timeout, ro as fromIterable$1, rr as reduceWithContext, rs as toJSON, rt as flatten$5, s as NumberFromString, sa as add$2, si as deferredInterruptWith, sn as uninterruptible$1, so as isArray$1, sr as defaultLogger$1, ss as cached, st as forkIn, t as Cause, ta as ids$1, ti as currentTracerEnabled$1, tn as tapError, to as findLast, tr as isInterruptedOnly, ts as redact$1, tt as filterOrDieMessage, u as String$, ua as remove$5, ui as deferredSucceed, un as unsafeMakeLatch, uo as join$4, ur as scopeMake, us as string, ut as ignore, va as empty$14, vi as exitZipRight, vn as zipRight$3, vo as reduce$2, vr as die, vs as constUndefined, vt as makeSemaphore, w as encodeSync, wa as of$1, wi as flatMap$4, wn as tagged, wo as tailNonEmpty, wr as match$3, wt as matchCause, x as proto$19, xa as isChunk, xi as fiberRefGetWith, xo as sort$2, xr as isFailure, xs as identity, xt as mapError$3, y as make$37, ya as filter$2, yi as fiberId, yn as zipWith, yo as reduceRight, yr as fail$7, ys as constVoid, yt as map$9, z as catchIf, za as getOption, zi as whenEffect, zn as Scope, zo as none$3, zr as TypeId$22, zt as repeatN } from "./esm-ZXjJmLEC.mjs";
3
- import { _ as LinkNode, a as HeadingNode, b as CodeHighlightNode, d as ListItemNode, f as ListNode, g as AutoLinkNode, o as QuoteNode, x as CodeNode } from "./LexicalRichText.node-Cd-BySPE.mjs";
4
- import { a as HorizontalRuleNode } from "./LexicalExtension.node-BwJt2LXV.mjs";
5
- import { hn as ElementNode, mn as DecoratorNode } from "./Lexical.node-kAh5GM2n.mjs";
2
+ import { $ as fiberIdWith, $a as findFirst, $i as combine$3, $n as isDieType, $o as NodeInspectSymbol, $r as catchAll, $t as sync$2, A as all$6, Aa as toArray, Ai as onInterrupt, An as scoped$3, Ao as fromNullable, Ar as bindTo, At as orDie, B as catchSome, Ba as merge$3, Bi as withFiberRuntime, Bn as addFinalizer, Bo as orElse$3, Br as allLevels, Bt as retry, C as decodeSync, Ca as map$12, Ci as fiberRefUnsafeMake, Cn as TaggedError$1, Co as splitAt, Cr as mapBoth, Ct as match$5, D as acquireRelease, Da as reverse, Di as interruptFiber, Dn as mergeAll$2, Do as empty$17, Dr as zip$2, Dt as negate, E as _void, Ea as reduce$1, Ei as interruptAsFiber, En as fromEffect$5, Eo as unsafeGet$1, Er as void_$3, Et as matchEffect, F as cached$1, Fa as Reference, Fi as tap$1, Fn as updateContext$1, Fo as isOption, Fr as set$3, Ft as provideService, G as die$2, Ga as append$5, Gi as of$3, Gn as make$36, Go as isEither, Gr as CommitPrototype, Gt as scopeWith, H as catchTags, Ha as isConfigError, Hi as DeferredTypeId$1, Hn as close, Ho as boolean$3, Hr as updateAs, Ht as runSync, I as catchAll$1, Ia as Tag$3, Ii as uninterruptible, In as forkIn$1, Io as isSome, Ir as update$9, It as race, J as ensuring$4, Ja as drop$1, Ji as get$23, Jn as fail$6, Jo as merge$2, Jr as consoleTag, Jt as serviceFunctions, K as dieMessage, Ka as appendAll$1, Ki as empty$16, Kn as NoSuchElementException, Ko as left, Kr as currentServices, Kt as scoped$4, L as catchAllCause$1, La as add$1, Li as uninterruptibleMask$1, Ln as makeSynchronized, Lo as map$14, Lr as updateAndGet, Lt as raceWith, M as as, Ma as unsafeGet, Mi as succeed$5, Mn as updateEffect$1, Mo as getOrThrow, Mr as get$22, Mt as orElseFail, N as asVoid$1, Na as unsafeHead, Ni as suspend$5, Nn as unsafeFork, No as getOrUndefined, Nr as make$35, O as acquireUseRelease$2, Oa as take$2, Oi as interruptible$1, On as provide$1, Oo as filter$5, Or as zipRight$2, Ot as onError, P as async, Pa as GenericTag, Pi as sync$1, Pn as unsafeRunPromiseExit, Po as isNone, Pr as modify$1, Pt as provide$2, Q as failSync, Qa as filterMap, Qi as set$4, Qn as interruptors, Qo as Class$1, Qr as asyncInterrupt, Qt as suspend$6, R as catchAllDefect, Ra as get$20, Ri as void_$2, Rn as unsafeMakeSemaphore, Ro as match$4, Rr as get$24, Rt as repeat, S as redactedRegistry, Sa as isEmpty$7, Si as fiberRefLocally, Sn as Error$1, So as span, Sr as map$10, Ss as pipe, St as mapInputContext, T as is$2, Ta as prepend$2, Ti as interrupt$2, Tn as taggedEnum, To as take$3, Tr as succeed$6, Tt as matchCauseEffect, U as context, Ua as isMissingDataOnly, Ui as cons$1, Un as extend, Uo as mapInput, Ur as sequential, Ut as runtime, V as catchTag, Va as omit, Vi as zipRight$1, Vn as addFinalizerExit, Vo as some, Vr as getOrDefault, Vt as runFork$1, W as contextWithEffect, Wa as allocate, Wi as isNil, Wn as fork, Wo as string$1, Wr as Class, Wt as scope, X as fail$8, Xa as every, Xi as isEmpty$8, Xn as flipCauseOption, Xo as pipeArguments, Xr as as$1, Xt as sleep$2, Y as exit, Ya as empty$15, Yi as has$1, Yn as failureOrCause, Yo as right, Yr as round, Yt as serviceOption, Z as failCause$4, Za as filter$4, Zi as make$39, Zn as interrupt$3, Zo as BaseProto, Zr as asVoid, Zt as succeed$7, _ as optional$9, _a as drop, _i as exitVoid, _n as zipLeft, _o as prepend$3, _r as all$5, _s as constTrue, _t as logWarning, a as Literal, aa as make$34, ai as deferredFailCause, an as tryPromise, ao as head$2, ar as currentLoggers$1, as as equals, at as forEach$2, b as isConfig, ba as fromIterable$2, bi as fiberRefGet, bn as spaced$1, bo as some$1, br as failCause$3, bs as dual, bt as mapBoth$1, ca as fromIterable$4, ci as deferredIsDone, cn as uninterruptibleMask, co as isEmptyReadonlyArray, cr as ensuring$5, cs as combine$2, ct as forkScoped, d as TaggedError, da as size$15, di as deferredUnsafeDone, dn as unsafeMakeSemaphore$1, do as make$38, dr as scopeTag, ds as symbol$1, dt as interrupt$4, ea as combineAll, ei as currentContext$1, en as tap, eo as findFirstIndex, er as isInterrupted, es as format$3, et as filter$3, f as Union, fa as decode, fi as deferredUnsafeMake, fn as useSpan, fo as map$13, fr as prettyLoggerDefault$1, fs as hasProperty, ft as interruptible, g as int, ga as appendAll, gi as exitSucceed, gn as zip$1, go as of$2, gr as join$3, gs as constFalse, gt as logError, h as decodeUnknown, ha as append$4, hi as exitFailCause, hn as withParentSpan, ho as matchRight, hr as interruptAllAs$1, hs as globalValue, ht as locally, i as Int, ia as get$21, ii as deferredFail, in as tryMap, io as getSomes, ir as squash, is as toStringUnknown, it as fnUntraced, j as annotateLogs, ja as unsafeFromArray, ji as scopeClose, jn as succeed$4, jo as getOrElse, jr as sleep$1, jt as orElse$4, k as addFinalizer$1, ka as takeRight, ki as map$8, kn as provideMerge$1, ko as flatMap$6, kr as bind, kt as onInterrupt$1, la as has$2, li as deferredMake, ln as unlessEffect, lo as isNonEmptyReadonlyArray, lr as forEachConcurrentDiscard, ls as hash, lt as gen, ma as seconds, mi as exitFail, mn as withFiberRuntime$1, mo as matchLeft, mr as inheritAll$1, ms as isTagged, mt as isEffect, n as Date$, na as make$40, ni as deferredAwait, nn as tapErrorCause, no as flatMap$7, nr as map$11, ns as symbolRedactable, nt as flatMap$5, o as Number$, oa as set$2, oi as deferredInterrupt, on as try_, oo as headNonEmpty, or as currentMinimumLogLevel, os as symbol$2, ot as forkDaemon, p as compose, pa as isFinite$1, pi as exitAs, pn as when$2, po as match$6, pr as _await$2, ps as isObject, pt as intoDeferred, q as either$1, qa as contains, qi as fromIterable$3, qn as die$1, qo as match$2, qr as spanTag, qt as scopedWith$1, r as Defect, ra as none$4, ri as deferredComplete, rn as timeout, ro as fromIterable$1, rr as reduceWithContext, rs as toJSON, rt as flatten$5, s as NumberFromString, sa as add$2, si as deferredInterruptWith, sn as uninterruptible$1, so as isArray$1, sr as defaultLogger$1, ss as cached, st as forkIn, t as Cause, ta as ids$1, ti as currentTracerEnabled$1, tn as tapError, to as findLast, tr as isInterruptedOnly, ts as redact$1, tt as filterOrDieMessage, u as String$, ua as remove$5, ui as deferredSucceed, un as unsafeMakeLatch, uo as join$4, ur as scopeMake, us as string, ut as ignore, va as empty$14, vi as exitZipRight, vn as zipRight$3, vo as reduce$2, vr as die, vs as constUndefined, vt as makeSemaphore, w as encodeSync, wa as of$1, wi as flatMap$4, wn as tagged, wo as tailNonEmpty, wr as match$3, wt as matchCause, x as proto$19, xa as isChunk, xi as fiberRefGetWith, xo as sort$2, xr as isFailure, xs as identity, xt as mapError$3, y as make$37, ya as filter$2, yi as fiberId, yn as zipWith, yo as reduceRight, yr as fail$7, ys as constVoid, yt as map$9, z as catchIf, za as getOption, zi as whenEffect, zn as Scope, zo as none$3, zr as TypeId$22, zt as repeatN } from "./esm-7vSMGlFz.mjs";
3
+ import { _ as LinkNode, a as HeadingNode, b as CodeHighlightNode, d as ListItemNode, f as ListNode, g as AutoLinkNode, o as QuoteNode, x as CodeNode } from "./LexicalRichText.node-wNAi2Z4i.mjs";
4
+ import { a as HorizontalRuleNode } from "./LexicalExtension.node-3nsS5NjU.mjs";
5
+ import { hn as ElementNode, mn as DecoratorNode } from "./Lexical.node-B064E4Hy.mjs";
6
6
  import { createRequire } from "node:module";
7
7
  import * as Path from "node:path";
8
8
  import path, { basename, dirname, join } from "node:path";
@@ -3759,12 +3759,12 @@ const Module = /*#__PURE__*/ Literal("Clipboard", "Command", "FileSystem", "KeyV
3759
3759
  * @since 1.0.0
3760
3760
  * @category Models
3761
3761
  */
3762
- var BadArgument = class extends TaggedError("@effect/platform/Error/BadArgument")("BadArgument", {
3762
+ var BadArgument = class extends (/*#__PURE__*/ TaggedError("@effect/platform/Error/BadArgument")("BadArgument", {
3763
3763
  module: Module,
3764
3764
  method: String$,
3765
3765
  description: /*#__PURE__*/ optional$9(String$),
3766
3766
  cause: /*#__PURE__*/ optional$9(Defect)
3767
- }) {
3767
+ })) {
3768
3768
  /**
3769
3769
  * @since 1.0.0
3770
3770
  */
@@ -3785,7 +3785,7 @@ const SystemErrorReason = /*#__PURE__*/ Literal("AlreadyExists", "BadResource",
3785
3785
  * @since 1.0.0
3786
3786
  * @category models
3787
3787
  */
3788
- var SystemError = class extends TaggedError("@effect/platform/Error/SystemError")("SystemError", {
3788
+ var SystemError = class extends (/*#__PURE__*/ TaggedError("@effect/platform/Error/SystemError")("SystemError", {
3789
3789
  reason: SystemErrorReason,
3790
3790
  module: Module,
3791
3791
  method: String$,
@@ -3793,7 +3793,7 @@ var SystemError = class extends TaggedError("@effect/platform/Error/SystemError"
3793
3793
  syscall: /*#__PURE__*/ optional$9(String$),
3794
3794
  pathOrDescriptor: /*#__PURE__*/ optional$9(/*#__PURE__*/ Union(String$, Number$)),
3795
3795
  cause: /*#__PURE__*/ optional$9(Defect)
3796
- }) {
3796
+ })) {
3797
3797
  /**
3798
3798
  * @since 1.0.0
3799
3799
  */
@@ -3906,7 +3906,7 @@ const WatchEventRemove = /*#__PURE__*/ tagged("Remove");
3906
3906
  * @since 1.0.0
3907
3907
  * @category file watcher
3908
3908
  */
3909
- var WatchBackend = class extends Tag$3("@effect/platform/FileSystem/WatchBackend")() {};
3909
+ var WatchBackend = class extends (/*#__PURE__*/ Tag$3("@effect/platform/FileSystem/WatchBackend")()) {};
3910
3910
  //#endregion
3911
3911
  //#region ../../node_modules/.pnpm/@effect+typeclass@0.41.0_effect@3.22.1/node_modules/@effect/typeclass/dist/esm/internal/Iterable.js
3912
3912
  /** @internal */
@@ -6096,7 +6096,7 @@ const tag$1 = /*#__PURE__*/ GenericTag("@effect/platform/Terminal");
6096
6096
  * @since 1.0.0
6097
6097
  * @category model
6098
6098
  */
6099
- var QuitException = class extends TaggedError$1("QuitException") {};
6099
+ var QuitException = class extends (/*#__PURE__*/ TaggedError$1("QuitException")) {};
6100
6100
  /**
6101
6101
  * @since 1.0.0
6102
6102
  * @category refinements
@@ -10961,7 +10961,6 @@ const TypeId$11 = /*#__PURE__*/ Symbol.for("@effect/platform/Cookies");
10961
10961
  * @category type ids
10962
10962
  */
10963
10963
  const CookieTypeId = /*#__PURE__*/ Symbol.for("@effect/platform/Cookies/Cookie");
10964
- TypeIdError(/* @__PURE__ */ Symbol.for("@effect/platform/Cookies/CookieError"), "CookieError");
10965
10964
  const Proto$4 = {
10966
10965
  [TypeId$11]: TypeId$11,
10967
10966
  ...BaseProto,
@@ -11236,7 +11235,7 @@ const TypeId$9 = /* @__PURE__ */ Symbol.for("@effect/platform/HttpClientError");
11236
11235
  * @since 1.0.0
11237
11236
  * @category error
11238
11237
  */
11239
- var RequestError = class extends TypeIdError(TypeId$9, "RequestError") {
11238
+ var RequestError = class extends (/*#__PURE__*/ TypeIdError(TypeId$9, "RequestError")) {
11240
11239
  get methodAndUrl() {
11241
11240
  return `${this.request.method} ${this.request.url}`;
11242
11241
  }
@@ -11248,7 +11247,7 @@ var RequestError = class extends TypeIdError(TypeId$9, "RequestError") {
11248
11247
  * @since 1.0.0
11249
11248
  * @category error
11250
11249
  */
11251
- var ResponseError = class extends TypeIdError(TypeId$9, "ResponseError") {
11250
+ var ResponseError = class extends (/*#__PURE__*/ TypeIdError(TypeId$9, "ResponseError")) {
11252
11251
  get methodAndUrl() {
11253
11252
  return `${this.request.method} ${this.request.url}`;
11254
11253
  }
@@ -11339,7 +11338,7 @@ const TypeId$8 = /*#__PURE__*/ Symbol.for("@effect/platform/HttpIncomingMessage"
11339
11338
  * @since 1.0.0
11340
11339
  * @category fiber refs
11341
11340
  */
11342
- var MaxBodySize = class extends Reference()("@effect/platform/HttpIncomingMessage/MaxBodySize", { defaultValue: none$3 }) {};
11341
+ var MaxBodySize = class extends (/*#__PURE__*/ Reference()("@effect/platform/HttpIncomingMessage/MaxBodySize", { defaultValue: none$3 })) {};
11343
11342
  /**
11344
11343
  * @since 1.0.0
11345
11344
  */
@@ -12017,7 +12016,7 @@ const join$1 = (self) => _await(self.deferred);
12017
12016
  * @since 1.0.0
12018
12017
  * @category tags
12019
12018
  */
12020
- var Collector = class extends Tag$3("@effect/platform/Transferable/Collector")() {};
12019
+ var Collector = class extends (/*#__PURE__*/ Tag$3("@effect/platform/Transferable/Collector")()) {};
12021
12020
  /**
12022
12021
  * @since 1.0.0
12023
12022
  * @category constructors
@@ -12053,10 +12052,10 @@ const WorkerErrorTypeId = /* @__PURE__ */ Symbol.for("@effect/platform/WorkerErr
12053
12052
  * @since 1.0.0
12054
12053
  * @category errors
12055
12054
  */
12056
- var WorkerError = class extends TaggedError()("WorkerError", {
12055
+ var WorkerError = class extends (/*#__PURE__*/ TaggedError()("WorkerError", {
12057
12056
  reason: /*#__PURE__*/ Literal("spawn", "decode", "send", "unknown", "encode"),
12058
12057
  cause: Defect
12059
- }) {
12058
+ })) {
12060
12059
  /**
12061
12060
  * @since 1.0.0
12062
12061
  */
@@ -12877,7 +12876,7 @@ const fromAgent = (agent) => make$12((request, url, signal) => {
12877
12876
  headers: request.headers,
12878
12877
  signal
12879
12878
  });
12880
- return pipe(zipRight$3(sendBody(nodeRequest, request, request.body), waitForResponse(nodeRequest, request), { concurrent: true }), map$9((_) => new ClientResponseImpl$1(request, _)));
12879
+ return pipe(zipRight$3(sendBody(nodeRequest, request, request.body), waitForResponse(nodeRequest, request), { concurrent: true }), map$9((_) => new ClientResponseImpl(request, _)));
12881
12880
  });
12882
12881
  const sendBody = (nodeRequest, request, body) => suspend$6(() => {
12883
12882
  switch (body._tag) {
@@ -12953,7 +12952,7 @@ const waitForFinish = (nodeRequest, request) => async((resume) => {
12953
12952
  nodeRequest.off("finish", onFinish);
12954
12953
  });
12955
12954
  });
12956
- var ClientResponseImpl$1 = class extends HttpIncomingMessageImpl {
12955
+ var ClientResponseImpl = class extends HttpIncomingMessageImpl {
12957
12956
  request;
12958
12957
  [TypeId$1];
12959
12958
  constructor(request, source) {
@@ -12995,20 +12994,13 @@ var ClientResponseImpl$1 = class extends HttpIncomingMessageImpl {
12995
12994
  });
12996
12995
  }
12997
12996
  };
12998
- /** @internal */
12999
- const layer$8 = /*#__PURE__*/ provide(/* @__PURE__ */ layerMergedContext(/* @__PURE__ */ map$9(HttpAgent, fromAgent)), agentLayer);
13000
- //#endregion
13001
- //#region ../../node_modules/.pnpm/@effect+platform-node@0.108.1_@effect+cluster@0.60.2_@effect+platform@0.97.1_effect@3.2_cbaf2d87b25498626ad7aed57ec0563d/node_modules/@effect/platform-node/dist/esm/internal/httpClientUndici.js
13002
- /** @internal */
13003
- const undiciOptionsTagKey = "@effect/platform-node/NodeHttpClient/undiciOptions";
13004
12997
  //#endregion
13005
12998
  //#region ../../node_modules/.pnpm/@effect+platform-node@0.108.1_@effect+cluster@0.60.2_@effect+platform@0.97.1_effect@3.2_cbaf2d87b25498626ad7aed57ec0563d/node_modules/@effect/platform-node/dist/esm/NodeHttpClient.js
13006
12999
  /**
13007
13000
  * @since 1.0.0
13008
13001
  * @category layers
13009
13002
  */
13010
- const layer$7 = layer$8;
13011
- Tag$3(undiciOptionsTagKey)();
13003
+ const layer$7 = /* @__PURE__ */ provide(/* @__PURE__ */ layerMergedContext(/* @__PURE__ */ map$9(HttpAgent, fromAgent)), agentLayer);
13012
13004
  //#endregion
13013
13005
  //#region ../../node_modules/.pnpm/@effect+platform@0.97.1_effect@3.22.1/node_modules/@effect/platform/dist/esm/internal/commandExecutor.js
13014
13006
  /** @internal */
@@ -14567,7 +14559,7 @@ function parseBody(res) {
14567
14559
  function decodeWithSchema(schema, body) {
14568
14560
  return tryPromise({
14569
14561
  try: async () => {
14570
- const { Schema: SchemaMod } = await import("./esm-CNZ7kdTg.mjs");
14562
+ const { Schema: SchemaMod } = await import("./esm-ZrfYH2y2.mjs");
14571
14563
  return SchemaMod.decodeUnknownPromise(schema)(body);
14572
14564
  },
14573
14565
  catch: (err) => new ServerError({
@@ -16266,7 +16258,7 @@ function customAlphabet(alphabet, defaultSize = 21) {
16266
16258
  }
16267
16259
  customAlphabet(urlAlphabet);
16268
16260
  //#endregion
16269
- //#region ../../node_modules/.pnpm/@haklex+rich-litexml@0.36.0_typescript@6.0.3/node_modules/@haklex/rich-litexml/dist/src-DKDBBSml.js
16261
+ //#region ../../node_modules/.pnpm/@haklex+rich-litexml@0.39.1_typescript@6.0.3/node_modules/@haklex/rich-litexml/dist/src-h5Q0X5zw.js
16270
16262
  var impl = null;
16271
16263
  function registerParseHTML(fn) {
16272
16264
  impl = fn;
@@ -16510,6 +16502,17 @@ function registerCustomReaders(registry) {
16510
16502
  height: numAttr(el, "height"),
16511
16503
  version: 1
16512
16504
  }));
16505
+ registry.registerReader("attachment", (el) => ({
16506
+ type: "file",
16507
+ ...extractBlockId(el),
16508
+ src: el.getAttribute("src") ?? "",
16509
+ name: el.getAttribute("name") ?? "",
16510
+ size: numAttr(el, "size"),
16511
+ mimeType: el.getAttribute("mime-type") ?? void 0,
16512
+ ext: el.getAttribute("ext") ?? void 0,
16513
+ display: el.getAttribute("display") === "inline" ? "inline" : "block",
16514
+ version: 1
16515
+ }));
16513
16516
  registry.registerReader("link-card", (el) => ({
16514
16517
  type: "link-card",
16515
16518
  ...extractBlockId(el),
@@ -16990,6 +16993,22 @@ function registerCustomWriters(registry) {
16990
16993
  selfClosing: true
16991
16994
  };
16992
16995
  });
16996
+ registry.registerWriter("file", (node) => {
16997
+ const n = node;
16998
+ return {
16999
+ tag: "attachment",
17000
+ attrs: optAttr({
17001
+ ...blockId(n),
17002
+ "src": n.src,
17003
+ "name": n.name,
17004
+ "size": n.size != null ? String(n.size) : void 0,
17005
+ "mime-type": n.mimeType,
17006
+ "ext": n.ext,
17007
+ "display": n.display === "inline" ? "inline" : void 0
17008
+ }),
17009
+ selfClosing: true
17010
+ };
17011
+ });
16993
17012
  registry.registerWriter("link-card", (node) => {
16994
17013
  const n = node;
16995
17014
  return {
@@ -17491,8 +17510,10 @@ function createReaderContext(registry) {
17491
17510
  else if (child.nodeType === 1) {
17492
17511
  flushText();
17493
17512
  const parsed = parseElement(child, registry, ctx, 0);
17494
- if (parsed) if (Array.isArray(parsed)) nodes.push(...parsed);
17495
- else nodes.push(parsed);
17513
+ if (parsed) {
17514
+ if (Array.isArray(parsed)) nodes.push(...parsed);
17515
+ else nodes.push(parsed);
17516
+ }
17496
17517
  }
17497
17518
  flushText();
17498
17519
  return nodes;
@@ -17530,8 +17551,10 @@ function parseInlineChildren(element, registry, ctx, format) {
17530
17551
  else if (child.nodeType === 1) {
17531
17552
  flushText();
17532
17553
  const parsed = parseElement(child, registry, ctx, format);
17533
- if (parsed) if (Array.isArray(parsed)) nodes.push(...parsed);
17534
- else nodes.push(parsed);
17554
+ if (parsed) {
17555
+ if (Array.isArray(parsed)) nodes.push(...parsed);
17556
+ else nodes.push(parsed);
17557
+ }
17535
17558
  }
17536
17559
  flushText();
17537
17560
  return nodes;
@@ -28078,8 +28101,8 @@ var require_CSSStyleDeclaration = /* @__PURE__ */ __commonJSMin(((exports) => {
28078
28101
  return properties.join(" ");
28079
28102
  },
28080
28103
  set cssText(text) {
28081
- var i, name;
28082
- for (i = this.length; i--;) {
28104
+ var i = this.length, name;
28105
+ for (; i--;) {
28083
28106
  name = this[i];
28084
28107
  this[name] = "";
28085
28108
  }
@@ -29837,7 +29860,7 @@ function Document() {
29837
29860
  }
29838
29861
  setPrototypeOf(Document, Document$1).prototype = Document$1.prototype;
29839
29862
  //#endregion
29840
- //#region ../../node_modules/.pnpm/@haklex+rich-litexml@0.36.0_typescript@6.0.3/node_modules/@haklex/rich-litexml/dist/node.mjs
29863
+ //#region ../../node_modules/.pnpm/@haklex+rich-litexml@0.39.1_typescript@6.0.3/node_modules/@haklex/rich-litexml/dist/node.mjs
29841
29864
  registerParseHTML((html) => parseHTML(html).document);
29842
29865
  //#endregion
29843
29866
  //#region ../editor/src/core/litexml.ts
@@ -29881,7 +29904,7 @@ function stripMxLitexmlDocWrapper(xml) {
29881
29904
  * LICENSE file in the root directory of this source tree.
29882
29905
  *
29883
29906
  */
29884
- const mod$2 = await (process.env.NODE_ENV !== "production" ? import("./LexicalTable.dev-D-sFhO-o.mjs") : import("./LexicalTable.prod-DwYaa_dN.mjs"));
29907
+ const mod$2 = await (process.env.NODE_ENV !== "production" ? import("./LexicalTable.dev-DN3ezVey.mjs") : import("./LexicalTable.prod-B0MioVyq.mjs"));
29885
29908
  mod$2.$computeTableCellRectBoundary;
29886
29909
  mod$2.$computeTableMap;
29887
29910
  mod$2.$computeTableMapSkipCellCheck;
@@ -29958,7 +29981,7 @@ mod$2.setScrollableTablesActive;
29958
29981
  * LICENSE file in the root directory of this source tree.
29959
29982
  *
29960
29983
  */
29961
- const mod$1 = await (process.env.NODE_ENV !== "production" ? import("./LexicalMarkdown.dev-DJLKbZtD.mjs") : import("./LexicalMarkdown.prod-Cp21kDCU.mjs"));
29984
+ const mod$1 = await (process.env.NODE_ENV !== "production" ? import("./LexicalMarkdown.dev-S2yWckH9.mjs") : import("./LexicalMarkdown.prod-TRkMWfmC.mjs"));
29962
29985
  mod$1.$convertFromMarkdownString;
29963
29986
  mod$1.$convertSelectionToMarkdownString;
29964
29987
  const $convertToMarkdownString = mod$1.$convertToMarkdownString;
@@ -29987,7 +30010,7 @@ mod$1.UNORDERED_LIST;
29987
30010
  mod$1.isTableRowDivider;
29988
30011
  mod$1.registerMarkdownShortcuts;
29989
30012
  //#endregion
29990
- //#region ../../node_modules/.pnpm/@haklex+rich-headless@0.36.0_lexical@0.49.0_typescript@6.0.3__typescript@6.0.3/node_modules/@haklex/rich-headless/dist/transformers.mjs
30013
+ //#region ../../node_modules/.pnpm/@haklex+rich-headless@0.39.1_lexical@0.49.0_typescript@6.0.3__typescript@6.0.3/node_modules/@haklex/rich-headless/dist/transformers.mjs
29991
30014
  /**
29992
30015
  * Headless Markdown transformers — export-only (Lexical → Markdown).
29993
30016
  * Import stubs are no-ops; used only for $convertToMarkdownString.
@@ -30414,7 +30437,7 @@ function $toMarkdown() {
30414
30437
  return $convertToMarkdownString(allHeadlessTransformers);
30415
30438
  }
30416
30439
  //#endregion
30417
- //#region ../../node_modules/.pnpm/@haklex+rich-headless@0.36.0_lexical@0.49.0_typescript@6.0.3__typescript@6.0.3/node_modules/@haklex/rich-headless/dist/index.mjs
30440
+ //#region ../../node_modules/.pnpm/@haklex+rich-headless@0.39.1_lexical@0.49.0_typescript@6.0.3__typescript@6.0.3/node_modules/@haklex/rich-headless/dist/index.mjs
30418
30441
  var INTRINSIC_TYPES = [
30419
30442
  "root",
30420
30443
  "paragraph",
@@ -30733,6 +30756,21 @@ var VideoNode = headlessDecorator("video", [
30733
30756
  width: void 0,
30734
30757
  height: void 0
30735
30758
  });
30759
+ var FileNode = headlessDecorator("file", [
30760
+ "src",
30761
+ "name",
30762
+ "size",
30763
+ "mimeType",
30764
+ "ext",
30765
+ "display"
30766
+ ], {
30767
+ src: "",
30768
+ name: "",
30769
+ size: void 0,
30770
+ mimeType: void 0,
30771
+ ext: void 0,
30772
+ display: "block"
30773
+ });
30736
30774
  var LinkCardNode = headlessDecorator("link-card", [
30737
30775
  "url",
30738
30776
  "source",
@@ -30829,6 +30867,7 @@ var customHeadlessNodes = [
30829
30867
  RichQuoteNode,
30830
30868
  ImageNode,
30831
30869
  VideoNode,
30870
+ FileNode,
30832
30871
  LinkCardNode,
30833
30872
  KaTeXInlineNode,
30834
30873
  KaTeXBlockNode,
@@ -31033,7 +31072,7 @@ var customHeadlessNodes = [
31033
31072
  ChatNode
31034
31073
  ];
31035
31074
  var allHeadlessNodes = [...builtinNodes, ...customHeadlessNodes];
31036
- const createHeadlessEditor = (await (process.env.NODE_ENV !== "production" ? import("./LexicalHeadless.dev-BeUbKBes.mjs") : import("./LexicalHeadless.prod-4gbIA8HM.mjs"))).createHeadlessEditor;
31075
+ const createHeadlessEditor = (await (process.env.NODE_ENV !== "production" ? import("./LexicalHeadless.dev-DdWJsPoH.mjs") : import("./LexicalHeadless.prod-CH74ZDMt.mjs"))).createHeadlessEditor;
31037
31076
  //#endregion
31038
31077
  //#region ../editor/src/core/nodes/litexml.ts
31039
31078
  const XML_ESCAPE_MAP = {
@@ -31637,7 +31676,7 @@ const criticalProperties = [
31637
31676
  "prototype"
31638
31677
  ];
31639
31678
  //#endregion
31640
- //#region ../../node_modules/.pnpm/fast-xml-parser@5.11.0/node_modules/fast-xml-parser/src/validator.js
31679
+ //#region ../../node_modules/.pnpm/fast-xml-parser@5.11.1/node_modules/fast-xml-parser/src/validator.js
31641
31680
  const defaultOptions$2 = {
31642
31681
  allowBooleanAttributes: false,
31643
31682
  unpairedTags: []
@@ -31809,11 +31848,86 @@ function readAttributeStr(xmlData, i) {
31809
31848
  };
31810
31849
  }
31811
31850
  /**
31812
- * Select all the attributes whether valid or invalid.
31851
+ * Walk `attrStr` once, left to right, splitting it into attribute tokens.
31852
+ *
31853
+ * This replaces a regex that used to do the same job
31854
+ * (`(\s*)([^\s=]+)(\s*=)?(\s*(['"])(([\s\S])*?)\5)?`). That regex led with an
31855
+ * optional whitespace group followed by a required "non-whitespace" group.
31856
+ * On a long run of whitespace that never resolves into an attribute name
31857
+ * (e.g. a tag with thousands of trailing spaces before `>`), the engine
31858
+ * backtracks the whitespace group one character at a time before giving up
31859
+ * and moving to the next starting position — one full backtrack per
31860
+ * position, which is quadratic in the length of the run.
31861
+ *
31862
+ * A single forward-only scan can never backtrack, so it can't be made slow
31863
+ * this way no matter how much whitespace the input contains — it's always
31864
+ * proportional to the length of the string, once.
31865
+ *
31866
+ * Each returned token mirrors the shape the old regex match array had, so
31867
+ * the validation logic below (which reads token[1]..token[6]) didn't need
31868
+ * to change:
31869
+ * token.startIndex - where this token begins in attrStr
31870
+ * token[1] - leading whitespace before the name
31871
+ * token[2] - the attribute name
31872
+ * token[3] - whitespace + '=' if present, else undefined
31873
+ * token[4] - marker (any defined value) if a quoted value was found
31874
+ * token[5] - the quote character used ('"' or "'")
31875
+ * token[6] - the value's text, without the surrounding quotes
31876
+ *
31877
+ * A malformed leading character (e.g. a stray '=' with no name before it)
31878
+ * is simply skipped over, one character at a time — the same outcome the
31879
+ * old regex produced by failing to match at that position and retrying at
31880
+ * the next one.
31813
31881
  */
31814
- const validAttrStrRegxp = /* @__PURE__ */ new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?", "g");
31882
+ function scanAttributeTokens(attrStr) {
31883
+ const tokens = [];
31884
+ const len = attrStr.length;
31885
+ let i = 0;
31886
+ while (i < len) {
31887
+ const tokenStart = i;
31888
+ while (i < len && isWhiteSpace(attrStr[i])) i++;
31889
+ if (i >= len) break;
31890
+ if (attrStr[i] === "=") {
31891
+ i = tokenStart + 1;
31892
+ continue;
31893
+ }
31894
+ const leadingWs = attrStr.slice(tokenStart, i);
31895
+ const nameStart = i;
31896
+ while (i < len && !isWhiteSpace(attrStr[i]) && attrStr[i] !== "=") i++;
31897
+ const name = attrStr.slice(nameStart, i);
31898
+ let equalsGroup;
31899
+ let j = i;
31900
+ while (j < len && isWhiteSpace(attrStr[j])) j++;
31901
+ if (j < len && attrStr[j] === "=") {
31902
+ equalsGroup = attrStr.slice(i, j + 1);
31903
+ i = j + 1;
31904
+ }
31905
+ let quoteChar;
31906
+ let value;
31907
+ let k = i;
31908
+ while (k < len && isWhiteSpace(attrStr[k])) k++;
31909
+ if (k < len && (attrStr[k] === "\"" || attrStr[k] === "'")) {
31910
+ const valueStart = k + 1;
31911
+ const closeIdx = attrStr.indexOf(attrStr[k], valueStart);
31912
+ if (closeIdx !== -1) {
31913
+ quoteChar = attrStr[k];
31914
+ value = attrStr.slice(valueStart, closeIdx);
31915
+ i = closeIdx + 1;
31916
+ }
31917
+ }
31918
+ const token = { startIndex: tokenStart };
31919
+ token[1] = leadingWs;
31920
+ token[2] = name;
31921
+ token[3] = equalsGroup;
31922
+ token[4] = quoteChar !== void 0 ? true : void 0;
31923
+ token[5] = quoteChar;
31924
+ token[6] = value;
31925
+ tokens.push(token);
31926
+ }
31927
+ return tokens;
31928
+ }
31815
31929
  function validateAttributeString(attrStr, options) {
31816
- const matches = getAllMatches(attrStr, validAttrStrRegxp);
31930
+ const matches = scanAttributeTokens(attrStr);
31817
31931
  const attrNames = {};
31818
31932
  for (let i = 0; i < matches.length; i++) {
31819
31933
  if (matches[i][1].length === 0) return getErrorObject("InvalidAttr", "Attribute '" + matches[i][2] + "' has no space in starting.", getPositionFromMatch(matches[i]));
@@ -32395,7 +32509,7 @@ var EntityDecoder = class {
32395
32509
  }
32396
32510
  };
32397
32511
  //#endregion
32398
- //#region ../../node_modules/.pnpm/fast-xml-parser@5.11.0/node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js
32512
+ //#region ../../node_modules/.pnpm/fast-xml-parser@5.11.1/node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js
32399
32513
  const defaultOnDangerousProperty = (name) => {
32400
32514
  if (DANGEROUS_PROPERTY_NAMES.includes(name)) return "__" + name;
32401
32515
  return name;
@@ -32522,7 +32636,7 @@ const buildOptions = function(options) {
32522
32636
  return built;
32523
32637
  };
32524
32638
  //#endregion
32525
- //#region ../../node_modules/.pnpm/fast-xml-parser@5.11.0/node_modules/fast-xml-parser/src/xmlparser/xmlNode.js
32639
+ //#region ../../node_modules/.pnpm/fast-xml-parser@5.11.1/node_modules/fast-xml-parser/src/xmlparser/xmlNode.js
32526
32640
  let METADATA_SYMBOL$1;
32527
32641
  if (typeof Symbol !== "function") METADATA_SYMBOL$1 = "@@xmlMetadata";
32528
32642
  else METADATA_SYMBOL$1 = Symbol("XML Node Metadata");
@@ -32599,7 +32713,7 @@ const getRegexes = (xmlVersion = "1.0", asciiOnly = false) => {
32599
32713
  */
32600
32714
  const qName = (str, { xmlVersion = "1.0", asciiOnly = false } = {}) => getRegexes(xmlVersion, asciiOnly).qName.test(str);
32601
32715
  //#endregion
32602
- //#region ../../node_modules/.pnpm/fast-xml-parser@5.11.0/node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js
32716
+ //#region ../../node_modules/.pnpm/fast-xml-parser@5.11.1/node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js
32603
32717
  var DocTypeReader = class {
32604
32718
  constructor(options, xmlVersion) {
32605
32719
  this.suppressValidationErr = !options;
@@ -33137,7 +33251,7 @@ function handleInfinity(str, num, options) {
33137
33251
  }
33138
33252
  }
33139
33253
  //#endregion
33140
- //#region ../../node_modules/.pnpm/fast-xml-parser@5.11.0/node_modules/fast-xml-parser/src/ignoreAttributes.js
33254
+ //#region ../../node_modules/.pnpm/fast-xml-parser@5.11.1/node_modules/fast-xml-parser/src/ignoreAttributes.js
33141
33255
  function getIgnoreAttributesFn(ignoreAttributes) {
33142
33256
  if (typeof ignoreAttributes === "function") return ignoreAttributes;
33143
33257
  if (Array.isArray(ignoreAttributes)) return (attrName) => {
@@ -34822,7 +34936,7 @@ function isUnsafe(value, context) {
34822
34936
  return false;
34823
34937
  }
34824
34938
  //#endregion
34825
- //#region ../../node_modules/.pnpm/fast-xml-parser@5.11.0/node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js
34939
+ //#region ../../node_modules/.pnpm/fast-xml-parser@5.11.1/node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js
34826
34940
  /**
34827
34941
  * Extract raw attributes (without prefix) from prefixed attribute map
34828
34942
  * @param {object} prefixedAttrs - Attributes with prefix from buildAttributesMap
@@ -35346,7 +35460,7 @@ function sanitizeName(name, options) {
35346
35460
  return name;
35347
35461
  }
35348
35462
  //#endregion
35349
- //#region ../../node_modules/.pnpm/fast-xml-parser@5.11.0/node_modules/fast-xml-parser/src/xmlparser/node2json.js
35463
+ //#region ../../node_modules/.pnpm/fast-xml-parser@5.11.1/node_modules/fast-xml-parser/src/xmlparser/node2json.js
35350
35464
  const METADATA_SYMBOL = XmlNode.getMetaDataSymbol();
35351
35465
  /**
35352
35466
  * Helper function to strip attribute prefix from attribute map
@@ -35449,7 +35563,7 @@ function isLeafTag(obj, options) {
35449
35563
  return false;
35450
35564
  }
35451
35565
  //#endregion
35452
- //#region ../../node_modules/.pnpm/fast-xml-parser@5.11.0/node_modules/fast-xml-parser/src/xmlparser/XMLParser.js
35566
+ //#region ../../node_modules/.pnpm/fast-xml-parser@5.11.1/node_modules/fast-xml-parser/src/xmlparser/XMLParser.js
35453
35567
  var XMLParser = class {
35454
35568
  constructor(options) {
35455
35569
  this.externalEntities = {};
@@ -37871,7 +37985,7 @@ const convertWslPathToWindows = async (paths) => {
37871
37985
  return isBatch ? results : results[0];
37872
37986
  };
37873
37987
  //#endregion
37874
- //#region ../../node_modules/.pnpm/powershell-utils@0.2.0/node_modules/powershell-utils/index.js
37988
+ //#region ../../node_modules/.pnpm/powershell-utils@0.2.1/node_modules/powershell-utils/index.js
37875
37989
  const execFile$1 = promisify(childProcess.execFile);
37876
37990
  const powerShellPath = () => `${process$1.env.SYSTEMROOT || process$1.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;
37877
37991
  const argumentsPrefix = [
@@ -37882,14 +37996,16 @@ const argumentsPrefix = [
37882
37996
  "-EncodedCommand"
37883
37997
  ];
37884
37998
  const encodeCommand = (command) => Buffer$1.from(command, "utf16le").toString("base64");
37885
- const escapeArgument = (value) => `'${String(value).replaceAll("'", "''")}'`;
37999
+ const escapeArgument = (value) => `'${String(value).replaceAll(/['‘’‚‛]/g, (match) => match + match)}'`;
37886
38000
  const createArguments = (command) => [...argumentsPrefix, encodeCommand(command)];
38001
+ const createExecFileOptions = (options) => ({
38002
+ encoding: "utf8",
38003
+ ...options,
38004
+ shell: false
38005
+ });
37887
38006
  const executePowerShell = async (command, options = {}) => {
37888
38007
  const { powerShellPath: psPath, ...execFileOptions } = options;
37889
- return execFile$1(psPath ?? powerShellPath(), createArguments(command), {
37890
- encoding: "utf8",
37891
- ...execFileOptions
37892
- });
38008
+ return execFile$1(psPath ?? powerShellPath(), createArguments(command), createExecFileOptions(execFileOptions));
37893
38009
  };
37894
38010
  executePowerShell.argumentsPrefix = argumentsPrefix;
37895
38011
  executePowerShell.encodeCommand = encodeCommand;
@@ -37952,7 +38068,7 @@ async function bundleName(bundleId) {
37952
38068
  return runAppleScript(`tell application "Finder" to set app_path to application file id "${bundleId}" as string\ntell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`);
37953
38069
  }
37954
38070
  //#endregion
37955
- //#region ../../node_modules/.pnpm/default-browser@5.5.0/node_modules/default-browser/windows.js
38071
+ //#region ../../node_modules/.pnpm/default-browser@5.5.1/node_modules/default-browser/windows.js
37956
38072
  const execFileAsync$1 = promisify(execFile);
37957
38073
  const windowsBrowserProgIds = {
37958
38074
  MSEdgeHTM: {
@@ -38023,7 +38139,7 @@ const windowsBrowserProgIds = {
38023
38139
  const _windowsBrowserProgIdMap = new Map(Object.entries(windowsBrowserProgIds));
38024
38140
  var UnknownBrowserError = class extends Error {};
38025
38141
  async function defaultBrowser$1(_execFileAsync = execFileAsync$1) {
38026
- const { stdout } = await _execFileAsync("reg", [
38142
+ const { stdout } = await _execFileAsync(`${process$1.env.SYSTEMROOT ?? process$1.env.windir ?? "C:\\Windows"}\\System32\\reg.exe`, [
38027
38143
  "QUERY",
38028
38144
  " HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice",
38029
38145
  "/v",
@@ -38042,7 +38158,7 @@ async function defaultBrowser$1(_execFileAsync = execFileAsync$1) {
38042
38158
  };
38043
38159
  }
38044
38160
  //#endregion
38045
- //#region ../../node_modules/.pnpm/default-browser@5.5.0/node_modules/default-browser/index.js
38161
+ //#region ../../node_modules/.pnpm/default-browser@5.5.1/node_modules/default-browser/index.js
38046
38162
  const execFileAsync = promisify(execFile);
38047
38163
  const titleize = (string) => string.toLowerCase().replaceAll(/(?:^|\s|-)\S/g, (x) => x.toUpperCase());
38048
38164
  async function defaultBrowser() {
@@ -38072,7 +38188,7 @@ async function defaultBrowser() {
38072
38188
  //#region ../../node_modules/.pnpm/is-in-ssh@1.0.0/node_modules/is-in-ssh/index.js
38073
38189
  const isInSsh = Boolean(process$1.env.SSH_CONNECTION || process$1.env.SSH_CLIENT || process$1.env.SSH_TTY);
38074
38190
  //#endregion
38075
- //#region ../../node_modules/.pnpm/open@11.0.1/node_modules/open/index.js
38191
+ //#region ../../node_modules/.pnpm/open@11.0.2/node_modules/open/index.js
38076
38192
  const fallbackAttemptSymbol = Symbol("fallbackAttempt");
38077
38193
  const __dirname = import.meta.url ? path.dirname(fileURLToPath(import.meta.url)) : "";
38078
38194
  const localXdgOpenPath = path.join(__dirname, "xdg-open");
@@ -38136,8 +38252,9 @@ const baseOpen = async (options) => {
38136
38252
  const progId = await wslDefaultBrowser();
38137
38253
  browser = _windowsBrowserProgIdMap.get(progId) ?? {};
38138
38254
  } else browser = await defaultBrowser();
38139
- if (browser.id in ids) {
38255
+ if (Object.hasOwn(ids, browser.id)) {
38140
38256
  const browserName = ids[browser.id.toLowerCase()];
38257
+ if (browserName === void 0) throw new Error(`${browser.name} is not supported as a default browser`);
38141
38258
  if (app === "browserPrivate") {
38142
38259
  if (browserName === "safari") throw new Error("Safari doesn't support opening in private mode via command line");
38143
38260
  appArguments.push(flags[browserName]);
@@ -40224,12 +40341,12 @@ const extractId$1 = (res) => {
40224
40341
  };
40225
40342
  //#endregion
40226
40343
  //#region src/cli/draft/_shared.ts
40227
- /** Draft-native fields; everything else rides along in `typeSpecificData`. */
40228
- const DRAFT_CORE_KEYS$1 = /* @__PURE__ */ new Set([
40344
+ const DRAFT_CORE_KEYS = /* @__PURE__ */ new Set([
40229
40345
  "title",
40230
40346
  "text",
40231
40347
  "content",
40232
40348
  "contentFormat",
40349
+ "images",
40233
40350
  "meta"
40234
40351
  ]);
40235
40352
  const REF_TYPE_TO_RESOURCE = {
@@ -40240,50 +40357,17 @@ const REF_TYPE_TO_RESOURCE = {
40240
40357
  const splitDraftBody = (payload) => {
40241
40358
  const draftBody = {};
40242
40359
  const typeSpecificData = {};
40243
- for (const [key, value] of Object.entries(payload)) if (DRAFT_CORE_KEYS$1.has(key)) draftBody[key] = value;
40360
+ for (const [key, value] of Object.entries(payload)) if (DRAFT_CORE_KEYS.has(key)) draftBody[key] = value;
40244
40361
  else typeSpecificData[key] = value;
40245
40362
  if (Object.keys(typeSpecificData).length > 0) draftBody.typeSpecificData = typeSpecificData;
40246
40363
  return draftBody;
40247
40364
  };
40248
- const parseTypeSpecificData$1 = (raw) => {
40249
- if (!raw) return {};
40250
- if (typeof raw === "object") return raw;
40251
- try {
40252
- const parsed = JSON.parse(raw);
40253
- return typeof parsed === "object" && parsed !== null ? parsed : {};
40254
- } catch {
40255
- return {};
40256
- }
40257
- };
40258
- /**
40259
- * The response interceptor snake_cases keys at every depth, but the request
40260
- * pipe only camelizes the body's top level — nested subtrees (like `meta`)
40261
- * must be restored before being sent back, or `skillIds` round-trips into a
40262
- * stored `skill_ids`. Best-effort inverse: keys that legitimately contained
40263
- * underscores were already mangled by the response side.
40264
- */
40365
+ /** The server serializes response keys to snake_case; normalize back. */
40265
40366
  const camelizeDeep = (value) => {
40266
40367
  if (Array.isArray(value)) return value.map(camelizeDeep);
40267
40368
  if (value && typeof value === "object") return Object.fromEntries(Object.entries(value).map(([k, v]) => [k.replaceAll(/_([\da-z])/g, (_, c) => c.toUpperCase()), camelizeDeep(v)]));
40268
40369
  return value;
40269
40370
  };
40270
- /** The server serializes response keys to snake_case; normalize back. */
40271
- const normalizeDraftRow = (row) => {
40272
- if (!row || typeof row !== "object") return {};
40273
- const r = row;
40274
- const pick = (camel, snake) => r[camel] ?? r[snake];
40275
- return {
40276
- id: pick("id", "id"),
40277
- refType: pick("refType", "ref_type"),
40278
- refId: pick("refId", "ref_id"),
40279
- title: pick("title", "title"),
40280
- text: pick("text", "text"),
40281
- content: pick("content", "content"),
40282
- contentFormat: pick("contentFormat", "content_format"),
40283
- meta: pick("meta", "meta"),
40284
- typeSpecificData: pick("typeSpecificData", "type_specific_data")
40285
- };
40286
- };
40287
40371
  /** Single-object responses may arrive wrapped in an outer `data` envelope. */
40288
40372
  const unwrapData = (res) => {
40289
40373
  if (res && typeof res === "object" && "data" in res) {
@@ -40292,6 +40376,63 @@ const unwrapData = (res) => {
40292
40376
  }
40293
40377
  return res;
40294
40378
  };
40379
+ const normalizeData = (value) => camelizeDeep(unwrapData(value));
40380
+ const normalizeDraftRow = (row) => {
40381
+ const normalized = normalizeData(row);
40382
+ if (!normalized || typeof normalized !== "object") return null;
40383
+ const branch = normalized;
40384
+ return branch.id && branch.document && branch.headRevision ? branch : null;
40385
+ };
40386
+ const normalizeVersionContext = (value) => normalizeData(value);
40387
+ const mergeRevisionPatch = (base, patch) => ({
40388
+ ...base,
40389
+ ...patch,
40390
+ typeSpecificData: {
40391
+ ...base.typeSpecificData,
40392
+ ...patch.typeSpecificData
40393
+ }
40394
+ });
40395
+ const saveDraftPayload = (api, refType, payload, refId) => gen(function* () {
40396
+ const patch = splitDraftBody(payload);
40397
+ if (!refId) {
40398
+ const response = yield* api.request("/drafts", {
40399
+ method: "POST",
40400
+ body: {
40401
+ data: patch,
40402
+ refType
40403
+ }
40404
+ });
40405
+ return {
40406
+ draft: normalizeDraftRow(response),
40407
+ response
40408
+ };
40409
+ }
40410
+ const context = normalizeVersionContext(yield* api.request(`/drafts/context/${refType}/${encodeURIComponent(refId)}`));
40411
+ if (!context.publishedRevision) return yield* fail$8(new Generic({ message: `published revision not found for ${refType} ${refId}` }));
40412
+ const response = yield* api.request("/drafts", {
40413
+ method: "POST",
40414
+ body: {
40415
+ baseRevisionId: context.publishedRevision.id,
40416
+ data: mergeRevisionPatch(context.publishedRevision, patch),
40417
+ refId,
40418
+ refType
40419
+ }
40420
+ });
40421
+ return {
40422
+ draft: normalizeDraftRow(response),
40423
+ response
40424
+ };
40425
+ });
40426
+ const publishSavedDraft = (api, draft) => api.request("/publish-jobs", {
40427
+ method: "POST",
40428
+ body: {
40429
+ aiResources: [],
40430
+ branchId: draft.id,
40431
+ confirmDiverged: draft.relationToPublished === "descendant" || draft.relationToPublished === "diverged",
40432
+ expectedPublishedRevisionId: draft.document.publishedRevisionId,
40433
+ revisionId: draft.headRevisionId
40434
+ }
40435
+ });
40295
40436
  //#endregion
40296
40437
  //#region src/cli/draft/create.ts
40297
40438
  const create$6 = make$16("create", postWriteOptions, (opts) => gen(function* () {
@@ -40306,8 +40447,8 @@ const create$6 = make$16("create", postWriteOptions, (opts) => gen(function* ()
40306
40447
  const res = yield* api.request("/drafts", {
40307
40448
  method: "POST",
40308
40449
  body: {
40309
- refType: "post",
40310
- ...body
40450
+ data: body,
40451
+ refType: "post"
40311
40452
  }
40312
40453
  });
40313
40454
  const id = extractId$1(res);
@@ -40369,38 +40510,14 @@ const publish$2 = make$16("publish", {
40369
40510
  }, ({ id, open, silent }) => gen(function* () {
40370
40511
  const api = yield* Api;
40371
40512
  const renderer = yield* Renderer;
40372
- const draft = normalizeDraftRow(unwrapData(yield* api.request(`/drafts/${encodeURIComponent(id)}`)));
40373
- if (!draft?.id || !draft.refType) return yield* fail$8(new Generic({ message: `draft not found: ${id}` }));
40374
- const resource = REF_TYPE_TO_RESOURCE[draft.refType];
40375
- if (!resource) return yield* fail$8(new Generic({ message: `unsupported draft refType: ${draft.refType}` }));
40376
- const body = { ...parseTypeSpecificData$1(draft.typeSpecificData) };
40377
- if (draft.title !== void 0) body.title = draft.title;
40378
- if (draft.text !== void 0) body.text = draft.text;
40379
- if (draft.content !== void 0 && draft.content !== null) body.content = draft.content;
40380
- if (draft.contentFormat !== void 0) body.contentFormat = draft.contentFormat;
40381
- if (draft.meta !== void 0 && draft.meta !== null) body.meta = camelizeDeep(draft.meta);
40382
- body.draftId = draft.id;
40383
- let res;
40384
- if (draft.refId) {
40385
- if (draft.refType !== "page") body.isPublished = true;
40386
- res = yield* api.request(`/${resource}/${draft.refId}`, {
40387
- method: "PATCH",
40388
- body
40389
- });
40390
- } else {
40391
- if (draft.refType !== "page") body.isPublished = true;
40392
- res = yield* api.request(`/${resource}`, {
40393
- method: "POST",
40394
- body
40395
- });
40396
- }
40397
- const publishedId = extractId$1(res) ?? draft.refId;
40398
- yield* renderer.emitSuccess(silent ? {
40399
- ok: true,
40400
- id: publishedId
40401
- } : res);
40402
- if (open && publishedId && draft.refType !== "page") yield* openAdminEdit(resource, publishedId);
40403
- })).pipe(withDescription("publish a draft: creates the post/note/page (or applies to the linked one) and marks it live"));
40513
+ const draft = normalizeDraftRow(yield* api.request(`/drafts/${encodeURIComponent(id)}`));
40514
+ if (!draft) return yield* fail$8(new Generic({ message: `draft not found: ${id}` }));
40515
+ const resource = REF_TYPE_TO_RESOURCE[draft.document.refType];
40516
+ if (!resource) return yield* fail$8(new Generic({ message: `unsupported draft refType: ${draft.document.refType}` }));
40517
+ const res = yield* publishSavedDraft(api, draft);
40518
+ yield* renderer.emitSuccess(silent ? { ok: true } : res);
40519
+ if (open) yield* openAdminDraftEdit(resource, draft.id, draft.document.refId ?? void 0);
40520
+ })).pipe(withDescription("publish the current head revision of one draft branch"));
40404
40521
  const update$6 = make$16("update", {
40405
40522
  id: text$6({ name: "id" }),
40406
40523
  ...postWriteOptions
@@ -40413,15 +40530,27 @@ const update$6 = make$16("update", {
40413
40530
  const body = splitDraftBody(payload);
40414
40531
  const api = yield* Api;
40415
40532
  const renderer = yield* Renderer;
40533
+ const current = normalizeDraftRow(yield* api.request(`/drafts/${encodeURIComponent(id)}`));
40534
+ if (!current) return yield* fail$8(new ValidationFailed({ message: `draft not found: ${id}` }));
40416
40535
  const res = yield* api.request(`/drafts/${encodeURIComponent(id)}`, {
40417
40536
  method: "PUT",
40418
- body
40537
+ body: {
40538
+ data: {
40539
+ ...current.headRevision,
40540
+ ...body,
40541
+ typeSpecificData: {
40542
+ ...current.headRevision.typeSpecificData,
40543
+ ...body.typeSpecificData
40544
+ }
40545
+ },
40546
+ expectedHeadRevisionId: current.headRevisionId
40547
+ }
40419
40548
  });
40420
40549
  yield* renderer.emitSuccess(rest.silent ? {
40421
40550
  ok: true,
40422
40551
  id
40423
40552
  } : res);
40424
- })).pipe(withDescription("update a draft (bumps its version and records history on content change)"));
40553
+ })).pipe(withDescription("append a revision to one draft branch"));
40425
40554
  //#endregion
40426
40555
  //#region src/cli/draft/index.ts
40427
40556
  const help$9 = registerCommandHelp({
@@ -40672,19 +40801,16 @@ const resolveTopicRefs = (payload) => gen(function* () {
40672
40801
  const create$5 = make$16("create", noteWriteOptions, (opts) => gen(function* () {
40673
40802
  const flags = toNoteFlagInputs(opts);
40674
40803
  const built = yield* buildNotePayload(flags);
40675
- const payload = yield* resolveTopicRefs(built.payload);
40804
+ const payload = yield* resolveTopicRefs({ ...built.payload });
40805
+ const shouldPublish = payload.isPublished === true;
40806
+ delete payload.isPublished;
40676
40807
  const api = yield* Api;
40677
40808
  const renderer = yield* Renderer;
40678
- const res = yield* api.request("/notes", {
40679
- method: "POST",
40680
- body: payload
40681
- });
40682
- yield* renderer.emitSuccess(opts.silent ? { ok: true } : res);
40683
- if (opts.open) {
40684
- const id = extractId$1(res);
40685
- if (id) yield* openAdminEdit("notes", id);
40686
- }
40687
- })).pipe(withDescription("create a note"));
40809
+ const saved = yield* saveDraftPayload(api, "note", payload);
40810
+ const response = shouldPublish ? yield* publishSavedDraft(api, saved.draft) : saved.response;
40811
+ yield* renderer.emitSuccess(opts.silent ? { ok: true } : response);
40812
+ if (opts.open && saved.draft.id) yield* openAdminDraftEdit("notes", saved.draft.id);
40813
+ })).pipe(withDescription("create a note draft; pass --state publish to start first publication"));
40688
40814
  const del$5 = make$16("delete", {
40689
40815
  slugOrId: text$6({ name: "slugOrId" }),
40690
40816
  force: boolean("force").pipe(withDescription$3("skip confirmation"))
@@ -40706,7 +40832,7 @@ const materializeForEditor$2 = (slugOrId) => gen(function* () {
40706
40832
  const resolver = yield* Resolver;
40707
40833
  const lexical = yield* Lexical;
40708
40834
  const id = yield* resolver.resolveNoteId(slugOrId);
40709
- const note = yield* api.request(`/notes/${id}`, { query: { prefer: "lexical" } });
40835
+ const note = normalizeData(yield* api.request(`/notes/${id}`, { query: { prefer: "lexical" } }));
40710
40836
  let inner;
40711
40837
  if (note.contentFormat === "lexical" && note.content) {
40712
40838
  const state = JSON.parse(note.content);
@@ -40749,7 +40875,8 @@ const edit$4 = make$16("edit", {
40749
40875
  const api = yield* Api;
40750
40876
  const editor = yield* Editor;
40751
40877
  const renderer = yield* Renderer;
40752
- const resolver = yield* Resolver;
40878
+ const id = yield* (yield* Resolver).resolveNoteId(slugOrId);
40879
+ const current = normalizeData(yield* api.request(`/notes/${id}`));
40753
40880
  if (!flags.file && flags.content === void 0) {
40754
40881
  const xml = yield* materializeForEditor$2(slugOrId);
40755
40882
  const next = yield* editor.openEditor({
@@ -40774,22 +40901,22 @@ const edit$4 = make$16("edit", {
40774
40901
  });
40775
40902
  const payload = applyNoteEnvelopeMeta(built.payload, parsed.meta);
40776
40903
  const resolved = yield* resolveTopicRefs(payload);
40777
- const id = yield* resolver.resolveNoteId(slugOrId);
40778
- const res = yield* api.request(`/notes/${id}`, {
40779
- method: "PUT",
40780
- body: resolved
40781
- });
40782
- yield* renderer.emitSuccess(res);
40904
+ const shouldPublish = typeof resolved.isPublished === "boolean" ? resolved.isPublished : current.isPublished !== false;
40905
+ delete resolved.isPublished;
40906
+ const saved = yield* saveDraftPayload(api, "note", resolved, id);
40907
+ const response = shouldPublish ? yield* publishSavedDraft(api, saved.draft) : saved.response;
40908
+ yield* renderer.emitSuccess(response);
40909
+ if (rest.open && saved.draft.id) yield* openAdminDraftEdit("notes", saved.draft.id, id);
40783
40910
  return;
40784
40911
  }
40785
40912
  const built = yield* buildNotePayload(flags);
40786
40913
  const resolved = yield* resolveTopicRefs(built.payload);
40787
- const id = yield* resolver.resolveNoteId(slugOrId);
40788
- const res = yield* api.request(`/notes/${id}`, {
40789
- method: "PUT",
40790
- body: resolved
40791
- });
40792
- yield* renderer.emitSuccess(res);
40914
+ const shouldPublish = typeof resolved.isPublished === "boolean" ? resolved.isPublished : current.isPublished !== false;
40915
+ delete resolved.isPublished;
40916
+ const saved = yield* saveDraftPayload(api, "note", resolved, id);
40917
+ const response = shouldPublish ? yield* publishSavedDraft(api, saved.draft) : saved.response;
40918
+ yield* renderer.emitSuccess(response);
40919
+ if (rest.open && saved.draft.id) yield* openAdminDraftEdit("notes", saved.draft.id, id);
40793
40920
  })).pipe(withDescription("edit a note via $EDITOR or flags"));
40794
40921
  //#endregion
40795
40922
  //#region src/cli/note/view.ts
@@ -40998,18 +41125,17 @@ const update$5 = make$16("update", {
40998
41125
  delete payload.text;
40999
41126
  delete payload.contentFormat;
41000
41127
  }
41001
- if (flags.state === void 0) delete payload.isPublished;
41128
+ delete payload.isPublished;
41002
41129
  const resolved = yield* resolveTopicRefs(payload);
41003
41130
  const id = yield* (yield* Resolver).resolveNoteId(slugOrId);
41004
41131
  const api = yield* Api;
41005
41132
  const renderer = yield* Renderer;
41006
- const res = yield* api.request(`/notes/${id}`, {
41007
- method: "PATCH",
41008
- body: resolved
41009
- });
41010
- yield* renderer.emitSuccess(rest.silent ? { ok: true } : res);
41011
- if (rest.open) yield* openAdminEdit("notes", id);
41012
- })).pipe(withDescription("partially update a note"));
41133
+ const current = flags.state === void 0 ? normalizeData(yield* api.request(`/notes/${id}`)) : null;
41134
+ const saved = yield* saveDraftPayload(api, "note", resolved, id);
41135
+ const response = flags.state === "publish" || current?.isPublished ? yield* publishSavedDraft(api, saved.draft) : saved.response;
41136
+ yield* renderer.emitSuccess(rest.silent ? { ok: true } : response);
41137
+ if (rest.open && saved.draft.id) yield* openAdminDraftEdit("notes", saved.draft.id, id);
41138
+ })).pipe(withDescription("save changes through the note draft; published notes create an online update job"));
41013
41139
  //#endregion
41014
41140
  //#region src/cli/note/index.ts
41015
41141
  const help$7 = registerCommandHelp({
@@ -41114,16 +41240,10 @@ const create$4 = make$16("create", pageWriteOptions, (opts) => gen(function* ()
41114
41240
  const built = yield* buildPagePayload(flags);
41115
41241
  const api = yield* Api;
41116
41242
  const renderer = yield* Renderer;
41117
- const res = yield* api.request("/pages", {
41118
- method: "POST",
41119
- body: built.payload
41120
- });
41121
- yield* renderer.emitSuccess(opts.silent ? { ok: true } : res);
41122
- if (opts.open) {
41123
- const id = extractId$1(res);
41124
- if (id) yield* openAdminEdit("pages", id);
41125
- }
41126
- }));
41243
+ const saved = yield* saveDraftPayload(api, "page", built.payload);
41244
+ yield* renderer.emitSuccess(opts.silent ? { ok: true } : saved.response);
41245
+ if (opts.open && saved.draft.id) yield* openAdminDraftEdit("pages", saved.draft.id);
41246
+ })).pipe(withDescription("create a page draft"));
41127
41247
  //#endregion
41128
41248
  //#region src/cli/page/delete.ts
41129
41249
  const slugOrId$14 = text$6({ name: "slugOrId" });
@@ -41169,7 +41289,7 @@ const materializeForEditor$1 = (ref) => gen(function* () {
41169
41289
  const api = yield* Api;
41170
41290
  const lexical = yield* Lexical;
41171
41291
  const path = isSnowflakeId(ref) ? `/pages/${ref}` : `/pages/slug/${encodeURIComponent(ref)}`;
41172
- const page = yield* api.request(path, { query: { prefer: "lexical" } });
41292
+ const page = normalizeData(yield* api.request(path, { query: { prefer: "lexical" } }));
41173
41293
  const isLexical = page.contentFormat === "lexical";
41174
41294
  let innerXml;
41175
41295
  if (isLexical && page.content) {
@@ -41204,6 +41324,7 @@ const edit$3 = make$16("edit", {
41204
41324
  const api = yield* Api;
41205
41325
  const editor = yield* Editor;
41206
41326
  const renderer = yield* Renderer;
41327
+ const id = yield* resolvePageId$1(api, slugOrId);
41207
41328
  if (!flags.file && flags.content === void 0) {
41208
41329
  const xml = yield* materializeForEditor$1(slugOrId);
41209
41330
  const next = yield* editor.openEditor({
@@ -41227,21 +41348,17 @@ const edit$3 = make$16("edit", {
41227
41348
  format: flags.format ?? "lexical"
41228
41349
  });
41229
41350
  const payload = overlayPageMeta(built.payload, parsed.meta);
41230
- const id = yield* resolvePageId$1(api, slugOrId);
41231
- const res = yield* api.request(`/pages/${id}`, {
41232
- method: "PUT",
41233
- body: payload
41234
- });
41235
- yield* renderer.emitSuccess(res);
41351
+ const saved = yield* saveDraftPayload(api, "page", payload, id);
41352
+ const response = yield* publishSavedDraft(api, saved.draft);
41353
+ yield* renderer.emitSuccess(response);
41354
+ if (rest.open && saved.draft.id) yield* openAdminDraftEdit("pages", saved.draft.id, id);
41236
41355
  return;
41237
41356
  }
41238
41357
  const built = yield* buildPagePayload(flags);
41239
- const id = yield* resolvePageId$1(api, slugOrId);
41240
- const res = yield* api.request(`/pages/${id}`, {
41241
- method: "PUT",
41242
- body: built.payload
41243
- });
41244
- yield* renderer.emitSuccess(res);
41358
+ const saved = yield* saveDraftPayload(api, "page", built.payload, id);
41359
+ const response = yield* publishSavedDraft(api, saved.draft);
41360
+ yield* renderer.emitSuccess(response);
41361
+ if (rest.open && saved.draft.id) yield* openAdminDraftEdit("pages", saved.draft.id, id);
41245
41362
  }));
41246
41363
  //#endregion
41247
41364
  //#region src/cli/page/view.ts
@@ -41357,13 +41474,11 @@ const update$4 = make$16("update", {
41357
41474
  const api = yield* Api;
41358
41475
  const renderer = yield* Renderer;
41359
41476
  const id = yield* resolvePageId(api, slugOrId);
41360
- const res = yield* api.request(`/pages/${id}`, {
41361
- method: "PATCH",
41362
- body
41363
- });
41364
- yield* renderer.emitSuccess(rest.silent ? { ok: true } : res);
41365
- if (rest.open) yield* openAdminEdit("pages", id);
41366
- }));
41477
+ const saved = yield* saveDraftPayload(api, "page", body, id);
41478
+ const response = yield* publishSavedDraft(api, saved.draft);
41479
+ yield* renderer.emitSuccess(rest.silent ? { ok: true } : response);
41480
+ if (rest.open && saved.draft.id) yield* openAdminDraftEdit("pages", saved.draft.id, id);
41481
+ })).pipe(withDescription("save changes through the page draft and create an online update job"));
41367
41482
  //#endregion
41368
41483
  //#region src/cli/page/index.ts
41369
41484
  const help$6 = registerCommandHelp({
@@ -41422,67 +41537,38 @@ const pageCmd = make$16("page").pipe(withDescription(help$6.description), withSu
41422
41537
  update$4,
41423
41538
  del$4
41424
41539
  ]));
41425
- //#endregion
41426
- //#region src/cli/post/apply.ts
41427
- const slugOrId$10 = text$6({ name: "slugOrId" });
41428
- const parseTypeSpecificData = (raw) => {
41429
- if (!raw) return {};
41430
- if (typeof raw === "object" && !Array.isArray(raw)) return raw;
41431
- if (typeof raw !== "string") return {};
41432
- try {
41433
- const parsed = JSON.parse(raw);
41434
- return typeof parsed === "object" && parsed !== null && !Array.isArray(parsed) ? parsed : {};
41435
- } catch {
41436
- return {};
41437
- }
41438
- };
41439
- const apply = make$16("apply", { slugOrId: slugOrId$10 }, ({ slugOrId }) => gen(function* () {
41540
+ const apply = make$16("apply", { slugOrId: text$6({ name: "slugOrId" }) }, ({ slugOrId }) => gen(function* () {
41440
41541
  const resolver = yield* Resolver;
41441
41542
  const api = yield* Api;
41442
41543
  const renderer = yield* Renderer;
41443
41544
  const id = yield* resolver.resolvePostId(slugOrId);
41444
- const draft = asRecord(unwrapDocument(yield* api.request(`/drafts/by-ref/post/${id}`)));
41445
- const draftId = first(draft, "id");
41446
- if (typeof draftId !== "string" || !draftId) return yield* fail$8(new Generic({
41545
+ const branches = normalizeVersionContext(yield* api.request(`/drafts/context/post/${id}`)).branches.filter((branch) => branch.status === "active" && branch.relationToPublished !== "same");
41546
+ if (branches.length === 0) return yield* fail$8(new Generic({
41447
41547
  message: `no staged changes for post ${slugOrId}`,
41448
41548
  hint: "stage changes first with `mxs post stage <slugOrId> --file <article.xml>`"
41449
41549
  }));
41450
- const body = { ...parseTypeSpecificData(first(draft, "type_specific_data", "typeSpecificData")) };
41451
- const title = first(draft, "title");
41452
- const text = first(draft, "text");
41453
- const content = first(draft, "content");
41454
- const contentFormat = first(draft, "content_format", "contentFormat");
41455
- const meta = first(draft, "meta");
41456
- if (title !== void 0) body.title = title;
41457
- if (text !== void 0) body.text = text;
41458
- if (content !== void 0) body.content = content;
41459
- if (contentFormat !== void 0) body.contentFormat = contentFormat;
41460
- if (meta !== void 0) body.meta = camelizeDeep(meta);
41461
- body.draftId = draftId;
41462
- const res = yield* api.request(`/posts/${id}`, {
41463
- method: "PATCH",
41464
- body
41465
- });
41550
+ if (branches.length > 1) return yield* fail$8(new Generic({
41551
+ message: `post ${slugOrId} has ${branches.length} draft branches`,
41552
+ hint: "publish the intended branch explicitly with `mxs draft publish <branchId>`"
41553
+ }));
41554
+ const res = yield* publishSavedDraft(api, branches[0]);
41466
41555
  yield* renderer.emitSuccess(res);
41467
- })).pipe(withDescription("apply the staged draft of a post to the live post (the confirm step after `post stage`)"));
41556
+ })).pipe(withDescription("publish the exact staged post draft through the server publish job"));
41468
41557
  //#endregion
41469
41558
  //#region src/cli/post/create.ts
41470
41559
  const create$3 = make$16("create", postWriteOptions, (opts) => gen(function* () {
41471
41560
  const flags = toPostFlagInputs(opts);
41472
41561
  const built = yield* buildPostPayload(flags);
41473
- const payload = yield* resolveCategoryRefs(built.payload);
41562
+ const payload = yield* resolveCategoryRefs({ ...built.payload });
41563
+ const shouldPublish = payload.isPublished === true;
41564
+ delete payload.isPublished;
41474
41565
  const api = yield* Api;
41475
41566
  const renderer = yield* Renderer;
41476
- const res = yield* api.request("/posts", {
41477
- method: "POST",
41478
- body: payload
41479
- });
41480
- yield* renderer.emitSuccess(opts.silent ? { ok: true } : res);
41481
- if (opts.open) {
41482
- const id = extractId$1(res);
41483
- if (id) yield* openAdminEdit("posts", id);
41484
- }
41485
- })).pipe(withDescription("create a post"));
41567
+ const saved = yield* saveDraftPayload(api, "post", payload);
41568
+ const response = shouldPublish ? yield* publishSavedDraft(api, saved.draft) : saved.response;
41569
+ yield* renderer.emitSuccess(opts.silent ? { ok: true } : response);
41570
+ if (opts.open && saved.draft.id) yield* openAdminDraftEdit("posts", saved.draft.id);
41571
+ })).pipe(withDescription("create a post draft; pass --state publish to start first publication"));
41486
41572
  const del$3 = make$16("delete", {
41487
41573
  slugOrId: text$6({ name: "slugOrId" }),
41488
41574
  force: boolean("force").pipe(withDescription$3("skip confirmation"))
@@ -41504,7 +41590,7 @@ const materializeForEditor = (slugOrId) => gen(function* () {
41504
41590
  const resolver = yield* Resolver;
41505
41591
  const lexical = yield* Lexical;
41506
41592
  const path = yield* resolver.resolvePostReadPath(slugOrId);
41507
- const post = yield* api.request(path, { query: { prefer: "lexical" } });
41593
+ const post = normalizeData(yield* api.request(path, { query: { prefer: "lexical" } }));
41508
41594
  const isLexical = post.contentFormat === "lexical";
41509
41595
  let innerXml;
41510
41596
  if (isLexical && post.content) {
@@ -41536,6 +41622,16 @@ const metaFromEnvelope = (meta) => {
41536
41622
  if (m.tags !== void 0) overlay.tags = m.tags;
41537
41623
  return overlay;
41538
41624
  };
41625
+ const submitPostPayload = (api, id, payload, publishedFallback) => gen(function* () {
41626
+ const shouldPublish = typeof payload.isPublished === "boolean" ? payload.isPublished : publishedFallback;
41627
+ const draftPayload = { ...payload };
41628
+ delete draftPayload.isPublished;
41629
+ const saved = yield* saveDraftPayload(api, "post", draftPayload, id);
41630
+ return {
41631
+ ...saved,
41632
+ response: shouldPublish ? yield* publishSavedDraft(api, saved.draft) : saved.response
41633
+ };
41634
+ });
41539
41635
  const edit$2 = make$16("edit", {
41540
41636
  slugOrId: slugOrId$8,
41541
41637
  ...postWriteOptions
@@ -41544,7 +41640,8 @@ const edit$2 = make$16("edit", {
41544
41640
  const api = yield* Api;
41545
41641
  const editor = yield* Editor;
41546
41642
  const renderer = yield* Renderer;
41547
- const resolver = yield* Resolver;
41643
+ const id = yield* (yield* Resolver).resolvePostId(slugOrId);
41644
+ const current = normalizeData(yield* api.request(`/posts/${id}`));
41548
41645
  if (!flags.file && flags.content === void 0) {
41549
41646
  const xml = yield* materializeForEditor(slugOrId);
41550
41647
  const next = yield* editor.openEditor({
@@ -41571,24 +41668,16 @@ const edit$2 = make$16("edit", {
41571
41668
  ...metaFromEnvelope(parsed.meta)
41572
41669
  };
41573
41670
  const resolved = yield* resolveCategoryRefs(payload);
41574
- const id = yield* resolver.resolvePostId(slugOrId);
41575
- const res = yield* api.request(`/posts/${id}`, {
41576
- method: "PUT",
41577
- body: resolved
41578
- });
41579
- yield* renderer.emitSuccess(rest.silent ? { ok: true } : res);
41580
- if (rest.open) yield* openAdminEdit("posts", id);
41671
+ const saved = yield* submitPostPayload(api, id, resolved, current.isPublished !== false);
41672
+ yield* renderer.emitSuccess(rest.silent ? { ok: true } : saved.response);
41673
+ if (rest.open && saved.draft.id) yield* openAdminDraftEdit("posts", saved.draft.id, id);
41581
41674
  return;
41582
41675
  }
41583
41676
  const built = yield* buildPostPayload(flags);
41584
41677
  const resolved = yield* resolveCategoryRefs(built.payload);
41585
- const id = yield* resolver.resolvePostId(slugOrId);
41586
- const res = yield* api.request(`/posts/${id}`, {
41587
- method: "PUT",
41588
- body: resolved
41589
- });
41590
- yield* renderer.emitSuccess(rest.silent ? { ok: true } : res);
41591
- if (rest.open) yield* openAdminEdit("posts", id);
41678
+ const saved = yield* submitPostPayload(api, id, resolved, current.isPublished !== false);
41679
+ yield* renderer.emitSuccess(rest.silent ? { ok: true } : saved.response);
41680
+ if (rest.open && saved.draft.id) yield* openAdminDraftEdit("posts", saved.draft.id, id);
41592
41681
  })).pipe(withDescription("edit a post via $EDITOR or flags"));
41593
41682
  //#endregion
41594
41683
  //#region src/cli/post/view.ts
@@ -41748,25 +41837,14 @@ const publish = make$16("publish", { slugOrId: text$6({ name: "slugOrId" }) }, (
41748
41837
  const api = yield* Api;
41749
41838
  const renderer = yield* Renderer;
41750
41839
  const id = yield* resolver.resolvePostId(slugOrId);
41751
- const res = yield* api.request(`/posts/${id}`, {
41840
+ const res = yield* api.request(`/posts/${id}/publish`, {
41752
41841
  method: "PATCH",
41753
41842
  body: { isPublished: true }
41754
41843
  });
41755
41844
  yield* renderer.emitSuccess(res);
41756
41845
  })).pipe(withDescription("publish a post"));
41757
- //#endregion
41758
- //#region src/cli/post/stage.ts
41759
- const slugOrId$5 = text$6({ name: "slugOrId" });
41760
- /** Draft-native fields; everything else rides along in `typeSpecificData`. */
41761
- const DRAFT_CORE_KEYS = /* @__PURE__ */ new Set([
41762
- "title",
41763
- "text",
41764
- "content",
41765
- "contentFormat",
41766
- "meta"
41767
- ]);
41768
41846
  const stage = make$16("stage", {
41769
- slugOrId: slugOrId$5,
41847
+ slugOrId: text$6({ name: "slugOrId" }),
41770
41848
  ...postWriteOptions
41771
41849
  }, ({ slugOrId, ...rest }) => gen(function* () {
41772
41850
  const flags = toPostFlagInputs(rest);
@@ -41774,30 +41852,18 @@ const stage = make$16("stage", {
41774
41852
  const payload = yield* resolveCategoryRefs({ ...built.payload });
41775
41853
  delete payload.isPublished;
41776
41854
  if (Object.keys(payload).filter((k) => k !== "contentFormat").length === 0) return yield* fail$8(new ValidationFailed({ message: "nothing to stage: provide --file or content/meta flags" }));
41777
- const draftBody = {};
41778
- const typeSpecificData = {};
41779
- for (const [key, value] of Object.entries(payload)) if (DRAFT_CORE_KEYS.has(key)) draftBody[key] = value;
41780
- else typeSpecificData[key] = value;
41781
- if (Object.keys(typeSpecificData).length > 0) draftBody.typeSpecificData = typeSpecificData;
41782
41855
  const id = yield* (yield* Resolver).resolvePostId(slugOrId);
41783
41856
  const api = yield* Api;
41784
41857
  const renderer = yield* Renderer;
41785
- const res = yield* api.request(`/drafts`, {
41786
- method: "POST",
41787
- body: {
41788
- refType: "post",
41789
- refId: id,
41790
- ...draftBody
41791
- }
41792
- });
41793
- yield* renderer.emitSuccess(rest.silent ? { ok: true } : res);
41858
+ const { response } = yield* saveDraftPayload(api, "post", payload, id);
41859
+ yield* renderer.emitSuccess(rest.silent ? { ok: true } : response);
41794
41860
  })).pipe(withDescription("stage changes as a draft attached to a published post (the live post is untouched until `post apply`)"));
41795
41861
  const unpublish = make$16("unpublish", { slugOrId: text$6({ name: "slugOrId" }) }, ({ slugOrId }) => gen(function* () {
41796
41862
  const resolver = yield* Resolver;
41797
41863
  const api = yield* Api;
41798
41864
  const renderer = yield* Renderer;
41799
41865
  const id = yield* resolver.resolvePostId(slugOrId);
41800
- const res = yield* api.request(`/posts/${id}`, {
41866
+ const res = yield* api.request(`/posts/${id}/publish`, {
41801
41867
  method: "PATCH",
41802
41868
  body: { isPublished: false }
41803
41869
  });
@@ -41814,18 +41880,17 @@ const update$3 = make$16("update", {
41814
41880
  delete payload.text;
41815
41881
  delete payload.contentFormat;
41816
41882
  }
41817
- if (flags.state === void 0) delete payload.isPublished;
41883
+ delete payload.isPublished;
41818
41884
  const resolved = yield* resolveCategoryRefs(payload);
41819
41885
  const id = yield* (yield* Resolver).resolvePostId(slugOrId);
41820
41886
  const api = yield* Api;
41821
41887
  const renderer = yield* Renderer;
41822
- const res = yield* api.request(`/posts/${id}`, {
41823
- method: "PATCH",
41824
- body: resolved
41825
- });
41826
- yield* renderer.emitSuccess(rest.silent ? { ok: true } : res);
41827
- if (rest.open) yield* openAdminEdit("posts", id);
41828
- })).pipe(withDescription("partially update a post"));
41888
+ const current = flags.state === void 0 ? normalizeData(yield* api.request(`/posts/${id}`)) : null;
41889
+ const saved = yield* saveDraftPayload(api, "post", resolved, id);
41890
+ const response = flags.state === "publish" || current?.isPublished ? yield* publishSavedDraft(api, saved.draft) : saved.response;
41891
+ yield* renderer.emitSuccess(rest.silent ? { ok: true } : response);
41892
+ if (rest.open && saved.draft.id) yield* openAdminDraftEdit("posts", saved.draft.id, id);
41893
+ })).pipe(withDescription("save changes through the post draft; published posts create an online update job"));
41829
41894
  //#endregion
41830
41895
  //#region src/cli/post/index.ts
41831
41896
  const help$5 = registerCommandHelp({