initialize is the first request on every connection. No other method except
info may precede it. It negotiates the protocol version and exchanges
capabilities.
initialize
Request params
integer
required
The highest protocol version the client supports. Each peer supports the
contiguous range
[1 .. protocolVersion].object
{ name, version } — the client’s identity, for logs and diagnostics.object
What the client can consume (same presence ⇒ supported shape). RCP/1 requires
none — a client MAY advertise
streaming (ready to receive progress) or
log. Servers treat these as hints and MUST NOT require any.Response result
integer
The negotiated version,
min(client, server), governing the connection for
its lifetime.object
{ name, version } — the server’s identity.object
Exactly what the server offers. See Capabilities.
Version negotiation
TheprotocolVersion on the wire is the highest each peer supports. The
negotiated version is min(client.protocolVersion, server.protocolVersion) and
is what the server returns.
1
Server floor
Because RCP/1 is the floor, the negotiated result is always
≥ 1 in
practice. A server returns -32002 (VersionMismatch) only if it cannot
satisfy the floor.2
Client floor
A client that receives a negotiated version lower than its own minimum
MUST abort rather than speak a dialect it does not implement.
info
info has the same shape as initialize.result but causes no state
change and is callable at any time — before initialize, or to re-read
identity and capabilities later.
info, ping, and shutdown are the only methods a server answers before
initialize. Every capability-gated method called pre-initialize returns
-32001 (NotInitialized).