Skip to main content

simulator/src

packages/simulator/src

Purpose

Code-first simulator API.

Public surface

AgentConnection

Interface
Runtime identity issued for one scope-owned autonomous agent.

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.

AgentRuntimeCompleted

Class
An autonomous runtime completed normally.

AgentRuntimeFailed

Class
An autonomous runtime completed with a recorded failure.

AgentRuntimeReady

Class
A roster runtime completed acquisition and readiness.

AgentRuntimeStartFailed

Class
A roster runtime failed before it established readiness.

AgentWorkspaceFileHarvested

Class
One workspace file read back from a live application after the customer program ended. relativePath is the experiment’s own name for the file, or the runtime’s label for a file it harvests on the experiment’s behalf.

ClusterError

Class
Cluster loss that ends a run without exposing its backend.

ClusterLost

Class
Post-allocation cluster error plus all durable evidence retained.

ClusterServices

TypeAlias
Opaque service set supplied by a local-Kubernetes or GKE Layer.

CompletedLedgerReceipt

Class
Physical receipt for a ledger whose completion marker is durable.

coreEvents

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

CustomerEvents

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

EncodedEventOf

TypeAlias
The closed encoded union persisted for a catalog.

Endpoint

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

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
Represents event catalog definition failure conditions.

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.

HarvestedFileOutcome

TypeAlias
How the ledger records one read: the file’s text, its size when it ran past the bound, its absence, or why it could not be read.

IncompleteLedgerReceipt

Class
Physical receipt retained when ledger completion could not be published.

isEntryModule

Function
Whether a module is the process entry point rather than an ordinary import. Both sides are canonicalized because they are not the same kind of path: Node resolves a module’s real path before it becomes import.meta.url, while process.argv[1] is whatever the caller typed. Every executable in this package reaches its module through a symlink in the controller image, where /opt/moltzap/dist points at the installed package directory. Comparing the two without canonicalizing makes a directly invoked entry point look like an import, so the process exits successfully having done nothing. realPath returns undefined for a path that does not exist, so a missing or deleted argv[1] is a plain false rather than a thrown ENOENT. Returns: Whether both locations name the same real file.

LedgerFailure

TypeAlias
Represents ledger failure conditions.

LedgerReceipt (type)

TypeAlias
Decoded physical ledger receipt.

LedgerReceipt (value)

Variable
Schema for the complete physical ledger-receipt universe.

LinkController

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

LinkControllerService

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

LinkDelivery

Interface
One opaque signed message about to cross a directed link.

LinkDown

Class
A directed participant link transitioned from available to unavailable.

linkPolicy

Variable
Canonical link policies for the common traffic shapes.

LinkPolicy

TypeAlias
Decides one delivery on a directed link. A policy reads only its input and the ambient Clock; the link interpreter, never the policy, spends time and records evidence.

LinkPolicyCleared

Class
A described policy stopped shaping one directed participant link.

LinkPolicySet

Class
A described policy became active on one directed participant link.

LinkUp

Class
A directed participant link transitioned from unavailable to available.

linkVerdict

Variable
Constructors and matchers for the closed verdict union.

LinkVerdict

TypeAlias
Closed per-delivery decision returned by a link policy.

Network

Class
Network operations available to the customer program.

NetworkError

Class
An operational failure at a simulator network boundary.

NetworkService

Interface
Controlled endpoint operations installed for one run scope.

ParticipantHandle

Class
A network participant identity. The hidden symbol prevents structurally similar identity data from being used as a simulator handle.

ProfileRunResult (type)

TypeAlias
Decoded form of the one result line moltzap-sim run prints.

ProfileRunResult (value)

Variable
Schema of the final line moltzap-sim run prints for one submission. A consumer that spawns the executable decodes its stdout with this schema rather than copying the shape: the submitter is a separate process, so nothing else would notice the two sides disagreeing until a live run produced an undecodable line. The submitter’s own result type derives from this schema, so the two cannot drift.

ProgramFailed

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

ProgramFinished

Class
Customer-program completion plus its complete durable evidence.

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.

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.

Run

Variable
Discoverable execution entry point for one experiment society.

RunSpec (type)

Interface
Immutable code-first definition of one experiment society.

RunSpec (value)

Variable
Discoverable constructor for immutable experiment definitions.

RunStarted

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

SimulatorDefinitionError

Class
Reports simulator definition failures.

SimulatorDefinitionId

TypeAlias
Stable code identity persisted in every ledger manifest.

SimulatorRunFailure

TypeAlias
Represents simulator run failure conditions.

SimulatorRunOutcome

TypeAlias
Closed result of every run whose ledger allocation succeeded.

VersionedEventTag

TypeAlias
Stable persisted identity for an event class.

Files

  • agents/agent.ts
  • agents/container.ts
  • agents/index.ts
  • agents/nanoclaw/gateway.ts
  • agents/nanoclaw/runtime.ts
  • agents/openclaw/configuration.ts
  • agents/openclaw/gateway.ts
  • agents/openclaw/runtime.ts
  • agents/roster.ts
  • agents/workspace.ts
  • cluster/bootstrap.ts
  • cluster/cluster.ts
  • cluster/cohort.ts
  • cluster/controlled-endpoint.ts
  • cluster/controller/configuration.ts
  • cluster/controller/ledger-export.ts
  • cluster/controller/main.ts
  • cluster/controller/services.ts
  • cluster/controller/summary.ts
  • cluster/entry.ts
  • cluster/install.ts
  • cluster/kubernetes/calls.ts
  • cluster/kubernetes/harvest.ts
  • cluster/kubernetes/network-objects.ts
  • cluster/kubernetes/objects.ts
  • cluster/profile.ts
  • cluster/profiles/cli.ts
  • cluster/profiles/gke.ts
  • cluster/profiles/local.ts
  • cluster/profiles/result.ts
  • cluster/reclaim.ts
  • cluster/scaffold.ts
  • cluster/society-network.ts
  • cluster/submit.ts
  • cluster/temporal.ts
  • cluster/watch.ts
  • definition.ts
  • events/catalog.ts
  • events/core.ts
  • index.ts
  • ledger/append.ts
  • ledger/filesystem.ts
  • ledger/index.ts
  • ledger/read.ts
  • ledger/schema.ts
  • ledger/storage.ts
  • network/endpoint.ts
  • network/failure.ts
  • network/index.ts
  • network/link.ts
  • network/participant.ts
  • network/router.ts
  • run/acquire.ts
  • run/endpoints.ts
  • run/events.ts
  • run/execute.ts
  • run/link-fabric.ts
  • run/links.ts
  • run/outcomes.ts
  • run/router-fault-proxy.ts