Skip to main content

relay_knowledge/api/operations/
graph_maintenance.rs

1use serde::{Deserialize, Serialize};
2
3use crate::{
4    api::ApiMetadata,
5    domain::{CodeRepositoryTotals, IndexKind, IndexStatus},
6    storage::{GraphInspection, IndexCursor, IndexRefreshDiagnostics},
7};
8
9/// Graph inspection request with optional scope filtering reserved for adapters.
10#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
11pub struct GraphInspectionRequest {
12    #[serde(skip_serializing_if = "Option::is_none")]
13    pub source_scope: Option<String>,
14}
15
16/// Graph inspection response for diagnostics and agent adapters.
17#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
18pub struct GraphInspectionResponse {
19    pub metadata: ApiMetadata,
20    pub graph: GraphInspection,
21    pub repository_code_totals: CodeRepositoryTotals,
22}
23
24/// Index refresh request. Empty `kinds` means all v1 index families.
25#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
26pub struct IndexRefreshRequest {
27    #[serde(default)]
28    pub kinds: Vec<IndexKind>,
29}
30
31/// Index refresh response after metadata is updated.
32#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
33pub struct IndexRefreshResponse {
34    pub metadata: ApiMetadata,
35    pub indexes: Vec<IndexStatus>,
36    pub index_cursors: Vec<IndexCursor>,
37    pub diagnostics: IndexRefreshDiagnostics,
38}