vibesketch.agent.client¶
A small client for vibe-sketch’s REST API, on the standard library alone.
The MCP server calls the same API the browser does, so an agent’s edit and a human’s go through one revision counter and show up in each other’s view.
Functions
|
The address of a vibe-sketch server running on this machine, or |
|
Start a vibe-sketch server in a background thread; returns its address. |
Classes
|
JSON calls against one vibe-sketch server. |
Exceptions
|
The server answered with an error status; |
- class vibesketch.agent.client.RestClient(base_url, *, timeout=300.0)¶
Bases:
objectJSON calls against one vibe-sketch server.
- raw(method, path, body=None)¶
The response body and its content type; raises
ServerError.
- exception vibesketch.agent.client.ServerError(status, detail)¶
Bases:
RuntimeErrorThe server answered with an error status;
detailis its explanation.- Parameters:
status (int)
detail (Any)
- Return type:
None
- vibesketch.agent.client.find_server(host='127.0.0.1', ports=range(8766, 8776))¶
The address of a vibe-sketch server running on this machine, or
None.servetakes the first free port from 8766, so the search walks the same range and recognises vibe-sketch by its session route.
- vibesketch.agent.client.start_server(store=None, host='127.0.0.1')¶
Start a vibe-sketch server in a background thread; returns its address.
The port is chosen by the operating system and the socket is handed to uvicorn already bound, so no other process can take it in between.