
Company News
Jerod Santo Joins Socket as Head of Media
Allow myself to introduce... myself.
@glyphicjs/schema
Advanced tools
Zod schema for Glyphic diagram inputs — the typed, machine-first contract LLMs emit instead of fragile DSLs or raw SVG.
The Zod validation layer for Glyphic — the strict, machine-first contract that LLMs target. Install this if you want to validate model output (or any untrusted input) before handing it to the renderer, or to generate a JSON Schema for tool definitions.
npm install @glyphicjs/schema
Glyphic's whole premise is that models emit JSON, not a DSL. @glyphicjs/schema is that JSON contract, expressed once as a Zod schema and reused everywhere — @glyphicjs/core validates with it, the MCP server exposes it as a tool's inputSchema, and the HTTP API rejects bad payloads with it. Every field carries a .describe() so the generated JSON Schema is self-documenting for the model.
import { DiagramInput } from "@glyphicjs/schema";
// Throws a ZodError with precise, fixable messages on invalid input.
const diagram = DiagramInput.parse(untrustedJson);
// Or handle errors yourself:
const result = DiagramInput.safeParse(untrustedJson);
if (!result.success) {
console.error(result.error.issues);
}
DiagramInput is a discriminated union on the type field, so validation routes to the right shape automatically:
{ "type": "flowchart", "nodes": [/* ... */], "edges": [/* ... */] }
{ "type": "erd", "entities": [/* ... */], "relationships": [/* ... */] }
{ "type": "pie", "data": [/* ... */] }
import { DiagramInput } from "@glyphicjs/schema";
import { zodToJsonSchema } from "zod-to-json-schema";
const jsonSchema = zodToJsonSchema(DiagramInput);
// → feed to an LLM tool definition so the model knows the exact shape.
DiagramInput — the discriminated union of all 18 types.NodeEdgeDiagram (flowchart/architecture), SequenceDiagram, PieChart, QuadrantChart, Mindmap, GanttChart, SankeyDiagram, GitGraph, CanvasDiagram, StateDiagram, ErdDiagram, ClassDiagram, TimelineDiagram, JourneyDiagram, KanbanDiagram, C4Diagram, TreemapDiagram, plus ThemeConfig.DiagramInputType, NodeEdgeDiagramType, ErdDiagramType, … (one per schema).z and ZodError — re-exported so downstream packages share a single Zod instance (keeps instanceof ZodError reliable across the workspace).The schema is also the first line of defense:
.max() caps on every array (nodes, edges, entities, elements, …) to bound layout/render cost.customFontUrl must be a valid HTTPS URL; fontFamily is restricted to safe characters.canvas/treemap inputs are bounded by depth and total node count.end or duration, pie values ≥ 0, journey scores 1–5).See the full field reference in the Diagram Types documentation.
MIT
FAQs
Zod schema for Glyphic diagram inputs — the typed, machine-first contract LLMs emit instead of fragile DSLs or raw SVG.
We found that @glyphicjs/schema demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Company News
Allow myself to introduce... myself.

Research
/Security News
A Twitch browser extension on Chrome and Firefox forwards users’ live OAuth session tokens through proxies controlled by a Russian bot service.

Security News
Anthropic found biased reasoning and recklessness drove Claude Mythos 5 to publish malware on PyPI and compromise a security vendor.