rnxsim 0.1.313 → 0.1.315
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/LICENSE +11 -10
- package/README.md +5 -0
- package/cli/app-config.ts +65 -0
- package/cli/app-fonts.ts +408 -0
- package/cli/app-project.ts +231 -0
- package/cli/app-splash.ts +185 -0
- package/cli/app-state-reset.ts +24 -0
- package/cli/auth.ts +155 -0
- package/cli/bin.ts +594 -0
- package/cli/bridge-diagnostics.ts +226 -0
- package/cli/bridge-flow-runner.ts +2830 -0
- package/cli/browser-evals.ts +96 -0
- package/cli/commands/agent-wrapper.ts +986 -0
- package/cli/commands/agent.ts +423 -0
- package/cli/commands/app-fonts.ts +98 -0
- package/cli/commands/assert.ts +541 -0
- package/cli/commands/auth.ts +59 -0
- package/cli/commands/camera.ts +266 -0
- package/cli/commands/cleanup.ts +169 -0
- package/cli/commands/compat.ts +87 -0
- package/cli/commands/config.ts +32 -0
- package/cli/commands/control.ts +2142 -0
- package/cli/commands/cpu-profile.ts +269 -0
- package/cli/commands/daemon-mac-app.ts +169 -0
- package/cli/commands/daemon.ts +874 -0
- package/cli/commands/debug.ts +719 -0
- package/cli/commands/desktop.ts +39 -0
- package/cli/commands/detect.ts +197 -0
- package/cli/commands/detox.ts +385 -0
- package/cli/commands/device.ts +133 -0
- package/cli/commands/diagnose.ts +589 -0
- package/cli/commands/electron.ts +95 -0
- package/cli/commands/film.ts +379 -0
- package/cli/commands/flow.ts +1124 -0
- package/cli/commands/inspect/actions.ts +622 -0
- package/cli/commands/inspect/core.ts +2405 -0
- package/cli/commands/inspect/count.ts +17 -0
- package/cli/commands/inspect/describe.ts +192 -0
- package/cli/commands/inspect/env.ts +23 -0
- package/cli/commands/inspect/find.ts +171 -0
- package/cli/commands/inspect/get-layout.ts +39 -0
- package/cli/commands/inspect/keyboard.ts +52 -0
- package/cli/commands/inspect/list.ts +58 -0
- package/cli/commands/inspect/memory.ts +215 -0
- package/cli/commands/inspect/redaction.ts +39 -0
- package/cli/commands/inspect/resolve-target.ts +82 -0
- package/cli/commands/inspect/screens.ts +78 -0
- package/cli/commands/inspect/settle.ts +22 -0
- package/cli/commands/inspect/settling.ts +158 -0
- package/cli/commands/inspect/shared.ts +353 -0
- package/cli/commands/inspect/sleep.ts +14 -0
- package/cli/commands/inspect/tree.ts +32 -0
- package/cli/commands/inspect/url.ts +17 -0
- package/cli/commands/inspect/wait-event.ts +210 -0
- package/cli/commands/inspect/wait-idle.ts +24 -0
- package/cli/commands/inspect/wait-ready.ts +74 -0
- package/cli/commands/inspect/wait-selector.ts +54 -0
- package/cli/commands/inspect/wait.ts +31 -0
- package/cli/commands/inspect.ts +4519 -0
- package/cli/commands/install-desktop.ts +351 -0
- package/cli/commands/login.ts +331 -0
- package/cli/commands/logout.ts +31 -0
- package/cli/commands/maestro-generate.ts +361 -0
- package/cli/commands/maestro.ts +453 -0
- package/cli/commands/mode.ts +57 -0
- package/cli/commands/no-bridge-hint.ts +80 -0
- package/cli/commands/perf.ts +66 -0
- package/cli/commands/permissions.ts +203 -0
- package/cli/commands/profile.ts +108 -0
- package/cli/commands/react.ts +353 -0
- package/cli/commands/record.ts +1434 -0
- package/cli/commands/report-issue.ts +305 -0
- package/cli/commands/reset.ts +85 -0
- package/cli/commands/runtime.ts +351 -0
- package/cli/commands/screenshot-command.ts +106 -0
- package/cli/commands/screenshot-layers.ts +143 -0
- package/cli/commands/screenshot-mode.ts +37 -0
- package/cli/commands/screenshot.ts +488 -0
- package/cli/commands/screenshots-capture.ts +607 -0
- package/cli/commands/screenshots.ts +127 -0
- package/cli/commands/serve.ts +168 -0
- package/cli/commands/setup.ts +545 -0
- package/cli/commands/shell-boolean-mode.ts +81 -0
- package/cli/commands/skills.ts +467 -0
- package/cli/commands/slides.ts +361 -0
- package/cli/commands/state.ts +87 -0
- package/cli/commands/storage.ts +58 -0
- package/cli/commands/telemetry.ts +54 -0
- package/cli/commands/three-mode.ts +763 -0
- package/cli/commands/timeline.ts +122 -0
- package/cli/commands/upgrade.ts +208 -0
- package/cli/commands/upload.ts +1225 -0
- package/cli/commands/version.ts +54 -0
- package/cli/commands/what-happened.ts +327 -0
- package/cli/current-sim.ts +204 -0
- package/cli/desktop-companion.ts +300 -0
- package/cli/drivers/electron.ts +70 -0
- package/cli/drivers/index.ts +20 -0
- package/cli/drivers/playwright-provisioning.ts +180 -0
- package/cli/drivers/playwright.ts +698 -0
- package/cli/drivers/registry.ts +65 -0
- package/cli/drivers/types.ts +102 -0
- package/cli/flow-file.ts +142 -0
- package/cli/flow-live-status.ts +120 -0
- package/cli/flow-session.ts +187 -0
- package/cli/help.ts +80 -0
- package/cli/hidden-runtime-alias.ts +19 -0
- package/cli/hints.ts +216 -0
- package/cli/inspect-notice-state.ts +114 -0
- package/cli/maestro-js.ts +334 -0
- package/cli/open-url.ts +8 -0
- package/cli/parent-pid.ts +204 -0
- package/cli/parse-args.ts +211 -0
- package/cli/prompt.ts +51 -0
- package/cli/recording-access.ts +107 -0
- package/cli/registry.ts +1 -0
- package/cli/resolve-assets.ts +63 -0
- package/cli/run-registry.ts +226 -0
- package/cli/runtime-notes.ts +66 -0
- package/cli/runtime-summary.ts +25 -0
- package/cli/setup-repository.ts +187 -0
- package/cli/telemetry.ts +187 -0
- package/cli/ws-bridge.ts +798 -0
- package/dist-cli/bin.js +5 -5
- package/dist-cli/chunks/{agent-XZ2KTPCU.js → agent-CBU2WDKV.js} +2 -2
- package/dist-cli/chunks/{agent-wrapper-JJYYW2WH.js → agent-wrapper-UNB4R27L.js} +2 -2
- package/dist-cli/chunks/{app-fonts-IXRNQG6B.js → app-fonts-YMLRF3JD.js} +2 -2
- package/dist-cli/chunks/{assert-54T5SK5F.js → assert-5N6HUCL5.js} +2 -2
- package/dist-cli/chunks/{auth-FI5UDI45.js → auth-BHDR3A6G.js} +2 -2
- package/dist-cli/chunks/{beta-JV6UKADW.js → beta-LWUVCPYK.js} +2 -2
- package/dist-cli/chunks/camera-CNO6B2JZ.js +33 -0
- package/dist-cli/chunks/{chunk-ZMJD5GEC.js → chunk-25VCR44B.js} +1 -1
- package/dist-cli/chunks/{chunk-WUSWBCWA.js → chunk-26CSIR76.js} +8 -9
- package/dist-cli/chunks/{chunk-WINYQ44O.js → chunk-26WMWUH4.js} +1 -1
- package/dist-cli/chunks/{chunk-BTWORNNG.js → chunk-2JZ53D4A.js} +1 -1
- package/dist-cli/chunks/{chunk-DCEMHR2Y.js → chunk-2POODCTW.js} +2 -2
- package/dist-cli/chunks/{chunk-5TEF3ET3.js → chunk-4LTBK3ZN.js} +2 -2
- package/dist-cli/chunks/{chunk-NMF2ZMZQ.js → chunk-54MIRTFE.js} +4 -4
- package/dist-cli/chunks/{chunk-WEXDAC74.js → chunk-56H6EVO4.js} +2 -2
- package/dist-cli/chunks/{chunk-F5ZRSS3C.js → chunk-657SQG4D.js} +1 -1
- package/dist-cli/chunks/{chunk-IJ5CAZZC.js → chunk-6ZMRJPKI.js} +1 -1
- package/dist-cli/chunks/{chunk-W6K4EFPH.js → chunk-AOGGOC4V.js} +2 -2
- package/dist-cli/chunks/chunk-BPCDO7ST.js +15 -0
- package/dist-cli/chunks/{chunk-D4FFVGI5.js → chunk-C5O5CTXJ.js} +1 -1
- package/dist-cli/chunks/{chunk-RTN5C5RL.js → chunk-CMM64PPR.js} +1 -1
- package/dist-cli/chunks/{chunk-BBULZ7CG.js → chunk-D3M36D7O.js} +62 -87
- package/dist-cli/chunks/{chunk-5DHC6KHQ.js → chunk-DNCNFZ7V.js} +1 -1
- package/dist-cli/chunks/{chunk-YIFT42WN.js → chunk-FNTTIR2P.js} +2 -2
- package/dist-cli/chunks/chunk-H362IX2I.js +4 -0
- package/dist-cli/chunks/{chunk-IJO63TDP.js → chunk-J6HMTUZH.js} +2 -2
- package/dist-cli/chunks/{chunk-RSZWCKNT.js → chunk-JZ6VTZ5B.js} +3 -3
- package/dist-cli/chunks/{chunk-MJRLLB4R.js → chunk-KQSJVNFE.js} +4 -4
- package/dist-cli/chunks/chunk-L4JZKVCC.js +6 -0
- package/dist-cli/chunks/{chunk-VFCMSYZK.js → chunk-LP2BTEJ6.js} +2 -2
- package/dist-cli/chunks/{chunk-2YR5BGA5.js → chunk-LT6UC7I3.js} +2 -2
- package/dist-cli/chunks/{chunk-OVFJFXUD.js → chunk-MCKQH4AM.js} +2 -2
- package/dist-cli/chunks/{chunk-TZFFR3SD.js → chunk-MF7WUHQ3.js} +2 -2
- package/dist-cli/chunks/{chunk-46EUUFJ5.js → chunk-MSSY4EEZ.js} +1 -1
- package/dist-cli/chunks/{chunk-WMIIKMGK.js → chunk-N5ZCYP5F.js} +2 -2
- package/dist-cli/chunks/{chunk-3NV2NCNX.js → chunk-NCKAD3V7.js} +2 -2
- package/dist-cli/chunks/{chunk-VNQEB4L7.js → chunk-O2KRHVTU.js} +2 -2
- package/dist-cli/chunks/{chunk-OZSSI4WN.js → chunk-OF2HTH25.js} +2 -2
- package/dist-cli/chunks/{chunk-GGRX24GF.js → chunk-OXS2IWO2.js} +2 -2
- package/dist-cli/chunks/{chunk-WWZIXIRD.js → chunk-PVL7XSPN.js} +1 -1
- package/dist-cli/chunks/{chunk-DZS6WPUI.js → chunk-PVPAP3TV.js} +1 -1
- package/dist-cli/chunks/{chunk-5YJCOWCH.js → chunk-PXNAZYGV.js} +1 -1
- package/dist-cli/chunks/chunk-QR3HTFRB.js +5 -0
- package/dist-cli/chunks/{chunk-5TPRP5QT.js → chunk-QR7MWAWE.js} +1 -1
- package/dist-cli/chunks/chunk-RJIEZ2NY.js +4 -0
- package/dist-cli/chunks/{chunk-UC6U3MML.js → chunk-RVM4EZ4E.js} +2 -2
- package/dist-cli/chunks/{chunk-2D2UPBBR.js → chunk-SZKSFMWS.js} +1 -1
- package/dist-cli/chunks/{chunk-7GN3LVWB.js → chunk-TEL7G234.js} +2 -2
- package/dist-cli/chunks/{chunk-GASE6UBA.js → chunk-U2HNIHBY.js} +1 -1
- package/dist-cli/chunks/chunk-UROXJVY3.js +27 -0
- package/dist-cli/chunks/{chunk-HI5TFJWN.js → chunk-WM32MGTJ.js} +2 -2
- package/dist-cli/chunks/{chunk-VZXWHRUZ.js → chunk-WMZ7NJAO.js} +89 -133
- package/dist-cli/chunks/{chunk-XEVZYVIW.js → chunk-WUXCH6WN.js} +10 -9
- package/dist-cli/chunks/chunk-XOXGC3EH.js +9 -0
- package/dist-cli/chunks/chunk-XSSHENNY.js +4 -0
- package/dist-cli/chunks/{chunk-OHAZNXLK.js → chunk-XZ6O67AR.js} +1 -1
- package/dist-cli/chunks/{chunk-QKDWYITG.js → chunk-Y2MWQKOS.js} +3 -3
- package/dist-cli/chunks/{chunk-YDGQTMQL.js → chunk-YY24QI25.js} +1 -1
- package/dist-cli/chunks/{chunk-WF3T4SVI.js → chunk-ZWX6DDIS.js} +2 -2
- package/dist-cli/chunks/{cleanup-P27PA6JI.js → cleanup-F3NUJ3SL.js} +2 -2
- package/dist-cli/chunks/cli-version-XIW6O3FG.js +4 -0
- package/dist-cli/chunks/{compat-ZD65FED3.js → compat-AX2SEPTH.js} +2 -2
- package/dist-cli/chunks/{config-XMJRNM2A.js → config-4QQO5JVU.js} +2 -2
- package/dist-cli/chunks/{control-KMIQT3QP.js → control-OCKKSOWA.js} +2 -2
- package/dist-cli/chunks/daemon-N5VLMYKQ.js +4 -0
- package/dist-cli/chunks/{debug-PT4HOP7N.js → debug-T6MWVEVX.js} +5 -5
- package/dist-cli/chunks/{desktop-S3FG72AK.js → desktop-NCW7R7CB.js} +3 -3
- package/dist-cli/chunks/{detox-B3D4IFCN.js → detox-G6GITO2X.js} +2 -2
- package/dist-cli/chunks/{device-XBNDSB2R.js → device-7BTEJCTH.js} +2 -2
- package/dist-cli/chunks/{diagnose-HMQXJE5N.js → diagnose-SC5LACE3.js} +2 -2
- package/dist-cli/chunks/{disk-cleanup-BLCZ5BSZ.js → disk-cleanup-KK56QQZA.js} +2 -2
- package/dist-cli/chunks/drivers-NPGVBWMG.js +4 -0
- package/dist-cli/chunks/{film-BJGTBYZB.js → film-WGYEHGIA.js} +3 -3
- package/dist-cli/chunks/flow-KQBIBM3N.js +4 -0
- package/dist-cli/chunks/help-G7CAKI65.js +4 -0
- package/dist-cli/chunks/{hidden-runtime-alias-ANOYADHM.js → hidden-runtime-alias-CWTZWH3L.js} +2 -2
- package/dist-cli/chunks/home-paths-EBT4XHAS.js +4 -0
- package/dist-cli/chunks/inspect-CCPZXVDU.js +4 -0
- package/dist-cli/chunks/install-desktop-NZ3VGTQZ.js +4 -0
- package/dist-cli/chunks/{login-FJ737MWG.js → login-GSYOTGVQ.js} +4 -4
- package/dist-cli/chunks/{logout-ZCNMMHMY.js → logout-JPRIR7YK.js} +2 -2
- package/dist-cli/chunks/{maestro-SZTNKLDF.js → maestro-LXKDNO5M.js} +3 -3
- package/dist-cli/chunks/{maestro-generate-DCFAIZ4H.js → maestro-generate-5ZIKOU53.js} +3 -3
- package/dist-cli/chunks/{mode-GRMQCRXR.js → mode-N3QHXCES.js} +2 -2
- package/dist-cli/chunks/{optional-demo-registry-W36EWFFB.js → optional-demo-registry-XDH6X24N.js} +2 -2
- package/dist-cli/chunks/{perf-QYBAAUZG.js → perf-VOPL26FM.js} +2 -2
- package/dist-cli/chunks/{permissions-3QCQ6VF4.js → permissions-CZFKM4UD.js} +2 -2
- package/dist-cli/chunks/{record-QPPC2S4E.js → record-FODSOGMA.js} +3 -3
- package/dist-cli/chunks/{report-issue-7NMFP4HK.js → report-issue-FBPCZKOV.js} +2 -2
- package/dist-cli/chunks/reset-3H35GFO3.js +4 -0
- package/dist-cli/chunks/runtime-4OVFRXV5.js +4 -0
- package/dist-cli/chunks/{screenshot-command-67AECJFB.js → screenshot-command-7S3FYVO7.js} +7 -7
- package/dist-cli/chunks/{screenshot-layers-ASWBYPJL.js → screenshot-layers-CDYHPNC3.js} +3 -3
- package/dist-cli/chunks/{screenshots-capture-PXA3HFQK.js → screenshots-capture-EBIIY2YU.js} +2 -2
- package/dist-cli/chunks/serve-NELNSCZP.js +44 -0
- package/dist-cli/chunks/{setup-7DWPMRSB.js → setup-DF5ZDDIV.js} +2 -2
- package/dist-cli/chunks/{skills-S3Y22TUA.js → skills-E2QZF6WZ.js} +2 -2
- package/dist-cli/chunks/state-MBZDKZ7U.js +14 -0
- package/dist-cli/chunks/{storage-XUIMJWAJ.js → storage-J5BMNVXM.js} +6 -6
- package/dist-cli/chunks/store-U3DXC7HH.js +4 -0
- package/dist-cli/chunks/telemetry-XIPJVT5E.js +4 -0
- package/dist-cli/chunks/{timeline-TMPLQPSP.js → timeline-MC6N5BHY.js} +2 -2
- package/dist-cli/chunks/{upgrade-7HDSIM7K.js → upgrade-7UTU53DH.js} +2 -2
- package/dist-cli/chunks/upload-2M2KOTYI.js +4 -0
- package/dist-cli/chunks/version-VNACNYQK.js +6 -0
- package/dist-cli/chunks/{web-DG3WBYD3.js → web-MGJ2TUKR.js} +2 -2
- package/dist-cli/chunks/{what-happened-XFVUTZR7.js → what-happened-7DLKH3OD.js} +3 -3
- 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.cjs +20 -0
- package/dist-lib/cli-constants.cjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/detox/index.cjs +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/home-paths.cjs +67 -28
- package/dist-lib/host/bridge-host.cjs +140 -12
- 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 +2815 -40
- package/dist-lib/jump-to-source-babel.cjs +1 -1
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +1 -1
- package/dist-lib/metro.cjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +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 +2549 -2061
- package/dist-lib/sdk.mjs +2543 -2061
- package/dist-lib/skills.cjs +480 -280
- package/dist-lib/vite.cjs +1 -1
- package/package.json +8 -2
- package/src/bridge-constants.ts +3 -4
- package/src/bridge-contract.ts +251 -0
- package/src/connect.ts +83 -0
- package/src/disk-cleanup.ts +30 -0
- package/src/home-paths.ts +81 -38
- package/src/host/bridge-host.ts +134 -6
- package/src/index.ts +27 -1
- package/src/sdk.ts +8 -0
- package/src/sim-client.ts +660 -0
- package/dist-cli/chunks/camera-VL73YIKP.js +0 -22
- package/dist-cli/chunks/chunk-4NPPOV2N.js +0 -5
- package/dist-cli/chunks/chunk-FSUYIVJ6.js +0 -9
- package/dist-cli/chunks/chunk-G2WW6L2C.js +0 -23
- package/dist-cli/chunks/chunk-KTHV3RUS.js +0 -26
- package/dist-cli/chunks/chunk-LF2ZVT7O.js +0 -6
- package/dist-cli/chunks/chunk-NFK7T35W.js +0 -4
- package/dist-cli/chunks/chunk-TIVZIMMW.js +0 -4
- package/dist-cli/chunks/cli-version-WWLPBDQ7.js +0 -4
- package/dist-cli/chunks/daemon-G2ME7NLB.js +0 -4
- package/dist-cli/chunks/drivers-LDECZGP2.js +0 -4
- package/dist-cli/chunks/flow-UEQNVTU7.js +0 -4
- package/dist-cli/chunks/help-T5FYSVGB.js +0 -4
- package/dist-cli/chunks/home-paths-GT3LFNOR.js +0 -4
- package/dist-cli/chunks/inspect-ZA6XF5LD.js +0 -4
- package/dist-cli/chunks/install-desktop-TIMUDHPL.js +0 -4
- package/dist-cli/chunks/runtime-XOAXMSTU.js +0 -4
- package/dist-cli/chunks/serve-BI2NBAXG.js +0 -44
- package/dist-cli/chunks/store-JTHEJLAZ.js +0 -4
- package/dist-cli/chunks/telemetry-ZYJGD2DB.js +0 -4
- package/dist-cli/chunks/upload-GMSZPWM6.js +0 -4
- package/dist-cli/chunks/version-HOCHZ37L.js +0 -6
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import { MERGED_CONSOLE_COUNT_EVAL, inspectErrors } from './commands/inspect/core'
|
|
2
|
+
import { formatLogTimestamp } from './commands/inspect/shared'
|
|
3
|
+
import type { WsBridge } from './ws-bridge'
|
|
4
|
+
import type { SootSimRequestEntry } from '@sootsim/globals'
|
|
5
|
+
|
|
6
|
+
interface ConsoleSummaryOptions {
|
|
7
|
+
includeTail?: boolean
|
|
8
|
+
errorsCommand?: string
|
|
9
|
+
warningsCommand?: string
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
interface RequestSummaryOptions {
|
|
13
|
+
includeTail?: boolean
|
|
14
|
+
requestsCommand?: string
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
interface FailureDiagnosticsOptions {
|
|
18
|
+
errorsCommand?: string
|
|
19
|
+
warningsCommand?: string
|
|
20
|
+
requestsCommand?: string
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function formatRequestMessage(entry: SootSimRequestEntry) {
|
|
24
|
+
const target = entry.displayUrl || entry.url
|
|
25
|
+
if (entry.status != null) {
|
|
26
|
+
return `${entry.method} ${target} -> ${entry.status}${entry.statusText ? ` ${entry.statusText}` : ''}`
|
|
27
|
+
}
|
|
28
|
+
if (entry.error) {
|
|
29
|
+
return `${entry.method} ${target} -> ${entry.error}`
|
|
30
|
+
}
|
|
31
|
+
return `${entry.method} ${target}`
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
async function callTestBridge<T = unknown>(
|
|
35
|
+
bridge: WsBridge,
|
|
36
|
+
method: string,
|
|
37
|
+
...args: unknown[]
|
|
38
|
+
) {
|
|
39
|
+
return bridge.send({
|
|
40
|
+
type: 'call',
|
|
41
|
+
path: `__sootsimTest.${method}`,
|
|
42
|
+
args,
|
|
43
|
+
}) as Promise<T>
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export async function printBridgeConsoleSummary(
|
|
47
|
+
bridge: WsBridge,
|
|
48
|
+
opts: ConsoleSummaryOptions = {},
|
|
49
|
+
) {
|
|
50
|
+
const counts = (await bridge.send({
|
|
51
|
+
type: 'evaluate',
|
|
52
|
+
code: MERGED_CONSOLE_COUNT_EVAL,
|
|
53
|
+
})) as { errors?: number; warnings?: number; total?: number } | null
|
|
54
|
+
|
|
55
|
+
if (!counts || typeof counts !== 'object') return
|
|
56
|
+
|
|
57
|
+
const errors = Math.max(0, Number(counts.errors) || 0)
|
|
58
|
+
const warnings = Math.max(0, Number(counts.warnings) || 0)
|
|
59
|
+
if (errors === 0 && warnings === 0) return
|
|
60
|
+
|
|
61
|
+
const parts = []
|
|
62
|
+
if (errors > 0) parts.push(`${errors} console error${errors === 1 ? '' : 's'}`)
|
|
63
|
+
if (warnings > 0) {
|
|
64
|
+
parts.push(`${warnings} console warning${warnings === 1 ? '' : 's'}`)
|
|
65
|
+
}
|
|
66
|
+
console.log(`\n console: ${parts.join(', ')}`)
|
|
67
|
+
if (opts.errorsCommand) console.log(` inspect: ${opts.errorsCommand}`)
|
|
68
|
+
if (warnings > 0 && opts.warningsCommand) {
|
|
69
|
+
console.log(` inspect: ${opts.warningsCommand}`)
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if (!opts.includeTail || errors === 0) return
|
|
73
|
+
|
|
74
|
+
// merged read (ws-bridge buffer + observability) so forwarded render-worker
|
|
75
|
+
// errors are shown in the tail, not just counted.
|
|
76
|
+
const recentErrors = await inspectErrors(bridge, 5)
|
|
77
|
+
if (!Array.isArray(recentErrors) || recentErrors.length === 0) return
|
|
78
|
+
|
|
79
|
+
console.log('\n recent console errors:\n')
|
|
80
|
+
for (const entry of recentErrors as Array<{
|
|
81
|
+
timestamp: number
|
|
82
|
+
args?: unknown[]
|
|
83
|
+
}>) {
|
|
84
|
+
const time = formatLogTimestamp(entry.timestamp)
|
|
85
|
+
const msg = Array.isArray(entry.args)
|
|
86
|
+
? entry.args
|
|
87
|
+
.map((value) =>
|
|
88
|
+
typeof value === 'object' ? JSON.stringify(value) : String(value),
|
|
89
|
+
)
|
|
90
|
+
.join(' ')
|
|
91
|
+
: String(entry)
|
|
92
|
+
console.log(` [${time}] ${msg}`)
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export async function printBridgeRequestSummary(
|
|
97
|
+
bridge: WsBridge,
|
|
98
|
+
opts: RequestSummaryOptions = {},
|
|
99
|
+
) {
|
|
100
|
+
const counts = await callTestBridge<{ failed?: number; total?: number }>(
|
|
101
|
+
bridge,
|
|
102
|
+
'getRequestCounts',
|
|
103
|
+
)
|
|
104
|
+
if (!counts || typeof counts !== 'object') return
|
|
105
|
+
|
|
106
|
+
const failed = Math.max(0, Number(counts.failed) || 0)
|
|
107
|
+
if (failed === 0) return
|
|
108
|
+
|
|
109
|
+
console.log(`\n network: ${failed} failed request${failed === 1 ? '' : 's'}`)
|
|
110
|
+
if (opts.requestsCommand) console.log(` inspect: ${opts.requestsCommand}`)
|
|
111
|
+
|
|
112
|
+
if (!opts.includeTail) return
|
|
113
|
+
|
|
114
|
+
const recentFailed = await callTestBridge<SootSimRequestEntry[]>(
|
|
115
|
+
bridge,
|
|
116
|
+
'getFailedRequests',
|
|
117
|
+
5,
|
|
118
|
+
)
|
|
119
|
+
if (!Array.isArray(recentFailed) || recentFailed.length === 0) return
|
|
120
|
+
|
|
121
|
+
console.log('\n recent failed requests:\n')
|
|
122
|
+
for (const entry of recentFailed) {
|
|
123
|
+
const time = formatLogTimestamp(entry.timestamp)
|
|
124
|
+
console.log(` [${time}] ${formatRequestMessage(entry)}`)
|
|
125
|
+
if (entry.responseBody) {
|
|
126
|
+
console.log(` ${entry.responseBody}`)
|
|
127
|
+
} else if (entry.error) {
|
|
128
|
+
console.log(` ${entry.error}`)
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
interface BridgeStateSummary {
|
|
134
|
+
url?: string
|
|
135
|
+
simId?: string | null
|
|
136
|
+
nodeCount?: number
|
|
137
|
+
mode?: string
|
|
138
|
+
shell?: {
|
|
139
|
+
state?: string | null
|
|
140
|
+
activeApp?: string | null
|
|
141
|
+
showSwitcher?: boolean
|
|
142
|
+
switcherPhase?: string | null
|
|
143
|
+
} | null
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export async function printBridgeStateSummary(bridge: WsBridge) {
|
|
147
|
+
const state = (await bridge.send({
|
|
148
|
+
type: 'evaluate',
|
|
149
|
+
code: `(async () => {
|
|
150
|
+
const test = window.__sootsimTest
|
|
151
|
+
const mainShell = window.SootSim?.bridges?.mainShell
|
|
152
|
+
let shell = null
|
|
153
|
+
try {
|
|
154
|
+
shell = typeof mainShell?.getState === 'function' ? await mainShell.getState() : null
|
|
155
|
+
} catch {}
|
|
156
|
+
let nodeCount = 0
|
|
157
|
+
try {
|
|
158
|
+
nodeCount = typeof test?.getNodeCount === 'function' ? await test.getNodeCount() : 0
|
|
159
|
+
} catch {}
|
|
160
|
+
return {
|
|
161
|
+
url: window.location.href,
|
|
162
|
+
simId: window.__sootsimSimId || null,
|
|
163
|
+
nodeCount,
|
|
164
|
+
mode: window.__sootsimRenderHost ? 'render-worker' : 'main-thread',
|
|
165
|
+
shell: shell
|
|
166
|
+
? {
|
|
167
|
+
state: shell.state || null,
|
|
168
|
+
activeApp: shell.activeApp || null,
|
|
169
|
+
showSwitcher: !!shell.showSwitcher,
|
|
170
|
+
switcherPhase: shell.switcherPhase || null,
|
|
171
|
+
}
|
|
172
|
+
: null,
|
|
173
|
+
}
|
|
174
|
+
})()`,
|
|
175
|
+
})) as BridgeStateSummary | null
|
|
176
|
+
|
|
177
|
+
if (!state || typeof state !== 'object') return
|
|
178
|
+
|
|
179
|
+
console.log('\n state:')
|
|
180
|
+
if (state.simId) console.log(` sim: ${state.simId}`)
|
|
181
|
+
if (state.url) console.log(` url: ${state.url}`)
|
|
182
|
+
if (state.mode) console.log(` mode: ${state.mode}`)
|
|
183
|
+
const nodeCount = Number(state.nodeCount) || 0
|
|
184
|
+
console.log(` nodes: ${nodeCount}${nodeCount > 10 ? ' (ready)' : ' (not ready)'}`)
|
|
185
|
+
|
|
186
|
+
const shell = state.shell
|
|
187
|
+
if (shell && typeof shell === 'object') {
|
|
188
|
+
const shellParts = [
|
|
189
|
+
shell.state ? `state=${shell.state}` : null,
|
|
190
|
+
shell.activeApp ? `app=${shell.activeApp}` : null,
|
|
191
|
+
shell.showSwitcher ? 'switcher=open' : null,
|
|
192
|
+
shell.switcherPhase ? `phase=${shell.switcherPhase}` : null,
|
|
193
|
+
].filter(Boolean)
|
|
194
|
+
if (shellParts.length > 0) {
|
|
195
|
+
console.log(` shell: ${shellParts.join(' ')}`)
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
export async function printBridgeFailureDiagnostics(
|
|
201
|
+
bridge: WsBridge,
|
|
202
|
+
opts: FailureDiagnosticsOptions = {},
|
|
203
|
+
) {
|
|
204
|
+
try {
|
|
205
|
+
await printBridgeStateSummary(bridge)
|
|
206
|
+
} catch {
|
|
207
|
+
// ignore state snapshot failures while already handling a failure
|
|
208
|
+
}
|
|
209
|
+
try {
|
|
210
|
+
await printBridgeConsoleSummary(bridge, {
|
|
211
|
+
includeTail: true,
|
|
212
|
+
errorsCommand: opts.errorsCommand,
|
|
213
|
+
warningsCommand: opts.warningsCommand,
|
|
214
|
+
})
|
|
215
|
+
} catch {
|
|
216
|
+
// ignore console snapshot failures while already handling a failure
|
|
217
|
+
}
|
|
218
|
+
try {
|
|
219
|
+
await printBridgeRequestSummary(bridge, {
|
|
220
|
+
includeTail: true,
|
|
221
|
+
requestsCommand: opts.requestsCommand,
|
|
222
|
+
})
|
|
223
|
+
} catch {
|
|
224
|
+
// ignore request snapshot failures while already handling a failure
|
|
225
|
+
}
|
|
226
|
+
}
|