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.
TypeScript browser-shellcontrol-planefile-managerhomelabmobile-firstnextjsptyreactself-hostedserver-managementshadcn-uisysadmintailwindcssterminaltypescriptvpsweb-desktopweb-terminal
feat(mcp): add compact ChatGPT list surface
Rahmanca8aff2e8f06
diff --git a/.app.json b/.app.jsonnew file mode 100644index 00000000..e3afa4c2--- /dev/null+++ b/.app.json@@ -0,0 +1,3 @@+{+ "apps": {}+}diff --git a/.codex-plugin/plugin.json b/.codex-plugin/plugin.jsonindex 84d1f579..b441e45b 100644--- a/.codex-plugin/plugin.json+++ b/.codex-plugin/plugin.json@@ -24,5 +24,6 @@"Debug this service using bounded MSO tools and evidence.","Implement and verify this MCP capability without weakening existing MSO safeguards."]- }+ },+ "apps": "./.app.json"}diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.mdindex 9ad66a41..f078548b 100644--- a/docs/ARCHITECTURE.md+++ b/docs/ARCHITECTURE.md@@ -119,8 +119,9 @@ through the app catch-all.### 4.1 ChatGPT as an MSO presentation targetThe web catch-all remains the authenticated cockpit route. ChatGPT does **not** frame that cockpit.-MSO exposes exactly two user-visible MCP App classes instead:+MSO exposes exactly three user-visible MCP App classes instead:+- `render_mso_list` binds `ui://mso/list-v1.html` for compact searchable collections after ordinary data tools have returned model-checkable structured results. Item/global actions return follow-up messages and do not execute mutations in the widget.- `render_mso_block` binds `ui://mso/block-v3.html` for compact validation, action buttons, andCRUD input-output. A button returns a user-approved follow-up message; it does not execute amutation inside the widget, so ordinary scope, approval, audit, and workflow rules still apply.diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.mdindex 8461f5de..622d5e80 100644--- a/docs/CHANGELOG.md+++ b/docs/CHANGELOG.md@@ -8,6 +8,7 @@ this is the *what*, and it is what Settings → About shows as “What's new”.**Added**+- `mcp` add compact ChatGPT list surface- `plugins` add structured OpenAI skill contracts- `workflows` stabilize semantic action references- `workflows` add semantic session flowsdiff --git a/docs/CHATGPT-PLUGIN.md b/docs/CHATGPT-PLUGIN.mdindex 948ae8dc..a8f12e17 100644--- a/docs/CHATGPT-PLUGIN.md+++ b/docs/CHATGPT-PLUGIN.md@@ -50,7 +50,7 @@ Every advertised MSO tool has:The ChatGPT projection compacts verbose descriptions/schema descriptions without changing names, required arguments, enum/range constraints, scopes, or safety semantics.-Selected lifecycle-sensitive tools also declare an additive `mso/actionContract` on the **full** MCP descriptor. The contract names the semantic target, discover/validate/verify path, source-of-truth policy, confirmation mode and concurrency guard. It is documentation/orchestration metadata only: OAuth scope, tool implementation checks, CAS/revision guards, provider policy and explicit confirmations remain authoritative. The compact ChatGPT action snapshot intentionally omits this extra per-tool metadata because the complete 112-action profile already sits close to MSO's strict 96 KiB scanner budget; ChatGPT receives the same structured workflow policy through the published skill resources instead, without dropping any action.+Selected lifecycle-sensitive tools also declare an additive `mso/actionContract` on the **full** MCP descriptor. The contract names the semantic target, discover/validate/verify path, source-of-truth policy, confirmation mode and concurrency guard. It is documentation/orchestration metadata only: OAuth scope, tool implementation checks, CAS/revision guards, provider policy and explicit confirmations remain authoritative. The compact ChatGPT action snapshot intentionally omits this extra per-tool metadata because the complete ChatGPT profile already sits close to MSO's strict 96 KiB scanner budget; ChatGPT receives the same structured workflow policy through the published skill resources instead, without dropping any action.## Exact ChatGPT model tool profile@@ -60,9 +60,9 @@ The restored Original MSO operator primitives (`sys_*`, `fs_usage` + full boundeProject-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. Apps outside the reviewed Page catalog use the remote browser. Nested frames are limited to code-reviewed exact origins and registry policy; arbitrary third-party URLs are never accepted. 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_list` renders a compact searchable list/grid from data already fetched by ordinary tools; it is the default lightweight surface for projects, files, sessions, workflows, apps, integrations and agents. `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 either compact 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. Apps outside the reviewed Page catalog use the remote browser. Nested frames are limited to code-reviewed exact origins and registry policy; arbitrary third-party URLs are never accepted. 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. The current Page therefore uses one modern binding and keeps earlier Page URIs only as non-advertised read aliases.+`render_mso_list`, `render_mso_page` and `integration_setup_open` use the standard MCP Apps `ui.resourceUri` binding. List and Page intentionally omit the legacy `openai/outputTemplate`; Block retains it only for compatibility. 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.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).@@ -78,15 +78,14 @@ For the complete non-ChatGPT MSO catalog, scopes, limits, A2A, providers, Tool F## OpenAI/Codex plugin package-The repository root also carries `.codex-plugin/plugin.json` as a **skill-only** OpenAI/Codex package. It points directly at `./claude-skills/`, so the same reviewed skill bundles are reusable without maintaining a second copy. The package deliberately does **not** declare `mcpServers`: the live web-capable MSO MCP connection remains the separately authorized custom app at `/mcp`, preserving its OAuth scopes, server-side credentials, dynamic project MCP seams and browser/mobile availability instead of coupling those capabilities to a local plugin executor. Installing/importing the skill package never grants MCP access by itself.--Do not invent a root `.app.json` id. If an existing OpenAI app registration is intentionally packaged later, add its exact registered app id and keep that connection lifecycle separate from the skill package.+The repository root also carries `.codex-plugin/plugin.json` as an OpenAI/Codex compatibility package for the reviewed skills plus an optional registered-app mapping. It points directly at `./claude-skills/`, so the same reviewed skill bundles are reusable without maintaining a second copy. The package deliberately does **not** declare `mcpServers`: the live web-capable MSO MCP connection remains the separately authorized custom app at `/mcp`, preserving its OAuth scopes, server-side credentials, dynamic project MCP seams and browser/mobile availability instead of coupling those capabilities to a local plugin executor. `.app.json` is an intentionally empty OpenAI scaffold (`apps: {}`) until an exact registered app ID is available; this matches the supported plugin-creator scaffold and does not grant MCP access by itself. When an existing OpenAI registration is intentionally packaged, link only its exact registered ID—never a placeholder—and keep OAuth authorization on the live MSO app. Use `bun run plugin:link-app -- plugin_asdk_app_...` (legacy `asdk_app_...` is also accepted); `bun run plugin:link-app -- --clear` restores the empty scaffold.The OpenAI-facing repository shape is therefore:```textMSO repo-├── .codex-plugin/plugin.json # OpenAI/Codex skill package+├── .codex-plugin/plugin.json # OpenAI/Codex compatibility manifest+├── .app.json # registered-app mapping; empty until linked├── claude-skills/<skill>/│ ├── SKILL.md│ ├── contract.yamldiff --git a/docs/PROGRESS.md b/docs/PROGRESS.mdindex cb83fa8c..02aca1e2 100644--- a/docs/PROGRESS.md+++ b/docs/PROGRESS.md@@ -1,3 +1,7 @@+## 2026-09-17 — ChatGPT List surface and OpenAI app scaffold++Added `render_mso_list` + `ui://mso/list-v1.html` as the lightweight collection surface between Block and Page. Data tools remain headless; the model first fetches/filters structured results, then renders at most 40 selected items as list/grid with local search, bounded metadata and user-approved follow-up actions. The widget has no network/tool-call path and cannot execute mutations. ChatGPT now exposes 113 transport tools while retaining the strict 96 KiB internal descriptor budget through scanner-only summary compaction; full MCP descriptions and runtime schemas remain unchanged. `.app.json` is now a valid empty registered-app scaffold referenced by the compatibility manifest, with skill checks rejecting malformed or placeholder mappings.+## 2026-09-17 — OpenAI plugin skill contracts + local validator registry- Implemented additive structured `contract.yaml` + `agents/openai.yaml` bundles for all 13 official skills, a portable root `.codex-plugin/plugin.json`, local artifact validators, compact contract-aware skill discovery, and full-MCP `mso/actionContract` lifecycle metadata on selected stateful tools.diff --git a/docs/TESTING-HANDOFF.md b/docs/TESTING-HANDOFF.mdindex 533a4f47..9823e7df 100644--- a/docs/TESTING-HANDOFF.md+++ b/docs/TESTING-HANDOFF.md@@ -9,7 +9,7 @@ The current release target is **MSO CLI 1.12.1**, MCP server `1.10.0`, toolset `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 MCP presentation remains two canonical resources (Block + Page). The Page widget origin is now deployment-derived from `OS_MCP_UI_ORIGIN` / `OS_PUBLIC_ORIGIN`; portable source carries no operator domain. External Page apps default to none and are opt-in through validated per-installation `MSO_SURFACE_APPS_JSON`. `workflow_start` remains headless; Block has no frame domains and cannot execute a mutation directly.+- Fresh 3 MCP presentation now has three canonical resources (List + Block + Page). The Page widget origin is now deployment-derived from `OS_MCP_UI_ORIGIN` / `OS_PUBLIC_ORIGIN`; portable source carries no operator domain. External Page apps default to none and are opt-in through validated per-installation `MSO_SURFACE_APPS_JSON`. `workflow_start` remains headless; Block has no frame domains and cannot execute a mutation directly.- MCP App acceptance: starting a workflow must produce structured workflow identity without opening an App. A Block must render bounded validation/CRUD data and return a user-approved follow-up when its action is pressed; it must not call a mutation itself. A Page must render native `/monitor`/`/project`/`/diff` views through `tools/call`; any external app must come only from the current installation's validated catalog. Compatibility URIs remain non-advertised aliases.- Alfa Cockpit acceptance: Assistant → Chat shows a compact project/model/activity bar; Cockpit opens as a desktop panel and mobile drawer; project search can select a project outside the first bounded page; selected project metadata reaches the next Alfa system prompt but raw `KNOWLEDGE.md`/repo-memory bodies do not; private typed-memory keys/values render as `Private memory`; Host Skills lazy-load from `/api/skills`; model switch stays within the configured provider; Activity & Runs shows local Alfa tool state alongside MCP workflow activity without treating the browser run as MCP `workflow_finish`.- Alfa Automation acceptance: a saved recipe's Run action switches to its configured persona and submits the ordered recipe through normal Alfa execution. Read steps may execute directly; write/exec steps must still park on the existing approval card. Playbook starter prompts appear as bounded empty-chat quick actions.diff --git a/docs/generated/MCP-CATALOG.md b/docs/generated/MCP-CATALOG.mdindex 5749e23a..acbd7a56 100644--- a/docs/generated/MCP-CATALOG.md+++ b/docs/generated/MCP-CATALOG.md@@ -4,21 +4,21 @@## Full MSO catalog-<!-- mcp-toolset: server=1.14.4 version=2026.09.15.3 tools=110 read=53 write=35 exec=22 -->+<!-- mcp-toolset: server=1.15.0 version=2026.09.17.1 tools=111 read=54 write=35 exec=22 -->| Fact | Current source value ||---|---:|-| MCP server | `1.14.4` |-| Toolset | `2026.09.15.3` |-| Toolset changed at | `2026-09-15T03:35:00+07:00` |-| Transport tools | **112** |-| Model/operator tools | **110** |-| Read | **53** |+| MCP server | `1.15.0` |+| Toolset | `2026.09.17.1` |+| Toolset changed at | `2026-09-17T02:50:00+07:00` |+| Transport tools | **113** |+| Model/operator tools | **111** |+| Read | **54** || Write | **35** || Exec | **22** || App-only bridges | **2** |-### Read (53)+### Read (54)- `a2a_agent_discover`- `a2a_agents_list`@@ -63,6 +63,7 @@- `projects_list`- `read_pipeline`- `render_mso_block`+- `render_mso_list`- `render_mso_page`- `screen_capture`- `session_artifacts`@@ -144,20 +145,20 @@## ChatGPT model profile-<!-- mcp-chatgpt-profile: server=1.14.4 version=2026.09.15.3 tools=110 read=53 write=35 exec=22 app-only=2 total=112 -->+<!-- mcp-chatgpt-profile: server=1.15.0 version=2026.09.17.1 tools=111 read=54 write=35 exec=22 app-only=2 total=113 -->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.| Fact | Current source value ||---|---:|-| ChatGPT transport tools | **112** |-| ChatGPT model/operator tools | **110** |-| Read | **53** |+| ChatGPT transport tools | **113** |+| ChatGPT model/operator tools | **111** |+| Read | **54** || Write | **35** || Exec | **22** || App-only bridges | **2** |-### ChatGPT read (53)+### ChatGPT read (54)- `a2a_agent_discover`- `a2a_agents_list`@@ -202,6 +203,7 @@ The ChatGPT profile automatically projects the complete MSO-owned generic model/- `projects_list`- `read_pipeline`- `render_mso_block`+- `render_mso_list`- `render_mso_page`- `screen_capture`- `session_artifacts`diff --git a/docs/integrations/CHATGPT-UI.md b/docs/integrations/CHATGPT-UI.mdindex b85430d8..4a05869d 100644--- a/docs/integrations/CHATGPT-UI.md+++ b/docs/integrations/CHATGPT-UI.md@@ -1,10 +1,12 @@# ChatGPT MCP App UI-MSO exposes two explicit presentation resources. Ordinary tools and workflow startup stay-headless; clients without MCP Apps keep structured/text results.+MSO exposes three explicit presentation resources. Ordinary data tools and workflow startup stay+headless; clients without MCP Apps keep structured/text results. The model fetches data first, then+chooses List, Block or Page as a separate render step.| Surface | Entry tool | Resource | Purpose || --- | --- | --- | --- |+| List | `render_mso_list` | `ui://mso/list-v1.html` | Searchable compact collections and item actions || 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-v15.html` | Native workspaces, session assets and reviewed project previews |@@ -24,10 +26,16 @@ explicit click and are hidden when the host declares them unsupported.Standard host context controls theme, display mode, dimensions and safe-area insets.Standard `styles.variables` supplies host colors, type, font family and corners; removing an override restores the shared defaults. Legacy OpenAI globals and the browser color-scheme remain compatible fallbacks. Layout responds to the container, including a 320 × 200 viewport; narrow Integrations uses a native service selector instead of a nested scrolling rail.The compact header, readable controls, flat navigation and shared integration styles-follow the existing MSO workbench. Block, Page and native Integrations embed the existing+follow the existing MSO workbench. List, 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, fonts, type scale, spacing, control size, focus, radii and scroll tokens remain in `lib/presentation/widget-tokens.ts`.+## List behavior++List is a pure presentation tool. The model first calls a normal list/search/read tool, reasons over the returned structured data, and then passes only the selected bounded items to `render_mso_list`. It accepts at most 40 items, four metadata pairs per item, two item actions and three collection actions. `layout` is `list` or `grid`; optional local search filters only the already-rendered items and makes no network request. Icons are semantic tokens, not arbitrary image URLs.++List actions behave like Block actions: a click sends a bounded follow-up message to ChatGPT with the item id/title and requested continuation. The widget never names or directly calls an MSO mutation tool, so OAuth scope, confirmations, concurrency guards, audit and workflow ownership remain authoritative.+## Block behaviorBlock accepts bounded structured fields, checks, scalar outputs and up to eight actions;@@ -70,14 +78,14 @@ Page initializes MCP Apps protocol `2026-01-26`, then sendsnotifications 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+List and Page 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: Block allows no nested frames; Page includes only exact reviewed iframe origins and permits its MSO origin for private setup requests. OpenAI requires stricter review for `frameDomains`; this is an official review boundary, not a blanket iframe ban. `OS_MCP_UI_ORIGIN` controls the widget origin, otherwisethe 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+Only the three current resources are listed. Older Block/Page URIs remain read aliases forcurrent bytes, including Block v2 and Page v14. `workflow_status` and `render_mso_surface`remain app-only compatibility tools. `workflow_start` has no UI binding.@@ -91,7 +99,7 @@ provider search and 320–1920 px reflow. Production release journeys verify autreal 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+generated catalog, verify the three resource URIs, render a List, and reopen the Page. Hosts cache tooland resource descriptors: a development-app rescan/reconnect may still be needed.The server cannot replace an already mounted document in an old conversation.diff --git a/lib/mcp/integration-model-contract.test.ts b/lib/mcp/integration-model-contract.test.tsindex bf5f1435..ae29f65c 100644--- a/lib/mcp/integration-model-contract.test.ts+++ b/lib/mcp/integration-model-contract.test.ts@@ -43,9 +43,9 @@ it("returns identity-bound setup only in UI-private metadata on both supported Mconst token=wire._meta?.integrationSetup?.token;expect(token).toMatch(/^[A-Za-z0-9_-]{43}$/);expect(JSON.stringify(wire.content)).not.toContain(token);expect(JSON.stringify(wire.structuredContent)).not.toContain(token);}});-it("keeps current and older Page resources readable and emits no extra UI type",async()=>{+it("keeps current and older Page resources readable alongside the canonical List and Block",async()=>{const {readUiResource,listUiResources,MSO_PAGE_URI}=await import("./ui-resources");- expect(await listUiResources()).toHaveLength(2);const html=(await readUiResource(MSO_PAGE_URI))!.text;+ expect(await listUiResources()).toHaveLength(3);const html=(await readUiResource(MSO_PAGE_URI))!.text;for(const version of [1,2,3,4,5,6])expect((await readUiResource(`ui://mso/page-v${version}.html`))?.text).toBe(html);expect(html).toContain("mountConnectionManager");expect(html).toContain("data-display-mode");const script=inlineScripts(html)[0];expect(()=>new Function(script!)).not.toThrow();diff --git a/lib/mcp/parity.test.ts b/lib/mcp/parity.test.tsindex 57115aa2..41221556 100644--- a/lib/mcp/parity.test.ts+++ b/lib/mcp/parity.test.ts@@ -111,6 +111,7 @@ const MCP_ONLY: Record<string, string> = {"project.agent.status": "status belongs to project-agent message ids owned by the external MCP principal/session; Alfa has no compatible project-agent task ledger","vps.status": "this is an aggregate MCP Apps operator card over existing bounded host/app/browser/infra primitives; Alfa already renders equivalent in-shell operational surfaces","mso.surface.apps.list": "the reviewed ChatGPT Page app catalog is MCP-App presentation metadata; Alfa already owns its in-shell app registry and must not inherit ChatGPT frame allowlists",+ "render.mso.list": "the compact List is a ChatGPT MCP Apps presentation target for model-selected collections; Alfa already has native project/file/session/workflow/app lists and does not need a second presentation-only host tool","render.mso.block": "the compact Block is a ChatGPT MCP Apps presentation target for validation/action/CRUD handoff; Alfa already has native forms and approval cards","render.mso.page": "the full Page is a ChatGPT MCP Apps presentation target; Alfa already is an MSO presentation target and does not render another copy of itself","render.mso.surface": "app-only compatibility alias for cached pre-Page widgets; Alfa has no reason to expose the retired presentation name",diff --git a/lib/mcp/tool-contract.ts b/lib/mcp/tool-contract.tsindex 4b1cbcc0..44fe10b1 100644--- a/lib/mcp/tool-contract.ts+++ b/lib/mcp/tool-contract.ts@@ -41,7 +41,7 @@ export const CHATGPT_APP_ONLY_TOOL_NAMES = new Set([const TITLES: Record<string, string> = {workflow_start: "Start Workflow", workflow_status: "Workflow Status", workflow_finish: "Finish Workflow", workflow_cancel: "Cancel Workflow",- render_mso_block: "Render MSO Block", render_mso_page: "Render MSO Page", render_mso_surface: "Render MSO Surface (Compatibility)",+ render_mso_list: "Render MSO List", render_mso_block: "Render MSO Block", render_mso_page: "Render MSO Page", render_mso_surface: "Render MSO Surface (Compatibility)",skills_search: "Search Skills", projects_list: "List Projects", project_capabilities: "Project Capabilities",project_mcp_tools: "List Project MCP Tools", project_mcp_call: "Call Project MCP Tool", project_function_call: "Call Project Function",read_pipeline: "Run Read Pipeline", fs_list: "List Files", fs_read: "Read File", fs_search: "Search Directories", fs_write: "Write File",@@ -115,7 +115,7 @@ function compactSchema(value: unknown): unknown {for (const [key, item] of Object.entries(value as Record<string, unknown>)) {if (key === "additionalProperties" && item === true || key === "required" && Array.isArray(item) && item.length === 0) continue;if (key === "workflow_id" && item && typeof item === "object") out[key] = { type:"string" };- else if (key === "description" && typeof item === "string") out[key] = compactText(item, 28);+ else if (key === "description" && typeof item === "string") out[key] = compactText(item, 16);else out[key] = compactSchema(item);}return out;@@ -133,7 +133,7 @@ export function toolDescriptor(tool: McpTool, profile: McpToolProfile = "full")return {name: tool.name,title: tool.title ?? toolTitle(tool.name),- description: compact ? compactText(tool.chatgptDescription ?? tool.description, 64) : tool.description,+ description: compact ? compactText(tool.chatgptDescription ?? tool.description, 56) : tool.description,inputSchema: compact ? compactSchema(tool.inputSchema) : tool.inputSchema,...(outputSchema ? { outputSchema: compact ? compactSchema(outputSchema) : outputSchema } : {}),securitySchemes,diff --git a/lib/mcp/tools-list.test.ts b/lib/mcp/tools-list.test.tsnew file mode 100644index 00000000..95d5270e--- /dev/null+++ b/lib/mcp/tools-list.test.ts@@ -0,0 +1,38 @@+import { describe, expect, it, vi } from "vitest";+vi.mock("server-only", () => ({}));+const { LIST_TOOLS } = await import("./tools-list");+const { MSO_LIST_URI } = await import("./ui-list");+const tool = LIST_TOOLS.find((row) => row.name === "render_mso_list")!;++describe("render_mso_list", () => {+ it("is a read-only explicit render tool bound only to the List resource", () => {+ expect(tool.scope).toBe("read");+ expect(tool.meta).toMatchObject({ ui: { resourceUri: MSO_LIST_URI, visibility: ["model", "app"] } });+ expect(tool.meta?.["openai/outputTemplate"]).toBeUndefined();+ });++ it("normalizes bounded model-selected collection data without executing actions", async () => {+ const result = await tool.run({+ title: "Projects",+ layout: "grid",+ searchable: true,+ items: Array.from({ length: 45 }, (_, index) => ({+ id: `p-${index}`,+ title: `Project ${index}`,+ subtitle: "x".repeat(700),+ icon: "project",+ status: index ? "success" : "invalid",+ meta: Array.from({ length: 8 }, (_, meta) => ({ label: `M${meta}`, value: "v" })),+ actions: [{ label: "Open", prompt: "Open this project with render_mso_page." }, { label: "Inspect", prompt: "Inspect it." }, { label: "Overflow", prompt: "No." }],+ })),+ }, {} as never) as any;+ expect(result.title).toBe("Projects");+ expect(result.layout).toBe("grid");+ expect(result.searchable).toBe(true);+ expect(result.items).toHaveLength(40);+ expect(result.items[0].status).toBe("neutral");+ expect(result.items[0].subtitle).toHaveLength(500);+ expect(result.items[0].meta).toHaveLength(4);+ expect(result.items[0].actions).toHaveLength(2);+ });+});diff --git a/lib/mcp/tools-list.ts b/lib/mcp/tools-list.tsnew file mode 100644index 00000000..2db3d495--- /dev/null+++ b/lib/mcp/tools-list.ts@@ -0,0 +1,27 @@+import { MSO_LIST_URI } from "./ui-list";+import { type McpTool, READ_ONLY, S, str } from "./tool-kit";++const META_SCHEMA={type:"object",properties:{label:{type:"string",maxLength:80},value:{type:"string",maxLength:240}},required:["value"],additionalProperties:false} as const;+const ACTION_SCHEMA={type:"object",properties:{id:{type:"string",maxLength:80},label:{type:"string",maxLength:80},style:{type:"string",enum:["primary","secondary"]},prompt:{type:"string",minLength:1,maxLength:1200}},required:["label","prompt"],additionalProperties:false} as const;+const ITEM_SCHEMA={type:"object",properties:{id:{type:"string",minLength:1,maxLength:120},title:{type:"string",minLength:1,maxLength:240},subtitle:{type:"string",maxLength:500},badge:{type:"string",maxLength:80},status:{type:"string",enum:["neutral","info","success","warning","error"]},icon:{type:"string",enum:["project","file","folder","workflow","session","app","integration","agent","server","code","item"]},meta:{type:"array",maxItems:4,items:META_SCHEMA},actions:{type:"array",maxItems:2,items:ACTION_SCHEMA}},required:["id","title"],additionalProperties:false} as const;++export const LIST_OUTPUT_SCHEMA={type:"object",properties:{title:{type:"string"},description:{type:"string"},layout:{type:"string"},searchable:{type:"boolean"},emptyMessage:{type:"string"},items:{type:"array"},actions:{type:"array"}},required:["title","layout","searchable","emptyMessage","items","actions"],additionalProperties:false} as const;+const text=(v:unknown,max:number,f="")=>typeof v==="string"&&v.trim()?v.trim().slice(0,max):f;+const rows=(v:unknown,max:number):Array<Record<string,unknown>>=>Array.isArray(v)?v.filter((x):x is Record<string,unknown>=>Boolean(x)&&typeof x==="object"&&!Array.isArray(x)).slice(0,max):[];+const choice=<T extends string>(v:unknown,a:readonly T[],f:T):T=>typeof v==="string"&&a.includes(v as T)?v as T:f;+const normalizeAction=(a:Record<string,unknown>,i:number)=>({id:text(a.id,80,`action-${i+1}`),label:text(a.label,80,"Open"),style:choice(a.style,["primary","secondary"] as const,"secondary"),prompt:text(a.prompt,1200,"Continue with the selected MSO item.")});+function normalizeList(input:Record<string,unknown>){+ const items=rows(input.items,40).map((item,index)=>({id:text(item.id,120,`item-${index+1}`),title:text(item.title,240,`Item ${index+1}`),...(text(item.subtitle,500)?{subtitle:text(item.subtitle,500)}:{}),...(text(item.badge,80)?{badge:text(item.badge,80)}:{}),status:choice(item.status,["neutral","info","success","warning","error"] as const,"neutral"),icon:choice(item.icon,["project","file","folder","workflow","session","app","integration","agent","server","code","item"] as const,"item"),meta:rows(item.meta,4).map(m=>({...(text(m.label,80)?{label:text(m.label,80)}:{}),value:text(m.value,240)})),actions:rows(item.actions,2).map(normalizeAction)}));+ return {title:text(input.title,240,"MSO list"),...(text(input.description,1000)?{description:text(input.description,1000)}:{}),layout:choice(input.layout,["list","grid"] as const,"list"),searchable:input.searchable===true,emptyMessage:text(input.emptyMessage,240,"No items."),items,actions:rows(input.actions,3).map(normalizeAction)};+}++export const LIST_TOOLS:McpTool[]=[{+ name:"render_mso_list",title:"Render MSO List",+ description:"Render a compact searchable MCP App list/grid after a data tool has returned the relevant items. Use it for projects, files, sessions, workflows, apps, integrations, agents, or other bounded collections. Keep data tools headless; this render tool only presents model-selected data. Item/global buttons send follow-up prompts and never execute mutations directly.",+ chatgptDescription:"Render a compact list/grid from already-fetched MSO data. Use after list/search tools; buttons only return follow-ups to chat.",+ scope:"read",annotations:READ_ONLY,+ inputSchema:S({title:{type:"string",minLength:1,maxLength:240},description:{type:"string",maxLength:1000},layout:{type:"string",enum:["list","grid"]},searchable:{type:"boolean"},emptyMessage:{type:"string",maxLength:240},items:{type:"array",maxItems:40,items:ITEM_SCHEMA},actions:{type:"array",maxItems:3,items:ACTION_SCHEMA}},["title","items"]),+ outputSchema:LIST_OUTPUT_SCHEMA,+ meta:{ui:{resourceUri:MSO_LIST_URI,visibility:["model","app"]},"openai/toolInvocation/invoking":"Preparing list…","openai/toolInvocation/invoked":"List ready","openai/widgetAccessible":true},+ run:async input=>normalizeList({...input,title:str(input,"title")}),+}];diff --git a/lib/mcp/tools-ui.ts b/lib/mcp/tools-ui.tsindex 229f1fe4..57f6203b 100644--- a/lib/mcp/tools-ui.ts+++ b/lib/mcp/tools-ui.ts@@ -1,2 +1,3 @@+export { LIST_TOOLS } from "./tools-list";export { BLOCK_TOOLS } from "./tools-block";export { SURFACE_TOOLS } from "./tools-surface";diff --git a/lib/mcp/tools.ts b/lib/mcp/tools.tsindex f08c9a3b..ec2c1abb 100644--- a/lib/mcp/tools.ts+++ b/lib/mcp/tools.ts@@ -21,9 +21,9 @@ import { READ_TOOLS } from "./tools-read";import { READ_PIPELINE_TOOLS } from "./tools-read-pipeline";import { SESSION_ARTIFACT_TOOLS } from "./tools-session-artifacts";import { SUBAGENT_TOOLS } from "./tools-subagents";-import { BLOCK_TOOLS, SURFACE_TOOLS } from "./tools-ui";+import { BLOCK_TOOLS, LIST_TOOLS, SURFACE_TOOLS } from "./tools-ui";import type { McpTool } from "./tool-kit";import { MUTATE_TOOLS } from "./tools-mutate";-export const TOOLS: McpTool[] = [...FLOW_TOOLS, ...AGENT_OPEN_TOOLS, ...PROJECT_ASSET_TOOLS, ...PROJECT_MCP_MANAGE_TOOLS, ...SESSION_ARTIFACT_TOOLS, ...READ_TOOLS, ...FILE_TRANSFER_READ_TOOLS, ...DISCOVERY_TOOLS, ...LEARNING_TOOLS, ...AGENT_TOOLS, ...LOCAL_AGENT_TOOLS, ...SUBAGENT_TOOLS, ...A2A_TOOLS, ...FORGE_TOOLS, ...READ_PIPELINE_TOOLS, ...PROJECT_MCP_TOOLS, ...PROJECT_EXPERIENCE_TOOLS, ...ORGANIZATION_TOOLS, ...OPERATOR_DASHBOARD_TOOLS, ...BLOCK_TOOLS, ...SURFACE_TOOLS, ...INFRA_TOOLS, ...INTEGRATION_TOOLS, ...MUTATE_TOOLS, ...POWER_TOOLS].map(withWorkflowContext); export const TOOLS_BY_NAME = new Map(TOOLS.map((t) => [t.name, t]));+export const TOOLS: McpTool[] = [...FLOW_TOOLS, ...AGENT_OPEN_TOOLS, ...PROJECT_ASSET_TOOLS, ...PROJECT_MCP_MANAGE_TOOLS, ...SESSION_ARTIFACT_TOOLS, ...READ_TOOLS, ...FILE_TRANSFER_READ_TOOLS, ...DISCOVERY_TOOLS, ...LEARNING_TOOLS, ...AGENT_TOOLS, ...LOCAL_AGENT_TOOLS, ...SUBAGENT_TOOLS, ...A2A_TOOLS, ...FORGE_TOOLS, ...READ_PIPELINE_TOOLS, ...PROJECT_MCP_TOOLS, ...PROJECT_EXPERIENCE_TOOLS, ...ORGANIZATION_TOOLS, ...OPERATOR_DASHBOARD_TOOLS, ...BLOCK_TOOLS, ...LIST_TOOLS, ...SURFACE_TOOLS, ...INFRA_TOOLS, ...INTEGRATION_TOOLS, ...MUTATE_TOOLS, ...POWER_TOOLS].map(withWorkflowContext); export const TOOLS_BY_NAME = new Map(TOOLS.map((t) => [t.name, t]));diff --git a/lib/mcp/toolset.ts b/lib/mcp/toolset.tsindex ff8af877..47954111 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.14.4";-export const MCP_TOOLSET_VERSION = "2026.09.15.3";-export const MCP_TOOLSET_CHANGED_AT = "2026-09-15T03:35:00+07:00";+export const MCP_SERVER_VERSION = "1.15.0";+export const MCP_TOOLSET_VERSION = "2026.09.17.1";+export const MCP_TOOLSET_CHANGED_AT = "2026-09-17T02:50:00+07:00";export type McpToolsetInfo = {serverVersion: string;diff --git a/lib/mcp/ui-list.ts b/lib/mcp/ui-list.tsnew file mode 100644index 00000000..2c2fe885--- /dev/null+++ b/lib/mcp/ui-list.ts@@ -0,0 +1,42 @@+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_LIST_URI = "ui://mso/list-v1.html";+const MIME = "text/html;profile=mcp-app";++const html = String.raw`<meta charset="utf-8"><main class="mso-list" 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)}.shell{overflow:hidden;border:1px solid var(--sep-strong);border-radius:var(--radius-panel);background:var(--surface);box-shadow:var(--shadow-pop)}.head{display:flex;align-items:flex-start;gap:10px;padding:11px 12px;border-bottom:1px solid var(--sep)}.mark{display:grid;width:30px;height:30px;flex:0 0 30px;place-items:center;border-radius:7px;background:var(--text);color:var(--surface)}.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}.count{flex:0 0 auto;border:1px solid var(--sep);border-radius:999px;padding:4px 7px;font-family:var(--font-mono);font-size:8px;color:var(--text-dim)}.filter{padding:8px 10px;border-bottom:1px solid var(--sep);background:var(--inset)}.filter input{width:100%;min-height:32px;border:1px solid var(--sep-strong);border-radius:8px;background:var(--field);color:var(--text);padding:6px 9px;font:inherit;font-size:10px;outline:none}.filter input:focus{border-color:var(--os-accent);box-shadow:0 0 0 2px color-mix(in srgb,var(--os-accent) 17%,transparent)}.items{display:grid}.items.grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:8px}.items.grid .item{border:1px solid var(--sep);border-radius:9px}.item{min-width:0;display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:9px;align-items:center;padding:10px 12px;border-bottom:1px solid var(--sep)}.items:not(.grid) .item:last-child{border-bottom:0}.icon{display:grid;width:30px;height:30px;place-items:center;border:1px solid var(--sep-strong);border-radius:8px;background:var(--field);font-family:var(--font-mono);font-size:10px;font-weight:750;color:var(--text-dim)}.main{min-width:0}.title-row{display:flex;align-items:center;gap:6px;min-width:0}.title{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10.5px;font-weight:700}.badge{flex:0 0 auto;border:1px solid var(--sep);border-radius:999px;padding:2px 5px;font-family:var(--font-mono);font-size:7.5px;color:var(--text-dim)}.badge.success{border-color:color-mix(in srgb,var(--success-text) 40%,var(--sep));color:var(--success-text)}.badge.warning{border-color:color-mix(in srgb,var(--warning) 45%,var(--sep));color:var(--warning)}.badge.error{border-color:color-mix(in srgb,var(--destructive-text) 40%,var(--sep));color:var(--destructive-text)}.badge.info{border-color:color-mix(in srgb,var(--info) 40%,var(--sep));color:var(--info)}.subtitle{margin-top:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:9px;color:var(--text-dim)}.meta{display:flex;gap:5px;flex-wrap:wrap;margin-top:5px}.meta span{font-family:var(--font-mono);font-size:9px;color:var(--text-dim)}.actions{display:flex;gap:5px;align-items:center}.actions button,.footer button{appearance:none;min-height:28px;border:1px solid var(--sep-strong);border-radius:8px;background:transparent;color:var(--text);padding:5px 8px;font:inherit;font-size:9px;font-weight:680;cursor:pointer}.actions button:hover,.footer button:hover{background:var(--hover-strong)}.actions button.primary,.footer button.primary{border-color:var(--text);background:var(--text);color:var(--surface)}.empty{padding:18px 12px;text-align:center;font-size:10px;color:var(--text-dim)}.footer{display:flex;align-items:center;gap:6px;justify-content:flex-end;border-top:1px solid var(--sep);padding:8px 10px}.feedback{margin-right:auto;font-size:9px;color:var(--text-dim)}@media(max-width:560px){body{padding:4px}.items.grid{grid-template-columns:1fr}.item{grid-template-columns:auto minmax(0,1fr)}.actions{grid-column:2;justify-content:flex-start;flex-wrap:wrap}.head{padding:10px}.item{padding:9px 10px}}+</style>+<section class="shell" aria-label="MSO list">+<header class="head"><div class="mark" aria-hidden="true">${MSO_LOGO_SVG}</div><div class="copy"><div class="eyebrow">Collection</div><h2 id="title">MSO list</h2><p class="description" id="description" hidden></p></div><span class="count" id="count">0</span></header>+<div class="filter" id="filter-wrap" hidden><input id="filter" type="search" maxlength="120" autocomplete="off" placeholder="Filter items" aria-label="Filter items"></div>+<div class="items" id="items"></div><div class="empty" id="empty" hidden>No items.</div>+<footer class="footer" id="footer" hidden><span class="feedback" id="feedback" role="status" aria-live="polite"></span><div class="actions" id="footer-actions"></div></footer>+</section>+<script>(()=>{+${MSO_WIDGET_THEME_SCRIPT}+const $=id=>document.getElementById(id);const title=$("title"),description=$("description"),count=$("count"),items=$("items"),empty=$("empty"),filterWrap=$("filter-wrap"),filter=$("filter"),footer=$("footer"),footerActions=$("footer-actions"),feedback=$("feedback");let current=null;+const text=(v,f="")=>typeof v==="string"&&v.trim()?v.trim():f;const rows=(v,max)=>Array.isArray(v)?v.filter(x=>x&&typeof x==="object"&&!Array.isArray(x)).slice(0,max):[];const icons={project:"PRJ",file:"DOC",folder:"DIR",workflow:"WF",session:"SES",app:"APP",integration:"INT",agent:"AGT",server:"SRV",code:"CODE",item:"•"};+function normalize(raw){if(!raw||typeof raw!=="object")return null;return{title:text(raw.title,"MSO list"),description:text(raw.description),layout:raw.layout==="grid"?"grid":"list",searchable:raw.searchable===true,emptyMessage:text(raw.emptyMessage,"No items."),items:rows(raw.items,40).map((row,index)=>({id:text(row.id,"item-"+(index+1)),title:text(row.title,"Item "+(index+1)),subtitle:text(row.subtitle),badge:text(row.badge),status:["neutral","info","success","warning","error"].includes(row.status)?row.status:"neutral",icon:icons[row.icon]?row.icon:"item",meta:rows(row.meta,4).map(m=>({label:text(m.label),value:text(m.value)})),actions:rows(row.actions,2).map((a,i)=>({id:text(a.id,"action-"+(i+1)),label:text(a.label,"Open"),style:a.style==="primary"?"primary":"secondary",prompt:text(a.prompt)})).filter(a=>a.prompt)})),actions:rows(raw.actions,3).map((a,i)=>({id:text(a.id,"global-"+(i+1)),label:text(a.label,"Continue"),style:a.style==="primary"?"primary":"secondary",prompt:text(a.prompt)})).filter(a=>a.prompt)}}+function clear(node){while(node.firstChild)node.removeChild(node.firstChild)}function el(tag,cls,val){const n=document.createElement(tag);if(cls)n.className=cls;if(val!==undefined)n.textContent=String(val);return n}+async function follow(action,item){if(!action?.prompt)return;const context=item?"\n\nMSO list selection:\n"+JSON.stringify({id:item.id,title:item.title}).slice(0,1000):"";feedback.textContent="Sending to chat…";try{if(!window.openai||typeof window.openai.sendFollowUpMessage!=="function")throw new Error("unsupported");await window.openai.sendFollowUpMessage({prompt:action.prompt+context});feedback.textContent="Sent to chat."}catch(_){feedback.textContent="Continue in the chat."}}+function renderAction(action,item){const b=el("button",action.style||"secondary",action.label);b.type="button";b.addEventListener("click",()=>follow(action,item));return b}+function renderItems(query=""){clear(items);const q=query.trim().toLowerCase();const visible=current.items.filter(row=>!q||[row.title,row.subtitle,row.badge,...row.meta.flatMap(m=>[m.label,m.value])].join(" ").toLowerCase().includes(q));items.className="items"+(current.layout==="grid"?" grid":"");count.textContent=String(visible.length)+"/"+String(current.items.length);empty.hidden=visible.length>0;empty.textContent=q?"No matching items.":current.emptyMessage;for(const row of visible){const item=el("article","item");item.dataset.itemId=row.id;item.append(el("div","icon",icons[row.icon]||"•"));const main=el("div","main"),tr=el("div","title-row");tr.append(el("div","title",row.title));if(row.badge)tr.append(el("span","badge "+row.status,row.badge));main.append(tr);if(row.subtitle)main.append(el("div","subtitle",row.subtitle));if(row.meta.length){const meta=el("div","meta");for(const m of row.meta)meta.append(el("span","",m.label?(m.label+": "+m.value):m.value));main.append(meta)}item.append(main);if(row.actions.length){const actions=el("div","actions");for(const a of row.actions)actions.append(renderAction(a,row));item.append(actions)}items.append(item)}}+function persist(){try{if(window.openai&&typeof window.openai.setWidgetState==="function")window.openai.setWidgetState({modelContent:"MSO list: "+(current?.title||"collection"),privateContent:{query:filter.value},imageIds:[]})}catch(_){}}+function render(raw){const next=normalize(raw);if(!next)return;current=next;title.textContent=next.title;description.textContent=next.description;description.hidden=!next.description;filterWrap.hidden=!next.searchable;filter.value="";renderItems();clear(footerActions);footer.hidden=!next.actions.length;for(const a of next.actions)footerActions.append(renderAction(a));persist()}+filter.addEventListener("input",()=>{renderItems(filter.value);persist()});function readHostOutput(){const output=window.openai&&window.openai.toolOutput;if(output)render(output)}window.addEventListener("message",event=>{if(event.source!==window.parent)return;const message=event.data;if(message&&message.method==="ui/notifications/tool-result"&&message.params&&message.params.structuredContent)render(message.params.structuredContent)},{passive:true});window.addEventListener("openai:set_globals",()=>{applyHostTheme();readHostOutput()},{passive:true});applyHostTheme();readHostOutput();+})();</script></main>`;++export const MSO_LIST_RESOURCE = {+ uri: MSO_LIST_URI,+ name: "MSO List",+ description: "Compact searchable list or grid for model-selected MSO items.",+ mimeType: MIME,+ text: html,+ _meta: widgetResourceMeta(+ "Compact MSO collection view for model-selected projects, files, sessions, workflows, apps, integrations, agents, and other bounded items. Actions return user-approved follow-ups to the chat and never execute mutations directly.",+ ),+} as const;diff --git a/lib/mcp/ui-page-lifecycle.test.ts b/lib/mcp/ui-page-lifecycle.test.tsindex 116c6782..1881b3bd 100644--- a/lib/mcp/ui-page-lifecycle.test.ts+++ b/lib/mcp/ui-page-lifecycle.test.ts@@ -3,7 +3,7 @@ import { describe, expect, it } from "vitest";import { LEGACY_PAGE_V12_URI, LEGACY_PAGE_V11_URI, LEGACY_PAGE_V10_URI, LEGACY_PAGE_V2_URI, LEGACY_PAGE_V3_URI, LEGACY_PAGE_V9_URI, MSO_PAGE_URI, listUiResources, readUiResource } from "./ui-resources";describe("MCP Page lifecycle and cached resource migration", () => {- it("serves current bytes to cached v2 clients without advertising a third UI", async () => {+ it("serves current bytes to cached Page clients without advertising legacy aliases", 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 });@@ -12,7 +12,7 @@ describe("MCP Page lifecycle and cached resource migration", () => {expect(await readUiResource(LEGACY_PAGE_V2_URI)).toMatchObject({ uri: LEGACY_PAGE_V2_URI, text: page?.text });expect(await readUiResource(LEGACY_PAGE_V3_URI)).toMatchObject({ uri: LEGACY_PAGE_V3_URI, text: page?.text });expect(await readUiResource(LEGACY_PAGE_V9_URI)).toMatchObject({ uri: LEGACY_PAGE_V9_URI, text: page?.text });- expect(await listUiResources()).toHaveLength(2);+ expect(await listUiResources()).toHaveLength(3);expect((await listUiResources()).some((resource) => resource.uri === LEGACY_PAGE_V2_URI)).toBe(false);});it("includes the Apps handshake and reviewed preview contract in valid self-contained JavaScript", async () => {diff --git a/lib/mcp/ui-resource-state.test.ts b/lib/mcp/ui-resource-state.test.tsindex e024ffdc..2cfc9bd5 100644--- a/lib/mcp/ui-resource-state.test.ts+++ b/lib/mcp/ui-resource-state.test.ts@@ -21,7 +21,7 @@ const { activeWorkflowForActor } = await import("@/lib/workflow");const call = (name: string, args: Record<string, unknown> = {}) =>({ jsonrpc: "2.0", id: 1, method: "tools/call", params: { name, arguments: args } });-describe("MCP Apps Block and Page contract", () => {+describe("MCP Apps List, Block and Page contract", () => {it("returns only redacted structured workflow state and keeps status polling out of workflow memory", async () => {const actor = `mcp:ui-status-${Date.now()}`;const projectHint = "/private/operator/projects/mso";diff --git a/lib/mcp/ui-resources.test.ts b/lib/mcp/ui-resources.test.tsindex 9661ee33..d8582306 100644--- a/lib/mcp/ui-resources.test.ts+++ b/lib/mcp/ui-resources.test.ts@@ -11,11 +11,12 @@ const { dispatch } = await import("./dispatch");const {MCP_APP_MIME_TYPE,MSO_BLOCK_URI,+ MSO_LIST_URI,MSO_PAGE_URI,} = await import("./ui-resources");const { MCP_UI_DOMAIN, MSO_ORIGIN } = await import("./ui-config");-describe("MCP Apps Block and Page contract", () => {+describe("MCP Apps List, Block and Page contract", () => {it("keeps workflow_start headless and binds only explicit Block/Page render tools", async () => {const initialized = await dispatch({ id: 1, method: "initialize" }, "write", "mcp:ui-init");expect(initialized.result).toMatchObject({@@ -39,6 +40,14 @@ describe("MCP Apps Block and Page contract", () => {"openai/widgetAccessible": true,});+ const list = tools.find((tool) => tool.name === "render_mso_list");+ expect(list?.outputSchema).toBeDefined();+ expect(list?._meta).toMatchObject({+ ui: { resourceUri: MSO_LIST_URI, visibility: ["model", "app"] },+ "openai/widgetAccessible": true,+ });+ expect(list?._meta?.["openai/outputTemplate"]).toBeUndefined();+const block = tools.find((tool) => tool.name === "render_mso_block");expect(block?.outputSchema).toBeDefined();expect(block?._meta).toMatchObject({@@ -71,7 +80,7 @@ describe("MCP Apps Block and Page contract", () => {.filter((tool) => Boolean((tool._meta?.ui as { resourceUri?: string } | undefined)?.resourceUri)).map((tool) => tool.name).sort();- expect(resourceBound).toEqual(["integration_setup_open", "render_mso_block", "render_mso_page"]);+ expect(resourceBound).toEqual(["integration_setup_open", "render_mso_block", "render_mso_list", "render_mso_page"]);const appOnly = tools.filter((tool) => {const visibility = (tool._meta?.ui as { visibility?: string[] } | undefined)?.visibility;@@ -89,15 +98,36 @@ describe("MCP Apps Block and Page contract", () => {}});- it("advertises exactly two canonical resources: one Block and one Page", async () => {+ it("advertises exactly three canonical resources: List, Block and Page", async () => {const listed = await dispatch({ id: 1, method: "resources/list" }, "read", "mcp:ui-resource");const resources = (listed.result as { resources: Array<{ uri: string; name: string; mimeType: string }> }).resources;expect(resources).toEqual([+ expect.objectContaining({ uri: MSO_LIST_URI, name: "MSO List", mimeType: MCP_APP_MIME_TYPE }),expect.objectContaining({ uri: MSO_BLOCK_URI, name: "MSO Block", mimeType: MCP_APP_MIME_TYPE }),expect.objectContaining({ uri: MSO_PAGE_URI, name: "MSO Page", mimeType: MCP_APP_MIME_TYPE }),]);});++ it("serves a self-contained searchable List whose actions only return follow-ups", async () => {+ const read = await dispatch({ id: 29, method: "resources/read", params: { uri: MSO_LIST_URI } }, "read", "mcp:ui-list");+ const content = (read.result as { contents: Array<{ uri: string; mimeType: string; text: string; _meta: Record<string, any> }> }).contents[0];+ expect(content.uri).toBe(MSO_LIST_URI);+ expect(content.mimeType).toBe(MCP_APP_MIME_TYPE);+ expect(content.text).toContain("sendFollowUpMessage");+ expect(content.text).toContain('type=\"search\"');+ expect(content.text).toContain("MSO list selection");+ expect(content.text).toContain("setWidgetState");+ expect(content.text).not.toContain("fetch(");+ expect(content.text).not.toContain('rpcRequest(\"tools/call\"');+ expect(content.text).not.toContain("dangerouslySetInnerHTML");+ const script = inlineScripts(content.text)[0];+ expect(script).toBeTruthy();+ expect(() => new Function(script!)).not.toThrow();+ expect(content._meta.ui.csp).toMatchObject({ connectDomains: [], resourceDomains: [] });+ expect(content._meta.ui.csp.frameDomains).toBeUndefined();+ });+it("serves a self-contained compact Block with user-approved follow-up actions", async () => {const read = await dispatch({ id: 2, method: "resources/read", params: { uri: MSO_BLOCK_URI } }, "read", "mcp:ui-block");const content = (read.result as {diff --git a/lib/mcp/ui-resources.ts b/lib/mcp/ui-resources.tsindex cdba4887..a152926b 100644--- a/lib/mcp/ui-resources.ts+++ b/lib/mcp/ui-resources.ts@@ -1,12 +1,13 @@import { MSO_BLOCK_RESOURCE, MSO_BLOCK_URI } from "./ui-block";+import { MSO_LIST_RESOURCE, MSO_LIST_URI } from "./ui-list";import { MSO_PAGE_URI, msoPageResource } from "./ui-surface";-export { MSO_BLOCK_URI, MSO_PAGE_URI };+export { MSO_BLOCK_URI, MSO_LIST_URI, MSO_PAGE_URI };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.+// resources/list advertises the three canonical presentation levels: List, Block and Page.export const LEGACY_BLOCK_V2_URI = "ui://mso/block-v2.html";export const LEGACY_PAGE_V14_URI = "ui://mso/page-v14.html";export const LEGACY_PAGE_V13_URI = "ui://mso/page-v13.html";@@ -55,10 +56,11 @@ const LEGACY_PAGE_URIS = new Set([export async function listUiResources(): Promise<Array<{ uri: string; name: string; description: string; mimeType: string }>> {const page = await msoPageResource();- return [MSO_BLOCK_RESOURCE, page].map(({ uri, name, description, mimeType }) => ({ uri, name, description, mimeType }));+ return [MSO_LIST_RESOURCE, MSO_BLOCK_RESOURCE, page].map(({ uri, name, description, mimeType }) => ({ uri, name, description, mimeType }));}export async function readUiResource(uri: string): Promise<McpUiResource | undefined> {+ if (uri === MSO_LIST_URI) return MSO_LIST_RESOURCE;if (uri === MSO_BLOCK_URI) return MSO_BLOCK_RESOURCE;if (uri === MSO_PAGE_URI) return msoPageResource();if (uri === LEGACY_BLOCK_V2_URI || uri === LEGACY_BLOCK_V1_URI || uri === LEGACY_WORKFLOW_PROGRESS_URI) return { ...MSO_BLOCK_RESOURCE, uri };diff --git a/lib/mcp/ui-widget-theme.test.ts b/lib/mcp/ui-widget-theme.test.tsindex fd142564..7486f354 100644--- a/lib/mcp/ui-widget-theme.test.ts+++ b/lib/mcp/ui-widget-theme.test.ts@@ -1,5 +1,6 @@import { describe, expect, it } from "vitest";import { MSO_BLOCK_RESOURCE } from "./ui-block";+import { MSO_LIST_RESOURCE } from "./ui-list";import { MSO_PAGE_RESOURCE } from "./ui-surface";import { MSO_SURFACE_SCRIPT } from "./ui-surface-script";import { MSO_SURFACE_STYLE } from "./ui-surface-style";@@ -7,7 +8,7 @@ import { MSO_WIDGET_THEME_SCRIPT, MSO_WIDGET_TOKENS } from "./ui-widget-tokens";const pageResource = await MSO_PAGE_RESOURCE;const surfaceScript = await MSO_SURFACE_SCRIPT;-const canonicalHtml = `${MSO_BLOCK_RESOURCE.text}\n${pageResource.text}`;+const canonicalHtml = `${MSO_LIST_RESOURCE.text}\n${MSO_BLOCK_RESOURCE.text}\n${pageResource.text}`;describe("Rahmanef widget theme", () => {it("mirrors the public site's light and dark palette from one shared token source", () => {@@ -22,7 +23,8 @@ describe("Rahmanef widget theme", () => {expect(MSO_WIDGET_TOKENS).toContain(":root:not([data-theme])");});- it("injects the same palette into Block and Page and removes the old generic purple theme", () => {+ it("injects the same palette into List, Block and Page and removes the old generic purple theme", () => {+ expect(MSO_LIST_RESOURCE.text).toContain(MSO_WIDGET_TOKENS);expect(MSO_BLOCK_RESOURCE.text).toContain(MSO_WIDGET_TOKENS);expect(MSO_SURFACE_STYLE).toContain(MSO_WIDGET_TOKENS);expect(pageResource.text).toContain(MSO_WIDGET_TOKENS);@@ -43,6 +45,7 @@ describe("Rahmanef widget theme", () => {it("tracks the ChatGPT host theme while retaining prefers-color-scheme fallback", () => {expect(MSO_WIDGET_THEME_SCRIPT).toContain("window.openai.theme");expect(MSO_WIDGET_THEME_SCRIPT).toContain('theme==="light"||theme==="dark"');+ expect(MSO_LIST_RESOURCE.text).toContain("applyHostTheme();readHostOutput()");expect(MSO_BLOCK_RESOURCE.text).toContain("applyHostTheme();readHostOutput()");expect(surfaceScript).toContain("applyHostTheme();");expect(pageResource.text).toContain("window.openai.theme");diff --git a/lib/presentation/widget-tokens.ts b/lib/presentation/widget-tokens.tsindex 83e4707c..3f364c51 100644--- a/lib/presentation/widget-tokens.ts+++ b/lib/presentation/widget-tokens.ts@@ -1,5 +1,5 @@/**- * Shared visual contract for ChatGPT Block and Page resources.+ * Shared visual contract for ChatGPT List, Block and Page resources.** Core values follow the MSO presentation palette. The widget keeps its own* small presentation aliases, but the public brand palette stays single-source.diff --git a/package.json b/package.jsonindex 71477efd..40f50874 100644--- a/package.json+++ b/package.json@@ -26,6 +26,7 @@"icons:app": "node scripts/gen-app-icons.mjs && python3 scripts/gen-remaining-platform-icons.py","skill:new": "node scripts/create-skill-flow.mjs","skill:check": "bun scripts/check-skill-flows.mjs",+ "plugin:link-app": "node scripts/link-openai-app.mjs","comparison": "node scripts/gen-comparison.mjs","bench:cognitive": "bun scripts/bench-cognitive-runtime.mjs","bench:memory": "bun scripts/bench-memory-retrieval.mjs",diff --git a/scripts/check-skill-flows.mjs b/scripts/check-skill-flows.mjsindex 06b7cc41..14717780 100755--- a/scripts/check-skill-flows.mjs+++ b/scripts/check-skill-flows.mjs@@ -108,8 +108,16 @@ try {if (plugin.name !== "mso") errors.push(".codex-plugin/plugin.json name must be mso");if (plugin.version !== pkg.version) errors.push(".codex-plugin/plugin.json version must match package.json");if (plugin.skills !== "./claude-skills/") errors.push(".codex-plugin/plugin.json skills must point at ./claude-skills/");+ if (plugin.apps !== "./.app.json") errors.push(".codex-plugin/plugin.json apps must point at ./.app.json");if (plugin.mcpServers !== undefined) errors.push(".codex-plugin/plugin.json must not declare mcpServers; the web-capable MSO custom MCP app remains a separate OAuth connection");if (!Array.isArray(plugin.interface?.capabilities)) errors.push(".codex-plugin/plugin.json interface.capabilities must be an array");+ const appManifest = JSON.parse(await fs.readFile(path.join(repo, ".app.json"), "utf8"));+ if (!appManifest.apps || typeof appManifest.apps !== "object" || Array.isArray(appManifest.apps)) errors.push(".app.json must contain an apps object");+ for (const [name, app] of Object.entries(appManifest.apps ?? {})) {+ if (!slug.test(name)) errors.push(`.app.json app key must be kebab-case: ${name}`);+ if (!app || typeof app !== "object" || typeof app.id !== "string" || !/^(?:plugin_)?asdk_app_[a-z0-9]+$/.test(app.id)) errors.push(`.app.json ${name}.id must be an exact registered OpenAI app id`);+ if (app?.required !== true) errors.push(`.app.json ${name}.required must be true`);+ }} catch (error) {errors.push(`OpenAI plugin manifest invalid: ${error instanceof Error ? error.message : String(error)}`);}diff --git a/scripts/e2e/mcp-page.mjs b/scripts/e2e/mcp-page.mjsindex ba196168..868c2dc9 100644--- a/scripts/e2e/mcp-page.mjs+++ b/scripts/e2e/mcp-page.mjs@@ -23,6 +23,11 @@ const resource = JSON.parse(execFileSync(["-e", 'import { MSO_PAGE_RESOURCE } from "./lib/mcp/ui-surface"; console.log(JSON.stringify(await MSO_PAGE_RESOURCE))'],{ encoding: "utf8", env: { ...process.env, MSO_SURFACE_APPS_JSON: JSON.stringify(registry), OS_PUBLIC_ORIGIN: "https://mso.example.com", OS_MCP_UI_ORIGIN: "https://mso-ui.example.com" } },));+const listResource = JSON.parse(execFileSync(+ "bun",+ ["-e", 'import { MSO_LIST_RESOURCE } from "./lib/mcp/ui-list"; console.log(JSON.stringify(MSO_LIST_RESOURCE))'],+ { encoding: "utf8", env: { ...process.env, OS_PUBLIC_ORIGIN: "https://mso.example.com", OS_MCP_UI_ORIGIN: "https://mso-ui.example.com" } },+));const output = {route: "/apps/play-together",kind: "app",@@ -43,6 +48,9 @@ const output = {},};+assert.equal(listResource.uri, "ui://mso/list-v1.html");+assert.deepEqual(listResource._meta.ui.csp.connectDomains, []);+assert.deepEqual(listResource._meta.ui.csp.resourceDomains, []);assert.equal(resource.uri, "ui://mso/page-v15.html");assert.deepEqual(resource._meta.ui.csp.frameDomains, [registry[0].origin]);assert.deepEqual(resource._meta["openai/widgetCSP"].frame_domains, [registry[0].origin]);@@ -51,8 +59,27 @@ assert(!resource.text.includes("mountReviewedFrame"));assert(resource.text.includes('"renderer":"iframe"'));const browser = await chromium.launch({ ...(process.env.CHROME_PATH ? {executablePath:process.env.CHROME_PATH} : {}), args: ["--no-sandbox", "--disable-dev-shm-usage"] });-let assertions = 6;+let assertions = 9;try {+ const listContext=await browser.newContext({viewport:{width:640,height:720}});+ const listPage=await listContext.newPage();+ const listOutput={title:"Projects",description:"Model-selected projects",layout:"list",searchable:true,emptyMessage:"No projects.",items:[+ {id:"baton",title:"Batonly",subtitle:"Project management",badge:"Active",status:"success",icon:"project",meta:[{label:"Branch",value:"main"}],actions:[{id:"open",label:"Open",style:"primary",prompt:"Open this project with render_mso_page."}]},+ {id:"careerpack",title:"CareerPack",subtitle:"HR platform",badge:"Review",status:"info",icon:"project",meta:[],actions:[]},+ ],actions:[]};+ await listPage.route("https://mso-ui.example.com/list",route=>route.fulfill({contentType:"text/html",body:`<!doctype html><script>window.followUps=[];window.openai={toolOutput:${JSON.stringify(listOutput)},sendFollowUpMessage:async x=>window.followUps.push(x),setWidgetState:()=>{}}</script>${listResource.text}`}));+ await listPage.goto("https://mso-ui.example.com/list");+ assert.equal(await listPage.locator(".item").count(),2);assertions++;+ await listPage.getByRole("searchbox").fill("career");+ assert.equal(await listPage.locator(".item").count(),1);assertions++;+ await listPage.getByRole("searchbox").fill("");+ await listPage.getByRole("button",{name:"Open",exact:true}).click();+ await listPage.waitForFunction(()=>window.followUps?.length===1);+ assert.match(await listPage.evaluate(()=>window.followUps[0].prompt),/baton/);assertions++;+ const listAudit=await new AxeBuilder({page:listPage}).include(".mso-list").withTags(["wcag2a","wcag2aa","wcag21aa"]).analyze();+ assert.deepEqual(listAudit.violations.map(v=>v.id),[]);assertions++;+ await listPage.close();+ await listContext.close();for (const viewport of [{ width: 1280, height: 800 }, { width: 390, height: 800 }]) {const page = await browser.newPage({ viewport });await page.route("https://mso-ui.example.com/qa", (route) => route.fulfill({diff --git a/scripts/link-openai-app.mjs b/scripts/link-openai-app.mjsnew file mode 100755index 00000000..4a103e93--- /dev/null+++ b/scripts/link-openai-app.mjs@@ -0,0 +1,18 @@+#!/usr/bin/env node+import { promises as fs } from "node:fs";+import path from "node:path";++const repo=path.resolve(path.dirname(new URL(import.meta.url).pathname),"..");+const target=path.join(repo,".app.json");+const args=process.argv.slice(2);+const fail=(message)=>{console.error(`openai-app: ${message}`);process.exit(2)};+if(args.includes("--clear")){+ await fs.writeFile(target,JSON.stringify({apps:{}},null,2)+"\n");+ console.log("openai-app: cleared registered app mapping; live MCP authorization is unchanged");+ process.exit(0);+}+const id=args[0]?.trim();+if(!id) fail("usage: bun run plugin:link-app -- <plugin_asdk_app...|asdk_app...> | --clear");+if(!/^(?:plugin_)?asdk_app_[a-z0-9]+$/.test(id)) fail("expected an exact registered OpenAI app id; placeholders and URLs are rejected");+await fs.writeFile(target,JSON.stringify({apps:{mso:{id,required:true}}},null,2)+"\n");+console.log(`openai-app: linked mso -> ${id}`);