Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/desktop/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,8 @@ Terminal control),
which the helper refuses. With **Ask before using a new
app** on, each app's first use is approved for the task or persistently, and persistent approvals are
listed in Settings and can be revoked. Sign-out and deployment changes clear opt-in, the ask choice
and approvals. The conversation shows the
active app/action and a Stop button; **⌘⇧Esc** also stops active work when the shortcut is available.
and approvals. Stopping the chat response, or **⌘⇧Esc** when the shortcut is available, stops active
work; Settings shows the action in progress.
Stop cancels queued actions, in-flight authorization, approval prompts and the native helper.
Already completed input cannot be undone.

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/docs/desktop/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Sim can then use any app except terminals and scripting apps (Script Editor, Aut

Sim can read app windows and interact through clicks, text, keyboard shortcuts, scrolling, and supported accessibility controls. Screenshots and returned app content can be sent to your Sim deployment and model. Some actions require bringing the app to the foreground; app compatibility and macOS permissions can still limit what succeeds.

The conversation shows the active app and action. Select **Stop**, or press **Cmd + Shift + Escape** when that shortcut is available, to cancel active and queued computer actions. Stopping cannot undo input already delivered to an app. Verify the app's current state before repeating an interrupted action.
Stop the chat response, or press **Cmd + Shift + Escape** when that shortcut is available, to cancel active and queued computer actions. **Settings → Desktop → Computer Use** shows the action in progress. Stopping cannot undo input already delivered to an app. Verify the app's current state before repeating an interrupted action.

With **Ask before using a new app** on, use **Revoke** under **Approved apps** to remove a saved approval. Signing out or changing deployments clears the device opt-in and app approvals. Computer Use never operates Sim, macOS System Settings, password managers, terminals, or scripting apps.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import {
AssistantActionReviewMessage,
useHasAssistantActionReview,
} from '@/components/assistant-actions'
import { ComputerUseActivity } from '@/components/computer-use/activity'
import { SMOOTH_CHASE_RATE } from '@/lib/core/utils/smooth-bottom-chase'
import type { TurnOrigin } from '@/lib/mothership/generated/protocol'
import { inter } from '@/app/_styles/fonts/inter/inter'
Expand Down Expand Up @@ -1039,7 +1038,6 @@ export function MothershipChat({
onAnimationEnd={animateInput ? onInputAnimationEnd : undefined}
>
<div className={styles.footerInner}>
<ComputerUseActivity />
<QueuedMessages
messageQueue={messageQueue}
editingQueuedId={editingQueuedId}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/** @vitest-environment jsdom */
import { act } from 'react'
import type { ComputerUseActivity } from '@sim/desktop-bridge'
import { libDesktopMock, libDesktopMockFns } from '@sim/testing/mocks/lib-desktop.mock'
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import { createRoot, type Root } from 'react-dom/client'
Expand All @@ -15,11 +14,6 @@ import {
} from '@/stores/mothership-effort/store'

vi.mock('@/lib/desktop', () => libDesktopMock)
const native = vi.hoisted(() => ({
getActivity: vi.fn<() => Promise<ComputerUseActivity | null>>(),
onActivity: vi.fn<(listener: (activity: ComputerUseActivity | null) => void) => () => void>(),
cancel: vi.fn<() => Promise<void>>(),
}))
let root: Root
let container: HTMLDivElement
let client: QueryClient
Expand All @@ -36,10 +30,7 @@ beforeEach(() => {
useMothershipEffortStore.getState().reset()
useMothershipPlanEffortStore.getState().reset()
client = new QueryClient({ defaultOptions: { queries: { retry: false } } })
libDesktopMockFns.mockGetDesktopBridge.mockReturnValue({ computerUse: native })
native.getActivity.mockResolvedValue(null)
native.onActivity.mockReturnValue(() => {})
native.cancel.mockResolvedValue(undefined)
libDesktopMockFns.mockGetDesktopBridge.mockReturnValue(undefined)
container = document.createElement('div')
document.body.append(container)
root = createRoot(container)
Expand Down Expand Up @@ -108,30 +99,3 @@ it('hides the Plan model picker while its rollout is off but preserves the reque
fastMode: false,
})
})
it.each([undefined, 'workspace'])(
'chat %s exposes active native action and Stop while rollout is off',
async (workspaceId) => {
await render(false, workspaceId)
const listener = native.onActivity.mock.calls[0]?.[0]
expect(listener).toBeDefined()
if (!listener) throw new Error('Chat did not subscribe to native activity')
await act(async () =>
listener({
toolCallId: 'action',
scopeId: 'chat',
appName: 'Synthetic app',
action: 'type_text',
startedAt: 1,
stopShortcutAvailable: true,
})
)
const status = container.querySelector('[role="status"]')
expect(status?.textContent).toContain('Synthetic app · Typing')
const stop = status?.querySelector<HTMLButtonElement>('button')
expect(stop?.getAttribute('aria-keyshortcuts')).toBe('Meta+Shift+Escape')
await act(async () => stop?.click())
expect(native.cancel).toHaveBeenCalledOnce()
await act(async () => listener(null))
expect(container.querySelector('[role="status"]')).toBeNull()
}
)
Loading