1.3 KiB
jsinspector-modern concepts
CDP object model
Target
A debuggable entity that a debugger frontend can connect to.
Target Delegate
An interface between a Target class and the underlying debuggable entity. For example, HostTargetDelegate is used by HostTarget to send host-related events to the native platform implementation.
Target Controller
A private interface exposed by a Target class to its Sessions/Agents. For example, HostTargetController is used by HostAgent to safely access the host's HostTargetDelegate, without exposing HostTarget's other private state.
Session
A single connection between a debugger frontend and a target. There can be multiple active sessions connected to the same target.
Agent
A handler for a subset of CDP messages for a specific target as part of a specific session.
Agent Delegate
An interface between an Agent class and some integration-specific, per-session logic/state it relies on (that does not fit in a Target Delegate). For example, a RuntimeAgentDelegate is used by RuntimeAgent to host Hermes's native CDP handler and delegate messages to it. The interface may look exactly like an Agent (purely CDP messages in/out) or there may be a more involved API to expose state/functionality needed by the Agent.