feat(backend,frontend): lot utilisateur #310 #311 #312 #313 — horodatage conversation, stop agent robuste, préférence terminal par défaut, paramètres projet (QA verte)
- #310: horodatage de tous les messages et événements de conversation visibles — composant partagé EntryTimestamp, timestamps propagés dans le transcript chat, les annonces inter-agent et le viewer de conversation, normalisation côté domain/adapters (conversation_log, paginate). - #311: stop d'agent robuste pour PTY non monté, sessions headless et CLI custom — lifecycle/orchestrator durcis, ponts chat app-tauri/web-server alignés, arrêt fiable sans session orpheline. - #312: préférence globale d'interface terminal par défaut — nouveau store settings (domain/application/infrastructure + tests), DTO et commandes backend, adapter frontend userSettings, panneau TerminalSettings dans les paramètres globaux. - #313: Paramètres du projet — contexte de projet éditable et couleur de thème par projet (ProjectSettingsPanel + projectTheme), teinte des onglets projet, persistance via DTO projet. QA verte (GO QA sur feature/batch-310-311-312-313-chat-stop-prefs-theme) — vérifications Git: git diff --cached --check OK; staging borné à crates/ et frontend/ (74 fichiers, +2105/-531), commit unique de lot conforme à la convention des lots (précédents batch-151/158/159, batch-210/211/212) car les fichiers partagés (dto.rs, commands.rs, CustomAgentChatView) entrelacent les 4 tickets. fichiers .ideai/* (agents/test.md, chat-drafts.json, system-permissions.json, tickets/counter.json, tickets/index.json, tickets/308-313/), attachments/ et scripts/ hors périmètre et préservés en worktree ; aucun push. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@ -3252,6 +3252,59 @@ pub struct UpdateProjectContextRequestDto {
|
||||
pub content: String,
|
||||
}
|
||||
|
||||
/// Global machine-local user settings wire contract.
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct UserSettingsDto {
|
||||
/// Default interface for newly opened agent terminals.
|
||||
#[serde(default)]
|
||||
pub default_agent_terminal_interface: Option<domain::DefaultAgentTerminalInterface>,
|
||||
}
|
||||
|
||||
impl From<domain::IdeaUserSettings> for UserSettingsDto {
|
||||
fn from(value: domain::IdeaUserSettings) -> Self {
|
||||
Self {
|
||||
default_agent_terminal_interface: value.default_agent_terminal_interface,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<UserSettingsDto> for domain::IdeaUserSettings {
|
||||
fn from(value: UserSettingsDto) -> Self {
|
||||
Self {
|
||||
default_agent_terminal_interface: value.default_agent_terminal_interface,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Project-owned settings wire contract.
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct ProjectSettingsDto {
|
||||
/// Optional validated project theme colour.
|
||||
#[serde(default)]
|
||||
pub theme_color: Option<String>,
|
||||
}
|
||||
|
||||
impl From<domain::ProjectSettings> for ProjectSettingsDto {
|
||||
fn from(value: domain::ProjectSettings) -> Self {
|
||||
Self {
|
||||
theme_color: value.theme_color.map(|color| color.as_str().to_owned()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Project settings update request.
|
||||
#[derive(Debug, Clone, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct UpdateProjectSettingsRequestDto {
|
||||
/// Project registry id.
|
||||
pub project_id: String,
|
||||
/// New colour, or null to restore the product default.
|
||||
#[serde(default)]
|
||||
pub theme_color: Option<String>,
|
||||
}
|
||||
|
||||
/// Request DTO for `launch_agent`.
|
||||
#[derive(Debug, Clone, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
@ -3747,6 +3800,9 @@ impl From<ReplyProgressStage> for ReplyProgressStageDto {
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct ReplyProgressDto {
|
||||
/// Time at which the backend accepted this visible event.
|
||||
#[serde(default)]
|
||||
pub occurred_at_ms: Option<u64>,
|
||||
/// Optional stable progress entity id for frontend upsert.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub progress_id: Option<String>,
|
||||
@ -3775,6 +3831,7 @@ pub struct ReplyProgressDto {
|
||||
impl From<ReplyProgress> for ReplyProgressDto {
|
||||
fn from(value: ReplyProgress) -> Self {
|
||||
Self {
|
||||
occurred_at_ms: None,
|
||||
progress_id: value.progress_id,
|
||||
source: value.source.into(),
|
||||
kind: value.kind.into(),
|
||||
@ -3804,6 +3861,9 @@ pub enum ReplyChunk {
|
||||
/// The user's submitted prompt, retained in live scrollback for reattach.
|
||||
#[serde(rename_all = "camelCase")]
|
||||
UserPrompt {
|
||||
/// Time at which the backend accepted this prompt.
|
||||
#[serde(default)]
|
||||
at_ms: Option<u64>,
|
||||
/// Submitted prompt text.
|
||||
text: String,
|
||||
/// Display labels for attachments submitted with the prompt.
|
||||
@ -3816,12 +3876,18 @@ pub enum ReplyChunk {
|
||||
/// An assistant text fragment (incremental chat rendering).
|
||||
#[serde(rename_all = "camelCase")]
|
||||
TextDelta {
|
||||
/// Time at which the backend accepted this fragment.
|
||||
#[serde(default)]
|
||||
at_ms: Option<u64>,
|
||||
/// The text fragment.
|
||||
text: String,
|
||||
},
|
||||
/// A human-readable tool-activity badge (best-effort observability).
|
||||
#[serde(rename_all = "camelCase")]
|
||||
ToolActivity {
|
||||
/// Time at which the backend accepted this activity.
|
||||
#[serde(default)]
|
||||
at_ms: Option<u64>,
|
||||
/// The human-readable activity label.
|
||||
label: String,
|
||||
},
|
||||
@ -3834,12 +3900,18 @@ pub enum ReplyChunk {
|
||||
/// The deterministic end-of-turn chunk carrying the aggregated final content.
|
||||
#[serde(rename_all = "camelCase")]
|
||||
Final {
|
||||
/// Time at which the backend accepted the terminal response.
|
||||
#[serde(default)]
|
||||
at_ms: Option<u64>,
|
||||
/// The aggregated final content of the turn.
|
||||
content: String,
|
||||
},
|
||||
/// A visible terminal fallback when the model stream produced no usable answer.
|
||||
#[serde(rename_all = "camelCase")]
|
||||
Error {
|
||||
/// Time at which the backend accepted the terminal error.
|
||||
#[serde(default)]
|
||||
at_ms: Option<u64>,
|
||||
/// Human-readable explanation to render in the chat cell.
|
||||
message: String,
|
||||
},
|
||||
@ -4210,7 +4282,7 @@ pub struct ConversationTurnWorkPreviewDto {
|
||||
/// Origin of the turn (human operator or a delegating agent).
|
||||
pub source: TicketWorkSourceDto,
|
||||
/// Timestamp (epoch milliseconds) of the turn.
|
||||
pub at_ms: u64,
|
||||
pub at_ms: Option<u64>,
|
||||
/// Bounded excerpt of the turn text.
|
||||
pub text_preview: String,
|
||||
/// Character length of the original (un-truncated) turn text.
|
||||
@ -4469,6 +4541,9 @@ pub struct StopLiveAgentRequestDto {
|
||||
pub project_id: String,
|
||||
/// Id of the running agent to stop.
|
||||
pub agent_id: String,
|
||||
/// Optional human-readable reason for the stop.
|
||||
#[serde(default)]
|
||||
pub reason: Option<String>,
|
||||
}
|
||||
|
||||
/// Response DTO for `stop_live_agent`: the torn-down session's coordinates.
|
||||
@ -4477,11 +4552,23 @@ pub struct StopLiveAgentRequestDto {
|
||||
pub struct StopLiveAgentResponseDto {
|
||||
/// The stopped agent's id.
|
||||
pub agent_id: String,
|
||||
/// The id of the session that was torn down.
|
||||
/// Every runtime actually torn down by this request.
|
||||
pub stopped: Vec<StoppedAgentRuntimeDto>,
|
||||
/// True when the operation was an idempotent no-op.
|
||||
pub already_stopped: bool,
|
||||
}
|
||||
|
||||
/// One stopped runtime in an agent-level stop response.
|
||||
#[derive(Debug, Clone, Serialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct StoppedAgentRuntimeDto {
|
||||
/// Removed runtime session id.
|
||||
pub session_id: String,
|
||||
/// Runtime family that owned the session (`pty`/`structured`).
|
||||
/// Last hosting layout node id.
|
||||
pub node_id: String,
|
||||
/// Runtime family.
|
||||
pub kind: LiveWorkSessionKindDto,
|
||||
/// Runtime lifecycle projection after the stop request.
|
||||
/// Terminal lifecycle state.
|
||||
pub runtime_state: LiveRuntimeStateDto,
|
||||
}
|
||||
|
||||
@ -4489,9 +4576,17 @@ impl From<StopLiveAgentOutput> for StopLiveAgentResponseDto {
|
||||
fn from(out: StopLiveAgentOutput) -> Self {
|
||||
Self {
|
||||
agent_id: out.agent_id.to_string(),
|
||||
session_id: out.session_id.to_string(),
|
||||
kind: out.kind.into(),
|
||||
runtime_state: out.runtime_state.into(),
|
||||
stopped: out
|
||||
.stopped
|
||||
.into_iter()
|
||||
.map(|item| StoppedAgentRuntimeDto {
|
||||
session_id: item.session_id.to_string(),
|
||||
node_id: item.node_id.to_string(),
|
||||
kind: item.kind.into(),
|
||||
runtime_state: item.state.into(),
|
||||
})
|
||||
.collect(),
|
||||
already_stopped: out.already_stopped,
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -5552,7 +5647,7 @@ pub struct TurnViewDto {
|
||||
/// Stable turn id (also the pagination anchor).
|
||||
pub id: String,
|
||||
/// Timestamp (epoch milliseconds).
|
||||
pub at_ms: u64,
|
||||
pub at_ms: Option<u64>,
|
||||
/// Turn nature (prompt, response, tool activity).
|
||||
pub role: TurnRole,
|
||||
/// Origin (human or delegating agent).
|
||||
|
||||
Reference in New Issue
Block a user