1pub use dk_protocol::{
3 CallEdgeRef, CodebaseSummary, ConflictInfo, DependencyRef, SubmitError, SymbolRef,
4 SymbolResult, VerifyStepResult, WatchEvent,
5};
6
7#[derive(Debug, Clone)]
10pub enum Change {
11 Add { path: String, content: String },
12 Modify { path: String, content: String },
13 Delete { path: String },
14}
15
16impl Change {
17 pub fn add(path: impl Into<String>, content: impl Into<String>) -> Self {
19 Change::Add {
20 path: path.into(),
21 content: content.into(),
22 }
23 }
24
25 pub fn modify(path: impl Into<String>, content: impl Into<String>) -> Self {
27 Change::Modify {
28 path: path.into(),
29 content: content.into(),
30 }
31 }
32
33 pub fn delete(path: impl Into<String>) -> Self {
35 Change::Delete { path: path.into() }
36 }
37}
38
39#[derive(Debug, Clone, Copy)]
41pub enum Depth {
42 Signatures,
43 Full,
44 CallGraph,
45}
46
47#[derive(Debug, Clone)]
49pub enum Filter {
50 All,
51 Symbols,
52 Files,
53}
54
55#[derive(Debug)]
57pub struct ConnectResult {
58 pub session_id: String,
59 pub changeset_id: String,
60 pub codebase_version: String,
61 pub summary: Option<CodebaseSummary>,
62}
63
64#[derive(Debug)]
66pub struct ContextResult {
67 pub symbols: Vec<SymbolResult>,
68 pub call_graph: Vec<CallEdgeRef>,
69 pub dependencies: Vec<DependencyRef>,
70 pub estimated_tokens: u32,
71}
72
73#[derive(Debug)]
75pub struct SubmitResult {
76 pub changeset_id: String,
77 pub status: String,
78 pub errors: Vec<SubmitError>,
79}
80
81#[derive(Debug)]
83pub struct MergeResult {
84 pub commit_hash: String,
85 pub merged_version: String,
86 pub conflicts: Vec<ConflictInfo>,
87}