vibe-sketcherDocumentation

vibesketcher.server.periodic_graph

REST routes for periodic bond graphs and crystal preparation (#200).

Every mutation is checked against the document revision and recorded as an edit; graph edits and applied preparations have their own undo routes, which refuse when the structure changed since.

Functions

router(store)

Classes

GraphEditRequest(*[, actor, client])

PreparationPreviewRequest(*, preparation)

A preview reads the current document; the answer names its revision.

PreparationRequest(*[, actor, client, ...])

PreparationUndoRequest(*[, actor, client])

class vibesketcher.server.periodic_graph.GraphEditRequest(*, actor='agent', client='rest', revision, operations)[source]

Bases: RevisionRequest

Parameters:
  • actor (Literal['human', 'agent', 'system'])

  • client (Annotated[str, _PydanticGeneralMetadata(pattern='^[a-z0-9][a-z0-9_.:+-]{0,63}$')])

  • revision (int)

  • operations (Annotated[list[dict[str, Any]], MinLen(min_length=1), MaxLen(max_length=1000)])

operations: list[dict[str, Any]]
model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class vibesketcher.server.periodic_graph.PreparationPreviewRequest(*, preparation)[source]

Bases: BaseModel

A preview reads the current document; the answer names its revision.

Parameters:

preparation (dict[str, Any])

model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

preparation: dict[str, Any]
class vibesketcher.server.periodic_graph.PreparationRequest(*, actor='agent', client='rest', revision, preparation, source_sha256=None)[source]

Bases: RevisionRequest

Parameters:
  • actor (Literal['human', 'agent', 'system'])

  • client (Annotated[str, _PydanticGeneralMetadata(pattern='^[a-z0-9][a-z0-9_.:+-]{0,63}$')])

  • revision (int)

  • preparation (dict[str, Any])

  • source_sha256 (Annotated[str | None, _PydanticGeneralMetadata(pattern='^[0-9a-f]{64}$')])

preparation: dict[str, Any]
source_sha256: str | None
model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class vibesketcher.server.periodic_graph.PreparationUndoRequest(*, actor='agent', client='rest', revision, structure)[source]

Bases: RevisionRequest

Parameters:
  • actor (Literal['human', 'agent', 'system'])

  • client (Annotated[str, _PydanticGeneralMetadata(pattern='^[a-z0-9][a-z0-9_.:+-]{0,63}$')])

  • revision (int)

  • structure (str)

structure: str
model_config = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

vibesketcher.server.periodic_graph.router(store)[source]
Parameters:

store (Store)

Return type:

APIRouter