Intelligence · interface

DecisionChannel

How a decision crosses. The consumer's, because packing and transport are theirs.

Explained in Agents and behaviour.

interface DecisionChannel
import type { DecisionChannel } from '@driftengine/ai';

In depth

A command is a tool id, structured arguments and two tick numbers. It is not a simulation input: inputLog.ts is fixed-width per participant per tick and refuses variable-length payloads by design, and an agent's decision is exactly the shape it refuses. So this rides whatever reliable channel the consumer already has.

Methods

replicateDecision

replicateDecision(command: AiCommand): void

Authority side. Called once per accepted command, never for a floor intent.

ParameterTypeDescription
commandAiCommand

drain

drain(into: (command: AiCommand) => void): number

Participant side. Hand over everything that has arrived since the last call.

ParameterTypeDescription
into(command: AiCommand) => void
More

Returns how many were delivered. Draining rather than a callback registration so the consumer decides when decisions enter the simulation, which on a fixed step must be at a tick boundary.