Expand description
Application protocol shared by every Bern entry point.
The schema here is independent of UI frameworks and of any transport encoding. Adapters translate it to a wire format (JSON for control channels, a compact binary layout for in-process bridges) but the meaning of commands, state and values is defined once.
Modules§
- format
- The message format of translated texts:
tr!and enum labels. - shortcut
- Keyboard shortcuts as Bern writes them: the modifiers
cmd(the primary modifier: Command on Apple systems, Control elsewhere),ctrl,altandshift, then one key, joined by+, such as"cmd+k"or"space". Declarations write them as literals, which the compiler normalizes; a shortcut that follows state is a text in the same form, which engines normalize withparse_shortcutbefore they keep it, and every runtime reads by the same rules.
Structs§
- Cancellation
- Signals a query provider that its answer is no longer wanted: the subscription moved on to newer parameters or ended. Clones share the same flag, so the requester and the provider see one request.
- Codec
Error - Command
Error - Structured command failure returned identically to every entry point.
- Command
Outcome - Command
Policy - Command
Spec - Descriptor
Error - EnumDef
- Event
Spec - Something a module reports so the modules depending on it can react,
such as
playback.opened. - External
Names - Explicit, collision-checked names for entries other than the UI.
- Field
Def - Invocation
- A validated command call addressed by catalog index.
- Localized
Text - A user-visible text declared together with all of its translations.
- Module
Part - One module of an application: its catalog, and whether it can be switched off at run time.
- Param
Spec - Protocol
Descriptor - The complete, versioned description of one application protocol: its types, read-only state snapshot and command catalog.
- Reader
- Record
Def - Schema
Error - A value or definition that does not match the declared schema.
- State
Field - State
Update - Changed state fields within one consistent revision.
- Type
Table - Named enum and record definitions referenced by
Type. - Variant
Def - Writer
Enums§
- Command
Status - Lifecycle of a command request. The first version runs commands to
completion before answering; the enum keeps room for long operations
that answer
Acceptedwith a handle first. - Concurrency
- Operation
Kind - Commands perform actions; queries only read and never change state.
- Retry
- Scope
- Whether a command changes engine state or acts on one UI session.
- Session
Command - Identifies one framework session command.
- Type
- Types that may cross a Bern boundary. The first version deliberately limits itself to booleans, numbers, text, enums, optionals, records and lists, each with a defined mapping in every target language.
- Value
- A schema-checked value. Records and enum payloads keep field order from their definition, so encoders never need field names on hot paths.
Constants§
- DESCRIPTOR_
VERSION - Version of the serialized protocol descriptor layout.
- MODULES_
NAMESPACE - Namespace of the commands switching optional modules on and off.
- MODULES_
STATE_ TYPE - Record type of the
modulesstate field: oneboolper optional module, true while the module runs. - PROTOCOL_
VERSION - Version of the application protocol messages exchanged between entries and an engine host. Incompatible peers must fail during the handshake.
- RESERVED_
NAMESPACES - Namespaces used by framework-provided session, window and media commands.
- SET_
ENABLED - Name of the command switching an optional module:
modules.set_enabled.
Functions§
- check_
external_ names - Reject catalogs where two commands would share a CLI path or MCP tool.
- check_
resource_ name - Check a resource name. Every segment uses ASCII letters, digits,
-,_and., and does not start with.; absolute paths, empty segments,..and backslashes are rejected. The error explains why. - command_
offsets - Where each part’s commands start in the composed catalog: the shell at
0, then every module in order.
modules.set_enabled, if any, follows. - compose
- The application catalog: the shell’s state and commands first, then each module in order. Module query reads name the module’s own fields; in the application they read the module’s state field as a whole.
- decode
- Decode and validate a value of type
ty. - encode
- Encode a value that has already been checked against
ty. - fingerprint_
bytes - Stable 64-bit FNV-1a hash used for catalog fingerprints.
- label_
key - Resource key of an enum variant label.
- module_
state_ type - Name of the record holding a module’s state:
downloadsgivesDownloadsState,network_sourcesgivesNetworkSourcesState. - session_
catalog - Type table and command specs for the framework session catalog.
- valid_
name