@sixb/core 0.2.4 → 0.2.6

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 (763) hide show
  1. package/dist/actions/index.js +41 -40
  2. package/dist/actions/index.js.map +1 -1
  3. package/dist/actions/validation.d.ts.map +1 -1
  4. package/dist/agents/errors.d.ts +1 -1
  5. package/dist/agents/errors.d.ts.map +1 -1
  6. package/dist/agents/execution.d.ts +50 -3
  7. package/dist/agents/execution.d.ts.map +1 -1
  8. package/dist/agents/ids.d.ts +2 -0
  9. package/dist/agents/ids.d.ts.map +1 -1
  10. package/dist/agents/index.d.ts +7 -5
  11. package/dist/agents/index.d.ts.map +1 -1
  12. package/dist/agents/index.js +74 -50
  13. package/dist/agents/index.js.map +1 -1
  14. package/dist/agents/model-routing.d.ts +5 -2
  15. package/dist/agents/model-routing.d.ts.map +1 -1
  16. package/dist/agents/queued-turn.d.ts +16 -0
  17. package/dist/agents/queued-turn.d.ts.map +1 -0
  18. package/dist/agents/request.d.ts +120 -1
  19. package/dist/agents/request.d.ts.map +1 -1
  20. package/dist/agents/run-after-finish.d.ts +10 -0
  21. package/dist/agents/run-after-finish.d.ts.map +1 -1
  22. package/dist/agents/run-artifacts.d.ts +0 -38
  23. package/dist/agents/run-artifacts.d.ts.map +1 -1
  24. package/dist/agents/run-events.d.ts +10 -1
  25. package/dist/agents/run-events.d.ts.map +1 -1
  26. package/dist/agents/run-session-children.d.ts.map +1 -1
  27. package/dist/agents/run-session-http.d.ts.map +1 -1
  28. package/dist/agents/run-session-serve.d.ts.map +1 -1
  29. package/dist/agents/run-session.d.ts +14 -1
  30. package/dist/agents/run-session.d.ts.map +1 -1
  31. package/dist/agents/run-turn.d.ts +9 -1
  32. package/dist/agents/run-turn.d.ts.map +1 -1
  33. package/dist/agents/streams/index.d.ts +1 -1
  34. package/dist/agents/streams/index.d.ts.map +1 -1
  35. package/dist/agents/streams/index.js +1 -1
  36. package/dist/agents/streams/internal.d.ts +2 -1
  37. package/dist/agents/streams/internal.d.ts.map +1 -1
  38. package/dist/agents/streams/internal.js +22 -2
  39. package/dist/agents/streams/internal.js.map +1 -1
  40. package/dist/agents/streams/protocol.d.ts +53 -0
  41. package/dist/agents/streams/protocol.d.ts.map +1 -1
  42. package/dist/agents/streams/steps.d.ts +24 -0
  43. package/dist/agents/streams/steps.d.ts.map +1 -0
  44. package/dist/agents/thread-access.d.ts +44 -2
  45. package/dist/agents/thread-access.d.ts.map +1 -1
  46. package/dist/agents/turn-answered.d.ts +7 -0
  47. package/dist/agents/turn-answered.d.ts.map +1 -0
  48. package/dist/agents/validation.d.ts +1 -1
  49. package/dist/agents/validation.d.ts.map +1 -1
  50. package/dist/artifacts/canvas-display.d.ts +3 -5
  51. package/dist/artifacts/canvas-display.d.ts.map +1 -1
  52. package/dist/artifacts/comments.d.ts +14 -3
  53. package/dist/artifacts/comments.d.ts.map +1 -1
  54. package/dist/artifacts/document-fill.d.ts +18 -0
  55. package/dist/artifacts/document-fill.d.ts.map +1 -0
  56. package/dist/artifacts/errors.d.ts +1 -1
  57. package/dist/artifacts/errors.d.ts.map +1 -1
  58. package/dist/artifacts/events.d.ts +3 -2
  59. package/dist/artifacts/events.d.ts.map +1 -1
  60. package/dist/artifacts/execution.d.ts +40 -4
  61. package/dist/artifacts/execution.d.ts.map +1 -1
  62. package/dist/artifacts/frames/assets.d.ts +8 -1
  63. package/dist/artifacts/frames/assets.d.ts.map +1 -1
  64. package/dist/artifacts/frames/document-data.d.ts +98 -0
  65. package/dist/artifacts/frames/document-data.d.ts.map +1 -0
  66. package/dist/artifacts/frames/entries.d.ts +12 -7
  67. package/dist/artifacts/frames/entries.d.ts.map +1 -1
  68. package/dist/artifacts/frames/index.d.ts +2 -1
  69. package/dist/artifacts/frames/index.d.ts.map +1 -1
  70. package/dist/artifacts/frames/index.js +22 -13
  71. package/dist/artifacts/frames/index.js.map +4 -4
  72. package/dist/artifacts/frames/kit.d.ts +15 -0
  73. package/dist/artifacts/frames/kit.d.ts.map +1 -1
  74. package/dist/artifacts/frames/protocol.d.ts +12 -1
  75. package/dist/artifacts/frames/protocol.d.ts.map +1 -1
  76. package/dist/artifacts/frames/runtime.d.ts +24 -4
  77. package/dist/artifacts/frames/runtime.d.ts.map +1 -1
  78. package/dist/artifacts/index.d.ts +3 -1
  79. package/dist/artifacts/index.d.ts.map +1 -1
  80. package/dist/artifacts/index.js +9 -3
  81. package/dist/artifacts/index.js.map +3 -3
  82. package/dist/artifacts/live/blocks.d.ts +62 -0
  83. package/dist/artifacts/live/blocks.d.ts.map +1 -0
  84. package/dist/artifacts/live/board.d.ts +6 -0
  85. package/dist/artifacts/live/board.d.ts.map +1 -1
  86. package/dist/artifacts/live/document.d.ts +12 -0
  87. package/dist/artifacts/live/document.d.ts.map +1 -1
  88. package/dist/artifacts/live/index.d.ts +2 -0
  89. package/dist/artifacts/live/index.d.ts.map +1 -1
  90. package/dist/artifacts/live/index.js +148 -44
  91. package/dist/artifacts/live/index.js.map +3 -3
  92. package/dist/artifacts/live/page.d.ts +49 -0
  93. package/dist/artifacts/live/page.d.ts.map +1 -0
  94. package/dist/artifacts/live/protocol.d.ts +5 -0
  95. package/dist/artifacts/live/protocol.d.ts.map +1 -1
  96. package/dist/artifacts/live/server.d.ts +2 -2
  97. package/dist/artifacts/live/server.d.ts.map +1 -1
  98. package/dist/artifacts/live/server.js +29 -24
  99. package/dist/artifacts/live/server.js.map +1 -1
  100. package/dist/artifacts/live/state.d.ts +4 -1
  101. package/dist/artifacts/live/state.d.ts.map +1 -1
  102. package/dist/artifacts/outline.d.ts +16 -0
  103. package/dist/artifacts/outline.d.ts.map +1 -1
  104. package/dist/artifacts/paper.d.ts +22 -0
  105. package/dist/artifacts/paper.d.ts.map +1 -0
  106. package/dist/artifacts/pdf-job.d.ts +9 -0
  107. package/dist/artifacts/pdf-job.d.ts.map +1 -0
  108. package/dist/artifacts/publish/fields.d.ts +25 -0
  109. package/dist/artifacts/publish/fields.d.ts.map +1 -0
  110. package/dist/artifacts/publish/index.d.ts +2 -1
  111. package/dist/artifacts/publish/index.d.ts.map +1 -1
  112. package/dist/artifacts/publish/index.js +32 -23
  113. package/dist/artifacts/publish/index.js.map +1 -1
  114. package/dist/artifacts/publish/merge.d.ts +7 -6
  115. package/dist/artifacts/publish/merge.d.ts.map +1 -1
  116. package/dist/artifacts/publish/pdf.d.ts +28 -0
  117. package/dist/artifacts/publish/pdf.d.ts.map +1 -0
  118. package/dist/artifacts/publish/previews.d.ts +12 -20
  119. package/dist/artifacts/publish/previews.d.ts.map +1 -1
  120. package/dist/artifacts/publish/publish.d.ts.map +1 -1
  121. package/dist/artifacts/publish/queries.d.ts +6 -1
  122. package/dist/artifacts/publish/queries.d.ts.map +1 -1
  123. package/dist/artifacts/publish/query-answers.d.ts +5 -2
  124. package/dist/artifacts/publish/query-answers.d.ts.map +1 -1
  125. package/dist/artifacts/publish/validate/document-html.d.ts +24 -0
  126. package/dist/artifacts/publish/validate/document-html.d.ts.map +1 -0
  127. package/dist/artifacts/publish/validate/document.d.ts +5 -3
  128. package/dist/artifacts/publish/validate/document.d.ts.map +1 -1
  129. package/dist/artifacts/queries.d.ts +16 -2
  130. package/dist/artifacts/queries.d.ts.map +1 -1
  131. package/dist/artifacts/run-query.d.ts.map +1 -1
  132. package/dist/auth/index.js +6 -6
  133. package/dist/authorization/event-visibility.d.ts.map +1 -1
  134. package/dist/authorization/index.js +2 -2
  135. package/dist/blob-storage/index.js +1 -1
  136. package/dist/bootstrap/index.js +50 -48
  137. package/dist/bootstrap/index.js.map +2 -2
  138. package/dist/calendar.d.ts +55 -0
  139. package/dist/calendar.d.ts.map +1 -0
  140. package/dist/calendar.js +19 -0
  141. package/dist/calendar.js.map +9 -0
  142. package/dist/{chunk-5a4a52tq.js → chunk-0pmpwn3g.js} +18 -2
  143. package/dist/chunk-0pmpwn3g.js.map +10 -0
  144. package/dist/{chunk-0k3r5kb3.js → chunk-394zjzjs.js} +20 -10
  145. package/dist/{chunk-0k3r5kb3.js.map → chunk-394zjzjs.js.map} +5 -5
  146. package/dist/{chunk-stmxh0hv.js → chunk-3neam1y5.js} +2 -2
  147. package/dist/{chunk-zeykm8my.js → chunk-3qtk0070.js} +16 -42
  148. package/dist/chunk-3qtk0070.js.map +14 -0
  149. package/dist/{chunk-p8pgnq8d.js → chunk-425ydk65.js} +5 -5
  150. package/dist/{chunk-p351afzm.js → chunk-5sswe5ej.js} +2 -2
  151. package/dist/{chunk-a6fjkcne.js → chunk-60662fyv.js} +54 -28
  152. package/dist/{chunk-a6fjkcne.js.map → chunk-60662fyv.js.map} +7 -6
  153. package/dist/{chunk-e0hnbb1m.js → chunk-61zptves.js} +1 -1
  154. package/dist/chunk-6hfbz4d0.js +98 -0
  155. package/dist/chunk-6hfbz4d0.js.map +10 -0
  156. package/dist/{chunk-3zagkr6w.js → chunk-7mhbs9yy.js} +4 -4
  157. package/dist/{chunk-3zagkr6w.js.map → chunk-7mhbs9yy.js.map} +1 -1
  158. package/dist/{chunk-gxwy4c3s.js → chunk-7r9mqpva.js} +570 -104
  159. package/dist/chunk-7r9mqpva.js.map +47 -0
  160. package/dist/{chunk-3014rfjz.js → chunk-88xeh6zx.js} +28 -8
  161. package/dist/{chunk-3014rfjz.js.map → chunk-88xeh6zx.js.map} +4 -4
  162. package/dist/{chunk-9nsjjd44.js → chunk-8tv3qd65.js} +2 -1
  163. package/dist/chunk-8tv3qd65.js.map +12 -0
  164. package/dist/chunk-90nqenq8.js +386 -0
  165. package/dist/chunk-90nqenq8.js.map +14 -0
  166. package/dist/{chunk-fe6r7yhg.js → chunk-92wrka15.js} +1 -1
  167. package/dist/{chunk-w1wq7gfr.js → chunk-9c9yknwt.js} +464 -29
  168. package/dist/{chunk-w1wq7gfr.js.map → chunk-9c9yknwt.js.map} +7 -7
  169. package/dist/{chunk-q9nkpr8k.js → chunk-9tpmfh3n.js} +1 -1
  170. package/dist/chunk-9wr3yajk.js.map +2 -2
  171. package/dist/{chunk-rtm1jq00.js → chunk-ats8y3d9.js} +1202 -246
  172. package/dist/{chunk-rtm1jq00.js.map → chunk-ats8y3d9.js.map} +16 -14
  173. package/dist/{chunk-td26wjr5.js → chunk-bcz9dxtf.js} +17 -47
  174. package/dist/chunk-bcz9dxtf.js.map +12 -0
  175. package/dist/chunk-bqr703h4.js +1799 -0
  176. package/dist/chunk-bqr703h4.js.map +13 -0
  177. package/dist/{chunk-sysnvjce.js → chunk-brhp9d97.js} +2 -2
  178. package/dist/{chunk-8a8k38tz.js → chunk-brybqw5k.js} +1 -1
  179. package/dist/{chunk-rsxb14an.js → chunk-bs1sd0e0.js} +12 -8
  180. package/dist/chunk-bs1sd0e0.js.map +18 -0
  181. package/dist/{chunk-eptrvnby.js → chunk-c29729me.js} +42 -3
  182. package/dist/chunk-c29729me.js.map +12 -0
  183. package/dist/{chunk-855w9nvw.js → chunk-cg7cygfj.js} +1 -1
  184. package/dist/chunk-dq3t5sr3.js +114 -0
  185. package/dist/chunk-dq3t5sr3.js.map +11 -0
  186. package/dist/{chunk-t24yktqr.js → chunk-dvgc56n2.js} +20 -4
  187. package/dist/{chunk-t24yktqr.js.map → chunk-dvgc56n2.js.map} +5 -5
  188. package/dist/{chunk-r2psmn42.js → chunk-eg6xqef7.js} +1 -1
  189. package/dist/{chunk-7kpqntgw.js → chunk-f05994as.js} +1 -1
  190. package/dist/{chunk-msyevpp3.js → chunk-fmgf9h5e.js} +38 -14
  191. package/dist/chunk-fmgf9h5e.js.map +22 -0
  192. package/dist/{chunk-b9qfh2ya.js → chunk-fzbhybya.js} +29 -2
  193. package/dist/chunk-fzbhybya.js.map +11 -0
  194. package/dist/{chunk-t0s7b3d1.js → chunk-gaj8djsw.js} +251 -6
  195. package/dist/chunk-gaj8djsw.js.map +13 -0
  196. package/dist/{chunk-2bn6813a.js → chunk-grt2j5vp.js} +2 -2
  197. package/dist/{chunk-s7xqfxs9.js → chunk-hkbks1xm.js} +3 -1
  198. package/dist/{chunk-s7xqfxs9.js.map → chunk-hkbks1xm.js.map} +3 -3
  199. package/dist/chunk-hn2r7z41.js.map +1 -1
  200. package/dist/{chunk-rtdrm592.js → chunk-htdzx40w.js} +2 -2
  201. package/dist/{chunk-bc3y6gff.js → chunk-jka26v8c.js} +1 -1
  202. package/dist/{chunk-yy914zfr.js → chunk-jt012fxq.js} +772 -98
  203. package/dist/chunk-jt012fxq.js.map +34 -0
  204. package/dist/{chunk-48c1z8nj.js → chunk-kft7mp7z.js} +28 -3
  205. package/dist/chunk-kft7mp7z.js.map +10 -0
  206. package/dist/chunk-mbwsgjn7.js +40 -0
  207. package/dist/chunk-mbwsgjn7.js.map +11 -0
  208. package/dist/{chunk-wa05txmk.js → chunk-n1hbwc6y.js} +51 -8
  209. package/dist/chunk-n1hbwc6y.js.map +12 -0
  210. package/dist/{chunk-n4zzaf6q.js → chunk-nxysqbt0.js} +4 -2
  211. package/dist/chunk-nxysqbt0.js.map +10 -0
  212. package/dist/{chunk-6ef4esq4.js → chunk-pqj8vff9.js} +4 -4
  213. package/dist/chunk-pvpq483h.js.map +2 -2
  214. package/dist/{chunk-mzx71snp.js → chunk-q7g9cqwt.js} +7 -2
  215. package/dist/{chunk-mzx71snp.js.map → chunk-q7g9cqwt.js.map} +3 -3
  216. package/dist/{chunk-n68vz95m.js → chunk-qbd282aa.js} +2 -2
  217. package/dist/{chunk-e91fmg6t.js → chunk-qsa7nw6f.js} +2 -1
  218. package/dist/{chunk-e91fmg6t.js.map → chunk-qsa7nw6f.js.map} +3 -3
  219. package/dist/{chunk-rsrc7vtw.js → chunk-s8xxef60.js} +240 -46
  220. package/dist/chunk-s8xxef60.js.map +50 -0
  221. package/dist/{chunk-r9rtavg9.js → chunk-t19wjmnc.js} +7 -7
  222. package/dist/{chunk-vzkxqf8h.js → chunk-tapdssb5.js} +50 -6
  223. package/dist/chunk-tapdssb5.js.map +23 -0
  224. package/dist/{chunk-dhkc9b23.js → chunk-v8a1qjzp.js} +1 -1
  225. package/dist/{chunk-hvbvq7p4.js → chunk-vs2s3p8n.js} +731 -10
  226. package/dist/chunk-vs2s3p8n.js.map +20 -0
  227. package/dist/chunk-vtjzwymr.js.map +2 -2
  228. package/dist/{chunk-8t2ynwg0.js → chunk-wzcjhv54.js} +31 -1
  229. package/dist/{chunk-8t2ynwg0.js.map → chunk-wzcjhv54.js.map} +3 -3
  230. package/dist/{chunk-8tqnsx3q.js → chunk-xavet0qs.js} +5 -3
  231. package/dist/{chunk-8tqnsx3q.js.map → chunk-xavet0qs.js.map} +3 -3
  232. package/dist/{chunk-8bns0y68.js → chunk-xf76csps.js} +5 -5
  233. package/dist/{chunk-cwdzcv37.js → chunk-xrmbhap8.js} +2 -2
  234. package/dist/{chunk-cwdzcv37.js.map → chunk-xrmbhap8.js.map} +2 -2
  235. package/dist/{chunk-f6ahf5gf.js → chunk-xxfj0rr2.js} +20 -5
  236. package/dist/chunk-xxfj0rr2.js.map +13 -0
  237. package/dist/{chunk-3hzhcfsv.js → chunk-y8fwm3z2.js} +2 -2
  238. package/dist/{chunk-3hzhcfsv.js.map → chunk-y8fwm3z2.js.map} +3 -3
  239. package/dist/{chunk-smnt672s.js → chunk-ygvay56w.js} +20 -4
  240. package/dist/chunk-ygvay56w.js.map +10 -0
  241. package/dist/{chunk-evj5jxz3.js → chunk-ykchk644.js} +63 -15
  242. package/dist/{chunk-evj5jxz3.js.map → chunk-ykchk644.js.map} +7 -7
  243. package/dist/{chunk-vepea5c3.js → chunk-ym1bqd98.js} +6 -6
  244. package/dist/{chunk-yv8hv4wq.js → chunk-z4jqb44a.js} +3 -1
  245. package/dist/chunk-z4jqb44a.js.map +10 -0
  246. package/dist/connectors/connection-handles.d.ts +9 -0
  247. package/dist/connectors/connection-handles.d.ts.map +1 -0
  248. package/dist/connectors/connections/authorizations.d.ts +9 -0
  249. package/dist/connectors/connections/authorizations.d.ts.map +1 -1
  250. package/dist/connectors/connections/capability.d.ts +11 -0
  251. package/dist/connectors/connections/capability.d.ts.map +1 -1
  252. package/dist/connectors/connections/events.d.ts +17 -0
  253. package/dist/connectors/connections/events.d.ts.map +1 -0
  254. package/dist/connectors/connections/internal.d.ts +2 -1
  255. package/dist/connectors/connections/internal.d.ts.map +1 -1
  256. package/dist/connectors/connections/internal.js +8 -4
  257. package/dist/connectors/connections/internal.js.map +1 -1
  258. package/dist/connectors/connections/runs.d.ts +3 -0
  259. package/dist/connectors/connections/runs.d.ts.map +1 -1
  260. package/dist/connectors/connections/service.d.ts +13 -1
  261. package/dist/connectors/connections/service.d.ts.map +1 -1
  262. package/dist/connectors/execution.d.ts +14 -2
  263. package/dist/connectors/execution.d.ts.map +1 -1
  264. package/dist/connectors/index.d.ts +1 -1
  265. package/dist/connectors/index.d.ts.map +1 -1
  266. package/dist/connectors/service.d.ts +5 -1
  267. package/dist/connectors/service.d.ts.map +1 -1
  268. package/dist/connectors/types.d.ts +22 -1
  269. package/dist/connectors/types.d.ts.map +1 -1
  270. package/dist/datasets/write.js +1 -1
  271. package/dist/deploy/index.d.ts +1 -1
  272. package/dist/deploy/index.d.ts.map +1 -1
  273. package/dist/deploy/internal.js +3 -2
  274. package/dist/deploy/internal.js.map +3 -3
  275. package/dist/deploy/services.d.ts.map +1 -1
  276. package/dist/deploy/types.d.ts +22 -2
  277. package/dist/deploy/types.d.ts.map +1 -1
  278. package/dist/events/definitions.d.ts +4 -0
  279. package/dist/events/definitions.d.ts.map +1 -1
  280. package/dist/events/execution.d.ts +8 -1
  281. package/dist/events/execution.d.ts.map +1 -1
  282. package/dist/events/index.d.ts +2 -2
  283. package/dist/events/index.d.ts.map +1 -1
  284. package/dist/events/index.js +3 -3
  285. package/dist/events/outbox-dispatcher.d.ts +7 -0
  286. package/dist/events/outbox-dispatcher.d.ts.map +1 -1
  287. package/dist/events/scope.d.ts +1 -0
  288. package/dist/events/scope.d.ts.map +1 -1
  289. package/dist/events/scope.js +1 -1
  290. package/dist/events/selectors/builder.d.ts +9 -1
  291. package/dist/events/selectors/builder.d.ts.map +1 -1
  292. package/dist/events/selectors/index.d.ts +2 -2
  293. package/dist/events/selectors/index.d.ts.map +1 -1
  294. package/dist/events/selectors/index.js +2 -2
  295. package/dist/events/selectors/predicate.d.ts.map +1 -1
  296. package/dist/events/selectors/types.d.ts +18 -3
  297. package/dist/events/selectors/types.d.ts.map +1 -1
  298. package/dist/events/types/artifacts.d.ts +7 -1
  299. package/dist/events/types/artifacts.d.ts.map +1 -1
  300. package/dist/events/types/connectors.d.ts +32 -0
  301. package/dist/events/types/connectors.d.ts.map +1 -0
  302. package/dist/events/types/index.d.ts +3 -1
  303. package/dist/events/types/index.d.ts.map +1 -1
  304. package/dist/events/types/syncs.d.ts +4 -0
  305. package/dist/events/types/syncs.d.ts.map +1 -1
  306. package/dist/execution/agent.js +43 -42
  307. package/dist/execution/agent.js.map +1 -1
  308. package/dist/execution/authorization.d.ts +5 -0
  309. package/dist/execution/authorization.d.ts.map +1 -1
  310. package/dist/execution/authorized-object-reader.d.ts +4 -0
  311. package/dist/execution/authorized-object-reader.d.ts.map +1 -1
  312. package/dist/execution/object-reader-ontology.d.ts +3 -0
  313. package/dist/execution/object-reader-ontology.d.ts.map +1 -1
  314. package/dist/execution/primitive.js +41 -40
  315. package/dist/execution/primitive.js.map +1 -1
  316. package/dist/execution/request.d.ts +1 -1
  317. package/dist/execution/request.d.ts.map +1 -1
  318. package/dist/execution/request.js +39 -38
  319. package/dist/execution/request.js.map +3 -3
  320. package/dist/execution/scopes.d.ts +8 -0
  321. package/dist/execution/scopes.d.ts.map +1 -1
  322. package/dist/execution/script.d.ts +7 -0
  323. package/dist/execution/script.d.ts.map +1 -0
  324. package/dist/execution/types.d.ts +16 -1
  325. package/dist/execution/types.d.ts.map +1 -1
  326. package/dist/http/api-routes.d.ts.map +1 -1
  327. package/dist/http/index.js +1 -1
  328. package/dist/index.d.ts +13 -12
  329. package/dist/index.d.ts.map +1 -1
  330. package/dist/index.js +74 -70
  331. package/dist/index.js.map +1 -1
  332. package/dist/lake-storage/index.js +1 -1
  333. package/dist/lineage/executors.d.ts +1 -1
  334. package/dist/lineage/executors.d.ts.map +1 -1
  335. package/dist/maintenance/index.js +2 -2
  336. package/dist/materialization/event-envelopes.d.ts +3 -3
  337. package/dist/materialization/event-envelopes.d.ts.map +1 -1
  338. package/dist/materialization/events.d.ts +6 -0
  339. package/dist/materialization/events.d.ts.map +1 -1
  340. package/dist/materialization/index.js +1 -1
  341. package/dist/materialization/model.d.ts +6 -0
  342. package/dist/materialization/model.d.ts.map +1 -1
  343. package/dist/materializer/index.js +24 -23
  344. package/dist/materializer/index.js.map +1 -1
  345. package/dist/materializer/projections/replace.d.ts.map +1 -1
  346. package/dist/materializer/projections/replacement-plan.d.ts +2 -0
  347. package/dist/materializer/projections/replacement-plan.d.ts.map +1 -1
  348. package/dist/materializer/shared/normalize.d.ts +1 -0
  349. package/dist/materializer/shared/normalize.d.ts.map +1 -1
  350. package/dist/models/audio/runtime.d.ts.map +1 -1
  351. package/dist/models/audio/types.d.ts +19 -0
  352. package/dist/models/audio/types.d.ts.map +1 -1
  353. package/dist/models/execution/index.js +22 -21
  354. package/dist/models/execution/index.js.map +1 -1
  355. package/dist/models/index.d.ts +1 -1
  356. package/dist/models/index.d.ts.map +1 -1
  357. package/dist/objects/index.js +41 -40
  358. package/dist/objects/index.js.map +1 -1
  359. package/dist/objects/query/executor.d.ts +3 -1
  360. package/dist/objects/query/executor.d.ts.map +1 -1
  361. package/dist/objects/query/explain.d.ts +3 -1
  362. package/dist/objects/query/explain.d.ts.map +1 -1
  363. package/dist/objects/query/index.d.ts +1 -1
  364. package/dist/objects/query/index.d.ts.map +1 -1
  365. package/dist/objects/query/index.js +21 -20
  366. package/dist/objects/query/index.js.map +1 -1
  367. package/dist/objects/query/link-query-clearance.d.ts +3 -0
  368. package/dist/objects/query/link-query-clearance.d.ts.map +1 -1
  369. package/dist/objects/query/links.d.ts +1 -1
  370. package/dist/objects/query/links.d.ts.map +1 -1
  371. package/dist/objects/query/validate.d.ts +17 -0
  372. package/dist/objects/query/validate.d.ts.map +1 -1
  373. package/dist/objects/sdk/runtime-query-executor.d.ts +1 -1
  374. package/dist/objects/sdk/runtime-query-executor.d.ts.map +1 -1
  375. package/dist/ontology/index.js +3 -3
  376. package/dist/ontology/internal.js +3 -3
  377. package/dist/pipelines/index.js +27 -26
  378. package/dist/pipelines/index.js.map +1 -1
  379. package/dist/projections/builders.d.ts +7 -1
  380. package/dist/projections/builders.d.ts.map +1 -1
  381. package/dist/projections/index.d.ts +1 -1
  382. package/dist/projections/index.d.ts.map +1 -1
  383. package/dist/projections/internal.js +22 -21
  384. package/dist/projections/internal.js.map +1 -1
  385. package/dist/projections/types.d.ts +10 -0
  386. package/dist/projections/types.d.ts.map +1 -1
  387. package/dist/projections/validation.d.ts.map +1 -1
  388. package/dist/queues/in-memory.d.ts +3 -2
  389. package/dist/queues/in-memory.d.ts.map +1 -1
  390. package/dist/queues/index.d.ts +1 -1
  391. package/dist/queues/index.d.ts.map +1 -1
  392. package/dist/queues/index.js +1 -1
  393. package/dist/queues/types.d.ts +40 -13
  394. package/dist/queues/types.d.ts.map +1 -1
  395. package/dist/runtime/host.d.ts +13 -0
  396. package/dist/runtime/host.d.ts.map +1 -1
  397. package/dist/runtime/internal.d.ts +1 -0
  398. package/dist/runtime/internal.d.ts.map +1 -1
  399. package/dist/runtime/internal.js +47 -25
  400. package/dist/runtime/internal.js.map +4 -3
  401. package/dist/runtime/locale.d.ts +0 -2
  402. package/dist/runtime/locale.d.ts.map +1 -1
  403. package/dist/runtime/resolve-definitions.d.ts +1 -1
  404. package/dist/runtime/resolve-definitions.d.ts.map +1 -1
  405. package/dist/runtime/script.d.ts +39 -0
  406. package/dist/runtime/script.d.ts.map +1 -0
  407. package/dist/runtime/sixb.d.ts +2 -2
  408. package/dist/runtime/sixb.d.ts.map +1 -1
  409. package/dist/sandboxes/auth.d.ts +26 -4
  410. package/dist/sandboxes/auth.d.ts.map +1 -1
  411. package/dist/sandboxes/index.d.ts +3 -1
  412. package/dist/sandboxes/index.d.ts.map +1 -1
  413. package/dist/sandboxes/index.js +5 -5
  414. package/dist/schedules/builders.d.ts.map +1 -1
  415. package/dist/schedules/index.js +3 -3
  416. package/dist/schedules/runtime.d.ts.map +1 -1
  417. package/dist/schedules/validation.d.ts +2 -0
  418. package/dist/schedules/validation.d.ts.map +1 -1
  419. package/dist/security/view-conditions.d.ts.map +1 -1
  420. package/dist/shares/internal.js +19 -18
  421. package/dist/shares/internal.js.map +2 -2
  422. package/dist/storage/agents/errors.d.ts +1 -1
  423. package/dist/storage/agents/errors.d.ts.map +1 -1
  424. package/dist/storage/agents/in-memory.d.ts +43 -1
  425. package/dist/storage/agents/in-memory.d.ts.map +1 -1
  426. package/dist/storage/agents/index.d.ts +2 -2
  427. package/dist/storage/agents/index.d.ts.map +1 -1
  428. package/dist/storage/agents/provider.d.ts +54 -11
  429. package/dist/storage/agents/provider.d.ts.map +1 -1
  430. package/dist/storage/agents/provider.js +41 -5
  431. package/dist/storage/agents/provider.js.map +1 -1
  432. package/dist/storage/agents/types.d.ts +291 -3
  433. package/dist/storage/agents/types.d.ts.map +1 -1
  434. package/dist/storage/ai-cost/analytics.d.ts +3 -2
  435. package/dist/storage/ai-cost/analytics.d.ts.map +1 -1
  436. package/dist/storage/ai-cost/provider.js +4 -3
  437. package/dist/storage/ai-cost/provider.js.map +1 -1
  438. package/dist/storage/ai-cost/types.d.ts +5 -1
  439. package/dist/storage/ai-cost/types.d.ts.map +1 -1
  440. package/dist/storage/artifacts/in-memory.d.ts +7 -1
  441. package/dist/storage/artifacts/in-memory.d.ts.map +1 -1
  442. package/dist/storage/artifacts/index.d.ts +1 -1
  443. package/dist/storage/artifacts/index.d.ts.map +1 -1
  444. package/dist/storage/artifacts/record.d.ts +5 -2
  445. package/dist/storage/artifacts/record.d.ts.map +1 -1
  446. package/dist/storage/artifacts/types.d.ts +41 -0
  447. package/dist/storage/artifacts/types.d.ts.map +1 -1
  448. package/dist/storage/executions/provider.d.ts +3 -3
  449. package/dist/storage/executions/provider.d.ts.map +1 -1
  450. package/dist/storage/executions/provider.js +1 -1
  451. package/dist/storage/executions/types.d.ts +6 -0
  452. package/dist/storage/executions/types.d.ts.map +1 -1
  453. package/dist/storage/executions/validation.d.ts.map +1 -1
  454. package/dist/storage/file-upload-sessions/provider.js +7 -7
  455. package/dist/storage/index.d.ts +4 -4
  456. package/dist/storage/index.d.ts.map +1 -1
  457. package/dist/storage/index.js +30 -25
  458. package/dist/storage/index.js.map +1 -1
  459. package/dist/storage/internal.d.ts +1 -1
  460. package/dist/storage/internal.d.ts.map +1 -1
  461. package/dist/storage/internal.js +12 -10
  462. package/dist/storage/internal.js.map +2 -2
  463. package/dist/storage/ontology/in-memory/replacement-plans.d.ts +2 -0
  464. package/dist/storage/ontology/in-memory/replacement-plans.d.ts.map +1 -1
  465. package/dist/storage/ontology/provider.js +1 -1
  466. package/dist/storage/ontology/replacement-plans.d.ts +8 -0
  467. package/dist/storage/ontology/replacement-plans.d.ts.map +1 -1
  468. package/dist/storage/operation-scope.d.ts.map +1 -1
  469. package/dist/storage/operation-scope.js +1 -1
  470. package/dist/storage/sync-runs/idempotency.d.ts.map +1 -1
  471. package/dist/storage/sync-runs/in-memory.d.ts +2 -1
  472. package/dist/storage/sync-runs/in-memory.d.ts.map +1 -1
  473. package/dist/storage/sync-runs/index.d.ts +1 -1
  474. package/dist/storage/sync-runs/index.d.ts.map +1 -1
  475. package/dist/storage/sync-runs/types.d.ts +27 -2
  476. package/dist/storage/sync-runs/types.d.ts.map +1 -1
  477. package/dist/storage/workflow-runs/provider.js +7 -7
  478. package/dist/syncs/accounts.d.ts +36 -0
  479. package/dist/syncs/accounts.d.ts.map +1 -0
  480. package/dist/syncs/builders.d.ts.map +1 -1
  481. package/dist/syncs/connections.d.ts +36 -0
  482. package/dist/syncs/connections.d.ts.map +1 -0
  483. package/dist/syncs/execution.d.ts +14 -4
  484. package/dist/syncs/execution.d.ts.map +1 -1
  485. package/dist/syncs/index.d.ts +2 -1
  486. package/dist/syncs/index.d.ts.map +1 -1
  487. package/dist/syncs/index.js +28 -27
  488. package/dist/syncs/index.js.map +1 -1
  489. package/dist/syncs/request.d.ts +16 -2
  490. package/dist/syncs/request.d.ts.map +1 -1
  491. package/dist/syncs/run-dispatch.d.ts +14 -2
  492. package/dist/syncs/run-dispatch.d.ts.map +1 -1
  493. package/dist/testing/agent-approval-storage-contract.d.ts.map +1 -1
  494. package/dist/testing/agent-execution.d.ts +3 -0
  495. package/dist/testing/agent-execution.d.ts.map +1 -1
  496. package/dist/testing/agent-inbox-storage-contract.d.ts +15 -0
  497. package/dist/testing/agent-inbox-storage-contract.d.ts.map +1 -0
  498. package/dist/testing/agent-storage-contract.d.ts.map +1 -1
  499. package/dist/testing/ai-cost-storage-contract.d.ts.map +1 -1
  500. package/dist/testing/artifact-storage-contract.d.ts.map +1 -1
  501. package/dist/testing/execution-storage-contract.d.ts.map +1 -1
  502. package/dist/testing/index.d.ts +1 -0
  503. package/dist/testing/index.d.ts.map +1 -1
  504. package/dist/testing/index.js +6589 -4627
  505. package/dist/testing/index.js.map +13 -12
  506. package/dist/testing/materializer-storage-contract.d.ts.map +1 -1
  507. package/dist/testing/queues-contract.d.ts.map +1 -1
  508. package/dist/testing/run-claim-storage-contract.d.ts.map +1 -1
  509. package/dist/webhooks/connections.d.ts +3 -4
  510. package/dist/webhooks/connections.d.ts.map +1 -1
  511. package/dist/webhooks/index.d.ts +1 -1
  512. package/dist/webhooks/index.d.ts.map +1 -1
  513. package/dist/webhooks/internal.js +22 -54
  514. package/dist/webhooks/internal.js.map +3 -3
  515. package/dist/webhooks/types.d.ts +2 -11
  516. package/dist/webhooks/types.d.ts.map +1 -1
  517. package/dist/workers/index.js +66 -13
  518. package/dist/workers/index.js.map +4 -4
  519. package/dist/workers/queue-worker.d.ts +5 -0
  520. package/dist/workers/queue-worker.d.ts.map +1 -1
  521. package/dist/workers/queued-run-dispatch.d.ts.map +1 -1
  522. package/dist/workers/worker.d.ts +8 -0
  523. package/dist/workers/worker.d.ts.map +1 -1
  524. package/dist/workflows/index.js +50 -48
  525. package/dist/workflows/index.js.map +1 -1
  526. package/package.json +12 -1
  527. package/src/actions/validation.ts +3 -1
  528. package/src/agents/README.md +6 -2
  529. package/src/agents/children.ts +6 -0
  530. package/src/agents/errors.ts +3 -0
  531. package/src/agents/execution.ts +331 -43
  532. package/src/agents/ids.ts +5 -0
  533. package/src/agents/index.ts +22 -4
  534. package/src/agents/model-routing.ts +25 -9
  535. package/src/agents/queued-turn.ts +46 -0
  536. package/src/agents/request.ts +1444 -210
  537. package/src/agents/run-after-finish.ts +259 -2
  538. package/src/agents/run-artifacts.ts +3 -93
  539. package/src/agents/run-events.ts +256 -34
  540. package/src/agents/run-session-children.ts +13 -2
  541. package/src/agents/run-session-http.ts +9 -2
  542. package/src/agents/run-session-serve.ts +2 -8
  543. package/src/agents/run-session.ts +142 -3
  544. package/src/agents/run-turn.ts +148 -23
  545. package/src/agents/streams/index.ts +3 -0
  546. package/src/agents/streams/internal.ts +12 -0
  547. package/src/agents/streams/protocol.ts +109 -1
  548. package/src/agents/streams/steps.ts +131 -0
  549. package/src/agents/thread-access.ts +57 -2
  550. package/src/agents/turn-answered.ts +31 -0
  551. package/src/agents/validation.ts +2 -0
  552. package/src/artifacts/canvas-display.ts +4 -6
  553. package/src/artifacts/comments.ts +70 -17
  554. package/src/artifacts/document-fill.ts +103 -0
  555. package/src/artifacts/errors.ts +2 -0
  556. package/src/artifacts/events.ts +4 -1
  557. package/src/artifacts/execution.ts +265 -31
  558. package/src/artifacts/frames/assets.ts +42 -7
  559. package/src/artifacts/frames/document-data.ts +353 -0
  560. package/src/artifacts/frames/entries.ts +22 -16
  561. package/src/artifacts/frames/grants.ts +2 -2
  562. package/src/artifacts/frames/index.ts +3 -0
  563. package/src/artifacts/frames/kit.ts +102 -0
  564. package/src/artifacts/frames/protocol.ts +12 -1
  565. package/src/artifacts/frames/runtime.ts +413 -6
  566. package/src/artifacts/index.ts +3 -0
  567. package/src/artifacts/live/blocks.ts +889 -0
  568. package/src/artifacts/live/board.ts +195 -42
  569. package/src/artifacts/live/document.ts +170 -5
  570. package/src/artifacts/live/index.ts +7 -0
  571. package/src/artifacts/live/page.ts +807 -0
  572. package/src/artifacts/live/protocol.ts +5 -0
  573. package/src/artifacts/live/server.ts +2 -2
  574. package/src/artifacts/live/state.ts +9 -4
  575. package/src/artifacts/outline.ts +17 -0
  576. package/src/artifacts/paper.ts +173 -0
  577. package/src/artifacts/pdf-job.ts +11 -0
  578. package/src/artifacts/publish/fields.ts +177 -0
  579. package/src/artifacts/publish/index.ts +6 -1
  580. package/src/artifacts/publish/merge.ts +28 -15
  581. package/src/artifacts/publish/pdf.ts +82 -0
  582. package/src/artifacts/publish/previews.ts +24 -34
  583. package/src/artifacts/publish/publish.ts +26 -3
  584. package/src/artifacts/publish/queries.ts +20 -4
  585. package/src/artifacts/publish/query-answers.ts +14 -3
  586. package/src/artifacts/publish/validate/document-html.ts +245 -0
  587. package/src/artifacts/publish/validate/document.ts +34 -3
  588. package/src/artifacts/queries.ts +59 -13
  589. package/src/artifacts/run-query.ts +5 -2
  590. package/src/authorization/event-visibility.ts +13 -0
  591. package/src/calendar.ts +195 -0
  592. package/src/connectors/connection-handles.ts +71 -0
  593. package/src/connectors/connections/authorizations.ts +50 -2
  594. package/src/connectors/connections/capability.ts +40 -0
  595. package/src/connectors/connections/events.ts +57 -0
  596. package/src/connectors/connections/internal.ts +3 -0
  597. package/src/connectors/connections/runs.ts +5 -0
  598. package/src/connectors/connections/service.ts +93 -6
  599. package/src/connectors/execution.ts +35 -8
  600. package/src/connectors/index.ts +3 -0
  601. package/src/connectors/service.ts +23 -0
  602. package/src/connectors/types.ts +29 -1
  603. package/src/deploy/index.ts +1 -0
  604. package/src/deploy/services.ts +1 -0
  605. package/src/deploy/types.ts +30 -2
  606. package/src/events/definitions.ts +14 -0
  607. package/src/events/execution.ts +51 -4
  608. package/src/events/index.ts +8 -0
  609. package/src/events/outbox-dispatcher.ts +12 -2
  610. package/src/events/scope.ts +3 -0
  611. package/src/events/selectors/builder.ts +49 -0
  612. package/src/events/selectors/index.ts +5 -0
  613. package/src/events/selectors/predicate.ts +2 -0
  614. package/src/events/selectors/types.ts +30 -1
  615. package/src/events/types/artifacts.ts +7 -1
  616. package/src/events/types/connectors.ts +36 -0
  617. package/src/events/types/index.ts +7 -0
  618. package/src/events/types/syncs.ts +4 -0
  619. package/src/execution/authorization.ts +45 -0
  620. package/src/execution/authorized-object-reader.ts +33 -5
  621. package/src/execution/durable.ts +2 -0
  622. package/src/execution/object-reader-ontology.ts +6 -0
  623. package/src/execution/request.ts +1 -0
  624. package/src/execution/scopes.ts +24 -0
  625. package/src/execution/script.ts +27 -0
  626. package/src/execution/types.ts +7 -1
  627. package/src/http/api-routes.ts +33 -0
  628. package/src/index.ts +39 -4
  629. package/src/lineage/executors.ts +3 -1
  630. package/src/materialization/event-envelopes.ts +10 -5
  631. package/src/materialization/events.ts +2 -0
  632. package/src/materialization/model.ts +6 -0
  633. package/src/materializer/README.md +10 -0
  634. package/src/materializer/projections/replace.ts +42 -1
  635. package/src/materializer/projections/replacement-plan.ts +44 -4
  636. package/src/materializer/shared/normalize.ts +4 -0
  637. package/src/models/audio/runtime.ts +57 -14
  638. package/src/models/audio/types.ts +20 -0
  639. package/src/models/index.ts +1 -0
  640. package/src/objects/query/executor.ts +4 -0
  641. package/src/objects/query/explain.ts +5 -0
  642. package/src/objects/query/index.ts +1 -0
  643. package/src/objects/query/link-query-clearance.ts +4 -1
  644. package/src/objects/query/links.ts +5 -1
  645. package/src/objects/query/validate.ts +33 -1
  646. package/src/objects/sdk/runtime-query-executor.ts +7 -3
  647. package/src/projections/builders.ts +20 -0
  648. package/src/projections/index.ts +1 -0
  649. package/src/projections/registry.ts +1 -0
  650. package/src/projections/revision.ts +2 -0
  651. package/src/projections/types.ts +11 -0
  652. package/src/projections/validation.ts +6 -0
  653. package/src/queues/in-memory.ts +5 -0
  654. package/src/queues/index.ts +3 -1
  655. package/src/queues/types.ts +45 -14
  656. package/src/runtime/host.ts +125 -11
  657. package/src/runtime/internal.ts +1 -0
  658. package/src/runtime/locale.ts +0 -10
  659. package/src/runtime/resolve-definitions.ts +4 -1
  660. package/src/runtime/script.ts +62 -0
  661. package/src/runtime/sixb.ts +15 -5
  662. package/src/sandboxes/README.md +3 -1
  663. package/src/sandboxes/auth.ts +32 -4
  664. package/src/sandboxes/index.ts +15 -1
  665. package/src/schedules/builders.ts +4 -1
  666. package/src/schedules/runtime.ts +3 -0
  667. package/src/schedules/validation.ts +20 -2
  668. package/src/security/view-conditions.ts +2 -1
  669. package/src/storage/agents/errors.ts +1 -0
  670. package/src/storage/agents/in-memory.ts +500 -7
  671. package/src/storage/agents/index.ts +26 -0
  672. package/src/storage/agents/provider.ts +454 -15
  673. package/src/storage/agents/types.ts +315 -3
  674. package/src/storage/ai-cost/analytics.ts +22 -43
  675. package/src/storage/ai-cost/types.ts +5 -1
  676. package/src/storage/artifacts/in-memory.ts +52 -6
  677. package/src/storage/artifacts/index.ts +2 -0
  678. package/src/storage/artifacts/record.ts +33 -4
  679. package/src/storage/artifacts/types.ts +44 -0
  680. package/src/storage/executions/provider.ts +22 -2
  681. package/src/storage/executions/types.ts +2 -0
  682. package/src/storage/executions/validation.ts +27 -0
  683. package/src/storage/index.ts +29 -0
  684. package/src/storage/internal.ts +1 -0
  685. package/src/storage/ontology/in-memory/replacement-plans.ts +22 -0
  686. package/src/storage/ontology/replacement-plans.ts +6 -0
  687. package/src/storage/operation-scope.ts +2 -0
  688. package/src/storage/sync-runs/idempotency.ts +1 -0
  689. package/src/storage/sync-runs/in-memory.ts +43 -1
  690. package/src/storage/sync-runs/index.ts +1 -0
  691. package/src/storage/sync-runs/types.ts +30 -1
  692. package/src/syncs/accounts.ts +85 -0
  693. package/src/syncs/builders.ts +18 -1
  694. package/src/syncs/connections.ts +123 -0
  695. package/src/syncs/execution.ts +64 -22
  696. package/src/syncs/index.ts +3 -0
  697. package/src/syncs/request.ts +81 -23
  698. package/src/syncs/run-dispatch.ts +69 -7
  699. package/src/testing/agent-approval-storage-contract.ts +123 -0
  700. package/src/testing/agent-execution.ts +45 -2
  701. package/src/testing/agent-inbox-storage-contract.ts +874 -0
  702. package/src/testing/agent-storage-contract.ts +965 -103
  703. package/src/testing/ai-cost-storage-contract.ts +80 -0
  704. package/src/testing/artifact-storage-contract.ts +201 -4
  705. package/src/testing/execution-storage-contract.ts +31 -0
  706. package/src/testing/index.ts +5 -0
  707. package/src/testing/materializer-storage-contract.ts +139 -1
  708. package/src/testing/queues-contract.ts +22 -0
  709. package/src/testing/run-claim-storage-contract.ts +116 -0
  710. package/src/webhooks/connections.ts +9 -50
  711. package/src/webhooks/index.ts +0 -2
  712. package/src/webhooks/types.ts +2 -13
  713. package/src/workers/README.md +4 -1
  714. package/src/workers/lost-runs.ts +1 -0
  715. package/src/workers/queue-worker.ts +16 -5
  716. package/src/workers/queued-run-dispatch.ts +8 -1
  717. package/src/workers/worker.ts +67 -7
  718. package/dist/chunk-3z1vxzcm.js +0 -234
  719. package/dist/chunk-3z1vxzcm.js.map +0 -12
  720. package/dist/chunk-48c1z8nj.js.map +0 -10
  721. package/dist/chunk-58geavnf.js +0 -29
  722. package/dist/chunk-58geavnf.js.map +0 -10
  723. package/dist/chunk-5a4a52tq.js.map +0 -10
  724. package/dist/chunk-9nsjjd44.js.map +0 -12
  725. package/dist/chunk-b9qfh2ya.js.map +0 -11
  726. package/dist/chunk-eptrvnby.js.map +0 -12
  727. package/dist/chunk-f6ahf5gf.js.map +0 -13
  728. package/dist/chunk-gxwy4c3s.js.map +0 -47
  729. package/dist/chunk-hvbvq7p4.js.map +0 -18
  730. package/dist/chunk-m2jerfef.js +0 -474
  731. package/dist/chunk-m2jerfef.js.map +0 -11
  732. package/dist/chunk-msyevpp3.js.map +0 -22
  733. package/dist/chunk-n4zzaf6q.js.map +0 -10
  734. package/dist/chunk-rsrc7vtw.js.map +0 -49
  735. package/dist/chunk-rsxb14an.js.map +0 -18
  736. package/dist/chunk-smnt672s.js.map +0 -10
  737. package/dist/chunk-t0s7b3d1.js.map +0 -13
  738. package/dist/chunk-td26wjr5.js.map +0 -13
  739. package/dist/chunk-vzkxqf8h.js.map +0 -23
  740. package/dist/chunk-wa05txmk.js.map +0 -11
  741. package/dist/chunk-yv8hv4wq.js.map +0 -10
  742. package/dist/chunk-yy914zfr.js.map +0 -30
  743. package/dist/chunk-zeykm8my.js.map +0 -14
  744. /package/dist/{chunk-stmxh0hv.js.map → chunk-3neam1y5.js.map} +0 -0
  745. /package/dist/{chunk-p8pgnq8d.js.map → chunk-425ydk65.js.map} +0 -0
  746. /package/dist/{chunk-p351afzm.js.map → chunk-5sswe5ej.js.map} +0 -0
  747. /package/dist/{chunk-e0hnbb1m.js.map → chunk-61zptves.js.map} +0 -0
  748. /package/dist/{chunk-fe6r7yhg.js.map → chunk-92wrka15.js.map} +0 -0
  749. /package/dist/{chunk-q9nkpr8k.js.map → chunk-9tpmfh3n.js.map} +0 -0
  750. /package/dist/{chunk-sysnvjce.js.map → chunk-brhp9d97.js.map} +0 -0
  751. /package/dist/{chunk-8a8k38tz.js.map → chunk-brybqw5k.js.map} +0 -0
  752. /package/dist/{chunk-855w9nvw.js.map → chunk-cg7cygfj.js.map} +0 -0
  753. /package/dist/{chunk-r2psmn42.js.map → chunk-eg6xqef7.js.map} +0 -0
  754. /package/dist/{chunk-7kpqntgw.js.map → chunk-f05994as.js.map} +0 -0
  755. /package/dist/{chunk-2bn6813a.js.map → chunk-grt2j5vp.js.map} +0 -0
  756. /package/dist/{chunk-rtdrm592.js.map → chunk-htdzx40w.js.map} +0 -0
  757. /package/dist/{chunk-bc3y6gff.js.map → chunk-jka26v8c.js.map} +0 -0
  758. /package/dist/{chunk-6ef4esq4.js.map → chunk-pqj8vff9.js.map} +0 -0
  759. /package/dist/{chunk-n68vz95m.js.map → chunk-qbd282aa.js.map} +0 -0
  760. /package/dist/{chunk-r9rtavg9.js.map → chunk-t19wjmnc.js.map} +0 -0
  761. /package/dist/{chunk-dhkc9b23.js.map → chunk-v8a1qjzp.js.map} +0 -0
  762. /package/dist/{chunk-8bns0y68.js.map → chunk-xf76csps.js.map} +0 -0
  763. /package/dist/{chunk-vepea5c3.js.map → chunk-ym1bqd98.js.map} +0 -0
@@ -2,11 +2,11 @@
2
2
  "version": 3,
3
3
  "sources": ["../src/artifacts/frames/entries.ts", "../src/artifacts/frames/grants.ts", "../src/artifacts/frames/probe.ts"],
4
4
  "sourcesContent": [
5
- "import type { ArtifactKind } from \"../kinds\"\nimport type { ArtifactOutline } from \"../outline\"\n\n/**\n * How the frame's runtime lays out what it serves: a deck shows 1280×720 slides scaled to fit, one\n * at a time or all at once; a page scrolls like any web page, as a canvas's boards do.\n */\nexport type FrameLayout = \"deck\" | \"page\"\n\n/** The kinds that open in a sandboxed frame, each in its layout. */\nconst FRAME_LAYOUTS: Partial<Readonly<Record<ArtifactKind, FrameLayout>>> = {\n slides: \"deck\",\n page: \"page\",\n canvas: \"page\",\n}\n\n/** A kind's frame layout, or null for a kind Sixb draws natively. */\nexport function frameLayout(kind: ArtifactKind): FrameLayout | null {\n return FRAME_LAYOUTS[kind] ?? null\n}\n\n/**\n * The files of a version its frame serves as pages, with the kit and the runtime first in their\n * `<head>`: a deck's or a page's entry, or each of a canvas's boards; none for a kind that does\n * not open in a frame.\n */\nexport function frameEntries(version: {\n readonly entry: string\n readonly outline: ArtifactOutline\n}): readonly string[] {\n if (version.outline.kind === \"canvas\") {\n return version.outline.items.flatMap((item) => (item.type === \"board\" ? [item.file] : []))\n }\n return frameLayout(version.outline.kind) ? [version.entry] : []\n}\n",
6
- "import { createHash, randomBytes } from \"node:crypto\"\nimport type {\n ArtifactFrameTarget,\n ArtifactStorage,\n ArtifactVersionRecord,\n} from \"../../storage/artifacts/types\"\nimport { parseArtifactAddress } from \"../address\"\nimport { CANVAS_FILE } from \"../canvas\"\nimport { ArtifactRequestError } from \"../errors\"\nimport { frameLayout } from \"./entries\"\n\n/** Path prefix of the route that serves a version's files to its frame. */\nexport const ARTIFACT_FRAME_ROUTE_PREFIX = \"/api/artifact-frames/\"\n\n/** A frame link lasts an hour; the app asks for a new one before it runs out. */\nconst FRAME_LIFETIME_MS = 60 * 60 * 1000\n/** 32 random bytes in base64url. */\nconst TOKEN_PATTERN = /^[A-Za-z0-9_-]{43}$/\n\nexport interface ArtifactFrame {\n /** The frame's base, ending in `/`: the version's files are served under it by their paths. */\n readonly path: string\n readonly expiresAt: Date\n}\n\ntype ReadArtifactVersion = (\n artifactId: string,\n version: number | \"latest\"\n) => Promise<ArtifactVersionRecord | null>\n\n/**\n * Issues a link that serves a version, as its files are now, to a sandboxed frame, with the files it\n * embeds from other artifacts that `read` finds. The token in the link is the credential: only its\n * hash is stored. Whoever asks must already have been allowed to read the version, and `read`\n * reads as them. Only a kind with a frame layout opens in one, since the frame serves its entry as\n * a page.\n */\nexport async function createArtifactFrame(input: {\n readonly projectId: string\n readonly storage: ArtifactStorage\n readonly version: ArtifactVersionRecord\n readonly read?: ReadArtifactVersion\n readonly now?: Date\n}): Promise<ArtifactFrame> {\n const { version } = input\n if (!frameLayout(version.outline.kind)) {\n throw new ArtifactRequestError(\n \"artifact_kind_mismatch\",\n `[Sixb] '${version.artifactId}' is a ${version.outline.kind}, which does not open in a frame. Read its files instead.`\n )\n }\n const createdAt = input.now ?? new Date()\n const expiresAt = new Date(createdAt.getTime() + FRAME_LIFETIME_MS)\n const token = randomBytes(32).toString(\"base64url\")\n await input.storage.createFrameGrant({\n projectId: input.projectId,\n tokenHash: hashToken(token),\n artifactId: version.artifactId,\n version: version.version,\n filesDigest: frameFilesDigest(version),\n targets: input.read ? await frameTargets(version, input.read) : [],\n createdAt,\n expiresAt,\n })\n return { path: `${ARTIFACT_FRAME_ROUTE_PREFIX}${token}/`, expiresAt }\n}\n\n/**\n * The files from other artifacts a version's frame may show its reader: each file it embeds\n * (`<img src=\"artifact:…/figure.svg\">`) that `read`, as the reader, finds. A pinned address shows\n * the created version it names, which never changes; an unpinned one follows its artifact's latest\n * version as it changes, the way the app shows it. A chart, range, or section is drawn by the app\n * over the frame, under the reader's own session, and needs nothing here.\n */\nasync function frameTargets(\n version: ArtifactVersionRecord,\n read: ReadArtifactVersion\n): Promise<ArtifactFrameTarget[]> {\n const targets: ArtifactFrameTarget[] = []\n for (const reference of version.references) {\n if (\n reference.as !== \"embed\" ||\n targets.some((target) => target.address === reference.address)\n ) {\n continue\n }\n const address = parseArtifactAddress(reference.address)\n if (!address?.path) continue\n const target = await read(address.artifactId, address.version ?? \"latest\").catch(() => null)\n if (!target?.files.some((file) => file.path === address.path)) continue\n targets.push({\n address: reference.address,\n artifactId: target.artifactId,\n version: address.version ?? \"latest\",\n })\n }\n return targets\n}\n\n/**\n * What a frame link serves: its version, and what it may show from other artifacts; `null` once\n * the link is unknown, expired, or its version gone or its files changed since, so a frame never\n * mixes two contents, and for a kind that does not open in a frame. A canvas written again with\n * only its items moved serves the same files, so its boards keep running.\n */\nexport async function resolveArtifactFrame(input: {\n readonly projectId: string\n readonly storage: ArtifactStorage\n readonly token: string\n readonly now?: Date\n}): Promise<{\n readonly version: ArtifactVersionRecord\n readonly targets: readonly ArtifactFrameTarget[]\n} | null> {\n if (!TOKEN_PATTERN.test(input.token)) return null\n const grant = await input.storage.findFrameGrant({\n projectId: input.projectId,\n tokenHash: hashToken(input.token),\n })\n if (!grant || grant.expiresAt <= (input.now ?? new Date())) return null\n const version = await input.storage.getVersion({\n projectId: input.projectId,\n artifactId: grant.artifactId,\n version: grant.version,\n })\n if (!version || frameFilesDigest(version) !== grant.filesDigest) return null\n\n return frameLayout(version.outline.kind) ? { version, targets: grant.targets } : null\n}\n\n/**\n * The files a version's frame serves, as a SHA-256 hex of their paths and digests. A canvas's\n * `canvas.json` is left out: no board loads it, and a canvas edited live writes it every few\n * seconds.\n */\nfunction frameFilesDigest(version: ArtifactVersionRecord): string {\n const served = version.files\n .filter((entry) => version.outline.kind !== \"canvas\" || entry.path !== CANVAS_FILE)\n .map((entry) => [entry.path, entry.file.digest] as const)\n .sort(([left], [right]) => (left < right ? -1 : left > right ? 1 : 0))\n return createHash(\"sha256\").update(JSON.stringify(served)).digest(\"hex\")\n}\n\nfunction hashToken(token: string): string {\n return createHash(\"sha256\").update(token).digest(\"hex\")\n}\n",
5
+ "import type { ArtifactOutline } from \"../outline\"\n\n/**\n * How the frame's runtime lays out what it serves: a deck shows 1280×720 slides scaled to fit, one\n * at a time or all at once; a page scrolls like any web page, as a canvas's boards do; a designed\n * document scrolls as one sheet, or as the pages its paper cuts it into.\n */\nexport type FrameLayout = \"deck\" | \"page\" | \"document\"\n\n/**\n * A version's frame layout, or null for one Sixb draws natively: a Markdown document, a sheet, or\n * a file.\n */\nexport function frameLayout(version: { readonly outline: ArtifactOutline }): FrameLayout | null {\n switch (version.outline.kind) {\n case \"slides\":\n return \"deck\"\n case \"page\":\n case \"canvas\":\n return \"page\"\n case \"document\":\n return version.outline.format === \"html\" ? \"document\" : null\n default:\n return null\n }\n}\n\n/**\n * The files of a version its frame serves as pages, with the kit and the runtime first in their\n * `<head>`: a deck's, a page's or a designed document's entry, or each of a canvas's boards; none\n * for a version that does not open in a frame.\n */\nexport function frameEntries(version: {\n readonly entry: string\n readonly outline: ArtifactOutline\n}): readonly string[] {\n if (version.outline.kind === \"canvas\") {\n return version.outline.items.flatMap((item) => (item.type === \"board\" ? [item.file] : []))\n }\n return frameLayout(version) ? [version.entry] : []\n}\n",
6
+ "import { createHash, randomBytes } from \"node:crypto\"\nimport type {\n ArtifactFrameTarget,\n ArtifactStorage,\n ArtifactVersionRecord,\n} from \"../../storage/artifacts/types\"\nimport { parseArtifactAddress } from \"../address\"\nimport { CANVAS_FILE } from \"../canvas\"\nimport { ArtifactRequestError } from \"../errors\"\nimport { frameLayout } from \"./entries\"\n\n/** Path prefix of the route that serves a version's files to its frame. */\nexport const ARTIFACT_FRAME_ROUTE_PREFIX = \"/api/artifact-frames/\"\n\n/** A frame link lasts an hour; the app asks for a new one before it runs out. */\nconst FRAME_LIFETIME_MS = 60 * 60 * 1000\n/** 32 random bytes in base64url. */\nconst TOKEN_PATTERN = /^[A-Za-z0-9_-]{43}$/\n\nexport interface ArtifactFrame {\n /** The frame's base, ending in `/`: the version's files are served under it by their paths. */\n readonly path: string\n readonly expiresAt: Date\n}\n\ntype ReadArtifactVersion = (\n artifactId: string,\n version: number | \"latest\"\n) => Promise<ArtifactVersionRecord | null>\n\n/**\n * Issues a link that serves a version, as its files are now, to a sandboxed frame, with the files it\n * embeds from other artifacts that `read` finds. The token in the link is the credential: only its\n * hash is stored. Whoever asks must already have been allowed to read the version, and `read`\n * reads as them. Only a kind with a frame layout opens in one, since the frame serves its entry as\n * a page.\n */\nexport async function createArtifactFrame(input: {\n readonly projectId: string\n readonly storage: ArtifactStorage\n readonly version: ArtifactVersionRecord\n readonly read?: ReadArtifactVersion\n readonly now?: Date\n}): Promise<ArtifactFrame> {\n const { version } = input\n if (!frameLayout(version)) {\n throw new ArtifactRequestError(\n \"artifact_kind_mismatch\",\n `[Sixb] '${version.artifactId}' is a ${version.outline.kind}, which does not open in a frame. Read its files instead.`\n )\n }\n const createdAt = input.now ?? new Date()\n const expiresAt = new Date(createdAt.getTime() + FRAME_LIFETIME_MS)\n const token = randomBytes(32).toString(\"base64url\")\n await input.storage.createFrameGrant({\n projectId: input.projectId,\n tokenHash: hashToken(token),\n artifactId: version.artifactId,\n version: version.version,\n filesDigest: frameFilesDigest(version),\n targets: input.read ? await frameTargets(version, input.read) : [],\n createdAt,\n expiresAt,\n })\n return { path: `${ARTIFACT_FRAME_ROUTE_PREFIX}${token}/`, expiresAt }\n}\n\n/**\n * The files from other artifacts a version's frame may show its reader: each file it embeds\n * (`<img src=\"artifact:…/figure.svg\">`) that `read`, as the reader, finds. A pinned address shows\n * the created version it names, which never changes; an unpinned one follows its artifact's latest\n * version as it changes, the way the app shows it. A chart, range, or section is drawn by the app\n * over the frame, under the reader's own session, and needs nothing here.\n */\nasync function frameTargets(\n version: ArtifactVersionRecord,\n read: ReadArtifactVersion\n): Promise<ArtifactFrameTarget[]> {\n const targets: ArtifactFrameTarget[] = []\n for (const reference of version.references) {\n if (\n reference.as !== \"embed\" ||\n targets.some((target) => target.address === reference.address)\n ) {\n continue\n }\n const address = parseArtifactAddress(reference.address)\n if (!address?.path) continue\n const target = await read(address.artifactId, address.version ?? \"latest\").catch(() => null)\n if (!target?.files.some((file) => file.path === address.path)) continue\n targets.push({\n address: reference.address,\n artifactId: target.artifactId,\n version: address.version ?? \"latest\",\n })\n }\n return targets\n}\n\n/**\n * What a frame link serves: its version, and what it may show from other artifacts; `null` once\n * the link is unknown, expired, or its version gone or its files changed since, so a frame never\n * mixes two contents, and for a kind that does not open in a frame. A canvas written again with\n * only its items moved serves the same files, so its boards keep running.\n */\nexport async function resolveArtifactFrame(input: {\n readonly projectId: string\n readonly storage: ArtifactStorage\n readonly token: string\n readonly now?: Date\n}): Promise<{\n readonly version: ArtifactVersionRecord\n readonly targets: readonly ArtifactFrameTarget[]\n} | null> {\n if (!TOKEN_PATTERN.test(input.token)) return null\n const grant = await input.storage.findFrameGrant({\n projectId: input.projectId,\n tokenHash: hashToken(input.token),\n })\n if (!grant || grant.expiresAt <= (input.now ?? new Date())) return null\n const version = await input.storage.getVersion({\n projectId: input.projectId,\n artifactId: grant.artifactId,\n version: grant.version,\n })\n if (!version || frameFilesDigest(version) !== grant.filesDigest) return null\n\n return frameLayout(version) ? { version, targets: grant.targets } : null\n}\n\n/**\n * The files a version's frame serves, as a SHA-256 hex of their paths and digests. A canvas's\n * `canvas.json` is left out: no board loads it, and a canvas edited live writes it every few\n * seconds.\n */\nfunction frameFilesDigest(version: ArtifactVersionRecord): string {\n const served = version.files\n .filter((entry) => version.outline.kind !== \"canvas\" || entry.path !== CANVAS_FILE)\n .map((entry) => [entry.path, entry.file.digest] as const)\n .sort(([left], [right]) => (left < right ? -1 : left > right ? 1 : 0))\n return createHash(\"sha256\").update(JSON.stringify(served)).digest(\"hex\")\n}\n\nfunction hashToken(token: string): string {\n return createHash(\"sha256\").update(token).digest(\"hex\")\n}\n",
7
7
  "/** A problem the layout probe found on a slide or a page, where it is, and its text. */\nexport interface LayoutProblem {\n readonly code:\n | \"outside\"\n | \"footer\"\n | \"wide\"\n | \"overlap\"\n | \"clipped\"\n | \"small_text\"\n | \"small_target\"\n | \"contrast\"\n | \"broken_image\"\n /** In the slide's 1280×720 pixels, or the page's from its top left. */\n readonly rect: {\n readonly x: number\n readonly y: number\n readonly width: number\n readonly height: number\n }\n /** The element's text, shortened, or its tag when it has none. */\n readonly text: string\n /** The element as CSS names it, `p.eyebrow`: the same problem on many slides shares it. */\n readonly selector: string\n /** `small_text`: its size in pixels. `contrast`: the ratio, and the two colors. */\n readonly size?: number\n /** `overlap`: the text it overlaps. */\n readonly other?: string\n readonly ratio?: number\n readonly colors?: readonly [string, string]\n}\n\n/**\n * Measures a slide the frame shows, laid out at its own size (`sixb-fill`), or the whole page, and\n * returns what a reader would find wrong with it. Run in the frame as its own source,\n * `(${layoutProbe})(3)` or `(${layoutProbe})(\"page\")`, so it names nothing outside itself.\n *\n * - `outside` (a slide): text or an image past the slide's edge, which the slide cuts off.\n * - `footer` (a slide): text or an image over the footer's rule, the source, or the number.\n * - `wide` (a page): text or an image past the window's right edge, outside any box that scrolls\n * sideways, which makes the whole page scroll sideways.\n * - `overlap`: text drawn over other text, line box on line box.\n * - `clipped`: text its own box cuts off.\n * - `small_text`: text under 18px on a slide, 12px on a page, as drawn, an SVG's scaled with it.\n * - `small_target` (a page): a button, field, or other control under 24px either way.\n * - `contrast`: text under WCAG AA against the solid colors painted under it, its own box's,\n * any box it overlaps, and an SVG shape's fill (4.5:1, or 3:1 from 24px, or 18.66px bold); text\n * over an image or a gradient is not judged.\n * - `broken_image`: an image of the deck's own that did not load.\n *\n * Another artifact's chart or image is a box here, sized as its host sizes it: it is measured as\n * one, and its content is the app's. A page is measured where the viewport shows it, so the check\n * sizes the viewport to the page first.\n */\nexport function layoutProbe(scope: number | \"page\"): LayoutProblem[] {\n const MAX_PER_CODE = 8\n const page = scope === \"page\"\n const slide = page\n ? document.body\n : document.querySelectorAll<HTMLElement>(\"section.slide\")[scope - 1]\n if (!slide) return []\n const box = page\n ? document.documentElement.getBoundingClientRect()\n : slide.getBoundingClientRect()\n const problems: LayoutProblem[] = []\n const counts = new Map<string, number>()\n const selector = (element: Element) =>\n element instanceof SVGElement && element.tagName.toLowerCase() !== \"svg\"\n ? `svg ${element.tagName.toLowerCase()}`\n : [element.tagName.toLowerCase(), ...Array.from(element.classList).slice(0, 2)].join(\".\")\n const report = (\n code: LayoutProblem[\"code\"],\n element: Element,\n details: Pick<LayoutProblem, \"size\" | \"ratio\" | \"colors\" | \"other\"> & { text?: string } = {}\n ) => {\n const count = counts.get(code) ?? 0\n if (count >= MAX_PER_CODE) return\n counts.set(code, count + 1)\n problems.push({\n code,\n rect: at(element.getBoundingClientRect()),\n selector: selector(element),\n ...details,\n text: details.text ?? describe(element),\n })\n }\n const at = (rect: DOMRect) => ({\n x: Math.round(rect.left - box.left),\n y: Math.round(rect.top - box.top),\n width: Math.round(rect.width),\n height: Math.round(rect.height),\n })\n // The text as a reader sees it: a line break separates words.\n const describe = (element: Element) =>\n (element instanceof HTMLElement ? element.innerText : (element.textContent ?? \"\"))\n .replace(/\\s+/g, \" \")\n .trim()\n .slice(0, 60) || element.tagName.toLowerCase()\n const shown = (element: Element) => {\n const style = getComputedStyle(element)\n if (style.display === \"none\" || style.visibility === \"hidden\" || style.opacity === \"0\") {\n return false\n }\n const rect = element.getBoundingClientRect()\n return rect.width > 0 && rect.height > 0\n }\n const ownText = (element: Element) =>\n Array.from(element.childNodes).some(\n (node) => node.nodeType === Node.TEXT_NODE && (node.textContent ?? \"\").trim() !== \"\"\n )\n const media = (element: Element) =>\n /^(img|svg|canvas|video|picture|table|sixb-embed)$/i.test(element.tagName)\n\n // What a reader sees: elements with text of their own, and media. Each judged once.\n const elements = Array.from(slide.querySelectorAll(\"*\")).filter(\n (element) => !element.closest(\"svg *, .source\") && shown(element)\n )\n const content = elements.filter((element) => ownText(element) || media(element))\n const svgText = Array.from(slide.querySelectorAll<SVGTextContentElement>(\"svg text\")).filter(\n (element) => (element.textContent ?? \"\").trim() !== \"\" && shown(element)\n )\n\n // Past the slide's edge, or over the footer; on a page, past the window's right edge. The\n // outermost offender stands for what it holds.\n const footer = getComputedStyle(slide, \"::after\")\n const footerTop =\n page || footer.content === \"none\" || footer.display === \"none\"\n ? Number.POSITIVE_INFINITY\n : box.bottom -\n Number.parseFloat(footer.bottom) -\n Number.parseFloat(footer.paddingTop) -\n Number.parseFloat(footer.lineHeight) -\n Number.parseFloat(footer.borderTopWidth)\n // The footer's rule spans these columns; a deck may narrow it beside an edge-to-edge image.\n const footerLeft = box.left + (Number.parseFloat(footer.left) || 0)\n const footerRight = box.right - (Number.parseFloat(footer.right) || 0)\n // An image that reaches the slide's bottom edge is drawn behind the footer on purpose: a\n // backdrop or an edge-to-edge photo. The kit's footer sits over it.\n const bleeds = (element: Element, rect: DOMRect) =>\n /^(img|picture|video|canvas)$/i.test(element.tagName) && rect.bottom >= box.bottom - 1\n const outside: Element[] = []\n // A box that scrolls sideways holds what is wider than the window, as a wide table's does.\n const scrolls = (element: Element) => {\n for (let node = element.parentElement; node && node !== slide; node = node.parentElement) {\n if (/auto|scroll/.test(getComputedStyle(node).overflowX)) return true\n }\n return false\n }\n for (const element of content) {\n if (outside.some((parent) => parent.contains(element))) continue\n const rect = element.getBoundingClientRect()\n if (page) {\n if (rect.right > window.innerWidth + 1 && !scrolls(element)) {\n outside.push(element)\n report(\"wide\", element)\n }\n continue\n }\n if (\n rect.left < box.left - 1 ||\n rect.top < box.top - 1 ||\n rect.right > box.right + 1 ||\n rect.bottom > box.bottom + 1\n ) {\n outside.push(element)\n report(\"outside\", element)\n } else if (\n rect.bottom > footerTop + 1 &&\n rect.top < box.bottom &&\n rect.right > footerLeft + 1 &&\n rect.left < footerRight - 1 &&\n !bleeds(element, rect)\n ) {\n outside.push(element)\n report(\"footer\", element)\n }\n }\n\n // Text over text: the lines each element's own text draws, against every other's. A range's\n // rectangle spans the font's whole ascent and descent, which a tight line-height (a stat's\n // number) leaves well outside its line: each is cut to its line-height around its middle.\n const lines = content\n .filter((element) => ownText(element) && !outside.some((parent) => parent.contains(element)))\n .map((element) => {\n const lineHeight = Number.parseFloat(getComputedStyle(element).lineHeight)\n const rects: DOMRect[] = []\n for (const node of Array.from(element.childNodes)) {\n if (node.nodeType !== Node.TEXT_NODE || (node.textContent ?? \"\").trim() === \"\") continue\n const range = document.createRange()\n range.selectNodeContents(node)\n for (const rect of Array.from(range.getClientRects())) {\n if (rect.width === 0) continue\n const inset =\n Number.isFinite(lineHeight) && rect.height > lineHeight\n ? (rect.height - lineHeight) / 2\n : 0\n rects.push(new DOMRect(rect.x, rect.y + inset, rect.width, rect.height - inset * 2))\n }\n }\n return { element, rects }\n })\n const crosses = (a: DOMRect, b: DOMRect) =>\n Math.min(a.right, b.right) - Math.max(a.left, b.left) > 3 &&\n Math.min(a.bottom, b.bottom) - Math.max(a.top, b.top) > 3\n const overlapping = new Set<Element>()\n for (const [index, a] of lines.entries()) {\n for (const b of lines.slice(index + 1)) {\n if (overlapping.has(a.element) || overlapping.has(b.element)) continue\n if (a.rects.some((rectA) => b.rects.some((rectB) => crosses(rectA, rectB)))) {\n overlapping.add(a.element)\n overlapping.add(b.element)\n report(\"overlap\", b.element, { other: describe(a.element) })\n }\n }\n }\n\n // Cut off by its own box.\n for (const element of elements) {\n if (outside.some((parent) => parent.contains(element) || element.contains(parent))) continue\n const style = getComputedStyle(element)\n const clips = /hidden|clip/.test(`${style.overflowX} ${style.overflowY}`)\n if (!clips || (element.textContent ?? \"\").trim() === \"\") continue\n const wraps = style.textOverflow === \"ellipsis\" && style.whiteSpace === \"nowrap\"\n if (\n !wraps &&\n (element.scrollHeight > element.clientHeight + 2 ||\n element.scrollWidth > element.clientWidth + 2)\n ) {\n report(\"clipped\", element)\n }\n }\n\n // Colors as the screen shows them: any CSS color, through a canvas pixel.\n const canvas = document.createElement(\"canvas\")\n canvas.width = 1\n canvas.height = 1\n const context = canvas.getContext(\"2d\", { willReadFrequently: true })\n const rgba = (color: string): [number, number, number, number] | null => {\n if (!context) return null\n context.clearRect(0, 0, 1, 1)\n context.fillStyle = \"rgba(0, 0, 0, 0)\"\n context.fillStyle = color\n context.fillRect(0, 0, 1, 1)\n const [r = 0, g = 0, b = 0, a = 0] = context.getImageData(0, 0, 1, 1).data\n return [r, g, b, a / 255]\n }\n const over = (\n top: [number, number, number, number],\n under: [number, number, number, number]\n ): [number, number, number, number] => [\n top[0] * top[3] + under[0] * (1 - top[3]),\n top[1] * top[3] + under[1] * (1 - top[3]),\n top[2] * top[3] + under[2] * (1 - top[3]),\n 1,\n ]\n /**\n * The solid color painted under an element's text, or null over an image or a gradient, or out\n * of the window: every\n * box under its center, top to bottom, its own and its ancestors' and any it overlaps, until an\n * opaque one.\n */\n const background = (element: Element): [number, number, number, number] | null => {\n const layers: [number, number, number, number][] = []\n const rect = element.getBoundingClientRect()\n const x = rect.left + rect.width / 2\n const y = rect.top + rect.height / 2\n // Out of the window, as a wide table's far cells are in the box it scrolls in, nothing is\n // under the point to measure.\n if (x < 0 || y < 0 || x > window.innerWidth || y > window.innerHeight) return null\n const stack = document.elementsFromPoint(x, y)\n // An SVG's text is not hit between its glyphs: then everything under the point counts.\n const start = Math.max(0, stack.indexOf(element))\n const under = stack.slice(start)\n // A photo or a video paints colors no style names.\n const pictures = under.filter((node) => /^(img|picture|video|canvas)$/i.test(node.tagName))\n for (const node of under) {\n if (pictures.includes(node)) return null\n // A box holding the picture paints under it, though its ::before, a scrim over the photo,\n // puts it above the picture in the stack.\n if (pictures.some((picture) => node.contains(picture))) continue\n const style = getComputedStyle(node)\n // An SVG shape paints with its fill: a chart's label sits on its bar.\n const shape = node instanceof SVGGeometryElement\n const paint = shape ? style.fill : style.backgroundColor\n if ((!shape && style.backgroundImage !== \"none\") || paint.startsWith(\"url(\")) return null\n const color = rgba(paint)\n if (color && shape) color[3] *= Number.parseFloat(style.fillOpacity) || 0\n if (color && color[3] > 0) {\n layers.push(color)\n if (color[3] >= 0.99) break\n }\n }\n return layers.reduceRight<[number, number, number, number]>(\n (under, top) => over(top, under),\n [255, 255, 255, 1]\n )\n }\n const luminance = ([r, g, b]: readonly number[]) => {\n const channel = (value = 0) => {\n const c = value / 255\n return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4\n }\n return 0.2126 * channel(r) + 0.7152 * channel(g) + 0.0722 * channel(b)\n }\n const hex = (color: readonly number[]) =>\n `#${color\n .slice(0, 3)\n .map((value) => Math.round(value).toString(16).padStart(2, \"0\"))\n .join(\"\")}`\n\n // Text: its size as drawn, and its contrast.\n const texts: { element: Element; size: number; ink: string }[] = [\n ...content\n .filter((element) => ownText(element))\n .map((element) => {\n const style = getComputedStyle(element)\n return { element, size: Number.parseFloat(style.fontSize), ink: style.color }\n }),\n ...svgText.map((element) => {\n const style = getComputedStyle(element)\n const scale = element.getScreenCTM()?.a ?? 1\n return { element, size: Number.parseFloat(style.fontSize) * scale, ink: style.fill }\n }),\n ]\n for (const { element, size, ink } of texts) {\n if (outside.some((parent) => parent.contains(element))) continue\n if (size < (page ? 11.5 : 17.5)) {\n report(\"small_text\", element, { size: Math.round(size * 10) / 10 })\n }\n const color = rgba(ink)\n const behind = background(element)\n if (!color || color[3] === 0 || !behind) continue\n const solid = over(color, behind)\n const [light, dark] = [luminance(solid), luminance(behind)].sort((a, b) => b - a)\n const ratio = ((light ?? 0) + 0.05) / ((dark ?? 0) + 0.05)\n const bold = Number.parseInt(getComputedStyle(element).fontWeight, 10) >= 700\n const needed = size >= 24 || (bold && size >= 18.66) ? 3 : 4.5\n if (ratio < needed) {\n report(\"contrast\", element, {\n ratio: Math.round(ratio * 100) / 100,\n colors: [hex(solid), hex(behind)],\n })\n }\n }\n\n // A control a finger or a pointer can miss: WCAG's 24px minimum target, on a page.\n if (page) {\n const controls = slide.querySelectorAll(\n 'button, select, textarea, summary, [role=\"button\"], a.button, input:not([type=\"hidden\"], [type=\"checkbox\"], [type=\"radio\"])'\n )\n for (const control of Array.from(controls)) {\n if (!shown(control)) continue\n const rect = control.getBoundingClientRect()\n if (rect.width < 23.5 || rect.height < 23.5) {\n report(\"small_target\", control, {\n size: Math.round(Math.min(rect.width, rect.height)),\n })\n }\n }\n }\n\n // An image from another artifact is the app's to load, not the deck's.\n for (const image of Array.from(\n slide.querySelectorAll<HTMLImageElement>(\"img:not([data-sixb-ref])\")\n )) {\n if (image.getAttribute(\"src\") && image.complete && image.naturalWidth === 0) {\n report(\"broken_image\", image, { text: image.getAttribute(\"src\") ?? \"img\" })\n }\n }\n return problems\n}\n"
8
8
  ],
9
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;AAUA,IAAM,gBAAsE;AAAA,EAC1E,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,QAAQ;AACV;AAGO,SAAS,WAAW,CAAC,MAAwC;AAAA,EAClE,OAAO,cAAc,SAAS;AAAA;AAQzB,SAAS,YAAY,CAAC,SAGP;AAAA,EACpB,IAAI,QAAQ,QAAQ,SAAS,UAAU;AAAA,IACrC,OAAO,QAAQ,QAAQ,MAAM,QAAQ,CAAC,SAAU,KAAK,SAAS,UAAU,CAAC,KAAK,IAAI,IAAI,CAAC,CAAE;AAAA,EAC3F;AAAA,EACA,OAAO,YAAY,QAAQ,QAAQ,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC;AAAA;;ACjChE;AAYO,IAAM,8BAA8B;AAG3C,IAAM,oBAAoB,KAAK,KAAK;AAEpC,IAAM,gBAAgB;AAoBf,eAAe,mBAAmB,CAAC,OAMf;AAAA,EACzB,QAAQ,YAAY;AAAA,EACpB,IAAI,CAAC,YAAY,QAAQ,QAAQ,IAAI,GAAG;AAAA,IACtC,MAAM,IAAI,sBACR,0BACA,WAAW,QAAQ,oBAAoB,QAAQ,QAAQ,+DACzD;AAAA,EACF;AAAA,EACA,MAAM,YAAY,MAAM,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KAAK,QAAQ,GAAG;AAAA,MAC1C,IAAI,CAAC,MAAM,OAAO;AAAA,QAAG;AAAA,MACrB,MAAM,OAAO,QAAQ,sBAAsB;AAAA,MAC3C,IAAI,KAAK,QAAQ,QAAQ,KAAK,SAAS,MAAM;AAAA,QAC3C,OAAO,gBAAgB,SAAS;AAAA,UAC9B,MAAM,KAAK,MAAM,KAAK,IAAI,KAAK,OAAO,KAAK,MAAM,CAAC;AAAA,QACpD,CAAC;AAAA,MACH;AAAA,IACF;AAAA,EACF;AAAA,EAGA,WAAW,SAAS,MAAM,KACxB,MAAM,iBAAmC,0BAA0B,CACrE,GAAG;AAAA,IACD,IAAI,MAAM,aAAa,KAAK,KAAK,MAAM,YAAY,MAAM,iBAAiB,GAAG;AAAA,MAC3E,OAAO,gBAAgB,OAAO,EAAE,MAAM,MAAM,aAAa,KAAK,KAAK,MAAM,CAAC;AAAA,IAC5E;AAAA,EACF;AAAA,EACA,OAAO;AAAA;",
10
+ "debugId": "F74697C06AC4BEFD64756E2164756E21",
11
11
  "names": []
12
12
  }
@@ -68,4 +68,19 @@ export declare const FRAME_DECK_CSS: string;
68
68
  * `.callout`. Every rule sits in the kit's layer, so a page's own CSS wins wherever it differs.
69
69
  */
70
70
  export declare const FRAME_PAGE_CSS: string;
71
+ /**
72
+ * A designed document's kit. Its own stylesheets design it: the kit only sets it on the stage.
73
+ *
74
+ * As one sheet, the body is the sheet: as wide as its paper, with the paper's margins as its
75
+ * padding, so its lines break where they will on paper, on the stage in the app's colors. A
76
+ * document's own CSS, unlayered, overrides any of that.
77
+ *
78
+ * As pages, the runtime moves the body's content into a flow laid out in columns of the paper's
79
+ * content box, and shows each column on a sheet of its own. The body becomes the stage those
80
+ * sheets sit on, so the rules that make it one are important: a document that styles its body as
81
+ * its sheet would otherwise draw the stage as one. So are those that size the sheets, their content
82
+ * boxes and the flow, which are elements a document's own `article` or `div` rules would reach.
83
+ * Its body's inherited styles, its font and its color, still reach every page.
84
+ */
85
+ export declare const FRAME_DOCUMENT_CSS: string;
71
86
  //# sourceMappingURL=kit.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"kit.d.ts","sourceRoot":"","sources":["../../../src/artifacts/frames/kit.ts"],"names":[],"mappings":"AAOA;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgDvB,CAAA;AAgCV;;;GAGG;AACH,eAAO,MAAM,cAAc,QAgTzB,CAAA;AAEF;;;;;GAKG;AACH,eAAO,MAAM,cAAc,QAkKzB,CAAA"}
1
+ {"version":3,"file":"kit.d.ts","sourceRoot":"","sources":["../../../src/artifacts/frames/kit.ts"],"names":[],"mappings":"AAOA;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgDvB,CAAA;AAgCV;;;GAGG;AACH,eAAO,MAAM,cAAc,QAgTzB,CAAA;AAEF;;;;;GAKG;AACH,eAAO,MAAM,cAAc,QAkKzB,CAAA;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,kBAAkB,QAsF7B,CAAA"}
@@ -17,8 +17,12 @@ export type DeckMode = "slide" | "overview" | "present";
17
17
  export interface FrameStart {
18
18
  readonly slide?: number;
19
19
  readonly fill?: boolean;
20
+ /** A designed document shown as the pages its paper cuts it into, not as one sheet. */
21
+ readonly pages?: boolean;
22
+ /** A designed document opened at a section, by its heading's slug. */
23
+ readonly section?: string;
20
24
  }
21
- /** The fragment that carries a frame's start: `#sixb-slide=3&sixb-fill`. */
25
+ /** The fragment that carries a frame's start: `#sixb-slide=3&sixb-fill`, `#sixb-pages`. */
22
26
  export declare function frameStartHash(start: FrameStart): string;
23
27
  /** What the app asks of the frame. */
24
28
  export type FrameRequest = FrameRequestOf<"theme", {
@@ -70,6 +74,13 @@ export type FrameRequest = FrameRequestOf<"theme", {
70
74
  */
71
75
  | FrameRequestOf<"canvas", {
72
76
  readonly moving: boolean;
77
+ }>
78
+ /**
79
+ * Runs a designed document's editor in its frame, served for editing: `code` is the editor's
80
+ * script, which takes the `MessagePort` the request transfers and edits the body in place.
81
+ */
82
+ | FrameRequestOf<"editor", {
83
+ readonly code: string;
73
84
  }>;
74
85
  interface FrameRequestOf<Method extends string, Params> {
75
86
  readonly protocol: typeof FRAME_PROTOCOL;
@@ -1 +1 @@
1
- {"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../../src/artifacts/frames/protocol.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAItE;;;;GAIG;AACH,eAAO,MAAM,cAAc,iBAAiB,CAAA;AAE5C;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,CAAA;AAEvD;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAA;CACxB;AAED,4EAA4E;AAC5E,wBAAgB,cAAc,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAMxD;AAED,sCAAsC;AACtC,MAAM,MAAM,YAAY,GACpB,cAAc,CACZ,OAAO,EACP;IAAE,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;CAAE,CAC9E,GACD,cAAc,CAAC,MAAM,EAAE;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,GAClD,cAAc,CAAC,MAAM,EAAE;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC;AACrD,sEAAsE;GACpE,cAAc,CAAC,QAAQ,EAAE;IAAE,QAAQ,CAAC,CAAC,EAAE,M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cAAc,CAAA;IACxC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAA;IACxB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CACxB;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,OAAO,GAAG,SAAS,GAAG,IAAI,CAoC9D;AA6BD,8FAA8F;AAC9F,eAAO,MAAM,SAAS,kHAWZ,CAAA;AAEV;;;GAGG;AACH,eAAO,MAAM,kBAAkB,mBAAwB,CAAA;AAEvD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,OAAO,GAAG,UAAU,GAAG,IAAI,CAoGhE"}
@@ -1,8 +1,9 @@
1
+ import type { DocumentData } from "./document-data";
1
2
  /**
2
3
  * The runtime the frame injects before anything else in an entry's `<head>`. It is served as this
3
- * function's own source, `(${frameRuntime})()`, so it imports nothing and names nothing outside
4
- * itself: the protocol string and the keys repeat what `protocol.ts` declares, and a test holds
5
- * the two together. Its tag names the layout, `data-sixb-layout`.
4
+ * function's own source, `(${frameRuntime})(${documentData})`, so it imports nothing but types and
5
+ * names nothing outside itself: the protocol string and the keys repeat what `protocol.ts`
6
+ * declares, and a test holds the two together. Its tag names the layout, `data-sixb-layout`.
6
7
  *
7
8
  * In every layout it applies the theme the app sends, then fires `sixb:theme` on the window for
8
9
  * what draws its own colors; answers the app's requests; and tells the app about the links the
@@ -14,6 +15,20 @@
14
15
  * the app about keys and picks in the overview. A page scrolls as it is: it reports the embeds
15
16
  * near its view as it scrolls, and its height as it changes.
16
17
  *
18
+ * A designed document scrolls as a page does, as one sheet of its paper (`data-sixb-paper`). With
19
+ * `sixb-pages` it is cut into pages instead, once its fonts and images have loaded: its content
20
+ * goes into a flow laid out in columns as wide and tall as the paper's content box, a forced page
21
+ * break becomes a column break, and each column shows on a sheet of its own. The first sheet keeps
22
+ * the original, which is what assistive technology reads; a sheet in view, or next to one, holds
23
+ * a copy of it, made as it comes near and dropped once it is far. It reports how many pages it
24
+ * made. `sixb-section=<slug>` opens it at the heading publishing named so.
25
+ *
26
+ * Its fields and repeated elements show live data, as `documentData`, which the runtime is given,
27
+ * walks them: once it has read the object that holds the document and the queries they name, as
28
+ * the reader, from the document as published, before it is cut into pages; and again, cut anew,
29
+ * whenever one of those changes. Opened on its own, it reads them as `sixb.query` does. Served for
30
+ * editing, it shows what is written in them, which takes no typing.
31
+ *
17
32
  * It gives every layout `window.sixb.state`, where a page keeps JSON values for its reader: each
18
33
  * call is a message the app answers, and the app keeps the values. Opened on its own, with no app
19
34
  * around it, as the layout check opens a page, the values live in memory until it closes.
@@ -43,6 +58,11 @@
43
58
  * in place, and the frame sends through the port what moves the canvas, their wheel turns unless
44
59
  * the page scrolls them, a finger's drag, Space held to drag, and the zooming above, and the words
45
60
  * of what they press, for the canvas to follow the arrow they label.
61
+ *
62
+ * A designed document served for editing may be handed its editor with `editor`: the script the
63
+ * app sends runs once, leaving a start function the runtime takes at once, and is handed the port
64
+ * that came with the request and the body, which it edits in place. From then on a click on a link
65
+ * places the caret rather than following it.
46
66
  */
47
- export declare function frameRuntime(): void;
67
+ export declare function frameRuntime(data?: () => DocumentData): void;
48
68
  //# sourceMappingURL=runtime.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../src/artifacts/frames/runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,wBAAgB,YAAY,IAAI,IAAI,CAs9BnC"}
1
+ {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../src/artifacts/frames/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EAIb,MAAM,iBAAiB,CAAA;AAExB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgEG;AACH,wBAAgB,YAAY,CAAC,IAAI,CAAC,EAAE,MAAM,YAAY,GAAG,IAAI,CAm1C5D"}
@@ -14,7 +14,9 @@ export { type DeckMode, FRAME_PROTOCOL, FRAME_THEME_TOKENS, type FrameCall, type
14
14
  export { ARTIFACT_KINDS, type ArtifactKind } from "./kinds";
15
15
  export { ARTIFACT_COMMENT_LIMITS, ARTIFACT_HOLDERS_LIMIT, ARTIFACT_LIMITS, ARTIFACT_STATE_LIMITS, } from "./limits";
16
16
  export { type LiveSheetColumn, type LiveSheetLayout, type LiveSheetRow, type LiveSheetTable, liveSheetColumns, liveSheetTable, } from "./live-sheet";
17
- export { type ArtifactOutline, type CanvasOutline, type CanvasOutlineItem, createHeadingSlugger, type DocumentHeading, type DocumentOutline, type FileOutline, type SheetOutline, type SheetSummary, type SlidesOutline, } from "./outline";
17
+ export { type ArtifactOutline, type CanvasOutline, type CanvasOutlineItem, createHeadingSlugger, type DocumentHeading, type DocumentHolder, type DocumentOutline, type FileOutline, type SheetOutline, type SheetSummary, type SlidesOutline, } from "./outline";
18
+ export type { DocumentPaper } from "./paper";
19
+ export { DOCUMENT_PDF_WAIT_MS } from "./pdf-job";
18
20
  export { type ArtifactFacetsQueryResult, type ArtifactObjectsQueryResult, type ArtifactQueryProperty, type ArtifactQueryPropertyType, type ArtifactQueryResult, type ArtifactQuerySchema, artifactQueryName, } from "./queries";
19
21
  export { type ArtifactAddressTarget, type ResolvedArtifactPart, resolveArtifactAddress, } from "./resolve";
20
22
  export { checkSheet } from "./sheet-rules";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/artifacts/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,qBAAqB,EACrB,iBAAiB,EACjB,oBAAoB,EACpB,cAAc,EACd,KAAK,SAAS,GACf,MAAM,WAAW,CAAA;AAClB,OAAO,EACL,WAAW,EACX,KAAK,MAAM,EACX,KAA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AM,YAAY,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/artifacts/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,qBAAqB,EACrB,iBAAiB,EACjB,oBAAoB,EACpB,cAAc,EACd,KAAK,SAAS,GACf,MAAM,WAAW,CAAA;AAClB,OAAO,EACL,WAAW,EACX,KAAK,MAAM,EACX,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,YAAY,EACZ,WAAW,GACZ,MAAM,UAAU,CAAA;AACjB,OAAO,EACL,qBAAqB,EACrB,kBAAkB,EAClB,kBAAkB,EAClB,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EACnB,yBAAyB,GAC1B,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AACrD,OAAO,EAAE,aAAa,EAAE,KAAK,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACzE,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,uBAAuB,EACvB,cAAc,EACd,iBAAiB,EACjB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,EACZ,sBAAsB,GACvB,MAAM,WAAW,CAAA;AAClB,OAAO,EACL,KAAK,QAAQ,EACb,cAAc,EACd,kBAAkB,EAClB,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,UAAU,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S,CAAA;AAChB,OAAO,EAAE,cAAc,EAAE,KAAK,YAAY,EAAE,MAAM,SAAS,CAAA;AAC3D,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACpB,oBAAoB,EACpB,cAAc,EACd,gBAAgB,EAChB,aAAa,EACb,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,EACZ,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,aAAa,EACb,aAAa,EACb,KAAK,QAAQ,EACb,KAAK,aAAa,EAClB,KAAK,aAAa,GACnB,MAAM,YAAY,CAAA"}
@@ -26,11 +26,12 @@ import {
26
26
  canvasArrowLine2,
27
27
  isArtifactQueryName,
28
28
  artifactQueryName2,
29
+ createHeadingSlugger2,
30
+ DOCUMENT_PDF_WAIT_MS2,
29
31
  ARTIFACT_THEME_FILE2,
30
32
  ARTIFACT_THEME_TOKENS,
31
33
  parseArtifactTheme2,
32
34
  resolveArtifactAddress2,
33
- createHeadingSlugger2,
34
35
  CsvParseError2,
35
36
  parseCsv2,
36
37
  formatCsv2,
@@ -56,7 +57,7 @@ import {
56
57
  liveSheetColumns2,
57
58
  liveSheetTable2,
58
59
  checkSheet2
59
- } from "../chunk-a6fjkcne.js";
60
+ } from "../chunk-60662fyv.js";
60
61
  import {
61
62
  ARTIFACT_KINDS2
62
63
  } from "../chunk-d7vyc7k6.js";
@@ -81,6 +82,10 @@ function frameStartHash(start) {
81
82
  params.push(`sixb-slide=${Math.round(start.slide)}`);
82
83
  if (start.fill)
83
84
  params.push("sixb-fill");
85
+ if (start.pages)
86
+ params.push("sixb-pages");
87
+ if (start.section)
88
+ params.push(`sixb-section=${encodeURIComponent(start.section)}`);
84
89
  return params.length > 0 ? `#${params.join("&")}` : "";
85
90
  }
86
91
  function parseFrameCall(data) {
@@ -319,6 +324,7 @@ export {
319
324
  CANVAS_FIT_PADDING2 as CANVAS_FIT_PADDING,
320
325
  CANVAS_TEXT_PIXELS2 as CANVAS_TEXT_PIXELS,
321
326
  CsvParseError2 as CsvParseError,
327
+ DOCUMENT_PDF_WAIT_MS2 as DOCUMENT_PDF_WAIT_MS,
322
328
  FORMULA_ERRORS2 as FORMULA_ERRORS,
323
329
  FRAME_PROTOCOL,
324
330
  FRAME_THEME_TOKENS,
@@ -365,4 +371,4 @@ export {
365
371
  sheetFilePath2 as sheetFilePath
366
372
  };
367
373
 
368
- //# debugId=FA17282EC9D00B9564756E2164756E21
374
+ //# debugId=F3BBB9DDF22B3DC264756E2164756E21
@@ -3,9 +3,9 @@
3
3
  "sources": ["../src/artifacts/comment-text.ts", "../src/artifacts/frames/protocol.ts"],
4
4
  "sourcesContent": [
5
5
  "import type { ArtifactCommentAnchor } from \"../storage/artifacts/types\"\n\n/**\n * A comment as a message to the Agent quotes it: where it is, then its words, as the\n * `sixb-artifacts` skill tells the Agent to read it. `[welcome · body>main:0>h1:0 · \"Welcome\n * back\" · revision 12 · comment cmt_4k2a9c0d1e · from Ava Martin] Make the title warmer.` A\n * comment on a whole board names no element, and one on the artifact no board; the comment's id\n * lets the Agent resolve it, or reply to it, and its author's name says whose request it is: `from\n * guest Ava Martin` for a shared link's visitor, whose name nobody vouches for. Browser-safe, for\n * the app to draft the message with.\n */\nexport function quoteArtifactComment(comment: {\n readonly id?: string\n readonly authorName?: string | null\n /** Its author opened a shared link: a guest, without an account. */\n readonly guest?: boolean\n readonly anchor: ArtifactCommentAnchor\n readonly body: string\n}): string {\n const { anchor } = comment\n const where = [\n anchor.board,\n anchor.element,\n anchor.label ? JSON.stringify(anchor.label) : undefined,\n `revision ${anchor.revision}`,\n comment.id ? `comment ${comment.id}` : undefined,\n comment.authorName\n ? `from ${comment.guest ? \"guest \" : \"\"}${comment.authorName.replace(/\\s+/g, \" \").trim()}`\n : undefined,\n ].filter((part): part is string => part !== undefined)\n return `[${where.join(\" · \")}] ${comment.body.replace(/\\s+/g, \" \").trim()}`\n}\n",
6
- "import { ARTIFACT_LIMITS, ARTIFACT_STATE_LIMITS } from \"../limits\"\nimport type { BoardElementKind, BoardFramePatch } from \"../live/board\"\nimport { isArtifactQueryName } from \"../queries\"\nimport { ARTIFACT_THEME_TOKENS } from \"../theme\"\n\n/**\n * Messages between the app and an artifact in its sandboxed frame: a deck, or a page. The app\n * asks; the frame answers each request by its id, and tells the app what happened inside it as\n * events. Later abilities are new methods and events, not a new protocol.\n */\nexport const FRAME_PROTOCOL = \"sixb-frame/1\"\n\n/**\n * A deck shows one slide scaled to fit on its stage, every slide in a grid, or one slide filling\n * the page to present it.\n */\nexport type DeckMode = \"slide\" | \"overview\" | \"present\"\n\n/**\n * How a frame opens, set in its URL so the first paint is right: at a slide, and with `fill`, that\n * slide alone filling the frame with no stage around it, as a thumbnail or an embed shows it.\n */\nexport interface FrameStart {\n readonly slide?: number\n readonly fill?: boolean\n}\n\n/** The fragment that carries a frame's start: `#sixb-slide=3&sixb-fill`. */\nexport function frameStartHash(start: FrameStart): string {\n const params: string[] = []\n if (start.slide !== undefined && start.slide > 1)\n params.push(`sixb-slide=${Math.round(start.slide)}`)\n if (start.fill) params.push(\"sixb-fill\")\n return params.length > 0 ? `#${params.join(\"&\")}` : \"\"\n}\n\n/** What the app asks of the frame. */\nexport type FrameRequest =\n | FrameRequestOf<\n \"theme\",\n { readonly tokens: Readonly<Record<string, string>>; readonly dark: boolean }\n >\n | FrameRequestOf<\"goto\", { readonly slide: number }>\n | FrameRequestOf<\"mode\", { readonly mode: DeckMode }>\n /** Scrolls a page by a wheel turned over what the app draws on it. */\n | FrameRequestOf<\"scroll\", { readonly x: number; readonly y: number }>\n /** Loads the entry again, as a page whose data was reset starts over. */\n | FrameRequestOf<\"reload\", Record<string, never>>\n /**\n * A query the page read has new rows: the objects it reads changed. The page reads them with\n * `sixb.query(name)` again; the app sends it only for the queries that frame has read.\n */\n | FrameRequestOf<\"query.changed\", { readonly name: string }>\n /**\n * Starts or stops editing a canvas's board, served for editing (`?sixb-edit`): the frame then\n * reports what the reader points at and picks, by address, and lets them type into text. With\n * `typing: false`, a text the reader picks takes no typing, as when they pick what to comment on.\n * The first request after the frame loads transfers a `MessagePort`: the frame reports editing\n * (`edit.hover`, `edit.select`, `edit.text`) through it alone, never through the window.\n */\n | FrameRequestOf<\"edit\", { readonly on: boolean; readonly typing?: boolean }>\n /**\n * What someone else changed in the board, element by element, as `boardFramePatches` says. The\n * element the reader is typing in takes its patch once they leave it.\n */\n | FrameRequestOf<\"edit.patch\", { readonly patches: readonly BoardFramePatch[] }>\n /**\n * A canvas's board running on the canvas, where the reader uses its page in place. The first\n * request after the frame loads transfers a `MessagePort`: the frame then sends through it alone\n * the reader's gestures the canvas takes (`zoom`, `pan`, `space`) and the words of what they\n * press. `moving` says the canvas is panning by the wheel: a page coming under a still pointer\n * then keeps panning the canvas rather than scrolling itself.\n */\n | FrameRequestOf<\"canvas\", { readonly moving: boolean }>\n\ninterface FrameRequestOf<Method extends string, Params> {\n readonly protocol: typeof FRAME_PROTOCOL\n readonly id: number\n readonly method: Method\n readonly params: Params\n}\n\n/** The frame's answer to one request. */\nexport interface FrameResponse {\n readonly protocol: typeof FRAME_PROTOCOL\n readonly id: number\n readonly error?: string\n}\n\n/** What happened inside the frame. */\nexport type FrameEvent =\n /** The frame has laid out its entry: a deck says how many slides it has. */\n | FrameEventOf<\"ready\", { readonly slides?: number }>\n /** The reader picked a slide in the overview. */\n | FrameEventOf<\"select\", { readonly slide: number }>\n /** A key the app handles, pressed while the frame had focus. */\n | FrameEventOf<\"key\", { readonly key: string }>\n /** A link to another artifact, which opens where the reader is. */\n | FrameEventOf<\"open\", { readonly address: string }>\n /**\n * A link to a web page, which the app opens in a new tab: the frame cannot open windows itself.\n * Only `http:` and `https:` addresses.\n */\n | FrameEventOf<\"link\", { readonly url: string }>\n /**\n * Where the `<sixb-embed>` boxes in view are, for the app to draw each over the frame: in the\n * frame's pixels, with the scale they are drawn at. A deck reports the shown slide's, and none in\n * the overview, where an embed stays a placeholder, as it does in a filled frame, which never\n * reports; a page reports those near its view as it scrolls, at its own scale.\n */\n | FrameEventOf<\"embeds\", { readonly embeds: readonly FrameEmbed[] }>\n /** A page's height as laid out at the frame's width, so a document can size the frame to it. */\n | FrameEventOf<\"size\", { readonly height: number }>\n /**\n * The reader pressed a button, or a link within the page, that reads `text`: a canvas's board\n * follows the arrow that leaves it with that label. At most a label's length. A board running on\n * the canvas also sends it through its port, for the reader's own presses alone.\n */\n | FrameEventOf<\"press\", { readonly text: string }>\n /** Editing, the reader points at an element, or at none. */\n | FrameEventOf<\"edit.hover\", { readonly target: FrameEditTarget | null }>\n /** Editing, the reader picked an element, or none, clicking `at` that point of the frame. */\n | FrameEventOf<\n \"edit.select\",\n { readonly target: FrameEditTarget | null; readonly at?: FramePoint }\n >\n /**\n * Editing, the reader typed in a text element: all its words now, as plain text, and `base`,\n * its words as the frame last posted them, or as they were when the reader started typing. The\n * app makes it with `mergeBoardText`, so what others changed in the element since stays.\n *\n * The runtime takes the port before the board's scripts run, and stops the request that hands\n * it over before they hear it, so they cannot post on it; it reports only the reader's own\n * clicks and keys. What it posts is what the element holds, which the board's scripts can still\n * rewrite. The app takes `edit.text` only for the element the reader picked, the last\n * `edit.select` it heard, and nothing once the board's elements changed under the frame.\n */\n | FrameEventOf<\n \"edit.text\",\n { readonly address: string; readonly base: string; readonly text: string }\n >\n /**\n * The reader zoomed over a canvas's board, opened or running on the canvas, which the app zooms\n * instead of the browser: a pinch or the wheel with ⌘ or Ctrl, `factor` times around `at`, in\n * the frame's pixels; or ⌘ or Ctrl with +, − or 0, a `step`. Only a frame handed a port with\n * `edit` or `canvas` reports it, through that port, and only for the reader's own gestures and\n * keys; any other leaves them to the browser.\n */\n | FrameEventOf<\"zoom\", FrameZoom>\n /**\n * The reader turned the wheel or dragged a finger over a board running on the canvas, which pans\n * the canvas instead of scrolling the page. Only a frame handed a port with `canvas` reports it,\n * through that port, for the reader's own gestures.\n */\n | FrameEventOf<\"pan\", FramePan>\n /**\n * The reader pressed or let go of Space over a board running on the canvas, outside a field:\n * while it is held, dragging pans the canvas. Through the port, as `pan` is.\n */\n | FrameEventOf<\"space\", { readonly down: boolean }>\n\n/**\n * How far the reader scrolled, as a wheel's deltas say it: `x` right and `y` down, in pixels. A\n * finger dragging scrolls the opposite way it moves, as it would scroll a page; the wheel's turns\n * pan the canvas at its own speed for them, as React Flow's do.\n */\nexport interface FramePan {\n readonly x: number\n readonly y: number\n readonly by: \"wheel\" | \"touch\"\n}\n\n/** How the reader zoomed: by a gesture, or by a key. */\nexport type FrameZoom =\n | { readonly factor: number; readonly at: FramePoint }\n | { readonly step: FrameZoomStep }\n\n/** ⌘ or Ctrl with +, − or 0: in, out, or the page at its own size. */\nexport type FrameZoomStep = \"in\" | \"out\" | \"actual\"\n\n/**\n * An element of a board being edited. One a script built, or whose words a script rewrote, is\n * `scripted`: it has no address of its own, and `within` names the element it sits in.\n */\nexport type FrameEditTarget =\n | {\n readonly address: string\n readonly kind: BoardElementKind\n readonly label: string\n readonly rect: FrameRect\n }\n | {\n readonly address: null\n readonly kind: \"scripted\"\n readonly within: string | null\n /** The words the reader pointed at, as the page shows them now. */\n readonly label?: string\n readonly rect: FrameRect\n }\n\nexport interface FramePoint {\n readonly x: number\n readonly y: number\n}\n\nexport interface FrameRect {\n readonly x: number\n readonly y: number\n readonly width: number\n readonly height: number\n}\n\n/** One `<sixb-embed>` the frame shows. */\nexport interface FrameEmbed {\n /** The element's own id while the page is loaded: the same as it scrolls out and back. */\n readonly id: number\n readonly address: string\n readonly rect: {\n readonly x: number\n readonly y: number\n readonly width: number\n readonly height: number\n }\n /**\n * The scale it is drawn at: a slide's, where the embed is laid out at `rect / scale` and scaled\n * with the slide; 1 on a page.\n */\n readonly scale: number\n}\n\ninterface FrameEventOf<Event extends string, Params> {\n readonly protocol: typeof FRAME_PROTOCOL\n readonly event: Event\n readonly params: Params\n}\n\n/**\n * What the frame asks of the app, numbered so the app's `result` answers it: a page keeping data\n * with `sixb.state`, or reading one of its version's queries with `sixb.query`. The app answers\n * only its own frame, for the artifact and the version it shows.\n */\nexport type FrameCall =\n | FrameCallOf<\"state.get\", { readonly key: string }>\n | FrameCallOf<\"state.set\", { readonly key: string; readonly value: unknown }>\n | FrameCallOf<\"state.delete\", { readonly key: string }>\n | FrameCallOf<\"state.keys\", Record<string, never>>\n /** Runs `queries/<name>.json` as the reader; the value is the query route's JSON. */\n | FrameCallOf<\"query.run\", { readonly name: string }>\n\ninterface FrameCallOf<Method extends string, Params> {\n readonly protocol: typeof FRAME_PROTOCOL\n readonly call: number\n readonly method: Method\n readonly params: Params\n}\n\n/** The app's answer to one call: its value, or why it failed. */\nexport interface FrameCallResult {\n readonly protocol: typeof FRAME_PROTOCOL\n readonly result: number\n readonly value?: unknown\n readonly error?: string\n}\n\n/**\n * A message from a frame as a call, or null when it is not one. A page's scripts write what it\n * posts, so the shapes are checked here, and a value is checked for size as JSON, as storage will\n * count it, before the app sends it anywhere.\n */\nexport function parseFrameCall(data: unknown): FrameCall | null {\n if (!isRecord(data) || data.protocol !== FRAME_PROTOCOL || !isRecord(data.params)) return null\n if (!Number.isSafeInteger(data.call) || Number(data.call) < 0) return null\n const call = Number(data.call)\n const { params } = data\n const key = params.key\n const keyed = isStateKey(key)\n switch (data.method) {\n case \"state.get\":\n case \"state.delete\":\n return keyed\n ? ({ protocol: FRAME_PROTOCOL, call, method: data.method, params: { key } } as FrameCall)\n : null\n case \"state.set\": {\n if (!keyed || !(\"value\" in params)) return null\n const json = jsonText(params.value)\n if (json === undefined || utf8Bytes(json) > ARTIFACT_STATE_LIMITS.maxValueBytes) return null\n return {\n protocol: FRAME_PROTOCOL,\n call,\n method: \"state.set\",\n params: { key, value: params.value },\n }\n }\n case \"state.keys\":\n return { protocol: FRAME_PROTOCOL, call, method: \"state.keys\", params: {} }\n case \"query.run\": {\n // The client puts the name in the URL's path, as it does a key.\n const { name } = params\n if (typeof name !== \"string\" || !isArtifactQueryName(name)) return null\n\n return { protocol: FRAME_PROTOCOL, call, method: \"query.run\", params: { name } }\n }\n default:\n return null\n }\n}\n\n/**\n * A key the app can send: the client puts it in the URL's path, where `.` and `..` would name\n * another route, `..` the artifact itself.\n */\nfunction isStateKey(value: unknown): value is string {\n return (\n typeof value === \"string\" &&\n value.length > 0 &&\n value.length <= ARTIFACT_STATE_LIMITS.maxKeyLength &&\n !/\\p{Cc}/u.test(value) &&\n value !== \".\" &&\n value !== \"..\"\n )\n}\n\nfunction jsonText(value: unknown): string | undefined {\n try {\n return JSON.stringify(value)\n } catch {\n return undefined\n }\n}\n\nfunction utf8Bytes(text: string): number {\n return new TextEncoder().encode(text).byteLength\n}\n\n/** Keys the frame passes to the app, so a deck navigates the same with focus in it or not. */\nexport const DECK_KEYS = [\n \"ArrowLeft\",\n \"ArrowRight\",\n \"ArrowUp\",\n \"ArrowDown\",\n \"PageUp\",\n \"PageDown\",\n \"Home\",\n \"End\",\n \" \",\n \"Escape\",\n] as const\n\n/**\n * The theme tokens the app sends into a frame, read from the viewer as it is themed: the ones an\n * artifact's theme may set.\n */\nexport const FRAME_THEME_TOKENS = ARTIFACT_THEME_TOKENS\n\n/**\n * A message from a frame as an event, or null when it is not one this protocol sends. A deck runs\n * its own scripts, so anything it posts is checked for the shape the app relies on: whole slide\n * numbers, a key the app handles, finite boxes, and no more embeds than a version may record.\n */\nexport function parseFrameEvent(data: unknown): FrameEvent | null {\n if (!isRecord(data) || data.protocol !== FRAME_PROTOCOL || !isRecord(data.params)) return null\n const { params } = data\n switch (data.event) {\n case \"ready\":\n if (params.slides === undefined) return event(\"ready\", {})\n return isCount(params.slides) ? event(\"ready\", { slides: params.slides }) : null\n case \"select\":\n return isCount(params.slide) && params.slide > 0\n ? event(\"select\", { slide: params.slide })\n : null\n case \"key\":\n return typeof params.key === \"string\" && (DECK_KEYS as readonly string[]).includes(params.key)\n ? event(\"key\", { key: params.key })\n : null\n case \"open\":\n return isAddress(params.address) ? event(\"open\", { address: params.address }) : null\n case \"link\":\n return isWebAddress(params.url) ? event(\"link\", { url: params.url }) : null\n case \"embeds\": {\n const { embeds } = params\n if (!Array.isArray(embeds) || embeds.length > ARTIFACT_LIMITS.maxReferences) return null\n const parsed: FrameEmbed[] = []\n const ids = new Set<number>()\n for (const embed of embeds) {\n if (!isRecord(embed) || !isAddress(embed.address) || !isRecord(embed.rect)) return null\n\n // Two embeds with one id would be one element drawn twice.\n if (!isCount(embed.id) || ids.has(embed.id)) return null\n ids.add(embed.id)\n\n const { x, y, width, height } = embed.rect\n if (![x, y, width, height, embed.scale].every(Number.isFinite)) return null\n if (Number(width) < 0 || Number(height) < 0 || Number(embed.scale) <= 0) return null\n parsed.push({\n id: embed.id,\n address: embed.address,\n rect: { x: Number(x), y: Number(y), width: Number(width), height: Number(height) },\n scale: Number(embed.scale),\n })\n }\n return event(\"embeds\", { embeds: parsed })\n }\n case \"size\":\n return Number.isFinite(params.height) && Number(params.height) >= 0\n ? event(\"size\", { height: Math.min(Number(params.height), MAX_HEIGHT) })\n : null\n case \"edit.hover\":\n case \"edit.select\": {\n const at = data.event === \"edit.select\" ? parsePoint(params.at) : undefined\n if (at === null) return null\n const point = at ? { at } : {}\n if (params.target === null) return event(data.event, { target: null, ...point })\n const target = parseEditTarget(params.target)\n return target ? event(data.event, { target, ...point }) : null\n }\n case \"edit.text\":\n return isEditAddress(params.address) &&\n typeof params.text === \"string\" &&\n params.text.length <= MAX_EDIT_TEXT_LENGTH &&\n typeof params.base === \"string\" &&\n params.base.length <= MAX_EDIT_TEXT_LENGTH\n ? event(\"edit.text\", { address: params.address, base: params.base, text: params.text })\n : null\n case \"zoom\": {\n if (params.step !== undefined) {\n return ZOOM_STEPS.includes(String(params.step))\n ? event(\"zoom\", { step: params.step as FrameZoomStep })\n : null\n }\n\n const at = parsePoint(params.at)\n const factor = Number(params.factor)\n if (!at || !Number.isFinite(params.factor) || factor <= 0) return null\n\n return event(\"zoom\", {\n factor: Math.min(MAX_ZOOM_FACTOR, Math.max(1 / MAX_ZOOM_FACTOR, factor)),\n at,\n })\n }\n case \"pan\": {\n const { x, y, by } = params\n if (!Number.isFinite(x) || !Number.isFinite(y) || (by !== \"wheel\" && by !== \"touch\")) {\n return null\n }\n\n const bounded = (delta: number) => Math.min(MAX_PAN, Math.max(-MAX_PAN, delta))\n return event(\"pan\", { x: bounded(Number(x)), y: bounded(Number(y)), by })\n }\n case \"space\":\n return typeof params.down === \"boolean\" ? event(\"space\", { down: params.down }) : null\n case \"press\":\n return typeof params.text === \"string\" &&\n params.text.length > 0 &&\n params.text.length <= ARTIFACT_LIMITS.maxCanvasLabelLength\n ? event(\"press\", { text: params.text })\n : null\n default:\n return null\n }\n}\n\n/** The most words a text element of a board takes from one edit: a board's own size. */\nconst MAX_EDIT_TEXT_LENGTH = ARTIFACT_LIMITS.maxBoardBytes\n\nconst EDIT_KINDS: readonly string[] = [\"text\", \"image\", \"whole\", \"box\"]\n\nconst ZOOM_STEPS: readonly string[] = [\"in\", \"out\", \"actual\"] satisfies FrameZoomStep[]\n\n/** The most one gesture zooms by, either way: a wheel's notch is far less. */\nconst MAX_ZOOM_FACTOR = 4\n\n/** The most one wheel's turn or one finger's move pans by, either way: a screen's width. */\nconst MAX_PAN = 4000\n\n/** The longest label a frame reports for an element: the runtime cuts its own at 80. */\nconst MAX_EDIT_LABEL_LENGTH = 200\n\n/** An address as `boardElements` writes one: steps of a tag and an index, from the body. */\nfunction isEditAddress(value: unknown): value is string {\n return (\n typeof value === \"string\" && value.length <= 2048 && /^body(>[a-z][a-z0-9-]*:\\d+)*$/.test(value)\n )\n}\n\n/** A point the frame reports: undefined for none, null for one that does not read. */\nfunction parsePoint(value: unknown): FramePoint | null | undefined {\n if (value === undefined) return undefined\n if (!isRecord(value) || !Number.isFinite(value.x) || !Number.isFinite(value.y)) return null\n return { x: Number(value.x), y: Number(value.y) }\n}\n\nfunction parseEditTarget(value: unknown): FrameEditTarget | null {\n if (!isRecord(value) || !isRecord(value.rect)) return null\n const { x, y, width, height } = value.rect\n if (![x, y, width, height].every(Number.isFinite)) return null\n const rect = { x: Number(x), y: Number(y), width: Number(width), height: Number(height) }\n\n if (value.kind === \"scripted\") {\n if (value.address !== null) return null\n if (value.within !== null && !isEditAddress(value.within)) return null\n const label =\n typeof value.label === \"string\" && value.label.length <= MAX_EDIT_LABEL_LENGTH\n ? { label: value.label }\n : {}\n return {\n address: null,\n kind: \"scripted\",\n within: value.within as string | null,\n ...label,\n rect,\n }\n }\n if (!isEditAddress(value.address) || !EDIT_KINDS.includes(String(value.kind))) return null\n if (typeof value.label !== \"string\" || value.label.length > MAX_EDIT_LABEL_LENGTH) return null\n return {\n address: value.address,\n kind: value.kind as BoardElementKind,\n label: value.label,\n rect,\n }\n}\n\n/** The most a page reports as its height: more is a page that grows with its frame. */\nconst MAX_HEIGHT = 100_000\n\nfunction event<Name extends FrameEvent[\"event\"]>(\n name: Name,\n params: Extract<FrameEvent, { event: Name }>[\"params\"]\n): FrameEvent {\n return { protocol: FRAME_PROTOCOL, event: name, params } as FrameEvent\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null\n}\n\nfunction isCount(value: unknown): value is number {\n return Number.isSafeInteger(value) && Number(value) >= 0\n}\n\n/** Long enough for any address a version can record; the app resolves it before using it. */\nfunction isAddress(value: unknown): value is string {\n return typeof value === \"string\" && value.length <= 2048\n}\n\n/** The longest web address the app opens: longer than any link a page needs. */\nconst MAX_URL_LENGTH = 8192\n\n/** An absolute `http:` or `https:` address, as the frame resolves a link's. */\nfunction isWebAddress(value: unknown): value is string {\n if (typeof value !== \"string\" || value.length > MAX_URL_LENGTH) return false\n\n try {\n const { protocol } = new URL(value)\n return protocol === \"http:\" || protocol === \"https:\"\n } catch {\n return false\n }\n}\n"
6
+ "import { ARTIFACT_LIMITS, ARTIFACT_STATE_LIMITS } from \"../limits\"\nimport type { BoardElementKind, BoardFramePatch } from \"../live/board\"\nimport { isArtifactQueryName } from \"../queries\"\nimport { ARTIFACT_THEME_TOKENS } from \"../theme\"\n\n/**\n * Messages between the app and an artifact in its sandboxed frame: a deck, or a page. The app\n * asks; the frame answers each request by its id, and tells the app what happened inside it as\n * events. Later abilities are new methods and events, not a new protocol.\n */\nexport const FRAME_PROTOCOL = \"sixb-frame/1\"\n\n/**\n * A deck shows one slide scaled to fit on its stage, every slide in a grid, or one slide filling\n * the page to present it.\n */\nexport type DeckMode = \"slide\" | \"overview\" | \"present\"\n\n/**\n * How a frame opens, set in its URL so the first paint is right: at a slide, and with `fill`, that\n * slide alone filling the frame with no stage around it, as a thumbnail or an embed shows it.\n */\nexport interface FrameStart {\n readonly slide?: number\n readonly fill?: boolean\n /** A designed document shown as the pages its paper cuts it into, not as one sheet. */\n readonly pages?: boolean\n /** A designed document opened at a section, by its heading's slug. */\n readonly section?: string\n}\n\n/** The fragment that carries a frame's start: `#sixb-slide=3&sixb-fill`, `#sixb-pages`. */\nexport function frameStartHash(start: FrameStart): string {\n const params: string[] = []\n if (start.slide !== undefined && start.slide > 1)\n params.push(`sixb-slide=${Math.round(start.slide)}`)\n if (start.fill) params.push(\"sixb-fill\")\n if (start.pages) params.push(\"sixb-pages\")\n if (start.section) params.push(`sixb-section=${encodeURIComponent(start.section)}`)\n return params.length > 0 ? `#${params.join(\"&\")}` : \"\"\n}\n\n/** What the app asks of the frame. */\nexport type FrameRequest =\n | FrameRequestOf<\n \"theme\",\n { readonly tokens: Readonly<Record<string, string>>; readonly dark: boolean }\n >\n | FrameRequestOf<\"goto\", { readonly slide: number }>\n | FrameRequestOf<\"mode\", { readonly mode: DeckMode }>\n /** Scrolls a page by a wheel turned over what the app draws on it. */\n | FrameRequestOf<\"scroll\", { readonly x: number; readonly y: number }>\n /** Loads the entry again, as a page whose data was reset starts over. */\n | FrameRequestOf<\"reload\", Record<string, never>>\n /**\n * A query the page read has new rows: the objects it reads changed. The page reads them with\n * `sixb.query(name)` again; the app sends it only for the queries that frame has read.\n */\n | FrameRequestOf<\"query.changed\", { readonly name: string }>\n /**\n * Starts or stops editing a canvas's board, served for editing (`?sixb-edit`): the frame then\n * reports what the reader points at and picks, by address, and lets them type into text. With\n * `typing: false`, a text the reader picks takes no typing, as when they pick what to comment on.\n * The first request after the frame loads transfers a `MessagePort`: the frame reports editing\n * (`edit.hover`, `edit.select`, `edit.text`) through it alone, never through the window.\n */\n | FrameRequestOf<\"edit\", { readonly on: boolean; readonly typing?: boolean }>\n /**\n * What someone else changed in the board, element by element, as `boardFramePatches` says. The\n * element the reader is typing in takes its patch once they leave it.\n */\n | FrameRequestOf<\"edit.patch\", { readonly patches: readonly BoardFramePatch[] }>\n /**\n * A canvas's board running on the canvas, where the reader uses its page in place. The first\n * request after the frame loads transfers a `MessagePort`: the frame then sends through it alone\n * the reader's gestures the canvas takes (`zoom`, `pan`, `space`) and the words of what they\n * press. `moving` says the canvas is panning by the wheel: a page coming under a still pointer\n * then keeps panning the canvas rather than scrolling itself.\n */\n | FrameRequestOf<\"canvas\", { readonly moving: boolean }>\n /**\n * Runs a designed document's editor in its frame, served for editing: `code` is the editor's\n * script, which takes the `MessagePort` the request transfers and edits the body in place.\n */\n | FrameRequestOf<\"editor\", { readonly code: string }>\n\ninterface FrameRequestOf<Method extends string, Params> {\n readonly protocol: typeof FRAME_PROTOCOL\n readonly id: number\n readonly method: Method\n readonly params: Params\n}\n\n/** The frame's answer to one request. */\nexport interface FrameResponse {\n readonly protocol: typeof FRAME_PROTOCOL\n readonly id: number\n readonly error?: string\n}\n\n/** What happened inside the frame. */\nexport type FrameEvent =\n /** The frame has laid out its entry: a deck says how many slides it has. */\n | FrameEventOf<\"ready\", { readonly slides?: number }>\n /** The reader picked a slide in the overview. */\n | FrameEventOf<\"select\", { readonly slide: number }>\n /** A key the app handles, pressed while the frame had focus. */\n | FrameEventOf<\"key\", { readonly key: string }>\n /** A link to another artifact, which opens where the reader is. */\n | FrameEventOf<\"open\", { readonly address: string }>\n /**\n * A link to a web page, which the app opens in a new tab: the frame cannot open windows itself.\n * Only `http:` and `https:` addresses.\n */\n | FrameEventOf<\"link\", { readonly url: string }>\n /**\n * Where the `<sixb-embed>` boxes in view are, for the app to draw each over the frame: in the\n * frame's pixels, with the scale they are drawn at. A deck reports the shown slide's, and none in\n * the overview, where an embed stays a placeholder, as it does in a filled frame, which never\n * reports; a page reports those near its view as it scrolls, at its own scale.\n */\n | FrameEventOf<\"embeds\", { readonly embeds: readonly FrameEmbed[] }>\n /** A page's height as laid out at the frame's width, so a document can size the frame to it. */\n | FrameEventOf<\"size\", { readonly height: number }>\n /**\n * The reader pressed a button, or a link within the page, that reads `text`: a canvas's board\n * follows the arrow that leaves it with that label. At most a label's length. A board running on\n * the canvas also sends it through its port, for the reader's own presses alone.\n */\n | FrameEventOf<\"press\", { readonly text: string }>\n /** Editing, the reader points at an element, or at none. */\n | FrameEventOf<\"edit.hover\", { readonly target: FrameEditTarget | null }>\n /** Editing, the reader picked an element, or none, clicking `at` that point of the frame. */\n | FrameEventOf<\n \"edit.select\",\n { readonly target: FrameEditTarget | null; readonly at?: FramePoint }\n >\n /**\n * Editing, the reader typed in a text element: all its words now, as plain text, and `base`,\n * its words as the frame last posted them, or as they were when the reader started typing. The\n * app makes it with `mergeBoardText`, so what others changed in the element since stays.\n *\n * The runtime takes the port before the board's scripts run, and stops the request that hands\n * it over before they hear it, so they cannot post on it; it reports only the reader's own\n * clicks and keys. What it posts is what the element holds, which the board's scripts can still\n * rewrite. The app takes `edit.text` only for the element the reader picked, the last\n * `edit.select` it heard, and nothing once the board's elements changed under the frame.\n */\n | FrameEventOf<\n \"edit.text\",\n { readonly address: string; readonly base: string; readonly text: string }\n >\n /**\n * The reader zoomed over a canvas's board, opened or running on the canvas, which the app zooms\n * instead of the browser: a pinch or the wheel with ⌘ or Ctrl, `factor` times around `at`, in\n * the frame's pixels; or ⌘ or Ctrl with +, − or 0, a `step`. Only a frame handed a port with\n * `edit` or `canvas` reports it, through that port, and only for the reader's own gestures and\n * keys; any other leaves them to the browser.\n */\n | FrameEventOf<\"zoom\", FrameZoom>\n /**\n * The reader turned the wheel or dragged a finger over a board running on the canvas, which pans\n * the canvas instead of scrolling the page. Only a frame handed a port with `canvas` reports it,\n * through that port, for the reader's own gestures.\n */\n | FrameEventOf<\"pan\", FramePan>\n /**\n * The reader pressed or let go of Space over a board running on the canvas, outside a field:\n * while it is held, dragging pans the canvas. Through the port, as `pan` is.\n */\n | FrameEventOf<\"space\", { readonly down: boolean }>\n\n/**\n * How far the reader scrolled, as a wheel's deltas say it: `x` right and `y` down, in pixels. A\n * finger dragging scrolls the opposite way it moves, as it would scroll a page; the wheel's turns\n * pan the canvas at its own speed for them, as React Flow's do.\n */\nexport interface FramePan {\n readonly x: number\n readonly y: number\n readonly by: \"wheel\" | \"touch\"\n}\n\n/** How the reader zoomed: by a gesture, or by a key. */\nexport type FrameZoom =\n | { readonly factor: number; readonly at: FramePoint }\n | { readonly step: FrameZoomStep }\n\n/** ⌘ or Ctrl with +, − or 0: in, out, or the page at its own size. */\nexport type FrameZoomStep = \"in\" | \"out\" | \"actual\"\n\n/**\n * An element of a board being edited. One a script built, or whose words a script rewrote, is\n * `scripted`: it has no address of its own, and `within` names the element it sits in.\n */\nexport type FrameEditTarget =\n | {\n readonly address: string\n readonly kind: BoardElementKind\n readonly label: string\n readonly rect: FrameRect\n }\n | {\n readonly address: null\n readonly kind: \"scripted\"\n readonly within: string | null\n /** The words the reader pointed at, as the page shows them now. */\n readonly label?: string\n readonly rect: FrameRect\n }\n\nexport interface FramePoint {\n readonly x: number\n readonly y: number\n}\n\nexport interface FrameRect {\n readonly x: number\n readonly y: number\n readonly width: number\n readonly height: number\n}\n\n/** One `<sixb-embed>` the frame shows. */\nexport interface FrameEmbed {\n /** The element's own id while the page is loaded: the same as it scrolls out and back. */\n readonly id: number\n readonly address: string\n readonly rect: {\n readonly x: number\n readonly y: number\n readonly width: number\n readonly height: number\n }\n /**\n * The scale it is drawn at: a slide's, where the embed is laid out at `rect / scale` and scaled\n * with the slide; 1 on a page.\n */\n readonly scale: number\n}\n\ninterface FrameEventOf<Event extends string, Params> {\n readonly protocol: typeof FRAME_PROTOCOL\n readonly event: Event\n readonly params: Params\n}\n\n/**\n * What the frame asks of the app, numbered so the app's `result` answers it: a page keeping data\n * with `sixb.state`, or reading one of its version's queries with `sixb.query`. The app answers\n * only its own frame, for the artifact and the version it shows.\n */\nexport type FrameCall =\n | FrameCallOf<\"state.get\", { readonly key: string }>\n | FrameCallOf<\"state.set\", { readonly key: string; readonly value: unknown }>\n | FrameCallOf<\"state.delete\", { readonly key: string }>\n | FrameCallOf<\"state.keys\", Record<string, never>>\n /** Runs `queries/<name>.json` as the reader; the value is the query route's JSON. */\n | FrameCallOf<\"query.run\", { readonly name: string }>\n\ninterface FrameCallOf<Method extends string, Params> {\n readonly protocol: typeof FRAME_PROTOCOL\n readonly call: number\n readonly method: Method\n readonly params: Params\n}\n\n/** The app's answer to one call: its value, or why it failed. */\nexport interface FrameCallResult {\n readonly protocol: typeof FRAME_PROTOCOL\n readonly result: number\n readonly value?: unknown\n readonly error?: string\n}\n\n/**\n * A message from a frame as a call, or null when it is not one. A page's scripts write what it\n * posts, so the shapes are checked here, and a value is checked for size as JSON, as storage will\n * count it, before the app sends it anywhere.\n */\nexport function parseFrameCall(data: unknown): FrameCall | null {\n if (!isRecord(data) || data.protocol !== FRAME_PROTOCOL || !isRecord(data.params)) return null\n if (!Number.isSafeInteger(data.call) || Number(data.call) < 0) return null\n const call = Number(data.call)\n const { params } = data\n const key = params.key\n const keyed = isStateKey(key)\n switch (data.method) {\n case \"state.get\":\n case \"state.delete\":\n return keyed\n ? ({ protocol: FRAME_PROTOCOL, call, method: data.method, params: { key } } as FrameCall)\n : null\n case \"state.set\": {\n if (!keyed || !(\"value\" in params)) return null\n const json = jsonText(params.value)\n if (json === undefined || utf8Bytes(json) > ARTIFACT_STATE_LIMITS.maxValueBytes) return null\n return {\n protocol: FRAME_PROTOCOL,\n call,\n method: \"state.set\",\n params: { key, value: params.value },\n }\n }\n case \"state.keys\":\n return { protocol: FRAME_PROTOCOL, call, method: \"state.keys\", params: {} }\n case \"query.run\": {\n // The client puts the name in the URL's path, as it does a key.\n const { name } = params\n if (typeof name !== \"string\" || !isArtifactQueryName(name)) return null\n\n return { protocol: FRAME_PROTOCOL, call, method: \"query.run\", params: { name } }\n }\n default:\n return null\n }\n}\n\n/**\n * A key the app can send: the client puts it in the URL's path, where `.` and `..` would name\n * another route, `..` the artifact itself.\n */\nfunction isStateKey(value: unknown): value is string {\n return (\n typeof value === \"string\" &&\n value.length > 0 &&\n value.length <= ARTIFACT_STATE_LIMITS.maxKeyLength &&\n !/\\p{Cc}/u.test(value) &&\n value !== \".\" &&\n value !== \"..\"\n )\n}\n\nfunction jsonText(value: unknown): string | undefined {\n try {\n return JSON.stringify(value)\n } catch {\n return undefined\n }\n}\n\nfunction utf8Bytes(text: string): number {\n return new TextEncoder().encode(text).byteLength\n}\n\n/** Keys the frame passes to the app, so a deck navigates the same with focus in it or not. */\nexport const DECK_KEYS = [\n \"ArrowLeft\",\n \"ArrowRight\",\n \"ArrowUp\",\n \"ArrowDown\",\n \"PageUp\",\n \"PageDown\",\n \"Home\",\n \"End\",\n \" \",\n \"Escape\",\n] as const\n\n/**\n * The theme tokens the app sends into a frame, read from the viewer as it is themed: the ones an\n * artifact's theme may set.\n */\nexport const FRAME_THEME_TOKENS = ARTIFACT_THEME_TOKENS\n\n/**\n * A message from a frame as an event, or null when it is not one this protocol sends. A deck runs\n * its own scripts, so anything it posts is checked for the shape the app relies on: whole slide\n * numbers, a key the app handles, finite boxes, and no more embeds than a version may record.\n */\nexport function parseFrameEvent(data: unknown): FrameEvent | null {\n if (!isRecord(data) || data.protocol !== FRAME_PROTOCOL || !isRecord(data.params)) return null\n const { params } = data\n switch (data.event) {\n case \"ready\":\n if (params.slides === undefined) return event(\"ready\", {})\n return isCount(params.slides) ? event(\"ready\", { slides: params.slides }) : null\n case \"select\":\n return isCount(params.slide) && params.slide > 0\n ? event(\"select\", { slide: params.slide })\n : null\n case \"key\":\n return typeof params.key === \"string\" && (DECK_KEYS as readonly string[]).includes(params.key)\n ? event(\"key\", { key: params.key })\n : null\n case \"open\":\n return isAddress(params.address) ? event(\"open\", { address: params.address }) : null\n case \"link\":\n return isWebAddress(params.url) ? event(\"link\", { url: params.url }) : null\n case \"embeds\": {\n const { embeds } = params\n if (!Array.isArray(embeds) || embeds.length > ARTIFACT_LIMITS.maxReferences) return null\n const parsed: FrameEmbed[] = []\n const ids = new Set<number>()\n for (const embed of embeds) {\n if (!isRecord(embed) || !isAddress(embed.address) || !isRecord(embed.rect)) return null\n\n // Two embeds with one id would be one element drawn twice.\n if (!isCount(embed.id) || ids.has(embed.id)) return null\n ids.add(embed.id)\n\n const { x, y, width, height } = embed.rect\n if (![x, y, width, height, embed.scale].every(Number.isFinite)) return null\n if (Number(width) < 0 || Number(height) < 0 || Number(embed.scale) <= 0) return null\n parsed.push({\n id: embed.id,\n address: embed.address,\n rect: { x: Number(x), y: Number(y), width: Number(width), height: Number(height) },\n scale: Number(embed.scale),\n })\n }\n return event(\"embeds\", { embeds: parsed })\n }\n case \"size\":\n return Number.isFinite(params.height) && Number(params.height) >= 0\n ? event(\"size\", { height: Math.min(Number(params.height), MAX_HEIGHT) })\n : null\n case \"edit.hover\":\n case \"edit.select\": {\n const at = data.event === \"edit.select\" ? parsePoint(params.at) : undefined\n if (at === null) return null\n const point = at ? { at } : {}\n if (params.target === null) return event(data.event, { target: null, ...point })\n const target = parseEditTarget(params.target)\n return target ? event(data.event, { target, ...point }) : null\n }\n case \"edit.text\":\n return isEditAddress(params.address) &&\n typeof params.text === \"string\" &&\n params.text.length <= MAX_EDIT_TEXT_LENGTH &&\n typeof params.base === \"string\" &&\n params.base.length <= MAX_EDIT_TEXT_LENGTH\n ? event(\"edit.text\", { address: params.address, base: params.base, text: params.text })\n : null\n case \"zoom\": {\n if (params.step !== undefined) {\n return ZOOM_STEPS.includes(String(params.step))\n ? event(\"zoom\", { step: params.step as FrameZoomStep })\n : null\n }\n\n const at = parsePoint(params.at)\n const factor = Number(params.factor)\n if (!at || !Number.isFinite(params.factor) || factor <= 0) return null\n\n return event(\"zoom\", {\n factor: Math.min(MAX_ZOOM_FACTOR, Math.max(1 / MAX_ZOOM_FACTOR, factor)),\n at,\n })\n }\n case \"pan\": {\n const { x, y, by } = params\n if (!Number.isFinite(x) || !Number.isFinite(y) || (by !== \"wheel\" && by !== \"touch\")) {\n return null\n }\n\n const bounded = (delta: number) => Math.min(MAX_PAN, Math.max(-MAX_PAN, delta))\n return event(\"pan\", { x: bounded(Number(x)), y: bounded(Number(y)), by })\n }\n case \"space\":\n return typeof params.down === \"boolean\" ? event(\"space\", { down: params.down }) : null\n case \"press\":\n return typeof params.text === \"string\" &&\n params.text.length > 0 &&\n params.text.length <= ARTIFACT_LIMITS.maxCanvasLabelLength\n ? event(\"press\", { text: params.text })\n : null\n default:\n return null\n }\n}\n\n/** The most words a text element of a board takes from one edit: a board's own size. */\nconst MAX_EDIT_TEXT_LENGTH = ARTIFACT_LIMITS.maxBoardBytes\n\nconst EDIT_KINDS: readonly string[] = [\"text\", \"image\", \"whole\", \"box\"]\n\nconst ZOOM_STEPS: readonly string[] = [\"in\", \"out\", \"actual\"] satisfies FrameZoomStep[]\n\n/** The most one gesture zooms by, either way: a wheel's notch is far less. */\nconst MAX_ZOOM_FACTOR = 4\n\n/** The most one wheel's turn or one finger's move pans by, either way: a screen's width. */\nconst MAX_PAN = 4000\n\n/** The longest label a frame reports for an element: the runtime cuts its own at 80. */\nconst MAX_EDIT_LABEL_LENGTH = 200\n\n/** An address as `boardElements` writes one: steps of a tag and an index, from the body. */\nfunction isEditAddress(value: unknown): value is string {\n return (\n typeof value === \"string\" && value.length <= 2048 && /^body(>[a-z][a-z0-9-]*:\\d+)*$/.test(value)\n )\n}\n\n/** A point the frame reports: undefined for none, null for one that does not read. */\nfunction parsePoint(value: unknown): FramePoint | null | undefined {\n if (value === undefined) return undefined\n if (!isRecord(value) || !Number.isFinite(value.x) || !Number.isFinite(value.y)) return null\n return { x: Number(value.x), y: Number(value.y) }\n}\n\nfunction parseEditTarget(value: unknown): FrameEditTarget | null {\n if (!isRecord(value) || !isRecord(value.rect)) return null\n const { x, y, width, height } = value.rect\n if (![x, y, width, height].every(Number.isFinite)) return null\n const rect = { x: Number(x), y: Number(y), width: Number(width), height: Number(height) }\n\n if (value.kind === \"scripted\") {\n if (value.address !== null) return null\n if (value.within !== null && !isEditAddress(value.within)) return null\n const label =\n typeof value.label === \"string\" && value.label.length <= MAX_EDIT_LABEL_LENGTH\n ? { label: value.label }\n : {}\n return {\n address: null,\n kind: \"scripted\",\n within: value.within as string | null,\n ...label,\n rect,\n }\n }\n if (!isEditAddress(value.address) || !EDIT_KINDS.includes(String(value.kind))) return null\n if (typeof value.label !== \"string\" || value.label.length > MAX_EDIT_LABEL_LENGTH) return null\n return {\n address: value.address,\n kind: value.kind as BoardElementKind,\n label: value.label,\n rect,\n }\n}\n\n/** The most a page reports as its height: more is a page that grows with its frame. */\nconst MAX_HEIGHT = 100_000\n\nfunction event<Name extends FrameEvent[\"event\"]>(\n name: Name,\n params: Extract<FrameEvent, { event: Name }>[\"params\"]\n): FrameEvent {\n return { protocol: FRAME_PROTOCOL, event: name, params } as FrameEvent\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null\n}\n\nfunction isCount(value: unknown): value is number {\n return Number.isSafeInteger(value) && Number(value) >= 0\n}\n\n/** Long enough for any address a version can record; the app resolves it before using it. */\nfunction isAddress(value: unknown): value is string {\n return typeof value === \"string\" && value.length <= 2048\n}\n\n/** The longest web address the app opens: longer than any link a page needs. */\nconst MAX_URL_LENGTH = 8192\n\n/** An absolute `http:` or `https:` address, as the frame resolves a link's. */\nfunction isWebAddress(value: unknown): value is string {\n if (typeof value !== \"string\" || value.length > MAX_URL_LENGTH) return false\n\n try {\n const { protocol } = new URL(value)\n return protocol === \"http:\" || protocol === \"https:\"\n } catch {\n return false\n }\n}\n"
7
7
  ],
8
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F;AAAA,EACF;AAAA,EACA,IAAI,CAAC,cAAc,MAAM,OAAO,KAAK,CAAC,WAAW,SAAS,OAAO,MAAM,IAAI,CAAC;AAAA,IAAG,OAAO;AAAA,EACtF,IAAI,OAAO,MAAM,UAAU,YAAY,MAAM,MAAM,SAAS;AAAA,IAAuB,OAAO;AAAA,EAC1F,OAAO;AAAA,IACL,SAAS,MAAM;AAAA,IACf,MAAM,MAAM;AAAA,IACZ,OAAO,MAAM;AAAA,IACb;AAAA,EACF;AAAA;AAIF,IAAM,aAAa;AAEnB,SAAS,KAAuC,CAC9C,MACA,QACY;AAAA,EACZ,OAAO,EAAE,UAAU,gBAAgB,OAAO,MAAM,OAAO;AAAA;AAGzD,SAAS,QAAQ,CAAC,OAAkD;AAAA,EAClE,OAAO,OAAO,UAAU,YAAY,UAAU;AAAA;AAGhD,SAAS,OAAO,CAAC,OAAiC;AAAA,EAChD,OAAO,OAAO,cAAc,KAAK,KAAK,OAAO,KAAK,KAAK;AAAA;AAIzD,SAAS,SAAS,CAAC,OAAiC;AAAA,EAClD,OAAO,OAAO,UAAU,YAAY,MAAM,UAAU;AAAA;AAItD,IAAM,iBAAiB;AAGvB,SAAS,YAAY,CAAC,OAAiC;AAAA,EACrD,IAAI,OAAO,UAAU,YAAY,MAAM,SAAS;AAAA,IAAgB,OAAO;AAAA,EAEvE,IAAI;AAAA,IACF,QAAQ,aAAa,IAAI,IAAI,KAAK;AAAA,IAClC,OAAO,aAAa,WAAW,aAAa;AAAA,IAC5C,MAAM;AAAA,IACN,OAAO;AAAA;AAAA;",
9
+ "debugId": "F3BBB9DDF22B3DC264756E2164756E21",
10
10
  "names": []
11
11
  }
@@ -0,0 +1,62 @@
1
+ import * as Y from "yjs";
2
+ /** A node as ProseMirror's JSON holds it. */
3
+ export interface BlockNode {
4
+ readonly type: string;
5
+ readonly attrs?: Readonly<Record<string, unknown>>;
6
+ readonly content?: readonly BlockNode[];
7
+ readonly text?: string;
8
+ readonly marks?: readonly BlockMark[];
9
+ }
10
+ export interface BlockMark {
11
+ readonly type: string;
12
+ readonly attrs?: Readonly<Record<string, unknown>>;
13
+ }
14
+ /** A document's Markdown as blocks. */
15
+ export declare function markdownToBlocks(markdown: string): BlockNode;
16
+ /** Blocks written as a document's Markdown. */
17
+ export declare function blocksToMarkdown(doc: BlockNode): string;
18
+ /** Blocks as a `Y.XmlFragment`'s children: each an element, its text with its marks. */
19
+ export declare function blocksToY(nodes: readonly BlockNode[]): (Y.XmlElement | Y.XmlText)[];
20
+ /** A fragment's children read back as blocks. */
21
+ export declare function blocksFromY(children: readonly (Y.XmlElement | Y.XmlText | Y.XmlHook)[]): BlockNode[];
22
+ /** A new fragment holding the blocks of `markdown`. */
23
+ export declare function markdownFragment(markdown: string): Y.XmlFragment;
24
+ /** The Markdown a fragment holds now. */
25
+ export declare function fragmentMarkdown(fragment: Y.XmlFragment): string;
26
+ /**
27
+ * Makes a fragment hold the blocks of `markdown` by the fewest changes to its blocks, as
28
+ * `patchBlocks` makes them.
29
+ */
30
+ export declare function patchFragment(fragment: Y.XmlFragment, markdown: string): void;
31
+ /**
32
+ * Makes a fragment or an element hold `next` by the fewest changes to its blocks: one that reads
33
+ * the same stays as it is, with whatever its editors' carets and history hold. A block replaced by
34
+ * one of the same type and attributes that holds blocks too is patched inside the same way, so a
35
+ * change to one paragraph of a section leaves the rest of the section as it was.
36
+ */
37
+ export declare function patchBlocks(parent: Y.XmlFragment, next: readonly BlockNode[], options?: BlockComparison): void;
38
+ /**
39
+ * Folds two changes of a list of blocks, `ours` and `theirs` of `base`, block by block: a block
40
+ * only one side changed is taken from it; one both changed is merged inside, a block of blocks by
41
+ * its blocks and anything else by `mergeLeaf`; what both added is kept, ours first, and what
42
+ * either took out goes. A block both hold is taken as `theirs` holds it.
43
+ */
44
+ export declare function mergeBlockLists(base: readonly BlockNode[], ours: readonly BlockNode[], theirs: readonly BlockNode[], comparison: Required<BlockComparison> & {
45
+ /** One block both changed, merged inside; null to keep both sides' as two. */
46
+ readonly mergeLeaf: (base: BlockNode, ours: BlockNode, theirs: BlockNode) => BlockNode | null;
47
+ }): BlockNode[];
48
+ /**
49
+ * Folds two changes of a Markdown document, `ours` the blocks its editors hold now, block by
50
+ * block: compared as blocks, how each side writes its Markdown is no change. A block both changed
51
+ * is merged by its Markdown, written alone.
52
+ */
53
+ export declare function mergeMarkdownBlocks(base: string, ours: readonly BlockNode[], theirs: string): BlockNode[];
54
+ /**
55
+ * How `patchBlocks` tells blocks apart: `key` is the same for two blocks that are the same, and
56
+ * `shell` for two that are the same but for what they hold. By default, by their nodes.
57
+ */
58
+ export interface BlockComparison {
59
+ readonly key?: (node: BlockNode) => string;
60
+ readonly shell?: (node: BlockNode) => string;
61
+ }
62
+ //# sourceMappingURL=blocks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blocks.d.ts","sourceRoot":"","sources":["../../../src/artifacts/live/blocks.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAqBxB,6CAA6C;AAC7C,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;IAClD,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,SAAS,EAAE,CAAA;IACvC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,SAAS,EAAE,CAAA;CACtC;AAED,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;CACnD;AAmCD,uCAAuC;AACvC,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAu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