Node52
Constructors
Connect
clientsfunctionClient layers for a catalog node's ROut (C2) — one shared connect, no repeated node on each client line.connectconstWire a Node's transport — the transport-agnostic primitive, dual: ts MyNode.pipe(Node.connect) // derive the transport from the node's declared kind + url MyNode.pipe(Node.connect(protocol)) // data-last: an explicit RpcClient.Protocol Node.connect(MyNode) // data-first, derived (needs an AddressedNode) Node.connect(MyNode, protocol) // data-first, explicit The derived forms read the node's ProtocolKind — so a node that declares kind: "WebSocket" dials WS and one that declares "Http" dials http; picking the wrong transport isn't expressible.connectHttpconstWire a node over http — Effect's layerProtocolHttp transport, connect pinned to kind: "Http".connectIpcconstWire a node over IpcSocket — Unix-domain socket RPC (protocolIpc), connect pinned to kind: "IpcSocket".connectSocketconstWire a node over a WebSocket — Effect's layerProtocolSocket transport (WS in the browser), connect pinned to kind: "WebSocket".Listen
httpfunctionLocal Http listen — localhost bind.listenfunctionNeutral catalog spine (C2) — no transport bind.listenLocalfunctionSugar: unix(node, serves) — IPC listen (pipe Lookup when needed).nPipefunctionWindows named-pipe IPC listen — same overload shapes as unix.unixfunctionUnix-domain IPC listen — all ipc mint/bind.wsfunctionLocal WebSocket listen — localhost bind.Servers
httpServerfunctionThe shared http server for resources composed with serve — the multi-resource, heterogeneous-dependency counterpart to a single serve layer.ipcServerfunctionA Unix-domain RPC server — same-machine sibling of httpServer / wsServer.wsServerfunctionA WebSocket RPC server — the httpServer sibling for the browser.Models
AddressedNodetypeAn AnyNode that can derive connect with no protocol argument — kind set, and either a url (Http/WebSocket) or a Unix path (IpcSocket).AnyNodetypeA 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.CatalogNodetypeA Node with typed catalog ROut (union of resource handles).DialableTargettypeDialable Tag targets — enough address for connect / auto-wired Hyperlink.client with no extra protocol argument.HttpServerOptionsinterfaceOptions for httpServer.IpcServerOptionsinterfaceOptions for ipcServer — Unix-domain RPC (same-machine).ListenNodeclassThe Node a protocol listen (unix / http / ws) is binding (concrete or minted).ListenOptionstypeShared options for unix / http / ws (and low-level Server) — rpc path / health / ipc unlink.NamelessListenOptionstypeOptions for unix / http / ws / Node.listenLocal.NodeKeytypeThe Context key of a Node (HSelf = its identity): a service whose value is the transport NodeProtocol.OnConflicttypeDirectory advertise conflict policy when the same nodeKey already has a row.OnConflictResolvedtypeConcrete advertise conflict policy (no "inherit") — what Lookup runs.ProtocolKindtypeThe transport a Node speaks — tag-style names (apps rarely type this alias; they write the literals or get inference from url / path): - "Http" — RpcClient.layerProtocolHttp (servers / CLIs) - "WebSocket" — browser WS (layerProtocolWebsocket / client layerProtocolSocket over WS) - "IpcSocket" — Unix-domain socket (same-machine; see ipcServer) Stamped on the node so the topology is self-describing about how to reach it — connect/client derive the transport from it.Guards
Utils
Errors
AddressLessClaimLostclassAddress-less unix / http / ws lost the Node.key claim — another process owns this Node.ContractMismatchclassClient and server disagree on a resource's wire contract (contractHash mismatch).HttpListenRequiresHttpclasshttp only speaks local Http.InvalidHttpTargetclassresolveHttpTarget / a positional Node.Tag()(name, badString) got a string that is neither a port (":3009"), a port number, nor an http(s):// url.ListenTagNodeRequiredclassProtocol Tag+impl (unix / http / ws(Tag, impl)) needs exactly one Node on the resource handle ({ node } / Hyperlink.nodes([X]) / Hyperlink.andNode).ListenUseProtocolclasslisten no longer binds a transport.NodeUnreachableclassA remote Node that didn't answer at its declared address — down, wrong port/url, or (for a socket node) a server not speaking the socket protocol.NPipeListenRequiresIpcclassnPipe only speaks IpcSocket (named-pipe path).NPipeRequiresWindowsclassnPipe is Windows-only.ProtocolKindMismatchclassA node-bound resource is being served over a transport that isn't in its node's declared ProtocolKind set.ProtocolUnansweredclassTransport answered, but the Effect RPC protocol did not — typically something else is listening on the address (wrong process / wrong protocol).ServiceNotReadyclassThe peer serves the target resource, but reports it not ready (ready: false).ServiceNotServedclassThe peer answered NodeStatus, but the target resource key is not in status.resources.UnaddressedNodeclassDeriving a transport from a node that never declared one — a bare Node.Tag()("x") has no address/kind, so connect / listen can't know how to reach it.UnixListenRequiresIpcclassunix only speaks Unix-domain IPC.WsListenRequiresWsclassws only speaks local WebSocket.Classes
ClientsNodeMismatchclassclients got bound tags that do not share one AddressedNode.MalformedNodeclassA node was built with inconsistent transport fields — a programming invariant, thrown at declaration (like DuplicateHyperlinkKey) so a malformed node fails loudly there instead of as a confusing dial/serve failure later.