Class: NodeRef
Defined in: src/batteries/orchestration/encoding.ts:42
A serializable reference to another node's output — a CLASS, not a record.
Remarks
Why a class rather than a record with a marker field: a plain record can wear {kind: 'nodeRef', node, select, …} — it is an ordinary encodable record — so a marker property cannot separate a reference from a literal that happens to look like one, and a resolver keying on it would silently rewrite the literal. instanceof is unforgeable: no record can satisfy NodeRef.isNodeRef, and the encoder round-trips instances as custom:NodeRef rather than as records. Same mechanism core uses for Media/Tokenizable.
branchId identifies WHICH EXECUTION of node to read — the same path identity NodeOutput and FrameRef carry. Omitted means "do not filter".
Constructors
Constructor
new NodeRef(
node: string,
select:
| "last"
| "first"
| "all"
| {
index: number;
},
path?: string,
branchId?: BranchId): NodeRef;Defined in: src/batteries/orchestration/encoding.ts:68
Construct a NodeRef.
Parameters
| Parameter | Type | Description |
|---|---|---|
node | string | The id of the node whose output this reference reads. |
select | | "last" | "first" | "all" | { index: number; } | Which item of that node's output to take: 'first', 'last', 'all', or an explicit {index}. |
path? | string | An optional dot-path into the selected item's value. |
branchId? | BranchId | Which execution of the node to read, as a path identity; omitted means "do not filter". |
Returns
NodeRef
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
branchId? | BranchId | WHICH EXECUTION of the node to read, as a path identity. Remarks This is NOT an outgoing branch of that node: a node fanning out to two successors still runs once and produces one output; what creates several outputs for one node is that node being REACHED by several paths. Omitted means "do not filter" — fine when exactly one path reaches the node, and refused at freeze when more than one does. | src/batteries/orchestration/encoding.ts:58 |
node | string | The id of the node whose output this reference reads. | src/batteries/orchestration/encoding.ts:44 |
path? | string | An optional dot-path into the selected item's value. | src/batteries/orchestration/encoding.ts:48 |
select | | "last" | "first" | "all" | { index: number; } | Which item of that node's output to take: 'first', 'last', 'all', or an explicit {index}. | src/batteries/orchestration/encoding.ts:46 |
Methods
[ENCODE_METHOD]()
ENCODE_METHOD: Record<string, unknown>;Defined in: src/batteries/orchestration/encoding.ts:86
Emit a plain snapshot of the fields for the encoder.
Returns
Record<string, unknown>
[DECODE_METHOD]()
static DECODE_METHOD: NodeRef;Defined in: src/batteries/orchestration/encoding.ts:91
Rebuild an instance from a NodeRef.[ENCODE_METHOD] snapshot.
Parameters
| Parameter | Type |
|---|---|
data | unknown |
Returns
NodeRef
isNodeRef()
static isNodeRef(v: unknown): v is NodeRef;Defined in: src/batteries/orchestration/encoding.ts:81
instanceof guard — a look-alike record cannot pass.
Parameters
| Parameter | Type |
|---|---|
v | unknown |
Returns
v is NodeRef