Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

816 B
Raw Blame
interface ProfileToolVisibilityOptions {
  agentConnectorIdentifiers?: ReadonlySet<string> | null;
  nonConfigurableBuiltinToolIdentifiers: ReadonlySet<string>;
}

/**
 * Keep the Agent Profile count and selected chips aligned with the tools this
 * surface actually owns. Hidden config entries stay intact because another
 * activation mode or runtime flow may still use them; this surface simply must
 * not represent them as profile-managed Workspace Tools in the current mode.
 */
export const getVisibleProfileToolIds = (
  toolIds: string[],
  {
    agentConnectorIdentifiers,
    nonConfigurableBuiltinToolIdentifiers,
  }: ProfileToolVisibilityOptions,
): string[] =>
  toolIds.filter(
    (toolId) =>
      !nonConfigurableBuiltinToolIdentifiers.has(toolId) && !agentConnectorIdentifiers?.has(toolId),
  );