mcp-teams 0.3.41 → 0.3.43

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/README.md CHANGED
@@ -98,7 +98,7 @@ The browser clears that memory when the extension is reloaded or updated. A Team
98
98
 
99
99
  Every AI session starts its own mcp-teams server, and they share the one extension connection. The first server owns the bridge port (`role: "hub"` in `get_version`), and later ones forward their calls through it (`role: "peer"`). When the hub's session ends, a peer takes over within a second. A newer server takes over from an older one. Servers of 0.2.0 and older can't do the newer handshake: after updating from them, restart AI sessions that are still open (in Claude Code: `/mcp`).
100
100
 
101
- A server that is already running keeps its code when the copy on disk changes (`git pull` and `npm run build`). It notices: `get_version` then shows `restartNeeded: true` with the build on disk, and every failed tool call ends with a line saying to reconnect it with `/mcp` and reload the extension.
101
+ A server that is already running keeps its code when the copy on disk changes (`git pull` and `npm run build`). It notices: `get_version` then shows `restartNeeded: true` with the build on disk, and every failed tool call ends with a line saying to reconnect it with `/mcp` and reload the extension. It compares its version and build id with those in `dist/build.json` on disk. The build id is a hash of the server code (`dist/**/*.js`) and of the extension it ships (`extension/`, without the `pairing.json` that only the installed copy has). So a release that changes only the extension counts as a new build too, and a rebuild that changes nothing doesn't. The same files give the same build id on Windows and Linux.
102
102
 
103
103
  ## Configuration
104
104
 
package/dist/build.json CHANGED
@@ -1,4 +1,4 @@
1
1
  {
2
- "version": "0.3.41",
3
- "buildId": "b80780726765"
2
+ "version": "0.3.43",
3
+ "buildId": "08927041e6f2"
4
4
  }
package/dist/buildInfo.js CHANGED
@@ -27,7 +27,7 @@ export const BUILD_CHECK_CACHE_MS = 5_000;
27
27
  /**
28
28
  * Compares the running build with the one in `dir` on disk, read again when asked but at most once per
29
29
  * BUILD_CHECK_CACHE_MS (by `now`). A restart is needed when the two build ids differ (not "newer": any
30
- * other build), never when either has no id.
30
+ * other build) or their versions do (every release bumps it, #100), never when either has no id.
31
31
  */
32
32
  export function restartCheck(running, dir, now = Date.now) {
33
33
  let last;
@@ -41,7 +41,7 @@ export function restartCheck(running, dir, now = Date.now) {
41
41
  catch {
42
42
  return { restartNeeded: false };
43
43
  }
44
- return onDisk.buildId && onDisk.buildId !== running.buildId
44
+ return onDisk.buildId && (onDisk.buildId !== running.buildId || onDisk.version !== running.version)
45
45
  ? { restartNeeded: true, onDisk: { version: onDisk.version, build: onDisk.buildId } }
46
46
  : { restartNeeded: false };
47
47
  };
@@ -1 +1 @@
1
- {"version":3,"file":"buildInfo.js","sourceRoot":"","sources":["../src/buildInfo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AASjC;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,GAAW;IACvC,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,EAAE,YAAY,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;QACvE,IAAI,OAAO,IAAI,EAAE,OAAO,KAAK,QAAQ,IAAI,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ;YAAE,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC;IACrI,CAAC;IAAC,MAAM,CAAC;QACP,4CAA4C;IAC9C,CAAC;IACD,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,EAAE,cAAc,CAAC,EAAE,MAAM,CAAC,CAAwB,CAAC;IACrG,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AACjD,CAAC;AAKD,uFAAuF;AACvF,MAAM,UAAU,WAAW,CAAC,OAAkB,EAAE,KAAmB;IACjE,IAAI,CAAC,KAAK,CAAC,aAAa;QAAE,OAAO,IA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,YAAY,CAAC,OAAkB,EAAE,GAAW,EAAE,GAAG,GAAiB,IAAI,CAAC,GAAG;IACxF,IAAI,IAAqD,CAAC;IAC1D,MAAM,IAAI,GAAG,GAAiB,EAAE;QAC9B,IAAI,CAAC,OAAO,CAAC,OAAO;YAAE,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC;QACtD,IAAI,MAAiB,CAAC;QACtB,IAAI,CAAC;YACH,MAAM,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC;QAC9B,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC;QAClC,CAAC;QACD,OAAO,MAAM,CAAC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,KAAK,OAAO,CAAC,OAAO,IAAI,MAAM,CAAC,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC;YACjG,CAAC,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,OAAO,EAAE,EAAE;YACrF,CAAC,CAAC,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC;IAC/B,CAAC,CAAC;IACF,OAAO,GAAG,EAAE;QACV,MAAM,EAAE,GAAG,GAAG,EAAE,CAAC;QACjB,IAAI,CAAC,IAAI,IAAI,EAAE,GAAG,IAAI,CAAC,EAAE,IAAI,oBAAoB;YAAE,IAAI,GAAG,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC;QAChF,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC"}
@@ -1826,6 +1826,21 @@ function reconnectNow() {
1826
1826
  retryMs = RETRY_MIN_MS;
1827
1827
  }
1828
1828
 
1829
+ let reconnecting = true; // false only after stopReconnecting()
1830
+
1831
+ /**
1832
+ * For tests only (nothing in the extension calls it): the worker never connects again, and no
1833
+ * retry or watchdog is left waiting. A test's teardown calls it before the hub's connections end
1834
+ * and its fake chrome goes, since a retry would otherwise run connect() without chrome.
1835
+ */
1836
+ export function stopReconnecting() {
1837
+ reconnecting = false;
1838
+ clearTimeout(retryTimer);
1839
+ retryTimer = null;
1840
+ clearTimeout(watchdog?.timer);
1841
+ watchdog = null;
1842
+ }
1843
+
1829
1844
  /**
1830
1845
  * The pairing token: one saved under Advanced, else the one setup wrote into this
1831
1846
  * folder (pairing.json, only in the installed copy). Null when there is none.
@@ -1847,7 +1862,7 @@ async function pairingToken(saved) {
1847
1862
  * the port gets nothing.
1848
1863
  */
1849
1864
  async function connect() {
1850
- if (starting || (ws && (ws.readyState === WebSocket.OPEN || ws.readyState === WebSocket.CONNECTING))) return;
1865
+ if (!reconnecting || starting || (ws && (ws.readyState === WebSocket.OPEN || ws.readyState === WebSocket.CONNECTING))) return;
1851
1866
  clearTimeout(retryTimer);
1852
1867
  retryTimer = null;
1853
1868
  starting = true;
@@ -1863,7 +1878,8 @@ async function connect() {
1863
1878
  } finally {
1864
1879
  starting = false;
1865
1880
  }
1866
- if (ws) return;
1881
+ // stopReconnecting() may have run while the storage read was waiting.
1882
+ if (ws || !reconnecting) return;
1867
1883
  state = "connecting";
1868
1884
  const socket = new WebSocket(`ws://127.0.0.1:${port || DEFAULT_PORT}`);
1869
1885
  ws = socket;
@@ -1932,7 +1948,7 @@ async function connect() {
1932
1948
  // When a server session ends, another one takes over the port within a second:
1933
1949
  // retry soon, backing off to the alarm's pace.
1934
1950
  clearTimeout(retryTimer);
1935
- retryTimer = setTimeout(connect, retryMs);
1951
+ retryTimer = reconnecting ? setTimeout(connect, retryMs) : null;
1936
1952
  retryMs = Math.min(retryMs * 2, RETRY_MAX_MS);
1937
1953
  if (state === "unauthorized" && !authed && lastError) {
1938
1954
  // refuse() said why.
@@ -2,7 +2,7 @@
2
2
  "manifest_version": 3,
3
3
  "key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvoz9Wexl4ZqY9YtEyBZsu/Qi5Ft5EjNUNB8b30wgt3AR8TjXI5UumcPQFBIm7ZfvBsjgrh6tBJlygsgFbZ5cB1EiI+WSz/2Wcqwz4eowKMXXPvGuDGrO+2O2zbSpTG19/MwTljI+g0TLfn8Vkoqd8z9MskKk+vCZjjV0Jk8QjVEdHypgM7H8zTuUM06SO12IIZMdeE3IURzf35zbjlfPPkJiDWoo3wB9nxAvLd57xrQhPUB/lGtCJk9mS3SY+/VwOlG5kJ9WS/RCHXcs5Qs7huIlKIatmFz7YiducvTR3DKBbjqbMTyqHzXkmkUmJRqzsYtgtKcz0C0cjFOt6uNdhwIDAQAB",
4
4
  "name": "mcp-teams bridge",
5
- "version": "0.3.41",
5
+ "version": "0.3.43",
6
6
  "description": "Lets AI assistants (via the mcp-teams MCP server) read and search Microsoft Teams chats, channels and meeting transcripts and, with your explicit confirmation, post messages.",
7
7
  "minimum_chrome_version": "116",
8
8
  "icons": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcp-teams",
3
- "version": "0.3.41",
3
+ "version": "0.3.43",
4
4
  "description": "MCP server that lets AI assistants work with Microsoft Teams (web) through a Chrome/Edge extension bridge",
5
5
  "keywords": ["mcp", "model-context-protocol", "teams", "microsoft-teams", "microsoft-365", "chat", "claude", "chrome-extension"],
6
6
  "repository": {