mcp-newoutlook 0.26.0 → 0.28.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.
@@ -0,0 +1,159 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RETRIED = exports.LAUNCHER_FILE = exports.LAUNCHER_FORMAT = void 0;
4
+ exports.packageDir = packageDir;
5
+ exports.isValidVersion = isValidVersion;
6
+ exports.compareVersions = compareVersions;
7
+ exports.installedVersions = installedVersions;
8
+ exports.readPointer = readPointer;
9
+ exports.atomicWrite = atomicWrite;
10
+ exports.writePointer = writePointer;
11
+ exports.resolveVersion = resolveVersion;
12
+ exports.main = main;
13
+ // The launcher (#launcher). setup copies dist/launch.cjs to ~/.mcp-newoutlook/launch.cjs and
14
+ // registers `<node> <home>/launch.cjs` in every AI app. It starts the version the `current`
15
+ // pointer names, from versions/<v>/node_modules/mcp-newoutlook, without touching the network.
16
+ //
17
+ // CommonJS with Node built-ins only: it sits alone in the store and must run on Node 20. The
18
+ // .cjs name keeps it CommonJS even when a parent folder's package.json says "type": "module"
19
+ // (Node looks that up in every parent, and a home folder can have one). The server imports the
20
+ // store functions from here too.
21
+ //
22
+ // It runs the version in this same process (import(), not spawn): an AI app on Windows ends a
23
+ // server by killing its pid, which would orphan a child still holding the stdio handles and,
24
+ // as the hub, the bridge port.
25
+ const node_fs_1 = require("node:fs");
26
+ const node_path_1 = require("node:path");
27
+ const node_url_1 = require("node:url");
28
+ /** The layout of the store and the pointer this launcher understands. */
29
+ exports.LAUNCHER_FORMAT = 1;
30
+ /** The launcher's file name in the store, the one registered in the AI apps. */
31
+ exports.LAUNCHER_FILE = "launch.cjs";
32
+ const VERSION_RE = /^\d+\.\d+\.\d+$/;
33
+ /** Where version v of the package is installed. */
34
+ function packageDir(home, v) {
35
+ return (0, node_path_1.join)(home, "versions", v, "node_modules", "mcp-newoutlook");
36
+ }
37
+ /** True when v is an x.y.z version whose install is complete (its package.json agrees, dist/index.js exists). */
38
+ function isValidVersion(home, v) {
39
+ if (!VERSION_RE.test(v))
40
+ return false;
41
+ const dir = packageDir(home, v);
42
+ try {
43
+ if (JSON.parse((0, node_fs_1.readFileSync)((0, node_path_1.join)(dir, "package.json"), "utf8")).version !== v)
44
+ return false;
45
+ }
46
+ catch {
47
+ return false;
48
+ }
49
+ return (0, node_fs_1.existsSync)((0, node_path_1.join)(dir, "dist", "index.js"));
50
+ }
51
+ /** Compares x.y.z versions: negative when a is older than b, 0 when equal, positive when newer. */
52
+ function compareVersions(a, b) {
53
+ const x = a.split(".").map(Number);
54
+ const y = b.split(".").map(Number);
55
+ for (let i = 0; i < 3; i++)
56
+ if (x[i] !== y[i])
57
+ return x[i] - y[i];
58
+ return 0;
59
+ }
60
+ /** The complete installed versions, newest first. An install in progress (<v>.tmp) is never one. */
61
+ function installedVersions(home) {
62
+ let names;
63
+ try {
64
+ names = (0, node_fs_1.readdirSync)((0, node_path_1.join)(home, "versions"));
65
+ }
66
+ catch {
67
+ return [];
68
+ }
69
+ return names.filter((v) => !v.endsWith(".tmp") && isValidVersion(home, v)).sort((a, b) => compareVersions(b, a));
70
+ }
71
+ /**
72
+ * The `current` pointer, or null when it is missing or unusable (e.g. cut short), or written by
73
+ * a newer launcher in a format this one doesn't know.
74
+ */
75
+ function readPointer(home) {
76
+ try {
77
+ const p = JSON.parse((0, node_fs_1.readFileSync)((0, node_path_1.join)(home, "current"), "utf8"));
78
+ if (typeof p !== "object" || p === null || typeof p.version !== "string")
79
+ return null;
80
+ if (!(Number(p.format) <= exports.LAUNCHER_FORMAT))
81
+ return null;
82
+ return { format: Number(p.format), version: p.version, previous: typeof p.previous === "string" ? p.previous : null };
83
+ }
84
+ catch {
85
+ return null;
86
+ }
87
+ }
88
+ /** The rename errors worth retrying on Windows: the file or folder is open elsewhere for a moment. */
89
+ exports.RETRIED = new Set(["EPERM", "EBUSY", "EACCES"]);
90
+ const sleepSync = (ms) => Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, ms);
91
+ /**
92
+ * Replaces path with text so that a reader sees either the old file or the new one, never a
93
+ * part: a temp file next to it, then a rename. Windows refuses the rename while antivirus or
94
+ * another start has the file open, so that is retried (up to 5 times).
95
+ * The waits between tries block (up to 750 ms in all): fine for the launcher, setup or a
96
+ * rollback, not for a running server, which needs an async variant.
97
+ */
98
+ function atomicWrite(path, text, deps = {}) {
99
+ const rename = deps.rename ?? node_fs_1.renameSync;
100
+ const tmp = `${path}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;
101
+ for (let attempt = 0;; attempt++) {
102
+ try {
103
+ // In the try, so a write cut short (e.g. a full disk) also removes its temp file.
104
+ if (attempt === 0)
105
+ (0, node_fs_1.writeFileSync)(tmp, text);
106
+ rename(tmp, path);
107
+ return;
108
+ }
109
+ catch (err) {
110
+ if (attempt >= 5 || !exports.RETRIED.has(err.code ?? "")) {
111
+ try {
112
+ (0, node_fs_1.unlinkSync)(tmp);
113
+ }
114
+ catch {
115
+ // already gone
116
+ }
117
+ throw err;
118
+ }
119
+ sleepSync(50 * (attempt + 1));
120
+ }
121
+ }
122
+ }
123
+ function writePointer(home, p) {
124
+ atomicWrite((0, node_path_1.join)(home, "current"), JSON.stringify(p));
125
+ }
126
+ /** The version to start: the pointer's when it is installed and complete, else the newest one that is. */
127
+ function resolveVersion(home) {
128
+ const pointer = readPointer(home);
129
+ if (pointer && isValidVersion(home, pointer.version))
130
+ return { version: pointer.version, source: "current" };
131
+ const newest = installedVersions(home)[0];
132
+ return newest ? { version: newest, source: "fallback" } : null;
133
+ }
134
+ /**
135
+ * Starts the resolved version: `hub <args>` runs its dist/hub.js (the native-messaging host),
136
+ * anything else its dist/index.js with all of argv. Both read process.argv[2] when they load,
137
+ * so argv is rewritten to look as if that file had been started directly.
138
+ */
139
+ async function main(argv, home = process.env.NEWOUTLOOK_MCP_HOME ?? __dirname) {
140
+ const found = resolveVersion(home);
141
+ if (!found) {
142
+ process.stderr.write(`mcp-newoutlook: nothing installed in ${(0, node_path_1.join)(home, "versions")}. Run: npx mcp-newoutlook setup\n`);
143
+ process.exit(1);
144
+ }
145
+ const hub = argv[0] === "hub";
146
+ const entry = (0, node_path_1.join)(packageDir(home, found.version), "dist", hub ? "hub.js" : "index.js");
147
+ process.env.NEWOUTLOOK_MCP_LAUNCHED = found.version;
148
+ process.argv = [process.execPath, entry, ...(hub ? argv.slice(1) : argv)];
149
+ await import((0, node_url_1.pathToFileURL)(entry).href);
150
+ }
151
+ // Only when run as the launcher; the server imports this file for the store functions. The
152
+ // typeof check is for tests, where vitest loads this file as ESM and there is no require.
153
+ if (typeof require !== "undefined" && require.main === module) {
154
+ main(process.argv.slice(2), process.env.NEWOUTLOOK_MCP_HOME ?? __dirname).catch((err) => {
155
+ process.stderr.write(`mcp-newoutlook: could not start: ${err?.stack ?? err}\n`);
156
+ process.exit(1);
157
+ });
158
+ }
159
+ //# sourceMappingURL=launch.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"launch.cjs","sourceRoot":"","sources":["../src/launch.cts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6FAA6F;AAC7F,4FAA4F;AAC5F,8FAA8F;AAC9F,EAAE;AACF,6FAA6F;AAC7F,6FAA6F;AAC7F,+FAA+F;AAC/F,iCAAiC;AACjC,EAAE;AACF,8FAA8F;AAC9F,6FAA6F;AAC7F,+BAA+B;AAC/B,qCAAuG;AACvG,yCAAiC;AACjC,uCAAyC;AAEzC,yEAAyE;AAC5D,QAAA,eAAe,GAAG,CAAC,CAAC;AAEjC,gFAAgF;AACnE,QAAA,aAAa,GAAG,YAAY,CAAC;AAS1C,MAAM,UAAU,GAAG,iBAAiB,CAAC;AAErC,mDAAmD;AACnD,oBAA2B,IAAY,EAAE,CAAS;IAChD,OAAO,IAAA,gBAAI,EAAC,IAAI,EAAE,UAAU,EAAE,CAAC,EAAE,cAAc,EAAE,gBAAgB,CAAC,CAAC;AACrE,CAAC;AAED,iHAAiH;AACjH,wBA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,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IAC1E,MAAM,MAAM,CAAC,IAAA,wBAAa,EAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC;AAC1C,CAAC;AAED,2FAA2F;AAC3F,0FAA0F;AAC1F,IAAI,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;IAC9D,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,GAAG,CAAC,mBAAmB,IAAI,SAAS,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;QACtF,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,oCAAqC,GAAa,EAAE,KAAK,IAAI,GAAG,IAAI,CAAC,CAAC;QAC3F,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,404 @@
1
+ // The installer (#launcher): puts a release into the launcher's store. npm installs it into
2
+ // versions/<v>.tmp, an isolated selftest checks it, and only then is it renamed to versions/<v>
3
+ // and made current, so a start never sees a half-installed version. When to update is
4
+ // autoupdate.ts's job; this file only knows how.
5
+ import { execFile } from "node:child_process";
6
+ import { closeSync, cpSync, existsSync, mkdirSync, mkdtempSync, openSync, readFileSync, renameSync, rmSync, statSync, unlinkSync, writeSync } from "node:fs";
7
+ import { createServer } from "node:net";
8
+ import { tmpdir } from "node:os";
9
+ import { basename, dirname, isAbsolute, join, posix, relative, win32 } from "node:path";
10
+ import { Client } from "@modelcontextprotocol/sdk/client/index.js";
11
+ import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
12
+ import { atomicWrite, compareVersions, installedVersions, isValidVersion, LAUNCHER_FILE, LAUNCHER_FORMAT, packageDir, readPointer, RETRIED, writePointer } from "./launch.cjs";
13
+ /**
14
+ * npm's own script, run with this Node (never npm.cmd: Windows refuses to spawn a .cmd without
15
+ * a shell, and an AI app started from the GUI has no PATH). Next to node.exe on Windows, in
16
+ * ../lib/node_modules on macOS and Linux. Null when npm isn't there: updates are then off.
17
+ */
18
+ export function findNpmCli(execPath = process.execPath, exists = existsSync) {
19
+ // By the path's own shape, so that both cases can be checked on any platform.
20
+ const path = execPath.includes("\\") ? win32 : posix;
21
+ const dir = path.dirname(execPath);
22
+ const candidates = [path.join(dir, "node_modules", "npm", "bin", "npm-cli.js"), path.join(dir, "..", "lib", "node_modules", "npm", "bin", "npm-cli.js")];
23
+ return candidates.find((p) => exists(p)) ?? null;
24
+ }
25
+ /**
26
+ * Whether this Node meets a release's engines.node. Only `>=X[.Y[.Z]]` is understood (what this
27
+ * package has always declared); anything else counts as met, rather than pulling in semver.
28
+ */
29
+ export function satisfiesEngines(range, nodeVersion = process.versions.node) {
30
+ const m = range?.trim().match(/^>=\s*(\d+)(?:\.(\d+))?(?:\.(\d+))?$/);
31
+ if (!m)
32
+ return true;
33
+ return compareVersions(nodeVersion, [m[1], m[2] ?? "0", m[3] ?? "0"].join(".")) >= 0;
34
+ }
35
+ /** A lock this old belongs to a process that died while installing: it is broken. */
36
+ export const LOCK_STALE_MS = 10 * 60_000;
37
+ /**
38
+ * Takes update/lock, so that of the servers that reach the update check at the same moment
39
+ * exactly one installs. Returns the function that releases it, or null when another process
40
+ * holds it. A lock older than LOCK_STALE_MS (by the time in it, or by its age on disk when it
41
+ * can't be read) is broken.
42
+ *
43
+ * Several servers may find the same stale lock. If each deleted it, a late one would delete the
44
+ * fresh lock an earlier one had just made. Moving the lock aside to look at it has the same
45
+ * gap: while a fresh lock is away, a third server can create its own. So breaking is itself
46
+ * exclusive (lock.break, created with "wx"): the one breaker reads the lock again and replaces
47
+ * it only if it still holds the stale text it saw. The others give up for this round.
48
+ */
49
+ export function acquireLock(home, now = Date.now()) {
50
+ const file = join(home, "update", "lock");
51
+ mkdirSync(dirname(file), { recursive: true });
52
+ const text = JSON.stringify({ pid: process.pid, time: now });
53
+ const release = () => {
54
+ // Only our own: after ours was broken as stale, the file may be someone else's.
55
+ try {
56
+ if (readFileSync(file, "utf8") === text)
57
+ unlinkSync(file);
58
+ }
59
+ catch {
60
+ // already gone
61
+ }
62
+ };
63
+ if (createLock(file, text))
64
+ return release;
65
+ const seen = readLock(file);
66
+ if (seen === null || now - seen.time <= LOCK_STALE_MS)
67
+ return null;
68
+ const breaker = `${file}.break`;
69
+ if (!createLock(breaker, text)) {
70
+ // Left by a server that died while breaking (it takes microseconds): removed for the next round.
71
+ if (Date.now() - statMtime(breaker) > BREAK_STALE_MS)
72
+ rmSync(breaker, { force: true });
73
+ return null;
74
+ }
75
+ try {
76
+ const current = readLock(file);
77
+ if (current && current.text !== seen.text)
78
+ return null; // someone else's fresh lock
79
+ rmSync(file, { force: true });
80
+ return createLock(file, text) ? release : null;
81
+ }
82
+ finally {
83
+ rmSync(breaker, { force: true });
84
+ }
85
+ }
86
+ /** A lock.break older than this was left by a server that died while breaking a stale lock. */
87
+ const BREAK_STALE_MS = 10_000;
88
+ /** When file was last written; now when it is gone. */
89
+ const statMtime = (file) => {
90
+ try {
91
+ return statSync(file).mtimeMs;
92
+ }
93
+ catch {
94
+ return Date.now();
95
+ }
96
+ };
97
+ /** Creates the lock file holding text; false when one exists. */
98
+ function createLock(file, text) {
99
+ let fd;
100
+ try {
101
+ fd = openSync(file, "wx");
102
+ }
103
+ catch (err) {
104
+ if (err.code === "EEXIST")
105
+ return false;
106
+ throw err;
107
+ }
108
+ try {
109
+ writeSync(fd, text);
110
+ }
111
+ finally {
112
+ closeSync(fd);
113
+ }
114
+ return true;
115
+ }
116
+ /** A lock file's text and time (its age on disk when the time can't be read), or null when it is gone. */
117
+ function readLock(file) {
118
+ try {
119
+ const text = readFileSync(file, "utf8");
120
+ let time;
121
+ try {
122
+ time = JSON.parse(text).time;
123
+ }
124
+ catch {
125
+ time = undefined;
126
+ }
127
+ return { text, time: typeof time === "number" ? time : statSync(file).mtimeMs };
128
+ }
129
+ catch {
130
+ return null;
131
+ }
132
+ }
133
+ const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
134
+ /**
135
+ * Renames the finished install into place. Windows refuses while antivirus (or the search
136
+ * indexer) has a file in the new folder open, so that is retried: 8 tries, waiting 250 ms
137
+ * doubling up to 2 s (about 10 s in all). If it still fails, the caller leaves the .tmp folder
138
+ * for the next attempt, which removes it and starts again.
139
+ */
140
+ export async function renameWithRetry(from, to, opts = {}) {
141
+ const { tries = 8, delayMs = 250, rename = renameSync } = opts;
142
+ for (let attempt = 1;; attempt++) {
143
+ try {
144
+ rename(from, to);
145
+ return;
146
+ }
147
+ catch (err) {
148
+ if (attempt >= tries || !RETRIED.has(err.code ?? ""))
149
+ throw err;
150
+ await sleep(Math.min(delayMs * 2 ** (attempt - 1), 2_000));
151
+ }
152
+ }
153
+ }
154
+ /** A local port nobody listens on right now. */
155
+ function freePort() {
156
+ return new Promise((resolve, reject) => {
157
+ const srv = createServer();
158
+ srv.unref();
159
+ srv.on("error", reject);
160
+ srv.listen(0, "127.0.0.1", () => {
161
+ const { port } = srv.address();
162
+ srv.close(() => resolve(port));
163
+ });
164
+ });
165
+ }
166
+ /**
167
+ * Checks a freshly installed package before anything can start it: `index.js selftest` must
168
+ * answer initialize and tools/list. It runs isolated (SELFTEST_ENV in config.ts): a temporary
169
+ * home, a free port and an unused hub socket, so that even a version without the selftest
170
+ * command, which starts its bridge instead, can't reach the user's hub or extension folder.
171
+ * Never throws.
172
+ */
173
+ export async function runSelftest(pkgDir, opts = {}) {
174
+ const { timeoutMs = 20_000, rm = rmSync } = opts;
175
+ // Short: a Unix socket path is limited to about 100 bytes.
176
+ const home = mkdtempSync(join(tmpdir(), "mno-st-"));
177
+ const socket = process.platform === "win32" ? `\\\\.\\pipe\\${basename(home)}` : join(home, "hub.sock");
178
+ const { NEWOUTLOOK_MCP_LAUNCHED: _, ...inherited } = process.env;
179
+ const isolated = { NEWOUTLOOK_MCP_HOME: home, NEWOUTLOOK_MCP_PORT: String(await freePort()), NEWOUTLOOK_MCP_HUB_SOCKET: socket, NEWOUTLOOK_MCP_NO_UPDATE: "1" };
180
+ const transport = new StdioClientTransport({ command: process.execPath, args: [join(pkgDir, "dist", "index.js"), "selftest"], env: { ...inherited, ...isolated }, stderr: "pipe" });
181
+ let stderr = "";
182
+ transport.stderr?.on("data", (d) => (stderr = (stderr + d).slice(-500)));
183
+ const client = new Client({ name: "mcp-newoutlook-updater", version: "0" });
184
+ let timer;
185
+ try {
186
+ const timedOut = new Promise((_, reject) => (timer = setTimeout(() => reject(new Error(`no answer within ${timeoutMs} ms`)), timeoutMs)));
187
+ const check = async () => {
188
+ await client.connect(transport, { timeout: timeoutMs });
189
+ return (await client.listTools(undefined, { timeout: timeoutMs })).tools.length;
190
+ };
191
+ return { ok: true, tools: await Promise.race([check(), timedOut]) };
192
+ }
193
+ catch (err) {
194
+ return { ok: false, error: `${err.message}${stderr.trim() ? `; stderr: ${stderr.trim()}` : ""}` };
195
+ }
196
+ finally {
197
+ clearTimeout(timer);
198
+ await client.close().catch(() => { });
199
+ try {
200
+ rm(home, { recursive: true, force: true, maxRetries: 5 });
201
+ }
202
+ catch {
203
+ // still held (antivirus, the exiting child): a few KB left in the temp folder
204
+ }
205
+ }
206
+ }
207
+ /** Runs npm's own script with this Node, never through a shell. Rejects with the end of its stderr. */
208
+ function npm(npmCli, args, timeoutMs) {
209
+ return new Promise((resolve, reject) => {
210
+ execFile(process.execPath, [npmCli, ...args], { timeout: timeoutMs, windowsHide: true, maxBuffer: 16 * 1024 * 1024 }, (err, stdout, stderr) => {
211
+ if (err)
212
+ reject(new Error(`npm ${args[0]} failed: ${(String(stderr).trim() || err.message).slice(-500)}`));
213
+ else
214
+ resolve(String(stdout));
215
+ });
216
+ });
217
+ }
218
+ /**
219
+ * The release npm's `latest` dist-tag names. Asked through npm, not fetch, so the user's .npmrc
220
+ * registry and proxy apply, as they do to the install that follows.
221
+ */
222
+ export async function latestVersion(npmCli, opts = {}) {
223
+ const out = await npm(npmCli, ["view", "mcp-newoutlook", "dist-tags.latest", "--json"], opts.timeoutMs ?? 30_000);
224
+ let v;
225
+ try {
226
+ v = JSON.parse(out);
227
+ }
228
+ catch {
229
+ v = undefined;
230
+ }
231
+ if (typeof v !== "string" || !/^\d+\.\d+\.\d+$/.test(v))
232
+ throw new Error(`npm view: not a version: ${out.trim().slice(0, 100)}`);
233
+ return v;
234
+ }
235
+ /** How long one npm install may take (a slow proxy, a cold cache). */
236
+ const INSTALL_TIMEOUT_MS = 5 * 60_000;
237
+ /**
238
+ * The steps every way into the store shares: fill versions/<v>.tmp, check what is there, rename
239
+ * it to versions/<v>. Leftovers of an interrupted attempt go first: a stale .tmp, and an
240
+ * incomplete versions/<v> (never started, since it isn't valid), renamed to the .tmp name and
241
+ * removed as prune does. On any failure it throws, and there is no versions/<v>; a rename that
242
+ * still fails after its retries leaves the .tmp folder for the next attempt.
243
+ */
244
+ async function stageVersion(home, v, fill, selftest) {
245
+ const dest = join(home, "versions", v);
246
+ const tmp = `${dest}.tmp`;
247
+ rmSync(tmp, { recursive: true, force: true, maxRetries: 3 });
248
+ if (existsSync(dest)) {
249
+ await renameWithRetry(dest, tmp);
250
+ rmSync(tmp, { recursive: true, force: true, maxRetries: 3 });
251
+ }
252
+ try {
253
+ await fill(tmp);
254
+ await checkCandidate(join(tmp, "node_modules", "mcp-newoutlook"), v, selftest);
255
+ }
256
+ catch (err) {
257
+ rmSync(tmp, { recursive: true, force: true, maxRetries: 3 });
258
+ throw err;
259
+ }
260
+ await renameWithRetry(tmp, dest);
261
+ }
262
+ /**
263
+ * Installs release v into versions/<v> through npm, into versions/<v>.tmp first, then the
264
+ * check, the isolated selftest and the rename (stageVersion). An installed version is never
265
+ * overwritten: servers may be running from it. It doesn't switch the pointer (switchTo) and
266
+ * doesn't take the lock: the caller holds acquireLock around it.
267
+ */
268
+ export async function installVersion(home, v, deps) {
269
+ if (isValidVersion(home, v))
270
+ return;
271
+ await stageVersion(home, v, async (tmp) => {
272
+ mkdirSync(tmp, { recursive: true });
273
+ await npm(deps.npmCli, ["install", "--prefix", tmp, `mcp-newoutlook@${v}`, "--ignore-scripts", "--omit=dev", "--no-audit", "--no-fund", ...(deps.npmArgs ?? [])], INSTALL_TIMEOUT_MS);
274
+ }, deps.selftest ?? runSelftest);
275
+ }
276
+ const readPackageJson = (dir) => JSON.parse(readFileSync(join(dir, "package.json"), "utf8"));
277
+ /** Where Node finds package `name` when a file in dir requires it: dir's node_modules, then each parent's. */
278
+ function resolvePackage(name, dir) {
279
+ for (let d = dir;; d = dirname(d)) {
280
+ const candidate = join(d, "node_modules", name);
281
+ if (basename(d) !== "node_modules" && existsSync(join(candidate, "package.json")))
282
+ return candidate;
283
+ if (dirname(d) === d)
284
+ return null;
285
+ }
286
+ }
287
+ /**
288
+ * Puts the copy of version v that is running right now (e.g. from npx's cache) into the store,
289
+ * so the first start through the launcher needs no download. It copies packageRoot (without
290
+ * its node_modules) and the packages its dependencies need, each found the way Node would find
291
+ * it from there, keeping their nesting. Never a whole node_modules: npx's and a global one hold
292
+ * unrelated packages. Then the same check as an install, and the rename (stageVersion).
293
+ * "incomplete" when a required dependency isn't there, or packageRoot isn't inside a
294
+ * node_modules folder (a clone, which the updater never touches); the caller then installs
295
+ * through npm.
296
+ */
297
+ export async function seedFromRunningCopy(home, packageRoot, v, deps = {}) {
298
+ if (isValidVersion(home, v))
299
+ return "present";
300
+ // The node_modules folder packageRoot sits in: positions in the copy are relative to it.
301
+ const top = dirname(packageRoot);
302
+ if (basename(top) !== "node_modules")
303
+ return "incomplete";
304
+ const copies = new Map([[packageRoot, "mcp-newoutlook"]]); // source folder → path under the new node_modules
305
+ const queue = [packageRoot];
306
+ while (queue.length) {
307
+ const from = queue.shift();
308
+ const json = readPackageJson(from);
309
+ const optional = new Set([...Object.keys(json.optionalDependencies ?? {}), ...Object.entries(json.peerDependenciesMeta ?? {}).filter(([, m]) => m.optional).map(([n]) => n)]);
310
+ for (const name of new Set([...Object.keys(json.dependencies ?? {}), ...Object.keys(json.optionalDependencies ?? {}), ...Object.keys(json.peerDependencies ?? {})])) {
311
+ const found = resolvePackage(name, from);
312
+ if (!found) {
313
+ if (optional.has(name))
314
+ continue;
315
+ return "incomplete";
316
+ }
317
+ if (copies.has(found))
318
+ continue;
319
+ const rel = relative(top, found);
320
+ // Found above npx's folder (rare): it goes to the top, unless something else is there already.
321
+ const at = rel.startsWith("..") || isAbsolute(rel) ? name : rel;
322
+ if ([...copies.values()].includes(at))
323
+ return "incomplete";
324
+ copies.set(found, at);
325
+ queue.push(found);
326
+ }
327
+ }
328
+ const fill = (tmp) => {
329
+ for (const [from, at] of copies) {
330
+ const own = join(from, "node_modules");
331
+ cpSync(from, join(tmp, "node_modules", at), { recursive: true, dereference: true, filter: (src) => src !== own });
332
+ }
333
+ };
334
+ await stageVersion(home, v, fill, deps.selftest ?? runSelftest);
335
+ return "seeded";
336
+ }
337
+ /** Throws unless dir holds a complete package of version v that runs on this Node and passes the selftest. */
338
+ async function checkCandidate(dir, v, selftest) {
339
+ let pkg;
340
+ try {
341
+ pkg = readPackageJson(dir);
342
+ }
343
+ catch {
344
+ throw new Error(`mcp-newoutlook ${v}: no package.json in ${dir}`);
345
+ }
346
+ if (pkg.version !== v)
347
+ throw new Error(`mcp-newoutlook ${v}: version mismatch, got ${pkg.version}`);
348
+ if (!existsSync(join(dir, "dist", "index.js")))
349
+ throw new Error(`mcp-newoutlook ${v}: dist/index.js is missing`);
350
+ if (!satisfiesEngines(pkg.engines?.node))
351
+ throw new Error(`mcp-newoutlook ${v} needs Node ${pkg.engines?.node}, this is ${process.versions.node}`);
352
+ const result = await selftest(dir);
353
+ if (!result.ok)
354
+ throw new Error(`mcp-newoutlook ${v}: selftest failed: ${result.error}`);
355
+ }
356
+ /**
357
+ * Makes installed version v the one the next start runs. Its launcher is installed first, so a
358
+ * pointer in a newer format is never read by an older launcher; then the pointer, with the
359
+ * version it replaces as previous (the rollback target). Both are atomic writes.
360
+ */
361
+ export function switchTo(home, v) {
362
+ if (!isValidVersion(home, v))
363
+ throw new Error(`mcp-newoutlook ${v} is not installed in ${join(home, "versions")}`);
364
+ atomicWrite(join(home, LAUNCHER_FILE), readFileSync(join(packageDir(home, v), "dist", LAUNCHER_FILE), "utf8"));
365
+ const old = readPointer(home);
366
+ const previous = old && old.version !== v ? old.version : (old?.previous ?? null);
367
+ writePointer(home, { format: LAUNCHER_FORMAT, version: v, previous });
368
+ }
369
+ /**
370
+ * Removes the installed versions older than both the current one and the previous one (the
371
+ * rollback target), and returns them. Never the current or previous version, nor one isInUse
372
+ * says a server is still starting from. Without a pointer, or without a previous version,
373
+ * nothing is removed. Each folder is first renamed to <v>.tmp, which no start ever picks, so a
374
+ * start never sees one half-deleted; a folder that can't be renamed (in use) is kept.
375
+ */
376
+ export function prune(home, isInUse = () => false) {
377
+ const pointer = readPointer(home);
378
+ if (!pointer?.previous)
379
+ return [];
380
+ const floor = compareVersions(pointer.previous, pointer.version) < 0 ? pointer.previous : pointer.version;
381
+ const removed = [];
382
+ for (const v of installedVersions(home)) {
383
+ if (compareVersions(v, floor) >= 0 || isInUse(v))
384
+ continue;
385
+ const dir = join(home, "versions", v);
386
+ const doomed = `${dir}.tmp`;
387
+ try {
388
+ rmSync(doomed, { recursive: true, force: true });
389
+ renameSync(dir, doomed);
390
+ }
391
+ catch {
392
+ continue;
393
+ }
394
+ removed.push(v);
395
+ try {
396
+ rmSync(doomed, { recursive: true, force: true, maxRetries: 3 });
397
+ }
398
+ catch {
399
+ // left as <v>.tmp: never started, and removed by the next install of v
400
+ }
401
+ }
402
+ return removed;
403
+ }
404
+ //# sourceMappingURL=updater.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"updater.js","sourceRoot":"","sources":["../src/updater.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,gGAAgG;AAChG,sFAAsF;AACtF,iDAAiD;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAA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5zz0AZEPSH7ldcAI2dHkmxuFh85k1cJJjWYEHikXc+ibTv9n1OfGbt/BzV/+QpMjbpJGmnJJrzCEqjw0WOyoabtpRKympl/jshjA5Kp+avlUvEYse12QIDAQAB",
4
4
  "name": "mcp-newoutlook bridge",
5
- "version": "0.26.0",
5
+ "version": "0.28.0",
6
6
  "description": "Lets AI assistants (via the mcp-newoutlook MCP server) read, search, draft and — with your explicit confirmation — send mail in New Outlook.",
7
7
  "minimum_chrome_version": "116",
8
8
  "icons": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcp-newoutlook",
3
- "version": "0.26.0",
3
+ "version": "0.28.0",
4
4
  "description": "MCP server that lets AI assistants work with New Outlook (web) through a Chrome/Edge extension bridge",
5
5
  "keywords": ["mcp", "model-context-protocol", "outlook", "office365", "email", "calendar", "claude", "chrome-extension"],
6
6
  "repository": {