@patimweb/pi-teams 1.12.0 → 1.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -186,3 +186,11 @@ and renews it every 5 minutes for 15 minutes at a time. You show as
186
186
  **Available**, or as whatever you picked with `teams_set_presence`. When the
187
187
  watcher stops, pi clears the session and you drop back to Offline straight away
188
188
  (at the latest 15 minutes after pi was killed).
189
+
190
+ ## "Seen" as soon as pi picks a message up
191
+
192
+ When a message wakes pi, the chat is marked read right away — before the answer
193
+ is written. With read receipts on in the tenant, the sender sees the "seen" eye
194
+ under their message and knows a reply is coming. A real typing indicator
195
+ ("…") is not possible: Microsoft Graph has no typing API for user accounts,
196
+ only the Bot Framework has one for bots.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@patimweb/pi-teams",
3
- "version": "1.12.0",
3
+ "version": "1.13.0",
4
4
  "description": "Microsoft Teams integration for pi coding agent — acts fully as the signed-in user across multiple accounts and tenants: chats, channels, meetings, presence, with configurable guardrails",
5
5
  "keywords": [
6
6
  "pi-package",
@@ -37,6 +37,7 @@ import {
37
37
  type WatchLoop,
38
38
  } from "../watch/loop.ts";
39
39
  import { composeWatchPrompt } from "../watch/prompt.ts";
40
+ import { setChatReadState } from "../graph/chats.ts";
40
41
  import { clearWakeTarget, pinViolation, pinWakeTarget } from "../watch/pin.ts";
41
42
  import { readWatchCursor, writeWatchCursor } from "../watch/cursor.ts";
42
43
 
@@ -225,6 +226,13 @@ export default function (pi: ExtensionAPI) {
225
226
  // answer the chat that woke pi, and the message it is about to read
226
227
  // was written by somebody else.
227
228
  pinWakeTarget(event.chat.id, event.chat.label);
229
+ // Mark the chat read the moment pi picks it up: with read receipts on,
230
+ // the sender sees the "seen" eye right away — the closest thing to a
231
+ // typing indicator Graph offers (there is no typing API for users).
232
+ // Fire-and-forget: a failed receipt must not hold up the answer.
233
+ if (event.me?.id) {
234
+ void setChatReadState(conn, event.chat.id, event.me, true).catch(() => undefined);
235
+ }
228
236
  pi.sendUserMessage(composeWatchPrompt(event, event.me), { deliverAs: "followUp" });
229
237
  },
230
238
  onTick: (status) => {