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 { Routine, RoutineReceiptSource } from "@akeru/contracts";
/** Keep deleted routine labels in chat without sending their full definitions. */
export function toRoutineReceiptSource(routine: Routine): RoutineReceiptSource {
return {
id: routine.id,
targetThreadId: routine.targetThreadId,
job: routine.job,
createdAt: routine.createdAt,
};
}
export function deletedRoutineReceiptSources(
routines: ReadonlyArray<Routine>,
): RoutineReceiptSource[] {
return routines.flatMap((routine) =>
routine.deletedAt !== null ? [toRoutineReceiptSource(routine)] : [],
);
}