feat(portal): add executive action center

This commit is contained in:
igor04091968
2026-06-07 16:39:49 +03:00
parent 307170b128
commit 2b41fb14c7
11 changed files with 1069 additions and 3 deletions
@@ -39,6 +39,9 @@
{
"name": "risk"
},
{
"name": "actions"
},
{
"name": "pfsense"
},
@@ -891,6 +894,42 @@
}
}
}
},
"/actions": {
"get": {
"tags": [
"actions"
],
"summary": "Rule-based executive action center",
"parameters": [
{
"name": "role",
"in": "query",
"required": false,
"schema": {
"$ref": "#/components/schemas/PortalRole"
}
}
],
"responses": {
"200": {
"description": "Recommended actions payload",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ActionCenterResponse"
}
}
}
},
"400": {
"description": "Query limits rejected"
},
"403": {
"description": "Role denied"
}
}
}
}
},
"components": {
@@ -1024,6 +1063,12 @@
"risk_narrative": {
"$ref": "#/components/schemas/RiskNarrative"
},
"recommended_actions": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ActionItem"
}
},
"agent_quality": {
"$ref": "#/components/schemas/JsonObject"
},
@@ -1054,6 +1099,96 @@
},
"additionalProperties": true
},
"ActionItem": {
"type": "object",
"required": [
"priority",
"title",
"summary",
"owner_role",
"recommended_deadline",
"reason_codes",
"evidence"
],
"properties": {
"priority": {
"type": "string",
"enum": [
"low",
"medium",
"high",
"critical"
]
},
"title": {
"type": "string"
},
"summary": {
"type": "string"
},
"owner_role": {
"type": "string",
"enum": [
"executive",
"manager",
"security",
"forensics",
"admin"
]
},
"recommended_deadline": {
"type": "string"
},
"reason_codes": {
"type": "array",
"items": {
"type": "string"
}
},
"evidence": {
"type": "array",
"items": {
"type": "string"
}
}
},
"additionalProperties": true
},
"ActionCenterResponse": {
"type": "object",
"required": [
"ok",
"actions",
"model"
],
"properties": {
"ok": {
"type": "boolean"
},
"role_context": {
"$ref": "#/components/schemas/RoleContext"
},
"actions": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ActionItem"
}
},
"model": {
"$ref": "#/components/schemas/JsonObject"
},
"generated_at_utc": {
"type": "string"
},
"limitations": {
"type": "array",
"items": {
"type": "string"
}
}
},
"additionalProperties": true
},
"RiskNarrativeEvidence": {
"type": "object",
"required": [
@@ -87,6 +87,30 @@ export interface RiskNarrative {
[key: string]: unknown;
}
export type ActionPriority = "low" | "medium" | "high" | "critical";
export type ActionOwnerRole = "executive" | "manager" | "security" | "forensics" | "admin";
export interface ActionItem {
priority: ActionPriority | string;
title: string;
summary: string;
owner_role: ActionOwnerRole | string;
recommended_deadline: string;
reason_codes: string[];
evidence: string[];
[key: string]: unknown;
}
export interface ActionCenterResponse {
ok: boolean;
role_context?: RoleContext;
actions: ActionItem[];
model?: JsonObject;
generated_at_utc?: ISODateTime;
limitations?: string[];
[key: string]: unknown;
}
export interface AgentQuality {
collector_source?: string;
collector_error?: string | null;
@@ -218,6 +242,7 @@ export interface ReportsResponse {
executive_points?: string[];
executive_dashboard?: ExecutiveDashboard;
risk_narrative?: RiskNarrative;
recommended_actions?: ActionItem[];
agent_quality?: AgentQuality;
agent_coverage_sla?: AgentCoverageSla;
business_risk?: BusinessRiskItem[];
@@ -303,6 +328,7 @@ export interface DetMirPortalApi {
module?: string;
role?: PortalRole;
}): Promise<RiskNarrative>;
getActions(options?: { role?: PortalRole }): Promise<ActionCenterResponse>;
getPfsense(options?: { role?: PortalRole }): Promise<PfsenseReadinessResponse>;
getIncidents(): Promise<JsonObject>;
getCases(): Promise<CaseListResponse>;