Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

772 B
Raw Blame
// The one "Sign in with Boat" connection of this server process, for the modules that only need to ask about it
// (server/config.ts marks a loaded config with it; server/boat-call.ts takes its bearer). Null wherever sign-in is not
// offered, and then every Boat call uses the pasted key or the plan's included computers exactly as before.
import type { BoatSignIn } from "./boat-sign-in.ts";

let active: BoatSignIn | null = null;

export function setBoatSignIn(signIn: BoatSignIn | null): void {
  active = signIn;
}

export const boatSignIn = (): BoatSignIn | null => active;

/** The sign-in, not the pasted key, is the credential in use: alone, or set after the key. */
export const boatSignInUsed = (keySaved: boolean): boolean => active?.used(keySaved) === true;