diff --git a/ui/src/archie/AgentModelEditor.vue b/ui/src/archie/AgentModelEditor.vue
new file mode 100644
index 000000000..ed846dedd
--- /dev/null
+++ b/ui/src/archie/AgentModelEditor.vue
@@ -0,0 +1,145 @@
+
+
+
+
+
diff --git a/ui/src/archie/App.vue b/ui/src/archie/App.vue
index 63158c699..e4de6e847 100644
--- a/ui/src/archie/App.vue
+++ b/ui/src/archie/App.vue
@@ -31,13 +31,18 @@ function signOut() {
Archie
-
+
+
+
+
diff --git a/ui/src/archie/SourcesView.vue b/ui/src/archie/SourcesView.vue
new file mode 100644
index 000000000..da67e4053
--- /dev/null
+++ b/ui/src/archie/SourcesView.vue
@@ -0,0 +1,186 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Deliver to {{ issued.url }}
+
+
+
+ No sources yet
+
+
+
+
+ {{ src.token_set ? "Token set" : "No token" }}
+
+
+
+
+ {{ src.connector }}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ saved }}
+
+
+
diff --git a/ui/src/archie/SystemSettings.vue b/ui/src/archie/SystemSettings.vue
new file mode 100644
index 000000000..2ed855982
--- /dev/null
+++ b/ui/src/archie/SystemSettings.vue
@@ -0,0 +1,104 @@
+
+
+
+
+
+
+
+
+
+
+
+
{{ error }}
+
+
+
+
+
+
+
+
+
This is the only time the token is shown.
+
+
+
+
diff --git a/ui/src/archie/TriggersView.vue b/ui/src/archie/TriggersView.vue
new file mode 100644
index 000000000..fbf7bd19d
--- /dev/null
+++ b/ui/src/archie/TriggersView.vue
@@ -0,0 +1,235 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ No triggers yet
+
+
+ {{ saved }}
+
+
+
diff --git a/ui/src/archie/api.ts b/ui/src/archie/api.ts
index caea021dd..9c6ef54da 100644
--- a/ui/src/archie/api.ts
+++ b/ui/src/archie/api.ts
@@ -4,6 +4,16 @@ const TOKEN_KEY = "archie.adminToken";
export class Unauthorized extends Error {}
+/** A failed request, with the status the server answered. */
+export class ApiError extends Error {
+ readonly status: number;
+
+ constructor(message: string, status: number) {
+ super(message);
+ this.status = status;
+ }
+}
+
export const token = (): string => sessionStorage.getItem(TOKEN_KEY) ?? "";
export const setToken = (value: string) => sessionStorage.setItem(TOKEN_KEY, value);
export const clearToken = () => sessionStorage.removeItem(TOKEN_KEY);
@@ -13,7 +23,7 @@ async function request(path: string, signal?: AbortSignal): Promise {
if (res.status === 401) throw new Unauthorized("The admin token was refused.");
if (!res.ok) {
const body = (await res.json().catch(() => ({}))) as { error?: string };
- throw new Error(body.error ?? `${res.status} ${res.statusText}`);
+ throw new ApiError(body.error ?? `${res.status} ${res.statusText}`, res.status);
}
return res;
}
@@ -267,7 +277,7 @@ async function send(method: string, path: string, payload?: unknown): Promise
if (res.status === 401) throw new Unauthorized("The admin token was refused.");
if (!res.ok) {
const body = (await res.json().catch(() => ({}))) as { error?: string };
- throw new Error(body.error ?? `${res.status} ${res.statusText}`);
+ throw new ApiError(body.error ?? `${res.status} ${res.statusText}`, res.status);
}
return (await res.json().catch(() => undefined)) as T;
}
@@ -429,6 +439,191 @@ export const dryRunDraft = (id: string) => send("POST", `/api/drafts/${en
export const publishDraft = (id: string) => send("POST", `/api/drafts/${encodeURIComponent(id)}/publish`);
export const listRuns =(signal?: AbortSignal) => get("/api/runs", signal);
+
+/** A setting an extension declares. Its type decides the control the form shows. */
+export interface SettingDecl {
+ key: string;
+ label: string;
+ description?: string;
+ secret?: boolean;
+ required?: boolean;
+ type?: "string" | "number" | "boolean" | "duration" | "list" | "select" | "text";
+ options?: string[];
+}
+
+export type ExtensionContract = "connector" | "secretengine" | "guard" | "mcp";
+
+const extensionPath: Record = {
+ connector: "connectors",
+ secretengine: "secret-engines",
+ guard: "guards",
+ mcp: "mcp-servers",
+};
+
+/** An accepted package: what it is, whether it runs, and what it was given. */
+export interface Extension {
+ name: string;
+ contract: ExtensionContract;
+ state: "running" | "failed" | "stopped";
+ error?: string;
+ version?: string;
+ digest: string;
+ path?: string;
+ url?: string;
+ args?: string[];
+ egress: string[];
+ env: string[];
+ settings: Record;
+ settings_schema: SettingDecl[];
+ credentials: Record;
+ tools?: unknown;
+}
+
+/** What a credential field is: a stored value, or the engine and key resolving it. */
+export interface CredentialField {
+ value?: string;
+ engine?: string;
+ key?: string;
+}
+
+export interface CredentialView {
+ name: string;
+ kind: "machine" | "age" | "basic" | "bearer";
+ fields: Record;
+}
+
+export interface AgentModel {
+ class: string;
+ base_url: string;
+ model: string;
+ /** The credential holding the token; the token itself is never returned. */
+ api_key_credential?: string;
+}
+
+export interface BootstrapView {
+ listen: string;
+ database_host: string;
+ schemas: number;
+ admin_token_hash_prefix: string;
+ admin_token_set: boolean;
+ sealing_identity_set: boolean;
+}
+
+export interface SourceView {
+ name: string;
+ connector: string;
+ key_fields: string[];
+ token_set: boolean;
+}
+
+export interface TriggerView {
+ name: string;
+ source: string;
+ event_type: string;
+ filter: Record;
+ workflow: string;
+ enabled: boolean;
+ every?: string;
+}
+
+export interface EventRow {
+ id: string;
+ source: string;
+ type: string;
+ fields: unknown;
+ linked_to?: string;
+ occurred_at?: string;
+ received_at: string;
+ matched: boolean;
+ dispatched_at?: string;
+}
+
+export interface EventDetail extends EventRow {
+ body: unknown;
+ runs: { trigger: string; run_id: string }[];
+}
+
+export interface JudgeControl {
+ name: string;
+ version?: string;
+ digest?: string;
+ advisory: boolean;
+ settings: Record;
+ settings_schema: SettingDecl[];
+ latest?: {
+ model?: string;
+ trusted: boolean;
+ advisory_reason?: string;
+ eval_date?: string;
+ answer?: string;
+ at: string;
+ };
+}
+
+export const listExtensions = (contract: ExtensionContract, signal?: AbortSignal) =>
+ get(`/api/${extensionPath[contract]}`, signal);
+
+export interface AcceptRequest {
+ path?: string;
+ sha256?: string;
+ url?: string;
+ args?: string[];
+ egress?: string[];
+ env?: string[];
+ settings?: Record;
+ credentials?: Record;
+ tools?: unknown[];
+}
+
+export const acceptExtension = (contract: ExtensionContract, name: string, body: AcceptRequest) =>
+ send<{ name: string; state: string }>("PUT", `/api/${extensionPath[contract]}/${encodeURIComponent(name)}`, body);
+
+export const removeExtension = (contract: ExtensionContract, name: string) =>
+ send<{ name: string; state: string }>("DELETE", `/api/${extensionPath[contract]}/${encodeURIComponent(name)}`);
+
+export const listCredentials = (signal?: AbortSignal) => get("/api/credentials", signal);
+export const getCredential = (name: string, signal?: AbortSignal) =>
+ get(`/api/credentials/${encodeURIComponent(name)}`, signal);
+export const saveCredential = (name: string, kind: CredentialView["kind"], fields: Record) =>
+ send<{ name: string; kind: string; restarted: string[] }>("PUT", `/api/credentials/${encodeURIComponent(name)}`, { kind, fields });
+
+export const getAgentModel = (signal?: AbortSignal) => get("/api/settings/agent-model", signal);
+export const saveAgentModel = (model: AgentModel) =>
+ send("PUT", "/api/settings/agent-model", model);
+export const testAgentModel = (model: AgentModel) =>
+ send<{ model: string; answer: string }>("POST", "/api/settings/agent-model/test", model);
+
+export const getBootstrap = (signal?: AbortSignal) => get("/api/system/bootstrap", signal);
+export const rotateAdminToken = () => send<{ token: string }>("POST", "/api/admin/token");
+
+export const listSources = (signal?: AbortSignal) => get("/api/sources", signal);
+export const putSource = (name: string, connector: string) =>
+ send<{ source: string; token: string; url: string }>("PUT", `/api/sources/${encodeURIComponent(name)}`, { connector });
+export const putKeyFields = (name: string, paths: string[]) =>
+ send<{ key_fields: string[] }>("PUT", `/api/sources/${encodeURIComponent(name)}/key-fields`, { paths });
+
+export const listTriggers = (signal?: AbortSignal) => get("/api/triggers", signal);
+export const saveTrigger = (
+ name: string,
+ trigger: { source: string; event_type: string; filter: Record; workflow: string; disabled: boolean; every?: string },
+) => send<{ trigger: string }>("PUT", `/api/triggers/${encodeURIComponent(name)}`, trigger);
+
+export async function listEvents(
+ params: { source?: string; type?: string; matched?: boolean; limit?: number },
+ signal?: AbortSignal,
+): Promise {
+ const query = new URLSearchParams();
+ if (params.source) query.set("source", params.source);
+ if (params.type) query.set("type", params.type);
+ if (params.matched !== undefined) query.set("matched", String(params.matched));
+ if (params.limit) query.set("limit", String(params.limit));
+ return get(`/api/events?${query.toString()}`, signal);
+}
+
+export const getEvent = (id: string, signal?: AbortSignal) =>
+ get(`/api/events/${encodeURIComponent(id)}`, signal);
+
+export const listJudges = (signal?: AbortSignal) => get("/api/controls/judges", signal);
export const runTrail = (id: string, signal?: AbortSignal) => get(`/api/runs/${encodeURIComponent(id)}`, signal);
/**
diff --git a/ui/src/archie/router.ts b/ui/src/archie/router.ts
index a23c92d9d..aff812d8f 100644
--- a/ui/src/archie/router.ts
+++ b/ui/src/archie/router.ts
@@ -11,6 +11,11 @@ export default createRouter({
{ path: "/classes/:id", name: "class", component: () => import("./ClassView.vue"), props: true },
{ path: "/people", name: "people", component: () => import("./PeopleView.vue") },
{ path: "/controls", name: "controls", component: () => import("./ControlsView.vue") },
+ { path: "/extensions", name: "extensions", component: () => import("./ExtensionsView.vue") },
+ { path: "/sources", name: "sources", component: () => import("./SourcesView.vue") },
+ { path: "/triggers", name: "triggers", component: () => import("./TriggersView.vue") },
+ { path: "/events", name: "events", component: () => import("./EventsView.vue") },
+ { path: "/credentials", name: "credentials", component: () => import("./CredentialsView.vue") },
{ path: "/settings", name: "settings", component: () => import("./SettingsView.vue") },
{ path: "/runs/:id", name: "run", component: () => import("./RunView.vue"), props: true },
],