feat: add ecc2 shared context graph cli

This commit is contained in:
Affaan Mustafa
2026-04-10 03:50:21 -07:00
parent 194bf605c2
commit 8653d6d5d5
4 changed files with 999 additions and 8 deletions

View File

@@ -6,6 +6,7 @@ pub mod store;
use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
use std::collections::BTreeMap;
use std::fmt;
use std::path::Path;
use std::path::PathBuf;
@@ -154,6 +155,41 @@ pub struct DecisionLogEntry {
pub timestamp: DateTime<Utc>,
}
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
pub struct ContextGraphEntity {
pub id: i64,
pub session_id: Option<String>,
pub entity_type: String,
pub name: String,
pub path: Option<String>,
pub summary: String,
pub metadata: BTreeMap<String, String>,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
}
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
pub struct ContextGraphRelation {
pub id: i64,
pub session_id: Option<String>,
pub from_entity_id: i64,
pub from_entity_type: String,
pub from_entity_name: String,
pub to_entity_id: i64,
pub to_entity_type: String,
pub to_entity_name: String,
pub relation_type: String,
pub summary: String,
pub created_at: DateTime<Utc>,
}
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
pub struct ContextGraphEntityDetail {
pub entity: ContextGraphEntity,
pub outgoing: Vec<ContextGraphRelation>,
pub incoming: Vec<ContextGraphRelation>,
}
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
#[serde(rename_all = "snake_case")]
pub enum FileActivityAction {