peachsim 0.1.729 → 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 +1617 -533
- 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 +2307 -1068
- package/dist-lib/swift-compile.cjs +318 -61
- package/dist-lib/swift-compile.mjs +314 -62
- 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 +1311 -227
- 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 +404 -69
- 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
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
// desktop drivers: `desktop` launches the native host, `electron` the
|
|
2
|
+
// Electron companion. both wrap the desktop-companion helpers, which already
|
|
3
|
+
// handle mac `open -a`, linux AppImage and the --device seed.
|
|
4
|
+
|
|
5
|
+
import { findDesktopCompanion, launchDesktopCompanion } from '../desktop-companion'
|
|
6
|
+
import type {
|
|
7
|
+
Driver,
|
|
8
|
+
DriverAvailability,
|
|
9
|
+
DriverLaunchOptions,
|
|
10
|
+
DriverLaunchResult,
|
|
11
|
+
} from './types'
|
|
12
|
+
|
|
13
|
+
export function createDesktopDriver(id: 'desktop' | 'electron'): Driver {
|
|
14
|
+
const native = id === 'desktop'
|
|
15
|
+
const missing = `peach ${id} app not installed (run \`peach desktop install${native ? ' --native' : ''}\`)`
|
|
16
|
+
function probe(): DriverAvailability {
|
|
17
|
+
const install = findDesktopCompanion({ native })
|
|
18
|
+
if (!install) return { available: false, reason: missing }
|
|
19
|
+
return {
|
|
20
|
+
available: true,
|
|
21
|
+
reason: null,
|
|
22
|
+
detail: `${install.kind} @ ${install.path}`,
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
async function launch(opts: DriverLaunchOptions): Promise<DriverLaunchResult> {
|
|
27
|
+
try {
|
|
28
|
+
const install = findDesktopCompanion({ native })
|
|
29
|
+
if (!install) return { launched: false, message: missing }
|
|
30
|
+
const result = await launchDesktopCompanion(opts.url, install, {
|
|
31
|
+
device: opts.device,
|
|
32
|
+
profileId: opts.profileId,
|
|
33
|
+
ephemeralProfile: opts.ephemeralProfile,
|
|
34
|
+
ownerPid: opts.ownerPid,
|
|
35
|
+
})
|
|
36
|
+
if (!result.launched) {
|
|
37
|
+
return { launched: false, message: 'desktop companion failed to start' }
|
|
38
|
+
}
|
|
39
|
+
return {
|
|
40
|
+
launched: true,
|
|
41
|
+
message: `${install.kind === 'native-mac-app' ? 'native desktop' : 'electron'} launched via ${result.via}${opts.url ? ` → ${opts.url}` : ''}`,
|
|
42
|
+
target: result.target,
|
|
43
|
+
attachUrl: opts.url,
|
|
44
|
+
}
|
|
45
|
+
} catch (err) {
|
|
46
|
+
return {
|
|
47
|
+
launched: false,
|
|
48
|
+
message: `${id} launch failed: ${err instanceof Error ? err.message : String(err)}`,
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return {
|
|
54
|
+
id,
|
|
55
|
+
name: id,
|
|
56
|
+
description: native
|
|
57
|
+
? 'native desktop host (macOS arm64; native window, menu bar)'
|
|
58
|
+
: 'peach desktop companion app (Electron; native window, menu bar)',
|
|
59
|
+
kind: 'native',
|
|
60
|
+
availability: probe,
|
|
61
|
+
launch,
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export const desktopDriver = createDesktopDriver('desktop')
|
package/cli/drivers/electron.ts
CHANGED
|
@@ -1,68 +1,6 @@
|
|
|
1
|
-
// electron driver
|
|
2
|
-
//
|
|
3
|
-
// to launchDesktopCompanion, which already handles mac `open -a`, linux
|
|
4
|
-
// AppImage, and the --device seed.
|
|
1
|
+
// electron driver: the Electron desktop companion, until the native host
|
|
2
|
+
// (the `desktop` driver) replaces it.
|
|
5
3
|
|
|
6
|
-
import {
|
|
7
|
-
import type {
|
|
8
|
-
Driver,
|
|
9
|
-
DriverAvailability,
|
|
10
|
-
DriverLaunchOptions,
|
|
11
|
-
DriverLaunchResult,
|
|
12
|
-
} from './types'
|
|
4
|
+
import { createDesktopDriver } from './desktop'
|
|
13
5
|
|
|
14
|
-
|
|
15
|
-
const install = findDesktopCompanion()
|
|
16
|
-
if (!install) {
|
|
17
|
-
return {
|
|
18
|
-
available: false,
|
|
19
|
-
reason: 'peach desktop app not installed (run `peach desktop install`)',
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
return {
|
|
23
|
-
available: true,
|
|
24
|
-
reason: null,
|
|
25
|
-
detail: `${install.kind} @ ${install.path}`,
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
async function launch(opts: DriverLaunchOptions): Promise<DriverLaunchResult> {
|
|
30
|
-
const install = findDesktopCompanion()
|
|
31
|
-
if (!install) {
|
|
32
|
-
return {
|
|
33
|
-
launched: false,
|
|
34
|
-
message: 'peach desktop app not installed',
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
try {
|
|
38
|
-
const result = await launchDesktopCompanion(opts.url, install, {
|
|
39
|
-
device: opts.device,
|
|
40
|
-
profileId: opts.profileId,
|
|
41
|
-
ephemeralProfile: opts.ephemeralProfile,
|
|
42
|
-
ownerPid: opts.ownerPid,
|
|
43
|
-
})
|
|
44
|
-
if (!result.launched) {
|
|
45
|
-
return { launched: false, message: 'desktop companion failed to start' }
|
|
46
|
-
}
|
|
47
|
-
return {
|
|
48
|
-
launched: true,
|
|
49
|
-
message: `${install.kind === 'native-mac-app' ? 'native desktop' : 'electron'} launched via ${result.via}${opts.url ? ` → ${opts.url}` : ''}`,
|
|
50
|
-
target: result.target,
|
|
51
|
-
attachUrl: opts.url,
|
|
52
|
-
}
|
|
53
|
-
} catch (err) {
|
|
54
|
-
return {
|
|
55
|
-
launched: false,
|
|
56
|
-
message: `electron launch failed: ${err instanceof Error ? err.message : String(err)}`,
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export const electronDriver: Driver = {
|
|
62
|
-
id: 'electron',
|
|
63
|
-
name: 'electron',
|
|
64
|
-
description: 'peach desktop companion app (native window, menu bar)',
|
|
65
|
-
kind: 'native',
|
|
66
|
-
availability: probe,
|
|
67
|
-
launch,
|
|
68
|
-
}
|
|
6
|
+
export const electronDriver = createDesktopDriver('electron')
|
package/cli/drivers/index.ts
CHANGED
|
@@ -219,14 +219,14 @@ async function launch(opts: DriverLaunchOptions): Promise<DriverLaunchResult> {
|
|
|
219
219
|
}${hint ? `\n${hint}` : ''}`,
|
|
220
220
|
}
|
|
221
221
|
}
|
|
222
|
-
// name both lifetime bounds: the bridge closes an automation sim
|
|
223
|
-
// has touched for the idle window, and the host watchdog closes chrome ~5s
|
|
222
|
+
// name both lifetime bounds: the bridge closes an automation sim neither a
|
|
223
|
+
// cli nor a person has touched for the idle window, and the host watchdog closes chrome ~5s
|
|
224
224
|
// after the owning session pid exits, which surprises one-shot/detached
|
|
225
225
|
// shells (their topmost non-init ancestor is the shell itself, so the sim
|
|
226
226
|
// dies the moment the command finishes).
|
|
227
227
|
const ownerComm = getProcessComm(ownerPid)
|
|
228
228
|
const idleMinutes = AUTOMATION_SIM_IDLE_REAP_TTL_MS / 60_000
|
|
229
|
-
const ownerNote = ` — browser closes after ${idleMinutes} min with no peach command, or when pid ${ownerPid}${ownerComm ? ` (${ownerComm})` : ''} exits`
|
|
229
|
+
const ownerNote = ` — browser closes after ${idleMinutes} min with no peach command or input, or when pid ${ownerPid}${ownerComm ? ` (${ownerComm})` : ''} exits`
|
|
230
230
|
return {
|
|
231
231
|
launched: true,
|
|
232
232
|
message: `playwright chrome launched → ${targetUrl.href}${ownerNote}`,
|
package/cli/drivers/registry.ts
CHANGED
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
// driver registry — hardcoded list of known drivers plus lookup helpers.
|
|
2
|
-
// kept intentionally flat: no DI, no plugin discovery, no lazy imports.
|
|
2
|
+
// kept intentionally flat: no DI, no plugin discovery, no lazy imports. the
|
|
3
3
|
// built-in drivers load unconditionally because their module bodies are cheap
|
|
4
4
|
// (no I/O, no side effects).
|
|
5
5
|
|
|
6
|
+
import { desktopDriver } from './desktop'
|
|
6
7
|
import { electronDriver } from './electron'
|
|
7
8
|
import { playwrightDriver } from './playwright'
|
|
8
9
|
import type { Driver, DriverId } from './types'
|
|
9
10
|
|
|
10
|
-
export const ALL_DRIVERS: readonly Driver[] = [
|
|
11
|
+
export const ALL_DRIVERS: readonly Driver[] = [
|
|
12
|
+
desktopDriver,
|
|
13
|
+
electronDriver,
|
|
14
|
+
playwrightDriver,
|
|
15
|
+
]
|
|
11
16
|
|
|
12
17
|
export function getAllDrivers(): readonly Driver[] {
|
|
13
18
|
return ALL_DRIVERS
|
package/cli/drivers/types.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
// driver / runner abstraction for peach. browser sims run in an isolated
|
|
2
|
-
// playwright-owned profile.
|
|
2
|
+
// playwright-owned profile. desktop launches the native host; electron the
|
|
3
|
+
// Electron companion.
|
|
3
4
|
|
|
4
|
-
export type DriverId = 'electron' | 'playwright'
|
|
5
|
+
export type DriverId = 'desktop' | 'electron' | 'playwright'
|
|
5
6
|
|
|
6
|
-
// broad category for grouping / filtering. "native" is
|
|
7
|
+
// broad category for grouping / filtering. "native" is a desktop host;
|
|
7
8
|
// "automation" is the isolated playwright browser.
|
|
8
9
|
export type DriverKind = 'native' | 'automation'
|
|
9
10
|
|
package/cli/maestro-js.ts
CHANGED
|
@@ -174,6 +174,16 @@ export class MaestroJsContext {
|
|
|
174
174
|
this.envBinding.set(key, value)
|
|
175
175
|
}
|
|
176
176
|
|
|
177
|
+
// a flow config `env:` block (upstream DefineVariablesCommand): every value
|
|
178
|
+
// evaluates against the env as it stands, then all are defined, so
|
|
179
|
+
// `${NAME || 'default'}` keeps a value passed with --env.
|
|
180
|
+
defineVariables(env: Record<string, unknown>) {
|
|
181
|
+
const evaluated = Object.entries(env).map(
|
|
182
|
+
([key, value]) => [key, this.evaluateStringTemplate(String(value))] as const,
|
|
183
|
+
)
|
|
184
|
+
for (const [key, value] of evaluated) this.envBinding.set(key, value)
|
|
185
|
+
}
|
|
186
|
+
|
|
177
187
|
setCopiedText(text: string | null) {
|
|
178
188
|
this.maestro.copiedText = text
|
|
179
189
|
}
|
|
@@ -37,9 +37,9 @@ export const OUTBOUND_ENDPOINTS: Record<string, OutboundEndpointDeclaration> = {
|
|
|
37
37
|
runtime_delivery: {
|
|
38
38
|
category: 'runtime-delivery',
|
|
39
39
|
destination:
|
|
40
|
-
'https://contrast.dev/runtimes/manifest.json and selected runtime tarball',
|
|
40
|
+
'https://contrast.dev/runtimes/manifest.json and selected runtime tarball; with `peach desktop install --native`, https://r2.rnxsim.com/releases/native/<channel>/ manifest and versioned host zip',
|
|
41
41
|
preConsent: true,
|
|
42
|
-
payload: 'HTTP runtime version request; no project or app data',
|
|
42
|
+
payload: 'HTTP runtime or desktop host version request; no project or app data',
|
|
43
43
|
},
|
|
44
44
|
map_style_delivery: {
|
|
45
45
|
category: 'runtime-delivery',
|
|
@@ -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;
|
|
@@ -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 __defProp = Object.defineProperty;
|
|
@@ -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 __defProp = Object.defineProperty;
|
|
@@ -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;
|
|
@@ -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;
|
|
@@ -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;
|
|
@@ -37,9 +37,11 @@ __export(shared_session_exports, {
|
|
|
37
37
|
readSharedDesktopAuthSession: () => readSharedDesktopAuthSession,
|
|
38
38
|
refreshSharedDesktopAuthSession: () => refreshSharedDesktopAuthSession,
|
|
39
39
|
sharedDesktopAuthAccounts: () => sharedDesktopAuthAccounts,
|
|
40
|
+
watchSharedDesktopAuthSession: () => watchSharedDesktopAuthSession,
|
|
40
41
|
writeSharedDesktopAuthSession: () => writeSharedDesktopAuthSession
|
|
41
42
|
});
|
|
42
43
|
module.exports = __toCommonJS(shared_session_exports);
|
|
44
|
+
var import_node_crypto = require("node:crypto");
|
|
43
45
|
var import_node_fs = require("node:fs");
|
|
44
46
|
var import_node_path2 = require("node:path");
|
|
45
47
|
|
|
@@ -157,7 +159,16 @@ function writeSharedDesktopAuthSession(session) {
|
|
|
157
159
|
validatedAt: session.validatedAt,
|
|
158
160
|
accountId: session.accountId?.trim() || void 0
|
|
159
161
|
};
|
|
160
|
-
(0,
|
|
162
|
+
const temporary = `${filepath}.${process.pid}.${(0, import_node_crypto.randomUUID)()}.tmp`;
|
|
163
|
+
try {
|
|
164
|
+
(0, import_node_fs.writeFileSync)(temporary, JSON.stringify(normalized, null, 2) + "\n", {
|
|
165
|
+
mode: 384,
|
|
166
|
+
flag: "wx"
|
|
167
|
+
});
|
|
168
|
+
(0, import_node_fs.renameSync)(temporary, filepath);
|
|
169
|
+
} finally {
|
|
170
|
+
(0, import_node_fs.rmSync)(temporary, { force: true });
|
|
171
|
+
}
|
|
161
172
|
try {
|
|
162
173
|
(0, import_node_fs.chmodSync)(filepath, 384);
|
|
163
174
|
} catch {
|
|
@@ -167,6 +178,21 @@ function writeSharedDesktopAuthSession(session) {
|
|
|
167
178
|
function clearSharedDesktopAuthSession() {
|
|
168
179
|
(0, import_node_fs.rmSync)(getSharedDesktopAuthFilePath(), { force: true });
|
|
169
180
|
}
|
|
181
|
+
function watchSharedDesktopAuthSession(changed) {
|
|
182
|
+
const filepath = getSharedDesktopAuthFilePath();
|
|
183
|
+
(0, import_node_fs.mkdirSync)((0, import_node_path2.dirname)(filepath), { recursive: true });
|
|
184
|
+
const snapshot = (session) => JSON.stringify([session?.token, session?.user, session?.origin, session?.accountId]);
|
|
185
|
+
let previous = snapshot(readSharedDesktopAuthSession());
|
|
186
|
+
const watcher = (0, import_node_fs.watch)((0, import_node_path2.dirname)(filepath), (_event, filename) => {
|
|
187
|
+
if (filename !== null && filename !== (0, import_node_path2.basename)(filepath)) return;
|
|
188
|
+
const session = readSharedDesktopAuthSession();
|
|
189
|
+
const next = snapshot(session);
|
|
190
|
+
if (next === previous) return;
|
|
191
|
+
previous = next;
|
|
192
|
+
changed(session);
|
|
193
|
+
});
|
|
194
|
+
return () => watcher.close();
|
|
195
|
+
}
|
|
170
196
|
async function refreshSharedDesktopAuthSession(originOverride) {
|
|
171
197
|
const current = readSharedDesktopAuthSession();
|
|
172
198
|
if (!current?.token) return null;
|
|
@@ -175,26 +201,29 @@ async function refreshSharedDesktopAuthSession(originOverride) {
|
|
|
175
201
|
const res = await fetch(`${origin.replace(/\/$/, "")}/api/auth/me`, {
|
|
176
202
|
headers: { authorization: `Bearer ${current.token}` }
|
|
177
203
|
});
|
|
204
|
+
const body = res.ok ? await res.json() : null;
|
|
205
|
+
const user = body && typeof body === "object" && "user" in body ? normalizeUser(body.user) : null;
|
|
206
|
+
const latest = readSharedDesktopAuthSession();
|
|
207
|
+
if (latest?.token !== current.token) return latest;
|
|
178
208
|
if (res.status === 401) {
|
|
179
209
|
clearSharedDesktopAuthSession();
|
|
180
210
|
return null;
|
|
181
211
|
}
|
|
182
|
-
if (!res.ok) return
|
|
183
|
-
|
|
184
|
-
if (!data.user?.id) {
|
|
212
|
+
if (!res.ok) return latest;
|
|
213
|
+
if (!user) {
|
|
185
214
|
clearSharedDesktopAuthSession();
|
|
186
215
|
return null;
|
|
187
216
|
}
|
|
188
217
|
return writeSharedDesktopAuthSession({
|
|
189
218
|
token: current.token,
|
|
190
|
-
user
|
|
219
|
+
user,
|
|
191
220
|
origin,
|
|
192
|
-
source:
|
|
221
|
+
source: latest.source,
|
|
193
222
|
validatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
194
|
-
accountId:
|
|
223
|
+
accountId: latest.accountId
|
|
195
224
|
});
|
|
196
225
|
} catch {
|
|
197
|
-
return
|
|
226
|
+
return readSharedDesktopAuthSession();
|
|
198
227
|
}
|
|
199
228
|
}
|
|
200
229
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -204,5 +233,6 @@ async function refreshSharedDesktopAuthSession(originOverride) {
|
|
|
204
233
|
readSharedDesktopAuthSession,
|
|
205
234
|
refreshSharedDesktopAuthSession,
|
|
206
235
|
sharedDesktopAuthAccounts,
|
|
236
|
+
watchSharedDesktopAuthSession,
|
|
207
237
|
writeSharedDesktopAuthSession
|
|
208
238
|
});
|
|
@@ -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 __defProp = Object.defineProperty;
|
package/dist-lib/beta.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 __defProp = Object.defineProperty;
|
package/dist-lib/beta.mjs
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 __defProp = Object.defineProperty;
|
|
@@ -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 __defProp = Object.defineProperty;
|
|
@@ -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 __defProp = Object.defineProperty;
|
|
@@ -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 __defProp = Object.defineProperty;
|
|
@@ -38,40 +38,34 @@ function isLiveRasterSource(node) {
|
|
|
38
38
|
}
|
|
39
39
|
function selectRnxRasterNodeIds(tree) {
|
|
40
40
|
const nodesById = new Map(tree.nodes.map((node) => [node.nodeId, node]));
|
|
41
|
-
const
|
|
41
|
+
const maxLayerArea = tree.width * tree.height * 0.25;
|
|
42
|
+
const eligible = /* @__PURE__ */ new Map();
|
|
42
43
|
for (const node of tree.nodes) {
|
|
43
44
|
const liveVideo = isLiveRasterSource(node);
|
|
44
45
|
const visibleFrame = liveVideo && node.visibleFrame && (node.visibleFrame.width <= 0 || node.visibleFrame.height <= 0) ? node.frame : node.visibleFrame ?? node.frame;
|
|
45
46
|
if (!visibleFrame || visibleFrame.width <= 0 || visibleFrame.height <= 0) continue;
|
|
46
|
-
|
|
47
|
+
const unsupported = node.type === "masked-view" || liveVideo || node.type === "text" && typeof node.text === "string" && (new RegExp("\\p{Emoji_Presentation}", "u").test(node.text) || new RegExp("\\uFE0F|\\u200D|\\u20E3|\\p{Emoji_Modifier}|\\p{Regional_Indicator}", "u").test(
|
|
47
48
|
node.text
|
|
48
|
-
)) || node.style._liquidGlass !== void 0 || node.style._liquidGlassEdge !== void 0 || node.style._liquidGlassMaterialTint !== void 0
|
|
49
|
-
|
|
49
|
+
)) || node.style._liquidGlass !== void 0 || node.style._liquidGlassEdge !== void 0 || node.style._liquidGlassMaterialTint !== void 0;
|
|
50
|
+
const area = visibleFrame.width * visibleFrame.height;
|
|
51
|
+
if (unsupported && (liveVideo || area <= maxLayerArea)) {
|
|
52
|
+
eligible.set(node.nodeId, { nodeId: node.nodeId, area, liveVideo });
|
|
50
53
|
}
|
|
51
54
|
}
|
|
52
|
-
for (const nodeId of [...
|
|
55
|
+
for (const nodeId of [...eligible.keys()]) {
|
|
53
56
|
let parentNodeId = nodesById.get(nodeId)?.parentNodeId ?? null;
|
|
54
57
|
while (parentNodeId !== null) {
|
|
55
|
-
if (
|
|
56
|
-
|
|
58
|
+
if (eligible.has(parentNodeId)) {
|
|
59
|
+
eligible.delete(nodeId);
|
|
57
60
|
break;
|
|
58
61
|
}
|
|
59
62
|
parentNodeId = nodesById.get(parentNodeId)?.parentNodeId ?? null;
|
|
60
63
|
}
|
|
61
64
|
}
|
|
62
|
-
const
|
|
63
|
-
const maxLayerArea = screenArea * 0.25;
|
|
64
|
-
const candidates = [...unsupported].map((nodeId) => {
|
|
65
|
-
const node = nodesById.get(nodeId);
|
|
66
|
-
if (!node) return null;
|
|
67
|
-
const liveVideo = isLiveRasterSource(node);
|
|
68
|
-
const frame = liveVideo && node.visibleFrame && (node.visibleFrame.width <= 0 || node.visibleFrame.height <= 0) ? node.frame : node.visibleFrame ?? node.frame;
|
|
69
|
-
return frame ? { nodeId, area: frame.width * frame.height, liveVideo } : null;
|
|
70
|
-
}).filter(
|
|
71
|
-
(candidate) => candidate !== null && (candidate.liveVideo || candidate.area <= maxLayerArea)
|
|
72
|
-
).sort(
|
|
65
|
+
const candidates = [...eligible.values()].sort(
|
|
73
66
|
(left, right) => Number(right.liveVideo) - Number(left.liveVideo) || left.area - right.area || left.nodeId - right.nodeId
|
|
74
67
|
);
|
|
68
|
+
const screenArea = tree.width * tree.height;
|
|
75
69
|
const selected = /* @__PURE__ */ new Set();
|
|
76
70
|
let atlasArea = 0;
|
|
77
71
|
for (const candidate of candidates) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.745 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
|
|
3
3
|
// src/capture-contract.ts
|
|
4
4
|
var RNX_SCREEN_CAPTURE_VERSION = 1;
|
|
@@ -8,40 +8,34 @@ function isLiveRasterSource(node) {
|
|
|
8
8
|
}
|
|
9
9
|
function selectRnxRasterNodeIds(tree) {
|
|
10
10
|
const nodesById = new Map(tree.nodes.map((node) => [node.nodeId, node]));
|
|
11
|
-
const
|
|
11
|
+
const maxLayerArea = tree.width * tree.height * 0.25;
|
|
12
|
+
const eligible = /* @__PURE__ */ new Map();
|
|
12
13
|
for (const node of tree.nodes) {
|
|
13
14
|
const liveVideo = isLiveRasterSource(node);
|
|
14
15
|
const visibleFrame = liveVideo && node.visibleFrame && (node.visibleFrame.width <= 0 || node.visibleFrame.height <= 0) ? node.frame : node.visibleFrame ?? node.frame;
|
|
15
16
|
if (!visibleFrame || visibleFrame.width <= 0 || visibleFrame.height <= 0) continue;
|
|
16
|
-
|
|
17
|
+
const unsupported = node.type === "masked-view" || liveVideo || node.type === "text" && typeof node.text === "string" && (/\p{Emoji_Presentation}/u.test(node.text) || /\uFE0F|\u200D|\u20E3|\p{Emoji_Modifier}|\p{Regional_Indicator}/u.test(
|
|
17
18
|
node.text
|
|
18
|
-
)) || node.style._liquidGlass !== void 0 || node.style._liquidGlassEdge !== void 0 || node.style._liquidGlassMaterialTint !== void 0
|
|
19
|
-
|
|
19
|
+
)) || node.style._liquidGlass !== void 0 || node.style._liquidGlassEdge !== void 0 || node.style._liquidGlassMaterialTint !== void 0;
|
|
20
|
+
const area = visibleFrame.width * visibleFrame.height;
|
|
21
|
+
if (unsupported && (liveVideo || area <= maxLayerArea)) {
|
|
22
|
+
eligible.set(node.nodeId, { nodeId: node.nodeId, area, liveVideo });
|
|
20
23
|
}
|
|
21
24
|
}
|
|
22
|
-
for (const nodeId of [...
|
|
25
|
+
for (const nodeId of [...eligible.keys()]) {
|
|
23
26
|
let parentNodeId = nodesById.get(nodeId)?.parentNodeId ?? null;
|
|
24
27
|
while (parentNodeId !== null) {
|
|
25
|
-
if (
|
|
26
|
-
|
|
28
|
+
if (eligible.has(parentNodeId)) {
|
|
29
|
+
eligible.delete(nodeId);
|
|
27
30
|
break;
|
|
28
31
|
}
|
|
29
32
|
parentNodeId = nodesById.get(parentNodeId)?.parentNodeId ?? null;
|
|
30
33
|
}
|
|
31
34
|
}
|
|
32
|
-
const
|
|
33
|
-
const maxLayerArea = screenArea * 0.25;
|
|
34
|
-
const candidates = [...unsupported].map((nodeId) => {
|
|
35
|
-
const node = nodesById.get(nodeId);
|
|
36
|
-
if (!node) return null;
|
|
37
|
-
const liveVideo = isLiveRasterSource(node);
|
|
38
|
-
const frame = liveVideo && node.visibleFrame && (node.visibleFrame.width <= 0 || node.visibleFrame.height <= 0) ? node.frame : node.visibleFrame ?? node.frame;
|
|
39
|
-
return frame ? { nodeId, area: frame.width * frame.height, liveVideo } : null;
|
|
40
|
-
}).filter(
|
|
41
|
-
(candidate) => candidate !== null && (candidate.liveVideo || candidate.area <= maxLayerArea)
|
|
42
|
-
).sort(
|
|
35
|
+
const candidates = [...eligible.values()].sort(
|
|
43
36
|
(left, right) => Number(right.liveVideo) - Number(left.liveVideo) || left.area - right.area || left.nodeId - right.nodeId
|
|
44
37
|
);
|
|
38
|
+
const screenArea = tree.width * tree.height;
|
|
45
39
|
const selected = /* @__PURE__ */ new Set();
|
|
46
40
|
let atlasArea = 0;
|
|
47
41
|
for (const candidate of candidates) {
|
|
@@ -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 __defProp = Object.defineProperty;
|
|
@@ -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 __defProp = Object.defineProperty;
|
|
@@ -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 __defProp = Object.defineProperty;
|
package/dist-lib/cloud.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 __defProp = Object.defineProperty;
|
package/dist-lib/cloud.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.745 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4
4
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
package/dist-lib/config.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 __defProp = Object.defineProperty;
|