Upgrading from Older Versions
Legacy simulations remain the default: omitting interaction or setting interaction.mode: "legacy" keeps the original message routing behavior. The perception layer is opt-in with interaction.mode: "perception".
Supported public imports
typescript
import { WorldEngine } from "worldsim";
import { format as formatFederatedAgentId } from "worldsim/federation";CommonJS remains supported:
javascript
const { WorldEngine } = require("worldsim");Deep imports such as worldsim/dist/... or worldsim/src/... are not part of the public API and may change between releases.
Migration checklist
- Message routing — If you relied on global broadcast, keep
interaction.mode: "legacy"(default). Switch to"perception"only when you want sensory limits. - Perception mode — Set
interaction.defaultSensesand optionallydisableBroadcastFallback: truefor strict physics-aware worlds. See Perception Layer. - Groups & gatherings — From
1.3.x, wiregroupStoreandgatheringStoreonWorldConfigif you need structured multi-agent events. See Groups & Gatherings. - Federation — Cross-world messaging is opt-in via
WorldConfig.federation. See Federation. - Closed routing — Replace patches to internal
MessageRoutermethods withmessageRouting.unroutablePolicy: "drop"or"error". Observe exact delivery outcomes through the publiconMessageRoutedplugin hook.