gglib_core/
lib.rs

1#![doc = include_str!(concat!(env!("OUT_DIR"), "/README_GENERATED.md"))]
2#![deny(unused_crate_dependencies)]
3
4pub mod contracts;
5pub mod domain;
6pub mod download;
7pub mod events;
8pub mod normalize;
9pub mod paths;
10pub mod ports;
11pub mod services;
12pub mod settings;
13pub mod sse;
14pub mod utils;
15
16// Re-export commonly used types for convenience
17pub use domain::{
18    AGENT_EVENT_CHANNEL_CAPACITY, AgentConfig, AgentConfigError, AgentEvent, AgentMessage,
19    ApprovalKind, AssistantContent, ChatMessage, Conversation, ConversationUpdate, CouncilEvent,
20    DEFAULT_MAX_ITERATIONS, DEFAULT_MAX_PARALLEL_TOOLS, DEFAULT_MAX_STAGNATION_STEPS, HitlMode,
21    LlmStreamEvent, MAX_DEPTH, MAX_ITERATIONS_CEILING, MAX_NODES, MAX_PARALLEL_TOOLS_CEILING,
22    MAX_TOOL_TIMEOUT_MS_CEILING, MIN_CONTEXT_BUDGET_CHARS, MIN_TOOL_TIMEOUT_MS, McpEnvEntry,
23    McpLifecycle, McpServer, McpServerConfig, McpServerStatus, McpServerType, McpTool,
24    McpToolResult, Message, MessageContent, MessageRole, Model, ModelCapabilities,
25    ModelFilterOptions, NewConversation, NewMcpServer, NewMessage, NewModel, NodeId, NodeStatus,
26    RangeValues, SEARCH_RESULTS_CAP, TaskGraph, TaskGraphError, TaskNode, ToolCall, ToolDefinition,
27    ToolIndex, ToolResult, ToolSummary, UpdateMcpServer, capabilities_from_architecture,
28    infer_from_chat_template, transform_messages_for_capabilities,
29};
30pub use download::{
31    AttemptCounts, CompletionDetail, CompletionKey, CompletionKind, DownloadError, DownloadEvent,
32    DownloadId, DownloadResult, DownloadStatus, DownloadSummary, FailedDownload, Quantization,
33    QueueRunSummary, QueueSnapshot, QueuedDownload, ShardInfo,
34};
35pub use events::{AppEvent, McpServerSummary, ModelSummary, ServerSnapshotEntry};
36pub use ports::{
37    AgentError, AgentLoopPort, AgentRunOutput, AppEventBridge, AppEventEmitter, ChatHistoryError,
38    ChatHistoryRepository, CompletedDownload, CoreError, DownloadEventEmitterPort,
39    DownloadManagerConfig, DownloadManagerPort, DownloadRequest, DownloadStateRepositoryPort,
40    EmptyToolExecutor, FilteredToolExecutor, GgufCapabilities, GgufMetadata, GgufParseError,
41    GgufParserPort, HfClientPort, HfFileInfo, HfPortError, HfQuantInfo, HfRepoInfo,
42    HfSearchOptions, HfSearchResult, LlmCompletionPort, McpErrorCategory, McpErrorInfo,
43    McpRepositoryError, McpServerRepository, McpServiceError, ModelRegistrarPort, ModelRepository,
44    NoopDownloadEmitter, NoopEmitter, NoopGgufParser, ProcessError, ProcessHandle, ProcessRunner,
45    QuantizationResolver, Repos, RepositoryError, Resolution, ResolvedFile, ResponseFormat,
46    ServerConfig, ServerHealth, SettingsRepository, StructuredOutputError, TOOL_NOT_AVAILABLE_MSG,
47    ToolExecutorPort,
48};
49pub use services::{ChatHistoryService, ModelRegistrar};
50pub use settings::{
51    DEFAULT_CONTEXT_SIZE, DEFAULT_LLAMA_BASE_PORT, DEFAULT_PROXY_PORT, Settings, SettingsError,
52    SettingsUpdate, validate_settings,
53};
54
55// Re-export timing utility
56pub use utils::timing::{elapsed_ms, format_duration_human};
57
58// Re-export path utilities
59#[cfg(not(target_os = "windows"))]
60pub use paths::DEFAULT_MODELS_DIR_RELATIVE;
61pub use paths::{
62    DirectoryCreationStrategy, ModelsDirResolution, ModelsDirSource, PathError, data_root,
63    database_path, default_models_dir, ensure_directory, env_file_path, is_prebuilt_binary,
64    llama_config_path, llama_cpp_dir, llama_server_path, persist_env_value, persist_models_dir,
65    resolve_models_dir, resource_root, verify_writable,
66};
67
68// Silence unused dev-dependency warnings until we add mock-based tests
69#[cfg(test)]
70use mockall as _;
71#[cfg(test)]
72use tokio_test as _;