(parsed: &Value)
| 698 | } |
| 699 | |
| 700 | fn cursor_tool_hint_input(parsed: &Value) -> ToolHintInput { |
| 701 | let tool_input = parsed |
| 702 | .get("tool_input") |
| 703 | .or_else(|| parsed.get("toolInput")) |
| 704 | .or_else(|| parsed.get("input")) |
| 705 | .unwrap_or(&Value::Null); |
| 706 | ToolHintInput { |
| 707 | agent: HintAgent::Cursor, |
| 708 | session_id: event_session_id(parsed), |
| 709 | tool_name: text_field(parsed, &["tool_name", "toolName", "name"]), |
| 710 | command: text_field(tool_input, &["command", "cmd"]) |
| 711 | .or_else(|| text_field(parsed, &["command", "cmd"])), |
| 712 | prompt: text_field( |
| 713 | tool_input, |
| 714 | &["prompt", "query", "pattern", "task", "description"], |
| 715 | ) |
| 716 | .or_else(|| { |
| 717 | text_field( |
| 718 | parsed, |
| 719 | &["prompt", "query", "pattern", "task", "description"], |
| 720 | ) |
| 721 | }), |
| 722 | subagent_type: text_field(parsed, &["subagent_type", "subagentType", "agent_type"]), |
| 723 | file_path: text_field(tool_input, &["file_path", "filePath", "path"]) |
| 724 | .or_else(|| text_field(parsed, &["file_path", "filePath", "path"])), |
| 725 | hints_enabled: true, |
| 726 | } |
| 727 | } |
| 728 | |
| 729 | #[cfg(test)] |
| 730 | #[allow(clippy::unwrap_used)] |
no test coverage detected