Skip to content

@my-swu/simulator-client


@my-swu/simulator-client / GameState

Interface: GameState ​

Defined in: packages/ts-sdk/src/generated/types/common.ts:2414

Complete public projection of one match.

Besides riding the wire, this type is embedded in persisted lobby and tournament records (per-player startedAccess.access.snapshot), so rows in storage keep whatever shape they were stored with. A field added without #[serde(default)] makes every older stored record fail strict decode; either keep the default or extend the restoration tables in swu-server/src/legacy_snapshots.rs in the same change.

Example:

ts
import { createSimulatorClient } from '@my-swu/simulator-client'

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')

console.log(matchSnapshot)

Properties ​

actionAbilities ​

Example:

ts
import { createSimulatorClient } from '@my-swu/simulator-client'

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')

const { actionAbilities } = matchSnapshot

console.log(actionAbilities)

actionAbilities: ActionAbilityView[]

Defined in: packages/ts-sdk/src/generated/types/common.ts:2415


activeEffects ​

Example:

ts
import { createSimulatorClient } from '@my-swu/simulator-client'

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')

const { activeEffects } = matchSnapshot

console.log(activeEffects)

activeEffects: ActiveEffectView[]

Defined in: packages/ts-sdk/src/generated/types/common.ts:2419

Engine-authoritative outstanding public effects that are active now.


activePlayer? ​

Example:

ts
import { createSimulatorClient } from '@my-swu/simulator-client'

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')

const { activePlayer } = matchSnapshot

console.log(activePlayer)

optional activePlayer?: Seat | null

Defined in: packages/ts-sdk/src/generated/types/common.ts:2420


availableAttacks ​

Example:

ts
import { createSimulatorClient } from '@my-swu/simulator-client'

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')

const { availableAttacks } = matchSnapshot

console.log(availableAttacks)

availableAttacks: AvailableAttackView[]

Defined in: packages/ts-sdk/src/generated/types/common.ts:2421


availableCounters ​

Example:

ts
import { createSimulatorClient } from '@my-swu/simulator-client'

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')

const { availableCounters } = matchSnapshot

console.log(availableCounters)

availableCounters: TwinSunsCounter[]

Defined in: packages/ts-sdk/src/generated/types/common.ts:2422


availableLeaderDeploys ​

Example:

ts
import { createSimulatorClient } from '@my-swu/simulator-client'

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')

const { availableLeaderDeploys } = matchSnapshot

console.log(availableLeaderDeploys)

availableLeaderDeploys: LeaderDeployActionView[]

Defined in: packages/ts-sdk/src/generated/types/common.ts:2423


consecutivePasses ​

Example:

ts
import { createSimulatorClient } from '@my-swu/simulator-client'

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')

const { consecutivePasses } = matchSnapshot

console.log(consecutivePasses)

consecutivePasses: number

Defined in: packages/ts-sdk/src/generated/types/common.ts:2424


currentAttack ​

Example:

ts
import { createSimulatorClient } from '@my-swu/simulator-client'

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')

const { currentAttack } = matchSnapshot

console.log(currentAttack)

currentAttack: CurrentAttackStateView

Defined in: packages/ts-sdk/src/generated/types/common.ts:2425


delayedEffects ​

Example:

ts
import { createSimulatorClient } from '@my-swu/simulator-client'

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')

const { delayedEffects } = matchSnapshot

console.log(delayedEffects)

delayedEffects: DelayedEffectView[]

Defined in: packages/ts-sdk/src/generated/types/common.ts:2429

Engine-authoritative outstanding public effects waiting on later timing.


effectResolutionDraft? ​

Example:

ts
import { createSimulatorClient } from '@my-swu/simulator-client'

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')

const { effectResolutionDraft } = matchSnapshot

console.log(effectResolutionDraft)

optional effectResolutionDraft?: EffectResolutionDraftView | null

Defined in: packages/ts-sdk/src/generated/types/common.ts:2433

Viewer-owned effect inputs awaiting atomic commit.


eventsApplied ​

Example:

ts
import { createSimulatorClient } from '@my-swu/simulator-client'

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')

const { eventsApplied } = matchSnapshot

console.log(eventsApplied)

eventsApplied: number

Defined in: packages/ts-sdk/src/generated/types/common.ts:2434


format ​

Example:

ts
import { createSimulatorClient } from '@my-swu/simulator-client'

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')

const { format } = matchSnapshot

console.log(format)

format: MatchFormat

Defined in: packages/ts-sdk/src/generated/types/common.ts:2438

Match format requested at creation time.


gameTimer? ​

Example:

ts
import { createSimulatorClient } from '@my-swu/simulator-client'

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')

const { gameTimer } = matchSnapshot

console.log(gameTimer)

optional gameTimer?: GameTimerStateView | null

Defined in: packages/ts-sdk/src/generated/types/common.ts:2439


groundArena ​

Example:

ts
import { createSimulatorClient } from '@my-swu/simulator-client'

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')

const { groundArena } = matchSnapshot

console.log(groundArena)

groundArena: UnitStateView[]

Defined in: packages/ts-sdk/src/generated/types/common.ts:2440


initiative ​

Example:

ts
import { createSimulatorClient } from '@my-swu/simulator-client'

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')

const { initiative } = matchSnapshot

console.log(initiative)

initiative: InitiativeState

Defined in: packages/ts-sdk/src/generated/types/common.ts:2441


leaderAction? ​

Example:

ts
import { createSimulatorClient } from '@my-swu/simulator-client'

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')

const { leaderAction } = matchSnapshot

console.log(leaderAction)

optional leaderAction?: LeaderActionView | null

Defined in: packages/ts-sdk/src/generated/types/common.ts:2442


matchId ​

Example:

ts
import { createSimulatorClient } from '@my-swu/simulator-client'

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')

const { matchId } = matchSnapshot

console.log(matchId)

matchId: string

Defined in: packages/ts-sdk/src/generated/types/common.ts:2443


pendingAbilities ​

Example:

ts
import { createSimulatorClient } from '@my-swu/simulator-client'

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')

const { pendingAbilities } = matchSnapshot

console.log(pendingAbilities)

pendingAbilities: PendingAbilityView[]

Defined in: packages/ts-sdk/src/generated/types/common.ts:2453

Abilities awaiting input, in presentation order only.

Index 0 has no semantic meaning: it is whichever ability the engine collected first in the current simultaneous batch. Clients that need a specific ability must match on its identity (id / sourceCardId / sourceUnitId / window / clauseId / family), never on position.


pendingChoice? ​

Example:

ts
import { createSimulatorClient } from '@my-swu/simulator-client'

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')

const { pendingChoice } = matchSnapshot

console.log(pendingChoice)

optional pendingChoice?: PendingChoiceView | null

Defined in: packages/ts-sdk/src/generated/types/common.ts:2457

The one prompt payload the viewer is being asked for, if any.


pendingUndo? ​

Example:

ts
import { createSimulatorClient } from '@my-swu/simulator-client'

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')

const { pendingUndo } = matchSnapshot

console.log(pendingUndo)

optional pendingUndo?: PendingUndoRequest | null

Defined in: packages/ts-sdk/src/generated/types/common.ts:2463

Sensitive multiplayer undo waiting for approval from the other human seats. Fully public: every viewer (including spectators) sees the same request, only the prompt actions differ per seat client-side.


phase ​

Example:

ts
import { createSimulatorClient } from '@my-swu/simulator-client'

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')

const { phase } = matchSnapshot

console.log(phase)

phase: MatchPhase

Defined in: packages/ts-sdk/src/generated/types/common.ts:2464


playActions ​

Example:

ts
import { createSimulatorClient } from '@my-swu/simulator-client'

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')

const { playActions } = matchSnapshot

console.log(playActions)

playActions: PlayActionView[]

Defined in: packages/ts-sdk/src/generated/types/common.ts:2465


playerCount ​

Example:

ts
import { createSimulatorClient } from '@my-swu/simulator-client'

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')

const { playerCount } = matchSnapshot

console.log(playerCount)

playerCount: number

Defined in: packages/ts-sdk/src/generated/types/common.ts:2469

Configured number of seats in clockwise order.


players ​

Example:

ts
import { createSimulatorClient } from '@my-swu/simulator-client'

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')

const { players } = matchSnapshot

console.log(players)

players: SeatState[]

Defined in: packages/ts-sdk/src/generated/types/common.ts:2470


playground? ​

Example:

ts
import { createSimulatorClient } from '@my-swu/simulator-client'

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')

const { playground } = matchSnapshot

console.log(playground)

optional playground?: boolean

Defined in: packages/ts-sdk/src/generated/types/common.ts:2474

Whether this snapshot belongs to a server-authorized Playground match.


playgroundActionAbilities? ​

Example:

ts
import { createSimulatorClient } from '@my-swu/simulator-client'

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')

const { playgroundActionAbilities } = matchSnapshot

console.log(playgroundActionAbilities)

optional playgroundActionAbilities?: PlaygroundActionAbilityView[]

Defined in: packages/ts-sdk/src/generated/types/common.ts:2479

Host-only Playground ability projection. Empty for normal matches and while a resolution owns the command boundary.


playgroundDeckCardIds? ​

Example:

ts
import { createSimulatorClient } from '@my-swu/simulator-client'

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')

const { playgroundDeckCardIds } = matchSnapshot

console.log(playgroundDeckCardIds)

optional playgroundDeckCardIds?: number[]

Defined in: packages/ts-sdk/src/generated/types/common.ts:2483

Printed cards supplied by every configured Playground deck.


prompt ​

Example:

ts
import { createSimulatorClient } from '@my-swu/simulator-client'

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')

const { prompt } = matchSnapshot

console.log(prompt)

prompt: PromptState

Defined in: packages/ts-sdk/src/generated/types/common.ts:2484


rejectedPlayReasons ​

Example:

ts
import { createSimulatorClient } from '@my-swu/simulator-client'

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')

const { rejectedPlayReasons } = matchSnapshot

console.log(rejectedPlayReasons)

rejectedPlayReasons: RejectedPlayView[]

Defined in: packages/ts-sdk/src/generated/types/common.ts:2485


result? ​

Example:

ts
import { createSimulatorClient } from '@my-swu/simulator-client'

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')

const { result } = matchSnapshot

console.log(result)

optional result?: MatchResult | null

Defined in: packages/ts-sdk/src/generated/types/common.ts:2486


roundNumber ​

Example:

ts
import { createSimulatorClient } from '@my-swu/simulator-client'

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')

const { roundNumber } = matchSnapshot

console.log(roundNumber)

roundNumber: number

Defined in: packages/ts-sdk/src/generated/types/common.ts:2487


series ​

Example:

ts
import { createSimulatorClient } from '@my-swu/simulator-client'

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')

const { series } = matchSnapshot

console.log(series)

series: MatchSeriesView

Defined in: packages/ts-sdk/src/generated/types/common.ts:2491

Multi-game and format-event state for this match.


spaceArena ​

Example:

ts
import { createSimulatorClient } from '@my-swu/simulator-client'

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')

const { spaceArena } = matchSnapshot

console.log(spaceArena)

spaceArena: UnitStateView[]

Defined in: packages/ts-sdk/src/generated/types/common.ts:2492


status ​

Example:

ts
import { createSimulatorClient } from '@my-swu/simulator-client'

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')

const { status: healthStatus } = matchSnapshot

console.log(healthStatus)

status: MatchStatus

Defined in: packages/ts-sdk/src/generated/types/common.ts:2493


trilogyFormat? ​

Example:

ts
import { createSimulatorClient } from '@my-swu/simulator-client'

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')

const { trilogyFormat } = matchSnapshot

console.log(trilogyFormat)

optional trilogyFormat?: ConstructedFormat | null

Defined in: packages/ts-sdk/src/generated/types/common.ts:2497

Constructed legality profile selected for Trilogy deck validation.


turnPlayer ​

Example:

ts
import { createSimulatorClient } from '@my-swu/simulator-client'

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')

const { turnPlayer } = matchSnapshot

console.log(turnPlayer)

turnPlayer: NullableSeatView

Defined in: packages/ts-sdk/src/generated/types/common.ts:2507

The seat whose action-phase turn is currently in progress.

Use this — not active_player — to answer "whose turn is it". The engine reassigns active_player to whoever must resolve a forced prompt (e.g. the opponent distributing indirect damage from your card), but the turn itself stays with the player who began it. None outside the action phase (lobby / setup / regroup / once the match is decided).


twinSunsCounters? ​

Example:

ts
import { createSimulatorClient } from '@my-swu/simulator-client'

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')

const { twinSunsCounters } = matchSnapshot

console.log(twinSunsCounters)

optional twinSunsCounters?: TwinSunsCountersView | null

Defined in: packages/ts-sdk/src/generated/types/common.ts:2508


undoDeclinedRequesters? ​

Example:

ts
import { createSimulatorClient } from '@my-swu/simulator-client'

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')

const { undoDeclinedRequesters } = matchSnapshot

console.log(undoDeclinedRequesters)

optional undoDeclinedRequesters?: Seat[]

Defined in: packages/ts-sdk/src/generated/types/common.ts:2514

Seats whose undo request was declined during the current turn; those seats cannot request an undo again until the next turn begins. Fully public like the pending request itself.


winner? ​

Example:

ts
import { createSimulatorClient } from '@my-swu/simulator-client'

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')

const { winner } = matchSnapshot

console.log(winner)

optional winner?: Seat | null

Defined in: packages/ts-sdk/src/generated/types/common.ts:2515


winners ​

Example:

ts
import { createSimulatorClient } from '@my-swu/simulator-client'

// Point this at the simulator HTTP origin for /health and /api routes.
const simulatorClient = createSimulatorClient({
  baseUrl: 'http://127.0.0.1:4000',
})

// Public match fetch returns the latest snapshot projection.
const matchSnapshot = await simulatorClient.matches.get('match_123')

const { winners } = matchSnapshot

console.log(winners)

winners: Seat[]

Defined in: packages/ts-sdk/src/generated/types/common.ts:2516

Released under the MIT License.