vibe-sketcherDocumentation

vibesketcher.document.draft_session

Atomic review receipts and complete-document undo for a live document store.

Classes

DraftSession([store])

Session-local SDK service; pass the server Store to share its atomic lock.

Receipt(document, source, candidate, review, ...)

class vibesketcher.document.draft_session.Receipt(document: 'str', source: 'Document', candidate: 'Document', review: 'dict[str, Any]', expires: 'float', size: 'int', phase: 'str' = 'review', expected: 'str' = '', retries: 'dict[str, tuple[str, dict[str, Any]]]'=<factory>)[source]

Bases: object

Parameters:
document: str
source: Document
candidate: Document
review: dict[str, Any]
expires: float
size: int
phase: str = 'review'
expected: str = ''
retries: dict[str, tuple[str, dict[str, Any]]]
class vibesketcher.document.draft_session.DraftSession(store=None)[source]

Bases: object

Session-local SDK service; pass the server Store to share its atomic lock.

Receipts expire after 30 minutes, on document close or on process restart. No live receipt is evicted to make room for another one.

Parameters:

store (Store | None)

review(identifier, proposal, *, revision, source_digest)[source]
Parameters:
Return type:

dict[str, Any]

inspect(identifier, token)[source]
Parameters:
  • identifier (str)

  • token (str)

Return type:

dict[str, Any]

discard(identifier, token)[source]
Parameters:
  • identifier (str)

  • token (str)

Return type:

None

transact(identifier, token, action, *, key, revision, source_digest, client='sdk', actor='agent')[source]
Parameters:
  • identifier (str)

  • token (str)

  • action (Literal['apply', 'undo', 'redo'])

  • key (str)

  • revision (int)

  • source_digest (str)

  • client (str)

  • actor (Literal['human', 'agent'])

Return type:

dict[str, Any]