Skip to main content

Module drone_handlers

Module drone_handlers 

Source
Expand description

WSH RPC handlers for the Drone pane (issue #753 Phase 1).

Commands:

  • listdrones → Vec<DroneDefinition>
  • getdrone → Option<DroneDefinition>
  • upsertdrone → DroneDefinition (echoed back, normalized)
  • deletedrone → { deleted: bool }
  • rundrone → { run_id: String } (synchronous; SSE streaming added in Phase 1 PR-4)
  • listdroneruns → Vec<DroneRun>

Run streaming: the executor emits RunEvents over an mpsc channel. Phase 1 of this PR drains the channel server-side and stores the final block-state snapshot in db_drone_runs. A future commit will tee the channel to the renderer via the existing mps event broker so RunPanel shows live per-block status.

Structs§

DeleteDroneReq
DeleteResp
GetDroneReq
ListDronesReq
Request for listdrones, which ignores its payload.
ListRunsReq
RunDroneReq
RunResp

Constants§

MAX_LIST_LIMIT 🔒
Hard cap on ListRunsReq.limit — guards against a malicious or buggy client passing e.g. i64::MAX and pulling the entire run history (DoS / memory blow-up). 200 covers any plausible UI page size with headroom; Phase 2 pagination cursor work will move this to client-driven slicing. (kimi P1 on PR #755.)

Functions§

default_limit 🔒
register_drone_handlers