maven: calendar event querying (task 3)
Store: CalendarEvents(ctx, from, to) — filters caldav facts by key date prefix. IPC: full wiring through interface, server dispatch, and client. Router: ParseCalendarDate (сегодня/завтра), CalendarEventFormatter (RU reply). Voice: calendar detection before notes RAG in IntentQuery handler. Tests: store integration test, date parser tests, formatter tests. Co-Authored-By: opencode <opencode@anthropic.com>
This commit is contained in:
@@ -411,6 +411,21 @@ func (h *reactiveHandler) applyAction(ctx context.Context, dec router.Decision)
|
||||
return "" // replier phrases the "saved" reply
|
||||
|
||||
case router.IntentQuery:
|
||||
// Calendar questions: "что у меня сегодня?", "планы на завтра?"
|
||||
if date, ok := router.ParseCalendarDate(dec.Utterance, time.Now()); ok {
|
||||
events, err := h.api.CalendarEvents(ctx, date, date.Add(24*time.Hour))
|
||||
if err != nil {
|
||||
log.Printf("voice: calendar events: %v", err)
|
||||
return "не получилось проверить календарь."
|
||||
}
|
||||
values := make([]string, len(events))
|
||||
for i, e := range events {
|
||||
values[i] = e.Value
|
||||
}
|
||||
var f router.CalendarEventFormatter
|
||||
return f.Format(values, date)
|
||||
}
|
||||
|
||||
vec, err := h.embedder.Embed(ctx, dec.Utterance)
|
||||
if err != nil {
|
||||
log.Printf("voice: embed query: %v", err)
|
||||
|
||||
Reference in New Issue
Block a user