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

+30
View File
@@ -596,6 +596,26 @@ def test_all_day_event_parses(nextcloud):
assert event["start"] == "2026-07-04"
def test_list_events_expands_recurrences_when_window_given(nextcloud):
fake, base = nextcloud
make_client(base).list_events(
"personal", "2026-03-01T00:00:00Z", "2026-04-01T00:00:00Z"
)
report = [call for call in fake.calls if call[0] == "REPORT"][-1]
body = report[3].decode("utf-8")
assert "<c:expand" in body, body
assert "c:time-range" in body, body
def test_list_events_without_a_window_does_not_expand(nextcloud):
fake, base = nextcloud
make_client(base).list_events("personal")
report = [call for call in fake.calls if call[0] == "REPORT"][-1]
body = report[3].decode("utf-8")
assert "<c:expand" not in body, body
assert "<c:calendar-data/>" in body, body
def test_create_event_sends_if_none_match(nextcloud):
fake, base = nextcloud
make_client(base).create_event("personal", "u3", "X", "2026-03-01T12:00:00Z")
@@ -786,6 +806,16 @@ def test_bridge_lists_files(nextcloud):
assert [entry["name"] for entry in payload["entries"]] == ["readme.txt"]
def test_bridge_lists_calendars_with_default(nextcloud):
_fake, base = nextcloud
status, payload = bridge_for(base, default_calendar="personal").handle_get(
"/calendars", {}
)
assert status == 200
assert payload["default"] == "personal"
assert [c["name"] for c in payload["calendars"]] == ["personal"]
def test_bridge_create_event(nextcloud):
_fake, base = nextcloud
status, payload = bridge_for(base, default_calendar="personal").handle_post(