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.

586 B
Raw Blame
import type { AppDescriptor } from "../../lib/types";

export type Command = {
  id: string;
  label: string;
  hint: string;
  run: () => void;
  app?: AppDescriptor;
  /** Extra match terms beyond the label (dynamic commands). */
  keywords?: string;
};

// Subsequence match (typing "cdr" hits "Code Editor"). Cheap, no fuzzy lib.
export function matches(q: string, text: string): boolean {
  if (!q) return true;
  const s = text.toLowerCase();
  let i = 0;
  for (const c of q.toLowerCase()) {
    i = s.indexOf(c, i);
    if (i === -1) return false;
    i++;
  }
  return true;
}