@mathismeadows/roamer-device-auth 1.5.7 → 1.5.9

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,24 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>CFBundleDisplayName</key>
6
+ <string>Roamer MCP</string>
7
+ <key>CFBundleExecutable</key>
8
+ <string>roamer-mcp-notifier</string>
9
+ <key>CFBundleIdentifier</key>
10
+ <string>com.mathismeadows.roamer-mcp.notifier.v4</string>
11
+ <key>CFBundleIconFile</key>
12
+ <string>roamer-mcp-v4.icns</string>
13
+ <key>CFBundleName</key>
14
+ <string>Roamer MCP</string>
15
+ <key>CFBundlePackageType</key>
16
+ <string>APPL</string>
17
+ <key>CFBundleShortVersionString</key>
18
+ <string>1.0</string>
19
+ <key>CFBundleVersion</key>
20
+ <string>4</string>
21
+ <key>LSUIElement</key>
22
+ <true/>
23
+ </dict>
24
+ </plist>
@@ -0,0 +1,150 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>files</key>
6
+ <dict>
7
+ <key>Resources/roamer-mcp-icon-v2.png</key>
8
+ <data>
9
+ 2dM6CEL1wlYNq4xt+ecVt+BHGGE=
10
+ </data>
11
+ <key>Resources/roamer-mcp-v4.icns</key>
12
+ <data>
13
+ cQdIamkBe9J4DyIwSJnoMbrgdL4=
14
+ </data>
15
+ <key>Resources/roamer-mcp.icns</key>
16
+ <data>
17
+ cQdIamkBe9J4DyIwSJnoMbrgdL4=
18
+ </data>
19
+ </dict>
20
+ <key>files2</key>
21
+ <dict>
22
+ <key>Resources/roamer-mcp-icon-v2.png</key>
23
+ <dict>
24
+ <key>hash2</key>
25
+ <data>
26
+ MWFb39dsRLKc+Q+xfVR6joPIp/MVngghyYXAYyTUEQg=
27
+ </data>
28
+ </dict>
29
+ <key>Resources/roamer-mcp-v4.icns</key>
30
+ <dict>
31
+ <key>hash2</key>
32
+ <data>
33
+ qx5IaaBZH5kHBh1t8Kb0XEpXM51aRZuMOvBIbQLqKsQ=
34
+ </data>
35
+ </dict>
36
+ <key>Resources/roamer-mcp.icns</key>
37
+ <dict>
38
+ <key>hash2</key>
39
+ <data>
40
+ qx5IaaBZH5kHBh1t8Kb0XEpXM51aRZuMOvBIbQLqKsQ=
41
+ </data>
42
+ </dict>
43
+ </dict>
44
+ <key>rules</key>
45
+ <dict>
46
+ <key>^Resources/</key>
47
+ <true/>
48
+ <key>^Resources/.*\.lproj/</key>
49
+ <dict>
50
+ <key>optional</key>
51
+ <true/>
52
+ <key>weight</key>
53
+ <real>1000</real>
54
+ </dict>
55
+ <key>^Resources/.*\.lproj/locversion.plist$</key>
56
+ <dict>
57
+ <key>omit</key>
58
+ <true/>
59
+ <key>weight</key>
60
+ <real>1100</real>
61
+ </dict>
62
+ <key>^Resources/Base\.lproj/</key>
63
+ <dict>
64
+ <key>weight</key>
65
+ <real>1010</real>
66
+ </dict>
67
+ <key>^version.plist$</key>
68
+ <true/>
69
+ </dict>
70
+ <key>rules2</key>
71
+ <dict>
72
+ <key>.*\.dSYM($|/)</key>
73
+ <dict>
74
+ <key>weight</key>
75
+ <real>11</real>
76
+ </dict>
77
+ <key>^(.*/)?\.DS_Store$</key>
78
+ <dict>
79
+ <key>omit</key>
80
+ <true/>
81
+ <key>weight</key>
82
+ <real>2000</real>
83
+ </dict>
84
+ <key>^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/</key>
85
+ <dict>
86
+ <key>nested</key>
87
+ <true/>
88
+ <key>weight</key>
89
+ <real>10</real>
90
+ </dict>
91
+ <key>^.*</key>
92
+ <true/>
93
+ <key>^Info\.plist$</key>
94
+ <dict>
95
+ <key>omit</key>
96
+ <true/>
97
+ <key>weight</key>
98
+ <real>20</real>
99
+ </dict>
100
+ <key>^PkgInfo$</key>
101
+ <dict>
102
+ <key>omit</key>
103
+ <true/>
104
+ <key>weight</key>
105
+ <real>20</real>
106
+ </dict>
107
+ <key>^Resources/</key>
108
+ <dict>
109
+ <key>weight</key>
110
+ <real>20</real>
111
+ </dict>
112
+ <key>^Resources/.*\.lproj/</key>
113
+ <dict>
114
+ <key>optional</key>
115
+ <true/>
116
+ <key>weight</key>
117
+ <real>1000</real>
118
+ </dict>
119
+ <key>^Resources/.*\.lproj/locversion.plist$</key>
120
+ <dict>
121
+ <key>omit</key>
122
+ <true/>
123
+ <key>weight</key>
124
+ <real>1100</real>
125
+ </dict>
126
+ <key>^Resources/Base\.lproj/</key>
127
+ <dict>
128
+ <key>weight</key>
129
+ <real>1010</real>
130
+ </dict>
131
+ <key>^[^/]+$</key>
132
+ <dict>
133
+ <key>nested</key>
134
+ <true/>
135
+ <key>weight</key>
136
+ <real>10</real>
137
+ </dict>
138
+ <key>^embedded\.provisionprofile$</key>
139
+ <dict>
140
+ <key>weight</key>
141
+ <real>20</real>
142
+ </dict>
143
+ <key>^version\.plist$</key>
144
+ <dict>
145
+ <key>weight</key>
146
+ <real>20</real>
147
+ </dict>
148
+ </dict>
149
+ </dict>
150
+ </plist>
package/package.json CHANGED
@@ -1,16 +1,17 @@
1
1
  {
2
2
  "name": "@mathismeadows/roamer-device-auth",
3
- "version": "1.5.7",
3
+ "version": "1.5.9",
4
4
  "private": false,
5
5
  "mcpName": "com.mathismeadows/roamer-mcp",
6
6
  "type": "module",
7
7
  "description": "AUTH-14/AUTH-25/AUTH-38: stdio<->HTTP MCP proxy for Roamer MCP with two auth mechanisms, chosen per-machine by default-browser detection. Safari-default machines use a server-mediated device authorization flow (AUTH-25) since Safari's HTTPS-Only Mode blocks a loopback redirect; every other machine uses a standard direct loopback redirect instead. Both authenticate against RoamerMcp's own OAuth authorization server (AUTH-38). AUTH-54/55/57/58: sessions are cached per (client, identity) pair, with explicit login/logout/status subcommands to switch or inspect which identity a client is using.",
8
8
  "bin": {
9
- "roamer-device-auth": "./roamer-device-auth.mjs"
9
+ "roamer-device-auth": "roamer-device-auth.mjs"
10
10
  },
11
11
  "main": "./roamer-device-auth.mjs",
12
12
  "files": [
13
- "roamer-device-auth.mjs"
13
+ "roamer-device-auth.mjs",
14
+ "macos-notifier.app/"
14
15
  ],
15
16
  "publishConfig": {
16
17
  "access": "public"
@@ -46,11 +46,11 @@ import {
46
46
  import { readFile, writeFile, mkdir, readdir, unlink } from "node:fs/promises";
47
47
  import { realpathSync, watch } from "node:fs";
48
48
  import { homedir } from "node:os";
49
- import { join } from "node:path";
49
+ import { dirname, join } from "node:path";
50
50
  import { setTimeout as sleep } from "node:timers/promises";
51
51
  import { execFile } from "node:child_process";
52
52
  import { promisify } from "node:util";
53
- import { pathToFileURL } from "node:url";
53
+ import { fileURLToPath, pathToFileURL } from "node:url";
54
54
  import { createServer } from "node:http";
55
55
  import qrcode from "qrcode-terminal";
56
56
 
@@ -60,6 +60,13 @@ const ROAMER_MCP_URL = process.env.ROAMER_MCP_URL ?? "https://roamer-mcp.mathism
60
60
  const ROAMER_MCP_ORIGIN = new URL(ROAMER_MCP_URL).origin;
61
61
 
62
62
  const CACHE_DIR = join(homedir(), ".mcp-auth-device");
63
+ const MACOS_NOTIFIER_PATH = join(
64
+ dirname(fileURLToPath(import.meta.url)),
65
+ "macos-notifier.app",
66
+ "Contents",
67
+ "MacOS",
68
+ "roamer-mcp-notifier",
69
+ );
63
70
 
64
71
  // AUTH-51: every on-disk cache is namespaced per client slug — a null slug (the connecting
65
72
  // host sent no usable clientInfo.name) means "never persist": the caller gets a real
@@ -329,18 +336,25 @@ async function showDeviceCodeDialog(verificationUri, userCode) {
329
336
  // distinction someone needs in order to notice a stale identity is still active.
330
337
  async function notifySessionReused(clientSlug, identityLabel) {
331
338
  const clientLabel = clientSlug ?? "an unidentified client";
332
- const message = identityLabel
339
+ const logMessage = identityLabel
333
340
  ? `Reused an existing Roamer MCP session for ${clientLabel} (${identityLabel}).`
334
341
  : `Reused an existing Roamer MCP session for ${clientLabel}.`;
335
- try {
336
- await execFileAsync("osascript", [
337
- "-e",
338
- `display notification "${message.replace(/"/g, '\\"')}" with title "Roamer MCP"`,
339
- ]);
340
- } catch {
341
- // Best-effort, macOS-only — the stderr log line below is the fallback for every other OS.
342
+ if (process.platform === "darwin") {
343
+ try {
344
+ await execFileAsync("open", [
345
+ "-n",
346
+ "-W",
347
+ join(dirname(MACOS_NOTIFIER_PATH), "..", ".."),
348
+ "--args",
349
+ "Roamer MCP",
350
+ identityLabel ? `Connected as ${identityLabel}.` : "Connected using a saved session.",
351
+ `Client: ${clientLabel}`,
352
+ ]);
353
+ } catch {
354
+ // Best-effort — stderr remains the fallback if native notifications are unavailable.
355
+ }
342
356
  }
343
- log(message);
357
+ log(logMessage);
344
358
  }
345
359
 
346
360
  // AUTH-54: identityKey defaults to null (the pre-AUTH-54 file shape) rather than being