Skip to main content

roder_api/
patch_progress.rs

1//! Proposed patch changes emitted during generation; these are not evidence
2//! of a filesystem write or approval to execute a tool.
3use crate::events::{ThreadId, TurnId};
4use serde::{Deserialize, Serialize};
5
6#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7#[serde(rename_all = "camelCase")]
8pub struct PatchProgress {
9    pub thread_id: ThreadId,
10    pub turn_id: TurnId,
11    pub tool_id: String,
12    pub patch: String,
13    pub changes: Vec<ProposedPatchChange>,
14    pub complete: bool,
15}
16
17#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
18#[serde(rename_all = "camelCase")]
19pub struct ProposedPatchChange {
20    pub path: String,
21    pub change_type: String,
22    #[serde(default, skip_serializing_if = "Option::is_none")]
23    pub move_to: Option<String>,
24    /// Requested context/removal lines, not the complete source file.
25    pub old_lines: Vec<String>,
26    /// Requested context/addition lines, not the complete resulting file.
27    pub new_lines: Vec<String>,
28}