Skip to content

armgit / pibot

Public Imported from GitHub
0

Open-source, local-first AI agent team for your desktop: multi-agent group chats, computer use, browser, MCP, routines and approvals. macOS, Windows, Linux + Android. Built on pi.

797 B
Raw Blame
/**
 * What the connected desktop said in the `app.about` handshake. `level` is absent when the
 * desktop predates the handshake (or did not answer): unknown, which never shows a notice.
 */
export interface DesktopAbout {
  computerId: string;
  version?: string;
  level?: number;
}
export type CompatNotice = "update_phone" | "update_desktop";

/**
 * Only the compatibility levels decide; different version numbers on the same level read each
 * other fine (new fields are dropped, unknown list items skipped), so they get no notice.
 */
export function compatNotice(phoneLevel: number, about?: DesktopAbout): CompatNotice | undefined {
  if (about?.level === undefined || about.level === phoneLevel) return undefined;
  return about.level > phoneLevel ? "update_phone" : "update_desktop";
}