pkg:clod/com.clodhub/computer-players 0.12.0 Computer players that fill empty seats, play for people who are away, and wait a human-like time before moving, over an injected player strategy, game clock and seating. `computer-players` seats and paces computer players. It takes the next unused name from a configurable list and seats it as a computer player, can fill every empty seat when the game starts, decides whether the computer side moves for a given player (always for a computer, and optionally for a person who is away or sitting out), works out when the move falls due (never sooner than a minimum gap after now, never before the table has settled, then a thinking time of a minimum plus a random share of a spread), and the delay before a computer accepts a rebuy. The moves themselves come from the injected player strategy; the component carries the strategy's memory of opponents between moves. Examples A person sits alone, taps add computer and a computer named Robin sits. With mode `fill-empty` the host starts with two people at a nine-seat room and seven computers join. A computer is next to act at action-clock 10000 with the table settled at 14000: it moves at 14000 plus 300 plus up to 1200 more. With mode `on-request` or `fill-empty` the computer side plays for a person whose connection has gone. Package URL: pkg:clod/com.clodhub/computer-players@0.12.0 Class: Computer players (pkg:clod/com.clodhub/computer-players-class@1.1.0): Computer opponents that take empty seats and act in their turn. Any component of this class can fill a recipe slot that asks for it. Category games/opponents; https://clodhub.com/classes/computer-players-class.txt; 0 other components of this class: https://clodhub.com/components.txt?class=pkg%3Aclod%2Fcom.clodhub%2Fcomputer-players-class Provides (1) - computer-players (com.clodhub/computer-players 1.0.0): Computer players: which names they sit under, how long they wait before moving, and when one plays for a person who is away. Pure over a small state (the strategy's memory); the moves come from an injected player strategy. TypeScript, `implementation/server/computers.ts`. Build once with createComputers(settings, {strategy, clock, seating}); methods named `Computers.` are members of the object it returns. Seating state, game clock state and observations are opaque here. Clock times are milliseconds on the action clock; wall times are epoch milliseconds. components that use it: https://clodhub.com/components.txt?requires=com.clodhub%2Fcomputer-players Requires (3) - player-strategy (com.clodhub/player-strategy 1.0.0): Decisions for computer poker players: win chance by simulation, pot odds, position, a style (how tight, how aggressive, how often it bluffs) and a memory of how each opponent has played. Pure: the table state arrives as a DecisionInput, randomness as a function, the result is an action. TypeScript, `implementation/server/index.ts` (strategy.ts, types.ts). Build with createStrategy({odds}, settings); methods named `Strategy.` are members of the object it returns. The computer-players form is newMemory, choose and observe; decide is choose without the player id. components that provide it: https://clodhub.com/components.txt?provides=com.clodhub%2Fplayer-strategy - game-clock (com.clodhub/game-clock 1.0.0): Game clocks as pure functions over an injected `now` (epoch milliseconds). The caller says which clocks run between two readings (create, advance, reset, elapsed, wallAt); pauses and holds belong to presence and are not stored here. The action clock times decisions, runouts, result holds and offers; the level clock times stake levels. Timers (after, startDecision, startThinking, renewIfPresent, delay, isDue, remainingMs, settleLeftMs, timeoutAction, nextWake) read the action clock. Server: TypeScript `implementation/server/clock.ts`. Client countdowns: TypeScript `implementation/web/countdown.ts` (remaining, endsAt, formatClock), Swift `implementation/apple/Sources/Countdown.swift` and Kotlin `com.clodhub.clock` `Countdown.kt` (remaining, formatClock). Every function returns a new value. components that provide it: https://clodhub.com/components.txt?provides=com.clodhub%2Fgame-clock - seating (com.clodhub/seating 1.0.0): Seats for a table of people and computer players. Build the component once with createSeating(settings, identity); methods named `Seating.` are members of the object it returns. Every member takes a state and returns a new one, never changing its input. Server: TypeScript `implementation/server/seating.ts` and `implementation/server/migrate.ts` (exportAll, importAll). Client lobby rows: TypeScript `implementation/web/lobby.ts`, Swift `implementation/apple/Sources/SeatRows.swift`, Kotlin `com.clodhub.seating` `SeatRows.kt` (seatRows, canTakeSeat; Swift and Kotlin take the same values as structs and enums). components that provide it: https://clodhub.com/components.txt?provides=com.clodhub%2Fseating Settings (6) Settings (all optional): `names` (a space separated list, default eight neutral first names; the installer's label grammar allows no comma, so a name from the setting cannot hold a space; `parseNames` splits on spaces, and the API takes a list; the recipe's poker names stay in the recipe), `mode` (`none`, `on-request` or `fill-empty`; default `on-request`; label grammar), `thinkMinMs` (300), `thinkSpreadMs` (1200), `minimumGapMs` (4000) and `rebuyDelayMs` (4000). `mode`: `none` seats no computer (`add` is refused, `fill` adds none, nobody plays for an absent person), which is how a recipe without computer players uses this component; `on-request` lets a person add a computer and has a computer play for a person who is away or sitting out; `fill-empty` does the same and also fills every empty seat when the game starts. `createComputers(...).settings` carries the derived values `enabled` (mode is not none), `fillEmptySeats` (mode is fill-empty) and `takeOverAbsent` (same as enabled). Names must be 1 to 20 plain characters and distinct. - names: string (label); optional, default "Robin Sam Alex Jordan Casey Morgan Taylor Riley" - mode: string (label); optional, default "on-request" - thinkMinMs: integer; optional, default 300 - thinkSpreadMs: integer; optional, default 1200 - minimumGapMs: integer; optional, default 4000 - rebuyDelayMs: integer; optional, default 4000 Depends on components: none How to use in a recipe A recipe uses it through a slot of class Computer players (pkg:clod/com.clodhub/computer-players-class 1.1.0), naming pkg:clod/com.clodhub/computer-players as the slot's preferred component or substituting it for another component of the class. The recipe connects what it provides (computer-players) to the slots that use it. It fills what the component needs (player-strategy, game-clock and seating) from slots whose components provide them. The recipe sets names, mode, thinkMinMs, thinkSpreadMs, minimumGapMs and rebuyDelayMs; any it leaves out takes its default. - as a slot in recipe.json components: {"id":"computer-players","class":{"name":"pkg:clod/com.clodhub/computer-players-class","version":"1.1.0","digest":"73bce90fb270c6db3504f625f20dc7caf6042215fc35db1b8c1a1fe0a0074f5b"},"preferred":{"name":"pkg:clod/com.clodhub/computer-players","version":"0.12.0"}} - in place of another component of the class: clod fetch computer-players@0.12.0 --store store --from https://clodhub.com, then clod design RECIPE@VERSION --store store --answers answers.json --substitute SLOT=computer-players@0.12.0 --out definition.json Used by recipes: pkg:clod/com.clodhub/ourpoker-recipe 0.13.0 (slot computer-players) For developers: how an application uses it Build it once with `createComputers(settings, {strategy, clock, seating})` from `implementation/server/computers.ts`. The turn engine keeps the state (`create`) in the game state, calls `add` for the add-computer action, `fill` when the game starts, `actsFor` and `moveDeadline` when it sets a player's turn, `isDue` when the room asks for due moves, `choose` and `observe` for the strategy, and `rebuyDelayMs` for the tournament. The strategy's `observation` is whatever the game rules give a player as what they know. The clock is game-clock's `elapsed(clock, 'action')` and `wallAt(clock, 'action', ms)`; its state type is `ClockState`. The strategy is poker-strategy's `newMemory`, `choose(observation, playerId, rng, memory)` and `observe(memory, observation, playerId, move)`; `observe` may return the new memory or change it in place. Accounts and services No service is deployed. The only state is the strategy's memory, part of the game state the room stores. No accounts or keys. How it is checked `node --test tests/web.test.ts` checks settings, neutral default names (none of the recipe's poker names), name list parsing (space separated, the default fitting clod's label grammar), `mode` (the default, the three derived values for each mode, refusal of an unknown mode), mode `none`, adding until names or seats run out, filling, take-over of absent players, deadline arithmetic (settle, gap, thinking time, bounds), wake time, rebuy time, strategy calls that cannot change the stored memory, and the runnable consumer. The tests use small stand-ins for the strategy, clock and seating (`tests/fakes.ts`). No Swift or Kotlin: the recipe's clients have no computer-player code. - `node --test tests/web.test.ts` (web, required-local; tools: node 26.5) Updates Patch updates replace files; no stored data of its own beyond the strategy memory in the game state. Removal deletes the owned sources and the application's imports. A computer plays for a person who is away unless mode is `none`. Tags: computer, games, opponents, players Targets: client none; server none Publisher: George McIntyre (george-mcintyre) Guardians: Level N Ltd (guardian key 08775f20) Source: clodhub/computer-players release v0.12.0; digest sha256:30122d7e62b6171a87e11f311f857fd797dfa7e4e9287b7a05f00064d7aed0cc Release: features Line 0.12: no security releases Quality: Integration-tested, certified Known vulnerabilities: none known (checked 2026-11-26 at OSV); https://clodhub.com/api/components/computer-players/0.12.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/computer-players/0.12.0 Bundle download: GET https://clodhub.com/api/components/computer-players/0.12.0/bundle returns a link valid for one hour Implements: pkg:clod/com.clodhub/computer-players-class@1.1.0 73bce90fb270c6db3504f625f20dc7caf6042215fc35db1b8c1a1fe0a0074f5b com.clodhub/computer-players 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, 25 files (listed on the details page) Suitable for jobs: computer-players profile any: cost none; load none; regions any; compliance none Notes: Pure library; the only state is the strategy memory, a few hundred bytes per opponent. Data migration: this component keeps no data Maintainers: Level N Ltd; https://github.com/clodhub/computer-players/issues; updates https://github.com/clodhub/computer-players/releases (manual) What you download computer-players-0.12.0.tar, from release v0.12.0 of clodhub/computer-players: 25 files - Documents and manifests (8): CONTRACT.md, INSTRUCTIONS.md, LICENCE, NOTICE, PROVENANCE.md, SOURCE.md, ... - Source code (2): server/ (2) - Tests (2): fakes.ts, web.test.ts - Interface documents (4): computer-players.json, required-game-clock.json, required-player-strategy.json, required-seating.json - Class files: the class's interfaces and shared checks (3): computer-players-class/ (3) - Examples (1): consumer.ts - Diagrams (5): definition.json, examples/ (1), output/ (3) Installing copies 2 of them into the application under components/computer-players/: server 2 Not included: the components that provide what it requires (com.clodhub/player-strategy, com.clodhub/game-clock, com.clodhub/seating), 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.12.0 features (2026-11-26T11:25:37.213Z) sha256:30122d7e62b6171a87e11f311f857fd797dfa7e4e9287b7a05f00064d7aed0cc Links Details (package foundations, upstream sources, exact dependencies, styles, class inventories, files): https://clodhub.com/components/computer-players/details.txt?version=0.12.0 Page: https://clodhub.com/components/computer-players; JSON: https://clodhub.com/api/components/computer-players/0.12.0; connections diagram: https://clodhub.com/api/components/computer-players/0.12.0/connections.svg Copyright Level N Ltd 2026