WORKSTATION AGENT
Workstation Agent — Architecture & Communication
2 of 12Understand the secure communication model between browser applications, the local Agent and workstation resources.
Secure BridgeLocal FirstBi-directionalEvent-drivenMultiplexedResilient
Communication architecture
Mediloop Web Application
JavaScript SDK
Connector UI
Multiple tabs / apps share one Agent
WebSocket secure channel
wss://localhost:8765
or gRPC TLS
wss://localhost:8765
or gRPC TLS
Workstation Agent (Local Service)
Secure communication server
Request router
Device & resource manager
Protocol adapters
Event bus / streamer
Logging & diagnostics
Native / protocol
connection
connection
USB / HID Devices
Serial / COM Devices
Smart Card Readers
Local Applications
File System
Legacy Systems
Channel & transport
PrimaryWebSocket over TLS
AlternategRPC over TLS
Local network modewss://agent-host:8765
Data formatJSON + binary chunks
Keep alivePing / Pong every 25s
CompressionPer-message gzip
Max message size10 MB configurable
Message flow (high level)
1Connect / Authenticate
2Connection accepted
3Discover resources
4Resource list
5Send command / request
6Stream event / data
7Acknowledge
8Result / response
Connection lifecycle
Install & register workstation identity
Start local service and listen on local port
Pair and authorize the browser session
Establish secure bidirectional session
Send heartbeat while connected
Reconnect automatically with exponential backoff
Disconnect cleanly and release resources
Request routing
Unique namespace per connector
Permission and route validation
Correlate responses by request ID
Long-running operations and cancellation
jsonCopy
{
"id":"req_01H...",
"connector":"dictation",
"action":"start_stream",
"timeout":30000
}Event streaming
Push real-time events Agent → web app
Dictation partials, device status, progress
Ordered delivery per session
jsonCopy
{
"event":"transcript.partial",
"sessionId":"sess_...",
"data":{"text":"Le patient..."}
}Multiplexing & concurrency
One Agent handles multiple apps and sessions
Resources shared only with locking when required
Per-session isolation and quotas
Web App A
Agent
Web App B
Error handling & reconnect
Standardized error codes
Exponential retry with backoff
Queue requests offline when possible
Notify app about connection state
| Code | Type |
|---|---|
| AGENT_NOT_RUNNING | Fatal |
| CONNECTION_LOST | Transient |
| DEVICE_UNAVAILABLE | Transient |
| PERMISSION_DENIED | Fatal |
| TIMEOUT | Transient |