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