Skip to content

armgit / avibe

Public Imported from GitHub
0

Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.

788 B
Raw Blame
import type { SuspendedRouteAttempt } from "./RouteChainDialog";
import type { AgentBackend } from "./types";

export type SuspendedRouteAttempts = ReadonlyMap<
  AgentBackend,
  SuspendedRouteAttempt
>;

export const emptySuspendedRouteAttempts = (): SuspendedRouteAttempts =>
  new Map();

export const holdSuspendedRouteAttempt = (
  attempts: SuspendedRouteAttempts,
  attempt: SuspendedRouteAttempt,
): SuspendedRouteAttempts => {
  const next = new Map(attempts);
  next.set(attempt.backend, attempt);
  return next;
};

export const releaseSuspendedRouteAttempt = (
  attempts: SuspendedRouteAttempts,
  backend: AgentBackend,
): SuspendedRouteAttempts => {
  if (!attempts.has(backend)) return attempts;
  const next = new Map(attempts);
  next.delete(backend);
  return next;
};