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§
- Action
App - Action
Context - Action
Facet - A filterable activity dimension. Open key/value vocabulary lets future apps add facets without changing the wire enum.
- Action
Group - Action
Invoker - 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.
- Action
Resource - 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.
- Participant
Id - 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§
- Change
Kind - 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
compensationmay 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
actionmay take, encoded. - MAX_
PARTICIPANT_ ID_ BYTES - Upper bound on a
ParticipantIdin bytes. Participants key bounded per-view maps in app workers; they are never free text. - RISK_
FACET ActionFacet::keyof the risk (crate::RiskLevel::name) of the action a context describes, for a question about it put to a person.