Add message intent classification (edit/info/help) before routing

Introduces a two-LLM-call pipeline: the first call classifies the user's
message intent as "edit", "info", or "help". Edit messages proceed through
the existing routing → edit → propose flow. Info messages get a generated
response about site content from the manifest. Help messages get a
templated capabilities overview. This handles open-ended questions like
"What can I do?" or "What does my site have on it?" which previously
had no path through the system.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Khalid A
2026-04-17 20:17:22 -05:00
parent 464d2c8230
commit 3cf3694ee7
4 changed files with 120 additions and 2 deletions

View File

@@ -142,6 +142,13 @@ export const editJobPayloadSchema = z.discriminatedUnion('kind', [
]);
export type EditJobPayload = z.infer<typeof editJobPayloadSchema>;
// ── Classification output (first LLM call) ──
export const classificationSchema = z.object({
intent: z.enum(['edit', 'info', 'help']),
reason: z.string(),
});
export type ClassificationOutput = z.infer<typeof classificationSchema>;
// ── Routing output (LLM structured output) ──
export const routingOutputSchema = z.object({
repo_relative_path: z.string(),