BlueGit

ict rusty-teams

Files

rusty-teams / README.md

README.md

b4838b28 History
README.md 5.7 KiB Download Raw

Rusty Teams

A fast native Microsoft Teams chat client written in Rust with GPUI. It does chats and channels. Calls, meetings and channel tabs are planned (see ROADMAP.md).

Rusty Teams with demo data

> Unofficial. Not affiliated with or endorsed by Microsoft. It uses the same web APIs as the Teams web app, which can change at any time.

Features

  • Chats and channels, with the Teams pin order, chat folders and hidden teams
  • Chat menu: pin, move to folder, mark as unread, mute, hide, leave
  • Live updates over the Teams realtime socket, no polling
  • Send, edit, delete, react, quote-reply, @mentions
  • Rich text composer: format bar over a selection, Ctrl+B / Ctrl+I / Ctrl+U, lists, quotes, code; Markdown converts as you type or paste
  • Composer picker for emoji, GIFs and stickers; GIFs and stickers also show in messages
  • Schedule send: right-click the send button or Ctrl+Shift+Enter; Teams delivers the message, text and formatting only
  • Emoji by : code with English codes and German aliases, :thumbsup: and :) convert as you type
  • Link previews: card under messages, preview above the composer that goes out with the message
  • Inline images, file cards, Adaptive Cards (layout, links, images, buttons: submit, execute, show card, toggle; input fields; task dialogs)
  • Read receipts, typing indicator (shown and sent), presence (last known status shown at start), unread jump
  • Select and copy message text, Ctrl+A in the composer
  • Local full-text search and a Ctrl+K switcher, served from the cache
  • Activity bell: feed of new messages, @mentions and reactions to your messages, kept for 14 days
  • Dark theme, opens instantly from the local cache
  • Self-update from an update folder
  • Single instance: a second start brings the running window to the front

Status

PlatformState
WindowsMain target. Login through an embedded WebView2
LinuxConnects to a Chrome you start with --remote-debugging-port=9222. Built-in login is planned

How it works

Rusty Teams never sees your password and never stores a token. It signs you in through a real Teams web page and lets that page make the API calls.

+--------------------------- Rusty Teams (Rust) ---------------------------+
|  app      GPUI window: sidebar, chat view, composer, Ctrl+K              |
|  core     sync engine, actions, mapping to view models                   |
|  store    SQLite cache + FTS5 search index                               |
|  graph    Microsoft Graph: chats, channels, messages, people, sending    |
|  chatsvc  Teams chat service: realtime, pins, folders, read receipts     |
|  session  runs requests inside the Teams page, one Transport trait       |
+------------------------------------|-------------------------------------+
                                     | DevTools protocol (CDP)
+------------------------------------v-------------------------------------+
|  Hidden browser page on teams.cloud.microsoft, own profile               |
|  webview: WebView2 (Windows)   or   browser: Chrome with a debug port    |
+------------------------------------|-------------------------------------+
                                     | HTTPS with the page's own MSAL tokens
               Graph  |  chat service (ic3)  |  presence  |  Trouter socket

Sign-in and tokens

1. A hidden browser page loads Teams web with its own profile. On Windows this is WebView2, so single sign-on with the Windows account usually just works. 2. If Teams asks for a login, the login window shows itself. After that the page stays parked in the background. 3. Every API call is sent to that page over CDP. A small script (crates/session/assets/fetch.js) picks the matching token from the page's MSAL cache, refreshes it when needed, and runs the fetch. 4. Only the response goes back to Rust. Tokens never leave the page.

Data flow

StepWhat happens
StartThe UI renders from the SQLite cache right away. A chat still syncing shows a progress line in its header. Skeleton bubbles only when the cache has no messages yet
Synccore fetches chats and channels from Graph with delta queries, pins and folders from the chat service
Livechatsvc keeps the Trouter WebSocket open. An event only says "something changed", the content is then fetched fresh
WriteSends, edits and reactions go out through Graph or the chat service, then the cache updates
SearchLocal FTS5 index over cached messages, no server round trip

Crates

CrateJob
appGPUI desktop app, binary teams
coreSync engine, actions, people ranking, markdown and card rendering
storeSQLite cache, migrations, search, image file cache
graphTyped Microsoft Graph client with batching and paging
chatsvcTeams chat service: Trouter realtime, pins, folders, receipts
sessionTransport trait, CDP session, in-page fetch
webviewHidden WebView2 host (Windows only)
browserChrome lifecycle and watchdog for the CDP transport
cliteams-probe, a read-only end-to-end check

Build and run

TaskCommand
Demo data, no accountcargo run -p app -- --demo
Against Chrome on a debug portcargo run -p app -- --endpoint http://127.0.0.1:9222
Windows exe from WSL/Linuxscripts/build-windows.sh crates/app teams
Testscargo test
Screenshot without a desktop (Xvfb, xdotool, xclip, mesa-vulkan-drivers)cargo build -p app && scripts/headless-shot.sh shot.png -- "mousemove 450 740" "click 1" "type hello"

Docs

  • ROADMAP.md - open and finished features by priority
  • docs/ - local research notes and mockups, not in git

License

MIT

Source
1# Rusty Teams
2
3A fast native Microsoft Teams chat client written in Rust with [GPUI](https://www.gpui.rs/).
4It does chats and channels. Calls, meetings and channel tabs are planned (see [ROADMAP.md](ROADMAP.md)).
5
6![Rusty Teams with demo data](.github/app-demo.png)
7
8> Unofficial. Not affiliated with or endorsed by Microsoft. It uses the same web APIs as the Teams web app, which can change at any time.
9
10## Features
11
12- Chats and channels, with the Teams pin order, chat folders and hidden teams
13- Chat menu: pin, move to folder, mark as unread, mute, hide, leave
14- Live updates over the Teams realtime socket, no polling
15- Send, edit, delete, react, quote-reply, @mentions
16- Rich text composer: format bar over a selection, `Ctrl+B` / `Ctrl+I` / `Ctrl+U`, lists, quotes, code; Markdown converts as you type or paste
17- Composer picker for emoji, GIFs and stickers; GIFs and stickers also show in messages
18- Schedule send: right-click the send button or `Ctrl+Shift+Enter`; Teams delivers the message, text and formatting only
19- Emoji by `:` code with English codes and German aliases, `:thumbsup:` and `:)` convert as you type
20- Link previews: card under messages, preview above the composer that goes out with the message
21- Inline images, file cards, Adaptive Cards (layout, links, images, buttons: submit, execute, show card, toggle; input fields; task dialogs)
22- Read receipts, typing indicator (shown and sent), presence (last known status shown at start), unread jump
23- Select and copy message text, `Ctrl+A` in the composer
24- Local full-text search and a `Ctrl+K` switcher, served from the cache
25- Activity bell: feed of new messages, @mentions and reactions to your messages, kept for 14 days
26- Dark theme, opens instantly from the local cache
27- Self-update from an update folder
28- Single instance: a second start brings the running window to the front
29
30## Status
31
32| Platform | State |
33|---|---|
34| Windows | Main target. Login through an embedded WebView2 |
35| Linux | Connects to a Chrome you start with `--remote-debugging-port=9222`. Built-in login is planned |
36
37## How it works
38
39Rusty Teams never sees your password and never stores a token.
40It signs you in through a real Teams web page and lets that page make the API calls.
41
42```
43+--------------------------- Rusty Teams (Rust) ---------------------------+
44| app GPUI window: sidebar, chat view, composer, Ctrl+K |
45| core sync engine, actions, mapping to view models |
46| store SQLite cache + FTS5 search index |
47| graph Microsoft Graph: chats, channels, messages, people, sending |
48| chatsvc Teams chat service: realtime, pins, folders, read receipts |
49| session runs requests inside the Teams page, one Transport trait |
50+------------------------------------|-------------------------------------+
51 | DevTools protocol (CDP)
52+------------------------------------v-------------------------------------+
53| Hidden browser page on teams.cloud.microsoft, own profile |
54| webview: WebView2 (Windows) or browser: Chrome with a debug port |
55+------------------------------------|-------------------------------------+
56 | HTTPS with the page's own MSAL tokens
57 Graph | chat service (ic3) | presence | Trouter socket
58```
59
60### Sign-in and tokens
61
621. A hidden browser page loads Teams web with its own profile. On Windows this is WebView2, so single sign-on with the Windows account usually just works.
632. If Teams asks for a login, the login window shows itself. After that the page stays parked in the background.
643. Every API call is sent to that page over CDP. A small script (`crates/session/assets/fetch.js`) picks the matching token from the page's MSAL cache, refreshes it when needed, and runs the `fetch`.
654. Only the response goes back to Rust. Tokens never leave the page.
66
67### Data flow
68
69| Step | What happens |
70|---|---|
71| Start | The UI renders from the SQLite cache right away. A chat still syncing shows a progress line in its header. Skeleton bubbles only when the cache has no messages yet |
72| Sync | `core` fetches chats and channels from Graph with delta queries, pins and folders from the chat service |
73| Live | `chatsvc` keeps the Trouter WebSocket open. An event only says "something changed", the content is then fetched fresh |
74| Write | Sends, edits and reactions go out through Graph or the chat service, then the cache updates |
75| Search | Local FTS5 index over cached messages, no server round trip |
76
77### Crates
78
79| Crate | Job |
80|---|---|
81| `app` | GPUI desktop app, binary `teams` |
82| `core` | Sync engine, actions, people ranking, markdown and card rendering |
83| `store` | SQLite cache, migrations, search, image file cache |
84| `graph` | Typed Microsoft Graph client with batching and paging |
85| `chatsvc` | Teams chat service: Trouter realtime, pins, folders, receipts |
86| `session` | `Transport` trait, CDP session, in-page fetch |
87| `webview` | Hidden WebView2 host (Windows only) |
88| `browser` | Chrome lifecycle and watchdog for the CDP transport |
89| `cli` | `teams-probe`, a read-only end-to-end check |
90
91## Build and run
92
93| Task | Command |
94|---|---|
95| Demo data, no account | `cargo run -p app -- --demo` |
96| Against Chrome on a debug port | `cargo run -p app -- --endpoint http://127.0.0.1:9222` |
97| Windows exe from WSL/Linux | `scripts/build-windows.sh crates/app teams` |
98| Tests | `cargo test` |
99| Screenshot without a desktop (Xvfb, xdotool, xclip, mesa-vulkan-drivers) | `cargo build -p app && scripts/headless-shot.sh shot.png -- "mousemove 450 740" "click 1" "type hello"` |
100
101## Docs
102
103- [ROADMAP.md](ROADMAP.md) - open and finished features by priority
104- `docs/` - local research notes and mockups, not in git
105
106## License
107
108[MIT](LICENSE)