pkg:clod/com.clodhub/display-mode 0.13.0 Keeps a shared screen, such as a television showing the table, from acting, using the camera or microphone, or showing private information. Some applications run on a shared screen as well as on each person's device: a television showing the table to the room, a tablet propped up as a scoreboard. A shared screen is seen by everyone, so it must never show one person's private information, never act on anyone's behalf and never turn on a camera or microphone. `display-mode` gives the application one switch for that. A session is either in `player` mode (a person's own device) or `board` mode (a shared screen). The application asks the component before it acts, captures media or shows private data, and the answer is no on a board. On the web, `createMode(initial, eventName)` holds the current mode; publishing a new mode records it on the page (`data-mode` on the document element, so styles can hide private parts) and then sends a browser event that other components listen for, so video stops the moment a screen becomes a board. `displayCapabilities(board)` answers `canAct`, `canCapture` and `canSeePrivate`, all false on a board. Apple (Swift) and Android (Kotlin) have the same three answers as `DisplayPolicy`. This component decides what the device itself does. It does not sign anyone in and does not hide data on the server: the server must still send a board only public information. Examples Four friends play cards on their phones and put the table on the living-room television. The television's session switches to `board`: it shows the shared cards and the pot, but no one's own cards, its buttons do nothing, and if video was on it stops at once. A phone stays in `player` mode: its owner sees their cards and can bet. A person who turns their phone into a board for a moment loses those rights until they switch back. Package URL: pkg:clod/com.clodhub/display-mode@0.13.0 Class: Display mode (pkg:clod/com.clodhub/display-mode-class@1.1.0): A shared screen, such as a television, that shows the table and never acts. Any component of this class can fill a recipe slot that asks for it. Category presentation/shared-screens; https://clodhub.com/classes/display-mode-class.txt; 0 other components of this class: https://clodhub.com/components.txt?class=pkg%3Aclod%2Fcom.clodhub%2Fdisplay-mode-class Provides (1) - display-policy (com.clodhub/display-policy 1.0.0): Mode publication and display capability restrictions. createMode and displayCapabilities are TypeScript (web/mode.ts); DisplayPolicy.canAct, canCapture and canSeePrivate are Swift (enum DisplayPolicy) and Kotlin (object com.clodhub.display.DisplayPolicy). Every capability is false for a display on every platform. This policy does not authorize requests or redact server responses. components that use it: https://clodhub.com/components.txt?requires=com.clodhub%2Fdisplay-policy Requires (1) - display-mode-configuration (com.clodhub/display-mode-configuration 1.0.0, optional): The application's arguments to createMode. Persistence and authentication belong to the application. components that provide it: https://clodhub.com/components.txt?provides=com.clodhub%2Fdisplay-mode-configuration Settings (0) There are no installer settings. The application gives two values in code when it creates the mode (or through the optional `display-mode-configuration` port): - `initial`: the mode a session starts in, `player` or `board`. Most applications start in `player` and switch to `board` when the person chooses "use this screen as the table". - `eventName`: the name of the browser event sent on each change, any non-empty text such as `app:mode`. Every component that reacts to the mode (video-calls, windows-desktop) must be given the same name. Remembering the chosen mode between visits is up to the application. Depends on components: none How to use in a recipe A recipe uses it through a slot of class Display mode (pkg:clod/com.clodhub/display-mode-class 1.1.0), naming pkg:clod/com.clodhub/display-mode as the slot's preferred component or substituting it for another component of the class. The recipe connects what it provides (display-policy) to the slots that use it. What it can use (display-mode-configuration) may stay unconnected. It has no settings. - as a slot in recipe.json components: {"id":"display-mode","class":{"name":"pkg:clod/com.clodhub/display-mode-class","version":"1.1.0","digest":"4b40dc93ba42ba8423e824e14a6cc706ee24f98def98d2abc453e3d6f2fc49e5"},"preferred":{"name":"pkg:clod/com.clodhub/display-mode","version":"0.13.0"}} - in place of another component of the class: clod fetch display-mode@0.13.0 --store store --from https://clodhub.com, then clod design RECIPE@VERSION --store store --answers answers.json --substitute SLOT=display-mode@0.13.0 --out definition.json Used by recipes: pkg:clod/com.clodhub/ourpoker-recipe 0.13.0 (slot display-mode) For developers: how an application uses it Create the mode once when the application starts and publish the starting mode before anything can capture media: ```ts import { createMode, displayCapabilities } from "./components/display-mode/web/index"; const mode = createMode("player", "app:mode"); mode.publish(mode.current()); const board = () => mode.current() === "board"; if (displayCapabilities(board()).canAct) sendMove(move); ``` Call `displayCapabilities` (or `DisplayPolicy` on Apple and Android) at every point where the device would act, open the camera or microphone, or show private data. Give video-calls and windows-desktop the same event name so they react to a switch. The server must still decide for itself what a board may see. `examples/consumer.ts` is a complete small example. Accounts and services None. It runs inside the application on each device; no accounts, services or costs. How it is checked `node --test tests/mode.test.mjs` (required) checks, against `tests/fixtures/modes.json`, that a board may not act, capture or see private data and a player may; and that publishing records the mode on the page and in `current()` before the event is sent, that the event carries the new mode, and that two modes created side by side do not affect each other. `python3 scripts/check-native.py apple` and `python3 scripts/check-native.py android` compile the Swift and Kotlin `DisplayPolicy` and check the same three answers. Updates Updates replace the component's files; it stores nothing. The mode names `player` and `board`, the page marker and the event's `{mode}` detail are part of the contract, so changing any of them is a new major version. Removing the component leaves any mode the application remembered in its own storage. Tags: display, mode, presentation, shared-screens Targets: client android, ios, macos, tvos, web, windows; server none Publisher: George McIntyre (george-mcintyre) Guardians: Level N Ltd (guardian key 08775f20) Source: clodhub/display-mode release v0.13.0; digest sha256:31c4ae0162ec870fbba54a9e8f120da7a29def1e08afca4be58f7470d43c65ad Release: features Line 0.13: no security releases Quality: Integration-tested, certified Known vulnerabilities: none known (checked 2026-11-26 at OSV); https://clodhub.com/api/components/display-mode/0.13.0/vulnerabilities Downloads: 1 in 30 days; 1 of this version Classes: https://clodhub.com/classes.txt; this component as JSON: https://clodhub.com/api/components/display-mode/0.13.0 Bundle download: GET https://clodhub.com/api/components/display-mode/0.13.0/bundle returns a link valid for one hour Implements: pkg:clod/com.clodhub/display-mode-class@1.1.0 4b40dc93ba42ba8423e824e14a6cc706ee24f98def98d2abc453e3d6f2fc49e5 com.clodhub/display-policy 1.0.0 entry modules: android android/src/main/java, ios apple/Sources, macos apple/Sources, tvos apple/Sources, web web/index.ts, windows web/index.ts shared behaviour suites: shared Platforms: android, ios, macos, tvos, web, windows Toolchains: android >=8.0.0, ios >=17.0.0, java >=17.0.0 <27.0.0, kotlin =2.4.21, macos >=14.0.0, node >=26.5.0 <27.0.0, swift =6.4.2, tvos >=17.0.0 Frameworks: none Styles: scope none; 0 namespaces; 0 conflicts Licence: Apache-2.0; 0 upstream sources, 0 exact dependencies, 31 files (listed on the details page) Suitable for jobs: display-mode profile any: cost none; load none; regions any; compliance none Notes: Pure policy library; no hosted service, account or measured load. Data migration: this component keeps no data Maintainers: Level N Ltd; https://github.com/clodhub/display-mode/issues; updates https://github.com/clodhub/display-mode/releases (manual) What you download display-mode-0.13.0.tar, from release v0.13.0 of clodhub/display-mode: 31 files - Documents and manifests (11): CONTRACT.md, INSTRUCTIONS.md, LICENCE, NOTICE, PROVENANCE.md, SOURCE.json, ... - Source code (4): android/ (1), apple/ (1), web/ (2) - Tests (4): android/ (1), apple/ (1), fixtures/ (1), mode.test.mjs - Interface documents (2): display-policy.json, required-display-mode-configuration.json - Class files: the class's interfaces and shared checks (3): display-mode-class/ (3) - Examples (1): consumer.ts - Diagrams (5): definition.json, examples/ (1), output/ (3) - Scripts (1): check-native.py Installing copies 4 of them into the application under components/display-mode/: android 1, apple 1, web 2 Not included: the components that provide what it requires (com.clodhub/display-mode-configuration), each a separate download; the values of its settings, which the recipe writes; any secret The archive is a release file on the publisher's public GitHub repository; ClodHub keeps this page and a pointer to the release, not the code. clod checks the archive's sha256 fingerprint before anything is copied, and installing runs none of the package's code. Versions - 0.13.0 features (2026-11-26T11:26:23.192Z) sha256:31c4ae0162ec870fbba54a9e8f120da7a29def1e08afca4be58f7470d43c65ad Links Details (package foundations, upstream sources, exact dependencies, styles, class inventories, files): https://clodhub.com/components/display-mode/details.txt?version=0.13.0 Page: https://clodhub.com/components/display-mode; JSON: https://clodhub.com/api/components/display-mode/0.13.0; connections diagram: https://clodhub.com/api/components/display-mode/0.13.0/connections.svg Copyright Level N Ltd 2026