moi-computer 0.8.1-next.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.
@@ -25,7 +25,7 @@ const components = {
25
25
  },
26
26
  pre({ children }: ComponentProps<'pre'>) {
27
27
  return (
28
- <div className="not-prose my-2 rounded-lg border border-border bg-muted px-3 py-2.5">
28
+ <div className="not-prose my-2 rounded-lg border border-border bg-[color-mix(var(--foreground)_5%,transparent)] px-3 py-2.5">
29
29
  <pre className="overflow-auto font-mono text-xs leading-relaxed whitespace-pre text-foreground [&>code]:rounded-none [&>code]:bg-transparent [&>code]:p-0">
30
30
  {children}
31
31
  </pre>
@@ -192,7 +192,12 @@ const CODEX_SUBAGENT_ACTION_LABELS: Record<string, string> = {
192
192
  }
193
193
 
194
194
  export function getToolDisplayName(call: ToolCall): string {
195
- if (call.provider === 'openclaw') return OPENCLAW_TOOL_LABELS[call.name] ?? call.name
195
+ // An OpenClaw agent pinned to the `claude-cli` runtime reports Claude Code's
196
+ // own tool names (`Read`, `Bash`, `Edit`, …) rather than OpenClaw's, so the
197
+ // Claude vocabulary is the fallback before giving up and showing the raw name.
198
+ if (call.provider === 'openclaw') {
199
+ return OPENCLAW_TOOL_LABELS[call.name] ?? CLAUDE_TOOL_LABELS[call.name] ?? call.name
200
+ }
196
201
  if (call.provider === 'codex') {
197
202
  if (call.name === 'exec') {
198
203
  const action = codexExecAction(call.input)
@@ -221,7 +226,13 @@ function shortToolName(name: string): string {
221
226
  export function formatInputBrief(call: ToolCall, cwd: string | null): string {
222
227
  const input = (call.input as Record<string, unknown>) ?? {}
223
228
  const shorten = makeShortenPaths(cwd)
224
- if (call.provider === 'openclaw') return formatOpenClawBrief(call.name, input, shorten)
229
+ if (call.provider === 'openclaw') {
230
+ // Same fallback as the label: a claude-cli-backed run carries Claude Code's
231
+ // tool names and argument keys (`file_path`, not `path`).
232
+ return (
233
+ formatOpenClawBrief(call.name, input, shorten) || formatClaudeBrief(call.name, input, shorten)
234
+ )
235
+ }
225
236
  if (call.provider === 'codex') return formatCodexBrief(call.name, input, shorten)
226
237
  return formatClaudeBrief(call.name, input, shorten)
227
238
  }
@@ -314,7 +325,21 @@ function formatOpenClawBrief(
314
325
  if (tool === 'read' || tool === 'write' || tool === 'edit')
315
326
  return shorten(getInputValue(input, 'path'))
316
327
  if (tool === 'apply_patch') {
317
- const patch = getInputValue(input, 'patch')
328
+ // The codex runtime describes an edit structurally: `{ changes: [{ path,
329
+ // kind }] }` (captured live on 2026.7.1). Name the file, or count them when
330
+ // one patch touches several.
331
+ const changes = input.changes
332
+ if (Array.isArray(changes) && changes.length > 0) {
333
+ const paths = changes
334
+ .map(c =>
335
+ c && typeof c === 'object' ? getInputValue(c as Record<string, unknown>, 'path') : ''
336
+ )
337
+ .filter(Boolean)
338
+ if (paths.length === 1) return shorten(paths[0])
339
+ if (paths.length > 1) return `${paths.length} files`
340
+ }
341
+ // Older shape: the raw patch text, whose `*** ` header names the file.
342
+ const patch = getInputValue(input, 'patch') || getInputValue(input, 'input')
318
343
  const firstLine = patch.split('\n').find(l => l.startsWith('*** ')) ?? patch.split('\n')[0]
319
344
  return shorten(firstLine ?? '')
320
345
  }
@@ -33,6 +33,7 @@ import {
33
33
  WorkspaceLayoutContext,
34
34
  type WorkspaceLayoutContextValue
35
35
  } from '@/client/features/workspace/WorkspaceLayoutContext'
36
+ import { cn } from '@/client/lib/cn'
36
37
  import { createDefaultWorkspaceLayout } from '@/lib/workspace-layout'
37
38
  import type { SystemNotice, Turn } from '@/lib/types'
38
39
 
@@ -70,6 +71,7 @@ const ANCHOR_BY_ITEM_ID: Record<string, string> = Object.fromEntries(
70
71
  )
71
72
 
72
73
  type TailState = 'none' | 'dots' | 'thinking' | 'text'
74
+ type BackgroundState = 'default' | 'muted'
73
75
 
74
76
  const TAIL_OPTIONS: { value: TailState; label: string }[] = [
75
77
  { value: 'none', label: 'None' },
@@ -78,6 +80,11 @@ const TAIL_OPTIONS: { value: TailState; label: string }[] = [
78
80
  { value: 'text', label: 'Text' }
79
81
  ]
80
82
 
83
+ const BACKGROUND_OPTIONS: { value: BackgroundState; label: string }[] = [
84
+ { value: 'default', label: 'Default' },
85
+ { value: 'muted', label: 'Muted' }
86
+ ]
87
+
81
88
  function tailPreviewTurn(tail: TailState): Turn | null {
82
89
  if (tail === 'thinking') return buildPreviewTurn(toLivePreview(reasoningStreamPreview))
83
90
  if (tail === 'text') return buildPreviewTurn(toLivePreview(textStreamPreview))
@@ -187,6 +194,8 @@ function SelectorHeader() {
187
194
  type TailControlsProps = {
188
195
  tail: TailState
189
196
  onTail: (tail: TailState) => void
197
+ background: BackgroundState
198
+ onBackground: (background: BackgroundState) => void
190
199
  showError: boolean
191
200
  onShowError: (show: boolean) => void
192
201
  }
@@ -194,7 +203,14 @@ type TailControlsProps = {
194
203
  // Fixed dev control for the conversation's live tail and the error banner.
195
204
  // Sits at the end of the page DOM, so it paints above the content without
196
205
  // z-index.
197
- function TailControls({ tail, onTail, showError, onShowError }: TailControlsProps) {
206
+ function TailControls({
207
+ tail,
208
+ onTail,
209
+ background,
210
+ onBackground,
211
+ showError,
212
+ onShowError
213
+ }: TailControlsProps) {
198
214
  return (
199
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">
200
216
  <span className="px-1 text-xs text-muted-foreground">Live tail</span>
@@ -211,6 +227,20 @@ function TailControls({ tail, onTail, showError, onShowError }: TailControlsProp
211
227
  </Button>
212
228
  ))}
213
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>
214
244
  <label className="flex items-center justify-between gap-2 px-1 text-xs text-muted-foreground">
215
245
  Error banner
216
246
  <Switch checked={showError} onCheckedChange={onShowError} />
@@ -221,6 +251,7 @@ function TailControls({ tail, onTail, showError, onShowError }: TailControlsProp
221
251
 
222
252
  export function ChatStatesPage() {
223
253
  const [tail, setTail] = useState<TailState>('text')
254
+ const [background, setBackground] = useState<BackgroundState>('default')
224
255
  const [showError, setShowError] = useState(false)
225
256
 
226
257
  // The running selector row's spinner reads the live activity store. Seed it,
@@ -246,7 +277,12 @@ export function ChatStatesPage() {
246
277
 
247
278
  return (
248
279
  <WorkspaceLayoutContext value={layoutCtxValue}>
249
- <div className="min-h-dvh bg-background font-sans text-foreground">
280
+ <div
281
+ className={cn(
282
+ 'min-h-dvh font-sans text-foreground',
283
+ background === 'default' ? 'bg-background' : 'bg-muted'
284
+ )}
285
+ >
250
286
  <div className="mx-auto flex w-full max-w-5xl gap-10 px-6 py-10">
251
287
  <nav className="sticky top-10 hidden h-fit w-44 shrink-0 flex-col gap-1.5 self-start xl:flex">
252
288
  <span className="pb-1 text-[11px] font-medium tracking-widest text-muted-foreground uppercase">
@@ -419,6 +455,8 @@ export function ChatStatesPage() {
419
455
  <TailControls
420
456
  tail={tail}
421
457
  onTail={setTail}
458
+ background={background}
459
+ onBackground={setBackground}
422
460
  showError={showError}
423
461
  onShowError={setShowError}
424
462
  />
@@ -1 +1 @@
1
- import{Ic as t}from"/chunk-35fq49qa.js";if(typeof globalThis.structuredClone==="function")globalThis.structuredClone=globalThis.structuredClone.bind(globalThis);async function e(r){let{mount:a}=await import("/chunk-n7pga5x3.js");a(r)}globalThis.__init=e;
1
+ import{Ic as t}from"/chunk-35fq49qa.js";if(typeof globalThis.structuredClone==="function")globalThis.structuredClone=globalThis.structuredClone.bind(globalThis);async function e(r){let{mount:a}=await import("/chunk-ty1sqbmn.js");a(r)}globalThis.__init=e;