ailoha.
Home/ Docs/ DevFlow Agent Protocol/ WebSocket reference
Generated from AsyncAPI

WebSocket reference

Real-time streaming channels for the DevFlow Agent Protocol. These complement the HTTP API defined in openapi.yaml.

Channels

WS /ws/v1/ble

Live Bluetooth Low Energy event stream. Connect with query parameters to
replay buffered events, filter by event type, and optionally start native
scanning for the lifetime of the WebSocket connection when supported.
Streamed events remain in the bounded BLE buffer until evicted by
retention or cleared via the REST API.

BLE Event Replay replay

Initial replay of recent BLE events on connect.

Content type: application/json

{
  "type": "object",
  "description": "Replay of recent BLE events.",
  "required": [
    "type",
    "timestamp",
    "data"
  ],
  "properties": {
    "type": {
      "type": "string",
      "const": "replay",
      "description": "Message type identifier."
    },
    "timestamp": {
      "$ref": "#/components/schemas/Timestamp",
      "description": "UTC timestamp when this message was produced."
    },
    "data": {
      "type": "object",
      "required": [
        "events"
      ],
      "properties": {
        "events": {
          "type": "array",
          "items": {
            "$ref": "#/components/schemas/BleEvent"
          },
          "description": "Buffered BLE events."
        }
      }
    }
  }
}
BLE Event ble_event

New Bluetooth Low Energy event.

Content type: application/json

{
  "type": "object",
  "description": "Live BLE event envelope.",
  "required": [
    "type",
    "timestamp",
    "data"
  ],
  "properties": {
    "type": {
      "type": "string",
      "const": "ble_event",
      "description": "Message type identifier."
    },
    "timestamp": {
      "$ref": "#/components/schemas/Timestamp",
      "description": "UTC timestamp when this message was produced."
    },
    "data": {
      "$ref": "#/components/schemas/BleEvent",
      "description": "The recorded BLE event."
    }
  }
}
BLE Stream Error error

Error occurred while streaming BLE events.

Content type: application/json

{
  "type": "object",
  "description": "BLE stream error notification.",
  "required": [
    "type",
    "timestamp",
    "data"
  ],
  "properties": {
    "type": {
      "type": "string",
      "const": "error",
      "description": "Message type identifier."
    },
    "timestamp": {
      "$ref": "#/components/schemas/Timestamp",
      "description": "UTC timestamp when this message was produced."
    },
    "data": {
      "type": "object",
      "required": [
        "message"
      ],
      "properties": {
        "message": {
          "type": "string",
          "description": "Human-readable error message."
        }
      }
    }
  }
}
WS /ws/v1/device/sensors

Live sensor data streaming. Connect with query parameters to specify the
sensor, reading speed, and throttle interval. Supports subscribing to
different sensors or changing settings over the same connection.

Sensor Subscribed subscribed

Confirmation that the sensor subscription is active.

Content type: application/json

{
  "type": "object",
  "description": "Sensor subscription confirmation.",
  "required": [
    "type",
    "timestamp",
    "data"
  ],
  "properties": {
    "type": {
      "type": "string",
      "const": "subscribed",
      "description": "Message type identifier."
    },
    "timestamp": {
      "$ref": "#/components/schemas/Timestamp",
      "description": "UTC timestamp when this message was produced."
    },
    "data": {
      "type": "object",
      "required": [
        "sensor",
        "speed",
        "throttleMs"
      ],
      "properties": {
        "sensor": {
          "type": "string",
          "description": "Name of the subscribed sensor."
        },
        "speed": {
          "type": "string",
          "description": "Active reading speed."
        },
        "throttleMs": {
          "type": "number",
          "description": "Active throttle interval in milliseconds."
        }
      }
    }
  }
}
Sensor Reading reading

New sensor reading.

Content type: application/json

{
  "type": "object",
  "description": "Live sensor reading event.",
  "required": [
    "type",
    "timestamp",
    "data"
  ],
  "properties": {
    "type": {
      "type": "string",
      "const": "reading",
      "description": "Message type identifier."
    },
    "timestamp": {
      "$ref": "#/components/schemas/Timestamp",
      "description": "UTC timestamp when this message was produced."
    },
    "data": {
      "$ref": "#/components/schemas/SensorReading",
      "description": "Sensor reading data (shape varies by sensor type)."
    }
  }
}
Sensor Error error

Error occurred while reading sensor data.

Content type: application/json

{
  "type": "object",
  "description": "Sensor error notification.",
  "required": [
    "type",
    "timestamp",
    "data"
  ],
  "properties": {
    "type": {
      "type": "string",
      "const": "error",
      "description": "Message type identifier."
    },
    "timestamp": {
      "$ref": "#/components/schemas/Timestamp",
      "description": "UTC timestamp when this message was produced."
    },
    "data": {
      "type": "object",
      "required": [
        "sensor",
        "message"
      ],
      "properties": {
        "sensor": {
          "type": "string",
          "description": "Name of the sensor that encountered an error."
        },
        "message": {
          "type": "string",
          "description": "Human-readable error message."
        }
      }
    }
  }
}
Sensor Stopped stopped

Sensor data streaming has stopped.

Content type: application/json

{
  "type": "object",
  "description": "Sensor stopped notification.",
  "required": [
    "type",
    "timestamp",
    "data"
  ],
  "properties": {
    "type": {
      "type": "string",
      "const": "stopped",
      "description": "Message type identifier."
    },
    "timestamp": {
      "$ref": "#/components/schemas/Timestamp",
      "description": "UTC timestamp when this message was produced."
    },
    "data": {
      "type": "object",
      "required": [
        "sensor"
      ],
      "properties": {
        "sensor": {
          "type": "string",
          "description": "Name of the sensor that was stopped."
        }
      }
    }
  }
}
Subscribe to Sensor subscribe

Subscribe to a different sensor or change settings.

Content type: application/json

{
  "type": "object",
  "description": "Command to subscribe to a sensor or update settings.",
  "required": [
    "type",
    "timestamp",
    "data"
  ],
  "properties": {
    "type": {
      "type": "string",
      "const": "subscribe",
      "description": "Message type identifier."
    },
    "timestamp": {
      "$ref": "#/components/schemas/Timestamp",
      "description": "UTC timestamp when this message was produced."
    },
    "data": {
      "type": "object",
      "required": [
        "sensor"
      ],
      "properties": {
        "sensor": {
          "type": "string",
          "description": "Name of the sensor to subscribe to."
        },
        "speed": {
          "type": "string",
          "enum": [
            "UI",
            "Game",
            "Fastest",
            "Default"
          ],
          "description": "Reading speed preset."
        },
        "throttleMs": {
          "type": "integer",
          "minimum": 0,
          "description": "Minimum milliseconds between readings."
        }
      }
    }
  }
}
Unsubscribe from Sensor unsubscribe

Stop receiving readings for a sensor.

Content type: application/json

{
  "type": "object",
  "description": "Command to unsubscribe from a sensor.",
  "required": [
    "type",
    "timestamp",
    "data"
  ],
  "properties": {
    "type": {
      "type": "string",
      "const": "unsubscribe",
      "description": "Message type identifier."
    },
    "timestamp": {
      "$ref": "#/components/schemas/Timestamp",
      "description": "UTC timestamp when this message was produced."
    },
    "data": {
      "type": "object",
      "required": [
        "sensor"
      ],
      "properties": {
        "sensor": {
          "type": "string",
          "description": "Name of the sensor to unsubscribe from."
        }
      }
    }
  }
}
WS /ws/v1/logs

Real-time application log streaming. Supports filtering by source and
minimum severity level via query-string parameters. Replays recent
entries on connect.

Log Replay replay

Initial replay of recent log entries on connect.

Content type: application/json

{
  "type": "object",
  "description": "Replay of recent log entries.",
  "required": [
    "type",
    "timestamp",
    "data"
  ],
  "properties": {
    "type": {
      "type": "string",
      "const": "replay",
      "description": "Message type identifier."
    },
    "timestamp": {
      "$ref": "#/components/schemas/Timestamp",
      "description": "UTC timestamp when this message was produced."
    },
    "data": {
      "type": "object",
      "required": [
        "entries"
      ],
      "properties": {
        "entries": {
          "type": "array",
          "items": {
            "$ref": "#/components/schemas/LogEntry"
          },
          "description": "Array of recent log entries."
        }
      }
    }
  }
}
Log Entry log

New log entry from the application.

Content type: application/json

{
  "type": "object",
  "description": "Live log entry event.",
  "required": [
    "type",
    "timestamp",
    "data"
  ],
  "properties": {
    "type": {
      "type": "string",
      "const": "log",
      "description": "Message type identifier."
    },
    "timestamp": {
      "$ref": "#/components/schemas/Timestamp",
      "description": "UTC timestamp when this message was produced."
    },
    "data": {
      "type": "object",
      "required": [
        "entry"
      ],
      "properties": {
        "entry": {
          "$ref": "#/components/schemas/LogEntry",
          "description": "The log entry."
        }
      }
    }
  }
}
WS /ws/v1/network

Real-time stream of captured HTTP requests. On connect the server replays
recent requests, then streams new requests as they are captured. Clients
may request full details for a specific request or clear the buffer.

Network Replay replay

Initial replay of recent requests on connect.

Content type: application/json

{
  "type": "object",
  "description": "Replay of recent network request entries.",
  "required": [
    "type",
    "timestamp",
    "data"
  ],
  "properties": {
    "type": {
      "type": "string",
      "const": "replay",
      "description": "Message type identifier."
    },
    "timestamp": {
      "$ref": "#/components/schemas/Timestamp",
      "description": "UTC timestamp when this message was produced."
    },
    "data": {
      "type": "object",
      "required": [
        "entries"
      ],
      "properties": {
        "entries": {
          "type": "array",
          "items": {
            "$ref": "#/components/schemas/NetworkRequestSummary"
          },
          "description": "Array of recent network request summaries."
        }
      }
    }
  }
}
Network Request Captured request

New HTTP request captured.

Content type: application/json

{
  "type": "object",
  "description": "Live network request event.",
  "required": [
    "type",
    "timestamp",
    "data"
  ],
  "properties": {
    "type": {
      "type": "string",
      "const": "request",
      "description": "Message type identifier."
    },
    "timestamp": {
      "$ref": "#/components/schemas/Timestamp",
      "description": "UTC timestamp when this message was produced."
    },
    "data": {
      "type": "object",
      "required": [
        "entry"
      ],
      "properties": {
        "entry": {
          "$ref": "#/components/schemas/NetworkRequestSummary",
          "description": "The captured network request summary."
        }
      }
    }
  }
}
Request Details Response details

Full details for a previously captured network request.

Content type: application/json

{
  "type": "object",
  "description": "Response containing full request/response details.",
  "required": [
    "type",
    "timestamp",
    "data"
  ],
  "properties": {
    "type": {
      "type": "string",
      "const": "details",
      "description": "Message type identifier."
    },
    "timestamp": {
      "$ref": "#/components/schemas/Timestamp",
      "description": "UTC timestamp when this message was produced."
    },
    "data": {
      "type": "object",
      "required": [
        "entry"
      ],
      "properties": {
        "entry": {
          "$ref": "#/components/schemas/NetworkRequestDetail",
          "description": "Full details of the network request."
        }
      }
    }
  }
}
Buffer Cleared cleared

Server confirms the request buffer has been cleared.

Content type: application/json

{
  "type": "object",
  "description": "Confirmation that the request buffer was cleared.",
  "required": [
    "type",
    "timestamp"
  ],
  "properties": {
    "type": {
      "type": "string",
      "const": "cleared",
      "description": "Message type identifier."
    },
    "timestamp": {
      "$ref": "#/components/schemas/Timestamp",
      "description": "UTC timestamp when this message was produced."
    }
  }
}
Get Request Details get_details

Request full details for a specific captured network request.

Content type: application/json

{
  "type": "object",
  "description": "Command to retrieve full details for a network request.",
  "required": [
    "type",
    "timestamp",
    "data"
  ],
  "properties": {
    "type": {
      "type": "string",
      "const": "get_details",
      "description": "Message type identifier."
    },
    "timestamp": {
      "$ref": "#/components/schemas/Timestamp",
      "description": "UTC timestamp when this message was produced."
    },
    "data": {
      "type": "object",
      "required": [
        "id"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Unique identifier of the network request to retrieve."
        }
      }
    }
  }
}
Clear Request Buffer clear

Clear the server's captured request buffer.

Content type: application/json

{
  "type": "object",
  "description": "Command to clear the request buffer.",
  "required": [
    "type",
    "timestamp"
  ],
  "properties": {
    "type": {
      "type": "string",
      "const": "clear",
      "description": "Message type identifier."
    },
    "timestamp": {
      "$ref": "#/components/schemas/Timestamp",
      "description": "UTC timestamp when this message was produced."
    }
  }
}
WS /ws/v1/profiler

Real-time profiler data stream. Streams periodic batches of samples,
markers, and spans from an active profiling session. Use cursor
parameters to resume from a specific position.

Profiler Batch batch

Periodic batch of profiler samples, markers, and spans.

Content type: application/json

{
  "type": "object",
  "description": "Batch of profiler data with updated cursors.",
  "required": [
    "type",
    "timestamp",
    "data"
  ],
  "properties": {
    "type": {
      "type": "string",
      "const": "batch",
      "description": "Message type identifier."
    },
    "timestamp": {
      "$ref": "#/components/schemas/Timestamp",
      "description": "UTC timestamp when this message was produced."
    },
    "data": {
      "$ref": "#/components/schemas/ProfilerBatch",
      "description": "Profiler batch containing samples, markers, spans, and updated cursor positions for pagination.\n"
    }
  }
}
Profiler Stopped stopped

Profiling session has ended.

Content type: application/json

{
  "type": "object",
  "description": "Notification that a profiling session ended.",
  "required": [
    "type",
    "timestamp",
    "data"
  ],
  "properties": {
    "type": {
      "type": "string",
      "const": "stopped",
      "description": "Message type identifier."
    },
    "timestamp": {
      "$ref": "#/components/schemas/Timestamp",
      "description": "UTC timestamp when this message was produced."
    },
    "data": {
      "type": "object",
      "required": [
        "sessionId"
      ],
      "properties": {
        "sessionId": {
          "type": "string",
          "description": "Identifier of the stopped profiler session."
        }
      }
    }
  }
}
WS /ws/v1/ui/events

Real-time UI state change notifications including navigation, lifecycle
changes, visual tree mutations, system alerts, and unhandled exceptions.
Clients subscribe to the event types they are interested in.

Navigation Event navigation

Page or screen navigation occurred.

Content type: application/json

{
  "type": "object",
  "description": "Navigation event indicating a page or route change.",
  "required": [
    "type",
    "timestamp",
    "data"
  ],
  "properties": {
    "type": {
      "type": "string",
      "const": "navigation",
      "description": "Message type identifier."
    },
    "timestamp": {
      "$ref": "#/components/schemas/Timestamp",
      "description": "UTC timestamp when this message was produced."
    },
    "data": {
      "type": "object",
      "required": [
        "to",
        "timestamp"
      ],
      "properties": {
        "from": {
          "type": [
            "string",
            "null"
          ],
          "description": "Route or page navigated away from."
        },
        "to": {
          "type": "string",
          "description": "Route or page navigated to."
        },
        "route": {
          "type": [
            "string",
            "null"
          ],
          "description": "Route pattern, if applicable."
        },
        "timestamp": {
          "$ref": "#/components/schemas/Timestamp",
          "description": "Timestamp when the navigation occurred."
        }
      }
    }
  }
}
Lifecycle Event lifecycle

Application lifecycle state change.

Content type: application/json

{
  "type": "object",
  "description": "Application lifecycle event.",
  "required": [
    "type",
    "timestamp",
    "data"
  ],
  "properties": {
    "type": {
      "type": "string",
      "const": "lifecycle",
      "description": "Message type identifier."
    },
    "timestamp": {
      "$ref": "#/components/schemas/Timestamp",
      "description": "UTC timestamp when this message was produced."
    },
    "data": {
      "type": "object",
      "required": [
        "state",
        "timestamp"
      ],
      "properties": {
        "state": {
          "type": "string",
          "enum": [
            "started",
            "resumed",
            "paused",
            "stopped",
            "backgrounded",
            "foregrounded"
          ],
          "description": "New lifecycle state."
        },
        "timestamp": {
          "$ref": "#/components/schemas/Timestamp",
          "description": "Timestamp when the lifecycle change occurred."
        }
      }
    }
  }
}
Tree Change Event treeChange

Visual tree structure changed (element added, removed, or modified).

Content type: application/json

{
  "type": "object",
  "description": "Visual tree mutation event.",
  "required": [
    "type",
    "timestamp",
    "data"
  ],
  "properties": {
    "type": {
      "type": "string",
      "const": "treeChange",
      "description": "Message type identifier."
    },
    "timestamp": {
      "$ref": "#/components/schemas/Timestamp",
      "description": "UTC timestamp when this message was produced."
    },
    "data": {
      "type": "object",
      "required": [
        "changeType",
        "elementId",
        "elementType",
        "timestamp"
      ],
      "properties": {
        "changeType": {
          "type": "string",
          "enum": [
            "added",
            "removed",
            "modified"
          ],
          "description": "Type of tree change."
        },
        "elementId": {
          "type": "string",
          "description": "Identifier of the changed element."
        },
        "elementType": {
          "type": "string",
          "description": "Type name of the changed element."
        },
        "parentId": {
          "type": [
            "string",
            "null"
          ],
          "description": "Identifier of the parent element, or null for root elements."
        },
        "timestamp": {
          "$ref": "#/components/schemas/Timestamp",
          "description": "Timestamp when the tree change occurred."
        }
      }
    }
  }
}
Alert Event alert

System alert or dialog appeared.

Content type: application/json

{
  "type": "object",
  "description": "System alert / dialog event.",
  "required": [
    "type",
    "timestamp",
    "data"
  ],
  "properties": {
    "type": {
      "type": "string",
      "const": "alert",
      "description": "Message type identifier."
    },
    "timestamp": {
      "$ref": "#/components/schemas/Timestamp",
      "description": "UTC timestamp when this message was produced."
    },
    "data": {
      "type": "object",
      "required": [
        "buttons",
        "timestamp"
      ],
      "properties": {
        "title": {
          "type": [
            "string",
            "null"
          ],
          "description": "Alert title."
        },
        "message": {
          "type": [
            "string",
            "null"
          ],
          "description": "Alert message body."
        },
        "buttons": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Labels of the alert buttons."
        },
        "timestamp": {
          "$ref": "#/components/schemas/Timestamp",
          "description": "Timestamp when the alert appeared."
        }
      }
    }
  }
}
Unhandled Error Event error

Unhandled exception occurred in the application.

Content type: application/json

{
  "type": "object",
  "description": "Unhandled exception event.",
  "required": [
    "type",
    "timestamp",
    "data"
  ],
  "properties": {
    "type": {
      "type": "string",
      "const": "error",
      "description": "Message type identifier."
    },
    "timestamp": {
      "$ref": "#/components/schemas/Timestamp",
      "description": "UTC timestamp when this message was produced."
    },
    "data": {
      "type": "object",
      "required": [
        "message",
        "timestamp"
      ],
      "properties": {
        "message": {
          "type": "string",
          "description": "Error message."
        },
        "stackTrace": {
          "type": [
            "string",
            "null"
          ],
          "description": "Stack trace, if available."
        },
        "timestamp": {
          "$ref": "#/components/schemas/Timestamp",
          "description": "Timestamp when the error occurred."
        }
      }
    }
  }
}
Subscribe to Events subscribe

Subscribe to specific UI event types.

Content type: application/json

{
  "type": "object",
  "description": "Command to subscribe to UI event types.",
  "required": [
    "type",
    "timestamp",
    "data"
  ],
  "properties": {
    "type": {
      "type": "string",
      "const": "subscribe",
      "description": "Message type identifier."
    },
    "timestamp": {
      "$ref": "#/components/schemas/Timestamp",
      "description": "UTC timestamp when this message was produced."
    },
    "data": {
      "type": "object",
      "required": [
        "events"
      ],
      "properties": {
        "events": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "navigation",
              "lifecycle",
              "treeChange",
              "alert",
              "error",
              "all"
            ]
          },
          "description": "Event types to subscribe to. Use \"all\" to receive every event type.\n"
        }
      }
    }
  }
}
Unsubscribe from Events unsubscribe

Unsubscribe from specific UI event types.

Content type: application/json

{
  "type": "object",
  "description": "Command to unsubscribe from UI event types.",
  "required": [
    "type",
    "timestamp",
    "data"
  ],
  "properties": {
    "type": {
      "type": "string",
      "const": "unsubscribe",
      "description": "Message type identifier."
    },
    "timestamp": {
      "$ref": "#/components/schemas/Timestamp",
      "description": "UTC timestamp when this message was produced."
    },
    "data": {
      "type": "object",
      "required": [
        "events"
      ],
      "properties": {
        "events": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "navigation",
              "lifecycle",
              "treeChange",
              "alert",
              "error",
              "all"
            ]
          },
          "description": "Event types to unsubscribe from."
        }
      }
    }
  }
}