@hypothesi/tauri-mcp-server 0.6.5 → 0.7.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.
- package/dist/driver/plugin-commands.js +28 -0
- package/dist/prompts-registry.js +2 -1
- package/dist/tools-registry.js +2 -1
- package/dist/version.js +17 -0
- package/package.json +1 -1
|
@@ -41,11 +41,25 @@ export async function manageIPCMonitoring(action, appIdentifier) {
|
|
|
41
41
|
}
|
|
42
42
|
export async function startIPCMonitoring(appIdentifier) {
|
|
43
43
|
try {
|
|
44
|
+
// Start the Rust-side monitor state
|
|
44
45
|
const result = await executeIPCCommand({ command: 'plugin:mcp-bridge|start_ipc_monitor', appIdentifier });
|
|
45
46
|
const parsed = JSON.parse(result);
|
|
46
47
|
if (!parsed.success) {
|
|
47
48
|
throw new Error(parsed.error || 'Unknown error');
|
|
48
49
|
}
|
|
50
|
+
// Start the JS-side IPC interception
|
|
51
|
+
const client = await ensureSessionAndConnect(appIdentifier);
|
|
52
|
+
const jsResponse = await client.sendCommand({
|
|
53
|
+
command: 'execute_js',
|
|
54
|
+
args: {
|
|
55
|
+
script: 'window.__MCP_START_IPC_MONITOR__ && window.__MCP_START_IPC_MONITOR__(); true;',
|
|
56
|
+
windowLabel: 'main',
|
|
57
|
+
},
|
|
58
|
+
}, 5000);
|
|
59
|
+
if (!jsResponse.success) {
|
|
60
|
+
// Log but don't fail - Rust-side monitoring is still active
|
|
61
|
+
console.error('Failed to start JS-side IPC interception:', jsResponse.error);
|
|
62
|
+
}
|
|
49
63
|
return JSON.stringify(parsed.result);
|
|
50
64
|
}
|
|
51
65
|
catch (error) {
|
|
@@ -55,6 +69,20 @@ export async function startIPCMonitoring(appIdentifier) {
|
|
|
55
69
|
}
|
|
56
70
|
export async function stopIPCMonitoring(appIdentifier) {
|
|
57
71
|
try {
|
|
72
|
+
// Stop the JS-side IPC interception first
|
|
73
|
+
const client = await ensureSessionAndConnect(appIdentifier);
|
|
74
|
+
const jsResponse = await client.sendCommand({
|
|
75
|
+
command: 'execute_js',
|
|
76
|
+
args: {
|
|
77
|
+
script: 'window.__MCP_STOP_IPC_MONITOR__ && window.__MCP_STOP_IPC_MONITOR__(); true;',
|
|
78
|
+
windowLabel: 'main',
|
|
79
|
+
},
|
|
80
|
+
}, 5000);
|
|
81
|
+
if (!jsResponse.success) {
|
|
82
|
+
// Log but don't fail - continue to stop Rust-side monitoring
|
|
83
|
+
console.error('Failed to stop JS-side IPC interception:', jsResponse.error);
|
|
84
|
+
}
|
|
85
|
+
// Stop the Rust-side monitor state
|
|
58
86
|
const result = await executeIPCCommand({ command: 'plugin:mcp-bridge|stop_ipc_monitor', appIdentifier });
|
|
59
87
|
const parsed = JSON.parse(result);
|
|
60
88
|
if (!parsed.success) {
|
package/dist/prompts-registry.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Single source of truth for all MCP prompt definitions
|
|
3
3
|
* Prompts are user-controlled templates that appear as slash commands in MCP clients
|
|
4
4
|
*/
|
|
5
|
+
import { PLUGIN_VERSION_CARGO } from './version.js';
|
|
5
6
|
const FIX_WEBVIEW_ERRORS_PROMPT = `I need help finding and fixing JavaScript errors in my Tauri app's webview.
|
|
6
7
|
|
|
7
8
|
Please follow these steps:
|
|
@@ -49,7 +50,7 @@ Examine these files and report what needs to be added or updated:
|
|
|
49
50
|
Check \`src-tauri/Cargo.toml\` for \`tauri-plugin-mcp-bridge\`. If missing or outdated, note that it needs:
|
|
50
51
|
\`\`\`toml
|
|
51
52
|
[dependencies]
|
|
52
|
-
tauri-plugin-mcp-bridge = "
|
|
53
|
+
tauri-plugin-mcp-bridge = "${PLUGIN_VERSION_CARGO}"
|
|
53
54
|
\`\`\`
|
|
54
55
|
|
|
55
56
|
### 2. Plugin Registration
|
package/dist/tools-registry.js
CHANGED
|
@@ -8,6 +8,7 @@ import { manageDriverSession, ManageDriverSessionSchema, } from './driver/sessio
|
|
|
8
8
|
import { readLogs, ReadLogsSchema } from './monitor/logs.js';
|
|
9
9
|
import { executeIPCCommand, manageIPCMonitoring, getIPCEvents, emitTestEvent, getBackendState, manageWindow, ExecuteIPCCommandSchema, ManageIPCMonitoringSchema, GetIPCEventsSchema, EmitTestEventSchema, GetBackendStateSchema, ManageWindowSchema, } from './driver/plugin-commands.js';
|
|
10
10
|
import { interact, screenshot, keyboard, waitFor, getStyles, executeJavaScript, findElement, InteractSchema, ScreenshotSchema, KeyboardSchema, WaitForSchema, GetStylesSchema, ExecuteJavaScriptSchema, FindElementSchema, } from './driver/webview-interactions.js';
|
|
11
|
+
import { PLUGIN_VERSION_CARGO } from './version.js';
|
|
11
12
|
/**
|
|
12
13
|
* Standard multi-app description for webview tools.
|
|
13
14
|
*/
|
|
@@ -50,7 +51,7 @@ Examine these files and report what needs to be added or updated:
|
|
|
50
51
|
Check \`src-tauri/Cargo.toml\` for \`tauri-plugin-mcp-bridge\`. If missing or outdated, note that it needs:
|
|
51
52
|
\`\`\`toml
|
|
52
53
|
[dependencies]
|
|
53
|
-
tauri-plugin-mcp-bridge = "
|
|
54
|
+
tauri-plugin-mcp-bridge = "${PLUGIN_VERSION_CARGO}"
|
|
54
55
|
\`\`\`
|
|
55
56
|
|
|
56
57
|
### 2. Plugin Registration
|
package/dist/version.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Version information for the MCP Bridge plugin.
|
|
3
|
+
*
|
|
4
|
+
* Reads the version from this package's package.json at runtime.
|
|
5
|
+
* Both packages share the same version (monorepo single-version policy).
|
|
6
|
+
*/
|
|
7
|
+
import { createRequire } from 'module';
|
|
8
|
+
const require = createRequire(import.meta.url), pkg = require('../package.json'), [major, minor] = pkg.version.split('.');
|
|
9
|
+
/**
|
|
10
|
+
* Full version string (e.g., "0.6.5")
|
|
11
|
+
*/
|
|
12
|
+
export const PLUGIN_VERSION_FULL = pkg.version;
|
|
13
|
+
/**
|
|
14
|
+
* Cargo-compatible version string for Cargo.toml dependencies (e.g., "0.6")
|
|
15
|
+
* This is the major.minor version used in Cargo.toml dependency specifications.
|
|
16
|
+
*/
|
|
17
|
+
export const PLUGIN_VERSION_CARGO = `${major}.${minor}`;
|
package/package.json
CHANGED