update_html
Write an HTML surface's body. Pass any of html / css / js; omitted fields stay unchanged. Pass empty string to clear. The surface renders in a sandboxed iframe with no access to Dock cookies, storage, or parent DOM, and scripts do not run there today: inline <script> and the js field are stored but never execute. Build pages that work without JavaScript; for interaction use CSS (:hover, :focus, transitions), title= attributes for tooltips, and <details>/<summary> for expanders. External CDN fonts and CSS (Google Fonts, Tailwind CDN, Fontsource), video, audio and CSS animations are fine. Text, numbers and charts go in the html itself. Per-field caps: html 256 KB, css 200 KB, js 200 KB, total 600 KB. The sanitizer is allowlist-based: standard HTML/SVG elements (including <canvas>, forms, <style>, <script>, <link>) and id/class/style/aria-*/data-* attributes are kept; anything off the allowlist is removed — e.g. <iframe>, <object>, <embed>, <meta>, <base>, custom elements, inline on*= event-handler attributes, javascript: and data:text/html URIs. Inline on*= handlers are removed and <script> does not run, so nothing script-driven will work. Call validate_html first: parsed.htmlRemoved lists exactly which tags / tag[attr] would be removed. Layout: Dock renders the surface EDGE-TO-EDGE (full-bleed) inside the workspace — the surface itself is the frame. Do NOT put border-radius, an outer border, or a drop-shadow on the root/outermost element unless the owner explicitly asked for that framing, or the specific design genuinely needs it; keep the page root flush and apply rounding to inner cards only. DESIGN LANGUAGE: Dock injects a base stylesheet into every surface — semantic tokens + a small component kit — that automatically follows each VIEWER's light/dark theme. USE these by default and never hardcode a color, including inside SVG: color SVG with classes or var(--dock-*) in CSS, not hex in fill=/stroke=. A hardcoded color looks broken for a viewer on the other theme (a dark surface for a light-mode viewer, and vice-versa). Tokens: var(--dock-canvas|surface|surface-muted|border|border-strong|text|text-2|text-muted|accent|accent-ink|data|data-strong|good|warn|crit), var(--dock-radius|shadow|gap); font is Inter via var(--dock-font). Component classes: .dock-card, .dock-stat/.dock-stat-value/.dock-stat-label, .dock-delta.up|.down, .dock-badge.good|warn|crit|neutral|accent (add a ), .dock-btn(.primary), .dock-table (use td.name for the primary cell, .dock-num for tabular figures), .dock-grid, .dock-eyebrow, .dock-row, .dock-avatar, .dock-field + .dock-input, .dock-bars/.dock-bar(.hot). Put .dock-num on any number so it aligns. This is a DEFAULT floor: override layout and type freely with your own CSS (nothing in the baseline is !important); colors stay on the tokens. CHARTS: draw them as static inline SVG in html (bars, lines, axes, labels and the numbers in the markup). Never rely on a script to render content: the page must read the same with scripts off, and to get_html. Requires editor role. Returns a short receipt, not the page: { surface_slug, url, updatedAt, bytes: { html, css, js }, sanitized } — sanitized lists any field you sent that the sanitizer changed on write. Before you share the surface's link, read it back with get_html and confirm the content and numbers you meant are there.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| js | No | JS source. Stored alongside html/css but not executed: html surfaces render with scripts off today. 200 KB cap (matches the top-level `update_html` description; the server enforces `HTML_SURFACE_LIMITS.jsBytes` = 200_000). | |
| css | No | CSS source. Applied inside the sandbox iframe. You can also `<link rel="stylesheet">` external stylesheets from any HTTPS CDN (Tailwind CDN, Google Fonts, icon kits); CSS works, scripts do not. | |
| html | No | HTML body. Sanitized server-side (smells stripped; `<script>` and `<link>` are kept, but scripts do not run in the surface today, so use `<link>` for CDN stylesheets and fonts only). Use `validate_html` first for a pre-flight check. | |
| slug | Yes | The workspace slug. | |
| surface_slug | No | Optional html surface slug. Omit to write the primary html surface. |