diff --git a/README.md b/README.md index 30e5437..ec990db 100644 --- a/README.md +++ b/README.md @@ -70,10 +70,10 @@ restart Prime, or run `/reload` in a running session. agents can inspect and control threads programmatically from the python REPL using the bundled `threads` skill: ```python -await threads.list() # list open and closed threads -await threads.complete("t1", reason="done in test") # mark thread complete -await threads.dismiss("t2", reason="obsolete") # dismiss unwanted thread -await threads.reopen("t3") # reopen a closed thread +threads.list() # list open and closed threads +threads.complete("t1", reason="done in test") # mark thread complete +threads.dismiss("t2", reason="obsolete") # dismiss unwanted thread +threads.reopen("t3") # reopen a closed thread ``` nothing is hidden: every thread the model tracks is visible and correctable here. diff --git a/skills/threads/SKILL.md b/skills/threads/SKILL.md index 4a971a4..244a960 100644 --- a/skills/threads/SKILL.md +++ b/skills/threads/SKILL.md @@ -9,15 +9,15 @@ The commitment observer tracks open user requests across turns so multi-part req Use this skill to inspect and update tracked threads directly from Python: ```python -await threads.list() -await threads.complete("t1") -await threads.dismiss("t2") -await threads.reopen("t3") +threads.list() +threads.complete("t1") +threads.dismiss("t2") +threads.reopen("t3") ``` ## API -- `await threads.list()` — list all open and closed threads as structured dicts (`id`, `status`, `canonicalRequest`, `missing`, etc.). -- `await threads.complete(thread_id, reason=None)` — mark a thread as completed (`status: done`). -- `await threads.dismiss(thread_id, reason=None)` — dismiss an obsolete or unwanted thread (`status: dismissed`). -- `await threads.reopen(thread_id)` — reopen a closed thread (`status: open`). +- `threads.list()` — list all open and closed threads as structured dicts (`id`, `status`, `canonicalRequest`, `missing`, etc.). +- `threads.complete(thread_id, reason=None)` — mark a thread as completed (`status: done`). +- `threads.dismiss(thread_id, reason=None)` — dismiss an obsolete or unwanted thread (`status: dismissed`). +- `threads.reopen(thread_id)` — reopen a closed thread (`status: open`). diff --git a/skills/threads/src/threads/__init__.py b/skills/threads/src/threads/__init__.py index 60a0637..a4bb139 100644 --- a/skills/threads/src/threads/__init__.py +++ b/skills/threads/src/threads/__init__.py @@ -102,7 +102,7 @@ def _read_threads() -> list[dict[str, Any]]: return threads -async def list(status: str | None = None) -> list[dict[str, Any]]: +def list(status: str | None = None) -> list[dict[str, Any]]: """List tracked commitment threads. Optional filter by status ('open', 'active', 'done', etc.).""" all_threads = _read_threads() if status is not None: @@ -110,7 +110,7 @@ async def list(status: str | None = None) -> list[dict[str, Any]]: return all_threads -async def complete(thread_id: str, reason: str | None = None) -> dict[str, Any]: +def complete(thread_id: str, reason: str | None = None) -> dict[str, Any]: """Mark a thread complete (status: done).""" if not isinstance(thread_id, str): raise TypeError(f"thread_id must be str, got {type(thread_id).__name__}") @@ -124,7 +124,7 @@ async def complete(thread_id: str, reason: str | None = None) -> dict[str, Any]: return {"status": "ok", "threadId": thread_id, "action": "accept"} -async def dismiss(thread_id: str, reason: str | None = None) -> dict[str, Any]: +def dismiss(thread_id: str, reason: str | None = None) -> dict[str, Any]: """Dismiss an obsolete or unwanted thread (status: dismissed).""" if not isinstance(thread_id, str): raise TypeError(f"thread_id must be str, got {type(thread_id).__name__}") @@ -138,7 +138,7 @@ async def dismiss(thread_id: str, reason: str | None = None) -> dict[str, Any]: return {"status": "ok", "threadId": thread_id, "action": "dismiss"} -async def reopen(thread_id: str) -> dict[str, Any]: +def reopen(thread_id: str) -> dict[str, Any]: """Reopen a closed thread (status: open).""" if not isinstance(thread_id, str): raise TypeError(f"thread_id must be str, got {type(thread_id).__name__}")