vibesketch.server

The FastAPI application behind vibe-sketch serve.

The API (/api): version and liveness, the document JSON schema and validation, the revisioned document store with import, report, render and export (vibesketch.server.documents), and the input writers. Each route mirrors an SDK call and a CLI command (AGENTS.md, ground rule 4). OpenAPI is served at /openapi.json, so a client can read the contract instead of guessing it. Everything else is the browser shell, served from its built bundle.

Functions

create_app([store, web_root, hosts, max_body])

Build the application.

web_bundle()

The built browser shell: VIBESKETCH_WEB_DIST, the package, or the checkout.

Classes

InputFileOut(*, name, media_type, content)

InputRequest(*, document[, job, species, ...])

Which input to write: a job of the document, or a species and a writer.

InputResponse(*, program, species, files)

ValidationReport(*, valid, errors)

Whether a document is valid, and every problem when it is not.

WriterInfo(*, name, description, tasks, fields)

vibesketch.server.create_app(store=None, *, web_root=None, hosts=None, max_body=None)[source]

Build the application. One instance per server process.

store holds the documents (a fresh one by default); web_root is the built browser shell (found with web_bundle() by default). hosts are the only names the server answers for, and the only origins it takes requests from (vibesketch.server.guard); a loopback server passes LOOPBACK. Request bodies are bounded by max_body bytes, by default vibesketch.limits.MAX_REQUEST_BYTES.

Parameters:
Return type:

FastAPI

vibesketch.server.web_bundle()[source]

The built browser shell: VIBESKETCH_WEB_DIST, the package, or the checkout.

Return type:

Path | None

Modules

documents

Document routes: create, read, edit, import, report, render, export, save.

guard

The local server's front door: who may talk to it and how much they may send (#69).

store

The server's documents: in memory, revisioned, optionally backed by a file.