pkg:clod/com.clodhub/presence 0.11.0 Notices absent participants and pauses or carries on by rule. `presence` tracks which participants of a shared activity are present. A participant is present while they make requests or hold a live connection; one who is silent for longer than the away period (and has no live connection) becomes absent. From who is absent it derives pause flags: the host being absent pauses the activity or not according to a rule, everyone counted being absent pauses it, and a manual pause can be set and lifted. When everyone has been absent for the drop period `abandoned` says so and the caller ends or clears the activity. All functions are pure over a plain state and take the clock as an argument. It is the one owner of pause and hold state: besides the automatic pauses, a person can sit out, leave a running activity, or hold the clock to look at a result (`look`) or read a guide (`learn`); a hold ends with its person's connection. Examples A phone goes to the background: the app reports `away`, the host is absent and the room pauses with `hostAbsent`. The host returns: the next request calls `seen` and the pause clears. All players close their tabs: the room pauses with `allOffline`; after the drop period the room is abandoned and cleared. With `hostAbsentRule` set to `continue` the host leaving changes nothing. Package URL: pkg:clod/com.clodhub/presence@0.11.0 Class: Presence (pkg:clod/com.clodhub/presence-class@1.1.0): Who is connected, away or back, and missed turns. Any component of this class can fill a recipe slot that asks for it. Category communication/presence; https://clodhub.com/classes/presence-class.txt; 0 other components of this class: https://clodhub.com/components.txt?class=pkg%3Aclod%2Fcom.clodhub%2Fpresence-class Provides (1) - presence (com.clodhub/presence 1.0.0): Who is present, who has gone quiet, and whether the activity pauses or carries on (TypeScript module server/presence.ts). Pure functions over plain JSON state; the caller supplies the clock and keeps the state. Participant ids are the ids guest-identity issues; automatic participants (computer players) are always present. Presence is the one owner of pause flags (hostAbsent, allOffline, manual) and holds (look, learn); an engine derives game-clock run flags from them. Events: a request from a participant is seen; a live connection opening or closing is setLive; the application going to the background is away; time passing is refresh. Methods named PresenceApi.* are the functions of createPresenceApi(settings), which a turn engine calls. components that use it: https://clodhub.com/components.txt?requires=com.clodhub%2Fpresence Requires (1) - guest-identity (com.clodhub/guest-identity 1.0.0): Guests known by the name they type, with private bearer tokens that rotate. Pure functions over a plain book (server/identity.ts, storage belongs to the caller), the same functions with the settings bound once (createIdentityApi, what seating and realtime-rooms call), and a device-side store of the name and per-slot tokens (web/identity-store.ts, Swift and Kotlin IdentityStore with NameRules). Methods are tagged with the languages that provide them. Over the wire a client sends {name}, the server answers {token, playerId}, later requests carry Authorization: Bearer , and a response may carry a rotated token. components that provide it: https://clodhub.com/components.txt?provides=com.clodhub%2Fguest-identity Settings (3) Three settings. `awayAfterSeconds` (default 30) is the silence after which a participant without a live connection is absent; it should be longer than one polling round trip. `dropAfterSeconds` (default 1800) is how long everyone counted may be absent before `abandoned` is true. `hostAbsentRule` (default `pause`) is `pause` to pause while the host is absent or `continue` to carry on without them. - awayAfterSeconds: integer; optional, default 30 - dropAfterSeconds: integer; optional, default 1800 - hostAbsentRule: string (identifier); optional, default "pause" Depends on components: none How to use in a recipe A recipe uses it through a slot of class Presence (pkg:clod/com.clodhub/presence-class 1.1.0), naming pkg:clod/com.clodhub/presence as the slot's preferred component or substituting it for another component of the class. The recipe connects what it provides (presence) to the slots that use it. It fills what the component needs (guest-identity) from slots whose components provide it. The recipe sets awayAfterSeconds, dropAfterSeconds and hostAbsentRule; any it leaves out takes its default. - as a slot in recipe.json components: {"id":"presence","class":{"name":"pkg:clod/com.clodhub/presence-class","version":"1.1.0","digest":"7ed1da69a973ee3d82d1bbecb3947756fbcc3663102198faa4b3f0db76abdeda"},"preferred":{"name":"pkg:clod/com.clodhub/presence","version":"0.11.0"}} - in place of another component of the class: clod fetch presence@0.11.0 --store store --from https://clodhub.com, then clod design RECIPE@VERSION --store store --answers answers.json --substitute SLOT=presence@0.11.0 --out definition.json Used by recipes: pkg:clod/com.clodhub/ourpoker-recipe 0.13.0 (slot presence) For developers: how an application uses it The room keeps one `PresenceState` beside its activity state. `createPresenceApi(settings)` returns the object a turn engine calls, with the away and drop settings bound: `create`, `register(state, id, now, 'person'|'computer')`, `unregister`, `restart(state, keepIds)`, `seen`, `setLive`, `away`, `sitOut`, `returned`, `leftGame`, `recordMiss`, the readers `isConnected isLive isSittingOut misses lastSeen`, `refresh(state, now, {hostId, running, roundOver, activeIds})`, `setManualPause`, `setHold`, `isHeld`, `holds`, `isPaused`, `pauseReasons`, `isManualPause`, `pausedSince` and `nextWake` (the next silence deadline). Before acting the engine calls `refresh`; it then decides which clocks run (not paused and not held) and gives game-clock run flags; presence, not game-clock, records who is paused or holding. The module functions are the same without bound settings (`refreshFor`, `nextSilence`); `refresh(state, now, settings, active)` is the module function for a room with no engine. Ask `nextCheck` (or `nextWake`) for the wall time to set the room's alarm for, and `abandoned` to end an idle paused activity. Participant ids are the identities of the guest-identity component; computers are registered as automatic. `examples/consumer.ts` runs a host dropping and returning without any game. Accounts and services No service. State is plain data held by the caller. How it is checked Required-local: `node --test tests/server.test.ts` checks the silence boundary, live connections, returning, the host rule both ways, all-absent pausing and abandoning, participants that do not count, manual pause, the inactive mode, the next-check time, purity of every function and the example; and the engine layer: register by kind, sitting out and returning, leaving, the readers on known and unknown ids, holds (who may hold, when, ending with the connection, ending when the activity stops), refresh with an engine's context, restart, nextWake as the silence deadline only, bound settings, same-object results when nothing changes, and a state saved by 0.1.0. No Swift or Kotlin suites: the component is server-side only. - `node --test tests/server.test.ts` (server, required-local; tools: node 26.5) Updates Patch updates replace files; no persisted-state migration. The state is short-lived (a room's presence flags) and is rebuilt as participants are seen again, so there is no migration.json. Tags: communication, presence Targets: client none; server none Publisher: George McIntyre (george-mcintyre) Guardians: Level N Ltd (guardian key 08775f20) Source: clodhub/presence release v0.11.0; digest sha256:aad92d1699a9c085ca036701c403f6be3478b8c92a8bb15b187ca35689f7eb2a Release: features Line 0.11: no security releases Quality: Integration-tested, certified Known vulnerabilities: none known (checked 2026-11-26 at OSV); https://clodhub.com/api/components/presence/0.11.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/presence/0.11.0 Bundle download: GET https://clodhub.com/api/components/presence/0.11.0/bundle returns a link valid for one hour Implements: pkg:clod/com.clodhub/presence-class@1.1.0 7ed1da69a973ee3d82d1bbecb3947756fbcc3663102198faa4b3f0db76abdeda com.clodhub/presence 1.0.0 entry modules: server server/index.ts shared behaviour suites: shared Platforms: server Toolchains: node >=26.5.0 <27.0.0 Frameworks: none Styles: scope none; 0 namespaces; 0 conflicts Licence: Apache-2.0; 0 upstream sources, 0 exact dependencies, 22 files (listed on the details page) Suitable for jobs: presence profile any: cost none; load none; regions any; compliance none Notes: Pure functions; no provider involved. Data migration: this component keeps no data Maintainers: Level N Ltd; https://github.com/clodhub/presence/issues; updates https://github.com/clodhub/presence/releases (manual) What you download presence-0.11.0.tar, from release v0.11.0 of clodhub/presence: 22 files - Documents and manifests (8): CONTRACT.md, INSTRUCTIONS.md, LICENCE, NOTICE, PROVENANCE.md, SOURCE.md, ... - Source code (2): server/ (2) - Tests (1): server.test.ts - Interface documents (2): presence.json, required-guest-identity.json - Class files: the class's interfaces and shared checks (3): presence-class/ (3) - Examples (1): consumer.ts - Diagrams (5): definition.json, examples/ (1), output/ (3) Installing copies 2 of them into the application under components/presence/: server 2 Not included: the components that provide what it requires (com.clodhub/guest-identity), 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.11.0 features (2026-11-26T11:29:46.258Z) sha256:aad92d1699a9c085ca036701c403f6be3478b8c92a8bb15b187ca35689f7eb2a Links Details (package foundations, upstream sources, exact dependencies, styles, class inventories, files): https://clodhub.com/components/presence/details.txt?version=0.11.0 Page: https://clodhub.com/components/presence; JSON: https://clodhub.com/api/components/presence/0.11.0; connections diagram: https://clodhub.com/api/components/presence/0.11.0/connections.svg Copyright Level N Ltd 2026