/** * The God's Eye View panel: an MCP Apps view (`io.modelcontextprotocol/ui`) that shows * God's Eye View inside a conversation. The panel is a small page that runs * the app's panel build inside itself in embed mode, loading it through the * MCP server, and sends it each view the show_in_gods_eye_view tool returns; * see docs/TOOLS.md. */ export const GLOBE_PANEL_URI = 'ui://gods-eye-view/globe'; /** Where the app's server serves its panel build (see build/panel.js). */ export const PANEL_BASE = '/panel/'; /** The script the panel runs ahead of Cesium's workers, in the build. */ export const PANEL_WORKER_PRELUDE_PATH = 'cesium/worker-prelude.js'; /** * Sites the app's browser code loads from directly: map imagery, 3D tiles, * terrain, fonts, and Street Level's Mapillary Graph API and image CDN (its * coverage tiles come through the app's server). Everything from the app's * own server comes through the MCP server. */ const PROVIDER_ORIGINS = Object.freeze([ 'https://tile.googleapis.com', 'https://maps.googleapis.com', 'https://api.cesium.com', 'https://assets.ion.cesium.com', 'https://assets.cesium.com', 'https://dev.virtualearth.net', 'https://ecn.t0.tiles.virtualearth.net', 'https://ecn.t1.tiles.virtualearth.net', 'https://ecn.t2.tiles.virtualearth.net', 'https://ecn.t3.tiles.virtualearth.net', 'https://services.arcgisonline.com', 'https://server.arcgisonline.com', 'https://tile.openstreetmap.org', 'https://tiles.openfreemap.org', 'https://gibs.earthdata.nasa.gov', 'https://fonts.googleapis.com', 'https://fonts.gstatic.com', 'https://graph.mapillary.com', // Google Street View's tiles, controls and contributed photos (the Maps // JavaScript API itself comes from maps.googleapis.com above). 'https://streetviewpixels-pa.googleapis.com', 'https://maps.gstatic.com', 'https://*.ggpht.com', // Mapillary photos come from regional hosts, e.g. scontent-man2-1.xx.fbcdn.net. 'https://*.xx.fbcdn.net', ]); export const MCP_APP_MIME_TYPE = 'text/html;profile=mcp-app'; const MCP_APPS_PROTOCOL_VERSION = '2026-01-26'; const PANEL_HEIGHT_PX = 520; const LOAD_TIMEOUT_MS = 90_000; /** * The app's address inside the panel, for code that needs an https address * (the page's own may use a host's scheme). The panel loads its paths * through the MCP server; the name never resolves. */ const PANEL_APP_BASE_URL = 'https://app.gods-eye-view.invalid/'; /** The panel-only tool the panel loads the app through. */ export const PANEL_REQUEST_TOOL = 'panel_request'; /** * The panel page: its status line, the Open in God's Eye View button, and * the panel's script, `runtime`, which loads the app through the MCP server * and shows each view a tool returns. */ function panelHtml(runtime, panelKey) { const config = { appBaseUrl: PANEL_APP_BASE_URL, loadTimeoutMs: LOAD_TIMEOUT_MS, panelBase: PANEL_BASE, panelHeight: PANEL_HEIGHT_PX, panelKey, protocolVersion: MCP_APPS_PROTOCOL_VERSION, toolName: PANEL_REQUEST_TOOL, workerPreludePath: PANEL_WORKER_PRELUDE_PATH, }; const script = `(${runtime})(${JSON.stringify(config)});`.replace( /<\/script/gi, '<\\/script', ); return `