Skip to content

armgit / mso

Public Imported from GitHub
0

Browser-based graphical shell and control plane for a Linux server you own — real terminal, file manager, live metrics and BYOK AI in one mobile-first workspace. Next.js 16 · React 19 · node-pty · Tailwind v4 · shadcn/ui. Public alpha, self-hosted.

547 B
Raw Blame
import { SCOPES, scopeRank, type Scope } from "./scope";

/** Deployment ceiling shared by transports and unattended workflow execution. */
export function configuredCapabilityCeiling(): Scope {
  const raw = process.env.OS_MCP_MAX_SCOPE;
  if (!raw) return "exec";
  const scope = raw.trim();
  return (SCOPES as readonly string[]).includes(scope) ? scope as Scope : "write";
}

export function clampScope(asked: Scope): Scope {
  const ceiling = configuredCapabilityCeiling();
  return scopeRank(asked) > scopeRank(ceiling) ? ceiling : asked;
}