@sixb/core 0.2.1 → 0.2.3

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 (1247) hide show
  1. package/dist/actions/index.js +60 -54
  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.map +1 -1
  9. package/dist/agents/execution.d.ts +2 -1
  10. package/dist/agents/execution.d.ts.map +1 -1
  11. package/dist/agents/fork.d.ts.map +1 -1
  12. package/dist/agents/index.d.ts +6 -4
  13. package/dist/agents/index.d.ts.map +1 -1
  14. package/dist/agents/index.js +95 -82
  15. package/dist/agents/index.js.map +1 -1
  16. package/dist/agents/request.d.ts +7 -1
  17. package/dist/agents/request.d.ts.map +1 -1
  18. package/dist/agents/run-artifacts.d.ts +73 -10
  19. package/dist/agents/run-artifacts.d.ts.map +1 -1
  20. package/dist/agents/run-plan.d.ts +15 -1
  21. package/dist/agents/run-plan.d.ts.map +1 -1
  22. package/dist/agents/run-session-http.d.ts.map +1 -1
  23. package/dist/agents/run-session-serve.d.ts.map +1 -1
  24. package/dist/agents/run-session.d.ts +17 -2
  25. package/dist/agents/run-session.d.ts.map +1 -1
  26. package/dist/agents/skills.d.ts +3 -0
  27. package/dist/agents/skills.d.ts.map +1 -1
  28. package/dist/agents/step-limits.d.ts +6 -0
  29. package/dist/agents/step-limits.d.ts.map +1 -1
  30. package/dist/agents/streams/index.js +2 -2
  31. package/dist/agents/streams/internal.js +2 -2
  32. package/dist/agents/streams/protocol.d.ts +8 -2
  33. package/dist/agents/streams/protocol.d.ts.map +1 -1
  34. package/dist/agents/tool-files.d.ts +3 -1
  35. package/dist/agents/tool-files.d.ts.map +1 -1
  36. package/dist/agents/validation.d.ts +1 -1
  37. package/dist/agents/validation.d.ts.map +1 -1
  38. package/dist/agents/web.d.ts +47 -0
  39. package/dist/agents/web.d.ts.map +1 -0
  40. package/dist/artifacts/access.d.ts +37 -17
  41. package/dist/artifacts/access.d.ts.map +1 -1
  42. package/dist/artifacts/canvas-display.d.ts +65 -0
  43. package/dist/artifacts/canvas-display.d.ts.map +1 -0
  44. package/dist/artifacts/canvas.d.ts +6 -1
  45. package/dist/artifacts/canvas.d.ts.map +1 -1
  46. package/dist/artifacts/comment-text.d.ts +19 -0
  47. package/dist/artifacts/comment-text.d.ts.map +1 -0
  48. package/dist/artifacts/comments.d.ts +52 -0
  49. package/dist/artifacts/comments.d.ts.map +1 -0
  50. package/dist/artifacts/errors.d.ts +3 -3
  51. package/dist/artifacts/errors.d.ts.map +1 -1
  52. package/dist/artifacts/events.d.ts +14 -0
  53. package/dist/artifacts/events.d.ts.map +1 -0
  54. package/dist/artifacts/execution.d.ts +129 -22
  55. package/dist/artifacts/execution.d.ts.map +1 -1
  56. package/dist/artifacts/frames/assets.d.ts +12 -1
  57. package/dist/artifacts/frames/assets.d.ts.map +1 -1
  58. package/dist/artifacts/frames/grants.d.ts +8 -5
  59. package/dist/artifacts/frames/grants.d.ts.map +1 -1
  60. package/dist/artifacts/frames/index.d.ts +1 -1
  61. package/dist/artifacts/frames/index.d.ts.map +1 -1
  62. package/dist/artifacts/frames/index.js +32 -964
  63. package/dist/artifacts/frames/index.js.map +4 -8
  64. package/dist/artifacts/frames/kit.d.ts.map +1 -1
  65. package/dist/artifacts/frames/protocol.d.ts +78 -0
  66. package/dist/artifacts/frames/protocol.d.ts.map +1 -1
  67. package/dist/artifacts/frames/runtime.d.ts +17 -7
  68. package/dist/artifacts/frames/runtime.d.ts.map +1 -1
  69. package/dist/artifacts/holders.d.ts +23 -0
  70. package/dist/artifacts/holders.d.ts.map +1 -0
  71. package/dist/artifacts/ids.d.ts +2 -0
  72. package/dist/artifacts/ids.d.ts.map +1 -1
  73. package/dist/artifacts/index.d.ts +6 -4
  74. package/dist/artifacts/index.d.ts.map +1 -1
  75. package/dist/artifacts/index.js +108 -13
  76. package/dist/artifacts/index.js.map +5 -4
  77. package/dist/artifacts/limits.d.ts +24 -3
  78. package/dist/artifacts/limits.d.ts.map +1 -1
  79. package/dist/artifacts/live/board.d.ts +103 -0
  80. package/dist/artifacts/live/board.d.ts.map +1 -0
  81. package/dist/artifacts/live/diff.d.ts +43 -0
  82. package/dist/artifacts/live/diff.d.ts.map +1 -0
  83. package/dist/artifacts/live/document.d.ts +55 -0
  84. package/dist/artifacts/live/document.d.ts.map +1 -0
  85. package/dist/artifacts/live/files.d.ts +16 -0
  86. package/dist/artifacts/live/files.d.ts.map +1 -0
  87. package/dist/artifacts/live/index.d.ts +9 -0
  88. package/dist/artifacts/live/index.d.ts.map +1 -0
  89. package/dist/artifacts/live/index.js +593 -0
  90. package/dist/artifacts/live/index.js.map +10 -0
  91. package/dist/artifacts/live/presence.d.ts +55 -0
  92. package/dist/artifacts/live/presence.d.ts.map +1 -0
  93. package/dist/artifacts/live/protocol.d.ts +109 -0
  94. package/dist/artifacts/live/protocol.d.ts.map +1 -0
  95. package/dist/artifacts/live/protocol.js +21 -0
  96. package/dist/artifacts/live/protocol.js.map +9 -0
  97. package/dist/artifacts/live/server.d.ts +10 -0
  98. package/dist/artifacts/live/server.d.ts.map +1 -0
  99. package/dist/artifacts/live/server.js +86 -0
  100. package/dist/artifacts/live/server.js.map +9 -0
  101. package/dist/artifacts/live/state.d.ts +26 -0
  102. package/dist/artifacts/live/state.d.ts.map +1 -0
  103. package/dist/artifacts/outline.d.ts +11 -0
  104. package/dist/artifacts/outline.d.ts.map +1 -1
  105. package/dist/artifacts/publish/index.d.ts +8 -1
  106. package/dist/artifacts/publish/index.d.ts.map +1 -1
  107. package/dist/artifacts/publish/index.js +67 -39
  108. package/dist/artifacts/publish/index.js.map +1 -1
  109. package/dist/artifacts/publish/merge.d.ts +75 -0
  110. package/dist/artifacts/publish/merge.d.ts.map +1 -0
  111. package/dist/artifacts/publish/previews.d.ts +153 -0
  112. package/dist/artifacts/publish/previews.d.ts.map +1 -0
  113. package/dist/artifacts/publish/publish.d.ts +29 -8
  114. package/dist/artifacts/publish/publish.d.ts.map +1 -1
  115. package/dist/artifacts/publish/query-answers.d.ts +20 -0
  116. package/dist/artifacts/publish/query-answers.d.ts.map +1 -0
  117. package/dist/artifacts/publish/references.d.ts +4 -3
  118. package/dist/artifacts/publish/references.d.ts.map +1 -1
  119. package/dist/artifacts/publish/validate/canvas.d.ts.map +1 -1
  120. package/dist/artifacts/theme.d.ts +5 -1
  121. package/dist/artifacts/theme.d.ts.map +1 -1
  122. package/dist/auth/directory.d.ts +33 -0
  123. package/dist/auth/directory.d.ts.map +1 -0
  124. package/dist/auth/index.js +13 -12
  125. package/dist/auth/index.js.map +1 -1
  126. package/dist/auth/member-events.d.ts +5 -1
  127. package/dist/auth/member-events.d.ts.map +1 -1
  128. package/dist/auth/runtime.d.ts +22 -1
  129. package/dist/auth/runtime.d.ts.map +1 -1
  130. package/dist/auth/strategy.d.ts +2 -2
  131. package/dist/auth/strategy.d.ts.map +1 -1
  132. package/dist/auth/types.d.ts +42 -1
  133. package/dist/auth/types.d.ts.map +1 -1
  134. package/dist/authorization/decision.d.ts +6 -5
  135. package/dist/authorization/decision.d.ts.map +1 -1
  136. package/dist/authorization/event-visibility.d.ts.map +1 -1
  137. package/dist/authorization/index.js +7 -6
  138. package/dist/authorization/index.js.map +1 -1
  139. package/dist/authorization/resolve.d.ts +4 -3
  140. package/dist/authorization/resolve.d.ts.map +1 -1
  141. package/dist/authorization/types.d.ts +5 -5
  142. package/dist/authorization/types.d.ts.map +1 -1
  143. package/dist/blob-storage/index.js +4 -4
  144. package/dist/blob-storage/index.js.map +1 -1
  145. package/dist/bootstrap/index.js +70 -64
  146. package/dist/bootstrap/index.js.map +2 -2
  147. package/dist/broker/in-memory.d.ts.map +1 -1
  148. package/dist/broker/index.js +1 -1
  149. package/dist/broker/types.d.ts +4 -0
  150. package/dist/broker/types.d.ts.map +1 -1
  151. package/dist/{chunk-3x3bebz7.js → chunk-0k3r5kb3.js} +414 -101
  152. package/dist/chunk-0k3r5kb3.js.map +51 -0
  153. package/dist/{chunk-e5wf5vz0.js → chunk-0kgrghqx.js} +13 -1
  154. package/dist/chunk-0kgrghqx.js.map +10 -0
  155. package/dist/{chunk-2pk5hjj9.js → chunk-186k5yz3.js} +1 -1
  156. package/dist/chunk-191jz8a6.js +61 -0
  157. package/dist/chunk-191jz8a6.js.map +10 -0
  158. package/dist/{chunk-mmagke4x.js → chunk-22d3qg4x.js} +2 -2
  159. package/dist/{chunk-mmagke4x.js.map → chunk-22d3qg4x.js.map} +3 -3
  160. package/dist/{chunk-8yzhjawq.js → chunk-26qet7wh.js} +64 -23
  161. package/dist/{chunk-8yzhjawq.js.map → chunk-26qet7wh.js.map} +5 -5
  162. package/dist/{chunk-cb21tx14.js → chunk-2by73sm2.js} +1055 -201
  163. package/dist/chunk-2by73sm2.js.map +75 -0
  164. package/dist/chunk-2c4j899j.js.map +2 -2
  165. package/dist/{chunk-e6xgz4h4.js → chunk-3014rfjz.js} +197 -18
  166. package/dist/chunk-3014rfjz.js.map +21 -0
  167. package/dist/{chunk-nghc7eq0.js → chunk-3723kgba.js} +1 -1
  168. package/dist/chunk-38yvdqzd.js +70 -0
  169. package/dist/chunk-38yvdqzd.js.map +10 -0
  170. package/dist/{chunk-ytzcxtpt.js → chunk-3ba89vm7.js} +1 -1
  171. package/dist/chunk-3hzhcfsv.js +139 -0
  172. package/dist/chunk-3hzhcfsv.js.map +10 -0
  173. package/dist/chunk-3sgvd10b.js +69 -0
  174. package/dist/chunk-3sgvd10b.js.map +10 -0
  175. package/dist/{chunk-djs3hw9p.js → chunk-3zagkr6w.js} +73 -6
  176. package/dist/chunk-3zagkr6w.js.map +21 -0
  177. package/dist/{chunk-fg1db9xx.js → chunk-48c1z8nj.js} +10 -10
  178. package/dist/chunk-48c1z8nj.js.map +10 -0
  179. package/dist/{chunk-rjeeyssy.js → chunk-4j0sagwv.js} +134 -19
  180. package/dist/{chunk-rjeeyssy.js.map → chunk-4j0sagwv.js.map} +11 -10
  181. package/dist/{chunk-qsg8rw04.js → chunk-5qqmndhm.js} +2 -2
  182. package/dist/{chunk-scyq22td.js → chunk-5rqqp8cr.js} +19 -4
  183. package/dist/chunk-5rqqp8cr.js.map +12 -0
  184. package/dist/{chunk-ax10ft8d.js → chunk-6gtxshcc.js} +6 -6
  185. package/dist/{chunk-ax10ft8d.js.map → chunk-6gtxshcc.js.map} +1 -1
  186. package/dist/{chunk-jspskey0.js → chunk-7j4yydm2.js} +67 -45
  187. package/dist/chunk-7j4yydm2.js.map +11 -0
  188. package/dist/{chunk-8wsjr52f.js → chunk-7qe46788.js} +1 -1
  189. package/dist/{chunk-edx8xcsm.js → chunk-7z5rkf0m.js} +29 -6
  190. package/dist/chunk-7z5rkf0m.js.map +13 -0
  191. package/dist/{chunk-23s66j86.js → chunk-855w9nvw.js} +1 -1
  192. package/dist/{chunk-e7v3trpz.js → chunk-8a8k38tz.js} +4 -3
  193. package/dist/chunk-8a8k38tz.js.map +10 -0
  194. package/dist/{chunk-tvbmh7tj.js → chunk-8p7bze4c.js} +14 -10
  195. package/dist/chunk-8p7bze4c.js.map +18 -0
  196. package/dist/{chunk-jftd33rc.js → chunk-8t2ynwg0.js} +105 -9
  197. package/dist/chunk-8t2ynwg0.js.map +11 -0
  198. package/dist/{chunk-qbrmpgvv.js → chunk-8tqnsx3q.js} +1 -1
  199. package/dist/{chunk-s3we74h8.js → chunk-9nsjjd44.js} +38 -5
  200. package/dist/chunk-9nsjjd44.js.map +12 -0
  201. package/dist/{chunk-hz5d43gn.js → chunk-9vsc919v.js} +14 -6
  202. package/dist/chunk-9vsc919v.js.map +10 -0
  203. package/dist/{chunk-waqk73p1.js → chunk-a6fjkcne.js} +185 -341
  204. package/dist/{chunk-waqk73p1.js.map → chunk-a6fjkcne.js.map} +6 -7
  205. package/dist/{chunk-tvefbgvw.js → chunk-az95tsh3.js} +4 -2
  206. package/dist/chunk-az95tsh3.js.map +11 -0
  207. package/dist/{chunk-s038wa5v.js → chunk-b9qfh2ya.js} +1 -1
  208. package/dist/{chunk-5taem5aw.js → chunk-bc3y6gff.js} +13 -4
  209. package/dist/chunk-bc3y6gff.js.map +10 -0
  210. package/dist/{chunk-ks87m383.js → chunk-bkmnd7zq.js} +556 -262
  211. package/dist/chunk-bkmnd7zq.js.map +49 -0
  212. package/dist/chunk-bz5bnjjt.js +358 -0
  213. package/dist/chunk-bz5bnjjt.js.map +12 -0
  214. package/dist/{chunk-7hd2ez3q.js → chunk-c4nrycdy.js} +1 -1
  215. package/dist/{chunk-w976a4me.js → chunk-czct88ht.js} +28 -4
  216. package/dist/chunk-czct88ht.js.map +10 -0
  217. package/dist/{chunk-5kyvrtjh.js → chunk-d9xbwh3h.js} +131 -32
  218. package/dist/chunk-d9xbwh3h.js.map +13 -0
  219. package/dist/{chunk-kfee1h52.js → chunk-dfveegqq.js} +28 -8
  220. package/dist/chunk-dfveegqq.js.map +13 -0
  221. package/dist/{chunk-2g0r46hy.js → chunk-dhkc9b23.js} +15 -2
  222. package/dist/chunk-dhkc9b23.js.map +12 -0
  223. package/dist/chunk-dmnd9ea6.js +106 -0
  224. package/dist/chunk-dmnd9ea6.js.map +10 -0
  225. package/dist/{chunk-nz7815t3.js → chunk-e0hnbb1m.js} +27 -2
  226. package/dist/chunk-e0hnbb1m.js.map +14 -0
  227. package/dist/chunk-e91fmg6t.js +288 -0
  228. package/dist/chunk-e91fmg6t.js.map +11 -0
  229. package/dist/{chunk-z3evap21.js → chunk-e9w4mgdh.js} +314 -225
  230. package/dist/{chunk-z3evap21.js.map → chunk-e9w4mgdh.js.map} +22 -20
  231. package/dist/{chunk-w122ymx4.js → chunk-f6ahf5gf.js} +15 -4
  232. package/dist/{chunk-w122ymx4.js.map → chunk-f6ahf5gf.js.map} +3 -3
  233. package/dist/{chunk-jjmggm9a.js → chunk-fe6r7yhg.js} +1 -1
  234. package/dist/{chunk-165c9wm6.js → chunk-g2ph4873.js} +1 -1
  235. package/dist/chunk-hgj98cbb.js +22 -0
  236. package/dist/chunk-hgj98cbb.js.map +10 -0
  237. package/dist/{chunk-nqnfz3jg.js → chunk-hkaa807g.js} +18 -7
  238. package/dist/{chunk-nqnfz3jg.js.map → chunk-hkaa807g.js.map} +3 -3
  239. package/dist/chunk-hn2r7z41.js.map +3 -3
  240. package/dist/chunk-j0wgh8gv.js +250 -0
  241. package/dist/chunk-j0wgh8gv.js.map +10 -0
  242. package/dist/{chunk-z8fx5cgb.js → chunk-j2zm215x.js} +37 -3
  243. package/dist/chunk-j2zm215x.js.map +12 -0
  244. package/dist/{chunk-j1ny5fwh.js → chunk-k1g14kk3.js} +11 -83
  245. package/dist/{chunk-j1ny5fwh.js.map → chunk-k1g14kk3.js.map} +4 -5
  246. package/dist/{chunk-b7a97n8b.js → chunk-k66rp2hr.js} +7 -7
  247. package/dist/{chunk-b7a97n8b.js.map → chunk-k66rp2hr.js.map} +2 -2
  248. package/dist/chunk-kr6dx38r.js +25 -0
  249. package/dist/chunk-kr6dx38r.js.map +10 -0
  250. package/dist/{chunk-w53trr0c.js → chunk-kv0kvknv.js} +14 -14
  251. package/dist/{chunk-w53trr0c.js.map → chunk-kv0kvknv.js.map} +1 -1
  252. package/dist/chunk-m2jerfef.js +474 -0
  253. package/dist/chunk-m2jerfef.js.map +11 -0
  254. package/dist/chunk-m7b9q5dk.js +234 -0
  255. package/dist/chunk-m7b9q5dk.js.map +12 -0
  256. package/dist/{chunk-escedwyt.js → chunk-mvz89age.js} +6 -1
  257. package/dist/{chunk-escedwyt.js.map → chunk-mvz89age.js.map} +3 -3
  258. package/dist/chunk-mwcqz3e3.js +30 -0
  259. package/dist/chunk-mwcqz3e3.js.map +10 -0
  260. package/dist/chunk-n2ay51px.js +21 -0
  261. package/dist/chunk-n2ay51px.js.map +10 -0
  262. package/dist/{chunk-jk97v21j.js → chunk-n4zzaf6q.js} +3 -2
  263. package/dist/chunk-n4zzaf6q.js.map +10 -0
  264. package/dist/{chunk-cgznz22f.js → chunk-n68vz95m.js} +5 -5
  265. package/dist/{chunk-cgznz22f.js.map → chunk-n68vz95m.js.map} +3 -3
  266. package/dist/{chunk-neftrg0n.js → chunk-p351afzm.js} +14 -14
  267. package/dist/{chunk-neftrg0n.js.map → chunk-p351afzm.js.map} +4 -4
  268. package/dist/chunk-pk539cwv.js +370 -0
  269. package/dist/chunk-pk539cwv.js.map +11 -0
  270. package/dist/{chunk-jbw70d6t.js → chunk-ppxf7gw2.js} +52 -10
  271. package/dist/chunk-ppxf7gw2.js.map +11 -0
  272. package/dist/{chunk-9x8dybsb.js → chunk-pvpq483h.js} +10 -2
  273. package/dist/chunk-pvpq483h.js.map +10 -0
  274. package/dist/{chunk-jhbk10wf.js → chunk-q9nkpr8k.js} +1 -1
  275. package/dist/chunk-qafng88v.js +225 -0
  276. package/dist/chunk-qafng88v.js.map +11 -0
  277. package/dist/chunk-qds484t8.js +1363 -0
  278. package/dist/chunk-qds484t8.js.map +18 -0
  279. package/dist/{chunk-47e09r7z.js → chunk-qttqe1ah.js} +86 -6
  280. package/dist/{chunk-47e09r7z.js.map → chunk-qttqe1ah.js.map} +5 -4
  281. package/dist/{chunk-4zm1k3xj.js → chunk-r2psmn42.js} +1 -1
  282. package/dist/{chunk-31khg3g0.js → chunk-rt9deb92.js} +76 -4
  283. package/dist/{chunk-31khg3g0.js.map → chunk-rt9deb92.js.map} +3 -3
  284. package/dist/{chunk-r1cxq7vv.js → chunk-rtdrm592.js} +2 -2
  285. package/dist/{chunk-t5daew4g.js → chunk-s5n9617r.js} +18 -18
  286. package/dist/{chunk-t5daew4g.js.map → chunk-s5n9617r.js.map} +1 -1
  287. package/dist/{chunk-m3qe54bb.js → chunk-smnt672s.js} +1 -1
  288. package/dist/{chunk-21q0j5f2.js → chunk-stmxh0hv.js} +2 -2
  289. package/dist/{chunk-y2x2935j.js → chunk-sysnvjce.js} +5 -5
  290. package/dist/{chunk-y2x2935j.js.map → chunk-sysnvjce.js.map} +3 -3
  291. package/dist/{chunk-57g0215c.js → chunk-t24yktqr.js} +296 -7
  292. package/dist/{chunk-57g0215c.js.map → chunk-t24yktqr.js.map} +6 -3
  293. package/dist/{chunk-ff5xkv0p.js → chunk-tfzvjdms.js} +1 -1
  294. package/dist/chunk-tqa68kj7.js +1322 -0
  295. package/dist/chunk-tqa68kj7.js.map +25 -0
  296. package/dist/chunk-vtjzwymr.js +37 -0
  297. package/dist/chunk-vtjzwymr.js.map +10 -0
  298. package/dist/{chunk-dz7a4t3a.js → chunk-vzkxqf8h.js} +26 -21
  299. package/dist/{chunk-dz7a4t3a.js.map → chunk-vzkxqf8h.js.map} +8 -8
  300. package/dist/{chunk-6b61s40c.js → chunk-w3t94hm6.js} +1 -1
  301. package/dist/{chunk-t9xyr7y9.js → chunk-w9s23r24.js} +1218 -101
  302. package/dist/chunk-w9s23r24.js.map +30 -0
  303. package/dist/{chunk-9rh8ncs5.js → chunk-wa05txmk.js} +20 -7
  304. package/dist/{chunk-9rh8ncs5.js.map → chunk-wa05txmk.js.map} +3 -3
  305. package/dist/chunk-whbwf3np.js +12 -0
  306. package/dist/chunk-whbwf3np.js.map +10 -0
  307. package/dist/{chunk-agn8d8ys.js → chunk-xtztwpkh.js} +1 -1
  308. package/dist/{chunk-t5608tkq.js → chunk-yv8hv4wq.js} +3 -1
  309. package/dist/{chunk-t5608tkq.js.map → chunk-yv8hv4wq.js.map} +3 -3
  310. package/dist/{chunk-ratj7t3t.js → chunk-z0t4p2sk.js} +465 -76
  311. package/dist/chunk-z0t4p2sk.js.map +47 -0
  312. package/dist/{chunk-0g5nyx0k.js → chunk-zeykm8my.js} +2 -2
  313. package/dist/connectors/builders.d.ts +2 -2
  314. package/dist/connectors/builders.d.ts.map +1 -1
  315. package/dist/connectors/connections/access.d.ts +11 -0
  316. package/dist/connectors/connections/access.d.ts.map +1 -0
  317. package/dist/connectors/connections/contracts.d.ts +6 -1
  318. package/dist/connectors/connections/contracts.d.ts.map +1 -1
  319. package/dist/connectors/connections/internal.js +1 -1
  320. package/dist/connectors/connections/runs.d.ts +13 -0
  321. package/dist/connectors/connections/runs.d.ts.map +1 -1
  322. package/dist/connectors/connections/service.d.ts +25 -0
  323. package/dist/connectors/connections/service.d.ts.map +1 -1
  324. package/dist/connectors/connections/views.d.ts +1 -1
  325. package/dist/connectors/connections/views.d.ts.map +1 -1
  326. package/dist/connectors/execution.d.ts.map +1 -1
  327. package/dist/connectors/index.d.ts +1 -1
  328. package/dist/connectors/index.d.ts.map +1 -1
  329. package/dist/connectors/service.d.ts +3 -0
  330. package/dist/connectors/service.d.ts.map +1 -1
  331. package/dist/connectors/types.d.ts +21 -2
  332. package/dist/connectors/types.d.ts.map +1 -1
  333. package/dist/datasets/execution.d.ts +12 -6
  334. package/dist/datasets/execution.d.ts.map +1 -1
  335. package/dist/datasets/ingest-flush-batch.d.ts +59 -0
  336. package/dist/datasets/ingest-flush-batch.d.ts.map +1 -0
  337. package/dist/datasets/ingest-flush-job.d.ts +33 -0
  338. package/dist/datasets/ingest-flush-job.d.ts.map +1 -0
  339. package/dist/datasets/ingest-flush.d.ts +66 -0
  340. package/dist/datasets/ingest-flush.d.ts.map +1 -0
  341. package/dist/datasets/produced-version.d.ts +21 -0
  342. package/dist/datasets/produced-version.d.ts.map +1 -0
  343. package/dist/datasets/write.d.ts +22 -1
  344. package/dist/datasets/write.d.ts.map +1 -1
  345. package/dist/datasets/write.js +8 -4
  346. package/dist/datasets/write.js.map +1 -1
  347. package/dist/deploy/internal.js +5 -4
  348. package/dist/deploy/internal.js.map +4 -4
  349. package/dist/deploy/types.d.ts +2 -3
  350. package/dist/deploy/types.d.ts.map +1 -1
  351. package/dist/error-reporting/capability.d.ts +8 -2
  352. package/dist/error-reporting/capability.d.ts.map +1 -1
  353. package/dist/error-reporting/internal.d.ts +1 -1
  354. package/dist/error-reporting/internal.d.ts.map +1 -1
  355. package/dist/error-reporting/internal.js +17 -5
  356. package/dist/error-reporting/internal.js.map +1 -1
  357. package/dist/error-reporting/reporter.d.ts.map +1 -1
  358. package/dist/error-reporting/reports.d.ts +55 -0
  359. package/dist/error-reporting/reports.d.ts.map +1 -1
  360. package/dist/error-reporting/types.d.ts +82 -1
  361. package/dist/error-reporting/types.d.ts.map +1 -1
  362. package/dist/errors/catalog.d.ts +5 -0
  363. package/dist/errors/catalog.d.ts.map +1 -1
  364. package/dist/errors/internal.js +1 -1
  365. package/dist/events/definitions.d.ts +4 -0
  366. package/dist/events/definitions.d.ts.map +1 -1
  367. package/dist/events/execution.d.ts +1 -0
  368. package/dist/events/execution.d.ts.map +1 -1
  369. package/dist/events/index.d.ts +1 -1
  370. package/dist/events/index.d.ts.map +1 -1
  371. package/dist/events/index.js +5 -5
  372. package/dist/events/scope.d.ts.map +1 -1
  373. package/dist/events/scope.js +1 -1
  374. package/dist/events/selectors/index.js +2 -2
  375. package/dist/events/types/artifacts.d.ts +38 -0
  376. package/dist/events/types/artifacts.d.ts.map +1 -0
  377. package/dist/events/types/index.d.ts +3 -1
  378. package/dist/events/types/index.d.ts.map +1 -1
  379. package/dist/events/types/users.d.ts +5 -2
  380. package/dist/events/types/users.d.ts.map +1 -1
  381. package/dist/execution/agent.js +61 -55
  382. package/dist/execution/agent.js.map +1 -1
  383. package/dist/execution/authorized-object-reader.d.ts +10 -0
  384. package/dist/execution/authorized-object-reader.d.ts.map +1 -1
  385. package/dist/execution/object-reader-clearance.d.ts +6 -0
  386. package/dist/execution/object-reader-clearance.d.ts.map +1 -1
  387. package/dist/execution/object-reader-security.d.ts +9 -2
  388. package/dist/execution/object-reader-security.d.ts.map +1 -1
  389. package/dist/execution/primitive.js +60 -54
  390. package/dist/execution/primitive.js.map +1 -1
  391. package/dist/execution/request.js +57 -51
  392. package/dist/execution/request.js.map +2 -2
  393. package/dist/http/api-routes.d.ts +1 -1
  394. package/dist/http/api-routes.d.ts.map +1 -1
  395. package/dist/http/index.js +1 -1
  396. package/dist/index.d.ts +12 -10
  397. package/dist/index.d.ts.map +1 -1
  398. package/dist/index.js +101 -93
  399. package/dist/index.js.map +1 -1
  400. package/dist/lake-storage/errors.d.ts +15 -0
  401. package/dist/lake-storage/errors.d.ts.map +1 -1
  402. package/dist/lake-storage/index.d.ts +3 -2
  403. package/dist/lake-storage/index.d.ts.map +1 -1
  404. package/dist/lake-storage/index.js +16 -10
  405. package/dist/lake-storage/index.js.map +1 -1
  406. package/dist/lake-storage/maintenance.d.ts +88 -0
  407. package/dist/lake-storage/maintenance.d.ts.map +1 -0
  408. package/dist/lake-storage/merge.d.ts +3 -1
  409. package/dist/lake-storage/merge.d.ts.map +1 -1
  410. package/dist/lake-storage/source-ordering.d.ts +23 -0
  411. package/dist/lake-storage/source-ordering.d.ts.map +1 -1
  412. package/dist/lake-storage/types.d.ts +10 -0
  413. package/dist/lake-storage/types.d.ts.map +1 -1
  414. package/dist/maintenance/heartbeat.d.ts +5 -0
  415. package/dist/maintenance/heartbeat.d.ts.map +1 -0
  416. package/dist/maintenance/index.d.ts +4 -2
  417. package/dist/maintenance/index.d.ts.map +1 -1
  418. package/dist/maintenance/index.js +515 -0
  419. package/dist/maintenance/index.js.map +16 -0
  420. package/dist/maintenance/lake-retention-status.d.ts +36 -0
  421. package/dist/maintenance/lake-retention-status.d.ts.map +1 -0
  422. package/dist/maintenance/lake-retention.d.ts +84 -0
  423. package/dist/maintenance/lake-retention.d.ts.map +1 -0
  424. package/dist/maintenance/loop.d.ts +95 -0
  425. package/dist/maintenance/loop.d.ts.map +1 -0
  426. package/dist/maintenance/ontology-maintenance.d.ts +17 -16
  427. package/dist/maintenance/ontology-maintenance.d.ts.map +1 -1
  428. package/dist/maintenance/passes/cron-pass.d.ts +21 -0
  429. package/dist/maintenance/passes/cron-pass.d.ts.map +1 -0
  430. package/dist/maintenance/passes/directory-pass.d.ts +12 -0
  431. package/dist/maintenance/passes/directory-pass.d.ts.map +1 -0
  432. package/dist/maintenance/passes/ingest-pass.d.ts +26 -0
  433. package/dist/maintenance/passes/ingest-pass.d.ts.map +1 -0
  434. package/dist/maintenance/passes/lake-change-feed.d.ts +38 -0
  435. package/dist/maintenance/passes/lake-change-feed.d.ts.map +1 -0
  436. package/dist/maintenance/passes/lake-retention-pass.d.ts +20 -0
  437. package/dist/maintenance/passes/lake-retention-pass.d.ts.map +1 -0
  438. package/dist/maintenance/passes/ontology-pass.d.ts +8 -0
  439. package/dist/maintenance/passes/ontology-pass.d.ts.map +1 -0
  440. package/dist/maintenance/passes/projections-pass.d.ts +26 -0
  441. package/dist/maintenance/passes/projections-pass.d.ts.map +1 -0
  442. package/dist/maintenance/passes/recovery-pass.d.ts +6 -0
  443. package/dist/maintenance/passes/recovery-pass.d.ts.map +1 -0
  444. package/dist/maintenance/passes/recovery-passes.d.ts +24 -0
  445. package/dist/maintenance/passes/recovery-passes.d.ts.map +1 -0
  446. package/dist/maintenance/passes/runs-pass.d.ts +6 -0
  447. package/dist/maintenance/passes/runs-pass.d.ts.map +1 -0
  448. package/dist/maintenance/passes/triggers-pass.d.ts +41 -0
  449. package/dist/maintenance/passes/triggers-pass.d.ts.map +1 -0
  450. package/dist/maintenance/status.d.ts +19 -0
  451. package/dist/maintenance/status.d.ts.map +1 -0
  452. package/dist/maintenance/types.d.ts +25 -24
  453. package/dist/maintenance/types.d.ts.map +1 -1
  454. package/dist/materialization/model.d.ts +11 -2
  455. package/dist/materialization/model.d.ts.map +1 -1
  456. package/dist/materializer/edits/artifact-refs.d.ts +33 -0
  457. package/dist/materializer/edits/artifact-refs.d.ts.map +1 -0
  458. package/dist/materializer/edits/commit.d.ts.map +1 -1
  459. package/dist/materializer/edits/operations.d.ts +7 -1
  460. package/dist/materializer/edits/operations.d.ts.map +1 -1
  461. package/dist/materializer/edits/plan.d.ts.map +1 -1
  462. package/dist/materializer/execution/work-records.d.ts +6 -0
  463. package/dist/materializer/execution/work-records.d.ts.map +1 -1
  464. package/dist/materializer/index.js +33 -30
  465. package/dist/materializer/index.js.map +1 -1
  466. package/dist/materializer/projections/replacement-plan.d.ts.map +1 -1
  467. package/dist/materializer/shared/normalize.d.ts.map +1 -1
  468. package/dist/materializer/telemetry/plan.d.ts.map +1 -1
  469. package/dist/models/catalog.d.ts +16 -0
  470. package/dist/models/catalog.d.ts.map +1 -1
  471. package/dist/models/definitions.d.ts +1 -1
  472. package/dist/models/definitions.d.ts.map +1 -1
  473. package/dist/models/execution/index.js +36 -33
  474. package/dist/models/execution/index.js.map +1 -1
  475. package/dist/models/execution/model-call-recorder.d.ts +1 -1
  476. package/dist/models/execution/model-call-recorder.d.ts.map +1 -1
  477. package/dist/models/execution/web-search.d.ts +7 -0
  478. package/dist/models/execution/web-search.d.ts.map +1 -0
  479. package/dist/models/index.d.ts +3 -1
  480. package/dist/models/index.d.ts.map +1 -1
  481. package/dist/models/index.js +5 -3
  482. package/dist/models/index.js.map +1 -1
  483. package/dist/models/language-model.d.ts +12 -0
  484. package/dist/models/language-model.d.ts.map +1 -1
  485. package/dist/models/web-search-model.d.ts +66 -0
  486. package/dist/models/web-search-model.d.ts.map +1 -0
  487. package/dist/objects/artifact-refs.d.ts +5 -0
  488. package/dist/objects/artifact-refs.d.ts.map +1 -0
  489. package/dist/objects/index.js +63 -58
  490. package/dist/objects/index.js.map +1 -1
  491. package/dist/objects/materializer-adapter.d.ts +4 -3
  492. package/dist/objects/materializer-adapter.d.ts.map +1 -1
  493. package/dist/objects/object/upsert-batch.d.ts.map +1 -1
  494. package/dist/objects/object/upsert.d.ts.map +1 -1
  495. package/dist/objects/query/executor.d.ts.map +1 -1
  496. package/dist/objects/query/index.d.ts +1 -0
  497. package/dist/objects/query/index.d.ts.map +1 -1
  498. package/dist/objects/query/index.js +35 -29
  499. package/dist/objects/query/index.js.map +1 -1
  500. package/dist/objects/query/ir.d.ts +3 -1
  501. package/dist/objects/query/ir.d.ts.map +1 -1
  502. package/dist/objects/query/scalar-values.d.ts.map +1 -1
  503. package/dist/objects/query/sort-ties.d.ts +11 -0
  504. package/dist/objects/query/sort-ties.d.ts.map +1 -0
  505. package/dist/objects/runtime-batch.d.ts +2 -0
  506. package/dist/objects/runtime-batch.d.ts.map +1 -1
  507. package/dist/ontology/artifact-ref.d.ts +36 -0
  508. package/dist/ontology/artifact-ref.d.ts.map +1 -0
  509. package/dist/ontology/docs-markdown.d.ts.map +1 -1
  510. package/dist/ontology/index.d.ts +3 -1
  511. package/dist/ontology/index.d.ts.map +1 -1
  512. package/dist/ontology/index.js +8 -5
  513. package/dist/ontology/index.js.map +1 -1
  514. package/dist/ontology/inference/index.d.ts +2 -0
  515. package/dist/ontology/inference/index.d.ts.map +1 -1
  516. package/dist/ontology/internal.js +7 -6
  517. package/dist/ontology/internal.js.map +1 -1
  518. package/dist/ontology/json-schema.d.ts.map +1 -1
  519. package/dist/ontology/primitives.d.ts.map +1 -1
  520. package/dist/ontology/reference-values.d.ts +10 -0
  521. package/dist/ontology/reference-values.d.ts.map +1 -0
  522. package/dist/ontology/refs.d.ts +6 -1
  523. package/dist/ontology/refs.d.ts.map +1 -1
  524. package/dist/ontology/registry.d.ts +9 -1
  525. package/dist/ontology/registry.d.ts.map +1 -1
  526. package/dist/ontology/types.d.ts +2 -1
  527. package/dist/ontology/types.d.ts.map +1 -1
  528. package/dist/ontology/user-ref.d.ts +16 -0
  529. package/dist/ontology/user-ref.d.ts.map +1 -1
  530. package/dist/ontology/validation/normalize.d.ts.map +1 -1
  531. package/dist/ontology/validation/properties.d.ts.map +1 -1
  532. package/dist/ontology/validation/schema.d.ts.map +1 -1
  533. package/dist/pending-tasks.d.ts +17 -0
  534. package/dist/pending-tasks.d.ts.map +1 -0
  535. package/dist/pipelines/index.js +40 -37
  536. package/dist/pipelines/index.js.map +1 -1
  537. package/dist/pipelines/run-dispatch.d.ts +6 -0
  538. package/dist/pipelines/run-dispatch.d.ts.map +1 -1
  539. package/dist/predicates/types.d.ts +4 -0
  540. package/dist/predicates/types.d.ts.map +1 -1
  541. package/dist/projections/builders.d.ts +13 -11
  542. package/dist/projections/builders.d.ts.map +1 -1
  543. package/dist/projections/internal.js +33 -30
  544. package/dist/projections/internal.js.map +1 -1
  545. package/dist/projections/types.d.ts +1 -1
  546. package/dist/projections/types.d.ts.map +1 -1
  547. package/dist/projections/validation.d.ts +2 -2
  548. package/dist/projections/validation.d.ts.map +1 -1
  549. package/dist/queues/in-memory.d.ts +6 -1
  550. package/dist/queues/in-memory.d.ts.map +1 -1
  551. package/dist/queues/index.d.ts +1 -1
  552. package/dist/queues/index.d.ts.map +1 -1
  553. package/dist/queues/index.js +1 -1
  554. package/dist/queues/types.d.ts +55 -2
  555. package/dist/queues/types.d.ts.map +1 -1
  556. package/dist/runtime/create.d.ts +4 -1
  557. package/dist/runtime/create.d.ts.map +1 -1
  558. package/dist/runtime/host.d.ts +22 -5
  559. package/dist/runtime/host.d.ts.map +1 -1
  560. package/dist/runtime/index.d.ts +0 -1
  561. package/dist/runtime/index.d.ts.map +1 -1
  562. package/dist/runtime/internal.d.ts +6 -0
  563. package/dist/runtime/internal.d.ts.map +1 -1
  564. package/dist/runtime/internal.js +57 -36
  565. package/dist/runtime/internal.js.map +1 -1
  566. package/dist/runtime/resolve-definitions.d.ts.map +1 -1
  567. package/dist/runtime/sixb.d.ts +6 -1
  568. package/dist/runtime/sixb.d.ts.map +1 -1
  569. package/dist/sandboxes/index.js +8 -7
  570. package/dist/sandboxes/index.js.map +1 -1
  571. package/dist/scheduler/index.d.ts +0 -2
  572. package/dist/scheduler/index.d.ts.map +1 -1
  573. package/dist/scheduler/index.js +3 -6
  574. package/dist/scheduler/index.js.map +1 -1
  575. package/dist/schedules/index.js +9 -11
  576. package/dist/schedules/index.js.map +1 -1
  577. package/dist/security/index.d.ts +1 -0
  578. package/dist/security/index.d.ts.map +1 -1
  579. package/dist/security/internal.js +1 -1
  580. package/dist/security/registry.d.ts +2 -0
  581. package/dist/security/registry.d.ts.map +1 -1
  582. package/dist/security/view-conditions.d.ts.map +1 -1
  583. package/dist/security/visibility-keys.d.ts +19 -0
  584. package/dist/security/visibility-keys.d.ts.map +1 -0
  585. package/dist/shared/backoff.d.ts +12 -0
  586. package/dist/shared/backoff.d.ts.map +1 -0
  587. package/dist/shared/duration.d.ts +3 -0
  588. package/dist/shared/duration.d.ts.map +1 -0
  589. package/dist/shared/params/artifact-refs.d.ts +19 -0
  590. package/dist/shared/params/artifact-refs.d.ts.map +1 -0
  591. package/dist/shares/guest-name.d.ts +8 -0
  592. package/dist/shares/guest-name.d.ts.map +1 -0
  593. package/dist/shares/internal.d.ts +1 -0
  594. package/dist/shares/internal.d.ts.map +1 -1
  595. package/dist/shares/internal.js +74 -33
  596. package/dist/shares/internal.js.map +3 -3
  597. package/dist/shares/session-protocol.d.ts +13 -0
  598. package/dist/shares/session-protocol.d.ts.map +1 -1
  599. package/dist/storage/action-runs/failure.js +2 -2
  600. package/dist/storage/agents/in-memory.d.ts +8 -2
  601. package/dist/storage/agents/in-memory.d.ts.map +1 -1
  602. package/dist/storage/agents/index.d.ts +1 -1
  603. package/dist/storage/agents/index.d.ts.map +1 -1
  604. package/dist/storage/agents/provider.d.ts +8 -2
  605. package/dist/storage/agents/provider.d.ts.map +1 -1
  606. package/dist/storage/agents/provider.js +12 -6
  607. package/dist/storage/agents/provider.js.map +1 -1
  608. package/dist/storage/agents/types.d.ts +42 -2
  609. package/dist/storage/agents/types.d.ts.map +1 -1
  610. package/dist/storage/ai-cost/provider.js +4 -4
  611. package/dist/storage/ai-limits/enforcement.js +4 -4
  612. package/dist/storage/ai-limits/provider.js +2 -2
  613. package/dist/storage/artifacts/errors.d.ts +9 -4
  614. package/dist/storage/artifacts/errors.d.ts.map +1 -1
  615. package/dist/storage/artifacts/in-memory.d.ts +27 -4
  616. package/dist/storage/artifacts/in-memory.d.ts.map +1 -1
  617. package/dist/storage/artifacts/index.d.ts +1 -1
  618. package/dist/storage/artifacts/index.d.ts.map +1 -1
  619. package/dist/storage/artifacts/record.d.ts +39 -2
  620. package/dist/storage/artifacts/record.d.ts.map +1 -1
  621. package/dist/storage/artifacts/types.d.ts +328 -39
  622. package/dist/storage/artifacts/types.d.ts.map +1 -1
  623. package/dist/storage/auth/in-memory/auth-storage.d.ts +2 -1
  624. package/dist/storage/auth/in-memory/auth-storage.d.ts.map +1 -1
  625. package/dist/storage/auth/in-memory/identities.d.ts +4 -0
  626. package/dist/storage/auth/in-memory/identities.d.ts.map +1 -1
  627. package/dist/storage/auth/in-memory/shared.d.ts +3 -1
  628. package/dist/storage/auth/in-memory/shared.d.ts.map +1 -1
  629. package/dist/storage/auth/in-memory/users.d.ts.map +1 -1
  630. package/dist/storage/auth/index.d.ts +1 -1
  631. package/dist/storage/auth/index.d.ts.map +1 -1
  632. package/dist/storage/auth/types.d.ts +39 -0
  633. package/dist/storage/auth/types.d.ts.map +1 -1
  634. package/dist/storage/connector-connections/in-memory.d.ts +1 -1
  635. package/dist/storage/connector-connections/in-memory.d.ts.map +1 -1
  636. package/dist/storage/connector-connections/index.d.ts +1 -1
  637. package/dist/storage/connector-connections/index.d.ts.map +1 -1
  638. package/dist/storage/connector-connections/provider/runs.d.ts.map +1 -1
  639. package/dist/storage/connector-connections/provider/shared.d.ts +12 -2
  640. package/dist/storage/connector-connections/provider/shared.d.ts.map +1 -1
  641. package/dist/storage/connector-connections/provider.d.ts +1 -0
  642. package/dist/storage/connector-connections/provider.d.ts.map +1 -1
  643. package/dist/storage/connector-connections/provider.js +23 -7
  644. package/dist/storage/connector-connections/provider.js.map +6 -6
  645. package/dist/storage/connector-connections/types.d.ts +1 -1
  646. package/dist/storage/connector-connections/types.d.ts.map +1 -1
  647. package/dist/storage/dataset-ingest/codec.d.ts +6 -0
  648. package/dist/storage/dataset-ingest/codec.d.ts.map +1 -0
  649. package/dist/storage/dataset-ingest/in-memory.d.ts +28 -0
  650. package/dist/storage/dataset-ingest/in-memory.d.ts.map +1 -0
  651. package/dist/storage/dataset-ingest/index.d.ts +4 -0
  652. package/dist/storage/dataset-ingest/index.d.ts.map +1 -0
  653. package/dist/storage/dataset-ingest/provider.d.ts +157 -0
  654. package/dist/storage/dataset-ingest/provider.d.ts.map +1 -0
  655. package/dist/storage/dataset-ingest/provider.js +17 -0
  656. package/dist/storage/dataset-ingest/provider.js.map +9 -0
  657. package/dist/storage/dataset-ingest/types.d.ts +188 -0
  658. package/dist/storage/dataset-ingest/types.d.ts.map +1 -0
  659. package/dist/storage/file-upload-sessions/provider.js +12 -11
  660. package/dist/storage/file-upload-sessions/provider.js.map +1 -1
  661. package/dist/storage/in-memory/index.d.ts +12 -0
  662. package/dist/storage/in-memory/index.d.ts.map +1 -1
  663. package/dist/storage/index.d.ts +20 -13
  664. package/dist/storage/index.d.ts.map +1 -1
  665. package/dist/storage/index.js +61 -51
  666. package/dist/storage/index.js.map +1 -1
  667. package/dist/storage/internal.d.ts +4 -1
  668. package/dist/storage/internal.d.ts.map +1 -1
  669. package/dist/storage/internal.js +83 -7
  670. package/dist/storage/internal.js.map +4 -3
  671. package/dist/storage/lake-retention-runs/in-memory.d.ts +11 -0
  672. package/dist/storage/lake-retention-runs/in-memory.d.ts.map +1 -0
  673. package/dist/storage/lake-retention-runs/index.d.ts +3 -0
  674. package/dist/storage/lake-retention-runs/index.d.ts.map +1 -0
  675. package/dist/storage/lake-retention-runs/types.d.ts +21 -0
  676. package/dist/storage/lake-retention-runs/types.d.ts.map +1 -0
  677. package/dist/storage/maintenance-heartbeats/in-memory.d.ts +11 -0
  678. package/dist/storage/maintenance-heartbeats/in-memory.d.ts.map +1 -0
  679. package/dist/storage/maintenance-heartbeats/index.d.ts +3 -0
  680. package/dist/storage/maintenance-heartbeats/index.d.ts.map +1 -0
  681. package/dist/storage/maintenance-heartbeats/record.d.ts +11 -0
  682. package/dist/storage/maintenance-heartbeats/record.d.ts.map +1 -0
  683. package/dist/storage/maintenance-heartbeats/types.d.ts +30 -0
  684. package/dist/storage/maintenance-heartbeats/types.d.ts.map +1 -0
  685. package/dist/storage/migrations/types.d.ts +6 -0
  686. package/dist/storage/migrations/types.d.ts.map +1 -1
  687. package/dist/storage/objects/in-memory/query.d.ts.map +1 -1
  688. package/dist/storage/objects/in-memory/storage.d.ts +15 -1
  689. package/dist/storage/objects/in-memory/storage.d.ts.map +1 -1
  690. package/dist/storage/objects/index.d.ts +1 -1
  691. package/dist/storage/objects/index.d.ts.map +1 -1
  692. package/dist/storage/objects/query-preparation.d.ts +13 -0
  693. package/dist/storage/objects/query-preparation.d.ts.map +1 -1
  694. package/dist/storage/objects/read-scope.d.ts.map +1 -1
  695. package/dist/storage/objects/types.d.ts +70 -1
  696. package/dist/storage/objects/types.d.ts.map +1 -1
  697. package/dist/storage/ontology/in-memory/materializations.d.ts.map +1 -1
  698. package/dist/storage/ontology/in-memory/replacement-plans.d.ts.map +1 -1
  699. package/dist/storage/ontology/index.d.ts +1 -1
  700. package/dist/storage/ontology/index.d.ts.map +1 -1
  701. package/dist/storage/ontology/materializations.d.ts +20 -0
  702. package/dist/storage/ontology/materializations.d.ts.map +1 -1
  703. package/dist/storage/ontology/provider-work.d.ts +7 -1
  704. package/dist/storage/ontology/provider-work.d.ts.map +1 -1
  705. package/dist/storage/ontology/provider.js +1 -1
  706. package/dist/storage/pipeline-runs/in-memory.d.ts +8 -2
  707. package/dist/storage/pipeline-runs/in-memory.d.ts.map +1 -1
  708. package/dist/storage/pipeline-runs/index.d.ts +1 -1
  709. package/dist/storage/pipeline-runs/index.d.ts.map +1 -1
  710. package/dist/storage/pipeline-runs/provider.js +1 -1
  711. package/dist/storage/pipeline-runs/transitions.d.ts +2 -2
  712. package/dist/storage/pipeline-runs/transitions.d.ts.map +1 -1
  713. package/dist/storage/pipeline-runs/types.d.ts +26 -6
  714. package/dist/storage/pipeline-runs/types.d.ts.map +1 -1
  715. package/dist/storage/projection-runs/errors.d.ts +6 -0
  716. package/dist/storage/projection-runs/errors.d.ts.map +1 -1
  717. package/dist/storage/projection-runs/in-memory.d.ts +5 -1
  718. package/dist/storage/projection-runs/in-memory.d.ts.map +1 -1
  719. package/dist/storage/projection-runs/index.d.ts +2 -2
  720. package/dist/storage/projection-runs/index.d.ts.map +1 -1
  721. package/dist/storage/projection-runs/lifecycle.d.ts +1 -0
  722. package/dist/storage/projection-runs/lifecycle.d.ts.map +1 -1
  723. package/dist/storage/projection-runs/provider.js +2 -2
  724. package/dist/storage/projection-runs/types.d.ts +16 -0
  725. package/dist/storage/projection-runs/types.d.ts.map +1 -1
  726. package/dist/storage/run-claim.d.ts +132 -0
  727. package/dist/storage/run-claim.d.ts.map +1 -0
  728. package/dist/storage/share-grants/provider.js +3 -3
  729. package/dist/storage/share-sessions/in-memory.d.ts +2 -1
  730. package/dist/storage/share-sessions/in-memory.d.ts.map +1 -1
  731. package/dist/storage/share-sessions/index.d.ts +1 -1
  732. package/dist/storage/share-sessions/index.d.ts.map +1 -1
  733. package/dist/storage/share-sessions/provider.d.ts +1 -1
  734. package/dist/storage/share-sessions/provider.d.ts.map +1 -1
  735. package/dist/storage/share-sessions/provider.js +4 -2
  736. package/dist/storage/share-sessions/provider.js.map +1 -1
  737. package/dist/storage/share-sessions/record.d.ts +2 -1
  738. package/dist/storage/share-sessions/record.d.ts.map +1 -1
  739. package/dist/storage/share-sessions/types.d.ts +17 -1
  740. package/dist/storage/share-sessions/types.d.ts.map +1 -1
  741. package/dist/storage/sync-runs/in-memory.d.ts +10 -2
  742. package/dist/storage/sync-runs/in-memory.d.ts.map +1 -1
  743. package/dist/storage/sync-runs/index.d.ts +1 -1
  744. package/dist/storage/sync-runs/index.d.ts.map +1 -1
  745. package/dist/storage/sync-runs/transitions.d.ts +2 -2
  746. package/dist/storage/sync-runs/transitions.d.ts.map +1 -1
  747. package/dist/storage/sync-runs/types.d.ts +29 -3
  748. package/dist/storage/sync-runs/types.d.ts.map +1 -1
  749. package/dist/storage/types.d.ts +12 -6
  750. package/dist/storage/types.d.ts.map +1 -1
  751. package/dist/storage/webhook-runs/in-memory.d.ts +2 -1
  752. package/dist/storage/webhook-runs/in-memory.d.ts.map +1 -1
  753. package/dist/storage/webhook-runs/index.d.ts +2 -2
  754. package/dist/storage/webhook-runs/index.d.ts.map +1 -1
  755. package/dist/storage/webhook-runs/types.d.ts +33 -2
  756. package/dist/storage/webhook-runs/types.d.ts.map +1 -1
  757. package/dist/storage/workflow-runs/in-memory.d.ts +6 -3
  758. package/dist/storage/workflow-runs/in-memory.d.ts.map +1 -1
  759. package/dist/storage/workflow-runs/index.d.ts +1 -1
  760. package/dist/storage/workflow-runs/index.d.ts.map +1 -1
  761. package/dist/storage/workflow-runs/provider.js +12 -11
  762. package/dist/storage/workflow-runs/provider.js.map +1 -1
  763. package/dist/storage/workflow-runs/types.d.ts +11 -28
  764. package/dist/storage/workflow-runs/types.d.ts.map +1 -1
  765. package/dist/syncs/index.js +41 -38
  766. package/dist/syncs/index.js.map +1 -1
  767. package/dist/syncs/run-dispatch.d.ts +2 -0
  768. package/dist/syncs/run-dispatch.d.ts.map +1 -1
  769. package/dist/testing/agent-storage-contract.d.ts.map +1 -1
  770. package/dist/testing/ai-limit-storage-contract.d.ts.map +1 -1
  771. package/dist/testing/ai-model-call-groups-contract.d.ts.map +1 -1
  772. package/dist/testing/ai-usage-storage-contract.d.ts.map +1 -1
  773. package/dist/testing/artifact-holders-contract.d.ts +15 -0
  774. package/dist/testing/artifact-holders-contract.d.ts.map +1 -0
  775. package/dist/testing/artifact-storage-contract.d.ts.map +1 -1
  776. package/dist/testing/auth-storage-contract.d.ts.map +1 -1
  777. package/dist/testing/broker-contract.d.ts.map +1 -1
  778. package/dist/testing/connector-connection-storage-contract.d.ts +1 -1
  779. package/dist/testing/connector-connection-storage-contract.d.ts.map +1 -1
  780. package/dist/testing/dataset-ingest-storage-contract.d.ts +11 -0
  781. package/dist/testing/dataset-ingest-storage-contract.d.ts.map +1 -0
  782. package/dist/testing/dataset-sequence-contract.d.ts +1 -1
  783. package/dist/testing/dataset-sequence-contract.d.ts.map +1 -1
  784. package/dist/testing/execution.d.ts.map +1 -1
  785. package/dist/testing/index.d.ts +8 -0
  786. package/dist/testing/index.d.ts.map +1 -1
  787. package/dist/testing/index.js +6497 -3090
  788. package/dist/testing/index.js.map +32 -23
  789. package/dist/testing/lake-retention-run-storage-contract.d.ts +9 -0
  790. package/dist/testing/lake-retention-run-storage-contract.d.ts.map +1 -0
  791. package/dist/testing/maintenance-heartbeat-storage-contract.d.ts +9 -0
  792. package/dist/testing/maintenance-heartbeat-storage-contract.d.ts.map +1 -0
  793. package/dist/testing/object-conditional-read-scope-contract.d.ts.map +1 -1
  794. package/dist/testing/object-query-contract.d.ts.map +1 -1
  795. package/dist/testing/pipeline-execution.d.ts.map +1 -1
  796. package/dist/testing/pipeline-run-read-contract.d.ts +13 -0
  797. package/dist/testing/pipeline-run-read-contract.d.ts.map +1 -0
  798. package/dist/testing/projection-run-storage-contract.d.ts.map +1 -1
  799. package/dist/testing/queues-contract.d.ts.map +1 -1
  800. package/dist/testing/run-claim-storage-contract.d.ts +12 -0
  801. package/dist/testing/run-claim-storage-contract.d.ts.map +1 -0
  802. package/dist/testing/run-claim.d.ts +30 -0
  803. package/dist/testing/run-claim.d.ts.map +1 -0
  804. package/dist/testing/run-recovery-contract.d.ts +49 -0
  805. package/dist/testing/run-recovery-contract.d.ts.map +1 -0
  806. package/dist/testing/share-session-storage-contract.d.ts.map +1 -1
  807. package/dist/testing/stored-artifacts.d.ts +10 -0
  808. package/dist/testing/stored-artifacts.d.ts.map +1 -0
  809. package/dist/testing/sync-execution.d.ts.map +1 -1
  810. package/dist/testing/webhook-execution.d.ts +1 -1
  811. package/dist/testing/webhook-execution.d.ts.map +1 -1
  812. package/dist/testing/webhook-run-storage-contract.d.ts.map +1 -1
  813. package/dist/users/execution.d.ts +18 -1
  814. package/dist/users/execution.d.ts.map +1 -1
  815. package/dist/users/index.d.ts +1 -1
  816. package/dist/users/index.d.ts.map +1 -1
  817. package/dist/webhooks/delivery-lease.d.ts +13 -0
  818. package/dist/webhooks/delivery-lease.d.ts.map +1 -0
  819. package/dist/webhooks/internal.d.ts +2 -0
  820. package/dist/webhooks/internal.d.ts.map +1 -1
  821. package/dist/webhooks/internal.js +72 -40
  822. package/dist/webhooks/internal.js.map +5 -4
  823. package/dist/webhooks/run-admission.d.ts.map +1 -1
  824. package/dist/workers/index.d.ts +5 -1
  825. package/dist/workers/index.d.ts.map +1 -1
  826. package/dist/workers/index.js +193 -58
  827. package/dist/workers/index.js.map +8 -7
  828. package/dist/workers/job-ids.d.ts +17 -0
  829. package/dist/workers/job-ids.d.ts.map +1 -0
  830. package/dist/workers/lost-projection-runs.d.ts +26 -0
  831. package/dist/workers/lost-projection-runs.d.ts.map +1 -0
  832. package/dist/workers/lost-runs.d.ts +51 -0
  833. package/dist/workers/lost-runs.d.ts.map +1 -0
  834. package/dist/workers/queue-delivery.d.ts.map +1 -1
  835. package/dist/workers/queue-worker.d.ts +1 -2
  836. package/dist/workers/queue-worker.d.ts.map +1 -1
  837. package/dist/workers/queued-run-dispatch.d.ts +90 -0
  838. package/dist/workers/queued-run-dispatch.d.ts.map +1 -0
  839. package/dist/workers/run-lease.d.ts +25 -0
  840. package/dist/workers/run-lease.d.ts.map +1 -0
  841. package/dist/workers/run-worker.d.ts +95 -0
  842. package/dist/workers/run-worker.d.ts.map +1 -0
  843. package/dist/workflows/index.js +68 -62
  844. package/dist/workflows/index.js.map +1 -1
  845. package/dist/workflows/request.d.ts.map +1 -1
  846. package/dist/workflows/run-dispatch.d.ts +6 -1
  847. package/dist/workflows/run-dispatch.d.ts.map +1 -1
  848. package/package.json +41 -3
  849. package/src/actions/request.ts +24 -7
  850. package/src/actions/run/executor.ts +9 -42
  851. package/src/actions/types/context.ts +8 -3
  852. package/src/agents/README.md +2 -1
  853. package/src/agents/cancel.ts +7 -1
  854. package/src/agents/execution.ts +10 -2
  855. package/src/agents/fork.ts +12 -4
  856. package/src/agents/index.ts +16 -2
  857. package/src/agents/request.ts +42 -31
  858. package/src/agents/run-artifacts.ts +290 -46
  859. package/src/agents/run-plan.ts +31 -0
  860. package/src/agents/run-session-http.ts +19 -12
  861. package/src/agents/run-session-serve.ts +18 -2
  862. package/src/agents/run-session.ts +39 -12
  863. package/src/agents/skills.ts +3 -0
  864. package/src/agents/step-limits.ts +6 -0
  865. package/src/agents/streams/protocol.ts +14 -14
  866. package/src/agents/tool-files.ts +11 -3
  867. package/src/agents/validation.ts +12 -0
  868. package/src/agents/web.ts +218 -0
  869. package/src/artifacts/access.ts +71 -28
  870. package/src/artifacts/canvas-display.ts +160 -0
  871. package/src/artifacts/canvas.ts +26 -1
  872. package/src/artifacts/comment-text.ts +32 -0
  873. package/src/artifacts/comments.ts +275 -0
  874. package/src/artifacts/errors.ts +6 -1
  875. package/src/artifacts/events.ts +58 -0
  876. package/src/artifacts/execution.ts +496 -53
  877. package/src/artifacts/frames/assets.ts +20 -1
  878. package/src/artifacts/frames/grants.ts +31 -10
  879. package/src/artifacts/frames/index.ts +2 -0
  880. package/src/artifacts/frames/kit.ts +8 -5
  881. package/src/artifacts/frames/protocol.ts +149 -0
  882. package/src/artifacts/frames/runtime.ts +317 -29
  883. package/src/artifacts/holders.ts +120 -0
  884. package/src/artifacts/ids.ts +8 -0
  885. package/src/artifacts/index.ts +28 -2
  886. package/src/artifacts/limits.ts +28 -4
  887. package/src/artifacts/live/board.ts +759 -0
  888. package/src/artifacts/live/diff.ts +297 -0
  889. package/src/artifacts/live/document.ts +354 -0
  890. package/src/artifacts/live/files.ts +82 -0
  891. package/src/artifacts/live/index.ts +50 -0
  892. package/src/artifacts/live/presence.ts +144 -0
  893. package/src/artifacts/live/protocol.ts +134 -0
  894. package/src/artifacts/live/server.ts +16 -0
  895. package/src/artifacts/live/state.ts +115 -0
  896. package/src/artifacts/outline.ts +12 -0
  897. package/src/artifacts/publish/index.ts +26 -1
  898. package/src/artifacts/publish/merge.ts +271 -0
  899. package/src/artifacts/publish/previews.ts +485 -0
  900. package/src/artifacts/publish/publish.ts +92 -39
  901. package/src/artifacts/publish/query-answers.ts +85 -0
  902. package/src/artifacts/publish/references.ts +10 -4
  903. package/src/artifacts/publish/validate/canvas.ts +133 -1
  904. package/src/artifacts/theme.ts +9 -1
  905. package/src/auth/directory.ts +166 -0
  906. package/src/auth/member-events.ts +10 -3
  907. package/src/auth/runtime.ts +108 -8
  908. package/src/auth/strategy.ts +3 -1
  909. package/src/auth/types.ts +44 -0
  910. package/src/authorization/decision.ts +6 -5
  911. package/src/authorization/event-visibility.ts +4 -0
  912. package/src/authorization/resolve.ts +9 -11
  913. package/src/authorization/types.ts +5 -5
  914. package/src/broker/in-memory.ts +33 -6
  915. package/src/broker/types.ts +4 -0
  916. package/src/connectors/builders.ts +34 -2
  917. package/src/connectors/connections/access.ts +83 -0
  918. package/src/connectors/connections/contracts.ts +6 -1
  919. package/src/connectors/connections/execution.ts +2 -2
  920. package/src/connectors/connections/runs.ts +93 -7
  921. package/src/connectors/connections/service.ts +208 -41
  922. package/src/connectors/connections/views.ts +11 -4
  923. package/src/connectors/execution.ts +27 -3
  924. package/src/connectors/index.ts +2 -0
  925. package/src/connectors/service.ts +12 -0
  926. package/src/connectors/types.ts +37 -2
  927. package/src/datasets/execution.ts +74 -37
  928. package/src/datasets/ingest-flush-batch.ts +289 -0
  929. package/src/datasets/ingest-flush-job.ts +112 -0
  930. package/src/datasets/ingest-flush.ts +377 -0
  931. package/src/datasets/produced-version.ts +55 -0
  932. package/src/datasets/write.ts +65 -11
  933. package/src/deploy/services.ts +1 -1
  934. package/src/deploy/types.ts +2 -3
  935. package/src/deploy/validation.ts +1 -0
  936. package/src/error-reporting/capability.ts +66 -0
  937. package/src/error-reporting/internal.ts +12 -0
  938. package/src/error-reporting/reporter.ts +11 -35
  939. package/src/error-reporting/reports.ts +167 -0
  940. package/src/error-reporting/types.ts +99 -0
  941. package/src/errors/catalog.ts +6 -0
  942. package/src/events/definitions.ts +14 -0
  943. package/src/events/execution.ts +77 -28
  944. package/src/events/index.ts +3 -0
  945. package/src/events/scope.ts +2 -0
  946. package/src/events/types/artifacts.ts +40 -0
  947. package/src/events/types/index.ts +3 -0
  948. package/src/events/types/users.ts +5 -2
  949. package/src/execution/authorized-object-reader.ts +34 -0
  950. package/src/execution/object-reader-clearance.ts +31 -0
  951. package/src/execution/object-reader-security.ts +37 -22
  952. package/src/http/api-routes.ts +105 -4
  953. package/src/index.ts +24 -4
  954. package/src/lake-storage/errors.ts +21 -0
  955. package/src/lake-storage/index.ts +9 -1
  956. package/src/lake-storage/maintenance.ts +93 -0
  957. package/src/lake-storage/merge.ts +3 -1
  958. package/src/lake-storage/source-ordering.ts +28 -2
  959. package/src/lake-storage/types.ts +14 -0
  960. package/src/maintenance/heartbeat.ts +14 -0
  961. package/src/maintenance/index.ts +5 -3
  962. package/src/maintenance/lake-retention-status.ts +81 -0
  963. package/src/maintenance/lake-retention.ts +347 -0
  964. package/src/maintenance/loop.ts +365 -0
  965. package/src/maintenance/ontology-maintenance.ts +76 -229
  966. package/src/maintenance/passes/cron-pass.ts +217 -0
  967. package/src/maintenance/passes/directory-pass.ts +22 -0
  968. package/src/maintenance/passes/ingest-pass.ts +94 -0
  969. package/src/maintenance/passes/lake-change-feed.ts +112 -0
  970. package/src/maintenance/passes/lake-retention-pass.ts +71 -0
  971. package/src/maintenance/passes/ontology-pass.ts +19 -0
  972. package/src/maintenance/passes/projections-pass.ts +238 -0
  973. package/src/maintenance/passes/recovery-pass.ts +17 -0
  974. package/src/maintenance/passes/recovery-passes.ts +39 -0
  975. package/src/maintenance/passes/runs-pass.ts +12 -0
  976. package/src/maintenance/passes/triggers-pass.ts +332 -0
  977. package/src/maintenance/status.ts +75 -0
  978. package/src/maintenance/types.ts +27 -25
  979. package/src/materialization/model.ts +33 -21
  980. package/src/materializer/README.md +13 -2
  981. package/src/materializer/edits/artifact-refs.ts +140 -0
  982. package/src/materializer/edits/commit.ts +20 -7
  983. package/src/materializer/edits/operations.ts +23 -7
  984. package/src/materializer/edits/plan.ts +2 -0
  985. package/src/materializer/execution/work-records.ts +61 -0
  986. package/src/materializer/projections/replacement-plan.ts +2 -0
  987. package/src/materializer/shared/normalize.ts +14 -0
  988. package/src/materializer/telemetry/plan.ts +2 -0
  989. package/src/models/catalog.ts +52 -3
  990. package/src/models/definitions.ts +2 -0
  991. package/src/models/execution/README.md +22 -2
  992. package/src/models/execution/model-call-recorder.ts +1 -1
  993. package/src/models/execution/web-search.ts +186 -0
  994. package/src/models/index.ts +12 -0
  995. package/src/models/language-model.ts +12 -0
  996. package/src/models/web-search-model.ts +152 -0
  997. package/src/objects/artifact-refs.ts +34 -0
  998. package/src/objects/materializer-adapter.ts +8 -3
  999. package/src/objects/object/upsert-batch.ts +7 -0
  1000. package/src/objects/object/upsert.ts +11 -2
  1001. package/src/objects/query/executor.ts +7 -3
  1002. package/src/objects/query/index.ts +1 -0
  1003. package/src/objects/query/ir.ts +2 -0
  1004. package/src/objects/query/scalar-values.ts +5 -3
  1005. package/src/objects/query/sort-ties.ts +16 -0
  1006. package/src/objects/runtime-batch.ts +8 -1
  1007. package/src/objects/vectors/README.md +4 -4
  1008. package/src/ontology/artifact-ref.ts +83 -0
  1009. package/src/ontology/docs-markdown.ts +17 -0
  1010. package/src/ontology/index.ts +3 -1
  1011. package/src/ontology/inference/index.ts +2 -0
  1012. package/src/ontology/json-schema.ts +13 -0
  1013. package/src/ontology/primitives.ts +14 -0
  1014. package/src/ontology/reference-values.ts +62 -0
  1015. package/src/ontology/refs.ts +7 -1
  1016. package/src/ontology/registry.ts +26 -1
  1017. package/src/ontology/types.ts +2 -0
  1018. package/src/ontology/user-ref.ts +35 -45
  1019. package/src/ontology/validation/normalize.ts +13 -0
  1020. package/src/ontology/validation/properties.ts +9 -0
  1021. package/src/ontology/validation/schema.ts +12 -0
  1022. package/src/pending-tasks.ts +51 -0
  1023. package/src/pipelines/run-dispatch.ts +120 -238
  1024. package/src/predicates/types.ts +2 -1
  1025. package/src/projections/builders.ts +28 -13
  1026. package/src/projections/run-dispatch.ts +1 -1
  1027. package/src/projections/types.ts +1 -1
  1028. package/src/projections/validation.ts +22 -8
  1029. package/src/queues/in-memory.ts +50 -3
  1030. package/src/queues/index.ts +4 -0
  1031. package/src/queues/types.ts +68 -1
  1032. package/src/runtime/create.ts +7 -2
  1033. package/src/runtime/host.ts +118 -13
  1034. package/src/runtime/index.ts +0 -1
  1035. package/src/runtime/internal.ts +13 -0
  1036. package/src/runtime/ontology-mutations.ts +1 -1
  1037. package/src/runtime/resolve-definitions.ts +4 -0
  1038. package/src/runtime/sixb.ts +14 -5
  1039. package/src/scheduler/index.ts +0 -2
  1040. package/src/security/index.ts +1 -0
  1041. package/src/security/registry.ts +2 -0
  1042. package/src/security/view-conditions.ts +4 -3
  1043. package/src/security/visibility-keys.ts +144 -0
  1044. package/src/shared/backoff.ts +34 -0
  1045. package/src/shared/duration.ts +15 -0
  1046. package/src/shared/params/artifact-refs.ts +42 -0
  1047. package/src/shares/compiler.ts +1 -1
  1048. package/src/shares/guest-name.ts +20 -0
  1049. package/src/shares/internal.ts +1 -0
  1050. package/src/shares/session-protocol.ts +63 -0
  1051. package/src/storage/agents/in-memory.ts +29 -2
  1052. package/src/storage/agents/index.ts +2 -0
  1053. package/src/storage/agents/provider.ts +57 -1
  1054. package/src/storage/agents/types.ts +45 -2
  1055. package/src/storage/artifacts/errors.ts +10 -2
  1056. package/src/storage/artifacts/in-memory.ts +579 -96
  1057. package/src/storage/artifacts/index.ts +22 -1
  1058. package/src/storage/artifacts/record.ts +255 -11
  1059. package/src/storage/artifacts/types.ts +343 -40
  1060. package/src/storage/auth/in-memory/auth-storage.ts +42 -5
  1061. package/src/storage/auth/in-memory/identities.ts +16 -0
  1062. package/src/storage/auth/in-memory/shared.ts +15 -0
  1063. package/src/storage/auth/in-memory/users.ts +17 -16
  1064. package/src/storage/auth/index.ts +3 -0
  1065. package/src/storage/auth/types.ts +38 -0
  1066. package/src/storage/connector-connections/in-memory.ts +6 -3
  1067. package/src/storage/connector-connections/index.ts +1 -0
  1068. package/src/storage/connector-connections/provider/connections.ts +2 -2
  1069. package/src/storage/connector-connections/provider/runs.ts +3 -0
  1070. package/src/storage/connector-connections/provider/shared.ts +30 -0
  1071. package/src/storage/connector-connections/provider.ts +4 -0
  1072. package/src/storage/connector-connections/types.ts +1 -0
  1073. package/src/storage/dataset-ingest/codec.ts +90 -0
  1074. package/src/storage/dataset-ingest/in-memory.ts +277 -0
  1075. package/src/storage/dataset-ingest/index.ts +16 -0
  1076. package/src/storage/dataset-ingest/provider.ts +592 -0
  1077. package/src/storage/dataset-ingest/types.ts +191 -0
  1078. package/src/storage/in-memory/index.ts +33 -0
  1079. package/src/storage/index.ts +69 -5
  1080. package/src/storage/internal.ts +20 -0
  1081. package/src/storage/lake-retention-runs/in-memory.ts +22 -0
  1082. package/src/storage/lake-retention-runs/index.ts +2 -0
  1083. package/src/storage/lake-retention-runs/types.ts +19 -0
  1084. package/src/storage/maintenance-heartbeats/in-memory.ts +24 -0
  1085. package/src/storage/maintenance-heartbeats/index.ts +7 -0
  1086. package/src/storage/maintenance-heartbeats/record.ts +50 -0
  1087. package/src/storage/maintenance-heartbeats/types.ts +30 -0
  1088. package/src/storage/migrations/types.ts +6 -0
  1089. package/src/storage/objects/in-memory/query.ts +6 -2
  1090. package/src/storage/objects/in-memory/storage.ts +81 -0
  1091. package/src/storage/objects/index.ts +2 -0
  1092. package/src/storage/objects/query-preparation.ts +59 -1
  1093. package/src/storage/objects/read-scope.ts +109 -2
  1094. package/src/storage/objects/types.ts +59 -1
  1095. package/src/storage/ontology/in-memory/materializations.ts +8 -0
  1096. package/src/storage/ontology/in-memory/replacement-plans.ts +4 -1
  1097. package/src/storage/ontology/index.ts +2 -0
  1098. package/src/storage/ontology/materializations.ts +18 -0
  1099. package/src/storage/ontology/provider-work.ts +39 -0
  1100. package/src/storage/pipeline-runs/in-memory.ts +97 -24
  1101. package/src/storage/pipeline-runs/index.ts +0 -1
  1102. package/src/storage/pipeline-runs/provider.ts +1 -1
  1103. package/src/storage/pipeline-runs/transitions.ts +7 -4
  1104. package/src/storage/pipeline-runs/types.ts +33 -7
  1105. package/src/storage/projection-runs/errors.ts +10 -0
  1106. package/src/storage/projection-runs/in-memory.ts +56 -1
  1107. package/src/storage/projection-runs/index.ts +2 -1
  1108. package/src/storage/projection-runs/lifecycle.ts +9 -1
  1109. package/src/storage/projection-runs/types.ts +20 -1
  1110. package/src/storage/run-claim.ts +224 -0
  1111. package/src/storage/share-sessions/in-memory.ts +21 -0
  1112. package/src/storage/share-sessions/index.ts +1 -0
  1113. package/src/storage/share-sessions/provider.ts +1 -0
  1114. package/src/storage/share-sessions/record.ts +28 -0
  1115. package/src/storage/share-sessions/types.ts +19 -1
  1116. package/src/storage/sync-runs/in-memory.ts +109 -29
  1117. package/src/storage/sync-runs/index.ts +1 -1
  1118. package/src/storage/sync-runs/transitions.ts +7 -4
  1119. package/src/storage/sync-runs/types.ts +36 -3
  1120. package/src/storage/types.ts +15 -5
  1121. package/src/storage/webhook-runs/in-memory.ts +26 -2
  1122. package/src/storage/webhook-runs/index.ts +3 -1
  1123. package/src/storage/webhook-runs/types.ts +44 -3
  1124. package/src/storage/workflow-runs/in-memory.ts +50 -36
  1125. package/src/storage/workflow-runs/index.ts +0 -2
  1126. package/src/storage/workflow-runs/types.ts +18 -30
  1127. package/src/syncs/run-dispatch.ts +118 -239
  1128. package/src/testing/agent-storage-contract.ts +70 -0
  1129. package/src/testing/ai-limit-storage-contract.ts +11 -1
  1130. package/src/testing/ai-model-call-groups-contract.ts +2 -1
  1131. package/src/testing/ai-usage-storage-contract.ts +15 -2
  1132. package/src/testing/artifact-holders-contract.ts +392 -0
  1133. package/src/testing/artifact-storage-contract.ts +1205 -151
  1134. package/src/testing/auth-storage-contract.ts +228 -1
  1135. package/src/testing/broker-contract.ts +56 -0
  1136. package/src/testing/connector-connection-storage-contract.ts +117 -5
  1137. package/src/testing/dataset-ingest-storage-contract.ts +480 -0
  1138. package/src/testing/dataset-sequence-contract.ts +97 -12
  1139. package/src/testing/execution.ts +23 -0
  1140. package/src/testing/index.ts +31 -0
  1141. package/src/testing/lake-retention-run-storage-contract.ts +75 -0
  1142. package/src/testing/maintenance-heartbeat-storage-contract.ts +99 -0
  1143. package/src/testing/object-conditional-read-scope-contract.ts +267 -5
  1144. package/src/testing/object-query-contract.ts +168 -0
  1145. package/src/testing/pipeline-execution.ts +3 -1
  1146. package/src/testing/pipeline-run-read-contract.ts +123 -0
  1147. package/src/testing/projection-run-storage-contract.ts +113 -0
  1148. package/src/testing/queues-contract.ts +112 -0
  1149. package/src/testing/run-claim-storage-contract.ts +736 -0
  1150. package/src/testing/run-claim.ts +69 -0
  1151. package/src/testing/run-recovery-contract.ts +176 -0
  1152. package/src/testing/share-session-storage-contract.ts +43 -0
  1153. package/src/testing/stored-artifacts.ts +43 -0
  1154. package/src/testing/sync-execution.ts +3 -1
  1155. package/src/testing/webhook-execution.ts +7 -2
  1156. package/src/testing/webhook-run-storage-contract.ts +102 -5
  1157. package/src/users/execution.ts +50 -2
  1158. package/src/users/index.ts +1 -0
  1159. package/src/webhooks/delivery-lease.ts +40 -0
  1160. package/src/webhooks/internal.ts +2 -0
  1161. package/src/webhooks/run-admission.ts +22 -9
  1162. package/src/workers/README.md +169 -0
  1163. package/src/workers/index.ts +9 -1
  1164. package/src/workers/job-ids.ts +31 -0
  1165. package/src/workers/lost-projection-runs.ts +114 -0
  1166. package/src/workers/lost-runs.ts +397 -0
  1167. package/src/workers/queue-delivery.ts +2 -14
  1168. package/src/workers/queue-worker.ts +9 -17
  1169. package/src/workers/queued-run-dispatch.ts +308 -0
  1170. package/src/workers/run-lease.ts +46 -0
  1171. package/src/workers/run-worker.ts +312 -0
  1172. package/src/workers/worker.ts +4 -17
  1173. package/src/workflows/request.ts +2 -0
  1174. package/src/workflows/run-dispatch.ts +22 -4
  1175. package/src/workflows/snapshot.ts +1 -0
  1176. package/dist/chunk-2g0r46hy.js.map +0 -12
  1177. package/dist/chunk-3fqxbn31.js +0 -107
  1178. package/dist/chunk-3fqxbn31.js.map +0 -11
  1179. package/dist/chunk-3x3bebz7.js.map +0 -49
  1180. package/dist/chunk-5kyvrtjh.js.map +0 -12
  1181. package/dist/chunk-5taem5aw.js.map +0 -10
  1182. package/dist/chunk-65abf64x.js +0 -13
  1183. package/dist/chunk-65abf64x.js.map +0 -10
  1184. package/dist/chunk-9x8dybsb.js.map +0 -10
  1185. package/dist/chunk-aqyjb86c.js +0 -587
  1186. package/dist/chunk-aqyjb86c.js.map +0 -18
  1187. package/dist/chunk-az47zep4.js +0 -41
  1188. package/dist/chunk-az47zep4.js.map +0 -10
  1189. package/dist/chunk-cb21tx14.js.map +0 -71
  1190. package/dist/chunk-djs3hw9p.js.map +0 -20
  1191. package/dist/chunk-e5wf5vz0.js.map +0 -10
  1192. package/dist/chunk-e6xgz4h4.js.map +0 -21
  1193. package/dist/chunk-e7v3trpz.js.map +0 -10
  1194. package/dist/chunk-edx8xcsm.js.map +0 -13
  1195. package/dist/chunk-epyfm23v.js +0 -299
  1196. package/dist/chunk-epyfm23v.js.map +0 -11
  1197. package/dist/chunk-fb3feg1e.js +0 -298
  1198. package/dist/chunk-fb3feg1e.js.map +0 -12
  1199. package/dist/chunk-fg1db9xx.js.map +0 -10
  1200. package/dist/chunk-h05rg3bx.js +0 -314
  1201. package/dist/chunk-h05rg3bx.js.map +0 -12
  1202. package/dist/chunk-hz5d43gn.js.map +0 -10
  1203. package/dist/chunk-jbw70d6t.js.map +0 -10
  1204. package/dist/chunk-jftd33rc.js.map +0 -11
  1205. package/dist/chunk-jk97v21j.js.map +0 -10
  1206. package/dist/chunk-jspskey0.js.map +0 -10
  1207. package/dist/chunk-kfee1h52.js.map +0 -13
  1208. package/dist/chunk-ks87m383.js.map +0 -44
  1209. package/dist/chunk-kwfhd1g0.js +0 -144
  1210. package/dist/chunk-kwfhd1g0.js.map +0 -13
  1211. package/dist/chunk-nz7815t3.js.map +0 -14
  1212. package/dist/chunk-ratj7t3t.js.map +0 -45
  1213. package/dist/chunk-s3we74h8.js.map +0 -12
  1214. package/dist/chunk-scyq22td.js.map +0 -12
  1215. package/dist/chunk-t9xyr7y9.js.map +0 -22
  1216. package/dist/chunk-tvbmh7tj.js.map +0 -18
  1217. package/dist/chunk-tvefbgvw.js.map +0 -11
  1218. package/dist/chunk-w976a4me.js.map +0 -10
  1219. package/dist/chunk-yw9pyg66.js +0 -143
  1220. package/dist/chunk-yw9pyg66.js.map +0 -11
  1221. package/dist/chunk-z8fx5cgb.js.map +0 -11
  1222. package/dist/scheduler/runtime.d.ts +0 -40
  1223. package/dist/scheduler/runtime.d.ts.map +0 -1
  1224. package/dist/workers/unstarted-run.d.ts +0 -10
  1225. package/dist/workers/unstarted-run.d.ts.map +0 -1
  1226. package/src/scheduler/runtime.ts +0 -214
  1227. package/src/workers/unstarted-run.ts +0 -18
  1228. /package/dist/{chunk-2pk5hjj9.js.map → chunk-186k5yz3.js.map} +0 -0
  1229. /package/dist/{chunk-nghc7eq0.js.map → chunk-3723kgba.js.map} +0 -0
  1230. /package/dist/{chunk-ytzcxtpt.js.map → chunk-3ba89vm7.js.map} +0 -0
  1231. /package/dist/{chunk-qsg8rw04.js.map → chunk-5qqmndhm.js.map} +0 -0
  1232. /package/dist/{chunk-8wsjr52f.js.map → chunk-7qe46788.js.map} +0 -0
  1233. /package/dist/{chunk-23s66j86.js.map → chunk-855w9nvw.js.map} +0 -0
  1234. /package/dist/{chunk-qbrmpgvv.js.map → chunk-8tqnsx3q.js.map} +0 -0
  1235. /package/dist/{chunk-s038wa5v.js.map → chunk-b9qfh2ya.js.map} +0 -0
  1236. /package/dist/{chunk-7hd2ez3q.js.map → chunk-c4nrycdy.js.map} +0 -0
  1237. /package/dist/{chunk-jjmggm9a.js.map → chunk-fe6r7yhg.js.map} +0 -0
  1238. /package/dist/{chunk-165c9wm6.js.map → chunk-g2ph4873.js.map} +0 -0
  1239. /package/dist/{chunk-jhbk10wf.js.map → chunk-q9nkpr8k.js.map} +0 -0
  1240. /package/dist/{chunk-4zm1k3xj.js.map → chunk-r2psmn42.js.map} +0 -0
  1241. /package/dist/{chunk-r1cxq7vv.js.map → chunk-rtdrm592.js.map} +0 -0
  1242. /package/dist/{chunk-m3qe54bb.js.map → chunk-smnt672s.js.map} +0 -0
  1243. /package/dist/{chunk-21q0j5f2.js.map → chunk-stmxh0hv.js.map} +0 -0
  1244. /package/dist/{chunk-ff5xkv0p.js.map → chunk-tfzvjdms.js.map} +0 -0
  1245. /package/dist/{chunk-6b61s40c.js.map → chunk-w3t94hm6.js.map} +0 -0
  1246. /package/dist/{chunk-agn8d8ys.js.map → chunk-xtztwpkh.js.map} +0 -0
  1247. /package/dist/{chunk-0g5nyx0k.js.map → chunk-zeykm8my.js.map} +0 -0
@@ -0,0 +1,1363 @@
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 root = document.documentElement;
722
+ const script = document.currentScript;
723
+ const deck = script?.getAttribute("data-sixb-layout") !== "page";
724
+ const start = new URLSearchParams(window.location.hash.slice(1));
725
+ if (deck) {
726
+ root.classList.add("sixb-deck");
727
+ root.dataset.mode = start.has("sixb-fill") ? "fill" : "slide";
728
+ }
729
+ let current = Number(start.get("sixb-slide")) || 1;
730
+ const slides = () => Array.from(document.querySelectorAll("section.slide"));
731
+ const post = (message) => window.parent.postMessage({ protocol: PROTOCOL, ...message }, "*");
732
+ const webAddress = (href) => {
733
+ try {
734
+ const url = new URL(href, document.baseURI);
735
+ return url.protocol === "http:" || url.protocol === "https:" ? url.href : null;
736
+ } catch {
737
+ return null;
738
+ }
739
+ };
740
+ const fit = () => {
741
+ const columns = window.innerWidth < 720 ? 2 : window.innerWidth < 1100 ? 3 : 4;
742
+ const gap = 16;
743
+ const margin = root.dataset.mode === "fill" || root.dataset.mode === "present" ? 0 : Math.min(32, window.innerWidth * 0.04);
744
+ root.style.setProperty("--sixb-scale", String(Math.min((window.innerWidth - margin * 2) / WIDTH, (window.innerHeight - margin * 2) / HEIGHT)));
745
+ root.style.setProperty("--sixb-columns", String(columns));
746
+ root.style.setProperty("--sixb-overview-scale", String((window.innerWidth - gap * (columns + 1)) / columns / WIDTH));
747
+ };
748
+ let reported = "";
749
+ let reporting = false;
750
+ const ids = new WeakMap;
751
+ let lastId = 0;
752
+ const idOf = (element) => {
753
+ const known = ids.get(element);
754
+ if (known !== undefined)
755
+ return known;
756
+ lastId += 1;
757
+ ids.set(element, lastId);
758
+ return lastId;
759
+ };
760
+ const reportEmbeds = () => {
761
+ if (reporting || root.dataset.mode === "fill")
762
+ return;
763
+ reporting = true;
764
+ requestAnimationFrame(() => {
765
+ reporting = false;
766
+ const scale = deck ? Number(root.style.getPropertyValue("--sixb-scale")) || 1 : 1;
767
+ const scope = deck ? root.dataset.mode === "overview" ? undefined : slides()[current - 1] : document;
768
+ const near = (rect) => deck || rect.bottom > -window.innerHeight && rect.top < window.innerHeight * 2;
769
+ const embeds = Array.from(scope?.querySelectorAll("sixb-embed[src]") ?? []).flatMap((element) => {
770
+ const id = idOf(element);
771
+ const rect = element.getBoundingClientRect();
772
+ return near(rect) ? [
773
+ {
774
+ id,
775
+ address: (element.getAttribute("src") ?? "").trim(),
776
+ rect: { x: rect.left, y: rect.top, width: rect.width, height: rect.height },
777
+ scale
778
+ }
779
+ ] : [];
780
+ });
781
+ const next = JSON.stringify(embeds);
782
+ if (next === reported)
783
+ return;
784
+ reported = next;
785
+ post({ event: "embeds", params: { embeds } });
786
+ });
787
+ };
788
+ let height = -1;
789
+ const reportSize = () => {
790
+ const body = document.body;
791
+ if (deck || !body)
792
+ return;
793
+ const style = getComputedStyle(body);
794
+ const next = Math.ceil(Math.max(body.scrollHeight, body.getBoundingClientRect().height) + (Number.parseFloat(style.marginTop) || 0) + (Number.parseFloat(style.marginBottom) || 0));
795
+ if (next === height)
796
+ return;
797
+ height = next;
798
+ post({ event: "size", params: { height } });
799
+ };
800
+ const show = (slide) => {
801
+ const all = slides();
802
+ current = Math.min(Math.max(1, Math.round(slide) || 1), Math.max(1, all.length));
803
+ all.forEach((element, index) => {
804
+ element.toggleAttribute("data-current", index + 1 === current);
805
+ });
806
+ if (root.dataset.mode === "overview") {
807
+ all[current - 1]?.scrollIntoView({ block: "nearest" });
808
+ }
809
+ reportEmbeds();
810
+ };
811
+ const portPost = typeof MessagePort === "function" ? MessagePort.prototype.postMessage : undefined;
812
+ const apply = Reflect.apply;
813
+ let editPort = null;
814
+ const postEdit = (message) => {
815
+ if (editPort && portPost)
816
+ apply(portPost, editPort, [{ protocol: PROTOCOL, ...message }]);
817
+ };
818
+ let editing = false;
819
+ let typable = true;
820
+ let pointed = null;
821
+ let picked = null;
822
+ let typing = null;
823
+ let held = null;
824
+ let typedFrom = "";
825
+ const wordsHash = (text) => {
826
+ let hash = 2166136261;
827
+ for (let index = 0;index < text.length; index += 1) {
828
+ hash ^= text.charCodeAt(index);
829
+ hash = Math.imul(hash, 16777619) >>> 0;
830
+ }
831
+ return hash.toString(16);
832
+ };
833
+ const spokenWords = (element) => {
834
+ const copy = element.cloneNode(true);
835
+ if (!(copy instanceof Element))
836
+ return element.textContent ?? "";
837
+ for (const lineBreak of Array.from(copy.querySelectorAll("br")))
838
+ lineBreak.replaceWith(" ");
839
+ for (const code of Array.from(copy.querySelectorAll("script, style, template")))
840
+ code.remove();
841
+ return copy.textContent ?? "";
842
+ };
843
+ const commentable = (element, node) => element ?? (!typable && node instanceof Element && node !== root && node !== document.body ? node : null);
844
+ const editTarget = (node) => {
845
+ const start = node instanceof Element ? node : null;
846
+ const element = start?.closest(`[${AT}]`) ?? null;
847
+ const box = (start ?? element)?.getBoundingClientRect();
848
+ const rect = {
849
+ x: box?.left ?? 0,
850
+ y: box?.top ?? 0,
851
+ width: box?.width ?? 0,
852
+ height: box?.height ?? 0
853
+ };
854
+ const kind = element?.getAttribute(KIND) ?? "";
855
+ const shown = start && start !== root && start !== document.body ? spokenWords(start).replace(/\s+/g, " ").trim() : "";
856
+ const scripted = {
857
+ address: null,
858
+ kind: "scripted",
859
+ within: element?.getAttribute(AT) ?? null,
860
+ ...shown ? { label: shown.slice(0, MAX_EDIT_LABEL) } : {},
861
+ rect
862
+ };
863
+ if (!element)
864
+ return { element: null, target: scripted };
865
+ if (element !== start && kind !== "text" && kind !== "whole") {
866
+ return { element: null, target: scripted };
867
+ }
868
+ const words = element.textContent ?? "";
869
+ if (kind === "text" && wordsHash(words) !== element.getAttribute(WORDS)) {
870
+ return { element: null, target: { ...scripted, within: element.getAttribute(AT) } };
871
+ }
872
+ const own = element.getBoundingClientRect();
873
+ const label = (kind === "image" ? element.getAttribute("alt") ?? "" : spokenWords(element)).replace(/\s+/g, " ").trim().slice(0, MAX_EDIT_LABEL);
874
+ return {
875
+ element,
876
+ target: {
877
+ address: element.getAttribute(AT),
878
+ kind,
879
+ label,
880
+ rect: { x: own.left, y: own.top, width: own.width, height: own.height }
881
+ }
882
+ };
883
+ };
884
+ const mark = (attribute, previous, next) => {
885
+ previous?.removeAttribute(attribute);
886
+ next?.setAttribute(attribute, "");
887
+ return next;
888
+ };
889
+ const stopTyping = () => {
890
+ const element = typing;
891
+ if (!element)
892
+ return;
893
+ typing = null;
894
+ element.removeAttribute("contenteditable");
895
+ const patch = held;
896
+ held = null;
897
+ if (patch)
898
+ applyPatch(element, patch);
899
+ };
900
+ const applyPatch = (element, patch) => {
901
+ const attributes = patch.attributes;
902
+ if (attributes && typeof attributes === "object") {
903
+ const next = attributes;
904
+ for (const name of element.getAttributeNames()) {
905
+ if (!(name in next) && !name.startsWith("data-sixb-"))
906
+ element.removeAttribute(name);
907
+ }
908
+ for (const [name, value] of Object.entries(next)) {
909
+ if (typeof value === "string" && /^[a-z_:][a-z0-9_.:-]*$/i.test(name)) {
910
+ element.setAttribute(name, value);
911
+ }
912
+ }
913
+ }
914
+ if (typeof patch.html === "string")
915
+ element.innerHTML = patch.html;
916
+ };
917
+ const startEditing = (on, typingAllowed) => {
918
+ editing = on;
919
+ typable = typingAllowed;
920
+ if (!typable)
921
+ stopTyping();
922
+ root.toggleAttribute("data-sixb-editing", on);
923
+ root.toggleAttribute("data-sixb-commenting", on && !typable);
924
+ if (on && !document.getElementById("sixb-editing")) {
925
+ const style = document.createElement("style");
926
+ style.id = "sixb-editing";
927
+ style.textContent = EDITING_CSS;
928
+ document.head.append(style);
929
+ }
930
+ if (!on) {
931
+ stopTyping();
932
+ pointed = mark("data-sixb-hover", pointed, null);
933
+ picked = mark("data-sixb-picked", picked, null);
934
+ }
935
+ };
936
+ window.addEventListener("click", (event) => {
937
+ if (!editing || !event.isTrusted)
938
+ return;
939
+ if (typing?.contains(event.target))
940
+ return;
941
+ event.preventDefault();
942
+ event.stopPropagation();
943
+ stopTyping();
944
+ const { element, target } = editTarget(event.target);
945
+ picked = mark("data-sixb-picked", picked, commentable(element, event.target));
946
+ const at = { x: event.clientX, y: event.clientY };
947
+ postEdit({ event: "edit.select", params: { target, at } });
948
+ if (typable && element instanceof HTMLElement && target.kind === "text") {
949
+ typing = element;
950
+ typedFrom = element.textContent ?? "";
951
+ element.setAttribute("contenteditable", "plaintext-only");
952
+ element.focus();
953
+ }
954
+ }, true);
955
+ document.addEventListener("mouseover", (event) => {
956
+ if (!editing || !event.isTrusted)
957
+ return;
958
+ const { element, target } = editTarget(event.target);
959
+ const shown = commentable(element, event.target);
960
+ if (shown === pointed && shown !== null)
961
+ return;
962
+ pointed = mark("data-sixb-hover", pointed, shown);
963
+ postEdit({ event: "edit.hover", params: { target } });
964
+ });
965
+ document.addEventListener("mouseout", (event) => {
966
+ if (!editing || !event.isTrusted || event.relatedTarget !== null || pointed === null)
967
+ return;
968
+ pointed = mark("data-sixb-hover", pointed, null);
969
+ postEdit({ event: "edit.hover", params: { target: null } });
970
+ });
971
+ document.addEventListener("input", (event) => {
972
+ if (!editing || !event.isTrusted || !typing || !typing.contains(event.target)) {
973
+ return;
974
+ }
975
+ const text = typing.textContent ?? "";
976
+ typing.setAttribute(WORDS, wordsHash(text));
977
+ postEdit({
978
+ event: "edit.text",
979
+ params: { address: typing.getAttribute(AT), base: typedFrom, text }
980
+ });
981
+ typedFrom = text;
982
+ });
983
+ window.addEventListener("keydown", (event) => {
984
+ if (!typing || !event.isTrusted)
985
+ return;
986
+ if (event.key === "Enter")
987
+ event.preventDefault();
988
+ if (event.key === "Escape")
989
+ typing.blur();
990
+ event.stopPropagation();
991
+ }, true);
992
+ document.addEventListener("focusout", (event) => {
993
+ if (typing && event.target === typing)
994
+ stopTyping();
995
+ });
996
+ const handle = (method, params) => {
997
+ switch (method) {
998
+ case "theme": {
999
+ const tokens = params.tokens ?? {};
1000
+ const declarations = Object.entries(tokens).filter(([name, value]) => /^--[a-z0-9-]+$/.test(name) && typeof value === "string" && !/[;{}<]/.test(value)).map(([name, value]) => `${name}: ${value};`);
1001
+ for (const [stage, token] of [
1002
+ ["--sixb-stage", "--muted"],
1003
+ ["--sixb-stage-border", "--border"],
1004
+ ["--sixb-stage-foreground", "--foreground"]
1005
+ ]) {
1006
+ const value = declarations.find((declaration) => declaration.startsWith(`${token}:`));
1007
+ if (value)
1008
+ declarations.push(`${stage}${value.slice(token.length)}`);
1009
+ }
1010
+ let style = document.getElementById("sixb-theme");
1011
+ if (!style) {
1012
+ style = document.createElement("style");
1013
+ style.id = "sixb-theme";
1014
+ document.head.append(style);
1015
+ }
1016
+ style.textContent = `@layer sixb-theme { :root { ${declarations.join(" ")} color-scheme: ${params.dark === true ? "dark" : "light"}; } }`;
1017
+ root.classList.toggle("dark", params.dark === true);
1018
+ window.dispatchEvent(new CustomEvent("sixb:theme", { detail: { dark: params.dark === true } }));
1019
+ return;
1020
+ }
1021
+ case "goto":
1022
+ if (!deck)
1023
+ throw new Error("Only a deck has slides.");
1024
+ show(Number(params.slide));
1025
+ return;
1026
+ case "reload":
1027
+ setTimeout(() => window.location.reload());
1028
+ return;
1029
+ case "query.changed": {
1030
+ const name = String(params.name);
1031
+ if (!QUERY_NAME.test(name))
1032
+ throw new Error(`Unknown query '${name}'.`);
1033
+ window.dispatchEvent(new CustomEvent("sixb:query", { detail: { name } }));
1034
+ return;
1035
+ }
1036
+ case "edit":
1037
+ startEditing(params.on === true, params.typing !== false);
1038
+ return;
1039
+ case "edit.patch": {
1040
+ const patches = Array.isArray(params.patches) ? params.patches : [];
1041
+ for (const patch of patches) {
1042
+ const address = typeof patch?.address === "string" ? patch.address : null;
1043
+ const element = address ? document.querySelector(`[${AT}="${CSS.escape(address)}"]`) : null;
1044
+ if (!element)
1045
+ continue;
1046
+ if (element === typing)
1047
+ held = { ...held ?? {}, ...patch };
1048
+ else
1049
+ applyPatch(element, patch);
1050
+ }
1051
+ return;
1052
+ }
1053
+ case "scroll":
1054
+ if (deck)
1055
+ throw new Error("Only a page scrolls.");
1056
+ window.scrollBy({ left: Number(params.x) || 0, top: Number(params.y) || 0 });
1057
+ return;
1058
+ case "mode":
1059
+ if (!deck)
1060
+ throw new Error("Only a deck has modes.");
1061
+ if (root.dataset.mode === "fill")
1062
+ return;
1063
+ root.dataset.mode = params.mode === "overview" || params.mode === "present" ? params.mode : "slide";
1064
+ fit();
1065
+ show(current);
1066
+ return;
1067
+ default:
1068
+ throw new Error(`Unknown method '${method}'.`);
1069
+ }
1070
+ };
1071
+ const calls = new Map;
1072
+ let called = 0;
1073
+ const alone = window.parent === window;
1074
+ const memory = new Map;
1075
+ const call = (method, params) => {
1076
+ if (alone) {
1077
+ const key = String(params.key);
1078
+ const kept = memory.get(key);
1079
+ switch (method) {
1080
+ case "state.get":
1081
+ return Promise.resolve(kept === undefined ? undefined : JSON.parse(kept));
1082
+ case "state.set":
1083
+ memory.set(key, JSON.stringify(params.value));
1084
+ return Promise.resolve(undefined);
1085
+ case "state.delete":
1086
+ return Promise.resolve(memory.delete(key));
1087
+ default:
1088
+ return Promise.resolve([...memory.keys()].sort());
1089
+ }
1090
+ }
1091
+ called += 1;
1092
+ const id = called;
1093
+ return new Promise((resolve, reject) => {
1094
+ calls.set(id, { resolve, reject });
1095
+ post({ call: id, method, params });
1096
+ });
1097
+ };
1098
+ const checkKey = (key) => {
1099
+ if (typeof key !== "string" || key.length === 0 || key.length > MAX_KEY_LENGTH || key === "." || key === "..") {
1100
+ throw new TypeError(`sixb.state: a key is text of 1 to ${MAX_KEY_LENGTH} characters.`);
1101
+ }
1102
+ return key;
1103
+ };
1104
+ const state = {
1105
+ get: (key) => Promise.resolve().then(() => call("state.get", { key: checkKey(key) })),
1106
+ set: (key, value) => Promise.resolve().then(() => {
1107
+ const json = JSON.stringify(value);
1108
+ if (json === undefined) {
1109
+ throw new TypeError("sixb.state: a value is JSON: text, a number, true or false, null, a list, or an object.");
1110
+ }
1111
+ if (new TextEncoder().encode(json).byteLength > MAX_VALUE_BYTES) {
1112
+ throw new RangeError(`sixb.state: a value is at most ${MAX_VALUE_BYTES / 1024} KB as JSON.`);
1113
+ }
1114
+ return call("state.set", { key: checkKey(key), value: JSON.parse(json) }).then(() => {});
1115
+ }),
1116
+ delete: (key) => Promise.resolve().then(() => call("state.delete", { key: checkKey(key) })),
1117
+ keys: () => call("state.keys", {})
1118
+ };
1119
+ const readQueryFile = async (name) => {
1120
+ const base = script?.src || new URL("__sixb/runtime.js", window.location.href).href;
1121
+ const response = await fetch(new URL(`queries/${name}.json`, base));
1122
+ if (response.ok)
1123
+ return response.json();
1124
+ if (response.status === 404) {
1125
+ throw new Error(`[Sixb] No query '${name}' in this page's version.`);
1126
+ }
1127
+ const body = await response.json().catch(() => null);
1128
+ throw new Error(typeof body?.error === "string" ? body.error : `[Sixb] Query '${name}' could not be read.`);
1129
+ };
1130
+ const query = (name) => Promise.resolve().then(() => {
1131
+ if (typeof name !== "string" || !QUERY_NAME.test(name)) {
1132
+ throw new TypeError("sixb.query: a query's name is that of its file, queries/<name>.json: lowercase letters, digits and hyphens.");
1133
+ }
1134
+ return alone ? readQueryFile(name) : call("query.run", { name });
1135
+ });
1136
+ Object.defineProperty(window, "sixb", {
1137
+ value: Object.freeze({ state: Object.freeze(state), query }),
1138
+ enumerable: true
1139
+ });
1140
+ window.addEventListener("message", (event) => {
1141
+ if (event.source !== window.parent)
1142
+ return;
1143
+ const data = event.data;
1144
+ if (data && data.protocol === PROTOCOL && typeof data.result === "number") {
1145
+ const pending = calls.get(data.result);
1146
+ calls.delete(data.result);
1147
+ if (typeof data.error === "string")
1148
+ pending?.reject(new Error(data.error));
1149
+ else
1150
+ pending?.resolve(data.value);
1151
+ return;
1152
+ }
1153
+ if (!data || data.protocol !== PROTOCOL || typeof data.id !== "number")
1154
+ return;
1155
+ if (typeof data.method !== "string")
1156
+ return;
1157
+ event.stopImmediatePropagation();
1158
+ const port = event.ports?.[0];
1159
+ if (data.method === "edit" && port)
1160
+ editPort = port;
1161
+ try {
1162
+ handle(String(data.method), data.params ?? {});
1163
+ post({ id: data.id });
1164
+ } catch (error) {
1165
+ post({ id: data.id, error: error instanceof Error ? error.message : String(error) });
1166
+ }
1167
+ }, true);
1168
+ window.addEventListener("keydown", (event) => {
1169
+ if (!deck || event.metaKey || event.ctrlKey || event.altKey)
1170
+ return;
1171
+ const target = event.target;
1172
+ if (target?.closest("input, textarea, select, [contenteditable]"))
1173
+ return;
1174
+ if (!KEYS.includes(event.key))
1175
+ return;
1176
+ event.preventDefault();
1177
+ post({ event: "key", params: { key: event.key } });
1178
+ });
1179
+ document.addEventListener("click", (event) => {
1180
+ const target = event.target;
1181
+ const pressed = target?.closest('button, [role="button"], a[href^="#"]');
1182
+ const words = (pressed?.innerText ?? pressed?.textContent ?? "").replace(/\s+/g, " ").trim();
1183
+ if (words && words.length <= MAX_LABEL_LENGTH)
1184
+ post({ event: "press", params: { text: words } });
1185
+ const link = target?.closest("a[href]");
1186
+ if (link) {
1187
+ const href = link.getAttribute("href") ?? "";
1188
+ if (href.startsWith("#") || event.defaultPrevented)
1189
+ return;
1190
+ event.preventDefault();
1191
+ if (/^artifact:/i.test(href.trim())) {
1192
+ post({ event: "open", params: { address: href.trim() } });
1193
+ return;
1194
+ }
1195
+ const url = webAddress(href);
1196
+ if (url)
1197
+ post({ event: "link", params: { url } });
1198
+ return;
1199
+ }
1200
+ if (!deck || root.dataset.mode !== "overview")
1201
+ return;
1202
+ const slide = target?.closest("section.slide");
1203
+ if (!slide)
1204
+ return;
1205
+ post({ event: "select", params: { slide: slides().indexOf(slide) + 1 } });
1206
+ });
1207
+ window.addEventListener("resize", () => {
1208
+ if (deck)
1209
+ fit();
1210
+ reportEmbeds();
1211
+ });
1212
+ const ready = () => {
1213
+ if (!deck) {
1214
+ post({ event: "ready", params: {} });
1215
+ window.addEventListener("scroll", reportEmbeds, { passive: true });
1216
+ const resized = new ResizeObserver(() => {
1217
+ reportSize();
1218
+ reportEmbeds();
1219
+ });
1220
+ resized.observe(document.documentElement);
1221
+ if (document.body)
1222
+ resized.observe(document.body);
1223
+ window.addEventListener("load", () => {
1224
+ reportSize();
1225
+ reportEmbeds();
1226
+ });
1227
+ reportSize();
1228
+ reportEmbeds();
1229
+ return;
1230
+ }
1231
+ slides().forEach((element, index) => {
1232
+ element.dataset.number = String(index + 1);
1233
+ });
1234
+ fit();
1235
+ show(current);
1236
+ post({ event: "ready", params: { slides: slides().length } });
1237
+ const resized = new ResizeObserver(reportEmbeds);
1238
+ for (const element of Array.from(document.querySelectorAll("section.slide > *, sixb-embed"))) {
1239
+ resized.observe(element);
1240
+ }
1241
+ window.addEventListener("load", reportEmbeds);
1242
+ document.fonts?.ready.then(reportEmbeds);
1243
+ };
1244
+ if (document.readyState === "loading")
1245
+ document.addEventListener("DOMContentLoaded", ready);
1246
+ else
1247
+ ready();
1248
+ }
1249
+
1250
+ // src/artifacts/frames/assets.ts
1251
+ var FRAME_CDN_ALLOWLIST2 = [
1252
+ "https://cdn.jsdelivr.net",
1253
+ "https://cdnjs.cloudflare.com",
1254
+ "https://unpkg.com",
1255
+ "https://fonts.googleapis.com",
1256
+ "https://fonts.gstatic.com"
1257
+ ];
1258
+ var FRAME_ASSETS2 = {
1259
+ [`${FRAME_ASSET_PREFIX}deck.css`]: { body: FRAME_DECK_CSS, type: "text/css; charset=utf-8" },
1260
+ [`${FRAME_ASSET_PREFIX}page.css`]: { body: FRAME_PAGE_CSS, type: "text/css; charset=utf-8" },
1261
+ [`${FRAME_ASSET_PREFIX}runtime.js`]: {
1262
+ body: `(${frameRuntime.toString()})()
1263
+ `,
1264
+ type: "text/javascript; charset=utf-8"
1265
+ }
1266
+ };
1267
+ function injected(layout, base) {
1268
+ return `<link rel="stylesheet" href="${base}${FRAME_ASSET_PREFIX}${layout}.css"><script src="${base}${FRAME_ASSET_PREFIX}runtime.js" data-sixb-layout="${layout}"></script>`;
1269
+ }
1270
+ function rootOf(entry) {
1271
+ return "../".repeat(entry.split("/").length - 1);
1272
+ }
1273
+ function injectFrameAssets2(html, layout, entry = "index.html") {
1274
+ const assets = injected(layout, rootOf(entry));
1275
+ for (const selector of ["head", "html"]) {
1276
+ let injected = false;
1277
+ const rewritten = new HTMLRewriter().on(selector, {
1278
+ element(element) {
1279
+ if (injected)
1280
+ return;
1281
+ injected = true;
1282
+ element.prepend(assets, { html: true });
1283
+ }
1284
+ }).transform(html);
1285
+ if (injected)
1286
+ return rewritten;
1287
+ }
1288
+ const doctype = /^\s*<!doctype[^>]*>/i.exec(html)?.[0] ?? "";
1289
+ return `${doctype}${assets}${html.slice(doctype.length)}`;
1290
+ }
1291
+ var FRAME_REFERENCE_PREFIX2 = `${FRAME_ASSET_PREFIX}ref/`;
1292
+ var FRAME_REFERENCE_PATH2 = /^([^/@]+)@(\d+|latest)\/(.+)$/;
1293
+ function frameReferencePath(target, entry) {
1294
+ const file = parseArtifactAddress2(target.address)?.path;
1295
+ if (!file)
1296
+ return null;
1297
+ const path = file.split("/").map(encodeURIComponent).join("/");
1298
+ return `${rootOf(entry)}${FRAME_REFERENCE_PREFIX2}${target.artifactId}@${target.version}/${path}`;
1299
+ }
1300
+ function rewriteFrameReferences2(html, targets, entry = "index.html") {
1301
+ return new HTMLRewriter().on("img[src]", {
1302
+ element(element) {
1303
+ const source = decodeHtmlEntities(element.getAttribute("src") ?? "").trim();
1304
+ if (!isArtifactAddress2(source))
1305
+ return;
1306
+ const target = targets.find((candidate) => candidate.address === source);
1307
+ const path = target ? frameReferencePath(target, entry) : null;
1308
+ if (path) {
1309
+ element.setAttribute("src", path);
1310
+ element.setAttribute("data-sixb-ref", "");
1311
+ } else {
1312
+ element.removeAttribute("src");
1313
+ element.setAttribute("data-sixb-ref", "unavailable");
1314
+ }
1315
+ }
1316
+ }).transform(html);
1317
+ }
1318
+
1319
+ // src/objects/serialize.ts
1320
+ function serializeObject2(row) {
1321
+ return {
1322
+ ...row.score === undefined ? {} : { score: row.score },
1323
+ primaryId: row.primaryId,
1324
+ objectTypeId: row.objectTypeId,
1325
+ properties: row.properties,
1326
+ ...row.redactions === undefined ? {} : { redactions: row.redactions },
1327
+ createdAt: row.createdAt.toISOString(),
1328
+ updatedAt: row.updatedAt.toISOString()
1329
+ };
1330
+ }
1331
+ function serializeExpandedObject2(row) {
1332
+ const serialized = serializeObject2(row);
1333
+ if (row.links)
1334
+ serialized.links = serializeLinks(row.links);
1335
+ if (row.linkProperties !== undefined)
1336
+ serialized.linkProperties = row.linkProperties;
1337
+ if (row.users)
1338
+ serialized.users = row.users;
1339
+ return serialized;
1340
+ }
1341
+ function serializeLinks(links) {
1342
+ const result = {};
1343
+ for (const [linkId, value] of Object.entries(links)) {
1344
+ result[linkId] = serializeLinkValue(value);
1345
+ }
1346
+ return result;
1347
+ }
1348
+ function serializeLinkValue(value) {
1349
+ if (value === null)
1350
+ return null;
1351
+ if (Array.isArray(value))
1352
+ return value.map(serializeExpandedObject2);
1353
+ return serializeExpandedObject2(value);
1354
+ }
1355
+
1356
+ // src/artifacts/serialize-query.ts
1357
+ function serializeArtifactQueryResult2(result) {
1358
+ return result.kind === "objects" ? { ...result, objects: result.objects.map(serializeExpandedObject2) } : result;
1359
+ }
1360
+
1361
+ 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 };
1362
+
1363
+ //# debugId=D1DA1156502B301F64756E2164756E21