Open-source Grok Bot alternative for named AI teammates. Local-first desktop, web, and mobile clients with per-bot tools, instructions, and memory. Independent fork of T3 Code.
import type { EnvironmentThreadStatus } from "@akeru/client-runtime/state/threads";
export type ThreadSyncPhase = "loading" | "syncing";
export function resolveThreadSyncPhase(input: {
readonly detailExists: boolean;
readonly shellExists: boolean;
readonly status: EnvironmentThreadStatus;
}): ThreadSyncPhase | null {
if (!input.shellExists) {
return null;
}
switch (input.status) {
case "empty":
case "cached":
case "synchronizing":
return input.detailExists ? "syncing" : "loading";
case "deleted":
case "live":
return null;
}
}
export function threadSyncLabel(phase: ThreadSyncPhase): string {
return phase === "loading" ? "Loading messages..." : "Syncing messages...";
}