safari-mcp 2.8.3 → 2.8.4
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 +1 -1
- package/safari.js +4 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "safari-mcp",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.4",
|
|
4
4
|
"mcpName": "io.github.achiya-automation/safari-mcp",
|
|
5
5
|
"description": "Safari browser automation for AI agents — native macOS, zero Chrome overhead. 80 tools via AppleScript + JavaScript.",
|
|
6
6
|
"type": "module",
|
package/safari.js
CHANGED
|
@@ -10,10 +10,14 @@ import { join, dirname, resolve as resolvePath } from "node:path";
|
|
|
10
10
|
import { readFile, writeFile, unlink, appendFile } from "node:fs/promises";
|
|
11
11
|
import { readFileSync } from "node:fs";
|
|
12
12
|
import { fileURLToPath } from "node:url";
|
|
13
|
+
import { randomUUID } from "node:crypto";
|
|
13
14
|
// Extension bridge is handled by index.js (WebSocket server on port 9223)
|
|
14
15
|
|
|
15
16
|
const execFileAsync = promisify(execFile);
|
|
16
17
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
18
|
+
// Local session ID — kept in sync with index.js SESSION_ID for tab marker generation
|
|
19
|
+
// Both files need their own const because they're separate ES modules; the marker only needs to be unique per process
|
|
20
|
+
const SESSION_ID = randomUUID().slice(0, 8);
|
|
17
21
|
|
|
18
22
|
// ========== SWIFT HELPER DAEMON ==========
|
|
19
23
|
// Persistent process — no subprocess spawn overhead (~5ms vs ~90ms)
|