@sixb/core 0.2.2 → 0.2.4

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 (1155) hide show
  1. package/dist/actions/index.js +56 -50
  2. package/dist/actions/index.js.map +1 -1
  3. package/dist/actions/request.d.ts.map +1 -1
  4. package/dist/actions/run/executor.d.ts +0 -2
  5. package/dist/actions/run/executor.d.ts.map +1 -1
  6. package/dist/actions/types/context.d.ts +5 -1
  7. package/dist/actions/types/context.d.ts.map +1 -1
  8. package/dist/agents/cancel.d.ts +1 -1
  9. package/dist/agents/cancel.d.ts.map +1 -1
  10. package/dist/agents/child-question.d.ts +35 -2
  11. package/dist/agents/child-question.d.ts.map +1 -1
  12. package/dist/agents/execution.d.ts +3 -2
  13. package/dist/agents/execution.d.ts.map +1 -1
  14. package/dist/agents/fork.d.ts.map +1 -1
  15. package/dist/agents/ids.d.ts +2 -0
  16. package/dist/agents/ids.d.ts.map +1 -1
  17. package/dist/agents/index.d.ts +4 -4
  18. package/dist/agents/index.d.ts.map +1 -1
  19. package/dist/agents/index.js +91 -76
  20. package/dist/agents/index.js.map +1 -1
  21. package/dist/agents/model-loop.d.ts.map +1 -1
  22. package/dist/agents/request.d.ts +7 -1
  23. package/dist/agents/request.d.ts.map +1 -1
  24. package/dist/agents/run-artifacts.d.ts +73 -10
  25. package/dist/agents/run-artifacts.d.ts.map +1 -1
  26. package/dist/agents/run-session-children.d.ts +9 -0
  27. package/dist/agents/run-session-children.d.ts.map +1 -1
  28. package/dist/agents/run-session-http.d.ts.map +1 -1
  29. package/dist/agents/run-session-serve.d.ts.map +1 -1
  30. package/dist/agents/run-session.d.ts +3 -0
  31. package/dist/agents/run-session.d.ts.map +1 -1
  32. package/dist/agents/streams/index.js +2 -2
  33. package/dist/agents/streams/internal.js +2 -2
  34. package/dist/agents/streams/protocol.d.ts.map +1 -1
  35. package/dist/agents/tool-files.d.ts +1 -1
  36. package/dist/agents/tool-files.d.ts.map +1 -1
  37. package/dist/agents/tool-input-coercion.d.ts +20 -0
  38. package/dist/agents/tool-input-coercion.d.ts.map +1 -0
  39. package/dist/agents/validation.d.ts +1 -1
  40. package/dist/agents/validation.d.ts.map +1 -1
  41. package/dist/artifacts/access.d.ts +37 -17
  42. package/dist/artifacts/access.d.ts.map +1 -1
  43. package/dist/artifacts/canvas-display.d.ts +65 -0
  44. package/dist/artifacts/canvas-display.d.ts.map +1 -0
  45. package/dist/artifacts/canvas.d.ts +6 -1
  46. package/dist/artifacts/canvas.d.ts.map +1 -1
  47. package/dist/artifacts/comment-text.d.ts +19 -0
  48. package/dist/artifacts/comment-text.d.ts.map +1 -0
  49. package/dist/artifacts/comments.d.ts +52 -0
  50. package/dist/artifacts/comments.d.ts.map +1 -0
  51. package/dist/artifacts/errors.d.ts +3 -3
  52. package/dist/artifacts/errors.d.ts.map +1 -1
  53. package/dist/artifacts/events.d.ts +14 -0
  54. package/dist/artifacts/events.d.ts.map +1 -0
  55. package/dist/artifacts/execution.d.ts +129 -22
  56. package/dist/artifacts/execution.d.ts.map +1 -1
  57. package/dist/artifacts/frames/assets.d.ts +12 -1
  58. package/dist/artifacts/frames/assets.d.ts.map +1 -1
  59. package/dist/artifacts/frames/grants.d.ts +8 -5
  60. package/dist/artifacts/frames/grants.d.ts.map +1 -1
  61. package/dist/artifacts/frames/index.d.ts +1 -1
  62. package/dist/artifacts/frames/index.d.ts.map +1 -1
  63. package/dist/artifacts/frames/index.js +32 -964
  64. package/dist/artifacts/frames/index.js.map +4 -8
  65. package/dist/artifacts/frames/kit.d.ts.map +1 -1
  66. package/dist/artifacts/frames/protocol.d.ts +129 -0
  67. package/dist/artifacts/frames/protocol.d.ts.map +1 -1
  68. package/dist/artifacts/frames/runtime.d.ts +24 -7
  69. package/dist/artifacts/frames/runtime.d.ts.map +1 -1
  70. package/dist/artifacts/holders.d.ts +23 -0
  71. package/dist/artifacts/holders.d.ts.map +1 -0
  72. package/dist/artifacts/ids.d.ts +2 -0
  73. package/dist/artifacts/ids.d.ts.map +1 -1
  74. package/dist/artifacts/index.d.ts +6 -4
  75. package/dist/artifacts/index.d.ts.map +1 -1
  76. package/dist/artifacts/index.js +134 -13
  77. package/dist/artifacts/index.js.map +5 -4
  78. package/dist/artifacts/limits.d.ts +24 -3
  79. package/dist/artifacts/limits.d.ts.map +1 -1
  80. package/dist/artifacts/live/board.d.ts +103 -0
  81. package/dist/artifacts/live/board.d.ts.map +1 -0
  82. package/dist/artifacts/live/diff.d.ts +43 -0
  83. package/dist/artifacts/live/diff.d.ts.map +1 -0
  84. package/dist/artifacts/live/document.d.ts +55 -0
  85. package/dist/artifacts/live/document.d.ts.map +1 -0
  86. package/dist/artifacts/live/files.d.ts +16 -0
  87. package/dist/artifacts/live/files.d.ts.map +1 -0
  88. package/dist/artifacts/live/index.d.ts +9 -0
  89. package/dist/artifacts/live/index.d.ts.map +1 -0
  90. package/dist/artifacts/live/index.js +593 -0
  91. package/dist/artifacts/live/index.js.map +10 -0
  92. package/dist/artifacts/live/presence.d.ts +55 -0
  93. package/dist/artifacts/live/presence.d.ts.map +1 -0
  94. package/dist/artifacts/live/protocol.d.ts +109 -0
  95. package/dist/artifacts/live/protocol.d.ts.map +1 -0
  96. package/dist/artifacts/live/protocol.js +21 -0
  97. package/dist/artifacts/live/protocol.js.map +9 -0
  98. package/dist/artifacts/live/server.d.ts +10 -0
  99. package/dist/artifacts/live/server.d.ts.map +1 -0
  100. package/dist/artifacts/live/server.js +86 -0
  101. package/dist/artifacts/live/server.js.map +9 -0
  102. package/dist/artifacts/live/state.d.ts +26 -0
  103. package/dist/artifacts/live/state.d.ts.map +1 -0
  104. package/dist/artifacts/outline.d.ts +11 -0
  105. package/dist/artifacts/outline.d.ts.map +1 -1
  106. package/dist/artifacts/publish/index.d.ts +8 -1
  107. package/dist/artifacts/publish/index.d.ts.map +1 -1
  108. package/dist/artifacts/publish/index.js +62 -34
  109. package/dist/artifacts/publish/index.js.map +1 -1
  110. package/dist/artifacts/publish/merge.d.ts +75 -0
  111. package/dist/artifacts/publish/merge.d.ts.map +1 -0
  112. package/dist/artifacts/publish/previews.d.ts +153 -0
  113. package/dist/artifacts/publish/previews.d.ts.map +1 -0
  114. package/dist/artifacts/publish/publish.d.ts +29 -8
  115. package/dist/artifacts/publish/publish.d.ts.map +1 -1
  116. package/dist/artifacts/publish/query-answers.d.ts +20 -0
  117. package/dist/artifacts/publish/query-answers.d.ts.map +1 -0
  118. package/dist/artifacts/publish/references.d.ts +4 -3
  119. package/dist/artifacts/publish/references.d.ts.map +1 -1
  120. package/dist/artifacts/publish/validate/canvas.d.ts.map +1 -1
  121. package/dist/artifacts/theme.d.ts +5 -1
  122. package/dist/artifacts/theme.d.ts.map +1 -1
  123. package/dist/auth/directory.d.ts +33 -0
  124. package/dist/auth/directory.d.ts.map +1 -0
  125. package/dist/auth/index.js +13 -12
  126. package/dist/auth/index.js.map +1 -1
  127. package/dist/auth/member-events.d.ts +5 -1
  128. package/dist/auth/member-events.d.ts.map +1 -1
  129. package/dist/auth/runtime.d.ts +22 -1
  130. package/dist/auth/runtime.d.ts.map +1 -1
  131. package/dist/auth/strategy.d.ts +2 -2
  132. package/dist/auth/strategy.d.ts.map +1 -1
  133. package/dist/auth/types.d.ts +42 -1
  134. package/dist/auth/types.d.ts.map +1 -1
  135. package/dist/authorization/decision.d.ts +6 -5
  136. package/dist/authorization/decision.d.ts.map +1 -1
  137. package/dist/authorization/event-visibility.d.ts.map +1 -1
  138. package/dist/authorization/index.js +7 -6
  139. package/dist/authorization/index.js.map +1 -1
  140. package/dist/blob-storage/index.js +4 -4
  141. package/dist/blob-storage/index.js.map +1 -1
  142. package/dist/bootstrap/index.js +63 -57
  143. package/dist/bootstrap/index.js.map +2 -2
  144. package/dist/broker/in-memory.d.ts.map +1 -1
  145. package/dist/broker/index.js +1 -1
  146. package/dist/broker/types.d.ts +4 -0
  147. package/dist/broker/types.d.ts.map +1 -1
  148. package/dist/{chunk-s7j8ewqv.js → chunk-0k3r5kb3.js} +257 -43
  149. package/dist/{chunk-s7j8ewqv.js.map → chunk-0k3r5kb3.js.map} +14 -13
  150. package/dist/{chunk-e5wf5vz0.js → chunk-0kgrghqx.js} +13 -1
  151. package/dist/chunk-0kgrghqx.js.map +10 -0
  152. package/dist/{chunk-80gym75n.js → chunk-186k5yz3.js} +1 -1
  153. package/dist/chunk-191jz8a6.js +61 -0
  154. package/dist/chunk-191jz8a6.js.map +10 -0
  155. package/dist/{chunk-mmagke4x.js → chunk-22d3qg4x.js} +2 -2
  156. package/dist/{chunk-mmagke4x.js.map → chunk-22d3qg4x.js.map} +3 -3
  157. package/dist/{chunk-ga63a3dz.js → chunk-2bn6813a.js} +3 -3
  158. package/dist/chunk-2c4j899j.js.map +2 -2
  159. package/dist/{chunk-e6xgz4h4.js → chunk-3014rfjz.js} +197 -18
  160. package/dist/chunk-3014rfjz.js.map +21 -0
  161. package/dist/{chunk-ytzcxtpt.js → chunk-3ba89vm7.js} +1 -1
  162. package/dist/chunk-3hzhcfsv.js +139 -0
  163. package/dist/chunk-3hzhcfsv.js.map +10 -0
  164. package/dist/chunk-3sgvd10b.js +69 -0
  165. package/dist/chunk-3sgvd10b.js.map +10 -0
  166. package/dist/chunk-3z1vxzcm.js +234 -0
  167. package/dist/chunk-3z1vxzcm.js.map +12 -0
  168. package/dist/{chunk-djs3hw9p.js → chunk-3zagkr6w.js} +73 -6
  169. package/dist/chunk-3zagkr6w.js.map +21 -0
  170. package/dist/{chunk-wkq3kvzd.js → chunk-48c1z8nj.js} +6 -6
  171. package/dist/chunk-48c1z8nj.js.map +10 -0
  172. package/dist/{chunk-d04g36fw.js → chunk-5qqmndhm.js} +1 -1
  173. package/dist/{chunk-scyq22td.js → chunk-5rqqp8cr.js} +19 -4
  174. package/dist/chunk-5rqqp8cr.js.map +12 -0
  175. package/dist/chunk-6ef4esq4.js +225 -0
  176. package/dist/chunk-6ef4esq4.js.map +11 -0
  177. package/dist/{chunk-jspskey0.js → chunk-7j4yydm2.js} +67 -45
  178. package/dist/chunk-7j4yydm2.js.map +11 -0
  179. package/dist/chunk-7kpqntgw.js +70 -0
  180. package/dist/chunk-7kpqntgw.js.map +10 -0
  181. package/dist/{chunk-5wtnmpze.js → chunk-7qe46788.js} +1 -1
  182. package/dist/{chunk-31kcqmhf.js → chunk-855w9nvw.js} +1 -1
  183. package/dist/{chunk-e7v3trpz.js → chunk-8a8k38tz.js} +4 -3
  184. package/dist/chunk-8a8k38tz.js.map +10 -0
  185. package/dist/chunk-8bns0y68.js +1322 -0
  186. package/dist/chunk-8bns0y68.js.map +25 -0
  187. package/dist/{chunk-jftd33rc.js → chunk-8t2ynwg0.js} +105 -9
  188. package/dist/chunk-8t2ynwg0.js.map +11 -0
  189. package/dist/{chunk-9whfmsfk.js → chunk-8tqnsx3q.js} +1 -1
  190. package/dist/{chunk-s3we74h8.js → chunk-9nsjjd44.js} +38 -5
  191. package/dist/chunk-9nsjjd44.js.map +12 -0
  192. package/dist/{chunk-hz5d43gn.js → chunk-9vsc919v.js} +14 -6
  193. package/dist/chunk-9vsc919v.js.map +10 -0
  194. package/dist/{chunk-waqk73p1.js → chunk-a6fjkcne.js} +185 -341
  195. package/dist/{chunk-waqk73p1.js.map → chunk-a6fjkcne.js.map} +6 -7
  196. package/dist/chunk-az95tsh3.js.map +2 -2
  197. package/dist/{chunk-s038wa5v.js → chunk-b9qfh2ya.js} +1 -1
  198. package/dist/{chunk-5taem5aw.js → chunk-bc3y6gff.js} +13 -4
  199. package/dist/chunk-bc3y6gff.js.map +10 -0
  200. package/dist/chunk-bz5bnjjt.js +358 -0
  201. package/dist/chunk-bz5bnjjt.js.map +12 -0
  202. package/dist/{chunk-w976a4me.js → chunk-czct88ht.js} +28 -4
  203. package/dist/chunk-czct88ht.js.map +10 -0
  204. package/dist/{chunk-5kyvrtjh.js → chunk-d9xbwh3h.js} +131 -32
  205. package/dist/chunk-d9xbwh3h.js.map +13 -0
  206. package/dist/{chunk-kfee1h52.js → chunk-dfveegqq.js} +28 -8
  207. package/dist/chunk-dfveegqq.js.map +13 -0
  208. package/dist/{chunk-2g0r46hy.js → chunk-dhkc9b23.js} +15 -2
  209. package/dist/chunk-dhkc9b23.js.map +12 -0
  210. package/dist/chunk-dmnd9ea6.js +106 -0
  211. package/dist/chunk-dmnd9ea6.js.map +10 -0
  212. package/dist/{chunk-nz7815t3.js → chunk-e0hnbb1m.js} +27 -2
  213. package/dist/chunk-e0hnbb1m.js.map +14 -0
  214. package/dist/chunk-e91fmg6t.js +288 -0
  215. package/dist/chunk-e91fmg6t.js.map +11 -0
  216. package/dist/{chunk-3sqqhpr7.js → chunk-evj5jxz3.js} +134 -19
  217. package/dist/{chunk-3sqqhpr7.js.map → chunk-evj5jxz3.js.map} +11 -10
  218. package/dist/{chunk-w122ymx4.js → chunk-f6ahf5gf.js} +15 -4
  219. package/dist/{chunk-w122ymx4.js.map → chunk-f6ahf5gf.js.map} +3 -3
  220. package/dist/{chunk-jjmggm9a.js → chunk-fe6r7yhg.js} +1 -1
  221. package/dist/{chunk-165c9wm6.js → chunk-g2ph4873.js} +1 -1
  222. package/dist/{chunk-dsv783c3.js → chunk-gxwy4c3s.js} +203 -57
  223. package/dist/chunk-gxwy4c3s.js.map +47 -0
  224. package/dist/chunk-hgj98cbb.js +22 -0
  225. package/dist/chunk-hgj98cbb.js.map +10 -0
  226. package/dist/chunk-hn2r7z41.js.map +3 -3
  227. package/dist/chunk-hvbvq7p4.js +1553 -0
  228. package/dist/chunk-hvbvq7p4.js.map +18 -0
  229. package/dist/chunk-j0wgh8gv.js +250 -0
  230. package/dist/chunk-j0wgh8gv.js.map +10 -0
  231. package/dist/{chunk-z8fx5cgb.js → chunk-j2zm215x.js} +37 -3
  232. package/dist/chunk-j2zm215x.js.map +12 -0
  233. package/dist/{chunk-j1ny5fwh.js → chunk-k1g14kk3.js} +11 -83
  234. package/dist/{chunk-j1ny5fwh.js.map → chunk-k1g14kk3.js.map} +4 -5
  235. package/dist/chunk-kr6dx38r.js +25 -0
  236. package/dist/chunk-kr6dx38r.js.map +10 -0
  237. package/dist/chunk-m2jerfef.js +474 -0
  238. package/dist/chunk-m2jerfef.js.map +11 -0
  239. package/dist/{chunk-m2vh8gh0.js → chunk-msyevpp3.js} +62 -15
  240. package/dist/{chunk-m2vh8gh0.js.map → chunk-msyevpp3.js.map} +5 -5
  241. package/dist/{chunk-escedwyt.js → chunk-mvz89age.js} +6 -1
  242. package/dist/{chunk-escedwyt.js.map → chunk-mvz89age.js.map} +3 -3
  243. package/dist/chunk-mwcqz3e3.js +30 -0
  244. package/dist/chunk-mwcqz3e3.js.map +10 -0
  245. package/dist/chunk-n2ay51px.js +21 -0
  246. package/dist/chunk-n2ay51px.js.map +10 -0
  247. package/dist/chunk-n4zzaf6q.js.map +1 -1
  248. package/dist/{chunk-gkv8r794.js → chunk-n68vz95m.js} +5 -5
  249. package/dist/{chunk-gkv8r794.js.map → chunk-n68vz95m.js.map} +3 -3
  250. package/dist/{chunk-0j3crh1w.js → chunk-p351afzm.js} +14 -14
  251. package/dist/{chunk-0j3crh1w.js.map → chunk-p351afzm.js.map} +4 -4
  252. package/dist/{chunk-c7cfe31p.js → chunk-p8pgnq8d.js} +16 -16
  253. package/dist/{chunk-c7cfe31p.js.map → chunk-p8pgnq8d.js.map} +1 -1
  254. package/dist/chunk-pk539cwv.js +370 -0
  255. package/dist/chunk-pk539cwv.js.map +11 -0
  256. package/dist/{chunk-jbw70d6t.js → chunk-ppxf7gw2.js} +52 -10
  257. package/dist/chunk-ppxf7gw2.js.map +11 -0
  258. package/dist/{chunk-9x8dybsb.js → chunk-pvpq483h.js} +10 -2
  259. package/dist/chunk-pvpq483h.js.map +10 -0
  260. package/dist/{chunk-4zm1k3xj.js → chunk-r2psmn42.js} +1 -1
  261. package/dist/{chunk-a7aa0nzj.js → chunk-r9rtavg9.js} +14 -14
  262. package/dist/{chunk-a7aa0nzj.js.map → chunk-r9rtavg9.js.map} +1 -1
  263. package/dist/{chunk-w1btn96n.js → chunk-rsrc7vtw.js} +523 -254
  264. package/dist/chunk-rsrc7vtw.js.map +49 -0
  265. package/dist/{chunk-2ajw5rz0.js → chunk-rsxb14an.js} +3 -3
  266. package/dist/{chunk-kkjfve0t.js → chunk-rt9deb92.js} +4 -3
  267. package/dist/{chunk-kkjfve0t.js.map → chunk-rt9deb92.js.map} +3 -3
  268. package/dist/{chunk-r1cxq7vv.js → chunk-rtdrm592.js} +2 -2
  269. package/dist/{chunk-a5v4gjdx.js → chunk-rtm1jq00.js} +460 -227
  270. package/dist/{chunk-a5v4gjdx.js.map → chunk-rtm1jq00.js.map} +25 -22
  271. package/dist/{chunk-4bm0caep.js → chunk-smnt672s.js} +1 -1
  272. package/dist/{chunk-21q0j5f2.js → chunk-stmxh0hv.js} +2 -2
  273. package/dist/{chunk-nh26e7c5.js → chunk-sysnvjce.js} +5 -5
  274. package/dist/{chunk-nh26e7c5.js.map → chunk-sysnvjce.js.map} +3 -3
  275. package/dist/{chunk-7z5rkf0m.js → chunk-t0s7b3d1.js} +4 -3
  276. package/dist/{chunk-7z5rkf0m.js.map → chunk-t0s7b3d1.js.map} +3 -3
  277. package/dist/{chunk-57g0215c.js → chunk-t24yktqr.js} +296 -7
  278. package/dist/{chunk-57g0215c.js.map → chunk-t24yktqr.js.map} +6 -3
  279. package/dist/{chunk-mbc5hvnj.js → chunk-td26wjr5.js} +18 -7
  280. package/dist/{chunk-mbc5hvnj.js.map → chunk-td26wjr5.js.map} +3 -3
  281. package/dist/{chunk-ff5xkv0p.js → chunk-tfzvjdms.js} +1 -1
  282. package/dist/{chunk-f1h34y3r.js → chunk-vepea5c3.js} +6 -6
  283. package/dist/{chunk-f1h34y3r.js.map → chunk-vepea5c3.js.map} +1 -1
  284. package/dist/chunk-vtjzwymr.js +37 -0
  285. package/dist/chunk-vtjzwymr.js.map +10 -0
  286. package/dist/{chunk-twfreyxr.js → chunk-vzkxqf8h.js} +23 -13
  287. package/dist/{chunk-twfreyxr.js.map → chunk-vzkxqf8h.js.map} +6 -6
  288. package/dist/{chunk-eqgr6nsa.js → chunk-w1wq7gfr.js} +983 -185
  289. package/dist/chunk-w1wq7gfr.js.map +75 -0
  290. package/dist/{chunk-6b61s40c.js → chunk-w3t94hm6.js} +1 -1
  291. package/dist/{chunk-fwsvshr5.js → chunk-wa05txmk.js} +20 -7
  292. package/dist/{chunk-fwsvshr5.js.map → chunk-wa05txmk.js.map} +3 -3
  293. package/dist/chunk-whbwf3np.js +12 -0
  294. package/dist/chunk-whbwf3np.js.map +10 -0
  295. package/dist/{chunk-t5608tkq.js → chunk-yv8hv4wq.js} +3 -1
  296. package/dist/{chunk-t5608tkq.js.map → chunk-yv8hv4wq.js.map} +3 -3
  297. package/dist/{chunk-j8thxj7w.js → chunk-yy914zfr.js} +1218 -101
  298. package/dist/chunk-yy914zfr.js.map +30 -0
  299. package/dist/connectors/builders.d.ts +2 -2
  300. package/dist/connectors/builders.d.ts.map +1 -1
  301. package/dist/connectors/connections/access.d.ts +11 -0
  302. package/dist/connectors/connections/access.d.ts.map +1 -0
  303. package/dist/connectors/connections/contracts.d.ts +6 -1
  304. package/dist/connectors/connections/contracts.d.ts.map +1 -1
  305. package/dist/connectors/connections/internal.js +1 -1
  306. package/dist/connectors/connections/runs.d.ts +6 -0
  307. package/dist/connectors/connections/runs.d.ts.map +1 -1
  308. package/dist/connectors/connections/service.d.ts +25 -0
  309. package/dist/connectors/connections/service.d.ts.map +1 -1
  310. package/dist/connectors/connections/views.d.ts +1 -1
  311. package/dist/connectors/connections/views.d.ts.map +1 -1
  312. package/dist/connectors/execution.d.ts.map +1 -1
  313. package/dist/connectors/index.d.ts +1 -1
  314. package/dist/connectors/index.d.ts.map +1 -1
  315. package/dist/connectors/service.d.ts +3 -0
  316. package/dist/connectors/service.d.ts.map +1 -1
  317. package/dist/connectors/types.d.ts +21 -2
  318. package/dist/connectors/types.d.ts.map +1 -1
  319. package/dist/datasets/execution.d.ts +12 -6
  320. package/dist/datasets/execution.d.ts.map +1 -1
  321. package/dist/datasets/ingest-flush-batch.d.ts +59 -0
  322. package/dist/datasets/ingest-flush-batch.d.ts.map +1 -0
  323. package/dist/datasets/ingest-flush-job.d.ts +33 -0
  324. package/dist/datasets/ingest-flush-job.d.ts.map +1 -0
  325. package/dist/datasets/ingest-flush.d.ts +66 -0
  326. package/dist/datasets/ingest-flush.d.ts.map +1 -0
  327. package/dist/datasets/produced-version.d.ts +21 -0
  328. package/dist/datasets/produced-version.d.ts.map +1 -0
  329. package/dist/datasets/write.d.ts +22 -1
  330. package/dist/datasets/write.d.ts.map +1 -1
  331. package/dist/datasets/write.js +8 -4
  332. package/dist/datasets/write.js.map +1 -1
  333. package/dist/deploy/internal.js +5 -4
  334. package/dist/deploy/internal.js.map +4 -4
  335. package/dist/deploy/types.d.ts +2 -3
  336. package/dist/deploy/types.d.ts.map +1 -1
  337. package/dist/error-reporting/capability.d.ts +8 -2
  338. package/dist/error-reporting/capability.d.ts.map +1 -1
  339. package/dist/error-reporting/internal.d.ts +1 -1
  340. package/dist/error-reporting/internal.d.ts.map +1 -1
  341. package/dist/error-reporting/internal.js +17 -5
  342. package/dist/error-reporting/internal.js.map +1 -1
  343. package/dist/error-reporting/reporter.d.ts.map +1 -1
  344. package/dist/error-reporting/reports.d.ts +55 -0
  345. package/dist/error-reporting/reports.d.ts.map +1 -1
  346. package/dist/error-reporting/types.d.ts +82 -1
  347. package/dist/error-reporting/types.d.ts.map +1 -1
  348. package/dist/errors/catalog.d.ts +5 -0
  349. package/dist/errors/catalog.d.ts.map +1 -1
  350. package/dist/errors/internal.js +1 -1
  351. package/dist/events/definitions.d.ts +4 -0
  352. package/dist/events/definitions.d.ts.map +1 -1
  353. package/dist/events/execution.d.ts +1 -0
  354. package/dist/events/execution.d.ts.map +1 -1
  355. package/dist/events/index.d.ts +1 -1
  356. package/dist/events/index.d.ts.map +1 -1
  357. package/dist/events/index.js +5 -5
  358. package/dist/events/scope.d.ts.map +1 -1
  359. package/dist/events/scope.js +1 -1
  360. package/dist/events/selectors/index.js +2 -2
  361. package/dist/events/types/artifacts.d.ts +38 -0
  362. package/dist/events/types/artifacts.d.ts.map +1 -0
  363. package/dist/events/types/index.d.ts +3 -1
  364. package/dist/events/types/index.d.ts.map +1 -1
  365. package/dist/events/types/users.d.ts +5 -2
  366. package/dist/events/types/users.d.ts.map +1 -1
  367. package/dist/execution/agent.js +58 -52
  368. package/dist/execution/agent.js.map +1 -1
  369. package/dist/execution/authorized-object-reader.d.ts +10 -0
  370. package/dist/execution/authorized-object-reader.d.ts.map +1 -1
  371. package/dist/execution/object-reader-clearance.d.ts +6 -0
  372. package/dist/execution/object-reader-clearance.d.ts.map +1 -1
  373. package/dist/execution/object-reader-security.d.ts +9 -2
  374. package/dist/execution/object-reader-security.d.ts.map +1 -1
  375. package/dist/execution/primitive.js +56 -50
  376. package/dist/execution/primitive.js.map +1 -1
  377. package/dist/execution/request.js +50 -44
  378. package/dist/execution/request.js.map +2 -2
  379. package/dist/http/api-routes.d.ts +1 -1
  380. package/dist/http/api-routes.d.ts.map +1 -1
  381. package/dist/http/index.js +1 -1
  382. package/dist/index.d.ts +10 -8
  383. package/dist/index.d.ts.map +1 -1
  384. package/dist/index.js +96 -88
  385. package/dist/index.js.map +1 -1
  386. package/dist/lake-storage/errors.d.ts +15 -0
  387. package/dist/lake-storage/errors.d.ts.map +1 -1
  388. package/dist/lake-storage/index.d.ts +3 -2
  389. package/dist/lake-storage/index.d.ts.map +1 -1
  390. package/dist/lake-storage/index.js +16 -10
  391. package/dist/lake-storage/index.js.map +1 -1
  392. package/dist/lake-storage/maintenance.d.ts +88 -0
  393. package/dist/lake-storage/maintenance.d.ts.map +1 -0
  394. package/dist/lake-storage/merge.d.ts +3 -1
  395. package/dist/lake-storage/merge.d.ts.map +1 -1
  396. package/dist/lake-storage/source-ordering.d.ts +23 -0
  397. package/dist/lake-storage/source-ordering.d.ts.map +1 -1
  398. package/dist/lake-storage/types.d.ts +10 -0
  399. package/dist/lake-storage/types.d.ts.map +1 -1
  400. package/dist/maintenance/heartbeat.d.ts +5 -0
  401. package/dist/maintenance/heartbeat.d.ts.map +1 -0
  402. package/dist/maintenance/index.d.ts +4 -2
  403. package/dist/maintenance/index.d.ts.map +1 -1
  404. package/dist/maintenance/index.js +515 -0
  405. package/dist/maintenance/index.js.map +16 -0
  406. package/dist/maintenance/lake-retention-status.d.ts +36 -0
  407. package/dist/maintenance/lake-retention-status.d.ts.map +1 -0
  408. package/dist/maintenance/lake-retention.d.ts +84 -0
  409. package/dist/maintenance/lake-retention.d.ts.map +1 -0
  410. package/dist/maintenance/loop.d.ts +95 -0
  411. package/dist/maintenance/loop.d.ts.map +1 -0
  412. package/dist/maintenance/ontology-maintenance.d.ts +17 -16
  413. package/dist/maintenance/ontology-maintenance.d.ts.map +1 -1
  414. package/dist/maintenance/passes/cron-pass.d.ts +21 -0
  415. package/dist/maintenance/passes/cron-pass.d.ts.map +1 -0
  416. package/dist/maintenance/passes/directory-pass.d.ts +12 -0
  417. package/dist/maintenance/passes/directory-pass.d.ts.map +1 -0
  418. package/dist/maintenance/passes/ingest-pass.d.ts +26 -0
  419. package/dist/maintenance/passes/ingest-pass.d.ts.map +1 -0
  420. package/dist/maintenance/passes/lake-change-feed.d.ts +38 -0
  421. package/dist/maintenance/passes/lake-change-feed.d.ts.map +1 -0
  422. package/dist/maintenance/passes/lake-retention-pass.d.ts +20 -0
  423. package/dist/maintenance/passes/lake-retention-pass.d.ts.map +1 -0
  424. package/dist/maintenance/passes/ontology-pass.d.ts +8 -0
  425. package/dist/maintenance/passes/ontology-pass.d.ts.map +1 -0
  426. package/dist/maintenance/passes/projections-pass.d.ts +26 -0
  427. package/dist/maintenance/passes/projections-pass.d.ts.map +1 -0
  428. package/dist/maintenance/passes/recovery-pass.d.ts +6 -0
  429. package/dist/maintenance/passes/recovery-pass.d.ts.map +1 -0
  430. package/dist/maintenance/passes/recovery-passes.d.ts +24 -0
  431. package/dist/maintenance/passes/recovery-passes.d.ts.map +1 -0
  432. package/dist/maintenance/passes/runs-pass.d.ts +6 -0
  433. package/dist/maintenance/passes/runs-pass.d.ts.map +1 -0
  434. package/dist/maintenance/passes/triggers-pass.d.ts +41 -0
  435. package/dist/maintenance/passes/triggers-pass.d.ts.map +1 -0
  436. package/dist/maintenance/status.d.ts +19 -0
  437. package/dist/maintenance/status.d.ts.map +1 -0
  438. package/dist/maintenance/types.d.ts +25 -24
  439. package/dist/maintenance/types.d.ts.map +1 -1
  440. package/dist/materialization/model.d.ts +11 -2
  441. package/dist/materialization/model.d.ts.map +1 -1
  442. package/dist/materializer/edits/artifact-refs.d.ts +33 -0
  443. package/dist/materializer/edits/artifact-refs.d.ts.map +1 -0
  444. package/dist/materializer/edits/commit.d.ts.map +1 -1
  445. package/dist/materializer/edits/operations.d.ts +7 -1
  446. package/dist/materializer/edits/operations.d.ts.map +1 -1
  447. package/dist/materializer/edits/plan.d.ts.map +1 -1
  448. package/dist/materializer/execution/work-records.d.ts +6 -0
  449. package/dist/materializer/execution/work-records.d.ts.map +1 -1
  450. package/dist/materializer/index.js +31 -28
  451. package/dist/materializer/index.js.map +1 -1
  452. package/dist/materializer/projections/replacement-plan.d.ts.map +1 -1
  453. package/dist/materializer/shared/normalize.d.ts.map +1 -1
  454. package/dist/materializer/telemetry/plan.d.ts.map +1 -1
  455. package/dist/models/execution/index.js +30 -27
  456. package/dist/models/execution/index.js.map +1 -1
  457. package/dist/models/language-model.d.ts +6 -0
  458. package/dist/models/language-model.d.ts.map +1 -1
  459. package/dist/models/tools.d.ts +2 -0
  460. package/dist/models/tools.d.ts.map +1 -1
  461. package/dist/objects/artifact-refs.d.ts +5 -0
  462. package/dist/objects/artifact-refs.d.ts.map +1 -0
  463. package/dist/objects/index.js +59 -54
  464. package/dist/objects/index.js.map +1 -1
  465. package/dist/objects/materializer-adapter.d.ts +4 -3
  466. package/dist/objects/materializer-adapter.d.ts.map +1 -1
  467. package/dist/objects/object/upsert-batch.d.ts.map +1 -1
  468. package/dist/objects/object/upsert.d.ts.map +1 -1
  469. package/dist/objects/query/index.js +29 -26
  470. package/dist/objects/query/index.js.map +1 -1
  471. package/dist/objects/query/ir.d.ts +3 -1
  472. package/dist/objects/query/ir.d.ts.map +1 -1
  473. package/dist/objects/query/scalar-values.d.ts.map +1 -1
  474. package/dist/objects/runtime-batch.d.ts +2 -0
  475. package/dist/objects/runtime-batch.d.ts.map +1 -1
  476. package/dist/ontology/artifact-ref.d.ts +36 -0
  477. package/dist/ontology/artifact-ref.d.ts.map +1 -0
  478. package/dist/ontology/docs-markdown.d.ts.map +1 -1
  479. package/dist/ontology/index.d.ts +3 -1
  480. package/dist/ontology/index.d.ts.map +1 -1
  481. package/dist/ontology/index.js +8 -5
  482. package/dist/ontology/index.js.map +1 -1
  483. package/dist/ontology/inference/index.d.ts +2 -0
  484. package/dist/ontology/inference/index.d.ts.map +1 -1
  485. package/dist/ontology/internal.js +7 -6
  486. package/dist/ontology/internal.js.map +1 -1
  487. package/dist/ontology/json-schema.d.ts.map +1 -1
  488. package/dist/ontology/primitives.d.ts.map +1 -1
  489. package/dist/ontology/reference-values.d.ts +10 -0
  490. package/dist/ontology/reference-values.d.ts.map +1 -0
  491. package/dist/ontology/refs.d.ts +6 -1
  492. package/dist/ontology/refs.d.ts.map +1 -1
  493. package/dist/ontology/registry.d.ts +9 -1
  494. package/dist/ontology/registry.d.ts.map +1 -1
  495. package/dist/ontology/types.d.ts +2 -1
  496. package/dist/ontology/types.d.ts.map +1 -1
  497. package/dist/ontology/user-ref.d.ts +16 -0
  498. package/dist/ontology/user-ref.d.ts.map +1 -1
  499. package/dist/ontology/validation/normalize.d.ts.map +1 -1
  500. package/dist/ontology/validation/properties.d.ts.map +1 -1
  501. package/dist/ontology/validation/schema.d.ts.map +1 -1
  502. package/dist/pending-tasks.d.ts +17 -0
  503. package/dist/pending-tasks.d.ts.map +1 -0
  504. package/dist/pipelines/index.js +37 -34
  505. package/dist/pipelines/index.js.map +1 -1
  506. package/dist/pipelines/run-dispatch.d.ts +6 -0
  507. package/dist/pipelines/run-dispatch.d.ts.map +1 -1
  508. package/dist/predicates/types.d.ts +4 -0
  509. package/dist/predicates/types.d.ts.map +1 -1
  510. package/dist/projections/builders.d.ts +13 -11
  511. package/dist/projections/builders.d.ts.map +1 -1
  512. package/dist/projections/internal.js +30 -27
  513. package/dist/projections/internal.js.map +1 -1
  514. package/dist/projections/types.d.ts +1 -1
  515. package/dist/projections/types.d.ts.map +1 -1
  516. package/dist/projections/validation.d.ts +2 -2
  517. package/dist/projections/validation.d.ts.map +1 -1
  518. package/dist/queues/in-memory.d.ts +6 -1
  519. package/dist/queues/in-memory.d.ts.map +1 -1
  520. package/dist/queues/index.d.ts +1 -1
  521. package/dist/queues/index.d.ts.map +1 -1
  522. package/dist/queues/index.js +1 -1
  523. package/dist/queues/types.d.ts +55 -2
  524. package/dist/queues/types.d.ts.map +1 -1
  525. package/dist/runtime/create.d.ts +3 -0
  526. package/dist/runtime/create.d.ts.map +1 -1
  527. package/dist/runtime/host.d.ts +22 -5
  528. package/dist/runtime/host.d.ts.map +1 -1
  529. package/dist/runtime/index.d.ts +0 -1
  530. package/dist/runtime/index.d.ts.map +1 -1
  531. package/dist/runtime/internal.d.ts +6 -0
  532. package/dist/runtime/internal.d.ts.map +1 -1
  533. package/dist/runtime/internal.js +52 -31
  534. package/dist/runtime/internal.js.map +1 -1
  535. package/dist/runtime/sixb.d.ts +6 -1
  536. package/dist/runtime/sixb.d.ts.map +1 -1
  537. package/dist/sandboxes/index.js +8 -7
  538. package/dist/sandboxes/index.js.map +1 -1
  539. package/dist/scheduler/index.d.ts +0 -2
  540. package/dist/scheduler/index.d.ts.map +1 -1
  541. package/dist/scheduler/index.js +3 -6
  542. package/dist/scheduler/index.js.map +1 -1
  543. package/dist/schedules/index.js +9 -11
  544. package/dist/schedules/index.js.map +1 -1
  545. package/dist/security/internal.js +1 -1
  546. package/dist/shared/backoff.d.ts +12 -0
  547. package/dist/shared/backoff.d.ts.map +1 -0
  548. package/dist/shared/duration.d.ts +3 -0
  549. package/dist/shared/duration.d.ts.map +1 -0
  550. package/dist/shared/params/artifact-refs.d.ts +19 -0
  551. package/dist/shared/params/artifact-refs.d.ts.map +1 -0
  552. package/dist/shares/guest-name.d.ts +8 -0
  553. package/dist/shares/guest-name.d.ts.map +1 -0
  554. package/dist/shares/internal.d.ts +1 -0
  555. package/dist/shares/internal.d.ts.map +1 -1
  556. package/dist/shares/internal.js +69 -28
  557. package/dist/shares/internal.js.map +3 -3
  558. package/dist/shares/session-protocol.d.ts +13 -0
  559. package/dist/shares/session-protocol.d.ts.map +1 -1
  560. package/dist/storage/action-runs/failure.js +2 -2
  561. package/dist/storage/agents/provider.js +1 -1
  562. package/dist/storage/agents/types.d.ts +1 -1
  563. package/dist/storage/agents/types.d.ts.map +1 -1
  564. package/dist/storage/ai-limits/enforcement.js +2 -2
  565. package/dist/storage/artifacts/errors.d.ts +9 -4
  566. package/dist/storage/artifacts/errors.d.ts.map +1 -1
  567. package/dist/storage/artifacts/in-memory.d.ts +27 -4
  568. package/dist/storage/artifacts/in-memory.d.ts.map +1 -1
  569. package/dist/storage/artifacts/index.d.ts +1 -1
  570. package/dist/storage/artifacts/index.d.ts.map +1 -1
  571. package/dist/storage/artifacts/record.d.ts +39 -2
  572. package/dist/storage/artifacts/record.d.ts.map +1 -1
  573. package/dist/storage/artifacts/types.d.ts +328 -39
  574. package/dist/storage/artifacts/types.d.ts.map +1 -1
  575. package/dist/storage/auth/in-memory/auth-storage.d.ts +2 -1
  576. package/dist/storage/auth/in-memory/auth-storage.d.ts.map +1 -1
  577. package/dist/storage/auth/in-memory/identities.d.ts +4 -0
  578. package/dist/storage/auth/in-memory/identities.d.ts.map +1 -1
  579. package/dist/storage/auth/in-memory/shared.d.ts +3 -1
  580. package/dist/storage/auth/in-memory/shared.d.ts.map +1 -1
  581. package/dist/storage/auth/in-memory/users.d.ts.map +1 -1
  582. package/dist/storage/auth/index.d.ts +1 -1
  583. package/dist/storage/auth/index.d.ts.map +1 -1
  584. package/dist/storage/auth/types.d.ts +39 -0
  585. package/dist/storage/auth/types.d.ts.map +1 -1
  586. package/dist/storage/connector-connections/in-memory.d.ts +1 -1
  587. package/dist/storage/connector-connections/in-memory.d.ts.map +1 -1
  588. package/dist/storage/connector-connections/index.d.ts +1 -1
  589. package/dist/storage/connector-connections/index.d.ts.map +1 -1
  590. package/dist/storage/connector-connections/provider/runs.d.ts.map +1 -1
  591. package/dist/storage/connector-connections/provider/shared.d.ts +12 -2
  592. package/dist/storage/connector-connections/provider/shared.d.ts.map +1 -1
  593. package/dist/storage/connector-connections/provider.d.ts +1 -0
  594. package/dist/storage/connector-connections/provider.d.ts.map +1 -1
  595. package/dist/storage/connector-connections/provider.js +21 -5
  596. package/dist/storage/connector-connections/provider.js.map +5 -5
  597. package/dist/storage/connector-connections/types.d.ts +1 -1
  598. package/dist/storage/connector-connections/types.d.ts.map +1 -1
  599. package/dist/storage/dataset-ingest/codec.d.ts +6 -0
  600. package/dist/storage/dataset-ingest/codec.d.ts.map +1 -0
  601. package/dist/storage/dataset-ingest/in-memory.d.ts +28 -0
  602. package/dist/storage/dataset-ingest/in-memory.d.ts.map +1 -0
  603. package/dist/storage/dataset-ingest/index.d.ts +4 -0
  604. package/dist/storage/dataset-ingest/index.d.ts.map +1 -0
  605. package/dist/storage/dataset-ingest/provider.d.ts +157 -0
  606. package/dist/storage/dataset-ingest/provider.d.ts.map +1 -0
  607. package/dist/storage/dataset-ingest/provider.js +17 -0
  608. package/dist/storage/dataset-ingest/provider.js.map +9 -0
  609. package/dist/storage/dataset-ingest/types.d.ts +188 -0
  610. package/dist/storage/dataset-ingest/types.d.ts.map +1 -0
  611. package/dist/storage/file-upload-sessions/provider.js +12 -11
  612. package/dist/storage/file-upload-sessions/provider.js.map +1 -1
  613. package/dist/storage/in-memory/index.d.ts +12 -0
  614. package/dist/storage/in-memory/index.d.ts.map +1 -1
  615. package/dist/storage/index.d.ts +18 -11
  616. package/dist/storage/index.d.ts.map +1 -1
  617. package/dist/storage/index.js +56 -46
  618. package/dist/storage/index.js.map +1 -1
  619. package/dist/storage/internal.d.ts +4 -1
  620. package/dist/storage/internal.d.ts.map +1 -1
  621. package/dist/storage/internal.js +81 -5
  622. package/dist/storage/internal.js.map +4 -3
  623. package/dist/storage/lake-retention-runs/in-memory.d.ts +11 -0
  624. package/dist/storage/lake-retention-runs/in-memory.d.ts.map +1 -0
  625. package/dist/storage/lake-retention-runs/index.d.ts +3 -0
  626. package/dist/storage/lake-retention-runs/index.d.ts.map +1 -0
  627. package/dist/storage/lake-retention-runs/types.d.ts +21 -0
  628. package/dist/storage/lake-retention-runs/types.d.ts.map +1 -0
  629. package/dist/storage/maintenance-heartbeats/in-memory.d.ts +11 -0
  630. package/dist/storage/maintenance-heartbeats/in-memory.d.ts.map +1 -0
  631. package/dist/storage/maintenance-heartbeats/index.d.ts +3 -0
  632. package/dist/storage/maintenance-heartbeats/index.d.ts.map +1 -0
  633. package/dist/storage/maintenance-heartbeats/record.d.ts +11 -0
  634. package/dist/storage/maintenance-heartbeats/record.d.ts.map +1 -0
  635. package/dist/storage/maintenance-heartbeats/types.d.ts +30 -0
  636. package/dist/storage/maintenance-heartbeats/types.d.ts.map +1 -0
  637. package/dist/storage/objects/in-memory/query.d.ts.map +1 -1
  638. package/dist/storage/objects/in-memory/storage.d.ts +15 -1
  639. package/dist/storage/objects/in-memory/storage.d.ts.map +1 -1
  640. package/dist/storage/objects/read-scope.d.ts.map +1 -1
  641. package/dist/storage/objects/types.d.ts +18 -1
  642. package/dist/storage/objects/types.d.ts.map +1 -1
  643. package/dist/storage/ontology/in-memory/materializations.d.ts.map +1 -1
  644. package/dist/storage/ontology/in-memory/replacement-plans.d.ts.map +1 -1
  645. package/dist/storage/ontology/index.d.ts +1 -1
  646. package/dist/storage/ontology/index.d.ts.map +1 -1
  647. package/dist/storage/ontology/materializations.d.ts +20 -0
  648. package/dist/storage/ontology/materializations.d.ts.map +1 -1
  649. package/dist/storage/ontology/provider-work.d.ts +7 -1
  650. package/dist/storage/ontology/provider-work.d.ts.map +1 -1
  651. package/dist/storage/ontology/provider.js +1 -1
  652. package/dist/storage/pipeline-runs/in-memory.d.ts +8 -2
  653. package/dist/storage/pipeline-runs/in-memory.d.ts.map +1 -1
  654. package/dist/storage/pipeline-runs/index.d.ts +1 -1
  655. package/dist/storage/pipeline-runs/index.d.ts.map +1 -1
  656. package/dist/storage/pipeline-runs/provider.js +1 -1
  657. package/dist/storage/pipeline-runs/transitions.d.ts +2 -2
  658. package/dist/storage/pipeline-runs/transitions.d.ts.map +1 -1
  659. package/dist/storage/pipeline-runs/types.d.ts +26 -6
  660. package/dist/storage/pipeline-runs/types.d.ts.map +1 -1
  661. package/dist/storage/projection-runs/errors.d.ts +6 -0
  662. package/dist/storage/projection-runs/errors.d.ts.map +1 -1
  663. package/dist/storage/projection-runs/in-memory.d.ts +5 -1
  664. package/dist/storage/projection-runs/in-memory.d.ts.map +1 -1
  665. package/dist/storage/projection-runs/index.d.ts +2 -2
  666. package/dist/storage/projection-runs/index.d.ts.map +1 -1
  667. package/dist/storage/projection-runs/lifecycle.d.ts +1 -0
  668. package/dist/storage/projection-runs/lifecycle.d.ts.map +1 -1
  669. package/dist/storage/projection-runs/provider.js +2 -2
  670. package/dist/storage/projection-runs/types.d.ts +16 -0
  671. package/dist/storage/projection-runs/types.d.ts.map +1 -1
  672. package/dist/storage/run-claim.d.ts +132 -0
  673. package/dist/storage/run-claim.d.ts.map +1 -0
  674. package/dist/storage/share-grants/provider.js +3 -3
  675. package/dist/storage/share-sessions/in-memory.d.ts +2 -1
  676. package/dist/storage/share-sessions/in-memory.d.ts.map +1 -1
  677. package/dist/storage/share-sessions/index.d.ts +1 -1
  678. package/dist/storage/share-sessions/index.d.ts.map +1 -1
  679. package/dist/storage/share-sessions/provider.d.ts +1 -1
  680. package/dist/storage/share-sessions/provider.d.ts.map +1 -1
  681. package/dist/storage/share-sessions/provider.js +4 -2
  682. package/dist/storage/share-sessions/provider.js.map +1 -1
  683. package/dist/storage/share-sessions/record.d.ts +2 -1
  684. package/dist/storage/share-sessions/record.d.ts.map +1 -1
  685. package/dist/storage/share-sessions/types.d.ts +17 -1
  686. package/dist/storage/share-sessions/types.d.ts.map +1 -1
  687. package/dist/storage/sync-runs/in-memory.d.ts +10 -2
  688. package/dist/storage/sync-runs/in-memory.d.ts.map +1 -1
  689. package/dist/storage/sync-runs/index.d.ts +1 -1
  690. package/dist/storage/sync-runs/index.d.ts.map +1 -1
  691. package/dist/storage/sync-runs/transitions.d.ts +2 -2
  692. package/dist/storage/sync-runs/transitions.d.ts.map +1 -1
  693. package/dist/storage/sync-runs/types.d.ts +29 -3
  694. package/dist/storage/sync-runs/types.d.ts.map +1 -1
  695. package/dist/storage/types.d.ts +12 -6
  696. package/dist/storage/types.d.ts.map +1 -1
  697. package/dist/storage/webhook-runs/in-memory.d.ts +2 -1
  698. package/dist/storage/webhook-runs/in-memory.d.ts.map +1 -1
  699. package/dist/storage/webhook-runs/index.d.ts +2 -2
  700. package/dist/storage/webhook-runs/index.d.ts.map +1 -1
  701. package/dist/storage/webhook-runs/types.d.ts +33 -2
  702. package/dist/storage/webhook-runs/types.d.ts.map +1 -1
  703. package/dist/storage/workflow-runs/in-memory.d.ts +6 -3
  704. package/dist/storage/workflow-runs/in-memory.d.ts.map +1 -1
  705. package/dist/storage/workflow-runs/index.d.ts +1 -1
  706. package/dist/storage/workflow-runs/index.d.ts.map +1 -1
  707. package/dist/storage/workflow-runs/provider.js +12 -11
  708. package/dist/storage/workflow-runs/provider.js.map +1 -1
  709. package/dist/storage/workflow-runs/types.d.ts +11 -28
  710. package/dist/storage/workflow-runs/types.d.ts.map +1 -1
  711. package/dist/syncs/index.js +38 -35
  712. package/dist/syncs/index.js.map +1 -1
  713. package/dist/syncs/run-dispatch.d.ts +2 -0
  714. package/dist/syncs/run-dispatch.d.ts.map +1 -1
  715. package/dist/testing/ai-model-call-groups-contract.d.ts.map +1 -1
  716. package/dist/testing/artifact-holders-contract.d.ts +15 -0
  717. package/dist/testing/artifact-holders-contract.d.ts.map +1 -0
  718. package/dist/testing/artifact-storage-contract.d.ts.map +1 -1
  719. package/dist/testing/auth-storage-contract.d.ts.map +1 -1
  720. package/dist/testing/broker-contract.d.ts.map +1 -1
  721. package/dist/testing/connector-connection-storage-contract.d.ts +1 -1
  722. package/dist/testing/connector-connection-storage-contract.d.ts.map +1 -1
  723. package/dist/testing/dataset-ingest-storage-contract.d.ts +11 -0
  724. package/dist/testing/dataset-ingest-storage-contract.d.ts.map +1 -0
  725. package/dist/testing/dataset-sequence-contract.d.ts +1 -1
  726. package/dist/testing/dataset-sequence-contract.d.ts.map +1 -1
  727. package/dist/testing/execution.d.ts.map +1 -1
  728. package/dist/testing/index.d.ts +8 -0
  729. package/dist/testing/index.d.ts.map +1 -1
  730. package/dist/testing/index.js +6245 -3192
  731. package/dist/testing/index.js.map +28 -19
  732. package/dist/testing/lake-retention-run-storage-contract.d.ts +9 -0
  733. package/dist/testing/lake-retention-run-storage-contract.d.ts.map +1 -0
  734. package/dist/testing/maintenance-heartbeat-storage-contract.d.ts +9 -0
  735. package/dist/testing/maintenance-heartbeat-storage-contract.d.ts.map +1 -0
  736. package/dist/testing/object-query-contract.d.ts.map +1 -1
  737. package/dist/testing/pipeline-execution.d.ts.map +1 -1
  738. package/dist/testing/pipeline-run-read-contract.d.ts +13 -0
  739. package/dist/testing/pipeline-run-read-contract.d.ts.map +1 -0
  740. package/dist/testing/projection-run-storage-contract.d.ts.map +1 -1
  741. package/dist/testing/queues-contract.d.ts.map +1 -1
  742. package/dist/testing/run-claim-storage-contract.d.ts +12 -0
  743. package/dist/testing/run-claim-storage-contract.d.ts.map +1 -0
  744. package/dist/testing/run-claim.d.ts +30 -0
  745. package/dist/testing/run-claim.d.ts.map +1 -0
  746. package/dist/testing/run-recovery-contract.d.ts +49 -0
  747. package/dist/testing/run-recovery-contract.d.ts.map +1 -0
  748. package/dist/testing/share-session-storage-contract.d.ts.map +1 -1
  749. package/dist/testing/stored-artifacts.d.ts +10 -0
  750. package/dist/testing/stored-artifacts.d.ts.map +1 -0
  751. package/dist/testing/sync-execution.d.ts.map +1 -1
  752. package/dist/testing/webhook-execution.d.ts +1 -1
  753. package/dist/testing/webhook-execution.d.ts.map +1 -1
  754. package/dist/testing/webhook-run-storage-contract.d.ts.map +1 -1
  755. package/dist/users/execution.d.ts +18 -1
  756. package/dist/users/execution.d.ts.map +1 -1
  757. package/dist/users/index.d.ts +1 -1
  758. package/dist/users/index.d.ts.map +1 -1
  759. package/dist/webhooks/delivery-lease.d.ts +13 -0
  760. package/dist/webhooks/delivery-lease.d.ts.map +1 -0
  761. package/dist/webhooks/internal.d.ts +2 -0
  762. package/dist/webhooks/internal.d.ts.map +1 -1
  763. package/dist/webhooks/internal.js +68 -36
  764. package/dist/webhooks/internal.js.map +5 -4
  765. package/dist/webhooks/run-admission.d.ts.map +1 -1
  766. package/dist/workers/index.d.ts +5 -1
  767. package/dist/workers/index.d.ts.map +1 -1
  768. package/dist/workers/index.js +193 -58
  769. package/dist/workers/index.js.map +8 -7
  770. package/dist/workers/job-ids.d.ts +17 -0
  771. package/dist/workers/job-ids.d.ts.map +1 -0
  772. package/dist/workers/lost-projection-runs.d.ts +26 -0
  773. package/dist/workers/lost-projection-runs.d.ts.map +1 -0
  774. package/dist/workers/lost-runs.d.ts +51 -0
  775. package/dist/workers/lost-runs.d.ts.map +1 -0
  776. package/dist/workers/queue-delivery.d.ts.map +1 -1
  777. package/dist/workers/queue-worker.d.ts +1 -2
  778. package/dist/workers/queue-worker.d.ts.map +1 -1
  779. package/dist/workers/queued-run-dispatch.d.ts +90 -0
  780. package/dist/workers/queued-run-dispatch.d.ts.map +1 -0
  781. package/dist/workers/run-lease.d.ts +25 -0
  782. package/dist/workers/run-lease.d.ts.map +1 -0
  783. package/dist/workers/run-worker.d.ts +95 -0
  784. package/dist/workers/run-worker.d.ts.map +1 -0
  785. package/dist/workflows/index.js +64 -58
  786. package/dist/workflows/index.js.map +1 -1
  787. package/dist/workflows/request.d.ts.map +1 -1
  788. package/dist/workflows/run-dispatch.d.ts +6 -1
  789. package/dist/workflows/run-dispatch.d.ts.map +1 -1
  790. package/package.json +41 -3
  791. package/src/actions/request.ts +24 -7
  792. package/src/actions/run/executor.ts +9 -42
  793. package/src/actions/types/context.ts +8 -3
  794. package/src/agents/approval-outcome.ts +2 -2
  795. package/src/agents/cancel.ts +2 -2
  796. package/src/agents/child-question.ts +76 -8
  797. package/src/agents/execution.ts +11 -3
  798. package/src/agents/fork.ts +12 -4
  799. package/src/agents/ids.ts +4 -1
  800. package/src/agents/index.ts +16 -3
  801. package/src/agents/model-loop.ts +3 -1
  802. package/src/agents/request.ts +42 -31
  803. package/src/agents/run-artifacts.ts +290 -46
  804. package/src/agents/run-session-children.ts +33 -0
  805. package/src/agents/run-session-http.ts +5 -0
  806. package/src/agents/run-session-serve.ts +11 -0
  807. package/src/agents/run-session.ts +8 -1
  808. package/src/agents/streams/protocol.ts +5 -10
  809. package/src/agents/tool-files.ts +1 -1
  810. package/src/agents/tool-input-coercion.ts +140 -0
  811. package/src/agents/validation.ts +12 -1
  812. package/src/artifacts/access.ts +71 -28
  813. package/src/artifacts/canvas-display.ts +160 -0
  814. package/src/artifacts/canvas.ts +26 -1
  815. package/src/artifacts/comment-text.ts +32 -0
  816. package/src/artifacts/comments.ts +275 -0
  817. package/src/artifacts/errors.ts +6 -1
  818. package/src/artifacts/events.ts +58 -0
  819. package/src/artifacts/execution.ts +496 -53
  820. package/src/artifacts/frames/assets.ts +20 -1
  821. package/src/artifacts/frames/grants.ts +31 -10
  822. package/src/artifacts/frames/index.ts +2 -0
  823. package/src/artifacts/frames/kit.ts +8 -5
  824. package/src/artifacts/frames/protocol.ts +231 -0
  825. package/src/artifacts/frames/runtime.ts +600 -29
  826. package/src/artifacts/holders.ts +120 -0
  827. package/src/artifacts/ids.ts +8 -0
  828. package/src/artifacts/index.ts +31 -2
  829. package/src/artifacts/limits.ts +28 -4
  830. package/src/artifacts/live/board.ts +759 -0
  831. package/src/artifacts/live/diff.ts +297 -0
  832. package/src/artifacts/live/document.ts +354 -0
  833. package/src/artifacts/live/files.ts +82 -0
  834. package/src/artifacts/live/index.ts +50 -0
  835. package/src/artifacts/live/presence.ts +144 -0
  836. package/src/artifacts/live/protocol.ts +134 -0
  837. package/src/artifacts/live/server.ts +16 -0
  838. package/src/artifacts/live/state.ts +115 -0
  839. package/src/artifacts/outline.ts +12 -0
  840. package/src/artifacts/publish/index.ts +26 -1
  841. package/src/artifacts/publish/merge.ts +271 -0
  842. package/src/artifacts/publish/previews.ts +485 -0
  843. package/src/artifacts/publish/publish.ts +92 -39
  844. package/src/artifacts/publish/query-answers.ts +85 -0
  845. package/src/artifacts/publish/references.ts +10 -4
  846. package/src/artifacts/publish/validate/canvas.ts +133 -1
  847. package/src/artifacts/theme.ts +9 -1
  848. package/src/auth/directory.ts +166 -0
  849. package/src/auth/member-events.ts +10 -3
  850. package/src/auth/runtime.ts +108 -8
  851. package/src/auth/strategy.ts +3 -1
  852. package/src/auth/types.ts +44 -0
  853. package/src/authorization/decision.ts +6 -5
  854. package/src/authorization/event-visibility.ts +4 -0
  855. package/src/broker/in-memory.ts +33 -6
  856. package/src/broker/types.ts +4 -0
  857. package/src/connectors/builders.ts +34 -2
  858. package/src/connectors/connections/access.ts +83 -0
  859. package/src/connectors/connections/contracts.ts +6 -1
  860. package/src/connectors/connections/execution.ts +2 -2
  861. package/src/connectors/connections/runs.ts +51 -2
  862. package/src/connectors/connections/service.ts +208 -41
  863. package/src/connectors/connections/views.ts +11 -4
  864. package/src/connectors/execution.ts +27 -3
  865. package/src/connectors/index.ts +2 -0
  866. package/src/connectors/service.ts +12 -0
  867. package/src/connectors/types.ts +37 -2
  868. package/src/datasets/execution.ts +74 -37
  869. package/src/datasets/ingest-flush-batch.ts +289 -0
  870. package/src/datasets/ingest-flush-job.ts +112 -0
  871. package/src/datasets/ingest-flush.ts +377 -0
  872. package/src/datasets/produced-version.ts +55 -0
  873. package/src/datasets/write.ts +65 -11
  874. package/src/deploy/services.ts +1 -1
  875. package/src/deploy/types.ts +2 -3
  876. package/src/deploy/validation.ts +1 -0
  877. package/src/error-reporting/capability.ts +66 -0
  878. package/src/error-reporting/internal.ts +12 -0
  879. package/src/error-reporting/reporter.ts +11 -35
  880. package/src/error-reporting/reports.ts +167 -0
  881. package/src/error-reporting/types.ts +99 -0
  882. package/src/errors/catalog.ts +6 -0
  883. package/src/events/definitions.ts +14 -0
  884. package/src/events/execution.ts +77 -28
  885. package/src/events/index.ts +3 -0
  886. package/src/events/scope.ts +2 -0
  887. package/src/events/types/artifacts.ts +40 -0
  888. package/src/events/types/index.ts +3 -0
  889. package/src/events/types/users.ts +5 -2
  890. package/src/execution/authorized-object-reader.ts +34 -0
  891. package/src/execution/object-reader-clearance.ts +31 -0
  892. package/src/execution/object-reader-security.ts +33 -13
  893. package/src/http/api-routes.ts +106 -5
  894. package/src/index.ts +22 -4
  895. package/src/lake-storage/errors.ts +21 -0
  896. package/src/lake-storage/index.ts +9 -1
  897. package/src/lake-storage/maintenance.ts +93 -0
  898. package/src/lake-storage/merge.ts +3 -1
  899. package/src/lake-storage/source-ordering.ts +28 -2
  900. package/src/lake-storage/types.ts +14 -0
  901. package/src/maintenance/heartbeat.ts +14 -0
  902. package/src/maintenance/index.ts +5 -3
  903. package/src/maintenance/lake-retention-status.ts +81 -0
  904. package/src/maintenance/lake-retention.ts +347 -0
  905. package/src/maintenance/loop.ts +365 -0
  906. package/src/maintenance/ontology-maintenance.ts +76 -229
  907. package/src/maintenance/passes/cron-pass.ts +217 -0
  908. package/src/maintenance/passes/directory-pass.ts +22 -0
  909. package/src/maintenance/passes/ingest-pass.ts +94 -0
  910. package/src/maintenance/passes/lake-change-feed.ts +112 -0
  911. package/src/maintenance/passes/lake-retention-pass.ts +71 -0
  912. package/src/maintenance/passes/ontology-pass.ts +19 -0
  913. package/src/maintenance/passes/projections-pass.ts +238 -0
  914. package/src/maintenance/passes/recovery-pass.ts +17 -0
  915. package/src/maintenance/passes/recovery-passes.ts +39 -0
  916. package/src/maintenance/passes/runs-pass.ts +12 -0
  917. package/src/maintenance/passes/triggers-pass.ts +332 -0
  918. package/src/maintenance/status.ts +75 -0
  919. package/src/maintenance/types.ts +27 -25
  920. package/src/materialization/model.ts +33 -21
  921. package/src/materializer/README.md +13 -2
  922. package/src/materializer/edits/artifact-refs.ts +140 -0
  923. package/src/materializer/edits/commit.ts +20 -7
  924. package/src/materializer/edits/operations.ts +23 -7
  925. package/src/materializer/edits/plan.ts +2 -0
  926. package/src/materializer/execution/work-records.ts +61 -0
  927. package/src/materializer/projections/replacement-plan.ts +2 -0
  928. package/src/materializer/shared/normalize.ts +14 -0
  929. package/src/materializer/telemetry/plan.ts +2 -0
  930. package/src/models/language-model.ts +6 -0
  931. package/src/models/tools.ts +2 -0
  932. package/src/objects/artifact-refs.ts +34 -0
  933. package/src/objects/materializer-adapter.ts +8 -3
  934. package/src/objects/object/upsert-batch.ts +7 -0
  935. package/src/objects/object/upsert.ts +11 -2
  936. package/src/objects/query/ir.ts +2 -0
  937. package/src/objects/query/scalar-values.ts +5 -3
  938. package/src/objects/runtime-batch.ts +8 -1
  939. package/src/objects/vectors/README.md +4 -4
  940. package/src/ontology/artifact-ref.ts +83 -0
  941. package/src/ontology/docs-markdown.ts +17 -0
  942. package/src/ontology/index.ts +3 -1
  943. package/src/ontology/inference/index.ts +2 -0
  944. package/src/ontology/json-schema.ts +13 -0
  945. package/src/ontology/primitives.ts +14 -0
  946. package/src/ontology/reference-values.ts +62 -0
  947. package/src/ontology/refs.ts +7 -1
  948. package/src/ontology/registry.ts +26 -1
  949. package/src/ontology/types.ts +2 -0
  950. package/src/ontology/user-ref.ts +35 -45
  951. package/src/ontology/validation/normalize.ts +13 -0
  952. package/src/ontology/validation/properties.ts +9 -0
  953. package/src/ontology/validation/schema.ts +12 -0
  954. package/src/pending-tasks.ts +51 -0
  955. package/src/pipelines/run-dispatch.ts +120 -238
  956. package/src/predicates/types.ts +2 -1
  957. package/src/projections/builders.ts +28 -13
  958. package/src/projections/run-dispatch.ts +1 -1
  959. package/src/projections/types.ts +1 -1
  960. package/src/projections/validation.ts +22 -8
  961. package/src/queues/in-memory.ts +50 -3
  962. package/src/queues/index.ts +4 -0
  963. package/src/queues/types.ts +68 -1
  964. package/src/runtime/create.ts +4 -0
  965. package/src/runtime/host.ts +118 -13
  966. package/src/runtime/index.ts +0 -1
  967. package/src/runtime/internal.ts +13 -0
  968. package/src/runtime/ontology-mutations.ts +1 -1
  969. package/src/runtime/sixb.ts +14 -5
  970. package/src/scheduler/index.ts +0 -2
  971. package/src/shared/backoff.ts +34 -0
  972. package/src/shared/duration.ts +15 -0
  973. package/src/shared/params/artifact-refs.ts +42 -0
  974. package/src/shares/compiler.ts +1 -1
  975. package/src/shares/guest-name.ts +20 -0
  976. package/src/shares/internal.ts +1 -0
  977. package/src/shares/session-protocol.ts +63 -0
  978. package/src/storage/agents/types.ts +1 -1
  979. package/src/storage/artifacts/errors.ts +10 -2
  980. package/src/storage/artifacts/in-memory.ts +579 -96
  981. package/src/storage/artifacts/index.ts +22 -1
  982. package/src/storage/artifacts/record.ts +255 -11
  983. package/src/storage/artifacts/types.ts +343 -40
  984. package/src/storage/auth/in-memory/auth-storage.ts +42 -5
  985. package/src/storage/auth/in-memory/identities.ts +16 -0
  986. package/src/storage/auth/in-memory/shared.ts +15 -0
  987. package/src/storage/auth/in-memory/users.ts +17 -16
  988. package/src/storage/auth/index.ts +3 -0
  989. package/src/storage/auth/types.ts +38 -0
  990. package/src/storage/connector-connections/in-memory.ts +4 -1
  991. package/src/storage/connector-connections/index.ts +1 -0
  992. package/src/storage/connector-connections/provider/runs.ts +3 -0
  993. package/src/storage/connector-connections/provider/shared.ts +30 -0
  994. package/src/storage/connector-connections/provider.ts +4 -0
  995. package/src/storage/connector-connections/types.ts +1 -0
  996. package/src/storage/dataset-ingest/codec.ts +90 -0
  997. package/src/storage/dataset-ingest/in-memory.ts +277 -0
  998. package/src/storage/dataset-ingest/index.ts +16 -0
  999. package/src/storage/dataset-ingest/provider.ts +592 -0
  1000. package/src/storage/dataset-ingest/types.ts +191 -0
  1001. package/src/storage/in-memory/index.ts +33 -0
  1002. package/src/storage/index.ts +65 -5
  1003. package/src/storage/internal.ts +20 -0
  1004. package/src/storage/lake-retention-runs/in-memory.ts +22 -0
  1005. package/src/storage/lake-retention-runs/index.ts +2 -0
  1006. package/src/storage/lake-retention-runs/types.ts +19 -0
  1007. package/src/storage/maintenance-heartbeats/in-memory.ts +24 -0
  1008. package/src/storage/maintenance-heartbeats/index.ts +7 -0
  1009. package/src/storage/maintenance-heartbeats/record.ts +50 -0
  1010. package/src/storage/maintenance-heartbeats/types.ts +30 -0
  1011. package/src/storage/objects/in-memory/query.ts +1 -0
  1012. package/src/storage/objects/in-memory/storage.ts +81 -0
  1013. package/src/storage/objects/read-scope.ts +1 -0
  1014. package/src/storage/objects/types.ts +16 -1
  1015. package/src/storage/ontology/in-memory/materializations.ts +8 -0
  1016. package/src/storage/ontology/in-memory/replacement-plans.ts +4 -1
  1017. package/src/storage/ontology/index.ts +2 -0
  1018. package/src/storage/ontology/materializations.ts +18 -0
  1019. package/src/storage/ontology/provider-work.ts +39 -0
  1020. package/src/storage/pipeline-runs/in-memory.ts +97 -24
  1021. package/src/storage/pipeline-runs/index.ts +0 -1
  1022. package/src/storage/pipeline-runs/provider.ts +1 -1
  1023. package/src/storage/pipeline-runs/transitions.ts +7 -4
  1024. package/src/storage/pipeline-runs/types.ts +33 -7
  1025. package/src/storage/projection-runs/errors.ts +10 -0
  1026. package/src/storage/projection-runs/in-memory.ts +56 -1
  1027. package/src/storage/projection-runs/index.ts +2 -1
  1028. package/src/storage/projection-runs/lifecycle.ts +9 -1
  1029. package/src/storage/projection-runs/types.ts +20 -1
  1030. package/src/storage/run-claim.ts +224 -0
  1031. package/src/storage/share-sessions/in-memory.ts +21 -0
  1032. package/src/storage/share-sessions/index.ts +1 -0
  1033. package/src/storage/share-sessions/provider.ts +1 -0
  1034. package/src/storage/share-sessions/record.ts +28 -0
  1035. package/src/storage/share-sessions/types.ts +19 -1
  1036. package/src/storage/sync-runs/in-memory.ts +109 -29
  1037. package/src/storage/sync-runs/index.ts +1 -1
  1038. package/src/storage/sync-runs/transitions.ts +7 -4
  1039. package/src/storage/sync-runs/types.ts +36 -3
  1040. package/src/storage/types.ts +15 -5
  1041. package/src/storage/webhook-runs/in-memory.ts +26 -2
  1042. package/src/storage/webhook-runs/index.ts +3 -1
  1043. package/src/storage/webhook-runs/types.ts +44 -3
  1044. package/src/storage/workflow-runs/in-memory.ts +50 -36
  1045. package/src/storage/workflow-runs/index.ts +0 -2
  1046. package/src/storage/workflow-runs/types.ts +18 -30
  1047. package/src/syncs/run-dispatch.ts +118 -239
  1048. package/src/testing/ai-model-call-groups-contract.ts +2 -1
  1049. package/src/testing/artifact-holders-contract.ts +392 -0
  1050. package/src/testing/artifact-storage-contract.ts +1205 -151
  1051. package/src/testing/auth-storage-contract.ts +228 -1
  1052. package/src/testing/broker-contract.ts +56 -0
  1053. package/src/testing/connector-connection-storage-contract.ts +94 -5
  1054. package/src/testing/dataset-ingest-storage-contract.ts +480 -0
  1055. package/src/testing/dataset-sequence-contract.ts +97 -12
  1056. package/src/testing/execution.ts +23 -0
  1057. package/src/testing/index.ts +31 -0
  1058. package/src/testing/lake-retention-run-storage-contract.ts +75 -0
  1059. package/src/testing/maintenance-heartbeat-storage-contract.ts +99 -0
  1060. package/src/testing/object-query-contract.ts +93 -0
  1061. package/src/testing/pipeline-execution.ts +3 -1
  1062. package/src/testing/pipeline-run-read-contract.ts +123 -0
  1063. package/src/testing/projection-run-storage-contract.ts +113 -0
  1064. package/src/testing/queues-contract.ts +112 -0
  1065. package/src/testing/run-claim-storage-contract.ts +736 -0
  1066. package/src/testing/run-claim.ts +69 -0
  1067. package/src/testing/run-recovery-contract.ts +176 -0
  1068. package/src/testing/share-session-storage-contract.ts +43 -0
  1069. package/src/testing/stored-artifacts.ts +43 -0
  1070. package/src/testing/sync-execution.ts +3 -1
  1071. package/src/testing/webhook-execution.ts +7 -2
  1072. package/src/testing/webhook-run-storage-contract.ts +102 -5
  1073. package/src/users/execution.ts +50 -2
  1074. package/src/users/index.ts +1 -0
  1075. package/src/webhooks/delivery-lease.ts +40 -0
  1076. package/src/webhooks/internal.ts +2 -0
  1077. package/src/webhooks/run-admission.ts +22 -9
  1078. package/src/workers/README.md +169 -0
  1079. package/src/workers/index.ts +9 -1
  1080. package/src/workers/job-ids.ts +31 -0
  1081. package/src/workers/lost-projection-runs.ts +114 -0
  1082. package/src/workers/lost-runs.ts +397 -0
  1083. package/src/workers/queue-delivery.ts +2 -14
  1084. package/src/workers/queue-worker.ts +9 -17
  1085. package/src/workers/queued-run-dispatch.ts +308 -0
  1086. package/src/workers/run-lease.ts +46 -0
  1087. package/src/workers/run-worker.ts +312 -0
  1088. package/src/workers/worker.ts +4 -17
  1089. package/src/workflows/request.ts +2 -0
  1090. package/src/workflows/run-dispatch.ts +22 -4
  1091. package/src/workflows/snapshot.ts +1 -0
  1092. package/dist/chunk-2g0r46hy.js.map +0 -12
  1093. package/dist/chunk-3fqxbn31.js +0 -107
  1094. package/dist/chunk-3fqxbn31.js.map +0 -11
  1095. package/dist/chunk-4s753g3k.js +0 -314
  1096. package/dist/chunk-4s753g3k.js.map +0 -12
  1097. package/dist/chunk-5kyvrtjh.js.map +0 -12
  1098. package/dist/chunk-5taem5aw.js.map +0 -10
  1099. package/dist/chunk-65abf64x.js +0 -13
  1100. package/dist/chunk-65abf64x.js.map +0 -10
  1101. package/dist/chunk-9x8dybsb.js.map +0 -10
  1102. package/dist/chunk-az47zep4.js +0 -41
  1103. package/dist/chunk-az47zep4.js.map +0 -10
  1104. package/dist/chunk-c706qvyc.js +0 -299
  1105. package/dist/chunk-c706qvyc.js.map +0 -11
  1106. package/dist/chunk-djs3hw9p.js.map +0 -20
  1107. package/dist/chunk-dsv783c3.js.map +0 -47
  1108. package/dist/chunk-e5wf5vz0.js.map +0 -10
  1109. package/dist/chunk-e6xgz4h4.js.map +0 -21
  1110. package/dist/chunk-e7v3trpz.js.map +0 -10
  1111. package/dist/chunk-eqgr6nsa.js.map +0 -72
  1112. package/dist/chunk-fb3feg1e.js +0 -298
  1113. package/dist/chunk-fb3feg1e.js.map +0 -12
  1114. package/dist/chunk-hz5d43gn.js.map +0 -10
  1115. package/dist/chunk-j8thxj7w.js.map +0 -22
  1116. package/dist/chunk-jbw70d6t.js.map +0 -10
  1117. package/dist/chunk-jftd33rc.js.map +0 -11
  1118. package/dist/chunk-jspskey0.js.map +0 -10
  1119. package/dist/chunk-kfee1h52.js.map +0 -13
  1120. package/dist/chunk-kwfhd1g0.js +0 -144
  1121. package/dist/chunk-kwfhd1g0.js.map +0 -13
  1122. package/dist/chunk-nz7815t3.js.map +0 -14
  1123. package/dist/chunk-s3we74h8.js.map +0 -12
  1124. package/dist/chunk-scyq22td.js.map +0 -12
  1125. package/dist/chunk-w1btn96n.js.map +0 -44
  1126. package/dist/chunk-w976a4me.js.map +0 -10
  1127. package/dist/chunk-wkq3kvzd.js.map +0 -10
  1128. package/dist/chunk-wrjx1fqz.js +0 -587
  1129. package/dist/chunk-wrjx1fqz.js.map +0 -18
  1130. package/dist/chunk-yw9pyg66.js +0 -143
  1131. package/dist/chunk-yw9pyg66.js.map +0 -11
  1132. package/dist/chunk-z8fx5cgb.js.map +0 -11
  1133. package/dist/scheduler/runtime.d.ts +0 -40
  1134. package/dist/scheduler/runtime.d.ts.map +0 -1
  1135. package/dist/workers/unstarted-run.d.ts +0 -10
  1136. package/dist/workers/unstarted-run.d.ts.map +0 -1
  1137. package/src/scheduler/runtime.ts +0 -214
  1138. package/src/workers/unstarted-run.ts +0 -18
  1139. /package/dist/{chunk-80gym75n.js.map → chunk-186k5yz3.js.map} +0 -0
  1140. /package/dist/{chunk-ga63a3dz.js.map → chunk-2bn6813a.js.map} +0 -0
  1141. /package/dist/{chunk-ytzcxtpt.js.map → chunk-3ba89vm7.js.map} +0 -0
  1142. /package/dist/{chunk-d04g36fw.js.map → chunk-5qqmndhm.js.map} +0 -0
  1143. /package/dist/{chunk-5wtnmpze.js.map → chunk-7qe46788.js.map} +0 -0
  1144. /package/dist/{chunk-31kcqmhf.js.map → chunk-855w9nvw.js.map} +0 -0
  1145. /package/dist/{chunk-9whfmsfk.js.map → chunk-8tqnsx3q.js.map} +0 -0
  1146. /package/dist/{chunk-s038wa5v.js.map → chunk-b9qfh2ya.js.map} +0 -0
  1147. /package/dist/{chunk-jjmggm9a.js.map → chunk-fe6r7yhg.js.map} +0 -0
  1148. /package/dist/{chunk-165c9wm6.js.map → chunk-g2ph4873.js.map} +0 -0
  1149. /package/dist/{chunk-4zm1k3xj.js.map → chunk-r2psmn42.js.map} +0 -0
  1150. /package/dist/{chunk-2ajw5rz0.js.map → chunk-rsxb14an.js.map} +0 -0
  1151. /package/dist/{chunk-r1cxq7vv.js.map → chunk-rtdrm592.js.map} +0 -0
  1152. /package/dist/{chunk-4bm0caep.js.map → chunk-smnt672s.js.map} +0 -0
  1153. /package/dist/{chunk-21q0j5f2.js.map → chunk-stmxh0hv.js.map} +0 -0
  1154. /package/dist/{chunk-ff5xkv0p.js.map → chunk-tfzvjdms.js.map} +0 -0
  1155. /package/dist/{chunk-6b61s40c.js.map → chunk-w3t94hm6.js.map} +0 -0
@@ -0,0 +1,1553 @@
1
+ // @bun
2
+ import {
3
+ isValidFileRef
4
+ } from "./chunk-wkv3h3q7.js";
5
+ import {
6
+ ARTIFACT_LIMITS2
7
+ } from "./chunk-9vsc919v.js";
8
+ import {
9
+ statFileRef2
10
+ } from "./chunk-a3faa34j.js";
11
+ import {
12
+ isArtifactAddress2,
13
+ parseArtifactAddress2
14
+ } from "./chunk-bz5bnjjt.js";
15
+
16
+ // src/artifacts/errors.ts
17
+ class ArtifactRequestError2 extends Error {
18
+ code;
19
+ latest;
20
+ name = "ArtifactRequestError";
21
+ constructor(code, message, latest) {
22
+ super(message);
23
+ this.code = code;
24
+ this.latest = latest;
25
+ }
26
+ }
27
+
28
+ // src/artifacts/publish/files.ts
29
+ async function checkArtifactFiles(blobStorage, files) {
30
+ if (files.length === 0)
31
+ throw invalidArtifact("A version needs at least one file.");
32
+ if (files.length > ARTIFACT_LIMITS2.maxFiles) {
33
+ throw invalidArtifact(`A version holds at most ${ARTIFACT_LIMITS2.maxFiles} files; this one has ${files.length}.`);
34
+ }
35
+ const paths = new Set;
36
+ let totalBytes = 0;
37
+ for (const entry of files) {
38
+ if (!isArtifactPath(entry.path)) {
39
+ throw invalidArtifact(`'${entry.path}' is not a usable file path: use a relative path with / separators, no . or .. segments, and at most ${ARTIFACT_LIMITS2.maxPathLength} characters.`);
40
+ }
41
+ if (paths.has(entry.path))
42
+ throw invalidArtifact(`'${entry.path}' appears twice.`);
43
+ paths.add(entry.path);
44
+ if (!isValidFileRef(entry.file)) {
45
+ throw invalidArtifact(`'${entry.path}' does not have a valid file reference.`);
46
+ }
47
+ if (entry.file.sizeBytes > ARTIFACT_LIMITS2.maxFileBytes) {
48
+ throw invalidArtifact(`'${entry.path}' is ${entry.file.sizeBytes} bytes; a file may be at most ${ARTIFACT_LIMITS2.maxFileBytes}.`);
49
+ }
50
+ totalBytes += entry.file.sizeBytes;
51
+ }
52
+ if (totalBytes > ARTIFACT_LIMITS2.maxVersionBytes) {
53
+ throw invalidArtifact(`The files total ${totalBytes} bytes; a version may hold at most ${ARTIFACT_LIMITS2.maxVersionBytes}.`);
54
+ }
55
+ const stored = await Promise.all(files.map((entry) => statFileRef2(blobStorage, entry.file)));
56
+ const missing = files.find((_, index) => !stored[index]);
57
+ if (missing)
58
+ throw invalidArtifact(`'${missing.path}' refers to a file that is not stored.`);
59
+ }
60
+ async function readArtifactText(blobStorage, file, maxBytes) {
61
+ if (file.file.sizeBytes > maxBytes) {
62
+ throw invalidArtifact(`'${file.path}' is ${file.file.sizeBytes} bytes; it may be at most ${maxBytes}.`);
63
+ }
64
+ const text = await new Response(await blobStorage.open(file.file.blobId)).text();
65
+ return text.charCodeAt(0) === 65279 ? text.slice(1) : text;
66
+ }
67
+ function isArtifactPath(path) {
68
+ return typeof path === "string" && path.length > 0 && path.length <= ARTIFACT_LIMITS2.maxPathLength && !path.startsWith("/") && !path.includes("\\") && !/[\u0000-\u001f\u007f]/.test(path) && path.split("/").every((segment) => segment.length > 0 && segment !== "." && segment !== "..");
69
+ }
70
+ function invalidArtifact(message) {
71
+ return new ArtifactRequestError2("invalid_artifact", `[Sixb] ${message}`);
72
+ }
73
+
74
+ // src/artifacts/html.ts
75
+ var NAMED_ENTITIES = {
76
+ amp: "&",
77
+ lt: "<",
78
+ gt: ">",
79
+ quot: '"',
80
+ apos: "'",
81
+ nbsp: String.fromCharCode(160)
82
+ };
83
+ function decodeHtmlEntities(value) {
84
+ return value.replace(/&(#x[\da-f]+|#\d+|[a-z]+);/gi, (match, entity) => {
85
+ if (entity[0] !== "#")
86
+ return NAMED_ENTITIES[entity.toLowerCase()] ?? match;
87
+ const codePoint = entity[1]?.toLowerCase() === "x" ? Number.parseInt(entity.slice(2), 16) : Number(entity.slice(1));
88
+ return Number.isInteger(codePoint) && codePoint >= 0 && codePoint <= 1114111 ? String.fromCodePoint(codePoint) : match;
89
+ });
90
+ }
91
+
92
+ // src/artifacts/publish/validate/html.ts
93
+ var HTML_ENTRY2 = "index.html";
94
+ var FRAME_ASSET_PREFIX = "__sixb/";
95
+ function refuseFrameAssetPaths(files, what) {
96
+ const reserved = files.find((file) => file.path.startsWith(FRAME_ASSET_PREFIX));
97
+ if (reserved) {
98
+ throw invalidArtifact(`'${reserved.path}' is under ${FRAME_ASSET_PREFIX}, where Sixb serves ${what}'s kit and runtime: move it.`);
99
+ }
100
+ }
101
+ function readHtmlReferences(rewriter, at, file = HTML_ENTRY2) {
102
+ const references = [];
103
+ let refused;
104
+ rewriter.on("a[href]", {
105
+ element(element) {
106
+ const href = decodeHtmlEntities(element.getAttribute("href") ?? "");
107
+ if (isArtifactAddress2(href)) {
108
+ references.push({ address: href.trim(), as: "link", at: at() });
109
+ }
110
+ }
111
+ }).on("img[src]", {
112
+ element(element) {
113
+ const source = decodeHtmlEntities(element.getAttribute("src") ?? "").trim();
114
+ if (!isArtifactAddress2(source))
115
+ return;
116
+ if (!parseArtifactAddress2(source)?.path) {
117
+ refused ??= `An <img> shows a file from another artifact, and '${source}' names none: show a chart, a range, a section, or a slide with <sixb-embed src="${source}"></sixb-embed>.`;
118
+ return;
119
+ }
120
+ references.push({ address: source, as: "embed", at: at() });
121
+ }
122
+ }).on("sixb-embed", {
123
+ element(element) {
124
+ const source = decodeHtmlEntities(element.getAttribute("src") ?? "").trim();
125
+ if (!isArtifactAddress2(source)) {
126
+ refused ??= `<sixb-embed> shows another artifact: give it src="artifact:\u2026", such as artifact:art_k3m9q2x7tp#chart=revenue.`;
127
+ return;
128
+ }
129
+ references.push({ address: source, as: "embed", at: at() });
130
+ }
131
+ }).on("iframe[src], object[data], embed[src]", {
132
+ element(element) {
133
+ const source = decodeHtmlEntities(element.getAttribute("src") ?? element.getAttribute("data") ?? "").trim();
134
+ if (isArtifactAddress2(source)) {
135
+ refused ??= `${file} frames '${source}': show another artifact with <sixb-embed src="${source}"></sixb-embed>, or a file of one with <img>.`;
136
+ }
137
+ }
138
+ });
139
+ return { references, refusal: () => refused };
140
+ }
141
+
142
+ // src/artifacts/frames/kit.ts
143
+ var FONTS = {
144
+ "--font-sans": '"SF Pro Text", "SF Pro Display", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif',
145
+ "--font-serif": 'ui-serif, Georgia, Cambria, "Times New Roman", Times, serif',
146
+ "--font-mono": '"SF Mono", "Geist Mono", "JetBrains Mono", ui-monospace, monospace'
147
+ };
148
+ var FRAME_DEFAULT_THEMES2 = {
149
+ light: {
150
+ dark: false,
151
+ tokens: {
152
+ "--background": "#fafafa",
153
+ "--foreground": "#101010",
154
+ "--card": "#ffffff",
155
+ "--card-foreground": "#101010",
156
+ "--muted": "#f4f4f4",
157
+ "--muted-foreground": "#5f5f5f",
158
+ "--primary": "#0a0a0a",
159
+ "--primary-foreground": "#ffffff",
160
+ "--accent": "#f0f0f0",
161
+ "--accent-foreground": "#202020",
162
+ "--border": "#e2e2e2",
163
+ "--chart-1": "#101010",
164
+ "--chart-2": "#404040",
165
+ "--chart-3": "#737373",
166
+ "--chart-4": "#a3a3a3",
167
+ "--chart-5": "#d4d4d4",
168
+ ...FONTS,
169
+ "--radius": "0.5rem"
170
+ }
171
+ },
172
+ dark: {
173
+ dark: true,
174
+ tokens: {
175
+ "--background": "#0a0a0a",
176
+ "--foreground": "#f4f4f4",
177
+ "--card": "#141414",
178
+ "--card-foreground": "#f4f4f4",
179
+ "--muted": "#1c1c1c",
180
+ "--muted-foreground": "#8a8a8a",
181
+ "--primary": "#f4f4f4",
182
+ "--primary-foreground": "#0a0a0a",
183
+ "--accent": "#1c1c1c",
184
+ "--accent-foreground": "#f4f4f4",
185
+ "--border": "#262626",
186
+ "--chart-1": "#f4f4f4",
187
+ "--chart-2": "#c4c4c4",
188
+ "--chart-3": "#8a8a8a",
189
+ "--chart-4": "#5f5f5f",
190
+ "--chart-5": "#404040",
191
+ ...FONTS,
192
+ "--radius": "0.5rem"
193
+ }
194
+ }
195
+ };
196
+ var LIGHT = FRAME_DEFAULT_THEMES2.light.tokens;
197
+ function kit(rules) {
198
+ return `
199
+ @layer sixb-kit, sixb-theme;
200
+
201
+ @layer sixb-kit {
202
+ :root {
203
+ ${Object.entries(LIGHT).map(([name, value]) => ` ${name}: ${value};`).join(`
204
+ `)}
205
+ }
206
+
207
+ *, *::before, *::after { box-sizing: border-box; }
208
+ html, body { margin: 0; padding: 0; }
209
+ body {
210
+ color: var(--foreground);
211
+ font-family: var(--font-sans);
212
+ -webkit-font-smoothing: antialiased;
213
+ }
214
+
215
+ ${rules}}
216
+ `;
217
+ }
218
+ var FRAME_DECK_CSS = kit(` :root {
219
+ --sixb-scale: 1;
220
+ --sixb-overview-scale: 0.25;
221
+ --sixb-columns: 4;
222
+ --sixb-stage: ${LIGHT["--muted"]};
223
+ --sixb-stage-border: ${LIGHT["--border"]};
224
+ --sixb-stage-foreground: ${LIGHT["--foreground"]};
225
+ }
226
+ body { background: var(--muted); }
227
+
228
+ /*
229
+ * The stage: a slide's size and scale, which slides show, and the stage around them, in the
230
+ * app's colors (--sixb-stage and its kin, which only the app's theme sets). A deck's own CSS, unlayered,
231
+ * wins over everything else in the kit, so these alone are important: an important declaration
232
+ * in a layer wins over every unlayered one, a deck's own important ones included. Otherwise a
233
+ * deck that sets display on its closing slide shows it under every other, and one that sets its
234
+ * body's background repaints the stage.
235
+ */
236
+ html.sixb-deck section.slide { width: 1280px !important; height: 720px !important; flex: none !important; }
237
+
238
+ /* One slide at a time, scaled to fit and centered on the stage. */
239
+ html.sixb-deck:not([data-mode="overview"]),
240
+ html.sixb-deck:not([data-mode="overview"]) body { height: 100% !important; overflow: hidden !important; }
241
+ html.sixb-deck:not([data-mode="overview"]) body {
242
+ margin: 0 !important;
243
+ padding: 0 !important;
244
+ display: grid !important;
245
+ place-items: center !important;
246
+ background: var(--sixb-stage) !important;
247
+ }
248
+ html.sixb-deck:not([data-mode="overview"]) section.slide { zoom: var(--sixb-scale) !important; }
249
+ html.sixb-deck:not([data-mode="overview"]) section.slide:not([data-current]) { display: none !important; }
250
+ html.sixb-deck[data-mode="slide"] section.slide {
251
+ border-radius: calc(10px / var(--sixb-scale)) !important;
252
+ box-shadow: 0 0 0 calc(1px / var(--sixb-scale)) var(--sixb-stage-border) !important;
253
+ }
254
+ /* Filled, the slide is the whole frame, as a thumbnail or an embed shows it; presented, it
255
+ fills the page on black. */
256
+ html.sixb-deck:is([data-mode="fill"], [data-mode="present"]) section.slide {
257
+ border-radius: 0 !important;
258
+ box-shadow: none !important;
259
+ }
260
+ html.sixb-deck[data-mode="present"] body { background: #000 !important; }
261
+
262
+ /* Every slide in a grid. */
263
+ html.sixb-deck[data-mode="overview"],
264
+ html.sixb-deck[data-mode="overview"] body { height: 100% !important; overflow: auto !important; }
265
+ html.sixb-deck[data-mode="overview"] body {
266
+ margin: 0 !important;
267
+ display: grid !important;
268
+ grid-template-columns: repeat(var(--sixb-columns), max-content) !important;
269
+ justify-content: center !important;
270
+ align-content: start !important;
271
+ gap: 16px !important;
272
+ padding: 16px !important;
273
+ background: var(--sixb-stage) !important;
274
+ }
275
+ html.sixb-deck[data-mode="overview"] section.slide {
276
+ zoom: var(--sixb-overview-scale) !important;
277
+ cursor: pointer;
278
+ border-radius: calc(6px / var(--sixb-overview-scale)) !important;
279
+ box-shadow: 0 0 0 calc(1px / var(--sixb-overview-scale)) var(--sixb-stage-border) !important;
280
+ }
281
+ html.sixb-deck[data-mode="overview"] section.slide[data-current] {
282
+ box-shadow: 0 0 0 calc(1px / var(--sixb-overview-scale)) var(--sixb-stage-foreground) !important;
283
+ outline: calc(2px / var(--sixb-overview-scale)) solid var(--sixb-stage-foreground) !important;
284
+ outline-offset: calc(2px / var(--sixb-overview-scale)) !important;
285
+ }
286
+
287
+ /*
288
+ * A slide: 1280\xD7720. Its footer, a rule with the source and the slide's number, sits in the
289
+ * bottom padding, so content never runs into it.
290
+ */
291
+ section.slide {
292
+ position: relative;
293
+ display: flex;
294
+ flex-direction: column;
295
+ gap: 28px;
296
+ width: 1280px;
297
+ height: 720px;
298
+ flex: none;
299
+ padding: 72px 96px 140px;
300
+ overflow: hidden;
301
+ background: var(--background);
302
+ color: var(--foreground);
303
+ font-size: 28px;
304
+ line-height: 1.4;
305
+ }
306
+
307
+ /* Type: nothing on a slide is smaller than 18px. */
308
+ section.slide :is(h1, h2, h3) { margin: 0; text-wrap: balance; }
309
+ section.slide h1 { font-size: 72px; line-height: 1; font-weight: 650; letter-spacing: -0.035em; }
310
+ section.slide h2 { max-width: 1000px; font-size: 46px; line-height: 1.08; font-weight: 600; letter-spacing: -0.025em; }
311
+ section.slide h3 { font-size: 30px; line-height: 1.2; font-weight: 600; letter-spacing: -0.01em; }
312
+ section.slide p { margin: 0; max-width: 34em; }
313
+ section.slide :is(ul, ol) {
314
+ margin: 0;
315
+ padding-left: 30px;
316
+ display: flex;
317
+ flex-direction: column;
318
+ gap: 22px;
319
+ font-size: 30px;
320
+ line-height: 1.35;
321
+ letter-spacing: -0.01em;
322
+ }
323
+ section.slide li { padding-left: 6px; }
324
+ section.slide li::marker { color: var(--muted-foreground); }
325
+ section.slide strong { font-weight: 600; }
326
+ section.slide a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 5px; }
327
+ section.slide small, section.slide .note { font-size: 20px; color: var(--muted-foreground); }
328
+ section.slide img, section.slide svg, section.slide video { max-width: 100%; max-height: 100%; }
329
+ /* A figure's default 40px margins would squeeze a chart and its labels below the type floor. */
330
+ section.slide figure { margin: 0; }
331
+ section.slide code { font-family: var(--font-mono); font-size: 0.85em; }
332
+
333
+ /* Chrome: a label above the heading (two spans sit at either end), and the footer. */
334
+ section.slide .eyebrow {
335
+ display: flex;
336
+ justify-content: space-between;
337
+ gap: 24px;
338
+ margin: 0;
339
+ max-width: none;
340
+ font-size: 20px;
341
+ line-height: 1.3;
342
+ letter-spacing: 0.01em;
343
+ color: var(--muted-foreground);
344
+ }
345
+ section.slide .eyebrow + :is(h1, h2) { margin-top: -12px; }
346
+ section.slide::after {
347
+ content: attr(data-number);
348
+ position: absolute;
349
+ left: 96px;
350
+ right: 96px;
351
+ bottom: 64px;
352
+ padding-top: 22px;
353
+ border-top: 1px solid var(--border);
354
+ text-align: right;
355
+ font-size: 18px;
356
+ line-height: 1.4;
357
+ font-variant-numeric: tabular-nums;
358
+ color: var(--muted-foreground);
359
+ }
360
+ section.slide.no-number::after { content: ""; }
361
+ section.slide.no-number:not(:has(.source))::after { display: none; }
362
+ section.slide .source {
363
+ position: absolute;
364
+ left: 96px;
365
+ right: calc(96px + 3em);
366
+ bottom: 64px;
367
+ z-index: 1;
368
+ max-width: none;
369
+ overflow: hidden;
370
+ white-space: nowrap;
371
+ text-overflow: ellipsis;
372
+ font-size: 18px;
373
+ line-height: 1.4;
374
+ font-variant-numeric: tabular-nums;
375
+ color: var(--muted-foreground);
376
+ }
377
+
378
+ /* Layouts. */
379
+ section.slide.title > .eyebrow { margin-bottom: auto; }
380
+ section.slide.title h1 { margin-top: 0; font-size: 132px; line-height: 0.92; letter-spacing: -0.04em; max-width: 9em; }
381
+ section.slide.title > p:not(.eyebrow, .source) { font-size: 36px; line-height: 1.25; letter-spacing: -0.01em; color: var(--muted-foreground); max-width: 24em; text-wrap: balance; }
382
+
383
+ section.slide.section { justify-content: flex-end; }
384
+ section.slide.section h2 { font-size: 72px; line-height: 1; letter-spacing: -0.035em; max-width: 13em; }
385
+
386
+ section.slide.split {
387
+ display: grid;
388
+ grid-template-columns: 5fr 6fr;
389
+ grid-template-rows: auto 1fr;
390
+ column-gap: 80px;
391
+ row-gap: 28px;
392
+ }
393
+ section.slide.split:has(> .eyebrow) { grid-template-rows: auto auto 1fr; }
394
+ section.slide.split > :is(h1, h2, .eyebrow) { grid-column: 1 / -1; }
395
+ section.slide.split > * { min-width: 0; min-height: 0; }
396
+ section.slide.split > :not(h1, h2, .eyebrow) { align-self: center; }
397
+
398
+ section.slide.stat > .value { margin-top: auto; }
399
+ section.slide.stat .value {
400
+ font-size: 144px;
401
+ line-height: 0.9;
402
+ font-weight: 600;
403
+ letter-spacing: -0.045em;
404
+ font-variant-numeric: tabular-nums;
405
+ color: var(--primary);
406
+ }
407
+ section.slide.stat .label { font-size: 26px; line-height: 1.35; color: var(--muted-foreground); }
408
+ section.slide.stat .stats {
409
+ margin-top: auto;
410
+ display: grid;
411
+ grid-auto-flow: column;
412
+ grid-auto-columns: minmax(0, 1fr);
413
+ gap: 64px;
414
+ padding-bottom: 16px;
415
+ }
416
+ section.slide.stat .stats > * {
417
+ display: flex;
418
+ flex-direction: column;
419
+ gap: 14px;
420
+ padding-top: 28px;
421
+ border-top: 2px solid var(--foreground);
422
+ }
423
+ section.slide.stat .stats:has(> :nth-child(3)) .value { font-size: 96px; }
424
+ section.slide.stat .stats:has(> :nth-child(4)) .value { font-size: 80px; }
425
+
426
+ section.slide.quote { justify-content: center; }
427
+ section.slide.quote blockquote {
428
+ margin: 0;
429
+ font-family: var(--font-serif);
430
+ font-size: 52px;
431
+ line-height: 1.2;
432
+ letter-spacing: -0.01em;
433
+ max-width: 22em;
434
+ text-wrap: balance;
435
+ }
436
+ section.slide.quote cite { font-style: normal; font-size: 24px; color: var(--muted-foreground); }
437
+
438
+ section.slide.image > :is(img, figure) { flex: 1; min-height: 0; margin: 0; object-fit: contain; }
439
+ section.slide.image.bleed { padding: 0; }
440
+ section.slide.image.bleed > img { width: 100%; height: 100%; object-fit: cover; }
441
+ section.slide.image.bleed::after, section.slide.image.bleed .source { display: none; }
442
+
443
+ section.slide.chart > :is(figure, svg, img, .chart) { flex: 1; min-height: 0; margin: 0; }
444
+ section.slide.chart figure { display: flex; flex-direction: column; gap: 20px; }
445
+ section.slide.chart figure > :is(svg, img) { flex: 1; min-height: 0; width: 100%; }
446
+ section.slide figcaption { font-size: 20px; color: var(--muted-foreground); }
447
+
448
+ section.slide.table table { width: 100%; border-collapse: collapse; font-size: 26px; font-variant-numeric: tabular-nums; }
449
+ section.slide.table :is(th, td) { padding: 14px 16px; border-bottom: 1px solid var(--border); text-align: left; }
450
+ section.slide.table :is(th, td):first-child { padding-left: 0; }
451
+ section.slide.table :is(th, td):last-child { padding-right: 0; }
452
+ section.slide.table th { font-size: 20px; font-weight: 500; color: var(--muted-foreground); }
453
+ section.slide.table :is(th, td).num, section.slide.table :is(th, td)[data-numeric] { text-align: right; }
454
+
455
+ /*
456
+ * Another artifact on the slide: the app draws it over this box, sized by the deck's CSS like
457
+ * any block. Until it does, and in a thumbnail, the box shows where it goes.
458
+ */
459
+ sixb-embed {
460
+ display: block;
461
+ position: relative;
462
+ width: 100%;
463
+ min-width: 0;
464
+ aspect-ratio: 16 / 9;
465
+ border-radius: 12px;
466
+ background: color-mix(in oklab, var(--muted) 80%, transparent);
467
+ }
468
+ sixb-embed[title]::after {
469
+ content: attr(title);
470
+ position: absolute;
471
+ inset: auto 24px 20px;
472
+ font-size: 20px;
473
+ color: var(--muted-foreground);
474
+ }
475
+ section.slide.chart > sixb-embed,
476
+ section.slide.chart figure > sixb-embed { flex: 1; min-height: 0; aspect-ratio: auto; }
477
+ /* An image from another artifact its reader cannot see. */
478
+ section.slide img[data-sixb-ref="unavailable"] {
479
+ display: block;
480
+ min-width: 160px;
481
+ min-height: 90px;
482
+ border-radius: 12px;
483
+ background: var(--muted);
484
+ }
485
+
486
+ /* Components. */
487
+ section.slide .legend {
488
+ display: flex;
489
+ flex-direction: row;
490
+ flex-wrap: wrap;
491
+ gap: 8px 24px;
492
+ margin: 0;
493
+ padding: 0;
494
+ list-style: none;
495
+ font-size: 20px;
496
+ line-height: 1.3;
497
+ letter-spacing: 0;
498
+ color: var(--muted-foreground);
499
+ }
500
+ section.slide .legend > * { display: flex; align-items: center; gap: 8px; padding: 0; }
501
+ section.slide .legend > *::before {
502
+ content: "";
503
+ width: 0.8em;
504
+ height: 0.8em;
505
+ border-radius: 2px;
506
+ background: var(--swatch, var(--chart-1));
507
+ }
508
+ section.slide .callout {
509
+ padding: 24px 28px;
510
+ border-radius: var(--radius);
511
+ background: var(--muted);
512
+ font-size: 26px;
513
+ }
514
+ section.slide .tag {
515
+ display: inline-block;
516
+ padding: 4px 12px;
517
+ border-radius: 999px;
518
+ background: var(--muted);
519
+ font-size: 18px;
520
+ font-weight: 600;
521
+ }
522
+ `);
523
+ var FRAME_PAGE_CSS = kit(` html { color-scheme: light; }
524
+ html.dark { color-scheme: dark; }
525
+ body {
526
+ background: var(--background);
527
+ font-size: 15px;
528
+ line-height: 1.6;
529
+ text-rendering: optimizeLegibility;
530
+ }
531
+
532
+ /* A page reads in a centered column with room around it, narrower on a phone. */
533
+ main { display: block; max-width: 1120px; margin: 0 auto; padding: 40px 32px 56px; }
534
+ @media (max-width: 640px) { main { padding: 24px 16px 40px; } }
535
+
536
+ /*
537
+ * Type. Text takes the body's colour, or the colour of whatever the page paints it on: the kit
538
+ * colours only the surfaces it paints itself. A rule on a heading would win over the colour a
539
+ * page gives its body, and a page with its own light background loses its headings in dark mode.
540
+ */
541
+ :is(h1, h2, h3, h4) { margin: 0 0 0.5em; text-wrap: balance; }
542
+ h1 { font-size: 32px; line-height: 1.15; font-weight: 650; letter-spacing: -0.025em; }
543
+ h2 { margin-top: 1.6em; font-size: 21px; line-height: 1.25; font-weight: 620; letter-spacing: -0.015em; }
544
+ h3 { margin-top: 1.4em; font-size: 16px; line-height: 1.35; font-weight: 600; }
545
+ h4 { font-size: 14px; font-weight: 600; }
546
+ :is(h1, h2, h3, h4):first-child { margin-top: 0; }
547
+ @media (max-width: 640px) { h1 { font-size: 26px; } h2 { font-size: 19px; } }
548
+ p { margin: 0 0 1em; text-wrap: pretty; }
549
+ .lede { max-width: 42em; margin-bottom: 1.6em; font-size: 17px; line-height: 1.55; color: var(--muted-foreground); }
550
+ .eyebrow {
551
+ margin: 0 0 8px;
552
+ font-size: 12px;
553
+ font-weight: 600;
554
+ letter-spacing: 0.06em;
555
+ text-transform: uppercase;
556
+ color: var(--muted-foreground);
557
+ }
558
+ small, .muted, .note { color: var(--muted-foreground); }
559
+ small, .note { font-size: 13px; }
560
+ a { color: inherit; text-decoration-color: color-mix(in oklab, currentColor 35%, transparent); text-underline-offset: 3px; }
561
+ a:hover { text-decoration-color: currentColor; }
562
+ strong { font-weight: 600; }
563
+ hr { margin: 32px 0; border: 0; border-top: 1px solid var(--border); }
564
+ :is(ul, ol) { margin: 0 0 1em; padding-left: 1.25em; }
565
+ li + li { margin-top: 0.25em; }
566
+ code { font-family: var(--font-mono); font-size: 0.88em; padding: 0.1em 0.35em; border-radius: 5px; background: var(--muted); }
567
+ pre { margin: 0 0 1em; padding: 14px 16px; overflow-x: auto; border-radius: var(--radius); background: var(--muted); font-size: 13px; line-height: 1.5; }
568
+ pre code { padding: 0; background: none; }
569
+ img, svg, video, canvas { max-width: 100%; }
570
+ img, video { height: auto; }
571
+
572
+ /* Tables: hairline rows, quiet headers, numbers aligned. Wide ones scroll in their box. */
573
+ table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
574
+ :is(th, td) { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
575
+ th { font-size: 12px; font-weight: 600; letter-spacing: 0.02em; color: var(--muted-foreground); white-space: nowrap; }
576
+ :is(th, td):first-child { padding-left: 0; }
577
+ :is(th, td):last-child { padding-right: 0; }
578
+ :is(th, td).num, :is(th, td)[data-numeric] { text-align: right; white-space: nowrap; }
579
+ .table-scroll { overflow-x: auto; }
580
+
581
+ /* Forms and buttons, drawn like the app's. */
582
+ label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 550; }
583
+ :is(input:not([type="checkbox"], [type="radio"], [type="range"], [type="color"]), select, textarea) {
584
+ width: 100%;
585
+ min-height: 36px;
586
+ padding: 7px 10px;
587
+ border: 1px solid var(--border);
588
+ border-radius: calc(var(--radius) - 2px);
589
+ background: var(--card);
590
+ color: var(--foreground);
591
+ font: inherit;
592
+ font-size: 14px;
593
+ line-height: 1.4;
594
+ box-shadow: 0 1px 1px rgb(0 0 0 / 0.03);
595
+ transition: border-color 0.12s, box-shadow 0.12s;
596
+ }
597
+ :is(input, select, textarea):focus-visible {
598
+ outline: none;
599
+ border-color: color-mix(in oklab, var(--foreground) 45%, var(--border));
600
+ box-shadow: 0 0 0 3px color-mix(in oklab, var(--foreground) 12%, transparent);
601
+ }
602
+ input[type="range"], input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); }
603
+ textarea { min-height: 88px; resize: vertical; }
604
+ button, .button {
605
+ display: inline-flex;
606
+ align-items: center;
607
+ justify-content: center;
608
+ gap: 6px;
609
+ min-height: 36px;
610
+ padding: 0 14px;
611
+ border: 1px solid transparent;
612
+ border-radius: calc(var(--radius) - 2px);
613
+ background: var(--primary);
614
+ color: var(--primary-foreground);
615
+ font: inherit;
616
+ font-size: 14px;
617
+ font-weight: 550;
618
+ text-decoration: none;
619
+ cursor: pointer;
620
+ transition: background-color 0.12s, border-color 0.12s, opacity 0.12s;
621
+ }
622
+ :is(button, .button):hover { background: color-mix(in oklab, var(--primary) 88%, var(--background)); }
623
+ :is(button, .button):focus-visible { outline: 2px solid var(--ring, var(--foreground)); outline-offset: 2px; }
624
+ :is(button, .button):disabled { opacity: 0.5; cursor: default; }
625
+ :is(button, .button).secondary { border-color: var(--border); background: var(--card); color: var(--foreground); }
626
+ :is(button, .button).secondary:hover { background: var(--muted); }
627
+ :is(button, .button).ghost { background: transparent; color: inherit; }
628
+ :is(button, .button).ghost:hover { background: var(--muted); }
629
+ fieldset { margin: 0 0 16px; padding: 0; border: 0; }
630
+ .field { margin-bottom: 16px; }
631
+
632
+ /* Components. */
633
+ .card {
634
+ padding: 20px;
635
+ border: 1px solid var(--border);
636
+ border-radius: var(--radius);
637
+ background: var(--card);
638
+ box-shadow: 0 1px 2px rgb(0 0 0 / 0.04);
639
+ }
640
+ .card > :last-child { margin-bottom: 0; }
641
+ /* Cards stack with room between them; in a grid or a row, its gap spaces them. */
642
+ .card { margin-bottom: 16px; }
643
+ :is(.grid, .row) > .card { margin-bottom: 0; }
644
+ .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 16px; margin-bottom: 24px; }
645
+ .row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
646
+ .stat .label { font-size: 13px; color: var(--muted-foreground); }
647
+ .stat .value { margin-top: 4px; font-size: 30px; line-height: 1.1; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
648
+ .stat .delta { margin-top: 6px; font-size: 13px; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
649
+ .tag {
650
+ display: inline-flex;
651
+ align-items: center;
652
+ gap: 6px;
653
+ padding: 2px 9px;
654
+ border-radius: 999px;
655
+ background: var(--muted);
656
+ font-size: 12px;
657
+ font-weight: 600;
658
+ line-height: 1.6;
659
+ white-space: nowrap;
660
+ }
661
+ .callout { margin: 0 0 1em; padding: 14px 16px; border-radius: var(--radius); background: var(--muted); }
662
+ .callout > :last-child { margin-bottom: 0; }
663
+
664
+ /*
665
+ * Another artifact on the page: the app draws it over this box, sized by the page's CSS like any
666
+ * block. Until it does, the box shows where it goes.
667
+ */
668
+ sixb-embed {
669
+ display: block;
670
+ position: relative;
671
+ width: 100%;
672
+ aspect-ratio: 16 / 9;
673
+ margin-bottom: 1em;
674
+ border-radius: var(--radius);
675
+ background: var(--muted);
676
+ }
677
+ sixb-embed[title]::after {
678
+ content: attr(title);
679
+ position: absolute;
680
+ inset: auto 16px 12px;
681
+ font-size: 13px;
682
+ color: var(--muted-foreground);
683
+ }
684
+ img[data-sixb-ref="unavailable"] { display: block; min-width: 120px; min-height: 68px; border-radius: var(--radius); background: var(--muted); }
685
+ `);
686
+
687
+ // src/artifacts/frames/runtime.ts
688
+ function frameRuntime() {
689
+ const PROTOCOL = "sixb-frame/1";
690
+ const WIDTH = 1280;
691
+ const HEIGHT = 720;
692
+ const KEYS = [
693
+ "ArrowLeft",
694
+ "ArrowRight",
695
+ "ArrowUp",
696
+ "ArrowDown",
697
+ "PageUp",
698
+ "PageDown",
699
+ "Home",
700
+ "End",
701
+ " ",
702
+ "Escape"
703
+ ];
704
+ const MAX_KEY_LENGTH = 128;
705
+ const MAX_VALUE_BYTES = 65536;
706
+ const QUERY_NAME = /^[a-z0-9][a-z0-9-]{0,63}$/;
707
+ const MAX_LABEL_LENGTH = 120;
708
+ const AT = "data-sixb-at";
709
+ const KIND = "data-sixb-edit";
710
+ const WORDS = "data-sixb-text";
711
+ const MAX_EDIT_LABEL = 80;
712
+ const COMMENT_CURSOR = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M3 21V11a8 8 0 1 1 8 8H3z' fill='%23111' stroke='white' stroke-width='1.5' stroke-linejoin='round'/%3E%3C/svg%3E") 3 21, crosshair`;
713
+ const EDITING_CSS = [
714
+ "[data-sixb-editing] [data-sixb-hover] { outline: 1px dashed #0a84ff; outline-offset: 2px; }",
715
+ "[data-sixb-editing] [data-sixb-picked] { outline: 2px solid #0a84ff; outline-offset: 2px; }",
716
+ "[data-sixb-editing] [contenteditable] { cursor: text; }",
717
+ `[data-sixb-commenting], [data-sixb-commenting] * { cursor: ${COMMENT_CURSOR} !important; }`,
718
+ "[data-sixb-commenting] [data-sixb-hover] { outline: 2px dashed #0a84ff; outline-offset: 3px; }",
719
+ "[data-sixb-commenting] [data-sixb-picked] { outline: 2px solid #0a84ff; outline-offset: 3px; }"
720
+ ].join(" ");
721
+ const CANVAS_CSS = "html { overscroll-behavior: none; } html, html * { touch-action: none !important; }";
722
+ const root = document.documentElement;
723
+ const script = document.currentScript;
724
+ const deck = script?.getAttribute("data-sixb-layout") !== "page";
725
+ const start = new URLSearchParams(window.location.hash.slice(1));
726
+ if (deck) {
727
+ root.classList.add("sixb-deck");
728
+ root.dataset.mode = start.has("sixb-fill") ? "fill" : "slide";
729
+ }
730
+ let current = Number(start.get("sixb-slide")) || 1;
731
+ const slides = () => Array.from(document.querySelectorAll("section.slide"));
732
+ const post = (message) => window.parent.postMessage({ protocol: PROTOCOL, ...message }, "*");
733
+ const webAddress = (href) => {
734
+ try {
735
+ const url = new URL(href, document.baseURI);
736
+ return url.protocol === "http:" || url.protocol === "https:" ? url.href : null;
737
+ } catch {
738
+ return null;
739
+ }
740
+ };
741
+ const fit = () => {
742
+ const columns = window.innerWidth < 720 ? 2 : window.innerWidth < 1100 ? 3 : 4;
743
+ const gap = 16;
744
+ const margin = root.dataset.mode === "fill" || root.dataset.mode === "present" ? 0 : Math.min(32, window.innerWidth * 0.04);
745
+ root.style.setProperty("--sixb-scale", String(Math.min((window.innerWidth - margin * 2) / WIDTH, (window.innerHeight - margin * 2) / HEIGHT)));
746
+ root.style.setProperty("--sixb-columns", String(columns));
747
+ root.style.setProperty("--sixb-overview-scale", String((window.innerWidth - gap * (columns + 1)) / columns / WIDTH));
748
+ };
749
+ let reported = "";
750
+ let reporting = false;
751
+ const ids = new WeakMap;
752
+ let lastId = 0;
753
+ const idOf = (element) => {
754
+ const known = ids.get(element);
755
+ if (known !== undefined)
756
+ return known;
757
+ lastId += 1;
758
+ ids.set(element, lastId);
759
+ return lastId;
760
+ };
761
+ const reportEmbeds = () => {
762
+ if (reporting || root.dataset.mode === "fill")
763
+ return;
764
+ reporting = true;
765
+ requestAnimationFrame(() => {
766
+ reporting = false;
767
+ const scale = deck ? Number(root.style.getPropertyValue("--sixb-scale")) || 1 : 1;
768
+ const scope = deck ? root.dataset.mode === "overview" ? undefined : slides()[current - 1] : document;
769
+ const near = (rect) => deck || rect.bottom > -window.innerHeight && rect.top < window.innerHeight * 2;
770
+ const embeds = Array.from(scope?.querySelectorAll("sixb-embed[src]") ?? []).flatMap((element) => {
771
+ const id = idOf(element);
772
+ const rect = element.getBoundingClientRect();
773
+ return near(rect) ? [
774
+ {
775
+ id,
776
+ address: (element.getAttribute("src") ?? "").trim(),
777
+ rect: { x: rect.left, y: rect.top, width: rect.width, height: rect.height },
778
+ scale
779
+ }
780
+ ] : [];
781
+ });
782
+ const next = JSON.stringify(embeds);
783
+ if (next === reported)
784
+ return;
785
+ reported = next;
786
+ post({ event: "embeds", params: { embeds } });
787
+ });
788
+ };
789
+ let height = -1;
790
+ const reportSize = () => {
791
+ const body = document.body;
792
+ if (deck || !body)
793
+ return;
794
+ const style = getComputedStyle(body);
795
+ const next = Math.ceil(Math.max(body.scrollHeight, body.getBoundingClientRect().height) + (Number.parseFloat(style.marginTop) || 0) + (Number.parseFloat(style.marginBottom) || 0));
796
+ if (next === height)
797
+ return;
798
+ height = next;
799
+ post({ event: "size", params: { height } });
800
+ };
801
+ const show = (slide) => {
802
+ const all = slides();
803
+ current = Math.min(Math.max(1, Math.round(slide) || 1), Math.max(1, all.length));
804
+ all.forEach((element, index) => {
805
+ element.toggleAttribute("data-current", index + 1 === current);
806
+ });
807
+ if (root.dataset.mode === "overview") {
808
+ all[current - 1]?.scrollIntoView({ block: "nearest" });
809
+ }
810
+ reportEmbeds();
811
+ };
812
+ const portPost = typeof MessagePort === "function" ? MessagePort.prototype.postMessage : undefined;
813
+ const apply = Reflect.apply;
814
+ let appPort = null;
815
+ const postPort = (message) => {
816
+ if (appPort && portPost)
817
+ apply(portPost, appPort, [{ protocol: PROTOCOL, ...message }]);
818
+ };
819
+ let editing = false;
820
+ let typable = true;
821
+ let pointed = null;
822
+ let picked = null;
823
+ let typing = null;
824
+ let held = null;
825
+ let typedFrom = "";
826
+ const wordsHash = (text) => {
827
+ let hash = 2166136261;
828
+ for (let index = 0;index < text.length; index += 1) {
829
+ hash ^= text.charCodeAt(index);
830
+ hash = Math.imul(hash, 16777619) >>> 0;
831
+ }
832
+ return hash.toString(16);
833
+ };
834
+ const spokenWords = (element) => {
835
+ const copy = element.cloneNode(true);
836
+ if (!(copy instanceof Element))
837
+ return element.textContent ?? "";
838
+ for (const lineBreak of Array.from(copy.querySelectorAll("br")))
839
+ lineBreak.replaceWith(" ");
840
+ for (const code of Array.from(copy.querySelectorAll("script, style, template")))
841
+ code.remove();
842
+ return copy.textContent ?? "";
843
+ };
844
+ const commentable = (element, node) => element ?? (!typable && node instanceof Element && node !== root && node !== document.body ? node : null);
845
+ const editTarget = (node) => {
846
+ const start = node instanceof Element ? node : null;
847
+ const element = start?.closest(`[${AT}]`) ?? null;
848
+ const box = (start ?? element)?.getBoundingClientRect();
849
+ const rect = {
850
+ x: box?.left ?? 0,
851
+ y: box?.top ?? 0,
852
+ width: box?.width ?? 0,
853
+ height: box?.height ?? 0
854
+ };
855
+ const kind = element?.getAttribute(KIND) ?? "";
856
+ const shown = start && start !== root && start !== document.body ? spokenWords(start).replace(/\s+/g, " ").trim() : "";
857
+ const scripted = {
858
+ address: null,
859
+ kind: "scripted",
860
+ within: element?.getAttribute(AT) ?? null,
861
+ ...shown ? { label: shown.slice(0, MAX_EDIT_LABEL) } : {},
862
+ rect
863
+ };
864
+ if (!element)
865
+ return { element: null, target: scripted };
866
+ if (element !== start && kind !== "text" && kind !== "whole") {
867
+ return { element: null, target: scripted };
868
+ }
869
+ const words = element.textContent ?? "";
870
+ if (kind === "text" && wordsHash(words) !== element.getAttribute(WORDS)) {
871
+ return { element: null, target: { ...scripted, within: element.getAttribute(AT) } };
872
+ }
873
+ const own = element.getBoundingClientRect();
874
+ const label = (kind === "image" ? element.getAttribute("alt") ?? "" : spokenWords(element)).replace(/\s+/g, " ").trim().slice(0, MAX_EDIT_LABEL);
875
+ return {
876
+ element,
877
+ target: {
878
+ address: element.getAttribute(AT),
879
+ kind,
880
+ label,
881
+ rect: { x: own.left, y: own.top, width: own.width, height: own.height }
882
+ }
883
+ };
884
+ };
885
+ const mark = (attribute, previous, next) => {
886
+ previous?.removeAttribute(attribute);
887
+ next?.setAttribute(attribute, "");
888
+ return next;
889
+ };
890
+ const stopTyping = () => {
891
+ const element = typing;
892
+ if (!element)
893
+ return;
894
+ typing = null;
895
+ element.removeAttribute("contenteditable");
896
+ const patch = held;
897
+ held = null;
898
+ if (patch)
899
+ applyPatch(element, patch);
900
+ };
901
+ const applyPatch = (element, patch) => {
902
+ const attributes = patch.attributes;
903
+ if (attributes && typeof attributes === "object") {
904
+ const next = attributes;
905
+ for (const name of element.getAttributeNames()) {
906
+ if (!(name in next) && !name.startsWith("data-sixb-"))
907
+ element.removeAttribute(name);
908
+ }
909
+ for (const [name, value] of Object.entries(next)) {
910
+ if (typeof value === "string" && /^[a-z_:][a-z0-9_.:-]*$/i.test(name)) {
911
+ element.setAttribute(name, value);
912
+ }
913
+ }
914
+ }
915
+ if (typeof patch.html === "string")
916
+ element.innerHTML = patch.html;
917
+ };
918
+ const startEditing = (on, typingAllowed) => {
919
+ editing = on;
920
+ typable = typingAllowed;
921
+ if (!typable)
922
+ stopTyping();
923
+ root.toggleAttribute("data-sixb-editing", on);
924
+ root.toggleAttribute("data-sixb-commenting", on && !typable);
925
+ if (on && !document.getElementById("sixb-editing")) {
926
+ const style = document.createElement("style");
927
+ style.id = "sixb-editing";
928
+ style.textContent = EDITING_CSS;
929
+ document.head.append(style);
930
+ }
931
+ if (!on) {
932
+ stopTyping();
933
+ pointed = mark("data-sixb-hover", pointed, null);
934
+ picked = mark("data-sixb-picked", picked, null);
935
+ }
936
+ };
937
+ window.addEventListener("click", (event) => {
938
+ if (!editing || !event.isTrusted)
939
+ return;
940
+ if (typing?.contains(event.target))
941
+ return;
942
+ event.preventDefault();
943
+ event.stopPropagation();
944
+ stopTyping();
945
+ const { element, target } = editTarget(event.target);
946
+ picked = mark("data-sixb-picked", picked, commentable(element, event.target));
947
+ const at = { x: event.clientX, y: event.clientY };
948
+ postPort({ event: "edit.select", params: { target, at } });
949
+ if (typable && element instanceof HTMLElement && target.kind === "text") {
950
+ typing = element;
951
+ typedFrom = element.textContent ?? "";
952
+ element.setAttribute("contenteditable", "plaintext-only");
953
+ element.focus();
954
+ }
955
+ }, true);
956
+ document.addEventListener("mouseover", (event) => {
957
+ if (!editing || !event.isTrusted)
958
+ return;
959
+ const { element, target } = editTarget(event.target);
960
+ const shown = commentable(element, event.target);
961
+ if (shown === pointed && shown !== null)
962
+ return;
963
+ pointed = mark("data-sixb-hover", pointed, shown);
964
+ postPort({ event: "edit.hover", params: { target } });
965
+ });
966
+ document.addEventListener("mouseout", (event) => {
967
+ if (!editing || !event.isTrusted || event.relatedTarget !== null || pointed === null)
968
+ return;
969
+ pointed = mark("data-sixb-hover", pointed, null);
970
+ postPort({ event: "edit.hover", params: { target: null } });
971
+ });
972
+ document.addEventListener("input", (event) => {
973
+ if (!editing || !event.isTrusted || !typing || !typing.contains(event.target)) {
974
+ return;
975
+ }
976
+ const text = typing.textContent ?? "";
977
+ typing.setAttribute(WORDS, wordsHash(text));
978
+ postPort({
979
+ event: "edit.text",
980
+ params: { address: typing.getAttribute(AT), base: typedFrom, text }
981
+ });
982
+ typedFrom = text;
983
+ });
984
+ window.addEventListener("keydown", (event) => {
985
+ if (!typing || !event.isTrusted)
986
+ return;
987
+ if (event.key === "Enter")
988
+ event.preventDefault();
989
+ if (event.key === "Escape")
990
+ typing.blur();
991
+ event.stopPropagation();
992
+ }, true);
993
+ document.addEventListener("focusout", (event) => {
994
+ if (typing && event.target === typing)
995
+ stopTyping();
996
+ });
997
+ const mac = /Mac|iPhone|iPad/.test(window.navigator?.platform ?? "");
998
+ const zoom = (params) => postPort({ event: "zoom", params });
999
+ const pan = (x, y, by) => postPort({ event: "pan", params: { x, y, by } });
1000
+ const forwards = (event) => appPort !== null && event.isTrusted;
1001
+ let onCanvas = false;
1002
+ let canvasMoving = false;
1003
+ const WHEEL_GESTURE_MS = 150;
1004
+ const MIN_OVERFLOW = 16;
1005
+ let wheeledAt = Number.NEGATIVE_INFINITY;
1006
+ let wheelScrolls = false;
1007
+ const scrollsUnder = (target, x, y) => {
1008
+ const vertical = Math.abs(y) >= Math.abs(x);
1009
+ const delta = vertical ? y : x;
1010
+ if (delta === 0)
1011
+ return false;
1012
+ const overflowOf = (element) => getComputedStyle(element)[vertical ? "overflowY" : "overflowX"];
1013
+ const scrolls = (size, shown, at) => size - shown >= MIN_OVERFLOW && (delta > 0 ? at + shown < size - 1 : at > 0);
1014
+ for (let element = target instanceof Element ? target : null;element && element !== root && element !== document.body; element = element.parentElement) {
1015
+ if (!/auto|scroll/.test(overflowOf(element)))
1016
+ continue;
1017
+ const scrolled = vertical ? scrolls(element.scrollHeight, element.clientHeight, element.scrollTop) : scrolls(element.scrollWidth, element.clientWidth, element.scrollLeft);
1018
+ if (scrolled)
1019
+ return true;
1020
+ }
1021
+ const page = document.scrollingElement;
1022
+ if (!page || [root, document.body].some((each) => each && /hidden|clip/.test(overflowOf(each)))) {
1023
+ return false;
1024
+ }
1025
+ return vertical ? scrolls(page.scrollHeight, window.innerHeight, window.scrollY) : scrolls(page.scrollWidth, window.innerWidth, window.scrollX);
1026
+ };
1027
+ window.addEventListener("wheel", (event) => {
1028
+ if (!forwards(event))
1029
+ return;
1030
+ if (event.ctrlKey || event.metaKey) {
1031
+ event.preventDefault();
1032
+ const unit = event.deltaMode === 1 ? 0.05 : event.deltaMode ? 1 : 0.002;
1033
+ const factor = 2 ** (-event.deltaY * unit * (event.ctrlKey && mac ? 10 : 1));
1034
+ zoom({ factor, at: { x: event.clientX, y: event.clientY } });
1035
+ return;
1036
+ }
1037
+ if (!onCanvas)
1038
+ return;
1039
+ const unit = event.deltaMode === 1 ? 20 : event.deltaMode === 2 ? window.innerHeight : 1;
1040
+ const x = (!mac && event.shiftKey ? event.deltaY : event.deltaX) * unit;
1041
+ const y = !mac && event.shiftKey ? 0 : event.deltaY * unit;
1042
+ if (event.timeStamp - wheeledAt > WHEEL_GESTURE_MS) {
1043
+ wheelScrolls = !canvasMoving && scrollsUnder(event.target, x, y);
1044
+ }
1045
+ wheeledAt = event.timeStamp;
1046
+ if (wheelScrolls)
1047
+ return;
1048
+ event.preventDefault();
1049
+ pan(x, y, "wheel");
1050
+ }, { passive: false });
1051
+ const TOUCH_SLOP = 6;
1052
+ let spread = 0;
1053
+ let touched = null;
1054
+ const spreadOf = (touches) => {
1055
+ const [one, two] = [touches[0], touches[1]];
1056
+ return one && two ? Math.hypot(one.screenX - two.screenX, one.screenY - two.screenY) : 0;
1057
+ };
1058
+ const middleOf = (touches) => {
1059
+ const fingers = [touches[0], touches[1]].filter((touch) => touch !== undefined);
1060
+ const sum = (axis) => fingers.reduce((total, touch) => total + touch[axis], 0) / Math.max(1, fingers.length);
1061
+ return { x: sum("screenX"), y: sum("screenY") };
1062
+ };
1063
+ window.addEventListener("touchstart", (event) => {
1064
+ const ours = forwards(event);
1065
+ spread = ours && event.touches.length === 2 ? spreadOf(event.touches) : 0;
1066
+ touched = ours && onCanvas ? { ...middleOf(event.touches), dragging: event.touches.length > 1 } : null;
1067
+ }, { passive: true });
1068
+ window.addEventListener("touchmove", (event) => {
1069
+ if (!forwards(event))
1070
+ return;
1071
+ if (touched && event.touches.length <= 2) {
1072
+ const middle = middleOf(event.touches);
1073
+ const x = touched.x - middle.x;
1074
+ const y = touched.y - middle.y;
1075
+ if (!touched.dragging && Math.hypot(x, y) < TOUCH_SLOP)
1076
+ return;
1077
+ event.preventDefault();
1078
+ touched = { ...middle, dragging: true };
1079
+ if (x !== 0 || y !== 0)
1080
+ pan(x, y, "touch");
1081
+ }
1082
+ if (event.touches.length !== 2 || spread === 0)
1083
+ return;
1084
+ event.preventDefault();
1085
+ const [one, two] = [event.touches[0], event.touches[1]];
1086
+ const next = spreadOf(event.touches);
1087
+ if (!one || !two || next === 0)
1088
+ return;
1089
+ zoom({
1090
+ factor: next / spread,
1091
+ at: { x: (one.clientX + two.clientX) / 2, y: (one.clientY + two.clientY) / 2 }
1092
+ });
1093
+ spread = next;
1094
+ }, { passive: false });
1095
+ const untouch = (event) => {
1096
+ if (event.touches.length < 2)
1097
+ spread = 0;
1098
+ if (touched)
1099
+ touched = event.touches.length > 0 ? { ...middleOf(event.touches), dragging: true } : null;
1100
+ };
1101
+ window.addEventListener("touchend", untouch);
1102
+ window.addEventListener("touchcancel", untouch);
1103
+ let gestured = 1;
1104
+ const onGesture = (event) => {
1105
+ if (!forwards(event))
1106
+ return;
1107
+ event.preventDefault();
1108
+ const gesture = event;
1109
+ const scale = gesture.scale ?? 1;
1110
+ if (event.type === "gesturestart" || spread > 0 || scale <= 0) {
1111
+ gestured = scale > 0 ? scale : 1;
1112
+ return;
1113
+ }
1114
+ zoom({ factor: scale / gestured, at: { x: gesture.clientX ?? 0, y: gesture.clientY ?? 0 } });
1115
+ gestured = scale;
1116
+ };
1117
+ window.addEventListener("gesturestart", onGesture, { passive: false });
1118
+ window.addEventListener("gesturechange", onGesture, { passive: false });
1119
+ window.addEventListener("keydown", (event) => {
1120
+ if (!forwards(event) || !(event.metaKey || event.ctrlKey) || event.altKey)
1121
+ return;
1122
+ const step = event.key === "=" || event.key === "+" ? "in" : event.key === "-" ? "out" : event.key === "0" ? "actual" : null;
1123
+ if (!step)
1124
+ return;
1125
+ event.preventDefault();
1126
+ zoom({ step });
1127
+ }, true);
1128
+ const SPACE_TAKERS = [
1129
+ "input:not([type=button], [type=submit], [type=reset], [type=image])",
1130
+ "textarea",
1131
+ "select",
1132
+ ...[
1133
+ "checkbox",
1134
+ "radio",
1135
+ "switch",
1136
+ "option",
1137
+ "menuitemcheckbox",
1138
+ "menuitemradio",
1139
+ "textbox",
1140
+ "searchbox",
1141
+ "combobox",
1142
+ "slider",
1143
+ "spinbutton"
1144
+ ].map((role) => `[role=${role}]`)
1145
+ ].join(", ");
1146
+ let spaceHeld = false;
1147
+ const holdSpace = (down) => {
1148
+ if (spaceHeld === down)
1149
+ return;
1150
+ spaceHeld = down;
1151
+ postPort({ event: "space", params: { down } });
1152
+ };
1153
+ const onSpace = (event) => {
1154
+ if (!onCanvas || !forwards(event) || event.key !== " ")
1155
+ return;
1156
+ if (event.metaKey || event.ctrlKey || event.altKey)
1157
+ return;
1158
+ const down = event.type === "keydown";
1159
+ const focused = document.activeElement;
1160
+ if (down && focused instanceof HTMLElement) {
1161
+ if (focused.isContentEditable || focused.matches(SPACE_TAKERS))
1162
+ return;
1163
+ }
1164
+ if (!down && !spaceHeld)
1165
+ return;
1166
+ event.preventDefault();
1167
+ event.stopPropagation();
1168
+ holdSpace(down);
1169
+ };
1170
+ window.addEventListener("keydown", onSpace, true);
1171
+ window.addEventListener("keyup", onSpace, true);
1172
+ window.addEventListener("blur", () => holdSpace(false));
1173
+ const handle = (method, params) => {
1174
+ switch (method) {
1175
+ case "theme": {
1176
+ const tokens = params.tokens ?? {};
1177
+ const declarations = Object.entries(tokens).filter(([name, value]) => /^--[a-z0-9-]+$/.test(name) && typeof value === "string" && !/[;{}<]/.test(value)).map(([name, value]) => `${name}: ${value};`);
1178
+ for (const [stage, token] of [
1179
+ ["--sixb-stage", "--muted"],
1180
+ ["--sixb-stage-border", "--border"],
1181
+ ["--sixb-stage-foreground", "--foreground"]
1182
+ ]) {
1183
+ const value = declarations.find((declaration) => declaration.startsWith(`${token}:`));
1184
+ if (value)
1185
+ declarations.push(`${stage}${value.slice(token.length)}`);
1186
+ }
1187
+ let style = document.getElementById("sixb-theme");
1188
+ if (!style) {
1189
+ style = document.createElement("style");
1190
+ style.id = "sixb-theme";
1191
+ document.head.append(style);
1192
+ }
1193
+ style.textContent = `@layer sixb-theme { :root { ${declarations.join(" ")} color-scheme: ${params.dark === true ? "dark" : "light"}; } }`;
1194
+ root.classList.toggle("dark", params.dark === true);
1195
+ window.dispatchEvent(new CustomEvent("sixb:theme", { detail: { dark: params.dark === true } }));
1196
+ return;
1197
+ }
1198
+ case "goto":
1199
+ if (!deck)
1200
+ throw new Error("Only a deck has slides.");
1201
+ show(Number(params.slide));
1202
+ return;
1203
+ case "reload":
1204
+ setTimeout(() => window.location.reload());
1205
+ return;
1206
+ case "query.changed": {
1207
+ const name = String(params.name);
1208
+ if (!QUERY_NAME.test(name))
1209
+ throw new Error(`Unknown query '${name}'.`);
1210
+ window.dispatchEvent(new CustomEvent("sixb:query", { detail: { name } }));
1211
+ return;
1212
+ }
1213
+ case "edit":
1214
+ startEditing(params.on === true, params.typing !== false);
1215
+ return;
1216
+ case "canvas":
1217
+ onCanvas = true;
1218
+ canvasMoving = params.moving === true;
1219
+ if (!document.getElementById("sixb-canvas")) {
1220
+ const style = document.createElement("style");
1221
+ style.id = "sixb-canvas";
1222
+ style.textContent = CANVAS_CSS;
1223
+ document.head.append(style);
1224
+ }
1225
+ return;
1226
+ case "edit.patch": {
1227
+ const patches = Array.isArray(params.patches) ? params.patches : [];
1228
+ for (const patch of patches) {
1229
+ const address = typeof patch?.address === "string" ? patch.address : null;
1230
+ const element = address ? document.querySelector(`[${AT}="${CSS.escape(address)}"]`) : null;
1231
+ if (!element)
1232
+ continue;
1233
+ if (element === typing)
1234
+ held = { ...held ?? {}, ...patch };
1235
+ else
1236
+ applyPatch(element, patch);
1237
+ }
1238
+ return;
1239
+ }
1240
+ case "scroll":
1241
+ if (deck)
1242
+ throw new Error("Only a page scrolls.");
1243
+ window.scrollBy({ left: Number(params.x) || 0, top: Number(params.y) || 0 });
1244
+ return;
1245
+ case "mode":
1246
+ if (!deck)
1247
+ throw new Error("Only a deck has modes.");
1248
+ if (root.dataset.mode === "fill")
1249
+ return;
1250
+ root.dataset.mode = params.mode === "overview" || params.mode === "present" ? params.mode : "slide";
1251
+ fit();
1252
+ show(current);
1253
+ return;
1254
+ default:
1255
+ throw new Error(`Unknown method '${method}'.`);
1256
+ }
1257
+ };
1258
+ const calls = new Map;
1259
+ let called = 0;
1260
+ const alone = window.parent === window;
1261
+ const memory = new Map;
1262
+ const call = (method, params) => {
1263
+ if (alone) {
1264
+ const key = String(params.key);
1265
+ const kept = memory.get(key);
1266
+ switch (method) {
1267
+ case "state.get":
1268
+ return Promise.resolve(kept === undefined ? undefined : JSON.parse(kept));
1269
+ case "state.set":
1270
+ memory.set(key, JSON.stringify(params.value));
1271
+ return Promise.resolve(undefined);
1272
+ case "state.delete":
1273
+ return Promise.resolve(memory.delete(key));
1274
+ default:
1275
+ return Promise.resolve([...memory.keys()].sort());
1276
+ }
1277
+ }
1278
+ called += 1;
1279
+ const id = called;
1280
+ return new Promise((resolve, reject) => {
1281
+ calls.set(id, { resolve, reject });
1282
+ post({ call: id, method, params });
1283
+ });
1284
+ };
1285
+ const checkKey = (key) => {
1286
+ if (typeof key !== "string" || key.length === 0 || key.length > MAX_KEY_LENGTH || key === "." || key === "..") {
1287
+ throw new TypeError(`sixb.state: a key is text of 1 to ${MAX_KEY_LENGTH} characters.`);
1288
+ }
1289
+ return key;
1290
+ };
1291
+ const state = {
1292
+ get: (key) => Promise.resolve().then(() => call("state.get", { key: checkKey(key) })),
1293
+ set: (key, value) => Promise.resolve().then(() => {
1294
+ const json = JSON.stringify(value);
1295
+ if (json === undefined) {
1296
+ throw new TypeError("sixb.state: a value is JSON: text, a number, true or false, null, a list, or an object.");
1297
+ }
1298
+ if (new TextEncoder().encode(json).byteLength > MAX_VALUE_BYTES) {
1299
+ throw new RangeError(`sixb.state: a value is at most ${MAX_VALUE_BYTES / 1024} KB as JSON.`);
1300
+ }
1301
+ return call("state.set", { key: checkKey(key), value: JSON.parse(json) }).then(() => {});
1302
+ }),
1303
+ delete: (key) => Promise.resolve().then(() => call("state.delete", { key: checkKey(key) })),
1304
+ keys: () => call("state.keys", {})
1305
+ };
1306
+ const readQueryFile = async (name) => {
1307
+ const base = script?.src || new URL("__sixb/runtime.js", window.location.href).href;
1308
+ const response = await fetch(new URL(`queries/${name}.json`, base));
1309
+ if (response.ok)
1310
+ return response.json();
1311
+ if (response.status === 404) {
1312
+ throw new Error(`[Sixb] No query '${name}' in this page's version.`);
1313
+ }
1314
+ const body = await response.json().catch(() => null);
1315
+ throw new Error(typeof body?.error === "string" ? body.error : `[Sixb] Query '${name}' could not be read.`);
1316
+ };
1317
+ const query = (name) => Promise.resolve().then(() => {
1318
+ if (typeof name !== "string" || !QUERY_NAME.test(name)) {
1319
+ throw new TypeError("sixb.query: a query's name is that of its file, queries/<name>.json: lowercase letters, digits and hyphens.");
1320
+ }
1321
+ return alone ? readQueryFile(name) : call("query.run", { name });
1322
+ });
1323
+ Object.defineProperty(window, "sixb", {
1324
+ value: Object.freeze({ state: Object.freeze(state), query }),
1325
+ enumerable: true
1326
+ });
1327
+ window.addEventListener("message", (event) => {
1328
+ if (event.source !== window.parent)
1329
+ return;
1330
+ const data = event.data;
1331
+ if (data && data.protocol === PROTOCOL && typeof data.result === "number") {
1332
+ const pending = calls.get(data.result);
1333
+ calls.delete(data.result);
1334
+ if (typeof data.error === "string")
1335
+ pending?.reject(new Error(data.error));
1336
+ else
1337
+ pending?.resolve(data.value);
1338
+ return;
1339
+ }
1340
+ if (!data || data.protocol !== PROTOCOL || typeof data.id !== "number")
1341
+ return;
1342
+ if (typeof data.method !== "string")
1343
+ return;
1344
+ event.stopImmediatePropagation();
1345
+ const port = event.ports?.[0];
1346
+ if ((data.method === "edit" || data.method === "canvas") && port)
1347
+ appPort = port;
1348
+ try {
1349
+ handle(String(data.method), data.params ?? {});
1350
+ post({ id: data.id });
1351
+ } catch (error) {
1352
+ post({ id: data.id, error: error instanceof Error ? error.message : String(error) });
1353
+ }
1354
+ }, true);
1355
+ window.addEventListener("keydown", (event) => {
1356
+ if (!deck || event.metaKey || event.ctrlKey || event.altKey)
1357
+ return;
1358
+ const target = event.target;
1359
+ if (target?.closest("input, textarea, select, [contenteditable]"))
1360
+ return;
1361
+ if (!KEYS.includes(event.key))
1362
+ return;
1363
+ event.preventDefault();
1364
+ post({ event: "key", params: { key: event.key } });
1365
+ });
1366
+ document.addEventListener("click", (event) => {
1367
+ const target = event.target;
1368
+ const pressed = target?.closest('button, [role="button"], a[href^="#"]');
1369
+ const words = (pressed?.innerText ?? pressed?.textContent ?? "").replace(/\s+/g, " ").trim();
1370
+ if (words && words.length <= MAX_LABEL_LENGTH) {
1371
+ post({ event: "press", params: { text: words } });
1372
+ if (onCanvas && event.isTrusted)
1373
+ postPort({ event: "press", params: { text: words } });
1374
+ }
1375
+ const link = target?.closest("a[href]");
1376
+ if (link) {
1377
+ const href = link.getAttribute("href") ?? "";
1378
+ if (href.startsWith("#") || event.defaultPrevented)
1379
+ return;
1380
+ event.preventDefault();
1381
+ if (/^artifact:/i.test(href.trim())) {
1382
+ post({ event: "open", params: { address: href.trim() } });
1383
+ return;
1384
+ }
1385
+ const url = webAddress(href);
1386
+ if (url)
1387
+ post({ event: "link", params: { url } });
1388
+ return;
1389
+ }
1390
+ if (!deck || root.dataset.mode !== "overview")
1391
+ return;
1392
+ const slide = target?.closest("section.slide");
1393
+ if (!slide)
1394
+ return;
1395
+ post({ event: "select", params: { slide: slides().indexOf(slide) + 1 } });
1396
+ });
1397
+ window.addEventListener("resize", () => {
1398
+ if (deck)
1399
+ fit();
1400
+ reportEmbeds();
1401
+ });
1402
+ const ready = () => {
1403
+ if (!deck) {
1404
+ post({ event: "ready", params: {} });
1405
+ window.addEventListener("scroll", reportEmbeds, { passive: true });
1406
+ const resized = new ResizeObserver(() => {
1407
+ reportSize();
1408
+ reportEmbeds();
1409
+ });
1410
+ resized.observe(document.documentElement);
1411
+ if (document.body)
1412
+ resized.observe(document.body);
1413
+ window.addEventListener("load", () => {
1414
+ reportSize();
1415
+ reportEmbeds();
1416
+ });
1417
+ reportSize();
1418
+ reportEmbeds();
1419
+ return;
1420
+ }
1421
+ slides().forEach((element, index) => {
1422
+ element.dataset.number = String(index + 1);
1423
+ });
1424
+ fit();
1425
+ show(current);
1426
+ post({ event: "ready", params: { slides: slides().length } });
1427
+ const resized = new ResizeObserver(reportEmbeds);
1428
+ for (const element of Array.from(document.querySelectorAll("section.slide > *, sixb-embed"))) {
1429
+ resized.observe(element);
1430
+ }
1431
+ window.addEventListener("load", reportEmbeds);
1432
+ document.fonts?.ready.then(reportEmbeds);
1433
+ };
1434
+ if (document.readyState === "loading")
1435
+ document.addEventListener("DOMContentLoaded", ready);
1436
+ else
1437
+ ready();
1438
+ }
1439
+
1440
+ // src/artifacts/frames/assets.ts
1441
+ var FRAME_CDN_ALLOWLIST2 = [
1442
+ "https://cdn.jsdelivr.net",
1443
+ "https://cdnjs.cloudflare.com",
1444
+ "https://unpkg.com",
1445
+ "https://fonts.googleapis.com",
1446
+ "https://fonts.gstatic.com"
1447
+ ];
1448
+ var FRAME_ASSETS2 = {
1449
+ [`${FRAME_ASSET_PREFIX}deck.css`]: { body: FRAME_DECK_CSS, type: "text/css; charset=utf-8" },
1450
+ [`${FRAME_ASSET_PREFIX}page.css`]: { body: FRAME_PAGE_CSS, type: "text/css; charset=utf-8" },
1451
+ [`${FRAME_ASSET_PREFIX}runtime.js`]: {
1452
+ body: `(${frameRuntime.toString()})()
1453
+ `,
1454
+ type: "text/javascript; charset=utf-8"
1455
+ }
1456
+ };
1457
+ function injected(layout, base) {
1458
+ return `<link rel="stylesheet" href="${base}${FRAME_ASSET_PREFIX}${layout}.css"><script src="${base}${FRAME_ASSET_PREFIX}runtime.js" data-sixb-layout="${layout}"></script>`;
1459
+ }
1460
+ function rootOf(entry) {
1461
+ return "../".repeat(entry.split("/").length - 1);
1462
+ }
1463
+ function injectFrameAssets2(html, layout, entry = "index.html") {
1464
+ const assets = injected(layout, rootOf(entry));
1465
+ for (const selector of ["head", "html"]) {
1466
+ let injected = false;
1467
+ const rewritten = new HTMLRewriter().on(selector, {
1468
+ element(element) {
1469
+ if (injected)
1470
+ return;
1471
+ injected = true;
1472
+ element.prepend(assets, { html: true });
1473
+ }
1474
+ }).transform(html);
1475
+ if (injected)
1476
+ return rewritten;
1477
+ }
1478
+ const doctype = /^\s*<!doctype[^>]*>/i.exec(html)?.[0] ?? "";
1479
+ return `${doctype}${assets}${html.slice(doctype.length)}`;
1480
+ }
1481
+ var FRAME_REFERENCE_PREFIX2 = `${FRAME_ASSET_PREFIX}ref/`;
1482
+ var FRAME_REFERENCE_PATH2 = /^([^/@]+)@(\d+|latest)\/(.+)$/;
1483
+ function frameReferencePath(target, entry) {
1484
+ const file = parseArtifactAddress2(target.address)?.path;
1485
+ if (!file)
1486
+ return null;
1487
+ const path = file.split("/").map(encodeURIComponent).join("/");
1488
+ return `${rootOf(entry)}${FRAME_REFERENCE_PREFIX2}${target.artifactId}@${target.version}/${path}`;
1489
+ }
1490
+ function rewriteFrameReferences2(html, targets, entry = "index.html") {
1491
+ return new HTMLRewriter().on("img[src]", {
1492
+ element(element) {
1493
+ const source = decodeHtmlEntities(element.getAttribute("src") ?? "").trim();
1494
+ if (!isArtifactAddress2(source))
1495
+ return;
1496
+ const target = targets.find((candidate) => candidate.address === source);
1497
+ const path = target ? frameReferencePath(target, entry) : null;
1498
+ if (path) {
1499
+ element.setAttribute("src", path);
1500
+ element.setAttribute("data-sixb-ref", "");
1501
+ } else {
1502
+ element.removeAttribute("src");
1503
+ element.setAttribute("data-sixb-ref", "unavailable");
1504
+ }
1505
+ }
1506
+ }).transform(html);
1507
+ }
1508
+
1509
+ // src/objects/serialize.ts
1510
+ function serializeObject2(row) {
1511
+ return {
1512
+ ...row.score === undefined ? {} : { score: row.score },
1513
+ primaryId: row.primaryId,
1514
+ objectTypeId: row.objectTypeId,
1515
+ properties: row.properties,
1516
+ ...row.redactions === undefined ? {} : { redactions: row.redactions },
1517
+ createdAt: row.createdAt.toISOString(),
1518
+ updatedAt: row.updatedAt.toISOString()
1519
+ };
1520
+ }
1521
+ function serializeExpandedObject2(row) {
1522
+ const serialized = serializeObject2(row);
1523
+ if (row.links)
1524
+ serialized.links = serializeLinks(row.links);
1525
+ if (row.linkProperties !== undefined)
1526
+ serialized.linkProperties = row.linkProperties;
1527
+ if (row.users)
1528
+ serialized.users = row.users;
1529
+ return serialized;
1530
+ }
1531
+ function serializeLinks(links) {
1532
+ const result = {};
1533
+ for (const [linkId, value] of Object.entries(links)) {
1534
+ result[linkId] = serializeLinkValue(value);
1535
+ }
1536
+ return result;
1537
+ }
1538
+ function serializeLinkValue(value) {
1539
+ if (value === null)
1540
+ return null;
1541
+ if (Array.isArray(value))
1542
+ return value.map(serializeExpandedObject2);
1543
+ return serializeExpandedObject2(value);
1544
+ }
1545
+
1546
+ // src/artifacts/serialize-query.ts
1547
+ function serializeArtifactQueryResult2(result) {
1548
+ return result.kind === "objects" ? { ...result, objects: result.objects.map(serializeExpandedObject2) } : result;
1549
+ }
1550
+
1551
+ export { ArtifactRequestError2, checkArtifactFiles, readArtifactText, invalidArtifact, decodeHtmlEntities, HTML_ENTRY2, refuseFrameAssetPaths, readHtmlReferences, FRAME_DEFAULT_THEMES2, FRAME_CDN_ALLOWLIST2, FRAME_ASSETS2, injectFrameAssets2, FRAME_REFERENCE_PREFIX2, FRAME_REFERENCE_PATH2, rewriteFrameReferences2, serializeObject2, serializeExpandedObject2, serializeArtifactQueryResult2 };
1552
+
1553
+ //# debugId=17C01D9E19A6181C64756E2164756E21