vibesketcher.agent.client¶
A small client for vibe-sketcher’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-sketcher server running on this machine, or |
|
Start a vibe-sketcher server in a background thread; returns its address. |
Classes
|
JSON calls against one vibe-sketcher server. |
Exceptions
|
The server answered with an error status; |
- class vibesketcher.agent.client.RestClient(base_url, *, timeout=300.0)[source]¶
Bases:
objectJSON calls against one vibe-sketcher server.
- raw(method, path, body=None)[source]¶
The response body and its content type; raises
ServerError.
- exception vibesketcher.agent.client.ServerError(status, detail)[source]¶
Bases:
RuntimeErrorThe server answered with an error status;
detailis its explanation.- Parameters:
status (int)
detail (Any)
- Return type:
None
- vibesketcher.agent.client.find_server(host='127.0.0.1', ports=range(8766, 8776))[source]¶
The address of a vibe-sketcher server running on this machine, or
None.servetakes the first free port from 8766, so the search walks the same range and recognises vibe-sketcher by its session route.