API Specification - 45deg/Actoverse GitHub Wiki

(version 0.1)

Communication

Events and commands are communicated over the WebSocket connection.

Events

Events are reported from the host to the UI. They also include responses to a request from the UI, which are marked .

JSON Format

{ 
  "event": "EVENT_TYPE", 
  ... parameters ...
}

EVENT_TYPE is a type of an event, and the parameters depend on the type.

Type of Events

Event: SEND_MESSAGE

Description An actor sent a message.

Parameters

  • body — a message object (as below)
    • sender — the name of the sender actor
    • target — the name of the receiver actor
    • data — the content of the message in the JSON format
    • timestamp — the Lamport timestamp at sending this message
    • uid — the unique ID of this message
  • timestamp — the Lamport timestamp
  • name — the name of the actor that sent the message

Event: MESSAGE_RECEIVED

Description An actor received a message.

Parameters

  • body — a message body (same as SEND_MESSAGE)
  • timestamp — the Lamport timestamp
  • name — the name of the actor that received the message

Event: ACTOR_UPDATED

Description An actor changed its state. (This happens when an actor finishes processing a message)

Parameters

  • body — the state of the actor in the JSON format
  • timestamp — the Lamport timestamp
  • name — the name of the actor that updated the state

Event: ACTOR_CREATED

Description An actor spawned.

Parameters

  • body — the information about the actor
  • kind — the kind (like a class name) of the actor
  • state — the state of the actor in the JSON format
  • timestamp — the Lamport timestamp
  • name — the name of the actor that spawned

Event: POOL_ADD

Description A received message was suspended by a message breakpoint.

Parameters

  • body — a message body (same as SEND_MESSAGE)
  • timestamp — the Lamport timestamp
  • name — the name of the actor that received the message

Event: DUMP_LOG

Description A response for a command to export the message history.

Parameters

  • body — the history of messages

Event: ACTOR_REPLACED

Description A response for a command to rollback the state.

Parameters

  • body — the state of the actor in the JSON format
  • timestamp — the Lamport timestamp
  • name — the name of the target actor

Event: ADD_BREAKPOINT

Description A response for a command to add a message breakpoint.

Parameters

  • body — the content of the breakpoint
  • type — the type of the breakpoint
  • value — the condition in the JSON format
  • id — the unique ID for this breakpoint

Event: REMOVE_BREAKPOINT

Description A response for a command to remove a message breakpoint.

  • id — the unique ID for the removed message breakpoint

Commands

Commands are sent from the UI to the host for manipulating the debugger.

JSON Format

{ 
	"type": "command type",
	 ... parameters ...
}

command_type is a type of a command, and the parameters depend on the type.

Type of Commands

Command: dump_log

Description Dumps a message history.

Parameters

No parameters


Command: rollback

Description Reverts to the past state specified by a Lamport clock.

Parameters

  • time — target time

Command: add_breakpoint

Description Adds a message breakpoint condition.

Parameters

  • body — the content of the breakpoint
  • type — the type of the breakpoint
  • value — the condition in the JSON format

Command: remove_filter

Description Removes a message breakpoint.

Parameters

  • id — the unique ID for the breakpoint to be removed

Command: export_filters

Description Exports all registered breakpoints. The responses of this command are multiple ADD_BREAKPOINT events.

Parameters

No parameters


Command: select

Description Continues processing a message taken from the list of filtered messages.

Parameters

  • id — the unique ID for the message
⚠️ **GitHub.com Fallback** ⚠️