peachsim 0.1.815 → 0.1.817
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 +57 -121
- package/cli/outbound-endpoints.ts +4 -3
- package/cli/telemetry.ts +21 -7
- 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 +1 -1
- 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/bundle-channel.cjs +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 +114 -2
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +1 -1
- package/dist-lib/expo-swift-metadata.cjs +1 -1
- package/dist-lib/expo-swift-metadata.mjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +1 -1
- 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 +41 -95
- package/dist-lib/swift-compile.cjs +1 -1
- package/dist-lib/swift-compile.mjs +1 -1
- 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 +1 -1
- package/dist-lib/vite.cjs +1 -1
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/package.json +1 -1
|
@@ -102,20 +102,6 @@ const MAESTRO_SELECTOR_KEYS = new Set([
|
|
|
102
102
|
'label',
|
|
103
103
|
'css',
|
|
104
104
|
])
|
|
105
|
-
// maestro filters the runner resolves beyond id and text
|
|
106
|
-
const SELECTOR_FILTER_KEYS = [
|
|
107
|
-
'childOf',
|
|
108
|
-
'width',
|
|
109
|
-
'height',
|
|
110
|
-
'traits',
|
|
111
|
-
'enabled',
|
|
112
|
-
'selected',
|
|
113
|
-
'checked',
|
|
114
|
-
'below',
|
|
115
|
-
'above',
|
|
116
|
-
'leftOf',
|
|
117
|
-
'rightOf',
|
|
118
|
-
] as const
|
|
119
105
|
// maestro filters without a verified ios reading here yet: `css` is web only.
|
|
120
106
|
// `containsChild`, `containsDescendants`, and `focused` read the engine's
|
|
121
107
|
// XCTest accessibility projection (see findElementAccessibilityTree).
|
|
@@ -183,13 +169,22 @@ function accessibilitySubtreeNodes(
|
|
|
183
169
|
return [node, ...node.children.flatMap(accessibilitySubtreeNodes)]
|
|
184
170
|
}
|
|
185
171
|
|
|
186
|
-
//
|
|
187
|
-
//
|
|
172
|
+
// upstream Orchestra.REGEX_OPTIONS + Filters.textMatches/idMatches. this closure-free
|
|
173
|
+
// matcher also runs inside the bridge evaluation for render-tree selectors.
|
|
188
174
|
function accessibilityTextMatcher(
|
|
189
175
|
value: string,
|
|
190
176
|
kind: 'text' | 'id',
|
|
191
177
|
): (candidate: string | null) => boolean {
|
|
192
|
-
|
|
178
|
+
// absolute boundaries preserve Regex.matches with multiline enabled, even
|
|
179
|
+
// for a final newline. ^ and $ inside the user's pattern still match lines.
|
|
180
|
+
let pattern: RegExp
|
|
181
|
+
try {
|
|
182
|
+
pattern = new RegExp(`(?<![\\s\\S])(?:${value})(?![\\s\\S])`, 'ism')
|
|
183
|
+
} catch {
|
|
184
|
+
// upstream StringUtils.toRegexSafe quotes an invalid regex as literal copy.
|
|
185
|
+
const escaped = value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
|
|
186
|
+
pattern = new RegExp(`(?<![\\s\\S])(?:${escaped})(?![\\s\\S])`, 'ism')
|
|
187
|
+
}
|
|
193
188
|
return (candidate) => {
|
|
194
189
|
// IOSDriver emits an empty attribute for absent label, value and id.
|
|
195
190
|
const native = candidate ?? ''
|
|
@@ -612,7 +607,13 @@ export interface MaestroStep {
|
|
|
612
607
|
optional?: boolean
|
|
613
608
|
}
|
|
614
609
|
scroll?: { direction?: string; optional?: boolean }
|
|
615
|
-
scrollTo?: {
|
|
610
|
+
scrollTo?: {
|
|
611
|
+
id?: string
|
|
612
|
+
nodeId?: number
|
|
613
|
+
x: number
|
|
614
|
+
y: number
|
|
615
|
+
optional?: boolean
|
|
616
|
+
}
|
|
616
617
|
pinch?: {
|
|
617
618
|
from: [number, number, number, number]
|
|
618
619
|
to: [number, number, number, number]
|
|
@@ -631,7 +632,12 @@ export interface MaestroStep {
|
|
|
631
632
|
// app-only capture; 'shell' is the inverse.
|
|
632
633
|
layers?: 'full' | 'tenant' | 'shell'
|
|
633
634
|
}
|
|
634
|
-
waitFor?: {
|
|
635
|
+
waitFor?: {
|
|
636
|
+
text?: string
|
|
637
|
+
id?: string
|
|
638
|
+
timeout?: number
|
|
639
|
+
optional?: boolean
|
|
640
|
+
}
|
|
635
641
|
waitForAnimationToEnd?: boolean | number | { timeout?: number }
|
|
636
642
|
back?: boolean
|
|
637
643
|
hideKeyboard?: boolean
|
|
@@ -1291,45 +1297,7 @@ export class SootSimBridgeFlowRunner {
|
|
|
1291
1297
|
if (needsAccessibilityProjection(opts)) {
|
|
1292
1298
|
return this.findElementAccessibilityTree(opts)
|
|
1293
1299
|
}
|
|
1294
|
-
|
|
1295
|
-
// candidate set in maestro's order, so a repeated id (one per list row)
|
|
1296
|
-
// means the top row. a literal text selector keeps the direct lookup.
|
|
1297
|
-
if (
|
|
1298
|
-
opts.id != null ||
|
|
1299
|
-
opts.index != null ||
|
|
1300
|
-
(opts.text != null && /[.*+?^$()[\]{}|\\]/.test(opts.text)) ||
|
|
1301
|
-
SELECTOR_FILTER_KEYS.some((key) => opts[key] != null)
|
|
1302
|
-
) {
|
|
1303
|
-
return this.findElementScoped(opts)
|
|
1304
|
-
}
|
|
1305
|
-
return this.evaluate<any>(`(async () => {
|
|
1306
|
-
const test = window.__sootsimTest
|
|
1307
|
-
if (!test) return null
|
|
1308
|
-
let node = null
|
|
1309
|
-
if (${JSON.stringify(!!opts.text)}) {
|
|
1310
|
-
// maestro text selectors match rendered text and exact accessibility
|
|
1311
|
-
// labels. the engine resolves both in one visibility-aware tree pass.
|
|
1312
|
-
node = await test.findByTextOrLabel(${JSON.stringify(opts.text || '')})
|
|
1313
|
-
}
|
|
1314
|
-
if (!node && ${JSON.stringify(!!opts.id)}) {
|
|
1315
|
-
node = (await test.findByTestId(${JSON.stringify(opts.id || '')})) || (await test.findById(${JSON.stringify(opts.id || '')}))
|
|
1316
|
-
}
|
|
1317
|
-
if (!node || !node.absolutePosition || !node.layout) return null
|
|
1318
|
-
return {
|
|
1319
|
-
nodeId: typeof node.nodeId === 'number' ? node.nodeId : null,
|
|
1320
|
-
id: node.id || null,
|
|
1321
|
-
testID: node.testID || null,
|
|
1322
|
-
text: node.text || null,
|
|
1323
|
-
absolutePosition: node.absolutePosition,
|
|
1324
|
-
layout: node.layout,
|
|
1325
|
-
// the engine's authoritative answer to "is this painted": layout
|
|
1326
|
-
// bounds minus clipping and minus every frontward sibling, overlay
|
|
1327
|
-
// and portal that fully covers it. visibility assertions read this,
|
|
1328
|
-
// never the raw layout box.
|
|
1329
|
-
visibleFrame: node.visibleFrame || null,
|
|
1330
|
-
isTextInput: !!node.isTextInput,
|
|
1331
|
-
}
|
|
1332
|
-
})()`)
|
|
1300
|
+
return this.findElementScoped(opts)
|
|
1333
1301
|
}
|
|
1334
1302
|
|
|
1335
1303
|
// structural filters (containsChild / containsDescendants / focused) read the
|
|
@@ -1380,25 +1348,12 @@ export class SootSimBridgeFlowRunner {
|
|
|
1380
1348
|
// and a relative filter holds when ANY match of its anchor satisfies it.
|
|
1381
1349
|
private async findElementScoped(opts: FlowTargetSelector) {
|
|
1382
1350
|
const screen = await this.screenBounds()
|
|
1383
|
-
const needsEveryNode =
|
|
1384
|
-
!opts.id ||
|
|
1385
|
-
opts.childOf != null ||
|
|
1386
|
-
SELECTOR_FILTER_KEYS.some((key) => opts[key] != null)
|
|
1387
1351
|
return this.evaluate<any>(`(async () => {
|
|
1388
1352
|
const test = window.__sootsimTest
|
|
1389
1353
|
if (!test || !test.queryAll) return null
|
|
1390
1354
|
const selector = ${JSON.stringify(opts)}
|
|
1391
|
-
|
|
1392
|
-
const
|
|
1393
|
-
if (!value) return null
|
|
1394
|
-
let pattern = null
|
|
1395
|
-
try { pattern = new RegExp('^(?:' + value + ')$') } catch {}
|
|
1396
|
-
return (candidate) => typeof candidate === 'string' &&
|
|
1397
|
-
(candidate === value || !!pattern?.test(candidate))
|
|
1398
|
-
}
|
|
1399
|
-
const all = ((await test.queryAll(${JSON.stringify(
|
|
1400
|
-
needsEveryNode ? {} : { idPattern: opts.id },
|
|
1401
|
-
)})) || []).filter(
|
|
1355
|
+
const compile = ${accessibilityTextMatcher.toString()}
|
|
1356
|
+
const all = ((await test.queryAll({})) || []).filter(
|
|
1402
1357
|
(n) => n && n.absolutePosition && n.layout,
|
|
1403
1358
|
)
|
|
1404
1359
|
// maestro reads ios frames as integer edges (AXElement.boundsString)
|
|
@@ -1432,16 +1387,12 @@ export class SootSimBridgeFlowRunner {
|
|
|
1432
1387
|
}
|
|
1433
1388
|
const matchAll = (raw) => {
|
|
1434
1389
|
const sel = typeof raw === 'string' ? { text: raw } : raw
|
|
1435
|
-
const matchesId = compile(sel.id)
|
|
1436
|
-
const matchesText = compile(sel.text)
|
|
1390
|
+
const matchesId = sel.id == null ? null : compile(sel.id, 'id')
|
|
1391
|
+
const matchesText = sel.text == null ? null : compile(sel.text, 'text')
|
|
1437
1392
|
let candidates = all.filter((n) =>
|
|
1438
1393
|
(!matchesId || matchesId(n.testID) || matchesId(n.id)) &&
|
|
1439
|
-
(!matchesText || matchesText(n.text) || matchesText(n.accessibilityLabel)),
|
|
1394
|
+
(!matchesText || matchesText(n.text) || matchesText(n.accessibilityLabel) || matchesText(n.placeholder)),
|
|
1440
1395
|
)
|
|
1441
|
-
const literalText = candidates.filter((n) =>
|
|
1442
|
-
n.text === sel.text || n.accessibilityLabel === sel.text,
|
|
1443
|
-
)
|
|
1444
|
-
if (matchesText && literalText.length > 0) candidates = literalText
|
|
1445
1396
|
if (sel.width != null || sel.height != null) {
|
|
1446
1397
|
const tolerance = sel.tolerance ?? 0
|
|
1447
1398
|
candidates = candidates.filter((n) => {
|
|
@@ -1547,43 +1498,25 @@ export class SootSimBridgeFlowRunner {
|
|
|
1547
1498
|
})()`)
|
|
1548
1499
|
}
|
|
1549
1500
|
|
|
1550
|
-
private async activatePressTarget(
|
|
1501
|
+
private async activatePressTarget(
|
|
1502
|
+
opts: { text?: string; id?: string },
|
|
1503
|
+
nodeId: number,
|
|
1504
|
+
x: number,
|
|
1505
|
+
y: number,
|
|
1506
|
+
) {
|
|
1551
1507
|
const replayTarget: ReplayTapTarget = opts.id
|
|
1552
1508
|
? { id: opts.id, testID: opts.id, text: null }
|
|
1553
1509
|
: { id: null, testID: null, text: opts.text ?? null }
|
|
1554
1510
|
return this.evaluate<any>(`(async () => {
|
|
1555
1511
|
const test = window.__sootsimTest
|
|
1556
1512
|
if (!test) return null
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
}
|
|
1562
|
-
let point = null
|
|
1563
|
-
if (node?.absolutePosition && node?.layout) {
|
|
1564
|
-
point = {
|
|
1565
|
-
x: node.absolutePosition.x + node.layout.width / 2,
|
|
1566
|
-
y: node.absolutePosition.y + node.layout.height / 2,
|
|
1567
|
-
}
|
|
1568
|
-
if (typeof node.nodeId === 'number' && test.resolveTapTarget) {
|
|
1569
|
-
const resolved = await test.resolveTapTarget(node.nodeId)
|
|
1570
|
-
if (
|
|
1571
|
-
resolved &&
|
|
1572
|
-
Number.isFinite(resolved.cx) &&
|
|
1573
|
-
Number.isFinite(resolved.cy)
|
|
1574
|
-
) {
|
|
1575
|
-
point = { x: resolved.cx, y: resolved.cy }
|
|
1576
|
-
}
|
|
1577
|
-
}
|
|
1578
|
-
}
|
|
1579
|
-
${
|
|
1580
|
-
opts.id
|
|
1581
|
-
? `const direct = await test.activatePressById?.(${JSON.stringify(opts.id)})`
|
|
1582
|
-
: `const direct = await test.activatePressByText?.(${JSON.stringify(
|
|
1583
|
-
opts.text || '',
|
|
1584
|
-
)})`
|
|
1513
|
+
let point = { x: ${x}, y: ${y} }
|
|
1514
|
+
const resolved = await test.resolveTapTarget(${nodeId})
|
|
1515
|
+
if (resolved && Number.isFinite(resolved.cx) && Number.isFinite(resolved.cy)) {
|
|
1516
|
+
point = { x: resolved.cx, y: resolved.cy }
|
|
1585
1517
|
}
|
|
1586
|
-
|
|
1518
|
+
const direct = await test.activatePressAt(point.x, point.y, ${nodeId})
|
|
1519
|
+
if (direct?.ok) {
|
|
1587
1520
|
window.dispatchEvent(
|
|
1588
1521
|
new CustomEvent('sootsim:agentAction', {
|
|
1589
1522
|
detail: { type: 'tap', x: point.x, y: point.y, target: ${JSON.stringify(
|
|
@@ -1826,16 +1759,17 @@ export class SootSimBridgeFlowRunner {
|
|
|
1826
1759
|
break
|
|
1827
1760
|
}
|
|
1828
1761
|
}
|
|
1829
|
-
//
|
|
1830
|
-
//
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1762
|
+
// the synthetic-pointer route must retain the matched node's identity.
|
|
1763
|
+
// a new findByText here would widen a failed full-value selector.
|
|
1764
|
+
const direct =
|
|
1765
|
+
typeof element?.nodeId === 'number'
|
|
1766
|
+
? await this.activatePressTarget(
|
|
1767
|
+
opts,
|
|
1768
|
+
element.nodeId,
|
|
1769
|
+
element.absolutePosition.x + element.layout.width / 2,
|
|
1770
|
+
element.absolutePosition.y + element.layout.height / 2,
|
|
1771
|
+
)
|
|
1772
|
+
: null
|
|
1839
1773
|
if (direct?.ok) {
|
|
1840
1774
|
await this.settleAfterInput()
|
|
1841
1775
|
return
|
|
@@ -2775,7 +2709,9 @@ export class SootSimBridgeFlowRunner {
|
|
|
2775
2709
|
const appId = readStringKey(state, 'activeApp') || readRecentShellAppId(state)
|
|
2776
2710
|
if (!appId) throw new Error('launchApp: no simulator app to set permissions for')
|
|
2777
2711
|
for (const [kind, status] of statuses) {
|
|
2778
|
-
await this.callTest('permissionSetAppPermission', appId, kind, {
|
|
2712
|
+
await this.callTest('permissionSetAppPermission', appId, kind, {
|
|
2713
|
+
status,
|
|
2714
|
+
})
|
|
2779
2715
|
}
|
|
2780
2716
|
}
|
|
2781
2717
|
|
|
@@ -50,10 +50,11 @@ export const OUTBOUND_ENDPOINTS: Record<string, OutboundEndpointDeclaration> = {
|
|
|
50
50
|
},
|
|
51
51
|
bounded_diagnostics: {
|
|
52
52
|
category: 'bounded-diagnostics',
|
|
53
|
-
destination:
|
|
53
|
+
destination:
|
|
54
|
+
'configured analytics origin, /api/events (default https://contrast.dev/api/events)',
|
|
54
55
|
preConsent: true,
|
|
55
56
|
payload:
|
|
56
|
-
'anonymous install id, CLI/runtime versions, OS/arch, command name, exit code and duration bucket, package compatibility fields, error class and bounded path-redacted first-line error/warning messages; on until `peach config telemetry off` or DO_NOT_TRACK',
|
|
57
|
+
'anonymous install id, CLI/runtime versions, OS/arch, command name, occurrence uuid and timestamp, exit code and duration bucket, package compatibility fields, error class and bounded path-redacted first-line error/warning messages; on until `peach config telemetry off` or DO_NOT_TRACK',
|
|
57
58
|
},
|
|
58
59
|
crash_report: {
|
|
59
60
|
category: 'bounded-diagnostics',
|
|
@@ -657,7 +658,7 @@ export const DECLARED_OUTBOUND_CALLS: Record<string, OutboundCallDeclaration> =
|
|
|
657
658
|
},
|
|
658
659
|
'packages/peachsim/cli/telemetry.ts :: fetch :: `${endpoint.origin}/api/sootsim/report-issue`':
|
|
659
660
|
{ category: 'crash_report', count: 1 },
|
|
660
|
-
'packages/peachsim/cli/telemetry.ts :: fetch :: `${config.host}/
|
|
661
|
+
'packages/peachsim/cli/telemetry.ts :: fetch :: `${config.host}/api/events`': {
|
|
661
662
|
category: 'bounded_diagnostics',
|
|
662
663
|
count: 1,
|
|
663
664
|
},
|
package/cli/telemetry.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createHash } from 'node:crypto'
|
|
2
2
|
import { homedir } from 'node:os'
|
|
3
|
+
import { eventUuid } from '@peach/globals/event-identity'
|
|
3
4
|
import { crashFingerprint } from 'peach-engine/crash-fingerprint'
|
|
4
5
|
import { getCliVersion } from '../src/cli-version'
|
|
5
6
|
import {
|
|
@@ -44,7 +45,7 @@ function loadConfig(): Config | null {
|
|
|
44
45
|
const host =
|
|
45
46
|
process.env.CONTRAST_POSTHOG_HOST ||
|
|
46
47
|
process.env.VITE_POSTHOG_HOST ||
|
|
47
|
-
'https://
|
|
48
|
+
'https://contrast.dev'
|
|
48
49
|
return { apiKey, host: host.replace(/\/+$/, '') }
|
|
49
50
|
}
|
|
50
51
|
|
|
@@ -94,7 +95,10 @@ export function setDiagnosticRuntimeVersion(version: string): void {
|
|
|
94
95
|
observedRuntimeVersion = diagnosticVersion(version)
|
|
95
96
|
}
|
|
96
97
|
|
|
97
|
-
export function buildCliDiagnosticEvent(
|
|
98
|
+
export function buildCliDiagnosticEvent(
|
|
99
|
+
diagnostic: CliDiagnostic,
|
|
100
|
+
identity = { uuid: eventUuid(), timestamp: new Date().toISOString() },
|
|
101
|
+
) {
|
|
98
102
|
const properties =
|
|
99
103
|
diagnostic.kind === 'package_incompatibility'
|
|
100
104
|
? {
|
|
@@ -112,6 +116,7 @@ export function buildCliDiagnosticEvent(diagnostic: CliDiagnostic) {
|
|
|
112
116
|
: { message: sanitizeDiagnosticMessage(diagnostic.message) }
|
|
113
117
|
|
|
114
118
|
return {
|
|
119
|
+
...identity,
|
|
115
120
|
event: diagnostic.kind,
|
|
116
121
|
distinct_id: readOrCreateAnonymousId(),
|
|
117
122
|
properties: { ...environmentProperties(), ...properties },
|
|
@@ -129,7 +134,7 @@ function environmentProperties() {
|
|
|
129
134
|
}
|
|
130
135
|
}
|
|
131
136
|
|
|
132
|
-
const queue: CliDiagnostic[] = []
|
|
137
|
+
const queue: { diagnostic: CliDiagnostic; uuid: string; timestamp: string }[] = []
|
|
133
138
|
|
|
134
139
|
export function trackCliDiagnostic(diagnostic: CliDiagnostic): void {
|
|
135
140
|
if (!diagnosticsAllowedForCurrentProcess()) return
|
|
@@ -138,8 +143,13 @@ export function trackCliDiagnostic(diagnostic: CliDiagnostic): void {
|
|
|
138
143
|
diagnostic.kind === 'package_incompatibility'
|
|
139
144
|
? diagnostic
|
|
140
145
|
: { ...diagnostic, message: sanitizeDiagnosticMessage(diagnostic.message) }
|
|
141
|
-
if (queue.some((queued) => JSON.stringify(queued) === JSON.stringify(entry)))
|
|
142
|
-
|
|
146
|
+
if (queue.some((queued) => JSON.stringify(queued.diagnostic) === JSON.stringify(entry)))
|
|
147
|
+
return
|
|
148
|
+
queue.push({
|
|
149
|
+
diagnostic: entry,
|
|
150
|
+
uuid: eventUuid(),
|
|
151
|
+
timestamp: new Date().toISOString(),
|
|
152
|
+
})
|
|
143
153
|
}
|
|
144
154
|
|
|
145
155
|
export function trackCliError(error: unknown): void {
|
|
@@ -154,6 +164,8 @@ export function trackCliError(error: unknown): void {
|
|
|
154
164
|
function commandRunEvent(exitCode: number) {
|
|
155
165
|
const ms = Math.max(1, Math.round(process.uptime() * 1000))
|
|
156
166
|
return {
|
|
167
|
+
uuid: eventUuid(),
|
|
168
|
+
timestamp: new Date().toISOString(),
|
|
157
169
|
event: 'command_run',
|
|
158
170
|
distinct_id: readOrCreateAnonymousId(),
|
|
159
171
|
properties: {
|
|
@@ -173,10 +185,12 @@ export async function flushCliTelemetry(exitCode: number): Promise<void> {
|
|
|
173
185
|
const diagnostics = queue.splice(0, queue.length)
|
|
174
186
|
try {
|
|
175
187
|
const batch = [
|
|
176
|
-
...diagnostics.map((diagnostic) =>
|
|
188
|
+
...diagnostics.map(({ diagnostic, uuid, timestamp }) =>
|
|
189
|
+
buildCliDiagnosticEvent(diagnostic, { uuid, timestamp }),
|
|
190
|
+
),
|
|
177
191
|
commandRunEvent(exitCode),
|
|
178
192
|
]
|
|
179
|
-
await fetch(`${config.host}/
|
|
193
|
+
await fetch(`${config.host}/api/events`, {
|
|
180
194
|
method: 'POST',
|
|
181
195
|
headers: { 'content-type': 'application/json' },
|
|
182
196
|
body: JSON.stringify({ api_key: config.apiKey, batch }),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.817 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.817 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.817 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.817 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.817 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.817 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.817 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } 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.817 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } 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.817 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.817 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.817 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.817 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.817 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.817 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.817 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! rnx v0.1.
|
|
1
|
+
/*! rnx v0.1.817 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } 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.817 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } 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.817 | (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.817 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|