@polderlabs/bizar 7.0.2 → 8.0.0

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 (490) hide show
  1. package/.claude/settings.local.json +8 -0
  2. package/bizar-dash/DESIGN.md +729 -969
  3. package/bizar-dash/GLYPH.md +418 -0
  4. package/bizar-dash/PLAN.md +1135 -0
  5. package/bizar-dash/dist/assets/ActivityFeed-BRBtQOHB.js +6 -0
  6. package/bizar-dash/dist/assets/ActivityFeed-BRBtQOHB.js.map +1 -0
  7. package/bizar-dash/dist/assets/ActivityView-CwqhxBfh.js +1 -0
  8. package/bizar-dash/dist/assets/ActivityView-CwqhxBfh.js.map +1 -0
  9. package/bizar-dash/dist/assets/AgentActivity-6MxU-a9F.js +1 -0
  10. package/bizar-dash/dist/assets/AgentActivity-6MxU-a9F.js.map +1 -0
  11. package/bizar-dash/dist/assets/AgentsView-BYrOFdwl.js +8 -0
  12. package/bizar-dash/dist/assets/AgentsView-BYrOFdwl.js.map +1 -0
  13. package/bizar-dash/dist/assets/Badge-Cd61wsBa.js +1 -0
  14. package/bizar-dash/dist/assets/Badge-Cd61wsBa.js.map +1 -0
  15. package/bizar-dash/dist/assets/Card-C_bvqXdQ.js +1 -0
  16. package/bizar-dash/dist/assets/Card-C_bvqXdQ.js.map +1 -0
  17. package/bizar-dash/dist/assets/EmptyState-BWQuKnk9.js +1 -0
  18. package/bizar-dash/dist/assets/EmptyState-BWQuKnk9.js.map +1 -0
  19. package/bizar-dash/dist/assets/GoalsView-Dok0yt9S.js +11 -0
  20. package/bizar-dash/dist/assets/GoalsView-Dok0yt9S.js.map +1 -0
  21. package/bizar-dash/dist/assets/Grid-C62gCPqt.js +1 -0
  22. package/bizar-dash/dist/assets/Grid-C62gCPqt.js.map +1 -0
  23. package/bizar-dash/dist/assets/KanbanCard-CtTKP6ZX.js +21 -0
  24. package/bizar-dash/dist/assets/KanbanCard-CtTKP6ZX.js.map +1 -0
  25. package/bizar-dash/dist/assets/LibrariesView-BcyBQXiY.js +67 -0
  26. package/bizar-dash/dist/assets/LibrariesView-BcyBQXiY.js.map +1 -0
  27. package/bizar-dash/dist/assets/MemoryView-49wR4u-y.js +13 -0
  28. package/bizar-dash/dist/assets/MemoryView-49wR4u-y.js.map +1 -0
  29. package/bizar-dash/dist/assets/OverviewView-BtQ_UWYj.js +1 -0
  30. package/bizar-dash/dist/assets/OverviewView-BtQ_UWYj.js.map +1 -0
  31. package/bizar-dash/dist/assets/ProgressBar-CpvDeq9F.js +1 -0
  32. package/bizar-dash/dist/assets/ProgressBar-CpvDeq9F.js.map +1 -0
  33. package/bizar-dash/dist/assets/SettingsRow-DmIe5OUu.js +30 -0
  34. package/bizar-dash/dist/assets/SettingsRow-DmIe5OUu.js.map +1 -0
  35. package/bizar-dash/dist/assets/SettingsView-D1KmGWbi.js +48 -0
  36. package/bizar-dash/dist/assets/SettingsView-D1KmGWbi.js.map +1 -0
  37. package/bizar-dash/dist/assets/StatTile-BkIP32gG.js +11 -0
  38. package/bizar-dash/dist/assets/StatTile-BkIP32gG.js.map +1 -0
  39. package/bizar-dash/dist/assets/TasksView-Cba3GJ42.js +1 -0
  40. package/bizar-dash/dist/assets/TasksView-Cba3GJ42.js.map +1 -0
  41. package/bizar-dash/dist/assets/ViewHeader-D6c2cw1b.js +6 -0
  42. package/bizar-dash/dist/assets/ViewHeader-D6c2cw1b.js.map +1 -0
  43. package/bizar-dash/dist/assets/brain-DeoXNDE2.js +6 -0
  44. package/bizar-dash/dist/assets/brain-DeoXNDE2.js.map +1 -0
  45. package/bizar-dash/dist/assets/calendar-DRlQkGJc.js +6 -0
  46. package/bizar-dash/dist/assets/calendar-DRlQkGJc.js.map +1 -0
  47. package/bizar-dash/dist/assets/circle-check-DmYQ3vGp.js +6 -0
  48. package/bizar-dash/dist/assets/circle-check-DmYQ3vGp.js.map +1 -0
  49. package/bizar-dash/dist/assets/cmdk-BwN8hcKQ.js +80 -0
  50. package/bizar-dash/dist/assets/cmdk-BwN8hcKQ.js.map +1 -0
  51. package/bizar-dash/dist/assets/dnd-kit-DR2Qzzxk.js +5 -0
  52. package/bizar-dash/dist/assets/dnd-kit-DR2Qzzxk.js.map +1 -0
  53. package/bizar-dash/dist/assets/git-merge-OoqBKQer.js +6 -0
  54. package/bizar-dash/dist/assets/git-merge-OoqBKQer.js.map +1 -0
  55. package/bizar-dash/dist/assets/git-pull-request-CXBQTR2f.js +6 -0
  56. package/bizar-dash/dist/assets/git-pull-request-CXBQTR2f.js.map +1 -0
  57. package/bizar-dash/dist/assets/main-COdgjqbZ.css +1 -0
  58. package/bizar-dash/dist/assets/main-Cw6gybzS.js +109 -0
  59. package/bizar-dash/dist/assets/main-Cw6gybzS.js.map +1 -0
  60. package/bizar-dash/dist/assets/message-square-DUTeIQAR.js +6 -0
  61. package/bizar-dash/dist/assets/message-square-DUTeIQAR.js.map +1 -0
  62. package/bizar-dash/dist/assets/minus-CrStJTZ7.js +6 -0
  63. package/bizar-dash/dist/assets/minus-CrStJTZ7.js.map +1 -0
  64. package/bizar-dash/dist/assets/wrench-BJ1WIC4u.js +6 -0
  65. package/bizar-dash/dist/assets/wrench-BJ1WIC4u.js.map +1 -0
  66. package/bizar-dash/dist/{mobile.html → v8.html} +6 -9
  67. package/bizar-dash/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -0
  68. package/bizar-dash/src/server/server.mjs +1 -57
  69. package/bizar-dash/src/web/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -0
  70. package/bizar-dash/src/web/v8/App.tsx +188 -0
  71. package/bizar-dash/src/web/v8/__tests__/App.test.tsx +102 -0
  72. package/bizar-dash/src/web/v8/__tests__/AppShell.test.tsx +79 -0
  73. package/bizar-dash/src/web/v8/__tests__/PageSkeleton.test.tsx +12 -0
  74. package/bizar-dash/src/web/v8/__tests__/SettingsView.test.tsx +84 -0
  75. package/bizar-dash/src/web/v8/__tests__/Sidebar.test.tsx +95 -0
  76. package/bizar-dash/src/web/v8/__tests__/activity.test.tsx +63 -0
  77. package/bizar-dash/src/web/v8/__tests__/agents.test.tsx +90 -0
  78. package/bizar-dash/src/web/v8/__tests__/controls.test.tsx +135 -0
  79. package/bizar-dash/src/web/v8/__tests__/cx.test.ts +25 -0
  80. package/bizar-dash/src/web/v8/__tests__/data.test.tsx +293 -0
  81. package/bizar-dash/src/web/v8/__tests__/feedback.test.tsx +213 -0
  82. package/bizar-dash/src/web/v8/__tests__/goals.test.tsx +105 -0
  83. package/bizar-dash/src/web/v8/__tests__/kanban.test.tsx +176 -0
  84. package/bizar-dash/src/web/v8/__tests__/libraries.test.tsx +70 -0
  85. package/bizar-dash/src/web/v8/__tests__/memory.test.tsx +60 -0
  86. package/bizar-dash/src/web/v8/__tests__/navigation.test.tsx +137 -0
  87. package/bizar-dash/src/web/v8/__tests__/settings.test.tsx +104 -0
  88. package/bizar-dash/src/web/v8/__tests__/theme.test.tsx +98 -0
  89. package/bizar-dash/src/web/v8/__tests__/views.test.tsx +112 -0
  90. package/bizar-dash/src/web/v8/main.tsx +28 -0
  91. package/bizar-dash/src/web/v8/shell/AppShell.tsx +90 -0
  92. package/bizar-dash/src/web/v8/shell/PageSkeleton.tsx +29 -0
  93. package/bizar-dash/src/web/v8/shell/Sidebar.tsx +361 -0
  94. package/bizar-dash/src/web/v8/shell/StatusBar.tsx +63 -0
  95. package/bizar-dash/src/web/v8/shell/Topbar.tsx +113 -0
  96. package/bizar-dash/src/web/v8/shell/index.ts +15 -0
  97. package/bizar-dash/src/web/v8/ui/activity/ActivityFeed.tsx +137 -0
  98. package/bizar-dash/src/web/v8/ui/agents/AgentActivity.tsx +101 -0
  99. package/bizar-dash/src/web/v8/ui/agents/AgentCard.tsx +158 -0
  100. package/bizar-dash/src/web/v8/ui/controls/Button.tsx +141 -0
  101. package/bizar-dash/src/web/v8/ui/controls/ButtonGroup.tsx +32 -0
  102. package/bizar-dash/src/web/v8/ui/controls/Checkbox.tsx +49 -0
  103. package/bizar-dash/src/web/v8/ui/controls/Field.tsx +78 -0
  104. package/bizar-dash/src/web/v8/ui/controls/Form.tsx +23 -0
  105. package/bizar-dash/src/web/v8/ui/controls/IconButton.tsx +112 -0
  106. package/bizar-dash/src/web/v8/ui/controls/Input.tsx +94 -0
  107. package/bizar-dash/src/web/v8/ui/controls/RadioGroup.tsx +74 -0
  108. package/bizar-dash/src/web/v8/ui/controls/Select.tsx +171 -0
  109. package/bizar-dash/src/web/v8/ui/controls/Slider.tsx +68 -0
  110. package/bizar-dash/src/web/v8/ui/controls/Switch.tsx +56 -0
  111. package/bizar-dash/src/web/v8/ui/controls/Textarea.tsx +64 -0
  112. package/bizar-dash/src/web/v8/ui/controls/Toggle.tsx +36 -0
  113. package/bizar-dash/src/web/v8/ui/controls/ToggleGroup.tsx +85 -0
  114. package/bizar-dash/src/web/v8/ui/data/Accordion.tsx +134 -0
  115. package/bizar-dash/src/web/v8/ui/data/Avatar.tsx +175 -0
  116. package/bizar-dash/src/web/v8/ui/data/Badge.tsx +93 -0
  117. package/bizar-dash/src/web/v8/ui/data/BarList.tsx +101 -0
  118. package/bizar-dash/src/web/v8/ui/data/Card.tsx +140 -0
  119. package/bizar-dash/src/web/v8/ui/data/Chip.tsx +96 -0
  120. package/bizar-dash/src/web/v8/ui/data/Kbd.tsx +42 -0
  121. package/bizar-dash/src/web/v8/ui/data/ProgressBar.tsx +93 -0
  122. package/bizar-dash/src/web/v8/ui/data/Sparkline.tsx +98 -0
  123. package/bizar-dash/src/web/v8/ui/data/StatTile.tsx +150 -0
  124. package/bizar-dash/src/web/v8/ui/data/Table.tsx +170 -0
  125. package/bizar-dash/src/web/v8/ui/data/Timeline.tsx +130 -0
  126. package/bizar-dash/src/web/v8/ui/data/ViewHeader.tsx +122 -0
  127. package/bizar-dash/src/web/v8/ui/feedback/Alert.tsx +95 -0
  128. package/bizar-dash/src/web/v8/ui/feedback/Banner.tsx +39 -0
  129. package/bizar-dash/src/web/v8/ui/feedback/ContextMenu.tsx +143 -0
  130. package/bizar-dash/src/web/v8/ui/feedback/Dialog.tsx +149 -0
  131. package/bizar-dash/src/web/v8/ui/feedback/Drawer.tsx +8 -0
  132. package/bizar-dash/src/web/v8/ui/feedback/DropdownMenu.tsx +231 -0
  133. package/bizar-dash/src/web/v8/ui/feedback/EmptyState.tsx +48 -0
  134. package/bizar-dash/src/web/v8/ui/feedback/Popover.tsx +56 -0
  135. package/bizar-dash/src/web/v8/ui/feedback/Sheet.tsx +103 -0
  136. package/bizar-dash/src/web/v8/ui/feedback/Skeleton.tsx +67 -0
  137. package/bizar-dash/src/web/v8/ui/feedback/Spinner.tsx +30 -0
  138. package/bizar-dash/src/web/v8/ui/feedback/Toast.tsx +66 -0
  139. package/bizar-dash/src/web/v8/ui/feedback/Tooltip.tsx +89 -0
  140. package/bizar-dash/src/web/v8/ui/goals/GoalCard.tsx +176 -0
  141. package/bizar-dash/src/web/v8/ui/goals/KeyResult.tsx +115 -0
  142. package/bizar-dash/src/web/v8/ui/index.ts +322 -0
  143. package/bizar-dash/src/web/v8/ui/kanban/KanbanBoard.tsx +80 -0
  144. package/bizar-dash/src/web/v8/ui/kanban/KanbanCard.tsx +247 -0
  145. package/bizar-dash/src/web/v8/ui/kanban/KanbanColumn.tsx +181 -0
  146. package/bizar-dash/src/web/v8/ui/kanban/KanbanContextMenu.tsx +122 -0
  147. package/bizar-dash/src/web/v8/ui/kanban/KanbanQuickAdd.tsx +141 -0
  148. package/bizar-dash/src/web/v8/ui/libraries/LibraryGrid.tsx +30 -0
  149. package/bizar-dash/src/web/v8/ui/libraries/LibraryItem.tsx +161 -0
  150. package/bizar-dash/src/web/v8/ui/memory/MemoryVault.tsx +144 -0
  151. package/bizar-dash/src/web/v8/ui/navigation/CommandPalette.tsx +224 -0
  152. package/bizar-dash/src/web/v8/ui/navigation/NavLink.tsx +81 -0
  153. package/bizar-dash/src/web/v8/ui/navigation/Pagination.tsx +164 -0
  154. package/bizar-dash/src/web/v8/ui/navigation/Tabs.tsx +128 -0
  155. package/bizar-dash/src/web/v8/ui/navigation/useCommandPaletteHotkey.test.ts +79 -0
  156. package/bizar-dash/src/web/v8/ui/primitives/Box.tsx +144 -0
  157. package/bizar-dash/src/web/v8/ui/primitives/Center.tsx +40 -0
  158. package/bizar-dash/src/web/v8/ui/primitives/Cluster.tsx +67 -0
  159. package/bizar-dash/src/web/v8/ui/primitives/Grid.tsx +104 -0
  160. package/bizar-dash/src/web/v8/ui/primitives/Inline.tsx +77 -0
  161. package/bizar-dash/src/web/v8/ui/primitives/Portal.tsx +33 -0
  162. package/bizar-dash/src/web/v8/ui/primitives/ScrollArea.tsx +62 -0
  163. package/bizar-dash/src/web/v8/ui/primitives/Separator.tsx +42 -0
  164. package/bizar-dash/src/web/v8/ui/primitives/Stack.tsx +73 -0
  165. package/bizar-dash/src/web/v8/ui/primitives/VisuallyHidden.tsx +49 -0
  166. package/bizar-dash/src/web/v8/ui/settings/SettingsNav.tsx +91 -0
  167. package/bizar-dash/src/web/v8/ui/settings/SettingsRow.tsx +88 -0
  168. package/bizar-dash/src/web/v8/ui/settings/SettingsSection.tsx +109 -0
  169. package/bizar-dash/src/web/v8/ui/styles/globals.css +220 -0
  170. package/bizar-dash/src/web/v8/ui/styles/reset.css +57 -0
  171. package/bizar-dash/src/web/v8/ui/styles/tokens.css +217 -0
  172. package/bizar-dash/src/web/v8/ui/theme/DensityProvider.test.tsx +74 -0
  173. package/bizar-dash/src/web/v8/ui/theme/DensityProvider.tsx +66 -0
  174. package/bizar-dash/src/web/v8/ui/theme/ThemeProvider.test.tsx +86 -0
  175. package/bizar-dash/src/web/v8/ui/theme/ThemeProvider.tsx +94 -0
  176. package/bizar-dash/src/web/v8/ui/theme/ThemeToggle.tsx +88 -0
  177. package/bizar-dash/src/web/v8/ui/theme/useDensity.ts +15 -0
  178. package/bizar-dash/src/web/v8/ui/theme/useTheme.ts +16 -0
  179. package/bizar-dash/src/web/v8/ui/utils/cx.ts +19 -0
  180. package/bizar-dash/src/web/v8/views/Activity/ActivityView.tsx +33 -0
  181. package/bizar-dash/src/web/v8/views/Agents/AgentsView.tsx +108 -0
  182. package/bizar-dash/src/web/v8/views/CommandPalette/AppCommandPalette.test.tsx +142 -0
  183. package/bizar-dash/src/web/v8/views/CommandPalette/AppCommandPalette.tsx +144 -0
  184. package/bizar-dash/src/web/v8/views/Goals/GoalsView.tsx +84 -0
  185. package/bizar-dash/src/web/v8/views/Libraries/LibrariesView.tsx +41 -0
  186. package/bizar-dash/src/web/v8/views/Memory/MemoryView.tsx +61 -0
  187. package/bizar-dash/src/web/v8/views/Overview/OverviewView.tsx +92 -0
  188. package/bizar-dash/src/web/v8/views/Router.tsx +96 -0
  189. package/bizar-dash/src/web/v8/views/Settings/SettingsView.tsx +305 -0
  190. package/bizar-dash/src/web/v8/views/Tasks/CommandPalettePlaceholder.tsx +106 -0
  191. package/bizar-dash/src/web/v8/views/Tasks/TasksKanbanPlaceholder.tsx +62 -0
  192. package/bizar-dash/src/web/v8/views/Tasks/TasksView.tsx +74 -0
  193. package/bizar-dash/src/web/v8/vite-env.d.ts +15 -0
  194. package/bizar-dash/src/web/{mobile.html → v8.html} +4 -7
  195. package/bizar-dash/tests/settings-layout.test.tsx +2 -2
  196. package/bizar-dash/tests/settings-nav.test.tsx +6 -6
  197. package/bizar-dash/tests/setup.ts +26 -0
  198. package/bizar-dash/vite.config.ts +26 -2
  199. package/bizar-dash/vitest.config.ts +5 -3
  200. package/cli/provision-claude.mjs +108 -5
  201. package/package.json +36 -3
  202. package/bizar-dash/dist/assets/EnvVarsSection-BfhAz3ax.js +0 -114
  203. package/bizar-dash/dist/assets/EnvVarsSection-BfhAz3ax.js.map +0 -1
  204. package/bizar-dash/dist/assets/MobileChat-DLWdv6tQ.js +0 -1
  205. package/bizar-dash/dist/assets/MobileChat-DLWdv6tQ.js.map +0 -1
  206. package/bizar-dash/dist/assets/MobileSettings-Bxv62uPY.js +0 -1
  207. package/bizar-dash/dist/assets/MobileSettings-Bxv62uPY.js.map +0 -1
  208. package/bizar-dash/dist/assets/Toast-ATSAmbdi.js +0 -26
  209. package/bizar-dash/dist/assets/Toast-ATSAmbdi.js.map +0 -1
  210. package/bizar-dash/dist/assets/__vite-browser-external-BIHI7g3E.js +0 -1
  211. package/bizar-dash/dist/assets/__vite-browser-external-BIHI7g3E.js.map +0 -1
  212. package/bizar-dash/dist/assets/main-306CZfn6.js +0 -430
  213. package/bizar-dash/dist/assets/main-306CZfn6.js.map +0 -1
  214. package/bizar-dash/dist/assets/main-G3bNDpY3.css +0 -1
  215. package/bizar-dash/dist/assets/mobile-C_naUN91.js +0 -1
  216. package/bizar-dash/dist/assets/mobile-C_naUN91.js.map +0 -1
  217. package/bizar-dash/dist/assets/mobile-layout-BWLtwtfQ.css +0 -1
  218. package/bizar-dash/dist/assets/mobile-layout-GZ3bE8L6.js +0 -211
  219. package/bizar-dash/dist/assets/mobile-layout-GZ3bE8L6.js.map +0 -1
  220. package/bizar-dash/dist/assets/useSlashCommands-BOwD7lNb.js +0 -65
  221. package/bizar-dash/dist/assets/useSlashCommands-BOwD7lNb.js.map +0 -1
  222. package/bizar-dash/dist/index.html +0 -43
  223. package/bizar-dash/src/web/App.tsx +0 -915
  224. package/bizar-dash/src/web/MobileApp.tsx +0 -414
  225. package/bizar-dash/src/web/components/ArtifactCreateDialog.tsx +0 -95
  226. package/bizar-dash/src/web/components/ArtifactListDialog.tsx +0 -55
  227. package/bizar-dash/src/web/components/ArtifactViewer.tsx +0 -144
  228. package/bizar-dash/src/web/components/AuditDialog.tsx +0 -79
  229. package/bizar-dash/src/web/components/AutosaveField.tsx +0 -50
  230. package/bizar-dash/src/web/components/BackupRestore.tsx +0 -330
  231. package/bizar-dash/src/web/components/BgStatusBadge.tsx +0 -32
  232. package/bizar-dash/src/web/components/Button.tsx +0 -56
  233. package/bizar-dash/src/web/components/CanvasContextMenu.tsx +0 -68
  234. package/bizar-dash/src/web/components/Card.tsx +0 -40
  235. package/bizar-dash/src/web/components/CollapsibleSection.tsx +0 -72
  236. package/bizar-dash/src/web/components/CommandDialog.tsx +0 -66
  237. package/bizar-dash/src/web/components/DoctorPanel.tsx +0 -160
  238. package/bizar-dash/src/web/components/EmptyState.tsx +0 -30
  239. package/bizar-dash/src/web/components/EnvVarManager.tsx +0 -430
  240. package/bizar-dash/src/web/components/EvalDiff.tsx +0 -157
  241. package/bizar-dash/src/web/components/EvalExportButton.tsx +0 -27
  242. package/bizar-dash/src/web/components/EvalRunCard.tsx +0 -78
  243. package/bizar-dash/src/web/components/FileBrowser.tsx +0 -633
  244. package/bizar-dash/src/web/components/HeadroomSettings.tsx +0 -418
  245. package/bizar-dash/src/web/components/HeadroomStatus.tsx +0 -158
  246. package/bizar-dash/src/web/components/HelpDialog.tsx +0 -55
  247. package/bizar-dash/src/web/components/InviteDialog.tsx +0 -205
  248. package/bizar-dash/src/web/components/KillConfirmDialog.tsx +0 -88
  249. package/bizar-dash/src/web/components/MobileBottomNav.tsx +0 -38
  250. package/bizar-dash/src/web/components/MobileDrawer.tsx +0 -68
  251. package/bizar-dash/src/web/components/MobileHeader.tsx +0 -50
  252. package/bizar-dash/src/web/components/MobileLayout.tsx +0 -63
  253. package/bizar-dash/src/web/components/Modal.tsx +0 -215
  254. package/bizar-dash/src/web/components/Notifications.tsx +0 -242
  255. package/bizar-dash/src/web/components/ScheduleTemplateCard.tsx +0 -72
  256. package/bizar-dash/src/web/components/ScreenshotCapture.tsx +0 -138
  257. package/bizar-dash/src/web/components/ScreenshotOCR.tsx +0 -42
  258. package/bizar-dash/src/web/components/SearchModal.tsx +0 -227
  259. package/bizar-dash/src/web/components/SettingsNav.tsx +0 -112
  260. package/bizar-dash/src/web/components/SettingsSearch.tsx +0 -328
  261. package/bizar-dash/src/web/components/Sidebar.tsx +0 -89
  262. package/bizar-dash/src/web/components/Spinner.tsx +0 -19
  263. package/bizar-dash/src/web/components/StatusBadge.tsx +0 -56
  264. package/bizar-dash/src/web/components/Tag.tsx +0 -41
  265. package/bizar-dash/src/web/components/TailscaleSettings.tsx +0 -161
  266. package/bizar-dash/src/web/components/TaskCard.tsx +0 -69
  267. package/bizar-dash/src/web/components/TaskCreateSheet.tsx +0 -76
  268. package/bizar-dash/src/web/components/Toast.tsx +0 -150
  269. package/bizar-dash/src/web/components/Toggle.tsx +0 -31
  270. package/bizar-dash/src/web/components/Topbar.tsx +0 -410
  271. package/bizar-dash/src/web/components/UsageChart.tsx +0 -250
  272. package/bizar-dash/src/web/components/UsageTable.tsx +0 -90
  273. package/bizar-dash/src/web/components/VirtualList.tsx +0 -53
  274. package/bizar-dash/src/web/components/VisualPlanDialog.tsx +0 -58
  275. package/bizar-dash/src/web/components/VoiceNotesPanel.tsx +0 -211
  276. package/bizar-dash/src/web/components/VoiceRecorder.tsx +0 -105
  277. package/bizar-dash/src/web/components/WorkspaceSelector.tsx +0 -158
  278. package/bizar-dash/src/web/components/agents/CommunicationLog.tsx +0 -126
  279. package/bizar-dash/src/web/components/agents/DependencyGraph.tsx +0 -163
  280. package/bizar-dash/src/web/components/agents/QualityGates.tsx +0 -123
  281. package/bizar-dash/src/web/components/agents/RealTimeEventLog.tsx +0 -127
  282. package/bizar-dash/src/web/components/agents/RoutingDecisions.test.tsx +0 -148
  283. package/bizar-dash/src/web/components/agents/RoutingDecisions.tsx +0 -160
  284. package/bizar-dash/src/web/components/background/AttachButton.tsx +0 -96
  285. package/bizar-dash/src/web/components/background/TmuxAttachCard.tsx +0 -122
  286. package/bizar-dash/src/web/components/chat/AgentChip.tsx +0 -68
  287. package/bizar-dash/src/web/components/chat/AgentNode.tsx +0 -127
  288. package/bizar-dash/src/web/components/chat/AgentTree.tsx +0 -80
  289. package/bizar-dash/src/web/components/chat/ChatBubble.tsx +0 -60
  290. package/bizar-dash/src/web/components/chat/ChatComposer.tsx +0 -72
  291. package/bizar-dash/src/web/components/chat/ChatInfoPanel.tsx +0 -370
  292. package/bizar-dash/src/web/components/chat/ChatRail.tsx +0 -387
  293. package/bizar-dash/src/web/components/chat/ChatThread.tsx +0 -127
  294. package/bizar-dash/src/web/components/chat/ChatTopBar.tsx +0 -50
  295. package/bizar-dash/src/web/components/chat/Composer.tsx +0 -166
  296. package/bizar-dash/src/web/components/chat/ConfirmModal.tsx +0 -54
  297. package/bizar-dash/src/web/components/chat/EmptyState.tsx +0 -21
  298. package/bizar-dash/src/web/components/chat/FirstRunGreeting.tsx +0 -18
  299. package/bizar-dash/src/web/components/chat/FloatingComposer.tsx +0 -38
  300. package/bizar-dash/src/web/components/chat/InfoPanel.tsx +0 -184
  301. package/bizar-dash/src/web/components/chat/JumpToLatest.tsx +0 -58
  302. package/bizar-dash/src/web/components/chat/LoadingSkeleton.tsx +0 -19
  303. package/bizar-dash/src/web/components/chat/MessageBlock.tsx +0 -260
  304. package/bizar-dash/src/web/components/chat/MessageBubble.tsx +0 -60
  305. package/bizar-dash/src/web/components/chat/SessionList.tsx +0 -163
  306. package/bizar-dash/src/web/components/chat/SessionRowMenu.tsx +0 -206
  307. package/bizar-dash/src/web/components/chat/StreamingIndicator.tsx +0 -37
  308. package/bizar-dash/src/web/components/chat/SuggestionCards.tsx +0 -55
  309. package/bizar-dash/src/web/components/chat/WelcomeScreen.tsx +0 -36
  310. package/bizar-dash/src/web/components/chat/_legacy.ts +0 -30
  311. package/bizar-dash/src/web/components/chat/index.ts +0 -31
  312. package/bizar-dash/src/web/components/chat/useAutoGrowTextarea.ts +0 -18
  313. package/bizar-dash/src/web/components/chat/useChat.ts +0 -1190
  314. package/bizar-dash/src/web/components/chat/useSlashCommands.ts +0 -47
  315. package/bizar-dash/src/web/components/goals/GoalInput.tsx +0 -86
  316. package/bizar-dash/src/web/components/goals/PlanVisualization.tsx +0 -111
  317. package/bizar-dash/src/web/components/tasks/BacklogPanel.css +0 -109
  318. package/bizar-dash/src/web/components/tasks/BacklogPanel.tsx +0 -209
  319. package/bizar-dash/src/web/hooks/useAutosave.ts +0 -107
  320. package/bizar-dash/src/web/hooks/useI18n.ts +0 -13
  321. package/bizar-dash/src/web/index.html +0 -37
  322. package/bizar-dash/src/web/lib/api.ts +0 -237
  323. package/bizar-dash/src/web/lib/goapPlanner.ts +0 -614
  324. package/bizar-dash/src/web/lib/i18n.ts +0 -25
  325. package/bizar-dash/src/web/lib/logger.ts +0 -30
  326. package/bizar-dash/src/web/lib/markdown.tsx +0 -59
  327. package/bizar-dash/src/web/lib/search.ts +0 -115
  328. package/bizar-dash/src/web/lib/types.ts +0 -894
  329. package/bizar-dash/src/web/lib/utils.ts +0 -114
  330. package/bizar-dash/src/web/lib/ws.ts +0 -177
  331. package/bizar-dash/src/web/locales/en.json +0 -52
  332. package/bizar-dash/src/web/main.tsx +0 -43
  333. package/bizar-dash/src/web/mobile/MobileApp.tsx +0 -309
  334. package/bizar-dash/src/web/mobile/MobileBottomNav.tsx +0 -38
  335. package/bizar-dash/src/web/mobile/MobileChat.tsx +0 -138
  336. package/bizar-dash/src/web/mobile/MobileDoctor.tsx +0 -80
  337. package/bizar-dash/src/web/mobile/MobileEval.tsx +0 -167
  338. package/bizar-dash/src/web/mobile/MobileMemory.tsx +0 -108
  339. package/bizar-dash/src/web/mobile/MobileOverview.tsx +0 -213
  340. package/bizar-dash/src/web/mobile/MobileSettings.tsx +0 -251
  341. package/bizar-dash/src/web/mobile/MobileTasks.tsx +0 -94
  342. package/bizar-dash/src/web/mobile/MobileTopbar.tsx +0 -115
  343. package/bizar-dash/src/web/mobile/components/MobileBottomSheet.tsx +0 -182
  344. package/bizar-dash/src/web/mobile/components/MobileListItem.tsx +0 -64
  345. package/bizar-dash/src/web/mobile/components/MobileModal.tsx +0 -123
  346. package/bizar-dash/src/web/mobile/views/MobileActivity.tsx +0 -273
  347. package/bizar-dash/src/web/mobile/views/MobileAgents.tsx +0 -374
  348. package/bizar-dash/src/web/mobile/views/MobileArtifactCanvas.tsx +0 -439
  349. package/bizar-dash/src/web/mobile/views/MobileArtifacts.tsx +0 -143
  350. package/bizar-dash/src/web/mobile/views/MobileChat.tsx +0 -257
  351. package/bizar-dash/src/web/mobile/views/MobileConfig.tsx +0 -175
  352. package/bizar-dash/src/web/mobile/views/MobileHistory.tsx +0 -191
  353. package/bizar-dash/src/web/mobile/views/MobileMods.tsx +0 -149
  354. package/bizar-dash/src/web/mobile/views/MobileMore.tsx +0 -121
  355. package/bizar-dash/src/web/mobile/views/MobileNotifications.tsx +0 -137
  356. package/bizar-dash/src/web/mobile/views/MobilePlans.tsx +0 -26
  357. package/bizar-dash/src/web/mobile/views/MobileSchedules.tsx +0 -685
  358. package/bizar-dash/src/web/mobile/views/MobileSearchModal.tsx +0 -172
  359. package/bizar-dash/src/web/mobile/views/MobileSettings.tsx +0 -363
  360. package/bizar-dash/src/web/mobile/views/MobileSkills.tsx +0 -153
  361. package/bizar-dash/src/web/mobile/views/MobileTasks.tsx +0 -564
  362. package/bizar-dash/src/web/mobile/views/QrCodePanel.tsx +0 -69
  363. package/bizar-dash/src/web/mobile.tsx +0 -14
  364. package/bizar-dash/src/web/styles/agents-redesign.css +0 -311
  365. package/bizar-dash/src/web/styles/chat.css +0 -1740
  366. package/bizar-dash/src/web/styles/glyphs.css +0 -960
  367. package/bizar-dash/src/web/styles/main.css +0 -10391
  368. package/bizar-dash/src/web/styles/memory.css +0 -1182
  369. package/bizar-dash/src/web/styles/minimax-usage.css +0 -842
  370. package/bizar-dash/src/web/styles/mobile-chat.css +0 -5
  371. package/bizar-dash/src/web/styles/mobile-layout.css +0 -233
  372. package/bizar-dash/src/web/styles/mobile.css +0 -2181
  373. package/bizar-dash/src/web/styles/settings.css +0 -795
  374. package/bizar-dash/src/web/styles/skills.css +0 -302
  375. package/bizar-dash/src/web/styles/tasks-redesign.css +0 -253
  376. package/bizar-dash/src/web/styles/tasks.css +0 -605
  377. package/bizar-dash/src/web/ui/controls/Button.tsx +0 -77
  378. package/bizar-dash/src/web/ui/controls/Checkbox.tsx +0 -95
  379. package/bizar-dash/src/web/ui/controls/IconButton.tsx +0 -66
  380. package/bizar-dash/src/web/ui/controls/Kbd.tsx +0 -24
  381. package/bizar-dash/src/web/ui/controls/NumberInput.tsx +0 -77
  382. package/bizar-dash/src/web/ui/controls/RadioGroup.tsx +0 -109
  383. package/bizar-dash/src/web/ui/controls/SearchInput.tsx +0 -91
  384. package/bizar-dash/src/web/ui/controls/Select.tsx +0 -92
  385. package/bizar-dash/src/web/ui/controls/Slider.tsx +0 -70
  386. package/bizar-dash/src/web/ui/controls/TextInput.tsx +0 -67
  387. package/bizar-dash/src/web/ui/controls/Textarea.tsx +0 -56
  388. package/bizar-dash/src/web/ui/controls/Toggle.tsx +0 -79
  389. package/bizar-dash/src/web/ui/controls/controls.css +0 -476
  390. package/bizar-dash/src/web/ui/controls/index.ts +0 -35
  391. package/bizar-dash/src/web/ui/data/BarChart.tsx +0 -60
  392. package/bizar-dash/src/web/ui/data/DataTable.tsx +0 -216
  393. package/bizar-dash/src/web/ui/data/EmptyState.tsx +0 -60
  394. package/bizar-dash/src/web/ui/data/ErrorState.tsx +0 -56
  395. package/bizar-dash/src/web/ui/data/KeyValueList.tsx +0 -106
  396. package/bizar-dash/src/web/ui/data/LoadingState.tsx +0 -65
  397. package/bizar-dash/src/web/ui/data/Sparkline.tsx +0 -87
  398. package/bizar-dash/src/web/ui/data/StatTile.tsx +0 -87
  399. package/bizar-dash/src/web/ui/data/data.css +0 -535
  400. package/bizar-dash/src/web/ui/data/index.ts +0 -31
  401. package/bizar-dash/src/web/ui/feedback/Badge.tsx +0 -49
  402. package/bizar-dash/src/web/ui/feedback/Dialog.tsx +0 -209
  403. package/bizar-dash/src/web/ui/feedback/ProgressBar.tsx +0 -69
  404. package/bizar-dash/src/web/ui/feedback/StatusDot.tsx +0 -50
  405. package/bizar-dash/src/web/ui/feedback/Toast.tsx +0 -200
  406. package/bizar-dash/src/web/ui/feedback/Tooltip.tsx +0 -126
  407. package/bizar-dash/src/web/ui/feedback/feedback.css +0 -314
  408. package/bizar-dash/src/web/ui/feedback/index.ts +0 -43
  409. package/bizar-dash/src/web/ui/index.ts +0 -56
  410. package/bizar-dash/src/web/ui/layout/AppShell.tsx +0 -51
  411. package/bizar-dash/src/web/ui/layout/Breadcrumbs.tsx +0 -97
  412. package/bizar-dash/src/web/ui/layout/Panel.tsx +0 -73
  413. package/bizar-dash/src/web/ui/layout/PanelHeader.tsx +0 -39
  414. package/bizar-dash/src/web/ui/layout/Sidebar.tsx +0 -131
  415. package/bizar-dash/src/web/ui/layout/Tabs.tsx +0 -133
  416. package/bizar-dash/src/web/ui/layout/Topbar.tsx +0 -42
  417. package/bizar-dash/src/web/ui/layout/ViewHeader.tsx +0 -48
  418. package/bizar-dash/src/web/ui/layout/index.ts +0 -34
  419. package/bizar-dash/src/web/ui/layout/layout.css +0 -464
  420. package/bizar-dash/src/web/ui/navigation/CommandPalette.tsx +0 -199
  421. package/bizar-dash/src/web/ui/navigation/NavGroup.tsx +0 -95
  422. package/bizar-dash/src/web/ui/navigation/NavLink.tsx +0 -93
  423. package/bizar-dash/src/web/ui/navigation/index.ts +0 -17
  424. package/bizar-dash/src/web/ui/navigation/navigation.css +0 -343
  425. package/bizar-dash/src/web/ui/primitives/Box.tsx +0 -91
  426. package/bizar-dash/src/web/ui/primitives/Grid.tsx +0 -49
  427. package/bizar-dash/src/web/ui/primitives/Inline.tsx +0 -55
  428. package/bizar-dash/src/web/ui/primitives/Separator.tsx +0 -46
  429. package/bizar-dash/src/web/ui/primitives/Stack.tsx +0 -54
  430. package/bizar-dash/src/web/ui/primitives/VisuallyHidden.tsx +0 -26
  431. package/bizar-dash/src/web/ui/primitives/index.ts +0 -23
  432. package/bizar-dash/src/web/ui/primitives/primitives.css +0 -183
  433. package/bizar-dash/src/web/ui/styles/globals.css +0 -86
  434. package/bizar-dash/src/web/ui/styles/reset.css +0 -125
  435. package/bizar-dash/src/web/ui/styles/tokens.css +0 -208
  436. package/bizar-dash/src/web/ui/theme/ThemeProvider.tsx +0 -142
  437. package/bizar-dash/src/web/ui/theme/tokens.ts +0 -131
  438. package/bizar-dash/src/web/ui/theme/useTheme.ts +0 -22
  439. package/bizar-dash/src/web/ui/utils/cx.ts +0 -42
  440. package/bizar-dash/src/web/views/Activity.tsx +0 -1221
  441. package/bizar-dash/src/web/views/Agents.tsx +0 -964
  442. package/bizar-dash/src/web/views/Artifacts.tsx +0 -1494
  443. package/bizar-dash/src/web/views/BackgroundAgents.tsx +0 -822
  444. package/bizar-dash/src/web/views/Chat.tsx +0 -532
  445. package/bizar-dash/src/web/views/Config.tsx +0 -3
  446. package/bizar-dash/src/web/views/Doctor.tsx +0 -317
  447. package/bizar-dash/src/web/views/Eval.tsx +0 -372
  448. package/bizar-dash/src/web/views/EvalReport.tsx +0 -353
  449. package/bizar-dash/src/web/views/GoalPlanner.tsx +0 -158
  450. package/bizar-dash/src/web/views/Harness.tsx +0 -306
  451. package/bizar-dash/src/web/views/History.tsx +0 -353
  452. package/bizar-dash/src/web/views/Memory.tsx +0 -161
  453. package/bizar-dash/src/web/views/MiniMaxUsage.tsx +0 -942
  454. package/bizar-dash/src/web/views/ModView.tsx +0 -207
  455. package/bizar-dash/src/web/views/Mods.tsx +0 -706
  456. package/bizar-dash/src/web/views/Overview.tsx +0 -1364
  457. package/bizar-dash/src/web/views/Providers.tsx +0 -302
  458. package/bizar-dash/src/web/views/Schedules.tsx +0 -902
  459. package/bizar-dash/src/web/views/Settings.tsx +0 -308
  460. package/bizar-dash/src/web/views/Skills.tsx +0 -383
  461. package/bizar-dash/src/web/views/SpawnAgentModal.tsx +0 -221
  462. package/bizar-dash/src/web/views/Tasks.tsx +0 -789
  463. package/bizar-dash/src/web/views/Workspace.tsx +0 -294
  464. package/bizar-dash/src/web/views/glyphs/GlyphRenderer.tsx +0 -844
  465. package/bizar-dash/src/web/views/glyphs/components.tsx +0 -1098
  466. package/bizar-dash/src/web/views/memory/ConfigPanel.tsx +0 -426
  467. package/bizar-dash/src/web/views/memory/FromScreenshotPanel.tsx +0 -23
  468. package/bizar-dash/src/web/views/memory/GitSyncPanel.tsx +0 -220
  469. package/bizar-dash/src/web/views/memory/LightragPanel.tsx +0 -310
  470. package/bizar-dash/src/web/views/memory/MemoryGraphLegend.tsx +0 -29
  471. package/bizar-dash/src/web/views/memory/MemoryGraphPanel.tsx +0 -192
  472. package/bizar-dash/src/web/views/memory/MemoryGraphView.tsx +0 -336
  473. package/bizar-dash/src/web/views/memory/MemoryOverview.tsx +0 -367
  474. package/bizar-dash/src/web/views/memory/MemoryStatusCard.tsx +0 -160
  475. package/bizar-dash/src/web/views/memory/ObsidianPanel.tsx +0 -650
  476. package/bizar-dash/src/web/views/memory/SemanticSearchPanel.tsx +0 -197
  477. package/bizar-dash/src/web/views/memory/VaultFromClipboardPanel.tsx +0 -101
  478. package/bizar-dash/src/web/views/settings/ActivitySection.tsx +0 -205
  479. package/bizar-dash/src/web/views/settings/AgentSection.tsx +0 -305
  480. package/bizar-dash/src/web/views/settings/AuthSection.tsx +0 -159
  481. package/bizar-dash/src/web/views/settings/EnvVarsSection.tsx +0 -15
  482. package/bizar-dash/src/web/views/settings/GeneralSection.tsx +0 -128
  483. package/bizar-dash/src/web/views/settings/HeadroomSection.tsx +0 -39
  484. package/bizar-dash/src/web/views/settings/MemorySection.tsx +0 -154
  485. package/bizar-dash/src/web/views/settings/NetworkSection.tsx +0 -87
  486. package/bizar-dash/src/web/views/settings/NotificationsSection.tsx +0 -34
  487. package/bizar-dash/src/web/views/settings/SystemLlmSection.tsx +0 -81
  488. package/bizar-dash/src/web/views/settings/ThemeSection.tsx +0 -168
  489. package/bizar-dash/src/web/views/settings/UpdatesSection.tsx +0 -256
  490. package/bizar-dash/src/web/views/settings/WorkspacesSection.tsx +0 -189
@@ -1,1221 +0,0 @@
1
- // src/views/Activity.tsx — v3.5.4: timeline-based activity view (replaces the v3.5.2 graph+strip hybrid).
2
- // Layout: CSS grid with 3 sibling columns — left event stream, center timeline canvas, right detail panel.
3
- // X axis is time; Y axis is lanes (BG instances + tasks). Active tasks pulse; queued tasks are translucent
4
- // dashed; done tasks are faded. A red "now" line updates every 1s and re-anchors when it nears the right edge.
5
-
6
- import {
7
- useCallback,
8
- useEffect,
9
- useLayoutEffect,
10
- useMemo,
11
- useRef,
12
- useState,
13
- } from 'react';
14
- import {
15
- Activity as ActivityIcon,
16
- Bot,
17
- CheckSquare,
18
- Cpu,
19
- RefreshCw,
20
- Send,
21
- X,
22
- Plus,
23
- Trash2,
24
- MessageSquare,
25
- History,
26
- Pause,
27
- Play,
28
- PanelLeftClose,
29
- PanelLeftOpen,
30
- Layers,
31
- Target,
32
- FileText,
33
- } from 'lucide-react';
34
- import { Button } from '../components/Button';
35
- import { Card, CardTitle } from '../components/Card';
36
- import { EmptyState } from '../components/EmptyState';
37
- import { Spinner } from '../components/Spinner';
38
- import { VirtualList } from '../components/VirtualList';
39
- import { useToast } from '../components/Toast';
40
- import { useModal } from '../components/Modal';
41
- import { api } from '../lib/api';
42
- import { cn } from '../lib/utils';
43
- import type { Settings, Snapshot, Task, Agent } from '../lib/types';
44
- import { openArtifactViewer } from '../components/ArtifactViewer';
45
- import { logger } from '../lib/logger';
46
-
47
- type Props = {
48
- snapshot: Snapshot;
49
- settings: Settings;
50
- activeTab: string;
51
- setActiveTab: (id: string) => void;
52
- refreshSnapshot: () => Promise<void>;
53
- };
54
-
55
- type BgInstance = {
56
- instanceId: string;
57
- agent?: string;
58
- status?: string;
59
- startedAt?: number;
60
- completedAt?: number;
61
- lastEventAt?: number;
62
- promptPreview?: string;
63
- resultPreview?: string;
64
- error?: string;
65
- parentAgent?: string;
66
- parentInstanceId?: string;
67
- tmuxSession?: string;
68
- tmuxActive?: boolean;
69
- taskId?: string; // v3.6.2 — linked task for artifact lookup
70
- _bgDir?: string;
71
- };
72
-
73
- type ActivityEvent = {
74
- ts: string;
75
- kind: string;
76
- nodeId?: string;
77
- text?: string;
78
- author?: string;
79
- taskId?: string;
80
- [k: string]: unknown;
81
- };
82
-
83
- // ─── Time / layout constants ──────────────────────────────────────────
84
-
85
- const ZOOM_RANGES = {
86
- '1m': 60 * 1000,
87
- '5m': 5 * 60 * 1000,
88
- '30m': 30 * 60 * 1000,
89
- '1h': 60 * 60 * 1000,
90
- } as const;
91
- type ZoomKey = keyof typeof ZOOM_RANGES;
92
-
93
- const LANE_HEIGHT = 56;
94
- const TIME_AXIS_HEIGHT = 32;
95
- const EVENTS_STRIP_HEIGHT = 22;
96
- const MIN_BAR_WIDTH = 4;
97
- const REANCHOR_RATIO = 0.9; // when now_x exceeds this fraction of canvas width, re-anchor viewStart
98
-
99
- // ─── Status → color ───────────────────────────────────────────────────
100
-
101
- const STATUS_COLORS: Record<string, string> = {
102
- working: 'var(--success)',
103
- running: 'var(--success)',
104
- doing: 'var(--info)',
105
- queued: 'var(--info)',
106
- done: 'var(--success)',
107
- success: 'var(--success)',
108
- blocked: 'var(--warning)',
109
- error: 'var(--error)',
110
- failed: 'var(--error)',
111
- stuck: 'var(--warning)',
112
- killed: 'var(--error)',
113
- idle: 'var(--text-dim)',
114
- pending: 'var(--info)',
115
- timed_out: 'var(--warning)',
116
- };
117
-
118
- function statusColor(s: string | null | undefined): string {
119
- if (!s) return STATUS_COLORS.idle;
120
- return STATUS_COLORS[s] || STATUS_COLORS.idle;
121
- }
122
-
123
- function shortLabel(s: string | null | undefined, n = 24): string {
124
- if (!s) return '';
125
- if (s.length <= n) return s;
126
- return s.slice(0, n - 1) + '…';
127
- }
128
-
129
- // ─── Time helpers ─────────────────────────────────────────────────────
130
-
131
- function parseTs(ts: string | number | null | undefined): number {
132
- if (ts == null) return 0;
133
- if (typeof ts === 'number') return ts;
134
- const t = new Date(ts).getTime();
135
- return Number.isNaN(t) ? 0 : t;
136
- }
137
-
138
- function taskStartMs(t: Task): number {
139
- // v3.5.4 — prefer _timerStart (set when work begins), fall back to createdAt.
140
- const ts = (t as { _timerStart?: number })._timerStart;
141
- if (typeof ts === 'number' && ts > 0) return ts;
142
- return parseTs(t.createdAt) || Date.now();
143
- }
144
-
145
- function taskEndMs(t: Task, now: number): number {
146
- if (t.status === 'done' || t.status === 'archived' || t.status === 'failed' || t.status === 'killed') {
147
- return parseTs(t.completedAt) || parseTs(t.updatedAt) || now;
148
- }
149
- // Active tasks: pin to now.
150
- return now;
151
- }
152
-
153
- function bgStartMs(b: BgInstance): number {
154
- return typeof b.startedAt === 'number' && b.startedAt > 0 ? b.startedAt : Date.now();
155
- }
156
-
157
- function bgEndMs(b: BgInstance, now: number): number {
158
- if (
159
- b.status === 'done'
160
- || b.status === 'success'
161
- || b.status === 'killed'
162
- || b.status === 'failed'
163
- || b.status === 'error'
164
- || b.status === 'timed_out'
165
- ) {
166
- return b.completedAt || b.lastEventAt || now;
167
- }
168
- return now;
169
- }
170
-
171
- function chooseTickStep(rangeMs: number): number {
172
- if (rangeMs <= 60_000) return 10_000;
173
- if (rangeMs <= 300_000) return 30_000;
174
- if (rangeMs <= 1_800_000) return 300_000;
175
- return 600_000;
176
- }
177
-
178
- function formatTickLabel(t: number, rangeMs: number): string {
179
- const d = new Date(t);
180
- if (rangeMs <= 300_000) {
181
- return d.toLocaleTimeString('en-GB', { hour12: false });
182
- }
183
- return d.toLocaleTimeString('en-GB', { hour12: false, hour: '2-digit', minute: '2-digit' });
184
- }
185
-
186
- // ─── Lane + tick types ────────────────────────────────────────────────
187
-
188
- type Lane =
189
- | { kind: 'bg'; id: string; index: number; label: string; sub: string; start: number; end: number; data: BgInstance }
190
- | { kind: 'task'; id: string; index: number; label: string; sub: string; start: number; end: number; data: Task }
191
- | { kind: 'events'; id: string; index: number; label: string; sub: string; start: number; end: number };
192
-
193
- type SelectedItem = {
194
- id: string;
195
- kind: 'task' | 'bg' | 'agent';
196
- label: string;
197
- status: string;
198
- data: Task | BgInstance | Agent;
199
- };
200
-
201
- type EventMarker = {
202
- id: string;
203
- x: number;
204
- y: number;
205
- kind: string;
206
- ts: number;
207
- text: string;
208
- author?: string;
209
- };
210
-
211
- type TaskBar = {
212
- id: string;
213
- laneIndex: number;
214
- x: number;
215
- y: number;
216
- w: number;
217
- h: number;
218
- label: string;
219
- statusClass: 'doing' | 'done' | 'queued' | 'blocked' | 'failed';
220
- selected: boolean;
221
- data: Task | BgInstance;
222
- kind: 'task' | 'bg';
223
- start: number;
224
- end: number;
225
- };
226
-
227
- // ─── Component ────────────────────────────────────────────────────────
228
-
229
- export function Activity({ snapshot, refreshSnapshot }: Props) {
230
- const toast = useToast();
231
- const canvasWrapRef = useRef<HTMLDivElement | null>(null);
232
-
233
- // View state
234
- const [mode, setMode] = useState<'live' | 'pause'>('live');
235
- const [zoom, setZoom] = useState<ZoomKey>('5m');
236
- const [streamOpen, setStreamOpen] = useState(() => {
237
- if (typeof window === 'undefined') return true;
238
- return window.innerWidth > 900;
239
- });
240
-
241
- // Data
242
- const [bgInstances, setBgInstances] = useState<BgInstance[]>([]);
243
- const [events, setEvents] = useState<ActivityEvent[]>([]);
244
- const [loading, setLoading] = useState(true);
245
- const [refreshTick, setRefreshTick] = useState(0);
246
-
247
- // Time
248
- const [nowTick, setNowTick] = useState<number>(Date.now());
249
- const [viewStart, setViewStart] = useState<number>(() => Date.now() - ZOOM_RANGES['5m'] * 0.1);
250
-
251
- // Canvas size (observed)
252
- const [canvasSize, setCanvasSize] = useState<{ width: number; height: number }>({ width: 800, height: 400 });
253
-
254
- // Selection / detail
255
- const [selectedItem, setSelectedItem] = useState<SelectedItem | null>(null);
256
-
257
- // Detail panel local state
258
- const [commentText, setCommentText] = useState('');
259
- const [comments, setComments] = useState<ActivityEvent[]>([]);
260
- const [taskTitle, setTaskTitle] = useState('');
261
- const [taskPriority, setTaskPriority] = useState('normal');
262
- const [bgMessage, setBgMessage] = useState('');
263
- const [bgOutput, setBgOutput] = useState('');
264
- const [creatingTask, setCreatingTask] = useState(false);
265
- const [postingComment, setPostingComment] = useState(false);
266
- // v3.6.2 — artifact IDs fetched from the task linked to the selected bg instance.
267
- const [bgArtifactIds, setBgArtifactIds] = useState<string[]>([]);
268
-
269
- const modal = useModal();
270
-
271
- const agents = snapshot.agents || [];
272
- const tasks = snapshot.tasks || [];
273
- const rangeMs = ZOOM_RANGES[zoom];
274
- const rangeStart = viewStart;
275
- const rangeEnd = viewStart + rangeMs;
276
-
277
- // ─── Data polling ───────────────────────────────────────────────────
278
- const reloadAll = useCallback(async () => {
279
- try {
280
- const [bgRes, evRes] = await Promise.all([
281
- api.get<{ instances: BgInstance[] }>('/background').catch(() => ({ instances: [] })),
282
- api.get<{ events: ActivityEvent[] }>('/activity?limit=200').catch(() => ({ events: [] })),
283
- ]);
284
- setBgInstances(bgRes.instances || []);
285
- setEvents(evRes.events || []);
286
- } catch (err) {
287
- logger.warn('activity reload failed:', err);
288
- } finally {
289
- setLoading(false);
290
- }
291
- }, []);
292
-
293
- useEffect(() => {
294
- reloadAll();
295
- const id = setInterval(reloadAll, 3000);
296
- return () => clearInterval(id);
297
- }, [reloadAll]);
298
-
299
- // Trigger a re-fetch when the snapshot's task/agent counts change.
300
- useEffect(() => {
301
- setRefreshTick((t) => t + 1);
302
- // eslint-disable-next-line react-hooks/exhaustive-deps
303
- }, [tasks.length, agents.length]);
304
-
305
- // ─── Now tick (1s) — paused when mode === 'pause' ───────────────────
306
- useEffect(() => {
307
- if (mode === 'pause') return;
308
- setNowTick(Date.now());
309
- const id = setInterval(() => setNowTick(Date.now()), 1000);
310
- return () => clearInterval(id);
311
- }, [mode, refreshTick]);
312
-
313
- // ─── Re-anchor viewStart when the now line nears the right edge ────
314
- useEffect(() => {
315
- if (mode === 'pause') return;
316
- const nowRatio = (nowTick - viewStart) / rangeMs;
317
- if (nowRatio > REANCHOR_RATIO) {
318
- setViewStart(nowTick - rangeMs * 0.1);
319
- }
320
- }, [nowTick, viewStart, rangeMs, mode]);
321
-
322
- // On zoom change, reset viewStart so now sits at 10% from the left.
323
- useEffect(() => {
324
- setViewStart(Date.now() - rangeMs * 0.1);
325
- // eslint-disable-next-line react-hooks/exhaustive-deps
326
- }, [zoom]);
327
-
328
- // On resume from pause, re-anchor so the now line lands at 10%.
329
- useEffect(() => {
330
- if (mode === 'live') {
331
- setViewStart(Date.now() - rangeMs * 0.1);
332
- }
333
- // eslint-disable-next-line react-hooks/exhaustive-deps
334
- }, [mode]);
335
-
336
- // ─── Canvas size observer ───────────────────────────────────────────
337
- useLayoutEffect(() => {
338
- const el = canvasWrapRef.current;
339
- if (!el) return;
340
- const ro = new ResizeObserver((entries) => {
341
- for (const entry of entries) {
342
- const { width, height } = entry.contentRect;
343
- setCanvasSize({
344
- width: Math.max(200, Math.floor(width)),
345
- height: Math.max(120, Math.floor(height)),
346
- });
347
- }
348
- });
349
- ro.observe(el);
350
- return () => ro.disconnect();
351
- }, []);
352
-
353
- // ─── Lane allocation ────────────────────────────────────────────────
354
- const lanes: Lane[] = useMemo(() => {
355
- const out: Lane[] = [];
356
- let idx = 0;
357
-
358
- // BG instances — one lane each, at the top.
359
- for (const bg of bgInstances) {
360
- const start = bgStartMs(bg);
361
- const end = bgEndMs(bg, nowTick);
362
- if (end < rangeStart || start > rangeEnd) continue;
363
- out.push({
364
- kind: 'bg',
365
- id: `bg:${bg.instanceId}`,
366
- index: idx++,
367
- label: `BG ${shortLabel(bg.promptPreview, 20) || bg.instanceId.slice(0, 10)}`,
368
- sub: bg.status || 'pending',
369
- start,
370
- end,
371
- data: bg,
372
- });
373
- }
374
-
375
- // Tasks — greedy lane assignment (fill first lane that has no overlap).
376
- const sorted = [...tasks].sort((a, b) => taskStartMs(a) - taskStartMs(b));
377
- const taskLaneEnds: number[] = []; // end-time of last task placed in each lane
378
- for (const t of sorted) {
379
- const s = taskStartMs(t);
380
- const e = taskEndMs(t, nowTick);
381
- if (e < rangeStart || s > rangeEnd) continue;
382
- let assigned = -1;
383
- for (let i = 0; i < taskLaneEnds.length; i++) {
384
- if (taskLaneEnds[i] <= s) {
385
- taskLaneEnds[i] = e;
386
- assigned = i;
387
- break;
388
- }
389
- }
390
- if (assigned === -1) {
391
- taskLaneEnds.push(e);
392
- assigned = taskLaneEnds.length - 1;
393
- }
394
- out.push({
395
- kind: 'task',
396
- id: `task:${t.id}`,
397
- index: idx + assigned,
398
- label: shortLabel(t.title, 32),
399
- sub: t.status,
400
- start: s,
401
- end: e,
402
- data: t,
403
- });
404
- }
405
-
406
- return out;
407
- }, [bgInstances, tasks, nowTick, rangeStart, rangeEnd]);
408
-
409
- const laneById = useMemo(() => {
410
- const m = new Map<string, Lane>();
411
- for (const l of lanes) m.set(l.id, l);
412
- return m;
413
- }, [lanes]);
414
-
415
- // ─── Time → X coordinate ────────────────────────────────────────────
416
- const timeToX = useCallback(
417
- (t: number): number => {
418
- if (rangeMs <= 0) return 0;
419
- return ((t - rangeStart) / rangeMs) * canvasSize.width;
420
- },
421
- [rangeStart, rangeMs, canvasSize.width],
422
- );
423
-
424
- // ─── Tick marks for the time axis ───────────────────────────────────
425
- const ticks = useMemo(() => {
426
- const step = chooseTickStep(rangeMs);
427
- const result: { t: number; x: number; label: string }[] = [];
428
- // Align to step boundary.
429
- const startAligned = Math.floor(rangeStart / step) * step;
430
- for (let t = startAligned; t <= rangeEnd + step; t += step) {
431
- if (t < rangeStart - step) continue;
432
- if (t > rangeEnd) break;
433
- const x = timeToX(t);
434
- if (x < -40 || x > canvasSize.width + 40) continue;
435
- result.push({ t, x, label: formatTickLabel(t, rangeMs) });
436
- }
437
- return result;
438
- }, [rangeStart, rangeEnd, rangeMs, canvasSize.width, timeToX]);
439
-
440
- // ─── Build task/bg bars ─────────────────────────────────────────────
441
- const bars: TaskBar[] = useMemo(() => {
442
- const out: TaskBar[] = [];
443
- for (const lane of lanes) {
444
- if (lane.kind === 'events') continue;
445
- const visibleStart = Math.max(lane.start, rangeStart);
446
- const visibleEnd = Math.min(lane.end, rangeEnd);
447
- if (visibleEnd < rangeStart || visibleStart > rangeEnd) continue;
448
- const x = timeToX(visibleStart);
449
- const xEnd = timeToX(visibleEnd);
450
- const w = Math.max(MIN_BAR_WIDTH, xEnd - x);
451
- const y = TIME_AXIS_HEIGHT + EVENTS_STRIP_HEIGHT + lane.index * LANE_HEIGHT + 8;
452
- const h = LANE_HEIGHT - 16;
453
-
454
- let statusClass: TaskBar['statusClass'] = 'doing';
455
- if (lane.kind === 'bg') {
456
- const s = lane.data.status || 'pending';
457
- if (s === 'done' || s === 'success') statusClass = 'done';
458
- else if (s === 'failed' || s === 'killed' || s === 'error') statusClass = 'failed';
459
- else if (s === 'queued' || s === 'pending') statusClass = 'queued';
460
- else if (s === 'blocked' || s === 'stuck') statusClass = 'blocked';
461
- else statusClass = 'doing';
462
- } else {
463
- const s = lane.data.status;
464
- if (s === 'done' || s === 'archived') statusClass = 'done';
465
- else if (s === 'failed' || s === 'killed') statusClass = 'failed';
466
- else if (s === 'queued') statusClass = 'queued';
467
- else if (s === 'blocked') statusClass = 'blocked';
468
- else statusClass = 'doing';
469
- }
470
-
471
- const selected = selectedItem?.id === lane.id;
472
-
473
- out.push({
474
- id: lane.id,
475
- laneIndex: lane.index,
476
- x,
477
- y,
478
- w,
479
- h,
480
- label: lane.label,
481
- statusClass,
482
- selected,
483
- data: lane.data,
484
- kind: lane.kind,
485
- start: lane.start,
486
- end: lane.end,
487
- });
488
- }
489
- return out;
490
- }, [lanes, timeToX, selectedItem, rangeStart, rangeEnd]);
491
-
492
- // ─── Build event markers (placed on the lane of their related entity) ─
493
- const eventMarkers: EventMarker[] = useMemo(() => {
494
- const out: EventMarker[] = [];
495
- for (const ev of events) {
496
- const ts = parseTs(ev.ts);
497
- if (ts < rangeStart - 5000 || ts > rangeEnd + 5000) continue;
498
- const x = timeToX(ts);
499
-
500
- // Try to find a related lane.
501
- let y = TIME_AXIS_HEIGHT + 12; // default: events strip
502
- if (ev.taskId) {
503
- const lane = laneById.get(`task:${ev.taskId}`);
504
- if (lane) y = TIME_AXIS_HEIGHT + EVENTS_STRIP_HEIGHT + lane.index * LANE_HEIGHT + LANE_HEIGHT / 2;
505
- } else if (ev.nodeId) {
506
- const id = String(ev.nodeId);
507
- const lane = laneById.get(id.startsWith('task:') || id.startsWith('bg:') ? id : `task:${id}`);
508
- if (lane) y = TIME_AXIS_HEIGHT + EVENTS_STRIP_HEIGHT + lane.index * LANE_HEIGHT + LANE_HEIGHT / 2;
509
- }
510
-
511
- out.push({
512
- id: `${ev.ts}-${ev.kind}-${ev.author ?? ''}-${ev.taskId ?? ''}`,
513
- x,
514
- y,
515
- kind: ev.kind || 'event',
516
- ts,
517
- text: String(ev.text || ev.kind || ''),
518
- author: ev.author as string | undefined,
519
- });
520
- }
521
- return out;
522
- }, [events, rangeStart, rangeEnd, timeToX, laneById]);
523
-
524
- // ─── Lane backgrounds (alternating) ─────────────────────────────────
525
- const laneRects = useMemo(() => {
526
- return lanes.map((lane) => ({
527
- id: lane.id,
528
- y: TIME_AXIS_HEIGHT + EVENTS_STRIP_HEIGHT + lane.index * LANE_HEIGHT,
529
- h: LANE_HEIGHT,
530
- }));
531
- }, [lanes]);
532
-
533
- // ─── Now line position ──────────────────────────────────────────────
534
- const nowX = useMemo(() => {
535
- const x = timeToX(nowTick);
536
- return Math.max(0, Math.min(canvasSize.width, x));
537
- }, [timeToX, nowTick, canvasSize.width]);
538
-
539
- // ─── Click on a bar → open detail panel ─────────────────────────────
540
- const onSelectBar = useCallback((bar: TaskBar) => {
541
- const id = bar.id; // 'task:xxx' or 'bg:xxx'
542
- const item: SelectedItem = {
543
- id,
544
- kind: bar.kind,
545
- label: bar.label,
546
- status: bar.statusClass,
547
- data: bar.data,
548
- };
549
- setSelectedItem(item);
550
- }, []);
551
-
552
- // ─── Detail panel: fetch related data when selection changes ────────
553
- useEffect(() => {
554
- if (!selectedItem) {
555
- setComments([]);
556
- setBgOutput('');
557
- setBgArtifactIds([]);
558
- return;
559
- }
560
- setCommentText('');
561
- setTaskTitle('');
562
- setBgMessage('');
563
- setBgArtifactIds([]);
564
- (async () => {
565
- try {
566
- const r = await api.get<{ events: ActivityEvent[] }>(
567
- `/activity?nodeId=${encodeURIComponent(selectedItem.id)}&limit=50`,
568
- );
569
- setComments(r.events || []);
570
- } catch {
571
- setComments([]);
572
- }
573
- if (selectedItem.kind === 'bg') {
574
- const bgData = selectedItem.data as BgInstance;
575
- try {
576
- const r = await api.get<{ output: string }>(
577
- `/background/${encodeURIComponent(bgData.instanceId)}/output?lines=80`,
578
- );
579
- setBgOutput(r.output || '');
580
- } catch {
581
- setBgOutput('');
582
- }
583
- // v3.6.2 — If the bg instance has a linked taskId, fetch its artifacts.
584
- if (bgData.taskId) {
585
- try {
586
- const artR = await api.get<{ artifacts: { id: string }[] }>(
587
- `/tasks/${encodeURIComponent(bgData.taskId)}/artifacts`,
588
- );
589
- setBgArtifactIds((artR.artifacts || []).map((a) => a.id));
590
- } catch {
591
- setBgArtifactIds([]);
592
- }
593
- }
594
- }
595
- })();
596
- }, [selectedItem]);
597
-
598
- // ─── Detail actions ─────────────────────────────────────────────────
599
- const onAddComment = async () => {
600
- if (!selectedItem || !commentText.trim()) return;
601
- setPostingComment(true);
602
- try {
603
- await api.post('/comments', { nodeId: selectedItem.id, text: commentText, author: 'user' });
604
- setCommentText('');
605
- const r = await api.get<{ events: ActivityEvent[] }>(
606
- `/activity?nodeId=${encodeURIComponent(selectedItem.id)}&limit=50`,
607
- );
608
- setComments(r.events || []);
609
- toast.success('Comment added.');
610
- } catch (err) {
611
- toast.error(`Comment failed: ${(err as Error).message}`);
612
- } finally {
613
- setPostingComment(false);
614
- }
615
- };
616
-
617
- const onCreateTaskFromNode = async () => {
618
- if (!selectedItem || !taskTitle.trim()) return;
619
- setCreatingTask(true);
620
- try {
621
- await api.post(`/nodes/${encodeURIComponent(selectedItem.id)}/tasks`, {
622
- title: taskTitle,
623
- description: `Created from timeline selection ${selectedItem.id}.`,
624
- priority: taskPriority,
625
- });
626
- setTaskTitle('');
627
- toast.success('Task created.');
628
- await refreshSnapshot();
629
- } catch (err) {
630
- toast.error(`Task create failed: ${(err as Error).message}`);
631
- } finally {
632
- setCreatingTask(false);
633
- }
634
- };
635
-
636
- const onSendBgMessage = async () => {
637
- if (!selectedItem || selectedItem.kind !== 'bg' || !bgMessage.trim()) return;
638
- const bgData = selectedItem.data as BgInstance;
639
- try {
640
- const r = await api.post<{ ok: boolean; error?: string }>(
641
- `/background/${encodeURIComponent(bgData.instanceId)}/message`,
642
- { message: bgMessage },
643
- );
644
- if (r.ok) {
645
- toast.success('Message sent.');
646
- setBgMessage('');
647
- } else {
648
- toast.warning(r.error || 'Send failed');
649
- }
650
- } catch (err) {
651
- toast.error(`Send failed: ${(err as Error).message}`);
652
- }
653
- };
654
-
655
- const onKillBg = async () => {
656
- if (!selectedItem || selectedItem.kind !== 'bg') return;
657
- if (!confirm('Kill this bg instance session?')) return;
658
- const bgData = selectedItem.data as BgInstance;
659
- try {
660
- const r = await api.del<{ ok: boolean; error?: string }>(
661
- `/background/${encodeURIComponent(bgData.instanceId)}`,
662
- );
663
- if (r.ok) toast.success('Session killed.');
664
- else toast.warning(r.error || 'Kill failed');
665
- await reloadAll();
666
- } catch (err) {
667
- toast.error(`Kill failed: ${(err as Error).message}`);
668
- }
669
- };
670
-
671
- const refetchOutput = async () => {
672
- if (!selectedItem || selectedItem.kind !== 'bg') return;
673
- const bgData = selectedItem.data as BgInstance;
674
- try {
675
- const r = await api.get<{ output: string }>(
676
- `/background/${encodeURIComponent(bgData.instanceId)}/output?lines=80`,
677
- );
678
- setBgOutput(r.output || '');
679
- } catch {
680
- /* ignore */
681
- }
682
- };
683
-
684
- // ─── Keyboard helpers ───────────────────────────────────────────────
685
- useEffect(() => {
686
- const onKey = (e: KeyboardEvent) => {
687
- if (e.key === 'Escape') setSelectedItem(null);
688
- };
689
- window.addEventListener('keydown', onKey);
690
- return () => window.removeEventListener('keydown', onKey);
691
- }, []);
692
-
693
- // ─── Refresh handler ────────────────────────────────────────────────
694
- const refresh = () => {
695
- setRefreshTick((t) => t + 1);
696
- reloadAll();
697
- };
698
-
699
- // ─── Derived: total content height (for SVG sizing) ─────────────────
700
- const contentHeight = TIME_AXIS_HEIGHT + EVENTS_STRIP_HEIGHT + lanes.length * LANE_HEIGHT;
701
-
702
- // ─── Render ─────────────────────────────────────────────────────────
703
- return (
704
- <div className="view view-activity">
705
- {/* Top header bar — title + live/pause + zoom + refresh */}
706
- <header className="view-header">
707
- <div className="view-header-text">
708
- <h2 className="view-title">
709
- <ActivityIcon size={18} /> Activity
710
- </h2>
711
- <p className="view-subtitle">
712
- Live timeline of agents, tasks, and background sessions. Active tasks pulse; the red line marks &ldquo;now&rdquo;.
713
- </p>
714
- </div>
715
- <div className="view-actions">
716
- <div className="tl-mode-toggle">
717
- <Button
718
- variant={mode === 'live' ? 'primary' : 'secondary'}
719
- size="sm"
720
- onClick={() => setMode(mode === 'live' ? 'pause' : 'live')}
721
- title={mode === 'live' ? 'Pause timeline' : 'Resume timeline'}
722
- >
723
- {mode === 'live' ? <Pause size={14} /> : <Play size={14} />}
724
- {mode === 'live' ? 'Live' : 'Paused'}
725
- </Button>
726
- <div className="tl-zoom-group">
727
- {(['1m', '5m', '30m', '1h'] as ZoomKey[]).map((z) => (
728
- <button
729
- type="button"
730
- key={z}
731
- className={cn('tl-zoom-btn', zoom === z && 'tl-zoom-btn-active')}
732
- onClick={() => setZoom(z)}
733
- title={`Zoom to ${z}`}
734
- >
735
- {z}
736
- </button>
737
- ))}
738
- </div>
739
- <Button variant="secondary" size="sm" onClick={refresh} title="Refresh">
740
- <RefreshCw size={14} /> Refresh
741
- </Button>
742
- </div>
743
- </div>
744
- </header>
745
-
746
- {loading && (
747
- <div className="view-loading"><Spinner size="lg" /></div>
748
- )}
749
-
750
- {!loading && agents.length === 0 && tasks.length === 0 && bgInstances.length === 0 && events.length === 0 ? (
751
- <EmptyState
752
- icon={<ActivityIcon size={32} />}
753
- title="No activity yet"
754
- message="Once agents, tasks, or background instances exist, they'll show up here on the timeline."
755
- />
756
- ) : (
757
- <div className={cn('tl-view', selectedItem && 'tl-view-detail-open')}>
758
- <div className={cn('tl-body', !streamOpen && 'tl-body-stream-collapsed')}>
759
- {/* Left column — event stream (sibling, not overlay) */}
760
- <aside className={cn('tl-stream', !streamOpen && 'tl-stream-collapsed')}>
761
- <div className="tl-stream-head">
762
- <h3>
763
- <History size={13} /> Live events
764
- </h3>
765
- <button
766
- type="button"
767
- className="icon-btn"
768
- onClick={() => setStreamOpen(false)}
769
- title="Hide event stream"
770
- aria-label="Hide event stream"
771
- >
772
- <PanelLeftClose size={14} />
773
- </button>
774
- </div>
775
- <div className="tl-stream-list">
776
- {events.length === 0 ? (
777
- <div className="tl-stream-empty">
778
- <p>No events yet.</p>
779
- </div>
780
- ) : (
781
- <VirtualList
782
- items={[...events].reverse()}
783
- itemHeight={40}
784
- height={400}
785
- className="tl-stream-virtual"
786
- renderItem={(ev) => {
787
- const Icon =
788
- ev.author ? Bot : ev.kind === 'task' ? CheckSquare : ev.kind === 'bg' ? Cpu : ActivityIcon;
789
- return (
790
- <div className="tl-stream-event">
791
- <span className="tl-stream-event-time">
792
- {new Date(ev.ts).toLocaleTimeString('en-GB', { hour12: false })}
793
- </span>
794
- <span className="tl-stream-event-icon" style={{ color: statusColor(ev.kind) }}>
795
- <Icon size={12} />
796
- </span>
797
- <span className="tl-stream-event-text">
798
- {ev.author || ev.text || ev.kind}
799
- </span>
800
- </div>
801
- );
802
- }}
803
- />
804
- )}
805
- </div>
806
- </aside>
807
-
808
- {/* Center column — timeline canvas */}
809
- <div className="tl-canvas-wrap" ref={canvasWrapRef}>
810
- <div className="tl-canvas-toolbar">
811
- <div className="tl-canvas-toolbar-left">
812
- {!streamOpen && (
813
- <Button
814
- variant="ghost"
815
- size="sm"
816
- onClick={() => setStreamOpen(true)}
817
- title="Show event stream"
818
- >
819
- <PanelLeftOpen size={14} /> Events
820
- </Button>
821
- )}
822
- <span className="tl-canvas-mode">
823
- {mode === 'live' ? '● Live' : '⏸ Paused'}
824
- </span>
825
- <span className="tl-canvas-range">
826
- {new Date(rangeStart).toLocaleTimeString('en-GB', { hour12: false })} →{' '}
827
- {new Date(rangeEnd).toLocaleTimeString('en-GB', { hour12: false })}
828
- </span>
829
- </div>
830
- <div className="tl-canvas-legend">
831
- <span className="tl-legend-item"><span className="tl-legend-dot" style={{ background: 'var(--success)' }} /> active</span>
832
- <span className="tl-legend-item"><span className="tl-legend-dot tl-legend-dot-dashed" style={{ borderColor: 'var(--info)' }} /> queued</span>
833
- <span className="tl-legend-item"><span className="tl-legend-dot" style={{ background: 'var(--warning)' }} /> blocked</span>
834
- <span className="tl-legend-item"><span className="tl-legend-dot" style={{ background: 'var(--error)' }} /> error</span>
835
- <span className="tl-legend-sep" />
836
- <span className="tl-legend-item"><Layers size={11} /> agent</span>
837
- <span className="tl-legend-item"><Target size={11} /> task</span>
838
- <span className="tl-legend-item"><Cpu size={11} /> bg</span>
839
- </div>
840
- </div>
841
-
842
- <div className="tl-canvas-scroll">
843
- <svg
844
- className="tl-canvas"
845
- width={canvasSize.width}
846
- height={Math.max(canvasSize.height, contentHeight)}
847
- role="application"
848
- aria-label="Activity timeline"
849
- >
850
- <defs>
851
- <pattern
852
- id="tl-canvas-grid"
853
- width={canvasSize.width}
854
- height={LANE_HEIGHT}
855
- patternUnits="userSpaceOnUse"
856
- >
857
- <path
858
- d={`M 0 0 L 0 ${LANE_HEIGHT}`}
859
- fill="none"
860
- stroke="var(--border)"
861
- strokeWidth={0.5}
862
- opacity={0.35}
863
- />
864
- </pattern>
865
- </defs>
866
- <rect width="100%" height="100%" fill="url(#tl-canvas-grid)" />
867
-
868
- {/* Lane backgrounds (alternating) */}
869
- {laneRects.map((lr) => (
870
- <rect
871
- key={`bg-${lr.id}`}
872
- className="tl-lane-bg"
873
- x={0}
874
- y={lr.y}
875
- width={canvasSize.width}
876
- height={lr.h}
877
- fill={lr.id.charCodeAt(lr.id.length - 1) % 2 === 0 ? 'var(--bg-elev-2)' : 'var(--bg-elev)'}
878
- opacity={0.4}
879
- />
880
- ))}
881
-
882
- {/* Time axis tick lines + labels */}
883
- <g className="tl-time-axis">
884
- {ticks.map((t) => (
885
- <g key={`tick-${t.t}`}>
886
- <line
887
- x1={t.x}
888
- y1={0}
889
- x2={t.x}
890
- y2={contentHeight}
891
- stroke="var(--border)"
892
- strokeWidth={0.5}
893
- strokeDasharray="2,4"
894
- opacity={0.5}
895
- />
896
- <text
897
- x={t.x + 4}
898
- y={TIME_AXIS_HEIGHT - 8}
899
- fontSize={10}
900
- fontFamily="var(--font-mono)"
901
- fill="var(--text-dim)"
902
- >
903
- {t.label}
904
- </text>
905
- </g>
906
- ))}
907
- </g>
908
-
909
- {/* Lane labels (rendered inside SVG, x=4) */}
910
- {lanes.map((lane) => {
911
- const y = TIME_AXIS_HEIGHT + EVENTS_STRIP_HEIGHT + lane.index * LANE_HEIGHT + LANE_HEIGHT / 2;
912
- return (
913
- <g key={`label-${lane.id}`} className="tl-lane-label-group">
914
- <text
915
- x={6}
916
- y={y - 2}
917
- className="tl-lane-label"
918
- textAnchor="start"
919
- >
920
- {shortLabel(lane.label, 28)}
921
- </text>
922
- <text
923
- x={6}
924
- y={y + 10}
925
- className="tl-lane-label-sub"
926
- textAnchor="start"
927
- >
928
- {lane.sub}
929
- </text>
930
- </g>
931
- );
932
- })}
933
-
934
- {/* Task / BG bars */}
935
- {bars.map((bar) => {
936
- const fillColor = statusColor(bar.statusClass);
937
- const isSelected = bar.id === selectedItem?.id;
938
- return (
939
- <g
940
- key={`bar-${bar.id}`}
941
- className={cn('tl-task-bar', `tl-task-bar-${bar.statusClass}`, isSelected && 'tl-task-bar-selected')}
942
- onClick={() => onSelectBar(bar)}
943
- >
944
- <rect
945
- x={bar.x}
946
- y={bar.y}
947
- width={bar.w}
948
- height={bar.h}
949
- rx={6}
950
- fill={fillColor}
951
- fillOpacity={bar.statusClass === 'done' ? 0.35 : bar.statusClass === 'queued' ? 0.18 : 0.85}
952
- stroke={fillColor}
953
- strokeWidth={isSelected ? 2.5 : 1.5}
954
- strokeOpacity={bar.statusClass === 'done' ? 0.5 : 1}
955
- strokeDasharray={bar.statusClass === 'queued' ? '4 4' : undefined}
956
- style={{ cursor: 'pointer' }}
957
- />
958
- {bar.w > 36 && (
959
- <text
960
- x={bar.x + 8}
961
- y={bar.y + bar.h / 2 + 4}
962
- fontSize={11}
963
- fontFamily="var(--font-sans)"
964
- fontWeight={500}
965
- fill="var(--text-strong)"
966
- style={{ pointerEvents: 'none' }}
967
- opacity={bar.statusClass === 'done' ? 0.7 : 1}
968
- >
969
- {shortLabel(bar.label, Math.max(4, Math.floor(bar.w / 7)))}
970
- </text>
971
- )}
972
- </g>
973
- );
974
- })}
975
-
976
- {/* Event markers */}
977
- {eventMarkers.map((m) => {
978
- const color = statusColor(m.kind);
979
- return (
980
- <g key={`ev-${m.id}`} className="tl-event-marker-group">
981
- <line
982
- x1={m.x}
983
- y1={m.y - 6}
984
- x2={m.x}
985
- y2={m.y + 6}
986
- stroke={color}
987
- strokeWidth={1.2}
988
- opacity={0.7}
989
- />
990
- <circle
991
- cx={m.x}
992
- cy={m.y}
993
- r={4}
994
- fill={color}
995
- opacity={0.9}
996
- >
997
- <title>
998
- {`${m.kind}${m.author ? ` · ${m.author}` : ''} · ${new Date(m.ts).toLocaleTimeString('en-GB', { hour12: false })}`}
999
- </title>
1000
- </circle>
1001
- </g>
1002
- );
1003
- })}
1004
-
1005
- {/* Now line (red, vertical) */}
1006
- <line
1007
- className="tl-now-line"
1008
- x1={nowX}
1009
- y1={0}
1010
- x2={nowX}
1011
- y2={contentHeight}
1012
- stroke="var(--error)"
1013
- strokeWidth={1.5}
1014
- opacity={0.9}
1015
- />
1016
- <g className="tl-now-marker">
1017
- <circle cx={nowX} cy={TIME_AXIS_HEIGHT - 4} r={4} fill="var(--error)" />
1018
- <text
1019
- x={nowX + 6}
1020
- y={TIME_AXIS_HEIGHT - 4}
1021
- fontSize={10}
1022
- fontWeight={700}
1023
- fill="var(--error)"
1024
- fontFamily="var(--font-mono)"
1025
- >
1026
- now
1027
- </text>
1028
- </g>
1029
- </svg>
1030
- </div>
1031
- </div>
1032
-
1033
- {/* Right column — detail panel */}
1034
- {selectedItem && (
1035
- <aside className="tl-detail tl-detail-enter" key={selectedItem.id}>
1036
- <Card>
1037
- <CardTitle>
1038
- {selectedItem.kind === 'agent' && <Bot size={14} />}
1039
- {selectedItem.kind === 'task' && <CheckSquare size={14} />}
1040
- {selectedItem.kind === 'bg' && <Cpu size={14} />}
1041
- {selectedItem.label}
1042
- <button
1043
- type="button"
1044
- className="icon-btn"
1045
- onClick={() => setSelectedItem(null)}
1046
- title="Close"
1047
- aria-label="Close activity detail"
1048
- style={{ marginLeft: 'auto' }}
1049
- >
1050
- <X size={14} />
1051
- </button>
1052
- </CardTitle>
1053
- <div className="tl-detail-meta">
1054
- <div><span className="muted">type</span> {selectedItem.kind}</div>
1055
- <div><span className="muted">status</span> <code>{selectedItem.status}</code></div>
1056
- {selectedItem.kind === 'agent' && (() => {
1057
- const a = selectedItem.data as Agent;
1058
- return (
1059
- <>
1060
- {a.role && <div><span className="muted">role</span> {a.role}</div>}
1061
- {a.model && <div><span className="muted">model</span> {a.model}</div>}
1062
- </>
1063
- );
1064
- })()}
1065
- {selectedItem.kind === 'task' && (() => {
1066
- const t = selectedItem.data as Task;
1067
- return (
1068
- <>
1069
- {t.assignee && <div><span className="muted">assignee</span> @{t.assignee}</div>}
1070
- {t.priority && <div><span className="muted">priority</span> {t.priority}</div>}
1071
- {t.createdAt && <div><span className="muted">created</span> {new Date(t.createdAt).toLocaleString()}</div>}
1072
- </>
1073
- );
1074
- })()}
1075
- {selectedItem.kind === 'bg' && (() => {
1076
- const b = selectedItem.data as BgInstance;
1077
- return (
1078
- <>
1079
- {b.startedAt && <div><span className="muted">started</span> {new Date(b.startedAt).toLocaleString()}</div>}
1080
- {b.tmuxSession && <div><span className="muted">tmux</span> <code>{b.tmuxSession}</code> {b.tmuxActive ? <span className="tag tag-success">active</span> : <span className="tag">inactive</span>}</div>}
1081
- </>
1082
- );
1083
- })()}
1084
- </div>
1085
- {selectedItem.kind === 'task' && (selectedItem.data as Task).description && (
1086
- <div className="tl-detail-desc">{(selectedItem.data as Task).description}</div>
1087
- )}
1088
- {selectedItem.kind === 'bg' && (selectedItem.data as BgInstance).promptPreview && (
1089
- <div className="tl-detail-desc">{(selectedItem.data as BgInstance).promptPreview}</div>
1090
- )}
1091
-
1092
- {selectedItem.kind === 'bg' && (
1093
- <div className="tl-detail-bg">
1094
- <pre className="tl-bg-output">{bgOutput || '(no output — start the session via tmux attach)'}</pre>
1095
- <div className="tl-bg-output-actions">
1096
- <Button variant="ghost" size="sm" onClick={refetchOutput}>
1097
- <RefreshCw size={12} /> Refresh output
1098
- </Button>
1099
- {bgArtifactIds.length > 0 && (
1100
- <Button
1101
- variant="secondary"
1102
- size="sm"
1103
- onClick={() => openArtifactViewer(modal, bgArtifactIds[0])}
1104
- >
1105
- <FileText size={12} /> Open artifact
1106
- </Button>
1107
- )}
1108
- <Button variant="danger" size="sm" onClick={onKillBg}>
1109
- <Trash2 size={12} /> Kill session
1110
- </Button>
1111
- </div>
1112
- <div className="tl-form-row">
1113
- <label htmlFor="bg-message-input" className="sr-only">Send a message to this bg session</label>
1114
- <input
1115
- id="bg-message-input"
1116
- className="input"
1117
- placeholder="Send a message to this bg session…"
1118
- value={bgMessage}
1119
- onChange={(e) => setBgMessage(e.target.value)}
1120
- onKeyDown={(e) => {
1121
- if (e.key === 'Enter') onSendBgMessage();
1122
- }}
1123
- aria-label="Send a message to this bg session"
1124
- />
1125
- <Button variant="primary" size="sm" disabled={!bgMessage.trim()} onClick={onSendBgMessage}>
1126
- <Send size={12} /> Send
1127
- </Button>
1128
- </div>
1129
- </div>
1130
- )}
1131
-
1132
- {selectedItem.kind !== 'bg' && (
1133
- <div className="tl-detail-create">
1134
- <label className="field-label" htmlFor="followup-task-title">Create follow-up task</label>
1135
- <input
1136
- id="followup-task-title"
1137
- className="input"
1138
- placeholder="Task title"
1139
- value={taskTitle}
1140
- onChange={(e) => setTaskTitle(e.target.value)}
1141
- />
1142
- <div className="tl-form-row">
1143
- <label htmlFor="followup-task-priority" className="sr-only">Task priority</label>
1144
- <select
1145
- id="followup-task-priority"
1146
- className="select"
1147
- value={taskPriority}
1148
- onChange={(e) => setTaskPriority(e.target.value)}
1149
- aria-label="Task priority"
1150
- >
1151
- <option value="low">Low</option>
1152
- <option value="normal">Normal</option>
1153
- <option value="high">High</option>
1154
- </select>
1155
- <Button
1156
- variant="primary"
1157
- size="sm"
1158
- disabled={!taskTitle.trim() || creatingTask}
1159
- onClick={onCreateTaskFromNode}
1160
- >
1161
- <Plus size={12} /> Add task
1162
- </Button>
1163
- </div>
1164
- </div>
1165
- )}
1166
-
1167
- <div className="tl-detail-comments">
1168
- <div className="field-label">
1169
- <MessageSquare size={12} /> Comments &amp; activity
1170
- </div>
1171
- <ul className="comment-list">
1172
- {comments.length === 0 && <li className="muted">No comments yet.</li>}
1173
- {comments.map((c, i) => (
1174
- <li key={`c-${i}`} className="comment-item">
1175
- <div className="comment-head">
1176
- <strong>{c.author || 'system'}</strong>
1177
- <span className="muted">
1178
- {c.kind} · {new Date(c.ts).toLocaleString()}
1179
- </span>
1180
- </div>
1181
- {c.text && <div className="comment-text">{c.text}</div>}
1182
- {c.taskId && (
1183
- <div className="muted">
1184
- → task <code>{String(c.taskId)}</code>
1185
- </div>
1186
- )}
1187
- </li>
1188
- ))}
1189
- </ul>
1190
- <div className="comment-input-row">
1191
- <label htmlFor="comment-input" className="sr-only">Add a comment</label>
1192
- <input
1193
- id="comment-input"
1194
- className="input"
1195
- placeholder="Add a comment…"
1196
- value={commentText}
1197
- onChange={(e) => setCommentText(e.target.value)}
1198
- onKeyDown={(e) => {
1199
- if (e.key === 'Enter' && !e.shiftKey) onAddComment();
1200
- }}
1201
- aria-label="Add a comment"
1202
- />
1203
- <Button
1204
- variant="secondary"
1205
- size="sm"
1206
- disabled={!commentText.trim() || postingComment}
1207
- onClick={onAddComment}
1208
- >
1209
- <Send size={12} /> Post
1210
- </Button>
1211
- </div>
1212
- </div>
1213
- </Card>
1214
- </aside>
1215
- )}
1216
- </div>
1217
- </div>
1218
- )}
1219
- </div>
1220
- );
1221
- }