moi-computer 0.0.2 → 0.1.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 (246) hide show
  1. package/bin/moi.mjs +3 -1
  2. package/bunfig.toml +4 -0
  3. package/client/api/workspaces.ts +277 -6
  4. package/client/assets/mcp/agentation.png +0 -0
  5. package/client/assets/mcp/airtable.png +0 -0
  6. package/client/assets/mcp/apollo.png +0 -0
  7. package/client/assets/mcp/asana.png +0 -0
  8. package/client/assets/mcp/box.png +0 -0
  9. package/client/assets/mcp/chrome.svg +33 -0
  10. package/client/assets/mcp/clickup.png +0 -0
  11. package/client/assets/mcp/cloudflare.png +0 -0
  12. package/client/assets/mcp/context7.png +0 -0
  13. package/client/assets/mcp/datadog.png +0 -0
  14. package/client/assets/mcp/dropbox.png +0 -0
  15. package/client/assets/mcp/elevenlabs.png +0 -0
  16. package/client/assets/mcp/exa.png +0 -0
  17. package/client/assets/mcp/firecrawl.png +0 -0
  18. package/client/assets/mcp/gmail.png +0 -0
  19. package/client/assets/mcp/googlecalendar.png +0 -0
  20. package/client/assets/mcp/googledrive.png +0 -0
  21. package/client/assets/mcp/grafana.png +0 -0
  22. package/client/assets/mcp/huggingface.png +0 -0
  23. package/client/assets/mcp/intercom.png +0 -0
  24. package/client/assets/mcp/monday.png +0 -0
  25. package/client/assets/mcp/mongodb.png +0 -0
  26. package/client/assets/mcp/paper.png +0 -0
  27. package/client/assets/mcp/paypal.png +0 -0
  28. package/client/assets/mcp/perplexity.png +0 -0
  29. package/client/assets/mcp/postgresql.png +0 -0
  30. package/client/assets/mcp/posthog.png +0 -0
  31. package/client/assets/mcp/puppeteer.png +0 -0
  32. package/client/assets/mcp/railway.png +0 -0
  33. package/client/assets/mcp/redis.png +0 -0
  34. package/client/assets/mcp/salesforce.png +0 -0
  35. package/client/assets/mcp/shopify.png +0 -0
  36. package/client/assets/mcp/snowflake.png +0 -0
  37. package/client/assets/mcp/telegram.png +0 -0
  38. package/client/assets/mcp/twilio.png +0 -0
  39. package/client/assets/mcp/zapier.png +0 -0
  40. package/client/components/App.tsx +7 -1
  41. package/client/components/BottomPanel.tsx +2 -2
  42. package/client/components/ChatInput.tsx +195 -14
  43. package/client/components/ChatPanel.tsx +118 -49
  44. package/client/components/ChatPopup.tsx +2 -2
  45. package/client/components/CustomizePanel.tsx +8 -8
  46. package/client/components/HiddenPanel.tsx +1 -1
  47. package/client/components/HomePage.tsx +1 -1
  48. package/client/components/IconMcp.tsx +21 -0
  49. package/client/components/MarkdownContent.tsx +2 -2
  50. package/client/components/McpMenu.tsx +125 -0
  51. package/client/components/ModelPicker.tsx +147 -0
  52. package/client/components/Scratchpad.tsx +775 -0
  53. package/client/components/ShimmerText.tsx +20 -0
  54. package/client/components/ThreadSelector.tsx +2 -2
  55. package/client/components/TurnView.tsx +114 -534
  56. package/client/components/WidgetErrorBoundary.tsx +2 -2
  57. package/client/components/WidgetFrame.tsx +1 -1
  58. package/client/components/WidgetShell.tsx +2 -2
  59. package/client/components/Widgets.tsx +2 -2
  60. package/client/components/WorkspacePreview.tsx +3 -3
  61. package/client/components/WorkspacesPage.tsx +28 -20
  62. package/client/components/layout/SidebarLayout.tsx +24 -15
  63. package/client/components/playground/PixelPainter.tsx +2 -2
  64. package/client/components/playground/PlaygroundPage.tsx +1 -1
  65. package/client/components/playground/ToolCallsPage.tsx +81 -0
  66. package/client/components/routes/workspace/[id].tsx +534 -141
  67. package/client/components/routes/workspace/create.tsx +155 -0
  68. package/client/components/settings/IconPicker.tsx +590 -0
  69. package/client/components/settings/SettingsPages.tsx +307 -0
  70. package/client/components/settings/WorkspaceSettings.tsx +92 -0
  71. package/client/components/tool-group/CodeBlock.tsx +41 -0
  72. package/client/components/tool-group/Collapse.tsx +28 -0
  73. package/client/components/tool-group/ReadImagePreview.tsx +46 -0
  74. package/client/components/tool-group/SubagentCard.tsx +135 -0
  75. package/client/components/tool-group/TimelineRow.tsx +147 -0
  76. package/client/components/tool-group/ToolCallGroup.tsx +231 -0
  77. package/client/components/tool-group/ToolOutput.tsx +139 -0
  78. package/client/components/tool-group/detect.ts +93 -0
  79. package/client/components/tool-group/fixtures.ts +315 -0
  80. package/client/components/tool-group/format.ts +211 -0
  81. package/client/components/tool-group/index.ts +9 -0
  82. package/client/components/ui/button.tsx +4 -4
  83. package/client/components/ui/dialog.tsx +58 -0
  84. package/client/components/ui/dropdown-menu.tsx +9 -9
  85. package/client/components/ui/hover-card.tsx +44 -0
  86. package/client/components/ui/popover.tsx +1 -1
  87. package/client/components/ui/switch.tsx +23 -0
  88. package/client/components/ui/tooltip.tsx +54 -0
  89. package/client/externalize-react.ts +11 -5
  90. package/client/hooks/useApplet.ts +117 -0
  91. package/client/hooks/useChat.ts +162 -62
  92. package/client/hooks/useMeiEvents.ts +9 -2
  93. package/client/hooks/useStickToBottom.ts +86 -0
  94. package/client/hooks/useWorkspaceTheme.ts +8 -2
  95. package/client/index.css +49 -3
  96. package/client/index.html +22 -18
  97. package/client/index.tsx +29 -2
  98. package/client/lib/WorkspaceContext.tsx +5 -8
  99. package/client/lib/WorkspaceLayoutContext.tsx +30 -10
  100. package/client/lib/applet-cache.ts +54 -0
  101. package/client/lib/connection.ts +237 -0
  102. package/client/lib/flags.ts +10 -0
  103. package/client/lib/mcp-icons.ts +142 -10
  104. package/client/lib/preview-turn.ts +37 -0
  105. package/client/lib/render-icon.ts +173 -0
  106. package/client/lib/scratch-executor.ts +20 -0
  107. package/client/lib/uploads.ts +18 -0
  108. package/client/main.tsx +5 -0
  109. package/client/store/live.ts +282 -0
  110. package/client/structured-clone-shim.ts +14 -0
  111. package/client/theme.css +2 -2
  112. package/client/vendor/emojibase/en/data.json +1 -0
  113. package/client/vendor/emojibase/en/messages.json +1 -0
  114. package/client/vendor/react/development/_impl/react-dom-client.js +15871 -0
  115. package/client/vendor/react/development/_impl/react-dom.js +223 -0
  116. package/client/vendor/react/development/_impl/react-jsx-dev-runtime.js +256 -0
  117. package/client/vendor/react/development/_impl/react-jsx-runtime.js +260 -0
  118. package/client/vendor/react/development/_impl/react.js +863 -0
  119. package/client/vendor/react/development/react-dom-client.js +6 -0
  120. package/client/vendor/react/development/react-dom.js +17 -0
  121. package/client/vendor/react/development/react-jsx-dev-runtime.js +5 -0
  122. package/client/vendor/react/development/react-jsx-runtime.js +6 -0
  123. package/client/vendor/react/development/react.js +47 -0
  124. package/client/vendor/react/production/_impl/react-dom-client.js +10361 -0
  125. package/client/vendor/react/production/_impl/react-dom.js +184 -0
  126. package/client/vendor/react/production/_impl/react-jsx-dev-runtime.js +37 -0
  127. package/client/vendor/react/production/_impl/react-jsx-runtime.js +60 -0
  128. package/client/vendor/react/production/_impl/react.js +428 -0
  129. package/client/vendor/react/production/react-dom-client.js +6 -0
  130. package/client/vendor/react/production/react-dom.js +17 -0
  131. package/client/vendor/react/production/react-jsx-dev-runtime.js +5 -0
  132. package/client/vendor/react/production/react-jsx-runtime.js +6 -0
  133. package/client/vendor/react/production/react.js +47 -0
  134. package/dist/agentation-4s0nn45p.png +0 -0
  135. package/dist/airtable-hsa66v6q.png +0 -0
  136. package/dist/apollo-2ed5dy2d.png +0 -0
  137. package/dist/asana-tvgtwbx2.png +0 -0
  138. package/dist/atlassian-b3tq39hs.png +0 -0
  139. package/dist/box-w3n36t5g.png +0 -0
  140. package/dist/chrome-tspm94rw.svg +33 -0
  141. package/dist/chunk-kc6e9nd4.css +1 -0
  142. package/dist/chunk-yf3p7qg7.js +673 -0
  143. package/dist/claude-z2xnay0d.svg +3 -0
  144. package/dist/clickup-qqrqqvqb.png +0 -0
  145. package/dist/cloudflare-j9p931v6.png +0 -0
  146. package/dist/context7-8ht0xjfy.png +0 -0
  147. package/dist/datadog-70ne3yzt.png +0 -0
  148. package/dist/discord-vejhptwx.png +0 -0
  149. package/dist/dropbox-4m5s9mgr.png +0 -0
  150. package/dist/elevenlabs-2nzzej1t.png +0 -0
  151. package/dist/exa-qqj3vr0x.png +0 -0
  152. package/dist/favicon-nbmyjfjh.png +0 -0
  153. package/dist/figma-y9898rry.png +0 -0
  154. package/dist/firecrawl-w2t8nehx.png +0 -0
  155. package/dist/github-av5r5y3e.png +0 -0
  156. package/dist/gitlab-4pv5vm6b.png +0 -0
  157. package/dist/gmail-sg6a5v3x.png +0 -0
  158. package/dist/googlecalendar-nqhh2v7r.png +0 -0
  159. package/dist/googledrive-6s8xyab7.png +0 -0
  160. package/dist/grafana-1yfsnwr6.png +0 -0
  161. package/dist/granola-7j3b0nk2.png +0 -0
  162. package/dist/hermes-nous-pznd63x9.png +0 -0
  163. package/dist/hubspot-hghcmc2t.png +0 -0
  164. package/dist/huggingface-kxzaxj83.png +0 -0
  165. package/dist/index.html +47 -0
  166. package/dist/intercom-td763jt8.png +0 -0
  167. package/dist/linear-v9s3az2d.png +0 -0
  168. package/dist/monday-jdbs4wwf.png +0 -0
  169. package/dist/mongodb-emzxvhd5.png +0 -0
  170. package/dist/neon-zj4qar44.png +0 -0
  171. package/dist/notion-w034c0b8.png +0 -0
  172. package/dist/openclaw-a2pyfhpn.svg +22 -0
  173. package/dist/paper-zbt34fab.png +0 -0
  174. package/dist/paypal-kwwf7xsc.png +0 -0
  175. package/dist/perplexity-4y63rxvj.png +0 -0
  176. package/dist/postgresql-qsspbsr1.png +0 -0
  177. package/dist/posthog-sphppc4w.png +0 -0
  178. package/dist/puppeteer-2xjt1a9b.png +0 -0
  179. package/dist/railway-834de8d2.png +0 -0
  180. package/dist/redis-spm6w2m1.png +0 -0
  181. package/dist/salesforce-1mk56v4z.png +0 -0
  182. package/dist/sentry-hdwpmvek.png +0 -0
  183. package/dist/shopify-90dadaav.png +0 -0
  184. package/dist/slack-1c1wj62s.png +0 -0
  185. package/dist/snowflake-hfpykpgy.png +0 -0
  186. package/dist/stripe-zrfaqbj3.png +0 -0
  187. package/dist/supabase-4vg33zf2.png +0 -0
  188. package/dist/telegram-v6tjyrs7.png +0 -0
  189. package/dist/twilio-dpyjdwpj.png +0 -0
  190. package/dist/vercel-7d0ssw28.png +0 -0
  191. package/dist/zapier-p67qfch0.png +0 -0
  192. package/lib/attachment-note.ts +48 -0
  193. package/lib/claude-adapter.ts +219 -29
  194. package/lib/format.ts +32 -0
  195. package/lib/types.ts +314 -6
  196. package/package.json +21 -31
  197. package/server/CLAUDE.md +3 -0
  198. package/server/agent.ts +25 -118
  199. package/server/api.ts +593 -0
  200. package/server/applets.ts +396 -0
  201. package/server/build-applet.ts +580 -0
  202. package/server/cc-session.ts +611 -0
  203. package/server/cli-colors.ts +17 -0
  204. package/server/cli-ui.ts +52 -0
  205. package/server/cli.ts +970 -72
  206. package/server/control.ts +166 -19
  207. package/server/debug.ts +10 -0
  208. package/server/events.ts +24 -0
  209. package/server/functions-worker.ts +18 -2
  210. package/server/functions.ts +59 -12
  211. package/server/icon.ts +13 -0
  212. package/server/layout.ts +25 -3
  213. package/server/mcp.ts +125 -0
  214. package/server/moi-scaffold.ts +85 -0
  215. package/server/openclaw-session.ts +41 -10
  216. package/server/openclaw.ts +22 -0
  217. package/server/preview.ts +70 -0
  218. package/server/registry.ts +32 -2
  219. package/server/scratchpad-executor.ts +380 -0
  220. package/server/scratchpad-relay.ts +45 -0
  221. package/server/scratchpad.ts +171 -0
  222. package/server/skill-version.ts +146 -0
  223. package/server/skills-template.ts +6 -1
  224. package/server/state.ts +22 -36
  225. package/server/static.ts +23 -0
  226. package/server/status.ts +94 -0
  227. package/server/thread-config.ts +125 -0
  228. package/server/uploads.ts +0 -0
  229. package/server/vendor.ts +63 -0
  230. package/server/views.ts +0 -0
  231. package/server/web.ts +113 -223
  232. package/server/widgets.ts +52 -142
  233. package/server/workspace-config.ts +37 -0
  234. package/server/workspace-env.ts +407 -0
  235. package/server/workspace-init.ts +66 -0
  236. package/workspace/.claude/skills/moi-workspace/DESIGN.md +109 -0
  237. package/workspace/.claude/skills/moi-workspace/SCRATCHPAD.md +57 -0
  238. package/workspace/.claude/skills/moi-workspace/SKILL.md +252 -0
  239. package/workspace/.claude/skills/moi-workspace/VIEW-DESIGN.md +22 -0
  240. package/client/hooks/useWidget.ts +0 -72
  241. package/client/hooks/useWidgetList.ts +0 -30
  242. package/client/lib/ws.ts +0 -129
  243. package/client/store/chat.tsx +0 -162
  244. package/server/build-widget.ts +0 -343
  245. package/workspace/.claude/skills/widgets/DESIGN.md +0 -630
  246. package/workspace/.claude/skills/widgets/SKILL.md +0 -176
@@ -31,11 +31,11 @@ export class WidgetErrorBoundary extends Component<Props, State> {
31
31
  if (this.state.error) {
32
32
  return (
33
33
  <div className="flex h-full w-full flex-col items-start justify-start gap-1.5 p-4 text-xs">
34
- <div className="text-destructive flex items-center gap-1.5 font-semibold">
34
+ <div className="flex items-center gap-1.5 font-semibold text-destructive">
35
35
  <IconAlertTriangle size={14} stroke={1.5} />
36
36
  Widget crashed
37
37
  </div>
38
- <div className="text-muted-foreground break-words font-mono">
38
+ <div className="font-mono break-words text-muted-foreground">
39
39
  {this.state.error.message}
40
40
  </div>
41
41
  </div>
@@ -50,7 +50,7 @@ export function WidgetFrame({ editing, hidden, onRemove, children }: WidgetFrame
50
50
  </div>
51
51
 
52
52
  {editing && onRemove && (
53
- <div className="absolute -right-2 -top-2 opacity-0 transition-opacity group-hover/widget:opacity-100">
53
+ <div className="absolute -top-2 -right-2 opacity-0 transition-opacity group-hover/widget:opacity-100">
54
54
  <Button
55
55
  size="icon-sm"
56
56
  variant="outline"
@@ -1,6 +1,6 @@
1
1
  import { AnimatePresence, motion } from 'motion/react'
2
2
 
3
- import { useWidget } from '@/client/hooks/useWidget'
3
+ import { useWidget } from '@/client/hooks/useApplet'
4
4
 
5
5
  import { WidgetErrorBoundary } from './WidgetErrorBoundary'
6
6
 
@@ -30,7 +30,7 @@ export function WidgetShell({ name }: WidgetShellProps) {
30
30
  {widget.status === 'error' && (
31
31
  <motion.p
32
32
  key={`err-${widget.version}`}
33
- className="text-destructive absolute inset-0 p-4 text-xs"
33
+ className="absolute inset-0 p-4 text-xs text-destructive"
34
34
  initial={{ opacity: 0 }}
35
35
  animate={{ opacity: 1 }}
36
36
  exit={{ opacity: 0 }}
@@ -78,7 +78,7 @@ export function Widgets({ mode, widgets }: WidgetsProps) {
78
78
  if (widgets.length === 0) {
79
79
  return (
80
80
  <div className="flex min-h-0 flex-1 items-center justify-center">
81
- <p className="text-muted-foreground text-sm">No widgets found</p>
81
+ <p className="text-sm text-muted-foreground">No widgets found</p>
82
82
  </div>
83
83
  )
84
84
  }
@@ -90,7 +90,7 @@ export function Widgets({ mode, widgets }: WidgetsProps) {
90
90
  // to its natural height.
91
91
  <div className="relative min-h-0 flex-1">
92
92
  <LayoutGroup>
93
- <div className="h-full overflow-y-auto px-[var(--page-pad)] pb-[calc(var(--page-pad)*2)] pt-[var(--page-pad)]">
93
+ <div className="h-full overflow-y-auto px-[var(--page-pad)] pt-[var(--page-pad)] pb-[calc(var(--page-pad)*2)]">
94
94
  {/* Bottom reservation = 2× page-pad (the pb above) + the open panel's
95
95
  height (this margin), so the last cards scroll clear of it. */}
96
96
  <motion.div
@@ -16,12 +16,12 @@ export function WorkspacePreview({ workspaceId }: WorkspacePreviewProps) {
16
16
  const isEmpty = query.data !== undefined && !hasItems
17
17
 
18
18
  return (
19
- <div className="bg-muted flex size-24 shrink-0 items-center justify-center rounded-lg p-2">
19
+ <div className="flex size-24 shrink-0 items-center justify-center rounded-lg bg-muted p-2">
20
20
  {hasItems && (
21
21
  <svg
22
22
  viewBox={`0 0 ${cols} ${rows}`}
23
23
  preserveAspectRatio="none"
24
- className="animate-in fade-in size-full duration-300"
24
+ className="size-full animate-in duration-300 fade-in"
25
25
  >
26
26
  {items.map((item, i) => (
27
27
  <rect
@@ -40,7 +40,7 @@ export function WorkspacePreview({ workspaceId }: WorkspacePreviewProps) {
40
40
  <IconRobotFace
41
41
  size={20}
42
42
  stroke={1.5}
43
- className="text-muted-foreground/40 animate-in fade-in duration-300"
43
+ className="animate-in text-muted-foreground/40 duration-300 fade-in"
44
44
  />
45
45
  )}
46
46
  </div>
@@ -21,19 +21,24 @@ import type { DiscoveredWorkspace, WorkspaceEntry, WorkspaceType } from '@/lib/t
21
21
 
22
22
  import { WorkspacePreview } from './WorkspacePreview'
23
23
 
24
- const typeIconSrc: Record<WorkspaceType, string> = {
24
+ export const typeIconSrc: Record<WorkspaceType, string> = {
25
25
  'claude-code': claudeIcon,
26
26
  openclaw: openclawIcon,
27
27
  hermes: hermesIcon
28
28
  }
29
29
 
30
- const typeLabel: Record<WorkspaceType, string> = {
30
+ export const typeLabel: Record<WorkspaceType, string> = {
31
31
  'claude-code': 'Claude Code',
32
32
  openclaw: 'OpenClaw',
33
33
  hermes: 'Hermes'
34
34
  }
35
35
 
36
- function TypeIcon({ type, className }: { type: WorkspaceType; className?: string }) {
36
+ type TypeIconProps = {
37
+ type: WorkspaceType
38
+ className?: string
39
+ }
40
+
41
+ export function TypeIcon({ type, className }: TypeIconProps) {
37
42
  return (
38
43
  <img
39
44
  src={typeIconSrc[type]}
@@ -53,7 +58,7 @@ export function WorkspacesPage() {
53
58
  if (workspacesQuery.isPending || discoveredQuery.isPending) {
54
59
  return (
55
60
  <div className="flex min-h-[50vh] items-center justify-center">
56
- <IconLoader2 size={20} stroke={1.5} className="text-muted-foreground animate-spin" />
61
+ <IconLoader2 size={20} stroke={1.5} className="animate-spin text-muted-foreground" />
57
62
  </div>
58
63
  )
59
64
  }
@@ -61,7 +66,7 @@ export function WorkspacesPage() {
61
66
  if (workspacesQuery.isError || discoveredQuery.isError) {
62
67
  return (
63
68
  <div className="flex min-h-[50vh] items-center justify-center">
64
- <p className="text-muted-foreground text-sm">Could not load workspaces.</p>
69
+ <p className="text-sm text-muted-foreground">Could not load workspaces.</p>
65
70
  </div>
66
71
  )
67
72
  }
@@ -73,7 +78,7 @@ export function WorkspacesPage() {
73
78
  importMutation.isPending && importMutation.variables ? importMutation.variables.path : null
74
79
 
75
80
  return (
76
- <div className="mx-auto w-full max-w-3xl px-8 pb-16 pt-14">
81
+ <div className="mx-auto w-full max-w-3xl px-8 pt-14 pb-16">
77
82
  {count > 0 && (
78
83
  <div className="mb-10 grid grid-cols-2 gap-3">
79
84
  {workspaces.map(ws => (
@@ -87,9 +92,9 @@ export function WorkspacesPage() {
87
92
  )}
88
93
 
89
94
  {count === 0 && discovered.length === 0 && (
90
- <p className="text-muted-foreground mb-10 text-sm">
95
+ <p className="mb-10 text-sm text-muted-foreground">
91
96
  No workspaces yet. Run{' '}
92
- <code className="bg-muted rounded px-1 py-0.5 font-mono text-xs">moi start</code> in a
97
+ <code className="rounded bg-muted px-1 py-0.5 font-mono text-xs">moi init</code> in a
93
98
  project directory.
94
99
  </p>
95
100
  )}
@@ -97,10 +102,10 @@ export function WorkspacesPage() {
97
102
  {discovered.length > 0 && (
98
103
  <section>
99
104
  <div className="mb-4">
100
- <h2 className="text-foreground mb-1.5 text-sm font-semibold">Found on your machine</h2>
101
- <p className="text-muted-foreground text-xs">Discovered via Claude Code and OpenClaw</p>
105
+ <h2 className="mb-1.5 text-sm font-semibold text-foreground">Found on your machine</h2>
106
+ <p className="text-xs text-muted-foreground">Discovered via Claude Code and OpenClaw</p>
102
107
  </div>
103
- <ul className="border-border border-t">
108
+ <ul className="border-t border-border">
104
109
  {discovered.map(item => (
105
110
  <SuggestedRow
106
111
  key={item.path}
@@ -110,6 +115,9 @@ export function WorkspacesPage() {
110
115
  />
111
116
  ))}
112
117
  </ul>
118
+ {importMutation.isError && (
119
+ <p className="mt-3 text-xs text-destructive">{importMutation.error.message}</p>
120
+ )}
113
121
  </section>
114
122
  )}
115
123
  </div>
@@ -134,16 +142,16 @@ function WorkspaceCard({ workspace, onRemove }: WorkspaceCardProps) {
134
142
  <a
135
143
  href={`/workspace/${workspace.id}`}
136
144
  className={cn(
137
- 'border-border bg-card hover:bg-muted/40 group flex gap-3.5 rounded-xl border p-2',
145
+ 'group flex gap-3.5 rounded-xl border border-border bg-card p-2 hover:bg-muted/40',
138
146
  'transition-colors'
139
147
  )}
140
148
  >
141
149
  <WorkspacePreview workspaceId={workspace.id} />
142
- <div className="flex min-w-0 flex-1 flex-col gap-1.5 py-1 pl-1 pr-2">
150
+ <div className="flex min-w-0 flex-1 flex-col gap-1.5 py-1 pr-2 pl-1">
143
151
  <div className="flex items-start justify-between gap-2">
144
152
  <div className="flex min-w-0 items-center gap-2">
145
153
  <TypeIcon type={workspace.type ?? 'claude-code'} />
146
- <span className="text-foreground truncate text-sm font-semibold">{name}</span>
154
+ <span className="truncate text-sm font-semibold text-foreground">{name}</span>
147
155
  </div>
148
156
  <DropdownMenu>
149
157
  <DropdownMenuTrigger
@@ -155,7 +163,7 @@ function WorkspaceCard({ workspace, onRemove }: WorkspaceCardProps) {
155
163
  e.preventDefault()
156
164
  e.stopPropagation()
157
165
  }}
158
- className="text-muted-foreground -mr-1 -mt-0.5"
166
+ className="-mt-0.5 -mr-1 text-muted-foreground"
159
167
  aria-label="More actions"
160
168
  >
161
169
  <IconDots stroke={1.5} />
@@ -177,11 +185,11 @@ function WorkspaceCard({ workspace, onRemove }: WorkspaceCardProps) {
177
185
  </DropdownMenuContent>
178
186
  </DropdownMenu>
179
187
  </div>
180
- <div title={workspace.path} className="text-muted-foreground truncate font-mono text-xs">
188
+ <div title={workspace.path} className="truncate font-mono text-xs text-muted-foreground">
181
189
  {workspace.displayPath ?? workspace.path}
182
190
  </div>
183
191
  <div className="flex-1" />
184
- <div className="text-muted-foreground text-xs">{meta}</div>
192
+ <div className="text-xs text-muted-foreground">{meta}</div>
185
193
  </div>
186
194
  </a>
187
195
  )
@@ -197,12 +205,12 @@ function SuggestedRow({ suggestion, onAdd, loading }: SuggestedRowProps) {
197
205
  const { path, type } = suggestion
198
206
  const name = displayName(suggestion)
199
207
  return (
200
- <li className="border-border flex items-center gap-3 border-b px-1 py-2.5">
208
+ <li className="flex items-center gap-3 border-b border-border px-1 py-2.5">
201
209
  <TypeIcon type={type} className="opacity-70" />
202
- <span className="text-foreground/80 shrink-0 text-sm font-medium">{name}</span>
210
+ <span className="shrink-0 text-sm font-medium text-foreground/80">{name}</span>
203
211
  <span
204
212
  title={path}
205
- className="text-muted-foreground min-w-0 flex-1 truncate font-mono text-xs"
213
+ className="min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground"
206
214
  >
207
215
  {suggestion.displayPath ?? path}
208
216
  </span>
@@ -3,16 +3,18 @@ import { type ReactNode, useEffect, useState } from 'react'
3
3
  import { AnimatePresence, motion } from 'motion/react'
4
4
 
5
5
  import {
6
- IconHome,
6
+ IconHome2,
7
7
  IconLayoutSidebar,
8
8
  IconLayoutSidebarLeftCollapse,
9
9
  IconLayoutSidebarLeftExpand,
10
10
  IconPlus,
11
11
  IconSettings
12
12
  } from '@tabler/icons-react'
13
+ import { useQueryClient } from '@tanstack/react-query'
13
14
  import { Link } from 'wouter'
14
15
 
15
- import { useWorkspaces } from '@/client/api/workspaces'
16
+ import { useWorkspaces, workspaceKeys } from '@/client/api/workspaces'
17
+ import { useMeiEvent } from '@/client/hooks/useMeiEvents'
16
18
  import claudeIcon from '@/client/assets/claude.svg'
17
19
  import hermesIcon from '@/client/assets/hermes-nous.png'
18
20
  import openclawIcon from '@/client/assets/openclaw.svg'
@@ -21,7 +23,7 @@ import { cn } from '@/client/lib/cn'
21
23
  import { useUiStore } from '@/client/store/ui'
22
24
  import type { WorkspaceEntry, WorkspaceType } from '@/lib/types'
23
25
 
24
- const PROVIDER_ICON: Record<WorkspaceType, string> = {
26
+ export const PROVIDER_ICON: Record<WorkspaceType, string> = {
25
27
  'claude-code': claudeIcon,
26
28
  openclaw: openclawIcon,
27
29
  hermes: hermesIcon
@@ -53,6 +55,13 @@ export function SidebarLayout({ children }: SidebarLayoutProps) {
53
55
  // passed down ready, so they don't re-subscribe/refetch or flicker on collapse.
54
56
  const { data: workspaces } = useWorkspaces()
55
57
 
58
+ // `moi config` / the settings modal broadcast `workspace:updated`; refetch the
59
+ // list so the sidebar reflects new names/icons live.
60
+ const qc = useQueryClient()
61
+ useMeiEvent(e => {
62
+ if (e.type === 'workspace:updated') qc.invalidateQueries({ queryKey: workspaceKeys.all })
63
+ })
64
+
56
65
  // Boot-up: on mount the logo runs the noise effect for 0.75s, then settles to
57
66
  // the sprite. Kept here (not in the remounting Sidebar) so it fires once.
58
67
  const [booting, setBooting] = useState(true)
@@ -96,7 +105,7 @@ export function SidebarLayout({ children }: SidebarLayoutProps) {
96
105
  </motion.div>
97
106
  </AnimatePresence>
98
107
  </motion.div>
99
- <main className="bg-background flex min-w-0 flex-1 flex-col overflow-hidden rounded-l-md border-l border-gray-200 shadow-[1px_0px_3px_0px_rgba(0,0,0,0.1)]">
108
+ <main className="flex min-w-0 flex-1 flex-col overflow-hidden rounded-l-md border-l border-gray-200 bg-background shadow-[1px_0px_3px_0px_rgba(0,0,0,0.1)]">
100
109
  {children}
101
110
  </main>
102
111
  </div>
@@ -111,7 +120,7 @@ type PanelHeaderProps = {
111
120
 
112
121
  export function PanelHeader({ children }: PanelHeaderProps) {
113
122
  return (
114
- <header className="border-border flex h-12 shrink-0 items-center gap-2.5 border-b px-3">
123
+ <header className="@container flex h-11 shrink-0 items-center gap-2.5 border-b border-border/75 px-3">
115
124
  {children}
116
125
  </header>
117
126
  )
@@ -131,7 +140,7 @@ export function SidebarToggle() {
131
140
  title={collapsed ? 'Expand sidebar' : 'Collapse sidebar'}
132
141
  onClick={toggle}
133
142
  className={cn(
134
- 'text-muted-foreground hover:bg-muted hover:text-foreground flex size-7 items-center justify-center rounded-sm',
143
+ 'flex size-7 items-center justify-center rounded-sm text-muted-foreground hover:bg-muted hover:text-foreground',
135
144
  collapsed ? 'cursor-e-resize' : 'cursor-w-resize'
136
145
  )}
137
146
  >
@@ -152,7 +161,7 @@ function Sidebar({ collapsed, workspaces, logoEffect }: SidebarProps) {
152
161
  return (
153
162
  <aside className={cn('flex h-full shrink-0 flex-col px-2.5', collapsed ? 'w-[54px]' : 'w-60')}>
154
163
  {/* Logo */}
155
- <div className="mb-3.5 flex h-12 items-center px-2">
164
+ <div className="mb-3.5 flex h-11 items-center px-2">
156
165
  <LedLogo
157
166
  pixelSize={3}
158
167
  gap={0.5}
@@ -165,7 +174,7 @@ function Sidebar({ collapsed, workspaces, logoEffect }: SidebarProps) {
165
174
  <nav className="flex flex-col gap-0.5">
166
175
  <NavRow
167
176
  href="/"
168
- icon={<IconHome size={18} className="text-foreground shrink-0" />}
177
+ icon={<IconHome2 size={18} className="shrink-0 text-foreground" />}
169
178
  label="Home"
170
179
  collapsed={collapsed}
171
180
  />
@@ -174,11 +183,11 @@ function Sidebar({ collapsed, workspaces, logoEffect }: SidebarProps) {
174
183
  {/* Workspaces */}
175
184
  <div className="mt-5 flex flex-col gap-2">
176
185
  <div className={cn('flex items-center justify-between pl-2', collapsed && 'invisible')}>
177
- <span className="text-muted-foreground text-[13px] font-medium">Workspaces</span>
186
+ <span className="text-[13px] font-medium text-muted-foreground">Workspaces</span>
178
187
  <Link
179
- href="/"
188
+ href="/workspace/create"
180
189
  aria-label="Add workspace"
181
- className="border-border bg-background text-foreground/60 hover:bg-muted hover:text-foreground flex size-6 items-center justify-center rounded-[6px] border"
190
+ className="flex size-6 items-center justify-center rounded-[6px] border border-border bg-background text-foreground/60 hover:bg-muted hover:text-foreground"
182
191
  >
183
192
  <IconPlus size={16} />
184
193
  </Link>
@@ -191,9 +200,9 @@ function Sidebar({ collapsed, workspaces, logoEffect }: SidebarProps) {
191
200
  href={`/workspace/${ws.id}`}
192
201
  icon={
193
202
  <img
194
- src={PROVIDER_ICON[ws.type ?? 'claude-code']}
203
+ src={ws.icon ?? PROVIDER_ICON[ws.type ?? 'claude-code']}
195
204
  alt=""
196
- className="size-[18px] shrink-0"
205
+ className="size-5 shrink-0 rounded-[4px]"
197
206
  />
198
207
  }
199
208
  label={workspaceLabel(ws)}
@@ -210,7 +219,7 @@ function Sidebar({ collapsed, workspaces, logoEffect }: SidebarProps) {
210
219
  <button
211
220
  type="button"
212
221
  className={cn(
213
- 'hover:bg-foreground/[0.05] hover:text-foreground text-foreground flex h-8 items-center gap-2 rounded-sm pl-1.5 text-sm',
222
+ 'flex h-8 items-center gap-2 rounded-sm pl-1.5 text-sm text-foreground hover:bg-foreground/[0.05] hover:text-foreground',
214
223
  collapsed ? 'pr-1.5' : 'pr-2.5'
215
224
  )}
216
225
  >
@@ -221,7 +230,7 @@ function Sidebar({ collapsed, workspaces, logoEffect }: SidebarProps) {
221
230
  <button
222
231
  type="button"
223
232
  aria-label="Toggle sidebar"
224
- className="text-foreground/45 hover:bg-foreground/[0.06] hover:text-foreground/80 hidden size-7 items-center justify-center rounded-[6px]"
233
+ className="hidden size-7 items-center justify-center rounded-[6px] text-foreground/45 hover:bg-foreground/[0.06] hover:text-foreground/80"
225
234
  >
226
235
  <IconLayoutSidebar size={16} />
227
236
  </button>
@@ -60,7 +60,7 @@ export function PixelPainter() {
60
60
 
61
61
  return (
62
62
  <div className="flex flex-col items-center gap-4">
63
- <div className="grid w-fit select-none grid-cols-[repeat(5,28px)] gap-px bg-black/15 p-px">
63
+ <div className="grid w-fit grid-cols-[repeat(5,28px)] gap-px bg-black/15 p-px select-none">
64
64
  {grid.map((row, r) =>
65
65
  row.map((on, c) => (
66
66
  <div
@@ -73,7 +73,7 @@ export function PixelPainter() {
73
73
  )}
74
74
  </div>
75
75
 
76
- <pre className="border-border rounded-md border bg-white px-3 py-2 text-center font-mono text-sm leading-snug text-neutral-900">
76
+ <pre className="rounded-md border border-border bg-white px-3 py-2 text-center font-mono text-sm leading-snug text-neutral-900">
77
77
  {ascii}
78
78
  </pre>
79
79
 
@@ -49,7 +49,7 @@ export function PlaygroundPage() {
49
49
 
50
50
  return (
51
51
  <div className="relative flex min-h-dvh flex-col items-center justify-center gap-8 bg-[#f2f1ee]">
52
- <span className="absolute left-5 top-5 text-[11px] font-medium uppercase tracking-widest text-black/30">
52
+ <span className="absolute top-5 left-5 text-[11px] font-medium tracking-widest text-black/30 uppercase">
53
53
  Playground
54
54
  </span>
55
55
 
@@ -0,0 +1,81 @@
1
+ import { useState } from 'react'
2
+
3
+ import { cn } from '@/client/lib/cn'
4
+ import {
5
+ FIXTURE_CWD,
6
+ liveToolCalls,
7
+ multipleToolCalls,
8
+ singleToolCall,
9
+ subagentDoneTrace,
10
+ subagentTrace,
11
+ ToolCallGroup
12
+ } from '@/client/components/tool-group'
13
+
14
+ const VARIANTS = [
15
+ { value: 'single', label: 'Single' },
16
+ { value: 'multiple', label: 'Multiple' },
17
+ { value: 'live', label: 'Live' },
18
+ { value: 'subagent', label: 'Subagent' },
19
+ { value: 'subagent-done', label: 'Subagent done' }
20
+ ] as const
21
+
22
+ type Variant = (typeof VARIANTS)[number]['value']
23
+
24
+ type SegmentedProps = {
25
+ value: Variant
26
+ onChange: (value: Variant) => void
27
+ }
28
+
29
+ function Segmented({ value, onChange }: SegmentedProps) {
30
+ return (
31
+ <div className="flex gap-1 rounded-lg bg-black/[0.04] p-1">
32
+ {VARIANTS.map(o => (
33
+ <button
34
+ key={o.value}
35
+ type="button"
36
+ onClick={() => onChange(o.value)}
37
+ className={cn(
38
+ 'rounded-md px-3 py-1 text-xs transition-colors',
39
+ value === o.value ? 'bg-neutral-900 text-white' : 'text-black/50 hover:text-black/80'
40
+ )}
41
+ >
42
+ {o.label}
43
+ </button>
44
+ ))}
45
+ </div>
46
+ )
47
+ }
48
+
49
+ // Scratch route for iterating on <ToolCallGroup> in isolation. Renders the
50
+ // group inside a chat-width card so it reads like the real transcript.
51
+ const FIXTURES: Record<Variant, typeof singleToolCall> = {
52
+ single: singleToolCall,
53
+ multiple: multipleToolCalls,
54
+ live: liveToolCalls,
55
+ subagent: subagentTrace,
56
+ 'subagent-done': subagentDoneTrace
57
+ }
58
+
59
+ export function ToolCallsPage() {
60
+ const [variant, setVariant] = useState<Variant>('multiple')
61
+
62
+ return (
63
+ <div className="flex min-h-dvh flex-col items-center gap-6 bg-[#f2f1ee] px-4 py-16">
64
+ <span className="text-[11px] font-medium tracking-widest text-black/30 uppercase">
65
+ Playground / Tool calls
66
+ </span>
67
+
68
+ <Segmented value={variant} onChange={setVariant} />
69
+
70
+ <div className="w-full max-w-[var(--column-w)] rounded-xl border border-border bg-background p-5 font-sans text-foreground shadow-sm">
71
+ {/* `processing` only matters for the live variant — it turns the trailing
72
+ reasoning into "Thinking" and shows the live running tool spinning. */}
73
+ <ToolCallGroup
74
+ parts={FIXTURES[variant]}
75
+ cwd={FIXTURE_CWD}
76
+ processing={variant === 'live'}
77
+ />
78
+ </div>
79
+ </div>
80
+ )
81
+ }