roboto.uri#

The roboto:// URI scheme, a host-independent reference to one platform entity.

roboto://<type>/<id> names an entity without naming a web address. Platform event payloads, AI chat answers, and notifications all identify entities this way; opening one in the Roboto web app lands on that entity’s page. A URI may carry a ?t= epoch nanosecond timestamp, which asks a time-aware page to open at that instant.

Module Contents#

roboto.uri.ROBOTO_URI_IN_TEXT_PATTERN#

Finds where a roboto:// URI starts and ends inside prose, for callers rewriting URIs into links. Deliberately looser than RobotoUri.parse(): it matches text this module refuses to parse, because a finder that skipped a malformed URI would leave it in the rendered output as raw text.

roboto.uri.ROBOTO_URI_SCHEME = 'roboto'#
class roboto.uri.RobotoUri#

A parsed roboto://<type>/<id> reference, optionally carrying a timestamp.

str() renders it back to URI text in normalized form: the type is lowercased, empty path segments are dropped, and only the t query parameter survives, so str(RobotoUri.parse(text)) equals text only when text is already normalized.

Raises:

ValueErrorid is empty, or timestamp_ns is negative.

id: str#
classmethod parse(text)#

Read roboto://<type>/<id>, with an optional ?t=<epoch_ns>, into its parts.

Query parameters other than t are ignored and the entity type is matched case-insensitively, so a URI written by any Roboto surface parses here.

Parameters:

text (str) – The URI to read. Anything else raises rather than returning None, so a caller sifting arbitrary prose should locate candidates with ROBOTO_URI_IN_TEXT_PATTERN first.

Raises:

ValueErrortext is not a roboto:// URI, names a type outside RobotoUriType, carries no entity id or more than one path segment, or carries a t that is not a whole number of nanoseconds.

Return type:

RobotoUri

timestamp_ns: int | None = None#

The instant this URI points at, in nanoseconds since the Unix epoch, written as the URI’s ?t= parameter. None when the URI names an entity and no instant. Only pages showing data over time act on it; the rest ignore it.

type: RobotoUriType#
class roboto.uri.RobotoUriType#

Bases: roboto.compat.StrEnum

The entity kinds a roboto:// URI may name.

A roboto:// URI whose type is absent from this enum names no entity. The web app relies on that to reserve type names for links addressing its own controls rather than an entity, so an unrecognized type is ordinary input, not corruption.

Collection = 'collection'#
Dataset = 'dataset'#
Device = 'device'#
Event = 'event'#
File = 'file'#
Invocation = 'invocation'#
Layout = 'layout'#
MessagePath = 'msgpath'#
Org = 'org'#
Session = 'session'#
Topic = 'topic'#
Trigger = 'trigger'#
Workspace = 'workspace'#
roboto.uri.TIMESTAMP_QUERY_PARAM = 't'#

Query parameter naming the instant a URI points at, in epoch nanoseconds.