Module app_surface
Expand description
Which app surface the changes an app makes are decided against.
Every signed op names the content hash of its app’s surface.toml
([collab_types::SignedOp::surface]), the file the app’s package ships at
its payload root. Whoever starts the app names that file
(SURFACE_FILE_ENV) and its hash (SURFACE_HASH_ENV): the launcher
the file in the package it runs, tilo-app run/dev the app’s committed
file. The app reads it, checks the hash and registers it
(register_named); an app’s own binary does not carry the file. A host
that runs an app in its own process (the shell’s built-in apps, the web
build) carries its committed file instead (register_built_in). The bytes
are kept in the app’s content store, from where they reach the devices and
relays that decide its changes.
Constants§
- SURFACE_
FILE_ ENV - The variable naming the path of the app’s
surface.toml. - SURFACE_
HASH_ ENV - The variable carrying the lowercase hex hash of that file, as whoever started the app read it.
Functions§
- bytes_
of - The surface bytes of
app_id, when this process carries them. - hash_of
- The hash of the surface
app_id’s changes are decided against. - hash_
of_ kind - The hash of the surface the changes to a record of kind
kindare decided against: its app’s. - keeps_
person_ record - Whether
app_id’s surface declares the person’s records ofkind. - launch_
env - The variables that name
bytes, read frompath, as an app’s surface: what a host that starts an app sets in its environment. - parse_
hash - Parse a lowercase hex hash, as
SURFACE_HASH_ENVcarries it. - person_
record_ kinds - The person-record kinds
app_id’s surface declares (itsResourceApp::records): the records it may keep in, or read from, the person’s own room. Empty when this process holds no surface for it. - register_
built_ in - Name
bytes, the committed surface of an app a host runs in its own process (built into the host, no package of its own), forapp_id, unless a package already named one. - register_
kind - Records of kind
kindbelong to the appapp_id. - register_
named - Name
bytes, the surface file whoever started the app named, forapp_id, when they hash tohash, the hash it was named with. - register_
package - Name
bytes, the surface the signed packageapp_idships, as the one it runs with, replacing any its host held before (an update of the app).