Autocomplete system for @ mentions and / commands.
This is a custom implementation that handles trigger-based completion for slash commands (/) and file mentions (@).
UI cap so the completion popup doesn't get unwieldy.
Find the project root by looking for git metadata.
Neutralize control characters and deceptive Unicode in untrusted text.
Untrusted strings (MCP server errors, config-file contents, tool output)
can carry ANSI escape sequences, other control characters, or invisible
Unicode that corrupts the terminal, breaks out of a layout, or injects fake
lines into logs and prompts. This first removes the invisible/bidi code
points flagged by strip_dangerous_unicode, then replaces every remaining
Unicode "Other" (control/format) character with a space.
A single autocomplete entry for the slash-command controller.
Result of handling a key event in the completion system.
Protocol for views that can display completion suggestions.
Protocol for completion controllers.
Controller for / slash command completion.
Controller for @ file completion with fuzzy matching from current cwd.
Manages multiple completion controllers, delegating to the active one.