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.

refactor(mcp): unify ChatGPT Surface UI

Rahman63b5e9224a2c
diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md
index 14539d7f..3a5bfa82 100644
--- a/docs/ARCHITECTURE.md
+++ b/docs/ARCHITECTURE.md
@@ -118,11 +118,13 @@ through the app catch-all.
### 4.1 ChatGPT as an MSO presentation target
The web catch-all remains the authenticated cockpit route. ChatGPT does **not** frame that cockpit.
-Instead `render_mso_surface` binds the versioned MCP App resource `ui://mso/surface-v1.html`, which
+Instead `render_mso_surface` binds the versioned MCP App resource `ui://mso/surface-v4.html`, which
implements a smaller presentation router for `/`, `/monitor`, `/project`, `/diff`, `/browser` and
`/apps/<reviewed-id>`. Native Surface views call the same bounded MSO tools; reviewed app demos may
use a nested iframe only when their exact HTTPS origin exists in the code-owned Surface catalog and
-the MCP resource CSP `frameDomains`. Anti-frame apps stay on the remote-browser seam.
+the MCP resource CSP `frameDomains`. Anti-frame apps stay on the remote-browser seam. `project_get`,
+`project_diff`, and `vps_status` remain pure data tools with no UI template; only `render_mso_surface`
+owns the general-purpose Surface resource, while `workflow_start` retains its dedicated progress card.
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
diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md
index 3c3fea1a..e2d7da80 100644
--- a/docs/CHANGELOG.md
+++ b/docs/CHANGELOG.md
@@ -34,6 +34,10 @@ this is the *what*, and it is what Settings → About shows as “What's new”.
- `agent` add repeatable corpus runner
- `agent` expand objective repo corpus
+**Changed**
+
+- `mcp` unify ChatGPT Surface UI
+
**Tests**
- `agent` calibrate local semantic memory retrieval
diff --git a/docs/PROGRESS.md b/docs/PROGRESS.md
index 90191f00..288cd909 100644
--- a/docs/PROGRESS.md
+++ b/docs/PROGRESS.md
@@ -1,4 +1,5 @@
# mso — Progress Log
+- **MCP Apps presentation unification / Surface v4 (2026-09-04):** MCP server `1.9.3` / toolset `2026.09.04.4` retires the specialized `project-status-v2`, `project-diff-v2`, and `vps-status-v2` resources. `project_get`, `project_diff`, and `vps_status` are pure data tools again; `ui://mso/surface-v4.html` is the only general-purpose UI and uses the portable MCP Apps `tools/call` bridge for native monitor/project/diff views. `workflow-progress-v2` remains intentionally separate for live workflow polling. Play Together keeps the exact `game.rahmanef.com/embed` frame boundary, so the external-iframe review advisory remains expected only for the universal Surface.
- **Cognitive Runtime claim audit / public evidence boundary (2026-09-04):** revalidated source/main/origin and loopback/public production on the latest concurrent baseline, then reran the deterministic Cognitive Runtime/memory gates: routing recall 100%, active-schema reduction 96.6%, typed memory 8/8, P9 6/6 at 200 corrections, P10 lifecycle 8/8, lexical/local-semantic 4/6 vs 3/6, and bounded graph fixture 3/3. Raw P6/P7/P8 artifacts were independently re-hashed and their aggregate arithmetic recomputed; the canonical P7 two-run artifact is `mso-p7-repeat-full-2x9.json` (`a0c12961...`), not the similarly named older `mso-p7-repeat-full-2runs.json`. Canonical P7+P8 yields 5/5 perfect full runs for both MSO and Hermes and the documented 74.7% token / 12.8% average-latency / 34.1% p50 observed deltas on that exact nine-scenario matched corpus. P4/P5 exact tables are downgraded to historical release-reported metrics because this audit could not independently recover raw artifacts matching those exact values. README now removes the stale 29-tool ChatGPT count, removes the unsupported "most complete" positioning superlative, and states explicit no-universal-superiority/no-cost/no-cache/no-OpenClaw boundaries. Tool Forge executable evaluation is documented as fail-closed until its explicit local Docker sandbox image is provisioned; that image was absent during this audit.
- **Play Together secure iframe / Surface v3 (2026-09-04):** MCP server `1.9.2` / toolset `2026.09.04.3` upgrades `ui://mso/surface-v3.html` so Play Together can render live inside ChatGPT without relaxing the whole app. The Surface allowlists only `https://game.rahmanef.com`, starts it at `/embed`, revalidates the exact origin plus `/embed` path prefix in-browser, and retains a sandbox without popups/top-navigation. The Play Together deployment reciprocally keeps normal routes anti-frame and gives only `/embed` + `/embed/*` the exact `mso-ui.rahmanef.com` ancestor permission. Auth remains normal; no demo bypass or raw HTML/arbitrary URL input is added.
- **MSO Surface v1 scope correction / v2 resource (2026-09-04):** MCP server `1.9.1` / toolset `2026.09.04.2` removes accidental cross-project catalog entries from Fresh 3. `ui://mso/surface-v2.html` keeps the generic secure Surface architecture but its current VPSKU app catalog contains only **Play Together** (`https://game.rahmanef.com`) as a `remote` target because that app currently sends `frame-ancestors 'self'`. The Surface CSP therefore has **no third-party `frameDomains` at all**. Raw HTML/arbitrary URLs remain rejected, project anti-framing headers are never stripped, and app identities from other MSO server scopes are not copied into this connector.
diff --git a/docs/TESTING-HANDOFF.md b/docs/TESTING-HANDOFF.md
index 2991e3fe..a5d5ea52 100644
--- a/docs/TESTING-HANDOFF.md
+++ b/docs/TESTING-HANDOFF.md
@@ -9,8 +9,8 @@ The current release target is **MSO CLI 1.12.0**, MCP server `1.9.2`, toolset `2
Current verified behavior:
- **2026-09-04 Cognitive Runtime public-claim audit:** source/main/origin + loopback/public production were revalidated on the latest concurrent baseline. Fresh reruns pass `bench:cognitive`, `bench:memory`, P9 200-correction calibration, P10 lifecycle, and P10 retrieval calibration. Current deterministic evidence: 100% required-tool recall, 96.6% active-schema reduction, memory 8/8, P9 6/6, P10 lifecycle 8/8, lexical/local-semantic 4/6 vs 3/6, graph fixture 3/3. Canonical raw comparison artifacts were re-hashed: P6 `e0b5e1e30a9f1e5b34624e42d4bb5195792e50129b74de7d4006906a99716ba5`, P7 two-run `a0c12961d142420f6ac334ff021bde7ab82faa89f9294107d3bd46823606a530`, P8 three-run `f70e2f5e8132f0808976ed69e2cb6769d2cec861d58612a8cca2ef5d80a7d838`, P8 cache `b4a2b1be5dc6edfb2ce8282eae64e3a4fc206cd043ecb825a1eae6a617c9f871`. The canonical P7 file is `mso-p7-repeat-full-2x9.json`; the similarly named `mso-p7-repeat-full-2runs.json` is a different, non-canonical run. Recomputed P7+P8 evidence is 5/5 perfect for both MSO and Hermes with 74.7% fewer normalized tokens/attempt, 12.8% lower mean average latency, and 34.1% lower mean per-run p50 for MSO on that exact matched nine-scenario corpus. P4/P5 exact numeric tables are historical-only because their exact raw artifacts were not independently revalidated in this audit. Cost/cache/OpenClaw remain unranked. Tool Forge source/non-Docker tests pass, but the local Forge Docker image was absent, so three Docker-only tests were correctly skipped and executable evaluation fails closed until explicitly provisioned.
-- Fresh 3 current MCP contract: server `1.9.2` / toolset `2026.09.04.3`; ChatGPT receives **64 transport tools = 63 model/operator actions (34 read / 17 write / 12 exec) + app-only `workflow_status`**, while the full transport catalog is 88 tools / 87 model tools. Every ChatGPT action advertises `outputSchema`, the dedicated MCP Apps widget origin is `https://mso-ui.rahmanef.com`, and five official digest-verified Skills are exposed through the MCP Skills/resource extension. Five MCP Apps are published: the four existing v2 operator cards plus `ui://mso/surface-v3.html`. The Surface accepts no raw HTML/arbitrary URL; its only frame domain is `https://game.rahmanef.com`, and every Play Together iframe URL must remain under `/embed`. The normal Play Together shell stays anti-frame, while the dedicated embed namespace allows only `mso-ui.rahmanef.com`. Other MSO server scopes are not copied into this catalog.
-- MCP App navigation acceptance: a ChatGPT-opened root URL carrying `redirectUrl=https://chatgpt.com/c/...` must 307 to `/assistant/mcp`, then authenticated browser E2E must show the Alfa `MCP Activity` view. Contextual widget targets are workflow→`/assistant/mcp`, VPS→`/monitor`, project→`/files`, diff→`/code`. This changes no MCP tool/schema/resource URI, so existing Fresh 3 registrations remain compatible.
+- Fresh 3 current MCP contract: server `1.9.3` / toolset `2026.09.04.4`; ChatGPT receives **64 transport tools = 63 model/operator actions (34 read / 17 write / 12 exec) + app-only `workflow_status`**, while the full transport catalog is 88 tools / 87 model tools. Every ChatGPT action advertises `outputSchema`, the dedicated MCP Apps widget origin is `https://mso-ui.rahmanef.com`, and five official digest-verified Skills are exposed through the MCP Skills/resource extension. Exactly two MCP App resources are published: dedicated `ui://mso/workflow-progress-v2.html` plus universal `ui://mso/surface-v4.html`. `project_get`, `project_diff`, and `vps_status` are pure data tools with no UI template; Surface native views refresh them through MCP Apps `tools/call`. The Surface accepts no raw HTML/arbitrary URL; its only frame domain is `https://game.rahmanef.com`, and every Play Together iframe URL must remain under `/embed`. The normal Play Together shell stays anti-frame, while the dedicated embed namespace allows only `mso-ui.rahmanef.com`. Other MSO server scopes are not copied into this catalog.
+- MCP App navigation acceptance: a ChatGPT-opened root URL carrying `redirectUrl=https://chatgpt.com/c/...` must 307 to `/assistant/mcp`, then authenticated browser E2E must show the Alfa `MCP Activity` view. The dedicated workflow card targets `/assistant/mcp`; VPS/project/diff are now native routes inside universal Surface v4 rather than independent widgets. Surface v4 is a cache-busting resource URI change, so ChatGPT must re-scan Fresh 3 after deployment.
- P10 memory retention/lifecycle: isolated fixtures now archive only cold finished claims before the hard 2,000-record / 2 MiB live-ledger limits. Trigger/target are 1,400 -> <=1,000 live records (or ~1.4 MiB -> ~1 MiB); archive segments are content-addressed, owner-only and archive-before-ledger atomic. `bench:memory:lifecycle` is **8/8 deterministic** with a 1,400-correction seed ending at **1,000 live + 401 archived / two segments** and a 56-byte resolved projection. It verifies explicit archived-history retrieval, historical temporal resolution, aggregate-only no-content telemetry, `0700/0600` permissions, interrupted-commit live-wins semantics, backdated replacement over immutable archive, and frozen session A / fresh session B / resume-copy behavior. The P10 retrieval gate is **4/6 lexical** (synonym + Indonesian/English misses remain explicit); P10D also calibrates the existing local `mso-local-hybrid-v1` encoder on the same rows and gets **3/6** with zero network calls / zero persisted memory vectors, so production vector storage stays blocked by measured non-improvement rather than assumption. **3/3 two-hop relationship fixtures** keep graph storage blocked. The exact-history crowding bug (`Runtime-1` vs `Runtime-10...`) is fixed by exact phrase/token scoring; legacy `bench:memory` remains 100%.
- P9 memory calibration: isolated temporary-memory fixtures now cover repeated corrections, explicit-vs-observed authority, confidence/recency, future validity, forget, and history integrity. P9 fixed a real temporal privacy bug where `forget` could leave a future-scheduled claim that resurrected later; forget now closes all current/future-capable intervals while preserving already-ended history. Final 200-correction stress from source `d249da4`: **6/6 calibration scenarios**, existing memory benchmark **100%**, Cognitive Runtime memory gates **100%**; 200 ledger rows / 135,180 bytes resolve to 1 row / 58-byte compatibility projection (**99.96% smaller**) and history retrieval remains capped at 100. No calibrated case requires graph memory.
- P8 calibration: repeat aggregation now reports descriptive per-run spread without inferential claims; three new complete nine-scenario runs from source `51ae31f` were **27/27 task + 27/27 scenario-policy and 3/3 perfect runs for both agents**, with 54/54 row identity/provider/model/token-arithmetic checks passing. Combined with P7, both agents are **5/5 perfect**; five-run means are MSO vs Hermes 16,907.6 vs 66,791.1 normalized tokens/attempt (~74.7% lower for MSO), 18,985.9 vs 21,779.8 ms average latency, and 14,130.8 vs 21,457.2 ms per-run p50. New `bench:cache-calibration` final 4-round/12K-prefix run was 8/8 success; MSO cache-read was zero on 4/4 while Hermes naturally reported positive cache reads on 2/4 (9,728 + 19,968), but cache frequency is unranked because request envelopes differ. P8 also fixes false token non-comparability when independently valid normalized proof shapes vary across cache/no-cache rows. Cost remains non-comparable because attribution is asymmetric.
diff --git a/docs/generated/MCP-CATALOG.md b/docs/generated/MCP-CATALOG.md
index e7a706e0..60f2259c 100644
--- a/docs/generated/MCP-CATALOG.md
+++ b/docs/generated/MCP-CATALOG.md
@@ -4,13 +4,13 @@
## Full MSO catalog
-<!-- mcp-toolset: server=1.9.2 version=2026.09.04.3 tools=87 read=43 write=25 exec=19 -->
+<!-- mcp-toolset: server=1.9.3 version=2026.09.04.4 tools=87 read=43 write=25 exec=19 -->
| Fact | Current source value |
|---|---:|
-| MCP server | `1.9.2` |
-| Toolset | `2026.09.04.3` |
-| Toolset changed at | `2026-09-03T19:22:00Z` |
+| MCP server | `1.9.3` |
+| Toolset | `2026.09.04.4` |
+| Toolset changed at | `2026-09-03T20:56:00Z` |
| Transport tools | **88** |
| Model/operator tools | **87** |
| Read | **43** |
@@ -120,7 +120,7 @@
## ChatGPT static profile
-<!-- mcp-chatgpt-profile: server=1.9.2 version=2026.09.04.3 tools=63 read=34 write=17 exec=12 app-only=1 total=64 -->
+<!-- mcp-chatgpt-profile: server=1.9.3 version=2026.09.04.4 tools=63 read=34 write=17 exec=12 app-only=1 total=64 -->
The ChatGPT profile is a fail-closed static projection defined by `CHATGPT_TOOL_NAMES`. OAuth scope is still enforced independently; 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 8b8a60aa..7797692b 100644
--- a/docs/integrations/CHATGPT-UI.md
+++ b/docs/integrations/CHATGPT-UI.md
@@ -7,9 +7,9 @@ MSO renders first-party interactive operator cards inside ChatGPT while keeping
A normal tool result cannot create an inline application by returning arbitrary HTML. MSO exposes the MCP Apps contracts explicitly:
1. `resources/list` / `resources/read` expose `ui://…` resources with `text/html;profile=mcp-app`.
-2. Model-visible tools bind a resource with `_meta.ui.resourceUri` plus the OpenAI compatibility alias `_meta["openai/outputTemplate"]`.
+2. Only render-entry tools bind a resource with `_meta.ui.resourceUri`; data tools return structured results without templates. `workflow_start` owns the dedicated progress resource and `render_mso_surface` owns the general-purpose Surface. The OpenAI `outputTemplate` alias remains only on those render entries for compatibility.
3. Every ChatGPT action declares `outputSchema`. UI/critical tools use typed projections; other actions use the shared bounded `{ result }` structured envelope. Generic MCP clients keep their historical text fallback unless an explicit output schema exists.
-4. Sandboxed widgets read `window.openai.toolOutput`, may call only explicitly app-visible MSO tools through `window.openai.callTool`, and use `window.openai.openExternal` for the full dashboard.
+4. Sandboxed widgets read tool results from the MCP Apps bridge and use standard `tools/call` for data refreshes. ChatGPT-only extensions remain feature-detected for display mode, widget state, and `openExternal`.
Official references:
@@ -21,17 +21,13 @@ Official references:
| Experience | Entry tool | Resource | Refresh behavior |
| --- | --- | --- | --- |
| Workflow progress | `workflow_start` | `ui://mso/workflow-progress-v2.html` | app-only `workflow_status` |
-| Project status | `project_get` | `ui://mso/project-status-v2.html` | widget calls `project_get` again |
-| Git diff summary | `project_diff` | `ui://mso/project-diff-v2.html` | static result; request a new diff for changed state |
-| VPS/operator status | `vps_status` | `ui://mso/vps-status-v2.html` | widget calls `vps_status` again |
-| Universal MSO Surface | `render_mso_surface` | `ui://mso/surface-v3.html` | native views call bounded read tools; Play Together uses its reviewed exact-origin `/embed` frame boundary |
+| Universal MSO Surface | `render_mso_surface` | `ui://mso/surface-v4.html` | `/monitor`, `/project`, and `/diff` call pure data tools via `tools/call`; Play Together uses its reviewed exact-origin `/embed` frame boundary |
Source boundaries:
| Contract | MSO source |
| --- | --- |
| Resource registry / workflow UI | `lib/mcp/ui-resources.ts` |
-| Project/diff/VPS resources | `lib/mcp/ui-operator-resources.ts` |
| Universal Surface resource/runtime | `lib/mcp/ui-surface.ts`, `lib/mcp/ui-surface-script.ts`, `lib/mcp/ui-surface-style.ts` |
| Surface security catalog/router | `lib/mcp/surface-catalog.ts`, `lib/mcp/tools-surface.ts` |
| Resource capability / RPC | `lib/mcp/dispatch.ts` |
@@ -47,15 +43,11 @@ Source boundaries:
The workflow component receives only workflow id, intent, resolved project label, timing, step count, and recent tool name/outcome/timestamp/duration. `workflow_status` is `ui.visibility:["app"]`, so polling is not another model action and is deliberately excluded from workflow-memory persistence.
-The project component receives the safe `project_get` projection: project identity/path, bounded Git state, package metadata, Convex detection mode, project-MCP alias count, and knowledge existence/size. It does not receive `.mcp.json`, `.env.local`, provider tokens, project-MCP headers, or knowledge content.
+The universal Surface receives no raw project/VPS HTML. Its native views call `project_get`, `project_diff`, and `vps_status` through MCP Apps `tools/call`; those data tools keep complete structured outputs for model/tool chaining but no longer own templates. Project output remains bounded to safe identity/Git/package/Convex/integration/knowledge metadata, diff UI consumes only summary/file metadata rather than interpolating the unified diff, and VPS output reuses the masked infrastructure summary layer so raw credentials never enter the widget.
-The diff component receives only project/mode/SHA metadata, changed file names and aggregate additions/deletions. The unified diff remains in the tool's portable text result and is never interpolated into widget HTML.
+Both resources are self-contained: no external JavaScript, CSS, images, or direct `fetch()` calls. The workflow card retains `Open in MSO`; the Surface provides native routing and the reviewed app-demo renderer. A root MSO landing carrying ChatGPT's `redirectUrl=https://chatgpt.com/c/...` is server-redirected to `/assistant/mcp` while preserving the callback query; MSO never follows that callback itself.
-The VPS component receives bounded health/process/app/browser state and **masked** infrastructure readiness. Provider values are those already sanitized by the infrastructure summary layer; raw credentials are never added for UI rendering.
-
-All five resources are self-contained: no external JavaScript, CSS, images, or direct `fetch()` calls. `Open in MSO` feature-detects the official ChatGPT `window.openai.openExternal` bridge, registers a contextual MSO deep-link with `window.openai.setOpenInAppUrl`, and shows a user-clickable `Open directly` fallback plus visible status when automatic navigation is unavailable. Workflow cards target `/assistant/mcp`, VPS cards `/monitor`, project cards `/files`, and diff cards `/code`. As a cache-safe fallback, a root MSO landing carrying ChatGPT's `redirectUrl=https://chatgpt.com/c/...` is server-redirected to `/assistant/mcp` while preserving the callback query; MSO never follows that callback itself.
-
-The universal **MSO Surface** is intentionally stricter than the ordinary runtime-app/HTML widgets. `render_mso_surface` accepts only an MSO-style route plus optional project/SHA context — never raw HTML and never an arbitrary URL. Nested frames can come only from the code-owned `SURFACE_APPS` registry and are permitted only when the exact origin is also present in the resource's `ui.csp.frameDomains`. The current Fresh 3 catalog has no iframe renderer, so `frameDomains` is omitted entirely. The browser-side renderer validates the returned app id and URL origin against the catalog bundled into the signed resource before setting `iframe.src`; dynamic labels use DOM `textContent`, not HTML interpolation. The iframe sandbox omits popup/top-navigation privileges. Apps that send `X-Frame-Options` or restrictive `frame-ancestors` remain `remote` and MSO does not strip those protections.
+The universal **MSO Surface** is intentionally stricter than the ordinary runtime-app/HTML widgets. `render_mso_surface` accepts only an MSO-style route plus optional project/SHA context — never raw HTML and never an arbitrary URL. Nested frames can come only from the code-owned `SURFACE_APPS` registry and are permitted only when the exact origin is also present in the resource's `ui.csp.frameDomains`. The current Fresh 3 catalog has one reviewed iframe renderer for Play Together, so `frameDomains` contains exactly `https://game.rahmanef.com`. The browser-side renderer validates the returned app id and URL origin against the catalog bundled into the signed resource before setting `iframe.src`; dynamic labels use DOM `textContent`, not HTML interpolation. The iframe sandbox omits popup/top-navigation privileges. Apps that send `X-Frame-Options` or restrictive `frame-ancestors` remain `remote` and MSO does not strip those protections.
Fresh 3 is the VPSKU MSO connector. Its current app target is **Play Together** at `https://game.rahmanef.com`. App identities and trusted origins from other MSO server scopes must not be copied into this catalog or CSP.
@@ -69,20 +61,20 @@ Installed `runtime:"html"` apps and user-authored HTML widgets are **not** trust
ChatGPT model
│
├─ workflow_start ──→ workflow card ──→ workflow_status (app-only)
- ├─ project_get ──→ project card ──→ project_get refresh
- ├─ project_diff ──→ diff card
- ├─ vps_status ──→ VPS card ──→ vps_status refresh
+ ├─ project_get / project_diff / vps_status ──→ structured data only
└─ render_mso_surface ─→ MSO Surface
- ├─ native monitor/project/diff views
+ ├─ /monitor ──tools/call──→ vps_status
+ ├─ /project ──tools/call──→ project_get
+ ├─ /diff ──tools/call──→ project_diff
├─ exact-origin iframe only after explicit trust review
└─ remote-browser seam for anti-frame apps
-Every entry tool also returns portable text/JSON for non-MCP-Apps clients.
+All data tools keep portable structured/text results for non-MCP-Apps clients.
```
## Dedicated UI origin
-All five templates declare `_meta.ui.domain = https://mso-ui.rahmanef.com` and the ChatGPT compatibility alias `_meta["openai/widgetDomain"]` with the same origin. The sibling hostname is intentional: the cockpit may scope its session cookie to `mso.rahmanef.com`, while `mso-ui.rahmanef.com` is outside that cookie domain. The dedicated origin therefore satisfies the plugin UI identity requirement without reusing the authenticated dashboard origin.
+Both templates declare `_meta.ui.domain = https://mso-ui.rahmanef.com` and the ChatGPT compatibility alias `_meta["openai/widgetDomain"]` with the same origin. The sibling hostname is intentional: the cockpit may scope its session cookie to `mso.rahmanef.com`, while `mso-ui.rahmanef.com` is outside that cookie domain. The dedicated origin therefore satisfies the plugin UI identity requirement without reusing the authenticated dashboard origin.
The reproducible Traefik route is stored in `ops/traefik/mso-ui.yml` and forwards only to the same local MSO service through the existing HTTPS/Let's Encrypt ingress. Widget CSP still allows no network/static-resource domains and only permits `Open in MSO` to redirect to `https://mso.rahmanef.com`.
@@ -94,8 +86,8 @@ Do not manually click through every model action. Cover the public contract with
| --- | --- | --- |
| Workflow/UI bridge | Start a read-only workflow for `mso`, press `Refresh`, then `Open in MSO` | progress updates; MSO opens visibly at Alfa → MCP Activity (`/assistant/mcp`), including when ChatGPT still uses a cached root-targeting widget; the explicit `Open directly` fallback targets the same view |
| MSO Surface | Ask to render `/`, `/monitor`, then `/apps/play-together` | home/native view renders inline; Play Together loads only from `https://game.rahmanef.com/embed`; `frameDomains` contains exactly `https://game.rahmanef.com`; fullscreen remains user-initiated |
-| VPS card | Ask for the current VPS status | `vps_status` renders CPU/memory/disk/apps/browser/infra and its refresh works |
-| Project/Git | Ask to inspect project `mso`, then show its current diff/history | `project_get` and `project_diff` render the correct project/branch/changes without secrets |
+| VPS / monitor | Ask for current VPS data, then render `/monitor` | `vps_status` returns structured data without a template; Surface renders CPU/memory/disk/apps/browser/infra and refresh works |
+| Project/Git | Ask to inspect project `mso`, then render `/project` or `/diff` | data tools return the correct project/branch/changes without templates; Surface presents them without secrets |
| Safe filesystem CRUD | Create/read/copy/move/delete a disposable file under `~/mso-smoke-tests/` | content/hash round-trip succeeds and cleanup leaves no test file |
| Convex | Check database status/tools for a known Convex project such as CareerPack | provider is Convex, project boundary is preserved, no env credential tools appear |
| Project agent | Run `project_agent_run` in `plan_mode=true` for a harmless project inspection | returns a bounded plan/message id without modifying the repo |
@@ -110,9 +102,9 @@ After a UI/schema release:
1. run `bun run verify` and a production build;
2. deploy through the normal MSO release path;
3. refresh/re-scan the ChatGPT development app so `initialize`, `tools/list`, and `resources/list` are read again;
-4. verify all 64 ChatGPT transport tools expose `outputSchema` (63 model actions + app-only `workflow_status`); verify each UI entry tool also exposes `_meta.ui.resourceUri`;
-5. verify each `resources/read` returns `text/html;profile=mcp-app`;
-6. verify every UI resource reports `ui.domain=https://mso-ui.rahmanef.com`; for the universal Surface verify `ui.csp.frameDomains` contains only reviewed iframe origins, refresh buttons work, and `workflow_status` polling does not enter learned workflow steps;
+4. verify all 64 ChatGPT transport tools expose `outputSchema` (63 model actions + app-only `workflow_status`); verify only `workflow_start` and `render_mso_surface` expose `_meta.ui.resourceUri`, while `project_get`, `project_diff`, and `vps_status` do not;
+5. verify `resources/list` contains exactly the dedicated workflow card plus universal Surface and each `resources/read` returns `text/html;profile=mcp-app`;
+6. verify both UI resources report `ui.domain=https://mso-ui.rahmanef.com`; for the universal Surface verify `ui.csp.frameDomains` contains only reviewed iframe origins, native data refreshes use `tools/call`, and `workflow_status` polling does not enter learned workflow steps;
7. verify `skills/list`, `skills/get`, and each declared `skill://` resource/digest before the final Scan Tools refresh.
If ChatGPT still renders text only after a verified deployment, treat a stale app/action snapshot as the first suspect before changing the server again.
diff --git a/lib/config/env-example.test.ts b/lib/config/env-example.test.ts
index 63fa6c4e..693953e7 100644
--- a/lib/config/env-example.test.ts
+++ b/lib/config/env-example.test.ts
@@ -9,7 +9,7 @@
// The allowlist below is the other half of the contract: vars that are deliberately
// NOT in .env.example because you never set them by hand. Each one carries the
// reason, so adding to this list is a decision rather than a way to silence a test.
-import { readFileSync } from "node:fs";
+import { existsSync, readFileSync } from "node:fs";
import { execSync } from "node:child_process";
import path from "node:path";
import { describe, expect, it } from "vitest";
@@ -57,7 +57,10 @@ function usedEnvNames(): string[] {
// A test may stub anything, so .test files do not count as "the app reads it".
// The e2e HARNESSES do count — they are committed code, and the vars they read
// are exactly the ones that belong in NOT_A_KNOB rather than in .env.example.
- .filter((f) => !f.includes(".test."));
+ .filter((f) => !f.includes(".test."))
+ // `git ls-files --cached` still reports tracked paths deleted in the working tree.
+ // Ignore those so pre-commit verification can validate intentional file retirement.
+ .filter((f) => existsSync(path.join(ROOT, f)));
const names = new Set<string>();
for (const file of files) {
const src = readFileSync(path.join(ROOT, file), "utf8");
diff --git a/lib/mcp/surface-catalog.test.ts b/lib/mcp/surface-catalog.test.ts
index 2afe88cc..1159a90a 100644
--- a/lib/mcp/surface-catalog.test.ts
+++ b/lib/mcp/surface-catalog.test.ts
@@ -49,6 +49,8 @@ describe("MSO Surface trusted app catalog", () => {
expect(MSO_SURFACE_SCRIPT).not.toContain("innerHTML");
expect(MSO_SURFACE_SCRIPT).not.toContain("insertAdjacentHTML");
expect(MSO_SURFACE_SCRIPT).not.toContain("document.write");
+ expect(MSO_SURFACE_SCRIPT).toContain('method:"tools/call"');
+ expect(MSO_SURFACE_SCRIPT).not.toContain("window.openai.callTool");
expect(MSO_SURFACE_SCRIPT).toContain("url.origin!==safe.origin");
expect(MSO_SURFACE_SCRIPT).toContain("!url.pathname.startsWith(start+\"/\")");
});
diff --git a/lib/mcp/tools-operator-dashboard.ts b/lib/mcp/tools-operator-dashboard.ts
index 559e8421..f7a847b8 100644
--- a/lib/mcp/tools-operator-dashboard.ts
+++ b/lib/mcp/tools-operator-dashboard.ts
@@ -3,7 +3,6 @@ import { camoufoxStatus } from "@/lib/camoufox/service";
import { listManagedApps } from "@/lib/managed-apps/manager";
import { INFRA_PROVIDER_IDS, readInfraProvider, summarizeInfraProvider } from "@/lib/infra";
import { type McpTool, S, READ_ONLY } from "./tool-kit";
-import { VPS_STATUS_URI } from "./ui-resources";
const OUTPUT = {
type: "object",
@@ -13,18 +12,11 @@ const OUTPUT = {
export const OPERATOR_DASHBOARD_TOOLS: McpTool[] = [{
name: "vps_status",
- title: "Open VPS Status",
+ title: "Get VPS Status",
description: "Return one bounded operator overview of this VPS: health, top processes, managed apps, Camoufox state and masked infrastructure-provider readiness. This aggregates existing safe primitives without replacing them.",
- chatgptDescription: "Open one bounded VPS overview with health, processes, apps, browser and masked infrastructure readiness.",
+ chatgptDescription: "Return one bounded VPS overview with health, processes, apps, browser and masked infrastructure readiness.",
scope: "read", annotations: READ_ONLY,
outputSchema: OUTPUT,
- meta: {
- ui: { resourceUri: VPS_STATUS_URI, visibility: ["model", "app"] },
- "openai/outputTemplate": VPS_STATUS_URI,
- "openai/toolInvocation/invoking": "Opening VPS status…",
- "openai/toolInvocation/invoked": "VPS status opened",
- "openai/widgetAccessible": true,
- },
inputSchema: S({}),
run: async () => {
const [{ uptime, ...health }, top, apps, browser, infrastructure] = await Promise.all([
diff --git a/lib/mcp/tools-project-state.ts b/lib/mcp/tools-project-state.ts
index 05e84918..54014360 100644
--- a/lib/mcp/tools-project-state.ts
+++ b/lib/mcp/tools-project-state.ts
@@ -7,7 +7,6 @@ import {
import { makeDir, writeFileGuarded } from "@/lib/host/fs-api";
import { INFRA_PROVIDER_IDS, readInfraProvider, summarizeInfraProvider } from "@/lib/infra";
import { type McpTool, S, str, opt, READ_ONLY } from "./tool-kit";
-import { DIFF_VIEW_URI, PROJECT_STATUS_URI } from "./ui-resources";
import { selectedProject } from "./tools-project-shared";
const PROJECT_STATUS_OUTPUT = {
@@ -36,13 +35,6 @@ export const PROJECT_STATE_TOOLS: McpTool[] = [
chatgptDescription: "Get a canonical project snapshot with Git, package, Convex, integration and knowledge status. No secrets are returned.",
scope: "read", annotations: READ_ONLY,
outputSchema: PROJECT_STATUS_OUTPUT,
- meta: {
- ui: { resourceUri: PROJECT_STATUS_URI, visibility: ["model", "app"] },
- "openai/outputTemplate": PROJECT_STATUS_URI,
- "openai/toolInvocation/invoking": "Opening MSO project…",
- "openai/toolInvocation/invoked": "MSO project opened",
- "openai/widgetAccessible": true,
- },
toStructuredContent: (value) => {
if (!value || typeof value !== "object") return undefined;
const row = value as Record<string, unknown>;
@@ -86,12 +78,6 @@ export const PROJECT_STATE_TOOLS: McpTool[] = [
scope: "read", annotations: READ_ONLY,
result: { maxTextBytes: 96 * 1024, overflowHint: "The unified diff was compacted; request a narrower commit or inspect one file." },
outputSchema: DIFF_OUTPUT,
- meta: {
- ui: { resourceUri: DIFF_VIEW_URI, visibility: ["model", "app"] },
- "openai/outputTemplate": DIFF_VIEW_URI,
- "openai/toolInvocation/invoking": "Opening project diff…",
- "openai/toolInvocation/invoked": "Project diff opened",
- },
toStructuredContent: (value) => {
if (!value || typeof value !== "object") return undefined;
const row = value as Record<string, unknown>;
diff --git a/lib/mcp/toolset.ts b/lib/mcp/toolset.ts
index 46e0b8f9..4f6d5136 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.9.2";
-export const MCP_TOOLSET_VERSION = "2026.09.04.3";
-export const MCP_TOOLSET_CHANGED_AT = "2026-09-03T19:22:00Z";
+export const MCP_SERVER_VERSION = "1.9.3";
+export const MCP_TOOLSET_VERSION = "2026.09.04.4";
+export const MCP_TOOLSET_CHANGED_AT = "2026-09-03T20:56:00Z";
export type McpToolsetInfo = {
serverVersion: string;
diff --git a/lib/mcp/ui-operator-resources.ts b/lib/mcp/ui-operator-resources.ts
deleted file mode 100644
index a29c4871..00000000
--- a/lib/mcp/ui-operator-resources.ts
+++ /dev/null
@@ -1,49 +0,0 @@
-import { widgetResourceMeta } from "./ui-config";
-import { OPEN_IN_MSO_SCRIPT, openInMsoControls } from "./ui-navigation";
-
-export const PROJECT_STATUS_URI = "ui://mso/project-status-v2.html";
-export const DIFF_VIEW_URI = "ui://mso/project-diff-v2.html";
-export const VPS_STATUS_URI = "ui://mso/vps-status-v2.html";
-
-const MIME = "text/html;profile=mcp-app";
-
-function shell(title: string, body: string, script: string, openPath: string) {
- return String.raw`<main class="mso-card"><style>
-:root{color-scheme:light dark;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}*{box-sizing:border-box}body{margin:0;background:transparent;color:CanvasText}.mso-card{padding:10px}.card{overflow:hidden;border:1px solid color-mix(in srgb,CanvasText 14%,transparent);border-radius:18px;background:color-mix(in srgb,Canvas 95%,transparent)}header{display:flex;align-items:center;gap:10px;padding:13px 14px;border-bottom:1px solid color-mix(in srgb,CanvasText 9%,transparent)}.mark{display:grid;place-items:center;width:30px;height:30px;border-radius:9px;background:color-mix(in srgb,#2563eb 16%,Canvas);font-weight:800}h2{margin:0;font-size:14px}.sub{margin:2px 0 0;color:color-mix(in srgb,CanvasText 58%,transparent);font-size:10px}.grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1px;background:color-mix(in srgb,CanvasText 9%,transparent)}.cell{min-width:0;padding:10px 12px;background:Canvas}.cell span{display:block;font-size:9px;text-transform:uppercase;letter-spacing:.08em;color:color-mix(in srgb,CanvasText 52%,transparent)}.cell strong{display:block;margin-top:3px;font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.section{padding:10px 14px}.row{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:27px;border-top:1px solid color-mix(in srgb,CanvasText 8%,transparent);font-size:11px}.row:first-child{border-top:0}.mono{font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.muted{color:color-mix(in srgb,CanvasText 52%,transparent)}.good{color:#16a34a}.bad{color:#dc2626}.files{margin:0;padding:0;list-style:none}.file{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;min-height:28px;align-items:center;border-top:1px solid color-mix(in srgb,CanvasText 8%,transparent);font-size:11px}.file:first-child{border-top:0}.file-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.actions{display:flex;justify-content:flex-end;align-items:center;gap:7px;flex-wrap:wrap;padding:9px 12px;border-top:1px solid color-mix(in srgb,CanvasText 9%,transparent)}.open-direct{color:CanvasText;font-size:11px;text-decoration:none;border-bottom:1px solid currentColor}.open-feedback{width:100%;text-align:right;font-size:9px;color:color-mix(in srgb,CanvasText 55%,transparent)}button{border:1px solid color-mix(in srgb,CanvasText 14%,transparent);background:color-mix(in srgb,CanvasText 5%,Canvas);color:CanvasText;border-radius:10px;padding:7px 10px;font:inherit;font-size:11px;cursor:pointer}@media(max-width:440px){.mso-card{padding:6px}.grid{grid-template-columns:1fr 1fr}.wide{grid-column:1/-1}}
-</style><section class="card"><header><div class="mark">M</div><div><h2>${title}</h2><p class="sub" id="subtitle">MSO</p></div></header>${body}<div class="actions"><button id="refresh" hidden>Refresh</button>${openInMsoControls("", openPath)}</div></section><script>${script}</script></main>`;
-}
-
-const sharedScript = String.raw`
-const $=id=>document.getElementById(id);let last=null;
-const txt=(v,f="—")=>v===undefined||v===null||v===""?f:String(v);const esc=v=>txt(v);
-function output(){return window.openai&&window.openai.toolOutput?window.openai.toolOutput:null}
-${OPEN_IN_MSO_SCRIPT}
-window.addEventListener("openai:set_globals",()=>{const v=output();if(v)render(v)},{passive:true});window.addEventListener("message",e=>{if(e.source!==window.parent)return;const m=e.data;if(m&&m.method==="ui/notifications/tool-result"&&m.params&&m.params.structuredContent)render(m.params.structuredContent)},{passive:true});
-`;
-
-const projectBody = String.raw`<div class="grid"><div class="cell wide"><span>Project</span><strong id="project">—</strong></div><div class="cell"><span>Branch</span><strong id="branch">—</strong></div><div class="cell"><span>HEAD</span><strong class="mono" id="head">—</strong></div><div class="cell"><span>Working tree</span><strong id="clean">—</strong></div></div><div class="section"><div class="row"><span>Package</span><strong id="package">—</strong></div><div class="row"><span>Database</span><strong id="database">—</strong></div><div class="row"><span>Project MCP</span><strong id="mcp">0</strong></div><div class="row"><span>Knowledge</span><strong id="knowledge">—</strong></div></div>`;
-const projectScript = sharedScript + String.raw`
-let projectId="";function render(v){last=v||{};const p=v.project||{},g=v.git||{},pkg=v.package||{},db=v.database||{},i=v.integrations||{},k=v.knowledge||{};projectId=txt(p.id,"");$("project").textContent=txt(p.name);$("subtitle").textContent=txt(p.path,"Project status");$("branch").textContent=txt(g.branch);$("head").textContent=g.head&&g.head.sha?String(g.head.sha).slice(0,12):"—";$("clean").textContent=g.clean===true?"Clean":g.clean===false?(String(Array.isArray(g.changes)?g.changes.length:0)+" change(s)"):"Unknown";$("clean").className=g.clean===true?"good":g.clean===false?"bad":"";$("package").textContent=[pkg.name,pkg.version].filter(Boolean).join(" · ")||"—";$("database").textContent=db.detected?("Convex · "+txt(db.mode)):"Not detected";$("mcp").textContent=String(Array.isArray(i.projectMcp)?i.projectMcp.length:0);$("knowledge").textContent=k.exists?(txt(k.bytes,0)+" bytes"):"Not set";$("refresh").hidden=!projectId}
-$("refresh").addEventListener("click",async()=>{if(!projectId||!window.openai||typeof window.openai.callTool!=="function")return;const r=await window.openai.callTool("project_get",{project:projectId});render(r&&r.structuredContent?r.structuredContent:r)});const initial=output();if(initial)render(initial);
-`;
-
-const diffBody = String.raw`<div class="grid"><div class="cell wide"><span>Project</span><strong id="project">—</strong></div><div class="cell"><span>Mode</span><strong id="mode">—</strong></div><div class="cell"><span>Files</span><strong id="count">0</strong></div><div class="cell"><span>Lines</span><strong id="lines">+0 −0</strong></div></div><div class="section"><ul class="files" id="files"></ul><div class="muted" id="empty">No changed files.</div></div>`;
-const diffScript = sharedScript + String.raw`
-function render(v){last=v||{};const p=v.project||{},s=v.summary||{},files=Array.isArray(v.files)?v.files:[];$("project").textContent=txt(p.name);$("subtitle").textContent=v.sha?("Commit "+String(v.sha).slice(0,12)):"Current changes";$("mode").textContent=txt(v.mode);$("count").textContent=txt(s.files,files.length);$("lines").textContent="+"+txt(s.additions,0)+" −"+txt(s.deletions,0);const ul=$("files");ul.textContent="";$("empty").hidden=files.length>0;for(const f of files.slice(0,80)){const li=document.createElement("li");li.className="file";const n=document.createElement("span");n.className="file-name mono";n.textContent=txt(f.file);const d=document.createElement("span");d.className="muted";d.textContent="+"+txt(f.added,"?")+" −"+txt(f.deleted,"?");li.append(n,d);ul.append(li)}}const initial=output();if(initial)render(initial);
-`;
-
-const vpsBody = String.raw`<div class="grid"><div class="cell"><span>Load</span><strong id="load">—</strong></div><div class="cell"><span>Memory</span><strong id="memory">—</strong></div><div class="cell"><span>Disk</span><strong id="disk">—</strong></div></div><div class="section"><div class="row"><span>Uptime</span><strong id="uptime">—</strong></div><div class="row"><span>Managed apps</span><strong id="apps">—</strong></div><div class="row"><span>Browser</span><strong id="browser">—</strong></div><div class="row"><span>Infrastructure</span><strong id="infra">—</strong></div></div>`;
-const vpsScript = sharedScript + String.raw`
-const pct=n=>Number.isFinite(Number(n))?(String(Math.round(Number(n)))+"%"):"—";function render(v){last=v||{};const h=v.health||{},a=Array.isArray(v.apps)?v.apps:[],b=v.browser||{},infra=Array.isArray(v.infrastructure)?v.infrastructure:[];$("subtitle").textContent="Live bounded VPS overview";const load=h.load||h.cpu||{};$("load").textContent=Array.isArray(load)?load.map(x=>Number(x).toFixed(2)).join(" / "):txt(load.one||load.load1||h.load1);const mem=h.memory||{};$("memory").textContent=mem.percentUsed!==undefined?pct(mem.percentUsed):mem.used&&mem.total?pct(mem.used/mem.total*100):"—";const disk=h.disk||{};$("disk").textContent=disk.percentUsed!==undefined?pct(disk.percentUsed):disk.used&&disk.total?pct(disk.used/disk.total*100):"—";$("uptime").textContent=h.uptimeSeconds!==undefined?(String(Math.round(Number(h.uptimeSeconds)/3600))+"h"):"—";$("apps").textContent=String(a.filter(x=>x.running).length)+"/"+String(a.length)+" running";$("browser").textContent=b.running?"Running":b.installed?"Stopped":"Not installed";$("infra").textContent=String(infra.filter(x=>x.configured).length)+"/"+String(infra.length)+" configured";$("refresh").hidden=false}
-$("refresh").addEventListener("click",async()=>{if(!window.openai||typeof window.openai.callTool!=="function")return;const r=await window.openai.callTool("vps_status",{});render(r&&r.structuredContent?r.structuredContent:r)});const initial=output();if(initial)render(initial);
-`;
-
-function meta(description: string) {
- return widgetResourceMeta(description);
-}
-
-export const OPERATOR_UI_RESOURCES = [
- { uri: PROJECT_STATUS_URI, name: "MSO project status", description: "Interactive project snapshot.", mimeType: MIME, text: shell("MSO project", projectBody, projectScript, "/files"), _meta: meta("MSO project status card with bounded Git, Convex, knowledge and integration state.") },
- { uri: DIFF_VIEW_URI, name: "MSO project diff", description: "Compact project diff summary.", mimeType: MIME, text: shell("MSO diff", diffBody, diffScript, "/code"), _meta: meta("MSO project diff summary. Raw diff text remains in the tool fallback and is not injected as HTML.") },
- { uri: VPS_STATUS_URI, name: "MSO VPS status", description: "Interactive bounded VPS overview.", mimeType: MIME, text: shell("MSO VPS", vpsBody, vpsScript, "/monitor"), _meta: meta("MSO live bounded VPS overview for health, managed apps, browser and infrastructure readiness.") },
-] as const;
diff --git a/lib/mcp/ui-resources.test.ts b/lib/mcp/ui-resources.test.ts
index 20fb26dc..1a655b7b 100644
--- a/lib/mcp/ui-resources.test.ts
+++ b/lib/mcp/ui-resources.test.ts
@@ -3,7 +3,7 @@ import { describe, expect, it, vi } from "vitest";
vi.mock("server-only", () => ({}));
const { dispatch } = await import("./dispatch");
-const { MCP_APP_MIME_TYPE, WORKFLOW_PROGRESS_URI, PROJECT_STATUS_URI, DIFF_VIEW_URI, VPS_STATUS_URI, MSO_SURFACE_URI, readUiResource } = await import("./ui-resources");
+const { MCP_APP_MIME_TYPE, WORKFLOW_PROGRESS_URI, MSO_SURFACE_URI, readUiResource } = await import("./ui-resources");
const { MCP_UI_DOMAIN } = await import("./ui-config");
const { activeWorkflowForActor } = await import("@/lib/workflow");
@@ -35,10 +35,11 @@ describe("MCP Apps workflow progress UI", () => {
"openai/widgetAccessible": true,
});
- for (const [name, uri] of [["project_get", PROJECT_STATUS_URI], ["project_diff", DIFF_VIEW_URI], ["vps_status", VPS_STATUS_URI]] as const) {
+ for (const name of ["project_get", "project_diff", "vps_status"] as const) {
const tool = tools.find((row) => row.name === name);
expect(tool?.outputSchema, name).toBeDefined();
- expect(tool?._meta, name).toMatchObject({ ui: { resourceUri: uri, visibility: ["model", "app"] }, "openai/outputTemplate": uri });
+ expect((tool?._meta?.ui as { resourceUri?: string } | undefined)?.resourceUri, name).toBeUndefined();
+ expect(tool?._meta?.["openai/outputTemplate"], name).toBeUndefined();
}
const surface = tools.find((row) => row.name === "render_mso_surface");
@@ -53,12 +54,9 @@ describe("MCP Apps workflow progress UI", () => {
it("serves one self-contained mcp-app resource", async () => {
const listed = await dispatch({ id: 1, method: "resources/list" }, "read", "mcp:ui-resource");
const resources = (listed.result as { resources: Array<{ uri: string; mimeType: string }> }).resources;
- expect(resources).toHaveLength(5);
+ expect(resources).toHaveLength(2);
expect(resources).toEqual(expect.arrayContaining([
expect.objectContaining({ uri: WORKFLOW_PROGRESS_URI, mimeType: MCP_APP_MIME_TYPE }),
- expect.objectContaining({ uri: PROJECT_STATUS_URI, mimeType: MCP_APP_MIME_TYPE }),
- expect.objectContaining({ uri: DIFF_VIEW_URI, mimeType: MCP_APP_MIME_TYPE }),
- expect.objectContaining({ uri: VPS_STATUS_URI, mimeType: MCP_APP_MIME_TYPE }),
expect.objectContaining({ uri: MSO_SURFACE_URI, mimeType: MCP_APP_MIME_TYPE }),
]));
@@ -135,20 +133,18 @@ describe("MCP Apps workflow progress UI", () => {
});
- it("serves project, diff and VPS MCP Apps without external fetches", async () => {
- for (const [uri, marker] of [[PROJECT_STATUS_URI, "project_get"], [DIFF_VIEW_URI, "MSO diff"], [VPS_STATUS_URI, "vps_status"]] as const) {
- const read = await dispatch({ id: 20, method: "resources/read", params: { uri } }, "read", "mcp:ui-operator");
- const content = (read.result as { contents: Array<{ mimeType: string; text: string; _meta: Record<string, unknown> }> }).contents[0];
- expect(content.mimeType).toBe(MCP_APP_MIME_TYPE);
- expect(content.text).toContain(marker);
- expect(content.text).not.toContain("fetch(");
- expect(content.text).toContain("openExternal");
- expect(content.text).toContain("setOpenInAppUrl");
- expect(content.text).toContain("Open directly");
- expect(uri).toContain("-v2.html");
- expect(content._meta).toMatchObject({ ui: { domain: MCP_UI_DOMAIN, prefersBorder: true }, "openai/widgetDomain": MCP_UI_DOMAIN, "openai/widgetPrefersBorder": true });
+ it("retires specialized operator resources in favor of the universal Surface", async () => {
+ for (const uri of [
+ "ui://mso/project-status-v2.html",
+ "ui://mso/project-diff-v2.html",
+ "ui://mso/vps-status-v2.html",
+ ]) {
+ expect(readUiResource(uri)).toBeUndefined();
+ const read = await dispatch({ id: 20, method: "resources/read", params: { uri } }, "read", "mcp:ui-retired");
+ expect(read.error).toMatchObject({ code: -32602 });
}
});
+
it("serves the universal MSO Surface with a minimal nested-frame allowlist", async () => {
const read = await dispatch({ id: 30, method: "resources/read", params: { uri: MSO_SURFACE_URI } }, "read", "mcp:ui-surface");
const content = (read.result as { contents: Array<{ mimeType: string; text: string; _meta: Record<string, any> }> }).contents[0];
@@ -171,14 +167,17 @@ describe("MCP Apps workflow progress UI", () => {
resource_domains: [],
frame_domains: ["https://game.rahmanef.com"],
});
- expect(MSO_SURFACE_URI).toContain("surface-v3.html");
+ expect(MSO_SURFACE_URI).toContain("surface-v4.html");
});
- it("gives every MCP App a visible contextual MSO destination", () => {
+ it("keeps one dedicated progress card and one universal general-purpose Surface", () => {
expect(readUiResource(WORKFLOW_PROGRESS_URI)?.text).toContain('data-mso-path="/assistant/mcp"');
- expect(readUiResource(PROJECT_STATUS_URI)?.text).toContain('data-mso-path="/files"');
- expect(readUiResource(DIFF_VIEW_URI)?.text).toContain('data-mso-path="/code"');
- expect(readUiResource(VPS_STATUS_URI)?.text).toContain('data-mso-path="/monitor"');
+ const surface = readUiResource(MSO_SURFACE_URI)?.text ?? "";
+ expect(surface).toContain('route:"/monitor"');
+ expect(surface).toContain('route:"/project"');
+ expect(surface).toContain('route:"/diff"');
+ expect(surface).toContain('route:"/browser"');
+ expect(surface).toContain('method:"tools/call"');
});
it("rejects unknown UI resource URIs", async () => {
diff --git a/lib/mcp/ui-resources.ts b/lib/mcp/ui-resources.ts
index edb7968e..5825e32b 100644
--- a/lib/mcp/ui-resources.ts
+++ b/lib/mcp/ui-resources.ts
@@ -1,8 +1,6 @@
import { MSO_SURFACE_RESOURCE } from "./ui-surface";
-import { OPERATOR_UI_RESOURCES } from "./ui-operator-resources";
import { widgetResourceMeta } from "./ui-config";
import { OPEN_IN_MSO_SCRIPT, openInMsoControls } from "./ui-navigation";
-export { PROJECT_STATUS_URI, DIFF_VIEW_URI, VPS_STATUS_URI } from "./ui-operator-resources";
export { MSO_SURFACE_URI } from "./ui-surface";
export const WORKFLOW_PROGRESS_URI = "ui://mso/workflow-progress-v2.html";
export const MCP_APP_MIME_TYPE = "text/html;profile=mcp-app";
@@ -225,7 +223,6 @@ const RESOURCES: readonly McpUiResource[] = [
text: workflowProgressHtml,
_meta: workflowResourceMeta(),
},
- ...OPERATOR_UI_RESOURCES,
MSO_SURFACE_RESOURCE,
];
diff --git a/lib/mcp/ui-surface-script.ts b/lib/mcp/ui-surface-script.ts
index 630e9091..6ecd3461 100644
--- a/lib/mcp/ui-surface-script.ts
+++ b/lib/mcp/ui-surface-script.ts
@@ -53,7 +53,6 @@ function persistRoute(){
try{if(window.openai&&typeof window.openai.setWidgetState==="function")window.openai.setWidgetState({modelContent:"MSO Surface: "+current.route,privateContent:{route:current.route},imageIds:[]})}catch(_){}
}
function rpcCall(name,args){
- if(window.openai&&typeof window.openai.callTool==="function")return window.openai.callTool(name,args);
const id=nextRpcId++;window.parent.postMessage({jsonrpc:"2.0",id,method:"tools/call",params:{name,arguments:args}},"*");
return new Promise((resolve,reject)=>{pending.set(id,{resolve,reject});setTimeout(()=>{if(pending.has(id)){pending.delete(id);reject(new Error("tool timeout"))}},10000)})
}
diff --git a/lib/mcp/ui-surface.ts b/lib/mcp/ui-surface.ts
index 26c9629a..797fe557 100644
--- a/lib/mcp/ui-surface.ts
+++ b/lib/mcp/ui-surface.ts
@@ -4,7 +4,7 @@ import { surfaceFrameDomains } from "./surface-catalog";
import { MSO_SURFACE_SCRIPT } from "./ui-surface-script";
import { MSO_SURFACE_STYLE } from "./ui-surface-style";
-export const MSO_SURFACE_URI = "ui://mso/surface-v3.html";
+export const MSO_SURFACE_URI = "ui://mso/surface-v4.html";
const MIME = "text/html;profile=mcp-app";
const html = String.raw`<main class="surface" aria-label="MSO Surface">