@patimweb/pi-teams 1.7.2 → 1.7.3

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@patimweb/pi-teams",
3
- "version": "1.7.2",
3
+ "version": "1.7.3",
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",
@@ -16,7 +16,13 @@ import {
16
16
  tryResolveConnection,
17
17
  type TeamsConnection,
18
18
  } from "../config/index.ts";
19
- import { buildConnectionCard, buildConnectionLabel, formatStatusText, type ConnectionCard } from "../status.ts";
19
+ import {
20
+ buildConnectionCard,
21
+ buildConnectionLabel,
22
+ buildStartupNotice,
23
+ formatStatusText,
24
+ type ConnectionCard,
25
+ } from "../status.ts";
20
26
  import {
21
27
  blockReason,
22
28
  formatMutationSummary,
@@ -416,10 +422,8 @@ export default function (pi: ExtensionAPI) {
416
422
  "warning",
417
423
  );
418
424
  } else {
419
- ctx.ui.notify(
420
- `@patimweb/pi-teams loaded (${card.account}${card.user ? ` as ${card.user}` : ""}, safety: ${card.safetyLevel})`,
421
- "info",
422
- );
425
+ const notice = buildStartupNotice(card, connection.watch);
426
+ ctx.ui.notify(notice.message, notice.level);
423
427
  }
424
428
 
425
429
  // Survives /reload, so the transcript keeps saying who pi is acting as.
package/src/status.ts CHANGED
@@ -90,6 +90,31 @@ export function buildConnectionLabel(card: ConnectionCard | undefined): string {
90
90
  return `✓ Teams · ${scope}${card.user ? ` · ${card.user}` : ""}${listening}`;
91
91
  }
92
92
 
93
+ /**
94
+ * The line a session starts with.
95
+ *
96
+ * It names listen mode on purpose. The watcher starts from the saved setting, so
97
+ * a session can begin polling — and answering in your name — without the
98
+ * transcript ever saying so, which is how a listener nobody remembers starting
99
+ * turns up, and how it gets to answer before anyone notices.
100
+ *
101
+ * The level is part of the answer: being listened to is the state worth a louder
102
+ * notice, not the ordinary one of it being off.
103
+ */
104
+ export function buildStartupNotice(
105
+ card: ConnectionCard,
106
+ watch: { enabled: boolean; intervalSeconds: number },
107
+ ): { message: string; level: "info" | "warning" } {
108
+ const identity = `@patimweb/pi-teams loaded (${card.account}${card.user ? ` as ${card.user}` : ""}, safety: ${card.safetyLevel})`;
109
+
110
+ if (!watch.enabled) return { message: `${identity} · listen mode off`, level: "info" };
111
+
112
+ return {
113
+ message: `${identity} · listen mode ON — every ${watch.intervalSeconds} s, /teams-listen off to stop`,
114
+ level: "warning",
115
+ };
116
+ }
117
+
93
118
  /** Rich markdown for `/teams-status` and the expanded card. */
94
119
  export function formatStatusText(card: ConnectionCard | undefined): string {
95
120
  if (!card) {