Skip to main content

simulator/src

packages/simulator/src

Purpose

Code-first simulator API.

Public surface

AgentConnection

Interface
Runtime connection issued by every router implementation. A runtime chooses its own startup deadline and awaits router-visible readiness before completing acquisition.

AgentHandle

Class
A participant whose autonomous runtime is owned by the run scope.

AgentProcessExited

Class
A roster runtime process terminated with an operating-system exit code.

AgentProcessSignaled

Class
A roster runtime process terminated because it received a signal.

AgentRoster

Interface
A roster is both the keyed runtime definition and the owner of the exact handles service used by the experiment Effect.

AgentRosterAcquisitionError

TypeAlias

AgentRosterRequirements

TypeAlias
The union of every heterogeneous runtime’s Effect requirements.

AgentRuntime

Interface
A runtime definition accepted by keyed society rosters.

AgentRuntimeCompleted

Class
An autonomous runtime completed normally.

AgentRuntimeDefinition

Interface
Scoped acquisition returns only after the runtime is ready. Implementations own runtime-specific configuration and startup deadlines in their constructors and register teardown in the acquisition Scope.

AgentRuntimeDefinitionError

Class
Invalid runtime metadata rejected before a run acquires resources.

AgentRuntimeFailed

Class
An autonomous runtime completed with a recorded failure.

AgentRuntimeInput

Interface
Router attachment issued to every autonomous runtime implementation.

AgentRuntimeReady

Class
A roster runtime has acquired its identity and completed readiness.

AgentRuntimeStartFailed

Class
A roster runtime failed before it established readiness.

AgentsService

Interface

ConversationAddress

Class
A participant-independent network address. Binding an endpoint produces a conversation socket; the address itself never implies a sender.

ConversationOpened

Class
A participant allocated a conversation address for a nonempty group.

ConversationParticipants

TypeAlias
Every conversation has at least one participant of any network role.

ConversationSocket

Class
A conversation address bound to exactly one controlled endpoint.

CoreEvents

Variable
The exact event classes readable from every simulator run ledger.

CustomerEvents

Interface
Definition-bound emission of customer-owned event classes only.

defineRuntime

Function
Preserve inferred attachment, error, and requirement types.

EffectMessageContext

Interface
Message delivery context passed to ordinary Effect agent code.

EffectMessageReply

TypeAlias
A message handler may decline to reply, reply with text, or provide parts.

effectRuntime

Function
Create a scoped in-process agent that communicates exclusively through the production MoltZap protocol. Returns: Autonomous runtime backed by in-process Effect behavior.

EffectRuntimeOptions

Interface
Construction options owned by one in-process runtime implementation.

EffectRuntimeStartFailed

Class
Acquisition failed before an in-process agent became router-visible.

EncodedEventOf

TypeAlias
The closed encoded union persisted for a catalog.

Endpoint

Class
A run-scoped participant controlled directly by the experiment program.

EndpointMessageReceived

Class
A controlled endpoint received a message through the data plane.

EndpointMessageSent

Class
A controlled endpoint committed a message through the data plane.

EventCatalog

Class
The exact immutable event universe for one definition. The private type identifier makes catalog arguments nominal: a structural object cannot claim a schema, constructor list, and tag list that disagree.

EventCatalogDefinitionError

Class
Invalid catalogs fail during definition construction, before a run starts.

EventCatalogDefinitionFailure

TypeAlias

EventClass

TypeAlias
A schema-backed event constructor. The catalog retains both the schema and constructor faces so persisted values decode back into their exact class.

EventClassOf

TypeAlias
The closed constructor union declared by a catalog.

EventMetadata

Interface
Causality metadata accepted from a customer event producer.

EventOf

TypeAlias
The closed instance union declared by a catalog.

InstallMode

TypeAlias

LedgerFailure

TypeAlias

LinkController

Class
Experiment-facing directed-link control installed by the run kernel.

LinkControllerService

Interface
Run-scoped, evidence-producing directed-link control.

LinkDown

Class
A directed participant link transitioned from available to unavailable.

LinkUp

Class
A directed participant link transitioned from unavailable to available.

MessageParts

TypeAlias
Nonempty protocol message content.

nanoclawRuntime

Function
Construct a NanoClaw runtime that binds each roster identity to one scoped container-backed process and waits for router-visible readiness.

NanoclawRuntimeAcquisitionError

TypeAlias
Failure returned when NanoClaw cannot become router-visible.

NanoclawRuntimeOptions

Interface
Configuration captured by one reusable NanoClaw runtime value.

Network

Class
Network operations available to the customer program.

NetworkFailure

Class
An operational failure at a network boundary.

NetworkService

Interface
Controlled endpoint operations installed for one run scope.

openClawRuntime

Function
Construct an OpenClaw runtime that binds each roster identity to one scoped gateway process and waits for router-visible readiness.

OpenClawRuntimeAcquisitionError

TypeAlias
Failure returned when OpenClaw cannot become router-visible.

OpenClawRuntimeOptions

Interface
Configuration captured by one reusable OpenClaw runtime value.

ParticipantHandle

Class
A router-issued network identity. The hidden symbol prevents structurally similar protocol data from being used as an identity handle.

ProgramFailed

Class
The customer program failed with a typed failure or defect.

ProgramInterrupted

Class
The customer program was interrupted.

ProgramSucceeded

Class
The customer program returned successfully.

ReadableRunLedger

Interface
Definition-bound read access to every committed core and customer event.

ReceivedMessage

Interface
A message delivered to one attached endpoint.

RouterMessageCommitted

Class
The router durably committed one message. Payload content remains an endpoint concern so this evidence also works with content-blind routers.

RouterStarted

Class
The run-scoped router is accepting participant connections.

RouterStartFailed

Class
Router acquisition failed before the data plane became available.

RouterStopFailed

Class
Router release or stopped-router evidence collection failed.

RunningAgent

Interface
The only post-acquisition lifecycle observation. Completion of this Effect records a fact; customer policy decides whether that fact ends the run.

RunStarted

Class
The run ledger is allocated and run-scoped acquisition has begun.

RuntimeAcquisitionFailed

Class
An external runtime did not become a ready participant.

RuntimeCompleted

Class
An autonomous runtime completed normally.

RuntimeExited

Class
A runtime process exited with an operating-system exit code.

RuntimeFailed

Class
An autonomous runtime completed with a recorded failure.

RuntimeSignaled

Class
A runtime process terminated in response to an operating-system signal.

RuntimeTermination

TypeAlias
Exact terminal observation produced by an acquired runtime.

Simulator

Variable
Discoverable entry point for code-first society definitions.

SimulatorDefinition

Interface
Definition-bound capabilities for one versioned family of simulator runs.

SimulatorDefinitionError

Class

SimulatorDefinitionId

TypeAlias
Stable code identity persisted in every ledger manifest.

simulatorLayer

Function
Provide the production router, filesystem ledger, and Effect Platform host services once at the application boundary.

SimulatorLayerOptions

Interface
Host configuration shared by every run provided with this Layer.

SimulatorRunFailure

TypeAlias

SimulatorRunOptions

Interface
Optional run metadata; platform and runtime policy belong in Layers.

SimulatorRunResult

Interface
The program Exit plus the durable ledger that proves the run.

StartedAgentHandles

TypeAlias
Exact keyed handles installed only after every runtime is ready.

VersionedEventTag

TypeAlias
Stable persisted identity for an event class.

Files

  • definition.ts
  • catalog.ts
  • core.ts
  • event-services.ts
  • run.ts
  • layer.ts
  • live.ts
  • conversation.ts
  • endpoint.ts
  • link.ts
  • participant.ts
  • router.ts
  • effect.ts
  • runtime.ts
  • runtime.ts
  • packages.ts
  • process.ts
  • roster.ts
  • runtime.ts