Constructs a new RemoteDebugClient.
Private OptionalcurrentPrivatecurrentCurrent trace event being recorded (set during handler execution). Used by property change and getSubView wrappers to append data.
PrivatecvWhether CV row lifecycle tracing is enabled
PrivatecvRecorded row lifecycle events
PrivatecvWhen tracing started
PrivatehandlerWhether handler tracing is currently active
PrivatehandlerRecorded handler execution events
PrivatehandlerTimestamp when handler tracing started
PrivatelifecycleWhether lifecycle tracing is currently active
PrivateoriginalStores original CustomViewRow inner view methods (hibernateView, wakeView).
Key: ${customViewHid}:${methodName}
Value: original bound method
PrivateoriginalOriginal field setter functions for wrapped renderers.
Key: ${nodeHid}:${fieldName}
Value: original setter function
PrivateoriginalStores original getSubView methods for wrapped views (when tracking getSubView). Key: viewHid Value: original bound getSubView function
PrivateoriginalStores original handler methods for wrapped views.
Key: ${viewHid}:${handlerName}
Value: original bound handler function
PrivateoriginalOriginal render methods for wrapped renderers
PrivateoriginalStores original row methods for wrapped rows.
Key: ${rowHid}:${methodName} (methodName = 'onEnterScreen' | 'onExitScreen')
Value: original bound method
PrivateoriginalStores original setField methods for wrapped views. Key: view._hid, Value: original bound setField function Used to restore views when tracing is disabled.
Note: We use any here because BaseView.setField has a generic signature
setField<K extends keyof T>(field: K, value: T[K]) where T varies per view.
Since we're storing/restoring without modification, the exact type doesn't matter.
PrivateoriginalStores original viewPhase property descriptors for wrapped views. Key: view._hid Value: original property descriptor from prototype Used to restore views when tracing is disabled.
Private OptionalpendingPending trigger field (set by field setter, consumed by render wrapper)
Private ReadonlyphaseMap phase number to human-readable name
PrivatephaseTracks phase timestamps for wrapped views. Key: view._hid Value: { phase, since (timestamp), history of changes }
PrivaterecentRecent field values for cycle detection.
Key: ${targetHid}:${fieldName}
Value: { values: [], timestamps: [] }
PrivaterendererRecorded renderer-level events
PrivaterenderWhether render frequency tracing is enabled
PrivaterenderWhen tracing ended (for duration calculation after disable)
PrivaterenderHotspot threshold in calls/sec
PrivaterenderWhen tracing started
PrivaterenderWhether render tracing is currently active
PrivaterenderRecorded state mutations from wrapped views. Each entry captures: which view, what property, old/new values.
PrivaterenderRecorded rebuild events (when getViews is called). Note: Rebuild tracking requires additional instrumentation not yet implemented.
PrivaterenderTimestamp when tracing started (for duration calculation)
Privatetraced_hid of the traced CollectionView
PrivatetracedList of view _hids being traced
PrivatetracedWhich handlers are being traced
PrivatetracedList of _hids currently being handler-traced
PrivatetracedList of _hids currently being lifecycle-traced
PrivatetracedList of renderer _hids being traced
PrivatetracedRow indices being watched
PrivatetracedList of _hids currently being traced. Used for reporting and cleanup.
PrivatetrackWhether to track getSubView calls during handler execution
PrivatetrackWhether to track property changes during handler execution
PrivateviewRecorded view-level events
Private Static ReadonlyCYCLE_Cycle detection window in ms
Register a callback when the remote debug WebSocket connects (or immediately if already connected).
Used to flush early remote.log() calls that occur before on_open.
PrivateanalyzeAnalyzes renderer events and produces per-renderer stats.
PrivateanalyzePrivatebuildBuild focus context with siblings and parent focus manager info.
PrivatebuildBuilds lifecycle info for a view and optionally its descendants.
When lifecycle tracing is enabled for a view:
When tracing is disabled:
PrivatecaptureCaptures the current state of a CustomViewRow's inner customView.
PrivatecaptureCaptures the state of a custom view directly.
Starts the remote debugger by initializing and connecting the WebSocketClient. Requests port assignment from the management server for multi-app support unless the caller supplies an explicit direct port.
Optionalport: numberPrivatedetectDetects state cycling patterns from tracked field values. A cycle is when value goes A→B→A (or more) within the window.
OUT: Dispatches a remote debug command to the debugger, via the WebSocket.
The remote debug command to send.
PrivateextractExtracts row and cell data from CV for specific row indices. Much lighter than full GetCollectionView serialization when targeting specific rows.
PrivateextractPrivateextractExtracts minimal view info for trace events.
PrivatefindPrivatefindPrivatefindPrivategetGets phase info for a view, including duration if tracing is enabled.
Phase number, name, and optional tracking data
PrivategetPrivategetGets the renderer type name (e.g., 'WebSGPoster').
PrivatehandlePrivatehandlePrivatehandleHandles GetCVRowLifecycleTrace command.
Returns the collected trace data and optionally clears it.
PrivatehandlePrivatehandlePrivatehandlePrivatehandleHandles GetHandlerTrace command.
Returns the collected trace data and optionally clears it.
PrivatehandleHandle GetHsViewByHid with fallback to CollectionView rows/cells. Returns true if handled (found in CV), false to let base class handle it.
PrivatehandleHandles GetRenderFrequencyTrace command.
Analyzes collected events and returns:
PrivatehandleReturns the collected render trace data.
Includes:
PrivatehandleHandles GetRowsSlice command.
Returns row and cell data for specific row indices - much lighter than GetCollectionView when you only need specific rows. Includes essential data for animation tracking and debugging.
Payload: { cv_hid?: string, row_indices?: number[], include_cells?: boolean, max_cells_per_row?: number, include_cell_identity?: boolean, include_cell_translation?: boolean } Response: { cv_hid, rows: [{ index, translation, rowLabel, cells: [{ index, translation, cellTitle, ... }] }] }
// Get data for rows 0, 1, 2 of a specific CV
GetRowsSlice({ cv_hid: "506", row_indices: [0, 1, 2] })
// Get only row-level state for animation/focus tracking without rendered cell extraction
GetRowsSlice({ row_indices: [0], include_cells: false })
// Limit cell payload size and omit expensive identity/translation fields
GetRowsSlice({
row_indices: [0],
max_cells_per_row: 4,
include_cell_identity: false,
include_cell_translation: false
})
// Get all rows of first CV found (use sparingly - prefer specific indices)
GetRowsSlice({})
PrivatehandlePrivatehandlePrivatehandleHandles GetViewLifecycle command.
Returns lifecycle info for a view including:
PrivatehandlePrivatehandlePrivatehandlePrivatehandlePrivatehandlePrivatehandleHandles SetLifecycleTracing command.
When enabled with watch_hids:
When disabled:
PrivatehandleHandles SetRenderFrequencyTracing command.
When enabled:
PrivatehandleHandles SetRenderTracing command.
When enabled with watch_hids:
When disabled:
PrivatehandlePrivatepeekIN: Handles an incoming debug command from the remote debugger, via the WebSocket.
The debug command to execute.
Focus relay: called when focused view changes (from FocusManager via focus-dev-relay).
Focus relay: called when a key is pressed (from FocusManager via focus-dev-relay).
PrivatesafePrivateserializeSerialize a CollectionView row or cell with debug-relevant properties.
PrivatetraceRoku-safe value inequality (avoids === on IHsIdentifiable; HS-1054 / HS-1074).
PrivatetrackTracks a value for state cycling detection. Detects patterns like A→B→A within a short window.
PrivateunwrapUnwraps all render frequency traced nodes.
PrivateunwrapRestores all original handler methods and getSubView methods.
PrivateunwrapRestores original viewPhase property descriptors on all traced views.
Deletes the instance-level property override, which automatically restores access to the prototype's getter/setter.
Called when tracing is disabled to ensure views return to their normal behavior with zero overhead.
PrivateunwrapRestores all wrapped row methods to their originals.
PrivateunwrapRestores original setField methods on all traced views.
Called when tracing is disabled to ensure views return to their normal behavior with zero overhead.
PrivatevalidatePrivatewrapPrivatewrapWraps a single field setter on a renderer to detect trigger fields.
PrivatewrapTemporarily wraps getSubView on a view to log calls during handler execution.
The original getSubView method to restore after handler completes
PrivatewrapWraps a single renderer node for render frequency tracking.
PrivatewrapPrivatewrapWraps a row's lifecycle methods (onEnterScreen, onExitScreen). For CustomViewRow, also wraps the inner customView's hibernateView/wakeView.
PrivatewrapPrivatewrapWraps a view's event handlers to intercept calls and log trace data.
The _hid of the view to wrap
Which handlers to wrap
true if view was found and at least one handler wrapped
PrivatewrapWraps a view's viewPhase property to intercept phase changes.
The wrapper:
Uses Object.defineProperty to override the prototype's getter/setter with an instance-level property that intercepts writes.
The _hid of the view to wrap
true if view was found and wrapped, false otherwise
PrivatewrapPrivatewrapWraps a view's setField method to intercept state mutations.
The wrapper:
The _hid of the view to wrap
true if view was found and wrapped, false otherwise
Remote debug client extension for the hosanna-debugger MCP proxy:
id(request/response matching).