summaryrefslogtreecommitdiff
path: root/makima/src/daemon/api
diff options
context:
space:
mode:
authorsoryu <soryu@soryu.co>2026-01-27 03:02:19 +0000
committersoryu <soryu@soryu.co>2026-01-27 03:02:19 +0000
commitf04094966956bc2534b2bab6ee3637c6566daab8 (patch)
tree6a8baf805417b6c272edbc21494e91f70ef37d41 /makima/src/daemon/api
parent55fb3aaf157f40fe652309ef18016edc7ace6c59 (diff)
downloadsoryu-f04094966956bc2534b2bab6ee3637c6566daab8.tar.gz
soryu-f04094966956bc2534b2bab6ee3637c6566daab8.zip
Add Red Team CLI command and frontend UI
Backend additions: - Add `makima red-team notify` CLI command for red team tasks - Add RedTeamCommand enum with Notify subcommand - Add red_team API client module for notify endpoint - Add RedTeamNotifyArgs with severity, task, file, context options Frontend additions: - Add ContractCreateModal with red team toggle and prompt input - Update ContractDetail with red-team tab for notifications - Update ContractList with red team enabled badge - Add TypeScript types for RedTeamNotification and related interfaces Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Diffstat (limited to 'makima/src/daemon/api')
-rw-r--r--makima/src/daemon/api/mod.rs2
-rw-r--r--makima/src/daemon/api/red_team.rs39
2 files changed, 41 insertions, 0 deletions
diff --git a/makima/src/daemon/api/mod.rs b/makima/src/daemon/api/mod.rs
index 49d80e0..92e34e9 100644
--- a/makima/src/daemon/api/mod.rs
+++ b/makima/src/daemon/api/mod.rs
@@ -2,7 +2,9 @@
pub mod client;
pub mod contract;
+pub mod red_team;
pub mod supervisor;
pub use client::ApiClient;
pub use contract::CreateContractRequest;
+pub use red_team::RedTeamNotifyRequest;
diff --git a/makima/src/daemon/api/red_team.rs b/makima/src/daemon/api/red_team.rs
new file mode 100644
index 0000000..6d3c969
--- /dev/null
+++ b/makima/src/daemon/api/red_team.rs
@@ -0,0 +1,39 @@
+//! Red team API methods.
+
+use serde::Serialize;
+use uuid::Uuid;
+
+use super::client::{ApiClient, ApiError};
+use super::supervisor::JsonValue;
+
+/// Request body for red team notify endpoint.
+#[derive(Serialize)]
+#[serde(rename_all = "camelCase")]
+pub struct RedTeamNotifyRequest {
+ /// The issue message
+ pub message: String,
+
+ /// Severity level: low, medium, high, critical
+ pub severity: String,
+
+ /// The specific task this relates to (optional)
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub related_task_id: Option<Uuid>,
+
+ /// The file path where the issue was detected (optional)
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub file_path: Option<String>,
+
+ /// Additional context about the issue (optional)
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub context: Option<String>,
+}
+
+impl ApiClient {
+ /// Send a red team notification about an issue found during adversarial review.
+ ///
+ /// POST /api/v1/mesh/red-team/notify
+ pub async fn red_team_notify(&self, req: RedTeamNotifyRequest) -> Result<JsonValue, ApiError> {
+ self.post("/api/v1/mesh/red-team/notify", &req).await
+ }
+}