Add dashboard room activity timeline

This commit is contained in:
Eyejoker
2026-04-27 11:46:35 +09:00
committed by GitHub
parent d7fe6fa13a
commit d28068f646
8 changed files with 1031 additions and 2 deletions

View File

@@ -92,6 +92,57 @@ export interface StatusSnapshot {
}>;
}
export interface DashboardRoomActivity {
serviceId: string;
jid: string;
name: string;
folder: string;
agentType: string;
status: 'processing' | 'waiting' | 'inactive';
elapsedMs: number | null;
pendingMessages: boolean;
pendingTasks: number;
messages: Array<{
id: string;
sender: string;
senderName: string;
content: string;
timestamp: string;
isFromMe: boolean;
isBotMessage: boolean;
sourceKind: string;
}>;
pairedTask: {
id: string;
title: string | null;
status: string;
roundTripCount: number;
updatedAt: string;
currentTurn: {
turnId: string;
role: string;
intentKind: string;
state: string;
attemptNo: number;
executorServiceId: string | null;
executorAgentType: string | null;
activeRunId: string | null;
createdAt: string;
updatedAt: string;
completedAt: string | null;
lastError: string | null;
} | null;
outputs: Array<{
id: number;
turnNumber: number;
role: string;
verdict: string | null;
createdAt: string;
outputText: string;
}>;
} | null;
}
export interface DashboardTask {
id: string;
groupFolder: string;
@@ -180,6 +231,14 @@ export async function fetchDashboardData(): Promise<{
return { overview, snapshots, tasks };
}
export async function fetchRoomTimeline(
roomJid: string,
): Promise<DashboardRoomActivity> {
return fetchJson<DashboardRoomActivity>(
`/api/rooms/${encodeURIComponent(roomJid)}/timeline`,
);
}
export async function runScheduledTaskAction(
taskId: string,
action: DashboardTaskAction,