@vibefield/puppeteer-views 0.0.0-stage → 0.2.1

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 (522) hide show
  1. package/LICENSE +21 -0
  2. package/dist/bar/InstrumentBar.d.ts +81 -0
  3. package/dist/bar/InstrumentBar.d.ts.map +1 -0
  4. package/dist/bar/InstrumentBar.js +86 -0
  5. package/dist/bar/InstrumentBar.js.map +1 -0
  6. package/dist/bar/ProfileTabs.d.ts +24 -0
  7. package/dist/bar/ProfileTabs.d.ts.map +1 -0
  8. package/dist/bar/ProfileTabs.js +141 -0
  9. package/dist/bar/ProfileTabs.js.map +1 -0
  10. package/dist/chrome/ChromeBoundary.d.ts +60 -0
  11. package/dist/chrome/ChromeBoundary.d.ts.map +1 -0
  12. package/dist/chrome/ChromeBoundary.js +70 -0
  13. package/dist/chrome/ChromeBoundary.js.map +1 -0
  14. package/dist/chrome/stage.d.ts +8 -0
  15. package/dist/chrome/stage.d.ts.map +1 -0
  16. package/dist/chrome/stage.js +8 -0
  17. package/dist/chrome/stage.js.map +1 -0
  18. package/dist/colour/pane-colours.d.ts +21 -0
  19. package/dist/colour/pane-colours.d.ts.map +1 -0
  20. package/dist/colour/pane-colours.js +25 -0
  21. package/dist/colour/pane-colours.js.map +1 -0
  22. package/dist/colour/project-tint.d.ts +23 -0
  23. package/dist/colour/project-tint.d.ts.map +1 -0
  24. package/dist/colour/project-tint.js +100 -0
  25. package/dist/colour/project-tint.js.map +1 -0
  26. package/dist/deck/DeckFrames.d.ts +71 -0
  27. package/dist/deck/DeckFrames.d.ts.map +1 -0
  28. package/dist/deck/DeckFrames.js +50 -0
  29. package/dist/deck/DeckFrames.js.map +1 -0
  30. package/dist/deck/PaneFrame.d.ts +80 -0
  31. package/dist/deck/PaneFrame.d.ts.map +1 -0
  32. package/dist/deck/PaneFrame.js +118 -0
  33. package/dist/deck/PaneFrame.js.map +1 -0
  34. package/dist/deck/completed-agent-panes.d.ts +24 -0
  35. package/dist/deck/completed-agent-panes.d.ts.map +1 -0
  36. package/dist/deck/completed-agent-panes.js +72 -0
  37. package/dist/deck/completed-agent-panes.js.map +1 -0
  38. package/dist/deck/deck-zoom.d.ts +40 -0
  39. package/dist/deck/deck-zoom.d.ts.map +1 -0
  40. package/dist/deck/deck-zoom.js +200 -0
  41. package/dist/deck/deck-zoom.js.map +1 -0
  42. package/dist/deck/index.d.ts +8 -0
  43. package/dist/deck/index.d.ts.map +1 -0
  44. package/dist/deck/index.js +13 -0
  45. package/dist/deck/index.js.map +1 -0
  46. package/dist/deck/pane-elements.d.ts +24 -0
  47. package/dist/deck/pane-elements.d.ts.map +1 -0
  48. package/dist/deck/pane-elements.js +73 -0
  49. package/dist/deck/pane-elements.js.map +1 -0
  50. package/dist/deck/pane-frame.d.ts +88 -0
  51. package/dist/deck/pane-frame.d.ts.map +1 -0
  52. package/dist/deck/pane-frame.js +51 -0
  53. package/dist/deck/pane-frame.js.map +1 -0
  54. package/dist/deck/unused-pane-sessions.d.ts +24 -0
  55. package/dist/deck/unused-pane-sessions.d.ts.map +1 -0
  56. package/dist/deck/unused-pane-sessions.js +75 -0
  57. package/dist/deck/unused-pane-sessions.js.map +1 -0
  58. package/dist/deck/use-deck-zoom.d.ts +10 -0
  59. package/dist/deck/use-deck-zoom.d.ts.map +1 -0
  60. package/dist/deck/use-deck-zoom.js +31 -0
  61. package/dist/deck/use-deck-zoom.js.map +1 -0
  62. package/dist/find/FindSheet.d.ts +23 -0
  63. package/dist/find/FindSheet.d.ts.map +1 -0
  64. package/dist/find/FindSheet.js +197 -0
  65. package/dist/find/FindSheet.js.map +1 -0
  66. package/dist/find/find-agent.d.ts +35 -0
  67. package/dist/find/find-agent.d.ts.map +1 -0
  68. package/dist/find/find-agent.js +2 -0
  69. package/dist/find/find-agent.js.map +1 -0
  70. package/dist/find/find-model.d.ts +93 -0
  71. package/dist/find/find-model.d.ts.map +1 -0
  72. package/dist/find/find-model.js +372 -0
  73. package/dist/find/find-model.js.map +1 -0
  74. package/dist/find/history-port.d.ts +78 -0
  75. package/dist/find/history-port.d.ts.map +1 -0
  76. package/dist/find/history-port.js +9 -0
  77. package/dist/find/history-port.js.map +1 -0
  78. package/dist/icons/ServiceMark.d.ts +32 -0
  79. package/dist/icons/ServiceMark.d.ts.map +1 -0
  80. package/dist/icons/ServiceMark.js +57 -0
  81. package/dist/icons/ServiceMark.js.map +1 -0
  82. package/dist/icons/profile-glyph-suggest.d.ts +8 -0
  83. package/dist/icons/profile-glyph-suggest.d.ts.map +1 -0
  84. package/dist/icons/profile-glyph-suggest.js +42 -0
  85. package/dist/icons/profile-glyph-suggest.js.map +1 -0
  86. package/dist/icons/service-marks.d.ts +5 -0
  87. package/dist/icons/service-marks.d.ts.map +1 -0
  88. package/dist/icons/service-marks.js +81 -0
  89. package/dist/icons/service-marks.js.map +1 -0
  90. package/dist/index.d.ts +60 -0
  91. package/dist/index.d.ts.map +1 -0
  92. package/dist/index.js +86 -0
  93. package/dist/index.js.map +1 -0
  94. package/dist/lab/lab-clock.d.ts +11 -0
  95. package/dist/lab/lab-clock.d.ts.map +1 -0
  96. package/dist/lab/lab-clock.js +48 -0
  97. package/dist/lab/lab-clock.js.map +1 -0
  98. package/dist/lab/lab-model.d.ts +10 -0
  99. package/dist/lab/lab-model.d.ts.map +1 -0
  100. package/dist/lab/lab-model.js +146 -0
  101. package/dist/lab/lab-model.js.map +1 -0
  102. package/dist/lab/lab-stage.d.ts +72 -0
  103. package/dist/lab/lab-stage.d.ts.map +1 -0
  104. package/dist/lab/lab-stage.js +201 -0
  105. package/dist/lab/lab-stage.js.map +1 -0
  106. package/dist/lab/lab-world.d.ts +33 -0
  107. package/dist/lab/lab-world.d.ts.map +1 -0
  108. package/dist/lab/lab-world.js +394 -0
  109. package/dist/lab/lab-world.js.map +1 -0
  110. package/dist/lab/view-lab.css +98 -0
  111. package/dist/launcher/DeckLaunchers.d.ts +92 -0
  112. package/dist/launcher/DeckLaunchers.d.ts.map +1 -0
  113. package/dist/launcher/DeckLaunchers.js +377 -0
  114. package/dist/launcher/DeckLaunchers.js.map +1 -0
  115. package/dist/launcher/PaneLaunch.d.ts +50 -0
  116. package/dist/launcher/PaneLaunch.d.ts.map +1 -0
  117. package/dist/launcher/PaneLaunch.js +318 -0
  118. package/dist/launcher/PaneLaunch.js.map +1 -0
  119. package/dist/launcher/PaneLaunchChrome.d.ts +49 -0
  120. package/dist/launcher/PaneLaunchChrome.d.ts.map +1 -0
  121. package/dist/launcher/PaneLaunchChrome.js +32 -0
  122. package/dist/launcher/PaneLaunchChrome.js.map +1 -0
  123. package/dist/launcher/PaneLauncher.d.ts +97 -0
  124. package/dist/launcher/PaneLauncher.d.ts.map +1 -0
  125. package/dist/launcher/PaneLauncher.js +349 -0
  126. package/dist/launcher/PaneLauncher.js.map +1 -0
  127. package/dist/launcher/PaneLauncherChrome.d.ts +97 -0
  128. package/dist/launcher/PaneLauncherChrome.d.ts.map +1 -0
  129. package/dist/launcher/PaneLauncherChrome.js +131 -0
  130. package/dist/launcher/PaneLauncherChrome.js.map +1 -0
  131. package/dist/launcher/index.d.ts +9 -0
  132. package/dist/launcher/index.d.ts.map +1 -0
  133. package/dist/launcher/index.js +16 -0
  134. package/dist/launcher/index.js.map +1 -0
  135. package/dist/launcher/launch-model.d.ts +162 -0
  136. package/dist/launcher/launch-model.d.ts.map +1 -0
  137. package/dist/launcher/launch-model.js +169 -0
  138. package/dist/launcher/launch-model.js.map +1 -0
  139. package/dist/launcher/launcher-model.d.ts +268 -0
  140. package/dist/launcher/launcher-model.d.ts.map +1 -0
  141. package/dist/launcher/launcher-model.js +443 -0
  142. package/dist/launcher/launcher-model.js.map +1 -0
  143. package/dist/launcher/launcher-port.d.ts +115 -0
  144. package/dist/launcher/launcher-port.d.ts.map +1 -0
  145. package/dist/launcher/launcher-port.js +12 -0
  146. package/dist/launcher/launcher-port.js.map +1 -0
  147. package/dist/monitor/agent-status.d.ts +13 -0
  148. package/dist/monitor/agent-status.d.ts.map +1 -0
  149. package/dist/monitor/agent-status.js +5 -0
  150. package/dist/monitor/agent-status.js.map +1 -0
  151. package/dist/monitor/agents.d.ts +6 -0
  152. package/dist/monitor/agents.d.ts.map +1 -0
  153. package/dist/monitor/agents.js +21 -0
  154. package/dist/monitor/agents.js.map +1 -0
  155. package/dist/monitor/cost-format.d.ts +3 -0
  156. package/dist/monitor/cost-format.d.ts.map +1 -0
  157. package/dist/monitor/cost-format.js +12 -0
  158. package/dist/monitor/cost-format.js.map +1 -0
  159. package/dist/monitor/folder-name.d.ts +3 -0
  160. package/dist/monitor/folder-name.d.ts.map +1 -0
  161. package/dist/monitor/folder-name.js +6 -0
  162. package/dist/monitor/folder-name.js.map +1 -0
  163. package/dist/monitor/palette.d.ts +94 -0
  164. package/dist/monitor/palette.d.ts.map +1 -0
  165. package/dist/monitor/palette.js +157 -0
  166. package/dist/monitor/palette.js.map +1 -0
  167. package/dist/monitor/parameters.d.ts +33 -0
  168. package/dist/monitor/parameters.d.ts.map +1 -0
  169. package/dist/monitor/parameters.js +53 -0
  170. package/dist/monitor/parameters.js.map +1 -0
  171. package/dist/monitor/recede.d.ts +14 -0
  172. package/dist/monitor/recede.d.ts.map +1 -0
  173. package/dist/monitor/recede.js +35 -0
  174. package/dist/monitor/recede.js.map +1 -0
  175. package/dist/monitor/registry.d.ts +14 -0
  176. package/dist/monitor/registry.d.ts.map +1 -0
  177. package/dist/monitor/registry.js +36 -0
  178. package/dist/monitor/registry.js.map +1 -0
  179. package/dist/monitor/remote-write.d.ts +16 -0
  180. package/dist/monitor/remote-write.d.ts.map +1 -0
  181. package/dist/monitor/remote-write.js +21 -0
  182. package/dist/monitor/remote-write.js.map +1 -0
  183. package/dist/monitor/types.d.ts +205 -0
  184. package/dist/monitor/types.d.ts.map +1 -0
  185. package/dist/monitor/types.js +2 -0
  186. package/dist/monitor/types.js.map +1 -0
  187. package/dist/styles/bar.css +396 -0
  188. package/dist/styles/deck-frame.css +439 -0
  189. package/dist/styles/deck-zoom.css +70 -0
  190. package/dist/styles/find-sheet.css +270 -0
  191. package/dist/styles/pane-launcher.css +955 -0
  192. package/dist/styles/usage.css +368 -0
  193. package/dist/styles/views.css +12 -0
  194. package/dist/usage/UsageColumn.d.ts +8 -0
  195. package/dist/usage/UsageColumn.d.ts.map +1 -0
  196. package/dist/usage/UsageColumn.js +133 -0
  197. package/dist/usage/UsageColumn.js.map +1 -0
  198. package/dist/usage/account-usage-port.d.ts +12 -0
  199. package/dist/usage/account-usage-port.d.ts.map +1 -0
  200. package/dist/usage/account-usage-port.js +2 -0
  201. package/dist/usage/account-usage-port.js.map +1 -0
  202. package/dist/usage/account-usage.d.ts +86 -0
  203. package/dist/usage/account-usage.d.ts.map +1 -0
  204. package/dist/usage/account-usage.js +262 -0
  205. package/dist/usage/account-usage.js.map +1 -0
  206. package/dist/views/list/AgentList.d.ts +4 -0
  207. package/dist/views/list/AgentList.d.ts.map +1 -0
  208. package/dist/views/list/AgentList.js +101 -0
  209. package/dist/views/list/AgentList.js.map +1 -0
  210. package/dist/views/list/ListSpawnMenu.d.ts +20 -0
  211. package/dist/views/list/ListSpawnMenu.d.ts.map +1 -0
  212. package/dist/views/list/ListSpawnMenu.js +143 -0
  213. package/dist/views/list/ListSpawnMenu.js.map +1 -0
  214. package/dist/views/list/index.d.ts +8 -0
  215. package/dist/views/list/index.d.ts.map +1 -0
  216. package/dist/views/list/index.js +43 -0
  217. package/dist/views/list/index.js.map +1 -0
  218. package/dist/views/list/lab/main.d.ts +2 -0
  219. package/dist/views/list/lab/main.d.ts.map +1 -0
  220. package/dist/views/list/lab/main.js +25 -0
  221. package/dist/views/list/lab/main.js.map +1 -0
  222. package/dist/views/list/list-parameters.d.ts +9 -0
  223. package/dist/views/list/list-parameters.d.ts.map +1 -0
  224. package/dist/views/list/list-parameters.js +27 -0
  225. package/dist/views/list/list-parameters.js.map +1 -0
  226. package/dist/views/list/list.css +387 -0
  227. package/dist/views/rain/RainView.d.ts +4 -0
  228. package/dist/views/rain/RainView.d.ts.map +1 -0
  229. package/dist/views/rain/RainView.js +282 -0
  230. package/dist/views/rain/RainView.js.map +1 -0
  231. package/dist/views/rain/index.d.ts +8 -0
  232. package/dist/views/rain/index.d.ts.map +1 -0
  233. package/dist/views/rain/index.js +53 -0
  234. package/dist/views/rain/index.js.map +1 -0
  235. package/dist/views/rain/lab/main.d.ts +2 -0
  236. package/dist/views/rain/lab/main.d.ts.map +1 -0
  237. package/dist/views/rain/lab/main.js +26 -0
  238. package/dist/views/rain/lab/main.js.map +1 -0
  239. package/dist/views/rain/rain-parameters.d.ts +15 -0
  240. package/dist/views/rain/rain-parameters.d.ts.map +1 -0
  241. package/dist/views/rain/rain-parameters.js +52 -0
  242. package/dist/views/rain/rain-parameters.js.map +1 -0
  243. package/dist/views/rain/rain-streams.d.ts +44 -0
  244. package/dist/views/rain/rain-streams.d.ts.map +1 -0
  245. package/dist/views/rain/rain-streams.js +101 -0
  246. package/dist/views/rain/rain-streams.js.map +1 -0
  247. package/dist/views/rain/rain.css +200 -0
  248. package/dist/views/spend/SpendView.d.ts +30 -0
  249. package/dist/views/spend/SpendView.d.ts.map +1 -0
  250. package/dist/views/spend/SpendView.js +645 -0
  251. package/dist/views/spend/SpendView.js.map +1 -0
  252. package/dist/views/spend/index.d.ts +8 -0
  253. package/dist/views/spend/index.d.ts.map +1 -0
  254. package/dist/views/spend/index.js +54 -0
  255. package/dist/views/spend/index.js.map +1 -0
  256. package/dist/views/spend/lab/main.d.ts +2 -0
  257. package/dist/views/spend/lab/main.d.ts.map +1 -0
  258. package/dist/views/spend/lab/main.js +237 -0
  259. package/dist/views/spend/lab/main.js.map +1 -0
  260. package/dist/views/spend/lab/spend-fixtures.d.ts +72 -0
  261. package/dist/views/spend/lab/spend-fixtures.d.ts.map +1 -0
  262. package/dist/views/spend/lab/spend-fixtures.js +412 -0
  263. package/dist/views/spend/lab/spend-fixtures.js.map +1 -0
  264. package/dist/views/spend/spend-ink.d.ts +18 -0
  265. package/dist/views/spend/spend-ink.d.ts.map +1 -0
  266. package/dist/views/spend/spend-ink.js +50 -0
  267. package/dist/views/spend/spend-ink.js.map +1 -0
  268. package/dist/views/spend/spend-list.d.ts +48 -0
  269. package/dist/views/spend/spend-list.d.ts.map +1 -0
  270. package/dist/views/spend/spend-list.js +93 -0
  271. package/dist/views/spend/spend-list.js.map +1 -0
  272. package/dist/views/spend/spend-paint.d.ts +88 -0
  273. package/dist/views/spend/spend-paint.d.ts.map +1 -0
  274. package/dist/views/spend/spend-paint.js +225 -0
  275. package/dist/views/spend/spend-paint.js.map +1 -0
  276. package/dist/views/spend/spend-parameters.d.ts +11 -0
  277. package/dist/views/spend/spend-parameters.d.ts.map +1 -0
  278. package/dist/views/spend/spend-parameters.js +27 -0
  279. package/dist/views/spend/spend-parameters.js.map +1 -0
  280. package/dist/views/spend/spend-scale.d.ts +43 -0
  281. package/dist/views/spend/spend-scale.d.ts.map +1 -0
  282. package/dist/views/spend/spend-scale.js +71 -0
  283. package/dist/views/spend/spend-scale.js.map +1 -0
  284. package/dist/views/spend/spend-series.d.ts +91 -0
  285. package/dist/views/spend/spend-series.d.ts.map +1 -0
  286. package/dist/views/spend/spend-series.js +212 -0
  287. package/dist/views/spend/spend-series.js.map +1 -0
  288. package/dist/views/spend/spend-words.d.ts +82 -0
  289. package/dist/views/spend/spend-words.d.ts.map +1 -0
  290. package/dist/views/spend/spend-words.js +164 -0
  291. package/dist/views/spend/spend-words.js.map +1 -0
  292. package/dist/views/spend/spend.css +585 -0
  293. package/dist/views/swarm/AgentSwarm.d.ts +4 -0
  294. package/dist/views/swarm/AgentSwarm.d.ts.map +1 -0
  295. package/dist/views/swarm/AgentSwarm.js +969 -0
  296. package/dist/views/swarm/AgentSwarm.js.map +1 -0
  297. package/dist/views/swarm/bloom/SpawnBloom.d.ts +26 -0
  298. package/dist/views/swarm/bloom/SpawnBloom.d.ts.map +1 -0
  299. package/dist/views/swarm/bloom/SpawnBloom.js +332 -0
  300. package/dist/views/swarm/bloom/SpawnBloom.js.map +1 -0
  301. package/dist/views/swarm/bloom/birth.d.ts +70 -0
  302. package/dist/views/swarm/bloom/birth.d.ts.map +1 -0
  303. package/dist/views/swarm/bloom/birth.js +89 -0
  304. package/dist/views/swarm/bloom/birth.js.map +1 -0
  305. package/dist/views/swarm/bloom/canvas-measure.d.ts +11 -0
  306. package/dist/views/swarm/bloom/canvas-measure.d.ts.map +1 -0
  307. package/dist/views/swarm/bloom/canvas-measure.js +37 -0
  308. package/dist/views/swarm/bloom/canvas-measure.js.map +1 -0
  309. package/dist/views/swarm/bloom/constants.d.ts +93 -0
  310. package/dist/views/swarm/bloom/constants.d.ts.map +1 -0
  311. package/dist/views/swarm/bloom/constants.js +94 -0
  312. package/dist/views/swarm/bloom/constants.js.map +1 -0
  313. package/dist/views/swarm/bloom/field-frame.d.ts +69 -0
  314. package/dist/views/swarm/bloom/field-frame.d.ts.map +1 -0
  315. package/dist/views/swarm/bloom/field-frame.js +104 -0
  316. package/dist/views/swarm/bloom/field-frame.js.map +1 -0
  317. package/dist/views/swarm/bloom/geometry.d.ts +187 -0
  318. package/dist/views/swarm/bloom/geometry.d.ts.map +1 -0
  319. package/dist/views/swarm/bloom/geometry.js +379 -0
  320. package/dist/views/swarm/bloom/geometry.js.map +1 -0
  321. package/dist/views/swarm/bloom/index.d.ts +8 -0
  322. package/dist/views/swarm/bloom/index.d.ts.map +1 -0
  323. package/dist/views/swarm/bloom/index.js +13 -0
  324. package/dist/views/swarm/bloom/index.js.map +1 -0
  325. package/dist/views/swarm/bloom/menu.d.ts +5 -0
  326. package/dist/views/swarm/bloom/menu.d.ts.map +1 -0
  327. package/dist/views/swarm/bloom/menu.js +14 -0
  328. package/dist/views/swarm/bloom/menu.js.map +1 -0
  329. package/dist/views/swarm/bloom/model.d.ts +255 -0
  330. package/dist/views/swarm/bloom/model.d.ts.map +1 -0
  331. package/dist/views/swarm/bloom/model.js +678 -0
  332. package/dist/views/swarm/bloom/model.js.map +1 -0
  333. package/dist/views/swarm/bloom/scenarios.d.ts +7 -0
  334. package/dist/views/swarm/bloom/scenarios.d.ts.map +1 -0
  335. package/dist/views/swarm/bloom/scenarios.js +57 -0
  336. package/dist/views/swarm/bloom/scenarios.js.map +1 -0
  337. package/dist/views/swarm/bloom/spawn-bloom.css +407 -0
  338. package/dist/views/swarm/bloom/targeting.d.ts +60 -0
  339. package/dist/views/swarm/bloom/targeting.d.ts.map +1 -0
  340. package/dist/views/swarm/bloom/targeting.js +74 -0
  341. package/dist/views/swarm/bloom/targeting.js.map +1 -0
  342. package/dist/views/swarm/bloom/use-spawn-bloom.d.ts +100 -0
  343. package/dist/views/swarm/bloom/use-spawn-bloom.d.ts.map +1 -0
  344. package/dist/views/swarm/bloom/use-spawn-bloom.js +333 -0
  345. package/dist/views/swarm/bloom/use-spawn-bloom.js.map +1 -0
  346. package/dist/views/swarm/bloom/words.d.ts +73 -0
  347. package/dist/views/swarm/bloom/words.d.ts.map +1 -0
  348. package/dist/views/swarm/bloom/words.js +195 -0
  349. package/dist/views/swarm/bloom/words.js.map +1 -0
  350. package/dist/views/swarm/body-id.d.ts +13 -0
  351. package/dist/views/swarm/body-id.d.ts.map +1 -0
  352. package/dist/views/swarm/body-id.js +12 -0
  353. package/dist/views/swarm/body-id.js.map +1 -0
  354. package/dist/views/swarm/bubble-model.d.ts +128 -0
  355. package/dist/views/swarm/bubble-model.d.ts.map +1 -0
  356. package/dist/views/swarm/bubble-model.js +421 -0
  357. package/dist/views/swarm/bubble-model.js.map +1 -0
  358. package/dist/views/swarm/gpu/frame-layout.d.ts +52 -0
  359. package/dist/views/swarm/gpu/frame-layout.d.ts.map +1 -0
  360. package/dist/views/swarm/gpu/frame-layout.js +122 -0
  361. package/dist/views/swarm/gpu/frame-layout.js.map +1 -0
  362. package/dist/views/swarm/gpu/glyph-atlas.d.ts +63 -0
  363. package/dist/views/swarm/gpu/glyph-atlas.d.ts.map +1 -0
  364. package/dist/views/swarm/gpu/glyph-atlas.js +207 -0
  365. package/dist/views/swarm/gpu/glyph-atlas.js.map +1 -0
  366. package/dist/views/swarm/gpu/profile-icons.d.ts +4 -0
  367. package/dist/views/swarm/gpu/profile-icons.d.ts.map +1 -0
  368. package/dist/views/swarm/gpu/profile-icons.js +18 -0
  369. package/dist/views/swarm/gpu/profile-icons.js.map +1 -0
  370. package/dist/views/swarm/gpu/shaders/body.wgsl.d.ts +3 -0
  371. package/dist/views/swarm/gpu/shaders/body.wgsl.d.ts.map +1 -0
  372. package/dist/views/swarm/gpu/shaders/body.wgsl.js +162 -0
  373. package/dist/views/swarm/gpu/shaders/body.wgsl.js.map +1 -0
  374. package/dist/views/swarm/gpu/shaders/common.wgsl.d.ts +3 -0
  375. package/dist/views/swarm/gpu/shaders/common.wgsl.d.ts.map +1 -0
  376. package/dist/views/swarm/gpu/shaders/common.wgsl.js +171 -0
  377. package/dist/views/swarm/gpu/shaders/common.wgsl.js.map +1 -0
  378. package/dist/views/swarm/gpu/shaders/erase.wgsl.d.ts +3 -0
  379. package/dist/views/swarm/gpu/shaders/erase.wgsl.d.ts.map +1 -0
  380. package/dist/views/swarm/gpu/shaders/erase.wgsl.js +61 -0
  381. package/dist/views/swarm/gpu/shaders/erase.wgsl.js.map +1 -0
  382. package/dist/views/swarm/gpu/shaders/field.wgsl.d.ts +3 -0
  383. package/dist/views/swarm/gpu/shaders/field.wgsl.d.ts.map +1 -0
  384. package/dist/views/swarm/gpu/shaders/field.wgsl.js +47 -0
  385. package/dist/views/swarm/gpu/shaders/field.wgsl.js.map +1 -0
  386. package/dist/views/swarm/gpu/shaders/glow.wgsl.d.ts +3 -0
  387. package/dist/views/swarm/gpu/shaders/glow.wgsl.d.ts.map +1 -0
  388. package/dist/views/swarm/gpu/shaders/glow.wgsl.js +39 -0
  389. package/dist/views/swarm/gpu/shaders/glow.wgsl.js.map +1 -0
  390. package/dist/views/swarm/gpu/shaders/hub.wgsl.d.ts +3 -0
  391. package/dist/views/swarm/gpu/shaders/hub.wgsl.d.ts.map +1 -0
  392. package/dist/views/swarm/gpu/shaders/hub.wgsl.js +48 -0
  393. package/dist/views/swarm/gpu/shaders/hub.wgsl.js.map +1 -0
  394. package/dist/views/swarm/gpu/shaders/shadow.wgsl.d.ts +3 -0
  395. package/dist/views/swarm/gpu/shaders/shadow.wgsl.d.ts.map +1 -0
  396. package/dist/views/swarm/gpu/shaders/shadow.wgsl.js +37 -0
  397. package/dist/views/swarm/gpu/shaders/shadow.wgsl.js.map +1 -0
  398. package/dist/views/swarm/gpu/shaders/text.wgsl.d.ts +3 -0
  399. package/dist/views/swarm/gpu/shaders/text.wgsl.d.ts.map +1 -0
  400. package/dist/views/swarm/gpu/shaders/text.wgsl.js +51 -0
  401. package/dist/views/swarm/gpu/shaders/text.wgsl.js.map +1 -0
  402. package/dist/views/swarm/gpu/swarm-renderer.d.ts +155 -0
  403. package/dist/views/swarm/gpu/swarm-renderer.d.ts.map +1 -0
  404. package/dist/views/swarm/gpu/swarm-renderer.js +696 -0
  405. package/dist/views/swarm/gpu/swarm-renderer.js.map +1 -0
  406. package/dist/views/swarm/index.d.ts +9 -0
  407. package/dist/views/swarm/index.d.ts.map +1 -0
  408. package/dist/views/swarm/index.js +40 -0
  409. package/dist/views/swarm/index.js.map +1 -0
  410. package/dist/views/swarm/lab/fixtures.d.ts +148 -0
  411. package/dist/views/swarm/lab/fixtures.d.ts.map +1 -0
  412. package/dist/views/swarm/lab/fixtures.js +821 -0
  413. package/dist/views/swarm/lab/fixtures.js.map +1 -0
  414. package/dist/views/swarm/lab/lab.css +315 -0
  415. package/dist/views/swarm/lab/main.d.ts +2 -0
  416. package/dist/views/swarm/lab/main.d.ts.map +1 -0
  417. package/dist/views/swarm/lab/main.js +474 -0
  418. package/dist/views/swarm/lab/main.js.map +1 -0
  419. package/dist/views/swarm/physics/driver.d.ts +23 -0
  420. package/dist/views/swarm/physics/driver.d.ts.map +1 -0
  421. package/dist/views/swarm/physics/driver.js +68 -0
  422. package/dist/views/swarm/physics/driver.js.map +1 -0
  423. package/dist/views/swarm/physics/frame.d.ts +28 -0
  424. package/dist/views/swarm/physics/frame.d.ts.map +1 -0
  425. package/dist/views/swarm/physics/frame.js +47 -0
  426. package/dist/views/swarm/physics/frame.js.map +1 -0
  427. package/dist/views/swarm/physics/host.d.ts +28 -0
  428. package/dist/views/swarm/physics/host.d.ts.map +1 -0
  429. package/dist/views/swarm/physics/host.js +168 -0
  430. package/dist/views/swarm/physics/host.js.map +1 -0
  431. package/dist/views/swarm/physics/index.d.ts +6 -0
  432. package/dist/views/swarm/physics/index.d.ts.map +1 -0
  433. package/dist/views/swarm/physics/index.js +14 -0
  434. package/dist/views/swarm/physics/index.js.map +1 -0
  435. package/dist/views/swarm/physics/inline-driver.d.ts +27 -0
  436. package/dist/views/swarm/physics/inline-driver.d.ts.map +1 -0
  437. package/dist/views/swarm/physics/inline-driver.js +37 -0
  438. package/dist/views/swarm/physics/inline-driver.js.map +1 -0
  439. package/dist/views/swarm/physics/protocol.d.ts +125 -0
  440. package/dist/views/swarm/physics/protocol.d.ts.map +1 -0
  441. package/dist/views/swarm/physics/protocol.js +4 -0
  442. package/dist/views/swarm/physics/protocol.js.map +1 -0
  443. package/dist/views/swarm/physics/spawn-clamp.d.ts +11 -0
  444. package/dist/views/swarm/physics/spawn-clamp.d.ts.map +1 -0
  445. package/dist/views/swarm/physics/spawn-clamp.js +15 -0
  446. package/dist/views/swarm/physics/spawn-clamp.js.map +1 -0
  447. package/dist/views/swarm/physics/swarm-physics.worker.d.ts +2 -0
  448. package/dist/views/swarm/physics/swarm-physics.worker.d.ts.map +1 -0
  449. package/dist/views/swarm/physics/swarm-physics.worker.js +66 -0
  450. package/dist/views/swarm/physics/swarm-physics.worker.js.map +1 -0
  451. package/dist/views/swarm/physics/world.d.ts +174 -0
  452. package/dist/views/swarm/physics/world.d.ts.map +1 -0
  453. package/dist/views/swarm/physics/world.js +454 -0
  454. package/dist/views/swarm/physics/world.js.map +1 -0
  455. package/dist/views/swarm/swarm-parameters.d.ts +50 -0
  456. package/dist/views/swarm/swarm-parameters.d.ts.map +1 -0
  457. package/dist/views/swarm/swarm-parameters.js +103 -0
  458. package/dist/views/swarm/swarm-parameters.js.map +1 -0
  459. package/dist/views/swarm/swarm-theme.d.ts +5 -0
  460. package/dist/views/swarm/swarm-theme.d.ts.map +1 -0
  461. package/dist/views/swarm/swarm-theme.js +63 -0
  462. package/dist/views/swarm/swarm-theme.js.map +1 -0
  463. package/dist/views/swarm/swarm.css +136 -0
  464. package/dist/views/swarm/text-layout.d.ts +72 -0
  465. package/dist/views/swarm/text-layout.d.ts.map +1 -0
  466. package/dist/views/swarm/text-layout.js +76 -0
  467. package/dist/views/swarm/text-layout.js.map +1 -0
  468. package/dist/views/swarm/weight.d.ts +44 -0
  469. package/dist/views/swarm/weight.d.ts.map +1 -0
  470. package/dist/views/swarm/weight.js +57 -0
  471. package/dist/views/swarm/weight.js.map +1 -0
  472. package/dist/views/timeline/TimelineView.d.ts +9 -0
  473. package/dist/views/timeline/TimelineView.d.ts.map +1 -0
  474. package/dist/views/timeline/TimelineView.js +889 -0
  475. package/dist/views/timeline/TimelineView.js.map +1 -0
  476. package/dist/views/timeline/index.d.ts +11 -0
  477. package/dist/views/timeline/index.d.ts.map +1 -0
  478. package/dist/views/timeline/index.js +63 -0
  479. package/dist/views/timeline/index.js.map +1 -0
  480. package/dist/views/timeline/lab/main.d.ts +2 -0
  481. package/dist/views/timeline/lab/main.d.ts.map +1 -0
  482. package/dist/views/timeline/lab/main.js +114 -0
  483. package/dist/views/timeline/lab/main.js.map +1 -0
  484. package/dist/views/timeline/lab/timeline-fixtures.d.ts +31 -0
  485. package/dist/views/timeline/lab/timeline-fixtures.d.ts.map +1 -0
  486. package/dist/views/timeline/lab/timeline-fixtures.js +337 -0
  487. package/dist/views/timeline/lab/timeline-fixtures.js.map +1 -0
  488. package/dist/views/timeline/pulse-map.d.ts +63 -0
  489. package/dist/views/timeline/pulse-map.d.ts.map +1 -0
  490. package/dist/views/timeline/pulse-map.js +162 -0
  491. package/dist/views/timeline/pulse-map.js.map +1 -0
  492. package/dist/views/timeline/timeline-inks.d.ts +28 -0
  493. package/dist/views/timeline/timeline-inks.d.ts.map +1 -0
  494. package/dist/views/timeline/timeline-inks.js +35 -0
  495. package/dist/views/timeline/timeline-inks.js.map +1 -0
  496. package/dist/views/timeline/timeline-lanes.d.ts +139 -0
  497. package/dist/views/timeline/timeline-lanes.d.ts.map +1 -0
  498. package/dist/views/timeline/timeline-lanes.js +240 -0
  499. package/dist/views/timeline/timeline-lanes.js.map +1 -0
  500. package/dist/views/timeline/timeline-paint.d.ts +39 -0
  501. package/dist/views/timeline/timeline-paint.d.ts.map +1 -0
  502. package/dist/views/timeline/timeline-paint.js +242 -0
  503. package/dist/views/timeline/timeline-paint.js.map +1 -0
  504. package/dist/views/timeline/timeline-parameters.d.ts +11 -0
  505. package/dist/views/timeline/timeline-parameters.d.ts.map +1 -0
  506. package/dist/views/timeline/timeline-parameters.js +27 -0
  507. package/dist/views/timeline/timeline-parameters.js.map +1 -0
  508. package/dist/views/timeline/timeline-scale.d.ts +73 -0
  509. package/dist/views/timeline/timeline-scale.d.ts.map +1 -0
  510. package/dist/views/timeline/timeline-scale.js +152 -0
  511. package/dist/views/timeline/timeline-scale.js.map +1 -0
  512. package/dist/views/timeline/timeline-words.d.ts +46 -0
  513. package/dist/views/timeline/timeline-words.d.ts.map +1 -0
  514. package/dist/views/timeline/timeline-words.js +132 -0
  515. package/dist/views/timeline/timeline-words.js.map +1 -0
  516. package/dist/views/timeline/timeline.css +875 -0
  517. package/dist/views/timeline/wake-geometry.d.ts +88 -0
  518. package/dist/views/timeline/wake-geometry.d.ts.map +1 -0
  519. package/dist/views/timeline/wake-geometry.js +243 -0
  520. package/dist/views/timeline/wake-geometry.js.map +1 -0
  521. package/package.json +78 -3
  522. package/README.md +0 -3
@@ -0,0 +1,696 @@
1
+ /// <reference types="@webgpu/types" />
2
+ import { AGENT_MARK_ATLAS, agentMarkSvg, agentMarkTile } from '@vibefield/puppeteer-view-sdk/toolkit';
3
+ import { layoutCopy, leadAdvance, } from '../text-layout.js';
4
+ import { FRAME_FLOATS, FRAME_LAYOUT, packFrame, writeRgba } from './frame-layout.js';
5
+ import { GlyphAtlas } from './glyph-atlas.js';
6
+ import { PROFILE_ICON_PREFIX, profileIconSvg } from './profile-icons.js';
7
+ import { climb, onField, SWARM_WEIGHT, WORKING_CORE_STRENGTH } from '../weight.js';
8
+ import bodyShader from './shaders/body.wgsl.js';
9
+ import commonShader from './shaders/common.wgsl.js';
10
+ import eraseShader from './shaders/erase.wgsl.js';
11
+ import fieldShader from './shaders/field.wgsl.js';
12
+ import glowShader from './shaders/glow.wgsl.js';
13
+ import hubShader from './shaders/hub.wgsl.js';
14
+ import shadowShader from './shaders/shadow.wgsl.js';
15
+ import textShader from './shaders/text.wgsl.js';
16
+ export { MAX_CLEARINGS } from './frame-layout.js';
17
+ const F_HOLLOW = 1;
18
+ const F_RUNNING = 2;
19
+ const F_GLOW = 8;
20
+ const F_RIM = 16;
21
+ const F_STALE = 32;
22
+ const F_LINKED = 64;
23
+ const F_FOCUS = 128;
24
+ const F_RING_HOT = 512;
25
+ const F_RING = 1024;
26
+ const F_SHADOW = 2048;
27
+ const F_CORE = 4096;
28
+ const F_WAVES = 8192;
29
+ const F_PENDING = 16384;
30
+ /** A pending body's dashes turn a radian every this many seconds (the prototype's `spin`). */
31
+ const DASH_TURN_SECONDS = 0.9;
32
+ const BODY_FLOATS = 40;
33
+ const GLYPH_FLOATS = 16;
34
+ const INITIAL_BODIES = 32;
35
+ const INITIAL_GLYPHS = 2048;
36
+ /** The context figure and the total: one size, the same margin in from the rim. */
37
+ const FIGURE_STYLE = { size: 10.5, weight: 800, letterSpacing: 0.02 };
38
+ const FIGURE_MARGIN = 7;
39
+ /** The burn row keeps this much clear of the model line above and of the total below. */
40
+ const BAND_MARGIN_TOP = 4;
41
+ const BAND_MARGIN_BOTTOM = 8;
42
+ // Stroke icons, 24-box, from the proposals record.
43
+ const ICON_SVG = {
44
+ folder: '<path d="M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/>',
45
+ tool: '<path d="M5 7l5 5-5 5M12 17h7"/>',
46
+ responding: '<path d="M4 20l4.5-1L19 8.5l-3.5-3.5L5 15.5z"/>',
47
+ reasoning: '<circle cx="6" cy="12" r="1.6" fill="currentColor" stroke="none"/><circle cx="12" cy="12" r="1.6" fill="currentColor" stroke="none"/><circle cx="18" cy="12" r="1.6" fill="currentColor" stroke="none"/>',
48
+ delegating: '<circle cx="6" cy="6" r="2"/><circle cx="18" cy="6" r="2"/><circle cx="12" cy="18" r="2"/><path d="M6 8v2c0 3 6 3 6 6M18 8v2c0 3-6 3-6 6"/>',
49
+ compacting: '<path d="M5 6h14M7 12h10M10 18h4"/>',
50
+ starting: '<path d="M12 4v4M12 16v4M4 12h4M16 12h4"/>',
51
+ permission: '<circle cx="8" cy="8" r="3.5"/><path d="M10.5 10.5L19 19M15.5 15.5l2-2M13 13l2-2"/>',
52
+ question: '<path d="M9 9.5a3 3 0 1 1 4.2 2.7c-.8.4-1.2 1-1.2 1.8v.5"/><circle cx="12" cy="17.5" r="1" fill="currentColor" stroke="none"/>',
53
+ failure: '<path d="M12 5v9"/><circle cx="12" cy="18" r="1.1" fill="currentColor" stroke="none"/>',
54
+ message: '<path d="M20 14a2 2 0 0 1-2 2H9l-4.5 3.5V6a2 2 0 0 1 2-2h11.5a2 2 0 0 1 2 2z"/>',
55
+ // The same silhouette filled: the project's mark once its name has stepped back.
56
+ 'folder-solid': '<path d="M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/>',
57
+ };
58
+ /** Marks drawn as a silhouette rather than a stroke. */
59
+ const FILLED_ICONS = new Set(['folder-solid']);
60
+ function iconSvg(name) {
61
+ if (name.startsWith(PROFILE_ICON_PREFIX))
62
+ return profileIconSvg(name.slice(PROFILE_ICON_PREFIX.length));
63
+ const inner = ICON_SVG[name];
64
+ if (!inner)
65
+ return undefined;
66
+ const paint = FILLED_ICONS.has(name)
67
+ ? 'fill="currentColor" stroke="none"'
68
+ : 'fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"';
69
+ return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" ${paint}>${inner}</svg>`;
70
+ }
71
+ /** The burn mark: a leaning flame with a sharp tip, so it reads as fire and not
72
+ * as a droplet at thirteen pixels. Filled when lit, outlined where there is no
73
+ * price to read. */
74
+ const FLAME_PATH = 'M12.2 1.8C14.6 5.6 18 8.6 18 13.4a6 6 0 0 1-12 0c0-2.7 1.1-4.5 2.5-5.8.2 1.8 1 2.9 2.1 3.3C9.3 7.5 10.1 4.1 12.2 1.8z';
75
+ const FLAME_SVG = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="${FLAME_PATH}" fill="currentColor"/></svg>`;
76
+ const FLAME_HOLLOW_SVG = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="${FLAME_PATH}" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linejoin="round"/></svg>`;
77
+ /** The ladder's own geometry: four marks, the gap between them, and the alphas. */
78
+ const FLAME_SIZE = 13;
79
+ const FLAME_GAP = 3;
80
+ const DOT_SVG = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><circle cx="12" cy="12" r="12" fill="currentColor"/></svg>';
81
+ async function compile(device, label, source) {
82
+ const module = device.createShaderModule({ label, code: `${commonShader}\n${source}` });
83
+ const info = await module.getCompilationInfo();
84
+ const errors = info.messages.filter((message) => message.type === 'error');
85
+ if (errors.length > 0) {
86
+ throw new Error(`${label}: ${errors.map((message) => `${message.lineNum}:${message.linePos} ${message.message}`).join('; ')}`);
87
+ }
88
+ return module;
89
+ }
90
+ const PREMULTIPLIED_OVER = {
91
+ color: { srcFactor: 'one', dstFactor: 'one-minus-src-alpha', operation: 'add' },
92
+ alpha: { srcFactor: 'one', dstFactor: 'one-minus-src-alpha', operation: 'add' },
93
+ };
94
+ /** The clearings' blend: the target keeps (1 − the fragment's alpha) of itself.
95
+ * The canvas is premultiplied, so scaling colour and alpha together is exactly
96
+ * the page's own ground laid over the frame at that alpha. */
97
+ const ERASE = {
98
+ color: { srcFactor: 'zero', dstFactor: 'one-minus-src-alpha', operation: 'add' },
99
+ alpha: { srcFactor: 'zero', dstFactor: 'one-minus-src-alpha', operation: 'add' },
100
+ };
101
+ async function loadMarks(device) {
102
+ const texture = device.createTexture({
103
+ label: 'swarm marks',
104
+ size: { width: AGENT_MARK_ATLAS.width, height: AGENT_MARK_ATLAS.height },
105
+ format: 'r8unorm',
106
+ usage: GPUTextureUsage.TEXTURE_BINDING | GPUTextureUsage.COPY_DST | GPUTextureUsage.RENDER_ATTACHMENT,
107
+ });
108
+ try {
109
+ const image = new Image();
110
+ image.src = AGENT_MARK_ATLAS.url;
111
+ await image.decode();
112
+ const bitmap = await createImageBitmap(image, { premultiplyAlpha: 'none', colorSpaceConversion: 'none' });
113
+ device.queue.copyExternalImageToTexture({ source: bitmap }, { texture }, { width: bitmap.width, height: bitmap.height });
114
+ bitmap.close();
115
+ }
116
+ catch (error) {
117
+ // An undecodable atlas leaves an empty field: every mark falls back to nothing
118
+ // rather than to garbage, and the letter marks still come from the glyph atlas.
119
+ console.warn('[swarm] vendor marks atlas did not load', error);
120
+ }
121
+ return texture;
122
+ }
123
+ /** A light in a STATE's own colour, as against the ink a working body is lit with. */
124
+ function isStateLight(light) {
125
+ return light === 'orange' || light === 'blue';
126
+ }
127
+ /** The ground a body wears when it needs the user, or nothing for the rest. A
128
+ * working body's light is the ink itself and fills nothing. */
129
+ function stateGroundOf(theme, light) {
130
+ if (light === 'orange')
131
+ return theme.stateGround.orange;
132
+ if (light === 'blue')
133
+ return theme.stateGround.blue;
134
+ return undefined;
135
+ }
136
+ /** The same colour at another alpha: every rung of the ladder is one ink at a weight. */
137
+ function withAlpha(colour, alpha) {
138
+ return [colour[0], colour[1], colour[2], alpha];
139
+ }
140
+ export async function createSwarmRenderer(canvas) {
141
+ if (typeof navigator === 'undefined' || !navigator.gpu)
142
+ return { ok: false, reason: 'WebGPU is not available in this window' };
143
+ const adapter = await navigator.gpu.requestAdapter({ powerPreference: 'high-performance' });
144
+ if (!adapter)
145
+ return { ok: false, reason: 'No WebGPU adapter on this GPU' };
146
+ // The canvas is the window, or in the lab a whole document: ask for the
147
+ // adapter's real texture limit instead of the 8192 default.
148
+ const device = await adapter.requestDevice({
149
+ label: 'godview swarm',
150
+ requiredLimits: { maxTextureDimension2D: adapter.limits.maxTextureDimension2D },
151
+ });
152
+ const context = canvas.getContext('webgpu');
153
+ if (!context) {
154
+ device.destroy();
155
+ return { ok: false, reason: 'The canvas has no WebGPU context' };
156
+ }
157
+ const format = navigator.gpu.getPreferredCanvasFormat();
158
+ context.configure({ device, format, alphaMode: 'premultiplied' });
159
+ device.addEventListener('uncapturederror', (event) => {
160
+ console.error('[swarm] WebGPU error', event.error.message);
161
+ });
162
+ const [fieldModule, shadowModule, bodyModule, glowModule, textModule, eraseModule, hubModule] = await Promise.all([
163
+ compile(device, 'swarm field', fieldShader),
164
+ compile(device, 'swarm shadow', shadowShader),
165
+ compile(device, 'swarm body', bodyShader),
166
+ compile(device, 'swarm glow', glowShader),
167
+ compile(device, 'swarm text', textShader),
168
+ compile(device, 'swarm erase', eraseShader),
169
+ compile(device, 'swarm hub', hubShader),
170
+ ]);
171
+ const sceneLayout = device.createBindGroupLayout({
172
+ label: 'swarm scene',
173
+ entries: [
174
+ { binding: 0, visibility: GPUShaderStage.VERTEX | GPUShaderStage.FRAGMENT, buffer: { type: 'uniform' } },
175
+ {
176
+ binding: 1,
177
+ visibility: GPUShaderStage.VERTEX | GPUShaderStage.FRAGMENT,
178
+ buffer: { type: 'read-only-storage' },
179
+ },
180
+ ],
181
+ });
182
+ const textLayout = device.createBindGroupLayout({
183
+ label: 'swarm text',
184
+ entries: [
185
+ {
186
+ binding: 0,
187
+ visibility: GPUShaderStage.VERTEX | GPUShaderStage.FRAGMENT,
188
+ buffer: { type: 'read-only-storage' },
189
+ },
190
+ { binding: 1, visibility: GPUShaderStage.FRAGMENT, texture: { sampleType: 'float' } },
191
+ { binding: 2, visibility: GPUShaderStage.FRAGMENT, sampler: { type: 'filtering' } },
192
+ { binding: 3, visibility: GPUShaderStage.FRAGMENT, texture: { sampleType: 'float' } },
193
+ ],
194
+ });
195
+ const scenePipelineLayout = device.createPipelineLayout({ bindGroupLayouts: [sceneLayout] });
196
+ const textPipelineLayout = device.createPipelineLayout({ bindGroupLayouts: [sceneLayout, textLayout] });
197
+ const pipeline = (label, module, layout, blend = PREMULTIPLIED_OVER) => device.createRenderPipelineAsync({
198
+ label,
199
+ layout,
200
+ vertex: { module, entryPoint: 'vs' },
201
+ fragment: { module, entryPoint: 'fs', targets: [{ format, blend }] },
202
+ primitive: { topology: 'triangle-list' },
203
+ });
204
+ const [fieldPipeline, shadowPipeline, bodyPipeline, glowPipeline, textPipeline, erasePipeline, hubPipeline] = await Promise.all([
205
+ pipeline('swarm field', fieldModule, scenePipelineLayout),
206
+ pipeline('swarm shadow', shadowModule, scenePipelineLayout),
207
+ pipeline('swarm body', bodyModule, scenePipelineLayout),
208
+ pipeline('swarm glow', glowModule, scenePipelineLayout),
209
+ pipeline('swarm text', textModule, textPipelineLayout),
210
+ pipeline('swarm erase', eraseModule, scenePipelineLayout, ERASE),
211
+ pipeline('swarm hub', hubModule, scenePipelineLayout),
212
+ ]);
213
+ const frameBuffer = device.createBuffer({
214
+ label: 'swarm frame',
215
+ size: FRAME_FLOATS * 4,
216
+ usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST,
217
+ });
218
+ const sampler = device.createSampler({ magFilter: 'linear', minFilter: 'linear' });
219
+ const atlas = new GlyphAtlas(device, Math.max(1, window.devicePixelRatio || 1), undefined, () => canvas.ownerDocument.createElement('canvas'));
220
+ const marks = await loadMarks(device);
221
+ let bodyCapacity = INITIAL_BODIES;
222
+ let glyphCapacity = INITIAL_GLYPHS;
223
+ let bodyBuffer;
224
+ let glyphBuffer;
225
+ let sceneBindGroup;
226
+ let textBindGroup;
227
+ let bodyData = new Float32Array(0);
228
+ let bodyFlags = new Uint32Array(0);
229
+ let glyphData = new Float32Array(0);
230
+ const frameData = new Float32Array(FRAME_FLOATS);
231
+ const allocateBodies = (capacity) => {
232
+ bodyCapacity = capacity;
233
+ bodyBuffer?.destroy();
234
+ bodyBuffer = device.createBuffer({
235
+ label: 'swarm bodies',
236
+ size: capacity * BODY_FLOATS * 4,
237
+ usage: GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_DST,
238
+ });
239
+ bodyData = new Float32Array(capacity * BODY_FLOATS);
240
+ bodyFlags = new Uint32Array(bodyData.buffer);
241
+ sceneBindGroup = device.createBindGroup({
242
+ layout: sceneLayout,
243
+ entries: [
244
+ { binding: 0, resource: { buffer: frameBuffer } },
245
+ { binding: 1, resource: { buffer: bodyBuffer } },
246
+ ],
247
+ });
248
+ };
249
+ const allocateGlyphs = (capacity) => {
250
+ glyphCapacity = capacity;
251
+ glyphBuffer?.destroy();
252
+ glyphBuffer = device.createBuffer({
253
+ label: 'swarm glyphs',
254
+ size: capacity * GLYPH_FLOATS * 4,
255
+ usage: GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_DST,
256
+ });
257
+ glyphData = new Float32Array(capacity * GLYPH_FLOATS);
258
+ textBindGroup = device.createBindGroup({
259
+ layout: textLayout,
260
+ entries: [
261
+ { binding: 0, resource: { buffer: glyphBuffer } },
262
+ { binding: 1, resource: atlas.texture.createView() },
263
+ { binding: 2, resource: sampler },
264
+ { binding: 3, resource: marks.createView() },
265
+ ],
266
+ });
267
+ };
268
+ allocateBodies(bodyCapacity);
269
+ allocateGlyphs(glyphCapacity);
270
+ let width = 1;
271
+ let height = 1;
272
+ let dpr = atlas.dpr;
273
+ let heldTime = 0;
274
+ let glyphCount = 0;
275
+ let destroyed = false;
276
+ // When each pending body began to turn, on the held clock, by body id: its
277
+ // dashes start from where they stood, and stand still with the motion.
278
+ const turnStarts = new Map();
279
+ const turnedThisFrame = new Set();
280
+ /** How far a pending body's dashes have turned, radians clockwise; 0 until the model says it turns. */
281
+ const dashTurn = (model) => {
282
+ if (!model.pending?.turning)
283
+ return 0;
284
+ let start = turnStarts.get(model.id);
285
+ if (start === undefined) {
286
+ start = heldTime;
287
+ turnStarts.set(model.id, start);
288
+ }
289
+ turnedThisFrame.add(model.id);
290
+ return (heldTime - start) / DASH_TURN_SECONDS;
291
+ };
292
+ const toneColour = (tone, body, ink, theme) => {
293
+ switch (tone) {
294
+ // Words and marks take the readable variant; only the body's light is the
295
+ // full hue.
296
+ case 'orange':
297
+ return theme.stateInk.orange;
298
+ case 'green':
299
+ return theme.stateInk.green;
300
+ case 'blue':
301
+ return theme.stateInk.blue;
302
+ case 'accent':
303
+ return body.accent;
304
+ default:
305
+ return ink;
306
+ }
307
+ };
308
+ const pushGlyph = (x, y, w, h, u0, v0, u1, v1, colour, alpha, field = 0) => {
309
+ if (glyphCount >= glyphCapacity) {
310
+ const previous = glyphData;
311
+ allocateGlyphs(glyphCapacity * 2);
312
+ glyphData.set(previous);
313
+ }
314
+ const offset = glyphCount * GLYPH_FLOATS;
315
+ glyphData[offset] = x;
316
+ glyphData[offset + 1] = y;
317
+ glyphData[offset + 2] = w;
318
+ glyphData[offset + 3] = h;
319
+ glyphData[offset + 4] = u0;
320
+ glyphData[offset + 5] = v0;
321
+ glyphData[offset + 6] = u1;
322
+ glyphData[offset + 7] = v1;
323
+ glyphData[offset + 8] = colour[0];
324
+ glyphData[offset + 9] = colour[1];
325
+ glyphData[offset + 10] = colour[2];
326
+ glyphData[offset + 11] = colour[3] * alpha;
327
+ glyphData[offset + 12] = field > 0 ? 1 : 0;
328
+ glyphData[offset + 13] = field;
329
+ glyphData[offset + 14] = 0;
330
+ glyphData[offset + 15] = 0;
331
+ glyphCount += 1;
332
+ };
333
+ /** A tile from the signed-distance atlas, `size` CSS px, centred on (cx, cy). */
334
+ const pushTile = (tile, size, cx, cy, colour, alpha) => {
335
+ const { width, height, tile: texels, pxRange } = AGENT_MARK_ATLAS;
336
+ const screenPxRange = (pxRange * size * dpr) / texels;
337
+ pushGlyph(cx - size / 2, cy - size / 2, size, size, tile.x / width, tile.y / height, (tile.x + texels) / width, (tile.y + texels) / height, colour, alpha, screenPxRange);
338
+ };
339
+ /** A provider's mark, or false when it has only a letter. */
340
+ const pushMark = (providerId, size, cx, cy, colour, alpha) => {
341
+ const tile = agentMarkTile(providerId);
342
+ if (!tile)
343
+ return false;
344
+ pushTile(tile, size, cx, cy, colour, alpha);
345
+ return true;
346
+ };
347
+ const pushSprite = (key, svg, size, cx, cy, colour, alpha) => {
348
+ if (!svg)
349
+ return;
350
+ const region = atlas.sprite(key, svg, size);
351
+ if (!region)
352
+ return;
353
+ pushGlyph(cx - region.width / 2, cy - region.height / 2, region.width, region.height, region.u0, region.v0, region.u1, region.v1, colour, alpha);
354
+ };
355
+ const pushText = (text, style, x, baseline, colour, alpha) => {
356
+ const spacing = (style.letterSpacing ?? 0) * style.size;
357
+ let pen = x;
358
+ for (const character of text) {
359
+ const region = atlas.glyph(character, style);
360
+ if (!region)
361
+ return;
362
+ if (character !== ' ') {
363
+ pushGlyph(pen + region.left, baseline + region.top, region.width, region.height, region.u0, region.v0, region.u1, region.v1, colour, alpha);
364
+ }
365
+ pen += region.advance + spacing;
366
+ }
367
+ };
368
+ const copyLayoutOf = (body) => layoutCopy(body.model.copy, {
369
+ radius: body.radius * body.scale,
370
+ measure: (text, style) => atlas.measure(text, style),
371
+ maxWidthRatio: body.model.copyMaxWidthRatio,
372
+ });
373
+ /** The burn row's centre, relative to the body's own centre: midway between a
374
+ * margin under the model line and a margin above the total figure, so the
375
+ * flames stand where the chart used to, whatever the radius. */
376
+ const burnRowOf = (body, layout) => {
377
+ const radius = body.radius * body.scale;
378
+ const modelLine = layout.lines.find((line) => line.key === 'model');
379
+ const under = modelLine ? modelLine.y + modelLine.height / 2 : layout.bottom;
380
+ const top = under + BAND_MARGIN_TOP;
381
+ const floor = Math.max(top + 4, radius - FIGURE_MARGIN - FIGURE_STYLE.size - BAND_MARGIN_BOTTOM);
382
+ return (top + floor) / 2;
383
+ };
384
+ /**
385
+ * The burn ladder: as many flames as the rate has lit, and no empty slots
386
+ * (2026-09-18). A calm session draws nothing at all, which is the honest thing
387
+ * for a body with nothing to say. The one exception is a session nobody can
388
+ * price: it draws a single hollow flame, because an absent reading must never
389
+ * look like a calm one (RFC 008). The last lit flame breathes on the newest
390
+ * bucket's rhythm, as the newest column used to. Ink only — a colour here would
391
+ * collide with the states' own (record §10).
392
+ */
393
+ const emitBurn = (body, ink, time, motion, layout, dim, rung) => {
394
+ const burn = body.model.burn;
395
+ if (!burn)
396
+ return;
397
+ const drawn = burn.priced ? burn.lit : 1;
398
+ if (drawn === 0)
399
+ return;
400
+ const rowY = body.y + burnRowOf(body, layout);
401
+ const span = drawn * FLAME_SIZE + (drawn - 1) * FLAME_GAP;
402
+ const breath = motion ? 0.5 - 0.5 * Math.cos((time * 2 * Math.PI) / 1.6 + body.seed) : 0.5;
403
+ for (let slot = 0; slot < drawn; slot += 1) {
404
+ const x = body.x - span / 2 + FLAME_SIZE / 2 + slot * (FLAME_SIZE + FLAME_GAP);
405
+ // Each flame climbs the range the gauge climbs: the first sits low, the
406
+ // fourth reaches the title's own weight, because a body burning that hard is
407
+ // the most important thing on the stage. The last one breathes.
408
+ const alpha = burn.priced
409
+ ? climb(slot / 3) * (slot === burn.lit - 1 ? 0.82 + 0.18 * breath : 1)
410
+ : SWARM_WEIGHT.absent;
411
+ pushSprite(burn.priced ? 'flame' : 'flame-hollow', burn.priced ? FLAME_SVG : FLAME_HOLLOW_SVG, FLAME_SIZE, x, rowY, ink, rung(alpha) * dim);
412
+ }
413
+ };
414
+ const emitBodyText = (body, ink, theme, time, motion, layout) => {
415
+ const { model } = body;
416
+ const radius = body.radius * body.scale;
417
+ const dim = body.opacity * (model.stale ? 0.58 : 1);
418
+ // A coloured ground gives the ink less room, so the ladder starts higher on it.
419
+ const rung = stateGroundOf(theme, model.light) === undefined ? (weight) => weight : onField;
420
+ if (radius < 12)
421
+ return;
422
+ if (model.watermark) {
423
+ // The ignition's breath, kept from the DOM: a working mark swells from
424
+ // 0.92 to 1.08 and brightens from 8% to 24% every 1.5s.
425
+ const breathing = motion && model.appearance === 'working';
426
+ const k = breathing ? 0.5 - 0.5 * Math.cos((time * 2 * Math.PI) / 1.5 + body.seed) : 0.5;
427
+ const size = (radius <= 40 ? 46 : 58) * (breathing ? 0.92 + 0.16 * k : 1);
428
+ const opacity = (breathing ? 0.08 + 0.16 * k : model.watermark.opacity) * dim;
429
+ const cx = body.x;
430
+ // Lifted above the copy's centre so the branch line clears its densest part.
431
+ const cy = body.y - 0.27 * radius;
432
+ if (!pushMark(model.watermark.sprite, size, cx, cy, ink, opacity)) {
433
+ pushSprite(`mark:${model.watermark.sprite}`, agentMarkSvg(model.watermark.sprite), Math.round(size), cx, cy, ink, opacity);
434
+ }
435
+ }
436
+ for (const line of layout.lines) {
437
+ const colour = toneColour(line.tone, body, ink, theme);
438
+ const alpha = rung(line.opacity) * dim;
439
+ const lineY = body.y + line.y;
440
+ let pen = body.x - line.width / 2;
441
+ const mark = (lead) => {
442
+ const leadColour = toneColour(lead.tone ?? line.tone, body, ink, theme);
443
+ const leadAlpha = rung(lead.opacity ?? line.opacity) * dim;
444
+ const leadCentreX = pen + leadAdvance(lead) / 2;
445
+ if (lead.kind === 'dot')
446
+ pushSprite('dot', DOT_SVG, lead.size, leadCentreX, lineY - 0.5, leadColour, leadAlpha);
447
+ else
448
+ pushSprite(`icon:${lead.icon}`, iconSvg(lead.icon ?? ''), lead.size, leadCentreX, lineY, leadColour, leadAlpha);
449
+ pen += leadAdvance(lead) + lead.gap;
450
+ };
451
+ if (line.lead)
452
+ mark(line.lead);
453
+ if (line.text.length === 0)
454
+ continue;
455
+ const metrics = atlas.fontMetrics(line.style);
456
+ const baseline = lineY + (metrics.ascent - metrics.descent) / 2;
457
+ pushText(line.text, line.style, pen, baseline, colour, alpha);
458
+ }
459
+ const figure = (item, centreY) => {
460
+ // The gauge's own climb already says a context is nearly spent; the figure
461
+ // beside it needs no second alarm, and orange now means one thing only.
462
+ const colour = ink;
463
+ const alpha = rung(item.none ? SWARM_WEIGHT.absent : SWARM_WEIGHT.secondary) * dim;
464
+ const textWidth = atlas.measure(item.text, FIGURE_STYLE);
465
+ const metrics = atlas.fontMetrics(FIGURE_STYLE);
466
+ pushText(item.text, FIGURE_STYLE, body.x - textWidth / 2, centreY + (metrics.ascent - metrics.descent) / 2, colour, alpha);
467
+ };
468
+ // The context figure on the top chord and the total on the bottom one,
469
+ // under the burn row, each the same distance in from the rim.
470
+ const figureInset = FIGURE_MARGIN + FIGURE_STYLE.size / 2;
471
+ if (model.figures?.top)
472
+ figure(model.figures.top, body.y - radius + figureInset);
473
+ if (model.figures?.bottom)
474
+ figure(model.figures.bottom, body.y + radius - figureInset);
475
+ emitBurn(body, ink, time, motion, layout, dim, rung);
476
+ };
477
+ const packBody = (index, body, frame) => {
478
+ const { model } = body;
479
+ const theme = frame.theme;
480
+ const offset = index * BODY_FLOATS;
481
+ // One surface, one ink, in both themes (2026-09-18). A body's edge is the
482
+ // faintest rung of the ladder; a hollow terminal's dashed rim and a working
483
+ // body's border earn a little more.
484
+ const rimWeight = model.hollow
485
+ ? SWARM_WEIGHT.rim
486
+ : model.appearance === 'working'
487
+ ? SWARM_WEIGHT.edge
488
+ : SWARM_WEIGHT.hairline;
489
+ // A body that needs the user is filled with the state's own colour, and its
490
+ // words are still the theme's ink — light on dark, dark on light, the same
491
+ // direction every other body follows.
492
+ const fill = stateGroundOf(theme, model.light) ?? theme.surface;
493
+ const colours = { fill, ink: theme.ink, rim: withAlpha(theme.ink, rimWeight) };
494
+ // The light inside the body is the STATE's colour — the theme's own ink while
495
+ // working, orange while blocked, blue for an unread reply. The project's colour
496
+ // reaches the body only as the folder before its name (2026-09-16). The ink is
497
+ // held back: on a light theme it can only darken, so it reads as density at the
498
+ // centre rather than as a glow.
499
+ // The light itself: the state's own glow over the ground it sits on, or the
500
+ // theme's ink for a working body, which is a density and not a colour.
501
+ const lightColour = model.light === undefined
502
+ ? [0, 0, 0, 0]
503
+ : model.light === 'orange'
504
+ ? theme.stateGlow.orange
505
+ : model.light === 'blue'
506
+ ? theme.stateGlow.blue
507
+ : withAlpha(theme.ink, WORKING_CORE_STRENGTH);
508
+ let flags = 0;
509
+ if (model.hollow)
510
+ flags |= F_HOLLOW;
511
+ if (model.running)
512
+ flags |= F_RUNNING;
513
+ if (model.light)
514
+ flags |= F_CORE;
515
+ // A body that needs the user glows in waves rather than breathing.
516
+ if (isStateLight(model.light))
517
+ flags |= F_WAVES;
518
+ // The outer light: only on the body whose pane is the selected one. Every
519
+ // other mounted body wears its colour as the band alone.
520
+ if (body.link && model.active)
521
+ flags |= F_GLOW;
522
+ if (model.appearance === 'working' && !model.hollow)
523
+ flags |= F_RIM | F_SHADOW;
524
+ if (model.stale)
525
+ flags |= F_STALE;
526
+ if (body.link)
527
+ flags |= F_LINKED;
528
+ if (body.focus)
529
+ flags |= F_FOCUS;
530
+ if (model.ring)
531
+ flags |= F_RING;
532
+ if (model.ring?.hot)
533
+ flags |= F_RING_HOT;
534
+ if (model.pending)
535
+ flags |= F_PENDING;
536
+ bodyData[offset] = body.x;
537
+ bodyData[offset + 1] = body.y;
538
+ bodyData[offset + 2] = body.radius;
539
+ bodyData[offset + 3] = body.scale;
540
+ writeRgba(bodyData, offset + 4, colours.fill, body.opacity);
541
+ writeRgba(bodyData, offset + 8, colours.ink);
542
+ writeRgba(bodyData, offset + 12, lightColour, body.opacity);
543
+ writeRgba(bodyData, offset + 16, colours.rim, body.opacity);
544
+ bodyFlags[offset + 20] = flags;
545
+ bodyFlags[offset + 21] = 0;
546
+ bodyFlags[offset + 22] = 0;
547
+ bodyFlags[offset + 23] = 0;
548
+ bodyData[offset + 24] = model.ring ? model.ring.percent / 100 : 0;
549
+ // The gauge climbs as it goes round; the track behind it stays the faintest rung.
550
+ bodyData[offset + 25] = climb(0);
551
+ bodyData[offset + 26] = SWARM_WEIGHT.hairline * body.opacity;
552
+ bodyData[offset + 27] = climb(1);
553
+ const glow = body.glow ?? frame.glow;
554
+ bodyData[offset + 28] = glow.reach;
555
+ bodyData[offset + 29] = glow.strength * body.opacity;
556
+ bodyData[offset + 30] = glow.breath;
557
+ bodyData[offset + 31] = body.seed;
558
+ bodyData[offset + 32] = dashTurn(model);
559
+ bodyData[offset + 33] = body.seed;
560
+ bodyData[offset + 34] = model.stale ? 1 : 0;
561
+ bodyData[offset + 35] = body.opacity;
562
+ writeRgba(bodyData, offset + 36, body.link ?? [0, 0, 0, 0], body.opacity);
563
+ return colours.ink;
564
+ };
565
+ const lost = device.lost;
566
+ const renderer = {
567
+ lost,
568
+ resize(nextWidth, nextHeight, nextDpr) {
569
+ width = Math.max(1, nextWidth);
570
+ height = Math.max(1, nextHeight);
571
+ dpr = Math.max(1, nextDpr);
572
+ const pixelWidth = Math.max(1, Math.round(width * dpr));
573
+ const pixelHeight = Math.max(1, Math.round(height * dpr));
574
+ if (canvas.width !== pixelWidth)
575
+ canvas.width = pixelWidth;
576
+ if (canvas.height !== pixelHeight)
577
+ canvas.height = pixelHeight;
578
+ atlas.setDpr(dpr);
579
+ },
580
+ measure(text, style) {
581
+ return atlas.measure(text, style);
582
+ },
583
+ render(frame) {
584
+ if (destroyed)
585
+ return;
586
+ const bodies = frame.bodies;
587
+ if (bodies.length > bodyCapacity) {
588
+ let capacity = bodyCapacity;
589
+ while (capacity < bodies.length)
590
+ capacity *= 2;
591
+ allocateBodies(capacity);
592
+ }
593
+ if (frame.motion)
594
+ heldTime = frame.time;
595
+ const time = heldTime;
596
+ const theme = frame.theme;
597
+ // Two groups, each one instance range in painter's order: the field's
598
+ // bodies, then the bodies being born, which are drawn over the clearings.
599
+ glyphCount = 0;
600
+ let packed = 0;
601
+ const pack = (body) => {
602
+ const layout = copyLayoutOf(body);
603
+ const ink = packBody(packed, body, frame);
604
+ emitBodyText(body, ink, theme, time, frame.motion, layout);
605
+ packed += 1;
606
+ };
607
+ for (const body of bodies)
608
+ if (!body.aboveClearings)
609
+ pack(body);
610
+ const bodiesBelow = packed;
611
+ for (const mark of frame.marks ?? [])
612
+ pushTile(mark.tile, mark.size, mark.x, mark.y, mark.colour, mark.alpha);
613
+ const glyphsBelow = glyphCount;
614
+ for (const body of bodies)
615
+ if (body.aboveClearings)
616
+ pack(body);
617
+ atlas.flush();
618
+ // A body that stopped turning (or left) starts afresh if it turns again.
619
+ for (const id of turnStarts.keys())
620
+ if (!turnedThisFrame.has(id))
621
+ turnStarts.delete(id);
622
+ turnedThisFrame.clear();
623
+ packFrame(frameData, frame, { width, height, dpr, time });
624
+ device.queue.writeBuffer(frameBuffer, 0, frameData);
625
+ if (bodies.length > 0) {
626
+ device.queue.writeBuffer(bodyBuffer, 0, bodyData, 0, bodies.length * BODY_FLOATS);
627
+ }
628
+ if (glyphCount > 0)
629
+ device.queue.writeBuffer(glyphBuffer, 0, glyphData, 0, glyphCount * GLYPH_FLOATS);
630
+ const encoder = device.createCommandEncoder({ label: 'swarm frame' });
631
+ const pass = encoder.beginRenderPass({
632
+ colorAttachments: [
633
+ {
634
+ view: context.getCurrentTexture().createView(),
635
+ clearValue: { r: 0, g: 0, b: 0, a: 0 },
636
+ loadOp: 'clear',
637
+ storeOp: 'store',
638
+ },
639
+ ],
640
+ });
641
+ const drawBodies = (first, count) => {
642
+ if (count === 0)
643
+ return;
644
+ pass.setPipeline(shadowPipeline);
645
+ pass.draw(6, count, 0, first);
646
+ pass.setPipeline(bodyPipeline);
647
+ pass.draw(6, count, 0, first);
648
+ pass.setPipeline(glowPipeline);
649
+ pass.draw(6, count, 0, first);
650
+ };
651
+ const drawType = (first, count) => {
652
+ if (count === 0)
653
+ return;
654
+ pass.setPipeline(textPipeline);
655
+ pass.setBindGroup(1, textBindGroup);
656
+ pass.draw(6, count, 0, first);
657
+ };
658
+ pass.setBindGroup(0, sceneBindGroup);
659
+ pass.setPipeline(fieldPipeline);
660
+ pass.draw(3);
661
+ drawBodies(0, bodiesBelow);
662
+ drawType(0, glyphsBelow);
663
+ // The clearings erase what the field drew under the bloom and its words.
664
+ if (frameData[FRAME_LAYOUT.clearing] > 0) {
665
+ pass.setPipeline(erasePipeline);
666
+ pass.draw(3);
667
+ }
668
+ drawBodies(bodiesBelow, packed - bodiesBelow);
669
+ drawType(glyphsBelow, glyphCount - glyphsBelow);
670
+ // The hold ring last, over everything the field drew: while the spawn
671
+ // bloom is open it is the hub the whole gesture turns on.
672
+ if (frameData[FRAME_LAYOUT.pointer + 3] > 0) {
673
+ pass.setPipeline(hubPipeline);
674
+ pass.draw(6);
675
+ }
676
+ pass.end();
677
+ device.queue.submit([encoder.finish()]);
678
+ },
679
+ destroy() {
680
+ if (destroyed)
681
+ return;
682
+ destroyed = true;
683
+ atlas.destroy();
684
+ marks.destroy();
685
+ bodyBuffer?.destroy();
686
+ glyphBuffer?.destroy();
687
+ frameBuffer.destroy();
688
+ // The canvas context is shared by every renderer ever made for this
689
+ // canvas (React's development double-mount makes two in a row), so it is
690
+ // left configured; destroying the device is what releases this one.
691
+ device.destroy();
692
+ },
693
+ };
694
+ return { ok: true, renderer };
695
+ }
696
+ //# sourceMappingURL=swarm-renderer.js.map