Skip to content

Linger is An Open-Source Personal Agent That Runs Fully on Your PC. We aim to break Big Tech’s grip on AI by bringing powerful local AI to everyday computers through efficient model–harness co-design, so everyone can run their own.

1.1 KB
Raw Blame
import type { Message } from "@/i18n/messages";

import type { PanelTabKind } from "./panel-tab-types";
import { sidePanelMessages as m } from "./side-panel.messages";

const ALL_PANEL_CREATE_ITEMS = [
  {
    kind: "file",
    label: m.documents,
  },
  {
    kind: "agentInfo",
    label: m.agentInfo,
  },
  {
    kind: "roomInfo",
    label: m.roomInfo,
  },
  {
    kind: "collaboration",
    label: m.collaboration,
  },
] as const satisfies { kind: PanelTabKind; label: Message<string> }[];

export type PanelCreateChoice = (typeof ALL_PANEL_CREATE_ITEMS)[number]["kind"];

/** Keep the general launcher focused on Documents; Agent info is DM-scoped. */
export const PANEL_HIDDEN_CREATE_KINDS = new Set<PanelCreateChoice>([
  "roomInfo",
]);

export function panelCreateItems(includeAgentInfo = false) {
  return ALL_PANEL_CREATE_ITEMS.filter((item) =>
    isPanelCreateChoiceEnabled(item.kind, includeAgentInfo),
  );
}

export function isPanelCreateChoiceEnabled(
  choice: PanelCreateChoice,
  includeAgentInfo = false,
) {
  return (
    !PANEL_HIDDEN_CREATE_KINDS.has(choice) &&
    (choice !== "agentInfo" || includeAgentInfo)
  );
}