peachsim 0.1.754 → 0.1.755
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/commands/daemon.ts +117 -116
- package/cli/commands/install-desktop.ts +13 -8
- package/cli/desktop-companion.ts +9 -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 +8 -5
- 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 +1 -1
- package/dist-lib/capture-contract.mjs +1 -1
- 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 +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/home-paths.cjs +2 -23
- package/dist-lib/host/bridge-host.cjs +8 -3
- 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 +1 -1
- 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 +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +44 -39
- package/dist-lib/swift-compile.cjs +6 -2
- package/dist-lib/swift-compile.mjs +6 -2
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +1 -1
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +1 -1
- package/dist-lib/swift-toolchain.cjs +1 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +6 -2
- package/dist-lib/vite.cjs +1 -1
- package/package.json +1 -1
- package/src/auth/shared-session.ts +9 -4
- package/src/desktop-host-delivery.ts +82 -19
- package/src/home-paths.ts +5 -22
- package/src/host/agent-host.ts +4 -1
- package/src/swift-compile.ts +4 -0
package/dist-lib/vite-swift.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.755 | (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;
|
|
@@ -831,7 +831,11 @@ var OPTIONAL_FRAMEWORK_DEPENDENCIES = {
|
|
|
831
831
|
DatadogCore: [],
|
|
832
832
|
DatadogLogs: ["DatadogCore"],
|
|
833
833
|
DatadogRUM: ["DatadogCore"],
|
|
834
|
-
DatadogTrace: ["DatadogCore"]
|
|
834
|
+
DatadogTrace: ["DatadogCore"],
|
|
835
|
+
AppLovinSDK: [],
|
|
836
|
+
AppsFlyerLib: [],
|
|
837
|
+
FBSDKCoreKit: [],
|
|
838
|
+
FBAudienceNetwork: []
|
|
835
839
|
};
|
|
836
840
|
var OPTIONAL_FRAMEWORKS = new Set(Object.keys(OPTIONAL_FRAMEWORK_DEPENDENCIES));
|
|
837
841
|
var SWIFT_IMPORT = /^\s*(?:@\w+(?:\([^)]*\))?\s+)*import\s+(?:(?:typealias|struct|class|enum|protocol|let|var|func)\s+)?([A-Za-z_][A-Za-z0-9_]*)/;
|
package/dist-lib/vite.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.755 | (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
|
@@ -177,15 +177,20 @@ export function writeSharedDesktopAuthSession(
|
|
|
177
177
|
) {
|
|
178
178
|
const filepath = getSharedDesktopAuthFilePath()
|
|
179
179
|
mkdirSync(dirname(filepath), { recursive: true })
|
|
180
|
+
const token = session.token.trim()
|
|
181
|
+
// a write of the session already stored (a page echoing what it adopted, or
|
|
182
|
+
// refreshing its user) keeps where that session came from and its account
|
|
183
|
+
const stored = readSharedDesktopAuthSession()
|
|
184
|
+
const same = stored?.token === token ? stored : null
|
|
180
185
|
const normalized: SharedDesktopAuthSession = {
|
|
181
186
|
version: SESSION_VERSION,
|
|
182
|
-
token
|
|
187
|
+
token,
|
|
183
188
|
user: session.user ? normalizeUser(session.user) : null,
|
|
184
189
|
origin: session.origin?.trim() || DEFAULT_ORIGIN,
|
|
185
|
-
source: session.source,
|
|
190
|
+
source: same?.source ?? session.source,
|
|
186
191
|
updatedAt: session.updatedAt || new Date().toISOString(),
|
|
187
|
-
validatedAt: session.validatedAt,
|
|
188
|
-
accountId: session.accountId?.trim() ||
|
|
192
|
+
validatedAt: session.validatedAt ?? same?.validatedAt,
|
|
193
|
+
accountId: session.accountId?.trim() || same?.accountId,
|
|
189
194
|
}
|
|
190
195
|
// readers and directory watchers see a complete session, including replacement writes.
|
|
191
196
|
const temporary = `${filepath}.${process.pid}.${randomUUID()}.tmp`
|
|
@@ -1,21 +1,18 @@
|
|
|
1
1
|
// peach's binding of the shared runtime-delivery machinery for the native
|
|
2
2
|
// desktop host. the host releases on its own (packages/peach-desktop's Native
|
|
3
|
-
// Desktop Release workflow) and the CLI
|
|
4
|
-
// ~/.peach/desktop/<version>/, exactly as `peach runtime install` manages
|
|
5
|
-
// engine runtime.
|
|
6
|
-
//
|
|
3
|
+
// Desktop Release workflow) and the CLI downloads and verifies each version
|
|
4
|
+
// into ~/.peach/desktop/versions/<version>/, exactly as `peach runtime install` manages
|
|
5
|
+
// the engine runtime. the active version is the one at /Applications/Peach.app,
|
|
6
|
+
// where Spotlight finds it and the CLI, the fleet installer and the app's own
|
|
7
|
+
// updater share it. each channel publishes its own manifest per platform, so
|
|
8
|
+
// the staging and production queues never write the same object.
|
|
7
9
|
|
|
8
10
|
import { spawnSync } from 'node:child_process'
|
|
11
|
+
import fs from 'node:fs'
|
|
12
|
+
import os from 'node:os'
|
|
9
13
|
import path from 'node:path'
|
|
10
14
|
import { createRuntimeDelivery, type RuntimeDelivery } from '@contrast/runtime-delivery'
|
|
11
|
-
import {
|
|
12
|
-
cacheDir,
|
|
13
|
-
desktopHostDir,
|
|
14
|
-
desktopHostsDir,
|
|
15
|
-
ensureRnxHome,
|
|
16
|
-
readActiveDesktopHost,
|
|
17
|
-
writeActiveDesktopHost,
|
|
18
|
-
} from './home-paths.ts'
|
|
15
|
+
import { cacheDir, desktopHostDir, desktopHostsDir, ensureRnxHome } from './home-paths.ts'
|
|
19
16
|
|
|
20
17
|
export const DESKTOP_HOST_CDN_ORIGIN = 'https://r2.rnxsim.com'
|
|
21
18
|
export const DESKTOP_HOST_CHANNELS = ['production', 'staging'] as const
|
|
@@ -33,11 +30,8 @@ export function desktopHostExecutable(): string {
|
|
|
33
30
|
return 'PeachDesktop.app/Contents/MacOS/PeachDesktop'
|
|
34
31
|
}
|
|
35
32
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const version = readActiveDesktopHost()
|
|
39
|
-
return version ? path.join(desktopHostDir(version), 'PeachDesktop.app') : null
|
|
40
|
-
}
|
|
33
|
+
export const MAC_HOST_APP = '/Applications/Peach.app'
|
|
34
|
+
const HOST_BUNDLE_ID = 'dev.contrast.peach-desktop'
|
|
41
35
|
|
|
42
36
|
// the host's identity: the manifest checksum proves the bytes are the published
|
|
43
37
|
// ones, this proves who signed them
|
|
@@ -60,6 +54,75 @@ function verifyHost(dir: string): void {
|
|
|
60
54
|
}
|
|
61
55
|
}
|
|
62
56
|
|
|
57
|
+
function bundleValue(app: string, key: string): string | null {
|
|
58
|
+
const read = spawnSync(
|
|
59
|
+
'plutil',
|
|
60
|
+
['-extract', key, 'raw', '-o', '-', path.join(app, 'Contents/Info.plist')],
|
|
61
|
+
{ encoding: 'utf8' },
|
|
62
|
+
)
|
|
63
|
+
return read.status === 0 ? read.stdout.trim() : null
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** whether `app` is the native host, as opposed to the Electron app, which
|
|
67
|
+
* installs to the same path on a case-insensitive disk. */
|
|
68
|
+
export function isNativeHostBundle(app: string): boolean {
|
|
69
|
+
return (
|
|
70
|
+
process.platform === 'darwin' &&
|
|
71
|
+
bundleValue(app, 'CFBundleIdentifier') === HOST_BUNDLE_ID
|
|
72
|
+
)
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function placedHostVersion(): string | null {
|
|
76
|
+
return isNativeHostBundle(MAC_HOST_APP)
|
|
77
|
+
? bundleValue(MAC_HOST_APP, 'CFBundleVersion')
|
|
78
|
+
: null
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** the active native host's app bundle, or null when none is installed. */
|
|
82
|
+
export function activeDesktopHostApp(): string | null {
|
|
83
|
+
return placedHostVersion() ? MAC_HOST_APP : null
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function run(command: string, args: string[]): void {
|
|
87
|
+
const result = spawnSync(command, args, { encoding: 'utf8' })
|
|
88
|
+
if (result.status !== 0)
|
|
89
|
+
throw new Error(`${command} ${args.join(' ')} failed: ${result.stderr.trim()}`)
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// lands a verified cached version at /Applications/Peach.app. the copy is an
|
|
93
|
+
// APFS clone of the cache, so it costs no space, and it swaps in by rename so a
|
|
94
|
+
// failure leaves the previous app in place. an Electron app in the slot moves to
|
|
95
|
+
// ~/Applications, where the CLI still finds it.
|
|
96
|
+
function placeHost(version: string): void {
|
|
97
|
+
if (placedHostVersion() === version) return
|
|
98
|
+
const parent = path.dirname(MAC_HOST_APP)
|
|
99
|
+
const incoming = path.join(parent, `.Peach-incoming-${process.pid}.app`)
|
|
100
|
+
const previous = path.join(parent, `.Peach-previous-${process.pid}.app`)
|
|
101
|
+
run('cp', ['-cR', path.join(desktopHostDir(version), 'PeachDesktop.app'), incoming])
|
|
102
|
+
try {
|
|
103
|
+
if (fs.existsSync(MAC_HOST_APP)) {
|
|
104
|
+
if (isNativeHostBundle(MAC_HOST_APP)) fs.renameSync(MAC_HOST_APP, previous)
|
|
105
|
+
else {
|
|
106
|
+
const electron = path.join(os.homedir(), 'Applications/peach.app')
|
|
107
|
+
if (fs.existsSync(electron))
|
|
108
|
+
throw new Error(
|
|
109
|
+
`${MAC_HOST_APP} holds another app and ${electron} exists; move one aside`,
|
|
110
|
+
)
|
|
111
|
+
fs.mkdirSync(path.dirname(electron), { recursive: true })
|
|
112
|
+
fs.renameSync(MAC_HOST_APP, electron)
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
fs.renameSync(incoming, MAC_HOST_APP)
|
|
116
|
+
} catch (err) {
|
|
117
|
+
if (fs.existsSync(previous) && !fs.existsSync(MAC_HOST_APP))
|
|
118
|
+
fs.renameSync(previous, MAC_HOST_APP)
|
|
119
|
+
throw err
|
|
120
|
+
} finally {
|
|
121
|
+
fs.rmSync(incoming, { recursive: true, force: true })
|
|
122
|
+
fs.rmSync(previous, { recursive: true, force: true })
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
63
126
|
function isChannel(value: string): value is DesktopHostChannel {
|
|
64
127
|
return DESKTOP_HOST_CHANNELS.some((channel) => channel === value)
|
|
65
128
|
}
|
|
@@ -98,7 +161,7 @@ export function desktopHostDelivery(channelInput?: string): RuntimeDelivery {
|
|
|
98
161
|
runtimesDir: desktopHostsDir,
|
|
99
162
|
runtimeDir: desktopHostDir,
|
|
100
163
|
cacheDir,
|
|
101
|
-
readActiveRuntime:
|
|
102
|
-
writeActiveRuntime:
|
|
164
|
+
readActiveRuntime: placedHostVersion,
|
|
165
|
+
writeActiveRuntime: placeHost,
|
|
103
166
|
})
|
|
104
167
|
}
|
package/src/home-paths.ts
CHANGED
|
@@ -119,35 +119,18 @@ export function activeRuntimeFile(): string {
|
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
// versioned native desktop hosts, laid out like runtimes: one directory per
|
|
122
|
-
// version
|
|
122
|
+
// version. the active one is the copy at /Applications/Peach.app. they sit
|
|
123
|
+
// apart from the host's own state in ~/.peach/desktop (profiles, window state,
|
|
124
|
+
// the node host's web data), since pruning removes every directory here that is
|
|
125
|
+
// not a kept version.
|
|
123
126
|
export function desktopHostsDir(): string {
|
|
124
|
-
return path.join(rnxHomeDir(), 'desktop')
|
|
127
|
+
return path.join(rnxHomeDir(), 'desktop', 'versions')
|
|
125
128
|
}
|
|
126
129
|
|
|
127
130
|
export function desktopHostDir(version: string): string {
|
|
128
131
|
return path.join(desktopHostsDir(), version)
|
|
129
132
|
}
|
|
130
133
|
|
|
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
|
-
|
|
151
134
|
export function electronDir(): string {
|
|
152
135
|
return path.join(rnxHomeDir(), 'electron')
|
|
153
136
|
}
|
package/src/host/agent-host.ts
CHANGED
|
@@ -397,12 +397,14 @@ export class AgentHost {
|
|
|
397
397
|
if (sockets.has(sessionId)) {
|
|
398
398
|
return { ok: true, refCount: this.subscriptions.get(sessionId)?.refCount ?? 1 }
|
|
399
399
|
}
|
|
400
|
-
sockets.add(sessionId)
|
|
401
400
|
const existing = this.subscriptions.get(sessionId)
|
|
402
401
|
if (existing) {
|
|
402
|
+
sockets.add(sessionId)
|
|
403
403
|
existing.refCount++
|
|
404
404
|
return { ok: true, refCount: existing.refCount }
|
|
405
405
|
}
|
|
406
|
+
// the socket holds the session only once its events open: a missing FIFO
|
|
407
|
+
// throws here and leaves nothing behind for a retry to count
|
|
406
408
|
const unsubscribe = subscribeAgentEvents(sessionId, (event) => {
|
|
407
409
|
const coalesced = this.coalescePromptEcho(sessionId, event)
|
|
408
410
|
if (coalesced) {
|
|
@@ -427,6 +429,7 @@ export class AgentHost {
|
|
|
427
429
|
}
|
|
428
430
|
}
|
|
429
431
|
})
|
|
432
|
+
sockets.add(sessionId)
|
|
430
433
|
this.subscriptions.set(sessionId, { unsubscribe, refCount: 1 })
|
|
431
434
|
return { ok: true, refCount: 1 }
|
|
432
435
|
}
|
package/src/swift-compile.ts
CHANGED
|
@@ -263,6 +263,10 @@ const OPTIONAL_FRAMEWORK_DEPENDENCIES: Record<string, string[]> = {
|
|
|
263
263
|
DatadogLogs: ['DatadogCore'],
|
|
264
264
|
DatadogRUM: ['DatadogCore'],
|
|
265
265
|
DatadogTrace: ['DatadogCore'],
|
|
266
|
+
AppLovinSDK: [],
|
|
267
|
+
AppsFlyerLib: [],
|
|
268
|
+
FBSDKCoreKit: [],
|
|
269
|
+
FBAudienceNetwork: [],
|
|
266
270
|
}
|
|
267
271
|
const OPTIONAL_FRAMEWORKS = new Set(Object.keys(OPTIONAL_FRAMEWORK_DEPENDENCIES))
|
|
268
272
|
|