peachsim 0.1.730 → 0.1.745
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/cli/bridge-flow-runner.ts +15 -2
- package/cli/commands/control.ts +13 -3
- package/cli/commands/desktop.ts +1 -0
- package/cli/commands/electron.ts +12 -8
- package/cli/commands/flow.ts +1 -3
- package/cli/commands/install-desktop.ts +105 -66
- package/cli/commands/logout.ts +5 -1
- package/cli/commands/no-bridge-hint.ts +2 -2
- package/cli/commands/swift.ts +26 -9
- package/cli/desktop-companion.ts +36 -9
- package/cli/drivers/desktop.ts +65 -0
- package/cli/drivers/electron.ts +4 -66
- package/cli/drivers/index.ts +1 -0
- package/cli/drivers/playwright.ts +3 -3
- package/cli/drivers/registry.ts +7 -2
- package/cli/drivers/types.ts +4 -3
- package/cli/maestro-js.ts +10 -0
- package/cli/outbound-endpoints.ts +2 -2
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/agent-identity.cjs +1 -1
- package/dist-lib/agent-sessions.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +39 -9
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +1 -1
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +1 -1
- package/dist-lib/capture-contract.cjs +13 -19
- package/dist-lib/capture-contract.mjs +13 -19
- package/dist-lib/cli-constants.cjs +1 -1
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +1 -1
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +1 -1
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/detox/index.cjs +20 -2
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/home-paths.cjs +32 -1
- package/dist-lib/host/bridge-host.cjs +1616 -532
- package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +14 -19
- package/dist-lib/jump-to-source-babel.cjs +1 -1
- package/dist-lib/jump-to-source-native.cjs +1 -1
- package/dist-lib/kotlin-host.cjs +1 -1
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +1 -1
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +1 -1
- package/dist-lib/metro-production-bundle.cjs +1 -1
- package/dist-lib/metro-production-bundle.mjs +1 -1
- package/dist-lib/metro.cjs +1 -1
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +1 -1
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +1 -1
- package/dist-lib/plist.cjs +1 -1
- package/dist-lib/plist.mjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +1 -1
- package/dist-lib/render-mode.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +2 -1
- package/dist-lib/sdk.mjs +2 -1
- package/dist-lib/skills.cjs +2306 -1067
- package/dist-lib/swift-compile.cjs +317 -60
- package/dist-lib/swift-compile.mjs +313 -61
- package/dist-lib/swift-package.cjs +146 -9
- package/dist-lib/swift-package.mjs +144 -9
- package/dist-lib/swift-submit.cjs +2 -2
- package/dist-lib/swift-submit.mjs +2 -2
- package/dist-lib/swift-toolchain.cjs +1 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +1310 -226
- package/dist-lib/vite.cjs +1 -1
- package/package.json +1 -1
- package/skills/contrast/SKILL.md +1 -1
- package/src/auth/shared-session.ts +45 -9
- package/src/bridge-constants.ts +7 -7
- package/src/capture-contract.ts +18 -33
- package/src/desktop-host-delivery.ts +81 -0
- package/src/home-paths.ts +30 -0
- package/src/host/bridge-host.ts +11 -6
- package/src/native-seam-manifest.ts +0 -11
- package/src/sim-client.ts +1 -0
- package/src/swift-compile.ts +403 -68
- package/src/swift-distribution.lock.json +11 -11
- package/src/swift-host.ts +316 -43
- package/src/swift-package.ts +204 -19
- package/src/swift-remote-packages.ts +255 -0
- package/src/swift-submit.ts +4 -1
- package/src/vite-plugin.ts +19 -8
- package/src/xcode-project.ts +527 -0
package/dist-lib/vite.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.745 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
package/package.json
CHANGED
package/skills/contrast/SKILL.md
CHANGED
|
@@ -19,7 +19,7 @@ automation, inspecting the render tree, and managing sims.
|
|
|
19
19
|
|
|
20
20
|
| command | description |
|
|
21
21
|
| --- | --- |
|
|
22
|
-
| `peach swift` | preview a SwiftPM app with live Swift edits, compiled on this machine |
|
|
22
|
+
| `peach swift` | preview a SwiftPM or Xcode app with live Swift edits, compiled on this machine |
|
|
23
23
|
| `peach kotlin` | run an Android Compose app module from its launcher activity |
|
|
24
24
|
| `peach maestro` | author, generate, and run Maestro YAML flows against peach |
|
|
25
25
|
| `peach detox` | run existing Detox suites against peach on headless Chromium |
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto'
|
|
1
2
|
import {
|
|
2
3
|
chmodSync,
|
|
3
4
|
existsSync,
|
|
4
5
|
mkdirSync,
|
|
5
6
|
readFileSync,
|
|
7
|
+
renameSync,
|
|
6
8
|
rmSync,
|
|
9
|
+
watch,
|
|
7
10
|
writeFileSync,
|
|
8
11
|
} from 'node:fs'
|
|
9
|
-
import { dirname, join, resolve } from 'node:path'
|
|
12
|
+
import { basename, dirname, join, resolve } from 'node:path'
|
|
10
13
|
import { electronUserDataDir } from '../home-paths.ts'
|
|
11
14
|
|
|
12
15
|
export type SharedDesktopAuthTeamSummary = {
|
|
@@ -184,7 +187,17 @@ export function writeSharedDesktopAuthSession(
|
|
|
184
187
|
validatedAt: session.validatedAt,
|
|
185
188
|
accountId: session.accountId?.trim() || undefined,
|
|
186
189
|
}
|
|
187
|
-
|
|
190
|
+
// readers and directory watchers see a complete session, including replacement writes.
|
|
191
|
+
const temporary = `${filepath}.${process.pid}.${randomUUID()}.tmp`
|
|
192
|
+
try {
|
|
193
|
+
writeFileSync(temporary, JSON.stringify(normalized, null, 2) + '\n', {
|
|
194
|
+
mode: 0o600,
|
|
195
|
+
flag: 'wx',
|
|
196
|
+
})
|
|
197
|
+
renameSync(temporary, filepath)
|
|
198
|
+
} finally {
|
|
199
|
+
rmSync(temporary, { force: true })
|
|
200
|
+
}
|
|
188
201
|
try {
|
|
189
202
|
chmodSync(filepath, 0o600)
|
|
190
203
|
} catch {
|
|
@@ -197,6 +210,25 @@ export function clearSharedDesktopAuthSession() {
|
|
|
197
210
|
rmSync(getSharedDesktopAuthFilePath(), { force: true })
|
|
198
211
|
}
|
|
199
212
|
|
|
213
|
+
export function watchSharedDesktopAuthSession(
|
|
214
|
+
changed: (session: SharedDesktopAuthSession | null) => void,
|
|
215
|
+
): () => void {
|
|
216
|
+
const filepath = getSharedDesktopAuthFilePath()
|
|
217
|
+
mkdirSync(dirname(filepath), { recursive: true })
|
|
218
|
+
const snapshot = (session: SharedDesktopAuthSession | null) =>
|
|
219
|
+
JSON.stringify([session?.token, session?.user, session?.origin, session?.accountId])
|
|
220
|
+
let previous = snapshot(readSharedDesktopAuthSession())
|
|
221
|
+
const watcher = watch(dirname(filepath), (_event, filename) => {
|
|
222
|
+
if (filename !== null && filename !== basename(filepath)) return
|
|
223
|
+
const session = readSharedDesktopAuthSession()
|
|
224
|
+
const next = snapshot(session)
|
|
225
|
+
if (next === previous) return
|
|
226
|
+
previous = next
|
|
227
|
+
changed(session)
|
|
228
|
+
})
|
|
229
|
+
return () => watcher.close()
|
|
230
|
+
}
|
|
231
|
+
|
|
200
232
|
export async function refreshSharedDesktopAuthSession(
|
|
201
233
|
originOverride?: string,
|
|
202
234
|
): Promise<SharedDesktopAuthSession | null> {
|
|
@@ -209,27 +241,31 @@ export async function refreshSharedDesktopAuthSession(
|
|
|
209
241
|
const res = await fetch(`${origin.replace(/\/$/, '')}/api/auth/me`, {
|
|
210
242
|
headers: { authorization: `Bearer ${current.token}` },
|
|
211
243
|
})
|
|
244
|
+
const body: unknown = res.ok ? await res.json() : null
|
|
245
|
+
const user =
|
|
246
|
+
body && typeof body === 'object' && 'user' in body ? normalizeUser(body.user) : null
|
|
247
|
+
const latest = readSharedDesktopAuthSession()
|
|
248
|
+
if (latest?.token !== current.token) return latest
|
|
212
249
|
if (res.status === 401) {
|
|
213
250
|
clearSharedDesktopAuthSession()
|
|
214
251
|
return null
|
|
215
252
|
}
|
|
216
|
-
if (!res.ok) return
|
|
253
|
+
if (!res.ok) return latest
|
|
217
254
|
|
|
218
|
-
|
|
219
|
-
if (!data.user?.id) {
|
|
255
|
+
if (!user) {
|
|
220
256
|
clearSharedDesktopAuthSession()
|
|
221
257
|
return null
|
|
222
258
|
}
|
|
223
259
|
|
|
224
260
|
return writeSharedDesktopAuthSession({
|
|
225
261
|
token: current.token,
|
|
226
|
-
user
|
|
262
|
+
user,
|
|
227
263
|
origin,
|
|
228
|
-
source:
|
|
264
|
+
source: latest.source,
|
|
229
265
|
validatedAt: new Date().toISOString(),
|
|
230
|
-
accountId:
|
|
266
|
+
accountId: latest.accountId,
|
|
231
267
|
})
|
|
232
268
|
} catch {
|
|
233
|
-
return
|
|
269
|
+
return readSharedDesktopAuthSession()
|
|
234
270
|
}
|
|
235
271
|
}
|
package/src/bridge-constants.ts
CHANGED
|
@@ -182,11 +182,11 @@ export const SOOTSIM_BRIDGE_SIM_CLOSE_REASON = 'sootsim close'
|
|
|
182
182
|
|
|
183
183
|
// automation sims (spawned by the playwright driver: `peach open --driver
|
|
184
184
|
// playwright`, the factory/screenshot capture path, `meta.sootsimHostDriver
|
|
185
|
-
// === 'playwright'`)
|
|
186
|
-
// one still renders at full rate (the host disables background
|
|
187
|
-
// captures see real motion).
|
|
188
|
-
//
|
|
189
|
-
//
|
|
190
|
-
//
|
|
191
|
-
// tree.
|
|
185
|
+
// === 'playwright'`) also serve people (`peach open` launches one by default),
|
|
186
|
+
// and an idle one still renders at full rate (the host disables background
|
|
187
|
+
// throttling so captures see real motion). a cli attached, which covers a long
|
|
188
|
+
// in-flight command such as a recording, a command within this window, or a
|
|
189
|
+
// person's input on the page within it proves one is in use. past it the
|
|
190
|
+
// bridge reaper closes the sim socket with the code above, the page asks its
|
|
191
|
+
// host to close, and the host exits with its chrome tree.
|
|
192
192
|
export const AUTOMATION_SIM_IDLE_REAP_TTL_MS = 5 * 60_000
|
package/src/capture-contract.ts
CHANGED
|
@@ -188,7 +188,11 @@ function isLiveRasterSource(node: RnxRasterRegionTree['nodes'][number]): boolean
|
|
|
188
188
|
|
|
189
189
|
export function selectRnxRasterNodeIds(tree: RnxRasterRegionTree): Set<number> {
|
|
190
190
|
const nodesById = new Map(tree.nodes.map((node) => [node.nodeId, node]))
|
|
191
|
-
const
|
|
191
|
+
const maxLayerArea = tree.width * tree.height * 0.25
|
|
192
|
+
// a layer over the per-layer cap never enters the atlas, so it cannot carry
|
|
193
|
+
// its descendants: a sheet's glass is too large, and the glass controls
|
|
194
|
+
// inside it still need their own regions.
|
|
195
|
+
const eligible = new Map<number, { nodeId: number; area: number; liveVideo: boolean }>()
|
|
192
196
|
for (const node of tree.nodes) {
|
|
193
197
|
const liveVideo = isLiveRasterSource(node)
|
|
194
198
|
const visibleFrame =
|
|
@@ -198,7 +202,7 @@ export function selectRnxRasterNodeIds(tree: RnxRasterRegionTree): Set<number> {
|
|
|
198
202
|
? node.frame
|
|
199
203
|
: (node.visibleFrame ?? node.frame)
|
|
200
204
|
if (!visibleFrame || visibleFrame.width <= 0 || visibleFrame.height <= 0) continue
|
|
201
|
-
|
|
205
|
+
const unsupported =
|
|
202
206
|
node.type === 'masked-view' ||
|
|
203
207
|
liveVideo ||
|
|
204
208
|
(node.type === 'text' &&
|
|
@@ -210,47 +214,28 @@ export function selectRnxRasterNodeIds(tree: RnxRasterRegionTree): Set<number> {
|
|
|
210
214
|
node.style._liquidGlass !== undefined ||
|
|
211
215
|
node.style._liquidGlassEdge !== undefined ||
|
|
212
216
|
node.style._liquidGlassMaterialTint !== undefined
|
|
213
|
-
|
|
214
|
-
|
|
217
|
+
const area = visibleFrame.width * visibleFrame.height
|
|
218
|
+
if (unsupported && (liveVideo || area <= maxLayerArea)) {
|
|
219
|
+
eligible.set(node.nodeId, { nodeId: node.nodeId, area, liveVideo })
|
|
215
220
|
}
|
|
216
221
|
}
|
|
217
|
-
|
|
218
|
-
for (const nodeId of [...unsupported]) {
|
|
222
|
+
for (const nodeId of [...eligible.keys()]) {
|
|
219
223
|
let parentNodeId = nodesById.get(nodeId)?.parentNodeId ?? null
|
|
220
224
|
while (parentNodeId !== null) {
|
|
221
|
-
if (
|
|
222
|
-
|
|
225
|
+
if (eligible.has(parentNodeId)) {
|
|
226
|
+
eligible.delete(nodeId)
|
|
223
227
|
break
|
|
224
228
|
}
|
|
225
229
|
parentNodeId = nodesById.get(parentNodeId)?.parentNodeId ?? null
|
|
226
230
|
}
|
|
227
231
|
}
|
|
228
|
-
|
|
232
|
+
const candidates = [...eligible.values()].sort(
|
|
233
|
+
(left, right) =>
|
|
234
|
+
Number(right.liveVideo) - Number(left.liveVideo) ||
|
|
235
|
+
left.area - right.area ||
|
|
236
|
+
left.nodeId - right.nodeId,
|
|
237
|
+
)
|
|
229
238
|
const screenArea = tree.width * tree.height
|
|
230
|
-
const maxLayerArea = screenArea * 0.25
|
|
231
|
-
const candidates = [...unsupported]
|
|
232
|
-
.map((nodeId) => {
|
|
233
|
-
const node = nodesById.get(nodeId)
|
|
234
|
-
if (!node) return null
|
|
235
|
-
const liveVideo = isLiveRasterSource(node)
|
|
236
|
-
const frame =
|
|
237
|
-
liveVideo &&
|
|
238
|
-
node.visibleFrame &&
|
|
239
|
-
(node.visibleFrame.width <= 0 || node.visibleFrame.height <= 0)
|
|
240
|
-
? node.frame
|
|
241
|
-
: (node.visibleFrame ?? node.frame)
|
|
242
|
-
return frame ? { nodeId, area: frame.width * frame.height, liveVideo } : null
|
|
243
|
-
})
|
|
244
|
-
.filter(
|
|
245
|
-
(candidate): candidate is { nodeId: number; area: number; liveVideo: boolean } =>
|
|
246
|
-
candidate !== null && (candidate.liveVideo || candidate.area <= maxLayerArea),
|
|
247
|
-
)
|
|
248
|
-
.sort(
|
|
249
|
-
(left, right) =>
|
|
250
|
-
Number(right.liveVideo) - Number(left.liveVideo) ||
|
|
251
|
-
left.area - right.area ||
|
|
252
|
-
left.nodeId - right.nodeId,
|
|
253
|
-
)
|
|
254
239
|
const selected = new Set<number>()
|
|
255
240
|
let atlasArea = 0
|
|
256
241
|
for (const candidate of candidates) {
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
// peach's binding of the shared runtime-delivery machinery for the native
|
|
2
|
+
// desktop host. the host releases on its own (packages/peach-desktop's Native
|
|
3
|
+
// Desktop Release workflow) and the CLI installs it by version under
|
|
4
|
+
// ~/.peach/desktop/<version>/, exactly as `peach runtime install` manages the
|
|
5
|
+
// engine runtime. each channel publishes its own manifest per platform, so the
|
|
6
|
+
// staging and production queues never write the same object.
|
|
7
|
+
|
|
8
|
+
import path from 'node:path'
|
|
9
|
+
import { createRuntimeDelivery, type RuntimeDelivery } from '@contrast/runtime-delivery'
|
|
10
|
+
import {
|
|
11
|
+
cacheDir,
|
|
12
|
+
desktopHostDir,
|
|
13
|
+
desktopHostsDir,
|
|
14
|
+
ensureRnxHome,
|
|
15
|
+
readActiveDesktopHost,
|
|
16
|
+
writeActiveDesktopHost,
|
|
17
|
+
} from './home-paths.ts'
|
|
18
|
+
|
|
19
|
+
export const DESKTOP_HOST_CDN_ORIGIN = 'https://r2.rnxsim.com'
|
|
20
|
+
export const DESKTOP_HOST_CHANNELS = ['production', 'staging'] as const
|
|
21
|
+
export type DesktopHostChannel = (typeof DESKTOP_HOST_CHANNELS)[number]
|
|
22
|
+
const CHANNEL_ENV = 'PEACH_DESKTOP_CHANNEL'
|
|
23
|
+
|
|
24
|
+
/** the artifact platform this machine installs, or null where no host ships. */
|
|
25
|
+
export function desktopHostPlatform(): 'mac-arm64' | null {
|
|
26
|
+
if (process.platform === 'darwin' && process.arch === 'arm64') return 'mac-arm64'
|
|
27
|
+
return null
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** the executable inside an installed version, relative to its directory. */
|
|
31
|
+
export function desktopHostExecutable(): string {
|
|
32
|
+
return 'PeachDesktop.app/Contents/MacOS/PeachDesktop'
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** the app bundle of the active installed version, or null when none is. */
|
|
36
|
+
export function activeDesktopHostApp(): string | null {
|
|
37
|
+
const version = readActiveDesktopHost()
|
|
38
|
+
return version ? path.join(desktopHostDir(version), 'PeachDesktop.app') : null
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function isChannel(value: string): value is DesktopHostChannel {
|
|
42
|
+
return DESKTOP_HOST_CHANNELS.some((channel) => channel === value)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function desktopHostDelivery(channelInput?: string): RuntimeDelivery {
|
|
46
|
+
const platform = desktopHostPlatform()
|
|
47
|
+
if (!platform) {
|
|
48
|
+
throw new Error(
|
|
49
|
+
`the native desktop host ships for macOS arm64 only (this is ${process.platform}-${process.arch})`,
|
|
50
|
+
)
|
|
51
|
+
}
|
|
52
|
+
const channel = channelInput || process.env[CHANNEL_ENV] || 'production'
|
|
53
|
+
if (!isChannel(channel)) {
|
|
54
|
+
throw new Error(
|
|
55
|
+
`unknown desktop channel '${channel}' (use ${DESKTOP_HOST_CHANNELS.join(' or ')})`,
|
|
56
|
+
)
|
|
57
|
+
}
|
|
58
|
+
const prefix = `/releases/native/${channel}`
|
|
59
|
+
return createRuntimeDelivery({
|
|
60
|
+
id: 'peach desktop',
|
|
61
|
+
defaultCdnOrigin: DESKTOP_HOST_CDN_ORIGIN,
|
|
62
|
+
manifestPath: `${prefix}/manifest-${platform}.json`,
|
|
63
|
+
tarballPath: (version) =>
|
|
64
|
+
`${prefix}/${version}/PeachDesktop-${version}-${platform}.zip`,
|
|
65
|
+
installedMarker: desktopHostExecutable(),
|
|
66
|
+
env: {
|
|
67
|
+
cdnOrigin: 'PEACH_DESKTOP_CDN_ORIGIN',
|
|
68
|
+
channel: CHANNEL_ENV,
|
|
69
|
+
pin: 'PEACH_DESKTOP_VERSION',
|
|
70
|
+
},
|
|
71
|
+
defaultChannel: channel,
|
|
72
|
+
ensureHome: ensureRnxHome,
|
|
73
|
+
// the engine runtime owns ~/.peach/config.json's channel and pin keys
|
|
74
|
+
configFile: () => path.join(desktopHostsDir(), 'config.json'),
|
|
75
|
+
runtimesDir: desktopHostsDir,
|
|
76
|
+
runtimeDir: desktopHostDir,
|
|
77
|
+
cacheDir,
|
|
78
|
+
readActiveRuntime: readActiveDesktopHost,
|
|
79
|
+
writeActiveRuntime: writeActiveDesktopHost,
|
|
80
|
+
})
|
|
81
|
+
}
|
package/src/home-paths.ts
CHANGED
|
@@ -118,6 +118,36 @@ export function activeRuntimeFile(): string {
|
|
|
118
118
|
return path.join(runtimesDir(), ACTIVE_RUNTIME_FILE)
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
+
// versioned native desktop hosts, laid out like runtimes: one directory per
|
|
122
|
+
// version plus an `active` file naming the one `peach desktop` launches.
|
|
123
|
+
export function desktopHostsDir(): string {
|
|
124
|
+
return path.join(rnxHomeDir(), 'desktop')
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export function desktopHostDir(version: string): string {
|
|
128
|
+
return path.join(desktopHostsDir(), version)
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export function readActiveDesktopHost(): string | null {
|
|
132
|
+
try {
|
|
133
|
+
const value = fs
|
|
134
|
+
.readFileSync(path.join(desktopHostsDir(), ACTIVE_RUNTIME_FILE), 'utf8')
|
|
135
|
+
.trim()
|
|
136
|
+
return value.length > 0 ? value : null
|
|
137
|
+
} catch {
|
|
138
|
+
return null
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export function writeActiveDesktopHost(version: string): void {
|
|
143
|
+
fs.mkdirSync(desktopHostsDir(), { recursive: true })
|
|
144
|
+
fs.writeFileSync(
|
|
145
|
+
path.join(desktopHostsDir(), ACTIVE_RUNTIME_FILE),
|
|
146
|
+
`${version}\n`,
|
|
147
|
+
'utf8',
|
|
148
|
+
)
|
|
149
|
+
}
|
|
150
|
+
|
|
121
151
|
export function electronDir(): string {
|
|
122
152
|
return path.join(rnxHomeDir(), 'electron')
|
|
123
153
|
}
|
package/src/host/bridge-host.ts
CHANGED
|
@@ -789,9 +789,14 @@ export class SootSimBridgeHost {
|
|
|
789
789
|
return
|
|
790
790
|
}
|
|
791
791
|
|
|
792
|
-
// a
|
|
793
|
-
//
|
|
794
|
-
|
|
792
|
+
// a person's input anywhere on the page, and a capture the page is
|
|
793
|
+
// still running after its cli exited (`peach record start`), are use
|
|
794
|
+
// the idle reaper cannot see in cli traffic.
|
|
795
|
+
if (
|
|
796
|
+
(msg.type === 'bridge:user-present' ||
|
|
797
|
+
msg.type === 'bridge:capture-active') &&
|
|
798
|
+
sim
|
|
799
|
+
) {
|
|
795
800
|
sim.lastActiveAt = Date.now()
|
|
796
801
|
return
|
|
797
802
|
}
|
|
@@ -2020,9 +2025,9 @@ export class SootSimBridgeHost {
|
|
|
2020
2025
|
if (attachedSimIds.has(sim.id)) continue
|
|
2021
2026
|
const automation = this.isAutomationSim(sim)
|
|
2022
2027
|
const lease = this.getActiveLease(sim)
|
|
2023
|
-
//
|
|
2024
|
-
//
|
|
2025
|
-
//
|
|
2028
|
+
// being primary or holding a cli lease (10 min from its last grant) says
|
|
2029
|
+
// nothing about an automation sim's use: only a person's input
|
|
2030
|
+
// (lastActiveAt, or a live user-active lease) keeps one past its window.
|
|
2026
2031
|
if (
|
|
2027
2032
|
automation ? lease?.kind === 'user-active' : sim.id === this.primarySimId || lease
|
|
2028
2033
|
) {
|
|
@@ -140,17 +140,6 @@ export const NATIVE_SEAM_MANIFEST: NativeSeamEntry[] = [
|
|
|
140
140
|
notes:
|
|
141
141
|
'ASAuthorizationAppleIDButton native view — render the system button surface while upstream AppleAuthenticationButton.tsx remains unchanged',
|
|
142
142
|
},
|
|
143
|
-
{
|
|
144
|
-
pkg: 'expo-asset',
|
|
145
|
-
// src/ExpoAsset.ts — `requireNativeModule('ExpoAsset')`; only
|
|
146
|
-
// `downloadAsync` is on the native surface. all the rest (`Asset`,
|
|
147
|
-
// `AssetHooks`, `AssetSourceResolver`, ...) is pure JS that composes on
|
|
148
|
-
// top.
|
|
149
|
-
seamBasenames: ['ExpoAsset'],
|
|
150
|
-
target: seamPath('expo-asset'),
|
|
151
|
-
notes:
|
|
152
|
-
'expo-modules-core requireNativeModule(ExpoAsset) — only downloadAsync; mirror upstream web build (return remote URL)',
|
|
153
|
-
},
|
|
154
143
|
{
|
|
155
144
|
pkg: '@bam.tech/react-native-image-resizer',
|
|
156
145
|
// a Metro bundle reaches the same seam through the ImageResizer
|