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 @@
+
+
+
+
+
+
+
Tightened : {{ data.tightened_because }}
+
+ Raise {{ r.from }} → {{ r.to }}, {{ r.state }}, proposed
+
+
+ Reset {{ r.from }} → {{ r.to }} by {{ r.by }}
+
+
+
+ · {{ h.level }} · {{ h.target }} · answered by {{ h.answered_by }} · refused by {{ h.refused_by }}
+ · run
+
+
+
No decisions yet.
+
+
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 @@
+
+
+
+
+
+
+
+
+
+
+
+ {{ row.name }} {{ row.version }}
+
+ {{ row.advisory ? "Advisory" : "Enforcing" }}
+
+
+
+ · {{ row.latest.model }} · {{ row.latest.answer }}
+ Not trusted
+
+
+ No guards
+
+ Manage guards
+
+
+ {{ resetError }}
+
+
+
+ {{ row.connector }}.{{ row.action }}
+ {{ row.target_kind }} · {{ row.environment }}
+
+ {{ row.level }}
+ from {{ row.default }}
+
+ {{ row.count }}
+ {{ row.decisions }}
+
+
+
+
+ Reset to {{ row.default }}
+
+
+ No action classes
+
+
+
+
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 @@
+
+
+
+
+
+ (picked = Number(v) === latest.data.value?.version ? 0 : Number(v))">
+
+
+ Version {{ v.version }}
+
+
+ Version {{ latest.data.value.version }}
+
+
+
+
+
+
+ by {{ old.data.value.created_by }}
+
+
+
+
+
+ by {{ latest.data.value.created_by }}
+
+
+
+
{{ publishError }}
+
Discard
+
Publish
+
+
+
+
diff --git a/ui/src/events/EventDetail.vue b/ui/src/events/EventDetail.vue
new file mode 100644
index 000000000..a950c0b71
--- /dev/null
+++ b/ui/src/events/EventDetail.vue
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+ Started
+ , a run through {{ run.trigger }}
+
+
+
+
diff --git a/ui/src/events/EventList.vue b/ui/src/events/EventList.vue
new file mode 100644
index 000000000..0fbe2e1b1
--- /dev/null
+++ b/ui/src/events/EventList.vue
@@ -0,0 +1,103 @@
+
+
+
+
+
+
+
+
+
+ All sources
+ {{ s.name }}
+
+
+
+
+
+ Matched or not
+ Matched a trigger
+ Unmatched
+
+
+
+
+
+
+
+
+ {{ row.source }}
+ {{ row.type }}
+
+ {{ row.matched ? "Matched" : "Unmatched" }}
+
+
+ {{ row.linked_to }}
+
+
+ No events
+
+
+
+
diff --git a/ui/src/events/EventsPage.vue b/ui/src/events/EventsPage.vue
index 5a577caf5..1b47898f8 100644
--- a/ui/src/events/EventsPage.vue
+++ b/ui/src/events/EventsPage.vue
@@ -23,6 +23,9 @@ import CapturesPage from "@/captures/CapturesPage.vue";
import { api } from "@/lib/api";
import { useLiveResource, useSessionStore } from "@/stores/session";
import MappingsPage from "@/mappings/MappingsPage.vue";
+import EventList from "./EventList.vue";
+import SourceList from "./SourceList.vue";
+import TriggerList from "./TriggerList.vue";
import { activeTab, availableTabs, stepsFor } from "./tab-selection";
import { loadEventCounts, type EventsCounts } from "./counts";
@@ -41,6 +44,9 @@ import { loadEventCounts, type EventsCounts } from "./counts";
* Which steps exist, and which one is showing, is decided in tab-selection.ts.
*/
const PANELS: Record = {
+ events: EventList,
+ sources: SourceList,
+ triggers: TriggerList,
inspector: CapturesPage,
bindings: BindingsPage,
mappings: MappingsPage,
@@ -77,7 +83,10 @@ const counts = ref({});
// started is dropped, so the previous workspace's counts never overwrite the
// current one.
let countsGeneration = 0;
+// The capture chain's counts read routes only a capture backend serves.
+const captureChain = computed(() => session.sections?.captures !== false);
async function loadCounts() {
+ if (!captureChain.value) return;
const gen = ++countsGeneration;
const workspace = events.workspace;
const loaded = await loadEventCounts({
@@ -108,6 +117,7 @@ function pickWorkspace(value: unknown): void {
void router.replace({ query: { ...route.query, workspace } });
}
onMounted(async () => {
+ if (session.sections?.org === false) return;
try {
await orgStore.loadOrg();
workspaces.value = (
@@ -146,7 +156,7 @@ const panel = computed(() => PANELS[active.value]);
-
+
Capture off
diff --git a/ui/src/events/SourceList.vue b/ui/src/events/SourceList.vue
new file mode 100644
index 000000000..e022c8e30
--- /dev/null
+++ b/ui/src/events/SourceList.vue
@@ -0,0 +1,148 @@
+
+
+
+
+
+
{{ actionError }}
+
+
+
+
+
+ {{ row.name }}
+ {{ row.connector }}
+ {{ (row.key_fields ?? []).join(", ") || "Connector default" }}
+
+
+ Group by…
+ Rotate token
+
+
+ No sources
+
+
+
+
+
+ Add source
+
+ Add
+
+
+
+
{ if (!open) keyFieldsOf = null; }">
+
+ Group {{ keyFieldsOf?.name }} events by
+
+ Save
+
+
+
+
diff --git a/ui/src/events/TriggerList.vue b/ui/src/events/TriggerList.vue
new file mode 100644
index 000000000..aa11bc920
--- /dev/null
+++ b/ui/src/events/TriggerList.vue
@@ -0,0 +1,153 @@
+
+
+
+
+
{{ actionError }}
+
+
+
+
+
+ {{ row.name }}
+
+ Every {{ row.every }}
+ {{ row.source }} {{ row.event_type }}
+
+ {{ row.workflow }}
+
+ {{ Object.entries(row.filter ?? {}).map(([k, v]) => `${k}=${v}`).join(", ") }}
+
+
+
+
+
+ Edit
+
+ No triggers
+
+
+
+
+
+ {{ isNew ? "Add trigger" : `Edit ${form.name}` }}
+
+ Save
+
+
+
+
diff --git a/ui/src/events/tab-selection.ts b/ui/src/events/tab-selection.ts
index 170255f34..a6a77ef9a 100644
--- a/ui/src/events/tab-selection.ts
+++ b/ui/src/events/tab-selection.ts
@@ -17,6 +17,9 @@ export interface EventsTabSpec {
/** The tabs, in reading order: what arrived, where its fields go wrong, what
* runs. */
const EVENTS_TABS: EventsTabSpec[] = [
+ { id: "events", label: "Events", section: "events" },
+ { id: "sources", label: "Sources", section: "events" },
+ { id: "triggers", label: "Triggers", section: "events" },
{ id: "inspector", label: "Inspector", section: "captures" },
{ id: "mappings", label: "Mappings", section: "mappings" },
{ id: "bindings", label: "Bindings", section: "bindings" },
@@ -68,6 +71,9 @@ const STEP_COPY: Record = {
inspector: { label: "Capture", hint: "webhooks received" },
mappings: { label: "Map", hint: "field mappings" },
bindings: { label: "Bind", hint: "bindings to workflows" },
+ events: { label: "Events", hint: "events received" },
+ sources: { label: "Sources", hint: "sources" },
+ triggers: { label: "Triggers", hint: "triggers" },
};
/**
diff --git a/ui/src/events/trigger.ts b/ui/src/events/trigger.ts
new file mode 100644
index 000000000..908446d03
--- /dev/null
+++ b/ui/src/events/trigger.ts
@@ -0,0 +1,14 @@
+import type { Trigger, TriggerInput } from "@/lib/api";
+
+/** triggerInput is the put that keeps a listed trigger as it is. A schedule
+ * sends only its interval: the server fixes its source, type and filter. */
+export function triggerInput(trigger: Trigger): TriggerInput {
+ if (trigger.every) return { every: trigger.every, workflow: trigger.workflow, disabled: !trigger.enabled };
+ return {
+ source: trigger.source,
+ event_type: trigger.event_type,
+ filter: trigger.filter,
+ workflow: trigger.workflow,
+ disabled: !trigger.enabled,
+ };
+}
diff --git a/ui/src/lib/api.ts b/ui/src/lib/api.ts
index 37f0cbbba..e5c777cc6 100644
--- a/ui/src/lib/api.ts
+++ b/ui/src/lib/api.ts
@@ -184,6 +184,52 @@ async function request(
}
export const api = {
+ // The archie binary's module API; the wire types are below the object.
+ runs: (limit = 200) => request("/api/runs" + qs({ limit })),
+ run: (id: string) => request(`/api/runs/${encodeURIComponent(id)}`),
+ approvals: () => request("/api/approvals"),
+ answerApproval: (id: string, approved: boolean) =>
+ request(`/api/approvals/${encodeURIComponent(id)}/answer`, { method: "POST", body: { approved } }),
+ events: (params: { limit?: number; source?: string; type?: string; matched?: string } = {}) =>
+ request("/api/events" + qs(params)),
+ event: (id: string) => request(`/api/events/${encodeURIComponent(id)}`),
+ eventSources: () => request("/api/sources"),
+ putEventSource: (name: string, connector: string) =>
+ request<{ source: string; token: string; url: string }>(`/api/sources/${encodeURIComponent(name)}`, { method: "PUT", body: { connector } }),
+ putSourceKeyFields: (name: string, paths: string[]) =>
+ request<{ key_fields: string[] }>(`/api/sources/${encodeURIComponent(name)}/key-fields`, { method: "PUT", body: { paths } }),
+ triggers: () => request("/api/triggers"),
+ putTrigger: (name: string, trigger: TriggerInput) =>
+ request<{ trigger: string }>(`/api/triggers/${encodeURIComponent(name)}`, { method: "PUT", body: trigger }),
+ workflowList: () => request("/api/workflows"),
+ workflow: (name: string, version?: number) =>
+ request(`/api/workflows/${encodeURIComponent(name)}` + qs({ version })),
+ putWorkflow: (name: string, body: string) =>
+ request(`/api/workflows/${encodeURIComponent(name)}`, { method: "PUT", body: { body } }),
+ workflowStepTypes: () => request<{ name: string; needs_repository: boolean; settings?: unknown }[]>("/api/workflow-step-types"),
+ extensions: (kind: ExtensionKind) => request(`/api/${kind}`),
+ acceptExtension: (kind: ExtensionKind, name: string, body: ExtensionInput) =>
+ request<{ name: string; state: string }>(`/api/${kind}/${encodeURIComponent(name)}`, { method: "PUT", body, timeoutMs: 60_000 }),
+ removeExtension: (kind: ExtensionKind, name: string) =>
+ request<{ name: string; state: string }>(`/api/${kind}/${encodeURIComponent(name)}`, { method: "DELETE" }),
+ credentials: () => request("/api/credentials"),
+ credentialKinds: () => request("/api/credential-kinds"),
+ putCredential: (name: string, kind: string, fields: Record) =>
+ request<{ name: string; kind: string; restarted: string[] }>(`/api/credentials/${encodeURIComponent(name)}`, { method: "PUT", body: { kind, fields }, timeoutMs: 60_000 }),
+ agentModels: () => request>("/api/settings/agent-models"),
+ putAgentModel: (alias: string, model: AgentModel) =>
+ request("/api/settings/agent-model" + qs({ alias }), { method: "PUT", body: model }),
+ testAgentModel: (model: AgentModel) =>
+ request<{ answer: string; model: string }>("/api/settings/agent-model/test", { method: "POST", body: model, timeoutMs: 60_000 }),
+ policyText: (kind: PolicyKind, version?: number) =>
+ request(`/api/policies/${kind}` + qs({ version })),
+ putPolicyText: (kind: PolicyKind, body: string) =>
+ request(`/api/policies/${kind}`, { method: "PUT", body: { body } }),
+ judges: () => request("/api/controls/judges"),
+ actionClasses: () => request("/api/classes"),
+ actionClass: (id: string) => request(`/api/classes/${encodeURIComponent(id)}`),
+ resetActionClass: (id: string) =>
+ request(`/api/classes/${encodeURIComponent(id)}/reset`, { method: "POST" }),
recoveryCode: () => request<{code:string}>("/api/account/recovery",{method:"POST",body:{}}),
recoverAccount: (email:string,code:string,password:string) => request("/api/auth/recover",{method:"POST",body:{email,code,password},parse:false}),
authStatus: () => request("/api/auth/status"),
@@ -201,7 +247,6 @@ export const api = {
deletePasskey: (id:string) => request(`/api/account/passkeys/${encodeURIComponent(id)}`,{method:"DELETE",body:{},parse:false}),
beginPasskey: (registration:boolean) => request(registration?"/api/account/passkeys/begin":"/api/auth/passkey/begin",{method:"POST",body:{}}),
finishPasskey: (registration:boolean,credential:unknown,name:string) => request(registration?"/api/account/passkeys/finish":"/api/auth/passkey/finish",{method:"POST",body:{credential,name}}),
- secretEngines: () => request("/api/secret-engines"),
checkSecret: (ref: { engine: string; key: string }) => request<{ resolved: boolean; process: string }>("/api/secret-references/check", { method: "POST", body: ref }),
health: () => request("/health/detailed"),
services: () => request("/api/services"),
@@ -498,6 +543,235 @@ export const api = {
}),
};
+export interface Run {
+ id: string;
+ workflow: string;
+ workflow_version: number;
+ state: string;
+ attempts: number;
+ error?: string;
+ created_at: string;
+ finished_at?: string;
+ result?: unknown;
+}
+
+export interface Approval {
+ id: string;
+ run_id: string;
+ step: number;
+ kind: string;
+ action: string;
+ target: string;
+ level: string;
+ summary: string;
+ state: string;
+ requested_at: string;
+ deadline?: string;
+ answered_at?: string;
+ answered_by?: string;
+ answered_via?: string;
+}
+
+interface Decision {
+ id: string;
+ level: string;
+ reason?: string;
+ refused_by?: string;
+ dry?: boolean;
+ change_request?: boolean;
+ change_request_rule?: string;
+ at: string;
+ action: { connector: string; name: string; target?: { Kind?: string; ID?: string; Environment?: string } };
+ verdicts?: { guard: string; advisory: boolean; ceiling?: string; failed?: string }[];
+}
+
+export interface RunAction {
+ decision: Decision;
+ rejudged?: Decision;
+ approval?: Approval;
+ effect?: { state: string; output?: string; error?: string; at?: string };
+}
+
+export interface RunEntry {
+ seq: number;
+ kind: string;
+ name?: string;
+ at?: string;
+ text?: string;
+ output?: string;
+ error?: string;
+ unknown?: boolean;
+ tool_calls?: { name: string; input: string }[];
+}
+
+export interface RunTrail {
+ run: Run;
+ origin?: { event_id?: string; source?: string; type?: string; trigger?: string; received_at?: string };
+ actions?: RunAction[];
+ entries?: RunEntry[];
+}
+
+export interface EventRecord {
+ id: string;
+ source: string;
+ type: string;
+ matched: boolean;
+ received_at: string;
+ occurred_at?: string;
+ dispatched_at?: string;
+ linked_to?: string;
+ fields?: unknown;
+}
+
+export interface EventDetail {
+ body: unknown;
+ runs?: { run_id: string; trigger: string }[];
+}
+
+// Named with a trailing underscore: EventSource is the browser's SSE class.
+export interface EventSource_ {
+ name: string;
+ connector: string;
+ key_fields?: string[];
+ token_set: boolean;
+}
+
+export interface Trigger {
+ name: string;
+ source?: string;
+ event_type?: string;
+ every?: string;
+ workflow: string;
+ filter?: Record;
+ enabled: boolean;
+}
+
+export interface TriggerInput {
+ source?: string;
+ event_type?: string;
+ every?: string;
+ workflow: string;
+ filter?: Record;
+ disabled: boolean;
+}
+
+export interface WorkflowVersion {
+ name: string;
+ version: number;
+ body: string;
+ steps?: string[];
+ created_at: string;
+ created_by?: string;
+}
+
+export type ExtensionKind = "connectors" | "guards" | "mcp-servers" | "secret-engines";
+
+export interface SettingField {
+ key: string;
+ label?: string;
+ description?: string;
+ type?: string;
+ options?: string[];
+ required?: boolean;
+ secret?: boolean;
+}
+
+export interface Extension {
+ name: string;
+ state: string;
+ error?: string;
+ path?: string;
+ url?: string;
+ args?: string[];
+ digest?: string;
+ version?: string;
+ contract?: string;
+ egress?: string[];
+ env?: string[];
+ settings?: Record;
+ settings_schema?: SettingField[];
+ credentials?: Record;
+ /** An MCP server's declared tools, as it was accepted with them. */
+ tools?: unknown;
+}
+
+export interface ExtensionInput {
+ path?: string;
+ sha256?: string;
+ url?: string;
+ args?: string[];
+ egress?: string[];
+ env?: string[];
+ settings?: Record;
+ credentials?: Record;
+ tools?: unknown;
+}
+
+export interface Credential {
+ name: string;
+ kind: string;
+ /** Per field: "stored", or "engine:key" for one a secret engine resolves. */
+ fields: Record;
+}
+
+export interface CredentialKind {
+ kind: string;
+ required: string[];
+ optional?: string[];
+}
+
+export interface CredentialField {
+ value?: string;
+ engine?: string;
+ key?: string;
+}
+
+export interface AgentModel {
+ class: string;
+ model: string;
+ base_url?: string;
+ api_key_credential?: string;
+}
+
+export type PolicyKind = "hard-rules" | "change-request";
+
+export interface PolicyText {
+ body: string;
+ version: number;
+ created_at?: string;
+ created_by?: string;
+ versions?: { version: number; created_at: string; created_by?: string }[];
+}
+
+export interface Judge {
+ name: string;
+ version?: string;
+ advisory: boolean;
+ latest?: { answer?: string; at?: string; model?: string; trusted?: boolean; advisory_reason?: string };
+}
+
+export interface ActionClass {
+ id: string;
+ connector: string;
+ action: string;
+ target_kind?: string;
+ environment?: string;
+ level: string;
+ default: string;
+ count: number;
+ decisions: number;
+ last_decided_at?: string;
+ tightened_at?: string;
+ tightened_because?: string;
+ reset_at?: string;
+}
+
+export interface ActionClassDetail extends ActionClass {
+ history?: { at: string; level: string; run_id?: string; target?: string; approval?: string; answered_by?: string; refused_by?: string }[];
+ raises?: { id: string; from: string; to: string; state: string; proposed_at: string }[];
+ resets?: { at: string; by: string; from: string; to: string }[];
+}
+
/**
* Subscribe to archied's event stream. Returns an unsubscribe function.
* Reconnection is the browser's job via EventSource, but a closed stream is
diff --git a/ui/src/lib/lines.ts b/ui/src/lib/lines.ts
new file mode 100644
index 000000000..2b0458cd5
--- /dev/null
+++ b/ui/src/lib/lines.ts
@@ -0,0 +1,14 @@
+/** toLines writes a string map as `key=value` lines for a textarea. */
+export function toLines(map: Record): string {
+ return Object.entries(map).map(([k, v]) => `${k}=${v}`).join("\n");
+}
+
+/** fromLines reads `key=value` lines back; a line without `=` is a key with no value. */
+export function fromLines(text: string): Record {
+ return Object.fromEntries(
+ text.split("\n").map((l) => l.trim()).filter(Boolean).map((line) => {
+ const at = line.indexOf("=");
+ return at < 0 ? [line, ""] : [line.slice(0, at).trim(), line.slice(at + 1).trim()];
+ }),
+ );
+}
diff --git a/ui/src/lib/nav.ts b/ui/src/lib/nav.ts
index a45a04370..6ca333cb7 100644
--- a/ui/src/lib/nav.ts
+++ b/ui/src/lib/nav.ts
@@ -17,8 +17,10 @@ const table = flattenRoutes(routes as NavRouteNode[]);
const specs: NavSpec[] = [
{ kind: "link", path: "/" },
{ kind: "link", path: "/tasks" },
+ { kind: "link", path: "/runs" },
{ kind: "link", path: "/workflows" },
{ kind: "link", path: "/events" },
+ { kind: "link", path: "/controls" },
{ kind: "link", path: "/org" },
{ kind: "link", path: "/settings" },
];
@@ -61,6 +63,7 @@ const settings: NavSpec = {
label: "Models & prompts",
paths: [
"/settings/models",
+ "/settings/model-aliases",
"/settings/skills",
"/settings/curators",
],
@@ -71,8 +74,10 @@ const settings: NavSpec = {
"/settings/channels",
"/settings/tools",
"/settings/extensions",
+ "/settings/extension-catalogue",
"/settings/plugins",
"/settings/secret-engines",
+ "/settings/credentials",
],
},
{
diff --git a/ui/src/lib/use-read.ts b/ui/src/lib/use-read.ts
new file mode 100644
index 000000000..59a61e880
--- /dev/null
+++ b/ui/src/lib/use-read.ts
@@ -0,0 +1,46 @@
+import { onScopeDispose, ref, shallowRef, type Ref, type ShallowRef } from "vue";
+
+import { errors } from "@/copy/errors";
+import { describeError } from "./api";
+
+export interface Read {
+ /** Undefined until the first read succeeds. */
+ data: ShallowRef;
+ error: Ref;
+ loading: Ref;
+ reload: () => Promise;
+}
+
+/** useRead keeps one server read's loading, failed and loaded states apart,
+ * and drops a response that settles after a newer read started. */
+export function useRead(read: () => Promise): Read {
+ const data = shallowRef();
+ const error = ref("");
+ const loading = ref(false);
+ let generation = 0;
+ async function reload(): Promise {
+ const current = ++generation;
+ loading.value = true;
+ try {
+ const value = await read();
+ if (current !== generation) return;
+ data.value = value;
+ error.value = "";
+ } catch (cause) {
+ if (current !== generation) return;
+ error.value = describeError(cause, errors.common.unknown);
+ } finally {
+ if (current === generation) loading.value = false;
+ }
+ }
+ return { data, error, loading, reload };
+}
+
+/** usePoll re-reads every intervalMs while the tab is visible, for views
+ * whose data the live stream does not carry. */
+export function usePoll(reload: () => unknown, intervalMs = 5000): void {
+ const timer = setInterval(() => {
+ if (!document.hidden) void reload();
+ }, intervalMs);
+ onScopeDispose(() => clearInterval(timer));
+}
diff --git a/ui/src/router/index.ts b/ui/src/router/index.ts
index 5098879ee..bbd3ea5a9 100644
--- a/ui/src/router/index.ts
+++ b/ui/src/router/index.ts
@@ -24,7 +24,6 @@ const SecretEnginesPage = () => import("@/settings/SecretEnginesPage.vue");
const ContainerRuntimePage = () => import("@/settings/ContainerRuntimePage.vue");
const ConnectionsPage = () => import("@/settings/ConnectionsPage.vue");
const SystemAppearancePage = () => import("@/settings/SystemAppearancePage.vue");
-const SystemModelsPage = () => import("@/settings/SystemModelsPage.vue");
const SystemReposPage = () => import("@/settings/SystemReposPage.vue");
const SystemStatusPage = () => import("@/settings/SystemStatusPage.vue");
const SystemTasksPage = () => import("@/settings/SystemTasksPage.vue");
@@ -53,6 +52,7 @@ const routes = [
label: "Dashboard",
description:
"Running work, work needing attention, token spend.",
+ section: "home",
},
},
{
@@ -62,18 +62,37 @@ const routes = [
meta: {
label: "Tasks",
description: "Picked-up issues and their status.",
+ section: "tasks",
},
},
{
path: "/tasks/:id",
name: "task-detail",
component: TaskDetailPage,
- meta: { label: "Task run", nav: false, navPath: "/tasks" },
+ meta: { label: "Task run", nav: false, navPath: "/tasks", section: "tasks" },
+ },
+ {
+ path: "/runs",
+ name: "runs",
+ component: () => import("@/runs/RunsPage.vue"),
+ meta: { label: "Runs", description: "Workflow runs, their decision trails and waiting approvals.", section: "runs" },
+ },
+ {
+ path: "/runs/:id",
+ name: "run",
+ component: () => import("@/runs/RunPage.vue"),
+ meta: { label: "Run", nav: false, navPath: "/runs", section: "runs" },
+ },
+ {
+ path: "/controls",
+ name: "controls",
+ component: () => import("@/controls/ControlsPage.vue"),
+ meta: { label: "Controls", description: "Hard rules, change-request rules, guards and action classes.", section: "controls" },
},
{
path: "/workflows",
name: "workflows",
- component: WorkflowsPage,
+ component: () => import("@/workflows/WorkflowListPage.vue"),
// Links written as /workflows?workflow= open that workflow's page.
beforeEnter: (to: RouteLocationGeneric) => {
const { workflow, ...query } = to.query;
@@ -89,8 +108,22 @@ const routes = [
{
path: "/workflows/:id",
name: "workflow",
+ component: () => import("@/workflows/WorkflowDocumentPage.vue"),
+ meta: { label: "Workflow", nav: false, navPath: "/workflows", section: "workflows" },
+ },
+ // The visual editor, with drafts, test runs and per-step statistics; it
+ // needs workflow drafts and run stages the binary does not serve yet.
+ {
+ path: "/workflow-editor",
+ name: "workflow-editor-list",
+ component: WorkflowsPage,
+ meta: { label: "Workflow editor", nav: false, navPath: "/workflows", section: "workflow_editor" },
+ },
+ {
+ path: "/workflow-editor/:id",
+ name: "workflow-editor",
component: WorkflowPage,
- meta: { label: "Workflow", nav: false, navPath: "/workflows" },
+ meta: { label: "Workflow", nav: false, navPath: "/workflows", section: "workflow_editor" },
},
{
path: "/settings/skills",
@@ -122,8 +155,8 @@ const routes = [
component: EventsPage,
meta: {
label: "Events",
- description:
- "Captured events, field mappings, workflow bindings.",
+ description: "Received events, their sources, and the triggers that start workflows.",
+ section: "events",
},
},
{
@@ -136,7 +169,7 @@ const routes = [
label: "Status",
description:
"Service presence, dependency health, and build versions.",
- section: "settings",
+ section: "system_status",
},
},
{
@@ -164,26 +197,26 @@ const routes = [
settings: true,
label: "Task execution",
description: "Statuses, operator actions, budgets.",
- section: "settings",
+ section: "task_execution",
},
},
{
path: "/settings/models",
name: "system-models",
- component: SystemModelsPage,
+ component: () => import("@/settings/AgentModelsPage.vue"),
meta: {
navPath: "/settings",
settings: true,
label: "Models",
- description: "Model aliases and providers.",
- section: "settings",
+ description: "The models agent loops use, by alias.",
+ section: "models",
},
},
{
path: "/settings/organisations",
name: "settings-organisations",
component: () => import("@/settings/OrganisationsPage.vue"),
- meta: { navPath: "/settings", settings: true, label: "Organisations", section: "settings" },
+ meta: { navPath: "/settings", settings: true, label: "Organisations", section: "organisations" },
},
{
path: "/settings/authentication",
@@ -205,6 +238,7 @@ const routes = [
label: "Organisation",
description: "Members, identities, connections, models and automation.",
navPath: "/org",
+ section: "org",
org: true,
},
children: [
@@ -252,7 +286,7 @@ const routes = [
path: "workspaces",
name: "org-workspaces",
component: OrgWorkspacesPage,
- meta: { label: "Workspaces", navPath: "/org" },
+ meta: { section: "org_workspaces", label: "Workspaces", navPath: "/org" },
},
{
path: "policies",
@@ -371,7 +405,7 @@ const routes = [
settings: true,
label: "Tools & MCP",
description: "Agent tools and MCP servers.",
- section: "settings",
+ section: "tools",
},
},
{
@@ -383,15 +417,27 @@ const routes = [
{
path: "/settings/extensions",
name: "settings-extensions",
- component: ExtensionsPage,
+ component: () => import("@/settings/AcceptedExtensionsPage.vue"),
meta: {
navPath: "/settings",
settings: true,
label: "Extensions",
- description: "Installed extensions and grants.",
- section: "settings",
+ description: "Connectors, guards and MCP servers.",
+ section: "extensions",
},
},
+ {
+ path: "/settings/extension-catalogue",
+ name: "settings-extension-catalogue",
+ component: ExtensionsPage,
+ meta: { navPath: "/settings", settings: true, label: "Extension catalogue", description: "Installed extensions, grants and the marketplace.", section: "extension_catalogue" },
+ },
+ {
+ path: "/settings/model-aliases",
+ name: "settings-model-aliases",
+ component: () => import("@/settings/SystemModelsPage.vue"),
+ meta: { navPath: "/settings", settings: true, label: "Model aliases", description: "Model aliases and providers.", section: "model_aliases" },
+ },
{
path: "/settings/plugins",
name: "settings-plugins",
@@ -401,14 +447,20 @@ const routes = [
settings: true,
label: "Plugins",
description: "Extension directories loaded at startup.",
- section: "settings",
+ section: "plugins",
},
},
{
path: "/settings/secret-engines",
name: "settings-secret-engines",
component: SecretEnginesPage,
- meta: { navPath: "/settings", settings: true, label: "Secret engines", section: "settings" },
+ meta: { navPath: "/settings", settings: true, label: "Secret engines", section: "secret_engines" },
+ },
+ {
+ path: "/settings/credentials",
+ name: "settings-credentials",
+ component: () => import("@/settings/CredentialsPage.vue"),
+ meta: { navPath: "/settings", settings: true, label: "Credentials", description: "Sealed credentials extensions and models use.", section: "credentials" },
},
{
path: "/settings/container-runtime",
@@ -418,20 +470,20 @@ const routes = [
navPath: "/settings",
settings: true,
label: "Container runtime",
- section: "settings",
+ section: "container_runtime",
},
},
{
path: "/settings/agent-profiles",
name: "settings-agent-profiles",
component: () => import("@/settings/AgentProfilesPage.vue"),
- meta: { navPath: "/settings", settings: true, label: "Agent profiles", section: "settings" },
+ meta: { navPath: "/settings", settings: true, label: "Agent profiles", section: "agent_profiles" },
},
{ path: "/settings/history", redirect: (to: RouteLocationGeneric) => ({ path: "/org/audit", query: to.query, hash: to.hash }), meta: { nav: false } },
{ path: "/settings/audit", redirect: (to: RouteLocationGeneric) => ({ path: "/org/audit", query: to.query, hash: to.hash }), meta: { nav: false } },
{
path: "/settings",
- redirect: "/settings/status",
+ redirect: "/settings/models",
meta: {
label: "Instance",
},
diff --git a/ui/src/runs/ApprovalsSection.vue b/ui/src/runs/ApprovalsSection.vue
new file mode 100644
index 000000000..5a12c9881
--- /dev/null
+++ b/ui/src/runs/ApprovalsSection.vue
@@ -0,0 +1,66 @@
+
+
+
+
+
+ {{ answerError }}
+
+
+
+
{{ approval.summary || approval.action }}
+
+ {{ approval.action }}
+ on {{ approval.target }}
+ · run
+ · due
+
+
+ {{ approval.level }}
+ Deny
+ Approve
+
+
+
+
diff --git a/ui/src/runs/RunPage.vue b/ui/src/runs/RunPage.vue
new file mode 100644
index 000000000..43761b9e1
--- /dev/null
+++ b/ui/src/runs/RunPage.vue
@@ -0,0 +1,127 @@
+
+
+
+
+
+ {{ data.run.state }}
+ Started
+
+
+
+
+
+
+
+
+
+
+ {{ row.value }}
+ {{ row.value }}
+
+
+
+
+
+ No actions
+
+
+
+ {{ action.decision.action.connector }}.{{ action.decision.action.name }}
+ {{ target(action) }}
+ {{ action.decision.level }}
+ Dry run
+ Refused by {{ action.decision.refused_by }}
+ Approval {{ action.approval.state }}
+ {{ action.effect.state }}
+
+
+ {{ action.decision.reason }}
+
+ Answered by {{ action.approval.answered_by }} via {{ action.approval.answered_via }}
+
+ Judged again before it ran: {{ action.rejudged.level }}, refused by {{ action.rejudged.refused_by }}
+ {{ action.effect.error }}
+
+
+
+
+
+ No steps recorded
+
+
+
+ {{ entry.kind }}
+ {{ entry.name }}
+ Outcome unknown
+
+
+ {{ entry.text }}
+ {{ call.name }} {{ call.input }}
+ {{ entry.error }}
+
+
+
+
+
+
+
+
diff --git a/ui/src/runs/RunsPage.vue b/ui/src/runs/RunsPage.vue
new file mode 100644
index 000000000..e3c92e0f4
--- /dev/null
+++ b/ui/src/runs/RunsPage.vue
@@ -0,0 +1,75 @@
+
+
+
+
+
+ {{ workflow }}
+
+
+
+
+
+ {{ row.workflow }} v{{ row.workflow_version }}
+
+ {{ row.state }}
+
+
+
+ {{ row.attempts }}
+ {{ row.id }}
+
+ No runs yet
+
+
+
+
diff --git a/ui/src/runs/state.ts b/ui/src/runs/state.ts
new file mode 100644
index 000000000..20ffc0cac
--- /dev/null
+++ b/ui/src/runs/state.ts
@@ -0,0 +1,24 @@
+/** The Badge and StatusDot tone for a run, approval or effect state the server
+ * reports. A state this build does not know reads as idle. */
+export function stateTone(state: string): "ok" | "warn" | "danger" | "info" | "idle" {
+ switch (state) {
+ case "succeeded":
+ case "approved":
+ case "done":
+ return "ok";
+ case "waiting":
+ case "pending":
+ case "unknown":
+ return "warn";
+ case "failed":
+ case "denied":
+ case "expired":
+ case "refused":
+ return "danger";
+ case "running":
+ case "queued":
+ return "info";
+ default:
+ return "idle";
+ }
+}
diff --git a/ui/src/settings/AcceptedExtensionsPage.vue b/ui/src/settings/AcceptedExtensionsPage.vue
new file mode 100644
index 000000000..70e133832
--- /dev/null
+++ b/ui/src/settings/AcceptedExtensionsPage.vue
@@ -0,0 +1,33 @@
+
+
+
+
+
+
router.replace({ query: { kind: String(k) } })">
+
+ {{ k.label }}
+
+
+
+
+
diff --git a/ui/src/settings/AgentModelsPage.vue b/ui/src/settings/AgentModelsPage.vue
new file mode 100644
index 000000000..b36787844
--- /dev/null
+++ b/ui/src/settings/AgentModelsPage.vue
@@ -0,0 +1,142 @@
+
+
+
+
+
diff --git a/ui/src/settings/CredentialsPage.vue b/ui/src/settings/CredentialsPage.vue
new file mode 100644
index 000000000..8ff85222b
--- /dev/null
+++ b/ui/src/settings/CredentialsPage.vue
@@ -0,0 +1,148 @@
+
+
+
+
+
+
+
+
Restarted {{ restarted.join(", ") }}.
+
+
+
+ {{ row.name }}
+ {{ row.kind }}
+
+ {{ Object.entries(row.fields).map(([f, from]) => from === "stored" ? f : `${f} ← ${from}`).join(", ") }}
+
+
+ Replace…
+
+ No credentials
+
+
+
+
+ {{ isNew ? "Add credential" : `Replace ${name}` }}
+
+
+
+
+
+ {{ k.kind }}
+
+
+
+
+
+ Value
+ Secret engine
+
+
+
+
+ {{ e.name }}
+
+
+
+
+
+
+
+ {{ actionError }}
+
+ Save
+
+
+
+
diff --git a/ui/src/settings/ExtensionList.vue b/ui/src/settings/ExtensionList.vue
new file mode 100644
index 000000000..fb369490e
--- /dev/null
+++ b/ui/src/settings/ExtensionList.vue
@@ -0,0 +1,183 @@
+
+
+
+
+
diff --git a/ui/src/stores/secret-engines.ts b/ui/src/stores/secret-engines.ts
index a7d4adaa7..63e9201e4 100644
--- a/ui/src/stores/secret-engines.ts
+++ b/ui/src/stores/secret-engines.ts
@@ -12,7 +12,8 @@ export const useSecretEnginesStore = defineStore("secret-engines", () => {
async function load() {
const current = ++generation;
try {
- engines.value = (await api.secretEngines<{ engines: SecretEngine[] }>()).engines;
+ const accepted = await api.extensions("secret-engines");
+ engines.value = accepted.map((e) => ({ name: e.name, version: e.version, source: e.path || e.url || "" }));
if (current !== generation) return;
error.value = "";
} catch (cause) {
diff --git a/ui/src/workflows/WorkflowDocumentPage.vue b/ui/src/workflows/WorkflowDocumentPage.vue
new file mode 100644
index 000000000..97b36b208
--- /dev/null
+++ b/ui/src/workflows/WorkflowDocumentPage.vue
@@ -0,0 +1,129 @@
+
+
+
+
+
+ Unpublished changes
+
+
+
+ Version {{ v }}
+
+
+ Version {{ latest.data.value.version }}
+ Runs
+
+
+
+
+
+
+ Canvas
+ YAML
+ Triggers
+
+
+
+
+
+
+
+
+
{{ publishError }}
+
Discard
+
Publish
+
+
+
+
+
+
+
+
diff --git a/ui/src/workflows/WorkflowListPage.vue b/ui/src/workflows/WorkflowListPage.vue
new file mode 100644
index 000000000..dc853fa5c
--- /dev/null
+++ b/ui/src/workflows/WorkflowListPage.vue
@@ -0,0 +1,126 @@
+
+
+
+
+
+
+
+
+
+
+ {{ triggers.error.value || runs.error.value }}
+
+ {{ row.name }} v{{ row.version }}
+ {{ startedBy(row) }}
+
+ {{ row.last.state }}
+
+ {{ row.steps }}
+ by {{ row.by }}
+ No workflows
+
+
+
+
+
+ New workflow
+
+
+
+ {{ createError }}
+
+ Publish
+
+
+
+
diff --git a/ui/src/workflows/WorkflowPage.vue b/ui/src/workflows/WorkflowPage.vue
index 1828ca902..ebc234c6c 100644
--- a/ui/src/workflows/WorkflowPage.vue
+++ b/ui/src/workflows/WorkflowPage.vue
@@ -20,7 +20,7 @@ const { store, data, error, loading, statsKnown, load, enabledOf, setEnabled, du
// under another id or deleting, and the URL follows.
const selected = computed({
get: () => String(route.params.id ?? ""),
- set: (id: string) => void (id ? router.replace({ name: "workflow", params: { id }, query: route.query }) : router.replace({ name: "workflows" })),
+ set: (id: string) => void (id ? router.replace({ name: "workflow-editor", params: { id }, query: route.query }) : router.replace({ name: "workflow-editor-list" })),
});
// ?view= opens a tab and ?run= opens the run dialog; a link carries them once.
diff --git a/ui/src/workflows/WorkflowsPage.vue b/ui/src/workflows/WorkflowsPage.vue
index 3e40d605e..5a6950c73 100644
--- a/ui/src/workflows/WorkflowsPage.vue
+++ b/ui/src/workflows/WorkflowsPage.vue
@@ -69,7 +69,7 @@ const shown = computed(() => {
return needle ? rows.value.filter((row) => row.id.toLowerCase().includes(needle) || row.trigger.text.toLowerCase().includes(needle)) : rows.value;
});
-const open = (id: string, query?: Record) => void router.push({ name: "workflow", params: { id }, query });
+const open = (id: string, query?: Record) => void router.push({ name: "workflow-editor", params: { id }, query });
const run = (id: string) => open(id, { run: "1" });
const openRuns = (id: string) => open(id, { view: "runs" });
const copy = (id: string) => void duplicate(id).then((next) => next && open(next));
diff --git a/ui/test/events-tabs.test.ts b/ui/test/events-tabs.test.ts
index a946e7516..3e5a4a8a6 100644
--- a/ui/test/events-tabs.test.ts
+++ b/ui/test/events-tabs.test.ts
@@ -4,11 +4,12 @@ import { activeTab, availableTabs } from "../src/events/tab-selection.ts";
test("Events hides only capabilities explicitly disabled by the server", () => {
const cases: Array<[Record | null | undefined, string[]]> = [
- [null, ["inspector", "mappings", "bindings"]],
- [undefined, ["inspector", "mappings", "bindings"]],
- [{ captures: true }, ["inspector", "mappings", "bindings"]],
- [{ captures: true, mappings: true, bindings: false }, ["inspector", "mappings"]],
- [{ captures: false, mappings: false, bindings: false }, []],
+ [null, ["events", "sources", "triggers", "inspector", "mappings", "bindings"]],
+ [undefined, ["events", "sources", "triggers", "inspector", "mappings", "bindings"]],
+ [{ captures: true, events: false }, ["inspector", "mappings", "bindings"]],
+ [{ events: false, captures: true, mappings: true, bindings: false }, ["inspector", "mappings"]],
+ [{ events: true, captures: false, mappings: false, bindings: false }, ["events", "sources", "triggers"]],
+ [{ events: false, captures: false, mappings: false, bindings: false }, []],
];
for (const [sections, expected] of cases) {
assert.deepEqual(availableTabs(sections).map((tab) => tab.id), expected, JSON.stringify(sections));
@@ -18,9 +19,10 @@ test("Events hides only capabilities explicitly disabled by the server", () => {
test("Events bookmarks select an available tab or fall back to the first", () => {
const cases: Array<[Record | null, string, string]> = [
[null, "mappings", "mappings"],
- [{ captures: false, mappings: false, bindings: true }, "inspector", "bindings"],
- [{ captures: false, mappings: false, bindings: true }, "", "bindings"],
- [{ captures: false, mappings: false, bindings: false }, "bindings", ""],
+ [{ events: false, captures: false, mappings: false, bindings: true }, "inspector", "bindings"],
+ [{ events: false, captures: false, mappings: false, bindings: true }, "", "bindings"],
+ [{ events: true, captures: false, mappings: false, bindings: false }, "bindings", "events"],
+ [{ events: false, captures: false, mappings: false, bindings: false }, "bindings", ""],
];
for (const [sections, requested, expected] of cases) {
assert.equal(activeTab(requested, availableTabs(sections)), expected, `${JSON.stringify(sections)}: ${requested}`);