feat(server): add Orbit agent command RPCs
@dgruzd This MR adds the Knowledge Graph side of the Orbit agent command surface described in !1253 (merged).
It introduces the v2 command registry, returns compact command details for lazy MCP discovery, and executes GKG-owned command invocations. Rails still owns the runtime path for query_graph through its command interceptor.
Relates to:
Depends on:
- gitlab-org/gitlab!234925 (merged)
- gitlab-org/modelops/applied-ml/code-suggestions/ai-assist!5446 (merged)
Flow
flowchart LR
Agent[Orbit agent] -->|MCP: list_commands| DWS[Duo Workflow Service]
DWS --> Rails[Rails MCP + REST]
Rails -->|ListAgentCommands| GKG[GKG command registry v2]
GKG -->|names, descriptions, schemas, source_type| Rails
Rails -->|TOON command catalog| Agent
Agent -->|MCP: invoke_command| DWS
Rails -->|GKG-owned commands| Invoke[GKG InvokeAgentCommand]
Invoke -->|DSL, schema, response format context| Agent
Rails -->|Rails-owned query_graph| Interceptor[Command interceptor]
Interceptor --> Stream[existing Workhorse query_graph stream]
Stream --> Agent
Rest[REST client] -->|GET /orbit/agent/commands| Rails
Rest -->|POST /orbit/agent/commands/:name| RailsGKG changes
- Adds
ListAgentCommandsandInvokeAgentCommandRPCs. - Adds a v2 command registry with command names, descriptions, parameter schemas, supported formats, and
source_typeownership. - Lists
query_graph,get_graph_schema,get_query_dsl, andget_response_formatfor lazy command discovery. - Executes GKG-owned discovery commands directly from
InvokeAgentCommand. - Marks Rails-owned commands so Rails can intercept them instead of sending execution into GKG.
- Returns the command catalog in TOON when callers request LLM format.
- Keeps
get_graph_statusout of the new command catalog. - Does not add
get_graph_info.
Edited by Michael Angelo Rivera