Skip to main content

relay_knowledge/api/operations/
graph_maintenance.rs

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