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.

1.0 KB
Raw Blame
import { configuredCapabilityCeiling } from "@/lib/capabilities/scope-policy";
// MCP-specific policy layered on the transport-neutral capability scope.
export { SCOPES, allows, parseScope, type Scope } from "@/lib/capabilities/scope";
import { type Scope } from "@/lib/capabilities/scope";
export { clampScope } from "@/lib/capabilities/scope-policy";

/** OAuth scope strings are cumulative so a standards-compliant host can see that an exec token also satisfies read/write tool schemes. */
export function oauthScopeString(scope: Scope, offline = false): string {
  const values = scope === "read" ? ["read"] : scope === "write" ? ["read", "write"] : ["read", "write", "exec"];
  if (offline) values.push("offline_access");
  return values.join(" ");
}

export function mcpEnabled(): boolean {
  if (process.env.NEXT_PUBLIC_OS_DEMO === "1") return false;
  return process.env.OS_MCP_ENABLED === "1";
}

export function maxScope(): Scope {
  return configuredCapabilityCeiling();
}

export function defaultConsentScope(ceiling: Scope): Scope { return ceiling; }