Pivot orchestration : agents IA pilotés via leur mode programmatique/JSON
(capture déterministe), au lieu du TUI brut + self-report. §16 (idea/MCP)
marquée remplacée comme voie principale.
- D0 (domaine) : port AgentSession + AgentSessionFactory, types ReplyEvent
/ReplyStream/AgentSessionError, champ AgentProfile.structured_adapter
(Option<StructuredAdapter{Claude,Codex}>, skip si None ⇒ zéro régression),
catalogue Claude/Codex annotés.
- D1 (application) : registre StructuredSessions (jumeau de TerminalSessions),
agrégateur LiveSessions{pty,structured} derrière LiveAgentRegistry (vivant si
PTY OU structuré, surface du trait inchangée), helper send_blocking (draine le
ReplyStream jusqu'au Final, Timeout sans tuer la session).
Tests : domaine 16+2 ; application registre 11 + send_blocking 9 ; workspace 0 échec.
A/B intacts. Aucun adapter concret (D2), pas de Tauri/front.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
102 lines
5.3 KiB
Rust
102 lines
5.3 KiB
Rust
//! # IdeA — Application layer
|
|
//!
|
|
//! Orchestrates **use cases** by talking **only to the domain ports** (traits),
|
|
//! never to concrete adapters (ARCHITECTURE §1.1, §6). Every use case is a
|
|
//! struct carrying its ports as `Arc<dyn Port>` and exposing
|
|
//! `execute(input) -> Result<output, AppError>`.
|
|
//!
|
|
//! This crate depends on `domain` only. The composition root (`app-tauri`) is
|
|
//! the single place that constructs concrete adapters and injects them here.
|
|
|
|
#![forbid(unsafe_code)]
|
|
#![warn(missing_docs)]
|
|
|
|
pub mod agent;
|
|
pub mod embedder;
|
|
pub mod error;
|
|
pub mod git;
|
|
pub mod health;
|
|
pub mod layout;
|
|
pub mod memory;
|
|
pub mod orchestrator;
|
|
pub mod project;
|
|
pub mod remote;
|
|
pub mod skill;
|
|
pub mod template;
|
|
pub mod terminal;
|
|
pub mod window;
|
|
|
|
pub use agent::{
|
|
reference_profile_id, reference_profiles, ChangeAgentProfile, ChangeAgentProfileInput,
|
|
ChangeAgentProfileOutput, ConfigureProfiles, ConfigureProfilesInput,
|
|
ConfigureProfilesOutput, CreateAgentFromScratch, CreateAgentInput, CreateAgentOutput,
|
|
DeleteAgent, DeleteAgentInput, DeleteProfile, DeleteProfileInput, DetectProfiles,
|
|
DetectProfilesInput, DetectProfilesOutput, FirstRunState, FirstRunStateOutput,
|
|
InspectConversation, InspectConversationInput, InspectConversationOutput, LaunchAgent,
|
|
LaunchAgentInput, LaunchAgentOutput, ListAgents, ListAgentsInput, ListAgentsOutput,
|
|
ListProfiles, ListProfilesOutput, ListResumableAgents, ListResumableAgentsInput,
|
|
ListResumableAgentsOutput, ProfileAvailability, ReadAgentContext, ReadAgentContextInput,
|
|
ReadAgentContextOutput, ReferenceProfiles, ReferenceProfilesOutput, ResumableAgent, SaveProfile,
|
|
SaveProfileInput, SaveProfileOutput, UpdateAgentContext, UpdateAgentContextInput,
|
|
send_blocking, AGENT_MEMORY_RECALL_BUDGET,
|
|
};
|
|
pub use embedder::{
|
|
CheckEmbedderSuggestion, CheckEmbedderSuggestionInput, CheckEmbedderSuggestionOutput,
|
|
DeleteEmbedderProfile, DeleteEmbedderProfileInput, DescribeEmbedderEngines, DismissChoice,
|
|
DismissEmbedderSuggestion, DismissEmbedderSuggestionInput, EmbedderEnginesView,
|
|
ListEmbedderProfiles, ListEmbedderProfilesOutput, OnnxModelView, SaveEmbedderProfile,
|
|
SaveEmbedderProfileInput, SaveEmbedderProfileOutput, SuggestedThisSession,
|
|
};
|
|
pub use error::AppError;
|
|
pub use git::{
|
|
GitBranches, GitBranchesInput, GitBranchesOutput, GitCheckout, GitCheckoutInput, GitCommit,
|
|
GitCommitInput, GitCommitOutput, GitGraph, GitGraphInput, GitGraphOutput, GitInit,
|
|
GitInitInput, GitLog, GitLogInput, GitLogOutput, GitStage, GitStagePathInput, GitStatus,
|
|
GitStatusInput, GitStatusOutput, GitUnstage,
|
|
};
|
|
pub use health::{HealthInput, HealthReport, HealthUseCase};
|
|
pub use layout::{
|
|
CreateLayout, CreateLayoutInput, CreateLayoutOutput, DeleteLayout, DeleteLayoutInput,
|
|
DeleteLayoutOutput, LayoutInfo, LayoutKind, LayoutOperation, LayoutsDoc, ListLayouts,
|
|
ListLayoutsInput, ListLayoutsOutput, LoadLayout, LoadLayoutInput, LoadLayoutOutput,
|
|
MutateLayout, MutateLayoutInput, MutateLayoutOutput, NamedLayout, RenameLayout,
|
|
RenameLayoutInput, SetActiveLayout, SetActiveLayoutInput, SnapshotRunningAgents,
|
|
SnapshotRunningAgentsInput, SnapshotRunningAgentsOutput, LAYOUTS_FILE,
|
|
};
|
|
pub use memory::{
|
|
CreateMemory, CreateMemoryInput, CreateMemoryOutput, DeleteMemory, DeleteMemoryInput,
|
|
GetMemory, GetMemoryInput, GetMemoryOutput, ListMemories, ListMemoriesInput,
|
|
ListMemoriesOutput, ReadMemoryIndex, ReadMemoryIndexInput, ReadMemoryIndexOutput, RecallMemory,
|
|
RecallMemoryInput, RecallMemoryOutput, ResolveMemoryLinks, ResolveMemoryLinksInput,
|
|
ResolveMemoryLinksOutput, UpdateMemory, UpdateMemoryInput, UpdateMemoryOutput,
|
|
};
|
|
pub use orchestrator::{OrchestratorOutcome, OrchestratorService};
|
|
pub use project::{
|
|
CloseProject, CloseProjectInput, CloseProjectOutput, CloseTab, CloseTabInput, CreateProject,
|
|
CreateProjectInput, CreateProjectOutput, ListProjects, ListProjectsOutput, OpenProject,
|
|
OpenProjectInput, OpenProjectOutput, ProjectMeta, ReadProjectContext, ReadProjectContextInput,
|
|
ReadProjectContextOutput, UpdateProjectContext, UpdateProjectContextInput,
|
|
PROJECT_CONTEXT_FILE,
|
|
};
|
|
pub use remote::{ConnectRemote, ConnectRemoteInput, ConnectRemoteOutput};
|
|
pub use skill::{
|
|
AssignSkillToAgent, AssignSkillToAgentInput, CreateSkill, CreateSkillInput, CreateSkillOutput,
|
|
DeleteSkill, DeleteSkillInput, ListSkills, ListSkillsInput, ListSkillsOutput,
|
|
UnassignSkillFromAgent, UnassignSkillFromAgentInput, UpdateSkill, UpdateSkillInput,
|
|
UpdateSkillOutput,
|
|
};
|
|
pub use template::{
|
|
AgentDrift, CreateAgentFromTemplate, CreateAgentFromTemplateInput,
|
|
CreateAgentFromTemplateOutput, CreateTemplate, CreateTemplateInput, CreateTemplateOutput,
|
|
DeleteTemplate, DeleteTemplateInput, DetectAgentDrift, DetectAgentDriftInput,
|
|
DetectAgentDriftOutput, ListTemplates, ListTemplatesOutput, SyncAgentWithTemplate,
|
|
SyncAgentWithTemplateInput, SyncAgentWithTemplateOutput, UpdateTemplate, UpdateTemplateInput,
|
|
UpdateTemplateOutput,
|
|
};
|
|
pub use terminal::{
|
|
CloseTerminal, CloseTerminalInput, CloseTerminalOutput, LiveAgentRegistry, LiveSessions,
|
|
OpenTerminal, OpenTerminalInput, OpenTerminalOutput, ResizeTerminal, ResizeTerminalInput,
|
|
StructuredSessions, TerminalSessions, WriteToTerminal, WriteToTerminalInput,
|
|
};
|
|
pub use window::{MoveTabToNewWindow, MoveTabToNewWindowInput, MoveTabToNewWindowOutput};
|