feat(calendar): add nc_calendar_complete_todo convenience tool#768
Open
KuriGohan-Kamehameha wants to merge 1 commit into
Open
feat(calendar): add nc_calendar_complete_todo convenience tool#768KuriGohan-Kamehameha wants to merge 1 commit into
KuriGohan-Kamehameha wants to merge 1 commit into
Conversation
Add a one-shot "complete this todo" wrapper around update_todo. It sets STATUS=COMPLETED, PERCENT-COMPLETE=100, and the COMPLETED timestamp in a single call. The same operation has always been possible via nc_calendar_update_todo with three explicit fields, but for AI clients the phrasing "complete this task" is much more natural than "set status to COMPLETED, set percent_complete to 100, and set completed to <now>" — the latter forces the client to compute a timestamp and remember three field names. A dedicated tool also pairs naturally with the existing delete_todo, update_todo, and create_todo trio. The implementation is a thin wrapper: it delegates to client.calendar.update_todo with a fixed three-field payload, defaulting completed_at to dt.datetime.now(dt.timezone.utc).isoformat() when the caller doesn't supply one. No client-side or model changes are needed. Verified end-to-end against Nextcloud 33.0.2: create_todo -> complete_todo -> search_todos shows status=COMPLETED, percent_complete=100, completed=<timestamp>.
433d0b8 to
94ecf40
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Adds
nc_calendar_complete_todo— a one-shot "complete this task" tool that wraps the existingupdate_todoto setSTATUS=COMPLETED,PERCENT-COMPLETE=100, and aCOMPLETEDtimestamp in a single call.Why
The same operation is already possible through
nc_calendar_update_todo:…but for AI clients, "complete this task" is a much more natural phrasing than "set three specific fields, and remember to compute the current timestamp." The dedicated tool also pairs naturally with the existing
create_todo/update_todo/delete_todotrio, mirroring CalDAV libraries that ship a one-shot complete operation (e.g., the Node CalDAV client stack).The new tool is a thin wrapper:
No client-side, model, or schema changes — the existing
update_todoclient method already accepts these three fields.Verification
End-to-end against a live Nextcloud 33.0.2 instance:
nc_calendar_create_todo(calendar_name="tasks", summary="…", description="…")→ returned UIDnc_calendar_complete_todo(calendar_name="tasks", todo_uid=<UID>)→{"status_code": 200, "uid": "<UID>", "href": "…"}nc_calendar_search_todos(calendar_name="tasks", query="…")→ entry showsstatus: "COMPLETED",percent_complete: 100,completed: "2026-…"nc_calendar_delete_todo(...)cleanup OKNotes
idempotentHint=True— calling complete on an already-completed todo just refreshes the COMPLETED timestamp (matches CalDAV semantics).todo.write, calendar.read(same asupdate_todo).