playerthree
playerthree: the game-agnostic contract — schema DSL, manifest and definition types, control plane, protocol
messages, team signals, the outbound guard, briefing/surface hash, skills and topics. Runtime pieces live under
subpaths (playerthree/host, /mcp, /policy, /devtools, /postgres, …).
Classes
PlayerThreeError
Defined in: packages/playerthree/src/host/util.ts:9
The only error the control plane throws on purpose. Carries a closed code and no text, so bindings can
forward it verbatim; anything else is an internal failure and must be reported as internal.
Extends
Error
Constructors
Constructor
new PlayerThreeError(code): PlayerThreeError;Defined in: packages/playerthree/src/host/util.ts:11
Parameters
| Parameter | Type |
|---|---|
code | ServerErrorCode |
Returns
Overrides
Error.constructor
Properties
| Property | Modifier | Type | Defined in |
|---|---|---|---|
code | readonly | ServerErrorCode | packages/playerthree/src/host/util.ts:10 |
Interfaces
AuthorizationLease
Defined in: packages/playerthree/src/host/types.ts:184
One transport connection's claim on a credential (claimToken); re-checked with authorizeLease on every request.
Properties
| Property | Modifier | Type | Defined in |
|---|---|---|---|
id | readonly | string | packages/playerthree/src/host/types.ts:185 |
principal | readonly | Principal | packages/playerthree/src/host/types.ts:186 |
BriefingTopic
Defined in: packages/playerthree/src/topics.ts:22
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
name | readonly | string | - | packages/playerthree/src/topics.ts:23 |
pages | readonly | readonly string[] | Each ≤ TOPIC_TEXT_MAX. | packages/playerthree/src/topics.ts:27 |
summary | readonly | string | One line, shown in the index (generated topics are indexed per family; see topicIndex). | packages/playerthree/src/topics.ts:25 |
ChatEntry
Defined in: packages/playerthree/src/host/types.ts:921
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
at | number | ms since epoch | packages/playerthree/src/host/types.ts:923 |
commanderIds | string[] | Owner messages: the recipients. Agent replies: the speaker. | packages/playerthree/src/host/types.ts:926 |
from | "agent" | "owner" | - | packages/playerthree/src/host/types.ts:924 |
ping? | unknown | - | packages/playerthree/src/host/types.ts:930 |
text | string | - | packages/playerthree/src/host/types.ts:929 |
tick | number | Match tick (0 in the lobby). | packages/playerthree/src/host/types.ts:928 |
CommanderAgent
Defined in: packages/playerthree/src/host/types.ts:944
Agent-rights access to one commander that is not bound to its commander token (e.g. an OAuth connection).
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
control | SeatControl | Routes like the commander token (lobby or live seat) while valid() holds, else every call is bad_token. | packages/playerthree/src/host/types.ts:946 |
Methods
active()
active(): boolean;Defined in: packages/playerthree/src/host/types.ts:950
Recent calls, in-flight work, or a running sequence keep this commander active.
Returns
boolean
drain()
drain(): OwnerMessage[];Defined in: packages/playerthree/src/host/types.ts:952
Read (and clear) unread owner messages (chat mode), in the lobby or the live seat.
Returns
reportUsage()
reportUsage(report): void;Defined in: packages/playerthree/src/host/types.ts:947
Parameters
| Parameter | Type |
|---|---|
report | DecisionUsage |
Returns
void
seat()
seat():
| {
match: string;
role: string;
team: string;
}
| null;Defined in: packages/playerthree/src/host/types.ts:954
The live match seating the commander, or null (lobby).
Returns
| {
match: string;
role: string;
team: string;
}
| null
status()
status(): SeatStatus;Defined in: packages/playerthree/src/host/types.ts:948
Returns
CommanderIdentity
Defined in: packages/playerthree/src/host/types.ts:787
Extended by
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
id | string | - | packages/playerthree/src/host/types.ts:788 |
isolation | object | Harness declaration, not externally verified isolation. Execution leases are exclusive. | packages/playerthree/src/host/types.ts:793 |
isolation.independentSessions | boolean | - | packages/playerthree/src/host/types.ts:793 |
kind | "policy" | "agent" | - | packages/playerthree/src/host/types.ts:790 |
metadata? | object | - | packages/playerthree/src/host/types.ts:794 |
metadata.model? | string | - | packages/playerthree/src/host/types.ts:794 |
metadata.provider? | string | - | packages/playerthree/src/host/types.ts:794 |
metadata.scaffoldVersion? | string | - | packages/playerthree/src/host/types.ts:794 |
name | string | - | packages/playerthree/src/host/types.ts:789 |
roles | string[] | - | packages/playerthree/src/host/types.ts:791 |
CommanderLogContext
Defined in: packages/playerthree/src/host/types.ts:117
What the game stamps into each new entry before it is digested and signed.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
commanderId | string | The private commander id and its trusted owner (never written to the signed entry). | packages/playerthree/src/host/types.ts:119 |
declared | object | The owner-declared metadata snapshot (sealed in the entry; games key rating segments on it). | packages/playerthree/src/host/types.ts:122 |
declared.model? | string | - | packages/playerthree/src/host/types.ts:122 |
declared.provider? | string | - | packages/playerthree/src/host/types.ts:122 |
declared.scaffoldVersion? | string | - | packages/playerthree/src/host/types.ts:122 |
entry | CommanderLogEntry | The entry so far (seq, prevDigest, digest, verdict and sig are placeholders). | packages/playerthree/src/host/types.ts:124 |
ownerRef | string | - | packages/playerthree/src/host/types.ts:120 |
CommanderLogEntry
Defined in: packages/playerthree/src/commander-log.ts:63
The signed entry: what verifiers and public projections see.
Properties
CommanderLogHead
Defined in: packages/playerthree/src/commander-log.ts:161
Chain head and casual tally (non-practice decided entries) of one commander.
Properties
| Property | Type | Defined in |
|---|---|---|
commanderId | string | packages/playerthree/src/commander-log.ts:162 |
digest | string | packages/playerthree/src/commander-log.ts:164 |
draws | number | packages/playerthree/src/commander-log.ts:167 |
losses | number | packages/playerthree/src/commander-log.ts:166 |
seq | number | packages/playerthree/src/commander-log.ts:163 |
wins | number | packages/playerthree/src/commander-log.ts:165 |
CommanderLogOptions
Defined in: packages/playerthree/src/host/types.ts:128
Commander match log settings (PlayerThreeHostOptions.commanderLog).
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
origin? | string | Public origin of this host, recorded in every entry (host.origin). | packages/playerthree/src/host/types.ts:131 |
signer? | ResultsSigner | Ed25519 results signer. Only a configured signer makes the host official (host.official, signed entries); without one every entry is unsigned and official: false. | packages/playerthree/src/host/types.ts:136 |
store? | CommanderLogStore | - | packages/playerthree/src/host/types.ts:129 |
Methods
verdict()?
verdict?(context):
| CommanderLogVerdict
| Promise<CommanderLogVerdict>;Defined in: packages/playerthree/src/host/types.ts:138
The game's rating decision for one entry (default: unrated). A failure stamps the default and is reported.
Parameters
| Parameter | Type |
|---|---|
context | CommanderLogContext |
Returns
| CommanderLogVerdict
| Promise<CommanderLogVerdict>
CommanderLogReader
Defined in: packages/playerthree/src/host/types.ts:153
Read side of the commander log (operators and the game; owner views go through CommanderRegistry.log).
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
keyId | readonly | string | null | The signing key id, or null on an unofficial host. | packages/playerthree/src/host/types.ts:155 |
official | readonly | boolean | - | packages/playerthree/src/host/types.ts:156 |
Methods
all()
all(): Promise<StoredCommanderLogEntry[]>;Defined in: packages/playerthree/src/host/types.ts:159
Returns
Promise<StoredCommanderLogEntry[]>
amend()
amend(
entryId,
verdict,
reason
): Promise<CommanderLogVerdictRow>;Defined in: packages/playerthree/src/host/types.ts:162
Append a signed verdict change (a review void) for an entry; never rewrites the entry.
Parameters
| Parameter | Type |
|---|---|
entryId | string |
verdict | CommanderLogVerdict |
reason | string |
Returns
Promise<CommanderLogVerdictRow>
entries()
entries(commanderId, afterSeq?): Promise<StoredCommanderLogEntry[]>;Defined in: packages/playerthree/src/host/types.ts:157
Parameters
| Parameter | Type |
|---|---|
commanderId | string |
afterSeq? | number |
Returns
Promise<StoredCommanderLogEntry[]>
flush()
flush(): Promise<void>;Defined in: packages/playerthree/src/host/types.ts:166
Resolves once queued log writes finished.
Returns
Promise<void>
match()
match(matchId): Promise<StoredCommanderLogEntry[]>;Defined in: packages/playerthree/src/host/types.ts:158
Parameters
| Parameter | Type |
|---|---|
matchId | string |
Returns
Promise<StoredCommanderLogEntry[]>
onAppend()
onAppend(listener): () => void;Defined in: packages/playerthree/src/host/types.ts:164
After each durable append. Returns unsubscribe.
Parameters
| Parameter | Type |
|---|---|
listener | (row) => void |
Returns
() => void
verdicts()
verdicts(): Promise<CommanderLogVerdictRow[]>;Defined in: packages/playerthree/src/host/types.ts:160
Returns
Promise<CommanderLogVerdictRow[]>
CommanderLogSealed
Defined in: packages/playerthree/src/commander-log.ts:135
Private facts, owner-only; scrubbed (set to null) by a deletion tombstone.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
declared | object | Owner-declared metadata snapshotted when the seat was prepared; later edits never rewrite it. | packages/playerthree/src/commander-log.ts:140 |
declared.model? | string | - | packages/playerthree/src/commander-log.ts:140 |
declared.provider? | string | - | packages/playerthree/src/commander-log.ts:140 |
declared.scaffoldVersion? | string | - | packages/playerthree/src/commander-log.ts:140 |
name | string | - | packages/playerthree/src/commander-log.ts:138 |
ownerRef | string | - | packages/playerthree/src/commander-log.ts:137 |
salt | string | - | packages/playerthree/src/commander-log.ts:136 |
usage? | CommanderLogUsage | - | packages/playerthree/src/commander-log.ts:141 |
CommanderLogSeatRef
Defined in: packages/playerthree/src/commander-log.ts:39
A seat of the match as observed at the end: who held it and of what kind.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
artifactHash? | string | - | packages/playerthree/src/commander-log.ts:49 |
botLevel? | string | - | packages/playerthree/src/commander-log.ts:45 |
botOptionsHash? | string | SHA-256 of the canonical JSON of the seat's built-in bot options. | packages/playerthree/src/commander-log.ts:47 |
commander | string | null | Public id of the named commander holding it at the end; null for other seats. | packages/playerthree/src/commander-log.ts:44 |
kind | "human" | "policy" | "agent" | "bot" | "none" | Assignment kind (else controller) at the end. | packages/playerthree/src/commander-log.ts:42 |
policyVersion? | number | - | packages/playerthree/src/commander-log.ts:48 |
role | string | - | packages/playerthree/src/commander-log.ts:40 |
CommanderLogStore
Defined in: packages/playerthree/src/commander-log.ts:174
Storage behind the commander log. Every method may be sync or async; the host issues writes in order. Insert only:
redact (privacy tombstone) is the one rewrite, and it touches only the sealed part.
Methods
all()
all():
| StoredCommanderLogEntry[]
| Promise<StoredCommanderLogEntry[]>;Defined in: packages/playerthree/src/commander-log.ts:182
Every entry in (endedAt, matchId, commander) order: deterministic recomputes.
Returns
| StoredCommanderLogEntry[]
| Promise<StoredCommanderLogEntry[]>
append()
append(row): void | Promise<void>;Defined in: packages/playerthree/src/commander-log.ts:176
Parameters
| Parameter | Type |
|---|---|
row | StoredCommanderLogEntry |
Returns
void | Promise<void>
appendVerdict()
appendVerdict(row): void | Promise<void>;Defined in: packages/playerthree/src/commander-log.ts:183
Parameters
| Parameter | Type |
|---|---|
row | CommanderLogVerdictRow |
Returns
void | Promise<void>
entries()
entries(commanderId, afterSeq?):
| StoredCommanderLogEntry[]
| Promise<StoredCommanderLogEntry[]>;Defined in: packages/playerthree/src/commander-log.ts:178
One commander's entries in seq order, after afterSeq (exclusive); limit newest-first trimming is the caller's.
Parameters
| Parameter | Type |
|---|---|
commanderId | string |
afterSeq? | number |
Returns
| StoredCommanderLogEntry[]
| Promise<StoredCommanderLogEntry[]>
heads()
heads():
| CommanderLogHead[]
| Promise<CommanderLogHead[]>;Defined in: packages/playerthree/src/commander-log.ts:175
Returns
| CommanderLogHead[]
| Promise<CommanderLogHead[]>
match()
match(matchId):
| StoredCommanderLogEntry[]
| Promise<StoredCommanderLogEntry[]>;Defined in: packages/playerthree/src/commander-log.ts:180
Every commander's entry for one match.
Parameters
| Parameter | Type |
|---|---|
matchId | string |
Returns
| StoredCommanderLogEntry[]
| Promise<StoredCommanderLogEntry[]>
redact()
redact(commanderId): void | Promise<void>;Defined in: packages/playerthree/src/commander-log.ts:185
Parameters
| Parameter | Type |
|---|---|
commanderId | string |
Returns
void | Promise<void>
verdicts()
verdicts():
| CommanderLogVerdictRow[]
| Promise<CommanderLogVerdictRow[]>;Defined in: packages/playerthree/src/commander-log.ts:184
Returns
| CommanderLogVerdictRow[]
| Promise<CommanderLogVerdictRow[]>
CommanderLogUsage
Defined in: packages/playerthree/src/commander-log.ts:52
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
cacheReadTokens | number | null | - | packages/playerthree/src/commander-log.ts:56 |
cacheWriteTokens | number | null | - | packages/playerthree/src/commander-log.ts:57 |
coverage | "complete" | "partial" | "unknown" | The worst coverage any report declared. | packages/playerthree/src/commander-log.ts:59 |
decisions | number | - | packages/playerthree/src/commander-log.ts:53 |
inputTokens | number | null | - | packages/playerthree/src/commander-log.ts:54 |
outputTokens | number | null | - | packages/playerthree/src/commander-log.ts:55 |
CommanderLogVerdict
Defined in: packages/playerthree/src/commander-log.ts:25
The game's rating decision, stamped into the entry before it is digested and signed (commanderLog.verdict).
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
badges | string[] | Game-defined closed vocabularies. | packages/playerthree/src/commander-log.ts:34 |
pool | string | null | Game-defined rated pool, or null. | packages/playerthree/src/commander-log.ts:28 |
rated | boolean | - | packages/playerthree/src/commander-log.ts:26 |
reasons | string[] | - | packages/playerthree/src/commander-log.ts:35 |
segmentId | string | null | Game-defined rating segment, or null. | packages/playerthree/src/commander-log.ts:30 |
weight | number | Match weight in [0, 1]. | packages/playerthree/src/commander-log.ts:32 |
CommanderLogVerdictRow
Defined in: packages/playerthree/src/commander-log.ts:151
A later verdict change (a review void): appended, never rewriting the entry.
Properties
| Property | Type | Defined in |
|---|---|---|
at | number | packages/playerthree/src/commander-log.ts:153 |
entryId | string | packages/playerthree/src/commander-log.ts:152 |
keyId | string | null | packages/playerthree/src/commander-log.ts:156 |
reason | string | packages/playerthree/src/commander-log.ts:155 |
sig | string | null | packages/playerthree/src/commander-log.ts:157 |
verdict | CommanderLogVerdict | packages/playerthree/src/commander-log.ts:154 |
CommanderPolicyVersion
Defined in: packages/playerthree/src/host/types.ts:812
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
artifactHash | string | SHA-256 hex of the module bytes (policyArtifactHash), computed at deploy. | packages/playerthree/src/host/types.ts:823 |
bytes | number | Module size: UTF-8 bytes of JS source, decoded bytes of a WASM module (0 if its artifact was missing on load). | packages/playerthree/src/host/types.ts:821 |
createdAt | number | ms since epoch | packages/playerthree/src/host/types.ts:819 |
role | string | null | null: legacy multi-role artifact without trustworthy role provenance; redeploy for the intended role. | packages/playerthree/src/host/types.ts:815 |
runtime | string | - | packages/playerthree/src/host/types.ts:816 |
surfaceHash | string | - | packages/playerthree/src/host/types.ts:817 |
version | number | - | packages/playerthree/src/host/types.ts:813 |
CommanderPractice
Defined in: packages/playerthree/src/host/types.ts:827
Closed-vocabulary summary of the last practice run (UI or agent).
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
allies | string | - | packages/playerthree/src/host/types.ts:831 |
at | number | - | packages/playerthree/src/host/types.ts:828 |
opponent | string | - | packages/playerthree/src/host/types.ts:830 |
outcome | "win" | "loss" | "draw" | "running" | - | packages/playerthree/src/host/types.ts:835 |
report | unknown | Guarded game report (manifest.report) from the last successful practice run. | packages/playerthree/src/host/types.ts:837 |
role | string | - | packages/playerthree/src/host/types.ts:829 |
seed | number | - | packages/playerthree/src/host/types.ts:833 |
ticks | number | - | packages/playerthree/src/host/types.ts:832 |
version | number | - | packages/playerthree/src/host/types.ts:834 |
CommanderRegistry
Defined in: packages/playerthree/src/host/types.ts:862
Persistent commander rosters. All methods take an owner id the game has already authenticated.
Unknown owners/commander IDs and invalid settings throw PlayerThreeError('invalid').
Type Parameters
| Type Parameter | Default type |
|---|---|
M extends AnyManifest | AnyManifest |
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
ready | readonly | Promise<void> | Resolves once the store has loaded; commander tokens do not authenticate before that. | packages/playerthree/src/host/types.ts:864 |
Methods
agent()
agent(
owner,
id,
valid,
role?
): CommanderAgent | undefined;Defined in: packages/playerthree/src/host/types.ts:906
Agent-rights access to an owner's commander for a credential the registry does not issue (the MCP binding's
OAuth connections): it stays usable while valid() holds. Undefined for unknown owners/roles.
Parameters
| Parameter | Type |
|---|---|
owner | string |
id | string |
valid | () => boolean |
role? | RoleOf<M> |
Returns
CommanderAgent | undefined
chat()
chat(owner): ChatEntry[];Defined in: packages/playerthree/src/host/types.ts:894
Recent owner ↔ commander chat of an owner (memory only), oldest first. Agent text: render as plain text.
Parameters
| Parameter | Type |
|---|---|
owner | string |
Returns
create()
create(owner, input): CommanderStatus;Defined in: packages/playerthree/src/host/types.ts:869
Parameters
| Parameter | Type |
|---|---|
owner | string |
input | CreateCommander |
Returns
delete()
delete(owner, id): Promise<void>;Defined in: packages/playerthree/src/host/types.ts:871
Parameters
| Parameter | Type |
|---|---|
owner | string |
id | string |
Returns
Promise<void>
ensure()
ensure(owner): CommanderStatus[];Defined in: packages/playerthree/src/host/types.ts:868
Create an empty owner registry if missing.
Parameters
| Parameter | Type |
|---|---|
owner | string |
Returns
flush()
flush(): Promise<void>;Defined in: packages/playerthree/src/host/types.ts:866
Finish queued artifact, role-library and terminal-receipt writes before closing persistent storage.
Returns
Promise<void>
has()
has(owner): boolean;Defined in: packages/playerthree/src/host/types.ts:872
Parameters
| Parameter | Type |
|---|---|
owner | string |
Returns
boolean
log()
log(owner, id): Promise<StoredCommanderLogEntry[]>;Defined in: packages/playerthree/src/host/types.ts:885
The owner's full log of one commander (entries and their sealed parts), oldest first.
Parameters
| Parameter | Type |
|---|---|
owner | string |
id | string |
Returns
Promise<StoredCommanderLogEntry[]>
onSaid()
onSaid(listener): () => void;Defined in: packages/playerthree/src/host/types.ts:896
Agent replies of any owner's commanders (lobby and matches). Returns unsubscribe.
Parameters
| Parameter | Type |
|---|---|
listener | (owner, said) => void |
Returns
() => void
onStatus()
onStatus(listener): () => void;Defined in: packages/playerthree/src/host/types.ts:901
Commander lifecycle or credential changes. role is the one execution lane that changed, or null when the
whole commander did. Returns unsubscribe; no text or credentials.
Parameters
| Parameter | Type |
|---|---|
listener | (owner, commanderId, role) => void |
Returns
() => void
owners()
owners(): string[];Defined in: packages/playerthree/src/host/types.ts:874
Every owner with a roster, sorted. For operator tooling; players only ever see their own roster.
Returns
string[]
practice()
practice(
owner,
id,
req
): Promise<PracticeResult>;Defined in: packages/playerthree/src/host/types.ts:879
Parameters
| Parameter | Type |
|---|---|
owner | string |
id | string |
req | CommanderPracticeRequest |
Returns
Promise<PracticeResult>
publicId()
publicId(owner, id): string;Defined in: packages/playerthree/src/host/types.ts:887
The commander's public id (commanderPublicId).
Parameters
| Parameter | Type |
|---|---|
owner | string |
id | string |
Returns
string
remove()
remove(owner): Promise<void>;Defined in: packages/playerthree/src/host/types.ts:883
Delete an owner's roster, tokens and library.
Parameters
| Parameter | Type |
|---|---|
owner | string |
Returns
Promise<void>
rename()
rename(
owner,
id,
input
): CommanderStatus;Defined in: packages/playerthree/src/host/types.ts:870
Parameters
| Parameter | Type |
|---|---|
owner | string |
id | string |
input | CreateCommander |
Returns
reserve()
reserve(
owner,
id,
role,
reservation
): void;Defined in: packages/playerthree/src/host/types.ts:914
A game lobby reserves one role lane of this commander for a seat of the next match (null clears it): until a match
seats it, its agent's lobby state shows the seat, the game's pre-match summary (match, manifest.lobby) and when
the match starts (start.at: wall clock, ms since epoch), and the agent can mark itself ready (carried into the
match that seats it there). A different seat, or clearing, resets ready and wakes the lane's lobby waits. The
reservation ends when the lane's match ends; it never seats anything by itself.
Parameters
| Parameter | Type |
|---|---|
owner | string |
id | string |
role | RoleOf<M> |
reservation | LobbyReservation | null |
Returns
void
resolveApproval()
resolveApproval(
owner,
id,
approvalId,
approve
): Promise<
| void
| DeployResult
| PublishResult>;Defined in: packages/playerthree/src/host/types.ts:881
Parameters
| Parameter | Type |
|---|---|
owner | string |
id | string |
approvalId | string |
approve | boolean |
Returns
Promise<
| void
| DeployResult
| PublishResult>
rollback()
rollback(
owner,
id,
role,
version
): Promise<DeployResult>;Defined in: packages/playerthree/src/host/types.ts:880
Parameters
| Parameter | Type |
|---|---|
owner | string |
id | string |
role | string |
version | number |
Returns
Promise<DeployResult>
roster()
roster(owner): CommanderStatus[];Defined in: packages/playerthree/src/host/types.ts:875
Parameters
| Parameter | Type |
|---|---|
owner | string |
Returns
rotate()
rotate(owner, id): string;Defined in: packages/playerthree/src/host/types.ts:878
Parameters
| Parameter | Type |
|---|---|
owner | string |
id | string |
Returns
string
tell()
tell(
owner,
commanderIds,
text,
ping?
): void;Defined in: packages/playerthree/src/host/types.ts:892
Chat mode: message the owner's own commanders (in the lobby or in their live match). Text ≤ maxTellChars,
rate-limited per owner; ping must match manifest.control.chat.ping.
Parameters
| Parameter | Type |
|---|---|
owner | string |
commanderIds | readonly string[] | "all" |
text | string |
ping? | unknown |
Returns
void
token()
token(owner, id): string;Defined in: packages/playerthree/src/host/types.ts:877
Parameters
| Parameter | Type |
|---|---|
owner | string |
id | string |
Returns
string
update()
update(
owner,
id,
patch
): CommanderStatus;Defined in: packages/playerthree/src/host/types.ts:876
Parameters
| Parameter | Type |
|---|---|
owner | string |
id | string |
patch | CommanderSettingsPatch |
Returns
CommanderSaid
Defined in: packages/playerthree/src/host/types.ts:916
An agent's reply to its owner (say), as delivered to the owner's clients only.
Extends
Properties
| Property | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|
commanderId | string | - | - | packages/playerthree/src/host/types.ts:917 |
role | string | - | Said.role | packages/playerthree/src/control.ts:299 |
text | string | Agent-authored text: render as plain text, never as markup. | Said.text | packages/playerthree/src/control.ts:302 |
tick | number | - | Said.tick | packages/playerthree/src/control.ts:300 |
CommanderSettings
Defined in: packages/playerthree/src/host/types.ts:799
Extended by
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
botLevel | string | Built-in bot level (one of manifest.opponents) when the seat falls back to a bot. | packages/playerthree/src/host/types.ts:803 |
mandate | Mandate | - | packages/playerthree/src/host/types.ts:801 |
scopes | ("act" | "policy" | "practice" | "publish" | "say")[] | - | packages/playerthree/src/host/types.ts:800 |
CommanderSettingsPatch
Defined in: packages/playerthree/src/host/types.ts:806
Properties
| Property | Type | Defined in |
|---|---|---|
botLevel? | string | packages/playerthree/src/host/types.ts:807 |
mandate? | Partial<Mandate> | packages/playerthree/src/host/types.ts:809 |
scopes? | ("act" | "policy" | "practice" | "publish" | "say")[] | packages/playerthree/src/host/types.ts:808 |
CommanderStatus
Defined in: packages/playerthree/src/host/types.ts:840
Extends
Properties
CommanderStore
Defined in: packages/playerthree/src/host/types.ts:1020
Storage behind the commander registry. Every method may be sync or async; writes are issued in order and failures are reported to the host's console (the in-memory state stays authoritative for the process).
Methods
deleteArtifact()
deleteArtifact(
owner,
commanderId,
version
): void | Promise<void>;Defined in: packages/playerthree/src/host/types.ts:1028
Parameters
| Parameter | Type |
|---|---|
owner | string |
commanderId | string |
version | number |
Returns
void | Promise<void>
deleteOwner()
deleteOwner(owner): void | Promise<void>;Defined in: packages/playerthree/src/host/types.ts:1025
Parameters
| Parameter | Type |
|---|---|
owner | string |
Returns
void | Promise<void>
load()
load():
| CommanderStoreData
| Promise<CommanderStoreData>;Defined in: packages/playerthree/src/host/types.ts:1021
Returns
| CommanderStoreData
| Promise<CommanderStoreData>
loadArtifact()
loadArtifact(
owner,
commanderId,
version
):
| StoredPolicyArtifact
| Promise<StoredPolicyArtifact | undefined>
| undefined;Defined in: packages/playerthree/src/host/types.ts:1027
Parameters
| Parameter | Type |
|---|---|
owner | string |
commanderId | string |
version | number |
Returns
| StoredPolicyArtifact
| Promise<StoredPolicyArtifact | undefined>
| undefined
saveArtifact()
saveArtifact(
owner,
commanderId,
version,
artifact
): void | Promise<void>;Defined in: packages/playerthree/src/host/types.ts:1026
Parameters
| Parameter | Type |
|---|---|
owner | string |
commanderId | string |
version | number |
artifact | StoredPolicyArtifact |
Returns
void | Promise<void>
saveKey()
saveKey(key): void | Promise<void>;Defined in: packages/playerthree/src/host/types.ts:1022
Parameters
| Parameter | Type |
|---|---|
key | string |
Returns
void | Promise<void>
saveOwner()
saveOwner(record): void | Promise<void>;Defined in: packages/playerthree/src/host/types.ts:1024
Upsert one owner's full record.
Parameters
| Parameter | Type |
|---|---|
record | StoredOwner |
Returns
void | Promise<void>
CommanderStoreData
Defined in: packages/playerthree/src/host/types.ts:1007
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
key | string | null | base64url host key that commander tokens are derived from (HMAC). Whoever holds the store can derive every token: protect it like the tokens themselves. null on first start (the host generates and saves one). | packages/playerthree/src/host/types.ts:1012 |
owners | StoredOwner[] | - | packages/playerthree/src/host/types.ts:1013 |
CommentaryEvent
Defined in: packages/playerthree/src/host/types.ts:205
Properties
| Property | Type | Defined in |
|---|---|---|
category | "summary" | "chat" | packages/playerthree/src/host/types.ts:209 |
role | string | packages/playerthree/src/host/types.ts:207 |
team | string | packages/playerthree/src/host/types.ts:206 |
text | string | packages/playerthree/src/host/types.ts:210 |
tick | number | packages/playerthree/src/host/types.ts:208 |
CreateMatchOptions
Defined in: packages/playerthree/src/host/types.ts:223
Options of PlayerThreeHost.createMatch.
Type Parameters
| Type Parameter |
|---|
M extends AnyManifest |
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
alliances? | Readonly<Record<string, readonly Infer<M["teams"]>[]>> | Named alliances: alliance id → member teams, partitioning the match teams (every match team in exactly one; invalid otherwise). An id that names a manifest team must name one of its own members. Allies share their outcome and rank; end() accepts alliance ids as keys. Default: every team on its own. | packages/playerthree/src/host/types.ts:239 |
assignments? | SeatAssignment[] | Trusted exact-seat assignments; duplicate seats or simultaneous named-commander leases fail atomically. | packages/playerthree/src/host/types.ts:253 |
botLevel? | Partial<Record<string, Infer<M["opponents"]>>> | Built-in bot strength per match team (other teams fail invalid). Default: the strongest-but-one opponent. | packages/playerthree/src/host/types.ts:243 |
botSeats? | readonly object[] | Exact-seat built-in bot options; validated against definition.botOptions. | packages/playerthree/src/host/types.ts:245 |
controllers? | Partial<Record<string, Partial<Record<string, "human" | "policy" | "agent" | "bot" | "none">>>> | Initial controller per match seat: { [team]: { [role]: controller } }. Default: bot everywhere. Other teams fail invalid. | packages/playerthree/src/host/types.ts:241 |
lobby? | unknown | The game's pre-match summary of this match (manifest.lobby; invalid when it does not conform or the game declares none): every agent seat sees it as its lobby state's match while the match is held before its first tick. | packages/playerthree/src/host/types.ts:263 |
log? | MatchLogFacts | Facts the commander log records for this match (PlayerThreeHostOptions.commanderLog). | packages/playerthree/src/host/types.ts:265 |
metricSampleEveryTicks? | number | Observational recorder cadence; independent of simulation and decision cadence. | packages/playerthree/src/host/types.ts:251 |
observerPolicy? | ObserverPolicy | - | packages/playerthree/src/host/types.ts:225 |
options? | MatchOptionsOf<M> | Match options (manifest.matchOptions; validated, invalid otherwise), merged over the host's matchOptions. Omitted fields use those, then the game's defaults. | packages/playerthree/src/host/types.ts:227 |
persistent? | object | A persistent session: no terminal outcome (outcome() stays running, the adapter's outcome is ignored, end() throws invalid; close it with dispose()) and no time cap. Replay retention is a rolling window: after the tick advances to a multiple of checkpointTicks the host checkpoints the game with adapter clone() (required), keeps the newest checkpoints (2–100), and drops recorded entries older than the oldest kept checkpoint (replay().window). Scrubbing reaches every tick from there to the current tick: at least the last (checkpoints − 1) × checkpointTicks ticks, or the whole session while it is younger. | packages/playerthree/src/host/types.ts:274 |
persistent.checkpoints | number | - | packages/playerthree/src/host/types.ts:274 |
persistent.checkpointTicks | number | - | packages/playerthree/src/host/types.ts:274 |
readySeconds? | number | Hold every stepping path at tick 0 until all assigned seats are ready, up to this many seconds. Humans require both trusted ready approval and an authenticated game-room join. | packages/playerthree/src/host/types.ts:258 |
realtime? | boolean | Drive ticks with a timer at manifest.tickRate (default true). Tests use step(). | packages/playerthree/src/host/types.ts:247 |
seed? | number | - | packages/playerthree/src/host/types.ts:224 |
teams? | readonly Infer<M["teams"]>[] | The manifest teams taking part (any order; the match keeps manifest order). Default: the host's teams, else every manifest team. Seats, tokens, readiness, outcomes, ranks, observer grants and the session record cover exactly these teams; anything naming another team fails invalid. Unknown or duplicate teams fail invalid. | packages/playerthree/src/host/types.ts:233 |
viewHz? | number | View push rate to transports, Hz (default = tickRate). | packages/playerthree/src/host/types.ts:249 |
DecisionUsage
Defined in: packages/playerthree/src/host/types.ts:53
Optional harness accounting. Provider identity and billing are declared, never host-verified.
Properties
| Property | Type | Defined in |
|---|---|---|
cacheReadTokens? | number | null | packages/playerthree/src/host/types.ts:60 |
cacheWriteTokens? | number | null | packages/playerthree/src/host/types.ts:61 |
costAmount? | string | null | packages/playerthree/src/host/types.ts:62 |
coverage | "complete" | "partial" | "unknown" | packages/playerthree/src/host/types.ts:65 |
currency? | string | null | packages/playerthree/src/host/types.ts:63 |
decisionId | string | packages/playerthree/src/host/types.ts:54 |
inputTokens? | number | null | packages/playerthree/src/host/types.ts:58 |
latencyMs | number | packages/playerthree/src/host/types.ts:55 |
outputTokens? | number | null | packages/playerthree/src/host/types.ts:59 |
pricingVersion? | string | null | packages/playerthree/src/host/types.ts:64 |
reporter | "reported" | "estimated" | "unpriced" | packages/playerthree/src/host/types.ts:57 |
source | "provider" | "self_report" | packages/playerthree/src/host/types.ts:56 |
GuardDrop
Defined in: packages/playerthree/src/guard.ts:21
Properties
| Property | Type | Defined in |
|---|---|---|
channel | string | packages/playerthree/src/guard.ts:22 |
code | SchemaErrorCode | packages/playerthree/src/guard.ts:23 |
path | SchemaPath | packages/playerthree/src/guard.ts:24 |
GuardOptions
Defined in: packages/playerthree/src/guard.ts:42
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
onDrop? | (drop) => void | Called once per drop. Default: console.warn with channel, path and code. | packages/playerthree/src/guard.ts:44 |
GuardStats
Defined in: packages/playerthree/src/guard.ts:27
Properties
| Property | Type | Defined in |
|---|---|---|
dropped | number | packages/playerthree/src/guard.ts:29 |
droppedByChannel | Record<string, number> | packages/playerthree/src/guard.ts:30 |
passed | number | packages/playerthree/src/guard.ts:28 |
HistoryStore
Defined in: packages/playerthree/src/host/types.ts:1066
Storage behind the session history. Every method may be sync or async; writes are issued in order and failures are
reported to the host's console. Records of other games in load() are ignored; the host prunes the loaded records
with its bounds (deleting from the store).
Methods
delete()
delete(id): void | Promise<void>;Defined in: packages/playerthree/src/host/types.ts:1071
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
void | Promise<void>
load()
load():
| SessionRecord[]
| Promise<SessionRecord[]>;Defined in: packages/playerthree/src/host/types.ts:1068
Every kept record. record.replay is true only when the replay is actually stored.
Returns
| SessionRecord[]
| Promise<SessionRecord[]>
loadReplay()
loadReplay(id):
| Replay
| Promise<Replay | undefined>
| undefined;Defined in: packages/playerthree/src/host/types.ts:1072
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
| Replay
| Promise<Replay | undefined>
| undefined
save()
save(record, replay): void | Promise<void>;Defined in: packages/playerthree/src/host/types.ts:1070
Upsert a released session: its record and its replay as serialized JSON (Replay), or null when not kept.
Parameters
| Parameter | Type |
|---|---|
record | SessionRecord |
replay | string | null |
Returns
void | Promise<void>
LoadOptions
Defined in: packages/playerthree/src/policy/types.ts:59
Per-instance load options.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
matchData? | unknown | JSON-compatible bootstrap passed to init once. Independently capped at MATCH_DATA_MAX_BYTES (128 KiB). | packages/playerthree/src/policy/types.ts:66 |
seed? | number | Seed for the sandbox's deterministic PRNG (JS Math.random). Same seed + same match data + same observation sequence ⇒ same outputs, so practice runs and replays reproduce exactly. Default 0. | packages/playerthree/src/policy/types.ts:64 |
LobbyReservation
Defined in: packages/playerthree/src/host/types.ts:934
A game lobby's reservation of one commander role lane (CommanderRegistry.reserve).
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
match? | unknown | The game's pre-match summary (manifest.lobby; invalid when it does not conform or the game declares none). | packages/playerthree/src/host/types.ts:938 |
start | object | When the match starts: host (the lobby's host starts it), ready (once every seat is ready, or at at), countdown (at at). | packages/playerthree/src/host/types.ts:940 |
start.at? | number | - | packages/playerthree/src/host/types.ts:940 |
start.kind | "host" | "ready" | "countdown" | - | packages/playerthree/src/host/types.ts:940 |
team | string | A manifest team: the reserved seat is {team, role}. | packages/playerthree/src/host/types.ts:936 |
MatchLogFacts
Defined in: packages/playerthree/src/host/types.ts:142
Game-supplied match facts for the commander log (game vocabularies; bounded identifiers).
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
customRules? | boolean | - | packages/playerthree/src/host/types.ts:148 |
map? | | { id: string; identity?: string | null; layout?: string | null; seed?: number | null; size?: number | null; } | null | - | packages/playerthree/src/host/types.ts:149 |
mode? | string | e.g. duel_1v1, ffa, lobby, series (default custom). | packages/playerthree/src/host/types.ts:144 |
queue? | string | null | The rated queue that created the match, or null (default). | packages/playerthree/src/host/types.ts:146 |
rulesHash? | string | null | - | packages/playerthree/src/host/types.ts:147 |
MatchTokens
Defined in: packages/playerthree/src/host/types.ts:278
The match's owner tokens, minted at creation: hand each team's token only to that team's owner.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
spectator | string | - | packages/playerthree/src/host/types.ts:281 |
teams | Record<string, string> | One owner token per match team. | packages/playerthree/src/host/types.ts:280 |
ObserverPolicy
Defined in: packages/playerthree/src/host/types.ts:213
Properties
| Property | Type | Defined in |
|---|---|---|
allowOmniscient | boolean | packages/playerthree/src/host/types.ts:214 |
maxAgeMs? | number | packages/playerthree/src/host/types.ts:218 |
maxBytes? | number | packages/playerthree/src/host/types.ts:217 |
minDelayMs | number | packages/playerthree/src/host/types.ts:215 |
public | boolean | packages/playerthree/src/host/types.ts:216 |
OutboundGuard
Defined in: packages/playerthree/src/guard.ts:33
Methods
pass()
pass(
channel,
schema,
data
): GuardResult<unknown>;Defined in: packages/playerthree/src/guard.ts:38
Snapshot data (JSON round trip, so getters/toJSON/prototype tricks cannot change it after the check),
validate the snapshot, and return it. The snapshot is what must be sent.
Parameters
| Parameter | Type |
|---|---|
channel | string |
schema | Schema |
data | unknown |
Returns
GuardResult<unknown>
stats()
stats(): GuardStats;Defined in: packages/playerthree/src/guard.ts:39
Returns
PlayerThreeHost
Defined in: packages/playerthree/src/host/types.ts:549
The in-process host of one game (createPlayerThreeHost): creates matches, resolves tokens and serves the bindings.
Type Parameters
| Type Parameter | Default type |
|---|---|
M extends AnyManifest | AnyManifest |
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
commanderLog | readonly | CommanderLogReader | - | packages/playerthree/src/host/types.ts:576 |
commanders | readonly | CommanderRegistry<M> | Named commander identities; each owns an exclusive exact-seat execution lease. | packages/playerthree/src/host/types.ts:575 |
definition | readonly | GameDefinition<M> | - | packages/playerthree/src/host/types.ts:550 |
history | readonly | SessionHistory | Sessions the host released recently (operator console). | packages/playerthree/src/host/types.ts:558 |
matchOptions | readonly | | MatchOptionsOf<M> | undefined | The host default match options (validated PlayerThreeHostOptions.matchOptions; undefined: the game's defaults). | packages/playerthree/src/host/types.ts:560 |
pool | readonly | PolicyPool | - | packages/playerthree/src/host/types.ts:556 |
ready | readonly | Promise<void> | Resolves once the commander, pool and history stores have loaded; rejects (it never hangs) if any load fails. Await it before serving. Sync stores (memory, JSON files) load during createPlayerThreeHost. | packages/playerthree/src/host/types.ts:555 |
Methods
agentSession()
agentSession(token, role?): AgentSession | undefined;Defined in: packages/playerthree/src/host/types.ts:573
Seat token or commander token → agent session (agent rights). Used by the MCP binding.
Parameters
| Parameter | Type |
|---|---|
token | string |
role? | string |
Returns
AgentSession | undefined
authenticate()
authenticate(token):
| {
match: PlayerThreeMatch<M>;
principal: Principal;
}
| undefined;Defined in: packages/playerthree/src/host/types.ts:564
Resolve any token to its match + principal. Constant-time compare; undefined if unknown/expired.
Parameters
| Parameter | Type |
|---|---|
token | string |
Returns
| {
match: PlayerThreeMatch<M>;
principal: Principal;
}
| undefined
authorizeLease()
authorizeLease(lease): Principal | undefined;Defined in: packages/playerthree/src/host/types.ts:567
Parameters
| Parameter | Type |
|---|---|
lease | AuthorizationLease |
Returns
Principal | undefined
claimToken()
claimToken(token, connectionId): AuthorizationLease | undefined;Defined in: packages/playerthree/src/host/types.ts:566
Atomically consumes a match credential for exactly one transport session.
Parameters
| Parameter | Type |
|---|---|
token | string |
connectionId | string |
Returns
AuthorizationLease | undefined
createMatch()
createMatch(opts?): PlayerThreeMatch<M>;Defined in: packages/playerthree/src/host/types.ts:561
Parameters
| Parameter | Type |
|---|---|
opts? | CreateMatchOptions<M> |
Returns
disconnectLease()
disconnectLease(lease): void;Defined in: packages/playerthree/src/host/types.ts:568
Parameters
| Parameter | Type |
|---|---|
lease | AuthorizationLease |
Returns
void
dispose()
dispose(): void;Defined in: packages/playerthree/src/host/types.ts:577
Returns
void
getMatch()
getMatch(id): PlayerThreeMatch<M> | undefined;Defined in: packages/playerthree/src/host/types.ts:562
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
PlayerThreeMatch<M> | undefined
matches()
matches(): PlayerThreeMatch<M>[];Defined in: packages/playerthree/src/host/types.ts:579
Live (not disposed) matches.
Returns
PlayerThreeMatch<M>[]
onLeaseRevoked()
onLeaseRevoked(listener): () => void;Defined in: packages/playerthree/src/host/types.ts:569
Parameters
| Parameter | Type |
|---|---|
listener | (lease) => void |
Returns
() => void
onTrace()
onTrace(listener): () => void;Defined in: packages/playerthree/src/host/types.ts:581
Developer-facing trace stream (DevTools). Returns unsubscribe. Listener errors are swallowed.
Parameters
| Parameter | Type |
|---|---|
listener | (event) => void |
Returns
() => void
onUsage()
onUsage(listener): () => void;Defined in: packages/playerthree/src/host/types.ts:582
Parameters
| Parameter | Type |
|---|---|
listener | (event) => void |
Returns
() => void
seatControl()
seatControl(token): SeatControl | undefined;Defined in: packages/playerthree/src/host/types.ts:571
Seat token → control plane bound to that seat (agent rights). Used by the MCP binding.
Parameters
| Parameter | Type |
|---|---|
token | string |
Returns
SeatControl | undefined
PlayerThreeHostOptions
Defined in: packages/playerthree/src/host/types.ts:77
Options of createPlayerThreeHost: the game definition, storage (directories or custom stores) and host defaults.
Type Parameters
| Type Parameter |
|---|
M extends AnyManifest |
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
commanderLog? | CommanderLogOptions | Commander match log (SPEC §20.10.1): one entry per match × named commander, written when the match is over or released. Default store: JSONL under dataDir (<dataDir>/commander-log/<game>.jsonl), else memory. | packages/playerthree/src/host/types.ts:113 |
commanderStore? | CommanderStore | Back the commander rosters with your own storage (a database, …). | packages/playerthree/src/host/types.ts:91 |
dataDir? | string | Directory for the commander rosters (JSON + policy artifacts, see jsonCommanderStore). Ignored when commanderStore is given. Omit both for in-memory rosters. | packages/playerthree/src/host/types.ts:89 |
definition | GameDefinition<M> | - | packages/playerthree/src/host/types.ts:78 |
history? | SessionHistoryOptions | Recent sessions kept after the host releases them (record + replay, for the operator console). Default: in memory, 50 sessions / 24 h / 64 MiB of replays. dir or store keeps them across restarts; maxSessions: 0 turns the history off. | packages/playerthree/src/host/types.ts:97 |
matchOptions? | MatchOptionsOf<M> | Host default match options (manifest.matchOptions; validated at creation, throws invalid otherwise). Every match and practice run this host creates merges its own options over them (mergeMatchOptions: objects field by field, other values replace); the merged options are what the match records and replays. | packages/playerthree/src/host/types.ts:103 |
maxMatches? | number | Max concurrent live matches. | packages/playerthree/src/host/types.ts:84 |
poolDir? | string | Directory for the published-policy pool (jsonPoolStore). Ignored when poolStore is given. Omit both for in-memory. | packages/playerthree/src/host/types.ts:80 |
poolStore? | PoolStore | Back the published-policy pool with your own storage (a database, …). | packages/playerthree/src/host/types.ts:82 |
teams? | readonly Infer<M["teams"]>[] | Default match teams: matches created without teams, and lobby practice (whose tested seat plays the first). Default: every manifest team. Validated at creation (invalid for unknown or duplicate teams). | packages/playerthree/src/host/types.ts:108 |
PlayerThreeMatch
Defined in: packages/playerthree/src/host/types.ts:313
One live match (session) on a host: seats and controllers, the clock, streams, replays and the protocol entry point.
Type Parameters
| Type Parameter | Default type |
|---|---|
M extends AnyManifest | AnyManifest |
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
alliances | readonly | | Readonly<Record<string, readonly Infer<M["teams"]>[]>> | undefined | Declared alliances (id → member teams), or undefined when every team is on its own. | packages/playerthree/src/host/types.ts:320 |
id | readonly | string | - | packages/playerthree/src/host/types.ts:314 |
options | readonly | | MatchOptionsOf<M> | undefined | The validated match options this match was created with (undefined: game defaults). | packages/playerthree/src/host/types.ts:333 |
over | readonly | boolean | True once the session's outcome is decided (by the game, or by end()). Never for a persistent session. | packages/playerthree/src/host/types.ts:471 |
persistent | readonly | boolean | Created with persistent: no outcome, end() throws invalid, replay retention is a checkpoint window. | packages/playerthree/src/host/types.ts:473 |
sameOwnerOpposed | readonly | boolean | Sticky: one owner has held played seats (a human hold, an agent or a policy) on two mutually hostile teams of this match. It is that owner's own practice: no outcome is recorded for its commanders or pool policies, and its history record carries the mark so no rating or ranking counts it. | packages/playerthree/src/host/types.ts:326 |
teams | readonly | readonly Infer<M["teams"]>[] | The teams taking part, in manifest order. | packages/playerthree/src/host/types.ts:318 |
tick | readonly | number | - | packages/playerthree/src/host/types.ts:316 |
tokens | readonly | MatchTokens | - | packages/playerthree/src/host/types.ts:315 |
Methods
assign()
assign(assignment): void;Defined in: packages/playerthree/src/host/types.ts:369
Trusted (game-authenticated owner) re-assignment of one seat, before the start or mid-match, at the current tick
boundary. The previous occupant is detached first: its commander lane returns to the lobby (its waits return
unseated), its exact-seat and human credentials (unless the same human keeps it) stop authenticating, and its
plan, pending approval, inbox and seat policies end. The new occupant takes the seat now — a named commander
(commander, with the createMatch rules: compatible role and kind, one owner's agents on different teams need
independent sessions, a commander seated elsewhere fails busy) gets the seat's lease, and its agent's next
wait returns the match entry with its first observation. Recorded as a seat change. Same occupant: no-op.
invalid once the seat's team is out, the match is over or its bindings were released.
Parameters
| Parameter | Type |
|---|---|
assignment | SeatAssignment |
Returns
void
cards()
cards(): PublicSeatCard[];Defined in: packages/playerthree/src/host/types.ts:398
Returns
checkpoint()
checkpoint(tick?): ReplayPosition<M> | undefined;Defined in: packages/playerthree/src/host/types.ts:442
Persistent sessions: an isolated copy (adapter clone()) of the newest kept checkpoint at or before tick
(default: the oldest kept one), positioned to re-simulate this session's replay() window with
replaySimulation(definition, replay, target, position). Undefined when no kept checkpoint is that old (or the
session is not persistent; then replay from the seed).
Parameters
| Parameter | Type |
|---|---|
tick? | number |
Returns
ReplayPosition<M> | undefined
coachingAllowed()
coachingAllowed(owner): boolean;Defined in: packages/playerthree/src/host/types.ts:389
Parameters
| Parameter | Type |
|---|---|
owner | string |
Returns
boolean
debugView()
debugView(): unknown;Defined in: packages/playerthree/src/host/types.ts:413
Unfogged developer-only JSON snapshot, or null if unsupported. Never exposed by the player protocol.
Returns
unknown
dispose()
dispose(): void;Defined in: packages/playerthree/src/host/types.ts:498
Returns
void
end()
end(outcomes): Record<string, Outcome>;Defined in: packages/playerthree/src/host/types.ts:483
End the session now, as if the game had decided it: the clock stops, onEnd listeners and the match_ended
trace fire, outcome()/rank()/replay() report it, and blocked wait calls return. 'draw': every team draws.
Otherwise keys are match teams and/or alliance ids (an alliance key covers its members) and values are either all
outcomes (win/loss/draw, ranked win, draw, loss) or all placements (1 = first; the single side placed first
wins, sides sharing first place draw, the rest lose; a standard competition ranking counting alliances, not
members). Every match team must be covered, allies must agree. Already over: no-op. Returns the final outcomes.
Throws invalid for any other shape and for a persistent session (it has no outcome; dispose() closes it).
Parameters
| Parameter | Type |
|---|---|
outcomes | | "draw" | Readonly<Record<string, FinalOutcome>> | Readonly<Record<string, number>> |
Returns
Record<string, Outcome>
forfeit()
forfeit(team, opts?): void;Defined in: packages/playerthree/src/host/types.ts:491
One match team concedes while the others play on: records the forfeit at the current tick (replay entry and
forfeit trace) and calls the game's forfeit hook, which takes the team out of play. The team's outcome turns
final when the game reports it (the per-team terminal rule); the host then retires it as any team that is out.
No-op once the team forfeited, its outcome is final or the session is over. Throws invalid for a team outside
the match, a game without the hook, or a persistent session (it has no outcome).
Parameters
| Parameter | Type |
|---|---|
team | TeamOf<M> |
opts? | { abandoned?: boolean; } |
opts.abandoned? | boolean |
Returns
void
halt()
halt(): Promise<void>;Defined in: packages/playerthree/src/host/types.ts:393
Stop at a serialized tick boundary without assigning an outcome; cannot be resumed.
Returns
Promise<void>
handleMessage()
handleMessage(
principal,
msg,
push?
): Promise<ServerMsg | undefined>;Defined in: packages/playerthree/src/host/types.ts:454
Transport-agnostic message handling for protocol.ts messages from an authenticated principal.
push is the transport's channel to that client; required for op: 'stream' (subscriptions are keyed by
(push, role); everyTicks: 0 stops). Call release(push) when the client leaves.
Parameters
| Parameter | Type |
|---|---|
principal | Principal |
msg | unknown |
push? | (msg) => void |
Returns
Promise<ServerMsg | undefined>
holdStart()
holdStart(): void;Defined in: packages/playerthree/src/host/types.ts:461
Trusted tick-0 manual preparation/countdown gate. Only start()/skipReadyCheck() releases it.
Returns
void
humanJoined()
humanJoined(
team,
role,
joined
): void;Defined in: packages/playerthree/src/host/types.ts:397
Parameters
Returns
void
metricRows()
metricRows(): Partial<ResultRows>;Defined in: packages/playerthree/src/host/types.ts:329
Returns
Partial<ResultRows>
metrics()
metrics(): GameMetrics;Defined in: packages/playerthree/src/host/types.ts:328
Returns
mintHumanToken()
mintHumanToken(
team,
role,
opts?
): SeatTicket;Defined in: packages/playerthree/src/host/types.ts:378
Parameters
Returns
mintObserverToken()
mintObserverToken(grant, opts): SeatTicket;Defined in: packages/playerthree/src/host/types.ts:385
Parameters
| Parameter | Type |
|---|---|
grant | ObserverGrant |
opts | { owner: string; ttlSeconds?: number; } |
opts.owner | string |
opts.ttlSeconds? | number |
Returns
mintSeatToken()
mintSeatToken(team, role): string;Defined in: packages/playerthree/src/host/types.ts:377
Mint a seat token for an agent (one seat, this match).
Parameters
Returns
string
mintSpectatorToken()
mintSpectatorToken(team, opts?): SeatTicket;Defined in: packages/playerthree/src/host/types.ts:384
Parameters
| Parameter | Type |
|---|---|
team | TeamOf<M> |
opts? | { ttlSeconds?: number; } |
opts.ttlSeconds? | number |
Returns
observerFrames()
observerFrames(grant, after?): AsyncIterable<ObserverFrame>;Defined in: packages/playerthree/src/host/types.ts:388
Parameters
| Parameter | Type |
|---|---|
grant | ObserverGrant |
after? | number |
Returns
AsyncIterable<ObserverFrame>
observerMessages()
observerMessages(
principal,
perspective,
after?
): ObserverMessage[];Defined in: packages/playerthree/src/host/types.ts:387
Released observer messages after cursor after: deltas in order, or one keyframe (join, resync). Shared and frozen.
Parameters
| Parameter | Type |
|---|---|
principal | Principal |
perspective | string |
after? | number |
Returns
onCommentary()
onCommentary(listener): () => void;Defined in: packages/playerthree/src/host/types.ts:331
Parameters
| Parameter | Type |
|---|---|
listener | (event) => void |
Returns
() => void
onEnd()
onEnd(listener): () => void;Defined in: packages/playerthree/src/host/types.ts:428
Fires once when the match is over, with every match team's outcome and rank.
Parameters
| Parameter | Type |
|---|---|
listener | (outcomes, ranks) => void |
Returns
() => void
onReadiness()
onReadiness(listener): () => void;Defined in: packages/playerthree/src/host/types.ts:351
Readiness/card changes: every status change plus agent arrivals (presence is not part of SeatStatus).
Parameters
| Parameter | Type |
|---|---|
listener | (team, role) => void |
Returns
() => void
onSaid()
onSaid(listener): () => void;Defined in: packages/playerthree/src/host/types.ts:408
Agent replies (say) per team — deliver them to that team's owners only. Returns unsubscribe.
Parameters
| Parameter | Type |
|---|---|
listener | (team, said) => void |
Returns
() => void
onStatus()
onStatus(listener): () => void;Defined in: packages/playerthree/src/host/types.ts:349
Seat lifecycle changes, not tick-rate observations. Returns unsubscribe.
Parameters
| Parameter | Type |
|---|---|
listener | (team, role) => void |
Returns
() => void
onTick()
onTick(listener): () => void;Defined in: packages/playerthree/src/host/types.ts:327
Parameters
| Parameter | Type |
|---|---|
listener | (tick) => void |
Returns
() => void
onUsage()
onUsage(listener): () => void;Defined in: packages/playerthree/src/host/types.ts:330
Parameters
| Parameter | Type |
|---|---|
listener | (event) => void |
Returns
() => void
onView()
onView(team, listener): () => void;Defined in: packages/playerthree/src/host/types.ts:419
Subscribe to a team's view stream (SPEC §4, view streams). The host computes a team's views only while its stream has
subscribers: a first subscriber restarts it from a fresh view, then every view tick (viewHz) that changed the view
adds a version and calls listener with it. Returns unsubscribe.
Parameters
| Parameter | Type |
|---|---|
team | TeamOf<M> |
listener | (version) => void |
Returns
() => void
outcome()
outcome(team): Outcome;Defined in: packages/playerthree/src/host/types.ts:339
A match team's outcome. The first final outcome the game reports for a team is kept: from then on the team is
out (its seats' intents fail game_over, its bots and policies stop, its waits return, its commanders and pool
policies record the outcome) while the others play on. The match is over once every team is final.
Parameters
| Parameter | Type |
|---|---|
team | TeamOf<M> |
Returns
paused()
paused(): PauseInfo | undefined;Defined in: packages/playerthree/src/host/types.ts:447
The session stands still because a seat with whenAbsent: 'pause' has no present agent (pausable games), or
undefined while it runs.
Returns
PauseInfo | undefined
rank()
rank(team): number | null;Defined in: packages/playerthree/src/host/types.ts:344
A match team's final placement once the match is over (1 is best, ties share, allies share their alliance's),
else null: the game's rank(), or ranked by outcome. invalid for a team not in the match.
Parameters
| Parameter | Type |
|---|---|
team | TeamOf<M> |
Returns
number | null
readiness()
readiness(): ReadinessSnapshot;Defined in: packages/playerthree/src/host/types.ts:399
Returns
readyCheck()
readyCheck(): ReadyCheck | undefined;Defined in: packages/playerthree/src/host/types.ts:463
Ready check state, or undefined if the match was created without one.
Returns
ReadyCheck | undefined
release()
release(push): void;Defined in: packages/playerthree/src/host/types.ts:456
Drop every stream subscription made through handleMessage with this push.
Parameters
| Parameter | Type |
|---|---|
push | (msg) => void |
Returns
void
releaseBindings()
releaseBindings(): Promise<void>;Defined in: packages/playerthree/src/host/types.ts:391
Release execution authority without inventing an outcome or changing replay/game state.
Returns
Promise<void>
renewHumanToken()
renewHumanToken(
team,
role,
opts?
): object;Defined in: packages/playerthree/src/host/types.ts:383
Extend the seat's claimed, still-connected human credential in place: its connection stays (no rejoin, no fresh
keyframe). Same holder check as mintHumanToken; bad_token when nothing live is left to extend.
Parameters
Returns
object
| Name | Type | Defined in |
|---|---|---|
expiresAt | number | packages/playerthree/src/host/types.ts:383 |
replay()
replay(): Replay;Defined in: packages/playerthree/src/host/types.ts:435
Replay so far: seed + every intent that reached adapter.apply and every seat change and pause/resume, per
tick and seat. Persistent sessions: only the retained window (window is set once older entries were dropped).
Returns
report()
report(team): ReportOf<M> | null;Defined in: packages/playerthree/src/host/types.ts:430
Guarded after-action report for a team (manifest.report), or null if the game produced non-conforming data.
Parameters
| Parameter | Type |
|---|---|
team | TeamOf<M> |
Returns
ReportOf<M> | null
resolveApproval()
resolveApproval(
team,
role,
id,
approve
): Promise<
| void
| DeployResult
| PublishResult>;Defined in: packages/playerthree/src/host/types.ts:357
Parameters
Returns
Promise<
| void
| DeployResult
| PublishResult>
revokeSeat()
revokeSeat(team, role): void;Defined in: packages/playerthree/src/host/types.ts:395
Parameters
Returns
void
revokeToken()
revokeToken(token): void;Defined in: packages/playerthree/src/host/types.ts:394
Parameters
| Parameter | Type |
|---|---|
token | string |
Returns
void
seat()
seat(team, role): SeatControl;Defined in: packages/playerthree/src/host/types.ts:401
In-process control plane for a seat, acting with owner rights.
Parameters
Returns
seats()
seats(): SeatInfo[];Defined in: packages/playerthree/src/host/types.ts:345
Returns
SeatInfo[]
setController()
setController(
team,
role,
controller,
opts?
): void;Defined in: packages/playerthree/src/host/types.ts:354
Owner-level operations (also reachable via handleMessage for remote owners).
Parameters
| Parameter | Type |
|---|---|
team | TeamOf<M> |
role | RoleOf<M> |
controller | "human" | "policy" | "agent" | "bot" | "none" |
opts? | { poolPolicy?: string; } |
opts.poolPolicy? | string |
Returns
void
setHumanReady()
setHumanReady(
team,
role,
ready
): void;Defined in: packages/playerthree/src/host/types.ts:396
Parameters
Returns
void
setLobbyStart()
setLobbyStart(start): void;Defined in: packages/playerthree/src/host/types.ts:375
Describe when a held match starts, for its agents' lobby state (startsWhen): host (the game starts it), ready
(once every seat is ready, or at at), countdown (at at); at is a wall clock (ms since epoch). Undefined
restores the default: ready with the ready-check deadline, or host for holdStart().
Parameters
| Parameter | Type |
|---|---|
start | | { at?: number; kind: "host" | "ready" | "countdown"; } | undefined |
Returns
void
setMandate()
setMandate(
team,
role,
mandate
): void;Defined in: packages/playerthree/src/host/types.ts:355
Parameters
Returns
void
setScopes()
setScopes(
team,
role,
scopes
): void;Defined in: packages/playerthree/src/host/types.ts:356
Parameters
Returns
void
skipReadyCheck()
skipReadyCheck(): void;Defined in: packages/playerthree/src/host/types.ts:468
End a pending ready check now ("start anyway"); starts the realtime loop if the match was created realtime. Every stepping path refuses while pending; readiness() explains the per-seat gate.
Returns
void
start()
start(): void;Defined in: packages/playerthree/src/host/types.ts:459
Starts the realtime loop (ends a pending ready check).
Returns
void
status()
status(team, role): SeatStatus;Defined in: packages/playerthree/src/host/types.ts:347
Non-consuming agent lifecycle snapshot; does not drain wait transitions or messages.
Parameters
Returns
step()
step(n?): Promise<void>;Defined in: packages/playerthree/src/host/types.ts:497
Advance N ticks (tests, practice, engines owning the clock). Awaits policy calls. While the session is paused
it refuses with PlayerThreeError('paused'): synchronously when paused at the call, else the promise rejects at the
first tick that finds the session paused (ticks before it were stepped). Check paused() / onStatus.
Parameters
| Parameter | Type |
|---|---|
n? | number |
Returns
Promise<void>
stop()
stop(): void;Defined in: packages/playerthree/src/host/types.ts:469
Returns
void
stream()
stream(
team,
role,
everyTicks,
listener,
detail?
): () => void;Defined in: packages/playerthree/src/host/types.ts:426
Stream mode push for a seat; detail widens the pushed observations (unknown section → invalid). Returns unsubscribe.
Parameters
| Parameter | Type |
|---|---|
team | TeamOf<M> |
role | RoleOf<M> |
everyTicks | number |
listener | (obs) => void |
detail? | DetailRequest |
Returns
() => void
tell()
tell(
team,
roles,
text,
ping?
): void;Defined in: packages/playerthree/src/host/types.ts:406
Chat mode (owner): message this team's own agents (roles or all). Text ≤ maxTellChars, rate-limited per
team; ping must match manifest.control.chat.ping. Reaches only that team's seats; never policies or replays.
Parameters
Returns
void
updateCommanderSettings()
updateCommanderSettings(
team,
role,
settings
): void;Defined in: packages/playerthree/src/host/types.ts:358
Parameters
| Parameter | Type |
|---|---|
team | TeamOf<M> |
role | RoleOf<M> |
settings | CommanderSettings |
Returns
void
view()
view(team): ViewOf<M>;Defined in: packages/playerthree/src/host/types.ts:411
Guarded, fogged view for a team as a fresh snapshot (includes static parts); outside the view stream.
Parameters
| Parameter | Type |
|---|---|
team | TeamOf<M> |
Returns
ViewOf<M>
viewMessages()
viewMessages(team, after?): ViewMessage[];Defined in: packages/playerthree/src/host/types.ts:424
The messages that bring a reader at version after (undefined: a fresh reader) up to the team's latest version:
the missed deltas in order, or one keyframe. Shared and frozen; empty when current or not subscribed.
Parameters
| Parameter | Type |
|---|---|
team | TeamOf<M> |
after? | number |
Returns
PolicyCallResult
Defined in: packages/playerthree/src/policy/types.ts:17
A successful think call.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
cpuMs | number | CPU time of the sandbox thread during the call: the quantity msPerCall budgets (load-independent). | packages/playerthree/src/policy/types.ts:26 |
dropped | number | - | packages/playerthree/src/policy/types.ts:20 |
intents | unknown[] | Untrusted; at most limits.maxIntentsPerCall (extra are dropped and counted). | packages/playerthree/src/policy/types.ts:19 |
logs | string[] | Lines the policy logged during this call, each ≤ maxLogLineBytes. | packages/playerthree/src/policy/types.ts:22 |
ms | number | Wall time the call took on the sandbox thread (excludes host scheduling and the thread round trip). | packages/playerthree/src/policy/types.ts:24 |
PolicyInstance
Defined in: packages/playerthree/src/policy/types.ts:41
One loaded policy, isolated in its own worker; state persists between its calls.
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
dead | readonly | boolean | - | packages/playerthree/src/policy/types.ts:51 |
detail | readonly | PolicyDetail | undefined | The artifact's declared observation detail (shape-checked at load); undefined when it declares none. | packages/playerthree/src/policy/types.ts:44 |
runtime | readonly | "js" | "wasm" | - | packages/playerthree/src/policy/types.ts:42 |
Methods
call()
call(observation): Promise<PolicyCallOutcome>;Defined in: packages/playerthree/src/policy/types.ts:50
Rejects never; failures are returned. After a timeout or memory_limit (or an engine crash, reported as threw)
the instance is dead and every further call returns the error that killed it. logs: lines the policy logged
before a non-fatal failure (same caps as on success).
Parameters
| Parameter | Type |
|---|---|
observation | unknown |
Returns
Promise<PolicyCallOutcome>
dispose()
dispose(): void;Defined in: packages/playerthree/src/policy/types.ts:52
Returns
void
PolicyPool
Defined in: packages/playerthree/src/host/types.ts:535
The host's published-policy pool.
Methods
draft()
draft(role): PoolEntry | undefined;Defined in: packages/playerthree/src/host/types.ts:539
Random draftable entry for a role (counted in drafts), or undefined.
Parameters
| Parameter | Type |
|---|---|
role | string |
Returns
PoolEntry | undefined
entries()
entries(): PoolRecord[];Defined in: packages/playerthree/src/host/types.ts:541
Operator tooling: every entry with its publisher and disabled flag.
Returns
list()
list(role?): PoolEntry[];Defined in: packages/playerthree/src/host/types.ts:537
Draftable (not disabled) entries.
Parameters
| Parameter | Type |
|---|---|
role? | string |
Returns
setDisabled()
setDisabled(id, disabled): PoolRecord | undefined;Defined in: packages/playerthree/src/host/types.ts:543
Operator tooling: stop (or resume) drafting an entry. Undefined for unknown ids.
Parameters
| Parameter | Type |
|---|---|
id | string |
disabled | boolean |
Returns
PoolRecord | undefined
unpublish()
unpublish(id): boolean;Defined in: packages/playerthree/src/host/types.ts:545
Operator tooling: delete an entry and its artifact. Seats already running it keep playing. False if unknown.
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
boolean
PoolEntry
Defined in: packages/playerthree/src/host/types.ts:508
A published pool policy without its publisher (operators see PoolRecord).
Extended by
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
createdAt | number | - | packages/playerthree/src/host/types.ts:519 |
drafts | number | Times the pool drafted this entry into a seat at random (draft). | packages/playerthree/src/host/types.ts:521 |
draws | number | - | packages/playerthree/src/host/types.ts:518 |
game | string | - | packages/playerthree/src/host/types.ts:511 |
id | string | pol_<digits> | packages/playerthree/src/host/types.ts:510 |
losses | number | - | packages/playerthree/src/host/types.ts:517 |
role | string | - | packages/playerthree/src/host/types.ts:512 |
runtime | string | - | packages/playerthree/src/host/types.ts:513 |
surfaceHash | string | - | packages/playerthree/src/host/types.ts:514 |
wins | number | Results of pool matches this policy played. | packages/playerthree/src/host/types.ts:516 |
PoolRecord
Defined in: packages/playerthree/src/host/types.ts:528
Operator view of a pool entry, including disabled ones.
Extends
Properties
PoolStore
Defined in: packages/playerthree/src/host/types.ts:1049
Storage behind the published-policy pool. Every method may be sync or async; writes are issued in order (an
entry's artifact before the entry) and failures are reported to the host's console (the in-memory state stays
authoritative for the process). Entries of other games in load() are ignored.
Methods
deleteEntry()
deleteEntry(id): void | Promise<void>;Defined in: packages/playerthree/src/host/types.ts:1054
Delete an entry and its artifact.
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
void | Promise<void>
load()
load():
| PoolStoreData
| Promise<PoolStoreData>;Defined in: packages/playerthree/src/host/types.ts:1050
Returns
| PoolStoreData
| Promise<PoolStoreData>
loadArtifact()
loadArtifact(id):
| StoredPolicyArtifact
| Promise<StoredPolicyArtifact | undefined>
| undefined;Defined in: packages/playerthree/src/host/types.ts:1056
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
| StoredPolicyArtifact
| Promise<StoredPolicyArtifact | undefined>
| undefined
saveArtifact()
saveArtifact(id, artifact): void | Promise<void>;Defined in: packages/playerthree/src/host/types.ts:1055
Parameters
| Parameter | Type |
|---|---|
id | string |
artifact | StoredPolicyArtifact |
Returns
void | Promise<void>
saveEntry()
saveEntry(entry): void | Promise<void>;Defined in: packages/playerthree/src/host/types.ts:1052
Upsert one entry (counters, disabled flag).
Parameters
| Parameter | Type |
|---|---|
entry | StoredPoolEntry |
Returns
void | Promise<void>
PoolStoreData
Defined in: packages/playerthree/src/host/types.ts:1040
Properties
| Property | Type | Defined in |
|---|---|---|
entries | StoredPoolEntry[] | packages/playerthree/src/host/types.ts:1041 |
PublicSeatCard
Defined in: packages/playerthree/src/host/types.ts:197
Properties
| Property | Type | Defined in |
|---|---|---|
aiPlayer | true | packages/playerthree/src/host/types.ts:200 |
harness? | object | packages/playerthree/src/host/types.ts:202 |
harness.label | string | packages/playerthree/src/host/types.ts:202 |
harness.verified | boolean | packages/playerthree/src/host/types.ts:202 |
kind | "policy" | "agent" | packages/playerthree/src/host/types.ts:199 |
mode | "policy" | "bot" | "live" | "held" | packages/playerthree/src/host/types.ts:201 |
policy? | object | packages/playerthree/src/host/types.ts:203 |
policy.policyId? | string | packages/playerthree/src/host/types.ts:203 |
policy.source | "pool" | "library" | packages/playerthree/src/host/types.ts:203 |
policy.version? | number | packages/playerthree/src/host/types.ts:203 |
seat | object | packages/playerthree/src/host/types.ts:198 |
seat.role | string | packages/playerthree/src/host/types.ts:198 |
seat.team | string | packages/playerthree/src/host/types.ts:198 |
ReadinessSnapshot
Defined in: packages/playerthree/src/host/types.ts:191
Properties
| Property | Type | Defined in |
|---|---|---|
deadline? | number | packages/playerthree/src/host/types.ts:194 |
mode | "none" | "start" | packages/playerthree/src/host/types.ts:192 |
pending | boolean | packages/playerthree/src/host/types.ts:193 |
seats | object[] | packages/playerthree/src/host/types.ts:195 |
ReadyCheck
Defined in: packages/playerthree/src/host/types.ts:303
Compact clock/readiness check for a match created with assignments + readySeconds.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
deadline | number | Wall clock (ms since epoch) for AI fallback. Required human admission does not time out into play. | packages/playerthree/src/host/types.ts:307 |
pending | boolean | True while the match is held at tick 0. | packages/playerthree/src/host/types.ts:305 |
seats | object[] | Every assigned seat; ready follows its kind's gate. | packages/playerthree/src/host/types.ts:309 |
Replay
Defined in: packages/playerthree/src/host/types.ts:710
Deterministic replay file. Re-simulate with replayMatch(definition, replay).
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
alliances? | Record<string, string[]> | - | packages/playerthree/src/host/types.ts:722 |
entries | ReplayEntry[] | - | packages/playerthree/src/host/types.ts:723 |
format | "playerthree.replay" | - | packages/playerthree/src/host/types.ts:711 |
game | string | - | packages/playerthree/src/host/types.ts:713 |
gameVersion | string | - | packages/playerthree/src/host/types.ts:714 |
options? | unknown | Match options the match was created with (absent: game defaults). | packages/playerthree/src/host/types.ts:717 |
outcomes | Record<string, Outcome> | Per match team, as of ticks. | packages/playerthree/src/host/types.ts:725 |
ranks? | Record<string, number> | Final placement per match team, once the match is over. | packages/playerthree/src/host/types.ts:727 |
seed | number | - | packages/playerthree/src/host/types.ts:715 |
teams | string[] | The match teams (manifest order) and declared alliances (absent: every team on its own); the game is created with them. | packages/playerthree/src/host/types.ts:721 |
ticks | number | Final tick recorded. | packages/playerthree/src/host/types.ts:719 |
version | 2 | - | packages/playerthree/src/host/types.ts:712 |
window? | object | Persistent sessions after retention dropped older entries: the window starts at checkpoint tick from, and dropped entries were recorded before entries[0] (entry indices in replay positions count them). Such a replay re-simulates only from that session's checkpoint (PlayerThreeMatch.checkpoint()), never from the seed. | packages/playerthree/src/host/types.ts:733 |
window.dropped | number | - | packages/playerthree/src/host/types.ts:733 |
window.from | number | - | packages/playerthree/src/host/types.ts:733 |
ReplayPosition
Defined in: packages/playerthree/src/host/types.ts:702
A re-simulation position: inputs before entryIndex have already been applied to this isolated adapter.
entryIndex is absolute: it counts entries a persistent session's replay window dropped (Replay.window.dropped).
Type Parameters
| Type Parameter |
|---|
M extends AnyManifest |
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
adapter | GameAdapter<M> | - | packages/playerthree/src/host/types.ts:703 |
entryIndex | number | - | packages/playerthree/src/host/types.ts:704 |
signals? | SignalBoard | The team signal boards at this position: required for games declaring signals. | packages/playerthree/src/host/types.ts:706 |
ResultsKey
Defined in: packages/playerthree/src/commander-log.ts:199
A published verification key with its validity window (ms since epoch; until exclusive, null = open).
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
from | number | - | packages/playerthree/src/commander-log.ts:203 |
keyId | string | - | packages/playerthree/src/commander-log.ts:200 |
publicKey | string | SPKI DER, base64url. | packages/playerthree/src/commander-log.ts:202 |
revokedAt? | number | null | Entries ending at or after this instant do not verify under this key. | packages/playerthree/src/commander-log.ts:206 |
until | number | null | - | packages/playerthree/src/commander-log.ts:204 |
ResultsSigner
Defined in: packages/playerthree/src/commander-log.ts:192
Host signing capability: keyId is resultsKeyId of its public key (SPKI DER, base64url); sign returns the
base64url Ed25519 signature of a UTF-8 payload. The private key never leaves it (parseResultsSigner).
Properties
| Property | Modifier | Type | Defined in |
|---|---|---|---|
keyId | readonly | string | packages/playerthree/src/commander-log.ts:193 |
publicKey | readonly | string | packages/playerthree/src/commander-log.ts:194 |
Methods
sign()
sign(payload): string;Defined in: packages/playerthree/src/commander-log.ts:195
Parameters
| Parameter | Type |
|---|---|
payload | string |
Returns
string
SeatAssignment
Defined in: packages/playerthree/src/host/types.ts:171
A trusted, game-authenticated seat assignment (CreateMatchOptions.assignments, PlayerThreeMatch.assign).
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
commander? | object | Owner-private named commander; required for roster-backed agent/library seats. | packages/playerthree/src/host/types.ts:180 |
commander.id | string | - | packages/playerthree/src/host/types.ts:180 |
kind | SeatKind | - | packages/playerthree/src/host/types.ts:176 |
owner | string | Trusted game-authenticated opaque owner; never publish this identifier. | packages/playerthree/src/host/types.ts:175 |
ownerControl? | boolean | Trusted game grant of human owner control/delegation; never inferred from a shared owner or agent identity. | packages/playerthree/src/host/types.ts:178 |
policy? | | { version: number; } | { policyId: string; } | - | packages/playerthree/src/host/types.ts:181 |
role | string | - | packages/playerthree/src/host/types.ts:173 |
team | string | - | packages/playerthree/src/host/types.ts:172 |
SeatInfo
Defined in: packages/playerthree/src/host/types.ts:284
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
agentActive | boolean | A recent call, an in-flight call, or an active sequence keeps the agent present. | packages/playerthree/src/host/types.ts:295 |
commander? | boolean | True when the seat was set up from the team owner's commander roster (its agent uses the persistent commander token). | packages/playerthree/src/host/types.ts:297 |
controller | "human" | "policy" | "agent" | "bot" | "none" | - | packages/playerthree/src/host/types.ts:287 |
mandate | Mandate | - | packages/playerthree/src/host/types.ts:288 |
pause? | SeatPause | Present while this seat holds a pausable session still (whenAbsent: 'pause', agent absent). | packages/playerthree/src/host/types.ts:299 |
policyVersion? | number | Deployed policy version for this seat, if any. | packages/playerthree/src/host/types.ts:291 |
poolPolicy? | string | Pool policy id when controller === 'policy'. | packages/playerthree/src/host/types.ts:293 |
role | string | - | packages/playerthree/src/host/types.ts:286 |
scopes | ("act" | "policy" | "practice" | "publish" | "say")[] | - | packages/playerthree/src/host/types.ts:289 |
team | string | - | packages/playerthree/src/host/types.ts:285 |
SeatTicket
Defined in: packages/playerthree/src/host/types.ts:188
Properties
| Property | Type | Defined in |
|---|---|---|
expiresAt | number | packages/playerthree/src/host/types.ts:188 |
token | string | packages/playerthree/src/host/types.ts:188 |
SessionHistory
Defined in: packages/playerthree/src/host/types.ts:661
Released sessions, newest first. Read-only for everything but the host and transports.
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
limits | readonly | object | Effective bounds; dir is the jsonHistoryStore directory from dir, else null (memory or a custom store). maxSessions 0: off. | packages/playerthree/src/host/types.ts:663 |
limits.dir | public | string | null | - | packages/playerthree/src/host/types.ts:663 |
limits.maxAgeMs | public | number | - | packages/playerthree/src/host/types.ts:663 |
limits.maxBytes | public | number | - | packages/playerthree/src/host/types.ts:663 |
limits.maxSessions | public | number | - | packages/playerthree/src/host/types.ts:663 |
Methods
annotate()
annotate(
session,
team,
role,
harness
): void;Defined in: packages/playerthree/src/host/types.ts:672
Transports report who holds a seat of a session the host still holds (e.g. the MCP sign-in client's name, or "seat token"); recorded with the seat on release. At most 4 labels per seat, 80 characters each.
Parameters
| Parameter | Type |
|---|---|
session | string |
team | string |
role | string |
harness | string |
Returns
void
flush()
flush(): Promise<void>;Defined in: packages/playerthree/src/host/types.ts:676
Resolves once pending store writes and deletions are done.
Returns
Promise<void>
get()
get(id): SessionRecord | undefined;Defined in: packages/playerthree/src/host/types.ts:665
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
SessionRecord | undefined
list()
list(): SessionRecord[];Defined in: packages/playerthree/src/host/types.ts:664
Returns
onRecord()
onRecord(listener): () => void;Defined in: packages/playerthree/src/host/types.ts:674
Called after each new record. Returns unsubscribe.
Parameters
| Parameter | Type |
|---|---|
listener | (record) => void |
Returns
() => void
replay()
replay(id): Promise<Replay | undefined>;Defined in: packages/playerthree/src/host/types.ts:667
The session's replay, or undefined (unknown, pruned, or too large to keep).
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
Promise<Replay | undefined>
SessionHistoryOptions
Defined in: packages/playerthree/src/host/types.ts:588
Bounds and storage of the session history (PlayerThreeHostOptions.history).
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
dir? | string | Directory for the history (jsonHistoryStore: one <session>.json per session, record + replay, written atomically). Survives restarts. Ignored when store is given. Omit both for in-memory. Use one directory per game. | packages/playerthree/src/host/types.ts:599 |
maxAgeMs? | number | Sessions released longer ago than this are dropped. Default 24 h. | packages/playerthree/src/host/types.ts:592 |
maxBytes? | number | Total replay bytes kept (serialized JSON). A replay larger than this on its own is not kept (the record is). Default 64 MiB. | packages/playerthree/src/host/types.ts:594 |
maxSessions? | number | Most sessions kept (oldest dropped first). Default 50; 0 turns the history off. | packages/playerthree/src/host/types.ts:590 |
store? | HistoryStore | Back the history with your own storage (a database, …). Wins over dir. | packages/playerthree/src/host/types.ts:601 |
SessionRecord
Defined in: packages/playerthree/src/host/types.ts:620
A released session as the history keeps it.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
alliances | Record<string, string[]> | null | - | packages/playerthree/src/host/types.ts:637 |
codes | object | Codes by count (top 16 each): rejected agent inputs, and policy errors (timeout, threw, deploy:<code>, …). | packages/playerthree/src/host/types.ts:651 |
codes.policyErrors | object[] | - | packages/playerthree/src/host/types.ts:651 |
codes.rejections | object[] | - | packages/playerthree/src/host/types.ts:651 |
createdAt | number | Wall clock, ms since epoch. | packages/playerthree/src/host/types.ts:628 |
endedAt | number | null | When the outcome was decided, or null (released while running). | packages/playerthree/src/host/types.ts:630 |
from | number | First tick the replay covers: 0, or the start of a persistent session's rolling window (Replay.window.from). | packages/playerthree/src/host/types.ts:657 |
game | string | - | packages/playerthree/src/host/types.ts:622 |
gameVersion | string | - | packages/playerthree/src/host/types.ts:623 |
id | string | - | packages/playerthree/src/host/types.ts:621 |
options | unknown | Validated match options (null: game defaults). | packages/playerthree/src/host/types.ts:626 |
outcomes | Record<string, Outcome> | Per match team. | packages/playerthree/src/host/types.ts:639 |
owners | Record<string, string> | { [team/role]: owner } for exact assigned seats. | packages/playerthree/src/host/types.ts:643 |
policyErrors | number | - | packages/playerthree/src/host/types.ts:649 |
ranks | Record<string, number> | null | Final placement per match team, or null (released while running). | packages/playerthree/src/host/types.ts:641 |
rejections | number | Rejected agent/policy/stream intents over the session. | packages/playerthree/src/host/types.ts:648 |
releasedAt | number | - | packages/playerthree/src/host/types.ts:631 |
replay | boolean | False when the replay exceeded maxBytes on its own and only the record was kept. | packages/playerthree/src/host/types.ts:655 |
replayBytes | number | Serialized replay size. | packages/playerthree/src/host/types.ts:653 |
sameOwnerOpposed | boolean | PlayerThreeMatch.sameOwnerOpposed at release: the owner's own practice, never rated or ranked. | packages/playerthree/src/host/types.ts:645 |
seats | SessionSeatRecord[] | - | packages/playerthree/src/host/types.ts:646 |
seconds | number | Game time (ticks / tickRate). | packages/playerthree/src/host/types.ts:634 |
seed | number | - | packages/playerthree/src/host/types.ts:624 |
teams | string[] | The match teams (manifest order) and declared alliances (null: every team on its own). | packages/playerthree/src/host/types.ts:636 |
ticks | number | - | packages/playerthree/src/host/types.ts:632 |
SessionSeatRecord
Defined in: packages/playerthree/src/host/types.ts:605
One seat as it was when the session was released.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
commander | boolean | Set up from the owner's commander roster. | packages/playerthree/src/host/types.ts:612 |
controller | "human" | "policy" | "agent" | "bot" | "none" | - | packages/playerthree/src/host/types.ts:608 |
harnesses | string[] | Who held the seat as an agent, as reported by the transport (annotate), e.g. a sign-in client's name. | packages/playerthree/src/host/types.ts:616 |
owner | string | null | Trusted owner assigned to this exact seat, or null for an unassigned seat. | packages/playerthree/src/host/types.ts:610 |
policyVersion? | number | - | packages/playerthree/src/host/types.ts:613 |
poolPolicy? | string | - | packages/playerthree/src/host/types.ts:614 |
role | string | - | packages/playerthree/src/host/types.ts:607 |
team | string | - | packages/playerthree/src/host/types.ts:606 |
StoredCommander
Defined in: packages/playerthree/src/host/types.ts:988
Extends
Properties
StoredCommanderLogEntry
Defined in: packages/playerthree/src/commander-log.ts:144
Properties
| Property | Type | Defined in |
|---|---|---|
commanderId | string | packages/playerthree/src/commander-log.ts:145 |
entry | CommanderLogEntry | packages/playerthree/src/commander-log.ts:146 |
sealed | CommanderLogSealed | null | packages/playerthree/src/commander-log.ts:147 |
StoredOwner
Defined in: packages/playerthree/src/host/types.ts:1001
Properties
| Property | Type | Defined in |
|---|---|---|
commanders | StoredCommander[] | packages/playerthree/src/host/types.ts:1004 |
createdAt | number | packages/playerthree/src/host/types.ts:1003 |
owner | string | packages/playerthree/src/host/types.ts:1002 |
StoredPoolEntry
Defined in: packages/playerthree/src/host/types.ts:1034
A pool entry as stored: the public entry plus its publisher and disabled flag (operators only).
Extends
Properties
TopicContext
Defined in: packages/playerthree/src/topics.ts:34
Seat context for dynamic topics. matchData: the seat's guarded match bootstrap while in a match (null when the
game declares none); omitted in the lobby, where match-data documents its fields instead.
Properties
| Property | Modifier | Type | Defined in |
|---|---|---|---|
matchData? | readonly | Record<string, unknown> | null | packages/playerthree/src/topics.ts:35 |
UsageEvent
Defined in: packages/playerthree/src/host/types.ts:67
Properties
| Property | Type | Defined in |
|---|---|---|
match | string | packages/playerthree/src/host/types.ts:68 |
receivedAt | number | packages/playerthree/src/host/types.ts:72 |
report | DecisionUsage | packages/playerthree/src/host/types.ts:73 |
role | string | packages/playerthree/src/host/types.ts:70 |
team | string | packages/playerthree/src/host/types.ts:69 |
tick | number | packages/playerthree/src/host/types.ts:71 |
Type Aliases
AgentSession
type AgentSession =
| {
control: SeatControl;
kind: "seat";
match: PlayerThreeMatch;
role: string;
team: string;
drain(): OwnerMessage[];
reportUsage(report): void;
}
| {
commanderId: string;
control: SeatControl;
key: string;
kind: "commander";
owner: string;
role: string;
drain(): OwnerMessage[];
reportUsage(report): void;
seat():
| {
match: string;
role: string;
team: string;
}
| null;
status(): SeatStatus;
};Defined in: packages/playerthree/src/host/types.ts:958
An authenticated agent: a per-match seat token, or a persistent commander token.
Union Members
Type Literal
{
control: SeatControl;
kind: "seat";
match: PlayerThreeMatch;
role: string;
team: string;
drain(): OwnerMessage[];
reportUsage(report): void;
}| Name | Type | Description | Defined in |
|---|---|---|---|
control | SeatControl | - | packages/playerthree/src/host/types.ts:961 |
kind | "seat" | - | packages/playerthree/src/host/types.ts:960 |
match | PlayerThreeMatch | - | packages/playerthree/src/host/types.ts:963 |
role | string | - | packages/playerthree/src/host/types.ts:965 |
team | string | - | packages/playerthree/src/host/types.ts:964 |
drain() | () => OwnerMessage[] | Read (and clear) unread owner messages (chat mode). | packages/playerthree/src/host/types.ts:967 |
reportUsage() | (report) => void | - | packages/playerthree/src/host/types.ts:962 |
Type Literal
{
commanderId: string;
control: SeatControl;
key: string;
kind: "commander";
owner: string;
role: string;
drain(): OwnerMessage[];
reportUsage(report): void;
seat():
| {
match: string;
role: string;
team: string;
}
| null;
status(): SeatStatus;
}| Name | Type | Description | Defined in |
|---|---|---|---|
commanderId | string | - | packages/playerthree/src/host/types.ts:976 |
control | SeatControl | Routes to the seat while a match seats the commander, else lobby semantics. | packages/playerthree/src/host/types.ts:972 |
key | string | Stable per (owner, commander ID, token generation): per-token consent and rate limits. | packages/playerthree/src/host/types.ts:979 |
kind | "commander" | - | packages/playerthree/src/host/types.ts:970 |
owner | string | - | packages/playerthree/src/host/types.ts:975 |
role | string | - | packages/playerthree/src/host/types.ts:977 |
drain() | () => OwnerMessage[] | Read (and clear) unread owner messages (chat mode), in the lobby or the live seat. | packages/playerthree/src/host/types.ts:981 |
reportUsage() | (report) => void | - | packages/playerthree/src/host/types.ts:973 |
seat() | () => | { match: string; role: string; team: string; } | null | The live match seating the commander, or null (lobby). | packages/playerthree/src/host/types.ts:983 |
status() | () => SeatStatus | - | packages/playerthree/src/host/types.ts:974 |
CommanderLogAssist
type CommanderLogAssist = "none" | "owner_chat" | "owner_intents" | "takeover";Defined in: packages/playerthree/src/commander-log.ts:22
Assistance the host observed for this commander's team: owner chat, owner intents, or a human/owner-control seat.
CommanderLogDisposition
type CommanderLogDisposition = "final" | "forfeit" | "abandoned" | "interrupted" | "aborted";Defined in: packages/playerthree/src/commander-log.ts:20
final: the game decided the match; forfeit / abandoned: this commander's team left (the game said whether it
conceded or failed to show up); interrupted: execution stopped without an outcome; aborted: it stopped before
the first tick.
CommanderLogOutcome
type CommanderLogOutcome = "win" | "loss" | "draw" | "unknown";Defined in: packages/playerthree/src/commander-log.ts:14
CommanderPracticeRequest
type CommanderPracticeRequest = Omit<PracticeRequest, "artifact"> & object;Defined in: packages/playerthree/src/host/types.ts:856
Owner-side practice request (the commander's active library policy plays).
Type Declaration
| Name | Type | Defined in |
|---|---|---|
role | string | packages/playerthree/src/host/types.ts:856 |
CreateCommander
type CreateCommander = Omit<CommanderIdentity, "id">;Defined in: packages/playerthree/src/host/types.ts:796
GuardChannel
type GuardChannel =
| "view"
| "observation"
| "matchData"
| "event"
| "report"
| "game_error"
| "lobby";Defined in: packages/playerthree/src/host/types.ts:739
GuardResult
type GuardResult<T> =
| {
json: string;
ok: true;
value: T;
}
| {
ok: false;
};Defined in: packages/playerthree/src/guard.ts:19
Type Parameters
LoadPolicy
type LoadPolicy = (runtime, code, limits, opts?) => Promise<LoadResult>;Defined in: packages/playerthree/src/policy/types.ts:70
Bytes for wasm, text for js. Validates size, compiles, instantiates, checks exports.
Parameters
| Parameter | Type |
|---|---|
runtime | PolicyRuntime |
code | string | Uint8Array |
limits | PolicyLimits |
opts? | LoadOptions |
Returns
Promise<LoadResult>
LoadResult
type LoadResult =
| {
instance: PolicyInstance;
ok: true;
}
| {
error: PolicyError;
ok: false;
};Defined in: packages/playerthree/src/policy/types.ts:56
The result of loading a policy: an instance, or a closed policy error.
PlayerThreeTraceEvent
type PlayerThreeTraceEvent =
| TraceBase & object
| TraceBase & object
| TraceBase & object
| SeatTrace & object
| SeatTrace & object
| SeatTrace & object
| SeatTrace & object
| SeatTrace & object
| SeatTrace & object
| SeatTrace & object
| SeatTrace & object
| SeatTrace & object
| TraceBase & object;Defined in: packages/playerthree/src/host/types.ts:756
Developer-facing trace events (DevTools). Contains only closed-vocabulary game data and own-authored policy text; logs of pool policies (authored by other players) are never included.
PolicyCallOutcome
type PolicyCallOutcome =
| {
ok: true;
value: PolicyCallResult;
}
| {
cpuMs?: number;
error: PolicyError;
logs?: string[];
ms: number;
ok: false;
};Defined in: packages/playerthree/src/policy/types.ts:29
Union Members
Type Literal
{
ok: true;
value: PolicyCallResult;
}Type Literal
{
cpuMs?: number;
error: PolicyError;
logs?: string[];
ms: number;
ok: false;
}cpuMs is present when the sandbox thread answered (not after a watchdog kill or on a dead instance).
PolicyDetail
type PolicyDetail = readonly string[] | "all";Defined in: packages/playerthree/src/policy/types.ts:38
Observation detail a policy declares it reads (JS global detail, wasm custom section playerthree.detail): 'all'
or section names (enum literals, unique). The host resolves it against the game's observationScope.
PoolPublisher
type PoolPublisher =
| {
kind: "commander";
owner: string;
}
| {
kind: "session";
session: string;
team: string;
};Defined in: packages/playerthree/src/host/types.ts:525
Who published a pool entry: an owner's commander, or a team in a session (seat/owner tokens).
ReadinessState
type ReadinessState =
| "ready"
| "online"
| "waiting"
| "absent"
| "stale_policy"
| "policy_failed"
| "consent_required";Defined in: packages/playerthree/src/host/types.ts:190
online: an agent seat whose agent is present but has not marked itself ready for the pre-match seat (ready).
ReplayEntry
type ReplayEntry =
| [tick: number, team: string, role: string, op: "intent", intent: unknown, source: Exclude<IntentSource, "owner">]
| [tick: number, team: string, role: string, op: "intent", intent: unknown, source: "owner", ownerRoles: readonly string[]]
| [tick: number, team: string, role: string, op: "seat", controller: Controller, mandate: Mandate]
| [tick: number, team: string, role: string, op: "pause", reason: SeatPause["reason"]]
| [tick: number, team: string, role: string, op: "resume", reason: ResumeReason]
| [tick: number, team: string, role: string, op: "forfeit"]
| [tick: number, team: string, role: string, op: "signal", intent: unknown];Defined in: packages/playerthree/src/host/types.ts:689
One recorded entry at tick, in recording order: an intent that reached adapter.apply or a setSeatInfo push
(controller/mandate change), both applied before step() of tick; a seat starting/stopping to hold a pausable
session still (pause/resume: no effect on the simulation, which does not step while paused); or a team's
forfeit (PlayerThreeMatch.forfeit, applied through adapter.forfeit before step() of tick). A forfeit is team-level:
its role is always the manifest's first role. A signal entry is an accepted signal / signal_update intent (games
declaring signals): it changes the team's signal board, never the simulation.
Owner intent entries always carry a seventh field, the verified owner-role scope (the seat's team roles its owner holds
as a human, else only the seat's role); every other intent source records exactly six fields.
SeatKind
type SeatKind = "human" | "agent" | "policy" | "bot" | "none";Defined in: packages/playerthree/src/host/types.ts:169
StoredPolicyArtifact
type StoredPolicyArtifact = Omit<PolicyArtifact, "include"> & object;Defined in: packages/playerthree/src/host/types.ts:505
Policy provenance is host-authored, never accepted from a deploy request. The code is the composed source (no
include); artifactHash is SHA-256 hex of its module bytes (policyArtifactHash).
Type Declaration
| Name | Type | Defined in |
|---|---|---|
artifactHash | string | packages/playerthree/src/host/types.ts:505 |
surfaceHash | string | packages/playerthree/src/host/types.ts:505 |
TraceSource
type TraceSource = "owner" | "agent" | "policy" | "bot" | "stream";Defined in: packages/playerthree/src/host/types.ts:737
Who produced an intent / received an observation.
Variables
COMMANDER_LOG_FORMAT
const COMMANDER_LOG_FORMAT: "playerthree.commanderLog";Defined in: packages/playerthree/src/commander-log.ts:11
Commander match log (playerthree.commanderLog/1): one append-only, host-observed entry per match × named commander,
hash-chained per commander and signed by the host (Ed25519). Types only (browser-safe); hashing, signing and
verification live in commander-log-integrity.ts.
Privacy: owner-identifying and owner-declared facts live in a separate sealed part that the entry commits to only
by a salted SHA-256 (entry.sealed). A deletion tombstone drops the sealed part; the signed entry, and so the chain
and every opponent's rating input, stays verifiable.
COMMANDER_LOG_VERSION
const COMMANDER_LOG_VERSION: 1;Defined in: packages/playerthree/src/commander-log.ts:12
SURFACE_JSON_PREFIX
const SURFACE_JSON_PREFIX: "Surface JSON: " = 'Surface JSON: ';Defined in: packages/playerthree/src/topics.ts:20
Prefix of the one machine-readable line in topic modes:
{ control, opponents, errors, eventKinds, intentRoles } as JSON (what tools such as playerthree audit read).
UNRATED
const UNRATED: Readonly<CommanderLogVerdict>;Defined in: packages/playerthree/src/commander-log.ts:210
The default verdict (no game hook): unrated. Consumers copy it.
Functions
briefingTopics()
function briefingTopics(manifest, ctx?): BriefingTopic[];Defined in: packages/playerthree/src/topics.ts:543
Every topic in index order: game topics (manifest order), then generated ones. With ctx.matchData (in a match)
match-data is the seat's live bootstrap; otherwise its field docs.
Parameters
| Parameter | Type |
|---|---|
manifest | AnyManifest |
ctx? | TopicContext |
Returns
buildBriefing()
function buildBriefing(
manifest,
seat,
settings?,
sides?
): Briefing;Defined in: packages/playerthree/src/briefing.ts:72
Core briefing for a seat in a match, or (without team) for a commander in the lobby. sides: the match's teams
and alliances (default: every manifest team, none allied). Topics are served separately (topicPage).
Parameters
| Parameter | Type |
|---|---|
manifest | AnyManifest |
seat | { role: string; team?: string; } |
seat.role | string |
seat.team? | string |
settings? | { mandate?: Mandate; scopes?: ("act" | "policy" | "practice" | "publish" | "say")[]; } |
settings.mandate? | Mandate |
settings.scopes? | ("act" | "policy" | "practice" | "publish" | "say")[] |
sides? | { alliances?: Readonly<Record<string, readonly string[]>>; teams: readonly string[]; } |
sides.alliances? | Readonly<Record<string, readonly string[]>> |
sides.teams | readonly string[] |
Returns
canonicalJson()
function canonicalJson(value): string;Defined in: packages/playerthree/src/briefing.ts:14
JSON with recursively sorted keys; undefined members dropped. Stable across engines and insertion order.
Parameters
| Parameter | Type |
|---|---|
value | unknown |
Returns
string
compareLogEntries()
function compareLogEntries(a, b): number;Defined in: packages/playerthree/src/commander-log.ts:213
Order of deterministic recomputes: (endedAt, matchId, commander).
Parameters
| Parameter | Type |
|---|---|
a | CommanderLogEntry |
b | CommanderLogEntry |
Returns
number
composePolicy()
function composePolicy(
skills,
code,
include?
): string;Defined in: packages/playerthree/src/skill.ts:118
Compose a JS policy source from served skill files: the included files' contents ("<skill>/<path>", .js only,
≤ MAX_POLICY_INCLUDES, no duplicates) joined by \n, then \n, then code. Without includes, code unchanged.
Unknown or invalid entries → PlayerThreeError('invalid').
Parameters
| Parameter | Type | Default value |
|---|---|---|
skills | readonly SkillDef[] | undefined |
code | string | undefined |
include? | readonly string[] | [] |
Returns
string
createGuard()
function createGuard(opts?): OutboundGuard;Defined in: packages/playerthree/src/guard.ts:52
A new outbound guard with its own drop counters.
Parameters
| Parameter | Type |
|---|---|
opts? | GuardOptions |
Returns
mergeMatchOptions()
function mergeMatchOptions(
schema,
defaults,
overrides
): Record<string, unknown> | undefined;Defined in: packages/playerthree/src/host/pipeline.ts:223
Host defaults with later options on top: objects merge recursively unless their schema declares
merge:'replace'; arrays/scalars replace. Inputs and the merged result must conform to the options schema.
Returns fresh objects (inputs are never mutated); undefined when both are absent.
Parameters
| Parameter | Type |
|---|---|
schema | Schema | undefined |
defaults | Record<string, unknown> | undefined |
overrides | Record<string, unknown> | undefined |
Returns
Record<string, unknown> | undefined
referenceSkill()
function referenceSkill(manifest): SkillDef;Defined in: packages/playerthree/src/skill.ts:71
The generated reference skill, named <game id>-reference: SKILL.md (purpose, reading order, one-line file index),
RULES.md (the core rules) and one file per briefing topic page (<topic>.md, later pages <topic>.<n>.md).
Parameters
| Parameter | Type |
|---|---|
manifest | AnyManifest |
Returns
servedSkills()
function servedSkills(manifest): SkillDef[];Defined in: packages/playerthree/src/briefing.ts:25
Every skill: game strategy, generated reference, and mode-aware SDK defaults.
Parameters
| Parameter | Type |
|---|---|
manifest | AnyManifest |
Returns
SkillDef[]
surfaceHash()
function surfaceHash(manifest): string;Defined in: packages/playerthree/src/briefing.ts:36
sha256 (hex) over the canonical JSON of the full agent-facing surface: control-plane version, the manifest (schemas, docs, limits, developer skills), the MCP tool definitions derived from it, and all generated skills. Players pin it; any change to what an agent can see or call changes the hash.
Parameters
| Parameter | Type |
|---|---|
manifest | AnyManifest |
Returns
string
topicIndex()
function topicIndex(manifest): string[];Defined in: packages/playerthree/src/topics.ts:345
The core briefing's topic index: game topics (name — summary), then one line per generated family.
Parameters
| Parameter | Type |
|---|---|
manifest | AnyManifest |
Returns
string[]
topicPage()
function topicPage(
manifest,
topic,
page?,
ctx?
): TopicPage;Defined in: packages/playerthree/src/topics.ts:551
One page of a topic; unknown topic or page → PlayerThreeError('invalid').
Parameters
| Parameter | Type | Default value |
|---|---|---|
manifest | AnyManifest | undefined |
topic | string | undefined |
page? | number | 1 |
ctx? | TopicContext | undefined |
Returns
References
AnyManifest
Re-exports AnyManifest
ApplyResult
Re-exports ApplyResult
applyView
Re-exports applyView
Approval
Re-exports Approval
ApprovalRequest
Re-exports ApprovalRequest
BoolS
Re-exports BoolS
BotCommander
Re-exports BotCommander
Briefing
Re-exports Briefing
ChatMode
Re-exports ChatMode
checkSignals
Re-exports checkSignals
ClientMsg
Re-exports ClientMsg
codePointLength
Re-exports codePointLength
CONTROL_PLANE_VERSION
Re-exports CONTROL_PLANE_VERSION
Controller
Re-exports Controller
CONTROLLERS
Re-exports CONTROLLERS
ControlMethod
Re-exports ControlMethod
ControlModes
Re-exports ControlModes
defaultScopes
Re-exports defaultScopes
defineManifest
Re-exports defineManifest
DeployResult
Re-exports DeployResult
DetailRequest
Re-exports DetailRequest
DirectiveOf
Re-exports DirectiveOf
DOC_MAX
Re-exports DOC_MAX
emptySeatSignals
Re-exports emptySeatSignals
EnumS
Re-exports EnumS
EventOf
Re-exports EventOf
Fields
Re-exports Fields
FinalOutcome
Re-exports FinalOutcome
GameAdapter
Re-exports GameAdapter
GameDefinition
Re-exports GameDefinition
GameErrorOf
Re-exports GameErrorOf
GameManifest
Re-exports GameManifest
GameMetricRecorder
Re-exports GameMetricRecorder
GameMetrics
Re-exports GameMetrics
GameObservationOf
Re-exports GameObservationOf
GameViewOf
Re-exports GameViewOf
GENERATED_TOPIC_ROOTS
Re-exports GENERATED_TOPIC_ROOTS
IdS
Re-exports IdS
Infer
Re-exports Infer
INTENT_SOURCES
Re-exports INTENT_SOURCES
IntentAck
Re-exports IntentAck
IntentContext
Re-exports IntentContext
IntentDef
Re-exports IntentDef
IntentMode
Re-exports IntentMode
IntentOf
Re-exports IntentOf
intentSchema
Re-exports intentSchema
IntentSource
Re-exports IntentSource
IntS
Re-exports IntS
IntsS
Re-exports IntsS
isSignalIntent
Re-exports isSignalIntent
JsonSchema
Re-exports JsonSchema
LimitsOf
Re-exports LimitsOf
ListS
Re-exports ListS
LOBBY_INSTRUCTIONS
Re-exports LOBBY_INSTRUCTIONS
LobbyStart
Re-exports LobbyStart
LobbyState
Re-exports LobbyState
Mandate
Re-exports Mandate
MandateOf
Re-exports MandateOf
MATCH_DATA_MAX_BYTES
Re-exports MATCH_DATA_MAX_BYTES
MATCH_INSTRUCTION
Re-exports MATCH_INSTRUCTION
MatchDataOf
Re-exports MatchDataOf
MatchOptionsOf
Re-exports MatchOptionsOf
MatchReceipt
Re-exports MatchReceipt
MatchSides
Re-exports MatchSides
MatchWait
Re-exports MatchWait
MAX_MESSAGE_BYTES
Re-exports MAX_MESSAGE_BYTES
MAX_POLICY_INCLUDES
Re-exports MAX_POLICY_INCLUDES
MAX_SAY_CHARS
Re-exports MAX_SAY_CHARS
MAX_TELL_CHARS
Re-exports MAX_TELL_CHARS
MCP_TOOL_NAMES
Re-exports MCP_TOOL_NAMES
METHOD_MODE
Re-exports METHOD_MODE
METHOD_SCOPE
Re-exports METHOD_SCOPE
MSG
Re-exports MSG
NumS
Re-exports NumS
ObjS
Re-exports ObjS
ObservationOf
Re-exports ObservationOf
ObservationScope
Re-exports ObservationScope
observationSections
Re-exports observationSections
ObserverAgentCard
Re-exports ObserverAgentCard
ObserverCommentary
Re-exports ObserverCommentary
ObserverFrame
Re-exports ObserverFrame
ObserverGrant
Re-exports ObserverGrant
ObserverMessage
Re-exports ObserverMessage
ObserverRequest
Re-exports ObserverRequest
OpponentOf
Re-exports OpponentOf
OptS
Re-exports OptS
Outcome
Re-exports Outcome
OwnerMessage
Re-exports OwnerMessage
PauseInfo
Re-exports PauseInfo
PauseMode
Re-exports PauseMode
POLICY_RUNTIMES
Re-exports POLICY_RUNTIMES
PolicyArtifact
Re-exports PolicyArtifact
PolicyError
Re-exports PolicyError
PolicyErrorCode
Re-exports PolicyErrorCode
PolicyLimits
Re-exports PolicyLimits
PolicyRuntime
Re-exports PolicyRuntime
PolicyStats
Re-exports PolicyStats
PolicyStatus
Re-exports PolicyStatus
PoolMode
Re-exports PoolMode
PracticeLimits
Re-exports PracticeLimits
PracticeRequest
Re-exports PracticeRequest
PracticeResult
Re-exports PracticeResult
Principal
Re-exports Principal
PROTOCOL_VERSION
Re-exports PROTOCOL_VERSION
PublishResult
Re-exports PublishResult
ReadyResult
Re-exports ReadyResult
ReportOf
Re-exports ReportOf
resolveDetail
Re-exports resolveDetail
RESULT_TEXT_MAX
Re-exports RESULT_TEXT_MAX
ResumeReason
Re-exports ResumeReason
ROLE_DOC_MAX
Re-exports ROLE_DOC_MAX
RoleOf
Re-exports RoleOf
Said
Re-exports Said
SayResult
Re-exports SayResult
Schema
Re-exports Schema
SchemaErrorCode
Re-exports SchemaErrorCode
SchemaPath
Re-exports SchemaPath
Scope
Re-exports Scope
SCOPES
Re-exports SCOPES
Seat
Re-exports Seat
SeatControl
Re-exports SeatControl
SeatPause
Re-exports SeatPause
SeatSignals
Re-exports SeatSignals
SeatStatus
Re-exports SeatStatus
SectionOf
Re-exports SectionOf
SequenceMode
Re-exports SequenceMode
SequenceRequest
Re-exports SequenceRequest
SequenceResult
Re-exports SequenceResult
ServerErrorCode
Re-exports ServerErrorCode
ServerMsg
Re-exports ServerMsg
SessionPhase
Re-exports SessionPhase
SIGNAL_CODES
Re-exports SIGNAL_CODES
SIGNAL_ENTRY_FIELDS
Re-exports SIGNAL_ENTRY_FIELDS
SIGNAL_ID_PREFIX
Re-exports SIGNAL_ID_PREFIX
SIGNAL_INTENT
Re-exports SIGNAL_INTENT
SIGNAL_LIMIT_BOUNDS
Re-exports SIGNAL_LIMIT_BOUNDS
SIGNAL_STATES
Re-exports SIGNAL_STATES
SIGNAL_TEAM
Re-exports SIGNAL_TEAM
SIGNAL_UPDATE_INTENT
Re-exports SIGNAL_UPDATE_INTENT
SIGNAL_UPDATES
Re-exports SIGNAL_UPDATES
SignalAck
Re-exports SignalAck
SignalBoard
Re-exports SignalBoard
SignalCode
Re-exports SignalCode
SignalEntry
Re-exports SignalEntry
SignalEntrySchema
Re-exports SignalEntrySchema
SignalKindDef
Re-exports SignalKindDef
SignalLimits
Re-exports SignalLimits
SIGNALS_FIELD
Re-exports SIGNALS_FIELD
signalSchemas
Re-exports signalSchemas
SignalSchemas
Re-exports SignalSchemas
SignalSkill
Re-exports SignalSkill
SignalState
Re-exports SignalState
SignalUpdate
Re-exports SignalUpdate
SignalVocabulary
Re-exports SignalVocabulary
SKILL_PAGE_MAX
Re-exports SKILL_PAGE_MAX
SKILL_PATH_PATTERN
Re-exports SKILL_PATH_PATTERN
SkillDef
Re-exports SkillDef
SkillPage
Re-exports SkillPage
StreamMode
Re-exports StreamMode
StrS
Re-exports StrS
t
Re-exports t
TeamOf
Re-exports TeamOf
toJsonSchema
Re-exports toJsonSchema
TOKEN_RE
Re-exports TOKEN_RE
TOPIC_INDEX_MAX
Re-exports TOPIC_INDEX_MAX
TOPIC_SUMMARY_MAX
Re-exports TOPIC_SUMMARY_MAX
TOPIC_TEXT_MAX
Re-exports TOPIC_TEXT_MAX
TopicDef
Re-exports TopicDef
TopicPage
Re-exports TopicPage
UnionS
Re-exports UnionS
validate
Re-exports validate
ValidateResult
Re-exports ValidateResult
ViewMessage
Re-exports ViewMessage
ViewOf
Re-exports ViewOf
ViewState
Re-exports ViewState
WaitRequest
Re-exports WaitRequest
WaitResult
Re-exports WaitResult
WaitWake
Re-exports WaitWake
WatchMsg
Re-exports WatchMsg
WhenAbsentOf
Re-exports WhenAbsentOf
withSignals
Re-exports withSignals
