Skip to content

armgit / mso

Public Imported from GitHub
0

Browser-based graphical shell and control plane for a Linux server you own — real terminal, file manager, live metrics and BYOK AI in one mobile-first workspace. Next.js 16 · React 19 · node-pty · Tailwind v4 · shadcn/ui. Public alpha, self-hosted.

fix(ui): fill MCP Page height and apply MSO branding

Rahman32ec16b52356
diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md
index add94c57..354d652a 100644
--- a/docs/ARCHITECTURE.md
+++ b/docs/ARCHITECTURE.md
@@ -120,10 +120,10 @@ through the app catch-all.
The web catch-all remains the authenticated cockpit route. ChatGPT does **not** frame that cockpit.
MSO exposes exactly two user-visible MCP App classes instead:
-- `render_mso_block` binds `ui://mso/block-v2.html` for compact validation, action buttons, and
+- `render_mso_block` binds `ui://mso/block-v3.html` for compact validation, action buttons, and
CRUD input-output. A button returns a user-approved follow-up message; it does not execute a
mutation inside the widget, so ordinary scope, approval, audit, and workflow rules still apply.
-- `render_mso_page` binds the canonical `ui://mso/page-v12.html` resource for native `/`, `/monitor`, `/project`, `/diff`,
+- `render_mso_page` binds the canonical `ui://mso/page-v14.html` resource for native `/`, `/monitor`, `/project`, `/diff`,
`/browser`, and `/apps/<reviewed-id>` views. Native Page views call the same bounded MSO tools.
`workflow_start` is orchestration-only and headless: it still owns workflow isolation, skill/recipe
@@ -132,9 +132,9 @@ lookup, collision detection, tracing, evidence, and learning, but no longer bind
`render_mso_surface` and `workflow_status` actions are app-only compatibility shims for cached
widgets; prior Block/Page URIs plus the previous workflow/surface resource URIs remain readable aliases but are not advertised. Page tools use the standard MCP Apps `ui.resourceUri` binding only; the legacy ChatGPT `openai/outputTemplate` alias is intentionally absent so one tool result maps to one Page mount.
-Reviewed Page apps may use a nested iframe only when their exact HTTPS origin exists in the
-validated owner-local Page registry (`~/.mso/surface-apps.json`, or explicit `MSO_SURFACE_APPS_JSON` override) and the MCP resource CSP `frameDomains`;
-portable source defaults to no external Page apps. Anti-frame apps stay on the remote-browser seam.
+Reviewed Page apps use the remote-browser handoff; Page does not mount third-party iframes.
+The owner-local registry (`~/.mso/surface-apps.json`, or explicit `MSO_SURFACE_APPS_JSON` override)
+validates app identity, origin and approved path; portable source defaults to no external Page apps.
This trust catalog is deliberately separate from Store/runtime `AppManifest` data. A locally installed `runtime:"html"` app or HTML widget is user-controlled presentation data
and cannot grant itself a ChatGPT nested-frame origin. `srcDoc` HTML remains opaque-origin
sandboxed. The MCP widget origin comes from `OS_MCP_UI_ORIGIN`, or is derived from
diff --git a/docs/AUTOMATION-FLOWS.md b/docs/AUTOMATION-FLOWS.md
index 2e549962..bc03a022 100644
--- a/docs/AUTOMATION-FLOWS.md
+++ b/docs/AUTOMATION-FLOWS.md
@@ -79,7 +79,8 @@ The exact result path depends on the inspected tool. Project calls inherit the c
|---|---|
| Manifest | 64 KiB, 32 flows |
| Flow | 32 input fields, 1–12 ordered steps, nesting at most 12 |
-| Run input | 32 KiB, typed fields; no inline credential/header fields |
+| Run input | 32 KiB through MCP, typed fields; no inline credential/header fields |
+| CLI/HTTP request | 16 KiB JSON body including envelope, bounded by the shared request reader |
| Concurrent runs | Four per principal |
| Step receipt result | Bounded to 12 KiB; full result available to following steps in memory |
| Whole run | No new step begins after ten minutes; each child retains its own timeout |
diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md
index adb46b10..72b47375 100644
--- a/docs/CHANGELOG.md
+++ b/docs/CHANGELOG.md
@@ -12,6 +12,7 @@ this is the *what*, and it is what Settings → About shows as “What's new”.
**Fixed**
+- `ui` fill MCP Page height and apply MSO branding
- `flows` enforce canonical paths and bounded waits
## 2026-09-11
diff --git a/docs/CHATGPT-PLUGIN.md b/docs/CHATGPT-PLUGIN.md
index aa577942..0c87bf81 100644
--- a/docs/CHATGPT-PLUGIN.md
+++ b/docs/CHATGPT-PLUGIN.md
@@ -56,11 +56,11 @@ The restored Original MSO operator primitives (`sys_*`, `fs_usage` + full bounde
Project-owned MCP names and Convex's own dynamic schemas still load on demand through `project_mcp_tools` / `project_mcp_call` and `project_database_tools` / `project_database_call`. That is how MSO keeps a bounded static model profile instead of copying every downstream provider/project action into ChatGPT.
-ChatGPT presentation is explicit rather than attached to every operation. `workflow_start` is headless. `render_mso_block` opens the compact validation/action/CRUD component and accepts only bounded fields, checks, outputs, and follow-up actions; a button cannot execute a mutation inside the widget. `render_mso_page` opens native MSO views or a code-reviewed development/preview/production app. It accepts only MSO-style routes and server-owned app ids, never arbitrary HTML or an external URL. `mso_surface_apps_list` exposes the reviewed Page catalog. Direct nested frames are exact-origin allowlisted in the Page CSP, while anti-frame applications remain remote-browser candidates. User-installed runtime HTML apps do not inherit this trust automatically. `render_mso_surface` and `workflow_status` remain app-only compatibility shims for cached clients.
+ChatGPT presentation is explicit rather than attached to every operation. `workflow_start` is headless. `render_mso_block` opens the compact validation/action/CRUD component and accepts only bounded fields, checks, outputs, and follow-up actions; a button cannot execute a mutation inside the widget. `render_mso_page` opens native MSO views or a code-reviewed development/preview/production app. It accepts only MSO-style routes and server-owned app ids, never arbitrary HTML or an external URL. `mso_surface_apps_list` exposes the reviewed Page catalog. External apps use the remote browser; Page does not mount third-party iframes. User-installed runtime HTML apps do not inherit this trust automatically. `render_mso_surface` and `workflow_status` remain app-only compatibility shims for cached clients.
-`render_mso_page` and `integration_setup_open` bind Page through the standard MCP Apps `ui.resourceUri` field only. Do not mirror `openai/outputTemplate` onto Page tools: the current ChatGPT host already supports the standard binding, and dual Page bindings can mount the same UI twice. Page v10 therefore uses one modern binding and keeps earlier Page URIs only as non-advertised read aliases.
+`render_mso_page` and `integration_setup_open` bind Page through the standard MCP Apps `ui.resourceUri` field only. Do not mirror `openai/outputTemplate` onto Page tools: the current ChatGPT host already supports the standard binding, and dual Page bindings can mount the same UI twice. The current Page therefore uses one modern binding and keeps earlier Page URIs only as non-advertised read aliases.
-Reviewed app previews enter in **inline** mode. The widget derives an inline height cap of 48% from the host-provided `maxHeight`, so an ordinary chat preview stays below half of the available host area and scrolls internally when needed. Fullscreen and PiP remain explicit user actions and are not constrained by the inline cap.
+Page enters in **inline** mode and fills standard MCP Apps `containerDimensions.height` or `maxHeight`, with legacy `maxHeight` and a 680 px fallback. Measured size notifications resize flexible host frames without viewport feedback. Fullscreen and supported PiP remain explicit user actions. See [the UI contract](integrations/CHATGPT-UI.md).
### Structured-result contract
diff --git a/docs/MCP.md b/docs/MCP.md
index 2ab45d09..d53568d8 100644
--- a/docs/MCP.md
+++ b/docs/MCP.md
@@ -729,7 +729,7 @@ MSO Integrations uses the existing Page at `/integrations`. The write-scoped
`integration_setup_open` tool opens a secure form without accepting secret values.
See [Native Integrations](INTEGRATIONS.md) for browser/CLI entrypoints, scope,
expiry, direct HTTPS submission, and verification limits. The friendly browser
-entrypoint is `/integrations`; Page v10 retains previous resource aliases. Page-bound tools advertise only the standard MCP Apps `ui.resourceUri`; the legacy `openai/outputTemplate` Page alias is intentionally omitted to prevent duplicate host mounts. Inline Page previews are capped at 48% of the host-reported maximum height, while fullscreen/PiP require explicit user action.
+entrypoint is `/integrations`; The current Page retains previous resource aliases. Page-bound tools advertise only the standard MCP Apps `ui.resourceUri`; the legacy `openai/outputTemplate` Page alias is intentionally omitted to prevent duplicate host mounts. Inline Page fills the host-declared fixed or maximum container height (legacy maxHeight, then 680 px fallback); fullscreen/PiP require explicit user action. Standard size notifications keep flexible host frames synchronized.
## Session artifact evidence
diff --git a/docs/PROGRESS.md b/docs/PROGRESS.md
index b2284eb8..abe88533 100644
--- a/docs/PROGRESS.md
+++ b/docs/PROGRESS.md
@@ -1,3 +1,19 @@
+## 2026-09-12 — Full-height MSO Page and shared brand
+
+The embedded Integrations report reproduced the old 48% legacy height cap. Page v14 now
+uses the standard MCP Apps fixed/maximum container height before legacy globals, with a
+680 px fallback and one content scrollport. Resize notifications cannot feed the current
+iframe viewport back into a smaller height. Standard host theme, safe areas and supported
+display modes are honored; fullscreen stays user initiated.
+
+Following the installed SI-Coder sc-fe workbench contract, Page uses readable controls,
+restrained separators and a compact header. Page, Block v3, native Integrations and shell
+use the existing public MSO logo instead of M. Shared manager styles keep both surfaces
+consistent. The browser regression covers small initial frames, fixed/flexible resizing,
+mobile widths, themes, Add MCP and fullscreen and runs inside the release gate.
+Current UI references now describe the iframe-free runtime and actual resource aliases.
+MCP 1.13.1 / toolset 2026.09.12.2 versions the resource refresh.
+
## 2026-09-12 — Hosted flow security checks
The hosted pipeline identified a ShellCheck usage-variable warning and a strict Semgrep
diff --git a/docs/generated/MCP-CATALOG.md b/docs/generated/MCP-CATALOG.md
index 9cd6329a..ff3bb90f 100644
--- a/docs/generated/MCP-CATALOG.md
+++ b/docs/generated/MCP-CATALOG.md
@@ -4,13 +4,13 @@
## Full MSO catalog
-<!-- mcp-toolset: server=1.13.0 version=2026.09.12.1 tools=104 read=49 write=34 exec=21 -->
+<!-- mcp-toolset: server=1.13.1 version=2026.09.12.2 tools=104 read=49 write=34 exec=21 -->
| Fact | Current source value |
|---|---:|
-| MCP server | `1.13.0` |
-| Toolset | `2026.09.12.1` |
-| Toolset changed at | `2026-09-12T12:55:00Z` |
+| MCP server | `1.13.1` |
+| Toolset | `2026.09.12.2` |
+| Toolset changed at | `2026-09-12T14:00:00Z` |
| Transport tools | **106** |
| Model/operator tools | **104** |
| Read | **49** |
@@ -138,7 +138,7 @@
## ChatGPT model profile
-<!-- mcp-chatgpt-profile: server=1.13.0 version=2026.09.12.1 tools=104 read=49 write=34 exec=21 app-only=2 total=106 -->
+<!-- mcp-chatgpt-profile: server=1.13.1 version=2026.09.12.2 tools=104 read=49 write=34 exec=21 app-only=2 total=106 -->
The ChatGPT profile automatically projects the complete MSO-owned generic model/operator catalog. OAuth scope is still enforced independently; app-only compatibility bridges stay app-only, and project-owned MCP tool names remain dynamic data behind the generic project bridge.
diff --git a/docs/integrations/CHATGPT-UI.md b/docs/integrations/CHATGPT-UI.md
index 98eb8021..73e2447c 100644
--- a/docs/integrations/CHATGPT-UI.md
+++ b/docs/integrations/CHATGPT-UI.md
@@ -1,172 +1,101 @@
# ChatGPT MCP App UI
-MSO treats ChatGPT as a presentation target without turning every tool call into a widget. JSON/text results remain the portable fallback for MCP clients that do not implement MCP Apps.
+MSO exposes two explicit presentation resources. Ordinary tools and workflow startup stay
+headless; clients without MCP Apps keep structured/text results.
-## Product contract: Block or Page
-
-The user-visible contract has exactly two canonical MCP App resources:
-
-| Surface | Entry tool | Resource | Intended use |
+| Surface | Entry tool | Resource | Purpose |
| --- | --- | --- | --- |
-| **Block** | `render_mso_block` | `ui://mso/block-v2.html` | Compact validation, action buttons, and CRUD input-output |
-| **Page** | `render_mso_page` | `ui://mso/page-v12.html` | Full native operator views and reviewed development, preview, or production app embeds |
-
-`workflow_start` is now headless. It remains the required orchestration bootstrap for multi-step work, including skill/recipe lookup, collision checks, workflow isolation, tracing, evidence, and learning, but it has no `_meta.ui.resourceUri` and no `openai/outputTemplate`. Starting background work therefore does not consume the answer with an unrelated workflow card.
-
-A normal data/action tool also remains headless unless its result genuinely needs one of the two explicit presentation tools. `project_get`, `project_diff`, and `vps_status`, for example, keep structured outputs with no UI binding; the Page may call them through the standard MCP Apps `tools/call` bridge when it needs a native view.
-
-## Visual identity
-
-Block and Page share one presentation-token source in `lib/mcp/ui-widget-tokens.ts`, aligned with the public `rahmanef.com` design system: light surface `#f4f4f7` with text `#1c1c1f`, dark surface `#1b1b20` with text `#f2f2f5`, and the restrained blue accent `#1f6df0`. Display copy uses the Plus Jakarta Sans stack, body copy uses Inter/system fallbacks, and routes or section labels use the mono stack. Primary actions use the editorial foreground/background inversion rather than a colored fill; blue is reserved for focus, state, and small accents.
-
-The widget first follows ChatGPT's `window.openai.theme` signal and updates on `openai:set_globals`; `prefers-color-scheme` remains the fallback for other MCP Apps hosts. The v2 resource URIs are intentional cache keys for this CSS/HTML refresh.
-
-Official references:
-
-- <https://developers.openai.com/plugins/build/chatgpt-ui>
-- <https://developers.openai.com/plugins/reference>
-
-## Block
-
-`render_mso_block` accepts bounded structured data rather than HTML:
+| Block | `render_mso_block` | `ui://mso/block-v3.html` | Validation, actions, bounded CRUD input/output |
+| Page | `render_mso_page`, `integration_setup_open` | `ui://mso/page-v14.html` | Native operator views and external-app browser handoff |
-- `kind`: `validation`, `crud`, or `action`;
-- title, description, and neutral/pending/success/warning/error status;
-- editable or read-only fields (`text`, `number`, `email`, `url`, `textarea`, `boolean`);
-- pass/warn/fail/info checks;
-- scalar output rows;
-- up to eight user-facing action buttons.
+## Layout and identity
-A Block button does **not** call a write/exec tool from inside the widget. After a real user click it sends a bounded follow-up message containing the action id and current field values. ChatGPT must then continue through the ordinary MCP tool path, so OAuth scope, argument validation, approval, rate limit, audit, workflow correlation, and destructive-operation rules remain authoritative. An action can require a second click with explicit confirmation copy; this is a presentation safeguard, not a replacement for server-side approval.
+Page fills the host's declared `containerDimensions.height`, or the full
+`containerDimensions.maxHeight` allowance. Legacy `window.openai.maxHeight` is the
+fallback, followed by a 680 px working area when no constraint is supplied. The former
+48% cap is removed. Height never derives from the current iframe viewport, preventing
+resize feedback. One Page body owns scrolling; fullscreen uses the actual viewport.
-The Block resource is self-contained, has no network/frame allowlist, constructs dynamic content with DOM text APIs, and accepts neither raw HTML nor an arbitrary URL/tool name. It stores only current form values in private widget state.
+Page reports measured dimensions through `ui/notifications/size-changed` after the
+MCP Apps handshake. Legacy hosts can use `notifyIntrinsicHeight`. The host controls
+the enclosing frame and may impose a smaller fixed height. Fullscreen/PiP require an
+explicit click and are hidden when the host declares them unsupported.
-## Page
+Standard host context controls theme, display mode, dimensions and safe-area insets.
+Legacy OpenAI globals and the browser color-scheme remain compatible fallbacks.
+The compact header, readable controls, flat navigation and shared integration styles
+follow the existing MSO workbench. Block, Page and native Integrations embed the existing
+`public/icon.svg` mark without an image request; the shell uses that same public asset.
+Presentation colors and fonts remain in `lib/presentation/widget-tokens.ts`.
-`render_mso_page` accepts an MSO-style route plus optional project/SHA context:
+## Block behavior
-- `/` — Page landing;
-- `/monitor` — native bounded VPS status;
-- `/project` — native project snapshot;
-- `/diff` — native project diff summary;
-- `/browser` — remote-browser handoff;
-- `/apps/<reviewed-app-id>` — reviewed app target.
+Block accepts bounded structured fields, checks, scalar outputs and up to eight actions;
+it never accepts raw HTML or an arbitrary tool name. A click sends a bounded follow-up
+message containing the selected action and field values. The agent then uses ordinary
+scoped tools. Server authorization, validation, rate limits and audit remain authoritative.
+Private widget state contains current form values. Block has no network or frame allowlist.
-The model cannot pass raw HTML or an external URL. App identity, origin, start path, renderer, environment (`development`, `preview`, `production`, or `other`), sandbox, and presentation mode come from the bounded per-instance reviewed registry at `~/.mso/surface-apps.json` (or the explicit `MSO_SURFACE_APPS_JSON` override). Portable source defaults to an empty external-app catalog, and the Page resource rebuilds its `SAFE_APPS` plus CSP frame domains whenever it is read. An iframe target is valid only when its exact HTTPS origin is also present in the Page resource's `_meta.ui.csp.frameDomains`, and the browser runtime revalidates origin plus the approved path prefix before assigning `iframe.src`.
+## Page routes and trust
-Apps that keep restrictive `X-Frame-Options` or `frame-ancestors` remain `remote`. MSO preserves those protections and offers the Camoufox seam instead of stripping headers. User-installed runtime HTML apps and arbitrary HTML snippets cannot add themselves to the ChatGPT frame allowlist; they remain opaque-origin `srcDoc` content inside the authenticated MSO shell.
-
-## Compatibility during migration
-
-The canonical `resources/list` response advertises only Block and Page. Previous Page/Block URIs, including `ui://mso/page-v11.html`, remain readable, but are not listed, so already-cached ChatGPT descriptors do not fail immediately:
-
-- `ui://mso/block-v1.html` resolves to the current Block resource.
-- `ui://mso/page-v1.html` resolves to the current Page resource.
-- `ui://mso/workflow-progress-v3.html` resolves to the Block resource. The Block recognizes the old workflow structured result and presents a small compatibility summary rather than the historical live progress dashboard.
-- `ui://mso/surface-v5.html` resolves to the Page resource.
-
-`render_mso_surface` remains app-only as a compatibility alias for a cached Page widget and has no resource binding of its own. `workflow_status` likewise remains app-only for cached workflow widgets and native operator use. New model calls use `render_mso_page`; new workflows do not create a widget.
-
-## MCP contract
-
-1. `resources/list` / `resources/read` expose the two canonical `ui://…` resources as `text/html;profile=mcp-app`.
-2. Only `render_mso_block` and `render_mso_page` advertise `_meta.ui.resourceUri` plus the OpenAI `outputTemplate` compatibility alias.
-3. Every ChatGPT transport action declares an `outputSchema`. Stable UI-critical tools use typed schemas; other actions use the bounded `{ result }` envelope. Generic MCP clients retain their existing text fallback where applicable.
-4. Sandboxed Pages use the standard `tools/call` bridge for native data refreshes. ChatGPT-only helpers such as display mode, private widget state, follow-up messages, and `openExternal` are feature-detected.
-5. The dedicated UI origin is deployment-derived: explicit `OS_MCP_UI_ORIGIN` wins; otherwise an `mso.<domain>` public origin derives `mso-ui.<domain>`, and other safe public origins are reused. Standard CSP fields live only in `_meta.ui.csp`; the legacy `openai/widgetCSP` object retains only `redirect_domains` for `Open in MSO`.
-
-Current ChatGPT model profile is source-generated from the complete MSO-owned generic model/operator catalog; exact counts live in [`../generated/MCP-CATALOG.md`](../generated/MCP-CATALOG.md). `workflow_status` and `render_mso_surface` remain app-only compatibility bridges. Exactly two model tools bind UI resources: `render_mso_block` and `render_mso_page`.
-
-## Source boundaries
-
-| Contract | MSO source |
+| Route | Context / behavior |
| --- | --- |
-| Shared Block/Page visual tokens and host-theme bridge | `lib/mcp/ui-widget-tokens.ts` |
-| Block resource/runtime | `lib/mcp/ui-block.ts` |
-| Block tool/schema | `lib/mcp/tools-block.ts` |
-| Page resource/runtime | `lib/mcp/ui-surface.ts`, `lib/mcp/ui-surface-script.ts`, `lib/mcp/ui-surface-style.ts` |
-| Page security catalog/router | `lib/mcp/surface-catalog.ts`, `lib/mcp/tools-surface.ts` |
-| Resource registry and legacy aliases | `lib/mcp/ui-resources.ts` |
-| Workflow bootstrap/lifecycle | `lib/mcp/tools-workflow-start.ts`, `lib/mcp/tools-workflow-lifecycle.ts` |
-| Resource capability / RPC | `lib/mcp/dispatch.ts` |
-| MCP descriptor/profile contract | `lib/mcp/tool-contract.ts` |
-| Toolset signature | `lib/mcp/toolset.ts` |
-| Contract tests | `lib/mcp/ui-resources.test.ts`, `lib/mcp/ui-widget-theme.test.ts`, `lib/mcp/tools-block.test.ts`, `lib/mcp/tools-surface.test.ts`, `lib/mcp/surface-catalog.test.ts` |
-
-## Flow
-
-```text
-ChatGPT model
- │
- ├─ workflow_start ──→ structured workflow id only (headless)
- │
- ├─ bounded data/action tools ──→ structured/text results
- │
- ├─ render_mso_block ──→ compact validation/action/CRUD block
- │ └─ user click → follow-up message
- │ └─ normal scoped/approved tool call
- │
- └─ render_mso_page ──→ full MSO Page
- ├─ /monitor ──tools/call──→ vps_status
- ├─ /project ──tools/call──→ project_get
- ├─ /diff ──tools/call──→ project_diff
- ├─ exact-origin iframe after explicit review
- └─ remote-browser seam for anti-frame apps
-```
-
-## Manual ChatGPT smoke journeys
-
-| Journey | Suggested prompt/action | Pass condition |
-| --- | --- | --- |
-| Headless workflow | Start a harmless multi-step workflow | `workflow_start` returns a workflow id but opens no MCP App |
-| Validation Block | Render deployment checks with Approve/Revise actions | compact Block renders; click creates a follow-up; no mutation happens inside the widget |
-| CRUD Block | Render editable sample fields and a Save action | values remain editable, required validation works, and submitted values return through the follow-up message |
-| Native Page | Render `/monitor`, then `/project` | Page opens and refreshes bounded data through `tools/call` |
-| Configured Page app | Render `/apps/<configured-app-id>` after setting a reviewed local catalog | iframe stays on the configured exact HTTPS origin/start prefix; fullscreen stays user-initiated |
-| Anti-frame fallback | Open a Page target classified `remote` | no header stripping or unreviewed frame occurs; the remote-browser handoff is shown |
-| Filesystem CRUD | Create/read/copy/move/delete a disposable file through ordinary tools | Block/Page presentation never changes the filesystem permission boundary |
-
-## Deployment and client refresh
-
-After changing UI resources or tool metadata:
-
-1. run targeted tests, `bun run verify`, and the official production release path;
-2. verify `initialize` reports MCP server `1.10.0` and toolset `2026.09.05.1`;
-3. verify `tools/list` exposes 66 ChatGPT transport tools, keeps `workflow_start` headless, marks the two compatibility actions app-only, and binds only `render_mso_block` / `render_mso_page`;
-4. verify `resources/list` contains exactly `ui://mso/block-v2.html` and `ui://mso/page-v12.html`, both with `text/html;profile=mcp-app`;
-5. verify Block has no frame domain and Page has only reviewed exact origins;
-6. refresh/re-scan the ChatGPT development app so its cached action/resource snapshot is replaced.
-
-A widget already rendered in an old conversation cannot be removed retroactively. After the server deployment, a stale workflow card indicates a cached ChatGPT connector snapshot, not a new `workflow_start` binding.
-
-## Page initialization and readiness (v3)
-
-Page sends the MCP Apps `ui/initialize` request with `appInfo`, `appCapabilities` and
-protocol version `2026-01-26`, then acknowledges with `ui/notifications/initialized`.
-Host result notifications and wrapped legacy `window.openai.toolOutput` use the same validated
-route interpreter. Unchanged results or host globals do not remount a running embedded app.
-The cached `ui://mso/page-v2.html` URI is a read-only alias for current Page bytes.
-
-A reviewed game sends a versioned readiness acknowledgement; Page validates its exact origin
-and iframe source. An iframe load event does not prove readiness. The bounded timeout shows
-Retry preview and Open production controls instead of a permanent skeleton. The production
-link is user-initiated through the host, and the Page redirect allowlist contains only MSO and
-the reviewed game origin. Normal host tools and headless workflows are unchanged.
-
-Verification: `node scripts/e2e/mcp-page.mjs` exercises a pure MCP host without `window.openai`,
-legacy wrapped output, readiness/source checks, timeout/retry and no duplicate iframe reloads.
-For Play Together, the independent game server must allow every reviewed ancestor on `/embed`
-and keep the inner cartridge at `/embed/game-frame.html`; root app framing stays restricted.
-
-Page reports measured dimensions through `ui/notifications/size-changed`; its layout avoids viewport-relative height feedback when the host resizes the component.
-
-### Reviewed app authentication
-
-Page v6 adds a code-owned optional external-auth path for reviewed apps. The nested application
-can highlight the **Google login in browser** control using a public versioned message, but cannot
-navigate the host or supply the target URL. Only an explicit click on the host control invokes
-`ui/open-link` or the supported `openExternal` fallback. The path must remain on the reviewed app
-origin. Existing iframe sandbox restrictions are unchanged. OAuth finishes in the browser tab;
-no automatic session sharing, cookie copying, callback code forwarding or chat token transfer is
-implied. Cached Page v5 resources remain readable aliases. Play Together's entry is
-`/?auth=google`; Google itself is never framed by MSO.
+| `/` | Workspace navigation |
+| `/integrations` | Shared connection manager, Add MCP and private credential forms |
+| `/monitor` | Bounded server status through `vps_status` |
+| `/project` | Explicit project context; `project_get` |
+| `/diff` | Explicit project and optional SHA; `project_diff` |
+| `/browser` | Open the MSO remote browser |
+| `/apps/<reviewed-id>` | Validate the deployment registry and hand off to the remote browser |
+
+Page does not mount third-party iframes. It accepts neither arbitrary HTML nor external
+URLs from the model. The bounded owner registry (`~/.mso/surface-apps.json`, or the explicit
+`MSO_SURFACE_APPS_JSON` override) supplies app identity, HTTPS origin and approved path.
+Public source defaults to an empty app catalog. Resource reads rebuild this safe catalog;
+the browser rechecks app identity, origin and path before exposing a handoff.
+
+Native integration forms and tools use the same capability/connection contracts as the
+browser. Credentials travel directly to MSO using private, expiring setup authorization,
+never through chat or ordinary tool arguments. Public guides remain readable without
+write access. Project MCP and automation contracts are in [automation flows](../AUTOMATION-FLOWS.md).
+
+User-installed HTML apps cannot grant themselves Page trust. The authenticated cockpit
+retains its framing protections; external sites keep their own authentication boundaries.
+
+## Bridge, metadata and compatibility
+
+Page initializes MCP Apps protocol `2026-01-26`, then sends
+`ui/notifications/initialized`. Only parent-source messages are accepted. Tool result
+notifications and legacy wrapped `window.openai.toolOutput` use the same route validator.
+Unchanged outputs do not remount views; teardown clears active forms and observers.
+
+Page-bound tools advertise standard `ui.resourceUri` only. Block also retains its
+`openai/outputTemplate` compatibility binding. Every ChatGPT tool has an output schema;
+exact tools, counts and scopes are generated in [the catalog](../generated/MCP-CATALOG.md).
+
+Resource CSP is explicit: neither surface allows nested frames; Page permits its MSO
+origin for private setup requests. `OS_MCP_UI_ORIGIN` controls the widget origin, otherwise
+the configured public origin derives it. Legacy redirect metadata supports Open in MSO.
+
+Only the two current resources are listed. Older Block/Page URIs remain read aliases for
+current bytes, including Block v2 and Page v13. `workflow_status` and `render_mso_surface`
+remain app-only compatibility tools. `workflow_start` has no UI binding.
+
+## Verification and deployment
+
+Run `node scripts/e2e/mcp-page.mjs` for a small initial host frame, standard-versus-legacy
+height precedence, fixed/flexible resize, light/dark theme, 320–1280 px layouts, logo,
+Add MCP and fullscreen. The release gate runs this browser contract automatically.
+`node scripts/e2e/integrations.mjs` adds shared manager user CRUD, keyboard selection,
+provider search and 320–1920 px reflow. Production release journeys verify authorization,
+real server handlers and provider revocation using synthetic stores.
+
+After shipping, compare live discovery/version/hash against `lib/mcp/toolset.ts` and the
+generated catalog, verify the two resource URIs, and reopen the Page. Hosts cache tool
+and resource descriptors: a development-app rescan/reconnect may still be needed.
+The server cannot replace an already mounted document in an old conversation.
+
+Official references:
+- [MCP Apps host dimensions](https://apps.extensions.modelcontextprotocol.io/api/interfaces/app.McpUiHostContext.html)
+- [MCP Apps specification](https://github.com/modelcontextprotocol/ext-apps/blob/main/specification/draft/apps.mdx)
+- [OpenAI plugin reference](https://developers.openai.com/plugins/reference)
diff --git a/frontend/slices/os-shell/shell.manifest.ts b/frontend/slices/os-shell/shell.manifest.ts
index 2fe94ebf..e7fee2f6 100644
--- a/frontend/slices/os-shell/shell.manifest.ts
+++ b/frontend/slices/os-shell/shell.manifest.ts
@@ -2,6 +2,7 @@
// AppShell. This is the ONE place brand + the built-in app set + shell features
// are declared; appshell core imports none of it. Runtime-installed apps are
// merged on top in os-root (they come from a hook, not static config).
+import { createElement } from "react";
import type { AppDescriptor, Brand, FeatureDescriptor } from "@/features/appshell";
import { DEFAULT_FEATURES } from "@/features/appshell";
import { filesManagerApp } from "@/features/files-manager";
@@ -25,7 +26,7 @@ import { APP_MARKS } from "./brand-marks";
export const TOPSIDE_BRAND: Brand = {
name: "MSO",
- logo: "M",
+ logo: createElement("img", { src: "/icon.svg", alt: "", width: 16, height: 16 }),
idleAppName: "Finder",
};
diff --git a/lib/infra/connection-ui-style.ts b/lib/infra/connection-ui-style.ts
index 2d81d060..08184fb6 100644
--- a/lib/infra/connection-ui-style.ts
+++ b/lib/infra/connection-ui-style.ts
@@ -5,11 +5,12 @@ export const CONNECTION_MANAGER_STYLE = String.raw`
.integration .identity-guide[open]{padding-bottom:12px}
.integration .connection-state[data-ready=true]{color:var(--success-text);background:color-mix(in srgb,var(--success-text) 10%,var(--surface))}
-.integration.manager{--integration-rail:224px;--integration-gap:24px;max-width:1180px;width:100%}
+.surface>.body.integration{margin:0 auto}
+.integration.manager{--integration-rail:192px;--integration-gap:24px;max-width:1180px;width:100%}
.integration .identity-heading,.integration .provider-heading,.integration .connection-heading{display:flex;align-items:center;justify-content:space-between;gap:16px}
.integration .identity-heading :is(h1,h2){margin:0}.integration .identity-heading p{margin:5px 0 0}
.integration .identity-count{font:600 12px var(--font-body);color:var(--text-dim);white-space:nowrap}
-.integration .identity-bar{display:flex;gap:10px;align-items:end;flex-wrap:wrap;margin:22px 0}
+.integration .identity-bar{display:flex;gap:10px;align-items:end;flex-wrap:wrap;margin:18px 0}
.integration .identity-bar>label{flex:1;max-width:340px;min-width:160px;margin:0}
.integration .identity-bar select{margin-top:6px}
.integration .identity-tools{position:relative;margin:0;padding:0;border:0;background:none}
@@ -28,7 +29,7 @@ export const CONNECTION_MANAGER_STYLE = String.raw`
.integration .provider-title h2{font-size:22px;margin:0}.integration .provider-title p{margin:4px 0 0}
.integration .provider-count{margin-left:auto;font:600 11px var(--font-body);color:var(--text-dim)}
.integration .identity-detail{min-width:0}.integration .identity-detail>p{max-width:66ch}
-.integration .connection-card{border:1px solid var(--sep-strong);border-radius:14px;padding:20px;margin:14px 0;background:var(--field)}
+.integration .connection-card{border:0;border-top:1px solid var(--sep);border-radius:0;padding:20px 0;margin:18px 0 0;background:transparent}
.integration .connection-card h3{margin:0;font-size:17px;overflow-wrap:anywhere}
.integration .connection-heading{align-items:start}.integration .connection-heading small{margin:3px 0 0}
.integration .connection-state{font-size:12px;line-height:1.5;border:1px solid var(--sep-strong);border-radius:99px;padding:3px 9px;white-space:nowrap}
@@ -40,19 +41,20 @@ export const CONNECTION_MANAGER_STYLE = String.raw`
.integration .identity-feedback{min-height:24px;margin:12px 0;color:var(--text-dim);overflow-wrap:anywhere}
.integration .identity-path{font:12px var(--font-mono);overflow-wrap:anywhere;margin:10px 0 18px;color:var(--text-dim)}
.integration .identity-check{display:flex;align-items:center;gap:8px}.integration .identity-check input{width:18px;height:18px;flex:none}
-.integration .identity-empty{border:1px dashed var(--sep-strong);border-radius:14px;padding:28px;margin:20px 0;background:var(--field)}
+.integration .identity-empty{border:0;border-top:1px solid var(--sep);border-radius:0;padding:24px 0;margin:20px 0;background:transparent}
.integration .identity-empty h3{margin:0 0 8px;font-size:17px}.integration .identity-empty p{max-width:50ch;margin-bottom:18px}
.integration .danger{color:var(--destructive-text)}.integration .identity-guide a{display:inline-block;margin:8px 12px 5px 0}
.integration .identity-guide li{font-size:13px}.integration .identity-muted{font-size:12px;color:var(--text-dim)}
.integration .identity-form{border:1px solid var(--sep-strong);border-radius:12px;padding:16px}
.integration .identity-readonly{padding:12px 16px;border-left:3px solid var(--os-accent);background:var(--field);font-size:13px}
-.integration .identity-summary{display:flex;align-items:center;gap:18px;padding:16px 20px;margin-bottom:22px;border:1px solid var(--sep);border-radius:14px;background:var(--field)}
+.integration .identity-summary{display:flex;align-items:center;gap:18px;padding:0 0 18px;margin-bottom:22px;border:0;border-bottom:1px solid var(--sep);border-radius:0;background:transparent}
.integration .identity-ring{width:64px;height:64px;flex:none;border-radius:50%;display:grid;place-items:center;background:conic-gradient(var(--os-accent) var(--ready-angle),var(--sep) 0)}
.integration .identity-ring strong{display:grid;place-items:center;width:50px;height:50px;border-radius:50%;background:var(--surface);font:700 18px var(--font-body)}
.integration .identity-summary dl{display:flex;gap:24px;flex-wrap:wrap;margin:0}.integration .identity-summary dt{font-size:12px;color:var(--text-dim)}.integration .identity-summary dd{font-weight:700;font-size:20px;margin:2px 0 0}
.integration :is(button,a,input,select,summary):focus-visible{outline:2px solid var(--os-accent);outline-offset:3px}
-@media(max-width:760px){.integration.manager{--integration-rail:180px;--integration-gap:16px}.integration .identity-providers{padding-right:12px}.integration .identity-heading{align-items:start}.integration .identity-count{white-space:normal;text-align:right}.integration .identity-summary dl{gap:16px}}
-@media(max-width:560px){.integration .owner-picker{max-width:none;flex-basis:100%}.integration .identity-workbench{width:100%}.integration .identity-layout{grid-template-columns:1fr;gap:18px}.integration .identity-providers{grid-template-columns:repeat(2,minmax(0,1fr));max-height:240px;overflow-y:auto;padding:0 0 12px;border:0;border-bottom:1px solid var(--sep)}.integration .identity-providers input{grid-column:1/-1;position:sticky;top:0;background:var(--surface);z-index:1}.integration .identity-providers button{font-size:12px;padding:7px;gap:7px}.integration .identity-fields{grid-template-columns:1fr}.integration .identity-bar{gap:8px;margin:18px 0}.integration .identity-bar>label{max-width:none;flex-basis:100%}.integration .connection-card{padding:16px}.integration .provider-heading{align-items:start;flex-wrap:wrap}.integration .identity-summary{padding:14px;gap:14px}.integration .identity-summary dl{gap:14px}.integration .identity-summary dd{font-size:17px}.integration .identity-tools[open] .identity-actions{left:0;right:auto}.integration .identity-heading p{font-size:13px}}
+@media(max-width:760px){.surface>.body.integration{margin:0 auto}
+.integration.manager{--integration-rail:180px;--integration-gap:16px}.integration .identity-providers{padding-right:12px}.integration .identity-heading{align-items:start}.integration .identity-count{white-space:normal;text-align:right}.integration .identity-summary dl{gap:16px}}
+@media(max-width:560px){.integration .owner-picker{max-width:none;flex-basis:100%}.integration .identity-workbench{width:100%}.integration .identity-layout{grid-template-columns:1fr;gap:18px}.integration .identity-providers{grid-template-columns:repeat(2,minmax(0,1fr));max-height:240px;overflow-y:auto;padding:0 0 12px;border:0;border-bottom:1px solid var(--sep)}.integration .identity-providers input{grid-column:1/-1;position:sticky;top:0;background:var(--surface);z-index:1}.integration .identity-providers button{font-size:12px;padding:7px;gap:7px}.integration .identity-fields{grid-template-columns:1fr}.integration .identity-bar{gap:8px;margin:18px 0}.integration .identity-bar>label{max-width:none;flex-basis:100%}.integration .connection-card{padding:16px}.integration .provider-heading{align-items:start;flex-wrap:wrap}.integration .identity-summary{padding:0 0 16px;gap:14px}.integration .identity-summary dl{gap:14px}.integration .identity-summary dd{font-size:17px}.integration .identity-tools[open] .identity-actions{left:0;right:auto}.integration .identity-heading p{font-size:13px}}
.integration .owner-picker{position:relative;min-width:220px;flex:1;max-width:340px}.integration .identity-picker-label{display:block;margin-bottom:6px;font-size:12px;font-weight:650;color:var(--text-dim)}.integration .owner-picker-trigger{display:flex;align-items:center;width:100%;justify-content:space-between;text-align:left;background:var(--field);border-color:var(--sep-strong)}
.integration .owner-picker-popup{position:absolute;z-index:3;top:calc(100% + 6px);left:0;right:0;max-height:240px;overflow:auto;padding:6px;background:var(--surface);border:1px solid var(--sep-strong);border-radius:var(--radius);box-shadow:var(--shadow-pop)}
diff --git a/lib/infra/setup-page.ts b/lib/infra/setup-page.ts
index 2794afe4..a500d84a 100644
--- a/lib/infra/setup-page.ts
+++ b/lib/infra/setup-page.ts
@@ -1,3 +1,4 @@
+import { MSO_LOGO_SVG } from "@/lib/presentation/logo";
import {PORTABILITY_SCRIPT,PORTABILITY_STYLE} from "./portable/ui";
import { randomBytes } from "node:crypto";
import { MSO_WIDGET_TOKENS } from "@/lib/presentation/widget-tokens";
@@ -8,7 +9,7 @@ import { connectionCatalog } from "./connection-registry";
export function integrationSetupPage() {
const nonce = randomBytes(18).toString("base64");
const catalog = JSON.stringify(connectionCatalog()).replace(/</g,"\\u003c");
- const html = `<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta name="referrer" content="no-referrer"><title>Integrations · MSO</title><style nonce="${nonce}">${MSO_WIDGET_TOKENS}${INTEGRATION_FORM_STYLE}${CONNECTION_MANAGER_STYLE}${PORTABILITY_STYLE}*{box-sizing:border-box}body{margin:0;background:var(--surface);padding:clamp(16px,3vw,40px);font-family:var(--font-body);color:var(--text)}.site-bar{max-width:1180px;margin:0 auto 26px;font-size:13px;display:flex;justify-content:space-between;gap:12px}.site-bar strong{font-weight:750}.site-bar span{color:var(--text-dim)}button{border:1px solid var(--sep-strong);border-radius:9px;background:var(--field);color:var(--text);padding:9px 13px;cursor:pointer}a{color:var(--os-accent)}</style></head><body><header class="site-bar"><strong>MSO / Integrations</strong><span>Your service connections</span></header><main id="setup" class="integration"><h1>Integrations</h1><p>Preparing the native provider catalog…</p><noscript>Enable JavaScript to open the secure credential form. Credentials can also be entered through the MSO terminal.</noscript></main><script nonce="${nonce}">const INTEGRATIONS_CATALOG=${catalog};${INTEGRATION_FORM_SCRIPT}${CONNECTION_MANAGER_SCRIPT}${PORTABILITY_SCRIPT}${INTEGRATION_BROWSER_SCRIPT}</script></body></html>`;
+ const html = `<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta name="referrer" content="no-referrer"><title>Integrations · MSO</title><style nonce="${nonce}">${MSO_WIDGET_TOKENS}${INTEGRATION_FORM_STYLE}${CONNECTION_MANAGER_STYLE}${PORTABILITY_STYLE}*{box-sizing:border-box}body{margin:0;background:var(--surface);padding:clamp(16px,3vw,40px);font-family:var(--font-body);color:var(--text)}.site-bar{max-width:1180px;margin:0 auto 26px;font-size:13px;display:flex;justify-content:space-between;gap:12px}.site-bar strong{display:flex;align-items:center;gap:10px;font-weight:750}.site-bar svg{width:30px;height:30px}.site-bar span{color:var(--text-dim)}button{border:1px solid var(--sep-strong);border-radius:9px;background:var(--field);color:var(--text);padding:9px 13px;cursor:pointer}a{color:var(--os-accent)}</style></head><body><header class="site-bar"><strong>${MSO_LOGO_SVG} MSO</strong><span>Your service connections</span></header><main id="setup" class="integration"><h1>Integrations</h1><p>Preparing the native provider catalog…</p><noscript>Enable JavaScript to open the secure credential form. Credentials can also be entered through the MSO terminal.</noscript></main><script nonce="${nonce}">const INTEGRATIONS_CATALOG=${catalog};${INTEGRATION_FORM_SCRIPT}${CONNECTION_MANAGER_SCRIPT}${PORTABILITY_SCRIPT}${INTEGRATION_BROWSER_SCRIPT}</script></body></html>`;
return { html, csp: `default-src 'none'; script-src 'nonce-${nonce}'; style-src 'nonce-${nonce}'; connect-src 'self'; form-action 'none'; base-uri 'none'; frame-ancestors 'none'` };
}
export function integrationPageResponse() {
diff --git a/lib/mcp/integration-setup.test.ts b/lib/mcp/integration-setup.test.ts
index 06a71346..2971fce2 100644
--- a/lib/mcp/integration-setup.test.ts
+++ b/lib/mcp/integration-setup.test.ts
@@ -20,7 +20,7 @@ describe("MCP integration setup privacy", () => {
it("requires write scope, accepts no credential parameters, and uses the existing Page", async () => {
const tool = SURFACE_TOOLS.find(t => t.name === "integration_setup_open")!;
expect(tool.scope).toBe("write"); expect(Object.keys(tool.inputSchema.properties)).toEqual(["user", "connection", "provider", "method"]);
- expect((tool.meta?.ui as { resourceUri?: string }).resourceUri).toMatch(/^ui:\/\/mso\/page-v13\.html$/);
+ expect((tool.meta?.ui as { resourceUri?: string }).resourceUri).toMatch(/^ui:\/\/mso\/page-v14\.html$/);
expect(tool.meta?.["openai/outputTemplate"]).toBeUndefined();
expect((await resolveSurfaceRoute("/integrations")).kind).toBe("integrations");
const script = await msoSurfaceScript();
diff --git a/lib/mcp/tools-surface.test.ts b/lib/mcp/tools-surface.test.ts
index 2f3d0b49..0e25501a 100644
--- a/lib/mcp/tools-surface.test.ts
+++ b/lib/mcp/tools-surface.test.ts
@@ -39,7 +39,7 @@ describe("MSO Page MCP tools", () => {
url: "https://demo.example.test/embed",
});
expect(result.app).not.toHaveProperty("sandbox");
- expect((render.meta?.ui as { resourceUri?: string }).resourceUri).toMatch(/^ui:\/\/mso\/page-v13\.html$/);
+ expect((render.meta?.ui as { resourceUri?: string }).resourceUri).toMatch(/^ui:\/\/mso\/page-v14\.html$/);
expect(render.meta?.["openai/outputTemplate"]).toBeUndefined();
});
@@ -58,7 +58,7 @@ describe("MSO Page MCP tools", () => {
it("uses only the standard resource binding for Page tools", () => {
for (const name of ["render_mso_page", "integration_setup_open"] as const) {
const value = tool(name);
- expect((value.meta?.ui as { resourceUri?: string }).resourceUri).toMatch(/^ui:\/\/mso\/page-v13\.html$/);
+ expect((value.meta?.ui as { resourceUri?: string }).resourceUri).toMatch(/^ui:\/\/mso\/page-v14\.html$/);
expect(value.meta?.["openai/outputTemplate"]).toBeUndefined();
}
});
diff --git a/lib/mcp/toolset.ts b/lib/mcp/toolset.ts
index 459c13d6..49b5b75c 100644
--- a/lib/mcp/toolset.ts
+++ b/lib/mcp/toolset.ts
@@ -3,9 +3,9 @@ import type { Scope } from "./scope";
import type { McpTool } from "./tool-kit";
import { toolDescriptor, type McpToolProfile } from "./tool-contract";
-export const MCP_SERVER_VERSION = "1.13.0";
-export const MCP_TOOLSET_VERSION = "2026.09.12.1";
-export const MCP_TOOLSET_CHANGED_AT = "2026-09-12T12:55:00Z";
+export const MCP_SERVER_VERSION = "1.13.1";
+export const MCP_TOOLSET_VERSION = "2026.09.12.2";
+export const MCP_TOOLSET_CHANGED_AT = "2026-09-12T14:00:00Z";
export type McpToolsetInfo = {
serverVersion: string;
diff --git a/lib/mcp/ui-block.ts b/lib/mcp/ui-block.ts
index 12cd748f..d30da9da 100644
--- a/lib/mcp/ui-block.ts
+++ b/lib/mcp/ui-block.ts
@@ -1,17 +1,18 @@
+import { MSO_LOGO_SVG } from "@/lib/presentation/logo";
import { widgetResourceMeta } from "./ui-config";
import { MSO_WIDGET_THEME_SCRIPT, MSO_WIDGET_TOKENS } from "./ui-widget-tokens";
-export const MSO_BLOCK_URI = "ui://mso/block-v2.html";
+export const MSO_BLOCK_URI = "ui://mso/block-v3.html";
const MIME = "text/html;profile=mcp-app";
-const html = String.raw`<main class="mso-block" aria-live="polite">
+const html = String.raw`<meta charset="utf-8"><main class="mso-block" aria-live="polite">
<style>
${MSO_WIDGET_TOKENS}
-*{box-sizing:border-box}html,body{margin:0;min-width:0;background:transparent;color:var(--text)}body{padding:7px;font-family:var(--font-body)}.card{position:relative;overflow:hidden;border:1px solid var(--sep-strong);border-radius:var(--radius);background:var(--surface);box-shadow:var(--shadow-pop)}.card::before{content:"";display:block;height:3px;background:var(--os-accent)}.head{display:flex;align-items:flex-start;gap:10px;padding:11px 12px 9px}.mark{display:grid;width:30px;height:30px;flex:0 0 30px;place-items:center;border-radius:6px;background:var(--text);color:var(--surface);font-family:var(--font-display);font-size:12px;font-weight:800;letter-spacing:-.03em}.copy{min-width:0;flex:1}.eyebrow{font-family:var(--font-mono);font-size:8px;font-weight:650;letter-spacing:.11em;text-transform:uppercase;color:var(--text-dim)}h2{margin:2px 0 0;font-family:var(--font-display);font-size:13px;font-weight:720;letter-spacing:-.026em;line-height:1.3}.description{margin:4px 0 0;font-size:10px;line-height:1.45;color:var(--text-dim);overflow-wrap:anywhere}.status{flex:0 0 auto;border:1px solid var(--sep-strong);border-radius:999px;background:var(--field);padding:4px 7px;font-family:var(--font-mono);font-size:8px;font-weight:700;letter-spacing:.06em;text-transform:uppercase}.status.pending{border-color:color-mix(in srgb,var(--os-accent) 45%,var(--sep));background:color-mix(in srgb,var(--os-accent) 8%,var(--surface))}.status.success{border-color:color-mix(in srgb,var(--success) 48%,var(--sep));background:color-mix(in srgb,var(--success) 8%,var(--surface))}.status.warning{border-color:color-mix(in srgb,var(--warning) 52%,var(--sep));background:color-mix(in srgb,var(--warning) 9%,var(--surface))}.status.error{border-color:color-mix(in srgb,var(--destructive-text) 48%,var(--sep));background:color-mix(in srgb,var(--destructive-text) 8%,var(--surface))}.section{border-top:1px solid var(--sep);padding:9px 12px}.section-title{margin:0 0 7px;font-family:var(--font-mono);font-size:8px;font-weight:650;letter-spacing:.1em;text-transform:uppercase;color:var(--text-dim)}.checks,.outputs{display:grid;gap:5px}.check,.output{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:7px;min-height:27px}.dot{width:7px;height:7px;border-radius:50%;background:var(--text-faint)}.dot.info{background:var(--info)}.dot.pass{background:var(--success)}.dot.warn{background:var(--warning)}.dot.fail{background:var(--destructive-text)}.check strong,.output strong{min-width:0;font-size:10px}.detail,.value{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:9px;color:var(--text-dim)}.fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.field{min-width:0}.field.full{grid-column:1/-1}.field label{display:block;margin-bottom:4px;font-size:9px;font-weight:650}.required{color:var(--destructive-text)}input,textarea{width:100%;min-height:34px;border:1px solid var(--sep-strong);border-radius:8px;background:var(--field);color:var(--text);caret-color:var(--os-accent);padding:7px 8px;font:inherit;font-size:10px;outline:none}input::placeholder,textarea::placeholder{color:var(--text-faint)}textarea{min-height:72px;resize:vertical}input:focus,textarea:focus{border-color:var(--os-accent);box-shadow:0 0 0 2px color-mix(in srgb,var(--os-accent) 17%,transparent)}.boolean{display:flex;min-height:34px;align-items:center;gap:7px;border:1px solid var(--sep-strong);border-radius:8px;padding:7px 8px;background:var(--field);font-size:10px}.boolean input{width:15px;min-height:15px;margin:0;accent-color:var(--os-accent)}.readonly{min-height:34px;border:1px solid var(--sep);border-radius:8px;padding:8px;background:var(--inset);font-size:10px;overflow-wrap:anywhere}.actions{display:flex;align-items:center;justify-content:flex-end;gap:6px;flex-wrap:wrap}.feedback{min-width:0;flex:1;font-size:9px;color:var(--text-dim)}button{appearance:none;min-height:32px;border:1px solid var(--sep-strong);border-radius:8px;background:transparent;color:var(--text);padding:6px 10px;font:inherit;font-size:10px;font-weight:680;cursor:pointer;transition:transform .18s cubic-bezier(.16,1,.3,1),box-shadow .18s ease,background-color .18s ease}button:hover{background:var(--hover-strong);transform:translateY(-1px)}button:active{transform:translateY(1px) scale(.99)}button.primary{border-color:var(--text);background:var(--text);color:var(--surface)}button.primary:hover{background:var(--text);box-shadow:0 8px 22px color-mix(in srgb,var(--text) 15%,transparent)}button.danger{border-color:color-mix(in srgb,var(--destructive-text) 48%,var(--sep));background:color-mix(in srgb,var(--destructive-text) 7%,var(--surface));color:var(--destructive-text)}button:disabled{cursor:default;opacity:.55;transform:none}button:focus-visible{outline:2px solid var(--os-accent);outline-offset:2px}.empty{padding:4px 0;font-size:10px;color:var(--text-dim)}@media(max-width:520px){body{padding:4px}.card{border-radius:9px}.head{padding:10px}.section{padding:8px 10px}.fields{grid-template-columns:1fr}.field.full{grid-column:auto}.actions{align-items:stretch}.feedback{width:100%;flex-basis:100%}button{flex:1}}
+*{box-sizing:border-box}html,body{margin:0;min-width:0;background:transparent;color:var(--text)}body{padding:7px;font-family:var(--font-body)}.card{position:relative;overflow:hidden;border:1px solid var(--sep-strong);border-radius:var(--radius);background:var(--surface);box-shadow:var(--shadow-pop)}.card::before{content:"";display:block;height:3px;background:var(--os-accent)}.head{display:flex;align-items:flex-start;gap:10px;padding:11px 12px 9px}.mark{display:grid;width:30px;height:30px;flex:0 0 30px;place-items:center;border-radius:6px;background:var(--text);color:var(--surface);font-family:var(--font-display);font-size:12px;font-weight:800;letter-spacing:-.03em}.mark svg{display:block;width:100%;height:100%}.copy{min-width:0;flex:1}.eyebrow{font-family:var(--font-mono);font-size:8px;font-weight:650;letter-spacing:.11em;text-transform:uppercase;color:var(--text-dim)}h2{margin:2px 0 0;font-family:var(--font-display);font-size:13px;font-weight:720;letter-spacing:-.026em;line-height:1.3}.description{margin:4px 0 0;font-size:10px;line-height:1.45;color:var(--text-dim);overflow-wrap:anywhere}.status{flex:0 0 auto;border:1px solid var(--sep-strong);border-radius:999px;background:var(--field);padding:4px 7px;font-family:var(--font-mono);font-size:8px;font-weight:700;letter-spacing:.06em;text-transform:uppercase}.status.pending{border-color:color-mix(in srgb,var(--os-accent) 45%,var(--sep));background:color-mix(in srgb,var(--os-accent) 8%,var(--surface))}.status.success{border-color:color-mix(in srgb,var(--success) 48%,var(--sep));background:color-mix(in srgb,var(--success) 8%,var(--surface))}.status.warning{border-color:color-mix(in srgb,var(--warning) 52%,var(--sep));background:color-mix(in srgb,var(--warning) 9%,var(--surface))}.status.error{border-color:color-mix(in srgb,var(--destructive-text) 48%,var(--sep));background:color-mix(in srgb,var(--destructive-text) 8%,var(--surface))}.section{border-top:1px solid var(--sep);padding:9px 12px}.section-title{margin:0 0 7px;font-family:var(--font-mono);font-size:8px;font-weight:650;letter-spacing:.1em;text-transform:uppercase;color:var(--text-dim)}.checks,.outputs{display:grid;gap:5px}.check,.output{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:7px;min-height:27px}.dot{width:7px;height:7px;border-radius:50%;background:var(--text-faint)}.dot.info{background:var(--info)}.dot.pass{background:var(--success)}.dot.warn{background:var(--warning)}.dot.fail{background:var(--destructive-text)}.check strong,.output strong{min-width:0;font-size:10px}.detail,.value{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:9px;color:var(--text-dim)}.fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.field{min-width:0}.field.full{grid-column:1/-1}.field label{display:block;margin-bottom:4px;font-size:9px;font-weight:650}.required{color:var(--destructive-text)}input,textarea{width:100%;min-height:34px;border:1px solid var(--sep-strong);border-radius:8px;background:var(--field);color:var(--text);caret-color:var(--os-accent);padding:7px 8px;font:inherit;font-size:10px;outline:none}input::placeholder,textarea::placeholder{color:var(--text-faint)}textarea{min-height:72px;resize:vertical}input:focus,textarea:focus{border-color:var(--os-accent);box-shadow:0 0 0 2px color-mix(in srgb,var(--os-accent) 17%,transparent)}.boolean{display:flex;min-height:34px;align-items:center;gap:7px;border:1px solid var(--sep-strong);border-radius:8px;padding:7px 8px;background:var(--field);font-size:10px}.boolean input{width:15px;min-height:15px;margin:0;accent-color:var(--os-accent)}.readonly{min-height:34px;border:1px solid var(--sep);border-radius:8px;padding:8px;background:var(--inset);font-size:10px;overflow-wrap:anywhere}.actions{display:flex;align-items:center;justify-content:flex-end;gap:6px;flex-wrap:wrap}.feedback{min-width:0;flex:1;font-size:9px;color:var(--text-dim)}button{appearance:none;min-height:32px;border:1px solid var(--sep-strong);border-radius:8px;background:transparent;color:var(--text);padding:6px 10px;font:inherit;font-size:10px;font-weight:680;cursor:pointer;transition:transform .18s cubic-bezier(.16,1,.3,1),box-shadow .18s ease,background-color .18s ease}button:hover{background:var(--hover-strong);transform:translateY(-1px)}button:active{transform:translateY(1px) scale(.99)}button.primary{border-color:var(--text);background:var(--text);color:var(--surface)}button.primary:hover{background:var(--text);box-shadow:0 8px 22px color-mix(in srgb,var(--text) 15%,transparent)}button.danger{border-color:color-mix(in srgb,var(--destructive-text) 48%,var(--sep));background:color-mix(in srgb,var(--destructive-text) 7%,var(--surface));color:var(--destructive-text)}button:disabled{cursor:default;opacity:.55;transform:none}button:focus-visible{outline:2px solid var(--os-accent);outline-offset:2px}.empty{padding:4px 0;font-size:10px;color:var(--text-dim)}@media(max-width:520px){body{padding:4px}.card{border-radius:9px}.head{padding:10px}.section{padding:8px 10px}.fields{grid-template-columns:1fr}.field.full{grid-column:auto}.actions{align-items:stretch}.feedback{width:100%;flex-basis:100%}button{flex:1}}
</style>
<section class="card" aria-label="MSO interaction block">
<header class="head">
- <div class="mark" aria-hidden="true">M</div>
+ <div class="mark" aria-hidden="true">${MSO_LOGO_SVG}</div>
<div class="copy"><div class="eyebrow" id="kind">Action</div><h2 id="title">MSO block</h2><p class="description" id="description" hidden></p></div>
<span class="status neutral" id="status">Ready</span>
</header>
diff --git a/lib/mcp/ui-page-bridge.ts b/lib/mcp/ui-page-bridge.ts
index 498ae6e5..636c87e6 100644
--- a/lib/mcp/ui-page-bridge.ts
+++ b/lib/mcp/ui-page-bridge.ts
@@ -3,12 +3,13 @@ export const MSO_PAGE_BRIDGE_SCRIPT = String.raw`
let hostConnected=false, hostContext={}, lastOutputKey="", viewCleanup=()=>{};
let lastPageSize="";
function reportPageSize(){
- if(!hostConnected||document.documentElement.dataset.displayMode==="fullscreen")return;const root=document.querySelector(".surface");if(!root)return;
+ if(document.documentElement.dataset.displayMode==="fullscreen")return;const root=document.querySelector(".surface");if(!root)return;
const rect=root.getBoundingClientRect(),style=getComputedStyle(document.body);
const height=Math.ceil(rect.height+(parseFloat(style.paddingTop)||0)+(parseFloat(style.paddingBottom)||0));
const width=Math.ceil(document.documentElement.clientWidth),key=width+","+height;
- if(height<1||height>1600||key===lastPageSize)return;lastPageSize=key;
- window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/size-changed",params:{width,height}},"*");
+ if(height<1||key===lastPageSize)return;lastPageSize=key;
+ if(hostConnected)window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/size-changed",params:{width,height}},"*");
+ else if(typeof window.openai?.notifyIntrinsicHeight==="function")window.openai.notifyIntrinsicHeight(height);
}
const pageResizeObserver=typeof ResizeObserver==="function"?new ResizeObserver(()=>requestAnimationFrame(reportPageSize)):null;
@@ -54,7 +55,7 @@ async function initializeMcpPage(){
appCapabilities:{availableDisplayModes:["inline","fullscreen","pip"]}
});
if(!result||typeof result.protocolVersion!=="string")throw new Error("Invalid host initialization response");
- hostConnected=true;hostContext=result.hostContext||{};applyHostGlobals();
+ hostConnected=true;lastPageSize="";hostContext=result.hostContext||{};applyHostGlobals();
window.parent.postMessage({jsonrpc:"2.0",method:"ui/notifications/initialized",params:{}},"*");
const root=document.querySelector(".surface");if(root)pageResizeObserver?.observe(root);reportPageSize();
}catch(error){if(!lastOutputKey)showError(new Error("The chat host did not initialize the page. Reopen the preview or refresh the connector."))}
diff --git a/lib/mcp/ui-page-lifecycle.test.ts b/lib/mcp/ui-page-lifecycle.test.ts
index b020fd5c..101cbfff 100644
--- a/lib/mcp/ui-page-lifecycle.test.ts
+++ b/lib/mcp/ui-page-lifecycle.test.ts
@@ -5,6 +5,7 @@ import { LEGACY_PAGE_V12_URI, LEGACY_PAGE_V11_URI, LEGACY_PAGE_V10_URI, LEGACY_P
describe("MCP Page lifecycle and cached resource migration", () => {
it("serves current bytes to cached v2 clients without advertising a third UI", async () => {
const page = await readUiResource(MSO_PAGE_URI);
+ expect(await readUiResource("ui://mso/page-v13.html")).toMatchObject({ uri: "ui://mso/page-v13.html", text: page?.text });
expect(await readUiResource(LEGACY_PAGE_V12_URI)).toMatchObject({ uri: LEGACY_PAGE_V12_URI, text: page?.text });
expect(await readUiResource(LEGACY_PAGE_V11_URI)).toMatchObject({ uri: LEGACY_PAGE_V11_URI, text: page?.text });
expect(await readUiResource(LEGACY_PAGE_V10_URI)).toMatchObject({ uri: LEGACY_PAGE_V10_URI, text: page?.text });
@@ -25,13 +26,13 @@ describe("MCP Page lifecycle and cached resource migration", () => {
'method:"ui/notifications/initialized"',
'event.source!==window.parent',
'if(key===lastOutputKey){',
- 'hostMax*.48',
+ 'dimensions.height,dimensions.maxHeight,api.maxHeight',
'availableDisplayModes:["inline","fullscreen","pip"]',
'stageBase("Remote-browser handoff")',
'openPath("/browser")',
]) expect(script).toContain(marker);
- expect(html).toContain('html[data-display-mode="inline"] .surface');
- expect(html).toContain('max-height:var(--inline-max-h)');
+ expect(html).toContain('height:var(--page-height)');
+ expect(script).not.toContain('hostMax*.48');
expect(html).toContain('html[data-display-mode="fullscreen"] .surface{height:100vh;height:100dvh');
expect(html).not.toContain('presentation:"fullscreen"');
expect(script).not.toContain('play-together:embed-ready');
diff --git a/lib/mcp/ui-resources.test.ts b/lib/mcp/ui-resources.test.ts
index ab4e8202..8b28b8f0 100644
--- a/lib/mcp/ui-resources.test.ts
+++ b/lib/mcp/ui-resources.test.ts
@@ -127,7 +127,7 @@ describe("MCP Apps Block and Page contract", () => {
});
expect(content._meta.ui.csp.frameDomains).toBeUndefined();
expect(content._meta["openai/widgetCSP"]).toEqual({ redirect_domains: [MSO_ORIGIN] });
- expect(MSO_BLOCK_URI).toContain("block-v2.html");
+ expect(MSO_BLOCK_URI).toContain("block-v3.html");
});
it("serves the full Page without external frame domains by default", async () => {
@@ -152,7 +152,7 @@ describe("MCP Apps Block and Page contract", () => {
});
expect(content._meta.ui.csp.frameDomains).toBeUndefined();
expect(content._meta["openai/widgetCSP"]).toEqual({ connect_domains: [MSO_ORIGIN], redirect_domains: [MSO_ORIGIN] });
- expect(MSO_PAGE_URI).toContain("page-v13.html");
+ expect(MSO_PAGE_URI).toContain("page-v14.html");
expect(content.text).not.toContain("createElement(\"iframe\")");
expect(content.text).not.toContain("mountReviewedFrame");
});
diff --git a/lib/mcp/ui-resources.ts b/lib/mcp/ui-resources.ts
index 495a30de..c658e7d3 100644
--- a/lib/mcp/ui-resources.ts
+++ b/lib/mcp/ui-resources.ts
@@ -7,6 +7,8 @@ export const MCP_APP_MIME_TYPE = "text/html;profile=mcp-app";
// Read-only aliases keep already-cached ChatGPT action descriptors functional
// across the UI-contract migration. They are intentionally not advertised by
// resources/list: the public product contract has exactly Block and Page.
+export const LEGACY_BLOCK_V2_URI = "ui://mso/block-v2.html";
+export const LEGACY_PAGE_V13_URI = "ui://mso/page-v13.html";
export const LEGACY_BLOCK_V1_URI = "ui://mso/block-v1.html";
export const LEGACY_PAGE_V12_URI = "ui://mso/page-v12.html";
export const LEGACY_PAGE_V11_URI = "ui://mso/page-v11.html";
@@ -33,6 +35,7 @@ export type McpUiResource = {
};
const LEGACY_PAGE_URIS = new Set([
+ LEGACY_PAGE_V13_URI,
LEGACY_PAGE_V12_URI,
LEGACY_PAGE_V11_URI,
LEGACY_PAGE_V10_URI,
@@ -56,7 +59,7 @@ export async function listUiResources(): Promise<Array<{ uri: string; name: stri
export async function readUiResource(uri: string): Promise<McpUiResource | undefined> {
if (uri === MSO_BLOCK_URI) return MSO_BLOCK_RESOURCE;
if (uri === MSO_PAGE_URI) return msoPageResource();
- if (uri === LEGACY_BLOCK_V1_URI || uri === LEGACY_WORKFLOW_PROGRESS_URI) return { ...MSO_BLOCK_RESOURCE, uri };
+ if (uri === LEGACY_BLOCK_V2_URI || uri === LEGACY_BLOCK_V1_URI || uri === LEGACY_WORKFLOW_PROGRESS_URI) return { ...MSO_BLOCK_RESOURCE, uri };
if (LEGACY_PAGE_URIS.has(uri)) return { ...(await msoPageResource()), uri };
return undefined;
}
diff --git a/lib/mcp/ui-surface-script.ts b/lib/mcp/ui-surface-script.ts
index 5d703a2b..1d15b223 100644
--- a/lib/mcp/ui-surface-script.ts
+++ b/lib/mcp/ui-surface-script.ts
@@ -56,10 +56,17 @@ function openPath(path){setMsoTarget(validRoute(path)?path:"/assistant/mcp")}
function applyHostGlobals(){
const api=hostConnected?{...(window.openai||{}),...hostContext}:{...hostContext,...(window.openai||{})};
applyHostTheme();
- const max=Number(api.maxHeight),hostMax=Number.isFinite(max)&&max>180?Math.floor(max):680;document.documentElement.style.setProperty("--host-max-h",hostMax+"px");document.documentElement.style.setProperty("--inline-max-h",Math.max(1,Math.floor(hostMax*.48))+"px");
- const safe=api.safeArea||{};for(const [key,value] of [["top",safe.top],["right",safe.right],["bottom",safe.bottom],["left",safe.left]]){const n=Number(value);document.documentElement.style.setProperty("--safe-"+key,Number.isFinite(n)?Math.max(0,n)+"px":"0px")}
+ if(api.theme==="light"||api.theme==="dark")document.documentElement.dataset.theme=api.theme;
+ // MCP Apps fixed height fills the host; flexible height uses its full allowance.
+ // Never derive our height from the current iframe viewport: resize feedback shrinks it.
+ const dimensions=api.containerDimensions||{},values=[dimensions.height,dimensions.maxHeight,api.maxHeight];
+ const height=values.find(value=>typeof value==="number"&&Number.isFinite(value)&&value>0)??680;
+ document.documentElement.style.setProperty("--page-height",Math.floor(height)+"px");
+ const safe=api.safeAreaInsets||api.safeArea||{};for(const [key,value] of [["top",safe.top],["right",safe.right],["bottom",safe.bottom],["left",safe.left]]){const n=Number(value);document.documentElement.style.setProperty("--safe-"+key,Number.isFinite(n)?Math.max(0,n)+"px":"0px")}
const mode=["inline","fullscreen","pip"].includes(api.displayMode)?api.displayMode:"inline";
document.documentElement.dataset.displayMode=mode;
+ if(Array.isArray(api.availableDisplayModes)){pipBtn.hidden=!api.availableDisplayModes.includes("pip");fsBtn.hidden=mode!=="fullscreen"&&!api.availableDisplayModes.includes("fullscreen")}
+ requestAnimationFrame(reportPageSize);
modeEl.textContent=mode;fsBtn.textContent=mode==="fullscreen"?"Exit fullscreen":"Fullscreen";
fsBtn.setAttribute("aria-label",mode==="fullscreen"?"Exit fullscreen":"Fullscreen");
}
@@ -83,10 +90,10 @@ function nav(route,extra={}){
}
function showError(error){viewCleanup();viewCleanup=()=>{};clear(body);const box=el("div","notice");const inner=el("div");inner.append(el("h3","","Page unavailable"),el("p","error",error&&error.message?error.message:"The requested page could not be loaded."));box.append(inner);body.append(box)}
function renderHome(){
- const root=el("div","home");const hero=el("section","hero");hero.append(el("h2","","MSO Page"),el("p","","ChatGPT is another MSO presentation target. Open native operator views here; registry-backed external apps continue through the isolated MSO Browser seam."));root.append(hero);
- root.append(el("div","section-title","Native pages"));const native=el("div","grid");
- for(const item of [{route:"/integrations",title:"Integrations",desc:"Secure, native credential setup."},{route:"/monitor",title:"System Monitor",desc:"Live bounded host status."},{route:"/project",title:"Project",desc:"Project snapshot and Git state."},{route:"/diff",title:"Diff",desc:"Review project changes."},{route:"/browser",title:"Remote Browser",desc:"Isolated seam for external apps and authenticated sites."}]){const card=button("",()=>nav(item.route),"card");card.append(el("strong","",item.title),el("span","",item.desc));native.append(card)}root.append(native);
- root.append(el("div","section-title","Registry-backed external apps"));const apps=el("div","grid");
+ const root=el("div","home");const hero=el("section","hero");hero.append(el("h2","","MSO Page"),el("p","","Manage your services, inspect projects, and check your server."));root.append(hero);
+ root.append(el("div","section-title","Workspace"));const native=el("div","grid");
+ for(const item of [{route:"/integrations",title:"Integrations",desc:"Secure, native credential setup."},{route:"/monitor",title:"System Monitor",desc:"CPU, memory, disk, and service health."},{route:"/project",title:"Project",desc:"Project snapshot and Git state."},{route:"/diff",title:"Diff",desc:"Review project changes."},{route:"/browser",title:"Remote Browser",desc:"Open websites in your server browser."}]){const card=button("",()=>nav(item.route),"card");card.append(el("strong","",item.title),el("span","",item.desc));native.append(card)}root.append(native);
+ root.append(el("div","section-title","Your apps"));const apps=el("div","grid");
for(const app of SAFE_APPS){const card=button("",()=>nav("/apps/"+encodeURIComponent(app.id)),"card");card.append(el("strong","",app.title),el("span","",app.description),el("span","tag",app.environment+" · "+app.renderer));apps.append(card)}root.append(apps);body.append(root)
}
function renderMonitor(){
@@ -105,7 +112,7 @@ function renderApp(){
const box=el("div","notice"),inner=el("div");inner.append(el("h3","",safe.title+" opens through MSO Browser"),el("p","",safe.reason||"External apps stay outside the ChatGPT Page iframe and continue through MSO's isolated remote-browser seam."));const row=el("div","row");row.append(button("Open Remote Browser",()=>openMso(),"primary"));if(window.openai&&typeof window.openai.sendFollowUpMessage==="function")row.append(button("Ask ChatGPT to continue",()=>window.openai.sendFollowUpMessage({prompt:"Continue this demo using the MSO remote-browser fallback for "+safe.title+"."})));inner.append(row);box.append(inner);stage.content.append(box);if(safe.presentation==="pip")pipBtn.hidden=false
}
function renderBrowser(){const box=el("div","notice"),inner=el("div");inner.append(el("h3","","Remote Browser seam"),el("p","","Sites that deny iframe embedding stay isolated. MSO can continue them through Camoufox without exposing its VNC password or authenticated viewer URL to this widget."));const row=el("div","row");row.append(button("Open MSO Browser",()=>openMso(),"primary"));inner.append(row);box.append(inner);body.append(box);openPath("/browser")}
-function render(){viewCleanup();viewCleanup=()=>{};clear(body);titleEl.textContent=text(current.title,"MSO Page");routeEl.textContent=text(current.route,"/");openPath(text(current.openPath,"/assistant/mcp"));persistRoute();if(current.kind==="home")renderHome();else if(current.kind==="integrations")renderIntegrations();else if(current.kind==="monitor")renderMonitor();else if(current.kind==="project")renderProject("project");else if(current.kind==="diff")renderProject("diff");else if(current.kind==="app")renderApp();else if(current.kind==="browser")renderBrowser();else body.append(el("div","loading","Loading MSO Page…"))}
+function render(){viewCleanup();viewCleanup=()=>{};clear(body);titleEl.textContent="MSO";routeEl.textContent=text(current.title,"Workspace");openPath(text(current.openPath,"/assistant/mcp"));persistRoute();if(current.kind==="home")renderHome();else if(current.kind==="integrations")renderIntegrations();else if(current.kind==="monitor")renderMonitor();else if(current.kind==="project")renderProject("project");else if(current.kind==="diff")renderProject("diff");else if(current.kind==="app")renderApp();else if(current.kind==="browser")renderBrowser();else body.append(el("div","loading","Loading MSO Page…"))}
function readOutput(){return acceptPageResult(window.openai&&window.openai.toolOutput)}
window.addEventListener("message",onHostMessage,{passive:true});
window.addEventListener("openai:set_globals",()=>{applyHostGlobals();readOutput()},{passive:true});
diff --git a/lib/mcp/ui-surface-style.ts b/lib/mcp/ui-surface-style.ts
index a21026fe..83fd0a26 100644
--- a/lib/mcp/ui-surface-style.ts
+++ b/lib/mcp/ui-surface-style.ts
@@ -2,20 +2,42 @@ import { MSO_WIDGET_TOKENS } from "./ui-widget-tokens";
export const MSO_SURFACE_STYLE = String.raw`
${MSO_WIDGET_TOKENS}
-:root{font-family:var(--font-body);--line:var(--sep);--muted:var(--text-dim);--soft:var(--field);--accent:var(--os-accent);--safe-top:0px;--safe-right:0px;--safe-bottom:0px;--safe-left:0px;--host-max-h:680px;--inline-max-h:326px}*{box-sizing:border-box}html,body{margin:0;min-width:0;background:transparent;color:var(--text)}body{padding:8px;font-family:var(--font-body)}.surface{display:flex;min-height:260px;max-height:var(--host-max-h);overflow:hidden;flex-direction:column;border:1px solid var(--sep-strong);border-radius:18px;background:var(--surface);box-shadow:var(--shadow-pop)}.bar{display:flex;min-height:48px;align-items:center;gap:8px;padding:8px 10px;border-bottom:1px solid var(--sep);padding-left:max(10px,var(--safe-left));padding-right:max(10px,var(--safe-right))}.brand{display:grid;place-items:center;width:30px;height:30px;flex:0 0 30px;border-radius:9px;background:var(--text);color:var(--surface);font-family:var(--font-display);font-size:12px;font-weight:850}.heading{min-width:0;flex:1}.heading strong{display:block;font-family:var(--font-display);font-size:12px;line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.heading span{display:block;margin-top:2px;font-size:9px;color:var(--text-dim);font-family:var(--font-mono);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tools{display:flex;align-items:center;gap:5px;flex-wrap:wrap;justify-content:flex-end}button,.button{appearance:none;border:1px solid var(--sep-strong);background:var(--field);color:var(--text);border-radius:9px;padding:6px 8px;min-height:30px;font:inherit;font-size:10px;font-weight:650;cursor:pointer;text-decoration:none}button:hover,.button:hover{background:var(--hover-strong)}button:focus-visible,.button:focus-visible{outline:2px solid var(--os-accent);outline-offset:2px}.primary{border-color:var(--text);background:var(--text);color:var(--surface)}.primary:hover{background:var(--text);box-shadow:0 8px 22px color-mix(in srgb,var(--text) 15%,transparent)}.open-direct{font-size:9px;color:inherit}.open-feedback{display:none}.body{min-height:0;flex:1;overflow:auto;padding:12px;padding-bottom:max(12px,var(--safe-bottom));scrollbar-gutter:stable}.home{display:grid;gap:12px}.hero{padding:14px;border:1px solid var(--sep-strong);border-radius:15px;background:linear-gradient(135deg,color-mix(in srgb,var(--os-accent) 9%,var(--surface)),var(--surface))}.hero h2{margin:0;font-family:var(--font-display);font-size:17px}.hero p{max-width:680px;margin:5px 0 0;font-size:11px;line-height:1.5;color:var(--text-dim)}.section-title{margin:2px 0 7px;font-family:var(--font-mono);font-size:10px;text-transform:uppercase;letter-spacing:.08em;color:var(--text-dim)}.grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.card{min-width:0;text-align:left;padding:11px;border:1px solid var(--sep-strong);border-radius:13px;background:var(--field)}.card:hover{background:var(--hover)}.card strong{display:block;font-family:var(--font-display);font-size:11px}.card span{display:block;margin-top:4px;font-size:9px;line-height:1.4;color:var(--text-dim)}.tag{display:inline-flex!important;width:auto!important;margin-top:8px!important;padding:2px 6px;border-radius:999px;border:1px solid var(--sep-strong);font-family:var(--font-mono);font-size:8px!important;text-transform:uppercase;letter-spacing:.06em}.stage{display:flex;min-height:330px;height:100%;flex-direction:column}.stage-head{display:flex;align-items:center;gap:8px;margin-bottom:8px}.back{flex:0 0 auto}.stage-title{min-width:0;flex:1}.stage-title strong{display:block;font-family:var(--font-display);font-size:12px}.stage-title span{display:block;margin-top:2px;font-size:9px;color:var(--text-dim)}.frame-wrap{position:relative;min-height:280px;flex:1;overflow:hidden;border:1px solid var(--sep-strong);border-radius:13px;background:var(--inset)}.frame-wrap iframe{display:block;width:100%;height:100%;min-height:360px;border:0;background:#fff}.notice{display:grid;min-height:280px;place-items:center;border:1px solid var(--sep-strong);border-radius:13px;background:var(--field);padding:24px;text-align:center}.notice>div{max-width:520px}.notice h3{margin:0;font-family:var(--font-display);font-size:14px}.notice p{margin:7px 0 0;color:var(--text-dim);font-size:10px;line-height:1.5}.notice .row{justify-content:center;margin-top:12px}.metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}.metric{padding:12px;border:1px solid var(--sep-strong);border-radius:12px;background:var(--field)}.metric span{display:block;font-family:var(--font-mono);font-size:8px;text-transform:uppercase;letter-spacing:.08em;color:var(--text-dim)}.metric strong{display:block;margin-top:4px;font-family:var(--font-display);font-size:13px}.list{margin-top:8px;border:1px solid var(--sep-strong);border-radius:12px;overflow:hidden}.line{display:flex;align-items:center;gap:10px;min-height:34px;padding:7px 9px;border-top:1px solid var(--sep);font-size:10px}.line:first-child{border-top:0}.line span{color:var(--text-dim)}.line strong{margin-left:auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mono{font-family:var(--font-mono)}.loading{display:grid;min-height:240px;place-items:center;color:var(--text-dim);font-size:11px}.error{color:var(--destructive-text)}.mode-badge{padding:3px 6px;border-radius:999px;background:var(--field);font-family:var(--font-mono);font-size:8px;color:var(--text-dim)}
-.frame-status{display:flex;gap:8px;align-items:center;flex-wrap:wrap;padding:6px 2px 10px;font-size:10px;color:var(--text-dim)}.frame-status span{flex:1;min-width:120px}.frame-status button{min-height:34px}.stage>div:last-child{min-height:0;display:flex;flex-direction:column;flex:1}.frame-wrap[data-state="unavailable"]{border-color:var(--destructive-text)}
-@media(max-width:660px){body{padding:5px}.surface{border-radius:14px}.bar{align-items:flex-start;min-height:46px}.tools{max-width:50%}.tools button,.tools .button{padding:5px 7px}.grid{grid-template-columns:1fr 1fr}.metrics{grid-template-columns:1fr 1fr}.body{padding:9px}}
-@media(max-width:420px){.grid{grid-template-columns:1fr}.heading span{max-width:150px}.tools .optional{display:none}.metrics{grid-template-columns:1fr}}
-
-html[data-display-mode="inline"] .surface{min-height:min(220px,var(--inline-max-h));max-height:var(--inline-max-h)}
-html[data-display-mode="inline"] .body{overscroll-behavior:contain}
-html[data-display-mode="inline"] .stage,html[data-display-mode="inline"] .frame-wrap,html[data-display-mode="inline"] .frame-wrap iframe{min-height:0}
-html[data-display-mode="inline"] .frame-wrap iframe{height:100%}
+:root{font-family:var(--font-body);--page-height:680px;--safe-top:0px;--safe-right:0px;--safe-bottom:0px;--safe-left:0px}
+*{box-sizing:border-box}
+html,body{margin:0;min-width:0;background:transparent;color:var(--text)}
+body{font-family:var(--font-body)}
+.surface{display:flex;height:var(--page-height);min-height:0;overflow:hidden;flex-direction:column;border:1px solid var(--sep);border-radius:12px;background:var(--surface)}
+.bar{display:flex;flex:0 0 auto;align-items:center;gap:10px;min-height:58px;padding:10px 16px;border-bottom:1px solid var(--sep);padding-left:max(16px,var(--safe-left));padding-right:max(16px,var(--safe-right))}
+.brand{width:32px;height:32px;flex:0 0 32px}.brand svg{display:block;width:100%;height:100%}
+.heading{min-width:0;flex:1}.heading strong{display:block;font-size:14px;line-height:1.25;font-weight:750}
+.heading span{display:block;margin-top:2px;font-size:11px;color:var(--text-dim);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
+.tools,.row{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.tools{justify-content:flex-end}
+button,.button{appearance:none;border:1px solid var(--sep-strong);background:transparent;color:var(--text);border-radius:7px;padding:8px 11px;min-height:36px;font:600 12px/1.3 var(--font-body);cursor:pointer;text-decoration:none}
+button:hover,.button:hover{background:var(--hover)}
+button:focus-visible,.button:focus-visible{outline:2px solid var(--os-accent);outline-offset:2px}
+.primary{border-color:var(--text);background:var(--text);color:var(--surface)}
+.primary:hover{background:var(--text);filter:brightness(.92)}
+.open-direct{font-size:11px;color:inherit}.open-feedback{display:none}
+.mode-badge{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
+.body{min-height:0;flex:1 1 0;overflow:auto;margin:0 auto;width:100%;padding:20px;padding-bottom:max(20px,var(--safe-bottom));overscroll-behavior:contain;scrollbar-gutter:stable}
+.home{display:grid;gap:16px;max-width:1040px;margin:auto}
+.hero{padding:4px 0 12px}.hero h2{margin:0;font:750 25px/1.25 var(--font-display)}.hero p{max-width:64ch;margin:8px 0 0;font-size:14px;line-height:1.6;color:var(--text-dim)}
+.section-title{margin:8px 0 0;font-size:12px;font-weight:650;color:var(--text-dim)}
+.grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0 24px}
+.card{min-width:0;text-align:left;padding:16px 0;border:0;border-bottom:1px solid var(--sep);border-radius:0;background:transparent}
+.card:hover{background:var(--hover)}.card strong{display:block;font-size:14px}.card span{display:block;margin-top:6px;font-size:12px;line-height:1.5;color:var(--text-dim)}
+.tag{font:10px var(--font-mono)}
+.stage{display:flex;min-height:0;height:100%;flex-direction:column}.stage-head{display:flex;align-items:center;gap:10px;margin-bottom:16px}
+.back{flex:0 0 auto}.stage-title{min-width:0;flex:1}.stage-title strong{display:block;font-size:17px}.stage-title span{display:block;margin-top:4px;font-size:12px;color:var(--text-dim)}
+.stage>div:last-child{min-height:0;display:flex;flex-direction:column;flex:1}
+.notice{display:grid;min-height:240px;place-items:center;padding:24px;text-align:center}.notice>div{max-width:520px}.notice h3{margin:0;font:700 19px/1.35 var(--font-display)}.notice p{margin:10px 0 0;color:var(--text-dim);font-size:14px;line-height:1.6}.notice .row{justify-content:center;margin-top:20px}
+.metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:24px}.metric{padding:16px 0;border-bottom:1px solid var(--sep)}.metric span{display:block;font-size:12px;color:var(--text-dim)}.metric strong{display:block;margin-top:8px;font:700 24px var(--font-display)}
+.list{margin-top:16px}.line{display:flex;align-items:center;gap:16px;min-height:44px;padding:10px 0;border-bottom:1px solid var(--sep);font-size:13px}.line span{color:var(--text-dim)}.line strong{margin-left:auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mono{font-family:var(--font-mono)}
+.loading{display:grid;min-height:240px;place-items:center;color:var(--text-dim);font-size:14px}.error{color:var(--destructive-text)}
html[data-display-mode="fullscreen"],html[data-display-mode="fullscreen"] body{height:100%;width:100%;overflow:hidden}
-html[data-display-mode="fullscreen"] body{padding:0}
-html[data-display-mode="fullscreen"] .surface{height:100vh;height:100dvh;min-height:0;max-height:none;border:0;border-radius:0;box-shadow:none}
-html[data-display-mode="fullscreen"] .surface>.bar{flex:0 0 auto;padding-top:max(8px,var(--safe-top))}
-html[data-display-mode="fullscreen"] .surface>.body{flex:1;min-height:0;overscroll-behavior:contain}
-html[data-display-mode="fullscreen"] .stage{min-height:0}
-html[data-display-mode="fullscreen"] .frame-wrap iframe{min-height:0;height:100%}
+html[data-display-mode="fullscreen"] .surface{height:100vh;height:100dvh;min-height:0;max-height:none;border:0;border-radius:0}
+html[data-display-mode="fullscreen"] .surface>.bar{padding-top:max(10px,var(--safe-top))}
+@media(max-width:660px){.bar{padding:10px 12px}.body{padding:16px}.grid{grid-template-columns:1fr 1fr}.tools{gap:5px}.tools button,.tools .button{padding:8px}.heading span{max-width:150px}}
+@media(max-width:420px){.bar{gap:8px;flex-wrap:wrap}.tools{margin-left:auto}.tools .optional{display:none}.tools button,.tools .button{font-size:11px;min-height:40px}.body{padding:14px}.grid{grid-template-columns:1fr}.metrics{gap:12px}.metric strong{font-size:20px}}
+@media(pointer:coarse){button,.button{min-height:44px}}
`;
diff --git a/lib/mcp/ui-surface.ts b/lib/mcp/ui-surface.ts
index 2ebb83f7..5b12d60a 100644
--- a/lib/mcp/ui-surface.ts
+++ b/lib/mcp/ui-surface.ts
@@ -1,3 +1,4 @@
+import { MSO_LOGO_SVG } from "@/lib/presentation/logo";
import { CONNECTION_MANAGER_STYLE } from "@/lib/infra/connection-ui";
import { INTEGRATION_FORM_STYLE } from "@/lib/infra/setup-ui";
import { publicMsoOrigin, widgetResourceMeta } from "./ui-config";
@@ -5,16 +6,16 @@ import { OPEN_IN_MSO_SCRIPT, openInMsoControls } from "./ui-navigation";
import { msoSurfaceScript } from "./ui-surface-script";
import { MSO_SURFACE_STYLE } from "./ui-surface-style";
-export const MSO_PAGE_URI = "ui://mso/page-v13.html";
+export const MSO_PAGE_URI = "ui://mso/page-v14.html";
const MIME = "text/html;profile=mcp-app";
async function pageHtml(): Promise<string> {
- return String.raw`<main class="surface" aria-label="MSO Page">
+ return String.raw`<meta charset="utf-8"><main class="surface" aria-label="MSO Page">
<style>${MSO_SURFACE_STYLE}${INTEGRATION_FORM_STYLE}${CONNECTION_MANAGER_STYLE}</style>
<header class="bar">
- <div class="brand" aria-hidden="true">M</div>
+ <div class="brand" aria-hidden="true">${MSO_LOGO_SVG}</div>
<div class="heading"><strong id="surface-title">MSO Page</strong><span id="surface-route">/</span></div>
- <span class="mode-badge" id="surface-mode">inline</span>
+ <span class="mode-badge" id="surface-mode" role="status" aria-live="polite">inline</span>
<div class="tools">
<button type="button" id="surface-home" class="optional">Home</button>
<button type="button" id="surface-pip" class="optional">PiP</button>
diff --git a/lib/presentation/logo.ts b/lib/presentation/logo.ts
new file mode 100644
index 00000000..6aec2564
--- /dev/null
+++ b/lib/presentation/logo.ts
@@ -0,0 +1,5 @@
+import { readFileSync } from "node:fs";
+import path from "node:path";
+
+// Embed the existing public mark so sandboxed Pages need no image request or extra CSP origin.
+export const MSO_LOGO_SVG = readFileSync(path.join(process.cwd(), "public/icon.svg"), "utf8");
diff --git a/scripts/e2e/integrations.mjs b/scripts/e2e/integrations.mjs
index c4f30936..e6197944 100644
--- a/scripts/e2e/integrations.mjs
+++ b/scripts/e2e/integrations.mjs
@@ -2,10 +2,7 @@
// Exercises the shared browser/embed manager using synthetic accounts; never production credentials.
import assert from "node:assert/strict";
import { execFileSync } from "node:child_process";
-import { createRequire } from "node:module";
-import path from "node:path";
-const require = createRequire(import.meta.url);
-const { chromium } = require(path.join(process.cwd(), "os-browser/node_modules/playwright"));
+import { chromium } from "@playwright/test";
const html = execFileSync("bun", ["-e", 'import { integrationSetupPage } from "./lib/infra/setup-page"; console.log(integrationSetupPage().html)'], {encoding:"utf8"});
const users=[{id:"studio",label:"Studio",isDefault:true},{id:"personal",label:"Personal",isDefault:false}];
const fixture={id:"work",label:"Delivery GitHub",provider:"github",source:"direct",authMethod:"token",scope:"account",state:"verified",isDefault:true,fields:[{key:"apiKey",label:"API key",stored:true}],verifiedAt:Date.now(),sharedFrom:null};
@@ -18,7 +15,7 @@ function manage(body){
if(body.action==="user.delete"){const index=users.findIndex(x=>x.id===body.user);if(index>=0)users.splice(index,1)}
return {ok:true,action:body.action};
}
-const browser=await chromium.launch({executablePath:"/usr/bin/google-chrome",args:["--no-sandbox","--disable-dev-shm-usage"]});
+const browser=await chromium.launch({...(process.env.CHROME_PATH ? {executablePath:process.env.CHROME_PATH} : {}),args:["--no-sandbox","--disable-dev-shm-usage"]});
let checks=0;
try{
const page=await browser.newPage();
diff --git a/scripts/e2e/mcp-page.mjs b/scripts/e2e/mcp-page.mjs
index 4c632d17..260bf465 100644
--- a/scripts/e2e/mcp-page.mjs
+++ b/scripts/e2e/mcp-page.mjs
@@ -2,11 +2,10 @@
// Browser contract for the iframe-free ChatGPT MSO Page external-app handoff.
import assert from "node:assert/strict";
import { execFileSync } from "node:child_process";
-import { createRequire } from "node:module";
+import { chromium } from "@playwright/test";
import path from "node:path";
+import { mkdir } from "node:fs/promises";
-const require = createRequire(import.meta.url);
-const { chromium } = require(path.join(process.cwd(), "os-browser/node_modules/playwright"));
const registry = [{
id: "play-together",
title: "Play Together",
@@ -43,14 +42,14 @@ const output = {
},
};
-assert.equal(resource.uri, "ui://mso/page-v13.html");
+assert.equal(resource.uri, "ui://mso/page-v14.html");
assert.equal(resource._meta.ui.csp.frameDomains, undefined);
assert.equal(resource._meta["openai/widgetCSP"].frame_domains, undefined);
assert(!resource.text.includes('createElement("iframe")'));
assert(!resource.text.includes("mountReviewedFrame"));
assert(resource.text.includes('"renderer":"remote"'));
-const browser = await chromium.launch({ executablePath: process.env.CHROME_PATH ?? "/usr/bin/google-chrome", args: ["--no-sandbox", "--disable-dev-shm-usage"] });
+const browser = await chromium.launch({ ...(process.env.CHROME_PATH ? {executablePath:process.env.CHROME_PATH} : {}), args: ["--no-sandbox", "--disable-dev-shm-usage"] });
let assertions = 6;
try {
for (const viewport of [{ width: 1280, height: 800 }, { width: 390, height: 800 }]) {
@@ -74,7 +73,62 @@ try {
console.log(`PASS iframe-free external app handoff ${viewport.width}x${viewport.height}`);
await page.close();
}
- console.log(`MCP Page browser checks: ${assertions} assertions passed`);
+ // Reproduce a small initial host frame with legacy maxHeight=200. Standard
+ // containerDimensions must win and resize it to the complete work area.
+ const snapshot={user:"studio",users:[{id:"studio",label:"Studio",isDefault:true}],connections:[],bindings:[]};
+ const integrationOutput={route:"/integrations",kind:"integrations",title:"Integrations",openPath:"/integrations",integrations:snapshot};
+ const page=await browser.newPage({viewport:{width:768,height:900}});
+ const errors=[];page.on("pageerror",error=>errors.push(error.message));
+ await page.route("https://mso-ui.example.com/qa",route=>route.fulfill({contentType:"text/html",body:`<!doctype html><script>window.openai={maxHeight:200,theme:"light",toolOutput:${JSON.stringify({structuredContent:integrationOutput})}}</script>${resource.text}`}));
+ await page.route("https://chatgpt.com/qa",route=>route.fulfill({contentType:"text/html",body:`<!doctype html><html><meta name="viewport" content="width=device-width,initial-scale=1"><style>body{margin:0;background:#171717}iframe{display:block;border:0;width:100%;height:140px}</style><script>
+ window.hostContext={theme:"dark",displayMode:"inline",availableDisplayModes:["inline","fullscreen"],containerDimensions:{maxHeight:680}};
+ window.addEventListener("message",event=>{
+ const m=event.data;if(!m||m.jsonrpc!=="2.0")return;
+ const frame=document.querySelector("iframe");let result;
+ if(m.method==="ui/initialize")result={protocolVersion:"2026-01-26",hostContext:window.hostContext};
+ else if(m.method==="ui/notifications/size-changed"){window.lastSize=m.params;frame.style.height=m.params.height+"px";return}
+ else if(m.method==="ui/request-display-mode"){window.hostContext.displayMode=m.params.mode;frame.style.height=m.params.mode==="fullscreen"?"900px":"680px";result={mode:m.params.mode}}
+ else if(m.method==="tools/call")result={structuredContent:{result:${JSON.stringify(snapshot)}}};
+ else return;
+ if(m.id!==undefined)event.source.postMessage({jsonrpc:"2.0",id:m.id,result},"*");
+ });
+ </script><iframe title="MSO Page" src="https://mso-ui.example.com/qa"></iframe></html>`}));
+ await page.goto("https://chatgpt.com/qa");
+ const component=page.frameLocator("iframe"),surface=component.locator(".surface"),body=component.locator("#surface-body");
+ await component.getByRole("button",{name:"Add MCP",exact:true}).waitFor();
+ await page.waitForFunction(()=>window.lastSize?.height===680);
+ assert.equal(await surface.evaluate(el=>el.getBoundingClientRect().height),680);assertions++;
+ assert.equal(await component.locator("html").getAttribute("data-theme"),"dark");assertions++;
+ assert.equal(await component.locator(".brand svg").count(),1);assertions++;
+ assert.equal(await component.locator("#surface-pip").isVisible(),false);assertions++;
+ assert(await body.evaluate(el=>el.clientHeight>580),"work area must not collapse to the heading");assertions++;
+ for(const width of [320,390,736,1280]){
+ await page.setViewportSize({width,height:900});
+ assert(await component.locator("html").evaluate(el=>el.scrollWidth<=innerWidth+1),"no horizontal overflow at "+width);assertions++;
+ assert.equal(Math.round(await surface.evaluate(el=>el.getBoundingClientRect().height)),680);assertions++;
+ }
+ await page.setViewportSize({width:736,height:900});
+ await component.getByRole("button",{name:"Fullscreen",exact:true}).click();
+ await component.getByRole("button",{name:"Exit fullscreen",exact:true}).waitFor();
+ assert.equal(await surface.evaluate(el=>el.getBoundingClientRect().height),900);assertions++;
+ await component.getByRole("button",{name:"Exit fullscreen",exact:true}).click();
+ await component.getByRole("button",{name:"Fullscreen",exact:true}).waitFor();
+ const setContext=async context=>{
+ await page.evaluate(context=>{window.hostContext={...window.hostContext,...context};document.querySelector("iframe").contentWindow.postMessage({jsonrpc:"2.0",method:"ui/notifications/host-context-changed",params:context},"*")},context);
+ await page.waitForFunction(height=>window.lastSize?.height===height,context.containerDimensions.height??context.containerDimensions.maxHeight);
+ };
+ await setContext({theme:"light",containerDimensions:{height:720}});
+ assert.equal(await surface.evaluate(el=>el.getBoundingClientRect().height),720);assertions++;
+ assert.equal(await component.locator("html").getAttribute("data-theme"),"light");assertions++;
+ await setContext({theme:"dark",containerDimensions:{maxHeight:680}});
+ const imageDir=process.env.MSO_SCREENSHOT_DIR;
+ if(imageDir){await mkdir(imageDir,{recursive:true});await page.locator("iframe").screenshot({path:path.join(imageDir,"mso-page-integrations.png")})}
+ await component.getByRole("button",{name:"Add MCP",exact:true}).click();
+ await component.getByRole("heading",{name:"Add MCP to project",exact:true}).waitFor();
+ if(imageDir)await page.locator("iframe").screenshot({path:path.join(imageDir,"mso-page-add-mcp.png")});
+ assert.deepEqual(errors,[]);assertions++;
+ await page.close();
+ console.log(`MCP Page browser checks: ${assertions} assertions passed (full height, host resize, theme, mobile, logo, Add MCP, fullscreen)`);
} finally {
await browser.close();
}
diff --git a/scripts/e2e/release.mjs b/scripts/e2e/release.mjs
index 813e8971..ffb558a0 100644
--- a/scripts/e2e/release.mjs
+++ b/scripts/e2e/release.mjs
@@ -7,6 +7,7 @@ import { mcpOwnerJourneys, mcpPublicJourney, settingsAccessibilityJourney } from
import { automationJourney } from "./automation.mjs";
import { releaseFixture } from "./release-fixture.mjs";
+execFileSync(process.execPath, ["scripts/e2e/mcp-page.mjs"], { stdio: "inherit" });
const fixture = await releaseFixture();
let browser;
try {