Trigger the TextComplete plugin hook after stream collection. Call this after `collect_stream` when you have the final text.
(session_id: &str, text: &str)
| 1521 | /// Trigger the TextComplete plugin hook after stream collection. |
| 1522 | /// Call this after `collect_stream` when you have the final text. |
| 1523 | pub async fn notify_text_complete(session_id: &str, text: &str) { |
| 1524 | if !text.is_empty() { |
| 1525 | let _ = opencode_plugin::trigger_collect( |
| 1526 | HookContext::new(HookEvent::TextComplete) |
| 1527 | .with_session(session_id) |
| 1528 | .with_data("text", serde_json::json!(text)), |
| 1529 | ) |
| 1530 | .await; |
| 1531 | } |
| 1532 | } |
| 1533 | |
| 1534 | pub fn to_model_messages(messages: &[MessageWithParts]) -> Vec<Message> { |
| 1535 | messages |
nothing calls this directly
no test coverage detected