# eclipse-core
The library under Eclipse: configuration, sessions, an OpenAI-compatible provider, the tool surface,
and the agent loop that ties them together.
Everything the terminal, the web dashboard and the gateway do goes through this crate — there is no
second implementation of "what a turn is" anywhere in the workspace.
## What is in it
| `config` | `config.toml` and `.env` loading, the key catalogue, provider profiles |
| `session` | the SQLite store: messages, titles, the archive flag, search |
| `provider` | the HTTP client for an OpenAI-compatible API, streaming, retries, reasoning policy |
| `tools` | the tool registry, the approval contract, and every built-in tool |
| `runtime` | `Agent` — one turn: prompt, tool calls, approvals, compaction, the events a front draws |
| `reasoning` | the effort ladder and each backend's own vocabulary for it |
## A turn, without a front end
```rust
use std::sync::Arc;
use eclipse_core::config::ProviderConfig;
use eclipse_core::provider::OpenAiProvider;
use eclipse_core::runtime::Agent;
use eclipse_core::session::SessionStore;
use eclipse_core::tools::{DenyAll, ToolRegistry};
# async fn example() -> eclipse_core::Result<()> {
let cfg = ProviderConfig {
base_url: "http://127.0.0.1:8080/v1".into(),
model: "local-model".into(),
..Default::default()
};
let agent = Agent::new(
Arc::new(OpenAiProvider::new(&cfg)?),
Arc::new(ToolRegistry::default()),
SessionStore::new("/home/you/.eclipse/sessions".into()),
"You are a careful assistant.".into(),
8, // tool round-trips per turn
);
// `DenyAll` refuses every tool call; the terminal and the dashboard pass a real approver here.