@derive-to/artifacts 0.0.0-stage → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1091) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +198 -2
  3. package/dist/host/bridge.d.ts +38 -0
  4. package/dist/host/bridge.d.ts.map +1 -0
  5. package/dist/host/bridge.js +86 -0
  6. package/dist/host/bridge.js.map +1 -0
  7. package/dist/host/client.d.ts +152 -0
  8. package/dist/host/client.d.ts.map +1 -0
  9. package/dist/host/client.js +186 -0
  10. package/dist/host/client.js.map +1 -0
  11. package/dist/host/emitter.d.ts +7 -0
  12. package/dist/host/emitter.d.ts.map +1 -0
  13. package/dist/host/emitter.js +18 -0
  14. package/dist/host/emitter.js.map +1 -0
  15. package/dist/host/index.d.ts +7 -0
  16. package/dist/host/index.d.ts.map +1 -0
  17. package/dist/host/index.js +5 -0
  18. package/dist/host/index.js.map +1 -0
  19. package/dist/host/live.d.ts +18 -0
  20. package/dist/host/live.d.ts.map +1 -0
  21. package/dist/host/live.js +32 -0
  22. package/dist/host/live.js.map +1 -0
  23. package/dist/host/print.d.ts +3 -0
  24. package/dist/host/print.d.ts.map +1 -0
  25. package/dist/host/print.js +57 -0
  26. package/dist/host/print.js.map +1 -0
  27. package/dist/host/sse.d.ts +11 -0
  28. package/dist/host/sse.d.ts.map +1 -0
  29. package/dist/host/sse.js +57 -0
  30. package/dist/host/sse.js.map +1 -0
  31. package/dist/host/view.d.ts +60 -0
  32. package/dist/host/view.d.ts.map +1 -0
  33. package/dist/host/view.js +218 -0
  34. package/dist/host/view.js.map +1 -0
  35. package/dist/protocol/access.d.ts +39 -0
  36. package/dist/protocol/access.d.ts.map +1 -0
  37. package/dist/protocol/access.js +30 -0
  38. package/dist/protocol/access.js.map +1 -0
  39. package/dist/protocol/anchors.d.ts +61 -0
  40. package/dist/protocol/anchors.d.ts.map +1 -0
  41. package/dist/protocol/anchors.js +41 -0
  42. package/dist/protocol/anchors.js.map +1 -0
  43. package/dist/protocol/collection.d.ts +33 -0
  44. package/dist/protocol/collection.d.ts.map +1 -0
  45. package/dist/protocol/collection.js +168 -0
  46. package/dist/protocol/collection.js.map +1 -0
  47. package/dist/protocol/define.d.ts +9 -0
  48. package/dist/protocol/define.d.ts.map +1 -0
  49. package/dist/protocol/define.js +2 -0
  50. package/dist/protocol/define.js.map +1 -0
  51. package/dist/protocol/errors.d.ts +55 -0
  52. package/dist/protocol/errors.d.ts.map +1 -0
  53. package/dist/protocol/errors.js +54 -0
  54. package/dist/protocol/errors.js.map +1 -0
  55. package/dist/protocol/extension.d.ts +44 -0
  56. package/dist/protocol/extension.d.ts.map +1 -0
  57. package/dist/protocol/extension.js +37 -0
  58. package/dist/protocol/extension.js.map +1 -0
  59. package/dist/protocol/http.d.ts +195 -0
  60. package/dist/protocol/http.d.ts.map +1 -0
  61. package/dist/protocol/http.js +72 -0
  62. package/dist/protocol/http.js.map +1 -0
  63. package/dist/protocol/index.d.ts +19 -0
  64. package/dist/protocol/index.d.ts.map +1 -0
  65. package/dist/protocol/index.js +19 -0
  66. package/dist/protocol/index.js.map +1 -0
  67. package/dist/protocol/inputs.d.ts +62 -0
  68. package/dist/protocol/inputs.d.ts.map +1 -0
  69. package/dist/protocol/inputs.js +51 -0
  70. package/dist/protocol/inputs.js.map +1 -0
  71. package/dist/protocol/layout.d.ts +33 -0
  72. package/dist/protocol/layout.d.ts.map +1 -0
  73. package/dist/protocol/layout.js +45 -0
  74. package/dist/protocol/layout.js.map +1 -0
  75. package/dist/protocol/mentions.d.ts +16 -0
  76. package/dist/protocol/mentions.d.ts.map +1 -0
  77. package/dist/protocol/mentions.js +35 -0
  78. package/dist/protocol/mentions.js.map +1 -0
  79. package/dist/protocol/methods.d.ts +146 -0
  80. package/dist/protocol/methods.d.ts.map +1 -0
  81. package/dist/protocol/methods.js +57 -0
  82. package/dist/protocol/methods.js.map +1 -0
  83. package/dist/protocol/presentation.d.ts +9 -0
  84. package/dist/protocol/presentation.d.ts.map +1 -0
  85. package/dist/protocol/presentation.js +7 -0
  86. package/dist/protocol/presentation.js.map +1 -0
  87. package/dist/protocol/quote-match.d.ts +20 -0
  88. package/dist/protocol/quote-match.d.ts.map +1 -0
  89. package/dist/protocol/quote-match.js +33 -0
  90. package/dist/protocol/quote-match.js.map +1 -0
  91. package/dist/protocol/sharing.d.ts +133 -0
  92. package/dist/protocol/sharing.d.ts.map +1 -0
  93. package/dist/protocol/sharing.js +67 -0
  94. package/dist/protocol/sharing.js.map +1 -0
  95. package/dist/protocol/slot-map.d.ts +4 -0
  96. package/dist/protocol/slot-map.d.ts.map +1 -0
  97. package/dist/protocol/slot-map.js +10 -0
  98. package/dist/protocol/slot-map.js.map +1 -0
  99. package/dist/protocol/source-anchors.d.ts +101 -0
  100. package/dist/protocol/source-anchors.d.ts.map +1 -0
  101. package/dist/protocol/source-anchors.js +250 -0
  102. package/dist/protocol/source-anchors.js.map +1 -0
  103. package/dist/protocol/source-assets.d.ts +15 -0
  104. package/dist/protocol/source-assets.d.ts.map +1 -0
  105. package/dist/protocol/source-assets.js +66 -0
  106. package/dist/protocol/source-assets.js.map +1 -0
  107. package/dist/protocol/source-cache.d.ts +23 -0
  108. package/dist/protocol/source-cache.d.ts.map +1 -0
  109. package/dist/protocol/source-cache.js +52 -0
  110. package/dist/protocol/source-cache.js.map +1 -0
  111. package/dist/protocol/source-copy-dom.d.ts +11 -0
  112. package/dist/protocol/source-copy-dom.d.ts.map +1 -0
  113. package/dist/protocol/source-copy-dom.js +103 -0
  114. package/dist/protocol/source-copy-dom.js.map +1 -0
  115. package/dist/protocol/source-copy-identities.d.ts +19 -0
  116. package/dist/protocol/source-copy-identities.d.ts.map +1 -0
  117. package/dist/protocol/source-copy-identities.js +119 -0
  118. package/dist/protocol/source-copy-identities.js.map +1 -0
  119. package/dist/protocol/source-deck-elements.d.ts +30 -0
  120. package/dist/protocol/source-deck-elements.d.ts.map +1 -0
  121. package/dist/protocol/source-deck-elements.js +67 -0
  122. package/dist/protocol/source-deck-elements.js.map +1 -0
  123. package/dist/protocol/source-deck-ops.d.ts +18 -0
  124. package/dist/protocol/source-deck-ops.d.ts.map +1 -0
  125. package/dist/protocol/source-deck-ops.js +154 -0
  126. package/dist/protocol/source-deck-ops.js.map +1 -0
  127. package/dist/protocol/source-deck.d.ts +20 -0
  128. package/dist/protocol/source-deck.d.ts.map +1 -0
  129. package/dist/protocol/source-deck.js +103 -0
  130. package/dist/protocol/source-deck.js.map +1 -0
  131. package/dist/protocol/source-edits.d.ts +21 -0
  132. package/dist/protocol/source-edits.d.ts.map +1 -0
  133. package/dist/protocol/source-edits.js +126 -0
  134. package/dist/protocol/source-edits.js.map +1 -0
  135. package/dist/protocol/source-element-edits.d.ts +24 -0
  136. package/dist/protocol/source-element-edits.d.ts.map +1 -0
  137. package/dist/protocol/source-element-edits.js +93 -0
  138. package/dist/protocol/source-element-edits.js.map +1 -0
  139. package/dist/protocol/source-element-match.d.ts +4 -0
  140. package/dist/protocol/source-element-match.d.ts.map +1 -0
  141. package/dist/protocol/source-element-match.js +40 -0
  142. package/dist/protocol/source-element-match.js.map +1 -0
  143. package/dist/protocol/source-element-neighbors.d.ts +8 -0
  144. package/dist/protocol/source-element-neighbors.d.ts.map +1 -0
  145. package/dist/protocol/source-element-neighbors.js +39 -0
  146. package/dist/protocol/source-element-neighbors.js.map +1 -0
  147. package/dist/protocol/source-element-properties.d.ts +25 -0
  148. package/dist/protocol/source-element-properties.d.ts.map +1 -0
  149. package/dist/protocol/source-element-properties.js +71 -0
  150. package/dist/protocol/source-element-properties.js.map +1 -0
  151. package/dist/protocol/source-element-scan.d.ts +4 -0
  152. package/dist/protocol/source-element-scan.d.ts.map +1 -0
  153. package/dist/protocol/source-element-scan.js +181 -0
  154. package/dist/protocol/source-element-scan.js.map +1 -0
  155. package/dist/protocol/source-element-score.d.ts +12 -0
  156. package/dist/protocol/source-element-score.d.ts.map +1 -0
  157. package/dist/protocol/source-element-score.js +82 -0
  158. package/dist/protocol/source-element-score.js.map +1 -0
  159. package/dist/protocol/source-element-selector.d.ts +19 -0
  160. package/dist/protocol/source-element-selector.d.ts.map +1 -0
  161. package/dist/protocol/source-element-selector.js +115 -0
  162. package/dist/protocol/source-element-selector.js.map +1 -0
  163. package/dist/protocol/source-element-types.d.ts +79 -0
  164. package/dist/protocol/source-element-types.d.ts.map +1 -0
  165. package/dist/protocol/source-element-types.js +2 -0
  166. package/dist/protocol/source-element-types.js.map +1 -0
  167. package/dist/protocol/source-elements.d.ts +7 -0
  168. package/dist/protocol/source-elements.d.ts.map +1 -0
  169. package/dist/protocol/source-elements.js +6 -0
  170. package/dist/protocol/source-elements.js.map +1 -0
  171. package/dist/protocol/source-entities.d.ts +17 -0
  172. package/dist/protocol/source-entities.d.ts.map +1 -0
  173. package/dist/protocol/source-entities.js +45 -0
  174. package/dist/protocol/source-entities.js.map +1 -0
  175. package/dist/protocol/source-hash.d.ts +4 -0
  176. package/dist/protocol/source-hash.d.ts.map +1 -0
  177. package/dist/protocol/source-hash.js +5 -0
  178. package/dist/protocol/source-hash.js.map +1 -0
  179. package/dist/protocol/source-head.d.ts +4 -0
  180. package/dist/protocol/source-head.d.ts.map +1 -0
  181. package/dist/protocol/source-head.js +79 -0
  182. package/dist/protocol/source-head.js.map +1 -0
  183. package/dist/protocol/source-html-attributes.d.ts +20 -0
  184. package/dist/protocol/source-html-attributes.d.ts.map +1 -0
  185. package/dist/protocol/source-html-attributes.js +89 -0
  186. package/dist/protocol/source-html-attributes.js.map +1 -0
  187. package/dist/protocol/source-html-elements.d.ts +5 -0
  188. package/dist/protocol/source-html-elements.d.ts.map +1 -0
  189. package/dist/protocol/source-html-elements.js +144 -0
  190. package/dist/protocol/source-html-elements.js.map +1 -0
  191. package/dist/protocol/source-html.d.ts +51 -0
  192. package/dist/protocol/source-html.d.ts.map +1 -0
  193. package/dist/protocol/source-html.js +167 -0
  194. package/dist/protocol/source-html.js.map +1 -0
  195. package/dist/protocol/source-layout-limits.d.ts +21 -0
  196. package/dist/protocol/source-layout-limits.d.ts.map +1 -0
  197. package/dist/protocol/source-layout-limits.js +20 -0
  198. package/dist/protocol/source-layout-limits.js.map +1 -0
  199. package/dist/protocol/source-layout.d.ts +29 -0
  200. package/dist/protocol/source-layout.d.ts.map +1 -0
  201. package/dist/protocol/source-layout.js +149 -0
  202. package/dist/protocol/source-layout.js.map +1 -0
  203. package/dist/protocol/source-markdown-blocks.d.ts +4 -0
  204. package/dist/protocol/source-markdown-blocks.d.ts.map +1 -0
  205. package/dist/protocol/source-markdown-blocks.js +175 -0
  206. package/dist/protocol/source-markdown-blocks.js.map +1 -0
  207. package/dist/protocol/source-markdown-history.d.ts +26 -0
  208. package/dist/protocol/source-markdown-history.d.ts.map +1 -0
  209. package/dist/protocol/source-markdown-history.js +133 -0
  210. package/dist/protocol/source-markdown-history.js.map +1 -0
  211. package/dist/protocol/source-markdown-inline.d.ts +20 -0
  212. package/dist/protocol/source-markdown-inline.d.ts.map +1 -0
  213. package/dist/protocol/source-markdown-inline.js +155 -0
  214. package/dist/protocol/source-markdown-inline.js.map +1 -0
  215. package/dist/protocol/source-markdown-model.d.ts +49 -0
  216. package/dist/protocol/source-markdown-model.d.ts.map +1 -0
  217. package/dist/protocol/source-markdown-model.js +28 -0
  218. package/dist/protocol/source-markdown-model.js.map +1 -0
  219. package/dist/protocol/source-markdown-op-align.d.ts +5 -0
  220. package/dist/protocol/source-markdown-op-align.d.ts.map +1 -0
  221. package/dist/protocol/source-markdown-op-align.js +49 -0
  222. package/dist/protocol/source-markdown-op-align.js.map +1 -0
  223. package/dist/protocol/source-markdown-op-blocks.d.ts +4 -0
  224. package/dist/protocol/source-markdown-op-blocks.d.ts.map +1 -0
  225. package/dist/protocol/source-markdown-op-blocks.js +198 -0
  226. package/dist/protocol/source-markdown-op-blocks.js.map +1 -0
  227. package/dist/protocol/source-markdown-op-context.d.ts +38 -0
  228. package/dist/protocol/source-markdown-op-context.d.ts.map +1 -0
  229. package/dist/protocol/source-markdown-op-context.js +44 -0
  230. package/dist/protocol/source-markdown-op-context.js.map +1 -0
  231. package/dist/protocol/source-markdown-op-inline.d.ts +8 -0
  232. package/dist/protocol/source-markdown-op-inline.d.ts.map +1 -0
  233. package/dist/protocol/source-markdown-op-inline.js +281 -0
  234. package/dist/protocol/source-markdown-op-inline.js.map +1 -0
  235. package/dist/protocol/source-markdown-op-reading.d.ts +7 -0
  236. package/dist/protocol/source-markdown-op-reading.d.ts.map +1 -0
  237. package/dist/protocol/source-markdown-op-reading.js +93 -0
  238. package/dist/protocol/source-markdown-op-reading.js.map +1 -0
  239. package/dist/protocol/source-markdown-ops.d.ts +13 -0
  240. package/dist/protocol/source-markdown-ops.d.ts.map +1 -0
  241. package/dist/protocol/source-markdown-ops.js +105 -0
  242. package/dist/protocol/source-markdown-ops.js.map +1 -0
  243. package/dist/protocol/source-markdown-projection.d.ts +30 -0
  244. package/dist/protocol/source-markdown-projection.d.ts.map +1 -0
  245. package/dist/protocol/source-markdown-projection.js +164 -0
  246. package/dist/protocol/source-markdown-projection.js.map +1 -0
  247. package/dist/protocol/source-markdown-types.d.ts +32 -0
  248. package/dist/protocol/source-markdown-types.d.ts.map +1 -0
  249. package/dist/protocol/source-markdown-types.js +2 -0
  250. package/dist/protocol/source-markdown-types.js.map +1 -0
  251. package/dist/protocol/source-markdown.d.ts +5 -0
  252. package/dist/protocol/source-markdown.d.ts.map +1 -0
  253. package/dist/protocol/source-markdown.js +9 -0
  254. package/dist/protocol/source-markdown.js.map +1 -0
  255. package/dist/protocol/source-op-apply.d.ts +14 -0
  256. package/dist/protocol/source-op-apply.d.ts.map +1 -0
  257. package/dist/protocol/source-op-apply.js +77 -0
  258. package/dist/protocol/source-op-apply.js.map +1 -0
  259. package/dist/protocol/source-op-context.d.ts +35 -0
  260. package/dist/protocol/source-op-context.d.ts.map +1 -0
  261. package/dist/protocol/source-op-context.js +97 -0
  262. package/dist/protocol/source-op-context.js.map +1 -0
  263. package/dist/protocol/source-op-hash.d.ts +36 -0
  264. package/dist/protocol/source-op-hash.d.ts.map +1 -0
  265. package/dist/protocol/source-op-hash.js +181 -0
  266. package/dist/protocol/source-op-hash.js.map +1 -0
  267. package/dist/protocol/source-op-history.d.ts +10 -0
  268. package/dist/protocol/source-op-history.d.ts.map +1 -0
  269. package/dist/protocol/source-op-history.js +85 -0
  270. package/dist/protocol/source-op-history.js.map +1 -0
  271. package/dist/protocol/source-op-index.d.ts +19 -0
  272. package/dist/protocol/source-op-index.d.ts.map +1 -0
  273. package/dist/protocol/source-op-index.js +53 -0
  274. package/dist/protocol/source-op-index.js.map +1 -0
  275. package/dist/protocol/source-op-parse.d.ts +11 -0
  276. package/dist/protocol/source-op-parse.d.ts.map +1 -0
  277. package/dist/protocol/source-op-parse.js +138 -0
  278. package/dist/protocol/source-op-parse.js.map +1 -0
  279. package/dist/protocol/source-op-preservation.d.ts +11 -0
  280. package/dist/protocol/source-op-preservation.d.ts.map +1 -0
  281. package/dist/protocol/source-op-preservation.js +47 -0
  282. package/dist/protocol/source-op-preservation.js.map +1 -0
  283. package/dist/protocol/source-op-render.d.ts +17 -0
  284. package/dist/protocol/source-op-render.d.ts.map +1 -0
  285. package/dist/protocol/source-op-render.js +116 -0
  286. package/dist/protocol/source-op-render.js.map +1 -0
  287. package/dist/protocol/source-op-types.d.ts +51 -0
  288. package/dist/protocol/source-op-types.d.ts.map +1 -0
  289. package/dist/protocol/source-op-types.js +2 -0
  290. package/dist/protocol/source-op-types.js.map +1 -0
  291. package/dist/protocol/source-quote-selector.d.ts +12 -0
  292. package/dist/protocol/source-quote-selector.d.ts.map +1 -0
  293. package/dist/protocol/source-quote-selector.js +29 -0
  294. package/dist/protocol/source-quote-selector.js.map +1 -0
  295. package/dist/protocol/source-ranges.d.ts +11 -0
  296. package/dist/protocol/source-ranges.d.ts.map +1 -0
  297. package/dist/protocol/source-ranges.js +37 -0
  298. package/dist/protocol/source-ranges.js.map +1 -0
  299. package/dist/protocol/source-read-html-navigation.d.ts +12 -0
  300. package/dist/protocol/source-read-html-navigation.d.ts.map +1 -0
  301. package/dist/protocol/source-read-html-navigation.js +76 -0
  302. package/dist/protocol/source-read-html-navigation.js.map +1 -0
  303. package/dist/protocol/source-read-html-tokens.d.ts +12 -0
  304. package/dist/protocol/source-read-html-tokens.d.ts.map +1 -0
  305. package/dist/protocol/source-read-html-tokens.js +58 -0
  306. package/dist/protocol/source-read-html-tokens.js.map +1 -0
  307. package/dist/protocol/source-read-landmarks.d.ts +24 -0
  308. package/dist/protocol/source-read-landmarks.d.ts.map +1 -0
  309. package/dist/protocol/source-read-landmarks.js +73 -0
  310. package/dist/protocol/source-read-landmarks.js.map +1 -0
  311. package/dist/protocol/source-read-markdown-blocks.d.ts +4 -0
  312. package/dist/protocol/source-read-markdown-blocks.d.ts.map +1 -0
  313. package/dist/protocol/source-read-markdown-blocks.js +87 -0
  314. package/dist/protocol/source-read-markdown-blocks.js.map +1 -0
  315. package/dist/protocol/source-read-markdown-inline.d.ts +4 -0
  316. package/dist/protocol/source-read-markdown-inline.d.ts.map +1 -0
  317. package/dist/protocol/source-read-markdown-inline.js +63 -0
  318. package/dist/protocol/source-read-markdown-inline.js.map +1 -0
  319. package/dist/protocol/source-read-markdown-state.d.ts +33 -0
  320. package/dist/protocol/source-read-markdown-state.d.ts.map +1 -0
  321. package/dist/protocol/source-read-markdown-state.js +79 -0
  322. package/dist/protocol/source-read-markdown-state.js.map +1 -0
  323. package/dist/protocol/source-read-markdown-tables.d.ts +4 -0
  324. package/dist/protocol/source-read-markdown-tables.d.ts.map +1 -0
  325. package/dist/protocol/source-read-markdown-tables.js +68 -0
  326. package/dist/protocol/source-read-markdown-tables.js.map +1 -0
  327. package/dist/protocol/source-read-markdown-text.d.ts +8 -0
  328. package/dist/protocol/source-read-markdown-text.d.ts.map +1 -0
  329. package/dist/protocol/source-read-markdown-text.js +42 -0
  330. package/dist/protocol/source-read-markdown-text.js.map +1 -0
  331. package/dist/protocol/source-read-markdown.d.ts +9 -0
  332. package/dist/protocol/source-read-markdown.d.ts.map +1 -0
  333. package/dist/protocol/source-read-markdown.js +106 -0
  334. package/dist/protocol/source-read-markdown.js.map +1 -0
  335. package/dist/protocol/source-read-spine.d.ts +33 -0
  336. package/dist/protocol/source-read-spine.d.ts.map +1 -0
  337. package/dist/protocol/source-read-spine.js +94 -0
  338. package/dist/protocol/source-read-spine.js.map +1 -0
  339. package/dist/protocol/source-reflow.d.ts +7 -0
  340. package/dist/protocol/source-reflow.d.ts.map +1 -0
  341. package/dist/protocol/source-reflow.js +127 -0
  342. package/dist/protocol/source-reflow.js.map +1 -0
  343. package/dist/protocol/source-stamp.d.ts +22 -0
  344. package/dist/protocol/source-stamp.d.ts.map +1 -0
  345. package/dist/protocol/source-stamp.js +52 -0
  346. package/dist/protocol/source-stamp.js.map +1 -0
  347. package/dist/protocol/source-stamped-sync.d.ts +11 -0
  348. package/dist/protocol/source-stamped-sync.d.ts.map +1 -0
  349. package/dist/protocol/source-stamped-sync.js +238 -0
  350. package/dist/protocol/source-stamped-sync.js.map +1 -0
  351. package/dist/protocol/source-structural-apply.d.ts +5 -0
  352. package/dist/protocol/source-structural-apply.d.ts.map +1 -0
  353. package/dist/protocol/source-structural-apply.js +59 -0
  354. package/dist/protocol/source-structural-apply.js.map +1 -0
  355. package/dist/protocol/source-structural-backfill-parts.d.ts +25 -0
  356. package/dist/protocol/source-structural-backfill-parts.d.ts.map +1 -0
  357. package/dist/protocol/source-structural-backfill-parts.js +85 -0
  358. package/dist/protocol/source-structural-backfill-parts.js.map +1 -0
  359. package/dist/protocol/source-structural-backfill-rules.d.ts +9 -0
  360. package/dist/protocol/source-structural-backfill-rules.d.ts.map +1 -0
  361. package/dist/protocol/source-structural-backfill-rules.js +94 -0
  362. package/dist/protocol/source-structural-backfill-rules.js.map +1 -0
  363. package/dist/protocol/source-structural-backfill.d.ts +7 -0
  364. package/dist/protocol/source-structural-backfill.d.ts.map +1 -0
  365. package/dist/protocol/source-structural-backfill.js +79 -0
  366. package/dist/protocol/source-structural-backfill.js.map +1 -0
  367. package/dist/protocol/source-structural-gap.d.ts +5 -0
  368. package/dist/protocol/source-structural-gap.d.ts.map +1 -0
  369. package/dist/protocol/source-structural-gap.js +21 -0
  370. package/dist/protocol/source-structural-gap.js.map +1 -0
  371. package/dist/protocol/source-structural-inspect.d.ts +5 -0
  372. package/dist/protocol/source-structural-inspect.d.ts.map +1 -0
  373. package/dist/protocol/source-structural-inspect.js +137 -0
  374. package/dist/protocol/source-structural-inspect.js.map +1 -0
  375. package/dist/protocol/source-structural-order.d.ts +22 -0
  376. package/dist/protocol/source-structural-order.d.ts.map +1 -0
  377. package/dist/protocol/source-structural-order.js +128 -0
  378. package/dist/protocol/source-structural-order.js.map +1 -0
  379. package/dist/protocol/source-structural-size.d.ts +14 -0
  380. package/dist/protocol/source-structural-size.d.ts.map +1 -0
  381. package/dist/protocol/source-structural-size.js +99 -0
  382. package/dist/protocol/source-structural-size.js.map +1 -0
  383. package/dist/protocol/source-structural-spacing.d.ts +10 -0
  384. package/dist/protocol/source-structural-spacing.d.ts.map +1 -0
  385. package/dist/protocol/source-structural-spacing.js +55 -0
  386. package/dist/protocol/source-structural-spacing.js.map +1 -0
  387. package/dist/protocol/source-structural-targets.d.ts +8 -0
  388. package/dist/protocol/source-structural-targets.d.ts.map +1 -0
  389. package/dist/protocol/source-structural-targets.js +55 -0
  390. package/dist/protocol/source-structural-targets.js.map +1 -0
  391. package/dist/protocol/source-structural-types.d.ts +120 -0
  392. package/dist/protocol/source-structural-types.d.ts.map +1 -0
  393. package/dist/protocol/source-structural-types.js +3 -0
  394. package/dist/protocol/source-structural-types.js.map +1 -0
  395. package/dist/protocol/source-style.d.ts +15 -0
  396. package/dist/protocol/source-style.d.ts.map +1 -0
  397. package/dist/protocol/source-style.js +130 -0
  398. package/dist/protocol/source-style.js.map +1 -0
  399. package/dist/protocol/source-tags.d.ts +6 -0
  400. package/dist/protocol/source-tags.d.ts.map +1 -0
  401. package/dist/protocol/source-tags.js +5 -0
  402. package/dist/protocol/source-tags.js.map +1 -0
  403. package/dist/protocol/source-text-index.d.ts +22 -0
  404. package/dist/protocol/source-text-index.d.ts.map +1 -0
  405. package/dist/protocol/source-text-index.js +95 -0
  406. package/dist/protocol/source-text-index.js.map +1 -0
  407. package/dist/protocol/source-text-range.d.ts +9 -0
  408. package/dist/protocol/source-text-range.d.ts.map +1 -0
  409. package/dist/protocol/source-text-range.js +55 -0
  410. package/dist/protocol/source-text-range.js.map +1 -0
  411. package/dist/protocol/source-text-segments.d.ts +27 -0
  412. package/dist/protocol/source-text-segments.d.ts.map +1 -0
  413. package/dist/protocol/source-text-segments.js +65 -0
  414. package/dist/protocol/source-text-segments.js.map +1 -0
  415. package/dist/protocol/source-text.d.ts +9 -0
  416. package/dist/protocol/source-text.d.ts.map +1 -0
  417. package/dist/protocol/source-text.js +72 -0
  418. package/dist/protocol/source-text.js.map +1 -0
  419. package/dist/protocol/source-video-attributes.d.ts +5 -0
  420. package/dist/protocol/source-video-attributes.d.ts.map +1 -0
  421. package/dist/protocol/source-video-attributes.js +29 -0
  422. package/dist/protocol/source-video-attributes.js.map +1 -0
  423. package/dist/protocol/source-video-edits.d.ts +4 -0
  424. package/dist/protocol/source-video-edits.d.ts.map +1 -0
  425. package/dist/protocol/source-video-edits.js +85 -0
  426. package/dist/protocol/source-video-edits.js.map +1 -0
  427. package/dist/protocol/source-video-id.d.ts +4 -0
  428. package/dist/protocol/source-video-id.d.ts.map +1 -0
  429. package/dist/protocol/source-video-id.js +9 -0
  430. package/dist/protocol/source-video-id.js.map +1 -0
  431. package/dist/protocol/source-video.d.ts +38 -0
  432. package/dist/protocol/source-video.d.ts.map +1 -0
  433. package/dist/protocol/source-video.js +116 -0
  434. package/dist/protocol/source-video.js.map +1 -0
  435. package/dist/protocol/source.d.ts +47 -0
  436. package/dist/protocol/source.d.ts.map +1 -0
  437. package/dist/protocol/source.js +45 -0
  438. package/dist/protocol/source.js.map +1 -0
  439. package/dist/protocol/state-apply.d.ts +22 -0
  440. package/dist/protocol/state-apply.d.ts.map +1 -0
  441. package/dist/protocol/state-apply.js +13 -0
  442. package/dist/protocol/state-apply.js.map +1 -0
  443. package/dist/protocol/state-limits.d.ts +10 -0
  444. package/dist/protocol/state-limits.d.ts.map +1 -0
  445. package/dist/protocol/state-limits.js +11 -0
  446. package/dist/protocol/state-limits.js.map +1 -0
  447. package/dist/protocol/state.d.ts +60 -0
  448. package/dist/protocol/state.d.ts.map +1 -0
  449. package/dist/protocol/state.js +56 -0
  450. package/dist/protocol/state.js.map +1 -0
  451. package/dist/protocol/text.d.ts +9 -0
  452. package/dist/protocol/text.d.ts.map +1 -0
  453. package/dist/protocol/text.js +72 -0
  454. package/dist/protocol/text.js.map +1 -0
  455. package/dist/protocol/tools.d.ts +77 -0
  456. package/dist/protocol/tools.d.ts.map +1 -0
  457. package/dist/protocol/tools.js +25 -0
  458. package/dist/protocol/tools.js.map +1 -0
  459. package/dist/protocol/viewer.d.ts +21 -0
  460. package/dist/protocol/viewer.d.ts.map +1 -0
  461. package/dist/protocol/viewer.js +18 -0
  462. package/dist/protocol/viewer.js.map +1 -0
  463. package/dist/react/artifact-list.d.ts +17 -0
  464. package/dist/react/artifact-list.d.ts.map +1 -0
  465. package/dist/react/artifact-list.js +121 -0
  466. package/dist/react/artifact-list.js.map +1 -0
  467. package/dist/react/comment-body.d.ts +5 -0
  468. package/dist/react/comment-body.d.ts.map +1 -0
  469. package/dist/react/comment-body.js +14 -0
  470. package/dist/react/comment-body.js.map +1 -0
  471. package/dist/react/comment-input.d.ts +18 -0
  472. package/dist/react/comment-input.d.ts.map +1 -0
  473. package/dist/react/comment-input.js +74 -0
  474. package/dist/react/comment-input.js.map +1 -0
  475. package/dist/react/composer.d.ts +10 -0
  476. package/dist/react/composer.d.ts.map +1 -0
  477. package/dist/react/composer.js +42 -0
  478. package/dist/react/composer.js.map +1 -0
  479. package/dist/react/context.d.ts +57 -0
  480. package/dist/react/context.d.ts.map +1 -0
  481. package/dist/react/context.js +11 -0
  482. package/dist/react/context.js.map +1 -0
  483. package/dist/react/cursors.d.ts +3 -0
  484. package/dist/react/cursors.d.ts.map +1 -0
  485. package/dist/react/cursors.js +8 -0
  486. package/dist/react/cursors.js.map +1 -0
  487. package/dist/react/edit-controls.d.ts +4 -0
  488. package/dist/react/edit-controls.d.ts.map +1 -0
  489. package/dist/react/edit-controls.js +29 -0
  490. package/dist/react/edit-controls.js.map +1 -0
  491. package/dist/react/editing-actions.d.ts +44 -0
  492. package/dist/react/editing-actions.d.ts.map +1 -0
  493. package/dist/react/editing-actions.js +129 -0
  494. package/dist/react/editing-actions.js.map +1 -0
  495. package/dist/react/history.css +79 -0
  496. package/dist/react/index.d.ts +20 -0
  497. package/dist/react/index.d.ts.map +1 -0
  498. package/dist/react/index.js +19 -0
  499. package/dist/react/index.js.map +1 -0
  500. package/dist/react/labels.d.ts +124 -0
  501. package/dist/react/labels.d.ts.map +1 -0
  502. package/dist/react/labels.js +115 -0
  503. package/dist/react/labels.js.map +1 -0
  504. package/dist/react/layout-surface.d.ts +29 -0
  505. package/dist/react/layout-surface.d.ts.map +1 -0
  506. package/dist/react/layout-surface.js +111 -0
  507. package/dist/react/layout-surface.js.map +1 -0
  508. package/dist/react/mention-list.d.ts +12 -0
  509. package/dist/react/mention-list.d.ts.map +1 -0
  510. package/dist/react/mention-list.js +16 -0
  511. package/dist/react/mention-list.js.map +1 -0
  512. package/dist/react/native-stage.d.ts +8 -0
  513. package/dist/react/native-stage.d.ts.map +1 -0
  514. package/dist/react/native-stage.js +41 -0
  515. package/dist/react/native-stage.js.map +1 -0
  516. package/dist/react/overlays.css +43 -0
  517. package/dist/react/panel.css +488 -0
  518. package/dist/react/panel.d.ts +26 -0
  519. package/dist/react/panel.d.ts.map +1 -0
  520. package/dist/react/panel.js +101 -0
  521. package/dist/react/panel.js.map +1 -0
  522. package/dist/react/presence.d.ts +3 -0
  523. package/dist/react/presence.d.ts.map +1 -0
  524. package/dist/react/presence.js +23 -0
  525. package/dist/react/presence.js.map +1 -0
  526. package/dist/react/present-button.d.ts +3 -0
  527. package/dist/react/present-button.d.ts.map +1 -0
  528. package/dist/react/present-button.js +14 -0
  529. package/dist/react/present-button.js.map +1 -0
  530. package/dist/react/provider.d.ts +22 -0
  531. package/dist/react/provider.d.ts.map +1 -0
  532. package/dist/react/provider.js +163 -0
  533. package/dist/react/provider.js.map +1 -0
  534. package/dist/react/rail-layout.d.ts +10 -0
  535. package/dist/react/rail-layout.d.ts.map +1 -0
  536. package/dist/react/rail-layout.js +32 -0
  537. package/dist/react/rail-layout.js.map +1 -0
  538. package/dist/react/rail.d.ts +10 -0
  539. package/dist/react/rail.d.ts.map +1 -0
  540. package/dist/react/rail.js +38 -0
  541. package/dist/react/rail.js.map +1 -0
  542. package/dist/react/role-badge.d.ts +17 -0
  543. package/dist/react/role-badge.d.ts.map +1 -0
  544. package/dist/react/role-badge.js +26 -0
  545. package/dist/react/role-badge.js.map +1 -0
  546. package/dist/react/selection-button.d.ts +3 -0
  547. package/dist/react/selection-button.d.ts.map +1 -0
  548. package/dist/react/selection-button.js +14 -0
  549. package/dist/react/selection-button.js.map +1 -0
  550. package/dist/react/sharing-panel.d.ts +8 -0
  551. package/dist/react/sharing-panel.d.ts.map +1 -0
  552. package/dist/react/sharing-panel.js +105 -0
  553. package/dist/react/sharing-panel.js.map +1 -0
  554. package/dist/react/slide-navigator.css +164 -0
  555. package/dist/react/slide-navigator.d.ts +5 -0
  556. package/dist/react/slide-navigator.d.ts.map +1 -0
  557. package/dist/react/slide-navigator.js +120 -0
  558. package/dist/react/slide-navigator.js.map +1 -0
  559. package/dist/react/stage.css +84 -0
  560. package/dist/react/stage.d.ts +13 -0
  561. package/dist/react/stage.d.ts.map +1 -0
  562. package/dist/react/stage.js +176 -0
  563. package/dist/react/stage.js.map +1 -0
  564. package/dist/react/styles.css +374 -0
  565. package/dist/react/thread-card.d.ts +8 -0
  566. package/dist/react/thread-card.d.ts.map +1 -0
  567. package/dist/react/thread-card.js +75 -0
  568. package/dist/react/thread-card.js.map +1 -0
  569. package/dist/react/time.d.ts +7 -0
  570. package/dist/react/time.d.ts.map +1 -0
  571. package/dist/react/time.js +19 -0
  572. package/dist/react/time.js.map +1 -0
  573. package/dist/react/tokens.css +58 -0
  574. package/dist/react/use-actions.d.ts +27 -0
  575. package/dist/react/use-actions.d.ts.map +1 -0
  576. package/dist/react/use-actions.js +91 -0
  577. package/dist/react/use-actions.js.map +1 -0
  578. package/dist/react/use-editing.d.ts +28 -0
  579. package/dist/react/use-editing.d.ts.map +1 -0
  580. package/dist/react/use-editing.js +70 -0
  581. package/dist/react/use-editing.js.map +1 -0
  582. package/dist/react/use-latest.d.ts +4 -0
  583. package/dist/react/use-latest.d.ts.map +1 -0
  584. package/dist/react/use-latest.js +11 -0
  585. package/dist/react/use-latest.js.map +1 -0
  586. package/dist/react/use-live.d.ts +58 -0
  587. package/dist/react/use-live.d.ts.map +1 -0
  588. package/dist/react/use-live.js +42 -0
  589. package/dist/react/use-live.js.map +1 -0
  590. package/dist/react/use-mention-picker.d.ts +18 -0
  591. package/dist/react/use-mention-picker.d.ts.map +1 -0
  592. package/dist/react/use-mention-picker.js +66 -0
  593. package/dist/react/use-mention-picker.js.map +1 -0
  594. package/dist/react/use-presence-sender.d.ts +4 -0
  595. package/dist/react/use-presence-sender.d.ts.map +1 -0
  596. package/dist/react/use-presence-sender.js +27 -0
  597. package/dist/react/use-presence-sender.js.map +1 -0
  598. package/dist/react/use-presenting.d.ts +26 -0
  599. package/dist/react/use-presenting.d.ts.map +1 -0
  600. package/dist/react/use-presenting.js +118 -0
  601. package/dist/react/use-presenting.js.map +1 -0
  602. package/dist/react/use-rail-layout.d.ts +13 -0
  603. package/dist/react/use-rail-layout.d.ts.map +1 -0
  604. package/dist/react/use-rail-layout.js +38 -0
  605. package/dist/react/use-rail-layout.js.map +1 -0
  606. package/dist/react/use-sharing.d.ts +27 -0
  607. package/dist/react/use-sharing.d.ts.map +1 -0
  608. package/dist/react/use-sharing.js +93 -0
  609. package/dist/react/use-sharing.js.map +1 -0
  610. package/dist/react/version-history.d.ts +12 -0
  611. package/dist/react/version-history.d.ts.map +1 -0
  612. package/dist/react/version-history.js +81 -0
  613. package/dist/react/version-history.js.map +1 -0
  614. package/dist/runtime/anchoring.d.ts +17 -0
  615. package/dist/runtime/anchoring.d.ts.map +1 -0
  616. package/dist/runtime/anchoring.js +258 -0
  617. package/dist/runtime/anchoring.js.map +1 -0
  618. package/dist/runtime/assets.d.ts +6 -0
  619. package/dist/runtime/assets.js +3 -0
  620. package/dist/runtime/connection.d.ts +32 -0
  621. package/dist/runtime/connection.d.ts.map +1 -0
  622. package/dist/runtime/connection.js +27 -0
  623. package/dist/runtime/connection.js.map +1 -0
  624. package/dist/runtime/editing.d.ts +10 -0
  625. package/dist/runtime/editing.d.ts.map +1 -0
  626. package/dist/runtime/editing.js +170 -0
  627. package/dist/runtime/editing.js.map +1 -0
  628. package/dist/runtime/geometry.d.ts +4 -0
  629. package/dist/runtime/geometry.d.ts.map +1 -0
  630. package/dist/runtime/geometry.js +8 -0
  631. package/dist/runtime/geometry.js.map +1 -0
  632. package/dist/runtime/highlights.d.ts +2 -0
  633. package/dist/runtime/highlights.d.ts.map +1 -0
  634. package/dist/runtime/highlights.js +29 -0
  635. package/dist/runtime/highlights.js.map +1 -0
  636. package/dist/runtime/index.d.ts +6 -0
  637. package/dist/runtime/index.d.ts.map +1 -0
  638. package/dist/runtime/index.js +4 -0
  639. package/dist/runtime/index.js.map +1 -0
  640. package/dist/runtime/layout-handle.d.ts +33 -0
  641. package/dist/runtime/layout-handle.d.ts.map +1 -0
  642. package/dist/runtime/layout-handle.js +218 -0
  643. package/dist/runtime/layout-handle.js.map +1 -0
  644. package/dist/runtime/layout.d.ts +27 -0
  645. package/dist/runtime/layout.d.ts.map +1 -0
  646. package/dist/runtime/layout.js +290 -0
  647. package/dist/runtime/layout.js.map +1 -0
  648. package/dist/runtime/presence.d.ts +5 -0
  649. package/dist/runtime/presence.d.ts.map +1 -0
  650. package/dist/runtime/presence.js +26 -0
  651. package/dist/runtime/presence.js.map +1 -0
  652. package/dist/runtime/runtime.d.ts +31 -0
  653. package/dist/runtime/runtime.d.ts.map +1 -0
  654. package/dist/runtime/runtime.entry.d.ts +9 -0
  655. package/dist/runtime/runtime.entry.d.ts.map +1 -0
  656. package/dist/runtime/runtime.entry.js +6 -0
  657. package/dist/runtime/runtime.entry.js.map +1 -0
  658. package/dist/runtime/runtime.js +189 -0
  659. package/dist/runtime/runtime.js.map +1 -0
  660. package/dist/runtime/sandbox/relay.d.ts +2 -0
  661. package/dist/runtime/sandbox/relay.d.ts.map +1 -0
  662. package/dist/runtime/sandbox/relay.js +82 -0
  663. package/dist/runtime/sandbox/relay.js.map +1 -0
  664. package/dist/runtime/sandbox.entry.d.ts +2 -0
  665. package/dist/runtime/sandbox.entry.d.ts.map +1 -0
  666. package/dist/runtime/sandbox.entry.js +3 -0
  667. package/dist/runtime/sandbox.entry.js.map +1 -0
  668. package/dist/runtime/shared.d.ts +22 -0
  669. package/dist/runtime/shared.d.ts.map +1 -0
  670. package/dist/runtime/shared.js +118 -0
  671. package/dist/runtime/shared.js.map +1 -0
  672. package/dist/runtime/slides.d.ts +20 -0
  673. package/dist/runtime/slides.d.ts.map +1 -0
  674. package/dist/runtime/slides.js +143 -0
  675. package/dist/runtime/slides.js.map +1 -0
  676. package/dist/runtime/source-align.d.ts +12 -0
  677. package/dist/runtime/source-align.d.ts.map +1 -0
  678. package/dist/runtime/source-align.js +158 -0
  679. package/dist/runtime/source-align.js.map +1 -0
  680. package/dist/runtime/source-attributes.d.ts +34 -0
  681. package/dist/runtime/source-attributes.d.ts.map +1 -0
  682. package/dist/runtime/source-attributes.js +51 -0
  683. package/dist/runtime/source-attributes.js.map +1 -0
  684. package/dist/runtime/source-copy-origin.d.ts +5 -0
  685. package/dist/runtime/source-copy-origin.d.ts.map +1 -0
  686. package/dist/runtime/source-copy-origin.js +28 -0
  687. package/dist/runtime/source-copy-origin.js.map +1 -0
  688. package/dist/runtime/source-element-dom-resolve.d.ts +11 -0
  689. package/dist/runtime/source-element-dom-resolve.d.ts.map +1 -0
  690. package/dist/runtime/source-element-dom-resolve.js +104 -0
  691. package/dist/runtime/source-element-dom-resolve.js.map +1 -0
  692. package/dist/runtime/source-element-dom.d.ts +14 -0
  693. package/dist/runtime/source-element-dom.d.ts.map +1 -0
  694. package/dist/runtime/source-element-dom.js +75 -0
  695. package/dist/runtime/source-element-dom.js.map +1 -0
  696. package/dist/runtime/source-page.d.ts +32 -0
  697. package/dist/runtime/source-page.d.ts.map +1 -0
  698. package/dist/runtime/source-page.js +137 -0
  699. package/dist/runtime/source-page.js.map +1 -0
  700. package/dist/runtime/source-patch.d.ts +20 -0
  701. package/dist/runtime/source-patch.d.ts.map +1 -0
  702. package/dist/runtime/source-patch.js +94 -0
  703. package/dist/runtime/source-patch.js.map +1 -0
  704. package/dist/runtime/source-serialize.d.ts +12 -0
  705. package/dist/runtime/source-serialize.d.ts.map +1 -0
  706. package/dist/runtime/source-serialize.js +144 -0
  707. package/dist/runtime/source-serialize.js.map +1 -0
  708. package/dist/runtime/source-text-anchor.d.ts +5 -0
  709. package/dist/runtime/source-text-anchor.d.ts.map +1 -0
  710. package/dist/runtime/source-text-anchor.js +27 -0
  711. package/dist/runtime/source-text-anchor.js.map +1 -0
  712. package/dist/runtime/source-text-dom.d.ts +5 -0
  713. package/dist/runtime/source-text-dom.d.ts.map +1 -0
  714. package/dist/runtime/source-text-dom.js +53 -0
  715. package/dist/runtime/source-text-dom.js.map +1 -0
  716. package/dist/runtime/source-tokens.d.ts +84 -0
  717. package/dist/runtime/source-tokens.d.ts.map +1 -0
  718. package/dist/runtime/source-tokens.js +192 -0
  719. package/dist/runtime/source-tokens.js.map +1 -0
  720. package/dist/runtime/source-video-attributes.d.ts +5 -0
  721. package/dist/runtime/source-video-attributes.d.ts.map +1 -0
  722. package/dist/runtime/source-video-attributes.js +5 -0
  723. package/dist/runtime/source-video-attributes.js.map +1 -0
  724. package/dist/runtime/source-video-controller.d.ts +43 -0
  725. package/dist/runtime/source-video-controller.d.ts.map +1 -0
  726. package/dist/runtime/source-video-controller.js +190 -0
  727. package/dist/runtime/source-video-controller.js.map +1 -0
  728. package/dist/runtime/source-video-dom.d.ts +3 -0
  729. package/dist/runtime/source-video-dom.d.ts.map +1 -0
  730. package/dist/runtime/source-video-dom.js +14 -0
  731. package/dist/runtime/source-video-dom.js.map +1 -0
  732. package/dist/runtime/source.d.ts +14 -0
  733. package/dist/runtime/source.d.ts.map +1 -0
  734. package/dist/runtime/source.js +13 -0
  735. package/dist/runtime/source.js.map +1 -0
  736. package/dist/runtime/state-backend.d.ts +28 -0
  737. package/dist/runtime/state-backend.d.ts.map +1 -0
  738. package/dist/runtime/state-backend.js +86 -0
  739. package/dist/runtime/state-backend.js.map +1 -0
  740. package/dist/runtime/text-index.d.ts +11 -0
  741. package/dist/runtime/text-index.d.ts.map +1 -0
  742. package/dist/runtime/text-index.js +73 -0
  743. package/dist/runtime/text-index.js.map +1 -0
  744. package/dist/runtime/theme.d.ts +5 -0
  745. package/dist/runtime/theme.d.ts.map +1 -0
  746. package/dist/runtime/theme.js +30 -0
  747. package/dist/runtime/theme.js.map +1 -0
  748. package/dist/runtime/viewer.d.ts +5 -0
  749. package/dist/runtime/viewer.d.ts.map +1 -0
  750. package/dist/runtime/viewer.entry.d.ts +2 -0
  751. package/dist/runtime/viewer.entry.d.ts.map +1 -0
  752. package/dist/runtime/viewer.entry.js +3 -0
  753. package/dist/runtime/viewer.entry.js.map +1 -0
  754. package/dist/runtime/viewer.js +62 -0
  755. package/dist/runtime/viewer.js.map +1 -0
  756. package/dist/runtime.global.js +142 -0
  757. package/dist/sandbox.global.js +1 -0
  758. package/dist/server/adapters/activity.d.ts +4 -0
  759. package/dist/server/adapters/activity.d.ts.map +1 -0
  760. package/dist/server/adapters/activity.js +25 -0
  761. package/dist/server/adapters/activity.js.map +1 -0
  762. package/dist/server/adapters/memory-bus.d.ts +6 -0
  763. package/dist/server/adapters/memory-bus.d.ts.map +1 -0
  764. package/dist/server/adapters/memory-bus.js +26 -0
  765. package/dist/server/adapters/memory-bus.js.map +1 -0
  766. package/dist/server/adapters/memory-store.d.ts +4 -0
  767. package/dist/server/adapters/memory-store.d.ts.map +1 -0
  768. package/dist/server/adapters/memory-store.js +125 -0
  769. package/dist/server/adapters/memory-store.js.map +1 -0
  770. package/dist/server/adapters/memory.d.ts +8 -0
  771. package/dist/server/adapters/memory.d.ts.map +1 -0
  772. package/dist/server/adapters/memory.js +23 -0
  773. package/dist/server/adapters/memory.js.map +1 -0
  774. package/dist/server/adapters/postgres/blobs.d.ts +6 -0
  775. package/dist/server/adapters/postgres/blobs.d.ts.map +1 -0
  776. package/dist/server/adapters/postgres/blobs.js +17 -0
  777. package/dist/server/adapters/postgres/blobs.js.map +1 -0
  778. package/dist/server/adapters/postgres/bus.d.ts +7 -0
  779. package/dist/server/adapters/postgres/bus.d.ts.map +1 -0
  780. package/dist/server/adapters/postgres/bus.js +60 -0
  781. package/dist/server/adapters/postgres/bus.js.map +1 -0
  782. package/dist/server/adapters/postgres/client.d.ts +38 -0
  783. package/dist/server/adapters/postgres/client.d.ts.map +1 -0
  784. package/dist/server/adapters/postgres/client.js +22 -0
  785. package/dist/server/adapters/postgres/client.js.map +1 -0
  786. package/dist/server/adapters/postgres/index.d.ts +29 -0
  787. package/dist/server/adapters/postgres/index.d.ts.map +1 -0
  788. package/dist/server/adapters/postgres/index.js +23 -0
  789. package/dist/server/adapters/postgres/index.js.map +1 -0
  790. package/dist/server/adapters/postgres/schema.d.ts +10 -0
  791. package/dist/server/adapters/postgres/schema.d.ts.map +1 -0
  792. package/dist/server/adapters/postgres/schema.js +111 -0
  793. package/dist/server/adapters/postgres/schema.js.map +1 -0
  794. package/dist/server/adapters/postgres/store.d.ts +4 -0
  795. package/dist/server/adapters/postgres/store.d.ts.map +1 -0
  796. package/dist/server/adapters/postgres/store.js +189 -0
  797. package/dist/server/adapters/postgres/store.js.map +1 -0
  798. package/dist/server/adapters/s3.d.ts +22 -0
  799. package/dist/server/adapters/s3.d.ts.map +1 -0
  800. package/dist/server/adapters/s3.js +47 -0
  801. package/dist/server/adapters/s3.js.map +1 -0
  802. package/dist/server/adapters/sql-rows.d.ts +26 -0
  803. package/dist/server/adapters/sql-rows.d.ts.map +1 -0
  804. package/dist/server/adapters/sql-rows.js +134 -0
  805. package/dist/server/adapters/sql-rows.js.map +1 -0
  806. package/dist/server/adapters/sqlite/index.d.ts +10 -0
  807. package/dist/server/adapters/sqlite/index.d.ts.map +1 -0
  808. package/dist/server/adapters/sqlite/index.js +50 -0
  809. package/dist/server/adapters/sqlite/index.js.map +1 -0
  810. package/dist/server/adapters/sqlite/schema.d.ts +3 -0
  811. package/dist/server/adapters/sqlite/schema.d.ts.map +1 -0
  812. package/dist/server/adapters/sqlite/schema.js +69 -0
  813. package/dist/server/adapters/sqlite/schema.js.map +1 -0
  814. package/dist/server/adapters/sqlite/sharing.d.ts +6 -0
  815. package/dist/server/adapters/sqlite/sharing.d.ts.map +1 -0
  816. package/dist/server/adapters/sqlite/sharing.js +81 -0
  817. package/dist/server/adapters/sqlite/sharing.js.map +1 -0
  818. package/dist/server/adapters/sqlite/store.d.ts +6 -0
  819. package/dist/server/adapters/sqlite/store.d.ts.map +1 -0
  820. package/dist/server/adapters/sqlite/store.js +130 -0
  821. package/dist/server/adapters/sqlite/store.js.map +1 -0
  822. package/dist/server/collection-storage.d.ts +55 -0
  823. package/dist/server/collection-storage.d.ts.map +1 -0
  824. package/dist/server/collection-storage.js +77 -0
  825. package/dist/server/collection-storage.js.map +1 -0
  826. package/dist/server/core/access.d.ts +17 -0
  827. package/dist/server/core/access.d.ts.map +1 -0
  828. package/dist/server/core/access.js +61 -0
  829. package/dist/server/core/access.js.map +1 -0
  830. package/dist/server/core/artifacts.d.ts +50 -0
  831. package/dist/server/core/artifacts.d.ts.map +1 -0
  832. package/dist/server/core/artifacts.js +152 -0
  833. package/dist/server/core/artifacts.js.map +1 -0
  834. package/dist/server/core/assets.d.ts +23 -0
  835. package/dist/server/core/assets.d.ts.map +1 -0
  836. package/dist/server/core/assets.js +41 -0
  837. package/dist/server/core/assets.js.map +1 -0
  838. package/dist/server/core/base64.d.ts +3 -0
  839. package/dist/server/core/base64.d.ts.map +1 -0
  840. package/dist/server/core/base64.js +17 -0
  841. package/dist/server/core/base64.js.map +1 -0
  842. package/dist/server/core/blobs.d.ts +10 -0
  843. package/dist/server/core/blobs.d.ts.map +1 -0
  844. package/dist/server/core/blobs.js +10 -0
  845. package/dist/server/core/blobs.js.map +1 -0
  846. package/dist/server/core/errors.d.ts +22 -0
  847. package/dist/server/core/errors.d.ts.map +1 -0
  848. package/dist/server/core/errors.js +32 -0
  849. package/dist/server/core/errors.js.map +1 -0
  850. package/dist/server/core/export.d.ts +8 -0
  851. package/dist/server/core/export.d.ts.map +1 -0
  852. package/dist/server/core/export.js +27 -0
  853. package/dist/server/core/export.js.map +1 -0
  854. package/dist/server/core/ids.d.ts +4 -0
  855. package/dist/server/core/ids.d.ts.map +1 -0
  856. package/dist/server/core/ids.js +12 -0
  857. package/dist/server/core/ids.js.map +1 -0
  858. package/dist/server/core/index.d.ts +36 -0
  859. package/dist/server/core/index.d.ts.map +1 -0
  860. package/dist/server/core/index.js +19 -0
  861. package/dist/server/core/index.js.map +1 -0
  862. package/dist/server/core/inline-assets.d.ts +6 -0
  863. package/dist/server/core/inline-assets.d.ts.map +1 -0
  864. package/dist/server/core/inline-assets.js +43 -0
  865. package/dist/server/core/inline-assets.js.map +1 -0
  866. package/dist/server/core/live.d.ts +10 -0
  867. package/dist/server/core/live.d.ts.map +1 -0
  868. package/dist/server/core/live.js +73 -0
  869. package/dist/server/core/live.js.map +1 -0
  870. package/dist/server/core/source-publication.d.ts +30 -0
  871. package/dist/server/core/source-publication.d.ts.map +1 -0
  872. package/dist/server/core/source-publication.js +89 -0
  873. package/dist/server/core/source-publication.js.map +1 -0
  874. package/dist/server/core/source.d.ts +16 -0
  875. package/dist/server/core/source.d.ts.map +1 -0
  876. package/dist/server/core/source.js +9 -0
  877. package/dist/server/core/source.js.map +1 -0
  878. package/dist/server/core/summary.d.ts +12 -0
  879. package/dist/server/core/summary.d.ts.map +1 -0
  880. package/dist/server/core/summary.js +40 -0
  881. package/dist/server/core/summary.js.map +1 -0
  882. package/dist/server/core/version-reader.d.ts +21 -0
  883. package/dist/server/core/version-reader.d.ts.map +1 -0
  884. package/dist/server/core/version-reader.js +49 -0
  885. package/dist/server/core/version-reader.js.map +1 -0
  886. package/dist/server/core/views.d.ts +6 -0
  887. package/dist/server/core/views.d.ts.map +1 -0
  888. package/dist/server/core/views.js +19 -0
  889. package/dist/server/core/views.js.map +1 -0
  890. package/dist/server/hosts.d.ts +13 -0
  891. package/dist/server/hosts.d.ts.map +1 -0
  892. package/dist/server/hosts.js +11 -0
  893. package/dist/server/hosts.js.map +1 -0
  894. package/dist/server/http/app.d.ts +48 -0
  895. package/dist/server/http/app.d.ts.map +1 -0
  896. package/dist/server/http/app.js +82 -0
  897. package/dist/server/http/app.js.map +1 -0
  898. package/dist/server/http/body.d.ts +5 -0
  899. package/dist/server/http/body.d.ts.map +1 -0
  900. package/dist/server/http/body.js +9 -0
  901. package/dist/server/http/body.js.map +1 -0
  902. package/dist/server/http/gates.d.ts +26 -0
  903. package/dist/server/http/gates.d.ts.map +1 -0
  904. package/dist/server/http/gates.js +43 -0
  905. package/dist/server/http/gates.js.map +1 -0
  906. package/dist/server/http/routes/artifacts.d.ts +5 -0
  907. package/dist/server/http/routes/artifacts.d.ts.map +1 -0
  908. package/dist/server/http/routes/artifacts.js +75 -0
  909. package/dist/server/http/routes/artifacts.js.map +1 -0
  910. package/dist/server/http/routes/events.d.ts +5 -0
  911. package/dist/server/http/routes/events.d.ts.map +1 -0
  912. package/dist/server/http/routes/events.js +26 -0
  913. package/dist/server/http/routes/events.js.map +1 -0
  914. package/dist/server/http/routes/mcp.d.ts +17 -0
  915. package/dist/server/http/routes/mcp.d.ts.map +1 -0
  916. package/dist/server/http/routes/mcp.js +37 -0
  917. package/dist/server/http/routes/mcp.js.map +1 -0
  918. package/dist/server/index.d.ts +3 -0
  919. package/dist/server/index.d.ts.map +1 -0
  920. package/dist/server/index.js +5 -0
  921. package/dist/server/index.js.map +1 -0
  922. package/dist/server/kit/broadcasts.d.ts +5 -0
  923. package/dist/server/kit/broadcasts.d.ts.map +1 -0
  924. package/dist/server/kit/broadcasts.js +10 -0
  925. package/dist/server/kit/broadcasts.js.map +1 -0
  926. package/dist/server/kit/events.d.ts +97 -0
  927. package/dist/server/kit/events.d.ts.map +1 -0
  928. package/dist/server/kit/events.js +28 -0
  929. package/dist/server/kit/events.js.map +1 -0
  930. package/dist/server/kit/observe.d.ts +20 -0
  931. package/dist/server/kit/observe.d.ts.map +1 -0
  932. package/dist/server/kit/observe.js +24 -0
  933. package/dist/server/kit/observe.js.map +1 -0
  934. package/dist/server/kit/plugin.d.ts +34 -0
  935. package/dist/server/kit/plugin.d.ts.map +1 -0
  936. package/dist/server/kit/plugin.js +4 -0
  937. package/dist/server/kit/plugin.js.map +1 -0
  938. package/dist/server/kit/tool.d.ts +54 -0
  939. package/dist/server/kit/tool.d.ts.map +1 -0
  940. package/dist/server/kit/tool.js +56 -0
  941. package/dist/server/kit/tool.js.map +1 -0
  942. package/dist/server/kit/wire.d.ts +9 -0
  943. package/dist/server/kit/wire.d.ts.map +1 -0
  944. package/dist/server/kit/wire.js +14 -0
  945. package/dist/server/kit/wire.js.map +1 -0
  946. package/dist/server/kit.d.ts +25 -0
  947. package/dist/server/kit.d.ts.map +1 -0
  948. package/dist/server/kit.js +18 -0
  949. package/dist/server/kit.js.map +1 -0
  950. package/dist/server/mcp/result.d.ts +5 -0
  951. package/dist/server/mcp/result.d.ts.map +1 -0
  952. package/dist/server/mcp/result.js +25 -0
  953. package/dist/server/mcp/result.js.map +1 -0
  954. package/dist/server/mcp/schema.d.ts +7 -0
  955. package/dist/server/mcp/schema.d.ts.map +1 -0
  956. package/dist/server/mcp/schema.js +27 -0
  957. package/dist/server/mcp/schema.js.map +1 -0
  958. package/dist/server/mcp/tools.d.ts +35 -0
  959. package/dist/server/mcp/tools.d.ts.map +1 -0
  960. package/dist/server/mcp/tools.js +72 -0
  961. package/dist/server/mcp/tools.js.map +1 -0
  962. package/dist/server/mcp/viewer.d.ts +17 -0
  963. package/dist/server/mcp/viewer.d.ts.map +1 -0
  964. package/dist/server/mcp/viewer.js +47 -0
  965. package/dist/server/mcp/viewer.js.map +1 -0
  966. package/dist/server/plugins/comments/index.d.ts +8 -0
  967. package/dist/server/plugins/comments/index.d.ts.map +1 -0
  968. package/dist/server/plugins/comments/index.js +79 -0
  969. package/dist/server/plugins/comments/index.js.map +1 -0
  970. package/dist/server/plugins/comments/routes.d.ts +6 -0
  971. package/dist/server/plugins/comments/routes.d.ts.map +1 -0
  972. package/dist/server/plugins/comments/routes.js +34 -0
  973. package/dist/server/plugins/comments/routes.js.map +1 -0
  974. package/dist/server/plugins/comments/service.d.ts +20 -0
  975. package/dist/server/plugins/comments/service.d.ts.map +1 -0
  976. package/dist/server/plugins/comments/service.js +66 -0
  977. package/dist/server/plugins/comments/service.js.map +1 -0
  978. package/dist/server/plugins/components/catalog.d.ts +15 -0
  979. package/dist/server/plugins/components/catalog.d.ts.map +1 -0
  980. package/dist/server/plugins/components/catalog.js +39 -0
  981. package/dist/server/plugins/components/catalog.js.map +1 -0
  982. package/dist/server/plugins/components/index.d.ts +21 -0
  983. package/dist/server/plugins/components/index.d.ts.map +1 -0
  984. package/dist/server/plugins/components/index.js +35 -0
  985. package/dist/server/plugins/components/index.js.map +1 -0
  986. package/dist/server/plugins/components/tags.d.ts +9 -0
  987. package/dist/server/plugins/components/tags.d.ts.map +1 -0
  988. package/dist/server/plugins/components/tags.js +22 -0
  989. package/dist/server/plugins/components/tags.js.map +1 -0
  990. package/dist/server/plugins/editing/apply.d.ts +9 -0
  991. package/dist/server/plugins/editing/apply.d.ts.map +1 -0
  992. package/dist/server/plugins/editing/apply.js +30 -0
  993. package/dist/server/plugins/editing/apply.js.map +1 -0
  994. package/dist/server/plugins/editing/index.d.ts +8 -0
  995. package/dist/server/plugins/editing/index.d.ts.map +1 -0
  996. package/dist/server/plugins/editing/index.js +48 -0
  997. package/dist/server/plugins/editing/index.js.map +1 -0
  998. package/dist/server/plugins/editing/layout.d.ts +4 -0
  999. package/dist/server/plugins/editing/layout.d.ts.map +1 -0
  1000. package/dist/server/plugins/editing/layout.js +29 -0
  1001. package/dist/server/plugins/editing/layout.js.map +1 -0
  1002. package/dist/server/plugins/editing/source-text.d.ts +10 -0
  1003. package/dist/server/plugins/editing/source-text.d.ts.map +1 -0
  1004. package/dist/server/plugins/editing/source-text.js +10 -0
  1005. package/dist/server/plugins/editing/source-text.js.map +1 -0
  1006. package/dist/server/plugins/editing/source.d.ts +18 -0
  1007. package/dist/server/plugins/editing/source.d.ts.map +1 -0
  1008. package/dist/server/plugins/editing/source.js +15 -0
  1009. package/dist/server/plugins/editing/source.js.map +1 -0
  1010. package/dist/server/plugins/index.d.ts +25 -0
  1011. package/dist/server/plugins/index.d.ts.map +1 -0
  1012. package/dist/server/plugins/index.js +20 -0
  1013. package/dist/server/plugins/index.js.map +1 -0
  1014. package/dist/server/plugins/mcp-auth.d.ts +12 -0
  1015. package/dist/server/plugins/mcp-auth.d.ts.map +1 -0
  1016. package/dist/server/plugins/mcp-auth.js +27 -0
  1017. package/dist/server/plugins/mcp-auth.js.map +1 -0
  1018. package/dist/server/plugins/mentions.d.ts +10 -0
  1019. package/dist/server/plugins/mentions.d.ts.map +1 -0
  1020. package/dist/server/plugins/mentions.js +28 -0
  1021. package/dist/server/plugins/mentions.js.map +1 -0
  1022. package/dist/server/plugins/moderation.d.ts +17 -0
  1023. package/dist/server/plugins/moderation.d.ts.map +1 -0
  1024. package/dist/server/plugins/moderation.js +17 -0
  1025. package/dist/server/plugins/moderation.js.map +1 -0
  1026. package/dist/server/plugins/notifications.d.ts +22 -0
  1027. package/dist/server/plugins/notifications.d.ts.map +1 -0
  1028. package/dist/server/plugins/notifications.js +43 -0
  1029. package/dist/server/plugins/notifications.js.map +1 -0
  1030. package/dist/server/plugins/presence.d.ts +3 -0
  1031. package/dist/server/plugins/presence.d.ts.map +1 -0
  1032. package/dist/server/plugins/presence.js +23 -0
  1033. package/dist/server/plugins/presence.js.map +1 -0
  1034. package/dist/server/plugins/rate-limit.d.ts +18 -0
  1035. package/dist/server/plugins/rate-limit.d.ts.map +1 -0
  1036. package/dist/server/plugins/rate-limit.js +43 -0
  1037. package/dist/server/plugins/rate-limit.js.map +1 -0
  1038. package/dist/server/plugins/state/index.d.ts +10 -0
  1039. package/dist/server/plugins/state/index.d.ts.map +1 -0
  1040. package/dist/server/plugins/state/index.js +66 -0
  1041. package/dist/server/plugins/state/index.js.map +1 -0
  1042. package/dist/server/plugins/state/service.d.ts +21 -0
  1043. package/dist/server/plugins/state/service.d.ts.map +1 -0
  1044. package/dist/server/plugins/state/service.js +65 -0
  1045. package/dist/server/plugins/state/service.js.map +1 -0
  1046. package/dist/server/plugins/webhook.d.ts +17 -0
  1047. package/dist/server/plugins/webhook.d.ts.map +1 -0
  1048. package/dist/server/plugins/webhook.js +54 -0
  1049. package/dist/server/plugins/webhook.js.map +1 -0
  1050. package/dist/server/ports.d.ts +214 -0
  1051. package/dist/server/ports.d.ts.map +1 -0
  1052. package/dist/server/ports.js +22 -0
  1053. package/dist/server/ports.js.map +1 -0
  1054. package/dist/server/sandbox/assets.d.ts +13 -0
  1055. package/dist/server/sandbox/assets.d.ts.map +1 -0
  1056. package/dist/server/sandbox/assets.js +8 -0
  1057. package/dist/server/sandbox/assets.js.map +1 -0
  1058. package/dist/server/sandbox/csp.d.ts +5 -0
  1059. package/dist/server/sandbox/csp.d.ts.map +1 -0
  1060. package/dist/server/sandbox/csp.js +29 -0
  1061. package/dist/server/sandbox/csp.js.map +1 -0
  1062. package/dist/server/sandbox/inject.d.ts +9 -0
  1063. package/dist/server/sandbox/inject.d.ts.map +1 -0
  1064. package/dist/server/sandbox/inject.js +42 -0
  1065. package/dist/server/sandbox/inject.js.map +1 -0
  1066. package/dist/server/sandbox/server.d.ts +17 -0
  1067. package/dist/server/sandbox/server.d.ts.map +1 -0
  1068. package/dist/server/sandbox/server.js +63 -0
  1069. package/dist/server/sandbox/server.js.map +1 -0
  1070. package/dist/server/sharing/index.d.ts +41 -0
  1071. package/dist/server/sharing/index.d.ts.map +1 -0
  1072. package/dist/server/sharing/index.js +150 -0
  1073. package/dist/server/sharing/index.js.map +1 -0
  1074. package/dist/server/sharing/postgres.d.ts +13 -0
  1075. package/dist/server/sharing/postgres.d.ts.map +1 -0
  1076. package/dist/server/sharing/postgres.js +87 -0
  1077. package/dist/server/sharing/postgres.js.map +1 -0
  1078. package/dist/server/sharing/store.d.ts +23 -0
  1079. package/dist/server/sharing/store.d.ts.map +1 -0
  1080. package/dist/server/sharing/store.js +38 -0
  1081. package/dist/server/sharing/store.js.map +1 -0
  1082. package/dist/server/source.d.ts +8 -0
  1083. package/dist/server/source.d.ts.map +1 -0
  1084. package/dist/server/source.js +6 -0
  1085. package/dist/server/source.js.map +1 -0
  1086. package/dist/server/testing.d.ts +17 -0
  1087. package/dist/server/testing.d.ts.map +1 -0
  1088. package/dist/server/testing.js +287 -0
  1089. package/dist/server/testing.js.map +1 -0
  1090. package/dist/viewer.global.js +150 -0
  1091. package/package.json +199 -4
@@ -0,0 +1 @@
1
+ "use strict";(()=>{function oe(e,t){return typeof t=="bigint"?t.toString():t}var F=class{constructor(t){this._getter=t,this._value=void 0}get value(){let t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}};function ie(e){return new F(e)}function se(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function ce(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}var U="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ue(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function I(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function w(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function ae(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var le={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function b(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function pe(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function B(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function E(e){return typeof e=="string"?e:e?.message}function K(e,t,r){var n;for(let i=t;i<e.length;i++)(n=e[i]).schema??(n.schema=r)}function P(e,t,r){var n;let i=e.inst?._zod?.traits;i?.has("$ZodType")&&(i.has("$ZodCheck")?(n=e).schema??(n.schema=e.inst):e.schema=e.inst);let s=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,c=e.message?e.message:E(e.inst?._zod.def?.error?.(e))??E(s?.(e))??E(t?.error?.(e))??E(r.customError?.(e))??E(r.localeError?.(e))??"Invalid input",o={};for(let a of Object.keys(e))a==="inst"||a==="schema"||a==="continue"||a==="input"||a==="__proto__"||(o[a]=e[a]);return o.path??(o.path=[]),o.message=c,t?.reportInput&&(o.input=e.input),o}function fe(e,t){for(let r in t){let n=Object.getOwnPropertyDescriptor(t,r);n.get?Object.defineProperty(e,r,{...n,enumerable:!1}):Ue(e,r,n.value)}}function v(e,t,r,n=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:n,value:r}),r}function V(e,t,r){return v(e,t,r,!1)}function Ue(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:v(this,t,r.bind(this))},set(n){v(this,t,n)}})}function Be(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}var N,z=!1,Ke={configurable:!0,get(){z=!0}};function S(e,t,r){let n=Object.getPrototypeOf(e._zod);if(t in n&&N!==e._zod){N=void 0;return}N=e._zod,Object.defineProperty(n,t,{configurable:!0,get(){Object.defineProperty(this,t,Ke);let i=z;z=!1;try{let s=r(this);return z?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:s}),z=z||i,s}catch(s){throw delete this[t],z=z||i,s}},set(i){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:i})}})}function de(e,t,r,n){let i=Be(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let s={configurable:!0,writable:!0,enumerable:n,value:void 0};return Object.defineProperty(this,t,s),s.value=r(this),Object.defineProperty(this,t,s),s.value},set(s){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:n,value:s})}})}var me;var W={value:void 0,enumerable:!1},he="captureStackTrace"in Error?Error:null;function Ve(e){let t=he;if(t){let r=t.stackTraceLimit;if(typeof r=="number"){try{t.stackTraceLimit=0}catch{return he=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}function _(e,t,r,n){let i={};function s(l){this.def=l,this.constr=f,this.traits=new Set}s.prototype=i;let c=r,o=c&&new WeakSet;function a(l,d){if(l._zod){if(l._zod.traits.has(e))return}else{W.value=new s(d);try{Object.defineProperty(l,"_zod",W)}finally{W.value=void 0}}if(l._zod.traits.add(e),t(l,d),o){let h=Object.getPrototypeOf(l),g=l._zod.constr.prototype,x=h;for(;x&&x!==g;)x=Object.getPrototypeOf(x);let Z=x??h;o.has(Z)||(o.add(Z),fe(Z,c))}let m=f.prototype;for(let h in m)Object.prototype.hasOwnProperty.call(m,h)&&(h in l||(l[h]=m[h].bind(l)))}let u=n?.Parent??Object;class p extends u{}Object.defineProperty(p,"name",{value:e});function f(l){let d=n?.Parent?Ve(p):this;a(d,l);let m=d._zod.deferred;if(m){for(let g of m)g();d._zod.deferred=void 0}let h=globalThis.__zod_globalConfig?.postProcessor;return h&&h(d),d}return Object.defineProperty(f,"init",{value:a}),Object.defineProperty(f,Symbol.hasInstance,{value:l=>n?.Parent&&l instanceof n.Parent?!0:l?._zod?.traits?.has(e)}),Object.defineProperty(f,"name",{value:e}),f}var $=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}};(me=globalThis).__zod_globalConfig??(me.__zod_globalConfig={});var R=globalThis.__zod_globalConfig;function k(e){return e&&Object.assign(R,e),R}function We(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,oe,2)),e.message}function Ge(e){this._zod.message=e}var Xe={get:We,set:Ge,enumerable:!0,configurable:!0},X={value:void 0,enumerable:!1},_e=new WeakSet([Object.prototype,Error.prototype]),ge=(e,t)=>{e.name="$ZodError",X.value=t,Object.defineProperty(e,"issues",X),X.value=void 0,Object.defineProperty(e,"message",Xe);let r=Object.getPrototypeOf(e);_e.has(r)||(_e.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){let n=()=>this.message;return Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0}),n},set(n){Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0})}}))},Zt=_("$ZodError",ge),M=_("$ZodError",ge,void 0,{Parent:Error});var Ye=e=>{let t=(r,n,i,s)=>{let c=i?{...i,async:!1}:{async:!1},o=r._zod.run({value:n,issues:[]},c);if(o instanceof Promise)throw new $;if(o.issues.length){let a=new(s?.Err??e)(o.issues.map(u=>P(u,c,k())));throw U(a,s?.callee??t),a}return o.value};return t},H=Ye(M),Je=e=>{let t=async(r,n,i,s)=>{let c=i?{...i,async:!0}:{async:!0},o=r._zod.run({value:n,issues:[]},c);if(o instanceof Promise&&(o=await o),o.issues.length){let a=new(s?.Err??e)(o.issues.map(u=>P(u,c,k())));throw U(a,s?.callee??t),a}return o.value};return t},Y=Je(M),qe=e=>(t,r,n)=>{let i=n?{...n,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise)throw new $;return s.issues.length?xe(e,s.issues,i):{success:!0,data:s.value}},J=qe(M);function xe(e,t,r){let n;return{success:!1,get error(){return n||(n=new e(t.map(i=>P(i,r,k()))),t=void 0,r=void 0),n},set error(i){n=i,t=void 0,r=void 0}}}var Qe=e=>async(t,r,n)=>{let i=n?{...n,async:!0}:{async:!0},s=t._zod.run({value:r,issues:[]},i);return s instanceof Promise&&(s=await s),s.issues.length?xe(e,s.issues,i):{success:!0,data:s.value}},q=Qe(M);var $e=/^-?\d+(?:\.\d+)?$/,ze=/^(?:true|false)$/i;var C=_("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var be={number:"number",bigint:"bigint",object:"date"};var ye=_("$ZodCheckGreaterThan",(e,t)=>{C.init(e,t);let r=be[typeof t.value];e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:be[typeof n.value]??r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}});var Ze=_("$ZodCheckNumberFormat",(e,t)=>{C.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[i,s]=le[t.format];e._zod.check=c=>{let o=c.value;if(r){if(!Number.isInteger(o)){c.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:o,inst:e});return}if(!Number.isSafeInteger(o)){o>0?c.issues.push({input:o,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):c.issues.push({input:o,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}o<i&&c.issues.push({origin:"number",input:o,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),o>s&&c.issues.push({origin:"number",input:o,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}});var Pe={major:4,minor:6,patch:7};var A=_("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Pe;let n=e._zod.def.checks,i=e._zod.traits.has("$ZodCheck")?[e,...n??[]]:n?.length?[...n]:[];for(let s of i)for(let c of s._zod.onattach)c(e);if(i.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let s=(o,a,u)=>{if(o.memo)return o;let p=b(o),f;for(let l of a){if(l._zod.def.when){if(pe(o)||!l._zod.def.when(o))continue}else if(p)continue;let d=o.issues.length,m=l._zod.check(o);if(m instanceof Promise&&u?.async===!1)throw new $;if(f||m instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await m,o.issues.length!==d&&(K(o.issues,d,e),p||(p=b(o,d)))});else{if(o.issues.length===d)continue;K(o.issues,d,e),p||(p=b(o,d))}}return f?f.then(()=>o):o},c=(o,a,u)=>{if(b(o))return o.aborted=!0,o;let p=s(a,i,u);if(p instanceof Promise){if(u.async===!1)throw new $;return p.then(f=>e._zod.parse(f,u))}return e._zod.parse(p,u)};e._zod.run=(o,a)=>{if(a.skipChecks)return e._zod.parse(o,a);if(a.direction==="backward"){let p=e._zod.parse({value:o.value,issues:[]},{...a,skipChecks:!0});return p instanceof Promise?p.then(f=>c(f,o,a)):c(p,o,a)}let u=e._zod.parse(o,a);if(u instanceof Promise){if(a.async===!1)throw new $;return u.then(p=>s(p,i,a))}return s(u,i,a)}}},{get"~standard"(){return V(this,"~standard",nt(this))},set"~standard"(e){v(this,"~standard",e)}}),Ae=(e,t)=>e.issues.length?{issues:e.issues.map(r=>P(r,t,k()))}:{value:e.value};async function rt(e,t){let r={async:!0};return Ae(await e._zod.run({value:t,issues:[]},r),r)}function nt(e){return{validate:t=>{let r={async:!1};try{let n=e._zod.run({value:t,issues:[]},r);if(!(n instanceof Promise))return Ae(n,r)}catch{}return rt(e,t)},vendor:"zod",version:1}}var Q=_("$ZodNumber",(e,t)=>{A.init(e,t),e._zod.pattern=$e,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;let s=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:String(i):void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...s?{received:s}:{}}),r}}),Ee=_("$ZodNumberFormat",(e,t)=>{Ze.init(e,t),Q.init(e,t)}),Se=_("$ZodBoolean",(e,t)=>{A.init(e,t),e._zod.pattern=ze,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let i=r.value;return typeof i=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),r}});function O(e,t,r,n,i,s){let c=r in n,o=s==="optional";if(!(!c&&o&&i==="optional")){if(e.issues.length){if(i!==void 0&&o&&!c)return;t.issues.push(...B(r,e.issues))}if(!c&&i===void 0){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?(c||i==="defaulted"&&!o)&&(t.value[r]=void 0):t.value[r]=e.value}}var ot=[];function it(e){let t=Object.keys(e.shape),r=Object.getOwnPropertySymbols(e.shape),n=r.length?r:ot,i=n.length?[...t,...n]:t;for(let c of i)if(!e.shape?.[c]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${String(c)}": expected a Zod schema`);let s=ae(e.shape);return{...e,allKeys:i,symbolKeys:n,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(s)}}function st(e,t,r,n,i,s,c){let o=[],a=i.keySet,u=i.catchall._zod,p=u.def.type,f=u.optin,l=u.optout,d=0;for(let m in t){if(c&&r.issues.length!==d){if(b(r,d))break;d=r.issues.length}if(a.has(m))continue;if(m==="__proto__"){p==="never"&&o.push(m);continue}if(p==="never"){o.push(m);continue}let h=u.run({value:t[m],issues:[]},n);h instanceof Promise?e.push(h.then(g=>O(g,r,m,t,f,l))):O(h,r,m,t,f,l)}return o.length&&r.issues.push({code:"unrecognized_keys",keys:o,input:t,inst:s,continue:!0}),e.length?Promise.all(e).then(()=>r):r}var Me=_("$ZodObject",(e,t)=>{A.init(e,t);let r=Object.getOwnPropertyDescriptor(t,"shape"),n=r?.get?r.get.raw:t.shape??{};if(n){let u=()=>{let p={...n};return Object.defineProperty(t,"shape",{value:p}),u.raw=p,p};u.raw=n,Object.defineProperty(t,"shape",{get:u})}let i=ie(()=>it(t));S(e,"propValues",u=>{let p=u.def.shape,f={};for(let l in p){let d=p[l]._zod;if(d.values){Object.prototype.hasOwnProperty.call(f,l)||ce(f,l,new Set);for(let m of d.values)f[l].add(m);d.optin!==void 0&&f[l].add(void 0)}}return f});let s=ue,c=t.catchall,o,a=R.memoizer;a?.attach(e),e._zod.parse=(u,p)=>{o??(o=i.value);let f=u.value;if(!s(f))return u.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),u;u.value=a?a.alloc(e,u,{},p):{};let l=[],d=o.shape,m=p?.abortEarly,h=u.issues.length;for(let g of o.allKeys){if(m&&u.issues.length!==h){if(b(u,h))break;h=u.issues.length}if(g==="__proto__")continue;let x=d[g],Z=x._zod.optin,ne=x._zod.optout,L=x._zod.run({value:f[g],issues:[]},p);L instanceof Promise?l.push(L.then(Fe=>O(Fe,u,g,f,Z,ne))):O(L,u,g,f,Z,ne)}return c?st(l,f,u,p,i.value,e,m===!0):l.length?Promise.all(l).then(()=>u):u}});function ke(e,t){return e.value=t.issues.length?void 0:t.value,e}var Ce=_("$ZodOptional",(e,t)=>{A.init(e,t),S(e,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",S(e,"values",r=>{let n=r.def.innerType._zod.values;return n?new Set([...n,void 0]):void 0}),S(e,"pattern",r=>{let n=r.def.innerType._zod.pattern;return n?new RegExp(`^(${se(n.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(r.value===void 0){if(t.innerType._zod.optin!=="defaulted")return r;let i=t.innerType._zod.run({value:r.value,issues:[]},n);return i instanceof Promise?i.then(s=>ke(r,s)):ke(r,i)}return t.innerType._zod.run(r,n)}});function Ie(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...w(t)})}function Re(e,t){return new e({type:"boolean",...w(t)})}function ee(e,t){return new ye({check:"greater_than",...w(t),value:e,inclusive:!0})}function te(e){return ee(0,e)}var T=_("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");A.init(e,t),e.def=t,e.type=t.type},{get with(){return this.check},set with(e){v(this,"with",e)},parse(e,t){return H(this,e,t,{callee:this.parse})},parseAsync(e,t){return Y(this,e,t,{callee:this.parseAsync})},safeParse(e,t){return J(this,e,t)},safeParseAsync(e,t){return q(this,e,t)},check(...e){let t=this.def;return this.clone({...t,checks:[...t.checks??[],...e.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]},{parent:!0})},clone(e,t){return I(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},apply(e,...t){return t.length===0?e(this):e(this,...t)}});var at=_("ZodMiniNumber",(e,t)=>{Q.init(e,t),T.init(e,t)});var lt=_("ZodMiniNumberFormat",(e,t)=>{Ee.init(e,t),at.init(e,t)});function Oe(e){return Ie(lt,e)}var pt=_("ZodMiniBoolean",(e,t)=>{Se.init(e,t),T.init(e,t)});function Te(e){return Re(pt,e)}var ft=_("ZodMiniObject",(e,t)=>{Me.init(e,t),T.init(e,t),de(e,"shape",r=>r._zod.def.shape,!1)});function D(e,t){let r={type:"object",shape:e??{},...w(t)};return new ft(r)}var dt=_("ZodMiniOptional",(e,t)=>{Ce.init(e,t),T.init(e,t)});function De(e){return new dt({type:"optional",innerType:e})}var j=(e,t)=>({kind:"notification",method:e,params:t});var re=j("artifact/notifications/present",D({on:Te(),slide:De(Oe().check(te()))})),je=j("artifact/notifications/exit-present",D({})),Le=j("artifact/notifications/escape",D({}));var ht="ui/notifications/sandbox-proxy-ready",_t="ui/notifications/sandbox-resource-ready",gt="allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox",xt={camera:"camera",microphone:"microphone",geolocation:"geolocation",clipboardWrite:"clipboard-write"},$t=e=>new Set((e.querySelector('meta[name="open-artifact-hosts"]')?.getAttribute("content")??"").split(/\s+/).filter(Boolean)),zt=e=>!!e&&typeof e=="object"&&"method"in e&&e.method===_t,vt=(e,{params:t})=>{typeof t.sandbox=="string"&&e.setAttribute("sandbox",t.sandbox);let r=Object.keys(t.permissions??{}).map(n=>xt[n]).filter(Boolean);r.length>0&&e.setAttribute("allow",r.join("; ")),typeof t.html=="string"&&(e.srcdoc=t.html)},Ne=e=>{let{document:t}=e;if(e.self===e.top)throw new Error("The artifact sandbox only runs inside a frame.");let r=t.referrer?new URL(t.referrer).origin:"";if(!$t(t).has(r))throw new Error(`Embedding from ${r||"an unknown origin"} is not allowed.`);let n=r,i=e.location.origin,s=!1,c=t.createElement("iframe");c.setAttribute("sandbox",gt),c.title="Artifact",t.body.append(c),e.addEventListener("focus",()=>{c.focus(),c.contentWindow?.focus()}),e.addEventListener("keydown",o=>{if(o.key!=="Escape"||o.defaultPrevented)return;let a={},u=s?je.method:Le.method;e.parent.postMessage({jsonrpc:"2.0",method:u,params:a},n)}),e.addEventListener("message",o=>{if(o.source===e.parent){if(o.origin!==n)return;if(zt(o.data))s=!1,vt(c,o.data);else{if(o.data?.method===re.method){let a=re.params.safeParse(o.data.params);a.success&&(s=a.data.on)}c.contentWindow?.postMessage(o.data,"*")}}else o.source===c.contentWindow&&o.origin===i&&e.parent.postMessage(o.data,n)}),e.parent.postMessage({jsonrpc:"2.0",method:ht,params:{}},n)};Ne(window);})();
@@ -0,0 +1,4 @@
1
+ import type { CommentRow, ThreadActivity, ThreadRow } from "../ports.js";
2
+ /** Thread activity from rows already read, for adapters without a grouping query. */
3
+ export declare const activityFrom: (artifactIds: readonly string[], threads: readonly ThreadRow[], comments: readonly CommentRow[]) => ThreadActivity[];
4
+ //# sourceMappingURL=activity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"activity.d.ts","sourceRoot":"","sources":["../../../src/server/adapters/activity.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAIxE,qFAAqF;AACrF,eAAO,MAAM,YAAY,gBACV,SAAS,MAAM,EAAE,WACrB,SAAS,SAAS,EAAE,YACnB,SAAS,UAAU,EAAE,KAC9B,cAAc,EAmBb,CAAA"}
@@ -0,0 +1,25 @@
1
+ const PEOPLE = 5;
2
+ /** Thread activity from rows already read, for adapters without a grouping query. */
3
+ export const activityFrom = (artifactIds, threads, comments) => artifactIds.flatMap((artifactId) => {
4
+ const own = threads.filter((thread) => thread.artifactId === artifactId);
5
+ if (own.length === 0)
6
+ return [];
7
+ const people = new Map();
8
+ for (const comment of comments
9
+ .filter((row) => row.artifactId === artifactId)
10
+ .toSorted((a, b) => b.createdAt.localeCompare(a.createdAt))) {
11
+ if (people.size === PEOPLE)
12
+ break;
13
+ if (!people.has(comment.author.id))
14
+ people.set(comment.author.id, comment.author);
15
+ }
16
+ return [
17
+ {
18
+ artifactId,
19
+ open: own.filter((thread) => thread.state === "open").length,
20
+ total: own.length,
21
+ people: [...people.values()],
22
+ },
23
+ ];
24
+ });
25
+ //# sourceMappingURL=activity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"activity.js","sourceRoot":"","sources":["../../../src/server/adapters/activity.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,GAAG,CAAC,CAAA;AAEhB,qFAAqF;AACrF,MAAM,CAAC,MAAM,YAAY,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export declare const silentBus: Bus;
4
+ /** In-process fan-out. Correct for one server process; use a shared bus to scale out. */
5
+ export declare const memoryBus: () => Bus;
6
+ //# sourceMappingURL=memory-bus.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memory-bus.d.ts","sourceRoot":"","sources":["../../../src/server/adapters/memory-bus.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAY,MAAM,aAAa,CAAA;AAEhD,mFAAmF;AACnF,eAAO,MAAM,SAAS,EAAE,GAGvB,CAAA;AAED,yFAAyF;AACzF,eAAO,MAAM,SAAS,QAAO,GAgB5B,CAAA"}
@@ -0,0 +1,26 @@
1
+ /** No fan-out, for a server with live updates off: nothing publishes to anyone. */
2
+ export const silentBus = {
3
+ publish: async () => undefined,
4
+ subscribe: () => () => undefined,
5
+ };
6
+ /** In-process fan-out. Correct for one server process; use a shared bus to scale out. */
7
+ export const memoryBus = () => {
8
+ const channels = new Map();
9
+ return {
10
+ publish: async (event) => {
11
+ for (const listener of channels.get(event.artifactId) ?? [])
12
+ listener(event);
13
+ },
14
+ subscribe: (artifactId, listener) => {
15
+ const listeners = channels.get(artifactId) ?? new Set();
16
+ listeners.add(listener);
17
+ channels.set(artifactId, listeners);
18
+ return () => {
19
+ listeners.delete(listener);
20
+ if (listeners.size === 0)
21
+ channels.delete(artifactId);
22
+ };
23
+ },
24
+ };
25
+ };
26
+ //# sourceMappingURL=memory-bus.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memory-bus.js","sourceRoot":"","sources":["../../../src/server/adapters/memory-bus.ts"],"names":[],"mappings":"AAEA,mFAAmF;AACnF,MAAM,CAAC,MAAM,SAAS,GAAQ;IAC5B,OAAO,EAAE,KAAK,IAAI,EAAE,CAAC,SAAS;IAC9B,SAAS,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,SAAS;CACjC,CAAA;AAED,yFAAyF;AACzF,MAAM,CAAC,MAAM,SAAS,GAAG,GAAQ,EAAE;IACjC,MAAM,QAAQ,GAAG,IAAI,GAAG,EAA0C,CAAA;IAClE,OAAO;QACL,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;YACvB,KAAK,MAAM,QAAQ,IAAI,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,EAAE;gBAAE,QAAQ,CAAC,KAAK,CAAC,CAAA;QAC9E,CAAC;QACD,SAAS,EAAE,CAAC,UAAU,EAAE,QAAQ,EAAE,EAAE;YAClC,MAAM,SAAS,GAAG,QAAQ,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,IAAI,GAAG,EAAE,CAAA;YACvD,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;YACvB,QAAQ,CAAC,GAAG,CAAC,UAAU,EAAE,SAAS,CAAC,CAAA;YACnC,OAAO,GAAG,EAAE;gBACV,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;gBAC1B,IAAI,SAAS,CAAC,IAAI,KAAK,CAAC;oBAAE,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,CAAA;YACvD,CAAC,CAAA;QACH,CAAC;KACF,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,4 @@
1
+ import type { ArtifactStore } from "../ports.js";
2
+ /** An in-memory store for tests, demos, and single-process prototypes. */
3
+ export declare const memoryStore: () => ArtifactStore;
4
+ //# sourceMappingURL=memory-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memory-store.d.ts","sourceRoot":"","sources":["../../../src/server/adapters/memory-store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAGV,aAAa,EAMd,MAAM,aAAa,CAAA;AAmJpB,0EAA0E;AAC1E,eAAO,MAAM,WAAW,QAAO,aAU9B,CAAA"}
@@ -0,0 +1,125 @@
1
+ import { activityFrom } from "./activity.js";
2
+ const copy = (value) => structuredClone(value);
3
+ const append = (map, key, row) => map.set(key, [...(map.get(key) ?? []), copy(row)]);
4
+ const stateKey = (artifactId, key) => `${artifactId}\u0000${key}`;
5
+ const withVersion = (artifact, version, facts) => copy({
6
+ ...artifact,
7
+ currentVersion: version.n,
8
+ updatedAt: version.createdAt,
9
+ updatedBy: version.createdBy,
10
+ summary: facts.summary,
11
+ kind: facts.kind,
12
+ title: facts.title ?? artifact.title,
13
+ });
14
+ const artifactTables = (t) => ({
15
+ createArtifact: async (artifact, first) => {
16
+ t.artifacts.set(artifact.id, copy(artifact));
17
+ t.versions.set(artifact.id, [copy(first)]);
18
+ },
19
+ getArtifact: async (id) => copy(t.artifacts.get(id) ?? null),
20
+ listArtifacts: async ({ space, limit, after, search, createdBy }) => [...t.artifacts.values()]
21
+ .filter((row) => row.space === space)
22
+ .filter((row) => createdBy === undefined || row.createdBy.id === createdBy)
23
+ .filter((row) => !search ||
24
+ row.title.toLowerCase().includes(search.toLowerCase()) ||
25
+ row.summary.toLowerCase().includes(search.toLowerCase()))
26
+ .toSorted((a, b) => b.updatedAt.localeCompare(a.updatedAt) || b.id.localeCompare(a.id))
27
+ .filter((row) => !after ||
28
+ row.updatedAt < after.updatedAt ||
29
+ (row.updatedAt === after.updatedAt && row.id < after.id))
30
+ .slice(0, limit)
31
+ .map(copy),
32
+ addVersion: async (version, expected, facts) => {
33
+ const artifact = t.artifacts.get(version.artifactId);
34
+ if (!artifact || artifact.currentVersion !== expected || version.n !== expected + 1)
35
+ return null;
36
+ t.artifacts.set(artifact.id, withVersion(artifact, version, facts));
37
+ append(t.versions, artifact.id, version);
38
+ return copy(version);
39
+ },
40
+ replaceVersion: async (version, expectedHash, facts) => {
41
+ const artifact = t.artifacts.get(version.artifactId);
42
+ const versions = t.versions.get(version.artifactId) ?? [];
43
+ const at = versions.findIndex((row) => row.n === version.n);
44
+ if (!artifact ||
45
+ artifact.currentVersion !== version.n ||
46
+ versions[at]?.contentHash !== expectedHash)
47
+ return null;
48
+ t.versions.set(artifact.id, versions.with(at, copy(version)));
49
+ t.artifacts.set(artifact.id, withVersion(artifact, version, facts));
50
+ return copy(version);
51
+ },
52
+ getVersion: async (artifactId, n) => copy(t.versions.get(artifactId)?.find((version) => version.n === n) ?? null),
53
+ listVersions: async (artifactId) => (t.versions.get(artifactId) ?? []).map(copy),
54
+ renameArtifact: async (id, title) => {
55
+ const artifact = t.artifacts.get(id);
56
+ if (!artifact)
57
+ return false;
58
+ t.artifacts.set(id, { ...artifact, title });
59
+ return true;
60
+ },
61
+ deleteArtifact: async (id) => {
62
+ if (!t.artifacts.delete(id))
63
+ return false;
64
+ for (const map of [t.versions, t.threads, t.comments])
65
+ map.delete(id);
66
+ const prefix = stateKey(id, "");
67
+ for (const map of [t.states, t.activity])
68
+ for (const key of map.keys())
69
+ if (key.startsWith(prefix))
70
+ map.delete(key);
71
+ return true;
72
+ },
73
+ });
74
+ const threadTables = (t) => ({
75
+ createThread: async (thread, first) => {
76
+ append(t.threads, thread.artifactId, thread);
77
+ append(t.comments, thread.artifactId, first);
78
+ },
79
+ addComment: async (comment) => {
80
+ append(t.comments, comment.artifactId, comment);
81
+ },
82
+ setThreadState: async (artifactId, threadId, state) => {
83
+ const rows = t.threads.get(artifactId) ?? [];
84
+ const at = rows.findIndex((row) => row.id === threadId);
85
+ const row = rows[at];
86
+ if (!row)
87
+ return false;
88
+ t.threads.set(artifactId, rows.with(at, { ...row, state }));
89
+ return true;
90
+ },
91
+ listThreads: async (artifactId) => ({
92
+ threads: (t.threads.get(artifactId) ?? []).map(copy),
93
+ comments: (t.comments.get(artifactId) ?? []).map(copy),
94
+ }),
95
+ threadActivity: async (artifactIds) => activityFrom(artifactIds, artifactIds.flatMap((id) => t.threads.get(id) ?? []), artifactIds.flatMap((id) => t.comments.get(id) ?? [])).map(copy),
96
+ });
97
+ const stateTables = (t) => ({
98
+ getState: async (artifactId, key) => copy(t.states.get(stateKey(artifactId, key)) ?? null),
99
+ countStateKeys: async (artifactId) => [...t.states.values()].filter((row) => row.artifactId === artifactId).length,
100
+ putState: async (row, expected) => {
101
+ const current = t.states.get(stateKey(row.artifactId, row.key));
102
+ if ((current?.version ?? 0) !== expected)
103
+ return false;
104
+ t.states.set(stateKey(row.artifactId, row.key), copy(row));
105
+ return true;
106
+ },
107
+ appendActivity: async (row, keep) => {
108
+ const key = stateKey(row.artifactId, row.key);
109
+ t.activity.set(key, [copy(row), ...(t.activity.get(key) ?? [])].slice(0, keep));
110
+ },
111
+ listActivity: async (artifactId, key, limit) => (t.activity.get(stateKey(artifactId, key)) ?? []).slice(0, limit).map(copy),
112
+ });
113
+ /** An in-memory store for tests, demos, and single-process prototypes. */
114
+ export const memoryStore = () => {
115
+ const tables = {
116
+ artifacts: new Map(),
117
+ versions: new Map(),
118
+ threads: new Map(),
119
+ comments: new Map(),
120
+ states: new Map(),
121
+ activity: new Map(),
122
+ };
123
+ return { ...artifactTables(tables), ...threadTables(tables), ...stateTables(tables) };
124
+ };
125
+ //# sourceMappingURL=memory-store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memory-store.js","sourceRoot":"","sources":["../../../src/server/adapters/memory-store.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAW5C,MAAM,IAAI,GAAG,CAAI,KAAQ,EAAK,EAAE,CAAC,eAAe,CAAC,KAAK,CAAC,CAAA;AACvD,MAAM,MAAM,GAAG,CAAI,GAAqB,EAAE,GAAW,EAAE,GAAM,EAAE,EAAE,CAC/D,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;AACpD,MAAM,QAAQ,GAAG,CAAC,UAAkB,EAAE,GAAW,EAAE,EAAE,CAAC,GAAG,UAAU,SAAS,GAAG,EAAE,CAAA;AAEjF,MAAM,WAAW,GAAG,CAClB,QAAqB,EACrB,OAAmB,EACnB,KAAmB,EACN,EAAE,CACf,IAAI,CAAC;IACH,GAAG,QAAQ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QAAQ,CAAC,GAAG,CAAC,UAAU,EAAE,GAAG,CAAC,GAAG,CAAC,CAAA;QAC7C,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAA;IACjF,CAAC;IACD,YAAY,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,CAC7C,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC;CAC9E,CAAkC,CAAA;AAErC,0EAA0E;AAC1E,MAAM,CAAC,MAAM,WAAW,GAAG,GAAkB,EAAE;IAC7C,MAAM,MAAM,GAAW;QACrB,SAAS,EAAE,IAAI,GAAG,EAAE;QACpB,QAAQ,EAAE,IAAI,GAAG,EAAE;QACnB,OAAO,EAAE,IAAI,GAAG,EAAE;QAClB,QAAQ,EAAE,IAAI,GAAG,EAAE;QACnB,MAAM,EAAE,IAAI,GAAG,EAAE;QACjB,QAAQ,EAAE,IAAI,GAAG,EAAE;KACpB,CAAA;IACD,OAAO,EAAE,GAAG,cAAc,CAAC,MAAM,CAAC,EAAE,GAAG,YAAY,CAAC,MAAM,CAAC,EAAE,GAAG,WAAW,CAAC,MAAM,CAAC,EAAE,CAAA;AACvF,CAAC,CAAA"}
@@ -0,0 +1,8 @@
1
+ import type { BlobStore, WiredBackend } from "../ports.js";
2
+ import { memoryBus } from "./memory-bus.js";
3
+ import { memoryStore } from "./memory-store.js";
4
+ export declare const memoryBlobs: () => BlobStore;
5
+ /** Everything in memory: tests, demos, and single-process prototypes. */
6
+ export declare const memory: () => WiredBackend;
7
+ export { memoryBus, memoryStore };
8
+ //# sourceMappingURL=memory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../../src/server/adapters/memory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,SAAS,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAE/C,eAAO,MAAM,WAAW,QAAO,SAW9B,CAAA;AAED,yEAAyE;AACzE,eAAO,MAAM,MAAM,QAAO,YAIxB,CAAA;AAEF,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,CAAA"}
@@ -0,0 +1,23 @@
1
+ import { memoryBus } from "./memory-bus.js";
2
+ import { memoryStore } from "./memory-store.js";
3
+ export const memoryBlobs = () => {
4
+ const blobs = new Map();
5
+ return {
6
+ put: async (key, blob) => {
7
+ if (!blobs.has(key))
8
+ blobs.set(key, { bytes: blob.bytes.slice(), type: blob.type });
9
+ },
10
+ get: async (key) => {
11
+ const blob = blobs.get(key);
12
+ return blob ? { bytes: blob.bytes.slice(), type: blob.type } : null;
13
+ },
14
+ };
15
+ };
16
+ /** Everything in memory: tests, demos, and single-process prototypes. */
17
+ export const memory = () => ({
18
+ store: memoryStore(),
19
+ blobs: memoryBlobs(),
20
+ bus: memoryBus(),
21
+ });
22
+ export { memoryBus, memoryStore };
23
+ //# sourceMappingURL=memory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memory.js","sourceRoot":"","sources":["../../../src/server/adapters/memory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAE/C,MAAM,CAAC,MAAM,WAAW,GAAG,GAAc,EAAE;IACzC,MAAM,KAAK,GAAG,IAAI,GAAG,EAAgB,CAAA;IACrC,OAAO;QACL,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;YACvB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC;gBAAE,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAA;QACrF,CAAC;QACD,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE;YACjB,MAAM,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;YAC3B,OAAO,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAA;QACrE,CAAC;KACF,CAAA;AACH,CAAC,CAAA;AAED,yEAAyE;AACzE,MAAM,CAAC,MAAM,MAAM,GAAG,GAAiB,EAAE,CAAC,CAAC;IACzC,KAAK,EAAE,WAAW,EAAE;IACpB,KAAK,EAAE,WAAW,EAAE;IACpB,GAAG,EAAE,SAAS,EAAE;CACjB,CAAC,CAAA;AAEF,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,CAAA"}
@@ -0,0 +1,6 @@
1
+ import type { BlobStore } from "../../ports.js";
2
+ import type { SqlClient, Tables } from "./client.js";
3
+ /** Blobs in the same database: no bucket to provision. Bytes cross the driver as base64 so
4
+ * every driver behaves the same; move to an S3-compatible store when files get large. */
5
+ export declare const postgresBlobsOn: (sql: SqlClient, t: Tables) => BlobStore;
6
+ //# sourceMappingURL=blobs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blobs.d.ts","sourceRoot":"","sources":["../../../../src/server/adapters/postgres/blobs.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEpD;0FAC0F;AAC1F,eAAO,MAAM,eAAe,QAAS,SAAS,KAAK,MAAM,KAAG,SAkB1D,CAAA"}
@@ -0,0 +1,17 @@
1
+ import { fromBase64, toBase64 } from "../../core/base64.js";
2
+ /** Blobs in the same database: no bucket to provision. Bytes cross the driver as base64 so
3
+ * every driver behaves the same; move to an S3-compatible store when files get large. */
4
+ export const postgresBlobsOn = (sql, t) => ({
5
+ put: async (key, blob) => {
6
+ await sql.query(`INSERT INTO ${t.blobs} (key, type, bytes) VALUES ($1, $2, decode($3, 'base64'))
7
+ ON CONFLICT DO NOTHING`, [key, blob.type, toBase64(blob.bytes)]);
8
+ },
9
+ get: async (key) => {
10
+ const { rows } = await sql.query(`SELECT type, encode(bytes, 'base64') AS data FROM ${t.blobs} WHERE key = $1`, [key]);
11
+ const row = rows[0];
12
+ return row
13
+ ? { type: String(row["type"]), bytes: fromBase64(String(row["data"]).replace(/\s+/g, "")) }
14
+ : null;
15
+ },
16
+ });
17
+ //# sourceMappingURL=blobs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blobs.js","sourceRoot":"","sources":["../../../../src/server/adapters/postgres/blobs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAI3D;0FAC0F;AAC1F,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,GAAc,EAAE,CAAS,EAAa,EAAE,CAAC,CAAC;IACxE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;QACvB,MAAM,GAAG,CAAC,KAAK,CACb,eAAe,CAAC,CAAC,KAAK;8BACE,EACxB,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CACvC,CAAA;IACH,CAAC;IACD,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE;QACjB,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,GAAG,CAAC,KAAK,CAC9B,qDAAqD,CAAC,CAAC,KAAK,iBAAiB,EAC7E,CAAC,GAAG,CAAC,CACN,CAAA;QACD,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;QACnB,OAAO,GAAG;YACR,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,EAAE;YAC3F,CAAC,CAAC,IAAI,CAAA;IACV,CAAC;CACF,CAAC,CAAA"}
@@ -0,0 +1,7 @@
1
+ import { type Bus } from "../../ports.js";
2
+ import type { SqlClient, SqlListen, Tables } from "./client.js";
3
+ /** Live fan-out across every instance through Postgres LISTEN/NOTIFY: one channel, one
4
+ * listener per instance, local dispatch by artifact. Each envelope is parsed once and the
5
+ * same object reaches every local subscriber, so hydration is shared too. */
6
+ export declare const postgresBusOn: (sql: SqlClient, t: Tables, listen: SqlListen, onError?: (error: unknown) => void) => Bus;
7
+ //# sourceMappingURL=bus.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bus.d.ts","sourceRoot":"","sources":["../../../../src/server/adapters/postgres/bus.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAAiC,MAAM,gBAAgB,CAAA;AACxE,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAK/D;;8EAE8E;AAC9E,eAAO,MAAM,aAAa,QACnB,SAAS,KACX,MAAM,UACD,SAAS,YACR,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,KAChC,GAiDF,CAAA"}
@@ -0,0 +1,60 @@
1
+ import { busEventSchema } from "../../ports.js";
2
+ /** NOTIFY carries at most 8000 bytes; envelopes are far smaller, but never risk it. */
3
+ const MAX_PAYLOAD = 7_900;
4
+ /** Live fan-out across every instance through Postgres LISTEN/NOTIFY: one channel, one
5
+ * listener per instance, local dispatch by artifact. Each envelope is parsed once and the
6
+ * same object reaches every local subscriber, so hydration is shared too. */
7
+ export const postgresBusOn = (sql, t, listen, onError = () => { }) => {
8
+ const channels = new Map();
9
+ const dispatch = (payload) => {
10
+ let raw;
11
+ try {
12
+ raw = JSON.parse(payload);
13
+ }
14
+ catch (error) {
15
+ onError(error);
16
+ return;
17
+ }
18
+ const parsed = busEventSchema.safeParse(raw);
19
+ if (!parsed.success) {
20
+ onError(new Error(`Ignored a live event that does not parse: ${parsed.error.message}`));
21
+ return;
22
+ }
23
+ const event = parsed.data;
24
+ for (const listener of channels.get(event.artifactId) ?? [])
25
+ listener(event);
26
+ };
27
+ // LISTEN starts on first use, so building the kit opens no connection. A failed attempt is
28
+ // forgotten, and the next publish or subscribe tries again.
29
+ let listening;
30
+ const ensureListening = () => {
31
+ listening ??= listen(t.channel, dispatch).catch((error) => {
32
+ listening = undefined;
33
+ throw error;
34
+ });
35
+ return listening;
36
+ };
37
+ return {
38
+ publish: async (event) => {
39
+ const payload = JSON.stringify(event);
40
+ if (payload.length > MAX_PAYLOAD)
41
+ throw new Error("Live event is too large for NOTIFY.");
42
+ await ensureListening();
43
+ await sql.query("SELECT pg_notify($1, $2)", [t.channel, payload]);
44
+ },
45
+ subscribe: (artifactId, listener) => {
46
+ // A subscriber cannot wait. A failed LISTEN goes to onError now, and the next publish
47
+ // or subscribe tries again.
48
+ ensureListening().catch(onError);
49
+ const listeners = channels.get(artifactId) ?? new Set();
50
+ listeners.add(listener);
51
+ channels.set(artifactId, listeners);
52
+ return () => {
53
+ listeners.delete(listener);
54
+ if (listeners.size === 0)
55
+ channels.delete(artifactId);
56
+ };
57
+ },
58
+ };
59
+ };
60
+ //# sourceMapp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EAAE,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;YACjE,SAAS,GAAG,SAAS,CAAA;YACrB,MAAM,KAAK,CAAA;QACb,CAAC,CAAC,CAAA;QACF,OAAO,SAAS,CAAA;IAClB,CAAC,CAAA;IAED,OAAO;QACL,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;YACvB,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;YACrC,IAAI,OAAO,CAAC,MAAM,GAAG,WAAW;gBAAE,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAA;YACxF,MAAM,eAAe,EAAE,CAAA;YACvB,MAAM,GAAG,CAAC,KAAK,CAAC,0BAA0B,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAA;QACnE,CAAC;QACD,SAAS,EAAE,CAAC,UAAU,EAAE,QAAQ,EAAE,EAAE;YAClC,sFAAsF;YACtF,4BAA4B;YAC5B,eAAe,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;YAChC,MAAM,SAAS,GAAG,QAAQ,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,IAAI,GAAG,EAAE,CAAA;YACvD,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;YACvB,QAAQ,CAAC,GAAG,CAAC,UAAU,EAAE,SAAS,CAAC,CAAA;YACnC,OAAO,GAAG,EAAE;gBACV,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;gBAC1B,IAAI,SAAS,CAAC,IAAI,KAAK,CAAC;oBAAE,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,CAAA;YACvD,CAAC,CAAA;QACH,CAAC;KACF,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,38 @@
1
+ /** The only thing the Postgres adapter needs from you: run one parameterized statement
2
+ * (`$1`, `$2`, …) and return its rows. Every write the kit makes is a single atomic
3
+ * statement, so no transaction API is required, and HTTP drivers work as well as pools.
4
+ *
5
+ * pg: { query: (text, params) => pool.query(text, params) }
6
+ * postgres.js: { query: async (text, params) => ({ rows: await sql.unsafe(text, params) }) }
7
+ * PGlite: { query: (text, params) => db.query(text, params) }
8
+ * Neon (HTTP): { query: async (text, params) => ({ rows: await neon(url).query(text, params) }) }
9
+ */
10
+ export interface SqlClient {
11
+ query(text: string, params?: unknown[]): Promise<{
12
+ rows: Record<string, unknown>[];
13
+ }>;
14
+ }
15
+ /** Optional: LISTEN for live events across instances. Return a function that stops.
16
+ *
17
+ * postgres.js: (channel, on) => sql.listen(channel, on).then(({ unlisten }) => unlisten)
18
+ * PGlite: (channel, on) => db.listen(channel, on)
19
+ * pg: see the README recipe (a dedicated client with `LISTEN` and `notification`)
20
+ */
21
+ export type SqlListen = (channel: string, onPayload: (payload: string) => void) => Promise<() => Promise<void> | void>;
22
+ /** Fully qualified table names for a schema and prefix, validated so they are safe to
23
+ * splice into SQL. */
24
+ export declare const tableNames: (schema: string, prefix: string) => {
25
+ artifacts: string;
26
+ versions: string;
27
+ threads: string;
28
+ comments: string;
29
+ states: string;
30
+ activity: string;
31
+ blobs: string;
32
+ migrations: string;
33
+ /** Index names are schema-local, so they are not qualified. */
34
+ index: (name: string) => string;
35
+ channel: string;
36
+ };
37
+ export type Tables = ReturnType<typeof tableNames>;
38
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../src/server/adapters/postgres/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,WAAW,SAAS;IACxB,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;KAAE,CAAC,CAAA;CACtF;AAED;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GAAG,CACtB,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,KACjC,OAAO,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAA;AAIxC;uBACuB;AACvB,eAAO,MAAM,UAAU,WAAY,MAAM,UAAU,MAAM;IAKrD,SAAS;IACT,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,MAAM;IACN,QAAQ;IACR,KAAK;IACL,UAAU;IACV,+DAA+D;IAC/D,KAAK,SAAS,MAAM;IACpB,OAAO;CAEV,CAAA;AAED,MAAM,MAAM,MAAM,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAA"}
@@ -0,0 +1,22 @@
1
+ const IDENTIFIER = /^[a-z_][a-z0-9_]{0,40}$/;
2
+ /** Fully qualified table names for a schema and prefix, validated so they are safe to
3
+ * splice into SQL. */
4
+ export const tableNames = (schema, prefix) => {
5
+ if (!IDENTIFIER.test(schema) || !(prefix === "" || IDENTIFIER.test(prefix)))
6
+ throw new Error("schema and prefix must be lowercase SQL identifiers");
7
+ const t = (name) => `"${schema}"."${prefix}${name}"`;
8
+ return {
9
+ artifacts: t("artifacts"),
10
+ versions: t("versions"),
11
+ threads: t("threads"),
12
+ comments: t("comments"),
13
+ states: t("states"),
14
+ activity: t("activity"),
15
+ blobs: t("blobs"),
16
+ migrations: t("migrations"),
17
+ /** Index names are schema-local, so they are not qualified. */
18
+ index: (name) => `"${prefix}${name}"`,
19
+ channel: `${prefix}events`,
20
+ };
21
+ };
22
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../src/server/adapters/postgres/client.ts"],"names":[],"mappings":"AAwBA,MAAM,UAAU,GAAG,yBAAyB,CAAA;AAE5C;uBACuB;AACvB,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,MAAc,EAAE,MAAc,EAAE,EAAE;IAC3D,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,KAAK,EAAE,IAAI,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACzE,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAA;IACxE,MAAM,CAAC,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,MAAM,MAAM,MAAM,GAAG,IAAI,GAAG,CAAA;IAC5D,OAAO;QACL,SAAS,EAAE,CAAC,CAAC,WAAW,CAAC;QACzB,QAAQ,EAAE,CAAC,CAAC,UAAU,CAAC;QACvB,OAAO,EAAE,CAAC,CAAC,SAAS,CAAC;QACrB,QAAQ,EAAE,CAAC,CAAC,UAAU,CAAC;QACvB,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC;QACnB,QAAQ,EAAE,CAAC,CAAC,UAAU,CAAC;QACvB,KAAK,EAAE,CAAC,CAAC,OAAO,CAAC;QACjB,UAAU,EAAE,CAAC,CAAC,YAAY,CAAC;QAC3B,+DAA+D;QAC/D,KAAK,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,MAAM,GAAG,IAAI,GAAG;QAC7C,OAAO,EAAE,GAAG,MAAM,QAAQ;KAC3B,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,29 @@
1
+ import type { WiredBackend } from "../../ports.js";
2
+ import { type SqlClient, type SqlListen } from "./client.js";
3
+ export type { SqlClient, SqlListen };
4
+ export interface PostgresOptions {
5
+ /** Runs one parameterized statement. See `SqlClient` for one-line recipes per driver. */
6
+ sql: SqlClient;
7
+ /** LISTEN for live events across instances. Without it, live events stay in-process. */
8
+ listen?: SqlListen;
9
+ /** Defaults to "public". */
10
+ schema?: string;
11
+ /** Prefix for every table, so the kit sits beside your own. Defaults to "oa_". */
12
+ prefix?: string;
13
+ /** Live-event failures with no caller to answer to: a failed LISTEN, a payload that does
14
+ * not parse. Pass the same handler as the server's `onError`. */
15
+ onError?: (error: unknown) => void;
16
+ }
17
+ /** Artifacts, files, and live events on the Postgres you already run. No other service and
18
+ * no driver dependency: bring any client with a `query` function. */
19
+ export declare const postgres: (options: PostgresOptions) => WiredBackend & {
20
+ /** Create or upgrade the tables atomically. Run during deployment. */
21
+ migrate: () => Promise<void>;
22
+ /** Read-only schema gate for application startup. */
23
+ assertMigrated: () => Promise<void>;
24
+ /** Atomic migration SQL, including the ledger, for a host deployment runner. */
25
+ migrationSql: () => string;
26
+ /** The schema as SQL, if you run your own migration tool instead. */
27
+ schemaSql: () => string;
28
+ };
29
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/server/adapters/postgres/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAIlD,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAc,MAAM,aAAa,CAAA;AAIxE,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,CAAA;AAEpC,MAAM,WAAW,eAAe;IAC9B,yFAAyF;IACzF,GAAG,EAAE,SAAS,CAAA;IACd,wFAAwF;IACxF,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,4BAA4B;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,kFAAkF;IAClF,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;sEACkE;IAClE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAA;CACnC;AAED;sEACsE;AACtE,eAAO,MAAM,QAAQ,YACV,eAAe,KACvB,YAAY,GAAG;IAChB,sEAAsE;IACtE,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;IAC5B,qDAAqD;IACrD,cAAc,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;IACnC,gFAAgF;IAChF,YAAY,EAAE,MAAM,MAAM,CAAA;IAC1B,qEAAqE;IACrE,SAAS,EAAE,MAAM,MAAM,CAAA;CAcxB,CAAA"}
@@ -0,0 +1,23 @@
1
+ import { memoryBus } from "../memory-bus.js";
2
+ import { postgresBlobsOn } from "./blobs.js";
3
+ import { postgresBusOn } from "./bus.js";
4
+ import { tableNames } from "./client.js";
5
+ import { assertMigrated, migrate, migrationSql } from "./schema.js";
6
+ import { postgresStoreOn } from "./store.js";
7
+ /** Artifacts, files, and live events on the Postgres you already run. No other service and
8
+ * no driver dependency: bring any client with a `query` function. */
9
+ export const postgres = (options) => {
10
+ const tables = tableNames(options.schema ?? "public", options.prefix ?? "oa_");
11
+ return {
12
+ store: postgresStoreOn(options.sql, tables),
13
+ blobs: postgresBlobsOn(options.sql, tables),
14
+ bus: options.listen
15
+ ? postgresBusOn(options.sql, tables, options.listen, options.onError)
16
+ : memoryBus(),
17
+ migrate: () => migrate(options.sql, tables),
18
+ assertMigrated: () => assertMigrated(options.sql, tables),
19
+ migrationSql: () => migrationSql(tables),
20
+ schemaSql: () => migrationSql(tables),
21
+ };
22
+ };
23
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/server/adapters/postgres/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAkC,UAAU,EAAE,MAAM,aAAa,CAAA;AACxE,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAkB5C;sEACsE;AACtE,MAAM,CAAC,MAAM,QAAQ,GAAG,CACtB,OAAwB,EAUxB,EAAE;IACF,MAAM,MAAM,GAAG,UAAU,CAAC,OAAO,CAAC,MAAM,IAAI,QAAQ,EAAE,OAAO,CAAC,MAAM,IAAI,KAAK,CAAC,CAAA;IAC9E,OAAO;QACL,KAAK,EAAE,eAAe,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,CAAC;QAC3C,KAAK,EAAE,eAAe,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,CAAC;QAC3C,GAAG,EAAE,OAAO,CAAC,MAAM;YACjB,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC;YACrE,CAAC,CAAC,SAAS,EAAE;QACf,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,CAAC;QAC3C,cAAc,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,CAAC;QACzD,YAAY,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC;QACxC,SAAS,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC;KACtC,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,10 @@
1
+ import type { SqlClient, Tables } from "./client.js";
2
+ /** One atomic migration statement. The transaction lock serializes all instances, including
3
+ * HTTP clients that cannot pin a connection across multiple calls. DDL and ledger commit
4
+ * together. A failed statement leaves the previous schema and ledger unchanged. */
5
+ export declare const migrationSql: (t: Tables) => string;
6
+ /** Run during deployment, never from an artifact request. */
7
+ export declare const migrate: (sql: SqlClient, t: Tables) => Promise<void>;
8
+ /** Read-only startup gate. An incomplete or newer schema needs an explicit deployment. */
9
+ export declare const assertMigrated: (sql: SqlClient, t: Tables) => Promise<void>;
10
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/server/adapters/postgres/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAgFpD;;oFAEoF;AACpF,eAAO,MAAM,YAAY,MAAO,MAAM,WAoBrC,CAAA;AAED,6DAA6D;AAC7D,eAAO,MAAM,OAAO,QAAe,SAAS,KAAK,MAAM,kBAEtD,CAAA;AAED,0FAA0F;AAC1F,eAAO,MAAM,cAAc,QAAe,SAAS,KAAK,MAAM,kBAK7D,CAAA"}