kmp_application/queries/context_render_options.rs
1use kmp_domain::{KmpMode, ResolutionTier};
2
3/// Hint about which RPC endpoint triggered this render. Influences the mode
4/// heuristic thresholds — scoped paths tolerate more pruning, sessions need
5/// richer context.
6#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
7pub enum EndpointHint {
8 /// `GetContext` — broad neighborhood retrieval.
9 #[default]
10 Neighborhood,
11 /// `GetContextPath` — specific path to a target node.
12 FocusedPath,
13 /// `RehydrateSession` — multi-role snapshot.
14 SessionSnapshot,
15}
16
17#[derive(Debug, Clone, PartialEq, Eq, Default)]
18pub struct ContextRenderOptions {
19 pub focus_node_id: Option<String>,
20 pub token_budget: Option<u32>,
21 /// Maximum tier to render. `None` means all tiers (backward compatible).
22 pub max_tier: Option<ResolutionTier>,
23 /// Rehydration mode. `Auto` lets the kernel choose based on token pressure.
24 pub rehydration_mode: KmpMode,
25 /// Which endpoint is requesting this render.
26 pub endpoint_hint: EndpointHint,
27}