<N extends AnyNode>(node: N): N & { readonly isLookupNode: true }Brand a node as the fleet lookup / identity server — piped onto a Tag node (sibling to
withProtocol). Reuses the node verbatim (address, transports, key, served resources) and
folds its advertise policy to a concrete default: an explicit { onConflict } survives, while an
ordinary node's "inherit" (or none) becomes "livenessReplace" — a lookup root never inherits.
class Directory extends Node.Tag<Directory>()("app/Lookup", { path: "/tmp/lookup.sock" }).pipe(Node.asLookup) {}
class Dual extends Node.Tag<Dual>()("app/Lookup", { http: "http://l/rpc", ws: "ws://l/rpc" }).pipe(Node.asLookup) {}export const const asLookup: <N extends AnyNode>(
node: N
) => N & { readonly isLookupNode: true }
Brand a node as the fleet lookup / identity server — piped onto a
Tag
node (sibling to
withProtocol
). Reuses the node verbatim (address, transports, key, served resources) and
folds its advertise policy to a concrete default: an explicit { onConflict } survives, while an
ordinary node's "inherit" (or none) becomes "livenessReplace" — a lookup root never inherits.
class Directory extends Node.Tag<Directory>()("app/Lookup", { path: "/tmp/lookup.sock" }).pipe(Node.asLookup) {}
class Dual extends Node.Tag<Dual>()("app/Lookup", { http: "http://l/rpc", ws: "ws://l/rpc" }).pipe(Node.asLookup) {}
asLookup = <function (type parameter) N in <N extends AnyNode>(node: N): N & {
readonly isLookupNode: true;
}
N extends type AnyNode = NodeKey<unknown> & {
readonly url: string | undefined
readonly path: string | undefined
readonly kind: ProtocolKind | undefined
readonly endpoints?: Endpoints
readonly onConflict?: OnConflict
readonly [portSym]?: number
}
A
Tag
erased — its transport endpoints set, plus the primary address
(url and/or Unix path) and
ProtocolKind
kind (the first-declared endpoint, kept for
single-protocol readers), so a tag's distributed set is self-describing about where AND how to
reach each one.
AnyNode>(
node: N extends AnyNodenode: function (type parameter) N in <N extends AnyNode>(node: N): N & {
readonly isLookupNode: true;
}
N,
): function (type parameter) N in <N extends AnyNode>(node: N): N & {
readonly isLookupNode: true;
}
N & { readonly isLookupNode: trueisLookupNode: true } =>
var Object: ObjectConstructorProvides functionality common to all JavaScript objects.
Object.ObjectConstructor.assign<N, {
isLookupNode: true;
onConflict: OnConflictResolved;
}>(target: N, source: {
isLookupNode: true;
onConflict: OnConflictResolved;
}): N & {
isLookupNode: true;
onConflict: OnConflictResolved;
} (+3 overloads)
Copy the values of all of the enumerable own properties from one or more source objects to a
target object. Returns the target object.
assign(node: N extends AnyNodenode, {
isLookupNode: trueisLookupNode: true as type const = trueconst,
onConflict: OnConflictResolvedonConflict: const resolveOnConflict: (
...prefs: ReadonlyArray<OnConflict | undefined>
) => OnConflictResolved
Walk preference layers (first concrete wins). Hard fallback: livenessReplace.
resolveOnConflict(node: N extends AnyNodenode.onConflict?: OnConflictStamped advertise conflict policy (default "inherit" on ordinary nodes).
onConflict),
});