feat(wave): #119/#122/#131/#132 verts + sprint plugins ESM/persistance #135/#136/#139
État d'intégration confiné à la branche batch. Les tickets #119 (skills → capacités agent découvrables), #122 (override permissions par défaut), #131 (effort par agent/presets) et #132 (outil MCP d'édition du contexte projet) sont verts en périmètre. Le sprint plugins multi-fichiers ESM / persistance plugin-owned (#135/#136/#139) est co-implémenté dans les MÊMES fichiers de câblage (frontend/src/ports/index.ts, backend/src/lib.rs, domain/ports.rs, backend/dto.rs), inséparable sans staging interactif (indisponible ici). Commit unique volontaire : préserve l'état vert QA sans découpe hunk risquée. NON mergé vers develop tant que #137 (QA e2e plugins) n'est pas vert. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@ -5,7 +5,7 @@
|
||||
use app_tauri_lib::dto::{
|
||||
parse_agent_id, AgentDto, AgentListDto, ConversationDetailsDto, CreateAgentRequestDto,
|
||||
InspectConversationRequestDto, LaunchAgentRequestDto, LiveAgentListDto, TerminalSessionDto,
|
||||
UpdateAgentContextRequestDto,
|
||||
UpdateAgentContextRequestDto, UpdateAgentEffortRequestDto,
|
||||
};
|
||||
use application::AppError;
|
||||
use application::{
|
||||
@ -17,7 +17,7 @@ use application::{
|
||||
use domain::ids::{AgentId, NodeId, ProfileId, SessionId};
|
||||
use domain::ports::ConversationDetails;
|
||||
use domain::terminal::{PtySize, SessionKind, SessionStatus, TerminalSession};
|
||||
use domain::{Agent, AgentOrigin, ProjectPath, SkillKind};
|
||||
use domain::{Agent, AgentOrigin, EffortSelection, ProjectPath, SkillKind};
|
||||
use serde_json::json;
|
||||
use uuid::Uuid;
|
||||
|
||||
@ -60,6 +60,15 @@ fn agent_dto_serialises_camelcase() {
|
||||
assert!(v.get("profile_id").is_none());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn agent_dto_serialises_effort_tagged_shape_when_present() {
|
||||
let agent = make_agent(1, 2).with_effort(Some(EffortSelection::Preset("medium".to_owned())));
|
||||
let dto = AgentDto::from_agent(agent);
|
||||
let v = serde_json::to_value(&dto).unwrap();
|
||||
|
||||
assert_eq!(v["effort"], json!({"kind":"preset","value":"medium"}));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn agent_list_dto_is_transparent_array() {
|
||||
let first = make_agent(1, 2);
|
||||
@ -73,6 +82,7 @@ fn agent_list_dto_is_transparent_array() {
|
||||
kind: SkillKind::Reference,
|
||||
}],
|
||||
}],
|
||||
effective_orchestrator: Some(first.id),
|
||||
};
|
||||
let dto = AgentListDto::from(out);
|
||||
let v = serde_json::to_value(&dto).unwrap();
|
||||
@ -82,7 +92,9 @@ fn agent_list_dto_is_transparent_array() {
|
||||
assert_eq!(arr[0]["capabilities"][0]["name"], "review");
|
||||
assert_eq!(arr[0]["capabilities"][0]["description"], "Reviews changes");
|
||||
assert_eq!(arr[0]["capabilities"][0]["kind"], "reference");
|
||||
assert_eq!(arr[0]["isOrchestrator"], true);
|
||||
assert_eq!(arr[1]["capabilities"], json!([]));
|
||||
assert_eq!(arr[1]["isOrchestrator"], false);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -139,6 +151,28 @@ fn update_agent_context_request_deserialises_camelcase() {
|
||||
assert_eq!(dto.content, "# Updated");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn update_agent_effort_request_deserialises_and_null_clears() {
|
||||
let raw = json!({
|
||||
"projectId": Uuid::from_u128(1).to_string(),
|
||||
"agentId": Uuid::from_u128(2).to_string(),
|
||||
"effort": {"kind": "custom", "value": "x-deep"}
|
||||
});
|
||||
let dto: UpdateAgentEffortRequestDto = serde_json::from_value(raw).unwrap();
|
||||
assert_eq!(
|
||||
dto.effort,
|
||||
Some(EffortSelection::Custom("x-deep".to_owned()))
|
||||
);
|
||||
|
||||
let clear: UpdateAgentEffortRequestDto = serde_json::from_value(json!({
|
||||
"projectId": Uuid::from_u128(1).to_string(),
|
||||
"agentId": Uuid::from_u128(2).to_string(),
|
||||
"effort": null
|
||||
}))
|
||||
.unwrap();
|
||||
assert_eq!(clear.effort, None);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn launch_agent_request_deserialises_camelcase() {
|
||||
let project_id = Uuid::from_u128(1).to_string();
|
||||
|
||||
Reference in New Issue
Block a user