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.
export function resolveBrowserRecordingStopTarget(
activeTabIds: ReadonlySet<string>,
implicitTabId: string | null,
explicitTabId?: string,
): string | null {
if (explicitTabId !== undefined) {
return activeTabIds.has(explicitTabId) ? explicitTabId : null;
}
if (implicitTabId !== null && activeTabIds.has(implicitTabId)) {
return implicitTabId;
}
if (activeTabIds.size !== 1) return null;
return activeTabIds.values().next().value ?? null;
}