Skip to main content

Module ipc

Module ipc 

Source
Expand description

JSON-RPC 2.0 based IPC protocol for the synwire daemon.

The daemon communicates with MCP server proxies over a Unix domain socket using newline-delimited JSON (NDJSON). Each line is a complete JSON-RPC 2.0 request or response object.

§Supported methods

Method stringVariantDescription
indexIpcMethod::IndexTrigger indexing for a worktree
searchIpcMethod::SearchSemantic vector search
graph_queryIpcMethod::GraphQueryCode graph query
graph_searchIpcMethod::GraphSearchCode graph search
community_searchIpcMethod::CommunitySearchCommunity detection search
hybrid_searchIpcMethod::HybridSearchHybrid vector + BM25 search
clone_repoIpcMethod::CloneRepoClone a repository
xref_queryIpcMethod::XrefQueryCross-reference query
index_statusIpcMethod::IndexStatusCheck indexing status

§Wire format

Each message is a single UTF-8 JSON object terminated by \n. The daemon reads one line at a time, deserialises it as an IpcRequest, dispatches the method, and writes back an IpcResponse followed by \n.

Structs§

IpcError
A JSON-RPC 2.0 error object.
IpcRequest
A JSON-RPC 2.0 request received from a client over the UDS.
IpcResponse
A JSON-RPC 2.0 response sent back to the client.

Enums§

IpcMethod
The set of IPC methods the daemon understands.

Constants§

ERROR_INTERNAL
Error code: an internal error occurred while processing the request.
ERROR_INVALID_PARAMS
Error code: invalid method parameters.
ERROR_METHOD_NOT_FOUND
Error code: the requested method does not exist.
ERROR_PARSE
Error code: the request could not be parsed as valid JSON-RPC.

Functions§

read_request
Read a single JSON-RPC request from a newline-delimited stream.
write_response
Write a JSON-RPC response as a single newline-terminated JSON line.