AGENTS.md@mcps/unreal_mcp/plugins/UnrealAgent/Source/UnrealAgent/Private/UI · git:20260727.48beb34 · 2026-07-27 · sha256 e0a13e86a8a52314

AGENTS.md@mcps/unreal_mcp/plugins/UnrealAgent/Source/UnrealAgent/Private/UI git:20260727.48beb34A

Immutable. This exact content is served forever at /api/v1/blob/e0a13e86a8a52314.

# Private/UI

Slate panel for `Window > Unreal Agent`. This subtree owns the visible chat surface: header, composer, model/agent menus, permission bar, transcript, quick prompts, sidebar/history, and context-window indicator.

## WHERE TO LOOK
| Task | File | Notes |
|------|------|-------|
| Build panel layout | `Core/` | Construction, lifecycle, main layout, predicates, and status |
| Public test hooks | `Core/SUnrealAgentPanel.h` | Automation-only transcript/sidebar/context helpers |
| Compose prompts | `Composer/` | Input, actions, prompt widgets, model/agent menus |
| Render transcript | `Transcript/` | Markdown, activity groups, streaming, active chat state |
| Manage history | `History/` | Conversation storage, rows, and history actions |
| Resolve permissions | `Permissions/` | Permission bar and approval/rejection actions |
| Show context controls | `Cockpit/` | Cockpit, sidebar, and context status |
| Automation state | `Automation/` | UI automation state and hooks |

## UI CONVENTIONS
- Stable widget tags prefixed `UnrealAgent.*` are the Slate automation contract. Update `UnrealAgentAutomationTests.cpp` with any tag/layout change.
- `Construct()` owns ACP client creation and delegate binding; keep protocol behavior in `Private/Acp`.
- Transcript caps: `200` entries, `20000` chars per entry, flush interval `0.05s`.
- Conversation roles: `OpenCode`, `User`/`You`, `Thought`, `Tool`, `Permission`, `Plan`, `Error`.
- `System` rows are status/diagnostic messages, not normal transcript rows.
- Stream rows append for `OpenCode`, `User`, and `Thought`; tool/permission/plan rows group under working/activity UI.
- Model/agent controls are visible only after ACP readiness and option discovery.
- Quick prompts should reinforce the production workflow: MCP capability discovery, current-state inspection, prototype-to-release planning, and verification. They must still avoid claiming live editor state unless MCP tooling is explicitly configured for the ACP session.
- Context-window status prefers exact OpenCode ACP `usage_update` token usage when available, then falls back to local model/transcript estimates.
- The cockpit row owns prompt context toggling, context refresh, Studio Kit status, validation, and evidence status. Keep long details in tooltips/transcript instead of expanding the row.
- Prompt context attachment is enabled by default; toggling it only changes prompt payloads, not visible user transcript text.

## ANTI-PATTERNS
- Removing or renaming widget tags without updating automation tests.
- Moving protocol parsing, process IO, or executable resolution into Slate layout code.
- Claiming live editor selection, viewport, or level state from UI state alone.
- Rendering raw JSON-RPC frames, normal process noise, or hidden tool/status events as chat rows.
- Blocking `Tick()` with process waits or long formatting work.
- Removing `WITH_DEV_AUTOMATION_TESTS` helpers without replacing the coverage.
- Putting Studio Kit generation, context capture, or validation logic directly in Slate layout code; call the ACP helpers instead.