@sixb/app 0.2.1 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (494) hide show
  1. package/dist/agent/activity-label.d.ts.map +1 -1
  2. package/dist/agent/agent-chat.d.ts +9 -2
  3. package/dist/agent/agent-chat.d.ts.map +1 -1
  4. package/dist/agent/agent-panel.d.ts +9 -1
  5. package/dist/agent/agent-panel.d.ts.map +1 -1
  6. package/dist/agent/agent-surface.d.ts.map +1 -1
  7. package/dist/agent/artifact-card.d.ts +3 -1
  8. package/dist/agent/artifact-card.d.ts.map +1 -1
  9. package/dist/agent/artifact-panel.d.ts +7 -1
  10. package/dist/agent/artifact-panel.d.ts.map +1 -1
  11. package/dist/agent/background/background-tool-row.d.ts.map +1 -1
  12. package/dist/agent/background/interpret.d.ts +1 -1
  13. package/dist/agent/background/interpret.d.ts.map +1 -1
  14. package/dist/agent/components/composer-place.d.ts +3 -1
  15. package/dist/agent/components/composer-place.d.ts.map +1 -1
  16. package/dist/agent/components/composer.d.ts +20 -1
  17. package/dist/agent/components/composer.d.ts.map +1 -1
  18. package/dist/agent/components/context-chips.d.ts.map +1 -1
  19. package/dist/agent/components/context-meter.d.ts +1 -1
  20. package/dist/agent/components/conversation-panel.d.ts +7 -2
  21. package/dist/agent/components/conversation-panel.d.ts.map +1 -1
  22. package/dist/agent/components/message-parts.d.ts +3 -1
  23. package/dist/agent/components/message-parts.d.ts.map +1 -1
  24. package/dist/agent/components/thread-artifacts-menu.d.ts.map +1 -1
  25. package/dist/agent/components/transcript.d.ts +5 -0
  26. package/dist/agent/components/transcript.d.ts.map +1 -1
  27. package/dist/agent/composer-insertion.d.ts +24 -0
  28. package/dist/agent/composer-insertion.d.ts.map +1 -0
  29. package/dist/agent/delegation/agent-exchange.d.ts +16 -0
  30. package/dist/agent/delegation/agent-exchange.d.ts.map +1 -0
  31. package/dist/agent/delegation/child-card.d.ts +3 -3
  32. package/dist/agent/delegation/child-card.d.ts.map +1 -1
  33. package/dist/agent/delegation/child-parts.d.ts +1 -10
  34. package/dist/agent/delegation/child-parts.d.ts.map +1 -1
  35. package/dist/agent/delegation/child-work.d.ts.map +1 -1
  36. package/dist/agent/delegation/interpret.d.ts +4 -10
  37. package/dist/agent/delegation/interpret.d.ts.map +1 -1
  38. package/dist/agent/delegation/use-children.d.ts +5 -5
  39. package/dist/agent/delegation/use-children.d.ts.map +1 -1
  40. package/dist/agent/file-edits/file-edit-tool-view.d.ts +10 -0
  41. package/dist/agent/file-edits/file-edit-tool-view.d.ts.map +1 -0
  42. package/dist/agent/file-edits/interpret.d.ts +25 -0
  43. package/dist/agent/file-edits/interpret.d.ts.map +1 -0
  44. package/dist/agent/hooks/use-agent-conversation.d.ts +16 -4
  45. package/dist/agent/hooks/use-agent-conversation.d.ts.map +1 -1
  46. package/dist/agent/hooks/use-new-thread-place.d.ts +39 -17
  47. package/dist/agent/hooks/use-new-thread-place.d.ts.map +1 -1
  48. package/dist/agent/hooks/use-thread-lists.d.ts.map +1 -1
  49. package/dist/agent/i18n/en.d.ts +59 -4
  50. package/dist/agent/i18n/en.d.ts.map +1 -1
  51. package/dist/agent/i18n/fr.d.ts.map +1 -1
  52. package/dist/agent/i18n/index.d.ts +96 -8
  53. package/dist/agent/i18n/index.d.ts.map +1 -1
  54. package/dist/agent/message-agent/interpret.d.ts +2 -2
  55. package/dist/agent/message-agent/interpret.d.ts.map +1 -1
  56. package/dist/agent/publish-artifact/interpret.d.ts +8 -2
  57. package/dist/agent/publish-artifact/interpret.d.ts.map +1 -1
  58. package/dist/agent/publish-artifact/open-artifact-tool-view.d.ts +9 -0
  59. package/dist/agent/publish-artifact/open-artifact-tool-view.d.ts.map +1 -0
  60. package/dist/agent/publish-artifact/publish-artifact-tool-view.d.ts +4 -2
  61. package/dist/agent/publish-artifact/publish-artifact-tool-view.d.ts.map +1 -1
  62. package/dist/agent/publish-artifact/use-live-publishes.d.ts +3 -3
  63. package/dist/agent/publish-artifact/use-live-publishes.d.ts.map +1 -1
  64. package/dist/agent/questions/interpret.d.ts +31 -0
  65. package/dist/agent/questions/interpret.d.ts.map +1 -0
  66. package/dist/agent/questions/question-card.d.ts +16 -0
  67. package/dist/agent/questions/question-card.d.ts.map +1 -0
  68. package/dist/agent/questions/question-composer.d.ts +15 -0
  69. package/dist/agent/questions/question-composer.d.ts.map +1 -0
  70. package/dist/agent/read/interpret.d.ts +8 -1
  71. package/dist/agent/read/interpret.d.ts.map +1 -1
  72. package/dist/agent/read/read-tool-view.d.ts.map +1 -1
  73. package/dist/agent/tool-views/built-in.d.ts.map +1 -1
  74. package/dist/agent/types.d.ts +3 -1
  75. package/dist/agent/types.d.ts.map +1 -1
  76. package/dist/agent/waits.d.ts +14 -0
  77. package/dist/agent/waits.d.ts.map +1 -0
  78. package/dist/artifacts/artifact-page.d.ts.map +1 -1
  79. package/dist/artifacts/artifact-viewer.d.ts +16 -0
  80. package/dist/artifacts/artifact-viewer.d.ts.map +1 -0
  81. package/dist/artifacts/card-details.d.ts +1 -1
  82. package/dist/artifacts/card-details.d.ts.map +1 -1
  83. package/dist/artifacts/card-preview.d.ts.map +1 -1
  84. package/dist/artifacts/comments-context.d.ts +48 -0
  85. package/dist/artifacts/comments-context.d.ts.map +1 -0
  86. package/dist/artifacts/edit-session.d.ts +17 -7
  87. package/dist/artifacts/edit-session.d.ts.map +1 -1
  88. package/dist/artifacts/file-source.d.ts.map +1 -1
  89. package/dist/artifacts/frame.d.ts +10 -2
  90. package/dist/artifacts/frame.d.ts.map +1 -1
  91. package/dist/artifacts/guest-badge.d.ts +8 -0
  92. package/dist/artifacts/guest-badge.d.ts.map +1 -0
  93. package/dist/artifacts/held-artifact.d.ts +19 -0
  94. package/dist/artifacts/held-artifact.d.ts.map +1 -0
  95. package/dist/artifacts/holders.d.ts +10 -0
  96. package/dist/artifacts/holders.d.ts.map +1 -0
  97. package/dist/artifacts/live/boards.d.ts +15 -0
  98. package/dist/artifacts/live/boards.d.ts.map +1 -0
  99. package/dist/artifacts/live/canvas.d.ts +79 -0
  100. package/dist/artifacts/live/canvas.d.ts.map +1 -0
  101. package/dist/artifacts/live/header.d.ts +29 -0
  102. package/dist/artifacts/live/header.d.ts.map +1 -0
  103. package/dist/artifacts/live/hooks.d.ts +21 -0
  104. package/dist/artifacts/live/hooks.d.ts.map +1 -0
  105. package/dist/artifacts/live/presence.d.ts +32 -0
  106. package/dist/artifacts/live/presence.d.ts.map +1 -0
  107. package/dist/artifacts/live/session.d.ts +130 -0
  108. package/dist/artifacts/live/session.d.ts.map +1 -0
  109. package/dist/artifacts/live/view.d.ts +28 -0
  110. package/dist/artifacts/live/view.d.ts.map +1 -0
  111. package/dist/artifacts/messages.d.ts +476 -14
  112. package/dist/artifacts/messages.d.ts.map +1 -1
  113. package/dist/artifacts/page-queries.d.ts +2 -2
  114. package/dist/artifacts/page-queries.d.ts.map +1 -1
  115. package/dist/artifacts/page-state.d.ts.map +1 -1
  116. package/dist/artifacts/publish-edit.d.ts +24 -14
  117. package/dist/artifacts/publish-edit.d.ts.map +1 -1
  118. package/dist/artifacts/queries.d.ts +490 -9
  119. package/dist/artifacts/queries.d.ts.map +1 -1
  120. package/dist/artifacts/references/references.d.ts.map +1 -1
  121. package/dist/artifacts/renderers/canvas/arrows.d.ts +0 -18
  122. package/dist/artifacts/renderers/canvas/arrows.d.ts.map +1 -1
  123. package/dist/artifacts/renderers/canvas/board-editor.d.ts +50 -0
  124. package/dist/artifacts/renderers/canvas/board-editor.d.ts.map +1 -0
  125. package/dist/artifacts/renderers/canvas/board-properties.d.ts +37 -0
  126. package/dist/artifacts/renderers/canvas/board-properties.d.ts.map +1 -0
  127. package/dist/artifacts/renderers/canvas/board-source.d.ts +18 -0
  128. package/dist/artifacts/renderers/canvas/board-source.d.ts.map +1 -0
  129. package/dist/artifacts/renderers/canvas/board.d.ts +77 -20
  130. package/dist/artifacts/renderers/canvas/board.d.ts.map +1 -1
  131. package/dist/artifacts/renderers/canvas/canvas.d.ts +14 -4
  132. package/dist/artifacts/renderers/canvas/canvas.d.ts.map +1 -1
  133. package/dist/artifacts/renderers/canvas/comment-pins.d.ts +84 -0
  134. package/dist/artifacts/renderers/canvas/comment-pins.d.ts.map +1 -0
  135. package/dist/artifacts/renderers/canvas/commenting.d.ts +58 -0
  136. package/dist/artifacts/renderers/canvas/commenting.d.ts.map +1 -0
  137. package/dist/artifacts/renderers/canvas/comments-panel.d.ts +27 -0
  138. package/dist/artifacts/renderers/canvas/comments-panel.d.ts.map +1 -0
  139. package/dist/artifacts/renderers/canvas/comments.d.ts +56 -0
  140. package/dist/artifacts/renderers/canvas/comments.d.ts.map +1 -0
  141. package/dist/artifacts/renderers/canvas/controls.d.ts +15 -4
  142. package/dist/artifacts/renderers/canvas/controls.d.ts.map +1 -1
  143. package/dist/artifacts/renderers/canvas/draft.d.ts +7 -6
  144. package/dist/artifacts/renderers/canvas/draft.d.ts.map +1 -1
  145. package/dist/artifacts/renderers/canvas/edit-mode.d.ts +19 -2
  146. package/dist/artifacts/renderers/canvas/edit-mode.d.ts.map +1 -1
  147. package/dist/artifacts/renderers/canvas/focus.d.ts +54 -5
  148. package/dist/artifacts/renderers/canvas/focus.d.ts.map +1 -1
  149. package/dist/artifacts/renderers/canvas/gestures.d.ts +46 -0
  150. package/dist/artifacts/renderers/canvas/gestures.d.ts.map +1 -0
  151. package/dist/artifacts/renderers/canvas/items.d.ts +47 -4
  152. package/dist/artifacts/renderers/canvas/items.d.ts.map +1 -1
  153. package/dist/artifacts/renderers/canvas/layout.d.ts +5 -8
  154. package/dist/artifacts/renderers/canvas/layout.d.ts.map +1 -1
  155. package/dist/artifacts/renderers/canvas/page-resize.d.ts +21 -0
  156. package/dist/artifacts/renderers/canvas/page-resize.d.ts.map +1 -0
  157. package/dist/artifacts/renderers/canvas/page-size-controls.d.ts +21 -0
  158. package/dist/artifacts/renderers/canvas/page-size-controls.d.ts.map +1 -0
  159. package/dist/artifacts/renderers/canvas/page-size.d.ts +93 -0
  160. package/dist/artifacts/renderers/canvas/page-size.d.ts.map +1 -0
  161. package/dist/artifacts/renderers/canvas/page-zoom.d.ts +64 -0
  162. package/dist/artifacts/renderers/canvas/page-zoom.d.ts.map +1 -0
  163. package/dist/artifacts/renderers/canvas/presence.d.ts +21 -0
  164. package/dist/artifacts/renderers/canvas/presence.d.ts.map +1 -0
  165. package/dist/artifacts/renderers/canvas/previews.d.ts +54 -0
  166. package/dist/artifacts/renderers/canvas/previews.d.ts.map +1 -0
  167. package/dist/artifacts/renderers/canvas/renderer.d.ts +11 -2
  168. package/dist/artifacts/renderers/canvas/renderer.d.ts.map +1 -1
  169. package/dist/artifacts/renderers/canvas/shown-size.d.ts +26 -0
  170. package/dist/artifacts/renderers/canvas/shown-size.d.ts.map +1 -0
  171. package/dist/artifacts/renderers/canvas/thumbnail.d.ts +5 -2
  172. package/dist/artifacts/renderers/canvas/thumbnail.d.ts.map +1 -1
  173. package/dist/artifacts/version-menu.d.ts +19 -0
  174. package/dist/artifacts/version-menu.d.ts.map +1 -0
  175. package/dist/artifacts/view-context.d.ts +43 -0
  176. package/dist/artifacts/view-context.d.ts.map +1 -0
  177. package/dist/artifacts/viewer.d.ts.map +1 -1
  178. package/dist/build.d.ts +5 -0
  179. package/dist/build.d.ts.map +1 -1
  180. package/dist/chunk-00wggsst.js +7 -0
  181. package/dist/chunk-00wggsst.js.map +10 -0
  182. package/dist/{chunk-q69001w3.js → chunk-694m74s7.js} +7 -1
  183. package/dist/{chunk-q69001w3.js.map → chunk-694m74s7.js.map} +3 -3
  184. package/dist/{chunk-7fj9cfkw.js → chunk-970s5nkn.js} +1 -1
  185. package/dist/{chunk-4mprsd2n.js → chunk-fg6thecb.js} +25 -1
  186. package/dist/chunk-fg6thecb.js.map +10 -0
  187. package/dist/{chunk-ytadd0b5.js → chunk-kymx9y5e.js} +8126 -4257
  188. package/dist/chunk-kymx9y5e.js.map +211 -0
  189. package/dist/{chunk-j8g956dt.js → chunk-pxd07kvx.js} +1 -1
  190. package/dist/{chunk-kwbw4dyk.js → chunk-ryed2jq8.js} +1 -1
  191. package/dist/chunk-yrcm1pbg.js +5975 -0
  192. package/dist/chunk-yrcm1pbg.js.map +34 -0
  193. package/dist/codegen.d.ts.map +1 -1
  194. package/dist/createCustomApp.d.ts.map +1 -1
  195. package/dist/index.d.ts +9 -1
  196. package/dist/index.d.ts.map +1 -1
  197. package/dist/index.js +932 -309
  198. package/dist/index.js.map +15 -10
  199. package/dist/locale-messages.d.ts +12 -0
  200. package/dist/locale-messages.d.ts.map +1 -1
  201. package/dist/locale.d.ts +12 -0
  202. package/dist/locale.d.ts.map +1 -1
  203. package/dist/locale.js +1 -1
  204. package/dist/metadata.d.ts +8 -0
  205. package/dist/metadata.d.ts.map +1 -1
  206. package/dist/pages/console/action-run.d.ts.map +1 -1
  207. package/dist/pages/console/data/connectors.d.ts.map +1 -1
  208. package/dist/pages/console/data/datasets.d.ts.map +1 -1
  209. package/dist/pages/console/data/lake-health.d.ts +3 -0
  210. package/dist/pages/console/data/lake-health.d.ts.map +1 -0
  211. package/dist/pages/console/data/messages.d.ts +98 -2
  212. package/dist/pages/console/data/messages.d.ts.map +1 -1
  213. package/dist/pages/console/data/pipelines.d.ts.map +1 -1
  214. package/dist/pages/console/data/projections.d.ts.map +1 -1
  215. package/dist/pages/console/data/syncs.d.ts.map +1 -1
  216. package/dist/pages/console/ontology/action-runs.d.ts.map +1 -1
  217. package/dist/pages/console/ontology/actions.d.ts.map +1 -1
  218. package/dist/pages/console/ontology/components/action-button.d.ts.map +1 -1
  219. package/dist/pages/console/ontology/components/artifact-picker.d.ts +36 -0
  220. package/dist/pages/console/ontology/components/artifact-picker.d.ts.map +1 -0
  221. package/dist/pages/console/ontology/components/object-query-bar.d.ts.map +1 -1
  222. package/dist/pages/console/ontology/lib/action-params.d.ts +2 -0
  223. package/dist/pages/console/ontology/lib/action-params.d.ts.map +1 -1
  224. package/dist/pages/console/ontology/lineage/properties-panel.d.ts +2 -1
  225. package/dist/pages/console/ontology/lineage/properties-panel.d.ts.map +1 -1
  226. package/dist/pages/console/ontology/object-page.d.ts.map +1 -1
  227. package/dist/pages/console/ontology/object-type.d.ts.map +1 -1
  228. package/dist/pages/console/ontology/object-types.d.ts.map +1 -1
  229. package/dist/pages/console/ontology/objects.d.ts.map +1 -1
  230. package/dist/pages/console/ontology/rules.d.ts.map +1 -1
  231. package/dist/pages/console/ontology/workflow.d.ts.map +1 -1
  232. package/dist/pages/console/ontology/workflows/run-input-form.d.ts.map +1 -1
  233. package/dist/pages/console/ontology/workflows/schema-shape.d.ts.map +1 -1
  234. package/dist/pages/console/ontology/workflows.d.ts.map +1 -1
  235. package/dist/pages/console/skeletons.d.ts +30 -0
  236. package/dist/pages/console/skeletons.d.ts.map +1 -0
  237. package/dist/pages/console/workflow-run.d.ts.map +1 -1
  238. package/dist/pages/section-page.d.ts +11 -1
  239. package/dist/pages/section-page.d.ts.map +1 -1
  240. package/dist/pages/section-ui.d.ts +25 -3
  241. package/dist/pages/section-ui.d.ts.map +1 -1
  242. package/dist/pages/settings/activity/calendar.d.ts.map +1 -1
  243. package/dist/pages/settings/activity/connections.d.ts.map +1 -1
  244. package/dist/pages/settings/activity/page.d.ts.map +1 -1
  245. package/dist/pages/settings/activity/thread.d.ts.map +1 -1
  246. package/dist/pages/settings/activity/timeline.d.ts +2 -0
  247. package/dist/pages/settings/activity/timeline.d.ts.map +1 -1
  248. package/dist/pages/settings/controls.d.ts +4 -0
  249. package/dist/pages/settings/controls.d.ts.map +1 -1
  250. package/dist/pages/settings/members.d.ts.map +1 -1
  251. package/dist/pages/settings/memory-history.d.ts +2 -0
  252. package/dist/pages/settings/memory-history.d.ts.map +1 -1
  253. package/dist/pages/settings/memory.d.ts.map +1 -1
  254. package/dist/pages/settings/service-accounts.d.ts.map +1 -1
  255. package/dist/pages/settings/sessions.d.ts.map +1 -1
  256. package/dist/pages/settings/usage/breakdown.d.ts.map +1 -1
  257. package/dist/pages/settings/usage/limits.d.ts.map +1 -1
  258. package/dist/pages/settings/usage/messages.d.ts +0 -2
  259. package/dist/pages/settings/usage/messages.d.ts.map +1 -1
  260. package/dist/pages/settings/usage/runs.d.ts +8 -2
  261. package/dist/pages/settings/usage/runs.d.ts.map +1 -1
  262. package/dist/pages/settings/usage/spend-chart.d.ts.map +1 -1
  263. package/dist/pages/settings/usage/spend-model.d.ts +5 -0
  264. package/dist/pages/settings/usage/spend-model.d.ts.map +1 -1
  265. package/dist/pages/values.d.ts +6 -0
  266. package/dist/pages/values.d.ts.map +1 -1
  267. package/dist/pages.d.ts +4 -0
  268. package/dist/pages.d.ts.map +1 -1
  269. package/dist/pages.js +8188 -4841
  270. package/dist/pages.js.map +56 -47
  271. package/dist/sections/catalog.d.ts.map +1 -1
  272. package/dist/sections/sections.d.ts.map +1 -1
  273. package/dist/server.js +294 -23
  274. package/dist/server.js.map +8 -7
  275. package/dist/service-worker.d.ts +39 -0
  276. package/dist/service-worker.d.ts.map +1 -0
  277. package/dist/shared-session.d.ts +25 -0
  278. package/dist/shared-session.d.ts.map +1 -0
  279. package/dist/shell/app-return.d.ts +35 -0
  280. package/dist/shell/app-return.d.ts.map +1 -0
  281. package/dist/shell/app-shell.d.ts +1 -1
  282. package/dist/shell/app-shell.d.ts.map +1 -1
  283. package/dist/shell/nav-items.d.ts +2 -0
  284. package/dist/shell/nav-items.d.ts.map +1 -1
  285. package/dist/shell/phone/back.d.ts +6 -0
  286. package/dist/shell/phone/back.d.ts.map +1 -0
  287. package/dist/shell/phone/launch.d.ts +7 -0
  288. package/dist/shell/phone/launch.d.ts.map +1 -0
  289. package/dist/shell/phone/more-sheet.d.ts +36 -0
  290. package/dist/shell/phone/more-sheet.d.ts.map +1 -0
  291. package/dist/shell/phone/phone-foundations.d.ts +9 -0
  292. package/dist/shell/phone/phone-foundations.d.ts.map +1 -0
  293. package/dist/shell/phone/pull-to-refresh.d.ts +9 -0
  294. package/dist/shell/phone/pull-to-refresh.d.ts.map +1 -0
  295. package/dist/shell/phone/routes.d.ts +12 -0
  296. package/dist/shell/phone/routes.d.ts.map +1 -0
  297. package/dist/shell/phone/screen-motion.d.ts +11 -0
  298. package/dist/shell/phone/screen-motion.d.ts.map +1 -0
  299. package/dist/shell/phone/scroll-restoration.d.ts +7 -0
  300. package/dist/shell/phone/scroll-restoration.d.ts.map +1 -0
  301. package/dist/shell/phone/startup-image.d.ts +17 -0
  302. package/dist/shell/phone/startup-image.d.ts.map +1 -0
  303. package/dist/shell/phone/tab-bar.d.ts +14 -0
  304. package/dist/shell/phone/tab-bar.d.ts.map +1 -0
  305. package/dist/shell/phone/top-bar.d.ts +24 -0
  306. package/dist/shell/phone/top-bar.d.ts.map +1 -0
  307. package/dist/shell/search-command.d.ts +3 -1
  308. package/dist/shell/search-command.d.ts.map +1 -1
  309. package/dist/shell/user-menu.d.ts +2 -0
  310. package/dist/shell/user-menu.d.ts.map +1 -1
  311. package/package.json +8 -5
  312. package/src/agent/activity-label.ts +6 -1
  313. package/src/agent/agent-chat.tsx +52 -8
  314. package/src/agent/agent-panel.tsx +12 -0
  315. package/src/agent/agent-surface.tsx +4 -0
  316. package/src/agent/artifact-card.tsx +84 -16
  317. package/src/agent/artifact-panel.tsx +63 -43
  318. package/src/agent/background/background-tool-row.tsx +24 -10
  319. package/src/agent/background/interpret.ts +60 -51
  320. package/src/agent/components/agent-message-body.tsx +1 -1
  321. package/src/agent/components/composer-place.tsx +77 -53
  322. package/src/agent/components/composer.tsx +92 -7
  323. package/src/agent/components/context-chips.tsx +72 -2
  324. package/src/agent/components/conversation-panel.tsx +30 -10
  325. package/src/agent/components/message-parts.tsx +29 -6
  326. package/src/agent/components/thread-artifacts-menu.tsx +22 -5
  327. package/src/agent/components/transcript.tsx +45 -27
  328. package/src/agent/composer-insertion.ts +36 -0
  329. package/src/agent/delegation/agent-exchange.tsx +53 -0
  330. package/src/agent/delegation/child-card.tsx +6 -40
  331. package/src/agent/delegation/child-parts.tsx +1 -84
  332. package/src/agent/delegation/child-work.tsx +19 -5
  333. package/src/agent/delegation/interpret.ts +33 -54
  334. package/src/agent/delegation/model.ts +1 -1
  335. package/src/agent/file-edits/file-edit-tool-view.tsx +126 -0
  336. package/src/agent/file-edits/interpret.ts +120 -0
  337. package/src/agent/hooks/use-agent-conversation.ts +61 -10
  338. package/src/agent/hooks/use-new-thread-place.ts +149 -25
  339. package/src/agent/i18n/en.ts +60 -4
  340. package/src/agent/i18n/fr.ts +51 -4
  341. package/src/agent/message-agent/interpret.ts +4 -3
  342. package/src/agent/publish-artifact/interpret.ts +37 -6
  343. package/src/agent/publish-artifact/open-artifact-tool-view.tsx +49 -0
  344. package/src/agent/publish-artifact/publish-artifact-tool-view.tsx +14 -8
  345. package/src/agent/publish-artifact/use-live-publishes.ts +7 -11
  346. package/src/agent/questions/interpret.ts +90 -0
  347. package/src/agent/questions/question-card.tsx +57 -0
  348. package/src/agent/questions/question-composer.tsx +257 -0
  349. package/src/agent/react-router.tsx +2 -2
  350. package/src/agent/read/interpret.ts +34 -1
  351. package/src/agent/read/read-tool-view.tsx +20 -4
  352. package/src/agent/tool-views/built-in.tsx +22 -8
  353. package/src/agent/types.ts +4 -0
  354. package/src/agent/waits.ts +50 -0
  355. package/src/artifacts/artifact-page.tsx +42 -17
  356. package/src/artifacts/artifact-viewer.tsx +56 -0
  357. package/src/artifacts/artifacts.css +116 -0
  358. package/src/artifacts/card-details.ts +2 -2
  359. package/src/artifacts/card-preview.tsx +17 -3
  360. package/src/artifacts/comments-context.ts +125 -0
  361. package/src/artifacts/edit-session.tsx +21 -7
  362. package/src/artifacts/file-source.ts +10 -3
  363. package/src/artifacts/frame.tsx +53 -14
  364. package/src/artifacts/gallery.tsx +9 -11
  365. package/src/artifacts/guest-badge.tsx +21 -0
  366. package/src/artifacts/held-artifact.tsx +241 -0
  367. package/src/artifacts/holders.tsx +170 -0
  368. package/src/artifacts/live/boards.ts +95 -0
  369. package/src/artifacts/live/canvas.ts +402 -0
  370. package/src/artifacts/live/header.tsx +137 -0
  371. package/src/artifacts/live/hooks.ts +94 -0
  372. package/src/artifacts/live/presence.ts +147 -0
  373. package/src/artifacts/live/session.ts +520 -0
  374. package/src/artifacts/live/view.ts +81 -0
  375. package/src/artifacts/messages.ts +469 -24
  376. package/src/artifacts/page-queries.ts +2 -3
  377. package/src/artifacts/page-state.ts +16 -7
  378. package/src/artifacts/publish-edit.ts +50 -22
  379. package/src/artifacts/queries.ts +108 -10
  380. package/src/artifacts/references/references.tsx +6 -9
  381. package/src/artifacts/renderers/canvas/arrows.tsx +12 -39
  382. package/src/artifacts/renderers/canvas/board-editor.tsx +839 -0
  383. package/src/artifacts/renderers/canvas/board-properties.tsx +488 -0
  384. package/src/artifacts/renderers/canvas/board-source.ts +110 -0
  385. package/src/artifacts/renderers/canvas/board.tsx +373 -35
  386. package/src/artifacts/renderers/canvas/canvas.tsx +441 -75
  387. package/src/artifacts/renderers/canvas/comment-pins.tsx +465 -0
  388. package/src/artifacts/renderers/canvas/commenting.tsx +319 -0
  389. package/src/artifacts/renderers/canvas/comments-panel.tsx +574 -0
  390. package/src/artifacts/renderers/canvas/comments.ts +225 -0
  391. package/src/artifacts/renderers/canvas/controls.tsx +64 -30
  392. package/src/artifacts/renderers/canvas/draft.ts +41 -50
  393. package/src/artifacts/renderers/canvas/edit-mode.tsx +145 -20
  394. package/src/artifacts/renderers/canvas/focus.tsx +321 -26
  395. package/src/artifacts/renderers/canvas/gestures.ts +265 -0
  396. package/src/artifacts/renderers/canvas/items.tsx +179 -52
  397. package/src/artifacts/renderers/canvas/layout.ts +99 -47
  398. package/src/artifacts/renderers/canvas/page-resize.tsx +542 -0
  399. package/src/artifacts/renderers/canvas/page-size-controls.tsx +193 -0
  400. package/src/artifacts/renderers/canvas/page-size.ts +218 -0
  401. package/src/artifacts/renderers/canvas/page-zoom.ts +280 -0
  402. package/src/artifacts/renderers/canvas/presence.tsx +184 -0
  403. package/src/artifacts/renderers/canvas/previews.ts +127 -0
  404. package/src/artifacts/renderers/canvas/renderer.tsx +87 -22
  405. package/src/artifacts/renderers/canvas/shown-size.ts +105 -0
  406. package/src/artifacts/renderers/canvas/thumbnail.tsx +56 -15
  407. package/src/artifacts/renderers/canvas/toolbar.tsx +1 -1
  408. package/src/artifacts/renderers/slides/slides.tsx +1 -1
  409. package/src/artifacts/version-menu.tsx +438 -0
  410. package/src/artifacts/view-context.ts +102 -0
  411. package/src/artifacts/viewer.tsx +219 -147
  412. package/src/build.ts +96 -11
  413. package/src/codegen.ts +83 -5
  414. package/src/createCustomApp.ts +20 -7
  415. package/src/index.ts +14 -0
  416. package/src/locale-messages.ts +24 -0
  417. package/src/metadata.ts +12 -0
  418. package/src/pages/console/action-run.tsx +20 -0
  419. package/src/pages/console/data/connectors.tsx +27 -3
  420. package/src/pages/console/data/datasets.tsx +30 -1
  421. package/src/pages/console/data/lake-health.tsx +299 -0
  422. package/src/pages/console/data/messages.ts +143 -2
  423. package/src/pages/console/data/pipelines.tsx +91 -3
  424. package/src/pages/console/data/projections.tsx +23 -4
  425. package/src/pages/console/data/syncs.tsx +39 -2
  426. package/src/pages/console/ontology/action-runs.tsx +8 -2
  427. package/src/pages/console/ontology/actions.tsx +39 -15
  428. package/src/pages/console/ontology/components/action-button.tsx +10 -0
  429. package/src/pages/console/ontology/components/artifact-picker.tsx +522 -0
  430. package/src/pages/console/ontology/components/object-query-bar.tsx +21 -5
  431. package/src/pages/console/ontology/lib/action-params.ts +10 -0
  432. package/src/pages/console/ontology/lineage/properties-panel.tsx +32 -24
  433. package/src/pages/console/ontology/object-page.tsx +2 -0
  434. package/src/pages/console/ontology/object-type.tsx +73 -14
  435. package/src/pages/console/ontology/object-types.tsx +56 -7
  436. package/src/pages/console/ontology/objects.tsx +167 -19
  437. package/src/pages/console/ontology/rules.tsx +186 -30
  438. package/src/pages/console/ontology/workflow.tsx +130 -74
  439. package/src/pages/console/ontology/workflows/run-input-form.tsx +21 -2
  440. package/src/pages/console/ontology/workflows/schema-shape.tsx +3 -0
  441. package/src/pages/console/ontology/workflows.tsx +34 -21
  442. package/src/pages/console/skeletons.tsx +99 -0
  443. package/src/pages/console/workflow-run.tsx +20 -0
  444. package/src/pages/section-page.tsx +37 -7
  445. package/src/pages/section-ui.tsx +96 -13
  446. package/src/pages/settings/activity/calendar.tsx +13 -6
  447. package/src/pages/settings/activity/connections.tsx +26 -9
  448. package/src/pages/settings/activity/page.tsx +31 -4
  449. package/src/pages/settings/activity/thread.tsx +32 -18
  450. package/src/pages/settings/activity/timeline.tsx +39 -0
  451. package/src/pages/settings/controls.tsx +19 -1
  452. package/src/pages/settings/developers.tsx +2 -2
  453. package/src/pages/settings/members.tsx +42 -9
  454. package/src/pages/settings/memory-history.tsx +76 -10
  455. package/src/pages/settings/memory.tsx +47 -5
  456. package/src/pages/settings/service-accounts.tsx +7 -2
  457. package/src/pages/settings/sessions.tsx +6 -2
  458. package/src/pages/settings/usage/breakdown.tsx +62 -2
  459. package/src/pages/settings/usage/limits.tsx +45 -3
  460. package/src/pages/settings/usage/messages.ts +0 -2
  461. package/src/pages/settings/usage/page.tsx +99 -52
  462. package/src/pages/settings/usage/runs.tsx +105 -8
  463. package/src/pages/settings/usage/spend-chart.tsx +79 -45
  464. package/src/pages/settings/usage/spend-model.ts +16 -0
  465. package/src/pages/values.tsx +72 -6
  466. package/src/pages.ts +4 -0
  467. package/src/sections/catalog.ts +6 -0
  468. package/src/sections/sections.tsx +2 -0
  469. package/src/service-worker.ts +176 -0
  470. package/src/shared-session.ts +73 -0
  471. package/src/shell/app-return.ts +115 -0
  472. package/src/shell/app-shell.tsx +125 -27
  473. package/src/shell/nav-items.tsx +2 -0
  474. package/src/shell/phone/back.ts +16 -0
  475. package/src/shell/phone/launch.ts +6 -0
  476. package/src/shell/phone/more-sheet.tsx +249 -0
  477. package/src/shell/phone/phone-foundations.tsx +43 -0
  478. package/src/shell/phone/phone.css +660 -0
  479. package/src/shell/phone/pull-to-refresh.tsx +201 -0
  480. package/src/shell/phone/routes.ts +34 -0
  481. package/src/shell/phone/screen-motion.ts +292 -0
  482. package/src/shell/phone/scroll-restoration.tsx +70 -0
  483. package/src/shell/phone/startup-image.ts +119 -0
  484. package/src/shell/phone/tab-bar.tsx +95 -0
  485. package/src/shell/phone/top-bar.tsx +195 -0
  486. package/src/shell/search-command.tsx +30 -14
  487. package/src/shell/user-menu.tsx +2 -1
  488. package/dist/chunk-4j3c3p72.js +0 -1487
  489. package/dist/chunk-4j3c3p72.js.map +0 -18
  490. package/dist/chunk-4mprsd2n.js.map +0 -10
  491. package/dist/chunk-ytadd0b5.js.map +0 -188
  492. /package/dist/{chunk-7fj9cfkw.js.map → chunk-970s5nkn.js.map} +0 -0
  493. /package/dist/{chunk-j8g956dt.js.map → chunk-pxd07kvx.js.map} +0 -0
  494. /package/dist/{chunk-kwbw4dyk.js.map → chunk-ryed2jq8.js.map} +0 -0
@@ -0,0 +1,265 @@
1
+ import type { FrameEvent, FramePan, FramePoint, FrameZoomStep } from "@sixb/core/artifacts"
2
+ import { useReactFlow, useStoreApi } from "@xyflow/react"
3
+ import { type RefObject, useEffect, useMemo, useRef } from "react"
4
+ import { LIVE_FROM_SCALE } from "./board"
5
+ import type { Box } from "./draft"
6
+ import { zoomKey } from "./focus"
7
+
8
+ // A board running on the canvas is a page the reader uses in place, in read mode. Its frame takes
9
+ // the reader's clicks, keys and text, and hands the canvas, through the port each load is given,
10
+ // what moves it:
11
+ //
12
+ // frame ── pan ────▶ the canvas pans: the wheel unless the page scrolls it, or a finger's drag
13
+ // ── zoom ───▶ the canvas zooms around the pointer, or by a step
14
+ // ── space ──▶ Space held: a drag anywhere pans, the boards' pages let it through
15
+ // ── press ──▶ the canvas glides to the board an arrow with those words leads to
16
+ // ◀─ canvas ── whether the canvas is panning by the wheel, so a page coming under a still
17
+ // pointer keeps panning it instead of scrolling itself
18
+
19
+ /** How far a wheel's turn pans the canvas over a board, as React Flow's `panOnScrollSpeed` does. */
20
+ const WHEEL_PAN_SPEED = 0.5
21
+
22
+ /** How long after its last wheel turn the canvas still pans: React Flow's own pause. */
23
+ const WHEEL_PAUSE_MS = 150
24
+
25
+ /** How long the canvas takes to glide to the board an arrow leads to. */
26
+ const GLIDE_MS = 420
27
+
28
+ /** How long a zoom step takes, as the zoom bar's. */
29
+ const STEP_MS = 220
30
+
31
+ /** What a glide leaves above and beside a board too large for the view. */
32
+ const GLIDE_MARGIN = 32
33
+
34
+ /** What takes Space itself in the app: a field types it, a control presses. */
35
+ const KEYED = "input, textarea, select, button, a[href], [contenteditable], [role=menu]"
36
+
37
+ /** What the canvas does with what its running boards hand it. */
38
+ export interface BoardGestures {
39
+ /** Whether the canvas is panning by the wheel now. */
40
+ readonly moving: () => boolean
41
+ /** Tells `listener` each time the canvas starts or stops panning by the wheel. */
42
+ readonly onMoving: (listener: (moving: boolean) => void) => () => void
43
+ /** What `board`'s frame sent through its port; `page` is where its page is drawn. */
44
+ readonly receive: (board: string, event: FrameEvent, page: Element | null) => void
45
+ /** Glides the canvas to show `box`, as a press on an arrow's label does. */
46
+ readonly glide: (box: Box) => void
47
+ }
48
+
49
+ /**
50
+ * Where the view goes to show `box` in a `view` this large, from `zoom`: centered, never closer
51
+ * than the reader is, and further only as far as it takes to fit, though never so far the board
52
+ * stops running, unless the reader is further already. A board still too large starts at the
53
+ * view's top left, as a page is read.
54
+ */
55
+ export function glideView(
56
+ box: Box,
57
+ view: { readonly width: number; readonly height: number },
58
+ zoom: number,
59
+ padding: number
60
+ ): { readonly x: number; readonly y: number; readonly zoom: number } {
61
+ const fit = Math.min(view.width / (box.w * (1 + padding)), view.height / (box.h * (1 + padding)))
62
+ const next = Math.min(zoom, Math.max(fit, Math.min(zoom, LIVE_FROM_SCALE)))
63
+
64
+ const width = box.w * next
65
+ const height = box.h * next
66
+ const left = width <= view.width ? (view.width - width) / 2 : GLIDE_MARGIN
67
+ const top = height <= view.height ? (view.height - height) / 2 : GLIDE_MARGIN
68
+ return { x: left - box.x * next, y: top - box.y * next, zoom: next }
69
+ }
70
+
71
+ /**
72
+ * The canvas's side of its running boards' gestures, and of its own keys while it is read: Space
73
+ * held over it lets a drag pan across the boards' pages, and ⌘ +, − and 0 zoom it, never the
74
+ * browser, while it has the pointer or the focus and no board is opened.
75
+ */
76
+ export function useBoardGestures({
77
+ root,
78
+ pointed,
79
+ reading,
80
+ opened,
81
+ padding,
82
+ onPress,
83
+ }: {
84
+ readonly root: RefObject<HTMLElement | null>
85
+ /** Whether the pointer is over the canvas. */
86
+ readonly pointed: RefObject<boolean>
87
+ /** Whether the reader reads the canvas: neither editing it nor placing a comment. */
88
+ readonly reading: boolean
89
+ /** Whether a board is opened over the canvas, which takes the keys itself. */
90
+ readonly opened: boolean
91
+ readonly padding: number
92
+ /** The reader pressed `text` in `board`'s page. */
93
+ readonly onPress: (board: string, text: string) => void
94
+ }): BoardGestures {
95
+ const store = useStoreApi()
96
+ const { setViewport, zoomIn, zoomOut, zoomTo } = useReactFlow()
97
+ const pressRef = useRef(onPress)
98
+ pressRef.current = onPress
99
+
100
+ const gestures = useMemo(() => {
101
+ let moving = false
102
+ let pause: ReturnType<typeof setTimeout> | undefined
103
+ const listeners = new Set<(moving: boolean) => void>()
104
+ const tell = (next: boolean) => {
105
+ if (moving === next) return
106
+ moving = next
107
+ for (const listener of listeners) listener(next)
108
+ }
109
+
110
+ /** The canvas panned by the wheel: it is panning until the wheel pauses. */
111
+ const wheeled = () => {
112
+ tell(true)
113
+ clearTimeout(pause)
114
+ pause = setTimeout(() => tell(false), WHEEL_PAUSE_MS)
115
+ }
116
+
117
+ const view = () => {
118
+ const [x, y, zoom] = store.getState().transform
119
+ return { x, y, zoom }
120
+ }
121
+
122
+ /** Zooms by `factor` around a point on screen, which stays where it is. */
123
+ const zoomAround = (factor: number, at: FramePoint) => {
124
+ const { minZoom, maxZoom, domNode } = store.getState()
125
+ const bounds = domNode?.getBoundingClientRect()
126
+ if (!bounds) return
127
+
128
+ const { x, y, zoom } = view()
129
+ const next = Math.min(maxZoom, Math.max(minZoom, zoom * factor))
130
+ const left = at.x - bounds.left
131
+ const top = at.y - bounds.top
132
+ void setViewport({
133
+ x: left - ((left - x) * next) / zoom,
134
+ y: top - ((top - y) * next) / zoom,
135
+ zoom: next,
136
+ })
137
+ }
138
+
139
+ const pan = ({ x: right, y: down, by }: FramePan) => {
140
+ const speed = by === "wheel" ? WHEEL_PAN_SPEED : 1
141
+ const { x, y, zoom } = view()
142
+ void setViewport({ x: x - right * speed, y: y - down * speed, zoom })
143
+ if (by === "wheel") wheeled()
144
+ }
145
+
146
+ const step = (to: FrameZoomStep) => {
147
+ if (to === "in") void zoomIn({ duration: STEP_MS })
148
+ else if (to === "out") void zoomOut({ duration: STEP_MS })
149
+ else void zoomTo(1, { duration: STEP_MS })
150
+ }
151
+
152
+ /** While Space is held, a drag across a board's page pans, as anywhere on the canvas. */
153
+ const hold = (down: boolean) => {
154
+ root.current?.toggleAttribute("data-panning", down)
155
+ }
156
+
157
+ return {
158
+ wheeled,
159
+ step,
160
+ hold,
161
+ moving: () => moving,
162
+ onMoving: (listener: (moving: boolean) => void) => {
163
+ listeners.add(listener)
164
+ return () => {
165
+ listeners.delete(listener)
166
+ }
167
+ },
168
+ receive: (board: string, event: FrameEvent, page: Element | null) => {
169
+ switch (event.event) {
170
+ case "zoom": {
171
+ if ("step" in event.params) {
172
+ step(event.params.step)
173
+ return
174
+ }
175
+ // The frame's pixels are the canvas's, drawn at its zoom.
176
+ const bounds = page?.getBoundingClientRect()
177
+ if (!bounds) return
178
+ const { zoom } = view()
179
+ const { factor, at } = event.params
180
+ zoomAround(factor, { x: bounds.left + at.x * zoom, y: bounds.top + at.y * zoom })
181
+ return
182
+ }
183
+ case "pan":
184
+ pan(event.params)
185
+ return
186
+ case "space":
187
+ hold(event.params.down)
188
+ return
189
+ case "press":
190
+ pressRef.current(board, event.params.text)
191
+ return
192
+ default:
193
+ return
194
+ }
195
+ },
196
+ glide: (box: Box) => {
197
+ const { width, height } = store.getState()
198
+ const still = window.matchMedia?.("(prefers-reduced-motion: reduce)").matches ?? false
199
+ void setViewport(glideView(box, { width, height }, view().zoom, padding), {
200
+ duration: still ? 0 : GLIDE_MS,
201
+ })
202
+ },
203
+ stop: () => {
204
+ clearTimeout(pause)
205
+ tell(false)
206
+ },
207
+ }
208
+ }, [store, setViewport, zoomIn, zoomOut, zoomTo, root, padding])
209
+
210
+ useEffect(() => gestures.stop, [gestures])
211
+
212
+ // A wheel turned over the canvas itself pans it: a board coming under the pointer goes on
213
+ // panning it.
214
+ useEffect(() => {
215
+ const here = root.current
216
+ if (!here) return
217
+
218
+ const onWheel = (event: WheelEvent) => {
219
+ if (event.target instanceof Element && event.target.closest(".react-flow")) gestures.wheeled()
220
+ }
221
+ here.addEventListener("wheel", onWheel, { capture: true, passive: true })
222
+ return () => here.removeEventListener("wheel", onWheel, { capture: true })
223
+ }, [root, gestures])
224
+
225
+ // The canvas's own keys, while it has the pointer or the focus: a board's page sends its own
226
+ // through the port.
227
+ useEffect(() => {
228
+ if (opened) return
229
+
230
+ const here = () => {
231
+ const canvas = root.current
232
+ return canvas !== null && (pointed.current || canvas.contains(document.activeElement))
233
+ }
234
+ const onKey = (event: KeyboardEvent) => {
235
+ if (event.metaKey || event.ctrlKey) {
236
+ const to = event.type === "keydown" ? zoomKey(event) : null
237
+ if (!to || !here()) return
238
+ event.preventDefault()
239
+ gestures.step(to)
240
+ return
241
+ }
242
+ if (!reading || event.key !== " " || event.altKey) return
243
+
244
+ const down = event.type === "keydown"
245
+ if (down) {
246
+ if (!here() || (event.target instanceof Element && event.target.closest(KEYED))) return
247
+ event.preventDefault()
248
+ }
249
+ gestures.hold(down)
250
+ }
251
+ const release = () => gestures.hold(false)
252
+
253
+ window.addEventListener("keydown", onKey)
254
+ window.addEventListener("keyup", onKey)
255
+ window.addEventListener("blur", release)
256
+ return () => {
257
+ window.removeEventListener("keydown", onKey)
258
+ window.removeEventListener("keyup", onKey)
259
+ window.removeEventListener("blur", release)
260
+ release()
261
+ }
262
+ }, [opened, reading, root, pointed, gestures])
263
+
264
+ return gestures
265
+ }
@@ -6,30 +6,35 @@ import type {
6
6
  CanvasShapeItem,
7
7
  CanvasText,
8
8
  } from "@sixb/core/artifacts"
9
+ import { CANVAS_TEXT_PIXELS, canvasNoteFontSize, canvasShapeFontSize } from "@sixb/core/artifacts"
9
10
  import { cn } from "@sixb/ui/lib/utils"
10
- import { Handle, type NodeProps, type NodeTypes, Position, useStore } from "@xyflow/react"
11
+ import { useQueryClient } from "@tanstack/react-query"
12
+ import { Handle, type NodeProps, type NodeTypes, Position, useStoreApi } from "@xyflow/react"
11
13
  import { AppWindow, ArrowUpRight, Link2, Maximize2 } from "lucide-react"
12
- import type { ReactNode } from "react"
14
+ import { memo, type ReactNode, useSyncExternalStore } from "react"
13
15
  import { useArtifactMessages } from "../../messages"
16
+ import { artifactChanged } from "../../queries"
14
17
  import { ArtifactEmbed, ArtifactLink } from "../../references/references"
15
18
  import { TONE_COLORS } from "../../tones"
16
- import { LiveBoard, useLiveBoards } from "./board"
19
+ import { ItemTile, LiveBoard, useLive, useLiveBoards } from "./board"
17
20
  import { EditChrome, InPlaceText, useCanvasEditing } from "./editing"
18
- import { type CanvasFlowNode, TEXT_SIZES } from "./layout"
21
+ import type { CanvasFlowNode } from "./layout"
22
+ import { boardPreviewSize, boardPreviewUrl } from "./previews"
19
23
 
20
24
  /**
21
25
  * Every item's look on the board. Boards and embeds are pages and artifacts under their names,
22
- * live where the board shows them; sections are headings; the rest draw as they are, in the
23
- * theme's colors.
26
+ * live where the board shows them large enough; sections are headings; the rest draw as they are,
27
+ * in the theme's colors. Each draws again only when its own node changes: a canvas holds up to a
28
+ * thousand.
24
29
  */
25
30
  export const CANVAS_NODE_TYPES: NodeTypes = {
26
- board: BoardNode,
27
- section: SectionNode,
28
- note: NoteNode,
29
- text: TextNode,
30
- shape: ShapeNode,
31
- embed: EmbedNode,
32
- point: PointNode,
31
+ board: memo(BoardNode),
32
+ section: memo(SectionNode),
33
+ note: memo(NoteNode),
34
+ text: memo(TextNode),
35
+ shape: memo(ShapeNode),
36
+ embed: memo(EmbedNode),
37
+ point: memo(PointNode),
33
38
  }
34
39
 
35
40
  /** The ends an arrow attaches to. Arrows find their own sides, so these are never seen. */
@@ -52,21 +57,116 @@ const MAX_NAME_SCALE = 2
52
57
  /** How wide on screen an item is before its name is shown above it. */
53
58
  const NAMED_FROM_WIDTH = 120
54
59
 
60
+ /**
61
+ * The CSS variable names scale by, which the board sets on itself as it zooms, so no item draws
62
+ * again for a frame of a zoom.
63
+ */
64
+ export const NAME_SCALE = "--sixb-name-scale"
65
+
66
+ /** `scale` as the CSS variable gives it, 1 where nothing sets it. */
67
+ export const NAME_SCALE_VALUE = `var(${NAME_SCALE}, 1)`
68
+
55
69
  /**
56
70
  * How much names grow against the zoom, as a design tool names its frames: their size on screen
57
- * from 100% down to half, then shrinking with the canvas, then gone. Null when they are hidden.
71
+ * from 100% down to half, then shrinking with the canvas.
58
72
  */
59
- export function useNameScale(): number | null {
60
- return useStore((state) => {
61
- const zoom = state.transform[2]
62
- if (zoom < NAMES_FROM_ZOOM) return null
63
- return Math.min(MAX_NAME_SCALE, Math.max(1, 1 / zoom))
64
- })
73
+ export function nameScale(zoom: number): number {
74
+ return Math.min(MAX_NAME_SCALE, Math.max(1, 1 / zoom))
75
+ }
76
+
77
+ /**
78
+ * Below this zoom, the board marks itself far (`data-far`): a tile waiting for its picture, a few
79
+ * dozen pixels wide, stops breathing, which would repaint every such tile at each frame.
80
+ */
81
+ export const FAR_BELOW_ZOOM = 0.2
82
+
83
+ /** What the board sets on itself as it zooms, so no item draws again for a frame of a zoom. */
84
+ export function zoomMarks(zoom: number): { readonly nameScale: string; readonly far: boolean } {
85
+ // Rounded, so a zoom between the steps it can show changes nothing.
86
+ return { nameScale: nameScale(zoom).toFixed(3), far: zoom < FAR_BELOW_ZOOM }
87
+ }
88
+
89
+ /** Where React Flow's view is zoomed, and whether it waits to be fitted. */
90
+ export interface Zoom {
91
+ readonly zoom: number
92
+ readonly fitViewQueued: boolean
93
+ }
94
+
95
+ /** What of React Flow's store the zoom is read from. */
96
+ interface ZoomSource {
97
+ getState(): {
98
+ readonly transform: readonly [number, number, number]
99
+ readonly fitViewQueued: boolean
100
+ }
101
+ subscribe(listener: () => void): () => void
102
+ }
103
+
104
+ const zooms = new WeakMap<
105
+ ZoomSource,
106
+ { readonly get: () => Zoom; readonly subscribe: (listener: () => void) => () => void }
107
+ >()
108
+
109
+ /**
110
+ * The zoom of a React Flow store, told to its listeners only as it changes: the store changes for
111
+ * every node someone moves, and an item that asks only how far the view is zoomed is not asked
112
+ * again for each. One subscription to the store, while anyone listens.
113
+ */
114
+ export function zoomOf(source: ZoomSource) {
115
+ let entry = zooms.get(source)
116
+ if (entry) return entry
117
+
118
+ const read = (): Zoom => {
119
+ const { transform, fitViewQueued } = source.getState()
120
+ return { zoom: transform[2], fitViewQueued }
121
+ }
122
+ let current = read()
123
+ const listeners = new Set<() => void>()
124
+ let unsubscribe: (() => void) | null = null
125
+
126
+ entry = {
127
+ // Nobody listening, nothing keeps it up to date: it is read as it is asked for.
128
+ get: () => {
129
+ if (!unsubscribe) current = same(current, read())
130
+ return current
131
+ },
132
+ subscribe: (listener) => {
133
+ listeners.add(listener)
134
+ unsubscribe ??= source.subscribe(() => {
135
+ const next = same(current, read())
136
+ if (next === current) return
137
+ current = next
138
+ for (const each of listeners) each()
139
+ })
140
+ return () => {
141
+ listeners.delete(listener)
142
+ if (listeners.size > 0 || !unsubscribe) return
143
+ unsubscribe()
144
+ unsubscribe = null
145
+ }
146
+ },
147
+ }
148
+ zooms.set(source, entry)
149
+ return entry
150
+ }
151
+
152
+ function same(last: Zoom, next: Zoom): Zoom {
153
+ return last.zoom === next.zoom && last.fitViewQueued === next.fitViewQueued ? last : next
154
+ }
155
+
156
+ /** What an item reads of the zoom, read again only as the zoom changes. */
157
+ function useZoomed<T>(select: (zoom: Zoom) => T): T {
158
+ const zoom = zoomOf(useStoreApi())
159
+ return useSyncExternalStore(zoom.subscribe, () => select(zoom.get()))
160
+ }
161
+
162
+ /** Whether names show at all: zoomed out further, they give way to the canvas. */
163
+ export function useNamesShown(): boolean {
164
+ return useZoomed(({ zoom }) => zoom >= NAMES_FROM_ZOOM)
65
165
  }
66
166
 
67
167
  /** Whether an item is wide enough on screen to show its name above it. */
68
168
  function useNamed(width: number): boolean {
69
- return useStore((state) => width * state.transform[2] >= NAMED_FROM_WIDTH)
169
+ return useZoomed(({ zoom }) => width * zoom >= NAMED_FROM_WIDTH)
70
170
  }
71
171
 
72
172
  /**
@@ -75,14 +175,12 @@ function useNamed(width: number): boolean {
75
175
  */
76
176
  function NameRow({
77
177
  width,
78
- scale,
79
178
  icon,
80
179
  name,
81
180
  action,
82
181
  }: {
83
182
  /** The named item's width, in canvas pixels. */
84
183
  readonly width: number
85
- readonly scale: number
86
184
  readonly icon: ReactNode
87
185
  readonly name: string
88
186
  readonly action?: ReactNode
@@ -90,7 +188,10 @@ function NameRow({
90
188
  return (
91
189
  <div
92
190
  className="pointer-events-none absolute bottom-full left-0 flex h-7 origin-bottom-left items-center gap-1.5 pb-1.5 text-[13px] font-medium text-muted-foreground"
93
- style={{ width: width / scale, transform: `scale(${scale})` }}
191
+ style={{
192
+ width: `calc(${width}px / ${NAME_SCALE_VALUE})`,
193
+ transform: `scale(${NAME_SCALE_VALUE})`,
194
+ }}
94
195
  >
95
196
  <span className="shrink-0 [&>svg]:size-3.5" aria-hidden="true">
96
197
  {icon}
@@ -112,24 +213,23 @@ function itemOf<Item>(props: NodeProps<CanvasFlowNode>): Item {
112
213
  function BoardNode(props: NodeProps<CanvasFlowNode>) {
113
214
  const board = itemOf<CanvasBoard>(props)
114
215
  const messages = useArtifactMessages().canvas
115
- const { open } = useLiveBoards()
116
- const scale = useNameScale()
216
+ const { version, previews, mode, open } = useLiveBoards()
217
+ const queries = useQueryClient()
218
+ // Until the view is fitted it is at 100%, which is not where the reader sees the board: the
219
+ // small picture first, then the full one if the board is drawn large.
220
+ const previewSize = useZoomed(({ zoom, fitViewQueued }) =>
221
+ fitViewQueued ? "small" : boardPreviewSize(board.w * zoom, window.devicePixelRatio || 1)
222
+ )
223
+ const shown = useNamesShown()
117
224
  const named = useNamed(board.w)
118
225
  const title = board.title ?? board.id
119
- // Until the page runs, its outline: the name above says which it is.
120
- const tile = (
121
- <div className="flex size-full items-center justify-center bg-card">
122
- <AppWindow className="size-12 text-muted-foreground/30" strokeWidth={1} aria-hidden="true" />
123
- </div>
124
- )
125
226
  return (
126
227
  <div className="relative size-full">
127
228
  <Ends />
128
229
  <EditChrome id={board.id} selected={props.selected} />
129
- {scale && named ? (
230
+ {shown && named ? (
130
231
  <NameRow
131
232
  width={board.w}
132
- scale={scale}
133
233
  icon={<AppWindow />}
134
234
  name={title}
135
235
  action={
@@ -149,7 +249,28 @@ function BoardNode(props: NodeProps<CanvasFlowNode>) {
149
249
  />
150
250
  ) : null}
151
251
  <div className="sixb-canvas-surface size-full overflow-hidden">
152
- <LiveBoard id={board.id} file={board.file} title={title} tile={tile} />
252
+ <LiveBoard
253
+ id={board.id}
254
+ file={board.file}
255
+ title={title}
256
+ tile={
257
+ <ItemTile
258
+ icon={AppWindow}
259
+ {...(version && previews[board.id] === "ready"
260
+ ? {
261
+ preview: boardPreviewUrl(version, board.id, mode, previewSize),
262
+ // A small picture that can't be had gives way to the full one.
263
+ ...(previewSize === "small"
264
+ ? { fallback: boardPreviewUrl(version, board.id, mode) }
265
+ : {}),
266
+ }
267
+ : {})}
268
+ pending={previews[board.id] === "pending"}
269
+ // The version may have moved past the revision pictured: it is read again.
270
+ {...(version ? { onFail: () => artifactChanged(queries, version.artifactId) } : {})}
271
+ />
272
+ }
273
+ />
153
274
  </div>
154
275
  </div>
155
276
  )
@@ -161,7 +282,7 @@ function BoardNode(props: NodeProps<CanvasFlowNode>) {
161
282
  */
162
283
  function SectionNode(props: NodeProps<CanvasFlowNode>) {
163
284
  const section = itemOf<CanvasSection>(props)
164
- const scale = useNameScale()
285
+ const shown = useNamesShown()
165
286
  const editing = useCanvasEditing()
166
287
  const heading =
167
288
  "absolute top-0 left-0 m-0 origin-top-left text-base leading-6 font-semibold tracking-[-0.01em] text-foreground"
@@ -173,7 +294,7 @@ function SectionNode(props: NodeProps<CanvasFlowNode>) {
173
294
  <div className={cn(heading, "pointer-events-auto")} style={{ width: section.w }}>
174
295
  <InPlaceText id={section.id} value={section.title ?? ""} />
175
296
  </div>
176
- ) : section.title && scale ? (
297
+ ) : section.title && shown ? (
177
298
  // While the canvas is edited, the heading is what takes the section: a press anywhere
178
299
  // else in its region falls through to what the region holds, or pans.
179
300
  <h3
@@ -182,7 +303,10 @@ function SectionNode(props: NodeProps<CanvasFlowNode>) {
182
303
  "truncate",
183
304
  editing ? "pointer-events-auto cursor-grab" : "pointer-events-none"
184
305
  )}
185
- style={{ maxWidth: section.w / scale, transform: `scale(${scale})` }}
306
+ style={{
307
+ maxWidth: `calc(${section.w}px / ${NAME_SCALE_VALUE})`,
308
+ transform: `scale(${NAME_SCALE_VALUE})`,
309
+ }}
186
310
  >
187
311
  {section.title}
188
312
  </h3>
@@ -211,9 +335,7 @@ function NoteNode(props: NodeProps<CanvasFlowNode>) {
211
335
  width: "100%",
212
336
  // As tall as its box while it is resized, and never shorter than its height.
213
337
  minHeight: `max(${note.h ?? Math.min(note.w, 112)}px, 100%)`,
214
- // A wide note is read from further out, so its text is a little larger: never so large
215
- // that a few words fill it.
216
- fontSize: Math.round(Math.min(22, Math.max(15, note.w / 13))),
338
+ fontSize: canvasNoteFontSize(note.w),
217
339
  ...(tone === "neutral"
218
340
  ? {}
219
341
  : { backgroundColor: `color-mix(in oklab, ${TONE_COLORS[tone]} 20%, var(--card))` }),
@@ -238,19 +360,19 @@ function NoteNode(props: NodeProps<CanvasFlowNode>) {
238
360
  /** A label or a heading on the canvas itself. */
239
361
  function TextNode(props: NodeProps<CanvasFlowNode>) {
240
362
  const text = itemOf<CanvasText>(props)
241
- const size = TEXT_SIZES[text.size]
363
+ const size = CANVAS_TEXT_PIXELS[text.size]
242
364
  const editing = useCanvasEditing()
243
365
  return (
244
366
  <div
245
367
  className={cn(
246
368
  "relative whitespace-pre-wrap text-foreground",
247
- text.size === "xl" && "font-bold tracking-[-0.025em]",
369
+ (text.size === "xl" || text.size === "xxl") && "font-bold tracking-[-0.025em]",
248
370
  text.size === "l" && "font-semibold tracking-[-0.015em]",
249
371
  text.size === "s" && "text-muted-foreground"
250
372
  )}
251
373
  style={{
252
374
  fontSize: size,
253
- lineHeight: text.size === "xl" || text.size === "l" ? 1.15 : 1.45,
375
+ lineHeight: text.size === "s" || text.size === "m" ? 1.45 : 1.15,
254
376
  ...(text.w === undefined ? { width: "max-content", minWidth: "100%" } : { width: "100%" }),
255
377
  }}
256
378
  >
@@ -273,7 +395,7 @@ function ShapeNode(props: NodeProps<CanvasFlowNode>) {
273
395
  : "var(--card)"
274
396
  const stroke = "color-mix(in oklab, var(--foreground) 32%, transparent)"
275
397
  const editing = useCanvasEditing()
276
- const fontSize = Math.round(Math.min(22, Math.max(15, Math.min(shape.w, shape.h * 2) / 12)))
398
+ const fontSize = canvasShapeFontSize(shape.w, shape.h)
277
399
  const textBox = cn(
278
400
  "relative text-center leading-snug font-medium text-foreground",
279
401
  // A diamond's middle is narrower than its box.
@@ -330,22 +452,23 @@ function ShapeNode(props: NodeProps<CanvasFlowNode>) {
330
452
 
331
453
  /**
332
454
  * Another artifact on the canvas at the item's size, as a deck's box shows one: a chart, a range,
333
- * a slide, a section, a page's card, or another canvas's board. One the reader can't open, or
334
- * whose part is gone, says so in place.
455
+ * a slide, a section, a page's card, or another canvas's board. It shows once the view shows it
456
+ * large enough, as a board runs, and its tile until then. One the reader can't open, or whose part
457
+ * is gone, says so in place.
335
458
  */
336
459
  function EmbedNode(props: NodeProps<CanvasFlowNode>) {
337
460
  const embed = itemOf<CanvasEmbed>(props)
338
461
  const messages = useArtifactMessages().canvas
339
- const scale = useNameScale()
340
- const named = Boolean(useNamed(embed.w) && scale && embed.title)
462
+ const live = useLive(embed.id)
463
+ const shown = useNamesShown()
464
+ const named = useNamed(embed.w) && shown && Boolean(embed.title)
341
465
  return (
342
466
  <div className="relative size-full">
343
467
  <Ends />
344
468
  <EditChrome id={embed.id} selected={props.selected} />
345
- {named && scale && embed.title ? (
469
+ {named && embed.title ? (
346
470
  <NameRow
347
471
  width={embed.w}
348
- scale={scale}
349
472
  icon={<Link2 />}
350
473
  name={embed.title}
351
474
  action={
@@ -364,7 +487,11 @@ function EmbedNode(props: NodeProps<CanvasFlowNode>) {
364
487
  className="sixb-canvas-surface sixb-canvas-embed size-full overflow-hidden"
365
488
  {...(named ? { "data-named": "" } : {})}
366
489
  >
367
- <ArtifactEmbed address={embed.src} caption={embed.title ?? ""} fill />
490
+ {live ? (
491
+ <ArtifactEmbed address={embed.src} caption={embed.title ?? ""} fill />
492
+ ) : (
493
+ <ItemTile icon={Link2} />
494
+ )}
368
495
  </div>
369
496
  </div>
370
497
  )