Skip to main content

Module context

Module context 

Expand description

The history entry an action carries into its committed change.

The action payload says how to reproduce a mutation. ActionContext is the entry history keeps of it: who acted and for whom, in which task or run, on which resource and item (with the item’s label at the time), what was done (Did), and what kind of change it was. It contains no sentence: readers render one in their own language, and agents, scripts and logs read the data. The caller supplies who and why (invoker, purpose, group); the executor fills in what, from the action itself.

Structs§

ActionApp
ActionContext
ActionFacet
A filterable activity dimension. Open key/value vocabulary lets future apps add facets without changing the wire enum.
ActionGroup
ActionInvoker
The invoker of one action: the authenticated actor, its kind, the person it acts for, and optionally the participant whose view the invocation resolves against.
ActionResource
Cause
The run of a bot that made a change, and how deep in a chain of runs it is: a run fired by a change that itself came from a run is one deeper. Correlation only; it grants nothing. The dispatcher fires nothing past a depth of four, so two bots answering each other stop.
ParticipantId
One participant in a shared record: a person’s window or an agent task. Each participant owns its own view state (caret, selection, Find), and the app builds that participant’s resource tree from it (the toolkit’s PublishesResources::resources_for).

Enums§

ChangeKind
What a change is to the people sharing a document. Every kind is durable, shared and kept in the document’s own history; they differ in whether a person takes the change back and whether a feed of what people did to the workspace shows it.

Constants§

AGENT_TASK_PARTICIPANT_PREFIX
Reserved namespace of ParticipantId::for_agent_task.
CHANGE_MESSAGE_PREFIX
Prefix used when an entry is embedded in an Automerge change message, followed by the entry in its compact form (crate::compact). Ordinary application-authored commit messages remain untouched.
COMPENSATION_BUDGET
The most an entry’s compensation may take, encoded: an action whose inverse is larger is refused.
CONTINUATION_PREFIX
Prefix of a change message that continues its writer’s open gesture (the next keystroke of a word): tilo.cont/1 <gesture> <path> <payload>. It is the gesture’s first entry again but for the action’s payload, so it carries only the gesture (simple hex), the edit’s path (body, rows/r1/title; - for none) and the action’s JSON payload, whose type is the first entry’s. Readers fold it into that entry (ActionContext::continued).
HISTORY_BUDGET
The most an entry’s action may take, encoded.
MAX_PARTICIPANT_ID_BYTES
Upper bound on a ParticipantId in bytes. Participants key bounded per-view maps in app workers; they are never free text.
RISK_FACET
ActionFacet::key of the risk (crate::RiskLevel::name) of the action a context describes, for a question about it put to a person.