1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
//! 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
//!
//! 1. **Centralized definitions** - All semantic enums defined once
//! 2. **Cross-interface consistency** - LSP and MCP use same underlying types
//! 3. **Documentation** - Each type is fully documented for API consumers
//! 4. **Serialization** - All types support JSON and postcard serialization
//!
//! # Type Categories
//!
//! ## Graph Types (re-exported from `graph::unified`)
//! - [`NodeKind`](crate::graph::unified::node::NodeKind) - Categories of code symbols (function, class, method, etc.)
//! - [`EdgeKind`](crate::graph::unified::edge::EdgeKind) - Relationship types between symbols (calls, imports, etc.)
//!
//! ## Query Types
//! - [`RelationKind`](crate::schema::RelationKind) - Relation query types (callers, callees, imports, exports, returns)
//! - [`Visibility`](crate::schema::Visibility) - Node visibility filter (public, private)
//!
//! ## Output Types
//! - [`OutputFormat`](crate::schema::OutputFormat) - Graph/result output formats (json, dot, d2, mermaid)
//!
//! ## Analysis Types
//! - [`ChangeKind`](crate::schema::ChangeKind) - Semantic diff change types (added, removed, modified, etc.)
//! - [`CycleKind`](crate::schema::CycleKind) - Cycle detection types (calls, imports, modules)
//! - [`DuplicateKind`](crate::schema::DuplicateKind) - Duplicate detection types (body, signature, struct)
//! - [`UnusedScope`](crate::schema::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):
//!
//! ```rust,ignore
//! 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-export all canonical types
pub use ChangeKind;
pub use CycleKind;
pub use DuplicateKind;
pub use OutputFormat;
pub use RelationKind;
pub use UnusedScope;
pub use Visibility;
// Re-export graph types as canonical schema types
pub use crate;
pub use crateNodeKind;
// Phase β joint-stubs (Plan A + Plan B coordination — V12 schema bump).
//
// `FrameworkId` is re-exported here so the planner predicate
// (`sqry-db::planner::Predicate::FrameworkEq`) and the MCP filter parameter
// (`sqry-mcp::tools::params::*::framework`) can both refer to the canonical
// schema-level alias rather than reaching into
// `crate::graph::unified::storage::framework_routes` directly. `ResolvedVia`
// is already re-exported above (introduced for C-icall Phase A); Plan B's
// `Predicate::ResolvedViaEq(Vec<ResolvedVia>)` reuses that alias unchanged
// — see the schema re-export above.
pub use crate;
// Re-export `HttpMethod` here too — Plan A `FrameworkRouteMetadata.method`
// reuses the existing graph-side enum already used by `EdgeKind::HttpRequest`
// (DESIGN §6 line 151), so the schema-level alias keeps downstream MCP /
// CLI surfaces from having to reach into `graph::unified::edge::kind`
// directly.
pub use crateHttpMethod;