(state: &Arc<ServerState>, path: &str, body: serde_json::Value)
| 3713 | static TUI_RESPONSE_NOTIFY: Lazy<Notify> = Lazy::new(Notify::new); |
| 3714 | |
| 3715 | async fn enqueue_tui_request(state: &Arc<ServerState>, path: &str, body: serde_json::Value) { |
| 3716 | let mut queue = TUI_REQUEST_QUEUE.lock().await; |
| 3717 | queue.push_back(TuiRequest { |
| 3718 | path: path.to_string(), |
| 3719 | body: body.clone(), |
| 3720 | }); |
| 3721 | drop(queue); |
| 3722 | TUI_REQUEST_NOTIFY.notify_one(); |
| 3723 | |
| 3724 | state.broadcast( |
| 3725 | &serde_json::json!({ |
| 3726 | "type": "tui.request", |
| 3727 | "path": path, |
| 3728 | "body": body, |
| 3729 | }) |
| 3730 | .to_string(), |
| 3731 | ); |
| 3732 | } |
| 3733 | |
| 3734 | async fn append_prompt( |
| 3735 | State(state): State<Arc<ServerState>>, |
no test coverage detected