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

Co-authored-by: Jason Woltje <jason@diversecanvas.com>
Co-committed-by: Jason Woltje <jason@diversecanvas.com>
This commit was merged in pull request #176.
This commit is contained in:
2026-03-16 01:58:56 +00:00
committed by jason.woltje
parent 5a1991924c
commit f0741e045f
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 |

View File

@@ -0,0 +1,40 @@
# P8-009: TUI Phase 1 — Slash Command Parsing
## Task Reference
- Issue: #162
- Branch: feat/p8-009-tui-slash-commands
## Scope
- New files: parse.ts, registry.ts, local/help.ts, local/status.ts, commands/index.ts
- Modified files: use-socket.ts, input-bar.tsx, message-list.tsx, app.tsx
## Key Observations
- CommandDef in @mosaic/types does NOT have `category` field — will omit from LOCAL_COMMANDS
- CommandDef.args is `CommandArgDef[] | undefined`, not `{ usage: string }` — help.ts args rendering needs adjustment
- Message role union currently: 'user' | 'assistant' | 'thinking' | 'tool' — adding 'system'
- InputBar currently takes `onSubmit: (value: string) => void` — need to add slash command interception
- app.tsx passes `onSubmit={socket.sendMessage}` directly — needs command-aware handler
## Assumptions
- ASSUMPTION: `category` field not in CommandDef type — will skip category grouping in help output, or add it only to registry (not to CommandDef type)
- ASSUMPTION: For the `args` field display in help, will use `CommandArgDef.name` and `CommandArgDef.description`
- ASSUMPTION: `commands:manifest` event type may not be in ServerToClientEvents — will handle via socket.on with casting if needed
## Status
- [ ] Create commands directory structure
- [ ] Implement parse.ts
- [ ] Implement registry.ts
- [ ] Implement local/help.ts
- [ ] Implement local/status.ts
- [ ] Implement commands/index.ts
- [ ] Modify use-socket.ts
- [ ] Modify input-bar.tsx
- [ ] Modify message-list.tsx
- [ ] Modify app.tsx
- [ ] Run quality gates
- [ ] Commit + Push + PR + CI