feat(cli): TUI slash command parsing + local commands (P8-009)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful

- Add parseSlashCommand() with regex-based parser for /cmd [args] format
- Add CommandRegistry with local-only commands (help, stop, cost, status, clear) and gateway manifest support
- Add short alias resolution: /n→new, /m→model, /t→thinking, /a→agent, /s→status, /h→help, /pref→preferences
- Add executeHelp() and executeStatus() local command handlers
- Extend Message.role union with 'system' for in-TUI system messages
- Handle commands:manifest socket event to update registry from gateway
- Wire InputBar to intercept /commands before sending to socket
- Render system messages as dimmed ⚙ prefix without avatar chrome
- Expose addSystemMessage() and socketRef from useSocket hook

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-15 20:55:10 -05:00
parent 5a1991924c
commit 48c9f57f69
11 changed files with 328 additions and 7 deletions

View File

@@ -76,8 +76,8 @@
| P7-021 | done | Phase 7 | Verify Phase 7 — feature-complete platform E2E | — | #132 W10 done |
| P8-005 | done | Phase 8 | CLI command architecture — DB schema + brain repo + gateway endpoints | #158 | |
| P8-006 | done | Phase 8 | CLI command architecture — agent, mission, prdy commands + TUI mods | #158 | |
| P8-007 | not-started | Phase 8 | DB migrations — preferences.mutable + teams + team_members + projects.teamId | | #160 |
| P8-008 | not-started | Phase 8 | @mosaic/types — CommandDef, CommandManifest, new socket events | | #161 |
| P8-007 | done | Phase 8 | DB migrations — preferences.mutable + teams + team_members + projects.teamId | #175 | #160 |
| P8-008 | done | Phase 8 | @mosaic/types — CommandDef, CommandManifest, new socket events | #174 | #161 |
| P8-009 | not-started | Phase 8 | TUI Phase 1 — slash command parsing, local commands, system message rendering, InputBar wiring | — | #162 |
| P8-010 | not-started | Phase 8 | Gateway Phase 2 — CommandRegistryService, CommandExecutorService, socket + REST commands | — | #163 |
| P8-011 | not-started | Phase 8 | Gateway Phase 3 — PreferencesService, /preferences REST, /system Valkey override, prompt injection | — | #164 |