Implement AI workspace and mitigation workflow

This commit is contained in:
2026-02-15 04:27:28 +00:00
parent de2b9a9bbb
commit 2d3b8fdac6
64 changed files with 7669 additions and 769 deletions

View File

@@ -21,7 +21,21 @@ from django.urls import include, path
from django.views.generic import TemplateView
from two_factor.urls import urlpatterns as tf_urls
from core.views import base, notifications, signal, people, ais, groups, personas, manipulations, identifiers, sessions, messages, queues
from core.views import (
ais,
base,
groups,
identifiers,
manipulations,
messages,
notifications,
people,
personas,
queues,
sessions,
signal,
workspace,
)
urlpatterns = [
path("__debug__/", include("debug_toolbar.urls")),
@@ -68,6 +82,86 @@ urlpatterns = [
name="signal_account_add",
),
# AIs
path(
"ai/workspace/",
workspace.AIWorkspace.as_view(),
name="ai_workspace",
),
path(
"ai/workspace/<str:type>/contacts/",
workspace.AIWorkspaceContactsWidget.as_view(),
name="ai_workspace_contacts",
),
path(
"ai/workspace/<str:type>/person/<uuid:person_id>/",
workspace.AIWorkspacePersonWidget.as_view(),
name="ai_workspace_person",
),
path(
"ai/workspace/<str:type>/person/<uuid:person_id>/run/<str:operation>/",
workspace.AIWorkspaceRunOperation.as_view(),
name="ai_workspace_run",
),
path(
"ai/workspace/<str:type>/person/<uuid:person_id>/send/",
workspace.AIWorkspaceSendDraft.as_view(),
name="ai_workspace_send",
),
path(
"ai/workspace/<str:type>/person/<uuid:person_id>/queue/",
workspace.AIWorkspaceQueueDraft.as_view(),
name="ai_workspace_queue",
),
path(
"ai/workspace/<str:type>/person/<uuid:person_id>/mitigation/create/",
workspace.AIWorkspaceCreateMitigation.as_view(),
name="ai_workspace_mitigation_create",
),
path(
"ai/workspace/<str:type>/person/<uuid:person_id>/mitigation/<uuid:plan_id>/chat/",
workspace.AIWorkspaceMitigationChat.as_view(),
name="ai_workspace_mitigation_chat",
),
path(
"ai/workspace/<str:type>/person/<uuid:person_id>/mitigation/<uuid:plan_id>/export/",
workspace.AIWorkspaceExportArtifact.as_view(),
name="ai_workspace_mitigation_export",
),
path(
"ai/workspace/<str:type>/person/<uuid:person_id>/mitigation/<uuid:plan_id>/artifact/create/<str:kind>/",
workspace.AIWorkspaceCreateArtifact.as_view(),
name="ai_workspace_mitigation_artifact_create",
),
path(
"ai/workspace/<str:type>/person/<uuid:person_id>/mitigation/<uuid:plan_id>/artifact/<str:kind>/<uuid:artifact_id>/save/",
workspace.AIWorkspaceUpdateArtifact.as_view(),
name="ai_workspace_mitigation_artifact_save",
),
path(
"ai/workspace/<str:type>/person/<uuid:person_id>/mitigation/<uuid:plan_id>/artifact/<str:kind>/<uuid:artifact_id>/delete/",
workspace.AIWorkspaceDeleteArtifact.as_view(),
name="ai_workspace_mitigation_artifact_delete",
),
path(
"ai/workspace/<str:type>/person/<uuid:person_id>/mitigation/<uuid:plan_id>/artifact/<str:kind>/delete-all/",
workspace.AIWorkspaceDeleteArtifactList.as_view(),
name="ai_workspace_mitigation_artifact_delete_all",
),
path(
"ai/workspace/<str:type>/person/<uuid:person_id>/mitigation/<uuid:plan_id>/engage/share/",
workspace.AIWorkspaceEngageShare.as_view(),
name="ai_workspace_mitigation_engage_share",
),
path(
"ai/workspace/<str:type>/person/<uuid:person_id>/mitigation/<uuid:plan_id>/auto/",
workspace.AIWorkspaceAutoSettings.as_view(),
name="ai_workspace_mitigation_auto",
),
path(
"ai/workspace/<str:type>/person/<uuid:person_id>/mitigation/<uuid:plan_id>/fundamentals/save/",
workspace.AIWorkspaceUpdateFundamentals.as_view(),
name="ai_workspace_mitigation_fundamentals_save",
),
path(
"ai/<str:type>/",
ais.AIList.as_view(),
@@ -88,7 +182,6 @@ urlpatterns = [
ais.AIDelete.as_view(),
name="ai_delete",
),
# People
path(
"person/<str:type>/",
@@ -110,7 +203,6 @@ urlpatterns = [
people.PersonDelete.as_view(),
name="person_delete",
),
# Groups
path(
"group/<str:type>/",
@@ -132,7 +224,6 @@ urlpatterns = [
groups.GroupDelete.as_view(),
name="group_delete",
),
# Personas
path(
"persona/<str:type>/",
@@ -154,7 +245,6 @@ urlpatterns = [
personas.PersonaDelete.as_view(),
name="persona_delete",
),
# Manipulations
path(
"manipulation/<str:type>/",
@@ -198,19 +288,59 @@ urlpatterns = [
name="session_delete",
),
# Identifiers
path("person/<str:type>/identifiers/<str:person>/", identifiers.PersonIdentifierList.as_view(), name="person_identifiers"),
path("person/<str:type>/identifiers/create/<str:person>", identifiers.PersonIdentifierCreate.as_view(), name="person_identifier_create"),
path("person/<str:type>/identifiers/update/<str:person>/<str:pk>/", identifiers.PersonIdentifierUpdate.as_view(), name="person_identifier_update"),
path("person/<str:type>/identifiers/delete/<str:person>/<str:pk>/", identifiers.PersonIdentifierDelete.as_view(), name="person_identifier_delete"),
path(
"person/<str:type>/identifiers/<str:person>/",
identifiers.PersonIdentifierList.as_view(),
name="person_identifiers",
),
path(
"person/<str:type>/identifiers/create/<str:person>",
identifiers.PersonIdentifierCreate.as_view(),
name="person_identifier_create",
),
path(
"person/<str:type>/identifiers/update/<str:person>/<str:pk>/",
identifiers.PersonIdentifierUpdate.as_view(),
name="person_identifier_update",
),
path(
"person/<str:type>/identifiers/delete/<str:person>/<str:pk>/",
identifiers.PersonIdentifierDelete.as_view(),
name="person_identifier_delete",
),
# Messages
path("session/<str:type>/messages/<str:session>/", messages.MessageList.as_view(), name="messages"),
path("session/<str:type>/messages/create/<str:session>", messages.MessageCreate.as_view(), name="message_create"),
path("session/<str:type>/messages/update/<str:session>/<str:pk>/", messages.MessageUpdate.as_view(), name="message_update"),
path("session/<str:type>/messages/delete/<str:session>/<str:pk>/", messages.MessageDelete.as_view(), name="message_delete"),
path(
"session/<str:type>/messages/<str:session>/",
messages.MessageList.as_view(),
name="messages",
),
path(
"session/<str:type>/messages/create/<str:session>",
messages.MessageCreate.as_view(),
name="message_create",
),
path(
"session/<str:type>/messages/update/<str:session>/<str:pk>/",
messages.MessageUpdate.as_view(),
name="message_update",
),
path(
"session/<str:type>/messages/delete/<str:session>/<str:pk>/",
messages.MessageDelete.as_view(),
name="message_delete",
),
# API
# Queues
path("api/v1/queue/message/accept/<str:message_id>/", queues.AcceptMessageAPI.as_view(), name="message_accept_api"),
path("api/v1/queue/message/reject/<str:message_id>/", queues.RejectMessageAPI.as_view(), name="message_reject_api"),
path(
"api/v1/queue/message/accept/<str:message_id>/",
queues.AcceptMessageAPI.as_view(),
name="message_accept_api",
),
path(
"api/v1/queue/message/reject/<str:message_id>/",
queues.RejectMessageAPI.as_view(),
name="message_reject_api",
),
path(
"queue/<str:type>/",
queues.QueueList.as_view(),