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.

695 B
Raw Blame
import type { GroupConversation } from "@pibot/client-core";
import type { MessageFocusController } from "../../chat/messages/use-message-focus.ts";

export function groupFocusController(controller: GroupConversation): MessageFocusController {
  return {
    // GroupConversationView owns start/disposal. The shared hook waits for its loading snapshot.
    start: async () => {},
    subscribe: controller.subscribe,
    getSnapshot: () => {
      const state = controller.getSnapshot();
      return {
        ...state,
        loadingMore: state.paging || state.refreshing,
        historyError: state.error,
        metadataError: false,
      };
    },
    loadMore: controller.more,
  };
}