sootsim 0.1.132 → 0.1.134
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/detox/gestures.ts +2 -2
- package/detox/index.ts +211 -9
- package/dist-cli/bin.js +3 -3
- package/dist-cli/chunks/{agent-AFUTDI54.js → agent-VMB2RUAT.js} +2 -2
- package/dist-cli/chunks/{agent-wrapper-Y3DC2TRR.js → agent-wrapper-Z3ROMZQZ.js} +2 -2
- package/dist-cli/chunks/{app-fonts-KDB2PRPC.js → app-fonts-NMKBEO3H.js} +2 -2
- package/dist-cli/chunks/{assert-2MRMIKZ5.js → assert-6TFSLJZZ.js} +2 -2
- package/dist-cli/chunks/auto-bootstrap-JD7JT5JS.js +2 -0
- package/dist-cli/chunks/beta-OJZBBTGE.js +2 -0
- package/dist-cli/chunks/{chunk-M55FQGJZ.js → chunk-33MZ6O5D.js} +2 -2
- package/dist-cli/chunks/{chunk-ATNPY5MD.js → chunk-45XY4F6P.js} +2 -2
- package/dist-cli/chunks/{chunk-M2X6UVSB.js → chunk-535S34EI.js} +1 -1
- package/dist-cli/chunks/{chunk-PQ5FPU6A.js → chunk-5YFJRLU5.js} +2 -2
- package/dist-cli/chunks/chunk-646XDTEN.js +5 -0
- package/dist-cli/chunks/{chunk-RVQVLLEG.js → chunk-6BSDH5L3.js} +1 -1
- package/dist-cli/chunks/chunk-6EO76DWY.js +1 -0
- package/dist-cli/chunks/{chunk-G4E5YPA5.js → chunk-7AW6PBDV.js} +2 -2
- package/dist-cli/chunks/chunk-A4XRRJER.js +64 -0
- package/dist-cli/chunks/{chunk-Z65S4SDO.js → chunk-BXVFVTB7.js} +2 -2
- package/dist-cli/chunks/{chunk-FN7A3SAA.js → chunk-CFZAP564.js} +1 -1
- package/dist-cli/chunks/{chunk-DLJATZY5.js → chunk-DUWCLIV5.js} +2 -2
- package/dist-cli/chunks/{chunk-OPUGOT5W.js → chunk-DWLMWYVM.js} +1 -1
- package/dist-cli/chunks/{chunk-4HGQ2PEE.js → chunk-ELJTZV3R.js} +1 -1
- package/dist-cli/chunks/{chunk-2IBAWZ7U.js → chunk-GKW7BY7I.js} +1 -1
- package/dist-cli/chunks/{chunk-KKYYY4SU.js → chunk-HXR6XU6C.js} +2 -2
- package/dist-cli/chunks/{chunk-DQ26DUUJ.js → chunk-I2VRBQ5H.js} +2 -2
- package/dist-cli/chunks/{chunk-3QE2LTSK.js → chunk-IGMJFER4.js} +1 -1
- package/dist-cli/chunks/{chunk-V3BJFDXP.js → chunk-IVDZ3W6A.js} +2 -2
- package/dist-cli/chunks/chunk-IZN3MCHO.js +1 -0
- package/dist-cli/chunks/chunk-KE3EJA7O.js +1 -0
- package/dist-cli/chunks/{chunk-RXJZIMJJ.js → chunk-KFH6ED7B.js} +2 -2
- package/dist-cli/chunks/chunk-L35AUO7S.js +4 -0
- package/dist-cli/chunks/{chunk-ZQ4QY2YE.js → chunk-LAJCBUZT.js} +2 -2
- package/dist-cli/chunks/{chunk-WH53SVIJ.js → chunk-M63L7MMI.js} +2 -2
- package/dist-cli/chunks/{chunk-27N7ICZN.js → chunk-M6PYEFZ2.js} +2 -2
- package/dist-cli/chunks/{chunk-DXEK3GIY.js → chunk-M7Y6N4P6.js} +1 -1
- package/dist-cli/chunks/{chunk-7IOM3Q7K.js → chunk-ORHN5FYU.js} +2 -2
- package/dist-cli/chunks/{chunk-J2ULC5SV.js → chunk-OXEBJWSX.js} +1 -1
- package/dist-cli/chunks/{chunk-MB7542U3.js → chunk-QAQTDA4L.js} +2 -2
- package/dist-cli/chunks/{chunk-GSWF67XQ.js → chunk-R33YPSKP.js} +3 -3
- package/dist-cli/chunks/{chunk-TU2DICF6.js → chunk-SFXCDLYK.js} +2 -2
- package/dist-cli/chunks/{chunk-QR5A7YTU.js → chunk-SOK4CAR5.js} +1 -1
- package/dist-cli/chunks/{chunk-GYALTZH2.js → chunk-SUQFTSA4.js} +1 -1
- package/dist-cli/chunks/{chunk-IPELBBR7.js → chunk-T2OFKNEP.js} +2 -2
- package/dist-cli/chunks/{chunk-HV3JFW4Z.js → chunk-T3FWQAUS.js} +1 -1
- package/dist-cli/chunks/{chunk-O57A7XC3.js → chunk-T3LSXEVR.js} +2 -2
- package/dist-cli/chunks/{chunk-JSQZ3L4G.js → chunk-UKGEBJO7.js} +1 -1
- package/dist-cli/chunks/{chunk-FXQNZBLR.js → chunk-VT26XQSW.js} +2 -2
- package/dist-cli/chunks/{chunk-2RHEFCQU.js → chunk-WFKQBUVT.js} +1 -1
- package/dist-cli/chunks/chunk-WYDL2H2W.js +2 -0
- package/dist-cli/chunks/{chunk-KDL7JHIT.js → chunk-Y4KIVYC7.js} +3 -3
- package/dist-cli/chunks/{chunk-QZ7HOHPF.js → chunk-YHX465ER.js} +1 -1
- package/dist-cli/chunks/{chunk-ZQM7VKWC.js → chunk-YY7XLGEP.js} +3 -3
- package/dist-cli/chunks/{chunk-ONEE2ECF.js → chunk-ZLITT2QF.js} +1 -1
- package/dist-cli/chunks/cli-version-D3EINJYQ.js +2 -0
- package/dist-cli/chunks/{compat-IKHHQX64.js → compat-RQSP3A4K.js} +3 -3
- package/dist-cli/chunks/{config-PWBCAAGT.js → config-GPQXM7XD.js} +2 -2
- package/dist-cli/chunks/control-OPM5UT5V.js +2 -0
- package/dist-cli/chunks/{cpu-profile-ROFNHY3S.js → cpu-profile-SSK4NTBF.js} +2 -2
- package/dist-cli/chunks/{daemon-LBVKOXOS.js → daemon-5SXKDVTQ.js} +2 -2
- package/dist-cli/chunks/{debug-436NESIA.js → debug-VRDAVGN6.js} +3 -3
- package/dist-cli/chunks/demo-app-registry-JJVMXHLB.js +2 -0
- package/dist-cli/chunks/{detox-SJ362PDO.js → detox-IER2FXXY.js} +2 -2
- package/dist-cli/chunks/{device-E35BFFIK.js → device-XH546AFN.js} +2 -2
- package/dist-cli/chunks/{diagnose-X6VQU7JU.js → diagnose-IQVAFQGI.js} +2 -2
- package/dist-cli/chunks/drivers-2HTFK23W.js +2 -0
- package/dist-cli/chunks/{electron-DL6UYHMP.js → electron-DGAACAIN.js} +3 -3
- package/dist-cli/chunks/flow-3ZYT4CYB.js +2 -0
- package/dist-cli/chunks/help-AS4Z2FND.js +2 -0
- package/dist-cli/chunks/{hints-CL6GAGYA.js → hints-27ZUR5TJ.js} +2 -2
- package/dist-cli/chunks/{home-paths-UZ7VFTFH.js → home-paths-6O3WRSPE.js} +2 -2
- package/dist-cli/chunks/{inspect-ZIAH6YYL.js → inspect-ADZLCQTO.js} +3 -3
- package/dist-cli/chunks/install-P6K5SUCS.js +2 -0
- package/dist-cli/chunks/{install-desktop-CUEXCF63.js → install-desktop-MZ47Z4X5.js} +3 -3
- package/dist-cli/chunks/{keys-27777IEZ.js → keys-AU777KZN.js} +2 -2
- package/dist-cli/chunks/{launch-OSW5K7AB.js → launch-E34RMXXP.js} +3 -3
- package/dist-cli/chunks/{login-7Q7FHH56.js → login-J7W3QNG5.js} +4 -4
- package/dist-cli/chunks/{logout-GL53I6SM.js → logout-J2YBTA5E.js} +2 -2
- package/dist-cli/chunks/{maestro-QXGWQH5W.js → maestro-EZ62M2VG.js} +2 -2
- package/dist-cli/chunks/{preview-2VJKJQ4L.js → preview-KRDPFRKF.js} +2 -2
- package/dist-cli/chunks/{profile-PAUNDJTM.js → profile-75A7BSOQ.js} +2 -2
- package/dist-cli/chunks/{react-FH53EVOB.js → react-UCAXWTQU.js} +2 -2
- package/dist-cli/chunks/{record-BK4JRURI.js → record-JIDVPW3G.js} +2 -2
- package/dist-cli/chunks/runtime-ACX43ZIT.js +2 -0
- package/dist-cli/chunks/{runtime-delivery-H4BASUBJ.js → runtime-delivery-J7XQ4ZFI.js} +2 -2
- package/dist-cli/chunks/{screenshot-4LZTXRNR.js → screenshot-IASSDVSN.js} +2 -2
- package/dist-cli/chunks/{screenshot-mode-NFCQQCUM.js → screenshot-mode-N5QGF5RE.js} +2 -2
- package/dist-cli/chunks/{screenshots-26ZGYEI4.js → screenshots-T5YPBSYI.js} +2 -2
- package/dist-cli/chunks/{server-MQKMB65Q.js → server-OUOF3SW4.js} +3 -3
- package/dist-cli/chunks/setup-repo-LJIDHL6S.js +2 -0
- package/dist-cli/chunks/{skills-FTD3ULMY.js → skills-3XZ5EHZS.js} +2 -2
- package/dist-cli/chunks/{start-GYSLGONC.js → start-NLEY3RB2.js} +4 -4
- package/dist-cli/chunks/store-GTC6V2PO.js +2 -0
- package/dist-cli/chunks/telemetry-6BJJFDDX.js +2 -0
- package/dist-cli/chunks/{test-IM4FIGKF.js → test-MHLSSGM7.js} +3 -3
- package/dist-cli/chunks/{three-mode-AY2SXFFZ.js → three-mode-E6FNRWW2.js} +2 -2
- package/dist-cli/chunks/{timeline-MUT7OYAS.js → timeline-2TORZFTW.js} +2 -2
- package/dist-cli/chunks/{upgrade-YJLIYQ47.js → upgrade-FT3QFFOF.js} +2 -2
- package/dist-cli/chunks/upload-ZAAQ5XTC.js +2 -0
- package/dist-cli/chunks/{version-PC3ZKQMT.js → version-WYYMIGAV.js} +2 -2
- package/dist-cli/chunks/web-NUISI4HO.js +2 -0
- package/dist-cli/chunks/{what-happened-S4BWN4S3.js → what-happened-UVBUSMG3.js} +2 -2
- package/dist-cli/chunks/{whoami-BB5DRHYR.js → whoami-2Y422P77.js} +2 -2
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/agent-sessions.cjs +1 -1
- package/dist-lib/attached-projects.cjs +825 -23
- 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/cli-constants.cjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/detox/index.cjs +169 -11
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +443 -429
- 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/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +1 -1
- package/dist-lib/metro.cjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/render-mode.cjs +1 -1
- package/dist-lib/scripts/demo-app-registry.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 +10 -6
- package/dist-lib/vite.cjs +1 -1
- package/package.json +1 -1
- package/src/attached-projects.ts +1 -1
- package/dist-cli/chunks/auto-bootstrap-C4PEVL4E.js +0 -2
- package/dist-cli/chunks/beta-FO3BNCPQ.js +0 -2
- package/dist-cli/chunks/chunk-24RUJ6PP.js +0 -1
- package/dist-cli/chunks/chunk-JUPPJIY7.js +0 -1
- package/dist-cli/chunks/chunk-MGZLPYES.js +0 -2
- package/dist-cli/chunks/chunk-QLX4VBXC.js +0 -67
- package/dist-cli/chunks/chunk-RGNLXPRY.js +0 -1
- package/dist-cli/chunks/chunk-T5U3GOXM.js +0 -4
- package/dist-cli/chunks/cli-version-XPJ56KAZ.js +0 -2
- package/dist-cli/chunks/control-2NHYRULE.js +0 -2
- package/dist-cli/chunks/drivers-AH7EWZNI.js +0 -2
- package/dist-cli/chunks/flow-XFXAMDYM.js +0 -2
- package/dist-cli/chunks/help-Y3DWIZAN.js +0 -2
- package/dist-cli/chunks/install-QG6EPZBZ.js +0 -2
- package/dist-cli/chunks/runtime-5T3EBKUX.js +0 -2
- package/dist-cli/chunks/setup-repo-M7OKUYEP.js +0 -2
- package/dist-cli/chunks/store-AYCRGKD4.js +0 -2
- package/dist-cli/chunks/telemetry-JVR2VHBS.js +0 -2
- package/dist-cli/chunks/upload-P2ON6DUB.js +0 -2
- package/dist-cli/chunks/web-IRQTOA7M.js +0 -2
package/detox/gestures.ts
CHANGED
|
@@ -305,7 +305,7 @@ export async function dragScrollNode(
|
|
|
305
305
|
|
|
306
306
|
const startPage = await sootsimToPage(page, startSootX, startSootY)
|
|
307
307
|
const endPage = await sootsimToPage(page, endSootX, endSootY)
|
|
308
|
-
const steps =
|
|
308
|
+
const steps = Math.max(16, Math.ceil(pixels / 8))
|
|
309
309
|
|
|
310
310
|
await page.mouse.move(startPage.x, startPage.y)
|
|
311
311
|
await page.mouse.down()
|
|
@@ -315,7 +315,7 @@ export async function dragScrollNode(
|
|
|
315
315
|
const dy = (endPage.y - startPage.y) / steps
|
|
316
316
|
for (let i = 1; i <= steps; i++) {
|
|
317
317
|
await page.mouse.move(startPage.x + dx * i, startPage.y + dy * i)
|
|
318
|
-
await page.waitForTimeout(
|
|
318
|
+
await page.waitForTimeout(24)
|
|
319
319
|
}
|
|
320
320
|
|
|
321
321
|
await page.mouse.up()
|
package/detox/index.ts
CHANGED
|
@@ -129,6 +129,181 @@ async function waitForSootsimTree(page: Page, timeout = 30000): Promise<void> {
|
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
+
async function waitForSootsimSurfaceMetrics(page: Page, timeout = 30000): Promise<void> {
|
|
133
|
+
const deadline = Date.now() + timeout
|
|
134
|
+
let lastSnapshot: unknown = null
|
|
135
|
+
while (Date.now() < deadline) {
|
|
136
|
+
lastSnapshot = await page.evaluate(async () => {
|
|
137
|
+
const metricsWindow = (value: unknown): Record<string, unknown> | null => {
|
|
138
|
+
if (!value || typeof value !== 'object') return null
|
|
139
|
+
const windowValue = (value as Record<string, unknown>).window
|
|
140
|
+
if (!windowValue || typeof windowValue !== 'object') return null
|
|
141
|
+
return windowValue as Record<string, unknown>
|
|
142
|
+
}
|
|
143
|
+
const snapshot = await window.__sootsimTest?.getSurfaceMetricsSnapshot?.()
|
|
144
|
+
const windowMetrics = metricsWindow(snapshot)
|
|
145
|
+
const width = windowMetrics?.width
|
|
146
|
+
const height = windowMetrics?.height
|
|
147
|
+
if (
|
|
148
|
+
typeof width === 'number' &&
|
|
149
|
+
typeof height === 'number' &&
|
|
150
|
+
width > 0 &&
|
|
151
|
+
height > 0
|
|
152
|
+
) {
|
|
153
|
+
return { ready: true }
|
|
154
|
+
}
|
|
155
|
+
return { ready: false, snapshot }
|
|
156
|
+
})
|
|
157
|
+
if (
|
|
158
|
+
lastSnapshot &&
|
|
159
|
+
typeof lastSnapshot === 'object' &&
|
|
160
|
+
(lastSnapshot as { ready?: boolean }).ready
|
|
161
|
+
) {
|
|
162
|
+
return
|
|
163
|
+
}
|
|
164
|
+
await page.waitForTimeout(50)
|
|
165
|
+
}
|
|
166
|
+
throw new Error(
|
|
167
|
+
`timed out waiting for sootsim surface metrics: ${JSON.stringify(lastSnapshot)}`,
|
|
168
|
+
)
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
async function waitForSootsimShellReady(page: Page, timeout = 30000): Promise<void> {
|
|
172
|
+
try {
|
|
173
|
+
await page.evaluate(async (timeoutMs) => {
|
|
174
|
+
type ShellHostReadyBridge = {
|
|
175
|
+
ready?: Promise<unknown>
|
|
176
|
+
firstContentPainted?: Promise<unknown>
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
const start = Date.now()
|
|
180
|
+
const deadline = start + timeoutMs
|
|
181
|
+
const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms))
|
|
182
|
+
const remaining = () => Math.max(1, deadline - Date.now())
|
|
183
|
+
const withTimeout = async <T>(label: string, promise: Promise<T>) => {
|
|
184
|
+
let timer: ReturnType<typeof setTimeout> | null = null
|
|
185
|
+
try {
|
|
186
|
+
await Promise.race([
|
|
187
|
+
promise,
|
|
188
|
+
new Promise((_, reject) => {
|
|
189
|
+
timer = setTimeout(
|
|
190
|
+
() => reject(new Error(`${label} timed out after ${timeoutMs}ms`)),
|
|
191
|
+
remaining(),
|
|
192
|
+
)
|
|
193
|
+
}),
|
|
194
|
+
])
|
|
195
|
+
} finally {
|
|
196
|
+
if (timer) clearTimeout(timer)
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
const isTenantOnly =
|
|
201
|
+
new URL(window.location.href).searchParams.get('renderMode') === 'tenant-only'
|
|
202
|
+
let shellHost: ShellHostReadyBridge | null = null
|
|
203
|
+
while (Date.now() < deadline) {
|
|
204
|
+
const candidate = (window as any).SootSim?.bridges?.shellHost
|
|
205
|
+
if (candidate || isTenantOnly) {
|
|
206
|
+
shellHost = candidate ?? null
|
|
207
|
+
break
|
|
208
|
+
}
|
|
209
|
+
await sleep(25)
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
if (!shellHost) {
|
|
213
|
+
if (isTenantOnly) return
|
|
214
|
+
throw new Error(`sootsim shell host unavailable after ${timeoutMs}ms`)
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
if (shellHost.ready && typeof shellHost.ready.then === 'function') {
|
|
218
|
+
await withTimeout('sootsim shell ready', shellHost.ready)
|
|
219
|
+
}
|
|
220
|
+
if (
|
|
221
|
+
shellHost.firstContentPainted &&
|
|
222
|
+
typeof shellHost.firstContentPainted.then === 'function'
|
|
223
|
+
) {
|
|
224
|
+
await withTimeout(
|
|
225
|
+
'sootsim shell first content paint',
|
|
226
|
+
shellHost.firstContentPainted,
|
|
227
|
+
)
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
const waitForScreenTransitions = (window as any).__sootsimTest
|
|
231
|
+
?.waitForScreenTransitions
|
|
232
|
+
if (typeof waitForScreenTransitions === 'function') {
|
|
233
|
+
const transitionResult = await waitForScreenTransitions({
|
|
234
|
+
timeoutMs: Math.min(remaining(), 3000),
|
|
235
|
+
settleMs: 64,
|
|
236
|
+
startWindowMs: 700,
|
|
237
|
+
})
|
|
238
|
+
if (transitionResult?.timedOut === true) {
|
|
239
|
+
throw new Error(
|
|
240
|
+
`sootsim launch transitions timed out: ${JSON.stringify(transitionResult)}`,
|
|
241
|
+
)
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}, timeout)
|
|
245
|
+
} catch (error) {
|
|
246
|
+
throw await describeSootsimBridgeFailure(page, error)
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
async function waitForSootsimWorkletsIdle(page: Page, timeout = 3000): Promise<void> {
|
|
251
|
+
const result = await page.evaluate(
|
|
252
|
+
async ({ timeout }) => {
|
|
253
|
+
const getPeerStats = (window as any).__sootsimTest?.getPeerStats
|
|
254
|
+
if (typeof getPeerStats !== 'function') {
|
|
255
|
+
return { settled: true, skipped: true }
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms))
|
|
259
|
+
const readStats = () =>
|
|
260
|
+
Promise.race([
|
|
261
|
+
getPeerStats(false),
|
|
262
|
+
new Promise((resolve) => setTimeout(() => resolve(null), 250)),
|
|
263
|
+
])
|
|
264
|
+
const start = Date.now()
|
|
265
|
+
const deadline = start + timeout
|
|
266
|
+
const requiredStableMs = 120
|
|
267
|
+
let stableSince: number | null = null
|
|
268
|
+
let lastPending = 0
|
|
269
|
+
await sleep(0)
|
|
270
|
+
|
|
271
|
+
while (Date.now() < deadline) {
|
|
272
|
+
const stats = await readStats()
|
|
273
|
+
const pending =
|
|
274
|
+
stats &&
|
|
275
|
+
typeof stats === 'object' &&
|
|
276
|
+
typeof (stats as { pendingRunWorklets?: unknown }).pendingRunWorklets ===
|
|
277
|
+
'number'
|
|
278
|
+
? stats.pendingRunWorklets
|
|
279
|
+
: 0
|
|
280
|
+
lastPending = pending
|
|
281
|
+
if (pending === 0) {
|
|
282
|
+
stableSince ??= Date.now()
|
|
283
|
+
if (Date.now() - stableSince >= requiredStableMs) {
|
|
284
|
+
return { settled: true, elapsed: Date.now() - start, pending }
|
|
285
|
+
}
|
|
286
|
+
} else {
|
|
287
|
+
stableSince = null
|
|
288
|
+
}
|
|
289
|
+
await sleep(25)
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
return {
|
|
293
|
+
settled: false,
|
|
294
|
+
elapsed: Date.now() - start,
|
|
295
|
+
pending: lastPending,
|
|
296
|
+
}
|
|
297
|
+
},
|
|
298
|
+
{ timeout },
|
|
299
|
+
)
|
|
300
|
+
if (!result?.settled) {
|
|
301
|
+
throw new Error(
|
|
302
|
+
`sootsim worklet runtime did not settle after ${result?.elapsed ?? timeout}ms (pending=${result?.pending ?? 'unknown'})`,
|
|
303
|
+
)
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
|
|
132
307
|
async function closeContext() {
|
|
133
308
|
const context = _context
|
|
134
309
|
_context = null
|
|
@@ -289,13 +464,25 @@ async function getDefaultTapPoint(
|
|
|
289
464
|
nodeInfo: any,
|
|
290
465
|
): Promise<{ x: number; y: number }> {
|
|
291
466
|
const center = getNodeCenter(nodeInfo)
|
|
292
|
-
const viewport = await readSootsimInteractiveViewport(page)
|
|
293
467
|
const frame = nodeInfo.visibleFrame ?? {
|
|
294
468
|
x: nodeInfo.absolutePosition?.x ?? nodeInfo.layout?.x ?? 0,
|
|
295
469
|
y: nodeInfo.absolutePosition?.y ?? nodeInfo.layout?.y ?? 0,
|
|
296
470
|
width: nodeInfo.layout?.width ?? 0,
|
|
297
471
|
height: nodeInfo.layout?.height ?? 0,
|
|
298
472
|
}
|
|
473
|
+
const fullFrameTolerance = 0.5
|
|
474
|
+
const fullyVisible =
|
|
475
|
+
typeof nodeInfo.absolutePosition?.x === 'number' &&
|
|
476
|
+
typeof nodeInfo.absolutePosition?.y === 'number' &&
|
|
477
|
+
typeof nodeInfo.layout?.width === 'number' &&
|
|
478
|
+
typeof nodeInfo.layout?.height === 'number' &&
|
|
479
|
+
Math.abs(frame.x - nodeInfo.absolutePosition.x) <= fullFrameTolerance &&
|
|
480
|
+
Math.abs(frame.y - nodeInfo.absolutePosition.y) <= fullFrameTolerance &&
|
|
481
|
+
frame.width >= nodeInfo.layout.width - fullFrameTolerance &&
|
|
482
|
+
frame.height >= nodeInfo.layout.height - fullFrameTolerance
|
|
483
|
+
if (fullyVisible) return center
|
|
484
|
+
|
|
485
|
+
const viewport = await readSootsimInteractiveViewport(page)
|
|
299
486
|
const left = Math.max(0, frame.x)
|
|
300
487
|
const top = Math.max(0, frame.y)
|
|
301
488
|
const right = Math.min(viewport.width, frame.x + frame.width)
|
|
@@ -476,6 +663,7 @@ function createSootElement(matcher: Matcher): SootElement {
|
|
|
476
663
|
|
|
477
664
|
async tap(point) {
|
|
478
665
|
const page = getPage()
|
|
666
|
+
await waitForSootsimWorkletsIdle(page, 3000)
|
|
479
667
|
const node = await findNodeByMatcher(matcher)
|
|
480
668
|
if (!node) throw new Error(`element not found for tap: ${JSON.stringify(matcher)}`)
|
|
481
669
|
const defaultPoint = point ? null : await getDefaultTapPoint(page, node)
|
|
@@ -540,12 +728,19 @@ function createSootElement(matcher: Matcher): SootElement {
|
|
|
540
728
|
if (!node)
|
|
541
729
|
throw new Error(`element not found for longPress: ${JSON.stringify(matcher)}`)
|
|
542
730
|
const center = getNodeCenter(node)
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
731
|
+
await page.evaluate(
|
|
732
|
+
async ({ duration, x, y }) => {
|
|
733
|
+
const longPress = window.SootSim?.bridges?.interact?.longPress
|
|
734
|
+
if (typeof longPress !== 'function') {
|
|
735
|
+
throw new Error('sootsim longPress bridge is not installed')
|
|
736
|
+
}
|
|
737
|
+
const hit = await longPress(x, y, duration)
|
|
738
|
+
if (!hit) {
|
|
739
|
+
throw new Error(`sootsim longPress missed at ${x},${y}`)
|
|
740
|
+
}
|
|
741
|
+
},
|
|
742
|
+
{ duration, x: center.x, y: center.y },
|
|
743
|
+
)
|
|
549
744
|
await page.waitForTimeout(50)
|
|
550
745
|
},
|
|
551
746
|
|
|
@@ -924,10 +1119,12 @@ export const device = {
|
|
|
924
1119
|
await _page!.goto(url, { waitUntil: 'load', timeout: 30000 })
|
|
925
1120
|
|
|
926
1121
|
await waitForSootsimTree(_page!, 30000)
|
|
1122
|
+
await waitForSootsimSurfaceMetrics(_page!, 30000)
|
|
1123
|
+
await waitForSootsimShellReady(_page!, 30000)
|
|
1124
|
+
await waitForSootsimWorkletsIdle(_page!, 3000)
|
|
927
1125
|
// record the wall-clock time the page is ready — captureProofMenuStages
|
|
928
1126
|
// uses this to compute trigger-in-video offsets
|
|
929
1127
|
device._lastReadyAtMs = Date.now()
|
|
930
|
-
await _page!.waitForTimeout(500)
|
|
931
1128
|
},
|
|
932
1129
|
|
|
933
1130
|
_lastReadyAtMs: 0,
|
|
@@ -936,7 +1133,9 @@ export const device = {
|
|
|
936
1133
|
const page = getPage()
|
|
937
1134
|
await page.reload({ waitUntil: 'load', timeout: 30000 })
|
|
938
1135
|
await waitForSootsimTree(page, 30000)
|
|
939
|
-
await page
|
|
1136
|
+
await waitForSootsimSurfaceMetrics(page, 30000)
|
|
1137
|
+
await waitForSootsimShellReady(page, 30000)
|
|
1138
|
+
await waitForSootsimWorkletsIdle(page, 3000)
|
|
940
1139
|
},
|
|
941
1140
|
|
|
942
1141
|
async terminateApp() {
|
|
@@ -955,6 +1154,9 @@ export const device = {
|
|
|
955
1154
|
const page = getPage()
|
|
956
1155
|
await page.goto(url.url, { waitUntil: 'load', timeout: 30000 })
|
|
957
1156
|
await waitForSootsimTree(page, 10000)
|
|
1157
|
+
await waitForSootsimSurfaceMetrics(page, 10000)
|
|
1158
|
+
await waitForSootsimShellReady(page, 10000)
|
|
1159
|
+
await waitForSootsimWorkletsIdle(page, 3000)
|
|
958
1160
|
},
|
|
959
1161
|
|
|
960
1162
|
async takeScreenshot(name: string): Promise<string> {
|
package/dist-cli/bin.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
/*! sootsim v0.1.
|
|
3
|
-
import{a as u,b as d,c as g}from"./chunks/chunk-
|
|
2
|
+
/*! sootsim v0.1.134 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
3
|
+
import{a as u,b as d,c as g}from"./chunks/chunk-M7Y6N4P6.js";import"./chunks/chunk-UKGEBJO7.js";function f(a){let e=a instanceof Error?a.message:String(a);(/^command timed out after \d+s$/.test(e)||e.startsWith("sim disconnected:")||e.startsWith("bridge never reconnected")||e.startsWith("no sim connected with id ")||e.startsWith("could not connect to ws://")||e.startsWith("sootsim bridge daemon is not running")||e.startsWith("refusing to install the persistent sootsim daemon"))&&!process.env.SOOTSIM_VERBOSE&&(process.stderr.write(` ${e}
|
|
4
4
|
`),process.exit(1)),a instanceof Error&&a.stack?process.stderr.write(`${a.stack}
|
|
5
5
|
`):process.stderr.write(`${e}
|
|
6
6
|
`),process.exit(1)}process.on("unhandledRejection",f);process.on("uncaughtException",f);var A=typeof __SOOTSIM_STANDALONE__<"u"&&__SOOTSIM_STANDALONE__,k=new Set(["preview","electron","install-desktop"]);function v(a){!A||!k.has(a)||(process.stderr.write(` sootsim ${a} isn't available in the standalone binary \u2014
|
|
7
7
|
it needs vite / electron / playwright from a project's node_modules.
|
|
8
8
|
install the npm package and run via bun or node instead:
|
|
9
9
|
npm i -g sootsim && sootsim ${a}
|
|
10
|
-
`),process.exit(1))}var t=g(process.argv);{let{trackCliEvent:a}=await import("./chunks/telemetry-
|
|
10
|
+
`),process.exit(1))}var t=g(process.argv);{let{trackCliEvent:a}=await import("./chunks/telemetry-6BJJFDDX.js");a({event:"cli_command_invoked",properties:{command:t.command||(t.version?"version":t.help?"help":"none"),arg_count:t.commandArgs.length,platform:process.platform,arch:process.arch,node_version:process.versions.node}})}async function c(a){let{flushCliTelemetry:e}=await import("./chunks/telemetry-6BJJFDDX.js");await e(),process.exit(a)}if(t.version){let{getCliVersion:a}=await import("./chunks/cli-version-D3EINJYQ.js"),{IS_BETA:e,BETA_LABEL:i}=await import("./chunks/beta-OJZBBTGE.js"),m=e?` \xB7 ${i}`:"";console.log(`sootsim v${a()}${m}`);let{readActiveRuntime:h}=await import("./chunks/home-paths-6O3WRSPE.js"),w=h();console.log(w?`runtime v${w}`:"runtime not installed"),await c(0)}if(t.help&&!t.command){let{printHelp:a}=await import("./chunks/help-AS4Z2FND.js");a(),await c(0)}var o=t.globalFlags.port,n=t.verbose,p=t.globalFlags.device,l=t.globalFlags.theme,S=t.globalFlags.driver,E=t.globalFlags.headless===!0,b=t.globalFlags.sim??t.globalFlags.session??t.globalFlags.tab,s=b?["--sim",b,...t.commandArgs]:t.commandArgs;if(p||l){let{settingsStore:a}=await import("./chunks/store-GTC6V2PO.js"),e={};p&&(e.deviceModel=p),l&&(e.colorScheme=l),a.apply(e)}if(!t.command&&t.commandArgs.length===0){let{runStart:a}=await import("./chunks/start-NLEY3RB2.js");await a([],{port:o}),await c(0)}var r=t.command??"";if(!r){if(t.commandArgs.length>0){let e=t.commandArgs.find(i=>!i.startsWith("-"))??t.commandArgs[0];console.error(` unknown command: ${e}`),console.error(" run `sootsim --help` to see the full surface."),await c(1)}let{printHelp:a}=await import("./chunks/help-AS4Z2FND.js");a(),await c(0)}if(r in d){let a=d[r],e=t.commandArgs.length>0?` ${t.commandArgs.join(" ")}`:"";console.error(` \`sootsim ${r}\` was removed. use \`${a}\` instead.`),e&&console.error(` \u2192 ${a}${e}`),console.error(" run `sootsim --help` to see the new verb groups."),await c(1)}if(t.help||t.commandArgs.includes("--help")||t.commandArgs.includes("-h")){let a=r==="do"||r==="get"||r==="debug"||r==="shell"||r==="wait",e=t.commandArgs.find(i=>!i.startsWith("-"));if(r!=="shell")if(a&&!e){let{printGroupHelp:i}=await import("./chunks/help-AS4Z2FND.js");i(r)&&await c(0)}else{let{printCommandHelp:i}=await import("./chunks/help-AS4Z2FND.js");i(a&&e?e:r,{prefer:a&&e?"verb":"command",group:a&&e?r:void 0}),await c(0)}}v(r);if(u.has(r)){let{ensureSootsimReady:a,resolveBootstrapPort:e}=await import("./chunks/auto-bootstrap-JD7JT5JS.js"),i=e(s,o);await a(i);let{runInspect:m}=await import("./chunks/inspect-ADZLCQTO.js");await m([r,...s],{port:i,verbose:n})}else switch(r){case"assert":{let{runAssert:a}=await import("./chunks/assert-6TFSLJZZ.js");await a(t.commandArgs);break}case"flow":{let{runFlow:a}=await import("./chunks/flow-3ZYT4CYB.js"),e=await a(s);process.exit(typeof e=="number"?e:0)}case"test":{let{runTest:a}=await import("./chunks/test-MHLSSGM7.js");await a(t.commandArgs,{port:o,verbose:n});break}case"detox":{let{runDetox:a}=await import("./chunks/detox-IER2FXXY.js");await a(t.commandArgs,{port:o,verbose:n});break}case"maestro":{let{runMaestro:a}=await import("./chunks/maestro-EZ62M2VG.js"),e=await a(s,{port:o,verbose:n});process.exit(typeof e=="number"?e:0)}case"preview":{let{runPreview:a}=await import("./chunks/preview-KRDPFRKF.js");await a(t.commandArgs,{port:o,verbose:n});break}case"record":{let{runRecord:a}=await import("./chunks/record-JIDVPW3G.js");await a(s,{port:o,verbose:n});break}case"profile":{let{runProfile:a}=await import("./chunks/profile-75A7BSOQ.js"),e=await a(t.commandArgs,{port:o,verbose:n});process.exit(typeof e=="number"?e:0)}case"cpu-profile":{let{runCpuProfile:a}=await import("./chunks/cpu-profile-SSK4NTBF.js"),e=await a(s,{port:o,verbose:n});process.exit(typeof e=="number"?e:0)}case"react":{let{runReact:a}=await import("./chunks/react-UCAXWTQU.js"),e=await a(s,{port:o,verbose:n});process.exit(typeof e=="number"?e:0)}case"screenshot":{let{runScreenshot:a}=await import("./chunks/screenshot-IASSDVSN.js");await a(s,{port:o,verbose:n});break}case"screenshots":{let{runScreenshots:a}=await import("./chunks/screenshots-T5YPBSYI.js"),e=await a(s,{port:o,verbose:n});process.exit(typeof e=="number"?e:0)}case"screenshot-mode":{let{runScreenshotMode:a}=await import("./chunks/screenshot-mode-N5QGF5RE.js");await a(t.commandArgs,{port:o,verbose:n});break}case"three-mode":case"3d-mode":{let{runThreeMode:a}=await import("./chunks/three-mode-E6FNRWW2.js");await a(t.commandArgs,{port:o,verbose:n});break}case"inspect":{let{runInspect:a}=await import("./chunks/inspect-ADZLCQTO.js");await a(s,{port:o,verbose:n});break}case"debug":{let{runDebug:a}=await import("./chunks/debug-VRDAVGN6.js");await a(s,{port:o,verbose:n});break}case"timeline":{let{runTimeline:a}=await import("./chunks/timeline-2TORZFTW.js");await a(s,{port:o,verbose:n});break}case"what-happened":{let{runWhatHappened:a}=await import("./chunks/what-happened-UVBUSMG3.js");await a(s,{port:o,verbose:n});break}case"diagnose":{let{runDiagnose:a}=await import("./chunks/diagnose-IQVAFQGI.js"),e=await a(s,{port:o,verbose:n});process.exit(typeof e=="number"?e:0)}case"open":{let{ensureSootsimReady:a,resolveBootstrapPort:e}=await import("./chunks/auto-bootstrap-JD7JT5JS.js"),i=e(s,o);await a(i);let{runOpenCommand:m}=await import("./chunks/control-OPM5UT5V.js");await m(s,{port:i});break}case"use":case"focus":{let{runUseCommand:a}=await import("./chunks/control-OPM5UT5V.js");await a(s,{port:o});break}case"claim":{let{runClaimCommand:a}=await import("./chunks/control-OPM5UT5V.js");await a(s,{port:o});break}case"close":{let{runCloseCommand:a}=await import("./chunks/control-OPM5UT5V.js");await a(s,{port:o});break}case"config":{let{runConfig:a}=await import("./chunks/config-GPQXM7XD.js");await a(t.commandArgs);break}case"device":{let{runDeviceCommand:a}=await import("./chunks/device-XH546AFN.js");await a(s,{port:o});break}case"scan":case"compat":{let{runCompat:a}=await import("./chunks/compat-RQSP3A4K.js");await a(t.commandArgs);break}case"electron":{let{runElectron:a}=await import("./chunks/electron-DGAACAIN.js");await a(t.commandArgs,{port:o,device:p,driver:S});break}case"login":{let{runLogin:a}=await import("./chunks/login-J7W3QNG5.js");await a(t.commandArgs);break}case"logout":{let{runLogout:a}=await import("./chunks/logout-J2YBTA5E.js");await a();break}case"whoami":{let{runWhoami:a}=await import("./chunks/whoami-2Y422P77.js");await a();break}case"keys":{let{runKeys:a}=await import("./chunks/keys-AU777KZN.js");await a(t.commandArgs);break}case"setup-repo":{let{runSetupRepo:a}=await import("./chunks/setup-repo-LJIDHL6S.js");await a(t.commandArgs);break}case"install":{let{runInstall:a}=await import("./chunks/install-P6K5SUCS.js");await a(t.commandArgs);break}case"install-desktop":{let{runInstallDesktop:a}=await import("./chunks/install-desktop-MZ47Z4X5.js");await a(t.commandArgs);break}case"server":{let{runServer:a}=await import("./chunks/server-OUOF3SW4.js");await a(t.commandArgs,{port:o});break}case"daemon":{let{runDaemon:a}=await import("./chunks/daemon-5SXKDVTQ.js");await a(t.commandArgs,{port:o});break}case"runtime":{let{runRuntime:a}=await import("./chunks/runtime-ACX43ZIT.js");await a(t.commandArgs);break}case"upgrade":{let{runUpgrade:a}=await import("./chunks/upgrade-FT3QFFOF.js");await a(t.commandArgs);break}case"version":{let{runVersion:a}=await import("./chunks/version-WYYMIGAV.js");await a(t.commandArgs);break}case"launch":{let{runLaunch:a}=await import("./chunks/launch-E34RMXXP.js");await a(t.commandArgs);break}case"start":{let{runStart:a}=await import("./chunks/start-NLEY3RB2.js");await a(t.commandArgs,{port:o});break}case"agent":{let{runAgentCommand:a}=await import("./chunks/agent-VMB2RUAT.js"),e=await a(t.commandArgs);process.exit(e)}case"agent-wrapper":{let{runAgentWrapper:a}=await import("./chunks/agent-wrapper-Z3ROMZQZ.js"),e=await a(t.commandArgs);process.exit(e)}case"skills":{let{runSkills:a}=await import("./chunks/skills-3XZ5EHZS.js");await a(t.commandArgs);break}case"upload":{let{runUpload:a}=await import("./chunks/upload-ZAAQ5XTC.js");await a(t.commandArgs,{port:o,verbose:n});break}case"app-fonts":{let{runAppFonts:a}=await import("./chunks/app-fonts-NMKBEO3H.js");await a(t.commandArgs);break}case"hints":{let{runHints:a}=await import("./chunks/hints-27ZUR5TJ.js");a(t.commandArgs);break}default:console.error(` unknown command: ${r}`),console.error(" run `sootsim --help` to see the full surface."),process.exit(1)}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as E,b as A,c as S,d as l,e as j,g as T,h as I,j as D,m as k,n as x,o as O,p as g,q as R,r as C}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.134 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as E,b as A,c as S,d as l,e as j,g as T,h as I,j as D,m as k,n as x,o as O,p as g,q as R,r as C}from"./chunk-L35AUO7S.js";import"./chunk-SUQFTSA4.js";import{c as b}from"./chunk-M63L7MMI.js";import"./chunk-ORHN5FYU.js";import"./chunk-DWLMWYVM.js";import"./chunk-WYDL2H2W.js";import"./chunk-535S34EI.js";import"./chunk-ZLITT2QF.js";import"./chunk-ELJTZV3R.js";import"./chunk-WFKQBUVT.js";import{h as y,i as $}from"./chunk-GKW7BY7I.js";import"./chunk-UKGEBJO7.js";import w from"node:fs";import d from"node:path";import{spawn as F}from"node:child_process";import B from"node:net";import{WebSocket as M}from"ws";var c=class extends Error{code;constructor(e,t){super(e),this.name="AgentDaemonError",this.code=t}},f=class{ws;port;commandTimeoutMs;ready;closed=!1;nextId=1;pending=new Map;eventListeners=new Set;statusListeners=new Set;disconnectListeners=new Set;constructor(e={}){this.port=e.port??7668,this.commandTimeoutMs=e.commandTimeoutMs??15e3,this.ws=new M(`ws://localhost:${this.port}`),this.ready=new Promise((t,r)=>{let s=()=>{this.ws.off("error",o),t()},o=i=>{this.ws.off("open",s),r(new c(`could not connect to sootsim daemon on port ${this.port}: ${i.message}`,"NO_DAEMON"))};this.ws.once("open",s),this.ws.once("error",o)}),this.ws.on("message",t=>this.handleMessage(t)),this.ws.on("close",()=>this.handleClose()),this.ws.on("error",()=>{})}async waitReady(){return this.ready}async listProjects(){return this.send("agent:list-projects")}async upsertProject(e){return this.send("agent:upsert-project",{input:e})}async deleteProject(e){return this.send("agent:delete-project",{projectId:e})}async autoAttachForUrl(e){return this.send("agent:auto-attach-for-url",{input:e})}async listSessions(e){return this.send("agent:list-sessions",{projectId:e})}async startSession(e){return this.send("agent:start-session",{input:e})}async sendPrompt(e,t){return this.send("agent:send-prompt",{sessionId:e,prompt:t})}async endSession(e){return this.send("agent:end-session",{sessionId:e})}async getTranscript(e){return this.send("agent:get-transcript",{sessionId:e})}async getPaths(){return this.send("agent:get-paths")}async subscribeEvents(e){return this.send("agent:subscribe-events",{sessionId:e})}async unsubscribeEvents(e){return this.send("agent:unsubscribe-events",{sessionId:e})}onAgentEvent(e){return this.eventListeners.add(e),()=>this.eventListeners.delete(e)}onSessionStatusChange(e){return this.statusListeners.add(e),()=>this.statusListeners.delete(e)}onDisconnect(e){return this.disconnectListeners.add(e),()=>this.disconnectListeners.delete(e)}close(){if(!this.closed){this.closed=!0;try{this.ws.close()}catch{}}}async send(e,t={}){if(await this.ready,this.closed||this.ws.readyState!==M.OPEN)throw new c("daemon connection is closed","NO_DAEMON");let r=this.nextId++;return new Promise((s,o)=>{let i=setTimeout(()=>{this.pending.delete(r),o(new c(`${e} timed out after ${Math.round(this.commandTimeoutMs/1e3)}s`,"TIMEOUT"))},this.commandTimeoutMs);this.pending.set(r,{resolve:s,reject:o,timer:i});try{this.ws.send(JSON.stringify({id:r,type:e,...t}))}catch(a){clearTimeout(i),this.pending.delete(r),o(a instanceof Error?a:new Error(String(a)))}})}handleMessage(e){let t;try{t=JSON.parse(String(e))}catch{return}if(!t||typeof t!="object")return;if(t.type==="agent:event"){for(let s of this.eventListeners)try{s({sessionId:t.sessionId,event:t.event})}catch{}return}if(t.type==="agent:session-status"){for(let s of this.statusListeners)try{s(t.session)}catch{}return}if(typeof t.id!="number")return;let r=this.pending.get(t.id);r&&(this.pending.delete(t.id),clearTimeout(r.timer),t.error?r.reject(new c(t.error,t.code)):r.resolve(t.result))}handleClose(){if(!this.closed){this.closed=!0;for(let[,e]of this.pending)clearTimeout(e.timer),e.reject(new c("daemon disconnected","DISCONNECT"));this.pending.clear();for(let e of this.disconnectListeners)try{e()}catch{}}}};function L(n=7668,e=400){return new Promise(t=>{let r=new B.Socket,s=!1,o=i=>{s||(s=!0,r.destroy(),t(i))};r.setTimeout(e),r.once("connect",()=>o(!0)),r.once("timeout",()=>o(!1)),r.once("error",()=>o(!1)),r.connect(n,"127.0.0.1")})}async function W(n={}){let e=n.port??7668;if(await L(e))return{alreadyRunning:!0};if($()){let a=y()?"this is a dev workstation (IS_TAMAGUI_DEV=1)":"this is a dev checkout";throw new c(`no sootsim bridge on port ${e} and refusing to spawn a standalone daemon \u2014 ${a}. start the live \`bun dev\` stack so the bridge is up, or set SOOTSIM_FORCE_DAEMON_INSTALL=1 to spawn one here on purpose.`,"DEV_HOST_REFUSED")}let{cmd:t,prefixArgs:r}=C(),s=[...r,"server","--quiet"];e!==7668&&s.push("--port",String(e));let o=F(t,s,{detached:!0,stdio:"ignore",env:process.env,cwd:process.cwd()});o.unref();let i=Date.now()+(n.startupTimeoutMs??5e3);for(;Date.now()<i;){if(await L(e))return{alreadyRunning:!1,pid:o.pid};await new Promise(a=>setTimeout(a,100))}throw new c(`spawned sootsim daemon on port ${e} but it did not come up in time. run \`sootsim server\` manually to diagnose.`,"SPAWN_TIMEOUT")}async function h(n={}){await W({port:n.port,startupTimeoutMs:n.startupTimeoutMs});let e=new f(n);try{await e.waitReady()}catch(t){throw e.close(),t}return e}async function fe(n){let[e,...t]=n;try{switch(e){case void 0:case"--help":case"-h":case"help":return _(),0;case"attach":return await V(t);case"projects":return await J();case"project":return await G(t);case"sessions":return await H(t);case"start":return await q(t);case"prompt":return await K(t);case"watch":return await X(t);case"transcript":return await Q(t);case"end":return await Y(t);case"paths":return await Z();default:return process.stderr.write(`unknown agent subcommand: ${e}
|
|
3
3
|
`),_(),2}}catch(r){if(r instanceof c)return process.stderr.write(`${r.message}
|
|
4
4
|
`),1;throw r}}async function v(n){let e=await h({clientLabel:"sootsim-agent-cli"});try{return await n(e)}finally{e.close()}}function _(){b("agent")}function P(n,e){let t={},r=[];for(let s=0;s<n.length;s++){let o=n[s],i=e[o];i==="value"?(t[o]=n[s+1]??"",s++):i==="bool"?t[o]=!0:r.push(o)}return{flags:t,positional:r}}function U(n,e="codex"){return n==="codex"||n==="claude"?n:e}async function V(n){let{flags:e,positional:t}=P(n,{"--name":"value","--provider":"value"}),r=t[0];if(!r)return process.stderr.write(`usage: sootsim agent attach <dir> [--name X] [--provider codex|claude]
|
|
5
5
|
`),2;let s=d.resolve(r);if(!w.existsSync(s))return process.stderr.write(`directory does not exist: ${s}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{b as M}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.134 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{b as M}from"./chunk-SUQFTSA4.js";import"./chunk-UKGEBJO7.js";import{execFile as G,spawn as q}from"node:child_process";import{randomUUID as X}from"node:crypto";import{constants as R,createReadStream as Y,createWriteStream as j,existsSync as I,openSync as J}from"node:fs";import V from"node:fs/promises";import z from"node:path";import K from"node:readline";import{promisify as Q}from"node:util";import{spawn as H}from"node:child_process";import L from"node:readline";var b=class extends Error{code;data;constructor(t,r,m){super(t),this.name="CodexRpcError",this.code=r,this.data=m}};function W(d){let t=H(d.bin,["app-server"],{cwd:d.cwd,env:{...process.env,...d.env},stdio:["pipe","pipe","pipe"]}),r=new Map,m=new Map,u=1,g=!1,a=new Promise(s=>{t.on("exit",(i,e)=>{g=!0;let p=new Error(`codex app-server exited (code=${i}, signal=${e??""})`);for(let{reject:f}of r.values())f(p);r.clear(),s({code:i,signal:e})})});L.createInterface({input:t.stdout,crlfDelay:1/0}).on("line",s=>{let i=s.trim();if(!i)return;let e;try{e=JSON.parse(i)}catch{return}if(e.id!=null&&(e.result!==void 0||e.error!==void 0)){let p=typeof e.id=="string"?Number(e.id):e.id,f=p!=null?r.get(p):void 0;if(!f)return;r.delete(p),e.error?f.reject(new b(e.error.message,e.error.code,e.error.data)):f.resolve(e.result);return}if(e.method){let p=m.get(e.method);if(!p)return;for(let f of p)try{f(e.params)}catch(l){console.error(`[codex-client] handler for "${e.method}" threw:`,l instanceof Error?l.stack??l.message:l)}}}),t.stderr.setEncoding("utf8"),t.stderr.on("data",s=>{let i=m.get("__stderr__");if(i)for(let e of i)try{e({text:s})}catch{}});function n(s){if(!g)try{t.stdin.write(JSON.stringify(s)+`
|
|
3
3
|
`)}catch{}}return{exited:a,on(s,i){let e=m.get(s);return e||(e=new Set,m.set(s,e)),e.add(i),()=>{e?.delete(i)}},request(s,i){if(g)return Promise.reject(new Error(`codex app-server closed; cannot call ${s}`));let e=u++;return new Promise((p,f)=>{r.set(e,{resolve:l=>p(l),reject:f,method:s}),n({jsonrpc:"2.0",id:e,method:s,params:i})})},notify(s,i){n({jsonrpc:"2.0",method:s,params:i})},async shutdown(s=1500){if(g)return;try{t.stdin.end()}catch{}let i=setTimeout(()=>{if(!g)try{t.kill("SIGTERM")}catch{}},s);try{await a}finally{clearTimeout(i)}},kill(s="SIGTERM"){if(!g)try{t.kill(s)}catch{}}}}var O="never",F="danger-full-access",Z={type:"dangerFullAccess"},D="fast",ee="medium",te=Q(G);async function ne(d,t){let r=t||d;if(r.includes("/")||r.includes("\\"))return I(r)?{ok:!0,path:r}:{ok:!1,message:`agent binary not found at path: ${r}`};try{let{stdout:m}=await te("which",[r],{timeout:1500}),u=m.trim();return u?{ok:!0,path:u}:{ok:!1,message:`${r} not found on PATH`}}catch{return{ok:!1,message:`${r} not found on PATH. install the ${d} CLI and retry, or pass --${d}-bin /path/to/${d} to agent start.`}}}function re(d){let t={"--session-id":"sessionId","--project-id":"projectId","--provider":"provider","--cwd":"cwd","--prompt-in":"promptIn","--events-out":"eventsOut","--transcript":"transcript","--codex-bin":"codexBin","--claude-bin":"claudeBin","--claude-session-uuid":"claudeSessionUuid"},r={};for(let m=0;m<d.length;m++){let u=d[m];if(u==="--fresh-thread"){r.freshThread=!0;continue}let g=t[u];g&&(r[g]=d[m+1],m++)}return r}async function Ie(d){let t=re(d);if(!t.sessionId||!t.projectId||!t.provider||!t.cwd||!t.promptIn||!t.eventsOut)return process.stderr.write(`usage: sootsim agent-wrapper --session-id <id> --project-id <id>
|
|
4
4
|
--provider codex|claude --cwd <path>
|
|
5
5
|
--prompt-in <fifo> --events-out <fifo>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{d as p}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.134 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{d as p}from"./chunk-SOK4CAR5.js";import"./chunk-UKGEBJO7.js";import{existsSync as h,mkdirSync as d,readFileSync as y,writeFileSync as g}from"node:fs";import{join as m}from"node:path";import{gzipSync as w}from"node:zlib";function f(t,e){let o=t.indexOf(`--${e}`);if(o!==-1&&o+1<t.length)return t[o+1];let i=t.find(r=>r.startsWith(`--${e}=`));return i?i.slice(e.length+3):void 0}async function S(t){let e=f(t,"wire")||"",o=f(t,"out-dir"),i=f(t,"manifest");if((!o||!i)&&(console.error(" usage: sootsim app-fonts stage --wire <wire> --out-dir <dir> --manifest <path>"),process.exit(1)),!e.trim()){console.log("no app fonts declared \u2014 nothing to stage");return}d(o,{recursive:!0});let r=await p(e,{onStaged:({url:n,byteLength:s})=>console.log(` staged app font: ${n} (${(s/1024).toFixed(1)} KiB)`),onError:(n,s)=>console.error(` warning: failed to fetch app font ${n}: ${s instanceof Error?s.message:s}`)}),a=[];for(let n of r){let s=w(n.bytes);g(m(o,n.urlhash),s),a.push({url:n.url,urlhash:n.urlhash,contentType:n.contentType,encoding:"gzip",sizeBytes:s.length,rawBytes:n.bytes.byteLength})}let c=[];if(h(i))try{let n=JSON.parse(y(i,"utf8"));Array.isArray(n)&&(c=n)}catch{}let u=new Set(c.map(n=>n.urlhash)),l=[...c,...a.filter(n=>!u.has(n.urlhash))];g(i,JSON.stringify(l)),console.log(`staged ${a.length} app font(s); manifest now has ${l.length} file(s)`)}async function E(t){let e=t[0];if(e==="stage"){await S(t.slice(1));return}console.error(` unknown app-fonts subcommand: ${e??"(none)"}`),console.error(" available: stage"),process.exit(1)}export{E as runAppFonts};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import"./chunk-
|
|
1
|
+
/*! sootsim v0.1.134 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import"./chunk-UKGEBJO7.js";import{spawn as x}from"child_process";var w=new Set(["describe","find","list","network","logs","count","tree","url","a11y","node","layout","keyboard","errors","warnings","requests","animations","animation","state","sample-color"]),S=new Set(["--exists","--empty","--negate","--quiet","--allow-timeout","!"]),q=new Set(["--count","--count-at-least","--count-at-most","--contains","--not-contains","--matches","--not-matches","--equals","--jq","--has-path","--within"]),P=new Set(["--path-equals"]);function j(s){let r=[],u=[],n=0,e=!1,t=!1,i=!1;for(let o=0;o<s.length;o++){let a=s[o];if(a==="--within"){let c=Number(s[o+1]);if(!Number.isFinite(c)||c<0)return{error:`--within requires a non-negative number, got: ${s[o+1]}`};n=c,o++;continue}if(a==="--negate"||a==="!"){e=!0;continue}if(a==="--quiet"){t=!0;continue}if(a==="--allow-timeout"){i=!0;continue}if(S.has(a)){u.push({kind:a,args:[]});continue}if(q.has(a)){let c=s[o+1];if(c==null)return{error:`${a} requires a value`};u.push({kind:a,args:[c]}),o++;continue}if(P.has(a)){let c=s[o+1],f=s[o+2];if(c==null||f==null)return{error:`${a} requires <path> <value>`};u.push({kind:a,args:[c,f]}),o+=2;continue}r.push(a)}return r.length===0?{error:"assert requires a verb (e.g. find, describe, get errors)"}:{verbArgs:r,predicates:u,withinMs:n,negate:e,quiet:t,allowTimeout:i}}function N(s){return s[0]==="get"||s[0]==="debug"?w.has(s[1])?s[1]:null:s[0]==="do"||s[0]==="wait"?null:w.has(s[0])?s[0]:null}async function R(s){let u=[process.argv[1],...s,"--json"];return new Promise(n=>{let e=x(process.execPath,u,{stdio:["ignore","pipe","pipe"],env:process.env}),t="",i="";e.stdout.on("data",o=>t+=o.toString()),e.stderr.on("data",o=>i+=o.toString()),e.on("error",o=>{n({ok:!1,payload:null,reason:`spawn failed: ${o.message}`})}),e.on("close",o=>{if(o!==0){let a=i.trim().split(`
|
|
3
3
|
`).slice(-2).join(" | ").slice(0,200);n({ok:!1,payload:null,reason:`verb exited ${o}${a?`: ${a}`:""}`});return}if(!t.trim()){n({ok:!1,payload:null,reason:"verb produced no output"});return}try{let a=JSON.parse(t);n({ok:!0,payload:a})}catch{n({ok:!1,payload:null,reason:`verb output was not valid json: ${t.slice(0,120)}`})}})})}function y(s,r){let u=r.split(".").filter(e=>e.length>0),n=s;for(let e of u){if(n==null)return{found:!1};if(Array.isArray(n)){let t=Number(e);if(!Number.isInteger(t)||t<0||t>=n.length)return{found:!1};n=n[t];continue}if(typeof n=="object"){let t=n;if(!(e in t))return{found:!1};n=t[e];continue}return{found:!1}}return{found:!0,value:n}}function d(s){return Array.isArray(s)?s.length:s&&typeof s=="object"?Object.keys(s).length:null}async function A(s,r){let{kind:u,args:n}=s;switch(u){case"--exists":return r==null?{ok:!1,reason:"payload is null"}:d(r)===0?{ok:!1,reason:"payload is empty"}:{ok:!0,reason:"exists"};case"--empty":{if(r==null)return{ok:!0,reason:"payload is null"};let e=d(r);return e===0?{ok:!0,reason:"payload is empty"}:{ok:!1,reason:`payload has ${e} item(s)`}}case"--count":{let e=Number(n[0]),t=d(r);return t==null?{ok:!1,reason:`payload not countable (${typeof r})`}:{ok:t===e,reason:`count=${t}, want=${e}`}}case"--count-at-least":{let e=Number(n[0]),t=d(r);return t==null?{ok:!1,reason:"payload not countable"}:{ok:t>=e,reason:`count=${t}, want>=${e}`}}case"--count-at-most":{let e=Number(n[0]),t=d(r);return t==null?{ok:!1,reason:"payload not countable"}:{ok:t<=e,reason:`count=${t}, want<=${e}`}}case"--contains":{let e=n[0],t=JSON.stringify(r);return{ok:t.includes(e),reason:t.includes(e)?`contains "${e}"`:`missing "${e}"`}}case"--not-contains":{let e=n[0],t=JSON.stringify(r);return{ok:!t.includes(e),reason:t.includes(e)?`unexpected "${e}"`:`not contains "${e}"`}}case"--matches":{let e=new RegExp(n[0]),t=JSON.stringify(r),i=e.test(t);return{ok:i,reason:i?`matches /${n[0]}/`:`no match for /${n[0]}/`}}case"--not-matches":{let e=new RegExp(n[0]),t=JSON.stringify(r),i=!e.test(t);return{ok:i,reason:i?`not matches /${n[0]}/`:`unexpected /${n[0]}/`}}case"--equals":{let e=n[0],t=typeof r=="string"?r:typeof r=="number"||typeof r=="boolean"?String(r):JSON.stringify(r);return{ok:t===e,reason:`got=${JSON.stringify(t)}, want=${JSON.stringify(e)}`}}case"--has-path":{let e=y(r,n[0]);return{ok:e.found,reason:e.found?`path ${n[0]} present`:`path ${n[0]} missing`}}case"--path-equals":{let[e,t]=n,i=y(r,e);if(!i.found)return{ok:!1,reason:`path ${e} missing`};let o=typeof i.value=="string"||typeof i.value=="number"||typeof i.value=="boolean"?String(i.value):JSON.stringify(i.value);return{ok:o===t,reason:`${e}=${o}, want=${t}`}}case"--jq":{let e=n[0];try{let i=(await O(e,r)).trim();return{ok:i.length>0&&i!=="null"&&i!=="false"&&i!=='""',reason:`jq: ${i.slice(0,120)}`}}catch(t){throw new Error(`jq evaluation failed: ${t.message}`)}}default:return{ok:!1,reason:`unknown predicate ${u}`}}}function O(s,r){return new Promise((u,n)=>{let e=x("jq",[s],{stdio:["pipe","pipe","pipe"]}),t="",i="";e.stdout.on("data",o=>t+=o.toString()),e.stderr.on("data",o=>i+=o.toString()),e.on("error",n),e.on("close",o=>{if(o!==0){n(new Error(i.trim()||`jq exited ${o}`));return}u(t)}),e.stdin.end(JSON.stringify(r))})}async function T(s){(s[0]==="--help"||s[0]==="-h"||s.length===0)&&(J(),process.exit(s.length===0?2:0));let r=j(s);"error"in r&&(process.stderr.write(` assert: ${r.error}
|
|
4
4
|
`),process.exit(2));let{verbArgs:u,predicates:n,withinMs:e,negate:t,quiet:i,allowTimeout:o}=r;N(u)||(process.stderr.write(` assert: unknown or non-read verb: ${u.join(" ")}
|
|
5
5
|
supported: ${Array.from(w).sort().join(", ")}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! sootsim v0.1.134 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a,b,c,d}from"./chunk-YY7XLGEP.js";import"./chunk-SFXCDLYK.js";import"./chunk-T3FWQAUS.js";import"./chunk-535S34EI.js";import"./chunk-GKW7BY7I.js";import"./chunk-UKGEBJO7.js";export{c as ensureDaemonRunning,a as ensureRuntimeInstalled,d as ensureSootsimReady,b as resolveBootstrapPort};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{a as s}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.134 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as s}from"./chunk-QAQTDA4L.js";import{n as o}from"./chunk-GKW7BY7I.js";import{chmodSync as p,existsSync as d,mkdirSync as g,readFileSync as I,rmSync as f,writeFileSync as _}from"node:fs";import{dirname as y,join as h,resolve as k}from"node:path";function i(){return h(o(),"credentials.json")}function S(){let n=i();if(!d(n))return null;try{let t=JSON.parse(I(n,"utf8"));return t.version!==1||typeof t.apiKey!="string"||!t.apiKey.startsWith("sk_sootsim_")?null:t.apiKey}catch{return null}}function w(n){if(!n.startsWith("sk_sootsim_"))throw new Error("api key must start with sk_sootsim_");let t=i();g(y(k(t)),{recursive:!0}),_(t,JSON.stringify({version:1,apiKey:n,savedAt:new Date().toISOString()},null,2)+`
|
|
3
3
|
`);try{p(t,384)}catch{}}function E(){f(i(),{force:!0})}var m=["ghs_","ghp_","gho_","ghu_","github_pat_"];function O(n){return!!(n&&n.length>=20&&m.some(t=>n.startsWith(t)))}function A(){let n=process.env.SOOT_INSTALLATION_TOKEN?.trim(),t=process.env.GITHUB_TOKEN?.trim(),r=n||t;if(!O(r))return null;let e=(process.env.SOOT_REPO||process.env.GITHUB_REPOSITORY||"").trim();if(!e)return null;let[l,u]=e.includes("/")?e.split("/",2):[null,null],c=(process.env.SOOT_REPO_ID||process.env.GITHUB_REPOSITORY_ID||"").trim(),a=(process.env.SOOT_INSTALLATION_ID||process.env.GITHUB_APP_INSTALLATION_ID||"").trim();return{kind:"github",token:r,repoId:e,repositoryId:c||null,owner:l||null,repo:u||null,installationId:a||null,source:n?"soot-runner":"github-actions"}}function x(){let n=process.env.SOOTSIM_API_KEY?.trim();if(n&&n.startsWith("sk_sootsim_"))return{kind:"api-key",secret:n,source:"env"};let t=A();if(t)return t;let r=S();if(r)return{kind:"api-key",secret:r,source:"file"};let e=s();return e?.token?{kind:"session",token:e.token,origin:e.origin}:null}function H(n){return n.kind==="api-key"?`Bearer ${n.secret}`:`Bearer ${n.token}`}function N(n){return!n||n.kind!=="github"?null:{repoId:n.repoId,owner:n.owner??void 0,repo:n.repo??void 0,installationId:n.installationId}}export{S as a,w as b,E as c,x as d,H as e,N as f};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{A as R,B as g,C as v,E as w,k as p,t as b,v as S}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.134 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{A as R,B as g,C as v,E as w,k as p,t as b,v as S}from"./chunk-GKW7BY7I.js";import{spawn as I}from"child_process";import P from"crypto";import s from"fs";import l from"path";import{Readable as k}from"stream";import{pipeline as E}from"stream/promises";var M="https://sootbean.com",C="SOOTSIM_CDN_ORIGIN",N="SOOTSIM_RUNTIME_CHANNEL";function $(){try{let e=JSON.parse(s.readFileSync(S(),"utf8"));return e&&typeof e=="object"?e:{}}catch{return{}}}function m(e){let t=$();return(e||process.env[C]||t.cdnOrigin||M).replace(/\/+$/,"")}function x(e){let t=$();return e||process.env[N]||t.runtimeChannel||"stable"}function T(e){let t=new URL(`${m(e)}/runtimes/manifest.json`);return t.searchParams.set("t",String(Date.now())),t.toString()}function D(e,t){return`${m(t)}/runtimes/sootsim-runtime-${e}.tar.gz`}async function y(e){let t=T(e),r=await fetch(t,{headers:{Accept:"application/json"}});if(!r.ok)throw new Error(`manifest fetch failed: ${r.status} ${r.statusText} (${t})`);return await r.json()}function U(e,t){let r=new URL(`${m(t)}/api/changelog/sootsim`);return r.searchParams.set("page",String(e)),r.searchParams.set("t",String(Date.now())),r.toString()}async function V(e,t){let r=U(e,t),n=await fetch(r,{headers:{Accept:"application/json"}});if(n.status===404)return{product:"sootsim",updatedThrough:null,page:e,pageSize:0,total:0,totalPages:0,hasMore:!1,entries:[]};if(!n.ok)throw new Error(`releases fetch failed: ${n.status} ${n.statusText} (${r})`);return await n.json()}async function K(e){let t=[],r=1;for(let n=0;n<1e3;n++){let i=await V(r,e);if(Array.isArray(i.entries)&&t.push(...i.entries),!i.hasMore||i.entries.length===0)break;r++}return t}function A(e,t={}){let r=x(t.channel),n=t.version||e.channels[r]?.latest;if(!n)throw new Error(`no version specified and channel '${r}' has no latest entry in the manifest`);let i=e.versions[n];if(!i)throw new Error(`version ${n} not found in manifest; available: ${Object.keys(e.versions).slice(-10).join(", ")||"(none)"}`);return{version:n,channel:r,entry:i}}async function j(e={}){R();let t=m(e.cdnOrigin),r=await y(t),{version:n,channel:i,entry:o}=A(r,e),a=p(n),c=e.setActive!==!1;if(!e.force&&s.existsSync(l.join(a,"index.html")))return c&&v(n),{version:n,channel:i,cdnOrigin:t,runtimeDir:a,installed:!1,activated:c,manifest:r};let d=o.tarball||D(n,t),f=l.join(b(),`sootsim-runtime-${n}.tar.gz`);process.stderr.write(`sootsim: downloading runtime ${n}\u2026
|
|
3
3
|
`),await _(d,f),process.stderr.write(`sootsim: extracting runtime ${n}\u2026
|
|
4
4
|
`);let h=await z(f);if(h!==o.sha256)throw s.rmSync(f,{force:!0}),new Error(`sha256 mismatch for runtime ${n}: expected ${o.sha256}, actual ${h}`);let u=l.join(l.dirname(a),`.installing-${n}-${process.pid}`);s.rmSync(u,{recursive:!0,force:!0}),s.mkdirSync(u,{recursive:!0});try{if(await L(f,u),!s.existsSync(l.join(u,"index.html")))throw new Error(`extracted tarball for runtime ${n} is missing index.html`);s.rmSync(a,{recursive:!0,force:!0}),s.renameSync(u,a)}catch(O){throw s.rmSync(u,{recursive:!0,force:!0}),O}return c&&v(n),{version:n,channel:i,cdnOrigin:t,runtimeDir:a,installed:!0,activated:c,manifest:r}}async function Q(e={}){R();let t=m(e.cdnOrigin),r=x(e.channel),n=await y(t),i=n.channels[r]?.latest;if(!i)return{checked:!0,updated:!1,reason:`channel '${r}' has no latest runtime`,activeVersion:g()};if(!n.versions[i])return{checked:!0,updated:!1,reason:`manifest is missing version ${i}`,activeVersion:g(),latestVersion:i};let a=g(),c=a?p(a):null,d=c?s.existsSync(l.join(c,"index.html")):!1;if(!(!a||!d||w(i,a)>0))return{checked:!0,updated:!1,reason:"active runtime is current",activeVersion:a,latestVersion:i};let h=await j({version:i,channel:r,cdnOrigin:t,setActive:!1});return{checked:!0,updated:!0,activeVersion:i,latestVersion:i,install:h}}async function X(e={}){let t=g();try{let r=await y(m(e.cdnOrigin)),n=x(e.channel),i=r.channels[n]?.latest??null,o=!!(i&&(!t||w(i,t)>0));return{active:t,latest:i,outdated:o}}catch{return{active:t,latest:null,outdated:!1}}}async function _(e,t){let r=await fetch(e);if(!r.ok||!r.body)throw new Error(`download failed: ${r.status} ${r.statusText} (${e})`);s.mkdirSync(l.dirname(t),{recursive:!0});let n=`${t}.partial`;try{await E(k.fromWeb(r.body),s.createWriteStream(n)),s.renameSync(n,t)}catch(i){try{s.unlinkSync(n)}catch{}throw i}}function z(e){return new Promise((t,r)=>{let n=P.createHash("sha256"),i=s.createReadStream(e);i.on("data",o=>n.update(o)),i.on("error",r),i.on("end",()=>t(n.digest("hex")))})}function L(e,t){return new Promise((r,n)=>{let i=I("tar",["-xzf",e,"-C",t],{stdio:["ignore","inherit","inherit"]});i.on("error",n),i.on("exit",o=>{o===0?r():n(new Error(`tar exited with code ${o}`))})})}export{M as a,C as b,N as c,m as d,x as e,T as f,D as g,y as h,U as i,K as j,A as k,j as l,Q as m,X as n};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.134 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
var t=4001,n="sootsim close";export{t as a,n as b};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{A as m,n as P,p as a}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.134 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{A as m,n as P,p as a}from"./chunk-GKW7BY7I.js";import l from"fs";import c from"path";var s="default",S="profiles.json",i=1;function o(e){let r=e.trim();if(!r)throw new Error("profile id is required");if(!/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(r))throw new Error("profile ids must start with a letter or number and contain only letters, numbers, dot, dash, or underscore");if(r==="."||r==="..")throw new Error(`invalid profile id: ${r}`);return r}function d(){return c.join(a(),S)}function I(e){return`sootsim-profile-${o(e)}`}function h(e){return c.join(P(),"Partitions",I(e))}function A(e){return c.join(a(),"playwright",o(e))}function u(){try{let e=JSON.parse(l.readFileSync(d(),"utf8"));if(!e||e.version!==i)return{version:i,profiles:[]};let r=Array.isArray(e.profiles)?e.profiles.filter(t=>!!t&&typeof t.id=="string"&&typeof t.createdAt=="string"&&typeof t.updatedAt=="string").map(t=>({id:o(t.id),createdAt:t.createdAt,updatedAt:t.updatedAt})):[];return{version:i,profiles:r}}catch{return{version:i,profiles:[]}}}function x(e){return[...e].sort((r,t)=>r.id===s?-1:t.id===s?1:r.id.localeCompare(t.id))}function p(e){if(e.profiles.some(t=>t.id===s))return{...e,profiles:x(e.profiles)};let r=new Date().toISOString();return{version:i,profiles:x([{id:s,createdAt:r,updatedAt:r},...e.profiles])}}function g(e){m();let r=p(e),t=`${d()}.tmp`;return l.writeFileSync(t,`${JSON.stringify(r,null,2)}
|
|
3
3
|
`,"utf8"),l.renameSync(t,d()),r}function y(){return g(u()).profiles}function E(e){let r=o(e);return y().find(t=>t.id===r)??null}function _(e=s){let r=o(e),t=E(r);return t||D(r)}function D(e){let r=o(e),t=p(u());if(t.profiles.some(w=>w.id===r))throw new Error(`profile already exists: ${r}`);let f=new Date().toISOString(),n={id:r,createdAt:f,updatedAt:f};return g({version:i,profiles:[...t.profiles,n]}),n}function F(e){let r=o(e);if(r===s)throw new Error("the default profile cannot be deleted; clear it instead");let t=p(u()),f=t.profiles.find(n=>n.id===r);if(!f)throw new Error(`profile not found: ${r}`);return g({version:i,profiles:t.profiles.filter(n=>n.id!==r)}),v(r),f}function v(e){let r=o(e);for(let t of[h(r),A(r)])try{l.rmSync(t,{recursive:!0,force:!0})}catch{}}export{A as a,y as b,_ as c,D as d,F as e,v as f};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*! sootsim v0.1.134 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{a as R}from"./chunk-A4XRRJER.js";var C="sootsimConfig";function m(e){return!!e&&Object.keys(e).length>0}function U(e){return e?m(e.modules)||m(e.turboModules)||m(e.nativeModules)||m(e.env)||m(e.settings)||m(e.initialState):!1}function x(e,r){let t=new URL(e);return U(r)?t.searchParams.set(C,JSON.stringify(r)):t.searchParams.delete(C),t.toString()}import{exec as E}from"child_process";import A from"http";import N from"net";import{promisify as L}from"util";var ee="/index.bundle?platform=ios&dev=true&hot=true&minify=false";function _(e){return/^https?:\/\//i.test(e)}function D(e){return e.endsWith(".bundle")}function T(e){process.env.SOOTSIM_PREVIEW_PROD_BUNDLE&&(e.searchParams.set("dev","false"),e.searchParams.set("minify","true"),e.searchParams.has("hot")&&e.searchParams.set("hot","false"))}function k(e){try{let r=_(e),t=new URL(e,"http://soot.local");return t.pathname=t.pathname.replace(/\.\.bundle$/,".bundle"),D(t.pathname)?(t.searchParams.delete("transform.bytecode"),T(t),r?t.toString():`${t.pathname}${t.search}${t.hash}`):e}catch{return e}}var v=L(E),$=250,O=1500,I=120;function B(e,r=I){return new Promise(t=>{let o=new N.Socket,s=!1,i=a=>{s||(s=!0,o.destroy(),t(a))};o.setTimeout(r),o.once("connect",()=>i(!0)),o.once("timeout",()=>i(!1)),o.once("error",()=>i(!1)),o.connect(e,"localhost")})}function h(e,r,t="GET",o=$,s={}){return new Promise(i=>{let a=A.request({hostname:"localhost",port:e,path:r,method:t,timeout:o,headers:s},n=>{let u="";n.on("data",l=>u+=l.toString());let c=(()=>{let l=n.headers["content-type"];if(typeof l=="string")return l;if(Array.isArray(l))return l[0]})();n.on("end",()=>i({statusCode:n.statusCode||0,body:u,contentType:c}))});a.on("error",()=>i(null)),a.setTimeout(o,()=>{a.destroy(),i(null)}),a.end()})}var H=[8081,8082,8083,8084,8085,8086,3e3,3001,19e3].map(e=>({port:e,pid:0}));function P(e,r){return!(e<=0||e>=2e4||r.has(e)||e>=5170&&e<=5200)}async function j(e=[]){let r=new Set(e);try{let{stdout:t}=await v("lsof -iTCP -sTCP:LISTEN -P -n 2>/dev/null | grep -E '^(node|bun)'",{encoding:"utf8",timeout:2e3});if(t.trim()){let o=new Map;for(let s of t.trim().split(`
|
|
3
|
+
`)){let i=s.trim().split(/\s+/);if(i.length<9)continue;let a=Number(i[1]),u=i[8].match(/:(\d+)$/);if(!u)continue;let c=Number(u[1]);P(c,r)&&(o.has(c)||o.set(c,a))}if(o.size>0)return[...o.entries()].map(([s,i])=>({port:s,pid:i}))}}catch{}try{let{stdout:t}=await v(`ss -tlnp 2>/dev/null | grep -E '"(node|bun)"'`,{encoding:"utf8",timeout:2e3});if(t.trim()){let o=new Map;for(let s of t.trim().split(`
|
|
4
|
+
`)){let i=s.match(/:(\d+)\s/),a=s.match(/pid=(\d+)/);if(!i)continue;let n=Number(i[1]),u=a?Number(a[1]):0;P(n,r)&&(o.has(n)||o.set(n,u))}if(o.size>0)return[...o.entries()].map(([s,i])=>({port:s,pid:i}))}}catch{}return H.filter(t=>P(t.port,r))}var y=new Map;async function W(e){if(e<=0)return null;let r=y.get(e);if(r)return r;try{let{stdout:t}=await v(`lsof -p ${e} -a -d cwd -Fn 2>/dev/null`,{encoding:"utf8",timeout:1500});for(let o of t.split(`
|
|
5
|
+
`))if(o.startsWith("n")&&o.length>1){let s=o.slice(1).trim();if(s)return y.set(e,s),s}}catch{}return null}function F(e,r){return{port:e,framework:r,bundleUrl:p(e,`http://localhost:${e}/index.bundle?platform=ios&dev=true&hot=true&minify=false`),hmrUrl:`ws://localhost:${e}/hot`,lastSeen:Date.now()}}function p(e,r){let t=R.find(s=>s.preferredPort===e),o=t?.runtimeConfig?x(r,t.runtimeConfig):r;return k(o)}function G(e){return e.includes("/node_modules/one/metro-entry.bundle")}function z(e){try{let r=JSON.parse(e);return r&&typeof r=="object"?r:null}catch{return null}}function b(e,r,t){if(!r)return e;try{let o=JSON.parse(r.body),s=o?.extra?.expoClient||o?.extra||{};s.name&&(e.projectName=s.name),s.ios?.bundleIdentifier&&(e.bundleId=s.ios.bundleIdentifier),e.framework==="metro"&&s.sdkVersion&&(e.framework="expo");let i=o?.launchAsset?.url;i&&!e.patched&&!G(e.bundleUrl)&&(e.bundleUrl=p(e.port,i));let a=s.iconUrl||s.ios?.iconUrl||s.icon||s.ios?.icon;if(a)if(e.iconPath=a,t)if(a.startsWith("http"))e.iconUrl=t(a);else{let n=a.replace(/^\.\//,"");e.iconUrl=t(`http://localhost:${e.port}/assets/${n}`)}else e.iconUrl=a.startsWith("http")?a:`http://localhost:${e.port}/assets/${a.replace(/^\.\//,"")}`}catch{}return e}var d=new Set,f=new Set,S=new Set;async function J(e,r){if(!await B(e))return null;let t="/node_modules/one/metro-entry.bundle?platform=ios&dev=true",[o,s,i,a]=await Promise.all([d.has(e)?Promise.resolve(null):h(e,"/__soot/"),h(e,"/status"),S.has(e)?Promise.resolve(null):h(e,"/","GET",O,{"expo-platform":"ios"}),f.has(e)?Promise.resolve(null):h(e,"/_expo/status")]);a&&a.statusCode===200?f.delete(e):f.has(e)||f.add(e);let n=i?z(i.body):null,u=typeof n?.launchAsset?.url=="string"?n.launchAsset.url:null,c=n?.extra?.expoClient||n?.extra||{};if(n&&(u||typeof c.name=="string")){d.add(e);let g=u||`http://localhost:${e}/index.bundle?platform=ios&dev=true&hot=true&minify=false`,M=g.includes("/one/metro-entry.bundle")?"one":"expo";return b({port:e,framework:M,bundleUrl:p(e,g),hmrUrl:`ws://localhost:${e}/hot`,lastSeen:Date.now()},i,r)}if(s&&s.body.includes("packager-status:running"))return d.add(e),b(F(e,a&&a.statusCode===200?"expo":"metro"),i,r);if(o&&o.statusCode===200&&o.body.includes("sootsim-patched"))return d.delete(e),b({port:e,framework:"one",bundleUrl:p(e,`http://localhost:${e}/__soot/bundle.js`),hmrUrl:`ws://localhost:${e}/hot`,lastSeen:Date.now(),patched:!0},i,r);let l=await h(e,t,"HEAD");return l&&l.statusCode>0&&l.statusCode<400&&/application\/javascript/i.test(l.contentType||"")?(d.add(e),S.add(e),b({port:e,framework:"one",bundleUrl:p(e,`http://localhost:${e}${t}&minify=false`),hmrUrl:`ws://localhost:${e}/hot`,lastSeen:Date.now()},i,r)):(d.add(e),null)}function K(e){let r=e.projectName?.trim().toLowerCase();return!!(r==="soot"||r==="sootsim"||e.bundleId?.trim().toLowerCase()?.startsWith("dev.soot"))}var w=new Map,V=3e4,q=1500;function Q(e){return!e||e.framework==="metro"||e.framework==="unknown"}function Y(e){return e?p(e.port,e.bundleUrl)===e.bundleUrl:!0}function X(e,r,t=Date.now()){if(r===0||e.pid!==r||!Y(e.result))return!1;let o=t-e.cachedAt;return!(e.result===null&&o>=V||Q(e.result)&&o>=q)}async function ce(e={}){let r=await j(e.excludePorts),t=new Set(r.map(n=>n.port));for(let n of[...w.keys()])t.has(n)||w.delete(n);for(let n of[...d])t.has(n)||d.delete(n);for(let n of[...f])t.has(n)||f.delete(n);for(let n of[...S])t.has(n)||S.delete(n);let o=[],s=[];for(let{port:n,pid:u}of r){let c=w.get(n);if(c&&X(c,u)){c.result&&o.push(c.result);continue}c&&c.pid!==u&&(d.delete(n),f.delete(n),S.delete(n)),s.push({port:n,pid:u})}s.length>0&&(await Promise.all(s.map(u=>J(u.port,e.buildIconProxyUrl)))).forEach((u,c)=>{let{port:l,pid:g}=s[c];g!==0&&w.set(l,{pid:g,result:u,cachedAt:Date.now()}),u&&o.push(u)});let i=new Map;for(let{port:n,pid:u}of r)u>0&&i.set(n,u);await Promise.all(o.map(async n=>{let u=i.get(n.port);if(!u)return;n.pid=u;let c=await W(u);c&&(n.cwd=c)}));let a=new Set(i.values());for(let n of[...y.keys()])a.has(n)||y.delete(n);return o.filter(n=>!K(n))}export{x as a,ee as b,k as c,J as d,ce as e};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.134 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
2
|
function t(_){return`(async () => {
|
|
3
3
|
const __t = window.__sootsimTest
|
|
4
4
|
if (!__t) throw new Error('__sootsimTest not available')
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! sootsim v0.1.134 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
2
|
-
import{b as y}from"./chunk-
|
|
1
|
+
/*! sootsim v0.1.134 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
|
|
2
|
+
import{b as y}from"./chunk-T3FWQAUS.js";import{existsSync as S,mkdirSync as h,readFileSync as b,writeFileSync as H,rmSync as p}from"fs";import{tmpdir as m}from"os";import{dirname as v,join as w}from"path";var d=new Map;function s(e,r){d.set(e,r)}var c=1;function i(){return w(m(),`sootsim-cli-hints-${y()}.json`)}function l(){return w(m(),"sootsim-cli-hints-global.json")}function u(e){if(!S(e))return{version:c,shown:{}};try{let r=JSON.parse(b(e,"utf8"));return r?.version!==c||!r?.shown?{version:c,shown:{}}:r}catch{return{version:c,shown:{}}}}function f(e,r){try{h(v(e),{recursive:!0}),H(e,JSON.stringify(r)+`
|
|
3
3
|
`)}catch{}}function F(){let e=(process.env.SOOTSIM_HINTS||"").toLowerCase();return e==="off"||e==="0"||e==="false"?"off":e==="always"||e==="verbose"?"always":"normal"}function x(e,r){let o=F();if(o==="off")return!1;if(o==="always"||r==="always")return!0;let n=Date.now();if(r==="once-per-identity"){let t=u(i());return t.shown[e]?!1:(t.shown[e]=n,f(i(),t),!0)}if(r==="once-ever"){let t=u(l());return t.shown[e]?!1:(t.shown[e]=n,f(l(),t),!0)}if(typeof r=="object"&&"cooldownMs"in r){let t=u(i()),a=t.shown[e]??0;return n-a<r.cooldownMs?!1:(t.shown[e]=n,f(i(),t),!0)}return!0}function k(e,...r){let o=d.get(e);if(!o)return process.env.SOOTSIM_HINTS_DEBUG&&console.error(` [hints] no hint registered for id "${e}"`),!1;if(!x(e,o.frequency))return!1;let n=o.render(...r);if(n==null)return!1;let t=Array.isArray(n)?n:[n],a=o.stream==="error"?console.error:console.log;for(let g of t)a(` hint: ${g}`);return!0}function M(){p(i(),{force:!0})}function O(){p(l(),{force:!0})}function T(){return Array.from(d.entries()).map(([e,r])=>({id:e,frequency:r.frequency}))}s("app-still-loading",{frequency:{cooldownMs:6e4},render:e=>`app may still be loading (${e} nodes). run \`sootsim wait ready\` first.`});s("wait-selector-for-missing-testid",{frequency:"once-per-identity",render:e=>`sootsim wait selector ${e}`,stream:"error"});s("prefer-cli-over-eval",{frequency:"once-per-identity",render:e=>e.length?["try the CLI shortcut instead:",...e.map(r=>` ${r}`)]:null,stream:"error"});s("describe-use-filters",{frequency:"once-per-identity",render:()=>["describe output is long. narrow it with:"," sootsim describe --only '*Bottom Sheet*'"," sootsim describe --testid-like 'swap-*'"," sootsim describe --subtree <testID>"]});s("describe-filter-context",{frequency:"once-per-identity",render:()=>["filtered describe is search output, not current-route proof.","run `sootsim describe` without filters after navigation; clipped nodes are marked `(clipped:...)`."]});s("subtree-root-not-found",{frequency:"always",render:e=>`no node with testID/id "${e}" \u2014 try \`sootsim find --testid ${e}\` to discover available ids.`,stream:"error"});export{k as a,M as b,O as c,T as d};
|