<Self, ROut = never>(): {
(key: string): NodeTagClass<Self, ROut, BareAddress>
(
key: string,
target: {
readonly path: string
readonly kind?: "IpcSocket"
readonly onConflict?: OnConflict
}
): NodeTagClass<Self, ROut, IpcAddress>
(key: string, target: number | `:${number}`): NodeTagClass<
Self,
ROut,
HttpAddress
>
(
key: string,
target: `ws://${string}` | `wss://${string}`
): NodeTagClass<Self, ROut, WsAddress>
(
key: string,
target: `http://${string}` | `https://${string}`
): NodeTagClass<Self, ROut, HttpAddress>
(
key: string,
target: {
readonly url: `ws://${string}` | `wss://${string}`
readonly kind?: "WebSocket"
readonly onConflict?: OnConflict
}
): NodeTagClass<Self, ROut, WsAddress>
(
key: string,
target: {
readonly url: string
readonly kind: "WebSocket"
readonly onConflict?: OnConflict
}
): NodeTagClass<Self, ROut, WsAddress>
(
key: string,
target: {
readonly url: string
readonly kind: "Http"
readonly onConflict?: OnConflict
}
): NodeTagClass<Self, ROut, HttpAddress>
<const T extends ShorthandTarget>(key: string, target: T): NodeTagClass<
Self,
ROut,
MultiAddress<KindsOf<T>>
>
(
key: string,
target:
| string
| {
readonly url: string
readonly kind?: ProtocolKind
readonly onConflict?: OnConflict
}
): NodeTagClass<Self, ROut, UrlAddressLoose>
(key: string, target?: LooseNodeTarget): NodeTagClass<
Self,
ROut,
| BareAddress
| IpcAddress
| HttpAddress
| WsAddress
| UrlAddressLoose
| MultiAddress<ProtocolKind>
>
}Declare a node — a named transport endpoint a resource connects to. Two-stage and keyed by
a string, mirroring Effect's Context.Service<Self, Shape>()(key) (a node is a Context.Key,
resolved by its key in the Context map) and every sibling factory (Hyperlink.Tag<Self>(), …).
The second call infers the target shape, so the { http, ws } shorthand types its
ProtocolKind set precisely. Optional catalog type param ROut (C2) — prefer import type
for those handles (C4). Templates (no address until cloned) live on Node.Prototype:
class EdgeNode extends Node.Tag<EdgeNode>()("edge") {} // no address yet
class Worker extends Node.Tag<Worker>()("worker", 3001) {} // → http://localhost:3001/rpc, kind "Http"
class Mail extends Node.Tag<Mail>()("mail", "https://mail.internal/rpc") {} // full url, as-is, kind "Http"
class Live extends Node.Tag<Live>()("live", { url: "wss://live/rpc" }) {} // kind "WebSocket" (inferred from ws url)
class Push extends Node.Tag<Push>()("push", { url: "/rpc", kind: "WebSocket" }) {} // same-origin path, explicit kind
class Local extends Node.Tag<Local>()("local", { path: "/tmp/local.sock" }) {} // kind "IpcSocket" (Unix domain)
class Droplet extends Node.Tag<Droplet>()("droplet", { http: "http://d/rpc", ws: "ws://d/rpc" }) {} // multi-protocol
import type { Jobs, Emails } from "@app/contracts"
class AppWorker extends Node.Tag<AppWorker, Jobs | Emails>()("app/Worker", { path: "/tmp/w.sock" }) {}
class MailWorker extends Node.Prototype<MailWorker, Mail>("app/MailWorker") {}The key is the service key. The optional address matches clientHttp's target: a port
(3001 or ":3001" → http://localhost:3001/rpc), a full url (used as-is), { url, kind } for
an explicit endpoint, { path } for a Unix-domain socket (kind: "IpcSocket"), or the
{ http, ws, ipc } multi-protocol shorthand. The node carries ProtocolKind so the topology
is self-describing about where AND how: connect(node) derives the transport with no
protocol argument.
Dialable targets return an AddressedNode (kind: ProtocolKind) so
Hyperlink.client(Tag, Worker) can auto-wire connect. Bare Node.Tag()("x")
stays address-less (kind: undefined) — still needs explicit connect / lookup.
export const const Tag: <Self, ROut = never>() => {
(key: string): NodeTagClass<
Self,
ROut,
BareAddress
>
(
key: string,
target: {
readonly path: string
readonly kind?: "IpcSocket"
readonly onConflict?: OnConflict
}
): NodeTagClass<Self, ROut, IpcAddress>
(
key: string,
target: number | `:${number}`
): NodeTagClass<Self, ROut, HttpAddress>
(
key: string,
target: `ws://${string}` | `wss://${string}`
): NodeTagClass<Self, ROut, WsAddress>
(
key: string,
target:
| `http://${string}`
| `https://${string}`
): NodeTagClass<Self, ROut, HttpAddress>
(
key: string,
target: {
readonly url:
| `ws://${string}`
| `wss://${string}`
readonly kind?: "WebSocket"
readonly onConflict?: OnConflict
}
): NodeTagClass<Self, ROut, WsAddress>
(
key: string,
target: {
readonly url: string
readonly kind: "WebSocket"
readonly onConflict?: OnConflict
}
): NodeTagClass<Self, ROut, WsAddress>
(
key: string,
target: {
readonly url: string
readonly kind: "Http"
readonly onConflict?: OnConflict
}
): NodeTagClass<Self, ROut, HttpAddress>
<T extends ShorthandTarget>(
key: string,
target: T
): NodeTagClass<
Self,
ROut,
MultiAddress<KindsOf<T>>
>
(
key: string,
target:
| string
| {
readonly url: string
readonly kind?: ProtocolKind
readonly onConflict?: OnConflict
}
): NodeTagClass<Self, ROut, UrlAddressLoose>
(
key: string,
target?: LooseNodeTarget
): NodeTagClass<
Self,
ROut,
| BareAddress
| IpcAddress
| HttpAddress
| WsAddress
| UrlAddressLoose
| MultiAddress<ProtocolKind>
>
}
Declare a node — a named transport endpoint a resource connects to. Two-stage and keyed by
a string, mirroring Effect's Context.Service<Self, Shape>()(key) (a node is a Context.Key,
resolved by its key in the Context map) and every sibling factory (Hyperlink.Tag<Self>(), …).
The second call infers the target shape, so the { http, ws } shorthand types its
ProtocolKind
set precisely. Optional catalog type param ROut (C2) — prefer import type
for those handles (C4). Templates (no address until cloned) live on
Node
.Prototype:
class EdgeNode extends Node.Tag<EdgeNode>()("edge") {} // no address yet
class Worker extends Node.Tag<Worker>()("worker", 3001) {} // → http://localhost:3001/rpc, kind "Http"
class Mail extends Node.Tag<Mail>()("mail", "https://mail.internal/rpc") {} // full url, as-is, kind "Http"
class Live extends Node.Tag<Live>()("live", { url: "wss://live/rpc" }) {} // kind "WebSocket" (inferred from ws url)
class Push extends Node.Tag<Push>()("push", { url: "/rpc", kind: "WebSocket" }) {} // same-origin path, explicit kind
class Local extends Node.Tag<Local>()("local", { path: "/tmp/local.sock" }) {} // kind "IpcSocket" (Unix domain)
class Droplet extends Node.Tag<Droplet>()("droplet", { http: "http://d/rpc", ws: "ws://d/rpc" }) {} // multi-protocol
import type { Jobs, Emails } from "@app/contracts"
class AppWorker extends Node.Tag<AppWorker, Jobs | Emails>()("app/Worker", { path: "/tmp/w.sock" }) {}
class MailWorker extends Node.Prototype<MailWorker, Mail>("app/MailWorker") {}
The key is the service key. The optional address matches
clientHttp
's target: a port
(3001 or ":3001" → http://localhost:3001/rpc), a full url (used as-is), { url, kind } for
an explicit endpoint, { path } for a Unix-domain socket (kind: "IpcSocket"), or the
{ http, ws, ipc } multi-protocol shorthand. The node carries
ProtocolKind
so the topology
is self-describing about where AND how:
connect
(node) derives the transport with no
protocol argument.
Dialable targets return an
AddressedNode
(kind: ProtocolKind) so
Hyperlink.client(Tag, Worker) can auto-wire
connect
. Bare Node.Tag()("x")
stays address-less (kind: undefined) — still needs explicit connect / lookup.
Tag = <function (type parameter) Self in <Self, ROut = never>(): {
(key: string): NodeTagClass<Self, ROut, BareAddress>;
(key: string, target: {
readonly path: string;
readonly kind?: "IpcSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, IpcAddress>;
(key: string, target: number | `:${number}`): NodeTagClass<Self, ROut, HttpAddress>;
(key: string, target: `ws://${string}` | `wss://${string}`): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: `http://${string}` | `https://${string}`): NodeTagClass<Self, ROut, HttpAddress>;
(key: string, target: {
readonly url: `ws://${string}` | `wss://${string}`;
readonly kind?: "WebSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: {
readonly url: string;
readonly kind: "WebSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: {
readonly url: string;
readonly kind: "Http";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, HttpAddress>;
<const T extends ShorthandTarget>(key: string, target: T): NodeTagClass<Self, ROut, MultiAddress<KindsOf<T>>>;
(key: string, target: string | {
readonly url: string;
readonly kind?: ProtocolKind;
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, UrlAddressLoose>;
(key: string, target?: LooseNodeTarget): NodeTagClass<Self, ROut, BareAddress | IpcAddress | HttpAddress | WsAddress | UrlAddressLoose | MultiAddress ...
Self, function (type parameter) ROut in <Self, ROut = never>(): {
(key: string): NodeTagClass<Self, ROut, BareAddress>;
(key: string, target: {
readonly path: string;
readonly kind?: "IpcSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, IpcAddress>;
(key: string, target: number | `:${number}`): NodeTagClass<Self, ROut, HttpAddress>;
(key: string, target: `ws://${string}` | `wss://${string}`): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: `http://${string}` | `https://${string}`): NodeTagClass<Self, ROut, HttpAddress>;
(key: string, target: {
readonly url: `ws://${string}` | `wss://${string}`;
readonly kind?: "WebSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: {
readonly url: string;
readonly kind: "WebSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: {
readonly url: string;
readonly kind: "Http";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, HttpAddress>;
<const T extends ShorthandTarget>(key: string, target: T): NodeTagClass<Self, ROut, MultiAddress<KindsOf<T>>>;
(key: string, target: string | {
readonly url: string;
readonly kind?: ProtocolKind;
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, UrlAddressLoose>;
(key: string, target?: LooseNodeTarget): NodeTagClass<Self, ROut, BareAddress | IpcAddress | HttpAddress | WsAddress | UrlAddressLoose | MultiAddress ...
ROut = never>() => {
function function (local function) build(key: string): NodeTagClass<Self, ROut, BareAddress> (+10 overloads)build(key: stringkey: string): type NodeTagClass<Self, ROut, Address> =
Context.ServiceClass<
Self,
string,
NodeProtocol
> &
Address & {
readonly logs: unknown
readonly onConflict: OnConflict
readonly [catalogSym]?: ROut
}
Constructable
Tag
result — Context.ServiceClass plus address fields.
NodeTagClass<function (type parameter) Self in <Self, ROut = never>(): {
(key: string): NodeTagClass<Self, ROut, BareAddress>;
(key: string, target: {
readonly path: string;
readonly kind?: "IpcSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, IpcAddress>;
(key: string, target: number | `:${number}`): NodeTagClass<Self, ROut, HttpAddress>;
(key: string, target: `ws://${string}` | `wss://${string}`): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: `http://${string}` | `https://${string}`): NodeTagClass<Self, ROut, HttpAddress>;
(key: string, target: {
readonly url: `ws://${string}` | `wss://${string}`;
readonly kind?: "WebSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: {
readonly url: string;
readonly kind: "WebSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: {
readonly url: string;
readonly kind: "Http";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, HttpAddress>;
<const T extends ShorthandTarget>(key: string, target: T): NodeTagClass<Self, ROut, MultiAddress<KindsOf<T>>>;
(key: string, target: string | {
readonly url: string;
readonly kind?: ProtocolKind;
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, UrlAddressLoose>;
(key: string, target?: LooseNodeTarget): NodeTagClass<Self, ROut, BareAddress | IpcAddress | HttpAddress | WsAddress | UrlAddressLoose | MultiAddress ...
Self, function (type parameter) ROut in <Self, ROut = never>(): {
(key: string): NodeTagClass<Self, ROut, BareAddress>;
(key: string, target: {
readonly path: string;
readonly kind?: "IpcSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, IpcAddress>;
(key: string, target: number | `:${number}`): NodeTagClass<Self, ROut, HttpAddress>;
(key: string, target: `ws://${string}` | `wss://${string}`): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: `http://${string}` | `https://${string}`): NodeTagClass<Self, ROut, HttpAddress>;
(key: string, target: {
readonly url: `ws://${string}` | `wss://${string}`;
readonly kind?: "WebSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: {
readonly url: string;
readonly kind: "WebSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: {
readonly url: string;
readonly kind: "Http";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, HttpAddress>;
<const T extends ShorthandTarget>(key: string, target: T): NodeTagClass<Self, ROut, MultiAddress<KindsOf<T>>>;
(key: string, target: string | {
readonly url: string;
readonly kind?: ProtocolKind;
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, UrlAddressLoose>;
(key: string, target?: LooseNodeTarget): NodeTagClass<Self, ROut, BareAddress | IpcAddress | HttpAddress | WsAddress | UrlAddressLoose | MultiAddress ...
ROut, type BareAddress = {
readonly url: undefined
readonly path: undefined
readonly kind: undefined
}
Bare (address-less) node fields.
BareAddress>;
function function (local function) build(key: string, target: {
readonly path: string;
readonly kind?: "IpcSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, IpcAddress> (+10 overloads)
build(
key: stringkey: string,
target: {
readonly path: string
readonly kind?: "IpcSocket"
readonly onConflict?: OnConflict
}
target: {
readonly path: stringpath: string;
readonly kind?: "IpcSocket" | undefinedkind?: "IpcSocket";
readonly onConflict?: OnConflictonConflict?: type OnConflict =
| "livenessReplace"
| "askIncumbent"
| "reject"
| "inherit"
Directory advertise conflict policy when the same nodeKey already has a row.
livenessReplace — ping incumbent; alive → reject; dead → replace
askIncumbent — if alive, Lookup asks NodeStatus.yield; refuse/timeout → reject
reject — alive → reject; dead → still replace
inherit — continue up the resolve chain (call-site → node → Lookup → hard fallback)
OnConflict;
},
): type NodeTagClass<Self, ROut, Address> =
Context.ServiceClass<
Self,
string,
NodeProtocol
> &
Address & {
readonly logs: unknown
readonly onConflict: OnConflict
readonly [catalogSym]?: ROut
}
Constructable
Tag
result — Context.ServiceClass plus address fields.
NodeTagClass<function (type parameter) Self in <Self, ROut = never>(): {
(key: string): NodeTagClass<Self, ROut, BareAddress>;
(key: string, target: {
readonly path: string;
readonly kind?: "IpcSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, IpcAddress>;
(key: string, target: number | `:${number}`): NodeTagClass<Self, ROut, HttpAddress>;
(key: string, target: `ws://${string}` | `wss://${string}`): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: `http://${string}` | `https://${string}`): NodeTagClass<Self, ROut, HttpAddress>;
(key: string, target: {
readonly url: `ws://${string}` | `wss://${string}`;
readonly kind?: "WebSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: {
readonly url: string;
readonly kind: "WebSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: {
readonly url: string;
readonly kind: "Http";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, HttpAddress>;
<const T extends ShorthandTarget>(key: string, target: T): NodeTagClass<Self, ROut, MultiAddress<KindsOf<T>>>;
(key: string, target: string | {
readonly url: string;
readonly kind?: ProtocolKind;
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, UrlAddressLoose>;
(key: string, target?: LooseNodeTarget): NodeTagClass<Self, ROut, BareAddress | IpcAddress | HttpAddress | WsAddress | UrlAddressLoose | MultiAddress ...
Self, function (type parameter) ROut in <Self, ROut = never>(): {
(key: string): NodeTagClass<Self, ROut, BareAddress>;
(key: string, target: {
readonly path: string;
readonly kind?: "IpcSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, IpcAddress>;
(key: string, target: number | `:${number}`): NodeTagClass<Self, ROut, HttpAddress>;
(key: string, target: `ws://${string}` | `wss://${string}`): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: `http://${string}` | `https://${string}`): NodeTagClass<Self, ROut, HttpAddress>;
(key: string, target: {
readonly url: `ws://${string}` | `wss://${string}`;
readonly kind?: "WebSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: {
readonly url: string;
readonly kind: "WebSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: {
readonly url: string;
readonly kind: "Http";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, HttpAddress>;
<const T extends ShorthandTarget>(key: string, target: T): NodeTagClass<Self, ROut, MultiAddress<KindsOf<T>>>;
(key: string, target: string | {
readonly url: string;
readonly kind?: ProtocolKind;
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, UrlAddressLoose>;
(key: string, target?: LooseNodeTarget): NodeTagClass<Self, ROut, BareAddress | IpcAddress | HttpAddress | WsAddress | UrlAddressLoose | MultiAddress ...
ROut, type IpcAddress = {
readonly url: undefined
readonly path: string
readonly kind: "IpcSocket"
}
Dialable ipc node fields.
IpcAddress>;
function function (local function) build(key: string, target: number | `:${number}`): NodeTagClass<Self, ROut, HttpAddress> (+10 overloads)build(
key: stringkey: string,
target: number | `:${number}`target: number | `:${number}`,
): type NodeTagClass<Self, ROut, Address> =
Context.ServiceClass<
Self,
string,
NodeProtocol
> &
Address & {
readonly logs: unknown
readonly onConflict: OnConflict
readonly [catalogSym]?: ROut
}
Constructable
Tag
result — Context.ServiceClass plus address fields.
NodeTagClass<function (type parameter) Self in <Self, ROut = never>(): {
(key: string): NodeTagClass<Self, ROut, BareAddress>;
(key: string, target: {
readonly path: string;
readonly kind?: "IpcSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, IpcAddress>;
(key: string, target: number | `:${number}`): NodeTagClass<Self, ROut, HttpAddress>;
(key: string, target: `ws://${string}` | `wss://${string}`): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: `http://${string}` | `https://${string}`): NodeTagClass<Self, ROut, HttpAddress>;
(key: string, target: {
readonly url: `ws://${string}` | `wss://${string}`;
readonly kind?: "WebSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: {
readonly url: string;
readonly kind: "WebSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: {
readonly url: string;
readonly kind: "Http";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, HttpAddress>;
<const T extends ShorthandTarget>(key: string, target: T): NodeTagClass<Self, ROut, MultiAddress<KindsOf<T>>>;
(key: string, target: string | {
readonly url: string;
readonly kind?: ProtocolKind;
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, UrlAddressLoose>;
(key: string, target?: LooseNodeTarget): NodeTagClass<Self, ROut, BareAddress | IpcAddress | HttpAddress | WsAddress | UrlAddressLoose | MultiAddress ...
Self, function (type parameter) ROut in <Self, ROut = never>(): {
(key: string): NodeTagClass<Self, ROut, BareAddress>;
(key: string, target: {
readonly path: string;
readonly kind?: "IpcSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, IpcAddress>;
(key: string, target: number | `:${number}`): NodeTagClass<Self, ROut, HttpAddress>;
(key: string, target: `ws://${string}` | `wss://${string}`): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: `http://${string}` | `https://${string}`): NodeTagClass<Self, ROut, HttpAddress>;
(key: string, target: {
readonly url: `ws://${string}` | `wss://${string}`;
readonly kind?: "WebSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: {
readonly url: string;
readonly kind: "WebSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: {
readonly url: string;
readonly kind: "Http";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, HttpAddress>;
<const T extends ShorthandTarget>(key: string, target: T): NodeTagClass<Self, ROut, MultiAddress<KindsOf<T>>>;
(key: string, target: string | {
readonly url: string;
readonly kind?: ProtocolKind;
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, UrlAddressLoose>;
(key: string, target?: LooseNodeTarget): NodeTagClass<Self, ROut, BareAddress | IpcAddress | HttpAddress | WsAddress | UrlAddressLoose | MultiAddress ...
ROut, type HttpAddress = {
readonly url: string
readonly path: undefined
readonly kind: "Http"
}
Dialable http node fields.
HttpAddress>;
function function (local function) build(key: string, target: `ws://${string}` | `wss://${string}`): NodeTagClass<Self, ROut, WsAddress> (+10 overloads)build(
key: stringkey: string,
target: `ws://${string}` | `wss://${string}`target: `ws://${string}` | `wss://${string}`,
): type NodeTagClass<Self, ROut, Address> =
Context.ServiceClass<
Self,
string,
NodeProtocol
> &
Address & {
readonly logs: unknown
readonly onConflict: OnConflict
readonly [catalogSym]?: ROut
}
Constructable
Tag
result — Context.ServiceClass plus address fields.
NodeTagClass<function (type parameter) Self in <Self, ROut = never>(): {
(key: string): NodeTagClass<Self, ROut, BareAddress>;
(key: string, target: {
readonly path: string;
readonly kind?: "IpcSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, IpcAddress>;
(key: string, target: number | `:${number}`): NodeTagClass<Self, ROut, HttpAddress>;
(key: string, target: `ws://${string}` | `wss://${string}`): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: `http://${string}` | `https://${string}`): NodeTagClass<Self, ROut, HttpAddress>;
(key: string, target: {
readonly url: `ws://${string}` | `wss://${string}`;
readonly kind?: "WebSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: {
readonly url: string;
readonly kind: "WebSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: {
readonly url: string;
readonly kind: "Http";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, HttpAddress>;
<const T extends ShorthandTarget>(key: string, target: T): NodeTagClass<Self, ROut, MultiAddress<KindsOf<T>>>;
(key: string, target: string | {
readonly url: string;
readonly kind?: ProtocolKind;
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, UrlAddressLoose>;
(key: string, target?: LooseNodeTarget): NodeTagClass<Self, ROut, BareAddress | IpcAddress | HttpAddress | WsAddress | UrlAddressLoose | MultiAddress ...
Self, function (type parameter) ROut in <Self, ROut = never>(): {
(key: string): NodeTagClass<Self, ROut, BareAddress>;
(key: string, target: {
readonly path: string;
readonly kind?: "IpcSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, IpcAddress>;
(key: string, target: number | `:${number}`): NodeTagClass<Self, ROut, HttpAddress>;
(key: string, target: `ws://${string}` | `wss://${string}`): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: `http://${string}` | `https://${string}`): NodeTagClass<Self, ROut, HttpAddress>;
(key: string, target: {
readonly url: `ws://${string}` | `wss://${string}`;
readonly kind?: "WebSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: {
readonly url: string;
readonly kind: "WebSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: {
readonly url: string;
readonly kind: "Http";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, HttpAddress>;
<const T extends ShorthandTarget>(key: string, target: T): NodeTagClass<Self, ROut, MultiAddress<KindsOf<T>>>;
(key: string, target: string | {
readonly url: string;
readonly kind?: ProtocolKind;
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, UrlAddressLoose>;
(key: string, target?: LooseNodeTarget): NodeTagClass<Self, ROut, BareAddress | IpcAddress | HttpAddress | WsAddress | UrlAddressLoose | MultiAddress ...
ROut, type WsAddress = {
readonly url: string
readonly path: undefined
readonly kind: "WebSocket"
}
Dialable WebSocket node fields.
WsAddress>;
function function (local function) build(key: string, target: `http://${string}` | `https://${string}`): NodeTagClass<Self, ROut, HttpAddress> (+10 overloads)build(
key: stringkey: string,
target: `http://${string}` | `https://${string}`target: `http://${string}` | `https://${string}`,
): type NodeTagClass<Self, ROut, Address> =
Context.ServiceClass<
Self,
string,
NodeProtocol
> &
Address & {
readonly logs: unknown
readonly onConflict: OnConflict
readonly [catalogSym]?: ROut
}
Constructable
Tag
result — Context.ServiceClass plus address fields.
NodeTagClass<function (type parameter) Self in <Self, ROut = never>(): {
(key: string): NodeTagClass<Self, ROut, BareAddress>;
(key: string, target: {
readonly path: string;
readonly kind?: "IpcSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, IpcAddress>;
(key: string, target: number | `:${number}`): NodeTagClass<Self, ROut, HttpAddress>;
(key: string, target: `ws://${string}` | `wss://${string}`): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: `http://${string}` | `https://${string}`): NodeTagClass<Self, ROut, HttpAddress>;
(key: string, target: {
readonly url: `ws://${string}` | `wss://${string}`;
readonly kind?: "WebSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: {
readonly url: string;
readonly kind: "WebSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: {
readonly url: string;
readonly kind: "Http";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, HttpAddress>;
<const T extends ShorthandTarget>(key: string, target: T): NodeTagClass<Self, ROut, MultiAddress<KindsOf<T>>>;
(key: string, target: string | {
readonly url: string;
readonly kind?: ProtocolKind;
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, UrlAddressLoose>;
(key: string, target?: LooseNodeTarget): NodeTagClass<Self, ROut, BareAddress | IpcAddress | HttpAddress | WsAddress | UrlAddressLoose | MultiAddress ...
Self, function (type parameter) ROut in <Self, ROut = never>(): {
(key: string): NodeTagClass<Self, ROut, BareAddress>;
(key: string, target: {
readonly path: string;
readonly kind?: "IpcSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, IpcAddress>;
(key: string, target: number | `:${number}`): NodeTagClass<Self, ROut, HttpAddress>;
(key: string, target: `ws://${string}` | `wss://${string}`): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: `http://${string}` | `https://${string}`): NodeTagClass<Self, ROut, HttpAddress>;
(key: string, target: {
readonly url: `ws://${string}` | `wss://${string}`;
readonly kind?: "WebSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: {
readonly url: string;
readonly kind: "WebSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: {
readonly url: string;
readonly kind: "Http";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, HttpAddress>;
<const T extends ShorthandTarget>(key: string, target: T): NodeTagClass<Self, ROut, MultiAddress<KindsOf<T>>>;
(key: string, target: string | {
readonly url: string;
readonly kind?: ProtocolKind;
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, UrlAddressLoose>;
(key: string, target?: LooseNodeTarget): NodeTagClass<Self, ROut, BareAddress | IpcAddress | HttpAddress | WsAddress | UrlAddressLoose | MultiAddress ...
ROut, type HttpAddress = {
readonly url: string
readonly path: undefined
readonly kind: "Http"
}
Dialable http node fields.
HttpAddress>;
function function (local function) build(key: string, target: {
readonly url: `ws://${string}` | `wss://${string}`;
readonly kind?: "WebSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, WsAddress> (+10 overloads)
build(
key: stringkey: string,
target: {
readonly url:
| `ws://${string}`
| `wss://${string}`
readonly kind?: "WebSocket"
readonly onConflict?: OnConflict
}
target: {
readonly url: `ws://${string}` | `wss://${string}`url: `ws://${string}` | `wss://${string}`;
readonly kind?: "WebSocket" | undefinedkind?: "WebSocket";
readonly onConflict?: OnConflictonConflict?: type OnConflict =
| "livenessReplace"
| "askIncumbent"
| "reject"
| "inherit"
Directory advertise conflict policy when the same nodeKey already has a row.
livenessReplace — ping incumbent; alive → reject; dead → replace
askIncumbent — if alive, Lookup asks NodeStatus.yield; refuse/timeout → reject
reject — alive → reject; dead → still replace
inherit — continue up the resolve chain (call-site → node → Lookup → hard fallback)
OnConflict;
},
): type NodeTagClass<Self, ROut, Address> =
Context.ServiceClass<
Self,
string,
NodeProtocol
> &
Address & {
readonly logs: unknown
readonly onConflict: OnConflict
readonly [catalogSym]?: ROut
}
Constructable
Tag
result — Context.ServiceClass plus address fields.
NodeTagClass<function (type parameter) Self in <Self, ROut = never>(): {
(key: string): NodeTagClass<Self, ROut, BareAddress>;
(key: string, target: {
readonly path: string;
readonly kind?: "IpcSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, IpcAddress>;
(key: string, target: number | `:${number}`): NodeTagClass<Self, ROut, HttpAddress>;
(key: string, target: `ws://${string}` | `wss://${string}`): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: `http://${string}` | `https://${string}`): NodeTagClass<Self, ROut, HttpAddress>;
(key: string, target: {
readonly url: `ws://${string}` | `wss://${string}`;
readonly kind?: "WebSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: {
readonly url: string;
readonly kind: "WebSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: {
readonly url: string;
readonly kind: "Http";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, HttpAddress>;
<const T extends ShorthandTarget>(key: string, target: T): NodeTagClass<Self, ROut, MultiAddress<KindsOf<T>>>;
(key: string, target: string | {
readonly url: string;
readonly kind?: ProtocolKind;
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, UrlAddressLoose>;
(key: string, target?: LooseNodeTarget): NodeTagClass<Self, ROut, BareAddress | IpcAddress | HttpAddress | WsAddress | UrlAddressLoose | MultiAddress ...
Self, function (type parameter) ROut in <Self, ROut = never>(): {
(key: string): NodeTagClass<Self, ROut, BareAddress>;
(key: string, target: {
readonly path: string;
readonly kind?: "IpcSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, IpcAddress>;
(key: string, target: number | `:${number}`): NodeTagClass<Self, ROut, HttpAddress>;
(key: string, target: `ws://${string}` | `wss://${string}`): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: `http://${string}` | `https://${string}`): NodeTagClass<Self, ROut, HttpAddress>;
(key: string, target: {
readonly url: `ws://${string}` | `wss://${string}`;
readonly kind?: "WebSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: {
readonly url: string;
readonly kind: "WebSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: {
readonly url: string;
readonly kind: "Http";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, HttpAddress>;
<const T extends ShorthandTarget>(key: string, target: T): NodeTagClass<Self, ROut, MultiAddress<KindsOf<T>>>;
(key: string, target: string | {
readonly url: string;
readonly kind?: ProtocolKind;
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, UrlAddressLoose>;
(key: string, target?: LooseNodeTarget): NodeTagClass<Self, ROut, BareAddress | IpcAddress | HttpAddress | WsAddress | UrlAddressLoose | MultiAddress ...
ROut, type WsAddress = {
readonly url: string
readonly path: undefined
readonly kind: "WebSocket"
}
Dialable WebSocket node fields.
WsAddress>;
function function (local function) build(key: string, target: {
readonly url: string;
readonly kind: "WebSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, WsAddress> (+10 overloads)
build(
key: stringkey: string,
target: {
readonly url: string
readonly kind: "WebSocket"
readonly onConflict?: OnConflict
}
target: {
readonly url: stringurl: string;
readonly kind: "WebSocket"kind: "WebSocket";
readonly onConflict?: OnConflictonConflict?: type OnConflict =
| "livenessReplace"
| "askIncumbent"
| "reject"
| "inherit"
Directory advertise conflict policy when the same nodeKey already has a row.
livenessReplace — ping incumbent; alive → reject; dead → replace
askIncumbent — if alive, Lookup asks NodeStatus.yield; refuse/timeout → reject
reject — alive → reject; dead → still replace
inherit — continue up the resolve chain (call-site → node → Lookup → hard fallback)
OnConflict;
},
): type NodeTagClass<Self, ROut, Address> =
Context.ServiceClass<
Self,
string,
NodeProtocol
> &
Address & {
readonly logs: unknown
readonly onConflict: OnConflict
readonly [catalogSym]?: ROut
}
Constructable
Tag
result — Context.ServiceClass plus address fields.
NodeTagClass<function (type parameter) Self in <Self, ROut = never>(): {
(key: string): NodeTagClass<Self, ROut, BareAddress>;
(key: string, target: {
readonly path: string;
readonly kind?: "IpcSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, IpcAddress>;
(key: string, target: number | `:${number}`): NodeTagClass<Self, ROut, HttpAddress>;
(key: string, target: `ws://${string}` | `wss://${string}`): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: `http://${string}` | `https://${string}`): NodeTagClass<Self, ROut, HttpAddress>;
(key: string, target: {
readonly url: `ws://${string}` | `wss://${string}`;
readonly kind?: "WebSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: {
readonly url: string;
readonly kind: "WebSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: {
readonly url: string;
readonly kind: "Http";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, HttpAddress>;
<const T extends ShorthandTarget>(key: string, target: T): NodeTagClass<Self, ROut, MultiAddress<KindsOf<T>>>;
(key: string, target: string | {
readonly url: string;
readonly kind?: ProtocolKind;
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, UrlAddressLoose>;
(key: string, target?: LooseNodeTarget): NodeTagClass<Self, ROut, BareAddress | IpcAddress | HttpAddress | WsAddress | UrlAddressLoose | MultiAddress ...
Self, function (type parameter) ROut in <Self, ROut = never>(): {
(key: string): NodeTagClass<Self, ROut, BareAddress>;
(key: string, target: {
readonly path: string;
readonly kind?: "IpcSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, IpcAddress>;
(key: string, target: number | `:${number}`): NodeTagClass<Self, ROut, HttpAddress>;
(key: string, target: `ws://${string}` | `wss://${string}`): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: `http://${string}` | `https://${string}`): NodeTagClass<Self, ROut, HttpAddress>;
(key: string, target: {
readonly url: `ws://${string}` | `wss://${string}`;
readonly kind?: "WebSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: {
readonly url: string;
readonly kind: "WebSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: {
readonly url: string;
readonly kind: "Http";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, HttpAddress>;
<const T extends ShorthandTarget>(key: string, target: T): NodeTagClass<Self, ROut, MultiAddress<KindsOf<T>>>;
(key: string, target: string | {
readonly url: string;
readonly kind?: ProtocolKind;
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, UrlAddressLoose>;
(key: string, target?: LooseNodeTarget): NodeTagClass<Self, ROut, BareAddress | IpcAddress | HttpAddress | WsAddress | UrlAddressLoose | MultiAddress ...
ROut, type WsAddress = {
readonly url: string
readonly path: undefined
readonly kind: "WebSocket"
}
Dialable WebSocket node fields.
WsAddress>;
function function (local function) build(key: string, target: {
readonly url: string;
readonly kind: "Http";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, HttpAddress> (+10 overloads)
build(
key: stringkey: string,
target: {
readonly url: string
readonly kind: "Http"
readonly onConflict?: OnConflict
}
target: {
readonly url: stringurl: string;
readonly kind: "Http"kind: "Http";
readonly onConflict?: OnConflictonConflict?: type OnConflict =
| "livenessReplace"
| "askIncumbent"
| "reject"
| "inherit"
Directory advertise conflict policy when the same nodeKey already has a row.
livenessReplace — ping incumbent; alive → reject; dead → replace
askIncumbent — if alive, Lookup asks NodeStatus.yield; refuse/timeout → reject
reject — alive → reject; dead → still replace
inherit — continue up the resolve chain (call-site → node → Lookup → hard fallback)
OnConflict;
},
): type NodeTagClass<Self, ROut, Address> =
Context.ServiceClass<
Self,
string,
NodeProtocol
> &
Address & {
readonly logs: unknown
readonly onConflict: OnConflict
readonly [catalogSym]?: ROut
}
Constructable
Tag
result — Context.ServiceClass plus address fields.
NodeTagClass<function (type parameter) Self in <Self, ROut = never>(): {
(key: string): NodeTagClass<Self, ROut, BareAddress>;
(key: string, target: {
readonly path: string;
readonly kind?: "IpcSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, IpcAddress>;
(key: string, target: number | `:${number}`): NodeTagClass<Self, ROut, HttpAddress>;
(key: string, target: `ws://${string}` | `wss://${string}`): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: `http://${string}` | `https://${string}`): NodeTagClass<Self, ROut, HttpAddress>;
(key: string, target: {
readonly url: `ws://${string}` | `wss://${string}`;
readonly kind?: "WebSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: {
readonly url: string;
readonly kind: "WebSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: {
readonly url: string;
readonly kind: "Http";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, HttpAddress>;
<const T extends ShorthandTarget>(key: string, target: T): NodeTagClass<Self, ROut, MultiAddress<KindsOf<T>>>;
(key: string, target: string | {
readonly url: string;
readonly kind?: ProtocolKind;
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, UrlAddressLoose>;
(key: string, target?: LooseNodeTarget): NodeTagClass<Self, ROut, BareAddress | IpcAddress | HttpAddress | WsAddress | UrlAddressLoose | MultiAddress ...
Self, function (type parameter) ROut in <Self, ROut = never>(): {
(key: string): NodeTagClass<Self, ROut, BareAddress>;
(key: string, target: {
readonly path: string;
readonly kind?: "IpcSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, IpcAddress>;
(key: string, target: number | `:${number}`): NodeTagClass<Self, ROut, HttpAddress>;
(key: string, target: `ws://${string}` | `wss://${string}`): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: `http://${string}` | `https://${string}`): NodeTagClass<Self, ROut, HttpAddress>;
(key: string, target: {
readonly url: `ws://${string}` | `wss://${string}`;
readonly kind?: "WebSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: {
readonly url: string;
readonly kind: "WebSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: {
readonly url: string;
readonly kind: "Http";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, HttpAddress>;
<const T extends ShorthandTarget>(key: string, target: T): NodeTagClass<Self, ROut, MultiAddress<KindsOf<T>>>;
(key: string, target: string | {
readonly url: string;
readonly kind?: ProtocolKind;
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, UrlAddressLoose>;
(key: string, target?: LooseNodeTarget): NodeTagClass<Self, ROut, BareAddress | IpcAddress | HttpAddress | WsAddress | UrlAddressLoose | MultiAddress ...
ROut, type HttpAddress = {
readonly url: string
readonly path: undefined
readonly kind: "Http"
}
Dialable http node fields.
HttpAddress>;
function function (local function) build<const T extends ShorthandTarget>(key: string, target: T): NodeTagClass<Self, ROut, MultiAddress<KindsOf<T>>> (+10 overloads)build<const function (type parameter) T in build<const T extends ShorthandTarget>(key: string, target: T): NodeTagClass<Self, ROut, MultiAddress<KindsOf<T>>>T extends type ShorthandTarget = {
readonly http?: string
readonly ws?: string
readonly ipc?: string
readonly onConflict?: OnConflict
readonly url?: never
readonly path?: never
readonly kind?: never
}
The { http, ws, ipc } multi-protocol shorthand target. url/path/kind are pinned to never
so it stays disjoint from the single-address { url, kind } / { path } forms.
ShorthandTarget>(
key: stringkey: string,
target: const T extends ShorthandTargettarget: function (type parameter) T in build<const T extends ShorthandTarget>(key: string, target: T): NodeTagClass<Self, ROut, MultiAddress<KindsOf<T>>>T,
): type NodeTagClass<Self, ROut, Address> =
Context.ServiceClass<
Self,
string,
NodeProtocol
> &
Address & {
readonly logs: unknown
readonly onConflict: OnConflict
readonly [catalogSym]?: ROut
}
Constructable
Tag
result — Context.ServiceClass plus address fields.
NodeTagClass<function (type parameter) Self in <Self, ROut = never>(): {
(key: string): NodeTagClass<Self, ROut, BareAddress>;
(key: string, target: {
readonly path: string;
readonly kind?: "IpcSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, IpcAddress>;
(key: string, target: number | `:${number}`): NodeTagClass<Self, ROut, HttpAddress>;
(key: string, target: `ws://${string}` | `wss://${string}`): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: `http://${string}` | `https://${string}`): NodeTagClass<Self, ROut, HttpAddress>;
(key: string, target: {
readonly url: `ws://${string}` | `wss://${string}`;
readonly kind?: "WebSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: {
readonly url: string;
readonly kind: "WebSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: {
readonly url: string;
readonly kind: "Http";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, HttpAddress>;
<const T extends ShorthandTarget>(key: string, target: T): NodeTagClass<Self, ROut, MultiAddress<KindsOf<T>>>;
(key: string, target: string | {
readonly url: string;
readonly kind?: ProtocolKind;
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, UrlAddressLoose>;
(key: string, target?: LooseNodeTarget): NodeTagClass<Self, ROut, BareAddress | IpcAddress | HttpAddress | WsAddress | UrlAddressLoose | MultiAddress ...
Self, function (type parameter) ROut in <Self, ROut = never>(): {
(key: string): NodeTagClass<Self, ROut, BareAddress>;
(key: string, target: {
readonly path: string;
readonly kind?: "IpcSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, IpcAddress>;
(key: string, target: number | `:${number}`): NodeTagClass<Self, ROut, HttpAddress>;
(key: string, target: `ws://${string}` | `wss://${string}`): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: `http://${string}` | `https://${string}`): NodeTagClass<Self, ROut, HttpAddress>;
(key: string, target: {
readonly url: `ws://${string}` | `wss://${string}`;
readonly kind?: "WebSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: {
readonly url: string;
readonly kind: "WebSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: {
readonly url: string;
readonly kind: "Http";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, HttpAddress>;
<const T extends ShorthandTarget>(key: string, target: T): NodeTagClass<Self, ROut, MultiAddress<KindsOf<T>>>;
(key: string, target: string | {
readonly url: string;
readonly kind?: ProtocolKind;
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, UrlAddressLoose>;
(key: string, target?: LooseNodeTarget): NodeTagClass<Self, ROut, BareAddress | IpcAddress | HttpAddress | WsAddress | UrlAddressLoose | MultiAddress ...
ROut, type MultiAddress<
Kinds extends ProtocolKind
> = {
readonly url: string | undefined
readonly path: string | undefined
readonly kind: Kinds
readonly endpoints: Endpoints
}
A multi-protocol node's fields — its transport endpoints set, kind the union of the set
(the primary at runtime), plus the primary url/path. Single object type (not a union) so
class extends Tag()(…) stays constructable.
MultiAddress<type KindsOf<T> =
| (T extends {
readonly http: string
}
? "Http"
: never)
| (T extends {
readonly ws: string
}
? "WebSocket"
: never)
| (T extends {
readonly ipc: string
}
? "IpcSocket"
: never)
The
ProtocolKind
s present in a { http, ws, ipc } shorthand target.
KindsOf<function (type parameter) T in build<const T extends ShorthandTarget>(key: string, target: T): NodeTagClass<Self, ROut, MultiAddress<KindsOf<T>>>T>>>;
function function (local function) build(key: string, target: string | {
readonly url: string;
readonly kind?: ProtocolKind;
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, UrlAddressLoose> (+10 overloads)
build(
key: stringkey: string,
target: | string
| {
readonly url: string
readonly kind?: ProtocolKind
readonly onConflict?: OnConflict
}
target:
| string
| {
readonly url: stringurl: string;
readonly kind?: ProtocolKindkind?: type ProtocolKind =
| "Http"
| "WebSocket"
| "IpcSocket"
The 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. Inferred from a ws(s):// url, an http target, or { path } →
IpcSocket; otherwise declare it explicitly.
ProtocolKind;
readonly onConflict?: OnConflictonConflict?: type OnConflict =
| "livenessReplace"
| "askIncumbent"
| "reject"
| "inherit"
Directory advertise conflict policy when the same nodeKey already has a row.
livenessReplace — ping incumbent; alive → reject; dead → replace
askIncumbent — if alive, Lookup asks NodeStatus.yield; refuse/timeout → reject
reject — alive → reject; dead → still replace
inherit — continue up the resolve chain (call-site → node → Lookup → hard fallback)
OnConflict;
},
): type NodeTagClass<Self, ROut, Address> =
Context.ServiceClass<
Self,
string,
NodeProtocol
> &
Address & {
readonly logs: unknown
readonly onConflict: OnConflict
readonly [catalogSym]?: ROut
}
Constructable
Tag
result — Context.ServiceClass plus address fields.
NodeTagClass<function (type parameter) Self in <Self, ROut = never>(): {
(key: string): NodeTagClass<Self, ROut, BareAddress>;
(key: string, target: {
readonly path: string;
readonly kind?: "IpcSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, IpcAddress>;
(key: string, target: number | `:${number}`): NodeTagClass<Self, ROut, HttpAddress>;
(key: string, target: `ws://${string}` | `wss://${string}`): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: `http://${string}` | `https://${string}`): NodeTagClass<Self, ROut, HttpAddress>;
(key: string, target: {
readonly url: `ws://${string}` | `wss://${string}`;
readonly kind?: "WebSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: {
readonly url: string;
readonly kind: "WebSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: {
readonly url: string;
readonly kind: "Http";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, HttpAddress>;
<const T extends ShorthandTarget>(key: string, target: T): NodeTagClass<Self, ROut, MultiAddress<KindsOf<T>>>;
(key: string, target: string | {
readonly url: string;
readonly kind?: ProtocolKind;
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, UrlAddressLoose>;
(key: string, target?: LooseNodeTarget): NodeTagClass<Self, ROut, BareAddress | IpcAddress | HttpAddress | WsAddress | UrlAddressLoose | MultiAddress ...
Self, function (type parameter) ROut in <Self, ROut = never>(): {
(key: string): NodeTagClass<Self, ROut, BareAddress>;
(key: string, target: {
readonly path: string;
readonly kind?: "IpcSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, IpcAddress>;
(key: string, target: number | `:${number}`): NodeTagClass<Self, ROut, HttpAddress>;
(key: string, target: `ws://${string}` | `wss://${string}`): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: `http://${string}` | `https://${string}`): NodeTagClass<Self, ROut, HttpAddress>;
(key: string, target: {
readonly url: `ws://${string}` | `wss://${string}`;
readonly kind?: "WebSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: {
readonly url: string;
readonly kind: "WebSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: {
readonly url: string;
readonly kind: "Http";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, HttpAddress>;
<const T extends ShorthandTarget>(key: string, target: T): NodeTagClass<Self, ROut, MultiAddress<KindsOf<T>>>;
(key: string, target: string | {
readonly url: string;
readonly kind?: ProtocolKind;
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, UrlAddressLoose>;
(key: string, target?: LooseNodeTarget): NodeTagClass<Self, ROut, BareAddress | IpcAddress | HttpAddress | WsAddress | UrlAddressLoose | MultiAddress ...
ROut, type UrlAddressLoose = {
readonly url: string
readonly path: undefined
readonly kind: "Http" | "WebSocket"
}
Loose dialable url node — single object type (not a union) so class extends Tag()(…)
stays constructable. Precise overloads return
HttpAddress
/
WsAddress
.
UrlAddressLoose>;
function function (local function) build(key: string, target?: LooseNodeTarget): NodeTagClass<Self, ROut, BareAddress | IpcAddress | HttpAddress | WsAddress | UrlAddressLoose | MultiAddress<ProtocolKind>> (+10 overloads)build(
key: stringkey: string,
target: LooseNodeTarget | undefinedtarget?: type LooseNodeTarget =
| string
| number
| ShorthandTarget
| {
readonly url?: string
readonly path?: string
readonly kind?: ProtocolKind
readonly onConflict?: OnConflict
}
Loose target bag (may omit address — not an
AddressedNode
).
LooseNodeTarget,
): type NodeTagClass<Self, ROut, Address> =
Context.ServiceClass<
Self,
string,
NodeProtocol
> &
Address & {
readonly logs: unknown
readonly onConflict: OnConflict
readonly [catalogSym]?: ROut
}
Constructable
Tag
result — Context.ServiceClass plus address fields.
NodeTagClass<
function (type parameter) Self in <Self, ROut = never>(): {
(key: string): NodeTagClass<Self, ROut, BareAddress>;
(key: string, target: {
readonly path: string;
readonly kind?: "IpcSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, IpcAddress>;
(key: string, target: number | `:${number}`): NodeTagClass<Self, ROut, HttpAddress>;
(key: string, target: `ws://${string}` | `wss://${string}`): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: `http://${string}` | `https://${string}`): NodeTagClass<Self, ROut, HttpAddress>;
(key: string, target: {
readonly url: `ws://${string}` | `wss://${string}`;
readonly kind?: "WebSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: {
readonly url: string;
readonly kind: "WebSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: {
readonly url: string;
readonly kind: "Http";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, HttpAddress>;
<const T extends ShorthandTarget>(key: string, target: T): NodeTagClass<Self, ROut, MultiAddress<KindsOf<T>>>;
(key: string, target: string | {
readonly url: string;
readonly kind?: ProtocolKind;
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, UrlAddressLoose>;
(key: string, target?: LooseNodeTarget): NodeTagClass<Self, ROut, BareAddress | IpcAddress | HttpAddress | WsAddress | UrlAddressLoose | MultiAddress ...
Self,
function (type parameter) ROut in <Self, ROut = never>(): {
(key: string): NodeTagClass<Self, ROut, BareAddress>;
(key: string, target: {
readonly path: string;
readonly kind?: "IpcSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, IpcAddress>;
(key: string, target: number | `:${number}`): NodeTagClass<Self, ROut, HttpAddress>;
(key: string, target: `ws://${string}` | `wss://${string}`): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: `http://${string}` | `https://${string}`): NodeTagClass<Self, ROut, HttpAddress>;
(key: string, target: {
readonly url: `ws://${string}` | `wss://${string}`;
readonly kind?: "WebSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: {
readonly url: string;
readonly kind: "WebSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: {
readonly url: string;
readonly kind: "Http";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, HttpAddress>;
<const T extends ShorthandTarget>(key: string, target: T): NodeTagClass<Self, ROut, MultiAddress<KindsOf<T>>>;
(key: string, target: string | {
readonly url: string;
readonly kind?: ProtocolKind;
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, UrlAddressLoose>;
(key: string, target?: LooseNodeTarget): NodeTagClass<Self, ROut, BareAddress | IpcAddress | HttpAddress | WsAddress | UrlAddressLoose | MultiAddress ...
ROut,
| type BareAddress = {
readonly url: undefined
readonly path: undefined
readonly kind: undefined
}
Bare (address-less) node fields.
BareAddress
| type IpcAddress = {
readonly url: undefined
readonly path: string
readonly kind: "IpcSocket"
}
Dialable ipc node fields.
IpcAddress
| type HttpAddress = {
readonly url: string
readonly path: undefined
readonly kind: "Http"
}
Dialable http node fields.
HttpAddress
| type WsAddress = {
readonly url: string
readonly path: undefined
readonly kind: "WebSocket"
}
Dialable WebSocket node fields.
WsAddress
| type UrlAddressLoose = {
readonly url: string
readonly path: undefined
readonly kind: "Http" | "WebSocket"
}
Loose dialable url node — single object type (not a union) so class extends Tag()(…)
stays constructable. Precise overloads return
HttpAddress
/
WsAddress
.
UrlAddressLoose
| type MultiAddress<
Kinds extends ProtocolKind
> = {
readonly url: string | undefined
readonly path: string | undefined
readonly kind: Kinds
readonly endpoints: Endpoints
}
A multi-protocol node's fields — its transport endpoints set, kind the union of the set
(the primary at runtime), plus the primary url/path. Single object type (not a union) so
class extends Tag()(…) stays constructable.
MultiAddress<type ProtocolKind =
| "Http"
| "WebSocket"
| "IpcSocket"
The 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. Inferred from a ws(s):// url, an http target, or { path } →
IpcSocket; otherwise declare it explicitly.
ProtocolKind>
>;
function function (local function) build(key: string): NodeTagClass<Self, ROut, BareAddress> (+10 overloads)build(
key: stringkey: string,
target: LooseNodeTarget | undefinedtarget?: type LooseNodeTarget =
| string
| number
| ShorthandTarget
| {
readonly url?: string
readonly path?: string
readonly kind?: ProtocolKind
readonly onConflict?: OnConflict
}
Loose target bag (may omit address — not an
AddressedNode
).
LooseNodeTarget,
): type NodeTagClass<Self, ROut, Address> =
Context.ServiceClass<
Self,
string,
NodeProtocol
> &
Address & {
readonly logs: unknown
readonly onConflict: OnConflict
readonly [catalogSym]?: ROut
}
Constructable
Tag
result — Context.ServiceClass plus address fields.
NodeTagClass<
function (type parameter) Self in <Self, ROut = never>(): {
(key: string): NodeTagClass<Self, ROut, BareAddress>;
(key: string, target: {
readonly path: string;
readonly kind?: "IpcSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, IpcAddress>;
(key: string, target: number | `:${number}`): NodeTagClass<Self, ROut, HttpAddress>;
(key: string, target: `ws://${string}` | `wss://${string}`): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: `http://${string}` | `https://${string}`): NodeTagClass<Self, ROut, HttpAddress>;
(key: string, target: {
readonly url: `ws://${string}` | `wss://${string}`;
readonly kind?: "WebSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: {
readonly url: string;
readonly kind: "WebSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: {
readonly url: string;
readonly kind: "Http";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, HttpAddress>;
<const T extends ShorthandTarget>(key: string, target: T): NodeTagClass<Self, ROut, MultiAddress<KindsOf<T>>>;
(key: string, target: string | {
readonly url: string;
readonly kind?: ProtocolKind;
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, UrlAddressLoose>;
(key: string, target?: LooseNodeTarget): NodeTagClass<Self, ROut, BareAddress | IpcAddress | HttpAddress | WsAddress | UrlAddressLoose | MultiAddress ...
Self,
function (type parameter) ROut in <Self, ROut = never>(): {
(key: string): NodeTagClass<Self, ROut, BareAddress>;
(key: string, target: {
readonly path: string;
readonly kind?: "IpcSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, IpcAddress>;
(key: string, target: number | `:${number}`): NodeTagClass<Self, ROut, HttpAddress>;
(key: string, target: `ws://${string}` | `wss://${string}`): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: `http://${string}` | `https://${string}`): NodeTagClass<Self, ROut, HttpAddress>;
(key: string, target: {
readonly url: `ws://${string}` | `wss://${string}`;
readonly kind?: "WebSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: {
readonly url: string;
readonly kind: "WebSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: {
readonly url: string;
readonly kind: "Http";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, HttpAddress>;
<const T extends ShorthandTarget>(key: string, target: T): NodeTagClass<Self, ROut, MultiAddress<KindsOf<T>>>;
(key: string, target: string | {
readonly url: string;
readonly kind?: ProtocolKind;
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, UrlAddressLoose>;
(key: string, target?: LooseNodeTarget): NodeTagClass<Self, ROut, BareAddress | IpcAddress | HttpAddress | WsAddress | UrlAddressLoose | MultiAddress ...
ROut,
| type BareAddress = {
readonly url: undefined
readonly path: undefined
readonly kind: undefined
}
Bare (address-less) node fields.
BareAddress
| type IpcAddress = {
readonly url: undefined
readonly path: string
readonly kind: "IpcSocket"
}
Dialable ipc node fields.
IpcAddress
| type HttpAddress = {
readonly url: string
readonly path: undefined
readonly kind: "Http"
}
Dialable http node fields.
HttpAddress
| type WsAddress = {
readonly url: string
readonly path: undefined
readonly kind: "WebSocket"
}
Dialable WebSocket node fields.
WsAddress
| type UrlAddressLoose = {
readonly url: string
readonly path: undefined
readonly kind: "Http" | "WebSocket"
}
Loose dialable url node — single object type (not a union) so class extends Tag()(…)
stays constructable. Precise overloads return
HttpAddress
/
WsAddress
.
UrlAddressLoose
| type MultiAddress<
Kinds extends ProtocolKind
> = {
readonly url: string | undefined
readonly path: string | undefined
readonly kind: Kinds
readonly endpoints: Endpoints
}
A multi-protocol node's fields — its transport endpoints set, kind the union of the set
(the primary at runtime), plus the primary url/path. Single object type (not a union) so
class extends Tag()(…) stays constructable.
MultiAddress<type ProtocolKind =
| "Http"
| "WebSocket"
| "IpcSocket"
The 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. Inferred from a ws(s):// url, an http target, or { path } →
IpcSocket; otherwise declare it explicitly.
ProtocolKind>
> {
// matches clientHttp's target: a port / ":port" / url resolves to an /rpc url; an explicit
// `{ url }` is used verbatim. IPC nodes omit `url`. Bad positional strings do **not** throw —
// stamp {@link InvalidHttpTarget} and leave the node unaddressed (fail on connect / clientHttp).
let let httpPort: number | undefinedhttpPort: number | undefined;
let let url: string | undefinedurl: string | undefined;
let let path: string | undefinedpath: string | undefined;
let let kind: ProtocolKind | undefinedkind: type ProtocolKind =
| "Http"
| "WebSocket"
| "IpcSocket"
The 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. Inferred from a ws(s):// url, an http target, or { path } →
IpcSocket; otherwise declare it explicitly.
ProtocolKind | undefined;
let let endpoints: Endpointslet endpoints: {
Http: { readonly url: string };
WebSocket: { readonly url: string };
IpcSocket: { readonly path: string };
}
endpoints: Endpoints;
let let invalidTarget:
| InvalidHttpTarget
| undefined
invalidTarget: class InvalidHttpTargetclass InvalidHttpTarget {
name: string;
message: string;
stack: string;
cause: unknown;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
_tag: Tag;
target: string;
}
resolveHttpTarget
/ a positional Node.Tag()(name, badString) got a string that is
neither a port (":3009"), a port number, nor an http(s):// url. Surfaces on the
Layer / Effect error channel (same precedent as
UnaddressedNode
) — never a
sync throw. Catch via Exit / CatchTag when building clientHttp or derived connect.
InvalidHttpTarget | undefined;
if (const isShorthandTarget: (
t: LooseNodeTarget | undefined
) => t is ShorthandTarget
Is a target the { http, ws, ipc } multi-protocol shorthand?
isShorthandTarget(target: LooseNodeTarget | undefinedtarget)) {
// Multi-protocol shorthand `{ http?, ws?, ipc? }` — build the transport set; the primary
// (for single-protocol readers) is http > ws > ipc. `connect` selects from the full set.
const const httpUrl: string | undefinedhttpUrl = target: ShorthandTarget(parameter) target: {
http: string;
ws: string;
ipc: string;
onConflict: OnConflict;
url: never;
path: never;
kind: never;
}
target.http?: string | undefinedhttp;
const const wsUrl: string | undefinedwsUrl = target: ShorthandTarget(parameter) target: {
http: string;
ws: string;
ipc: string;
onConflict: OnConflict;
url: never;
path: never;
kind: never;
}
target.ws?: string | undefinedws;
const const ipcPath: string | undefinedipcPath = target: ShorthandTarget(parameter) target: {
http: string;
ws: string;
ipc: string;
onConflict: OnConflict;
url: never;
path: never;
kind: never;
}
target.ipc?: string | undefinedipc;
let endpoints: Endpointslet endpoints: {
Http: { readonly url: string };
WebSocket: { readonly url: string };
IpcSocket: { readonly path: string };
}
endpoints = {
...(const httpUrl: string | undefinedhttpUrl !== var undefinedundefined ? { Endpoints.Http?: {
readonly url: string;
} | undefined
Http: { url: stringurl: const httpUrl: stringhttpUrl } } : {}),
...(const wsUrl: string | undefinedwsUrl !== var undefinedundefined ? { Endpoints.WebSocket?: {
readonly url: string;
} | undefined
WebSocket: { url: stringurl: const wsUrl: stringwsUrl } } : {}),
...(const ipcPath: string | undefinedipcPath !== var undefinedundefined ? { Endpoints.IpcSocket?: {
readonly path: string;
} | undefined
IpcSocket: { path: stringpath: const ipcPath: stringipcPath } } : {}),
};
let url: string | undefinedurl = const httpUrl: string | undefinedhttpUrl ?? const wsUrl: string | undefinedwsUrl;
let path: string | undefinedpath = const ipcPath: string | undefinedipcPath;
let kind: ProtocolKind | undefinedkind =
const httpUrl: string | undefinedhttpUrl !== var undefinedundefined
? "Http"
: const wsUrl: string | undefinedwsUrl !== var undefinedundefined
? "WebSocket"
: const ipcPath: string | undefinedipcPath !== var undefinedundefined
? "IpcSocket"
: var undefinedundefined;
} else {
let path: string | undefinedpath = typeof target: | string
| number
| {
readonly url?: string
readonly path?: string
readonly kind?: ProtocolKind
readonly onConflict?: OnConflict
}
| undefined
target === "object" && target: {
readonly url?: string
readonly path?: string
readonly kind?: ProtocolKind
readonly onConflict?: OnConflict
}
target !== null ? target: {
readonly url?: string
readonly path?: string
readonly kind?: ProtocolKind
readonly onConflict?: OnConflict
}
target.path?: string | undefinedpath : var undefinedundefined;
if (let path: string | undefinedpath !== var undefinedundefined || target: | string
| number
| {
readonly url?: string
readonly path?: string
readonly kind?: ProtocolKind
readonly onConflict?: OnConflict
}
| undefined
target === var undefinedundefined) {
let url: string | undefinedurl = var undefinedundefined;
} else if (typeof target: | string
| number
| {
readonly url?: string
readonly path?: string
readonly kind?: ProtocolKind
readonly onConflict?: OnConflict
}
target === "object") {
let url: string | undefinedurl = target: {
readonly url?: string
readonly path?: string
readonly kind?: ProtocolKind
readonly onConflict?: OnConflict
}
target.url?: string | undefinedurl;
} else {
// Bare-**port** shorthand (`3009` / `":3009"`) — carry the port so the DIAL resolves the host via
// the client Config (`url` below is only a localhost preview). A full url has no port to carry.
let httpPort: number | undefinedhttpPort =
typeof target: string | numbertarget === "number"
? target: numbertarget
: /^:\d+$/.RegExp.test(string: string): booleanReturns a Boolean value that indicates whether or not a pattern exists in a searched string.
test(target: stringtarget)
? var Number: NumberConstructor
;(value?: any) => number
An object that represents a number of any kind. All JavaScript numbers are 64-bit floating-point numbers.
Number(target: stringtarget.String.slice(start?: number, end?: number): stringReturns a section of a string.
slice(1))
: var undefinedundefined;
const const resolved: Result.Result<
string,
InvalidHttpTarget
>
resolved = const resolveHttpTarget: (
target: number | string
) => Result.Result<string, InvalidHttpTarget>
Resolve a
clientHttp
/ positional Tag target to an RPC url.
Port (3009 / ":3009") → http://localhost:3009/rpc; http(s)://… as-is;
anything else →
InvalidHttpTarget
(Failure). Pure — no throw.
resolveHttpTarget(target: string | numbertarget);
if (import ResultResult.const isSuccess: <
string,
InvalidHttpTarget
>(
self: Result.Result<string, InvalidHttpTarget>
) => self is Result.Success<
string,
InvalidHttpTarget
>
Checks whether a Result is a Success.
When to use
Use to narrow a known Result to the Success variant.
Details
- Acts as a TypeScript type guard, narrowing to
Success<A, E>
- After narrowing, you can access
.success to read the value
Example (Narrowing to success)
import { Result } from "effect"
const result = Result.succeed(42)
if (Result.isSuccess(result)) {
console.log(result.success)
// Output: 42
}
isSuccess(const resolved: Result.Result<
string,
InvalidHttpTarget
>
resolved)) {
let url: string | undefinedurl = const resolved: Result.Success<
string,
InvalidHttpTarget
>
const resolved: {
_tag: "Success";
_op: "Success";
success: A;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
resolved.Success<string, InvalidHttpTarget>.success: stringsuccess;
} else {
let invalidTarget:
| InvalidHttpTarget
| undefined
invalidTarget = const resolved: Result.Failure<
string,
InvalidHttpTarget
>
const resolved: {
_tag: "Failure";
_op: "Failure";
failure: E;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
resolved.Failure<string, InvalidHttpTarget>.failure: InvalidHttpTarget(property) Failure<string, InvalidHttpTarget>.failure: {
name: string;
message: string;
stack: string;
cause: unknown;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
_tag: Tag;
target: string;
}
failure;
let url: string | undefinedurl = var undefinedundefined;
}
}
// `kind` is the SSOT for *how* to reach the node: explicit `{ kind }` wins; else `path` →
// IpcSocket, `ws(s)://` → WebSocket, any other url → Http. Bare / invalid leave kind undefined.
let kind: ProtocolKind | undefinedkind =
(typeof target: | string
| number
| {
readonly url?: string
readonly path?: string
readonly kind?: ProtocolKind
readonly onConflict?: OnConflict
}
| undefined
target === "object" && target: {
readonly url?: string
readonly path?: string
readonly kind?: ProtocolKind
readonly onConflict?: OnConflict
}
target !== null ? target: {
readonly url?: string
readonly path?: string
readonly kind?: ProtocolKind
readonly onConflict?: OnConflict
}
target.kind?: ProtocolKindkind : var undefinedundefined) ??
(let path: string | undefinedpath !== var undefinedundefined
? "IpcSocket"
: let url: string | undefinedurl === var undefinedundefined
? var undefinedundefined
: let url: stringurl.String.startsWith(searchString: string, position?: number): booleanReturns true if the sequence of elements of searchString converted to a String is the
same as the corresponding elements of this object (converted to a String) starting at
position. Otherwise returns false.
startsWith("ws://") || let url: stringurl.String.startsWith(searchString: string, position?: number): booleanReturns true if the sequence of elements of searchString converted to a String is the
same as the corresponding elements of this object (converted to a String) starting at
position. Otherwise returns false.
startsWith("wss://")
? "WebSocket"
: "Http");
// The transport set — one entry from the resolved primary (multi-protocol shorthand / `over*`
// add more). `connect` selects from it; the server asserts its transport is a member.
let endpoints: Endpointslet endpoints: {
Http: { readonly url: string };
WebSocket: { readonly url: string };
IpcSocket: { readonly path: string };
}
endpoints =
let kind: ProtocolKind | undefinedkind === "IpcSocket" && let path: string | undefinedpath !== var undefinedundefined
? { Endpoints.IpcSocket?: {
readonly path: string;
} | undefined
IpcSocket: { path: stringpath } }
: let kind: ProtocolKind | undefinedkind === "WebSocket" && let url: string | undefinedurl !== var undefinedundefined
? { Endpoints.WebSocket?: {
readonly url: string;
} | undefined
WebSocket: { url: stringurl } }
: let kind: ProtocolKind | undefinedkind === "Http" && let url: string | undefinedurl !== var undefinedundefined
? { Endpoints.Http?: {
readonly url: string;
} | undefined
Http: { url: stringurl } }
: {};
}
// Advertise conflict policy — an explicit `{ onConflict }` on the target wins (shorthand included);
// an ordinary node defaults to `"inherit"` (resolved up the chain at advertise time).
const const onConflict: OnConflictonConflict: type OnConflict =
| "livenessReplace"
| "askIncumbent"
| "reject"
| "inherit"
Directory advertise conflict policy when the same nodeKey already has a row.
livenessReplace — ping incumbent; alive → reject; dead → replace
askIncumbent — if alive, Lookup asks NodeStatus.yield; refuse/timeout → reject
reject — alive → reject; dead → still replace
inherit — continue up the resolve chain (call-site → node → Lookup → hard fallback)
OnConflict = const onConflictFromTarget: (
target: LooseNodeTarget | undefined
) => OnConflict | undefined
The advertise policy a construction target carries, if any — the single reader of target.onConflict
for both
Tag
(default "inherit") and
asLookup
(folds via
resolveOnConflict
).
onConflictFromTarget(target: LooseNodeTarget | undefinedtarget) ?? "inherit";
return const assembleNode: <Self, ROut, Addr>(
key: string,
fields: {
readonly url: string | undefined
readonly path: string | undefined
readonly kind: ProtocolKind | undefined
readonly endpoints: Endpoints
readonly onConflict: OnConflict
readonly httpPort?: number
readonly invalidTarget?: InvalidHttpTarget
}
) => NodeTagClass<Self, ROut, Addr>
Assemble a node tag value from resolved address fields — a Context.Service class stamped with the
transport fields, the logs accessor, and the catalog brand. The single place the runtime →
NodeTagClass impedance is bridged: a node's runtime kind is always looser (ProtocolKind |
undefined) than any precise address form Addr, so exactly one construction cast lives here and
every caller (
Tag
,
withProtocol
) stays cast-free.
assembleNode<
function (type parameter) Self in <Self, ROut = never>(): {
(key: string): NodeTagClass<Self, ROut, BareAddress>;
(key: string, target: {
readonly path: string;
readonly kind?: "IpcSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, IpcAddress>;
(key: string, target: number | `:${number}`): NodeTagClass<Self, ROut, HttpAddress>;
(key: string, target: `ws://${string}` | `wss://${string}`): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: `http://${string}` | `https://${string}`): NodeTagClass<Self, ROut, HttpAddress>;
(key: string, target: {
readonly url: `ws://${string}` | `wss://${string}`;
readonly kind?: "WebSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: {
readonly url: string;
readonly kind: "WebSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: {
readonly url: string;
readonly kind: "Http";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, HttpAddress>;
<const T extends ShorthandTarget>(key: string, target: T): NodeTagClass<Self, ROut, MultiAddress<KindsOf<T>>>;
(key: string, target: string | {
readonly url: string;
readonly kind?: ProtocolKind;
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, UrlAddressLoose>;
(key: string, target?: LooseNodeTarget): NodeTagClass<Self, ROut, BareAddress | IpcAddress | HttpAddress | WsAddress | UrlAddressLoose | MultiAddress ...
Self,
function (type parameter) ROut in <Self, ROut = never>(): {
(key: string): NodeTagClass<Self, ROut, BareAddress>;
(key: string, target: {
readonly path: string;
readonly kind?: "IpcSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, IpcAddress>;
(key: string, target: number | `:${number}`): NodeTagClass<Self, ROut, HttpAddress>;
(key: string, target: `ws://${string}` | `wss://${string}`): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: `http://${string}` | `https://${string}`): NodeTagClass<Self, ROut, HttpAddress>;
(key: string, target: {
readonly url: `ws://${string}` | `wss://${string}`;
readonly kind?: "WebSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: {
readonly url: string;
readonly kind: "WebSocket";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, WsAddress>;
(key: string, target: {
readonly url: string;
readonly kind: "Http";
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, HttpAddress>;
<const T extends ShorthandTarget>(key: string, target: T): NodeTagClass<Self, ROut, MultiAddress<KindsOf<T>>>;
(key: string, target: string | {
readonly url: string;
readonly kind?: ProtocolKind;
readonly onConflict?: OnConflict;
}): NodeTagClass<Self, ROut, UrlAddressLoose>;
(key: string, target?: LooseNodeTarget): NodeTagClass<Self, ROut, BareAddress | IpcAddress | HttpAddress | WsAddress | UrlAddressLoose | MultiAddress ...
ROut,
| type BareAddress = {
readonly url: undefined
readonly path: undefined
readonly kind: undefined
}
Bare (address-less) node fields.
BareAddress
| type IpcAddress = {
readonly url: undefined
readonly path: string
readonly kind: "IpcSocket"
}
Dialable ipc node fields.
IpcAddress
| type HttpAddress = {
readonly url: string
readonly path: undefined
readonly kind: "Http"
}
Dialable http node fields.
HttpAddress
| type WsAddress = {
readonly url: string
readonly path: undefined
readonly kind: "WebSocket"
}
Dialable WebSocket node fields.
WsAddress
| type UrlAddressLoose = {
readonly url: string
readonly path: undefined
readonly kind: "Http" | "WebSocket"
}
Loose dialable url node — single object type (not a union) so class extends Tag()(…)
stays constructable. Precise overloads return
HttpAddress
/
WsAddress
.
UrlAddressLoose
| type MultiAddress<
Kinds extends ProtocolKind
> = {
readonly url: string | undefined
readonly path: string | undefined
readonly kind: Kinds
readonly endpoints: Endpoints
}
A multi-protocol node's fields — its transport endpoints set, kind the union of the set
(the primary at runtime), plus the primary url/path. Single object type (not a union) so
class extends Tag()(…) stays constructable.
MultiAddress<type ProtocolKind =
| "Http"
| "WebSocket"
| "IpcSocket"
The 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. Inferred from a ws(s):// url, an http target, or { path } →
IpcSocket; otherwise declare it explicitly.
ProtocolKind>
>(key: stringkey, { url: string | undefinedurl, path: string | undefinedpath, kind: ProtocolKind | undefinedkind, endpoints: Endpoints(property) endpoints: {
Http: { readonly url: string };
WebSocket: { readonly url: string };
IpcSocket: { readonly path: string };
}
endpoints, onConflict: OnConflictonConflict, httpPort?: number | undefinedhttpPort, invalidTarget?: InvalidHttpTarget | undefinedinvalidTarget });
}
return function (local function) build(key: string): NodeTagClass<Self, ROut, BareAddress> (+10 overloads)build;
};