Skip to main content

Module authors

Module authors 

Expand description

Resolving an automerge actor id to the person behind it.

tilo_resource::history::Version hands back an actor_hex — a raw hex string, unreadable on its own. This module is the join.

Three shapes occur in documents: a raw 32-byte public key (the only cryptographically meaningful one, joining to a collab_types::Identity); a self-declared handle (ActorId::from(app_id.as_bytes()), the same key tilo_ui::presence::user_color and the per-character author marks already use, but unverified); and a random id (ActorId::random(), which resolves to nobody).

For an unknown actor, use UNKNOWN_AUTHOR_NAME as the name, the first eight hex characters as the label, and the same crate::presence::user_color / crate::presence::PEER_PALETTE slot presence uses for that identity, so history and presence cannot disagree.

Structs§

AuthorDirectory
Maps automerge actor ids to the people the chrome should name.
DeviceActors
The actors a device writes as, to tell its changes apart: its record writer, and the device_actor of any handle on it.
HistoryAgent
A delegated agent as history names it: its own principal, how it is shown, and the person it acts for.
RosterAgent
A delegated agent on a room’s roster, as the session verified it: its own device key, the person whose root signed its delegation for exactly that device, and how it is shown. Only the session produces these, after checking that delegation; history uses them to name who wrote and never to decide what anyone may do.

Constants§

UNKNOWN_AUTHOR_NAME
Display name used for an actor with no registered identity and no self-declared handle. Deliberately not a person’s name.

Functions§

actor_handle
Decode an actor id back to the handle the authoring process chose for itself, when it did. ActorId::from(&[u8]) stores the bytes verbatim, so set_actor(ActorId::from(app_id.as_bytes())) leaves the UTF-8 of app_id in the hex. Returns None for anything not a plausible handle (odd-length /non-hex input, non-UTF-8, control chars, empty, or too long); a 32-byte public key almost never survives this filter.
agent_display_label
name with the localized agent kind label, as every agent is shown in history, presence and activity.
agent_principal_name
The readable name of an agent:<id> principal, without the kind label: the id, or the localized unknown-agent name when it is empty. None for any principal that is not an agent. For surfaces that already mark the actor as software, such as an agent badge.
author_coloured
History row whose colour is already decided (a person’s own colour).
author_for_identity
History row for identity: the shared palette slot, same RGB crate::presence::user_color / crate::presence::PresenceCtx::color_for pick when no override is set.
device_actor
The actor handle writes a document as from the device whose record writer is device: the handle, which actor_handle reads back, and a part only that device has. Automerge numbers each actor’s changes, so one person writing from two devices under the bare handle would make two different changes with the same number, which no replica can merge.
local_identity_author
Build a HistoryAuthor from the local identity (crate::local_identity), if there is one. Public because the shell wants the same answer for its own chrome without having to own an AuthorDirectory.
participant_display_label
Turn a durable collaboration principal into copy suitable for people-facing history and audit UI.
read_as
The principal of the person this thread’s app runs for: whose changes every history read on this thread shows as theirs.
set_room_agents
Replace the verified agents of room this thread’s app names in its history (AuthorDirectory::with_room_agents). Only the session’s context stream calls this, with what it verified.
short_id
First SHORT_LEN hex characters of an actor id, for the dim monospace label next to the name. Short ids are returned whole.
stable_hue
Deterministic avatar hue for an actor with no registered colour: FNV-1a over the actor hex, folded into [0, 360). Same actor, same hue in every process and on every peer.