skills: route create_event/next_event through the bridge

Both skills spoke CalDAV directly and declared the account as flat contract
vars (nextcloud_url/username/app_password/default_calendar). Bootstrap now
stores the account under bridges.nextcloud and only the derived
nextcloud_bridge_url/_token reach ctx.config, so the runner asked for the URL
and credentials on first fire.

Call the bridge instead, like create_task:
- create_event: GET /calendars -> SemIf choice -> POST /calendars/events
- next_event:  GET /calendars -> SemIf choice -> GET /calendars/events

The bridge gains two small affordances so the skills keep their behavior:
- GET /calendars also returns the configured default calendar name
- GET /calendars/events expands recurrences server-side when given a window
This commit is contained in:
gabby committed 2026-10-14 04:25:54 +00:00
1 parent ace251a829
commit 1a1d28dffd
9 files changed
+486 -748

No files matched your search

+11 -1
View File
@@ -504,11 +504,21 @@ def _calendar_query_body(component: str, start: str = "", end: str = "") -> byte
if end:
attrs += f' end="{_stamp(_parse_dt(end))}"'
time_range = f"<c:time-range{attrs}/>"
# With a bounded window, ask the server to expand recurrences into their
# instances (matching a `next event` read); `<c:expand>` needs both bounds.
calendar_data = "<c:calendar-data/>"
if start and end:
calendar_data = (
"<c:calendar-data>"
f'<c:expand start="{_stamp(_parse_dt(start))}" '
f'end="{_stamp(_parse_dt(end))}"/>'
"</c:calendar-data>"
)
return (
'<?xml version="1.0"?>'
'<c:calendar-query xmlns:d="DAV:" '
'xmlns:c="urn:ietf:params:xml:ns:caldav">'
"<d:prop><d:getetag/><c:calendar-data/></d:prop>"
f"<d:prop><d:getetag/>{calendar_data}</d:prop>"
"<c:filter><c:comp-filter name=\"VCALENDAR\">"
f'<c:comp-filter name="{component}">{time_range}</c:comp-filter>'
"</c:comp-filter></c:filter></c:calendar-query>"