moi-computer 0.3.0-next.2 → 0.3.0-next.3
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/README.md +1 -1
- package/client/AGENTS.md +2 -2
- package/client/api/http.ts +1 -1
- package/client/api/workspace-keys.ts +1 -0
- package/client/app/AppRouter.tsx +14 -5
- package/client/app/routes/HomeRoute.tsx +1 -1
- package/client/app/routes/WorkspaceRoute.tsx +8 -2
- package/client/app/shell/SidebarLayout.tsx +10 -5
- package/client/assets/openai.svg +3 -0
- package/client/components/shared/BottomPanel.tsx +2 -2
- package/client/components/ui/button.tsx +3 -2
- package/client/components/ui/input.tsx +1 -1
- package/client/features/applets/AppletMount.tsx +44 -0
- package/client/features/applets/WidgetShell.tsx +4 -1
- package/client/features/applets/applet-cache.ts +8 -0
- package/client/features/applets/applet-styles.ts +61 -0
- package/client/features/chat/ChatComposer.tsx +2 -2
- package/client/features/chat/ChatPanel.tsx +8 -25
- package/client/features/chat/ChatPopup.tsx +3 -3
- package/client/features/chat/{ThreadSelector.tsx → ChatSelector.tsx} +4 -4
- package/client/features/chat/TurnView.tsx +8 -9
- package/client/features/chat/api.ts +1 -1
- package/client/features/chat/chat-send.ts +57 -0
- package/client/features/chat/tool-group/ToolCallGroup.tsx +2 -1
- package/client/features/chat/tool-group/format.ts +117 -0
- package/client/features/chat/useChat.ts +10 -34
- package/client/features/connectors/McpMenu.tsx +4 -21
- package/client/features/dev/DevRoutes.tsx +18 -0
- package/client/features/dev/HarnessDebugPage.tsx +468 -0
- package/client/{components/playground → features/dev}/PlaygroundPage.tsx +1 -1
- package/client/features/home/CreateWorkspaceDialog.tsx +64 -158
- package/client/features/home/CreateWorkspaceDialogSteps.tsx +234 -0
- package/client/features/home/HomeLogo.tsx +344 -0
- package/client/features/home/HomePage.tsx +15 -21
- package/client/features/home/WorkspacePreview.tsx +2 -2
- package/client/features/home/api.ts +11 -3
- package/client/features/home/workspace-presentation.tsx +4 -4
- package/client/features/settings/GeneralSettings.tsx +3 -3
- package/client/features/settings/IconPicker.tsx +4 -3
- package/client/features/settings/icon-picker-options.ts +0 -131
- package/client/features/views/ViewBuilderTab.tsx +153 -0
- package/client/features/views/api.ts +124 -0
- package/client/features/views/useViewBuilderActions.ts +72 -0
- package/client/features/widgets/WidgetGrid.tsx +36 -20
- package/client/features/widgets/Widgets.tsx +140 -90
- package/client/features/workspace/WorkspaceLayoutContext.tsx +3 -9
- package/client/features/workspace/WorkspaceScreen.tsx +179 -40
- package/client/features/workspace/WorkspaceTabs.tsx +4 -4
- package/client/index.css +0 -35
- package/client/index.html +1 -1
- package/client/lib/app-icon-registry.ts +145 -0
- package/client/runtime/useWorkspaceEvents.ts +3 -1
- package/client/theme.css +1 -1
- package/dist/chunk-4vf1t6v1.js +10 -0
- package/dist/chunk-6c24yndg.js +61 -0
- package/dist/chunk-6c8cwpzc.js +1 -0
- package/dist/chunk-b4b276wx.js +15 -0
- package/dist/{chunk-c4j722at.js → chunk-cs8vbert.js} +2 -2
- package/dist/chunk-cwqmay73.css +1 -0
- package/dist/chunk-kxmvv1ax.js +48 -0
- package/dist/chunk-rq0ar7vp.js +1 -0
- package/dist/{chunk-p68fnz3q.js → chunk-vkvb3hjm.js} +1 -1
- package/dist/chunk-zpxrb1ce.js +2 -0
- package/dist/index.html +2 -2
- package/dist/openai-h13pza4b.svg +3 -0
- package/lib/format.ts +2 -2
- package/lib/types.ts +38 -2
- package/lib/view-builder-meta.ts +35 -0
- package/lib/workspace-layout.ts +14 -0
- package/package.json +2 -1
- package/server/AGENTS.md +3 -3
- package/server/api.ts +165 -51
- package/server/applets.ts +1 -1
- package/server/bundle-queue.ts +19 -0
- package/server/bundler/applet-css.ts +50 -0
- package/server/{build-applet.ts → bundler/build-applet.ts} +36 -26
- package/server/cli.ts +79 -2
- package/server/control.ts +106 -8
- package/server/env-apply.ts +2 -2
- package/server/harness/README.md +228 -0
- package/server/harness/claude-code/NOTES.md +578 -0
- package/{lib/claude-adapter.ts → server/harness/claude-code/adapter.ts} +67 -5
- package/server/harness/claude-code/index.ts +124 -0
- package/server/{mcp.ts → harness/claude-code/mcp.ts} +1 -1
- package/server/{cc-session.ts → harness/claude-code/session.ts} +42 -14
- package/server/harness/claude-code/sessions.ts +42 -0
- package/server/harness/codex/NOTES.md +239 -0
- package/server/harness/codex/adapter.ts +414 -0
- package/server/harness/codex/client.ts +343 -0
- package/server/harness/codex/index.ts +68 -0
- package/server/harness/codex/probe.ts +186 -0
- package/server/harness/codex/session.ts +617 -0
- package/server/harness/debug.ts +57 -0
- package/server/harness/openclaw/NOTES.md +316 -0
- package/server/{openclaw-adapter.ts → harness/openclaw/adapter.ts} +2 -2
- package/server/harness/openclaw/index.ts +93 -0
- package/server/{openclaw-session.ts → harness/openclaw/session.ts} +44 -9
- package/server/{openclaw-strip.ts → harness/openclaw/strip.ts} +3 -1
- package/server/harness/registry.ts +36 -0
- package/server/harness/types.ts +87 -0
- package/server/layout.ts +6 -12
- package/server/moi-scaffold.ts +1 -1
- package/server/registry.ts +14 -52
- package/server/state.ts +5 -38
- package/server/status.ts +7 -46
- package/server/vendor.ts +1 -1
- package/server/view-builders.ts +428 -0
- package/server/views.ts +0 -0
- package/server/web.ts +18 -40
- package/server/workspace-init.ts +6 -6
- package/workspace/.claude/skills/moi-workspace/DESIGN.md +1 -0
- package/workspace/.claude/skills/moi-workspace/SKILL.md +28 -7
- package/client/assets/hermes-nous.png +0 -0
- package/client/hooks/useScrollFade.ts +0 -38
- package/dist/chunk-23cgr1tz.css +0 -1
- package/dist/chunk-3hy3qy6d.js +0 -10
- package/dist/chunk-dyfaffyz.js +0 -119
- package/dist/chunk-kpe40hm8.js +0 -1
- package/dist/chunk-ty6dvda0.js +0 -1
- package/dist/hermes-nous-pznd63x9.png +0 -0
- /package/client/{components/playground → features/dev}/PixelPainter.tsx +0 -0
- /package/client/{components/playground → features/dev}/ToolCallsPage.tsx +0 -0
- /package/server/{agent.ts → harness/claude-code/models.ts} +0 -0
- /package/server/{openclaw.ts → harness/openclaw/discovery.ts} +0 -0
- /package/server/{openclaw-gateway.ts → harness/openclaw/gateway.ts} +0 -0
|
@@ -32,6 +32,7 @@ import {
|
|
|
32
32
|
import { ToolOutput } from './ToolOutput'
|
|
33
33
|
import {
|
|
34
34
|
formatInputBrief,
|
|
35
|
+
parseCodexMcp,
|
|
35
36
|
formatMcpTool,
|
|
36
37
|
getToolDisplayName,
|
|
37
38
|
parseMcporterCall,
|
|
@@ -195,7 +196,7 @@ function ToolCallCard({ call, cwd, isFirst, isLast }: ToolCallCardProps) {
|
|
|
195
196
|
/>
|
|
196
197
|
)
|
|
197
198
|
}
|
|
198
|
-
const mcp = parseMcporterCall(call) ?? parseNativeMcp(call)
|
|
199
|
+
const mcp = parseMcporterCall(call) ?? parseNativeMcp(call) ?? parseCodexMcp(call)
|
|
199
200
|
if (mcp) {
|
|
200
201
|
const fn = formatMcpTool(mcp.server, mcp.tool)
|
|
201
202
|
return (
|
|
@@ -36,6 +36,24 @@ export function parseNativeMcp(call: ToolCall): McpRef | null {
|
|
|
36
36
|
return { server: rest.slice(0, i), tool: rest.slice(i + 2), rest: '' }
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
// Codex MCP calls arrive with a real `mcpServer` field and a plain tool name.
|
|
40
|
+
// Two shapes get the server-branded card:
|
|
41
|
+
// - a call against a configured server (`server: "codex_apps"`), where app
|
|
42
|
+
// tools are dotted `<app>.<tool>` (`resume_io.build_resume_with_templates`)
|
|
43
|
+
// — brand by the app, not the host;
|
|
44
|
+
// - anything else brands by the server itself.
|
|
45
|
+
// Codex's own MCP-management pseudo-tools (`server: "codex"`, or the
|
|
46
|
+
// list/read management names on any server) stay plain rows — they're
|
|
47
|
+
// runtime introspection, not a call INTO a server (see CODEX_TOOL_LABELS).
|
|
48
|
+
export function parseCodexMcp(call: ToolCall): McpRef | null {
|
|
49
|
+
if (call.provider !== 'codex' || !call.mcpServer) return null
|
|
50
|
+
if (call.name in CODEX_TOOL_LABELS) return null
|
|
51
|
+
if (call.mcpServer === 'codex') return null
|
|
52
|
+
const dot = call.name.indexOf('.')
|
|
53
|
+
if (dot > 0) return { server: call.name.slice(0, dot), tool: call.name.slice(dot + 1), rest: '' }
|
|
54
|
+
return { server: call.mcpServer, tool: call.name, rest: '' }
|
|
55
|
+
}
|
|
56
|
+
|
|
39
57
|
// Drop the redundant server prefix many MCP tools repeat — the icon + server name
|
|
40
58
|
// already identify it: `notion-search` → `search`, `notion-get-teams` →
|
|
41
59
|
// `get-teams`. Tools that don't repeat the server pass through unchanged.
|
|
@@ -121,8 +139,55 @@ const CLAUDE_TOOL_LABELS: Record<string, string> = {
|
|
|
121
139
|
WebFetch: 'Web Fetch'
|
|
122
140
|
}
|
|
123
141
|
|
|
142
|
+
// Codex emits semantic items, which the adapter maps to a small fixed set of
|
|
143
|
+
// tool names (plus raw MCP tool names, which fall through unchanged).
|
|
144
|
+
const CODEX_TOOL_LABELS: Record<string, string> = {
|
|
145
|
+
exec: 'Bash',
|
|
146
|
+
apply_patch: 'Edit',
|
|
147
|
+
web_search: 'Web search',
|
|
148
|
+
update_plan: 'Update plan',
|
|
149
|
+
subagent: 'Run sub-agent',
|
|
150
|
+
subagent_activity: 'Sub-agent',
|
|
151
|
+
review: 'Review',
|
|
152
|
+
view_image: 'View image',
|
|
153
|
+
generate_image: 'Generate image',
|
|
154
|
+
// MCP-management introspection (can arrive under any server, incl. the
|
|
155
|
+
// "codex" pseudo-server) — plain rows, never the server-branded card.
|
|
156
|
+
list_mcp_resources: 'List MCP resources',
|
|
157
|
+
list_mcp_resource_templates: 'List MCP templates',
|
|
158
|
+
read_mcp_resource: 'Read MCP resource'
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
// Codex classifies each shell command itself (`commandActions`, one entry per
|
|
162
|
+
// piped command). When every action agrees on a type, use a CC-style semantic
|
|
163
|
+
// label instead of "Bash".
|
|
164
|
+
type CodexCommandAction = { type?: string; name?: string; path?: string; query?: string | null }
|
|
165
|
+
|
|
166
|
+
const CODEX_ACTION_LABELS: Record<string, string> = {
|
|
167
|
+
read: 'Read',
|
|
168
|
+
listFiles: 'List files',
|
|
169
|
+
search: 'Search'
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
function codexExecAction(input: unknown): CodexCommandAction | null {
|
|
173
|
+
const actions = (input as { commandActions?: unknown } | null)?.commandActions
|
|
174
|
+
if (!Array.isArray(actions) || actions.length === 0) return null
|
|
175
|
+
const first = actions[0] as CodexCommandAction
|
|
176
|
+
const type = first?.type
|
|
177
|
+
if (!type || !(type in CODEX_ACTION_LABELS)) return null
|
|
178
|
+
if (actions.some(a => (a as CodexCommandAction)?.type !== type)) return null
|
|
179
|
+
return first
|
|
180
|
+
}
|
|
181
|
+
|
|
124
182
|
export function getToolDisplayName(call: ToolCall): string {
|
|
125
183
|
if (call.provider === 'openclaw') return OPENCLAW_TOOL_LABELS[call.name] ?? call.name
|
|
184
|
+
if (call.provider === 'codex') {
|
|
185
|
+
if (call.name === 'exec') {
|
|
186
|
+
const action = codexExecAction(call.input)
|
|
187
|
+
if (action?.type) return CODEX_ACTION_LABELS[action.type]
|
|
188
|
+
}
|
|
189
|
+
return CODEX_TOOL_LABELS[call.name] ?? call.name
|
|
190
|
+
}
|
|
126
191
|
return CLAUDE_TOOL_LABELS[call.name] ?? call.name
|
|
127
192
|
}
|
|
128
193
|
|
|
@@ -139,9 +204,61 @@ export function formatInputBrief(call: ToolCall, cwd: string | null): string {
|
|
|
139
204
|
const input = (call.input as Record<string, unknown>) ?? {}
|
|
140
205
|
const shorten = makeShortenPaths(cwd)
|
|
141
206
|
if (call.provider === 'openclaw') return formatOpenClawBrief(call.name, input, shorten)
|
|
207
|
+
if (call.provider === 'codex') return formatCodexBrief(call.name, input, shorten)
|
|
142
208
|
return formatClaudeBrief(call.name, input, shorten)
|
|
143
209
|
}
|
|
144
210
|
|
|
211
|
+
function formatCodexBrief(
|
|
212
|
+
tool: string,
|
|
213
|
+
input: Record<string, unknown>,
|
|
214
|
+
shorten: (s: string) => string
|
|
215
|
+
): string {
|
|
216
|
+
if (tool === 'exec') {
|
|
217
|
+
// Semantic brief when Codex classified the command (label says Read/
|
|
218
|
+
// Search/List files); raw command otherwise.
|
|
219
|
+
const action = codexExecAction(input)
|
|
220
|
+
if (action?.type === 'read') return shorten(action.path || action.name || '')
|
|
221
|
+
if (action?.type === 'search')
|
|
222
|
+
return [action.query && `/${action.query}/`, action.path && shorten(action.path)]
|
|
223
|
+
.filter(Boolean)
|
|
224
|
+
.join(' ')
|
|
225
|
+
if (action?.type === 'listFiles') return action.path ? shorten(action.path) : ''
|
|
226
|
+
return shorten(`$ ${getInputValue(input, 'command')}`)
|
|
227
|
+
}
|
|
228
|
+
if (tool === 'apply_patch') {
|
|
229
|
+
// The adapter sends structured per-file changes: [{ path, kind, diff }].
|
|
230
|
+
const changes = input.changes
|
|
231
|
+
if (Array.isArray(changes)) {
|
|
232
|
+
const paths = changes
|
|
233
|
+
.map(c => (c && typeof c === 'object' ? (c as { path?: unknown }).path : undefined))
|
|
234
|
+
.filter((p): p is string => typeof p === 'string')
|
|
235
|
+
.map(shorten)
|
|
236
|
+
return paths.join(', ')
|
|
237
|
+
}
|
|
238
|
+
return ''
|
|
239
|
+
}
|
|
240
|
+
if (tool === 'web_search') {
|
|
241
|
+
// Multi-query fan-outs carry every query in `queries`; single searches
|
|
242
|
+
// just have `query`.
|
|
243
|
+
const queries = input.queries
|
|
244
|
+
if (Array.isArray(queries) && queries.length > 0) {
|
|
245
|
+
return queries.filter((q): q is string => typeof q === 'string').join(' · ')
|
|
246
|
+
}
|
|
247
|
+
return getInputValue(input, 'query')
|
|
248
|
+
}
|
|
249
|
+
if (tool === 'update_plan') {
|
|
250
|
+
const plan = input.plan
|
|
251
|
+
return typeof plan === 'string' ? plan.split('\n')[0] : ''
|
|
252
|
+
}
|
|
253
|
+
if (tool === 'subagent') return getInputValue(input, 'prompt') || getInputValue(input, 'action')
|
|
254
|
+
if (tool === 'subagent_activity') return getInputValue(input, 'kind')
|
|
255
|
+
if (tool === 'generate_image') return getInputValue(input, 'prompt').split('\n')[0]
|
|
256
|
+
if (tool === 'read_mcp_resource') return getInputValue(input, 'uri')
|
|
257
|
+
if (tool === 'list_mcp_resources' || tool === 'list_mcp_resource_templates')
|
|
258
|
+
return getInputValue(input, 'server')
|
|
259
|
+
return ''
|
|
260
|
+
}
|
|
261
|
+
|
|
145
262
|
function formatClaudeBrief(
|
|
146
263
|
tool: string,
|
|
147
264
|
input: Record<string, unknown>,
|
|
@@ -3,14 +3,13 @@ import { useCallback, useMemo } from 'react'
|
|
|
3
3
|
import { useQueryClient } from '@tanstack/react-query'
|
|
4
4
|
|
|
5
5
|
import { useSessionView, useThreadConfig, useWorkspaceModels } from '@/client/features/chat/api'
|
|
6
|
-
import { workspaceKeys } from '@/client/api/workspace-keys'
|
|
7
6
|
import { useWorkspaceId } from '@/client/features/workspace/WorkspaceContext'
|
|
8
7
|
import { useWorkspaceLayoutCtx } from '@/client/features/workspace/WorkspaceLayoutContext'
|
|
9
8
|
import { sendMessage } from '@/client/features/chat/chat-connection'
|
|
10
|
-
import {
|
|
9
|
+
import { resolveChatRunOptions, startOptimisticTurn } from '@/client/features/chat/chat-send'
|
|
11
10
|
import { buildPreviewTurn } from '@/client/features/chat/preview-turn'
|
|
12
11
|
import { draftKey, liveStore, selectPreviews, useLive } from '@/client/features/chat/chat-store'
|
|
13
|
-
import {
|
|
12
|
+
import { emptyViewState } from '@/lib/format'
|
|
14
13
|
import type { Part, ViewState } from '@/lib/types'
|
|
15
14
|
|
|
16
15
|
const EMPTY: ViewState = emptyViewState()
|
|
@@ -23,8 +22,6 @@ export function useChat() {
|
|
|
23
22
|
const qc = useQueryClient()
|
|
24
23
|
const { layout } = useWorkspaceLayoutCtx()
|
|
25
24
|
const modelsData = useWorkspaceModels(workspaceId).data
|
|
26
|
-
const models = modelsData?.models
|
|
27
|
-
const supportsStreaming = modelsData?.supportsStreaming ?? false
|
|
28
25
|
|
|
29
26
|
const activeSessionId = useLive(s => s.activeByWorkspace[workspaceId] ?? null)
|
|
30
27
|
const processing = useLive(s =>
|
|
@@ -79,7 +76,6 @@ export function useChat() {
|
|
|
79
76
|
// upserts in place rather than duplicating. Image attachments render from
|
|
80
77
|
// their local object URL until the server's broadcast (with a data URL)
|
|
81
78
|
// upserts in place.
|
|
82
|
-
const optimisticId = `optimistic:${crypto.randomUUID()}`
|
|
83
79
|
const parts: Part[] = []
|
|
84
80
|
for (const a of ready) {
|
|
85
81
|
if (a.upload?.kind === 'image' && a.previewUrl) {
|
|
@@ -89,20 +85,12 @@ export function useChat() {
|
|
|
89
85
|
}
|
|
90
86
|
}
|
|
91
87
|
if (text) parts.push({ type: 'text', text })
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
origin: { kind: 'user-input' },
|
|
99
|
-
parts,
|
|
100
|
-
timestamp: new Date().toISOString()
|
|
101
|
-
}
|
|
102
|
-
})
|
|
103
|
-
)
|
|
104
|
-
liveStore.getState().setProcessing(workspaceId, sid, true)
|
|
105
|
-
liveStore.getState().setError(workspaceId, sid, null)
|
|
88
|
+
const optimisticId = startOptimisticTurn({
|
|
89
|
+
queryClient: qc,
|
|
90
|
+
workspaceId,
|
|
91
|
+
sessionId: sid,
|
|
92
|
+
parts
|
|
93
|
+
})
|
|
106
94
|
|
|
107
95
|
// The thread's persisted choice (workspace defaults for a new chat). Drop a
|
|
108
96
|
// model the loaded list no longer offers (stale alias) so the SDK doesn't
|
|
@@ -110,19 +98,8 @@ export function useChat() {
|
|
|
110
98
|
// (e.g. model changed under it); when the model is unknown/default we can't
|
|
111
99
|
// check, so pass it through — the SDK silently downgrades unsupported effort.
|
|
112
100
|
const pickedModel = threadCfg?.model ?? layout.selectedModel
|
|
113
|
-
const modelOk = !pickedModel || !models || models.some(m => m.value === pickedModel)
|
|
114
|
-
const model = modelOk ? pickedModel : undefined
|
|
115
|
-
const modelInfo = models?.find(m => m.value === model)
|
|
116
101
|
const pickedEffort = threadCfg?.effort ?? layout.selectedEffort
|
|
117
|
-
const effort =
|
|
118
|
-
pickedEffort &&
|
|
119
|
-
(!modelInfo || (modelInfo.supportedEffortLevels ?? []).includes(pickedEffort))
|
|
120
|
-
? pickedEffort
|
|
121
|
-
: undefined
|
|
122
|
-
// Live token streaming is a compile-time dev flag (client/lib/flags.ts),
|
|
123
|
-
// gated to providers that support it. Send `true` or omit (never `false`),
|
|
124
|
-
// so a provider that ignores it behaves identically.
|
|
125
|
-
const stream = STREAM_RESPONSES && supportsStreaming ? true : undefined
|
|
102
|
+
const { model, effort, stream } = resolveChatRunOptions(modelsData, pickedModel, pickedEffort)
|
|
126
103
|
sendMessage({
|
|
127
104
|
type: 'chat',
|
|
128
105
|
workspaceId,
|
|
@@ -148,8 +125,7 @@ export function useChat() {
|
|
|
148
125
|
layout.selectedEffort,
|
|
149
126
|
threadCfg?.model,
|
|
150
127
|
threadCfg?.effort,
|
|
151
|
-
|
|
152
|
-
supportsStreaming
|
|
128
|
+
modelsData
|
|
153
129
|
]
|
|
154
130
|
)
|
|
155
131
|
|
|
@@ -3,7 +3,6 @@ import { IconAlertCircleFilled, IconPlugConnected } from '@tabler/icons-react'
|
|
|
3
3
|
import { IconMcp } from '@/client/features/connectors/IconMcp'
|
|
4
4
|
import { Button } from '@/client/components/ui/button'
|
|
5
5
|
import { HoverCard, HoverCardContent, HoverCardTrigger } from '@/client/components/ui/hover-card'
|
|
6
|
-
import { useScrollFade } from '@/client/hooks/useScrollFade'
|
|
7
6
|
import { formatMcpServerName, getMcpIcon } from '@/client/features/connectors/mcp-icons'
|
|
8
7
|
import { useWorkspaceId } from '@/client/features/workspace/WorkspaceContext'
|
|
9
8
|
import { useWorkspaceLayoutCtx } from '@/client/features/workspace/WorkspaceLayoutContext'
|
|
@@ -96,27 +95,11 @@ export function McpServerCard({ server }: { server: McpServer }) {
|
|
|
96
95
|
)
|
|
97
96
|
}
|
|
98
97
|
|
|
99
|
-
// The scrollable server list.
|
|
100
|
-
//
|
|
101
|
-
// Overflow is signalled with top/bottom mask fades; the scrollbar is hidden.
|
|
98
|
+
// The scrollable server list. Overflow is signalled with scroll-aware fades;
|
|
99
|
+
// the scrollbar is hidden.
|
|
102
100
|
function McpList({ servers }: { servers: McpServer[] }) {
|
|
103
|
-
const { ref, showTopFade, showBottomFade } = useScrollFade()
|
|
104
|
-
const fade =
|
|
105
|
-
showTopFade && showBottomFade
|
|
106
|
-
? 'mask-fade-y'
|
|
107
|
-
: showTopFade
|
|
108
|
-
? 'mask-fade-top'
|
|
109
|
-
: showBottomFade
|
|
110
|
-
? 'mask-fade-bottom'
|
|
111
|
-
: undefined
|
|
112
101
|
return (
|
|
113
|
-
<div
|
|
114
|
-
ref={ref}
|
|
115
|
-
className={cn(
|
|
116
|
-
'scrollbar-none flex max-h-72 flex-col overflow-y-auto overscroll-contain',
|
|
117
|
-
fade
|
|
118
|
-
)}
|
|
119
|
-
>
|
|
102
|
+
<div className="no-scrollbar flex max-h-72 scroll-fade flex-col overflow-y-auto overscroll-contain [--scroll-fade-reveal:16px]">
|
|
120
103
|
{servers.map(server => (
|
|
121
104
|
<McpServerRow key={server.name} server={server} />
|
|
122
105
|
))}
|
|
@@ -134,7 +117,7 @@ export function McpMenu() {
|
|
|
134
117
|
// between the fullscreen and two-pane headers) fires `refetchOnMount`, which
|
|
135
118
|
// overwrites an in-flight optimistic chat-mode change before it's persisted.
|
|
136
119
|
const { provider, isLoading } = useWorkspaceLayoutCtx()
|
|
137
|
-
const isClaude = !isLoading && provider !== 'openclaw'
|
|
120
|
+
const isClaude = !isLoading && provider !== 'openclaw'
|
|
138
121
|
const { data: servers } = useWorkspaceMcp(workspaceId, isClaude)
|
|
139
122
|
|
|
140
123
|
if (!isClaude) return null
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Route, Switch } from 'wouter'
|
|
2
|
+
|
|
3
|
+
import { HarnessDebugPage } from './HarnessDebugPage'
|
|
4
|
+
import { PlaygroundPage } from './PlaygroundPage'
|
|
5
|
+
import { ToolCallsPage } from './ToolCallsPage'
|
|
6
|
+
|
|
7
|
+
// All /dev/* routes, colocated with their pages so the whole dev playground
|
|
8
|
+
// (and its dependencies) lives in this folder and loads as one lazy chunk —
|
|
9
|
+
// see the dynamic import in AppRouter.
|
|
10
|
+
export default function DevRoutes() {
|
|
11
|
+
return (
|
|
12
|
+
<Switch>
|
|
13
|
+
<Route path="/dev/harness" component={HarnessDebugPage} />
|
|
14
|
+
<Route path="/dev/tool-calls" component={ToolCallsPage} />
|
|
15
|
+
<Route path="/dev" component={PlaygroundPage} />
|
|
16
|
+
</Switch>
|
|
17
|
+
)
|
|
18
|
+
}
|