fix(10-02): update downstream code for batched answers API

- Update resumeAgentInputSchema: prompt → answers (Record<string, string>)
- Update tRPC router to pass answers map
- Update CLI to accept JSON or single answer (fallback to q1 key)
- Update E2E tests for new resume signature
This commit is contained in:
Lukas May
2026-01-31 18:03:00 +01:00
parent a9e46a2843
commit 2c41e52029
5 changed files with 65 additions and 19 deletions

View File

@@ -119,15 +119,15 @@ export const agentIdentifierSchema = z.object({
export type AgentIdentifier = z.infer<typeof agentIdentifierSchema>;
/**
* Schema for resuming an agent with a prompt.
* Schema for resuming an agent with batched answers.
*/
export const resumeAgentInputSchema = z.object({
/** Lookup by human-readable name (preferred) */
name: z.string().optional(),
/** Or lookup by ID */
id: z.string().optional(),
/** User response to continue the agent */
prompt: z.string().min(1),
/** Map of question ID to user's answer */
answers: z.record(z.string(), z.string()),
}).refine(data => data.name || data.id, {
message: 'Either name or id must be provided',
});
@@ -378,7 +378,7 @@ export const appRouter = router({
.mutation(async ({ ctx, input }) => {
const agentManager = requireAgentManager(ctx);
const agent = await resolveAgent(ctx, input);
await agentManager.resume(agent.id, input.prompt);
await agentManager.resume(agent.id, input.answers);
return { success: true, name: agent.name };
}),