@womp/flowir
v0.3.0
Published
Typed intermediate representation for node-based computation graphs — schema registry, parser, semantic validator, and LLM prompt utilities.
Keywords
Readme
@womp/flowir
Typed intermediate representation for node-based computation graphs — schema registry, parser, semantic validator, and LLM prompt utilities.
Install
npm install @womp/flowirQuick Start
import { Registry, compile, formatDiagnostics } from "@womp/flowir"
const registry = Registry.fromJsonObject(dialectJson)
const result = compile(source, registry)
if (!result.ok) console.error(formatDiagnostics(result))API
| Export | Description |
|--------|-------------|
| Registry | Load a dialect JSON; query nodes, ports, enums, casts |
| compile | Parse + validate source against a registry |
| parse | Parse source into an AstProgram |
| jsonToProgram | Build an AstProgram from a JSON object |
| formatDiagnostics | Pretty-print errors with source context and fix hints |
| renderSchemaBlock | Render dialect schema for LLM prompts |
| renderDslRulesBlock | Render validation rules for LLM prompts |
| buildOutputSchema | Zod schema for structured LLM output |
