Skip to main content

talon_core/indexing/
input.rs

1//! Indexing tool input types.
2
3use serde::{Deserialize, Serialize};
4
5/// Inspect check type.
6#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
7#[serde(rename_all = "kebab-case")]
8pub enum InspectCheck {
9    /// Run all checks.
10    All,
11    /// Files with no incoming wikilinks.
12    Orphans,
13    /// Links whose targets don't resolve to indexed files.
14    BrokenLinks,
15    /// Frontmatter `sources:` pointing to non-existent paths.
16    DanglingRefs,
17    /// Files with no incoming AND no outgoing wikilinks.
18    Unreferenced,
19    /// Persisted graph health findings and missing-link suggestions.
20    Graph,
21}
22
23/// Sync request.
24#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Default)]
25#[serde(rename_all = "camelCase")]
26pub struct SyncInput {
27    /// Specific paths to sync (empty = full pass).
28    #[serde(default)]
29    pub paths: Vec<String>,
30    /// Skip embeddings (lexical-only pass).
31    #[serde(default)]
32    pub fast: bool,
33    /// Reset vector state before syncing.
34    #[serde(default)]
35    pub force: bool,
36    /// Delete and recreate the index before syncing.
37    #[serde(default)]
38    pub rebuild: bool,
39}
40
41/// Status request.
42#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Default)]
43#[serde(rename_all = "camelCase")]
44pub struct StatusInput {
45    /// Emit JSON output.
46    #[serde(default)]
47    pub json: bool,
48}
49
50/// Inspect check request.
51#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
52#[serde(rename_all = "camelCase")]
53pub struct InspectInput {
54    /// Which inspect check to run.
55    pub check: InspectCheck,
56    /// Scope names to include.
57    #[serde(default)]
58    pub scope: Vec<String>,
59    /// Scope names to search exclusively.
60    #[serde(default)]
61    pub scope_only: Vec<String>,
62    /// Include every configured scope, overriding `default = false`.
63    #[serde(default)]
64    pub scope_all: bool,
65    /// Maximum number of findings to return.
66    #[serde(default)]
67    pub limit: Option<u16>,
68}