Skip to content

Commit 1dd85eb

Browse files
authored
improvement(desktop): add apple signing, fix some bugs (#6519)
* feat(desktop): sync updater and shell refinements * style(desktop): refine macOS installer layout * chore(desktop): trigger updated prerelease * Unify resource panel collapse controls * Desktop improvemetns * Update * browser updates * fix(desktop): harden browser and terminal tab activity
1 parent 6d3e484 commit 1dd85eb

132 files changed

Lines changed: 7417 additions & 990 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/desktop-e2e.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ concurrency:
1717
jobs:
1818
e2e:
1919
name: E2E (${{ matrix.electron }})
20-
runs-on: macos-14
20+
runs-on: macos-26
2121
strategy:
2222
fail-fast: false
2323
matrix:
@@ -58,7 +58,7 @@ jobs:
5858

5959
package-smoke:
6060
name: Unsigned package smoke
61-
runs-on: macos-14
61+
runs-on: macos-26
6262
steps:
6363
- name: Checkout code
6464
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6

.github/workflows/desktop-release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ permissions:
4949
jobs:
5050
build-sign-notarize:
5151
name: Build, Sign, Notarize
52-
runs-on: macos-14
52+
runs-on: macos-26
5353
steps:
5454
- name: Checkout code
5555
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
@@ -167,8 +167,8 @@ jobs:
167167
if: ${{ inputs.sign }}
168168
run: |
169169
DMG="$(ls apps/desktop/release/*.dmg | head -1)"
170-
xcrun stapler validate "$DMG"
171170
hdiutil attach "$DMG" -mountpoint /tmp/sim-dmg -nobrowse -quiet
171+
xcrun stapler validate /tmp/sim-dmg/*.app
172172
spctl --assess --type execute --verbose /tmp/sim-dmg/*.app
173173
codesign --verify --deep --strict /tmp/sim-dmg/*.app
174174
hdiutil detach /tmp/sim-dmg -quiet
240 KB
Loading
682 KB
Loading

apps/desktop/build/entitlements.mac.plist

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,10 @@
44
<dict>
55
<key>com.apple.security.cs.allow-jit</key>
66
<true/>
7+
<!-- Hardened Runtime blocks microphone capture without this, so the
8+
composer's voice input fails with NotAllowedError in signed builds
9+
even after the user grants access in System Settings. -->
10+
<key>com.apple.security.device.audio-input</key>
11+
<true/>
712
</dict>
813
</plist>

apps/desktop/electron-builder.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,32 @@ mac:
5454
mergeASARs: false
5555
hardenedRuntime: true
5656
gatekeeperAssess: false
57+
# macOS refuses to show the microphone prompt at all — it kills the process —
58+
# unless the bundle declares why it wants the device.
59+
extendInfo:
60+
NSMicrophoneUsageDescription: Sim uses your microphone for voice input in Chat.
5761
entitlements: build/entitlements.mac.plist
5862
entitlementsInherit: build/entitlements.mac.plist
5963
notarize: true
6064

6165
dmg:
6266
sign: false
67+
title: ${productName}
68+
# Finder uses the image dimensions as the installer window dimensions. The
69+
# @2x companion is detected automatically and keeps the mountain artwork and
70+
# install arrow sharp on Retina displays.
71+
background: build/dmg-background.png
72+
iconSize: 96
73+
iconTextSize: 13
74+
# Keep both icon centers inside the compact 660x420 Finder canvas.
75+
contents:
76+
- x: 165
77+
y: 210
78+
type: file
79+
- x: 495
80+
y: 210
81+
type: link
82+
path: /Applications
6383

6484
# node-pty ships pure N-API prebuilds, which are ABI-stable across Node and
6585
# Electron versions, so there is nothing to rebuild against Electron's ABI.

apps/desktop/src/main/browser-agent/cdp.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ export interface CdpCallbacks {
3636
const callbacksByContents = new WeakMap<WebContents, CdpCallbacks>()
3737
/** Contents already instrumented (attach survives for the tab's lifetime). */
3838
const instrumented = new WeakSet<WebContents>()
39+
/** Tracks trusted input currently being dispatched by the agent itself. */
40+
const agentInputDepthByContents = new WeakMap<WebContents, number>()
3941
/** Flattened CDP child-target sessions keyed by their protocol frame/target id. */
4042
const childSessionsByContents = new WeakMap<WebContents, Map<string, string>>()
4143
const FRAME_WORLD_NAME = 'sim-browser-agent'
@@ -62,6 +64,7 @@ async function sendInput(
6264
method: string,
6365
params: Record<string, unknown>
6466
): Promise<void> {
67+
agentInputDepthByContents.set(contents, (agentInputDepthByContents.get(contents) ?? 0) + 1)
6568
let timer: NodeJS.Timeout | undefined
6669
const timeout = new Promise<never>((_resolve, reject) => {
6770
timer = setTimeout(
@@ -73,9 +76,17 @@ async function sendInput(
7376
await Promise.race([send(contents, method, params), timeout])
7477
} finally {
7578
clearTimeout(timer)
79+
const nextDepth = (agentInputDepthByContents.get(contents) ?? 1) - 1
80+
if (nextDepth > 0) agentInputDepthByContents.set(contents, nextDepth)
81+
else agentInputDepthByContents.delete(contents)
7682
}
7783
}
7884

85+
/** Distinguishes user input from CDP input when Electron mirrors it as an event. */
86+
export function isDispatchingAgentInput(contents: WebContents): boolean {
87+
return (agentInputDepthByContents.get(contents) ?? 0) > 0
88+
}
89+
7990
/** Idempotently instruments a tab's WebContents. */
8091
export async function ensureInstrumented(contents: WebContents, cb: CdpCallbacks): Promise<void> {
8192
callbacksByContents.set(contents, cb)

0 commit comments

Comments
 (0)