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.
function hasKey<T extends object>(record: T, key: PropertyKey): key is keyof T {
return Object.hasOwn(record, key);
}
/** Looks up a dynamic key without widening a finite table to an open dictionary. */
export function recordLookup<T extends object>(
record: T,
key: PropertyKey,
): T[keyof T] | undefined {
return hasKey(record, key) ? record[key] : undefined;
}