feat: taibai conversations command (Milestone 6b) #3

Closed
opened 2026-05-24 02:29:09 +00:00 by coding-agent-marvin8 · 1 comment
coding-agent-marvin8 commented 2026-05-24 02:29:09 +00:00 (Migrated from codeberg.org)

Add DM management commands:

  • taibai conversations — list direct message conversations
  • taibai conversations read CONV_ID — mark a conversation as read
  • taibai conversations delete CONV_ID — delete a conversation

Relevant longwei methods:

  • get_conversations(limit=20) -> list[Conversation]
  • read_conversation(conv_id) -> Conversation
  • delete_conversation(conv_id) -> None

Conversation model: id, unread, accounts: list[Account], last_status: Status|None

Add DM management commands: - `taibai conversations` — list direct message conversations - `taibai conversations read CONV_ID` — mark a conversation as read - `taibai conversations delete CONV_ID` — delete a conversation Relevant longwei methods: - `get_conversations(limit=20) -> list[Conversation]` - `read_conversation(conv_id) -> Conversation` - `delete_conversation(conv_id) -> None` Conversation model: `id`, `unread`, `accounts: list[Account]`, `last_status: Status|None`
coding-agent-marvin8 commented 2026-05-24 02:30:11 +00:00 (Migrated from codeberg.org)

Exploration findings:

  • get_conversations(limit=20) returns list[Conversation]; model fields: id, unread, accounts: list[Account], last_status: Status|None.
  • read_conversation(conv_id) and delete_conversation(conv_id) both available in longwei.
  • Conversations exist on Mastodon and Pleroma — no pre-flight instance-type guard needed; rely on ActivityPubError for graceful failure on unsupported platforms.
  • Pattern: cyclopts sub-App (like lists.py) with .default (list), .command("read"), .command("delete").

Plan of attack:

  1. Write failing tests (tests/test_conversations.py) — CLI layer + async layer.
  2. Implement src/taibai/commands/conversations.py: conversations_app = App(name="conversations") with default (list, renders Rich table: ID, unread flag, participants, last message snippet) and read/delete subcommands.
  3. Register in src/taibai/cli.py via app.command(conversations_app).
  4. Add docs/conversations.md + mkdocs.yml nav entry.
**Exploration findings:** - `get_conversations(limit=20)` returns `list[Conversation]`; model fields: `id`, `unread`, `accounts: list[Account]`, `last_status: Status|None`. - `read_conversation(conv_id)` and `delete_conversation(conv_id)` both available in longwei. - Conversations exist on Mastodon and Pleroma — no pre-flight instance-type guard needed; rely on `ActivityPubError` for graceful failure on unsupported platforms. - Pattern: cyclopts sub-App (like `lists.py`) with `.default` (list), `.command("read")`, `.command("delete")`. **Plan of attack:** 1. Write failing tests (`tests/test_conversations.py`) — CLI layer + async layer. 2. Implement `src/taibai/commands/conversations.py`: `conversations_app = App(name="conversations")` with default (list, renders Rich table: ID, unread flag, participants, last message snippet) and `read`/`delete` subcommands. 3. Register in `src/taibai/cli.py` via `app.command(conversations_app)`. 4. Add `docs/conversations.md` + `mkdocs.yml` nav entry.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
marvin8/taibai#3
No description provided.