feat(cli): command architecture — agents, missions, gateway-aware prdy #158

Merged
jason.woltje merged 1 commits from feat/cli-command-architecture into main 2026-03-15 23:10:24 +00:00
Owner

Summary

  • DB schema: Extend agents table with project scoping, ownership, system prompt, tool/skill config, isSystem flag. Add agentId FK to conversations.
  • Brain: New agents repository with full CRUD + findAccessible.
  • Gateway: New /api/agents CRUD endpoints. Consolidate /api/missions to user-scoped CRUD with /tasks sub-routes. Slim coord to file-based only. Wire agentConfigId into session creation.
  • CLI: New mosaic agent, mosaic mission, mosaic prdy commands. Shared with-auth helper and select-dialog. TUI accepts --agent and --project flags.
  • Types: Add agentId to ChatMessagePayload.

Test plan

  • pnpm typecheck — 32/32 green
  • pnpm lint — 18/18 green
  • pnpm format:check — clean
  • pnpm test — 23 tests pass
## Summary - DB schema: Extend agents table with project scoping, ownership, system prompt, tool/skill config, isSystem flag. Add agentId FK to conversations. - Brain: New agents repository with full CRUD + findAccessible. - Gateway: New /api/agents CRUD endpoints. Consolidate /api/missions to user-scoped CRUD with /tasks sub-routes. Slim coord to file-based only. Wire agentConfigId into session creation. - CLI: New mosaic agent, mosaic mission, mosaic prdy commands. Shared with-auth helper and select-dialog. TUI accepts --agent and --project flags. - Types: Add agentId to ChatMessagePayload. ## Test plan - [x] pnpm typecheck — 32/32 green - [x] pnpm lint — 18/18 green - [x] pnpm format:check — clean - [x] pnpm test — 23 tests pass
jason.woltje added 1 commit 2026-03-15 23:09:37 +00:00
feat(cli): command architecture — agents, missions, and gateway-aware prdy
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
ae4cd490ec
DB schema:
- Extend agents table with projectId, ownerId, systemPrompt, allowedTools,
  skills, isSystem columns and indexes
- Add agentId FK to conversations table with index

Brain:
- New agents repository (findAll, findById, findByName, findByProject,
  findSystem, findAccessible, create, update, remove)
- Wire into Brain interface and createBrain factory

Gateway:
- New AgentConfigsController at /api/agents with full CRUD + ownership guards
- Consolidate /api/missions — user-scoped CRUD replaces old project-ownership
  model, add /api/missions/:id/tasks sub-routes (replaces coord mission-tasks)
- Slim coord controller to file-based endpoints only (agent tool consumption)
- Remove DB-backed methods from CoordService (now handled by Brain repos)
- Wire agentConfigId into AgentService.createSession for DB config merging
- Add agentId field to ChatSocketMessageDto and ChatMessagePayload

CLI:
- New `mosaic agent` command (--list, --new, --show, --update, --delete)
- New `mosaic mission` command (--list, --init, --plan, --update, task sub)
- New `mosaic prdy` gateway-aware wrapper (--init, --update, --project)
- Shared with-auth helper and select-dialog utility
- TUI: accept --agent and --project flags, pass agentId to socket, display
  agent name in top bar
- Gateway API client: add agents, projects, missions, mission-tasks helpers
- Add @clack/prompts dependency
- Refactor sessions commands to use with-auth helper

Types:
- Add agentId to ChatMessagePayload

Tests:
- Update resource-ownership test for user-scoped missions (NotFoundException)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
jason.woltje merged commit 4da255bf04 into main 2026-03-15 23:10:24 +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#158