Creating Custom Chat Modes/Agents

The Chat view in AI Positron has a drop-down menu where you can choose between custom chat modes (e.g. Chat/Ask/DITA Agent). Each of these chat modes define an initial prompt and a set of tools that are used when the chat is started. Extra chat modes can be added by creating custom AI actions with a specific output-action, as exemplified below:
{
    "id": "my.custom.chat.mode",
    "title": "S1000D",
    "description": "Chat with the AI about your S1000D project.",
    "categoryId": "Chat modes",
    "output-action": "agentic",
    "prompt_ref": "prompts/s100d-detailed-prompt.md",
    "expand-params": [
      {
        "name": "applicationContext",
        "value": "${applicationContext}"
      }
    ],
    "parameters": {
      "function_refs": [
        {"ref": "get_current_document_location"},
        {"ref": "get_document_content"},
        {"ref": "search_project_resources"},
        {"ref": "search_webhelp_content"},
        {"ref": "grep_project"},
        {"ref": "list_dir"},
        {"ref": "copy_move_rename_path"},
        {"ref": "run_command_line"},
        {"ref": "edit_document"},
        {"ref": "invoke_ai_action"},
        {"ref": "retrieve_ai_actions"},
        {"ref": "get_xml_refactoring_operations"},
        {"ref": "get_xml_refactoring_operation_params"},
        {"ref": "refactor_xml_with_operation"},
        {"ref": "refactor_xml_with_xslt"},
        {"ref": "store_to_memory"},
        {"ref": "clear_memory"},
        {"ref": "validate_content"},
        {"ref": "term_check_document_content"}
      ]
    }
  }