Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

1.0 KB
Raw Blame
/**
 * Native OS notification (Windows toast / macOS Notification Center / Linux) for
 * events worth surfacing even when the user isn't looking at the app, e.g. a
 * generation or workflow run finishing while they're in another window. Plays
 * each platform's own default notification sound (the toast isn't `silent`).
 *
 * Skipped when the app window already has focus: the user is looking right at
 * it, so a toast on top would just be noise.
 */
async function notifyIfUnfocused(title: string, body: string): Promise<void> {
  if (typeof document !== 'undefined' && document.hasFocus()) return
  try {
    await window.electron.notifications.show(title, body)
  } catch {
    // Notifications not available (e.g. unsupported platform)
  }
}

export function showCompletionNotification(body: string, title = 'three.ws Forge'): Promise<void> {
  return notifyIfUnfocused(title, body)
}

export function showErrorNotification(body: string, title = 'three.ws Forge'): Promise<void> {
  return notifyIfUnfocused(title, body)
}