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.
TypeScript agentai-agentai-agentsai-assistantandroidautomationchatgptcoding-agentcomputer-usedesktop-appelectronllmlocal-firstmcpmulti-agentollamaopenaiprivacyself-hostedtypescript
import type { Category, Level, PermissionLevels } from "@pibot/protocol";
import { tightenOverrides } from "@pibot/protocol";
/** Only callers holding application-owned built-in content may use this exception. */
export function builtinPermission(global: PermissionLevels, category: Category, level?: Level) {
if (category === "run_command" && level === "always")
return global.run_command === "never" ? undefined : "always";
return level === undefined
? undefined
: (tightenOverrides(global, { [category]: level }).overrides[category] as Level | undefined);
}