Phase 19: Agent Inbox - 4 plans in 2 waves - 3 parallel (Wave 1), 1 sequential (Wave 2) - Ready for execution
3.8 KiB
phase, plan, type, wave, depends_on, files_modified, autonomous
| phase | plan | type | wave | depends_on | files_modified | autonomous | |
|---|---|---|---|---|---|---|---|
| 19-agent-inbox | 01 | execute | 1 |
|
true |
Purpose: The agent inbox UI needs structured question data (options, multiSelect) to render form controls. Questions are stored in-memory on AgentManager via getPendingQuestions(agentId), but no tRPC procedure exposes this. The message table content is a plain string and does NOT contain the structured question data. This plan bridges that gap.
Output: Two new tRPC procedures: getAgentQuestions and listWaitingAgents.
<execution_context>
@/.claude/get-shit-done/workflows/execute-plan.md
@/.claude/get-shit-done/templates/summary.md
</execution_context>
@src/trpc/router.ts @src/agent/types.ts @src/agent/schema.ts
Task 1: Add getAgentQuestions tRPC procedure src/trpc/router.ts Add a `getAgentQuestions` query procedure to the appRouter. It should: 1. Accept `agentIdentifierSchema` input (same as getAgent — name or id) 2. Resolve the agent via `resolveAgent(ctx, input)` 3. Call `agentManager.getPendingQuestions(agent.id)` 4. Return the `PendingQuestions` object (or null if no pending questions)Place it near the existing getAgentResult procedure since it follows the same pattern.
Also add a listWaitingAgents query that filters agentManager.list() to only agents with status === 'waiting_for_input'. This lets the inbox efficiently fetch only agents that have questions without filtering client-side.
Update the JSDoc procedure list comment at the top of appRouter to include both new procedures.
npx tsc --noEmit (TypeScript compiles without errors)
- getAgentQuestions procedure exists and returns PendingQuestions | null
- listWaitingAgents procedure exists and returns AgentInfo[] filtered to waiting_for_input
- TypeScript compiles clean
- In
packages/shared/src/types.ts, add re-exports forPendingQuestionsandQuestionItemfrom../../src/agent/types.js - If the import path doesn't work with the shared package's rootDir config, define matching interfaces directly in the shared types file (same shapes as in src/agent/types.ts)
The key types needed by the frontend are:
QuestionItem:{ id: string; question: string; options?: { label: string; description?: string }[]; multiSelect?: boolean }PendingQuestions:{ questions: QuestionItem[] }npx tsc --noEmit -p packages/shared/tsconfig.json && npx tsc --noEmit -p packages/web/tsconfig.app.json- PendingQuestions and QuestionItem available to import from @codewalk-district/shared
- Both frontend and backend packages compile
<success_criteria>
- getAgentQuestions procedure returns structured question data from AgentManager
- listWaitingAgents returns only agents in waiting_for_input status
- PendingQuestions/QuestionItem types available in shared package
- All builds pass </success_criteria>