feat(cli): TUI slash command parsing + local commands (P8-009) #176

Merged
jason.woltje merged 1 commits from feat/p8-009-tui-slash-commands into main 2026-03-16 01:58:56 +00:00
Owner

Summary

  • Add slash command infrastructure: parseSlashCommand(), CommandRegistry with local + gateway manifest commands
  • Wire InputBar to intercept /command input before sending to socket — routes to local handlers or gateway via command:execute
  • Add 'system' to Message.role union and render system messages as dimmed gear-prefix without avatar chrome
  • Handle commands:manifest socket event to hydrate registry from gateway on connect
  • Local commands implemented: /help, /status, /clear, /cost, /stop
  • Short aliases: /n->new, /m->model, /t->thinking, /a->agent, /s->status, /h->help, /pref->preferences

Test plan

  • Type /help in TUI — system message with command list appears
  • Type /status — shows connection/model/session/token info
  • Type /clear — clears conversation display
  • Type /unknowncmd — system message with "Unknown command: /unknowncmd. Type /help..."
  • Normal messages still send to socket
  • pnpm typecheck && pnpm lint && pnpm format:check all pass

Closes #162

## Summary - Add slash command infrastructure: parseSlashCommand(), CommandRegistry with local + gateway manifest commands - Wire InputBar to intercept /command input before sending to socket — routes to local handlers or gateway via command:execute - Add 'system' to Message.role union and render system messages as dimmed gear-prefix without avatar chrome - Handle commands:manifest socket event to hydrate registry from gateway on connect - Local commands implemented: /help, /status, /clear, /cost, /stop - Short aliases: /n->new, /m->model, /t->thinking, /a->agent, /s->status, /h->help, /pref->preferences ## Test plan - Type /help in TUI — system message with command list appears - Type /status — shows connection/model/session/token info - Type /clear — clears conversation display - Type /unknowncmd — system message with "Unknown command: /unknowncmd. Type /help..." - Normal messages still send to socket - pnpm typecheck && pnpm lint && pnpm format:check all pass Closes #162
jason.woltje added 1 commit 2026-03-16 01:56:02 +00:00
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
48c9f57f69
- 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>
jason.woltje merged commit f0741e045f into main 2026-03-16 01:58:56 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mosaicstack/stack#176