ACPex.Schema.Types.SessionUpdate.AvailableCommandsUpdate (ACPex v0.1.1)

Copy Markdown View Source

Available commands update.

Notification of changes to the set of available commands in the session.

Required Fields

  • type - Always "available_commands_update" for this variant
  • session_update - Update identifier
  • available_commands - List of available commands (list of maps)

Optional Fields

  • meta - Additional metadata (map)

Available Command Structure

Each entry in the available_commands list typically contains:

  • id - Unique identifier for the command
  • name - Command name
  • description - Description of what the command does
  • Other fields specific to the command

Example

%ACPex.Schema.Types.SessionUpdate.AvailableCommandsUpdate{
  type: "available_commands_update",
  session_update: "update-999",
  available_commands: [
    %{
      "id" => "cmd-1",
      "name" => "analyze",
      "description" => "Analyze the code"
    },
    %{
      "id" => "cmd-2",
      "name" => "refactor",
      "description" => "Refactor the code"
    }
  ]
}

JSON Representation

{
  "type": "available_commands_update",
  "sessionUpdate": "update-999",
  "availableCommands": [
    {
      "id": "cmd-1",
      "name": "analyze",
      "description": "Analyze the code"
    },
    {
      "id": "cmd-2",
      "name": "refactor",
      "description": "Refactor the code"
    }
  ]
}

Summary

Functions

Creates a changeset for validation.

Types

t()

@type t() :: %ACPex.Schema.Types.SessionUpdate.AvailableCommandsUpdate{
  available_commands: [map()],
  meta: map() | nil,
  session_update: String.t(),
  type: String.t()
}

Functions

changeset(struct \\ %__MODULE__{}, params)

@spec changeset(t(), map()) :: Ecto.Changeset.t()

Creates a changeset for validation.

Required Fields

  • session_update - Must be present
  • available_commands - Must be present

The type field defaults to "available_commands_update".