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.
TypeScript browser-shellcontrol-planefile-managerhomelabmobile-firstnextjsptyreactself-hostedserver-managementshadcn-uisysadmintailwindcssterminaltypescriptvpsweb-desktopweb-terminal
import { describe, expect, it } from "vitest";
import { parseWorkflowGraphDefinition } from "./graph-schema";
const base = () => ({
name: "Deploy app", description: "generic", status: "draft", inputs: {}, metadata: {},
nodes: [
{ id: "start", name: "Start", type: "manual", position: { x: 0, y: 0 }, config: {} },
{ id: "done", name: "Done", type: "output", position: { x: 200, y: 0 }, config: {} },
], edges: [{ id: "e1", source: "start", target: "done" }],
});
describe("workflow graph schema", () => {
it("accepts a bounded acyclic metadata-only graph", () => expect(parseWorkflowGraphDefinition(base()).nodes).toHaveLength(2));
it("preserves a valid offset schedule and rejects invalid schedules before save", () => {
const config = { mode: "runAt", runAt: "2026-10-19T09:00:30+07:00", missedPolicy: "run_once" };
const definition = { ...base(), nodes: [{ ...base().nodes[0], type: "schedule", config }, base().nodes[1]] };
expect(parseWorkflowGraphDefinition(definition).nodes[0].config).toEqual(config);
for (const invalid of [{ ...config, runAt: "2026-10-19T09:00:30" }, { ...config, mode: "once" }, { ...config, missedPolicy: "skip" }, { ...config, timezone: "Mars/Olympus" }]) {
expect(() => parseWorkflowGraphDefinition({ ...definition, nodes: [{ ...definition.nodes[0], config: invalid }, definition.nodes[1]] })).toThrow();
}
expect(() => parseWorkflowGraphDefinition({ ...definition, metadata: { timezone: "Mars/Olympus" } })).toThrow(/timezone/);
});
it("rejects cycles", () => expect(() => parseWorkflowGraphDefinition({ ...base(), nodes: [{ id: "a", name: "A", type: "tool", position: { x: 0, y: 0 }, config: { tool: "x" } }, { id: "b", name: "B", type: "output", position: { x: 200, y: 0 }, config: {} }], edges: [{ id: "e1", source: "a", target: "b" }, { id: "e2", source: "b", target: "a" }] })).toThrow("cycle"));
it("rejects secret-like config fields recursively", () => expect(() => parseWorkflowGraphDefinition({ ...base(), nodes: [{ id: "start", name: "Start", type: "tool", position: { x: 0, y: 0 }, config: { nested: { accessToken: "x" } } }, base().nodes[1]] })).toThrow("secret_input_forbidden"));
it("persists edge style/active state and ignores disabled edges for topology", () => {
const parsed = parseWorkflowGraphDefinition({
...base(),
edges: [
{ id: "e1", source: "start", target: "done", style: "dashed", disabled: true },
{ id: "e2", source: "done", target: "start", style: "solid", disabled: true },
],
});
expect(parsed.edges).toEqual([
{ id: "e1", source: "start", target: "done", style: "dashed", disabled: true },
{ id: "e2", source: "done", target: "start", style: "solid", disabled: true },
]);
expect(() => parseWorkflowGraphDefinition({ ...base(), edges: [{ id: "bad", source: "start", target: "done", style: "dots" }] })).toThrow("edge style");
});
it("accepts parity node types but keeps triggers root-only", () => {
expect(parseWorkflowGraphDefinition({ ...base(), nodes: [{ id: "start", name: "Schedule", type: "schedule", position: { x: 0, y: 0 }, config: { mode: "interval", everyMinutes: 5 } }, { id: "repeat", name: "Repeat", type: "repeat", position: { x: 100, y: 0 }, config: { workflowId: "saved-workflow", path: "result.output", equals: true, maxIterations: 5 } }, { id: "wait", name: "Wait", type: "wait", position: { x: 200, y: 0 }, config: { delayMs: 0 } }, base().nodes[1]], edges: [{ id: "a", source: "start", target: "repeat" }, { id: "b", source: "repeat", target: "wait", sourceHandle: "done" }, { id: "c", source: "wait", target: "done" }] }).nodes.map((node) => node.type)).toEqual(["schedule", "repeat", "wait", "output"]);
expect(() => parseWorkflowGraphDefinition({ ...base(), nodes: [base().nodes[0], { id: "hook", name: "Hook", type: "webhook", position: { x: 100, y: 0 }, config: {} }], edges: [{ id: "bad", source: "start", target: "hook" }] })).toThrow("root");
});
});