Skip to content

armgit / mso

Public Imported from GitHub
0

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

fix(integrations): inherit shell design tokens

Rahman1211d2687665
diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md
index 9f3eb9dc..4f94fd59 100644
--- a/docs/CHANGELOG.md
+++ b/docs/CHANGELOG.md
@@ -13,6 +13,7 @@ this is the *what*, and it is what Settings → About shows as “What's new”.
**Fixed**
+- `integrations` inherit shell design tokens
- `integrations` align layout with Settings sidebar
- `mcp` harden bidirectional file transfer
- `mcp` bind ChatGPT Azure file trust to OAuth provenance
diff --git a/docs/INTEGRATIONS.md b/docs/INTEGRATIONS.md
index 3f5d04ae..553cc682 100644
--- a/docs/INTEGRATIONS.md
+++ b/docs/INTEGRATIONS.md
@@ -102,8 +102,10 @@ Open `/integrations`. Public instructions are readable before sign-in; an Owner
session is required to read/manage credential profiles or open their private forms.
Choose the credential user, provider, named connection, source and authentication.
The browser workbench uses the same master/detail navigation grammar as Settings.
-Desktop has a searchable **224px sidebar** and a bounded **48rem detail pane**; below
-600px the sidebar becomes an accessible drawer. Providers live under **Connections**.
+Desktop uses the shared Settings sidebar/content measure tokens; compact windows turn the
+same sidebar into an accessible drawer. Providers live under **Connections**. Visual
+surfaces, accent, typography, radius and spacing come from the shared semantic token
+contract, and the native iframe synchronizes those tokens from the active AppShell.
**Credential owners**, **Project routing**, **Transfer & backup**, and **Add project MCP**
live under **Manage**. Section state stays selected when the credential owner changes,
and Transfer & backup renders in the detail pane instead of replacing the navigation.
diff --git a/docs/PROGRESS.md b/docs/PROGRESS.md
index c895b48c..fc0ace40 100644
--- a/docs/PROGRESS.md
+++ b/docs/PROGRESS.md
@@ -1,3 +1,9 @@
+## 2026-09-15 — Integrations content is fully token-driven
+
+The Settings-style Integrations shell and its content pane now consume one semantic visual contract instead of feature-local colors, dimensions, radii, typography, or spacing constants. Provider cards, credential rows, menus, setup forms, Transfer & backup, status pills, buttons, and empty states use shared `background/card/primary/muted/border` aliases plus the MSO widget spacing/type/radius tokens. A regression test rejects feature-local hex/RGB, px/rem visual lengths, numeric font weights, and literal white/black in Integrations styles; only the structural container breakpoint is exempt because CSS custom properties cannot parameterize media/container-query conditions.
+
+The native same-origin Integrations iframe now receives the active AppShell palette, accent/foreground, sidebar, shadow, radius, shell font, and root font scale at load time and whenever shell theme/preset styles change. This removes the previous split where the window/sidebar followed MSO but the generated content retained its own fallback appearance. MCP Page continues to map host style variables through the same semantic aliases.
+
## 2026-09-15 — Integrations adopts the Settings sidebar/detail layout
Integrations now uses the same navigation grammar as Settings instead of its own toolbar + nested provider rail. Desktop uses a searchable 224px sidebar grouped into **Connections** and **Manage**, with a bounded 48rem detail pane; below 600px the same sidebar becomes an accessible drawer with Escape/backdrop close behavior. Credential owner selection stays in the sidebar, section state persists across owner changes, and connection counts are decorative so accessible button names remain stable.
diff --git a/docs/generated/MCP-CATALOG.md b/docs/generated/MCP-CATALOG.md
index 66c86444..c578461e 100644
--- a/docs/generated/MCP-CATALOG.md
+++ b/docs/generated/MCP-CATALOG.md
@@ -4,13 +4,13 @@
## Full MSO catalog
-<!-- mcp-toolset: server=1.14.3 version=2026.09.15.2 tools=105 read=50 write=34 exec=21 -->
+<!-- mcp-toolset: server=1.14.4 version=2026.09.15.3 tools=105 read=50 write=34 exec=21 -->
| Fact | Current source value |
|---|---:|
-| MCP server | `1.14.3` |
-| Toolset | `2026.09.15.2` |
-| Toolset changed at | `2026-09-15T02:00:00+07:00` |
+| MCP server | `1.14.4` |
+| Toolset | `2026.09.15.3` |
+| Toolset changed at | `2026-09-15T03:35:00+07:00` |
| Transport tools | **107** |
| Model/operator tools | **105** |
| Read | **50** |
@@ -139,7 +139,7 @@
## ChatGPT model profile
-<!-- mcp-chatgpt-profile: server=1.14.3 version=2026.09.15.2 tools=105 read=50 write=34 exec=21 app-only=2 total=107 -->
+<!-- mcp-chatgpt-profile: server=1.14.4 version=2026.09.15.3 tools=105 read=50 write=34 exec=21 app-only=2 total=107 -->
The ChatGPT profile automatically projects the complete MSO-owned generic model/operator catalog. OAuth scope is still enforced independently; app-only compatibility bridges stay app-only, and project-owned MCP tool names remain dynamic data behind the generic project bridge.
diff --git a/frontend/slices/integrations/app.tsx b/frontend/slices/integrations/app.tsx
index 5c0a7512..436f6a81 100644
--- a/frontend/slices/integrations/app.tsx
+++ b/frontend/slices/integrations/app.tsx
@@ -2,6 +2,7 @@
import { useEffect, useRef, useState } from "react";
import { Button } from "@/components/ui/button";
+import { syncIntegrationFrameTokens } from "./frame-theme";
/** Preserve transfer/setup deep links without putting private capabilities in React state. */
export function managerLocation(search: string, hash = "") {
@@ -19,7 +20,23 @@ export default function IntegrationsApp() {
target.src = managerLocation(window.location.search, window.location.hash);
if (window.location.hash) window.history.replaceState(window.history.state, "", window.location.pathname + window.location.search);
const timer = window.setTimeout(() => setStatus(current => current === "loading" ? "error" : current), 15000);
- return () => window.clearTimeout(timer);
+ let animation = 0;
+ const sync = () => {
+ window.cancelAnimationFrame(animation);
+ animation = window.requestAnimationFrame(() => syncIntegrationFrameTokens(target));
+ };
+ const observer = new MutationObserver(sync);
+ observer.observe(document.documentElement, { attributes: true, attributeFilter: ["class", "style", "data-theme", "data-shell"] });
+ observer.observe(document.head, { childList: true, subtree: true, characterData: true });
+ const scheme = window.matchMedia("(prefers-color-scheme: dark)");
+ scheme.addEventListener("change", sync);
+ sync();
+ return () => {
+ window.clearTimeout(timer);
+ window.cancelAnimationFrame(animation);
+ observer.disconnect();
+ scheme.removeEventListener("change", sync);
+ };
}, [retry]);
return (
<section className="flex h-full min-h-0 flex-col bg-background" aria-label="Integrations">
@@ -30,7 +47,7 @@ export default function IntegrationsApp() {
{status === "error" && <Button variant="secondary" onClick={() => { setStatus("loading"); setRetry(n => n + 1); }}>Retry</Button>}
</div>}
<iframe ref={frame} title="MSO native Integrations manager" className="min-h-0 w-full flex-1 border-0"
- referrerPolicy="no-referrer" onLoad={() => { if (frame.current?.getAttribute("src")) setStatus("ready"); }}
+ referrerPolicy="no-referrer" onLoad={() => { if (frame.current?.getAttribute("src")) { syncIntegrationFrameTokens(frame.current); setStatus("ready"); } }}
onError={() => setStatus("error")} />
</section>
);
diff --git a/frontend/slices/integrations/frame-theme.test.ts b/frontend/slices/integrations/frame-theme.test.ts
new file mode 100644
index 00000000..790a06ce
--- /dev/null
+++ b/frontend/slices/integrations/frame-theme.test.ts
@@ -0,0 +1,18 @@
+import { describe, expect, it } from "vitest";
+import { INTEGRATION_FRAME_TOKEN_MAP, integrationFrameTokens } from "./frame-theme";
+
+describe("Integrations frame visual token bridge", () => {
+ it("maps shell semantic palette/accent into the iframe without arbitrary CSS", () => {
+ const source = new Map<string, string>([["--accent", " dynamic-accent "], ["--surface", " dynamic-surface "], ["--sidebar", " dynamic-sidebar "]]);
+ expect(integrationFrameTokens((name) => source.get(name) ?? "")).toMatchObject({
+ "--os-accent": "dynamic-accent",
+ "--surface": "dynamic-surface",
+ "--sidebar": "dynamic-sidebar",
+ });
+ expect(INTEGRATION_FRAME_TOKEN_MAP.some(([local]) => local === "--os-accent")).toBe(true);
+ });
+
+ it("drops missing values instead of manufacturing feature-local fallbacks", () => {
+ expect(integrationFrameTokens(() => "")).toEqual({});
+ });
+});
diff --git a/frontend/slices/integrations/frame-theme.ts b/frontend/slices/integrations/frame-theme.ts
new file mode 100644
index 00000000..fce1573c
--- /dev/null
+++ b/frontend/slices/integrations/frame-theme.ts
@@ -0,0 +1,71 @@
+/**
+ * Same-origin Integrations iframe theme bridge.
+ *
+ * Iframes do not inherit CSS custom properties from AppShell. Copy only the
+ * reviewed visual tokens needed by the generated Integrations resource so its
+ * Settings-like content follows the active shell preset/accent dynamically.
+ */
+export const INTEGRATION_FRAME_TOKEN_MAP = [
+ ["--text", "--text"],
+ ["--text-dim", "--text-dim"],
+ ["--text-faint", "--text-faint"],
+ ["--sep", "--sep"],
+ ["--sep-strong", "--sep-strong"],
+ ["--os-accent", "--accent"],
+ ["--accent-text", "--accent-text"],
+ ["--grouped", "--grouped"],
+ ["--fill", "--fill"],
+ ["--fill2", "--fill2"],
+ ["--window-bg", "--window-bg"],
+ ["--surface", "--surface"],
+ ["--field", "--field"],
+ ["--hover", "--hover"],
+ ["--hover-strong", "--hover-strong"],
+ ["--inset", "--inset"],
+ ["--shadow-pop", "--shadow-pop"],
+ ["--warning", "--warning"],
+ ["--info", "--info"],
+ ["--destructive-text", "--destructive-text"],
+ ["--sidebar", "--sidebar"],
+ ["--radius", "--radius"],
+ ["--blur", "--blur"],
+ ["--background", "--background"],
+ ["--foreground", "--foreground"],
+ ["--card", "--card"],
+ ["--primary", "--primary"],
+ ["--primary-foreground", "--primary-foreground"],
+ ["--secondary", "--secondary"],
+ ["--secondary-foreground", "--secondary-foreground"],
+ ["--muted", "--muted"],
+ ["--muted-foreground", "--muted-foreground"],
+ ["--border", "--border"],
+ ["--input", "--input"],
+ ["--font-family", "--shell-font"],
+] as const;
+
+export type IntegrationTokenReader = (name: string) => string;
+
+export function integrationFrameTokens(read: IntegrationTokenReader): Record<string, string> {
+ return Object.fromEntries(
+ INTEGRATION_FRAME_TOKEN_MAP
+ .map(([local, shell]) => [local, read(shell).trim()] as const)
+ .filter(([, value]) => value.length > 0),
+ );
+}
+
+export function syncIntegrationFrameTokens(frame: HTMLIFrameElement): void {
+ try {
+ const target = frame.contentDocument?.documentElement;
+ if (!target) return;
+ const source = getComputedStyle(document.documentElement);
+ const values = integrationFrameTokens((name) => source.getPropertyValue(name));
+ for (const [name, value] of Object.entries(values)) target.style.setProperty(name, value);
+ if (source.fontSize) target.style.fontSize = source.fontSize;
+ const theme = document.documentElement.dataset.theme;
+ if (theme === "light" || theme === "dark") target.dataset.theme = theme;
+ else target.removeAttribute("data-theme");
+ } catch {
+ // The production manager is same-origin. Fail closed/no-op if an embedding
+ // context changes that contract rather than attempting cross-origin access.
+ }
+}
diff --git a/lib/infra/connection-ui-layout.test.ts b/lib/infra/connection-ui-layout.test.ts
index edb9450d..29df2a59 100644
--- a/lib/infra/connection-ui-layout.test.ts
+++ b/lib/infra/connection-ui-layout.test.ts
@@ -10,8 +10,8 @@ it("uses the Settings master/detail navigation contract", () => {
expect(CONNECTION_MANAGER_SCRIPT).toContain('n("p","Manage","integration-nav-label")');
expect(CONNECTION_MANAGER_SCRIPT).toContain('["transfer","Transfer & backup",showTransfer]');
expect(CONNECTION_MANAGER_SCRIPT).toContain('["project-mcp","Add project MCP",showProjectMcp]');
- expect(CONNECTION_MANAGER_STYLE).toContain('grid-template-columns:14rem minmax(0,1fr)');
- expect(CONNECTION_MANAGER_STYLE).toContain('width:min(100%,48rem)');
+ expect(CONNECTION_MANAGER_STYLE).toContain('grid-template-columns:var(--settings-sidebar-width) minmax(0,1fr)');
+ expect(CONNECTION_MANAGER_STYLE).toContain('width:min(100%,var(--settings-content-width))');
expect(CONNECTION_MANAGER_STYLE).toContain('@container integration (max-width:37.5rem)');
expect(CONNECTION_MANAGER_STYLE).toContain('integration-sidebar-toggle');
});
diff --git a/lib/infra/connection-ui-style.ts b/lib/infra/connection-ui-style.ts
index a34ad3cc..1a91e1b4 100644
--- a/lib/infra/connection-ui-style.ts
+++ b/lib/infra/connection-ui-style.ts
@@ -1,121 +1,64 @@
-// Shared by the browser route and the MCP Page; theme values come from widget-tokens.
+// Shared by the browser route and the MCP Page; all visual values come from widget/shell semantic tokens.
export const CONNECTION_MANAGER_STYLE = String.raw`
-.integration .provider-mark svg{width:65%;height:65%;fill:currentColor}
-.integration .integration-signin{display:inline-flex;align-items:center;min-height:var(--control-size);padding:var(--space-3) var(--space-4);margin-bottom:var(--space-4);border-radius:var(--radius-control);text-decoration:none}
-.integration .identity-guide[open]{padding-bottom:var(--space-3)}
-.integration .connection-state[data-ready=true]{color:var(--success-text);background:color-mix(in srgb,var(--success-text) 10%,var(--surface))}
-
-.surface>.body.integration{margin:0 auto}
-.integration.manager{container:integration / inline-size;--integration-rail:12rem;--integration-gap:var(--space-6);max-width:var(--measure);width:100%}
-.integration .identity-heading,.integration .provider-heading,.integration .connection-heading{display:flex;align-items:center;justify-content:space-between;gap:var(--space-4)}
-.integration .identity-heading :is(h1,h2){margin:0}.integration .identity-heading p{margin:var(--space-1) 0 0}
-.integration .identity-count{font:600 var(--type-caption) var(--font-body);color:var(--text-dim);white-space:nowrap}
-.integration .identity-bar{display:flex;gap:var(--space-3);align-items:end;flex-wrap:wrap;margin:var(--space-4) 0}
-.integration .identity-bar>label{flex:1;max-width:340px;min-width:160px;margin:0}
-.integration .identity-bar select{margin-top:var(--space-2)}
+.integration{color:var(--foreground);font:var(--type-small)/var(--line-body) var(--font-body)}
+.integration :is(button,input,select,summary,a):focus-visible{outline:var(--focus-width) solid var(--primary);outline-offset:var(--focus-gap)}
+.integration button{min-height:var(--control-size);border:var(--stroke) solid var(--input);border-radius:var(--radius-control);background:var(--secondary);color:var(--secondary-foreground);padding:var(--space-2) var(--space-3);font:var(--type-small)/var(--line-body) var(--font-body);font-weight:var(--weight-medium);cursor:pointer}
+.integration button:hover:not(:disabled){background:var(--hover-strong)}
+.integration button:disabled{cursor:not-allowed;opacity:var(--settings-disabled-opacity)}
+.integration .primary{border-color:var(--primary);background:var(--primary);color:var(--primary-foreground)}
+.integration .danger{color:var(--destructive-text)}
+.integration .provider-mark{display:grid;place-items:center;flex:none;width:var(--brand-size);height:var(--brand-size);border:var(--stroke) solid var(--border);border-radius:var(--radius-control);background:var(--secondary);color:var(--foreground)}
+.integration .provider-mark svg{width:var(--icon-size);height:var(--icon-size);fill:currentColor}
+.integration .integration-signin{display:inline-flex;align-items:center;min-height:var(--control-size);padding:var(--space-3) var(--space-4);margin-bottom:var(--space-4);border-radius:var(--radius-control);text-decoration:none;background:var(--primary);color:var(--primary-foreground)}
+.integration .identity-actions{display:flex;gap:var(--space-2);flex-wrap:wrap;margin-top:var(--space-4)}
.integration .identity-tools{position:relative;margin:0;padding:0;border:0;background:none}
-.integration .identity-tools summary{min-height:var(--control-size);display:flex;align-items:center;border:var(--stroke) solid var(--sep-strong);border-radius:var(--radius-control);padding:var(--space-2) var(--space-3);font-size:var(--type-small)}
-.integration .identity-tools[open] .identity-actions{position:absolute;right:0;top:100%;z-index:2;min-width:210px;background:var(--surface);padding:var(--space-3);border:var(--stroke) solid var(--sep-strong);border-radius:var(--radius-panel);box-shadow:var(--shadow-pop)}
-.integration .identity-tools .identity-actions{display:grid;margin-top:var(--space-1)}
-.integration .identity-layout{display:grid;grid-template-columns:var(--integration-rail) minmax(0,1fr);gap:var(--integration-gap);align-items:start}
-.integration .identity-providers{display:grid;gap:var(--space-1);align-content:start;padding-right:var(--space-4);border-right:var(--stroke) solid var(--sep)}
-.integration .identity-providers input{margin-bottom:var(--space-2);font-size:var(--type-small)}
-.integration .identity-providers button{display:flex;text-align:left;align-items:center;gap:var(--space-3);padding:var(--space-2) var(--space-3);min-height:var(--control-size);border-color:transparent;background:transparent}
-.integration .identity-providers button:hover{background:var(--hover)}
-.integration [aria-pressed=true]{border-color:var(--sep-strong)!important;background:var(--field)!important;font-weight:700}
-.integration .provider-mark{display:grid;place-items:center;flex:none;width:32px;height:32px;border:var(--stroke) solid var(--sep-strong);border-radius:var(--radius-control);background:var(--field);font:700 var(--type-small) var(--font-body);color:var(--text)}
-.integration .provider-heading .provider-mark{width:44px;height:44px;font-size:var(--type-section);border-radius:var(--radius-panel)}
-.integration .provider-title{display:flex;align-items:center;gap:var(--space-3);min-width:0}
-.integration .provider-title h2{font-size:var(--type-title);margin:0}.integration .provider-title p{margin:var(--space-1) 0 0}
-.integration .provider-count{margin-left:auto;font:600 var(--type-caption) var(--font-body);color:var(--text-dim)}
-.integration .identity-detail{min-width:0}.integration .identity-detail>p{max-width:66ch}
-.integration .connection-card{border:0;border-top:var(--stroke) solid var(--sep);border-radius:0;padding:var(--space-5) 0;margin:var(--space-4) 0 0;background:transparent}
-.integration .connection-card h3{margin:0;font-size:var(--type-section);overflow-wrap:anywhere}
-.integration .connection-heading{align-items:start}.integration .connection-heading small{margin:3px 0 0}
-.integration .connection-state{font-size:var(--type-caption);line-height:1.5;border:var(--stroke) solid var(--sep-strong);border-radius:var(--radius-pill);padding:3px var(--space-2);white-space:nowrap}
-.integration .connection-state[data-ready=true]{color:var(--success-text);background:color-mix(in srgb,var(--success-text) 10%,var(--surface))}
-.integration .identity-tags{display:flex;flex-wrap:wrap;gap:var(--space-2);margin:var(--space-3) 0;color:var(--text-dim);font-size:var(--type-caption)}
-.integration .identity-actions{display:flex;gap:var(--space-2);flex-wrap:wrap;margin-top:var(--space-4)}.integration .identity-workbench{margin-top:0}.integration .identity-credential-status{display:grid;gap:var(--space-2);margin:var(--space-3) 0;font-size:var(--type-small)}.integration .identity-credential-status>div{display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:var(--space-2);padding:var(--space-2) 0;border-bottom:var(--stroke) solid var(--sep)}.integration .credential-field-state{font-size:var(--type-caption);color:var(--warning)}.integration .credential-field-state[data-stored=true]{color:var(--success-text)}
-.integration .identity-fields{display:grid;grid-template-columns:1fr 1fr;gap:var(--space-4);margin:var(--space-4) 0}
-.integration .identity-fields label{min-width:0}.integration .identity-fields input,.integration .identity-fields select{margin-top:var(--space-2)}
-.integration .identity-feedback{min-height:24px;margin:var(--space-3) 0;color:var(--text-dim);overflow-wrap:anywhere}
-.integration .identity-path{font:var(--type-caption) var(--font-mono);overflow-wrap:anywhere;margin:var(--space-3) 0 var(--space-4);color:var(--text-dim)}
-.integration .identity-check{display:flex;align-items:center;gap:var(--space-2)}.integration .identity-check input{width:18px;height:18px;flex:none}
-.integration .identity-empty{border:0;border-top:var(--stroke) solid var(--sep);border-radius:0;padding:var(--space-6) 0;margin:var(--space-5) 0;background:transparent}
-.integration .identity-empty h3{margin:0 0 var(--space-2);font-size:var(--type-section)}.integration .identity-empty p{max-width:50ch;margin-bottom:var(--space-4)}
-.integration .danger{color:var(--destructive-text)}.integration .identity-guide a{display:inline-block;margin:var(--space-2) var(--space-3) var(--space-1) 0}
-.integration .identity-guide li{font-size:var(--type-small)}.integration .identity-muted{font-size:var(--type-caption);color:var(--text-dim)}
-.integration .identity-form{border:var(--stroke) solid var(--sep-strong);border-radius:var(--radius-panel);padding:var(--space-4)}
-.integration .identity-readonly{padding:var(--space-3) var(--space-4);border-left:3px solid var(--os-accent);background:var(--field);font-size:var(--type-small)}
-.integration .identity-summary-line{margin:0 0 var(--space-4);padding:0 0 var(--space-3);border-bottom:var(--stroke) solid var(--sep);font-size:var(--type-small);color:var(--text-dim)}.integration .identity-summary{display:flex;align-items:center;gap:var(--space-4);padding:0 0 var(--space-4);margin-bottom:var(--space-6);border:0;border-bottom:var(--stroke) solid var(--sep);border-radius:0;background:transparent}
-.integration .identity-ring{width:64px;height:64px;flex:none;border-radius:50%;display:grid;place-items:center;background:conic-gradient(var(--os-accent) var(--ready-angle),var(--sep) 0)}
-.integration .identity-ring strong{display:grid;place-items:center;width:50px;height:50px;border-radius:50%;background:var(--surface);font:700 var(--type-section) var(--font-body)}
-.integration .identity-summary dl{display:flex;gap:var(--space-6);flex-wrap:wrap;margin:0}.integration .identity-summary dt{font-size:var(--type-caption);color:var(--text-dim)}.integration .identity-summary dd{font-weight:700;font-size:var(--type-section);margin:2px 0 0}
-.integration :is(button,a,input,select,summary):focus-visible{outline:var(--focus-width) solid var(--os-accent);outline-offset:var(--focus-gap)}
-@container integration (max-width:48rem){.surface>.body.integration{margin:0 auto}
-.integration.manager{--integration-rail:180px;--integration-gap:var(--space-4)}.integration .identity-providers{padding-right:var(--space-3)}.integration .identity-heading{align-items:start}.integration .identity-count{white-space:normal;text-align:right}.integration .identity-summary dl{gap:var(--space-4)}}
-@container integration (max-width:35rem){.integration .owner-picker{max-width:none;flex-basis:100%}.integration .identity-workbench{width:100%}.integration .identity-layout{grid-template-columns:1fr;gap:var(--space-4)}.integration .identity-providers{display:none;grid-template-columns:repeat(2,minmax(0,1fr));padding:0 0 var(--space-3);border:0;border-bottom:var(--stroke) solid var(--sep)}.integration .identity-providers input{grid-column:1/-1;position:sticky;top:0;background:var(--surface);z-index:1}.integration .identity-providers button{font-size:var(--type-caption);padding:var(--space-2);gap:var(--space-2)}.integration .identity-fields{grid-template-columns:1fr}.integration .identity-bar{gap:var(--space-2);margin:var(--space-4) 0}.integration .identity-bar>label{max-width:none;flex-basis:100%}.integration .connection-card{padding:var(--space-4)}.integration .provider-heading{align-items:start;flex-wrap:wrap}.integration .identity-summary{padding:0 0 var(--space-4);gap:var(--space-3)}.integration .identity-summary dl{gap:var(--space-3)}.integration .identity-summary dd{font-size:var(--type-section)}.integration .identity-tools[open] .identity-actions{left:0;right:auto}.integration .identity-heading p{font-size:var(--type-small)}}
-
-.integration .owner-picker{position:relative;min-width:220px;flex:1;max-width:340px}.integration .identity-picker-label{display:block;margin-bottom:var(--space-2);font-size:var(--type-caption);font-weight:650;color:var(--text-dim)}.integration .owner-picker-trigger{display:flex;align-items:center;width:100%;justify-content:space-between;text-align:left;background:var(--field);border-color:var(--sep-strong)}
-.integration .owner-picker-popup{position:absolute;z-index:3;top:calc(100% + 6px);left:0;right:0;max-height:240px;overflow:auto;padding:var(--space-2);background:var(--surface);border:var(--stroke) solid var(--sep-strong);border-radius:var(--radius);box-shadow:var(--shadow-pop)}
-.integration .owner-picker-option{display:flex;width:100%;text-align:left;background:transparent;border-color:transparent}.integration .owner-picker-option:hover,.integration .owner-picker-option:focus-visible,.integration .owner-picker-option[aria-selected=true]{background:var(--hover);border-color:var(--sep-strong)}.integration .owner-picker-option[aria-selected=true]{font-weight:700}
-.integration .service-picker{display:none}
-.integration .identity-current-owner{margin-right:auto;align-self:center;font-size:var(--type-small);font-weight:650;color:var(--text-dim);max-width:260px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.integration .identity-context{flex:0 0 auto;min-width:0;margin:0;padding:0;background:transparent;border:0}
-.integration .identity-context>summary{display:flex;align-items:center;min-height:var(--control-size);padding:var(--space-2) var(--space-3);border:var(--stroke) solid var(--sep-strong);border-radius:var(--radius-control);font-size:var(--type-small);font-weight:var(--weight-medium);overflow-wrap:anywhere}
-.integration .identity-context>summary::before{content:"+";margin-right:var(--space-2)}.integration .identity-context[open]>summary::before{content:"−"}
-.integration .identity-context-controls{display:flex;align-items:end;gap:var(--space-2);flex-wrap:wrap;padding-top:var(--space-3)}
-.integration .identity-context .owner-picker{min-width:0;flex-basis:100%;max-width:none}
-.integration .identity-bar{align-items:center}
-.integration .identity-context .identity-workbench{width:auto}
-
-.integration .identity-summary{padding-block:var(--space-3);margin-bottom:var(--space-4)}
-.integration .identity-ring{display:none}
-.integration .identity-providers{overflow:visible}
-@container integration (max-width:35rem){.integration .identity-current-owner{width:100%;max-width:none;margin-right:0}.integration .identity-bar>.primary{flex:1}.integration .service-picker{display:block;margin-bottom:var(--space-4)}.integration .connection-card{padding-inline:0}.integration .identity-summary dl{gap:var(--space-4)}.integration .identity-tools[open] .identity-actions{position:static;box-shadow:none;min-width:0}.integration .identity-credential-status>div{grid-template-columns:minmax(0,1fr) auto}.integration .identity-credential-status>div>button{grid-column:1/-1;justify-self:start}}
-@container mso (max-height:20rem){.integration .service-picker{margin-bottom:var(--space-2);font-size:0}.integration .service-picker select{font-size:var(--type-small);margin:0}.integration .identity-heading,.integration .identity-summary{display:none}.integration .identity-bar{margin-block:var(--space-2)}.integration .identity-picker-label{display:none}}
-
-/* Integrations shares the Settings master/detail grammar: grouped searchable
- sidebar, compact section detail, and a mobile side sheet. */
+.integration .identity-tools summary{min-height:var(--control-size);display:flex;align-items:center;border:var(--stroke) solid var(--input);border-radius:var(--radius-control);padding:var(--space-2) var(--space-3);font-size:var(--type-small);cursor:pointer}
+.integration .identity-tools[open] .identity-actions{position:absolute;right:0;top:100%;z-index:var(--settings-layer-popover);min-width:var(--settings-popover-width);display:grid;background:var(--card);padding:var(--space-3);border:var(--stroke) solid var(--border);border-radius:var(--radius-panel);box-shadow:var(--shadow-pop)}
+.integration .identity-guide{border:var(--stroke) solid var(--border);border-radius:var(--radius-panel);padding:var(--space-3);background:var(--card);margin:var(--space-3) 0}
+.integration .identity-guide[open]{padding-bottom:var(--space-3)}
+.integration .identity-guide summary{cursor:pointer;font-weight:var(--weight-strong)}
+.integration .identity-guide li{margin:var(--space-2) 0}.integration .identity-guide a{display:inline-block;margin:var(--space-2) var(--space-3) var(--space-1) 0;color:var(--primary);overflow-wrap:anywhere}
+.integration .provider-heading,.integration .connection-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:var(--space-4)}
+.integration .provider-title{display:flex;align-items:flex-start;gap:var(--space-3);min-width:0}.integration .provider-heading .provider-mark{width:var(--settings-section-icon-size);height:var(--settings-section-icon-size);border-radius:var(--radius-panel)}
+.integration .provider-title h2,.integration .integration-settings-detail>h2{font:var(--weight-strong) var(--type-title)/var(--line-title) var(--font-display);margin:0}.integration .provider-title p{max-width:var(--measure-copy);margin:var(--space-1) 0 0;color:var(--muted-foreground);font-size:var(--type-small)}
+.integration .identity-summary-line{margin:var(--space-4) 0;padding-bottom:var(--space-3);border-bottom:var(--stroke) solid var(--border);font-size:var(--type-small);color:var(--muted-foreground)}
+.integration .connection-card{border:var(--stroke) solid var(--border);border-radius:var(--radius-panel);padding:var(--space-4);margin:var(--space-4) 0 0;background:var(--settings-card)}
+.integration .connection-card h3{margin:0;font-size:var(--type-section);font-weight:var(--weight-strong);overflow-wrap:anywhere}.integration .connection-heading small{display:block;margin-top:var(--space-1);color:var(--muted-foreground)}
+.integration .connection-state{font-size:var(--type-caption);line-height:var(--line-body);border:var(--stroke) solid var(--border);border-radius:var(--radius-pill);padding:var(--space-1) var(--space-2);white-space:nowrap}.integration .connection-state[data-ready=true]{color:var(--success-text);background:var(--settings-success-fill)}
+.integration .identity-tags{display:flex;flex-wrap:wrap;gap:var(--space-2);margin:var(--space-3) 0;color:var(--muted-foreground);font-size:var(--type-caption)}.integration .identity-tags span{border-radius:var(--radius-pill);background:var(--muted);padding:var(--space-1) var(--space-2)}
+.integration .identity-credential-status{display:grid;margin:var(--space-3) calc(var(--space-4) * -1) 0;font-size:var(--type-small);border-top:var(--stroke) solid var(--border)}.integration .identity-credential-status>div{display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:var(--space-2);min-height:var(--control-size);padding:var(--space-2) var(--space-4);border-bottom:var(--stroke) solid var(--border)}.integration .identity-credential-status>div:last-child{border-bottom:0}.integration .credential-field-state{font-size:var(--type-caption);color:var(--warning)}.integration .credential-field-state[data-stored=true]{color:var(--success-text)}
+.integration .identity-fields{display:grid;grid-template-columns:1fr 1fr;gap:var(--space-4);margin:var(--space-4) 0}.integration .identity-fields label{min-width:0}.integration .identity-fields input,.integration .identity-fields select{margin-top:var(--space-2)}
+.integration .identity-feedback{min-height:var(--control-size);margin:var(--space-3) 0;color:var(--muted-foreground);overflow-wrap:anywhere}.integration .identity-path{font:var(--type-caption) var(--font-mono);overflow-wrap:anywhere;margin:var(--space-3) 0 var(--space-4);color:var(--muted-foreground)}
+.integration .identity-check{display:flex;align-items:center;gap:var(--space-2);font-weight:var(--weight-regular)}.integration .identity-check input{width:var(--icon-size);height:var(--icon-size);flex:none;margin:0;accent-color:var(--primary)}
+.integration .identity-empty{border:var(--stroke) solid var(--border);border-radius:var(--radius-panel);padding:var(--space-5);margin:var(--space-5) 0;background:var(--settings-card)}.integration .identity-empty h3{margin:0 0 var(--space-2);font-size:var(--type-section);font-weight:var(--weight-strong)}.integration .identity-empty p{max-width:var(--measure-copy);margin-bottom:var(--space-4)}
+.integration .identity-muted{font-size:var(--type-caption);color:var(--muted-foreground)}.integration .identity-readonly{width:min(100%,var(--settings-content-width));margin-inline:auto;padding:var(--space-3) var(--space-4);border-left:var(--stroke-emphasis) solid var(--primary);background:var(--muted);font-size:var(--type-small)}
+.integration .owner-picker{position:relative;min-width:0;width:100%}.integration .identity-picker-label{display:block;margin-bottom:var(--space-2);font-size:var(--type-caption);font-weight:var(--weight-strong);color:var(--muted-foreground)}.integration .owner-picker-trigger{display:flex;align-items:center;width:100%;justify-content:space-between;text-align:left;background:var(--secondary);border-color:var(--input)}
+.integration .owner-picker-popup{position:absolute;z-index:var(--settings-layer-popover);top:calc(100% + var(--space-1));left:0;right:0;max-height:var(--settings-popover-max-height);overflow:auto;padding:var(--space-2);background:var(--card);border:var(--stroke) solid var(--border);border-radius:var(--radius-panel);box-shadow:var(--shadow-pop)}.integration .owner-picker-option{display:flex;width:100%;text-align:left;background:transparent;border-color:transparent}.integration .owner-picker-option:hover,.integration .owner-picker-option:focus-visible{background:var(--hover)}.integration .owner-picker-option[aria-selected=true]{background:var(--settings-selected);color:var(--settings-selected-text);font-weight:var(--weight-strong)}
.surface>.body.integration{margin:0!important;max-width:none!important;width:100%!important;padding:0!important}
-.integration.manager{container:integration / inline-size;position:relative;max-width:none;width:100%;height:100%;min-height:100%;overflow:hidden;background:var(--surface)}
-.integration .integration-settings-shell{display:grid;grid-template-columns:14rem minmax(0,1fr);height:100%;min-height:0;background:color-mix(in srgb,var(--surface) 92%,var(--field))}
-.integration .integration-settings-sidebar{display:flex;min-height:0;flex-direction:column;border-right:var(--stroke) solid var(--sep);background:color-mix(in srgb,var(--field) 70%,var(--surface));overflow:hidden}
-.integration .integration-sidebar-header{display:grid;gap:var(--space-3);padding:var(--space-5) var(--space-3) var(--space-3)}
-.integration .integration-sidebar-brand{display:flex;align-items:center;gap:var(--space-3);padding:0 var(--space-1) var(--space-1)}
-.integration .integration-sidebar-brand strong,.integration .integration-sidebar-brand small{display:block}.integration .integration-sidebar-brand strong{font-size:var(--type-small)}.integration .integration-sidebar-brand small{margin-top:2px;color:var(--text-dim);font-size:var(--type-caption)}
-.integration .integration-brand-icon{display:grid;width:44px;height:44px;place-items:center;border-radius:12px;background:var(--field);box-shadow:inset 0 0 0 var(--stroke) var(--sep-strong);font-size:11px;font-weight:800;letter-spacing:.04em}
-.integration .integration-sidebar-header>input[type=search]{width:100%;min-height:36px;margin:0;border-radius:9px;background:color-mix(in srgb,var(--surface) 75%,transparent);font-size:var(--type-caption)}
-.integration .integration-settings-sidebar .owner-picker{min-width:0;max-width:none;width:100%}.integration .integration-settings-sidebar .owner-picker-trigger{min-height:38px;font-size:var(--type-caption)}
-.integration .integration-settings-nav{min-height:0;flex:1;overflow-y:auto;padding:0 var(--space-2) var(--space-4);scrollbar-width:thin}
-.integration .integration-nav-group{display:grid;gap:2px;margin-top:var(--space-3)}
-.integration .integration-nav-label{margin:0;padding:0 var(--space-2) var(--space-1);font-size:11px;font-weight:650;color:var(--text-dim)}
-.integration .integration-nav-item{position:relative;display:flex;width:100%;min-height:42px;align-items:center;gap:10px;border:0;border-radius:7px;padding:6px 8px;text-align:left;background:transparent;color:var(--text);font-size:13px;font-weight:500}
-.integration .integration-nav-item:hover{background:var(--hover)}
-.integration .integration-nav-item[aria-current=page]{background:var(--os-accent);color:white;font-weight:650}
-.integration .integration-nav-item[aria-current=page] .provider-mark{border-color:color-mix(in srgb,white 45%,transparent);background:color-mix(in srgb,white 14%,transparent);color:white}
-.integration .integration-nav-item .provider-mark{width:25px;height:25px;border-radius:6px;box-shadow:0 1px 2px color-mix(in srgb,var(--text) 10%,transparent)}
-.integration .integration-nav-item .provider-count{margin-left:auto;font-size:11px;color:inherit;opacity:.72}
-.integration .integration-nav-utility{padding-left:10px}.integration .integration-nav-utility::before{content:"";width:7px;height:7px;flex:none;border-radius:50%;background:var(--sep-strong)}.integration .integration-nav-utility[aria-current=page]::before{background:white}
-.integration .integration-sidebar-footer{flex:none;border-top:var(--stroke) solid var(--sep);padding:var(--space-3)}.integration .integration-sidebar-footer button{width:100%;justify-content:center;border-color:transparent;background:transparent;color:var(--text-dim)}
-.integration .integration-settings-content{min-width:0;min-height:0;overflow-y:auto;background:var(--surface)}
-.integration .integration-settings-detail,.integration .identity-feedback,.integration .identity-readonly{width:min(100%,48rem);margin-inline:auto}
-.integration .integration-settings-detail{padding:var(--space-5);padding-bottom:max(var(--space-5),env(safe-area-inset-bottom))}.integration .identity-feedback{padding:0 var(--space-5) var(--space-5)}
-.integration .integration-settings-detail>h2,.integration .provider-title h2{font-size:20px;font-weight:650;letter-spacing:-.012em}
-.integration .provider-heading{align-items:flex-start;padding-bottom:var(--space-1)}.integration .provider-title{align-items:flex-start}.integration .provider-heading .provider-mark{width:38px;height:38px;border-radius:9px}.integration .provider-title p{max-width:58ch;color:var(--text-dim);font-size:var(--type-small);line-height:1.5}
-.integration .identity-summary-line{margin:var(--space-3) 0 0;padding-bottom:var(--space-3)}
-.integration .integration-mobile-toolbar{display:none}
-.integration .integration-sidebar-backdrop{display:none}
-.integration .integration-sidebar-toggle{min-height:38px}
+.integration.manager{container:integration / inline-size;position:relative;max-width:none;width:100%;height:100%;min-height:100%;overflow:hidden;background:var(--settings-canvas)}
+.integration .integration-settings-shell{display:grid;grid-template-columns:var(--settings-sidebar-width) minmax(0,1fr);height:100%;min-height:0;background:var(--settings-canvas)}
+.integration .integration-settings-sidebar{display:flex;min-height:0;flex-direction:column;border-right:var(--stroke) solid var(--border);background:var(--settings-sidebar);overflow:hidden;color:var(--sidebar-foreground)}
+.integration .integration-sidebar-header{display:grid;gap:var(--space-4);padding:var(--space-5) var(--space-3) var(--space-3)}
+.integration .integration-sidebar-brand{display:flex;align-items:center;gap:var(--space-3);padding-inline:var(--space-1)}.integration .integration-sidebar-brand strong,.integration .integration-sidebar-brand small{display:block}.integration .integration-sidebar-brand strong{font-size:var(--type-small);font-weight:var(--weight-strong)}.integration .integration-sidebar-brand small{margin-top:var(--space-1);color:var(--muted-foreground);font-size:var(--type-caption)}
+.integration .integration-brand-icon{display:grid;width:var(--control-size);height:var(--control-size);place-items:center;border-radius:var(--radius-panel);background:var(--secondary);box-shadow:inset 0 0 0 var(--stroke) var(--border);font-size:var(--type-caption);font-weight:var(--weight-heavy)}
+.integration .integration-sidebar-header>input[type=search]{width:100%;min-height:var(--control-size);margin:0;border-radius:var(--radius-control);background:var(--secondary);font-size:var(--type-caption)}.integration .integration-settings-sidebar .owner-picker-trigger{min-height:var(--control-size);font-size:var(--type-caption)}
+.integration .integration-settings-nav{min-height:0;flex:1;overflow-y:auto;padding:0 var(--space-2) var(--space-4);scrollbar-width:thin}.integration .integration-nav-group{display:grid;gap:var(--space-1);margin-top:var(--space-3)}.integration .integration-nav-label{margin:0;padding:0 var(--space-2) var(--space-1);font-size:var(--type-caption);font-weight:var(--weight-medium);color:var(--muted-foreground)}
+.integration .integration-nav-item{position:relative;display:flex;width:100%;min-height:var(--control-size);align-items:center;gap:var(--space-2);border:0;border-radius:var(--radius-control);padding:var(--space-2);text-align:left;background:transparent;color:var(--foreground);font-size:var(--type-small);font-weight:var(--weight-regular)}.integration .integration-nav-item:hover:not(:disabled){background:var(--hover)}.integration .integration-nav-item[aria-current=page]{background:var(--settings-selected);color:var(--settings-selected-text);font-weight:var(--weight-strong)}
+.integration .integration-nav-item .provider-mark{width:var(--settings-nav-icon-size);height:var(--settings-nav-icon-size);border-radius:var(--radius-control)}.integration .integration-nav-item[aria-current=page] .provider-mark{border-color:var(--settings-selected-border);background:var(--settings-selected-subtle);color:var(--settings-selected-text)}.integration .integration-nav-item .provider-count{margin-left:auto;font-size:var(--type-caption);color:inherit;opacity:var(--settings-muted-opacity)}
+.integration .integration-nav-utility::before{content:"";width:var(--space-2);height:var(--space-2);flex:none;border-radius:var(--radius-pill);background:var(--border)}.integration .integration-nav-utility[aria-current=page]::before{background:var(--settings-selected-text)}
+.integration .integration-sidebar-footer{flex:none;border-top:var(--stroke) solid var(--border);padding:var(--space-3)}.integration .integration-sidebar-footer button{width:100%;justify-content:center;border-color:transparent;background:transparent;color:var(--muted-foreground)}
+.integration .integration-settings-content{min-width:0;min-height:0;overflow-y:auto;background:var(--settings-canvas)}.integration .integration-settings-detail,.integration .identity-feedback{width:min(100%,var(--settings-content-width));margin-inline:auto}.integration .integration-settings-detail{padding:var(--space-5);padding-bottom:max(var(--space-5),env(safe-area-inset-bottom))}.integration .identity-feedback{padding:0 var(--space-5) var(--space-5)}
+.integration .integration-mobile-toolbar{display:none}.integration .integration-sidebar-backdrop{display:none}.integration .integration-sidebar-toggle{min-height:var(--control-size)}
@container integration (max-width:37.5rem){
.integration .integration-settings-shell{display:block;position:relative;min-height:100%}
- .integration .integration-settings-sidebar{position:absolute;inset:0 auto 0 0;z-index:30;width:min(82%,18rem);transform:translateX(-102%);transition:transform 160ms ease;box-shadow:var(--shadow-pop)}
+ .integration .integration-settings-sidebar{position:absolute;inset:0 auto 0 0;z-index:var(--settings-layer-drawer);width:min(100%,var(--settings-sidebar-sheet-width));transform:translateX(-100%);transition:transform var(--settings-transition);box-shadow:var(--shadow-pop)}
.integration .integration-settings-sidebar[data-open=true]{transform:translateX(0)}
- .integration .integration-sidebar-backdrop{position:absolute;inset:0;z-index:20;display:block;width:100%;height:100%;padding:0;border:0;border-radius:0;background:color-mix(in srgb,#000 38%,transparent)}
+ .integration .integration-sidebar-backdrop{position:absolute;inset:0;z-index:var(--settings-layer-backdrop);display:block;width:100%;height:100%;padding:0;border:0;border-radius:0;background:var(--settings-overlay)}
.integration .integration-sidebar-backdrop[hidden]{display:none}
.integration .integration-settings-content{height:100%;overflow-y:auto}
- .integration .integration-mobile-toolbar{position:sticky;top:0;z-index:10;display:flex;align-items:center;border-bottom:var(--stroke) solid var(--sep);padding:6px var(--space-3);background:color-mix(in srgb,var(--surface) 94%,transparent);backdrop-filter:blur(14px)}
+ .integration .integration-mobile-toolbar{position:sticky;top:0;z-index:var(--settings-layer-sticky);display:flex;align-items:center;border-bottom:var(--stroke) solid var(--border);padding:var(--space-2) var(--space-3);background:var(--settings-canvas);backdrop-filter:blur(var(--settings-backdrop-blur))}
.integration .integration-settings-detail{padding:var(--space-4)}.integration .identity-feedback{padding:0 var(--space-4) var(--space-4)}
.integration .provider-heading{gap:var(--space-3);flex-wrap:wrap}.integration .provider-heading>.primary{width:100%}
- .integration .connection-card{padding-inline:0}
+ .integration .identity-fields{grid-template-columns:1fr}.integration .identity-tools[open] .identity-actions{position:static;box-shadow:none;min-width:0}.integration .identity-credential-status>div{grid-template-columns:minmax(0,1fr) auto}.integration .identity-credential-status>div>button{grid-column:1/-1;justify-self:start}
}
-`;
\ No newline at end of file
+`;
diff --git a/lib/infra/integration-style-contract.test.ts b/lib/infra/integration-style-contract.test.ts
new file mode 100644
index 00000000..23ef46e9
--- /dev/null
+++ b/lib/infra/integration-style-contract.test.ts
@@ -0,0 +1,40 @@
+import { describe, expect, it } from "vitest";
+import { CONNECTION_MANAGER_STYLE } from "./connection-ui-style";
+import { INTEGRATION_FORM_STYLE } from "./setup-ui";
+import { PORTABILITY_STYLE } from "./portable/ui";
+import { INTEGRATION_PAGE_STYLE } from "./setup-page";
+
+const styles = {
+ manager: CONNECTION_MANAGER_STYLE,
+ setup: INTEGRATION_FORM_STYLE,
+ portability: PORTABILITY_STYLE,
+ page: INTEGRATION_PAGE_STYLE,
+};
+
+// CSS custom properties cannot be substituted inside container-query conditions,
+// so the one shared structural breakpoint is intentionally exempt. Every visual
+// declaration inside the feature must consume semantic tokens instead of literals.
+function withoutStructuralBreakpoint(css: string) {
+ return css.replaceAll("37.5rem", "TOKEN_BREAKPOINT");
+}
+
+describe("Integrations visual token contract", () => {
+ it.each(Object.entries(styles))("%s has no feature-local colors or absolute visual lengths", (_name, css) => {
+ const value = withoutStructuralBreakpoint(css);
+ expect(value).not.toMatch(/#[0-9a-f]{3,8}\b/i);
+ expect(value).not.toMatch(/rgba?\s*\(/i);
+ expect(value).not.toMatch(/hsla?\s*\(/i);
+ expect(value).not.toMatch(/\b\d+(?:\.\d+)?px\b/i);
+ expect(value).not.toMatch(/\b\d+(?:\.\d+)?rem\b/i);
+ expect(value).not.toMatch(/font-weight\s*:\s*\d+/i);
+ expect(value).not.toMatch(/(?:^|[:;,\s])(white|black)(?:[;,\s}]|$)/i);
+ });
+
+ it("uses the shared Settings semantic surfaces and accent", () => {
+ expect(CONNECTION_MANAGER_STYLE).toContain("var(--settings-card)");
+ expect(CONNECTION_MANAGER_STYLE).toContain("var(--settings-sidebar)");
+ expect(CONNECTION_MANAGER_STYLE).toContain("var(--primary)");
+ expect(PORTABILITY_STYLE).toContain("var(--settings-card)");
+ expect(INTEGRATION_FORM_STYLE).toContain("var(--settings-card)");
+ });
+});
diff --git a/lib/infra/portable/ui.ts b/lib/infra/portable/ui.ts
index f47a3a69..f6474521 100644
--- a/lib/infra/portable/ui.ts
+++ b/lib/infra/portable/ui.ts
@@ -63,5 +63,12 @@ function mountPortability(root,bridge){
}
`;
export const PORTABILITY_STYLE=String.raw`
-.portable-transfer{max-width:880px!important;margin:auto}.portable-transfer .transfer-heading h2{margin-bottom:4px}.portable-transfer .transfer-heading p{margin-top:0}.portable-transfer .transfer-tabs{display:flex;gap:4px;margin:20px 0;border-bottom:1px solid var(--sep)}.portable-transfer .transfer-tabs button{border:0;border-radius:0;background:transparent;margin:0;padding:10px 14px}.portable-transfer .transfer-tabs button[aria-selected=true]{border-bottom:2px solid var(--os-accent);font-weight:700}.portable-transfer .transfer-card{border:1px solid var(--sep-strong);border-radius:12px;padding:20px;background:var(--field);margin-top:0}.portable-transfer .transfer-card>label{display:block;margin:14px 0 6px;font-weight:600;font-size:13px}.portable-transfer select,.portable-transfer input{margin-top:6px;max-width:100%}.portable-transfer .transfer-security{margin:16px 0;padding:14px;border-radius:10px;background:var(--inset)}.portable-transfer .danger-zone{border:1px solid color-mix(in srgb,var(--destructive-text) 40%,var(--sep));background:color-mix(in srgb,var(--destructive-text) 5%,var(--surface))}.portable-transfer .identity-check{display:flex;gap:9px;align-items:center;font-weight:400}.portable-transfer .identity-check input{width:18px;height:18px;margin:0;order:-1;flex:none}.portable-transfer .transfer-tree{max-height:360px;overflow:auto;margin:10px 0;padding:10px;border:1px solid var(--sep);border-radius:10px;background:var(--surface)}.portable-transfer .transfer-tree-user{padding:8px 0;border-bottom:1px solid var(--sep)}.portable-transfer .transfer-tree-provider{padding-left:22px}.portable-transfer .transfer-tree-provider>.identity-check~.identity-check{padding-left:22px;color:var(--text-dim)}.portable-transfer pre{max-height:330px;overflow:auto;font-size:12px;line-height:1.6;white-space:pre-wrap;overflow-wrap:anywhere}.portable-transfer [role=status]{font-size:13px;overflow-wrap:anywhere}.portable-transfer .transfer-hint{font-size:12px;color:var(--text-dim);margin-top:12px}.portable-transfer button{min-height:40px;margin:8px 7px 8px 0}@media(max-width:700px){.portable-transfer .transfer-card{padding:14px}.portable-transfer .transfer-tabs button{flex:1}.portable-transfer .transfer-tree-provider{padding-left:12px}.portable-transfer .transfer-tree-provider>.identity-check~.identity-check{padding-left:12px}}
+.portable-transfer{width:100%;max-width:var(--settings-content-width)!important;margin:auto}.portable-transfer .transfer-heading h2{margin-bottom:var(--space-1)}.portable-transfer .transfer-heading p{margin-top:0}.portable-transfer .transfer-tabs{display:flex;gap:var(--space-1);margin:var(--space-5) 0;border-bottom:var(--stroke) solid var(--border)}
+.portable-transfer .transfer-tabs button{border:0;border-radius:0;background:transparent;margin:0;padding:var(--space-2) var(--space-3)}.portable-transfer .transfer-tabs button[aria-selected=true]{border-bottom:var(--stroke-active) solid var(--primary);font-weight:var(--weight-bold);color:var(--primary)}
+.portable-transfer .transfer-card{border:var(--stroke) solid var(--border);border-radius:var(--radius-panel);padding:var(--space-5);background:var(--settings-card);margin-top:0}.portable-transfer .transfer-card>label{display:block;margin:var(--space-4) 0 var(--space-2);font-weight:var(--weight-strong);font-size:var(--type-small)}.portable-transfer select,.portable-transfer input{margin-top:var(--space-2);max-width:100%}
+.portable-transfer .transfer-security{margin:var(--space-4) 0;padding:var(--space-4);border-radius:var(--radius-control);background:var(--muted)}.portable-transfer .danger-zone{border:var(--stroke) solid var(--settings-danger-border);background:var(--settings-danger-fill)}
+.portable-transfer .identity-check{display:flex;gap:var(--space-2);align-items:center;font-weight:var(--weight-regular)}.portable-transfer .identity-check input{width:var(--icon-size);height:var(--icon-size);margin:0;order:-1;flex:none;accent-color:var(--primary)}
+.portable-transfer .transfer-tree{max-height:var(--settings-scroll-max-height);overflow:auto;margin:var(--space-3) 0;padding:var(--space-3);border:var(--stroke) solid var(--border);border-radius:var(--radius-control);background:var(--background)}.portable-transfer .transfer-tree-user{padding:var(--space-2) 0;border-bottom:var(--stroke) solid var(--border)}.portable-transfer .transfer-tree-provider{padding-left:var(--space-6)}.portable-transfer .transfer-tree-provider>.identity-check~.identity-check{padding-left:var(--space-6);color:var(--muted-foreground)}
+.portable-transfer pre{max-height:var(--settings-code-max-height);overflow:auto;font:var(--type-caption)/var(--line-body) var(--font-mono);white-space:pre-wrap;overflow-wrap:anywhere;background:var(--muted);border-radius:var(--radius-control);padding:var(--space-3)}.portable-transfer [role=status]{font-size:var(--type-small);overflow-wrap:anywhere}.portable-transfer .transfer-hint{font-size:var(--type-caption);color:var(--muted-foreground);margin-top:var(--space-3)}.portable-transfer button{min-height:var(--control-size);margin:var(--space-2) var(--space-2) var(--space-2) 0}
+@container integration (max-width:37.5rem){.portable-transfer .transfer-card{padding:var(--space-4)}.portable-transfer .transfer-tabs button{flex:1}.portable-transfer .transfer-tree-provider,.portable-transfer .transfer-tree-provider>.identity-check~.identity-check{padding-left:var(--space-3)}}
`;
diff --git a/lib/infra/setup-page.ts b/lib/infra/setup-page.ts
index c1d95d0d..18b718e3 100644
--- a/lib/infra/setup-page.ts
+++ b/lib/infra/setup-page.ts
@@ -6,10 +6,18 @@ import { INTEGRATION_FORM_SCRIPT, INTEGRATION_FORM_STYLE } from "./setup-ui";
import { CONNECTION_MANAGER_SCRIPT, CONNECTION_MANAGER_STYLE } from "./connection-ui";
import { INTEGRATION_BROWSER_SCRIPT } from "./setup-browser";
import { connectionCatalog } from "./connection-registry";
+export const INTEGRATION_PAGE_STYLE = String.raw`
+*{box-sizing:border-box}
+body{margin:0;background:var(--background);padding:var(--space-6);font-family:var(--font-body);color:var(--foreground)}
+.site-bar{max-width:var(--measure);margin:0 auto var(--space-6);font-size:var(--type-small);display:flex;justify-content:space-between;gap:var(--space-3)}
+.site-bar strong{display:flex;align-items:center;gap:var(--space-3);font-weight:var(--weight-strong)}.site-bar svg{width:var(--brand-size);height:var(--brand-size)}.site-bar span{color:var(--muted-foreground)}
+button{border:var(--stroke) solid var(--input);border-radius:var(--radius-control);background:var(--secondary);color:var(--secondary-foreground);padding:var(--space-2) var(--space-3);font:var(--type-small)/var(--line-body) var(--font-body);cursor:pointer}a{color:var(--primary)}
+`;
+
export function integrationSetupPage(embedded = false) {
const nonce = randomBytes(18).toString("base64");
const catalog = JSON.stringify(connectionCatalog()).replace(/</g,"\\u003c");
- const html = `<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta name="referrer" content="no-referrer"><title>Integrations · MSO</title><style nonce="${nonce}">${MSO_WIDGET_TOKENS}${INTEGRATION_FORM_STYLE}${CONNECTION_MANAGER_STYLE}${PORTABILITY_STYLE}*{box-sizing:border-box}body{margin:0;background:var(--surface);padding:clamp(var(--space-4),3vw,40px);font-family:var(--font-body);color:var(--text)}.site-bar{max-width:1180px;margin:0 auto 26px;font-size:var(--type-small);display:flex;justify-content:space-between;gap:var(--space-3)}.site-bar strong{display:flex;align-items:center;gap:var(--space-3);font-weight:750}.site-bar svg{width:30px;height:30px}.site-bar span{color:var(--text-dim)}button{border:var(--stroke) solid var(--sep-strong);border-radius:var(--radius-control);background:var(--field);color:var(--text);padding:var(--space-2) var(--space-3);cursor:pointer}a{color:var(--os-accent)}${embedded ? "html,body{height:100%}body{padding:0;overflow:hidden}.site-bar{display:none}#setup{height:100%}" : ""}</style></head><body><header class="site-bar"><strong>${MSO_LOGO_SVG} MSO</strong><span>Your service connections</span></header><main id="setup" class="integration"><h1>Integrations</h1><p>Preparing the native provider catalog…</p><noscript>Enable JavaScript to open the secure credential form. Credentials can also be entered through the MSO terminal.</noscript></main><script nonce="${nonce}">const INTEGRATIONS_CATALOG=${catalog};${INTEGRATION_FORM_SCRIPT}${CONNECTION_MANAGER_SCRIPT}${PORTABILITY_SCRIPT}${INTEGRATION_BROWSER_SCRIPT}</script></body></html>`;
+ const html = `<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta name="referrer" content="no-referrer"><title>Integrations · MSO</title><style nonce="${nonce}">${MSO_WIDGET_TOKENS}${INTEGRATION_PAGE_STYLE}${INTEGRATION_FORM_STYLE}${CONNECTION_MANAGER_STYLE}${PORTABILITY_STYLE}${embedded ? "html,body{height:100%}body{padding:0;overflow:hidden}.site-bar{display:none}#setup{height:100%}" : ""}</style></head><body><header class="site-bar"><strong>${MSO_LOGO_SVG} MSO</strong><span>Your service connections</span></header><main id="setup" class="integration"><h1>Integrations</h1><p>Preparing the native provider catalog…</p><noscript>Enable JavaScript to open the secure credential form. Credentials can also be entered through the MSO terminal.</noscript></main><script nonce="${nonce}">const INTEGRATIONS_CATALOG=${catalog};${INTEGRATION_FORM_SCRIPT}${CONNECTION_MANAGER_SCRIPT}${PORTABILITY_SCRIPT}${INTEGRATION_BROWSER_SCRIPT}</script></body></html>`;
return { html, csp: `default-src 'none'; script-src 'nonce-${nonce}'; style-src 'nonce-${nonce}'; connect-src 'self'; form-action 'none'; base-uri 'none'; frame-ancestors ${embedded ? "'self'" : "'none'"}` };
}
function integrationResponse(embedded: boolean) {
diff --git a/lib/infra/setup-ui.ts b/lib/infra/setup-ui.ts
index b6775c2d..3408e66f 100644
--- a/lib/infra/setup-ui.ts
+++ b/lib/infra/setup-ui.ts
@@ -2,7 +2,15 @@
// No input, capability, or provider response is sent through the MCP bridge.
export const INTEGRATION_FORM_STYLE = String.raw`
[hidden]{display:none!important}
-.integration{max-width:850px;margin:auto;font:var(--type-small)/1.55 var(--font-body);color:var(--text)}.integration h2{font:700 var(--type-title)/1.25 var(--font-display);margin:0 0 var(--space-2)}.integration p{color:var(--text-dim);margin:var(--space-2) 0 var(--space-3)}.integration .setup-grid{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);gap:var(--space-5)}.integration label{display:block;font-weight:650;margin-bottom:var(--space-1)}.integration input,.integration select{width:100%;min-width:0;border:var(--stroke) solid var(--sep-strong);border-radius:var(--radius-control);background:var(--field);color:var(--text);padding:var(--space-3) var(--space-3);font:var(--type-body) var(--font-body)}.integration .input-row{display:flex;gap:var(--space-2)}.integration .input-row input{flex:1;width:0}.integration button{font-size:var(--type-small);min-height:var(--control-size);white-space:normal}.integration .field{margin-bottom:var(--space-4);min-width:0}.integration small{display:block;margin-top:var(--space-1);color:var(--text-dim);overflow-wrap:anywhere}.integration details{border:var(--stroke) solid var(--sep-strong);border-radius:var(--radius-panel);padding:var(--space-3);background:var(--field);margin:var(--space-3) 0}.integration summary{cursor:pointer;font-weight:650}.integration li{margin:var(--space-2) 0}.integration a{color:var(--os-accent);text-underline-offset:3px;overflow-wrap:anywhere}.integration .setup-status{min-height:28px;overflow-wrap:anywhere}.integration button:disabled{cursor:not-allowed;opacity:.55}.integration .setup-tag{display:inline-block;border:var(--stroke) solid var(--sep-strong);border-radius:var(--radius-pill);padding:3px var(--space-3);margin-bottom:var(--space-3);font-size:var(--type-caption)}.integration .setup-actions{display:flex;gap:var(--space-2);flex-wrap:wrap}.integration .primary{background:var(--text);color:var(--surface);border-color:var(--text)}@container integration (max-width:39rem){.integration .setup-grid{grid-template-columns:1fr;gap:0}.integration h2{font-size:var(--type-title)}}`;
+.integration{max-width:var(--settings-content-width);margin:auto;font:var(--type-small)/var(--line-body) var(--font-body);color:var(--foreground)}
+.integration h2{font:var(--weight-bold) var(--type-title)/var(--line-title) var(--font-display);margin:0 0 var(--space-2)}.integration p{color:var(--muted-foreground);margin:var(--space-2) 0 var(--space-3)}
+.integration .setup-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:var(--space-5)}.integration label{display:block;font-weight:var(--weight-strong);margin-bottom:var(--space-1)}
+.integration input,.integration select{width:100%;min-width:0;min-height:var(--control-size);border:var(--stroke) solid var(--input);border-radius:var(--radius-control);background:var(--secondary);color:var(--foreground);padding:var(--space-2) var(--space-3);font:var(--type-body)/var(--line-body) var(--font-body)}
+.integration .input-row{display:flex;gap:var(--space-2)}.integration .input-row input{flex:1;width:0}.integration button{font-size:var(--type-small);min-height:var(--control-size);white-space:normal}.integration .field{margin-bottom:var(--space-4);min-width:0}.integration small{display:block;margin-top:var(--space-1);color:var(--muted-foreground);overflow-wrap:anywhere}
+.integration details{border:var(--stroke) solid var(--border);border-radius:var(--radius-panel);padding:var(--space-3);background:var(--settings-card);margin:var(--space-3) 0}.integration summary{cursor:pointer;font-weight:var(--weight-strong)}.integration li{margin:var(--space-2) 0}.integration a{color:var(--primary);text-underline-offset:var(--space-1);overflow-wrap:anywhere}.integration .setup-status{min-height:var(--control-size);overflow-wrap:anywhere}.integration button:disabled{cursor:not-allowed;opacity:var(--settings-disabled-opacity)}
+.integration .setup-tag{display:inline-block;border:var(--stroke) solid var(--border);border-radius:var(--radius-pill);padding:var(--space-1) var(--space-3);margin-bottom:var(--space-3);font-size:var(--type-caption);background:var(--muted)}.integration .setup-actions{display:flex;gap:var(--space-2);flex-wrap:wrap}.integration .primary{background:var(--primary);color:var(--primary-foreground);border-color:var(--primary)}
+@container integration (max-width:37.5rem){.integration .setup-grid{grid-template-columns:1fr;gap:0}}
+`;
export const INTEGRATION_FORM_SCRIPT = String.raw`
function integrationNode(tag,value){const n=document.createElement(tag);if(value!==undefined)n.textContent=value;return n}
diff --git a/lib/mcp/toolset.ts b/lib/mcp/toolset.ts
index 782ab0c1..ff8af877 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.3";
-export const MCP_TOOLSET_VERSION = "2026.09.15.2";
-export const MCP_TOOLSET_CHANGED_AT = "2026-09-15T02:00:00+07:00";
+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 type McpToolsetInfo = {
serverVersion: string;
diff --git a/lib/presentation/widget-tokens.ts b/lib/presentation/widget-tokens.ts
index 77824209..675af9f8 100644
--- a/lib/presentation/widget-tokens.ts
+++ b/lib/presentation/widget-tokens.ts
@@ -55,18 +55,38 @@ color-scheme:light;
--font-body:var(--font-family,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif);
--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono",monospace;
--radius:var(--border-radius-md,.5rem);
---radius-control:var(--border-radius-sm,.375rem);
---radius-panel:var(--border-radius-lg,.75rem);
+--radius-control:var(--border-radius-sm,var(--radius));
+--radius-panel:var(--border-radius-lg,var(--radius));
--radius-pill:999px;
--space-1:.25rem;--space-2:.5rem;--space-3:.75rem;--space-4:1rem;--space-5:1.25rem;--space-6:1.5rem;--space-8:2rem;
--type-caption:var(--font-text-xs-size,.75rem);--type-small:var(--font-text-sm-size,.875rem);--type-body:var(--font-text-md-size,1rem);
--type-title:var(--font-heading-md-size,1.5rem);--type-section:var(--font-heading-sm-size,1.125rem);
--line-body:var(--font-text-md-line-height,1.5);--line-title:var(--font-heading-md-line-height,1.25);
---weight-medium:var(--font-weight-medium,500);--weight-strong:var(--font-weight-semibold,600);
+--weight-regular:var(--font-weight-normal,400);--weight-medium:var(--font-weight-medium,500);--weight-strong:var(--font-weight-semibold,600);--weight-bold:var(--font-weight-bold,700);--weight-heavy:var(--font-weight-extrabold,800);
--control-size:2.75rem;--icon-size:1.25rem;--brand-size:2rem;
---stroke:1px;--focus-width:2px;--focus-gap:2px;
+--stroke:1px;--stroke-active:calc(var(--stroke) * 2);--stroke-emphasis:calc(var(--stroke) * 3);--focus-width:2px;--focus-gap:2px;
--measure:72rem;--measure-copy:65ch;
--scroll-thumb:var(--sep-strong);
+/* Shared semantic aliases used by native Settings-like resources. The host may
+ override the source palette/radius/font variables; feature CSS consumes only
+ these semantic tokens rather than owning visual constants. */
+--background:var(--surface);--foreground:var(--text);--card:var(--window-bg);--card-foreground:var(--text);
+--primary:var(--os-accent);--primary-foreground:var(--accent-text);--secondary:var(--field);--secondary-foreground:var(--text);
+--muted:var(--inset);--muted-foreground:var(--text-dim);--border:var(--sep);--input:var(--sep-strong);
+--sidebar:color-mix(in srgb,var(--surface) 72%,var(--field));--sidebar-foreground:var(--text);
+--settings-card:var(--card);--settings-sidebar:var(--sidebar);--settings-canvas:var(--background);
+--settings-selected:var(--primary);--settings-selected-text:var(--primary-foreground);
+--settings-selected-subtle:color-mix(in srgb,var(--settings-selected-text) 14%,transparent);--settings-selected-border:color-mix(in srgb,var(--settings-selected-text) 42%,transparent);
+--settings-success-fill:color-mix(in srgb,var(--success-text) 10%,var(--surface));
+--settings-danger-fill:color-mix(in srgb,var(--destructive-text) 6%,var(--surface));
+--settings-danger-border:color-mix(in srgb,var(--destructive-text) 38%,var(--border));
+--settings-sidebar-width:14rem;--settings-sidebar-sheet-width:18rem;--settings-content-width:48rem;
+--settings-popover-width:calc(var(--control-size)*5);--settings-popover-max-height:calc(var(--control-size)*6);
+--settings-scroll-max-height:calc(var(--control-size)*8);--settings-code-max-height:calc(var(--control-size)*7);
+--settings-nav-icon-size:calc(var(--icon-size) + var(--space-1));--settings-section-icon-size:var(--control-size);
+--settings-overlay:rgba(0,0,0,.38);--settings-transition:160ms ease;--settings-disabled-opacity:.55;--settings-muted-opacity:.72;
+--settings-layer-sticky:10;--settings-layer-backdrop:20;--settings-layer-drawer:30;--settings-layer-popover:40;
+--settings-backdrop-blur:var(--blur,1.5rem);
}
:root[data-theme="dark"]{color-scheme:dark;${DARK_TOKENS}}
@media(prefers-color-scheme:dark){:root:not([data-theme]){color-scheme:dark;${DARK_TOKENS}}}
@@ -87,4 +107,7 @@ export const MSO_HOST_STYLE_ALIASES = {
"--surface": "--color-background-primary", "--field": "--color-background-secondary", "--hover": "--color-background-tertiary",
"--sep": "--color-border-secondary", "--sep-strong": "--color-border-primary", "--os-accent": "--color-text-info",
"--success-text": "--color-text-success", "--destructive-text": "--color-text-danger",
+ "--background": "--color-background-primary", "--foreground": "--color-text-primary", "--card": "--color-background-secondary",
+ "--primary": "--color-text-info", "--muted": "--color-background-tertiary", "--muted-foreground": "--color-text-secondary",
+ "--border": "--color-border-secondary", "--input": "--color-border-primary",
} as const;
diff --git a/package.json b/package.json
index d697e14d..9de1fc11 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "mso",
- "version": "0.2.13",
+ "version": "0.2.14",
"private": true,
"engines": {
"node": ">=20.9",
diff --git a/scripts/e2e/integrations-shell.mjs b/scripts/e2e/integrations-shell.mjs
index 3f9ff450..8a92e01a 100644
--- a/scripts/e2e/integrations-shell.mjs
+++ b/scripts/e2e/integrations-shell.mjs
@@ -21,6 +21,9 @@ try {
const frame = page.frameLocator('iframe[title="MSO native Integrations manager"]');
await expect(frame.getByRole("heading", { name: "GitHub", level: 2, exact: true })).toBeVisible();
await expect(frame.getByRole("link", { name: "Sign in to MSO as Owner" })).toBeVisible();
+ // Native iframe visual tokens follow the live AppShell preset/accent.
+ await page.evaluate(() => document.documentElement.style.setProperty("--accent", "rgb(31, 109, 240)"));
+ await expect.poll(() => frame.locator("html").evaluate((el) => getComputedStyle(el).getPropertyValue("--os-accent").trim())).toBe("rgb(31, 109, 240)");
expect(await page.evaluate(() => document.documentElement.scrollWidth <= innerWidth + 1)).toBe(true);
await page.reload();
await expect(frame.getByRole("heading", { name: "GitHub", level: 2, exact: true })).toBeVisible();