Expand description
Canonical schema types (single source of truth for semantic enums) Canonical schema types for sqry.
This module provides the single source of truth for all semantic types used across sqry interfaces (CLI, LSP, MCP). Interface-specific wire types should derive from or reference these canonical definitions.
§Design Goals
- Centralized definitions - All semantic enums defined once
- Cross-interface consistency - LSP and MCP use same underlying types
- Documentation - Each type is fully documented for API consumers
- Serialization - All types support JSON and postcard serialization
§Type Categories
§Graph Types (re-exported from graph::unified)
NodeKind- Categories of code symbols (function, class, method, etc.)EdgeKind- Relationship types between symbols (calls, imports, etc.)
§Query Types
RelationKind- Relation query types (callers, callees, imports, exports, returns)Visibility- Node visibility filter (public, private)
§Output Types
OutputFormat- Graph/result output formats (json, dot, d2, mermaid)
§Analysis Types
ChangeKind- Semantic diff change types (added, removed, modified, etc.)CycleKind- Cycle detection types (calls, imports, modules)DuplicateKind- Duplicate detection types (body, signature, struct)UnusedScope- Unused symbol scope (public, private, function, etc.)
§Usage
Interface packages should import these types and optionally create thin wrappers for JSON Schema generation (MCP) or protocol-specific serialization (LSP):
ⓘ
use sqry_core::schema::{RelationKind, Visibility, OutputFormat};
// MCP can derive schemars::JsonSchema on a wrapper if needed
#[derive(schemars::JsonSchema)]
#[serde(transparent)]
pub struct RelationTypeParam(RelationKind);Re-exports§
Enums§
- Change
Kind - Types of changes detected by semantic diff.
- Cycle
Kind - Types of cycles to detect in code graphs.
- Duplicate
Kind - Types of duplicates to detect in code.
- Output
Format - Output formats for graph exports and visualizations.
- Relation
Kind - Types of symbol relationships for relation queries.
- Unused
Scope - Scopes for unused symbol detection.
- Visibility
- Node visibility levels for filtering.