Skip to main content

Module app_surface

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 kind are decided against: its app’s.
keeps_person_record
Whether app_id’s surface declares the person’s records of kind.
launch_env
The variables that name bytes, read from path, 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_ENV carries it.
person_record_kinds
The person-record kinds app_id’s surface declares (its ResourceApp::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), for app_id, unless a package already named one.
register_kind
Records of kind kind belong to the app app_id.
register_named
Name bytes, the surface file whoever started the app named, for app_id, when they hash to hash, the hash it was named with.
register_package
Name bytes, the surface the signed package app_id ships, as the one it runs with, replacing any its host held before (an update of the app).