moi-computer 0.8.0 → 0.8.1-next.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 (100) hide show
  1. package/client/api/workspace-keys.ts +1 -2
  2. package/client/app/AppRouter.tsx +10 -3
  3. package/client/app/routes/HomeRoute.tsx +1 -1
  4. package/client/app/shell/SidebarLayout.tsx +2 -14
  5. package/client/components/shared/Composer.tsx +20 -7
  6. package/client/components/shared/PanelHeader.tsx +8 -1
  7. package/client/components/ui/button.tsx +3 -3
  8. package/client/components/ui/dialog.tsx +1 -1
  9. package/client/components/ui/dropdown-menu.tsx +2 -2
  10. package/client/components/ui/hover-card.tsx +1 -1
  11. package/client/components/ui/popover.tsx +1 -1
  12. package/client/components/ui/resizable.tsx +40 -0
  13. package/client/features/chat/ChatEmptyState.tsx +9 -11
  14. package/client/features/chat/ChatPanel.tsx +76 -48
  15. package/client/features/chat/ChatPopup.tsx +16 -2
  16. package/client/features/chat/ChatPromptBubbles.tsx +6 -8
  17. package/client/features/chat/ChatSelector.tsx +24 -7
  18. package/client/features/chat/ModelPicker.tsx +5 -4
  19. package/client/features/chat/TurnView.tsx +108 -13
  20. package/client/features/chat/api.ts +1 -18
  21. package/client/features/chat/chat-send.ts +2 -2
  22. package/client/features/chat/{ChatComposer.tsx → composer/ChatComposer.tsx} +6 -5
  23. package/client/features/chat/composer/banners/ChatErrorBanner.tsx +28 -0
  24. package/client/features/chat/composer/banners/ComposerBanner.tsx +30 -0
  25. package/client/features/chat/composer/banners/WorkspaceAgentAvailabilityBanner.tsx +91 -0
  26. package/client/features/{workspace → chat/composer/banners}/WorkspaceSkillUpdateBanner.tsx +9 -7
  27. package/client/features/chat/composer/useWorkspaceComposerState.tsx +74 -0
  28. package/client/features/{workspace → chat/composer}/useWorkspaceSkillUpdates.ts +1 -1
  29. package/client/features/chat/group-turns.ts +46 -28
  30. package/client/features/chat/interleave-notices.ts +84 -0
  31. package/client/features/chat/model-order.ts +9 -3
  32. package/client/features/chat/tool-group/TimelineRow.tsx +23 -11
  33. package/client/features/chat/tool-group/ToolCallGroup.tsx +38 -3
  34. package/client/features/chat/tool-group/format.ts +23 -7
  35. package/client/features/chat/useAppletChatMessage.ts +11 -16
  36. package/client/features/chat/useChat.ts +3 -7
  37. package/client/features/dev/ChatStatesPage.tsx +428 -0
  38. package/client/features/dev/DevIndexPage.tsx +52 -0
  39. package/client/features/dev/DevRoutes.tsx +6 -3
  40. package/client/features/dev/HarnessDebugPage.tsx +3 -3
  41. package/client/features/dev/chat-states-fixtures.ts +744 -0
  42. package/client/features/scratchpad/Scratchpad.tsx +4 -0
  43. package/client/features/scratchpad/scratch-session.ts +71 -0
  44. package/client/features/views/ViewBuilderTab.tsx +5 -4
  45. package/client/features/views/useViewBuilderActions.ts +2 -2
  46. package/client/features/workspace/WorkspaceLayoutContext.tsx +4 -2
  47. package/client/features/workspace/WorkspaceScreen.tsx +128 -146
  48. package/client/features/workspace/WorkspaceSplitLayout.tsx +111 -0
  49. package/client/features/workspace/api.ts +33 -8
  50. package/client/features/workspace/useFitsSplitLayout.ts +31 -5
  51. package/client/index.css +1 -1
  52. package/client/lib/flags.ts +4 -3
  53. package/client/runtime/useWorkspaceEvents.ts +18 -1
  54. package/client/store/ui.ts +5 -1
  55. package/dist/{chunk-0pcdwjkp.js → chunk-2vaafjp4.js} +1 -1
  56. package/dist/{chunk-9y2zbzqz.js → chunk-35fq49qa.js} +1 -1
  57. package/dist/chunk-gny990qx.css +1 -0
  58. package/dist/chunk-gt7n06ef.js +1 -0
  59. package/dist/{chunk-r5ce5cdg.js → chunk-kkj86722.js} +75 -75
  60. package/dist/chunk-n7pga5x3.js +80 -0
  61. package/dist/chunk-xeyxk7ep.js +10 -0
  62. package/dist/{chunk-h9h8f176.js → chunk-xzx7c9hq.js} +1 -1
  63. package/dist/index.html +1 -1
  64. package/lib/format.ts +17 -1
  65. package/lib/themes.ts +2 -2
  66. package/lib/types.ts +38 -8
  67. package/lib/workspace-layout.ts +2 -2
  68. package/package.json +2 -1
  69. package/server/agent.ts +199 -0
  70. package/server/api.ts +36 -17
  71. package/server/env-apply.ts +4 -0
  72. package/server/harness/README.md +28 -12
  73. package/server/harness/claude-code/auth.ts +54 -0
  74. package/server/harness/claude-code/index.ts +6 -1
  75. package/server/harness/codex/adapter.ts +9 -1
  76. package/server/harness/codex/auth.ts +50 -0
  77. package/server/harness/codex/index.ts +6 -1
  78. package/server/harness/codex/session.ts +33 -14
  79. package/server/harness/openclaw/NOTES.md +518 -187
  80. package/server/harness/openclaw/adapter.ts +125 -31
  81. package/server/harness/openclaw/compat.ts +99 -0
  82. package/server/harness/openclaw/cron-view.ts +78 -0
  83. package/server/harness/openclaw/discovery.ts +145 -52
  84. package/server/harness/openclaw/gateway.ts +224 -36
  85. package/server/harness/openclaw/index.ts +56 -21
  86. package/server/harness/openclaw/session.ts +971 -55
  87. package/server/harness/openclaw/strip.ts +87 -15
  88. package/server/harness/openclaw/thinking.ts +198 -0
  89. package/server/harness/types.ts +10 -5
  90. package/server/layout.ts +5 -2
  91. package/workspace/.claude/skills/moi-workspace/DESIGN.md +19 -9
  92. package/client/features/dev/PixelPainter.tsx +0 -94
  93. package/client/features/dev/PlaygroundPage.tsx +0 -69
  94. package/dist/chunk-0k7brsms.js +0 -9
  95. package/dist/chunk-dfs36zgc.js +0 -1
  96. package/dist/chunk-dtwxpxbg.js +0 -51
  97. package/dist/chunk-ga7t9qsk.js +0 -2
  98. package/dist/chunk-tey2nq7c.js +0 -31
  99. package/dist/chunk-z73xpsa0.js +0 -50
  100. package/dist/chunk-zzgredta.css +0 -1
@@ -0,0 +1,428 @@
1
+ // Designer-facing dev route: ONE continuous conversation rendered by the
2
+ // PRODUCTION chat components (TurnView, tool groups, subagent cards, notice
3
+ // rows, the preview-turn path, selector rows) over inline fixtures — no server
4
+ // data. The transcript runs through the exact ChatPanel pipeline (groupTurns →
5
+ // interleaveNotices → TurnView/ChatNoticeRow, plus the live tail), so a
6
+ // designer can restyle the chat by looking at this page and it stays truthful
7
+ // as components evolve. A fixed control switches the live tail state and the
8
+ // error banner; the sidebar holds jump links to each scripted state.
9
+ import { useEffect, useState } from 'react'
10
+
11
+ import { IconChevronDown, IconEdit } from '@tabler/icons-react'
12
+
13
+ import { Button } from '@/client/components/ui/button'
14
+ import {
15
+ DropdownMenu,
16
+ DropdownMenuContent,
17
+ DropdownMenuGroup,
18
+ DropdownMenuItem,
19
+ DropdownMenuLabel,
20
+ DropdownMenuSeparator,
21
+ DropdownMenuTrigger
22
+ } from '@/client/components/ui/dropdown-menu'
23
+ import { Switch } from '@/client/components/ui/switch'
24
+ import { ChatNoticeRow } from '@/client/features/chat/ChatPanel'
25
+ import { ChatErrorBanner } from '@/client/features/chat/composer/banners/ChatErrorBanner'
26
+ import { ChatSessionItem } from '@/client/features/chat/ChatSelector'
27
+ import { ThinkingIndicator, TurnView } from '@/client/features/chat/TurnView'
28
+ import { isSessionRunning, liveStore } from '@/client/features/chat/chat-store'
29
+ import { groupTurns } from '@/client/features/chat/group-turns'
30
+ import { interleaveNotices } from '@/client/features/chat/interleave-notices'
31
+ import { buildPreviewTurn } from '@/client/features/chat/preview-turn'
32
+ import {
33
+ WorkspaceLayoutContext,
34
+ type WorkspaceLayoutContextValue
35
+ } from '@/client/features/workspace/WorkspaceLayoutContext'
36
+ import { createDefaultWorkspaceLayout } from '@/lib/workspace-layout'
37
+ import type { SystemNotice, Turn } from '@/lib/types'
38
+
39
+ import {
40
+ DEV_CWD,
41
+ DEV_WORKSPACE_ID,
42
+ RUNNING_SELECTOR_SESSION_ID,
43
+ chatError,
44
+ conversationAnchors,
45
+ conversationNotices,
46
+ conversationTurns,
47
+ reasoningStreamPreview,
48
+ selectorSessions,
49
+ textStreamPreview,
50
+ toLivePreview
51
+ } from './chat-states-fixtures'
52
+
53
+ // Static stand-in for the query-backed workspace layout provider: TurnView
54
+ // reads `cwd` from this context to shorten tool paths.
55
+ const layoutCtxValue: WorkspaceLayoutContextValue = {
56
+ layout: createDefaultWorkspaceLayout(),
57
+ setLayout: () => {},
58
+ name: 'moi',
59
+ icon: null,
60
+ cwd: DEV_CWD,
61
+ provider: 'openclaw',
62
+ workspaceId: DEV_WORKSPACE_ID,
63
+ isLoading: false
64
+ }
65
+
66
+ // Map from timeline item id (turn or notice) → anchor slug, for the invisible
67
+ // jump targets woven between conversation items.
68
+ const ANCHOR_BY_ITEM_ID: Record<string, string> = Object.fromEntries(
69
+ conversationAnchors.map(a => [a.itemId, a.anchor])
70
+ )
71
+
72
+ type TailState = 'none' | 'dots' | 'thinking' | 'text'
73
+
74
+ const TAIL_OPTIONS: { value: TailState; label: string }[] = [
75
+ { value: 'none', label: 'None' },
76
+ { value: 'dots', label: 'Dots' },
77
+ { value: 'thinking', label: 'Thinking' },
78
+ { value: 'text', label: 'Text' }
79
+ ]
80
+
81
+ function tailPreviewTurn(tail: TailState): Turn | null {
82
+ if (tail === 'thinking') return buildPreviewTurn(toLivePreview(reasoningStreamPreview))
83
+ if (tail === 'text') return buildPreviewTurn(toLivePreview(textStreamPreview))
84
+ return null
85
+ }
86
+
87
+ type TranscriptProps = {
88
+ turns: Turn[]
89
+ notices?: SystemNotice[]
90
+ previewTurn?: Turn | null
91
+ processing?: boolean
92
+ // Timeline item id (turn/notice) → anchor element id injected before it.
93
+ anchors?: Record<string, string>
94
+ }
95
+
96
+ // Mirrors ChatPanel's timeline: append the preview turn, fold tool-only turns
97
+ // (groupTurns), weave notices in, then map to the real row components. The
98
+ // pulsing dots appear exactly when ChatPanel shows them — processing with no
99
+ // preview content yet. Anchors render as zero-size absolute spans so the
100
+ // gap-6 rhythm between items stays untouched.
101
+ function Transcript({
102
+ turns,
103
+ notices = [],
104
+ previewTurn = null,
105
+ processing = false,
106
+ anchors = {}
107
+ }: TranscriptProps) {
108
+ const grouped = groupTurns(previewTurn ? [...turns, previewTurn] : turns)
109
+ const timeline = interleaveNotices(grouped, notices)
110
+ const lastTurnId = grouped.length > 0 ? grouped[grouped.length - 1].id : null
111
+ return (
112
+ <div className="flex w-full flex-col gap-6">
113
+ {timeline.map(item => {
114
+ const id = item.kind === 'notice' ? item.notice.id : item.turn.id
115
+ const anchor = anchors[id]
116
+ return (
117
+ <div key={item.kind === 'notice' ? `notice:${id}` : id} className="relative">
118
+ {anchor && <span id={anchor} aria-hidden className="absolute -top-8" />}
119
+ {item.kind === 'notice' ? (
120
+ <ChatNoticeRow notice={item.notice} />
121
+ ) : (
122
+ <TurnView turn={item.turn} processing={processing && item.turn.id === lastTurnId} />
123
+ )}
124
+ </div>
125
+ )
126
+ })}
127
+ {processing && !previewTurn && <ThinkingIndicator />}
128
+ </div>
129
+ )
130
+ }
131
+
132
+ function noop() {}
133
+ async function asyncNoop() {}
134
+
135
+ // The real chat header strip: the session dropdown, closed by default, with
136
+ // the fixture rows (badges, running spinner) inside — same composition as
137
+ // ChatSelector's menu.
138
+ function SelectorHeader() {
139
+ return (
140
+ <header className="flex w-full items-center justify-between pr-2 pb-2 pl-2">
141
+ <DropdownMenu modal={false}>
142
+ <DropdownMenuTrigger
143
+ render={
144
+ <Button variant="ghost">
145
+ <span className="max-w-64 truncate">{selectorSessions[0].summary}</span>
146
+ <IconChevronDown stroke={1.5} />
147
+ </Button>
148
+ }
149
+ />
150
+ <DropdownMenuContent
151
+ align="start"
152
+ className="flex max-h-100 w-max max-w-72 min-w-40 flex-col overflow-hidden"
153
+ >
154
+ <DropdownMenuItem
155
+ className="shrink-0 gap-1 font-medium text-muted-foreground! **:text-muted-foreground!"
156
+ onClick={noop}
157
+ >
158
+ <IconEdit size={16} stroke={1.75} />
159
+ New chat
160
+ </DropdownMenuItem>
161
+ <DropdownMenuSeparator className="shrink-0" />
162
+ <DropdownMenuGroup>
163
+ <DropdownMenuLabel>Today</DropdownMenuLabel>
164
+ {selectorSessions.map(session => (
165
+ <ChatSessionItem
166
+ key={session.sessionId}
167
+ session={session}
168
+ active={session.sessionId === selectorSessions[0].sessionId}
169
+ // The archive affordance replaces the running spinner on
170
+ // hover/touch, so the running row keeps archiving off to show
171
+ // the pure spinner treatment.
172
+ canArchive={session.sessionId !== RUNNING_SELECTOR_SESSION_ID}
173
+ confirmingArchive={false}
174
+ onSelect={noop}
175
+ onArchive={asyncNoop}
176
+ onRequestArchive={noop}
177
+ workspaceId={DEV_WORKSPACE_ID}
178
+ />
179
+ ))}
180
+ </DropdownMenuGroup>
181
+ </DropdownMenuContent>
182
+ </DropdownMenu>
183
+ </header>
184
+ )
185
+ }
186
+
187
+ type TailControlsProps = {
188
+ tail: TailState
189
+ onTail: (tail: TailState) => void
190
+ showError: boolean
191
+ onShowError: (show: boolean) => void
192
+ }
193
+
194
+ // Fixed dev control for the conversation's live tail and the error banner.
195
+ // Sits at the end of the page DOM, so it paints above the content without
196
+ // z-index.
197
+ function TailControls({ tail, onTail, showError, onShowError }: TailControlsProps) {
198
+ return (
199
+ <div className="fixed right-4 bottom-20 flex flex-col gap-2 rounded-xl bg-popover p-2 text-popover-foreground shadow-md ring-1 ring-border">
200
+ <span className="px-1 text-xs text-muted-foreground">Live tail</span>
201
+ <div className="flex gap-1 rounded-lg bg-accent p-1">
202
+ {TAIL_OPTIONS.map(option => (
203
+ <Button
204
+ key={option.value}
205
+ type="button"
206
+ variant={tail === option.value ? 'default' : 'ghost'}
207
+ size="sm"
208
+ onClick={() => onTail(option.value)}
209
+ >
210
+ {option.label}
211
+ </Button>
212
+ ))}
213
+ </div>
214
+ <label className="flex items-center justify-between gap-2 px-1 text-xs text-muted-foreground">
215
+ Error banner
216
+ <Switch checked={showError} onCheckedChange={onShowError} />
217
+ </label>
218
+ </div>
219
+ )
220
+ }
221
+
222
+ export function ChatStatesPage() {
223
+ const [tail, setTail] = useState<TailState>('text')
224
+ const [showError, setShowError] = useState(false)
225
+
226
+ // The running selector row's spinner reads the live activity store. Seed it,
227
+ // and re-seed after any server status_snapshot reconcile (which rebuilds the
228
+ // activity map and would drop this fixture entry).
229
+ useEffect(() => {
230
+ const seed = () => {
231
+ const state = liveStore.getState()
232
+ if (!isSessionRunning(state.activity, DEV_WORKSPACE_ID, RUNNING_SELECTOR_SESSION_ID)) {
233
+ state.setActivity(DEV_WORKSPACE_ID, RUNNING_SELECTOR_SESSION_ID, 'running')
234
+ }
235
+ }
236
+ seed()
237
+ const unsubscribe = liveStore.subscribe(seed)
238
+ return () => {
239
+ unsubscribe()
240
+ liveStore.getState().setActivity(DEV_WORKSPACE_ID, RUNNING_SELECTOR_SESSION_ID, 'idle')
241
+ }
242
+ }, [])
243
+
244
+ const previewTurn = tailPreviewTurn(tail)
245
+ const processing = tail !== 'none'
246
+
247
+ return (
248
+ <WorkspaceLayoutContext value={layoutCtxValue}>
249
+ <div className="min-h-dvh bg-background font-sans text-foreground">
250
+ <div className="mx-auto flex w-full max-w-5xl gap-10 px-6 py-10">
251
+ <nav className="sticky top-10 hidden h-fit w-44 shrink-0 flex-col gap-1.5 self-start xl:flex">
252
+ <span className="pb-1 text-[11px] font-medium tracking-widest text-muted-foreground uppercase">
253
+ Chat states
254
+ </span>
255
+ {conversationAnchors.map(entry => (
256
+ <a
257
+ key={entry.anchor}
258
+ href={`#${entry.anchor}`}
259
+ className="text-xs text-muted-foreground hover:text-foreground"
260
+ >
261
+ {entry.label}
262
+ </a>
263
+ ))}
264
+ </nav>
265
+
266
+ <main className="flex w-full max-w-(--chat-max-container) min-w-0 flex-1 flex-col">
267
+ <header className="flex flex-col gap-1 pb-6">
268
+ <span className="text-[11px] font-medium tracking-widest text-muted-foreground uppercase">
269
+ Playground / Chat states
270
+ </span>
271
+ <p className="text-sm text-muted-foreground">
272
+ One continuous conversation covering every chat state, rendered by the production
273
+ components over inline fixtures.
274
+ </p>
275
+ </header>
276
+
277
+ <SelectorHeader />
278
+
279
+ <div className="flex flex-col pt-4">
280
+ <Transcript
281
+ turns={conversationTurns}
282
+ notices={conversationNotices}
283
+ previewTurn={previewTurn}
284
+ processing={processing}
285
+ anchors={ANCHOR_BY_ITEM_ID}
286
+ />
287
+
288
+ {showError && (
289
+ <div className="mt-6 flex w-full flex-col gap-2 rounded-t-xl rounded-b-2xl bg-destructive/10 p-2">
290
+ <ChatErrorBanner error={chatError} onDismiss={() => setShowError(false)} />
291
+ </div>
292
+ )}
293
+ </div>
294
+
295
+ <details className="mt-16 border-t border-border pt-6 text-xs text-muted-foreground">
296
+ <summary className="cursor-pointer font-medium">Notes for designers</summary>
297
+ <ul className="mt-3 flex list-disc flex-col gap-1.5 pl-4">
298
+ <li>
299
+ User bubbles render markdown verbatim (whitespace preserved, no markdown parsing)
300
+ — the fenced code block in the long question is intentional.
301
+ </li>
302
+ <li>
303
+ The moon reply carries a full <code>TurnMeta</code> payload (model, provider, stop
304
+ reason, usage, cost) but nothing in the transcript renders meta yet — it rides on
305
+ the turn for future treatments.
306
+ </li>
307
+ <li>
308
+ Approval-pending and approval-denied tool rows render as plain dot rows with no
309
+ body; there is no dedicated approval treatment yet.
310
+ </li>
311
+ <li>
312
+ Pending and running tool calls render identically (spinner node, no output).
313
+ </li>
314
+ <li>
315
+ Channel provenance (the IRC hello) lives on the session (<code>origin</code> badge
316
+ in the selector), not on the turn — the gateway's inbound metadata envelope is
317
+ stripped before display.
318
+ </li>
319
+ <li>
320
+ Nested subagent transcripts render reasoning and tool rows only; nested plain text
321
+ is skipped, and the final answer shows in the summary segment.
322
+ </li>
323
+ <li>
324
+ The busy dots follow ChatPanel's rule — they show whenever the agent is processing
325
+ and no preview content is visible yet, including under running tool rows.
326
+ </li>
327
+ <li>
328
+ Empty-chat states (<code>ChatEmptyState</code>: placeholder and first-run welcome)
329
+ cannot appear in a continuous transcript — find them in the chat with no turns.
330
+ </li>
331
+ <li>
332
+ Text-part <code>citations</code> (the sources reply carries one) are not rendered
333
+ — only the standalone <code>source-url</code> / <code>source-document</code> parts
334
+ show, as small underlined links.
335
+ </li>
336
+ <li>
337
+ <code>Edit</code> results render as plain text — <code>ToolOutput</code>{' '}
338
+ highlights only read/write-with-content or JSON outputs.
339
+ </li>
340
+ <li>
341
+ The image <code>Read</code> row's expanded body holds a{' '}
342
+ <code>ReadImagePreview</code> that loads the workspace preview endpoint; with this
343
+ page's fake workspace id the request 404s and the preview hides itself, leaving
344
+ the body empty. It needs a live workspace to show the picture.
345
+ </li>
346
+ <li>
347
+ <code>TurnOrigin</code> <code>'tool-return'</code> turns never reach the
348
+ transcript: adapters strip <code>tool_result</code> blocks and fold them into the
349
+ owning tool call, so no adapter emits one. (If one ever appeared, TurnView would
350
+ render its parts left-aligned, without the user bubble.)
351
+ </li>
352
+ </ul>
353
+
354
+ <p className="mt-5 font-medium text-foreground">No rendering yet</p>
355
+ <p className="mt-1">
356
+ These claude-code states reach the client but currently render nothing in the chat —
357
+ each needs a designed treatment, not just styling (shapes in{' '}
358
+ <code>lib/format.ts</code>):
359
+ </p>
360
+ <ul className="mt-2 flex list-disc flex-col gap-1.5 pl-4">
361
+ <li>
362
+ <code>rate-limit</code> notice —{' '}
363
+ <code>{"{ kind: 'rate-limit', at, info: { resetsAt: 1754300400 } }"}</code>
364
+ </li>
365
+ <li>
366
+ <code>api-retry</code> notice —{' '}
367
+ <code>
368
+ {
369
+ "{ kind: 'api-retry', at, attempt: 2, maxRetries: 10, delayMs: 8000, error: 'overloaded_error' }"
370
+ }
371
+ </code>
372
+ </li>
373
+ <li>
374
+ <code>hook</code> notice —{' '}
375
+ <code>
376
+ {
377
+ "{ kind: 'hook', at, hookId: 'hook_1a2b', hookName: 'PostToolUse', event: 'PostToolUse', status: 'response', output: 'ok', exitCode: 0, outcome: 'success' }"
378
+ }
379
+ </code>
380
+ </li>
381
+ <li>
382
+ <code>session-state</code> notice —{' '}
383
+ <code>{"{ kind: 'session-state', at, state: 'requires-action' }"}</code> (blocked
384
+ on a permission prompt; no loader or banner exists for it).
385
+ </li>
386
+ <li>
387
+ <code>files-persisted</code> notice —{' '}
388
+ <code>
389
+ {
390
+ "{ kind: 'files-persisted', at, files: ['notes/summary.md'], failed: [{ filename: 'shots/huge.png', error: 'exceeds size limit' }] }"
391
+ }
392
+ </code>
393
+ </li>
394
+ <li>
395
+ <code>elicitation</code> notice —{' '}
396
+ <code>
397
+ {"{ kind: 'elicitation', at, server: 'github', elicitationId: 'elic_7f3a' }"}
398
+ </code>
399
+ </li>
400
+ <li>
401
+ <code>SessionSnapshot</code> —{' '}
402
+ <code>
403
+ {
404
+ "{ sessionId, model: 'claude-sonnet-4-6', cwd, permissionMode: 'bypassPermissions', tools: ['Bash', 'Read', …], mcpServers: [{ name: 'github', status: 'connected' }], skills: ['moi-workspace'], … }"
405
+ }
406
+ </code>
407
+ </li>
408
+ <li>
409
+ <code>ResultSummary</code> —{' '}
410
+ <code>{"{ subtype: 'success', cost: 0.1129, turns: 6, durationMs: 48210 }"}</code>{' '}
411
+ (error subtypes: <code>error_during_execution</code>, <code>error_max_turns</code>
412
+ , budget and structured-output variants).
413
+ </li>
414
+ </ul>
415
+ </details>
416
+ </main>
417
+ </div>
418
+
419
+ <TailControls
420
+ tail={tail}
421
+ onTail={setTail}
422
+ showError={showError}
423
+ onShowError={setShowError}
424
+ />
425
+ </div>
426
+ </WorkspaceLayoutContext>
427
+ )
428
+ }
@@ -0,0 +1,52 @@
1
+ import { Link } from 'wouter'
2
+
3
+ type DevRouteEntry = {
4
+ path: string
5
+ title: string
6
+ description: string
7
+ }
8
+
9
+ const DEV_ROUTES: DevRouteEntry[] = [
10
+ {
11
+ path: '/dev/chat-states',
12
+ title: 'Chat states',
13
+ description:
14
+ 'Every chat state as one continuous conversation, rendered by the production components over fixtures.'
15
+ },
16
+ {
17
+ path: '/dev/tool-calls',
18
+ title: 'Tool calls',
19
+ description: 'Tool-call group fixtures: single and merged runs, live states, subagent traces.'
20
+ },
21
+ {
22
+ path: '/dev/harness',
23
+ title: 'Harness debug',
24
+ description:
25
+ 'Drive a workspace over the real chat protocol with wire, client, and durable event logs.'
26
+ }
27
+ ]
28
+
29
+ // The /dev index — a plain list of every dev route so pages stay
30
+ // discoverable. Add new entries here when adding a route in DevRoutes.
31
+ export function DevIndexPage() {
32
+ return (
33
+ <div className="mx-auto w-full max-w-xl px-6 py-10">
34
+ <span className="text-[11px] font-medium tracking-widest text-muted-foreground uppercase">
35
+ Playground
36
+ </span>
37
+ <ul className="mt-6 flex flex-col gap-5">
38
+ {DEV_ROUTES.map(route => (
39
+ <li key={route.path}>
40
+ <div className="flex items-baseline gap-2">
41
+ <Link href={route.path} className="underline underline-offset-4">
42
+ {route.title}
43
+ </Link>
44
+ <span className="font-mono text-xs text-muted-foreground">{route.path}</span>
45
+ </div>
46
+ <p className="mt-1 text-sm text-muted-foreground">{route.description}</p>
47
+ </li>
48
+ ))}
49
+ </ul>
50
+ </div>
51
+ )
52
+ }
@@ -1,18 +1,21 @@
1
1
  import { Route, Switch } from 'wouter'
2
2
 
3
+ import { ChatStatesPage } from './ChatStatesPage'
4
+ import { DevIndexPage } from './DevIndexPage'
3
5
  import { HarnessDebugPage } from './HarnessDebugPage'
4
- import { PlaygroundPage } from './PlaygroundPage'
5
6
  import { ToolCallsPage } from './ToolCallsPage'
6
7
 
7
8
  // All /dev/* routes, colocated with their pages so the whole dev playground
8
9
  // (and its dependencies) lives in this folder and loads as one lazy chunk —
9
- // see the dynamic import in AppRouter.
10
+ // see the dynamic import in AppRouter. /dev itself is the index; list new
11
+ // routes there too.
10
12
  export default function DevRoutes() {
11
13
  return (
12
14
  <Switch>
13
15
  <Route path="/dev/harness" component={HarnessDebugPage} />
16
+ <Route path="/dev/chat-states" component={ChatStatesPage} />
14
17
  <Route path="/dev/tool-calls" component={ToolCallsPage} />
15
- <Route path="/dev" component={PlaygroundPage} />
18
+ <Route path="/dev" component={DevIndexPage} />
16
19
  </Switch>
17
20
  )
18
21
  }
@@ -6,7 +6,7 @@ import { useSearchParams } from 'wouter'
6
6
  import { Button } from '@/client/components/ui/button'
7
7
  import { cn } from '@/client/lib/cn'
8
8
  import { wsUrl } from '@/client/lib/ws-url'
9
- import type { Model, WorkspaceEntry, WorkspaceModels } from '@/lib/types'
9
+ import type { Model, WorkspaceAgent, WorkspaceEntry } from '@/lib/types'
10
10
 
11
11
  // Scratch route for driving any harness end to end: pick a workspace, fire
12
12
  // canned scenarios (or your own prompt), and watch three synchronized logs —
@@ -235,9 +235,9 @@ export function HarnessDebugPage() {
235
235
  // Model list for the selected workspace.
236
236
  useEffect(() => {
237
237
  if (!workspaceId) return
238
- fetch(`/api/workspaces/${workspaceId}/models`)
238
+ fetch(`/api/workspaces/${workspaceId}/agent`)
239
239
  .then(r => r.json())
240
- .then((m: WorkspaceModels) => setModels(m.models))
240
+ .then((m: WorkspaceAgent) => setModels(m.models))
241
241
  .catch(() => setModels([]))
242
242
  }, [workspaceId])
243
243