feat: add main features
Agents for developpement added + frontend add + backend added. Git viewer created + agent and template creator + layout and project creator
This commit is contained in:
88
crates/domain/src/lib.rs
Normal file
88
crates/domain/src/lib.rs
Normal file
@ -0,0 +1,88 @@
|
||||
//! # IdeA — Domain layer
|
||||
//!
|
||||
//! The **pure** hexagonal core (ARCHITECTURE.md §1.4, §3, §4, §7). It contains:
|
||||
//!
|
||||
//! - **Entities & value objects** with invariants enforced by validating
|
||||
//! constructors (`new`/`try_new` returning `Result`),
|
||||
//! - the **pure layout logic** (`split`/`merge`/`resize`/`move` as immutable
|
||||
//! `&LayoutTree -> Result<LayoutTree, LayoutError>` functions),
|
||||
//! - **ports** (traits) the infrastructure implements,
|
||||
//! - **domain events** and **errors**.
|
||||
//!
|
||||
//! ## Dependency rule
|
||||
//!
|
||||
//! This crate depends on **no I/O**: no `tokio`, no `std::fs`, no
|
||||
//! `std::process`, no `git2`/`portable-pty`/`russh`. The only third-party
|
||||
//! dependencies are `uuid`, `serde` (allowed solely to derive (de)serialisation
|
||||
//! of *persisted* domain types — a metier format constraint, not I/O),
|
||||
//! `thiserror`, and `async-trait`.
|
||||
//!
|
||||
//! ## Async strategy for ports
|
||||
//!
|
||||
//! I/O-touching ports (`PtyPort`, `FileSystem`, `ProcessSpawner`, `RemoteHost`,
|
||||
//! the stores, `GitPort`) are `#[async_trait]`. They are injected as
|
||||
//! `Arc<dyn Port>` trait objects at the composition root, which native
|
||||
//! `async fn`-in-trait does not yet support dyn-compatibly without boxing;
|
||||
//! `async_trait` boxes the returned future and keeps the ports object-safe.
|
||||
//! Non-blocking ports (`Clock`, `IdGenerator`, `EventBus`, `AgentRuntime`)
|
||||
//! remain plain synchronous traits. See [`ports`] for details.
|
||||
|
||||
#![forbid(unsafe_code)]
|
||||
#![warn(missing_docs)]
|
||||
|
||||
pub mod agent;
|
||||
pub mod error;
|
||||
pub mod events;
|
||||
pub mod git;
|
||||
pub mod ids;
|
||||
pub mod layout;
|
||||
pub mod markdown;
|
||||
pub mod ports;
|
||||
pub mod profile;
|
||||
pub mod project;
|
||||
pub mod remote;
|
||||
pub mod template;
|
||||
pub mod terminal;
|
||||
|
||||
mod validation;
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Curated re-exports for ergonomic downstream use.
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
pub use error::DomainError;
|
||||
|
||||
pub use ids::{
|
||||
AgentId, LayoutId, NodeId, ProfileId, ProjectId, SessionId, TabId, TemplateId, WindowId,
|
||||
};
|
||||
|
||||
pub use project::{Project, ProjectPath};
|
||||
|
||||
pub use agent::{Agent, AgentManifest, AgentOrigin, ManifestEntry};
|
||||
|
||||
pub use template::{AgentTemplate, TemplateVersion};
|
||||
|
||||
pub use profile::{AgentProfile, ContextInjection};
|
||||
|
||||
pub use markdown::MarkdownDoc;
|
||||
|
||||
pub use remote::{RemoteKind, RemoteRef, SshAuth};
|
||||
|
||||
pub use terminal::{PtySize, SessionKind, SessionStatus, TerminalSession};
|
||||
|
||||
pub use git::GitRepository;
|
||||
|
||||
pub use layout::{
|
||||
Direction, GridCell, GridContainer, LayoutError, LayoutNode, LayoutTree, LeafCell,
|
||||
SplitContainer, Tab, WeightedChild, Window, Workspace,
|
||||
};
|
||||
|
||||
pub use events::DomainEvent;
|
||||
|
||||
pub use ports::{
|
||||
AgentContextStore, AgentRuntime, Clock, ContextInjectionPlan, DirEntry, EventBus, EventStream,
|
||||
ExitStatus, FileSystem, FsError, GitCommitInfo, GitError, GitFileStatus, GitPort, GraphCommit,
|
||||
IdGenerator, Output, OutputStream, PreparedContext, ProcessError, ProcessSpawner, ProfileStore,
|
||||
ProjectStore, PtyError, PtyHandle, PtyPort, RemoteError, RemoteHost, RemotePath, RuntimeError,
|
||||
SpawnSpec, StoreError, TemplateStore,
|
||||
};
|
||||
Reference in New Issue
Block a user