BlueGit

ict rusty-teams

Files

rusty-teams / README.md

README.md

Initial commit
metis Daniel Däschle · pushed by metis · 7 weeks ago
06e0ae51 History
README.md 4.5 KiB Download Raw

Rusty Teams

A fast native Microsoft Teams chat client written in Rust with GPUI. It does chats and channels. No calls, no meetings, no apps.

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
  • Live updates over the Teams realtime socket, no polling
  • Send, edit, delete, react, quote-reply, @mentions
  • Inline images, file cards, Adaptive Cards as text
  • Read receipts, presence, unread jump
  • Local full-text search and a Ctrl+K switcher, served from the cache
  • Dark theme, opens instantly from the local cache
  • Self-update from an update folder

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
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, see docs/build-windows.md
Testscargo test

Docs

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. No calls, no meetings, no apps.
5
6![Rusty Teams with demo data](docs/screenshots/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- Live updates over the Teams realtime socket, no polling
14- Send, edit, delete, react, quote-reply, @mentions
15- Inline images, file cards, Adaptive Cards as text
16- Read receipts, presence, unread jump
17- Local full-text search and a `Ctrl+K` switcher, served from the cache
18- Dark theme, opens instantly from the local cache
19- Self-update from an update folder
20
21## Status
22
23| Platform | State |
24|---|---|
25| Windows | Main target. Login through an embedded WebView2 |
26| Linux | Connects to a Chrome you start with `--remote-debugging-port=9222`. Built-in login is planned |
27
28## How it works
29
30Rusty Teams never sees your password and never stores a token.
31It signs you in through a real Teams web page and lets that page make the API calls.
32
33```
34+--------------------------- Rusty Teams (Rust) ---------------------------+
35| app GPUI window: sidebar, chat view, composer, Ctrl+K |
36| core sync engine, actions, mapping to view models |
37| store SQLite cache + FTS5 search index |
38| graph Microsoft Graph: chats, channels, messages, people, sending |
39| chatsvc Teams chat service: realtime, pins, folders, read receipts |
40| session runs requests inside the Teams page, one Transport trait |
41+------------------------------------|-------------------------------------+
42 | DevTools protocol (CDP)
43+------------------------------------v-------------------------------------+
44| Hidden browser page on teams.cloud.microsoft, own profile |
45| webview: WebView2 (Windows) or browser: Chrome with a debug port |
46+------------------------------------|-------------------------------------+
47 | HTTPS with the page's own MSAL tokens
48 Graph | chat service (ic3) | presence | Trouter socket
49```
50
51### Sign-in and tokens
52
531. 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.
542. If Teams asks for a login, the login window shows itself. After that the page stays parked in the background.
553. 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`.
564. Only the response goes back to Rust. Tokens never leave the page.
57
58### Data flow
59
60| Step | What happens |
61|---|---|
62| Start | The UI renders from the SQLite cache right away |
63| Sync | `core` fetches chats and channels from Graph with delta queries, pins and folders from the chat service |
64| Live | `chatsvc` keeps the Trouter WebSocket open. An event only says "something changed", the content is then fetched fresh |
65| Write | Sends, edits and reactions go out through Graph or the chat service, then the cache updates |
66| Search | Local FTS5 index over cached messages, no server round trip |
67
68### Crates
69
70| Crate | Job |
71|---|---|
72| `app` | GPUI desktop app, binary `teams` |
73| `core` | Sync engine, actions, people ranking, markdown and card rendering |
74| `store` | SQLite cache, migrations, search, image file cache |
75| `graph` | Typed Microsoft Graph client with batching and paging |
76| `chatsvc` | Teams chat service: Trouter realtime, pins, folders, receipts |
77| `session` | `Transport` trait, CDP session, in-page fetch |
78| `webview` | Hidden WebView2 host (Windows only) |
79| `browser` | Chrome lifecycle and watchdog for the CDP transport |
80| `cli` | `teams-probe`, a read-only end-to-end check |
81
82## Build and run
83
84| Task | Command |
85|---|---|
86| Demo data, no account | `cargo run -p app -- --demo` |
87| Against Chrome on a debug port | `cargo run -p app -- --endpoint http://127.0.0.1:9222` |
88| Windows exe from WSL/Linux | `scripts/build-windows.sh crates/app teams`, see [docs/build-windows.md](docs/build-windows.md) |
89| Tests | `cargo test` |
90
91## Docs
92
93- [docs/research](docs/research) - how Teams does realtime, pins, read receipts and edits
94- [docs/design](docs/design) - mockups
95- [docs/build-windows.md](docs/build-windows.md) - cross-compiling without admin rights
96
97## License
98
99[MIT](LICENSE)