From 264062866cf513c95cf02e5f0bef85889b185452 Mon Sep 17 00:00:00 2001 From: Sam Catlow Date: Fri, 20 Nov 2026 01:04:29 +1100 Subject: [PATCH] feat(ui): run events, workflows, runs, controls and settings pages on the archie binary (#2023) Events (sources, triggers), workflows (list, document, YAML publish, read-only canvas), runs with approvals and the decision trail, controls (policies, guards, action classes), agent models, accepted extensions, secret engines and credentials now read the binary's API. Capabilities name every section, so pages the binary can't back yet (the visual workflow editor, captures, mappings, bindings, the extension catalogue, model aliases and the rest) stay in the tree, hidden. Adds GET /api/credential-kinds for the credentials form. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- api/openapi.yaml | 44 +++ modules/connectors/credentials.go | 21 ++ modules/connectors/module.go | 4 + modules/governance/accounts_api.go | 21 +- ui/src/App.vue | 9 +- .../command-palette/CommandPalette.vue | 11 +- ui/src/controls/ActionClassDetail.vue | 36 +++ ui/src/controls/ControlsPage.vue | 103 +++++++ ui/src/controls/PolicyText.vue | 97 ++++++ ui/src/events/EventDetail.vue | 28 ++ ui/src/events/EventList.vue | 103 +++++++ ui/src/events/EventsPage.vue | 12 +- ui/src/events/SourceList.vue | 148 ++++++++++ ui/src/events/TriggerList.vue | 153 ++++++++++ ui/src/events/tab-selection.ts | 6 + ui/src/events/trigger.ts | 14 + ui/src/lib/api.ts | 276 +++++++++++++++++- ui/src/lib/lines.ts | 14 + ui/src/lib/nav.ts | 5 + ui/src/lib/use-read.ts | 46 +++ ui/src/router/index.ts | 96 ++++-- ui/src/runs/ApprovalsSection.vue | 66 +++++ ui/src/runs/RunPage.vue | 127 ++++++++ ui/src/runs/RunsPage.vue | 75 +++++ ui/src/runs/state.ts | 24 ++ ui/src/settings/AcceptedExtensionsPage.vue | 33 +++ ui/src/settings/AgentModelsPage.vue | 142 +++++++++ ui/src/settings/CredentialsPage.vue | 148 ++++++++++ ui/src/settings/ExtensionList.vue | 183 ++++++++++++ ui/src/stores/secret-engines.ts | 3 +- ui/src/workflows/WorkflowDocumentPage.vue | 129 ++++++++ ui/src/workflows/WorkflowListPage.vue | 126 ++++++++ ui/src/workflows/WorkflowPage.vue | 2 +- ui/src/workflows/WorkflowsPage.vue | 2 +- ui/test/events-tabs.test.ts | 18 +- 35 files changed, 2274 insertions(+), 51 deletions(-) create mode 100644 ui/src/controls/ActionClassDetail.vue create mode 100644 ui/src/controls/ControlsPage.vue create mode 100644 ui/src/controls/PolicyText.vue create mode 100644 ui/src/events/EventDetail.vue create mode 100644 ui/src/events/EventList.vue create mode 100644 ui/src/events/SourceList.vue create mode 100644 ui/src/events/TriggerList.vue create mode 100644 ui/src/events/trigger.ts create mode 100644 ui/src/lib/lines.ts create mode 100644 ui/src/lib/use-read.ts create mode 100644 ui/src/runs/ApprovalsSection.vue create mode 100644 ui/src/runs/RunPage.vue create mode 100644 ui/src/runs/RunsPage.vue create mode 100644 ui/src/runs/state.ts create mode 100644 ui/src/settings/AcceptedExtensionsPage.vue create mode 100644 ui/src/settings/AgentModelsPage.vue create mode 100644 ui/src/settings/CredentialsPage.vue create mode 100644 ui/src/settings/ExtensionList.vue create mode 100644 ui/src/workflows/WorkflowDocumentPage.vue create mode 100644 ui/src/workflows/WorkflowListPage.vue diff --git a/api/openapi.yaml b/api/openapi.yaml index bfa022f38..6a8024e01 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -331,6 +331,27 @@ components: - method - request type: object + ConnectorsCredentialKind: + additionalProperties: false + properties: + kind: + type: string + optional: + items: + type: string + type: + - array + - "null" + required: + items: + type: string + type: + - array + - "null" + required: + - kind + - required + type: object ConnectorsCredentialRequest: additionalProperties: false properties: @@ -3444,6 +3465,29 @@ paths: summary: List each guard's judge, its standing and its eval date tags: - Controls + /api/credential-kinds: + get: + operationId: list-credential-kinds + responses: + "200": + content: + application/json: + schema: + items: + $ref: "#/components/schemas/ConnectorsCredentialKind" + type: + - array + - "null" + description: OK + default: + content: + application/problem+json: + schema: + $ref: "#/components/schemas/ErrorModel" + description: Error + summary: List credential kinds and the fields each takes + tags: + - Credentials /api/credentials: get: operationId: list-credentials diff --git a/modules/connectors/credentials.go b/modules/connectors/credentials.go index e90009a52..6aebdcc5a 100644 --- a/modules/connectors/credentials.go +++ b/modules/connectors/credentials.go @@ -39,6 +39,27 @@ func kindFields(kind string) (required, optional []string, ok bool) { return nil, nil, false } +// credentialKinds is every kind kindFields accepts, in the order a form +// offers them. +var credentialKinds = []string{"bearer", "basic", "machine", "age"} + +type credentialKind struct { + Kind string `json:"kind"` + Required []string `json:"required"` + Optional []string `json:"optional,omitzero"` +} + +// listCredentialKinds serves kindFields, so a form asks for exactly the fields +// a put accepts. +func listCredentialKinds(context.Context, *struct{}) (*httpapi.Reply[[]credentialKind], error) { + kinds := make([]credentialKind, 0, len(credentialKinds)) + for _, kind := range credentialKinds { + required, optional, _ := kindFields(kind) + kinds = append(kinds, credentialKind{Kind: kind, Required: required, Optional: optional}) + } + return httpapi.OK(kinds), nil +} + type credentialRequest struct { Kind string `json:"kind"` Fields map[string]Field `json:"fields"` diff --git a/modules/connectors/module.go b/modules/connectors/module.go index 3e2ccc8a2..29461756b 100644 --- a/modules/connectors/module.go +++ b/modules/connectors/module.go @@ -294,6 +294,10 @@ func (m *Module) Register(api huma.API) { OperationID: "put-credential", Method: http.MethodPut, Path: "/api/credentials/{name}", Summary: "Store a credential sealed and restart what uses it", Tags: tags, }, m.putCredential) + huma.Register(api, huma.Operation{ + OperationID: "list-credential-kinds", Method: http.MethodGet, Path: "/api/credential-kinds", + Summary: "List credential kinds and the fields each takes", Tags: tags, + }, listCredentialKinds) } type acceptRequest struct { diff --git a/modules/governance/accounts_api.go b/modules/governance/accounts_api.go index 7e2aeb305..cf7d7c222 100644 --- a/modules/governance/accounts_api.go +++ b/modules/governance/accounts_api.go @@ -602,16 +602,23 @@ type capabilitiesBody struct { Sections map[string]bool `json:"sections"` } -// capabilities reports the dashboard sections this binary serves. The -// sections below have no backend here yet, so the dashboard hides them; -// settings is the instance area, which only an instance administrator -// operates. +// capabilities reports the dashboard sections this binary serves. Every +// served section's operations need an instance administrator, so each is +// reported as the caller's administrator standing; the dashboard hides the +// rest, whose pages call operations this binary does not have. func (m *Module) capabilities(ctx context.Context, _ *struct{}) (*httpapi.Reply[capabilitiesBody], error) { p, _ := PrincipalFromContext(ctx) - sections := map[string]bool{"settings": p.InstanceAdmin()} + sections := map[string]bool{} for _, name := range []string{ - "chat", "logs", "skills", "curators", "channels", "captures", "mappings", "bindings", "workflows", - "org_members", "org_agents", "org_policies", "org_denials", "org_audit", "org_usage", "org_config", + "settings", "events", "workflows", "runs", "credentials", "extensions", "secret_engines", "models", "controls", + } { + sections[name] = p.InstanceAdmin() + } + for _, name := range []string{ + "home", "tasks", "work_requests", "chat", "logs", "skills", "curators", "channels", + "captures", "mappings", "bindings", "workflow_editor", "extension_catalogue", "model_aliases", + "system_status", "task_execution", "organisations", "tools", "plugins", "container_runtime", "agent_profiles", + "org", "org_members", "org_agents", "org_workspaces", "org_policies", "org_denials", "org_audit", "org_usage", "org_config", } { sections[name] = false } diff --git a/ui/src/App.vue b/ui/src/App.vue index af6aa6c24..18c4c6c91 100644 --- a/ui/src/App.vue +++ b/ui/src/App.vue @@ -23,7 +23,7 @@ import { SidebarInset, SidebarProvider } from "@/components/ui/sidebar"; import NewTaskDialog from "@/tasks/NewTaskDialog.vue"; import SettingsShell from "@/settings/SettingsShell.vue"; import { TooltipProvider } from "@/components/ui/tooltip"; -import { hiddenPaths } from "@/lib/nav"; +import { hiddenPaths, navTree } from "@/lib/nav"; import { loadTaskMeta } from "@/lib/task-meta"; import { useSessionStore } from "@/stores/session"; import { Toaster } from "vue-sonner"; @@ -42,7 +42,10 @@ const newTaskOpen = ref(false); // it, so a bookmark or a chat link must not land on a form whose saves the // control plane refuses. watch([() => route.path, hidden], () => { - if (hidden.value.includes(typeof route.meta.navPath === "string" ? route.meta.navPath : route.path)) void router.replace("/"); + if (!hidden.value.includes(typeof route.meta.navPath === "string" ? route.meta.navPath : route.path)) return; + // Home may be hidden too, so land on the first destination that is served. + const first = navTree(hidden.value).find((node) => node.kind === "link"); + void router.replace(first?.kind === "link" ? first.entry.path : "/account"); }); watch(() => [route.path, accounts.instance], () => { const scope = route.meta.org ? "Organisation" : route.meta.settings ? "Instance" : ""; @@ -117,7 +120,7 @@ watch(() => accounts.status?.user, (user) => {
- + diff --git a/ui/src/components/command-palette/CommandPalette.vue b/ui/src/components/command-palette/CommandPalette.vue index b1ca8b904..9a9a9d0f2 100644 --- a/ui/src/components/command-palette/CommandPalette.vue +++ b/ui/src/components/command-palette/CommandPalette.vue @@ -46,6 +46,7 @@ const tasks = ref([]); const workflows = ref([]); const shortcut = navigator.platform.startsWith("Mac") ? "⌘K" : "Ctrl K"; const showWorkflows = computed(() => !props.hidden.includes("/workflows")); +const showTasks = computed(() => !props.hidden.includes("/tasks")); // A failed read shows as an error item with Retry in that group, not as a // missing group: the pages still work either way. @@ -55,16 +56,14 @@ let entriesGeneration = 0; async function loadEntries(): Promise { const current = ++entriesGeneration; const [taskPage, workflowList] = await Promise.all([ - api.taskPage({ limit: 100 }).catch(() => null), - showWorkflows.value - ? api.workflows<{ definitions?: { id: string }[] }>().catch(() => null) - : null, + showTasks.value ? api.taskPage({ limit: 100 }).catch(() => null) : { tasks: [] }, + showWorkflows.value ? api.workflowList().catch(() => null) : [], ]); if (current !== entriesGeneration) return; tasksError.value = taskPage === null; tasks.value = taskPage?.tasks ?? []; - workflowsError.value = showWorkflows.value && workflowList === null; - workflows.value = (workflowList?.definitions ?? []).map(({ id }) => id); + workflowsError.value = workflowList === null; + workflows.value = (workflowList ?? []).map(({ name }) => name); } watch(open, (value) => { diff --git a/ui/src/controls/ActionClassDetail.vue b/ui/src/controls/ActionClassDetail.vue new file mode 100644 index 000000000..09670ae24 --- /dev/null +++ b/ui/src/controls/ActionClassDetail.vue @@ -0,0 +1,36 @@ + + + diff --git a/ui/src/controls/ControlsPage.vue b/ui/src/controls/ControlsPage.vue new file mode 100644 index 000000000..aec3114cb --- /dev/null +++ b/ui/src/controls/ControlsPage.vue @@ -0,0 +1,103 @@ + + + diff --git a/ui/src/controls/PolicyText.vue b/ui/src/controls/PolicyText.vue new file mode 100644 index 000000000..6d40e8fa7 --- /dev/null +++ b/ui/src/controls/PolicyText.vue @@ -0,0 +1,97 @@ + + +