Archon Interface 2 or AI2 is the built-in admin console for Hexarc. It allows users and administrators to interact with the arcology using a command-line interface.

Return Types

An AI2 command returns a datum, which is then read as a JavaScript value on the UI. Depending on the type and format, the AI2 interface displays the datum in different ways.

Primitive values (numbers, strings, etc.) are displayed verbatim.

Arrays are displayed in one of two formats. If all the elements of the array are objects (structs) then we display the result as a table, in which the columns are the union of all fields. Otherwise, we assume the array is an array of primitive types and display a list of values.

Structs are displayed as a table of field-value pairs.

In addition, a struct with an ai2Directive field is interpreted as a special type. The following directives are defined:


   ai2Directive: "imageResult"


   ai2Directive: "listResult"
   listResult: ...              // An array of objects

The listResult directive forces the result to be interpreted as an array.


   ai2Directive: "partialResult"
   partialResult: ...           // Partial result to output
   continueCommand: ...         // Command to continue (or null)

This directive is used to return partial results to the console instead of waiting for the entire command to finish.