@hlang-org/ir
The hlang intermediate representation: IGraph types, validation, and the execution plan shared by the interpreter and the compiler. Version 1.0.1, 19 exports.
Classes
GraphError
Defined in: packages/ir/src/plan.ts:56
Thrown by planGraph when a graph violates hlang's rules.
Extends
Error
Constructors
Constructor
new GraphError(code, message): GraphError;Defined in: packages/ir/src/plan.ts:59
Parameters
| Parameter | Type |
|---|---|
code | GraphErrorCode |
message | string |
Returns
Overrides
Error.constructor
Properties
| Property | Modifier | Type | Defined in |
|---|---|---|---|
code | readonly | GraphErrorCode | packages/ir/src/plan.ts:57 |
Interfaces
ExecutionPlan
Defined in: packages/ir/src/plan.ts:38
A validated, backend-neutral program.
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
connections | readonly | readonly PlannedConnection[] | Connections in graph order. | packages/ir/src/plan.ts:42 |
nodes | readonly | readonly PlannedNode[] | Nodes in graph order. | packages/ir/src/plan.ts:40 |
roots | readonly | readonly string[] | Node ids of the Readable roots, in graph order. Never empty. | packages/ir/src/plan.ts:44 |
IBizData
Defined in: packages/ir/src/igraph.ts:38
Business data attached to a node; params is the user-facing config.
Indexable
[key: string]: unknownProperties
| Property | Modifier | Type | Defined in |
|---|---|---|---|
flowId? | readonly | string | packages/ir/src/igraph.ts:39 |
nodeId? | readonly | string | packages/ir/src/igraph.ts:40 |
params? | readonly | Readonly<Record<string, ParamValue>> | packages/ir/src/igraph.ts:41 |
IConnection
Defined in: packages/ir/src/igraph.ts:64
A single connection. Direction is inverted from intuition and MUST be
preserved: Output is the upstream source (an O port), Input is the
downstream target (an I port). Wiring is Output.O(id).connect(Input.I(id)).
Properties
| Property | Modifier | Type | Defined in |
|---|---|---|---|
Input | readonly | IConnectionEndpoint | packages/ir/src/igraph.ts:65 |
Output | readonly | IConnectionEndpoint | packages/ir/src/igraph.ts:66 |
IConnectionEndpoint
Defined in: packages/ir/src/igraph.ts:46
One endpoint of a connection, as serialized.
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
name? | readonly | string | - | packages/ir/src/igraph.ts:47 |
nodeId | readonly | string | - | packages/ir/src/igraph.ts:49 |
portConf? | readonly | object | Port configuration. The port is identified by id (its name), e.g. "Input" / "Output" / "@node/error". Both portConf and the legacy portConfig spelling appear across fixtures; readers must accept either. | packages/ir/src/igraph.ts:55 |
portConf.id | readonly | string | - | packages/ir/src/igraph.ts:55 |
portConf.type? | readonly | string | - | packages/ir/src/igraph.ts:55 |
portConfig? | readonly | Readonly<Record<string, unknown>> | - | packages/ir/src/igraph.ts:56 |
type? | readonly | NodeKind | - | packages/ir/src/igraph.ts:48 |
IGraph
Defined in: packages/ir/src/igraph.ts:100
The complete serialized graph.
Properties
| Property | Modifier | Type | Defined in |
|---|---|---|---|
connections | readonly | readonly IConnection[] | packages/ir/src/igraph.ts:102 |
deps? | readonly | readonly IPackageInfo[] | packages/ir/src/igraph.ts:101 |
nodeList | readonly | readonly INodeInfo[] | packages/ir/src/igraph.ts:103 |
INodeInfo
Defined in: packages/ir/src/igraph.ts:76
A node entry in the graph's node list.
Indexable
[key: string]: unknownProperties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
bizData? | readonly | IBizData | - | packages/ir/src/igraph.ts:83 |
code | readonly | string | Node type key. A backend resolves it to a runtime node class. | packages/ir/src/igraph.ts:78 |
groupCode? | readonly | string | - | packages/ir/src/igraph.ts:86 |
name | readonly | string | - | packages/ir/src/igraph.ts:79 |
nodeId | readonly | string | Stable per-instance id used to correlate nodes and connections. | packages/ir/src/igraph.ts:82 |
portInfo? | readonly | IPortInfo | - | packages/ir/src/igraph.ts:84 |
position? | readonly | object | - | packages/ir/src/igraph.ts:85 |
position.x | readonly | number | - | packages/ir/src/igraph.ts:85 |
position.y | readonly | number | - | packages/ir/src/igraph.ts:85 |
runtimeResource? | readonly | string | npm coordinate of the runtime implementation, e.g. "pkg@1.2.3". | packages/ir/src/igraph.ts:88 |
type | readonly | NodeKind | - | packages/ir/src/igraph.ts:80 |
IPackageInfo
Defined in: packages/ir/src/igraph.ts:93
A dependency descriptor (populated by the compiler; optional for interpret).
Properties
| Property | Modifier | Type | Defined in |
|---|---|---|---|
local? | readonly | boolean | packages/ir/src/igraph.ts:96 |
name | readonly | string | packages/ir/src/igraph.ts:94 |
version? | readonly | string | packages/ir/src/igraph.ts:95 |
IParamObject
Defined in: packages/ir/src/igraph.ts:30
Object-valued parameters. Declared as an interface (not a Record alias) so
the recursive ParamValue reference resolves without a circular-alias error.
Indexable
[key: string]: ParamValueIPortInfo
Defined in: packages/ir/src/igraph.ts:70
Port metadata carried on a node (the design-time port descriptors).
Properties
| Property | Modifier | Type | Defined in |
|---|---|---|---|
Input? | readonly | readonly Readonly<Record<string, unknown>>[] | packages/ir/src/igraph.ts:71 |
Output? | readonly | readonly Readonly<Record<string, unknown>>[] | packages/ir/src/igraph.ts:72 |
PlannedConnection
Defined in: packages/ir/src/plan.ts:32
source is an output (O) port; target is an input (I) port.
Properties
| Property | Modifier | Type | Defined in |
|---|---|---|---|
source | readonly | PlannedEndpoint | packages/ir/src/plan.ts:33 |
target | readonly | PlannedEndpoint | packages/ir/src/plan.ts:34 |
PlannedEndpoint
Defined in: packages/ir/src/plan.ts:26
One end of a planned connection.
Properties
| Property | Modifier | Type | Defined in |
|---|---|---|---|
nodeId | readonly | string | packages/ir/src/plan.ts:27 |
portId | readonly | string | packages/ir/src/plan.ts:28 |
PlannedNode
Defined in: packages/ir/src/plan.ts:18
A node to construct. config is passed to the node constructor.
Properties
| Property | Modifier | Type | Defined in |
|---|---|---|---|
code | readonly | string | packages/ir/src/plan.ts:20 |
config | readonly | Readonly<Record<string, unknown>> | packages/ir/src/plan.ts:22 |
kind | readonly | NodeKind | packages/ir/src/plan.ts:21 |
nodeId | readonly | string | packages/ir/src/plan.ts:19 |
Type Aliases
GraphErrorCode
type GraphErrorCode =
| "duplicate-node-id"
| "invalid-node-kind"
| "unknown-node"
| "invalid-connection"
| "no-readable-root";Defined in: packages/ir/src/plan.ts:48
Machine-readable reasons a graph cannot be planned.
NodeKind
type NodeKind = "R" | "T" | "W";Defined in: packages/ir/src/igraph.ts:12
The three hlang node kinds: Readable (source), Transform, Writable (sink).
ParamBag
type ParamBag = Readonly<Record<string, ParamValue>>;Defined in: packages/ir/src/igraph.ts:35
A bag of node parameters (the params object under bizData).
ParamValue
type ParamValue =
| string
| number
| boolean
| null
| readonly ParamValue[]
| IParamObject;Defined in: packages/ir/src/igraph.ts:18
Serialized parameter values carried in bizData.params.
Variables
ERROR_PORT_NAME
const ERROR_PORT_NAME: "@node/error" = '@node/error';Defined in: packages/ir/src/igraph.ts:15
The output port every Readable and Transform node exposes for errors.
Functions
planGraph()
function planGraph(graph): ExecutionPlan;Defined in: packages/ir/src/plan.ts:70
Validate graph and lower it to an ExecutionPlan.
Parameters
| Parameter | Type |
|---|---|
graph | IGraph |
Returns
Generated by TypeDoc from packages/ir/src at build time.