Files
kandev/apps/web/lib/session-working.ts
2026-08-23 17:39:09 +00:00

14 lines
425 B
TypeScript

import type { TaskSession } from "@/lib/types/http";
/** Returns whether a session still has live agent or background work. */
export function isSessionWorking(
session: Pick<TaskSession, "state" | "foreground_activity"> | null | undefined,
): boolean {
if (!session) return false;
return (
session.state === "STARTING" ||
session.state === "RUNNING" ||
session.foreground_activity === "background"
);
}