1pub use dk_protocol::{
3 CallEdgeRef, CodebaseSummary, ConflictDetail, DependencyRef, MergeConflict, MergeSuccess,
4 RecentOverwriteWarning, SubmitError, SymbolOverwrite, SymbolRef, SymbolResult,
5 VerifyStepResult, WatchEvent,
6};
7
8#[derive(Debug, Clone)]
11pub enum Change {
12 Add { path: String, content: String },
13 Modify { path: String, content: String },
14 Delete { path: String },
15}
16
17impl Change {
18 pub fn add(path: impl Into<String>, content: impl Into<String>) -> Self {
20 Change::Add {
21 path: path.into(),
22 content: content.into(),
23 }
24 }
25
26 pub fn modify(path: impl Into<String>, content: impl Into<String>) -> Self {
28 Change::Modify {
29 path: path.into(),
30 content: content.into(),
31 }
32 }
33
34 pub fn delete(path: impl Into<String>) -> Self {
36 Change::Delete { path: path.into() }
37 }
38}
39
40#[derive(Debug, Clone, Copy)]
42pub enum Depth {
43 Signatures,
44 Full,
45 CallGraph,
46}
47
48#[derive(Debug, Clone)]
50pub enum Filter {
51 All,
52 Symbols,
53 Files,
54}
55
56#[derive(Debug)]
58pub struct ConnectResult {
59 pub session_id: String,
60 pub changeset_id: String,
61 pub codebase_version: String,
62 pub summary: Option<CodebaseSummary>,
63}
64
65#[derive(Debug)]
67pub struct ContextResult {
68 pub symbols: Vec<SymbolResult>,
69 pub call_graph: Vec<CallEdgeRef>,
70 pub dependencies: Vec<DependencyRef>,
71 pub estimated_tokens: u32,
72}
73
74#[derive(Debug)]
76pub struct SubmitResult {
77 pub changeset_id: String,
78 pub status: String,
79 pub errors: Vec<SubmitError>,
80}
81
82#[derive(Debug)]
84pub enum MergeResult {
85 Success(MergeSuccess),
87 Conflict(MergeConflict),
89 OverwriteWarning(RecentOverwriteWarning),
91}