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 @@ + + +