ive harnessed the harness
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

at main 95 lines 2.0 kB view raw
1use serde::{Deserialize, Serialize}; 2 3/// client → daemon 4#[derive(Debug, Serialize, Deserialize)] 5#[serde(tag = "type", rename_all = "snake_case")] 6pub enum ClientMsg { 7 Message { 8 source: String, 9 content: String, 10 }, 11 ExternalEvent { 12 source: String, 13 conversation_id: String, 14 content: String, 15 author_id: Option<String>, 16 author_name: Option<String>, 17 message_id: Option<String>, 18 timestamp: Option<i64>, 19 #[serde(default)] 20 metadata: serde_json::Value, 21 }, 22 FetchHistory { 23 before_id: i64, 24 limit: usize, 25 }, 26 Compact, 27 Reset, 28 DumpMemories { 29 path: Option<String>, 30 }, 31} 32 33#[derive(Debug, Serialize, Deserialize, Clone)] 34#[serde(rename_all = "snake_case")] 35pub struct HistoryEntry { 36 pub id: i64, 37 pub timestamp: i64, 38 pub role: String, 39 pub content: String, 40 pub reasoning: Option<String>, 41} 42 43/// daemon → client 44#[derive(Debug, Serialize, Deserialize, Clone)] 45#[serde(tag = "type", rename_all = "snake_case")] 46pub enum ServerMsg { 47 Started, 48 Token { 49 content: String, 50 }, 51 ThinkToken { 52 content: String, 53 }, 54 Done, 55 Reset, 56 ReflectStarted, 57 ReflectDone, 58 Error { 59 content: String, 60 }, 61 Status { 62 content: String, 63 }, 64 /// sent after each Done with current agent stats 65 Metrics { 66 turn_count: usize, 67 context_tokens: usize, 68 watermark: usize, 69 }, 70 History { 71 turns: Vec<HistoryEntry>, 72 }, 73 Turn { 74 entry: HistoryEntry, 75 }, 76 ExternalEvent { 77 source: String, 78 conversation_id: String, 79 content: String, 80 }, 81 ToolCall { 82 name: String, 83 args: String, 84 }, 85 ToolResult { 86 name: String, 87 content: String, 88 }, 89} 90 91pub const DEFAULT_WS_URL: &str = "ws://127.0.0.1:8765"; 92 93pub fn ws_url() -> &'static str { 94 DEFAULT_WS_URL 95}