feat: global activity feed + session digest
Ops "Executions" tab showed raw target UUIDs, alphabetical (not
recency) order, and a stale status vocabulary from an earlier schema
iteration — never actually usable as a live "what's happening" view.
Replaced with a new recency-ordered /api/v1/activity/recent endpoint
and matching table (human-readable action summaries, risk/status
badges, duration, inline error preview).
Also added /api/v1/activity/session/{id} + a collapsible SessionDigest
panel in the chat rail, answering "what did this session actually do"
(executions by status, entities touched, knowledge written) — the
missing piece for proactive outcome reporting to be visible in the UI,
not just in the chat transcript.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -242,6 +242,41 @@ export async function cancelExecution(id: string): Promise<Execution | null> {
|
||||
return res.json()
|
||||
}
|
||||
|
||||
export interface ActivityItem {
|
||||
id: string
|
||||
target: string
|
||||
verb: string
|
||||
summary: string
|
||||
risk_class: string
|
||||
status: string
|
||||
duration_ms: number | null
|
||||
error?: string
|
||||
created_at: string
|
||||
completed_at: string | null
|
||||
}
|
||||
|
||||
export async function fetchRecentActivity(limit = 50): Promise<ActivityItem[]> {
|
||||
const res = await fetch(`${API}/activity/recent?limit=${limit}`)
|
||||
if (!res.ok) return []
|
||||
const data = await res.json()
|
||||
return data.items ?? []
|
||||
}
|
||||
|
||||
export interface SessionDigest {
|
||||
session_id: string
|
||||
total_executions: number
|
||||
by_status: Record<string, number>
|
||||
entities_touched: string[]
|
||||
executions: { target: string; verb: string; summary: string; risk_class: string; status: string }[]
|
||||
knowledge_created: string[]
|
||||
}
|
||||
|
||||
export async function fetchSessionDigest(sessionId: string): Promise<SessionDigest | null> {
|
||||
const res = await fetch(`${API}/activity/session/${sessionId}`)
|
||||
if (!res.ok) return null
|
||||
return res.json()
|
||||
}
|
||||
|
||||
export interface Signal {
|
||||
id: string
|
||||
slug: string
|
||||
|
||||
Reference in New Issue
Block a user