DebugClient
Class: DebugClient
Defined in: debug/src/tui/client.ts:26
HTTP + WebSocket client for the debug server API.
Connects to the debug server started by webda debug and provides
typed methods for each introspection endpoint, plus a reconnecting
WebSocket subscription for live request events.
Constructors
Constructor
new DebugClient(
baseUrl?,token?):DebugClient
Defined in: debug/src/tui/client.ts:52
Creates a new DebugClient.
Parameters
baseUrl?
string = "http://localhost:18181"
Base URL of the debug server, e.g. "http://localhost:18181"
token?
string
Session token printed by webda debug (required by the server)
Returns
DebugClient
Accessors
connected
Get Signature
get connected():
boolean
Defined in: debug/src/tui/client.ts:61
Whether the WebSocket is currently connected.
Returns
boolean
true if the WebSocket connection is open
Methods
connectWebSocket()
connectWebSocket():
void
Defined in: debug/src/tui/client.ts:199
Connect to the debug server WebSocket and begin receiving events. Automatically reconnects with exponential backoff on disconnect.
Returns
void
disconnect()
disconnect():
void
Defined in: debug/src/tui/client.ts:258
Disconnect the WebSocket and stop reconnecting.
Returns
void
getAppInfo()
getAppInfo():
Promise<any>
Defined in: debug/src/tui/client.ts:170
Fetch application info (package name, version, working directory).
Returns
Promise<any>
project information record
getConfig()
getConfig():
Promise<Record<string,any>>
Defined in: debug/src/tui/client.ts:127
Fetch the resolved application configuration.
Returns
Promise<Record<string, any>>
resolved configuration record
getLogs()
getLogs():
Promise<any[]>
Defined in: debug/src/tui/client.ts:162
Fetch recent application log entries.
Returns
Promise<any[]>
array of log entries
getModel()
getModel(
id):Promise<any>
Defined in: debug/src/tui/client.ts:95
Fetch a single model by identifier.
Parameters
id
string
Fully-qualified model identifier
Returns
Promise<any>
model metadata object
getModels()
getModels():
Promise<any[]>
Defined in: debug/src/tui/client.ts:85
Fetch all registered models.
Returns
Promise<any[]>
array of model metadata objects
getOpenAPI()
getOpenAPI():
Promise<Record<string,any>>
Defined in: debug/src/tui/client.ts:135
Fetch the OpenAPI specification.
Returns
Promise<Record<string, any>>
OpenAPI 3.0.3 document
getOperations()
getOperations():
Promise<any[]>
Defined in: debug/src/tui/client.ts:111
Fetch all registered operations.
Returns
Promise<any[]>
array of operation info objects
getRequestDetail()
getRequestDetail(
id):Promise<any>
Defined in: debug/src/tui/client.ts:154
Fetch the full detail of a single request by id, including captured headers, bodies, and any error.
Parameters
id
string
The request id (as returned in the summary list).
Returns
Promise<any>
The detailed request entry.
getRequests()
getRequests():
Promise<any[]>
Defined in: debug/src/tui/client.ts:143
Fetch recent request log entries (summary fields only — no headers/bodies).
Returns
Promise<any[]>
array of request log entry summaries
getRoutes()
getRoutes():
Promise<any[]>
Defined in: debug/src/tui/client.ts:119
Fetch all registered routes.
Returns
Promise<any[]>
array of route info objects
getServices()
getServices():
Promise<any[]>
Defined in: debug/src/tui/client.ts:103
Fetch all registered services.
Returns
Promise<any[]>
array of service info objects
onEvent()
onEvent(
callback): () =>void
Defined in: debug/src/tui/client.ts:190
Subscribe to WebSocket events.
Parameters
callback
WsEventCallback
Called for each event received
Returns
Unsubscribe function
() => void
searchLogs()
searchLogs(
query):Promise<any[]>
Defined in: debug/src/tui/client.ts:180
Search application log entries by query string.
Parameters
query
string
search text to filter logs
Returns
Promise<any[]>
array of matching log entries