@geometra/mcp 1.19.2 → 1.19.3
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.
|
@@ -89,6 +89,34 @@ describe('proxy ready helpers', () => {
|
|
|
89
89
|
rmSync(tempRoot, { recursive: true, force: true });
|
|
90
90
|
}
|
|
91
91
|
});
|
|
92
|
+
it('falls back to the packaged sibling proxy dist when package exports are stale', () => {
|
|
93
|
+
const tempRoot = mkdtempSync(path.join(tmpdir(), 'geometra-proxy-stale-exports-'));
|
|
94
|
+
try {
|
|
95
|
+
const proxyDir = path.join(tempRoot, 'node_modules', '@geometra', 'proxy');
|
|
96
|
+
const mcpDistDir = path.join(tempRoot, 'node_modules', '@geometra', 'mcp', 'dist');
|
|
97
|
+
const proxyDistDir = path.join(proxyDir, 'dist');
|
|
98
|
+
const probePath = path.join(mcpDistDir, 'proxy-spawn.cjs');
|
|
99
|
+
mkdirSync(proxyDistDir, { recursive: true });
|
|
100
|
+
mkdirSync(mcpDistDir, { recursive: true });
|
|
101
|
+
writeFileSync(path.join(proxyDir, 'package.json'), JSON.stringify({
|
|
102
|
+
name: '@geometra/proxy',
|
|
103
|
+
type: 'module',
|
|
104
|
+
exports: {
|
|
105
|
+
'.': {
|
|
106
|
+
import: './dist/index.js',
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
}, null, 2));
|
|
110
|
+
writeFileSync(path.join(proxyDistDir, 'index.js'), 'export {};\n');
|
|
111
|
+
writeFileSync(probePath, 'module.exports = {};\n');
|
|
112
|
+
const customRequire = createRequire(probePath);
|
|
113
|
+
const scriptPath = resolveProxyScriptPathWith(customRequire, mcpDistDir);
|
|
114
|
+
expect(scriptPath).toBe(path.join(proxyDistDir, 'index.js'));
|
|
115
|
+
}
|
|
116
|
+
finally {
|
|
117
|
+
rmSync(tempRoot, { recursive: true, force: true });
|
|
118
|
+
}
|
|
119
|
+
});
|
|
92
120
|
it('parses structured proxy ready JSON', () => {
|
|
93
121
|
const wsUrl = parseProxyReadySignalLine('{"type":"geometra-proxy-ready","wsUrl":"ws://127.0.0.1:41237","pageUrl":"https://example.com"}');
|
|
94
122
|
expect(wsUrl).toBe('ws://127.0.0.1:41237');
|
package/dist/proxy-spawn.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type ChildProcess } from 'node:child_process';
|
|
2
2
|
/** Resolve bundled @geometra/proxy CLI entry (dist/index.js). */
|
|
3
3
|
export declare function resolveProxyScriptPath(): string;
|
|
4
|
-
export declare function resolveProxyScriptPathWith(customRequire: NodeRequire): string;
|
|
4
|
+
export declare function resolveProxyScriptPathWith(customRequire: NodeRequire, moduleDir?: string): string;
|
|
5
5
|
export interface SpawnProxyParams {
|
|
6
6
|
pageUrl: string;
|
|
7
7
|
port: number;
|
package/dist/proxy-spawn.js
CHANGED
|
@@ -11,7 +11,7 @@ const MODULE_DIR = path.dirname(fileURLToPath(import.meta.url));
|
|
|
11
11
|
export function resolveProxyScriptPath() {
|
|
12
12
|
return resolveProxyScriptPathWith(require);
|
|
13
13
|
}
|
|
14
|
-
export function resolveProxyScriptPathWith(customRequire) {
|
|
14
|
+
export function resolveProxyScriptPathWith(customRequire, moduleDir = MODULE_DIR) {
|
|
15
15
|
const errors = [];
|
|
16
16
|
try {
|
|
17
17
|
const pkgJson = customRequire.resolve('@geometra/proxy/package.json');
|
|
@@ -26,7 +26,12 @@ export function resolveProxyScriptPathWith(customRequire) {
|
|
|
26
26
|
catch (err) {
|
|
27
27
|
errors.push(err instanceof Error ? err.message : String(err));
|
|
28
28
|
}
|
|
29
|
-
const
|
|
29
|
+
const packagedSiblingDist = path.resolve(moduleDir, '../../proxy/dist/index.js');
|
|
30
|
+
if (existsSync(packagedSiblingDist)) {
|
|
31
|
+
return packagedSiblingDist;
|
|
32
|
+
}
|
|
33
|
+
errors.push(`Packaged sibling fallback not found at ${packagedSiblingDist}`);
|
|
34
|
+
const workspaceDist = path.resolve(moduleDir, '../../packages/proxy/dist/index.js');
|
|
30
35
|
if (existsSync(workspaceDist)) {
|
|
31
36
|
return workspaceDist;
|
|
32
37
|
}
|
package/dist/server.js
CHANGED
|
@@ -3,7 +3,7 @@ import { z } from 'zod';
|
|
|
3
3
|
import { formatConnectFailureMessage, isHttpUrl, normalizeConnectTarget } from './connect-utils.js';
|
|
4
4
|
import { connect, connectThroughProxy, disconnect, getSession, sendClick, sendType, sendKey, sendFileUpload, sendListboxPick, sendSelectOption, sendWheel, buildA11yTree, buildCompactUiIndex, buildPageModel, expandPageSection, buildUiDelta, hasUiDelta, nodeIdForPath, summarizeCompactIndex, summarizePageModel, summarizeUiDelta, } from './session.js';
|
|
5
5
|
export function createServer() {
|
|
6
|
-
const server = new McpServer({ name: 'geometra', version: '1.19.
|
|
6
|
+
const server = new McpServer({ name: 'geometra', version: '1.19.3' }, { capabilities: { tools: {} } });
|
|
7
7
|
// ── connect ──────────────────────────────────────────────────
|
|
8
8
|
server.tool('geometra_connect', `Connect to a Geometra WebSocket peer, or start \`geometra-proxy\` automatically for a normal web page.
|
|
9
9
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geometra/mcp",
|
|
3
|
-
"version": "1.19.
|
|
3
|
+
"version": "1.19.3",
|
|
4
4
|
"description": "MCP server for Geometra — interact with running Geometra apps via the geometry protocol, no browser needed",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"ui-testing"
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@geometra/proxy": "1.19.
|
|
33
|
+
"@geometra/proxy": "1.19.3",
|
|
34
34
|
"@modelcontextprotocol/sdk": "^1.12.1",
|
|
35
35
|
"ws": "^8.18.0",
|
|
36
36
|
"zod": "^3.23.0"
|