pub mod agent_notes;
pub mod branch_reset;
pub mod changes;
pub mod commit_envelope;
pub mod coverage;
pub mod diff;
pub mod export;
pub mod health;
pub mod health_compose;
pub mod integrity;
pub mod labelling;
pub mod proposal;
pub mod redaction;
#[cfg(not(target_arch = "wasm32"))]
pub mod search;
pub mod signals;
pub mod strict;
pub mod transport;
pub use agent_notes::{AgentNotesReport, CommitNote};
pub use branch_reset::{BranchResetOutcome, StrandedCrossMemRef};
pub use changes::{
BackendChanges, ChangeEnvelope, ChangesReport, EMPTY_TREE_SHA, MemChangedNotice,
NoticeByChange, NoticeChanges, RENAME_SIMILARITY_DEFAULT, RENAME_SIMILARITY_MAX,
RENAME_SIMILARITY_MIN, StoreLookup, folder_changes_since,
};
pub use commit_envelope::{CommitEnvelope, EntityChange};
pub use diff::{Diff, DiffConfig, EntityDiff, IncomingRipple};
pub use export::{MemExportBytes, MemExportError};
pub use proposal::{
ProposalBrief, ProposalChange, ProposalEntry, ProposalMergeOutcome, ProposalRecord,
render_proposal_brief, render_proposal_merge, render_proposal_record,
};
pub use transport::{
FetchOutcome, PullAllOutcome, PullOutcome, PulledRef, PushAllOutcome, PushOutcome, PushedRef,
QuarantinedAfterPull, RefusedRef, RemoteAddOutcome, RemoteRefState, RemoteRefStatus,
RemoteStatusOutcome, UnmountedRemoteMem, UpdatedRef,
};
use crate::entity::EntityId;
use indexmap::IndexMap;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize, Serializer, ser::SerializeStruct};
use std::collections::HashMap;
use std::fmt;
pub const OVERVIEW_INCLUDE_KEYS: &[&str] = &[
"community_members",
"community_bridges",
"mem_distribution",
"dangling_links",
];
pub(crate) fn format_types_clause(types: &[String]) -> String {
types
.iter()
.map(|t| format!("'{t}'"))
.collect::<Vec<_>>()
.join(", ")
}
pub(crate) fn type_word_for(types: &[String]) -> &'static str {
if types.len() == 1 { "type" } else { "types" }
}
mod crud;
mod export_types;
mod health_types;
mod search_types;
mod warning_hint;
pub use crud::*;
pub use export_types::*;
pub use health_types::*;
pub use search_types::*;
pub use warning_hint::*;
#[derive(Debug, Clone, Serialize)]
pub struct ContextResult {
pub entity_id: EntityId,
pub community: Option<String>,
pub neighbors: Vec<NeighborInfo>,
}
#[derive(Debug, Clone, Serialize)]
pub struct NeighborInfo {
pub id: EntityId,
pub title: String,
pub relationship: String,
pub direction: Direction,
}
#[derive(Debug, Clone, Serialize)]
pub enum Direction {
Outgoing,
Incoming,
}
#[derive(Debug, Clone, Serialize)]
pub struct Status {
pub entity_count: usize,
pub edge_count: usize,
pub edge_types: std::collections::BTreeMap<String, usize>,
pub community_count: usize,
pub mem_count: usize,
pub types_in_use: Vec<String>,
}
#[derive(Debug, Clone, Serialize)]
pub struct ReloadResult {
pub added: Vec<EntityId>,
pub changed: Vec<EntityId>,
pub removed: Vec<EntityId>,
}
#[derive(Debug, Clone, Serialize)]
pub struct ReloadReport {
pub mem: String,
pub head_before: String,
pub head_after: String,
pub entities_loaded: usize,
pub changed_entity_ids: Vec<EntityId>,
}
#[derive(Debug, Clone, Default, Serialize)]
pub struct FullRefreshReport {
pub schemas_added: Vec<String>,
pub schema_removals_skipped: Vec<String>,
pub mems_mounted: Vec<String>,
pub mems_unmounted: Vec<String>,
pub mems_quarantined: Vec<String>,
pub failures: Vec<RefreshFailure>,
pub elapsed_ms: u64,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct RefreshFailure {
pub item: String,
pub error: String,
}
#[cfg(test)]
mod tests;
#[cfg(test)]
mod write_id_doc_gloss_tests;