Skip to content

listProtocols

function listProtocols(target): Promise<HostedProtocol[]>;

Defined in: src/client/introspect.ts:516

List the protocols a server hosts, over a client the caller already holds.

One round trip – vgi_rpc.Reflection.v1.list_protocols – on target’s own connection; nothing new is opened and nothing is closed. Over HTTP the call shares the client’s fetch, prefix, authorization, session scope, compression and response budget; over a byte-stream transport (pipe, subprocess, TCP, Iroh) it shares the client’s stream, which the server demultiplexes by each request’s protocol key – so, like any other call on such a client, it cannot run while a stream is open on it.

target may be bound to any protocol the server hosts; only its connection matters.

Parameter Type
target RpcClient

Promise<HostedProtocol[]>

One HostedProtocol per hosted protocol, in the server’s order.

The server does not host reflection. The connection is still usable.

Any other server error, or a transport failure.