orka.tui.data_manager module

Data management for TUI interface - statistics, caching, and data fetching.

class orka.tui.data_manager.MemoryLoggerProtocol(*args, **kwargs)[source]

Bases: Protocol

get_memory_stats() Dict[str, Any][source]
get_recent_stored_memories(limit: int) List[Dict[str, Any]][source]
search_memories(query: str, num_results: int, log_type: str) List[Dict[str, Any]][source]
get_performance_metrics() Dict[str, Any][source]
class orka.tui.data_manager.MemoryStats(max_history: int = 100)[source]

Bases: object

Container for memory statistics with historical tracking.

update(stats: Dict[str, str | int | float | bool | Dict[str, Any]]) None[source]

Update current stats and add to history.

get_trend(key: str, window: int = 10) str[source]

Get trend direction for a metric.

get_rate(key: str, window: int = 5) float[source]

Get rate of change for a metric (per second).

class orka.tui.data_manager.DataManager[source]

Bases: object

Manages data fetching and caching for the TUI interface.

init_memory_logger(args: Any) None[source]

Initialize the memory logger.

update_data() None[source]

Update all monitoring data.

is_short_term_memory(memory: dict[str, Any]) bool[source]

Check if a memory entry is short-term (TTL < 1 hour).

get_filtered_memories(memory_type: str = 'all') list[dict[str, Any]][source]
get_memory_distribution() Dict[str, Any][source]

Get distribution of memory types and log types for diagnostic purposes.

get_unified_stats() Dict[str, Any][source]

Get unified, comprehensive statistics for all TUI components. This replaces scattered calculations throughout the TUI system.

debug_memory_data() None[source]

Debug method to inspect memory data structure.