Skip to content

Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.

553 B
Raw Blame
import { useCallback, useRef, useState } from "react";

/** The host owns intent across Canvas recreation; the renderer acknowledges it. */
export function useCompanionFocusRequests() {
  const sequence = useRef(0);
  const [pending, setPending] = useState(0);
  const request = useCallback(() => setPending(++sequence.current), []);
  const acknowledge = useCallback((id: number) => setPending((current) => current === id ? 0 : current), []);
  const cancel = useCallback(() => setPending(0), []);
  return { pending, request, acknowledge, cancel };
}