Publish Claude Code Binaries / Stage and publish binaries (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-arm64 (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build linux-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build windows-amd64 (push) Canceled after 0s
Sync Tutti Agent Skills / sync (push) Canceled after 0s
Windows Agent Adapters / Test Windows agent adapters (push) Canceled after 0s
Windows Daemon Adapters / Test Windows daemon adapters (push) Canceled after 0s
Publish Tutti App Runtime / Publish runtime catalog (push) Canceled after 0s
43 lines
1.2 KiB
TypeScript
43 lines
1.2 KiB
TypeScript
import { type AgentActivitySession } from "@tutti-os/agent-activity-core";
|
|
import type { WorkspaceAgentActivityStatus } from "./workspaceAgentActivityListTypes";
|
|
|
|
export function resolveWorkspaceAgentActivityStatus(
|
|
session: AgentActivitySession
|
|
): WorkspaceAgentActivityStatus {
|
|
const normalized = canonicalSessionStatus(session);
|
|
switch (normalized) {
|
|
case "failed":
|
|
return "failed";
|
|
case "canceled":
|
|
return "canceled";
|
|
case "completed":
|
|
return "completed";
|
|
case "waiting":
|
|
return "waiting";
|
|
case "working":
|
|
return "working";
|
|
default:
|
|
return "idle";
|
|
}
|
|
}
|
|
|
|
function canonicalSessionStatus(
|
|
session: AgentActivitySession
|
|
): WorkspaceAgentActivityStatus {
|
|
if ((session.pendingInteractions?.length ?? 0) > 0) return "waiting";
|
|
if (session.activeTurn && session.activeTurn.phase !== "settled") {
|
|
return session.activeTurn.phase === "waiting" ? "waiting" : "working";
|
|
}
|
|
switch (session.latestTurn?.outcome) {
|
|
case "completed":
|
|
return "completed";
|
|
case "failed":
|
|
return "failed";
|
|
case "canceled":
|
|
case "interrupted":
|
|
return "canceled";
|
|
default:
|
|
return "idle";
|
|
}
|
|
}
|