Skip to content

Avatar Development Fixtures ​

Development fixtures provide repeatable local inputs for regression testing and rendering validation without an active Runtime session. Setting VITE_AVATAR_DRIVER=mock instructs the driver factory to instantiate MockDriver. By default, the factory initializes SdkDriver, which requires valid SDK bootstrap inputs.

Fixtures validate scenario parsing, event scheduling, and local state mapping. Rendering a development avatar model additionally requires a valid model manifest in the fixture configuration; event JSON alone does not guarantee visible canvas output. Fixture-driven previews remain marked as fixture_not_verified and cannot be used to close formal product acceptance.

Current Driver Interface ​

The renderer interacts with the driver through AgentDataDriver, which exposes:

  • Lifecycle and state: start, stop, getBundle, and onStatusChange
  • Event and bundle handling: onEvent, onBundleChange, and emit
  • Optional capabilities: emitCancelable

The kind and status properties are read-only. Bundle updates are reported exclusively through onBundleChange (there is no onAgentDataChange callback).

When constructing drivers via the factory:

  • MockDriver requires scenarioJson and accepts an optional scenarioSource.
  • SdkDriver requires explicit SdkDriverOptions and cannot be instantiated with a zero-argument constructor.

Scenario Format ​

FieldRequirement
scenario_idNon-empty string; must match the fixture filename when loaded from disk
versionString "1"
descriptionDescriptive scenario summary string
duration_msOptional finite positive number or null; a value is required when loop is true
loopRequired boolean
agent_bootstrapInitial fixture context: world ID, user ID, locale, posture, status text, and execution state
eventsRequired array of scenario events; use [] for a static preview
triggersOptional interactive trigger definitions

Fixture scenarios do not include a top-level bundle or meta wrapper. Events support two scheduling models:

  • Timed events: define kind: "time", at_ms, type, and detail.
  • Sequenced events: define kind: "after", after_event_id, delay_ms, type, and detail. The event referenced by after_event_id must exist in the scenario.

Simulated user or agent activity in fixtures emits avatar.fixture.presentation.activity_requested with source="mock". Synthetic events generated by fixtures are strictly local and are not Runtime-authorized events.

Static Input Example ​

Save the following scenario as static-preview.mock.json:

json
{
  "scenario_id": "static-preview",
  "version": "1",
  "description": "Static development preview",
  "duration_ms": null,
  "loop": false,
  "agent_bootstrap": {
    "active_world_id": "fixture-world",
    "active_user_id": "fixture-user",
    "locale": "en-US",
    "initial_posture": {
      "posture_class": "baseline_observer",
      "action_family": "observe",
      "interrupt_mode": "welcome",
      "transition_reason": "scenario_start",
      "truth_basis_ids": []
    },
    "initial_status_text": "Development preview",
    "initial_execution_state": "IDLE"
  },
  "events": []
}

Identity and environment fields configured in agent_bootstrap (such as active_world_id and active_user_id) exist solely within the local test fixture. They do not provision a live account, create an App session, or establish conversation continuity.

Validate custom scenario files against the renderer's loadScenarioFromJson and parseScenario loaders; default.mock.json provides an end-to-end reference implementation. Final 3D model presentation and live runtime paths must still be verified through dedicated integration checks.

Source Basis ​

Documentation for Nimi — the installable, open-source, local-first personal AI product.