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:
79
crates/domain/src/events.rs
Normal file
79
crates/domain/src/events.rs
Normal file
@ -0,0 +1,79 @@
|
||||
//! Domain events published on the [`crate::ports::EventBus`] and relayed to the
|
||||
//! presentation layer (ARCHITECTURE §3.2).
|
||||
|
||||
use crate::ids::{AgentId, ProjectId, SessionId, TemplateId};
|
||||
use crate::template::TemplateVersion;
|
||||
|
||||
/// Events emitted by the domain/application as state changes occur.
|
||||
///
|
||||
/// Deliberately *not* `Serialize`/`Deserialize`: events are an in-process
|
||||
/// concern relayed to IPC by an infrastructure adapter, which owns the wire
|
||||
/// format. `PtyOutput` in particular is usually short-circuited to a Tauri
|
||||
/// channel rather than serialised here.
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub enum DomainEvent {
|
||||
/// A project was created.
|
||||
ProjectCreated {
|
||||
/// The new project.
|
||||
project_id: ProjectId,
|
||||
},
|
||||
/// An agent was launched in a terminal.
|
||||
AgentLaunched {
|
||||
/// The agent.
|
||||
agent_id: AgentId,
|
||||
/// The session it runs in.
|
||||
session_id: SessionId,
|
||||
},
|
||||
/// An agent's process exited.
|
||||
AgentExited {
|
||||
/// The agent.
|
||||
agent_id: AgentId,
|
||||
/// Exit code.
|
||||
code: i32,
|
||||
},
|
||||
/// A template was updated (content changed, version bumped).
|
||||
TemplateUpdated {
|
||||
/// The template.
|
||||
template_id: TemplateId,
|
||||
/// New version.
|
||||
version: TemplateVersion,
|
||||
},
|
||||
/// A synchronized agent is behind its template.
|
||||
AgentDriftDetected {
|
||||
/// The drifting agent.
|
||||
agent_id: AgentId,
|
||||
/// Version the agent is currently at.
|
||||
from: TemplateVersion,
|
||||
/// Version available from the template.
|
||||
to: TemplateVersion,
|
||||
},
|
||||
/// A synchronized agent received its template update.
|
||||
AgentSynced {
|
||||
/// The agent.
|
||||
agent_id: AgentId,
|
||||
/// Version it was brought up to.
|
||||
to: TemplateVersion,
|
||||
},
|
||||
/// A tab's layout changed.
|
||||
LayoutChanged {
|
||||
/// The project whose layout changed.
|
||||
project_id: ProjectId,
|
||||
},
|
||||
/// A remote host connection was established.
|
||||
RemoteConnected {
|
||||
/// The project on that remote.
|
||||
project_id: ProjectId,
|
||||
},
|
||||
/// Git state for a project changed.
|
||||
GitStateChanged {
|
||||
/// The project.
|
||||
project_id: ProjectId,
|
||||
},
|
||||
/// Raw PTY output (usually routed to a dedicated channel, not this bus).
|
||||
PtyOutput {
|
||||
/// The session.
|
||||
session_id: SessionId,
|
||||
/// Output bytes.
|
||||
bytes: Vec<u8>,
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user