feat(dashboard): run paired inbox actions (#34)

This commit is contained in:
Eyejoker
2026-04-27 02:39:41 +09:00
committed by GitHub
parent 1676f53f4d
commit 16aeb0449d
5 changed files with 493 additions and 0 deletions

View File

@@ -101,6 +101,7 @@ export interface DashboardTask {
}
export type DashboardTaskAction = 'pause' | 'resume' | 'cancel';
export type DashboardInboxAction = 'run';
async function fetchJson<T>(path: string): Promise<T> {
const response = await fetch(path, {
@@ -162,6 +163,21 @@ export async function runScheduledTaskAction(
});
}
export async function runInboxAction(
inboxId: string,
action: DashboardInboxAction,
): Promise<{
ok: true;
id: string;
taskId: string;
intentKind: string;
queued: boolean;
}> {
return postJson(`/api/inbox/${encodeURIComponent(inboxId)}/actions`, {
action,
});
}
export async function sendRoomMessage(
roomJid: string,
text: string,