From ee05e922c01595dc49609796e46e8b397f8328e0 Mon Sep 17 00:00:00 2001 From: Sameh Khamis Date: Sat, 3 Oct 2026 21:17:47 -0700 Subject: [PATCH 1/2] feat: export the globe panel for MCP servers MCP servers that compose Core's tools can now serve the globe panel: @gods-eye-view/core/tools/panel exports createGlobePanelResource, panelRuntime, GLOBE_PANEL_URI and PANEL_BASE. The local MCP server uses the same entry point. --- package.json | 1 + server/mcp/server.js | 6 ++++-- src/tools/globePanel.test.mjs | 11 +++++++++++ src/tools/panel.js | 12 ++++++++++++ 4 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 src/tools/panel.js diff --git a/package.json b/package.json index 94e83bf6f..f1cc544e5 100644 --- a/package.json +++ b/package.json @@ -255,6 +255,7 @@ "./sources/map-features": "./src/sources/overpassFeatures.js", "./tools": "./src/tools/index.js", "./tools/mcp": "./src/tools/mcp/index.js", + "./tools/panel": "./src/tools/panel.js", "./tools/services": "./src/tools/services.js", "./view": "./src/view/index.js" } diff --git a/server/mcp/server.js b/server/mcp/server.js index 20a0745ec..0926c865e 100644 --- a/server/mcp/server.js +++ b/server/mcp/server.js @@ -7,8 +7,10 @@ import { coreTools, catalogForSurface, } from '../../src/tools/index.js'; -import { panelRuntime } from '../../src/app/globePanelRuntime.js'; -import { createGlobePanelResource } from '../../src/tools/globePanel.js'; +import { + createGlobePanelResource, + panelRuntime, +} from '../../src/tools/panel.js'; import { createMcpServer } from '../../src/tools/mcp/index.js'; import { DEFAULT_API_BASE, createLocalToolServices } from './services.js'; diff --git a/src/tools/globePanel.test.mjs b/src/tools/globePanel.test.mjs index 378a1472c..964ca0a64 100644 --- a/src/tools/globePanel.test.mjs +++ b/src/tools/globePanel.test.mjs @@ -122,3 +122,14 @@ test('a view that only follows an aircraft is framed where the aircraft is', asy /not reported now/.test(error.message), ); }); + +test('the package exports the panel resource and its runtime together', async () => { + const panel = await import('gods-eye-view/tools/panel'); + const resource = panel.createGlobePanelResource({ + runtime: panel.panelRuntime, + panelKey: 'key', + }); + assert.equal(resource.uri, panel.GLOBE_PANEL_URI); + assert.equal(panel.PANEL_BASE, '/panel/'); + assert.match(resource.text, /panelRuntime|function/); +}); diff --git a/src/tools/panel.js b/src/tools/panel.js new file mode 100644 index 000000000..5a2a0afbf --- /dev/null +++ b/src/tools/panel.js @@ -0,0 +1,12 @@ +/** + * The MCP Apps globe panel for MCP servers that compose Core's tools: the + * panel resource and the script its page runs. A server serves the panel + * build at PANEL_BASE and passes the same key to the resource and to the + * tool services (see src/tools/services.js). + */ +export { + GLOBE_PANEL_URI, + PANEL_BASE, + createGlobePanelResource, +} from './globePanel.js'; +export { panelRuntime } from '../app/globePanelRuntime.js'; From a2099358fd268006893d5260561308a7b4d185cc Mon Sep 17 00:00:00 2001 From: Sameh Khamis Date: Sat, 3 Oct 2026 21:20:04 -0700 Subject: [PATCH 2/2] chore: classify the tools/panel export Add the tools-panel boundary group for the new export. --- scripts/package-boundaries.json | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/package-boundaries.json b/scripts/package-boundaries.json index ab28b67e0..e91656bb3 100644 --- a/scripts/package-boundaries.json +++ b/scripts/package-boundaries.json @@ -3168,6 +3168,15 @@ ], "external": [] }, + "tools-panel": { + "exports": ["./tools/panel"], + "modules": [ + "src/tools/panel.js", + "src/tools/globePanel.js", + "src/app/globePanelRuntime.js" + ], + "external": [] + }, "tools-services": { "exports": ["./tools/services"], "modules": [